From: Andrea Amorese Date: Mon, 9 Aug 2021 12:36:47 +0000 (+0200) Subject: Built motion from commit a41f143f.|2.5.32 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%27?a=commitdiff_plain;h=3e49e6224b8066bca8a606e79da5df8e3094bbff;p=motion2.git Built motion from commit a41f143f.|2.5.32 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 8f96375..533cf8b 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-08-09T12:11:44.164Z", + "time": "2021-08-09T12:28:09.084Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index ad7f139..4ec54e8 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-09T12:11:44.164Z", + "time": "2021-08-09T12:28:09.084Z", "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 1c14d25..0807860 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 _0x3117=['jscripty','browser','script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','STRING','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','action','contactManager','motionbar'];(function(_0x5dd408,_0x310804){var _0x5b51bf=function(_0x3168fe){while(--_0x3168fe){_0x5dd408['push'](_0x5dd408['shift']());}};_0x5b51bf(++_0x310804);}(_0x3117,0x125));var _0x7311=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x3117[_0x22ffbf];return _0x360c17;};'use strict';var Sequelize=require('sequelize');module[_0x7311('0x0')]={'name':{'type':Sequelize[_0x7311('0x1')],'get':function(_0x5ab827){return this[_0x7311('0x2')](_0x7311('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7311('0x4'),'integration',_0x7311('0x5'),_0x7311('0x6'),'urlForward',_0x7311('0x7'),'bot',_0x7311('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7311('0x9')},'data3':{'type':Sequelize[_0x7311('0xa')](0x1000),'comment':_0x7311('0xb')},'data4':{'type':Sequelize[_0x7311('0xa')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x7311('0xc')]}}; \ No newline at end of file +var _0x6d5e=['urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','sequelize','exports','getDataValue','action','STRING','integration'];(function(_0x5440d3,_0x68412d){var _0x49b20a=function(_0x328c52){while(--_0x328c52){_0x5440d3['push'](_0x5440d3['shift']());}};_0x49b20a(++_0x68412d);}(_0x6d5e,0xec));var _0xe6d5=function(_0x142ea1,_0x1da77d){_0x142ea1=_0x142ea1-0x0;var _0x235e55=_0x6d5e[_0x142ea1];return _0x235e55;};'use strict';var Sequelize=require(_0xe6d5('0x0'));module[_0xe6d5('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xd13a53){return this[_0xe6d5('0x2')](_0xe6d5('0x3'));}},'action':{'type':Sequelize[_0xe6d5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xe6d5('0x5'),'motionbar','jscripty',_0xe6d5('0x6'),_0xe6d5('0x7'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xe6d5('0x8')},'data1':{'type':Sequelize[_0xe6d5('0x4')](0x1000),'comment':_0xe6d5('0x9')},'data2':{'type':Sequelize[_0xe6d5('0x4')](0x1000),'comment':_0xe6d5('0xa')},'data3':{'type':Sequelize[_0xe6d5('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xe6d5('0x4')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xe6d5('0x4')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c2dc87e..6da5489 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 _0x7c80=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x430b24,_0x1f085e){var _0x5cee14=function(_0x15fcf4){while(--_0x15fcf4){_0x430b24['push'](_0x430b24['shift']());}};_0x5cee14(++_0x1f085e);}(_0x7c80,0x1c5));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x07c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x07c8('0x1'));var jsonpatch=require(_0x07c8('0x2'));var rp=require(_0x07c8('0x3'));var moment=require(_0x07c8('0x4'));var BPromise=require(_0x07c8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x07c8('0x6'));var sox=require(_0x07c8('0x7'));var csv=require(_0x07c8('0x8'));var ejs=require(_0x07c8('0x9'));var fs=require('fs');var fs_extra=require(_0x07c8('0xa'));var _=require('lodash');var squel=require(_0x07c8('0xb'));var crypto=require(_0x07c8('0xc'));var jsforce=require(_0x07c8('0xd'));var deskjs=require(_0x07c8('0xe'));var toCsv=require(_0x07c8('0x8'));var querystring=require(_0x07c8('0xf'));var Papa=require('papaparse');var Redis=require(_0x07c8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x07c8('0x11'));var as=require(_0x07c8('0x12'));var hardwareService=require(_0x07c8('0x13'));var logger=require('../../config/logger')(_0x07c8('0x14'));var utils=require(_0x07c8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x07c8('0x16'));var db=require(_0x07c8('0x17'))['db'];function respondWithStatusCode(_0x78cb76,_0x1dad00){_0x1dad00=_0x1dad00||0xcc;return function(_0x31add3){if(_0x31add3){return _0x78cb76[_0x07c8('0x18')](_0x1dad00);}return _0x78cb76[_0x07c8('0x19')](_0x1dad00)['end']();};}function respondWithResult(_0x27a3a8,_0x3eb0c9){_0x3eb0c9=_0x3eb0c9||0xc8;return function(_0x23e71b){if(_0x23e71b){return _0x27a3a8[_0x07c8('0x19')](_0x3eb0c9)[_0x07c8('0x1a')](_0x23e71b);}};}function respondWithFilteredResult(_0x11fac8,_0x344eaf){return function(_0x4f3dd6){if(_0x4f3dd6){var _0x1f2be9=typeof _0x344eaf[_0x07c8('0x1b')]===_0x07c8('0x1c')&&typeof _0x344eaf[_0x07c8('0x1d')]===_0x07c8('0x1c');var _0x4737a4=_0x4f3dd6[_0x07c8('0x1e')];var _0x4a429b=_0x1f2be9?0x0:_0x344eaf['offset'];var _0x44aa0b=_0x1f2be9?_0x4f3dd6[_0x07c8('0x1e')]:_0x344eaf[_0x07c8('0x1b')]+_0x344eaf[_0x07c8('0x1d')];var _0x409c88;if(_0x44aa0b>=_0x4737a4){_0x44aa0b=_0x4737a4;_0x409c88=0xc8;}else{_0x409c88=0xce;}_0x11fac8[_0x07c8('0x19')](_0x409c88);return _0x11fac8[_0x07c8('0x1f')](_0x07c8('0x20'),_0x4a429b+'-'+_0x44aa0b+'/'+_0x4737a4)[_0x07c8('0x1a')](_0x4f3dd6);}return null;};}function patchUpdates(_0x58fcb0){return function(_0x4f8a3b){try{jsonpatch[_0x07c8('0x21')](_0x4f8a3b,_0x58fcb0,!![]);}catch(_0x385edf){return BPromise[_0x07c8('0x22')](_0x385edf);}return _0x4f8a3b[_0x07c8('0x23')]();};}function saveUpdates(_0x21cefa,_0x2e4715){return function(_0x3fa137){if(_0x3fa137){return _0x3fa137[_0x07c8('0x24')](_0x21cefa)['then'](function(_0x4b289a){return _0x4b289a;});}return null;};}function removeEntity(_0x10a847,_0x14c5db){return function(_0x39578b){if(_0x39578b){return _0x39578b[_0x07c8('0x25')]()[_0x07c8('0x26')](function(){_0x10a847['status'](0xcc)[_0x07c8('0x27')]();});}};}function handleEntityNotFound(_0x25e456,_0x2889cf){return function(_0x1437f9){if(!_0x1437f9){_0x25e456[_0x07c8('0x18')](0x194);}return _0x1437f9;};}function handleError(_0xe7589d,_0x27ff93){_0x27ff93=_0x27ff93||0x1f4;return function(_0xd38f7){logger[_0x07c8('0x28')](_0xd38f7['stack']);if(_0xd38f7[_0x07c8('0x29')]){delete _0xd38f7[_0x07c8('0x29')];}_0xe7589d[_0x07c8('0x19')](_0x27ff93)['send'](_0xd38f7);};}exports[_0x07c8('0x24')]=function(_0x4c9580,_0x2b9292){if(_0x4c9580[_0x07c8('0x2a')]['id']){delete _0x4c9580[_0x07c8('0x2a')]['id'];}return db[_0x07c8('0x2b')][_0x07c8('0x2c')]({'where':{'id':_0x4c9580[_0x07c8('0x2d')]['id']}})[_0x07c8('0x26')](handleEntityNotFound(_0x2b9292,null))['then'](saveUpdates(_0x4c9580[_0x07c8('0x2a')],null))[_0x07c8('0x26')](respondWithResult(_0x2b9292,null))[_0x07c8('0x2e')](handleError(_0x2b9292,null));};exports[_0x07c8('0x25')]=function(_0x45e011,_0x412151){return db[_0x07c8('0x2b')][_0x07c8('0x2c')]({'where':{'id':_0x45e011[_0x07c8('0x2d')]['id']}})[_0x07c8('0x26')](handleEntityNotFound(_0x412151,null))[_0x07c8('0x26')](removeEntity(_0x412151,null))[_0x07c8('0x2e')](handleError(_0x412151,null));}; \ No newline at end of file +var _0x5266=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto'];(function(_0x545053,_0x121b89){var _0x4f53f7=function(_0x8ef6d1){while(--_0x8ef6d1){_0x545053['push'](_0x545053['shift']());}};_0x4f53f7(++_0x121b89);}(_0x5266,0xd9));var _0x6526=function(_0x4536d7,_0x2c14bd){_0x4536d7=_0x4536d7-0x0;var _0x268280=_0x5266[_0x4536d7];return _0x268280;};'use strict';var emlformat=require(_0x6526('0x0'));var rimraf=require(_0x6526('0x1'));var zipdir=require(_0x6526('0x2'));var jsonpatch=require(_0x6526('0x3'));var rp=require('request-promise');var moment=require(_0x6526('0x4'));var BPromise=require(_0x6526('0x5'));var Mustache=require(_0x6526('0x6'));var util=require(_0x6526('0x7'));var path=require('path');var sox=require(_0x6526('0x8'));var csv=require('to-csv');var ejs=require(_0x6526('0x9'));var fs=require('fs');var fs_extra=require(_0x6526('0xa'));var _=require('lodash');var squel=require(_0x6526('0xb'));var crypto=require(_0x6526('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6526('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6526('0xe'));var Papa=require(_0x6526('0xf'));var Redis=require(_0x6526('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6526('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6526('0x12'))(_0x6526('0x13'));var utils=require('../../config/utils');var config=require(_0x6526('0x14'));var licenseUtil=require(_0x6526('0x15'));var db=require(_0x6526('0x16'))['db'];function respondWithStatusCode(_0x473ade,_0x438ecd){_0x438ecd=_0x438ecd||0xcc;return function(_0x3afda6){if(_0x3afda6){return _0x473ade[_0x6526('0x17')](_0x438ecd);}return _0x473ade[_0x6526('0x18')](_0x438ecd)['end']();};}function respondWithResult(_0x4a1c11,_0x5741cf){_0x5741cf=_0x5741cf||0xc8;return function(_0x1152e8){if(_0x1152e8){return _0x4a1c11['status'](_0x5741cf)[_0x6526('0x19')](_0x1152e8);}};}function respondWithFilteredResult(_0x498429,_0x3ebe93){return function(_0x5d5862){if(_0x5d5862){var _0x5d65d6=typeof _0x3ebe93[_0x6526('0x1a')]===_0x6526('0x1b')&&typeof _0x3ebe93[_0x6526('0x1c')]===_0x6526('0x1b');var _0x1ee54d=_0x5d5862[_0x6526('0x1d')];var _0x238b61=_0x5d65d6?0x0:_0x3ebe93[_0x6526('0x1a')];var _0x128f83=_0x5d65d6?_0x5d5862[_0x6526('0x1d')]:_0x3ebe93['offset']+_0x3ebe93[_0x6526('0x1c')];var _0x5c6c8b;if(_0x128f83>=_0x1ee54d){_0x128f83=_0x1ee54d;_0x5c6c8b=0xc8;}else{_0x5c6c8b=0xce;}_0x498429['status'](_0x5c6c8b);return _0x498429['set'](_0x6526('0x1e'),_0x238b61+'-'+_0x128f83+'/'+_0x1ee54d)[_0x6526('0x19')](_0x5d5862);}return null;};}function patchUpdates(_0x223759){return function(_0x5b716e){try{jsonpatch[_0x6526('0x1f')](_0x5b716e,_0x223759,!![]);}catch(_0x17344e){return BPromise[_0x6526('0x20')](_0x17344e);}return _0x5b716e[_0x6526('0x21')]();};}function saveUpdates(_0x133124,_0x589e13){return function(_0x97c8f9){if(_0x97c8f9){return _0x97c8f9[_0x6526('0x22')](_0x133124)[_0x6526('0x23')](function(_0x428239){return _0x428239;});}return null;};}function removeEntity(_0x59b2fa,_0x1e91d8){return function(_0x3241c2){if(_0x3241c2){return _0x3241c2[_0x6526('0x24')]()[_0x6526('0x23')](function(){_0x59b2fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8237,_0x27767e){return function(_0x891028){if(!_0x891028){_0x4a8237[_0x6526('0x17')](0x194);}return _0x891028;};}function handleError(_0x1f449a,_0xecd117){_0xecd117=_0xecd117||0x1f4;return function(_0x23019e){logger[_0x6526('0x25')](_0x23019e[_0x6526('0x26')]);if(_0x23019e[_0x6526('0x27')]){delete _0x23019e['name'];}_0x1f449a[_0x6526('0x18')](_0xecd117)[_0x6526('0x28')](_0x23019e);};}exports['update']=function(_0x5d2941,_0x5dd583){if(_0x5d2941[_0x6526('0x29')]['id']){delete _0x5d2941[_0x6526('0x29')]['id'];}return db['Action'][_0x6526('0x2a')]({'where':{'id':_0x5d2941[_0x6526('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5dd583,null))['then'](saveUpdates(_0x5d2941[_0x6526('0x29')],null))[_0x6526('0x23')](respondWithResult(_0x5dd583,null))[_0x6526('0x2c')](handleError(_0x5dd583,null));};exports['destroy']=function(_0x13219a,_0x2f921c){return db[_0x6526('0x2d')]['find']({'where':{'id':_0x13219a[_0x6526('0x2b')]['id']}})[_0x6526('0x23')](handleEntityNotFound(_0x2f921c,null))[_0x6526('0x23')](removeEntity(_0x2f921c,null))[_0x6526('0x2c')](handleError(_0x2f921c,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index cba7a0b..9c57518 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 _0xd4cb=['moment','bluebird','rimraf','../../config/environment','Action','lodash','util','../../config/logger','api'];(function(_0x21b037,_0x1f310a){var _0x20556c=function(_0x1855a9){while(--_0x1855a9){_0x21b037['push'](_0x21b037['shift']());}};_0x20556c(++_0x1f310a);}(_0xd4cb,0x9e));var _0xbd4c=function(_0x16fc7a,_0x3ee6d2){_0x16fc7a=_0x16fc7a-0x0;var _0x5b5f74=_0xd4cb[_0x16fc7a];return _0x5b5f74;};'use strict';var _=require(_0xbd4c('0x0'));var util=require(_0xbd4c('0x1'));var logger=require(_0xbd4c('0x2'))(_0xbd4c('0x3'));var moment=require(_0xbd4c('0x4'));var BPromise=require(_0xbd4c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd4c('0x6'));var config=require(_0xbd4c('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x14bb59,_0x167de5){return _0x14bb59['define'](_0xbd4c('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dc0=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','tools_actions'];(function(_0x4af8cf,_0x51a87c){var _0x1cb78d=function(_0x49de71){while(--_0x49de71){_0x4af8cf['push'](_0x4af8cf['shift']());}};_0x1cb78d(++_0x51a87c);}(_0x7dc0,0xe4));var _0x07dc=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x7dc0[_0x39caaa];return _0x9b9c7d;};'use strict';var _=require(_0x07dc('0x0'));var util=require(_0x07dc('0x1'));var logger=require(_0x07dc('0x2'))(_0x07dc('0x3'));var moment=require('moment');var BPromise=require(_0x07dc('0x4'));var rp=require(_0x07dc('0x5'));var fs=require('fs');var path=require(_0x07dc('0x6'));var rimraf=require(_0x07dc('0x7'));var config=require(_0x07dc('0x8'));var attributes=require(_0x07dc('0x9'));module['exports']=function(_0x1e0eb1,_0x462284){return _0x1e0eb1[_0x07dc('0xa')]('Action',attributes,{'tableName':_0x07dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 081da78..1538d74 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4a1628,_0x184d58){var _0x1e8b5e=function(_0x45b138){while(--_0x45b138){_0x4a1628['push'](_0x4a1628['shift']());}};_0x1e8b5e(++_0x184d58);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'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')]('Action,\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);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x79c6de,_0x10de94){var _0x321a56=function(_0x2e313e){while(--_0x2e313e){_0x79c6de['push'](_0x79c6de['shift']());}};_0x321a56(++_0x10de94);}(_0x5fab,0x177));var _0xb5fa=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0x5fab[_0x3186aa];return _0x2d8c36;};'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']('Action,\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')]('Action,\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']('Action,\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/action/index.js b/server/api/action/index.js index 4c48013..f2ece1b 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 _0x360d=['delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x10751e,_0x1e937d){var _0x2d04fc=function(_0x3673a0){while(--_0x3673a0){_0x10751e['push'](_0x10751e['shift']());}};_0x2d04fc(++_0x1e937d);}(_0x360d,0x188));var _0xd360=function(_0x5a0d6c,_0x180ba4){_0x5a0d6c=_0x5a0d6c-0x0;var _0x1b9fc1=_0x360d[_0x5a0d6c];return _0x1b9fc1;};'use strict';var multer=require(_0xd360('0x0'));var util=require(_0xd360('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd360('0x2'));var router=express[_0xd360('0x3')]();var fs_extra=require(_0xd360('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd360('0x5'));var config=require(_0xd360('0x6'));var controller=require(_0xd360('0x7'));router[_0xd360('0x8')](_0xd360('0x9'),auth[_0xd360('0xa')](),controller['update']);router[_0xd360('0xb')](_0xd360('0x9'),auth[_0xd360('0xa')](),controller['destroy']);module[_0xd360('0xc')]=router; \ No newline at end of file +var _0xec92=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x126b70,_0x390b37){var _0x2b8337=function(_0x2e43ad){while(--_0x2e43ad){_0x126b70['push'](_0x126b70['shift']());}};_0x2b8337(++_0x390b37);}(_0xec92,0x6f));var _0x2ec9=function(_0x168254,_0x34240d){_0x168254=_0x168254-0x0;var _0xa5adc8=_0xec92[_0x168254];return _0xa5adc8;};'use strict';var multer=require(_0x2ec9('0x0'));var util=require(_0x2ec9('0x1'));var path=require(_0x2ec9('0x2'));var timeout=require(_0x2ec9('0x3'));var express=require(_0x2ec9('0x4'));var router=express[_0x2ec9('0x5')]();var fs_extra=require(_0x2ec9('0x6'));var auth=require(_0x2ec9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2ec9('0x8'));var controller=require(_0x2ec9('0x9'));router[_0x2ec9('0xa')](_0x2ec9('0xb'),auth[_0x2ec9('0xc')](),controller[_0x2ec9('0xd')]);router[_0x2ec9('0xe')]('/:id',auth[_0x2ec9('0xc')](),controller[_0x2ec9('0xf')]);module[_0x2ec9('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 8457153..2396ea4 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 _0x8958=['TEXT','exports'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x8958,0x93));var _0x8895=function(_0x13e875,_0x5c7330){_0x13e875=_0x13e875-0x0;var _0x5c4ab2=_0x8958[_0x13e875];return _0x5c4ab2;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xae24=['sequelize','STRING'];(function(_0x3d5587,_0x36057c){var _0x406893=function(_0x4bb8c9){while(--_0x4bb8c9){_0x3d5587['push'](_0x3d5587['shift']());}};_0x406893(++_0x36057c);}(_0xae24,0x182));var _0x4ae2=function(_0x4995a1,_0x47ddde){_0x4995a1=_0x4995a1-0x0;var _0x803fe4=_0xae24[_0x4995a1];return _0x803fe4;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6b2c6fa..b189a4f 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 _0xe03b=['runReport','SUM(%s)','IS\x20NOT\x20NULL','condition','parentKey','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','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/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','map','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','operator','rules','group','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignKey','foreignTable','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','IS\x20EMPTY','Sequelize','DESC','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0xd04cb3,_0x3b51d5){var _0x3281d3=function(_0x466664){while(--_0x466664){_0xd04cb3['push'](_0xd04cb3['shift']());}};_0x3281d3(++_0x3b51d5);}(_0xe03b,0x155));var _0xbe03=function(_0x9b1959,_0x47d5dd){_0x9b1959=_0x9b1959-0x0;var _0x2d3ce4=_0xe03b[_0x9b1959];return _0x2d3ce4;};'use strict';var emlformat=require(_0xbe03('0x0'));var rimraf=require(_0xbe03('0x1'));var zipdir=require(_0xbe03('0x2'));var jsonpatch=require(_0xbe03('0x3'));var rp=require('request-promise');var moment=require(_0xbe03('0x4'));var BPromise=require(_0xbe03('0x5'));var Mustache=require('mustache');var util=require(_0xbe03('0x6'));var path=require(_0xbe03('0x7'));var sox=require(_0xbe03('0x8'));var csv=require(_0xbe03('0x9'));var ejs=require(_0xbe03('0xa'));var fs=require('fs');var fs_extra=require(_0xbe03('0xb'));var _=require(_0xbe03('0xc'));var squel=require(_0xbe03('0xd'));var crypto=require(_0xbe03('0xe'));var jsforce=require(_0xbe03('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbe03('0x9'));var querystring=require('querystring');var Papa=require(_0xbe03('0x10'));var Redis=require(_0xbe03('0x11'));var authService=require(_0xbe03('0x12'));var qs=require(_0xbe03('0x13'));var as=require(_0xbe03('0x14'));var hardwareService=require(_0xbe03('0x15'));var logger=require(_0xbe03('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xbe03('0x17'));var licenseUtil=require(_0xbe03('0x18'));var db=require(_0xbe03('0x19'))['db'];var dbH=require(_0xbe03('0x19'))['dbH'];function respondWithStatusCode(_0x4e700d,_0x17bd00){_0x17bd00=_0x17bd00||0xcc;return function(_0x3ed64f){if(_0x3ed64f){return _0x4e700d[_0xbe03('0x1a')](_0x17bd00);}return _0x4e700d['status'](_0x17bd00)[_0xbe03('0x1b')]();};}function respondWithResult(_0x1d3f69,_0x24a238){_0x24a238=_0x24a238||0xc8;return function(_0x26a094){if(_0x26a094){return _0x1d3f69[_0xbe03('0x1c')](_0x24a238)[_0xbe03('0x1d')](_0x26a094);}};}function respondWithFilteredResult(_0xdfc434,_0x53935a){return function(_0xe11982){if(_0xe11982){var _0x26137=typeof _0x53935a[_0xbe03('0x1e')]===_0xbe03('0x1f')&&typeof _0x53935a[_0xbe03('0x20')]===_0xbe03('0x1f');var _0x41f5ff=_0xe11982[_0xbe03('0x21')];var _0x1c4781=_0x26137?0x0:_0x53935a[_0xbe03('0x1e')];var _0x28999d=_0x26137?_0xe11982[_0xbe03('0x21')]:_0x53935a['offset']+_0x53935a['limit'];var _0x2d97f5;if(_0x28999d>=_0x41f5ff){_0x28999d=_0x41f5ff;_0x2d97f5=0xc8;}else{_0x2d97f5=0xce;}_0xdfc434[_0xbe03('0x1c')](_0x2d97f5);return _0xdfc434[_0xbe03('0x22')](_0xbe03('0x23'),_0x1c4781+'-'+_0x28999d+'/'+_0x41f5ff)[_0xbe03('0x1d')](_0xe11982);}return null;};}function patchUpdates(_0x984e02){return function(_0x6d9b38){try{jsonpatch[_0xbe03('0x24')](_0x6d9b38,_0x984e02,!![]);}catch(_0x372e45){return BPromise[_0xbe03('0x25')](_0x372e45);}return _0x6d9b38[_0xbe03('0x26')]();};}function saveUpdates(_0x415d8c,_0x4733e4){return function(_0x1ef582){if(_0x1ef582){return _0x1ef582[_0xbe03('0x27')](_0x415d8c)[_0xbe03('0x28')](function(_0x5ee058){return _0x5ee058;});}return null;};}function removeEntity(_0x41a7e3,_0x9d1745){return function(_0x3e7b0b){if(_0x3e7b0b){return _0x3e7b0b['destroy']()[_0xbe03('0x28')](function(){var _0x31199e=_0x3e7b0b[_0xbe03('0x29')]({'plain':!![]});var _0x17a986='CustomReports';return db[_0xbe03('0x2a')][_0xbe03('0x2b')]({'where':{'type':_0x17a986,'resourceId':_0x31199e['id']}})[_0xbe03('0x28')](function(){return _0x3e7b0b;});})[_0xbe03('0x28')](function(){_0x41a7e3[_0xbe03('0x1c')](0xcc)[_0xbe03('0x1b')]();});}};}function handleEntityNotFound(_0x5e8ac2,_0x150705){return function(_0x37b876){if(!_0x37b876){_0x5e8ac2['sendStatus'](0x194);}return _0x37b876;};}function handleError(_0x2032b5,_0xdf97f2){_0xdf97f2=_0xdf97f2||0x1f4;return function(_0x542fb1){logger[_0xbe03('0x2c')](_0x542fb1[_0xbe03('0x2d')]);if(_0x542fb1[_0xbe03('0x2e')]){delete _0x542fb1[_0xbe03('0x2e')];}_0x2032b5[_0xbe03('0x1c')](_0xdf97f2)['send'](_0x542fb1);};}exports['index']=function(_0xa15b16,_0x819c2d){var _0x4ae740={},_0x435365={},_0xa8c5da={'count':0x0,'rows':[]};var _0x43ed2b=_[_0xbe03('0x2f')](db['AnalyticCustomReport'][_0xbe03('0x30')],function(_0x487867){return{'name':_0x487867['fieldName'],'type':_0x487867[_0xbe03('0x31')]['key']};});_0x435365['model']=_[_0xbe03('0x2f')](_0x43ed2b,_0xbe03('0x2e'));_0x435365['query']=_[_0xbe03('0x32')](_0xa15b16[_0xbe03('0x33')]);_0x435365[_0xbe03('0x34')]=_[_0xbe03('0x35')](_0x435365[_0xbe03('0x36')],_0x435365['query']);_0x4ae740[_0xbe03('0x37')]=_[_0xbe03('0x35')](_0x435365[_0xbe03('0x36')],qs[_0xbe03('0x38')](_0xa15b16[_0xbe03('0x33')][_0xbe03('0x38')]));_0x4ae740['attributes']=_0x4ae740[_0xbe03('0x37')]['length']?_0x4ae740[_0xbe03('0x37')]:_0x435365['model'];if(!_0xa15b16[_0xbe03('0x33')][_0xbe03('0x39')](_0xbe03('0x3a'))){_0x4ae740[_0xbe03('0x20')]=qs[_0xbe03('0x20')](_0xa15b16[_0xbe03('0x33')][_0xbe03('0x20')]);_0x4ae740[_0xbe03('0x1e')]=qs[_0xbe03('0x1e')](_0xa15b16[_0xbe03('0x33')]['offset']);}_0x4ae740[_0xbe03('0x3b')]=qs[_0xbe03('0x3c')](_0xa15b16[_0xbe03('0x33')][_0xbe03('0x3c')]);_0x4ae740['where']=qs[_0xbe03('0x34')](_['pick'](_0xa15b16[_0xbe03('0x33')],_0x435365[_0xbe03('0x34')]),_0x43ed2b);if(_0xa15b16[_0xbe03('0x33')][_0xbe03('0x3d')]){_0x4ae740[_0xbe03('0x3e')]=_[_0xbe03('0x3f')](_0x4ae740['where'],{'$or':_[_0xbe03('0x2f')](_0x43ed2b,function(_0x4e7895){if(_0x4e7895['type']!=='VIRTUAL'){var _0x45c0d2={};_0x45c0d2[_0x4e7895['name']]={'$like':'%'+_0xa15b16[_0xbe03('0x33')][_0xbe03('0x3d')]+'%'};return _0x45c0d2;}})});}_0x4ae740=_[_0xbe03('0x3f')]({},_0x4ae740,_0xa15b16[_0xbe03('0x40')]);var _0x5f592e={'where':_0x4ae740[_0xbe03('0x3e')]};return db[_0xbe03('0x41')][_0xbe03('0x21')](_0x5f592e)[_0xbe03('0x28')](function(_0x136d12){_0xa8c5da[_0xbe03('0x21')]=_0x136d12;if(_0xa15b16['query'][_0xbe03('0x42')]){_0x4ae740[_0xbe03('0x43')]=[{'all':!![]}];}return db[_0xbe03('0x41')][_0xbe03('0x44')](_0x4ae740);})[_0xbe03('0x28')](function(_0x2bdb9e){_0xa8c5da[_0xbe03('0x45')]=_0x2bdb9e;return _0xa8c5da;})['then'](respondWithFilteredResult(_0x819c2d,_0x4ae740))[_0xbe03('0x46')](handleError(_0x819c2d,null));};exports['show']=function(_0x569f7a,_0x252e51){var _0x31a366={'raw':![],'where':{'id':_0x569f7a[_0xbe03('0x47')]['id']}},_0x145f8a={};_0x145f8a['model']=_[_0xbe03('0x32')](db['AnalyticCustomReport'][_0xbe03('0x30')]);_0x145f8a['query']=_[_0xbe03('0x32')](_0x569f7a[_0xbe03('0x33')]);_0x145f8a[_0xbe03('0x34')]=_[_0xbe03('0x35')](_0x145f8a[_0xbe03('0x36')],_0x145f8a[_0xbe03('0x33')]);_0x31a366[_0xbe03('0x37')]=_[_0xbe03('0x35')](_0x145f8a[_0xbe03('0x36')],qs[_0xbe03('0x38')](_0x569f7a[_0xbe03('0x33')]['fields']));_0x31a366[_0xbe03('0x37')]=_0x31a366[_0xbe03('0x37')][_0xbe03('0x48')]?_0x31a366['attributes']:_0x145f8a['model'];if(_0x569f7a[_0xbe03('0x33')][_0xbe03('0x42')]){_0x31a366[_0xbe03('0x43')]=[{'all':!![]}];}_0x31a366=_[_0xbe03('0x3f')]({},_0x31a366,_0x569f7a[_0xbe03('0x40')]);return db[_0xbe03('0x41')][_0xbe03('0x49')](_0x31a366)[_0xbe03('0x28')](handleEntityNotFound(_0x252e51,null))[_0xbe03('0x28')](respondWithResult(_0x252e51,null))['catch'](handleError(_0x252e51,null));};exports['create']=function(_0x44a9aa,_0x411a3f){return db[_0xbe03('0x41')][_0xbe03('0x4a')](_0x44a9aa[_0xbe03('0x4b')],{})[_0xbe03('0x28')](function(_0x2fda68){var _0x5407dc=_0x44a9aa[_0xbe03('0x4c')][_0xbe03('0x29')]({'plain':!![]});if(!_0x5407dc)throw new Error(_0xbe03('0x4d'));if(_0x5407dc[_0xbe03('0x4e')]===_0xbe03('0x4c')){var _0x1f46a8=_0x2fda68[_0xbe03('0x29')]({'plain':!![]});var _0xde40bb=_0xbe03('0x4f');return db[_0xbe03('0x50')][_0xbe03('0x49')]({'where':{'name':_0xde40bb,'userProfileId':_0x5407dc[_0xbe03('0x51')]},'raw':!![]})['then'](function(_0x313c5b){if(_0x313c5b&&_0x313c5b['autoAssociation']===0x0){return db[_0xbe03('0x2a')]['create']({'name':_0x1f46a8['name'],'resourceId':_0x1f46a8['id'],'type':_0xbe03('0x52'),'sectionId':_0x313c5b['id']},{})['then'](function(){return _0x2fda68;});}else{return _0x2fda68;}})[_0xbe03('0x46')](function(_0x335cd3){logger['error'](_0xbe03('0x53'),_0x335cd3);throw _0x335cd3;});}return _0x2fda68;})['then'](respondWithResult(_0x411a3f,0xc9))[_0xbe03('0x46')](handleError(_0x411a3f,null));};exports['update']=function(_0x1e8b99,_0x5ee13e){if(_0x1e8b99[_0xbe03('0x4b')]['id']){delete _0x1e8b99['body']['id'];}return db['AnalyticCustomReport'][_0xbe03('0x49')]({'where':{'id':_0x1e8b99['params']['id']}})['then'](handleEntityNotFound(_0x5ee13e,null))[_0xbe03('0x28')](saveUpdates(_0x1e8b99['body'],null))[_0xbe03('0x28')](respondWithResult(_0x5ee13e,null))['catch'](handleError(_0x5ee13e,null));};exports[_0xbe03('0x2b')]=function(_0x533e1f,_0xc64073){return db[_0xbe03('0x41')]['find']({'where':{'id':_0x533e1f['params']['id']}})[_0xbe03('0x28')](handleEntityNotFound(_0xc64073,null))[_0xbe03('0x28')](removeEntity(_0xc64073,null))[_0xbe03('0x46')](handleError(_0xc64073,null));};exports[_0xbe03('0x54')]=function(_0x2f4e52,_0x4d57b5){var _0x52487b=0xa;var _0x53c9bf=[_0xbe03('0x55'),_0xbe03('0x56'),_0xbe03('0x57'),'cross_join'];var _0x4a2c3b={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbe03('0x58'),'MAX':'MAX(%s)','MIN':_0xbe03('0x59'),'AVG':_0xbe03('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbe03('0x5b'),'GROUP_CONCAT DESC':_0xbe03('0x5c')};var _0x5c9312={'SEC_TO_TIME':_0xbe03('0x5d'),'DATE':_0xbe03('0x5e'),'HOUR':_0xbe03('0x5f'),'ROUND':_0xbe03('0x60'),'UNIX_TIMESTAMP':_0xbe03('0x61')};var _0xc80405=function(_0x257385){return!_[_0xbe03('0x62')]([_0xbe03('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xbe03('0x64')],_0x257385);};var _0x4392a5=function(_0x1feb71){if(!_0x1feb71||!_0x1feb71['rules'][_0xbe03('0x48')]){return'';}for(var _0x434f4c='(',_0x15d262=0x0;_0x15d262<_0x1feb71['rules'][_0xbe03('0x48')];_0x15d262+=0x1){_0x15d262>0x0&&(_0x434f4c+='\x20'+_0x1feb71[_0xbe03('0x65')]+'\x20');_0x434f4c+=_0x1feb71[_0xbe03('0x66')][_0x15d262][_0xbe03('0x67')]?_0x4392a5(_0x1feb71[_0xbe03('0x66')][_0x15d262][_0xbe03('0x67')]):_0x1feb71[_0xbe03('0x66')][_0x15d262]['field']+'\x20'+_0x1feb71[_0xbe03('0x66')][_0x15d262]['condition']+(_0xc80405(_0x1feb71[_0xbe03('0x66')][_0x15d262]['condition'])?'\x20'+_0x1feb71[_0xbe03('0x66')][_0x15d262][_0xbe03('0x68')]:'');}return _0x434f4c+')';};var _0x2eb574={'where':{'id':_0x2f4e52[_0xbe03('0x47')]['id']}},_0x3ae25d,_0x46e627,_0x23ccc5,_0x51c321,_0x2ca239;_0x2eb574=_[_0xbe03('0x3f')]({},_0x2eb574,_0x2f4e52['options']);return db['AnalyticCustomReport']['find'](_0x2eb574)['then'](function(_0x3bead7){if(_0x3bead7){_0x3ae25d=_0x3bead7;return _0x3bead7[_0xbe03('0x69')]();}return null;})['then'](function(_0x12672e){if(_0x12672e){if(!_0x12672e[_0xbe03('0x48')]){throw new db['Sequelize'][(_0xbe03('0x6a'))](_0xbe03('0x6b'),0x193);}_0x46e627=_0x12672e;return db[_0xbe03('0x6c')][_0xbe03('0x44')]({'raw':!![]});}return null;})[_0xbe03('0x28')](function(_0x5282a3){if(_0x5282a3){_0x23ccc5=_[_0xbe03('0x6d')](_0x5282a3,'id');var _0x1c5b2a;var _0x1eeb66=squel[_0xbe03('0x6e')]();_0x1eeb66[_0xbe03('0x6f')](_0x3ae25d['table']);for(var _0x86fd9f=0x0;_0x86fd9f<_0x46e627[_0xbe03('0x48')];_0x86fd9f+=0x1){_0x1c5b2a=_0x46e627[_0x86fd9f][_0xbe03('0x70')]?_0x23ccc5[_0x46e627[_0x86fd9f][_0xbe03('0x70')]][_0xbe03('0x71')]:_0x46e627[_0x86fd9f][_0xbe03('0x72')];_0x1c5b2a=_0x46e627[_0x86fd9f][_0xbe03('0x73')]?_[_0xbe03('0x74')](_0x4a2c3b[_0x46e627[_0x86fd9f][_0xbe03('0x73')]],'%s',_0x1c5b2a):_0x1c5b2a;_0x1c5b2a=_0x46e627[_0x86fd9f]['format']?_[_0xbe03('0x74')](_0x5c9312[_0x46e627[_0x86fd9f][_0xbe03('0x75')]],'%s',_0x1c5b2a):_0x1c5b2a;if(_0x46e627[_0x86fd9f][_0xbe03('0x76')]){_0x1eeb66[_0xbe03('0x67')](_0x1c5b2a);}_0x46e627[_0x86fd9f][_0xbe03('0x77')]&&_0x1eeb66['order'](_0x1c5b2a,_0x46e627[_0x86fd9f][_0xbe03('0x77')]==='DESC'?![]:!![]);_0x1eeb66[_0xbe03('0x72')](_0x1c5b2a,_0x46e627[_0x86fd9f][_0xbe03('0x78')]||_0x1c5b2a);}if(_0x3ae25d['joins']){_0x3ae25d[_0xbe03('0x79')]=JSON[_0xbe03('0x7a')](_0x3ae25d[_0xbe03('0x79')]);for(var _0x21f2d1=0x0;_0x21f2d1<_0x3ae25d['joins'][_0xbe03('0x48')];_0x21f2d1+=0x1){if(_0x3ae25d['joins'][_0x21f2d1][_0xbe03('0x31')]&&_[_0xbe03('0x62')](_0x53c9bf,_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['type'])&&_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['parentKey']&&_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['foreignTable']&&_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x7b')]){_0x1eeb66[_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x31')]](_0x3ae25d['joins'][_0x21f2d1][_0xbe03('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3ae25d[_0xbe03('0x7d')],_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['parentKey'],_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x7c')],_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x7b')]));}}}if(_0x3ae25d[_0xbe03('0x7e')]){_0x3ae25d[_0xbe03('0x7e')]=JSON['parse'](_0x3ae25d[_0xbe03('0x7e')]);_0x1eeb66['where'](_0x4392a5(_0x3ae25d[_0xbe03('0x7e')][_0xbe03('0x67')]));}_0x2ca239=_0x1eeb66[_0xbe03('0x7f')]();_0x1eeb66[_0xbe03('0x20')](_0x52487b);_0x1eeb66[_0xbe03('0x1e')](0x0);logger[_0xbe03('0x80')](_0xbe03('0x81'),_0x1eeb66[_0xbe03('0x82')]());return dbH[_0xbe03('0x83')]['query'](_0x1eeb66[_0xbe03('0x82')](),{'type':dbH[_0xbe03('0x83')][_0xbe03('0x84')][_0xbe03('0x85')]});}})[_0xbe03('0x28')](respondWithResult(_0x4d57b5,null))[_0xbe03('0x46')](handleError(_0x4d57b5,null));};function runReport(_0x4e6d0a,_0x479807,_0x4a361b){var _0x28392a=_0x479807[_0xbe03('0x2e')];var _0x2677a2=0xa;var _0x3f55ad=[_0xbe03('0x55'),_0xbe03('0x56'),_0xbe03('0x57'),_0xbe03('0x86')];var _0x26f44d={'SUM':'SUM(%s)','COUNT':_0xbe03('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xbe03('0x88'),'MIN':_0xbe03('0x59'),'AVG':_0xbe03('0x5a'),'GROUP_CONCAT':_0xbe03('0x89'),'GROUP_CONCAT ASC':_0xbe03('0x5b'),'GROUP_CONCAT DESC':_0xbe03('0x5c')};var _0x1cc44a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbe03('0x5e'),'HOUR':_0xbe03('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbe03('0x61')};var _0x2c5ac4=function(_0x643854){return!_[_0xbe03('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbe03('0x8a'),_0xbe03('0x64')],_0x643854);};var _0x11aa6d=function(_0x4c430f){if(!_0x4c430f||!_0x4c430f[_0xbe03('0x66')][_0xbe03('0x48')]){return'';}for(var _0x27f8be='(',_0x19eb17=0x0;_0x19eb17<_0x4c430f[_0xbe03('0x66')][_0xbe03('0x48')];_0x19eb17+=0x1){_0x19eb17>0x0&&(_0x27f8be+='\x20'+_0x4c430f['operator']+'\x20');_0x27f8be+=_0x4c430f[_0xbe03('0x66')][_0x19eb17]['group']?_0x11aa6d(_0x4c430f[_0xbe03('0x66')][_0x19eb17]['group']):_0x4c430f[_0xbe03('0x66')][_0x19eb17]['field']+'\x20'+_0x4c430f['rules'][_0x19eb17]['condition']+(_0x2c5ac4(_0x4c430f[_0xbe03('0x66')][_0x19eb17]['condition'])?'\x20'+_0x4c430f[_0xbe03('0x66')][_0x19eb17][_0xbe03('0x68')]:'');}return _0x27f8be+')';};var _0x5857b9={'where':{'id':_0x4e6d0a['id']}},_0x43cfc0,_0x448d96,_0x426121,_0x2607aa,_0x1eb5a7;_0x5857b9=_[_0xbe03('0x3f')]({},_0x5857b9,_0x4a361b);return db[_0xbe03('0x41')]['find'](_0x5857b9)[_0xbe03('0x28')](function(_0x2c0626){if(_0x2c0626){_0x43cfc0=_0x2c0626;return _0x2c0626[_0xbe03('0x69')]();}return null;})[_0xbe03('0x28')](function(_0xcd940b){if(_0xcd940b){if(!_0xcd940b[_0xbe03('0x48')]){throw new db[(_0xbe03('0x8b'))][(_0xbe03('0x6a'))](_0xbe03('0x6b'),0x193);}_0x448d96=_0xcd940b;return db[_0xbe03('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xbe03('0x28')](function(_0x4ad8cf){if(_0x4ad8cf){_0x426121=_[_0xbe03('0x6d')](_0x4ad8cf,'id');var _0x4c692c;var _0xbf297=squel[_0xbe03('0x6e')]();_0xbf297[_0xbe03('0x6f')](_0x43cfc0['table']);for(var _0x4ad204=0x0;_0x4ad204<_0x448d96[_0xbe03('0x48')];_0x4ad204+=0x1){_0x4c692c=_0x448d96[_0x4ad204][_0xbe03('0x70')]?_0x426121[_0x448d96[_0x4ad204][_0xbe03('0x70')]][_0xbe03('0x71')]:_0x448d96[_0x4ad204]['field'];_0x4c692c=_0x448d96[_0x4ad204][_0xbe03('0x73')]?_[_0xbe03('0x74')](_0x26f44d[_0x448d96[_0x4ad204]['function']],'%s',_0x4c692c):_0x4c692c;_0x4c692c=_0x448d96[_0x4ad204][_0xbe03('0x75')]?_[_0xbe03('0x74')](_0x1cc44a[_0x448d96[_0x4ad204][_0xbe03('0x75')]],'%s',_0x4c692c):_0x4c692c;if(_0x448d96[_0x4ad204]['groupBy']){_0xbf297['group'](_0x4c692c);}_0x448d96[_0x4ad204][_0xbe03('0x77')]&&_0xbf297[_0xbe03('0x3b')](_0x4c692c,_0x448d96[_0x4ad204]['orderBy']===_0xbe03('0x8c')?![]:!![]);_0xbf297[_0xbe03('0x72')](_0x4c692c,_0x448d96[_0x4ad204][_0xbe03('0x78')]||_0x4c692c);}if(_0x43cfc0[_0xbe03('0x79')]){_0x43cfc0[_0xbe03('0x79')]=JSON[_0xbe03('0x7a')](_0x43cfc0[_0xbe03('0x79')]);for(var _0xa0b3c2=0x0;_0xa0b3c2<_0x43cfc0['joins'][_0xbe03('0x48')];_0xa0b3c2+=0x1){if(_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x31')]&&_[_0xbe03('0x62')](_0x3f55ad,_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x31')])&&_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['parentKey']&&_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['foreignTable']&&_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['foreignKey']){_0xbf297[_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x31')]](_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x7c')],null,util['format'](_0xbe03('0x8d'),_0x43cfc0[_0xbe03('0x7d')],_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['parentKey'],_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x7c')],_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x7b')]));}}}if(_0x43cfc0[_0xbe03('0x7e')]){_0x43cfc0['conditions']=JSON[_0xbe03('0x7a')](_0x43cfc0[_0xbe03('0x7e')]);_0xbf297[_0xbe03('0x3e')](_0x11aa6d(_0x43cfc0['conditions'][_0xbe03('0x67')]));}_0x1eb5a7=_0xbf297[_0xbe03('0x7f')]();_0xbf297['limit'](_0x2677a2);_0xbf297[_0xbe03('0x1e')](0x0);return;}})[_0xbe03('0x28')](function(){if(_0x479807[_0xbe03('0x8e')]==='web'){return null;}var _0x546abc=_[_0xbe03('0x3f')](_0x479807,{'name':_0x479807[_0xbe03('0x8f')]||_0x479807['name']||_0x43cfc0[_0xbe03('0x2e')],'basename':_0x28392a,'savename':util['format'](_0xbe03('0x90'),_0x479807['name']||_0x43cfc0['name'],require(_0xbe03('0x91'))[_0xbe03('0x92')](0x4),_0x479807[_0xbe03('0x8e')]||_0xbe03('0x93')),'reportId':_0x43cfc0['id'],'reportType':_0xbe03('0x94')});return db[_0xbe03('0x95')]['create'](_0x546abc,{'raw':!![]});})['then'](function(_0x6daedd){if(_0x43cfc0['table']===_0xbe03('0x96')){_0x1eb5a7[_0xbe03('0x3e')](_0x43cfc0[_0xbe03('0x7d')]+_0xbe03('0x97'),_0x479807[_0xbe03('0x98')],_0x479807['endDate']);}else{_0x1eb5a7[_0xbe03('0x3e')](_0x43cfc0[_0xbe03('0x7d')]+_0xbe03('0x99'),_0x479807[_0xbe03('0x98')],_0x479807[_0xbe03('0x9a')]);}if(_0x6daedd){logger[_0xbe03('0x9b')](_0xbe03('0x9c'),_0x1eb5a7[_0xbe03('0x82')]());require('child_process')[_0xbe03('0x9d')](path[_0xbe03('0x55')](__dirname,_0xbe03('0x9e'),_0x6daedd['output']),[_0x6daedd['id'],_0x1eb5a7['toString'](),path[_0xbe03('0x55')](__dirname,_0xbe03('0x9f'),_0x6daedd[_0xbe03('0xa0')]),_0x28392a]);return _0x6daedd;}else{var _0x4e64ea=squel[_0xbe03('0x6e')]();_0x4e64ea[_0xbe03('0x6f')]('('+_0x1eb5a7[_0xbe03('0x82')]()+')',_0xbe03('0xa1'));_0x4e64ea[_0xbe03('0x72')](_0xbe03('0xa2'),'count');_0x1eb5a7[_0xbe03('0x20')](_0x479807[_0xbe03('0x20')]||_0x2677a2);_0x1eb5a7[_0xbe03('0x1e')](_0x479807['offset']||0x0);return dbH[_0xbe03('0x83')][_0xbe03('0x33')](_0x4e64ea['toString'](),{'type':dbH[_0xbe03('0x83')]['QueryTypes'][_0xbe03('0x85')]})[_0xbe03('0x28')](function(_0x79ccd0){if(!_0x79ccd0[_0xbe03('0x48')]){_0x2607aa=0x0;}else{_0x2607aa=_0x79ccd0[0x0]['count']||0x0;}return dbH[_0xbe03('0x83')][_0xbe03('0x33')](_0x1eb5a7[_0xbe03('0x82')](),{'type':dbH['sequelize'][_0xbe03('0x84')][_0xbe03('0x85')]});})[_0xbe03('0x28')](function(_0x365341){return{'rows':_0x365341||[],'count':_0x2607aa};});}});}exports['run']=function(_0x47ac82,_0x455a0b){return runReport(_0x47ac82[_0xbe03('0x47')],_0x47ac82['query'],_0x47ac82[_0xbe03('0x40')])['then'](respondWithResult(_0x455a0b,null))[_0xbe03('0x46')](handleError(_0x455a0b,null));};exports[_0xbe03('0xa3')]=runReport;exports['query']=function(_0xe8509f,_0xc28b25){var _0x3081e6=0xa;var _0x3ea6a2=[_0xbe03('0x55'),_0xbe03('0x56'),'right_join','cross_join'];var _0xd417cf={'SUM':_0xbe03('0xa4'),'COUNT':_0xbe03('0x87'),'COUNT DISTINCT':_0xbe03('0x58'),'MAX':'MAX(%s)','MIN':_0xbe03('0x59'),'AVG':_0xbe03('0x5a'),'GROUP_CONCAT':_0xbe03('0x89'),'GROUP_CONCAT ASC':_0xbe03('0x5b'),'GROUP_CONCAT DESC':_0xbe03('0x5c')};var _0x2cafd7={'SEC_TO_TIME':_0xbe03('0x5d'),'DATE':_0xbe03('0x5e'),'HOUR':_0xbe03('0x5f'),'ROUND':_0xbe03('0x60'),'UNIX_TIMESTAMP':_0xbe03('0x61')};var _0x27389d=function(_0xc317c8){return!_['includes']([_0xbe03('0x63'),_0xbe03('0xa5'),_0xbe03('0x8a'),'IS\x20NOT\x20EMPTY'],_0xc317c8);};var _0x2979cf=function(_0x4d2249){if(!_0x4d2249||!_0x4d2249[_0xbe03('0x66')][_0xbe03('0x48')]){return'';}for(var _0xd2c0bd='(',_0x4cb285=0x0;_0x4cb285<_0x4d2249[_0xbe03('0x66')][_0xbe03('0x48')];_0x4cb285+=0x1){_0x4cb285>0x0&&(_0xd2c0bd+='\x20'+_0x4d2249[_0xbe03('0x65')]+'\x20');_0xd2c0bd+=_0x4d2249['rules'][_0x4cb285][_0xbe03('0x67')]?_0x2979cf(_0x4d2249['rules'][_0x4cb285]['group']):_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0x72')]+'\x20'+_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0xa6')]+(_0x27389d(_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0xa6')])?'\x20'+_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0x68')]:'');}return _0xd2c0bd+')';};var _0x2ae91e={'where':{'id':_0xe8509f[_0xbe03('0x47')]['id']}},_0x4ca6db,_0x394770,_0x4befc7,_0x504069,_0x594b59;_0x2ae91e=_[_0xbe03('0x3f')]({},_0x2ae91e,_0xe8509f[_0xbe03('0x40')]);return db[_0xbe03('0x41')][_0xbe03('0x49')](_0x2ae91e)[_0xbe03('0x28')](function(_0x481fc0){if(_0x481fc0){_0x4ca6db=_0x481fc0;return _0x481fc0[_0xbe03('0x69')]();}return null;})[_0xbe03('0x28')](function(_0x557e22){if(_0x557e22){if(!_0x557e22[_0xbe03('0x48')]){throw new db[(_0xbe03('0x8b'))][(_0xbe03('0x6a'))](_0xbe03('0x6b'),0x193);}_0x394770=_0x557e22;return db[_0xbe03('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x25e9b4){if(_0x25e9b4){_0x4befc7=_[_0xbe03('0x6d')](_0x25e9b4,'id');var _0x4220ca;var _0x154020=squel[_0xbe03('0x6e')]();_0x154020['from'](_0x4ca6db[_0xbe03('0x7d')]);for(var _0x128108=0x0;_0x128108<_0x394770['length'];_0x128108+=0x1){_0x4220ca=_0x394770[_0x128108][_0xbe03('0x70')]?_0x4befc7[_0x394770[_0x128108][_0xbe03('0x70')]][_0xbe03('0x71')]:_0x394770[_0x128108][_0xbe03('0x72')];_0x4220ca=_0x394770[_0x128108][_0xbe03('0x73')]?_[_0xbe03('0x74')](_0xd417cf[_0x394770[_0x128108][_0xbe03('0x73')]],'%s',_0x4220ca):_0x4220ca;_0x4220ca=_0x394770[_0x128108]['format']?_[_0xbe03('0x74')](_0x2cafd7[_0x394770[_0x128108][_0xbe03('0x75')]],'%s',_0x4220ca):_0x4220ca;if(_0x394770[_0x128108][_0xbe03('0x76')]){_0x154020[_0xbe03('0x67')](_0x4220ca);}_0x394770[_0x128108][_0xbe03('0x77')]&&_0x154020['order'](_0x4220ca,_0x394770[_0x128108][_0xbe03('0x77')]===_0xbe03('0x8c')?![]:!![]);_0x154020[_0xbe03('0x72')](_0x4220ca,_0x394770[_0x128108][_0xbe03('0x78')]||_0x4220ca);}if(_0x4ca6db[_0xbe03('0x79')]){_0x4ca6db[_0xbe03('0x79')]=JSON[_0xbe03('0x7a')](_0x4ca6db[_0xbe03('0x79')]);for(var _0x55521e=0x0;_0x55521e<_0x4ca6db[_0xbe03('0x79')][_0xbe03('0x48')];_0x55521e+=0x1){if(_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x31')]&&_[_0xbe03('0x62')](_0x3ea6a2,_0x4ca6db['joins'][_0x55521e][_0xbe03('0x31')])&&_0x4ca6db[_0xbe03('0x79')][_0x55521e]['parentKey']&&_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7c')]&&_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7b')]){_0x154020[_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x31')]](_0x4ca6db['joins'][_0x55521e][_0xbe03('0x7c')],null,util[_0xbe03('0x75')](_0xbe03('0x8d'),_0x4ca6db[_0xbe03('0x7d')],_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0xa7')],_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7c')],_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7b')]));}}}if(_0x4ca6db['conditions']){_0x4ca6db[_0xbe03('0x7e')]=JSON[_0xbe03('0x7a')](_0x4ca6db[_0xbe03('0x7e')]);_0x154020[_0xbe03('0x3e')](_0x2979cf(_0x4ca6db[_0xbe03('0x7e')]['group']));}_0x594b59=_0x154020[_0xbe03('0x7f')]();_0x154020[_0xbe03('0x20')](_0x3081e6);_0x154020['offset'](0x0);logger[_0xbe03('0x80')](_0xbe03('0x81'),_0x154020[_0xbe03('0x82')]());return dbH[_0xbe03('0x83')][_0xbe03('0x33')](_0x154020[_0xbe03('0x82')](),{'type':dbH[_0xbe03('0x83')]['QueryTypes'][_0xbe03('0x85')]});}})[_0xbe03('0x28')](function(){return{'sql':_0x594b59[_0xbe03('0x82')]()};})[_0xbe03('0x28')](respondWithResult(_0xc28b25,null))[_0xbe03('0x46')](handleError(_0xc28b25,null));}; \ No newline at end of file +var _0xa60f=['cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','toString','savename','COUNT(*)','SELECT','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','value','debug','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','includeAll','include','catch','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','userProfileId','CustomReports','body','preview','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','joins','parse','parentKey','foreignKey','foreignTable','conditions','sequelize','QueryTypes','cross_join','COUNT(%s)','MIN(%s)','SEC_TO_TIME(%s)','getFields','Sequelize','AnalyticMetric','findAll','metric','DESC','alias','%s.%s\x20=\x20%s.%s','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport'];(function(_0x3d2bd9,_0x397944){var _0x5086f9=function(_0x2908b7){while(--_0x2908b7){_0x3d2bd9['push'](_0x3d2bd9['shift']());}};_0x5086f9(++_0x397944);}(_0xa60f,0x153));var _0xfa60=function(_0x444003,_0x5c07ef){_0x444003=_0x444003-0x0;var _0x4b96a5=_0xa60f[_0x444003];return _0x4b96a5;};'use strict';var emlformat=require(_0xfa60('0x0'));var rimraf=require(_0xfa60('0x1'));var zipdir=require(_0xfa60('0x2'));var jsonpatch=require(_0xfa60('0x3'));var rp=require('request-promise');var moment=require(_0xfa60('0x4'));var BPromise=require(_0xfa60('0x5'));var Mustache=require(_0xfa60('0x6'));var util=require(_0xfa60('0x7'));var path=require(_0xfa60('0x8'));var sox=require(_0xfa60('0x9'));var csv=require(_0xfa60('0xa'));var ejs=require(_0xfa60('0xb'));var fs=require('fs');var fs_extra=require(_0xfa60('0xc'));var _=require(_0xfa60('0xd'));var squel=require(_0xfa60('0xe'));var crypto=require(_0xfa60('0xf'));var jsforce=require(_0xfa60('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfa60('0xa'));var querystring=require('querystring');var Papa=require(_0xfa60('0x11'));var Redis=require(_0xfa60('0x12'));var authService=require(_0xfa60('0x13'));var qs=require(_0xfa60('0x14'));var as=require(_0xfa60('0x15'));var hardwareService=require(_0xfa60('0x16'));var logger=require(_0xfa60('0x17'))(_0xfa60('0x18'));var utils=require(_0xfa60('0x19'));var config=require(_0xfa60('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa60('0x1b'))['db'];var dbH=require(_0xfa60('0x1b'))['dbH'];function respondWithStatusCode(_0x57c691,_0x513003){_0x513003=_0x513003||0xcc;return function(_0x54d0a2){if(_0x54d0a2){return _0x57c691[_0xfa60('0x1c')](_0x513003);}return _0x57c691[_0xfa60('0x1d')](_0x513003)[_0xfa60('0x1e')]();};}function respondWithResult(_0x52f14a,_0x235543){_0x235543=_0x235543||0xc8;return function(_0x4c86ad){if(_0x4c86ad){return _0x52f14a[_0xfa60('0x1d')](_0x235543)['json'](_0x4c86ad);}};}function respondWithFilteredResult(_0x513bd9,_0x3caf23){return function(_0x1c7f9f){if(_0x1c7f9f){var _0x501ff8=typeof _0x3caf23[_0xfa60('0x1f')]===_0xfa60('0x20')&&typeof _0x3caf23['limit']===_0xfa60('0x20');var _0x30af55=_0x1c7f9f['count'];var _0x4cfac0=_0x501ff8?0x0:_0x3caf23[_0xfa60('0x1f')];var _0x3099ea=_0x501ff8?_0x1c7f9f['count']:_0x3caf23[_0xfa60('0x1f')]+_0x3caf23[_0xfa60('0x21')];var _0x16763f;if(_0x3099ea>=_0x30af55){_0x3099ea=_0x30af55;_0x16763f=0xc8;}else{_0x16763f=0xce;}_0x513bd9['status'](_0x16763f);return _0x513bd9[_0xfa60('0x22')]('Content-Range',_0x4cfac0+'-'+_0x3099ea+'/'+_0x30af55)[_0xfa60('0x23')](_0x1c7f9f);}return null;};}function patchUpdates(_0x1b7531){return function(_0x5e88fa){try{jsonpatch[_0xfa60('0x24')](_0x5e88fa,_0x1b7531,!![]);}catch(_0x28539a){return BPromise['reject'](_0x28539a);}return _0x5e88fa[_0xfa60('0x25')]();};}function saveUpdates(_0x1d91b8,_0x9d2403){return function(_0x4185aa){if(_0x4185aa){return _0x4185aa[_0xfa60('0x26')](_0x1d91b8)[_0xfa60('0x27')](function(_0x5af3de){return _0x5af3de;});}return null;};}function removeEntity(_0x195c55,_0x87c9a){return function(_0x45307f){if(_0x45307f){return _0x45307f['destroy']()[_0xfa60('0x27')](function(){var _0x2f3a1d=_0x45307f[_0xfa60('0x28')]({'plain':!![]});var _0xdaaea='CustomReports';return db[_0xfa60('0x29')][_0xfa60('0x2a')]({'where':{'type':_0xdaaea,'resourceId':_0x2f3a1d['id']}})['then'](function(){return _0x45307f;});})[_0xfa60('0x27')](function(){_0x195c55[_0xfa60('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d9809,_0x3068b2){return function(_0x3484d2){if(!_0x3484d2){_0x4d9809[_0xfa60('0x1c')](0x194);}return _0x3484d2;};}function handleError(_0x5bd589,_0x1398bc){_0x1398bc=_0x1398bc||0x1f4;return function(_0x15885c){logger[_0xfa60('0x2b')](_0x15885c[_0xfa60('0x2c')]);if(_0x15885c[_0xfa60('0x2d')]){delete _0x15885c['name'];}_0x5bd589[_0xfa60('0x1d')](_0x1398bc)[_0xfa60('0x2e')](_0x15885c);};}exports[_0xfa60('0x2f')]=function(_0x303c5d,_0x56f090){var _0x46406f={},_0x52d961={},_0x39d682={'count':0x0,'rows':[]};var _0x11a2f5=_[_0xfa60('0x30')](db[_0xfa60('0x31')]['rawAttributes'],function(_0x40a4b6){return{'name':_0x40a4b6[_0xfa60('0x32')],'type':_0x40a4b6[_0xfa60('0x33')]['key']};});_0x52d961['model']=_[_0xfa60('0x30')](_0x11a2f5,_0xfa60('0x2d'));_0x52d961[_0xfa60('0x34')]=_[_0xfa60('0x35')](_0x303c5d[_0xfa60('0x34')]);_0x52d961['filters']=_[_0xfa60('0x36')](_0x52d961[_0xfa60('0x37')],_0x52d961['query']);_0x46406f[_0xfa60('0x38')]=_[_0xfa60('0x36')](_0x52d961['model'],qs[_0xfa60('0x39')](_0x303c5d[_0xfa60('0x34')][_0xfa60('0x39')]));_0x46406f[_0xfa60('0x38')]=_0x46406f['attributes'][_0xfa60('0x3a')]?_0x46406f['attributes']:_0x52d961[_0xfa60('0x37')];if(!_0x303c5d['query'][_0xfa60('0x3b')](_0xfa60('0x3c'))){_0x46406f[_0xfa60('0x21')]=qs[_0xfa60('0x21')](_0x303c5d[_0xfa60('0x34')][_0xfa60('0x21')]);_0x46406f[_0xfa60('0x1f')]=qs[_0xfa60('0x1f')](_0x303c5d[_0xfa60('0x34')]['offset']);}_0x46406f[_0xfa60('0x3d')]=qs[_0xfa60('0x3e')](_0x303c5d[_0xfa60('0x34')]['sort']);_0x46406f[_0xfa60('0x3f')]=qs[_0xfa60('0x40')](_['pick'](_0x303c5d[_0xfa60('0x34')],_0x52d961[_0xfa60('0x40')]),_0x11a2f5);if(_0x303c5d[_0xfa60('0x34')][_0xfa60('0x41')]){_0x46406f[_0xfa60('0x3f')]=_['merge'](_0x46406f[_0xfa60('0x3f')],{'$or':_[_0xfa60('0x30')](_0x11a2f5,function(_0x4ce2b9){if(_0x4ce2b9[_0xfa60('0x33')]!=='VIRTUAL'){var _0x2edf21={};_0x2edf21[_0x4ce2b9[_0xfa60('0x2d')]]={'$like':'%'+_0x303c5d[_0xfa60('0x34')][_0xfa60('0x41')]+'%'};return _0x2edf21;}})});}_0x46406f=_[_0xfa60('0x42')]({},_0x46406f,_0x303c5d[_0xfa60('0x43')]);var _0x1e9e29={'where':_0x46406f[_0xfa60('0x3f')]};return db['AnalyticCustomReport']['count'](_0x1e9e29)[_0xfa60('0x27')](function(_0x405ba5){_0x39d682[_0xfa60('0x44')]=_0x405ba5;if(_0x303c5d[_0xfa60('0x34')][_0xfa60('0x45')]){_0x46406f[_0xfa60('0x46')]=[{'all':!![]}];}return db[_0xfa60('0x31')]['findAll'](_0x46406f);})[_0xfa60('0x27')](function(_0x35e023){_0x39d682['rows']=_0x35e023;return _0x39d682;})[_0xfa60('0x27')](respondWithFilteredResult(_0x56f090,_0x46406f))[_0xfa60('0x47')](handleError(_0x56f090,null));};exports['show']=function(_0x4ca458,_0x3ffe30){var _0x53a532={'raw':![],'where':{'id':_0x4ca458[_0xfa60('0x48')]['id']}},_0x2a9e66={};_0x2a9e66['model']=_['keys'](db[_0xfa60('0x31')][_0xfa60('0x49')]);_0x2a9e66['query']=_[_0xfa60('0x35')](_0x4ca458[_0xfa60('0x34')]);_0x2a9e66['filters']=_[_0xfa60('0x36')](_0x2a9e66[_0xfa60('0x37')],_0x2a9e66[_0xfa60('0x34')]);_0x53a532[_0xfa60('0x38')]=_[_0xfa60('0x36')](_0x2a9e66[_0xfa60('0x37')],qs['fields'](_0x4ca458[_0xfa60('0x34')]['fields']));_0x53a532[_0xfa60('0x38')]=_0x53a532[_0xfa60('0x38')][_0xfa60('0x3a')]?_0x53a532[_0xfa60('0x38')]:_0x2a9e66[_0xfa60('0x37')];if(_0x4ca458[_0xfa60('0x34')][_0xfa60('0x45')]){_0x53a532[_0xfa60('0x46')]=[{'all':!![]}];}_0x53a532=_[_0xfa60('0x42')]({},_0x53a532,_0x4ca458[_0xfa60('0x43')]);return db[_0xfa60('0x31')][_0xfa60('0x4a')](_0x53a532)[_0xfa60('0x27')](handleEntityNotFound(_0x3ffe30,null))['then'](respondWithResult(_0x3ffe30,null))[_0xfa60('0x47')](handleError(_0x3ffe30,null));};exports[_0xfa60('0x4b')]=function(_0x2692f3,_0x1576d2){return db[_0xfa60('0x31')]['create'](_0x2692f3['body'],{})['then'](function(_0x3c6760){var _0x1672b1=_0x2692f3['user'][_0xfa60('0x28')]({'plain':!![]});if(!_0x1672b1)throw new Error(_0xfa60('0x4c'));if(_0x1672b1['role']===_0xfa60('0x4d')){var _0x424e42=_0x3c6760['get']({'plain':!![]});var _0x488a24=_0xfa60('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x488a24,'userProfileId':_0x1672b1[_0xfa60('0x4f')]},'raw':!![]})[_0xfa60('0x27')](function(_0x410863){if(_0x410863&&_0x410863['autoAssociation']===0x0){return db[_0xfa60('0x29')][_0xfa60('0x4b')]({'name':_0x424e42[_0xfa60('0x2d')],'resourceId':_0x424e42['id'],'type':_0xfa60('0x50'),'sectionId':_0x410863['id']},{})['then'](function(){return _0x3c6760;});}else{return _0x3c6760;}})[_0xfa60('0x47')](function(_0xf842df){logger[_0xfa60('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf842df);throw _0xf842df;});}return _0x3c6760;})[_0xfa60('0x27')](respondWithResult(_0x1576d2,0xc9))['catch'](handleError(_0x1576d2,null));};exports[_0xfa60('0x26')]=function(_0x361681,_0x37eb68){if(_0x361681['body']['id']){delete _0x361681['body']['id'];}return db['AnalyticCustomReport'][_0xfa60('0x4a')]({'where':{'id':_0x361681[_0xfa60('0x48')]['id']}})[_0xfa60('0x27')](handleEntityNotFound(_0x37eb68,null))[_0xfa60('0x27')](saveUpdates(_0x361681[_0xfa60('0x51')],null))['then'](respondWithResult(_0x37eb68,null))[_0xfa60('0x47')](handleError(_0x37eb68,null));};exports[_0xfa60('0x2a')]=function(_0x327e60,_0x1de8a1){return db[_0xfa60('0x31')][_0xfa60('0x4a')]({'where':{'id':_0x327e60[_0xfa60('0x48')]['id']}})[_0xfa60('0x27')](handleEntityNotFound(_0x1de8a1,null))[_0xfa60('0x27')](removeEntity(_0x1de8a1,null))['catch'](handleError(_0x1de8a1,null));};exports[_0xfa60('0x52')]=function(_0x21b2ba,_0x5e2f16){var _0x4da150=0xa;var _0x58ecf7=[_0xfa60('0x53'),_0xfa60('0x54'),_0xfa60('0x55'),'cross_join'];var _0x2a5649={'SUM':_0xfa60('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfa60('0x57'),'MAX':_0xfa60('0x58'),'MIN':'MIN(%s)','AVG':_0xfa60('0x59'),'GROUP_CONCAT':_0xfa60('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfa60('0x5b')};var _0x313bf4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfa60('0x5c'),'HOUR':_0xfa60('0x5d'),'ROUND':_0xfa60('0x5e'),'UNIX_TIMESTAMP':_0xfa60('0x5f')};var _0x163b47=function(_0x48af31){return!_[_0xfa60('0x60')]([_0xfa60('0x61'),_0xfa60('0x62'),_0xfa60('0x63'),_0xfa60('0x64')],_0x48af31);};var _0x310689=function(_0x57bce4){if(!_0x57bce4||!_0x57bce4[_0xfa60('0x65')][_0xfa60('0x3a')]){return'';}for(var _0x3a0706='(',_0x3fbbe1=0x0;_0x3fbbe1<_0x57bce4[_0xfa60('0x65')]['length'];_0x3fbbe1+=0x1){_0x3fbbe1>0x0&&(_0x3a0706+='\x20'+_0x57bce4[_0xfa60('0x66')]+'\x20');_0x3a0706+=_0x57bce4['rules'][_0x3fbbe1][_0xfa60('0x67')]?_0x310689(_0x57bce4[_0xfa60('0x65')][_0x3fbbe1][_0xfa60('0x67')]):_0x57bce4[_0xfa60('0x65')][_0x3fbbe1][_0xfa60('0x68')]+'\x20'+_0x57bce4[_0xfa60('0x65')][_0x3fbbe1][_0xfa60('0x69')]+(_0x163b47(_0x57bce4['rules'][_0x3fbbe1][_0xfa60('0x69')])?'\x20'+_0x57bce4[_0xfa60('0x65')][_0x3fbbe1]['value']:'');}return _0x3a0706+')';};var _0x172daf={'where':{'id':_0x21b2ba['params']['id']}},_0x2b12ef,_0x23f340,_0x5b45f0,_0x41601a,_0xf47840;_0x172daf=_['merge']({},_0x172daf,_0x21b2ba[_0xfa60('0x43')]);return db[_0xfa60('0x31')][_0xfa60('0x4a')](_0x172daf)[_0xfa60('0x27')](function(_0x538955){if(_0x538955){_0x2b12ef=_0x538955;return _0x538955['getFields']();}return null;})[_0xfa60('0x27')](function(_0x1dac38){if(_0x1dac38){if(!_0x1dac38[_0xfa60('0x3a')]){throw new db['Sequelize'][(_0xfa60('0x6a'))](_0xfa60('0x6b'),0x193);}_0x23f340=_0x1dac38;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfa60('0x27')](function(_0x12369f){if(_0x12369f){_0x5b45f0=_[_0xfa60('0x6c')](_0x12369f,'id');var _0x54b018;var _0x255acd=squel[_0xfa60('0x6d')]();_0x255acd[_0xfa60('0x6e')](_0x2b12ef[_0xfa60('0x6f')]);for(var _0x3aa3da=0x0;_0x3aa3da<_0x23f340[_0xfa60('0x3a')];_0x3aa3da+=0x1){_0x54b018=_0x23f340[_0x3aa3da]['MetricId']?_0x5b45f0[_0x23f340[_0x3aa3da][_0xfa60('0x70')]]['metric']:_0x23f340[_0x3aa3da][_0xfa60('0x68')];_0x54b018=_0x23f340[_0x3aa3da][_0xfa60('0x71')]?_[_0xfa60('0x72')](_0x2a5649[_0x23f340[_0x3aa3da][_0xfa60('0x71')]],'%s',_0x54b018):_0x54b018;_0x54b018=_0x23f340[_0x3aa3da][_0xfa60('0x73')]?_['replace'](_0x313bf4[_0x23f340[_0x3aa3da][_0xfa60('0x73')]],'%s',_0x54b018):_0x54b018;if(_0x23f340[_0x3aa3da][_0xfa60('0x74')]){_0x255acd[_0xfa60('0x67')](_0x54b018);}_0x23f340[_0x3aa3da][_0xfa60('0x75')]&&_0x255acd[_0xfa60('0x3d')](_0x54b018,_0x23f340[_0x3aa3da]['orderBy']==='DESC'?![]:!![]);_0x255acd[_0xfa60('0x68')](_0x54b018,_0x23f340[_0x3aa3da]['alias']||_0x54b018);}if(_0x2b12ef[_0xfa60('0x76')]){_0x2b12ef['joins']=JSON[_0xfa60('0x77')](_0x2b12ef['joins']);for(var _0x541872=0x0;_0x541872<_0x2b12ef['joins']['length'];_0x541872+=0x1){if(_0x2b12ef[_0xfa60('0x76')][_0x541872]['type']&&_[_0xfa60('0x60')](_0x58ecf7,_0x2b12ef['joins'][_0x541872][_0xfa60('0x33')])&&_0x2b12ef[_0xfa60('0x76')][_0x541872][_0xfa60('0x78')]&&_0x2b12ef[_0xfa60('0x76')][_0x541872]['foreignTable']&&_0x2b12ef[_0xfa60('0x76')][_0x541872][_0xfa60('0x79')]){_0x255acd[_0x2b12ef[_0xfa60('0x76')][_0x541872][_0xfa60('0x33')]](_0x2b12ef[_0xfa60('0x76')][_0x541872][_0xfa60('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2b12ef[_0xfa60('0x6f')],_0x2b12ef[_0xfa60('0x76')][_0x541872][_0xfa60('0x78')],_0x2b12ef[_0xfa60('0x76')][_0x541872][_0xfa60('0x7a')],_0x2b12ef[_0xfa60('0x76')][_0x541872]['foreignKey']));}}}if(_0x2b12ef[_0xfa60('0x7b')]){_0x2b12ef[_0xfa60('0x7b')]=JSON[_0xfa60('0x77')](_0x2b12ef['conditions']);_0x255acd[_0xfa60('0x3f')](_0x310689(_0x2b12ef[_0xfa60('0x7b')][_0xfa60('0x67')]));}_0xf47840=_0x255acd['clone']();_0x255acd[_0xfa60('0x21')](_0x4da150);_0x255acd[_0xfa60('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x255acd['toString']());return dbH[_0xfa60('0x7c')]['query'](_0x255acd['toString'](),{'type':dbH['sequelize'][_0xfa60('0x7d')]['SELECT']});}})[_0xfa60('0x27')](respondWithResult(_0x5e2f16,null))[_0xfa60('0x47')](handleError(_0x5e2f16,null));};function runReport(_0x5a4e21,_0x539c61,_0x3ef1ac){var _0x5c2019=_0x539c61[_0xfa60('0x2d')];var _0xa3aa13=0xa;var _0x2a8357=[_0xfa60('0x53'),_0xfa60('0x54'),_0xfa60('0x55'),_0xfa60('0x7e')];var _0x22594a={'SUM':_0xfa60('0x56'),'COUNT':_0xfa60('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfa60('0x58'),'MIN':_0xfa60('0x80'),'AVG':_0xfa60('0x59'),'GROUP_CONCAT':_0xfa60('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfa60('0x5b')};var _0x19329d={'SEC_TO_TIME':_0xfa60('0x81'),'DATE':_0xfa60('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xfa60('0x5e'),'UNIX_TIMESTAMP':_0xfa60('0x5f')};var _0x392df3=function(_0x454265){return!_[_0xfa60('0x60')](['IS\x20NULL',_0xfa60('0x62'),_0xfa60('0x63'),'IS\x20NOT\x20EMPTY'],_0x454265);};var _0x372fcc=function(_0x445303){if(!_0x445303||!_0x445303[_0xfa60('0x65')][_0xfa60('0x3a')]){return'';}for(var _0x226cee='(',_0x21f66b=0x0;_0x21f66b<_0x445303[_0xfa60('0x65')][_0xfa60('0x3a')];_0x21f66b+=0x1){_0x21f66b>0x0&&(_0x226cee+='\x20'+_0x445303[_0xfa60('0x66')]+'\x20');_0x226cee+=_0x445303[_0xfa60('0x65')][_0x21f66b][_0xfa60('0x67')]?_0x372fcc(_0x445303[_0xfa60('0x65')][_0x21f66b][_0xfa60('0x67')]):_0x445303[_0xfa60('0x65')][_0x21f66b][_0xfa60('0x68')]+'\x20'+_0x445303[_0xfa60('0x65')][_0x21f66b][_0xfa60('0x69')]+(_0x392df3(_0x445303[_0xfa60('0x65')][_0x21f66b][_0xfa60('0x69')])?'\x20'+_0x445303[_0xfa60('0x65')][_0x21f66b]['value']:'');}return _0x226cee+')';};var _0x54348b={'where':{'id':_0x5a4e21['id']}},_0x14085c,_0x7fa0b9,_0x62649a,_0x529588,_0x5eb24c;_0x54348b=_[_0xfa60('0x42')]({},_0x54348b,_0x3ef1ac);return db[_0xfa60('0x31')][_0xfa60('0x4a')](_0x54348b)[_0xfa60('0x27')](function(_0xf0e8aa){if(_0xf0e8aa){_0x14085c=_0xf0e8aa;return _0xf0e8aa[_0xfa60('0x82')]();}return null;})[_0xfa60('0x27')](function(_0x37dd5c){if(_0x37dd5c){if(!_0x37dd5c[_0xfa60('0x3a')]){throw new db[(_0xfa60('0x83'))][(_0xfa60('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x7fa0b9=_0x37dd5c;return db[_0xfa60('0x84')][_0xfa60('0x85')]({'raw':!![]});}return null;})['then'](function(_0x29781a){if(_0x29781a){_0x62649a=_[_0xfa60('0x6c')](_0x29781a,'id');var _0x815613;var _0x2a8e1b=squel['select']();_0x2a8e1b[_0xfa60('0x6e')](_0x14085c[_0xfa60('0x6f')]);for(var _0x1aa3c4=0x0;_0x1aa3c4<_0x7fa0b9[_0xfa60('0x3a')];_0x1aa3c4+=0x1){_0x815613=_0x7fa0b9[_0x1aa3c4]['MetricId']?_0x62649a[_0x7fa0b9[_0x1aa3c4]['MetricId']][_0xfa60('0x86')]:_0x7fa0b9[_0x1aa3c4]['field'];_0x815613=_0x7fa0b9[_0x1aa3c4][_0xfa60('0x71')]?_[_0xfa60('0x72')](_0x22594a[_0x7fa0b9[_0x1aa3c4]['function']],'%s',_0x815613):_0x815613;_0x815613=_0x7fa0b9[_0x1aa3c4][_0xfa60('0x73')]?_['replace'](_0x19329d[_0x7fa0b9[_0x1aa3c4][_0xfa60('0x73')]],'%s',_0x815613):_0x815613;if(_0x7fa0b9[_0x1aa3c4][_0xfa60('0x74')]){_0x2a8e1b[_0xfa60('0x67')](_0x815613);}_0x7fa0b9[_0x1aa3c4][_0xfa60('0x75')]&&_0x2a8e1b[_0xfa60('0x3d')](_0x815613,_0x7fa0b9[_0x1aa3c4][_0xfa60('0x75')]===_0xfa60('0x87')?![]:!![]);_0x2a8e1b[_0xfa60('0x68')](_0x815613,_0x7fa0b9[_0x1aa3c4][_0xfa60('0x88')]||_0x815613);}if(_0x14085c[_0xfa60('0x76')]){_0x14085c['joins']=JSON[_0xfa60('0x77')](_0x14085c[_0xfa60('0x76')]);for(var _0x467e65=0x0;_0x467e65<_0x14085c[_0xfa60('0x76')][_0xfa60('0x3a')];_0x467e65+=0x1){if(_0x14085c[_0xfa60('0x76')][_0x467e65][_0xfa60('0x33')]&&_[_0xfa60('0x60')](_0x2a8357,_0x14085c['joins'][_0x467e65][_0xfa60('0x33')])&&_0x14085c['joins'][_0x467e65][_0xfa60('0x78')]&&_0x14085c['joins'][_0x467e65][_0xfa60('0x7a')]&&_0x14085c['joins'][_0x467e65][_0xfa60('0x79')]){_0x2a8e1b[_0x14085c['joins'][_0x467e65]['type']](_0x14085c[_0xfa60('0x76')][_0x467e65][_0xfa60('0x7a')],null,util['format'](_0xfa60('0x89'),_0x14085c[_0xfa60('0x6f')],_0x14085c[_0xfa60('0x76')][_0x467e65][_0xfa60('0x78')],_0x14085c[_0xfa60('0x76')][_0x467e65][_0xfa60('0x7a')],_0x14085c[_0xfa60('0x76')][_0x467e65][_0xfa60('0x79')]));}}}if(_0x14085c[_0xfa60('0x7b')]){_0x14085c[_0xfa60('0x7b')]=JSON[_0xfa60('0x77')](_0x14085c[_0xfa60('0x7b')]);_0x2a8e1b[_0xfa60('0x3f')](_0x372fcc(_0x14085c[_0xfa60('0x7b')][_0xfa60('0x67')]));}_0x5eb24c=_0x2a8e1b[_0xfa60('0x8a')]();_0x2a8e1b[_0xfa60('0x21')](_0xa3aa13);_0x2a8e1b[_0xfa60('0x1f')](0x0);return;}})['then'](function(){if(_0x539c61[_0xfa60('0x8b')]==='web'){return null;}var _0x1ca56b=_[_0xfa60('0x42')](_0x539c61,{'name':_0x539c61[_0xfa60('0x8c')]||_0x539c61[_0xfa60('0x2d')]||_0x14085c[_0xfa60('0x2d')],'basename':_0x5c2019,'savename':util['format'](_0xfa60('0x8d'),_0x539c61[_0xfa60('0x2d')]||_0x14085c['name'],require(_0xfa60('0x8e'))[_0xfa60('0x8f')](0x4),_0x539c61[_0xfa60('0x8b')]||_0xfa60('0x90')),'reportId':_0x14085c['id'],'reportType':_0xfa60('0x91')});return db[_0xfa60('0x92')]['create'](_0x1ca56b,{'raw':!![]});})[_0xfa60('0x27')](function(_0x40a603){if(_0x14085c[_0xfa60('0x6f')]===_0xfa60('0x93')){_0x5eb24c['where'](_0x14085c['table']+_0xfa60('0x94'),_0x539c61['startDate'],_0x539c61['endDate']);}else{_0x5eb24c[_0xfa60('0x3f')](_0x14085c[_0xfa60('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x539c61['startDate'],_0x539c61[_0xfa60('0x95')]);}if(_0x40a603){logger['info'](_0xfa60('0x96'),_0x5eb24c['toString']());require(_0xfa60('0x97'))[_0xfa60('0x98')](path[_0xfa60('0x53')](__dirname,'../../components/export/',_0x40a603[_0xfa60('0x8b')]),[_0x40a603['id'],_0x5eb24c[_0xfa60('0x99')](),path['join'](__dirname,'../../files/reports',_0x40a603[_0xfa60('0x9a')]),_0x5c2019]);return _0x40a603;}else{var _0x4f4b5a=squel[_0xfa60('0x6d')]();_0x4f4b5a[_0xfa60('0x6e')]('('+_0x5eb24c[_0xfa60('0x99')]()+')','countTable');_0x4f4b5a['field'](_0xfa60('0x9b'),'count');_0x5eb24c[_0xfa60('0x21')](_0x539c61[_0xfa60('0x21')]||_0xa3aa13);_0x5eb24c['offset'](_0x539c61[_0xfa60('0x1f')]||0x0);return dbH[_0xfa60('0x7c')]['query'](_0x4f4b5a[_0xfa60('0x99')](),{'type':dbH[_0xfa60('0x7c')]['QueryTypes']['SELECT']})[_0xfa60('0x27')](function(_0x36b2f4){if(!_0x36b2f4[_0xfa60('0x3a')]){_0x529588=0x0;}else{_0x529588=_0x36b2f4[0x0][_0xfa60('0x44')]||0x0;}return dbH['sequelize'][_0xfa60('0x34')](_0x5eb24c['toString'](),{'type':dbH[_0xfa60('0x7c')][_0xfa60('0x7d')][_0xfa60('0x9c')]});})['then'](function(_0x2bbdce){return{'rows':_0x2bbdce||[],'count':_0x529588};});}});}exports['run']=function(_0x36ec5f,_0x3f5b58){return runReport(_0x36ec5f['params'],_0x36ec5f['query'],_0x36ec5f['options'])[_0xfa60('0x27')](respondWithResult(_0x3f5b58,null))[_0xfa60('0x47')](handleError(_0x3f5b58,null));};exports[_0xfa60('0x9d')]=runReport;exports['query']=function(_0xafece9,_0x31d0ff){var _0x293250=0xa;var _0x5c5f50=[_0xfa60('0x53'),_0xfa60('0x54'),'right_join',_0xfa60('0x7e')];var _0x11e397={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfa60('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xfa60('0x5a'),'GROUP_CONCAT ASC':_0xfa60('0x9e'),'GROUP_CONCAT DESC':_0xfa60('0x5b')};var _0x155932={'SEC_TO_TIME':_0xfa60('0x81'),'DATE':_0xfa60('0x5c'),'HOUR':_0xfa60('0x5d'),'ROUND':_0xfa60('0x5e'),'UNIX_TIMESTAMP':_0xfa60('0x5f')};var _0x560ffa=function(_0xa2c0bb){return!_[_0xfa60('0x60')](['IS\x20NULL',_0xfa60('0x62'),'IS\x20EMPTY',_0xfa60('0x64')],_0xa2c0bb);};var _0xc002f6=function(_0x12cdd3){if(!_0x12cdd3||!_0x12cdd3[_0xfa60('0x65')][_0xfa60('0x3a')]){return'';}for(var _0x56a24f='(',_0x3fa7c4=0x0;_0x3fa7c4<_0x12cdd3[_0xfa60('0x65')][_0xfa60('0x3a')];_0x3fa7c4+=0x1){_0x3fa7c4>0x0&&(_0x56a24f+='\x20'+_0x12cdd3[_0xfa60('0x66')]+'\x20');_0x56a24f+=_0x12cdd3[_0xfa60('0x65')][_0x3fa7c4][_0xfa60('0x67')]?_0xc002f6(_0x12cdd3[_0xfa60('0x65')][_0x3fa7c4][_0xfa60('0x67')]):_0x12cdd3[_0xfa60('0x65')][_0x3fa7c4]['field']+'\x20'+_0x12cdd3[_0xfa60('0x65')][_0x3fa7c4][_0xfa60('0x69')]+(_0x560ffa(_0x12cdd3[_0xfa60('0x65')][_0x3fa7c4]['condition'])?'\x20'+_0x12cdd3[_0xfa60('0x65')][_0x3fa7c4][_0xfa60('0x9f')]:'');}return _0x56a24f+')';};var _0x4945d8={'where':{'id':_0xafece9[_0xfa60('0x48')]['id']}},_0x59bee6,_0x12f4f2,_0x2f4880,_0x2933b9,_0x367ea4;_0x4945d8=_[_0xfa60('0x42')]({},_0x4945d8,_0xafece9[_0xfa60('0x43')]);return db[_0xfa60('0x31')][_0xfa60('0x4a')](_0x4945d8)[_0xfa60('0x27')](function(_0x23183c){if(_0x23183c){_0x59bee6=_0x23183c;return _0x23183c[_0xfa60('0x82')]();}return null;})[_0xfa60('0x27')](function(_0x44090b){if(_0x44090b){if(!_0x44090b[_0xfa60('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xfa60('0x6b'),0x193);}_0x12f4f2=_0x44090b;return db[_0xfa60('0x84')][_0xfa60('0x85')]({'raw':!![]});}return null;})[_0xfa60('0x27')](function(_0xc3e44f){if(_0xc3e44f){_0x2f4880=_[_0xfa60('0x6c')](_0xc3e44f,'id');var _0x511da4;var _0x26a39a=squel[_0xfa60('0x6d')]();_0x26a39a[_0xfa60('0x6e')](_0x59bee6[_0xfa60('0x6f')]);for(var _0x1f48d6=0x0;_0x1f48d6<_0x12f4f2[_0xfa60('0x3a')];_0x1f48d6+=0x1){_0x511da4=_0x12f4f2[_0x1f48d6][_0xfa60('0x70')]?_0x2f4880[_0x12f4f2[_0x1f48d6][_0xfa60('0x70')]]['metric']:_0x12f4f2[_0x1f48d6][_0xfa60('0x68')];_0x511da4=_0x12f4f2[_0x1f48d6]['function']?_[_0xfa60('0x72')](_0x11e397[_0x12f4f2[_0x1f48d6][_0xfa60('0x71')]],'%s',_0x511da4):_0x511da4;_0x511da4=_0x12f4f2[_0x1f48d6][_0xfa60('0x73')]?_[_0xfa60('0x72')](_0x155932[_0x12f4f2[_0x1f48d6][_0xfa60('0x73')]],'%s',_0x511da4):_0x511da4;if(_0x12f4f2[_0x1f48d6]['groupBy']){_0x26a39a[_0xfa60('0x67')](_0x511da4);}_0x12f4f2[_0x1f48d6]['orderBy']&&_0x26a39a[_0xfa60('0x3d')](_0x511da4,_0x12f4f2[_0x1f48d6][_0xfa60('0x75')]===_0xfa60('0x87')?![]:!![]);_0x26a39a[_0xfa60('0x68')](_0x511da4,_0x12f4f2[_0x1f48d6][_0xfa60('0x88')]||_0x511da4);}if(_0x59bee6[_0xfa60('0x76')]){_0x59bee6['joins']=JSON[_0xfa60('0x77')](_0x59bee6[_0xfa60('0x76')]);for(var _0x344b72=0x0;_0x344b72<_0x59bee6['joins']['length'];_0x344b72+=0x1){if(_0x59bee6[_0xfa60('0x76')][_0x344b72][_0xfa60('0x33')]&&_[_0xfa60('0x60')](_0x5c5f50,_0x59bee6[_0xfa60('0x76')][_0x344b72]['type'])&&_0x59bee6[_0xfa60('0x76')][_0x344b72][_0xfa60('0x78')]&&_0x59bee6[_0xfa60('0x76')][_0x344b72][_0xfa60('0x7a')]&&_0x59bee6[_0xfa60('0x76')][_0x344b72]['foreignKey']){_0x26a39a[_0x59bee6[_0xfa60('0x76')][_0x344b72][_0xfa60('0x33')]](_0x59bee6[_0xfa60('0x76')][_0x344b72][_0xfa60('0x7a')],null,util[_0xfa60('0x73')](_0xfa60('0x89'),_0x59bee6[_0xfa60('0x6f')],_0x59bee6[_0xfa60('0x76')][_0x344b72][_0xfa60('0x78')],_0x59bee6['joins'][_0x344b72][_0xfa60('0x7a')],_0x59bee6['joins'][_0x344b72]['foreignKey']));}}}if(_0x59bee6[_0xfa60('0x7b')]){_0x59bee6[_0xfa60('0x7b')]=JSON[_0xfa60('0x77')](_0x59bee6['conditions']);_0x26a39a[_0xfa60('0x3f')](_0xc002f6(_0x59bee6[_0xfa60('0x7b')][_0xfa60('0x67')]));}_0x367ea4=_0x26a39a[_0xfa60('0x8a')]();_0x26a39a[_0xfa60('0x21')](_0x293250);_0x26a39a[_0xfa60('0x1f')](0x0);logger[_0xfa60('0xa0')](_0xfa60('0xa1'),_0x26a39a['toString']());return dbH['sequelize'][_0xfa60('0x34')](_0x26a39a[_0xfa60('0x99')](),{'type':dbH[_0xfa60('0x7c')][_0xfa60('0x7d')][_0xfa60('0x9c')]});}})[_0xfa60('0x27')](function(){return{'sql':_0x367ea4[_0xfa60('0x99')]()};})[_0xfa60('0x27')](respondWithResult(_0x31d0ff,null))['catch'](handleError(_0x31d0ff,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 390c7dc..f1541b9 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 _0x1324=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1324,0xd0));var _0x4132=function(_0x4b1434,_0x1fa900){_0x4b1434=_0x4b1434-0x0;var _0x9870da=_0x1324[_0x4b1434];return _0x9870da;};'use strict';var _=require(_0x4132('0x0'));var util=require(_0x4132('0x1'));var logger=require(_0x4132('0x2'))(_0x4132('0x3'));var moment=require(_0x4132('0x4'));var BPromise=require(_0x4132('0x5'));var rp=require(_0x4132('0x6'));var fs=require('fs');var path=require(_0x4132('0x7'));var rimraf=require(_0x4132('0x8'));var config=require(_0x4132('0x9'));var attributes=require(_0x4132('0xa'));module[_0x4132('0xb')]=function(_0x2a5ac4,_0x59c91c){return _0x2a5ac4['define']('AnalyticCustomReport',attributes,{'tableName':_0x4132('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceda=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4fd994,_0x199a8a){var _0x5034ec=function(_0x43e6e0){while(--_0x43e6e0){_0x4fd994['push'](_0x4fd994['shift']());}};_0x5034ec(++_0x199a8a);}(_0xceda,0xbb));var _0xaced=function(_0x418931,_0x3932aa){_0x418931=_0x418931-0x0;var _0x4cdb67=_0xceda[_0x418931];return _0x4cdb67;};'use strict';var _=require(_0xaced('0x0'));var util=require('util');var logger=require(_0xaced('0x1'))(_0xaced('0x2'));var moment=require(_0xaced('0x3'));var BPromise=require(_0xaced('0x4'));var rp=require(_0xaced('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaced('0x6'));var config=require(_0xaced('0x7'));var attributes=require(_0xaced('0x8'));module['exports']=function(_0x47f034,_0x4bf8de){return _0x47f034[_0xaced('0x9')](_0xaced('0xa'),attributes,{'tableName':_0xaced('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 4b09184..c5c19cc 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 _0x9c79=['jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xaf84ae,_0x2f4ce1){var _0x355a10=function(_0x1dceb6){while(--_0x1dceb6){_0xaf84ae['push'](_0xaf84ae['shift']());}};_0x355a10(++_0x2f4ce1);}(_0x9c79,0x1d6));var _0x99c7=function(_0x240eee,_0x249118){_0x240eee=_0x240eee-0x0;var _0x411632=_0x9c79[_0x240eee];return _0x411632;};'use strict';var _=require(_0x99c7('0x0'));var util=require(_0x99c7('0x1'));var moment=require(_0x99c7('0x2'));var BPromise=require(_0x99c7('0x3'));var rs=require(_0x99c7('0x4'));var fs=require('fs');var Redis=require(_0x99c7('0x5'));var db=require(_0x99c7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x99c7('0x7'))(_0x99c7('0x8'));var config=require(_0x99c7('0x9'));var jayson=require(_0x99c7('0xa'));var client=jayson[_0x99c7('0xb')][_0x99c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc4c07f,_0xd30d88,_0x154e4b){return new BPromise(function(_0x53d756,_0x4b939a){return client[_0x99c7('0xd')](_0xc4c07f,_0x154e4b)['then'](function(_0x5993cd){logger[_0x99c7('0xe')](_0x99c7('0xf'),_0xd30d88,_0x99c7('0x10'));logger[_0x99c7('0x11')](_0x99c7('0x12'),_0xd30d88,'request\x20sent',JSON[_0x99c7('0x13')](_0x5993cd));if(_0x5993cd[_0x99c7('0x14')]){if(_0x5993cd[_0x99c7('0x14')]['code']===0x1f4){logger['error'](_0x99c7('0xf'),_0xd30d88,_0x5993cd[_0x99c7('0x14')]['message']);return _0x4b939a(_0x5993cd[_0x99c7('0x14')]['message']);}logger[_0x99c7('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0xd30d88,_0x5993cd[_0x99c7('0x14')]['message']);return _0x53d756(_0x5993cd[_0x99c7('0x14')][_0x99c7('0x15')]);}else{logger[_0x99c7('0xe')](_0x99c7('0xf'),_0xd30d88,_0x99c7('0x10'));_0x53d756(_0x5993cd[_0x99c7('0x16')]['message']);}})[_0x99c7('0x17')](function(_0x40b6fc){logger[_0x99c7('0x14')](_0x99c7('0xf'),_0xd30d88,_0x40b6fc);_0x4b939a(_0x40b6fc);});});} \ No newline at end of file +var _0x86fc=['error','code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x5ba69f,_0x39aef3){var _0x4dc7fa=function(_0x7790c8){while(--_0x7790c8){_0x5ba69f['push'](_0x5ba69f['shift']());}};_0x4dc7fa(++_0x39aef3);}(_0x86fc,0x107));var _0xc86f=function(_0xb1eafa,_0x1985a7){_0xb1eafa=_0xb1eafa-0x0;var _0x37fff7=_0x86fc[_0xb1eafa];return _0x37fff7;};'use strict';var _=require('lodash');var util=require(_0xc86f('0x0'));var moment=require(_0xc86f('0x1'));var BPromise=require(_0xc86f('0x2'));var rs=require(_0xc86f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc86f('0x4'))['db'];var utils=require(_0xc86f('0x5'));var logger=require(_0xc86f('0x6'))(_0xc86f('0x7'));var config=require(_0xc86f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc86f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19afb6,_0x383f08,_0x34d0cb){return new BPromise(function(_0x93ef5d,_0x196063){return client[_0xc86f('0xa')](_0x19afb6,_0x34d0cb)[_0xc86f('0xb')](function(_0x1f96ef){logger[_0xc86f('0xc')](_0xc86f('0xd'),_0x383f08,_0xc86f('0xe'));logger[_0xc86f('0xf')](_0xc86f('0x10'),_0x383f08,_0xc86f('0xe'),JSON['stringify'](_0x1f96ef));if(_0x1f96ef[_0xc86f('0x11')]){if(_0x1f96ef[_0xc86f('0x11')][_0xc86f('0x12')]===0x1f4){logger['error'](_0xc86f('0xd'),_0x383f08,_0x1f96ef['error'][_0xc86f('0x13')]);return _0x196063(_0x1f96ef['error']['message']);}logger['error'](_0xc86f('0xd'),_0x383f08,_0x1f96ef['error']['message']);return _0x93ef5d(_0x1f96ef[_0xc86f('0x11')][_0xc86f('0x13')]);}else{logger[_0xc86f('0xc')](_0xc86f('0xd'),_0x383f08,'request\x20sent');_0x93ef5d(_0x1f96ef['result'][_0xc86f('0x13')]);}})['catch'](function(_0x3574ba){logger[_0xc86f('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x383f08,_0x3574ba);_0x196063(_0x3574ba);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 983fac9..db249e2 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 _0x01bf=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id/preview','/:id/run','query','create','put','/:id','update','delete','exports','util'];(function(_0x1aebd9,_0x1a1fac){var _0x487704=function(_0x1492ad){while(--_0x1492ad){_0x1aebd9['push'](_0x1aebd9['shift']());}};_0x487704(++_0x1a1fac);}(_0x01bf,0x97));var _0xf01b=function(_0xe07094,_0x1cd13b){_0xe07094=_0xe07094-0x0;var _0x2d447b=_0x01bf[_0xe07094];return _0x2d447b;};'use strict';var multer=require('multer');var util=require(_0xf01b('0x0'));var path=require(_0xf01b('0x1'));var timeout=require(_0xf01b('0x2'));var express=require('express');var router=express[_0xf01b('0x3')]();var fs_extra=require(_0xf01b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf01b('0x5'));var config=require(_0xf01b('0x6'));var controller=require(_0xf01b('0x7'));router[_0xf01b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf01b('0x8')]('/:id',auth[_0xf01b('0x9')](),controller['show']);router[_0xf01b('0x8')](_0xf01b('0xa'),auth[_0xf01b('0x9')](),controller['preview']);router[_0xf01b('0x8')](_0xf01b('0xb'),auth['isAuthenticated'](),controller['run']);router[_0xf01b('0x8')]('/:id/query',auth[_0xf01b('0x9')](),controller[_0xf01b('0xc')]);router['post']('/',auth[_0xf01b('0x9')](),controller[_0xf01b('0xd')]);router[_0xf01b('0xe')](_0xf01b('0xf'),auth['isAuthenticated'](),controller[_0xf01b('0x10')]);router[_0xf01b('0x11')]('/:id',auth[_0xf01b('0x9')](),controller['destroy']);module[_0xf01b('0x12')]=router; \ No newline at end of file +var _0x1c90=['run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run'];(function(_0xcdefdc,_0x435194){var _0x45f1d0=function(_0x138d80){while(--_0x138d80){_0xcdefdc['push'](_0xcdefdc['shift']());}};_0x45f1d0(++_0x435194);}(_0x1c90,0x14e));var _0x01c9=function(_0x28143f,_0x61fe7b){_0x28143f=_0x28143f-0x0;var _0x1da705=_0x1c90[_0x28143f];return _0x1da705;};'use strict';var multer=require(_0x01c9('0x0'));var util=require(_0x01c9('0x1'));var path=require(_0x01c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x01c9('0x3'));var router=express['Router']();var fs_extra=require(_0x01c9('0x4'));var auth=require(_0x01c9('0x5'));var interaction=require(_0x01c9('0x6'));var config=require(_0x01c9('0x7'));var controller=require(_0x01c9('0x8'));router[_0x01c9('0x9')]('/',auth['isAuthenticated'](),controller[_0x01c9('0xa')]);router[_0x01c9('0x9')](_0x01c9('0xb'),auth[_0x01c9('0xc')](),controller['show']);router[_0x01c9('0x9')](_0x01c9('0xd'),auth[_0x01c9('0xc')](),controller[_0x01c9('0xe')]);router['get'](_0x01c9('0xf'),auth['isAuthenticated'](),controller[_0x01c9('0x10')]);router['get'](_0x01c9('0x11'),auth[_0x01c9('0xc')](),controller[_0x01c9('0x12')]);router[_0x01c9('0x13')]('/',auth[_0x01c9('0xc')](),controller[_0x01c9('0x14')]);router[_0x01c9('0x15')](_0x01c9('0xb'),auth['isAuthenticated'](),controller[_0x01c9('0x16')]);router['delete']('/:id',auth[_0x01c9('0xc')](),controller[_0x01c9('0x17')]);module[_0x01c9('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index ee9364c..dbc98c6 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 _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2952d5,_0x1dc7ec){_0x2952d5=_0x2952d5-0x0;var _0xf00f04=_0x8ef6[_0x2952d5];return _0xf00f04;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x537bf5,_0x92251c){var _0x50f3b5=function(_0x554bb8){while(--_0x554bb8){_0x537bf5['push'](_0x537bf5['shift']());}};_0x50f3b5(++_0x92251c);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 090e25b..a661a53 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 _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x41062b,_0x308726){var _0x148fb4=function(_0xfe6107){while(--_0xfe6107){_0x41062b['push'](_0x41062b['shift']());}};_0x148fb4(++_0x308726);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file +var _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x20d06a,_0x16b092){_0x20d06a=_0x20d06a-0x0;var _0x1c48ef=_0x687b[_0x20d06a];return _0x1c48ef;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 2044894..5412d53 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 _0xfd74=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport'];(function(_0x3e0584,_0x469dd5){var _0x41a70f=function(_0x40e32a){while(--_0x40e32a){_0x3e0584['push'](_0x3e0584['shift']());}};_0x41a70f(++_0x469dd5);}(_0xfd74,0x118));var _0x4fd7=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xfd74[_0x4afac5];return _0x2404b3;};'use strict';var _=require(_0x4fd7('0x0'));var util=require('util');var logger=require(_0x4fd7('0x1'))('api');var moment=require(_0x4fd7('0x2'));var BPromise=require(_0x4fd7('0x3'));var rp=require(_0x4fd7('0x4'));var fs=require('fs');var path=require(_0x4fd7('0x5'));var rimraf=require(_0x4fd7('0x6'));var config=require(_0x4fd7('0x7'));var attributes=require(_0x4fd7('0x8'));module['exports']=function(_0x4dd242,_0x32ef68){return _0x4dd242['define'](_0x4fd7('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2292=['exports','AnalyticDefaultReport','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2292,0x91));var _0x2229=function(_0x727dfa,_0x2327cf){_0x727dfa=_0x727dfa-0x0;var _0x1562ad=_0x2292[_0x727dfa];return _0x1562ad;};'use strict';var _=require(_0x2229('0x0'));var util=require('util');var logger=require(_0x2229('0x1'))(_0x2229('0x2'));var moment=require(_0x2229('0x3'));var BPromise=require(_0x2229('0x4'));var rp=require(_0x2229('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2229('0x6'));var config=require(_0x2229('0x7'));var attributes=require(_0x2229('0x8'));module[_0x2229('0x9')]=function(_0x42dd53,_0x55945c){return _0x42dd53['define'](_0x2229('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 7c1e622..72437e8 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 _0x3b70=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','AnalyticDefaultReport,\x20%s,\x20%s','message','info'];(function(_0x51c2ad,_0x3c87e2){var _0x157264=function(_0x32d3a4){while(--_0x32d3a4){_0x51c2ad['push'](_0x51c2ad['shift']());}};_0x157264(++_0x3c87e2);}(_0x3b70,0x1b9));var _0x03b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3b70[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x03b7('0x0'));var util=require(_0x03b7('0x1'));var moment=require(_0x03b7('0x2'));var BPromise=require(_0x03b7('0x3'));var rs=require(_0x03b7('0x4'));var fs=require('fs');var Redis=require(_0x03b7('0x5'));var db=require(_0x03b7('0x6'))['db'];var utils=require(_0x03b7('0x7'));var logger=require(_0x03b7('0x8'))(_0x03b7('0x9'));var config=require('../../config/environment');var jayson=require(_0x03b7('0xa'));var client=jayson['client'][_0x03b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3024b2,_0x41ea9a,_0x2e65d5){return new BPromise(function(_0x4255e1,_0xb4d674){return client[_0x03b7('0xc')](_0x3024b2,_0x2e65d5)['then'](function(_0x5a4b21){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x41ea9a,_0x03b7('0xd'));logger[_0x03b7('0xe')](_0x03b7('0xf'),_0x41ea9a,'request\x20sent',JSON['stringify'](_0x5a4b21));if(_0x5a4b21['error']){if(_0x5a4b21['error'][_0x03b7('0x10')]===0x1f4){logger[_0x03b7('0x11')](_0x03b7('0x12'),_0x41ea9a,_0x5a4b21[_0x03b7('0x11')][_0x03b7('0x13')]);return _0xb4d674(_0x5a4b21['error'][_0x03b7('0x13')]);}logger['error'](_0x03b7('0x12'),_0x41ea9a,_0x5a4b21['error']['message']);return _0x4255e1(_0x5a4b21[_0x03b7('0x11')]['message']);}else{logger[_0x03b7('0x14')](_0x03b7('0x12'),_0x41ea9a,_0x03b7('0xd'));_0x4255e1(_0x5a4b21['result'][_0x03b7('0x13')]);}})[_0x03b7('0x15')](function(_0x521c60){logger['error'](_0x03b7('0x12'),_0x41ea9a,_0x521c60);_0xb4d674(_0x521c60);});});} \ No newline at end of file +var _0x302f=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x49f4a7,_0x5346e7){var _0x579df8=function(_0x4aa1f9){while(--_0x4aa1f9){_0x49f4a7['push'](_0x49f4a7['shift']());}};_0x579df8(++_0x5346e7);}(_0x302f,0x162));var _0xf302=function(_0x54a450,_0x144a6a){_0x54a450=_0x54a450-0x0;var _0x2eb2d5=_0x302f[_0x54a450];return _0x2eb2d5;};'use strict';var _=require(_0xf302('0x0'));var util=require(_0xf302('0x1'));var moment=require(_0xf302('0x2'));var BPromise=require(_0xf302('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf302('0x4'));var db=require(_0xf302('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf302('0x6'))(_0xf302('0x7'));var config=require(_0xf302('0x8'));var jayson=require(_0xf302('0x9'));var client=jayson[_0xf302('0xa')][_0xf302('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21fa2d,_0x534a23,_0x35313c){return new BPromise(function(_0x326d97,_0x4f9224){return client[_0xf302('0xc')](_0x21fa2d,_0x35313c)[_0xf302('0xd')](function(_0x3941f4){logger[_0xf302('0xe')](_0xf302('0xf'),_0x534a23,'request\x20sent');logger[_0xf302('0x10')](_0xf302('0x11'),_0x534a23,_0xf302('0x12'),JSON[_0xf302('0x13')](_0x3941f4));if(_0x3941f4['error']){if(_0x3941f4[_0xf302('0x14')][_0xf302('0x15')]===0x1f4){logger[_0xf302('0x14')](_0xf302('0xf'),_0x534a23,_0x3941f4[_0xf302('0x14')]['message']);return _0x4f9224(_0x3941f4[_0xf302('0x14')][_0xf302('0x16')]);}logger[_0xf302('0x14')](_0xf302('0xf'),_0x534a23,_0x3941f4['error'][_0xf302('0x16')]);return _0x326d97(_0x3941f4[_0xf302('0x14')][_0xf302('0x16')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x534a23,'request\x20sent');_0x326d97(_0x3941f4[_0xf302('0x17')][_0xf302('0x16')]);}})[_0xf302('0x18')](function(_0x15e8e4){logger[_0xf302('0x14')](_0xf302('0xf'),_0x534a23,_0x15e8e4);_0x4f9224(_0x15e8e4);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index fde6c95..a165996 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 _0xf34e=['../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf34e,0x145));var _0xef34=function(_0x19ba56,_0x415ff8){_0x19ba56=_0x19ba56-0x0;var _0x32046e=_0xf34e[_0x19ba56];return _0x32046e;};'use strict';var multer=require(_0xef34('0x0'));var util=require(_0xef34('0x1'));var path=require('path');var timeout=require(_0xef34('0x2'));var express=require(_0xef34('0x3'));var router=express['Router']();var fs_extra=require(_0xef34('0x4'));var auth=require(_0xef34('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef34('0x6'));var controller=require(_0xef34('0x7'));router[_0xef34('0x8')]('/',auth[_0xef34('0x9')](),controller[_0xef34('0xa')]);router[_0xef34('0x8')](_0xef34('0xb'),auth[_0xef34('0x9')](),controller['show']);router[_0xef34('0x8')](_0xef34('0xc'),auth[_0xef34('0x9')](),controller['preview']);router[_0xef34('0x8')]('/:id/run',auth[_0xef34('0x9')](),controller[_0xef34('0xd')]);router[_0xef34('0x8')](_0xef34('0xe'),auth[_0xef34('0x9')](),controller[_0xef34('0xf')]);router[_0xef34('0x10')]('/',auth[_0xef34('0x9')](),controller[_0xef34('0x11')]);router['put'](_0xef34('0xb'),auth[_0xef34('0x9')](),controller[_0xef34('0x12')]);router[_0xef34('0x13')](_0xef34('0xb'),auth[_0xef34('0x9')](),controller[_0xef34('0x14')]);module[_0xef34('0x15')]=router; \ No newline at end of file +var _0xc65b=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xc65b,0x12f));var _0xbc65=function(_0x35268e,_0x4acfd1){_0x35268e=_0x35268e-0x0;var _0x28ba11=_0xc65b[_0x35268e];return _0x28ba11;};'use strict';var multer=require('multer');var util=require(_0xbc65('0x0'));var path=require(_0xbc65('0x1'));var timeout=require(_0xbc65('0x2'));var express=require(_0xbc65('0x3'));var router=express[_0xbc65('0x4')]();var fs_extra=require(_0xbc65('0x5'));var auth=require(_0xbc65('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbc65('0x7'));var controller=require(_0xbc65('0x8'));router['get']('/',auth[_0xbc65('0x9')](),controller[_0xbc65('0xa')]);router[_0xbc65('0xb')](_0xbc65('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbc65('0xb')](_0xbc65('0xd'),auth[_0xbc65('0x9')](),controller[_0xbc65('0xe')]);router[_0xbc65('0xb')](_0xbc65('0xf'),auth[_0xbc65('0x9')](),controller[_0xbc65('0x10')]);router[_0xbc65('0xb')](_0xbc65('0x11'),auth[_0xbc65('0x9')](),controller[_0xbc65('0x12')]);router[_0xbc65('0x13')]('/',auth['isAuthenticated'](),controller[_0xbc65('0x14')]);router[_0xbc65('0x15')](_0xbc65('0xc'),auth[_0xbc65('0x9')](),controller[_0xbc65('0x16')]);router['delete']('/:id',auth[_0xbc65('0x9')](),controller[_0xbc65('0x17')]);module[_0xbc65('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index f2e3d8a..4ea4ca8 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 _0x1bde=['DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','xlsx','csv'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1bde,0x157));var _0xe1bd=function(_0x3ce221,_0x22d678){_0x3ce221=_0x3ce221-0x0;var _0x3995b8=_0x1bde[_0x3ce221];return _0x3995b8;};'use strict';var Sequelize=require(_0xe1bd('0x0'));var moment=require('moment');module[_0xe1bd('0x1')]={'name':{'type':Sequelize[_0xe1bd('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe1bd('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xe1bd('0x3')),'allowNull':![],'defaultValue':_0xe1bd('0x4')},'savename':{'type':Sequelize[_0xe1bd('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe1bd('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xe1bd('0x6')},'type':{'type':Sequelize[_0xe1bd('0x7')](_0xe1bd('0x8'),_0xe1bd('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe1bd('0xa')](0xb)[_0xe1bd('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6670=['scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x5eb199,_0x29cd23){var _0x366ff3=function(_0x20d8d4){while(--_0x20d8d4){_0x5eb199['push'](_0x5eb199['shift']());}};_0x366ff3(++_0x29cd23);}(_0x6670,0x10b));var _0x0667=function(_0x3eea80,_0x127f1a){_0x3eea80=_0x3eea80-0x0;var _0x1e6a81=_0x6670[_0x3eea80];return _0x1e6a81;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x0667('0x0')]={'name':{'type':Sequelize[_0x0667('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x0667('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x0667('0x2')](_0x0667('0x3'),_0x0667('0x4'),_0x0667('0x5')),'allowNull':![],'defaultValue':_0x0667('0x3')},'savename':{'type':Sequelize[_0x0667('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0667('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x0667('0x7')},'type':{'type':Sequelize[_0x0667('0x2')]('manual',_0x0667('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x0667('0x9')](0xb)[_0x0667('0xa')]},'reportType':{'type':Sequelize[_0x0667('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 11ab81b..7faea82 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 _0xdc44=['status','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','findAll','rows','catch','show','params','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','download','basename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','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','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','sendStatus','error','stack','name'];(function(_0x29982b,_0x594e0){var _0xb1f0a9=function(_0x3d824c){while(--_0x3d824c){_0x29982b['push'](_0x29982b['shift']());}};_0xb1f0a9(++_0x594e0);}(_0xdc44,0x1ac));var _0x4dc4=function(_0x19fa95,_0x1cca0a){_0x19fa95=_0x19fa95-0x0;var _0x58a835=_0xdc44[_0x19fa95];return _0x58a835;};'use strict';var emlformat=require(_0x4dc4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4dc4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4dc4('0x2'));var Mustache=require(_0x4dc4('0x3'));var util=require('util');var path=require(_0x4dc4('0x4'));var sox=require(_0x4dc4('0x5'));var csv=require(_0x4dc4('0x6'));var ejs=require(_0x4dc4('0x7'));var fs=require('fs');var fs_extra=require(_0x4dc4('0x8'));var _=require(_0x4dc4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4dc4('0xa'));var deskjs=require(_0x4dc4('0xb'));var toCsv=require(_0x4dc4('0x6'));var querystring=require(_0x4dc4('0xc'));var Papa=require(_0x4dc4('0xd'));var Redis=require('ioredis');var authService=require(_0x4dc4('0xe'));var qs=require(_0x4dc4('0xf'));var as=require(_0x4dc4('0x10'));var hardwareService=require(_0x4dc4('0x11'));var logger=require(_0x4dc4('0x12'))(_0x4dc4('0x13'));var utils=require(_0x4dc4('0x14'));var config=require(_0x4dc4('0x15'));var licenseUtil=require(_0x4dc4('0x16'));var db=require(_0x4dc4('0x17'))['db'];function respondWithStatusCode(_0x50516f,_0x201bbd){_0x201bbd=_0x201bbd||0xcc;return function(_0x4cfd42){if(_0x4cfd42){return _0x50516f['sendStatus'](_0x201bbd);}return _0x50516f['status'](_0x201bbd)[_0x4dc4('0x18')]();};}function respondWithResult(_0x4ec29f,_0x19af05){_0x19af05=_0x19af05||0xc8;return function(_0x258592){if(_0x258592){return _0x4ec29f['status'](_0x19af05)[_0x4dc4('0x19')](_0x258592);}};}function respondWithFilteredResult(_0x2701de,_0xab5f4c){return function(_0x13a234){if(_0x13a234){var _0x32c062=typeof _0xab5f4c[_0x4dc4('0x1a')]==='undefined'&&typeof _0xab5f4c[_0x4dc4('0x1b')]===_0x4dc4('0x1c');var _0x194f7f=_0x13a234['count'];var _0x53bb9d=_0x32c062?0x0:_0xab5f4c[_0x4dc4('0x1a')];var _0x32d224=_0x32c062?_0x13a234[_0x4dc4('0x1d')]:_0xab5f4c[_0x4dc4('0x1a')]+_0xab5f4c[_0x4dc4('0x1b')];var _0xa9238b;if(_0x32d224>=_0x194f7f){_0x32d224=_0x194f7f;_0xa9238b=0xc8;}else{_0xa9238b=0xce;}_0x2701de['status'](_0xa9238b);return _0x2701de[_0x4dc4('0x1e')](_0x4dc4('0x1f'),_0x53bb9d+'-'+_0x32d224+'/'+_0x194f7f)[_0x4dc4('0x19')](_0x13a234);}return null;};}function patchUpdates(_0x5385f4){return function(_0x5e56a3){try{jsonpatch[_0x4dc4('0x20')](_0x5e56a3,_0x5385f4,!![]);}catch(_0xc0369e){return BPromise['reject'](_0xc0369e);}return _0x5e56a3[_0x4dc4('0x21')]();};}function saveUpdates(_0x2bd00f,_0x169b1c){return function(_0x1b5698){if(_0x1b5698){return _0x1b5698[_0x4dc4('0x22')](_0x2bd00f)[_0x4dc4('0x23')](function(_0x57c29b){return _0x57c29b;});}return null;};}function removeEntity(_0x3da1fc,_0x13d450){return function(_0x2e29f5){if(_0x2e29f5){return _0x2e29f5['destroy']()[_0x4dc4('0x23')](function(){var _0x567de6=_0x2e29f5[_0x4dc4('0x24')]({'plain':!![]});var _0x4844='ExtractedReports';return db[_0x4dc4('0x25')]['destroy']({'where':{'type':_0x4844,'resourceId':_0x567de6['id']}})[_0x4dc4('0x23')](function(){return _0x2e29f5;});})[_0x4dc4('0x23')](function(){_0x3da1fc['status'](0xcc)[_0x4dc4('0x18')]();});}};}function handleEntityNotFound(_0x377127,_0x115ab4){return function(_0x2c5c58){if(!_0x2c5c58){_0x377127[_0x4dc4('0x26')](0x194);}return _0x2c5c58;};}function handleError(_0x39a9f4,_0x1b7f6a){_0x1b7f6a=_0x1b7f6a||0x1f4;return function(_0x347ad1){logger[_0x4dc4('0x27')](_0x347ad1[_0x4dc4('0x28')]);if(_0x347ad1[_0x4dc4('0x29')]){delete _0x347ad1['name'];}_0x39a9f4[_0x4dc4('0x2a')](_0x1b7f6a)[_0x4dc4('0x2b')](_0x347ad1);};}exports[_0x4dc4('0x2c')]=function(_0x75a948,_0x27b6fc){var _0x1218e9={},_0x1c1f8f={},_0x571fef={'count':0x0,'rows':[]};var _0x484d52=_[_0x4dc4('0x2d')](db[_0x4dc4('0x2e')][_0x4dc4('0x2f')],function(_0x12c665){return{'name':_0x12c665[_0x4dc4('0x30')],'type':_0x12c665[_0x4dc4('0x31')]['key']};});_0x1c1f8f[_0x4dc4('0x32')]=_[_0x4dc4('0x2d')](_0x484d52,_0x4dc4('0x29'));_0x1c1f8f[_0x4dc4('0x33')]=_[_0x4dc4('0x34')](_0x75a948['query']);_0x1c1f8f[_0x4dc4('0x35')]=_[_0x4dc4('0x36')](_0x1c1f8f[_0x4dc4('0x32')],_0x1c1f8f[_0x4dc4('0x33')]);_0x1218e9[_0x4dc4('0x37')]=_[_0x4dc4('0x36')](_0x1c1f8f[_0x4dc4('0x32')],qs[_0x4dc4('0x38')](_0x75a948[_0x4dc4('0x33')][_0x4dc4('0x38')]));_0x1218e9[_0x4dc4('0x37')]=_0x1218e9[_0x4dc4('0x37')]['length']?_0x1218e9[_0x4dc4('0x37')]:_0x1c1f8f[_0x4dc4('0x32')];if(!_0x75a948['query'][_0x4dc4('0x39')]('nolimit')){_0x1218e9[_0x4dc4('0x1b')]=qs['limit'](_0x75a948[_0x4dc4('0x33')]['limit']);_0x1218e9[_0x4dc4('0x1a')]=qs[_0x4dc4('0x1a')](_0x75a948['query'][_0x4dc4('0x1a')]);}_0x1218e9[_0x4dc4('0x3a')]=qs['sort'](_0x75a948[_0x4dc4('0x33')][_0x4dc4('0x3b')]);_0x1218e9[_0x4dc4('0x3c')]=qs[_0x4dc4('0x35')](_[_0x4dc4('0x3d')](_0x75a948[_0x4dc4('0x33')],_0x1c1f8f['filters']),_0x484d52);if(_0x75a948['query']['filter']){_0x1218e9[_0x4dc4('0x3c')]=_[_0x4dc4('0x3e')](_0x1218e9[_0x4dc4('0x3c')],{'$or':_['map'](_0x484d52,function(_0x411575){if(_0x411575['type']!=='VIRTUAL'){var _0x179409={};_0x179409[_0x411575[_0x4dc4('0x29')]]={'$like':'%'+_0x75a948[_0x4dc4('0x33')][_0x4dc4('0x3f')]+'%'};return _0x179409;}})});}_0x1218e9=_[_0x4dc4('0x3e')]({},_0x1218e9,_0x75a948[_0x4dc4('0x40')]);var _0x155b39={'where':_0x1218e9[_0x4dc4('0x3c')]};return db['AnalyticExtractedReport'][_0x4dc4('0x1d')](_0x155b39)[_0x4dc4('0x23')](function(_0x499bdc){_0x571fef[_0x4dc4('0x1d')]=_0x499bdc;if(_0x75a948[_0x4dc4('0x33')]['includeAll']){_0x1218e9['include']=[{'all':!![]}];}return db[_0x4dc4('0x2e')][_0x4dc4('0x41')](_0x1218e9);})[_0x4dc4('0x23')](function(_0x9dc5ba){_0x571fef[_0x4dc4('0x42')]=_0x9dc5ba;return _0x571fef;})[_0x4dc4('0x23')](respondWithFilteredResult(_0x27b6fc,_0x1218e9))[_0x4dc4('0x43')](handleError(_0x27b6fc,null));};exports[_0x4dc4('0x44')]=function(_0xde0693,_0x50d284){var _0xa55e84={'raw':!![],'where':{'id':_0xde0693[_0x4dc4('0x45')]['id']}},_0x3a3a1f={};_0x3a3a1f[_0x4dc4('0x32')]=_[_0x4dc4('0x34')](db['AnalyticExtractedReport']['rawAttributes']);_0x3a3a1f[_0x4dc4('0x33')]=_[_0x4dc4('0x34')](_0xde0693[_0x4dc4('0x33')]);_0x3a3a1f[_0x4dc4('0x35')]=_[_0x4dc4('0x36')](_0x3a3a1f[_0x4dc4('0x32')],_0x3a3a1f['query']);_0xa55e84[_0x4dc4('0x37')]=_[_0x4dc4('0x36')](_0x3a3a1f[_0x4dc4('0x32')],qs[_0x4dc4('0x38')](_0xde0693['query'][_0x4dc4('0x38')]));_0xa55e84[_0x4dc4('0x37')]=_0xa55e84[_0x4dc4('0x37')][_0x4dc4('0x46')]?_0xa55e84[_0x4dc4('0x37')]:_0x3a3a1f[_0x4dc4('0x32')];if(_0xde0693[_0x4dc4('0x33')]['includeAll']){_0xa55e84[_0x4dc4('0x47')]=[{'all':!![]}];}_0xa55e84=_[_0x4dc4('0x3e')]({},_0xa55e84,_0xde0693[_0x4dc4('0x40')]);return db[_0x4dc4('0x2e')]['find'](_0xa55e84)['then'](handleEntityNotFound(_0x50d284,null))[_0x4dc4('0x23')](respondWithResult(_0x50d284,null))[_0x4dc4('0x43')](handleError(_0x50d284,null));};exports[_0x4dc4('0x48')]=function(_0x6ec897,_0x333359){return db[_0x4dc4('0x2e')]['create'](_0x6ec897['body'],{})[_0x4dc4('0x23')](function(_0x325ffd){var _0x3b3092=_0x6ec897[_0x4dc4('0x49')][_0x4dc4('0x24')]({'plain':!![]});if(!_0x3b3092)throw new Error(_0x4dc4('0x4a'));if(_0x3b3092['role']===_0x4dc4('0x49')){var _0x2948b9=_0x325ffd[_0x4dc4('0x24')]({'plain':!![]});var _0x171914=_0x4dc4('0x4b');return db[_0x4dc4('0x4c')][_0x4dc4('0x4d')]({'where':{'name':_0x171914,'userProfileId':_0x3b3092[_0x4dc4('0x4e')]},'raw':!![]})['then'](function(_0x45bdd5){if(_0x45bdd5&&_0x45bdd5['autoAssociation']===0x0){return db[_0x4dc4('0x25')][_0x4dc4('0x48')]({'name':_0x2948b9[_0x4dc4('0x29')],'resourceId':_0x2948b9['id'],'type':_0x45bdd5[_0x4dc4('0x29')],'sectionId':_0x45bdd5['id']},{})[_0x4dc4('0x23')](function(){return _0x325ffd;});}else{return _0x325ffd;}})[_0x4dc4('0x43')](function(_0x60eeb0){logger[_0x4dc4('0x27')](_0x4dc4('0x4f'),_0x60eeb0);throw _0x60eeb0;});}return _0x325ffd;})[_0x4dc4('0x23')](respondWithResult(_0x333359,0xc9))['catch'](handleError(_0x333359,null));};exports[_0x4dc4('0x22')]=function(_0x1dbd9a,_0x57a357){if(_0x1dbd9a[_0x4dc4('0x50')]['id']){delete _0x1dbd9a['body']['id'];}return db[_0x4dc4('0x2e')][_0x4dc4('0x4d')]({'where':{'id':_0x1dbd9a['params']['id']}})[_0x4dc4('0x23')](handleEntityNotFound(_0x57a357,null))[_0x4dc4('0x23')](saveUpdates(_0x1dbd9a[_0x4dc4('0x50')],null))['then'](respondWithResult(_0x57a357,null))[_0x4dc4('0x43')](handleError(_0x57a357,null));};exports[_0x4dc4('0x51')]=function(_0x3523a6,_0x27429e){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3523a6[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x23')](handleEntityNotFound(_0x27429e,null))[_0x4dc4('0x23')](removeEntity(_0x27429e,null))[_0x4dc4('0x43')](handleError(_0x27429e,null));};exports[_0x4dc4('0x52')]=function(_0x32bc11,_0x116ca0,_0x5ab3b4){return db[_0x4dc4('0x2e')]['find']({'where':{'id':_0x32bc11[_0x4dc4('0x45')]['id']},'attributes':[_0x4dc4('0x29'),_0x4dc4('0x53'),'savename',_0x4dc4('0x54')],'raw':!![]})[_0x4dc4('0x23')](handleEntityNotFound(_0x116ca0,null))[_0x4dc4('0x23')](function(_0x483b86){if(_0x483b86){if(!fs['existsSync'](path[_0x4dc4('0x55')](config[_0x4dc4('0x56')],_0x4dc4('0x57'),_0x483b86['savename']))){throw new db[(_0x4dc4('0x58'))]['ValidationError'](_0x4dc4('0x59'));}if(_0x32bc11[_0x4dc4('0x33')][_0x4dc4('0x5a')]){return _0x116ca0[_0x4dc4('0x26')](0xc8);}return _0x116ca0[_0x4dc4('0x52')](path[_0x4dc4('0x55')](config['root'],_0x4dc4('0x57'),_0x483b86['savename']),util[_0x4dc4('0x5b')](_0x4dc4('0x5c'),_0x483b86['basename']||_0x483b86['name'],_0x483b86[_0x4dc4('0x54')][_0x4dc4('0x5d')]()));}})[_0x4dc4('0x43')](handleError(_0x116ca0,null));}; \ No newline at end of file +var _0xc7bb=['length','find','catch','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','server/files/reports','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','rows','show','params'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc7bb,0xd7));var _0xbc7b=function(_0x8782ff,_0x3df2d9){_0x8782ff=_0x8782ff-0x0;var _0x2fa4cb=_0xc7bb[_0x8782ff];return _0x2fa4cb;};'use strict';var emlformat=require(_0xbc7b('0x0'));var rimraf=require(_0xbc7b('0x1'));var zipdir=require(_0xbc7b('0x2'));var jsonpatch=require(_0xbc7b('0x3'));var rp=require(_0xbc7b('0x4'));var moment=require(_0xbc7b('0x5'));var BPromise=require(_0xbc7b('0x6'));var Mustache=require(_0xbc7b('0x7'));var util=require(_0xbc7b('0x8'));var path=require(_0xbc7b('0x9'));var sox=require(_0xbc7b('0xa'));var csv=require(_0xbc7b('0xb'));var ejs=require(_0xbc7b('0xc'));var fs=require('fs');var fs_extra=require(_0xbc7b('0xd'));var _=require(_0xbc7b('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbc7b('0xf'));var toCsv=require(_0xbc7b('0xb'));var querystring=require(_0xbc7b('0x10'));var Papa=require(_0xbc7b('0x11'));var Redis=require('ioredis');var authService=require(_0xbc7b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbc7b('0x13'));var hardwareService=require(_0xbc7b('0x14'));var logger=require(_0xbc7b('0x15'))(_0xbc7b('0x16'));var utils=require(_0xbc7b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbc7b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x326a02,_0x443ef6){_0x443ef6=_0x443ef6||0xcc;return function(_0x4d9d47){if(_0x4d9d47){return _0x326a02[_0xbc7b('0x19')](_0x443ef6);}return _0x326a02['status'](_0x443ef6)[_0xbc7b('0x1a')]();};}function respondWithResult(_0x340ad2,_0x3d32bd){_0x3d32bd=_0x3d32bd||0xc8;return function(_0x564d98){if(_0x564d98){return _0x340ad2[_0xbc7b('0x1b')](_0x3d32bd)[_0xbc7b('0x1c')](_0x564d98);}};}function respondWithFilteredResult(_0x330228,_0x248c4a){return function(_0x386477){if(_0x386477){var _0x3d1bed=typeof _0x248c4a['offset']===_0xbc7b('0x1d')&&typeof _0x248c4a[_0xbc7b('0x1e')]===_0xbc7b('0x1d');var _0x15255e=_0x386477[_0xbc7b('0x1f')];var _0x2d95cb=_0x3d1bed?0x0:_0x248c4a['offset'];var _0x5998ed=_0x3d1bed?_0x386477[_0xbc7b('0x1f')]:_0x248c4a[_0xbc7b('0x20')]+_0x248c4a['limit'];var _0x220512;if(_0x5998ed>=_0x15255e){_0x5998ed=_0x15255e;_0x220512=0xc8;}else{_0x220512=0xce;}_0x330228['status'](_0x220512);return _0x330228[_0xbc7b('0x21')]('Content-Range',_0x2d95cb+'-'+_0x5998ed+'/'+_0x15255e)['json'](_0x386477);}return null;};}function patchUpdates(_0xf0aa96){return function(_0x254a27){try{jsonpatch['apply'](_0x254a27,_0xf0aa96,!![]);}catch(_0x186e7b){return BPromise[_0xbc7b('0x22')](_0x186e7b);}return _0x254a27[_0xbc7b('0x23')]();};}function saveUpdates(_0x35f605,_0x5aa803){return function(_0x26e147){if(_0x26e147){return _0x26e147['update'](_0x35f605)[_0xbc7b('0x24')](function(_0x1663dd){return _0x1663dd;});}return null;};}function removeEntity(_0x533e38,_0x590e2b){return function(_0xe1519b){if(_0xe1519b){return _0xe1519b[_0xbc7b('0x25')]()['then'](function(){var _0x52d0e5=_0xe1519b[_0xbc7b('0x26')]({'plain':!![]});var _0x2e56d0=_0xbc7b('0x27');return db[_0xbc7b('0x28')][_0xbc7b('0x25')]({'where':{'type':_0x2e56d0,'resourceId':_0x52d0e5['id']}})[_0xbc7b('0x24')](function(){return _0xe1519b;});})[_0xbc7b('0x24')](function(){_0x533e38[_0xbc7b('0x1b')](0xcc)[_0xbc7b('0x1a')]();});}};}function handleEntityNotFound(_0x5be8f6,_0x35c19c){return function(_0x400341){if(!_0x400341){_0x5be8f6[_0xbc7b('0x19')](0x194);}return _0x400341;};}function handleError(_0x4bbd62,_0x47850d){_0x47850d=_0x47850d||0x1f4;return function(_0x59bd8b){logger[_0xbc7b('0x29')](_0x59bd8b[_0xbc7b('0x2a')]);if(_0x59bd8b[_0xbc7b('0x2b')]){delete _0x59bd8b[_0xbc7b('0x2b')];}_0x4bbd62[_0xbc7b('0x1b')](_0x47850d)[_0xbc7b('0x2c')](_0x59bd8b);};}exports[_0xbc7b('0x2d')]=function(_0x1754c2,_0x432f27){var _0x496d5c={},_0x1059ae={},_0x405ebd={'count':0x0,'rows':[]};var _0x5327da=_['map'](db[_0xbc7b('0x2e')][_0xbc7b('0x2f')],function(_0x3ff370){return{'name':_0x3ff370[_0xbc7b('0x30')],'type':_0x3ff370[_0xbc7b('0x31')][_0xbc7b('0x32')]};});_0x1059ae['model']=_['map'](_0x5327da,_0xbc7b('0x2b'));_0x1059ae[_0xbc7b('0x33')]=_[_0xbc7b('0x34')](_0x1754c2['query']);_0x1059ae[_0xbc7b('0x35')]=_[_0xbc7b('0x36')](_0x1059ae['model'],_0x1059ae[_0xbc7b('0x33')]);_0x496d5c[_0xbc7b('0x37')]=_['intersection'](_0x1059ae[_0xbc7b('0x38')],qs[_0xbc7b('0x39')](_0x1754c2[_0xbc7b('0x33')][_0xbc7b('0x39')]));_0x496d5c[_0xbc7b('0x37')]=_0x496d5c[_0xbc7b('0x37')]['length']?_0x496d5c[_0xbc7b('0x37')]:_0x1059ae['model'];if(!_0x1754c2['query'][_0xbc7b('0x3a')](_0xbc7b('0x3b'))){_0x496d5c[_0xbc7b('0x1e')]=qs['limit'](_0x1754c2['query'][_0xbc7b('0x1e')]);_0x496d5c['offset']=qs[_0xbc7b('0x20')](_0x1754c2[_0xbc7b('0x33')][_0xbc7b('0x20')]);}_0x496d5c[_0xbc7b('0x3c')]=qs[_0xbc7b('0x3d')](_0x1754c2['query'][_0xbc7b('0x3d')]);_0x496d5c[_0xbc7b('0x3e')]=qs[_0xbc7b('0x35')](_[_0xbc7b('0x3f')](_0x1754c2['query'],_0x1059ae[_0xbc7b('0x35')]),_0x5327da);if(_0x1754c2[_0xbc7b('0x33')]['filter']){_0x496d5c[_0xbc7b('0x3e')]=_[_0xbc7b('0x40')](_0x496d5c[_0xbc7b('0x3e')],{'$or':_[_0xbc7b('0x41')](_0x5327da,function(_0x3de363){if(_0x3de363[_0xbc7b('0x31')]!=='VIRTUAL'){var _0x3fc00c={};_0x3fc00c[_0x3de363[_0xbc7b('0x2b')]]={'$like':'%'+_0x1754c2[_0xbc7b('0x33')][_0xbc7b('0x42')]+'%'};return _0x3fc00c;}})});}_0x496d5c=_[_0xbc7b('0x40')]({},_0x496d5c,_0x1754c2[_0xbc7b('0x43')]);var _0x741019={'where':_0x496d5c['where']};return db[_0xbc7b('0x2e')][_0xbc7b('0x1f')](_0x741019)[_0xbc7b('0x24')](function(_0x41e5d5){_0x405ebd[_0xbc7b('0x1f')]=_0x41e5d5;if(_0x1754c2[_0xbc7b('0x33')][_0xbc7b('0x44')]){_0x496d5c[_0xbc7b('0x45')]=[{'all':!![]}];}return db[_0xbc7b('0x2e')]['findAll'](_0x496d5c);})[_0xbc7b('0x24')](function(_0x5381e5){_0x405ebd[_0xbc7b('0x46')]=_0x5381e5;return _0x405ebd;})[_0xbc7b('0x24')](respondWithFilteredResult(_0x432f27,_0x496d5c))['catch'](handleError(_0x432f27,null));};exports[_0xbc7b('0x47')]=function(_0x4b3530,_0x443ac7){var _0x5e5675={'raw':!![],'where':{'id':_0x4b3530[_0xbc7b('0x48')]['id']}},_0x153326={};_0x153326[_0xbc7b('0x38')]=_[_0xbc7b('0x34')](db[_0xbc7b('0x2e')][_0xbc7b('0x2f')]);_0x153326[_0xbc7b('0x33')]=_[_0xbc7b('0x34')](_0x4b3530[_0xbc7b('0x33')]);_0x153326[_0xbc7b('0x35')]=_[_0xbc7b('0x36')](_0x153326[_0xbc7b('0x38')],_0x153326[_0xbc7b('0x33')]);_0x5e5675['attributes']=_[_0xbc7b('0x36')](_0x153326[_0xbc7b('0x38')],qs[_0xbc7b('0x39')](_0x4b3530[_0xbc7b('0x33')]['fields']));_0x5e5675['attributes']=_0x5e5675[_0xbc7b('0x37')][_0xbc7b('0x49')]?_0x5e5675[_0xbc7b('0x37')]:_0x153326[_0xbc7b('0x38')];if(_0x4b3530[_0xbc7b('0x33')][_0xbc7b('0x44')]){_0x5e5675[_0xbc7b('0x45')]=[{'all':!![]}];}_0x5e5675=_[_0xbc7b('0x40')]({},_0x5e5675,_0x4b3530[_0xbc7b('0x43')]);return db[_0xbc7b('0x2e')][_0xbc7b('0x4a')](_0x5e5675)[_0xbc7b('0x24')](handleEntityNotFound(_0x443ac7,null))[_0xbc7b('0x24')](respondWithResult(_0x443ac7,null))[_0xbc7b('0x4b')](handleError(_0x443ac7,null));};exports[_0xbc7b('0x4c')]=function(_0x460058,_0x238619){return db['AnalyticExtractedReport'][_0xbc7b('0x4c')](_0x460058['body'],{})['then'](function(_0x7dd4c7){var _0xaba875=_0x460058[_0xbc7b('0x4d')][_0xbc7b('0x26')]({'plain':!![]});if(!_0xaba875)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaba875['role']===_0xbc7b('0x4d')){var _0x22f4d5=_0x7dd4c7['get']({'plain':!![]});var _0x14f461=_0xbc7b('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x14f461,'userProfileId':_0xaba875[_0xbc7b('0x4e')]},'raw':!![]})[_0xbc7b('0x24')](function(_0xe3a56a){if(_0xe3a56a&&_0xe3a56a[_0xbc7b('0x4f')]===0x0){return db['UserProfileResource'][_0xbc7b('0x4c')]({'name':_0x22f4d5[_0xbc7b('0x2b')],'resourceId':_0x22f4d5['id'],'type':_0xe3a56a[_0xbc7b('0x2b')],'sectionId':_0xe3a56a['id']},{})[_0xbc7b('0x24')](function(){return _0x7dd4c7;});}else{return _0x7dd4c7;}})[_0xbc7b('0x4b')](function(_0x488f6f){logger[_0xbc7b('0x29')](_0xbc7b('0x50'),_0x488f6f);throw _0x488f6f;});}return _0x7dd4c7;})['then'](respondWithResult(_0x238619,0xc9))['catch'](handleError(_0x238619,null));};exports[_0xbc7b('0x51')]=function(_0x1165b5,_0x1059ce){if(_0x1165b5[_0xbc7b('0x52')]['id']){delete _0x1165b5[_0xbc7b('0x52')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1165b5[_0xbc7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1059ce,null))[_0xbc7b('0x24')](saveUpdates(_0x1165b5[_0xbc7b('0x52')],null))[_0xbc7b('0x24')](respondWithResult(_0x1059ce,null))['catch'](handleError(_0x1059ce,null));};exports['destroy']=function(_0x20b856,_0x1ae259){return db[_0xbc7b('0x2e')]['find']({'where':{'id':_0x20b856[_0xbc7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ae259,null))[_0xbc7b('0x24')](removeEntity(_0x1ae259,null))[_0xbc7b('0x4b')](handleError(_0x1ae259,null));};exports['download']=function(_0x8f362f,_0x5b017a,_0x5ac1b5){return db[_0xbc7b('0x2e')][_0xbc7b('0x4a')]({'where':{'id':_0x8f362f[_0xbc7b('0x48')]['id']},'attributes':[_0xbc7b('0x2b'),_0xbc7b('0x53'),_0xbc7b('0x54'),_0xbc7b('0x55')],'raw':!![]})[_0xbc7b('0x24')](handleEntityNotFound(_0x5b017a,null))[_0xbc7b('0x24')](function(_0x52b373){if(_0x52b373){if(!fs[_0xbc7b('0x56')](path[_0xbc7b('0x57')](config[_0xbc7b('0x58')],'server/files/reports',_0x52b373['savename']))){throw new db[(_0xbc7b('0x59'))][(_0xbc7b('0x5a'))](_0xbc7b('0x5b'));}if(_0x8f362f['query']['exists']){return _0x5b017a[_0xbc7b('0x19')](0xc8);}return _0x5b017a[_0xbc7b('0x5c')](path[_0xbc7b('0x57')](config[_0xbc7b('0x58')],_0xbc7b('0x5d'),_0x52b373[_0xbc7b('0x54')]),util['format'](_0xbc7b('0x5e'),_0x52b373[_0xbc7b('0x53')]||_0x52b373['name'],_0x52b373[_0xbc7b('0x55')][_0xbc7b('0x5f')]()));}})[_0xbc7b('0x4b')](handleError(_0x5b017a,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 913dbad..6d86013 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 _0xf844=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xf844,0x14e));var _0x4f84=function(_0x537563,_0x1eab9e){_0x537563=_0x537563-0x0;var _0x3d3f2=_0xf844[_0x537563];return _0x3d3f2;};'use strict';var _=require(_0x4f84('0x0'));var util=require(_0x4f84('0x1'));var logger=require(_0x4f84('0x2'))(_0x4f84('0x3'));var moment=require(_0x4f84('0x4'));var BPromise=require(_0x4f84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f84('0x6'));var rimraf=require(_0x4f84('0x7'));var config=require(_0x4f84('0x8'));var attributes=require(_0x4f84('0x9'));module[_0x4f84('0xa')]=function(_0x20f3c8,_0x3b1f5c){return _0x20f3c8[_0x4f84('0xb')](_0x4f84('0xc'),attributes,{'tableName':_0x4f84('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x835d=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports'];(function(_0xa2262e,_0x50082e){var _0x14c3fe=function(_0x5d839b){while(--_0x5d839b){_0xa2262e['push'](_0xa2262e['shift']());}};_0x14c3fe(++_0x50082e);}(_0x835d,0x79));var _0xd835=function(_0x38e5ea,_0x5a01e4){_0x38e5ea=_0x38e5ea-0x0;var _0x3d3d37=_0x835d[_0x38e5ea];return _0x3d3d37;};'use strict';var _=require(_0xd835('0x0'));var util=require(_0xd835('0x1'));var logger=require(_0xd835('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd835('0x3'));var rp=require(_0xd835('0x4'));var fs=require('fs');var path=require(_0xd835('0x5'));var rimraf=require(_0xd835('0x6'));var config=require('../../config/environment');var attributes=require(_0xd835('0x7'));module[_0xd835('0x8')]=function(_0x4a9f21,_0x4c44a4){return _0x4a9f21[_0xd835('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xd835('0xa'),'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 5426fb1..c130711 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 _0x35d2=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent'];(function(_0x1abde4,_0x445e9f){var _0xbbef4c=function(_0x485e1b){while(--_0x485e1b){_0x1abde4['push'](_0x1abde4['shift']());}};_0xbbef4c(++_0x445e9f);}(_0x35d2,0xd4));var _0x235d=function(_0x3ad99c,_0x207389){_0x3ad99c=_0x3ad99c-0x0;var _0x420368=_0x35d2[_0x3ad99c];return _0x420368;};'use strict';var _=require(_0x235d('0x0'));var util=require('util');var moment=require(_0x235d('0x1'));var BPromise=require(_0x235d('0x2'));var rs=require(_0x235d('0x3'));var fs=require('fs');var Redis=require(_0x235d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x235d('0x5'));var logger=require(_0x235d('0x6'))(_0x235d('0x7'));var config=require(_0x235d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x235d('0x9')][_0x235d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5340cb,_0x1b1381,_0x535437){return new BPromise(function(_0x41a9ae,_0x518aa2){return client[_0x235d('0xb')](_0x5340cb,_0x535437)['then'](function(_0x252087){logger[_0x235d('0xc')](_0x235d('0xd'),_0x1b1381,'request\x20sent');logger[_0x235d('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1b1381,'request\x20sent',JSON['stringify'](_0x252087));if(_0x252087['error']){if(_0x252087[_0x235d('0xf')][_0x235d('0x10')]===0x1f4){logger[_0x235d('0xf')](_0x235d('0xd'),_0x1b1381,_0x252087[_0x235d('0xf')][_0x235d('0x11')]);return _0x518aa2(_0x252087[_0x235d('0xf')][_0x235d('0x11')]);}logger['error'](_0x235d('0xd'),_0x1b1381,_0x252087[_0x235d('0xf')][_0x235d('0x11')]);return _0x41a9ae(_0x252087[_0x235d('0xf')][_0x235d('0x11')]);}else{logger[_0x235d('0xc')](_0x235d('0xd'),_0x1b1381,_0x235d('0x12'));_0x41a9ae(_0x252087[_0x235d('0x13')][_0x235d('0x11')]);}})[_0x235d('0x14')](function(_0x2bbcef){logger['error'](_0x235d('0xd'),_0x1b1381,_0x2bbcef);_0x518aa2(_0x2bbcef);});});} \ No newline at end of file +var _0x26f7=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info'];(function(_0x10e8ed,_0x384a0d){var _0x4aea4a=function(_0x486ad1){while(--_0x486ad1){_0x10e8ed['push'](_0x10e8ed['shift']());}};_0x4aea4a(++_0x384a0d);}(_0x26f7,0x138));var _0x726f=function(_0x128aa4,_0x1b8240){_0x128aa4=_0x128aa4-0x0;var _0x5ec558=_0x26f7[_0x128aa4];return _0x5ec558;};'use strict';var _=require(_0x726f('0x0'));var util=require('util');var moment=require(_0x726f('0x1'));var BPromise=require(_0x726f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x726f('0x3'));var db=require(_0x726f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x726f('0x5'));var config=require(_0x726f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x726f('0x7')][_0x726f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d2dbb,_0xe4621e,_0x52ff32){return new BPromise(function(_0x4725b3,_0xc8670a){return client['request'](_0x5d2dbb,_0x52ff32)[_0x726f('0x9')](function(_0x48f522){logger[_0x726f('0xa')](_0x726f('0xb'),_0xe4621e,_0x726f('0xc'));logger[_0x726f('0xd')](_0x726f('0xe'),_0xe4621e,_0x726f('0xc'),JSON[_0x726f('0xf')](_0x48f522));if(_0x48f522[_0x726f('0x10')]){if(_0x48f522['error']['code']===0x1f4){logger[_0x726f('0x10')](_0x726f('0xb'),_0xe4621e,_0x48f522['error'][_0x726f('0x11')]);return _0xc8670a(_0x48f522[_0x726f('0x10')][_0x726f('0x11')]);}logger['error'](_0x726f('0xb'),_0xe4621e,_0x48f522[_0x726f('0x10')][_0x726f('0x11')]);return _0x4725b3(_0x48f522[_0x726f('0x10')]['message']);}else{logger[_0x726f('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xe4621e,_0x726f('0xc'));_0x4725b3(_0x48f522[_0x726f('0x12')][_0x726f('0x11')]);}})['catch'](function(_0x238c9b){logger[_0x726f('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xe4621e,_0x238c9b);_0xc8670a(_0x238c9b);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e004aac..0982936 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 _0x9f9e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','download','post','create','/:id','update','delete','destroy','exports','multer','path'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0x9f9e,0x76));var _0xe9f9=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x9f9e[_0x378b4];return _0x11d07b;};'use strict';var multer=require(_0xe9f9('0x0'));var util=require('util');var path=require(_0xe9f9('0x1'));var timeout=require(_0xe9f9('0x2'));var express=require(_0xe9f9('0x3'));var router=express[_0xe9f9('0x4')]();var fs_extra=require(_0xe9f9('0x5'));var auth=require(_0xe9f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe9f9('0x7'));var controller=require(_0xe9f9('0x8'));router[_0xe9f9('0x9')]('/',auth[_0xe9f9('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe9f9('0xb')]);router[_0xe9f9('0x9')]('/:id/download',auth[_0xe9f9('0xa')](),controller[_0xe9f9('0xc')]);router[_0xe9f9('0xd')]('/',auth[_0xe9f9('0xa')](),controller[_0xe9f9('0xe')]);router['put'](_0xe9f9('0xf'),auth['isAuthenticated'](),controller[_0xe9f9('0x10')]);router[_0xe9f9('0x11')]('/:id',auth[_0xe9f9('0xa')](),controller[_0xe9f9('0x12')]);module[_0xe9f9('0x13')]=router; \ No newline at end of file +var _0x0a62=['delete','exports','express','../../components/auth/service','get','isAuthenticated','/:id','post','create'];(function(_0x28da43,_0x3eb46d){var _0x1914bb=function(_0x385fb1){while(--_0x385fb1){_0x28da43['push'](_0x28da43['shift']());}};_0x1914bb(++_0x3eb46d);}(_0x0a62,0xb6));var _0x20a6=function(_0x105a8a,_0x15a3a2){_0x105a8a=_0x105a8a-0x0;var _0x105a0e=_0x0a62[_0x105a8a];return _0x105a0e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x20a6('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x20a6('0x1'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x20a6('0x2')]('/',auth[_0x20a6('0x3')](),controller['index']);router[_0x20a6('0x2')](_0x20a6('0x4'),auth[_0x20a6('0x3')](),controller['show']);router[_0x20a6('0x2')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x20a6('0x5')]('/',auth[_0x20a6('0x3')](),controller[_0x20a6('0x6')]);router['put'](_0x20a6('0x4'),auth[_0x20a6('0x3')](),controller['update']);router[_0x20a6('0x7')](_0x20a6('0x4'),auth[_0x20a6('0x3')](),controller['destroy']);module[_0x20a6('0x8')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index baa5393..9f4ad3e 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 _0x916a=['exports','STRING','BOOLEAN'];(function(_0x377ed8,_0x244c12){var _0x4a1f59=function(_0x4d342a){while(--_0x4d342a){_0x377ed8['push'](_0x377ed8['shift']());}};_0x4a1f59(++_0x244c12);}(_0x916a,0x195));var _0xa916=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0x916a[_0xd299c3];return _0x376574;};'use strict';var Sequelize=require('sequelize');module[_0xa916('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa916('0x1')]},'function':{'type':Sequelize[_0xa916('0x1')]},'format':{'type':Sequelize[_0xa916('0x1')]},'groupBy':{'type':Sequelize[_0xa916('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa916('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbe9d=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xbe9d,0x103));var _0xdbe9=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xbe9d[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0xdbe9('0x0'));module[_0xdbe9('0x1')]={'field':{'type':Sequelize[_0xdbe9('0x2')]},'alias':{'type':Sequelize[_0xdbe9('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xdbe9('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdbe9('0x3')]},'custom':{'type':Sequelize[_0xdbe9('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index f975a3d..20f4ad0 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 _0x1ad5=['name','send','AnalyticFieldReport','key','model','map','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','update','then','destroy','error','stack'];(function(_0x25260d,_0x5bc43b){var _0x3622cb=function(_0x286533){while(--_0x286533){_0x25260d['push'](_0x25260d['shift']());}};_0x3622cb(++_0x5bc43b);}(_0x1ad5,0xca));var _0x51ad=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x1ad5[_0x79cd47];return _0x3b9484;};'use strict';var emlformat=require(_0x51ad('0x0'));var rimraf=require(_0x51ad('0x1'));var zipdir=require(_0x51ad('0x2'));var jsonpatch=require(_0x51ad('0x3'));var rp=require(_0x51ad('0x4'));var moment=require(_0x51ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x51ad('0x6'));var util=require(_0x51ad('0x7'));var path=require(_0x51ad('0x8'));var sox=require(_0x51ad('0x9'));var csv=require(_0x51ad('0xa'));var ejs=require(_0x51ad('0xb'));var fs=require('fs');var fs_extra=require(_0x51ad('0xc'));var _=require(_0x51ad('0xd'));var squel=require(_0x51ad('0xe'));var crypto=require('crypto');var jsforce=require(_0x51ad('0xf'));var deskjs=require(_0x51ad('0x10'));var toCsv=require(_0x51ad('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x51ad('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x51ad('0x12'));var as=require(_0x51ad('0x13'));var hardwareService=require(_0x51ad('0x14'));var logger=require(_0x51ad('0x15'))(_0x51ad('0x16'));var utils=require(_0x51ad('0x17'));var config=require(_0x51ad('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c651c,_0x1e1e71){_0x1e1e71=_0x1e1e71||0xcc;return function(_0x2fd885){if(_0x2fd885){return _0x1c651c[_0x51ad('0x19')](_0x1e1e71);}return _0x1c651c[_0x51ad('0x1a')](_0x1e1e71)[_0x51ad('0x1b')]();};}function respondWithResult(_0x483e03,_0x4b946d){_0x4b946d=_0x4b946d||0xc8;return function(_0x23de38){if(_0x23de38){return _0x483e03[_0x51ad('0x1a')](_0x4b946d)[_0x51ad('0x1c')](_0x23de38);}};}function respondWithFilteredResult(_0x229897,_0x2f9d20){return function(_0x526db0){if(_0x526db0){var _0x576e2e=typeof _0x2f9d20['offset']===_0x51ad('0x1d')&&typeof _0x2f9d20['limit']===_0x51ad('0x1d');var _0x4ab44b=_0x526db0[_0x51ad('0x1e')];var _0x127c10=_0x576e2e?0x0:_0x2f9d20[_0x51ad('0x1f')];var _0x2a0de2=_0x576e2e?_0x526db0[_0x51ad('0x1e')]:_0x2f9d20['offset']+_0x2f9d20[_0x51ad('0x20')];var _0x435c38;if(_0x2a0de2>=_0x4ab44b){_0x2a0de2=_0x4ab44b;_0x435c38=0xc8;}else{_0x435c38=0xce;}_0x229897[_0x51ad('0x1a')](_0x435c38);return _0x229897[_0x51ad('0x21')]('Content-Range',_0x127c10+'-'+_0x2a0de2+'/'+_0x4ab44b)[_0x51ad('0x1c')](_0x526db0);}return null;};}function patchUpdates(_0x282e15){return function(_0xfad642){try{jsonpatch[_0x51ad('0x22')](_0xfad642,_0x282e15,!![]);}catch(_0x360665){return BPromise['reject'](_0x360665);}return _0xfad642[_0x51ad('0x23')]();};}function saveUpdates(_0x5751a9,_0x1a773a){return function(_0x24fc8e){if(_0x24fc8e){return _0x24fc8e[_0x51ad('0x24')](_0x5751a9)[_0x51ad('0x25')](function(_0x3ee828){return _0x3ee828;});}return null;};}function removeEntity(_0x3bebb6,_0x56e79f){return function(_0x21d438){if(_0x21d438){return _0x21d438[_0x51ad('0x26')]()[_0x51ad('0x25')](function(){_0x3bebb6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aec0e,_0x3104a9){return function(_0x3af368){if(!_0x3af368){_0x3aec0e[_0x51ad('0x19')](0x194);}return _0x3af368;};}function handleError(_0x1d2116,_0x571c9e){_0x571c9e=_0x571c9e||0x1f4;return function(_0x3d5f65){logger[_0x51ad('0x27')](_0x3d5f65[_0x51ad('0x28')]);if(_0x3d5f65[_0x51ad('0x29')]){delete _0x3d5f65[_0x51ad('0x29')];}_0x1d2116['status'](_0x571c9e)[_0x51ad('0x2a')](_0x3d5f65);};}exports['index']=function(_0x241cbb,_0x5a78ca){var _0x14f186={},_0x54f3f9={},_0x4823ad={'count':0x0,'rows':[]};var _0x585c6a=_['map'](db[_0x51ad('0x2b')]['rawAttributes'],function(_0x392d4d){return{'name':_0x392d4d['fieldName'],'type':_0x392d4d['type'][_0x51ad('0x2c')]};});_0x54f3f9[_0x51ad('0x2d')]=_[_0x51ad('0x2e')](_0x585c6a,_0x51ad('0x29'));_0x54f3f9[_0x51ad('0x2f')]=_['keys'](_0x241cbb['query']);_0x54f3f9['filters']=_[_0x51ad('0x30')](_0x54f3f9[_0x51ad('0x2d')],_0x54f3f9[_0x51ad('0x2f')]);_0x14f186[_0x51ad('0x31')]=_[_0x51ad('0x30')](_0x54f3f9[_0x51ad('0x2d')],qs[_0x51ad('0x32')](_0x241cbb[_0x51ad('0x2f')]['fields']));_0x14f186[_0x51ad('0x31')]=_0x14f186[_0x51ad('0x31')][_0x51ad('0x33')]?_0x14f186[_0x51ad('0x31')]:_0x54f3f9[_0x51ad('0x2d')];if(!_0x241cbb['query']['hasOwnProperty']('nolimit')){_0x14f186[_0x51ad('0x20')]=qs[_0x51ad('0x20')](_0x241cbb[_0x51ad('0x2f')][_0x51ad('0x20')]);_0x14f186[_0x51ad('0x1f')]=qs[_0x51ad('0x1f')](_0x241cbb[_0x51ad('0x2f')]['offset']);}_0x14f186[_0x51ad('0x34')]=qs['sort'](_0x241cbb[_0x51ad('0x2f')][_0x51ad('0x35')]);_0x14f186[_0x51ad('0x36')]=qs[_0x51ad('0x37')](_[_0x51ad('0x38')](_0x241cbb[_0x51ad('0x2f')],_0x54f3f9['filters']),_0x585c6a);if(_0x241cbb['query'][_0x51ad('0x39')]){_0x14f186[_0x51ad('0x36')]=_['merge'](_0x14f186[_0x51ad('0x36')],{'$or':_[_0x51ad('0x2e')](_0x585c6a,function(_0x18dc0c){if(_0x18dc0c[_0x51ad('0x3a')]!=='VIRTUAL'){var _0x2771a7={};_0x2771a7[_0x18dc0c[_0x51ad('0x29')]]={'$like':'%'+_0x241cbb[_0x51ad('0x2f')]['filter']+'%'};return _0x2771a7;}})});}_0x14f186=_[_0x51ad('0x3b')]({},_0x14f186,_0x241cbb[_0x51ad('0x3c')]);var _0x109751={'where':_0x14f186['where']};return db['AnalyticFieldReport'][_0x51ad('0x1e')](_0x109751)[_0x51ad('0x25')](function(_0x54900e){_0x4823ad['count']=_0x54900e;if(_0x241cbb[_0x51ad('0x2f')][_0x51ad('0x3d')]){_0x14f186[_0x51ad('0x3e')]=[{'all':!![]}];}return db[_0x51ad('0x2b')][_0x51ad('0x3f')](_0x14f186);})[_0x51ad('0x25')](function(_0x3a9ab6){_0x4823ad[_0x51ad('0x40')]=_0x3a9ab6;return _0x4823ad;})[_0x51ad('0x25')](respondWithFilteredResult(_0x5a78ca,_0x14f186))[_0x51ad('0x41')](handleError(_0x5a78ca,null));};exports[_0x51ad('0x42')]=function(_0x4ba941,_0x45a02d){var _0xc2919f={'raw':![],'where':{'id':_0x4ba941[_0x51ad('0x43')]['id']}},_0x2a1390={};_0x2a1390[_0x51ad('0x2d')]=_[_0x51ad('0x44')](db['AnalyticFieldReport'][_0x51ad('0x45')]);_0x2a1390['query']=_['keys'](_0x4ba941[_0x51ad('0x2f')]);_0x2a1390[_0x51ad('0x37')]=_[_0x51ad('0x30')](_0x2a1390[_0x51ad('0x2d')],_0x2a1390[_0x51ad('0x2f')]);_0xc2919f[_0x51ad('0x31')]=_[_0x51ad('0x30')](_0x2a1390[_0x51ad('0x2d')],qs['fields'](_0x4ba941[_0x51ad('0x2f')][_0x51ad('0x32')]));_0xc2919f[_0x51ad('0x31')]=_0xc2919f[_0x51ad('0x31')][_0x51ad('0x33')]?_0xc2919f[_0x51ad('0x31')]:_0x2a1390[_0x51ad('0x2d')];if(_0x4ba941[_0x51ad('0x2f')][_0x51ad('0x3d')]){_0xc2919f[_0x51ad('0x3e')]=[{'all':!![]}];}_0xc2919f=_[_0x51ad('0x3b')]({},_0xc2919f,_0x4ba941[_0x51ad('0x3c')]);return db[_0x51ad('0x2b')][_0x51ad('0x46')](_0xc2919f)[_0x51ad('0x25')](handleEntityNotFound(_0x45a02d,null))[_0x51ad('0x25')](respondWithResult(_0x45a02d,null))[_0x51ad('0x41')](handleError(_0x45a02d,null));};exports[_0x51ad('0x47')]=function(_0x5ead3f,_0x1cbb2d){return db['AnalyticFieldReport'][_0x51ad('0x47')](_0x5ead3f[_0x51ad('0x48')],{})['then'](respondWithResult(_0x1cbb2d,0xc9))[_0x51ad('0x41')](handleError(_0x1cbb2d,null));};exports[_0x51ad('0x49')]=function(_0x2de5ce,_0x23cc09){return db[_0x51ad('0x2b')]['bulkCreate'](_0x2de5ce[_0x51ad('0x48')],{'raw':![],'individualHooks':!![]})[_0x51ad('0x25')](respondWithResult(_0x23cc09,0xc9))['catch'](handleError(_0x23cc09,null));};exports['update']=function(_0x317261,_0x217f4b){if(_0x317261[_0x51ad('0x48')]['id']){delete _0x317261[_0x51ad('0x48')]['id'];}return db[_0x51ad('0x2b')][_0x51ad('0x46')]({'where':{'id':_0x317261[_0x51ad('0x43')]['id']}})[_0x51ad('0x25')](handleEntityNotFound(_0x217f4b,null))['then'](saveUpdates(_0x317261['body'],null))[_0x51ad('0x25')](respondWithResult(_0x217f4b,null))[_0x51ad('0x41')](handleError(_0x217f4b,null));};exports[_0x51ad('0x26')]=function(_0x5718f7,_0x5d7d06){return db['AnalyticFieldReport'][_0x51ad('0x46')]({'where':{'id':_0x5718f7[_0x51ad('0x43')]['id']}})[_0x51ad('0x25')](handleEntityNotFound(_0x5d7d06,null))['then'](removeEntity(_0x5d7d06,null))[_0x51ad('0x41')](handleError(_0x5d7d06,null));};exports[_0x51ad('0x4a')]=function(_0x4965c1,_0xd6695d){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4965c1[_0x51ad('0x2f')][_0x51ad('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xd6695d,0xcc))[_0x51ad('0x41')](handleError(_0xd6695d,null));};exports['addFields']=function(_0x216419,_0x417946,_0xa5cf29){return db[_0x51ad('0x4c')][_0x51ad('0x4d')]({'where':{'id':_0x216419[_0x51ad('0x43')]['id']}})[_0x51ad('0x25')](handleEntityNotFound(_0x417946,null))['then'](function(_0x21ab32){if(_0x21ab32){return db[_0x51ad('0x4e')][_0x51ad('0x4f')](function(_0x44e1db){return db[_0x51ad('0x2b')]['destroy']({'where':{'CustomReportId':_0x216419[_0x51ad('0x43')]['id']},'transaction':_0x44e1db})['then'](function(_0x21e23e){var _0x24b83f=_[_0x51ad('0x2e')](_0x216419[_0x51ad('0x48')],function(_0x36b7a3){delete _0x36b7a3['id'];_0x36b7a3[_0x51ad('0x50')]=_0x216419[_0x51ad('0x43')]['id'];return _0x36b7a3;});return db[_0x51ad('0x2b')][_0x51ad('0x49')](_0x24b83f,{'transaction':_0x44e1db});});})[_0x51ad('0x25')](function(){return db[_0x51ad('0x2b')][_0x51ad('0x3f')]({'where':{'CustomReportId':_0x216419[_0x51ad('0x43')]['id']}});});}})['then'](respondWithResult(_0x417946,null))[_0x51ad('0x41')](handleError(_0x417946,null));}; \ No newline at end of file +var _0x4271=['hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','merge','find','bulkCreate','update','body','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','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','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2712b7,_0x4e8210){var _0x1706ea=function(_0x3958a6){while(--_0x3958a6){_0x2712b7['push'](_0x2712b7['shift']());}};_0x1706ea(++_0x4e8210);}(_0x4271,0x16c));var _0x1427=function(_0x4e2a00,_0x4a643a){_0x4e2a00=_0x4e2a00-0x0;var _0x1175f4=_0x4271[_0x4e2a00];return _0x1175f4;};'use strict';var emlformat=require(_0x1427('0x0'));var rimraf=require(_0x1427('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1427('0x2'));var rp=require('request-promise');var moment=require(_0x1427('0x3'));var BPromise=require(_0x1427('0x4'));var Mustache=require(_0x1427('0x5'));var util=require(_0x1427('0x6'));var path=require(_0x1427('0x7'));var sox=require(_0x1427('0x8'));var csv=require(_0x1427('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1427('0xa'));var _=require(_0x1427('0xb'));var squel=require(_0x1427('0xc'));var crypto=require('crypto');var jsforce=require(_0x1427('0xd'));var deskjs=require(_0x1427('0xe'));var toCsv=require(_0x1427('0x9'));var querystring=require(_0x1427('0xf'));var Papa=require('papaparse');var Redis=require(_0x1427('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1427('0x11'));var as=require(_0x1427('0x12'));var hardwareService=require(_0x1427('0x13'));var logger=require(_0x1427('0x14'))(_0x1427('0x15'));var utils=require(_0x1427('0x16'));var config=require(_0x1427('0x17'));var licenseUtil=require(_0x1427('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf90f9,_0x41a2bd){_0x41a2bd=_0x41a2bd||0xcc;return function(_0x4b545b){if(_0x4b545b){return _0xcf90f9[_0x1427('0x19')](_0x41a2bd);}return _0xcf90f9[_0x1427('0x1a')](_0x41a2bd)['end']();};}function respondWithResult(_0x2f238e,_0x46d20c){_0x46d20c=_0x46d20c||0xc8;return function(_0x7b48d7){if(_0x7b48d7){return _0x2f238e['status'](_0x46d20c)[_0x1427('0x1b')](_0x7b48d7);}};}function respondWithFilteredResult(_0x159772,_0x5e47c6){return function(_0x2c6eef){if(_0x2c6eef){var _0x322954=typeof _0x5e47c6[_0x1427('0x1c')]===_0x1427('0x1d')&&typeof _0x5e47c6[_0x1427('0x1e')]===_0x1427('0x1d');var _0x586b99=_0x2c6eef[_0x1427('0x1f')];var _0x339f24=_0x322954?0x0:_0x5e47c6[_0x1427('0x1c')];var _0x45c35d=_0x322954?_0x2c6eef[_0x1427('0x1f')]:_0x5e47c6[_0x1427('0x1c')]+_0x5e47c6[_0x1427('0x1e')];var _0x396186;if(_0x45c35d>=_0x586b99){_0x45c35d=_0x586b99;_0x396186=0xc8;}else{_0x396186=0xce;}_0x159772[_0x1427('0x1a')](_0x396186);return _0x159772[_0x1427('0x20')](_0x1427('0x21'),_0x339f24+'-'+_0x45c35d+'/'+_0x586b99)['json'](_0x2c6eef);}return null;};}function patchUpdates(_0x17c202){return function(_0x168c35){try{jsonpatch[_0x1427('0x22')](_0x168c35,_0x17c202,!![]);}catch(_0x5cf065){return BPromise[_0x1427('0x23')](_0x5cf065);}return _0x168c35[_0x1427('0x24')]();};}function saveUpdates(_0x5b7521,_0x30a36c){return function(_0x37494e){if(_0x37494e){return _0x37494e['update'](_0x5b7521)[_0x1427('0x25')](function(_0x16de77){return _0x16de77;});}return null;};}function removeEntity(_0x30fae0,_0x367c86){return function(_0xf001d){if(_0xf001d){return _0xf001d[_0x1427('0x26')]()[_0x1427('0x25')](function(){_0x30fae0[_0x1427('0x1a')](0xcc)[_0x1427('0x27')]();});}};}function handleEntityNotFound(_0x2077f8,_0x607c07){return function(_0x326678){if(!_0x326678){_0x2077f8[_0x1427('0x19')](0x194);}return _0x326678;};}function handleError(_0x12fc8f,_0x180e75){_0x180e75=_0x180e75||0x1f4;return function(_0x306a5d){logger[_0x1427('0x28')](_0x306a5d['stack']);if(_0x306a5d[_0x1427('0x29')]){delete _0x306a5d[_0x1427('0x29')];}_0x12fc8f[_0x1427('0x1a')](_0x180e75)[_0x1427('0x2a')](_0x306a5d);};}exports[_0x1427('0x2b')]=function(_0x4d84c5,_0x3155c7){var _0x37c8f5={},_0x141af7={},_0x37f833={'count':0x0,'rows':[]};var _0x4df81a=_['map'](db['AnalyticFieldReport'][_0x1427('0x2c')],function(_0x393391){return{'name':_0x393391[_0x1427('0x2d')],'type':_0x393391[_0x1427('0x2e')]['key']};});_0x141af7[_0x1427('0x2f')]=_[_0x1427('0x30')](_0x4df81a,'name');_0x141af7[_0x1427('0x31')]=_[_0x1427('0x32')](_0x4d84c5[_0x1427('0x31')]);_0x141af7[_0x1427('0x33')]=_[_0x1427('0x34')](_0x141af7[_0x1427('0x2f')],_0x141af7[_0x1427('0x31')]);_0x37c8f5[_0x1427('0x35')]=_[_0x1427('0x34')](_0x141af7[_0x1427('0x2f')],qs[_0x1427('0x36')](_0x4d84c5['query'][_0x1427('0x36')]));_0x37c8f5[_0x1427('0x35')]=_0x37c8f5['attributes'][_0x1427('0x37')]?_0x37c8f5[_0x1427('0x35')]:_0x141af7[_0x1427('0x2f')];if(!_0x4d84c5[_0x1427('0x31')][_0x1427('0x38')](_0x1427('0x39'))){_0x37c8f5[_0x1427('0x1e')]=qs['limit'](_0x4d84c5['query'][_0x1427('0x1e')]);_0x37c8f5['offset']=qs[_0x1427('0x1c')](_0x4d84c5[_0x1427('0x31')][_0x1427('0x1c')]);}_0x37c8f5[_0x1427('0x3a')]=qs['sort'](_0x4d84c5[_0x1427('0x31')][_0x1427('0x3b')]);_0x37c8f5[_0x1427('0x3c')]=qs[_0x1427('0x33')](_[_0x1427('0x3d')](_0x4d84c5[_0x1427('0x31')],_0x141af7['filters']),_0x4df81a);if(_0x4d84c5[_0x1427('0x31')][_0x1427('0x3e')]){_0x37c8f5[_0x1427('0x3c')]=_['merge'](_0x37c8f5[_0x1427('0x3c')],{'$or':_[_0x1427('0x30')](_0x4df81a,function(_0x25d684){if(_0x25d684[_0x1427('0x2e')]!==_0x1427('0x3f')){var _0x7c7004={};_0x7c7004[_0x25d684['name']]={'$like':'%'+_0x4d84c5['query'][_0x1427('0x3e')]+'%'};return _0x7c7004;}})});}_0x37c8f5=_['merge']({},_0x37c8f5,_0x4d84c5[_0x1427('0x40')]);var _0x1bc248={'where':_0x37c8f5[_0x1427('0x3c')]};return db[_0x1427('0x41')][_0x1427('0x1f')](_0x1bc248)[_0x1427('0x25')](function(_0x31748b){_0x37f833[_0x1427('0x1f')]=_0x31748b;if(_0x4d84c5[_0x1427('0x31')][_0x1427('0x42')]){_0x37c8f5[_0x1427('0x43')]=[{'all':!![]}];}return db[_0x1427('0x41')][_0x1427('0x44')](_0x37c8f5);})[_0x1427('0x25')](function(_0x21808f){_0x37f833[_0x1427('0x45')]=_0x21808f;return _0x37f833;})[_0x1427('0x25')](respondWithFilteredResult(_0x3155c7,_0x37c8f5))[_0x1427('0x46')](handleError(_0x3155c7,null));};exports[_0x1427('0x47')]=function(_0x48f10e,_0x5a0d2){var _0x35508e={'raw':![],'where':{'id':_0x48f10e[_0x1427('0x48')]['id']}},_0x11d7c6={};_0x11d7c6[_0x1427('0x2f')]=_[_0x1427('0x32')](db[_0x1427('0x41')][_0x1427('0x2c')]);_0x11d7c6[_0x1427('0x31')]=_[_0x1427('0x32')](_0x48f10e[_0x1427('0x31')]);_0x11d7c6[_0x1427('0x33')]=_[_0x1427('0x34')](_0x11d7c6[_0x1427('0x2f')],_0x11d7c6[_0x1427('0x31')]);_0x35508e['attributes']=_['intersection'](_0x11d7c6[_0x1427('0x2f')],qs[_0x1427('0x36')](_0x48f10e[_0x1427('0x31')][_0x1427('0x36')]));_0x35508e[_0x1427('0x35')]=_0x35508e[_0x1427('0x35')][_0x1427('0x37')]?_0x35508e['attributes']:_0x11d7c6['model'];if(_0x48f10e['query'][_0x1427('0x42')]){_0x35508e[_0x1427('0x43')]=[{'all':!![]}];}_0x35508e=_[_0x1427('0x49')]({},_0x35508e,_0x48f10e['options']);return db[_0x1427('0x41')][_0x1427('0x4a')](_0x35508e)[_0x1427('0x25')](handleEntityNotFound(_0x5a0d2,null))[_0x1427('0x25')](respondWithResult(_0x5a0d2,null))[_0x1427('0x46')](handleError(_0x5a0d2,null));};exports['create']=function(_0x50f5b3,_0x4f6563){return db[_0x1427('0x41')]['create'](_0x50f5b3['body'],{})[_0x1427('0x25')](respondWithResult(_0x4f6563,0xc9))[_0x1427('0x46')](handleError(_0x4f6563,null));};exports['bulkCreate']=function(_0x207757,_0x469f6b){return db[_0x1427('0x41')][_0x1427('0x4b')](_0x207757['body'],{'raw':![],'individualHooks':!![]})[_0x1427('0x25')](respondWithResult(_0x469f6b,0xc9))['catch'](handleError(_0x469f6b,null));};exports[_0x1427('0x4c')]=function(_0x36792d,_0xd68220){if(_0x36792d['body']['id']){delete _0x36792d['body']['id'];}return db[_0x1427('0x41')][_0x1427('0x4a')]({'where':{'id':_0x36792d[_0x1427('0x48')]['id']}})[_0x1427('0x25')](handleEntityNotFound(_0xd68220,null))[_0x1427('0x25')](saveUpdates(_0x36792d[_0x1427('0x4d')],null))[_0x1427('0x25')](respondWithResult(_0xd68220,null))[_0x1427('0x46')](handleError(_0xd68220,null));};exports[_0x1427('0x26')]=function(_0x2c0fd8,_0x15e48b){return db[_0x1427('0x41')]['find']({'where':{'id':_0x2c0fd8['params']['id']}})[_0x1427('0x25')](handleEntityNotFound(_0x15e48b,null))['then'](removeEntity(_0x15e48b,null))[_0x1427('0x46')](handleError(_0x15e48b,null));};exports[_0x1427('0x4e')]=function(_0x1fb98f,_0x4eeb2d){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x1fb98f[_0x1427('0x31')][_0x1427('0x4f')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4eeb2d,0xcc))[_0x1427('0x46')](handleError(_0x4eeb2d,null));};exports[_0x1427('0x50')]=function(_0x1667a9,_0x3a499e,_0x28a745){return db[_0x1427('0x51')]['findOne']({'where':{'id':_0x1667a9['params']['id']}})[_0x1427('0x25')](handleEntityNotFound(_0x3a499e,null))['then'](function(_0x4ef5cd){if(_0x4ef5cd){return db['sequelize'][_0x1427('0x52')](function(_0x782b3b){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x1667a9[_0x1427('0x48')]['id']},'transaction':_0x782b3b})[_0x1427('0x25')](function(_0x5454b3){var _0x3250fa=_[_0x1427('0x30')](_0x1667a9['body'],function(_0x428ee6){delete _0x428ee6['id'];_0x428ee6[_0x1427('0x53')]=_0x1667a9[_0x1427('0x48')]['id'];return _0x428ee6;});return db['AnalyticFieldReport']['bulkCreate'](_0x3250fa,{'transaction':_0x782b3b});});})[_0x1427('0x25')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x1667a9[_0x1427('0x48')]['id']}});});}})[_0x1427('0x25')](respondWithResult(_0x3a499e,null))[_0x1427('0x46')](handleError(_0x3a499e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 8d7486e..9b1eec0 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 _0xed54=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0xed54,0x76));var _0x4ed5=function(_0x1fcd68,_0x43019c){_0x1fcd68=_0x1fcd68-0x0;var _0x4e424d=_0xed54[_0x1fcd68];return _0x4e424d;};'use strict';var _=require(_0x4ed5('0x0'));var util=require(_0x4ed5('0x1'));var logger=require(_0x4ed5('0x2'))(_0x4ed5('0x3'));var moment=require(_0x4ed5('0x4'));var BPromise=require('bluebird');var rp=require(_0x4ed5('0x5'));var fs=require('fs');var path=require(_0x4ed5('0x6'));var rimraf=require(_0x4ed5('0x7'));var config=require(_0x4ed5('0x8'));var attributes=require(_0x4ed5('0x9'));module[_0x4ed5('0xa')]=function(_0x34f44a,_0x2561c7){return _0x34f44a[_0x4ed5('0xb')](_0x4ed5('0xc'),attributes,{'tableName':_0x4ed5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad93=['lodash','util','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x32e57a,_0x3d5c3d){var _0x493891=function(_0x502743){while(--_0x502743){_0x32e57a['push'](_0x32e57a['shift']());}};_0x493891(++_0x3d5c3d);}(_0xad93,0x1f4));var _0x3ad9=function(_0x5d7d06,_0x423126){_0x5d7d06=_0x5d7d06-0x0;var _0xe8eacc=_0xad93[_0x5d7d06];return _0xe8eacc;};'use strict';var _=require(_0x3ad9('0x0'));var util=require(_0x3ad9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3ad9('0x2'));var rp=require(_0x3ad9('0x3'));var fs=require('fs');var path=require(_0x3ad9('0x4'));var rimraf=require(_0x3ad9('0x5'));var config=require('../../config/environment');var attributes=require(_0x3ad9('0x6'));module[_0x3ad9('0x7')]=function(_0xdc35fd,_0x197957){return _0xdc35fd[_0x3ad9('0x8')](_0x3ad9('0x9'),attributes,{'tableName':'analytics_report_fields','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 d2c0174..6e8b374 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 _0x0cbf=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0cbf,0x1a4));var _0xf0cb=function(_0x5da9a4,_0x3ebf42){_0x5da9a4=_0x5da9a4-0x0;var _0x3f458e=_0x0cbf[_0x5da9a4];return _0x3f458e;};'use strict';var _=require(_0xf0cb('0x0'));var util=require(_0xf0cb('0x1'));var moment=require('moment');var BPromise=require(_0xf0cb('0x2'));var rs=require(_0xf0cb('0x3'));var fs=require('fs');var Redis=require(_0xf0cb('0x4'));var db=require(_0xf0cb('0x5'))['db'];var utils=require(_0xf0cb('0x6'));var logger=require('../../config/logger')(_0xf0cb('0x7'));var config=require(_0xf0cb('0x8'));var jayson=require(_0xf0cb('0x9'));var client=jayson[_0xf0cb('0xa')][_0xf0cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf1cc9a,_0x44d1f3,_0x544ca6){return new BPromise(function(_0x3ac9cb,_0x29bb09){return client['request'](_0xf1cc9a,_0x544ca6)[_0xf0cb('0xc')](function(_0x4fc1ad){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x44d1f3,_0xf0cb('0xd'));logger[_0xf0cb('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x44d1f3,_0xf0cb('0xd'),JSON['stringify'](_0x4fc1ad));if(_0x4fc1ad[_0xf0cb('0xf')]){if(_0x4fc1ad[_0xf0cb('0xf')][_0xf0cb('0x10')]===0x1f4){logger[_0xf0cb('0xf')](_0xf0cb('0x11'),_0x44d1f3,_0x4fc1ad[_0xf0cb('0xf')]['message']);return _0x29bb09(_0x4fc1ad[_0xf0cb('0xf')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x44d1f3,_0x4fc1ad[_0xf0cb('0xf')][_0xf0cb('0x12')]);return _0x3ac9cb(_0x4fc1ad['error'][_0xf0cb('0x12')]);}else{logger[_0xf0cb('0x13')](_0xf0cb('0x11'),_0x44d1f3,_0xf0cb('0xd'));_0x3ac9cb(_0x4fc1ad[_0xf0cb('0x14')][_0xf0cb('0x12')]);}})[_0xf0cb('0x15')](function(_0x3acddb){logger['error'](_0xf0cb('0x11'),_0x44d1f3,_0x3acddb);_0x29bb09(_0x3acddb);});});} \ No newline at end of file +var _0x48c7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird'];(function(_0x27b8d1,_0x24d532){var _0x42a4b8=function(_0x1b4dd8){while(--_0x1b4dd8){_0x27b8d1['push'](_0x27b8d1['shift']());}};_0x42a4b8(++_0x24d532);}(_0x48c7,0x1f1));var _0x748c=function(_0x4e37bc,_0x8174e7){_0x4e37bc=_0x4e37bc-0x0;var _0x48a8b7=_0x48c7[_0x4e37bc];return _0x48a8b7;};'use strict';var _=require(_0x748c('0x0'));var util=require(_0x748c('0x1'));var moment=require('moment');var BPromise=require(_0x748c('0x2'));var rs=require(_0x748c('0x3'));var fs=require('fs');var Redis=require(_0x748c('0x4'));var db=require(_0x748c('0x5'))['db'];var utils=require(_0x748c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x748c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x748c('0x8')][_0x748c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27a96c,_0x258f64,_0x94a1f2){return new BPromise(function(_0x49e3c6,_0x16c5a6){return client[_0x748c('0xa')](_0x27a96c,_0x94a1f2)[_0x748c('0xb')](function(_0x529866){logger[_0x748c('0xc')](_0x748c('0xd'),_0x258f64,_0x748c('0xe'));logger['debug'](_0x748c('0xf'),_0x258f64,'request\x20sent',JSON['stringify'](_0x529866));if(_0x529866['error']){if(_0x529866[_0x748c('0x10')][_0x748c('0x11')]===0x1f4){logger[_0x748c('0x10')](_0x748c('0xd'),_0x258f64,_0x529866[_0x748c('0x10')][_0x748c('0x12')]);return _0x16c5a6(_0x529866[_0x748c('0x10')][_0x748c('0x12')]);}logger[_0x748c('0x10')](_0x748c('0xd'),_0x258f64,_0x529866[_0x748c('0x10')][_0x748c('0x12')]);return _0x49e3c6(_0x529866[_0x748c('0x10')]['message']);}else{logger['info'](_0x748c('0xd'),_0x258f64,_0x748c('0xe'));_0x49e3c6(_0x529866[_0x748c('0x13')][_0x748c('0x12')]);}})['catch'](function(_0x3d0e30){logger[_0x748c('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x258f64,_0x3d0e30);_0x16c5a6(_0x3d0e30);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1d6ee49..875e355 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(_0x1c45a1,_0x18f0ca){var _0xde7b99=function(_0x76dc2a){while(--_0x76dc2a){_0x1c45a1['push'](_0x1c45a1['shift']());}};_0xde7b99(++_0x18f0ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x50d17c,_0xc9e711){var _0x4e6fe6=function(_0x4b9a70){while(--_0x4b9a70){_0x50d17c['push'](_0x50d17c['shift']());}};_0x4e6fe6(++_0xc9e711);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 3263861..ef7804a 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 _0x9e0d=['name','TEXT','sequelize','exports','STRING'];(function(_0x5dcf18,_0xa8cca8){var _0x5df3fa=function(_0x15c136){while(--_0x15c136){_0x5dcf18['push'](_0x5dcf18['shift']());}};_0x5df3fa(++_0xa8cca8);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x1cb96f,_0x1f21ec){_0x1cb96f=_0x1cb96f-0x0;var _0x418399=_0x9e0d[_0x1cb96f];return _0x418399;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'name':{'type':Sequelize[_0xd9e0('0x2')],'allowNull':![],'unique':_0xd9e0('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd9e0('0x4')]},'description':{'type':Sequelize[_0xd9e0('0x2')]}}; \ No newline at end of file +var _0x803f=['sequelize','STRING','name','TEXT'];(function(_0x20ad80,_0x36cb5f){var _0xd29578=function(_0x32df40){while(--_0x32df40){_0x20ad80['push'](_0x20ad80['shift']());}};_0xd29578(++_0x36cb5f);}(_0x803f,0x64));var _0xf803=function(_0x2850d1,_0x680e09){_0x2850d1=_0x2850d1-0x0;var _0x55cce0=_0x803f[_0x2850d1];return _0x55cce0;};'use strict';var Sequelize=require(_0xf803('0x0'));module['exports']={'name':{'type':Sequelize[_0xf803('0x1')],'allowNull':![],'unique':_0xf803('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf803('0x3')]},'description':{'type':Sequelize[_0xf803('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index f61c267..e9bbabd 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x119b88,_0x335cf6){var _0x36b5f6=function(_0x20d443){while(--_0x20d443){_0x119b88['push'](_0x119b88['shift']());}};_0x36b5f6(++_0x335cf6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3588ba,_0x5c49f3){_0x3588ba=_0x3588ba-0x0;var _0x3695a2=_0x7fbe[_0x3588ba];return _0x3695a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x28fe38,_0x74c9a2){var _0x423045=function(_0x2027e9){while(--_0x2027e9){_0x28fe38['push'](_0x28fe38['shift']());}};_0x423045(++_0x74c9a2);}(_0x425d,0x1e0));var _0xd425=function(_0x237dfd,_0x138284){_0x237dfd=_0x237dfd-0x0;var _0x34eb74=_0x425d[_0x237dfd];return _0x34eb74;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 674b144..87b6b54 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 _0x908e=['request-promise','path','../../config/environment','define','AnalyticMetric','analytics_metrics','lodash','util','moment','bluebird'];(function(_0x3b234f,_0x4e2ad8){var _0x10a484=function(_0x582144){while(--_0x582144){_0x3b234f['push'](_0x3b234f['shift']());}};_0x10a484(++_0x4e2ad8);}(_0x908e,0x182));var _0xe908=function(_0x35e524,_0x418c45){_0x35e524=_0x35e524-0x0;var _0x1e3020=_0x908e[_0x35e524];return _0x1e3020;};'use strict';var _=require(_0xe908('0x0'));var util=require(_0xe908('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe908('0x2'));var BPromise=require(_0xe908('0x3'));var rp=require(_0xe908('0x4'));var fs=require('fs');var path=require(_0xe908('0x5'));var rimraf=require('rimraf');var config=require(_0xe908('0x6'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x448267,_0x27b216){return _0x448267[_0xe908('0x7')](_0xe908('0x8'),attributes,{'tableName':_0xe908('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb194=['rimraf','../../config/environment','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb194,0x1b2));var _0x4b19=function(_0x374f59,_0x5c2098){_0x374f59=_0x374f59-0x0;var _0x408ead=_0xb194[_0x374f59];return _0x408ead;};'use strict';var _=require(_0x4b19('0x0'));var util=require('util');var logger=require(_0x4b19('0x1'))(_0x4b19('0x2'));var moment=require(_0x4b19('0x3'));var BPromise=require(_0x4b19('0x4'));var rp=require(_0x4b19('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b19('0x6'));var config=require(_0x4b19('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x4b19('0x8')]=function(_0x570374,_0x22033b){return _0x570374['define'](_0x4b19('0x9'),attributes,{'tableName':_0x4b19('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index be4b28d..4def7a9 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 _0xe1b7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x5248ec,_0x978819){var _0x214ee1=function(_0x8b9f09){while(--_0x8b9f09){_0x5248ec['push'](_0x5248ec['shift']());}};_0x214ee1(++_0x978819);}(_0xe1b7,0xca));var _0x7e1b=function(_0x56c641,_0x5dd67d){_0x56c641=_0x56c641-0x0;var _0x83da3=_0xe1b7[_0x56c641];return _0x83da3;};'use strict';var _=require('lodash');var util=require(_0x7e1b('0x0'));var moment=require(_0x7e1b('0x1'));var BPromise=require(_0x7e1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e1b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e1b('0x4'));var logger=require(_0x7e1b('0x5'))(_0x7e1b('0x6'));var config=require(_0x7e1b('0x7'));var jayson=require(_0x7e1b('0x8'));var client=jayson[_0x7e1b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30135c,_0x3f3a60,_0x1b38b8){return new BPromise(function(_0x262e2c,_0x5bb5eb){return client[_0x7e1b('0xa')](_0x30135c,_0x1b38b8)[_0x7e1b('0xb')](function(_0x241fbf){logger[_0x7e1b('0xc')](_0x7e1b('0xd'),_0x3f3a60,_0x7e1b('0xe'));logger[_0x7e1b('0xf')](_0x7e1b('0x10'),_0x3f3a60,_0x7e1b('0xe'),JSON[_0x7e1b('0x11')](_0x241fbf));if(_0x241fbf['error']){if(_0x241fbf['error'][_0x7e1b('0x12')]===0x1f4){logger[_0x7e1b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3f3a60,_0x241fbf['error'][_0x7e1b('0x14')]);return _0x5bb5eb(_0x241fbf[_0x7e1b('0x13')]['message']);}logger[_0x7e1b('0x13')](_0x7e1b('0xd'),_0x3f3a60,_0x241fbf[_0x7e1b('0x13')][_0x7e1b('0x14')]);return _0x262e2c(_0x241fbf[_0x7e1b('0x13')][_0x7e1b('0x14')]);}else{logger['info'](_0x7e1b('0xd'),_0x3f3a60,_0x7e1b('0xe'));_0x262e2c(_0x241fbf[_0x7e1b('0x15')][_0x7e1b('0x14')]);}})[_0x7e1b('0x16')](function(_0x4ff8a1){logger[_0x7e1b('0x13')](_0x7e1b('0xd'),_0x3f3a60,_0x4ff8a1);_0x5bb5eb(_0x4ff8a1);});});} \ No newline at end of file +var _0xdab9=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x426edc,_0x5d6f34){var _0x42e159=function(_0x216fd2){while(--_0x216fd2){_0x426edc['push'](_0x426edc['shift']());}};_0x42e159(++_0x5d6f34);}(_0xdab9,0x66));var _0x9dab=function(_0x116a02,_0x44ad60){_0x116a02=_0x116a02-0x0;var _0x5b0448=_0xdab9[_0x116a02];return _0x5b0448;};'use strict';var _=require(_0x9dab('0x0'));var util=require(_0x9dab('0x1'));var moment=require(_0x9dab('0x2'));var BPromise=require(_0x9dab('0x3'));var rs=require(_0x9dab('0x4'));var fs=require('fs');var Redis=require(_0x9dab('0x5'));var db=require(_0x9dab('0x6'))['db'];var utils=require(_0x9dab('0x7'));var logger=require(_0x9dab('0x8'))(_0x9dab('0x9'));var config=require(_0x9dab('0xa'));var jayson=require(_0x9dab('0xb'));var client=jayson['client'][_0x9dab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x139736,_0x410c8b,_0x43ca08){return new BPromise(function(_0x1b501b,_0x523632){return client['request'](_0x139736,_0x43ca08)[_0x9dab('0xd')](function(_0x14ce48){logger[_0x9dab('0xe')](_0x9dab('0xf'),_0x410c8b,_0x9dab('0x10'));logger[_0x9dab('0x11')](_0x9dab('0x12'),_0x410c8b,_0x9dab('0x10'),JSON[_0x9dab('0x13')](_0x14ce48));if(_0x14ce48['error']){if(_0x14ce48[_0x9dab('0x14')][_0x9dab('0x15')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x410c8b,_0x14ce48[_0x9dab('0x14')][_0x9dab('0x16')]);return _0x523632(_0x14ce48[_0x9dab('0x14')]['message']);}logger[_0x9dab('0x14')](_0x9dab('0xf'),_0x410c8b,_0x14ce48[_0x9dab('0x14')][_0x9dab('0x16')]);return _0x1b501b(_0x14ce48['error'][_0x9dab('0x16')]);}else{logger[_0x9dab('0xe')](_0x9dab('0xf'),_0x410c8b,_0x9dab('0x10'));_0x1b501b(_0x14ce48[_0x9dab('0x17')][_0x9dab('0x16')]);}})[_0x9dab('0x18')](function(_0x2ab54a){logger[_0x9dab('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x410c8b,_0x2ab54a);_0x523632(_0x2ab54a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d325c09..05b8d93 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 _0xdb70=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xdb70,0xa0));var _0x0db7=function(_0x4f02eb,_0x8d5abe){_0x4f02eb=_0x4f02eb-0x0;var _0x2a1fc0=_0xdb70[_0x4f02eb];return _0x2a1fc0;};'use strict';var multer=require(_0x0db7('0x0'));var util=require(_0x0db7('0x1'));var path=require(_0x0db7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0db7('0x3'));var router=express[_0x0db7('0x4')]();var fs_extra=require(_0x0db7('0x5'));var auth=require(_0x0db7('0x6'));var interaction=require(_0x0db7('0x7'));var config=require(_0x0db7('0x8'));var controller=require(_0x0db7('0x9'));router[_0x0db7('0xa')]('/',auth[_0x0db7('0xb')](),controller[_0x0db7('0xc')]);router[_0x0db7('0xa')]('/:id',auth[_0x0db7('0xb')](),controller[_0x0db7('0xd')]);router[_0x0db7('0xe')]('/',auth[_0x0db7('0xb')](),controller[_0x0db7('0xf')]);router[_0x0db7('0x10')]('/:id',auth[_0x0db7('0xb')](),controller[_0x0db7('0x11')]);router['delete'](_0x0db7('0x12'),auth[_0x0db7('0xb')](),controller[_0x0db7('0x13')]);module[_0x0db7('0x14')]=router; \ No newline at end of file +var _0x26cf=['put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create'];(function(_0x2db573,_0x4490e6){var _0x11bd96=function(_0x53aa58){while(--_0x53aa58){_0x2db573['push'](_0x2db573['shift']());}};_0x11bd96(++_0x4490e6);}(_0x26cf,0x135));var _0xf26c=function(_0x35b5bf,_0x1bf275){_0x35b5bf=_0x35b5bf-0x0;var _0x35789f=_0x26cf[_0x35b5bf];return _0x35789f;};'use strict';var multer=require('multer');var util=require(_0xf26c('0x0'));var path=require(_0xf26c('0x1'));var timeout=require('connect-timeout');var express=require(_0xf26c('0x2'));var router=express['Router']();var fs_extra=require(_0xf26c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf26c('0x4'));var config=require(_0xf26c('0x5'));var controller=require('./analyticMetric.controller');router[_0xf26c('0x6')]('/',auth[_0xf26c('0x7')](),controller[_0xf26c('0x8')]);router[_0xf26c('0x6')](_0xf26c('0x9'),auth[_0xf26c('0x7')](),controller['show']);router['post']('/',auth[_0xf26c('0x7')](),controller[_0xf26c('0xa')]);router[_0xf26c('0xb')](_0xf26c('0x9'),auth[_0xf26c('0x7')](),controller[_0xf26c('0xc')]);router[_0xf26c('0xd')](_0xf26c('0x9'),auth['isAuthenticated'](),controller[_0xf26c('0xe')]);module[_0xf26c('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 43eae6c..5b3d9fc 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 _0x56e3=['TEXT','sequelize','exports'];(function(_0x1e713d,_0x5ceecb){var _0x368d53=function(_0x109fd9){while(--_0x109fd9){_0x1e713d['push'](_0x1e713d['shift']());}};_0x368d53(++_0x5ceecb);}(_0x56e3,0x11e));var _0x356e=function(_0xd70150,_0x4fbb05){_0xd70150=_0xd70150-0x0;var _0x3de2e9=_0x56e3[_0xd70150];return _0x3de2e9;};'use strict';var Sequelize=require(_0x356e('0x0'));module[_0x356e('0x1')]={'tree':{'type':Sequelize[_0x356e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x90e2=['TEXT','exports'];(function(_0xdaa968,_0x4dd927){var _0x5bdc9f=function(_0x404c59){while(--_0x404c59){_0xdaa968['push'](_0xdaa968['shift']());}};_0x5bdc9f(++_0x4dd927);}(_0x90e2,0xa1));var _0x290e=function(_0x2cd39a,_0x2d286b){_0x2cd39a=_0x2cd39a-0x0;var _0x5e01cb=_0x90e2[_0x2cd39a];return _0x5e01cb;};'use strict';var Sequelize=require('sequelize');module[_0x290e('0x0')]={'tree':{'type':Sequelize[_0x290e('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 0339add..47eccfa 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 _0x6b46=['crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x53a1e2,_0x3b291c){var _0x593932=function(_0x15363b){while(--_0x15363b){_0x53a1e2['push'](_0x53a1e2['shift']());}};_0x593932(++_0x3b291c);}(_0x6b46,0x88));var _0x66b4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6b46[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x66b4('0x0'));var rimraf=require(_0x66b4('0x1'));var zipdir=require(_0x66b4('0x2'));var jsonpatch=require(_0x66b4('0x3'));var rp=require(_0x66b4('0x4'));var moment=require(_0x66b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x66b4('0x6'));var util=require(_0x66b4('0x7'));var path=require(_0x66b4('0x8'));var sox=require(_0x66b4('0x9'));var csv=require(_0x66b4('0xa'));var ejs=require(_0x66b4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66b4('0xc'));var squel=require(_0x66b4('0xd'));var crypto=require(_0x66b4('0xe'));var jsforce=require(_0x66b4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x66b4('0xa'));var querystring=require(_0x66b4('0x10'));var Papa=require(_0x66b4('0x11'));var Redis=require(_0x66b4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x66b4('0x13'));var as=require(_0x66b4('0x14'));var hardwareService=require(_0x66b4('0x15'));var logger=require(_0x66b4('0x16'))('api');var utils=require(_0x66b4('0x17'));var config=require(_0x66b4('0x18'));var licenseUtil=require(_0x66b4('0x19'));var db=require(_0x66b4('0x1a'))['db'];function respondWithStatusCode(_0x34ff88,_0x20664a){_0x20664a=_0x20664a||0xcc;return function(_0x53b8c7){if(_0x53b8c7){return _0x34ff88[_0x66b4('0x1b')](_0x20664a);}return _0x34ff88[_0x66b4('0x1c')](_0x20664a)[_0x66b4('0x1d')]();};}function respondWithResult(_0x100352,_0x26ca11){_0x26ca11=_0x26ca11||0xc8;return function(_0x12b872){if(_0x12b872){return _0x100352[_0x66b4('0x1c')](_0x26ca11)[_0x66b4('0x1e')](_0x12b872);}};}function respondWithFilteredResult(_0x1c2178,_0x235113){return function(_0x5d06bf){if(_0x5d06bf){var _0x2308b5=typeof _0x235113['offset']===_0x66b4('0x1f')&&typeof _0x235113['limit']===_0x66b4('0x1f');var _0x18c4e0=_0x5d06bf[_0x66b4('0x20')];var _0x9acad6=_0x2308b5?0x0:_0x235113[_0x66b4('0x21')];var _0x3968c0=_0x2308b5?_0x5d06bf[_0x66b4('0x20')]:_0x235113[_0x66b4('0x21')]+_0x235113['limit'];var _0x59d4a4;if(_0x3968c0>=_0x18c4e0){_0x3968c0=_0x18c4e0;_0x59d4a4=0xc8;}else{_0x59d4a4=0xce;}_0x1c2178[_0x66b4('0x1c')](_0x59d4a4);return _0x1c2178[_0x66b4('0x22')](_0x66b4('0x23'),_0x9acad6+'-'+_0x3968c0+'/'+_0x18c4e0)[_0x66b4('0x1e')](_0x5d06bf);}return null;};}function patchUpdates(_0x2c7210){return function(_0x2391e5){try{jsonpatch['apply'](_0x2391e5,_0x2c7210,!![]);}catch(_0x31895a){return BPromise[_0x66b4('0x24')](_0x31895a);}return _0x2391e5[_0x66b4('0x25')]();};}function saveUpdates(_0xe55424,_0x170ec8){return function(_0x3a5150){if(_0x3a5150){return _0x3a5150['update'](_0xe55424)[_0x66b4('0x26')](function(_0x2afa8b){return _0x2afa8b;});}return null;};}function removeEntity(_0x350799,_0x3cb6e1){return function(_0x51f002){if(_0x51f002){return _0x51f002[_0x66b4('0x27')]()[_0x66b4('0x26')](function(){_0x350799[_0x66b4('0x1c')](0xcc)[_0x66b4('0x1d')]();});}};}function handleEntityNotFound(_0x49b36e,_0x4a310d){return function(_0x15342f){if(!_0x15342f){_0x49b36e[_0x66b4('0x1b')](0x194);}return _0x15342f;};}function handleError(_0x58e392,_0x128534){_0x128534=_0x128534||0x1f4;return function(_0x584a76){logger[_0x66b4('0x28')](_0x584a76[_0x66b4('0x29')]);if(_0x584a76[_0x66b4('0x2a')]){delete _0x584a76[_0x66b4('0x2a')];}_0x58e392[_0x66b4('0x1c')](_0x128534)[_0x66b4('0x2b')](_0x584a76);};}exports['index']=function(_0x54ff80,_0xd6067d){var _0x50bc40={},_0x39a9e2={},_0x2ddfc6={'count':0x0,'rows':[]};var _0x234b6f=_[_0x66b4('0x2c')](db[_0x66b4('0x2d')][_0x66b4('0x2e')],function(_0x369edb){return{'name':_0x369edb[_0x66b4('0x2f')],'type':_0x369edb['type'][_0x66b4('0x30')]};});_0x39a9e2[_0x66b4('0x31')]=_[_0x66b4('0x2c')](_0x234b6f,'name');_0x39a9e2[_0x66b4('0x32')]=_['keys'](_0x54ff80['query']);_0x39a9e2[_0x66b4('0x33')]=_[_0x66b4('0x34')](_0x39a9e2[_0x66b4('0x31')],_0x39a9e2['query']);_0x50bc40[_0x66b4('0x35')]=_[_0x66b4('0x34')](_0x39a9e2[_0x66b4('0x31')],qs[_0x66b4('0x36')](_0x54ff80['query'][_0x66b4('0x36')]));_0x50bc40[_0x66b4('0x35')]=_0x50bc40['attributes'][_0x66b4('0x37')]?_0x50bc40[_0x66b4('0x35')]:_0x39a9e2[_0x66b4('0x31')];if(!_0x54ff80[_0x66b4('0x32')][_0x66b4('0x38')]('nolimit')){_0x50bc40[_0x66b4('0x39')]=qs[_0x66b4('0x39')](_0x54ff80[_0x66b4('0x32')]['limit']);_0x50bc40[_0x66b4('0x21')]=qs[_0x66b4('0x21')](_0x54ff80['query'][_0x66b4('0x21')]);}_0x50bc40[_0x66b4('0x3a')]=qs[_0x66b4('0x3b')](_0x54ff80[_0x66b4('0x32')][_0x66b4('0x3b')]);_0x50bc40[_0x66b4('0x3c')]=qs['filters'](_['pick'](_0x54ff80[_0x66b4('0x32')],_0x39a9e2['filters']),_0x234b6f);if(_0x54ff80[_0x66b4('0x32')]['filter']){_0x50bc40['where']=_['merge'](_0x50bc40['where'],{'$or':_[_0x66b4('0x2c')](_0x234b6f,function(_0x55d155){if(_0x55d155[_0x66b4('0x3d')]!==_0x66b4('0x3e')){var _0x409dc6={};_0x409dc6[_0x55d155[_0x66b4('0x2a')]]={'$like':'%'+_0x54ff80[_0x66b4('0x32')]['filter']+'%'};return _0x409dc6;}})});}_0x50bc40=_[_0x66b4('0x3f')]({},_0x50bc40,_0x54ff80[_0x66b4('0x40')]);var _0xe7f126={'where':_0x50bc40[_0x66b4('0x3c')]};return db['AnalyticTreeReport'][_0x66b4('0x20')](_0xe7f126)[_0x66b4('0x26')](function(_0x1aca63){_0x2ddfc6[_0x66b4('0x20')]=_0x1aca63;if(_0x54ff80['query'][_0x66b4('0x41')]){_0x50bc40['include']=[{'all':!![]}];}return db[_0x66b4('0x2d')]['findAll'](_0x50bc40);})[_0x66b4('0x26')](function(_0x4ed876){_0x2ddfc6[_0x66b4('0x42')]=_0x4ed876;return _0x2ddfc6;})['then'](respondWithFilteredResult(_0xd6067d,_0x50bc40))[_0x66b4('0x43')](handleError(_0xd6067d,null));};exports[_0x66b4('0x44')]=function(_0x3eeafe,_0xafdf7e){var _0x202e7f={'raw':!![],'where':{'id':_0x3eeafe[_0x66b4('0x45')]['id']}},_0x19e2e3={};_0x19e2e3[_0x66b4('0x31')]=_[_0x66b4('0x46')](db[_0x66b4('0x2d')][_0x66b4('0x2e')]);_0x19e2e3[_0x66b4('0x32')]=_[_0x66b4('0x46')](_0x3eeafe['query']);_0x19e2e3[_0x66b4('0x33')]=_['intersection'](_0x19e2e3[_0x66b4('0x31')],_0x19e2e3[_0x66b4('0x32')]);_0x202e7f['attributes']=_[_0x66b4('0x34')](_0x19e2e3[_0x66b4('0x31')],qs[_0x66b4('0x36')](_0x3eeafe[_0x66b4('0x32')][_0x66b4('0x36')]));_0x202e7f[_0x66b4('0x35')]=_0x202e7f[_0x66b4('0x35')][_0x66b4('0x37')]?_0x202e7f[_0x66b4('0x35')]:_0x19e2e3[_0x66b4('0x31')];if(_0x3eeafe[_0x66b4('0x32')][_0x66b4('0x41')]){_0x202e7f['include']=[{'all':!![]}];}_0x202e7f=_[_0x66b4('0x3f')]({},_0x202e7f,_0x3eeafe[_0x66b4('0x40')]);return db[_0x66b4('0x2d')][_0x66b4('0x47')](_0x202e7f)['then'](handleEntityNotFound(_0xafdf7e,null))['then'](respondWithResult(_0xafdf7e,null))['catch'](handleError(_0xafdf7e,null));};exports['create']=function(_0x4dd910,_0x36a2d9){return db[_0x66b4('0x2d')][_0x66b4('0x48')](_0x4dd910[_0x66b4('0x49')],{})[_0x66b4('0x26')](respondWithResult(_0x36a2d9,0xc9))[_0x66b4('0x43')](handleError(_0x36a2d9,null));};exports[_0x66b4('0x4a')]=function(_0x368e36,_0x3dab56){if(_0x368e36[_0x66b4('0x49')]['id']){delete _0x368e36[_0x66b4('0x49')]['id'];}return db[_0x66b4('0x2d')][_0x66b4('0x47')]({'where':{'id':_0x368e36[_0x66b4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3dab56,null))['then'](saveUpdates(_0x368e36[_0x66b4('0x49')],null))[_0x66b4('0x26')](respondWithResult(_0x3dab56,null))['catch'](handleError(_0x3dab56,null));};exports[_0x66b4('0x27')]=function(_0x249d23,_0x3461a4){return db['AnalyticTreeReport'][_0x66b4('0x47')]({'where':{'id':_0x249d23[_0x66b4('0x45')]['id']}})[_0x66b4('0x26')](handleEntityNotFound(_0x3461a4,null))[_0x66b4('0x26')](removeEntity(_0x3461a4,null))[_0x66b4('0x43')](handleError(_0x3461a4,null));}; \ No newline at end of file +var _0xe618=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','params','rawAttributes','fields','catch','create','body','find'];(function(_0x49d49f,_0x178b2f){var _0x1b04a9=function(_0x4c30cb){while(--_0x4c30cb){_0x49d49f['push'](_0x49d49f['shift']());}};_0x1b04a9(++_0x178b2f);}(_0xe618,0x128));var _0x8e61=function(_0x143759,_0x249c49){_0x143759=_0x143759-0x0;var _0x4582be=_0xe618[_0x143759];return _0x4582be;};'use strict';var emlformat=require(_0x8e61('0x0'));var rimraf=require(_0x8e61('0x1'));var zipdir=require(_0x8e61('0x2'));var jsonpatch=require(_0x8e61('0x3'));var rp=require('request-promise');var moment=require(_0x8e61('0x4'));var BPromise=require(_0x8e61('0x5'));var Mustache=require(_0x8e61('0x6'));var util=require(_0x8e61('0x7'));var path=require(_0x8e61('0x8'));var sox=require(_0x8e61('0x9'));var csv=require(_0x8e61('0xa'));var ejs=require(_0x8e61('0xb'));var fs=require('fs');var fs_extra=require(_0x8e61('0xc'));var _=require('lodash');var squel=require(_0x8e61('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8e61('0xe'));var Papa=require(_0x8e61('0xf'));var Redis=require(_0x8e61('0x10'));var authService=require(_0x8e61('0x11'));var qs=require(_0x8e61('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e61('0x13'));var logger=require(_0x8e61('0x14'))(_0x8e61('0x15'));var utils=require(_0x8e61('0x16'));var config=require(_0x8e61('0x17'));var licenseUtil=require(_0x8e61('0x18'));var db=require(_0x8e61('0x19'))['db'];function respondWithStatusCode(_0x4019f6,_0x47e258){_0x47e258=_0x47e258||0xcc;return function(_0x675eb2){if(_0x675eb2){return _0x4019f6[_0x8e61('0x1a')](_0x47e258);}return _0x4019f6[_0x8e61('0x1b')](_0x47e258)[_0x8e61('0x1c')]();};}function respondWithResult(_0x246a7d,_0xd50d46){_0xd50d46=_0xd50d46||0xc8;return function(_0x3db7bf){if(_0x3db7bf){return _0x246a7d[_0x8e61('0x1b')](_0xd50d46)[_0x8e61('0x1d')](_0x3db7bf);}};}function respondWithFilteredResult(_0x4afeb4,_0x19f4a8){return function(_0x2044e7){if(_0x2044e7){var _0x57caf3=typeof _0x19f4a8[_0x8e61('0x1e')]==='undefined'&&typeof _0x19f4a8[_0x8e61('0x1f')]===_0x8e61('0x20');var _0x225c23=_0x2044e7[_0x8e61('0x21')];var _0x3250be=_0x57caf3?0x0:_0x19f4a8[_0x8e61('0x1e')];var _0x13ef67=_0x57caf3?_0x2044e7[_0x8e61('0x21')]:_0x19f4a8[_0x8e61('0x1e')]+_0x19f4a8[_0x8e61('0x1f')];var _0x1e9b8d;if(_0x13ef67>=_0x225c23){_0x13ef67=_0x225c23;_0x1e9b8d=0xc8;}else{_0x1e9b8d=0xce;}_0x4afeb4[_0x8e61('0x1b')](_0x1e9b8d);return _0x4afeb4['set'](_0x8e61('0x22'),_0x3250be+'-'+_0x13ef67+'/'+_0x225c23)['json'](_0x2044e7);}return null;};}function patchUpdates(_0x59fc98){return function(_0x599a27){try{jsonpatch['apply'](_0x599a27,_0x59fc98,!![]);}catch(_0x3044f8){return BPromise[_0x8e61('0x23')](_0x3044f8);}return _0x599a27['save']();};}function saveUpdates(_0x2a38e3,_0x5749bc){return function(_0x2914ed){if(_0x2914ed){return _0x2914ed[_0x8e61('0x24')](_0x2a38e3)[_0x8e61('0x25')](function(_0x5549af){return _0x5549af;});}return null;};}function removeEntity(_0x461148,_0x1ee6a1){return function(_0xebaf5){if(_0xebaf5){return _0xebaf5[_0x8e61('0x26')]()['then'](function(){_0x461148['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x287ed7,_0x186e9a){return function(_0x30be0f){if(!_0x30be0f){_0x287ed7['sendStatus'](0x194);}return _0x30be0f;};}function handleError(_0x431fa1,_0x457ac2){_0x457ac2=_0x457ac2||0x1f4;return function(_0x1957e5){logger[_0x8e61('0x27')](_0x1957e5['stack']);if(_0x1957e5[_0x8e61('0x28')]){delete _0x1957e5[_0x8e61('0x28')];}_0x431fa1[_0x8e61('0x1b')](_0x457ac2)[_0x8e61('0x29')](_0x1957e5);};}exports[_0x8e61('0x2a')]=function(_0xddd619,_0x282800){var _0x220905={},_0x2d46d1={},_0x2ae80f={'count':0x0,'rows':[]};var _0x306940=_[_0x8e61('0x2b')](db['AnalyticTreeReport']['rawAttributes'],function(_0x3474bc){return{'name':_0x3474bc[_0x8e61('0x2c')],'type':_0x3474bc[_0x8e61('0x2d')][_0x8e61('0x2e')]};});_0x2d46d1[_0x8e61('0x2f')]=_[_0x8e61('0x2b')](_0x306940,_0x8e61('0x28'));_0x2d46d1[_0x8e61('0x30')]=_[_0x8e61('0x31')](_0xddd619[_0x8e61('0x30')]);_0x2d46d1[_0x8e61('0x32')]=_[_0x8e61('0x33')](_0x2d46d1[_0x8e61('0x2f')],_0x2d46d1[_0x8e61('0x30')]);_0x220905[_0x8e61('0x34')]=_[_0x8e61('0x33')](_0x2d46d1['model'],qs['fields'](_0xddd619[_0x8e61('0x30')]['fields']));_0x220905[_0x8e61('0x34')]=_0x220905[_0x8e61('0x34')][_0x8e61('0x35')]?_0x220905[_0x8e61('0x34')]:_0x2d46d1[_0x8e61('0x2f')];if(!_0xddd619['query'][_0x8e61('0x36')]('nolimit')){_0x220905[_0x8e61('0x1f')]=qs[_0x8e61('0x1f')](_0xddd619[_0x8e61('0x30')][_0x8e61('0x1f')]);_0x220905[_0x8e61('0x1e')]=qs['offset'](_0xddd619[_0x8e61('0x30')][_0x8e61('0x1e')]);}_0x220905[_0x8e61('0x37')]=qs[_0x8e61('0x38')](_0xddd619[_0x8e61('0x30')][_0x8e61('0x38')]);_0x220905[_0x8e61('0x39')]=qs[_0x8e61('0x32')](_[_0x8e61('0x3a')](_0xddd619[_0x8e61('0x30')],_0x2d46d1[_0x8e61('0x32')]),_0x306940);if(_0xddd619['query'][_0x8e61('0x3b')]){_0x220905[_0x8e61('0x39')]=_[_0x8e61('0x3c')](_0x220905['where'],{'$or':_['map'](_0x306940,function(_0x3210a1){if(_0x3210a1[_0x8e61('0x2d')]!==_0x8e61('0x3d')){var _0x5291bb={};_0x5291bb[_0x3210a1[_0x8e61('0x28')]]={'$like':'%'+_0xddd619['query'][_0x8e61('0x3b')]+'%'};return _0x5291bb;}})});}_0x220905=_[_0x8e61('0x3c')]({},_0x220905,_0xddd619[_0x8e61('0x3e')]);var _0xf6c460={'where':_0x220905[_0x8e61('0x39')]};return db[_0x8e61('0x3f')][_0x8e61('0x21')](_0xf6c460)[_0x8e61('0x25')](function(_0x2fd531){_0x2ae80f[_0x8e61('0x21')]=_0x2fd531;if(_0xddd619[_0x8e61('0x30')][_0x8e61('0x40')]){_0x220905[_0x8e61('0x41')]=[{'all':!![]}];}return db[_0x8e61('0x3f')][_0x8e61('0x42')](_0x220905);})[_0x8e61('0x25')](function(_0x4036a5){_0x2ae80f['rows']=_0x4036a5;return _0x2ae80f;})['then'](respondWithFilteredResult(_0x282800,_0x220905))['catch'](handleError(_0x282800,null));};exports['show']=function(_0x195e55,_0x1de052){var _0x47ba58={'raw':!![],'where':{'id':_0x195e55[_0x8e61('0x43')]['id']}},_0x44ffba={};_0x44ffba[_0x8e61('0x2f')]=_[_0x8e61('0x31')](db[_0x8e61('0x3f')][_0x8e61('0x44')]);_0x44ffba['query']=_['keys'](_0x195e55[_0x8e61('0x30')]);_0x44ffba[_0x8e61('0x32')]=_[_0x8e61('0x33')](_0x44ffba[_0x8e61('0x2f')],_0x44ffba[_0x8e61('0x30')]);_0x47ba58[_0x8e61('0x34')]=_[_0x8e61('0x33')](_0x44ffba[_0x8e61('0x2f')],qs[_0x8e61('0x45')](_0x195e55[_0x8e61('0x30')]['fields']));_0x47ba58['attributes']=_0x47ba58[_0x8e61('0x34')]['length']?_0x47ba58['attributes']:_0x44ffba[_0x8e61('0x2f')];if(_0x195e55[_0x8e61('0x30')][_0x8e61('0x40')]){_0x47ba58['include']=[{'all':!![]}];}_0x47ba58=_['merge']({},_0x47ba58,_0x195e55[_0x8e61('0x3e')]);return db['AnalyticTreeReport']['find'](_0x47ba58)[_0x8e61('0x25')](handleEntityNotFound(_0x1de052,null))[_0x8e61('0x25')](respondWithResult(_0x1de052,null))[_0x8e61('0x46')](handleError(_0x1de052,null));};exports[_0x8e61('0x47')]=function(_0x336d9f,_0x5787e8){return db['AnalyticTreeReport'][_0x8e61('0x47')](_0x336d9f[_0x8e61('0x48')],{})[_0x8e61('0x25')](respondWithResult(_0x5787e8,0xc9))['catch'](handleError(_0x5787e8,null));};exports[_0x8e61('0x24')]=function(_0x2241da,_0x40abfc){if(_0x2241da[_0x8e61('0x48')]['id']){delete _0x2241da[_0x8e61('0x48')]['id'];}return db['AnalyticTreeReport'][_0x8e61('0x49')]({'where':{'id':_0x2241da[_0x8e61('0x43')]['id']}})[_0x8e61('0x25')](handleEntityNotFound(_0x40abfc,null))['then'](saveUpdates(_0x2241da['body'],null))[_0x8e61('0x25')](respondWithResult(_0x40abfc,null))[_0x8e61('0x46')](handleError(_0x40abfc,null));};exports[_0x8e61('0x26')]=function(_0x47223f,_0x5b3fb1){return db[_0x8e61('0x3f')]['find']({'where':{'id':_0x47223f[_0x8e61('0x43')]['id']}})[_0x8e61('0x25')](handleEntityNotFound(_0x5b3fb1,null))[_0x8e61('0x25')](removeEntity(_0x5b3fb1,null))[_0x8e61('0x46')](handleError(_0x5b3fb1,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 0986ae5..3ceb2ed 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 _0x81fa=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2595ab,_0xa172f3){var _0x7eecd5=function(_0x2f300c){while(--_0x2f300c){_0x2595ab['push'](_0x2595ab['shift']());}};_0x7eecd5(++_0xa172f3);}(_0x81fa,0xfe));var _0xa81f=function(_0x1317ed,_0x57217d){_0x1317ed=_0x1317ed-0x0;var _0xbaeca=_0x81fa[_0x1317ed];return _0xbaeca;};'use strict';var _=require('lodash');var util=require(_0xa81f('0x0'));var logger=require(_0xa81f('0x1'))(_0xa81f('0x2'));var moment=require(_0xa81f('0x3'));var BPromise=require(_0xa81f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa81f('0x5'));var rimraf=require(_0xa81f('0x6'));var config=require(_0xa81f('0x7'));var attributes=require(_0xa81f('0x8'));module[_0xa81f('0x9')]=function(_0x1f4016,_0x1ffe11){return _0x1f4016[_0xa81f('0xa')](_0xa81f('0xb'),attributes,{'tableName':_0xa81f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x488204,_0x4bd885){var _0x9e483c=function(_0x2bccd0){while(--_0x2bccd0){_0x488204['push'](_0x488204['shift']());}};_0x9e483c(++_0x4bd885);}(_0x038b,0x16a));var _0xb038=function(_0x40b645,_0x4b9f79){_0x40b645=_0x40b645-0x0;var _0x3b7d82=_0x038b[_0x40b645];return _0x3b7d82;};'use strict';var _=require(_0xb038('0x0'));var util=require(_0xb038('0x1'));var logger=require(_0xb038('0x2'))(_0xb038('0x3'));var moment=require(_0xb038('0x4'));var BPromise=require(_0xb038('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x6'));var rimraf=require('rimraf');var config=require(_0xb038('0x7'));var attributes=require(_0xb038('0x8'));module[_0xb038('0x9')]=function(_0x189916,_0xbc2fc7){return _0x189916[_0xb038('0xa')](_0xb038('0xb'),attributes,{'tableName':_0xb038('0xc'),'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 e20fc07..8d0db9f 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x907ff3,_0x4425b3){var _0x23e4d6=function(_0xc1072c){while(--_0xc1072c){_0x907ff3['push'](_0x907ff3['shift']());}};_0x23e4d6(++_0x4425b3);}(_0x1261,0x144));var _0x1126=function(_0x2cbec0,_0x262fef){_0x2cbec0=_0x2cbec0-0x0;var _0x3d4101=_0x1261[_0x2cbec0];return _0x3d4101;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x337879,_0x3ba232){_0x337879=_0x337879-0x0;var _0x5aaf57=_0x7a54[_0x337879];return _0x5aaf57;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index cc3ea3e..aa7a0c2 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 _0x99a8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','util','path','Router','fs-extra'];(function(_0x49f170,_0xa30615){var _0x907fbc=function(_0x393c12){while(--_0x393c12){_0x49f170['push'](_0x49f170['shift']());}};_0x907fbc(++_0xa30615);}(_0x99a8,0x73));var _0x899a=function(_0x35ae79,_0xfe315d){_0x35ae79=_0x35ae79-0x0;var _0x15f216=_0x99a8[_0x35ae79];return _0x15f216;};'use strict';var multer=require('multer');var util=require(_0x899a('0x0'));var path=require(_0x899a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x899a('0x2')]();var fs_extra=require(_0x899a('0x3'));var auth=require(_0x899a('0x4'));var interaction=require(_0x899a('0x5'));var config=require(_0x899a('0x6'));var controller=require(_0x899a('0x7'));router[_0x899a('0x8')]('/',auth[_0x899a('0x9')](),controller['index']);router[_0x899a('0x8')](_0x899a('0xa'),auth[_0x899a('0x9')](),controller['show']);router[_0x899a('0xb')]('/',auth[_0x899a('0x9')](),controller[_0x899a('0xc')]);router[_0x899a('0xd')](_0x899a('0xa'),auth[_0x899a('0x9')](),controller[_0x899a('0xe')]);router[_0x899a('0xf')](_0x899a('0xa'),auth[_0x899a('0x9')](),controller[_0x899a('0x10')]);module['exports']=router; \ No newline at end of file +var _0xea9d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','util','connect-timeout','express'];(function(_0x329b7d,_0x5d74db){var _0x297b68=function(_0x5779cf){while(--_0x5779cf){_0x329b7d['push'](_0x329b7d['shift']());}};_0x297b68(++_0x5d74db);}(_0xea9d,0xe7));var _0xdea9=function(_0x3f3ef6,_0x1dbc94){_0x3f3ef6=_0x3f3ef6-0x0;var _0x2ee40e=_0xea9d[_0x3f3ef6];return _0x2ee40e;};'use strict';var multer=require('multer');var util=require(_0xdea9('0x0'));var path=require('path');var timeout=require(_0xdea9('0x1'));var express=require(_0xdea9('0x2'));var router=express[_0xdea9('0x3')]();var fs_extra=require(_0xdea9('0x4'));var auth=require(_0xdea9('0x5'));var interaction=require(_0xdea9('0x6'));var config=require(_0xdea9('0x7'));var controller=require(_0xdea9('0x8'));router[_0xdea9('0x9')]('/',auth[_0xdea9('0xa')](),controller[_0xdea9('0xb')]);router['get'](_0xdea9('0xc'),auth[_0xdea9('0xa')](),controller['show']);router[_0xdea9('0xd')]('/',auth[_0xdea9('0xa')](),controller[_0xdea9('0xe')]);router['put'](_0xdea9('0xc'),auth[_0xdea9('0xa')](),controller[_0xdea9('0xf')]);router[_0xdea9('0x10')](_0xdea9('0xc'),auth[_0xdea9('0xa')](),controller[_0xdea9('0x11')]);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 8f8ae16..1b0828c 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 _0xe189=['sequelize','STRING'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xe189,0x194));var _0x9e18=function(_0x2d7fe7,_0xf8fd91){_0x2d7fe7=_0x2d7fe7-0x0;var _0xcb0510=_0xe189[_0x2d7fe7];return _0xcb0510;};'use strict';var Sequelize=require(_0x9e18('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x9e18('0x1')]},'type':{'type':Sequelize[_0x9e18('0x1')]}}; \ No newline at end of file +var _0x0d6a=['sequelize','exports','STRING'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x0d6a,0xc9));var _0xa0d6=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x0d6a[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require(_0xa0d6('0x0'));module[_0xa0d6('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa0d6('0x2')]},'type':{'type':Sequelize[_0xa0d6('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 49cc10f..7389540 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 _0x956e=['fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','error','name','send','index','Attachment','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','clone','get','omit','createdAt','updatedAt','body','update','file','originalname','basename','filename','mimetype','create','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1115a6,_0x5fd295){var _0x32edd3=function(_0x5a4b4b){while(--_0x5a4b4b){_0x1115a6['push'](_0x1115a6['shift']());}};_0x32edd3(++_0x5fd295);}(_0x956e,0xad));var _0xe956=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x956e[_0x365e54];return _0x13317a;};'use strict';var emlformat=require(_0xe956('0x0'));var rimraf=require(_0xe956('0x1'));var zipdir=require(_0xe956('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe956('0x3'));var moment=require(_0xe956('0x4'));var BPromise=require(_0xe956('0x5'));var Mustache=require(_0xe956('0x6'));var util=require(_0xe956('0x7'));var path=require(_0xe956('0x8'));var sox=require(_0xe956('0x9'));var csv=require(_0xe956('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe956('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe956('0xc'));var jsforce=require(_0xe956('0xd'));var deskjs=require(_0xe956('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe956('0xf'));var Papa=require('papaparse');var Redis=require(_0xe956('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe956('0x11'));var as=require(_0xe956('0x12'));var hardwareService=require(_0xe956('0x13'));var logger=require('../../config/logger')(_0xe956('0x14'));var utils=require(_0xe956('0x15'));var config=require(_0xe956('0x16'));var licenseUtil=require(_0xe956('0x17'));var db=require(_0xe956('0x18'))['db'];function respondWithStatusCode(_0x41d721,_0x181682){_0x181682=_0x181682||0xcc;return function(_0x44206b){if(_0x44206b){return _0x41d721['sendStatus'](_0x181682);}return _0x41d721[_0xe956('0x19')](_0x181682)[_0xe956('0x1a')]();};}function respondWithResult(_0x8e5f77,_0x53c1de){_0x53c1de=_0x53c1de||0xc8;return function(_0x3627bd){if(_0x3627bd){return _0x8e5f77['status'](_0x53c1de)[_0xe956('0x1b')](_0x3627bd);}};}function respondWithFilteredResult(_0x58b52a,_0x1893a6){return function(_0x232b43){if(_0x232b43){var _0x1d8023=typeof _0x1893a6[_0xe956('0x1c')]===_0xe956('0x1d')&&typeof _0x1893a6[_0xe956('0x1e')]==='undefined';var _0x41609e=_0x232b43[_0xe956('0x1f')];var _0x4ab32e=_0x1d8023?0x0:_0x1893a6['offset'];var _0x547eea=_0x1d8023?_0x232b43[_0xe956('0x1f')]:_0x1893a6[_0xe956('0x1c')]+_0x1893a6[_0xe956('0x1e')];var _0x216d42;if(_0x547eea>=_0x41609e){_0x547eea=_0x41609e;_0x216d42=0xc8;}else{_0x216d42=0xce;}_0x58b52a[_0xe956('0x19')](_0x216d42);return _0x58b52a[_0xe956('0x20')]('Content-Range',_0x4ab32e+'-'+_0x547eea+'/'+_0x41609e)['json'](_0x232b43);}return null;};}function patchUpdates(_0x57cba7){return function(_0xd8972f){try{jsonpatch[_0xe956('0x21')](_0xd8972f,_0x57cba7,!![]);}catch(_0x4fa787){return BPromise[_0xe956('0x22')](_0x4fa787);}return _0xd8972f['save']();};}function saveUpdates(_0xdb7884,_0x1a70ef){return function(_0x568334){if(_0x568334){return _0x568334['update'](_0xdb7884)[_0xe956('0x23')](function(_0x564de7){return _0x564de7;});}return null;};}function removeEntity(_0x4889ad,_0x1873d7){return function(_0x244494){if(_0x244494){return _0x244494[_0xe956('0x24')]()[_0xe956('0x23')](function(){_0x4889ad[_0xe956('0x19')](0xcc)[_0xe956('0x1a')]();});}};}function handleEntityNotFound(_0x615bf3,_0x57fc5b){return function(_0x22960f){if(!_0x22960f){_0x615bf3[_0xe956('0x25')](0x194);}return _0x22960f;};}function handleError(_0x43a551,_0x2a6ea9){_0x2a6ea9=_0x2a6ea9||0x1f4;return function(_0x196a56){logger[_0xe956('0x26')](_0x196a56['stack']);if(_0x196a56[_0xe956('0x27')]){delete _0x196a56[_0xe956('0x27')];}_0x43a551[_0xe956('0x19')](_0x2a6ea9)[_0xe956('0x28')](_0x196a56);};}exports[_0xe956('0x29')]=function(_0x35d6f5,_0x3cb18f){var _0x53034a={},_0x4a9c08={},_0x572593={'count':0x0,'rows':[]};var _0x314d03=_['map'](db[_0xe956('0x2a')]['rawAttributes'],function(_0x57434e){return{'name':_0x57434e[_0xe956('0x2b')],'type':_0x57434e[_0xe956('0x2c')][_0xe956('0x2d')]};});_0x4a9c08[_0xe956('0x2e')]=_[_0xe956('0x2f')](_0x314d03,_0xe956('0x27'));_0x4a9c08[_0xe956('0x30')]=_['keys'](_0x35d6f5['query']);_0x4a9c08[_0xe956('0x31')]=_[_0xe956('0x32')](_0x4a9c08[_0xe956('0x2e')],_0x4a9c08[_0xe956('0x30')]);_0x53034a[_0xe956('0x33')]=_['intersection'](_0x4a9c08[_0xe956('0x2e')],qs['fields'](_0x35d6f5['query'][_0xe956('0x34')]));_0x53034a[_0xe956('0x33')]=_0x53034a[_0xe956('0x33')][_0xe956('0x35')]?_0x53034a[_0xe956('0x33')]:_0x4a9c08[_0xe956('0x2e')];if(!_0x35d6f5[_0xe956('0x30')]['hasOwnProperty'](_0xe956('0x36'))){_0x53034a[_0xe956('0x1e')]=qs[_0xe956('0x1e')](_0x35d6f5[_0xe956('0x30')][_0xe956('0x1e')]);_0x53034a[_0xe956('0x1c')]=qs['offset'](_0x35d6f5[_0xe956('0x30')][_0xe956('0x1c')]);}_0x53034a[_0xe956('0x37')]=qs[_0xe956('0x38')](_0x35d6f5[_0xe956('0x30')][_0xe956('0x38')]);_0x53034a[_0xe956('0x39')]=qs[_0xe956('0x31')](_[_0xe956('0x3a')](_0x35d6f5[_0xe956('0x30')],_0x4a9c08[_0xe956('0x31')]),_0x314d03);if(_0x35d6f5[_0xe956('0x30')][_0xe956('0x3b')]){_0x53034a[_0xe956('0x39')]=_[_0xe956('0x3c')](_0x53034a['where'],{'$or':_['map'](_0x314d03,function(_0xcb87f3){if(_0xcb87f3['type']!==_0xe956('0x3d')){var _0x4171ca={};_0x4171ca[_0xcb87f3[_0xe956('0x27')]]={'$like':'%'+_0x35d6f5['query'][_0xe956('0x3b')]+'%'};return _0x4171ca;}})});}_0x53034a=_[_0xe956('0x3c')]({},_0x53034a,_0x35d6f5[_0xe956('0x3e')]);var _0x45f13e={'where':_0x53034a[_0xe956('0x39')]};return db[_0xe956('0x2a')][_0xe956('0x1f')](_0x45f13e)[_0xe956('0x23')](function(_0x15d2dd){_0x572593['count']=_0x15d2dd;if(_0x35d6f5[_0xe956('0x30')][_0xe956('0x3f')]){_0x53034a[_0xe956('0x40')]=[{'all':!![]}];}return db[_0xe956('0x2a')][_0xe956('0x41')](_0x53034a);})['then'](function(_0x337782){_0x572593[_0xe956('0x42')]=_0x337782;return _0x572593;})[_0xe956('0x23')](respondWithFilteredResult(_0x3cb18f,_0x53034a))[_0xe956('0x43')](handleError(_0x3cb18f,null));};exports[_0xe956('0x44')]=function(_0x15088f,_0x332a79){var _0x588b6a={'raw':!![],'where':{'id':_0x15088f[_0xe956('0x45')]['id']}},_0x56efe1={};_0x56efe1[_0xe956('0x2e')]=_[_0xe956('0x46')](db[_0xe956('0x2a')][_0xe956('0x47')]);_0x56efe1[_0xe956('0x30')]=_[_0xe956('0x46')](_0x15088f[_0xe956('0x30')]);_0x56efe1['filters']=_['intersection'](_0x56efe1[_0xe956('0x2e')],_0x56efe1[_0xe956('0x30')]);_0x588b6a[_0xe956('0x33')]=_[_0xe956('0x32')](_0x56efe1[_0xe956('0x2e')],qs[_0xe956('0x34')](_0x15088f['query'][_0xe956('0x34')]));_0x588b6a['attributes']=_0x588b6a[_0xe956('0x33')][_0xe956('0x35')]?_0x588b6a[_0xe956('0x33')]:_0x56efe1[_0xe956('0x2e')];if(_0x15088f[_0xe956('0x30')][_0xe956('0x3f')]){_0x588b6a[_0xe956('0x40')]=[{'all':!![]}];}_0x588b6a=_[_0xe956('0x3c')]({},_0x588b6a,_0x15088f['options']);return db[_0xe956('0x2a')][_0xe956('0x48')](_0x588b6a)['then'](handleEntityNotFound(_0x332a79,null))['then'](respondWithResult(_0x332a79,null))[_0xe956('0x43')](handleError(_0x332a79,null));};exports[_0xe956('0x49')]=function(_0x398749,_0x4079bf){var _0x563529={'where':{'id':_0x398749[_0xe956('0x45')]['id']}},_0x19c856={};_0x19c856['model']=_[_0xe956('0x46')](db[_0xe956('0x2a')]['rawAttributes']);_0x563529[_0xe956('0x33')]=_[_0xe956('0x32')](_0x19c856['model'],qs['fields'](_0x398749[_0xe956('0x30')][_0xe956('0x34')]));_0x563529[_0xe956('0x33')]=_0x563529[_0xe956('0x33')][_0xe956('0x35')]?_0x563529[_0xe956('0x33')]:_0x19c856[_0xe956('0x2e')];if(_0x398749[_0xe956('0x30')][_0xe956('0x3f')]){_0x563529[_0xe956('0x40')]=[{'all':!![]}];}_0x563529=_[_0xe956('0x3c')]({},_0x563529,_0x398749[_0xe956('0x3e')]);return db[_0xe956('0x2a')]['find'](_0x563529)[_0xe956('0x23')](handleEntityNotFound(_0x4079bf,null))['then'](function(_0x48fee8){if(_0x48fee8){var _0x2e18cf=_0x48fee8[_0xe956('0x4a')]({'plain':!![]});_0x2e18cf=qs[_0xe956('0x4b')](_0x2e18cf,['id','createdAt','updatedAt']);_0x398749['body']=_[_0xe956('0x4b')](_0x398749['body'],['id',_0xe956('0x4c'),_0xe956('0x4d')]);return db[_0xe956('0x2a')]['create'](_[_0xe956('0x3c')](_0x2e18cf,_0x398749[_0xe956('0x4e')]),{'include':_0x398749[_0xe956('0x30')][_0xe956('0x3f')]?[{'all':!![]}]:undefined});}})[_0xe956('0x23')](respondWithResult(_0x4079bf,0xc9))[_0xe956('0x43')](handleError(_0x4079bf,null));};exports[_0xe956('0x4f')]=function(_0x355ed5,_0x4b4c4d){if(_0x355ed5[_0xe956('0x4e')]['id']){delete _0x355ed5[_0xe956('0x4e')]['id'];}return db[_0xe956('0x2a')]['find']({'where':{'id':_0x355ed5['params']['id']}})[_0xe956('0x23')](handleEntityNotFound(_0x4b4c4d,null))[_0xe956('0x23')](saveUpdates(_0x355ed5['body'],null))[_0xe956('0x23')](respondWithResult(_0x4b4c4d,null))[_0xe956('0x43')](handleError(_0x4b4c4d,null));};exports[_0xe956('0x24')]=function(_0x519c27,_0x4673ae){return db[_0xe956('0x2a')][_0xe956('0x48')]({'where':{'id':_0x519c27[_0xe956('0x45')]['id']}})['then'](handleEntityNotFound(_0x4673ae,null))[_0xe956('0x23')](removeEntity(_0x4673ae,null))[_0xe956('0x43')](handleError(_0x4673ae,null));};exports['create']=function(_0x18bb76,_0x572495,_0x3b4249){_0x18bb76['body']['name']=_0x18bb76[_0xe956('0x50')][_0xe956('0x51')];_0x18bb76['body'][_0xe956('0x52')]=_0x18bb76[_0xe956('0x50')][_0xe956('0x53')];_0x18bb76[_0xe956('0x4e')][_0xe956('0x2c')]=_0x18bb76['file'][_0xe956('0x54')];return db['Attachment'][_0xe956('0x55')](_0x18bb76[_0xe956('0x4e')])[_0xe956('0x23')](respondWithResult(_0x572495,0xc9))[_0xe956('0x43')](handleError(_0x572495,null));};exports[_0xe956('0x56')]=function(_0x23200b,_0x3ff471,_0x90cc13){return db[_0xe956('0x2a')][_0xe956('0x57')]({'where':{'id':_0x23200b[_0xe956('0x45')]['id']},'raw':!![]})[_0xe956('0x23')](handleEntityNotFound(_0x3ff471,null))[_0xe956('0x23')](function(_0x8a1481){if(_0x8a1481){var _0x63024b=_0x8a1481[_0xe956('0x58')]!==null;var _0x2ef9c5=path['join'](config[_0xe956('0x59')],_0xe956('0x5a'));if(_0x63024b){_0x2ef9c5=path[_0xe956('0x5b')](_0x2ef9c5,'offline-chat/');}var _0x31ab7f=path['join'](_0x2ef9c5,_0x8a1481[_0xe956('0x52')]);return _0x3ff471[_0xe956('0x56')](_0x31ab7f);}})['catch'](handleError(_0x3ff471,null));}; \ No newline at end of file +var _0x542c=['join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','index','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','include','findAll','rows','catch','params','includeAll','options','find','clone','get','omit','createdAt','updatedAt','body','create','basename','file','filename','mimetype','download','findOne'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x542c,0xba));var _0xc542=function(_0x83f6cd,_0x4e9719){_0x83f6cd=_0x83f6cd-0x0;var _0x56ebf3=_0x542c[_0x83f6cd];return _0x56ebf3;};'use strict';var emlformat=require(_0xc542('0x0'));var rimraf=require(_0xc542('0x1'));var zipdir=require(_0xc542('0x2'));var jsonpatch=require(_0xc542('0x3'));var rp=require(_0xc542('0x4'));var moment=require(_0xc542('0x5'));var BPromise=require(_0xc542('0x6'));var Mustache=require(_0xc542('0x7'));var util=require(_0xc542('0x8'));var path=require(_0xc542('0x9'));var sox=require(_0xc542('0xa'));var csv=require(_0xc542('0xb'));var ejs=require(_0xc542('0xc'));var fs=require('fs');var fs_extra=require(_0xc542('0xd'));var _=require(_0xc542('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc542('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc542('0x10'));var Papa=require(_0xc542('0x11'));var Redis=require(_0xc542('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc542('0x13'));var as=require(_0xc542('0x14'));var hardwareService=require(_0xc542('0x15'));var logger=require('../../config/logger')(_0xc542('0x16'));var utils=require(_0xc542('0x17'));var config=require(_0xc542('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc542('0x19'))['db'];function respondWithStatusCode(_0x22422f,_0x2f0815){_0x2f0815=_0x2f0815||0xcc;return function(_0x3ea00f){if(_0x3ea00f){return _0x22422f[_0xc542('0x1a')](_0x2f0815);}return _0x22422f[_0xc542('0x1b')](_0x2f0815)[_0xc542('0x1c')]();};}function respondWithResult(_0x311e48,_0x5c5beb){_0x5c5beb=_0x5c5beb||0xc8;return function(_0x3dc78f){if(_0x3dc78f){return _0x311e48[_0xc542('0x1b')](_0x5c5beb)[_0xc542('0x1d')](_0x3dc78f);}};}function respondWithFilteredResult(_0x563c0b,_0x3608d1){return function(_0x4006fc){if(_0x4006fc){var _0x1dfc96=typeof _0x3608d1['offset']===_0xc542('0x1e')&&typeof _0x3608d1[_0xc542('0x1f')]===_0xc542('0x1e');var _0x191845=_0x4006fc[_0xc542('0x20')];var _0x19c98a=_0x1dfc96?0x0:_0x3608d1[_0xc542('0x21')];var _0x553080=_0x1dfc96?_0x4006fc[_0xc542('0x20')]:_0x3608d1[_0xc542('0x21')]+_0x3608d1[_0xc542('0x1f')];var _0x206352;if(_0x553080>=_0x191845){_0x553080=_0x191845;_0x206352=0xc8;}else{_0x206352=0xce;}_0x563c0b[_0xc542('0x1b')](_0x206352);return _0x563c0b[_0xc542('0x22')]('Content-Range',_0x19c98a+'-'+_0x553080+'/'+_0x191845)[_0xc542('0x1d')](_0x4006fc);}return null;};}function patchUpdates(_0x46d4d3){return function(_0x11bcc3){try{jsonpatch[_0xc542('0x23')](_0x11bcc3,_0x46d4d3,!![]);}catch(_0x5410c2){return BPromise[_0xc542('0x24')](_0x5410c2);}return _0x11bcc3[_0xc542('0x25')]();};}function saveUpdates(_0x32fd4d,_0x599a7c){return function(_0x383585){if(_0x383585){return _0x383585[_0xc542('0x26')](_0x32fd4d)[_0xc542('0x27')](function(_0x273be0){return _0x273be0;});}return null;};}function removeEntity(_0x19992c,_0x2d09ea){return function(_0x4c874d){if(_0x4c874d){return _0x4c874d[_0xc542('0x28')]()[_0xc542('0x27')](function(){_0x19992c[_0xc542('0x1b')](0xcc)[_0xc542('0x1c')]();});}};}function handleEntityNotFound(_0x397f14,_0x488fba){return function(_0x5d4896){if(!_0x5d4896){_0x397f14[_0xc542('0x1a')](0x194);}return _0x5d4896;};}function handleError(_0x51dfd8,_0x2e3a51){_0x2e3a51=_0x2e3a51||0x1f4;return function(_0x421ba1){logger[_0xc542('0x29')](_0x421ba1['stack']);if(_0x421ba1[_0xc542('0x2a')]){delete _0x421ba1[_0xc542('0x2a')];}_0x51dfd8[_0xc542('0x1b')](_0x2e3a51)['send'](_0x421ba1);};}exports[_0xc542('0x2b')]=function(_0x42384f,_0x2404bb){var _0x5b9f09={},_0x2ba4d8={},_0x38d5f1={'count':0x0,'rows':[]};var _0x500904=_['map'](db[_0xc542('0x2c')][_0xc542('0x2d')],function(_0x4e4d08){return{'name':_0x4e4d08[_0xc542('0x2e')],'type':_0x4e4d08[_0xc542('0x2f')][_0xc542('0x30')]};});_0x2ba4d8[_0xc542('0x31')]=_['map'](_0x500904,_0xc542('0x2a'));_0x2ba4d8[_0xc542('0x32')]=_[_0xc542('0x33')](_0x42384f[_0xc542('0x32')]);_0x2ba4d8[_0xc542('0x34')]=_[_0xc542('0x35')](_0x2ba4d8[_0xc542('0x31')],_0x2ba4d8['query']);_0x5b9f09[_0xc542('0x36')]=_[_0xc542('0x35')](_0x2ba4d8[_0xc542('0x31')],qs[_0xc542('0x37')](_0x42384f[_0xc542('0x32')][_0xc542('0x37')]));_0x5b9f09['attributes']=_0x5b9f09[_0xc542('0x36')][_0xc542('0x38')]?_0x5b9f09[_0xc542('0x36')]:_0x2ba4d8['model'];if(!_0x42384f[_0xc542('0x32')][_0xc542('0x39')](_0xc542('0x3a'))){_0x5b9f09[_0xc542('0x1f')]=qs[_0xc542('0x1f')](_0x42384f[_0xc542('0x32')][_0xc542('0x1f')]);_0x5b9f09[_0xc542('0x21')]=qs[_0xc542('0x21')](_0x42384f[_0xc542('0x32')][_0xc542('0x21')]);}_0x5b9f09[_0xc542('0x3b')]=qs[_0xc542('0x3c')](_0x42384f['query'][_0xc542('0x3c')]);_0x5b9f09[_0xc542('0x3d')]=qs[_0xc542('0x34')](_[_0xc542('0x3e')](_0x42384f[_0xc542('0x32')],_0x2ba4d8[_0xc542('0x34')]),_0x500904);if(_0x42384f[_0xc542('0x32')][_0xc542('0x3f')]){_0x5b9f09['where']=_[_0xc542('0x40')](_0x5b9f09[_0xc542('0x3d')],{'$or':_[_0xc542('0x41')](_0x500904,function(_0x5bcf38){if(_0x5bcf38['type']!=='VIRTUAL'){var _0x2982ef={};_0x2982ef[_0x5bcf38['name']]={'$like':'%'+_0x42384f[_0xc542('0x32')][_0xc542('0x3f')]+'%'};return _0x2982ef;}})});}_0x5b9f09=_['merge']({},_0x5b9f09,_0x42384f['options']);var _0x1d2149={'where':_0x5b9f09[_0xc542('0x3d')]};return db['Attachment']['count'](_0x1d2149)[_0xc542('0x27')](function(_0x26b3b9){_0x38d5f1[_0xc542('0x20')]=_0x26b3b9;if(_0x42384f[_0xc542('0x32')]['includeAll']){_0x5b9f09[_0xc542('0x42')]=[{'all':!![]}];}return db['Attachment'][_0xc542('0x43')](_0x5b9f09);})[_0xc542('0x27')](function(_0x505d17){_0x38d5f1[_0xc542('0x44')]=_0x505d17;return _0x38d5f1;})['then'](respondWithFilteredResult(_0x2404bb,_0x5b9f09))[_0xc542('0x45')](handleError(_0x2404bb,null));};exports['show']=function(_0xb556e0,_0x1eff45){var _0x1126d6={'raw':!![],'where':{'id':_0xb556e0[_0xc542('0x46')]['id']}},_0x23db8f={};_0x23db8f['model']=_[_0xc542('0x33')](db[_0xc542('0x2c')][_0xc542('0x2d')]);_0x23db8f['query']=_[_0xc542('0x33')](_0xb556e0[_0xc542('0x32')]);_0x23db8f[_0xc542('0x34')]=_[_0xc542('0x35')](_0x23db8f[_0xc542('0x31')],_0x23db8f[_0xc542('0x32')]);_0x1126d6[_0xc542('0x36')]=_['intersection'](_0x23db8f[_0xc542('0x31')],qs['fields'](_0xb556e0['query'][_0xc542('0x37')]));_0x1126d6[_0xc542('0x36')]=_0x1126d6[_0xc542('0x36')][_0xc542('0x38')]?_0x1126d6[_0xc542('0x36')]:_0x23db8f[_0xc542('0x31')];if(_0xb556e0[_0xc542('0x32')][_0xc542('0x47')]){_0x1126d6[_0xc542('0x42')]=[{'all':!![]}];}_0x1126d6=_[_0xc542('0x40')]({},_0x1126d6,_0xb556e0[_0xc542('0x48')]);return db[_0xc542('0x2c')][_0xc542('0x49')](_0x1126d6)[_0xc542('0x27')](handleEntityNotFound(_0x1eff45,null))[_0xc542('0x27')](respondWithResult(_0x1eff45,null))[_0xc542('0x45')](handleError(_0x1eff45,null));};exports[_0xc542('0x4a')]=function(_0x37ab5c,_0x55c366){var _0x3a9e16={'where':{'id':_0x37ab5c[_0xc542('0x46')]['id']}},_0x2a87e1={};_0x2a87e1[_0xc542('0x31')]=_[_0xc542('0x33')](db['Attachment'][_0xc542('0x2d')]);_0x3a9e16[_0xc542('0x36')]=_['intersection'](_0x2a87e1['model'],qs[_0xc542('0x37')](_0x37ab5c['query'][_0xc542('0x37')]));_0x3a9e16[_0xc542('0x36')]=_0x3a9e16[_0xc542('0x36')][_0xc542('0x38')]?_0x3a9e16[_0xc542('0x36')]:_0x2a87e1[_0xc542('0x31')];if(_0x37ab5c[_0xc542('0x32')][_0xc542('0x47')]){_0x3a9e16['include']=[{'all':!![]}];}_0x3a9e16=_[_0xc542('0x40')]({},_0x3a9e16,_0x37ab5c[_0xc542('0x48')]);return db[_0xc542('0x2c')][_0xc542('0x49')](_0x3a9e16)[_0xc542('0x27')](handleEntityNotFound(_0x55c366,null))[_0xc542('0x27')](function(_0x1d226b){if(_0x1d226b){var _0x3ebd39=_0x1d226b[_0xc542('0x4b')]({'plain':!![]});_0x3ebd39=qs[_0xc542('0x4c')](_0x3ebd39,['id',_0xc542('0x4d'),_0xc542('0x4e')]);_0x37ab5c[_0xc542('0x4f')]=_['omit'](_0x37ab5c[_0xc542('0x4f')],['id',_0xc542('0x4d'),_0xc542('0x4e')]);return db['Attachment']['create'](_['merge'](_0x3ebd39,_0x37ab5c[_0xc542('0x4f')]),{'include':_0x37ab5c[_0xc542('0x32')][_0xc542('0x47')]?[{'all':!![]}]:undefined});}})[_0xc542('0x27')](respondWithResult(_0x55c366,0xc9))[_0xc542('0x45')](handleError(_0x55c366,null));};exports[_0xc542('0x26')]=function(_0x2df039,_0x4d27bd){if(_0x2df039[_0xc542('0x4f')]['id']){delete _0x2df039[_0xc542('0x4f')]['id'];}return db[_0xc542('0x2c')][_0xc542('0x49')]({'where':{'id':_0x2df039[_0xc542('0x46')]['id']}})[_0xc542('0x27')](handleEntityNotFound(_0x4d27bd,null))[_0xc542('0x27')](saveUpdates(_0x2df039[_0xc542('0x4f')],null))[_0xc542('0x27')](respondWithResult(_0x4d27bd,null))['catch'](handleError(_0x4d27bd,null));};exports[_0xc542('0x28')]=function(_0x452f21,_0x14e5cd){return db[_0xc542('0x2c')][_0xc542('0x49')]({'where':{'id':_0x452f21['params']['id']}})['then'](handleEntityNotFound(_0x14e5cd,null))['then'](removeEntity(_0x14e5cd,null))[_0xc542('0x45')](handleError(_0x14e5cd,null));};exports[_0xc542('0x50')]=function(_0x4a67c6,_0x2907ba,_0x2f5cc0){_0x4a67c6[_0xc542('0x4f')][_0xc542('0x2a')]=_0x4a67c6['file']['originalname'];_0x4a67c6['body'][_0xc542('0x51')]=_0x4a67c6[_0xc542('0x52')][_0xc542('0x53')];_0x4a67c6[_0xc542('0x4f')][_0xc542('0x2f')]=_0x4a67c6[_0xc542('0x52')][_0xc542('0x54')];return db[_0xc542('0x2c')][_0xc542('0x50')](_0x4a67c6[_0xc542('0x4f')])[_0xc542('0x27')](respondWithResult(_0x2907ba,0xc9))['catch'](handleError(_0x2907ba,null));};exports[_0xc542('0x55')]=function(_0x52d936,_0x1eda9e,_0x400083){return db[_0xc542('0x2c')][_0xc542('0x56')]({'where':{'id':_0x52d936[_0xc542('0x46')]['id']},'raw':!![]})[_0xc542('0x27')](handleEntityNotFound(_0x1eda9e,null))[_0xc542('0x27')](function(_0x4858f5){if(_0x4858f5){var _0x5dcf26=_0x4858f5['ChatOfflineMessageId']!==null;var _0x219cb1=path[_0xc542('0x57')](config[_0xc542('0x58')],_0xc542('0x59'));if(_0x5dcf26){_0x219cb1=path[_0xc542('0x57')](_0x219cb1,_0xc542('0x5a'));}var _0x11dc13=path[_0xc542('0x57')](_0x219cb1,_0x4858f5[_0xc542('0x51')]);return _0x1eda9e[_0xc542('0x55')](_0x11dc13);}})[_0xc542('0x45')](handleError(_0x1eda9e,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 84765ef..a86784f 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 _0xa626=['../../config/environment','exports','define','Attachment','attachments','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x29e327,_0x2b6ea9){var _0x3dac9e=function(_0x5c0e02){while(--_0x5c0e02){_0x29e327['push'](_0x29e327['shift']());}};_0x3dac9e(++_0x2b6ea9);}(_0xa626,0x170));var _0x6a62=function(_0x52d008,_0x33b6c9){_0x52d008=_0x52d008-0x0;var _0x2bb6a9=_0xa626[_0x52d008];return _0x2bb6a9;};'use strict';var _=require('lodash');var util=require(_0x6a62('0x0'));var logger=require(_0x6a62('0x1'))('api');var moment=require(_0x6a62('0x2'));var BPromise=require(_0x6a62('0x3'));var rp=require(_0x6a62('0x4'));var fs=require('fs');var path=require(_0x6a62('0x5'));var rimraf=require('rimraf');var config=require(_0x6a62('0x6'));var attributes=require('./attachment.attributes');module[_0x6a62('0x7')]=function(_0x428b4e,_0x4c214b){return _0x428b4e[_0x6a62('0x8')](_0x6a62('0x9'),attributes,{'tableName':_0x6a62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a4e=['./attachment.attributes','exports','define','attachments','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a4e,0xe8));var _0xe3a4=function(_0x3533fc,_0x71554d){_0x3533fc=_0x3533fc-0x0;var _0x33f90b=_0x3a4e[_0x3533fc];return _0x33f90b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3a4('0x0'))(_0xe3a4('0x1'));var moment=require(_0xe3a4('0x2'));var BPromise=require(_0xe3a4('0x3'));var rp=require(_0xe3a4('0x4'));var fs=require('fs');var path=require(_0xe3a4('0x5'));var rimraf=require(_0xe3a4('0x6'));var config=require(_0xe3a4('0x7'));var attributes=require(_0xe3a4('0x8'));module[_0xe3a4('0x9')]=function(_0x5e5e40,_0x416379){return _0x5e5e40[_0xe3a4('0xa')]('Attachment',attributes,{'tableName':_0xe3a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 20b4061..388f60a 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 _0xeddd=['../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment','create','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0xeddd,0x69));var _0xdedd=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xeddd[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var moment=require(_0xdedd('0x2'));var BPromise=require(_0xdedd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdedd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdedd('0x5'));var logger=require(_0xdedd('0x6'))('rpc');var config=require(_0xdedd('0x7'));var jayson=require(_0xdedd('0x8'));var client=jayson[_0xdedd('0x9')][_0xdedd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x102b00,_0x41d72f,_0x2aa946){return new BPromise(function(_0x260839,_0x3cc017){return client[_0xdedd('0xb')](_0x102b00,_0x2aa946)[_0xdedd('0xc')](function(_0x429585){logger['info'](_0xdedd('0xd'),_0x41d72f,_0xdedd('0xe'));logger[_0xdedd('0xf')](_0xdedd('0x10'),_0x41d72f,'request\x20sent',JSON[_0xdedd('0x11')](_0x429585));if(_0x429585[_0xdedd('0x12')]){if(_0x429585[_0xdedd('0x12')][_0xdedd('0x13')]===0x1f4){logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);return _0x3cc017(_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);}logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);return _0x260839(_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);}else{logger[_0xdedd('0x15')](_0xdedd('0xd'),_0x41d72f,_0xdedd('0xe'));_0x260839(_0x429585['result'][_0xdedd('0x14')]);}})[_0xdedd('0x16')](function(_0x588ce7){logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x588ce7);_0x3cc017(_0x588ce7);});});}exports[_0xdedd('0x17')]=function(_0x4b16bb){var _0x43611b=this;return new Promise(function(_0x24e331,_0x4054b0){return db[_0xdedd('0x18')][_0xdedd('0x19')](_0x4b16bb['body'],{'raw':_0x4b16bb[_0xdedd('0x1a')]?_0x4b16bb[_0xdedd('0x1a')][_0xdedd('0x1b')]===undefined?!![]:![]:!![]})[_0xdedd('0xc')](function(_0x1213d6){logger[_0xdedd('0x15')](_0xdedd('0x17'),_0x4b16bb);logger[_0xdedd('0xf')](_0xdedd('0x17'),_0x4b16bb,JSON['stringify'](_0x1213d6));_0x24e331(_0x1213d6);})['catch'](function(_0x538dc1){logger['error'](_0xdedd('0x17'),_0x538dc1[_0xdedd('0x14')],_0x4b16bb);_0x4054b0(_0x43611b[_0xdedd('0x12')](0x1f4,_0x538dc1[_0xdedd('0x14')]));});});}; \ No newline at end of file +var _0xc91b=['client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','Attachment','create','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0xc91b,0x16f));var _0xbc91=function(_0x39c898,_0x226025){_0x39c898=_0x39c898-0x0;var _0xf0e85e=_0xc91b[_0x39c898];return _0xf0e85e;};'use strict';var _=require(_0xbc91('0x0'));var util=require(_0xbc91('0x1'));var moment=require(_0xbc91('0x2'));var BPromise=require(_0xbc91('0x3'));var rs=require(_0xbc91('0x4'));var fs=require('fs');var Redis=require(_0xbc91('0x5'));var db=require(_0xbc91('0x6'))['db'];var utils=require(_0xbc91('0x7'));var logger=require('../../config/logger')(_0xbc91('0x8'));var config=require(_0xbc91('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbc91('0xa')][_0xbc91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x535cb9,_0xf88d45,_0x43731a){return new BPromise(function(_0x36e15f,_0x34f079){return client[_0xbc91('0xc')](_0x535cb9,_0x43731a)[_0xbc91('0xd')](function(_0xa20d9){logger['info'](_0xbc91('0xe'),_0xf88d45,_0xbc91('0xf'));logger[_0xbc91('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0xf88d45,'request\x20sent',JSON[_0xbc91('0x11')](_0xa20d9));if(_0xa20d9[_0xbc91('0x12')]){if(_0xa20d9['error']['code']===0x1f4){logger[_0xbc91('0x12')]('Attachment,\x20%s,\x20%s',_0xf88d45,_0xa20d9['error'][_0xbc91('0x13')]);return _0x34f079(_0xa20d9[_0xbc91('0x12')][_0xbc91('0x13')]);}logger[_0xbc91('0x12')]('Attachment,\x20%s,\x20%s',_0xf88d45,_0xa20d9['error'][_0xbc91('0x13')]);return _0x36e15f(_0xa20d9[_0xbc91('0x12')]['message']);}else{logger[_0xbc91('0x14')](_0xbc91('0xe'),_0xf88d45,_0xbc91('0xf'));_0x36e15f(_0xa20d9[_0xbc91('0x15')][_0xbc91('0x13')]);}})[_0xbc91('0x16')](function(_0xb92600){logger[_0xbc91('0x12')](_0xbc91('0xe'),_0xf88d45,_0xb92600);_0x34f079(_0xb92600);});});}exports['CreateAttachment']=function(_0x60911a){var _0x439145=this;return new Promise(function(_0x181d48,_0x31ce1f){return db[_0xbc91('0x17')][_0xbc91('0x18')](_0x60911a[_0xbc91('0x19')],{'raw':_0x60911a['options']?_0x60911a[_0xbc91('0x1a')][_0xbc91('0x1b')]===undefined?!![]:![]:!![]})[_0xbc91('0xd')](function(_0x558c32){logger['info'](_0xbc91('0x1c'),_0x60911a);logger[_0xbc91('0x10')](_0xbc91('0x1c'),_0x60911a,JSON[_0xbc91('0x11')](_0x558c32));_0x181d48(_0x558c32);})['catch'](function(_0x521196){logger[_0xbc91('0x12')](_0xbc91('0x1c'),_0x521196[_0xbc91('0x13')],_0x60911a);_0x31ce1f(_0x439145[_0xbc91('0x12')](0x1f4,_0x521196[_0xbc91('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index aced63d..3294506 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(_0x26eecf,_0x360096){var _0x1cf849=function(_0x44f8be){while(--_0x44f8be){_0x26eecf['push'](_0x26eecf['shift']());}};_0x1cf849(++_0x360096);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ab263,_0x4d1958){_0x5ab263=_0x5ab263-0x0;var _0x21ac3e=_0x5f2f[_0x5ab263];return _0x21ac3e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x230155,_0xe6c951){var _0x107160=function(_0x4afd06){while(--_0x4afd06){_0x230155['push'](_0x230155['shift']());}};_0x107160(++_0xe6c951);}(_0xadb5,0xad));var _0x5adb=function(_0x44374a,_0x592c75){_0x44374a=_0x44374a-0x0;var _0x3313fd=_0xadb5[_0x44374a];return _0x3313fd;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index f8ac267..bd56e78 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 _0x5870=['use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','callback','authenticate'];(function(_0x1389e3,_0x2ed4bd){var _0x3f6873=function(_0x494b3a){while(--_0x494b3a){_0x1389e3['push'](_0x1389e3['shift']());}};_0x3f6873(++_0x2ed4bd);}(_0x5870,0x180));var _0x0587=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5870[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x0587('0x0'));var passport=require(_0x0587('0x1'));var GoogleStrategy=require(_0x0587('0x2'))[_0x0587('0x3')];var moment=require(_0x0587('0x4'));var db=require(_0x0587('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0x0587('0x6'))[_0x0587('0x7')];var utils=require(_0x0587('0x8'));exports[_0x0587('0x9')]=passport['authenticate'](_0x0587('0xa'),{'failureRedirect':_0x0587('0xb'),'scope':[_0x0587('0xc'),_0x0587('0xd')],'session':![]});exports[_0x0587('0xe')]=passport[_0x0587('0xf')](_0x0587('0xa'),{'failureRedirect':_0x0587('0xb'),'session':![]});passport[_0x0587('0x10')](new GoogleStrategy({'clientID':config[_0x0587('0xa')]?config['google'][_0x0587('0x11')]:'id','clientSecret':config[_0x0587('0xa')]?config['google'][_0x0587('0x12')]:_0x0587('0x13'),'callbackURL':config[_0x0587('0xa')]?config[_0x0587('0xa')][_0x0587('0x14')]:''},function(_0x29c6ef,_0x30269d,_0x323153,_0x3c6af5){var _0x2f093d,_0x301e41;return db[_0x0587('0x15')][_0x0587('0x16')]({'where':{'id':0x1},'attributes':[_0x0587('0x17'),_0x0587('0x18')],'raw':!![]})[_0x0587('0x19')](function(_0x43307a){_0x2f093d=_0x43307a;return db[_0x0587('0x1a')]['find']({'where':{'email':_[_0x0587('0x1b')](_0x323153[_0x0587('0x1c')],_0x0587('0x1d')),'role':{'$or':[_0x0587('0x1e'),'user',_0x0587('0x1f')]}}});})['then'](function(_0x2c6f82){_0x301e41=_0x2c6f82;if(_0x301e41){if(_0x301e41[_0x0587('0x20')]){return _0x3c6af5(_0x0587('0x21'));}else if(_0x2f093d['blockDuration']>0x0){if(_0x301e41[_0x0587('0x22')]){if(moment(_0x301e41['blockedAt'])[_0x0587('0x23')](_0x2f093d[_0x0587('0x18')],_0x0587('0x24'))>moment()){return _0x3c6af5('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x0587('0x25')](_0x301e41,0x0,![],null)[_0x0587('0x19')](function(){return utils[_0x0587('0x26')](_0x301e41);})['then'](function(){return _0x3c6af5(null,_0x301e41);});}}else{return utils[_0x0587('0x26')](_0x301e41)[_0x0587('0x19')](function(){return _0x3c6af5(null,_0x301e41);});}}else{return utils[_0x0587('0x26')](_0x301e41)[_0x0587('0x19')](function(){return _0x3c6af5(null,_0x301e41);});}}return _0x3c6af5(_0x0587('0x21'));})[_0x0587('0x27')](function(_0x3fac){_0x3c6af5(_0x3fac);});})); \ No newline at end of file +var _0x3953=['value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','Strategy','moment','../../mysqldb','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails'];(function(_0x1e8fd0,_0x9b6f0d){var _0x37ad7e=function(_0x590421){while(--_0x590421){_0x1e8fd0['push'](_0x1e8fd0['shift']());}};_0x37ad7e(++_0x9b6f0d);}(_0x3953,0x1b5));var _0x3395=function(_0x1e0253,_0x2ba1d1){_0x1e0253=_0x1e0253-0x0;var _0x136914=_0x3953[_0x1e0253];return _0x136914;};'use strict';var _=require(_0x3395('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x3395('0x1')];var moment=require(_0x3395('0x2'));var db=require(_0x3395('0x3'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0x3395('0x4')];var utils=require(_0x3395('0x5'));exports[_0x3395('0x6')]=passport[_0x3395('0x7')](_0x3395('0x8'),{'failureRedirect':_0x3395('0x9'),'scope':[_0x3395('0xa'),_0x3395('0xb')],'session':![]});exports[_0x3395('0xc')]=passport[_0x3395('0x7')](_0x3395('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x3395('0xd')](new GoogleStrategy({'clientID':config[_0x3395('0x8')]?config['google'][_0x3395('0xe')]:'id','clientSecret':config['google']?config[_0x3395('0x8')]['clientSecret']:_0x3395('0xf'),'callbackURL':config[_0x3395('0x8')]?config[_0x3395('0x8')]['callbackURL']:''},function(_0x33ee3c,_0x3e885b,_0x427274,_0xbb786a){var _0x535c87,_0x59275a;return db[_0x3395('0x10')][_0x3395('0x11')]({'where':{'id':0x1},'attributes':[_0x3395('0x12'),_0x3395('0x13')],'raw':!![]})[_0x3395('0x14')](function(_0x44b7be){_0x535c87=_0x44b7be;return db[_0x3395('0x15')][_0x3395('0x16')]({'where':{'email':_[_0x3395('0x17')](_0x427274[_0x3395('0x18')],_0x3395('0x19')),'role':{'$or':[_0x3395('0x1a'),'user',_0x3395('0x1b')]}}});})[_0x3395('0x14')](function(_0x5384d8){_0x59275a=_0x5384d8;if(_0x59275a){if(_0x59275a[_0x3395('0x1c')]){return _0xbb786a(_0x3395('0x1d'));}else if(_0x535c87[_0x3395('0x13')]>0x0){if(_0x59275a['blocked']){if(moment(_0x59275a['blockedAt'])['add'](_0x535c87[_0x3395('0x13')],'minutes')>moment()){return _0xbb786a(_0x3395('0x1d'));}else{return utils[_0x3395('0x1e')](_0x59275a,0x0,![],null)[_0x3395('0x14')](function(){return utils[_0x3395('0x1f')](_0x59275a);})[_0x3395('0x14')](function(){return _0xbb786a(null,_0x59275a);});}}else{return utils[_0x3395('0x1f')](_0x59275a)['then'](function(){return _0xbb786a(null,_0x59275a);});}}else{return utils[_0x3395('0x1f')](_0x59275a)[_0x3395('0x14')](function(){return _0xbb786a(null,_0x59275a);});}}return _0xbb786a(_0x3395('0x1d'));})[_0x3395('0x20')](function(_0x2e9162){_0xbb786a(_0x2e9162);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index cb1fc26..b7859af 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 _0x56f4=['exports','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback','setTokenCookie'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0x56f4,0xe2));var _0x456f=function(_0x4c70ec,_0x3823ee){_0x4c70ec=_0x4c70ec-0x0;var _0x5bc825=_0x56f4[_0x4c70ec];return _0x5bc825;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x456f('0x0')]();var controller=require(_0x456f('0x1'));var userController=require(_0x456f('0x2'));var authService=require(_0x456f('0x3'));router[_0x456f('0x4')]('/',controller[_0x456f('0x5')]);router[_0x456f('0x4')]('/callback',controller[_0x456f('0x6')],authService['isMiddleware'],userController[_0x456f('0x5')],authService[_0x456f('0x7')]);module[_0x456f('0x8')]=router; \ No newline at end of file +var _0x3fec=['exports','express','./authGoogle.controller','../user/user.controller.js','get','/callback','isMiddleware','login','setTokenCookie'];(function(_0x433467,_0x4c13a3){var _0x5cedee=function(_0x2de6fe){while(--_0x2de6fe){_0x433467['push'](_0x433467['shift']());}};_0x5cedee(++_0x4c13a3);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xc3fe('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xc3fe('0x1'));var userController=require(_0xc3fe('0x2'));var authService=require('../../components/auth/service');router[_0xc3fe('0x3')]('/',controller['login']);router['get'](_0xc3fe('0x4'),controller['callback'],authService[_0xc3fe('0x5')],userController[_0xc3fe('0x6')],authService[_0xc3fe('0x7')]);module[_0xc3fe('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e412647..d7dfa30 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 _0x9435=['host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','name','password','salt','role','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9435,0x93));var _0x5943=function(_0x570ad6,_0x36a5a4){_0x570ad6=_0x570ad6-0x0;var _0x4977c9=_0x9435[_0x570ad6];return _0x4977c9;};'use strict';var util=require(_0x5943('0x0'));var passport=require(_0x5943('0x1'));var LocalStrategy=require(_0x5943('0x2'))[_0x5943('0x3')];var jayson=require('jayson/promise');var _=require(_0x5943('0x4'));var rs=require('randomstring');var moment=require(_0x5943('0x5'));var db=require(_0x5943('0x6'))['db'];var authService=require(_0x5943('0x7'));var utils=require(_0x5943('0x8'));var client=jayson[_0x5943('0x9')][_0x5943('0xa')]({'port':0x232b});function localAuthenticate(_0x114c6c,_0x21cc3a,_0x1388ca,_0x139c03){var _0x3e13cd,_0x21dde7;return db[_0x5943('0xb')][_0x5943('0xc')]({'where':{'id':0x1},'attributes':[_0x5943('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x5a42db){_0x3e13cd=_0x5a42db;return _0x114c6c[_0x5943('0xc')]({'attributes':['id',_0x5943('0xe'),_0x5943('0xf'),_0x5943('0x10'),_0x5943('0x11'),'disabled',_0x5943('0x12'),'blockedAt',_0x5943('0x13')],'where':{'name':_0x21cc3a,'role':{'$or':[_0x5943('0x14'),_0x5943('0x15'),_0x5943('0x16')]}}});})[_0x5943('0x17')](function(_0x4035e6){if(!_0x4035e6||_0x4035e6&&_0x4035e6[_0x5943('0xe')]!==_0x21cc3a){throw new Error(_0x5943('0x18'));}else{_0x21dde7=_0x4035e6;return _0x21dde7;}})['then'](function(){_0x21dde7[_0x5943('0x19')](_0x1388ca,function(_0x4ae9bc,_0x239039){var _0x43987f=_0x21dde7[_0x5943('0x13')]+0x1;if(_0x4ae9bc){return _0x139c03(_0x4ae9bc);}else if(!_0x239039){if(_0x21dde7[_0x5943('0x1a')]){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else if(_0x3e13cd[_0x5943('0xd')]>0x0){if(_0x21dde7['blocked']){if(_0x3e13cd[_0x5943('0x1b')]>0x0){if(moment(_0x21dde7[_0x5943('0x1c')])[_0x5943('0x1d')](_0x3e13cd[_0x5943('0x1b')],_0x5943('0x1e'))>moment()){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else{return utils['clearBlockUser'](_0x21dde7,_0x43987f,![],null)['then'](function(){return _0x139c03(null,![],{'message':_0x5943('0x18')});});}}else{return _0x139c03(null,![],{'message':_0x5943('0x18')});}}else{if(_0x43987f>=_0x3e13cd[_0x5943('0xd')]){return utils[_0x5943('0x1f')](_0x21dde7,0x0,!![],moment())[_0x5943('0x17')](function(){return _0x139c03(null,![],{'message':_0x5943('0x18')});});}else{return utils['clearBlockUser'](_0x21dde7,_0x43987f,![],null)['then'](function(){return _0x139c03(null,![],{'message':_0x5943('0x18')});});}}}else{return _0x139c03(null,![],{'message':_0x5943('0x18')});}}else{if(_0x21dde7[_0x5943('0x1a')]){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else if(_0x3e13cd['allowedLoginAttempts']>0x0){if(_0x21dde7[_0x5943('0x12')]){if(_0x3e13cd[_0x5943('0x1b')]>0x0){if(moment(_0x21dde7['blockedAt'])[_0x5943('0x1d')](_0x3e13cd[_0x5943('0x1b')],_0x5943('0x1e'))>moment()){return _0x139c03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5943('0x1f')](_0x21dde7,0x0,![],null)['then'](function(){return utils[_0x5943('0x20')](_0x21dde7);})['then'](function(){return _0x139c03(null,_0x21dde7);});}}else{return _0x139c03(null,![],{'message':_0x5943('0x18')});}}else{return utils[_0x5943('0x1f')](_0x21dde7,0x0,![],null)[_0x5943('0x17')](function(){return utils[_0x5943('0x20')](_0x21dde7);})[_0x5943('0x17')](function(){return _0x139c03(null,_0x21dde7);})['catch'](function(_0x727bde){return _0x139c03(null,![],_0x727bde);});}}else{if(_0x21dde7[_0x5943('0x12')]){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else{return utils[_0x5943('0x20')](_0x21dde7)['then'](function(){return _0x139c03(null,_0x21dde7);});}}}});})['catch'](function(_0x39f9c6){return _0x139c03(null,![],_0x39f9c6);});}function sendServiceMail(_0x5434be){return db['MailAccount'][_0x5943('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x5943('0x22')],'include':[{'model':db[_0x5943('0x23')],'as':_0x5943('0x24')}]})['then'](function(_0x3f726a){if(!_0x3f726a){throw new Error(_0x5943('0x25'));}var _0x3aea7f={'tls':{'rejectUnauthorized':![]}};if(_0x3f726a[_0x5943('0x24')][_0x5943('0x26')]){_0x3aea7f[_0x5943('0x26')]=_0x3f726a[_0x5943('0x24')][_0x5943('0x26')];}else{_0x3aea7f[_0x5943('0x27')]=_0x3f726a['Smtp']['host'];_0x3aea7f[_0x5943('0x28')]=_0x3f726a[_0x5943('0x24')][_0x5943('0x28')];_0x3aea7f['secure']=_0x3f726a[_0x5943('0x24')][_0x5943('0x29')];}if(_0x3f726a[_0x5943('0x24')]['authentication']){_0x3aea7f[_0x5943('0x2a')]={'user':_0x3f726a['Smtp'][_0x5943('0x15')],'pass':_0x3f726a[_0x5943('0x24')][_0x5943('0x2b')]};}var _0x34e792={'account':_0x3aea7f,'message':_[_0x5943('0x2c')]({'from':util[_0x5943('0x2d')](_0x5943('0x2e'),_0x3f726a[_0x5943('0xe')],_0x3f726a[_0x5943('0x22')]||_0x3f726a[_0x5943('0x24')][_0x5943('0x15')])},_0x5434be)};return client[_0x5943('0x2f')](_0x5943('0x30'),_0x34e792);})['then'](function(_0x49119f){if(_0x49119f['error']){throw new Error(util[_0x5943('0x2d')](_0x5943('0x31'),_0x49119f[_0x5943('0x32')][_0x5943('0x33')]||JSON[_0x5943('0x34')](_0x49119f[_0x5943('0x32')])));}return!![];});}function handleError(_0x49631d,_0x11021c,_0x578ff7){return _0x49631d[_0x5943('0x35')](_0x11021c||0x1f4)[_0x5943('0x36')]({'message':_0x578ff7?_0x578ff7['message']||_0x578ff7:''});}exports[_0x5943('0x37')]=function(_0x84a4de,_0x27c1c5,_0x2cb100){passport[_0x5943('0x19')](_0x5943('0x38'),function(_0x29d0fe,_0x222fc0,_0x275477){var _0x4608ee=_0x29d0fe||_0x275477;if(_0x4608ee){return handleError(_0x27c1c5,0x191,_0x4608ee);}if(!_0x222fc0){return handleError(_0x27c1c5,0x194,{'message':_0x5943('0x39')});}else{var _0x38376d={'payload':{'id':_0x222fc0['id'],'role':_0x222fc0[_0x5943('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x5943('0x3a')](_0x38376d)[_0x5943('0x17')](function(_0x4debb0){_0x27c1c5[_0x5943('0x3b')]({'id':_0x222fc0['id'],'token':_0x4debb0,'statusCall':'','isAlreadyLogged':_0x222fc0[_0x5943('0x3c')]});});}})(_0x84a4de,_0x27c1c5,_0x2cb100);};exports[_0x5943('0x3d')]=function(_0x25faa2,_0x1d7b65,_0x10dba6){if(!_0x25faa2[_0x5943('0x3e')][_0x5943('0x22')]){return handleError(_0x1d7b65,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4f772c=rs[_0x5943('0x3f')]();_0x25faa2['body']['email']=_0x25faa2[_0x5943('0x3e')]['email'][_0x5943('0x40')]()[_0x5943('0x41')]();var _0x16d93a;return db[_0x5943('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x5943('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x3297a5){_0x16d93a=_0x3297a5;return db[_0x5943('0x42')][_0x5943('0x21')]({'where':{'email':_0x25faa2[_0x5943('0x3e')][_0x5943('0x22')]}});})['then'](function(_0x31d082){if(!_0x31d082){throw new Error(_0x5943('0x43'));}if(_0x31d082[_0x5943('0x1a')]){throw new Error(_0x5943('0x44'));}if(_0x31d082[_0x5943('0x12')]){if(moment(_0x31d082[_0x5943('0x1c')])[_0x5943('0x1d')](_0x16d93a[_0x5943('0x1b')],_0x5943('0x1e'))>moment()){throw new Error(_0x5943('0x45'));}else{_0x31d082[_0x5943('0x12')]=![];_0x31d082['blockedAt']=null;}}_0x31d082[_0x5943('0x46')]=_0x4f772c;_0x31d082[_0x5943('0x47')]=Date[_0x5943('0x48')]()+0x36ee80;return _0x31d082[_0x5943('0x49')]();})[_0x5943('0x17')](function(){return sendServiceMail({'to':_0x25faa2[_0x5943('0x3e')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5943('0x4a')+_0x5943('0x4b')+_0x5943('0x4c')+_0x25faa2[_0x5943('0x4d')][_0x5943('0x27')]+_0x5943('0x4e')+_0x4f772c+'\x0a\x0a'+_0x5943('0x4f')});})[_0x5943('0x17')](function(){_0x1d7b65[_0x5943('0x35')](0xc8)[_0x5943('0x36')]({'message':_0x5943('0x50')});})[_0x5943('0x51')](function(_0x1cb287){return handleError(_0x1d7b65,0x1f4,_0x1cb287);});};exports[_0x5943('0x52')]=function(_0x44bf89,_0x52b94d,_0x4f42cd){return db[_0x5943('0x42')][_0x5943('0x21')]({'where':{'resetPasswordToken':_0x44bf89[_0x5943('0x53')]['token'],'resetPasswordExpires':{'$gt':Date[_0x5943('0x48')]()}}})[_0x5943('0x17')](function(_0x58714c){if(!_0x58714c){throw new Error(_0x5943('0x54'));}return db[_0x5943('0xb')]['findOne']({'attributes':['id',_0x5943('0x55'),_0x5943('0x56'),'passwordHistoryLimit']})[_0x5943('0x17')](function(_0x4306f6){if(_0x4306f6[_0x5943('0x55')])authService[_0x5943('0x57')](_0x44bf89[_0x5943('0x3e')]['password']);if(!_0x4306f6['enforcePasswordHistory']||!_0x58714c[_0x5943('0x58')])return _0x58714c;authService[_0x5943('0x59')](_0x44bf89[_0x5943('0x3e')][_0x5943('0xf')],_0x58714c[_0x5943('0x58')],_0x4306f6[_0x5943('0x5a')]);return _0x58714c;})[_0x5943('0x17')](function(){_0x58714c[_0x5943('0xf')]=_0x44bf89[_0x5943('0x3e')][_0x5943('0xf')];_0x58714c['resetPasswordToken']=null;_0x58714c[_0x5943('0x47')]=null;return _0x58714c[_0x5943('0x49')]();});})[_0x5943('0x17')](function(){_0x52b94d['status'](0xc8)['send']({'message':_0x5943('0x5b')});})[_0x5943('0x51')](function(_0x521e88){return handleError(_0x52b94d,0x1f4,_0x521e88);});};passport[_0x5943('0x5c')](new LocalStrategy({'usernameField':_0x5943('0xe'),'passwordField':_0x5943('0xf')},function(_0x116f54,_0x367d6c,_0x57fe32){return localAuthenticate(db[_0x5943('0x42')],_0x116f54,_0x367d6c,_0x57fe32);})); \ No newline at end of file +var _0x69a1=['loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','error','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blocked','blockedAt'];(function(_0x5adede,_0x255a22){var _0x1e8790=function(_0x2048bd){while(--_0x2048bd){_0x5adede['push'](_0x5adede['shift']());}};_0x1e8790(++_0x255a22);}(_0x69a1,0x95));var _0x169a=function(_0x314afa,_0x2b0e26){_0x314afa=_0x314afa-0x0;var _0x3a2d19=_0x69a1[_0x314afa];return _0x3a2d19;};'use strict';var util=require(_0x169a('0x0'));var passport=require(_0x169a('0x1'));var LocalStrategy=require(_0x169a('0x2'))[_0x169a('0x3')];var jayson=require('jayson/promise');var _=require(_0x169a('0x4'));var rs=require(_0x169a('0x5'));var moment=require(_0x169a('0x6'));var db=require(_0x169a('0x7'))['db'];var authService=require(_0x169a('0x8'));var utils=require(_0x169a('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x5143f9,_0x5682c1,_0x3d35e6,_0x5202c4){var _0x25982c,_0x474bb2;return db[_0x169a('0xa')][_0x169a('0xb')]({'where':{'id':0x1},'attributes':[_0x169a('0xc'),_0x169a('0xd')],'raw':!![]})[_0x169a('0xe')](function(_0x53e3a7){_0x25982c=_0x53e3a7;return _0x5143f9[_0x169a('0xb')]({'attributes':['id',_0x169a('0xf'),'password',_0x169a('0x10'),_0x169a('0x11'),_0x169a('0x12'),_0x169a('0x13'),_0x169a('0x14'),_0x169a('0x15')],'where':{'name':_0x5682c1,'role':{'$or':[_0x169a('0x16'),_0x169a('0x17'),_0x169a('0x18')]}}});})[_0x169a('0xe')](function(_0x3ffcf0){if(!_0x3ffcf0||_0x3ffcf0&&_0x3ffcf0['name']!==_0x5682c1){throw new Error(_0x169a('0x19'));}else{_0x474bb2=_0x3ffcf0;return _0x474bb2;}})[_0x169a('0xe')](function(){_0x474bb2[_0x169a('0x1a')](_0x3d35e6,function(_0x4aad58,_0x3b0754){var _0x19300c=_0x474bb2[_0x169a('0x15')]+0x1;if(_0x4aad58){return _0x5202c4(_0x4aad58);}else if(!_0x3b0754){if(_0x474bb2[_0x169a('0x12')]){return _0x5202c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x25982c['allowedLoginAttempts']>0x0){if(_0x474bb2['blocked']){if(_0x25982c[_0x169a('0xd')]>0x0){if(moment(_0x474bb2[_0x169a('0x14')])[_0x169a('0x1b')](_0x25982c[_0x169a('0xd')],_0x169a('0x1c'))>moment()){return _0x5202c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x169a('0x1d')](_0x474bb2,_0x19300c,![],null)[_0x169a('0xe')](function(){return _0x5202c4(null,![],{'message':_0x169a('0x19')});});}}else{return _0x5202c4(null,![],{'message':_0x169a('0x19')});}}else{if(_0x19300c>=_0x25982c[_0x169a('0xc')]){return utils[_0x169a('0x1d')](_0x474bb2,0x0,!![],moment())[_0x169a('0xe')](function(){return _0x5202c4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x169a('0x1d')](_0x474bb2,_0x19300c,![],null)[_0x169a('0xe')](function(){return _0x5202c4(null,![],{'message':_0x169a('0x19')});});}}}else{return _0x5202c4(null,![],{'message':_0x169a('0x19')});}}else{if(_0x474bb2[_0x169a('0x12')]){return _0x5202c4(null,![],{'message':_0x169a('0x19')});}else if(_0x25982c['allowedLoginAttempts']>0x0){if(_0x474bb2[_0x169a('0x13')]){if(_0x25982c[_0x169a('0xd')]>0x0){if(moment(_0x474bb2[_0x169a('0x14')])[_0x169a('0x1b')](_0x25982c[_0x169a('0xd')],_0x169a('0x1c'))>moment()){return _0x5202c4(null,![],{'message':_0x169a('0x19')});}else{return utils[_0x169a('0x1d')](_0x474bb2,0x0,![],null)[_0x169a('0xe')](function(){return utils['getLicense'](_0x474bb2);})[_0x169a('0xe')](function(){return _0x5202c4(null,_0x474bb2);});}}else{return _0x5202c4(null,![],{'message':_0x169a('0x19')});}}else{return utils[_0x169a('0x1d')](_0x474bb2,0x0,![],null)[_0x169a('0xe')](function(){return utils[_0x169a('0x1e')](_0x474bb2);})[_0x169a('0xe')](function(){return _0x5202c4(null,_0x474bb2);})[_0x169a('0x1f')](function(_0x20371b){return _0x5202c4(null,![],_0x20371b);});}}else{if(_0x474bb2['blocked']){return _0x5202c4(null,![],{'message':_0x169a('0x19')});}else{return utils[_0x169a('0x1e')](_0x474bb2)[_0x169a('0xe')](function(){return _0x5202c4(null,_0x474bb2);});}}}});})[_0x169a('0x1f')](function(_0x2968a9){return _0x5202c4(null,![],_0x2968a9);});}function sendServiceMail(_0x34b34e){return db[_0x169a('0x20')][_0x169a('0x21')]({'where':{'service':!![]},'attributes':['id',_0x169a('0xf'),_0x169a('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x169a('0x23')}]})[_0x169a('0xe')](function(_0x25bae8){if(!_0x25bae8){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x41ae21={'tls':{'rejectUnauthorized':![]}};if(_0x25bae8[_0x169a('0x23')]['service']){_0x41ae21['service']=_0x25bae8[_0x169a('0x23')][_0x169a('0x24')];}else{_0x41ae21[_0x169a('0x25')]=_0x25bae8[_0x169a('0x23')][_0x169a('0x25')];_0x41ae21[_0x169a('0x26')]=_0x25bae8[_0x169a('0x23')][_0x169a('0x26')];_0x41ae21[_0x169a('0x27')]=_0x25bae8['Smtp']['secure'];}if(_0x25bae8[_0x169a('0x23')][_0x169a('0x28')]){_0x41ae21[_0x169a('0x29')]={'user':_0x25bae8[_0x169a('0x23')][_0x169a('0x17')],'pass':_0x25bae8[_0x169a('0x23')]['pass']};}var _0x1aac44={'account':_0x41ae21,'message':_[_0x169a('0x2a')]({'from':util[_0x169a('0x2b')](_0x169a('0x2c'),_0x25bae8['name'],_0x25bae8[_0x169a('0x22')]||_0x25bae8[_0x169a('0x23')]['user'])},_0x34b34e)};return client[_0x169a('0x2d')](_0x169a('0x2e'),_0x1aac44);})[_0x169a('0xe')](function(_0x105fe1){if(_0x105fe1['error']){throw new Error(util[_0x169a('0x2b')](_0x169a('0x2f'),_0x105fe1['error'][_0x169a('0x30')]||JSON['stringify'](_0x105fe1[_0x169a('0x31')])));}return!![];});}function handleError(_0x3b9a91,_0x572f2f,_0x49d1f4){return _0x3b9a91['status'](_0x572f2f||0x1f4)[_0x169a('0x32')]({'message':_0x49d1f4?_0x49d1f4['message']||_0x49d1f4:''});}exports[_0x169a('0x33')]=function(_0x285773,_0x4edf42,_0x42df08){passport['authenticate'](_0x169a('0x34'),function(_0x1b6f69,_0x59dde0,_0xd53fec){var _0x569d91=_0x1b6f69||_0xd53fec;if(_0x569d91){return handleError(_0x4edf42,0x191,_0x569d91);}if(!_0x59dde0){return handleError(_0x4edf42,0x194,{'message':_0x169a('0x35')});}else{var _0x34c8ec={'payload':{'id':_0x59dde0['id'],'role':_0x59dde0[_0x169a('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x34c8ec)[_0x169a('0xe')](function(_0x15ccf8){_0x4edf42[_0x169a('0x36')]({'id':_0x59dde0['id'],'token':_0x15ccf8,'statusCall':'','isAlreadyLogged':_0x59dde0[_0x169a('0x37')]});});}})(_0x285773,_0x4edf42,_0x42df08);};exports[_0x169a('0x38')]=function(_0x4448d5,_0xf32ea0,_0x3e4647){if(!_0x4448d5[_0x169a('0x39')][_0x169a('0x22')]){return handleError(_0xf32ea0,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xb046ee=rs['generate']();_0x4448d5[_0x169a('0x39')][_0x169a('0x22')]=_0x4448d5[_0x169a('0x39')][_0x169a('0x22')]['trim']()[_0x169a('0x3a')]();var _0x551903;return db[_0x169a('0xa')][_0x169a('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x169a('0xd')],'raw':!![]})[_0x169a('0xe')](function(_0x365be1){_0x551903=_0x365be1;return db[_0x169a('0x3b')]['find']({'where':{'email':_0x4448d5[_0x169a('0x39')]['email']}});})[_0x169a('0xe')](function(_0x1baa12){if(!_0x1baa12){throw new Error(_0x169a('0x3c'));}if(_0x1baa12[_0x169a('0x12')]){throw new Error(_0x169a('0x3d'));}if(_0x1baa12[_0x169a('0x13')]){if(moment(_0x1baa12['blockedAt'])[_0x169a('0x1b')](_0x551903[_0x169a('0xd')],_0x169a('0x1c'))>moment()){throw new Error(_0x169a('0x3e'));}else{_0x1baa12['blocked']=![];_0x1baa12[_0x169a('0x14')]=null;}}_0x1baa12['resetPasswordToken']=_0xb046ee;_0x1baa12[_0x169a('0x3f')]=Date[_0x169a('0x40')]()+0x36ee80;return _0x1baa12[_0x169a('0x41')]();})[_0x169a('0xe')](function(){return sendServiceMail({'to':_0x4448d5['body'][_0x169a('0x22')],'subject':_0x169a('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x169a('0x43')+'https://'+_0x4448d5[_0x169a('0x44')][_0x169a('0x25')]+'/reset/'+_0xb046ee+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0xf32ea0[_0x169a('0x45')](0xc8)[_0x169a('0x32')]({'message':_0x169a('0x46')});})[_0x169a('0x1f')](function(_0x131a18){return handleError(_0xf32ea0,0x1f4,_0x131a18);});};exports[_0x169a('0x47')]=function(_0x199767,_0x5bcf04,_0x5a240b){return db[_0x169a('0x3b')][_0x169a('0x21')]({'where':{'resetPasswordToken':_0x199767[_0x169a('0x48')][_0x169a('0x49')],'resetPasswordExpires':{'$gt':Date[_0x169a('0x40')]()}}})[_0x169a('0xe')](function(_0x5a0697){if(!_0x5a0697){throw new Error(_0x169a('0x4a'));}return db['Setting']['findOne']({'attributes':['id',_0x169a('0x4b'),_0x169a('0x4c'),_0x169a('0x4d')]})['then'](function(_0x13d56f){if(_0x13d56f[_0x169a('0x4b')])authService[_0x169a('0x4e')](_0x199767['body'][_0x169a('0x4f')]);if(!_0x13d56f[_0x169a('0x4c')]||!_0x5a0697[_0x169a('0x50')])return _0x5a0697;authService[_0x169a('0x51')](_0x199767[_0x169a('0x39')]['password'],_0x5a0697[_0x169a('0x50')],_0x13d56f[_0x169a('0x4d')]);return _0x5a0697;})[_0x169a('0xe')](function(){_0x5a0697['password']=_0x199767['body'][_0x169a('0x4f')];_0x5a0697[_0x169a('0x52')]=null;_0x5a0697[_0x169a('0x3f')]=null;return _0x5a0697[_0x169a('0x41')]();});})[_0x169a('0xe')](function(){_0x5bcf04[_0x169a('0x45')](0xc8)[_0x169a('0x32')]({'message':_0x169a('0x53')});})['catch'](function(_0x55691d){return handleError(_0x5bcf04,0x1f4,_0x55691d);});};passport[_0x169a('0x54')](new LocalStrategy({'usernameField':_0x169a('0xf'),'passwordField':'password'},function(_0x8494fe,_0x4668a5,_0x4d2f08){return localAuthenticate(db['User'],_0x8494fe,_0x4668a5,_0x4d2f08);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 0d712a4..ac4effc 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 _0xee51=['express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x33a308,_0x374616){var _0x457de0=function(_0x1d3f3a){while(--_0x1d3f3a){_0x33a308['push'](_0x33a308['shift']());}};_0x457de0(++_0x374616);}(_0xee51,0x10e));var _0x1ee5=function(_0x2c024f,_0x573917){_0x2c024f=_0x2c024f-0x0;var _0x3d9e3e=_0xee51[_0x2c024f];return _0x3d9e3e;};'use strict';var express=require(_0x1ee5('0x0'));var router=express['Router']();var controller=require(_0x1ee5('0x1'));router[_0x1ee5('0x2')]('/',controller[_0x1ee5('0x3')]);router[_0x1ee5('0x2')](_0x1ee5('0x4'),controller[_0x1ee5('0x5')]);router[_0x1ee5('0x2')](_0x1ee5('0x6'),controller[_0x1ee5('0x7')]);module[_0x1ee5('0x8')]=router; \ No newline at end of file +var _0x29de=['login','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x2e5111,_0x5b8f9e){var _0x1174ec=function(_0xca9f23){while(--_0xca9f23){_0x2e5111['push'](_0x2e5111['shift']());}};_0x1174ec(++_0x5b8f9e);}(_0x29de,0xf3));var _0xe29d=function(_0x1ddf87,_0x1c36d8){_0x1ddf87=_0x1ddf87-0x0;var _0x3c5845=_0x29de[_0x1ddf87];return _0x3c5845;};'use strict';var express=require(_0xe29d('0x0'));var router=express[_0xe29d('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xe29d('0x2')]);router['post']('/forgot',controller[_0xe29d('0x3')]);router['post'](_0xe29d('0x4'),controller[_0xe29d('0x5')]);module[_0xe29d('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f230680..b52dbe4 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 _0x911b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x911b,0xc4));var _0xb911=function(_0xcd888b,_0x55a146){_0xcd888b=_0xcd888b-0x0;var _0x3c2aba=_0x911b[_0xcd888b];return _0x3c2aba;};'use strict';var Sequelize=require(_0xb911('0x0'));module[_0xb911('0x1')]={'name':{'type':Sequelize[_0xb911('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb911('0x2')]},'description':{'type':Sequelize[_0xb911('0x2')]},'status':{'type':Sequelize[_0xb911('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xa0ff=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x7b2098,_0x191540){var _0x17dcf4=function(_0x15afff){while(--_0x15afff){_0x7b2098['push'](_0x7b2098['shift']());}};_0x17dcf4(++_0x191540);}(_0xa0ff,0x154));var _0xfa0f=function(_0x4e05d8,_0xab2ee9){_0x4e05d8=_0x4e05d8-0x0;var _0x356a48=_0xa0ff[_0x4e05d8];return _0x356a48;};'use strict';var Sequelize=require(_0xfa0f('0x0'));module[_0xfa0f('0x1')]={'name':{'type':Sequelize[_0xfa0f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xfa0f('0x2')]},'description':{'type':Sequelize[_0xfa0f('0x2')]},'status':{'type':Sequelize[_0xfa0f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfa0f('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 80498d5..5f9b054 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 _0x67fd=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','intersection','catch','create','body','params','addConditions','Condition','find','ids','omit','getConditions','addActions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','squel'];(function(_0x4a752,_0x3c1398){var _0x3ff76a=function(_0x230f83){while(--_0x230f83){_0x4a752['push'](_0x4a752['shift']());}};_0x3ff76a(++_0x3c1398);}(_0x67fd,0x1d6));var _0xd67f=function(_0x42e255,_0x4dc264){_0x42e255=_0x42e255-0x0;var _0x3b817e=_0x67fd[_0x42e255];return _0x3b817e;};'use strict';var emlformat=require(_0xd67f('0x0'));var rimraf=require(_0xd67f('0x1'));var zipdir=require(_0xd67f('0x2'));var jsonpatch=require(_0xd67f('0x3'));var rp=require(_0xd67f('0x4'));var moment=require('moment');var BPromise=require(_0xd67f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd67f('0x6'));var sox=require(_0xd67f('0x7'));var csv=require(_0xd67f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd67f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd67f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd67f('0xb'));var Papa=require(_0xd67f('0xc'));var Redis=require(_0xd67f('0xd'));var authService=require(_0xd67f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd67f('0xf'));var hardwareService=require(_0xd67f('0x10'));var logger=require('../../config/logger')(_0xd67f('0x11'));var utils=require(_0xd67f('0x12'));var config=require(_0xd67f('0x13'));var licenseUtil=require(_0xd67f('0x14'));var db=require(_0xd67f('0x15'))['db'];function respondWithStatusCode(_0x308140,_0x3f4571){_0x3f4571=_0x3f4571||0xcc;return function(_0x13d4a5){if(_0x13d4a5){return _0x308140[_0xd67f('0x16')](_0x3f4571);}return _0x308140[_0xd67f('0x17')](_0x3f4571)['end']();};}function respondWithResult(_0x5f3de5,_0x41d5e5){_0x41d5e5=_0x41d5e5||0xc8;return function(_0xeff800){if(_0xeff800){return _0x5f3de5[_0xd67f('0x17')](_0x41d5e5)[_0xd67f('0x18')](_0xeff800);}};}function respondWithFilteredResult(_0x359750,_0x206cec){return function(_0x4d4cef){if(_0x4d4cef){var _0xa3489f=typeof _0x206cec[_0xd67f('0x19')]===_0xd67f('0x1a')&&typeof _0x206cec[_0xd67f('0x1b')]==='undefined';var _0x58c8c7=_0x4d4cef[_0xd67f('0x1c')];var _0x10d4a3=_0xa3489f?0x0:_0x206cec[_0xd67f('0x19')];var _0x3c7c2b=_0xa3489f?_0x4d4cef['count']:_0x206cec[_0xd67f('0x19')]+_0x206cec[_0xd67f('0x1b')];var _0x2c1b1a;if(_0x3c7c2b>=_0x58c8c7){_0x3c7c2b=_0x58c8c7;_0x2c1b1a=0xc8;}else{_0x2c1b1a=0xce;}_0x359750[_0xd67f('0x17')](_0x2c1b1a);return _0x359750[_0xd67f('0x1d')](_0xd67f('0x1e'),_0x10d4a3+'-'+_0x3c7c2b+'/'+_0x58c8c7)[_0xd67f('0x18')](_0x4d4cef);}return null;};}function patchUpdates(_0x4c6cac){return function(_0x119eb6){try{jsonpatch['apply'](_0x119eb6,_0x4c6cac,!![]);}catch(_0xd85e34){return BPromise['reject'](_0xd85e34);}return _0x119eb6['save']();};}function saveUpdates(_0x91f204,_0x567306){return function(_0x428872){if(_0x428872){return _0x428872[_0xd67f('0x1f')](_0x91f204)[_0xd67f('0x20')](function(_0x59e17b){return _0x59e17b;});}return null;};}function removeEntity(_0x141aa0,_0x300e70){return function(_0x2c87f0){if(_0x2c87f0){return _0x2c87f0[_0xd67f('0x21')]()[_0xd67f('0x20')](function(){_0x141aa0[_0xd67f('0x17')](0xcc)[_0xd67f('0x22')]();});}};}function handleEntityNotFound(_0x80e600,_0x141910){return function(_0x5280e3){if(!_0x5280e3){_0x80e600[_0xd67f('0x16')](0x194);}return _0x5280e3;};}function handleError(_0x5dabfa,_0x482490){_0x482490=_0x482490||0x1f4;return function(_0x4b080b){logger['error'](_0x4b080b[_0xd67f('0x23')]);if(_0x4b080b[_0xd67f('0x24')]){delete _0x4b080b['name'];}_0x5dabfa[_0xd67f('0x17')](_0x482490)['send'](_0x4b080b);};}exports[_0xd67f('0x25')]=function(_0x50c9d4,_0x1ce9f2){var _0x15c338={},_0x5ed241={},_0x3b9af7={'count':0x0,'rows':[]};var _0x523067=_[_0xd67f('0x26')](db[_0xd67f('0x27')][_0xd67f('0x28')],function(_0x3214ad){return{'name':_0x3214ad[_0xd67f('0x29')],'type':_0x3214ad[_0xd67f('0x2a')][_0xd67f('0x2b')]};});_0x5ed241[_0xd67f('0x2c')]=_[_0xd67f('0x26')](_0x523067,_0xd67f('0x24'));_0x5ed241[_0xd67f('0x2d')]=_[_0xd67f('0x2e')](_0x50c9d4[_0xd67f('0x2d')]);_0x5ed241[_0xd67f('0x2f')]=_['intersection'](_0x5ed241[_0xd67f('0x2c')],_0x5ed241[_0xd67f('0x2d')]);_0x15c338[_0xd67f('0x30')]=_['intersection'](_0x5ed241[_0xd67f('0x2c')],qs[_0xd67f('0x31')](_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x31')]));_0x15c338[_0xd67f('0x30')]=_0x15c338[_0xd67f('0x30')][_0xd67f('0x32')]?_0x15c338['attributes']:_0x5ed241[_0xd67f('0x2c')];if(!_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x33')](_0xd67f('0x34'))){_0x15c338[_0xd67f('0x1b')]=qs[_0xd67f('0x1b')](_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x1b')]);_0x15c338[_0xd67f('0x19')]=qs[_0xd67f('0x19')](_0x50c9d4['query'][_0xd67f('0x19')]);}_0x15c338[_0xd67f('0x35')]=qs[_0xd67f('0x36')](_0x50c9d4['query'][_0xd67f('0x36')]);_0x15c338['where']=qs[_0xd67f('0x2f')](_[_0xd67f('0x37')](_0x50c9d4[_0xd67f('0x2d')],_0x5ed241[_0xd67f('0x2f')]),_0x523067);if(_0x50c9d4['query'][_0xd67f('0x38')]){_0x15c338[_0xd67f('0x39')]=_[_0xd67f('0x3a')](_0x15c338['where'],{'$or':_['map'](_0x523067,function(_0x1d49b9){if(_0x1d49b9['type']!==_0xd67f('0x3b')){var _0x3a605b={};_0x3a605b[_0x1d49b9['name']]={'$like':'%'+_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x38')]+'%'};return _0x3a605b;}})});}_0x15c338=_['merge']({},_0x15c338,_0x50c9d4[_0xd67f('0x3c')]);var _0x591ea1={'where':_0x15c338[_0xd67f('0x39')]};return db[_0xd67f('0x27')][_0xd67f('0x1c')](_0x591ea1)[_0xd67f('0x20')](function(_0x47e9a7){_0x3b9af7['count']=_0x47e9a7;if(_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x3d')]){_0x15c338[_0xd67f('0x3e')]=[{'all':!![]}];}return db[_0xd67f('0x27')][_0xd67f('0x3f')](_0x15c338);})[_0xd67f('0x20')](function(_0x52b75d){_0x3b9af7[_0xd67f('0x40')]=_0x52b75d;return _0x3b9af7;})[_0xd67f('0x20')](respondWithFilteredResult(_0x1ce9f2,_0x15c338))['catch'](handleError(_0x1ce9f2,null));};exports['show']=function(_0x124689,_0x183888){var _0x4db422={'raw':![],'where':{'id':_0x124689['params']['id']}},_0x388632={};_0x388632[_0xd67f('0x2c')]=_['keys'](db[_0xd67f('0x27')][_0xd67f('0x28')]);_0x388632[_0xd67f('0x2d')]=_[_0xd67f('0x2e')](_0x124689[_0xd67f('0x2d')]);_0x388632['filters']=_[_0xd67f('0x41')](_0x388632[_0xd67f('0x2c')],_0x388632[_0xd67f('0x2d')]);_0x4db422['attributes']=_[_0xd67f('0x41')](_0x388632[_0xd67f('0x2c')],qs[_0xd67f('0x31')](_0x124689['query'][_0xd67f('0x31')]));_0x4db422[_0xd67f('0x30')]=_0x4db422['attributes']['length']?_0x4db422[_0xd67f('0x30')]:_0x388632[_0xd67f('0x2c')];if(_0x124689[_0xd67f('0x2d')][_0xd67f('0x3d')]){_0x4db422['include']=[{'all':!![]}];}_0x4db422=_['merge']({},_0x4db422,_0x124689[_0xd67f('0x3c')]);return db[_0xd67f('0x27')]['find'](_0x4db422)[_0xd67f('0x20')](handleEntityNotFound(_0x183888,null))[_0xd67f('0x20')](respondWithResult(_0x183888,null))[_0xd67f('0x42')](handleError(_0x183888,null));};exports[_0xd67f('0x43')]=function(_0x468065,_0x132bb0){return db[_0xd67f('0x27')]['create'](_0x468065[_0xd67f('0x44')],{})['then'](respondWithResult(_0x132bb0,0xc9))[_0xd67f('0x42')](handleError(_0x132bb0,null));};exports[_0xd67f('0x1f')]=function(_0x50b59e,_0x39abff){if(_0x50b59e['body']['id']){delete _0x50b59e[_0xd67f('0x44')]['id'];}return db[_0xd67f('0x27')]['find']({'where':{'id':_0x50b59e[_0xd67f('0x45')]['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x39abff,null))['then'](saveUpdates(_0x50b59e[_0xd67f('0x44')],null))['then'](respondWithResult(_0x39abff,null))[_0xd67f('0x42')](handleError(_0x39abff,null));};exports['destroy']=function(_0x4de7aa,_0x306ac4){return db['Automation']['find']({'where':{'id':_0x4de7aa[_0xd67f('0x45')]['id']}})['then'](handleEntityNotFound(_0x306ac4,null))[_0xd67f('0x20')](removeEntity(_0x306ac4,null))[_0xd67f('0x42')](handleError(_0x306ac4,null));};exports[_0xd67f('0x46')]=function(_0x58679c,_0xef7479,_0x15535f){return db[_0xd67f('0x47')][_0xd67f('0x48')]({'where':{'id':_0x58679c['params']['id']}})['then'](handleEntityNotFound(_0xef7479,null))[_0xd67f('0x20')](function(_0x2927bc){if(_0x2927bc){return _0x2927bc['addConditions'](_0x58679c[_0xd67f('0x44')][_0xd67f('0x49')],_[_0xd67f('0x4a')](_0x58679c[_0xd67f('0x44')],['ids','id'])||{});}})[_0xd67f('0x20')](respondWithResult(_0xef7479,null))['catch'](handleError(_0xef7479,null));};exports['getConditions']=function(_0x6f1b63,_0x202ea0,_0xd36305){var _0x4a6569={};var _0x360d7d={};var _0x4b2cc2;var _0xf657dc;return db[_0xd67f('0x27')]['findOne']({'where':{'id':_0x6f1b63['params']['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x202ea0,null))['then'](function(_0x1422e8){if(_0x1422e8){_0x4b2cc2=_0x1422e8;_0x360d7d['model']=_[_0xd67f('0x2e')](db[_0xd67f('0x47')]['rawAttributes']);_0x360d7d[_0xd67f('0x2d')]=_[_0xd67f('0x2e')](_0x6f1b63['query']);_0x360d7d['filters']=_[_0xd67f('0x41')](_0x360d7d[_0xd67f('0x2c')],_0x360d7d[_0xd67f('0x2d')]);_0x4a6569['attributes']=_[_0xd67f('0x41')](_0x360d7d['model'],qs[_0xd67f('0x31')](_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x31')]));_0x4a6569['attributes']=_0x4a6569['attributes']['length']?_0x4a6569[_0xd67f('0x30')]:_0x360d7d['model'];_0x4a6569[_0xd67f('0x35')]=qs['sort'](_0x6f1b63['query']['sort']);_0x4a6569[_0xd67f('0x39')]=qs[_0xd67f('0x2f')](_[_0xd67f('0x37')](_0x6f1b63['query'],_0x360d7d['filters']));if(_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x38')]){_0x4a6569[_0xd67f('0x39')]=_[_0xd67f('0x3a')](_0x4a6569[_0xd67f('0x39')],{'$or':_['map'](_0x4a6569['attributes'],function(_0x5d61b3){var _0x25ed71={};_0x25ed71[_0x5d61b3]={'$like':'%'+_0x6f1b63[_0xd67f('0x2d')]['filter']+'%'};return _0x25ed71;})});}_0x4a6569=_[_0xd67f('0x3a')]({},_0x4a6569,_0x6f1b63['options']);return _0x4b2cc2[_0xd67f('0x4b')](_0x4a6569);}})[_0xd67f('0x20')](function(_0x2f8977){if(_0x2f8977){_0xf657dc=_0x2f8977[_0xd67f('0x32')];if(!_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x33')](_0xd67f('0x34'))){_0x4a6569[_0xd67f('0x1b')]=qs[_0xd67f('0x1b')](_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x1b')]);_0x4a6569[_0xd67f('0x19')]=qs[_0xd67f('0x19')](_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x19')]);}return _0x4b2cc2[_0xd67f('0x4b')](_0x4a6569);}})[_0xd67f('0x20')](function(_0x397703){if(_0x397703){return _0x397703?{'count':_0xf657dc,'rows':_0x397703}:null;}})[_0xd67f('0x20')](respondWithResult(_0x202ea0,null))[_0xd67f('0x42')](handleError(_0x202ea0,null));};exports['addActions']=function(_0x4efa29,_0x527026,_0x40c7ea){return db['Action']['find']({'where':{'id':_0x4efa29[_0xd67f('0x45')]['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x527026,null))[_0xd67f('0x20')](function(_0x260108){if(_0x260108){return _0x260108[_0xd67f('0x4c')](_0x4efa29[_0xd67f('0x44')]['ids'],_['omit'](_0x4efa29[_0xd67f('0x44')],['ids','id'])||{});}})[_0xd67f('0x20')](respondWithResult(_0x527026,null))[_0xd67f('0x42')](handleError(_0x527026,null));};exports['getActions']=function(_0x54f798,_0x16653f,_0x31c582){var _0x1a17fe={};var _0xbf3df4={};var _0x5a06fa;var _0x457cb8;return db[_0xd67f('0x27')][_0xd67f('0x4d')]({'where':{'id':_0x54f798[_0xd67f('0x45')]['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x16653f,null))[_0xd67f('0x20')](function(_0x4dce4c){if(_0x4dce4c){_0x5a06fa=_0x4dce4c;_0xbf3df4[_0xd67f('0x2c')]=_[_0xd67f('0x2e')](db[_0xd67f('0x4e')][_0xd67f('0x28')]);_0xbf3df4[_0xd67f('0x2d')]=_['keys'](_0x54f798[_0xd67f('0x2d')]);_0xbf3df4[_0xd67f('0x2f')]=_[_0xd67f('0x41')](_0xbf3df4[_0xd67f('0x2c')],_0xbf3df4[_0xd67f('0x2d')]);_0x1a17fe[_0xd67f('0x30')]=_['intersection'](_0xbf3df4[_0xd67f('0x2c')],qs[_0xd67f('0x31')](_0x54f798[_0xd67f('0x2d')][_0xd67f('0x31')]));_0x1a17fe[_0xd67f('0x30')]=_0x1a17fe[_0xd67f('0x30')][_0xd67f('0x32')]?_0x1a17fe[_0xd67f('0x30')]:_0xbf3df4[_0xd67f('0x2c')];_0x1a17fe['order']=qs[_0xd67f('0x36')](_0x54f798[_0xd67f('0x2d')][_0xd67f('0x36')]);_0x1a17fe[_0xd67f('0x39')]=qs[_0xd67f('0x2f')](_['pick'](_0x54f798['query'],_0xbf3df4[_0xd67f('0x2f')]));if(_0x54f798['query'][_0xd67f('0x38')]){_0x1a17fe[_0xd67f('0x39')]=_[_0xd67f('0x3a')](_0x1a17fe[_0xd67f('0x39')],{'$or':_['map'](_0x1a17fe[_0xd67f('0x30')],function(_0x663a2f){var _0x4ebe3b={};_0x4ebe3b[_0x663a2f]={'$like':'%'+_0x54f798[_0xd67f('0x2d')][_0xd67f('0x38')]+'%'};return _0x4ebe3b;})});}_0x1a17fe=_[_0xd67f('0x3a')]({},_0x1a17fe,_0x54f798[_0xd67f('0x3c')]);return _0x5a06fa[_0xd67f('0x4f')](_0x1a17fe);}})[_0xd67f('0x20')](function(_0x3f0e20){if(_0x3f0e20){_0x457cb8=_0x3f0e20['length'];if(!_0x54f798['query'][_0xd67f('0x33')](_0xd67f('0x34'))){_0x1a17fe[_0xd67f('0x1b')]=qs[_0xd67f('0x1b')](_0x54f798['query']['limit']);_0x1a17fe[_0xd67f('0x19')]=qs['offset'](_0x54f798[_0xd67f('0x2d')]['offset']);}return _0x5a06fa['getActions'](_0x1a17fe);}})[_0xd67f('0x20')](function(_0x17b0dc){if(_0x17b0dc){return _0x17b0dc?{'count':_0x457cb8,'rows':_0x17b0dc}:null;}})[_0xd67f('0x20')](respondWithResult(_0x16653f,null))[_0xd67f('0x42')](handleError(_0x16653f,null));}; \ No newline at end of file +var _0x94b0=['stack','send','index','map','Automation','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','order','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','error'];(function(_0x652f90,_0x2e50f8){var _0x19ac45=function(_0x2955b4){while(--_0x2955b4){_0x652f90['push'](_0x652f90['shift']());}};_0x19ac45(++_0x2e50f8);}(_0x94b0,0x1cd));var _0x094b=function(_0x193524,_0x148f15){_0x193524=_0x193524-0x0;var _0x2a17b5=_0x94b0[_0x193524];return _0x2a17b5;};'use strict';var emlformat=require(_0x094b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x094b('0x1'));var jsonpatch=require(_0x094b('0x2'));var rp=require('request-promise');var moment=require(_0x094b('0x3'));var BPromise=require(_0x094b('0x4'));var Mustache=require(_0x094b('0x5'));var util=require('util');var path=require(_0x094b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x094b('0x7'));var fs=require('fs');var fs_extra=require(_0x094b('0x8'));var _=require('lodash');var squel=require(_0x094b('0x9'));var crypto=require(_0x094b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x094b('0xb'));var toCsv=require(_0x094b('0xc'));var querystring=require(_0x094b('0xd'));var Papa=require(_0x094b('0xe'));var Redis=require('ioredis');var authService=require(_0x094b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x094b('0x10'));var logger=require(_0x094b('0x11'))(_0x094b('0x12'));var utils=require(_0x094b('0x13'));var config=require(_0x094b('0x14'));var licenseUtil=require(_0x094b('0x15'));var db=require(_0x094b('0x16'))['db'];function respondWithStatusCode(_0x700071,_0x27d118){_0x27d118=_0x27d118||0xcc;return function(_0x3bc72b){if(_0x3bc72b){return _0x700071[_0x094b('0x17')](_0x27d118);}return _0x700071[_0x094b('0x18')](_0x27d118)[_0x094b('0x19')]();};}function respondWithResult(_0x2940a8,_0x122568){_0x122568=_0x122568||0xc8;return function(_0x56c15e){if(_0x56c15e){return _0x2940a8[_0x094b('0x18')](_0x122568)[_0x094b('0x1a')](_0x56c15e);}};}function respondWithFilteredResult(_0x26ac62,_0x468918){return function(_0x4f763b){if(_0x4f763b){var _0x2c0e8b=typeof _0x468918[_0x094b('0x1b')]==='undefined'&&typeof _0x468918['limit']===_0x094b('0x1c');var _0x28c932=_0x4f763b[_0x094b('0x1d')];var _0xff3283=_0x2c0e8b?0x0:_0x468918[_0x094b('0x1b')];var _0x4e30b8=_0x2c0e8b?_0x4f763b['count']:_0x468918[_0x094b('0x1b')]+_0x468918[_0x094b('0x1e')];var _0x680db9;if(_0x4e30b8>=_0x28c932){_0x4e30b8=_0x28c932;_0x680db9=0xc8;}else{_0x680db9=0xce;}_0x26ac62[_0x094b('0x18')](_0x680db9);return _0x26ac62['set']('Content-Range',_0xff3283+'-'+_0x4e30b8+'/'+_0x28c932)[_0x094b('0x1a')](_0x4f763b);}return null;};}function patchUpdates(_0x50c737){return function(_0x3dab23){try{jsonpatch['apply'](_0x3dab23,_0x50c737,!![]);}catch(_0x4edb4a){return BPromise[_0x094b('0x1f')](_0x4edb4a);}return _0x3dab23[_0x094b('0x20')]();};}function saveUpdates(_0x36405a,_0x57dfb8){return function(_0x39285d){if(_0x39285d){return _0x39285d[_0x094b('0x21')](_0x36405a)[_0x094b('0x22')](function(_0x333657){return _0x333657;});}return null;};}function removeEntity(_0xf46ac0,_0x105dec){return function(_0x52b18c){if(_0x52b18c){return _0x52b18c[_0x094b('0x23')]()[_0x094b('0x22')](function(){_0xf46ac0[_0x094b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xce585d,_0xac4ff5){return function(_0x3fe943){if(!_0x3fe943){_0xce585d['sendStatus'](0x194);}return _0x3fe943;};}function handleError(_0x42b956,_0x347324){_0x347324=_0x347324||0x1f4;return function(_0xa02bf8){logger[_0x094b('0x24')](_0xa02bf8[_0x094b('0x25')]);if(_0xa02bf8['name']){delete _0xa02bf8['name'];}_0x42b956['status'](_0x347324)[_0x094b('0x26')](_0xa02bf8);};}exports[_0x094b('0x27')]=function(_0x2a667a,_0x1ffb03){var _0x1e5ebe={},_0x2aa6f8={},_0x5b7667={'count':0x0,'rows':[]};var _0x351900=_[_0x094b('0x28')](db[_0x094b('0x29')][_0x094b('0x2a')],function(_0x487094){return{'name':_0x487094[_0x094b('0x2b')],'type':_0x487094[_0x094b('0x2c')][_0x094b('0x2d')]};});_0x2aa6f8[_0x094b('0x2e')]=_[_0x094b('0x28')](_0x351900,_0x094b('0x2f'));_0x2aa6f8[_0x094b('0x30')]=_[_0x094b('0x31')](_0x2a667a[_0x094b('0x30')]);_0x2aa6f8['filters']=_[_0x094b('0x32')](_0x2aa6f8[_0x094b('0x2e')],_0x2aa6f8[_0x094b('0x30')]);_0x1e5ebe[_0x094b('0x33')]=_['intersection'](_0x2aa6f8[_0x094b('0x2e')],qs[_0x094b('0x34')](_0x2a667a[_0x094b('0x30')]['fields']));_0x1e5ebe[_0x094b('0x33')]=_0x1e5ebe[_0x094b('0x33')]['length']?_0x1e5ebe['attributes']:_0x2aa6f8[_0x094b('0x2e')];if(!_0x2a667a['query'][_0x094b('0x35')](_0x094b('0x36'))){_0x1e5ebe[_0x094b('0x1e')]=qs['limit'](_0x2a667a[_0x094b('0x30')][_0x094b('0x1e')]);_0x1e5ebe[_0x094b('0x1b')]=qs[_0x094b('0x1b')](_0x2a667a[_0x094b('0x30')]['offset']);}_0x1e5ebe['order']=qs['sort'](_0x2a667a[_0x094b('0x30')][_0x094b('0x37')]);_0x1e5ebe[_0x094b('0x38')]=qs[_0x094b('0x39')](_[_0x094b('0x3a')](_0x2a667a[_0x094b('0x30')],_0x2aa6f8[_0x094b('0x39')]),_0x351900);if(_0x2a667a['query'][_0x094b('0x3b')]){_0x1e5ebe[_0x094b('0x38')]=_[_0x094b('0x3c')](_0x1e5ebe['where'],{'$or':_['map'](_0x351900,function(_0x22914c){if(_0x22914c[_0x094b('0x2c')]!==_0x094b('0x3d')){var _0x3e94f2={};_0x3e94f2[_0x22914c['name']]={'$like':'%'+_0x2a667a[_0x094b('0x30')][_0x094b('0x3b')]+'%'};return _0x3e94f2;}})});}_0x1e5ebe=_['merge']({},_0x1e5ebe,_0x2a667a[_0x094b('0x3e')]);var _0x22a4cb={'where':_0x1e5ebe[_0x094b('0x38')]};return db[_0x094b('0x29')][_0x094b('0x1d')](_0x22a4cb)[_0x094b('0x22')](function(_0x25a9e0){_0x5b7667['count']=_0x25a9e0;if(_0x2a667a[_0x094b('0x30')][_0x094b('0x3f')]){_0x1e5ebe['include']=[{'all':!![]}];}return db['Automation'][_0x094b('0x40')](_0x1e5ebe);})['then'](function(_0x5413a1){_0x5b7667['rows']=_0x5413a1;return _0x5b7667;})[_0x094b('0x22')](respondWithFilteredResult(_0x1ffb03,_0x1e5ebe))[_0x094b('0x41')](handleError(_0x1ffb03,null));};exports[_0x094b('0x42')]=function(_0x4c1533,_0x23f1fe){var _0x1e3d02={'raw':![],'where':{'id':_0x4c1533[_0x094b('0x43')]['id']}},_0x4ad4dd={};_0x4ad4dd[_0x094b('0x2e')]=_['keys'](db[_0x094b('0x29')][_0x094b('0x2a')]);_0x4ad4dd['query']=_[_0x094b('0x31')](_0x4c1533['query']);_0x4ad4dd[_0x094b('0x39')]=_[_0x094b('0x32')](_0x4ad4dd['model'],_0x4ad4dd[_0x094b('0x30')]);_0x1e3d02['attributes']=_[_0x094b('0x32')](_0x4ad4dd[_0x094b('0x2e')],qs[_0x094b('0x34')](_0x4c1533['query']['fields']));_0x1e3d02[_0x094b('0x33')]=_0x1e3d02[_0x094b('0x33')][_0x094b('0x44')]?_0x1e3d02[_0x094b('0x33')]:_0x4ad4dd[_0x094b('0x2e')];if(_0x4c1533[_0x094b('0x30')][_0x094b('0x3f')]){_0x1e3d02[_0x094b('0x45')]=[{'all':!![]}];}_0x1e3d02=_[_0x094b('0x3c')]({},_0x1e3d02,_0x4c1533[_0x094b('0x3e')]);return db['Automation'][_0x094b('0x46')](_0x1e3d02)[_0x094b('0x22')](handleEntityNotFound(_0x23f1fe,null))[_0x094b('0x22')](respondWithResult(_0x23f1fe,null))[_0x094b('0x41')](handleError(_0x23f1fe,null));};exports[_0x094b('0x47')]=function(_0x233a8f,_0x46f210){return db[_0x094b('0x29')]['create'](_0x233a8f[_0x094b('0x48')],{})[_0x094b('0x22')](respondWithResult(_0x46f210,0xc9))[_0x094b('0x41')](handleError(_0x46f210,null));};exports[_0x094b('0x21')]=function(_0x47cd2f,_0x1c565e){if(_0x47cd2f[_0x094b('0x48')]['id']){delete _0x47cd2f['body']['id'];}return db['Automation']['find']({'where':{'id':_0x47cd2f[_0x094b('0x43')]['id']}})[_0x094b('0x22')](handleEntityNotFound(_0x1c565e,null))[_0x094b('0x22')](saveUpdates(_0x47cd2f[_0x094b('0x48')],null))[_0x094b('0x22')](respondWithResult(_0x1c565e,null))[_0x094b('0x41')](handleError(_0x1c565e,null));};exports[_0x094b('0x23')]=function(_0x1d4d1a,_0x4e79f2){return db['Automation'][_0x094b('0x46')]({'where':{'id':_0x1d4d1a[_0x094b('0x43')]['id']}})[_0x094b('0x22')](handleEntityNotFound(_0x4e79f2,null))['then'](removeEntity(_0x4e79f2,null))[_0x094b('0x41')](handleError(_0x4e79f2,null));};exports[_0x094b('0x49')]=function(_0x5d059b,_0x29adb6,_0xb4c50e){return db[_0x094b('0x4a')][_0x094b('0x46')]({'where':{'id':_0x5d059b[_0x094b('0x43')]['id']}})['then'](handleEntityNotFound(_0x29adb6,null))[_0x094b('0x22')](function(_0x4ff949){if(_0x4ff949){return _0x4ff949[_0x094b('0x49')](_0x5d059b[_0x094b('0x48')][_0x094b('0x4b')],_[_0x094b('0x4c')](_0x5d059b['body'],[_0x094b('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x29adb6,null))['catch'](handleError(_0x29adb6,null));};exports[_0x094b('0x4d')]=function(_0x3eddc7,_0x65c846,_0x4d27d0){var _0x4d5195={};var _0x3cedc7={};var _0x3f1668;var _0x366b3e;return db[_0x094b('0x29')][_0x094b('0x4e')]({'where':{'id':_0x3eddc7['params']['id']}})[_0x094b('0x22')](handleEntityNotFound(_0x65c846,null))['then'](function(_0x4e7a9b){if(_0x4e7a9b){_0x3f1668=_0x4e7a9b;_0x3cedc7[_0x094b('0x2e')]=_[_0x094b('0x31')](db['Condition']['rawAttributes']);_0x3cedc7[_0x094b('0x30')]=_[_0x094b('0x31')](_0x3eddc7[_0x094b('0x30')]);_0x3cedc7[_0x094b('0x39')]=_[_0x094b('0x32')](_0x3cedc7[_0x094b('0x2e')],_0x3cedc7[_0x094b('0x30')]);_0x4d5195[_0x094b('0x33')]=_[_0x094b('0x32')](_0x3cedc7[_0x094b('0x2e')],qs[_0x094b('0x34')](_0x3eddc7[_0x094b('0x30')][_0x094b('0x34')]));_0x4d5195[_0x094b('0x33')]=_0x4d5195[_0x094b('0x33')][_0x094b('0x44')]?_0x4d5195[_0x094b('0x33')]:_0x3cedc7[_0x094b('0x2e')];_0x4d5195[_0x094b('0x4f')]=qs[_0x094b('0x37')](_0x3eddc7[_0x094b('0x30')][_0x094b('0x37')]);_0x4d5195[_0x094b('0x38')]=qs[_0x094b('0x39')](_['pick'](_0x3eddc7[_0x094b('0x30')],_0x3cedc7[_0x094b('0x39')]));if(_0x3eddc7[_0x094b('0x30')][_0x094b('0x3b')]){_0x4d5195['where']=_['merge'](_0x4d5195[_0x094b('0x38')],{'$or':_[_0x094b('0x28')](_0x4d5195[_0x094b('0x33')],function(_0x3fe2c7){var _0x341b4d={};_0x341b4d[_0x3fe2c7]={'$like':'%'+_0x3eddc7[_0x094b('0x30')][_0x094b('0x3b')]+'%'};return _0x341b4d;})});}_0x4d5195=_[_0x094b('0x3c')]({},_0x4d5195,_0x3eddc7['options']);return _0x3f1668[_0x094b('0x4d')](_0x4d5195);}})[_0x094b('0x22')](function(_0x5297ce){if(_0x5297ce){_0x366b3e=_0x5297ce[_0x094b('0x44')];if(!_0x3eddc7[_0x094b('0x30')][_0x094b('0x35')](_0x094b('0x36'))){_0x4d5195[_0x094b('0x1e')]=qs[_0x094b('0x1e')](_0x3eddc7[_0x094b('0x30')][_0x094b('0x1e')]);_0x4d5195[_0x094b('0x1b')]=qs[_0x094b('0x1b')](_0x3eddc7['query'][_0x094b('0x1b')]);}return _0x3f1668['getConditions'](_0x4d5195);}})[_0x094b('0x22')](function(_0x1abac5){if(_0x1abac5){return _0x1abac5?{'count':_0x366b3e,'rows':_0x1abac5}:null;}})[_0x094b('0x22')](respondWithResult(_0x65c846,null))[_0x094b('0x41')](handleError(_0x65c846,null));};exports[_0x094b('0x50')]=function(_0x17212a,_0xca8a12,_0x2c4219){return db[_0x094b('0x51')][_0x094b('0x46')]({'where':{'id':_0x17212a['params']['id']}})[_0x094b('0x22')](handleEntityNotFound(_0xca8a12,null))[_0x094b('0x22')](function(_0x5da8fc){if(_0x5da8fc){return _0x5da8fc[_0x094b('0x50')](_0x17212a[_0x094b('0x48')][_0x094b('0x4b')],_[_0x094b('0x4c')](_0x17212a[_0x094b('0x48')],[_0x094b('0x4b'),'id'])||{});}})[_0x094b('0x22')](respondWithResult(_0xca8a12,null))[_0x094b('0x41')](handleError(_0xca8a12,null));};exports[_0x094b('0x52')]=function(_0x4cd2a0,_0x526a4a,_0x37febc){var _0x23c6e2={};var _0xfd126={};var _0x2a08f9;var _0x2332a1;return db[_0x094b('0x29')][_0x094b('0x4e')]({'where':{'id':_0x4cd2a0['params']['id']}})[_0x094b('0x22')](handleEntityNotFound(_0x526a4a,null))['then'](function(_0x3dea24){if(_0x3dea24){_0x2a08f9=_0x3dea24;_0xfd126[_0x094b('0x2e')]=_[_0x094b('0x31')](db[_0x094b('0x51')]['rawAttributes']);_0xfd126[_0x094b('0x30')]=_['keys'](_0x4cd2a0[_0x094b('0x30')]);_0xfd126[_0x094b('0x39')]=_[_0x094b('0x32')](_0xfd126[_0x094b('0x2e')],_0xfd126['query']);_0x23c6e2[_0x094b('0x33')]=_[_0x094b('0x32')](_0xfd126['model'],qs[_0x094b('0x34')](_0x4cd2a0[_0x094b('0x30')][_0x094b('0x34')]));_0x23c6e2[_0x094b('0x33')]=_0x23c6e2[_0x094b('0x33')][_0x094b('0x44')]?_0x23c6e2[_0x094b('0x33')]:_0xfd126['model'];_0x23c6e2[_0x094b('0x4f')]=qs[_0x094b('0x37')](_0x4cd2a0[_0x094b('0x30')][_0x094b('0x37')]);_0x23c6e2[_0x094b('0x38')]=qs['filters'](_['pick'](_0x4cd2a0[_0x094b('0x30')],_0xfd126[_0x094b('0x39')]));if(_0x4cd2a0[_0x094b('0x30')][_0x094b('0x3b')]){_0x23c6e2[_0x094b('0x38')]=_[_0x094b('0x3c')](_0x23c6e2[_0x094b('0x38')],{'$or':_['map'](_0x23c6e2[_0x094b('0x33')],function(_0x4af147){var _0x28f83f={};_0x28f83f[_0x4af147]={'$like':'%'+_0x4cd2a0[_0x094b('0x30')][_0x094b('0x3b')]+'%'};return _0x28f83f;})});}_0x23c6e2=_[_0x094b('0x3c')]({},_0x23c6e2,_0x4cd2a0[_0x094b('0x3e')]);return _0x2a08f9[_0x094b('0x52')](_0x23c6e2);}})[_0x094b('0x22')](function(_0x740d5){if(_0x740d5){_0x2332a1=_0x740d5['length'];if(!_0x4cd2a0['query'][_0x094b('0x35')](_0x094b('0x36'))){_0x23c6e2['limit']=qs[_0x094b('0x1e')](_0x4cd2a0[_0x094b('0x30')]['limit']);_0x23c6e2['offset']=qs[_0x094b('0x1b')](_0x4cd2a0[_0x094b('0x30')]['offset']);}return _0x2a08f9[_0x094b('0x52')](_0x23c6e2);}})['then'](function(_0x2b6e0b){if(_0x2b6e0b){return _0x2b6e0b?{'count':_0x2332a1,'rows':_0x2b6e0b}:null;}})[_0x094b('0x22')](respondWithResult(_0x526a4a,null))['catch'](handleError(_0x526a4a,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 40129c9..1772586 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 _0x4af5=['request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x174d74,_0x410a71){var _0x480e6c=function(_0x32398e){while(--_0x32398e){_0x174d74['push'](_0x174d74['shift']());}};_0x480e6c(++_0x410a71);}(_0x4af5,0x13c));var _0x54af=function(_0x3206e2,_0x3e0c6b){_0x3206e2=_0x3206e2-0x0;var _0x4b7512=_0x4af5[_0x3206e2];return _0x4b7512;};'use strict';var _=require(_0x54af('0x0'));var util=require(_0x54af('0x1'));var logger=require(_0x54af('0x2'))(_0x54af('0x3'));var moment=require(_0x54af('0x4'));var BPromise=require(_0x54af('0x5'));var rp=require(_0x54af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54af('0x7'));var config=require(_0x54af('0x8'));var attributes=require(_0x54af('0x9'));module[_0x54af('0xa')]=function(_0x5421ab,_0x6d8c1a){return _0x5421ab[_0x54af('0xb')](_0x54af('0xc'),attributes,{'tableName':_0x54af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00fd=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x00fd,0x1b7));var _0xd00f=function(_0x26e012,_0x53f7a7){_0x26e012=_0x26e012-0x0;var _0x12d18a=_0x00fd[_0x26e012];return _0x12d18a;};'use strict';var _=require(_0xd00f('0x0'));var util=require(_0xd00f('0x1'));var logger=require(_0xd00f('0x2'))(_0xd00f('0x3'));var moment=require('moment');var BPromise=require(_0xd00f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd00f('0x5'));var config=require(_0xd00f('0x6'));var attributes=require(_0xd00f('0x7'));module[_0xd00f('0x8')]=function(_0x59e5de,_0x16e7f6){return _0x59e5de[_0xd00f('0x9')](_0xd00f('0xa'),attributes,{'tableName':'tools_automations','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 adfab2d..5649a39 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 _0x1122=['Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3a956d,_0x5dd981){var _0x19d08f=function(_0x5298d0){while(--_0x5298d0){_0x3a956d['push'](_0x3a956d['shift']());}};_0x19d08f(++_0x5dd981);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2112('0x0'));var util=require('util');var moment=require(_0x2112('0x1'));var BPromise=require(_0x2112('0x2'));var rs=require(_0x2112('0x3'));var fs=require('fs');var Redis=require(_0x2112('0x4'));var db=require(_0x2112('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2112('0x6'));var config=require('../../config/environment');var jayson=require(_0x2112('0x7'));var client=jayson[_0x2112('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcca285,_0x2ad731,_0x3f0a81){return new BPromise(function(_0x272bdb,_0x4190c7){return client[_0x2112('0x9')](_0xcca285,_0x3f0a81)[_0x2112('0xa')](function(_0x2f7142){logger[_0x2112('0xb')]('Automation,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));logger[_0x2112('0xd')](_0x2112('0xe'),_0x2ad731,_0x2112('0xc'),JSON['stringify'](_0x2f7142));if(_0x2f7142[_0x2112('0xf')]){if(_0x2f7142[_0x2112('0xf')][_0x2112('0x10')]===0x1f4){logger[_0x2112('0xf')](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')][_0x2112('0x12')]);return _0x4190c7(_0x2f7142['error'][_0x2112('0x12')]);}logger['error'](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')]['message']);return _0x272bdb(_0x2f7142[_0x2112('0xf')]['message']);}else{logger[_0x2112('0xb')]('Automation,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));_0x272bdb(_0x2f7142[_0x2112('0x13')]['message']);}})[_0x2112('0x14')](function(_0x4db5c3){logger[_0x2112('0xf')]('Automation,\x20%s,\x20%s',_0x2ad731,_0x4db5c3);_0x4190c7(_0x4db5c3);});});} \ No newline at end of file +var _0x236c=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2672a7,_0x4a3bbe){var _0x5dd35a=function(_0xce6837){while(--_0xce6837){_0x2672a7['push'](_0x2672a7['shift']());}};_0x5dd35a(++_0x4a3bbe);}(_0x236c,0x155));var _0xc236=function(_0x198ca6,_0x5347ba){_0x198ca6=_0x198ca6-0x0;var _0x24a9d9=_0x236c[_0x198ca6];return _0x24a9d9;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5abd65,_0xd612c6,_0x4d349b){return new BPromise(function(_0x51a13b,_0x5bc6a2){return client['request'](_0x5abd65,_0x4d349b)[_0xc236('0xc')](function(_0x4b8dc6){logger[_0xc236('0xd')](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));logger[_0xc236('0x10')](_0xc236('0x11'),_0xd612c6,'request\x20sent',JSON[_0xc236('0x12')](_0x4b8dc6));if(_0x4b8dc6[_0xc236('0x13')]){if(_0x4b8dc6['error'][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('Automation,\x20%s,\x20%s',_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x5bc6a2(_0x4b8dc6['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0xe'),_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x51a13b(_0x4b8dc6[_0xc236('0x13')]['message']);}else{logger['info'](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));_0x51a13b(_0x4b8dc6[_0xc236('0x16')][_0xc236('0x15')]);}})[_0xc236('0x17')](function(_0x5ac3ed){logger['error']('Automation,\x20%s,\x20%s',_0xd612c6,_0x5ac3ed);_0x5bc6a2(_0x5ac3ed);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0009538..1c60911 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 _0x3297=['isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x5f12b1,_0x3b19f3){var _0x15573a=function(_0x5efc76){while(--_0x5efc76){_0x5f12b1['push'](_0x5f12b1['shift']());}};_0x15573a(++_0x3b19f3);}(_0x3297,0x19f));var _0x7329=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3297[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var path=require(_0x7329('0x2'));var timeout=require('connect-timeout');var express=require(_0x7329('0x3'));var router=express[_0x7329('0x4')]();var fs_extra=require(_0x7329('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7329('0x6'));var config=require(_0x7329('0x7'));var controller=require(_0x7329('0x8'));router[_0x7329('0x9')]('/',auth[_0x7329('0xa')](),controller[_0x7329('0xb')]);router[_0x7329('0x9')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0xd')]);router[_0x7329('0x9')](_0x7329('0xe'),auth['isAuthenticated'](),controller[_0x7329('0xf')]);router['get'](_0x7329('0x10'),auth['isAuthenticated'](),controller['getActions']);router[_0x7329('0x11')]('/',auth['isAuthenticated'](),controller[_0x7329('0x12')]);router[_0x7329('0x11')](_0x7329('0xe'),auth[_0x7329('0xa')](),controller[_0x7329('0x13')]);router[_0x7329('0x11')]('/:id/actions',auth[_0x7329('0xa')](),controller[_0x7329('0x14')]);router[_0x7329('0x15')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0x16')]);router[_0x7329('0x17')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0x18')]);module['exports']=router; \ No newline at end of file +var _0xf3cd=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getConditions','getActions','post','create','/:id/conditions','/:id/actions','addActions','update','destroy'];(function(_0xbbcb36,_0x586383){var _0x4278ff=function(_0x35c9da){while(--_0x35c9da){_0xbbcb36['push'](_0xbbcb36['shift']());}};_0x4278ff(++_0x586383);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0xf3cd[_0x599c94];return _0x34e215;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf3c('0x6'));var interaction=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var controller=require('./automation.controller');router[_0xdf3c('0x9')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xb')]);router[_0xdf3c('0x9')](_0xdf3c('0xc'),auth[_0xdf3c('0xa')](),controller['show']);router[_0xdf3c('0x9')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x9')]('/:id/actions',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xe')]);router[_0xdf3c('0xf')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x10')]);router[_0xdf3c('0xf')](_0xdf3c('0x11'),auth[_0xdf3c('0xa')](),controller['addConditions']);router[_0xdf3c('0xf')](_0xdf3c('0x12'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x13')]);router['put'](_0xdf3c('0xc'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x14')]);router['delete'](_0xdf3c('0xc'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x15')]);module[_0xdf3c('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 2efc049..a46e12f 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 _0xdc6b=['sequelize','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x232f9c,_0x3ae9df){var _0x24bb71=function(_0x4fb958){while(--_0x4fb958){_0x232f9c['push'](_0x232f9c['shift']());}};_0x24bb71(++_0x3ae9df);}(_0xdc6b,0xde));var _0xbdc6=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0xdc6b[_0x1305e3];return _0x1068e9;};'use strict';var Sequelize=require(_0xbdc6('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdc6('0x1')],'unique':_0xbdc6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xbdc6('0x3')),'allowNull':![],'defaultValue':_0xbdc6('0x3')},'description':{'type':Sequelize[_0xbdc6('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbdc6('0x4')},'limitCalls':{'type':Sequelize[_0xbdc6('0x5')](0x4)[_0xbdc6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbdc6('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbdc6('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbdc6('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbdc6('0xe')},'dialTimezone':{'type':Sequelize[_0xbdc6('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbdc6('0x1')],'defaultValue':_0xbdc6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xbdc6('0x10')]('always','never',_0xbdc6('0x11')),'defaultValue':_0xbdc6('0x12')},'dialAMDActive':{'type':Sequelize[_0xbdc6('0x13')],'defaultValue':0x0,'comment':_0xbdc6('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xbdc6('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbdc6('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xbdc6('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbdc6('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbdc6('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbdc6('0x5')](0x9)[_0xbdc6('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbdc6('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbdc6('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbdc6('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbdc6('0x5')](0x9)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbdc6('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbdc6('0x5')](0x9)[_0xbdc6('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbdc6('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xbdc6('0x1b'),_0xbdc6('0x1c')),'defaultValue':_0xbdc6('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbdc6('0x1d')},'dialCutDigit':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbdc6('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x142a=['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','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2aa67f,_0x4bd664){var _0xe64288=function(_0x12d0d7){while(--_0x12d0d7){_0x2aa67f['push'](_0x2aa67f['shift']());}};_0xe64288(++_0x4bd664);}(_0x142a,0x18b));var _0xa142=function(_0x252578,_0x5c80c2){_0x252578=_0x252578-0x0;var _0x85eeab=_0x142a[_0x252578];return _0x85eeab;};'use strict';var Sequelize=require(_0xa142('0x0'));module[_0xa142('0x1')]={'name':{'type':Sequelize[_0xa142('0x2')],'unique':_0xa142('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa142('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xa142('0x5')},'description':{'type':Sequelize[_0xa142('0x2')]},'active':{'type':Sequelize[_0xa142('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xa142('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa142('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xa142('0x7')](0x3)[_0xa142('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa142('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa142('0x7')](0x3)[_0xa142('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa142('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa142('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa142('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa142('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa142('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa142('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa142('0x7')](0x5)[_0xa142('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa142('0x7')](0x3)[_0xa142('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa142('0xf')},'dialTimezone':{'type':Sequelize[_0xa142('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa142('0x2')],'defaultValue':_0xa142('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xa142('0x4')](_0xa142('0x11'),_0xa142('0x12'),_0xa142('0x13')),'defaultValue':_0xa142('0x11')},'dialAMDActive':{'type':Sequelize[_0xa142('0x6')],'defaultValue':0x0,'comment':_0xa142('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa142('0x7')](0x9)[_0xa142('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa142('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xa142('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa142('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa142('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa142('0x7')](0x9)[_0xa142('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xa142('0x7')](0x9)[_0xa142('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa142('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa142('0x7')](0x9)[_0xa142('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa142('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa142('0x7')](0x9)[_0xa142('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa142('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa142('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa142('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa142('0x7')](0x9)[_0xa142('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa142('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa142('0x4')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xa142('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa142('0x7')](0x3)[_0xa142('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa142('0x7')](0x3)[_0xa142('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa142('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa142('0x7')](0x3)[_0xa142('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa142('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa142('0x7')](0x5)[_0xa142('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa142('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xa142('0x7')](0x3)[_0xa142('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa142('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa142('0x7')](0x5)[_0xa142('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa142('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa142('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa142('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa142('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 9dd1e35..8654cf6 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 _0x9be7=['CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','fromQuery','scheduledAt','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','into','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','find','create','catch','params','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','phone','ContactId','select','field','NOW()','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x37468e,_0x14c7a4){var _0x203d9f=function(_0x4b6741){while(--_0x4b6741){_0x37468e['push'](_0x37468e['shift']());}};_0x203d9f(++_0x14c7a4);}(_0x9be7,0x9b));var _0x79be=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x9be7[_0x2d126e];return _0xcb04d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79be('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x79be('0x1'));var BPromise=require(_0x79be('0x2'));var Mustache=require(_0x79be('0x3'));var util=require('util');var path=require(_0x79be('0x4'));var sox=require(_0x79be('0x5'));var csv=require(_0x79be('0x6'));var ejs=require(_0x79be('0x7'));var fs=require('fs');var fs_extra=require(_0x79be('0x8'));var _=require('lodash');var squel=require(_0x79be('0x9'));var crypto=require('crypto');var jsforce=require(_0x79be('0xa'));var deskjs=require(_0x79be('0xb'));var toCsv=require(_0x79be('0x6'));var querystring=require(_0x79be('0xc'));var Papa=require(_0x79be('0xd'));var Redis=require(_0x79be('0xe'));var authService=require(_0x79be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x79be('0x10'));var hardwareService=require(_0x79be('0x11'));var logger=require(_0x79be('0x12'))(_0x79be('0x13'));var utils=require(_0x79be('0x14'));var config=require(_0x79be('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x79be('0x16'))['db'];function respondWithStatusCode(_0x35478d,_0x470e7d){_0x470e7d=_0x470e7d||0xcc;return function(_0x3305d4){if(_0x3305d4){return _0x35478d['sendStatus'](_0x470e7d);}return _0x35478d[_0x79be('0x17')](_0x470e7d)[_0x79be('0x18')]();};}function respondWithResult(_0x23c5d2,_0x509649){_0x509649=_0x509649||0xc8;return function(_0x42dc46){if(_0x42dc46){return _0x23c5d2[_0x79be('0x17')](_0x509649)[_0x79be('0x19')](_0x42dc46);}};}function respondWithFilteredResult(_0x4e66c1,_0x74539f){return function(_0x20f402){if(_0x20f402){var _0x1228f6=typeof _0x74539f[_0x79be('0x1a')]==='undefined'&&typeof _0x74539f['limit']===_0x79be('0x1b');var _0x57a5e5=_0x20f402['count'];var _0x2f6ffb=_0x1228f6?0x0:_0x74539f['offset'];var _0x2e3c17=_0x1228f6?_0x20f402[_0x79be('0x1c')]:_0x74539f[_0x79be('0x1a')]+_0x74539f[_0x79be('0x1d')];var _0x9db36d;if(_0x2e3c17>=_0x57a5e5){_0x2e3c17=_0x57a5e5;_0x9db36d=0xc8;}else{_0x9db36d=0xce;}_0x4e66c1[_0x79be('0x17')](_0x9db36d);return _0x4e66c1[_0x79be('0x1e')](_0x79be('0x1f'),_0x2f6ffb+'-'+_0x2e3c17+'/'+_0x57a5e5)[_0x79be('0x19')](_0x20f402);}return null;};}function patchUpdates(_0x13b785){return function(_0x527b45){try{jsonpatch['apply'](_0x527b45,_0x13b785,!![]);}catch(_0x535743){return BPromise[_0x79be('0x20')](_0x535743);}return _0x527b45[_0x79be('0x21')]();};}function saveUpdates(_0x11a6ca,_0x1c6c8f){return function(_0x10964f){if(_0x10964f){return _0x10964f[_0x79be('0x22')](_0x11a6ca)[_0x79be('0x23')](function(_0xb70405){return _0xb70405;});}return null;};}function removeEntity(_0x211a46,_0x22304a){return function(_0x16d810){if(_0x16d810){return _0x16d810[_0x79be('0x24')]()['then'](function(){var _0x3af6d7=_0x16d810[_0x79be('0x25')]({'plain':!![]});var _0x232414=_0x79be('0x26');return db[_0x79be('0x27')][_0x79be('0x24')]({'where':{'type':_0x232414,'resourceId':_0x3af6d7['id']}})[_0x79be('0x23')](function(){return _0x16d810;});})[_0x79be('0x23')](function(){_0x211a46['status'](0xcc)[_0x79be('0x18')]();});}};}function handleEntityNotFound(_0x5d8164,_0x47665e){return function(_0x2e4278){if(!_0x2e4278){_0x5d8164['sendStatus'](0x194);}return _0x2e4278;};}function handleError(_0x3e0f39,_0x75738d){_0x75738d=_0x75738d||0x1f4;return function(_0x36e417){logger[_0x79be('0x28')](_0x36e417[_0x79be('0x29')]);if(_0x36e417[_0x79be('0x2a')]){delete _0x36e417[_0x79be('0x2a')];}_0x3e0f39[_0x79be('0x17')](_0x75738d)[_0x79be('0x2b')](_0x36e417);};}exports[_0x79be('0x2c')]=function(_0x3d822a,_0x2ad264){var _0x125d28={},_0x1b19c7={},_0xce795b={'count':0x0,'rows':[]};var _0x51132a=_[_0x79be('0x2d')](db[_0x79be('0x2e')][_0x79be('0x2f')],function(_0x1525ad){return{'name':_0x1525ad['fieldName'],'type':_0x1525ad[_0x79be('0x30')][_0x79be('0x31')]};});_0x1b19c7['model']=_[_0x79be('0x2d')](_0x51132a,_0x79be('0x2a'));_0x1b19c7[_0x79be('0x32')]=_[_0x79be('0x33')](_0x3d822a[_0x79be('0x32')]);_0x1b19c7[_0x79be('0x34')]=_['intersection'](_0x1b19c7[_0x79be('0x35')],_0x1b19c7['query']);_0x125d28['attributes']=_[_0x79be('0x36')](_0x1b19c7[_0x79be('0x35')],qs[_0x79be('0x37')](_0x3d822a[_0x79be('0x32')]['fields']));_0x125d28[_0x79be('0x38')]=_0x125d28['attributes'][_0x79be('0x39')]?_0x125d28[_0x79be('0x38')]:_0x1b19c7['model'];if(!_0x3d822a[_0x79be('0x32')]['hasOwnProperty'](_0x79be('0x3a'))){_0x125d28['limit']=qs[_0x79be('0x1d')](_0x3d822a[_0x79be('0x32')]['limit']);_0x125d28[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x3d822a[_0x79be('0x32')][_0x79be('0x1a')]);}_0x125d28[_0x79be('0x3b')]=qs[_0x79be('0x3c')](_0x3d822a[_0x79be('0x32')][_0x79be('0x3c')]);_0x125d28[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x3d822a[_0x79be('0x32')],_0x1b19c7[_0x79be('0x34')]),_0x51132a);if(_0x3d822a[_0x79be('0x32')][_0x79be('0x3f')]){_0x125d28['where']=_['merge'](_0x125d28['where'],{'$or':_[_0x79be('0x2d')](_0x51132a,function(_0x179a77){if(_0x179a77[_0x79be('0x30')]!=='VIRTUAL'){var _0x1ad8f4={};_0x1ad8f4[_0x179a77[_0x79be('0x2a')]]={'$like':'%'+_0x3d822a[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x1ad8f4;}})});}_0x125d28=_[_0x79be('0x40')]({},_0x125d28,_0x3d822a[_0x79be('0x41')]);var _0x1bb3d1={'where':_0x125d28[_0x79be('0x3d')]};return db[_0x79be('0x2e')]['count'](_0x1bb3d1)[_0x79be('0x23')](function(_0x43af36){_0xce795b[_0x79be('0x1c')]=_0x43af36;if(_0x3d822a[_0x79be('0x32')][_0x79be('0x42')]){_0x125d28[_0x79be('0x43')]=[{'all':!![]}];}return db[_0x79be('0x2e')][_0x79be('0x44')](_0x125d28);})[_0x79be('0x23')](function(_0x5a0d74){_0xce795b['rows']=_0x5a0d74;return _0xce795b;})[_0x79be('0x23')](respondWithFilteredResult(_0x2ad264,_0x125d28))['catch'](handleError(_0x2ad264,null));};exports[_0x79be('0x45')]=function(_0x55b3bd,_0x3bb84a){var _0x3796d4={'raw':![],'where':{'id':_0x55b3bd['params']['id']}},_0x34da6c={};_0x34da6c['model']=_[_0x79be('0x33')](db['Campaign'][_0x79be('0x2f')]);_0x34da6c[_0x79be('0x32')]=_[_0x79be('0x33')](_0x55b3bd[_0x79be('0x32')]);_0x34da6c[_0x79be('0x34')]=_['intersection'](_0x34da6c[_0x79be('0x35')],_0x34da6c[_0x79be('0x32')]);_0x3796d4[_0x79be('0x38')]=_['intersection'](_0x34da6c[_0x79be('0x35')],qs['fields'](_0x55b3bd[_0x79be('0x32')][_0x79be('0x37')]));_0x3796d4[_0x79be('0x38')]=_0x3796d4[_0x79be('0x38')][_0x79be('0x39')]?_0x3796d4['attributes']:_0x34da6c[_0x79be('0x35')];if(_0x55b3bd['query'][_0x79be('0x42')]){_0x3796d4[_0x79be('0x43')]=[{'all':!![]}];}_0x3796d4=_[_0x79be('0x40')]({},_0x3796d4,_0x55b3bd[_0x79be('0x41')]);return db[_0x79be('0x2e')][_0x79be('0x46')](_0x3796d4)[_0x79be('0x23')](handleEntityNotFound(_0x3bb84a,null))['then'](respondWithResult(_0x3bb84a,null))['catch'](handleError(_0x3bb84a,null));};exports[_0x79be('0x47')]=function(_0x14fc50,_0x15d4b1){return db[_0x79be('0x2e')][_0x79be('0x47')](_0x14fc50['body'],{})['then'](function(_0x506258){var _0x561f6b=_0x14fc50['user']['get']({'plain':!![]});if(!_0x561f6b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x561f6b['role']==='user'){var _0x344832=_0x506258[_0x79be('0x25')]({'plain':!![]});var _0x7c4e76=_0x79be('0x26');return db['UserProfileSection'][_0x79be('0x46')]({'where':{'name':_0x7c4e76,'userProfileId':_0x561f6b['userProfileId']},'raw':!![]})['then'](function(_0xfc284a){if(_0xfc284a&&_0xfc284a['autoAssociation']===0x0){return db[_0x79be('0x27')][_0x79be('0x47')]({'name':_0x344832[_0x79be('0x2a')],'resourceId':_0x344832['id'],'type':_0xfc284a['name'],'sectionId':_0xfc284a['id']},{})[_0x79be('0x23')](function(){return _0x506258;});}else{return _0x506258;}})[_0x79be('0x48')](function(_0x1214cb){logger[_0x79be('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1214cb);throw _0x1214cb;});}return _0x506258;})['then'](respondWithResult(_0x15d4b1,0xc9))['catch'](handleError(_0x15d4b1,null));};exports['clone']=function(_0x28b9b6,_0x5cb7ae){var _0x1ff2cd={'where':{'id':_0x28b9b6[_0x79be('0x49')]['id']}},_0x2956a1={};_0x2956a1['model']=_[_0x79be('0x33')](db[_0x79be('0x2e')][_0x79be('0x2f')]);_0x1ff2cd['attributes']=_[_0x79be('0x36')](_0x2956a1[_0x79be('0x35')],qs[_0x79be('0x37')](_0x28b9b6[_0x79be('0x32')]['fields']));_0x1ff2cd[_0x79be('0x38')]=_0x1ff2cd[_0x79be('0x38')]['length']?_0x1ff2cd[_0x79be('0x38')]:_0x2956a1[_0x79be('0x35')];if(_0x28b9b6['query'][_0x79be('0x42')]){_0x1ff2cd[_0x79be('0x43')]=[{'all':!![]}];}_0x1ff2cd=_['merge']({},_0x1ff2cd,_0x28b9b6[_0x79be('0x41')]);return db[_0x79be('0x2e')][_0x79be('0x46')](_0x1ff2cd)[_0x79be('0x23')](handleEntityNotFound(_0x5cb7ae,null))[_0x79be('0x23')](function(_0x2272d8){if(_0x2272d8){var _0x20a26f=_0x2272d8[_0x79be('0x25')]({'plain':!![]});_0x20a26f=qs[_0x79be('0x4a')](_0x20a26f,['id','createdAt',_0x79be('0x4b')]);_0x28b9b6[_0x79be('0x4c')]=_[_0x79be('0x4a')](_0x28b9b6[_0x79be('0x4c')],['id',_0x79be('0x4d'),_0x79be('0x4b')]);return db[_0x79be('0x2e')][_0x79be('0x47')](_[_0x79be('0x40')](_0x20a26f,_0x28b9b6[_0x79be('0x4c')]),{'include':_0x28b9b6[_0x79be('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x79be('0x23')](function(_0x1abb75){var _0x393642=_0x28b9b6[_0x79be('0x4e')][_0x79be('0x25')]({'plain':!![]});if(!_0x393642)throw new Error(_0x79be('0x4f'));if(_0x393642[_0x79be('0x50')]===_0x79be('0x4e')){var _0x39152b=_0x1abb75['get']({'plain':!![]});var _0xeb2957='IvrCampaigns';return db[_0x79be('0x51')]['find']({'where':{'name':_0xeb2957,'userProfileId':_0x393642['userProfileId']},'raw':!![]})[_0x79be('0x23')](function(_0x41abc7){if(_0x41abc7&&_0x41abc7[_0x79be('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x39152b['name'],'resourceId':_0x39152b['id'],'type':_0x41abc7[_0x79be('0x2a')],'sectionId':_0x41abc7['id']},{})[_0x79be('0x23')](function(){return _0x1abb75;});}else{return _0x1abb75;}})[_0x79be('0x48')](function(_0x4858ac){logger[_0x79be('0x28')](_0x79be('0x53'),_0x4858ac);throw _0x4858ac;});}return _0x1abb75;});}})[_0x79be('0x23')](respondWithResult(_0x5cb7ae,0xc9))[_0x79be('0x48')](handleError(_0x5cb7ae,null));};exports['update']=function(_0x29f8a9,_0x45c91a){if(_0x29f8a9[_0x79be('0x4c')]['id']){delete _0x29f8a9[_0x79be('0x4c')]['id'];}return db[_0x79be('0x2e')][_0x79be('0x46')]({'where':{'id':_0x29f8a9['params']['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x45c91a,null))['then'](saveUpdates(_0x29f8a9['body'],null))['then'](respondWithResult(_0x45c91a,null))['catch'](handleError(_0x45c91a,null));};exports[_0x79be('0x24')]=function(_0x551ef5,_0xb08686){return db['Campaign']['find']({'where':{'id':_0x551ef5[_0x79be('0x49')]['id']}})['then'](handleEntityNotFound(_0xb08686,null))['then'](removeEntity(_0xb08686,null))[_0x79be('0x48')](handleError(_0xb08686,null));};exports[_0x79be('0x54')]=function(_0x11e443,_0x263e1f,_0x211201){var _0x3e1b3a={'raw':!![],'where':{}};var _0x549bde={};var _0x5a59bf={'count':0x0,'rows':[]};return db['Campaign'][_0x79be('0x55')]({'where':{'id':_0x11e443[_0x79be('0x49')]['id']}})['then'](handleEntityNotFound(_0x263e1f,null))['then'](function(_0x1ab263){if(_0x1ab263){_0x549bde[_0x79be('0x35')]=_['keys'](db[_0x79be('0x56')][_0x79be('0x2f')]);_0x549bde[_0x79be('0x32')]=_[_0x79be('0x33')](_0x11e443[_0x79be('0x32')]);_0x549bde['filters']=_[_0x79be('0x36')](_0x549bde[_0x79be('0x35')],_0x549bde[_0x79be('0x32')]);_0x3e1b3a['attributes']=_[_0x79be('0x36')](_0x549bde[_0x79be('0x35')],qs[_0x79be('0x37')](_0x11e443[_0x79be('0x32')][_0x79be('0x37')]));_0x3e1b3a[_0x79be('0x38')]=_0x3e1b3a[_0x79be('0x38')]['length']?_0x3e1b3a['attributes']:_0x549bde[_0x79be('0x35')];if(!_0x11e443['query'][_0x79be('0x57')](_0x79be('0x3a'))){_0x3e1b3a[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x11e443['query']['limit']);_0x3e1b3a[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x11e443[_0x79be('0x32')][_0x79be('0x1a')]);}_0x3e1b3a['order']=qs['sort'](_0x11e443[_0x79be('0x32')]['sort']);_0x3e1b3a[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x11e443[_0x79be('0x32')],_0x549bde['filters']));_0x3e1b3a[_0x79be('0x3d')][_0x79be('0x58')]=_0x1ab263['id'];if(_0x11e443[_0x79be('0x32')][_0x79be('0x3f')]){_0x3e1b3a[_0x79be('0x3d')]=_['merge'](_0x3e1b3a[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x3e1b3a[_0x79be('0x38')],function(_0x5906dd){var _0x1984b5={};_0x1984b5[_0x5906dd]={'$like':'%'+_0x11e443[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x1984b5;})});}_0x3e1b3a=_['merge']({},_0x3e1b3a,_0x11e443['options']);return db[_0x79be('0x56')][_0x79be('0x1c')]({'where':_0x3e1b3a[_0x79be('0x3d')]})[_0x79be('0x23')](function(_0x3907ff){_0x5a59bf[_0x79be('0x1c')]=_0x3907ff;if(_0x11e443[_0x79be('0x32')]['includeAll']){_0x3e1b3a[_0x79be('0x43')]=[{'all':!![]}];}return db[_0x79be('0x56')][_0x79be('0x44')](_0x3e1b3a);})[_0x79be('0x23')](function(_0x29f9ea){_0x5a59bf[_0x79be('0x59')]=_0x29f9ea;return _0x5a59bf;});}})['then'](respondWithFilteredResult(_0x263e1f,_0x3e1b3a))['catch'](handleError(_0x263e1f,null));};exports[_0x79be('0x5a')]=function(_0x38e271,_0x281ea1,_0x5bceaa){var _0x1e5706={'raw':!![],'where':{}};var _0x5c6b56={};var _0x1a5bf8={'count':0x0,'rows':[]};return db[_0x79be('0x2e')]['findOne']({'where':{'id':_0x38e271[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x281ea1,null))['then'](function(_0x3332cb){if(_0x3332cb){_0x5c6b56['model']=_[_0x79be('0x33')](db[_0x79be('0x5b')]['rawAttributes']);_0x5c6b56[_0x79be('0x32')]=_[_0x79be('0x33')](_0x38e271[_0x79be('0x32')]);_0x5c6b56[_0x79be('0x34')]=_[_0x79be('0x36')](_0x5c6b56[_0x79be('0x35')],_0x5c6b56['query']);_0x1e5706[_0x79be('0x38')]=_['intersection'](_0x5c6b56[_0x79be('0x35')],qs['fields'](_0x38e271[_0x79be('0x32')][_0x79be('0x37')]));_0x1e5706[_0x79be('0x38')]=_0x1e5706[_0x79be('0x38')]['length']?_0x1e5706[_0x79be('0x38')]:_0x5c6b56[_0x79be('0x35')];if(!_0x38e271['query']['hasOwnProperty'](_0x79be('0x3a'))){_0x1e5706[_0x79be('0x1d')]=qs['limit'](_0x38e271[_0x79be('0x32')]['limit']);_0x1e5706[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x38e271[_0x79be('0x32')][_0x79be('0x1a')]);}_0x1e5706['order']=qs[_0x79be('0x3c')](_0x38e271['query'][_0x79be('0x3c')]);_0x1e5706[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x38e271['query'],_0x5c6b56[_0x79be('0x34')]));_0x1e5706[_0x79be('0x3d')][_0x79be('0x58')]=_0x3332cb['id'];if(_0x38e271[_0x79be('0x32')]['filter']){_0x1e5706[_0x79be('0x3d')]=_[_0x79be('0x40')](_0x1e5706[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x1e5706[_0x79be('0x38')],function(_0x48037c){var _0x55364f={};_0x55364f[_0x48037c]={'$like':'%'+_0x38e271[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x55364f;})});}_0x1e5706=_[_0x79be('0x40')]({},_0x1e5706,_0x38e271[_0x79be('0x41')]);return db[_0x79be('0x5b')][_0x79be('0x1c')]({'where':_0x1e5706[_0x79be('0x3d')]})[_0x79be('0x23')](function(_0x2925c9){_0x1a5bf8[_0x79be('0x1c')]=_0x2925c9;if(_0x38e271['query'][_0x79be('0x42')]){_0x1e5706[_0x79be('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x79be('0x44')](_0x1e5706);})['then'](function(_0xc783f4){_0x1a5bf8[_0x79be('0x59')]=_0xc783f4;return _0x1a5bf8;});}})[_0x79be('0x23')](respondWithFilteredResult(_0x281ea1,_0x1e5706))[_0x79be('0x48')](handleError(_0x281ea1,null));};exports['getHopperFinals']=function(_0x4e6e55,_0x8fa945,_0x2acc9c){var _0x9edee6={'raw':!![],'where':{}};var _0x56a2d8={};var _0x3eb555={'count':0x0,'rows':[]};return db[_0x79be('0x2e')][_0x79be('0x55')]({'where':{'id':_0x4e6e55[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x8fa945,null))[_0x79be('0x23')](function(_0x28917d){if(_0x28917d){_0x56a2d8['model']=_[_0x79be('0x33')](db[_0x79be('0x5c')][_0x79be('0x2f')]);_0x56a2d8[_0x79be('0x32')]=_['keys'](_0x4e6e55[_0x79be('0x32')]);_0x56a2d8['filters']=_[_0x79be('0x36')](_0x56a2d8[_0x79be('0x35')],_0x56a2d8[_0x79be('0x32')]);_0x9edee6[_0x79be('0x38')]=_[_0x79be('0x36')](_0x56a2d8[_0x79be('0x35')],qs[_0x79be('0x37')](_0x4e6e55[_0x79be('0x32')]['fields']));_0x9edee6[_0x79be('0x38')]=_0x9edee6[_0x79be('0x38')][_0x79be('0x39')]?_0x9edee6[_0x79be('0x38')]:_0x56a2d8['model'];if(!_0x4e6e55['query'][_0x79be('0x57')](_0x79be('0x3a'))){_0x9edee6[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x4e6e55[_0x79be('0x32')][_0x79be('0x1d')]);_0x9edee6[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x4e6e55[_0x79be('0x32')][_0x79be('0x1a')]);}_0x9edee6['order']=qs[_0x79be('0x3c')](_0x4e6e55[_0x79be('0x32')][_0x79be('0x3c')]);_0x9edee6[_0x79be('0x3d')]=qs['filters'](_[_0x79be('0x3e')](_0x4e6e55[_0x79be('0x32')],_0x56a2d8['filters']));_0x9edee6[_0x79be('0x3d')]['CampaignId']=_0x28917d['id'];if(_0x4e6e55['query'][_0x79be('0x3f')]){_0x9edee6['where']=_[_0x79be('0x40')](_0x9edee6[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x9edee6['attributes'],function(_0x257f49){var _0x20da74={};_0x20da74[_0x257f49]={'$like':'%'+_0x4e6e55[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x20da74;})});}_0x9edee6=_[_0x79be('0x40')]({},_0x9edee6,_0x4e6e55[_0x79be('0x41')]);return db[_0x79be('0x5c')][_0x79be('0x1c')]({'where':_0x9edee6['where']})[_0x79be('0x23')](function(_0x2db78c){_0x3eb555['count']=_0x2db78c;if(_0x4e6e55[_0x79be('0x32')][_0x79be('0x42')]){_0x9edee6[_0x79be('0x43')]=[{'all':!![]}];}return db[_0x79be('0x5c')][_0x79be('0x44')](_0x9edee6);})[_0x79be('0x23')](function(_0x4956e1){_0x3eb555[_0x79be('0x59')]=_0x4956e1;return _0x3eb555;});}})['then'](respondWithFilteredResult(_0x8fa945,_0x9edee6))[_0x79be('0x48')](handleError(_0x8fa945,null));};exports[_0x79be('0x5d')]=function(_0x3923d8,_0x53bba2,_0x2de9c1){var _0xf72a6d={'raw':!![],'where':{}};var _0xb10d9c={};var _0xcc4b7c={'count':0x0,'rows':[]};return db[_0x79be('0x2e')][_0x79be('0x55')]({'where':{'id':_0x3923d8[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x53bba2,null))[_0x79be('0x23')](function(_0x50f47e){if(_0x50f47e){_0xb10d9c[_0x79be('0x35')]=_[_0x79be('0x33')](db[_0x79be('0x5e')][_0x79be('0x2f')]);_0xb10d9c['query']=_['keys'](_0x3923d8['query']);_0xb10d9c[_0x79be('0x34')]=_[_0x79be('0x36')](_0xb10d9c[_0x79be('0x35')],_0xb10d9c['query']);_0xf72a6d[_0x79be('0x38')]=_['intersection'](_0xb10d9c['model'],qs[_0x79be('0x37')](_0x3923d8[_0x79be('0x32')][_0x79be('0x37')]));_0xf72a6d[_0x79be('0x38')]=_0xf72a6d[_0x79be('0x38')][_0x79be('0x39')]?_0xf72a6d[_0x79be('0x38')]:_0xb10d9c['model'];if(!_0x3923d8[_0x79be('0x32')][_0x79be('0x57')](_0x79be('0x3a'))){_0xf72a6d[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x3923d8[_0x79be('0x32')][_0x79be('0x1d')]);_0xf72a6d[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x3923d8[_0x79be('0x32')][_0x79be('0x1a')]);}_0xf72a6d['order']=qs[_0x79be('0x3c')](_0x3923d8['query'][_0x79be('0x3c')]);_0xf72a6d['where']=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x3923d8[_0x79be('0x32')],_0xb10d9c[_0x79be('0x34')]));_0xf72a6d[_0x79be('0x3d')][_0x79be('0x58')]=_0x50f47e['id'];if(_0x3923d8[_0x79be('0x32')]['filter']){_0xf72a6d['where']=_[_0x79be('0x40')](_0xf72a6d[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0xf72a6d[_0x79be('0x38')],function(_0x3cca93){var _0x429de4={};_0x429de4[_0x3cca93]={'$like':'%'+_0x3923d8['query'][_0x79be('0x3f')]+'%'};return _0x429de4;})});}_0xf72a6d=_['merge']({},_0xf72a6d,_0x3923d8[_0x79be('0x41')]);return db[_0x79be('0x5e')][_0x79be('0x1c')]({'where':_0xf72a6d[_0x79be('0x3d')]})['then'](function(_0xda0823){_0xcc4b7c['count']=_0xda0823;if(_0x3923d8[_0x79be('0x32')][_0x79be('0x42')]){_0xf72a6d['include']=[{'all':!![]}];}return db[_0x79be('0x5e')][_0x79be('0x44')](_0xf72a6d);})['then'](function(_0x379be2){_0xcc4b7c[_0x79be('0x59')]=_0x379be2;return _0xcc4b7c;});}})[_0x79be('0x23')](respondWithFilteredResult(_0x53bba2,_0xf72a6d))['catch'](handleError(_0x53bba2,null));};exports[_0x79be('0x5f')]=function(_0x2ea3e3,_0x3ddd99,_0x499842){var _0x558b46={};var _0x28fc51={};var _0x2b8422;var _0x2796bd;return db[_0x79be('0x2e')]['findOne']({'where':{'id':_0x2ea3e3[_0x79be('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ddd99,null))[_0x79be('0x23')](function(_0x396b7c){if(_0x396b7c){_0x2b8422=_0x396b7c;_0x28fc51['model']=_[_0x79be('0x33')](db['CmList'][_0x79be('0x2f')]);_0x28fc51[_0x79be('0x32')]=_[_0x79be('0x33')](_0x2ea3e3[_0x79be('0x32')]);_0x28fc51[_0x79be('0x34')]=_[_0x79be('0x36')](_0x28fc51['model'],_0x28fc51[_0x79be('0x32')]);_0x558b46[_0x79be('0x38')]=_['intersection'](_0x28fc51[_0x79be('0x35')],qs[_0x79be('0x37')](_0x2ea3e3['query'][_0x79be('0x37')]));_0x558b46[_0x79be('0x38')]=_0x558b46[_0x79be('0x38')][_0x79be('0x39')]?_0x558b46[_0x79be('0x38')]:_0x28fc51[_0x79be('0x35')];_0x558b46[_0x79be('0x3b')]=qs[_0x79be('0x3c')](_0x2ea3e3['query'][_0x79be('0x3c')]);_0x558b46[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x2ea3e3['query'],_0x28fc51['filters']));if(_0x2ea3e3[_0x79be('0x32')][_0x79be('0x3f')]){_0x558b46['where']=_[_0x79be('0x40')](_0x558b46[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x558b46[_0x79be('0x38')],function(_0x296def){var _0x24e220={};_0x24e220[_0x296def]={'$like':'%'+_0x2ea3e3[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x24e220;})});}_0x558b46=_['merge']({},_0x558b46,_0x2ea3e3[_0x79be('0x41')]);return _0x2b8422[_0x79be('0x5f')](_0x558b46);}})[_0x79be('0x23')](function(_0x3e648c){if(_0x3e648c){_0x2796bd=_0x3e648c['length'];if(!_0x2ea3e3[_0x79be('0x32')]['hasOwnProperty'](_0x79be('0x3a'))){_0x558b46[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x2ea3e3['query']['limit']);_0x558b46[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x2ea3e3[_0x79be('0x32')][_0x79be('0x1a')]);}return _0x2b8422[_0x79be('0x5f')](_0x558b46);}})[_0x79be('0x23')](function(_0x278dd0){if(_0x278dd0){return _0x278dd0?{'count':_0x2796bd,'rows':_0x278dd0}:null;}})[_0x79be('0x23')](respondWithResult(_0x3ddd99,null))[_0x79be('0x48')](handleError(_0x3ddd99,null));};exports[_0x79be('0x60')]=function(_0x1a8057,_0x462d7f,_0x54b309){var _0x5054b7,_0x3ae531;return db['Campaign'][_0x79be('0x46')]({'where':{'id':_0x1a8057['params']['id']}})['then'](handleEntityNotFound(_0x462d7f,null))[_0x79be('0x23')](function(_0xe5482c){if(_0xe5482c){_0x3ae531=_0xe5482c;return _0xe5482c[_0x79be('0x60')](_0x1a8057['body'][_0x79be('0x61')],_['omit'](_0x1a8057[_0x79be('0x4c')],['ids','id'])||{});}return null;})[_0x79be('0x62')](function(_0x4a75ca){var _0x15133d;_0x5054b7=_0x4a75ca||[];var _0x444eb7=[];if(_0x4a75ca){for(var _0x30d6ff=0x0;_0x30d6ff<_0x4a75ca['length'];_0x30d6ff+=0x1){var _0x25236c=_0x4a75ca[_0x30d6ff][_0x79be('0x25')]({'plain':!![]});_0x3ae531[_0x79be('0x63')]=_0x1a8057[_0x79be('0x4c')][_0x79be('0x63')]?_0x1a8057[_0x79be('0x4c')][_0x79be('0x63')]:_0x3ae531['dialCheckDuplicateType'];switch(_0x3ae531['dialCheckDuplicateType']){case'always':_0x15133d=squel[_0x79be('0x64')]()['into']('cm_hopper')['fromQuery']([_0x79be('0x65'),'scheduledAt',_0x79be('0x66'),'ListId',_0x79be('0x58'),'createdAt',_0x79be('0x4b')],squel[_0x79be('0x67')]()[_0x79be('0x68')](_0x79be('0x65'),_0x79be('0x65'))[_0x79be('0x68')](_0x79be('0x69'),'scheduledAt')['field']('id',_0x79be('0x66'))[_0x79be('0x68')](_0x25236c['CmListId'][_0x79be('0x6a')](),_0x79be('0x6b'))[_0x79be('0x68')](_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')](),_0x79be('0x58'))[_0x79be('0x68')]('NOW()',_0x79be('0x4d'))[_0x79be('0x68')](_0x79be('0x69'),'updatedAt')[_0x79be('0x6c')](_0x79be('0x6d'))[_0x79be('0x3d')](_0x79be('0x6e'))['where']('ListId\x20=\x20?',_0x25236c[_0x79be('0x6f')]['toString']())['where'](_0x79be('0x70'))[_0x79be('0x3d')](_0x79be('0x71'),squel[_0x79be('0x67')]()[_0x79be('0x68')](_0x79be('0x72'))[_0x79be('0x6c')](_0x79be('0x73'))[_0x79be('0x3d')](_0x79be('0x74'),_0x1a8057['params']['id'][_0x79be('0x6a')]()))[_0x79be('0x3d')](_0x79be('0x71'),squel['select']()[_0x79be('0x68')]('COALESCE(phone,\x27\x27)')[_0x79be('0x6c')](_0x79be('0x75'))[_0x79be('0x3d')](_0x79be('0x74'),_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')]())))[_0x79be('0x6a')]();break;case _0x79be('0x76'):_0x15133d=squel[_0x79be('0x64')]()['into'](_0x79be('0x75'))[_0x79be('0x77')](['phone','scheduledAt',_0x79be('0x66'),'ListId','CampaignId','createdAt',_0x79be('0x4b')],squel[_0x79be('0x67')]()[_0x79be('0x68')]('phone',_0x79be('0x65'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x78'))['field']('id',_0x79be('0x66'))[_0x79be('0x68')](_0x25236c[_0x79be('0x6f')][_0x79be('0x6a')](),_0x79be('0x6b'))['field'](_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')](),'CampaignId')[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4d'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4b'))[_0x79be('0x6c')](_0x79be('0x6d'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x79be('0x79'),_0x25236c['CmListId'][_0x79be('0x6a')]())[_0x79be('0x3d')](_0x79be('0x70'))[_0x79be('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x79be('0x67')]()[_0x79be('0x68')](_0x79be('0x7a'))[_0x79be('0x6c')](_0x79be('0x75'))[_0x79be('0x3d')](_0x79be('0x74'),_0x1a8057['params']['id']['toString']())))[_0x79be('0x6a')]();break;default:_0x15133d=squel['insert']()[_0x79be('0x7b')]('cm_hopper')[_0x79be('0x77')](['phone','scheduledAt',_0x79be('0x66'),_0x79be('0x6b'),'CampaignId',_0x79be('0x4d'),_0x79be('0x4b')],squel[_0x79be('0x67')]()[_0x79be('0x68')]('phone',_0x79be('0x65'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x78'))[_0x79be('0x68')]('id',_0x79be('0x66'))[_0x79be('0x68')](_0x25236c[_0x79be('0x6f')][_0x79be('0x6a')](),_0x79be('0x6b'))[_0x79be('0x68')](_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')](),_0x79be('0x58'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4d'))[_0x79be('0x68')](_0x79be('0x69'),'updatedAt')['from'](_0x79be('0x6d'))[_0x79be('0x3d')](_0x79be('0x6e'))['where'](_0x79be('0x79'),_0x25236c[_0x79be('0x6f')][_0x79be('0x6a')]())['where'](_0x79be('0x70')))[_0x79be('0x6a')]();}_0x444eb7[_0x79be('0x7c')](db[_0x79be('0x7d')]['query'](_0x15133d));}return BPromise[_0x79be('0x7e')](_0x444eb7);}})[_0x79be('0x23')](function(){return _0x5054b7;})[_0x79be('0x23')](respondWithResult(_0x462d7f,null))[_0x79be('0x48')](handleError(_0x462d7f,null));};exports['removeLists']=function(_0x3b64d0,_0x3885a6,_0x40221c){return db['Campaign'][_0x79be('0x46')]({'where':{'id':_0x3b64d0['params']['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x3885a6,null))['then'](function(_0x2d0feb){if(_0x2d0feb){return _0x2d0feb[_0x79be('0x7f')](_0x3b64d0['query'][_0x79be('0x61')]);}})[_0x79be('0x23')](function(_0x533b88){if(_0x533b88){return db[_0x79be('0x56')][_0x79be('0x24')]({'where':{'ListId':_0x3b64d0[_0x79be('0x32')][_0x79be('0x61')],'CampaignId':_0x3b64d0[_0x79be('0x49')]['id']}})[_0x79be('0x23')](function(){return _0x533b88;});}})[_0x79be('0x23')](respondWithStatusCode(_0x3885a6,null))[_0x79be('0x48')](handleError(_0x3885a6,null));};exports[_0x79be('0x80')]=function(_0x46eb4e,_0x4d899f,_0x30c573){var _0x2a0c46={};var _0x62fca1={};var _0x272d73;var _0x1e7d95;return db[_0x79be('0x2e')][_0x79be('0x55')]({'where':{'id':_0x46eb4e[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x4d899f,null))[_0x79be('0x23')](function(_0x50fac9){if(_0x50fac9){_0x272d73=_0x50fac9;_0x62fca1[_0x79be('0x35')]=_['keys'](db[_0x79be('0x81')][_0x79be('0x2f')]);_0x62fca1['query']=_[_0x79be('0x33')](_0x46eb4e[_0x79be('0x32')]);_0x62fca1[_0x79be('0x34')]=_['intersection'](_0x62fca1['model'],_0x62fca1[_0x79be('0x32')]);_0x2a0c46['attributes']=_[_0x79be('0x36')](_0x62fca1['model'],qs[_0x79be('0x37')](_0x46eb4e[_0x79be('0x32')][_0x79be('0x37')]));_0x2a0c46[_0x79be('0x38')]=_0x2a0c46[_0x79be('0x38')][_0x79be('0x39')]?_0x2a0c46[_0x79be('0x38')]:_0x62fca1[_0x79be('0x35')];_0x2a0c46[_0x79be('0x3b')]=qs[_0x79be('0x3c')](_0x46eb4e['query'][_0x79be('0x3c')]);_0x2a0c46[_0x79be('0x3d')]=qs['filters'](_[_0x79be('0x3e')](_0x46eb4e[_0x79be('0x32')],_0x62fca1[_0x79be('0x34')]));if(_0x46eb4e[_0x79be('0x32')][_0x79be('0x3f')]){_0x2a0c46[_0x79be('0x3d')]=_[_0x79be('0x40')](_0x2a0c46[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x2a0c46['attributes'],function(_0x3f6cc7){var _0x1a6e88={};_0x1a6e88[_0x3f6cc7]={'$like':'%'+_0x46eb4e['query'][_0x79be('0x3f')]+'%'};return _0x1a6e88;})});}_0x2a0c46=_[_0x79be('0x40')]({},_0x2a0c46,_0x46eb4e[_0x79be('0x41')]);return _0x272d73[_0x79be('0x80')](_0x2a0c46);}})[_0x79be('0x23')](function(_0x27784a){if(_0x27784a){_0x1e7d95=_0x27784a[_0x79be('0x39')];if(!_0x46eb4e['query'][_0x79be('0x57')](_0x79be('0x3a'))){_0x2a0c46[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x46eb4e[_0x79be('0x32')]['limit']);_0x2a0c46[_0x79be('0x1a')]=qs['offset'](_0x46eb4e[_0x79be('0x32')][_0x79be('0x1a')]);}return _0x272d73['getBlackLists'](_0x2a0c46);}})[_0x79be('0x23')](function(_0x20dcf2){if(_0x20dcf2){return _0x20dcf2?{'count':_0x1e7d95,'rows':_0x20dcf2}:null;}})['then'](respondWithResult(_0x4d899f,null))[_0x79be('0x48')](handleError(_0x4d899f,null));};exports['addBlackLists']=function(_0x2e5bcd,_0x3bb17a,_0x237a66){var _0x5f481d,_0x53d0fc;return db[_0x79be('0x2e')][_0x79be('0x46')]({'where':{'id':_0x2e5bcd[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x3bb17a,null))[_0x79be('0x23')](function(_0x2f6054){if(_0x2f6054){_0x53d0fc=_0x2f6054;return _0x2f6054[_0x79be('0x82')](_0x2e5bcd[_0x79be('0x4c')][_0x79be('0x61')],_['omit'](_0x2e5bcd[_0x79be('0x4c')],[_0x79be('0x61'),'id'])||{});}return null;})[_0x79be('0x62')](function(_0x31895b){var _0x2f097a;_0x5f481d=_0x31895b||[];var _0x407859=[];if(_0x31895b){for(var _0x593906=0x0;_0x593906<_0x31895b['length'];_0x593906+=0x1){var _0xcf2085=_0x31895b[_0x593906]['get']({'plain':!![]});_0x2f097a=squel[_0x79be('0x64')]()[_0x79be('0x7b')](_0x79be('0x83'))[_0x79be('0x77')]([_0x79be('0x65'),_0x79be('0x66'),'ListId',_0x79be('0x58'),_0x79be('0x4d'),_0x79be('0x4b')],squel['select']()[_0x79be('0x68')](_0x79be('0x65'),_0x79be('0x65'))[_0x79be('0x68')]('id',_0x79be('0x66'))[_0x79be('0x68')](_0xcf2085[_0x79be('0x6f')][_0x79be('0x6a')](),_0x79be('0x6b'))[_0x79be('0x68')](_0x2e5bcd['params']['id'][_0x79be('0x6a')](),'CampaignId')[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4d'))[_0x79be('0x68')]('NOW()',_0x79be('0x4b'))[_0x79be('0x6c')](_0x79be('0x6d'))[_0x79be('0x3d')](_0x79be('0x6e'))['where'](_0x79be('0x79'),_0xcf2085[_0x79be('0x6f')][_0x79be('0x6a')]())[_0x79be('0x3d')](_0x79be('0x70')))[_0x79be('0x6a')]();_0x407859['push'](db[_0x79be('0x7d')][_0x79be('0x32')](_0x2f097a));}return BPromise[_0x79be('0x7e')](_0x407859);}})[_0x79be('0x23')](function(){return _0x5f481d;})[_0x79be('0x23')](respondWithResult(_0x3bb17a,null))['catch'](handleError(_0x3bb17a,null));};exports[_0x79be('0x84')]=function(_0x35ed56,_0x2d5520,_0x3c11b4){return db['Campaign']['find']({'where':{'id':_0x35ed56['params']['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x2d5520,null))[_0x79be('0x23')](function(_0x7d34db){if(_0x7d34db){return _0x7d34db[_0x79be('0x84')](_0x35ed56['query'][_0x79be('0x61')]);}})[_0x79be('0x23')](function(_0x4a4c96){if(_0x4a4c96){return db[_0x79be('0x5e')][_0x79be('0x24')]({'where':{'ListId':_0x35ed56['query'][_0x79be('0x61')],'CampaignId':_0x35ed56[_0x79be('0x49')]['id']}})[_0x79be('0x23')](function(){return _0x4a4c96;});}})[_0x79be('0x23')](respondWithStatusCode(_0x2d5520,null))[_0x79be('0x48')](handleError(_0x2d5520,null));}; \ No newline at end of file +var _0xbf59=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','getHoppers','findOne','pick','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','push','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x2f83a7,_0x34af53){var _0x2119ec=function(_0x5004ca){while(--_0x5004ca){_0x2f83a7['push'](_0x2f83a7['shift']());}};_0x2119ec(++_0x34af53);}(_0xbf59,0x195));var _0x9bf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf59[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9bf5('0x0'));var zipdir=require(_0x9bf5('0x1'));var jsonpatch=require(_0x9bf5('0x2'));var rp=require('request-promise');var moment=require(_0x9bf5('0x3'));var BPromise=require(_0x9bf5('0x4'));var Mustache=require(_0x9bf5('0x5'));var util=require(_0x9bf5('0x6'));var path=require(_0x9bf5('0x7'));var sox=require(_0x9bf5('0x8'));var csv=require(_0x9bf5('0x9'));var ejs=require(_0x9bf5('0xa'));var fs=require('fs');var fs_extra=require(_0x9bf5('0xb'));var _=require(_0x9bf5('0xc'));var squel=require(_0x9bf5('0xd'));var crypto=require(_0x9bf5('0xe'));var jsforce=require(_0x9bf5('0xf'));var deskjs=require(_0x9bf5('0x10'));var toCsv=require(_0x9bf5('0x9'));var querystring=require(_0x9bf5('0x11'));var Papa=require(_0x9bf5('0x12'));var Redis=require(_0x9bf5('0x13'));var authService=require(_0x9bf5('0x14'));var qs=require(_0x9bf5('0x15'));var as=require(_0x9bf5('0x16'));var hardwareService=require(_0x9bf5('0x17'));var logger=require(_0x9bf5('0x18'))(_0x9bf5('0x19'));var utils=require('../../config/utils');var config=require(_0x9bf5('0x1a'));var licenseUtil=require(_0x9bf5('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22971a,_0x176997){_0x176997=_0x176997||0xcc;return function(_0x3a9338){if(_0x3a9338){return _0x22971a[_0x9bf5('0x1c')](_0x176997);}return _0x22971a[_0x9bf5('0x1d')](_0x176997)[_0x9bf5('0x1e')]();};}function respondWithResult(_0x269cff,_0x25eb93){_0x25eb93=_0x25eb93||0xc8;return function(_0x4110b6){if(_0x4110b6){return _0x269cff[_0x9bf5('0x1d')](_0x25eb93)[_0x9bf5('0x1f')](_0x4110b6);}};}function respondWithFilteredResult(_0x1e8c48,_0x471e1f){return function(_0x38b9cc){if(_0x38b9cc){var _0x229bb9=typeof _0x471e1f[_0x9bf5('0x20')]==='undefined'&&typeof _0x471e1f[_0x9bf5('0x21')]===_0x9bf5('0x22');var _0x1e0e7d=_0x38b9cc[_0x9bf5('0x23')];var _0x2c03fc=_0x229bb9?0x0:_0x471e1f[_0x9bf5('0x20')];var _0x2a80e3=_0x229bb9?_0x38b9cc[_0x9bf5('0x23')]:_0x471e1f[_0x9bf5('0x20')]+_0x471e1f[_0x9bf5('0x21')];var _0x3839aa;if(_0x2a80e3>=_0x1e0e7d){_0x2a80e3=_0x1e0e7d;_0x3839aa=0xc8;}else{_0x3839aa=0xce;}_0x1e8c48[_0x9bf5('0x1d')](_0x3839aa);return _0x1e8c48[_0x9bf5('0x24')]('Content-Range',_0x2c03fc+'-'+_0x2a80e3+'/'+_0x1e0e7d)[_0x9bf5('0x1f')](_0x38b9cc);}return null;};}function patchUpdates(_0xcab48c){return function(_0x543a1d){try{jsonpatch[_0x9bf5('0x25')](_0x543a1d,_0xcab48c,!![]);}catch(_0x59f4bc){return BPromise[_0x9bf5('0x26')](_0x59f4bc);}return _0x543a1d['save']();};}function saveUpdates(_0x1917ab,_0x436404){return function(_0x12a4b0){if(_0x12a4b0){return _0x12a4b0[_0x9bf5('0x27')](_0x1917ab)['then'](function(_0x3883d9){return _0x3883d9;});}return null;};}function removeEntity(_0x30e961,_0x588883){return function(_0x629acf){if(_0x629acf){return _0x629acf['destroy']()[_0x9bf5('0x28')](function(){var _0xb38ff6=_0x629acf[_0x9bf5('0x29')]({'plain':!![]});var _0x557f84=_0x9bf5('0x2a');return db[_0x9bf5('0x2b')][_0x9bf5('0x2c')]({'where':{'type':_0x557f84,'resourceId':_0xb38ff6['id']}})[_0x9bf5('0x28')](function(){return _0x629acf;});})[_0x9bf5('0x28')](function(){_0x30e961[_0x9bf5('0x1d')](0xcc)[_0x9bf5('0x1e')]();});}};}function handleEntityNotFound(_0x5ae596,_0x43fd49){return function(_0x108ddd){if(!_0x108ddd){_0x5ae596[_0x9bf5('0x1c')](0x194);}return _0x108ddd;};}function handleError(_0x361ba7,_0x3e138c){_0x3e138c=_0x3e138c||0x1f4;return function(_0x58a585){logger[_0x9bf5('0x2d')](_0x58a585[_0x9bf5('0x2e')]);if(_0x58a585[_0x9bf5('0x2f')]){delete _0x58a585[_0x9bf5('0x2f')];}_0x361ba7['status'](_0x3e138c)['send'](_0x58a585);};}exports['index']=function(_0x262877,_0x3afb47){var _0x63db={},_0x33b45c={},_0x1c1671={'count':0x0,'rows':[]};var _0x2aa33e=_['map'](db[_0x9bf5('0x30')][_0x9bf5('0x31')],function(_0x50f52f){return{'name':_0x50f52f[_0x9bf5('0x32')],'type':_0x50f52f[_0x9bf5('0x33')][_0x9bf5('0x34')]};});_0x33b45c[_0x9bf5('0x35')]=_[_0x9bf5('0x36')](_0x2aa33e,_0x9bf5('0x2f'));_0x33b45c[_0x9bf5('0x37')]=_[_0x9bf5('0x38')](_0x262877['query']);_0x33b45c['filters']=_[_0x9bf5('0x39')](_0x33b45c[_0x9bf5('0x35')],_0x33b45c['query']);_0x63db[_0x9bf5('0x3a')]=_['intersection'](_0x33b45c[_0x9bf5('0x35')],qs[_0x9bf5('0x3b')](_0x262877['query'][_0x9bf5('0x3b')]));_0x63db[_0x9bf5('0x3a')]=_0x63db[_0x9bf5('0x3a')][_0x9bf5('0x3c')]?_0x63db[_0x9bf5('0x3a')]:_0x33b45c[_0x9bf5('0x35')];if(!_0x262877[_0x9bf5('0x37')][_0x9bf5('0x3d')](_0x9bf5('0x3e'))){_0x63db[_0x9bf5('0x21')]=qs[_0x9bf5('0x21')](_0x262877[_0x9bf5('0x37')][_0x9bf5('0x21')]);_0x63db[_0x9bf5('0x20')]=qs[_0x9bf5('0x20')](_0x262877[_0x9bf5('0x37')][_0x9bf5('0x20')]);}_0x63db[_0x9bf5('0x3f')]=qs['sort'](_0x262877[_0x9bf5('0x37')][_0x9bf5('0x40')]);_0x63db[_0x9bf5('0x41')]=qs[_0x9bf5('0x42')](_['pick'](_0x262877[_0x9bf5('0x37')],_0x33b45c[_0x9bf5('0x42')]),_0x2aa33e);if(_0x262877[_0x9bf5('0x37')][_0x9bf5('0x43')]){_0x63db[_0x9bf5('0x41')]=_[_0x9bf5('0x44')](_0x63db['where'],{'$or':_['map'](_0x2aa33e,function(_0xe26104){if(_0xe26104['type']!==_0x9bf5('0x45')){var _0x44827d={};_0x44827d[_0xe26104['name']]={'$like':'%'+_0x262877[_0x9bf5('0x37')]['filter']+'%'};return _0x44827d;}})});}_0x63db=_[_0x9bf5('0x44')]({},_0x63db,_0x262877[_0x9bf5('0x46')]);var _0xcf3ba5={'where':_0x63db['where']};return db[_0x9bf5('0x30')][_0x9bf5('0x23')](_0xcf3ba5)[_0x9bf5('0x28')](function(_0x495979){_0x1c1671['count']=_0x495979;if(_0x262877[_0x9bf5('0x37')][_0x9bf5('0x47')]){_0x63db[_0x9bf5('0x48')]=[{'all':!![]}];}return db[_0x9bf5('0x30')]['findAll'](_0x63db);})[_0x9bf5('0x28')](function(_0x36b3a8){_0x1c1671['rows']=_0x36b3a8;return _0x1c1671;})['then'](respondWithFilteredResult(_0x3afb47,_0x63db))['catch'](handleError(_0x3afb47,null));};exports[_0x9bf5('0x49')]=function(_0x435db4,_0x156ed1){var _0x376612={'raw':![],'where':{'id':_0x435db4[_0x9bf5('0x4a')]['id']}},_0x2e0e53={};_0x2e0e53[_0x9bf5('0x35')]=_['keys'](db['Campaign']['rawAttributes']);_0x2e0e53['query']=_['keys'](_0x435db4[_0x9bf5('0x37')]);_0x2e0e53[_0x9bf5('0x42')]=_[_0x9bf5('0x39')](_0x2e0e53[_0x9bf5('0x35')],_0x2e0e53['query']);_0x376612[_0x9bf5('0x3a')]=_['intersection'](_0x2e0e53[_0x9bf5('0x35')],qs[_0x9bf5('0x3b')](_0x435db4[_0x9bf5('0x37')][_0x9bf5('0x3b')]));_0x376612[_0x9bf5('0x3a')]=_0x376612['attributes']['length']?_0x376612[_0x9bf5('0x3a')]:_0x2e0e53['model'];if(_0x435db4[_0x9bf5('0x37')][_0x9bf5('0x47')]){_0x376612['include']=[{'all':!![]}];}_0x376612=_[_0x9bf5('0x44')]({},_0x376612,_0x435db4[_0x9bf5('0x46')]);return db['Campaign'][_0x9bf5('0x4b')](_0x376612)['then'](handleEntityNotFound(_0x156ed1,null))[_0x9bf5('0x28')](respondWithResult(_0x156ed1,null))[_0x9bf5('0x4c')](handleError(_0x156ed1,null));};exports['create']=function(_0x5a4aa0,_0x3ea07f){return db[_0x9bf5('0x30')][_0x9bf5('0x4d')](_0x5a4aa0[_0x9bf5('0x4e')],{})['then'](function(_0x2bfdcb){var _0x4de963=_0x5a4aa0[_0x9bf5('0x4f')][_0x9bf5('0x29')]({'plain':!![]});if(!_0x4de963)throw new Error(_0x9bf5('0x50'));if(_0x4de963[_0x9bf5('0x51')]===_0x9bf5('0x4f')){var _0x10ca62=_0x2bfdcb['get']({'plain':!![]});var _0x5ae230=_0x9bf5('0x2a');return db[_0x9bf5('0x52')][_0x9bf5('0x4b')]({'where':{'name':_0x5ae230,'userProfileId':_0x4de963[_0x9bf5('0x53')]},'raw':!![]})['then'](function(_0x3669b2){if(_0x3669b2&&_0x3669b2['autoAssociation']===0x0){return db['UserProfileResource'][_0x9bf5('0x4d')]({'name':_0x10ca62[_0x9bf5('0x2f')],'resourceId':_0x10ca62['id'],'type':_0x3669b2[_0x9bf5('0x2f')],'sectionId':_0x3669b2['id']},{})[_0x9bf5('0x28')](function(){return _0x2bfdcb;});}else{return _0x2bfdcb;}})[_0x9bf5('0x4c')](function(_0x1baf5b){logger['error'](_0x9bf5('0x54'),_0x1baf5b);throw _0x1baf5b;});}return _0x2bfdcb;})[_0x9bf5('0x28')](respondWithResult(_0x3ea07f,0xc9))['catch'](handleError(_0x3ea07f,null));};exports[_0x9bf5('0x55')]=function(_0x287741,_0x50a558){var _0x36f06c={'where':{'id':_0x287741[_0x9bf5('0x4a')]['id']}},_0x36d305={};_0x36d305[_0x9bf5('0x35')]=_[_0x9bf5('0x38')](db[_0x9bf5('0x30')][_0x9bf5('0x31')]);_0x36f06c[_0x9bf5('0x3a')]=_[_0x9bf5('0x39')](_0x36d305[_0x9bf5('0x35')],qs[_0x9bf5('0x3b')](_0x287741[_0x9bf5('0x37')][_0x9bf5('0x3b')]));_0x36f06c[_0x9bf5('0x3a')]=_0x36f06c[_0x9bf5('0x3a')][_0x9bf5('0x3c')]?_0x36f06c[_0x9bf5('0x3a')]:_0x36d305[_0x9bf5('0x35')];if(_0x287741[_0x9bf5('0x37')][_0x9bf5('0x47')]){_0x36f06c['include']=[{'all':!![]}];}_0x36f06c=_[_0x9bf5('0x44')]({},_0x36f06c,_0x287741[_0x9bf5('0x46')]);return db['Campaign'][_0x9bf5('0x4b')](_0x36f06c)[_0x9bf5('0x28')](handleEntityNotFound(_0x50a558,null))[_0x9bf5('0x28')](function(_0x3421c1){if(_0x3421c1){var _0x30c584=_0x3421c1[_0x9bf5('0x29')]({'plain':!![]});_0x30c584=qs['omit'](_0x30c584,['id',_0x9bf5('0x56'),_0x9bf5('0x57')]);_0x287741[_0x9bf5('0x4e')]=_[_0x9bf5('0x58')](_0x287741[_0x9bf5('0x4e')],['id',_0x9bf5('0x56'),_0x9bf5('0x57')]);return db[_0x9bf5('0x30')][_0x9bf5('0x4d')](_[_0x9bf5('0x44')](_0x30c584,_0x287741[_0x9bf5('0x4e')]),{'include':_0x287741[_0x9bf5('0x37')][_0x9bf5('0x47')]?[{'all':!![]}]:undefined})[_0x9bf5('0x28')](function(_0x4f04fa){var _0x1b7a5d=_0x287741[_0x9bf5('0x4f')][_0x9bf5('0x29')]({'plain':!![]});if(!_0x1b7a5d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b7a5d[_0x9bf5('0x51')]===_0x9bf5('0x4f')){var _0x2c28ac=_0x4f04fa['get']({'plain':!![]});var _0x568853=_0x9bf5('0x2a');return db[_0x9bf5('0x52')][_0x9bf5('0x4b')]({'where':{'name':_0x568853,'userProfileId':_0x1b7a5d[_0x9bf5('0x53')]},'raw':!![]})['then'](function(_0x1f0506){if(_0x1f0506&&_0x1f0506['autoAssociation']===0x0){return db['UserProfileResource'][_0x9bf5('0x4d')]({'name':_0x2c28ac[_0x9bf5('0x2f')],'resourceId':_0x2c28ac['id'],'type':_0x1f0506[_0x9bf5('0x2f')],'sectionId':_0x1f0506['id']},{})['then'](function(){return _0x4f04fa;});}else{return _0x4f04fa;}})[_0x9bf5('0x4c')](function(_0x91be90){logger['error'](_0x9bf5('0x54'),_0x91be90);throw _0x91be90;});}return _0x4f04fa;});}})[_0x9bf5('0x28')](respondWithResult(_0x50a558,0xc9))['catch'](handleError(_0x50a558,null));};exports[_0x9bf5('0x27')]=function(_0x36eca4,_0x35c8d3){if(_0x36eca4[_0x9bf5('0x4e')]['id']){delete _0x36eca4[_0x9bf5('0x4e')]['id'];}return db[_0x9bf5('0x30')][_0x9bf5('0x4b')]({'where':{'id':_0x36eca4[_0x9bf5('0x4a')]['id']}})[_0x9bf5('0x28')](handleEntityNotFound(_0x35c8d3,null))['then'](saveUpdates(_0x36eca4[_0x9bf5('0x4e')],null))[_0x9bf5('0x28')](respondWithResult(_0x35c8d3,null))[_0x9bf5('0x4c')](handleError(_0x35c8d3,null));};exports[_0x9bf5('0x2c')]=function(_0x210f19,_0x1632c6){return db['Campaign'][_0x9bf5('0x4b')]({'where':{'id':_0x210f19['params']['id']}})[_0x9bf5('0x28')](handleEntityNotFound(_0x1632c6,null))[_0x9bf5('0x28')](removeEntity(_0x1632c6,null))[_0x9bf5('0x4c')](handleError(_0x1632c6,null));};exports[_0x9bf5('0x59')]=function(_0x57c503,_0x342cd3,_0x3fa072){var _0xd2c7cc={'raw':!![],'where':{}};var _0x5db4c5={};var _0x2e22e6={'count':0x0,'rows':[]};return db[_0x9bf5('0x30')][_0x9bf5('0x5a')]({'where':{'id':_0x57c503[_0x9bf5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x342cd3,null))[_0x9bf5('0x28')](function(_0x2ad92e){if(_0x2ad92e){_0x5db4c5[_0x9bf5('0x35')]=_[_0x9bf5('0x38')](db['CmHopper'][_0x9bf5('0x31')]);_0x5db4c5[_0x9bf5('0x37')]=_['keys'](_0x57c503[_0x9bf5('0x37')]);_0x5db4c5[_0x9bf5('0x42')]=_[_0x9bf5('0x39')](_0x5db4c5[_0x9bf5('0x35')],_0x5db4c5[_0x9bf5('0x37')]);_0xd2c7cc[_0x9bf5('0x3a')]=_[_0x9bf5('0x39')](_0x5db4c5[_0x9bf5('0x35')],qs[_0x9bf5('0x3b')](_0x57c503[_0x9bf5('0x37')][_0x9bf5('0x3b')]));_0xd2c7cc['attributes']=_0xd2c7cc[_0x9bf5('0x3a')][_0x9bf5('0x3c')]?_0xd2c7cc[_0x9bf5('0x3a')]:_0x5db4c5[_0x9bf5('0x35')];if(!_0x57c503[_0x9bf5('0x37')][_0x9bf5('0x3d')](_0x9bf5('0x3e'))){_0xd2c7cc[_0x9bf5('0x21')]=qs[_0x9bf5('0x21')](_0x57c503[_0x9bf5('0x37')][_0x9bf5('0x21')]);_0xd2c7cc[_0x9bf5('0x20')]=qs[_0x9bf5('0x20')](_0x57c503['query']['offset']);}_0xd2c7cc[_0x9bf5('0x3f')]=qs['sort'](_0x57c503[_0x9bf5('0x37')][_0x9bf5('0x40')]);_0xd2c7cc[_0x9bf5('0x41')]=qs[_0x9bf5('0x42')](_[_0x9bf5('0x5b')](_0x57c503[_0x9bf5('0x37')],_0x5db4c5[_0x9bf5('0x42')]));_0xd2c7cc['where'][_0x9bf5('0x5c')]=_0x2ad92e['id'];if(_0x57c503[_0x9bf5('0x37')]['filter']){_0xd2c7cc[_0x9bf5('0x41')]=_[_0x9bf5('0x44')](_0xd2c7cc['where'],{'$or':_[_0x9bf5('0x36')](_0xd2c7cc[_0x9bf5('0x3a')],function(_0x11eaf5){var _0x554186={};_0x554186[_0x11eaf5]={'$like':'%'+_0x57c503['query'][_0x9bf5('0x43')]+'%'};return _0x554186;})});}_0xd2c7cc=_[_0x9bf5('0x44')]({},_0xd2c7cc,_0x57c503[_0x9bf5('0x46')]);return db[_0x9bf5('0x5d')][_0x9bf5('0x23')]({'where':_0xd2c7cc[_0x9bf5('0x41')]})[_0x9bf5('0x28')](function(_0x6eb87){_0x2e22e6['count']=_0x6eb87;if(_0x57c503[_0x9bf5('0x37')][_0x9bf5('0x47')]){_0xd2c7cc[_0x9bf5('0x48')]=[{'all':!![]}];}return db[_0x9bf5('0x5d')][_0x9bf5('0x5e')](_0xd2c7cc);})[_0x9bf5('0x28')](function(_0x94c055){_0x2e22e6[_0x9bf5('0x5f')]=_0x94c055;return _0x2e22e6;});}})['then'](respondWithFilteredResult(_0x342cd3,_0xd2c7cc))[_0x9bf5('0x4c')](handleError(_0x342cd3,null));};exports[_0x9bf5('0x60')]=function(_0x3f6394,_0x6a1d64,_0x53cefc){var _0x413fb7={'raw':!![],'where':{}};var _0x404bb1={};var _0x623e6a={'count':0x0,'rows':[]};return db['Campaign'][_0x9bf5('0x5a')]({'where':{'id':_0x3f6394[_0x9bf5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6a1d64,null))['then'](function(_0x28f23d){if(_0x28f23d){_0x404bb1[_0x9bf5('0x35')]=_[_0x9bf5('0x38')](db[_0x9bf5('0x61')][_0x9bf5('0x31')]);_0x404bb1[_0x9bf5('0x37')]=_[_0x9bf5('0x38')](_0x3f6394[_0x9bf5('0x37')]);_0x404bb1[_0x9bf5('0x42')]=_['intersection'](_0x404bb1['model'],_0x404bb1[_0x9bf5('0x37')]);_0x413fb7['attributes']=_['intersection'](_0x404bb1[_0x9bf5('0x35')],qs['fields'](_0x3f6394[_0x9bf5('0x37')][_0x9bf5('0x3b')]));_0x413fb7[_0x9bf5('0x3a')]=_0x413fb7[_0x9bf5('0x3a')][_0x9bf5('0x3c')]?_0x413fb7[_0x9bf5('0x3a')]:_0x404bb1[_0x9bf5('0x35')];if(!_0x3f6394['query'][_0x9bf5('0x3d')](_0x9bf5('0x3e'))){_0x413fb7['limit']=qs[_0x9bf5('0x21')](_0x3f6394[_0x9bf5('0x37')][_0x9bf5('0x21')]);_0x413fb7[_0x9bf5('0x20')]=qs['offset'](_0x3f6394[_0x9bf5('0x37')]['offset']);}_0x413fb7[_0x9bf5('0x3f')]=qs[_0x9bf5('0x40')](_0x3f6394['query'][_0x9bf5('0x40')]);_0x413fb7['where']=qs[_0x9bf5('0x42')](_[_0x9bf5('0x5b')](_0x3f6394[_0x9bf5('0x37')],_0x404bb1[_0x9bf5('0x42')]));_0x413fb7[_0x9bf5('0x41')]['CampaignId']=_0x28f23d['id'];if(_0x3f6394[_0x9bf5('0x37')][_0x9bf5('0x43')]){_0x413fb7[_0x9bf5('0x41')]=_['merge'](_0x413fb7[_0x9bf5('0x41')],{'$or':_['map'](_0x413fb7['attributes'],function(_0x331abf){var _0x307a02={};_0x307a02[_0x331abf]={'$like':'%'+_0x3f6394[_0x9bf5('0x37')][_0x9bf5('0x43')]+'%'};return _0x307a02;})});}_0x413fb7=_['merge']({},_0x413fb7,_0x3f6394[_0x9bf5('0x46')]);return db[_0x9bf5('0x61')][_0x9bf5('0x23')]({'where':_0x413fb7[_0x9bf5('0x41')]})[_0x9bf5('0x28')](function(_0x11152c){_0x623e6a[_0x9bf5('0x23')]=_0x11152c;if(_0x3f6394[_0x9bf5('0x37')]['includeAll']){_0x413fb7[_0x9bf5('0x48')]=[{'all':!![]}];}return db[_0x9bf5('0x61')]['findAll'](_0x413fb7);})[_0x9bf5('0x28')](function(_0x16b629){_0x623e6a['rows']=_0x16b629;return _0x623e6a;});}})[_0x9bf5('0x28')](respondWithFilteredResult(_0x6a1d64,_0x413fb7))[_0x9bf5('0x4c')](handleError(_0x6a1d64,null));};exports['getHopperFinals']=function(_0x487353,_0x8e20d5,_0x49749d){var _0x30adc7={'raw':!![],'where':{}};var _0x607fd8={};var _0x2642ac={'count':0x0,'rows':[]};return db[_0x9bf5('0x30')]['findOne']({'where':{'id':_0x487353[_0x9bf5('0x4a')]['id']}})[_0x9bf5('0x28')](handleEntityNotFound(_0x8e20d5,null))[_0x9bf5('0x28')](function(_0x1328f5){if(_0x1328f5){_0x607fd8['model']=_[_0x9bf5('0x38')](db[_0x9bf5('0x62')][_0x9bf5('0x31')]);_0x607fd8['query']=_[_0x9bf5('0x38')](_0x487353[_0x9bf5('0x37')]);_0x607fd8[_0x9bf5('0x42')]=_['intersection'](_0x607fd8[_0x9bf5('0x35')],_0x607fd8['query']);_0x30adc7['attributes']=_[_0x9bf5('0x39')](_0x607fd8['model'],qs[_0x9bf5('0x3b')](_0x487353[_0x9bf5('0x37')]['fields']));_0x30adc7['attributes']=_0x30adc7[_0x9bf5('0x3a')][_0x9bf5('0x3c')]?_0x30adc7[_0x9bf5('0x3a')]:_0x607fd8['model'];if(!_0x487353[_0x9bf5('0x37')][_0x9bf5('0x3d')](_0x9bf5('0x3e'))){_0x30adc7['limit']=qs['limit'](_0x487353[_0x9bf5('0x37')][_0x9bf5('0x21')]);_0x30adc7[_0x9bf5('0x20')]=qs['offset'](_0x487353[_0x9bf5('0x37')][_0x9bf5('0x20')]);}_0x30adc7[_0x9bf5('0x3f')]=qs[_0x9bf5('0x40')](_0x487353[_0x9bf5('0x37')][_0x9bf5('0x40')]);_0x30adc7[_0x9bf5('0x41')]=qs[_0x9bf5('0x42')](_['pick'](_0x487353['query'],_0x607fd8['filters']));_0x30adc7[_0x9bf5('0x41')][_0x9bf5('0x5c')]=_0x1328f5['id'];if(_0x487353[_0x9bf5('0x37')][_0x9bf5('0x43')]){_0x30adc7[_0x9bf5('0x41')]=_['merge'](_0x30adc7['where'],{'$or':_[_0x9bf5('0x36')](_0x30adc7[_0x9bf5('0x3a')],function(_0x2c4525){var _0x48f6c7={};_0x48f6c7[_0x2c4525]={'$like':'%'+_0x487353['query'][_0x9bf5('0x43')]+'%'};return _0x48f6c7;})});}_0x30adc7=_[_0x9bf5('0x44')]({},_0x30adc7,_0x487353['options']);return db['CmHopperFinal']['count']({'where':_0x30adc7[_0x9bf5('0x41')]})[_0x9bf5('0x28')](function(_0x4b5cbb){_0x2642ac['count']=_0x4b5cbb;if(_0x487353[_0x9bf5('0x37')][_0x9bf5('0x47')]){_0x30adc7[_0x9bf5('0x48')]=[{'all':!![]}];}return db[_0x9bf5('0x62')]['findAll'](_0x30adc7);})[_0x9bf5('0x28')](function(_0x157f3d){_0x2642ac[_0x9bf5('0x5f')]=_0x157f3d;return _0x2642ac;});}})['then'](respondWithFilteredResult(_0x8e20d5,_0x30adc7))[_0x9bf5('0x4c')](handleError(_0x8e20d5,null));};exports[_0x9bf5('0x63')]=function(_0x237971,_0x13fc66,_0x220a91){var _0x185837={'raw':!![],'where':{}};var _0x4b45f3={};var _0x126d5a={'count':0x0,'rows':[]};return db[_0x9bf5('0x30')]['findOne']({'where':{'id':_0x237971[_0x9bf5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13fc66,null))[_0x9bf5('0x28')](function(_0x1fe3b7){if(_0x1fe3b7){_0x4b45f3[_0x9bf5('0x35')]=_[_0x9bf5('0x38')](db[_0x9bf5('0x64')][_0x9bf5('0x31')]);_0x4b45f3[_0x9bf5('0x37')]=_[_0x9bf5('0x38')](_0x237971['query']);_0x4b45f3['filters']=_[_0x9bf5('0x39')](_0x4b45f3['model'],_0x4b45f3[_0x9bf5('0x37')]);_0x185837[_0x9bf5('0x3a')]=_[_0x9bf5('0x39')](_0x4b45f3[_0x9bf5('0x35')],qs['fields'](_0x237971[_0x9bf5('0x37')][_0x9bf5('0x3b')]));_0x185837[_0x9bf5('0x3a')]=_0x185837[_0x9bf5('0x3a')][_0x9bf5('0x3c')]?_0x185837[_0x9bf5('0x3a')]:_0x4b45f3['model'];if(!_0x237971[_0x9bf5('0x37')][_0x9bf5('0x3d')](_0x9bf5('0x3e'))){_0x185837[_0x9bf5('0x21')]=qs[_0x9bf5('0x21')](_0x237971[_0x9bf5('0x37')][_0x9bf5('0x21')]);_0x185837[_0x9bf5('0x20')]=qs[_0x9bf5('0x20')](_0x237971['query'][_0x9bf5('0x20')]);}_0x185837[_0x9bf5('0x3f')]=qs[_0x9bf5('0x40')](_0x237971[_0x9bf5('0x37')][_0x9bf5('0x40')]);_0x185837[_0x9bf5('0x41')]=qs['filters'](_[_0x9bf5('0x5b')](_0x237971[_0x9bf5('0x37')],_0x4b45f3[_0x9bf5('0x42')]));_0x185837[_0x9bf5('0x41')]['CampaignId']=_0x1fe3b7['id'];if(_0x237971['query']['filter']){_0x185837[_0x9bf5('0x41')]=_['merge'](_0x185837[_0x9bf5('0x41')],{'$or':_[_0x9bf5('0x36')](_0x185837[_0x9bf5('0x3a')],function(_0x3d6c63){var _0x5baa6c={};_0x5baa6c[_0x3d6c63]={'$like':'%'+_0x237971['query'][_0x9bf5('0x43')]+'%'};return _0x5baa6c;})});}_0x185837=_[_0x9bf5('0x44')]({},_0x185837,_0x237971[_0x9bf5('0x46')]);return db[_0x9bf5('0x64')][_0x9bf5('0x23')]({'where':_0x185837[_0x9bf5('0x41')]})[_0x9bf5('0x28')](function(_0x19914a){_0x126d5a[_0x9bf5('0x23')]=_0x19914a;if(_0x237971[_0x9bf5('0x37')][_0x9bf5('0x47')]){_0x185837[_0x9bf5('0x48')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x9bf5('0x5e')](_0x185837);})[_0x9bf5('0x28')](function(_0x225af7){_0x126d5a[_0x9bf5('0x5f')]=_0x225af7;return _0x126d5a;});}})[_0x9bf5('0x28')](respondWithFilteredResult(_0x13fc66,_0x185837))[_0x9bf5('0x4c')](handleError(_0x13fc66,null));};exports[_0x9bf5('0x65')]=function(_0x3afcef,_0x284241,_0x5230e1){var _0x262a87={};var _0x46b2e9={};var _0x5d9728;var _0x12934a;return db[_0x9bf5('0x30')][_0x9bf5('0x5a')]({'where':{'id':_0x3afcef['params']['id']}})[_0x9bf5('0x28')](handleEntityNotFound(_0x284241,null))['then'](function(_0x2a127d){if(_0x2a127d){_0x5d9728=_0x2a127d;_0x46b2e9[_0x9bf5('0x35')]=_[_0x9bf5('0x38')](db[_0x9bf5('0x66')][_0x9bf5('0x31')]);_0x46b2e9[_0x9bf5('0x37')]=_['keys'](_0x3afcef[_0x9bf5('0x37')]);_0x46b2e9[_0x9bf5('0x42')]=_[_0x9bf5('0x39')](_0x46b2e9[_0x9bf5('0x35')],_0x46b2e9[_0x9bf5('0x37')]);_0x262a87[_0x9bf5('0x3a')]=_['intersection'](_0x46b2e9[_0x9bf5('0x35')],qs['fields'](_0x3afcef[_0x9bf5('0x37')][_0x9bf5('0x3b')]));_0x262a87['attributes']=_0x262a87[_0x9bf5('0x3a')][_0x9bf5('0x3c')]?_0x262a87[_0x9bf5('0x3a')]:_0x46b2e9[_0x9bf5('0x35')];_0x262a87[_0x9bf5('0x3f')]=qs['sort'](_0x3afcef[_0x9bf5('0x37')][_0x9bf5('0x40')]);_0x262a87[_0x9bf5('0x41')]=qs[_0x9bf5('0x42')](_['pick'](_0x3afcef[_0x9bf5('0x37')],_0x46b2e9['filters']));if(_0x3afcef['query'][_0x9bf5('0x43')]){_0x262a87[_0x9bf5('0x41')]=_[_0x9bf5('0x44')](_0x262a87[_0x9bf5('0x41')],{'$or':_[_0x9bf5('0x36')](_0x262a87[_0x9bf5('0x3a')],function(_0x4ada47){var _0x3756e3={};_0x3756e3[_0x4ada47]={'$like':'%'+_0x3afcef[_0x9bf5('0x37')][_0x9bf5('0x43')]+'%'};return _0x3756e3;})});}_0x262a87=_[_0x9bf5('0x44')]({},_0x262a87,_0x3afcef[_0x9bf5('0x46')]);return _0x5d9728[_0x9bf5('0x65')](_0x262a87);}})['then'](function(_0x108008){if(_0x108008){_0x12934a=_0x108008[_0x9bf5('0x3c')];if(!_0x3afcef['query'][_0x9bf5('0x3d')](_0x9bf5('0x3e'))){_0x262a87[_0x9bf5('0x21')]=qs[_0x9bf5('0x21')](_0x3afcef[_0x9bf5('0x37')][_0x9bf5('0x21')]);_0x262a87[_0x9bf5('0x20')]=qs[_0x9bf5('0x20')](_0x3afcef[_0x9bf5('0x37')][_0x9bf5('0x20')]);}return _0x5d9728[_0x9bf5('0x65')](_0x262a87);}})[_0x9bf5('0x28')](function(_0xfc8ec3){if(_0xfc8ec3){return _0xfc8ec3?{'count':_0x12934a,'rows':_0xfc8ec3}:null;}})[_0x9bf5('0x28')](respondWithResult(_0x284241,null))[_0x9bf5('0x4c')](handleError(_0x284241,null));};exports[_0x9bf5('0x67')]=function(_0x3b3f7e,_0x29fc75,_0x3d9eb4){var _0x22f954,_0x1ec0db;return db[_0x9bf5('0x30')][_0x9bf5('0x4b')]({'where':{'id':_0x3b3f7e[_0x9bf5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29fc75,null))['then'](function(_0x58b917){if(_0x58b917){_0x1ec0db=_0x58b917;return _0x58b917[_0x9bf5('0x67')](_0x3b3f7e[_0x9bf5('0x4e')][_0x9bf5('0x68')],_['omit'](_0x3b3f7e[_0x9bf5('0x4e')],['ids','id'])||{});}return null;})[_0x9bf5('0x69')](function(_0xe03826){var _0x423cd9;_0x22f954=_0xe03826||[];var _0x4eda7d=[];if(_0xe03826){for(var _0x69f858=0x0;_0x69f858<_0xe03826['length'];_0x69f858+=0x1){var _0x5e91b6=_0xe03826[_0x69f858][_0x9bf5('0x29')]({'plain':!![]});_0x1ec0db[_0x9bf5('0x6a')]=_0x3b3f7e['body'][_0x9bf5('0x6a')]?_0x3b3f7e[_0x9bf5('0x4e')][_0x9bf5('0x6a')]:_0x1ec0db[_0x9bf5('0x6a')];switch(_0x1ec0db[_0x9bf5('0x6a')]){case'always':_0x423cd9=squel[_0x9bf5('0x6b')]()[_0x9bf5('0x6c')]('cm_hopper')[_0x9bf5('0x6d')](['phone',_0x9bf5('0x6e'),_0x9bf5('0x6f'),_0x9bf5('0x70'),_0x9bf5('0x5c'),_0x9bf5('0x56'),_0x9bf5('0x57')],squel['select']()['field'](_0x9bf5('0x71'),_0x9bf5('0x71'))[_0x9bf5('0x72')](_0x9bf5('0x73'),_0x9bf5('0x6e'))[_0x9bf5('0x72')]('id',_0x9bf5('0x6f'))[_0x9bf5('0x72')](_0x5e91b6[_0x9bf5('0x74')][_0x9bf5('0x75')](),_0x9bf5('0x70'))['field'](_0x3b3f7e[_0x9bf5('0x4a')]['id'][_0x9bf5('0x75')](),_0x9bf5('0x5c'))['field'](_0x9bf5('0x73'),_0x9bf5('0x56'))[_0x9bf5('0x72')]('NOW()','updatedAt')[_0x9bf5('0x76')](_0x9bf5('0x77'))[_0x9bf5('0x41')](_0x9bf5('0x78'))[_0x9bf5('0x41')](_0x9bf5('0x79'),_0x5e91b6[_0x9bf5('0x74')][_0x9bf5('0x75')]())[_0x9bf5('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0x9bf5('0x41')](_0x9bf5('0x7a'),squel[_0x9bf5('0x7b')]()[_0x9bf5('0x72')](_0x9bf5('0x7c'))[_0x9bf5('0x76')](_0x9bf5('0x7d'))[_0x9bf5('0x41')](_0x9bf5('0x7e'),_0x3b3f7e['params']['id'][_0x9bf5('0x75')]()))['where'](_0x9bf5('0x7a'),squel[_0x9bf5('0x7b')]()[_0x9bf5('0x72')](_0x9bf5('0x7f'))['from'](_0x9bf5('0x80'))[_0x9bf5('0x41')](_0x9bf5('0x7e'),_0x3b3f7e['params']['id'][_0x9bf5('0x75')]())))[_0x9bf5('0x75')]();break;case'onlyIfOpen':_0x423cd9=squel['insert']()[_0x9bf5('0x6c')](_0x9bf5('0x80'))[_0x9bf5('0x6d')]([_0x9bf5('0x71'),_0x9bf5('0x6e'),'ContactId',_0x9bf5('0x70'),_0x9bf5('0x5c'),_0x9bf5('0x56'),_0x9bf5('0x57')],squel[_0x9bf5('0x7b')]()['field'](_0x9bf5('0x71'),'phone')[_0x9bf5('0x72')](_0x9bf5('0x73'),_0x9bf5('0x6e'))['field']('id',_0x9bf5('0x6f'))['field'](_0x5e91b6[_0x9bf5('0x74')]['toString'](),_0x9bf5('0x70'))[_0x9bf5('0x72')](_0x3b3f7e[_0x9bf5('0x4a')]['id'][_0x9bf5('0x75')](),_0x9bf5('0x5c'))[_0x9bf5('0x72')](_0x9bf5('0x73'),_0x9bf5('0x56'))['field']('NOW()','updatedAt')['from']('cm_contacts')['where'](_0x9bf5('0x78'))['where']('ListId\x20=\x20?',_0x5e91b6[_0x9bf5('0x74')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x9bf5('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9bf5('0x7b')]()['field'](_0x9bf5('0x7f'))[_0x9bf5('0x76')](_0x9bf5('0x80'))[_0x9bf5('0x41')](_0x9bf5('0x7e'),_0x3b3f7e[_0x9bf5('0x4a')]['id']['toString']())))['toString']();break;default:_0x423cd9=squel[_0x9bf5('0x6b')]()[_0x9bf5('0x6c')](_0x9bf5('0x80'))[_0x9bf5('0x6d')]([_0x9bf5('0x71'),_0x9bf5('0x6e'),_0x9bf5('0x6f'),_0x9bf5('0x70'),_0x9bf5('0x5c'),_0x9bf5('0x56'),'updatedAt'],squel[_0x9bf5('0x7b')]()[_0x9bf5('0x72')]('phone','phone')[_0x9bf5('0x72')](_0x9bf5('0x73'),_0x9bf5('0x6e'))['field']('id','ContactId')[_0x9bf5('0x72')](_0x5e91b6[_0x9bf5('0x74')][_0x9bf5('0x75')](),_0x9bf5('0x70'))[_0x9bf5('0x72')](_0x3b3f7e[_0x9bf5('0x4a')]['id']['toString'](),'CampaignId')[_0x9bf5('0x72')]('NOW()',_0x9bf5('0x56'))[_0x9bf5('0x72')](_0x9bf5('0x73'),'updatedAt')[_0x9bf5('0x76')]('cm_contacts')['where'](_0x9bf5('0x78'))[_0x9bf5('0x41')](_0x9bf5('0x79'),_0x5e91b6[_0x9bf5('0x74')]['toString']())[_0x9bf5('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x9bf5('0x75')]();}_0x4eda7d['push'](db[_0x9bf5('0x81')][_0x9bf5('0x37')](_0x423cd9));}return BPromise[_0x9bf5('0x82')](_0x4eda7d);}})[_0x9bf5('0x28')](function(){return _0x22f954;})[_0x9bf5('0x28')](respondWithResult(_0x29fc75,null))['catch'](handleError(_0x29fc75,null));};exports[_0x9bf5('0x83')]=function(_0x11b365,_0x343075,_0xd2f016){return db['Campaign'][_0x9bf5('0x4b')]({'where':{'id':_0x11b365[_0x9bf5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x343075,null))[_0x9bf5('0x28')](function(_0x23b991){if(_0x23b991){return _0x23b991[_0x9bf5('0x83')](_0x11b365['query'][_0x9bf5('0x68')]);}})[_0x9bf5('0x28')](function(_0x5a54c5){if(_0x5a54c5){return db[_0x9bf5('0x5d')][_0x9bf5('0x2c')]({'where':{'ListId':_0x11b365[_0x9bf5('0x37')][_0x9bf5('0x68')],'CampaignId':_0x11b365['params']['id']}})[_0x9bf5('0x28')](function(){return _0x5a54c5;});}})[_0x9bf5('0x28')](respondWithStatusCode(_0x343075,null))[_0x9bf5('0x4c')](handleError(_0x343075,null));};exports[_0x9bf5('0x84')]=function(_0xc30be0,_0x39c5e9,_0x12698f){var _0x4dd925={};var _0x5cfd29={};var _0x39a5cf;var _0x28ee9f;return db[_0x9bf5('0x30')][_0x9bf5('0x5a')]({'where':{'id':_0xc30be0[_0x9bf5('0x4a')]['id']}})[_0x9bf5('0x28')](handleEntityNotFound(_0x39c5e9,null))[_0x9bf5('0x28')](function(_0xfbc95a){if(_0xfbc95a){_0x39a5cf=_0xfbc95a;_0x5cfd29['model']=_[_0x9bf5('0x38')](db[_0x9bf5('0x66')][_0x9bf5('0x31')]);_0x5cfd29[_0x9bf5('0x37')]=_['keys'](_0xc30be0[_0x9bf5('0x37')]);_0x5cfd29[_0x9bf5('0x42')]=_['intersection'](_0x5cfd29['model'],_0x5cfd29[_0x9bf5('0x37')]);_0x4dd925[_0x9bf5('0x3a')]=_[_0x9bf5('0x39')](_0x5cfd29[_0x9bf5('0x35')],qs[_0x9bf5('0x3b')](_0xc30be0['query']['fields']));_0x4dd925[_0x9bf5('0x3a')]=_0x4dd925['attributes']['length']?_0x4dd925[_0x9bf5('0x3a')]:_0x5cfd29[_0x9bf5('0x35')];_0x4dd925[_0x9bf5('0x3f')]=qs['sort'](_0xc30be0['query'][_0x9bf5('0x40')]);_0x4dd925[_0x9bf5('0x41')]=qs[_0x9bf5('0x42')](_[_0x9bf5('0x5b')](_0xc30be0[_0x9bf5('0x37')],_0x5cfd29[_0x9bf5('0x42')]));if(_0xc30be0[_0x9bf5('0x37')][_0x9bf5('0x43')]){_0x4dd925['where']=_[_0x9bf5('0x44')](_0x4dd925[_0x9bf5('0x41')],{'$or':_[_0x9bf5('0x36')](_0x4dd925[_0x9bf5('0x3a')],function(_0x2f7163){var _0x17cd06={};_0x17cd06[_0x2f7163]={'$like':'%'+_0xc30be0[_0x9bf5('0x37')]['filter']+'%'};return _0x17cd06;})});}_0x4dd925=_[_0x9bf5('0x44')]({},_0x4dd925,_0xc30be0[_0x9bf5('0x46')]);return _0x39a5cf[_0x9bf5('0x84')](_0x4dd925);}})[_0x9bf5('0x28')](function(_0x59fd4f){if(_0x59fd4f){_0x28ee9f=_0x59fd4f['length'];if(!_0xc30be0[_0x9bf5('0x37')][_0x9bf5('0x3d')]('nolimit')){_0x4dd925[_0x9bf5('0x21')]=qs[_0x9bf5('0x21')](_0xc30be0[_0x9bf5('0x37')]['limit']);_0x4dd925[_0x9bf5('0x20')]=qs[_0x9bf5('0x20')](_0xc30be0[_0x9bf5('0x37')][_0x9bf5('0x20')]);}return _0x39a5cf['getBlackLists'](_0x4dd925);}})[_0x9bf5('0x28')](function(_0xf0106f){if(_0xf0106f){return _0xf0106f?{'count':_0x28ee9f,'rows':_0xf0106f}:null;}})[_0x9bf5('0x28')](respondWithResult(_0x39c5e9,null))['catch'](handleError(_0x39c5e9,null));};exports[_0x9bf5('0x85')]=function(_0x2ddd85,_0x3155a5,_0x7cf305){var _0x3ada03,_0x28f04c;return db[_0x9bf5('0x30')][_0x9bf5('0x4b')]({'where':{'id':_0x2ddd85[_0x9bf5('0x4a')]['id']}})[_0x9bf5('0x28')](handleEntityNotFound(_0x3155a5,null))[_0x9bf5('0x28')](function(_0xc1ee9){if(_0xc1ee9){_0x28f04c=_0xc1ee9;return _0xc1ee9[_0x9bf5('0x85')](_0x2ddd85[_0x9bf5('0x4e')][_0x9bf5('0x68')],_[_0x9bf5('0x58')](_0x2ddd85[_0x9bf5('0x4e')],[_0x9bf5('0x68'),'id'])||{});}return null;})[_0x9bf5('0x69')](function(_0x4dd6c7){var _0x4be306;_0x3ada03=_0x4dd6c7||[];var _0x1927c0=[];if(_0x4dd6c7){for(var _0x57d71f=0x0;_0x57d71f<_0x4dd6c7['length'];_0x57d71f+=0x1){var _0x497fd9=_0x4dd6c7[_0x57d71f]['get']({'plain':!![]});_0x4be306=squel['insert']()[_0x9bf5('0x6c')](_0x9bf5('0x86'))[_0x9bf5('0x6d')]([_0x9bf5('0x71'),_0x9bf5('0x6f'),_0x9bf5('0x70'),'CampaignId',_0x9bf5('0x56'),_0x9bf5('0x57')],squel[_0x9bf5('0x7b')]()[_0x9bf5('0x72')](_0x9bf5('0x71'),'phone')[_0x9bf5('0x72')]('id','ContactId')['field'](_0x497fd9[_0x9bf5('0x74')][_0x9bf5('0x75')](),_0x9bf5('0x70'))['field'](_0x2ddd85[_0x9bf5('0x4a')]['id'][_0x9bf5('0x75')](),_0x9bf5('0x5c'))[_0x9bf5('0x72')](_0x9bf5('0x73'),_0x9bf5('0x56'))['field'](_0x9bf5('0x73'),_0x9bf5('0x57'))[_0x9bf5('0x76')](_0x9bf5('0x77'))[_0x9bf5('0x41')](_0x9bf5('0x78'))[_0x9bf5('0x41')](_0x9bf5('0x79'),_0x497fd9[_0x9bf5('0x74')][_0x9bf5('0x75')]())[_0x9bf5('0x41')](_0x9bf5('0x87')))[_0x9bf5('0x75')]();_0x1927c0[_0x9bf5('0x88')](db[_0x9bf5('0x81')][_0x9bf5('0x37')](_0x4be306));}return BPromise[_0x9bf5('0x82')](_0x1927c0);}})[_0x9bf5('0x28')](function(){return _0x3ada03;})[_0x9bf5('0x28')](respondWithResult(_0x3155a5,null))[_0x9bf5('0x4c')](handleError(_0x3155a5,null));};exports[_0x9bf5('0x89')]=function(_0x43381d,_0x4bec8b,_0x3c7d87){return db[_0x9bf5('0x30')][_0x9bf5('0x4b')]({'where':{'id':_0x43381d[_0x9bf5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4bec8b,null))['then'](function(_0x4ccae3){if(_0x4ccae3){return _0x4ccae3['removeBlackLists'](_0x43381d[_0x9bf5('0x37')]['ids']);}})[_0x9bf5('0x28')](function(_0x87e3dc){if(_0x87e3dc){return db[_0x9bf5('0x64')][_0x9bf5('0x2c')]({'where':{'ListId':_0x43381d['query'][_0x9bf5('0x68')],'CampaignId':_0x43381d['params']['id']}})['then'](function(){return _0x87e3dc;});}})[_0x9bf5('0x28')](respondWithStatusCode(_0x4bec8b,null))[_0x9bf5('0x4c')](handleError(_0x4bec8b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 534ee06..6a999fd 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 9fbfd30..9adf535 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 _0x1306=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','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','where','include','model','attributes','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1553be,_0x4b167f){var _0x418597=function(_0x56772f){while(--_0x56772f){_0x1553be['push'](_0x1553be['shift']());}};_0x418597(++_0x4b167f);}(_0x1306,0x17a));var _0x6130=function(_0x31f385,_0x265386){_0x31f385=_0x31f385-0x0;var _0xefdf7e=_0x1306[_0x31f385];return _0xefdf7e;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('Campaign,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});}exports[_0x6130('0x1a')]=function(_0x49803e){var _0x1cd785=this;return new Promise(function(_0xb6575d,_0x42d630){return db[_0x6130('0x1b')][_0x6130('0x1c')]({'raw':_0x49803e['options']?_0x49803e[_0x6130('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x49803e[_0x6130('0x1d')]?_0x49803e[_0x6130('0x1d')][_0x6130('0x1e')]||null:null,'attributes':_0x49803e[_0x6130('0x1d')]?_0x49803e[_0x6130('0x1d')]['attributes']||null:null,'limit':_0x49803e['options']?_0x49803e[_0x6130('0x1d')]['limit']||null:null,'include':_0x49803e[_0x6130('0x1d')]?_0x49803e[_0x6130('0x1d')]['include']?_['map'](_0x49803e['options'][_0x6130('0x1f')],function(_0x5369e3){return{'model':db[_0x5369e3[_0x6130('0x20')]],'as':_0x5369e3['as'],'attributes':_0x5369e3['attributes'],'include':_0x5369e3['include']?_['map'](_0x5369e3['include'],function(_0x5069bf){return{'model':db[_0x5069bf[_0x6130('0x20')]],'as':_0x5069bf['as'],'attributes':_0x5069bf[_0x6130('0x21')],'include':_0x5069bf['include']?_[_0x6130('0x22')](_0x5069bf['include'],function(_0x306935){return{'model':db[_0x306935['model']],'as':_0x306935['as'],'attributes':_0x306935['attributes']};}):[]};}):[]};}):[]:[]})[_0x6130('0xf')](function(_0x456231){logger[_0x6130('0x10')](_0x6130('0x1a'),_0x49803e);logger[_0x6130('0x13')](_0x6130('0x1a'),_0x49803e,JSON[_0x6130('0x15')](_0x456231));_0xb6575d(_0x456231);})[_0x6130('0x19')](function(_0x14dff0){logger['error']('GetCampaign',_0x14dff0[_0x6130('0x17')],_0x49803e);_0x42d630(_0x1cd785[_0x6130('0x16')](0x1f4,_0x14dff0[_0x6130('0x17')]));});});}; \ No newline at end of file +var _0x2e35=['model','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include'];(function(_0x3c34cd,_0x4433f4){var _0x287309=function(_0x16b2d1){while(--_0x16b2d1){_0x3c34cd['push'](_0x3c34cd['shift']());}};_0x287309(++_0x4433f4);}(_0x2e35,0x1d0));var _0x52e3=function(_0x4fee28,_0x43bc3c){_0x4fee28=_0x4fee28-0x0;var _0x25d5ec=_0x2e35[_0x4fee28];return _0x25d5ec;};'use strict';var _=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var moment=require(_0x52e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x52e3('0x3'));var fs=require('fs');var Redis=require(_0x52e3('0x4'));var db=require(_0x52e3('0x5'))['db'];var utils=require(_0x52e3('0x6'));var logger=require('../../config/logger')(_0x52e3('0x7'));var config=require(_0x52e3('0x8'));var jayson=require(_0x52e3('0x9'));var client=jayson[_0x52e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x483b93,_0x507a6c,_0x21ae13){return new BPromise(function(_0x4d77a0,_0x4b2662){return client[_0x52e3('0xb')](_0x483b93,_0x21ae13)[_0x52e3('0xc')](function(_0x551848){logger[_0x52e3('0xd')](_0x52e3('0xe'),_0x507a6c,'request\x20sent');logger[_0x52e3('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x507a6c,_0x52e3('0x10'),JSON[_0x52e3('0x11')](_0x551848));if(_0x551848[_0x52e3('0x12')]){if(_0x551848['error'][_0x52e3('0x13')]===0x1f4){logger[_0x52e3('0x12')]('Campaign,\x20%s,\x20%s',_0x507a6c,_0x551848[_0x52e3('0x12')]['message']);return _0x4b2662(_0x551848['error']['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x507a6c,_0x551848[_0x52e3('0x12')][_0x52e3('0x14')]);return _0x4d77a0(_0x551848[_0x52e3('0x12')][_0x52e3('0x14')]);}else{logger[_0x52e3('0xd')](_0x52e3('0xe'),_0x507a6c,_0x52e3('0x10'));_0x4d77a0(_0x551848[_0x52e3('0x15')][_0x52e3('0x14')]);}})[_0x52e3('0x16')](function(_0x3355e7){logger['error'](_0x52e3('0xe'),_0x507a6c,_0x3355e7);_0x4b2662(_0x3355e7);});});}exports[_0x52e3('0x17')]=function(_0x5d55e7){var _0x3088a2=this;return new Promise(function(_0x2e82e2,_0x1ed787){return db[_0x52e3('0x18')][_0x52e3('0x19')]({'raw':_0x5d55e7[_0x52e3('0x1a')]?_0x5d55e7[_0x52e3('0x1a')][_0x52e3('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d55e7[_0x52e3('0x1a')]?_0x5d55e7[_0x52e3('0x1a')][_0x52e3('0x1c')]||null:null,'attributes':_0x5d55e7[_0x52e3('0x1a')]?_0x5d55e7[_0x52e3('0x1a')][_0x52e3('0x1d')]||null:null,'limit':_0x5d55e7[_0x52e3('0x1a')]?_0x5d55e7['options']['limit']||null:null,'include':_0x5d55e7['options']?_0x5d55e7[_0x52e3('0x1a')]['include']?_['map'](_0x5d55e7['options'][_0x52e3('0x1e')],function(_0x54f571){return{'model':db[_0x54f571[_0x52e3('0x1f')]],'as':_0x54f571['as'],'attributes':_0x54f571['attributes'],'include':_0x54f571[_0x52e3('0x1e')]?_[_0x52e3('0x20')](_0x54f571['include'],function(_0x3eefb3){return{'model':db[_0x3eefb3[_0x52e3('0x1f')]],'as':_0x3eefb3['as'],'attributes':_0x3eefb3[_0x52e3('0x1d')],'include':_0x3eefb3[_0x52e3('0x1e')]?_['map'](_0x3eefb3['include'],function(_0x5ded78){return{'model':db[_0x5ded78[_0x52e3('0x1f')]],'as':_0x5ded78['as'],'attributes':_0x5ded78[_0x52e3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x52e3('0xc')](function(_0x701259){logger[_0x52e3('0xd')]('GetCampaign',_0x5d55e7);logger[_0x52e3('0xf')]('GetCampaign',_0x5d55e7,JSON[_0x52e3('0x11')](_0x701259));_0x2e82e2(_0x701259);})[_0x52e3('0x16')](function(_0x2ceaa4){logger[_0x52e3('0x12')]('GetCampaign',_0x2ceaa4[_0x52e3('0x14')],_0x5d55e7);_0x1ed787(_0x3088a2[_0x52e3('0x12')](0x1f4,_0x2ceaa4['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index df5f761..99cfd52 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 _0x0642=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','post','create','/:id/clone','clone','addLists','/:id/blacklists','update','delete','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x0642,0x1dc));var _0x2064=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x0642[_0x365be9];return _0x185c12;};'use strict';var multer=require(_0x2064('0x0'));var util=require('util');var path=require(_0x2064('0x1'));var timeout=require(_0x2064('0x2'));var express=require(_0x2064('0x3'));var router=express[_0x2064('0x4')]();var fs_extra=require(_0x2064('0x5'));var auth=require(_0x2064('0x6'));var interaction=require(_0x2064('0x7'));var config=require(_0x2064('0x8'));var controller=require('./campaign.controller');router[_0x2064('0x9')]('/',auth[_0x2064('0xa')](),controller[_0x2064('0xb')]);router[_0x2064('0x9')](_0x2064('0xc'),auth[_0x2064('0xa')](),controller['show']);router[_0x2064('0x9')](_0x2064('0xd'),auth[_0x2064('0xa')](),controller[_0x2064('0xe')]);router[_0x2064('0x9')](_0x2064('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x2064('0x9')]('/:id/hopper_finals',auth[_0x2064('0xa')](),controller[_0x2064('0x10')]);router[_0x2064('0x9')](_0x2064('0x11'),auth[_0x2064('0xa')](),controller['getHopperBlacks']);router['get'](_0x2064('0x12'),auth[_0x2064('0xa')](),controller['getLists']);router[_0x2064('0x9')]('/:id/blacklists',auth[_0x2064('0xa')](),controller['getBlackLists']);router[_0x2064('0x13')]('/',auth['isAuthenticated'](),controller[_0x2064('0x14')]);router[_0x2064('0x13')](_0x2064('0x15'),auth[_0x2064('0xa')](),controller[_0x2064('0x16')]);router[_0x2064('0x13')](_0x2064('0x12'),auth['isAuthenticated'](),controller[_0x2064('0x17')]);router[_0x2064('0x13')](_0x2064('0x18'),auth[_0x2064('0xa')](),controller['addBlackLists']);router['put'](_0x2064('0xc'),auth[_0x2064('0xa')](),controller[_0x2064('0x19')]);router[_0x2064('0x1a')](_0x2064('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2064('0x1a')](_0x2064('0x12'),auth['isAuthenticated'](),controller[_0x2064('0x1b')]);router[_0x2064('0x1a')]('/:id/blacklists',auth[_0x2064('0xa')](),controller[_0x2064('0x1c')]);module[_0x2064('0x1d')]=router; \ No newline at end of file +var _0xb18e=['getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists'];(function(_0x3aaf69,_0x318ff9){var _0x4542c6=function(_0x5d1369){while(--_0x5d1369){_0x3aaf69['push'](_0x3aaf69['shift']());}};_0x4542c6(++_0x318ff9);}(_0xb18e,0x199));var _0xeb18=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0xb18e[_0x4a6cf8];return _0x22205e;};'use strict';var multer=require(_0xeb18('0x0'));var util=require(_0xeb18('0x1'));var path=require('path');var timeout=require(_0xeb18('0x2'));var express=require('express');var router=express[_0xeb18('0x3')]();var fs_extra=require(_0xeb18('0x4'));var auth=require(_0xeb18('0x5'));var interaction=require(_0xeb18('0x6'));var config=require('../../config/environment');var controller=require(_0xeb18('0x7'));router[_0xeb18('0x8')]('/',auth[_0xeb18('0x9')](),controller[_0xeb18('0xa')]);router[_0xeb18('0x8')](_0xeb18('0xb'),auth[_0xeb18('0x9')](),controller['show']);router[_0xeb18('0x8')](_0xeb18('0xc'),auth[_0xeb18('0x9')](),controller[_0xeb18('0xd')]);router[_0xeb18('0x8')](_0xeb18('0xe'),auth[_0xeb18('0x9')](),controller[_0xeb18('0xf')]);router['get'](_0xeb18('0x10'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x11')]);router[_0xeb18('0x8')](_0xeb18('0x12'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x13')]);router[_0xeb18('0x8')](_0xeb18('0x14'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x15')]);router[_0xeb18('0x8')](_0xeb18('0x16'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x17')]);router[_0xeb18('0x18')]('/',auth[_0xeb18('0x9')](),controller[_0xeb18('0x19')]);router['post'](_0xeb18('0x1a'),auth['isAuthenticated'](),controller[_0xeb18('0x1b')]);router['post'](_0xeb18('0x14'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x1c')]);router['post'](_0xeb18('0x16'),auth['isAuthenticated'](),controller[_0xeb18('0x1d')]);router[_0xeb18('0x1e')](_0xeb18('0xb'),auth[_0xeb18('0x9')](),controller['update']);router['delete'](_0xeb18('0xb'),auth['isAuthenticated'](),controller[_0xeb18('0x1f')]);router[_0xeb18('0x20')](_0xeb18('0x14'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x21')]);router[_0xeb18('0x20')](_0xeb18('0x16'),auth[_0xeb18('0x9')](),controller[_0xeb18('0x22')]);module[_0xeb18('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f8fa8e5..973c61d 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 _0x2599=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2599,0xf5));var _0x9259=function(_0x559897,_0x2eda50){_0x559897=_0x559897-0x0;var _0x56320e=_0x2599[_0x559897];return _0x56320e;};'use strict';var Sequelize=require(_0x9259('0x0'));module[_0x9259('0x1')]={'key':{'type':Sequelize[_0x9259('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9259('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9259('0x2')]},'name':{'type':Sequelize[_0x9259('0x4')],'get':function(){return this[_0x9259('0x5')](_0x9259('0x6'));}}}; \ No newline at end of file +var _0xbbb5=['VIRTUAL','getDataValue','key','exports','STRING','TEXT'];(function(_0x41a7b5,_0xaf3bad){var _0x7605dd=function(_0x267987){while(--_0x267987){_0x41a7b5['push'](_0x41a7b5['shift']());}};_0x7605dd(++_0xaf3bad);}(_0xbbb5,0x12f));var _0x5bbb=function(_0x23fc1a,_0x1a575d){_0x23fc1a=_0x23fc1a-0x0;var _0x27810b=_0xbbb5[_0x23fc1a];return _0x27810b;};'use strict';var Sequelize=require('sequelize');module[_0x5bbb('0x0')]={'key':{'type':Sequelize[_0x5bbb('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x5bbb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5bbb('0x1')]},'name':{'type':Sequelize[_0x5bbb('0x3')],'get':function(){return this[_0x5bbb('0x4')](_0x5bbb('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 8842b61..f87c60c 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 _0xa82a=['params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','rows','catch','attributes','include','body','find'];(function(_0x41efcf,_0x1dac15){var _0xb06961=function(_0x293f97){while(--_0x293f97){_0x41efcf['push'](_0x41efcf['shift']());}};_0xb06961(++_0x1dac15);}(_0xa82a,0x1c6));var _0xaa82=function(_0x44b5ec,_0x290eff){_0x44b5ec=_0x44b5ec-0x0;var _0x17e60a=_0xa82a[_0x44b5ec];return _0x17e60a;};'use strict';var emlformat=require(_0xaa82('0x0'));var rimraf=require(_0xaa82('0x1'));var zipdir=require(_0xaa82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa82('0x3'));var BPromise=require(_0xaa82('0x4'));var Mustache=require(_0xaa82('0x5'));var util=require(_0xaa82('0x6'));var path=require(_0xaa82('0x7'));var sox=require(_0xaa82('0x8'));var csv=require(_0xaa82('0x9'));var ejs=require(_0xaa82('0xa'));var fs=require('fs');var fs_extra=require(_0xaa82('0xb'));var _=require(_0xaa82('0xc'));var squel=require(_0xaa82('0xd'));var crypto=require(_0xaa82('0xe'));var jsforce=require(_0xaa82('0xf'));var deskjs=require(_0xaa82('0x10'));var toCsv=require('to-csv');var querystring=require(_0xaa82('0x11'));var Papa=require('papaparse');var Redis=require(_0xaa82('0x12'));var authService=require(_0xaa82('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xaa82('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa82('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xaa82('0x16'));var licenseUtil=require(_0xaa82('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x258c78,_0x13674f){_0x13674f=_0x13674f||0xcc;return function(_0x4646f6){if(_0x4646f6){return _0x258c78[_0xaa82('0x18')](_0x13674f);}return _0x258c78[_0xaa82('0x19')](_0x13674f)[_0xaa82('0x1a')]();};}function respondWithResult(_0x4f9146,_0x4ba03c){_0x4ba03c=_0x4ba03c||0xc8;return function(_0x209fb0){if(_0x209fb0){return _0x4f9146['status'](_0x4ba03c)[_0xaa82('0x1b')](_0x209fb0);}};}function respondWithFilteredResult(_0x44ec26,_0x568457){return function(_0x414bc2){if(_0x414bc2){var _0x405381=typeof _0x568457['offset']===_0xaa82('0x1c')&&typeof _0x568457['limit']==='undefined';var _0x13a12b=_0x414bc2['count'];var _0x410fc5=_0x405381?0x0:_0x568457[_0xaa82('0x1d')];var _0x388e0a=_0x405381?_0x414bc2[_0xaa82('0x1e')]:_0x568457[_0xaa82('0x1d')]+_0x568457['limit'];var _0x404c8d;if(_0x388e0a>=_0x13a12b){_0x388e0a=_0x13a12b;_0x404c8d=0xc8;}else{_0x404c8d=0xce;}_0x44ec26[_0xaa82('0x19')](_0x404c8d);return _0x44ec26[_0xaa82('0x1f')](_0xaa82('0x20'),_0x410fc5+'-'+_0x388e0a+'/'+_0x13a12b)[_0xaa82('0x1b')](_0x414bc2);}return null;};}function patchUpdates(_0x376a82){return function(_0x4f794d){try{jsonpatch[_0xaa82('0x21')](_0x4f794d,_0x376a82,!![]);}catch(_0x5c8b55){return BPromise[_0xaa82('0x22')](_0x5c8b55);}return _0x4f794d['save']();};}function saveUpdates(_0x2f3802,_0x1a7a62){return function(_0x1a2964){if(_0x1a2964){return _0x1a2964[_0xaa82('0x23')](_0x2f3802)[_0xaa82('0x24')](function(_0xde7f72){return _0xde7f72;});}return null;};}function removeEntity(_0x153aff,_0x2dcf7a){return function(_0x4f821e){if(_0x4f821e){return _0x4f821e[_0xaa82('0x25')]()[_0xaa82('0x24')](function(){var _0x1072a8=_0x4f821e[_0xaa82('0x26')]({'plain':!![]});var _0x15ae5e=_0xaa82('0x27');return db['UserProfileResource'][_0xaa82('0x25')]({'where':{'type':_0x15ae5e,'resourceId':_0x1072a8['id']}})[_0xaa82('0x24')](function(){return _0x4f821e;});})[_0xaa82('0x24')](function(){_0x153aff[_0xaa82('0x19')](0xcc)[_0xaa82('0x1a')]();});}};}function handleEntityNotFound(_0x2c02bd,_0x1ccaa6){return function(_0x2b18b6){if(!_0x2b18b6){_0x2c02bd[_0xaa82('0x18')](0x194);}return _0x2b18b6;};}function handleError(_0x5cc2e2,_0x4cad5e){_0x4cad5e=_0x4cad5e||0x1f4;return function(_0xfd97c5){logger[_0xaa82('0x28')](_0xfd97c5['stack']);if(_0xfd97c5[_0xaa82('0x29')]){delete _0xfd97c5['name'];}_0x5cc2e2[_0xaa82('0x19')](_0x4cad5e)[_0xaa82('0x2a')](_0xfd97c5);};}exports[_0xaa82('0x2b')]=function(_0x494f4e,_0xadb1c5){var _0x1a2227={},_0x5af62b={},_0x5eeda5={'count':0x0,'rows':[]};var _0x3bbfcc=_[_0xaa82('0x2c')](db[_0xaa82('0x2d')][_0xaa82('0x2e')],function(_0x4a3f6f){return{'name':_0x4a3f6f[_0xaa82('0x2f')],'type':_0x4a3f6f[_0xaa82('0x30')][_0xaa82('0x31')]};});_0x5af62b[_0xaa82('0x32')]=_[_0xaa82('0x2c')](_0x3bbfcc,_0xaa82('0x29'));_0x5af62b[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x494f4e['query']);_0x5af62b['filters']=_[_0xaa82('0x35')](_0x5af62b[_0xaa82('0x32')],_0x5af62b[_0xaa82('0x33')]);_0x1a2227['attributes']=_[_0xaa82('0x35')](_0x5af62b[_0xaa82('0x32')],qs[_0xaa82('0x36')](_0x494f4e[_0xaa82('0x33')][_0xaa82('0x36')]));_0x1a2227['attributes']=_0x1a2227['attributes'][_0xaa82('0x37')]?_0x1a2227['attributes']:_0x5af62b[_0xaa82('0x32')];if(!_0x494f4e[_0xaa82('0x33')][_0xaa82('0x38')](_0xaa82('0x39'))){_0x1a2227[_0xaa82('0x3a')]=qs[_0xaa82('0x3a')](_0x494f4e[_0xaa82('0x33')][_0xaa82('0x3a')]);_0x1a2227[_0xaa82('0x1d')]=qs[_0xaa82('0x1d')](_0x494f4e['query'][_0xaa82('0x1d')]);}_0x1a2227[_0xaa82('0x3b')]=qs[_0xaa82('0x3c')](_0x494f4e[_0xaa82('0x33')][_0xaa82('0x3c')]);_0x1a2227[_0xaa82('0x3d')]=qs[_0xaa82('0x3e')](_[_0xaa82('0x3f')](_0x494f4e[_0xaa82('0x33')],_0x5af62b[_0xaa82('0x3e')]),_0x3bbfcc);if(_0x494f4e['query'][_0xaa82('0x40')]){_0x1a2227['where']=_['merge'](_0x1a2227[_0xaa82('0x3d')],{'$or':[{'key':{'$like':'%'+_0x494f4e[_0xaa82('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x494f4e['query'][_0xaa82('0x40')]+'%'}}]});}_0x1a2227=_[_0xaa82('0x41')]({},_0x1a2227,_0x494f4e[_0xaa82('0x42')]);var _0x5accb8={'where':_0x1a2227[_0xaa82('0x3d')]};return db[_0xaa82('0x2d')][_0xaa82('0x1e')](_0x5accb8)[_0xaa82('0x24')](function(_0x503eb7){_0x5eeda5[_0xaa82('0x1e')]=_0x503eb7;if(_0x494f4e['query'][_0xaa82('0x43')]){_0x1a2227['include']=[{'all':!![]}];}return db[_0xaa82('0x2d')]['findAll'](_0x1a2227);})['then'](function(_0x264079){_0x5eeda5[_0xaa82('0x44')]=_0x264079;return _0x5eeda5;})[_0xaa82('0x24')](respondWithFilteredResult(_0xadb1c5,_0x1a2227))[_0xaa82('0x45')](handleError(_0xadb1c5,null));};exports['show']=function(_0x111131,_0x1fd468){var _0x3ad60b={'raw':!![],'where':{'id':_0x111131['params']['id']}},_0x246f43={};_0x246f43[_0xaa82('0x32')]=_[_0xaa82('0x34')](db[_0xaa82('0x2d')][_0xaa82('0x2e')]);_0x246f43[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x111131[_0xaa82('0x33')]);_0x246f43['filters']=_[_0xaa82('0x35')](_0x246f43[_0xaa82('0x32')],_0x246f43[_0xaa82('0x33')]);_0x3ad60b[_0xaa82('0x46')]=_[_0xaa82('0x35')](_0x246f43[_0xaa82('0x32')],qs[_0xaa82('0x36')](_0x111131[_0xaa82('0x33')][_0xaa82('0x36')]));_0x3ad60b[_0xaa82('0x46')]=_0x3ad60b[_0xaa82('0x46')]['length']?_0x3ad60b[_0xaa82('0x46')]:_0x246f43['model'];if(_0x111131[_0xaa82('0x33')][_0xaa82('0x43')]){_0x3ad60b[_0xaa82('0x47')]=[{'all':!![]}];}_0x3ad60b=_['merge']({},_0x3ad60b,_0x111131['options']);return db[_0xaa82('0x2d')]['find'](_0x3ad60b)[_0xaa82('0x24')](handleEntityNotFound(_0x1fd468,null))[_0xaa82('0x24')](respondWithResult(_0x1fd468,null))[_0xaa82('0x45')](handleError(_0x1fd468,null));};exports[_0xaa82('0x23')]=function(_0xea8077,_0x3db082){if(_0xea8077['body']['id']){delete _0xea8077[_0xaa82('0x48')]['id'];}return db['CannedAnswer'][_0xaa82('0x49')]({'where':{'id':_0xea8077[_0xaa82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3db082,null))[_0xaa82('0x24')](saveUpdates(_0xea8077[_0xaa82('0x48')],null))[_0xaa82('0x24')](respondWithResult(_0x3db082,null))[_0xaa82('0x45')](handleError(_0x3db082,null));};exports['destroy']=function(_0x3a1632,_0x1ec1da){return db[_0xaa82('0x2d')][_0xaa82('0x49')]({'where':{'id':_0x3a1632['params']['id']}})[_0xaa82('0x24')](handleEntityNotFound(_0x1ec1da,null))['then'](removeEntity(_0x1ec1da,null))[_0xaa82('0x45')](handleError(_0x1ec1da,null));};exports[_0xaa82('0x4b')]=function(_0x334933,_0x5221ce){var _0x4342ca={'key':_0x334933[_0xaa82('0x48')][_0xaa82('0x31')]};if(_0x334933['body'][_0xaa82('0x4c')]){_0x4342ca[_0xaa82('0x4c')]=_0x334933[_0xaa82('0x48')][_0xaa82('0x4c')];}else if(_0x334933[_0xaa82('0x48')][_0xaa82('0x4d')]){_0x4342ca['SmsAccountId']=_0x334933['body'][_0xaa82('0x4d')];}else if(_0x334933[_0xaa82('0x48')]['OpenchannelAccountId']){_0x4342ca['OpenchannelAccountId']=_0x334933[_0xaa82('0x48')][_0xaa82('0x4e')];}else if(_0x334933[_0xaa82('0x48')][_0xaa82('0x4f')]){_0x4342ca[_0xaa82('0x4f')]=_0x334933[_0xaa82('0x48')][_0xaa82('0x4f')];}return db[_0xaa82('0x2d')]['find']({'where':_0x4342ca})[_0xaa82('0x24')](function(_0x3d8310){if(_0x3d8310){throw new db[(_0xaa82('0x50'))][(_0xaa82('0x51'))](_0xaa82('0x52'));}return db[_0xaa82('0x2d')][_0xaa82('0x4b')](_0x334933[_0xaa82('0x48')]);})[_0xaa82('0x24')](function(_0x42048f){var _0x1684f6=_0x334933[_0xaa82('0x53')][_0xaa82('0x26')]({'plain':!![]});if(!_0x1684f6)throw new Error(_0xaa82('0x54'));if(_0x1684f6['role']===_0xaa82('0x53')){var _0x4d30a5=_0x42048f[_0xaa82('0x26')]({'plain':!![]});return db[_0xaa82('0x55')]['find']({'where':{'name':_0xaa82('0x27'),'userProfileId':_0x1684f6[_0xaa82('0x56')]},'raw':!![]})[_0xaa82('0x24')](function(_0x58a32f){if(_0x58a32f&&_0x58a32f['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa82('0x4b')]({'name':_0x4d30a5[_0xaa82('0x29')],'resourceId':_0x4d30a5['id'],'type':_0x58a32f[_0xaa82('0x29')],'sectionId':_0x58a32f['id']},{})[_0xaa82('0x24')](function(){return _0x42048f;});}else{return _0x42048f;}})['catch'](function(_0x5bf896){logger[_0xaa82('0x28')](_0xaa82('0x57'),_0x5bf896);throw _0x5bf896;});}return _0x42048f;})[_0xaa82('0x24')](respondWithResult(_0x5221ce,0xc9))[_0xaa82('0x45')](handleError(_0x5221ce,null));}; \ No newline at end of file +var _0xb086=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','get','CannedAnswers','stack','name','send','map','CannedAnswer','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error'];(function(_0x26f9a5,_0x3f7060){var _0x28b617=function(_0x209133){while(--_0x209133){_0x26f9a5['push'](_0x26f9a5['shift']());}};_0x28b617(++_0x3f7060);}(_0xb086,0x1a5));var _0x6b08=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb086[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6b08('0x0'));var jsonpatch=require(_0x6b08('0x1'));var rp=require(_0x6b08('0x2'));var moment=require('moment');var BPromise=require(_0x6b08('0x3'));var Mustache=require(_0x6b08('0x4'));var util=require(_0x6b08('0x5'));var path=require(_0x6b08('0x6'));var sox=require(_0x6b08('0x7'));var csv=require(_0x6b08('0x8'));var ejs=require(_0x6b08('0x9'));var fs=require('fs');var fs_extra=require(_0x6b08('0xa'));var _=require(_0x6b08('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b08('0xc'));var deskjs=require(_0x6b08('0xd'));var toCsv=require(_0x6b08('0x8'));var querystring=require('querystring');var Papa=require(_0x6b08('0xe'));var Redis=require(_0x6b08('0xf'));var authService=require(_0x6b08('0x10'));var qs=require(_0x6b08('0x11'));var as=require(_0x6b08('0x12'));var hardwareService=require(_0x6b08('0x13'));var logger=require(_0x6b08('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b08('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x747810,_0x18280b){_0x18280b=_0x18280b||0xcc;return function(_0x96db68){if(_0x96db68){return _0x747810[_0x6b08('0x16')](_0x18280b);}return _0x747810['status'](_0x18280b)['end']();};}function respondWithResult(_0x1c39f1,_0x264800){_0x264800=_0x264800||0xc8;return function(_0x1ac5c6){if(_0x1ac5c6){return _0x1c39f1[_0x6b08('0x17')](_0x264800)[_0x6b08('0x18')](_0x1ac5c6);}};}function respondWithFilteredResult(_0x18bdeb,_0x5aafd3){return function(_0x438f7d){if(_0x438f7d){var _0x3c5088=typeof _0x5aafd3['offset']===_0x6b08('0x19')&&typeof _0x5aafd3[_0x6b08('0x1a')]==='undefined';var _0x113faf=_0x438f7d[_0x6b08('0x1b')];var _0x1675fc=_0x3c5088?0x0:_0x5aafd3[_0x6b08('0x1c')];var _0x17786e=_0x3c5088?_0x438f7d[_0x6b08('0x1b')]:_0x5aafd3[_0x6b08('0x1c')]+_0x5aafd3[_0x6b08('0x1a')];var _0x3caf8c;if(_0x17786e>=_0x113faf){_0x17786e=_0x113faf;_0x3caf8c=0xc8;}else{_0x3caf8c=0xce;}_0x18bdeb[_0x6b08('0x17')](_0x3caf8c);return _0x18bdeb['set'](_0x6b08('0x1d'),_0x1675fc+'-'+_0x17786e+'/'+_0x113faf)['json'](_0x438f7d);}return null;};}function patchUpdates(_0x34d15f){return function(_0xf41b3b){try{jsonpatch['apply'](_0xf41b3b,_0x34d15f,!![]);}catch(_0x404085){return BPromise[_0x6b08('0x1e')](_0x404085);}return _0xf41b3b[_0x6b08('0x1f')]();};}function saveUpdates(_0x18ca7d,_0x17d59e){return function(_0x3ab484){if(_0x3ab484){return _0x3ab484[_0x6b08('0x20')](_0x18ca7d)[_0x6b08('0x21')](function(_0x2f2269){return _0x2f2269;});}return null;};}function removeEntity(_0x4c256c,_0x47c0a8){return function(_0x310c70){if(_0x310c70){return _0x310c70['destroy']()[_0x6b08('0x21')](function(){var _0x4a236d=_0x310c70[_0x6b08('0x22')]({'plain':!![]});var _0x274853=_0x6b08('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x274853,'resourceId':_0x4a236d['id']}})[_0x6b08('0x21')](function(){return _0x310c70;});})[_0x6b08('0x21')](function(){_0x4c256c[_0x6b08('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x324d35,_0x138e17){return function(_0x573257){if(!_0x573257){_0x324d35[_0x6b08('0x16')](0x194);}return _0x573257;};}function handleError(_0x5d8f84,_0xa882c6){_0xa882c6=_0xa882c6||0x1f4;return function(_0x1d95ab){logger['error'](_0x1d95ab[_0x6b08('0x24')]);if(_0x1d95ab[_0x6b08('0x25')]){delete _0x1d95ab[_0x6b08('0x25')];}_0x5d8f84['status'](_0xa882c6)[_0x6b08('0x26')](_0x1d95ab);};}exports['index']=function(_0x3f3e20,_0x177bd5){var _0x2084d9={},_0x4009ac={},_0x462559={'count':0x0,'rows':[]};var _0x31eed5=_[_0x6b08('0x27')](db[_0x6b08('0x28')]['rawAttributes'],function(_0x517df1){return{'name':_0x517df1[_0x6b08('0x29')],'type':_0x517df1['type']['key']};});_0x4009ac['model']=_[_0x6b08('0x27')](_0x31eed5,'name');_0x4009ac[_0x6b08('0x2a')]=_[_0x6b08('0x2b')](_0x3f3e20[_0x6b08('0x2a')]);_0x4009ac[_0x6b08('0x2c')]=_[_0x6b08('0x2d')](_0x4009ac[_0x6b08('0x2e')],_0x4009ac[_0x6b08('0x2a')]);_0x2084d9[_0x6b08('0x2f')]=_[_0x6b08('0x2d')](_0x4009ac['model'],qs[_0x6b08('0x30')](_0x3f3e20[_0x6b08('0x2a')][_0x6b08('0x30')]));_0x2084d9[_0x6b08('0x2f')]=_0x2084d9[_0x6b08('0x2f')][_0x6b08('0x31')]?_0x2084d9[_0x6b08('0x2f')]:_0x4009ac[_0x6b08('0x2e')];if(!_0x3f3e20['query'][_0x6b08('0x32')](_0x6b08('0x33'))){_0x2084d9[_0x6b08('0x1a')]=qs[_0x6b08('0x1a')](_0x3f3e20[_0x6b08('0x2a')][_0x6b08('0x1a')]);_0x2084d9[_0x6b08('0x1c')]=qs['offset'](_0x3f3e20[_0x6b08('0x2a')][_0x6b08('0x1c')]);}_0x2084d9[_0x6b08('0x34')]=qs['sort'](_0x3f3e20[_0x6b08('0x2a')]['sort']);_0x2084d9[_0x6b08('0x35')]=qs[_0x6b08('0x2c')](_[_0x6b08('0x36')](_0x3f3e20[_0x6b08('0x2a')],_0x4009ac[_0x6b08('0x2c')]),_0x31eed5);if(_0x3f3e20[_0x6b08('0x2a')]['filter']){_0x2084d9[_0x6b08('0x35')]=_['merge'](_0x2084d9[_0x6b08('0x35')],{'$or':[{'key':{'$like':'%'+_0x3f3e20[_0x6b08('0x2a')][_0x6b08('0x37')]+'%'}},{'value':{'$like':'%'+_0x3f3e20[_0x6b08('0x2a')][_0x6b08('0x37')]+'%'}}]});}_0x2084d9=_[_0x6b08('0x38')]({},_0x2084d9,_0x3f3e20[_0x6b08('0x39')]);var _0x3e5f28={'where':_0x2084d9[_0x6b08('0x35')]};return db[_0x6b08('0x28')][_0x6b08('0x1b')](_0x3e5f28)[_0x6b08('0x21')](function(_0x1f2081){_0x462559[_0x6b08('0x1b')]=_0x1f2081;if(_0x3f3e20[_0x6b08('0x2a')][_0x6b08('0x3a')]){_0x2084d9[_0x6b08('0x3b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6b08('0x3c')](_0x2084d9);})[_0x6b08('0x21')](function(_0x1b49b2){_0x462559[_0x6b08('0x3d')]=_0x1b49b2;return _0x462559;})[_0x6b08('0x21')](respondWithFilteredResult(_0x177bd5,_0x2084d9))[_0x6b08('0x3e')](handleError(_0x177bd5,null));};exports['show']=function(_0x1c0d24,_0x18b727){var _0x5444b8={'raw':!![],'where':{'id':_0x1c0d24[_0x6b08('0x3f')]['id']}},_0x139f09={};_0x139f09[_0x6b08('0x2e')]=_[_0x6b08('0x2b')](db['CannedAnswer'][_0x6b08('0x40')]);_0x139f09[_0x6b08('0x2a')]=_[_0x6b08('0x2b')](_0x1c0d24[_0x6b08('0x2a')]);_0x139f09[_0x6b08('0x2c')]=_[_0x6b08('0x2d')](_0x139f09[_0x6b08('0x2e')],_0x139f09['query']);_0x5444b8[_0x6b08('0x2f')]=_[_0x6b08('0x2d')](_0x139f09[_0x6b08('0x2e')],qs[_0x6b08('0x30')](_0x1c0d24[_0x6b08('0x2a')]['fields']));_0x5444b8[_0x6b08('0x2f')]=_0x5444b8[_0x6b08('0x2f')][_0x6b08('0x31')]?_0x5444b8[_0x6b08('0x2f')]:_0x139f09['model'];if(_0x1c0d24[_0x6b08('0x2a')]['includeAll']){_0x5444b8[_0x6b08('0x3b')]=[{'all':!![]}];}_0x5444b8=_[_0x6b08('0x38')]({},_0x5444b8,_0x1c0d24[_0x6b08('0x39')]);return db['CannedAnswer'][_0x6b08('0x41')](_0x5444b8)['then'](handleEntityNotFound(_0x18b727,null))[_0x6b08('0x21')](respondWithResult(_0x18b727,null))[_0x6b08('0x3e')](handleError(_0x18b727,null));};exports['update']=function(_0x23d2e6,_0x1079f0){if(_0x23d2e6['body']['id']){delete _0x23d2e6[_0x6b08('0x42')]['id'];}return db[_0x6b08('0x28')][_0x6b08('0x41')]({'where':{'id':_0x23d2e6[_0x6b08('0x3f')]['id']}})[_0x6b08('0x21')](handleEntityNotFound(_0x1079f0,null))['then'](saveUpdates(_0x23d2e6[_0x6b08('0x42')],null))['then'](respondWithResult(_0x1079f0,null))['catch'](handleError(_0x1079f0,null));};exports[_0x6b08('0x43')]=function(_0x3a6fae,_0x28b5f8){return db['CannedAnswer'][_0x6b08('0x41')]({'where':{'id':_0x3a6fae['params']['id']}})[_0x6b08('0x21')](handleEntityNotFound(_0x28b5f8,null))[_0x6b08('0x21')](removeEntity(_0x28b5f8,null))[_0x6b08('0x3e')](handleError(_0x28b5f8,null));};exports[_0x6b08('0x44')]=function(_0x194987,_0x34710e){var _0x3634c6={'key':_0x194987[_0x6b08('0x42')]['key']};if(_0x194987[_0x6b08('0x42')][_0x6b08('0x45')]){_0x3634c6[_0x6b08('0x45')]=_0x194987[_0x6b08('0x42')][_0x6b08('0x45')];}else if(_0x194987[_0x6b08('0x42')][_0x6b08('0x46')]){_0x3634c6[_0x6b08('0x46')]=_0x194987[_0x6b08('0x42')]['SmsAccountId'];}else if(_0x194987[_0x6b08('0x42')][_0x6b08('0x47')]){_0x3634c6['OpenchannelAccountId']=_0x194987['body'][_0x6b08('0x47')];}else if(_0x194987[_0x6b08('0x42')][_0x6b08('0x48')]){_0x3634c6[_0x6b08('0x48')]=_0x194987[_0x6b08('0x42')][_0x6b08('0x48')];}return db[_0x6b08('0x28')][_0x6b08('0x41')]({'where':_0x3634c6})[_0x6b08('0x21')](function(_0x3846af){if(_0x3846af){throw new db[(_0x6b08('0x49'))][(_0x6b08('0x4a'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x6b08('0x28')][_0x6b08('0x44')](_0x194987[_0x6b08('0x42')]);})[_0x6b08('0x21')](function(_0x2b7a53){var _0x15e8c6=_0x194987[_0x6b08('0x4b')]['get']({'plain':!![]});if(!_0x15e8c6)throw new Error(_0x6b08('0x4c'));if(_0x15e8c6[_0x6b08('0x4d')]===_0x6b08('0x4b')){var _0x55bb3e=_0x2b7a53[_0x6b08('0x22')]({'plain':!![]});return db[_0x6b08('0x4e')][_0x6b08('0x41')]({'where':{'name':_0x6b08('0x23'),'userProfileId':_0x15e8c6[_0x6b08('0x4f')]},'raw':!![]})[_0x6b08('0x21')](function(_0x5c3ac3){if(_0x5c3ac3&&_0x5c3ac3[_0x6b08('0x50')]===0x0){return db[_0x6b08('0x51')][_0x6b08('0x44')]({'name':_0x55bb3e[_0x6b08('0x25')],'resourceId':_0x55bb3e['id'],'type':_0x5c3ac3[_0x6b08('0x25')],'sectionId':_0x5c3ac3['id']},{})[_0x6b08('0x21')](function(){return _0x2b7a53;});}else{return _0x2b7a53;}})[_0x6b08('0x3e')](function(_0xa92130){logger[_0x6b08('0x52')](_0x6b08('0x53'),_0xa92130);throw _0xa92130;});}return _0x2b7a53;})[_0x6b08('0x21')](respondWithResult(_0x34710e,0xc9))['catch'](handleError(_0x34710e,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 798a070..736c56c 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 _0x61bf=['rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3a6415,_0x4f862e){var _0xca3cee=function(_0xc3f9a2){while(--_0xc3f9a2){_0x3a6415['push'](_0x3a6415['shift']());}};_0xca3cee(++_0x4f862e);}(_0x61bf,0x96));var _0xf61b=function(_0x380f23,_0x23966f){_0x380f23=_0x380f23-0x0;var _0x3d3739=_0x61bf[_0x380f23];return _0x3d3739;};'use strict';var _=require(_0xf61b('0x0'));var util=require(_0xf61b('0x1'));var logger=require(_0xf61b('0x2'))(_0xf61b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf61b('0x4'));var fs=require('fs');var path=require(_0xf61b('0x5'));var rimraf=require(_0xf61b('0x6'));var config=require(_0xf61b('0x7'));var attributes=require(_0xf61b('0x8'));module['exports']=function(_0x27890a,_0x2ea32b){return _0x27890a[_0xf61b('0x9')](_0xf61b('0xa'),attributes,{'tableName':_0xf61b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf61b('0xc')});}; \ No newline at end of file +var _0x99d4=['CannedAnswer','tools_canned_answers','lodash','../../config/logger','bluebird','request-promise','./cannedAnswer.attributes','exports','define'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x99d4,0x122));var _0x499d=function(_0x424dd6,_0x445038){_0x424dd6=_0x424dd6-0x0;var _0x2c45b8=_0x99d4[_0x424dd6];return _0x2c45b8;};'use strict';var _=require(_0x499d('0x0'));var util=require('util');var logger=require(_0x499d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x499d('0x2'));var rp=require(_0x499d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x499d('0x4'));module[_0x499d('0x5')]=function(_0x4748bc,_0x53264c){return _0x4748bc[_0x499d('0x6')](_0x499d('0x7'),attributes,{'tableName':_0x499d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 36ec9bc..8a1c105 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(_0x28abed,_0xa821f8){var _0x5c553d=function(_0x336b38){while(--_0x336b38){_0x28abed['push'](_0x28abed['shift']());}};_0x5c553d(++_0xa821f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0x3d64c3,_0x3cbe40){var _0x5d5fe5=function(_0x119a6c){while(--_0x119a6c){_0x3d64c3['push'](_0x3d64c3['shift']());}};_0x5d5fe5(++_0x3cbe40);}(_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/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 21d5c94..f7dbf9e 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 _0xaabe=['isAuthenticated','index','get','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x1d3700,_0x1733b4){var _0xff118b=function(_0x21f403){while(--_0x21f403){_0x1d3700['push'](_0x1d3700['shift']());}};_0xff118b(++_0x1733b4);}(_0xaabe,0x14d));var _0xeaab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaabe[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeaab('0x0'));var util=require(_0xeaab('0x1'));var path=require(_0xeaab('0x2'));var timeout=require(_0xeaab('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeaab('0x4'));var auth=require(_0xeaab('0x5'));var interaction=require(_0xeaab('0x6'));var config=require(_0xeaab('0x7'));var controller=require(_0xeaab('0x8'));router['get']('/',auth[_0xeaab('0x9')](),controller[_0xeaab('0xa')]);router[_0xeaab('0xb')](_0xeaab('0xc'),auth[_0xeaab('0x9')](),controller[_0xeaab('0xd')]);router[_0xeaab('0xe')]('/',auth[_0xeaab('0x9')](),controller['create']);router['put']('/:id',auth[_0xeaab('0x9')](),controller['update']);router[_0xeaab('0xf')](_0xeaab('0xc'),auth[_0xeaab('0x9')](),controller[_0xeaab('0x10')]);module[_0xeaab('0x11')]=router; \ No newline at end of file +var _0x23df=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','post','create','put','/:id','update','delete','destroy','util','path','express'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x23df,0x10d));var _0xf23d=function(_0x1c8b0b,_0x8dd684){_0x1c8b0b=_0x1c8b0b-0x0;var _0x4da615=_0x23df[_0x1c8b0b];return _0x4da615;};'use strict';var multer=require('multer');var util=require(_0xf23d('0x0'));var path=require(_0xf23d('0x1'));var timeout=require('connect-timeout');var express=require(_0xf23d('0x2'));var router=express[_0xf23d('0x3')]();var fs_extra=require(_0xf23d('0x4'));var auth=require(_0xf23d('0x5'));var interaction=require(_0xf23d('0x6'));var config=require(_0xf23d('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf23d('0x8')]);router['get']('/:id',auth[_0xf23d('0x9')](),controller['show']);router[_0xf23d('0xa')]('/',auth[_0xf23d('0x9')](),controller[_0xf23d('0xb')]);router[_0xf23d('0xc')](_0xf23d('0xd'),auth['isAuthenticated'](),controller[_0xf23d('0xe')]);router[_0xf23d('0xf')]('/:id',auth[_0xf23d('0x9')](),controller[_0xf23d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b82c61d..8f20d18 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 _0x8523=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x9ccc2,_0x113514){var _0x2fdbc9=function(_0x40d45b){while(--_0x40d45b){_0x9ccc2['push'](_0x9ccc2['shift']());}};_0x2fdbc9(++_0x113514);}(_0x8523,0x65));var _0x3852=function(_0x1d49da,_0x4b8203){_0x1d49da=_0x1d49da-0x0;var _0x206b1d=_0x8523[_0x1d49da];return _0x206b1d;};'use strict';var Sequelize=require(_0x3852('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x3852('0x1')],'allowNull':![],'defaultValue':_0x3852('0x2')},'clid':{'type':Sequelize[_0x3852('0x3')]},'src':{'type':Sequelize[_0x3852('0x3')]},'dst':{'type':Sequelize[_0x3852('0x3')]},'dcontext':{'type':Sequelize[_0x3852('0x3')]},'channel':{'type':Sequelize[_0x3852('0x3')]},'dstchannel':{'type':Sequelize[_0x3852('0x3')]},'lastapp':{'type':Sequelize[_0x3852('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3852('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3852('0x3')]},'amaflags':{'type':Sequelize[_0x3852('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x3852('0x3')]},'uniqueid':{'type':Sequelize[_0x3852('0x3')]},'linkedid':{'type':Sequelize[_0x3852('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x3852('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x3852('0x3')]}}; \ No newline at end of file +var _0x4c48=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1e9cce,_0x293e1e){var _0x1f9284=function(_0x45ea51){while(--_0x45ea51){_0x1e9cce['push'](_0x1e9cce['shift']());}};_0x1f9284(++_0x293e1e);}(_0x4c48,0x1e4));var _0x84c4=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0x4c48[_0x576e2b];return _0x46461a;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x84c4('0x0')],'allowNull':![],'defaultValue':_0x84c4('0x1')},'clid':{'type':Sequelize[_0x84c4('0x2')]},'src':{'type':Sequelize[_0x84c4('0x2')]},'dst':{'type':Sequelize[_0x84c4('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x84c4('0x2')]},'lastapp':{'type':Sequelize[_0x84c4('0x2')]},'lastdata':{'type':Sequelize[_0x84c4('0x2')]},'duration':{'type':Sequelize[_0x84c4('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x84c4('0x2')]},'amaflags':{'type':Sequelize[_0x84c4('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x84c4('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x84c4('0x2')]},'peeraccount':{'type':Sequelize[_0x84c4('0x2')]},'type':{'type':Sequelize[_0x84c4('0x2')]},'tag':{'type':Sequelize[_0x84c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 8d8de64..252b0bb 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 _0xc7a3=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x3951b1,_0x1fa8f6){var _0x29b8d7=function(_0x514b22){while(--_0x514b22){_0x3951b1['push'](_0x3951b1['shift']());}};_0x29b8d7(++_0x1fa8f6);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x456907,_0x84e54b){_0x456907=_0x456907-0x0;var _0x54a030=_0xc7a3[_0x456907];return _0x54a030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c7a('0x0'));var zipdir=require(_0x3c7a('0x1'));var jsonpatch=require(_0x3c7a('0x2'));var rp=require(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var Mustache=require('mustache');var util=require(_0x3c7a('0x6'));var path=require(_0x3c7a('0x7'));var sox=require('sox');var csv=require(_0x3c7a('0x8'));var ejs=require(_0x3c7a('0x9'));var fs=require('fs');var fs_extra=require(_0x3c7a('0xa'));var _=require('lodash');var squel=require(_0x3c7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c7a('0x8'));var querystring=require(_0x3c7a('0xd'));var Papa=require(_0x3c7a('0xe'));var Redis=require('ioredis');var authService=require(_0x3c7a('0xf'));var qs=require(_0x3c7a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7a('0x11'));var logger=require('../../config/logger')(_0x3c7a('0x12'));var utils=require('../../config/utils');var config=require(_0x3c7a('0x13'));var licenseUtil=require(_0x3c7a('0x14'));var db=require(_0x3c7a('0x15'))['db'];function respondWithStatusCode(_0x16ea63,_0x3d47c3){_0x3d47c3=_0x3d47c3||0xcc;return function(_0x53e5d7){if(_0x53e5d7){return _0x16ea63[_0x3c7a('0x16')](_0x3d47c3);}return _0x16ea63[_0x3c7a('0x17')](_0x3d47c3)[_0x3c7a('0x18')]();};}function respondWithResult(_0x36185c,_0x24d188){_0x24d188=_0x24d188||0xc8;return function(_0x4e6ca5){if(_0x4e6ca5){return _0x36185c[_0x3c7a('0x17')](_0x24d188)[_0x3c7a('0x19')](_0x4e6ca5);}};}function respondWithFilteredResult(_0x5af0a6,_0x539270){return function(_0x3044e6){if(_0x3044e6){var _0xb9201c=typeof _0x539270[_0x3c7a('0x1a')]==='undefined'&&typeof _0x539270[_0x3c7a('0x1b')]==='undefined';var _0x74fd1e=_0x3044e6[_0x3c7a('0x1c')];var _0x36e8c2=_0xb9201c?0x0:_0x539270[_0x3c7a('0x1a')];var _0x3cb5bf=_0xb9201c?_0x3044e6[_0x3c7a('0x1c')]:_0x539270['offset']+_0x539270[_0x3c7a('0x1b')];var _0x2db9df;if(_0x3cb5bf>=_0x74fd1e){_0x3cb5bf=_0x74fd1e;_0x2db9df=0xc8;}else{_0x2db9df=0xce;}_0x5af0a6[_0x3c7a('0x17')](_0x2db9df);return _0x5af0a6[_0x3c7a('0x1d')](_0x3c7a('0x1e'),_0x36e8c2+'-'+_0x3cb5bf+'/'+_0x74fd1e)[_0x3c7a('0x19')](_0x3044e6);}return null;};}function patchUpdates(_0x11a06b){return function(_0x34f4a6){try{jsonpatch[_0x3c7a('0x1f')](_0x34f4a6,_0x11a06b,!![]);}catch(_0x544742){return BPromise[_0x3c7a('0x20')](_0x544742);}return _0x34f4a6['save']();};}function saveUpdates(_0x3c75ff,_0x557518){return function(_0x40d24e){if(_0x40d24e){return _0x40d24e[_0x3c7a('0x21')](_0x3c75ff)[_0x3c7a('0x22')](function(_0x7dbe38){return _0x7dbe38;});}return null;};}function removeEntity(_0x283568,_0x245dde){return function(_0x8251d4){if(_0x8251d4){return _0x8251d4[_0x3c7a('0x23')]()[_0x3c7a('0x22')](function(){_0x283568[_0x3c7a('0x17')](0xcc)[_0x3c7a('0x18')]();});}};}function handleEntityNotFound(_0x317fbd,_0x56539f){return function(_0x3984a1){if(!_0x3984a1){_0x317fbd[_0x3c7a('0x16')](0x194);}return _0x3984a1;};}function handleError(_0x37cc40,_0x3829de){_0x3829de=_0x3829de||0x1f4;return function(_0x9b910c){logger[_0x3c7a('0x24')](_0x9b910c[_0x3c7a('0x25')]);if(_0x9b910c[_0x3c7a('0x26')]){delete _0x9b910c['name'];}_0x37cc40[_0x3c7a('0x17')](_0x3829de)[_0x3c7a('0x27')](_0x9b910c);};}exports[_0x3c7a('0x28')]=function(_0x197012,_0x33065b){var _0x1a96a0={},_0xccf304={},_0x1ff595={'count':0x0,'rows':[]};var _0x508d2e=_[_0x3c7a('0x29')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')],function(_0x18a346){return{'name':_0x18a346[_0x3c7a('0x2c')],'type':_0x18a346[_0x3c7a('0x2d')][_0x3c7a('0x2e')]};});_0xccf304[_0x3c7a('0x2f')]=_[_0x3c7a('0x29')](_0x508d2e,_0x3c7a('0x26'));_0xccf304[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x197012[_0x3c7a('0x30')]);_0xccf304['filters']=_['intersection'](_0xccf304['model'],_0xccf304['query']);_0x1a96a0[_0x3c7a('0x32')]=_[_0x3c7a('0x33')](_0xccf304[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x1a96a0[_0x3c7a('0x32')]=_0x1a96a0[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x1a96a0[_0x3c7a('0x32')]:_0xccf304[_0x3c7a('0x2f')];if(!_0x197012[_0x3c7a('0x30')][_0x3c7a('0x36')](_0x3c7a('0x37'))){_0x1a96a0['limit']=qs[_0x3c7a('0x1b')](_0x197012[_0x3c7a('0x30')]['limit']);_0x1a96a0[_0x3c7a('0x1a')]=qs['offset'](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x1a')]);}_0x1a96a0['order']=qs[_0x3c7a('0x38')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x38')]);_0x1a96a0[_0x3c7a('0x39')]=qs[_0x3c7a('0x3a')](_[_0x3c7a('0x3b')](_0x197012[_0x3c7a('0x30')],_0xccf304[_0x3c7a('0x3a')]),_0x508d2e);if(_0x197012[_0x3c7a('0x30')][_0x3c7a('0x3c')]){_0x1a96a0['where']=_[_0x3c7a('0x3d')](_0x1a96a0[_0x3c7a('0x39')],{'$or':_[_0x3c7a('0x29')](_0x508d2e,function(_0x43c236){if(_0x43c236[_0x3c7a('0x2d')]!==_0x3c7a('0x3e')){var _0x101e5d={};_0x101e5d[_0x43c236[_0x3c7a('0x26')]]={'$like':'%'+_0x197012['query'][_0x3c7a('0x3c')]+'%'};return _0x101e5d;}})});}_0x1a96a0=_[_0x3c7a('0x3d')]({},_0x1a96a0,_0x197012['options']);var _0x442087={'where':_0x1a96a0['where']};return db['Cdr']['count'](_0x442087)['then'](function(_0x44e935){_0x1ff595[_0x3c7a('0x1c')]=_0x44e935;if(_0x197012[_0x3c7a('0x30')]['includeAll']){_0x1a96a0[_0x3c7a('0x3f')]=[{'all':!![]}];}return db[_0x3c7a('0x2a')]['findAll'](_0x1a96a0);})['then'](function(_0x491335){_0x1ff595[_0x3c7a('0x40')]=_0x491335;return _0x1ff595;})[_0x3c7a('0x22')](respondWithFilteredResult(_0x33065b,_0x1a96a0))[_0x3c7a('0x41')](handleError(_0x33065b,null));};exports[_0x3c7a('0x42')]=function(_0x8d805a,_0x3e6a70){var _0x3f6060={'raw':!![],'where':{'id':_0x8d805a[_0x3c7a('0x43')]['id']}},_0x302556={};_0x302556[_0x3c7a('0x2f')]=_[_0x3c7a('0x31')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')]);_0x302556[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x8d805a['query']);_0x302556[_0x3c7a('0x3a')]=_[_0x3c7a('0x33')](_0x302556['model'],_0x302556['query']);_0x3f6060['attributes']=_[_0x3c7a('0x33')](_0x302556[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x8d805a[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x3f6060[_0x3c7a('0x32')]=_0x3f6060[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x3f6060[_0x3c7a('0x32')]:_0x302556[_0x3c7a('0x2f')];if(_0x8d805a[_0x3c7a('0x30')]['includeAll']){_0x3f6060['include']=[{'all':!![]}];}_0x3f6060=_['merge']({},_0x3f6060,_0x8d805a[_0x3c7a('0x44')]);return db[_0x3c7a('0x2a')][_0x3c7a('0x45')](_0x3f6060)[_0x3c7a('0x22')](handleEntityNotFound(_0x3e6a70,null))[_0x3c7a('0x22')](respondWithResult(_0x3e6a70,null))['catch'](handleError(_0x3e6a70,null));};exports[_0x3c7a('0x46')]=function(_0x12b69a,_0x2eb9e2){return db[_0x3c7a('0x2a')][_0x3c7a('0x46')](_0x12b69a[_0x3c7a('0x47')],{})[_0x3c7a('0x22')](respondWithResult(_0x2eb9e2,0xc9))['catch'](handleError(_0x2eb9e2,null));};exports['update']=function(_0x420fa7,_0x350ea7){if(_0x420fa7[_0x3c7a('0x47')]['id']){delete _0x420fa7[_0x3c7a('0x47')]['id'];}return db[_0x3c7a('0x2a')][_0x3c7a('0x45')]({'where':{'id':_0x420fa7['params']['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x350ea7,null))['then'](saveUpdates(_0x420fa7['body'],null))[_0x3c7a('0x22')](respondWithResult(_0x350ea7,null))[_0x3c7a('0x41')](handleError(_0x350ea7,null));};exports[_0x3c7a('0x23')]=function(_0x50b5e4,_0x5759a0){return db['Cdr']['find']({'where':{'id':_0x50b5e4[_0x3c7a('0x43')]['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x5759a0,null))[_0x3c7a('0x22')](removeEntity(_0x5759a0,null))[_0x3c7a('0x41')](handleError(_0x5759a0,null));};exports[_0x3c7a('0x48')]=function(_0x11f7ee,_0x124411){return db[_0x3c7a('0x2a')][_0x3c7a('0x48')]()[_0x3c7a('0x22')](respondWithResult(_0x124411,null))[_0x3c7a('0x41')](handleError(_0x124411,null));}; \ No newline at end of file +var _0x3fa4=['model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','intersection','length','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key'];(function(_0x2c373f,_0x124285){var _0x38c34e=function(_0x578325){while(--_0x578325){_0x2c373f['push'](_0x2c373f['shift']());}};_0x38c34e(++_0x124285);}(_0x3fa4,0xf0));var _0x43fa=function(_0xaa4463,_0x5affd2){_0xaa4463=_0xaa4463-0x0;var _0x24a160=_0x3fa4[_0xaa4463];return _0x24a160;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];function respondWithStatusCode(_0x582ec2,_0xfbf89e){_0xfbf89e=_0xfbf89e||0xcc;return function(_0x4353c1){if(_0x4353c1){return _0x582ec2[_0x43fa('0x18')](_0xfbf89e);}return _0x582ec2['status'](_0xfbf89e)[_0x43fa('0x19')]();};}function respondWithResult(_0x4bb4b0,_0x5bc292){_0x5bc292=_0x5bc292||0xc8;return function(_0x4fba54){if(_0x4fba54){return _0x4bb4b0[_0x43fa('0x1a')](_0x5bc292)['json'](_0x4fba54);}};}function respondWithFilteredResult(_0x1a898a,_0x12ae9e){return function(_0x4a07b5){if(_0x4a07b5){var _0x27b87f=typeof _0x12ae9e[_0x43fa('0x1b')]===_0x43fa('0x1c')&&typeof _0x12ae9e[_0x43fa('0x1d')]===_0x43fa('0x1c');var _0x53c04c=_0x4a07b5['count'];var _0x479d81=_0x27b87f?0x0:_0x12ae9e[_0x43fa('0x1b')];var _0x29b8aa=_0x27b87f?_0x4a07b5[_0x43fa('0x1e')]:_0x12ae9e[_0x43fa('0x1b')]+_0x12ae9e[_0x43fa('0x1d')];var _0x15e594;if(_0x29b8aa>=_0x53c04c){_0x29b8aa=_0x53c04c;_0x15e594=0xc8;}else{_0x15e594=0xce;}_0x1a898a[_0x43fa('0x1a')](_0x15e594);return _0x1a898a[_0x43fa('0x1f')](_0x43fa('0x20'),_0x479d81+'-'+_0x29b8aa+'/'+_0x53c04c)['json'](_0x4a07b5);}return null;};}function patchUpdates(_0xfd8d3){return function(_0x551528){try{jsonpatch[_0x43fa('0x21')](_0x551528,_0xfd8d3,!![]);}catch(_0x319cfd){return BPromise[_0x43fa('0x22')](_0x319cfd);}return _0x551528['save']();};}function saveUpdates(_0x2c6075,_0x3c78fb){return function(_0x2db3dd){if(_0x2db3dd){return _0x2db3dd[_0x43fa('0x23')](_0x2c6075)[_0x43fa('0x24')](function(_0x1d3328){return _0x1d3328;});}return null;};}function removeEntity(_0x3b8cb9,_0x241948){return function(_0x427426){if(_0x427426){return _0x427426['destroy']()['then'](function(){_0x3b8cb9[_0x43fa('0x1a')](0xcc)[_0x43fa('0x19')]();});}};}function handleEntityNotFound(_0x28f695,_0x78f105){return function(_0x40969a){if(!_0x40969a){_0x28f695[_0x43fa('0x18')](0x194);}return _0x40969a;};}function handleError(_0x5014fb,_0x4f6101){_0x4f6101=_0x4f6101||0x1f4;return function(_0x1fa077){logger[_0x43fa('0x25')](_0x1fa077[_0x43fa('0x26')]);if(_0x1fa077[_0x43fa('0x27')]){delete _0x1fa077['name'];}_0x5014fb[_0x43fa('0x1a')](_0x4f6101)[_0x43fa('0x28')](_0x1fa077);};}exports[_0x43fa('0x29')]=function(_0x186249,_0x4d6c8c){var _0x3d5abd={},_0x44fdef={},_0x398c44={'count':0x0,'rows':[]};var _0x28b833=_[_0x43fa('0x2a')](db[_0x43fa('0x2b')][_0x43fa('0x2c')],function(_0x41a3cf){return{'name':_0x41a3cf[_0x43fa('0x2d')],'type':_0x41a3cf[_0x43fa('0x2e')][_0x43fa('0x2f')]};});_0x44fdef[_0x43fa('0x30')]=_['map'](_0x28b833,'name');_0x44fdef[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x186249[_0x43fa('0x31')]);_0x44fdef[_0x43fa('0x33')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],_0x44fdef[_0x43fa('0x31')]);_0x3d5abd[_0x43fa('0x34')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x186249[_0x43fa('0x31')][_0x43fa('0x35')]));_0x3d5abd['attributes']=_0x3d5abd[_0x43fa('0x34')]['length']?_0x3d5abd[_0x43fa('0x34')]:_0x44fdef[_0x43fa('0x30')];if(!_0x186249[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3d5abd['limit']=qs['limit'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3d5abd[_0x43fa('0x1b')]=qs['offset'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1b')]);}_0x3d5abd[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x186249[_0x43fa('0x31')]['sort']);_0x3d5abd[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x186249[_0x43fa('0x31')],_0x44fdef['filters']),_0x28b833);if(_0x186249['query'][_0x43fa('0x3b')]){_0x3d5abd[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x3d5abd[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x28b833,function(_0x595d49){if(_0x595d49[_0x43fa('0x2e')]!=='VIRTUAL'){var _0x4cb1bd={};_0x4cb1bd[_0x595d49[_0x43fa('0x27')]]={'$like':'%'+_0x186249['query'][_0x43fa('0x3b')]+'%'};return _0x4cb1bd;}})});}_0x3d5abd=_[_0x43fa('0x3c')]({},_0x3d5abd,_0x186249[_0x43fa('0x3d')]);var _0x17403c={'where':_0x3d5abd['where']};return db['Cdr']['count'](_0x17403c)[_0x43fa('0x24')](function(_0x15ef49){_0x398c44['count']=_0x15ef49;if(_0x186249[_0x43fa('0x31')][_0x43fa('0x3e')]){_0x3d5abd[_0x43fa('0x3f')]=[{'all':!![]}];}return db[_0x43fa('0x2b')]['findAll'](_0x3d5abd);})[_0x43fa('0x24')](function(_0x23e156){_0x398c44['rows']=_0x23e156;return _0x398c44;})['then'](respondWithFilteredResult(_0x4d6c8c,_0x3d5abd))[_0x43fa('0x40')](handleError(_0x4d6c8c,null));};exports['show']=function(_0x3a6d39,_0x137ef){var _0x5cef1e={'raw':!![],'where':{'id':_0x3a6d39['params']['id']}},_0x4735d1={};_0x4735d1[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x2b')]['rawAttributes']);_0x4735d1[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x3a6d39[_0x43fa('0x31')]);_0x4735d1[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x4735d1[_0x43fa('0x30')],_0x4735d1['query']);_0x5cef1e[_0x43fa('0x34')]=_['intersection'](_0x4735d1[_0x43fa('0x30')],qs['fields'](_0x3a6d39[_0x43fa('0x31')][_0x43fa('0x35')]));_0x5cef1e[_0x43fa('0x34')]=_0x5cef1e[_0x43fa('0x34')][_0x43fa('0x42')]?_0x5cef1e['attributes']:_0x4735d1[_0x43fa('0x30')];if(_0x3a6d39['query']['includeAll']){_0x5cef1e['include']=[{'all':!![]}];}_0x5cef1e=_[_0x43fa('0x3c')]({},_0x5cef1e,_0x3a6d39[_0x43fa('0x3d')]);return db[_0x43fa('0x2b')][_0x43fa('0x43')](_0x5cef1e)[_0x43fa('0x24')](handleEntityNotFound(_0x137ef,null))['then'](respondWithResult(_0x137ef,null))[_0x43fa('0x40')](handleError(_0x137ef,null));};exports[_0x43fa('0x44')]=function(_0x305e90,_0x19b0f0){return db[_0x43fa('0x2b')][_0x43fa('0x44')](_0x305e90[_0x43fa('0x45')],{})[_0x43fa('0x24')](respondWithResult(_0x19b0f0,0xc9))[_0x43fa('0x40')](handleError(_0x19b0f0,null));};exports[_0x43fa('0x23')]=function(_0x1ae6e0,_0x52d66f){if(_0x1ae6e0[_0x43fa('0x45')]['id']){delete _0x1ae6e0[_0x43fa('0x45')]['id'];}return db['Cdr'][_0x43fa('0x43')]({'where':{'id':_0x1ae6e0['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x52d66f,null))[_0x43fa('0x24')](saveUpdates(_0x1ae6e0[_0x43fa('0x45')],null))[_0x43fa('0x24')](respondWithResult(_0x52d66f,null))[_0x43fa('0x40')](handleError(_0x52d66f,null));};exports['destroy']=function(_0x1bbae4,_0x4a24f1){return db[_0x43fa('0x2b')][_0x43fa('0x43')]({'where':{'id':_0x1bbae4[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a24f1,null))['then'](removeEntity(_0x4a24f1,null))[_0x43fa('0x40')](handleError(_0x4a24f1,null));};exports['describe']=function(_0x2ca431,_0x574076){return db['Cdr'][_0x43fa('0x47')]()[_0x43fa('0x24')](respondWithResult(_0x574076,null))['catch'](handleError(_0x574076,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 34ffc28..d0093ed 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2c9dc4,_0x56ce90){var _0x251c32=function(_0xff054a){while(--_0xff054a){_0x2c9dc4['push'](_0x2c9dc4['shift']());}};_0x251c32(++_0x56ce90);}(_0x7a54,0x106));var _0x47a5=function(_0x332ac5,_0x2a2d4e){_0x332ac5=_0x332ac5-0x0;var _0xacf530=_0x7a54[_0x332ac5];return _0xacf530;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x20f85c,_0x48bebc){var _0x510c0d=function(_0x5b0542){while(--_0x5b0542){_0x20f85c['push'](_0x20f85c['shift']());}};_0x510c0d(++_0x48bebc);}(_0x7a54,0x106));var _0x47a5=function(_0x80fcd1,_0x8a4efd){_0x80fcd1=_0x80fcd1-0x0;var _0x1f0b45=_0x7a54[_0x80fcd1];return _0x1f0b45;};'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 71733ed..267fa9a 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 _0xa744=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4fe9d6,_0x1b1ec2){var _0xc8bcff=function(_0x561091){while(--_0x561091){_0x4fe9d6['push'](_0x4fe9d6['shift']());}};_0xc8bcff(++_0x1b1ec2);}(_0xa744,0x6b));var _0x4a74=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa744[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4a74('0x0'));var util=require(_0x4a74('0x1'));var moment=require(_0x4a74('0x2'));var BPromise=require(_0x4a74('0x3'));var rs=require(_0x4a74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a74('0x5'))['db'];var utils=require(_0x4a74('0x6'));var logger=require(_0x4a74('0x7'))(_0x4a74('0x8'));var config=require(_0x4a74('0x9'));var jayson=require(_0x4a74('0xa'));var client=jayson[_0x4a74('0xb')][_0x4a74('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fc0a2,_0x992869,_0x44eb0e){return new BPromise(function(_0x206569,_0x399295){return client['request'](_0x2fc0a2,_0x44eb0e)[_0x4a74('0xd')](function(_0x21f27e){logger[_0x4a74('0xe')]('Cdr,\x20%s,\x20%s',_0x992869,_0x4a74('0xf'));logger[_0x4a74('0x10')](_0x4a74('0x11'),_0x992869,_0x4a74('0xf'),JSON[_0x4a74('0x12')](_0x21f27e));if(_0x21f27e['error']){if(_0x21f27e[_0x4a74('0x13')]['code']===0x1f4){logger[_0x4a74('0x13')](_0x4a74('0x14'),_0x992869,_0x21f27e[_0x4a74('0x13')][_0x4a74('0x15')]);return _0x399295(_0x21f27e[_0x4a74('0x13')]['message']);}logger[_0x4a74('0x13')](_0x4a74('0x14'),_0x992869,_0x21f27e[_0x4a74('0x13')][_0x4a74('0x15')]);return _0x206569(_0x21f27e[_0x4a74('0x13')][_0x4a74('0x15')]);}else{logger['info'](_0x4a74('0x14'),_0x992869,'request\x20sent');_0x206569(_0x21f27e['result'][_0x4a74('0x15')]);}})[_0x4a74('0x16')](function(_0x594d12){logger['error'](_0x4a74('0x14'),_0x992869,_0x594d12);_0x399295(_0x594d12);});});} \ No newline at end of file +var _0xcf3c=['../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','Cdr,\x20%s,\x20%s','message','result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x328b9b,_0x13082a){var _0x3a2d51=function(_0x63002b){while(--_0x63002b){_0x328b9b['push'](_0x328b9b['shift']());}};_0x3a2d51(++_0x13082a);}(_0xcf3c,0xe4));var _0xccf3=function(_0x50a3be,_0x24b768){_0x50a3be=_0x50a3be-0x0;var _0x2ba753=_0xcf3c[_0x50a3be];return _0x2ba753;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xccf3('0x0'));var fs=require('fs');var Redis=require(_0xccf3('0x1'));var db=require(_0xccf3('0x2'))['db'];var utils=require(_0xccf3('0x3'));var logger=require(_0xccf3('0x4'))(_0xccf3('0x5'));var config=require(_0xccf3('0x6'));var jayson=require(_0xccf3('0x7'));var client=jayson[_0xccf3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13d1ec,_0xf1a6,_0x1549e4){return new BPromise(function(_0x38948d,_0x2942f5){return client[_0xccf3('0x9')](_0x13d1ec,_0x1549e4)['then'](function(_0x49370a){logger[_0xccf3('0xa')]('Cdr,\x20%s,\x20%s',_0xf1a6,_0xccf3('0xb'));logger[_0xccf3('0xc')](_0xccf3('0xd'),_0xf1a6,'request\x20sent',JSON['stringify'](_0x49370a));if(_0x49370a['error']){if(_0x49370a[_0xccf3('0xe')]['code']===0x1f4){logger[_0xccf3('0xe')](_0xccf3('0xf'),_0xf1a6,_0x49370a[_0xccf3('0xe')][_0xccf3('0x10')]);return _0x2942f5(_0x49370a[_0xccf3('0xe')][_0xccf3('0x10')]);}logger[_0xccf3('0xe')]('Cdr,\x20%s,\x20%s',_0xf1a6,_0x49370a[_0xccf3('0xe')][_0xccf3('0x10')]);return _0x38948d(_0x49370a[_0xccf3('0xe')]['message']);}else{logger[_0xccf3('0xa')](_0xccf3('0xf'),_0xf1a6,_0xccf3('0xb'));_0x38948d(_0x49370a[_0xccf3('0x11')]['message']);}})['catch'](function(_0x7d4c37){logger[_0xccf3('0xe')]('Cdr,\x20%s,\x20%s',_0xf1a6,_0x7d4c37);_0x2942f5(_0x7d4c37);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index c6bc8a1..8da8f15 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4ceb13,_0x5e70f7){var _0x11f6e7=function(_0x1ffe46){while(--_0x1ffe46){_0x4ceb13['push'](_0x4ceb13['shift']());}};_0x11f6e7(++_0x5e70f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x1df5cd,_0x3dc641){var _0xf6df9b=function(_0x3c5b96){while(--_0x3c5b96){_0x1df5cd['push'](_0x1df5cd['shift']());}};_0xf6df9b(++_0x3dc641);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 9844000..96422bc 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 _0x6f44=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0xbafb3d,_0x2aa7aa){var _0xa5595f=function(_0x26a0a3){while(--_0x26a0a3){_0xbafb3d['push'](_0xbafb3d['shift']());}};_0xa5595f(++_0x2aa7aa);}(_0x6f44,0xe0));var _0x46f4=function(_0x38ef92,_0x5e95df){_0x38ef92=_0x38ef92-0x0;var _0x250adc=_0x6f44[_0x38ef92];return _0x250adc;};'use strict';var Sequelize=require('sequelize');module[_0x46f4('0x0')]={'priority':{'type':Sequelize[_0x46f4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x46f4('0x2')],'allowNull':![],'defaultValue':_0x46f4('0x3')},'appdata':{'type':Sequelize[_0x46f4('0x4')]()},'description':{'type':Sequelize[_0x46f4('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x46f4('0x5')}}; \ No newline at end of file +var _0x50d7=['INTEGER','TEXT','STRING','sequelize','exports'];(function(_0x36d85a,_0x3ac438){var _0x2ef72b=function(_0x2b40a6){while(--_0x2b40a6){_0x36d85a['push'](_0x36d85a['shift']());}};_0x2ef72b(++_0x3ac438);}(_0x50d7,0x116));var _0x750d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x50d7[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x750d('0x0'));module[_0x750d('0x1')]={'priority':{'type':Sequelize[_0x750d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x750d('0x3')]()},'description':{'type':Sequelize[_0x750d('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 0f76398..f703b3d 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 _0x00b3=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','reject','save','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','ChatApplication'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x00b3,0x17a));var _0x300b=function(_0x4f2558,_0x5af2fe){_0x4f2558=_0x4f2558-0x0;var _0x42ee50=_0x00b3[_0x4f2558];return _0x42ee50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300b('0x0'));var zipdir=require(_0x300b('0x1'));var jsonpatch=require(_0x300b('0x2'));var rp=require(_0x300b('0x3'));var moment=require('moment');var BPromise=require(_0x300b('0x4'));var Mustache=require('mustache');var util=require(_0x300b('0x5'));var path=require('path');var sox=require(_0x300b('0x6'));var csv=require(_0x300b('0x7'));var ejs=require(_0x300b('0x8'));var fs=require('fs');var fs_extra=require(_0x300b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x300b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x300b('0x7'));var querystring=require(_0x300b('0xb'));var Papa=require(_0x300b('0xc'));var Redis=require('ioredis');var authService=require(_0x300b('0xd'));var qs=require(_0x300b('0xe'));var as=require(_0x300b('0xf'));var hardwareService=require(_0x300b('0x10'));var logger=require('../../config/logger')(_0x300b('0x11'));var utils=require(_0x300b('0x12'));var config=require(_0x300b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300b('0x14'))['db'];function respondWithStatusCode(_0xea95bb,_0x138efb){_0x138efb=_0x138efb||0xcc;return function(_0x40c03b){if(_0x40c03b){return _0xea95bb[_0x300b('0x15')](_0x138efb);}return _0xea95bb[_0x300b('0x16')](_0x138efb)[_0x300b('0x17')]();};}function respondWithResult(_0x10bb41,_0x58746b){_0x58746b=_0x58746b||0xc8;return function(_0x54c3ee){if(_0x54c3ee){return _0x10bb41['status'](_0x58746b)['json'](_0x54c3ee);}};}function respondWithFilteredResult(_0x44e61b,_0x26c0e5){return function(_0xfb49f){if(_0xfb49f){var _0xd252fa=typeof _0x26c0e5['offset']==='undefined'&&typeof _0x26c0e5[_0x300b('0x18')]===_0x300b('0x19');var _0x2fed99=_0xfb49f[_0x300b('0x1a')];var _0x4d2024=_0xd252fa?0x0:_0x26c0e5[_0x300b('0x1b')];var _0x2a7d96=_0xd252fa?_0xfb49f[_0x300b('0x1a')]:_0x26c0e5['offset']+_0x26c0e5[_0x300b('0x18')];var _0x10174b;if(_0x2a7d96>=_0x2fed99){_0x2a7d96=_0x2fed99;_0x10174b=0xc8;}else{_0x10174b=0xce;}_0x44e61b[_0x300b('0x16')](_0x10174b);return _0x44e61b[_0x300b('0x1c')]('Content-Range',_0x4d2024+'-'+_0x2a7d96+'/'+_0x2fed99)[_0x300b('0x1d')](_0xfb49f);}return null;};}function patchUpdates(_0x16bfc6){return function(_0x971d15){try{jsonpatch['apply'](_0x971d15,_0x16bfc6,!![]);}catch(_0xe05542){return BPromise[_0x300b('0x1e')](_0xe05542);}return _0x971d15[_0x300b('0x1f')]();};}function saveUpdates(_0x502c5f,_0x26913f){return function(_0x5b14ed){if(_0x5b14ed){return _0x5b14ed['update'](_0x502c5f)[_0x300b('0x20')](function(_0xad0fb){return _0xad0fb;});}return null;};}function removeEntity(_0x28bc0a,_0x3ea40b){return function(_0x3219aa){if(_0x3219aa){return _0x3219aa[_0x300b('0x21')]()[_0x300b('0x20')](function(){_0x28bc0a[_0x300b('0x16')](0xcc)[_0x300b('0x17')]();});}};}function handleEntityNotFound(_0x544658,_0x3d62b1){return function(_0x152048){if(!_0x152048){_0x544658[_0x300b('0x15')](0x194);}return _0x152048;};}function handleError(_0x43c480,_0x4cce77){_0x4cce77=_0x4cce77||0x1f4;return function(_0x4f50b0){logger['error'](_0x4f50b0[_0x300b('0x22')]);if(_0x4f50b0['name']){delete _0x4f50b0[_0x300b('0x23')];}_0x43c480[_0x300b('0x16')](_0x4cce77)[_0x300b('0x24')](_0x4f50b0);};}exports[_0x300b('0x25')]=function(_0x2d2ea7,_0x10ed6b){var _0x165f56={'raw':!![],'where':{'id':_0x2d2ea7[_0x300b('0x26')]['id']}},_0x159b63={};_0x159b63[_0x300b('0x27')]=_['keys'](db['ChatApplication'][_0x300b('0x28')]);_0x159b63[_0x300b('0x29')]=_[_0x300b('0x2a')](_0x2d2ea7[_0x300b('0x29')]);_0x159b63['filters']=_[_0x300b('0x2b')](_0x159b63['model'],_0x159b63['query']);_0x165f56['attributes']=_[_0x300b('0x2b')](_0x159b63[_0x300b('0x27')],qs['fields'](_0x2d2ea7[_0x300b('0x29')][_0x300b('0x2c')]));_0x165f56['attributes']=_0x165f56[_0x300b('0x2d')]['length']?_0x165f56[_0x300b('0x2d')]:_0x159b63[_0x300b('0x27')];if(_0x2d2ea7[_0x300b('0x29')][_0x300b('0x2e')]){_0x165f56[_0x300b('0x2f')]=[{'all':!![]}];}_0x165f56=_[_0x300b('0x30')]({},_0x165f56,_0x2d2ea7[_0x300b('0x31')]);return db['ChatApplication'][_0x300b('0x32')](_0x165f56)['then'](handleEntityNotFound(_0x10ed6b,null))[_0x300b('0x20')](respondWithResult(_0x10ed6b,null))[_0x300b('0x33')](handleError(_0x10ed6b,null));};exports['update']=function(_0x3250dc,_0x355088){if(_0x3250dc['body']['id']){delete _0x3250dc[_0x300b('0x34')]['id'];}return db[_0x300b('0x35')][_0x300b('0x32')]({'where':{'id':_0x3250dc['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x355088,null))[_0x300b('0x20')](saveUpdates(_0x3250dc[_0x300b('0x34')],null))[_0x300b('0x20')](respondWithResult(_0x355088,null))[_0x300b('0x33')](handleError(_0x355088,null));};exports[_0x300b('0x21')]=function(_0x2004ae,_0x56ee6b){return db[_0x300b('0x35')][_0x300b('0x32')]({'where':{'id':_0x2004ae['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x56ee6b,null))['then'](removeEntity(_0x56ee6b,null))['catch'](handleError(_0x56ee6b,null));}; \ No newline at end of file +var _0x4e65=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','limit','undefined','count','offset','apply','update','then','destroy','sendStatus','stack','name','params','keys','ChatApplication','rawAttributes','query','model','intersection','fields','attributes','length','include','merge','options','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto'];(function(_0x26b9cb,_0x12bc4c){var _0x3f44e6=function(_0x1a5a4e){while(--_0x1a5a4e){_0x26b9cb['push'](_0x26b9cb['shift']());}};_0x3f44e6(++_0x12bc4c);}(_0x4e65,0xc4));var _0x54e6=function(_0x554a1e,_0x1f5ded){_0x554a1e=_0x554a1e-0x0;var _0x44683e=_0x4e65[_0x554a1e];return _0x44683e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54e6('0x0'));var zipdir=require(_0x54e6('0x1'));var jsonpatch=require(_0x54e6('0x2'));var rp=require(_0x54e6('0x3'));var moment=require(_0x54e6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x54e6('0x5'));var path=require(_0x54e6('0x6'));var sox=require(_0x54e6('0x7'));var csv=require(_0x54e6('0x8'));var ejs=require(_0x54e6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54e6('0xa'));var squel=require('squel');var crypto=require(_0x54e6('0xb'));var jsforce=require(_0x54e6('0xc'));var deskjs=require(_0x54e6('0xd'));var toCsv=require(_0x54e6('0x8'));var querystring=require('querystring');var Papa=require(_0x54e6('0xe'));var Redis=require(_0x54e6('0xf'));var authService=require(_0x54e6('0x10'));var qs=require(_0x54e6('0x11'));var as=require(_0x54e6('0x12'));var hardwareService=require(_0x54e6('0x13'));var logger=require('../../config/logger')(_0x54e6('0x14'));var utils=require('../../config/utils');var config=require(_0x54e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x54e6('0x16'))['db'];function respondWithStatusCode(_0x42809d,_0x5bb31c){_0x5bb31c=_0x5bb31c||0xcc;return function(_0x1524ef){if(_0x1524ef){return _0x42809d['sendStatus'](_0x5bb31c);}return _0x42809d[_0x54e6('0x17')](_0x5bb31c)[_0x54e6('0x18')]();};}function respondWithResult(_0x206572,_0x2b1a24){_0x2b1a24=_0x2b1a24||0xc8;return function(_0x193411){if(_0x193411){return _0x206572[_0x54e6('0x17')](_0x2b1a24)['json'](_0x193411);}};}function respondWithFilteredResult(_0x35fa82,_0x4248ad){return function(_0x4271de){if(_0x4271de){var _0x5ec08b=typeof _0x4248ad['offset']==='undefined'&&typeof _0x4248ad[_0x54e6('0x19')]===_0x54e6('0x1a');var _0x4bd74d=_0x4271de[_0x54e6('0x1b')];var _0x499caa=_0x5ec08b?0x0:_0x4248ad[_0x54e6('0x1c')];var _0x227c6b=_0x5ec08b?_0x4271de[_0x54e6('0x1b')]:_0x4248ad['offset']+_0x4248ad['limit'];var _0x117a43;if(_0x227c6b>=_0x4bd74d){_0x227c6b=_0x4bd74d;_0x117a43=0xc8;}else{_0x117a43=0xce;}_0x35fa82[_0x54e6('0x17')](_0x117a43);return _0x35fa82['set']('Content-Range',_0x499caa+'-'+_0x227c6b+'/'+_0x4bd74d)['json'](_0x4271de);}return null;};}function patchUpdates(_0x280594){return function(_0x35bac5){try{jsonpatch[_0x54e6('0x1d')](_0x35bac5,_0x280594,!![]);}catch(_0x56b06e){return BPromise['reject'](_0x56b06e);}return _0x35bac5['save']();};}function saveUpdates(_0x1a0246,_0x1a63cd){return function(_0x3a1853){if(_0x3a1853){return _0x3a1853[_0x54e6('0x1e')](_0x1a0246)[_0x54e6('0x1f')](function(_0xa48578){return _0xa48578;});}return null;};}function removeEntity(_0x15f760,_0x3dd8c6){return function(_0x5a2aec){if(_0x5a2aec){return _0x5a2aec[_0x54e6('0x20')]()[_0x54e6('0x1f')](function(){_0x15f760[_0x54e6('0x17')](0xcc)[_0x54e6('0x18')]();});}};}function handleEntityNotFound(_0x178ae3,_0x52a590){return function(_0x50f88b){if(!_0x50f88b){_0x178ae3[_0x54e6('0x21')](0x194);}return _0x50f88b;};}function handleError(_0x204f88,_0x323e32){_0x323e32=_0x323e32||0x1f4;return function(_0x26faba){logger['error'](_0x26faba[_0x54e6('0x22')]);if(_0x26faba['name']){delete _0x26faba[_0x54e6('0x23')];}_0x204f88['status'](_0x323e32)['send'](_0x26faba);};}exports['show']=function(_0x1008fd,_0x271f85){var _0x9e059b={'raw':!![],'where':{'id':_0x1008fd[_0x54e6('0x24')]['id']}},_0x248cf5={};_0x248cf5['model']=_[_0x54e6('0x25')](db[_0x54e6('0x26')][_0x54e6('0x27')]);_0x248cf5[_0x54e6('0x28')]=_[_0x54e6('0x25')](_0x1008fd[_0x54e6('0x28')]);_0x248cf5['filters']=_['intersection'](_0x248cf5[_0x54e6('0x29')],_0x248cf5[_0x54e6('0x28')]);_0x9e059b['attributes']=_[_0x54e6('0x2a')](_0x248cf5[_0x54e6('0x29')],qs[_0x54e6('0x2b')](_0x1008fd[_0x54e6('0x28')][_0x54e6('0x2b')]));_0x9e059b[_0x54e6('0x2c')]=_0x9e059b['attributes'][_0x54e6('0x2d')]?_0x9e059b[_0x54e6('0x2c')]:_0x248cf5[_0x54e6('0x29')];if(_0x1008fd[_0x54e6('0x28')]['includeAll']){_0x9e059b[_0x54e6('0x2e')]=[{'all':!![]}];}_0x9e059b=_[_0x54e6('0x2f')]({},_0x9e059b,_0x1008fd[_0x54e6('0x30')]);return db[_0x54e6('0x26')][_0x54e6('0x31')](_0x9e059b)[_0x54e6('0x1f')](handleEntityNotFound(_0x271f85,null))['then'](respondWithResult(_0x271f85,null))[_0x54e6('0x32')](handleError(_0x271f85,null));};exports[_0x54e6('0x1e')]=function(_0x156a1c,_0x20de8f){if(_0x156a1c['body']['id']){delete _0x156a1c[_0x54e6('0x33')]['id'];}return db[_0x54e6('0x26')][_0x54e6('0x31')]({'where':{'id':_0x156a1c[_0x54e6('0x24')]['id']}})[_0x54e6('0x1f')](handleEntityNotFound(_0x20de8f,null))['then'](saveUpdates(_0x156a1c[_0x54e6('0x33')],null))[_0x54e6('0x1f')](respondWithResult(_0x20de8f,null))[_0x54e6('0x32')](handleError(_0x20de8f,null));};exports[_0x54e6('0x20')]=function(_0x39fb34,_0x397192){return db[_0x54e6('0x26')][_0x54e6('0x31')]({'where':{'id':_0x39fb34[_0x54e6('0x24')]['id']}})[_0x54e6('0x1f')](handleEntityNotFound(_0x397192,null))[_0x54e6('0x1f')](removeEntity(_0x397192,null))[_0x54e6('0x32')](handleError(_0x397192,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 826af7f..b587615 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 _0xeb4d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x403230,_0x100c91){var _0x246eb3=function(_0x2aa681){while(--_0x2aa681){_0x403230['push'](_0x403230['shift']());}};_0x246eb3(++_0x100c91);}(_0xeb4d,0x14e));var _0xdeb4=function(_0x451aab,_0x12c2d8){_0x451aab=_0x451aab-0x0;var _0x5aa85c=_0xeb4d[_0x451aab];return _0x5aa85c;};'use strict';var _=require(_0xdeb4('0x0'));var util=require(_0xdeb4('0x1'));var logger=require(_0xdeb4('0x2'))(_0xdeb4('0x3'));var moment=require(_0xdeb4('0x4'));var BPromise=require(_0xdeb4('0x5'));var rp=require(_0xdeb4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdeb4('0x7'));var config=require('../../config/environment');var attributes=require(_0xdeb4('0x8'));module[_0xdeb4('0x9')]=function(_0x23ed89,_0x7ee8c2){return _0x23ed89[_0xdeb4('0xa')]('ChatApplication',attributes,{'tableName':_0xdeb4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb4('0xc'),'collate':_0xdeb4('0xd')});}; \ No newline at end of file +var _0x4ca8=['ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','define'];(function(_0x4a8d56,_0x2c7781){var _0x35a536=function(_0x4fa9fc){while(--_0x4fa9fc){_0x4a8d56['push'](_0x4a8d56['shift']());}};_0x35a536(++_0x2c7781);}(_0x4ca8,0x18f));var _0x84ca=function(_0x2beaea,_0x37a73d){_0x2beaea=_0x2beaea-0x0;var _0x6a0562=_0x4ca8[_0x2beaea];return _0x6a0562;};'use strict';var _=require('lodash');var util=require(_0x84ca('0x0'));var logger=require(_0x84ca('0x1'))('api');var moment=require(_0x84ca('0x2'));var BPromise=require('bluebird');var rp=require(_0x84ca('0x3'));var fs=require('fs');var path=require(_0x84ca('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x3f1b79,_0x32a1d4){return _0x3f1b79[_0x84ca('0x5')](_0x84ca('0x6'),attributes,{'tableName':_0x84ca('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x84ca('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index a09a5c8..33eaa5a 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 _0x109e=['../../config/utils','../../config/logger','../../config/environment','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x173c84,_0x1b2613){var _0x1ebc7b=function(_0x13e801){while(--_0x13e801){_0x173c84['push'](_0x173c84['shift']());}};_0x1ebc7b(++_0x1b2613);}(_0x109e,0xc3));var _0xe109=function(_0x215f67,_0x5656e2){_0x215f67=_0x215f67-0x0;var _0x24f8ef=_0x109e[_0x215f67];return _0x24f8ef;};'use strict';var _=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var moment=require(_0xe109('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe109('0x3'));var db=require(_0xe109('0x4'))['db'];var utils=require(_0xe109('0x5'));var logger=require(_0xe109('0x6'))('rpc');var config=require(_0xe109('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe109('0x8')][_0xe109('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12afec,_0x188ef0,_0x57ead4){return new BPromise(function(_0x38cb9b,_0x2573d3){return client['request'](_0x12afec,_0x57ead4)['then'](function(_0x3cdc7b){logger[_0xe109('0xa')](_0xe109('0xb'),_0x188ef0,_0xe109('0xc'));logger[_0xe109('0xd')](_0xe109('0xe'),_0x188ef0,_0xe109('0xc'),JSON[_0xe109('0xf')](_0x3cdc7b));if(_0x3cdc7b[_0xe109('0x10')]){if(_0x3cdc7b[_0xe109('0x10')][_0xe109('0x11')]===0x1f4){logger[_0xe109('0x10')](_0xe109('0xb'),_0x188ef0,_0x3cdc7b[_0xe109('0x10')]['message']);return _0x2573d3(_0x3cdc7b[_0xe109('0x10')]['message']);}logger['error'](_0xe109('0xb'),_0x188ef0,_0x3cdc7b[_0xe109('0x10')][_0xe109('0x12')]);return _0x38cb9b(_0x3cdc7b[_0xe109('0x10')][_0xe109('0x12')]);}else{logger[_0xe109('0xa')](_0xe109('0xb'),_0x188ef0,_0xe109('0xc'));_0x38cb9b(_0x3cdc7b[_0xe109('0x13')][_0xe109('0x12')]);}})['catch'](function(_0x23e167){logger['error']('ChatApplication,\x20%s,\x20%s',_0x188ef0,_0x23e167);_0x2573d3(_0x23e167);});});} \ No newline at end of file +var _0x5dac=['request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5dac,0xca));var _0xc5da=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5dac[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xc5da('0x0'));var util=require(_0xc5da('0x1'));var moment=require(_0xc5da('0x2'));var BPromise=require(_0xc5da('0x3'));var rs=require(_0xc5da('0x4'));var fs=require('fs');var Redis=require(_0xc5da('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5da('0x6'));var logger=require(_0xc5da('0x7'))(_0xc5da('0x8'));var config=require(_0xc5da('0x9'));var jayson=require(_0xc5da('0xa'));var client=jayson[_0xc5da('0xb')][_0xc5da('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ef614,_0x1f1950,_0x47860b){return new BPromise(function(_0x77cbd5,_0x58a998){return client['request'](_0x1ef614,_0x47860b)[_0xc5da('0xd')](function(_0x3ce0ca){logger[_0xc5da('0xe')](_0xc5da('0xf'),_0x1f1950,'request\x20sent');logger[_0xc5da('0x10')](_0xc5da('0x11'),_0x1f1950,_0xc5da('0x12'),JSON['stringify'](_0x3ce0ca));if(_0x3ce0ca[_0xc5da('0x13')]){if(_0x3ce0ca[_0xc5da('0x13')]['code']===0x1f4){logger[_0xc5da('0x13')](_0xc5da('0xf'),_0x1f1950,_0x3ce0ca['error'][_0xc5da('0x14')]);return _0x58a998(_0x3ce0ca[_0xc5da('0x13')][_0xc5da('0x14')]);}logger[_0xc5da('0x13')]('ChatApplication,\x20%s,\x20%s',_0x1f1950,_0x3ce0ca[_0xc5da('0x13')][_0xc5da('0x14')]);return _0x77cbd5(_0x3ce0ca[_0xc5da('0x13')][_0xc5da('0x14')]);}else{logger[_0xc5da('0xe')](_0xc5da('0xf'),_0x1f1950,_0xc5da('0x12'));_0x77cbd5(_0x3ce0ca[_0xc5da('0x15')][_0xc5da('0x14')]);}})['catch'](function(_0x1b4dd3){logger[_0xc5da('0x13')](_0xc5da('0xf'),_0x1f1950,_0x1b4dd3);_0x58a998(_0x1b4dd3);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 62d95d9..f42a078 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 _0x27e3=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','show','put','destroy'];(function(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0x27e3,0x9b));var _0x327e=function(_0xc1718d,_0x5835ae){_0xc1718d=_0xc1718d-0x0;var _0x26a6d8=_0x27e3[_0xc1718d];return _0x26a6d8;};'use strict';var multer=require(_0x327e('0x0'));var util=require('util');var path=require(_0x327e('0x1'));var timeout=require(_0x327e('0x2'));var express=require(_0x327e('0x3'));var router=express['Router']();var fs_extra=require(_0x327e('0x4'));var auth=require(_0x327e('0x5'));var interaction=require(_0x327e('0x6'));var config=require(_0x327e('0x7'));var controller=require(_0x327e('0x8'));router['get'](_0x327e('0x9'),auth['isAuthenticated'](),controller[_0x327e('0xa')]);router[_0x327e('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x327e('0x9'),auth['isAuthenticated'](),controller[_0x327e('0xc')]);module[_0x327e('0xd')]=router; \ No newline at end of file +var _0x938d=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x938d,0xc1));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd938('0x0'));var util=require(_0xd938('0x1'));var path=require(_0xd938('0x2'));var timeout=require(_0xd938('0x3'));var express=require(_0xd938('0x4'));var router=express['Router']();var fs_extra=require(_0xd938('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd938('0x6'));var config=require(_0xd938('0x7'));var controller=require(_0xd938('0x8'));router['get'](_0xd938('0x9'),auth[_0xd938('0xa')](),controller[_0xd938('0xb')]);router[_0xd938('0xc')]('/:id',auth[_0xd938('0xa')](),controller[_0xd938('0xd')]);router[_0xd938('0xe')]('/:id',auth[_0xd938('0xa')](),controller[_0xd938('0xf')]);module[_0xd938('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 95e95fc..61e0191 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 _0x45bb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x26c20b,_0x466612){var _0x2714b1=function(_0x54965e){while(--_0x54965e){_0x26c20b['push'](_0x26c20b['shift']());}};_0x2714b1(++_0x466612);}(_0x45bb,0x79));var _0xb45b=function(_0x677f25,_0x4eb4b5){_0x677f25=_0x677f25-0x0;var _0x22123d=_0x45bb[_0x677f25];return _0x22123d;};'use strict';var Sequelize=require(_0xb45b('0x0'));module[_0xb45b('0x1')]={'name':{'type':Sequelize[_0xb45b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb45b('0x2')]},'write':{'type':Sequelize[_0xb45b('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb296=['exports','STRING','BOOLEAN','sequelize'];(function(_0xd370d5,_0x3cdbb9){var _0x1250f2=function(_0x4bb0f8){while(--_0x4bb0f8){_0xd370d5['push'](_0xd370d5['shift']());}};_0x1250f2(++_0x3cdbb9);}(_0xb296,0xa3));var _0x6b29=function(_0x946c4c,_0x3d3eb6){_0x946c4c=_0x946c4c-0x0;var _0x574ccd=_0xb296[_0x946c4c];return _0x574ccd;};'use strict';var Sequelize=require(_0x6b29('0x0'));module[_0x6b29('0x1')]={'name':{'type':Sequelize[_0x6b29('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6b29('0x2')]},'write':{'type':Sequelize[_0x6b29('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 73e9749..d4c191f 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 _0xa9e0=['../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','jayson/promise','client','http','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','stack','name','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','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'];(function(_0x31b31b,_0x5f044e){var _0x2c8fc2=function(_0x5438aa){while(--_0x5438aa){_0x31b31b['push'](_0x31b31b['shift']());}};_0x2c8fc2(++_0x5f044e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return new BPromise(function(_0x519dfd,_0x16033c){var _0x12066b=_0x1985b6||client;return _0x12066b['request'](_0x52a03d,_0x5d0880)[_0x0a9e('0x1d')](function(_0x5a0a06){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x22dccb,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x22dccb,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x5a0a06));if(_0x5a0a06[_0x0a9e('0x24')]){if(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x16033c(_0x5a0a06[_0x0a9e('0x24')]['message']);}logger[_0x0a9e('0x24')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x519dfd(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x26')]);}else{logger[_0x0a9e('0x1e')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x0a9e('0x20'));_0x519dfd(_0x5a0a06[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x370d86){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x370d86);_0x16033c(_0x370d86);});});}function respondWithStatusCode(_0x5ea472,_0x59181e){_0x59181e=_0x59181e||0xcc;return function(_0x197ec0){if(_0x197ec0){return _0x5ea472[_0x0a9e('0x29')](_0x59181e);}return _0x5ea472[_0x0a9e('0x2a')](_0x59181e)[_0x0a9e('0x2b')]();};}function respondWithResult(_0x526cf3,_0x384319){_0x384319=_0x384319||0xc8;return function(_0x479bc4){if(_0x479bc4){return _0x526cf3[_0x0a9e('0x2a')](_0x384319)['json'](_0x479bc4);}};}function respondWithFilteredResult(_0x1dc186,_0x34dc65){return function(_0x25fba9){if(_0x25fba9){var _0x14433c=typeof _0x34dc65[_0x0a9e('0x2c')]===_0x0a9e('0x2d')&&typeof _0x34dc65[_0x0a9e('0x2e')]===_0x0a9e('0x2d');var _0x5a101a=_0x25fba9[_0x0a9e('0x2f')];var _0x468813=_0x14433c?0x0:_0x34dc65[_0x0a9e('0x2c')];var _0x2ec755=_0x14433c?_0x25fba9['count']:_0x34dc65[_0x0a9e('0x2c')]+_0x34dc65[_0x0a9e('0x2e')];var _0x1843b2;if(_0x2ec755>=_0x5a101a){_0x2ec755=_0x5a101a;_0x1843b2=0xc8;}else{_0x1843b2=0xce;}_0x1dc186[_0x0a9e('0x2a')](_0x1843b2);return _0x1dc186[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x468813+'-'+_0x2ec755+'/'+_0x5a101a)[_0x0a9e('0x32')](_0x25fba9);}return null;};}function patchUpdates(_0x2e8759){return function(_0x1dbde2){try{jsonpatch['apply'](_0x1dbde2,_0x2e8759,!![]);}catch(_0x426950){return BPromise['reject'](_0x426950);}return _0x1dbde2[_0x0a9e('0x33')]();};}function saveUpdates(_0x3ae878,_0x1122db){return function(_0x33bdb7){if(_0x33bdb7){return _0x33bdb7[_0x0a9e('0x34')](_0x3ae878)['then'](function(_0x66c1d2){return _0x66c1d2;});}return null;};}function removeEntity(_0x46f0a5,_0x40cb85){return function(_0x2da5c0){if(_0x2da5c0){return _0x2da5c0[_0x0a9e('0x35')]()[_0x0a9e('0x1d')](function(){_0x46f0a5[_0x0a9e('0x2a')](0xcc)[_0x0a9e('0x2b')]();});}};}function handleEntityNotFound(_0x5583a4,_0x44295a){return function(_0x5e7238){if(!_0x5e7238){_0x5583a4[_0x0a9e('0x29')](0x194);}return _0x5e7238;};}function handleError(_0x14b13f,_0x2b7e7f){_0x2b7e7f=_0x2b7e7f||0x1f4;return function(_0x3f3d41){logger['error'](_0x3f3d41[_0x0a9e('0x36')]);if(_0x3f3d41[_0x0a9e('0x37')]){delete _0x3f3d41[_0x0a9e('0x37')];}_0x14b13f[_0x0a9e('0x2a')](_0x2b7e7f)['send'](_0x3f3d41);};}exports['index']=function(_0x1e8694,_0x5640eb){var _0x24936a={},_0x3d9717={},_0x381c37={'count':0x0,'rows':[]};var _0x1ef87a=_['map'](db[_0x0a9e('0x38')][_0x0a9e('0x39')],function(_0x3cae){return{'name':_0x3cae['fieldName'],'type':_0x3cae[_0x0a9e('0x3a')][_0x0a9e('0x3b')]};});_0x3d9717[_0x0a9e('0x3c')]=_['map'](_0x1ef87a,'name');_0x3d9717[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x1e8694['query']);_0x3d9717[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x3d9717[_0x0a9e('0x3c')],_0x3d9717[_0x0a9e('0x3d')]);_0x24936a['attributes']=_['intersection'](_0x3d9717[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1e8694['query'][_0x0a9e('0x41')]));_0x24936a[_0x0a9e('0x42')]=_0x24936a[_0x0a9e('0x42')]['length']?_0x24936a[_0x0a9e('0x42')]:_0x3d9717[_0x0a9e('0x3c')];if(!_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x24936a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2e')]);_0x24936a[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}_0x24936a[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x1e8694['query']['sort']);_0x24936a[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x1e8694[_0x0a9e('0x3d')],_0x3d9717[_0x0a9e('0x3f')]),_0x1ef87a);if(_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x24936a[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x1ef87a,function(_0x35ed4a){if(_0x35ed4a['type']!==_0x0a9e('0x4c')){var _0x138b8b={};_0x138b8b[_0x35ed4a[_0x0a9e('0x37')]]={'$like':'%'+_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x138b8b;}})});}_0x24936a=_[_0x0a9e('0x4a')]({},_0x24936a,_0x1e8694[_0x0a9e('0x4d')]);var _0x44dd99={'where':_0x24936a['where']};return db[_0x0a9e('0x38')]['count'](_0x44dd99)[_0x0a9e('0x1d')](function(_0x476688){_0x381c37[_0x0a9e('0x2f')]=_0x476688;if(_0x1e8694['query'][_0x0a9e('0x4e')]){_0x24936a[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x38')][_0x0a9e('0x50')](_0x24936a);})[_0x0a9e('0x1d')](function(_0x37be73){_0x381c37[_0x0a9e('0x51')]=_0x37be73;return _0x381c37;})['then'](respondWithFilteredResult(_0x5640eb,_0x24936a))[_0x0a9e('0x28')](handleError(_0x5640eb,null));};exports[_0x0a9e('0x52')]=function(_0x1b5e80,_0x16f976){var _0x409789={'raw':!![],'where':{'id':_0x1b5e80[_0x0a9e('0x53')]['id']}},_0x992c77={};_0x992c77[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['ChatGroup'][_0x0a9e('0x39')]);_0x992c77[_0x0a9e('0x3d')]=_['keys'](_0x1b5e80['query']);_0x992c77['filters']=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],_0x992c77[_0x0a9e('0x3d')]);_0x409789[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1b5e80[_0x0a9e('0x3d')]['fields']));_0x409789['attributes']=_0x409789['attributes'][_0x0a9e('0x54')]?_0x409789[_0x0a9e('0x42')]:_0x992c77[_0x0a9e('0x3c')];if(_0x1b5e80['query'][_0x0a9e('0x4e')]){_0x409789[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x409789=_['merge']({},_0x409789,_0x1b5e80['options']);return db[_0x0a9e('0x38')]['find'](_0x409789)[_0x0a9e('0x1d')](handleEntityNotFound(_0x16f976,null))['then'](respondWithResult(_0x16f976,null))[_0x0a9e('0x28')](handleError(_0x16f976,null));};exports[_0x0a9e('0x55')]=function(_0x439340,_0x53613a){return db[_0x0a9e('0x38')][_0x0a9e('0x55')](_0x439340['body'],{})['then'](respondWithResult(_0x53613a,0xc9))[_0x0a9e('0x28')](handleError(_0x53613a,null));};exports[_0x0a9e('0x34')]=function(_0x49c095,_0x145931){if(_0x49c095['body']['id']){delete _0x49c095[_0x0a9e('0x56')]['id'];}return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x49c095['params']['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](saveUpdates(_0x49c095[_0x0a9e('0x56')],null))['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x28')](handleError(_0x145931,null));};exports[_0x0a9e('0x35')]=function(_0x3cfd00,_0x19b4df){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x3cfd00[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x19b4df,null))['then'](removeEntity(_0x19b4df,null))[_0x0a9e('0x28')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x58')]=function(_0x2642bb,_0x30c491){return db[_0x0a9e('0x38')][_0x0a9e('0x58')]()['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0x28')](handleError(_0x30c491,null));};exports[_0x0a9e('0x59')]=function(_0x5239ef,_0x3649cc,_0x5cc8fb){return db[_0x0a9e('0x5a')]['count']({'where':{'ChatGroupId':_0x5239ef['params']['id'],'ToId':_0x5239ef['user']['id'],'read':![]}})[_0x0a9e('0x1d')](function(_0x49d231){return{'id':_[_0x0a9e('0x5b')](_0x5239ef[_0x0a9e('0x53')]['id']),'count':_0x49d231};})[_0x0a9e('0x1d')](respondWithResult(_0x3649cc,null))[_0x0a9e('0x28')](handleError(_0x3649cc,null));};exports[_0x0a9e('0x5c')]=function(_0x26d7db,_0x49eed0,_0x1627a7){return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x26d7db[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))['then'](function(_0x453360){if(_0x453360){return _0x453360[_0x0a9e('0x5c')](_0x26d7db[_0x0a9e('0x56')][_0x0a9e('0x5d')],_['omit'](_0x26d7db[_0x0a9e('0x56')],[_0x0a9e('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x49eed0,null))[_0x0a9e('0x28')](handleError(_0x49eed0,null));};exports[_0x0a9e('0x5e')]=function(_0x88dcbf,_0x409b29,_0x401837){var _0x4d4a35={};var _0x176840={};var _0x2937e0;var _0x281c7d;return db['ChatGroup'][_0x0a9e('0x5f')]({'where':{'id':_0x88dcbf['params']['id']}})['then'](handleEntityNotFound(_0x409b29,null))[_0x0a9e('0x1d')](function(_0x4556c5){if(_0x4556c5){_0x2937e0=_0x4556c5;_0x176840[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x60')][_0x0a9e('0x39')]);_0x176840[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x88dcbf[_0x0a9e('0x3d')]);_0x176840[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],_0x176840[_0x0a9e('0x3d')]);_0x4d4a35[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x88dcbf[_0x0a9e('0x3d')]['fields']));_0x4d4a35[_0x0a9e('0x42')]=_0x4d4a35[_0x0a9e('0x42')][_0x0a9e('0x54')]?_0x4d4a35['attributes']:_0x176840[_0x0a9e('0x3c')];_0x4d4a35[_0x0a9e('0x45')]=qs['sort'](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x4d4a35[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x88dcbf['query'],_0x176840['filters']));if(_0x88dcbf['query'][_0x0a9e('0x49')]){_0x4d4a35[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x4d4a35[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x4d4a35[_0x0a9e('0x42')],function(_0xeef20){var _0x1a0677={};_0x1a0677[_0xeef20]={'$like':'%'+_0x88dcbf['query'][_0x0a9e('0x49')]+'%'};return _0x1a0677;})});}_0x4d4a35=_[_0x0a9e('0x4a')]({},_0x4d4a35,_0x88dcbf[_0x0a9e('0x4d')]);return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x583b2e){if(_0x583b2e){_0x281c7d=_0x583b2e[_0x0a9e('0x54')];if(!_0x88dcbf[_0x0a9e('0x3d')]['hasOwnProperty'](_0x0a9e('0x44'))){_0x4d4a35[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x88dcbf[_0x0a9e('0x3d')]['limit']);_0x4d4a35[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x3d91db){if(_0x3d91db){return _0x3d91db?{'count':_0x281c7d,'rows':_0x3d91db}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x409b29,null))[_0x0a9e('0x28')](handleError(_0x409b29,null));};exports['removeMembers']=function(_0x290d43,_0x3511c9,_0x30a4c7){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x290d43[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3511c9,null))[_0x0a9e('0x1d')](function(_0x1a7b03){if(_0x1a7b03){return _0x1a7b03[_0x0a9e('0x61')](_0x290d43[_0x0a9e('0x3d')][_0x0a9e('0x5d')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x3511c9,null))[_0x0a9e('0x28')](handleError(_0x3511c9,null));};exports['addMessage']=function(_0xf4120f,_0x11da9c,_0xc599b3){if(_0xf4120f['body']['id']){delete _0xf4120f[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0xf4120f[_0x0a9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x11da9c,null))['then'](function(_0x7ebea8){if(_0x7ebea8){_0xf4120f[_0x0a9e('0x56')]['ChatGroupId']=_0x7ebea8['id'];return db[_0x0a9e('0x5a')]['create'](_0xf4120f[_0x0a9e('0x56')]);}})[_0x0a9e('0x1d')](respondWithResult(_0x11da9c,null))['catch'](handleError(_0x11da9c,null));};exports[_0x0a9e('0x62')]=function(_0x41cf12,_0x2d2286,_0x42b959){var _0x3755fe={};var _0x1f42a0={};var _0x444f1f;var _0x482ca2;return db[_0x0a9e('0x38')][_0x0a9e('0x5f')]({'where':{'id':_0x41cf12[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2d2286,null))['then'](function(_0xf51744){if(_0xf51744){_0x444f1f=_0xf51744;_0x1f42a0[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x5a')]['rawAttributes']);_0x1f42a0[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x41cf12[_0x0a9e('0x3d')]);_0x1f42a0[_0x0a9e('0x3f')]=_['intersection'](_0x1f42a0['model'],_0x1f42a0[_0x0a9e('0x3d')]);_0x3755fe[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x1f42a0['model'],qs[_0x0a9e('0x41')](_0x41cf12[_0x0a9e('0x3d')]['fields']));_0x3755fe['attributes']=_0x3755fe[_0x0a9e('0x42')]['length']?_0x3755fe['attributes']:_0x1f42a0['model'];_0x3755fe[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x3755fe[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_['pick'](_0x41cf12[_0x0a9e('0x3d')],_0x1f42a0['filters']));if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x3755fe[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x3755fe['where'],{'$or':_[_0x0a9e('0x4b')](_0x3755fe[_0x0a9e('0x42')],function(_0x1d4877){var _0x5b74c3={};_0x5b74c3[_0x1d4877]={'$like':'%'+_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x5b74c3;})});}if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')]){var _0x255e49=_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')][_0x0a9e('0x64')](',');var _0x509efe={};_0x509efe[_0x255e49[0x0]]={'$gte':moment(_0x255e49[0x1])[_0x0a9e('0x65')](_0x0a9e('0x66'))};_0x3755fe['where']=_[_0x0a9e('0x4a')](_0x3755fe[_0x0a9e('0x47')],_0x509efe);}_0x3755fe=_[_0x0a9e('0x4a')]({},_0x3755fe,_0x41cf12['options']);return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){_0x482ca2=_0x8c8fbe[_0x0a9e('0x54')];if(!_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x3755fe[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x41cf12[_0x0a9e('0x3d')]['limit']);_0x3755fe[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})[_0x0a9e('0x1d')](function(_0x6803d6){if(_0x6803d6){return _0x6803d6?{'count':_0x482ca2,'rows':_0x6803d6}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x2d2286,null))[_0x0a9e('0x28')](handleError(_0x2d2286,null));}; \ No newline at end of file +var _0xa9e0=['../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','jayson/promise','client','http','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','stack','name','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','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'];(function(_0x1f44e4,_0x22d9fd){var _0x591989=function(_0x3aeb88){while(--_0x3aeb88){_0x1f44e4['push'](_0x1f44e4['shift']());}};_0x591989(++_0x22d9fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return new BPromise(function(_0x519dfd,_0x16033c){var _0x12066b=_0x1985b6||client;return _0x12066b['request'](_0x52a03d,_0x5d0880)[_0x0a9e('0x1d')](function(_0x5a0a06){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x22dccb,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x22dccb,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x5a0a06));if(_0x5a0a06[_0x0a9e('0x24')]){if(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x16033c(_0x5a0a06[_0x0a9e('0x24')]['message']);}logger[_0x0a9e('0x24')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x519dfd(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x26')]);}else{logger[_0x0a9e('0x1e')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x0a9e('0x20'));_0x519dfd(_0x5a0a06[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x370d86){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x370d86);_0x16033c(_0x370d86);});});}function respondWithStatusCode(_0x5ea472,_0x59181e){_0x59181e=_0x59181e||0xcc;return function(_0x197ec0){if(_0x197ec0){return _0x5ea472[_0x0a9e('0x29')](_0x59181e);}return _0x5ea472[_0x0a9e('0x2a')](_0x59181e)[_0x0a9e('0x2b')]();};}function respondWithResult(_0x526cf3,_0x384319){_0x384319=_0x384319||0xc8;return function(_0x479bc4){if(_0x479bc4){return _0x526cf3[_0x0a9e('0x2a')](_0x384319)['json'](_0x479bc4);}};}function respondWithFilteredResult(_0x1dc186,_0x34dc65){return function(_0x25fba9){if(_0x25fba9){var _0x14433c=typeof _0x34dc65[_0x0a9e('0x2c')]===_0x0a9e('0x2d')&&typeof _0x34dc65[_0x0a9e('0x2e')]===_0x0a9e('0x2d');var _0x5a101a=_0x25fba9[_0x0a9e('0x2f')];var _0x468813=_0x14433c?0x0:_0x34dc65[_0x0a9e('0x2c')];var _0x2ec755=_0x14433c?_0x25fba9['count']:_0x34dc65[_0x0a9e('0x2c')]+_0x34dc65[_0x0a9e('0x2e')];var _0x1843b2;if(_0x2ec755>=_0x5a101a){_0x2ec755=_0x5a101a;_0x1843b2=0xc8;}else{_0x1843b2=0xce;}_0x1dc186[_0x0a9e('0x2a')](_0x1843b2);return _0x1dc186[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x468813+'-'+_0x2ec755+'/'+_0x5a101a)[_0x0a9e('0x32')](_0x25fba9);}return null;};}function patchUpdates(_0x2e8759){return function(_0x1dbde2){try{jsonpatch['apply'](_0x1dbde2,_0x2e8759,!![]);}catch(_0x426950){return BPromise['reject'](_0x426950);}return _0x1dbde2[_0x0a9e('0x33')]();};}function saveUpdates(_0x3ae878,_0x1122db){return function(_0x33bdb7){if(_0x33bdb7){return _0x33bdb7[_0x0a9e('0x34')](_0x3ae878)['then'](function(_0x66c1d2){return _0x66c1d2;});}return null;};}function removeEntity(_0x46f0a5,_0x40cb85){return function(_0x2da5c0){if(_0x2da5c0){return _0x2da5c0[_0x0a9e('0x35')]()[_0x0a9e('0x1d')](function(){_0x46f0a5[_0x0a9e('0x2a')](0xcc)[_0x0a9e('0x2b')]();});}};}function handleEntityNotFound(_0x5583a4,_0x44295a){return function(_0x5e7238){if(!_0x5e7238){_0x5583a4[_0x0a9e('0x29')](0x194);}return _0x5e7238;};}function handleError(_0x14b13f,_0x2b7e7f){_0x2b7e7f=_0x2b7e7f||0x1f4;return function(_0x3f3d41){logger['error'](_0x3f3d41[_0x0a9e('0x36')]);if(_0x3f3d41[_0x0a9e('0x37')]){delete _0x3f3d41[_0x0a9e('0x37')];}_0x14b13f[_0x0a9e('0x2a')](_0x2b7e7f)['send'](_0x3f3d41);};}exports['index']=function(_0x1e8694,_0x5640eb){var _0x24936a={},_0x3d9717={},_0x381c37={'count':0x0,'rows':[]};var _0x1ef87a=_['map'](db[_0x0a9e('0x38')][_0x0a9e('0x39')],function(_0x3cae){return{'name':_0x3cae['fieldName'],'type':_0x3cae[_0x0a9e('0x3a')][_0x0a9e('0x3b')]};});_0x3d9717[_0x0a9e('0x3c')]=_['map'](_0x1ef87a,'name');_0x3d9717[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x1e8694['query']);_0x3d9717[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x3d9717[_0x0a9e('0x3c')],_0x3d9717[_0x0a9e('0x3d')]);_0x24936a['attributes']=_['intersection'](_0x3d9717[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1e8694['query'][_0x0a9e('0x41')]));_0x24936a[_0x0a9e('0x42')]=_0x24936a[_0x0a9e('0x42')]['length']?_0x24936a[_0x0a9e('0x42')]:_0x3d9717[_0x0a9e('0x3c')];if(!_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x24936a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2e')]);_0x24936a[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}_0x24936a[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x1e8694['query']['sort']);_0x24936a[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x1e8694[_0x0a9e('0x3d')],_0x3d9717[_0x0a9e('0x3f')]),_0x1ef87a);if(_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x24936a[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x1ef87a,function(_0x35ed4a){if(_0x35ed4a['type']!==_0x0a9e('0x4c')){var _0x138b8b={};_0x138b8b[_0x35ed4a[_0x0a9e('0x37')]]={'$like':'%'+_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x138b8b;}})});}_0x24936a=_[_0x0a9e('0x4a')]({},_0x24936a,_0x1e8694[_0x0a9e('0x4d')]);var _0x44dd99={'where':_0x24936a['where']};return db[_0x0a9e('0x38')]['count'](_0x44dd99)[_0x0a9e('0x1d')](function(_0x476688){_0x381c37[_0x0a9e('0x2f')]=_0x476688;if(_0x1e8694['query'][_0x0a9e('0x4e')]){_0x24936a[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x38')][_0x0a9e('0x50')](_0x24936a);})[_0x0a9e('0x1d')](function(_0x37be73){_0x381c37[_0x0a9e('0x51')]=_0x37be73;return _0x381c37;})['then'](respondWithFilteredResult(_0x5640eb,_0x24936a))[_0x0a9e('0x28')](handleError(_0x5640eb,null));};exports[_0x0a9e('0x52')]=function(_0x1b5e80,_0x16f976){var _0x409789={'raw':!![],'where':{'id':_0x1b5e80[_0x0a9e('0x53')]['id']}},_0x992c77={};_0x992c77[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['ChatGroup'][_0x0a9e('0x39')]);_0x992c77[_0x0a9e('0x3d')]=_['keys'](_0x1b5e80['query']);_0x992c77['filters']=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],_0x992c77[_0x0a9e('0x3d')]);_0x409789[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1b5e80[_0x0a9e('0x3d')]['fields']));_0x409789['attributes']=_0x409789['attributes'][_0x0a9e('0x54')]?_0x409789[_0x0a9e('0x42')]:_0x992c77[_0x0a9e('0x3c')];if(_0x1b5e80['query'][_0x0a9e('0x4e')]){_0x409789[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x409789=_['merge']({},_0x409789,_0x1b5e80['options']);return db[_0x0a9e('0x38')]['find'](_0x409789)[_0x0a9e('0x1d')](handleEntityNotFound(_0x16f976,null))['then'](respondWithResult(_0x16f976,null))[_0x0a9e('0x28')](handleError(_0x16f976,null));};exports[_0x0a9e('0x55')]=function(_0x439340,_0x53613a){return db[_0x0a9e('0x38')][_0x0a9e('0x55')](_0x439340['body'],{})['then'](respondWithResult(_0x53613a,0xc9))[_0x0a9e('0x28')](handleError(_0x53613a,null));};exports[_0x0a9e('0x34')]=function(_0x49c095,_0x145931){if(_0x49c095['body']['id']){delete _0x49c095[_0x0a9e('0x56')]['id'];}return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x49c095['params']['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](saveUpdates(_0x49c095[_0x0a9e('0x56')],null))['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x28')](handleError(_0x145931,null));};exports[_0x0a9e('0x35')]=function(_0x3cfd00,_0x19b4df){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x3cfd00[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x19b4df,null))['then'](removeEntity(_0x19b4df,null))[_0x0a9e('0x28')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x58')]=function(_0x2642bb,_0x30c491){return db[_0x0a9e('0x38')][_0x0a9e('0x58')]()['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0x28')](handleError(_0x30c491,null));};exports[_0x0a9e('0x59')]=function(_0x5239ef,_0x3649cc,_0x5cc8fb){return db[_0x0a9e('0x5a')]['count']({'where':{'ChatGroupId':_0x5239ef['params']['id'],'ToId':_0x5239ef['user']['id'],'read':![]}})[_0x0a9e('0x1d')](function(_0x49d231){return{'id':_[_0x0a9e('0x5b')](_0x5239ef[_0x0a9e('0x53')]['id']),'count':_0x49d231};})[_0x0a9e('0x1d')](respondWithResult(_0x3649cc,null))[_0x0a9e('0x28')](handleError(_0x3649cc,null));};exports[_0x0a9e('0x5c')]=function(_0x26d7db,_0x49eed0,_0x1627a7){return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x26d7db[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))['then'](function(_0x453360){if(_0x453360){return _0x453360[_0x0a9e('0x5c')](_0x26d7db[_0x0a9e('0x56')][_0x0a9e('0x5d')],_['omit'](_0x26d7db[_0x0a9e('0x56')],[_0x0a9e('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x49eed0,null))[_0x0a9e('0x28')](handleError(_0x49eed0,null));};exports[_0x0a9e('0x5e')]=function(_0x88dcbf,_0x409b29,_0x401837){var _0x4d4a35={};var _0x176840={};var _0x2937e0;var _0x281c7d;return db['ChatGroup'][_0x0a9e('0x5f')]({'where':{'id':_0x88dcbf['params']['id']}})['then'](handleEntityNotFound(_0x409b29,null))[_0x0a9e('0x1d')](function(_0x4556c5){if(_0x4556c5){_0x2937e0=_0x4556c5;_0x176840[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x60')][_0x0a9e('0x39')]);_0x176840[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x88dcbf[_0x0a9e('0x3d')]);_0x176840[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],_0x176840[_0x0a9e('0x3d')]);_0x4d4a35[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x88dcbf[_0x0a9e('0x3d')]['fields']));_0x4d4a35[_0x0a9e('0x42')]=_0x4d4a35[_0x0a9e('0x42')][_0x0a9e('0x54')]?_0x4d4a35['attributes']:_0x176840[_0x0a9e('0x3c')];_0x4d4a35[_0x0a9e('0x45')]=qs['sort'](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x4d4a35[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x88dcbf['query'],_0x176840['filters']));if(_0x88dcbf['query'][_0x0a9e('0x49')]){_0x4d4a35[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x4d4a35[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x4d4a35[_0x0a9e('0x42')],function(_0xeef20){var _0x1a0677={};_0x1a0677[_0xeef20]={'$like':'%'+_0x88dcbf['query'][_0x0a9e('0x49')]+'%'};return _0x1a0677;})});}_0x4d4a35=_[_0x0a9e('0x4a')]({},_0x4d4a35,_0x88dcbf[_0x0a9e('0x4d')]);return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x583b2e){if(_0x583b2e){_0x281c7d=_0x583b2e[_0x0a9e('0x54')];if(!_0x88dcbf[_0x0a9e('0x3d')]['hasOwnProperty'](_0x0a9e('0x44'))){_0x4d4a35[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x88dcbf[_0x0a9e('0x3d')]['limit']);_0x4d4a35[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x3d91db){if(_0x3d91db){return _0x3d91db?{'count':_0x281c7d,'rows':_0x3d91db}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x409b29,null))[_0x0a9e('0x28')](handleError(_0x409b29,null));};exports['removeMembers']=function(_0x290d43,_0x3511c9,_0x30a4c7){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x290d43[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3511c9,null))[_0x0a9e('0x1d')](function(_0x1a7b03){if(_0x1a7b03){return _0x1a7b03[_0x0a9e('0x61')](_0x290d43[_0x0a9e('0x3d')][_0x0a9e('0x5d')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x3511c9,null))[_0x0a9e('0x28')](handleError(_0x3511c9,null));};exports['addMessage']=function(_0xf4120f,_0x11da9c,_0xc599b3){if(_0xf4120f['body']['id']){delete _0xf4120f[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0xf4120f[_0x0a9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x11da9c,null))['then'](function(_0x7ebea8){if(_0x7ebea8){_0xf4120f[_0x0a9e('0x56')]['ChatGroupId']=_0x7ebea8['id'];return db[_0x0a9e('0x5a')]['create'](_0xf4120f[_0x0a9e('0x56')]);}})[_0x0a9e('0x1d')](respondWithResult(_0x11da9c,null))['catch'](handleError(_0x11da9c,null));};exports[_0x0a9e('0x62')]=function(_0x41cf12,_0x2d2286,_0x42b959){var _0x3755fe={};var _0x1f42a0={};var _0x444f1f;var _0x482ca2;return db[_0x0a9e('0x38')][_0x0a9e('0x5f')]({'where':{'id':_0x41cf12[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2d2286,null))['then'](function(_0xf51744){if(_0xf51744){_0x444f1f=_0xf51744;_0x1f42a0[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x5a')]['rawAttributes']);_0x1f42a0[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x41cf12[_0x0a9e('0x3d')]);_0x1f42a0[_0x0a9e('0x3f')]=_['intersection'](_0x1f42a0['model'],_0x1f42a0[_0x0a9e('0x3d')]);_0x3755fe[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x1f42a0['model'],qs[_0x0a9e('0x41')](_0x41cf12[_0x0a9e('0x3d')]['fields']));_0x3755fe['attributes']=_0x3755fe[_0x0a9e('0x42')]['length']?_0x3755fe['attributes']:_0x1f42a0['model'];_0x3755fe[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x3755fe[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_['pick'](_0x41cf12[_0x0a9e('0x3d')],_0x1f42a0['filters']));if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x3755fe[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x3755fe['where'],{'$or':_[_0x0a9e('0x4b')](_0x3755fe[_0x0a9e('0x42')],function(_0x1d4877){var _0x5b74c3={};_0x5b74c3[_0x1d4877]={'$like':'%'+_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x5b74c3;})});}if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')]){var _0x255e49=_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')][_0x0a9e('0x64')](',');var _0x509efe={};_0x509efe[_0x255e49[0x0]]={'$gte':moment(_0x255e49[0x1])[_0x0a9e('0x65')](_0x0a9e('0x66'))};_0x3755fe['where']=_[_0x0a9e('0x4a')](_0x3755fe[_0x0a9e('0x47')],_0x509efe);}_0x3755fe=_[_0x0a9e('0x4a')]({},_0x3755fe,_0x41cf12['options']);return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){_0x482ca2=_0x8c8fbe[_0x0a9e('0x54')];if(!_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x3755fe[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x41cf12[_0x0a9e('0x3d')]['limit']);_0x3755fe[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})[_0x0a9e('0x1d')](function(_0x6803d6){if(_0x6803d6){return _0x6803d6?{'count':_0x482ca2,'rows':_0x6803d6}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x2d2286,null))[_0x0a9e('0x28')](handleError(_0x2d2286,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index d06ce59..f81ed68 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 _0x077b=['hasOwnProperty','hook','exports','events','ChatGroup','save','update','remove','emit'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x077b,0xc0));var _0xb077=function(_0x52f5e1,_0x2b485b){_0x52f5e1=_0x52f5e1-0x0;var _0xf2b5ea=_0x077b[_0x52f5e1];return _0xf2b5ea;};'use strict';var EventEmitter=require(_0xb077('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xb077('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb077('0x2'),'afterUpdate':_0xb077('0x3'),'afterDestroy':_0xb077('0x4')};function emitEvent(_0x441305){return function(_0x1db4ea,_0x44df10,_0x113256){ChatGroupEvents['emit'](_0x441305+':'+_0x1db4ea['id'],_0x1db4ea);ChatGroupEvents[_0xb077('0x5')](_0x441305,_0x1db4ea);_0x113256(null);};}for(var e in events){if(events[_0xb077('0x6')](e)){var event=events[e];ChatGroup[_0xb077('0x7')](e,emitEvent(event));}}module[_0xb077('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x0298=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0x0298,0x1bb));var _0x8029=function(_0x59008b,_0x75ea97){_0x59008b=_0x59008b-0x0;var _0x20359c=_0x0298[_0x59008b];return _0x20359c;};'use strict';var EventEmitter=require(_0x8029('0x0'));var ChatGroup=require(_0x8029('0x1'))['db'][_0x8029('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8029('0x3')](0x0);var events={'afterCreate':_0x8029('0x4'),'afterUpdate':_0x8029('0x5'),'afterDestroy':_0x8029('0x6')};function emitEvent(_0x5c4fe7){return function(_0x46de94,_0x1df48e,_0x1ad32c){ChatGroupEvents[_0x8029('0x7')](_0x5c4fe7+':'+_0x46de94['id'],_0x46de94);ChatGroupEvents[_0x8029('0x7')](_0x5c4fe7,_0x46de94);_0x1ad32c(null);};}for(var e in events){if(events[_0x8029('0x8')](e)){var event=events[e];ChatGroup[_0x8029('0x9')](e,emitEvent(event));}}module[_0x8029('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 8810bff..b445b5f 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 _0x9a41=['./chatGroup.attributes','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0x9a41,0xf9));var _0x19a4=function(_0x48a7e6,_0x1f8e11){_0x48a7e6=_0x48a7e6-0x0;var _0x2885f3=_0x9a41[_0x48a7e6];return _0x2885f3;};'use strict';var _=require(_0x19a4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x19a4('0x1'));var moment=require(_0x19a4('0x2'));var BPromise=require(_0x19a4('0x3'));var rp=require(_0x19a4('0x4'));var fs=require('fs');var path=require(_0x19a4('0x5'));var rimraf=require('rimraf');var config=require(_0x19a4('0x6'));var attributes=require(_0x19a4('0x7'));module['exports']=function(_0x6b4985,_0x1b9798){return _0x6b4985['define']('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e94=['request-promise','path','./chatGroup.attributes','ChatGroup','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e94,0x148));var _0x44e9=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x4e94[_0x385c76];return _0x5c8367;};'use strict';var _=require(_0x44e9('0x0'));var util=require(_0x44e9('0x1'));var logger=require(_0x44e9('0x2'))(_0x44e9('0x3'));var moment=require(_0x44e9('0x4'));var BPromise=require('bluebird');var rp=require(_0x44e9('0x5'));var fs=require('fs');var path=require(_0x44e9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44e9('0x7'));module['exports']=function(_0x5a8fb1,_0xbe296e){return _0x5a8fb1['define'](_0x44e9('0x8'),attributes,{'tableName':'chat_groups','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 a579e26..46fe78a 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 _0xa234=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa234,0x142));var _0x4a23=function(_0x1b32a9,_0x238cce){_0x1b32a9=_0x1b32a9-0x0;var _0x3d0d9c=_0xa234[_0x1b32a9];return _0x3d0d9c;};'use strict';var _=require(_0x4a23('0x0'));var util=require(_0x4a23('0x1'));var moment=require(_0x4a23('0x2'));var BPromise=require(_0x4a23('0x3'));var rs=require(_0x4a23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a23('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a23('0x6'))('rpc');var config=require(_0x4a23('0x7'));var jayson=require(_0x4a23('0x8'));var client=jayson[_0x4a23('0x9')][_0x4a23('0xa')]({'port':0x232a});config[_0x4a23('0xb')]=_[_0x4a23('0xc')](config['redis'],{'host':_0x4a23('0xd'),'port':0x18eb});var socket=require(_0x4a23('0xe'))(new Redis(config[_0x4a23('0xb')]));require(_0x4a23('0xf'))[_0x4a23('0x10')](socket);function respondWithRpcPromise(_0x1889cf,_0x139675,_0x24f91c){return new BPromise(function(_0x2b835b,_0x3f4c83){return client[_0x4a23('0x11')](_0x1889cf,_0x24f91c)['then'](function(_0x4364cc){logger[_0x4a23('0x12')](_0x4a23('0x13'),_0x139675,'request\x20sent');logger[_0x4a23('0x14')](_0x4a23('0x15'),_0x139675,_0x4a23('0x16'),JSON[_0x4a23('0x17')](_0x4364cc));if(_0x4364cc['error']){if(_0x4364cc[_0x4a23('0x18')][_0x4a23('0x19')]===0x1f4){logger[_0x4a23('0x18')](_0x4a23('0x13'),_0x139675,_0x4364cc['error']['message']);return _0x3f4c83(_0x4364cc['error']['message']);}logger['error'](_0x4a23('0x13'),_0x139675,_0x4364cc[_0x4a23('0x18')][_0x4a23('0x1a')]);return _0x2b835b(_0x4364cc[_0x4a23('0x18')]['message']);}else{logger[_0x4a23('0x12')]('ChatGroup,\x20%s,\x20%s',_0x139675,_0x4a23('0x16'));_0x2b835b(_0x4364cc[_0x4a23('0x1b')][_0x4a23('0x1a')]);}})[_0x4a23('0x1c')](function(_0x2abe80){logger[_0x4a23('0x18')]('ChatGroup,\x20%s,\x20%s',_0x139675,_0x2abe80);_0x3f4c83(_0x2abe80);});});} \ No newline at end of file +var _0x34d2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment'];(function(_0x480ca1,_0xc0551a){var _0x50253d=function(_0x1a8495){while(--_0x1a8495){_0x480ca1['push'](_0x480ca1['shift']());}};_0x50253d(++_0xc0551a);}(_0x34d2,0x7b));var _0x234d=function(_0x409e77,_0x96e6ed){_0x409e77=_0x409e77-0x0;var _0x3bb44f=_0x34d2[_0x409e77];return _0x3bb44f;};'use strict';var _=require('lodash');var util=require(_0x234d('0x0'));var moment=require(_0x234d('0x1'));var BPromise=require(_0x234d('0x2'));var rs=require(_0x234d('0x3'));var fs=require('fs');var Redis=require(_0x234d('0x4'));var db=require(_0x234d('0x5'))['db'];var utils=require(_0x234d('0x6'));var logger=require(_0x234d('0x7'))('rpc');var config=require(_0x234d('0x8'));var jayson=require(_0x234d('0x9'));var client=jayson['client'][_0x234d('0xa')]({'port':0x232a});config[_0x234d('0xb')]=_[_0x234d('0xc')](config[_0x234d('0xb')],{'host':_0x234d('0xd'),'port':0x18eb});var socket=require(_0x234d('0xe'))(new Redis(config[_0x234d('0xb')]));require(_0x234d('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d25c9,_0x4d8b16,_0x4f6810){return new BPromise(function(_0x50fdaa,_0x48d44e){return client['request'](_0x5d25c9,_0x4f6810)['then'](function(_0x3ed84f){logger[_0x234d('0x10')](_0x234d('0x11'),_0x4d8b16,_0x234d('0x12'));logger[_0x234d('0x13')](_0x234d('0x14'),_0x4d8b16,'request\x20sent',JSON['stringify'](_0x3ed84f));if(_0x3ed84f['error']){if(_0x3ed84f['error']['code']===0x1f4){logger['error'](_0x234d('0x11'),_0x4d8b16,_0x3ed84f[_0x234d('0x15')][_0x234d('0x16')]);return _0x48d44e(_0x3ed84f['error'][_0x234d('0x16')]);}logger[_0x234d('0x15')](_0x234d('0x11'),_0x4d8b16,_0x3ed84f['error']['message']);return _0x50fdaa(_0x3ed84f['error']['message']);}else{logger[_0x234d('0x10')](_0x234d('0x11'),_0x4d8b16,_0x234d('0x12'));_0x50fdaa(_0x3ed84f[_0x234d('0x17')][_0x234d('0x16')]);}})[_0x234d('0x18')](function(_0x2b4ed2){logger[_0x234d('0x15')](_0x234d('0x11'),_0x4d8b16,_0x2b4ed2);_0x48d44e(_0x2b4ed2);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 0159b1b..75bced5 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 _0xc13b=['emit','register','chatGroup:','save','remove','update'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xc13b,0xbd));var _0xbc13=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xc13b[_0x4fc9e6];return _0x551d28;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xbc13('0x0'),_0xbc13('0x1'),_0xbc13('0x2')];function createListener(_0x2a472f,_0x7ac4aa){return function(_0x21b930){_0x7ac4aa[_0xbc13('0x3')](_0x2a472f,_0x21b930);};}function removeListener(_0x348b72,_0x3a434d){return function(){ChatGroupEvents['removeListener'](_0x348b72,_0x3a434d);};}exports[_0xbc13('0x4')]=function(_0x57672d){for(var _0x3b4484=0x0,_0x354a49=events['length'];_0x3b4484<_0x354a49;_0x3b4484++){var _0x2ecb3e=events[_0x3b4484];var _0x2bcd91=createListener(_0xbc13('0x5')+_0x2ecb3e,_0x57672d);ChatGroupEvents['on'](_0x2ecb3e,_0x2bcd91);}}; \ No newline at end of file +var _0x6fe8=['./chatGroup.events','save','remove','update','emit','removeListener','length'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x6fe8,0xc4));var _0x86fe=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x6fe8[_0x26b622];return _0x58a028;};'use strict';var ChatGroupEvents=require(_0x86fe('0x0'));var events=[_0x86fe('0x1'),_0x86fe('0x2'),_0x86fe('0x3')];function createListener(_0x9fc847,_0x1811e4){return function(_0x19a6d7){_0x1811e4[_0x86fe('0x4')](_0x9fc847,_0x19a6d7);};}function removeListener(_0x4d935a,_0x415555){return function(){ChatGroupEvents[_0x86fe('0x5')](_0x4d935a,_0x415555);};}exports['register']=function(_0x1bf710){for(var _0x290c2d=0x0,_0x3d97f1=events[_0x86fe('0x6')];_0x290c2d<_0x3d97f1;_0x290c2d++){var _0x1fb65a=events[_0x290c2d];var _0x46a547=createListener('chatGroup:'+_0x1fb65a,_0x1bf710);ChatGroupEvents['on'](_0x1fb65a,_0x46a547);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 28bf669..e59bc96 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 _0xfce9=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','getUnread','/:id/members','/:id/messages','create','post','addMembers','addMessage','put','delete','destroy','exports','multer'];(function(_0x55ec9a,_0x3808b7){var _0x4d14b9=function(_0x282892){while(--_0x282892){_0x55ec9a['push'](_0x55ec9a['shift']());}};_0x4d14b9(++_0x3808b7);}(_0xfce9,0x15d));var _0x9fce=function(_0x37a3e0,_0x216b86){_0x37a3e0=_0x37a3e0-0x0;var _0x30ce1d=_0xfce9[_0x37a3e0];return _0x30ce1d;};'use strict';var multer=require(_0x9fce('0x0'));var util=require(_0x9fce('0x1'));var path=require(_0x9fce('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fce('0x3'));var router=express['Router']();var fs_extra=require(_0x9fce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9fce('0x5'));var config=require(_0x9fce('0x6'));var controller=require(_0x9fce('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9fce('0x8')]);router[_0x9fce('0x9')](_0x9fce('0xa'),auth[_0x9fce('0xb')](),controller[_0x9fce('0xc')]);router[_0x9fce('0x9')](_0x9fce('0xd'),auth[_0x9fce('0xb')](),controller['show']);router['get']('/:id/unread',auth[_0x9fce('0xb')](),controller[_0x9fce('0xe')]);router[_0x9fce('0x9')](_0x9fce('0xf'),auth[_0x9fce('0xb')](),controller['getMembers']);router[_0x9fce('0x9')](_0x9fce('0x10'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x9fce('0x11')]);router[_0x9fce('0x12')](_0x9fce('0xf'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x13')]);router[_0x9fce('0x12')](_0x9fce('0x10'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x14')]);router[_0x9fce('0x15')](_0x9fce('0xd'),auth[_0x9fce('0xb')](),controller['update']);router[_0x9fce('0x16')]('/:id',auth[_0x9fce('0xb')](),controller[_0x9fce('0x17')]);router[_0x9fce('0x16')](_0x9fce('0xf'),auth[_0x9fce('0xb')](),controller['removeMembers']);module[_0x9fce('0x18')]=router; \ No newline at end of file +var _0x0fd2=['util','path','Router','fs-extra','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','put','update','destroy','delete','removeMembers','exports'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x0fd2,0x1db));var _0x20fd=function(_0x356573,_0x521b14){_0x356573=_0x356573-0x0;var _0x255550=_0x0fd2[_0x356573];return _0x255550;};'use strict';var multer=require('multer');var util=require(_0x20fd('0x0'));var path=require(_0x20fd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x20fd('0x2')]();var fs_extra=require(_0x20fd('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20fd('0x4'));var controller=require(_0x20fd('0x5'));router[_0x20fd('0x6')]('/',auth[_0x20fd('0x7')](),controller[_0x20fd('0x8')]);router[_0x20fd('0x6')](_0x20fd('0x9'),auth[_0x20fd('0x7')](),controller[_0x20fd('0xa')]);router[_0x20fd('0x6')](_0x20fd('0xb'),auth[_0x20fd('0x7')](),controller['show']);router[_0x20fd('0x6')](_0x20fd('0xc'),auth['isAuthenticated'](),controller['getUnread']);router[_0x20fd('0x6')](_0x20fd('0xd'),auth[_0x20fd('0x7')](),controller[_0x20fd('0xe')]);router[_0x20fd('0x6')](_0x20fd('0xf'),auth[_0x20fd('0x7')](),controller[_0x20fd('0x10')]);router[_0x20fd('0x11')]('/',auth['isAuthenticated'](),controller[_0x20fd('0x12')]);router[_0x20fd('0x11')](_0x20fd('0xd'),auth[_0x20fd('0x7')](),controller['addMembers']);router[_0x20fd('0x11')](_0x20fd('0xf'),auth[_0x20fd('0x7')](),controller['addMessage']);router[_0x20fd('0x13')](_0x20fd('0xb'),auth['isAuthenticated'](),controller[_0x20fd('0x14')]);router['delete'](_0x20fd('0xb'),auth[_0x20fd('0x7')](),controller[_0x20fd('0x15')]);router[_0x20fd('0x16')]('/:id/members',auth[_0x20fd('0x7')](),controller[_0x20fd('0x17')]);module[_0x20fd('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 863be79..c34c552 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 _0xc902=['ENUM','star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x4c63ca,_0x2df42e){var _0x1105f6=function(_0x4bb857){while(--_0x4bb857){_0x4c63ca['push'](_0x4c63ca['shift']());}};_0x1105f6(++_0x2df42e);}(_0xc902,0x15c));var _0x2c90=function(_0x51641f,_0x3da09f){_0x51641f=_0x51641f-0x0;var _0x26e87a=_0xc902[_0x51641f];return _0x26e87a;};'use strict';var Sequelize=require(_0x2c90('0x0'));module[_0x2c90('0x1')]={'closed':{'type':Sequelize[_0x2c90('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2c90('0x3')]},'ratingType':{'type':Sequelize[_0x2c90('0x4')](_0x2c90('0x5'),'thumb'),'defaultValue':_0x2c90('0x5')},'ratingMessage':{'type':Sequelize[_0x2c90('0x6')]},'pathTranscript':{'type':Sequelize[_0x2c90('0x6')]},'mailTranscript':{'type':Sequelize[_0x2c90('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2c90('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2c90('0x7')]},'note':{'type':Sequelize[_0x2c90('0x7')]},'browserName':{'type':Sequelize[_0x2c90('0x7')]},'browserVersion':{'type':Sequelize[_0x2c90('0x7')]},'osName':{'type':Sequelize[_0x2c90('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x2c90('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x2c90('0x6')]},'customerIp':{'type':Sequelize[_0x2c90('0x7')]},'formData':{'type':Sequelize[_0x2c90('0x6')](_0x2c90('0x9'))},'read1stAt':{'type':Sequelize[_0x2c90('0x8')]},'lastMsgAt':{'type':Sequelize[_0x2c90('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x2c90('0x4')]('in',_0x2c90('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2c90('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x2c90('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1d2d=['BOOLEAN','INTEGER','ENUM','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x3c5d76,_0x39c6a6){_0x3c5d76=_0x3c5d76-0x0;var _0x1d8d73=_0x1d2d[_0x3c5d76];return _0x1d8d73;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'closed':{'type':Sequelize[_0xd1d2('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd1d2('0x3')]},'ratingType':{'type':Sequelize[_0xd1d2('0x4')]('star',_0xd1d2('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd1d2('0x6')]},'mailTranscript':{'type':Sequelize[_0xd1d2('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd1d2('0x8')]},'disposition':{'type':Sequelize[_0xd1d2('0x7')]},'secondDisposition':{'type':Sequelize[_0xd1d2('0x7')]},'thirdDisposition':{'type':Sequelize[_0xd1d2('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xd1d2('0x7')]},'browserVersion':{'type':Sequelize[_0xd1d2('0x7')]},'osName':{'type':Sequelize[_0xd1d2('0x7')]},'osVersion':{'type':Sequelize[_0xd1d2('0x7')]},'deviceModel':{'type':Sequelize[_0xd1d2('0x7')]},'deviceVendor':{'type':Sequelize[_0xd1d2('0x7')]},'deviceType':{'type':Sequelize[_0xd1d2('0x7')]},'referer':{'type':Sequelize[_0xd1d2('0x6')]},'customerIp':{'type':Sequelize[_0xd1d2('0x7')]},'formData':{'type':Sequelize[_0xd1d2('0x6')](_0xd1d2('0x9'))},'read1stAt':{'type':Sequelize[_0xd1d2('0x8')]},'lastMsgAt':{'type':Sequelize[_0xd1d2('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd1d2('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd1d2('0x7')]},'customerPort':{'type':Sequelize[_0xd1d2('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xd1d2('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xd1d2('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 7c1698f..f7f4e2f 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 _0x5eb8=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','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','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','rows','show','params','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','CmContact','%s%d','agentAlias','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','Account','Owner','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','renderFile','.pdf','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','render','body','interaction','map','TagIds','Tags','forEach','catch','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','User','UserId','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5eb8,0xb0));var _0x85eb=function(_0x27650e,_0x278f7a){_0x27650e=_0x27650e-0x0;var _0x28fe08=_0x5eb8[_0x27650e];return _0x28fe08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var pdf=require(_0x85eb('0x14'));var hardwareService=require(_0x85eb('0x15'));var logger=require('../../config/logger')(_0x85eb('0x16'));var utils=require(_0x85eb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x85eb('0x18'));var db=require(_0x85eb('0x19'))['db'];config[_0x85eb('0x1a')]=_[_0x85eb('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x85eb('0x1c'))(new Redis(config['redis']));require(_0x85eb('0x1d'))[_0x85eb('0x1e')](socket);var jayson=require(_0x85eb('0x1f'));var client=jayson[_0x85eb('0x20')][_0x85eb('0x21')]({'port':0x232b});var client9004=jayson['client'][_0x85eb('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x59237b,_0x17140b,_0x10c2c9,_0x3e23e8){return new BPromise(function(_0x5deab1,_0x5dbeda){var _0x5c5cbb=_0x3e23e8||client;return _0x5c5cbb['request'](_0x59237b,_0x10c2c9)[_0x85eb('0x22')](function(_0x39ca96){logger[_0x85eb('0x23')](_0x85eb('0x24'),_0x17140b,_0x85eb('0x25'));logger[_0x85eb('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x17140b,_0x85eb('0x25'),JSON[_0x85eb('0x27')](_0x39ca96));if(_0x39ca96[_0x85eb('0x28')]){if(_0x39ca96['error']['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x17140b,_0x39ca96[_0x85eb('0x28')][_0x85eb('0x29')]);return _0x5dbeda(_0x39ca96[_0x85eb('0x28')][_0x85eb('0x29')]);}logger[_0x85eb('0x28')](_0x85eb('0x24'),_0x17140b,_0x39ca96['error']['message']);return _0x5deab1(_0x39ca96['error'][_0x85eb('0x29')]);}else{logger[_0x85eb('0x23')](_0x85eb('0x24'),_0x17140b,_0x85eb('0x25'));_0x5deab1(_0x39ca96[_0x85eb('0x2a')][_0x85eb('0x29')]);}})['catch'](function(_0x39d3fe){logger[_0x85eb('0x28')](_0x85eb('0x24'),_0x17140b,_0x39d3fe);_0x5dbeda(_0x39d3fe);});});}function respondWithStatusCode(_0x30e766,_0x3e2326){_0x3e2326=_0x3e2326||0xcc;return function(_0x57a03c){if(_0x57a03c){return _0x30e766[_0x85eb('0x2b')](_0x3e2326);}return _0x30e766[_0x85eb('0x2c')](_0x3e2326)[_0x85eb('0x2d')]();};}function respondWithResult(_0x3e7eb9,_0x40f13e){_0x40f13e=_0x40f13e||0xc8;return function(_0x29d262){if(_0x29d262){return _0x3e7eb9['status'](_0x40f13e)['json'](_0x29d262);}};}function respondWithFilteredResult(_0x37515c,_0x585f2a){return function(_0xa9b14f){if(_0xa9b14f){var _0x5255eb=typeof _0x585f2a[_0x85eb('0x2e')]===_0x85eb('0x2f')&&typeof _0x585f2a[_0x85eb('0x30')]===_0x85eb('0x2f');var _0xa67e1c=_0xa9b14f[_0x85eb('0x31')];var _0x41ed76=_0x5255eb?0x0:_0x585f2a['offset'];var _0x237f19=_0x5255eb?_0xa9b14f[_0x85eb('0x31')]:_0x585f2a['offset']+_0x585f2a[_0x85eb('0x30')];var _0x5af2de;if(_0x237f19>=_0xa67e1c){_0x237f19=_0xa67e1c;_0x5af2de=0xc8;}else{_0x5af2de=0xce;}_0x37515c['status'](_0x5af2de);return _0x37515c[_0x85eb('0x32')](_0x85eb('0x33'),_0x41ed76+'-'+_0x237f19+'/'+_0xa67e1c)[_0x85eb('0x34')](_0xa9b14f);}return null;};}function patchUpdates(_0x246dda){return function(_0x33c05f){try{jsonpatch[_0x85eb('0x35')](_0x33c05f,_0x246dda,!![]);}catch(_0x39b574){return BPromise[_0x85eb('0x36')](_0x39b574);}return _0x33c05f[_0x85eb('0x37')]();};}function saveUpdates(_0x1008bf,_0x4cbee0){return function(_0x14fe58){if(_0x14fe58){return _0x14fe58[_0x85eb('0x38')](_0x1008bf)['then'](function(_0x505321){return _0x505321;});}return null;};}function removeEntity(_0x340745,_0x13f245){return function(_0x38b96e){if(_0x38b96e){return _0x38b96e[_0x85eb('0x39')]()[_0x85eb('0x22')](function(){_0x340745[_0x85eb('0x2c')](0xcc)[_0x85eb('0x2d')]();});}};}function handleEntityNotFound(_0x35f092,_0x272a99){return function(_0x373e5f){if(!_0x373e5f){_0x35f092[_0x85eb('0x2b')](0x194);}return _0x373e5f;};}function handleError(_0x317d19,_0x317d86){_0x317d86=_0x317d86||0x1f4;return function(_0x33605a){logger['error'](_0x33605a[_0x85eb('0x3a')]);if(_0x33605a[_0x85eb('0x3b')]){delete _0x33605a['name'];}_0x317d19['status'](_0x317d86)[_0x85eb('0x3c')](_0x33605a);};}function getMustacheRender(_0xe22d16,_0x5389d8){return Mustache[_0x85eb('0x3d')](_0xe22d16,_['merge'](_0x5389d8[_0x85eb('0x3e')],{'contact':_0x5389d8['contact'],'message':_0x5389d8[_0x85eb('0x29')],'agent':_0x5389d8['agent'],'interaction':_0x5389d8[_0x85eb('0x3f')],'account':_0x5389d8['account']}))||'';}function getInteractionUsers(_0x38ab0f,_0x16202e){return new BPromise(function(_0x4de24e,_0x313989){try{if(_0x16202e[_0x38ab0f['id']]){_0x38ab0f['Users']=_[_0x85eb('0x40')](_0x16202e[_0x38ab0f['id']],function(_0x331260){return{'id':_0x331260['id'],'fullname':_0x331260['fullname']};});}}catch(_0x241488){_0x313989(_0x241488);}_0x4de24e(_0x38ab0f);});}function getInteractionTags(_0x4c25ed,_0x5495cf){return new BPromise(function(_0x1b8a71,_0x4edb2d){try{if(_0x4c25ed[_0x85eb('0x41')]){_0x4c25ed[_0x85eb('0x42')]=[];_0x4c25ed['TagIds']['split'](',')[_0x85eb('0x43')](function(_0x422ec3){_0x4c25ed['Tags']['push'](_0x5495cf[_0x422ec3]);});}delete _0x4c25ed[_0x85eb('0x41')];}catch(_0x2d1b32){_0x4edb2d(_0x2d1b32);}_0x1b8a71(_0x4c25ed);});}function updateChatInteraction(_0x2211f9,_0x202681,_0x3be961){return new BPromise(function(_0x5b7411,_0x5ccf8a){return getInteractionUsers(_0x2211f9,_0x3be961)[_0x85eb('0x22')](function(_0x208c27){return getInteractionTags(_0x208c27,_0x202681);})[_0x85eb('0x22')](function(_0x2ed39d){_0x5b7411(_0x2ed39d);})[_0x85eb('0x44')](function(_0x40e2a2){_0x5ccf8a(_0x40e2a2);});});}exports[_0x85eb('0x45')]=function(_0x469639,_0x540c7a){var _0x3a06af={},_0x1cabcb={},_0x5d90cc={'count':0x0,'rows':[]};var _0x1b77b3=_[_0x85eb('0x40')](db[_0x85eb('0x46')][_0x85eb('0x47')],function(_0x1b1559){return{'name':_0x1b1559[_0x85eb('0x48')],'type':_0x1b1559['type'][_0x85eb('0x49')]};});_0x1cabcb[_0x85eb('0x4a')]=_[_0x85eb('0x40')](_0x1b77b3,_0x85eb('0x3b'));_0x1cabcb[_0x85eb('0x4b')]=_[_0x85eb('0x4c')](_0x469639[_0x85eb('0x4b')]);_0x1cabcb[_0x85eb('0x4d')]=_['intersection'](_0x1cabcb[_0x85eb('0x4a')],_0x1cabcb[_0x85eb('0x4b')]);_0x3a06af[_0x85eb('0x4e')]=_[_0x85eb('0x4f')](_0x1cabcb[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x50')]));_0x3a06af[_0x85eb('0x4e')]=_0x3a06af[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x3a06af[_0x85eb('0x4e')]:_0x1cabcb['model'];if(!_0x469639[_0x85eb('0x4b')][_0x85eb('0x52')](_0x85eb('0x53'))){_0x3a06af['limit']=qs[_0x85eb('0x30')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x30')]);_0x3a06af[_0x85eb('0x2e')]=qs[_0x85eb('0x2e')](_0x469639['query'][_0x85eb('0x2e')]);}_0x3a06af[_0x85eb('0x54')]=qs[_0x85eb('0x55')](_0x469639['query'][_0x85eb('0x55')]);_0x3a06af[_0x85eb('0x56')]=qs[_0x85eb('0x4d')](_['pick'](_0x469639['query'],_0x1cabcb[_0x85eb('0x4d')]),_0x1b77b3);var _0x52996f=[];var _0x5ed98a=squel[_0x85eb('0x57')]()['field']('id')[_0x85eb('0x58')](_0x85eb('0x3b'))['field']('color')[_0x85eb('0x59')](_0x85eb('0x5a'));var _0x178d76=squel[_0x85eb('0x57')]()[_0x85eb('0x58')]('u.id')[_0x85eb('0x58')](_0x85eb('0x5b'))[_0x85eb('0x58')](_0x85eb('0x5c'))[_0x85eb('0x59')]('user_has_chat_interactions','ui')[_0x85eb('0x5d')]('users','u',_0x85eb('0x5e'));var _0x40d846=squel['select']()[_0x85eb('0x59')](_0x85eb('0x5f'),'i')[_0x85eb('0x5d')](_0x85eb('0x60'),'c',_0x85eb('0x61'))[_0x85eb('0x5d')]('users','o',_0x85eb('0x62'))['left_join'](_0x85eb('0x63'),'a',_0x85eb('0x64'))['left_join'](_0x85eb('0x65'),'me',_0x85eb('0x66'))['left_join'](_0x85eb('0x67'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x85eb('0x5d')](_0x85eb('0x5a'),'t',_0x85eb('0x68'));var _0x13c0b3=squel[_0x85eb('0x69')]();var _0x15d4a7=[];var _0x5a729e=squel[_0x85eb('0x69')]();var _0x76a9c6;if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x6a')]){_0x76a9c6=as[_0x85eb('0x6b')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x6a')]);var _0x1cb659=_0x76a9c6[_0x85eb('0x6c')];for(var _0x13cc2a=0x0;_0x13cc2a<_0x76a9c6[_0x85eb('0x6d')]['length'];_0x13cc2a++){var _0x271842=_0x76a9c6[_0x85eb('0x6d')][_0x13cc2a];var _0x46e5d3='i';var _0xdaf2fe=_[_0x85eb('0x6e')](_0x1b77b3,[_0x85eb('0x3b'),_0x271842['field']]);if(!_0xdaf2fe){switch(_0x271842[_0x85eb('0x58')]){case'unreadMessages':if(_0x271842[_0x85eb('0x6f')]==0x1){_0x40d846[_0x85eb('0x70')]('`'+_0x271842[_0x85eb('0x58')]+_0x85eb('0x71'));}else{_0x40d846[_0x85eb('0x70')]('`'+_0x271842['field']+_0x85eb('0x72'));}break;case _0x85eb('0x73'):if(_0x271842[_0x85eb('0x74')]===_0x85eb('0x75')){if(_0x271842[_0x85eb('0x6f')][_0x85eb('0x76')]('\x20')[_0x85eb('0x51')]>0x1){_0x13c0b3[_0x1cb659](_0x85eb('0x77'),qs['getFullTextValue'](_0x271842[_0x85eb('0x6f')]),null);}else{var _0x4d27bd='%'+_0x271842[_0x85eb('0x6f')]+'%';_0x13c0b3[_0x1cb659](_0x85eb('0x78'),_0x4d27bd,_0x4d27bd,_0x4d27bd);}}else{_0xdaf2fe=_[_0x85eb('0x6e')](_0x1b77b3,[_0x85eb('0x3b'),_0x85eb('0x79')]);_0x271842['field']=_0x85eb('0x79');_0x3ba160=as[_0x85eb('0x7a')](_0x46e5d3,_0xdaf2fe[_0x85eb('0x7b')],_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x7d')],_0x3ba160['value']['end']);}break;case _0x85eb('0x7e'):var _0x572560=_0x271842[_0x85eb('0x6f')][_0x85eb('0x76')](',')[_0x85eb('0x40')](function(_0x23f24a){return Number(_0x23f24a);});_0x572560[_0x85eb('0x43')](function(_0x2b7258){_0x5a729e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b7258+',%');});_0x15d4a7=_[_0x85eb('0x7f')](_0x15d4a7,_0x572560);break;case _0x85eb('0x80'):if(_0x271842[_0x85eb('0x74')]===_0x85eb('0x75')){_0x13c0b3[_0x1cb659]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x271842[_0x85eb('0x6f')]+'%',null);}else{_0xdaf2fe=_[_0x85eb('0x6e')](_0x1b77b3,[_0x85eb('0x3b'),_0x85eb('0x81')]);_0x271842['field']=_0x85eb('0x81');_0x3ba160=as[_0x85eb('0x7a')](_0x46e5d3,_0xdaf2fe[_0x85eb('0x7b')],_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x7d')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x2d')]);}break;case _0x85eb('0x3e'):_0x3ba160=as[_0x85eb('0x7a')]('me',null,_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x7d')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x2d')]);break;}}else{var _0x3ba160=as[_0x85eb('0x7a')](_0x46e5d3,_0xdaf2fe[_0x85eb('0x7b')],_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160['value'][_0x85eb('0x7d')],_0x3ba160['value'][_0x85eb('0x2d')]);}}}else{var _0x2346b1=_(_0x469639[_0x85eb('0x4b')])[_0x85eb('0x4c')]()[_0x85eb('0x40')](function(_0x3de724){return _[_0x85eb('0x82')](_0x1b77b3,[_0x85eb('0x3b'),_0x3de724])?_0x3de724:undefined;})[_0x85eb('0x83')]()['value']();if(!_[_0x85eb('0x84')](_0x2346b1)){_0x2346b1[_0x85eb('0x43')](function(_0x2d795b){if(_0x2d795b===_0x85eb('0x85')){_0x40d846[_0x85eb('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x85eb('0x86')](_0x469639['query'][_0x2d795b]));}else if(_0x2d795b===_0x85eb('0x87')){var _0x330c2b=JSON[_0x85eb('0x88')](_0x469639['query'][_0x2d795b])[_0x85eb('0x89')];var _0x2e358d=JSON[_0x85eb('0x88')](_0x469639['query'][_0x2d795b])['$lte'];_0x40d846[_0x85eb('0x56')](_0x85eb('0x8a'),_0x330c2b,_0x2e358d);}else{if(_0x469639[_0x85eb('0x4b')][_0x2d795b]===_0x85eb('0x8b')){_0x40d846['where']('i.'+_0x2d795b+_0x85eb('0x8c'));}else{_0x40d846['where']('i.'+_0x2d795b+_0x85eb('0x8d'),_0x469639[_0x85eb('0x4b')][_0x2d795b]);}}});}if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x8e')]){if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x8e')]==0x1){_0x40d846['having'](_0x85eb('0x8f'));}else{_0x40d846['having'](_0x85eb('0x90'));}}if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x91')]){_0x15d4a7=_[_0x85eb('0x92')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x91')])?_0x469639[_0x85eb('0x4b')][_0x85eb('0x91')]:new Array(_0x469639[_0x85eb('0x4b')]['tag']);_0x15d4a7[_0x85eb('0x43')](function(_0xd0c1d4){_0x5a729e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd0c1d4+',%');});}if(_0x469639['query'][_0x85eb('0x93')]){var _0x4a5e00=_0x469639[_0x85eb('0x4b')]['filter'][_0x85eb('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x85eb('0x95')](_0x4a5e00)){_0x13c0b3['or'](_0x85eb('0x96'),_0x4a5e00+'%');}else{_0x13c0b3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x85eb('0x97')](_0x4a5e00))['or'](_0x85eb('0x98'),_0x4a5e00+'%');}}}_0x40d846['where'](_0x13c0b3);_0x40d846[_0x85eb('0x99')](_0x85eb('0x9a'));var _0xf076af={'type':db[_0x85eb('0x9b')]['QueryTypes'][_0x85eb('0x9c')],'raw':!![]};var _0x53ccc5=_0x40d846[_0x85eb('0x9d')]();_0x53ccc5[_0x85eb('0x58')](_0x85eb('0x9a'));_0x53ccc5['field'](_0x85eb('0x9e'),_0x85eb('0x9f'));if(_0x3a06af[_0x85eb('0x54')]){_0x3a06af['order'][_0x85eb('0x43')](function(_0x5eb629){var _0x26cc46=_0x5eb629[0x0]===_0x85eb('0xa0')?_0x5eb629[0x0]:'i.'+_0x5eb629[0x0];_0x40d846[_0x85eb('0x54')](_0x26cc46,_0x5eb629[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x15d4a7)){_0x40d846['having'](_0x5a729e);_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa1'),_0x15d4a7);}BPromise[_0x85eb('0xa2')]()['then'](function(){if(!_0x76a9c6){if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x85')])return;_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa3'));_0x40d846[_0x85eb('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x469639['user'][_0x85eb('0xa4')]!==_0x85eb('0xa5'))return;return _0x469639['user'][_0x85eb('0xa6')]({'attributes':['id'],'raw':!![]})[_0x85eb('0x22')](function(_0x3bc357){if(_[_0x85eb('0x84')](_0x3bc357)){_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa7'));_0x40d846[_0x85eb('0x56')](_0x85eb('0xa7'));}else{_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa8'),_[_0x85eb('0x40')](_0x3bc357,'id'));_0x40d846[_0x85eb('0x56')](_0x85eb('0xa8'),_[_0x85eb('0x40')](_0x3bc357,'id'));}});})[_0x85eb('0x22')](function(){if(_0x469639['user'][_0x85eb('0xa4')]===_0x85eb('0xa5')&&!_0x76a9c6&&!_0x469639[_0x85eb('0x4b')][_0x85eb('0x85')])return[];return db[_0x85eb('0xa9')][_0x85eb('0x4b')](_0x53ccc5[_0x85eb('0xaa')](),_0xf076af);})[_0x85eb('0x22')](function(_0x2c0ab5){_0x5d90cc[_0x85eb('0x31')]=_0x2c0ab5['length'];if(_0x5d90cc[_0x85eb('0x31')]===0x0)return[];return db[_0x85eb('0xa9')][_0x85eb('0x4b')](_0x5ed98a[_0x85eb('0xaa')](),_0xf076af)['then'](function(_0x2caf89){_0x52996f=_[_0x85eb('0xab')](_0x2caf89,'id');_0xf076af=_[_0x85eb('0xac')](_0xf076af,{'model':db[_0x85eb('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x50')]){_0x3a06af['attributes'][_0x85eb('0x43')](function(_0x36dbb1){_0x40d846[_0x85eb('0x58')]('i.'+_0x36dbb1);});}else{_0x40d846['field'](_0x85eb('0x9e'),_0x85eb('0x9f'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xad'),_0x85eb('0xae'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xaf'),_0x85eb('0xb0'));_0x40d846['field'](_0x85eb('0xb1'),_0x85eb('0xa0'));_0x40d846['field']('i.*');_0x40d846[_0x85eb('0x58')]('c.firstName',_0x85eb('0xb2'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xb3'),_0x85eb('0xb4'));_0x40d846['field']('c.email',_0x85eb('0xb5'));_0x40d846['field'](_0x85eb('0xb6'),_0x85eb('0xb7'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xb8'),'Contact.mobile');_0x40d846['field'](_0x85eb('0xb9'),_0x85eb('0xba'));_0x40d846[_0x85eb('0x58')]('o.fullname','Owner.fullname');_0x40d846[_0x85eb('0x58')](_0x85eb('0xbb'),_0x85eb('0xbc'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xbd'),_0x85eb('0x41'));}if(_0x3a06af[_0x85eb('0x30')])_0x40d846[_0x85eb('0x30')](_0x3a06af[_0x85eb('0x30')]);if(_0x3a06af[_0x85eb('0x2e')])_0x40d846[_0x85eb('0x2e')](_0x3a06af['offset']);return db[_0x85eb('0xa9')][_0x85eb('0x4b')](_0x40d846['toString'](),_0xf076af);})[_0x85eb('0x22')](function(_0x3c8e3e){if(_0x3c8e3e[_0x85eb('0x51')]>0x0)_0x178d76[_0x85eb('0x56')](_0x85eb('0xbe'),_[_0x85eb('0x40')](_0x3c8e3e,'id'));return db['sequelize']['query'](_0x178d76[_0x85eb('0xaa')](),_0xf076af)['then'](function(_0x2f1ff1){var _0x5596c1=_[_0x85eb('0xbf')](_0x2f1ff1,_0x85eb('0xc0'));var _0x5e8478=[];_0x3c8e3e['forEach'](function(_0x119f69){_0x5e8478[_0x85eb('0xc1')](updateChatInteraction(_0x119f69,_0x52996f,_0x5596c1));});return BPromise['all'](_0x5e8478);});});})[_0x85eb('0x22')](function(_0x2e44b5){_0x5d90cc[_0x85eb('0xc2')]=_0x2e44b5;return _0x5d90cc;})['then'](respondWithFilteredResult(_0x540c7a,_0x3a06af))['catch'](handleError(_0x540c7a,null));};exports[_0x85eb('0xc3')]=function(_0x3a8d0d,_0x189733){var _0x422d33={'raw':![],'where':{'id':_0x3a8d0d[_0x85eb('0xc4')]['id']}},_0x1d695c={};_0x1d695c[_0x85eb('0x4a')]=_[_0x85eb('0x4c')](db[_0x85eb('0x46')][_0x85eb('0x47')]);_0x1d695c['query']=_[_0x85eb('0x4c')](_0x3a8d0d['query']);_0x1d695c[_0x85eb('0x4d')]=_[_0x85eb('0x4f')](_0x1d695c[_0x85eb('0x4a')],_0x1d695c[_0x85eb('0x4b')]);_0x422d33[_0x85eb('0x4e')]=_['intersection'](_0x1d695c[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x3a8d0d[_0x85eb('0x4b')]['fields']));_0x422d33[_0x85eb('0x4e')]=_0x422d33[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x422d33[_0x85eb('0x4e')]:_0x1d695c[_0x85eb('0x4a')];if(_0x3a8d0d[_0x85eb('0x4b')][_0x85eb('0xc5')]){_0x422d33[_0x85eb('0xc6')]=[{'all':!![]}];}_0x422d33=_[_0x85eb('0xac')]({},_0x422d33,_0x3a8d0d[_0x85eb('0xc7')]);return db[_0x85eb('0x46')][_0x85eb('0x6e')](_0x422d33)[_0x85eb('0x22')](handleEntityNotFound(_0x189733,null))[_0x85eb('0x22')](respondWithResult(_0x189733,null))[_0x85eb('0x44')](handleError(_0x189733,null));};exports[_0x85eb('0xc8')]=function(_0x576bc0,_0x364f29){return db[_0x85eb('0x46')][_0x85eb('0xc8')](_0x576bc0[_0x85eb('0x3e')],{})[_0x85eb('0x22')](respondWithResult(_0x364f29,0xc9))[_0x85eb('0x44')](handleError(_0x364f29,null));};exports[_0x85eb('0x38')]=function(_0x55255d,_0x419f52){if(_0x55255d[_0x85eb('0x3e')]['id']){delete _0x55255d['body']['id'];}return db[_0x85eb('0x46')]['find']({'where':{'id':_0x55255d[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x419f52,null))[_0x85eb('0x22')](saveUpdates(_0x55255d[_0x85eb('0x3e')],null))[_0x85eb('0x22')](respondWithResult(_0x419f52,null))[_0x85eb('0x44')](handleError(_0x419f52,null));};exports[_0x85eb('0x39')]=function(_0x1233be,_0x5906d2){return db['ChatInteraction'][_0x85eb('0x6e')]({'where':{'id':_0x1233be[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x5906d2,null))[_0x85eb('0x22')](removeEntity(_0x5906d2,null))['catch'](handleError(_0x5906d2,null));};exports[_0x85eb('0xc9')]=function(_0x2e2af5,_0x3d2e7d){return db['ChatInteraction'][_0x85eb('0xc9')]()[_0x85eb('0x22')](respondWithResult(_0x3d2e7d,null))[_0x85eb('0x44')](handleError(_0x3d2e7d,null));};exports['createVidaooSession']=function(_0x1fa8f6,_0x38f314){var _0x2a355b=_0x1fa8f6['params']['id'];var _0x18404c;var _0x466d54;var _0x404fef;return db[_0x85eb('0x46')][_0x85eb('0xca')]({'where':{'id':_0x2a355b}})[_0x85eb('0x22')](function(_0x3bb3e5){_0x18404c=_0x3bb3e5;return db[_0x85eb('0xcb')][_0x85eb('0xca')]({'where':{'id':_0x3bb3e5['ChatWebsiteId']},'attributes':['id',_0x85eb('0xcc'),_0x85eb('0xcd'),_0x85eb('0xce'),_0x85eb('0xcf'),_0x85eb('0xd0')],'raw':!![]});})[_0x85eb('0x22')](function(_0x5c80b1){if(_0x5c80b1&&_0x5c80b1['vidaooApiKey']&&_0x5c80b1[_0x85eb('0xcd')]){_0x466d54=_0x5c80b1;var _0x3b0878={'interaction':{'id':_0x2a355b},'agent':{'id':_0x1fa8f6[_0x85eb('0xd1')]['id'],'name':_0x1fa8f6[_0x85eb('0xd1')][_0x85eb('0x3b')],'fullname':_0x1fa8f6[_0x85eb('0xd1')][_0x85eb('0xd2')],'email':_0x1fa8f6['user'][_0x85eb('0xd3')]},'contact':_0x1fa8f6[_0x85eb('0x3e')]['contact'],'account':_0x1fa8f6[_0x85eb('0x3e')][_0x85eb('0xd4')]};var _0x1a5c26={'rejectUnauthorized':![],'method':_0x85eb('0xd5'),'url':_0x85eb('0xd6'),'headers':{'X-APIKEY':_0x5c80b1[_0x85eb('0xcc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1fa8f6[_0x85eb('0xd1')][_0x85eb('0xd3')]],'buttons':null,'topic':_0x466d54[_0x85eb('0xce')],'note':_['isNull'](_0x466d54['vidaooNote'])?null:getMustacheRender(_0x466d54['vidaooNote'],_0x3b0878),'metadata':null},'redirect':_0x85eb('0xd7'),'json':!![]};try{if(!_[_0x85eb('0xd8')](_0x466d54[_0x85eb('0xd0')])){var _0x413509=getMustacheRender(_0x466d54[_0x85eb('0xd0')],_0x3b0878);var _0x368f63=JSON[_0x85eb('0x88')](_0x413509);_0x1a5c26[_0x85eb('0x3e')][_0x85eb('0xd9')]=_0x368f63;}}catch(_0x2305a9){throw new db['Sequelize'][(_0x85eb('0xda'))](_0x85eb('0xdb'));}return rp(_0x1a5c26);}else{throw new db[(_0x85eb('0x9b'))][(_0x85eb('0xda'))](_0x85eb('0xdc'));}})[_0x85eb('0x22')](function(_0x495b8f){_0x404fef=_0x495b8f;if(_0x404fef['id']){var _0x1bbe41={'body':_0x404fef['join_url'],'ChatWebsiteId':_0x466d54['id'],'ChatInteractionId':_0x18404c['id'],'direction':_0x85eb('0xdd'),'UserId':_0x1fa8f6['user']['id']};return db[_0x85eb('0xde')][_0x85eb('0xc8')](_0x1bbe41,{});}else{throw new db[(_0x85eb('0x9b'))][(_0x85eb('0xda'))](_0x85eb('0xdf'));}})[_0x85eb('0x22')](function(){return _0x18404c[_0x85eb('0xe0')]({'vidaooSessionId':_0x404fef['id']});})[_0x85eb('0x22')](respondWithResult(_0x38f314,null))['catch'](handleError(_0x38f314,null));};exports['customUpdate']=function(_0x1c0550,_0x19261b){if(_0x1c0550[_0x85eb('0x3e')]['id']){delete _0x1c0550[_0x85eb('0x3e')]['id'];}return db[_0x85eb('0x46')]['find']({'where':{'id':_0x1c0550[_0x85eb('0xc4')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x85eb('0x22')](handleEntityNotFound(_0x19261b,null))[_0x85eb('0x22')](saveUpdates(_0x1c0550['body'],null))[_0x85eb('0x22')](respondWithResult(_0x19261b,null))[_0x85eb('0x44')](handleError(_0x19261b,null));};exports[_0x85eb('0xe1')]=function(_0x643bd3,_0x22cdc1,_0x490d17){if(_0x643bd3[_0x85eb('0x3e')]['id']){delete _0x643bd3[_0x85eb('0x3e')]['id'];}return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x643bd3[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](function(_0x452460){if(!_0x452460){logger[_0x85eb('0x28')](_0x85eb('0xe2'),_0x85eb('0xe1'),0x194,'entity\x20not\x20found');_0x22cdc1['sendStatus'](0x194);}else{if(_0x452460['UserId']){throw new db[(_0x85eb('0x9b'))][(_0x85eb('0xda'))](_0x85eb('0xe3'));}}return _0x452460;})['then'](function(_0x2d3772){if(_0x2d3772){return _0x2d3772[_0x85eb('0x38')]({'closed':_0x643bd3['body'][_0x85eb('0xe4')],'disposition':_0x643bd3[_0x85eb('0x3e')][_0x85eb('0xe5')]})[_0x85eb('0x22')](function(_0x521580){return _0x521580;});}})[_0x85eb('0x22')](function(_0x38fd1b){return respondWithRpcPromise(_0x85eb('0xe6'),_0x85eb('0xe1'),_0x643bd3[_0x85eb('0x3e')],client9004);})[_0x85eb('0x22')](respondWithResult(_0x22cdc1,null))[_0x85eb('0x44')](handleError(_0x22cdc1,null));};exports[_0x85eb('0xe7')]=function(_0x518eda,_0x299d7b,_0x120553){_0x518eda['body'][_0x85eb('0x3b')]=_0x518eda['file'][_0x85eb('0xe8')];_0x518eda[_0x85eb('0x3e')][_0x85eb('0xe9')]=_0x518eda[_0x85eb('0xea')][_0x85eb('0xeb')];_0x518eda['body'][_0x85eb('0x7b')]=_0x518eda['file']['mimetype'];return db[_0x85eb('0xec')][_0x85eb('0xc8')](_0x518eda['body'])[_0x85eb('0x22')](respondWithResult(_0x299d7b,0xc9))['catch'](handleError(_0x299d7b,null));};exports[_0x85eb('0xed')]=function(_0x36a522,_0x437908,_0xd0d358){return db[_0x85eb('0x46')][_0x85eb('0xca')]({'where':{'id':_0x36a522[_0x85eb('0xc4')]['id']},'raw':!![]})[_0x85eb('0x22')](handleEntityNotFound(_0x437908,null))['then'](function(_0x5122fc){if(_0x5122fc){if(_0x5122fc[_0x85eb('0xe4')]){return _0x437908[_0x85eb('0x2c')](0x193)[_0x85eb('0x34')]({'status':0x193,'message':_0x85eb('0xee')});}return db[_0x85eb('0xec')][_0x85eb('0xca')]({'where':{'id':_0x36a522[_0x85eb('0x4b')][_0x85eb('0xef')]},'raw':!![]})[_0x85eb('0x22')](handleEntityNotFound(_0x437908,null));}})[_0x85eb('0x22')](function(_0x2785e5){if(_0x2785e5){var _0x31422d=_0x2785e5[_0x85eb('0xf0')]!==null;var _0x4fd2c5=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],'server/files/attachments/');if(_0x31422d){_0x4fd2c5=path['join'](_0x4fd2c5,'offline-chat/');}var _0x1f8971=path[_0x85eb('0xf1')](_0x4fd2c5,_0x2785e5[_0x85eb('0xe9')]);return _0x437908[_0x85eb('0xf3')](_0x1f8971);}})['catch'](handleError(_0x437908,null));};exports[_0x85eb('0xf4')]=function(_0x8e8898,_0x2fb509){var _0x39bd74=null;var _0x3818db=null;var _0x529048=null;var _0x242488=null;if(_0x8e8898[_0x85eb('0x3e')]['id']){delete _0x8e8898['body']['id'];}if(_0x8e8898[_0x85eb('0x3e')][_0x85eb('0xf5')]){_0x242488=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0xf6'),util[_0x85eb('0xf7')](_0x85eb('0xf8'),Date[_0x85eb('0xf9')]()));_0x8e8898['body']['pathTranscript']=_0x242488;}return db['ChatInteraction'][_0x85eb('0x6e')]({'where':{'id':_0x8e8898['params']['id']},'include':[{'model':db[_0x85eb('0xde')],'as':_0x85eb('0xfa'),'include':[{'model':db[_0x85eb('0x80')],'as':_0x85eb('0x80')}]}]})[_0x85eb('0x22')](handleEntityNotFound(_0x2fb509,null))[_0x85eb('0x22')](saveUpdates(_0x8e8898['body'],null))[_0x85eb('0x22')](function(_0x3a276c){if(_0x3a276c){_0x39bd74=_0x3a276c;return db[_0x85eb('0xcb')][_0x85eb('0x6e')]({'where':{'id':_0x39bd74[_0x85eb('0x85')]}});}})[_0x85eb('0x22')](function(_0x6c7095){if(_0x6c7095){_0x529048=_0x6c7095;return db[_0x85eb('0xfb')][_0x85eb('0x6e')]({'where':{'id':_0x39bd74['ContactId']}});}})[_0x85eb('0x22')](function(_0x3aec49){if(_0x3aec49){_0x3818db=_0x3aec49;if(_0x242488){var _0x4c8ad6=null;for(var _0x20cbea=0x1;_0x20cbea<_0x39bd74[_0x85eb('0xfa')][_0x85eb('0x51')];++_0x20cbea){_0x4c8ad6=_0x39bd74[_0x85eb('0xfa')][_0x20cbea];var _0x401936=_0x4c8ad6[_0x85eb('0x81')]?util['format'](_0x85eb('0xfc'),_0x529048[_0x85eb('0xfd')],_0x4c8ad6['UserId']):'System';var _0x4660b6=_0x8e8898[_0x85eb('0x3e')]['customer']||util[_0x85eb('0xf7')](_0x85eb('0xfc'),'Visitor',_0x4c8ad6[_0x85eb('0x79')]);switch(_0x529048[_0x85eb('0xfe')]){case _0x85eb('0xff'):_0x401936=_0x4c8ad6[_0x85eb('0x81')]?util[_0x85eb('0xf7')]('%s%d',_0x529048['agentAlias'],_0x4c8ad6[_0x85eb('0x81')]):_0x85eb('0x100');break;case _0x85eb('0x101'):_0x401936=_0x4c8ad6[_0x85eb('0x81')]?_0x4c8ad6[_0x85eb('0x80')][_0x85eb('0x102')]||_0x4c8ad6[_0x85eb('0x80')]['fullname']:_0x85eb('0x100');break;case _0x85eb('0x103'):_0x401936=_0x4c8ad6[_0x85eb('0x81')]?_0x4c8ad6[_0x85eb('0x80')][_0x85eb('0xd2')]:_0x85eb('0x100');break;default:_0x401936=_0x4c8ad6[_0x85eb('0x81')]?util[_0x85eb('0xf7')](_0x85eb('0xfc'),_0x529048[_0x85eb('0xfd')],_0x4c8ad6['UserId']):_0x85eb('0x100');}var _0x2e7563=util[_0x85eb('0xf7')](_0x85eb('0x104'),moment(_0x4c8ad6[_0x85eb('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x4c8ad6[_0x85eb('0x105')]==='in'?_0x4660b6:_0x401936,_0x4c8ad6[_0x85eb('0x3e')]);if(!_0x4c8ad6[_0x85eb('0x106')]){fs[_0x85eb('0x107')](_0x242488,_0x2e7563);}}return db[_0x85eb('0x108')][_0x85eb('0xca')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x85eb('0x109'),'raw':!![]}]});}}})[_0x85eb('0x22')](function(_0x113c06){if(_0x113c06&&_0x113c06['Smtp']&&_0x8e8898[_0x85eb('0x3e')]){var _0x54e411={'tls':{'rejectUnauthorized':![]}};if(_0x113c06[_0x85eb('0x109')]['service']){_0x54e411[_0x85eb('0x10a')]=_0x113c06[_0x85eb('0x109')][_0x85eb('0x10a')];}else{_0x54e411['host']=_0x113c06[_0x85eb('0x109')][_0x85eb('0x10b')];_0x54e411[_0x85eb('0x10c')]=_0x113c06[_0x85eb('0x109')]['port'];_0x54e411[_0x85eb('0x10d')]=_0x113c06[_0x85eb('0x109')]['secure'];}if(_0x113c06[_0x85eb('0x109')][_0x85eb('0x10e')]){_0x54e411[_0x85eb('0x10f')]={'user':_0x113c06['Smtp']['user'],'pass':_0x113c06[_0x85eb('0x109')][_0x85eb('0x110')]};}return respondWithRpcPromise(_0x85eb('0x111'),_0x85eb('0x112'),{'account':_0x54e411,'message':{'from':util[_0x85eb('0xf7')]('\x22%s\x22\x20<%s>',_0x113c06[_0x85eb('0x3b')],_0x113c06[_0x85eb('0xd3')]||_0x113c06['Smtp'][_0x85eb('0xd1')]),'to':_0x8e8898[_0x85eb('0x3e')][_0x85eb('0xf5')],'subject':_0x85eb('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x8e8898[_0x85eb('0x3e')][_0x85eb('0xf5')]),'attachments':[{'path':_0x242488}]}})['then'](function(){return _0x39bd74;})['catch'](function(_0x3c794c){console[_0x85eb('0x28')](_0x3c794c);});}else{return _0x39bd74;}})[_0x85eb('0x22')](respondWithStatusCode(_0x2fb509,0xc8))['catch'](handleError(_0x2fb509,null));};exports[_0x85eb('0x114')]=function(_0x1bdbc5,_0x4edc7d,_0x32222c){return db[_0x85eb('0xde')][_0x85eb('0x6e')]({'where':{'id':_0x1bdbc5[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x4edc7d,null))[_0x85eb('0x22')](function(_0x52c186){if(_0x52c186){return _0x52c186[_0x85eb('0x114')](_0x1bdbc5[_0x85eb('0x3e')][_0x85eb('0x115')],_['omit'](_0x1bdbc5['body'],['ids','id'])||{});}})[_0x85eb('0x22')](respondWithResult(_0x4edc7d,null))['catch'](handleError(_0x4edc7d,null));};exports[_0x85eb('0x116')]=function(_0x46a2c4,_0x1b5db9,_0x386c1a){var _0x3ed32c={'raw':![],'where':{}};var _0x3d04e7={};var _0x1e2b79={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x85eb('0xca')]({'where':{'id':_0x46a2c4[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x1b5db9,null))[_0x85eb('0x22')](function(_0x4307f4){if(_0x4307f4){_0x3d04e7[_0x85eb('0x4a')]=_[_0x85eb('0x4c')](db[_0x85eb('0xde')][_0x85eb('0x47')]);_0x3d04e7[_0x85eb('0x4b')]=_[_0x85eb('0x4c')](_0x46a2c4[_0x85eb('0x4b')]);_0x3d04e7[_0x85eb('0x4d')]=_[_0x85eb('0x4f')](_0x3d04e7[_0x85eb('0x4a')],_0x3d04e7['query']);_0x3ed32c[_0x85eb('0x4e')]=_[_0x85eb('0x4f')](_0x3d04e7[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x46a2c4['query'][_0x85eb('0x50')]));_0x3ed32c[_0x85eb('0x4e')]=_0x3ed32c[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x3ed32c[_0x85eb('0x4e')]:_0x3d04e7[_0x85eb('0x4a')];if(!_0x46a2c4['query']['hasOwnProperty']('nolimit')){_0x3ed32c[_0x85eb('0x30')]=qs[_0x85eb('0x30')](_0x46a2c4[_0x85eb('0x4b')]['limit']);_0x3ed32c[_0x85eb('0x2e')]=qs[_0x85eb('0x2e')](_0x46a2c4['query'][_0x85eb('0x2e')]);}_0x3ed32c[_0x85eb('0x54')]=qs[_0x85eb('0x55')](_0x46a2c4[_0x85eb('0x4b')][_0x85eb('0x55')]);_0x3ed32c[_0x85eb('0x56')]=qs[_0x85eb('0x4d')](_[_0x85eb('0x117')](_0x46a2c4[_0x85eb('0x4b')],_0x3d04e7[_0x85eb('0x4d')]));_0x3ed32c[_0x85eb('0x56')][_0x85eb('0xc0')]=_0x4307f4['id'];if(_0x46a2c4['query'][_0x85eb('0x93')]){_0x3ed32c[_0x85eb('0x56')]=_['merge'](_0x3ed32c[_0x85eb('0x56')],{'$or':_['map'](_0x3ed32c[_0x85eb('0x4e')],function(_0x2037ef){var _0x200c28={};_0x200c28[_0x2037ef]={'$like':'%'+_0x46a2c4[_0x85eb('0x4b')][_0x85eb('0x93')]+'%'};return _0x200c28;})});}if(_0x46a2c4[_0x85eb('0x4b')][_0x85eb('0x89')]){var _0xe74bd5=_0x46a2c4['query']['$gte'][_0x85eb('0x76')](',');var _0x6b9b57={};_0x6b9b57[_0xe74bd5[0x0]]={'$gte':moment(_0xe74bd5[0x1])['format'](_0x85eb('0x118'))};_0x3ed32c[_0x85eb('0x56')]=_['merge'](_0x3ed32c[_0x85eb('0x56')],_0x6b9b57);}_0x3ed32c=_[_0x85eb('0xac')]({},_0x3ed32c,_0x46a2c4[_0x85eb('0xc7')]);return db['ChatMessage'][_0x85eb('0x31')]({'where':_0x3ed32c['where']})[_0x85eb('0x22')](function(_0x5badd){_0x1e2b79[_0x85eb('0x31')]=_0x5badd;if(_0x46a2c4[_0x85eb('0x4b')]['includeAll']){_0x3ed32c[_0x85eb('0xc6')]=[{'all':!![]}];}return db[_0x85eb('0xde')][_0x85eb('0x119')](_0x3ed32c);})[_0x85eb('0x22')](function(_0x4d7d3b){_0x1e2b79[_0x85eb('0xc2')]=_0x4d7d3b;return _0x1e2b79;});}})[_0x85eb('0x22')](respondWithFilteredResult(_0x1b5db9,_0x3ed32c))[_0x85eb('0x44')](handleError(_0x1b5db9,null));};exports[_0x85eb('0x11a')]=function(_0x1bdeea,_0x37ef17,_0x54e0a2){var _0x3b205e={'where':{}},_0x37bcff={},_0x5d4a73={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x85eb('0xca')]({'where':{'id':_0x1bdeea[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x37ef17,null))[_0x85eb('0x22')](function(_0x17d94e){if(_0x17d94e){_0x37bcff[_0x85eb('0x4a')]=_[_0x85eb('0x4c')](db[_0x85eb('0xde')][_0x85eb('0x47')]);_0x37bcff['query']=_[_0x85eb('0x4c')](_0x1bdeea[_0x85eb('0x4b')]);_0x37bcff[_0x85eb('0x4d')]=_[_0x85eb('0x4f')](_0x37bcff[_0x85eb('0x4a')],_0x37bcff[_0x85eb('0x4b')]);_0x3b205e[_0x85eb('0x4e')]=_['intersection'](_0x37bcff[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x1bdeea['query']['fields']));_0x3b205e[_0x85eb('0x4e')]=_0x3b205e[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x3b205e[_0x85eb('0x4e')]:_0x37bcff['model'];if(!_0x1bdeea['query'][_0x85eb('0x52')]('nolimit')){_0x3b205e[_0x85eb('0x30')]=qs[_0x85eb('0x30')](_0x1bdeea[_0x85eb('0x4b')]['limit']);_0x3b205e['offset']=qs[_0x85eb('0x2e')](_0x1bdeea[_0x85eb('0x4b')][_0x85eb('0x2e')]);}_0x3b205e[_0x85eb('0x54')]=qs['sort'](_0x1bdeea[_0x85eb('0x4b')][_0x85eb('0x55')]);_0x3b205e[_0x85eb('0x56')]=qs['filters'](_[_0x85eb('0x117')](_0x1bdeea['query'],_0x37bcff['filters']));_0x3b205e[_0x85eb('0x56')][_0x85eb('0xc0')]=_0x17d94e['id'];if(_0x1bdeea[_0x85eb('0x4b')][_0x85eb('0x93')]){_0x3b205e['where']=_[_0x85eb('0xac')](_0x3b205e[_0x85eb('0x56')],{'$or':_[_0x85eb('0x40')](_0x3b205e[_0x85eb('0x4e')],function(_0x32cf84){var _0x3f7ede={};_0x3f7ede[_0x32cf84]={'$like':'%'+_0x1bdeea[_0x85eb('0x4b')]['filter']+'%'};return _0x3f7ede;})});}_0x3b205e[_0x85eb('0x56')][_0x85eb('0x106')]=![];if(_0x1bdeea[_0x85eb('0x4b')]['id']){_0x3b205e[_0x85eb('0x56')]['id']={'$gt':_0x1bdeea[_0x85eb('0x4b')]['id']};}_0x3b205e=_['merge']({},_0x3b205e,_0x1bdeea[_0x85eb('0xc7')]);return db[_0x85eb('0xde')][_0x85eb('0x31')]({'where':_0x3b205e[_0x85eb('0x56')]})['then'](function(_0x761ba8){_0x5d4a73[_0x85eb('0x31')]=_0x761ba8;_0x3b205e[_0x85eb('0xc6')]=[];if(_0x1bdeea['query'][_0x85eb('0x11b')]){_0x3b205e[_0x85eb('0xc6')][_0x85eb('0xc1')]({'model':db[_0x85eb('0x80')],'as':_0x85eb('0x80'),'attributes':['id','fullname',_0x85eb('0x102')]});}if(_0x1bdeea['query'][_0x85eb('0xc5')]){_0x3b205e['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x3b205e);})['then'](function(_0x30eeb7){_0x5d4a73[_0x85eb('0xc2')]=_0x30eeb7;return _0x5d4a73;});}})['then'](respondWithFilteredResult(_0x37ef17,_0x3b205e))['catch'](handleError(_0x37ef17,null));};exports[_0x85eb('0x11c')]=function(_0x532769,_0x590d0d,_0x59fd91){return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x532769['params']['id']}})['then'](handleEntityNotFound(_0x590d0d,null))[_0x85eb('0x22')](function(_0x3971f5){if(_0x3971f5){return _0x3971f5['setTags'](_0x532769[_0x85eb('0x3e')][_0x85eb('0x115')],_[_0x85eb('0x11d')](_0x532769[_0x85eb('0x3e')],[_0x85eb('0x115'),'id'])||{})[_0x85eb('0x11e')](function(){return db[_0x85eb('0x7e')][_0x85eb('0x119')]({'attributes':['id',_0x85eb('0x3b'),_0x85eb('0x11f')],'where':{'id':_0x532769[_0x85eb('0x3e')][_0x85eb('0x115')]}});})['then'](function(_0x36ea41){socket[_0x85eb('0x120')](_0x85eb('0x121'),{'id':Number(_0x532769[_0x85eb('0xc4')]['id']),'tags':_0x36ea41||[]});return{'id':Number(_0x532769[_0x85eb('0xc4')]['id']),'tags':_0x36ea41||[]};});}})[_0x85eb('0x22')](respondWithResult(_0x590d0d,null))[_0x85eb('0x44')](handleError(_0x590d0d,null));};exports[_0x85eb('0x122')]=function(_0x1be39a,_0x2461f9,_0x356d32){return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x1be39a['params']['id']}})['then'](handleEntityNotFound(_0x2461f9,null))[_0x85eb('0x22')](function(_0x8c6dc0){if(_0x8c6dc0){return _0x8c6dc0[_0x85eb('0x122')](_0x1be39a[_0x85eb('0x4b')]['ids']);}})[_0x85eb('0x22')](respondWithStatusCode(_0x2461f9,null))[_0x85eb('0x44')](handleError(_0x2461f9,null));};exports['download']=function(_0x1f4e87,_0x1c3ed4){var _0x411f08=moment()[_0x85eb('0x123')]()['toString']();var _0x24b1f3=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0x124'),_0x85eb('0x125'),'tmp');var _0x163a17=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0x124'),_0x85eb('0x125'),'attachments');var _0x27ea02=path[_0x85eb('0xf1')](_0x24b1f3,_0x411f08);var _0x5a3a94=util[_0x85eb('0xf7')](_0x85eb('0x126'),_0x1f4e87[_0x85eb('0xc4')]['id'],_0x411f08);var _0x4675d1=path[_0x85eb('0xf1')](_0x24b1f3,_0x5a3a94);var _0x5f72cd=[];_0x5f72cd['push']({'model':db[_0x85eb('0x80')],'as':_0x85eb('0x80'),'attributes':['id',_0x85eb('0xd2')],'raw':!![]});_0x5f72cd[_0x85eb('0xc1')]({'model':db[_0x85eb('0xfb')],'as':_0x85eb('0x73'),'attributes':['id',_0x85eb('0x127'),_0x85eb('0x128')],'raw':!![]});if(_0x1f4e87['query'][_0x85eb('0x129')]){_0x5f72cd['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4d8940=[{'model':db[_0x85eb('0xde')],'as':_0x85eb('0xfa'),'attributes':['id',_0x85eb('0x3e'),_0x85eb('0x87'),'direction',_0x85eb('0x106'),_0x85eb('0x8e')],'include':_0x5f72cd}];_0x4d8940[_0x85eb('0xc1')]({'model':db[_0x85eb('0xcb')],'as':_0x85eb('0x12a'),'attributes':['id',_0x85eb('0x3b')]});_0x4d8940[_0x85eb('0xc1')]({'model':db[_0x85eb('0x80')],'as':_0x85eb('0x12b'),'attributes':['id',_0x85eb('0xd2')]});return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x1f4e87['params']['id']},'include':_0x4d8940})[_0x85eb('0x22')](handleEntityNotFound(_0x1c3ed4,null))[_0x85eb('0x22')](function(_0x38217f){if(_0x38217f){var _0x49146a=_0x38217f['get']({'plain':!![]});fs[_0x85eb('0x12c')](_0x27ea02);var _0xa82740={'channel':_0x85eb('0x12d'),'account':_0x49146a[_0x85eb('0x12a')]['name'],'agent':_0x49146a['Owner']?_0x49146a[_0x85eb('0x12b')][_0x85eb('0xd2')]:_0x85eb('0x12e'),'createdAt':moment(_0x49146a[_0x85eb('0x87')])[_0x85eb('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x49146a[_0x85eb('0xe4')]?moment(_0x49146a[_0x85eb('0x12f')])[_0x85eb('0xf7')](_0x85eb('0x118'))[_0x85eb('0xaa')]():'','disposition':_0x49146a[_0x85eb('0xe5')],'chatInfo':{'browser':_0x49146a['browserName'],'os':_0x49146a['osName'],'referer':_0x49146a[_0x85eb('0x130')],'customerIp':_0x49146a[_0x85eb('0x131')],'customerPort':_0x49146a[_0x85eb('0x132')]?_0x49146a[_0x85eb('0x132')]:'N.A.'},'messages':_(_0x49146a['Messages'])[_0x85eb('0x133')]()['filter']({'secret':![]})[_0x85eb('0x40')](function(_0x2d1a82){if(_0x2d1a82[_0x85eb('0xec')]){var _0x188ace=path[_0x85eb('0xf1')](_0x163a17,_0x2d1a82[_0x85eb('0xec')][_0x85eb('0xe9')]);if(fs[_0x85eb('0x134')](_0x188ace)){fs['createReadStream'](_0x188ace)['pipe'](fs['createWriteStream'](path['join'](_0x27ea02,_0x2d1a82[_0x85eb('0xec')][_0x85eb('0xe9')])));}}return{'date':moment(_0x2d1a82[_0x85eb('0x87')])[_0x85eb('0xf7')](_0x85eb('0x118'))[_0x85eb('0xaa')](),'sender':_0x2d1a82[_0x85eb('0x105')]===_0x85eb('0xdd')?_0x2d1a82[_0x85eb('0x80')]?_0x2d1a82['User'][_0x85eb('0xd2')]:_0x85eb('0x100'):_0x2d1a82[_0x85eb('0x73')]['firstName']+(_0x2d1a82['Contact'][_0x85eb('0x128')]?'\x20'+_0x2d1a82['Contact']['lastName']:''),'body':_0x2d1a82[_0x85eb('0xec')]?_0x2d1a82[_0x85eb('0xec')]['basename']:_0x2d1a82['body'],'direction':_0x2d1a82[_0x85eb('0x105')]===_0x85eb('0xdd')?'A':'C','secret':_0x2d1a82[_0x85eb('0x106')],'read':_0x2d1a82['read'],'attachment':_0x2d1a82[_0x85eb('0xec')]};})[_0x85eb('0x6f')]()};return ejs[_0x85eb('0x135')](path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0x124'),'views','downloadInteraction.ejs'),{'interaction':_0xa82740})[_0x85eb('0x22')](function(_0x226fbf){var _0x5f38af=path['join'](_0x27ea02,'transcript-'+_0x49146a['id']+'-'+_0x411f08+_0x85eb('0x136'));var _0x16b750={'path':_0x5f38af,'channel':_0x85eb('0x12d'),'interactionId':_0x49146a['id']};return pdf['createPdfFromHTML'](_0x226fbf,_0x16b750);})[_0x85eb('0x22')](function(){return new BPromise(function(_0x28229e,_0x46330e){zipdir(_0x27ea02,{'saveTo':_0x4675d1},function(_0x5ab7ab,_0x9be3b4){if(_0x5ab7ab)return _0x46330e(_0x5ab7ab);return _0x28229e(_0x9be3b4);});})[_0x85eb('0x22')](function(){return new BPromise(function(_0x4ee6d3,_0x42c865){rimraf(_0x27ea02,function(_0x329ba3){if(_0x329ba3)_0x42c865(_0x329ba3);return _0x4ee6d3();});});})[_0x85eb('0x22')](function(){return _0x1c3ed4['download'](_0x4675d1,_0x5a3a94,function(_0x3dc0d5){if(_0x3dc0d5){console[_0x85eb('0x137')](_0x85eb('0x138'),_0x3dc0d5);}else{fs[_0x85eb('0x139')](_0x4675d1);}});});});}else{return _0x1c3ed4[_0x85eb('0x2b')](0xc8);}})[_0x85eb('0x44')](handleError(_0x1c3ed4,null));}; \ No newline at end of file +var _0x9f0e=['error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','stack','name','send','render','merge','contact','interaction','fullname','TagIds','Tags','split','forEach','index','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','`\x20=\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','includeAll','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','agentAlias','System','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','intersection','sort','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','alias','rows','addTags','spread','emit','removeTags','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','Account','Owner','mkdirSync','closedAt','browserName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','lastName','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x57ff09,_0xfc92d0){var _0x49bba9=function(_0x5ed581){while(--_0x5ed581){_0x57ff09['push'](_0x57ff09['shift']());}};_0x49bba9(++_0xfc92d0);}(_0x9f0e,0x116));var _0xe9f0=function(_0x35ed30,_0x2369ea){_0x35ed30=_0x35ed30-0x0;var _0x3ec216=_0x9f0e[_0x35ed30];return _0x3ec216;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var pdf=require(_0xe9f0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9f0('0x15'))(_0xe9f0('0x16'));var utils=require(_0xe9f0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe9f0('0x18'));var db=require('../../mysqldb')['db'];config[_0xe9f0('0x19')]=_[_0xe9f0('0x1a')](config[_0xe9f0('0x19')],{'host':_0xe9f0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe9f0('0x19')]));require('./chatInteraction.socket')[_0xe9f0('0x1c')](socket);var jayson=require(_0xe9f0('0x1d'));var client=jayson[_0xe9f0('0x1e')]['http']({'port':0x232b});var client9004=jayson[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2e68ef,_0x598eee,_0xaa7aa6,_0x1e16e0){return new BPromise(function(_0xcd2042,_0xd71ac8){var _0x3ed69a=_0x1e16e0||client;return _0x3ed69a[_0xe9f0('0x20')](_0x2e68ef,_0xaa7aa6)[_0xe9f0('0x21')](function(_0x59bf5a){logger[_0xe9f0('0x22')](_0xe9f0('0x23'),_0x598eee,_0xe9f0('0x24'));logger['debug'](_0xe9f0('0x25'),_0x598eee,_0xe9f0('0x24'),JSON[_0xe9f0('0x26')](_0x59bf5a));if(_0x59bf5a[_0xe9f0('0x27')]){if(_0x59bf5a['error'][_0xe9f0('0x28')]===0x1f4){logger[_0xe9f0('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x598eee,_0x59bf5a['error']['message']);return _0xd71ac8(_0x59bf5a[_0xe9f0('0x27')][_0xe9f0('0x29')]);}logger[_0xe9f0('0x27')](_0xe9f0('0x23'),_0x598eee,_0x59bf5a[_0xe9f0('0x27')]['message']);return _0xcd2042(_0x59bf5a[_0xe9f0('0x27')][_0xe9f0('0x29')]);}else{logger[_0xe9f0('0x22')](_0xe9f0('0x23'),_0x598eee,_0xe9f0('0x24'));_0xcd2042(_0x59bf5a[_0xe9f0('0x2a')][_0xe9f0('0x29')]);}})[_0xe9f0('0x2b')](function(_0x3c4ba9){logger[_0xe9f0('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x598eee,_0x3c4ba9);_0xd71ac8(_0x3c4ba9);});});}function respondWithStatusCode(_0x371095,_0x27541f){_0x27541f=_0x27541f||0xcc;return function(_0x2ddfba){if(_0x2ddfba){return _0x371095[_0xe9f0('0x2c')](_0x27541f);}return _0x371095['status'](_0x27541f)[_0xe9f0('0x2d')]();};}function respondWithResult(_0x2613fd,_0x856ac8){_0x856ac8=_0x856ac8||0xc8;return function(_0x1f98a7){if(_0x1f98a7){return _0x2613fd[_0xe9f0('0x2e')](_0x856ac8)['json'](_0x1f98a7);}};}function respondWithFilteredResult(_0x130f96,_0xdc16bc){return function(_0x44fb5b){if(_0x44fb5b){var _0xab3d81=typeof _0xdc16bc[_0xe9f0('0x2f')]===_0xe9f0('0x30')&&typeof _0xdc16bc[_0xe9f0('0x31')]===_0xe9f0('0x30');var _0x2b6503=_0x44fb5b[_0xe9f0('0x32')];var _0x22806c=_0xab3d81?0x0:_0xdc16bc[_0xe9f0('0x2f')];var _0x445ad0=_0xab3d81?_0x44fb5b[_0xe9f0('0x32')]:_0xdc16bc[_0xe9f0('0x2f')]+_0xdc16bc[_0xe9f0('0x31')];var _0x80e3ac;if(_0x445ad0>=_0x2b6503){_0x445ad0=_0x2b6503;_0x80e3ac=0xc8;}else{_0x80e3ac=0xce;}_0x130f96[_0xe9f0('0x2e')](_0x80e3ac);return _0x130f96[_0xe9f0('0x33')](_0xe9f0('0x34'),_0x22806c+'-'+_0x445ad0+'/'+_0x2b6503)[_0xe9f0('0x35')](_0x44fb5b);}return null;};}function patchUpdates(_0x589803){return function(_0x1c394){try{jsonpatch[_0xe9f0('0x36')](_0x1c394,_0x589803,!![]);}catch(_0x5480ce){return BPromise['reject'](_0x5480ce);}return _0x1c394['save']();};}function saveUpdates(_0x191a39,_0x585742){return function(_0x9bf61d){if(_0x9bf61d){return _0x9bf61d[_0xe9f0('0x37')](_0x191a39)['then'](function(_0x285457){return _0x285457;});}return null;};}function removeEntity(_0x4c181d,_0x576a7a){return function(_0x59024e){if(_0x59024e){return _0x59024e[_0xe9f0('0x38')]()[_0xe9f0('0x21')](function(){_0x4c181d['status'](0xcc)[_0xe9f0('0x2d')]();});}};}function handleEntityNotFound(_0xb0cfc,_0x1d4748){return function(_0x4d4186){if(!_0x4d4186){_0xb0cfc['sendStatus'](0x194);}return _0x4d4186;};}function handleError(_0x3fb04e,_0x3ff42d){_0x3ff42d=_0x3ff42d||0x1f4;return function(_0x1917c8){logger['error'](_0x1917c8[_0xe9f0('0x39')]);if(_0x1917c8[_0xe9f0('0x3a')]){delete _0x1917c8[_0xe9f0('0x3a')];}_0x3fb04e[_0xe9f0('0x2e')](_0x3ff42d)[_0xe9f0('0x3b')](_0x1917c8);};}function getMustacheRender(_0x552ec2,_0x2ab492){return Mustache[_0xe9f0('0x3c')](_0x552ec2,_[_0xe9f0('0x3d')](_0x2ab492['body'],{'contact':_0x2ab492[_0xe9f0('0x3e')],'message':_0x2ab492[_0xe9f0('0x29')],'agent':_0x2ab492['agent'],'interaction':_0x2ab492[_0xe9f0('0x3f')],'account':_0x2ab492['account']}))||'';}function getInteractionUsers(_0x56c03e,_0x55c0bd){return new BPromise(function(_0x5dcbeb,_0x51eda3){try{if(_0x55c0bd[_0x56c03e['id']]){_0x56c03e['Users']=_['map'](_0x55c0bd[_0x56c03e['id']],function(_0x35062f){return{'id':_0x35062f['id'],'fullname':_0x35062f[_0xe9f0('0x40')]};});}}catch(_0x2d8f93){_0x51eda3(_0x2d8f93);}_0x5dcbeb(_0x56c03e);});}function getInteractionTags(_0x40c2c6,_0x2560c6){return new BPromise(function(_0xd9b61b,_0x3d4eb7){try{if(_0x40c2c6[_0xe9f0('0x41')]){_0x40c2c6[_0xe9f0('0x42')]=[];_0x40c2c6['TagIds'][_0xe9f0('0x43')](',')[_0xe9f0('0x44')](function(_0x36b00a){_0x40c2c6['Tags']['push'](_0x2560c6[_0x36b00a]);});}delete _0x40c2c6[_0xe9f0('0x41')];}catch(_0x515fa6){_0x3d4eb7(_0x515fa6);}_0xd9b61b(_0x40c2c6);});}function updateChatInteraction(_0x297689,_0x52613a,_0x314f0e){return new BPromise(function(_0x42d9d2,_0x4f1663){return getInteractionUsers(_0x297689,_0x314f0e)[_0xe9f0('0x21')](function(_0x3f5255){return getInteractionTags(_0x3f5255,_0x52613a);})[_0xe9f0('0x21')](function(_0x18faaf){_0x42d9d2(_0x18faaf);})[_0xe9f0('0x2b')](function(_0x59378a){_0x4f1663(_0x59378a);});});}exports[_0xe9f0('0x45')]=function(_0x2941a0,_0x30141e){var _0x319380={},_0xf75ffb={},_0x4ffc17={'count':0x0,'rows':[]};var _0x3a8d1d=_['map'](db['ChatInteraction'][_0xe9f0('0x46')],function(_0x17b832){return{'name':_0x17b832['fieldName'],'type':_0x17b832[_0xe9f0('0x47')][_0xe9f0('0x48')]};});_0xf75ffb[_0xe9f0('0x49')]=_[_0xe9f0('0x4a')](_0x3a8d1d,_0xe9f0('0x3a'));_0xf75ffb[_0xe9f0('0x4b')]=_[_0xe9f0('0x4c')](_0x2941a0['query']);_0xf75ffb[_0xe9f0('0x4d')]=_['intersection'](_0xf75ffb[_0xe9f0('0x49')],_0xf75ffb['query']);_0x319380[_0xe9f0('0x4e')]=_['intersection'](_0xf75ffb[_0xe9f0('0x49')],qs[_0xe9f0('0x4f')](_0x2941a0[_0xe9f0('0x4b')]['fields']));_0x319380[_0xe9f0('0x4e')]=_0x319380[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x319380[_0xe9f0('0x4e')]:_0xf75ffb[_0xe9f0('0x49')];if(!_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x51')](_0xe9f0('0x52'))){_0x319380[_0xe9f0('0x31')]=qs[_0xe9f0('0x31')](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0x319380['offset']=qs['offset'](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0x319380[_0xe9f0('0x53')]=qs['sort'](_0x2941a0[_0xe9f0('0x4b')]['sort']);_0x319380[_0xe9f0('0x54')]=qs[_0xe9f0('0x4d')](_[_0xe9f0('0x55')](_0x2941a0[_0xe9f0('0x4b')],_0xf75ffb['filters']),_0x3a8d1d);var _0xb18f13=[];var _0x3fa271=squel['select']()[_0xe9f0('0x56')]('id')[_0xe9f0('0x56')](_0xe9f0('0x3a'))[_0xe9f0('0x56')]('color')[_0xe9f0('0x57')](_0xe9f0('0x58'));var _0x3dd40d=squel[_0xe9f0('0x59')]()[_0xe9f0('0x56')](_0xe9f0('0x5a'))[_0xe9f0('0x56')](_0xe9f0('0x5b'))['field'](_0xe9f0('0x5c'))[_0xe9f0('0x57')](_0xe9f0('0x5d'),'ui')[_0xe9f0('0x5e')](_0xe9f0('0x5f'),'u',_0xe9f0('0x60'));var _0x28fe47=squel[_0xe9f0('0x59')]()[_0xe9f0('0x57')](_0xe9f0('0x61'),'i')[_0xe9f0('0x5e')](_0xe9f0('0x62'),'c',_0xe9f0('0x63'))[_0xe9f0('0x5e')]('users','o',_0xe9f0('0x64'))[_0xe9f0('0x5e')](_0xe9f0('0x65'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0xe9f0('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xe9f0('0x5e')](_0xe9f0('0x67'),'it',_0xe9f0('0x68'))['left_join'](_0xe9f0('0x58'),'t',_0xe9f0('0x69'));var _0x954616=squel[_0xe9f0('0x6a')]();var _0x4bb39d=[];var _0x392eae=squel[_0xe9f0('0x6a')]();var _0x28a66e;if(_0x2941a0[_0xe9f0('0x4b')]['search']){_0x28a66e=as['parseSearch'](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x6b')]);var _0x29286b=_0x28a66e[_0xe9f0('0x6c')];for(var _0x7cbe71=0x0;_0x7cbe71<_0x28a66e['conditions'][_0xe9f0('0x50')];_0x7cbe71++){var _0x55ce2d=_0x28a66e[_0xe9f0('0x6d')][_0x7cbe71];var _0x5858a9='i';var _0x7c05aa=_[_0xe9f0('0x6e')](_0x3a8d1d,[_0xe9f0('0x3a'),_0x55ce2d[_0xe9f0('0x56')]]);if(!_0x7c05aa){switch(_0x55ce2d[_0xe9f0('0x56')]){case'unreadMessages':if(_0x55ce2d['value']==0x1){_0x28fe47['having']('`'+_0x55ce2d[_0xe9f0('0x56')]+_0xe9f0('0x6f'));}else{_0x28fe47['having']('`'+_0x55ce2d[_0xe9f0('0x56')]+'`\x20>\x200');}break;case'Contact':if(_0x55ce2d[_0xe9f0('0x70')]===_0xe9f0('0x71')){if(_0x55ce2d[_0xe9f0('0x72')][_0xe9f0('0x43')]('\x20')[_0xe9f0('0x50')]>0x1){_0x954616[_0x29286b](_0xe9f0('0x73'),qs['getFullTextValue'](_0x55ce2d['value']),null);}else{var _0x1255e6='%'+_0x55ce2d[_0xe9f0('0x72')]+'%';_0x954616[_0x29286b](_0xe9f0('0x74'),_0x1255e6,_0x1255e6,_0x1255e6);}}else{_0x7c05aa=_[_0xe9f0('0x6e')](_0x3a8d1d,['name',_0xe9f0('0x75')]);_0x55ce2d[_0xe9f0('0x56')]=_0xe9f0('0x75');_0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa[_0xe9f0('0x47')],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')][_0xe9f0('0x2d')]);}break;case _0xe9f0('0x79'):var _0xb6e75d=_0x55ce2d['value'][_0xe9f0('0x43')](',')[_0xe9f0('0x4a')](function(_0x388091){return Number(_0x388091);});_0xb6e75d[_0xe9f0('0x44')](function(_0x214ac0){_0x392eae['or'](_0xe9f0('0x7a'),'%,'+_0x214ac0+',%');});_0x4bb39d=_[_0xe9f0('0x7b')](_0x4bb39d,_0xb6e75d);break;case _0xe9f0('0x7c'):if(_0x55ce2d[_0xe9f0('0x70')]===_0xe9f0('0x71')){_0x954616[_0x29286b](_0xe9f0('0x7d'),'%'+_0x55ce2d[_0xe9f0('0x72')]+'%',null);}else{_0x7c05aa=_['find'](_0x3a8d1d,[_0xe9f0('0x3a'),_0xe9f0('0x7e')]);_0x55ce2d[_0xe9f0('0x56')]=_0xe9f0('0x7e');_0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa[_0xe9f0('0x47')],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')]['end']);}break;case _0xe9f0('0x7f'):_0x2cd0c1=as[_0xe9f0('0x76')]('me',null,_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1[_0xe9f0('0x77')],_0x2cd0c1['value'][_0xe9f0('0x78')],_0x2cd0c1[_0xe9f0('0x72')]['end']);break;}}else{var _0x2cd0c1=as[_0xe9f0('0x76')](_0x5858a9,_0x7c05aa['type'],_0x55ce2d);_0x954616[_0x29286b](_0x2cd0c1['text'],_0x2cd0c1[_0xe9f0('0x72')]['start'],_0x2cd0c1[_0xe9f0('0x72')][_0xe9f0('0x2d')]);}}}else{var _0x56d052=_(_0x2941a0[_0xe9f0('0x4b')])[_0xe9f0('0x4c')]()[_0xe9f0('0x4a')](function(_0x300fae){return _[_0xe9f0('0x80')](_0x3a8d1d,[_0xe9f0('0x3a'),_0x300fae])?_0x300fae:undefined;})[_0xe9f0('0x81')]()[_0xe9f0('0x72')]();if(!_[_0xe9f0('0x82')](_0x56d052)){_0x56d052['forEach'](function(_0x2e15f9){if(_0x2e15f9===_0xe9f0('0x83')){_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0x84'),[][_0xe9f0('0x85')](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9]));}else if(_0x2e15f9===_0xe9f0('0x86')){var _0x114033=JSON['parse'](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9])[_0xe9f0('0x87')];var _0x2ce60c=JSON[_0xe9f0('0x88')](_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9])[_0xe9f0('0x89')];_0x28fe47['where'](_0xe9f0('0x8a'),_0x114033,_0x2ce60c);}else{if(_0x2941a0['query'][_0x2e15f9]==='null'){_0x28fe47['where']('i.'+_0x2e15f9+_0xe9f0('0x8b'));}else{_0x28fe47[_0xe9f0('0x54')]('i.'+_0x2e15f9+_0xe9f0('0x8c'),_0x2941a0[_0xe9f0('0x4b')][_0x2e15f9]);}}});}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x8d')]){if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x8d')]==0x1){_0x28fe47[_0xe9f0('0x8e')]('`unreadMessages`\x20=\x200');}else{_0x28fe47[_0xe9f0('0x8e')](_0xe9f0('0x8f'));}}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')]){_0x4bb39d=_[_0xe9f0('0x91')](_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')])?_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x90')]:new Array(_0x2941a0[_0xe9f0('0x4b')]['tag']);_0x4bb39d['forEach'](function(_0x23c9e8){_0x392eae['or'](_0xe9f0('0x7a'),'%,'+_0x23c9e8+',%');});}if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x92')]){var _0xdaf9e3=_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x92')][_0xe9f0('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xdaf9e3)){_0x954616['or'](_0xe9f0('0x94'),_0xdaf9e3+'%');}else{_0x954616['or'](_0xe9f0('0x95'),qs['getFullTextValue'](_0xdaf9e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xdaf9e3+'%');}}}_0x28fe47[_0xe9f0('0x54')](_0x954616);_0x28fe47[_0xe9f0('0x96')](_0xe9f0('0x97'));var _0xab92b={'type':db[_0xe9f0('0x98')]['QueryTypes'][_0xe9f0('0x99')],'raw':!![]};var _0x21eba3=_0x28fe47[_0xe9f0('0x9a')]();_0x21eba3[_0xe9f0('0x56')](_0xe9f0('0x97'));_0x21eba3[_0xe9f0('0x56')](_0xe9f0('0x9b'),'unreadMessages');if(_0x319380['order']){_0x319380['order'][_0xe9f0('0x44')](function(_0x3c95f4){var _0x245458=_0x3c95f4[0x0]===_0xe9f0('0x9c')?_0x3c95f4[0x0]:'i.'+_0x3c95f4[0x0];_0x28fe47['order'](_0x245458,_0x3c95f4[0x1]===_0xe9f0('0x9d')?![]:!![]);});}if(!_['isEmpty'](_0x4bb39d)){_0x28fe47[_0xe9f0('0x8e')](_0x392eae);_0x21eba3['where'](_0xe9f0('0x9e'),_0x4bb39d);}BPromise[_0xe9f0('0x9f')]()[_0xe9f0('0x21')](function(){if(!_0x28a66e){if(_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x83')])return;_0x21eba3[_0xe9f0('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0xa0'));return;}if(_0x2941a0[_0xe9f0('0xa1')][_0xe9f0('0xa2')]!==_0xe9f0('0xa3'))return;return _0x2941a0['user'][_0xe9f0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xe9f0('0x21')](function(_0x4c9808){if(_[_0xe9f0('0x82')](_0x4c9808)){_0x21eba3['where'](_0xe9f0('0xa5'));_0x28fe47[_0xe9f0('0x54')](_0xe9f0('0xa5'));}else{_0x21eba3['where'](_0xe9f0('0x84'),_[_0xe9f0('0x4a')](_0x4c9808,'id'));_0x28fe47[_0xe9f0('0x54')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe9f0('0x4a')](_0x4c9808,'id'));}});})[_0xe9f0('0x21')](function(){if(_0x2941a0[_0xe9f0('0xa1')][_0xe9f0('0xa2')]===_0xe9f0('0xa3')&&!_0x28a66e&&!_0x2941a0[_0xe9f0('0x4b')][_0xe9f0('0x83')])return[];return db['sequelize']['query'](_0x21eba3[_0xe9f0('0xa6')](),_0xab92b);})[_0xe9f0('0x21')](function(_0x1a7549){_0x4ffc17['count']=_0x1a7549[_0xe9f0('0x50')];if(_0x4ffc17[_0xe9f0('0x32')]===0x0)return[];return db[_0xe9f0('0xa7')][_0xe9f0('0x4b')](_0x3fa271['toString'](),_0xab92b)['then'](function(_0x20436f){_0xb18f13=_[_0xe9f0('0xa8')](_0x20436f,'id');_0xab92b=_['merge'](_0xab92b,{'model':db[_0xe9f0('0xa9')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2941a0['query']['fields']){_0x319380[_0xe9f0('0x4e')][_0xe9f0('0x44')](function(_0x77b59d){_0x28fe47[_0xe9f0('0x56')]('i.'+_0x77b59d);});}else{_0x28fe47[_0xe9f0('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xaa'),_0xe9f0('0xab'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xac'),'Account.mandatoryDisposition');_0x28fe47['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xe9f0('0x9c'));_0x28fe47['field'](_0xe9f0('0xad'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xae'),_0xe9f0('0xaf'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb0'),'Contact.lastName');_0x28fe47['field'](_0xe9f0('0xb1'),_0xe9f0('0xb2'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb3'),_0xe9f0('0xb4'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb5'),_0xe9f0('0xb6'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb7'),_0xe9f0('0xb8'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xb9'),_0xe9f0('0xba'));_0x28fe47['field'](_0xe9f0('0xbb'),_0xe9f0('0xbc'));_0x28fe47[_0xe9f0('0x56')](_0xe9f0('0xbd'),_0xe9f0('0x41'));}if(_0x319380[_0xe9f0('0x31')])_0x28fe47[_0xe9f0('0x31')](_0x319380[_0xe9f0('0x31')]);if(_0x319380[_0xe9f0('0x2f')])_0x28fe47[_0xe9f0('0x2f')](_0x319380[_0xe9f0('0x2f')]);return db['sequelize'][_0xe9f0('0x4b')](_0x28fe47[_0xe9f0('0xa6')](),_0xab92b);})[_0xe9f0('0x21')](function(_0x2af661){if(_0x2af661[_0xe9f0('0x50')]>0x0)_0x3dd40d[_0xe9f0('0x54')](_0xe9f0('0xbe'),_[_0xe9f0('0x4a')](_0x2af661,'id'));return db['sequelize']['query'](_0x3dd40d[_0xe9f0('0xa6')](),_0xab92b)[_0xe9f0('0x21')](function(_0x4e7f22){var _0x583c4c=_[_0xe9f0('0xbf')](_0x4e7f22,_0xe9f0('0xc0'));var _0x37a080=[];_0x2af661[_0xe9f0('0x44')](function(_0x21d159){_0x37a080[_0xe9f0('0xc1')](updateChatInteraction(_0x21d159,_0xb18f13,_0x583c4c));});return BPromise['all'](_0x37a080);});});})[_0xe9f0('0x21')](function(_0x2f1584){_0x4ffc17['rows']=_0x2f1584;return _0x4ffc17;})['then'](respondWithFilteredResult(_0x30141e,_0x319380))[_0xe9f0('0x2b')](handleError(_0x30141e,null));};exports[_0xe9f0('0xc2')]=function(_0x4b668a,_0x17013a){var _0x63e374={'raw':![],'where':{'id':_0x4b668a['params']['id']}},_0x34eda8={};_0x34eda8[_0xe9f0('0x49')]=_[_0xe9f0('0x4c')](db[_0xe9f0('0xa9')][_0xe9f0('0x46')]);_0x34eda8['query']=_[_0xe9f0('0x4c')](_0x4b668a[_0xe9f0('0x4b')]);_0x34eda8[_0xe9f0('0x4d')]=_['intersection'](_0x34eda8['model'],_0x34eda8['query']);_0x63e374[_0xe9f0('0x4e')]=_['intersection'](_0x34eda8['model'],qs[_0xe9f0('0x4f')](_0x4b668a['query'][_0xe9f0('0x4f')]));_0x63e374[_0xe9f0('0x4e')]=_0x63e374[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x63e374['attributes']:_0x34eda8[_0xe9f0('0x49')];if(_0x4b668a[_0xe9f0('0x4b')][_0xe9f0('0xc3')]){_0x63e374[_0xe9f0('0xc4')]=[{'all':!![]}];}_0x63e374=_[_0xe9f0('0x3d')]({},_0x63e374,_0x4b668a[_0xe9f0('0xc5')]);return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')](_0x63e374)[_0xe9f0('0x21')](handleEntityNotFound(_0x17013a,null))[_0xe9f0('0x21')](respondWithResult(_0x17013a,null))[_0xe9f0('0x2b')](handleError(_0x17013a,null));};exports[_0xe9f0('0xc6')]=function(_0x27c9f5,_0x56b64b){return db[_0xe9f0('0xa9')][_0xe9f0('0xc6')](_0x27c9f5['body'],{})['then'](respondWithResult(_0x56b64b,0xc9))[_0xe9f0('0x2b')](handleError(_0x56b64b,null));};exports[_0xe9f0('0x37')]=function(_0xef63f8,_0x1c0db4){if(_0xef63f8['body']['id']){delete _0xef63f8[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0xef63f8['params']['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x1c0db4,null))[_0xe9f0('0x21')](saveUpdates(_0xef63f8[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](respondWithResult(_0x1c0db4,null))[_0xe9f0('0x2b')](handleError(_0x1c0db4,null));};exports['destroy']=function(_0x5cbea8,_0x19f96b){return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x5cbea8[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x19f96b,null))[_0xe9f0('0x21')](removeEntity(_0x19f96b,null))[_0xe9f0('0x2b')](handleError(_0x19f96b,null));};exports[_0xe9f0('0xc8')]=function(_0x5ae9f1,_0x1aacfa){return db['ChatInteraction']['describe']()[_0xe9f0('0x21')](respondWithResult(_0x1aacfa,null))[_0xe9f0('0x2b')](handleError(_0x1aacfa,null));};exports[_0xe9f0('0xc9')]=function(_0x59396b,_0x564755){var _0x174e49=_0x59396b['params']['id'];var _0x3f2f29;var _0x18abe2;var _0x14e369;return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0x174e49}})[_0xe9f0('0x21')](function(_0x5108d3){_0x3f2f29=_0x5108d3;return db[_0xe9f0('0xca')]['findOne']({'where':{'id':_0x5108d3['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xe9f0('0xcb'),_0xe9f0('0xcc'),'vidaooNote',_0xe9f0('0xcd')],'raw':!![]});})[_0xe9f0('0x21')](function(_0x250bfe){if(_0x250bfe&&_0x250bfe[_0xe9f0('0xce')]&&_0x250bfe[_0xe9f0('0xcb')]){_0x18abe2=_0x250bfe;var _0x40306a={'interaction':{'id':_0x174e49},'agent':{'id':_0x59396b[_0xe9f0('0xa1')]['id'],'name':_0x59396b['user'][_0xe9f0('0x3a')],'fullname':_0x59396b[_0xe9f0('0xa1')][_0xe9f0('0x40')],'email':_0x59396b['user'][_0xe9f0('0xcf')]},'contact':_0x59396b[_0xe9f0('0x7f')][_0xe9f0('0x3e')],'account':_0x59396b['body'][_0xe9f0('0xd0')]};var _0x35456b={'rejectUnauthorized':![],'method':'POST','url':_0xe9f0('0xd1'),'headers':{'X-APIKEY':_0x250bfe['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x59396b[_0xe9f0('0xa1')][_0xe9f0('0xcf')]],'buttons':null,'topic':_0x18abe2[_0xe9f0('0xcc')],'note':_[_0xe9f0('0xd2')](_0x18abe2[_0xe9f0('0xd3')])?null:getMustacheRender(_0x18abe2[_0xe9f0('0xd3')],_0x40306a),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe9f0('0xd2')](_0x18abe2[_0xe9f0('0xcd')])){var _0xfe329a=getMustacheRender(_0x18abe2[_0xe9f0('0xcd')],_0x40306a);var _0x358cda=JSON[_0xe9f0('0x88')](_0xfe329a);_0x35456b[_0xe9f0('0x7f')]['metadata']=_0x358cda;}}catch(_0x5b9074){throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35456b);}else{throw new db[(_0xe9f0('0x98'))]['ValidationError'](_0xe9f0('0xd5'));}})[_0xe9f0('0x21')](function(_0x557b90){_0x14e369=_0x557b90;if(_0x14e369['id']){var _0x4aa320={'body':_0x14e369[_0xe9f0('0xd6')],'ChatWebsiteId':_0x18abe2['id'],'ChatInteractionId':_0x3f2f29['id'],'direction':_0xe9f0('0xd7'),'UserId':_0x59396b[_0xe9f0('0xa1')]['id']};return db['ChatMessage']['create'](_0x4aa320,{});}else{throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))](_0xe9f0('0xd8'));}})[_0xe9f0('0x21')](function(){return _0x3f2f29[_0xe9f0('0xd9')]({'vidaooSessionId':_0x14e369['id']});})[_0xe9f0('0x21')](respondWithResult(_0x564755,null))[_0xe9f0('0x2b')](handleError(_0x564755,null));};exports[_0xe9f0('0xda')]=function(_0x2f65a6,_0x45edd9){if(_0x2f65a6[_0xe9f0('0x7f')]['id']){delete _0x2f65a6[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x2f65a6['params']['id']},'include':[{'model':db[_0xe9f0('0xdb')],'as':'Contact'}]})[_0xe9f0('0x21')](handleEntityNotFound(_0x45edd9,null))[_0xe9f0('0x21')](saveUpdates(_0x2f65a6[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](respondWithResult(_0x45edd9,null))[_0xe9f0('0x2b')](handleError(_0x45edd9,null));};exports[_0xe9f0('0xdc')]=function(_0x297e2b,_0x114c65,_0x5df944){if(_0x297e2b[_0xe9f0('0x7f')]['id']){delete _0x297e2b[_0xe9f0('0x7f')]['id'];}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x297e2b[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](function(_0x1095d8){if(!_0x1095d8){logger[_0xe9f0('0x27')](_0xe9f0('0xdd'),_0xe9f0('0xdc'),0x194,_0xe9f0('0xde'));_0x114c65[_0xe9f0('0x2c')](0x194);}else{if(_0x1095d8[_0xe9f0('0x7e')]){throw new db[(_0xe9f0('0x98'))][(_0xe9f0('0xd4'))](_0xe9f0('0xdf'));}}return _0x1095d8;})['then'](function(_0x430b27){if(_0x430b27){return _0x430b27[_0xe9f0('0x37')]({'closed':_0x297e2b['body'][_0xe9f0('0xe0')],'disposition':_0x297e2b[_0xe9f0('0x7f')][_0xe9f0('0xe1')]})[_0xe9f0('0x21')](function(_0x5c34fa){return _0x5c34fa;});}})[_0xe9f0('0x21')](function(_0x3c80a4){return respondWithRpcPromise(_0xe9f0('0xe2'),_0xe9f0('0xdc'),_0x297e2b['body'],client9004);})[_0xe9f0('0x21')](respondWithResult(_0x114c65,null))['catch'](handleError(_0x114c65,null));};exports['attachmentUpload']=function(_0x14cad3,_0x4a98e8,_0x5cba30){_0x14cad3[_0xe9f0('0x7f')][_0xe9f0('0x3a')]=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe4')];_0x14cad3[_0xe9f0('0x7f')]['basename']=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe5')];_0x14cad3['body'][_0xe9f0('0x47')]=_0x14cad3[_0xe9f0('0xe3')][_0xe9f0('0xe6')];return db[_0xe9f0('0xe7')][_0xe9f0('0xc6')](_0x14cad3[_0xe9f0('0x7f')])[_0xe9f0('0x21')](respondWithResult(_0x4a98e8,0xc9))[_0xe9f0('0x2b')](handleError(_0x4a98e8,null));};exports[_0xe9f0('0xe8')]=function(_0x5b2c15,_0x2446b3,_0x3a3c7c){return db['ChatInteraction'][_0xe9f0('0xe9')]({'where':{'id':_0x5b2c15[_0xe9f0('0xc7')]['id']},'raw':!![]})[_0xe9f0('0x21')](handleEntityNotFound(_0x2446b3,null))[_0xe9f0('0x21')](function(_0x327d68){if(_0x327d68){if(_0x327d68['closed']){return _0x2446b3['status'](0x193)[_0xe9f0('0x35')]({'status':0x193,'message':_0xe9f0('0xea')});}return db[_0xe9f0('0xe7')]['findOne']({'where':{'id':_0x5b2c15[_0xe9f0('0x4b')][_0xe9f0('0xeb')]},'raw':!![]})[_0xe9f0('0x21')](handleEntityNotFound(_0x2446b3,null));}})[_0xe9f0('0x21')](function(_0x48ba5a){if(_0x48ba5a){var _0xac14ad=_0x48ba5a[_0xe9f0('0xec')]!==null;var _0x123951=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],_0xe9f0('0xef'));if(_0xac14ad){_0x123951=path[_0xe9f0('0xed')](_0x123951,_0xe9f0('0xf0'));}var _0x302279=path[_0xe9f0('0xed')](_0x123951,_0x48ba5a[_0xe9f0('0xf1')]);return _0x2446b3[_0xe9f0('0xf2')](_0x302279);}})['catch'](handleError(_0x2446b3,null));};exports[_0xe9f0('0xf3')]=function(_0x473602,_0x3cadbd){var _0x58fe38=null;var _0x1b37f7=null;var _0x4a3765=null;var _0x5964af=null;if(_0x473602[_0xe9f0('0x7f')]['id']){delete _0x473602['body']['id'];}if(_0x473602[_0xe9f0('0x7f')]['mailTranscript']){_0x5964af=path['join'](config[_0xe9f0('0xee')],_0xe9f0('0xf4'),util[_0xe9f0('0xf5')]('transcript-%s.txt',Date[_0xe9f0('0xf6')]()));_0x473602[_0xe9f0('0x7f')][_0xe9f0('0xf7')]=_0x5964af;}return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x473602[_0xe9f0('0xc7')]['id']},'include':[{'model':db[_0xe9f0('0xf8')],'as':_0xe9f0('0xf9'),'include':[{'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x7c')}]}]})[_0xe9f0('0x21')](handleEntityNotFound(_0x3cadbd,null))[_0xe9f0('0x21')](saveUpdates(_0x473602[_0xe9f0('0x7f')],null))[_0xe9f0('0x21')](function(_0x56a50c){if(_0x56a50c){_0x58fe38=_0x56a50c;return db[_0xe9f0('0xca')][_0xe9f0('0x6e')]({'where':{'id':_0x58fe38[_0xe9f0('0x83')]}});}})[_0xe9f0('0x21')](function(_0x2136dc){if(_0x2136dc){_0x4a3765=_0x2136dc;return db[_0xe9f0('0xdb')][_0xe9f0('0x6e')]({'where':{'id':_0x58fe38[_0xe9f0('0x75')]}});}})['then'](function(_0x296efe){if(_0x296efe){_0x1b37f7=_0x296efe;if(_0x5964af){var _0x504875=null;for(var _0x46e2fe=0x1;_0x46e2fe<_0x58fe38[_0xe9f0('0xf9')][_0xe9f0('0x50')];++_0x46e2fe){_0x504875=_0x58fe38[_0xe9f0('0xf9')][_0x46e2fe];var _0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')]('%s%d',_0x4a3765[_0xe9f0('0xfa')],_0x504875['UserId']):_0xe9f0('0xfb');var _0x419fdf=_0x473602['body']['customer']||util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0xe9f0('0xfd'),_0x504875[_0xe9f0('0x75')]);switch(_0x4a3765[_0xe9f0('0xfe')]){case _0xe9f0('0xff'):_0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0x4a3765[_0xe9f0('0xfa')],_0x504875[_0xe9f0('0x7e')]):_0xe9f0('0xfb');break;case _0xe9f0('0x100'):_0x329aa8=_0x504875['UserId']?_0x504875[_0xe9f0('0x7c')]['alias']||_0x504875['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb');break;case _0xe9f0('0x101'):_0x329aa8=_0x504875[_0xe9f0('0x7e')]?_0x504875['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb');break;default:_0x329aa8=_0x504875[_0xe9f0('0x7e')]?util[_0xe9f0('0xf5')](_0xe9f0('0xfc'),_0x4a3765['agentAlias'],_0x504875[_0xe9f0('0x7e')]):_0xe9f0('0xfb');}var _0x5293e4=util[_0xe9f0('0xf5')]('[%s]\x20%s:\x20%s\x0a',moment(_0x504875[_0xe9f0('0x86')])[_0xe9f0('0xf5')](_0xe9f0('0x102')),_0x504875[_0xe9f0('0x103')]==='in'?_0x419fdf:_0x329aa8,_0x504875[_0xe9f0('0x7f')]);if(!_0x504875[_0xe9f0('0x104')]){fs[_0xe9f0('0x105')](_0x5964af,_0x5293e4);}}return db[_0xe9f0('0x106')][_0xe9f0('0xe9')]({'where':{'service':!![]},'include':[{'model':db[_0xe9f0('0x107')],'as':'Smtp','raw':!![]}]});}}})[_0xe9f0('0x21')](function(_0x52919a){if(_0x52919a&&_0x52919a[_0xe9f0('0x108')]&&_0x473602[_0xe9f0('0x7f')]){var _0x509bb7={'tls':{'rejectUnauthorized':![]}};if(_0x52919a['Smtp']['service']){_0x509bb7[_0xe9f0('0x109')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x109')];}else{_0x509bb7[_0xe9f0('0x10a')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x10a')];_0x509bb7[_0xe9f0('0x10b')]=_0x52919a[_0xe9f0('0x108')][_0xe9f0('0x10b')];_0x509bb7['secure']=_0x52919a['Smtp'][_0xe9f0('0x10c')];}if(_0x52919a['Smtp'][_0xe9f0('0x10d')]){_0x509bb7[_0xe9f0('0x10e')]={'user':_0x52919a[_0xe9f0('0x108')][_0xe9f0('0xa1')],'pass':_0x52919a[_0xe9f0('0x108')]['pass']};}return respondWithRpcPromise(_0xe9f0('0x10f'),_0xe9f0('0x110'),{'account':_0x509bb7,'message':{'from':util[_0xe9f0('0xf5')](_0xe9f0('0x111'),_0x52919a[_0xe9f0('0x3a')],_0x52919a['email']||_0x52919a[_0xe9f0('0x108')][_0xe9f0('0xa1')]),'to':_0x473602['body'][_0xe9f0('0x112')],'subject':_0xe9f0('0x113'),'text':util[_0xe9f0('0xf5')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x473602['body'][_0xe9f0('0x112')]),'attachments':[{'path':_0x5964af}]}})[_0xe9f0('0x21')](function(){return _0x58fe38;})[_0xe9f0('0x2b')](function(_0x4e4045){console['error'](_0x4e4045);});}else{return _0x58fe38;}})[_0xe9f0('0x21')](respondWithStatusCode(_0x3cadbd,0xc8))[_0xe9f0('0x2b')](handleError(_0x3cadbd,null));};exports[_0xe9f0('0x114')]=function(_0x4ee4f9,_0x3d4e42,_0x108042){return db[_0xe9f0('0xf8')][_0xe9f0('0x6e')]({'where':{'id':_0x4ee4f9[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x3d4e42,null))['then'](function(_0x218ee5){if(_0x218ee5){return _0x218ee5[_0xe9f0('0x114')](_0x4ee4f9[_0xe9f0('0x7f')][_0xe9f0('0x115')],_[_0xe9f0('0x116')](_0x4ee4f9[_0xe9f0('0x7f')],[_0xe9f0('0x115'),'id'])||{});}})[_0xe9f0('0x21')](respondWithResult(_0x3d4e42,null))[_0xe9f0('0x2b')](handleError(_0x3d4e42,null));};exports[_0xe9f0('0x117')]=function(_0x302ea1,_0x267c6d,_0x6f6f84){var _0xa4fd68={'raw':![],'where':{}};var _0x444df7={};var _0xd6a343={'count':0x0,'rows':[]};return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0x302ea1['params']['id']}})['then'](handleEntityNotFound(_0x267c6d,null))[_0xe9f0('0x21')](function(_0xfa1b2){if(_0xfa1b2){_0x444df7['model']=_[_0xe9f0('0x4c')](db['ChatMessage'][_0xe9f0('0x46')]);_0x444df7[_0xe9f0('0x4b')]=_['keys'](_0x302ea1[_0xe9f0('0x4b')]);_0x444df7['filters']=_[_0xe9f0('0x118')](_0x444df7['model'],_0x444df7['query']);_0xa4fd68[_0xe9f0('0x4e')]=_[_0xe9f0('0x118')](_0x444df7['model'],qs[_0xe9f0('0x4f')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x4f')]));_0xa4fd68[_0xe9f0('0x4e')]=_0xa4fd68[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0xa4fd68['attributes']:_0x444df7[_0xe9f0('0x49')];if(!_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x51')](_0xe9f0('0x52'))){_0xa4fd68['limit']=qs[_0xe9f0('0x31')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0xa4fd68[_0xe9f0('0x2f')]=qs[_0xe9f0('0x2f')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0xa4fd68[_0xe9f0('0x53')]=qs[_0xe9f0('0x119')](_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x119')]);_0xa4fd68[_0xe9f0('0x54')]=qs['filters'](_[_0xe9f0('0x55')](_0x302ea1[_0xe9f0('0x4b')],_0x444df7[_0xe9f0('0x4d')]));_0xa4fd68['where'][_0xe9f0('0xc0')]=_0xfa1b2['id'];if(_0x302ea1[_0xe9f0('0x4b')]['filter']){_0xa4fd68[_0xe9f0('0x54')]=_[_0xe9f0('0x3d')](_0xa4fd68[_0xe9f0('0x54')],{'$or':_[_0xe9f0('0x4a')](_0xa4fd68[_0xe9f0('0x4e')],function(_0x40b24c){var _0x71ea35={};_0x71ea35[_0x40b24c]={'$like':'%'+_0x302ea1['query']['filter']+'%'};return _0x71ea35;})});}if(_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0x87')]){var _0x2ecef9=_0x302ea1['query'][_0xe9f0('0x87')]['split'](',');var _0x52a628={};_0x52a628[_0x2ecef9[0x0]]={'$gte':moment(_0x2ecef9[0x1])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))};_0xa4fd68['where']=_[_0xe9f0('0x3d')](_0xa4fd68[_0xe9f0('0x54')],_0x52a628);}_0xa4fd68=_[_0xe9f0('0x3d')]({},_0xa4fd68,_0x302ea1[_0xe9f0('0xc5')]);return db[_0xe9f0('0xf8')][_0xe9f0('0x32')]({'where':_0xa4fd68[_0xe9f0('0x54')]})[_0xe9f0('0x21')](function(_0x90b257){_0xd6a343[_0xe9f0('0x32')]=_0x90b257;if(_0x302ea1[_0xe9f0('0x4b')][_0xe9f0('0xc3')]){_0xa4fd68[_0xe9f0('0xc4')]=[{'all':!![]}];}return db[_0xe9f0('0xf8')][_0xe9f0('0x11b')](_0xa4fd68);})[_0xe9f0('0x21')](function(_0x48e968){_0xd6a343['rows']=_0x48e968;return _0xd6a343;});}})[_0xe9f0('0x21')](respondWithFilteredResult(_0x267c6d,_0xa4fd68))[_0xe9f0('0x2b')](handleError(_0x267c6d,null));};exports['getMyMessages']=function(_0xc39799,_0x5efe58,_0x216fe9){var _0x7cc418={'where':{}},_0x32805e={},_0x4a3225={'count':0x0,'rows':[]};return db[_0xe9f0('0xa9')]['findOne']({'where':{'id':_0xc39799[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x5efe58,null))[_0xe9f0('0x21')](function(_0x2391b7){if(_0x2391b7){_0x32805e[_0xe9f0('0x49')]=_[_0xe9f0('0x4c')](db[_0xe9f0('0xf8')]['rawAttributes']);_0x32805e['query']=_[_0xe9f0('0x4c')](_0xc39799[_0xe9f0('0x4b')]);_0x32805e['filters']=_[_0xe9f0('0x118')](_0x32805e['model'],_0x32805e[_0xe9f0('0x4b')]);_0x7cc418[_0xe9f0('0x4e')]=_[_0xe9f0('0x118')](_0x32805e[_0xe9f0('0x49')],qs['fields'](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x4f')]));_0x7cc418[_0xe9f0('0x4e')]=_0x7cc418[_0xe9f0('0x4e')][_0xe9f0('0x50')]?_0x7cc418[_0xe9f0('0x4e')]:_0x32805e[_0xe9f0('0x49')];if(!_0xc39799[_0xe9f0('0x4b')]['hasOwnProperty']('nolimit')){_0x7cc418[_0xe9f0('0x31')]=qs[_0xe9f0('0x31')](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x31')]);_0x7cc418['offset']=qs[_0xe9f0('0x2f')](_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x2f')]);}_0x7cc418['order']=qs[_0xe9f0('0x119')](_0xc39799[_0xe9f0('0x4b')]['sort']);_0x7cc418[_0xe9f0('0x54')]=qs[_0xe9f0('0x4d')](_[_0xe9f0('0x55')](_0xc39799[_0xe9f0('0x4b')],_0x32805e[_0xe9f0('0x4d')]));_0x7cc418[_0xe9f0('0x54')]['ChatInteractionId']=_0x2391b7['id'];if(_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x92')]){_0x7cc418[_0xe9f0('0x54')]=_[_0xe9f0('0x3d')](_0x7cc418['where'],{'$or':_[_0xe9f0('0x4a')](_0x7cc418['attributes'],function(_0x1ad83c){var _0x388dad={};_0x388dad[_0x1ad83c]={'$like':'%'+_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x92')]+'%'};return _0x388dad;})});}_0x7cc418[_0xe9f0('0x54')][_0xe9f0('0x104')]=![];if(_0xc39799[_0xe9f0('0x4b')]['id']){_0x7cc418[_0xe9f0('0x54')]['id']={'$gt':_0xc39799['query']['id']};}_0x7cc418=_[_0xe9f0('0x3d')]({},_0x7cc418,_0xc39799[_0xe9f0('0xc5')]);return db[_0xe9f0('0xf8')][_0xe9f0('0x32')]({'where':_0x7cc418[_0xe9f0('0x54')]})['then'](function(_0x198900){_0x4a3225[_0xe9f0('0x32')]=_0x198900;_0x7cc418['include']=[];if(_0xc39799[_0xe9f0('0x4b')][_0xe9f0('0x11c')]){_0x7cc418['include'][_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':'User','attributes':['id',_0xe9f0('0x40'),_0xe9f0('0x11d')]});}if(_0xc39799['query']['includeAll']){_0x7cc418['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x7cc418);})[_0xe9f0('0x21')](function(_0x266c0f){_0x4a3225[_0xe9f0('0x11e')]=_0x266c0f;return _0x4a3225;});}})['then'](respondWithFilteredResult(_0x5efe58,_0x7cc418))[_0xe9f0('0x2b')](handleError(_0x5efe58,null));};exports[_0xe9f0('0x11f')]=function(_0x548542,_0xdd7ded,_0x16b798){return db[_0xe9f0('0xa9')][_0xe9f0('0x6e')]({'where':{'id':_0x548542['params']['id']}})['then'](handleEntityNotFound(_0xdd7ded,null))['then'](function(_0x2ebe48){if(_0x2ebe48){return _0x2ebe48['setTags'](_0x548542[_0xe9f0('0x7f')]['ids'],_['omit'](_0x548542[_0xe9f0('0x7f')],['ids','id'])||{})[_0xe9f0('0x120')](function(){return db[_0xe9f0('0x79')][_0xe9f0('0x11b')]({'attributes':['id',_0xe9f0('0x3a'),'color'],'where':{'id':_0x548542[_0xe9f0('0x7f')]['ids']}});})[_0xe9f0('0x21')](function(_0x107363){socket[_0xe9f0('0x121')]('chatInteractionTags:save',{'id':Number(_0x548542[_0xe9f0('0xc7')]['id']),'tags':_0x107363||[]});return{'id':Number(_0x548542[_0xe9f0('0xc7')]['id']),'tags':_0x107363||[]};});}})[_0xe9f0('0x21')](respondWithResult(_0xdd7ded,null))['catch'](handleError(_0xdd7ded,null));};exports['removeTags']=function(_0x257fc2,_0x58c366,_0x306620){return db['ChatInteraction'][_0xe9f0('0x6e')]({'where':{'id':_0x257fc2[_0xe9f0('0xc7')]['id']}})[_0xe9f0('0x21')](handleEntityNotFound(_0x58c366,null))[_0xe9f0('0x21')](function(_0x13e1bd){if(_0x13e1bd){return _0x13e1bd[_0xe9f0('0x122')](_0x257fc2[_0xe9f0('0x4b')]['ids']);}})[_0xe9f0('0x21')](respondWithStatusCode(_0x58c366,null))['catch'](handleError(_0x58c366,null));};exports[_0xe9f0('0xf2')]=function(_0x37d384,_0x35de8c){var _0x1da405=moment()['unix']()[_0xe9f0('0xa6')]();var _0x1e3715=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],_0xe9f0('0x123'),'files',_0xe9f0('0x124'));var _0x31a744=path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],'server',_0xe9f0('0x125'),_0xe9f0('0x126'));var _0x1cc3b2=path[_0xe9f0('0xed')](_0x1e3715,_0x1da405);var _0x450684=util[_0xe9f0('0xf5')](_0xe9f0('0x127'),_0x37d384['params']['id'],_0x1da405);var _0x2163d8=path[_0xe9f0('0xed')](_0x1e3715,_0x450684);var _0x2dd6d1=[];_0x2dd6d1[_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x7c'),'attributes':['id',_0xe9f0('0x40')],'raw':!![]});_0x2dd6d1[_0xe9f0('0xc1')]({'model':db['CmContact'],'as':_0xe9f0('0x128'),'attributes':['id',_0xe9f0('0x129'),'lastName'],'raw':!![]});if(_0x37d384[_0xe9f0('0x4b')][_0xe9f0('0x126')]){_0x2dd6d1[_0xe9f0('0xc1')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x36e6b0=[{'model':db['ChatMessage'],'as':_0xe9f0('0xf9'),'attributes':['id',_0xe9f0('0x7f'),_0xe9f0('0x86'),_0xe9f0('0x103'),'secret',_0xe9f0('0x8d')],'include':_0x2dd6d1}];_0x36e6b0['push']({'model':db['ChatWebsite'],'as':_0xe9f0('0x12a'),'attributes':['id',_0xe9f0('0x3a')]});_0x36e6b0[_0xe9f0('0xc1')]({'model':db[_0xe9f0('0x7c')],'as':_0xe9f0('0x12b'),'attributes':['id',_0xe9f0('0x40')]});return db['ChatInteraction'][_0xe9f0('0x6e')]({'where':{'id':_0x37d384['params']['id']},'include':_0x36e6b0})[_0xe9f0('0x21')](handleEntityNotFound(_0x35de8c,null))[_0xe9f0('0x21')](function(_0x193cb2){if(_0x193cb2){var _0x3cb18a=_0x193cb2['get']({'plain':!![]});fs[_0xe9f0('0x12c')](_0x1cc3b2);var _0x3e49a0={'channel':'Chat','account':_0x3cb18a[_0xe9f0('0x12a')][_0xe9f0('0x3a')],'agent':_0x3cb18a[_0xe9f0('0x12b')]?_0x3cb18a['Owner']['fullname']:'N.A.','createdAt':moment(_0x3cb18a[_0xe9f0('0x86')])[_0xe9f0('0xf5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9f0('0xa6')](),'closedAt':_0x3cb18a[_0xe9f0('0xe0')]?moment(_0x3cb18a[_0xe9f0('0x12d')])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))[_0xe9f0('0xa6')]():'','disposition':_0x3cb18a[_0xe9f0('0xe1')],'chatInfo':{'browser':_0x3cb18a[_0xe9f0('0x12e')],'os':_0x3cb18a['osName'],'referer':_0x3cb18a[_0xe9f0('0x12f')],'customerIp':_0x3cb18a[_0xe9f0('0x130')],'customerPort':_0x3cb18a[_0xe9f0('0x131')]?_0x3cb18a[_0xe9f0('0x131')]:_0xe9f0('0x132')},'messages':_(_0x3cb18a['Messages'])[_0xe9f0('0x133')]()['filter']({'secret':![]})[_0xe9f0('0x4a')](function(_0xa78163){if(_0xa78163[_0xe9f0('0xe7')]){var _0x3b422c=path[_0xe9f0('0xed')](_0x31a744,_0xa78163['Attachment'][_0xe9f0('0xf1')]);if(fs[_0xe9f0('0x134')](_0x3b422c)){fs['createReadStream'](_0x3b422c)[_0xe9f0('0x135')](fs[_0xe9f0('0x136')](path['join'](_0x1cc3b2,_0xa78163[_0xe9f0('0xe7')][_0xe9f0('0xf1')])));}}return{'date':moment(_0xa78163[_0xe9f0('0x86')])[_0xe9f0('0xf5')](_0xe9f0('0x11a'))[_0xe9f0('0xa6')](),'sender':_0xa78163[_0xe9f0('0x103')]===_0xe9f0('0xd7')?_0xa78163[_0xe9f0('0x7c')]?_0xa78163['User'][_0xe9f0('0x40')]:_0xe9f0('0xfb'):_0xa78163[_0xe9f0('0x128')]['firstName']+(_0xa78163['Contact'][_0xe9f0('0x137')]?'\x20'+_0xa78163[_0xe9f0('0x128')]['lastName']:''),'body':_0xa78163[_0xe9f0('0xe7')]?_0xa78163['Attachment']['basename']:_0xa78163['body'],'direction':_0xa78163['direction']===_0xe9f0('0xd7')?'A':'C','secret':_0xa78163[_0xe9f0('0x104')],'read':_0xa78163['read'],'attachment':_0xa78163[_0xe9f0('0xe7')]};})[_0xe9f0('0x72')]()};return ejs['renderFile'](path[_0xe9f0('0xed')](config[_0xe9f0('0xee')],'server','views',_0xe9f0('0x138')),{'interaction':_0x3e49a0})['then'](function(_0x27f0d9){var _0x296c10=path[_0xe9f0('0xed')](_0x1cc3b2,_0xe9f0('0x139')+_0x3cb18a['id']+'-'+_0x1da405+'.pdf');var _0x484e2d={'path':_0x296c10,'channel':_0xe9f0('0x13a'),'interactionId':_0x3cb18a['id']};return pdf[_0xe9f0('0x13b')](_0x27f0d9,_0x484e2d);})[_0xe9f0('0x21')](function(){return new BPromise(function(_0x1cf653,_0x571169){zipdir(_0x1cc3b2,{'saveTo':_0x2163d8},function(_0x1f25ea,_0x524711){if(_0x1f25ea)return _0x571169(_0x1f25ea);return _0x1cf653(_0x524711);});})[_0xe9f0('0x21')](function(){return new BPromise(function(_0xbb7e33,_0x2e2fb9){rimraf(_0x1cc3b2,function(_0x51d788){if(_0x51d788)_0x2e2fb9(_0x51d788);return _0xbb7e33();});});})[_0xe9f0('0x21')](function(){return _0x35de8c[_0xe9f0('0xf2')](_0x2163d8,_0x450684,function(_0x4da74e){if(_0x4da74e){console['log'](_0xe9f0('0x13c'),_0x4da74e);}else{fs['unlinkSync'](_0x2163d8);}});});});}else{return _0x35de8c['sendStatus'](0xc8);}})[_0xe9f0('0x2b')](handleError(_0x35de8c,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9be2dbc..4e274a9 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 _0xaa9c=['../../mysqldb','ChatInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','map','unreadMessages','emit','catch','hasOwnProperty','exports'];(function(_0x547085,_0x36664b){var _0x5f7705=function(_0x2b21e4){while(--_0x2b21e4){_0x547085['push'](_0x547085['shift']());}};_0x5f7705(++_0x36664b);}(_0xaa9c,0xee));var _0xcaa9=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xaa9c[_0x599f41];return _0x2e4d58;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xcaa9('0x0'))['db'][_0xcaa9('0x1')];var ChatMessage=require(_0xcaa9('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xcaa9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcaa9('0x3'),'afterDestroy':_0xcaa9('0x4')};function emitEvent(_0x484f39){return function(_0x765567,_0x1345d8,_0x1dd05e){_0x765567[_0xcaa9('0x5')]({'attributes':['id'],'raw':!![]})[_0xcaa9('0x6')](function(_0x2e5e23){_0x765567[_0xcaa9('0x7')]('Users',_0x2e5e23[_0xcaa9('0x8')](function(_0x2a0a68){return{'id':_0x2a0a68['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x765567['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcaa9('0x6')](function(_0x309b9f){_0x765567[_0xcaa9('0x7')](_0xcaa9('0x9'),_0x309b9f['length']);ChatInteractionEvents[_0xcaa9('0xa')](_0x484f39+':'+_0x765567['id'],_0x765567);ChatInteractionEvents[_0xcaa9('0xa')](_0x484f39,_0x765567);_0x1dd05e(null);})[_0xcaa9('0xb')](_0x1dd05e(null));};}for(var e in events){if(events[_0xcaa9('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xcaa9('0xd')]=ChatInteractionEvents; \ No newline at end of file +var _0xef91=['save','update','remove','then','setDataValue','Users','findAll','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xef91,0x13e));var _0x1ef9=function(_0xd10742,_0x110101){_0xd10742=_0xd10742-0x0;var _0x1c7be4=_0xef91[_0xd10742];return _0x1c7be4;};'use strict';var EventEmitter=require(_0x1ef9('0x0'));var ChatInteraction=require(_0x1ef9('0x1'))['db'][_0x1ef9('0x2')];var ChatMessage=require(_0x1ef9('0x1'))['db'][_0x1ef9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1ef9('0x4')](0x0);var events={'afterCreate':_0x1ef9('0x5'),'afterUpdate':_0x1ef9('0x6'),'afterDestroy':_0x1ef9('0x7')};function emitEvent(_0xea67ca){return function(_0x5b38a0,_0x1c060f,_0x1d2552){_0x5b38a0['getUsers']({'attributes':['id'],'raw':!![]})[_0x1ef9('0x8')](function(_0x2ffd52){_0x5b38a0[_0x1ef9('0x9')](_0x1ef9('0xa'),_0x2ffd52['map'](function(_0x20af6b){return{'id':_0x20af6b['id']};}));return ChatMessage[_0x1ef9('0xb')]({'where':{'ChatInteractionId':_0x5b38a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1ef9('0x8')](function(_0x4f15f3){_0x5b38a0['setDataValue']('unreadMessages',_0x4f15f3[_0x1ef9('0xc')]);ChatInteractionEvents['emit'](_0xea67ca+':'+_0x5b38a0['id'],_0x5b38a0);ChatInteractionEvents[_0x1ef9('0xd')](_0xea67ca,_0x5b38a0);_0x1d2552(null);})[_0x1ef9('0xe')](_0x1d2552(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x1ef9('0xf')](e,emitEvent(event));}}module[_0x1ef9('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ec06056..0eae681 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 _0x1aff=['closed','closedAt','utf8mb4_unicode_ci','lodash','util','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x1aff,0x162));var _0xf1af=function(_0x25494c,_0x3ad717){_0x25494c=_0x25494c-0x0;var _0x4627d1=_0x1aff[_0x25494c];return _0x4627d1;};'use strict';var _=require(_0xf1af('0x0'));var util=require(_0xf1af('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf1af('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1af('0x3'));var config=require(_0xf1af('0x4'));var attributes=require(_0xf1af('0x5'));module[_0xf1af('0x6')]=function(_0x3eff7e,_0x2b7886){return _0x3eff7e[_0xf1af('0x7')](_0xf1af('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x340b85,_0x97add1,_0x45760e){if(_0x340b85[_0xf1af('0x9')](_0xf1af('0xa'))){_0x340b85[_0xf1af('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x45760e(null,_0x340b85);}},'charset':'utf8mb4','collate':_0xf1af('0xc')});}; \ No newline at end of file +var _0x7cda=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5837a4,_0x15c0f7){var _0x1feb62=function(_0x17d586){while(--_0x17d586){_0x5837a4['push'](_0x5837a4['shift']());}};_0x1feb62(++_0x15c0f7);}(_0x7cda,0x1e8));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa7cd('0x0'));var util=require(_0xa7cd('0x1'));var logger=require(_0xa7cd('0x2'))(_0xa7cd('0x3'));var moment=require('moment');var BPromise=require(_0xa7cd('0x4'));var rp=require(_0xa7cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7cd('0x6'));var config=require(_0xa7cd('0x7'));var attributes=require(_0xa7cd('0x8'));module[_0xa7cd('0x9')]=function(_0x1e1669,_0x4fc010){return _0x1e1669[_0xa7cd('0xa')](_0xa7cd('0xb'),attributes,{'tableName':_0xa7cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x545c62,_0x725c66,_0x1ea7d1){if(_0x545c62['changed'](_0xa7cd('0xd'))){_0x545c62['closedAt']=moment()[_0xa7cd('0xe')](_0xa7cd('0xf'));}_0x1ea7d1(null,_0x545c62);}},'charset':_0xa7cd('0x10'),'collate':_0xa7cd('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 1118f6f..0fc7ae8 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 _0xa5d2=['raw','attributes','limit','then','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','where','addTags','ids','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','./chatInteraction.socket','register','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','ChatInteraction','update','body','options'];(function(_0x16728a,_0x380e7f){var _0x57e9fd=function(_0x5520d5){while(--_0x5520d5){_0x16728a['push'](_0x16728a['shift']());}};_0x57e9fd(++_0x380e7f);}(_0xa5d2,0x11d));var _0x2a5d=function(_0x438101,_0xb0f6a6){_0x438101=_0x438101-0x0;var _0x43aba3=_0xa5d2[_0x438101];return _0x43aba3;};'use strict';var _=require(_0x2a5d('0x0'));var util=require('util');var moment=require(_0x2a5d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a5d('0x2'));var db=require(_0x2a5d('0x3'))['db'];var utils=require(_0x2a5d('0x4'));var logger=require(_0x2a5d('0x5'))(_0x2a5d('0x6'));var config=require(_0x2a5d('0x7'));var jayson=require(_0x2a5d('0x8'));var client=jayson[_0x2a5d('0x9')]['http']({'port':0x232a});config[_0x2a5d('0xa')]=_['defaults'](config[_0x2a5d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a5d('0xa')]));require(_0x2a5d('0xb'))[_0x2a5d('0xc')](socket);function respondWithRpcPromise(_0x373ac8,_0x31dc3a,_0x407909){return new BPromise(function(_0x70c7b2,_0x47ba2e){return client[_0x2a5d('0xd')](_0x373ac8,_0x407909)['then'](function(_0x5f2cc){logger[_0x2a5d('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x31dc3a,_0x2a5d('0xf'));logger[_0x2a5d('0x10')](_0x2a5d('0x11'),_0x31dc3a,_0x2a5d('0xf'),JSON['stringify'](_0x5f2cc));if(_0x5f2cc[_0x2a5d('0x12')]){if(_0x5f2cc['error'][_0x2a5d('0x13')]===0x1f4){logger['error'](_0x2a5d('0x14'),_0x31dc3a,_0x5f2cc[_0x2a5d('0x12')]['message']);return _0x47ba2e(_0x5f2cc[_0x2a5d('0x12')][_0x2a5d('0x15')]);}logger[_0x2a5d('0x12')](_0x2a5d('0x14'),_0x31dc3a,_0x5f2cc[_0x2a5d('0x12')]['message']);return _0x70c7b2(_0x5f2cc[_0x2a5d('0x12')]['message']);}else{logger[_0x2a5d('0xe')](_0x2a5d('0x14'),_0x31dc3a,_0x2a5d('0xf'));_0x70c7b2(_0x5f2cc['result'][_0x2a5d('0x15')]);}})[_0x2a5d('0x16')](function(_0x2d643f){logger[_0x2a5d('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x31dc3a,_0x2d643f);_0x47ba2e(_0x2d643f);});});}exports['UpdateChatInteraction']=function(_0x57ef93){var _0x18fe17=this;return new Promise(function(_0xe20f01,_0x617a44){return db[_0x2a5d('0x17')][_0x2a5d('0x18')](_0x57ef93[_0x2a5d('0x19')],{'raw':_0x57ef93['options']?_0x57ef93[_0x2a5d('0x1a')][_0x2a5d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57ef93['options']?_0x57ef93['options']['where']||null:null,'attributes':_0x57ef93['options']?_0x57ef93[_0x2a5d('0x1a')][_0x2a5d('0x1c')]||null:null,'limit':_0x57ef93['options']?_0x57ef93[_0x2a5d('0x1a')][_0x2a5d('0x1d')]||null:null})[_0x2a5d('0x1e')](function(_0x3340c4){logger['info'](_0x2a5d('0x1f'),_0x57ef93);logger[_0x2a5d('0x10')](_0x2a5d('0x1f'),_0x57ef93,JSON[_0x2a5d('0x20')](_0x3340c4));_0xe20f01(_0x3340c4);})[_0x2a5d('0x16')](function(_0x251d7f){logger[_0x2a5d('0x12')](_0x2a5d('0x1f'),_0x251d7f[_0x2a5d('0x15')],_0x57ef93);_0x617a44(_0x18fe17[_0x2a5d('0x12')](0x1f4,_0x251d7f[_0x2a5d('0x15')]));});});};exports[_0x2a5d('0x21')]=function(_0x1b39d9){return new Promise(function(_0x5dc5ea,_0x434bf8){return db[_0x2a5d('0x17')][_0x2a5d('0x22')]({'where':_0x1b39d9[_0x2a5d('0x1a')]?_0x1b39d9['options'][_0x2a5d('0x23')]||null:null})[_0x2a5d('0x1e')](function(_0x69bfe0){if(_0x69bfe0){return _0x69bfe0[_0x2a5d('0x24')](_0x1b39d9[_0x2a5d('0x19')]['ids'],_['omit'](_0x1b39d9['body'],[_0x2a5d('0x25'),'id'])||{});}})['spread'](function(_0x2482f7){logger[_0x2a5d('0xe')](_0x2a5d('0x26'),_0x1b39d9);logger[_0x2a5d('0x10')](_0x2a5d('0x26'),_0x1b39d9,JSON['stringify'](_0x2482f7));_0x5dc5ea(_0x2482f7);})[_0x2a5d('0x16')](function(_0x4ff3e1){logger['error']('AddTags',_0x4ff3e1[_0x2a5d('0x15')],_0x1b39d9);_0x434bf8(_this['error'](0x1f4,_0x4ff3e1[_0x2a5d('0x15')]));});});}; \ No newline at end of file +var _0x7dc8=['raw','where','attributes','limit','then','ChatInteraction','find','body','ids','omit','info','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','options'];(function(_0x2018ac,_0x522c53){var _0x5f129c=function(_0x264968){while(--_0x264968){_0x2018ac['push'](_0x2018ac['shift']());}};_0x5f129c(++_0x522c53);}(_0x7dc8,0x124));var _0x87dc=function(_0x15ecec,_0x30da66){_0x15ecec=_0x15ecec-0x0;var _0x51e412=_0x7dc8[_0x15ecec];return _0x51e412;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x87dc('0x0'));var BPromise=require(_0x87dc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87dc('0x2'));var db=require(_0x87dc('0x3'))['db'];var utils=require(_0x87dc('0x4'));var logger=require(_0x87dc('0x5'))(_0x87dc('0x6'));var config=require('../../config/environment');var jayson=require(_0x87dc('0x7'));var client=jayson[_0x87dc('0x8')][_0x87dc('0x9')]({'port':0x232a});config[_0x87dc('0xa')]=_[_0x87dc('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x87dc('0xc'))[_0x87dc('0xd')](socket);function respondWithRpcPromise(_0x3698b7,_0x81cbb2,_0x1427b9){return new BPromise(function(_0x59266b,_0x460dc7){return client[_0x87dc('0xe')](_0x3698b7,_0x1427b9)['then'](function(_0xc56765){logger['info'](_0x87dc('0xf'),_0x81cbb2,_0x87dc('0x10'));logger[_0x87dc('0x11')](_0x87dc('0x12'),_0x81cbb2,_0x87dc('0x10'),JSON[_0x87dc('0x13')](_0xc56765));if(_0xc56765[_0x87dc('0x14')]){if(_0xc56765['error'][_0x87dc('0x15')]===0x1f4){logger[_0x87dc('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x81cbb2,_0xc56765[_0x87dc('0x14')][_0x87dc('0x16')]);return _0x460dc7(_0xc56765[_0x87dc('0x14')][_0x87dc('0x16')]);}logger['error'](_0x87dc('0xf'),_0x81cbb2,_0xc56765[_0x87dc('0x14')][_0x87dc('0x16')]);return _0x59266b(_0xc56765['error'][_0x87dc('0x16')]);}else{logger['info'](_0x87dc('0xf'),_0x81cbb2,_0x87dc('0x10'));_0x59266b(_0xc56765[_0x87dc('0x17')][_0x87dc('0x16')]);}})[_0x87dc('0x18')](function(_0xb11847){logger[_0x87dc('0x14')](_0x87dc('0xf'),_0x81cbb2,_0xb11847);_0x460dc7(_0xb11847);});});}exports[_0x87dc('0x19')]=function(_0x5a80af){var _0x37d751=this;return new Promise(function(_0x5aa2ed,_0x108c35){return db['ChatInteraction'][_0x87dc('0x1a')](_0x5a80af['body'],{'raw':_0x5a80af[_0x87dc('0x1b')]?_0x5a80af[_0x87dc('0x1b')][_0x87dc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a80af[_0x87dc('0x1b')]?_0x5a80af['options'][_0x87dc('0x1d')]||null:null,'attributes':_0x5a80af[_0x87dc('0x1b')]?_0x5a80af[_0x87dc('0x1b')][_0x87dc('0x1e')]||null:null,'limit':_0x5a80af[_0x87dc('0x1b')]?_0x5a80af[_0x87dc('0x1b')][_0x87dc('0x1f')]||null:null})[_0x87dc('0x20')](function(_0x14ca9c){logger['info'](_0x87dc('0x19'),_0x5a80af);logger[_0x87dc('0x11')](_0x87dc('0x19'),_0x5a80af,JSON[_0x87dc('0x13')](_0x14ca9c));_0x5aa2ed(_0x14ca9c);})[_0x87dc('0x18')](function(_0x4ea9b2){logger['error'](_0x87dc('0x19'),_0x4ea9b2[_0x87dc('0x16')],_0x5a80af);_0x108c35(_0x37d751[_0x87dc('0x14')](0x1f4,_0x4ea9b2[_0x87dc('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x465508){return new Promise(function(_0x42b762,_0x2c0536){return db[_0x87dc('0x21')][_0x87dc('0x22')]({'where':_0x465508[_0x87dc('0x1b')]?_0x465508[_0x87dc('0x1b')]['where']||null:null})[_0x87dc('0x20')](function(_0x3a8383){if(_0x3a8383){return _0x3a8383['addTags'](_0x465508[_0x87dc('0x23')][_0x87dc('0x24')],_[_0x87dc('0x25')](_0x465508[_0x87dc('0x23')],[_0x87dc('0x24'),'id'])||{});}})['spread'](function(_0x4c1c59){logger[_0x87dc('0x26')]('AddTags',_0x465508);logger['debug']('AddTags',_0x465508,JSON[_0x87dc('0x13')](_0x4c1c59));_0x42b762(_0x4c1c59);})['catch'](function(_0x3f5df6){logger[_0x87dc('0x14')](_0x87dc('0x27'),_0x3f5df6[_0x87dc('0x16')],_0x465508);_0x2c0536(_this['error'](0x1f4,_0x3f5df6[_0x87dc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index bc6babe..6a9eba8 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 _0x5569=['./chatInteraction.events','remove','update','emit','removeListener','register','chatInteraction:'];(function(_0x554f39,_0x29f5a0){var _0x534d56=function(_0x443cd9){while(--_0x443cd9){_0x554f39['push'](_0x554f39['shift']());}};_0x534d56(++_0x29f5a0);}(_0x5569,0x1a4));var _0x9556=function(_0x5ea51f,_0x1e3a5b){_0x5ea51f=_0x5ea51f-0x0;var _0x28f6ab=_0x5569[_0x5ea51f];return _0x28f6ab;};'use strict';var ChatInteractionEvents=require(_0x9556('0x0'));var events=['save',_0x9556('0x1'),_0x9556('0x2')];function createListener(_0x272159,_0x355d45){return function(_0xbf198e){_0x355d45[_0x9556('0x3')](_0x272159,_0xbf198e);};}function removeListener(_0x27e8ed,_0x49de31){return function(){ChatInteractionEvents[_0x9556('0x4')](_0x27e8ed,_0x49de31);};}exports[_0x9556('0x5')]=function(_0x132600){for(var _0x3516d2=0x0,_0x24ecbc=events['length'];_0x3516d2<_0x24ecbc;_0x3516d2++){var _0x4a4760=events[_0x3516d2];var _0x349a08=createListener(_0x9556('0x6')+_0x4a4760,_0x132600);ChatInteractionEvents['on'](_0x4a4760,_0x349a08);}}; \ No newline at end of file +var _0xf0f8=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0xf0f8,0xbb));var _0x8f0f=function(_0x2bf03b,_0x15943c){_0x2bf03b=_0x2bf03b-0x0;var _0xa5e550=_0xf0f8[_0x2bf03b];return _0xa5e550;};'use strict';var ChatInteractionEvents=require(_0x8f0f('0x0'));var events=[_0x8f0f('0x1'),_0x8f0f('0x2'),_0x8f0f('0x3')];function createListener(_0x4bac0b,_0x59e1b4){return function(_0x54917b){_0x59e1b4[_0x8f0f('0x4')](_0x4bac0b,_0x54917b);};}function removeListener(_0x3cb5df,_0x1a2808){return function(){ChatInteractionEvents[_0x8f0f('0x5')](_0x3cb5df,_0x1a2808);};}exports[_0x8f0f('0x6')]=function(_0x179a85){for(var _0x36c7c6=0x0,_0x5b2984=events[_0x8f0f('0x7')];_0x36c7c6<_0x5b2984;_0x36c7c6++){var _0x1690f8=events[_0x36c7c6];var _0x36ddf9=createListener(_0x8f0f('0x8')+_0x1690f8,_0x179a85);ChatInteractionEvents['on'](_0x1690f8,_0x36ddf9);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ef3818c..e4728c2 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 _0xeb2a=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','format','%s-%s','now','originalname','replace','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','removeTags','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeb2a,0x64));var _0xaeb2=function(_0x56d4b4,_0x4ea4bf){_0x56d4b4=_0x56d4b4-0x0;var _0x1b92fd=_0xeb2a[_0x56d4b4];return _0x1b92fd;};'use strict';var multer=require('multer');var util=require(_0xaeb2('0x0'));var path=require(_0xaeb2('0x1'));var timeout=require(_0xaeb2('0x2'));var express=require('express');var router=express[_0xaeb2('0x3')]();var fs_extra=require(_0xaeb2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaeb2('0x5'));var config=require(_0xaeb2('0x6'));var controller=require(_0xaeb2('0x7'));router[_0xaeb2('0x8')]('/',auth[_0xaeb2('0x9')](),controller[_0xaeb2('0xa')]);router[_0xaeb2('0x8')](_0xaeb2('0xb'),auth[_0xaeb2('0x9')](),controller[_0xaeb2('0xc')]);router[_0xaeb2('0x8')](_0xaeb2('0xd'),auth[_0xaeb2('0xe')](),controller['show']);router[_0xaeb2('0x8')](_0xaeb2('0xf'),auth[_0xaeb2('0xe')](),controller[_0xaeb2('0x10')]);router[_0xaeb2('0x8')](_0xaeb2('0x11'),auth[_0xaeb2('0x9')](),controller[_0xaeb2('0x12')]);router[_0xaeb2('0x8')]('/:id/my_messages',auth[_0xaeb2('0xe')](),controller[_0xaeb2('0x13')]);router['get'](_0xaeb2('0x14'),auth[_0xaeb2('0x9')](),controller[_0xaeb2('0x15')]);router[_0xaeb2('0x16')]('/',auth[_0xaeb2('0x9')](),controller[_0xaeb2('0x17')]);router[_0xaeb2('0x16')]('/:id/vidaoo',auth[_0xaeb2('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xaeb2('0x18')]({'destination':function(_0x73d2c3,_0x3cd606,_0x4ad1d9){_0x4ad1d9(null,path[_0xaeb2('0x19')](config[_0xaeb2('0x1a')],'server/files/attachments/'));},'filename':function(_0xba6792,_0x251124,_0x452170){_0x452170(null,util[_0xaeb2('0x1b')](_0xaeb2('0x1c'),Date[_0xaeb2('0x1d')](),_0x251124[_0xaeb2('0x1e')][_0xaeb2('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xaeb2('0x16')]('/:id/attachment_upload',upload['single'](_0xaeb2('0x20')),controller[_0xaeb2('0x21')]);router[_0xaeb2('0x16')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xaeb2('0x16')](_0xaeb2('0x22'),auth[_0xaeb2('0x9')](),interaction[_0xaeb2('0x23')](_0xaeb2('0x24'),_0xaeb2('0x25')),controller[_0xaeb2('0x26')]);router[_0xaeb2('0x27')]('/:id',auth[_0xaeb2('0x9')](),interaction[_0xaeb2('0x23')](_0xaeb2('0x24'),_0xaeb2('0x28')),controller[_0xaeb2('0x29')]);router['put'](_0xaeb2('0x2a'),controller[_0xaeb2('0x2b')]);router[_0xaeb2('0x27')](_0xaeb2('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0xaeb2('0x2d')]);router[_0xaeb2('0x27')]('/:id/close',controller[_0xaeb2('0x2e')]);router[_0xaeb2('0x2f')](_0xaeb2('0xd'),auth[_0xaeb2('0x9')](),interaction['tracked']('chat','chatinteraction:destroy'),controller['destroy']);router[_0xaeb2('0x2f')](_0xaeb2('0x22'),auth['isAuthenticated'](),controller[_0xaeb2('0x30')]);module[_0xaeb2('0x31')]=router; \ No newline at end of file +var _0x45bd=['addTags','put','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','post','create','diskStorage','join','root','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat'];(function(_0x3e1156,_0x1af059){var _0x1aeb9d=function(_0x92b28b){while(--_0x92b28b){_0x3e1156['push'](_0x3e1156['shift']());}};_0x1aeb9d(++_0x1af059);}(_0x45bd,0x1c5));var _0xd45b=function(_0x172b58,_0x115739){_0x172b58=_0x172b58-0x0;var _0x3c16c7=_0x45bd[_0x172b58];return _0x3c16c7;};'use strict';var multer=require(_0xd45b('0x0'));var util=require(_0xd45b('0x1'));var path=require(_0xd45b('0x2'));var timeout=require(_0xd45b('0x3'));var express=require(_0xd45b('0x4'));var router=express['Router']();var fs_extra=require(_0xd45b('0x5'));var auth=require(_0xd45b('0x6'));var interaction=require(_0xd45b('0x7'));var config=require(_0xd45b('0x8'));var controller=require(_0xd45b('0x9'));router[_0xd45b('0xa')]('/',auth[_0xd45b('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd45b('0xc')]);router[_0xd45b('0xa')](_0xd45b('0xd'),auth[_0xd45b('0xe')](),controller[_0xd45b('0xf')]);router[_0xd45b('0xa')](_0xd45b('0x10'),auth[_0xd45b('0xe')](),controller[_0xd45b('0x11')]);router[_0xd45b('0xa')](_0xd45b('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd45b('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xd45b('0x13')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xd45b('0x14')]);router[_0xd45b('0x15')]('/',auth['isAuthenticated'](),controller[_0xd45b('0x16')]);router['post']('/:id/vidaoo',auth[_0xd45b('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd45b('0x17')]({'destination':function(_0x134cf9,_0x632fe0,_0x1fbf5c){_0x1fbf5c(null,path[_0xd45b('0x18')](config[_0xd45b('0x19')],'server/files/attachments/'));},'filename':function(_0x1683ff,_0x1a6458,_0x37dc94){_0x37dc94(null,util[_0xd45b('0x1a')]('%s-%s',Date[_0xd45b('0x1b')](),_0x1a6458[_0xd45b('0x1c')][_0xd45b('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd45b('0x15')](_0xd45b('0x1e'),upload['single'](_0xd45b('0x1f')),controller[_0xd45b('0x20')]);router[_0xd45b('0x15')](_0xd45b('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xd45b('0x21')]);router['post'](_0xd45b('0x22'),auth['isAuthenticated'](),interaction[_0xd45b('0x23')](_0xd45b('0x24'),'chatinteraction:addtags'),controller[_0xd45b('0x25')]);router[_0xd45b('0x26')](_0xd45b('0xd'),auth[_0xd45b('0xb')](),interaction[_0xd45b('0x23')](_0xd45b('0x24'),'chatinteraction:update'),controller[_0xd45b('0x27')]);router['put'](_0xd45b('0x28'),controller[_0xd45b('0x29')]);router[_0xd45b('0x26')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xd45b('0x2a')]);router[_0xd45b('0x26')](_0xd45b('0x2b'),controller[_0xd45b('0x2c')]);router[_0xd45b('0x2d')](_0xd45b('0xd'),auth['isAuthenticated'](),interaction[_0xd45b('0x23')](_0xd45b('0x24'),_0xd45b('0x2e')),controller[_0xd45b('0x2f')]);router[_0xd45b('0x2d')](_0xd45b('0x22'),auth[_0xd45b('0xb')](),controller[_0xd45b('0x30')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 45fa590..b0fb5d1 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 _0x3ba9=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x50c816,_0x10798d){var _0x1ff102=function(_0x10aed6){while(--_0x10aed6){_0x50c816['push'](_0x50c816['shift']());}};_0x1ff102(++_0x10798d);}(_0x3ba9,0x1ef));var _0x93ba=function(_0x1c2e22,_0x4c784d){_0x1c2e22=_0x1c2e22-0x0;var _0x55d667=_0x3ba9[_0x1c2e22];return _0x55d667;};'use strict';var Sequelize=require('sequelize');module[_0x93ba('0x0')]={'body':{'type':Sequelize[_0x93ba('0x1')](_0x93ba('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x93ba('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x93ba('0x4')]}}; \ No newline at end of file +var _0xda5d=['BOOLEAN','INTEGER','sequelize'];(function(_0x116d13,_0x135954){var _0xc26afc=function(_0x2ca0c7){while(--_0x2ca0c7){_0x116d13['push'](_0x116d13['shift']());}};_0xc26afc(++_0x135954);}(_0xda5d,0x104));var _0xdda5=function(_0xc1a4d,_0x22787e){_0xc1a4d=_0xc1a4d-0x0;var _0xb21ee8=_0xda5d[_0xc1a4d];return _0xb21ee8;};'use strict';var Sequelize=require(_0xdda5('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xdda5('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda5('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b121546..7cc5949 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 _0xb26f=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','include','findAll','catch','show','params','fields','length','includeAll','create','body','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','user','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','role','agent','resourceId','push','FromId','ToId','read','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','update','then','destroy','error','name','send','map','ChatInternalMessage'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0xb26f,0x11a));var _0xfb26=function(_0x2300fa,_0x41c382){_0x2300fa=_0x2300fa-0x0;var _0x11fef0=_0xb26f[_0x2300fa];return _0x11fef0;};'use strict';var emlformat=require(_0xfb26('0x0'));var rimraf=require(_0xfb26('0x1'));var zipdir=require(_0xfb26('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb26('0x3'));var moment=require(_0xfb26('0x4'));var BPromise=require(_0xfb26('0x5'));var Mustache=require(_0xfb26('0x6'));var util=require(_0xfb26('0x7'));var path=require(_0xfb26('0x8'));var sox=require(_0xfb26('0x9'));var csv=require(_0xfb26('0xa'));var ejs=require(_0xfb26('0xb'));var fs=require('fs');var fs_extra=require(_0xfb26('0xc'));var _=require(_0xfb26('0xd'));var squel=require(_0xfb26('0xe'));var crypto=require(_0xfb26('0xf'));var jsforce=require(_0xfb26('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfb26('0x11'));var Papa=require('papaparse');var Redis=require(_0xfb26('0x12'));var authService=require(_0xfb26('0x13'));var qs=require(_0xfb26('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb26('0x15'));var logger=require(_0xfb26('0x16'))(_0xfb26('0x17'));var utils=require(_0xfb26('0x18'));var config=require(_0xfb26('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfb26('0x1a')]=_['defaults'](config[_0xfb26('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb26('0x1b'))(new Redis(config['redis']));require(_0xfb26('0x1c'))[_0xfb26('0x1d')](socket);function respondWithStatusCode(_0x24271b,_0x3af77c){_0x3af77c=_0x3af77c||0xcc;return function(_0x4c7a34){if(_0x4c7a34){return _0x24271b[_0xfb26('0x1e')](_0x3af77c);}return _0x24271b[_0xfb26('0x1f')](_0x3af77c)[_0xfb26('0x20')]();};}function respondWithResult(_0x3b196b,_0x3689b6){_0x3689b6=_0x3689b6||0xc8;return function(_0x253e5d){if(_0x253e5d){return _0x3b196b['status'](_0x3689b6)['json'](_0x253e5d);}};}function respondWithFilteredResult(_0x55b2f3,_0xe50550){return function(_0xa94a3e){if(_0xa94a3e){var _0x48ec67=typeof _0xe50550[_0xfb26('0x21')]===_0xfb26('0x22')&&typeof _0xe50550[_0xfb26('0x23')]===_0xfb26('0x22');var _0x521c80=_0xa94a3e['count'];var _0x1d72ea=_0x48ec67?0x0:_0xe50550['offset'];var _0x4791f9=_0x48ec67?_0xa94a3e['count']:_0xe50550[_0xfb26('0x21')]+_0xe50550[_0xfb26('0x23')];var _0x459d50;if(_0x4791f9>=_0x521c80){_0x4791f9=_0x521c80;_0x459d50=0xc8;}else{_0x459d50=0xce;}_0x55b2f3[_0xfb26('0x1f')](_0x459d50);return _0x55b2f3['set'](_0xfb26('0x24'),_0x1d72ea+'-'+_0x4791f9+'/'+_0x521c80)[_0xfb26('0x25')](_0xa94a3e);}return null;};}function patchUpdates(_0x28f216){return function(_0xa69872){try{jsonpatch[_0xfb26('0x26')](_0xa69872,_0x28f216,!![]);}catch(_0xb86d){return BPromise[_0xfb26('0x27')](_0xb86d);}return _0xa69872['save']();};}function saveUpdates(_0x392959,_0x30f7fd){return function(_0x51671f){if(_0x51671f){return _0x51671f[_0xfb26('0x28')](_0x392959)[_0xfb26('0x29')](function(_0x492b8d){return _0x492b8d;});}return null;};}function removeEntity(_0x5319e7,_0x3c59ca){return function(_0x3faf24){if(_0x3faf24){return _0x3faf24[_0xfb26('0x2a')]()[_0xfb26('0x29')](function(){_0x5319e7[_0xfb26('0x1f')](0xcc)[_0xfb26('0x20')]();});}};}function handleEntityNotFound(_0x4ff72e,_0x5f37d1){return function(_0x4e3b24){if(!_0x4e3b24){_0x4ff72e[_0xfb26('0x1e')](0x194);}return _0x4e3b24;};}function handleError(_0x17a2b6,_0x1d01f5){_0x1d01f5=_0x1d01f5||0x1f4;return function(_0x5afe3c){logger[_0xfb26('0x2b')](_0x5afe3c['stack']);if(_0x5afe3c[_0xfb26('0x2c')]){delete _0x5afe3c[_0xfb26('0x2c')];}_0x17a2b6[_0xfb26('0x1f')](_0x1d01f5)[_0xfb26('0x2d')](_0x5afe3c);};}exports['index']=function(_0x371204,_0x41f662){var _0x2f1ced={},_0x167772={},_0x410991={'count':0x0,'rows':[]};var _0xae4a05=_[_0xfb26('0x2e')](db[_0xfb26('0x2f')][_0xfb26('0x30')],function(_0x2d4a0b){return{'name':_0x2d4a0b[_0xfb26('0x31')],'type':_0x2d4a0b[_0xfb26('0x32')][_0xfb26('0x33')]};});_0x167772[_0xfb26('0x34')]=_['map'](_0xae4a05,_0xfb26('0x2c'));_0x167772[_0xfb26('0x35')]=_[_0xfb26('0x36')](_0x371204['query']);_0x167772['filters']=_[_0xfb26('0x37')](_0x167772[_0xfb26('0x34')],_0x167772[_0xfb26('0x35')]);_0x2f1ced['attributes']=_[_0xfb26('0x37')](_0x167772[_0xfb26('0x34')],qs['fields'](_0x371204['query']['fields']));_0x2f1ced[_0xfb26('0x38')]=_0x2f1ced[_0xfb26('0x38')]['length']?_0x2f1ced[_0xfb26('0x38')]:_0x167772[_0xfb26('0x34')];if(!_0x371204[_0xfb26('0x35')][_0xfb26('0x39')](_0xfb26('0x3a'))){_0x2f1ced[_0xfb26('0x23')]=qs[_0xfb26('0x23')](_0x371204['query'][_0xfb26('0x23')]);_0x2f1ced[_0xfb26('0x21')]=qs[_0xfb26('0x21')](_0x371204[_0xfb26('0x35')][_0xfb26('0x21')]);}_0x2f1ced[_0xfb26('0x3b')]=qs[_0xfb26('0x3c')](_0x371204[_0xfb26('0x35')][_0xfb26('0x3c')]);_0x2f1ced[_0xfb26('0x3d')]=qs[_0xfb26('0x3e')](_[_0xfb26('0x3f')](_0x371204[_0xfb26('0x35')],_0x167772[_0xfb26('0x3e')]),_0xae4a05);if(_0x371204[_0xfb26('0x35')][_0xfb26('0x40')]){_0x2f1ced['where']=_['merge'](_0x2f1ced[_0xfb26('0x3d')],{'$or':_['map'](_0xae4a05,function(_0x4d311c){if(_0x4d311c[_0xfb26('0x32')]!==_0xfb26('0x41')){var _0x199179={};_0x199179[_0x4d311c[_0xfb26('0x2c')]]={'$like':'%'+_0x371204[_0xfb26('0x35')][_0xfb26('0x40')]+'%'};return _0x199179;}})});}_0x2f1ced=_[_0xfb26('0x42')]({},_0x2f1ced,_0x371204[_0xfb26('0x43')]);var _0x2a05e7={'where':_0x2f1ced[_0xfb26('0x3d')]};return db[_0xfb26('0x2f')][_0xfb26('0x44')](_0x2a05e7)[_0xfb26('0x29')](function(_0x40b396){_0x410991[_0xfb26('0x44')]=_0x40b396;if(_0x371204[_0xfb26('0x35')]['includeAll']){_0x2f1ced[_0xfb26('0x45')]=[{'all':!![]}];}return db[_0xfb26('0x2f')][_0xfb26('0x46')](_0x2f1ced);})['then'](function(_0x3ab805){_0x410991['rows']=_0x3ab805;return _0x410991;})[_0xfb26('0x29')](respondWithFilteredResult(_0x41f662,_0x2f1ced))[_0xfb26('0x47')](handleError(_0x41f662,null));};exports[_0xfb26('0x48')]=function(_0x341082,_0x440328){var _0x2885ba={'raw':!![],'where':{'id':_0x341082[_0xfb26('0x49')]['id']}},_0x310bff={};_0x310bff[_0xfb26('0x34')]=_[_0xfb26('0x36')](db[_0xfb26('0x2f')]['rawAttributes']);_0x310bff[_0xfb26('0x35')]=_[_0xfb26('0x36')](_0x341082[_0xfb26('0x35')]);_0x310bff[_0xfb26('0x3e')]=_[_0xfb26('0x37')](_0x310bff['model'],_0x310bff[_0xfb26('0x35')]);_0x2885ba[_0xfb26('0x38')]=_[_0xfb26('0x37')](_0x310bff[_0xfb26('0x34')],qs[_0xfb26('0x4a')](_0x341082[_0xfb26('0x35')][_0xfb26('0x4a')]));_0x2885ba[_0xfb26('0x38')]=_0x2885ba[_0xfb26('0x38')][_0xfb26('0x4b')]?_0x2885ba[_0xfb26('0x38')]:_0x310bff[_0xfb26('0x34')];if(_0x341082[_0xfb26('0x35')][_0xfb26('0x4c')]){_0x2885ba['include']=[{'all':!![]}];}_0x2885ba=_[_0xfb26('0x42')]({},_0x2885ba,_0x341082[_0xfb26('0x43')]);return db[_0xfb26('0x2f')]['find'](_0x2885ba)[_0xfb26('0x29')](handleEntityNotFound(_0x440328,null))[_0xfb26('0x29')](respondWithResult(_0x440328,null))[_0xfb26('0x47')](handleError(_0x440328,null));};exports[_0xfb26('0x4d')]=function(_0x4b8a66,_0x314e13){return db[_0xfb26('0x2f')][_0xfb26('0x4d')](_0x4b8a66['body'],{})[_0xfb26('0x29')](respondWithResult(_0x314e13,0xc9))[_0xfb26('0x47')](handleError(_0x314e13,null));};exports['update']=function(_0x8fa3a8,_0x26c04e){if(_0x8fa3a8[_0xfb26('0x4e')]['id']){delete _0x8fa3a8['body']['id'];}return db[_0xfb26('0x2f')]['find']({'where':{'id':_0x8fa3a8[_0xfb26('0x49')]['id']}})[_0xfb26('0x29')](handleEntityNotFound(_0x26c04e,null))[_0xfb26('0x29')](saveUpdates(_0x8fa3a8[_0xfb26('0x4e')],null))[_0xfb26('0x29')](respondWithResult(_0x26c04e,null))[_0xfb26('0x47')](handleError(_0x26c04e,null));};exports[_0xfb26('0x2a')]=function(_0x38a799,_0x126da0){return db[_0xfb26('0x2f')]['find']({'where':{'id':_0x38a799['params']['id']}})[_0xfb26('0x29')](handleEntityNotFound(_0x126da0,null))[_0xfb26('0x29')](removeEntity(_0x126da0,null))[_0xfb26('0x47')](handleError(_0x126da0,null));};exports[_0xfb26('0x4f')]=function(_0x470631,_0xd8358d){return db[_0xfb26('0x2f')][_0xfb26('0x4f')]()[_0xfb26('0x29')](respondWithResult(_0xd8358d,null))[_0xfb26('0x47')](handleError(_0xd8358d,null));};function wrapUser(_0x33e32f){return function(_0x45e611){var _0x2069bd=_0x33e32f['get']({'plain':!![]});_0x2069bd[_0xfb26('0x50')]=[];if(_0x45e611){_0x2069bd[_0xfb26('0x51')]=_0x45e611[_0xfb26('0x52')];_0x2069bd['lastMessage']=_0x45e611;}else{_0x2069bd[_0xfb26('0x51')]=moment(0x0)['format'](_0xfb26('0x53'));_0x2069bd[_0xfb26('0x54')]={};}return _0x2069bd;};}exports['getUsers']=function(_0x554e65,_0x5e888b,_0x2081a8){var _0x493992=[];return db[_0xfb26('0x55')][_0xfb26('0x46')]({'where':{'role':['agent','admin',_0xfb26('0x56')]},'attributes':['id','fullname',_0xfb26('0x2c'),'role',_0xfb26('0x57'),_0xfb26('0x58'),_0xfb26('0x59'),_0xfb26('0x5a'),_0xfb26('0x5b'),_0xfb26('0x5c')],'order':qs['sort'](_0xfb26('0x5d')),'include':[{'model':db[_0xfb26('0x5e')],'as':_0xfb26('0x5f'),'attributes':['id',_0xfb26('0x2c'),'type'],'through':{'attributes':[]}}]})[_0xfb26('0x29')](function(_0x11638c){if(_0x11638c){var _0x59f1a7=_0x554e65[_0xfb26('0x56')][_0xfb26('0x60')]({'plain':!![]});if(!_0x59f1a7)throw new Error(_0xfb26('0x61'));if(_0x59f1a7['role']===_0xfb26('0x56')){return db[_0xfb26('0x62')][_0xfb26('0x63')]({'where':{'name':'Agents','userProfileId':_0x59f1a7[_0xfb26('0x64')]},'raw':!![]})[_0xfb26('0x29')](function(_0x31e42a){if(_0x31e42a){if(_0x31e42a[_0xfb26('0x65')]===0x0){return db[_0xfb26('0x66')][_0xfb26('0x46')]({'where':{'sectionId':_0x31e42a['id']},'raw':!![]})[_0xfb26('0x29')](function(_0x2ad85c){var _0x4973e9=[];if(_['isEmpty'](_0x2ad85c)){_0x4973e9=_[_0xfb26('0x40')](_0x11638c,function(_0x490641){if(_0x490641[_0xfb26('0x67')]!==_0xfb26('0x68')){return _0x490641;}});return _0x4973e9;}else{for(var _0x25b902=0x0;_0x25b902<_0x11638c[_0xfb26('0x4b')];_0x25b902++){var _0x5c8a2f=_0x11638c[_0x25b902];if(_0x5c8a2f[_0xfb26('0x67')]===_0xfb26('0x68')){var _0x3378dd=_[_0xfb26('0x63')](_0x2ad85c,function(_0x6f4a08){return _0x6f4a08[_0xfb26('0x69')]===_0x5c8a2f['id'];});if(_0x3378dd)_0x4973e9[_0xfb26('0x6a')](_0x5c8a2f);}else{_0x4973e9['push'](_0x5c8a2f);}}return _0x4973e9;}});}else{return _0x11638c;}}else{var _0x5391ee=_[_0xfb26('0x40')](_0x11638c,function(_0xca61a6){if(_0xca61a6[_0xfb26('0x67')]!==_0xfb26('0x68')){return _0xca61a6;}});return _0x5391ee;}});}else{return _0x11638c;}}})[_0xfb26('0x29')](function(_0xa32edd){var _0x57ad12=[];if(_0xa32edd){_0x493992=_0xa32edd;for(var _0x2df0e8=0x0;_0x2df0e8<_0xa32edd[_0xfb26('0x4b')];_0x2df0e8+=0x1){_0x493992[_0x2df0e8][_0xfb26('0x50')]=[];_0x57ad12[_0xfb26('0x6a')](db[_0xfb26('0x2f')]['find']({'where':{'FromId':[_0x554e65[_0xfb26('0x56')]['id'],_0xa32edd[_0x2df0e8]['id']],'ToId':[_0x554e65['user']['id'],_0xa32edd[_0x2df0e8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xfb26('0x6b'),_0xfb26('0x6c'),_0xfb26('0x6d'),_0xfb26('0x4e')],'order':qs[_0xfb26('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfb26('0x29')](wrapUser(_0xa32edd[_0x2df0e8])));}return BPromise['all'](_0x57ad12);}return[];})['then'](function(_0x42d475){return{'rows':_0x42d475,'count':_0x42d475[_0xfb26('0x4b')]};})['then'](respondWithResult(_0x5e888b,null))[_0xfb26('0x47')](handleError(_0x5e888b,null));}; \ No newline at end of file +var _0x41f1=['get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','FromId','all','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','params','intersection','length','find','create','body','describe'];(function(_0x4c315a,_0x187fc3){var _0x2310d8=function(_0x35006d){while(--_0x35006d){_0x4c315a['push'](_0x4c315a['shift']());}};_0x2310d8(++_0x187fc3);}(_0x41f1,0x1c6));var _0x141f=function(_0x5ec21d,_0x5d0772){_0x5ec21d=_0x5ec21d-0x0;var _0x43bde8=_0x41f1[_0x5ec21d];return _0x43bde8;};'use strict';var emlformat=require(_0x141f('0x0'));var rimraf=require(_0x141f('0x1'));var zipdir=require(_0x141f('0x2'));var jsonpatch=require(_0x141f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x141f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x141f('0x5'));var sox=require(_0x141f('0x6'));var csv=require(_0x141f('0x7'));var ejs=require(_0x141f('0x8'));var fs=require('fs');var fs_extra=require(_0x141f('0x9'));var _=require(_0x141f('0xa'));var squel=require('squel');var crypto=require(_0x141f('0xb'));var jsforce=require(_0x141f('0xc'));var deskjs=require(_0x141f('0xd'));var toCsv=require(_0x141f('0x7'));var querystring=require(_0x141f('0xe'));var Papa=require(_0x141f('0xf'));var Redis=require('ioredis');var authService=require(_0x141f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x141f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x141f('0x12'))(_0x141f('0x13'));var utils=require(_0x141f('0x14'));var config=require(_0x141f('0x15'));var licenseUtil=require(_0x141f('0x16'));var db=require(_0x141f('0x17'))['db'];config['redis']=_['defaults'](config[_0x141f('0x18')],{'host':_0x141f('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x141f('0x1a')](socket);function respondWithStatusCode(_0x2edc3a,_0x2b4f38){_0x2b4f38=_0x2b4f38||0xcc;return function(_0x7444f2){if(_0x7444f2){return _0x2edc3a[_0x141f('0x1b')](_0x2b4f38);}return _0x2edc3a[_0x141f('0x1c')](_0x2b4f38)[_0x141f('0x1d')]();};}function respondWithResult(_0x18c466,_0x3c95e9){_0x3c95e9=_0x3c95e9||0xc8;return function(_0xc5b3b8){if(_0xc5b3b8){return _0x18c466[_0x141f('0x1c')](_0x3c95e9)[_0x141f('0x1e')](_0xc5b3b8);}};}function respondWithFilteredResult(_0x49ffe5,_0x2d128a){return function(_0x47da64){if(_0x47da64){var _0x4eb35f=typeof _0x2d128a[_0x141f('0x1f')]===_0x141f('0x20')&&typeof _0x2d128a[_0x141f('0x21')]===_0x141f('0x20');var _0x3ae9cd=_0x47da64[_0x141f('0x22')];var _0xc39be0=_0x4eb35f?0x0:_0x2d128a[_0x141f('0x1f')];var _0x1723f3=_0x4eb35f?_0x47da64[_0x141f('0x22')]:_0x2d128a[_0x141f('0x1f')]+_0x2d128a['limit'];var _0x2942ba;if(_0x1723f3>=_0x3ae9cd){_0x1723f3=_0x3ae9cd;_0x2942ba=0xc8;}else{_0x2942ba=0xce;}_0x49ffe5[_0x141f('0x1c')](_0x2942ba);return _0x49ffe5[_0x141f('0x23')]('Content-Range',_0xc39be0+'-'+_0x1723f3+'/'+_0x3ae9cd)[_0x141f('0x1e')](_0x47da64);}return null;};}function patchUpdates(_0x6f493f){return function(_0x2d5412){try{jsonpatch[_0x141f('0x24')](_0x2d5412,_0x6f493f,!![]);}catch(_0x48cda3){return BPromise[_0x141f('0x25')](_0x48cda3);}return _0x2d5412['save']();};}function saveUpdates(_0x3bc57c,_0x33c0a7){return function(_0x4ec474){if(_0x4ec474){return _0x4ec474[_0x141f('0x26')](_0x3bc57c)[_0x141f('0x27')](function(_0x1375eb){return _0x1375eb;});}return null;};}function removeEntity(_0x628acf,_0x41e108){return function(_0x1f7d98){if(_0x1f7d98){return _0x1f7d98[_0x141f('0x28')]()[_0x141f('0x27')](function(){_0x628acf[_0x141f('0x1c')](0xcc)[_0x141f('0x1d')]();});}};}function handleEntityNotFound(_0x331989,_0x5ba404){return function(_0x539c20){if(!_0x539c20){_0x331989['sendStatus'](0x194);}return _0x539c20;};}function handleError(_0x512b8b,_0x12f88c){_0x12f88c=_0x12f88c||0x1f4;return function(_0x57e021){logger['error'](_0x57e021[_0x141f('0x29')]);if(_0x57e021[_0x141f('0x2a')]){delete _0x57e021[_0x141f('0x2a')];}_0x512b8b[_0x141f('0x1c')](_0x12f88c)[_0x141f('0x2b')](_0x57e021);};}exports['index']=function(_0x354b14,_0x3a582d){var _0x415afc={},_0x575533={},_0x3d7c79={'count':0x0,'rows':[]};var _0x408fdf=_[_0x141f('0x2c')](db['ChatInternalMessage'][_0x141f('0x2d')],function(_0x380b21){return{'name':_0x380b21[_0x141f('0x2e')],'type':_0x380b21[_0x141f('0x2f')]['key']};});_0x575533[_0x141f('0x30')]=_[_0x141f('0x2c')](_0x408fdf,'name');_0x575533[_0x141f('0x31')]=_[_0x141f('0x32')](_0x354b14[_0x141f('0x31')]);_0x575533[_0x141f('0x33')]=_['intersection'](_0x575533[_0x141f('0x30')],_0x575533['query']);_0x415afc[_0x141f('0x34')]=_['intersection'](_0x575533['model'],qs[_0x141f('0x35')](_0x354b14['query'][_0x141f('0x35')]));_0x415afc['attributes']=_0x415afc[_0x141f('0x34')]['length']?_0x415afc[_0x141f('0x34')]:_0x575533[_0x141f('0x30')];if(!_0x354b14['query'][_0x141f('0x36')]('nolimit')){_0x415afc[_0x141f('0x21')]=qs[_0x141f('0x21')](_0x354b14[_0x141f('0x31')][_0x141f('0x21')]);_0x415afc[_0x141f('0x1f')]=qs['offset'](_0x354b14[_0x141f('0x31')]['offset']);}_0x415afc[_0x141f('0x37')]=qs[_0x141f('0x38')](_0x354b14[_0x141f('0x31')][_0x141f('0x38')]);_0x415afc[_0x141f('0x39')]=qs[_0x141f('0x33')](_[_0x141f('0x3a')](_0x354b14[_0x141f('0x31')],_0x575533[_0x141f('0x33')]),_0x408fdf);if(_0x354b14[_0x141f('0x31')][_0x141f('0x3b')]){_0x415afc['where']=_[_0x141f('0x3c')](_0x415afc[_0x141f('0x39')],{'$or':_['map'](_0x408fdf,function(_0x382608){if(_0x382608['type']!==_0x141f('0x3d')){var _0x3c27b7={};_0x3c27b7[_0x382608[_0x141f('0x2a')]]={'$like':'%'+_0x354b14[_0x141f('0x31')][_0x141f('0x3b')]+'%'};return _0x3c27b7;}})});}_0x415afc=_[_0x141f('0x3c')]({},_0x415afc,_0x354b14[_0x141f('0x3e')]);var _0x61968b={'where':_0x415afc[_0x141f('0x39')]};return db[_0x141f('0x3f')]['count'](_0x61968b)[_0x141f('0x27')](function(_0xe5cef8){_0x3d7c79[_0x141f('0x22')]=_0xe5cef8;if(_0x354b14[_0x141f('0x31')][_0x141f('0x40')]){_0x415afc[_0x141f('0x41')]=[{'all':!![]}];}return db[_0x141f('0x3f')][_0x141f('0x42')](_0x415afc);})['then'](function(_0x36f6b4){_0x3d7c79[_0x141f('0x43')]=_0x36f6b4;return _0x3d7c79;})[_0x141f('0x27')](respondWithFilteredResult(_0x3a582d,_0x415afc))[_0x141f('0x44')](handleError(_0x3a582d,null));};exports['show']=function(_0x5d5ad7,_0x462b4d){var _0x27fa01={'raw':!![],'where':{'id':_0x5d5ad7[_0x141f('0x45')]['id']}},_0x15cbef={};_0x15cbef[_0x141f('0x30')]=_[_0x141f('0x32')](db['ChatInternalMessage'][_0x141f('0x2d')]);_0x15cbef[_0x141f('0x31')]=_[_0x141f('0x32')](_0x5d5ad7[_0x141f('0x31')]);_0x15cbef['filters']=_[_0x141f('0x46')](_0x15cbef[_0x141f('0x30')],_0x15cbef[_0x141f('0x31')]);_0x27fa01[_0x141f('0x34')]=_[_0x141f('0x46')](_0x15cbef['model'],qs[_0x141f('0x35')](_0x5d5ad7['query'][_0x141f('0x35')]));_0x27fa01['attributes']=_0x27fa01[_0x141f('0x34')][_0x141f('0x47')]?_0x27fa01[_0x141f('0x34')]:_0x15cbef[_0x141f('0x30')];if(_0x5d5ad7[_0x141f('0x31')][_0x141f('0x40')]){_0x27fa01[_0x141f('0x41')]=[{'all':!![]}];}_0x27fa01=_['merge']({},_0x27fa01,_0x5d5ad7['options']);return db['ChatInternalMessage'][_0x141f('0x48')](_0x27fa01)[_0x141f('0x27')](handleEntityNotFound(_0x462b4d,null))[_0x141f('0x27')](respondWithResult(_0x462b4d,null))['catch'](handleError(_0x462b4d,null));};exports[_0x141f('0x49')]=function(_0x4a6b8b,_0x2c27bf){return db[_0x141f('0x3f')][_0x141f('0x49')](_0x4a6b8b[_0x141f('0x4a')],{})[_0x141f('0x27')](respondWithResult(_0x2c27bf,0xc9))['catch'](handleError(_0x2c27bf,null));};exports['update']=function(_0x104074,_0x2c4d5c){if(_0x104074['body']['id']){delete _0x104074[_0x141f('0x4a')]['id'];}return db[_0x141f('0x3f')][_0x141f('0x48')]({'where':{'id':_0x104074[_0x141f('0x45')]['id']}})[_0x141f('0x27')](handleEntityNotFound(_0x2c4d5c,null))[_0x141f('0x27')](saveUpdates(_0x104074['body'],null))[_0x141f('0x27')](respondWithResult(_0x2c4d5c,null))[_0x141f('0x44')](handleError(_0x2c4d5c,null));};exports[_0x141f('0x28')]=function(_0x3fe86e,_0x19d1ef){return db['ChatInternalMessage'][_0x141f('0x48')]({'where':{'id':_0x3fe86e['params']['id']}})[_0x141f('0x27')](handleEntityNotFound(_0x19d1ef,null))[_0x141f('0x27')](removeEntity(_0x19d1ef,null))[_0x141f('0x44')](handleError(_0x19d1ef,null));};exports[_0x141f('0x4b')]=function(_0x1881f9,_0x14da40){return db[_0x141f('0x3f')][_0x141f('0x4b')]()['then'](respondWithResult(_0x14da40,null))['catch'](handleError(_0x14da40,null));};function wrapUser(_0x5a0111){return function(_0x1cd562){var _0x58b508=_0x5a0111[_0x141f('0x4c')]({'plain':!![]});_0x58b508[_0x141f('0x4d')]=[];if(_0x1cd562){_0x58b508[_0x141f('0x4e')]=_0x1cd562['createdAt'];_0x58b508[_0x141f('0x4f')]=_0x1cd562;}else{_0x58b508[_0x141f('0x4e')]=moment(0x0)[_0x141f('0x50')](_0x141f('0x51'));_0x58b508[_0x141f('0x4f')]={};}return _0x58b508;};}exports['getUsers']=function(_0x25b818,_0x2a3d7b,_0xb96032){var _0x31e713=[];return db['User']['findAll']({'where':{'role':[_0x141f('0x52'),_0x141f('0x53'),_0x141f('0x54')]},'attributes':['id',_0x141f('0x55'),'name',_0x141f('0x56'),_0x141f('0x57'),_0x141f('0x58'),_0x141f('0x59'),_0x141f('0x5a'),_0x141f('0x5b'),_0x141f('0x5c')],'order':qs['sort']('-online'),'include':[{'model':db[_0x141f('0x5d')],'as':_0x141f('0x5e'),'attributes':['id','name',_0x141f('0x2f')],'through':{'attributes':[]}}]})[_0x141f('0x27')](function(_0x5616c2){if(_0x5616c2){var _0x466a46=_0x25b818[_0x141f('0x54')][_0x141f('0x4c')]({'plain':!![]});if(!_0x466a46)throw new Error(_0x141f('0x5f'));if(_0x466a46[_0x141f('0x56')]===_0x141f('0x54')){return db[_0x141f('0x60')][_0x141f('0x48')]({'where':{'name':_0x141f('0x61'),'userProfileId':_0x466a46[_0x141f('0x62')]},'raw':!![]})[_0x141f('0x27')](function(_0x48f55d){if(_0x48f55d){if(_0x48f55d[_0x141f('0x63')]===0x0){return db[_0x141f('0x64')][_0x141f('0x42')]({'where':{'sectionId':_0x48f55d['id']},'raw':!![]})[_0x141f('0x27')](function(_0x20c141){var _0x25e381=[];if(_['isEmpty'](_0x20c141)){_0x25e381=_[_0x141f('0x3b')](_0x5616c2,function(_0x7b8839){if(_0x7b8839[_0x141f('0x56')]!=='agent'){return _0x7b8839;}});return _0x25e381;}else{for(var _0x3a0bba=0x0;_0x3a0bba<_0x5616c2['length'];_0x3a0bba++){var _0x12ecc3=_0x5616c2[_0x3a0bba];if(_0x12ecc3[_0x141f('0x56')]===_0x141f('0x52')){var _0x346260=_[_0x141f('0x48')](_0x20c141,function(_0x3f2f6c){return _0x3f2f6c[_0x141f('0x65')]===_0x12ecc3['id'];});if(_0x346260)_0x25e381[_0x141f('0x66')](_0x12ecc3);}else{_0x25e381['push'](_0x12ecc3);}}return _0x25e381;}});}else{return _0x5616c2;}}else{var _0x5446de=_[_0x141f('0x3b')](_0x5616c2,function(_0x1eedf0){if(_0x1eedf0[_0x141f('0x56')]!==_0x141f('0x52')){return _0x1eedf0;}});return _0x5446de;}});}else{return _0x5616c2;}}})[_0x141f('0x27')](function(_0x349094){var _0x527c07=[];if(_0x349094){_0x31e713=_0x349094;for(var _0x582315=0x0;_0x582315<_0x349094[_0x141f('0x47')];_0x582315+=0x1){_0x31e713[_0x582315][_0x141f('0x4d')]=[];_0x527c07[_0x141f('0x66')](db[_0x141f('0x3f')][_0x141f('0x48')]({'where':{'FromId':[_0x25b818[_0x141f('0x54')]['id'],_0x349094[_0x582315]['id']],'ToId':[_0x25b818['user']['id'],_0x349094[_0x582315]['id']],'ChatGroupId':null},'attributes':['id',_0x141f('0x67'),_0x141f('0x68'),'ToId','read',_0x141f('0x4a')],'order':qs[_0x141f('0x38')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x141f('0x27')](wrapUser(_0x349094[_0x582315])));}return BPromise[_0x141f('0x69')](_0x527c07);}return[];})['then'](function(_0x9ca31e){return{'rows':_0x9ca31e,'count':_0x9ca31e[_0x141f('0x47')]};})['then'](respondWithResult(_0x2a3d7b,null))['catch'](handleError(_0x2a3d7b,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2c7c2d0..76bd6cc 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 _0xcb49=['setMaxListeners','save','update','remove','emit','hook','events','ChatInternalMessage'];(function(_0x17615e,_0x483a49){var _0xa4c97e=function(_0x24ecf7){while(--_0x24ecf7){_0x17615e['push'](_0x17615e['shift']());}};_0xa4c97e(++_0x483a49);}(_0xcb49,0x156));var _0x9cb4=function(_0x4d82e1,_0x5ac72b){_0x4d82e1=_0x4d82e1-0x0;var _0x5f3bd9=_0xcb49[_0x4d82e1];return _0x5f3bd9;};'use strict';var EventEmitter=require(_0x9cb4('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x9cb4('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9cb4('0x2')](0x0);var events={'afterCreate':_0x9cb4('0x3'),'afterUpdate':_0x9cb4('0x4'),'afterDestroy':_0x9cb4('0x5')};function emitEvent(_0x3bb409){return function(_0x4a8453,_0x55478d,_0x51717a){ChatInternalMessageEvents[_0x9cb4('0x6')](_0x3bb409+':'+_0x4a8453['id'],_0x4a8453);ChatInternalMessageEvents['emit'](_0x3bb409,_0x4a8453);_0x51717a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9cb4('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xe852=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4d3835,_0x4f5f50){var _0x823439=function(_0x25a5c6){while(--_0x25a5c6){_0x4d3835['push'](_0x4d3835['shift']());}};_0x823439(++_0x4f5f50);}(_0xe852,0x99));var _0x2e85=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xe852[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x2e85('0x0'))['db'][_0x2e85('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2e85('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e85('0x3'),'afterDestroy':_0x2e85('0x4')};function emitEvent(_0x513461){return function(_0xd3a987,_0x413c18,_0x140e74){ChatInternalMessageEvents[_0x2e85('0x5')](_0x513461+':'+_0xd3a987['id'],_0xd3a987);ChatInternalMessageEvents[_0x2e85('0x5')](_0x513461,_0xd3a987);_0x140e74(null);};}for(var e in events){if(events[_0x2e85('0x6')](e)){var event=events[e];ChatInternalMessage[_0x2e85('0x7')](e,emitEvent(event));}}module[_0x2e85('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 3154529..aff62ae 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 _0x6c94=['request-promise','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x1c2e4a,_0x1c931a){var _0x2a1d52=function(_0x4185de){while(--_0x4185de){_0x1c2e4a['push'](_0x1c2e4a['shift']());}};_0x2a1d52(++_0x1c931a);}(_0x6c94,0xac));var _0x46c9=function(_0x434fc2,_0x1d8a95){_0x434fc2=_0x434fc2-0x0;var _0x2aadc1=_0x6c94[_0x434fc2];return _0x2aadc1;};'use strict';var _=require(_0x46c9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x46c9('0x1'));var moment=require(_0x46c9('0x2'));var BPromise=require(_0x46c9('0x3'));var rp=require(_0x46c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x46c9('0x5'));module[_0x46c9('0x6')]=function(_0x4a253f,_0x5dfe42){return _0x4a253f[_0x46c9('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x46c9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46c9('0x9'),'collate':_0x46c9('0xa')});}; \ No newline at end of file +var _0xb20c=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf3ce74,_0x16623a){var _0x4f44c4=function(_0x4c23f8){while(--_0x4c23f8){_0xf3ce74['push'](_0xf3ce74['shift']());}};_0x4f44c4(++_0x16623a);}(_0xb20c,0xd9));var _0xcb20=function(_0x380249,_0x88bfd9){_0x380249=_0x380249-0x0;var _0x31c6a4=_0xb20c[_0x380249];return _0x31c6a4;};'use strict';var _=require(_0xcb20('0x0'));var util=require(_0xcb20('0x1'));var logger=require(_0xcb20('0x2'))(_0xcb20('0x3'));var moment=require(_0xcb20('0x4'));var BPromise=require(_0xcb20('0x5'));var rp=require(_0xcb20('0x6'));var fs=require('fs');var path=require(_0xcb20('0x7'));var rimraf=require(_0xcb20('0x8'));var config=require(_0xcb20('0x9'));var attributes=require(_0xcb20('0xa'));module[_0xcb20('0xb')]=function(_0x5ba704,_0xb156b2){return _0x5ba704['define'](_0xcb20('0xc'),attributes,{'tableName':_0xcb20('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb20('0xe'),'collate':_0xcb20('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 065a5ea..de1556a 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 _0xd3c6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','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','lodash'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0xd3c6,0x121));var _0x6d3c=function(_0xd43e89,_0x59fa27){_0xd43e89=_0xd43e89-0x0;var _0x581ec6=_0xd3c6[_0xd43e89];return _0x581ec6;};'use strict';var _=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var moment=require(_0x6d3c('0x2'));var BPromise=require(_0x6d3c('0x3'));var rs=require(_0x6d3c('0x4'));var fs=require('fs');var Redis=require(_0x6d3c('0x5'));var db=require(_0x6d3c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d3c('0x7'))(_0x6d3c('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d3c('0x9'));var client=jayson[_0x6d3c('0xa')][_0x6d3c('0xb')]({'port':0x232a});config[_0x6d3c('0xc')]=_[_0x6d3c('0xd')](config[_0x6d3c('0xc')],{'host':_0x6d3c('0xe'),'port':0x18eb});var socket=require(_0x6d3c('0xf'))(new Redis(config[_0x6d3c('0xc')]));require(_0x6d3c('0x10'))[_0x6d3c('0x11')](socket);function respondWithRpcPromise(_0x13fd90,_0x38fdaa,_0x675c3d){return new BPromise(function(_0x41d2e2,_0x4cf27a){return client[_0x6d3c('0x12')](_0x13fd90,_0x675c3d)[_0x6d3c('0x13')](function(_0xc05d7a){logger[_0x6d3c('0x14')](_0x6d3c('0x15'),_0x38fdaa,_0x6d3c('0x16'));logger[_0x6d3c('0x17')](_0x6d3c('0x18'),_0x38fdaa,_0x6d3c('0x16'),JSON[_0x6d3c('0x19')](_0xc05d7a));if(_0xc05d7a[_0x6d3c('0x1a')]){if(_0xc05d7a[_0x6d3c('0x1a')][_0x6d3c('0x1b')]===0x1f4){logger[_0x6d3c('0x1a')](_0x6d3c('0x15'),_0x38fdaa,_0xc05d7a[_0x6d3c('0x1a')][_0x6d3c('0x1c')]);return _0x4cf27a(_0xc05d7a['error'][_0x6d3c('0x1c')]);}logger['error'](_0x6d3c('0x15'),_0x38fdaa,_0xc05d7a[_0x6d3c('0x1a')][_0x6d3c('0x1c')]);return _0x41d2e2(_0xc05d7a[_0x6d3c('0x1a')]['message']);}else{logger[_0x6d3c('0x14')](_0x6d3c('0x15'),_0x38fdaa,_0x6d3c('0x16'));_0x41d2e2(_0xc05d7a['result'][_0x6d3c('0x1c')]);}})['catch'](function(_0x49cdb5){logger[_0x6d3c('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x38fdaa,_0x49cdb5);_0x4cf27a(_0x49cdb5);});});} \ No newline at end of file +var _0x95f2=['redis','defaults','localhost','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x30760e,_0x5e759c){var _0x4bd6f8=function(_0x3acf58){while(--_0x3acf58){_0x30760e['push'](_0x30760e['shift']());}};_0x4bd6f8(++_0x5e759c);}(_0x95f2,0xdf));var _0x295f=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x95f2[_0x265aa2];return _0x447a3a;};'use strict';var _=require(_0x295f('0x0'));var util=require(_0x295f('0x1'));var moment=require('moment');var BPromise=require(_0x295f('0x2'));var rs=require(_0x295f('0x3'));var fs=require('fs');var Redis=require(_0x295f('0x4'));var db=require(_0x295f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x295f('0x6'));var config=require(_0x295f('0x7'));var jayson=require(_0x295f('0x8'));var client=jayson[_0x295f('0x9')][_0x295f('0xa')]({'port':0x232a});config[_0x295f('0xb')]=_[_0x295f('0xc')](config[_0x295f('0xb')],{'host':_0x295f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x295f('0xe'))['register'](socket);function respondWithRpcPromise(_0x7996e6,_0x59935b,_0x229866){return new BPromise(function(_0x2e827e,_0x505774){return client[_0x295f('0xf')](_0x7996e6,_0x229866)[_0x295f('0x10')](function(_0x49c04d){logger[_0x295f('0x11')](_0x295f('0x12'),_0x59935b,_0x295f('0x13'));logger[_0x295f('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x59935b,_0x295f('0x13'),JSON[_0x295f('0x15')](_0x49c04d));if(_0x49c04d[_0x295f('0x16')]){if(_0x49c04d[_0x295f('0x16')][_0x295f('0x17')]===0x1f4){logger[_0x295f('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x59935b,_0x49c04d[_0x295f('0x16')][_0x295f('0x18')]);return _0x505774(_0x49c04d[_0x295f('0x16')][_0x295f('0x18')]);}logger[_0x295f('0x16')](_0x295f('0x12'),_0x59935b,_0x49c04d[_0x295f('0x16')][_0x295f('0x18')]);return _0x2e827e(_0x49c04d[_0x295f('0x16')][_0x295f('0x18')]);}else{logger[_0x295f('0x11')](_0x295f('0x12'),_0x59935b,_0x295f('0x13'));_0x2e827e(_0x49c04d['result']['message']);}})[_0x295f('0x19')](function(_0xf2114a){logger[_0x295f('0x16')](_0x295f('0x12'),_0x59935b,_0xf2114a);_0x505774(_0xf2114a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 325bd8c..4ff661a 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 _0xed3d=['save','remove','update','emit','register','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0xed3d,0x14f));var _0xded3=function(_0xce739c,_0x3452fc){_0xce739c=_0xce739c-0x0;var _0x37bfe1=_0xed3d[_0xce739c];return _0x37bfe1;};'use strict';var ChatInternalMessageEvents=require(_0xded3('0x0'));var events=[_0xded3('0x1'),_0xded3('0x2'),_0xded3('0x3')];function createListener(_0xb3ad35,_0x11aae7){return function(_0x446d7f){_0x11aae7[_0xded3('0x4')](_0xb3ad35,_0x446d7f);};}function removeListener(_0x12a6cf,_0x56b605){return function(){ChatInternalMessageEvents['removeListener'](_0x12a6cf,_0x56b605);};}exports[_0xded3('0x5')]=function(_0x426e14){for(var _0x2fbcf1=0x0,_0x17c360=events['length'];_0x2fbcf1<_0x17c360;_0x2fbcf1++){var _0x31e7e3=events[_0x2fbcf1];var _0xcb4440=createListener(_0xded3('0x6')+_0x31e7e3,_0x426e14);ChatInternalMessageEvents['on'](_0x31e7e3,_0xcb4440);}}; \ No newline at end of file +var _0xc6f6=['emit','removeListener','register','chatInternalMessage:','save'];(function(_0x15c5d3,_0x490700){var _0x2e6fdb=function(_0x2aebbb){while(--_0x2aebbb){_0x15c5d3['push'](_0x15c5d3['shift']());}};_0x2e6fdb(++_0x490700);}(_0xc6f6,0x10d));var _0x6c6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6f6[_0x20a584];return _0x4b41a8;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x6c6f('0x0'),'remove','update'];function createListener(_0x3868cd,_0x545490){return function(_0x48ca0f){_0x545490[_0x6c6f('0x1')](_0x3868cd,_0x48ca0f);};}function removeListener(_0x1e9d12,_0x5a8796){return function(){ChatInternalMessageEvents[_0x6c6f('0x2')](_0x1e9d12,_0x5a8796);};}exports[_0x6c6f('0x3')]=function(_0x55a6f7){for(var _0x444155=0x0,_0x365ad4=events['length'];_0x444155<_0x365ad4;_0x444155++){var _0x526ed1=events[_0x444155];var _0x16e60b=createListener(_0x6c6f('0x4')+_0x526ed1,_0x55a6f7);ChatInternalMessageEvents['on'](_0x526ed1,_0x16e60b);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e7ac230..341eefb 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 _0x3449=['describe','/users','getUsers','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x842f30,_0x5a3981){var _0x24caa8=function(_0x167d3e){while(--_0x167d3e){_0x842f30['push'](_0x842f30['shift']());}};_0x24caa8(++_0x5a3981);}(_0x3449,0x106));var _0x9344=function(_0x1f326d,_0x19c7d2){_0x1f326d=_0x1f326d-0x0;var _0xca55ba=_0x3449[_0x1f326d];return _0xca55ba;};'use strict';var multer=require(_0x9344('0x0'));var util=require('util');var path=require(_0x9344('0x1'));var timeout=require(_0x9344('0x2'));var express=require(_0x9344('0x3'));var router=express[_0x9344('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9344('0x5'));var config=require(_0x9344('0x6'));var controller=require(_0x9344('0x7'));router[_0x9344('0x8')]('/',auth[_0x9344('0x9')](),controller[_0x9344('0xa')]);router[_0x9344('0x8')]('/describe',auth[_0x9344('0x9')](),controller[_0x9344('0xb')]);router['get'](_0x9344('0xc'),auth[_0x9344('0x9')](),controller[_0x9344('0xd')]);router[_0x9344('0x8')](_0x9344('0xe'),auth[_0x9344('0x9')](),controller['show']);router[_0x9344('0xf')]('/',auth[_0x9344('0x9')](),controller[_0x9344('0x10')]);router[_0x9344('0x11')](_0x9344('0xe'),controller[_0x9344('0x12')]);router['delete']('/:id',auth[_0x9344('0x9')](),controller[_0x9344('0x13')]);module[_0x9344('0x14')]=router; \ No newline at end of file +var _0x75ba=['describe','/users','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','/describe'];(function(_0x5c2d5f,_0x21c3ae){var _0x30bbf9=function(_0x49ebf5){while(--_0x49ebf5){_0x5c2d5f['push'](_0x5c2d5f['shift']());}};_0x30bbf9(++_0x21c3ae);}(_0x75ba,0x174));var _0xa75b=function(_0x5ebf44,_0x4e543e){_0x5ebf44=_0x5ebf44-0x0;var _0x2fef12=_0x75ba[_0x5ebf44];return _0x2fef12;};'use strict';var multer=require(_0xa75b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa75b('0x1'));var express=require(_0xa75b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa75b('0x3'));var config=require('../../config/environment');var controller=require(_0xa75b('0x4'));router[_0xa75b('0x5')]('/',auth[_0xa75b('0x6')](),controller['index']);router['get'](_0xa75b('0x7'),auth[_0xa75b('0x6')](),controller[_0xa75b('0x8')]);router['get'](_0xa75b('0x9'),auth['isAuthenticated'](),controller[_0xa75b('0xa')]);router[_0xa75b('0x5')](_0xa75b('0xb'),auth[_0xa75b('0x6')](),controller[_0xa75b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa75b('0xd')]);router[_0xa75b('0xe')](_0xa75b('0xb'),controller[_0xa75b('0xf')]);router[_0xa75b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa75b('0x11')]);module[_0xa75b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index bac54cb..61bb36b 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 _0xa149=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x240502,_0x372cb4){var _0x58a1ab=function(_0x20f74f){while(--_0x20f74f){_0x240502['push'](_0x240502['shift']());}};_0x58a1ab(++_0x372cb4);}(_0xa149,0x18c));var _0x9a14=function(_0x298596,_0x1da7d8){_0x298596=_0x298596-0x0;var _0x13fa20=_0xa149[_0x298596];return _0x13fa20;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'body':{'type':Sequelize[_0x9a14('0x2')](_0x9a14('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a14('0x5')]('in',_0x9a14('0x6')),'defaultValue':_0x9a14('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9a14('0x7')]},'providerResponse':{'type':Sequelize[_0x9a14('0x2')]}}; \ No newline at end of file +var _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x23a299,_0x30e49c){var _0x560bb3=function(_0x1c8073){while(--_0x1c8073){_0x23a299['push'](_0x23a299['shift']());}};_0x560bb3(++_0x30e49c);}(_0x9158,0x16e));var _0x8915=function(_0x5054b1,_0x2f8b19){_0x5054b1=_0x5054b1-0x0;var _0x3b7aec=_0x9158[_0x5054b1];return _0x3b7aec;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index bf12044..06274d7 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 _0x7c1a=['debug','stringify','error','code','message','info','result','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','sendStatus','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','show','params','length','include','create','body','find','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','interface','SIP/%s','channel','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x5ec0a8,_0x46c1c9){var _0x4b536d=function(_0x5e8841){while(--_0x5e8841){_0x5ec0a8['push'](_0x5ec0a8['shift']());}};_0x4b536d(++_0x46c1c9);}(_0x7c1a,0x159));var _0xa7c1=function(_0x4d1bbc,_0x369b91){_0x4d1bbc=_0x4d1bbc-0x0;var _0x4a38a9=_0x7c1a[_0x4d1bbc];return _0x4a38a9;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require(_0xa7c1('0x2'));var jsonpatch=require(_0xa7c1('0x3'));var rp=require(_0xa7c1('0x4'));var moment=require(_0xa7c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa7c1('0x6'));var util=require(_0xa7c1('0x7'));var path=require('path');var sox=require(_0xa7c1('0x8'));var csv=require('to-csv');var ejs=require(_0xa7c1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7c1('0xa'));var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0xe'));var querystring=require(_0xa7c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0x10'));var authService=require(_0xa7c1('0x11'));var qs=require(_0xa7c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x13'));var logger=require(_0xa7c1('0x14'))('api');var utils=require(_0xa7c1('0x15'));var config=require(_0xa7c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7c1('0x17'))['db'];config[_0xa7c1('0x18')]=_[_0xa7c1('0x19')](config[_0xa7c1('0x18')],{'host':_0xa7c1('0x1a'),'port':0x18eb});var socket=require(_0xa7c1('0x1b'))(new Redis(config[_0xa7c1('0x18')]));require(_0xa7c1('0x1c'))[_0xa7c1('0x1d')](socket);var jayson=require(_0xa7c1('0x1e'));var client=jayson[_0xa7c1('0x1f')][_0xa7c1('0x20')]({'port':0x232c});var client9002=jayson[_0xa7c1('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0xba02b,_0x3a6f47,_0x1790c3,_0x1ca843){return new BPromise(function(_0x84244a,_0x5a92d9){var _0x3b77af=_0x1ca843||client;return _0x3b77af['request'](_0xba02b,_0x1790c3)[_0xa7c1('0x21')](function(_0x337db4){logger['info'](_0xa7c1('0x22'),_0x3a6f47,_0xa7c1('0x23'));logger[_0xa7c1('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3a6f47,_0xa7c1('0x23'),JSON[_0xa7c1('0x25')](_0x337db4));if(_0x337db4[_0xa7c1('0x26')]){if(_0x337db4[_0xa7c1('0x26')][_0xa7c1('0x27')]===0x1f4){logger[_0xa7c1('0x26')](_0xa7c1('0x22'),_0x3a6f47,_0x337db4[_0xa7c1('0x26')][_0xa7c1('0x28')]);return _0x5a92d9(_0x337db4['error'][_0xa7c1('0x28')]);}logger[_0xa7c1('0x26')](_0xa7c1('0x22'),_0x3a6f47,_0x337db4['error'][_0xa7c1('0x28')]);return _0x84244a(_0x337db4[_0xa7c1('0x26')][_0xa7c1('0x28')]);}else{logger[_0xa7c1('0x29')](_0xa7c1('0x22'),_0x3a6f47,_0xa7c1('0x23'));_0x84244a(_0x337db4[_0xa7c1('0x2a')]['message']);}})['catch'](function(_0x48280a){logger[_0xa7c1('0x26')](_0xa7c1('0x22'),_0x3a6f47,_0x48280a);_0x5a92d9(_0x48280a);});});}function respondWithStatusCode(_0xd17267,_0x153b1a){_0x153b1a=_0x153b1a||0xcc;return function(_0x94884d){if(_0x94884d){return _0xd17267['sendStatus'](_0x153b1a);}return _0xd17267['status'](_0x153b1a)[_0xa7c1('0x2b')]();};}function respondWithResult(_0x2726e9,_0xc60f7c){_0xc60f7c=_0xc60f7c||0xc8;return function(_0x59b3f5){if(_0x59b3f5){return _0x2726e9[_0xa7c1('0x2c')](_0xc60f7c)[_0xa7c1('0x2d')](_0x59b3f5);}};}function respondWithFilteredResult(_0x2fe45b,_0xa8a937){return function(_0x635792){if(_0x635792){var _0x1cc05c=typeof _0xa8a937[_0xa7c1('0x2e')]===_0xa7c1('0x2f')&&typeof _0xa8a937[_0xa7c1('0x30')]===_0xa7c1('0x2f');var _0x599b08=_0x635792[_0xa7c1('0x31')];var _0x924b93=_0x1cc05c?0x0:_0xa8a937[_0xa7c1('0x2e')];var _0x40ad2b=_0x1cc05c?_0x635792[_0xa7c1('0x31')]:_0xa8a937[_0xa7c1('0x2e')]+_0xa8a937[_0xa7c1('0x30')];var _0x6af68e;if(_0x40ad2b>=_0x599b08){_0x40ad2b=_0x599b08;_0x6af68e=0xc8;}else{_0x6af68e=0xce;}_0x2fe45b[_0xa7c1('0x2c')](_0x6af68e);return _0x2fe45b['set'](_0xa7c1('0x32'),_0x924b93+'-'+_0x40ad2b+'/'+_0x599b08)[_0xa7c1('0x2d')](_0x635792);}return null;};}function patchUpdates(_0x6533b2){return function(_0x27feee){try{jsonpatch['apply'](_0x27feee,_0x6533b2,!![]);}catch(_0x5c8956){return BPromise[_0xa7c1('0x33')](_0x5c8956);}return _0x27feee[_0xa7c1('0x34')]();};}function saveUpdates(_0x28371e,_0x57b905){return function(_0x496116){if(_0x496116){return _0x496116[_0xa7c1('0x35')](_0x28371e)[_0xa7c1('0x21')](function(_0x5182ca){return _0x5182ca;});}return null;};}function removeEntity(_0x1dc655,_0x55e4e0){return function(_0x2c1569){if(_0x2c1569){return _0x2c1569['destroy']()[_0xa7c1('0x21')](function(){_0x1dc655[_0xa7c1('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8fd6,_0x1a7261){return function(_0x18e7fc){if(!_0x18e7fc){_0x4d8fd6[_0xa7c1('0x36')](0x194);}return _0x18e7fc;};}function handleError(_0x410682,_0x821e1a){_0x821e1a=_0x821e1a||0x1f4;return function(_0x156f56){logger[_0xa7c1('0x26')](_0x156f56['stack']);if(_0x156f56[_0xa7c1('0x37')]){delete _0x156f56[_0xa7c1('0x37')];}_0x410682[_0xa7c1('0x2c')](_0x821e1a)[_0xa7c1('0x38')](_0x156f56);};}exports[_0xa7c1('0x39')]=function(_0x396748,_0x4b88d4){var _0x3e1a41={},_0x27d462={},_0x2eaf6c={'count':0x0,'rows':[]};var _0x1125f8=_[_0xa7c1('0x3a')](db[_0xa7c1('0x3b')][_0xa7c1('0x3c')],function(_0xff58c3){return{'name':_0xff58c3['fieldName'],'type':_0xff58c3[_0xa7c1('0x3d')][_0xa7c1('0x3e')]};});_0x27d462[_0xa7c1('0x3f')]=_[_0xa7c1('0x3a')](_0x1125f8,_0xa7c1('0x37'));_0x27d462[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x396748[_0xa7c1('0x40')]);_0x27d462[_0xa7c1('0x42')]=_[_0xa7c1('0x43')](_0x27d462[_0xa7c1('0x3f')],_0x27d462[_0xa7c1('0x40')]);_0x3e1a41[_0xa7c1('0x44')]=_[_0xa7c1('0x43')](_0x27d462[_0xa7c1('0x3f')],qs[_0xa7c1('0x45')](_0x396748[_0xa7c1('0x40')]['fields']));_0x3e1a41[_0xa7c1('0x44')]=_0x3e1a41[_0xa7c1('0x44')]['length']?_0x3e1a41[_0xa7c1('0x44')]:_0x27d462[_0xa7c1('0x3f')];if(!_0x396748[_0xa7c1('0x40')][_0xa7c1('0x46')]('nolimit')){_0x3e1a41[_0xa7c1('0x30')]=qs['limit'](_0x396748['query'][_0xa7c1('0x30')]);_0x3e1a41[_0xa7c1('0x2e')]=qs[_0xa7c1('0x2e')](_0x396748[_0xa7c1('0x40')][_0xa7c1('0x2e')]);}_0x3e1a41['order']=qs[_0xa7c1('0x47')](_0x396748[_0xa7c1('0x40')][_0xa7c1('0x47')]);_0x3e1a41['where']=qs['filters'](_[_0xa7c1('0x48')](_0x396748[_0xa7c1('0x40')],_0x27d462['filters']),_0x1125f8);if(_0x396748[_0xa7c1('0x40')][_0xa7c1('0x49')]){_0x3e1a41[_0xa7c1('0x4a')]=_[_0xa7c1('0x4b')](_0x3e1a41[_0xa7c1('0x4a')],{'$or':_['map'](_0x1125f8,function(_0x404362){if(_0x404362[_0xa7c1('0x3d')]!==_0xa7c1('0x4c')){var _0x1bf445={};_0x1bf445[_0x404362[_0xa7c1('0x37')]]={'$like':'%'+_0x396748['query'][_0xa7c1('0x49')]+'%'};return _0x1bf445;}})});}_0x3e1a41=_[_0xa7c1('0x4b')]({},_0x3e1a41,_0x396748[_0xa7c1('0x4d')]);var _0x41d56e={'where':_0x3e1a41[_0xa7c1('0x4a')]};return db[_0xa7c1('0x3b')]['count'](_0x41d56e)[_0xa7c1('0x21')](function(_0xa0159){_0x2eaf6c[_0xa7c1('0x31')]=_0xa0159;if(_0x396748[_0xa7c1('0x40')]['includeAll']){_0x3e1a41['include']=[{'all':!![]}];}return db[_0xa7c1('0x3b')]['findAll'](_0x3e1a41);})[_0xa7c1('0x21')](function(_0x12c578){_0x2eaf6c[_0xa7c1('0x4e')]=_0x12c578;return _0x2eaf6c;})['then'](respondWithFilteredResult(_0x4b88d4,_0x3e1a41))[_0xa7c1('0x4f')](handleError(_0x4b88d4,null));};exports[_0xa7c1('0x50')]=function(_0x5cae17,_0x4ea4b1){var _0x42edd0={'raw':!![],'where':{'id':_0x5cae17[_0xa7c1('0x51')]['id']}},_0x311fa2={};_0x311fa2['model']=_[_0xa7c1('0x41')](db[_0xa7c1('0x3b')][_0xa7c1('0x3c')]);_0x311fa2[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x5cae17['query']);_0x311fa2['filters']=_[_0xa7c1('0x43')](_0x311fa2[_0xa7c1('0x3f')],_0x311fa2['query']);_0x42edd0['attributes']=_[_0xa7c1('0x43')](_0x311fa2[_0xa7c1('0x3f')],qs['fields'](_0x5cae17[_0xa7c1('0x40')]['fields']));_0x42edd0['attributes']=_0x42edd0[_0xa7c1('0x44')][_0xa7c1('0x52')]?_0x42edd0[_0xa7c1('0x44')]:_0x311fa2['model'];if(_0x5cae17[_0xa7c1('0x40')]['includeAll']){_0x42edd0[_0xa7c1('0x53')]=[{'all':!![]}];}_0x42edd0=_[_0xa7c1('0x4b')]({},_0x42edd0,_0x5cae17['options']);return db[_0xa7c1('0x3b')]['find'](_0x42edd0)[_0xa7c1('0x21')](handleEntityNotFound(_0x4ea4b1,null))[_0xa7c1('0x21')](respondWithResult(_0x4ea4b1,null))['catch'](handleError(_0x4ea4b1,null));};exports[_0xa7c1('0x54')]=function(_0x532e5f,_0x7b81b9){return db[_0xa7c1('0x3b')][_0xa7c1('0x54')](_0x532e5f[_0xa7c1('0x55')],{})['then'](respondWithResult(_0x7b81b9,0xc9))[_0xa7c1('0x4f')](handleError(_0x7b81b9,null));};exports[_0xa7c1('0x35')]=function(_0x583063,_0x5c3955){if(_0x583063[_0xa7c1('0x55')]['id']){delete _0x583063[_0xa7c1('0x55')]['id'];}return db[_0xa7c1('0x3b')][_0xa7c1('0x56')]({'where':{'id':_0x583063[_0xa7c1('0x51')]['id']}})[_0xa7c1('0x21')](handleEntityNotFound(_0x5c3955,null))[_0xa7c1('0x21')](saveUpdates(_0x583063[_0xa7c1('0x55')],null))[_0xa7c1('0x21')](respondWithResult(_0x5c3955,null))['catch'](handleError(_0x5c3955,null));};exports[_0xa7c1('0x57')]=function(_0x1b6d5e,_0x409d97){return db[_0xa7c1('0x3b')]['find']({'where':{'id':_0x1b6d5e[_0xa7c1('0x51')]['id']}})['then'](handleEntityNotFound(_0x409d97,null))['then'](removeEntity(_0x409d97,null))[_0xa7c1('0x4f')](handleError(_0x409d97,null));};exports[_0xa7c1('0x58')]=function(_0x17b559,_0x1afe8b){return db[_0xa7c1('0x3b')][_0xa7c1('0x58')]()[_0xa7c1('0x21')](respondWithResult(_0x1afe8b,null))[_0xa7c1('0x4f')](handleError(_0x1afe8b,null));};var interaction_log=require(_0xa7c1('0x14'))(_0xa7c1('0x59'));exports['accept']=function(_0x1cb85d,_0x66fde3,_0x26f891){var _0x531582={'agent':{},'channel':_0xa7c1('0x5a')};if(_0x1cb85d['body']['id']){delete _0x1cb85d['body']['id'];}_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5b')]=!![];_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5c')]=moment()[_0xa7c1('0x5d')](_0xa7c1('0x5e'));_0x1cb85d['body']['UserId']=_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5f')]||_0x1cb85d['user']['id'];_0x531582[_0xa7c1('0x60')]['id']=_0x1cb85d['body'][_0xa7c1('0x5f')];return db[_0xa7c1('0x3b')][_0xa7c1('0x56')]({'where':{'id':_0x1cb85d[_0xa7c1('0x51')]['id'],'UserId':null}})[_0xa7c1('0x21')](handleEntityNotFound(_0x66fde3,null))['then'](saveUpdates(_0x1cb85d['body'],null))[_0xa7c1('0x21')](function(_0x3a24d3){if(_0x3a24d3){_0x531582[_0xa7c1('0x28')]=_0x3a24d3[_0xa7c1('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xa7c1('0x56')]({'where':{'id':_0x3a24d3['ChatInteractionId']}});}return null;})[_0xa7c1('0x21')](handleEntityNotFound(_0x66fde3,null))[_0xa7c1('0x21')](function(_0x3b0f9c){if(_0x3b0f9c){return _0x3b0f9c[_0xa7c1('0x35')]({'UserId':_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5f')],'read1stAt':_['isNil'](_0x3b0f9c['read1stAt'])?moment()['format'](_0xa7c1('0x5e')):undefined});}return null;})[_0xa7c1('0x21')](function(_0x263ef2){if(_0x263ef2){_0x531582[_0xa7c1('0x62')]=_0x263ef2[_0xa7c1('0x61')]({'plain':!![]});interaction_log[_0xa7c1('0x29')](_0xa7c1('0x63'),_0x1cb85d[_0xa7c1('0x64')]['id'],_0x1cb85d[_0xa7c1('0x64')][_0xa7c1('0x37')],_0x1cb85d[_0xa7c1('0x64')][_0xa7c1('0x65')],_0x531582[_0xa7c1('0x62')]['id'],_0x1cb85d[_0xa7c1('0x55')]?JSON[_0xa7c1('0x25')](_0x1cb85d[_0xa7c1('0x55')]):'null');return respondWithRpcPromise(_0xa7c1('0x66'),'acceptMessage',_0x531582);}return null;})[_0xa7c1('0x21')](function(_0x72ce4d){var _0x49e90b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x72ce4d[_0xa7c1('0x28')][_0xa7c1('0x67')];return db[_0xa7c1('0x68')][_0xa7c1('0x40')](_0x49e90b,{'type':db[_0xa7c1('0x69')][_0xa7c1('0x6a')][_0xa7c1('0x6b')],'raw':!![]})['then'](function(_0x48045b){return _0x48045b;});})[_0xa7c1('0x21')](function(_0x4006fe){if(_0x4006fe){_0x531582[_0xa7c1('0x28')][_0xa7c1('0x6c')]=_0x4006fe[0x0];if(!_0x1cb85d[_0xa7c1('0x55')]['UserId'])return;return db[_0xa7c1('0x6d')][_0xa7c1('0x56')]({'where':{'id':_0x1cb85d[_0xa7c1('0x55')]['UserId'],'role':_0xa7c1('0x60')},'attributes':['id','name',_0xa7c1('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0xa7c1('0x21')](function(_0x49d606){if(!_0x49d606)return null;_0x531582[_0xa7c1('0x28')][_0xa7c1('0x60')]=_0x49d606;return _0x531582;})[_0xa7c1('0x21')](function(_0xf3f3e6){if(_0xf3f3e6){if(_0x1cb85d['body'][_0xa7c1('0x6f')]){_0x531582[_0xa7c1('0x28')][_0xa7c1('0x70')]=util[_0xa7c1('0x5d')](_0xa7c1('0x71'),_0x1cb85d[_0xa7c1('0x64')][_0xa7c1('0x37')]);_0x531582[_0xa7c1('0x28')][_0xa7c1('0x72')]=_0x531582[_0xa7c1('0x72')];_0x531582['message']['event']='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xa7c1('0x73'),'message':_[_0xa7c1('0x4b')](_0x531582[_0xa7c1('0x28')],JSON[_0xa7c1('0x74')](_0x531582['interaction'][_0xa7c1('0x75')]))},client9002)['then'](function(){return _0x531582;});}return _0x531582;}return null;})[_0xa7c1('0x21')](respondWithResult(_0x66fde3,null))[_0xa7c1('0x4f')](handleError(_0x66fde3,null));};var interaction_log=require(_0xa7c1('0x14'))(_0xa7c1('0x59'));exports[_0xa7c1('0x33')]=function(_0x3655b6,_0x2c741f,_0x29ffc2){var _0x2b7e75={'agent':{},'channel':_0xa7c1('0x5a')};if(_0x3655b6[_0xa7c1('0x55')]['id']){delete _0x3655b6[_0xa7c1('0x55')]['id'];}_0x3655b6[_0xa7c1('0x55')][_0xa7c1('0x5f')]=_0x3655b6[_0xa7c1('0x55')][_0xa7c1('0x5f')]||_0x3655b6['user']['id'];_0x2b7e75['agent']['id']=_0x3655b6[_0xa7c1('0x55')][_0xa7c1('0x5f')];return db[_0xa7c1('0x3b')][_0xa7c1('0x56')]({'where':{'id':_0x3655b6[_0xa7c1('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2c741f,null))['then'](function(_0x147f73){if(_0x147f73){_0x2b7e75['message']=_0x147f73[_0xa7c1('0x61')]({'plain':!![]});return db[_0xa7c1('0x76')][_0xa7c1('0x56')]({'where':{'id':_0x147f73['ChatInteractionId']}});}return null;})[_0xa7c1('0x21')](handleEntityNotFound(_0x2c741f,null))[_0xa7c1('0x21')](function(_0x5c02d0){if(_0x5c02d0){_0x2b7e75[_0xa7c1('0x62')]=_0x5c02d0[_0xa7c1('0x61')]({'plain':!![]});interaction_log[_0xa7c1('0x29')](_0xa7c1('0x77'),_0x3655b6[_0xa7c1('0x64')]['id'],_0x3655b6[_0xa7c1('0x64')][_0xa7c1('0x37')],_0x3655b6['user']['role'],_0x2b7e75[_0xa7c1('0x62')]['id'],_0x3655b6[_0xa7c1('0x55')]?JSON['stringify'](_0x3655b6[_0xa7c1('0x55')]):_0xa7c1('0x78'));return respondWithRpcPromise(_0xa7c1('0x79'),_0xa7c1('0x7a'),_0x2b7e75);}return null;})[_0xa7c1('0x21')](function(_0x2cb10b){var _0x47b21f=_0xa7c1('0x7b')+_0x2cb10b['message'][_0xa7c1('0x67')];return db[_0xa7c1('0x68')][_0xa7c1('0x40')](_0x47b21f,{'type':db[_0xa7c1('0x69')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x2ee9f6){return _0x2ee9f6;});})[_0xa7c1('0x21')](function(_0x322f97){if(_0x322f97){_0x2b7e75[_0xa7c1('0x28')][_0xa7c1('0x6c')]=_0x322f97[0x0];if(!_0x3655b6[_0xa7c1('0x55')]['UserId'])return;return db[_0xa7c1('0x6d')]['find']({'where':{'id':_0x3655b6['body'][_0xa7c1('0x5f')],'role':_0xa7c1('0x60')},'attributes':['id',_0xa7c1('0x37'),_0xa7c1('0x6e'),'email',_0xa7c1('0x7c')],'raw':!![]});}return null;})[_0xa7c1('0x21')](function(_0x2874df){if(!_0x2874df)return null;_0x2b7e75[_0xa7c1('0x28')]['agent']=_0x2874df;return _0x2b7e75;})[_0xa7c1('0x21')](function(_0x4735a4){if(_0x4735a4){_0x4735a4['message'][_0xa7c1('0x70')]=util[_0xa7c1('0x5d')](_0xa7c1('0x71'),_0x3655b6[_0xa7c1('0x64')][_0xa7c1('0x37')]);_0x4735a4[_0xa7c1('0x28')][_0xa7c1('0x72')]=_0x2b7e75['channel'];_0x4735a4[_0xa7c1('0x28')][_0xa7c1('0x7d')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0xa7c1('0x7e'),'message':_[_0xa7c1('0x4b')](_0x2b7e75[_0xa7c1('0x28')],JSON[_0xa7c1('0x74')](_0x2b7e75[_0xa7c1('0x62')][_0xa7c1('0x75')]))},client9002);return _0x2b7e75;}return null;})[_0xa7c1('0x21')](respondWithResult(_0x2c741f,null))['catch'](handleError(_0x2c741f,null));}; \ No newline at end of file +var _0x6132=['params','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','email','internal','channel','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','name','map','ChatMessage','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','includeAll','findAll','show','include','create','body','find'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6132,0x13a));var _0x2613=function(_0x22c93d,_0x459bd1){_0x22c93d=_0x22c93d-0x0;var _0x268bb3=_0x6132[_0x22c93d];return _0x268bb3;};'use strict';var emlformat=require(_0x2613('0x0'));var rimraf=require(_0x2613('0x1'));var zipdir=require(_0x2613('0x2'));var jsonpatch=require(_0x2613('0x3'));var rp=require('request-promise');var moment=require(_0x2613('0x4'));var BPromise=require(_0x2613('0x5'));var Mustache=require(_0x2613('0x6'));var util=require(_0x2613('0x7'));var path=require('path');var sox=require(_0x2613('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2613('0x9'));var _=require(_0x2613('0xa'));var squel=require(_0x2613('0xb'));var crypto=require(_0x2613('0xc'));var jsforce=require(_0x2613('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2613('0xe'));var querystring=require(_0x2613('0xf'));var Papa=require(_0x2613('0x10'));var Redis=require('ioredis');var authService=require(_0x2613('0x11'));var qs=require(_0x2613('0x12'));var as=require(_0x2613('0x13'));var hardwareService=require(_0x2613('0x14'));var logger=require(_0x2613('0x15'))(_0x2613('0x16'));var utils=require(_0x2613('0x17'));var config=require(_0x2613('0x18'));var licenseUtil=require(_0x2613('0x19'));var db=require(_0x2613('0x1a'))['db'];config['redis']=_[_0x2613('0x1b')](config[_0x2613('0x1c')],{'host':_0x2613('0x1d'),'port':0x18eb});var socket=require(_0x2613('0x1e'))(new Redis(config['redis']));require(_0x2613('0x1f'))[_0x2613('0x20')](socket);var jayson=require(_0x2613('0x21'));var client=jayson[_0x2613('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x2613('0x22')][_0x2613('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x386686,_0x3e3620,_0x57170f,_0x35dd88){return new BPromise(function(_0x13cdee,_0x4958c2){var _0x37f961=_0x35dd88||client;return _0x37f961[_0x2613('0x24')](_0x386686,_0x57170f)[_0x2613('0x25')](function(_0x247e4c){logger[_0x2613('0x26')]('ChatMessage,\x20%s,\x20%s',_0x3e3620,_0x2613('0x27'));logger[_0x2613('0x28')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3e3620,_0x2613('0x27'),JSON[_0x2613('0x29')](_0x247e4c));if(_0x247e4c[_0x2613('0x2a')]){if(_0x247e4c[_0x2613('0x2a')]['code']===0x1f4){logger[_0x2613('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x3e3620,_0x247e4c['error'][_0x2613('0x2b')]);return _0x4958c2(_0x247e4c['error'][_0x2613('0x2b')]);}logger[_0x2613('0x2a')](_0x2613('0x2c'),_0x3e3620,_0x247e4c['error']['message']);return _0x13cdee(_0x247e4c[_0x2613('0x2a')][_0x2613('0x2b')]);}else{logger['info'](_0x2613('0x2c'),_0x3e3620,_0x2613('0x27'));_0x13cdee(_0x247e4c[_0x2613('0x2d')][_0x2613('0x2b')]);}})[_0x2613('0x2e')](function(_0x115f6f){logger[_0x2613('0x2a')](_0x2613('0x2c'),_0x3e3620,_0x115f6f);_0x4958c2(_0x115f6f);});});}function respondWithStatusCode(_0x52898d,_0x1dab3c){_0x1dab3c=_0x1dab3c||0xcc;return function(_0x11419f){if(_0x11419f){return _0x52898d[_0x2613('0x2f')](_0x1dab3c);}return _0x52898d[_0x2613('0x30')](_0x1dab3c)[_0x2613('0x31')]();};}function respondWithResult(_0x329e65,_0x15ee46){_0x15ee46=_0x15ee46||0xc8;return function(_0x2d43b1){if(_0x2d43b1){return _0x329e65[_0x2613('0x30')](_0x15ee46)['json'](_0x2d43b1);}};}function respondWithFilteredResult(_0x25bc15,_0x34860e){return function(_0x465cc8){if(_0x465cc8){var _0x3110d3=typeof _0x34860e[_0x2613('0x32')]===_0x2613('0x33')&&typeof _0x34860e[_0x2613('0x34')]===_0x2613('0x33');var _0x5b0c2f=_0x465cc8[_0x2613('0x35')];var _0x151415=_0x3110d3?0x0:_0x34860e[_0x2613('0x32')];var _0x471585=_0x3110d3?_0x465cc8[_0x2613('0x35')]:_0x34860e[_0x2613('0x32')]+_0x34860e['limit'];var _0x2eefec;if(_0x471585>=_0x5b0c2f){_0x471585=_0x5b0c2f;_0x2eefec=0xc8;}else{_0x2eefec=0xce;}_0x25bc15['status'](_0x2eefec);return _0x25bc15[_0x2613('0x36')]('Content-Range',_0x151415+'-'+_0x471585+'/'+_0x5b0c2f)[_0x2613('0x37')](_0x465cc8);}return null;};}function patchUpdates(_0x59369a){return function(_0x4412a2){try{jsonpatch[_0x2613('0x38')](_0x4412a2,_0x59369a,!![]);}catch(_0xd11cae){return BPromise[_0x2613('0x39')](_0xd11cae);}return _0x4412a2[_0x2613('0x3a')]();};}function saveUpdates(_0x51a5b8,_0x2eaf1d){return function(_0xb25315){if(_0xb25315){return _0xb25315[_0x2613('0x3b')](_0x51a5b8)['then'](function(_0x51ef50){return _0x51ef50;});}return null;};}function removeEntity(_0xa6cab2,_0x365342){return function(_0x145a46){if(_0x145a46){return _0x145a46[_0x2613('0x3c')]()[_0x2613('0x25')](function(){_0xa6cab2[_0x2613('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55704b,_0x26615c){return function(_0x4df905){if(!_0x4df905){_0x55704b['sendStatus'](0x194);}return _0x4df905;};}function handleError(_0x33b01c,_0x44bb70){_0x44bb70=_0x44bb70||0x1f4;return function(_0x58a697){logger[_0x2613('0x2a')](_0x58a697['stack']);if(_0x58a697[_0x2613('0x3d')]){delete _0x58a697[_0x2613('0x3d')];}_0x33b01c['status'](_0x44bb70)['send'](_0x58a697);};}exports['index']=function(_0x21440c,_0x3b8dd6){var _0x2a3fe9={},_0x57d3dc={},_0x3094f3={'count':0x0,'rows':[]};var _0x3e732a=_[_0x2613('0x3e')](db[_0x2613('0x3f')][_0x2613('0x40')],function(_0x5eccd6){return{'name':_0x5eccd6['fieldName'],'type':_0x5eccd6[_0x2613('0x41')][_0x2613('0x42')]};});_0x57d3dc[_0x2613('0x43')]=_['map'](_0x3e732a,'name');_0x57d3dc[_0x2613('0x44')]=_[_0x2613('0x45')](_0x21440c[_0x2613('0x44')]);_0x57d3dc['filters']=_['intersection'](_0x57d3dc['model'],_0x57d3dc[_0x2613('0x44')]);_0x2a3fe9[_0x2613('0x46')]=_[_0x2613('0x47')](_0x57d3dc[_0x2613('0x43')],qs[_0x2613('0x48')](_0x21440c[_0x2613('0x44')][_0x2613('0x48')]));_0x2a3fe9[_0x2613('0x46')]=_0x2a3fe9[_0x2613('0x46')][_0x2613('0x49')]?_0x2a3fe9[_0x2613('0x46')]:_0x57d3dc[_0x2613('0x43')];if(!_0x21440c[_0x2613('0x44')]['hasOwnProperty'](_0x2613('0x4a'))){_0x2a3fe9['limit']=qs[_0x2613('0x34')](_0x21440c[_0x2613('0x44')][_0x2613('0x34')]);_0x2a3fe9['offset']=qs['offset'](_0x21440c[_0x2613('0x44')][_0x2613('0x32')]);}_0x2a3fe9[_0x2613('0x4b')]=qs[_0x2613('0x4c')](_0x21440c[_0x2613('0x44')]['sort']);_0x2a3fe9['where']=qs['filters'](_[_0x2613('0x4d')](_0x21440c[_0x2613('0x44')],_0x57d3dc[_0x2613('0x4e')]),_0x3e732a);if(_0x21440c[_0x2613('0x44')]['filter']){_0x2a3fe9[_0x2613('0x4f')]=_['merge'](_0x2a3fe9[_0x2613('0x4f')],{'$or':_['map'](_0x3e732a,function(_0x54cd21){if(_0x54cd21[_0x2613('0x41')]!==_0x2613('0x50')){var _0xfa7b4b={};_0xfa7b4b[_0x54cd21[_0x2613('0x3d')]]={'$like':'%'+_0x21440c[_0x2613('0x44')][_0x2613('0x51')]+'%'};return _0xfa7b4b;}})});}_0x2a3fe9=_[_0x2613('0x52')]({},_0x2a3fe9,_0x21440c[_0x2613('0x53')]);var _0x50c715={'where':_0x2a3fe9[_0x2613('0x4f')]};return db['ChatMessage']['count'](_0x50c715)[_0x2613('0x25')](function(_0x205301){_0x3094f3['count']=_0x205301;if(_0x21440c[_0x2613('0x44')][_0x2613('0x54')]){_0x2a3fe9['include']=[{'all':!![]}];}return db[_0x2613('0x3f')][_0x2613('0x55')](_0x2a3fe9);})['then'](function(_0x338cc8){_0x3094f3['rows']=_0x338cc8;return _0x3094f3;})[_0x2613('0x25')](respondWithFilteredResult(_0x3b8dd6,_0x2a3fe9))[_0x2613('0x2e')](handleError(_0x3b8dd6,null));};exports[_0x2613('0x56')]=function(_0x514475,_0x19bb1a){var _0x5571b8={'raw':!![],'where':{'id':_0x514475['params']['id']}},_0x1cf77d={};_0x1cf77d[_0x2613('0x43')]=_[_0x2613('0x45')](db['ChatMessage'][_0x2613('0x40')]);_0x1cf77d[_0x2613('0x44')]=_[_0x2613('0x45')](_0x514475[_0x2613('0x44')]);_0x1cf77d[_0x2613('0x4e')]=_[_0x2613('0x47')](_0x1cf77d['model'],_0x1cf77d[_0x2613('0x44')]);_0x5571b8[_0x2613('0x46')]=_[_0x2613('0x47')](_0x1cf77d[_0x2613('0x43')],qs[_0x2613('0x48')](_0x514475['query'][_0x2613('0x48')]));_0x5571b8[_0x2613('0x46')]=_0x5571b8[_0x2613('0x46')][_0x2613('0x49')]?_0x5571b8['attributes']:_0x1cf77d[_0x2613('0x43')];if(_0x514475['query'][_0x2613('0x54')]){_0x5571b8[_0x2613('0x57')]=[{'all':!![]}];}_0x5571b8=_[_0x2613('0x52')]({},_0x5571b8,_0x514475['options']);return db[_0x2613('0x3f')]['find'](_0x5571b8)[_0x2613('0x25')](handleEntityNotFound(_0x19bb1a,null))['then'](respondWithResult(_0x19bb1a,null))[_0x2613('0x2e')](handleError(_0x19bb1a,null));};exports['create']=function(_0x5dc20e,_0x54a11e){return db[_0x2613('0x3f')][_0x2613('0x58')](_0x5dc20e[_0x2613('0x59')],{})[_0x2613('0x25')](respondWithResult(_0x54a11e,0xc9))[_0x2613('0x2e')](handleError(_0x54a11e,null));};exports[_0x2613('0x3b')]=function(_0x4e20d1,_0x349a95){if(_0x4e20d1[_0x2613('0x59')]['id']){delete _0x4e20d1[_0x2613('0x59')]['id'];}return db[_0x2613('0x3f')][_0x2613('0x5a')]({'where':{'id':_0x4e20d1[_0x2613('0x5b')]['id']}})[_0x2613('0x25')](handleEntityNotFound(_0x349a95,null))[_0x2613('0x25')](saveUpdates(_0x4e20d1['body'],null))[_0x2613('0x25')](respondWithResult(_0x349a95,null))[_0x2613('0x2e')](handleError(_0x349a95,null));};exports[_0x2613('0x3c')]=function(_0x860e66,_0x200393){return db[_0x2613('0x3f')][_0x2613('0x5a')]({'where':{'id':_0x860e66['params']['id']}})[_0x2613('0x25')](handleEntityNotFound(_0x200393,null))[_0x2613('0x25')](removeEntity(_0x200393,null))['catch'](handleError(_0x200393,null));};exports[_0x2613('0x5c')]=function(_0x4e795d,_0x1ff9bb){return db[_0x2613('0x3f')][_0x2613('0x5c')]()['then'](respondWithResult(_0x1ff9bb,null))[_0x2613('0x2e')](handleError(_0x1ff9bb,null));};var interaction_log=require(_0x2613('0x15'))(_0x2613('0x5d'));exports[_0x2613('0x5e')]=function(_0x281fd7,_0x31e436,_0x5c76bc){var _0x33acb4={'agent':{},'channel':_0x2613('0x5f')};if(_0x281fd7[_0x2613('0x59')]['id']){delete _0x281fd7[_0x2613('0x59')]['id'];}_0x281fd7[_0x2613('0x59')][_0x2613('0x60')]=!![];_0x281fd7[_0x2613('0x59')][_0x2613('0x61')]=moment()[_0x2613('0x62')](_0x2613('0x63'));_0x281fd7[_0x2613('0x59')]['UserId']=_0x281fd7['body'][_0x2613('0x64')]||_0x281fd7['user']['id'];_0x33acb4['agent']['id']=_0x281fd7['body'][_0x2613('0x64')];return db[_0x2613('0x3f')][_0x2613('0x5a')]({'where':{'id':_0x281fd7[_0x2613('0x5b')]['id'],'UserId':null}})[_0x2613('0x25')](handleEntityNotFound(_0x31e436,null))[_0x2613('0x25')](saveUpdates(_0x281fd7['body'],null))[_0x2613('0x25')](function(_0xfe4e4f){if(_0xfe4e4f){_0x33acb4['message']=_0xfe4e4f[_0x2613('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x2613('0x5a')]({'where':{'id':_0xfe4e4f['ChatInteractionId']}});}return null;})[_0x2613('0x25')](handleEntityNotFound(_0x31e436,null))[_0x2613('0x25')](function(_0x241cf5){if(_0x241cf5){return _0x241cf5[_0x2613('0x3b')]({'UserId':_0x281fd7[_0x2613('0x59')][_0x2613('0x64')],'read1stAt':_[_0x2613('0x66')](_0x241cf5[_0x2613('0x67')])?moment()[_0x2613('0x62')](_0x2613('0x63')):undefined});}return null;})[_0x2613('0x25')](function(_0x13362b){if(_0x13362b){_0x33acb4[_0x2613('0x68')]=_0x13362b[_0x2613('0x65')]({'plain':!![]});interaction_log['info'](_0x2613('0x69'),_0x281fd7['user']['id'],_0x281fd7['user'][_0x2613('0x3d')],_0x281fd7[_0x2613('0x6a')][_0x2613('0x6b')],_0x33acb4[_0x2613('0x68')]['id'],_0x281fd7[_0x2613('0x59')]?JSON[_0x2613('0x29')](_0x281fd7[_0x2613('0x59')]):_0x2613('0x6c'));return respondWithRpcPromise(_0x2613('0x6d'),_0x2613('0x6e'),_0x33acb4);}return null;})[_0x2613('0x25')](function(_0x4bec19){var _0x1fbd5e=_0x2613('0x6f')+_0x4bec19['message'][_0x2613('0x70')];return db[_0x2613('0x71')][_0x2613('0x44')](_0x1fbd5e,{'type':db['Sequelize'][_0x2613('0x72')][_0x2613('0x73')],'raw':!![]})[_0x2613('0x25')](function(_0x417114){return _0x417114;});})[_0x2613('0x25')](function(_0x204587){if(_0x204587){_0x33acb4['message'][_0x2613('0x74')]=_0x204587[0x0];if(!_0x281fd7['body'][_0x2613('0x64')])return;return db[_0x2613('0x75')][_0x2613('0x5a')]({'where':{'id':_0x281fd7['body'][_0x2613('0x64')],'role':_0x2613('0x76')},'attributes':['id',_0x2613('0x3d'),_0x2613('0x77'),'email','internal'],'raw':!![]});}return null;})[_0x2613('0x25')](function(_0x21b89b){if(!_0x21b89b)return null;_0x33acb4[_0x2613('0x2b')][_0x2613('0x76')]=_0x21b89b;return _0x33acb4;})['then'](function(_0x10f92f){if(_0x10f92f){if(_0x281fd7[_0x2613('0x59')][_0x2613('0x78')]){_0x33acb4['message'][_0x2613('0x79')]=util[_0x2613('0x62')](_0x2613('0x7a'),_0x281fd7[_0x2613('0x6a')]['name']);_0x33acb4[_0x2613('0x2b')]['channel']=_0x33acb4['channel'];_0x33acb4[_0x2613('0x2b')]['event']=_0x2613('0x5e');return respondWithRpcPromise(_0x2613('0x7b'),_0x2613('0x7b'),{'event':_0x2613('0x7c'),'message':_['merge'](_0x33acb4[_0x2613('0x2b')],JSON[_0x2613('0x7d')](_0x33acb4[_0x2613('0x68')][_0x2613('0x7e')]))},client9002)[_0x2613('0x25')](function(){return _0x33acb4;});}return _0x33acb4;}return null;})[_0x2613('0x25')](respondWithResult(_0x31e436,null))[_0x2613('0x2e')](handleError(_0x31e436,null));};var interaction_log=require(_0x2613('0x15'))(_0x2613('0x5d'));exports[_0x2613('0x39')]=function(_0x172282,_0x5b4ce7,_0x6cca62){var _0x216687={'agent':{},'channel':_0x2613('0x5f')};if(_0x172282['body']['id']){delete _0x172282[_0x2613('0x59')]['id'];}_0x172282['body']['UserId']=_0x172282[_0x2613('0x59')][_0x2613('0x64')]||_0x172282[_0x2613('0x6a')]['id'];_0x216687['agent']['id']=_0x172282[_0x2613('0x59')]['UserId'];return db[_0x2613('0x3f')]['find']({'where':{'id':_0x172282['params']['id'],'UserId':null}})[_0x2613('0x25')](handleEntityNotFound(_0x5b4ce7,null))[_0x2613('0x25')](function(_0x4c1db9){if(_0x4c1db9){_0x216687['message']=_0x4c1db9[_0x2613('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x2613('0x5a')]({'where':{'id':_0x4c1db9['ChatInteractionId']}});}return null;})[_0x2613('0x25')](handleEntityNotFound(_0x5b4ce7,null))[_0x2613('0x25')](function(_0x4856f4){if(_0x4856f4){_0x216687[_0x2613('0x68')]=_0x4856f4[_0x2613('0x65')]({'plain':!![]});interaction_log['info'](_0x2613('0x7f'),_0x172282['user']['id'],_0x172282[_0x2613('0x6a')][_0x2613('0x3d')],_0x172282['user']['role'],_0x216687[_0x2613('0x68')]['id'],_0x172282[_0x2613('0x59')]?JSON[_0x2613('0x29')](_0x172282['body']):_0x2613('0x6c'));return respondWithRpcPromise(_0x2613('0x80'),'rejectMessage',_0x216687);}return null;})[_0x2613('0x25')](function(_0x59bcb1){var _0x15e422=_0x2613('0x6f')+_0x59bcb1[_0x2613('0x2b')][_0x2613('0x70')];return db[_0x2613('0x71')][_0x2613('0x44')](_0x15e422,{'type':db[_0x2613('0x81')][_0x2613('0x72')][_0x2613('0x73')],'raw':!![]})[_0x2613('0x25')](function(_0x502f8f){return _0x502f8f;});})[_0x2613('0x25')](function(_0x5f433b){if(_0x5f433b){_0x216687[_0x2613('0x2b')]['contact']=_0x5f433b[0x0];if(!_0x172282[_0x2613('0x59')][_0x2613('0x64')])return;return db['User']['find']({'where':{'id':_0x172282['body'][_0x2613('0x64')],'role':'agent'},'attributes':['id',_0x2613('0x3d'),_0x2613('0x77'),_0x2613('0x82'),_0x2613('0x83')],'raw':!![]});}return null;})['then'](function(_0x9aa589){if(!_0x9aa589)return null;_0x216687['message']['agent']=_0x9aa589;return _0x216687;})[_0x2613('0x25')](function(_0x543bca){if(_0x543bca){_0x543bca[_0x2613('0x2b')][_0x2613('0x79')]=util[_0x2613('0x62')](_0x2613('0x7a'),_0x172282[_0x2613('0x6a')][_0x2613('0x3d')]);_0x543bca[_0x2613('0x2b')]['channel']=_0x216687[_0x2613('0x84')];_0x543bca[_0x2613('0x2b')][_0x2613('0x85')]=_0x2613('0x39');respondWithRpcPromise(_0x2613('0x7b'),'EventManager',{'event':_0x2613('0x86'),'message':_['merge'](_0x216687[_0x2613('0x2b')],JSON[_0x2613('0x7d')](_0x216687[_0x2613('0x68')][_0x2613('0x7e')]))},client9002);return _0x216687;}return null;})[_0x2613('0x25')](respondWithResult(_0x5b4ce7,null))['catch'](handleError(_0x5b4ce7,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index cafb648..54e93c3 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 _0x4dce=['events','../../mysqldb','ChatMessage','update','remove','emit','hasOwnProperty','hook'];(function(_0x50ee80,_0x4eb140){var _0x27c452=function(_0x224846){while(--_0x224846){_0x50ee80['push'](_0x50ee80['shift']());}};_0x27c452(++_0x4eb140);}(_0x4dce,0x168));var _0xe4dc=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0x4dce[_0x3ae96c];return _0x1b0c90;};'use strict';var EventEmitter=require(_0xe4dc('0x0'));var ChatMessage=require(_0xe4dc('0x1'))['db'][_0xe4dc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4dc('0x3'),'afterDestroy':_0xe4dc('0x4')};function emitEvent(_0x49940f){return function(_0xedaf06,_0x39a1ec,_0x2d536e){ChatMessageEvents[_0xe4dc('0x5')](_0x49940f+':'+_0xedaf06['id'],_0xedaf06);ChatMessageEvents['emit'](_0x49940f,_0xedaf06);_0x2d536e(null);};}for(var e in events){if(events[_0xe4dc('0x6')](e)){var event=events[e];ChatMessage[_0xe4dc('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x34f4=['hook','exports','events','../../mysqldb','ChatMessage','save','update','emit'];(function(_0xbb08ea,_0x477c6b){var _0x1f4ebd=function(_0x2f2679){while(--_0x2f2679){_0xbb08ea['push'](_0xbb08ea['shift']());}};_0x1f4ebd(++_0x477c6b);}(_0x34f4,0xfa));var _0x434f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x34f4[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x434f('0x0'));var ChatMessage=require(_0x434f('0x1'))['db'][_0x434f('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x434f('0x3'),'afterUpdate':_0x434f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d03d6){return function(_0x112fb0,_0x540dfe,_0x5d6bfd){ChatMessageEvents[_0x434f('0x5')](_0x2d03d6+':'+_0x112fb0['id'],_0x112fb0);ChatMessageEvents[_0x434f('0x5')](_0x2d03d6,_0x112fb0);_0x5d6bfd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x434f('0x6')](e,emitEvent(event));}}module[_0x434f('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 1641594..ba24947 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 _0x0a25=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x53b92f,_0x11def7){var _0x479ae3=function(_0x108fd2){while(--_0x108fd2){_0x53b92f['push'](_0x53b92f['shift']());}};_0x479ae3(++_0x11def7);}(_0x0a25,0x68));var _0x50a2=function(_0x27cfff,_0x468e33){_0x27cfff=_0x27cfff-0x0;var _0x4051cc=_0x0a25[_0x27cfff];return _0x4051cc;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var logger=require('../../config/logger')(_0x50a2('0x2'));var moment=require(_0x50a2('0x3'));var BPromise=require('bluebird');var rp=require(_0x50a2('0x4'));var fs=require('fs');var path=require(_0x50a2('0x5'));var rimraf=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var attributes=require(_0x50a2('0x8'));module[_0x50a2('0x9')]=function(_0x33fef7,_0x8b6ba4){return _0x33fef7[_0x50a2('0xa')](_0x50a2('0xb'),attributes,{'tableName':_0x50a2('0xc'),'paranoid':![],'indexes':[{'name':_0x50a2('0xd'),'fields':[_0x50a2('0xe')],'type':_0x50a2('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x312b6c,_0x1aed2f,_0x40ccae){var _0x201e9d=_0x33fef7['models'];var _0x1862ce=_0x312b6c[_0x50a2('0x10')]({'plain':!![]});if(_0x1862ce[_0x50a2('0x11')][_0x50a2('0x12')]()==='in'||_0x1862ce[_0x50a2('0x11')][_0x50a2('0x12')]()==='out'&&!_0x1862ce[_0x50a2('0x13')]&&!_[_0x50a2('0x14')](_0x1862ce[_0x50a2('0x15')])){_0x201e9d[_0x50a2('0x16')][_0x50a2('0x17')]({'where':{'id':_0x1862ce[_0x50a2('0x18')]}})[_0x50a2('0x19')](function(_0x4062c4){if(_0x4062c4){_0x4062c4['update']({'lastMsgAt':_0x1862ce['createdAt'],'lastMsgDirection':_0x1862ce['direction'][_0x50a2('0x12')]()});}})[_0x50a2('0x1a')](function(_0x209e2f){console['error'](_0x209e2f);});}_0x40ccae();}},'charset':_0x50a2('0x1b'),'collate':_0x50a2('0x1c')});}; \ No newline at end of file +var _0x867f=['toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatMessage','body','models','get','direction','secret','isNil','UserId','ChatInteractionId'];(function(_0x5b4d22,_0x35bc3f){var _0x5b7a15=function(_0x451573){while(--_0x451573){_0x5b4d22['push'](_0x5b4d22['shift']());}};_0x5b7a15(++_0x35bc3f);}(_0x867f,0xe6));var _0xf867=function(_0x1d4d75,_0x48b6b4){_0x1d4d75=_0x1d4d75-0x0;var _0x11316d=_0x867f[_0x1d4d75];return _0x11316d;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require(_0xf867('0x7'));var rimraf=require(_0xf867('0x8'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xf867('0x9')]=function(_0x2e0691,_0x2c09b1){return _0x2e0691[_0xf867('0xa')](_0xf867('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xf867('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2494f1,_0x2b1c12,_0x1cf341){var _0xb26c33=_0x2e0691[_0xf867('0xd')];var _0x462870=_0x2494f1[_0xf867('0xe')]({'plain':!![]});if(_0x462870[_0xf867('0xf')]['toLowerCase']()==='in'||_0x462870[_0xf867('0xf')]['toLowerCase']()==='out'&&!_0x462870[_0xf867('0x10')]&&!_[_0xf867('0x11')](_0x462870[_0xf867('0x12')])){_0xb26c33['ChatInteraction']['findOne']({'where':{'id':_0x462870[_0xf867('0x13')]}})['then'](function(_0x352f0b){if(_0x352f0b){_0x352f0b['update']({'lastMsgAt':_0x462870['createdAt'],'lastMsgDirection':_0x462870[_0xf867('0xf')][_0xf867('0x14')]()});}})[_0xf867('0x15')](function(_0x13973b){console[_0xf867('0x16')](_0x13973b);});}_0x1cf341();}},'charset':_0xf867('0x17'),'collate':_0xf867('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 16ea7f1..c5b6e75 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 _0xe1f5=['ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','create','options','raw','CreateChatMessage','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x38bd99,_0x1e8c4a){var _0x1a9c8a=function(_0x3d9f57){while(--_0x3d9f57){_0x38bd99['push'](_0x38bd99['shift']());}};_0x1a9c8a(++_0x1e8c4a);}(_0xe1f5,0x1ec));var _0x5e1f=function(_0x2453d2,_0x538ab9){_0x2453d2=_0x2453d2-0x0;var _0x269727=_0xe1f5[_0x2453d2];return _0x269727;};'use strict';var _=require(_0x5e1f('0x0'));var util=require(_0x5e1f('0x1'));var moment=require('moment');var BPromise=require(_0x5e1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e1f('0x3'));var db=require(_0x5e1f('0x4'))['db'];var utils=require(_0x5e1f('0x5'));var logger=require(_0x5e1f('0x6'))('rpc');var config=require(_0x5e1f('0x7'));var jayson=require(_0x5e1f('0x8'));var client=jayson[_0x5e1f('0x9')][_0x5e1f('0xa')]({'port':0x232a});config[_0x5e1f('0xb')]=_[_0x5e1f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e1f('0xd'))(new Redis(config[_0x5e1f('0xb')]));require(_0x5e1f('0xe'))['register'](socket);function respondWithRpcPromise(_0x1108f3,_0x1213ee,_0x1ab549){return new BPromise(function(_0x7a2ebc,_0x5d0057){return client[_0x5e1f('0xf')](_0x1108f3,_0x1ab549)[_0x5e1f('0x10')](function(_0x17e9bb){logger[_0x5e1f('0x11')](_0x5e1f('0x12'),_0x1213ee,'request\x20sent');logger[_0x5e1f('0x13')](_0x5e1f('0x14'),_0x1213ee,_0x5e1f('0x15'),JSON[_0x5e1f('0x16')](_0x17e9bb));if(_0x17e9bb[_0x5e1f('0x17')]){if(_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x18')]===0x1f4){logger['error'](_0x5e1f('0x12'),_0x1213ee,_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x19')]);return _0x5d0057(_0x17e9bb[_0x5e1f('0x17')]['message']);}logger[_0x5e1f('0x17')](_0x5e1f('0x12'),_0x1213ee,_0x17e9bb['error'][_0x5e1f('0x19')]);return _0x7a2ebc(_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x19')]);}else{logger[_0x5e1f('0x11')]('ChatMessage,\x20%s,\x20%s',_0x1213ee,_0x5e1f('0x15'));_0x7a2ebc(_0x17e9bb[_0x5e1f('0x1a')][_0x5e1f('0x19')]);}})[_0x5e1f('0x1b')](function(_0x516b8c){logger[_0x5e1f('0x17')](_0x5e1f('0x12'),_0x1213ee,_0x516b8c);_0x5d0057(_0x516b8c);});});}exports['CreateChatMessage']=function(_0x3a9d50){var _0x496293=this;return new Promise(function(_0x4d7b56,_0x2d2710){return db['ChatMessage'][_0x5e1f('0x1c')](_0x3a9d50['body'],{'raw':_0x3a9d50[_0x5e1f('0x1d')]?_0x3a9d50['options'][_0x5e1f('0x1e')]===undefined?!![]:![]:!![]})[_0x5e1f('0x10')](function(_0x3cc3ec){logger[_0x5e1f('0x11')]('CreateChatMessage',_0x3a9d50);logger['debug'](_0x5e1f('0x1f'),_0x3a9d50,JSON[_0x5e1f('0x16')](_0x3cc3ec));_0x4d7b56(_0x3cc3ec);})['catch'](function(_0x35795d){logger[_0x5e1f('0x17')]('CreateChatMessage',_0x35795d[_0x5e1f('0x19')],_0x3a9d50);_0x2d2710(_0x496293[_0x5e1f('0x17')](0x1f4,_0x35795d['message']));});});}; \ No newline at end of file +var _0xa4b8=['localhost','socket.io-emitter','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','ChatMessage','create','options','raw','CreateChatMessage','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x10e74e,_0x1603ae){var _0x2198c1=function(_0x4b627c){while(--_0x4b627c){_0x10e74e['push'](_0x10e74e['shift']());}};_0x2198c1(++_0x1603ae);}(_0xa4b8,0x148));var _0x8a4b=function(_0x188a1d,_0x2249fc){_0x188a1d=_0x188a1d-0x0;var _0x43d0db=_0xa4b8[_0x188a1d];return _0x43d0db;};'use strict';var _=require(_0x8a4b('0x0'));var util=require(_0x8a4b('0x1'));var moment=require(_0x8a4b('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a4b('0x4'))['db'];var utils=require(_0x8a4b('0x5'));var logger=require(_0x8a4b('0x6'))(_0x8a4b('0x7'));var config=require(_0x8a4b('0x8'));var jayson=require(_0x8a4b('0x9'));var client=jayson[_0x8a4b('0xa')][_0x8a4b('0xb')]({'port':0x232a});config[_0x8a4b('0xc')]=_['defaults'](config[_0x8a4b('0xc')],{'host':_0x8a4b('0xd'),'port':0x18eb});var socket=require(_0x8a4b('0xe'))(new Redis(config[_0x8a4b('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x28bc23,_0x35c3f9,_0x4e2ef3){return new BPromise(function(_0x487672,_0x984371){return client[_0x8a4b('0xf')](_0x28bc23,_0x4e2ef3)[_0x8a4b('0x10')](function(_0x8e5eff){logger['info'](_0x8a4b('0x11'),_0x35c3f9,_0x8a4b('0x12'));logger[_0x8a4b('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x35c3f9,'request\x20sent',JSON[_0x8a4b('0x14')](_0x8e5eff));if(_0x8e5eff[_0x8a4b('0x15')]){if(_0x8e5eff[_0x8a4b('0x15')][_0x8a4b('0x16')]===0x1f4){logger[_0x8a4b('0x15')](_0x8a4b('0x11'),_0x35c3f9,_0x8e5eff[_0x8a4b('0x15')][_0x8a4b('0x17')]);return _0x984371(_0x8e5eff[_0x8a4b('0x15')][_0x8a4b('0x17')]);}logger[_0x8a4b('0x15')](_0x8a4b('0x11'),_0x35c3f9,_0x8e5eff['error'][_0x8a4b('0x17')]);return _0x487672(_0x8e5eff['error'][_0x8a4b('0x17')]);}else{logger[_0x8a4b('0x18')](_0x8a4b('0x11'),_0x35c3f9,_0x8a4b('0x12'));_0x487672(_0x8e5eff['result'][_0x8a4b('0x17')]);}})['catch'](function(_0x3358d7){logger['error'](_0x8a4b('0x11'),_0x35c3f9,_0x3358d7);_0x984371(_0x3358d7);});});}exports['CreateChatMessage']=function(_0xb1ed29){var _0x58ce77=this;return new Promise(function(_0xc379fc,_0x3d18c7){return db[_0x8a4b('0x19')][_0x8a4b('0x1a')](_0xb1ed29['body'],{'raw':_0xb1ed29[_0x8a4b('0x1b')]?_0xb1ed29[_0x8a4b('0x1b')][_0x8a4b('0x1c')]===undefined?!![]:![]:!![]})[_0x8a4b('0x10')](function(_0x5c8dad){logger[_0x8a4b('0x18')](_0x8a4b('0x1d'),_0xb1ed29);logger[_0x8a4b('0x13')](_0x8a4b('0x1d'),_0xb1ed29,JSON[_0x8a4b('0x14')](_0x5c8dad));_0xc379fc(_0x5c8dad);})[_0x8a4b('0x1e')](function(_0x19a532){logger[_0x8a4b('0x15')](_0x8a4b('0x1d'),_0x19a532['message'],_0xb1ed29);_0x3d18c7(_0x58ce77[_0x8a4b('0x15')](0x1f4,_0x19a532[_0x8a4b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 63cd73d..aa3536a 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 _0x8ca9=['length','chatMessage:','./chatMessage.events','save','remove','update','register'];(function(_0x528ddb,_0x217878){var _0x1c66af=function(_0x50c3af){while(--_0x50c3af){_0x528ddb['push'](_0x528ddb['shift']());}};_0x1c66af(++_0x217878);}(_0x8ca9,0x9c));var _0x98ca=function(_0x49e835,_0x899b00){_0x49e835=_0x49e835-0x0;var _0x5d5249=_0x8ca9[_0x49e835];return _0x5d5249;};'use strict';var ChatMessageEvents=require(_0x98ca('0x0'));var events=[_0x98ca('0x1'),_0x98ca('0x2'),_0x98ca('0x3')];function createListener(_0x3d9153,_0x22047f){return function(_0xe479d6){_0x22047f['emit'](_0x3d9153,_0xe479d6);};}function removeListener(_0x4c230f,_0x142793){return function(){ChatMessageEvents['removeListener'](_0x4c230f,_0x142793);};}exports[_0x98ca('0x4')]=function(_0x48415d){for(var _0x219619=0x0,_0xca4097=events[_0x98ca('0x5')];_0x219619<_0xca4097;_0x219619++){var _0x2852a0=events[_0x219619];var _0x323c95=createListener(_0x98ca('0x6')+_0x2852a0,_0x48415d);ChatMessageEvents['on'](_0x2852a0,_0x323c95);}}; \ No newline at end of file +var _0x885a=['save','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x885a,0x180));var _0xa885=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x885a[_0x2be8c2];return _0x97f531;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa885('0x0'),_0xa885('0x1'),_0xa885('0x2')];function createListener(_0x2e4bc8,_0x573a2b){return function(_0xcf0656){_0x573a2b[_0xa885('0x3')](_0x2e4bc8,_0xcf0656);};}function removeListener(_0x2386ec,_0x106e16){return function(){ChatMessageEvents[_0xa885('0x4')](_0x2386ec,_0x106e16);};}exports[_0xa885('0x5')]=function(_0x5dfd7e){for(var _0x7ac6bd=0x0,_0x1200c7=events[_0xa885('0x6')];_0x7ac6bd<_0x1200c7;_0x7ac6bd++){var _0x546175=events[_0x7ac6bd];var _0x6b26e2=createListener(_0xa885('0x7')+_0x546175,_0x5dfd7e);ChatMessageEvents['on'](_0x546175,_0x6b26e2);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6e364af..50608ff 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 _0xa69c=['tracked','chat','chatmessage:create','put','/:id','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','post'];(function(_0x5a306f,_0x82e4db){var _0x2bc4e5=function(_0x339009){while(--_0x339009){_0x5a306f['push'](_0x5a306f['shift']());}};_0x2bc4e5(++_0x82e4db);}(_0xa69c,0x137));var _0xca69=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0xa69c[_0x2e249d];return _0x1faa37;};'use strict';var multer=require(_0xca69('0x0'));var util=require(_0xca69('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xca69('0x2'));var interaction=require(_0xca69('0x3'));var config=require(_0xca69('0x4'));var controller=require(_0xca69('0x5'));router[_0xca69('0x6')]('/',auth['isAuthenticated'](),controller[_0xca69('0x7')]);router['get'](_0xca69('0x8'),auth[_0xca69('0x9')](),controller['describe']);router['get']('/:id',auth[_0xca69('0x9')](),controller['show']);router[_0xca69('0xa')]('/',auth[_0xca69('0x9')](),interaction[_0xca69('0xb')](_0xca69('0xc'),_0xca69('0xd')),controller['create']);router[_0xca69('0xe')](_0xca69('0xf'),controller[_0xca69('0x10')]);router[_0xca69('0xe')](_0xca69('0x11'),auth[_0xca69('0x9')](),controller[_0xca69('0x12')]);router[_0xca69('0xe')]('/:id/reject',auth['isAuthenticated'](),controller[_0xca69('0x13')]);router[_0xca69('0x14')](_0xca69('0xf'),auth[_0xca69('0x9')](),controller[_0xca69('0x15')]);module[_0xca69('0x16')]=router; \ No newline at end of file +var _0x5915=['./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x11e897,_0x322b80){var _0x3160a1=function(_0x4aca2c){while(--_0x4aca2c){_0x11e897['push'](_0x11e897['shift']());}};_0x3160a1(++_0x322b80);}(_0x5915,0x13e));var _0x5591=function(_0x575092,_0x18c8d){_0x575092=_0x575092-0x0;var _0x559c86=_0x5915[_0x575092];return _0x559c86;};'use strict';var multer=require(_0x5591('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5591('0x1'));var express=require(_0x5591('0x2'));var router=express[_0x5591('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5591('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5591('0x5'));var controller=require(_0x5591('0x6'));router[_0x5591('0x7')]('/',auth[_0x5591('0x8')](),controller['index']);router[_0x5591('0x7')](_0x5591('0x9'),auth[_0x5591('0x8')](),controller[_0x5591('0xa')]);router['get'](_0x5591('0xb'),auth[_0x5591('0x8')](),controller[_0x5591('0xc')]);router[_0x5591('0xd')]('/',auth['isAuthenticated'](),interaction[_0x5591('0xe')](_0x5591('0xf'),_0x5591('0x10')),controller[_0x5591('0x11')]);router[_0x5591('0x12')](_0x5591('0xb'),controller[_0x5591('0x13')]);router['put'](_0x5591('0x14'),auth['isAuthenticated'](),controller[_0x5591('0x15')]);router[_0x5591('0x12')](_0x5591('0x16'),auth[_0x5591('0x8')](),controller[_0x5591('0x17')]);router[_0x5591('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x5591('0x19')]);module[_0x5591('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 016e027..d62d3de 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 _0xb6b6=['exports','TEXT','medium','sequelize'];(function(_0x5924ad,_0x111d9c){var _0x334a3e=function(_0x35d9d1){while(--_0x35d9d1){_0x5924ad['push'](_0x5924ad['shift']());}};_0x334a3e(++_0x111d9c);}(_0xb6b6,0xff));var _0x6b6b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb6b6[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x6b6b('0x0'));module[_0x6b6b('0x1')]={'body':{'type':Sequelize[_0x6b6b('0x2')](_0x6b6b('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x08a4=['exports','TEXT','sequelize'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x08a4,0x179));var _0x408a=function(_0x2730b1,_0x16228c){_0x2730b1=_0x2730b1-0x0;var _0x59ddaf=_0x08a4[_0x2730b1];return _0x59ddaf;};'use strict';var Sequelize=require(_0x408a('0x0'));module[_0x408a('0x1')]={'body':{'type':Sequelize[_0x408a('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 217b33a..9a329ba 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(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x7a54,0x106));var _0x47a5=function(_0x47b865,_0x3d923a){_0x47b865=_0x47b865-0x0;var _0x263ecc=_0x7a54[_0x47b865];return _0x263ecc;};'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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0xb591bc,_0x10cc5c){_0xb591bc=_0xb591bc-0x0;var _0x421e85=_0x7a54[_0xb591bc];return _0x421e85;};'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 44bb649..e95c895 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 _0x64ea=['../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x64ea,0x85));var _0xa64e=function(_0x84a189,_0x323ae4){_0x84a189=_0x84a189-0x0;var _0x476af8=_0x64ea[_0x84a189];return _0x476af8;};'use strict';var _=require(_0xa64e('0x0'));var util=require(_0xa64e('0x1'));var logger=require('../../config/logger')(_0xa64e('0x2'));var moment=require(_0xa64e('0x3'));var BPromise=require(_0xa64e('0x4'));var rp=require(_0xa64e('0x5'));var fs=require('fs');var path=require(_0xa64e('0x6'));var rimraf=require('rimraf');var config=require(_0xa64e('0x7'));var attributes=require(_0xa64e('0x8'));module[_0xa64e('0x9')]=function(_0x2de147,_0xdf2e51){return _0x2de147[_0xa64e('0xa')](_0xa64e('0xb'),attributes,{'tableName':_0xa64e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa64e('0xd')});}; \ No newline at end of file +var _0x8deb=['api','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','lodash','../../config/logger'];(function(_0x3f01f3,_0x349480){var _0x144a47=function(_0x14d5dc){while(--_0x14d5dc){_0x3f01f3['push'](_0x3f01f3['shift']());}};_0x144a47(++_0x349480);}(_0x8deb,0x9a));var _0xb8de=function(_0x4496df,_0x1ae2f4){_0x4496df=_0x4496df-0x0;var _0x5123c2=_0x8deb[_0x4496df];return _0x5123c2;};'use strict';var _=require(_0xb8de('0x0'));var util=require('util');var logger=require(_0xb8de('0x1'))(_0xb8de('0x2'));var moment=require(_0xb8de('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8de('0x4'));var fs=require('fs');var path=require(_0xb8de('0x5'));var rimraf=require(_0xb8de('0x6'));var config=require('../../config/environment');var attributes=require(_0xb8de('0x7'));module[_0xb8de('0x8')]=function(_0x2c8800,_0x455e83){return _0x2c8800[_0xb8de('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0xb8de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb8de('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f00e0f2..7320ab9 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 _0x5862=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2d819b,_0x321af5){var _0x3799fd=function(_0x50090b){while(--_0x50090b){_0x2d819b['push'](_0x2d819b['shift']());}};_0x3799fd(++_0x321af5);}(_0x5862,0xd8));var _0x2586=function(_0x885280,_0x342370){_0x885280=_0x885280-0x0;var _0xfeef11=_0x5862[_0x885280];return _0xfeef11;};'use strict';var _=require(_0x2586('0x0'));var util=require(_0x2586('0x1'));var moment=require(_0x2586('0x2'));var BPromise=require(_0x2586('0x3'));var rs=require(_0x2586('0x4'));var fs=require('fs');var Redis=require(_0x2586('0x5'));var db=require(_0x2586('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2586('0x7'));var config=require('../../config/environment');var jayson=require(_0x2586('0x8'));var client=jayson['client'][_0x2586('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37cc5d,_0x4c80d4,_0x105893){return new BPromise(function(_0x367972,_0x47e1ff){return client[_0x2586('0xa')](_0x37cc5d,_0x105893)[_0x2586('0xb')](function(_0x58dc10){logger[_0x2586('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4c80d4,_0x2586('0xd'));logger['debug'](_0x2586('0xe'),_0x4c80d4,_0x2586('0xd'),JSON[_0x2586('0xf')](_0x58dc10));if(_0x58dc10['error']){if(_0x58dc10[_0x2586('0x10')][_0x2586('0x11')]===0x1f4){logger[_0x2586('0x10')](_0x2586('0x12'),_0x4c80d4,_0x58dc10[_0x2586('0x10')][_0x2586('0x13')]);return _0x47e1ff(_0x58dc10['error'][_0x2586('0x13')]);}logger[_0x2586('0x10')](_0x2586('0x12'),_0x4c80d4,_0x58dc10[_0x2586('0x10')][_0x2586('0x13')]);return _0x367972(_0x58dc10[_0x2586('0x10')]['message']);}else{logger[_0x2586('0xc')](_0x2586('0x12'),_0x4c80d4,_0x2586('0xd'));_0x367972(_0x58dc10[_0x2586('0x14')][_0x2586('0x13')]);}})['catch'](function(_0x205ec5){logger[_0x2586('0x10')](_0x2586('0x12'),_0x4c80d4,_0x205ec5);_0x47e1ff(_0x205ec5);});});} \ No newline at end of file +var _0x713d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','request\x20sent','catch','util'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x713d,0x16f));var _0xd713=function(_0x335bbf,_0x45ec79){_0x335bbf=_0x335bbf-0x0;var _0x3b77bc=_0x713d[_0x335bbf];return _0x3b77bc;};'use strict';var _=require('lodash');var util=require(_0xd713('0x0'));var moment=require(_0xd713('0x1'));var BPromise=require(_0xd713('0x2'));var rs=require(_0xd713('0x3'));var fs=require('fs');var Redis=require(_0xd713('0x4'));var db=require(_0xd713('0x5'))['db'];var utils=require(_0xd713('0x6'));var logger=require(_0xd713('0x7'))(_0xd713('0x8'));var config=require(_0xd713('0x9'));var jayson=require(_0xd713('0xa'));var client=jayson['client'][_0xd713('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x304b8f,_0x55d5ab,_0x11cba5){return new BPromise(function(_0x383dda,_0x3ed51f){return client[_0xd713('0xc')](_0x304b8f,_0x11cba5)[_0xd713('0xd')](function(_0x58d702){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x55d5ab,'request\x20sent');logger[_0xd713('0xe')](_0xd713('0xf'),_0x55d5ab,'request\x20sent',JSON[_0xd713('0x10')](_0x58d702));if(_0x58d702[_0xd713('0x11')]){if(_0x58d702[_0xd713('0x11')]['code']===0x1f4){logger['error'](_0xd713('0x12'),_0x55d5ab,_0x58d702[_0xd713('0x11')]['message']);return _0x3ed51f(_0x58d702[_0xd713('0x11')][_0xd713('0x13')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x55d5ab,_0x58d702['error']['message']);return _0x383dda(_0x58d702['error'][_0xd713('0x13')]);}else{logger[_0xd713('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x55d5ab,_0xd713('0x15'));_0x383dda(_0x58d702['result'][_0xd713('0x13')]);}})[_0xd713('0x16')](function(_0x229aaf){logger[_0xd713('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x55d5ab,_0x229aaf);_0x3ed51f(_0x229aaf);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3b82be9..447b672 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 _0xa11e=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xa11e,0x17f));var _0xea11=function(_0x493f9d,_0x1ecb90){_0x493f9d=_0x493f9d-0x0;var _0x1bf985=_0xa11e[_0x493f9d];return _0x1bf985;};'use strict';var multer=require(_0xea11('0x0'));var util=require(_0xea11('0x1'));var path=require(_0xea11('0x2'));var timeout=require(_0xea11('0x3'));var express=require('express');var router=express[_0xea11('0x4')]();var fs_extra=require(_0xea11('0x5'));var auth=require(_0xea11('0x6'));var interaction=require(_0xea11('0x7'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xea11('0x8')]('/',auth[_0xea11('0x9')](),controller[_0xea11('0xa')]);router[_0xea11('0x8')](_0xea11('0xb'),auth[_0xea11('0x9')](),controller[_0xea11('0xc')]);router[_0xea11('0x8')](_0xea11('0xd'),auth[_0xea11('0x9')](),controller[_0xea11('0xe')]);router[_0xea11('0xf')]('/',auth[_0xea11('0x9')](),controller['create']);router[_0xea11('0x10')](_0xea11('0xd'),auth[_0xea11('0x9')](),controller[_0xea11('0x11')]);router[_0xea11('0x12')](_0xea11('0xd'),auth[_0xea11('0x9')](),controller[_0xea11('0x13')]);module[_0xea11('0x14')]=router; \ No newline at end of file +var _0x0f42=['/describe','describe','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x25b439,_0x294b12){var _0x361237=function(_0x22b424){while(--_0x22b424){_0x25b439['push'](_0x25b439['shift']());}};_0x361237(++_0x294b12);}(_0x0f42,0x184));var _0x20f4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0f42[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var path=require(_0x20f4('0x2'));var timeout=require(_0x20f4('0x3'));var express=require('express');var router=express[_0x20f4('0x4')]();var fs_extra=require(_0x20f4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x20f4('0x8')]('/',auth[_0x20f4('0x9')](),controller[_0x20f4('0xa')]);router[_0x20f4('0x8')](_0x20f4('0xb'),auth[_0x20f4('0x9')](),controller[_0x20f4('0xc')]);router[_0x20f4('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x20f4('0xd')]('/',auth[_0x20f4('0x9')](),controller[_0x20f4('0xe')]);router[_0x20f4('0xf')](_0x20f4('0x10'),auth[_0x20f4('0x9')](),controller[_0x20f4('0x11')]);router[_0x20f4('0x12')](_0x20f4('0x10'),auth[_0x20f4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0ad540a..fc2962c 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 _0xbd0e=['mouseOver','exports','STRING'];(function(_0x3e2756,_0x159e1d){var _0x39a4d1=function(_0x5d9380){while(--_0x5d9380){_0x3e2756['push'](_0x3e2756['shift']());}};_0x39a4d1(++_0x159e1d);}(_0xbd0e,0x85));var _0xebd0=function(_0x499001,_0x3f27ae){_0x499001=_0x499001-0x0;var _0x320c65=_0xbd0e[_0x499001];return _0x320c65;};'use strict';var Sequelize=require('sequelize');module[_0xebd0('0x0')]={'name':{'type':Sequelize[_0xebd0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xebd0('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf86e=['mouseOver','timeout','INTEGER','sequelize','exports','ENUM'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0xf86e,0x10b));var _0xef86=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xf86e[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0xef86('0x0'));module[_0xef86('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xef86('0x2')](_0xef86('0x3'),_0xef86('0x4')),'defaultValue':_0xef86('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xef86('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 08134d5..f95bb2f 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 _0xc92f=['ChatProactiveAction','find','catch','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options'];(function(_0x219a5f,_0x484570){var _0x1d6398=function(_0x377347){while(--_0x377347){_0x219a5f['push'](_0x219a5f['shift']());}};_0x1d6398(++_0x484570);}(_0xc92f,0xf3));var _0xfc92=function(_0x19bb98,_0x310023){_0x19bb98=_0x19bb98-0x0;var _0x32c5a0=_0xc92f[_0x19bb98];return _0x32c5a0;};'use strict';var emlformat=require(_0xfc92('0x0'));var rimraf=require(_0xfc92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc92('0x2'));var rp=require(_0xfc92('0x3'));var moment=require(_0xfc92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc92('0x5'));var util=require(_0xfc92('0x6'));var path=require(_0xfc92('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfc92('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc92('0x9'));var squel=require('squel');var crypto=require(_0xfc92('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfc92('0xb'));var toCsv=require(_0xfc92('0xc'));var querystring=require(_0xfc92('0xd'));var Papa=require('papaparse');var Redis=require(_0xfc92('0xe'));var authService=require(_0xfc92('0xf'));var qs=require(_0xfc92('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc92('0x11'));var logger=require(_0xfc92('0x12'))(_0xfc92('0x13'));var utils=require(_0xfc92('0x14'));var config=require(_0xfc92('0x15'));var licenseUtil=require(_0xfc92('0x16'));var db=require(_0xfc92('0x17'))['db'];function respondWithStatusCode(_0x17b4e6,_0x115a0f){_0x115a0f=_0x115a0f||0xcc;return function(_0x75fb72){if(_0x75fb72){return _0x17b4e6[_0xfc92('0x18')](_0x115a0f);}return _0x17b4e6[_0xfc92('0x19')](_0x115a0f)['end']();};}function respondWithResult(_0x55d532,_0x4bb1ca){_0x4bb1ca=_0x4bb1ca||0xc8;return function(_0x208c9c){if(_0x208c9c){return _0x55d532[_0xfc92('0x19')](_0x4bb1ca)['json'](_0x208c9c);}};}function respondWithFilteredResult(_0x213025,_0x15ee68){return function(_0x3abcf3){if(_0x3abcf3){var _0xbd6dee=typeof _0x15ee68[_0xfc92('0x1a')]===_0xfc92('0x1b')&&typeof _0x15ee68['limit']===_0xfc92('0x1b');var _0x458f20=_0x3abcf3[_0xfc92('0x1c')];var _0xcb8866=_0xbd6dee?0x0:_0x15ee68['offset'];var _0x5d9a30=_0xbd6dee?_0x3abcf3[_0xfc92('0x1c')]:_0x15ee68[_0xfc92('0x1a')]+_0x15ee68['limit'];var _0x21b7ef;if(_0x5d9a30>=_0x458f20){_0x5d9a30=_0x458f20;_0x21b7ef=0xc8;}else{_0x21b7ef=0xce;}_0x213025[_0xfc92('0x19')](_0x21b7ef);return _0x213025['set'](_0xfc92('0x1d'),_0xcb8866+'-'+_0x5d9a30+'/'+_0x458f20)['json'](_0x3abcf3);}return null;};}function patchUpdates(_0x376551){return function(_0x35ad35){try{jsonpatch[_0xfc92('0x1e')](_0x35ad35,_0x376551,!![]);}catch(_0x284669){return BPromise[_0xfc92('0x1f')](_0x284669);}return _0x35ad35[_0xfc92('0x20')]();};}function saveUpdates(_0x4ea927,_0x194587){return function(_0x539e74){if(_0x539e74){return _0x539e74[_0xfc92('0x21')](_0x4ea927)[_0xfc92('0x22')](function(_0x3aa7f6){return _0x3aa7f6;});}return null;};}function removeEntity(_0x55d9da,_0x4bb9ea){return function(_0x58a82e){if(_0x58a82e){return _0x58a82e['destroy']()[_0xfc92('0x22')](function(){_0x55d9da[_0xfc92('0x19')](0xcc)[_0xfc92('0x23')]();});}};}function handleEntityNotFound(_0x181d17,_0x3abd84){return function(_0xa43f14){if(!_0xa43f14){_0x181d17[_0xfc92('0x18')](0x194);}return _0xa43f14;};}function handleError(_0x156370,_0x532e5d){_0x532e5d=_0x532e5d||0x1f4;return function(_0x2da1f9){logger[_0xfc92('0x24')](_0x2da1f9[_0xfc92('0x25')]);if(_0x2da1f9['name']){delete _0x2da1f9[_0xfc92('0x26')];}_0x156370[_0xfc92('0x19')](_0x532e5d)['send'](_0x2da1f9);};}exports['show']=function(_0x25de92,_0x1465d4){var _0x58d37a={'raw':!![],'where':{'id':_0x25de92['params']['id']}},_0x3b52d6={};_0x3b52d6[_0xfc92('0x27')]=_[_0xfc92('0x28')](db['ChatProactiveAction'][_0xfc92('0x29')]);_0x3b52d6[_0xfc92('0x2a')]=_[_0xfc92('0x28')](_0x25de92[_0xfc92('0x2a')]);_0x3b52d6[_0xfc92('0x2b')]=_[_0xfc92('0x2c')](_0x3b52d6[_0xfc92('0x27')],_0x3b52d6[_0xfc92('0x2a')]);_0x58d37a[_0xfc92('0x2d')]=_['intersection'](_0x3b52d6['model'],qs[_0xfc92('0x2e')](_0x25de92['query'][_0xfc92('0x2e')]));_0x58d37a[_0xfc92('0x2d')]=_0x58d37a[_0xfc92('0x2d')][_0xfc92('0x2f')]?_0x58d37a['attributes']:_0x3b52d6['model'];if(_0x25de92[_0xfc92('0x2a')][_0xfc92('0x30')]){_0x58d37a[_0xfc92('0x31')]=[{'all':!![]}];}_0x58d37a=_[_0xfc92('0x32')]({},_0x58d37a,_0x25de92[_0xfc92('0x33')]);return db[_0xfc92('0x34')][_0xfc92('0x35')](_0x58d37a)['then'](handleEntityNotFound(_0x1465d4,null))[_0xfc92('0x22')](respondWithResult(_0x1465d4,null))[_0xfc92('0x36')](handleError(_0x1465d4,null));};exports[_0xfc92('0x37')]=function(_0x33e252,_0x4e8cbb){return db[_0xfc92('0x34')]['create'](_0x33e252['body'],{})[_0xfc92('0x22')](respondWithResult(_0x4e8cbb,0xc9))[_0xfc92('0x36')](handleError(_0x4e8cbb,null));};exports[_0xfc92('0x21')]=function(_0x55ea34,_0x12c9e6){if(_0x55ea34['body']['id']){delete _0x55ea34[_0xfc92('0x38')]['id'];}return db[_0xfc92('0x34')]['find']({'where':{'id':_0x55ea34[_0xfc92('0x39')]['id']}})[_0xfc92('0x22')](handleEntityNotFound(_0x12c9e6,null))['then'](saveUpdates(_0x55ea34[_0xfc92('0x38')],null))[_0xfc92('0x22')](respondWithResult(_0x12c9e6,null))[_0xfc92('0x36')](handleError(_0x12c9e6,null));};exports[_0xfc92('0x3a')]=function(_0x5d3a14,_0x57dfe2){return db[_0xfc92('0x34')][_0xfc92('0x35')]({'where':{'id':_0x5d3a14[_0xfc92('0x39')]['id']}})['then'](handleEntityNotFound(_0x57dfe2,null))['then'](removeEntity(_0x57dfe2,null))[_0xfc92('0x36')](handleError(_0x57dfe2,null));}; \ No newline at end of file +var _0xe4b8=['sox','to-csv','fs-extra','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','reject','update','then','destroy','end','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0xe4b8,0x179));var _0x8e4b=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xe4b8[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0x8e4b('0x0'));var rimraf=require(_0x8e4b('0x1'));var zipdir=require(_0x8e4b('0x2'));var jsonpatch=require(_0x8e4b('0x3'));var rp=require(_0x8e4b('0x4'));var moment=require(_0x8e4b('0x5'));var BPromise=require(_0x8e4b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e4b('0x7'));var sox=require(_0x8e4b('0x8'));var csv=require(_0x8e4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e4b('0xa'));var _=require('lodash');var squel=require(_0x8e4b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8e4b('0xc'));var Redis=require('ioredis');var authService=require(_0x8e4b('0xd'));var qs=require(_0x8e4b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e4b('0xf'));var logger=require(_0x8e4b('0x10'))(_0x8e4b('0x11'));var utils=require('../../config/utils');var config=require(_0x8e4b('0x12'));var licenseUtil=require(_0x8e4b('0x13'));var db=require(_0x8e4b('0x14'))['db'];function respondWithStatusCode(_0x13f8a6,_0x30b1c8){_0x30b1c8=_0x30b1c8||0xcc;return function(_0x30d9d1){if(_0x30d9d1){return _0x13f8a6[_0x8e4b('0x15')](_0x30b1c8);}return _0x13f8a6[_0x8e4b('0x16')](_0x30b1c8)['end']();};}function respondWithResult(_0x5f56fb,_0x2e8e71){_0x2e8e71=_0x2e8e71||0xc8;return function(_0x261e76){if(_0x261e76){return _0x5f56fb[_0x8e4b('0x16')](_0x2e8e71)[_0x8e4b('0x17')](_0x261e76);}};}function respondWithFilteredResult(_0x276d96,_0x4d10fd){return function(_0x4b0197){if(_0x4b0197){var _0xfff6b=typeof _0x4d10fd['offset']==='undefined'&&typeof _0x4d10fd[_0x8e4b('0x18')]==='undefined';var _0x38cbf5=_0x4b0197['count'];var _0x444c19=_0xfff6b?0x0:_0x4d10fd[_0x8e4b('0x19')];var _0x4b2458=_0xfff6b?_0x4b0197['count']:_0x4d10fd[_0x8e4b('0x19')]+_0x4d10fd[_0x8e4b('0x18')];var _0x38d4a7;if(_0x4b2458>=_0x38cbf5){_0x4b2458=_0x38cbf5;_0x38d4a7=0xc8;}else{_0x38d4a7=0xce;}_0x276d96[_0x8e4b('0x16')](_0x38d4a7);return _0x276d96[_0x8e4b('0x1a')](_0x8e4b('0x1b'),_0x444c19+'-'+_0x4b2458+'/'+_0x38cbf5)[_0x8e4b('0x17')](_0x4b0197);}return null;};}function patchUpdates(_0x27f816){return function(_0x9eeb68){try{jsonpatch[_0x8e4b('0x1c')](_0x9eeb68,_0x27f816,!![]);}catch(_0x123017){return BPromise[_0x8e4b('0x1d')](_0x123017);}return _0x9eeb68['save']();};}function saveUpdates(_0xa4c5ad,_0x16ff18){return function(_0x5f3043){if(_0x5f3043){return _0x5f3043[_0x8e4b('0x1e')](_0xa4c5ad)[_0x8e4b('0x1f')](function(_0x54b17e){return _0x54b17e;});}return null;};}function removeEntity(_0x2bd4e7,_0x719300){return function(_0x5e8915){if(_0x5e8915){return _0x5e8915[_0x8e4b('0x20')]()[_0x8e4b('0x1f')](function(){_0x2bd4e7['status'](0xcc)[_0x8e4b('0x21')]();});}};}function handleEntityNotFound(_0x2b29a4,_0xbd7008){return function(_0x376202){if(!_0x376202){_0x2b29a4[_0x8e4b('0x15')](0x194);}return _0x376202;};}function handleError(_0x43a92d,_0x535f71){_0x535f71=_0x535f71||0x1f4;return function(_0x395927){logger['error'](_0x395927['stack']);if(_0x395927[_0x8e4b('0x22')]){delete _0x395927[_0x8e4b('0x22')];}_0x43a92d['status'](_0x535f71)[_0x8e4b('0x23')](_0x395927);};}exports['show']=function(_0x6d7fbd,_0x5c5c34){var _0x2fd8da={'raw':!![],'where':{'id':_0x6d7fbd[_0x8e4b('0x24')]['id']}},_0xe991c2={};_0xe991c2[_0x8e4b('0x25')]=_[_0x8e4b('0x26')](db[_0x8e4b('0x27')][_0x8e4b('0x28')]);_0xe991c2[_0x8e4b('0x29')]=_['keys'](_0x6d7fbd['query']);_0xe991c2[_0x8e4b('0x2a')]=_[_0x8e4b('0x2b')](_0xe991c2[_0x8e4b('0x25')],_0xe991c2[_0x8e4b('0x29')]);_0x2fd8da[_0x8e4b('0x2c')]=_[_0x8e4b('0x2b')](_0xe991c2[_0x8e4b('0x25')],qs[_0x8e4b('0x2d')](_0x6d7fbd['query'][_0x8e4b('0x2d')]));_0x2fd8da[_0x8e4b('0x2c')]=_0x2fd8da[_0x8e4b('0x2c')][_0x8e4b('0x2e')]?_0x2fd8da[_0x8e4b('0x2c')]:_0xe991c2['model'];if(_0x6d7fbd[_0x8e4b('0x29')][_0x8e4b('0x2f')]){_0x2fd8da[_0x8e4b('0x30')]=[{'all':!![]}];}_0x2fd8da=_[_0x8e4b('0x31')]({},_0x2fd8da,_0x6d7fbd[_0x8e4b('0x32')]);return db[_0x8e4b('0x27')][_0x8e4b('0x33')](_0x2fd8da)[_0x8e4b('0x1f')](handleEntityNotFound(_0x5c5c34,null))['then'](respondWithResult(_0x5c5c34,null))[_0x8e4b('0x34')](handleError(_0x5c5c34,null));};exports[_0x8e4b('0x35')]=function(_0x1451ed,_0xe5eecf){return db[_0x8e4b('0x27')][_0x8e4b('0x35')](_0x1451ed[_0x8e4b('0x36')],{})[_0x8e4b('0x1f')](respondWithResult(_0xe5eecf,0xc9))[_0x8e4b('0x34')](handleError(_0xe5eecf,null));};exports[_0x8e4b('0x1e')]=function(_0x29c967,_0xe9e112){if(_0x29c967[_0x8e4b('0x36')]['id']){delete _0x29c967['body']['id'];}return db[_0x8e4b('0x27')]['find']({'where':{'id':_0x29c967[_0x8e4b('0x24')]['id']}})[_0x8e4b('0x1f')](handleEntityNotFound(_0xe9e112,null))['then'](saveUpdates(_0x29c967[_0x8e4b('0x36')],null))['then'](respondWithResult(_0xe9e112,null))[_0x8e4b('0x34')](handleError(_0xe9e112,null));};exports[_0x8e4b('0x20')]=function(_0xd466d,_0x15a82f){return db[_0x8e4b('0x27')]['find']({'where':{'id':_0xd466d['params']['id']}})[_0x8e4b('0x1f')](handleEntityNotFound(_0x15a82f,null))[_0x8e4b('0x1f')](removeEntity(_0x15a82f,null))[_0x8e4b('0x34')](handleError(_0x15a82f,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 2dfbf88..4b89618 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 _0x9f81=['ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define'];(function(_0x3008d6,_0x558308){var _0x41884d=function(_0xcf1d1f){while(--_0xcf1d1f){_0x3008d6['push'](_0x3008d6['shift']());}};_0x41884d(++_0x558308);}(_0x9f81,0x1ca));var _0x19f8=function(_0x404597,_0x4f4cae){_0x404597=_0x404597-0x0;var _0x1ce904=_0x9f81[_0x404597];return _0x1ce904;};'use strict';var _=require(_0x19f8('0x0'));var util=require(_0x19f8('0x1'));var logger=require('../../config/logger')(_0x19f8('0x2'));var moment=require(_0x19f8('0x3'));var BPromise=require(_0x19f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19f8('0x5'));var rimraf=require(_0x19f8('0x6'));var config=require('../../config/environment');var attributes=require(_0x19f8('0x7'));module[_0x19f8('0x8')]=function(_0x46552d,_0x19fca0){return _0x46552d[_0x19f8('0x9')](_0x19f8('0xa'),attributes,{'tableName':_0x19f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f13=['request-promise','path','./chatProactiveAction.attributes','ChatProactiveAction','lodash','util','../../config/logger','api'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9f13,0x74));var _0x39f1=function(_0x249dfe,_0x21f85c){_0x249dfe=_0x249dfe-0x0;var _0xc7c7be=_0x9f13[_0x249dfe];return _0xc7c7be;};'use strict';var _=require(_0x39f1('0x0'));var util=require(_0x39f1('0x1'));var logger=require(_0x39f1('0x2'))(_0x39f1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x39f1('0x4'));var fs=require('fs');var path=require(_0x39f1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x39f1('0x6'));module['exports']=function(_0x1512c0,_0x1af335){return _0x1512c0['define'](_0x39f1('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index a8d8786..1f9cfe8 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 _0xb159=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0xb159,0x91));var _0x9b15=function(_0x465643,_0x44dc4e){_0x465643=_0x465643-0x0;var _0x38ab86=_0xb159[_0x465643];return _0x38ab86;};'use strict';var _=require(_0x9b15('0x0'));var util=require(_0x9b15('0x1'));var moment=require(_0x9b15('0x2'));var BPromise=require(_0x9b15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b15('0x4'));var db=require(_0x9b15('0x5'))['db'];var utils=require(_0x9b15('0x6'));var logger=require('../../config/logger')(_0x9b15('0x7'));var config=require(_0x9b15('0x8'));var jayson=require(_0x9b15('0x9'));var client=jayson[_0x9b15('0xa')][_0x9b15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x640295,_0x4673c3,_0x2b8c20){return new BPromise(function(_0x5bbb26,_0x114e3f){return client['request'](_0x640295,_0x2b8c20)[_0x9b15('0xc')](function(_0x129ed5){logger[_0x9b15('0xd')](_0x9b15('0xe'),_0x4673c3,_0x9b15('0xf'));logger[_0x9b15('0x10')](_0x9b15('0x11'),_0x4673c3,_0x9b15('0xf'),JSON[_0x9b15('0x12')](_0x129ed5));if(_0x129ed5['error']){if(_0x129ed5[_0x9b15('0x13')][_0x9b15('0x14')]===0x1f4){logger[_0x9b15('0x13')](_0x9b15('0xe'),_0x4673c3,_0x129ed5[_0x9b15('0x13')]['message']);return _0x114e3f(_0x129ed5[_0x9b15('0x13')][_0x9b15('0x15')]);}logger[_0x9b15('0x13')](_0x9b15('0xe'),_0x4673c3,_0x129ed5[_0x9b15('0x13')][_0x9b15('0x15')]);return _0x5bbb26(_0x129ed5[_0x9b15('0x13')][_0x9b15('0x15')]);}else{logger[_0x9b15('0xd')](_0x9b15('0xe'),_0x4673c3,_0x9b15('0xf'));_0x5bbb26(_0x129ed5[_0x9b15('0x16')][_0x9b15('0x15')]);}})[_0x9b15('0x17')](function(_0x3b49a8){logger[_0x9b15('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x4673c3,_0x3b49a8);_0x114e3f(_0x3b49a8);});});} \ No newline at end of file +var _0xfe7c=['http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x56313b,_0x5b2bc3){var _0x22ed53=function(_0x179945){while(--_0x179945){_0x56313b['push'](_0x56313b['shift']());}};_0x22ed53(++_0x5b2bc3);}(_0xfe7c,0x1f0));var _0xcfe7=function(_0x2956c6,_0x511f0a){_0x2956c6=_0x2956c6-0x0;var _0x72c6ab=_0xfe7c[_0x2956c6];return _0x72c6ab;};'use strict';var _=require('lodash');var util=require(_0xcfe7('0x0'));var moment=require(_0xcfe7('0x1'));var BPromise=require(_0xcfe7('0x2'));var rs=require(_0xcfe7('0x3'));var fs=require('fs');var Redis=require(_0xcfe7('0x4'));var db=require(_0xcfe7('0x5'))['db'];var utils=require(_0xcfe7('0x6'));var logger=require(_0xcfe7('0x7'))(_0xcfe7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcfe7('0x9')][_0xcfe7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7c67d,_0x5752d9,_0x46bdd5){return new BPromise(function(_0x5dbc82,_0x46f322){return client[_0xcfe7('0xb')](_0xf7c67d,_0x46bdd5)[_0xcfe7('0xc')](function(_0x453f5){logger['info'](_0xcfe7('0xd'),_0x5752d9,_0xcfe7('0xe'));logger[_0xcfe7('0xf')](_0xcfe7('0x10'),_0x5752d9,'request\x20sent',JSON[_0xcfe7('0x11')](_0x453f5));if(_0x453f5[_0xcfe7('0x12')]){if(_0x453f5[_0xcfe7('0x12')][_0xcfe7('0x13')]===0x1f4){logger[_0xcfe7('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x5752d9,_0x453f5[_0xcfe7('0x12')]['message']);return _0x46f322(_0x453f5[_0xcfe7('0x12')][_0xcfe7('0x14')]);}logger[_0xcfe7('0x12')](_0xcfe7('0xd'),_0x5752d9,_0x453f5[_0xcfe7('0x12')]['message']);return _0x5dbc82(_0x453f5[_0xcfe7('0x12')]['message']);}else{logger['info'](_0xcfe7('0xd'),_0x5752d9,_0xcfe7('0xe'));_0x5dbc82(_0x453f5[_0xcfe7('0x15')]['message']);}})[_0xcfe7('0x16')](function(_0x1eedc3){logger[_0xcfe7('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x5752d9,_0x1eedc3);_0x46f322(_0x1eedc3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 421701c..0c098cb 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 _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x579713,_0x34a023){var _0x24fcc7=function(_0x520e49){while(--_0x520e49){_0x579713['push'](_0x579713['shift']());}};_0x24fcc7(++_0x34a023);}(_0x2d17,0x17e));var _0x72d1=function(_0x51246b,_0x7f1de1){_0x51246b=_0x51246b-0x0;var _0x1049f5=_0x2d17[_0x51246b];return _0x1049f5;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router; \ No newline at end of file +var _0x9957=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/',auth['isAuthenticated'](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a8dd8ab..41e8236 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 _0xdb12=['beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM'];(function(_0x2db1e3,_0x43d437){var _0x2ea4e9=function(_0x53813f){while(--_0x53813f){_0x2db1e3['push'](_0x2db1e3['shift']());}};_0x2ea4e9(++_0x43d437);}(_0xdb12,0xc2));var _0x2db1=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0xdb12[_0x39772f];return _0xc9edbf;};'use strict';var Sequelize=require(_0x2db1('0x0'));module[_0x2db1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2db1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2db1('0x3')]},'timeout':{'type':Sequelize[_0x2db1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2db1('0x5')]('rrmemory',_0x2db1('0x6'),_0x2db1('0x7'))}}; \ No newline at end of file +var _0xa37d=['exports','STRING','INTEGER','rrmemory','roundrobin','sequelize'];(function(_0x7e65b9,_0x1ccbda){var _0x547fd6=function(_0x34d917){while(--_0x34d917){_0x7e65b9['push'](_0x7e65b9['shift']());}};_0x547fd6(++_0x1ccbda);}(_0xa37d,0xa1));var _0xda37=function(_0x3e5325,_0x55af33){_0x3e5325=_0x3e5325-0x0;var _0x5a1c63=_0xa37d[_0x3e5325];return _0x5a1c63;};'use strict';var Sequelize=require(_0xda37('0x0'));module[_0xda37('0x1')]={'name':{'type':Sequelize[_0xda37('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xda37('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xda37('0x4'),'beepall',_0xda37('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 46ca54b..d81d096 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 _0x8d55=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','stack','name','index','ChatQueue','rawAttributes','type','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','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','ioredis'];(function(_0x37607a,_0x347eca){var _0x1dd6e2=function(_0xfdd16d){while(--_0xfdd16d){_0x37607a['push'](_0x37607a['shift']());}};_0x1dd6e2(++_0x347eca);}(_0x8d55,0x1bd));var _0x58d5=function(_0xf7a280,_0x2c43ce){_0xf7a280=_0xf7a280-0x0;var _0x5282ab=_0x8d55[_0xf7a280];return _0x5282ab;};'use strict';var emlformat=require(_0x58d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58d5('0x1'));var jsonpatch=require(_0x58d5('0x2'));var rp=require(_0x58d5('0x3'));var moment=require(_0x58d5('0x4'));var BPromise=require(_0x58d5('0x5'));var Mustache=require(_0x58d5('0x6'));var util=require(_0x58d5('0x7'));var path=require(_0x58d5('0x8'));var sox=require(_0x58d5('0x9'));var csv=require(_0x58d5('0xa'));var ejs=require(_0x58d5('0xb'));var fs=require('fs');var fs_extra=require(_0x58d5('0xc'));var _=require(_0x58d5('0xd'));var squel=require(_0x58d5('0xe'));var crypto=require(_0x58d5('0xf'));var jsforce=require(_0x58d5('0x10'));var deskjs=require(_0x58d5('0x11'));var toCsv=require(_0x58d5('0xa'));var querystring=require(_0x58d5('0x12'));var Papa=require('papaparse');var Redis=require(_0x58d5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x58d5('0x14'));var hardwareService=require(_0x58d5('0x15'));var logger=require(_0x58d5('0x16'))(_0x58d5('0x17'));var utils=require(_0x58d5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x58d5('0x19'));var db=require(_0x58d5('0x1a'))['db'];config[_0x58d5('0x1b')]=_[_0x58d5('0x1c')](config[_0x58d5('0x1b')],{'host':_0x58d5('0x1d'),'port':0x18eb});var socket=require(_0x58d5('0x1e'))(new Redis(config[_0x58d5('0x1b')]));require(_0x58d5('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x58d5('0x20')][_0x58d5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x366ee5,_0x23923e,_0x16498c,_0x5a4565){return new BPromise(function(_0x4c9b05,_0x14938e){var _0x2181fd=_0x5a4565||client;return _0x2181fd['request'](_0x366ee5,_0x16498c)[_0x58d5('0x22')](function(_0x5333ae){logger[_0x58d5('0x23')](_0x58d5('0x24'),_0x23923e,_0x58d5('0x25'));logger[_0x58d5('0x26')](_0x58d5('0x27'),_0x23923e,_0x58d5('0x25'),JSON[_0x58d5('0x28')](_0x5333ae));if(_0x5333ae[_0x58d5('0x29')]){if(_0x5333ae['error'][_0x58d5('0x2a')]===0x1f4){logger[_0x58d5('0x29')](_0x58d5('0x24'),_0x23923e,_0x5333ae[_0x58d5('0x29')][_0x58d5('0x2b')]);return _0x14938e(_0x5333ae['error'][_0x58d5('0x2b')]);}logger['error'](_0x58d5('0x24'),_0x23923e,_0x5333ae[_0x58d5('0x29')]['message']);return _0x4c9b05(_0x5333ae[_0x58d5('0x29')][_0x58d5('0x2b')]);}else{logger[_0x58d5('0x23')](_0x58d5('0x24'),_0x23923e,_0x58d5('0x25'));_0x4c9b05(_0x5333ae[_0x58d5('0x2c')][_0x58d5('0x2b')]);}})[_0x58d5('0x2d')](function(_0x34b083){logger[_0x58d5('0x29')]('ChatQueue,\x20%s,\x20%s',_0x23923e,_0x34b083);_0x14938e(_0x34b083);});});}function respondWithStatusCode(_0x274780,_0xd5b136){_0xd5b136=_0xd5b136||0xcc;return function(_0x324264){if(_0x324264){return _0x274780['sendStatus'](_0xd5b136);}return _0x274780[_0x58d5('0x2e')](_0xd5b136)['end']();};}function respondWithResult(_0x134f65,_0x244085){_0x244085=_0x244085||0xc8;return function(_0x1dec4d){if(_0x1dec4d){return _0x134f65[_0x58d5('0x2e')](_0x244085)[_0x58d5('0x2f')](_0x1dec4d);}};}function respondWithFilteredResult(_0x54dce0,_0x7ebc8c){return function(_0x392880){if(_0x392880){var _0x517314=typeof _0x7ebc8c[_0x58d5('0x30')]===_0x58d5('0x31')&&typeof _0x7ebc8c[_0x58d5('0x32')]===_0x58d5('0x31');var _0x22456d=_0x392880[_0x58d5('0x33')];var _0x4d5a3b=_0x517314?0x0:_0x7ebc8c[_0x58d5('0x30')];var _0x4f022e=_0x517314?_0x392880[_0x58d5('0x33')]:_0x7ebc8c['offset']+_0x7ebc8c[_0x58d5('0x32')];var _0x33d097;if(_0x4f022e>=_0x22456d){_0x4f022e=_0x22456d;_0x33d097=0xc8;}else{_0x33d097=0xce;}_0x54dce0[_0x58d5('0x2e')](_0x33d097);return _0x54dce0[_0x58d5('0x34')](_0x58d5('0x35'),_0x4d5a3b+'-'+_0x4f022e+'/'+_0x22456d)[_0x58d5('0x2f')](_0x392880);}return null;};}function patchUpdates(_0x5d947c){return function(_0x1e7a60){try{jsonpatch['apply'](_0x1e7a60,_0x5d947c,!![]);}catch(_0x2e6415){return BPromise['reject'](_0x2e6415);}return _0x1e7a60[_0x58d5('0x36')]();};}function saveUpdates(_0x5875d3,_0x4ac003){return function(_0x5dc74a){if(_0x5dc74a){return _0x5dc74a[_0x58d5('0x37')](_0x5875d3)['then'](function(_0x9ecc5a){return _0x9ecc5a;});}return null;};}function removeEntity(_0x1abc48,_0x34fcdd){return function(_0x2b9dab){if(_0x2b9dab){return _0x2b9dab[_0x58d5('0x38')]()['then'](function(){var _0x2f169f=_0x2b9dab[_0x58d5('0x39')]({'plain':!![]});var _0xe7071d=_0x58d5('0x3a');return db[_0x58d5('0x3b')][_0x58d5('0x38')]({'where':{'type':_0xe7071d,'resourceId':_0x2f169f['id']}})[_0x58d5('0x22')](function(){return _0x2b9dab;});})[_0x58d5('0x22')](function(){_0x1abc48[_0x58d5('0x2e')](0xcc)[_0x58d5('0x3c')]();});}};}function handleEntityNotFound(_0x263321,_0x4ba13f){return function(_0x1f8d3a){if(!_0x1f8d3a){_0x263321[_0x58d5('0x3d')](0x194);}return _0x1f8d3a;};}function handleError(_0x5c8516,_0xbcdc8f){_0xbcdc8f=_0xbcdc8f||0x1f4;return function(_0x2625d9){logger[_0x58d5('0x29')](_0x2625d9[_0x58d5('0x3e')]);if(_0x2625d9[_0x58d5('0x3f')]){delete _0x2625d9[_0x58d5('0x3f')];}_0x5c8516['status'](_0xbcdc8f)['send'](_0x2625d9);};}exports[_0x58d5('0x40')]=function(_0x49aa56,_0x2320f4){var _0x1c4cd2={},_0x1aec4c={},_0x3e670f={'count':0x0,'rows':[]};var _0x1de936=_['map'](db[_0x58d5('0x41')][_0x58d5('0x42')],function(_0x23795b){return{'name':_0x23795b['fieldName'],'type':_0x23795b[_0x58d5('0x43')]['key']};});_0x1aec4c[_0x58d5('0x44')]=_['map'](_0x1de936,_0x58d5('0x3f'));_0x1aec4c['query']=_[_0x58d5('0x45')](_0x49aa56['query']);_0x1aec4c[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x1aec4c['model'],_0x1aec4c['query']);_0x1c4cd2[_0x58d5('0x48')]=_[_0x58d5('0x47')](_0x1aec4c[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x49aa56['query'][_0x58d5('0x49')]));_0x1c4cd2[_0x58d5('0x48')]=_0x1c4cd2[_0x58d5('0x48')][_0x58d5('0x4a')]?_0x1c4cd2[_0x58d5('0x48')]:_0x1aec4c[_0x58d5('0x44')];if(!_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x4c')](_0x58d5('0x4d'))){_0x1c4cd2[_0x58d5('0x32')]=qs[_0x58d5('0x32')](_0x49aa56['query'][_0x58d5('0x32')]);_0x1c4cd2[_0x58d5('0x30')]=qs[_0x58d5('0x30')](_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x30')]);}_0x1c4cd2[_0x58d5('0x4e')]=qs[_0x58d5('0x4f')](_0x49aa56['query'][_0x58d5('0x4f')]);_0x1c4cd2[_0x58d5('0x50')]=qs['filters'](_[_0x58d5('0x51')](_0x49aa56[_0x58d5('0x4b')],_0x1aec4c['filters']),_0x1de936);if(_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x52')]){_0x1c4cd2['where']=_[_0x58d5('0x53')](_0x1c4cd2[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x1de936,function(_0x16be5f){if(_0x16be5f[_0x58d5('0x43')]!==_0x58d5('0x55')){var _0x5f5a53={};_0x5f5a53[_0x16be5f[_0x58d5('0x3f')]]={'$like':'%'+_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x52')]+'%'};return _0x5f5a53;}})});}_0x1c4cd2=_[_0x58d5('0x53')]({},_0x1c4cd2,_0x49aa56[_0x58d5('0x56')]);var _0x4aabd9={'where':_0x1c4cd2[_0x58d5('0x50')]};return db[_0x58d5('0x41')][_0x58d5('0x33')](_0x4aabd9)[_0x58d5('0x22')](function(_0x36b901){_0x3e670f['count']=_0x36b901;if(_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x57')]){_0x1c4cd2[_0x58d5('0x58')]=[{'all':!![]}];}return db[_0x58d5('0x41')][_0x58d5('0x59')](_0x1c4cd2);})[_0x58d5('0x22')](function(_0x49dca0){_0x3e670f['rows']=_0x49dca0;return _0x3e670f;})[_0x58d5('0x22')](respondWithFilteredResult(_0x2320f4,_0x1c4cd2))[_0x58d5('0x2d')](handleError(_0x2320f4,null));};exports[_0x58d5('0x5a')]=function(_0x2a8f1c,_0x5f04cb){var _0x39e99d={'raw':!![],'where':{'id':_0x2a8f1c['params']['id']}},_0x21d8e1={};_0x21d8e1['model']=_[_0x58d5('0x45')](db['ChatQueue']['rawAttributes']);_0x21d8e1['query']=_[_0x58d5('0x45')](_0x2a8f1c[_0x58d5('0x4b')]);_0x21d8e1[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x21d8e1[_0x58d5('0x44')],_0x21d8e1[_0x58d5('0x4b')]);_0x39e99d['attributes']=_[_0x58d5('0x47')](_0x21d8e1[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x2a8f1c[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x39e99d[_0x58d5('0x48')]=_0x39e99d['attributes'][_0x58d5('0x4a')]?_0x39e99d['attributes']:_0x21d8e1[_0x58d5('0x44')];if(_0x2a8f1c[_0x58d5('0x4b')][_0x58d5('0x57')]){_0x39e99d[_0x58d5('0x58')]=[{'all':!![]}];}_0x39e99d=_[_0x58d5('0x53')]({},_0x39e99d,_0x2a8f1c[_0x58d5('0x56')]);return db[_0x58d5('0x41')][_0x58d5('0x5b')](_0x39e99d)[_0x58d5('0x22')](handleEntityNotFound(_0x5f04cb,null))[_0x58d5('0x22')](respondWithResult(_0x5f04cb,null))['catch'](handleError(_0x5f04cb,null));};exports[_0x58d5('0x5c')]=function(_0x19a592,_0xf32e4c){return db[_0x58d5('0x41')][_0x58d5('0x5c')](_0x19a592[_0x58d5('0x5d')],{})[_0x58d5('0x22')](function(_0x5c44ce){var _0x41f570=_0x19a592['user'][_0x58d5('0x39')]({'plain':!![]});if(!_0x41f570)throw new Error(_0x58d5('0x5e'));if(_0x41f570[_0x58d5('0x5f')]===_0x58d5('0x60')){var _0x333c41=_0x5c44ce[_0x58d5('0x39')]({'plain':!![]});var _0x4cc0a7=_0x58d5('0x3a');return db['UserProfileSection'][_0x58d5('0x5b')]({'where':{'name':_0x4cc0a7,'userProfileId':_0x41f570['userProfileId']},'raw':!![]})[_0x58d5('0x22')](function(_0x1f39b9){if(_0x1f39b9&&_0x1f39b9['autoAssociation']===0x0){return db[_0x58d5('0x3b')][_0x58d5('0x5c')]({'name':_0x333c41[_0x58d5('0x3f')],'resourceId':_0x333c41['id'],'type':_0x1f39b9[_0x58d5('0x3f')],'sectionId':_0x1f39b9['id']},{})['then'](function(){return _0x5c44ce;});}else{return _0x5c44ce;}})[_0x58d5('0x2d')](function(_0x420c93){logger[_0x58d5('0x29')](_0x58d5('0x61'),_0x420c93);throw _0x420c93;});}return _0x5c44ce;})[_0x58d5('0x22')](respondWithResult(_0xf32e4c,0xc9))[_0x58d5('0x2d')](handleError(_0xf32e4c,null));};exports[_0x58d5('0x37')]=function(_0x362662,_0x323e2b){if(_0x362662[_0x58d5('0x5d')]['id']){delete _0x362662[_0x58d5('0x5d')]['id'];}return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x362662[_0x58d5('0x62')]['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0x323e2b,null))[_0x58d5('0x22')](saveUpdates(_0x362662[_0x58d5('0x5d')],null))['then'](respondWithResult(_0x323e2b,null))[_0x58d5('0x2d')](handleError(_0x323e2b,null));};exports[_0x58d5('0x38')]=function(_0x25b198,_0xf6cf43){return db['ChatQueue'][_0x58d5('0x5b')]({'where':{'id':_0x25b198[_0x58d5('0x62')]['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0xf6cf43,null))[_0x58d5('0x22')](removeEntity(_0xf6cf43,null))[_0x58d5('0x2d')](handleError(_0xf6cf43,null));};exports['describe']=function(_0x2f7012,_0x441755){return db[_0x58d5('0x41')][_0x58d5('0x63')]()[_0x58d5('0x22')](respondWithResult(_0x441755,null))[_0x58d5('0x2d')](handleError(_0x441755,null));};exports[_0x58d5('0x64')]=function(_0x5d9f82,_0x456dfd,_0x44b01b){var _0x57f523={'raw':!![],'where':{}},_0x18ee27={},_0x5e0373;return db[_0x58d5('0x41')][_0x58d5('0x65')]({'where':{'id':_0x5d9f82[_0x58d5('0x62')]['id']}})['then'](handleEntityNotFound(_0x456dfd,null))[_0x58d5('0x22')](function(_0x5c06ad){if(_0x5c06ad){_0x5e0373=_0x5c06ad[_0x58d5('0x39')]({'plain':!![]});_0x18ee27[_0x58d5('0x44')]=_[_0x58d5('0x45')](db['UserChatQueue']['rawAttributes']);_0x18ee27[_0x58d5('0x4b')]=_[_0x58d5('0x45')](_0x5d9f82[_0x58d5('0x4b')]);_0x18ee27[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x18ee27[_0x58d5('0x44')],_0x18ee27['query']);_0x57f523[_0x58d5('0x48')]=_[_0x58d5('0x47')](_0x18ee27[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x57f523['attributes']=_0x57f523['attributes'][_0x58d5('0x4a')]?_0x57f523[_0x58d5('0x48')]:_0x18ee27[_0x58d5('0x44')];if(!_0x5d9f82['query'][_0x58d5('0x4c')]('nolimit')){_0x57f523['limit']=qs['limit'](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x32')]);_0x57f523[_0x58d5('0x30')]=qs['offset'](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x30')]);}_0x57f523[_0x58d5('0x4e')]=qs[_0x58d5('0x4f')](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x4f')]);_0x57f523['where']=qs['filters'](_[_0x58d5('0x51')](_0x5d9f82[_0x58d5('0x4b')],_0x18ee27[_0x58d5('0x46')]));_0x57f523[_0x58d5('0x50')][_0x58d5('0x66')]=_0x5c06ad['id'];if(_0x5d9f82['query'][_0x58d5('0x52')]){_0x57f523[_0x58d5('0x50')]=_['merge'](_0x57f523[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x57f523['attributes'],function(_0x3add3e){var _0x1b3fb7={};_0x1b3fb7[_0x3add3e]={'$like':'%'+_0x5d9f82['query']['filter']+'%'};return _0x1b3fb7;})});}_0x57f523=_[_0x58d5('0x53')]({},_0x57f523,_0x5d9f82[_0x58d5('0x56')]);return db['UserChatQueue'][_0x58d5('0x59')](_0x57f523);}})[_0x58d5('0x22')](function(_0x16d8a2){if(_0x16d8a2){return db[_0x58d5('0x67')][_0x58d5('0x68')]({'where':{'id':_[_0x58d5('0x54')](_0x16d8a2,_0x58d5('0x69')),'role':_0x58d5('0x6a')},'attributes':['id',_0x58d5('0x3f'),'chatPause',_0x58d5('0x6b'),_0x58d5('0x6c')]});}})[_0x58d5('0x22')](function(_0x4b25e8){if(_0x4b25e8){return{'count':_0x4b25e8[_0x58d5('0x33')],'rows':_[_0x58d5('0x54')](_0x4b25e8['rows'],function(_0x51d8d9){return{'membername':_0x51d8d9[_0x58d5('0x3f')],'UserId':_0x51d8d9['id'],'queue_name':_0x5e0373[_0x58d5('0x3f')],'ChatQueueId':_0x5e0373['id'],'interface':util[_0x58d5('0x6d')](_0x58d5('0x6e'),'SIP',_0x51d8d9[_0x58d5('0x3f')]),'penalty':0x0,'paused':_0x51d8d9[_0x58d5('0x6f')],'createdAt':_0x51d8d9[_0x58d5('0x6c')],'updatedAt':_0x51d8d9[_0x58d5('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x58d5('0x22')](respondWithFilteredResult(_0x456dfd,_0x57f523))[_0x58d5('0x2d')](handleError(_0x456dfd,null));};exports[_0x58d5('0x70')]=function(_0x56cf60,_0x20e3e5,_0x3afdff){var _0x345907={};var _0x28430b={};var _0x3960ee;var _0x3aa637;return db[_0x58d5('0x41')][_0x58d5('0x65')]({'where':{'id':_0x56cf60[_0x58d5('0x62')]['id']}})['then'](handleEntityNotFound(_0x20e3e5,null))[_0x58d5('0x22')](function(_0x4be29a){if(_0x4be29a){_0x3960ee=_0x4be29a;_0x28430b['model']=_[_0x58d5('0x45')](db[_0x58d5('0x71')][_0x58d5('0x42')]);_0x28430b[_0x58d5('0x4b')]=_[_0x58d5('0x45')](_0x56cf60['query']);_0x28430b[_0x58d5('0x46')]=_['intersection'](_0x28430b[_0x58d5('0x44')],_0x28430b[_0x58d5('0x4b')]);_0x345907['attributes']=_['intersection'](_0x28430b[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x345907[_0x58d5('0x48')]=_0x345907[_0x58d5('0x48')]['length']?_0x345907[_0x58d5('0x48')]:_0x28430b[_0x58d5('0x44')];_0x345907[_0x58d5('0x4e')]=qs['sort'](_0x56cf60['query'][_0x58d5('0x4f')]);_0x345907[_0x58d5('0x50')]=qs[_0x58d5('0x46')](_[_0x58d5('0x51')](_0x56cf60[_0x58d5('0x4b')],_0x28430b[_0x58d5('0x46')]));if(_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x52')]){_0x345907[_0x58d5('0x50')]=_[_0x58d5('0x53')](_0x345907[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x345907[_0x58d5('0x48')],function(_0x7d1038){var _0x5820c0={};_0x5820c0[_0x7d1038]={'$like':'%'+_0x56cf60['query']['filter']+'%'};return _0x5820c0;})});}_0x345907=_[_0x58d5('0x53')]({},_0x345907,_0x56cf60['options']);return _0x3960ee[_0x58d5('0x70')](_0x345907);}})[_0x58d5('0x22')](function(_0x5927a8){if(_0x5927a8){_0x3aa637=_0x5927a8[_0x58d5('0x4a')];if(!_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x4c')](_0x58d5('0x4d'))){_0x345907[_0x58d5('0x32')]=qs[_0x58d5('0x32')](_0x56cf60[_0x58d5('0x4b')]['limit']);_0x345907[_0x58d5('0x30')]=qs[_0x58d5('0x30')](_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x30')]);}return _0x3960ee[_0x58d5('0x70')](_0x345907);}})[_0x58d5('0x22')](function(_0x3cd1ab){if(_0x3cd1ab){return _0x3cd1ab?{'count':_0x3aa637,'rows':_0x3cd1ab}:null;}})[_0x58d5('0x22')](respondWithResult(_0x20e3e5,null))[_0x58d5('0x2d')](handleError(_0x20e3e5,null));};exports[_0x58d5('0x72')]=function(_0x4b613f,_0x4ec9ec,_0x8aac2e){var _0x371d67=_0x4b613f[_0x58d5('0x5d')][_0x58d5('0x73')];return db[_0x58d5('0x71')][_0x58d5('0x59')]({'where':{'id':_0x371d67},'attributes':['id'],'include':[{'model':db[_0x58d5('0x67')],'as':_0x58d5('0x74'),'attributes':['id',_0x58d5('0x3f'),_0x58d5('0x75'),'voicePause',_0x58d5('0x76')],'raw':!![]}]})[_0x58d5('0x22')](function(_0x4c814b){if(_0x4c814b){var _0x5ef176=_[_0x58d5('0x77')](_0x4c814b,function(_0x3997cf){var _0x1b46f5=_0x3997cf[_0x58d5('0x39')]({'plain':!![]});return _0x1b46f5[_0x58d5('0x74')];});return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x4b613f[_0x58d5('0x62')]['id']}})['then'](function(_0x5844c2){return db['sequelize']['transaction'](function(_0x3f3435){return _0x5844c2[_0x58d5('0x72')](_0x371d67,{'transaction':_0x3f3435})[_0x58d5('0x22')](function(){return BPromise[_0x58d5('0x78')](_0x5ef176,function(_0x19f287){return db[_0x58d5('0x79')][_0x58d5('0x7a')]({'where':{'UserId':_0x19f287['id'],'ChatQueueId':_0x4b613f[_0x58d5('0x62')]['id']},'transaction':_0x3f3435});});})[_0x58d5('0x22')](function(){_0x5ef176[_0x58d5('0x7b')](function(_0x1d1f33){socket[_0x58d5('0x7c')](_0x58d5('0x7d'),{'UserId':_0x1d1f33['id'],'ChatQueueId':_0x5844c2['id']});});});});});}})[_0x58d5('0x22')](respondWithStatusCode(_0x4ec9ec,null))['catch'](handleError(_0x4ec9ec,null));};exports[_0x58d5('0x7e')]=function(_0xe13d18,_0x6a2300,_0x36c6e1){return db[_0x58d5('0x71')][_0x58d5('0x59')]({'where':{'id':_0xe13d18[_0x58d5('0x4b')][_0x58d5('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x58d5('0x22')](handleEntityNotFound(_0x6a2300,null))[_0x58d5('0x22')](function(_0x39acd6){var _0x582ae6=_[_0x58d5('0x54')](_0x39acd6,'id');var _0x4788cb=[];var _0x1995c4=[];var _0x1bb571=squel[_0x58d5('0x7f')]();_0x1bb571[_0x58d5('0x80')](_0x58d5('0x81'))[_0x58d5('0x82')]('team_has_chat_queues','tq')[_0x58d5('0x83')](_0x58d5('0x84'),'ut',_0x58d5('0x85'))['where'](_0x58d5('0x86'),_0xe13d18['params']['id']);for(var _0x22dfef=0x0;_0x22dfef<_0x39acd6[_0x58d5('0x4a')];_0x22dfef+=0x1){let _0xd9c492=_0x39acd6[_0x22dfef];for(var _0x2342e4=0x0;_0x2342e4<_0xd9c492[_0x58d5('0x74')]['length'];_0x2342e4+=0x1){let _0x51aec7=_0xd9c492[_0x58d5('0x74')][_0x2342e4];var _0x11288e=_0x1bb571[_0x58d5('0x87')]();_0x11288e[_0x58d5('0x50')](_0x58d5('0x88'),_0x51aec7['id']);_0x1995c4[_0x58d5('0x89')](db[_0x58d5('0x8a')][_0x58d5('0x4b')](_0x11288e[_0x58d5('0x8b')](),{'type':db[_0x58d5('0x8a')]['QueryTypes'][_0x58d5('0x8c')]})[_0x58d5('0x22')](function(_0x567774){if(_0x567774[_0x58d5('0x4a')]===0x1){return _0x51aec7['id'];}else{var _0x436ea0=_[_0x58d5('0x8d')](_[_0x58d5('0x54')](_0x567774,_0x58d5('0x8e')),function(_0x5af4b6){return _[_0x58d5('0x8f')](_0x582ae6,_0x5af4b6);});if(_0x436ea0){return _0x51aec7['id'];}}}));}}return BPromise[_0x58d5('0x90')](_0x1995c4)['then'](function(_0x1a0167){_0x4788cb=_(_0x4788cb)['union'](_0x1a0167)[_0x58d5('0x91')]()['value']();return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0xe13d18['params']['id']}})[_0x58d5('0x22')](function(_0x2184ae){return db[_0x58d5('0x8a')][_0x58d5('0x92')](function(_0x4f9bf1){return _0x2184ae[_0x58d5('0x7e')](_0xe13d18['query'][_0x58d5('0x73')],{'transaction':_0x4f9bf1})[_0x58d5('0x22')](function(){if(!_[_0x58d5('0x93')](_0x4788cb)){return _0x2184ae[_0x58d5('0x94')](_0x4788cb,{'transaction':_0x4f9bf1});}})['then'](function(){_0x4788cb[_0x58d5('0x7b')](function(_0x32b551){socket['emit'](_0x58d5('0x95'),{'UserId':_0x32b551,'ChatQueueId':_0x2184ae['id']});});});});});});})[_0x58d5('0x22')](respondWithStatusCode(_0x6a2300,null))['catch'](handleError(_0x6a2300,null));};exports[_0x58d5('0x96')]=function(_0x14d29c,_0xe9e277,_0x211c2a){return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x14d29c[_0x58d5('0x62')]['id']}})['then'](handleEntityNotFound(_0xe9e277,null))[_0x58d5('0x22')](function(_0x2e7fa4){if(_0x2e7fa4){return _0x2e7fa4['addAgents'](_0x14d29c[_0x58d5('0x5d')][_0x58d5('0x73')],_[_0x58d5('0x97')](_0x14d29c['body'],[_0x58d5('0x73'),'id'])||{})[_0x58d5('0x98')](function(_0x39a2c1){for(var _0x62b60d=0x0;_0x62b60d<_0x14d29c[_0x58d5('0x5d')]['ids'][_0x58d5('0x4a')];_0x62b60d+=0x1){socket[_0x58d5('0x7c')]('userChatQueue:save',{'UserId':_0x14d29c[_0x58d5('0x5d')][_0x58d5('0x73')][_0x62b60d],'ChatQueueId':_0x14d29c[_0x58d5('0x62')]['id']});}return _0x39a2c1;});}})[_0x58d5('0x22')](respondWithResult(_0xe9e277,null))['catch'](handleError(_0xe9e277,null));};exports[_0x58d5('0x94')]=function(_0x3986b4,_0x1762ac,_0x45d3f4){return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x3986b4['params']['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0x1762ac,null))[_0x58d5('0x22')](function(_0x4c5078){if(_0x4c5078){return _0x4c5078['removeAgents'](_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')])['then'](function(){if(_[_0x58d5('0x99')](_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')])){for(var _0x51e8c4=0x0;_0x51e8c4<_0x3986b4[_0x58d5('0x4b')]['ids'][_0x58d5('0x4a')];_0x51e8c4+=0x1){socket[_0x58d5('0x7c')](_0x58d5('0x95'),{'UserId':Number(_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')][_0x51e8c4]),'ChatQueueId':Number(_0x3986b4[_0x58d5('0x62')]['id'])});}}else{socket[_0x58d5('0x7c')](_0x58d5('0x95'),{'UserId':Number(_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')]),'ChatQueueId':Number(_0x3986b4[_0x58d5('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x1762ac,null))[_0x58d5('0x2d')](handleError(_0x1762ac,null));};exports['getAgents']=function(_0x102748,_0x1c2e66,_0x404f55){var _0x11b38f={};var _0x5ef0e1={};var _0x37917f;var _0xaf9efa;return db[_0x58d5('0x41')][_0x58d5('0x65')]({'where':{'id':_0x102748['params']['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0x1c2e66,null))[_0x58d5('0x22')](function(_0x123be3){if(_0x123be3){_0x37917f=_0x123be3;_0x5ef0e1[_0x58d5('0x44')]=_[_0x58d5('0x45')](db['User']['rawAttributes']);_0x5ef0e1['query']=_['keys'](_0x102748[_0x58d5('0x4b')]);_0x5ef0e1[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x5ef0e1[_0x58d5('0x44')],_0x5ef0e1['query']);_0x11b38f[_0x58d5('0x48')]=_[_0x58d5('0x47')](_0x5ef0e1['model'],qs[_0x58d5('0x49')](_0x102748[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x11b38f['attributes']=_0x11b38f['attributes']['length']?_0x11b38f[_0x58d5('0x48')]:_0x5ef0e1[_0x58d5('0x44')];_0x11b38f[_0x58d5('0x4e')]=qs[_0x58d5('0x4f')](_0x102748[_0x58d5('0x4b')][_0x58d5('0x4f')]);_0x11b38f[_0x58d5('0x50')]=qs['filters'](_[_0x58d5('0x51')](_0x102748[_0x58d5('0x4b')],_0x5ef0e1[_0x58d5('0x46')]));if(_0x102748[_0x58d5('0x4b')]['filter']){_0x11b38f[_0x58d5('0x50')]=_[_0x58d5('0x53')](_0x11b38f[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x11b38f['attributes'],function(_0x261c88){var _0x5af832={};_0x5af832[_0x261c88]={'$like':'%'+_0x102748[_0x58d5('0x4b')][_0x58d5('0x52')]+'%'};return _0x5af832;})});}_0x11b38f=_[_0x58d5('0x53')]({},_0x11b38f,_0x102748[_0x58d5('0x56')]);return _0x37917f[_0x58d5('0x9a')](_0x11b38f);}})[_0x58d5('0x22')](function(_0x2f5e9c){if(_0x2f5e9c){_0xaf9efa=_0x2f5e9c[_0x58d5('0x4a')];if(!_0x102748['query'][_0x58d5('0x4c')](_0x58d5('0x4d'))){_0x11b38f['limit']=qs[_0x58d5('0x32')](_0x102748['query'][_0x58d5('0x32')]);_0x11b38f[_0x58d5('0x30')]=qs[_0x58d5('0x30')](_0x102748[_0x58d5('0x4b')][_0x58d5('0x30')]);}return _0x37917f[_0x58d5('0x9a')](_0x11b38f);}})[_0x58d5('0x22')](function(_0x58da8e){if(_0x58da8e){return _0x58da8e?{'count':_0xaf9efa,'rows':_0x58da8e}:null;}})[_0x58d5('0x22')](respondWithResult(_0x1c2e66,null))['catch'](handleError(_0x1c2e66,null));}; \ No newline at end of file +var _0xdd5d=['value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','count','limit','get','ChatQueues','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','options','includeAll','include','findAll','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','destroy','describe','getMembers','UserChatQueue','pick','ChatQueueId','UserId','chatPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','ids','User','Agents','voicePause','interface','sequelize','addTeams','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact'];(function(_0xb251f1,_0x51cc0e){var _0x17cb3f=function(_0x4f03e1){while(--_0x4f03e1){_0xb251f1['push'](_0xb251f1['shift']());}};_0x17cb3f(++_0x51cc0e);}(_0xdd5d,0x12f));var _0xddd5=function(_0x5a3b6a,_0x1feffb){_0x5a3b6a=_0x5a3b6a-0x0;var _0x34d03b=_0xdd5d[_0x5a3b6a];return _0x34d03b;};'use strict';var emlformat=require(_0xddd5('0x0'));var rimraf=require(_0xddd5('0x1'));var zipdir=require(_0xddd5('0x2'));var jsonpatch=require(_0xddd5('0x3'));var rp=require(_0xddd5('0x4'));var moment=require(_0xddd5('0x5'));var BPromise=require(_0xddd5('0x6'));var Mustache=require(_0xddd5('0x7'));var util=require(_0xddd5('0x8'));var path=require(_0xddd5('0x9'));var sox=require(_0xddd5('0xa'));var csv=require(_0xddd5('0xb'));var ejs=require(_0xddd5('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddd5('0xd'));var squel=require(_0xddd5('0xe'));var crypto=require(_0xddd5('0xf'));var jsforce=require(_0xddd5('0x10'));var deskjs=require(_0xddd5('0x11'));var toCsv=require(_0xddd5('0xb'));var querystring=require(_0xddd5('0x12'));var Papa=require('papaparse');var Redis=require(_0xddd5('0x13'));var authService=require(_0xddd5('0x14'));var qs=require(_0xddd5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddd5('0x16'));var logger=require(_0xddd5('0x17'))(_0xddd5('0x18'));var utils=require(_0xddd5('0x19'));var config=require(_0xddd5('0x1a'));var licenseUtil=require(_0xddd5('0x1b'));var db=require(_0xddd5('0x1c'))['db'];config['redis']=_['defaults'](config[_0xddd5('0x1d')],{'host':_0xddd5('0x1e'),'port':0x18eb});var socket=require(_0xddd5('0x1f'))(new Redis(config[_0xddd5('0x1d')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0xddd5('0x20'));var client=jayson['client'][_0xddd5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4e3e1b,_0xd7c176,_0x26ef1f,_0x791dd9){return new BPromise(function(_0x37405f,_0x229943){var _0x329384=_0x791dd9||client;return _0x329384[_0xddd5('0x22')](_0x4e3e1b,_0x26ef1f)[_0xddd5('0x23')](function(_0xfd497a){logger[_0xddd5('0x24')](_0xddd5('0x25'),_0xd7c176,'request\x20sent');logger['debug'](_0xddd5('0x26'),_0xd7c176,_0xddd5('0x27'),JSON[_0xddd5('0x28')](_0xfd497a));if(_0xfd497a[_0xddd5('0x29')]){if(_0xfd497a[_0xddd5('0x29')][_0xddd5('0x2a')]===0x1f4){logger[_0xddd5('0x29')]('ChatQueue,\x20%s,\x20%s',_0xd7c176,_0xfd497a[_0xddd5('0x29')][_0xddd5('0x2b')]);return _0x229943(_0xfd497a[_0xddd5('0x29')][_0xddd5('0x2b')]);}logger[_0xddd5('0x29')](_0xddd5('0x25'),_0xd7c176,_0xfd497a[_0xddd5('0x29')][_0xddd5('0x2b')]);return _0x37405f(_0xfd497a[_0xddd5('0x29')][_0xddd5('0x2b')]);}else{logger[_0xddd5('0x24')](_0xddd5('0x25'),_0xd7c176,_0xddd5('0x27'));_0x37405f(_0xfd497a['result'][_0xddd5('0x2b')]);}})[_0xddd5('0x2c')](function(_0x42f96f){logger[_0xddd5('0x29')]('ChatQueue,\x20%s,\x20%s',_0xd7c176,_0x42f96f);_0x229943(_0x42f96f);});});}function respondWithStatusCode(_0xb7e11a,_0x15b07f){_0x15b07f=_0x15b07f||0xcc;return function(_0xf9342c){if(_0xf9342c){return _0xb7e11a['sendStatus'](_0x15b07f);}return _0xb7e11a[_0xddd5('0x2d')](_0x15b07f)[_0xddd5('0x2e')]();};}function respondWithResult(_0x39a564,_0x7e4164){_0x7e4164=_0x7e4164||0xc8;return function(_0x129fc7){if(_0x129fc7){return _0x39a564[_0xddd5('0x2d')](_0x7e4164)[_0xddd5('0x2f')](_0x129fc7);}};}function respondWithFilteredResult(_0x31a146,_0x3d7093){return function(_0x4bf637){if(_0x4bf637){var _0x14ecea=typeof _0x3d7093['offset']==='undefined'&&typeof _0x3d7093['limit']==='undefined';var _0x2611dc=_0x4bf637[_0xddd5('0x30')];var _0x3ebeca=_0x14ecea?0x0:_0x3d7093['offset'];var _0x1426a8=_0x14ecea?_0x4bf637[_0xddd5('0x30')]:_0x3d7093['offset']+_0x3d7093[_0xddd5('0x31')];var _0x7ffa21;if(_0x1426a8>=_0x2611dc){_0x1426a8=_0x2611dc;_0x7ffa21=0xc8;}else{_0x7ffa21=0xce;}_0x31a146[_0xddd5('0x2d')](_0x7ffa21);return _0x31a146['set']('Content-Range',_0x3ebeca+'-'+_0x1426a8+'/'+_0x2611dc)[_0xddd5('0x2f')](_0x4bf637);}return null;};}function patchUpdates(_0xe4a06c){return function(_0x121ecf){try{jsonpatch['apply'](_0x121ecf,_0xe4a06c,!![]);}catch(_0x148d07){return BPromise['reject'](_0x148d07);}return _0x121ecf['save']();};}function saveUpdates(_0x1ad5b7,_0x4b1680){return function(_0x54546f){if(_0x54546f){return _0x54546f['update'](_0x1ad5b7)[_0xddd5('0x23')](function(_0x5658db){return _0x5658db;});}return null;};}function removeEntity(_0x5855f7,_0x4df3da){return function(_0x3c1069){if(_0x3c1069){return _0x3c1069['destroy']()[_0xddd5('0x23')](function(){var _0x34c45d=_0x3c1069[_0xddd5('0x32')]({'plain':!![]});var _0x3bd52e=_0xddd5('0x33');return db['UserProfileResource']['destroy']({'where':{'type':_0x3bd52e,'resourceId':_0x34c45d['id']}})[_0xddd5('0x23')](function(){return _0x3c1069;});})[_0xddd5('0x23')](function(){_0x5855f7[_0xddd5('0x2d')](0xcc)[_0xddd5('0x2e')]();});}};}function handleEntityNotFound(_0x6a74a9,_0x53f34b){return function(_0x3a8067){if(!_0x3a8067){_0x6a74a9[_0xddd5('0x34')](0x194);}return _0x3a8067;};}function handleError(_0xd4bb5e,_0x435744){_0x435744=_0x435744||0x1f4;return function(_0x4be1f8){logger[_0xddd5('0x29')](_0x4be1f8[_0xddd5('0x35')]);if(_0x4be1f8[_0xddd5('0x36')]){delete _0x4be1f8[_0xddd5('0x36')];}_0xd4bb5e['status'](_0x435744)[_0xddd5('0x37')](_0x4be1f8);};}exports[_0xddd5('0x38')]=function(_0x1bf079,_0x137bc8){var _0x180d38={},_0x1fc7dc={},_0x5788c0={'count':0x0,'rows':[]};var _0x41f04=_[_0xddd5('0x39')](db[_0xddd5('0x3a')][_0xddd5('0x3b')],function(_0x387bc0){return{'name':_0x387bc0[_0xddd5('0x3c')],'type':_0x387bc0[_0xddd5('0x3d')]['key']};});_0x1fc7dc[_0xddd5('0x3e')]=_[_0xddd5('0x39')](_0x41f04,_0xddd5('0x36'));_0x1fc7dc[_0xddd5('0x3f')]=_[_0xddd5('0x40')](_0x1bf079[_0xddd5('0x3f')]);_0x1fc7dc[_0xddd5('0x41')]=_[_0xddd5('0x42')](_0x1fc7dc[_0xddd5('0x3e')],_0x1fc7dc[_0xddd5('0x3f')]);_0x180d38['attributes']=_[_0xddd5('0x42')](_0x1fc7dc[_0xddd5('0x3e')],qs[_0xddd5('0x43')](_0x1bf079[_0xddd5('0x3f')][_0xddd5('0x43')]));_0x180d38['attributes']=_0x180d38['attributes'][_0xddd5('0x44')]?_0x180d38[_0xddd5('0x45')]:_0x1fc7dc[_0xddd5('0x3e')];if(!_0x1bf079['query'][_0xddd5('0x46')](_0xddd5('0x47'))){_0x180d38[_0xddd5('0x31')]=qs[_0xddd5('0x31')](_0x1bf079[_0xddd5('0x3f')][_0xddd5('0x31')]);_0x180d38[_0xddd5('0x48')]=qs[_0xddd5('0x48')](_0x1bf079[_0xddd5('0x3f')]['offset']);}_0x180d38[_0xddd5('0x49')]=qs[_0xddd5('0x4a')](_0x1bf079[_0xddd5('0x3f')][_0xddd5('0x4a')]);_0x180d38[_0xddd5('0x4b')]=qs[_0xddd5('0x41')](_['pick'](_0x1bf079[_0xddd5('0x3f')],_0x1fc7dc[_0xddd5('0x41')]),_0x41f04);if(_0x1bf079['query'][_0xddd5('0x4c')]){_0x180d38[_0xddd5('0x4b')]=_[_0xddd5('0x4d')](_0x180d38[_0xddd5('0x4b')],{'$or':_[_0xddd5('0x39')](_0x41f04,function(_0x50000c){if(_0x50000c[_0xddd5('0x3d')]!=='VIRTUAL'){var _0x506554={};_0x506554[_0x50000c[_0xddd5('0x36')]]={'$like':'%'+_0x1bf079[_0xddd5('0x3f')][_0xddd5('0x4c')]+'%'};return _0x506554;}})});}_0x180d38=_[_0xddd5('0x4d')]({},_0x180d38,_0x1bf079[_0xddd5('0x4e')]);var _0x1c2b87={'where':_0x180d38[_0xddd5('0x4b')]};return db[_0xddd5('0x3a')][_0xddd5('0x30')](_0x1c2b87)[_0xddd5('0x23')](function(_0x38e6b1){_0x5788c0['count']=_0x38e6b1;if(_0x1bf079[_0xddd5('0x3f')][_0xddd5('0x4f')]){_0x180d38[_0xddd5('0x50')]=[{'all':!![]}];}return db[_0xddd5('0x3a')][_0xddd5('0x51')](_0x180d38);})[_0xddd5('0x23')](function(_0x417b24){_0x5788c0['rows']=_0x417b24;return _0x5788c0;})[_0xddd5('0x23')](respondWithFilteredResult(_0x137bc8,_0x180d38))[_0xddd5('0x2c')](handleError(_0x137bc8,null));};exports[_0xddd5('0x52')]=function(_0x3f3b79,_0x2d9b04){var _0x3e0d1c={'raw':!![],'where':{'id':_0x3f3b79['params']['id']}},_0x2d3659={};_0x2d3659[_0xddd5('0x3e')]=_[_0xddd5('0x40')](db['ChatQueue'][_0xddd5('0x3b')]);_0x2d3659[_0xddd5('0x3f')]=_[_0xddd5('0x40')](_0x3f3b79[_0xddd5('0x3f')]);_0x2d3659[_0xddd5('0x41')]=_[_0xddd5('0x42')](_0x2d3659['model'],_0x2d3659[_0xddd5('0x3f')]);_0x3e0d1c[_0xddd5('0x45')]=_['intersection'](_0x2d3659[_0xddd5('0x3e')],qs[_0xddd5('0x43')](_0x3f3b79[_0xddd5('0x3f')][_0xddd5('0x43')]));_0x3e0d1c[_0xddd5('0x45')]=_0x3e0d1c[_0xddd5('0x45')][_0xddd5('0x44')]?_0x3e0d1c[_0xddd5('0x45')]:_0x2d3659[_0xddd5('0x3e')];if(_0x3f3b79['query'][_0xddd5('0x4f')]){_0x3e0d1c[_0xddd5('0x50')]=[{'all':!![]}];}_0x3e0d1c=_[_0xddd5('0x4d')]({},_0x3e0d1c,_0x3f3b79[_0xddd5('0x4e')]);return db['ChatQueue'][_0xddd5('0x53')](_0x3e0d1c)[_0xddd5('0x23')](handleEntityNotFound(_0x2d9b04,null))[_0xddd5('0x23')](respondWithResult(_0x2d9b04,null))[_0xddd5('0x2c')](handleError(_0x2d9b04,null));};exports[_0xddd5('0x54')]=function(_0x676f6e,_0x49cf3f){return db[_0xddd5('0x3a')]['create'](_0x676f6e['body'],{})['then'](function(_0x485937){var _0x190da6=_0x676f6e['user'][_0xddd5('0x32')]({'plain':!![]});if(!_0x190da6)throw new Error(_0xddd5('0x55'));if(_0x190da6[_0xddd5('0x56')]===_0xddd5('0x57')){var _0xf15afb=_0x485937[_0xddd5('0x32')]({'plain':!![]});var _0x2bd09f=_0xddd5('0x33');return db[_0xddd5('0x58')]['find']({'where':{'name':_0x2bd09f,'userProfileId':_0x190da6[_0xddd5('0x59')]},'raw':!![]})[_0xddd5('0x23')](function(_0x167b04){if(_0x167b04&&_0x167b04[_0xddd5('0x5a')]===0x0){return db[_0xddd5('0x5b')][_0xddd5('0x54')]({'name':_0xf15afb[_0xddd5('0x36')],'resourceId':_0xf15afb['id'],'type':_0x167b04[_0xddd5('0x36')],'sectionId':_0x167b04['id']},{})[_0xddd5('0x23')](function(){return _0x485937;});}else{return _0x485937;}})[_0xddd5('0x2c')](function(_0x17022c){logger[_0xddd5('0x29')](_0xddd5('0x5c'),_0x17022c);throw _0x17022c;});}return _0x485937;})[_0xddd5('0x23')](respondWithResult(_0x49cf3f,0xc9))[_0xddd5('0x2c')](handleError(_0x49cf3f,null));};exports['update']=function(_0x5838d8,_0x10db49){if(_0x5838d8['body']['id']){delete _0x5838d8['body']['id'];}return db['ChatQueue'][_0xddd5('0x53')]({'where':{'id':_0x5838d8[_0xddd5('0x5d')]['id']}})['then'](handleEntityNotFound(_0x10db49,null))[_0xddd5('0x23')](saveUpdates(_0x5838d8[_0xddd5('0x5e')],null))[_0xddd5('0x23')](respondWithResult(_0x10db49,null))['catch'](handleError(_0x10db49,null));};exports[_0xddd5('0x5f')]=function(_0x242c81,_0x4709e2){return db['ChatQueue'][_0xddd5('0x53')]({'where':{'id':_0x242c81[_0xddd5('0x5d')]['id']}})[_0xddd5('0x23')](handleEntityNotFound(_0x4709e2,null))['then'](removeEntity(_0x4709e2,null))[_0xddd5('0x2c')](handleError(_0x4709e2,null));};exports['describe']=function(_0x460eae,_0x247326){return db['ChatQueue'][_0xddd5('0x60')]()['then'](respondWithResult(_0x247326,null))[_0xddd5('0x2c')](handleError(_0x247326,null));};exports[_0xddd5('0x61')]=function(_0x5576da,_0x18b3dc,_0x254c91){var _0x5b0a94={'raw':!![],'where':{}},_0x3c5144={},_0x430837;return db[_0xddd5('0x3a')]['findOne']({'where':{'id':_0x5576da['params']['id']}})['then'](handleEntityNotFound(_0x18b3dc,null))['then'](function(_0x37b6b2){if(_0x37b6b2){_0x430837=_0x37b6b2[_0xddd5('0x32')]({'plain':!![]});_0x3c5144[_0xddd5('0x3e')]=_[_0xddd5('0x40')](db[_0xddd5('0x62')][_0xddd5('0x3b')]);_0x3c5144['query']=_[_0xddd5('0x40')](_0x5576da[_0xddd5('0x3f')]);_0x3c5144[_0xddd5('0x41')]=_[_0xddd5('0x42')](_0x3c5144['model'],_0x3c5144[_0xddd5('0x3f')]);_0x5b0a94[_0xddd5('0x45')]=_[_0xddd5('0x42')](_0x3c5144[_0xddd5('0x3e')],qs[_0xddd5('0x43')](_0x5576da[_0xddd5('0x3f')][_0xddd5('0x43')]));_0x5b0a94['attributes']=_0x5b0a94[_0xddd5('0x45')][_0xddd5('0x44')]?_0x5b0a94[_0xddd5('0x45')]:_0x3c5144[_0xddd5('0x3e')];if(!_0x5576da[_0xddd5('0x3f')]['hasOwnProperty']('nolimit')){_0x5b0a94[_0xddd5('0x31')]=qs[_0xddd5('0x31')](_0x5576da[_0xddd5('0x3f')][_0xddd5('0x31')]);_0x5b0a94[_0xddd5('0x48')]=qs['offset'](_0x5576da[_0xddd5('0x3f')]['offset']);}_0x5b0a94[_0xddd5('0x49')]=qs[_0xddd5('0x4a')](_0x5576da['query'][_0xddd5('0x4a')]);_0x5b0a94[_0xddd5('0x4b')]=qs[_0xddd5('0x41')](_[_0xddd5('0x63')](_0x5576da[_0xddd5('0x3f')],_0x3c5144[_0xddd5('0x41')]));_0x5b0a94[_0xddd5('0x4b')][_0xddd5('0x64')]=_0x37b6b2['id'];if(_0x5576da[_0xddd5('0x3f')]['filter']){_0x5b0a94[_0xddd5('0x4b')]=_[_0xddd5('0x4d')](_0x5b0a94[_0xddd5('0x4b')],{'$or':_[_0xddd5('0x39')](_0x5b0a94['attributes'],function(_0x4a6e68){var _0x50d9bd={};_0x50d9bd[_0x4a6e68]={'$like':'%'+_0x5576da[_0xddd5('0x3f')][_0xddd5('0x4c')]+'%'};return _0x50d9bd;})});}_0x5b0a94=_[_0xddd5('0x4d')]({},_0x5b0a94,_0x5576da[_0xddd5('0x4e')]);return db[_0xddd5('0x62')]['findAll'](_0x5b0a94);}})['then'](function(_0x268375){if(_0x268375){return db['User']['findAndCountAll']({'where':{'id':_[_0xddd5('0x39')](_0x268375,_0xddd5('0x65')),'role':'agent'},'attributes':['id',_0xddd5('0x36'),_0xddd5('0x66'),_0xddd5('0x67'),'createdAt']});}})[_0xddd5('0x23')](function(_0x1aeea6){if(_0x1aeea6){return{'count':_0x1aeea6[_0xddd5('0x30')],'rows':_['map'](_0x1aeea6[_0xddd5('0x68')],function(_0x380cd1){return{'membername':_0x380cd1[_0xddd5('0x36')],'UserId':_0x380cd1['id'],'queue_name':_0x430837['name'],'ChatQueueId':_0x430837['id'],'interface':util[_0xddd5('0x69')](_0xddd5('0x6a'),_0xddd5('0x6b'),_0x380cd1[_0xddd5('0x36')]),'penalty':0x0,'paused':_0x380cd1[_0xddd5('0x66')],'createdAt':_0x380cd1[_0xddd5('0x6c')],'updatedAt':_0x380cd1[_0xddd5('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xddd5('0x23')](respondWithFilteredResult(_0x18b3dc,_0x5b0a94))['catch'](handleError(_0x18b3dc,null));};exports[_0xddd5('0x6d')]=function(_0x59322b,_0x5e221c,_0x461e90){var _0x42f294={};var _0x258dfd={};var _0x21ddee;var _0x394571;return db[_0xddd5('0x3a')]['findOne']({'where':{'id':_0x59322b[_0xddd5('0x5d')]['id']}})[_0xddd5('0x23')](handleEntityNotFound(_0x5e221c,null))[_0xddd5('0x23')](function(_0x5834dd){if(_0x5834dd){_0x21ddee=_0x5834dd;_0x258dfd[_0xddd5('0x3e')]=_[_0xddd5('0x40')](db[_0xddd5('0x6e')][_0xddd5('0x3b')]);_0x258dfd[_0xddd5('0x3f')]=_[_0xddd5('0x40')](_0x59322b[_0xddd5('0x3f')]);_0x258dfd['filters']=_[_0xddd5('0x42')](_0x258dfd[_0xddd5('0x3e')],_0x258dfd[_0xddd5('0x3f')]);_0x42f294[_0xddd5('0x45')]=_[_0xddd5('0x42')](_0x258dfd[_0xddd5('0x3e')],qs[_0xddd5('0x43')](_0x59322b[_0xddd5('0x3f')][_0xddd5('0x43')]));_0x42f294[_0xddd5('0x45')]=_0x42f294[_0xddd5('0x45')][_0xddd5('0x44')]?_0x42f294[_0xddd5('0x45')]:_0x258dfd['model'];_0x42f294[_0xddd5('0x49')]=qs[_0xddd5('0x4a')](_0x59322b[_0xddd5('0x3f')]['sort']);_0x42f294[_0xddd5('0x4b')]=qs[_0xddd5('0x41')](_[_0xddd5('0x63')](_0x59322b[_0xddd5('0x3f')],_0x258dfd['filters']));if(_0x59322b[_0xddd5('0x3f')][_0xddd5('0x4c')]){_0x42f294['where']=_[_0xddd5('0x4d')](_0x42f294['where'],{'$or':_['map'](_0x42f294[_0xddd5('0x45')],function(_0x3e5ee0){var _0x3f7f8c={};_0x3f7f8c[_0x3e5ee0]={'$like':'%'+_0x59322b[_0xddd5('0x3f')][_0xddd5('0x4c')]+'%'};return _0x3f7f8c;})});}_0x42f294=_[_0xddd5('0x4d')]({},_0x42f294,_0x59322b[_0xddd5('0x4e')]);return _0x21ddee[_0xddd5('0x6d')](_0x42f294);}})[_0xddd5('0x23')](function(_0x39694c){if(_0x39694c){_0x394571=_0x39694c[_0xddd5('0x44')];if(!_0x59322b['query'][_0xddd5('0x46')](_0xddd5('0x47'))){_0x42f294['limit']=qs[_0xddd5('0x31')](_0x59322b[_0xddd5('0x3f')][_0xddd5('0x31')]);_0x42f294[_0xddd5('0x48')]=qs['offset'](_0x59322b[_0xddd5('0x3f')][_0xddd5('0x48')]);}return _0x21ddee[_0xddd5('0x6d')](_0x42f294);}})[_0xddd5('0x23')](function(_0x8a315e){if(_0x8a315e){return _0x8a315e?{'count':_0x394571,'rows':_0x8a315e}:null;}})['then'](respondWithResult(_0x5e221c,null))[_0xddd5('0x2c')](handleError(_0x5e221c,null));};exports['addTeams']=function(_0x1159c2,_0x440ed5,_0x148de4){var _0x43ca74=_0x1159c2[_0xddd5('0x5e')][_0xddd5('0x6f')];return db[_0xddd5('0x6e')][_0xddd5('0x51')]({'where':{'id':_0x43ca74},'attributes':['id'],'include':[{'model':db[_0xddd5('0x70')],'as':_0xddd5('0x71'),'attributes':['id',_0xddd5('0x36'),'online',_0xddd5('0x72'),_0xddd5('0x73')],'raw':!![]}]})[_0xddd5('0x23')](function(_0x532ccd){if(_0x532ccd){var _0x58ad4f=_['flatMap'](_0x532ccd,function(_0x2e8902){var _0x202119=_0x2e8902['get']({'plain':!![]});return _0x202119[_0xddd5('0x71')];});return db['ChatQueue'][_0xddd5('0x53')]({'where':{'id':_0x1159c2['params']['id']}})[_0xddd5('0x23')](function(_0x2e6576){return db[_0xddd5('0x74')]['transaction'](function(_0x160f92){return _0x2e6576[_0xddd5('0x75')](_0x43ca74,{'transaction':_0x160f92})[_0xddd5('0x23')](function(){return BPromise['each'](_0x58ad4f,function(_0x5a9ba9){return db[_0xddd5('0x62')][_0xddd5('0x76')]({'where':{'UserId':_0x5a9ba9['id'],'ChatQueueId':_0x1159c2['params']['id']},'transaction':_0x160f92});});})[_0xddd5('0x23')](function(){_0x58ad4f[_0xddd5('0x77')](function(_0x3e3310){socket[_0xddd5('0x78')]('userChatQueue:save',{'UserId':_0x3e3310['id'],'ChatQueueId':_0x2e6576['id']});});});});});}})[_0xddd5('0x23')](respondWithStatusCode(_0x440ed5,null))[_0xddd5('0x2c')](handleError(_0x440ed5,null));};exports[_0xddd5('0x79')]=function(_0x32ad22,_0x306dc0,_0x44c217){return db[_0xddd5('0x6e')]['findAll']({'where':{'id':_0x32ad22['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xddd5('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xddd5('0x23')](handleEntityNotFound(_0x306dc0,null))[_0xddd5('0x23')](function(_0x23c0c4){var _0x57f054=_[_0xddd5('0x39')](_0x23c0c4,'id');var _0xed9cf3=[];var _0x2675ef=[];var _0x4695a4=squel['select']();_0x4695a4[_0xddd5('0x7a')](_0xddd5('0x7b'))[_0xddd5('0x7c')]('team_has_chat_queues','tq')[_0xddd5('0x7d')](_0xddd5('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xddd5('0x7f'),_0x32ad22['params']['id']);for(var _0x1f44de=0x0;_0x1f44de<_0x23c0c4[_0xddd5('0x44')];_0x1f44de+=0x1){let _0x28da19=_0x23c0c4[_0x1f44de];for(var _0x15dea9=0x0;_0x15dea9<_0x28da19[_0xddd5('0x71')][_0xddd5('0x44')];_0x15dea9+=0x1){let _0x395b53=_0x28da19['Agents'][_0x15dea9];var _0x2b1425=_0x4695a4['clone']();_0x2b1425[_0xddd5('0x4b')](_0xddd5('0x80'),_0x395b53['id']);_0x2675ef[_0xddd5('0x81')](db[_0xddd5('0x74')][_0xddd5('0x3f')](_0x2b1425[_0xddd5('0x82')](),{'type':db[_0xddd5('0x74')]['QueryTypes'][_0xddd5('0x83')]})[_0xddd5('0x23')](function(_0x8a8de7){if(_0x8a8de7['length']===0x1){return _0x395b53['id'];}else{var _0x3af786=_[_0xddd5('0x84')](_['map'](_0x8a8de7,_0xddd5('0x85')),function(_0x552df5){return _[_0xddd5('0x86')](_0x57f054,_0x552df5);});if(_0x3af786){return _0x395b53['id'];}}}));}}return BPromise[_0xddd5('0x87')](_0x2675ef)['then'](function(_0x2592e1){_0xed9cf3=_(_0xed9cf3)[_0xddd5('0x88')](_0x2592e1)[_0xddd5('0x89')]()[_0xddd5('0x8a')]();return db[_0xddd5('0x3a')][_0xddd5('0x53')]({'where':{'id':_0x32ad22[_0xddd5('0x5d')]['id']}})[_0xddd5('0x23')](function(_0x4b6c56){return db[_0xddd5('0x74')]['transaction'](function(_0x5707b5){return _0x4b6c56['removeTeams'](_0x32ad22[_0xddd5('0x3f')][_0xddd5('0x6f')],{'transaction':_0x5707b5})[_0xddd5('0x23')](function(){if(!_[_0xddd5('0x8b')](_0xed9cf3)){return _0x4b6c56[_0xddd5('0x8c')](_0xed9cf3,{'transaction':_0x5707b5});}})['then'](function(){_0xed9cf3['forEach'](function(_0x2f0e00){socket[_0xddd5('0x78')](_0xddd5('0x8d'),{'UserId':_0x2f0e00,'ChatQueueId':_0x4b6c56['id']});});});});});});})[_0xddd5('0x23')](respondWithStatusCode(_0x306dc0,null))[_0xddd5('0x2c')](handleError(_0x306dc0,null));};exports[_0xddd5('0x8e')]=function(_0x48b1f9,_0x55739d,_0x509349){return db[_0xddd5('0x3a')][_0xddd5('0x53')]({'where':{'id':_0x48b1f9[_0xddd5('0x5d')]['id']}})[_0xddd5('0x23')](handleEntityNotFound(_0x55739d,null))[_0xddd5('0x23')](function(_0x197392){if(_0x197392){return _0x197392['addAgents'](_0x48b1f9['body']['ids'],_[_0xddd5('0x8f')](_0x48b1f9[_0xddd5('0x5e')],[_0xddd5('0x6f'),'id'])||{})['spread'](function(_0x67b276){for(var _0xfac710=0x0;_0xfac710<_0x48b1f9[_0xddd5('0x5e')][_0xddd5('0x6f')][_0xddd5('0x44')];_0xfac710+=0x1){socket['emit'](_0xddd5('0x90'),{'UserId':_0x48b1f9[_0xddd5('0x5e')]['ids'][_0xfac710],'ChatQueueId':_0x48b1f9['params']['id']});}return _0x67b276;});}})[_0xddd5('0x23')](respondWithResult(_0x55739d,null))[_0xddd5('0x2c')](handleError(_0x55739d,null));};exports[_0xddd5('0x8c')]=function(_0x290878,_0x1ee880,_0x17040b){return db['ChatQueue'][_0xddd5('0x53')]({'where':{'id':_0x290878[_0xddd5('0x5d')]['id']}})[_0xddd5('0x23')](handleEntityNotFound(_0x1ee880,null))[_0xddd5('0x23')](function(_0x36894c){if(_0x36894c){return _0x36894c[_0xddd5('0x8c')](_0x290878[_0xddd5('0x3f')][_0xddd5('0x6f')])[_0xddd5('0x23')](function(){if(_[_0xddd5('0x91')](_0x290878[_0xddd5('0x3f')][_0xddd5('0x6f')])){for(var _0x43d28c=0x0;_0x43d28c<_0x290878['query'][_0xddd5('0x6f')][_0xddd5('0x44')];_0x43d28c+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x290878[_0xddd5('0x3f')][_0xddd5('0x6f')][_0x43d28c]),'ChatQueueId':Number(_0x290878['params']['id'])});}}else{socket[_0xddd5('0x78')]('userChatQueue:remove',{'UserId':Number(_0x290878['query']['ids']),'ChatQueueId':Number(_0x290878['params']['id'])});}});}})[_0xddd5('0x23')](respondWithStatusCode(_0x1ee880,null))[_0xddd5('0x2c')](handleError(_0x1ee880,null));};exports[_0xddd5('0x92')]=function(_0x3155bb,_0x2e60f4,_0x4f54d9){var _0x5bd44f={};var _0x533e48={};var _0x2e7700;var _0xe5da0f;return db['ChatQueue']['findOne']({'where':{'id':_0x3155bb[_0xddd5('0x5d')]['id']}})[_0xddd5('0x23')](handleEntityNotFound(_0x2e60f4,null))[_0xddd5('0x23')](function(_0x1af0c3){if(_0x1af0c3){_0x2e7700=_0x1af0c3;_0x533e48[_0xddd5('0x3e')]=_[_0xddd5('0x40')](db[_0xddd5('0x70')][_0xddd5('0x3b')]);_0x533e48[_0xddd5('0x3f')]=_[_0xddd5('0x40')](_0x3155bb[_0xddd5('0x3f')]);_0x533e48[_0xddd5('0x41')]=_[_0xddd5('0x42')](_0x533e48[_0xddd5('0x3e')],_0x533e48[_0xddd5('0x3f')]);_0x5bd44f[_0xddd5('0x45')]=_[_0xddd5('0x42')](_0x533e48[_0xddd5('0x3e')],qs[_0xddd5('0x43')](_0x3155bb['query'][_0xddd5('0x43')]));_0x5bd44f[_0xddd5('0x45')]=_0x5bd44f[_0xddd5('0x45')][_0xddd5('0x44')]?_0x5bd44f[_0xddd5('0x45')]:_0x533e48['model'];_0x5bd44f['order']=qs['sort'](_0x3155bb['query'][_0xddd5('0x4a')]);_0x5bd44f[_0xddd5('0x4b')]=qs[_0xddd5('0x41')](_['pick'](_0x3155bb[_0xddd5('0x3f')],_0x533e48['filters']));if(_0x3155bb[_0xddd5('0x3f')][_0xddd5('0x4c')]){_0x5bd44f[_0xddd5('0x4b')]=_[_0xddd5('0x4d')](_0x5bd44f['where'],{'$or':_[_0xddd5('0x39')](_0x5bd44f['attributes'],function(_0x5c4fd7){var _0x5b0767={};_0x5b0767[_0x5c4fd7]={'$like':'%'+_0x3155bb[_0xddd5('0x3f')][_0xddd5('0x4c')]+'%'};return _0x5b0767;})});}_0x5bd44f=_[_0xddd5('0x4d')]({},_0x5bd44f,_0x3155bb['options']);return _0x2e7700[_0xddd5('0x92')](_0x5bd44f);}})['then'](function(_0x4d2263){if(_0x4d2263){_0xe5da0f=_0x4d2263[_0xddd5('0x44')];if(!_0x3155bb[_0xddd5('0x3f')][_0xddd5('0x46')](_0xddd5('0x47'))){_0x5bd44f[_0xddd5('0x31')]=qs[_0xddd5('0x31')](_0x3155bb[_0xddd5('0x3f')][_0xddd5('0x31')]);_0x5bd44f[_0xddd5('0x48')]=qs[_0xddd5('0x48')](_0x3155bb[_0xddd5('0x3f')][_0xddd5('0x48')]);}return _0x2e7700[_0xddd5('0x92')](_0x5bd44f);}})['then'](function(_0x22956a){if(_0x22956a){return _0x22956a?{'count':_0xe5da0f,'rows':_0x22956a}:null;}})['then'](respondWithResult(_0x2e60f4,null))[_0xddd5('0x2c')](handleError(_0x2e60f4,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 91c9176..b0f8df5 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 _0x9e1f=['emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0xc941ea,_0x408c2e){var _0x3b0f27=function(_0x5a4233){while(--_0x5a4233){_0xc941ea['push'](_0xc941ea['shift']());}};_0x3b0f27(++_0x408c2e);}(_0x9e1f,0x9c));var _0xf9e1=function(_0x38dd3d,_0x102650){_0x38dd3d=_0x38dd3d-0x0;var _0x3d55c0=_0x9e1f[_0x38dd3d];return _0x3d55c0;};'use strict';var EventEmitter=require(_0xf9e1('0x0'));var ChatQueue=require(_0xf9e1('0x1'))['db'][_0xf9e1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf9e1('0x3')](0x0);var events={'afterCreate':_0xf9e1('0x4'),'afterUpdate':_0xf9e1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4e030c){return function(_0x46447,_0x6249ac,_0x315da2){ChatQueueEvents[_0xf9e1('0x6')](_0x4e030c+':'+_0x46447['id'],_0x46447);ChatQueueEvents[_0xf9e1('0x6')](_0x4e030c,_0x46447);_0x315da2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xf9e1('0x7')](e,emitEvent(event));}}module[_0xf9e1('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x1fec=['remove','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x5db8a5,_0x27f891){var _0x5d4feb=function(_0x5c17f9){while(--_0x5c17f9){_0x5db8a5['push'](_0x5db8a5['shift']());}};_0x5d4feb(++_0x27f891);}(_0x1fec,0x1ea));var _0xc1fe=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x1fec[_0x1ccdf7];return _0x52a0ae;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc1fe('0x0'))['db'][_0xc1fe('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc1fe('0x2')](0x0);var events={'afterCreate':_0xc1fe('0x3'),'afterUpdate':_0xc1fe('0x4'),'afterDestroy':_0xc1fe('0x5')};function emitEvent(_0x391d0f){return function(_0x381dfc,_0x4d2952,_0x39f5e5){ChatQueueEvents['emit'](_0x391d0f+':'+_0x381dfc['id'],_0x381dfc);ChatQueueEvents['emit'](_0x391d0f,_0x381dfc);_0x39f5e5(null);};}for(var e in events){if(events[_0xc1fe('0x6')](e)){var event=events[e];ChatQueue[_0xc1fe('0x7')](e,emitEvent(event));}}module[_0xc1fe('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index bb502f8..45dc9ca 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 _0x83fa=['define','ChatQueue','chat_queues','lodash','util','moment','bluebird','path','rimraf','./chatQueue.attributes'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x83fa,0xb7));var _0xa83f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x83fa[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xa83f('0x0'));var util=require(_0xa83f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa83f('0x2'));var BPromise=require(_0xa83f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa83f('0x4'));var rimraf=require(_0xa83f('0x5'));var config=require('../../config/environment');var attributes=require(_0xa83f('0x6'));module['exports']=function(_0x12ae59,_0x401a2e){return _0x12ae59[_0xa83f('0x7')](_0xa83f('0x8'),attributes,{'tableName':_0xa83f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58df=['chat_queues','lodash','util','api','moment','request-promise','path','rimraf','exports','define','ChatQueue'];(function(_0x5d92f3,_0x4d0faa){var _0x4ba25c=function(_0x3216eb){while(--_0x3216eb){_0x5d92f3['push'](_0x5d92f3['shift']());}};_0x4ba25c(++_0x4d0faa);}(_0x58df,0x90));var _0xf58d=function(_0x3cff2a,_0x384597){_0x3cff2a=_0x3cff2a-0x0;var _0xdf8d4a=_0x58df[_0x3cff2a];return _0xdf8d4a;};'use strict';var _=require(_0xf58d('0x0'));var util=require(_0xf58d('0x1'));var logger=require('../../config/logger')(_0xf58d('0x2'));var moment=require(_0xf58d('0x3'));var BPromise=require('bluebird');var rp=require(_0xf58d('0x4'));var fs=require('fs');var path=require(_0xf58d('0x5'));var rimraf=require(_0xf58d('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xf58d('0x7')]=function(_0x11a3c3,_0x138ac8){return _0x11a3c3[_0xf58d('0x8')](_0xf58d('0x9'),attributes,{'tableName':_0xf58d('0xa'),'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 7daafff..3c94619 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 _0x3af5=['redis','localhost','socket.io-emitter','./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowChatQueue','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','defaults'];(function(_0x320f74,_0x552318){var _0xc043ab=function(_0x5c8ef1){while(--_0x5c8ef1){_0x320f74['push'](_0x320f74['shift']());}};_0xc043ab(++_0x552318);}(_0x3af5,0x1d3));var _0x53af=function(_0x4c1b76,_0x2cdc2d){_0x4c1b76=_0x4c1b76-0x0;var _0x3ace6b=_0x3af5[_0x4c1b76];return _0x3ace6b;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var moment=require('moment');var BPromise=require(_0x53af('0x2'));var rs=require(_0x53af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53af('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x53af('0x5'));var jayson=require(_0x53af('0x6'));var client=jayson['client'][_0x53af('0x7')]({'port':0x232a});config['redis']=_[_0x53af('0x8')](config[_0x53af('0x9')],{'host':_0x53af('0xa'),'port':0x18eb});var socket=require(_0x53af('0xb'))(new Redis(config[_0x53af('0x9')]));require(_0x53af('0xc'))['register'](socket);function respondWithRpcPromise(_0x52b4d1,_0x10ee70,_0x5727e6){return new BPromise(function(_0x370cdc,_0x4673a9){return client['request'](_0x52b4d1,_0x5727e6)[_0x53af('0xd')](function(_0x1a08ca){logger['info'](_0x53af('0xe'),_0x10ee70,_0x53af('0xf'));logger[_0x53af('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x10ee70,_0x53af('0xf'),JSON['stringify'](_0x1a08ca));if(_0x1a08ca[_0x53af('0x11')]){if(_0x1a08ca[_0x53af('0x11')][_0x53af('0x12')]===0x1f4){logger[_0x53af('0x11')](_0x53af('0xe'),_0x10ee70,_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);return _0x4673a9(_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);}logger[_0x53af('0x11')]('ChatQueue,\x20%s,\x20%s',_0x10ee70,_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);return _0x370cdc(_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);}else{logger[_0x53af('0x14')](_0x53af('0xe'),_0x10ee70,_0x53af('0xf'));_0x370cdc(_0x1a08ca['result'][_0x53af('0x13')]);}})[_0x53af('0x15')](function(_0xae3142){logger[_0x53af('0x11')]('ChatQueue,\x20%s,\x20%s',_0x10ee70,_0xae3142);_0x4673a9(_0xae3142);});});}exports['GetChatQueue']=function(_0x167dc2){var _0x3f5503=this;return new Promise(function(_0x37ecb3,_0x5a31d6){return db[_0x53af('0x16')][_0x53af('0x17')]({'raw':_0x167dc2[_0x53af('0x18')]?_0x167dc2[_0x53af('0x18')][_0x53af('0x19')]===undefined?!![]:![]:!![],'where':_0x167dc2[_0x53af('0x18')]?_0x167dc2[_0x53af('0x18')][_0x53af('0x1a')]||null:null,'attributes':_0x167dc2['options']?_0x167dc2[_0x53af('0x18')][_0x53af('0x1b')]||null:null,'limit':_0x167dc2[_0x53af('0x18')]?_0x167dc2[_0x53af('0x18')][_0x53af('0x1c')]||null:null,'include':_0x167dc2[_0x53af('0x18')]?_0x167dc2['options'][_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x167dc2[_0x53af('0x18')][_0x53af('0x1d')],function(_0x480665){return{'model':db[_0x480665[_0x53af('0x1f')]],'as':_0x480665['as'],'attributes':_0x480665[_0x53af('0x1b')],'include':_0x480665[_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x480665[_0x53af('0x1d')],function(_0x152dcc){return{'model':db[_0x152dcc[_0x53af('0x1f')]],'as':_0x152dcc['as'],'attributes':_0x152dcc[_0x53af('0x1b')],'include':_0x152dcc['include']?_[_0x53af('0x1e')](_0x152dcc[_0x53af('0x1d')],function(_0xc9b0df){return{'model':db[_0xc9b0df[_0x53af('0x1f')]],'as':_0xc9b0df['as'],'attributes':_0xc9b0df[_0x53af('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x53af('0xd')](function(_0x154cc2){logger['info']('GetChatQueue',_0x167dc2);logger[_0x53af('0x10')]('GetChatQueue',_0x167dc2,JSON[_0x53af('0x20')](_0x154cc2));_0x37ecb3(_0x154cc2);})[_0x53af('0x15')](function(_0x38563d){logger[_0x53af('0x11')]('GetChatQueue',_0x38563d[_0x53af('0x13')],_0x167dc2);_0x5a31d6(_0x3f5503[_0x53af('0x11')](0x1f4,_0x38563d['message']));});});};exports['ShowChatQueue']=function(_0xc0dae3){var _0x1fa69c=this;return new Promise(function(_0x1a688c,_0x243ee5){return db['ChatQueue']['find']({'raw':_0xc0dae3[_0x53af('0x18')]?_0xc0dae3[_0x53af('0x18')][_0x53af('0x19')]===undefined?!![]:![]:!![],'where':_0xc0dae3['options']?_0xc0dae3['options'][_0x53af('0x1a')]||null:null,'attributes':_0xc0dae3[_0x53af('0x18')]?_0xc0dae3[_0x53af('0x18')][_0x53af('0x1b')]||null:null,'include':_0xc0dae3[_0x53af('0x18')]?_0xc0dae3[_0x53af('0x18')][_0x53af('0x1d')]?_['map'](_0xc0dae3[_0x53af('0x18')][_0x53af('0x1d')],function(_0x51784e){return{'model':db[_0x51784e[_0x53af('0x1f')]],'as':_0x51784e['as'],'attributes':_0x51784e[_0x53af('0x1b')],'include':_0x51784e[_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x51784e[_0x53af('0x1d')],function(_0x576bfc){return{'model':db[_0x576bfc[_0x53af('0x1f')]],'as':_0x576bfc['as'],'attributes':_0x576bfc['attributes'],'include':_0x576bfc[_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x576bfc[_0x53af('0x1d')],function(_0x1213a6){return{'model':db[_0x1213a6[_0x53af('0x1f')]],'as':_0x1213a6['as'],'attributes':_0x1213a6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e3295){logger[_0x53af('0x14')]('ShowChatQueue',_0xc0dae3);logger['debug']('ShowChatQueue',_0xc0dae3,JSON[_0x53af('0x20')](_0x5e3295));_0x1a688c(_0x5e3295);})[_0x53af('0x15')](function(_0x440655){logger[_0x53af('0x11')](_0x53af('0x21'),_0x440655[_0x53af('0x13')],_0xc0dae3);_0x243ee5(_0x1fa69c[_0x53af('0x11')](0x1f4,_0x440655[_0x53af('0x13')]));});});}; \ No newline at end of file +var _0x3149=['ChatQueue,\x20%s,\x20%s','message','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','catch','ShowChatQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x3149,0x181));var _0x9314=function(_0x4f2e54,_0x318457){_0x4f2e54=_0x4f2e54-0x0;var _0x4bc9b0=_0x3149[_0x4f2e54];return _0x4bc9b0;};'use strict';var _=require(_0x9314('0x0'));var util=require('util');var moment=require(_0x9314('0x1'));var BPromise=require(_0x9314('0x2'));var rs=require(_0x9314('0x3'));var fs=require('fs');var Redis=require(_0x9314('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9314('0x5'));var logger=require(_0x9314('0x6'))(_0x9314('0x7'));var config=require(_0x9314('0x8'));var jayson=require(_0x9314('0x9'));var client=jayson['client'][_0x9314('0xa')]({'port':0x232a});config[_0x9314('0xb')]=_[_0x9314('0xc')](config[_0x9314('0xb')],{'host':_0x9314('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9314('0xb')]));require('./chatQueue.socket')[_0x9314('0xe')](socket);function respondWithRpcPromise(_0x50128c,_0x1629f4,_0x18e92c){return new BPromise(function(_0x55a936,_0x3ef023){return client['request'](_0x50128c,_0x18e92c)[_0x9314('0xf')](function(_0x410894){logger[_0x9314('0x10')]('ChatQueue,\x20%s,\x20%s',_0x1629f4,_0x9314('0x11'));logger[_0x9314('0x12')](_0x9314('0x13'),_0x1629f4,_0x9314('0x11'),JSON[_0x9314('0x14')](_0x410894));if(_0x410894[_0x9314('0x15')]){if(_0x410894[_0x9314('0x15')]['code']===0x1f4){logger[_0x9314('0x15')](_0x9314('0x16'),_0x1629f4,_0x410894[_0x9314('0x15')]['message']);return _0x3ef023(_0x410894[_0x9314('0x15')][_0x9314('0x17')]);}logger[_0x9314('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1629f4,_0x410894[_0x9314('0x15')][_0x9314('0x17')]);return _0x55a936(_0x410894['error'][_0x9314('0x17')]);}else{logger[_0x9314('0x10')](_0x9314('0x16'),_0x1629f4,'request\x20sent');_0x55a936(_0x410894['result'][_0x9314('0x17')]);}})['catch'](function(_0x38832f){logger[_0x9314('0x15')](_0x9314('0x16'),_0x1629f4,_0x38832f);_0x3ef023(_0x38832f);});});}exports[_0x9314('0x18')]=function(_0x262aab){var _0xc23022=this;return new Promise(function(_0x5eb841,_0x1046ae){return db[_0x9314('0x19')][_0x9314('0x1a')]({'raw':_0x262aab['options']?_0x262aab[_0x9314('0x1b')][_0x9314('0x1c')]===undefined?!![]:![]:!![],'where':_0x262aab[_0x9314('0x1b')]?_0x262aab[_0x9314('0x1b')]['where']||null:null,'attributes':_0x262aab[_0x9314('0x1b')]?_0x262aab[_0x9314('0x1b')][_0x9314('0x1d')]||null:null,'limit':_0x262aab[_0x9314('0x1b')]?_0x262aab['options'][_0x9314('0x1e')]||null:null,'include':_0x262aab[_0x9314('0x1b')]?_0x262aab[_0x9314('0x1b')]['include']?_['map'](_0x262aab[_0x9314('0x1b')][_0x9314('0x1f')],function(_0x242096){return{'model':db[_0x242096[_0x9314('0x20')]],'as':_0x242096['as'],'attributes':_0x242096[_0x9314('0x1d')],'include':_0x242096['include']?_['map'](_0x242096[_0x9314('0x1f')],function(_0x460a46){return{'model':db[_0x460a46['model']],'as':_0x460a46['as'],'attributes':_0x460a46[_0x9314('0x1d')],'include':_0x460a46[_0x9314('0x1f')]?_[_0x9314('0x21')](_0x460a46[_0x9314('0x1f')],function(_0x239822){return{'model':db[_0x239822['model']],'as':_0x239822['as'],'attributes':_0x239822[_0x9314('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9314('0xf')](function(_0x9242d7){logger['info'](_0x9314('0x18'),_0x262aab);logger[_0x9314('0x12')](_0x9314('0x18'),_0x262aab,JSON[_0x9314('0x14')](_0x9242d7));_0x5eb841(_0x9242d7);})[_0x9314('0x22')](function(_0x1fc96b){logger['error']('GetChatQueue',_0x1fc96b[_0x9314('0x17')],_0x262aab);_0x1046ae(_0xc23022[_0x9314('0x15')](0x1f4,_0x1fc96b['message']));});});};exports[_0x9314('0x23')]=function(_0x572d47){var _0xf10178=this;return new Promise(function(_0x129154,_0xeb6ba8){return db[_0x9314('0x19')][_0x9314('0x24')]({'raw':_0x572d47[_0x9314('0x1b')]?_0x572d47[_0x9314('0x1b')][_0x9314('0x1c')]===undefined?!![]:![]:!![],'where':_0x572d47[_0x9314('0x1b')]?_0x572d47[_0x9314('0x1b')]['where']||null:null,'attributes':_0x572d47[_0x9314('0x1b')]?_0x572d47[_0x9314('0x1b')][_0x9314('0x1d')]||null:null,'include':_0x572d47[_0x9314('0x1b')]?_0x572d47[_0x9314('0x1b')][_0x9314('0x1f')]?_[_0x9314('0x21')](_0x572d47[_0x9314('0x1b')]['include'],function(_0x1584ad){return{'model':db[_0x1584ad[_0x9314('0x20')]],'as':_0x1584ad['as'],'attributes':_0x1584ad[_0x9314('0x1d')],'include':_0x1584ad[_0x9314('0x1f')]?_[_0x9314('0x21')](_0x1584ad['include'],function(_0x3e031c){return{'model':db[_0x3e031c[_0x9314('0x20')]],'as':_0x3e031c['as'],'attributes':_0x3e031c['attributes'],'include':_0x3e031c[_0x9314('0x1f')]?_[_0x9314('0x21')](_0x3e031c[_0x9314('0x1f')],function(_0x5860cc){return{'model':db[_0x5860cc[_0x9314('0x20')]],'as':_0x5860cc['as'],'attributes':_0x5860cc[_0x9314('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9314('0xf')](function(_0x1f25d8){logger[_0x9314('0x10')](_0x9314('0x23'),_0x572d47);logger[_0x9314('0x12')](_0x9314('0x23'),_0x572d47,JSON['stringify'](_0x1f25d8));_0x129154(_0x1f25d8);})[_0x9314('0x22')](function(_0x3aa82f){logger[_0x9314('0x15')](_0x9314('0x23'),_0x3aa82f[_0x9314('0x17')],_0x572d47);_0xeb6ba8(_0xf10178[_0x9314('0x15')](0x1f4,_0x3aa82f[_0x9314('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 2d788ee..d84db37 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 _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x560912,_0x551971){var _0x2767e9=function(_0x138e60){while(--_0x138e60){_0x560912['push'](_0x560912['shift']());}};_0x2767e9(++_0x551971);}(_0x5089,0x1bb));var _0x9508=function(_0x3015f9,_0x6eeb0d){_0x3015f9=_0x3015f9-0x0;var _0x3390b6=_0x5089[_0x3015f9];return _0x3390b6;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}}; \ No newline at end of file +var _0x9a19=['removeListener','register','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9a19,0x114));var _0x99a1=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0x9a19[_0x16bb4b];return _0x8aeb84;};'use strict';var ChatQueueEvents=require(_0x99a1('0x0'));var events=[_0x99a1('0x1'),_0x99a1('0x2'),'update'];function createListener(_0x16fd8b,_0x2ba463){return function(_0x112bcc){_0x2ba463[_0x99a1('0x3')](_0x16fd8b,_0x112bcc);};}function removeListener(_0x214082,_0x3d73c5){return function(){ChatQueueEvents[_0x99a1('0x4')](_0x214082,_0x3d73c5);};}exports[_0x99a1('0x5')]=function(_0x3eff4a){for(var _0xff0240=0x0,_0x65045d=events['length'];_0xff0240<_0x65045d;_0xff0240++){var _0x4d2a5c=events[_0xff0240];var _0x5aa6c2=createListener(_0x99a1('0x6')+_0x4d2a5c,_0x3eff4a);ChatQueueEvents['on'](_0x4d2a5c,_0x5aa6c2);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index e8483bd..b8de2ef 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x478cf4,_0x25c2e5){_0x478cf4=_0x478cf4-0x0;var _0x59273e=_0x3e74[_0x478cf4];return _0x59273e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x4ae1f4,_0x3a0390){_0x4ae1f4=_0x4ae1f4-0x0;var _0x14aa4d=_0x3e74[_0x4ae1f4];return _0x14aa4d;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('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 2475849..ee54373 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 _0x4e2e=['exports','STRING','DATE','moment','sequelize'];(function(_0x266628,_0x3e9ed8){var _0x3103c8=function(_0x54ac81){while(--_0x54ac81){_0x266628['push'](_0x266628['shift']());}};_0x3103c8(++_0x3e9ed8);}(_0x4e2e,0x193));var _0xe4e2=function(_0x29f740,_0x557fa9){_0x29f740=_0x29f740-0x0;var _0x200a0e=_0x4e2e[_0x29f740];return _0x200a0e;};'use strict';var moment=require(_0xe4e2('0x0'));var Sequelize=require(_0xe4e2('0x1'));module[_0xe4e2('0x2')]={'uniqueid':{'type':Sequelize[_0xe4e2('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe4e2('0x4')]},'leaveAt':{'type':Sequelize[_0xe4e2('0x4')]},'acceptAt':{'type':Sequelize[_0xe4e2('0x4')]},'exitAt':{'type':Sequelize[_0xe4e2('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5eda=['exports','STRING','DATE','moment'];(function(_0x559364,_0x223995){var _0x3b4555=function(_0x1700a2){while(--_0x1700a2){_0x559364['push'](_0x559364['shift']());}};_0x3b4555(++_0x223995);}(_0x5eda,0xef));var _0xa5ed=function(_0x5bbe3e,_0x477028){_0x5bbe3e=_0x5bbe3e-0x0;var _0x32b632=_0x5eda[_0x5bbe3e];return _0x32b632;};'use strict';var moment=require(_0xa5ed('0x0'));var Sequelize=require('sequelize');module[_0xa5ed('0x1')]={'uniqueid':{'type':Sequelize[_0xa5ed('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa5ed('0x2')]},'joinAt':{'type':Sequelize[_0xa5ed('0x3')]},'leaveAt':{'type':Sequelize[_0xa5ed('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa5ed('0x3')]},'reason':{'type':Sequelize[_0xa5ed('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 7dcceab..f302db1 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 _0xd101=['then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update'];(function(_0x3077f4,_0x4b72fc){var _0x34db88=function(_0x31784a){while(--_0x31784a){_0x3077f4['push'](_0x3077f4['shift']());}};_0x34db88(++_0x4b72fc);}(_0xd101,0xc1));var _0x1d10=function(_0x1a19cf,_0x388a28){_0x1a19cf=_0x1a19cf-0x0;var _0x4e164a=_0xd101[_0x1a19cf];return _0x4e164a;};'use strict';var emlformat=require(_0x1d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d10('0x1'));var jsonpatch=require(_0x1d10('0x2'));var rp=require(_0x1d10('0x3'));var moment=require(_0x1d10('0x4'));var BPromise=require(_0x1d10('0x5'));var Mustache=require(_0x1d10('0x6'));var util=require(_0x1d10('0x7'));var path=require(_0x1d10('0x8'));var sox=require('sox');var csv=require(_0x1d10('0x9'));var ejs=require(_0x1d10('0xa'));var fs=require('fs');var fs_extra=require(_0x1d10('0xb'));var _=require(_0x1d10('0xc'));var squel=require(_0x1d10('0xd'));var crypto=require(_0x1d10('0xe'));var jsforce=require(_0x1d10('0xf'));var deskjs=require(_0x1d10('0x10'));var toCsv=require(_0x1d10('0x9'));var querystring=require(_0x1d10('0x11'));var Papa=require(_0x1d10('0x12'));var Redis=require(_0x1d10('0x13'));var authService=require(_0x1d10('0x14'));var qs=require(_0x1d10('0x15'));var as=require(_0x1d10('0x16'));var hardwareService=require(_0x1d10('0x17'));var logger=require(_0x1d10('0x18'))('api');var utils=require(_0x1d10('0x19'));var config=require(_0x1d10('0x1a'));var licenseUtil=require(_0x1d10('0x1b'));var db=require(_0x1d10('0x1c'))['db'];function respondWithStatusCode(_0x268506,_0x5b71d8){_0x5b71d8=_0x5b71d8||0xcc;return function(_0x3f6bd8){if(_0x3f6bd8){return _0x268506[_0x1d10('0x1d')](_0x5b71d8);}return _0x268506[_0x1d10('0x1e')](_0x5b71d8)[_0x1d10('0x1f')]();};}function respondWithResult(_0x2224ff,_0x183bc4){_0x183bc4=_0x183bc4||0xc8;return function(_0x56bc3d){if(_0x56bc3d){return _0x2224ff[_0x1d10('0x1e')](_0x183bc4)[_0x1d10('0x20')](_0x56bc3d);}};}function respondWithFilteredResult(_0x306953,_0x2ad3c0){return function(_0x4f014a){if(_0x4f014a){var _0x3aedf7=typeof _0x2ad3c0[_0x1d10('0x21')]===_0x1d10('0x22')&&typeof _0x2ad3c0[_0x1d10('0x23')]===_0x1d10('0x22');var _0x382b37=_0x4f014a[_0x1d10('0x24')];var _0x4f3e2a=_0x3aedf7?0x0:_0x2ad3c0[_0x1d10('0x21')];var _0x1163dd=_0x3aedf7?_0x4f014a[_0x1d10('0x24')]:_0x2ad3c0[_0x1d10('0x21')]+_0x2ad3c0[_0x1d10('0x23')];var _0x5e61f8;if(_0x1163dd>=_0x382b37){_0x1163dd=_0x382b37;_0x5e61f8=0xc8;}else{_0x5e61f8=0xce;}_0x306953['status'](_0x5e61f8);return _0x306953[_0x1d10('0x25')]('Content-Range',_0x4f3e2a+'-'+_0x1163dd+'/'+_0x382b37)['json'](_0x4f014a);}return null;};}function patchUpdates(_0x5774f9){return function(_0x237b92){try{jsonpatch[_0x1d10('0x26')](_0x237b92,_0x5774f9,!![]);}catch(_0x24717c){return BPromise[_0x1d10('0x27')](_0x24717c);}return _0x237b92['save']();};}function saveUpdates(_0x5e5315,_0x140147){return function(_0x5da6cf){if(_0x5da6cf){return _0x5da6cf[_0x1d10('0x28')](_0x5e5315)[_0x1d10('0x29')](function(_0x160802){return _0x160802;});}return null;};}function removeEntity(_0x37f22d,_0x127b37){return function(_0x3601ba){if(_0x3601ba){return _0x3601ba[_0x1d10('0x2a')]()[_0x1d10('0x29')](function(){_0x37f22d[_0x1d10('0x1e')](0xcc)[_0x1d10('0x1f')]();});}};}function handleEntityNotFound(_0xf1e4c8,_0x5abc58){return function(_0x666012){if(!_0x666012){_0xf1e4c8[_0x1d10('0x1d')](0x194);}return _0x666012;};}function handleError(_0x475934,_0x15f2ee){_0x15f2ee=_0x15f2ee||0x1f4;return function(_0x18e7d9){logger[_0x1d10('0x2b')](_0x18e7d9[_0x1d10('0x2c')]);if(_0x18e7d9[_0x1d10('0x2d')]){delete _0x18e7d9['name'];}_0x475934[_0x1d10('0x1e')](_0x15f2ee)[_0x1d10('0x2e')](_0x18e7d9);};}exports['index']=function(_0x13a3dc,_0x52d514){var _0x4db221={},_0x41b5b8={},_0x597aea={'count':0x0,'rows':[]};var _0xa4e6aa=_[_0x1d10('0x2f')](db[_0x1d10('0x30')][_0x1d10('0x31')],function(_0x1a43fd){return{'name':_0x1a43fd[_0x1d10('0x32')],'type':_0x1a43fd['type']['key']};});_0x41b5b8[_0x1d10('0x33')]=_[_0x1d10('0x2f')](_0xa4e6aa,_0x1d10('0x2d'));_0x41b5b8[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x13a3dc[_0x1d10('0x34')]);_0x41b5b8[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x41b5b8[_0x1d10('0x33')],_0x41b5b8[_0x1d10('0x34')]);_0x4db221['attributes']=_[_0x1d10('0x37')](_0x41b5b8['model'],qs[_0x1d10('0x38')](_0x13a3dc[_0x1d10('0x34')]['fields']));_0x4db221[_0x1d10('0x39')]=_0x4db221['attributes'][_0x1d10('0x3a')]?_0x4db221[_0x1d10('0x39')]:_0x41b5b8[_0x1d10('0x33')];if(!_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3b')]('nolimit')){_0x4db221['limit']=qs[_0x1d10('0x23')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x23')]);_0x4db221['offset']=qs['offset'](_0x13a3dc['query'][_0x1d10('0x21')]);}_0x4db221['order']=qs[_0x1d10('0x3c')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3c')]);_0x4db221[_0x1d10('0x3d')]=qs['filters'](_['pick'](_0x13a3dc[_0x1d10('0x34')],_0x41b5b8[_0x1d10('0x36')]),_0xa4e6aa);if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]){_0x4db221['where']=_[_0x1d10('0x3f')](_0x4db221['where'],{'$or':_[_0x1d10('0x2f')](_0xa4e6aa,function(_0xec1f49){if(_0xec1f49[_0x1d10('0x40')]!==_0x1d10('0x41')){var _0x38addd={};_0x38addd[_0xec1f49[_0x1d10('0x2d')]]={'$like':'%'+_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]+'%'};return _0x38addd;}})});}_0x4db221=_[_0x1d10('0x3f')]({},_0x4db221,_0x13a3dc[_0x1d10('0x42')]);var _0x1cae38={'where':_0x4db221[_0x1d10('0x3d')]};return db[_0x1d10('0x30')]['count'](_0x1cae38)['then'](function(_0x35b2e3){_0x597aea[_0x1d10('0x24')]=_0x35b2e3;if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x43')]){_0x4db221[_0x1d10('0x44')]=[{'all':!![]}];}return db[_0x1d10('0x30')][_0x1d10('0x45')](_0x4db221);})['then'](function(_0x1a67e9){_0x597aea[_0x1d10('0x46')]=_0x1a67e9;return _0x597aea;})[_0x1d10('0x29')](respondWithFilteredResult(_0x52d514,_0x4db221))['catch'](handleError(_0x52d514,null));};exports[_0x1d10('0x47')]=function(_0x427cd7,_0x2ee987){var _0x598973={'raw':!![],'where':{'id':_0x427cd7[_0x1d10('0x48')]['id']}},_0x5795f1={};_0x5795f1[_0x1d10('0x33')]=_[_0x1d10('0x35')](db[_0x1d10('0x30')][_0x1d10('0x31')]);_0x5795f1[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x427cd7['query']);_0x5795f1[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x5795f1['model'],_0x5795f1[_0x1d10('0x34')]);_0x598973['attributes']=_[_0x1d10('0x37')](_0x5795f1['model'],qs['fields'](_0x427cd7[_0x1d10('0x34')][_0x1d10('0x38')]));_0x598973[_0x1d10('0x39')]=_0x598973[_0x1d10('0x39')][_0x1d10('0x3a')]?_0x598973[_0x1d10('0x39')]:_0x5795f1[_0x1d10('0x33')];if(_0x427cd7[_0x1d10('0x34')][_0x1d10('0x43')]){_0x598973['include']=[{'all':!![]}];}_0x598973=_['merge']({},_0x598973,_0x427cd7[_0x1d10('0x42')]);return db[_0x1d10('0x30')][_0x1d10('0x49')](_0x598973)[_0x1d10('0x29')](handleEntityNotFound(_0x2ee987,null))[_0x1d10('0x29')](respondWithResult(_0x2ee987,null))[_0x1d10('0x4a')](handleError(_0x2ee987,null));};exports['create']=function(_0x2db27f,_0x1b8513){return db[_0x1d10('0x30')][_0x1d10('0x4b')](_0x2db27f[_0x1d10('0x4c')],{})[_0x1d10('0x29')](respondWithResult(_0x1b8513,0xc9))[_0x1d10('0x4a')](handleError(_0x1b8513,null));};exports[_0x1d10('0x28')]=function(_0x39bf64,_0x32a9a9){if(_0x39bf64[_0x1d10('0x4c')]['id']){delete _0x39bf64[_0x1d10('0x4c')]['id'];}return db[_0x1d10('0x30')][_0x1d10('0x49')]({'where':{'id':_0x39bf64['params']['id']}})['then'](handleEntityNotFound(_0x32a9a9,null))[_0x1d10('0x29')](saveUpdates(_0x39bf64['body'],null))['then'](respondWithResult(_0x32a9a9,null))[_0x1d10('0x4a')](handleError(_0x32a9a9,null));};exports[_0x1d10('0x2a')]=function(_0x375fb1,_0x35d8fb){return db[_0x1d10('0x30')]['find']({'where':{'id':_0x375fb1['params']['id']}})['then'](handleEntityNotFound(_0x35d8fb,null))['then'](removeEntity(_0x35d8fb,null))[_0x1d10('0x4a')](handleError(_0x35d8fb,null));};exports[_0x1d10('0x4d')]=function(_0x4570c4,_0x3a4167){return db['ChatQueueReport'][_0x1d10('0x4d')]()[_0x1d10('0x29')](respondWithResult(_0x3a4167,null))[_0x1d10('0x4a')](handleError(_0x3a4167,null));}; \ No newline at end of file +var _0xfba8=['filter','merge','VIRTUAL','options','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','map','ChatQueueReport','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick'];(function(_0x5ed343,_0x190ce7){var _0x319bcb=function(_0x904ae2){while(--_0x904ae2){_0x5ed343['push'](_0x5ed343['shift']());}};_0x319bcb(++_0x190ce7);}(_0xfba8,0x1d6));var _0x8fba=function(_0x59618e,_0x2f4e70){_0x59618e=_0x59618e-0x0;var _0x28c6cd=_0xfba8[_0x59618e];return _0x28c6cd;};'use strict';var emlformat=require(_0x8fba('0x0'));var rimraf=require(_0x8fba('0x1'));var zipdir=require(_0x8fba('0x2'));var jsonpatch=require(_0x8fba('0x3'));var rp=require(_0x8fba('0x4'));var moment=require(_0x8fba('0x5'));var BPromise=require(_0x8fba('0x6'));var Mustache=require(_0x8fba('0x7'));var util=require(_0x8fba('0x8'));var path=require('path');var sox=require(_0x8fba('0x9'));var csv=require('to-csv');var ejs=require(_0x8fba('0xa'));var fs=require('fs');var fs_extra=require(_0x8fba('0xb'));var _=require(_0x8fba('0xc'));var squel=require(_0x8fba('0xd'));var crypto=require(_0x8fba('0xe'));var jsforce=require(_0x8fba('0xf'));var deskjs=require(_0x8fba('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8fba('0x11'));var Papa=require('papaparse');var Redis=require(_0x8fba('0x12'));var authService=require(_0x8fba('0x13'));var qs=require(_0x8fba('0x14'));var as=require(_0x8fba('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fba('0x16'))(_0x8fba('0x17'));var utils=require('../../config/utils');var config=require(_0x8fba('0x18'));var licenseUtil=require(_0x8fba('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e9b9f,_0x468ba7){_0x468ba7=_0x468ba7||0xcc;return function(_0x5b98f7){if(_0x5b98f7){return _0x5e9b9f[_0x8fba('0x1a')](_0x468ba7);}return _0x5e9b9f[_0x8fba('0x1b')](_0x468ba7)[_0x8fba('0x1c')]();};}function respondWithResult(_0x745513,_0x41f4cc){_0x41f4cc=_0x41f4cc||0xc8;return function(_0x3029c4){if(_0x3029c4){return _0x745513['status'](_0x41f4cc)['json'](_0x3029c4);}};}function respondWithFilteredResult(_0x307b94,_0xbd4229){return function(_0x2fa3ed){if(_0x2fa3ed){var _0x56cc5=typeof _0xbd4229[_0x8fba('0x1d')]===_0x8fba('0x1e')&&typeof _0xbd4229['limit']===_0x8fba('0x1e');var _0x389d8a=_0x2fa3ed[_0x8fba('0x1f')];var _0x3194e7=_0x56cc5?0x0:_0xbd4229[_0x8fba('0x1d')];var _0x3aba78=_0x56cc5?_0x2fa3ed[_0x8fba('0x1f')]:_0xbd4229[_0x8fba('0x1d')]+_0xbd4229['limit'];var _0x2564cc;if(_0x3aba78>=_0x389d8a){_0x3aba78=_0x389d8a;_0x2564cc=0xc8;}else{_0x2564cc=0xce;}_0x307b94[_0x8fba('0x1b')](_0x2564cc);return _0x307b94[_0x8fba('0x20')](_0x8fba('0x21'),_0x3194e7+'-'+_0x3aba78+'/'+_0x389d8a)[_0x8fba('0x22')](_0x2fa3ed);}return null;};}function patchUpdates(_0x5a2406){return function(_0xf2aab7){try{jsonpatch[_0x8fba('0x23')](_0xf2aab7,_0x5a2406,!![]);}catch(_0x532406){return BPromise[_0x8fba('0x24')](_0x532406);}return _0xf2aab7['save']();};}function saveUpdates(_0x525c86,_0x38a46e){return function(_0x5bc97a){if(_0x5bc97a){return _0x5bc97a[_0x8fba('0x25')](_0x525c86)[_0x8fba('0x26')](function(_0x393f24){return _0x393f24;});}return null;};}function removeEntity(_0x2f3225,_0x52eebd){return function(_0x31eaee){if(_0x31eaee){return _0x31eaee[_0x8fba('0x27')]()[_0x8fba('0x26')](function(){_0x2f3225['status'](0xcc)[_0x8fba('0x1c')]();});}};}function handleEntityNotFound(_0x5030c4,_0x35e22e){return function(_0x11bcd6){if(!_0x11bcd6){_0x5030c4[_0x8fba('0x1a')](0x194);}return _0x11bcd6;};}function handleError(_0x4c644d,_0x52eea9){_0x52eea9=_0x52eea9||0x1f4;return function(_0x38ad81){logger[_0x8fba('0x28')](_0x38ad81[_0x8fba('0x29')]);if(_0x38ad81[_0x8fba('0x2a')]){delete _0x38ad81[_0x8fba('0x2a')];}_0x4c644d[_0x8fba('0x1b')](_0x52eea9)['send'](_0x38ad81);};}exports['index']=function(_0x877157,_0x434e9e){var _0x3f0c26={},_0x20fd52={},_0xddc9f6={'count':0x0,'rows':[]};var _0x118a1e=_[_0x8fba('0x2b')](db[_0x8fba('0x2c')]['rawAttributes'],function(_0x16baa3){return{'name':_0x16baa3['fieldName'],'type':_0x16baa3[_0x8fba('0x2d')][_0x8fba('0x2e')]};});_0x20fd52[_0x8fba('0x2f')]=_[_0x8fba('0x2b')](_0x118a1e,_0x8fba('0x2a'));_0x20fd52[_0x8fba('0x30')]=_[_0x8fba('0x31')](_0x877157['query']);_0x20fd52['filters']=_[_0x8fba('0x32')](_0x20fd52[_0x8fba('0x2f')],_0x20fd52[_0x8fba('0x30')]);_0x3f0c26[_0x8fba('0x33')]=_['intersection'](_0x20fd52[_0x8fba('0x2f')],qs[_0x8fba('0x34')](_0x877157[_0x8fba('0x30')][_0x8fba('0x34')]));_0x3f0c26[_0x8fba('0x33')]=_0x3f0c26[_0x8fba('0x33')][_0x8fba('0x35')]?_0x3f0c26[_0x8fba('0x33')]:_0x20fd52[_0x8fba('0x2f')];if(!_0x877157[_0x8fba('0x30')][_0x8fba('0x36')](_0x8fba('0x37'))){_0x3f0c26[_0x8fba('0x38')]=qs[_0x8fba('0x38')](_0x877157[_0x8fba('0x30')][_0x8fba('0x38')]);_0x3f0c26['offset']=qs[_0x8fba('0x1d')](_0x877157[_0x8fba('0x30')][_0x8fba('0x1d')]);}_0x3f0c26[_0x8fba('0x39')]=qs[_0x8fba('0x3a')](_0x877157['query'][_0x8fba('0x3a')]);_0x3f0c26[_0x8fba('0x3b')]=qs[_0x8fba('0x3c')](_[_0x8fba('0x3d')](_0x877157['query'],_0x20fd52[_0x8fba('0x3c')]),_0x118a1e);if(_0x877157['query'][_0x8fba('0x3e')]){_0x3f0c26[_0x8fba('0x3b')]=_[_0x8fba('0x3f')](_0x3f0c26[_0x8fba('0x3b')],{'$or':_[_0x8fba('0x2b')](_0x118a1e,function(_0x33fd3f){if(_0x33fd3f['type']!==_0x8fba('0x40')){var _0x3057c8={};_0x3057c8[_0x33fd3f[_0x8fba('0x2a')]]={'$like':'%'+_0x877157[_0x8fba('0x30')][_0x8fba('0x3e')]+'%'};return _0x3057c8;}})});}_0x3f0c26=_[_0x8fba('0x3f')]({},_0x3f0c26,_0x877157[_0x8fba('0x41')]);var _0x9ed192={'where':_0x3f0c26[_0x8fba('0x3b')]};return db[_0x8fba('0x2c')][_0x8fba('0x1f')](_0x9ed192)[_0x8fba('0x26')](function(_0x17d9e3){_0xddc9f6[_0x8fba('0x1f')]=_0x17d9e3;if(_0x877157[_0x8fba('0x30')]['includeAll']){_0x3f0c26['include']=[{'all':!![]}];}return db[_0x8fba('0x2c')][_0x8fba('0x42')](_0x3f0c26);})['then'](function(_0x1b7478){_0xddc9f6['rows']=_0x1b7478;return _0xddc9f6;})['then'](respondWithFilteredResult(_0x434e9e,_0x3f0c26))[_0x8fba('0x43')](handleError(_0x434e9e,null));};exports[_0x8fba('0x44')]=function(_0xb30023,_0x35605c){var _0x572538={'raw':!![],'where':{'id':_0xb30023[_0x8fba('0x45')]['id']}},_0x6140ca={};_0x6140ca[_0x8fba('0x2f')]=_[_0x8fba('0x31')](db['ChatQueueReport'][_0x8fba('0x46')]);_0x6140ca[_0x8fba('0x30')]=_[_0x8fba('0x31')](_0xb30023[_0x8fba('0x30')]);_0x6140ca[_0x8fba('0x3c')]=_['intersection'](_0x6140ca[_0x8fba('0x2f')],_0x6140ca[_0x8fba('0x30')]);_0x572538[_0x8fba('0x33')]=_['intersection'](_0x6140ca[_0x8fba('0x2f')],qs['fields'](_0xb30023[_0x8fba('0x30')][_0x8fba('0x34')]));_0x572538[_0x8fba('0x33')]=_0x572538[_0x8fba('0x33')][_0x8fba('0x35')]?_0x572538[_0x8fba('0x33')]:_0x6140ca[_0x8fba('0x2f')];if(_0xb30023[_0x8fba('0x30')][_0x8fba('0x47')]){_0x572538['include']=[{'all':!![]}];}_0x572538=_[_0x8fba('0x3f')]({},_0x572538,_0xb30023['options']);return db[_0x8fba('0x2c')][_0x8fba('0x48')](_0x572538)[_0x8fba('0x26')](handleEntityNotFound(_0x35605c,null))['then'](respondWithResult(_0x35605c,null))[_0x8fba('0x43')](handleError(_0x35605c,null));};exports[_0x8fba('0x49')]=function(_0x2102bc,_0xce6a3){return db[_0x8fba('0x2c')][_0x8fba('0x49')](_0x2102bc['body'],{})['then'](respondWithResult(_0xce6a3,0xc9))['catch'](handleError(_0xce6a3,null));};exports[_0x8fba('0x25')]=function(_0x311776,_0x482b13){if(_0x311776['body']['id']){delete _0x311776['body']['id'];}return db['ChatQueueReport'][_0x8fba('0x48')]({'where':{'id':_0x311776[_0x8fba('0x45')]['id']}})[_0x8fba('0x26')](handleEntityNotFound(_0x482b13,null))['then'](saveUpdates(_0x311776[_0x8fba('0x4a')],null))['then'](respondWithResult(_0x482b13,null))[_0x8fba('0x43')](handleError(_0x482b13,null));};exports[_0x8fba('0x27')]=function(_0x1ef167,_0x13701a){return db[_0x8fba('0x2c')][_0x8fba('0x48')]({'where':{'id':_0x1ef167[_0x8fba('0x45')]['id']}})[_0x8fba('0x26')](handleEntityNotFound(_0x13701a,null))['then'](removeEntity(_0x13701a,null))['catch'](handleError(_0x13701a,null));};exports[_0x8fba('0x4b')]=function(_0x432b1d,_0x4cd72d){return db[_0x8fba('0x2c')]['describe']()[_0x8fba('0x26')](respondWithResult(_0x4cd72d,null))['catch'](handleError(_0x4cd72d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 128ab72..0db004d 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x46eae2,_0x3d1f8d){var _0x3230f1=function(_0x5c3ce8){while(--_0x5c3ce8){_0x46eae2['push'](_0x46eae2['shift']());}};_0x3230f1(++_0x3d1f8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x50e339,_0x49c923){var _0x2e1b88=function(_0x294b45){while(--_0x294b45){_0x50e339['push'](_0x50e339['shift']());}};_0x2e1b88(++_0x49c923);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f54f628..5225876 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 _0x8a5c=['attributes','UpdateChatQueueReport','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatQueueReport','create','options','ChatQueueReport','update','body','where'];(function(_0x472439,_0x4c6ba4){var _0x504d78=function(_0x51ee60){while(--_0x51ee60){_0x472439['push'](_0x472439['shift']());}};_0x504d78(++_0x4c6ba4);}(_0x8a5c,0x136));var _0xc8a5=function(_0x5474d5,_0x23a1ca){_0x5474d5=_0x5474d5-0x0;var _0x704993=_0x8a5c[_0x5474d5];return _0x704993;};'use strict';var _=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var moment=require(_0xc8a5('0x2'));var BPromise=require(_0xc8a5('0x3'));var rs=require(_0xc8a5('0x4'));var fs=require('fs');var Redis=require(_0xc8a5('0x5'));var db=require(_0xc8a5('0x6'))['db'];var utils=require(_0xc8a5('0x7'));var logger=require(_0xc8a5('0x8'))('rpc');var config=require(_0xc8a5('0x9'));var jayson=require(_0xc8a5('0xa'));var client=jayson['client'][_0xc8a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcee97e,_0xd6de78,_0xa9f42c){return new BPromise(function(_0x4d25e4,_0x3ecf08){return client[_0xc8a5('0xc')](_0xcee97e,_0xa9f42c)[_0xc8a5('0xd')](function(_0x2c1fe9){logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,_0xc8a5('0x10'));logger[_0xc8a5('0x11')](_0xc8a5('0x12'),_0xd6de78,'request\x20sent',JSON['stringify'](_0x2c1fe9));if(_0x2c1fe9[_0xc8a5('0x13')]){if(_0x2c1fe9['error'][_0xc8a5('0x14')]===0x1f4){logger[_0xc8a5('0x13')](_0xc8a5('0xf'),_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x3ecf08(_0x2c1fe9['error'][_0xc8a5('0x15')]);}logger[_0xc8a5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x4d25e4(_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);}else{logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,'request\x20sent');_0x4d25e4(_0x2c1fe9[_0xc8a5('0x16')][_0xc8a5('0x15')]);}})['catch'](function(_0x36a78b){logger[_0xc8a5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0xd6de78,_0x36a78b);_0x3ecf08(_0x36a78b);});});}exports[_0xc8a5('0x17')]=function(_0x3ef8d3){var _0x12a441=this;return new Promise(function(_0x1326e2,_0x1ea105){return db['ChatQueueReport'][_0xc8a5('0x18')](_0x3ef8d3['body'],{'raw':_0x3ef8d3[_0xc8a5('0x19')]?_0x3ef8d3[_0xc8a5('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x866737){logger[_0xc8a5('0xe')](_0xc8a5('0x17'),_0x3ef8d3);logger[_0xc8a5('0x11')](_0xc8a5('0x17'),_0x3ef8d3,JSON['stringify'](_0x866737));_0x1326e2(_0x866737);})['catch'](function(_0x3e2058){logger[_0xc8a5('0x13')](_0xc8a5('0x17'),_0x3e2058[_0xc8a5('0x15')],_0x3ef8d3);_0x1ea105(_0x12a441[_0xc8a5('0x13')](0x1f4,_0x3e2058[_0xc8a5('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x1b3870){var _0x3beb20=this;return new Promise(function(_0x266c59,_0x1e522c){return db[_0xc8a5('0x1a')][_0xc8a5('0x1b')](_0x1b3870[_0xc8a5('0x1c')],{'raw':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870[_0xc8a5('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870[_0xc8a5('0x19')][_0xc8a5('0x1d')]||null:null,'attributes':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870[_0xc8a5('0x19')][_0xc8a5('0x1e')]||null:null,'limit':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870['options']['limit']||null:null})[_0xc8a5('0xd')](function(_0x4e0a4b){logger['info'](_0xc8a5('0x1f'),_0x1b3870);logger[_0xc8a5('0x11')](_0xc8a5('0x1f'),_0x1b3870,JSON[_0xc8a5('0x20')](_0x4e0a4b));_0x266c59(_0x4e0a4b);})[_0xc8a5('0x21')](function(_0x31c416){logger['error'](_0xc8a5('0x1f'),_0x31c416[_0xc8a5('0x15')],_0x1b3870);_0x1e522c(_0x3beb20[_0xc8a5('0x13')](0x1f4,_0x31c416[_0xc8a5('0x15')]));});});}; \ No newline at end of file +var _0x435d=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','update','body','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x138557,_0x3f0b0e){var _0x5e04a9=function(_0x6a3b29){while(--_0x6a3b29){_0x138557['push'](_0x138557['shift']());}};_0x5e04a9(++_0x3f0b0e);}(_0x435d,0x12a));var _0xd435=function(_0x4e47b3,_0x29c0f8){_0x4e47b3=_0x4e47b3-0x0;var _0x14a4dd=_0x435d[_0x4e47b3];return _0x14a4dd;};'use strict';var _=require(_0xd435('0x0'));var util=require(_0xd435('0x1'));var moment=require(_0xd435('0x2'));var BPromise=require(_0xd435('0x3'));var rs=require(_0xd435('0x4'));var fs=require('fs');var Redis=require(_0xd435('0x5'));var db=require(_0xd435('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd435('0x7'))(_0xd435('0x8'));var config=require('../../config/environment');var jayson=require(_0xd435('0x9'));var client=jayson[_0xd435('0xa')][_0xd435('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x431fad,_0x486d9b,_0x43ce42){return new BPromise(function(_0x231550,_0x5853c6){return client[_0xd435('0xc')](_0x431fad,_0x43ce42)[_0xd435('0xd')](function(_0x216c6b){logger[_0xd435('0xe')](_0xd435('0xf'),_0x486d9b,_0xd435('0x10'));logger[_0xd435('0x11')](_0xd435('0x12'),_0x486d9b,'request\x20sent',JSON[_0xd435('0x13')](_0x216c6b));if(_0x216c6b['error']){if(_0x216c6b[_0xd435('0x14')][_0xd435('0x15')]===0x1f4){logger[_0xd435('0x14')](_0xd435('0xf'),_0x486d9b,_0x216c6b[_0xd435('0x14')][_0xd435('0x16')]);return _0x5853c6(_0x216c6b[_0xd435('0x14')][_0xd435('0x16')]);}logger[_0xd435('0x14')](_0xd435('0xf'),_0x486d9b,_0x216c6b['error'][_0xd435('0x16')]);return _0x231550(_0x216c6b[_0xd435('0x14')][_0xd435('0x16')]);}else{logger['info'](_0xd435('0xf'),_0x486d9b,'request\x20sent');_0x231550(_0x216c6b[_0xd435('0x17')][_0xd435('0x16')]);}})[_0xd435('0x18')](function(_0x46b075){logger[_0xd435('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x486d9b,_0x46b075);_0x5853c6(_0x46b075);});});}exports[_0xd435('0x19')]=function(_0x3271a2){var _0x4bf3a5=this;return new Promise(function(_0x12bf57,_0x1ff9f7){return db[_0xd435('0x1a')][_0xd435('0x1b')](_0x3271a2['body'],{'raw':_0x3271a2['options']?_0x3271a2[_0xd435('0x1c')][_0xd435('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x533265){logger[_0xd435('0xe')](_0xd435('0x19'),_0x3271a2);logger[_0xd435('0x11')]('CreateChatQueueReport',_0x3271a2,JSON[_0xd435('0x13')](_0x533265));_0x12bf57(_0x533265);})[_0xd435('0x18')](function(_0x1f6b56){logger[_0xd435('0x14')](_0xd435('0x19'),_0x1f6b56[_0xd435('0x16')],_0x3271a2);_0x1ff9f7(_0x4bf3a5[_0xd435('0x14')](0x1f4,_0x1f6b56[_0xd435('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x52be2d){var _0x49f9d5=this;return new Promise(function(_0x5cb155,_0x252275){return db[_0xd435('0x1a')][_0xd435('0x1e')](_0x52be2d[_0xd435('0x1f')],{'raw':_0x52be2d['options']?_0x52be2d[_0xd435('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52be2d[_0xd435('0x1c')]?_0x52be2d['options']['where']||null:null,'attributes':_0x52be2d['options']?_0x52be2d[_0xd435('0x1c')][_0xd435('0x20')]||null:null,'limit':_0x52be2d[_0xd435('0x1c')]?_0x52be2d[_0xd435('0x1c')][_0xd435('0x21')]||null:null})[_0xd435('0xd')](function(_0x2cb8c1){logger[_0xd435('0xe')]('UpdateChatQueueReport',_0x52be2d);logger[_0xd435('0x11')](_0xd435('0x22'),_0x52be2d,JSON[_0xd435('0x13')](_0x2cb8c1));_0x5cb155(_0x2cb8c1);})[_0xd435('0x18')](function(_0x3834c6){logger['error'](_0xd435('0x22'),_0x3834c6['message'],_0x52be2d);_0x252275(_0x49f9d5[_0xd435('0x14')](0x1f4,_0x3834c6[_0xd435('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 9063289..817cb90 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 _0x35a9=['index','/describe','isAuthenticated','describe','/:id','create','put','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','get'];(function(_0x436d0e,_0x2fe229){var _0x499710=function(_0x4f898){while(--_0x4f898){_0x436d0e['push'](_0x436d0e['shift']());}};_0x499710(++_0x2fe229);}(_0x35a9,0x144));var _0x935a=function(_0x4bc8cb,_0x2c4a59){_0x4bc8cb=_0x4bc8cb-0x0;var _0x454e3b=_0x35a9[_0x4bc8cb];return _0x454e3b;};'use strict';var multer=require(_0x935a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x935a('0x1'));var express=require(_0x935a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x935a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x935a('0x4'));var controller=require('./chatQueueReport.controller');router[_0x935a('0x5')]('/',auth['isAuthenticated'](),controller[_0x935a('0x6')]);router[_0x935a('0x5')](_0x935a('0x7'),auth[_0x935a('0x8')](),controller[_0x935a('0x9')]);router['get'](_0x935a('0xa'),auth[_0x935a('0x8')](),controller['show']);router['post']('/',auth[_0x935a('0x8')](),controller[_0x935a('0xb')]);router[_0x935a('0xc')](_0x935a('0xa'),auth[_0x935a('0x8')](),controller['update']);router['delete'](_0x935a('0xa'),auth[_0x935a('0x8')](),controller[_0x935a('0xd')]);module[_0x935a('0xe')]=router; \ No newline at end of file +var _0xb110=['get','/describe','describe','/:id','post','create','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index'];(function(_0x462166,_0x45ad82){var _0x20b6aa=function(_0x5836df){while(--_0x5836df){_0x462166['push'](_0x462166['shift']());}};_0x20b6aa(++_0x45ad82);}(_0xb110,0xf9));var _0x0b11=function(_0x601d99,_0x3607ba){_0x601d99=_0x601d99-0x0;var _0x486257=_0xb110[_0x601d99];return _0x486257;};'use strict';var multer=require('multer');var util=require(_0x0b11('0x0'));var path=require(_0x0b11('0x1'));var timeout=require(_0x0b11('0x2'));var express=require(_0x0b11('0x3'));var router=express[_0x0b11('0x4')]();var fs_extra=require(_0x0b11('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0b11('0x6'));var config=require(_0x0b11('0x7'));var controller=require(_0x0b11('0x8'));router['get']('/',auth[_0x0b11('0x9')](),controller[_0x0b11('0xa')]);router[_0x0b11('0xb')](_0x0b11('0xc'),auth[_0x0b11('0x9')](),controller[_0x0b11('0xd')]);router[_0x0b11('0xb')](_0x0b11('0xe'),auth[_0x0b11('0x9')](),controller['show']);router[_0x0b11('0xf')]('/',auth[_0x0b11('0x9')](),controller[_0x0b11('0x10')]);router[_0x0b11('0x11')](_0x0b11('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x0b11('0x12')](_0x0b11('0xe'),auth[_0x0b11('0x9')](),controller['destroy']);module[_0x0b11('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 a756b82..fa59ef2 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x468e19,_0x5832b6){_0x468e19=_0x468e19-0x0;var _0x184624=_0xb43b[_0x468e19];return _0x184624;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x9bde,0xe1));var _0xe9bd=function(_0x9ad14c,_0x234f53){_0x9ad14c=_0x9ad14c-0x0;var _0x5a5c18=_0x9bde[_0x9ad14c];return _0x5a5c18;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 4b35e3b..1af0673 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 _0x6aa1=['merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x7ce11e,_0x56bcc9){var _0x501119=function(_0x3adcf3){while(--_0x3adcf3){_0x7ce11e['push'](_0x7ce11e['shift']());}};_0x501119(++_0x56bcc9);}(_0x6aa1,0x1b5));var _0x16aa=function(_0x29c074,_0x322c99){_0x29c074=_0x29c074-0x0;var _0x1222b7=_0x6aa1[_0x29c074];return _0x1222b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x16aa('0x0'));var jsonpatch=require(_0x16aa('0x1'));var rp=require(_0x16aa('0x2'));var moment=require(_0x16aa('0x3'));var BPromise=require(_0x16aa('0x4'));var Mustache=require('mustache');var util=require(_0x16aa('0x5'));var path=require(_0x16aa('0x6'));var sox=require(_0x16aa('0x7'));var csv=require(_0x16aa('0x8'));var ejs=require(_0x16aa('0x9'));var fs=require('fs');var fs_extra=require(_0x16aa('0xa'));var _=require(_0x16aa('0xb'));var squel=require(_0x16aa('0xc'));var crypto=require(_0x16aa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16aa('0x8'));var querystring=require('querystring');var Papa=require(_0x16aa('0xe'));var Redis=require(_0x16aa('0xf'));var authService=require(_0x16aa('0x10'));var qs=require(_0x16aa('0x11'));var as=require(_0x16aa('0x12'));var hardwareService=require(_0x16aa('0x13'));var logger=require(_0x16aa('0x14'))('api');var utils=require(_0x16aa('0x15'));var config=require(_0x16aa('0x16'));var licenseUtil=require(_0x16aa('0x17'));var db=require(_0x16aa('0x18'))['db'];function respondWithStatusCode(_0x13d812,_0x2fbae7){_0x2fbae7=_0x2fbae7||0xcc;return function(_0x4e56b1){if(_0x4e56b1){return _0x13d812['sendStatus'](_0x2fbae7);}return _0x13d812[_0x16aa('0x19')](_0x2fbae7)[_0x16aa('0x1a')]();};}function respondWithResult(_0x50f9bd,_0x276fe2){_0x276fe2=_0x276fe2||0xc8;return function(_0xe108fd){if(_0xe108fd){return _0x50f9bd[_0x16aa('0x19')](_0x276fe2)[_0x16aa('0x1b')](_0xe108fd);}};}function respondWithFilteredResult(_0x5afc10,_0x337608){return function(_0x58dd9a){if(_0x58dd9a){var _0x478849=typeof _0x337608[_0x16aa('0x1c')]===_0x16aa('0x1d')&&typeof _0x337608[_0x16aa('0x1e')]===_0x16aa('0x1d');var _0x18b65d=_0x58dd9a[_0x16aa('0x1f')];var _0x358d53=_0x478849?0x0:_0x337608[_0x16aa('0x1c')];var _0x3ec33d=_0x478849?_0x58dd9a[_0x16aa('0x1f')]:_0x337608[_0x16aa('0x1c')]+_0x337608[_0x16aa('0x1e')];var _0x2be220;if(_0x3ec33d>=_0x18b65d){_0x3ec33d=_0x18b65d;_0x2be220=0xc8;}else{_0x2be220=0xce;}_0x5afc10[_0x16aa('0x19')](_0x2be220);return _0x5afc10['set'](_0x16aa('0x20'),_0x358d53+'-'+_0x3ec33d+'/'+_0x18b65d)[_0x16aa('0x1b')](_0x58dd9a);}return null;};}function patchUpdates(_0x90e5a7){return function(_0x20666b){try{jsonpatch[_0x16aa('0x21')](_0x20666b,_0x90e5a7,!![]);}catch(_0x33c2d4){return BPromise['reject'](_0x33c2d4);}return _0x20666b[_0x16aa('0x22')]();};}function saveUpdates(_0x24b71c,_0x4f5eba){return function(_0x3ddeb6){if(_0x3ddeb6){return _0x3ddeb6[_0x16aa('0x23')](_0x24b71c)[_0x16aa('0x24')](function(_0x41dcfc){return _0x41dcfc;});}return null;};}function removeEntity(_0x14bd43,_0x3c12a5){return function(_0x21482c){if(_0x21482c){return _0x21482c[_0x16aa('0x25')]()['then'](function(){_0x14bd43[_0x16aa('0x19')](0xcc)[_0x16aa('0x1a')]();});}};}function handleEntityNotFound(_0x4c2b92,_0x5cb05e){return function(_0x117d52){if(!_0x117d52){_0x4c2b92[_0x16aa('0x26')](0x194);}return _0x117d52;};}function handleError(_0x25cc91,_0xb01076){_0xb01076=_0xb01076||0x1f4;return function(_0x1d121b){logger['error'](_0x1d121b['stack']);if(_0x1d121b[_0x16aa('0x27')]){delete _0x1d121b[_0x16aa('0x27')];}_0x25cc91[_0x16aa('0x19')](_0xb01076)[_0x16aa('0x28')](_0x1d121b);};}exports[_0x16aa('0x29')]=function(_0x26a018,_0x295605){var _0x48c4ba={},_0x50437c={},_0x1c658f={'count':0x0,'rows':[]};var _0x1da0d7=_[_0x16aa('0x2a')](db[_0x16aa('0x2b')][_0x16aa('0x2c')],function(_0x61ecae){return{'name':_0x61ecae[_0x16aa('0x2d')],'type':_0x61ecae[_0x16aa('0x2e')][_0x16aa('0x2f')]};});_0x50437c[_0x16aa('0x30')]=_[_0x16aa('0x2a')](_0x1da0d7,'name');_0x50437c[_0x16aa('0x31')]=_[_0x16aa('0x32')](_0x26a018[_0x16aa('0x31')]);_0x50437c[_0x16aa('0x33')]=_[_0x16aa('0x34')](_0x50437c[_0x16aa('0x30')],_0x50437c[_0x16aa('0x31')]);_0x48c4ba['attributes']=_[_0x16aa('0x34')](_0x50437c[_0x16aa('0x30')],qs[_0x16aa('0x35')](_0x26a018['query'][_0x16aa('0x35')]));_0x48c4ba['attributes']=_0x48c4ba[_0x16aa('0x36')][_0x16aa('0x37')]?_0x48c4ba[_0x16aa('0x36')]:_0x50437c[_0x16aa('0x30')];if(!_0x26a018[_0x16aa('0x31')]['hasOwnProperty'](_0x16aa('0x38'))){_0x48c4ba[_0x16aa('0x1e')]=qs[_0x16aa('0x1e')](_0x26a018[_0x16aa('0x31')]['limit']);_0x48c4ba[_0x16aa('0x1c')]=qs['offset'](_0x26a018[_0x16aa('0x31')][_0x16aa('0x1c')]);}_0x48c4ba[_0x16aa('0x39')]=qs[_0x16aa('0x3a')](_0x26a018[_0x16aa('0x31')]['sort']);_0x48c4ba[_0x16aa('0x3b')]=qs[_0x16aa('0x33')](_['pick'](_0x26a018[_0x16aa('0x31')],_0x50437c[_0x16aa('0x33')]),_0x1da0d7);if(_0x26a018[_0x16aa('0x31')]['filter']){_0x48c4ba['where']=_[_0x16aa('0x3c')](_0x48c4ba[_0x16aa('0x3b')],{'$or':_[_0x16aa('0x2a')](_0x1da0d7,function(_0x518b49){if(_0x518b49[_0x16aa('0x2e')]!==_0x16aa('0x3d')){var _0x2c66b1={};_0x2c66b1[_0x518b49[_0x16aa('0x27')]]={'$like':'%'+_0x26a018[_0x16aa('0x31')]['filter']+'%'};return _0x2c66b1;}})});}_0x48c4ba=_['merge']({},_0x48c4ba,_0x26a018[_0x16aa('0x3e')]);var _0xedbf1a={'where':_0x48c4ba['where']};return db[_0x16aa('0x2b')]['count'](_0xedbf1a)[_0x16aa('0x24')](function(_0x3418fa){_0x1c658f['count']=_0x3418fa;if(_0x26a018[_0x16aa('0x31')][_0x16aa('0x3f')]){_0x48c4ba['include']=[{'all':!![]}];}return db[_0x16aa('0x2b')]['findAll'](_0x48c4ba);})[_0x16aa('0x24')](function(_0x376e0d){_0x1c658f[_0x16aa('0x40')]=_0x376e0d;return _0x1c658f;})[_0x16aa('0x24')](respondWithFilteredResult(_0x295605,_0x48c4ba))[_0x16aa('0x41')](handleError(_0x295605,null));};exports['show']=function(_0x2cc068,_0x3d428f){var _0x3baa51={'raw':!![],'where':{'id':_0x2cc068[_0x16aa('0x42')]['id']}},_0x1b0c05={};_0x1b0c05[_0x16aa('0x30')]=_['keys'](db[_0x16aa('0x2b')][_0x16aa('0x2c')]);_0x1b0c05['query']=_['keys'](_0x2cc068[_0x16aa('0x31')]);_0x1b0c05[_0x16aa('0x33')]=_[_0x16aa('0x34')](_0x1b0c05['model'],_0x1b0c05[_0x16aa('0x31')]);_0x3baa51[_0x16aa('0x36')]=_['intersection'](_0x1b0c05[_0x16aa('0x30')],qs[_0x16aa('0x35')](_0x2cc068[_0x16aa('0x31')]['fields']));_0x3baa51['attributes']=_0x3baa51['attributes'][_0x16aa('0x37')]?_0x3baa51['attributes']:_0x1b0c05['model'];if(_0x2cc068[_0x16aa('0x31')][_0x16aa('0x3f')]){_0x3baa51[_0x16aa('0x43')]=[{'all':!![]}];}_0x3baa51=_['merge']({},_0x3baa51,_0x2cc068[_0x16aa('0x3e')]);return db['ChatTransferReport'][_0x16aa('0x44')](_0x3baa51)[_0x16aa('0x24')](handleEntityNotFound(_0x3d428f,null))[_0x16aa('0x24')](respondWithResult(_0x3d428f,null))[_0x16aa('0x41')](handleError(_0x3d428f,null));};exports['create']=function(_0x3fa01e,_0x2d44ce){return db[_0x16aa('0x2b')]['create'](_0x3fa01e[_0x16aa('0x45')],{})[_0x16aa('0x24')](respondWithResult(_0x2d44ce,0xc9))[_0x16aa('0x41')](handleError(_0x2d44ce,null));};exports['update']=function(_0x3cdcd7,_0x1a82a4){if(_0x3cdcd7[_0x16aa('0x45')]['id']){delete _0x3cdcd7[_0x16aa('0x45')]['id'];}return db[_0x16aa('0x2b')][_0x16aa('0x44')]({'where':{'id':_0x3cdcd7[_0x16aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a82a4,null))['then'](saveUpdates(_0x3cdcd7[_0x16aa('0x45')],null))[_0x16aa('0x24')](respondWithResult(_0x1a82a4,null))[_0x16aa('0x41')](handleError(_0x1a82a4,null));};exports['destroy']=function(_0x2f6cb9,_0x2b117e){return db[_0x16aa('0x2b')][_0x16aa('0x44')]({'where':{'id':_0x2f6cb9[_0x16aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b117e,null))[_0x16aa('0x24')](removeEntity(_0x2b117e,null))['catch'](handleError(_0x2b117e,null));};exports[_0x16aa('0x46')]=function(_0x178b4e,_0x13791d){return db[_0x16aa('0x2b')][_0x16aa('0x46')]()[_0x16aa('0x24')](respondWithResult(_0x13791d,null))[_0x16aa('0x41')](handleError(_0x13791d,null));}; \ No newline at end of file +var _0xef30=['includeAll','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','ChatTransferReport'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xef30,0x133));var _0x0ef3=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0xef30[_0x3bef2c];return _0x331503;};'use strict';var emlformat=require(_0x0ef3('0x0'));var rimraf=require(_0x0ef3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ef3('0x2'));var rp=require(_0x0ef3('0x3'));var moment=require(_0x0ef3('0x4'));var BPromise=require(_0x0ef3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0ef3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ef3('0x7'));var squel=require(_0x0ef3('0x8'));var crypto=require(_0x0ef3('0x9'));var jsforce=require(_0x0ef3('0xa'));var deskjs=require(_0x0ef3('0xb'));var toCsv=require(_0x0ef3('0xc'));var querystring=require(_0x0ef3('0xd'));var Papa=require(_0x0ef3('0xe'));var Redis=require(_0x0ef3('0xf'));var authService=require(_0x0ef3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0ef3('0x11'));var hardwareService=require(_0x0ef3('0x12'));var logger=require(_0x0ef3('0x13'))(_0x0ef3('0x14'));var utils=require('../../config/utils');var config=require(_0x0ef3('0x15'));var licenseUtil=require(_0x0ef3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4afb8e,_0x407ccb){_0x407ccb=_0x407ccb||0xcc;return function(_0xc20f32){if(_0xc20f32){return _0x4afb8e[_0x0ef3('0x17')](_0x407ccb);}return _0x4afb8e[_0x0ef3('0x18')](_0x407ccb)[_0x0ef3('0x19')]();};}function respondWithResult(_0x39a420,_0x15c7a5){_0x15c7a5=_0x15c7a5||0xc8;return function(_0x3dc45d){if(_0x3dc45d){return _0x39a420[_0x0ef3('0x18')](_0x15c7a5)['json'](_0x3dc45d);}};}function respondWithFilteredResult(_0x4b9ff8,_0x4e4765){return function(_0x5e3509){if(_0x5e3509){var _0x151399=typeof _0x4e4765['offset']==='undefined'&&typeof _0x4e4765[_0x0ef3('0x1a')]===_0x0ef3('0x1b');var _0xc8c92d=_0x5e3509[_0x0ef3('0x1c')];var _0x24ae38=_0x151399?0x0:_0x4e4765[_0x0ef3('0x1d')];var _0x314a3b=_0x151399?_0x5e3509[_0x0ef3('0x1c')]:_0x4e4765['offset']+_0x4e4765['limit'];var _0x5cc893;if(_0x314a3b>=_0xc8c92d){_0x314a3b=_0xc8c92d;_0x5cc893=0xc8;}else{_0x5cc893=0xce;}_0x4b9ff8[_0x0ef3('0x18')](_0x5cc893);return _0x4b9ff8['set'](_0x0ef3('0x1e'),_0x24ae38+'-'+_0x314a3b+'/'+_0xc8c92d)[_0x0ef3('0x1f')](_0x5e3509);}return null;};}function patchUpdates(_0x34ff4c){return function(_0x562cfb){try{jsonpatch[_0x0ef3('0x20')](_0x562cfb,_0x34ff4c,!![]);}catch(_0x56434c){return BPromise[_0x0ef3('0x21')](_0x56434c);}return _0x562cfb['save']();};}function saveUpdates(_0x478223,_0x1d4f83){return function(_0x3ef8fc){if(_0x3ef8fc){return _0x3ef8fc[_0x0ef3('0x22')](_0x478223)[_0x0ef3('0x23')](function(_0x51ef62){return _0x51ef62;});}return null;};}function removeEntity(_0x5e3786,_0x191f8b){return function(_0x351483){if(_0x351483){return _0x351483[_0x0ef3('0x24')]()[_0x0ef3('0x23')](function(){_0x5e3786[_0x0ef3('0x18')](0xcc)[_0x0ef3('0x19')]();});}};}function handleEntityNotFound(_0x12d5cc,_0x1810ec){return function(_0x2c2f90){if(!_0x2c2f90){_0x12d5cc['sendStatus'](0x194);}return _0x2c2f90;};}function handleError(_0x34e817,_0x2741aa){_0x2741aa=_0x2741aa||0x1f4;return function(_0x3af9a){logger[_0x0ef3('0x25')](_0x3af9a[_0x0ef3('0x26')]);if(_0x3af9a[_0x0ef3('0x27')]){delete _0x3af9a[_0x0ef3('0x27')];}_0x34e817[_0x0ef3('0x18')](_0x2741aa)[_0x0ef3('0x28')](_0x3af9a);};}exports[_0x0ef3('0x29')]=function(_0x59cc93,_0x1ddbdc){var _0x2329c1={},_0x1846c0={},_0x289f61={'count':0x0,'rows':[]};var _0x1b2142=_['map'](db['ChatTransferReport'][_0x0ef3('0x2a')],function(_0x54171f){return{'name':_0x54171f[_0x0ef3('0x2b')],'type':_0x54171f[_0x0ef3('0x2c')][_0x0ef3('0x2d')]};});_0x1846c0[_0x0ef3('0x2e')]=_['map'](_0x1b2142,_0x0ef3('0x27'));_0x1846c0['query']=_['keys'](_0x59cc93[_0x0ef3('0x2f')]);_0x1846c0[_0x0ef3('0x30')]=_[_0x0ef3('0x31')](_0x1846c0[_0x0ef3('0x2e')],_0x1846c0[_0x0ef3('0x2f')]);_0x2329c1[_0x0ef3('0x32')]=_[_0x0ef3('0x31')](_0x1846c0[_0x0ef3('0x2e')],qs[_0x0ef3('0x33')](_0x59cc93[_0x0ef3('0x2f')][_0x0ef3('0x33')]));_0x2329c1['attributes']=_0x2329c1[_0x0ef3('0x32')][_0x0ef3('0x34')]?_0x2329c1[_0x0ef3('0x32')]:_0x1846c0[_0x0ef3('0x2e')];if(!_0x59cc93[_0x0ef3('0x2f')][_0x0ef3('0x35')]('nolimit')){_0x2329c1[_0x0ef3('0x1a')]=qs[_0x0ef3('0x1a')](_0x59cc93[_0x0ef3('0x2f')]['limit']);_0x2329c1[_0x0ef3('0x1d')]=qs[_0x0ef3('0x1d')](_0x59cc93[_0x0ef3('0x2f')][_0x0ef3('0x1d')]);}_0x2329c1[_0x0ef3('0x36')]=qs['sort'](_0x59cc93[_0x0ef3('0x2f')][_0x0ef3('0x37')]);_0x2329c1[_0x0ef3('0x38')]=qs[_0x0ef3('0x30')](_[_0x0ef3('0x39')](_0x59cc93['query'],_0x1846c0[_0x0ef3('0x30')]),_0x1b2142);if(_0x59cc93[_0x0ef3('0x2f')][_0x0ef3('0x3a')]){_0x2329c1['where']=_[_0x0ef3('0x3b')](_0x2329c1[_0x0ef3('0x38')],{'$or':_[_0x0ef3('0x3c')](_0x1b2142,function(_0x1ab467){if(_0x1ab467['type']!=='VIRTUAL'){var _0x8d7a90={};_0x8d7a90[_0x1ab467['name']]={'$like':'%'+_0x59cc93[_0x0ef3('0x2f')][_0x0ef3('0x3a')]+'%'};return _0x8d7a90;}})});}_0x2329c1=_[_0x0ef3('0x3b')]({},_0x2329c1,_0x59cc93[_0x0ef3('0x3d')]);var _0x2d1abf={'where':_0x2329c1[_0x0ef3('0x38')]};return db[_0x0ef3('0x3e')][_0x0ef3('0x1c')](_0x2d1abf)['then'](function(_0x22cfaf){_0x289f61['count']=_0x22cfaf;if(_0x59cc93[_0x0ef3('0x2f')][_0x0ef3('0x3f')]){_0x2329c1['include']=[{'all':!![]}];}return db[_0x0ef3('0x3e')][_0x0ef3('0x40')](_0x2329c1);})[_0x0ef3('0x23')](function(_0x537d33){_0x289f61[_0x0ef3('0x41')]=_0x537d33;return _0x289f61;})[_0x0ef3('0x23')](respondWithFilteredResult(_0x1ddbdc,_0x2329c1))[_0x0ef3('0x42')](handleError(_0x1ddbdc,null));};exports[_0x0ef3('0x43')]=function(_0x2a81a8,_0x41ab37){var _0xa3139={'raw':!![],'where':{'id':_0x2a81a8[_0x0ef3('0x44')]['id']}},_0x51cf4f={};_0x51cf4f[_0x0ef3('0x2e')]=_[_0x0ef3('0x45')](db['ChatTransferReport']['rawAttributes']);_0x51cf4f[_0x0ef3('0x2f')]=_[_0x0ef3('0x45')](_0x2a81a8[_0x0ef3('0x2f')]);_0x51cf4f[_0x0ef3('0x30')]=_[_0x0ef3('0x31')](_0x51cf4f['model'],_0x51cf4f[_0x0ef3('0x2f')]);_0xa3139[_0x0ef3('0x32')]=_[_0x0ef3('0x31')](_0x51cf4f[_0x0ef3('0x2e')],qs[_0x0ef3('0x33')](_0x2a81a8[_0x0ef3('0x2f')][_0x0ef3('0x33')]));_0xa3139['attributes']=_0xa3139[_0x0ef3('0x32')]['length']?_0xa3139[_0x0ef3('0x32')]:_0x51cf4f['model'];if(_0x2a81a8[_0x0ef3('0x2f')][_0x0ef3('0x3f')]){_0xa3139['include']=[{'all':!![]}];}_0xa3139=_[_0x0ef3('0x3b')]({},_0xa3139,_0x2a81a8['options']);return db[_0x0ef3('0x3e')][_0x0ef3('0x46')](_0xa3139)[_0x0ef3('0x23')](handleEntityNotFound(_0x41ab37,null))[_0x0ef3('0x23')](respondWithResult(_0x41ab37,null))['catch'](handleError(_0x41ab37,null));};exports[_0x0ef3('0x47')]=function(_0x1bcb04,_0x18d77b){return db[_0x0ef3('0x3e')][_0x0ef3('0x47')](_0x1bcb04[_0x0ef3('0x48')],{})['then'](respondWithResult(_0x18d77b,0xc9))['catch'](handleError(_0x18d77b,null));};exports[_0x0ef3('0x22')]=function(_0x57bc8e,_0x3411fa){if(_0x57bc8e[_0x0ef3('0x48')]['id']){delete _0x57bc8e['body']['id'];}return db['ChatTransferReport'][_0x0ef3('0x46')]({'where':{'id':_0x57bc8e['params']['id']}})[_0x0ef3('0x23')](handleEntityNotFound(_0x3411fa,null))[_0x0ef3('0x23')](saveUpdates(_0x57bc8e['body'],null))['then'](respondWithResult(_0x3411fa,null))[_0x0ef3('0x42')](handleError(_0x3411fa,null));};exports['destroy']=function(_0x382c7b,_0x30d8b7){return db['ChatTransferReport'][_0x0ef3('0x46')]({'where':{'id':_0x382c7b[_0x0ef3('0x44')]['id']}})[_0x0ef3('0x23')](handleEntityNotFound(_0x30d8b7,null))['then'](removeEntity(_0x30d8b7,null))[_0x0ef3('0x42')](handleError(_0x30d8b7,null));};exports[_0x0ef3('0x49')]=function(_0x1dced3,_0xb04a94){return db[_0x0ef3('0x3e')][_0x0ef3('0x49')]()['then'](respondWithResult(_0xb04a94,null))[_0x0ef3('0x42')](handleError(_0xb04a94,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2d4f6b1..832114b 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 _0xb0f6=['path','rimraf','./chatTransferReport.attributes','exports','uniqueid','lodash','../../config/logger','api','request-promise'];(function(_0x25cc7c,_0x24f457){var _0x5de4b4=function(_0x24667f){while(--_0x24667f){_0x25cc7c['push'](_0x25cc7c['shift']());}};_0x5de4b4(++_0x24f457);}(_0xb0f6,0xf8));var _0x6b0f=function(_0x1dd191,_0x524b5f){_0x1dd191=_0x1dd191-0x0;var _0x46d472=_0xb0f6[_0x1dd191];return _0x46d472;};'use strict';var _=require(_0x6b0f('0x0'));var util=require('util');var logger=require(_0x6b0f('0x1'))(_0x6b0f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6b0f('0x3'));var fs=require('fs');var path=require(_0x6b0f('0x4'));var rimraf=require(_0x6b0f('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b0f('0x6'));module[_0x6b0f('0x7')]=function(_0x179a14,_0x361624){return _0x179a14['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6b0f('0x8'),'fields':[_0x6b0f('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd0d=['exports','define','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x35b808,_0x1db353){var _0x39ea42=function(_0x5d51f2){while(--_0x5d51f2){_0x35b808['push'](_0x35b808['shift']());}};_0x39ea42(++_0x1db353);}(_0xfd0d,0x123));var _0xdfd0=function(_0x231bc5,_0x182c85){_0x231bc5=_0x231bc5-0x0;var _0x5aa049=_0xfd0d[_0x231bc5];return _0x5aa049;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdfd0('0x0'))(_0xdfd0('0x1'));var moment=require(_0xdfd0('0x2'));var BPromise=require(_0xdfd0('0x3'));var rp=require(_0xdfd0('0x4'));var fs=require('fs');var path=require(_0xdfd0('0x5'));var rimraf=require(_0xdfd0('0x6'));var config=require(_0xdfd0('0x7'));var attributes=require(_0xdfd0('0x8'));module[_0xdfd0('0x9')]=function(_0xc4ee18,_0x583ad5){return _0xc4ee18[_0xdfd0('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdfd0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 8236aa7..2ada8cb 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 _0xcde7=['rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x441ed7,_0x59de54){var _0x51d612=function(_0x526cd8){while(--_0x526cd8){_0x441ed7['push'](_0x441ed7['shift']());}};_0x51d612(++_0x59de54);}(_0xcde7,0x186));var _0x7cde=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xcde7[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x7cde('0x0'));var util=require('util');var moment=require(_0x7cde('0x1'));var BPromise=require(_0x7cde('0x2'));var rs=require(_0x7cde('0x3'));var fs=require('fs');var Redis=require(_0x7cde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cde('0x5'));var logger=require('../../config/logger')(_0x7cde('0x6'));var config=require(_0x7cde('0x7'));var jayson=require(_0x7cde('0x8'));var client=jayson[_0x7cde('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46ee92,_0x91a44e,_0x550515){return new BPromise(function(_0x329c32,_0x23d822){return client[_0x7cde('0xa')](_0x46ee92,_0x550515)[_0x7cde('0xb')](function(_0x38c456){logger[_0x7cde('0xc')](_0x7cde('0xd'),_0x91a44e,'request\x20sent');logger[_0x7cde('0xe')](_0x7cde('0xf'),_0x91a44e,'request\x20sent',JSON['stringify'](_0x38c456));if(_0x38c456[_0x7cde('0x10')]){if(_0x38c456[_0x7cde('0x10')][_0x7cde('0x11')]===0x1f4){logger[_0x7cde('0x10')](_0x7cde('0xd'),_0x91a44e,_0x38c456[_0x7cde('0x10')][_0x7cde('0x12')]);return _0x23d822(_0x38c456['error'][_0x7cde('0x12')]);}logger['error'](_0x7cde('0xd'),_0x91a44e,_0x38c456[_0x7cde('0x10')]['message']);return _0x329c32(_0x38c456[_0x7cde('0x10')][_0x7cde('0x12')]);}else{logger['info'](_0x7cde('0xd'),_0x91a44e,_0x7cde('0x13'));_0x329c32(_0x38c456[_0x7cde('0x14')][_0x7cde('0x12')]);}})[_0x7cde('0x15')](function(_0x590a68){logger['error'](_0x7cde('0xd'),_0x91a44e,_0x590a68);_0x23d822(_0x590a68);});});} \ No newline at end of file +var _0x0848=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring'];(function(_0x37ff01,_0x345a59){var _0x40d27e=function(_0x22263a){while(--_0x22263a){_0x37ff01['push'](_0x37ff01['shift']());}};_0x40d27e(++_0x345a59);}(_0x0848,0x1e0));var _0x8084=function(_0x57f959,_0x3ce8ef){_0x57f959=_0x57f959-0x0;var _0xef3d9f=_0x0848[_0x57f959];return _0xef3d9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8084('0x0'));var BPromise=require(_0x8084('0x1'));var rs=require(_0x8084('0x2'));var fs=require('fs');var Redis=require(_0x8084('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8084('0x4'))(_0x8084('0x5'));var config=require(_0x8084('0x6'));var jayson=require(_0x8084('0x7'));var client=jayson[_0x8084('0x8')][_0x8084('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1656c5,_0x2c087e,_0x4d22f7){return new BPromise(function(_0x39bf7d,_0x14a172){return client[_0x8084('0xa')](_0x1656c5,_0x4d22f7)[_0x8084('0xb')](function(_0x5de5fc){logger[_0x8084('0xc')](_0x8084('0xd'),_0x2c087e,_0x8084('0xe'));logger[_0x8084('0xf')](_0x8084('0x10'),_0x2c087e,_0x8084('0xe'),JSON[_0x8084('0x11')](_0x5de5fc));if(_0x5de5fc[_0x8084('0x12')]){if(_0x5de5fc[_0x8084('0x12')]['code']===0x1f4){logger[_0x8084('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2c087e,_0x5de5fc[_0x8084('0x12')][_0x8084('0x13')]);return _0x14a172(_0x5de5fc[_0x8084('0x12')][_0x8084('0x13')]);}logger['error'](_0x8084('0xd'),_0x2c087e,_0x5de5fc[_0x8084('0x12')][_0x8084('0x13')]);return _0x39bf7d(_0x5de5fc['error']['message']);}else{logger[_0x8084('0xc')](_0x8084('0xd'),_0x2c087e,_0x8084('0xe'));_0x39bf7d(_0x5de5fc[_0x8084('0x14')][_0x8084('0x13')]);}})['catch'](function(_0x28ffbd){logger[_0x8084('0x12')](_0x8084('0xd'),_0x2c087e,_0x28ffbd);_0x14a172(_0x28ffbd);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index a332d2b..f779b5d 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 _0xf11e=['index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x346ef8,_0x1c9095){var _0x177fd4=function(_0x5c7063){while(--_0x5c7063){_0x346ef8['push'](_0x346ef8['shift']());}};_0x177fd4(++_0x1c9095);}(_0xf11e,0xfc));var _0xef11=function(_0x2dc911,_0x4a7259){_0x2dc911=_0x2dc911-0x0;var _0x4dd04f=_0xf11e[_0x2dc911];return _0x4dd04f;};'use strict';var multer=require(_0xef11('0x0'));var util=require(_0xef11('0x1'));var path=require(_0xef11('0x2'));var timeout=require(_0xef11('0x3'));var express=require('express');var router=express[_0xef11('0x4')]();var fs_extra=require(_0xef11('0x5'));var auth=require(_0xef11('0x6'));var interaction=require(_0xef11('0x7'));var config=require(_0xef11('0x8'));var controller=require(_0xef11('0x9'));router[_0xef11('0xa')]('/',auth[_0xef11('0xb')](),controller[_0xef11('0xc')]);router[_0xef11('0xa')](_0xef11('0xd'),auth['isAuthenticated'](),controller[_0xef11('0xe')]);router[_0xef11('0xa')](_0xef11('0xf'),auth[_0xef11('0xb')](),controller[_0xef11('0x10')]);router[_0xef11('0x11')]('/',auth['isAuthenticated'](),controller[_0xef11('0x12')]);router[_0xef11('0x13')](_0xef11('0xf'),auth[_0xef11('0xb')](),controller[_0xef11('0x14')]);router[_0xef11('0x15')](_0xef11('0xf'),auth[_0xef11('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa42f=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x329ad1,_0x5e96dc){var _0x4274e4=function(_0xb4c5c){while(--_0xb4c5c){_0x329ad1['push'](_0x329ad1['shift']());}};_0x4274e4(++_0x5e96dc);}(_0xa42f,0x15e));var _0xfa42=function(_0x379a8c,_0x1d7a1f){_0x379a8c=_0x379a8c-0x0;var _0x5bfc81=_0xa42f[_0x379a8c];return _0x5bfc81;};'use strict';var multer=require('multer');var util=require(_0xfa42('0x0'));var path=require(_0xfa42('0x1'));var timeout=require(_0xfa42('0x2'));var express=require(_0xfa42('0x3'));var router=express[_0xfa42('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa42('0x5'));var interaction=require(_0xfa42('0x6'));var config=require(_0xfa42('0x7'));var controller=require('./chatTransferReport.controller');router[_0xfa42('0x8')]('/',auth[_0xfa42('0x9')](),controller['index']);router[_0xfa42('0x8')](_0xfa42('0xa'),auth[_0xfa42('0x9')](),controller[_0xfa42('0xb')]);router[_0xfa42('0x8')](_0xfa42('0xc'),auth[_0xfa42('0x9')](),controller[_0xfa42('0xd')]);router[_0xfa42('0xe')]('/',auth['isAuthenticated'](),controller[_0xfa42('0xf')]);router[_0xfa42('0x10')](_0xfa42('0xc'),auth['isAuthenticated'](),controller[_0xfa42('0x11')]);router[_0xfa42('0x12')](_0xfa42('0xc'),auth[_0xfa42('0x9')](),controller[_0xfa42('0x13')]);module[_0xfa42('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index a53c351..590b969 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 _0xc6c7=['Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','input','name','text','getDataValue','onlineForm','parse','stringify','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY'];(function(_0xec1042,_0x547c35){var _0x4e2644=function(_0x3937bc){while(--_0x3937bc){_0xec1042['push'](_0xec1042['shift']());}};_0x4e2644(++_0x547c35);}(_0xc6c7,0x159));var _0x7c6c=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xc6c7[_0x15b399];return _0x199f2d;};'use strict';var Sequelize=require(_0x7c6c('0x0'));var rs=require(_0x7c6c('0x1'));module[_0x7c6c('0x2')]={'name':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7c6c('0x4')},'description':{'type':Sequelize[_0x7c6c('0x3')]},'mapKey':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x5')},'key':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x6')},'customerAlias':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':_0x7c6c('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':_0x7c6c('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7c6c('0x3')]},'animation':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7c6c('0xb')](_0x7c6c('0xc'),_0x7c6c('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0xe')},'start_chat_button':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0xf')},'offline_chat_button':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x10')},'header_offline':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x11')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x14')},'noteTitle':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x16')},'closingMessageButton':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x10')},'skipMessageButton':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x18')},'ratingType':{'type':Sequelize[_0x7c6c('0xb')](_0x7c6c('0x19'),_0x7c6c('0x1a')),'defaultValue':_0x7c6c('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x7c6c('0x1c'),'variable':null,'config':{'placeholder':_0x7c6c('0x1d'),'type':_0x7c6c('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x7c6c('0x1c'),'props':{'title':_0x7c6c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7c6c('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7c6c('0x1f')](_0x7c6c('0x20'))?JSON[_0x7c6c('0x21')](this[_0x7c6c('0x1f')](_0x7c6c('0x20'))):{};},'set':function(_0x3431c5){return this['setDataValue'](_0x7c6c('0x20'),JSON[_0x7c6c('0x22')](_0x3431c5));}},'offlineForm':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':function(){return JSON[_0x7c6c('0x22')]({'items':[{'type':_0x7c6c('0x1c'),'props':{'title':_0x7c6c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7c6c('0x5'),'type':_0x7c6c('0x5')},'variable':null},{'type':_0x7c6c('0x23'),'config':{'placeholder':_0x7c6c('0x24')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x7c6c('0x25'))?JSON[_0x7c6c('0x21')](this[_0x7c6c('0x1f')](_0x7c6c('0x25'))):{};},'set':function(_0x4550b5){return this['setDataValue'](_0x7c6c('0x25'),JSON[_0x7c6c('0x22')](_0x4550b5));}},'token':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7c6c('0x3')]},'waitingTitle':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x26')},'waitingMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7c6c('0x1b')]},'showAgentAvatar':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7c6c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':function(){return _0x7c6c('0x29');}},'notificationSound':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x2b')},'verticalAlignment':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x7c6c('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7c6c('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7c6c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x2d')},'systemAvatar':{'type':Sequelize[_0x7c6c('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7c6c('0x9')],'comment':_0x7c6c('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![],'comment':_0x7c6c('0x2f'),'set':function(_0x101421){if(!_0x101421)this[_0x7c6c('0x30')](_0x7c6c('0x31'),null);this['setDataValue'](_0x7c6c('0x32'),_0x101421);}},'vidaooEscalation':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':function(){return _0x7c6c('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7c6c('0x1b')]}}; \ No newline at end of file +var _0x114d=['Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','#fafafa','System','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','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x34a087,_0x4bd68e){var _0x5c15d7=function(_0x152823){while(--_0x152823){_0x34a087['push'](_0x34a087['shift']());}};_0x5c15d7(++_0x4bd68e);}(_0x114d,0x75));var _0xd114=function(_0x4cce0c,_0x3e456d){_0x4cce0c=_0x4cce0c-0x0;var _0x376bac=_0x114d[_0x4cce0c];return _0x376bac;};'use strict';var Sequelize=require(_0xd114('0x0'));var rs=require('randomstring');module[_0xd114('0x1')]={'name':{'type':Sequelize[_0xd114('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd114('0x2')],'allowNull':![],'unique':_0xd114('0x3')},'description':{'type':Sequelize[_0xd114('0x2')]},'mapKey':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x4')},'key':{'type':Sequelize[_0xd114('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x5')},'customerAlias':{'type':Sequelize[_0xd114('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd114('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd114('0x2')],'allowNull':![],'defaultValue':_0xd114('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd114('0x2')],'allowNull':![],'defaultValue':_0xd114('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd114('0x2')]},'animation':{'type':Sequelize[_0xd114('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd114('0x9')](_0xd114('0xa'),_0xd114('0xb')),'defaultValue':_0xd114('0xa')},'header_online':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0xc')},'start_chat_button':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0xd')},'offline_chat_button':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0xe')},'header_offline':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0xf')},'download_transcript':{'type':Sequelize[_0xd114('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd114('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xd114('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd114('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd114('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x15')},'placeholderMessage':{'type':Sequelize[_0xd114('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x16')},'closingMessageButton':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0xe')},'skipMessageButton':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x18')},'ratingType':{'type':Sequelize[_0xd114('0x9')]('star',_0xd114('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xd114('0x10')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd114('0x12')],'defaultValue':function(){return JSON[_0xd114('0x1a')]({'items':[{'type':_0xd114('0x1b'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xd114('0x1c'),'helpText':''}},{'type':'input','props':{'title':_0xd114('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd114('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this[_0xd114('0x1d')](_0xd114('0x1e'))):{};},'set':function(_0x9d0662){return this[_0xd114('0x1f')](_0xd114('0x1e'),JSON['stringify'](_0x9d0662));}},'offlineForm':{'type':Sequelize[_0xd114('0x12')],'defaultValue':function(){return JSON[_0xd114('0x1a')]({'items':[{'type':_0xd114('0x1b'),'props':{'title':_0xd114('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd114('0x4'),'type':_0xd114('0x4')},'variable':null},{'type':_0xd114('0x20'),'config':{'placeholder':_0xd114('0x21')},'props':{'title':_0xd114('0x21'),'helpText':_0xd114('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xd114('0x1d')](_0xd114('0x23'))?JSON[_0xd114('0x24')](this[_0xd114('0x1d')](_0xd114('0x23'))):{};},'set':function(_0x114fd2){return this[_0xd114('0x1f')]('offlineForm',JSON[_0xd114('0x1a')](_0x114fd2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd114('0x25')]();}},'autoclose':{'type':Sequelize[_0xd114('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd114('0x2')]},'forwardOffline':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd114('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x26')},'waitingMessage':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xd114('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x17')},'sendUnmanaged':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd114('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd114('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd114('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd114('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd114('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd114('0x2')],'allowNull':![],'defaultValue':_0xd114('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd114('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd114('0x2')],'defaultValue':_0xd114('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd114('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![],'comment':_0xd114('0x30'),'set':function(_0x3437dc){if(!_0x3437dc)this[_0xd114('0x1f')](_0xd114('0x31'),null);this[_0xd114('0x1f')](_0xd114('0x32'),_0x3437dc);}},'vidaooEscalation':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xd114('0x2')],'allowNull':![],'defaultValue':_0xd114('0x33')},'vidaooNote':{'type':Sequelize[_0xd114('0x2')],'defaultValue':function(){return _0xd114('0x34');}},'vidaooMetadata':{'type':Sequelize[_0xd114('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd114('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 0319203..be8ef18 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 _0x6f7e=['findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','ChatApplication','Applications','account','list','applications','orderBy','priority','Contacts','contact','customerIp','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','lastName','messageId','created','autoclose','push','unmanaged','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','service','host','port','secure','auth','pass','SendMail','offlineMessageSubject','openNewInteraction','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','server','attachments','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ChatWebsite,\x20%s,\x20%s','info','result','sendStatus','end','limit','undefined','offset','count','status','set','Content-Range','json','apply','reject','save','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','ChatWebsite','includeAll','include'];(function(_0x44ab54,_0x1c075e){var _0x55d614=function(_0x72563a){while(--_0x72563a){_0x44ab54['push'](_0x44ab54['shift']());}};_0x55d614(++_0x1c075e);}(_0x6f7e,0xd7));var _0xe6f7=function(_0x487ef1,_0x54ef95){_0x487ef1=_0x487ef1-0x0;var _0x8dce76=_0x6f7e[_0x487ef1];return _0x8dce76;};'use strict';var emlformat=require(_0xe6f7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe6f7('0x1'));var rp=require(_0xe6f7('0x2'));var moment=require(_0xe6f7('0x3'));var BPromise=require(_0xe6f7('0x4'));var Mustache=require('mustache');var util=require(_0xe6f7('0x5'));var path=require(_0xe6f7('0x6'));var sox=require(_0xe6f7('0x7'));var csv=require(_0xe6f7('0x8'));var ejs=require(_0xe6f7('0x9'));var fs=require('fs');var fs_extra=require(_0xe6f7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe6f7('0xb'));var jsforce=require(_0xe6f7('0xc'));var deskjs=require(_0xe6f7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe6f7('0xe'));var Redis=require(_0xe6f7('0xf'));var authService=require(_0xe6f7('0x10'));var qs=require(_0xe6f7('0x11'));var as=require(_0xe6f7('0x12'));var hardwareService=require(_0xe6f7('0x13'));var logger=require(_0xe6f7('0x14'))(_0xe6f7('0x15'));var utils=require(_0xe6f7('0x16'));var config=require(_0xe6f7('0x17'));var licenseUtil=require(_0xe6f7('0x18'));var db=require('../../mysqldb')['db'];config[_0xe6f7('0x19')]=_[_0xe6f7('0x1a')](config[_0xe6f7('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe6f7('0x1b'))(new Redis(config[_0xe6f7('0x19')]));require(_0xe6f7('0x1c'))[_0xe6f7('0x1d')](socket);var jayson=require(_0xe6f7('0x1e'));var client=jayson[_0xe6f7('0x1f')][_0xe6f7('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xe6f7('0x1f')][_0xe6f7('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x190c43,_0x2d9803,_0x14d722,_0x2e283d){return new BPromise(function(_0x47620d,_0x4bf88){var _0x52b065=_0x2e283d||client;return _0x52b065[_0xe6f7('0x21')](_0x190c43,_0x14d722)['then'](function(_0x515e97){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2d9803,'request\x20sent');logger[_0xe6f7('0x22')](_0xe6f7('0x23'),_0x2d9803,_0xe6f7('0x24'),JSON[_0xe6f7('0x25')](_0x515e97));if(_0x515e97[_0xe6f7('0x26')]){if(_0x515e97['error']['code']===0x1f4){logger[_0xe6f7('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x2d9803,_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);return _0x4bf88(_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);}logger[_0xe6f7('0x26')](_0xe6f7('0x28'),_0x2d9803,_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);return _0x47620d(_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);}else{logger[_0xe6f7('0x29')](_0xe6f7('0x28'),_0x2d9803,_0xe6f7('0x24'));_0x47620d(_0x515e97[_0xe6f7('0x2a')]['message']);}})['catch'](function(_0x34aa45){logger[_0xe6f7('0x26')](_0xe6f7('0x28'),_0x2d9803,_0x34aa45);_0x4bf88(_0x34aa45);});});}function respondWithStatusCode(_0x2115bd,_0x13ee2a){_0x13ee2a=_0x13ee2a||0xcc;return function(_0x5a7cf5){if(_0x5a7cf5){return _0x2115bd[_0xe6f7('0x2b')](_0x13ee2a);}return _0x2115bd['status'](_0x13ee2a)[_0xe6f7('0x2c')]();};}function respondWithResult(_0x4cc94e,_0x443e25){_0x443e25=_0x443e25||0xc8;return function(_0x2d1de6){if(_0x2d1de6){return _0x4cc94e['status'](_0x443e25)['json'](_0x2d1de6);}};}function respondWithFilteredResult(_0x22b933,_0x128715){return function(_0x8b5c2f){if(_0x8b5c2f){var _0x2e3732=typeof _0x128715['offset']==='undefined'&&typeof _0x128715[_0xe6f7('0x2d')]===_0xe6f7('0x2e');var _0x584c4a=_0x8b5c2f['count'];var _0x521c43=_0x2e3732?0x0:_0x128715[_0xe6f7('0x2f')];var _0x4a9d5f=_0x2e3732?_0x8b5c2f[_0xe6f7('0x30')]:_0x128715[_0xe6f7('0x2f')]+_0x128715[_0xe6f7('0x2d')];var _0x5edc1b;if(_0x4a9d5f>=_0x584c4a){_0x4a9d5f=_0x584c4a;_0x5edc1b=0xc8;}else{_0x5edc1b=0xce;}_0x22b933[_0xe6f7('0x31')](_0x5edc1b);return _0x22b933[_0xe6f7('0x32')](_0xe6f7('0x33'),_0x521c43+'-'+_0x4a9d5f+'/'+_0x584c4a)[_0xe6f7('0x34')](_0x8b5c2f);}return null;};}function patchUpdates(_0x2a388e){return function(_0xcaa16c){try{jsonpatch[_0xe6f7('0x35')](_0xcaa16c,_0x2a388e,!![]);}catch(_0x350bde){return BPromise[_0xe6f7('0x36')](_0x350bde);}return _0xcaa16c[_0xe6f7('0x37')]();};}function saveUpdates(_0x51baf2,_0x36c49b){return function(_0xc270ab){if(_0xc270ab){return _0xc270ab['update'](_0x51baf2)[_0xe6f7('0x38')](function(_0xf1e143){return _0xf1e143;});}return null;};}function removeEntity(_0x35fe08,_0x5800ad){return function(_0x304504){if(_0x304504){return _0x304504[_0xe6f7('0x39')]()[_0xe6f7('0x38')](function(){var _0x2679c7=_0x304504[_0xe6f7('0x3a')]({'plain':!![]});var _0x5e5d5c=_0xe6f7('0x3b');return db[_0xe6f7('0x3c')][_0xe6f7('0x39')]({'where':{'type':_0x5e5d5c,'resourceId':_0x2679c7['id']}})['then'](function(){return _0x304504;});})['then'](function(){_0x35fe08[_0xe6f7('0x31')](0xcc)[_0xe6f7('0x2c')]();});}};}function handleEntityNotFound(_0x1537ae,_0x2d91b3){return function(_0x21dabe){if(!_0x21dabe){_0x1537ae[_0xe6f7('0x2b')](0x194);}return _0x21dabe;};}function handleError(_0x494f1a,_0x435ef0){_0x435ef0=_0x435ef0||0x1f4;return function(_0x27ad64){logger[_0xe6f7('0x26')](_0x27ad64[_0xe6f7('0x3d')]);if(_0x27ad64[_0xe6f7('0x3e')]){delete _0x27ad64[_0xe6f7('0x3e')];}_0x494f1a['status'](_0x435ef0)[_0xe6f7('0x3f')](_0x27ad64);};}exports['index']=function(_0x4b0e15,_0x55af19){var _0x5e7726={'include':[{'model':db['Pause'],'as':_0xe6f7('0x40')}]},_0x50e55e={},_0x220a60={'count':0x0,'rows':[]};var _0x394a32=_[_0xe6f7('0x41')](db['ChatWebsite'][_0xe6f7('0x42')],function(_0x3b009a){return{'name':_0x3b009a[_0xe6f7('0x43')],'type':_0x3b009a[_0xe6f7('0x44')]['key']};});_0x50e55e[_0xe6f7('0x45')]=_[_0xe6f7('0x41')](_0x394a32,'name');_0x50e55e[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x4b0e15[_0xe6f7('0x46')]);_0x50e55e['filters']=_[_0xe6f7('0x48')](_0x50e55e[_0xe6f7('0x45')],_0x50e55e['query']);_0x5e7726[_0xe6f7('0x49')]=_['intersection'](_0x50e55e[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x4b0e15['query'][_0xe6f7('0x4a')]));_0x5e7726[_0xe6f7('0x49')]=_0x5e7726['attributes']['length']?_0x5e7726[_0xe6f7('0x49')]:_0x50e55e[_0xe6f7('0x45')];if(!_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x4b')](_0xe6f7('0x4c'))){_0x5e7726['limit']=qs[_0xe6f7('0x2d')](_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x2d')]);_0x5e7726[_0xe6f7('0x2f')]=qs[_0xe6f7('0x2f')](_0x4b0e15['query']['offset']);}_0x5e7726[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x5e7726[_0xe6f7('0x4f')]=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x4b0e15['query'],_0x50e55e[_0xe6f7('0x50')]),_0x394a32);if(_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x5e7726[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x5e7726[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x394a32,function(_0x47843f){if(_0x47843f['type']!=='VIRTUAL'){var _0x39cc5d={};_0x39cc5d[_0x47843f[_0xe6f7('0x3e')]]={'$like':'%'+_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x52')]+'%'};return _0x39cc5d;}})});}_0x5e7726=_[_0xe6f7('0x53')]({},_0x5e7726,_0x4b0e15[_0xe6f7('0x54')]);var _0x54aff5={'where':_0x5e7726[_0xe6f7('0x4f')]};return db[_0xe6f7('0x55')][_0xe6f7('0x30')](_0x54aff5)[_0xe6f7('0x38')](function(_0x2dd75){_0x220a60[_0xe6f7('0x30')]=_0x2dd75;if(_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x56')]){_0x5e7726[_0xe6f7('0x57')]=[{'all':!![]}];}return db['ChatWebsite'][_0xe6f7('0x58')](_0x5e7726);})[_0xe6f7('0x38')](function(_0x5a9999){_0x220a60[_0xe6f7('0x59')]=_0x5a9999;return _0x220a60;})[_0xe6f7('0x38')](respondWithFilteredResult(_0x55af19,_0x5e7726))[_0xe6f7('0x5a')](handleError(_0x55af19,null));};exports[_0xe6f7('0x5b')]=function(_0x35716a,_0x1189fb){var _0x4c7f77={'raw':![],'where':{'id':_0x35716a[_0xe6f7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xe6f7('0x40')}]},_0x50aff3={};_0x50aff3[_0xe6f7('0x45')]=_[_0xe6f7('0x47')](db[_0xe6f7('0x55')][_0xe6f7('0x42')]);_0x50aff3['query']=_['keys'](_0x35716a[_0xe6f7('0x46')]);_0x50aff3[_0xe6f7('0x50')]=_['intersection'](_0x50aff3[_0xe6f7('0x45')],_0x50aff3[_0xe6f7('0x46')]);_0x4c7f77[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x50aff3['model'],qs[_0xe6f7('0x4a')](_0x35716a[_0xe6f7('0x46')][_0xe6f7('0x4a')]));_0x4c7f77[_0xe6f7('0x49')]=_0x4c7f77[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x4c7f77[_0xe6f7('0x49')]:_0x50aff3[_0xe6f7('0x45')];if(_0x35716a[_0xe6f7('0x46')][_0xe6f7('0x56')]){_0x4c7f77[_0xe6f7('0x57')]=[{'all':!![]}];}_0x4c7f77=_['merge']({},_0x4c7f77,_0x35716a[_0xe6f7('0x54')]);return db[_0xe6f7('0x55')]['find'](_0x4c7f77)[_0xe6f7('0x38')](handleEntityNotFound(_0x1189fb,null))['then'](respondWithResult(_0x1189fb,null))[_0xe6f7('0x5a')](handleError(_0x1189fb,null));};exports[_0xe6f7('0x5e')]=function(_0xe794e5,_0x3678ec){return db['ChatWebsite'][_0xe6f7('0x5e')](_0xe794e5[_0xe6f7('0x5f')],{})[_0xe6f7('0x38')](function(_0x5208f2){var _0x26b4cb=_0xe794e5[_0xe6f7('0x60')][_0xe6f7('0x3a')]({'plain':!![]});if(!_0x26b4cb)throw new Error(_0xe6f7('0x61'));if(_0x26b4cb['role']==='user'){var _0x29ffd9=_0x5208f2[_0xe6f7('0x3a')]({'plain':!![]});var _0x5c358d=_0xe6f7('0x3b');return db[_0xe6f7('0x62')]['find']({'where':{'name':_0x5c358d,'userProfileId':_0x26b4cb[_0xe6f7('0x63')]},'raw':!![]})[_0xe6f7('0x38')](function(_0x3146e6){if(_0x3146e6&&_0x3146e6[_0xe6f7('0x64')]===0x0){return db[_0xe6f7('0x3c')][_0xe6f7('0x5e')]({'name':_0x29ffd9['name'],'resourceId':_0x29ffd9['id'],'type':_0x3146e6[_0xe6f7('0x3e')],'sectionId':_0x3146e6['id']},{})[_0xe6f7('0x38')](function(){return _0x5208f2;});}else{return _0x5208f2;}})['catch'](function(_0x305602){logger[_0xe6f7('0x26')](_0xe6f7('0x65'),_0x305602);throw _0x305602;});}return _0x5208f2;})[_0xe6f7('0x38')](respondWithResult(_0x3678ec,0xc9))['catch'](handleError(_0x3678ec,null));};exports[_0xe6f7('0x66')]=function(_0x3c8116,_0x4d29e2){if(_0x3c8116[_0xe6f7('0x5f')]['id']){delete _0x3c8116['body']['id'];}return db['ChatWebsite'][_0xe6f7('0x67')]({'where':{'id':_0x3c8116[_0xe6f7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xe6f7('0x40')}]})[_0xe6f7('0x38')](handleEntityNotFound(_0x4d29e2,null))['then'](saveUpdates(_0x3c8116[_0xe6f7('0x5f')],null))['then'](respondWithResult(_0x4d29e2,null))[_0xe6f7('0x5a')](handleError(_0x4d29e2,null));};exports['destroy']=function(_0x5355cb,_0x198995){return db[_0xe6f7('0x55')]['find']({'where':{'id':_0x5355cb['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x198995,null))[_0xe6f7('0x38')](removeEntity(_0x198995,null))[_0xe6f7('0x5a')](handleError(_0x198995,null));};exports[_0xe6f7('0x68')]=function(_0x2b56f5,_0x250f00){return db[_0xe6f7('0x55')][_0xe6f7('0x68')]()['then'](respondWithResult(_0x250f00,null))[_0xe6f7('0x5a')](handleError(_0x250f00,null));};exports['addDisposition']=function(_0x154b0c,_0x177d4e,_0x23452f){if(_0x154b0c[_0xe6f7('0x5f')]['id']){delete _0x154b0c[_0xe6f7('0x5f')]['id'];}return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x154b0c[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x177d4e,null))['then'](function(_0x37b7a2){if(_0x37b7a2){_0x154b0c[_0xe6f7('0x5f')][_0xe6f7('0x69')]=_0x37b7a2['id'];return db[_0xe6f7('0x6a')]['create'](_0x154b0c[_0xe6f7('0x5f')]);}})['then'](respondWithResult(_0x177d4e,null))[_0xe6f7('0x5a')](handleError(_0x177d4e,null));};exports[_0xe6f7('0x6b')]=function(_0x1c502a,_0x296961,_0x4e1876){var _0x19b374={'raw':![],'where':{}};var _0x43571d={};var _0x31f384={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x1c502a[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x296961,null))[_0xe6f7('0x38')](function(_0x57554e){if(_0x57554e){_0x43571d['model']=_[_0xe6f7('0x47')](db[_0xe6f7('0x6a')]['rawAttributes']);_0x43571d['query']=_[_0xe6f7('0x47')](_0x1c502a[_0xe6f7('0x46')]);_0x43571d['filters']=_['intersection'](_0x43571d[_0xe6f7('0x45')],_0x43571d[_0xe6f7('0x46')]);_0x19b374[_0xe6f7('0x49')]=_['intersection'](_0x43571d['model'],qs['fields'](_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x4a')]));_0x19b374[_0xe6f7('0x49')]=_0x19b374[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x19b374[_0xe6f7('0x49')]:_0x43571d[_0xe6f7('0x45')];if(!_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x19b374[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x2d')]);_0x19b374['offset']=qs[_0xe6f7('0x2f')](_0x1c502a[_0xe6f7('0x46')]['offset']);}_0x19b374[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x19b374['where']=qs['filters'](_['pick'](_0x1c502a[_0xe6f7('0x46')],_0x43571d['filters']));_0x19b374[_0xe6f7('0x4f')]['ChatWebsiteId']=_0x57554e['id'];if(_0x1c502a['query']['filter']){_0x19b374[_0xe6f7('0x4f')]=_['merge'](_0x19b374[_0xe6f7('0x4f')],{'$or':_['map'](_0x19b374['attributes'],function(_0x30f1bc){var _0x4bd625={};_0x4bd625[_0x30f1bc]={'$like':'%'+_0x1c502a['query'][_0xe6f7('0x52')]+'%'};return _0x4bd625;})});}_0x19b374=_[_0xe6f7('0x53')]({},_0x19b374,_0x1c502a[_0xe6f7('0x54')]);return db[_0xe6f7('0x6a')][_0xe6f7('0x30')]({'where':_0x19b374[_0xe6f7('0x4f')]})[_0xe6f7('0x38')](function(_0x57f26f){_0x31f384[_0xe6f7('0x30')]=_0x57f26f;if(_0x1c502a[_0xe6f7('0x46')]['includeAll']){_0x19b374[_0xe6f7('0x57')]=[{'all':!![]}];}return db[_0xe6f7('0x6a')][_0xe6f7('0x58')](_0x19b374);})[_0xe6f7('0x38')](function(_0xad9f99){_0x31f384[_0xe6f7('0x59')]=_0xad9f99;return _0x31f384;});}})['then'](respondWithFilteredResult(_0x296961,_0x19b374))[_0xe6f7('0x5a')](handleError(_0x296961,null));};exports[_0xe6f7('0x6d')]=function(_0x306f82,_0x2f978e,_0x1331cf){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x306f82[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x2f978e,null))[_0xe6f7('0x38')](function(_0x3ab648){if(_0x3ab648){return _0x3ab648[_0xe6f7('0x6d')](_0x306f82[_0xe6f7('0x46')][_0xe6f7('0x6e')]);}})[_0xe6f7('0x38')](respondWithStatusCode(_0x2f978e,null))[_0xe6f7('0x5a')](handleError(_0x2f978e,null));};exports[_0xe6f7('0x6f')]=function(_0x5296f8,_0x329568,_0x44bedc){if(_0x5296f8[_0xe6f7('0x5f')]['id']){delete _0x5296f8[_0xe6f7('0x5f')]['id'];}return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x5296f8[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x329568,null))[_0xe6f7('0x38')](function(_0xd0720a){if(_0xd0720a){_0x5296f8[_0xe6f7('0x5f')][_0xe6f7('0x69')]=_0xd0720a['id'];return db[_0xe6f7('0x70')][_0xe6f7('0x5e')](_0x5296f8['body']);}})[_0xe6f7('0x38')](respondWithResult(_0x329568,null))[_0xe6f7('0x5a')](handleError(_0x329568,null));};exports[_0xe6f7('0x71')]=function(_0x511229,_0x3ceaaf,_0x3d3129){var _0x3f3853={'raw':![],'where':{}};var _0x43440d={};var _0x4c9e44={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x511229[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x3ceaaf,null))['then'](function(_0x17ef84){if(_0x17ef84){_0x43440d[_0xe6f7('0x45')]=_['keys'](db[_0xe6f7('0x70')][_0xe6f7('0x42')]);_0x43440d['query']=_[_0xe6f7('0x47')](_0x511229[_0xe6f7('0x46')]);_0x43440d[_0xe6f7('0x50')]=_['intersection'](_0x43440d[_0xe6f7('0x45')],_0x43440d[_0xe6f7('0x46')]);_0x3f3853[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x43440d[_0xe6f7('0x45')],qs['fields'](_0x511229['query'][_0xe6f7('0x4a')]));_0x3f3853['attributes']=_0x3f3853[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x3f3853['attributes']:_0x43440d[_0xe6f7('0x45')];if(!_0x511229['query']['hasOwnProperty']('nolimit')){_0x3f3853[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x511229['query'][_0xe6f7('0x2d')]);_0x3f3853[_0xe6f7('0x2f')]=qs['offset'](_0x511229[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}_0x3f3853['order']=qs[_0xe6f7('0x4e')](_0x511229[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x3f3853[_0xe6f7('0x4f')]=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x511229['query'],_0x43440d['filters']));_0x3f3853[_0xe6f7('0x4f')]['ChatWebsiteId']=_0x17ef84['id'];if(_0x511229[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x3f3853['where']=_[_0xe6f7('0x53')](_0x3f3853['where'],{'$or':_[_0xe6f7('0x41')](_0x3f3853['attributes'],function(_0x5d98d3){var _0x465040={};_0x465040[_0x5d98d3]={'$like':'%'+_0x511229[_0xe6f7('0x46')][_0xe6f7('0x52')]+'%'};return _0x465040;})});}_0x3f3853=_[_0xe6f7('0x53')]({},_0x3f3853,_0x511229[_0xe6f7('0x54')]);return db[_0xe6f7('0x70')]['count']({'where':_0x3f3853[_0xe6f7('0x4f')]})[_0xe6f7('0x38')](function(_0x33f9ff){_0x4c9e44[_0xe6f7('0x30')]=_0x33f9ff;if(_0x511229[_0xe6f7('0x46')]['includeAll']){_0x3f3853[_0xe6f7('0x57')]=[{'all':!![]}];}return db[_0xe6f7('0x70')][_0xe6f7('0x58')](_0x3f3853);})[_0xe6f7('0x38')](function(_0x2365a9){_0x4c9e44[_0xe6f7('0x59')]=_0x2365a9;return _0x4c9e44;});}})[_0xe6f7('0x38')](respondWithFilteredResult(_0x3ceaaf,_0x3f3853))[_0xe6f7('0x5a')](handleError(_0x3ceaaf,null));};exports[_0xe6f7('0x72')]=function(_0x2d45fe,_0x316196,_0x3d03f8){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x2d45fe[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x316196,null))[_0xe6f7('0x38')](function(_0x56c6fa){if(_0x56c6fa){return _0x56c6fa[_0xe6f7('0x72')](_0x2d45fe['query'][_0xe6f7('0x6e')]);}})[_0xe6f7('0x38')](respondWithStatusCode(_0x316196,null))[_0xe6f7('0x5a')](handleError(_0x316196,null));};exports[_0xe6f7('0x73')]=function(_0x2b885b,_0x51ecd1,_0x4ba1a5){_0x2b885b[_0xe6f7('0x5f')][_0xe6f7('0x74')]=_0x2b885b['file'][_0xe6f7('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x2b885b[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x51ecd1,null))[_0xe6f7('0x38')](saveUpdates(_0x2b885b[_0xe6f7('0x5f')],null))[_0xe6f7('0x38')](respondWithResult(_0x51ecd1,null))[_0xe6f7('0x5a')](handleError(_0x51ecd1,null));};exports[_0xe6f7('0x76')]=function(_0x1cd3ed,_0x5b7f15,_0x108836){_0x1cd3ed[_0xe6f7('0x5f')][_0xe6f7('0x77')]=_0x1cd3ed[_0xe6f7('0x78')][_0xe6f7('0x75')];return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x1cd3ed['params']['id']}})['then'](handleEntityNotFound(_0x5b7f15,null))[_0xe6f7('0x38')](saveUpdates(_0x1cd3ed['body'],null))['then'](respondWithResult(_0x5b7f15,null))[_0xe6f7('0x5a')](handleError(_0x5b7f15,null));};exports[_0xe6f7('0x79')]=function(_0x47efc4,_0x2f2a3a,_0x4d61b2){_0x47efc4[_0xe6f7('0x5f')][_0xe6f7('0x7a')]=_0x47efc4[_0xe6f7('0x78')]['filename'];return db[_0xe6f7('0x55')]['find']({'where':{'id':_0x47efc4[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x2f2a3a,null))[_0xe6f7('0x38')](saveUpdates(_0x47efc4['body'],null))['then'](respondWithResult(_0x2f2a3a,null))[_0xe6f7('0x5a')](handleError(_0x2f2a3a,null));};exports[_0xe6f7('0x7b')]=function(_0x29d425,_0xa8f629,_0x494743){_0x29d425['body'][_0xe6f7('0x7c')]=_0x29d425['file'][_0xe6f7('0x75')];return db[_0xe6f7('0x55')]['find']({'where':{'id':_0x29d425[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0xa8f629,null))[_0xe6f7('0x38')](saveUpdates(_0x29d425[_0xe6f7('0x5f')],null))[_0xe6f7('0x38')](respondWithResult(_0xa8f629,null))[_0xe6f7('0x5a')](handleError(_0xa8f629,null));};exports[_0xe6f7('0x7d')]=function(_0x1528c9,_0x5c54fc,_0x636c4f){var _0x4c54df=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],'server/files/images/logos/default_logo.svg');var _0x95f1eb={'where':{'id':_0x1528c9[_0xe6f7('0x5c')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4fcc78=![];return require(_0xe6f7('0x18'))[_0xe6f7('0x80')]()['then'](function(_0x10c944){if(_0x10c944){_0x4fcc78=_0x10c944['custom'];}})[_0xe6f7('0x38')](function(){return db[_0xe6f7('0x55')][_0xe6f7('0x67')](_0x95f1eb);})['then'](handleEntityNotFound(_0x5c54fc,null))[_0xe6f7('0x38')](function(_0x3630c5){if(_0x3630c5){if(!_[_0xe6f7('0x81')](_0x3630c5[_0xe6f7('0x74')])){if(fs['existsSync'](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x82'),_0x3630c5['sitepic']))&&_0x4fcc78){_0x4c54df=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x82'),_0x3630c5[_0xe6f7('0x74')]);}}return _0x5c54fc[_0xe6f7('0x83')](_0x4c54df);}})[_0xe6f7('0x5a')](handleError(_0x5c54fc,null));};exports[_0xe6f7('0x84')]=function(_0x627521,_0x4217ba,_0x5d7aac){var _0x3f13bc=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x85'));var _0x58e91b={'where':{'id':_0x627521[_0xe6f7('0x5c')]['id']},'attributes':['id',_0xe6f7('0x77')],'raw':!![]};return db[_0xe6f7('0x55')][_0xe6f7('0x67')](_0x58e91b)[_0xe6f7('0x38')](handleEntityNotFound(_0x4217ba,null))[_0xe6f7('0x38')](function(_0x465187){if(_0x465187){if(!_[_0xe6f7('0x81')](_0x465187[_0xe6f7('0x77')])){if(fs[_0xe6f7('0x86')](path[_0xe6f7('0x7e')](config['root'],_0xe6f7('0x87'),_0x465187[_0xe6f7('0x77')]))){_0x3f13bc=path['join'](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x465187[_0xe6f7('0x77')]);}}return _0x4217ba['download'](_0x3f13bc);}})[_0xe6f7('0x5a')](handleError(_0x4217ba,null));};exports[_0xe6f7('0x88')]=function(_0x24a1aa,_0x3691b0,_0x125660){var _0x5f3789=path['join'](config[_0xe6f7('0x7f')],_0xe6f7('0x89'));var _0x36347a={'where':{'id':_0x24a1aa[_0xe6f7('0x5c')]['id']},'attributes':['id',_0xe6f7('0x7a'),'showCustomerAvatar'],'raw':!![]};return db[_0xe6f7('0x55')][_0xe6f7('0x67')](_0x36347a)['then'](handleEntityNotFound(_0x3691b0,null))[_0xe6f7('0x38')](function(_0x45f24c){if(_0x45f24c){if(!_[_0xe6f7('0x81')](_0x45f24c['customerAvatar'])){if(fs[_0xe6f7('0x86')](path[_0xe6f7('0x7e')](config['root'],_0xe6f7('0x87'),_0x45f24c[_0xe6f7('0x7a')]))&&_0x45f24c[_0xe6f7('0x8a')]){_0x5f3789=path['join'](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x45f24c[_0xe6f7('0x7a')]);}}return _0x3691b0[_0xe6f7('0x83')](_0x5f3789);}})[_0xe6f7('0x5a')](handleError(_0x3691b0,null));};exports['getSystemAvatar']=function(_0x426aca,_0x150496,_0x1d510a){var _0x281bd0=path[_0xe6f7('0x7e')](config['root'],_0xe6f7('0x8b'));var _0x341810={'where':{'id':_0x426aca[_0xe6f7('0x5c')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe6f7('0x55')]['find'](_0x341810)[_0xe6f7('0x38')](handleEntityNotFound(_0x150496,null))[_0xe6f7('0x38')](function(_0x579f1c){if(_0x579f1c){if(!_['isNil'](_0x579f1c[_0xe6f7('0x7c')])){if(fs['existsSync'](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x579f1c['systemAvatar']))){_0x281bd0=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x579f1c[_0xe6f7('0x7c')]);}}return _0x150496[_0xe6f7('0x83')](_0x281bd0);}})[_0xe6f7('0x5a')](handleError(_0x150496,null));};exports[_0xe6f7('0x8c')]=function(_0x41d1c5,_0x34514b,_0x5eeff5){var _0x318d8e=require(_0xe6f7('0x8d'));var _0xb0e10c=new _0x318d8e();var _0x28bfdb=_0xb0e10c[_0xe6f7('0x8e')](_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0x90')])['getResult']();var _0x3b7058={'body':_0x41d1c5[_0xe6f7('0x5f')],'channel':'chat'};var _0x36f499=[];var _0x44ffe0=[];var _0x3b0aa0={};var _0x1ea00c=![];return db[_0xe6f7('0x91')][_0xe6f7('0x68')]()[_0xe6f7('0x38')](function(_0x340a7c){if(!_0x340a7c){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))]('no\x20available\x20attributes');}_0x36f499=_[_0xe6f7('0x94')](_['keys'](_0x340a7c),[_0xe6f7('0x95'),'updatedAt']);_0x44ffe0=_[_0xe6f7('0x94')](_[_0xe6f7('0x47')](_0x340a7c),['createdAt',_0xe6f7('0x96'),_0xe6f7('0x97'),_0xe6f7('0x98')]);if(_0x41d1c5[_0xe6f7('0x5f')]['id']){delete _0x41d1c5[_0xe6f7('0x5f')]['id'];}if(_[_0xe6f7('0x81')](_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x99')])){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0x9a'));}if(_[_0xe6f7('0x81')](_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x5f')])||_0x41d1c5['body'][_0xe6f7('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0xe6f7('0x9b'));}if(_[_0xe6f7('0x81')](_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x9c')])){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44ffe0);}if(!_[_0xe6f7('0x9d')](_0x44ffe0,_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x9c')])){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0x9e')+_0x44ffe0);}_0x3b0aa0[_0x41d1c5[_0xe6f7('0x5f')]['mapKey']]=_0x41d1c5['body'][_0xe6f7('0x99')];})[_0xe6f7('0x38')](function(){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x41d1c5[_0xe6f7('0x5c')]['id']},'include':[{'model':db[_0xe6f7('0x9f')],'as':_0xe6f7('0xa0'),'include':[{'model':db[_0xe6f7('0x91')],'as':'Contacts','where':_0x3b0aa0,'limit':0x1,'order':[[_0xe6f7('0x96'),'DESC']]}]},{'model':db[_0xe6f7('0xa1')],'as':_0xe6f7('0xa2')}]});})[_0xe6f7('0x38')](handleEntityNotFound(_0x34514b,null))[_0xe6f7('0x38')](function(_0x19e9c6){if(_0x19e9c6&&_0x19e9c6['List']){_0x3b7058[_0xe6f7('0xa3')]=_0x19e9c6;_0x3b7058['applications']=_0x19e9c6[_0xe6f7('0xa2')];_0x3b7058[_0xe6f7('0xa4')]=_0x19e9c6[_0xe6f7('0xa0')];_0x3b7058[_0xe6f7('0xa5')]=_[_0xe6f7('0xa6')](_0x3b7058['applications'],[_0xe6f7('0xa7')],['asc']);if(_0x3b7058['account']['Applications']){delete _0x3b7058[_0xe6f7('0xa3')]['Applications'];}if(_0x3b7058[_0xe6f7('0xa3')]['List']&&_0x3b7058['account']['List'][_0xe6f7('0xa8')][_0xe6f7('0x5d')]){return _0x3b7058['account'][_0xe6f7('0xa0')][_0xe6f7('0xa8')][0x0];}var _0x12f014=_[_0xe6f7('0x1a')](_0x41d1c5['body'],{'firstName':_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x99')],'ListId':_0x19e9c6[_0xe6f7('0x98')]});_0x12f014[_0x41d1c5['body']['mapKey']]=_0x41d1c5['body'][_0xe6f7('0x99')];return db[_0xe6f7('0x91')]['create'](_0x12f014,{'fields':_0x36f499,'raw':!![]});}})['then'](handleEntityNotFound(_0x34514b,null))[_0xe6f7('0x38')](function(_0x1d6f97){_0x3b7058[_0xe6f7('0xa9')]=_0x1d6f97;var _0x32a73f=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xaa')];if(_0x41d1c5['headers']['cf-connecting-ip']){_0x32a73f=_0x41d1c5[_0xe6f7('0x8f')]['cf-connecting-ip'];}else if(_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0xab')]){_0x32a73f=_[_0xe6f7('0xac')](_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0xab')][_0xe6f7('0xad')](','));}if(_0x1d6f97){var _0x1f7d59={'ContactId':_0x1d6f97['id'],'ChatWebsiteId':_0x41d1c5['params']['id'],'from':(_0x1d6f97[_0xe6f7('0xae')]||'')+'\x20'+(_0x1d6f97['lastName']||''),'customerIp':_0x32a73f,'customerPort':_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0xaf')]?_0x41d1c5[_0xe6f7('0x8f')]['x-real-port']:null,'referer':_0x41d1c5['body']['referer'],'browserName':_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0x3e')]&&_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0xb1')]?util[_0xe6f7('0xb2')]('%s\x20%s',_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0x3e')],_0x28bfdb['browser']['version']):_0xe6f7('0xb3'),'browserVersion':_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0xb1')]||'unknown','osName':util[_0xe6f7('0xb2')](_0xe6f7('0xb4'),_0x28bfdb['os'][_0xe6f7('0x3e')],_0x28bfdb['os'][_0xe6f7('0xb1')]),'osVersion':_0x28bfdb['os'][_0xe6f7('0xb1')],'deviceModel':_0x28bfdb[_0xe6f7('0xb5')]['model']&&_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0xb6')]?util['format'](_0xe6f7('0xb7'),_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0x45')],_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0xb6')],_0x28bfdb['device']['type']):null,'deviceVendor':_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0xb6')],'deviceType':_0x28bfdb[_0xe6f7('0xb5')]['type'],'formData':JSON[_0xe6f7('0x25')](_0x41d1c5[_0xe6f7('0x5f')])};var _0x33cf90={'ChatWebsiteId':_0x41d1c5[_0xe6f7('0x5c')]['id'],'closed':![]};if(_0x41d1c5['body'][_0xe6f7('0xb8')]){_0x33cf90[_0xe6f7('0xb8')]=_0x41d1c5[_0xe6f7('0x5f')]['threadId'];return db['ChatInteraction'][_0xe6f7('0x67')]({'where':_0x33cf90})[_0xe6f7('0x38')](function(_0x6c7823){if(_0x6c7823){return[_0x6c7823,![]];}_0x1f7d59[_0xe6f7('0xb8')]=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xb8')];_0x1f7d59[_0xe6f7('0xb9')]=_0x41d1c5[_0xe6f7('0x5f')]['externalUrl'];return db[_0xe6f7('0xba')][_0xe6f7('0x5e')](_0x1f7d59)[_0xe6f7('0x38')](function(_0x406170){return[_0x406170,!![]];});});}_0x33cf90['ContactId']=_0x1d6f97['id'];if(_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbb')]&&_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbb')]['id']){_0x33cf90['id']=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbb')]['id'];return db[_0xe6f7('0xba')][_0xe6f7('0x67')]({'where':_0x33cf90})[_0xe6f7('0x38')](function(_0x281797){if(_0x281797){return[_0x281797,![]];}return db[_0xe6f7('0xba')][_0xe6f7('0x5e')](_0x1f7d59)[_0xe6f7('0x38')](function(_0x44ff8b){return[_0x44ff8b,!![]];});});}return db['ChatInteraction'][_0xe6f7('0x5e')](_0x1f7d59)['then'](function(_0x217980){return[_0x217980,!![]];});}})[_0xe6f7('0xbc')](function(_0xd3f615,_0x5ce72d){if(_0xd3f615){_0x1ea00c=_0x5ce72d;if(!_0x5ce72d){var _0x117c99={'from':(_0x3b7058['contact'][_0xe6f7('0xae')]||'')+'\x20'+(_0x3b7058[_0xe6f7('0xa9')][_0xe6f7('0xbd')]||'')};if(_0x41d1c5['body'][_0xe6f7('0xb8')]&&_0x41d1c5['body'][_0xe6f7('0xbe')]&&_0x41d1c5['body'][_0xe6f7('0xb8')]!=_0x41d1c5[_0xe6f7('0x5f')]['messageId']){_0x117c99[_0xe6f7('0xb8')]=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbe')];}return _0xd3f615[_0xe6f7('0x66')](_0x117c99);}else{return _0xd3f615;}}})[_0xe6f7('0x38')](function(_0x29cb02){_0x3b7058[_0xe6f7('0xbb')]=_0x29cb02[_0xe6f7('0x3a')]({'plain':!![]});_0x3b7058['interaction'][_0xe6f7('0xbf')]=_0x1ea00c;if(_0x3b7058[_0xe6f7('0xbb')][_0xe6f7('0xbf')]){if(_0x3b7058[_0xe6f7('0xa3')][_0xe6f7('0xc0')]){_0x3b7058[_0xe6f7('0xa5')][_0xe6f7('0xc1')]({'id':0x0,'priority':_0x3b7058['applications'][_0xe6f7('0x5d')]+0x1,'app':'close','appdata':_0xe6f7('0xc2'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xe6f7('0x5e')]({'body':_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x5f')],'ChatWebsiteId':_0x41d1c5[_0xe6f7('0x5c')]['id'],'ChatInteractionId':_0x29cb02['id'],'direction':'in','ContactId':_0x3b7058[_0xe6f7('0xa9')]['id'],'AttachmentId':_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xc3')]});})[_0xe6f7('0x38')](function(_0x153c1c){_0x3b7058['message']=_0x153c1c;if(_0x3b7058[_0xe6f7('0xbb')][_0xe6f7('0xc4')]){return db[_0xe6f7('0xc5')][_0xe6f7('0x67')]({'attributes':['id',_0xe6f7('0x3e')],'where':{'id':_0x3b7058['interaction'][_0xe6f7('0xc4')]}})[_0xe6f7('0x38')](function(_0x22e0c2){if(_0x22e0c2){_0x3b7058['applications'][_0xe6f7('0xc6')]({'id':0x0,'priority':0x0,'app':_0xe6f7('0xc7'),'appdata':_0x22e0c2[_0xe6f7('0x3e')]+','+(_0x3b7058[_0xe6f7('0xa3')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x3b7058['forcedOwnership']=!![];}return respondWithRpcPromise(_0xe6f7('0xc8'),_0xe6f7('0xc9'),_0x3b7058);});}return respondWithRpcPromise('Start',_0xe6f7('0xc9'),_0x3b7058);})[_0xe6f7('0x38')](function(_0x58578b){respondWithRpcPromise(_0xe6f7('0xca'),_0xe6f7('0xca'),{'event':'notify','message':_0x58578b},client9002);return _0x58578b;})[_0xe6f7('0x38')](respondWithResult(_0x34514b,null))[_0xe6f7('0x5a')](handleError(_0x34514b,null));};exports[_0xe6f7('0xcb')]=function(_0x515f2a,_0x5a8f7c,_0x454597){var _0x514523,_0x78703f,_0x42462e;var _0x1ad664=[];var _0x5c7f75=[];var _0x4984db={};var _0x218dc2=_0x515f2a[_0xe6f7('0xcc')]||[];var _0x78b9fa=[];var _0x3653bd;return db['CmContact'][_0xe6f7('0x68')]()[_0xe6f7('0x38')](function(_0x2c7a93){if(!_0x2c7a93){throw new db['Sequelize'][(_0xe6f7('0x93'))](_0xe6f7('0xcd'));}_0x5c7f75=_[_0xe6f7('0x94')](_['keys'](_0x2c7a93),[_0xe6f7('0x95'),_0xe6f7('0x96')]);_0x1ad664=_[_0xe6f7('0x94')](_[_0xe6f7('0x47')](_0x2c7a93),['createdAt',_0xe6f7('0x96'),_0xe6f7('0x97'),_0xe6f7('0x98')]);if(_0x515f2a[_0xe6f7('0x5f')]['id']){delete _0x515f2a['body']['id'];}if(_[_0xe6f7('0x81')](_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')])){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)[_0xe6f7('0x3f')](new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))]('from\x20is\x20mandatory'));}if(_[_0xe6f7('0x81')](_0x515f2a[_0xe6f7('0x5f')]['body'])||_0x515f2a[_0xe6f7('0x5f')]['body']===''){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)['send'](new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0x9b')));}if(_['isNil'](_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0xce')])){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)[_0xe6f7('0x3f')](new db['Sequelize'][(_0xe6f7('0x93'))](_0xe6f7('0xcf')+_0x1ad664));}if(!_[_0xe6f7('0x9d')](_0x1ad664,_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0xce')])){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)[_0xe6f7('0x3f')](new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0xd0')+_0x1ad664));}_0x4984db[_0x515f2a[_0xe6f7('0x5f')]['mapKeyOffline']]=_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')];})[_0xe6f7('0x38')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x515f2a[_0xe6f7('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xe6f7('0xa0')},{'model':db[_0xe6f7('0xd1')],'as':_0xe6f7('0xd1')}]});})[_0xe6f7('0x38')](handleEntityNotFound(_0x5a8f7c,null))['then'](function(_0x2c4809){if(_0x2c4809&&_0x2c4809[_0xe6f7('0xa0')]){_0x78703f=_0x2c4809;var _0x3672d3=_[_0xe6f7('0x1a')](_0x515f2a[_0xe6f7('0x5f')],{'firstName':_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')],'phone':_0x515f2a[_0xe6f7('0x5f')]['from'],'ListId':_0x2c4809[_0xe6f7('0x98')]});_0x3672d3[_0x515f2a['body'][_0xe6f7('0xce')]]=_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')];return db['CmContact']['findOrCreate']({'where':_0x4984db,'defaults':_0x3672d3});}})[_0xe6f7('0xbc')](function(_0x371d95){if(_0x371d95){_0x42462e=_0x371d95;var _0x99db6c=fs[_0xe6f7('0xd2')](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0xd3')),'utf8');var _0x3e6e79=ejs['render'](_0x99db6c,{'body':_[_0xe6f7('0xd4')](_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x5f')]),'bodyTitle':_0x78703f[_0xe6f7('0xd5')]});return db[_0xe6f7('0xd6')][_0xe6f7('0x5e')]({'body':_0x3e6e79,'ContactId':_0x371d95['id'],'ChatWebsiteId':_0x78703f['id']});}})['then'](function(_0x12a455){_0x3653bd=_0x12a455;if(_0x218dc2[_0xe6f7('0x5d')]){var _0x909c7f=_0x218dc2['map'](function(_0x2af65d){return{'name':_0x2af65d['originalname'],'basename':_0x2af65d[_0xe6f7('0x75')],'type':_0x2af65d[_0xe6f7('0xd7')],'ChatOfflineMessageId':_0x12a455['id']};});_0x78b9fa=_0x909c7f['map'](_0x4f5f09=>{var _0x4ff289={'filename':_0x4f5f09[_0xe6f7('0x3e')],'path':path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],'server',_0xe6f7('0xcc'),'attachments',_0xe6f7('0xd8'),_0x4f5f09[_0xe6f7('0xd9')])};return _0x4ff289;});if(!_0x78703f['openNewInteraction']){return db[_0xe6f7('0xda')][_0xe6f7('0xdb')](function(_0x5265c1){return db[_0xe6f7('0xdc')][_0xe6f7('0xdd')](_0x909c7f,{'transaction':_0x5265c1});});}}})[_0xe6f7('0x38')](function(){if(_0x3653bd){_0x514523=_0x3653bd;return db[_0xe6f7('0xd1')][_0xe6f7('0x6c')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe6f7('0xde'),'raw':!![]}]});}})[_0xe6f7('0x38')](function(_0x4f1e26){if(_0x4f1e26&&_0x4f1e26[_0xe6f7('0xde')]&&_0x78703f[_0xe6f7('0xdf')]&&_0x78703f['forwardOfflineAddress']){var _0x5f4114={'tls':{'rejectUnauthorized':![]}};if(_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe0')]){_0x5f4114['service']=_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe0')];}else{_0x5f4114[_0xe6f7('0xe1')]=_0x4f1e26[_0xe6f7('0xde')]['host'];_0x5f4114['port']=_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe2')];_0x5f4114[_0xe6f7('0xe3')]=_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe3')];}if(_0x4f1e26[_0xe6f7('0xde')]['authentication']){_0x5f4114[_0xe6f7('0xe4')]={'user':_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0x60')],'pass':_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe5')]};}return respondWithRpcPromise(_0xe6f7('0xe6'),'sendMail',{'account':_0x5f4114,'message':{'from':util[_0xe6f7('0xb2')]('\x22%s\x22\x20<%s>',_0x4f1e26[_0xe6f7('0x3e')],_0x4f1e26['email']||_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0x60')]),'to':_0x78703f['forwardOfflineAddress'],'subject':_0x78703f[_0xe6f7('0xe7')],'html':_0x514523['body'],'attachments':_0x78b9fa}},client9003)[_0xe6f7('0x38')](function(){return _0x514523;})['catch'](function(_0x2e1c35){console[_0xe6f7('0x26')](_0x2e1c35);});}})[_0xe6f7('0x38')](function(){if(_0x78703f&&_0x78703f[_0xe6f7('0xe8')]&&_0x78703f[_0xe6f7('0xe9')]){var _0xe4646a=[];if(_0x218dc2[_0xe6f7('0x5d')]){_0xe4646a=_0x218dc2['map'](function(_0x5a2c4a){return{'name':_0x5a2c4a[_0xe6f7('0xea')],'basename':_0x5a2c4a['filename'],'type':_0x5a2c4a[_0xe6f7('0xd7')],'ChatOfflineMessageId':_0x3653bd['id']};});}var _0x337836;if(!_[_0xe6f7('0x81')](_0x78703f[_0xe6f7('0xeb')])){var _0x2b7c53=_[_0xe6f7('0x41')](_0x515f2a[_0xe6f7('0x5f')],function(_0x41d14c){return _0x41d14c;});var _0x5db638=_[_0xe6f7('0xec')](_0x2b7c53)[0x0];var _0x6488c3=_[_0xe6f7('0xed')](_0x5db638,function(_0x2585e7){return _0x2585e7;});_0x337836=_0x6488c3[0x1][_0x78703f[_0xe6f7('0xeb')]];}var _0x2532bb={'from':_0x42462e['email'],'firstName':_0x42462e[_0xe6f7('0xae')],'lastName':_0x42462e[_0xe6f7('0xbd')],'mapKey':'email','message':{'from':_0x42462e['email'],'to':_0x78703f[_0xe6f7('0xd1')][_0xe6f7('0xee')],'cc':'','subject':_['isNil'](_0x337836)?_0x78703f['offlineMessageSubject']:_0x337836,'messageId':'','sentAt':new Date(),'attach':_0xe4646a[_0xe6f7('0x5d')],'attachments':_0xe4646a,'originChannel':'Chat','ChatWebsiteId':_0x78703f['id'],'ChatOfflineMessageId':_0x514523['id'],'originTo':_0x78703f[_0xe6f7('0xd1')]['email']},'body':_0x514523[_0xe6f7('0x5f')]};var _0x35e1d2={'account':{'id':_0x78703f[_0xe6f7('0xe9')]},'body':_0x2532bb,'log':_0xe6f7('0xef')};return respondWithRpcPromise(_0xe6f7('0xef'),'notifyMail',_0x35e1d2,client9001)[_0xe6f7('0x38')](function(){return _0x514523;})[_0xe6f7('0x5a')](function(_0x1231a0){console[_0xe6f7('0x26')](_0x1231a0);});}return;})['then'](function(){if(_0x514523){return _0x514523;}})[_0xe6f7('0x38')](respondWithResult(_0x5a8f7c,null))[_0xe6f7('0x5a')](function(_0x137824){console[_0xe6f7('0x26')](_0xe6f7('0x5a'),_0x137824);for(var _0x2f4224 of _0x218dc2){var _0x5ccefa=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0xf0'),'files',_0xe6f7('0xf1'),'offline-chat',_0x2f4224[_0xe6f7('0x75')]);fs_extra['remove'](_0x5ccefa)[_0xe6f7('0x5a')](function(_0x55c816){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x5ccefa,_0x55c816);});}});};exports[_0xe6f7('0xf2')]=function(_0x18de83,_0x33480b,_0x44722e){return db[_0xe6f7('0xba')][_0xe6f7('0x67')]({'where':{'id':_0x18de83[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x33480b,null))[_0xe6f7('0x38')](function(_0x90f14){if(_0x90f14){return _0x90f14[_0xe6f7('0xf2')](_0x18de83[_0xe6f7('0x5f')][_0xe6f7('0x6e')],_[_0xe6f7('0xf3')](_0x18de83['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x33480b,null))[_0xe6f7('0x5a')](handleError(_0x33480b,null));};exports[_0xe6f7('0xf4')]=function(_0x1c48be,_0x1af6ad,_0x33f81d){var _0x53fea1={'raw':![],'where':{}};var _0x3de6a2={};var _0x3737f6={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')]['findOne']({'where':{'id':_0x1c48be[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x1af6ad,null))['then'](function(_0x4c166b){if(_0x4c166b){_0x3de6a2['model']=_['keys'](db[_0xe6f7('0xba')]['rawAttributes']);_0x3de6a2[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x1c48be[_0xe6f7('0x46')]);_0x3de6a2[_0xe6f7('0x50')]=_['intersection'](_0x3de6a2['model'],_0x3de6a2[_0xe6f7('0x46')]);_0x53fea1[_0xe6f7('0x49')]=_['intersection'](_0x3de6a2[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0x4a')]));_0x53fea1['attributes']=_0x53fea1['attributes']['length']?_0x53fea1[_0xe6f7('0x49')]:_0x3de6a2['model'];if(!_0x1c48be[_0xe6f7('0x46')]['hasOwnProperty'](_0xe6f7('0x4c'))){_0x53fea1[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x1c48be['query'][_0xe6f7('0x2d')]);_0x53fea1['offset']=qs['offset'](_0x1c48be['query']['offset']);}_0x53fea1[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x1c48be['query'][_0xe6f7('0x4e')]);_0x53fea1[_0xe6f7('0x4f')]=qs['filters'](_[_0xe6f7('0x51')](_0x1c48be['query'],_0x3de6a2['filters']));_0x53fea1['where']['ChatWebsiteId']=_0x4c166b['id'];if(_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x53fea1[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x53fea1[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x53fea1[_0xe6f7('0x49')],function(_0x303abb){var _0x1cb4c1={};_0x1cb4c1[_0x303abb]={'$like':'%'+_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0x52')]+'%'};return _0x1cb4c1;})});}_0x53fea1=_[_0xe6f7('0x53')]({},_0x53fea1,_0x1c48be['options']);return db['ChatInteraction']['count']({'where':_0x53fea1['where']})['then'](function(_0x5bb906){_0x3737f6['count']=_0x5bb906;if(_0x1c48be['query'][_0xe6f7('0x56')]){_0x53fea1[_0xe6f7('0x57')]=[{'model':db[_0xe6f7('0x91')],'as':_0xe6f7('0xf5'),'required':![]},{'model':db[_0xe6f7('0xc5')],'as':_0xe6f7('0xf6'),'attributes':[_0xe6f7('0x3e'),_0xe6f7('0xf7'),_0xe6f7('0xf8')],'required':![]},{'model':db[_0xe6f7('0xf9')],'as':_0xe6f7('0xfa'),'attributes':['id','name',_0xe6f7('0xfb')],'where':_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0xfc')]?{'id':_0x1c48be[_0xe6f7('0x46')]['tag']}:undefined,'required':_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0xfc')]?!![]:![]}];}return db[_0xe6f7('0xba')][_0xe6f7('0x58')](_0x53fea1);})[_0xe6f7('0x38')](function(_0x16ea1e){_0x3737f6[_0xe6f7('0x59')]=_0x16ea1e;return _0x3737f6;});}})['then'](respondWithFilteredResult(_0x1af6ad,_0x53fea1))['catch'](handleError(_0x1af6ad,null));};function iftimePromise(_0x1e986f,_0x61a524){return respondWithRpcPromise('Command',_0xe6f7('0xfd'),{'command':_0x61a524['timezone']?util[_0xe6f7('0xb2')](_0xe6f7('0xfe'),_0x1e986f[_0xe6f7('0xff')],_0x61a524['timezone']):util[_0xe6f7('0xb2')](_0xe6f7('0x100'),_0x1e986f['interval'])},client9002)[_0xe6f7('0x38')](function(_0x40c3f2){var _0xc68b3b=_0x40c3f2&&_0x40c3f2[_0xe6f7('0x101')]('true')>=0x0?!![]:![];logger[_0xe6f7('0x29')](_0xe6f7('0x102'),_0x61a524['id'],_0x1e986f['id'],_0x1e986f['interval'],_0xc68b3b?_0xe6f7('0x103'):_0xe6f7('0x104'),_0x61a524[_0xe6f7('0x105')]?_0x61a524[_0xe6f7('0x105')]:_0xe6f7('0x106'));return _0xc68b3b;})['catch'](function(_0x1d495a){logger['error'](_0xe6f7('0x102'),_0x61a524['id'],_0x1e986f['id'],_0x1e986f[_0xe6f7('0xff')],util[_0xe6f7('0x107')](_0x1d495a,{'showHidden':![],'depth':null}),_0x61a524[_0xe6f7('0x105')]?_0x61a524['timezone']:_0xe6f7('0x106'));return![];});}exports[_0xe6f7('0xfd')]=function(_0x420396,_0x932205,_0x3521ba){var _0x1525af=0x0;var _0x1e2bd4=0x0;var _0x1eee2a=![];var _0x38e446;var _0x1655c7;return db['ChatWebsite'][_0xe6f7('0x67')]({'where':{'id':_0x420396[_0xe6f7('0x5c')]['id']},'include':[{'model':db[_0xe6f7('0x108')],'as':_0xe6f7('0x108'),'include':[{'model':db['Interval'],'as':_0xe6f7('0x109'),'attributes':['id',_0xe6f7('0xff')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x932205,null))['then'](function(_0x4a3af6){if(_0x4a3af6){_0x38e446=_0x4a3af6;return _0x4a3af6[_0xe6f7('0x10a')]({'raw':!![]});}})[_0xe6f7('0x38')](function(_0x258e53){if(_0x38e446){if(_0x258e53){_0x1655c7=_0x258e53;}}return require('../../config/license/util')[_0xe6f7('0x80')]();})['then'](function(_0x5cfec8){if(_0x5cfec8){_0x1e2bd4=_0x5cfec8[_0xe6f7('0x10b')];_0x1eee2a=_0x5cfec8[_0xe6f7('0x10c')];}})['then'](function(){return db[_0xe6f7('0xba')][_0xe6f7('0x30')]({'where':{'closed':![]}});})['then'](function(_0x54ea38){_0x1525af=_0x54ea38;if(_0x1e2bd4&&_0x54ea38>_0x1e2bd4){return db[_0xe6f7('0x10d')][_0xe6f7('0x6c')]({'where':{'id':0x1}})[_0xe6f7('0x38')](function(_0x3fa63d){if(_0x3fa63d){_0x3fa63d['increment'](_0xe6f7('0x10e'));}});}})[_0xe6f7('0x38')](function(){if(_0x38e446['Interval']&&_0x38e446[_0xe6f7('0x108')][_0xe6f7('0x109')]){var _0x1c8399=[];for(var _0x1e1504=0x0;_0x1e1504<_0x38e446[_0xe6f7('0x108')]['Intervals']['length'];_0x1e1504++){var _0x180213=_0x38e446['Interval'][_0xe6f7('0x109')][_0x1e1504][_0xe6f7('0x3a')]({'plain':!![]});_0x1c8399[_0xe6f7('0xc1')](iftimePromise(_0x180213,_0x38e446));}return BPromise[_0xe6f7('0x10f')](_0x1c8399)['then'](function(_0x4e709e){return _[_0xe6f7('0x110')](_0x4e709e);});}else{return!![];}})[_0xe6f7('0x38')](function(_0x13fc4d){var _0x299ee2=fs[_0xe6f7('0xd2')](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x111')),'utf8');var _0x1717fd={'remote':_0x38e446[_0xe6f7('0x112')],'query':querystring['stringify'](_[_0xe6f7('0x53')](_0x38e446['get']({'plain':!![]}),{'customerIp':_0x420396['headers'][_0xe6f7('0xab')]||_0x420396[_0xe6f7('0x8f')][_0xe6f7('0x113')]||_0x420396[_0xe6f7('0x114')]['remoteAddress']||_0x420396['ip'],'referer':_0x420396[_0xe6f7('0x8f')]['referer'],'openedInteractions':_0x1525af,'maxInteractions':_0x1e2bd4,'virtual':_0x1eee2a['virtual'],'online':_0x13fc4d,'custom':_0x1eee2a}))[_0xe6f7('0x115')](/'/g,'\x5c\x27')};_0x932205['send'](ejs[_0xe6f7('0x116')](Mustache[_0xe6f7('0x116')](_0x299ee2,_0x1717fd),{'proactiveActions':_0x1655c7,'alignment':_0x38e446[_0xe6f7('0x117')],'verticalAlignment':_0x38e446[_0xe6f7('0x118')],'div_color':_0x38e446['color'],'text_color':_0x38e446[_0xe6f7('0x119')],'button_color':_0x38e446[_0xe6f7('0x11a')],'background_color':_0x38e446[_0xe6f7('0x11b')]}));})[_0xe6f7('0x5a')](handleError(_0x932205,null));};exports[_0xe6f7('0x11c')]=function(_0x68ac4,_0x3d0ec,_0x59680f){return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x68ac4[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x3d0ec,null))[_0xe6f7('0x38')](function(_0x5db140){if(_0x5db140){return db[_0xe6f7('0xda')][_0xe6f7('0xdb')](function(_0x11d249){return db['ChatApplication'][_0xe6f7('0x39')]({'where':{'ChatWebsiteId':_0x68ac4[_0xe6f7('0x5c')]['id']},'transaction':_0x11d249})[_0xe6f7('0x38')](function(_0x3ceaeb){var _0x309bff=_[_0xe6f7('0x41')](_0x68ac4[_0xe6f7('0x5f')],function(_0x4dbbdb){_0x4dbbdb[_0xe6f7('0x69')]=_0x68ac4[_0xe6f7('0x5c')]['id'];return _0x4dbbdb;});return db[_0xe6f7('0xa1')][_0xe6f7('0xdd')](_0x309bff,{'transaction':_0x11d249});});})[_0xe6f7('0x38')](function(){return db[_0xe6f7('0xa1')][_0xe6f7('0x11d')]({'where':{'ChatWebsiteId':_0x68ac4[_0xe6f7('0x5c')]['id']},'order':_0xe6f7('0xa7')});});}})[_0xe6f7('0x38')](respondWithResult(_0x3d0ec,null))[_0xe6f7('0x5a')](handleError(_0x3d0ec,null));};exports[_0xe6f7('0x11e')]=function(_0x51312f,_0x525830,_0x4f6ea0){var _0x1dbcc8={};var _0x136de0={};var _0x3d8a6e;var _0x2a0507;return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x51312f[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x525830,null))[_0xe6f7('0x38')](function(_0x46b846){if(_0x46b846){_0x3d8a6e=_0x46b846;_0x136de0['model']=_[_0xe6f7('0x47')](db[_0xe6f7('0xa1')]['rawAttributes']);_0x136de0[_0xe6f7('0x46')]=_['keys'](_0x51312f[_0xe6f7('0x46')]);_0x136de0[_0xe6f7('0x50')]=_[_0xe6f7('0x48')](_0x136de0[_0xe6f7('0x45')],_0x136de0[_0xe6f7('0x46')]);_0x1dbcc8[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x136de0[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x51312f['query'][_0xe6f7('0x4a')]));_0x1dbcc8['attributes']=_0x1dbcc8[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x1dbcc8[_0xe6f7('0x49')]:_0x136de0['model'];_0x1dbcc8[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x1dbcc8[_0xe6f7('0x4f')]=qs[_0xe6f7('0x50')](_['pick'](_0x51312f[_0xe6f7('0x46')],_0x136de0[_0xe6f7('0x50')]));if(_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x1dbcc8[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x1dbcc8[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x1dbcc8['attributes'],function(_0x3b100e){var _0x51bf44={};_0x51bf44[_0x3b100e]={'$like':'%'+_0x51312f[_0xe6f7('0x46')]['filter']+'%'};return _0x51bf44;})});}_0x1dbcc8=_[_0xe6f7('0x53')]({},_0x1dbcc8,_0x51312f[_0xe6f7('0x54')]);return _0x3d8a6e[_0xe6f7('0x11e')](_0x1dbcc8);}})['then'](function(_0xdddf27){if(_0xdddf27){_0x2a0507=_0xdddf27[_0xe6f7('0x5d')];if(!_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x1dbcc8[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x51312f[_0xe6f7('0x46')]['limit']);_0x1dbcc8['offset']=qs['offset'](_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}return _0x3d8a6e[_0xe6f7('0x11e')](_0x1dbcc8);}})['then'](function(_0x269af8){if(_0x269af8){return _0x269af8?{'count':_0x2a0507,'rows':_0x269af8}:null;}})[_0xe6f7('0x38')](respondWithResult(_0x525830,null))[_0xe6f7('0x5a')](handleError(_0x525830,null));};exports[_0xe6f7('0x11f')]=function(_0x3e5851,_0x2004ce,_0x13f3eb){return db[_0xe6f7('0x120')][_0xe6f7('0x67')]({'where':{'id':_0x3e5851['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x2004ce,null))[_0xe6f7('0x38')](function(_0x57d09d){if(_0x57d09d){return _0x57d09d[_0xe6f7('0x11f')](_0x3e5851[_0xe6f7('0x5f')]['ids'],_['omit'](_0x3e5851[_0xe6f7('0x5f')],['ids','id'])||{});}})[_0xe6f7('0x38')](respondWithResult(_0x2004ce,null))[_0xe6f7('0x5a')](handleError(_0x2004ce,null));};exports[_0xe6f7('0x10a')]=function(_0x303104,_0x285050,_0x3e4cd8){var _0x1a3291={};var _0x5ed55c={};var _0x5766ef;var _0x31824e;return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x303104[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x285050,null))[_0xe6f7('0x38')](function(_0x277a8e){if(_0x277a8e){_0x5766ef=_0x277a8e;_0x5ed55c[_0xe6f7('0x45')]=_[_0xe6f7('0x47')](db[_0xe6f7('0x121')][_0xe6f7('0x42')]);_0x5ed55c[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x303104[_0xe6f7('0x46')]);_0x5ed55c[_0xe6f7('0x50')]=_['intersection'](_0x5ed55c['model'],_0x5ed55c['query']);_0x1a3291[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x5ed55c[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x303104[_0xe6f7('0x46')]['fields']));_0x1a3291[_0xe6f7('0x49')]=_0x1a3291[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x1a3291[_0xe6f7('0x49')]:_0x5ed55c[_0xe6f7('0x45')];_0x1a3291[_0xe6f7('0x4d')]=qs['sort'](_0x303104[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x1a3291[_0xe6f7('0x4f')]=qs['filters'](_['pick'](_0x303104[_0xe6f7('0x46')],_0x5ed55c[_0xe6f7('0x50')]));if(_0x303104['query'][_0xe6f7('0x52')]){_0x1a3291[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x1a3291[_0xe6f7('0x4f')],{'$or':_['map'](_0x1a3291['attributes'],function(_0x307901){var _0x118e6e={};_0x118e6e[_0x307901]={'$like':'%'+_0x303104['query'][_0xe6f7('0x52')]+'%'};return _0x118e6e;})});}_0x1a3291=_[_0xe6f7('0x53')]({},_0x1a3291,_0x303104[_0xe6f7('0x54')]);return _0x5766ef[_0xe6f7('0x10a')](_0x1a3291);}})['then'](function(_0x3b77e4){if(_0x3b77e4){_0x31824e=_0x3b77e4[_0xe6f7('0x5d')];if(!_0x303104[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x1a3291['limit']=qs['limit'](_0x303104['query'][_0xe6f7('0x2d')]);_0x1a3291[_0xe6f7('0x2f')]=qs[_0xe6f7('0x2f')](_0x303104[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}return _0x5766ef['getProactiveActions'](_0x1a3291);}})[_0xe6f7('0x38')](function(_0x121575){if(_0x121575){return _0x121575?{'count':_0x31824e,'rows':_0x121575}:null;}})[_0xe6f7('0x38')](respondWithResult(_0x285050,null))[_0xe6f7('0x5a')](handleError(_0x285050,null));};exports['getFields']=function(_0x580f34,_0x4e70ab,_0x24f4dd){var _0x19bd7f=_0x580f34[_0xe6f7('0x46')][_0xe6f7('0x122')]===_0xe6f7('0x123')?_0xe6f7('0x124'):'onlineForm';return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'attributes':['id',_0x19bd7f],'where':{'id':_0x580f34[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x4e70ab,null))[_0xe6f7('0x38')](function(_0x31aea8){if(_0x31aea8){var _0xd8cfe1=_0x31aea8[_0x19bd7f];var _0x96fc5e=_0xd8cfe1&&_0xd8cfe1[_0xe6f7('0x125')]?_0xd8cfe1[_0xe6f7('0x125')]:[];_0x4e70ab[_0xe6f7('0x3f')]({'fromKey':_['isNil'](_0xd8cfe1[_0xe6f7('0x126')])?undefined:_0xd8cfe1['fromKey'],'count':_0x96fc5e['length'],'rows':_0x96fc5e});}})[_0xe6f7('0x5a')](handleError(_0x4e70ab,null));};exports[_0xe6f7('0x127')]=function(_0x201184,_0x3516c3,_0x58b4f5){var _0x132a2b={'raw':![],'where':{}};var _0x27c75d={};var _0x3a8792={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')]['findOne']({'where':{'id':_0x201184['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x3516c3,null))[_0xe6f7('0x38')](function(_0x431d4f){if(_0x431d4f){_0x27c75d[_0xe6f7('0x45')]=_['keys'](db[_0xe6f7('0xd6')]['rawAttributes']);_0x27c75d['query']=_[_0xe6f7('0x47')](_0x201184[_0xe6f7('0x46')]);_0x27c75d[_0xe6f7('0x50')]=_[_0xe6f7('0x48')](_0x27c75d[_0xe6f7('0x45')],_0x27c75d[_0xe6f7('0x46')]);_0x132a2b[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x27c75d[_0xe6f7('0x45')],qs['fields'](_0x201184[_0xe6f7('0x46')]['fields']));_0x132a2b[_0xe6f7('0x49')]=_0x132a2b['attributes'][_0xe6f7('0x5d')]?_0x132a2b['attributes']:_0x27c75d[_0xe6f7('0x45')];if(!_0x201184[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x132a2b['limit']=qs[_0xe6f7('0x2d')](_0x201184[_0xe6f7('0x46')]['limit']);_0x132a2b['offset']=qs[_0xe6f7('0x2f')](_0x201184[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}_0x132a2b[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x201184['query'][_0xe6f7('0x4e')]);_0x132a2b['where']=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x201184[_0xe6f7('0x46')],_0x27c75d[_0xe6f7('0x50')]));_0x132a2b[_0xe6f7('0x4f')]['ChatWebsiteId']=_0x431d4f['id'];if(_0x201184['query'][_0xe6f7('0x52')]){_0x132a2b[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x132a2b[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x132a2b[_0xe6f7('0x49')],function(_0x1df4ab){var _0xb17d04={};_0xb17d04[_0x1df4ab]={'$like':'%'+_0x201184['query'][_0xe6f7('0x52')]+'%'};return _0xb17d04;})});}_0x132a2b=_['merge']({},_0x132a2b,_0x201184[_0xe6f7('0x54')]);return db[_0xe6f7('0xd6')]['count']({'where':_0x132a2b[_0xe6f7('0x4f')]})['then'](function(_0x28f3c4){_0x3a8792[_0xe6f7('0x30')]=_0x28f3c4;if(_0x201184[_0xe6f7('0x46')]['includeAll']){_0x132a2b[_0xe6f7('0x57')]=[{'all':!![]}];}else{_0x132a2b[_0xe6f7('0x57')]=[{'model':db[_0xe6f7('0x91')],'as':_0xe6f7('0xf5'),'required':![]},{'model':db[_0xe6f7('0xdc')],'as':_0xe6f7('0x128'),'required':![]}];}return db['ChatOfflineMessage'][_0xe6f7('0x58')](_0x132a2b);})[_0xe6f7('0x38')](function(_0x279ac9){_0x3a8792[_0xe6f7('0x59')]=_0x279ac9;return _0x3a8792;});}})[_0xe6f7('0x38')](respondWithFilteredResult(_0x3516c3,_0x132a2b))[_0xe6f7('0x5a')](handleError(_0x3516c3,null));};exports[_0xe6f7('0x129')]=function(_0x345aef,_0x5070e0,_0x4fa9fa){return db['ChatWebsite']['find']({'where':{'id':_0x345aef[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x5070e0,null))[_0xe6f7('0x38')](function(_0x11d66f){if(_0x11d66f){return _0x11d66f[_0xe6f7('0x129')](_0x345aef[_0xe6f7('0x5f')][_0xe6f7('0x6e')],_['omit'](_0x345aef[_0xe6f7('0x5f')],['ids','id'])||{})[_0xe6f7('0xbc')](function(_0x250fde){for(var _0x1ca91e=0x0;_0x1ca91e<_0x345aef[_0xe6f7('0x5f')][_0xe6f7('0x6e')][_0xe6f7('0x5d')];_0x1ca91e+=0x1){socket[_0xe6f7('0x12a')]('userChatWebsite:save',{'UserId':_0x345aef['body'][_0xe6f7('0x6e')][_0x1ca91e],'ChatWebsiteId':_0x345aef['params']['id']});}return _0x250fde;});}})['then'](respondWithResult(_0x5070e0,null))[_0xe6f7('0x5a')](handleError(_0x5070e0,null));};exports[_0xe6f7('0x12b')]=function(_0x3f0157,_0x3012a6,_0x2a83e9){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x3f0157[_0xe6f7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3012a6,null))[_0xe6f7('0x38')](function(_0x71f40d){if(_0x71f40d){return _0x71f40d[_0xe6f7('0x12b')](_0x3f0157[_0xe6f7('0x46')][_0xe6f7('0x6e')])['then'](function(){if(_[_0xe6f7('0x12c')](_0x3f0157[_0xe6f7('0x46')][_0xe6f7('0x6e')])){for(var _0x49420f=0x0;_0x49420f<_0x3f0157[_0xe6f7('0x46')]['ids']['length'];_0x49420f+=0x1){socket[_0xe6f7('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x3f0157[_0xe6f7('0x46')]['ids'][_0x49420f]),'ChatWebsiteId':Number(_0x3f0157[_0xe6f7('0x5c')]['id'])});}}else{socket[_0xe6f7('0x12a')](_0xe6f7('0x12d'),{'UserId':Number(_0x3f0157[_0xe6f7('0x46')][_0xe6f7('0x6e')]),'ChatWebsiteId':Number(_0x3f0157[_0xe6f7('0x5c')]['id'])});}});}})[_0xe6f7('0x38')](respondWithStatusCode(_0x3012a6,null))[_0xe6f7('0x5a')](handleError(_0x3012a6,null));};exports[_0xe6f7('0x12e')]=function(_0x5b4600,_0x266d1e,_0x1cc798){var _0x3e80a9={};var _0x21dbdd={};var _0x21f030;var _0x37cf01;return db['ChatWebsite'][_0xe6f7('0x6c')]({'where':{'id':_0x5b4600['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x266d1e,null))[_0xe6f7('0x38')](function(_0x1dd144){if(_0x1dd144){_0x21f030=_0x1dd144;_0x21dbdd[_0xe6f7('0x45')]=_[_0xe6f7('0x47')](db['User'][_0xe6f7('0x42')]);_0x21dbdd[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x5b4600[_0xe6f7('0x46')]);_0x21dbdd['filters']=_[_0xe6f7('0x48')](_0x21dbdd[_0xe6f7('0x45')],_0x21dbdd[_0xe6f7('0x46')]);_0x3e80a9[_0xe6f7('0x49')]=_['intersection'](_0x21dbdd[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x5b4600['query'][_0xe6f7('0x4a')]));_0x3e80a9[_0xe6f7('0x49')]=_0x3e80a9[_0xe6f7('0x49')]['length']?_0x3e80a9['attributes']:_0x21dbdd[_0xe6f7('0x45')];_0x3e80a9[_0xe6f7('0x4d')]=qs['sort'](_0x5b4600['query']['sort']);_0x3e80a9['where']=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x5b4600[_0xe6f7('0x46')],_0x21dbdd[_0xe6f7('0x50')]));if(_0x5b4600[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x3e80a9[_0xe6f7('0x4f')]=_['merge'](_0x3e80a9[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x3e80a9[_0xe6f7('0x49')],function(_0x527c4f){var _0x8daca3={};_0x8daca3[_0x527c4f]={'$like':'%'+_0x5b4600['query'][_0xe6f7('0x52')]+'%'};return _0x8daca3;})});}_0x3e80a9=_[_0xe6f7('0x53')]({},_0x3e80a9,_0x5b4600[_0xe6f7('0x54')]);return _0x21f030[_0xe6f7('0x12e')](_0x3e80a9);}})[_0xe6f7('0x38')](function(_0x38ca61){if(_0x38ca61){_0x37cf01=_0x38ca61[_0xe6f7('0x5d')];if(!_0x5b4600[_0xe6f7('0x46')][_0xe6f7('0x4b')](_0xe6f7('0x4c'))){_0x3e80a9[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x5b4600[_0xe6f7('0x46')]['limit']);_0x3e80a9[_0xe6f7('0x2f')]=qs[_0xe6f7('0x2f')](_0x5b4600['query'][_0xe6f7('0x2f')]);}return _0x21f030['getAgents'](_0x3e80a9);}})[_0xe6f7('0x38')](function(_0x2ca6ec){if(_0x2ca6ec){return _0x2ca6ec?{'count':_0x37cf01,'rows':_0x2ca6ec}:null;}})['then'](respondWithResult(_0x266d1e,null))[_0xe6f7('0x5a')](handleError(_0x266d1e,null));}; \ No newline at end of file +var _0xcce0=['Applications','applications','orderBy','asc','account','defaults','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','server','files','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','License','chatLicenseExceeded','Intervals','all','some','stringify','x-real-ip','connection','remoteAddress','virtual','replace','verticalAlignment','color','textColor','color_button','backgroundColor','addApplications','sequelize','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','end','status','json','offset','undefined','count','set','Content-Range','reject','update','destroy','ChatWebsites','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','Pause','keys','create','body','user','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','getLogo','join','root','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC'];(function(_0x48969c,_0x490d95){var _0x351383=function(_0x1dcad1){while(--_0x1dcad1){_0x48969c['push'](_0x48969c['shift']());}};_0x351383(++_0x490d95);}(_0xcce0,0x92));var _0x0cce=function(_0x1795af,_0x777e3){_0x1795af=_0x1795af-0x0;var _0x1f09b6=_0xcce0[_0x1795af];return _0x1f09b6;};'use strict';var emlformat=require(_0x0cce('0x0'));var rimraf=require(_0x0cce('0x1'));var zipdir=require(_0x0cce('0x2'));var jsonpatch=require(_0x0cce('0x3'));var rp=require(_0x0cce('0x4'));var moment=require(_0x0cce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0cce('0x6'));var util=require(_0x0cce('0x7'));var path=require(_0x0cce('0x8'));var sox=require(_0x0cce('0x9'));var csv=require(_0x0cce('0xa'));var ejs=require(_0x0cce('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0cce('0xc'));var crypto=require(_0x0cce('0xd'));var jsforce=require(_0x0cce('0xe'));var deskjs=require(_0x0cce('0xf'));var toCsv=require(_0x0cce('0xa'));var querystring=require(_0x0cce('0x10'));var Papa=require(_0x0cce('0x11'));var Redis=require(_0x0cce('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0cce('0x13'));var as=require(_0x0cce('0x14'));var hardwareService=require(_0x0cce('0x15'));var logger=require(_0x0cce('0x16'))(_0x0cce('0x17'));var utils=require(_0x0cce('0x18'));var config=require(_0x0cce('0x19'));var licenseUtil=require(_0x0cce('0x1a'));var db=require(_0x0cce('0x1b'))['db'];config[_0x0cce('0x1c')]=_['defaults'](config[_0x0cce('0x1c')],{'host':_0x0cce('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0cce('0x1c')]));require(_0x0cce('0x1e'))[_0x0cce('0x1f')](socket);var jayson=require(_0x0cce('0x20'));var client=jayson[_0x0cce('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x0cce('0x21')][_0x0cce('0x22')]({'port':0x232a});var client9003=jayson['client'][_0x0cce('0x22')]({'port':0x232b});var client9001=jayson[_0x0cce('0x21')][_0x0cce('0x22')]({'port':0x2329});function respondWithRpcPromise(_0x2bf3ab,_0x5ae31a,_0x185661,_0x36d605){return new BPromise(function(_0xe14d49,_0x2829d6){var _0x164a41=_0x36d605||client;return _0x164a41[_0x0cce('0x23')](_0x2bf3ab,_0x185661)[_0x0cce('0x24')](function(_0x27b23f){logger[_0x0cce('0x25')](_0x0cce('0x26'),_0x5ae31a,_0x0cce('0x27'));logger[_0x0cce('0x28')](_0x0cce('0x29'),_0x5ae31a,_0x0cce('0x27'),JSON['stringify'](_0x27b23f));if(_0x27b23f[_0x0cce('0x2a')]){if(_0x27b23f[_0x0cce('0x2a')][_0x0cce('0x2b')]===0x1f4){logger['error'](_0x0cce('0x26'),_0x5ae31a,_0x27b23f['error'][_0x0cce('0x2c')]);return _0x2829d6(_0x27b23f['error']['message']);}logger[_0x0cce('0x2a')](_0x0cce('0x26'),_0x5ae31a,_0x27b23f[_0x0cce('0x2a')]['message']);return _0xe14d49(_0x27b23f[_0x0cce('0x2a')]['message']);}else{logger[_0x0cce('0x25')](_0x0cce('0x26'),_0x5ae31a,_0x0cce('0x27'));_0xe14d49(_0x27b23f[_0x0cce('0x2d')]['message']);}})['catch'](function(_0x155718){logger[_0x0cce('0x2a')](_0x0cce('0x26'),_0x5ae31a,_0x155718);_0x2829d6(_0x155718);});});}function respondWithStatusCode(_0x4ea608,_0x2c1a6a){_0x2c1a6a=_0x2c1a6a||0xcc;return function(_0x35858c){if(_0x35858c){return _0x4ea608['sendStatus'](_0x2c1a6a);}return _0x4ea608['status'](_0x2c1a6a)[_0x0cce('0x2e')]();};}function respondWithResult(_0x3d75a4,_0x59509f){_0x59509f=_0x59509f||0xc8;return function(_0x31e4b2){if(_0x31e4b2){return _0x3d75a4[_0x0cce('0x2f')](_0x59509f)[_0x0cce('0x30')](_0x31e4b2);}};}function respondWithFilteredResult(_0x3be262,_0x196e6f){return function(_0x3ac4e2){if(_0x3ac4e2){var _0x5057ae=typeof _0x196e6f[_0x0cce('0x31')]===_0x0cce('0x32')&&typeof _0x196e6f['limit']===_0x0cce('0x32');var _0x381b70=_0x3ac4e2[_0x0cce('0x33')];var _0x578b54=_0x5057ae?0x0:_0x196e6f[_0x0cce('0x31')];var _0x31cb94=_0x5057ae?_0x3ac4e2[_0x0cce('0x33')]:_0x196e6f['offset']+_0x196e6f['limit'];var _0x515fdf;if(_0x31cb94>=_0x381b70){_0x31cb94=_0x381b70;_0x515fdf=0xc8;}else{_0x515fdf=0xce;}_0x3be262[_0x0cce('0x2f')](_0x515fdf);return _0x3be262[_0x0cce('0x34')](_0x0cce('0x35'),_0x578b54+'-'+_0x31cb94+'/'+_0x381b70)['json'](_0x3ac4e2);}return null;};}function patchUpdates(_0x350452){return function(_0x65e947){try{jsonpatch['apply'](_0x65e947,_0x350452,!![]);}catch(_0x1d466a){return BPromise[_0x0cce('0x36')](_0x1d466a);}return _0x65e947['save']();};}function saveUpdates(_0x3b45c9,_0x5049fc){return function(_0x5e6fbf){if(_0x5e6fbf){return _0x5e6fbf[_0x0cce('0x37')](_0x3b45c9)['then'](function(_0xde198){return _0xde198;});}return null;};}function removeEntity(_0x561a78,_0x12dc28){return function(_0xf82262){if(_0xf82262){return _0xf82262[_0x0cce('0x38')]()[_0x0cce('0x24')](function(){var _0x18da7e=_0xf82262['get']({'plain':!![]});var _0x45da02=_0x0cce('0x39');return db[_0x0cce('0x3a')][_0x0cce('0x38')]({'where':{'type':_0x45da02,'resourceId':_0x18da7e['id']}})[_0x0cce('0x24')](function(){return _0xf82262;});})[_0x0cce('0x24')](function(){_0x561a78[_0x0cce('0x2f')](0xcc)[_0x0cce('0x2e')]();});}};}function handleEntityNotFound(_0x91e045,_0x212923){return function(_0x171aae){if(!_0x171aae){_0x91e045[_0x0cce('0x3b')](0x194);}return _0x171aae;};}function handleError(_0x57d9e3,_0x20d5f8){_0x20d5f8=_0x20d5f8||0x1f4;return function(_0x2e9e49){logger[_0x0cce('0x2a')](_0x2e9e49['stack']);if(_0x2e9e49[_0x0cce('0x3c')]){delete _0x2e9e49[_0x0cce('0x3c')];}_0x57d9e3[_0x0cce('0x2f')](_0x20d5f8)[_0x0cce('0x3d')](_0x2e9e49);};}exports[_0x0cce('0x3e')]=function(_0x256c59,_0x3709fd){var _0x22723f={'include':[{'model':db['Pause'],'as':_0x0cce('0x3f')}]},_0x203d17={},_0x505eeb={'count':0x0,'rows':[]};var _0x1294f2=_[_0x0cce('0x40')](db[_0x0cce('0x41')][_0x0cce('0x42')],function(_0x3ce87f){return{'name':_0x3ce87f['fieldName'],'type':_0x3ce87f[_0x0cce('0x43')]['key']};});_0x203d17[_0x0cce('0x44')]=_[_0x0cce('0x40')](_0x1294f2,'name');_0x203d17[_0x0cce('0x45')]=_['keys'](_0x256c59[_0x0cce('0x45')]);_0x203d17[_0x0cce('0x46')]=_[_0x0cce('0x47')](_0x203d17[_0x0cce('0x44')],_0x203d17[_0x0cce('0x45')]);_0x22723f[_0x0cce('0x48')]=_[_0x0cce('0x47')](_0x203d17[_0x0cce('0x44')],qs[_0x0cce('0x49')](_0x256c59[_0x0cce('0x45')][_0x0cce('0x49')]));_0x22723f[_0x0cce('0x48')]=_0x22723f[_0x0cce('0x48')][_0x0cce('0x4a')]?_0x22723f[_0x0cce('0x48')]:_0x203d17['model'];if(!_0x256c59['query'][_0x0cce('0x4b')](_0x0cce('0x4c'))){_0x22723f['limit']=qs[_0x0cce('0x4d')](_0x256c59[_0x0cce('0x45')]['limit']);_0x22723f[_0x0cce('0x31')]=qs[_0x0cce('0x31')](_0x256c59['query'][_0x0cce('0x31')]);}_0x22723f[_0x0cce('0x4e')]=qs[_0x0cce('0x4f')](_0x256c59[_0x0cce('0x45')]['sort']);_0x22723f[_0x0cce('0x50')]=qs[_0x0cce('0x46')](_[_0x0cce('0x51')](_0x256c59['query'],_0x203d17[_0x0cce('0x46')]),_0x1294f2);if(_0x256c59[_0x0cce('0x45')][_0x0cce('0x52')]){_0x22723f[_0x0cce('0x50')]=_['merge'](_0x22723f[_0x0cce('0x50')],{'$or':_[_0x0cce('0x40')](_0x1294f2,function(_0xcdc36){if(_0xcdc36['type']!==_0x0cce('0x53')){var _0x34ba2b={};_0x34ba2b[_0xcdc36['name']]={'$like':'%'+_0x256c59['query'][_0x0cce('0x52')]+'%'};return _0x34ba2b;}})});}_0x22723f=_[_0x0cce('0x54')]({},_0x22723f,_0x256c59[_0x0cce('0x55')]);var _0x410039={'where':_0x22723f[_0x0cce('0x50')]};return db['ChatWebsite'][_0x0cce('0x33')](_0x410039)[_0x0cce('0x24')](function(_0x4157f6){_0x505eeb[_0x0cce('0x33')]=_0x4157f6;if(_0x256c59[_0x0cce('0x45')][_0x0cce('0x56')]){_0x22723f[_0x0cce('0x57')]=[{'all':!![]}];}return db[_0x0cce('0x41')][_0x0cce('0x58')](_0x22723f);})[_0x0cce('0x24')](function(_0x571673){_0x505eeb[_0x0cce('0x59')]=_0x571673;return _0x505eeb;})[_0x0cce('0x24')](respondWithFilteredResult(_0x3709fd,_0x22723f))[_0x0cce('0x5a')](handleError(_0x3709fd,null));};exports[_0x0cce('0x5b')]=function(_0x5743fb,_0x61e21b){var _0x104004={'raw':![],'where':{'id':_0x5743fb[_0x0cce('0x5c')]['id']},'include':[{'model':db[_0x0cce('0x5d')],'as':_0x0cce('0x3f')}]},_0x1bd054={};_0x1bd054[_0x0cce('0x44')]=_['keys'](db[_0x0cce('0x41')][_0x0cce('0x42')]);_0x1bd054[_0x0cce('0x45')]=_[_0x0cce('0x5e')](_0x5743fb[_0x0cce('0x45')]);_0x1bd054[_0x0cce('0x46')]=_[_0x0cce('0x47')](_0x1bd054[_0x0cce('0x44')],_0x1bd054[_0x0cce('0x45')]);_0x104004['attributes']=_[_0x0cce('0x47')](_0x1bd054[_0x0cce('0x44')],qs[_0x0cce('0x49')](_0x5743fb['query']['fields']));_0x104004[_0x0cce('0x48')]=_0x104004['attributes']['length']?_0x104004[_0x0cce('0x48')]:_0x1bd054['model'];if(_0x5743fb[_0x0cce('0x45')]['includeAll']){_0x104004[_0x0cce('0x57')]=[{'all':!![]}];}_0x104004=_[_0x0cce('0x54')]({},_0x104004,_0x5743fb[_0x0cce('0x55')]);return db[_0x0cce('0x41')]['find'](_0x104004)[_0x0cce('0x24')](handleEntityNotFound(_0x61e21b,null))['then'](respondWithResult(_0x61e21b,null))[_0x0cce('0x5a')](handleError(_0x61e21b,null));};exports[_0x0cce('0x5f')]=function(_0x1c148c,_0x2d6691){return db[_0x0cce('0x41')][_0x0cce('0x5f')](_0x1c148c[_0x0cce('0x60')],{})[_0x0cce('0x24')](function(_0x3cc5a3){var _0xa47724=_0x1c148c[_0x0cce('0x61')][_0x0cce('0x62')]({'plain':!![]});if(!_0xa47724)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa47724['role']==='user'){var _0xb9cfbd=_0x3cc5a3[_0x0cce('0x62')]({'plain':!![]});var _0x21097f='ChatWebsites';return db[_0x0cce('0x63')][_0x0cce('0x64')]({'where':{'name':_0x21097f,'userProfileId':_0xa47724['userProfileId']},'raw':!![]})[_0x0cce('0x24')](function(_0x3ec46f){if(_0x3ec46f&&_0x3ec46f[_0x0cce('0x65')]===0x0){return db[_0x0cce('0x3a')][_0x0cce('0x5f')]({'name':_0xb9cfbd[_0x0cce('0x3c')],'resourceId':_0xb9cfbd['id'],'type':_0x3ec46f[_0x0cce('0x3c')],'sectionId':_0x3ec46f['id']},{})[_0x0cce('0x24')](function(){return _0x3cc5a3;});}else{return _0x3cc5a3;}})[_0x0cce('0x5a')](function(_0x2018de){logger['error'](_0x0cce('0x66'),_0x2018de);throw _0x2018de;});}return _0x3cc5a3;})[_0x0cce('0x24')](respondWithResult(_0x2d6691,0xc9))[_0x0cce('0x5a')](handleError(_0x2d6691,null));};exports[_0x0cce('0x37')]=function(_0x3f07e8,_0x3fd8bc){if(_0x3f07e8[_0x0cce('0x60')]['id']){delete _0x3f07e8[_0x0cce('0x60')]['id'];}return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x3f07e8[_0x0cce('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x0cce('0x24')](handleEntityNotFound(_0x3fd8bc,null))[_0x0cce('0x24')](saveUpdates(_0x3f07e8[_0x0cce('0x60')],null))[_0x0cce('0x24')](respondWithResult(_0x3fd8bc,null))['catch'](handleError(_0x3fd8bc,null));};exports[_0x0cce('0x38')]=function(_0xf0ed3a,_0x5b23d8){return db['ChatWebsite'][_0x0cce('0x64')]({'where':{'id':_0xf0ed3a[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x5b23d8,null))[_0x0cce('0x24')](removeEntity(_0x5b23d8,null))[_0x0cce('0x5a')](handleError(_0x5b23d8,null));};exports['describe']=function(_0x33df16,_0x524047){return db[_0x0cce('0x41')][_0x0cce('0x67')]()[_0x0cce('0x24')](respondWithResult(_0x524047,null))[_0x0cce('0x5a')](handleError(_0x524047,null));};exports[_0x0cce('0x68')]=function(_0x435bb9,_0x51658a,_0xa3a4e){if(_0x435bb9[_0x0cce('0x60')]['id']){delete _0x435bb9[_0x0cce('0x60')]['id'];}return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x435bb9[_0x0cce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x51658a,null))[_0x0cce('0x24')](function(_0x382126){if(_0x382126){_0x435bb9[_0x0cce('0x60')][_0x0cce('0x69')]=_0x382126['id'];return db['Disposition']['create'](_0x435bb9['body']);}})[_0x0cce('0x24')](respondWithResult(_0x51658a,null))[_0x0cce('0x5a')](handleError(_0x51658a,null));};exports[_0x0cce('0x6a')]=function(_0x4ceac2,_0x983b51,_0x48e4a3){var _0x4ad094={'raw':![],'where':{}};var _0x4490df={};var _0xa44986={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0cce('0x6b')]({'where':{'id':_0x4ceac2[_0x0cce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x983b51,null))[_0x0cce('0x24')](function(_0x8c3ed){if(_0x8c3ed){_0x4490df[_0x0cce('0x44')]=_['keys'](db['Disposition'][_0x0cce('0x42')]);_0x4490df[_0x0cce('0x45')]=_[_0x0cce('0x5e')](_0x4ceac2[_0x0cce('0x45')]);_0x4490df['filters']=_[_0x0cce('0x47')](_0x4490df[_0x0cce('0x44')],_0x4490df['query']);_0x4ad094['attributes']=_[_0x0cce('0x47')](_0x4490df[_0x0cce('0x44')],qs[_0x0cce('0x49')](_0x4ceac2[_0x0cce('0x45')]['fields']));_0x4ad094['attributes']=_0x4ad094['attributes']['length']?_0x4ad094[_0x0cce('0x48')]:_0x4490df[_0x0cce('0x44')];if(!_0x4ceac2[_0x0cce('0x45')][_0x0cce('0x4b')](_0x0cce('0x4c'))){_0x4ad094[_0x0cce('0x4d')]=qs[_0x0cce('0x4d')](_0x4ceac2['query']['limit']);_0x4ad094[_0x0cce('0x31')]=qs[_0x0cce('0x31')](_0x4ceac2[_0x0cce('0x45')]['offset']);}_0x4ad094[_0x0cce('0x4e')]=qs[_0x0cce('0x4f')](_0x4ceac2[_0x0cce('0x45')][_0x0cce('0x4f')]);_0x4ad094[_0x0cce('0x50')]=qs[_0x0cce('0x46')](_['pick'](_0x4ceac2[_0x0cce('0x45')],_0x4490df[_0x0cce('0x46')]));_0x4ad094[_0x0cce('0x50')][_0x0cce('0x69')]=_0x8c3ed['id'];if(_0x4ceac2[_0x0cce('0x45')][_0x0cce('0x52')]){_0x4ad094['where']=_['merge'](_0x4ad094[_0x0cce('0x50')],{'$or':_['map'](_0x4ad094[_0x0cce('0x48')],function(_0x9e9668){var _0x2bab63={};_0x2bab63[_0x9e9668]={'$like':'%'+_0x4ceac2['query']['filter']+'%'};return _0x2bab63;})});}_0x4ad094=_['merge']({},_0x4ad094,_0x4ceac2['options']);return db['Disposition']['count']({'where':_0x4ad094[_0x0cce('0x50')]})['then'](function(_0x186719){_0xa44986[_0x0cce('0x33')]=_0x186719;if(_0x4ceac2['query'][_0x0cce('0x56')]){_0x4ad094['include']=[{'all':!![]}];}return db[_0x0cce('0x6c')]['findAll'](_0x4ad094);})[_0x0cce('0x24')](function(_0x4068e1){_0xa44986[_0x0cce('0x59')]=_0x4068e1;return _0xa44986;});}})[_0x0cce('0x24')](respondWithFilteredResult(_0x983b51,_0x4ad094))[_0x0cce('0x5a')](handleError(_0x983b51,null));};exports[_0x0cce('0x6d')]=function(_0x3d833c,_0x59bf16,_0x3566c7){return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x3d833c['params']['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x59bf16,null))[_0x0cce('0x24')](function(_0x1b4370){if(_0x1b4370){return _0x1b4370['removeDispositions'](_0x3d833c[_0x0cce('0x45')][_0x0cce('0x6e')]);}})[_0x0cce('0x24')](respondWithStatusCode(_0x59bf16,null))['catch'](handleError(_0x59bf16,null));};exports['addAnswer']=function(_0xa9a8cc,_0x29ceab,_0x10620e){if(_0xa9a8cc[_0x0cce('0x60')]['id']){delete _0xa9a8cc['body']['id'];}return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0xa9a8cc[_0x0cce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x29ceab,null))['then'](function(_0x23cceb){if(_0x23cceb){_0xa9a8cc[_0x0cce('0x60')][_0x0cce('0x69')]=_0x23cceb['id'];return db[_0x0cce('0x6f')][_0x0cce('0x5f')](_0xa9a8cc['body']);}})['then'](respondWithResult(_0x29ceab,null))[_0x0cce('0x5a')](handleError(_0x29ceab,null));};exports[_0x0cce('0x70')]=function(_0x3b02b9,_0x2d6035,_0x3b90b0){var _0x196fbb={'raw':![],'where':{}};var _0x3b9e20={};var _0x441f88={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3b02b9['params']['id']}})['then'](handleEntityNotFound(_0x2d6035,null))[_0x0cce('0x24')](function(_0x466d6c){if(_0x466d6c){_0x3b9e20['model']=_[_0x0cce('0x5e')](db[_0x0cce('0x6f')][_0x0cce('0x42')]);_0x3b9e20[_0x0cce('0x45')]=_[_0x0cce('0x5e')](_0x3b02b9[_0x0cce('0x45')]);_0x3b9e20[_0x0cce('0x46')]=_[_0x0cce('0x47')](_0x3b9e20[_0x0cce('0x44')],_0x3b9e20['query']);_0x196fbb[_0x0cce('0x48')]=_['intersection'](_0x3b9e20[_0x0cce('0x44')],qs[_0x0cce('0x49')](_0x3b02b9[_0x0cce('0x45')][_0x0cce('0x49')]));_0x196fbb['attributes']=_0x196fbb['attributes'][_0x0cce('0x4a')]?_0x196fbb[_0x0cce('0x48')]:_0x3b9e20[_0x0cce('0x44')];if(!_0x3b02b9[_0x0cce('0x45')][_0x0cce('0x4b')](_0x0cce('0x4c'))){_0x196fbb[_0x0cce('0x4d')]=qs['limit'](_0x3b02b9[_0x0cce('0x45')][_0x0cce('0x4d')]);_0x196fbb[_0x0cce('0x31')]=qs[_0x0cce('0x31')](_0x3b02b9[_0x0cce('0x45')][_0x0cce('0x31')]);}_0x196fbb[_0x0cce('0x4e')]=qs[_0x0cce('0x4f')](_0x3b02b9[_0x0cce('0x45')][_0x0cce('0x4f')]);_0x196fbb[_0x0cce('0x50')]=qs[_0x0cce('0x46')](_['pick'](_0x3b02b9['query'],_0x3b9e20[_0x0cce('0x46')]));_0x196fbb[_0x0cce('0x50')][_0x0cce('0x69')]=_0x466d6c['id'];if(_0x3b02b9[_0x0cce('0x45')][_0x0cce('0x52')]){_0x196fbb[_0x0cce('0x50')]=_[_0x0cce('0x54')](_0x196fbb[_0x0cce('0x50')],{'$or':_[_0x0cce('0x40')](_0x196fbb[_0x0cce('0x48')],function(_0x561235){var _0xee168f={};_0xee168f[_0x561235]={'$like':'%'+_0x3b02b9[_0x0cce('0x45')][_0x0cce('0x52')]+'%'};return _0xee168f;})});}_0x196fbb=_[_0x0cce('0x54')]({},_0x196fbb,_0x3b02b9['options']);return db[_0x0cce('0x6f')][_0x0cce('0x33')]({'where':_0x196fbb[_0x0cce('0x50')]})[_0x0cce('0x24')](function(_0x258ef6){_0x441f88['count']=_0x258ef6;if(_0x3b02b9['query']['includeAll']){_0x196fbb[_0x0cce('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0cce('0x58')](_0x196fbb);})[_0x0cce('0x24')](function(_0x2ecdb7){_0x441f88[_0x0cce('0x59')]=_0x2ecdb7;return _0x441f88;});}})[_0x0cce('0x24')](respondWithFilteredResult(_0x2d6035,_0x196fbb))[_0x0cce('0x5a')](handleError(_0x2d6035,null));};exports['removeAnswers']=function(_0x1da014,_0x27e036,_0x231f38){return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x1da014['params']['id']}})['then'](handleEntityNotFound(_0x27e036,null))[_0x0cce('0x24')](function(_0x47353a){if(_0x47353a){return _0x47353a[_0x0cce('0x71')](_0x1da014[_0x0cce('0x45')][_0x0cce('0x6e')]);}})[_0x0cce('0x24')](respondWithStatusCode(_0x27e036,null))['catch'](handleError(_0x27e036,null));};exports[_0x0cce('0x72')]=function(_0x4297de,_0x5f5ac6,_0x4b6c10){_0x4297de[_0x0cce('0x60')][_0x0cce('0x73')]=_0x4297de[_0x0cce('0x74')][_0x0cce('0x75')];return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x4297de[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x5f5ac6,null))['then'](saveUpdates(_0x4297de[_0x0cce('0x60')],null))[_0x0cce('0x24')](respondWithResult(_0x5f5ac6,null))['catch'](handleError(_0x5f5ac6,null));};exports[_0x0cce('0x76')]=function(_0x411cf5,_0xc25879,_0x1c58af){_0x411cf5[_0x0cce('0x60')][_0x0cce('0x77')]=_0x411cf5[_0x0cce('0x74')][_0x0cce('0x75')];return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x411cf5[_0x0cce('0x5c')]['id']}})['then'](handleEntityNotFound(_0xc25879,null))[_0x0cce('0x24')](saveUpdates(_0x411cf5[_0x0cce('0x60')],null))[_0x0cce('0x24')](respondWithResult(_0xc25879,null))['catch'](handleError(_0xc25879,null));};exports[_0x0cce('0x78')]=function(_0x274a00,_0x5a6f4b,_0x5c44c9){_0x274a00[_0x0cce('0x60')]['customerAvatar']=_0x274a00[_0x0cce('0x74')][_0x0cce('0x75')];return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x274a00[_0x0cce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5a6f4b,null))[_0x0cce('0x24')](saveUpdates(_0x274a00[_0x0cce('0x60')],null))[_0x0cce('0x24')](respondWithResult(_0x5a6f4b,null))[_0x0cce('0x5a')](handleError(_0x5a6f4b,null));};exports['addSystemAvatar']=function(_0x5c30f7,_0x5d102c,_0x5b9e25){_0x5c30f7[_0x0cce('0x60')]['systemAvatar']=_0x5c30f7[_0x0cce('0x74')][_0x0cce('0x75')];return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x5c30f7[_0x0cce('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5d102c,null))[_0x0cce('0x24')](saveUpdates(_0x5c30f7[_0x0cce('0x60')],null))[_0x0cce('0x24')](respondWithResult(_0x5d102c,null))[_0x0cce('0x5a')](handleError(_0x5d102c,null));};exports[_0x0cce('0x79')]=function(_0x5b8cc7,_0x3ea70f,_0x3d2f39){var _0x2d85e1=path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],'server/files/images/logos/default_logo.svg');var _0x3c22c4={'where':{'id':_0x5b8cc7[_0x0cce('0x5c')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1ba872=![];return require(_0x0cce('0x1a'))[_0x0cce('0x7c')]()[_0x0cce('0x24')](function(_0x4245ca){if(_0x4245ca){_0x1ba872=_0x4245ca[_0x0cce('0x7d')];}})[_0x0cce('0x24')](function(){return db['ChatWebsite'][_0x0cce('0x64')](_0x3c22c4);})[_0x0cce('0x24')](handleEntityNotFound(_0x3ea70f,null))[_0x0cce('0x24')](function(_0x2ebc09){if(_0x2ebc09){if(!_[_0x0cce('0x7e')](_0x2ebc09['sitepic'])){if(fs[_0x0cce('0x7f')](path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],_0x0cce('0x80'),_0x2ebc09[_0x0cce('0x73')]))&&_0x1ba872){_0x2d85e1=path[_0x0cce('0x7a')](config['root'],'server/files/images/logos/',_0x2ebc09[_0x0cce('0x73')]);}}return _0x3ea70f[_0x0cce('0x81')](_0x2d85e1);}})['catch'](handleError(_0x3ea70f,null));};exports[_0x0cce('0x82')]=function(_0x397c42,_0x4381c0,_0x18e095){var _0x1c3955=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x34e137={'where':{'id':_0x397c42[_0x0cce('0x5c')]['id']},'attributes':['id',_0x0cce('0x77')],'raw':!![]};return db['ChatWebsite'][_0x0cce('0x64')](_0x34e137)['then'](handleEntityNotFound(_0x4381c0,null))[_0x0cce('0x24')](function(_0x3f3348){if(_0x3f3348){if(!_[_0x0cce('0x7e')](_0x3f3348[_0x0cce('0x77')])){if(fs[_0x0cce('0x7f')](path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],'server/files/images/avatars/',_0x3f3348[_0x0cce('0x77')]))){_0x1c3955=path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],_0x0cce('0x83'),_0x3f3348[_0x0cce('0x77')]);}}return _0x4381c0[_0x0cce('0x81')](_0x1c3955);}})[_0x0cce('0x5a')](handleError(_0x4381c0,null));};exports[_0x0cce('0x84')]=function(_0x485c32,_0x268d9d,_0x1cd933){var _0x4605a4=path['join'](config[_0x0cce('0x7b')],_0x0cce('0x85'));var _0x2ee78c={'where':{'id':_0x485c32[_0x0cce('0x5c')]['id']},'attributes':['id',_0x0cce('0x86'),_0x0cce('0x87')],'raw':!![]};return db[_0x0cce('0x41')][_0x0cce('0x64')](_0x2ee78c)[_0x0cce('0x24')](handleEntityNotFound(_0x268d9d,null))[_0x0cce('0x24')](function(_0x2f2d3c){if(_0x2f2d3c){if(!_[_0x0cce('0x7e')](_0x2f2d3c[_0x0cce('0x86')])){if(fs[_0x0cce('0x7f')](path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],'server/files/images/avatars/',_0x2f2d3c['customerAvatar']))&&_0x2f2d3c['showCustomerAvatar']){_0x4605a4=path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],'server/files/images/avatars/',_0x2f2d3c[_0x0cce('0x86')]);}}return _0x268d9d[_0x0cce('0x81')](_0x4605a4);}})[_0x0cce('0x5a')](handleError(_0x268d9d,null));};exports[_0x0cce('0x88')]=function(_0x4f3744,_0x3074db,_0x1baa26){var _0x1c155e=path[_0x0cce('0x7a')](config['root'],_0x0cce('0x89'));var _0x71bd39={'where':{'id':_0x4f3744[_0x0cce('0x5c')]['id']},'attributes':['id',_0x0cce('0x8a')],'raw':!![]};return db[_0x0cce('0x41')][_0x0cce('0x64')](_0x71bd39)[_0x0cce('0x24')](handleEntityNotFound(_0x3074db,null))[_0x0cce('0x24')](function(_0x5d1791){if(_0x5d1791){if(!_[_0x0cce('0x7e')](_0x5d1791['systemAvatar'])){if(fs[_0x0cce('0x7f')](path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],_0x0cce('0x83'),_0x5d1791[_0x0cce('0x8a')]))){_0x1c155e=path['join'](config[_0x0cce('0x7b')],'server/files/images/avatars/',_0x5d1791['systemAvatar']);}}return _0x3074db['download'](_0x1c155e);}})['catch'](handleError(_0x3074db,null));};exports['notify']=function(_0x37cda2,_0xa77730,_0x379e76){var _0x37730f=require(_0x0cce('0x8b'));var _0x182482=new _0x37730f();var _0x147dad=_0x182482[_0x0cce('0x8c')](_0x37cda2['headers'][_0x0cce('0x8d')])[_0x0cce('0x8e')]();var _0x5e7aa5={'body':_0x37cda2['body'],'channel':_0x0cce('0x8f')};var _0x1a2061=[];var _0x228e0c=[];var _0x474ccd={};var _0x1b4c56=![];return db[_0x0cce('0x90')][_0x0cce('0x67')]()[_0x0cce('0x24')](function(_0x3b9ee7){if(!_0x3b9ee7){throw new db['Sequelize'][(_0x0cce('0x91'))]('no\x20available\x20attributes');}_0x1a2061=_[_0x0cce('0x92')](_[_0x0cce('0x5e')](_0x3b9ee7),[_0x0cce('0x93'),_0x0cce('0x94')]);_0x228e0c=_[_0x0cce('0x92')](_[_0x0cce('0x5e')](_0x3b9ee7),[_0x0cce('0x93'),_0x0cce('0x94'),_0x0cce('0x95'),_0x0cce('0x96')]);if(_0x37cda2[_0x0cce('0x60')]['id']){delete _0x37cda2[_0x0cce('0x60')]['id'];}if(_[_0x0cce('0x7e')](_0x37cda2['body']['from'])){throw new db[(_0x0cce('0x97'))][(_0x0cce('0x91'))](_0x0cce('0x98'));}if(_[_0x0cce('0x7e')](_0x37cda2[_0x0cce('0x60')][_0x0cce('0x60')])||_0x37cda2[_0x0cce('0x60')]['body']===''){throw new db[(_0x0cce('0x97'))][(_0x0cce('0x91'))](_0x0cce('0x99'));}if(_['isNil'](_0x37cda2[_0x0cce('0x60')][_0x0cce('0x9a')])){throw new db['Sequelize'][(_0x0cce('0x91'))](_0x0cce('0x9b')+_0x228e0c);}if(!_['includes'](_0x228e0c,_0x37cda2[_0x0cce('0x60')]['mapKey'])){throw new db['Sequelize'][(_0x0cce('0x91'))](_0x0cce('0x9c')+_0x228e0c);}_0x474ccd[_0x37cda2['body'][_0x0cce('0x9a')]]=_0x37cda2[_0x0cce('0x60')][_0x0cce('0x9d')];})['then'](function(){return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x37cda2['params']['id']},'include':[{'model':db[_0x0cce('0x9e')],'as':_0x0cce('0x9f'),'include':[{'model':db['CmContact'],'as':_0x0cce('0xa0'),'where':_0x474ccd,'limit':0x1,'order':[['updatedAt',_0x0cce('0xa1')]]}]},{'model':db['ChatApplication'],'as':_0x0cce('0xa2')}]});})[_0x0cce('0x24')](handleEntityNotFound(_0xa77730,null))['then'](function(_0x44f423){if(_0x44f423&&_0x44f423['List']){_0x5e7aa5['account']=_0x44f423;_0x5e7aa5[_0x0cce('0xa3')]=_0x44f423[_0x0cce('0xa2')];_0x5e7aa5['list']=_0x44f423['List'];_0x5e7aa5[_0x0cce('0xa3')]=_[_0x0cce('0xa4')](_0x5e7aa5[_0x0cce('0xa3')],['priority'],[_0x0cce('0xa5')]);if(_0x5e7aa5[_0x0cce('0xa6')][_0x0cce('0xa2')]){delete _0x5e7aa5[_0x0cce('0xa6')][_0x0cce('0xa2')];}if(_0x5e7aa5[_0x0cce('0xa6')][_0x0cce('0x9f')]&&_0x5e7aa5['account'][_0x0cce('0x9f')]['Contacts'][_0x0cce('0x4a')]){return _0x5e7aa5[_0x0cce('0xa6')][_0x0cce('0x9f')][_0x0cce('0xa0')][0x0];}var _0x63be=_[_0x0cce('0xa7')](_0x37cda2['body'],{'firstName':_0x37cda2['body'][_0x0cce('0x9d')],'ListId':_0x44f423[_0x0cce('0x96')]});_0x63be[_0x37cda2[_0x0cce('0x60')][_0x0cce('0x9a')]]=_0x37cda2[_0x0cce('0x60')][_0x0cce('0x9d')];return db[_0x0cce('0x90')]['create'](_0x63be,{'fields':_0x1a2061,'raw':!![]});}})[_0x0cce('0x24')](handleEntityNotFound(_0xa77730,null))[_0x0cce('0x24')](function(_0x587893){_0x5e7aa5['contact']=_0x587893;var _0x1211de=_0x37cda2[_0x0cce('0x60')][_0x0cce('0xa8')];if(_0x37cda2[_0x0cce('0xa9')][_0x0cce('0xaa')]){_0x1211de=_0x37cda2[_0x0cce('0xa9')]['cf-connecting-ip'];}else if(_0x37cda2[_0x0cce('0xa9')][_0x0cce('0xab')]){_0x1211de=_[_0x0cce('0xac')](_0x37cda2[_0x0cce('0xa9')][_0x0cce('0xab')][_0x0cce('0xad')](','));}if(_0x587893){var _0x4862d4={'ContactId':_0x587893['id'],'ChatWebsiteId':_0x37cda2[_0x0cce('0x5c')]['id'],'from':(_0x587893[_0x0cce('0xae')]||'')+'\x20'+(_0x587893[_0x0cce('0xaf')]||''),'customerIp':_0x1211de,'customerPort':_0x37cda2[_0x0cce('0xa9')][_0x0cce('0xb0')]?_0x37cda2[_0x0cce('0xa9')][_0x0cce('0xb0')]:null,'referer':_0x37cda2[_0x0cce('0x60')][_0x0cce('0xb1')],'browserName':_0x147dad[_0x0cce('0xb2')][_0x0cce('0x3c')]&&_0x147dad[_0x0cce('0xb2')][_0x0cce('0xb3')]?util['format']('%s\x20%s',_0x147dad[_0x0cce('0xb2')][_0x0cce('0x3c')],_0x147dad[_0x0cce('0xb2')]['version']):_0x0cce('0xb4'),'browserVersion':_0x147dad[_0x0cce('0xb2')]['version']||'unknown','osName':util[_0x0cce('0xb5')](_0x0cce('0xb6'),_0x147dad['os']['name'],_0x147dad['os'][_0x0cce('0xb3')]),'osVersion':_0x147dad['os']['version'],'deviceModel':_0x147dad['device'][_0x0cce('0x44')]&&_0x147dad['device'][_0x0cce('0xb7')]?util['format'](_0x0cce('0xb8'),_0x147dad[_0x0cce('0xb9')][_0x0cce('0x44')],_0x147dad['device'][_0x0cce('0xb7')],_0x147dad[_0x0cce('0xb9')][_0x0cce('0x43')]):null,'deviceVendor':_0x147dad[_0x0cce('0xb9')][_0x0cce('0xb7')],'deviceType':_0x147dad[_0x0cce('0xb9')][_0x0cce('0x43')],'formData':JSON['stringify'](_0x37cda2[_0x0cce('0x60')])};var _0x2b711b={'ChatWebsiteId':_0x37cda2[_0x0cce('0x5c')]['id'],'closed':![]};if(_0x37cda2[_0x0cce('0x60')][_0x0cce('0xba')]){_0x2b711b[_0x0cce('0xba')]=_0x37cda2[_0x0cce('0x60')][_0x0cce('0xba')];return db[_0x0cce('0xbb')][_0x0cce('0x64')]({'where':_0x2b711b})[_0x0cce('0x24')](function(_0x56dc1d){if(_0x56dc1d){return[_0x56dc1d,![]];}_0x4862d4[_0x0cce('0xba')]=_0x37cda2[_0x0cce('0x60')][_0x0cce('0xba')];_0x4862d4['externalUrl']=_0x37cda2[_0x0cce('0x60')][_0x0cce('0xbc')];return db[_0x0cce('0xbb')]['create'](_0x4862d4)[_0x0cce('0x24')](function(_0x491ab3){return[_0x491ab3,!![]];});});}_0x2b711b[_0x0cce('0xbd')]=_0x587893['id'];if(_0x37cda2[_0x0cce('0x60')][_0x0cce('0xbe')]&&_0x37cda2['body']['interaction']['id']){_0x2b711b['id']=_0x37cda2['body'][_0x0cce('0xbe')]['id'];return db['ChatInteraction'][_0x0cce('0x64')]({'where':_0x2b711b})[_0x0cce('0x24')](function(_0x5ce228){if(_0x5ce228){return[_0x5ce228,![]];}return db[_0x0cce('0xbb')][_0x0cce('0x5f')](_0x4862d4)[_0x0cce('0x24')](function(_0x34549c){return[_0x34549c,!![]];});});}return db[_0x0cce('0xbb')]['create'](_0x4862d4)['then'](function(_0x5947bc){return[_0x5947bc,!![]];});}})[_0x0cce('0xbf')](function(_0x537f88,_0x3d4b28){if(_0x537f88){_0x1b4c56=_0x3d4b28;if(!_0x3d4b28){var _0x3fd4bb={'from':(_0x5e7aa5[_0x0cce('0xc0')][_0x0cce('0xae')]||'')+'\x20'+(_0x5e7aa5[_0x0cce('0xc0')][_0x0cce('0xaf')]||'')};if(_0x37cda2[_0x0cce('0x60')][_0x0cce('0xba')]&&_0x37cda2[_0x0cce('0x60')][_0x0cce('0xc1')]&&_0x37cda2[_0x0cce('0x60')][_0x0cce('0xba')]!=_0x37cda2[_0x0cce('0x60')][_0x0cce('0xc1')]){_0x3fd4bb[_0x0cce('0xba')]=_0x37cda2[_0x0cce('0x60')][_0x0cce('0xc1')];}return _0x537f88[_0x0cce('0x37')](_0x3fd4bb);}else{return _0x537f88;}}})[_0x0cce('0x24')](function(_0x2a7149){_0x5e7aa5[_0x0cce('0xbe')]=_0x2a7149[_0x0cce('0x62')]({'plain':!![]});_0x5e7aa5['interaction'][_0x0cce('0xc2')]=_0x1b4c56;if(_0x5e7aa5['interaction'][_0x0cce('0xc2')]){if(_0x5e7aa5[_0x0cce('0xa6')]['autoclose']){_0x5e7aa5[_0x0cce('0xa3')][_0x0cce('0xc3')]({'id':0x0,'priority':_0x5e7aa5[_0x0cce('0xa3')]['length']+0x1,'app':_0x0cce('0xc4'),'appdata':_0x0cce('0xc5'),'interval':'*,*,*,*'});}}return db[_0x0cce('0xc6')][_0x0cce('0x5f')]({'body':_0x37cda2[_0x0cce('0x60')][_0x0cce('0x60')],'ChatWebsiteId':_0x37cda2[_0x0cce('0x5c')]['id'],'ChatInteractionId':_0x2a7149['id'],'direction':'in','ContactId':_0x5e7aa5[_0x0cce('0xc0')]['id'],'AttachmentId':_0x37cda2[_0x0cce('0x60')][_0x0cce('0xc7')]});})['then'](function(_0x59a8da){_0x5e7aa5['message']=_0x59a8da;if(_0x5e7aa5[_0x0cce('0xbe')][_0x0cce('0xc8')]){return db[_0x0cce('0xc9')][_0x0cce('0x64')]({'attributes':['id',_0x0cce('0x3c')],'where':{'id':_0x5e7aa5[_0x0cce('0xbe')]['UserId']}})[_0x0cce('0x24')](function(_0x8bdbdb){if(_0x8bdbdb){_0x5e7aa5['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x0cce('0xca'),'appdata':_0x8bdbdb[_0x0cce('0x3c')]+','+(_0x5e7aa5[_0x0cce('0xa6')][_0x0cce('0xcb')]||0xa),'interval':'*,*,*,*'});_0x5e7aa5[_0x0cce('0xcc')]=!![];}return respondWithRpcPromise(_0x0cce('0xcd'),_0x0cce('0xce'),_0x5e7aa5);});}return respondWithRpcPromise(_0x0cce('0xcd'),'startRouting',_0x5e7aa5);})[_0x0cce('0x24')](function(_0x226100){respondWithRpcPromise(_0x0cce('0xcf'),'EventManager',{'event':_0x0cce('0xd0'),'message':_0x226100},client9002);return _0x226100;})[_0x0cce('0x24')](respondWithResult(_0xa77730,null))[_0x0cce('0x5a')](handleError(_0xa77730,null));};exports[_0x0cce('0xd1')]=function(_0x475cc1,_0x438e86,_0x9f78e5){var _0x4d0a9e,_0x322135,_0x4e9087;var _0x504c8a=[];var _0x4547c9=[];var _0xfc980={};var _0x42be1e=_0x475cc1['files']||[];var _0x49b7b3=[];var _0x485ff5;return db[_0x0cce('0x90')][_0x0cce('0x67')]()[_0x0cce('0x24')](function(_0x1991c7){if(!_0x1991c7){throw new db[(_0x0cce('0x97'))][(_0x0cce('0x91'))](_0x0cce('0xd2'));}_0x4547c9=_['difference'](_[_0x0cce('0x5e')](_0x1991c7),[_0x0cce('0x93'),_0x0cce('0x94')]);_0x504c8a=_[_0x0cce('0x92')](_[_0x0cce('0x5e')](_0x1991c7),[_0x0cce('0x93'),_0x0cce('0x94'),_0x0cce('0x95'),_0x0cce('0x96')]);if(_0x475cc1[_0x0cce('0x60')]['id']){delete _0x475cc1['body']['id'];}if(_[_0x0cce('0x7e')](_0x475cc1[_0x0cce('0x60')][_0x0cce('0x9d')])){throw _0x438e86[_0x0cce('0x2f')](0x1f4)[_0x0cce('0x3d')](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x475cc1['body']['body'])||_0x475cc1['body']['body']===''){throw _0x438e86[_0x0cce('0x2f')](0x1f4)[_0x0cce('0x3d')](new db[(_0x0cce('0x97'))]['ValidationError'](_0x0cce('0x99')));}if(_[_0x0cce('0x7e')](_0x475cc1['body'][_0x0cce('0xd3')])){throw _0x438e86[_0x0cce('0x2f')](0x1f4)['send'](new db[(_0x0cce('0x97'))]['ValidationError'](_0x0cce('0xd4')+_0x504c8a));}if(!_['includes'](_0x504c8a,_0x475cc1[_0x0cce('0x60')][_0x0cce('0xd3')])){throw _0x438e86[_0x0cce('0x2f')](0x1f4)[_0x0cce('0x3d')](new db[(_0x0cce('0x97'))][(_0x0cce('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x504c8a));}_0xfc980[_0x475cc1['body'][_0x0cce('0xd3')]]=_0x475cc1[_0x0cce('0x60')][_0x0cce('0x9d')];})[_0x0cce('0x24')](function(){return db[_0x0cce('0x41')]['find']({'where':{'id':_0x475cc1[_0x0cce('0x5c')]['id']},'include':[{'model':db[_0x0cce('0x9e')],'as':_0x0cce('0x9f')},{'model':db[_0x0cce('0xd5')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x438e86,null))[_0x0cce('0x24')](function(_0x35b2ce){if(_0x35b2ce&&_0x35b2ce[_0x0cce('0x9f')]){_0x322135=_0x35b2ce;var _0x56f93a=_[_0x0cce('0xa7')](_0x475cc1[_0x0cce('0x60')],{'firstName':_0x475cc1[_0x0cce('0x60')][_0x0cce('0x9d')],'phone':_0x475cc1[_0x0cce('0x60')][_0x0cce('0x9d')],'ListId':_0x35b2ce['ListId']});_0x56f93a[_0x475cc1[_0x0cce('0x60')][_0x0cce('0xd3')]]=_0x475cc1[_0x0cce('0x60')]['from'];return db[_0x0cce('0x90')][_0x0cce('0xd6')]({'where':_0xfc980,'defaults':_0x56f93a});}})[_0x0cce('0xbf')](function(_0x48a6c1){if(_0x48a6c1){_0x4e9087=_0x48a6c1;var _0x5a4cfb=fs[_0x0cce('0xd7')](path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],_0x0cce('0xd8')),_0x0cce('0xd9'));var _0x4c490c=ejs[_0x0cce('0xda')](_0x5a4cfb,{'body':_['toPairs'](_0x475cc1[_0x0cce('0x60')][_0x0cce('0x60')]),'bodyTitle':_0x322135[_0x0cce('0xdb')]});return db[_0x0cce('0xdc')]['create']({'body':_0x4c490c,'ContactId':_0x48a6c1['id'],'ChatWebsiteId':_0x322135['id']});}})[_0x0cce('0x24')](function(_0x39da5e){_0x485ff5=_0x39da5e;if(_0x42be1e[_0x0cce('0x4a')]){var _0x291079=_0x42be1e['map'](function(_0x2190f8){return{'name':_0x2190f8[_0x0cce('0xdd')],'basename':_0x2190f8['filename'],'type':_0x2190f8['mimetype'],'ChatOfflineMessageId':_0x39da5e['id']};});_0x49b7b3=_0x291079[_0x0cce('0x40')](_0x462ad6=>{var _0x5c2568={'filename':_0x462ad6[_0x0cce('0x3c')],'path':path['join'](config[_0x0cce('0x7b')],_0x0cce('0xde'),_0x0cce('0xdf'),_0x0cce('0xe0'),'offline-chat',_0x462ad6[_0x0cce('0xe1')])};return _0x5c2568;});if(!_0x322135[_0x0cce('0xe2')]){return db['sequelize'][_0x0cce('0xe3')](function(_0x5c1a89){return db[_0x0cce('0xe4')][_0x0cce('0xe5')](_0x291079,{'transaction':_0x5c1a89});});}}})[_0x0cce('0x24')](function(){if(_0x485ff5){_0x4d0a9e=_0x485ff5;return db[_0x0cce('0xd5')][_0x0cce('0x6b')]({'where':{'active':!![]},'include':[{'model':db[_0x0cce('0xe6')],'as':'Smtp','raw':!![]}]});}})[_0x0cce('0x24')](function(_0x59c38e){if(_0x59c38e&&_0x59c38e[_0x0cce('0xe7')]&&_0x322135[_0x0cce('0xe8')]&&_0x322135[_0x0cce('0xe9')]){var _0x3b16c9={'tls':{'rejectUnauthorized':![]}};if(_0x59c38e[_0x0cce('0xe7')][_0x0cce('0xea')]){_0x3b16c9[_0x0cce('0xea')]=_0x59c38e[_0x0cce('0xe7')]['service'];}else{_0x3b16c9[_0x0cce('0xeb')]=_0x59c38e[_0x0cce('0xe7')][_0x0cce('0xeb')];_0x3b16c9[_0x0cce('0xec')]=_0x59c38e[_0x0cce('0xe7')][_0x0cce('0xec')];_0x3b16c9['secure']=_0x59c38e['Smtp'][_0x0cce('0xed')];}if(_0x59c38e[_0x0cce('0xe7')][_0x0cce('0xee')]){_0x3b16c9[_0x0cce('0xef')]={'user':_0x59c38e[_0x0cce('0xe7')]['user'],'pass':_0x59c38e[_0x0cce('0xe7')]['pass']};}return respondWithRpcPromise(_0x0cce('0xf0'),_0x0cce('0xf1'),{'account':_0x3b16c9,'message':{'from':util[_0x0cce('0xb5')]('\x22%s\x22\x20<%s>',_0x59c38e['name'],_0x59c38e[_0x0cce('0xf2')]||_0x59c38e['Smtp'][_0x0cce('0x61')]),'to':_0x322135['forwardOfflineAddress'],'subject':_0x322135[_0x0cce('0xf3')],'html':_0x4d0a9e['body'],'attachments':_0x49b7b3}},client9003)[_0x0cce('0x24')](function(){return _0x4d0a9e;})[_0x0cce('0x5a')](function(_0x29efcd){console[_0x0cce('0x2a')](_0x29efcd);});}})[_0x0cce('0x24')](function(){if(_0x322135&&_0x322135[_0x0cce('0xe2')]&&_0x322135[_0x0cce('0xf4')]){var _0x381a0c=[];if(_0x42be1e['length']){_0x381a0c=_0x42be1e[_0x0cce('0x40')](function(_0x545c17){return{'name':_0x545c17['originalname'],'basename':_0x545c17['filename'],'type':_0x545c17['mimetype'],'ChatOfflineMessageId':_0x485ff5['id']};});}var _0x1de0be;if(!_['isNil'](_0x322135['subjectOffline'])){var _0x5077eb=_[_0x0cce('0x40')](_0x475cc1[_0x0cce('0x60')],function(_0x5720e6){return _0x5720e6;});var _0x330f3b=_[_0x0cce('0xf5')](_0x5077eb)[0x0];var _0x3185a4=_[_0x0cce('0xf6')](_0x330f3b,function(_0xcaa896){return _0xcaa896;});_0x1de0be=_0x3185a4[0x1][_0x322135[_0x0cce('0xf7')]];}var _0x4bf0f0={'from':_0x4e9087[_0x0cce('0xf2')],'firstName':_0x4e9087[_0x0cce('0xae')],'lastName':_0x4e9087[_0x0cce('0xaf')],'mapKey':_0x0cce('0xf2'),'message':{'from':_0x4e9087['email'],'to':_0x322135[_0x0cce('0xd5')][_0x0cce('0xf2')],'cc':'','subject':_[_0x0cce('0x7e')](_0x1de0be)?_0x322135[_0x0cce('0xf3')]:_0x1de0be,'messageId':'','sentAt':new Date(),'attach':_0x381a0c[_0x0cce('0x4a')],'attachments':_0x381a0c,'originChannel':_0x0cce('0xf8'),'ChatWebsiteId':_0x322135['id'],'ChatOfflineMessageId':_0x4d0a9e['id'],'originTo':_0x322135['MailAccount'][_0x0cce('0xf2')]},'body':_0x4d0a9e['body']};var _0x295676={'account':{'id':_0x322135[_0x0cce('0xf4')]},'body':_0x4bf0f0,'log':_0x0cce('0xf9')};return respondWithRpcPromise(_0x0cce('0xf9'),'notifyMail',_0x295676,client9001)[_0x0cce('0x24')](function(){return _0x4d0a9e;})['catch'](function(_0x1abffe){console[_0x0cce('0x2a')](_0x1abffe);});}return;})[_0x0cce('0x24')](function(){if(_0x4d0a9e){return _0x4d0a9e;}})[_0x0cce('0x24')](respondWithResult(_0x438e86,null))['catch'](function(_0x2133fa){console['error'](_0x0cce('0x5a'),_0x2133fa);for(var _0x3f041f of _0x42be1e){var _0x2e96b7=path[_0x0cce('0x7a')](config[_0x0cce('0x7b')],_0x0cce('0xde'),_0x0cce('0xdf'),'attachments',_0x0cce('0xfa'),_0x3f041f[_0x0cce('0x75')]);fs_extra['remove'](_0x2e96b7)[_0x0cce('0x5a')](function(_0xcb5c7d){console[_0x0cce('0x2a')](_0x0cce('0xfb'),_0x2e96b7,_0xcb5c7d);});}});};exports[_0x0cce('0xfc')]=function(_0xa4656f,_0x517d26,_0x1a81db){return db[_0x0cce('0xbb')][_0x0cce('0x64')]({'where':{'id':_0xa4656f[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x517d26,null))[_0x0cce('0x24')](function(_0x208216){if(_0x208216){return _0x208216[_0x0cce('0xfc')](_0xa4656f[_0x0cce('0x60')][_0x0cce('0x6e')],_[_0x0cce('0xfd')](_0xa4656f['body'],['ids','id'])||{});}})[_0x0cce('0x24')](respondWithResult(_0x517d26,null))['catch'](handleError(_0x517d26,null));};exports['getInteractions']=function(_0x3a5af7,_0x57a071,_0x407aba){var _0x342175={'raw':![],'where':{}};var _0x4a2dee={};var _0x612035={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0cce('0x6b')]({'where':{'id':_0x3a5af7[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x57a071,null))[_0x0cce('0x24')](function(_0x21086a){if(_0x21086a){_0x4a2dee[_0x0cce('0x44')]=_[_0x0cce('0x5e')](db[_0x0cce('0xbb')][_0x0cce('0x42')]);_0x4a2dee[_0x0cce('0x45')]=_['keys'](_0x3a5af7['query']);_0x4a2dee[_0x0cce('0x46')]=_['intersection'](_0x4a2dee[_0x0cce('0x44')],_0x4a2dee[_0x0cce('0x45')]);_0x342175[_0x0cce('0x48')]=_['intersection'](_0x4a2dee[_0x0cce('0x44')],qs[_0x0cce('0x49')](_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x49')]));_0x342175[_0x0cce('0x48')]=_0x342175[_0x0cce('0x48')][_0x0cce('0x4a')]?_0x342175[_0x0cce('0x48')]:_0x4a2dee[_0x0cce('0x44')];if(!_0x3a5af7[_0x0cce('0x45')]['hasOwnProperty']('nolimit')){_0x342175['limit']=qs[_0x0cce('0x4d')](_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x4d')]);_0x342175[_0x0cce('0x31')]=qs['offset'](_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x31')]);}_0x342175[_0x0cce('0x4e')]=qs['sort'](_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x4f')]);_0x342175[_0x0cce('0x50')]=qs[_0x0cce('0x46')](_[_0x0cce('0x51')](_0x3a5af7[_0x0cce('0x45')],_0x4a2dee['filters']));_0x342175['where'][_0x0cce('0x69')]=_0x21086a['id'];if(_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x52')]){_0x342175[_0x0cce('0x50')]=_[_0x0cce('0x54')](_0x342175[_0x0cce('0x50')],{'$or':_['map'](_0x342175[_0x0cce('0x48')],function(_0x39a60b){var _0x5463a2={};_0x5463a2[_0x39a60b]={'$like':'%'+_0x3a5af7['query'][_0x0cce('0x52')]+'%'};return _0x5463a2;})});}_0x342175=_[_0x0cce('0x54')]({},_0x342175,_0x3a5af7[_0x0cce('0x55')]);return db[_0x0cce('0xbb')][_0x0cce('0x33')]({'where':_0x342175[_0x0cce('0x50')]})[_0x0cce('0x24')](function(_0x519a9b){_0x612035['count']=_0x519a9b;if(_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x56')]){_0x342175[_0x0cce('0x57')]=[{'model':db[_0x0cce('0x90')],'as':_0x0cce('0xfe'),'required':![]},{'model':db['User'],'as':_0x0cce('0xff'),'attributes':[_0x0cce('0x3c'),_0x0cce('0x100'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x0cce('0x101'),'attributes':['id',_0x0cce('0x3c'),'color'],'where':_0x3a5af7['query'][_0x0cce('0x102')]?{'id':_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x102')]}:undefined,'required':_0x3a5af7[_0x0cce('0x45')][_0x0cce('0x102')]?!![]:![]}];}return db[_0x0cce('0xbb')][_0x0cce('0x58')](_0x342175);})[_0x0cce('0x24')](function(_0x36515d){_0x612035[_0x0cce('0x59')]=_0x36515d;return _0x612035;});}})['then'](respondWithFilteredResult(_0x57a071,_0x342175))['catch'](handleError(_0x57a071,null));};function iftimePromise(_0x568744,_0x1faae5){return respondWithRpcPromise('Command',_0x0cce('0x103'),{'command':_0x1faae5[_0x0cce('0x104')]?util[_0x0cce('0xb5')](_0x0cce('0x105'),_0x568744[_0x0cce('0x106')],_0x1faae5['timezone']):util[_0x0cce('0xb5')](_0x0cce('0x107'),_0x568744[_0x0cce('0x106')])},client9002)['then'](function(_0x4aceb2){var _0x4ce39f=_0x4aceb2&&_0x4aceb2[_0x0cce('0x108')](_0x0cce('0x109'))>=0x0?!![]:![];logger['info'](_0x0cce('0x10a'),_0x1faae5['id'],_0x568744['id'],_0x568744[_0x0cce('0x106')],_0x4ce39f?_0x0cce('0x10b'):'OFFLINE',_0x1faae5['timezone']?_0x1faae5[_0x0cce('0x104')]:_0x0cce('0x10c'));return _0x4ce39f;})[_0x0cce('0x5a')](function(_0x5727f1){logger[_0x0cce('0x2a')](_0x0cce('0x10a'),_0x1faae5['id'],_0x568744['id'],_0x568744[_0x0cce('0x106')],util['inspect'](_0x5727f1,{'showHidden':![],'depth':null}),_0x1faae5[_0x0cce('0x104')]?_0x1faae5[_0x0cce('0x104')]:_0x0cce('0x10c'));return![];});}exports[_0x0cce('0x103')]=function(_0x1ebb7d,_0x3e8536,_0x1db9f1){var _0x47ad54=0x0;var _0x5a7786=0x0;var _0x43d58e=![];var _0x482e7e;var _0x26897a;return db['ChatWebsite'][_0x0cce('0x64')]({'where':{'id':_0x1ebb7d[_0x0cce('0x5c')]['id']},'include':[{'model':db[_0x0cce('0x10d')],'as':_0x0cce('0x10d'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x0cce('0x106')],'raw':!![]}]}]})[_0x0cce('0x24')](handleEntityNotFound(_0x3e8536,null))[_0x0cce('0x24')](function(_0x981bb9){if(_0x981bb9){_0x482e7e=_0x981bb9;return _0x981bb9['getProactiveActions']({'raw':!![]});}})[_0x0cce('0x24')](function(_0x5d096e){if(_0x482e7e){if(_0x5d096e){_0x26897a=_0x5d096e;}}return require(_0x0cce('0x1a'))[_0x0cce('0x7c')]();})[_0x0cce('0x24')](function(_0x355556){if(_0x355556){_0x5a7786=_0x355556['virtual'];_0x43d58e=_0x355556[_0x0cce('0x7d')];}})[_0x0cce('0x24')](function(){return db[_0x0cce('0xbb')]['count']({'where':{'closed':![]}});})['then'](function(_0x1a6cc){_0x47ad54=_0x1a6cc;if(_0x5a7786&&_0x1a6cc>_0x5a7786){return db[_0x0cce('0x10e')][_0x0cce('0x6b')]({'where':{'id':0x1}})[_0x0cce('0x24')](function(_0x1eeafd){if(_0x1eeafd){_0x1eeafd['increment'](_0x0cce('0x10f'));}});}})[_0x0cce('0x24')](function(){if(_0x482e7e['Interval']&&_0x482e7e['Interval'][_0x0cce('0x110')]){var _0x48522b=[];for(var _0x285ecc=0x0;_0x285ecc<_0x482e7e[_0x0cce('0x10d')][_0x0cce('0x110')][_0x0cce('0x4a')];_0x285ecc++){var _0xa0777d=_0x482e7e[_0x0cce('0x10d')][_0x0cce('0x110')][_0x285ecc][_0x0cce('0x62')]({'plain':!![]});_0x48522b['push'](iftimePromise(_0xa0777d,_0x482e7e));}return BPromise[_0x0cce('0x111')](_0x48522b)[_0x0cce('0x24')](function(_0x1fac5e){return _[_0x0cce('0x112')](_0x1fac5e);});}else{return!![];}})[_0x0cce('0x24')](function(_0x523c5f){var _0x498e3f=fs[_0x0cce('0xd7')](path['join'](config['root'],'server/files/chat/iframe.ejs'),_0x0cce('0xd9'));var _0x3dbc26={'remote':_0x482e7e['remote'],'query':querystring[_0x0cce('0x113')](_[_0x0cce('0x54')](_0x482e7e[_0x0cce('0x62')]({'plain':!![]}),{'customerIp':_0x1ebb7d[_0x0cce('0xa9')]['x-forwarded-for']||_0x1ebb7d[_0x0cce('0xa9')][_0x0cce('0x114')]||_0x1ebb7d[_0x0cce('0x115')][_0x0cce('0x116')]||_0x1ebb7d['ip'],'referer':_0x1ebb7d[_0x0cce('0xa9')][_0x0cce('0xb1')],'openedInteractions':_0x47ad54,'maxInteractions':_0x5a7786,'virtual':_0x43d58e[_0x0cce('0x117')],'online':_0x523c5f,'custom':_0x43d58e}))[_0x0cce('0x118')](/'/g,'\x5c\x27')};_0x3e8536[_0x0cce('0x3d')](ejs['render'](Mustache[_0x0cce('0xda')](_0x498e3f,_0x3dbc26),{'proactiveActions':_0x26897a,'alignment':_0x482e7e['alignment'],'verticalAlignment':_0x482e7e[_0x0cce('0x119')],'div_color':_0x482e7e[_0x0cce('0x11a')],'text_color':_0x482e7e[_0x0cce('0x11b')],'button_color':_0x482e7e[_0x0cce('0x11c')],'background_color':_0x482e7e[_0x0cce('0x11d')]}));})[_0x0cce('0x5a')](handleError(_0x3e8536,null));};exports[_0x0cce('0x11e')]=function(_0xdeb085,_0x4dc3e1,_0x5b26b7){return db[_0x0cce('0x41')][_0x0cce('0x6b')]({'where':{'id':_0xdeb085[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x4dc3e1,null))[_0x0cce('0x24')](function(_0x47be70){if(_0x47be70){return db[_0x0cce('0x11f')]['transaction'](function(_0x3cd735){return db[_0x0cce('0x120')][_0x0cce('0x38')]({'where':{'ChatWebsiteId':_0xdeb085[_0x0cce('0x5c')]['id']},'transaction':_0x3cd735})['then'](function(_0x160948){var _0x57b678=_[_0x0cce('0x40')](_0xdeb085[_0x0cce('0x60')],function(_0x2f3d9c){_0x2f3d9c[_0x0cce('0x69')]=_0xdeb085[_0x0cce('0x5c')]['id'];return _0x2f3d9c;});return db[_0x0cce('0x120')][_0x0cce('0xe5')](_0x57b678,{'transaction':_0x3cd735});});})[_0x0cce('0x24')](function(){return db[_0x0cce('0x120')][_0x0cce('0x121')]({'where':{'ChatWebsiteId':_0xdeb085[_0x0cce('0x5c')]['id']},'order':'priority'});});}})[_0x0cce('0x24')](respondWithResult(_0x4dc3e1,null))[_0x0cce('0x5a')](handleError(_0x4dc3e1,null));};exports[_0x0cce('0x122')]=function(_0x19ae67,_0x23c246,_0xcbd597){var _0x267660={};var _0x5e5401={};var _0x187ea1;var _0xa81396;return db[_0x0cce('0x41')]['findOne']({'where':{'id':_0x19ae67[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x23c246,null))[_0x0cce('0x24')](function(_0x524755){if(_0x524755){_0x187ea1=_0x524755;_0x5e5401[_0x0cce('0x44')]=_[_0x0cce('0x5e')](db[_0x0cce('0x120')]['rawAttributes']);_0x5e5401[_0x0cce('0x45')]=_[_0x0cce('0x5e')](_0x19ae67[_0x0cce('0x45')]);_0x5e5401[_0x0cce('0x46')]=_['intersection'](_0x5e5401[_0x0cce('0x44')],_0x5e5401['query']);_0x267660[_0x0cce('0x48')]=_['intersection'](_0x5e5401['model'],qs[_0x0cce('0x49')](_0x19ae67[_0x0cce('0x45')]['fields']));_0x267660['attributes']=_0x267660[_0x0cce('0x48')][_0x0cce('0x4a')]?_0x267660['attributes']:_0x5e5401[_0x0cce('0x44')];_0x267660[_0x0cce('0x4e')]=qs[_0x0cce('0x4f')](_0x19ae67[_0x0cce('0x45')][_0x0cce('0x4f')]);_0x267660[_0x0cce('0x50')]=qs[_0x0cce('0x46')](_[_0x0cce('0x51')](_0x19ae67['query'],_0x5e5401[_0x0cce('0x46')]));if(_0x19ae67[_0x0cce('0x45')][_0x0cce('0x52')]){_0x267660[_0x0cce('0x50')]=_[_0x0cce('0x54')](_0x267660[_0x0cce('0x50')],{'$or':_['map'](_0x267660[_0x0cce('0x48')],function(_0x264684){var _0x1db8f4={};_0x1db8f4[_0x264684]={'$like':'%'+_0x19ae67['query'][_0x0cce('0x52')]+'%'};return _0x1db8f4;})});}_0x267660=_[_0x0cce('0x54')]({},_0x267660,_0x19ae67['options']);return _0x187ea1[_0x0cce('0x122')](_0x267660);}})[_0x0cce('0x24')](function(_0x1ec09e){if(_0x1ec09e){_0xa81396=_0x1ec09e[_0x0cce('0x4a')];if(!_0x19ae67[_0x0cce('0x45')][_0x0cce('0x4b')](_0x0cce('0x4c'))){_0x267660[_0x0cce('0x4d')]=qs[_0x0cce('0x4d')](_0x19ae67[_0x0cce('0x45')][_0x0cce('0x4d')]);_0x267660[_0x0cce('0x31')]=qs[_0x0cce('0x31')](_0x19ae67[_0x0cce('0x45')][_0x0cce('0x31')]);}return _0x187ea1['getApplications'](_0x267660);}})[_0x0cce('0x24')](function(_0x464a97){if(_0x464a97){return _0x464a97?{'count':_0xa81396,'rows':_0x464a97}:null;}})[_0x0cce('0x24')](respondWithResult(_0x23c246,null))['catch'](handleError(_0x23c246,null));};exports[_0x0cce('0x123')]=function(_0x5e8295,_0x3eb2f0,_0x2d563f){return db[_0x0cce('0x124')][_0x0cce('0x64')]({'where':{'id':_0x5e8295['params']['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x3eb2f0,null))['then'](function(_0x2c1a97){if(_0x2c1a97){return _0x2c1a97['addProactiveActions'](_0x5e8295[_0x0cce('0x60')][_0x0cce('0x6e')],_[_0x0cce('0xfd')](_0x5e8295[_0x0cce('0x60')],[_0x0cce('0x6e'),'id'])||{});}})[_0x0cce('0x24')](respondWithResult(_0x3eb2f0,null))[_0x0cce('0x5a')](handleError(_0x3eb2f0,null));};exports[_0x0cce('0x125')]=function(_0x3d6346,_0x229ea3,_0xb0f209){var _0x14d7c3={};var _0x3a8728={};var _0x205eec;var _0x107093;return db['ChatWebsite'][_0x0cce('0x6b')]({'where':{'id':_0x3d6346['params']['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x229ea3,null))[_0x0cce('0x24')](function(_0x5348fd){if(_0x5348fd){_0x205eec=_0x5348fd;_0x3a8728['model']=_[_0x0cce('0x5e')](db[_0x0cce('0x126')][_0x0cce('0x42')]);_0x3a8728['query']=_['keys'](_0x3d6346[_0x0cce('0x45')]);_0x3a8728[_0x0cce('0x46')]=_['intersection'](_0x3a8728['model'],_0x3a8728[_0x0cce('0x45')]);_0x14d7c3['attributes']=_['intersection'](_0x3a8728[_0x0cce('0x44')],qs[_0x0cce('0x49')](_0x3d6346[_0x0cce('0x45')][_0x0cce('0x49')]));_0x14d7c3[_0x0cce('0x48')]=_0x14d7c3[_0x0cce('0x48')]['length']?_0x14d7c3[_0x0cce('0x48')]:_0x3a8728[_0x0cce('0x44')];_0x14d7c3['order']=qs['sort'](_0x3d6346[_0x0cce('0x45')][_0x0cce('0x4f')]);_0x14d7c3[_0x0cce('0x50')]=qs['filters'](_['pick'](_0x3d6346[_0x0cce('0x45')],_0x3a8728[_0x0cce('0x46')]));if(_0x3d6346['query'][_0x0cce('0x52')]){_0x14d7c3['where']=_[_0x0cce('0x54')](_0x14d7c3['where'],{'$or':_[_0x0cce('0x40')](_0x14d7c3[_0x0cce('0x48')],function(_0x591a6c){var _0x22eee3={};_0x22eee3[_0x591a6c]={'$like':'%'+_0x3d6346[_0x0cce('0x45')][_0x0cce('0x52')]+'%'};return _0x22eee3;})});}_0x14d7c3=_['merge']({},_0x14d7c3,_0x3d6346[_0x0cce('0x55')]);return _0x205eec[_0x0cce('0x125')](_0x14d7c3);}})[_0x0cce('0x24')](function(_0x50f039){if(_0x50f039){_0x107093=_0x50f039[_0x0cce('0x4a')];if(!_0x3d6346[_0x0cce('0x45')]['hasOwnProperty'](_0x0cce('0x4c'))){_0x14d7c3[_0x0cce('0x4d')]=qs[_0x0cce('0x4d')](_0x3d6346['query'][_0x0cce('0x4d')]);_0x14d7c3['offset']=qs[_0x0cce('0x31')](_0x3d6346[_0x0cce('0x45')][_0x0cce('0x31')]);}return _0x205eec[_0x0cce('0x125')](_0x14d7c3);}})[_0x0cce('0x24')](function(_0x43d572){if(_0x43d572){return _0x43d572?{'count':_0x107093,'rows':_0x43d572}:null;}})[_0x0cce('0x24')](respondWithResult(_0x229ea3,null))[_0x0cce('0x5a')](handleError(_0x229ea3,null));};exports[_0x0cce('0x127')]=function(_0x190116,_0x1437ef,_0x48660f){var _0x715645=_0x190116[_0x0cce('0x45')][_0x0cce('0x128')]==='false'?_0x0cce('0x129'):'onlineForm';return db['ChatWebsite'][_0x0cce('0x64')]({'attributes':['id',_0x715645],'where':{'id':_0x190116['params']['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x1437ef,null))[_0x0cce('0x24')](function(_0x3f4ece){if(_0x3f4ece){var _0x11467a=_0x3f4ece[_0x715645];var _0x48f252=_0x11467a&&_0x11467a['items']?_0x11467a[_0x0cce('0x12a')]:[];_0x1437ef['send']({'fromKey':_[_0x0cce('0x7e')](_0x11467a[_0x0cce('0x12b')])?undefined:_0x11467a[_0x0cce('0x12b')],'count':_0x48f252['length'],'rows':_0x48f252});}})[_0x0cce('0x5a')](handleError(_0x1437ef,null));};exports[_0x0cce('0x12c')]=function(_0x29f64b,_0x2cdcce,_0x1b801a){var _0x486597={'raw':![],'where':{}};var _0x33ff4e={};var _0x2ccceb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0cce('0x6b')]({'where':{'id':_0x29f64b['params']['id']}})['then'](handleEntityNotFound(_0x2cdcce,null))[_0x0cce('0x24')](function(_0xc50660){if(_0xc50660){_0x33ff4e['model']=_[_0x0cce('0x5e')](db[_0x0cce('0xdc')]['rawAttributes']);_0x33ff4e['query']=_[_0x0cce('0x5e')](_0x29f64b['query']);_0x33ff4e[_0x0cce('0x46')]=_['intersection'](_0x33ff4e['model'],_0x33ff4e[_0x0cce('0x45')]);_0x486597['attributes']=_[_0x0cce('0x47')](_0x33ff4e[_0x0cce('0x44')],qs[_0x0cce('0x49')](_0x29f64b[_0x0cce('0x45')][_0x0cce('0x49')]));_0x486597[_0x0cce('0x48')]=_0x486597[_0x0cce('0x48')]['length']?_0x486597[_0x0cce('0x48')]:_0x33ff4e['model'];if(!_0x29f64b[_0x0cce('0x45')][_0x0cce('0x4b')](_0x0cce('0x4c'))){_0x486597['limit']=qs[_0x0cce('0x4d')](_0x29f64b['query'][_0x0cce('0x4d')]);_0x486597[_0x0cce('0x31')]=qs[_0x0cce('0x31')](_0x29f64b[_0x0cce('0x45')][_0x0cce('0x31')]);}_0x486597['order']=qs[_0x0cce('0x4f')](_0x29f64b[_0x0cce('0x45')][_0x0cce('0x4f')]);_0x486597[_0x0cce('0x50')]=qs[_0x0cce('0x46')](_[_0x0cce('0x51')](_0x29f64b[_0x0cce('0x45')],_0x33ff4e['filters']));_0x486597[_0x0cce('0x50')]['ChatWebsiteId']=_0xc50660['id'];if(_0x29f64b[_0x0cce('0x45')]['filter']){_0x486597[_0x0cce('0x50')]=_[_0x0cce('0x54')](_0x486597[_0x0cce('0x50')],{'$or':_['map'](_0x486597[_0x0cce('0x48')],function(_0xe59c50){var _0x59c402={};_0x59c402[_0xe59c50]={'$like':'%'+_0x29f64b[_0x0cce('0x45')][_0x0cce('0x52')]+'%'};return _0x59c402;})});}_0x486597=_[_0x0cce('0x54')]({},_0x486597,_0x29f64b[_0x0cce('0x55')]);return db[_0x0cce('0xdc')][_0x0cce('0x33')]({'where':_0x486597[_0x0cce('0x50')]})[_0x0cce('0x24')](function(_0x3f8822){_0x2ccceb[_0x0cce('0x33')]=_0x3f8822;if(_0x29f64b[_0x0cce('0x45')][_0x0cce('0x56')]){_0x486597[_0x0cce('0x57')]=[{'all':!![]}];}else{_0x486597['include']=[{'model':db[_0x0cce('0x90')],'as':_0x0cce('0xfe'),'required':![]},{'model':db['Attachment'],'as':_0x0cce('0x12d'),'required':![]}];}return db[_0x0cce('0xdc')]['findAll'](_0x486597);})[_0x0cce('0x24')](function(_0xf9c133){_0x2ccceb[_0x0cce('0x59')]=_0xf9c133;return _0x2ccceb;});}})['then'](respondWithFilteredResult(_0x2cdcce,_0x486597))['catch'](handleError(_0x2cdcce,null));};exports[_0x0cce('0x12e')]=function(_0x4632a5,_0x1cce77,_0x1f74e3){return db[_0x0cce('0x41')][_0x0cce('0x64')]({'where':{'id':_0x4632a5[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x1cce77,null))[_0x0cce('0x24')](function(_0x1d270a){if(_0x1d270a){return _0x1d270a[_0x0cce('0x12e')](_0x4632a5[_0x0cce('0x60')][_0x0cce('0x6e')],_['omit'](_0x4632a5['body'],[_0x0cce('0x6e'),'id'])||{})['spread'](function(_0x34db8c){for(var _0x4b730f=0x0;_0x4b730f<_0x4632a5[_0x0cce('0x60')][_0x0cce('0x6e')][_0x0cce('0x4a')];_0x4b730f+=0x1){socket[_0x0cce('0x12f')]('userChatWebsite:save',{'UserId':_0x4632a5[_0x0cce('0x60')][_0x0cce('0x6e')][_0x4b730f],'ChatWebsiteId':_0x4632a5['params']['id']});}return _0x34db8c;});}})[_0x0cce('0x24')](respondWithResult(_0x1cce77,null))[_0x0cce('0x5a')](handleError(_0x1cce77,null));};exports[_0x0cce('0x130')]=function(_0x22f3bc,_0x3f11f7,_0x54629e){return db['ChatWebsite']['find']({'where':{'id':_0x22f3bc[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x3f11f7,null))['then'](function(_0x42bed4){if(_0x42bed4){return _0x42bed4[_0x0cce('0x130')](_0x22f3bc[_0x0cce('0x45')][_0x0cce('0x6e')])[_0x0cce('0x24')](function(){if(_[_0x0cce('0x131')](_0x22f3bc[_0x0cce('0x45')][_0x0cce('0x6e')])){for(var _0x3af4f9=0x0;_0x3af4f9<_0x22f3bc[_0x0cce('0x45')][_0x0cce('0x6e')][_0x0cce('0x4a')];_0x3af4f9+=0x1){socket[_0x0cce('0x12f')](_0x0cce('0x132'),{'UserId':Number(_0x22f3bc['query'][_0x0cce('0x6e')][_0x3af4f9]),'ChatWebsiteId':Number(_0x22f3bc[_0x0cce('0x5c')]['id'])});}}else{socket[_0x0cce('0x12f')](_0x0cce('0x132'),{'UserId':Number(_0x22f3bc['query'][_0x0cce('0x6e')]),'ChatWebsiteId':Number(_0x22f3bc[_0x0cce('0x5c')]['id'])});}});}})[_0x0cce('0x24')](respondWithStatusCode(_0x3f11f7,null))['catch'](handleError(_0x3f11f7,null));};exports[_0x0cce('0x133')]=function(_0x174b33,_0x5eac45,_0x2bbad2){var _0x357035={};var _0x2db1f2={};var _0x40e010;var _0x31742f;return db[_0x0cce('0x41')][_0x0cce('0x6b')]({'where':{'id':_0x174b33[_0x0cce('0x5c')]['id']}})[_0x0cce('0x24')](handleEntityNotFound(_0x5eac45,null))['then'](function(_0x5786ae){if(_0x5786ae){_0x40e010=_0x5786ae;_0x2db1f2['model']=_[_0x0cce('0x5e')](db[_0x0cce('0xc9')][_0x0cce('0x42')]);_0x2db1f2[_0x0cce('0x45')]=_[_0x0cce('0x5e')](_0x174b33[_0x0cce('0x45')]);_0x2db1f2[_0x0cce('0x46')]=_['intersection'](_0x2db1f2['model'],_0x2db1f2[_0x0cce('0x45')]);_0x357035[_0x0cce('0x48')]=_['intersection'](_0x2db1f2[_0x0cce('0x44')],qs['fields'](_0x174b33[_0x0cce('0x45')][_0x0cce('0x49')]));_0x357035['attributes']=_0x357035[_0x0cce('0x48')][_0x0cce('0x4a')]?_0x357035[_0x0cce('0x48')]:_0x2db1f2['model'];_0x357035[_0x0cce('0x4e')]=qs[_0x0cce('0x4f')](_0x174b33[_0x0cce('0x45')]['sort']);_0x357035[_0x0cce('0x50')]=qs[_0x0cce('0x46')](_['pick'](_0x174b33[_0x0cce('0x45')],_0x2db1f2[_0x0cce('0x46')]));if(_0x174b33[_0x0cce('0x45')]['filter']){_0x357035[_0x0cce('0x50')]=_[_0x0cce('0x54')](_0x357035[_0x0cce('0x50')],{'$or':_[_0x0cce('0x40')](_0x357035[_0x0cce('0x48')],function(_0x6b296a){var _0x1f394b={};_0x1f394b[_0x6b296a]={'$like':'%'+_0x174b33['query'][_0x0cce('0x52')]+'%'};return _0x1f394b;})});}_0x357035=_[_0x0cce('0x54')]({},_0x357035,_0x174b33[_0x0cce('0x55')]);return _0x40e010[_0x0cce('0x133')](_0x357035);}})[_0x0cce('0x24')](function(_0x5a2ef4){if(_0x5a2ef4){_0x31742f=_0x5a2ef4['length'];if(!_0x174b33[_0x0cce('0x45')][_0x0cce('0x4b')](_0x0cce('0x4c'))){_0x357035['limit']=qs[_0x0cce('0x4d')](_0x174b33['query']['limit']);_0x357035[_0x0cce('0x31')]=qs[_0x0cce('0x31')](_0x174b33['query'][_0x0cce('0x31')]);}return _0x40e010[_0x0cce('0x133')](_0x357035);}})[_0x0cce('0x24')](function(_0x2aab6c){if(_0x2aab6c){return _0x2aab6c?{'count':_0x31742f,'rows':_0x2aab6c}:null;}})[_0x0cce('0x24')](respondWithResult(_0x5eac45,null))[_0x0cce('0x5a')](handleError(_0x5eac45,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 9f669de..d8ff8d4 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 _0x1fdc=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x249aea,_0x49ddc3){var _0x5d282f=function(_0x45e796){while(--_0x45e796){_0x249aea['push'](_0x249aea['shift']());}};_0x5d282f(++_0x49ddc3);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0x1fdc[_0x1fc4e2];return _0x2ba184;};'use strict';var EventEmitter=require(_0xc1fd('0x0'));var ChatWebsite=require(_0xc1fd('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc1fd('0x2')](0x0);var events={'afterCreate':_0xc1fd('0x3'),'afterUpdate':_0xc1fd('0x4'),'afterDestroy':_0xc1fd('0x5')};function emitEvent(_0x2218db){return function(_0x7fe059,_0x259024,_0x57b96f){ChatWebsiteEvents[_0xc1fd('0x6')](_0x2218db+':'+_0x7fe059['id'],_0x7fe059);ChatWebsiteEvents[_0xc1fd('0x6')](_0x2218db,_0x7fe059);_0x57b96f(null);};}for(var e in events){if(events[_0xc1fd('0x7')](e)){var event=events[e];ChatWebsite[_0xc1fd('0x8')](e,emitEvent(event));}}module[_0xc1fd('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xeb0d=['update','emit','hasOwnProperty','hook','events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x3c7f43,_0x538110){_0x3c7f43=_0x3c7f43-0x0;var _0x4e2e94=_0xeb0d[_0x3c7f43];return _0x4e2e94;};'use strict';var EventEmitter=require(_0xdeb0('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdeb0('0x1'),'afterUpdate':_0xdeb0('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3e6dea){return function(_0x36367c,_0xd8dd51,_0x2607a5){ChatWebsiteEvents[_0xdeb0('0x3')](_0x3e6dea+':'+_0x36367c['id'],_0x36367c);ChatWebsiteEvents[_0xdeb0('0x3')](_0x3e6dea,_0x36367c);_0x2607a5(null);};}for(var e in events){if(events[_0xdeb0('0x4')](e)){var event=events[e];ChatWebsite[_0xdeb0('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 9d81cca..f8a556e 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 _0xe9b5=['ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe9b5,0x1ba));var _0x5e9b=function(_0x47698,_0x4b4c01){_0x47698=_0x47698-0x0;var _0x11bc38=_0xe9b5[_0x47698];return _0x11bc38;};'use strict';var _=require('lodash');var util=require(_0x5e9b('0x0'));var logger=require(_0x5e9b('0x1'))(_0x5e9b('0x2'));var moment=require(_0x5e9b('0x3'));var BPromise=require(_0x5e9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e9b('0x5'));var config=require(_0x5e9b('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x5e9b('0x7')]=function(_0x45257f,_0x28258a){return _0x45257f[_0x5e9b('0x8')](_0x5e9b('0x9'),attributes,{'tableName':_0x5e9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87ad=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','moment','bluebird'];(function(_0xee5299,_0x447d5e){var _0x1d8451=function(_0x58acd4){while(--_0x58acd4){_0xee5299['push'](_0xee5299['shift']());}};_0x1d8451(++_0x447d5e);}(_0x87ad,0xdf));var _0xd87a=function(_0x4107f0,_0x5472b3){_0x4107f0=_0x4107f0-0x0;var _0x5c783f=_0x87ad[_0x4107f0];return _0x5c783f;};'use strict';var _=require(_0xd87a('0x0'));var util=require(_0xd87a('0x1'));var logger=require(_0xd87a('0x2'))('api');var moment=require(_0xd87a('0x3'));var BPromise=require(_0xd87a('0x4'));var rp=require(_0xd87a('0x5'));var fs=require('fs');var path=require(_0xd87a('0x6'));var rimraf=require('rimraf');var config=require(_0xd87a('0x7'));var attributes=require(_0xd87a('0x8'));module[_0xd87a('0x9')]=function(_0x32257d,_0xcb4c58){return _0x32257d[_0xd87a('0xa')](_0xd87a('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 5230294..126401f 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 _0xe4d2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x4c4683,_0x241657){var _0x78ee7e=function(_0x4c9489){while(--_0x4c9489){_0x4c4683['push'](_0x4c4683['shift']());}};_0x78ee7e(++_0x241657);}(_0xe4d2,0x13d));var _0x2e4d=function(_0xb47e97,_0x1c9b7b){_0xb47e97=_0xb47e97-0x0;var _0x3dc310=_0xe4d2[_0xb47e97];return _0x3dc310;};'use strict';var _=require(_0x2e4d('0x0'));var util=require(_0x2e4d('0x1'));var moment=require(_0x2e4d('0x2'));var BPromise=require(_0x2e4d('0x3'));var rs=require(_0x2e4d('0x4'));var fs=require('fs');var Redis=require(_0x2e4d('0x5'));var db=require(_0x2e4d('0x6'))['db'];var utils=require(_0x2e4d('0x7'));var logger=require(_0x2e4d('0x8'))(_0x2e4d('0x9'));var config=require(_0x2e4d('0xa'));var jayson=require(_0x2e4d('0xb'));var client=jayson[_0x2e4d('0xc')][_0x2e4d('0xd')]({'port':0x232a});config[_0x2e4d('0xe')]=_[_0x2e4d('0xf')](config[_0x2e4d('0xe')],{'host':_0x2e4d('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e4d('0xe')]));require(_0x2e4d('0x11'))['register'](socket);function respondWithRpcPromise(_0x1c3694,_0x3050cf,_0x45d7c8){return new BPromise(function(_0x300610,_0x45a95b){return client[_0x2e4d('0x12')](_0x1c3694,_0x45d7c8)[_0x2e4d('0x13')](function(_0x1c4750){logger[_0x2e4d('0x14')](_0x2e4d('0x15'),_0x3050cf,_0x2e4d('0x16'));logger['debug'](_0x2e4d('0x17'),_0x3050cf,_0x2e4d('0x16'),JSON[_0x2e4d('0x18')](_0x1c4750));if(_0x1c4750['error']){if(_0x1c4750['error']['code']===0x1f4){logger[_0x2e4d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3050cf,_0x1c4750[_0x2e4d('0x19')]['message']);return _0x45a95b(_0x1c4750[_0x2e4d('0x19')]['message']);}logger[_0x2e4d('0x19')](_0x2e4d('0x15'),_0x3050cf,_0x1c4750[_0x2e4d('0x19')][_0x2e4d('0x1a')]);return _0x300610(_0x1c4750[_0x2e4d('0x19')][_0x2e4d('0x1a')]);}else{logger[_0x2e4d('0x14')](_0x2e4d('0x15'),_0x3050cf,_0x2e4d('0x16'));_0x300610(_0x1c4750[_0x2e4d('0x1b')][_0x2e4d('0x1a')]);}})[_0x2e4d('0x1c')](function(_0x53d6cf){logger[_0x2e4d('0x19')](_0x2e4d('0x15'),_0x3050cf,_0x53d6cf);_0x45a95b(_0x53d6cf);});});} \ No newline at end of file +var _0x2971=['result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x2f6541,_0x31692f){var _0x34fb4f=function(_0x2e26ec){while(--_0x2e26ec){_0x2f6541['push'](_0x2f6541['shift']());}};_0x34fb4f(++_0x31692f);}(_0x2971,0xd0));var _0x1297=function(_0x3e591c,_0x806b8d){_0x3e591c=_0x3e591c-0x0;var _0x2cc037=_0x2971[_0x3e591c];return _0x2cc037;};'use strict';var _=require('lodash');var util=require(_0x1297('0x0'));var moment=require('moment');var BPromise=require(_0x1297('0x1'));var rs=require(_0x1297('0x2'));var fs=require('fs');var Redis=require(_0x1297('0x3'));var db=require(_0x1297('0x4'))['db'];var utils=require(_0x1297('0x5'));var logger=require(_0x1297('0x6'))(_0x1297('0x7'));var config=require(_0x1297('0x8'));var jayson=require(_0x1297('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1297('0xa')]=_[_0x1297('0xb')](config[_0x1297('0xa')],{'host':_0x1297('0xc'),'port':0x18eb});var socket=require(_0x1297('0xd'))(new Redis(config[_0x1297('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x480411,_0xa5c06e,_0x142c29){return new BPromise(function(_0x1053e6,_0x53a676){return client[_0x1297('0xe')](_0x480411,_0x142c29)['then'](function(_0xa46b8f){logger[_0x1297('0xf')](_0x1297('0x10'),_0xa5c06e,_0x1297('0x11'));logger[_0x1297('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xa5c06e,_0x1297('0x11'),JSON[_0x1297('0x13')](_0xa46b8f));if(_0xa46b8f[_0x1297('0x14')]){if(_0xa46b8f[_0x1297('0x14')]['code']===0x1f4){logger[_0x1297('0x14')](_0x1297('0x10'),_0xa5c06e,_0xa46b8f[_0x1297('0x14')][_0x1297('0x15')]);return _0x53a676(_0xa46b8f[_0x1297('0x14')][_0x1297('0x15')]);}logger[_0x1297('0x14')](_0x1297('0x10'),_0xa5c06e,_0xa46b8f['error'][_0x1297('0x15')]);return _0x1053e6(_0xa46b8f['error'][_0x1297('0x15')]);}else{logger[_0x1297('0xf')]('ChatWebsite,\x20%s,\x20%s',_0xa5c06e,_0x1297('0x11'));_0x1053e6(_0xa46b8f[_0x1297('0x16')][_0x1297('0x15')]);}})['catch'](function(_0x149b4a){logger['error'](_0x1297('0x10'),_0xa5c06e,_0x149b4a);_0x53a676(_0x149b4a);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index c60b921..133bf06 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 _0x3e45=['update','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x3ea6b4,_0x4572d1){var _0x2ccfb6=function(_0x1e27fc){while(--_0x1e27fc){_0x3ea6b4['push'](_0x3ea6b4['shift']());}};_0x2ccfb6(++_0x4572d1);}(_0x3e45,0x18a));var _0x53e4=function(_0x157902,_0x5e645b){_0x157902=_0x157902-0x0;var _0x35c56a=_0x3e45[_0x157902];return _0x35c56a;};'use strict';var ChatWebsiteEvents=require(_0x53e4('0x0'));var events=['save',_0x53e4('0x1'),_0x53e4('0x2')];function createListener(_0x22bb8a,_0x290556){return function(_0x1040ae){_0x290556['emit'](_0x22bb8a,_0x1040ae);};}function removeListener(_0x18bd8d,_0x4128a4){return function(){ChatWebsiteEvents['removeListener'](_0x18bd8d,_0x4128a4);};}exports[_0x53e4('0x3')]=function(_0x8243aa){for(var _0x4957c4=0x0,_0x2b04b1=events[_0x53e4('0x4')];_0x4957c4<_0x2b04b1;_0x4957c4++){var _0x6c82a3=events[_0x4957c4];var _0xd57d03=createListener(_0x53e4('0x5')+_0x6c82a3,_0x8243aa);ChatWebsiteEvents['on'](_0x6c82a3,_0xd57d03);}}; \ No newline at end of file +var _0x3a8f=['removeListener','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x493f96,_0x4d31a3){var _0x5137be=function(_0x43bdc2){while(--_0x43bdc2){_0x493f96['push'](_0x493f96['shift']());}};_0x5137be(++_0x4d31a3);}(_0x3a8f,0x112));var _0xf3a8=function(_0x319bad,_0x1fe44a){_0x319bad=_0x319bad-0x0;var _0x56987d=_0x3a8f[_0x319bad];return _0x56987d;};'use strict';var ChatWebsiteEvents=require(_0xf3a8('0x0'));var events=['save',_0xf3a8('0x1'),'update'];function createListener(_0x3dd011,_0x5a1bcc){return function(_0x4dda94){_0x5a1bcc['emit'](_0x3dd011,_0x4dda94);};}function removeListener(_0x4ddcd8,_0x16cce7){return function(){ChatWebsiteEvents[_0xf3a8('0x2')](_0x4ddcd8,_0x16cce7);};}exports[_0xf3a8('0x3')]=function(_0x1858c6){for(var _0x563fdb=0x0,_0x4bc499=events[_0xf3a8('0x4')];_0x563fdb<_0x4bc499;_0x563fdb++){var _0xe28c72=events[_0x563fdb];var _0x249ce4=createListener(_0xf3a8('0x5')+_0xe28c72,_0x1858c6);ChatWebsiteEvents['on'](_0xe28c72,_0x249ce4);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 8c07dc5..60ffcf8 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 _0x4e31=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','originalname','/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','now','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports'];(function(_0x281d28,_0x27ae5b){var _0x227e41=function(_0x4b39cb){while(--_0x4b39cb){_0x281d28['push'](_0x281d28['shift']());}};_0x227e41(++_0x27ae5b);}(_0x4e31,0xde));var _0x14e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e31[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x14e3('0x0'));var path=require(_0x14e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x14e3('0x2'));var router=express[_0x14e3('0x3')]();var fs_extra=require(_0x14e3('0x4'));var auth=require(_0x14e3('0x5'));var interaction=require(_0x14e3('0x6'));var config=require(_0x14e3('0x7'));var controller=require(_0x14e3('0x8'));router['get']('/',auth[_0x14e3('0x9')](),controller[_0x14e3('0xa')]);router[_0x14e3('0xb')](_0x14e3('0xc'),auth[_0x14e3('0x9')](),controller[_0x14e3('0xd')]);router[_0x14e3('0xb')](_0x14e3('0xe'),auth[_0x14e3('0x9')](),controller[_0x14e3('0xf')]);router[_0x14e3('0xb')](_0x14e3('0x10'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x11')]);router[_0x14e3('0xb')]('/:id/canned_answers',auth[_0x14e3('0x9')](),controller[_0x14e3('0x12')]);router[_0x14e3('0xb')]('/:id/logo',controller['getLogo']);router['get'](_0x14e3('0x13'),controller[_0x14e3('0x14')]);router[_0x14e3('0xb')](_0x14e3('0x15'),controller[_0x14e3('0x16')]);router[_0x14e3('0xb')](_0x14e3('0x17'),controller['getSystemAvatar']);router[_0x14e3('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x14e3('0x18')]);router[_0x14e3('0xb')](_0x14e3('0x19'),controller[_0x14e3('0x1a')]);router[_0x14e3('0xb')](_0x14e3('0x1b'),auth['isAuthenticated'](),controller[_0x14e3('0x1c')]);router[_0x14e3('0xb')](_0x14e3('0x1d'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x1e')]);router[_0x14e3('0xb')]('/:id/fields',controller[_0x14e3('0x1f')]);router[_0x14e3('0xb')]('/:id/offline_messages',auth[_0x14e3('0x9')](),controller[_0x14e3('0x20')]);router['get'](_0x14e3('0x21'),auth['isAuthenticated'](),controller[_0x14e3('0x22')]);router[_0x14e3('0x23')]('/',auth[_0x14e3('0x9')](),controller[_0x14e3('0x24')]);router['post'](_0x14e3('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x14e3('0x23')](_0x14e3('0x25'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x531256,_0x531359,_0x2e1b92){_0x2e1b92(null,path[_0x14e3('0x27')](config[_0x14e3('0x28')],_0x14e3('0x29')));},'filename':function(_0x530c05,_0x358c40,_0xb165ad){_0xb165ad(null,util[_0x14e3('0x2a')]('%s-%s',Date['now'](),_0x358c40[_0x14e3('0x2b')]));}})});router[_0x14e3('0x23')](_0x14e3('0x2c'),upload[_0x14e3('0x2d')](_0x14e3('0x2e')),controller[_0x14e3('0x2f')]);var upload=multer({'storage':multer[_0x14e3('0x30')]({'destination':function(_0x1167aa,_0x146625,_0xd6dad0){_0xd6dad0(null,path[_0x14e3('0x27')](config['root'],_0x14e3('0x31')));},'filename':function(_0x3a7ebe,_0x4bcdfa,_0xe7edcd){_0xe7edcd(null,util[_0x14e3('0x2a')](_0x14e3('0x32'),Date[_0x14e3('0x33')](),_0x4bcdfa[_0x14e3('0x2b')]));}})});router['post'](_0x14e3('0x13'),upload[_0x14e3('0x2d')](_0x14e3('0x2e')),controller[_0x14e3('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48dfd0,_0x5461a9,_0x4309bb){_0x4309bb(null,path['join'](config[_0x14e3('0x28')],_0x14e3('0x31')));},'filename':function(_0x4a14fe,_0x35ff0f,_0x5595a8){_0x5595a8(null,util['format'](_0x14e3('0x32'),Date[_0x14e3('0x33')](),_0x35ff0f['originalname']));}})});router['post']('/:id/customer_avatar',upload['single'](_0x14e3('0x2e')),controller[_0x14e3('0x35')]);var upload=multer({'storage':multer[_0x14e3('0x30')]({'destination':function(_0x544fb9,_0x1d6f6a,_0x3d0eb1){_0x3d0eb1(null,path['join'](config[_0x14e3('0x28')],'server/files/images/avatars/'));},'filename':function(_0x3469d1,_0x4d59a4,_0x41b46e){_0x41b46e(null,util[_0x14e3('0x2a')](_0x14e3('0x32'),Date[_0x14e3('0x33')](),_0x4d59a4[_0x14e3('0x2b')]));}})});router[_0x14e3('0x23')](_0x14e3('0x17'),upload['single'](_0x14e3('0x2e')),controller[_0x14e3('0x36')]);router[_0x14e3('0x23')](_0x14e3('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x14e3('0x30')]({'destination':function(_0x2fba3a,_0x5bf7e8,_0x53bf32){const _0xad759b=path['join'](config[_0x14e3('0x28')],_0x14e3('0x38'),'attachments','offline-chat');fs_extra[_0x14e3('0x39')](_0xad759b,function(){_0x53bf32(null,_0xad759b);});},'filename':function(_0x16a0f2,_0x18aff5,_0x3338a3){const _0x528e51=_0x18aff5['originalname'][_0x14e3('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1455e2=path[_0x14e3('0x3b')](_0x528e51);const _0x580ee1=Date[_0x14e3('0x33')]()+'-'+_0x528e51[_0x14e3('0x3a')](_0x1455e2,'')+_0x1455e2;_0x3338a3(null,_0x580ee1);}})});router[_0x14e3('0x23')](_0x14e3('0x3c'),offlineUploadMulter[_0x14e3('0x3d')](),controller[_0x14e3('0x3e')]);router[_0x14e3('0x23')]('/:id/interactions',auth[_0x14e3('0x9')](),controller[_0x14e3('0x3f')]);router['post']('/:id/applications',auth[_0x14e3('0x9')](),controller[_0x14e3('0x40')]);router[_0x14e3('0x23')]('/:id/proactive_actions',auth[_0x14e3('0x9')](),controller[_0x14e3('0x41')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x14e3('0x42')]);router[_0x14e3('0x43')]('/:id',auth[_0x14e3('0x9')](),controller[_0x14e3('0x44')]);router[_0x14e3('0x45')](_0x14e3('0xe'),auth['isAuthenticated'](),controller[_0x14e3('0x46')]);router['delete']('/:id/dispositions',auth[_0x14e3('0x9')](),controller[_0x14e3('0x47')]);router[_0x14e3('0x45')](_0x14e3('0x25'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x48')]);router[_0x14e3('0x45')]('/:id/users',auth[_0x14e3('0x9')](),controller['removeAgents']);module[_0x14e3('0x49')]=router; \ No newline at end of file +var _0x69d9=['/:id/snippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','addLogo','server/files/images/avatars/','%s-%s','/:id/avatar','file','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x574bc5,_0x566d15){var _0x151b01=function(_0x386da3){while(--_0x386da3){_0x574bc5['push'](_0x574bc5['shift']());}};_0x151b01(++_0x566d15);}(_0x69d9,0x1ec));var _0x969d=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0x69d9[_0x1030ce];return _0x3367fd;};'use strict';var multer=require(_0x969d('0x0'));var util=require(_0x969d('0x1'));var path=require(_0x969d('0x2'));var timeout=require(_0x969d('0x3'));var express=require(_0x969d('0x4'));var router=express[_0x969d('0x5')]();var fs_extra=require(_0x969d('0x6'));var auth=require(_0x969d('0x7'));var interaction=require(_0x969d('0x8'));var config=require('../../config/environment');var controller=require(_0x969d('0x9'));router[_0x969d('0xa')]('/',auth[_0x969d('0xb')](),controller['index']);router[_0x969d('0xa')](_0x969d('0xc'),auth[_0x969d('0xb')](),controller[_0x969d('0xd')]);router['get']('/:id',auth[_0x969d('0xb')](),controller[_0x969d('0xe')]);router[_0x969d('0xa')](_0x969d('0xf'),auth[_0x969d('0xb')](),controller['getDispositions']);router[_0x969d('0xa')]('/:id/canned_answers',auth[_0x969d('0xb')](),controller[_0x969d('0x10')]);router[_0x969d('0xa')](_0x969d('0x11'),controller[_0x969d('0x12')]);router['get']('/:id/avatar',controller[_0x969d('0x13')]);router['get'](_0x969d('0x14'),controller[_0x969d('0x15')]);router[_0x969d('0xa')](_0x969d('0x16'),controller[_0x969d('0x17')]);router['get'](_0x969d('0x18'),auth[_0x969d('0xb')](),controller[_0x969d('0x19')]);router[_0x969d('0xa')](_0x969d('0x1a'),controller['getSnippet']);router['get'](_0x969d('0x1b'),auth[_0x969d('0xb')](),controller[_0x969d('0x1c')]);router[_0x969d('0xa')]('/:id/proactive_actions',auth[_0x969d('0xb')](),controller['getProactiveActions']);router[_0x969d('0xa')](_0x969d('0x1d'),controller[_0x969d('0x1e')]);router[_0x969d('0xa')](_0x969d('0x1f'),auth[_0x969d('0xb')](),controller[_0x969d('0x20')]);router[_0x969d('0xa')](_0x969d('0x21'),auth[_0x969d('0xb')](),controller[_0x969d('0x22')]);router[_0x969d('0x23')]('/',auth['isAuthenticated'](),controller[_0x969d('0x24')]);router[_0x969d('0x23')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x969d('0x25')]);router[_0x969d('0x23')]('/:id/canned_answers',auth[_0x969d('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x969d('0x26')]({'destination':function(_0xb20a57,_0x162eef,_0x52ccd0){_0x52ccd0(null,path[_0x969d('0x27')](config[_0x969d('0x28')],_0x969d('0x29')));},'filename':function(_0x47253c,_0x31ca87,_0x4c86f8){_0x4c86f8(null,util[_0x969d('0x2a')]('%s-%s',Date[_0x969d('0x2b')](),_0x31ca87[_0x969d('0x2c')]));}})});router[_0x969d('0x23')](_0x969d('0x11'),upload[_0x969d('0x2d')]('file'),controller[_0x969d('0x2e')]);var upload=multer({'storage':multer[_0x969d('0x26')]({'destination':function(_0xef4bf5,_0x3240a6,_0x1de213){_0x1de213(null,path['join'](config[_0x969d('0x28')],_0x969d('0x2f')));},'filename':function(_0x4ddd08,_0x1436a4,_0x3a9d65){_0x3a9d65(null,util[_0x969d('0x2a')](_0x969d('0x30'),Date[_0x969d('0x2b')](),_0x1436a4[_0x969d('0x2c')]));}})});router[_0x969d('0x23')](_0x969d('0x31'),upload[_0x969d('0x2d')](_0x969d('0x32')),controller[_0x969d('0x33')]);var upload=multer({'storage':multer[_0x969d('0x26')]({'destination':function(_0x6141da,_0x2361d5,_0x1fb884){_0x1fb884(null,path['join'](config[_0x969d('0x28')],_0x969d('0x2f')));},'filename':function(_0x2fdc37,_0x283ab,_0x2f80c4){_0x2f80c4(null,util['format'](_0x969d('0x30'),Date[_0x969d('0x2b')](),_0x283ab[_0x969d('0x2c')]));}})});router[_0x969d('0x23')]('/:id/customer_avatar',upload[_0x969d('0x2d')](_0x969d('0x32')),controller[_0x969d('0x34')]);var upload=multer({'storage':multer[_0x969d('0x26')]({'destination':function(_0x859b05,_0x2779f8,_0x1d270f){_0x1d270f(null,path[_0x969d('0x27')](config[_0x969d('0x28')],_0x969d('0x2f')));},'filename':function(_0x458226,_0x1a420e,_0x24d825){_0x24d825(null,util[_0x969d('0x2a')](_0x969d('0x30'),Date[_0x969d('0x2b')](),_0x1a420e['originalname']));}})});router[_0x969d('0x23')](_0x969d('0x16'),upload[_0x969d('0x2d')]('file'),controller[_0x969d('0x35')]);router[_0x969d('0x23')](_0x969d('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x969d('0x26')]({'destination':function(_0x531ba6,_0x5a4f84,_0x4e9cee){const _0x4fe694=path[_0x969d('0x27')](config[_0x969d('0x28')],_0x969d('0x37'),_0x969d('0x38'),_0x969d('0x39'));fs_extra[_0x969d('0x3a')](_0x4fe694,function(){_0x4e9cee(null,_0x4fe694);});},'filename':function(_0xc20553,_0x5e8114,_0x372224){const _0x5e2418=_0x5e8114['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x30f64d=path['extname'](_0x5e2418);const _0x29423b=Date[_0x969d('0x2b')]()+'-'+_0x5e2418[_0x969d('0x3b')](_0x30f64d,'')+_0x30f64d;_0x372224(null,_0x29423b);}})});router[_0x969d('0x23')](_0x969d('0x3c'),offlineUploadMulter[_0x969d('0x3d')](),controller['offline']);router[_0x969d('0x23')](_0x969d('0x18'),auth['isAuthenticated'](),controller[_0x969d('0x3e')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x969d('0x3f')]);router[_0x969d('0x23')]('/:id/proactive_actions',auth[_0x969d('0xb')](),controller[_0x969d('0x40')]);router[_0x969d('0x23')](_0x969d('0x21'),auth[_0x969d('0xb')](),controller[_0x969d('0x41')]);router[_0x969d('0x42')](_0x969d('0x43'),auth[_0x969d('0xb')](),controller[_0x969d('0x44')]);router[_0x969d('0x45')](_0x969d('0x43'),auth[_0x969d('0xb')](),controller[_0x969d('0x46')]);router[_0x969d('0x45')](_0x969d('0xf'),auth[_0x969d('0xb')](),controller['removeDispositions']);router['delete'](_0x969d('0x47'),auth[_0x969d('0xb')](),controller[_0x969d('0x48')]);router['delete'](_0x969d('0x21'),auth[_0x969d('0xb')](),controller['removeAgents']);module[_0x969d('0x49')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 48ba2fe..d32daf7 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 _0x0adf=['Google','sequelize','exports','STRING','AmazonAWS'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x36d761,_0x4b990d){_0x36d761=_0x36d761-0x0;var _0x557f89=_0x0adf[_0x36d761];return _0x557f89;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf0ad('0x3'),_0xf0ad('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf0ad('0x2')]},'data2':{'type':Sequelize[_0xf0ad('0x2')]}}; \ No newline at end of file +var _0x9a14=['STRING','ENUM','AmazonAWS','Google'];(function(_0x57bff0,_0x3567b1){var _0x30b143=function(_0x801da6){while(--_0x801da6){_0x57bff0['push'](_0x57bff0['shift']());}};_0x30b143(++_0x3567b1);}(_0x9a14,0xa8));var _0x49a1=function(_0x10c582,_0x2b48e8){_0x10c582=_0x10c582-0x0;var _0x481c44=_0x9a14[_0x10c582];return _0x481c44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49a1('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x49a1('0x1')](_0x49a1('0x2'),_0x49a1('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x49a1('0x0')]},'data2':{'type':Sequelize[_0x49a1('0x0')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 5ff999d..368f182 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(_0x17b14a,_0x107e50){var _0xad4dcd=function(_0x4b273e){while(--_0x4b273e){_0x17b14a['push'](_0x17b14a['shift']());}};_0xad4dcd(++_0x107e50);}(_0x2ef3,0xba));var _0x32ef=function(_0x4e11bd,_0x2f09f1){_0x4e11bd=_0x4e11bd-0x0;var _0x4ab61=_0x2ef3[_0x4e11bd];return _0x4ab61;};'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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x450d4d,_0x201a7e){var _0x440901=function(_0x24e8f4){while(--_0x24e8f4){_0x450d4d['push'](_0x450d4d['shift']());}};_0x440901(++_0x201a7e);}(_0xdb28,0x106));var _0x8db2=function(_0x26068b,_0x4e342b){_0x26068b=_0x26068b-0x0;var _0x21f295=_0xdb28[_0x26068b];return _0x21f295;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 7bd11d8..770cedc 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 _0x2e54=['rimraf','../../config/environment','exports','define','CloudProvider','util','../../config/logger','bluebird','request-promise','path'];(function(_0x203664,_0x1536a4){var _0x992217=function(_0x13e657){while(--_0x13e657){_0x203664['push'](_0x203664['shift']());}};_0x992217(++_0x1536a4);}(_0x2e54,0x177));var _0x42e5=function(_0x565ad7,_0x103661){_0x565ad7=_0x565ad7-0x0;var _0x3a9ab6=_0x2e54[_0x565ad7];return _0x3a9ab6;};'use strict';var _=require('lodash');var util=require(_0x42e5('0x0'));var logger=require(_0x42e5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x42e5('0x2'));var rp=require(_0x42e5('0x3'));var fs=require('fs');var path=require(_0x42e5('0x4'));var rimraf=require(_0x42e5('0x5'));var config=require(_0x42e5('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x42e5('0x7')]=function(_0x39ce44,_0x48ed00){return _0x39ce44[_0x42e5('0x8')](_0x42e5('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3772=['../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x111bab,_0x271498){var _0x5999fa=function(_0x9512f4){while(--_0x9512f4){_0x111bab['push'](_0x111bab['shift']());}};_0x5999fa(++_0x271498);}(_0x3772,0x10c));var _0x2377=function(_0x3e0f52,_0x3754e6){_0x3e0f52=_0x3e0f52-0x0;var _0xc558fd=_0x3772[_0x3e0f52];return _0xc558fd;};'use strict';var _=require(_0x2377('0x0'));var util=require(_0x2377('0x1'));var logger=require(_0x2377('0x2'))(_0x2377('0x3'));var moment=require('moment');var BPromise=require(_0x2377('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2377('0x5'));var rimraf=require(_0x2377('0x6'));var config=require(_0x2377('0x7'));var attributes=require(_0x2377('0x8'));module[_0x2377('0x9')]=function(_0x24bf4f,_0x547c81){return _0x24bf4f['define']('CloudProvider',attributes,{'tableName':_0x2377('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index ff1b1c5..dcd2af0 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 _0xf5b6=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x4bdd60,_0x4ae128){var _0x2023cf=function(_0x1261f2){while(--_0x1261f2){_0x4bdd60['push'](_0x4bdd60['shift']());}};_0x2023cf(++_0x4ae128);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x467e48,_0x37186c){_0x467e48=_0x467e48-0x0;var _0xd62dbd=_0xf5b6[_0x467e48];return _0xd62dbd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f5b('0x0'));var BPromise=require(_0x6f5b('0x1'));var rs=require(_0x6f5b('0x2'));var fs=require('fs');var Redis=require(_0x6f5b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f5b('0x4'));var logger=require(_0x6f5b('0x5'))(_0x6f5b('0x6'));var config=require(_0x6f5b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cf395,_0x58899e,_0x4a8fe8){return new BPromise(function(_0x437f27,_0x5b97a4){return client[_0x6f5b('0x9')](_0x5cf395,_0x4a8fe8)[_0x6f5b('0xa')](function(_0x17692b){logger['info'](_0x6f5b('0xb'),_0x58899e,'request\x20sent');logger[_0x6f5b('0xc')](_0x6f5b('0xd'),_0x58899e,_0x6f5b('0xe'),JSON[_0x6f5b('0xf')](_0x17692b));if(_0x17692b[_0x6f5b('0x10')]){if(_0x17692b['error'][_0x6f5b('0x11')]===0x1f4){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b['error']['message']);return _0x5b97a4(_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);}logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);return _0x437f27(_0x17692b[_0x6f5b('0x10')]['message']);}else{logger[_0x6f5b('0x13')](_0x6f5b('0xb'),_0x58899e,'request\x20sent');_0x437f27(_0x17692b[_0x6f5b('0x14')][_0x6f5b('0x12')]);}})[_0x6f5b('0x15')](function(_0x344cf6){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x344cf6);_0x5b97a4(_0x344cf6);});});} \ No newline at end of file +var _0xda20=['http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda20,0x1d9));var _0x0da2=function(_0x4fca8d,_0x2bda9e){_0x4fca8d=_0x4fca8d-0x0;var _0x24ea3c=_0xda20[_0x4fca8d];return _0x24ea3c;};'use strict';var _=require(_0x0da2('0x0'));var util=require('util');var moment=require(_0x0da2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0da2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0da2('0x3'));var logger=require(_0x0da2('0x4'))('rpc');var config=require(_0x0da2('0x5'));var jayson=require(_0x0da2('0x6'));var client=jayson['client'][_0x0da2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x292ede,_0x166a32,_0x3aa0c5){return new BPromise(function(_0x1e5150,_0x1069a6){return client[_0x0da2('0x8')](_0x292ede,_0x3aa0c5)[_0x0da2('0x9')](function(_0x248bce){logger['info'](_0x0da2('0xa'),_0x166a32,_0x0da2('0xb'));logger[_0x0da2('0xc')](_0x0da2('0xd'),_0x166a32,'request\x20sent',JSON['stringify'](_0x248bce));if(_0x248bce[_0x0da2('0xe')]){if(_0x248bce[_0x0da2('0xe')][_0x0da2('0xf')]===0x1f4){logger[_0x0da2('0xe')](_0x0da2('0xa'),_0x166a32,_0x248bce[_0x0da2('0xe')][_0x0da2('0x10')]);return _0x1069a6(_0x248bce['error'][_0x0da2('0x10')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x166a32,_0x248bce['error'][_0x0da2('0x10')]);return _0x1e5150(_0x248bce['error'][_0x0da2('0x10')]);}else{logger[_0x0da2('0x11')]('CloudProvider,\x20%s,\x20%s',_0x166a32,_0x0da2('0xb'));_0x1e5150(_0x248bce[_0x0da2('0x12')]['message']);}})[_0x0da2('0x13')](function(_0x192772){logger[_0x0da2('0xe')]('CloudProvider,\x20%s,\x20%s',_0x166a32,_0x192772);_0x1069a6(_0x192772);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 98914ad..a93abca 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 _0x6bf1=['create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','/:id','isAuthenticated','show','post'];(function(_0x55b815,_0x3a444c){var _0x23ffcc=function(_0x2c45f7){while(--_0x2c45f7){_0x55b815['push'](_0x55b815['shift']());}};_0x23ffcc(++_0x3a444c);}(_0x6bf1,0x71));var _0x16bf=function(_0x14d0d2,_0x2ad908){_0x14d0d2=_0x14d0d2-0x0;var _0x57b04e=_0x6bf1[_0x14d0d2];return _0x57b04e;};'use strict';var multer=require(_0x16bf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x16bf('0x1'));var express=require(_0x16bf('0x2'));var router=express[_0x16bf('0x3')]();var fs_extra=require(_0x16bf('0x4'));var auth=require(_0x16bf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x16bf('0x6'));var controller=require(_0x16bf('0x7'));router[_0x16bf('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x16bf('0x8')](_0x16bf('0x9'),auth[_0x16bf('0xa')](),controller[_0x16bf('0xb')]);router[_0x16bf('0xc')]('/',auth[_0x16bf('0xa')](),controller[_0x16bf('0xd')]);router[_0x16bf('0xe')]('/:id',auth[_0x16bf('0xa')](),controller[_0x16bf('0xf')]);router[_0x16bf('0x10')](_0x16bf('0x9'),auth[_0x16bf('0xa')](),controller[_0x16bf('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2237=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','create','delete'];(function(_0x4bfab6,_0x1e772a){var _0x16f920=function(_0x56cde6){while(--_0x56cde6){_0x4bfab6['push'](_0x4bfab6['shift']());}};_0x16f920(++_0x1e772a);}(_0x2237,0x124));var _0x7223=function(_0x3fb617,_0x4979c3){_0x3fb617=_0x3fb617-0x0;var _0x3adc42=_0x2237[_0x3fb617];return _0x3adc42;};'use strict';var multer=require(_0x7223('0x0'));var util=require(_0x7223('0x1'));var path=require(_0x7223('0x2'));var timeout=require(_0x7223('0x3'));var express=require(_0x7223('0x4'));var router=express[_0x7223('0x5')]();var fs_extra=require(_0x7223('0x6'));var auth=require(_0x7223('0x7'));var interaction=require(_0x7223('0x8'));var config=require(_0x7223('0x9'));var controller=require('./cloudProvider.controller');router[_0x7223('0xa')]('/',auth[_0x7223('0xb')](),controller['index']);router[_0x7223('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7223('0xc')]);router['put']('/:id',auth[_0x7223('0xb')](),controller['update']);router[_0x7223('0xd')](_0x7223('0xe'),auth['isAuthenticated'](),controller[_0x7223('0xf')]);module[_0x7223('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 69d70b9..7134c71 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 _0x6d93=['exports','STRING','name','sequelize'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6d93,0x177));var _0x36d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d93[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x36d9('0x0'));module[_0x36d9('0x1')]={'name':{'type':Sequelize[_0x36d9('0x2')],'unique':_0x36d9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x36d9('0x2')]},'companyId':{'type':Sequelize[_0x36d9('0x2')]},'website':{'type':Sequelize[_0x36d9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x36d9('0x2')]},'type':{'type':Sequelize[_0x36d9('0x2')]},'street':{'type':Sequelize[_0x36d9('0x2')]},'postalCode':{'type':Sequelize[_0x36d9('0x2')]},'city':{'type':Sequelize[_0x36d9('0x2')]},'country':{'type':Sequelize[_0x36d9('0x2')]},'email':{'type':Sequelize[_0x36d9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x36d9('0x2')]},'sCity':{'type':Sequelize[_0x36d9('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x36d9('0x2')]}}; \ No newline at end of file +var _0xe38a=['name','exports','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe38a,0x1d2));var _0xae38=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xe38a[_0x5b7788];return _0x573871;};'use strict';var Sequelize=require('sequelize');module[_0xae38('0x0')]={'name':{'type':Sequelize[_0xae38('0x1')],'unique':_0xae38('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xae38('0x1')]},'companyId':{'type':Sequelize[_0xae38('0x1')]},'website':{'type':Sequelize[_0xae38('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xae38('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xae38('0x1')]},'postalCode':{'type':Sequelize[_0xae38('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xae38('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 5231e56..2794d13 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 _0x1968=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','send','index','CmCompany','describe','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','map','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find'];(function(_0x13597a,_0xa42c9e){var _0x26f558=function(_0x5ad90e){while(--_0x5ad90e){_0x13597a['push'](_0x13597a['shift']());}};_0x26f558(++_0xa42c9e);}(_0x1968,0xbe));var _0x8196=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1968[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x8196('0x0'));var rimraf=require(_0x8196('0x1'));var zipdir=require(_0x8196('0x2'));var jsonpatch=require(_0x8196('0x3'));var rp=require(_0x8196('0x4'));var moment=require(_0x8196('0x5'));var BPromise=require(_0x8196('0x6'));var Mustache=require(_0x8196('0x7'));var util=require('util');var path=require(_0x8196('0x8'));var sox=require(_0x8196('0x9'));var csv=require(_0x8196('0xa'));var ejs=require(_0x8196('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8196('0xc'));var squel=require(_0x8196('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8196('0xe'));var toCsv=require(_0x8196('0xa'));var querystring=require(_0x8196('0xf'));var Papa=require(_0x8196('0x10'));var Redis=require(_0x8196('0x11'));var authService=require(_0x8196('0x12'));var qs=require(_0x8196('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8196('0x14'));var logger=require(_0x8196('0x15'))(_0x8196('0x16'));var utils=require(_0x8196('0x17'));var config=require(_0x8196('0x18'));var licenseUtil=require(_0x8196('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c35c7,_0x29075e){_0x29075e=_0x29075e||0xcc;return function(_0x7952ac){if(_0x7952ac){return _0x1c35c7['sendStatus'](_0x29075e);}return _0x1c35c7[_0x8196('0x1a')](_0x29075e)[_0x8196('0x1b')]();};}function respondWithResult(_0x1fe3ce,_0x553e60){_0x553e60=_0x553e60||0xc8;return function(_0x46393f){if(_0x46393f){return _0x1fe3ce[_0x8196('0x1a')](_0x553e60)['json'](_0x46393f);}};}function respondWithFilteredResult(_0x8c97af,_0x815dcd){return function(_0x549bd5){if(_0x549bd5){var _0x3340bf=typeof _0x815dcd['offset']===_0x8196('0x1c')&&typeof _0x815dcd[_0x8196('0x1d')]===_0x8196('0x1c');var _0x289460=_0x549bd5[_0x8196('0x1e')];var _0x298dee=_0x3340bf?0x0:_0x815dcd[_0x8196('0x1f')];var _0x1e9299=_0x3340bf?_0x549bd5['count']:_0x815dcd[_0x8196('0x1f')]+_0x815dcd[_0x8196('0x1d')];var _0x1f5051;if(_0x1e9299>=_0x289460){_0x1e9299=_0x289460;_0x1f5051=0xc8;}else{_0x1f5051=0xce;}_0x8c97af[_0x8196('0x1a')](_0x1f5051);return _0x8c97af[_0x8196('0x20')](_0x8196('0x21'),_0x298dee+'-'+_0x1e9299+'/'+_0x289460)[_0x8196('0x22')](_0x549bd5);}return null;};}function patchUpdates(_0x5a1624){return function(_0x3951fa){try{jsonpatch['apply'](_0x3951fa,_0x5a1624,!![]);}catch(_0x83ce3c){return BPromise[_0x8196('0x23')](_0x83ce3c);}return _0x3951fa[_0x8196('0x24')]();};}function saveUpdates(_0x544fb0,_0x8e2ad7){return function(_0xcfc96d){if(_0xcfc96d){return _0xcfc96d[_0x8196('0x25')](_0x544fb0)[_0x8196('0x26')](function(_0x2c600a){return _0x2c600a;});}return null;};}function removeEntity(_0x455c76,_0x2b153f){return function(_0x298e7f){if(_0x298e7f){return _0x298e7f[_0x8196('0x27')]()[_0x8196('0x26')](function(){var _0x3dbc2d=_0x298e7f[_0x8196('0x28')]({'plain':!![]});var _0x565956=_0x8196('0x29');return db[_0x8196('0x2a')][_0x8196('0x27')]({'where':{'type':_0x565956,'resourceId':_0x3dbc2d['id']}})[_0x8196('0x26')](function(){return _0x298e7f;});})['then'](function(){_0x455c76[_0x8196('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x802568,_0x30cff2){return function(_0x596ac9){if(!_0x596ac9){_0x802568[_0x8196('0x2b')](0x194);}return _0x596ac9;};}function handleError(_0x10f99e,_0x3198ff){_0x3198ff=_0x3198ff||0x1f4;return function(_0x2ebc61){logger['error'](_0x2ebc61[_0x8196('0x2c')]);if(_0x2ebc61['name']){delete _0x2ebc61['name'];}_0x10f99e[_0x8196('0x1a')](_0x3198ff)[_0x8196('0x2d')](_0x2ebc61);};}exports[_0x8196('0x2e')]=function(_0x5e2f3d,_0x2291da){var _0x51916c={},_0x117993={},_0x2021bb={'count':0x0,'rows':[]};return db[_0x8196('0x2f')][_0x8196('0x30')]()['then'](function(_0x12f716){_0x117993['model']=_['keys'](_0x12f716);_0x117993[_0x8196('0x31')]=_[_0x8196('0x32')](_0x5e2f3d[_0x8196('0x31')]);_0x117993['filters']=_[_0x8196('0x33')](_0x117993[_0x8196('0x34')],_0x117993[_0x8196('0x31')]);_0x51916c[_0x8196('0x35')]=_['intersection'](_0x117993[_0x8196('0x34')],qs[_0x8196('0x36')](_0x5e2f3d['query'][_0x8196('0x36')]));_0x51916c[_0x8196('0x35')]=_0x51916c[_0x8196('0x35')][_0x8196('0x37')]?_0x51916c['attributes']:_0x117993[_0x8196('0x34')];if(!_0x5e2f3d[_0x8196('0x31')][_0x8196('0x38')]('nolimit')){_0x51916c[_0x8196('0x1d')]=qs[_0x8196('0x1d')](_0x5e2f3d[_0x8196('0x31')]['limit']);_0x51916c[_0x8196('0x1f')]=qs[_0x8196('0x1f')](_0x5e2f3d[_0x8196('0x31')][_0x8196('0x1f')]);}_0x51916c[_0x8196('0x39')]=qs[_0x8196('0x3a')](_0x5e2f3d[_0x8196('0x31')]['sort']);_0x51916c['where']=qs[_0x8196('0x3b')](_[_0x8196('0x3c')](_0x5e2f3d[_0x8196('0x31')],_0x117993[_0x8196('0x3b')]),_0x12f716);if(_0x5e2f3d['query']['filter']){_0x51916c[_0x8196('0x3d')]=_[_0x8196('0x3e')](_0x51916c[_0x8196('0x3d')],{'$or':_[_0x8196('0x3f')](_0x51916c[_0x8196('0x35')],function(_0x30479f){var _0xd0ef19={};_0xd0ef19[_0x30479f]={'$like':'%'+_0x5e2f3d[_0x8196('0x31')][_0x8196('0x40')]+'%'};return _0xd0ef19;})});}_0x51916c=_[_0x8196('0x3e')]({},_0x51916c,_0x5e2f3d[_0x8196('0x41')]);var _0x31373e={'where':_0x51916c[_0x8196('0x3d')]};return db['CmCompany'][_0x8196('0x1e')](_0x31373e)[_0x8196('0x26')](function(_0x316e34){_0x2021bb[_0x8196('0x1e')]=_0x316e34;if(_0x5e2f3d[_0x8196('0x31')][_0x8196('0x42')]){_0x51916c[_0x8196('0x43')]=[{'all':!![]}];}return db[_0x8196('0x2f')]['findAll'](_0x51916c);})[_0x8196('0x26')](function(_0x3b1663){_0x2021bb[_0x8196('0x44')]=_0x3b1663;return _0x2021bb;})['then'](respondWithFilteredResult(_0x2291da,_0x51916c))[_0x8196('0x45')](handleError(_0x2291da,null));})[_0x8196('0x45')](handleError(_0x2291da,null));};exports[_0x8196('0x46')]=function(_0x2347db,_0xa9abae){var _0x330956={'raw':![],'where':{'id':_0x2347db[_0x8196('0x47')]['id']}},_0x409000={};_0x409000['model']=_[_0x8196('0x32')](db['CmCompany'][_0x8196('0x48')]);_0x409000[_0x8196('0x31')]=_[_0x8196('0x32')](_0x2347db[_0x8196('0x31')]);_0x409000[_0x8196('0x3b')]=_['intersection'](_0x409000['model'],_0x409000['query']);_0x330956[_0x8196('0x35')]=_['intersection'](_0x409000[_0x8196('0x34')],qs[_0x8196('0x36')](_0x2347db['query'][_0x8196('0x36')]));_0x330956['attributes']=_0x330956[_0x8196('0x35')][_0x8196('0x37')]?_0x330956[_0x8196('0x35')]:_0x409000[_0x8196('0x34')];if(_0x2347db[_0x8196('0x31')][_0x8196('0x42')]){_0x330956[_0x8196('0x43')]=[{'all':!![]}];}_0x330956=_[_0x8196('0x3e')]({},_0x330956,_0x2347db[_0x8196('0x41')]);return db[_0x8196('0x2f')][_0x8196('0x49')](_0x330956)['then'](handleEntityNotFound(_0xa9abae,null))[_0x8196('0x26')](respondWithResult(_0xa9abae,null))['catch'](handleError(_0xa9abae,null));};exports['create']=function(_0x534e12,_0x3c24a6){return db[_0x8196('0x2f')][_0x8196('0x4a')](_0x534e12[_0x8196('0x4b')],{})[_0x8196('0x26')](function(_0x5dc097){var _0x133f82=_0x534e12[_0x8196('0x4c')]['get']({'plain':!![]});if(!_0x133f82)throw new Error(_0x8196('0x4d'));if(_0x133f82[_0x8196('0x4e')]==='user'){var _0xa19cc7=_0x5dc097['get']({'plain':!![]});var _0x2cbe37=_0x8196('0x29');return db[_0x8196('0x4f')]['find']({'where':{'name':_0x2cbe37,'userProfileId':_0x133f82[_0x8196('0x50')]},'raw':!![]})[_0x8196('0x26')](function(_0x2b42e9){if(_0x2b42e9&&_0x2b42e9['autoAssociation']===0x0){return db['UserProfileResource'][_0x8196('0x4a')]({'name':_0xa19cc7[_0x8196('0x51')],'resourceId':_0xa19cc7['id'],'type':_0x2b42e9['name'],'sectionId':_0x2b42e9['id']},{})['then'](function(){return _0x5dc097;});}else{return _0x5dc097;}})[_0x8196('0x45')](function(_0x3ea31d){logger[_0x8196('0x52')](_0x8196('0x53'),_0x3ea31d);throw _0x3ea31d;});}return _0x5dc097;})[_0x8196('0x26')](respondWithResult(_0x3c24a6,0xc9))[_0x8196('0x45')](handleError(_0x3c24a6,null));};exports['update']=function(_0x5c460f,_0x2763bd){if(_0x5c460f[_0x8196('0x4b')]['id']){delete _0x5c460f[_0x8196('0x4b')]['id'];}return db[_0x8196('0x2f')][_0x8196('0x49')]({'where':{'id':_0x5c460f[_0x8196('0x47')]['id']}})[_0x8196('0x26')](handleEntityNotFound(_0x2763bd,null))['then'](saveUpdates(_0x5c460f[_0x8196('0x4b')],null))[_0x8196('0x26')](respondWithResult(_0x2763bd,null))[_0x8196('0x45')](handleError(_0x2763bd,null));};exports[_0x8196('0x27')]=function(_0x339015,_0x3e6874){return db[_0x8196('0x2f')][_0x8196('0x49')]({'where':{'id':_0x339015[_0x8196('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e6874,null))['then'](removeEntity(_0x3e6874,null))['catch'](handleError(_0x3e6874,null));};exports[_0x8196('0x30')]=function(_0x4b643e,_0x133607){return db[_0x8196('0x2f')][_0x8196('0x30')]()[_0x8196('0x26')](respondWithResult(_0x133607,null))[_0x8196('0x45')](handleError(_0x133607,null));};exports['addContacts']=function(_0x16c622,_0x47a3de,_0x8ad250){return db['CmContact'][_0x8196('0x49')]({'where':{'id':_0x16c622[_0x8196('0x47')]['id']}})[_0x8196('0x26')](handleEntityNotFound(_0x47a3de,null))[_0x8196('0x26')](function(_0x186a47){if(_0x186a47){return _0x186a47[_0x8196('0x54')](_0x16c622[_0x8196('0x4b')][_0x8196('0x55')],_['omit'](_0x16c622['body'],[_0x8196('0x55'),'id'])||{});}})['then'](respondWithResult(_0x47a3de,null))[_0x8196('0x45')](handleError(_0x47a3de,null));};exports[_0x8196('0x56')]=function(_0x5c2363,_0x1bccf8,_0x3db629){var _0x394aba={};var _0x4e333c={};var _0x89ed28;var _0x59dfa4;return db[_0x8196('0x2f')]['findOne']({'where':{'id':_0x5c2363['params']['id']}})[_0x8196('0x26')](handleEntityNotFound(_0x1bccf8,null))[_0x8196('0x26')](function(_0x4a3bfe){if(_0x4a3bfe){_0x89ed28=_0x4a3bfe;_0x4e333c[_0x8196('0x34')]=_['keys'](db['CmContact'][_0x8196('0x48')]);_0x4e333c['query']=_[_0x8196('0x32')](_0x5c2363['query']);_0x4e333c[_0x8196('0x3b')]=_[_0x8196('0x33')](_0x4e333c[_0x8196('0x34')],_0x4e333c[_0x8196('0x31')]);_0x394aba['attributes']=_['intersection'](_0x4e333c[_0x8196('0x34')],qs[_0x8196('0x36')](_0x5c2363[_0x8196('0x31')][_0x8196('0x36')]));_0x394aba[_0x8196('0x35')]=_0x394aba['attributes'][_0x8196('0x37')]?_0x394aba['attributes']:_0x4e333c['model'];_0x394aba['order']=qs[_0x8196('0x3a')](_0x5c2363[_0x8196('0x31')]['sort']);_0x394aba['where']=qs['filters'](_[_0x8196('0x3c')](_0x5c2363['query'],_0x4e333c[_0x8196('0x3b')]));if(_0x5c2363['query'][_0x8196('0x40')]){_0x394aba['where']=_[_0x8196('0x3e')](_0x394aba[_0x8196('0x3d')],{'$or':_[_0x8196('0x3f')](_0x394aba[_0x8196('0x35')],function(_0x10f549){var _0x37cc08={};_0x37cc08[_0x10f549]={'$like':'%'+_0x5c2363[_0x8196('0x31')]['filter']+'%'};return _0x37cc08;})});}_0x394aba=_[_0x8196('0x3e')]({},_0x394aba,_0x5c2363[_0x8196('0x41')]);return _0x89ed28[_0x8196('0x56')](_0x394aba);}})['then'](function(_0xe4d10b){if(_0xe4d10b){_0x59dfa4=_0xe4d10b[_0x8196('0x37')];if(!_0x5c2363[_0x8196('0x31')]['hasOwnProperty'](_0x8196('0x57'))){_0x394aba[_0x8196('0x1d')]=qs['limit'](_0x5c2363['query'][_0x8196('0x1d')]);_0x394aba[_0x8196('0x1f')]=qs[_0x8196('0x1f')](_0x5c2363[_0x8196('0x31')][_0x8196('0x1f')]);}return _0x89ed28[_0x8196('0x56')](_0x394aba);}})[_0x8196('0x26')](function(_0x355b3a){if(_0x355b3a){return _0x355b3a?{'count':_0x59dfa4,'rows':_0x355b3a}:null;}})['then'](respondWithResult(_0x1bccf8,null))[_0x8196('0x45')](handleError(_0x1bccf8,null));}; \ No newline at end of file +var _0xfbe3=['destroy','sendStatus','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','body','addContacts','CmContact','params','ids','omit','getContacts','findOne','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','reject','save','update','then','get','Companies','UserProfileResource'];(function(_0xd9b1f6,_0x29df15){var _0x4299c7=function(_0x3f5b98){while(--_0x3f5b98){_0xd9b1f6['push'](_0xd9b1f6['shift']());}};_0x4299c7(++_0x29df15);}(_0xfbe3,0x8b));var _0x3fbe=function(_0x595a21,_0x24790f){_0x595a21=_0x595a21-0x0;var _0x50df84=_0xfbe3[_0x595a21];return _0x50df84;};'use strict';var emlformat=require(_0x3fbe('0x0'));var rimraf=require(_0x3fbe('0x1'));var zipdir=require(_0x3fbe('0x2'));var jsonpatch=require(_0x3fbe('0x3'));var rp=require(_0x3fbe('0x4'));var moment=require(_0x3fbe('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3fbe('0x6'));var path=require(_0x3fbe('0x7'));var sox=require(_0x3fbe('0x8'));var csv=require(_0x3fbe('0x9'));var ejs=require(_0x3fbe('0xa'));var fs=require('fs');var fs_extra=require(_0x3fbe('0xb'));var _=require(_0x3fbe('0xc'));var squel=require(_0x3fbe('0xd'));var crypto=require(_0x3fbe('0xe'));var jsforce=require(_0x3fbe('0xf'));var deskjs=require(_0x3fbe('0x10'));var toCsv=require(_0x3fbe('0x9'));var querystring=require(_0x3fbe('0x11'));var Papa=require(_0x3fbe('0x12'));var Redis=require(_0x3fbe('0x13'));var authService=require(_0x3fbe('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3fbe('0x15'));var hardwareService=require(_0x3fbe('0x16'));var logger=require(_0x3fbe('0x17'))(_0x3fbe('0x18'));var utils=require(_0x3fbe('0x19'));var config=require(_0x3fbe('0x1a'));var licenseUtil=require(_0x3fbe('0x1b'));var db=require(_0x3fbe('0x1c'))['db'];function respondWithStatusCode(_0x15ebc1,_0x4f7bb2){_0x4f7bb2=_0x4f7bb2||0xcc;return function(_0x467187){if(_0x467187){return _0x15ebc1['sendStatus'](_0x4f7bb2);}return _0x15ebc1['status'](_0x4f7bb2)[_0x3fbe('0x1d')]();};}function respondWithResult(_0x3e7dc1,_0x1beb54){_0x1beb54=_0x1beb54||0xc8;return function(_0x358700){if(_0x358700){return _0x3e7dc1[_0x3fbe('0x1e')](_0x1beb54)['json'](_0x358700);}};}function respondWithFilteredResult(_0x5cf384,_0x250c11){return function(_0x5d3d2d){if(_0x5d3d2d){var _0x5f1554=typeof _0x250c11['offset']===_0x3fbe('0x1f')&&typeof _0x250c11[_0x3fbe('0x20')]==='undefined';var _0x4d7ab4=_0x5d3d2d[_0x3fbe('0x21')];var _0x10f42a=_0x5f1554?0x0:_0x250c11[_0x3fbe('0x22')];var _0x455ed4=_0x5f1554?_0x5d3d2d[_0x3fbe('0x21')]:_0x250c11[_0x3fbe('0x22')]+_0x250c11['limit'];var _0x182f6f;if(_0x455ed4>=_0x4d7ab4){_0x455ed4=_0x4d7ab4;_0x182f6f=0xc8;}else{_0x182f6f=0xce;}_0x5cf384['status'](_0x182f6f);return _0x5cf384[_0x3fbe('0x23')]('Content-Range',_0x10f42a+'-'+_0x455ed4+'/'+_0x4d7ab4)['json'](_0x5d3d2d);}return null;};}function patchUpdates(_0x1b58bd){return function(_0x32bb4c){try{jsonpatch['apply'](_0x32bb4c,_0x1b58bd,!![]);}catch(_0x5afdec){return BPromise[_0x3fbe('0x24')](_0x5afdec);}return _0x32bb4c[_0x3fbe('0x25')]();};}function saveUpdates(_0x2eb877,_0x26f29f){return function(_0x4fd4b2){if(_0x4fd4b2){return _0x4fd4b2[_0x3fbe('0x26')](_0x2eb877)[_0x3fbe('0x27')](function(_0x48f4bd){return _0x48f4bd;});}return null;};}function removeEntity(_0x305851,_0x36acf0){return function(_0x2068bf){if(_0x2068bf){return _0x2068bf['destroy']()['then'](function(){var _0x178e50=_0x2068bf[_0x3fbe('0x28')]({'plain':!![]});var _0x37d6be=_0x3fbe('0x29');return db[_0x3fbe('0x2a')][_0x3fbe('0x2b')]({'where':{'type':_0x37d6be,'resourceId':_0x178e50['id']}})[_0x3fbe('0x27')](function(){return _0x2068bf;});})[_0x3fbe('0x27')](function(){_0x305851[_0x3fbe('0x1e')](0xcc)[_0x3fbe('0x1d')]();});}};}function handleEntityNotFound(_0xa24537,_0x3f85c5){return function(_0x193b29){if(!_0x193b29){_0xa24537[_0x3fbe('0x2c')](0x194);}return _0x193b29;};}function handleError(_0x21fbe1,_0x56cf43){_0x56cf43=_0x56cf43||0x1f4;return function(_0x181414){logger['error'](_0x181414[_0x3fbe('0x2d')]);if(_0x181414['name']){delete _0x181414[_0x3fbe('0x2e')];}_0x21fbe1[_0x3fbe('0x1e')](_0x56cf43)[_0x3fbe('0x2f')](_0x181414);};}exports[_0x3fbe('0x30')]=function(_0x5db5f1,_0x29254a){var _0x110d16={},_0x2ba606={},_0x1e592b={'count':0x0,'rows':[]};return db[_0x3fbe('0x31')][_0x3fbe('0x32')]()[_0x3fbe('0x27')](function(_0x212df8){_0x2ba606[_0x3fbe('0x33')]=_[_0x3fbe('0x34')](_0x212df8);_0x2ba606[_0x3fbe('0x35')]=_[_0x3fbe('0x34')](_0x5db5f1['query']);_0x2ba606[_0x3fbe('0x36')]=_[_0x3fbe('0x37')](_0x2ba606[_0x3fbe('0x33')],_0x2ba606[_0x3fbe('0x35')]);_0x110d16[_0x3fbe('0x38')]=_[_0x3fbe('0x37')](_0x2ba606['model'],qs[_0x3fbe('0x39')](_0x5db5f1['query'][_0x3fbe('0x39')]));_0x110d16['attributes']=_0x110d16[_0x3fbe('0x38')][_0x3fbe('0x3a')]?_0x110d16[_0x3fbe('0x38')]:_0x2ba606[_0x3fbe('0x33')];if(!_0x5db5f1[_0x3fbe('0x35')][_0x3fbe('0x3b')](_0x3fbe('0x3c'))){_0x110d16[_0x3fbe('0x20')]=qs[_0x3fbe('0x20')](_0x5db5f1[_0x3fbe('0x35')]['limit']);_0x110d16[_0x3fbe('0x22')]=qs[_0x3fbe('0x22')](_0x5db5f1[_0x3fbe('0x35')][_0x3fbe('0x22')]);}_0x110d16[_0x3fbe('0x3d')]=qs[_0x3fbe('0x3e')](_0x5db5f1[_0x3fbe('0x35')][_0x3fbe('0x3e')]);_0x110d16[_0x3fbe('0x3f')]=qs['filters'](_['pick'](_0x5db5f1['query'],_0x2ba606[_0x3fbe('0x36')]),_0x212df8);if(_0x5db5f1[_0x3fbe('0x35')][_0x3fbe('0x40')]){_0x110d16['where']=_[_0x3fbe('0x41')](_0x110d16[_0x3fbe('0x3f')],{'$or':_[_0x3fbe('0x42')](_0x110d16['attributes'],function(_0x4ace60){var _0x471b55={};_0x471b55[_0x4ace60]={'$like':'%'+_0x5db5f1['query'][_0x3fbe('0x40')]+'%'};return _0x471b55;})});}_0x110d16=_[_0x3fbe('0x41')]({},_0x110d16,_0x5db5f1[_0x3fbe('0x43')]);var _0x4aaed9={'where':_0x110d16['where']};return db[_0x3fbe('0x31')]['count'](_0x4aaed9)[_0x3fbe('0x27')](function(_0x4ee89b){_0x1e592b[_0x3fbe('0x21')]=_0x4ee89b;if(_0x5db5f1[_0x3fbe('0x35')][_0x3fbe('0x44')]){_0x110d16[_0x3fbe('0x45')]=[{'all':!![]}];}return db[_0x3fbe('0x31')][_0x3fbe('0x46')](_0x110d16);})[_0x3fbe('0x27')](function(_0x4d166e){_0x1e592b[_0x3fbe('0x47')]=_0x4d166e;return _0x1e592b;})[_0x3fbe('0x27')](respondWithFilteredResult(_0x29254a,_0x110d16))[_0x3fbe('0x48')](handleError(_0x29254a,null));})[_0x3fbe('0x48')](handleError(_0x29254a,null));};exports[_0x3fbe('0x49')]=function(_0x3e5db4,_0x5e8955){var _0xcb2697={'raw':![],'where':{'id':_0x3e5db4['params']['id']}},_0x5ec42c={};_0x5ec42c[_0x3fbe('0x33')]=_[_0x3fbe('0x34')](db[_0x3fbe('0x31')][_0x3fbe('0x4a')]);_0x5ec42c[_0x3fbe('0x35')]=_[_0x3fbe('0x34')](_0x3e5db4[_0x3fbe('0x35')]);_0x5ec42c[_0x3fbe('0x36')]=_['intersection'](_0x5ec42c['model'],_0x5ec42c[_0x3fbe('0x35')]);_0xcb2697[_0x3fbe('0x38')]=_[_0x3fbe('0x37')](_0x5ec42c[_0x3fbe('0x33')],qs['fields'](_0x3e5db4[_0x3fbe('0x35')]['fields']));_0xcb2697[_0x3fbe('0x38')]=_0xcb2697[_0x3fbe('0x38')][_0x3fbe('0x3a')]?_0xcb2697['attributes']:_0x5ec42c['model'];if(_0x3e5db4[_0x3fbe('0x35')][_0x3fbe('0x44')]){_0xcb2697[_0x3fbe('0x45')]=[{'all':!![]}];}_0xcb2697=_['merge']({},_0xcb2697,_0x3e5db4[_0x3fbe('0x43')]);return db[_0x3fbe('0x31')][_0x3fbe('0x4b')](_0xcb2697)['then'](handleEntityNotFound(_0x5e8955,null))[_0x3fbe('0x27')](respondWithResult(_0x5e8955,null))[_0x3fbe('0x48')](handleError(_0x5e8955,null));};exports[_0x3fbe('0x4c')]=function(_0x1b9753,_0x57a6ff){return db[_0x3fbe('0x31')][_0x3fbe('0x4c')](_0x1b9753['body'],{})[_0x3fbe('0x27')](function(_0x5d8154){var _0x462677=_0x1b9753[_0x3fbe('0x4d')][_0x3fbe('0x28')]({'plain':!![]});if(!_0x462677)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x462677['role']===_0x3fbe('0x4d')){var _0x13333d=_0x5d8154[_0x3fbe('0x28')]({'plain':!![]});var _0xa8f759='Companies';return db[_0x3fbe('0x4e')][_0x3fbe('0x4b')]({'where':{'name':_0xa8f759,'userProfileId':_0x462677[_0x3fbe('0x4f')]},'raw':!![]})['then'](function(_0x245f61){if(_0x245f61&&_0x245f61[_0x3fbe('0x50')]===0x0){return db[_0x3fbe('0x2a')][_0x3fbe('0x4c')]({'name':_0x13333d[_0x3fbe('0x2e')],'resourceId':_0x13333d['id'],'type':_0x245f61[_0x3fbe('0x2e')],'sectionId':_0x245f61['id']},{})[_0x3fbe('0x27')](function(){return _0x5d8154;});}else{return _0x5d8154;}})[_0x3fbe('0x48')](function(_0x33c3d9){logger[_0x3fbe('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33c3d9);throw _0x33c3d9;});}return _0x5d8154;})[_0x3fbe('0x27')](respondWithResult(_0x57a6ff,0xc9))['catch'](handleError(_0x57a6ff,null));};exports[_0x3fbe('0x26')]=function(_0x41e70c,_0x1b0d99){if(_0x41e70c[_0x3fbe('0x52')]['id']){delete _0x41e70c[_0x3fbe('0x52')]['id'];}return db[_0x3fbe('0x31')]['find']({'where':{'id':_0x41e70c['params']['id']}})[_0x3fbe('0x27')](handleEntityNotFound(_0x1b0d99,null))[_0x3fbe('0x27')](saveUpdates(_0x41e70c[_0x3fbe('0x52')],null))[_0x3fbe('0x27')](respondWithResult(_0x1b0d99,null))[_0x3fbe('0x48')](handleError(_0x1b0d99,null));};exports[_0x3fbe('0x2b')]=function(_0xf7582f,_0x2e0405){return db['CmCompany'][_0x3fbe('0x4b')]({'where':{'id':_0xf7582f['params']['id']}})['then'](handleEntityNotFound(_0x2e0405,null))['then'](removeEntity(_0x2e0405,null))[_0x3fbe('0x48')](handleError(_0x2e0405,null));};exports[_0x3fbe('0x32')]=function(_0x174992,_0x8f8ffa){return db[_0x3fbe('0x31')][_0x3fbe('0x32')]()[_0x3fbe('0x27')](respondWithResult(_0x8f8ffa,null))[_0x3fbe('0x48')](handleError(_0x8f8ffa,null));};exports[_0x3fbe('0x53')]=function(_0x2eef73,_0x2b427e,_0x47b888){return db[_0x3fbe('0x54')][_0x3fbe('0x4b')]({'where':{'id':_0x2eef73[_0x3fbe('0x55')]['id']}})['then'](handleEntityNotFound(_0x2b427e,null))[_0x3fbe('0x27')](function(_0x39d513){if(_0x39d513){return _0x39d513[_0x3fbe('0x53')](_0x2eef73[_0x3fbe('0x52')][_0x3fbe('0x56')],_[_0x3fbe('0x57')](_0x2eef73[_0x3fbe('0x52')],['ids','id'])||{});}})[_0x3fbe('0x27')](respondWithResult(_0x2b427e,null))[_0x3fbe('0x48')](handleError(_0x2b427e,null));};exports[_0x3fbe('0x58')]=function(_0x428fba,_0x17ba06,_0x474335){var _0x574106={};var _0x7e3354={};var _0x1d63f3;var _0x181b5a;return db[_0x3fbe('0x31')][_0x3fbe('0x59')]({'where':{'id':_0x428fba['params']['id']}})[_0x3fbe('0x27')](handleEntityNotFound(_0x17ba06,null))[_0x3fbe('0x27')](function(_0x3d7cf5){if(_0x3d7cf5){_0x1d63f3=_0x3d7cf5;_0x7e3354[_0x3fbe('0x33')]=_[_0x3fbe('0x34')](db[_0x3fbe('0x54')][_0x3fbe('0x4a')]);_0x7e3354[_0x3fbe('0x35')]=_[_0x3fbe('0x34')](_0x428fba[_0x3fbe('0x35')]);_0x7e3354[_0x3fbe('0x36')]=_['intersection'](_0x7e3354[_0x3fbe('0x33')],_0x7e3354[_0x3fbe('0x35')]);_0x574106[_0x3fbe('0x38')]=_[_0x3fbe('0x37')](_0x7e3354[_0x3fbe('0x33')],qs[_0x3fbe('0x39')](_0x428fba[_0x3fbe('0x35')][_0x3fbe('0x39')]));_0x574106[_0x3fbe('0x38')]=_0x574106[_0x3fbe('0x38')][_0x3fbe('0x3a')]?_0x574106[_0x3fbe('0x38')]:_0x7e3354[_0x3fbe('0x33')];_0x574106[_0x3fbe('0x3d')]=qs['sort'](_0x428fba[_0x3fbe('0x35')][_0x3fbe('0x3e')]);_0x574106[_0x3fbe('0x3f')]=qs['filters'](_[_0x3fbe('0x5a')](_0x428fba['query'],_0x7e3354[_0x3fbe('0x36')]));if(_0x428fba[_0x3fbe('0x35')]['filter']){_0x574106[_0x3fbe('0x3f')]=_['merge'](_0x574106[_0x3fbe('0x3f')],{'$or':_[_0x3fbe('0x42')](_0x574106[_0x3fbe('0x38')],function(_0x45e4cc){var _0x56ce31={};_0x56ce31[_0x45e4cc]={'$like':'%'+_0x428fba[_0x3fbe('0x35')]['filter']+'%'};return _0x56ce31;})});}_0x574106=_['merge']({},_0x574106,_0x428fba[_0x3fbe('0x43')]);return _0x1d63f3[_0x3fbe('0x58')](_0x574106);}})[_0x3fbe('0x27')](function(_0x1375b2){if(_0x1375b2){_0x181b5a=_0x1375b2[_0x3fbe('0x3a')];if(!_0x428fba[_0x3fbe('0x35')][_0x3fbe('0x3b')](_0x3fbe('0x3c'))){_0x574106['limit']=qs[_0x3fbe('0x20')](_0x428fba['query']['limit']);_0x574106[_0x3fbe('0x22')]=qs[_0x3fbe('0x22')](_0x428fba[_0x3fbe('0x35')][_0x3fbe('0x22')]);}return _0x1d63f3[_0x3fbe('0x58')](_0x574106);}})[_0x3fbe('0x27')](function(_0x2d7c14){if(_0x2d7c14){return _0x2d7c14?{'count':_0x181b5a,'rows':_0x2d7c14}:null;}})['then'](respondWithResult(_0x17ba06,null))['catch'](handleError(_0x17ba06,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 799be9c..30d4623 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 _0x8c0c=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','util','api','bluebird'];(function(_0xac3b20,_0x48e68c){var _0x580caf=function(_0xa07fcd){while(--_0xa07fcd){_0xac3b20['push'](_0xac3b20['shift']());}};_0x580caf(++_0x48e68c);}(_0x8c0c,0x8c));var _0xc8c0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c0c[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xc8c0('0x0'));var logger=require('../../config/logger')(_0xc8c0('0x1'));var moment=require('moment');var BPromise=require(_0xc8c0('0x2'));var rp=require(_0xc8c0('0x3'));var fs=require('fs');var path=require(_0xc8c0('0x4'));var rimraf=require(_0xc8c0('0x5'));var config=require(_0xc8c0('0x6'));var attributes=require(_0xc8c0('0x7'));module[_0xc8c0('0x8')]=function(_0x19ed6a,_0x2d56cd){return _0x19ed6a[_0xc8c0('0x9')](_0xc8c0('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16b2=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','cm_companies','util','api'];(function(_0x476b9f,_0x12b9a7){var _0x3a43bf=function(_0x232a9d){while(--_0x232a9d){_0x476b9f['push'](_0x476b9f['shift']());}};_0x3a43bf(++_0x12b9a7);}(_0x16b2,0x102));var _0x216b=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x16b2[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require('lodash');var util=require(_0x216b('0x0'));var logger=require('../../config/logger')(_0x216b('0x1'));var moment=require(_0x216b('0x2'));var BPromise=require(_0x216b('0x3'));var rp=require(_0x216b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x216b('0x5'));var config=require(_0x216b('0x6'));var attributes=require(_0x216b('0x7'));module[_0x216b('0x8')]=function(_0x252906,_0x45373b){return _0x252906['define']('CmCompany',attributes,{'tableName':_0x216b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 5df8e28..8c0c9e3 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 _0xeb15=['code','CmCompany,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','error'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0xeb15,0x1d7));var _0x5eb1=function(_0x4af3b7,_0x30c116){_0x4af3b7=_0x4af3b7-0x0;var _0x24727c=_0xeb15[_0x4af3b7];return _0x24727c;};'use strict';var _=require(_0x5eb1('0x0'));var util=require(_0x5eb1('0x1'));var moment=require(_0x5eb1('0x2'));var BPromise=require(_0x5eb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5eb1('0x4'));var db=require(_0x5eb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5eb1('0x6'))('rpc');var config=require(_0x5eb1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5eb1('0x8')][_0x5eb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a7e18,_0x190d89,_0x4a02cd){return new BPromise(function(_0x2f5436,_0x44880d){return client[_0x5eb1('0xa')](_0x3a7e18,_0x4a02cd)[_0x5eb1('0xb')](function(_0x45c9d9){logger[_0x5eb1('0xc')]('CmCompany,\x20%s,\x20%s',_0x190d89,_0x5eb1('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x190d89,_0x5eb1('0xd'),JSON['stringify'](_0x45c9d9));if(_0x45c9d9[_0x5eb1('0xe')]){if(_0x45c9d9[_0x5eb1('0xe')][_0x5eb1('0xf')]===0x1f4){logger['error'](_0x5eb1('0x10'),_0x190d89,_0x45c9d9[_0x5eb1('0xe')]['message']);return _0x44880d(_0x45c9d9[_0x5eb1('0xe')][_0x5eb1('0x11')]);}logger['error'](_0x5eb1('0x10'),_0x190d89,_0x45c9d9[_0x5eb1('0xe')][_0x5eb1('0x11')]);return _0x2f5436(_0x45c9d9['error']['message']);}else{logger['info'](_0x5eb1('0x10'),_0x190d89,'request\x20sent');_0x2f5436(_0x45c9d9['result'][_0x5eb1('0x11')]);}})['catch'](function(_0x212e84){logger[_0x5eb1('0xe')]('CmCompany,\x20%s,\x20%s',_0x190d89,_0x212e84);_0x44880d(_0x212e84);});});} \ No newline at end of file +var _0x3b5b=['ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring'];(function(_0x5a6d57,_0x1f1eaa){var _0x5d2c23=function(_0x118ac5){while(--_0x118ac5){_0x5a6d57['push'](_0x5a6d57['shift']());}};_0x5d2c23(++_0x1f1eaa);}(_0x3b5b,0x114));var _0xb3b5=function(_0x45f6cb,_0x531af6){_0x45f6cb=_0x45f6cb-0x0;var _0x5b7f93=_0x3b5b[_0x45f6cb];return _0x5b7f93;};'use strict';var _=require(_0xb3b5('0x0'));var util=require(_0xb3b5('0x1'));var moment=require('moment');var BPromise=require(_0xb3b5('0x2'));var rs=require(_0xb3b5('0x3'));var fs=require('fs');var Redis=require(_0xb3b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb3b5('0x5'));var config=require(_0xb3b5('0x6'));var jayson=require(_0xb3b5('0x7'));var client=jayson[_0xb3b5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28582f,_0x2e445b,_0x197ce7){return new BPromise(function(_0x1583a7,_0x10d11d){return client[_0xb3b5('0x9')](_0x28582f,_0x197ce7)[_0xb3b5('0xa')](function(_0x5c09c5){logger[_0xb3b5('0xb')]('CmCompany,\x20%s,\x20%s',_0x2e445b,_0xb3b5('0xc'));logger[_0xb3b5('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2e445b,_0xb3b5('0xc'),JSON[_0xb3b5('0xe')](_0x5c09c5));if(_0x5c09c5[_0xb3b5('0xf')]){if(_0x5c09c5[_0xb3b5('0xf')][_0xb3b5('0x10')]===0x1f4){logger[_0xb3b5('0xf')]('CmCompany,\x20%s,\x20%s',_0x2e445b,_0x5c09c5[_0xb3b5('0xf')][_0xb3b5('0x11')]);return _0x10d11d(_0x5c09c5['error']['message']);}logger[_0xb3b5('0xf')](_0xb3b5('0x12'),_0x2e445b,_0x5c09c5[_0xb3b5('0xf')]['message']);return _0x1583a7(_0x5c09c5['error'][_0xb3b5('0x11')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x2e445b,_0xb3b5('0xc'));_0x1583a7(_0x5c09c5[_0xb3b5('0x13')][_0xb3b5('0x11')]);}})['catch'](function(_0x750472){logger[_0xb3b5('0xf')](_0xb3b5('0x12'),_0x2e445b,_0x750472);_0x10d11d(_0x750472);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 65d481c..ae4227a 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 _0xc4bb=['addContacts','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create'];(function(_0x4bcc45,_0x42eece){var _0x325ca1=function(_0x282385){while(--_0x282385){_0x4bcc45['push'](_0x4bcc45['shift']());}};_0x325ca1(++_0x42eece);}(_0xc4bb,0x1e6));var _0xbc4b=function(_0x18b11c,_0x31b58d){_0x18b11c=_0x18b11c-0x0;var _0xeeb6cf=_0xc4bb[_0x18b11c];return _0xeeb6cf;};'use strict';var multer=require('multer');var util=require(_0xbc4b('0x0'));var path=require('path');var timeout=require(_0xbc4b('0x1'));var express=require(_0xbc4b('0x2'));var router=express[_0xbc4b('0x3')]();var fs_extra=require(_0xbc4b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbc4b('0x5'));var config=require(_0xbc4b('0x6'));var controller=require(_0xbc4b('0x7'));router[_0xbc4b('0x8')]('/',auth[_0xbc4b('0x9')](),controller[_0xbc4b('0xa')]);router['get'](_0xbc4b('0xb'),auth[_0xbc4b('0x9')](),controller[_0xbc4b('0xc')]);router[_0xbc4b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbc4b('0xd')]);router[_0xbc4b('0x8')](_0xbc4b('0xe'),auth['isAuthenticated'](),controller[_0xbc4b('0xf')]);router[_0xbc4b('0x10')]('/',auth[_0xbc4b('0x9')](),controller[_0xbc4b('0x11')]);router[_0xbc4b('0x10')](_0xbc4b('0xe'),auth[_0xbc4b('0x9')](),controller[_0xbc4b('0x12')]);router[_0xbc4b('0x13')]('/:id',auth[_0xbc4b('0x9')](),controller[_0xbc4b('0x14')]);router[_0xbc4b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbc4b('0x16')]);module[_0xbc4b('0x17')]=router; \ No newline at end of file +var _0x9c43=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x9c43,0x156));var _0x39c4=function(_0x35bad0,_0x21927d){_0x35bad0=_0x35bad0-0x0;var _0x4fe50f=_0x9c43[_0x35bad0];return _0x4fe50f;};'use strict';var multer=require(_0x39c4('0x0'));var util=require(_0x39c4('0x1'));var path=require('path');var timeout=require(_0x39c4('0x2'));var express=require(_0x39c4('0x3'));var router=express[_0x39c4('0x4')]();var fs_extra=require(_0x39c4('0x5'));var auth=require(_0x39c4('0x6'));var interaction=require(_0x39c4('0x7'));var config=require(_0x39c4('0x8'));var controller=require(_0x39c4('0x9'));router[_0x39c4('0xa')]('/',auth[_0x39c4('0xb')](),controller['index']);router[_0x39c4('0xa')](_0x39c4('0xc'),auth[_0x39c4('0xb')](),controller[_0x39c4('0xd')]);router['get'](_0x39c4('0xe'),auth[_0x39c4('0xb')](),controller[_0x39c4('0xf')]);router[_0x39c4('0xa')](_0x39c4('0x10'),auth[_0x39c4('0xb')](),controller[_0x39c4('0x11')]);router[_0x39c4('0x12')]('/',auth['isAuthenticated'](),controller[_0x39c4('0x13')]);router['post'](_0x39c4('0x10'),auth[_0x39c4('0xb')](),controller[_0x39c4('0x14')]);router[_0x39c4('0x15')](_0x39c4('0xe'),auth[_0x39c4('0xb')](),controller[_0x39c4('0x16')]);router[_0x39c4('0x17')]('/:id',auth[_0x39c4('0xb')](),controller[_0x39c4('0x18')]);module[_0x39c4('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 2c26220..bd7bc09 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 _0x3f2f=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0xc77c92,_0x8a9f1){var _0x51319b=function(_0x45b041){while(--_0x45b041){_0xc77c92['push'](_0xc77c92['shift']());}};_0x51319b(++_0x8a9f1);}(_0x3f2f,0xf7));var _0xf3f2=function(_0x522d05,_0x350cda){_0x522d05=_0x522d05-0x0;var _0xedc4f7=_0x3f2f[_0x522d05];return _0xedc4f7;};'use strict';var _=require(_0xf3f2('0x0'));var Sequelize=require(_0xf3f2('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xf3f2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf3f2('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf3f2('0x2')]},'country':{'type':Sequelize[_0xf3f2('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf3f2('0x2')]},'description':{'type':Sequelize[_0xf3f2('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf3f2('0x2')]},'email':{'type':Sequelize[_0xf3f2('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xf3f2('0x2')]},'fb_data':{'type':Sequelize[_0xf3f2('0x2')]},'twitter':{'type':Sequelize[_0xf3f2('0x2')]},'skype':{'type':Sequelize[_0xf3f2('0x2')]},'teams':{'type':Sequelize[_0xf3f2('0x2')]},'viber':{'type':Sequelize[_0xf3f2('0x2')]},'line':{'type':Sequelize[_0xf3f2('0x2')]},'wechat':{'type':Sequelize[_0xf3f2('0x2')]},'telegram':{'type':Sequelize[_0xf3f2('0x2')]},'UserId':{'type':Sequelize[_0xf3f2('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf3f2('0x5')],'defaultValue':Sequelize[_0xf3f2('0x6')]}}; \ No newline at end of file +var _0x31d4=['sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31d4,0x14f));var _0x431d=function(_0x276221,_0x378da4){_0x276221=_0x276221-0x0;var _0x4fa716=_0x31d4[_0x276221];return _0x4fa716;};'use strict';var _=require(_0x431d('0x0'));var Sequelize=require(_0x431d('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x431d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x431d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x431d('0x2')]},'city':{'type':Sequelize[_0x431d('0x2')]},'country':{'type':Sequelize[_0x431d('0x2')]},'dateOfBirth':{'type':Sequelize[_0x431d('0x2')]},'description':{'type':Sequelize[_0x431d('0x3')]},'phone':{'type':Sequelize[_0x431d('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x431d('0x2')]},'email':{'type':Sequelize[_0x431d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x431d('0x2')]},'twitter':{'type':Sequelize[_0x431d('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x431d('0x2')]},'viber':{'type':Sequelize[_0x431d('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x431d('0x2')]},'telegram':{'type':Sequelize[_0x431d('0x2')]},'UserId':{'type':Sequelize[_0x431d('0x4')]},'priority':{'type':Sequelize[_0x431d('0x4')](0x2)[_0x431d('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x431d('0x6')],'defaultValue':Sequelize[_0x431d('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 33665a5..58153c4 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 _0x1218=['c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','CmContact','tags','columnName','displayName','custom','values','body','findAll','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','show','params','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','options','getTags','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','firstName','root','server/files/tmp','file','filename','chmodSync','fork','CompanyId','socket_timestamp','pid','createReadStream','parse','meta','import','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','child_process','stringify','message','exit','getJourney','sms','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','mail','openchannel','externalUrl','startCase','Interaction','flatten','sortBy','slice','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','name','send','index','describe','keys','startsWith','cf_','CmCustomField','all','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','length','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','dateOfBirth','fieldType','datetime','castTo','DATE','text','start','filter','isNil','push','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','getFullTextValue','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax'];(function(_0x2196b7,_0x3c0dc6){var _0x220543=function(_0x575dee){while(--_0x575dee){_0x2196b7['push'](_0x2196b7['shift']());}};_0x220543(++_0x3c0dc6);}(_0x1218,0x1b6));var _0x8121=function(_0x149bec,_0x1907ad){_0x149bec=_0x149bec-0x0;var _0x2b42cf=_0x1218[_0x149bec];return _0x2b42cf;};'use strict';var emlformat=require(_0x8121('0x0'));var rimraf=require(_0x8121('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8121('0x2'));var rp=require(_0x8121('0x3'));var moment=require(_0x8121('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8121('0x5'));var path=require(_0x8121('0x6'));var sox=require(_0x8121('0x7'));var csv=require(_0x8121('0x8'));var ejs=require(_0x8121('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8121('0xa'));var squel=require(_0x8121('0xb'));var crypto=require('crypto');var jsforce=require(_0x8121('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8121('0x8'));var querystring=require('querystring');var Papa=require(_0x8121('0xd'));var Redis=require(_0x8121('0xe'));var authService=require(_0x8121('0xf'));var qs=require(_0x8121('0x10'));var as=require(_0x8121('0x11'));var hardwareService=require(_0x8121('0x12'));var logger=require(_0x8121('0x13'))(_0x8121('0x14'));var utils=require(_0x8121('0x15'));var config=require(_0x8121('0x16'));var licenseUtil=require(_0x8121('0x17'));var db=require('../../mysqldb')['db'];config[_0x8121('0x18')]=_[_0x8121('0x19')](config[_0x8121('0x18')],{'host':_0x8121('0x1a'),'port':0x18eb});var socket=require(_0x8121('0x1b'))(new Redis(config[_0x8121('0x18')]));require('./cmContact.socket')[_0x8121('0x1c')](socket);function respondWithStatusCode(_0x5bec4f,_0x2338f1){_0x2338f1=_0x2338f1||0xcc;return function(_0x20a78d){if(_0x20a78d){return _0x5bec4f[_0x8121('0x1d')](_0x2338f1);}return _0x5bec4f[_0x8121('0x1e')](_0x2338f1)[_0x8121('0x1f')]();};}function respondWithResult(_0x1dc04b,_0x3f8bdf){_0x3f8bdf=_0x3f8bdf||0xc8;return function(_0x2e0f12){if(_0x2e0f12){return _0x1dc04b[_0x8121('0x1e')](_0x3f8bdf)['json'](_0x2e0f12);}};}function respondWithFilteredResult(_0x304851,_0x506949){return function(_0x258812){if(_0x258812){var _0x3fbf0d=typeof _0x506949[_0x8121('0x20')]===_0x8121('0x21')&&typeof _0x506949[_0x8121('0x22')]===_0x8121('0x21');var _0x2f515a=_0x258812[_0x8121('0x23')];var _0x3677de=_0x3fbf0d?0x0:_0x506949[_0x8121('0x20')];var _0x5a90e9=_0x3fbf0d?_0x258812[_0x8121('0x23')]:_0x506949[_0x8121('0x20')]+_0x506949[_0x8121('0x22')];var _0x56628f;if(_0x5a90e9>=_0x2f515a){_0x5a90e9=_0x2f515a;_0x56628f=0xc8;}else{_0x56628f=0xce;}_0x304851[_0x8121('0x1e')](_0x56628f);return _0x304851[_0x8121('0x24')](_0x8121('0x25'),_0x3677de+'-'+_0x5a90e9+'/'+_0x2f515a)[_0x8121('0x26')](_0x258812);}return null;};}function patchUpdates(_0x33f8a6){return function(_0x22b757){try{jsonpatch[_0x8121('0x27')](_0x22b757,_0x33f8a6,!![]);}catch(_0x42c153){return BPromise['reject'](_0x42c153);}return _0x22b757[_0x8121('0x28')]();};}function saveUpdates(_0x22af04,_0x494571){return function(_0x3e1875){if(_0x3e1875){return _0x3e1875['update'](_0x22af04)[_0x8121('0x29')](function(_0x1287ff){return _0x1287ff;});}return null;};}function removeEntity(_0x1e20f7,_0x2d1a6a){return function(_0x48a423){if(_0x48a423){return _0x48a423['destroy']()['then'](function(){_0x1e20f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3b6c,_0xeec124){return function(_0x129869){if(!_0x129869){_0x2d3b6c[_0x8121('0x1d')](0x194);}return _0x129869;};}function handleError(_0x446059,_0x57a07e){_0x57a07e=_0x57a07e||0x1f4;return function(_0x2cff78){logger[_0x8121('0x2a')](_0x2cff78['stack']);if(_0x2cff78['name']){delete _0x2cff78[_0x8121('0x2b')];}_0x446059[_0x8121('0x1e')](_0x57a07e)[_0x8121('0x2c')](_0x2cff78);};}exports[_0x8121('0x2d')]=function(_0x2782cf,_0xc89dc){var _0xd3d67e={},_0x36adc5={},_0x4f6cee={'count':0x0,'rows':[]};return db['CmContact'][_0x8121('0x2e')]()[_0x8121('0x29')](function(_0xc8260f){var _0x5e12a9=[];for(var _0x1924e6=0x0;_0x1924e60x1){_0x55244c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8121('0x6c')](_0x46c1e1),null);}else{if(qs['isNumeric'](_0x46c1e1)){_0x55244c['or'](_0x8121('0x6d'),_0x46c1e1+'%');_0x55244c['or']('c.phone\x20LIKE\x20?',_0x46c1e1+'%');_0x55244c['or'](_0x8121('0x6e'),_0x46c1e1+'%');_0x55244c['or']('c.fax\x20LIKE\x20?',_0x46c1e1+'%');}else if(qs['isEmail'](_0x46c1e1)){_0x55244c['or']('c.email\x20LIKE\x20?',_0x46c1e1+'%');}else{_0x55244c['or'](_0x8121('0x6f'),'%'+_0x46c1e1+'%');_0x55244c['or'](_0x8121('0x70'),'%'+_0x46c1e1+'%');_0x55244c['or'](_0x8121('0x71'),'%'+_0x46c1e1+'%');}}}}_0x273fd7[_0x8121('0x3f')](_0x55244c);_0x273fd7[_0x8121('0x72')](_0x8121('0x73'));var _0x111ae7={'type':db[_0x8121('0x74')][_0x8121('0x75')][_0x8121('0x76')],'raw':!![]};var _0x38346b=_0x273fd7[_0x8121('0x77')]()[_0x8121('0x42')](_0x8121('0x73'));if(_0xd3d67e[_0x8121('0x3d')]){_0xd3d67e[_0x8121('0x3d')][_0x8121('0x64')](function(_0x35ce1c){_0x273fd7[_0x8121('0x3d')]('c.'+_0x35ce1c[0x0],_0x35ce1c[0x1]===_0x8121('0x78')?![]:!![]);});}if(!_[_0x8121('0x63')](_0xfa15c7)){_0x273fd7['having'](_0x21648d);_0x38346b[_0x8121('0x3f')]('t.id\x20IN\x20?',_0xfa15c7);}BPromise[_0x8121('0x79')]()[_0x8121('0x29')](function(){if(!_0x15b80e)return;if(_0x2782cf[_0x8121('0x7a')][_0x8121('0x7b')]!=='agent')return;if(!_[_0x8121('0x7c')](_0x15b80e[_0x8121('0x4e')],[_0x8121('0x42'),_0x8121('0x57')])){return _0x2782cf[_0x8121('0x7a')][_0x8121('0x7d')]({'attributes':['id'],'raw':!![]})[_0x8121('0x29')](function(_0xd98634){if(_['isEmpty'](_0xd98634)){_0x38346b[_0x8121('0x3f')](_0x8121('0x7e'));_0x273fd7[_0x8121('0x3f')](_0x8121('0x7e'));}else{_0x38346b[_0x8121('0x3f')]('c.ListId\x20IN\x20?',_[_0x8121('0x54')](_0xd98634,'id'));_0x273fd7[_0x8121('0x3f')]('c.ListId\x20IN\x20?',_[_0x8121('0x54')](_0xd98634,'id'));}});}})[_0x8121('0x29')](function(){if(_0x2782cf['user']['role']===_0x8121('0x7f')&&!_0x15b80e&&!_0x2782cf['query']['ListId'])return[];return db[_0x8121('0x80')][_0x8121('0x36')](_0x38346b[_0x8121('0x81')](),_0x111ae7);})['then'](function(_0x5a4b4a){_0x4f6cee[_0x8121('0x23')]=_0x5a4b4a[_0x8121('0x4f')];if(_0x4f6cee['count']===0x0)return[];return db[_0x8121('0x80')]['query'](_0x45384b['toString'](),_0x111ae7)[_0x8121('0x29')](function(_0x3e1cfa){_0x2c0b68=_[_0x8121('0x82')](_0x3e1cfa,'id');_0x111ae7=_[_0x8121('0x83')](_0x111ae7,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2782cf[_0x8121('0x36')]['fields']){_0xd3d67e[_0x8121('0x39')][_0x8121('0x64')](function(_0x306620){_0x273fd7[_0x8121('0x42')]('c.'+_0x306620);});}else{_0x273fd7['field'](_0x8121('0x73'));_0x273fd7[_0x8121('0x42')](_0x8121('0x84'));_0x273fd7[_0x8121('0x42')](_0x8121('0x85'));_0x273fd7[_0x8121('0x42')]('c.phone');_0x273fd7[_0x8121('0x42')](_0x8121('0x86'));_0x273fd7['field'](_0x8121('0x87'));_0x273fd7[_0x8121('0x42')](_0x8121('0x88'));_0x273fd7[_0x8121('0x42')](_0x8121('0x89'));_0x273fd7['field']('c.createdAt');_0x273fd7[_0x8121('0x42')](_0x8121('0x8a'));_0x273fd7[_0x8121('0x42')](_0x8121('0x8b'));_0x273fd7[_0x8121('0x42')](_0x8121('0x8c'),_0x8121('0x8d'));}if(_0xd3d67e[_0x8121('0x22')])_0x273fd7[_0x8121('0x22')](_0xd3d67e[_0x8121('0x22')]);if(_0xd3d67e[_0x8121('0x20')])_0x273fd7[_0x8121('0x20')](_0xd3d67e[_0x8121('0x20')]);return db['sequelize'][_0x8121('0x36')](_0x273fd7[_0x8121('0x81')](),_0x111ae7);});})['then'](function(_0x598256){_0x598256[_0x8121('0x64')](function(_0x4ca5ba){if(_0x4ca5ba[_0x8121('0x8d')]){_0x4ca5ba[_0x8121('0x8e')]=[];_0x4ca5ba[_0x8121('0x8d')][_0x8121('0x53')](',')['forEach'](function(_0x5bb6d0){_0x4ca5ba[_0x8121('0x8e')][_0x8121('0x61')](_0x2c0b68[_0x5bb6d0]);});}delete _0x4ca5ba[_0x8121('0x8d')];});_0x4f6cee[_0x8121('0x8f')]=_0x598256;return _0x4f6cee;})['then'](respondWithFilteredResult(_0xc89dc,_0xd3d67e));})[_0x8121('0x90')](handleError(_0xc89dc,null));};exports[_0x8121('0x91')]=function(_0x42f25f,_0x4fedcf){return db[_0x8121('0x92')]['find']({'where':{'id':_0x42f25f['params']['id']}})[_0x8121('0x29')](handleEntityNotFound(_0x4fedcf,null))[_0x8121('0x29')](removeEntity(_0x4fedcf,null))[_0x8121('0x90')](handleError(_0x4fedcf,null));};exports['describe']=function(_0x3f73b7,_0x44ebee){return db['CmContact']['describe']()[_0x8121('0x29')](function(_0x4b1dce){delete _0x4b1dce[_0x8121('0x93')];for(var _0x1c268d=0x0;_0x1c268d=_0x3f6821){_0x30d480=_0x3f6821;_0x5a3de7=0xc8;}else{_0x5a3de7=0xce;}_0xbd2ab2[_0x9f1c('0x20')](_0x5a3de7);return _0xbd2ab2['set'](_0x9f1c('0x27'),_0x1459a0+'-'+_0x30d480+'/'+_0x3f6821)['json'](_0x2d1ba0);}return null;};}function patchUpdates(_0x358336){return function(_0x4c4010){try{jsonpatch[_0x9f1c('0x28')](_0x4c4010,_0x358336,!![]);}catch(_0xe0f2d2){return BPromise[_0x9f1c('0x29')](_0xe0f2d2);}return _0x4c4010['save']();};}function saveUpdates(_0x4a2028,_0x696d58){return function(_0x31554f){if(_0x31554f){return _0x31554f[_0x9f1c('0x2a')](_0x4a2028)['then'](function(_0x2820b7){return _0x2820b7;});}return null;};}function removeEntity(_0x5ca122,_0x5aba7c){return function(_0x475a21){if(_0x475a21){return _0x475a21[_0x9f1c('0x2b')]()[_0x9f1c('0x2c')](function(){_0x5ca122[_0x9f1c('0x20')](0xcc)[_0x9f1c('0x21')]();});}};}function handleEntityNotFound(_0x60ca8b,_0x429a15){return function(_0x520d2c){if(!_0x520d2c){_0x60ca8b[_0x9f1c('0x2d')](0x194);}return _0x520d2c;};}function handleError(_0x73f5a5,_0x3932ff){_0x3932ff=_0x3932ff||0x1f4;return function(_0x6ee1ea){logger['error'](_0x6ee1ea[_0x9f1c('0x2e')]);if(_0x6ee1ea[_0x9f1c('0x2f')]){delete _0x6ee1ea[_0x9f1c('0x2f')];}_0x73f5a5[_0x9f1c('0x20')](_0x3932ff)[_0x9f1c('0x30')](_0x6ee1ea);};}exports[_0x9f1c('0x31')]=function(_0x369a8a,_0x17e4dc){var _0x887189={},_0x4fe066={},_0x540ad8={'count':0x0,'rows':[]};return db[_0x9f1c('0x32')]['describe']()[_0x9f1c('0x2c')](function(_0x1de05b){var _0xa8d3c8=[];for(var _0x106645=0x0;_0x1066450x1){_0x49df35['or'](_0x9f1c('0x71'),qs[_0x9f1c('0x72')](_0x3a5580),null);}else{if(qs[_0x9f1c('0x73')](_0x3a5580)){_0x49df35['or'](_0x9f1c('0x74'),_0x3a5580+'%');_0x49df35['or'](_0x9f1c('0x75'),_0x3a5580+'%');_0x49df35['or'](_0x9f1c('0x76'),_0x3a5580+'%');_0x49df35['or'](_0x9f1c('0x77'),_0x3a5580+'%');}else if(qs[_0x9f1c('0x78')](_0x3a5580)){_0x49df35['or'](_0x9f1c('0x79'),_0x3a5580+'%');}else{_0x49df35['or'](_0x9f1c('0x7a'),'%'+_0x3a5580+'%');_0x49df35['or'](_0x9f1c('0x7b'),'%'+_0x3a5580+'%');_0x49df35['or']('c.email\x20LIKE\x20?','%'+_0x3a5580+'%');}}}}_0x5831cf['where'](_0x49df35);_0x5831cf[_0x9f1c('0x7c')](_0x9f1c('0x7d'));var _0x184857={'type':db[_0x9f1c('0x7e')][_0x9f1c('0x7f')][_0x9f1c('0x80')],'raw':!![]};var _0x2da550=_0x5831cf[_0x9f1c('0x81')]()['field'](_0x9f1c('0x7d'));if(_0x887189[_0x9f1c('0x82')]){_0x887189['order']['forEach'](function(_0x144936){_0x5831cf[_0x9f1c('0x82')]('c.'+_0x144936[0x0],_0x144936[0x1]===_0x9f1c('0x83')?![]:!![]);});}if(!_[_0x9f1c('0x69')](_0x27be2d)){_0x5831cf['having'](_0x154633);_0x2da550['where'](_0x9f1c('0x84'),_0x27be2d);}BPromise[_0x9f1c('0x85')]()[_0x9f1c('0x2c')](function(){if(!_0x3e9a36)return;if(_0x369a8a[_0x9f1c('0x86')]['role']!==_0x9f1c('0x87'))return;if(!_[_0x9f1c('0x88')](_0x3e9a36[_0x9f1c('0x57')],[_0x9f1c('0x48'),_0x9f1c('0x5d')])){return _0x369a8a[_0x9f1c('0x86')][_0x9f1c('0x89')]({'attributes':['id'],'raw':!![]})[_0x9f1c('0x2c')](function(_0x476d2d){if(_[_0x9f1c('0x69')](_0x476d2d)){_0x2da550[_0x9f1c('0x45')](_0x9f1c('0x8a'));_0x5831cf[_0x9f1c('0x45')](_0x9f1c('0x8a'));}else{_0x2da550[_0x9f1c('0x45')](_0x9f1c('0x6b'),_[_0x9f1c('0x5a')](_0x476d2d,'id'));_0x5831cf[_0x9f1c('0x45')](_0x9f1c('0x6b'),_['map'](_0x476d2d,'id'));}});}})[_0x9f1c('0x2c')](function(){if(_0x369a8a['user'][_0x9f1c('0x8b')]===_0x9f1c('0x87')&&!_0x3e9a36&&!_0x369a8a[_0x9f1c('0x3e')][_0x9f1c('0x6a')])return[];return db[_0x9f1c('0x8c')][_0x9f1c('0x3e')](_0x2da550[_0x9f1c('0x8d')](),_0x184857);})[_0x9f1c('0x2c')](function(_0xeb5a2){_0x540ad8['count']=_0xeb5a2['length'];if(_0x540ad8[_0x9f1c('0x26')]===0x0)return[];return db[_0x9f1c('0x8c')][_0x9f1c('0x3e')](_0x2fc831[_0x9f1c('0x8d')](),_0x184857)[_0x9f1c('0x2c')](function(_0x3dc7ab){_0x5e9f38=_['keyBy'](_0x3dc7ab,'id');_0x184857=_['merge'](_0x184857,{'model':db[_0x9f1c('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x369a8a[_0x9f1c('0x3e')][_0x9f1c('0x42')]){_0x887189[_0x9f1c('0x41')][_0x9f1c('0x5b')](function(_0x42e8a8){_0x5831cf[_0x9f1c('0x48')]('c.'+_0x42e8a8);});}else{_0x5831cf[_0x9f1c('0x48')](_0x9f1c('0x7d'));_0x5831cf[_0x9f1c('0x48')](_0x9f1c('0x8e'));_0x5831cf[_0x9f1c('0x48')](_0x9f1c('0x8f'));_0x5831cf[_0x9f1c('0x48')](_0x9f1c('0x90'));_0x5831cf['field'](_0x9f1c('0x91'));_0x5831cf[_0x9f1c('0x48')](_0x9f1c('0x92'));_0x5831cf['field'](_0x9f1c('0x93'));_0x5831cf[_0x9f1c('0x48')]('c.ListId');_0x5831cf['field']('c.createdAt');_0x5831cf[_0x9f1c('0x48')]('c.deletedAt');_0x5831cf[_0x9f1c('0x48')](_0x9f1c('0x94'));_0x5831cf['field'](_0x9f1c('0x95'),_0x9f1c('0x96'));}if(_0x887189[_0x9f1c('0x25')])_0x5831cf['limit'](_0x887189[_0x9f1c('0x25')]);if(_0x887189[_0x9f1c('0x23')])_0x5831cf[_0x9f1c('0x23')](_0x887189[_0x9f1c('0x23')]);return db[_0x9f1c('0x8c')][_0x9f1c('0x3e')](_0x5831cf[_0x9f1c('0x8d')](),_0x184857);});})['then'](function(_0x18c031){_0x18c031[_0x9f1c('0x5b')](function(_0x3e5f56){if(_0x3e5f56[_0x9f1c('0x96')]){_0x3e5f56[_0x9f1c('0x97')]=[];_0x3e5f56['TagIds'][_0x9f1c('0x98')](',')[_0x9f1c('0x5b')](function(_0x2fdf3a){_0x3e5f56[_0x9f1c('0x97')][_0x9f1c('0x37')](_0x5e9f38[_0x2fdf3a]);});}delete _0x3e5f56['TagIds'];});_0x540ad8[_0x9f1c('0x99')]=_0x18c031;return _0x540ad8;})[_0x9f1c('0x2c')](respondWithFilteredResult(_0x17e4dc,_0x887189));})[_0x9f1c('0x9a')](handleError(_0x17e4dc,null));};exports[_0x9f1c('0x2b')]=function(_0x2a8c2d,_0x578af5){return db[_0x9f1c('0x32')][_0x9f1c('0x9b')]({'where':{'id':_0x2a8c2d['params']['id']}})['then'](handleEntityNotFound(_0x578af5,null))['then'](removeEntity(_0x578af5,null))[_0x9f1c('0x9a')](handleError(_0x578af5,null));};exports['describe']=function(_0x23501a,_0x175813){return db[_0x9f1c('0x32')][_0x9f1c('0x9c')]()[_0x9f1c('0x2c')](function(_0x485029){delete _0x485029[_0x9f1c('0x9d')];for(var _0x531498=0x0;_0x531498{}\s\\|]/g,'-');_0x5042e7(null,util['format']('%s-%s%s',path[_0x4274('0x1e')](_0x3dedac[_0x4274('0x1c')],path['extname'](_0x3dedac[_0x4274('0x1c')])),Date[_0x4274('0x1f')](),path[_0x4274('0x20')](_0x3dedac[_0x4274('0x1c')])));}})});router[_0x4274('0x15')](_0x4274('0x21'),upload['single']('file'),controller[_0x4274('0x22')]);var upload=multer({'storage':multer[_0x4274('0x23')]({'destination':function(_0x499c7b,_0x29906b,_0x44ee97){_0x44ee97(null,path[_0x4274('0x24')](config[_0x4274('0x1b')],'server/files/tmp'));},'filename':function(_0x5194ed,_0x55615d,_0x4a60a9){_0x55615d[_0x4274('0x1c')]=_0x55615d[_0x4274('0x1c')][_0x4274('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4a60a9(null,util[_0x4274('0x25')](_0x4274('0x26'),path[_0x4274('0x1e')](_0x55615d[_0x4274('0x1c')],path[_0x4274('0x20')](_0x55615d[_0x4274('0x1c')])),Date[_0x4274('0x1f')](),path[_0x4274('0x20')](_0x55615d['originalname'])));}})});router['post']('/upload',upload[_0x4274('0x27')](_0x4274('0x28')),controller[_0x4274('0x29')]);router['post'](_0x4274('0x2a'),auth[_0x4274('0xb')](),controller[_0x4274('0x2b')]);router[_0x4274('0x2c')](_0x4274('0xd'),auth['isAuthenticated'](),controller[_0x4274('0x2d')]);router[_0x4274('0x2e')](_0x4274('0xd'),auth[_0x4274('0xb')](),controller[_0x4274('0x2f')]);module[_0x4274('0x30')]=router; \ No newline at end of file +var _0x7f97=['bulkCreate','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','/csv','single','file','uploadCsv','now','/upload','upload','/upload/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','create','/create_many'];(function(_0x32af7a,_0x402a1d){var _0x20a4ae=function(_0x35d719){while(--_0x35d719){_0x32af7a['push'](_0x32af7a['shift']());}};_0x20a4ae(++_0x402a1d);}(_0x7f97,0x17a));var _0x77f9=function(_0x2031a7,_0x5857a5){_0x2031a7=_0x2031a7-0x0;var _0x58c9ba=_0x7f97[_0x2031a7];return _0x58c9ba;};'use strict';var multer=require(_0x77f9('0x0'));var util=require(_0x77f9('0x1'));var path=require(_0x77f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x77f9('0x3'));var router=express[_0x77f9('0x4')]();var fs_extra=require(_0x77f9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x77f9('0x6'));var config=require(_0x77f9('0x7'));var controller=require(_0x77f9('0x8'));router[_0x77f9('0x9')]('/',auth[_0x77f9('0xa')](),controller[_0x77f9('0xb')]);router['get'](_0x77f9('0xc'),auth[_0x77f9('0xa')](),controller[_0x77f9('0xd')]);router['get'](_0x77f9('0xe'),auth[_0x77f9('0xa')](),controller[_0x77f9('0xf')]);router[_0x77f9('0x9')](_0x77f9('0x10'),auth[_0x77f9('0xa')](),controller[_0x77f9('0x11')]);router[_0x77f9('0x9')](_0x77f9('0x12'),auth[_0x77f9('0xa')](),controller[_0x77f9('0x13')]);router['get'](_0x77f9('0x14'),auth[_0x77f9('0xa')](),controller[_0x77f9('0x15')]);router[_0x77f9('0x9')]('/:id/hopper_finals',auth[_0x77f9('0xa')](),controller[_0x77f9('0x16')]);router[_0x77f9('0x9')](_0x77f9('0x17'),auth[_0x77f9('0xa')](),controller['getJscriptySessions']);router['get'](_0x77f9('0x18'),auth[_0x77f9('0xa')](),controller[_0x77f9('0x19')]);router[_0x77f9('0x1a')](_0x77f9('0x1b'),auth['isAuthenticated'](),controller['merge']);router[_0x77f9('0x1a')]('/',auth[_0x77f9('0xa')](),controller[_0x77f9('0x1c')]);router[_0x77f9('0x1a')](_0x77f9('0x1d'),auth['isAuthenticated'](),controller[_0x77f9('0x1e')]);router['post'](_0x77f9('0x10'),auth['isAuthenticated'](),controller['setTags']);var upload=multer({'storage':multer[_0x77f9('0x1f')]({'destination':function(_0x48437c,_0x4958d5,_0x10b084){_0x10b084(null,path[_0x77f9('0x20')](config[_0x77f9('0x21')],_0x77f9('0x22')));},'filename':function(_0x12f0b0,_0x536ff0,_0x1b99dc){_0x536ff0[_0x77f9('0x23')]=_0x536ff0[_0x77f9('0x23')][_0x77f9('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b99dc(null,util[_0x77f9('0x25')](_0x77f9('0x26'),path[_0x77f9('0x27')](_0x536ff0['originalname'],path[_0x77f9('0x28')](_0x536ff0['originalname'])),Date['now'](),path[_0x77f9('0x28')](_0x536ff0[_0x77f9('0x23')])));}})});router[_0x77f9('0x1a')](_0x77f9('0x29'),upload[_0x77f9('0x2a')](_0x77f9('0x2b')),controller[_0x77f9('0x2c')]);var upload=multer({'storage':multer[_0x77f9('0x1f')]({'destination':function(_0x1d5d8a,_0x12a776,_0x477964){_0x477964(null,path[_0x77f9('0x20')](config[_0x77f9('0x21')],'server/files/tmp'));},'filename':function(_0x2a5084,_0x37686b,_0x4248ea){_0x37686b[_0x77f9('0x23')]=_0x37686b['originalname'][_0x77f9('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4248ea(null,util['format'](_0x77f9('0x26'),path['basename'](_0x37686b[_0x77f9('0x23')],path[_0x77f9('0x28')](_0x37686b[_0x77f9('0x23')])),Date[_0x77f9('0x2d')](),path[_0x77f9('0x28')](_0x37686b[_0x77f9('0x23')])));}})});router[_0x77f9('0x1a')](_0x77f9('0x2e'),upload[_0x77f9('0x2a')]('file'),controller[_0x77f9('0x2f')]);router[_0x77f9('0x1a')](_0x77f9('0x30'),auth['isAuthenticated'](),controller['import']);router['put'](_0x77f9('0xe'),auth[_0x77f9('0xa')](),controller[_0x77f9('0x31')]);router['delete'](_0x77f9('0xe'),auth[_0x77f9('0xa')](),controller[_0x77f9('0x32')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 03d217f..7758770 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 _0x6a5f=['parse','values','stringify','BOOLEAN','ENUM','sequelize','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select'];(function(_0x93c0cc,_0x59536a){var _0x2739e9=function(_0x449250){while(--_0x449250){_0x93c0cc['push'](_0x93c0cc['shift']());}};_0x2739e9(++_0x59536a);}(_0x6a5f,0x85));var _0xf6a5=function(_0x34596a,_0x4f5372){_0x34596a=_0x34596a-0x0;var _0x1695ec=_0x6a5f[_0x34596a];return _0x1695ec;};'use strict';var Sequelize=require(_0xf6a5('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xf6a5('0x1')],'get':function(_0x24e628){return this[_0xf6a5('0x2')](_0xf6a5('0x3'));}},'alias':{'type':Sequelize[_0xf6a5('0x4')],'allowNull':![],'set':function(_0x481d00){this[_0xf6a5('0x5')](_0xf6a5('0x3'),_0x481d00?_0x481d00:this['getDataValue'](_0xf6a5('0x6')));}},'type':{'type':Sequelize[_0xf6a5('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xf6a5('0x7')](_0xf6a5('0x8')),'get':function(){if(this[_0xf6a5('0x2')](_0xf6a5('0x9'))===_0xf6a5('0xa')){return JSON[_0xf6a5('0xb')](this['getDataValue']('values'));}else{return this['getDataValue'](_0xf6a5('0xc'));}},'set':function(_0xabd81d){if(Array['isArray'](_0xabd81d)){this[_0xf6a5('0x5')](_0xf6a5('0xc'),JSON[_0xf6a5('0xd')](_0xabd81d));}else{this[_0xf6a5('0x5')](_0xf6a5('0xc'),_0xabd81d);}}},'required':{'type':Sequelize[_0xf6a5('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf6a5('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf6a5('0xf')]('voice')}}; \ No newline at end of file +var _0xecae=['TEXT','long','type','select','parse','values','stringify','BOOLEAN','ENUM','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name'];(function(_0x1d203f,_0x566436){var _0x4efc04=function(_0xb57fc2){while(--_0xb57fc2){_0x1d203f['push'](_0x1d203f['shift']());}};_0x4efc04(++_0x566436);}(_0xecae,0xc4));var _0xeeca=function(_0x195aa2,_0x326df1){_0x195aa2=_0x195aa2-0x0;var _0x341fe5=_0xecae[_0x195aa2];return _0x341fe5;};'use strict';var Sequelize=require(_0xeeca('0x0'));var _=require(_0xeeca('0x1'));module['exports']={'name':{'type':Sequelize[_0xeeca('0x2')],'get':function(_0xbcb0e6){return this[_0xeeca('0x3')](_0xeeca('0x4'));}},'alias':{'type':Sequelize[_0xeeca('0x5')],'allowNull':![],'set':function(_0x2e1bf7){this[_0xeeca('0x6')]('alias',_0x2e1bf7?_0x2e1bf7:this['getDataValue'](_0xeeca('0x7')));}},'type':{'type':Sequelize[_0xeeca('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xeeca('0x8')](_0xeeca('0x9')),'get':function(){if(this['getDataValue'](_0xeeca('0xa'))===_0xeeca('0xb')){return JSON[_0xeeca('0xc')](this['getDataValue'](_0xeeca('0xd')));}else{return this[_0xeeca('0x3')](_0xeeca('0xd'));}},'set':function(_0x37d302){if(Array['isArray'](_0x37d302)){this[_0xeeca('0x6')]('values',JSON[_0xeeca('0xe')](_0x37d302));}else{this[_0xeeca('0x6')]('values',_0x37d302);}}},'required':{'type':Sequelize[_0xeeca('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xeeca('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xeeca('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index f921595..0c4be23 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 _0xe3c2=['body','find','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','send','CmCustomField','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xe3c2,0x19a));var _0x2e3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe3c2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2e3c('0x0'));var rimraf=require(_0x2e3c('0x1'));var zipdir=require(_0x2e3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e3c('0x3'));var moment=require(_0x2e3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2e3c('0x5'));var util=require(_0x2e3c('0x6'));var path=require('path');var sox=require(_0x2e3c('0x7'));var csv=require(_0x2e3c('0x8'));var ejs=require(_0x2e3c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e3c('0xa'));var squel=require(_0x2e3c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2e3c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2e3c('0xc'));var authService=require(_0x2e3c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2e3c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2e3c('0xf'));var config=require(_0x2e3c('0x10'));var licenseUtil=require(_0x2e3c('0x11'));var db=require(_0x2e3c('0x12'))['db'];function respondWithStatusCode(_0x5e75dd,_0x5f37b7){_0x5f37b7=_0x5f37b7||0xcc;return function(_0x131a82){if(_0x131a82){return _0x5e75dd[_0x2e3c('0x13')](_0x5f37b7);}return _0x5e75dd[_0x2e3c('0x14')](_0x5f37b7)[_0x2e3c('0x15')]();};}function respondWithResult(_0x2f967f,_0x4fddfd){_0x4fddfd=_0x4fddfd||0xc8;return function(_0x28d473){if(_0x28d473){return _0x2f967f[_0x2e3c('0x14')](_0x4fddfd)[_0x2e3c('0x16')](_0x28d473);}};}function respondWithFilteredResult(_0x267a89,_0x146b04){return function(_0x3751a8){if(_0x3751a8){var _0x351103=typeof _0x146b04[_0x2e3c('0x17')]==='undefined'&&typeof _0x146b04[_0x2e3c('0x18')]===_0x2e3c('0x19');var _0x1b5749=_0x3751a8[_0x2e3c('0x1a')];var _0x2543c7=_0x351103?0x0:_0x146b04[_0x2e3c('0x17')];var _0x267fe9=_0x351103?_0x3751a8[_0x2e3c('0x1a')]:_0x146b04[_0x2e3c('0x17')]+_0x146b04['limit'];var _0x17b5b7;if(_0x267fe9>=_0x1b5749){_0x267fe9=_0x1b5749;_0x17b5b7=0xc8;}else{_0x17b5b7=0xce;}_0x267a89[_0x2e3c('0x14')](_0x17b5b7);return _0x267a89[_0x2e3c('0x1b')](_0x2e3c('0x1c'),_0x2543c7+'-'+_0x267fe9+'/'+_0x1b5749)['json'](_0x3751a8);}return null;};}function patchUpdates(_0x56e7ac){return function(_0x3822dd){try{jsonpatch[_0x2e3c('0x1d')](_0x3822dd,_0x56e7ac,!![]);}catch(_0x21bfcf){return BPromise[_0x2e3c('0x1e')](_0x21bfcf);}return _0x3822dd['save']();};}function saveUpdates(_0x3718a5,_0x4e8177){return function(_0x35eefc){if(_0x35eefc){return _0x35eefc[_0x2e3c('0x1f')](_0x3718a5)['then'](function(_0x12c045){return _0x12c045;});}return null;};}function removeEntity(_0x1ec076,_0x2813ae){return function(_0x31c0fc){if(_0x31c0fc){return _0x31c0fc[_0x2e3c('0x20')]()[_0x2e3c('0x21')](function(){_0x1ec076[_0x2e3c('0x14')](0xcc)[_0x2e3c('0x15')]();});}};}function handleEntityNotFound(_0x1846ae,_0x491cca){return function(_0x337bb8){if(!_0x337bb8){_0x1846ae[_0x2e3c('0x13')](0x194);}return _0x337bb8;};}function handleError(_0x402cce,_0x2cfbbb){_0x2cfbbb=_0x2cfbbb||0x1f4;return function(_0x23f1db){logger[_0x2e3c('0x22')](_0x23f1db[_0x2e3c('0x23')]);if(_0x23f1db['name']){delete _0x23f1db['name'];}_0x402cce[_0x2e3c('0x14')](_0x2cfbbb)[_0x2e3c('0x24')](_0x23f1db);};}exports['index']=function(_0x6f32ed,_0x1f1413){var _0x430d51={},_0x32b830={},_0x11fe1a={'count':0x0,'rows':[]};var _0x404f13=_['map'](db[_0x2e3c('0x25')][_0x2e3c('0x26')],function(_0xa7e16f){return{'name':_0xa7e16f[_0x2e3c('0x27')],'type':_0xa7e16f[_0x2e3c('0x28')]['key']};});_0x32b830['model']=_['differenceBy'](_['map'](_0x404f13,_0x2e3c('0x29')),[_0x2e3c('0x29')]);_0x32b830[_0x2e3c('0x2a')]=_[_0x2e3c('0x2b')](_0x6f32ed[_0x2e3c('0x2a')]);_0x32b830[_0x2e3c('0x2c')]=_[_0x2e3c('0x2d')](_0x32b830[_0x2e3c('0x2e')],_0x32b830[_0x2e3c('0x2a')]);_0x430d51[_0x2e3c('0x2f')]=_[_0x2e3c('0x2d')](_0x32b830[_0x2e3c('0x2e')],qs['fields'](_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x30')]));_0x430d51[_0x2e3c('0x2f')]=_0x430d51[_0x2e3c('0x2f')]['length']?_0x430d51[_0x2e3c('0x2f')]:_0x32b830[_0x2e3c('0x2e')];if(!_0x6f32ed['query']['hasOwnProperty'](_0x2e3c('0x31'))){_0x430d51[_0x2e3c('0x18')]=qs[_0x2e3c('0x18')](_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x18')]);_0x430d51[_0x2e3c('0x17')]=qs['offset'](_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x17')]);}_0x430d51[_0x2e3c('0x32')]=qs[_0x2e3c('0x33')](_0x6f32ed[_0x2e3c('0x2a')]['sort']);_0x430d51['where']=qs['filters'](_[_0x2e3c('0x34')](_0x6f32ed[_0x2e3c('0x2a')],_0x32b830[_0x2e3c('0x2c')]),_0x404f13);if(_0x6f32ed[_0x2e3c('0x2a')]['filter']){_0x430d51[_0x2e3c('0x35')]=_[_0x2e3c('0x36')](_0x430d51['where'],{'$or':_['map'](_0x404f13,function(_0x4d4bf8){if(_0x4d4bf8[_0x2e3c('0x28')]!==_0x2e3c('0x37')){var _0x3cb3f8={};_0x3cb3f8[_0x4d4bf8[_0x2e3c('0x29')]]={'$like':'%'+_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x38')]+'%'};return _0x3cb3f8;}})});}_0x430d51=_[_0x2e3c('0x36')]({},_0x430d51,_0x6f32ed[_0x2e3c('0x39')]);var _0x1e0355={'where':_0x430d51[_0x2e3c('0x35')]};return db[_0x2e3c('0x25')][_0x2e3c('0x1a')](_0x1e0355)['then'](function(_0x2e064c){_0x11fe1a['count']=_0x2e064c;if(_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x3a')]){_0x430d51[_0x2e3c('0x3b')]=[{'all':!![]}];}return db[_0x2e3c('0x25')]['findAll'](_0x430d51);})[_0x2e3c('0x21')](function(_0x573ffb){_0x11fe1a[_0x2e3c('0x3c')]=_0x573ffb;return _0x11fe1a;})['then'](respondWithFilteredResult(_0x1f1413,_0x430d51))[_0x2e3c('0x3d')](handleError(_0x1f1413,null));};exports[_0x2e3c('0x3e')]=function(_0x814471,_0x254dca){var _0x35791a={'raw':!![],'where':{'id':_0x814471[_0x2e3c('0x3f')]['id']}},_0x4b255a={};_0x4b255a[_0x2e3c('0x2e')]=_['keys'](db[_0x2e3c('0x25')][_0x2e3c('0x26')]);_0x4b255a[_0x2e3c('0x2a')]=_[_0x2e3c('0x2b')](_0x814471[_0x2e3c('0x2a')]);_0x4b255a[_0x2e3c('0x2c')]=_[_0x2e3c('0x2d')](_0x4b255a[_0x2e3c('0x2e')],_0x4b255a[_0x2e3c('0x2a')]);_0x35791a['attributes']=_[_0x2e3c('0x2d')](_0x4b255a['model'],qs[_0x2e3c('0x30')](_0x814471['query']['fields']));_0x35791a[_0x2e3c('0x2f')]=_0x35791a[_0x2e3c('0x2f')]['length']?_0x35791a[_0x2e3c('0x2f')]:_0x4b255a[_0x2e3c('0x2e')];if(_0x814471[_0x2e3c('0x2a')][_0x2e3c('0x3a')]){_0x35791a[_0x2e3c('0x3b')]=[{'all':!![]}];}_0x35791a=_[_0x2e3c('0x36')]({},_0x35791a,_0x814471['options']);return db[_0x2e3c('0x25')]['find'](_0x35791a)[_0x2e3c('0x21')](handleEntityNotFound(_0x254dca,null))['then'](respondWithResult(_0x254dca,null))['catch'](handleError(_0x254dca,null));};exports['update']=function(_0x17709f,_0x3c1221){if(_0x17709f[_0x2e3c('0x40')]['id']){delete _0x17709f[_0x2e3c('0x40')]['id'];}return db[_0x2e3c('0x25')]['find']({'where':{'id':_0x17709f[_0x2e3c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c1221,null))[_0x2e3c('0x21')](saveUpdates(_0x17709f[_0x2e3c('0x40')],null))[_0x2e3c('0x21')](respondWithResult(_0x3c1221,null))[_0x2e3c('0x3d')](handleError(_0x3c1221,null));};exports['destroy']=function(_0x3671da,_0x52638e){return db[_0x2e3c('0x25')][_0x2e3c('0x41')]({'where':{'id':_0x3671da[_0x2e3c('0x3f')]['id']}})[_0x2e3c('0x21')](handleEntityNotFound(_0x52638e,null))[_0x2e3c('0x21')](removeEntity(_0x52638e,null))['catch'](handleError(_0x52638e,null));};exports[_0x2e3c('0x42')]=function(_0x5a151f,_0x1d0438){var _0x5f43cc;return db[_0x2e3c('0x43')][_0x2e3c('0x44')](function(_0x17cc0a){return db[_0x2e3c('0x25')]['create'](_0x5a151f['body'],{'transaction':_0x17cc0a})[_0x2e3c('0x21')](function(_0x2b0c87){_0x5f43cc=_0x2b0c87;var _0x26eaf9={'type':db[_0x2e3c('0x45')][_0x2e3c('0x46')],'transaction':_0x17cc0a};switch(_0x5a151f[_0x2e3c('0x40')][_0x2e3c('0x28')]){case _0x2e3c('0x47'):_0x26eaf9[_0x2e3c('0x28')]=db[_0x2e3c('0x45')][_0x2e3c('0x46')];break;case _0x2e3c('0x48'):_0x26eaf9[_0x2e3c('0x28')]=db[_0x2e3c('0x45')][_0x2e3c('0x49')];break;case'switch':_0x26eaf9['type']=db['Sequelize']['BOOLEAN'];_0x26eaf9[_0x2e3c('0x4a')]=![];break;default:}return db['sequelize'][_0x2e3c('0x4b')][_0x2e3c('0x4c')](_0x2e3c('0x4d'),util['format'](_0x2e3c('0x4e'),_0x5f43cc['id']),_0x26eaf9);})['then'](function(){return _0x5f43cc;});})[_0x2e3c('0x21')](respondWithResult(_0x1d0438,0xc9))['catch'](handleError(_0x1d0438,null));}; \ No newline at end of file +var _0x9b51=['merge','options','CmCustomField','count','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','Sequelize','text','TEXT','switch','BOOLEAN','defaultValue','cm_contacts','format','cf_%d','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x1c238f,_0x36012b){var _0x344288=function(_0x59127f){while(--_0x59127f){_0x1c238f['push'](_0x1c238f['shift']());}};_0x344288(++_0x36012b);}(_0x9b51,0x1d2));var _0x19b5=function(_0x215913,_0x338380){_0x215913=_0x215913-0x0;var _0x468591=_0x9b51[_0x215913];return _0x468591;};'use strict';var emlformat=require(_0x19b5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x19b5('0x1'));var rp=require(_0x19b5('0x2'));var moment=require('moment');var BPromise=require(_0x19b5('0x3'));var Mustache=require(_0x19b5('0x4'));var util=require(_0x19b5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x19b5('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19b5('0x7'));var _=require(_0x19b5('0x8'));var squel=require(_0x19b5('0x9'));var crypto=require(_0x19b5('0xa'));var jsforce=require(_0x19b5('0xb'));var deskjs=require(_0x19b5('0xc'));var toCsv=require(_0x19b5('0x6'));var querystring=require('querystring');var Papa=require(_0x19b5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19b5('0xe'));var as=require(_0x19b5('0xf'));var hardwareService=require(_0x19b5('0x10'));var logger=require(_0x19b5('0x11'))(_0x19b5('0x12'));var utils=require(_0x19b5('0x13'));var config=require(_0x19b5('0x14'));var licenseUtil=require(_0x19b5('0x15'));var db=require(_0x19b5('0x16'))['db'];function respondWithStatusCode(_0x54fc5d,_0x5d412b){_0x5d412b=_0x5d412b||0xcc;return function(_0x395c02){if(_0x395c02){return _0x54fc5d[_0x19b5('0x17')](_0x5d412b);}return _0x54fc5d[_0x19b5('0x18')](_0x5d412b)[_0x19b5('0x19')]();};}function respondWithResult(_0x23bbdc,_0xdb1719){_0xdb1719=_0xdb1719||0xc8;return function(_0x563f1e){if(_0x563f1e){return _0x23bbdc[_0x19b5('0x18')](_0xdb1719)[_0x19b5('0x1a')](_0x563f1e);}};}function respondWithFilteredResult(_0xdbf5ad,_0x3e9d11){return function(_0x1d895b){if(_0x1d895b){var _0x2d297e=typeof _0x3e9d11['offset']===_0x19b5('0x1b')&&typeof _0x3e9d11['limit']===_0x19b5('0x1b');var _0x15a705=_0x1d895b['count'];var _0x1dbdcf=_0x2d297e?0x0:_0x3e9d11[_0x19b5('0x1c')];var _0x3906bd=_0x2d297e?_0x1d895b['count']:_0x3e9d11[_0x19b5('0x1c')]+_0x3e9d11['limit'];var _0x170ede;if(_0x3906bd>=_0x15a705){_0x3906bd=_0x15a705;_0x170ede=0xc8;}else{_0x170ede=0xce;}_0xdbf5ad[_0x19b5('0x18')](_0x170ede);return _0xdbf5ad[_0x19b5('0x1d')](_0x19b5('0x1e'),_0x1dbdcf+'-'+_0x3906bd+'/'+_0x15a705)[_0x19b5('0x1a')](_0x1d895b);}return null;};}function patchUpdates(_0x4ef4b5){return function(_0x2057b5){try{jsonpatch[_0x19b5('0x1f')](_0x2057b5,_0x4ef4b5,!![]);}catch(_0x20bd04){return BPromise[_0x19b5('0x20')](_0x20bd04);}return _0x2057b5[_0x19b5('0x21')]();};}function saveUpdates(_0xbfe346,_0x5335ff){return function(_0x4cf52b){if(_0x4cf52b){return _0x4cf52b['update'](_0xbfe346)[_0x19b5('0x22')](function(_0x5d7ca1){return _0x5d7ca1;});}return null;};}function removeEntity(_0x1ad023,_0x385caa){return function(_0x2b4fbb){if(_0x2b4fbb){return _0x2b4fbb[_0x19b5('0x23')]()['then'](function(){_0x1ad023[_0x19b5('0x18')](0xcc)[_0x19b5('0x19')]();});}};}function handleEntityNotFound(_0xb5ae49,_0x184a9f){return function(_0x269125){if(!_0x269125){_0xb5ae49[_0x19b5('0x17')](0x194);}return _0x269125;};}function handleError(_0x2217d4,_0x5e78ae){_0x5e78ae=_0x5e78ae||0x1f4;return function(_0x3a1c30){logger[_0x19b5('0x24')](_0x3a1c30[_0x19b5('0x25')]);if(_0x3a1c30[_0x19b5('0x26')]){delete _0x3a1c30[_0x19b5('0x26')];}_0x2217d4['status'](_0x5e78ae)[_0x19b5('0x27')](_0x3a1c30);};}exports['index']=function(_0x4e92a9,_0x2ef9cc){var _0x3427d7={},_0x26a43a={},_0x26e3c5={'count':0x0,'rows':[]};var _0x2ab9e0=_[_0x19b5('0x28')](db['CmCustomField'][_0x19b5('0x29')],function(_0x3745b){return{'name':_0x3745b[_0x19b5('0x2a')],'type':_0x3745b[_0x19b5('0x2b')][_0x19b5('0x2c')]};});_0x26a43a['model']=_[_0x19b5('0x2d')](_[_0x19b5('0x28')](_0x2ab9e0,_0x19b5('0x26')),[_0x19b5('0x26')]);_0x26a43a[_0x19b5('0x2e')]=_[_0x19b5('0x2f')](_0x4e92a9[_0x19b5('0x2e')]);_0x26a43a[_0x19b5('0x30')]=_[_0x19b5('0x31')](_0x26a43a['model'],_0x26a43a['query']);_0x3427d7[_0x19b5('0x32')]=_[_0x19b5('0x31')](_0x26a43a[_0x19b5('0x33')],qs[_0x19b5('0x34')](_0x4e92a9[_0x19b5('0x2e')][_0x19b5('0x34')]));_0x3427d7['attributes']=_0x3427d7[_0x19b5('0x32')][_0x19b5('0x35')]?_0x3427d7['attributes']:_0x26a43a[_0x19b5('0x33')];if(!_0x4e92a9[_0x19b5('0x2e')][_0x19b5('0x36')]('nolimit')){_0x3427d7[_0x19b5('0x37')]=qs[_0x19b5('0x37')](_0x4e92a9['query'][_0x19b5('0x37')]);_0x3427d7[_0x19b5('0x1c')]=qs[_0x19b5('0x1c')](_0x4e92a9['query'][_0x19b5('0x1c')]);}_0x3427d7[_0x19b5('0x38')]=qs[_0x19b5('0x39')](_0x4e92a9[_0x19b5('0x2e')][_0x19b5('0x39')]);_0x3427d7[_0x19b5('0x3a')]=qs[_0x19b5('0x30')](_[_0x19b5('0x3b')](_0x4e92a9[_0x19b5('0x2e')],_0x26a43a[_0x19b5('0x30')]),_0x2ab9e0);if(_0x4e92a9['query'][_0x19b5('0x3c')]){_0x3427d7[_0x19b5('0x3a')]=_['merge'](_0x3427d7[_0x19b5('0x3a')],{'$or':_[_0x19b5('0x28')](_0x2ab9e0,function(_0x4ad280){if(_0x4ad280[_0x19b5('0x2b')]!==_0x19b5('0x3d')){var _0x30b2da={};_0x30b2da[_0x4ad280[_0x19b5('0x26')]]={'$like':'%'+_0x4e92a9[_0x19b5('0x2e')][_0x19b5('0x3c')]+'%'};return _0x30b2da;}})});}_0x3427d7=_[_0x19b5('0x3e')]({},_0x3427d7,_0x4e92a9[_0x19b5('0x3f')]);var _0x5cac25={'where':_0x3427d7[_0x19b5('0x3a')]};return db[_0x19b5('0x40')][_0x19b5('0x41')](_0x5cac25)[_0x19b5('0x22')](function(_0x40c010){_0x26e3c5[_0x19b5('0x41')]=_0x40c010;if(_0x4e92a9[_0x19b5('0x2e')][_0x19b5('0x42')]){_0x3427d7[_0x19b5('0x43')]=[{'all':!![]}];}return db[_0x19b5('0x40')][_0x19b5('0x44')](_0x3427d7);})[_0x19b5('0x22')](function(_0x5dc917){_0x26e3c5[_0x19b5('0x45')]=_0x5dc917;return _0x26e3c5;})['then'](respondWithFilteredResult(_0x2ef9cc,_0x3427d7))[_0x19b5('0x46')](handleError(_0x2ef9cc,null));};exports[_0x19b5('0x47')]=function(_0x4dfe79,_0x5caa11){var _0x938a2b={'raw':!![],'where':{'id':_0x4dfe79[_0x19b5('0x48')]['id']}},_0x50b132={};_0x50b132[_0x19b5('0x33')]=_[_0x19b5('0x2f')](db[_0x19b5('0x40')][_0x19b5('0x29')]);_0x50b132['query']=_[_0x19b5('0x2f')](_0x4dfe79[_0x19b5('0x2e')]);_0x50b132['filters']=_[_0x19b5('0x31')](_0x50b132['model'],_0x50b132[_0x19b5('0x2e')]);_0x938a2b[_0x19b5('0x32')]=_['intersection'](_0x50b132[_0x19b5('0x33')],qs[_0x19b5('0x34')](_0x4dfe79[_0x19b5('0x2e')]['fields']));_0x938a2b[_0x19b5('0x32')]=_0x938a2b['attributes']['length']?_0x938a2b['attributes']:_0x50b132[_0x19b5('0x33')];if(_0x4dfe79[_0x19b5('0x2e')]['includeAll']){_0x938a2b[_0x19b5('0x43')]=[{'all':!![]}];}_0x938a2b=_['merge']({},_0x938a2b,_0x4dfe79[_0x19b5('0x3f')]);return db[_0x19b5('0x40')][_0x19b5('0x49')](_0x938a2b)[_0x19b5('0x22')](handleEntityNotFound(_0x5caa11,null))[_0x19b5('0x22')](respondWithResult(_0x5caa11,null))[_0x19b5('0x46')](handleError(_0x5caa11,null));};exports[_0x19b5('0x4a')]=function(_0x122853,_0x178766){if(_0x122853[_0x19b5('0x4b')]['id']){delete _0x122853['body']['id'];}return db[_0x19b5('0x40')]['find']({'where':{'id':_0x122853[_0x19b5('0x48')]['id']}})[_0x19b5('0x22')](handleEntityNotFound(_0x178766,null))[_0x19b5('0x22')](saveUpdates(_0x122853[_0x19b5('0x4b')],null))[_0x19b5('0x22')](respondWithResult(_0x178766,null))[_0x19b5('0x46')](handleError(_0x178766,null));};exports[_0x19b5('0x23')]=function(_0x19e86a,_0x2c1072){return db['CmCustomField'][_0x19b5('0x49')]({'where':{'id':_0x19e86a[_0x19b5('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c1072,null))['then'](removeEntity(_0x2c1072,null))[_0x19b5('0x46')](handleError(_0x2c1072,null));};exports[_0x19b5('0x4c')]=function(_0x3337b5,_0x4232bc){var _0x47fdb3;return db[_0x19b5('0x4d')][_0x19b5('0x4e')](function(_0x4a218e){return db[_0x19b5('0x40')][_0x19b5('0x4c')](_0x3337b5[_0x19b5('0x4b')],{'transaction':_0x4a218e})[_0x19b5('0x22')](function(_0x37c282){_0x47fdb3=_0x37c282;var _0x218f56={'type':db[_0x19b5('0x4f')]['TEXT'],'transaction':_0x4a218e};switch(_0x3337b5['body']['type']){case _0x19b5('0x50'):_0x218f56['type']=db['Sequelize'][_0x19b5('0x51')];break;case'number':_0x218f56[_0x19b5('0x2b')]=db[_0x19b5('0x4f')]['INTEGER'];break;case _0x19b5('0x52'):_0x218f56[_0x19b5('0x2b')]=db[_0x19b5('0x4f')][_0x19b5('0x53')];_0x218f56[_0x19b5('0x54')]=![];break;default:}return db[_0x19b5('0x4d')]['queryInterface']['addColumn'](_0x19b5('0x55'),util[_0x19b5('0x56')](_0x19b5('0x57'),_0x47fdb3['id']),_0x218f56);})[_0x19b5('0x22')](function(){return _0x47fdb3;});})[_0x19b5('0x22')](respondWithResult(_0x4232bc,0xc9))['catch'](handleError(_0x4232bc,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 74fa8eb..8690d11 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 _0x2d5a=['define','cm_custom_fields','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x293ac3,_0x5f01e3){var _0x40398d=function(_0x47b7ba){while(--_0x47b7ba){_0x293ac3['push'](_0x293ac3['shift']());}};_0x40398d(++_0x5f01e3);}(_0x2d5a,0x1e8));var _0xa2d5=function(_0x4d1945,_0xd9a6a9){_0x4d1945=_0x4d1945-0x0;var _0x2279cf=_0x2d5a[_0x4d1945];return _0x2279cf;};'use strict';var _=require(_0xa2d5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa2d5('0x1'));var BPromise=require(_0xa2d5('0x2'));var rp=require(_0xa2d5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2d5('0x4'));var config=require(_0xa2d5('0x5'));var attributes=require(_0xa2d5('0x6'));module['exports']=function(_0x56058c,_0x4ec14e){return _0x56058c[_0xa2d5('0x7')]('CmCustomField',attributes,{'tableName':_0xa2d5('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0020=['cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField'];(function(_0x2b252a,_0x48591c){var _0x5ade52=function(_0x130ee1){while(--_0x130ee1){_0x2b252a['push'](_0x2b252a['shift']());}};_0x5ade52(++_0x48591c);}(_0x0020,0x1bb));var _0x0002=function(_0x55b460,_0x497077){_0x55b460=_0x55b460-0x0;var _0x3ac537=_0x0020[_0x55b460];return _0x3ac537;};'use strict';var _=require(_0x0002('0x0'));var util=require(_0x0002('0x1'));var logger=require(_0x0002('0x2'))(_0x0002('0x3'));var moment=require(_0x0002('0x4'));var BPromise=require(_0x0002('0x5'));var rp=require(_0x0002('0x6'));var fs=require('fs');var path=require(_0x0002('0x7'));var rimraf=require(_0x0002('0x8'));var config=require(_0x0002('0x9'));var attributes=require(_0x0002('0xa'));module['exports']=function(_0x32fc22,_0x25c37b){return _0x32fc22['define'](_0x0002('0xb'),attributes,{'tableName':_0x0002('0xc'),'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 9554634..4caf3b9 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 _0xed5a=['then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2b996b,_0x2b3e59){var _0x285751=function(_0x235ef2){while(--_0x235ef2){_0x2b996b['push'](_0x2b996b['shift']());}};_0x285751(++_0x2b3e59);}(_0xed5a,0x180));var _0xaed5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xed5a[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0xaed5('0x0'));var util=require(_0xaed5('0x1'));var moment=require(_0xaed5('0x2'));var BPromise=require('bluebird');var rs=require(_0xaed5('0x3'));var fs=require('fs');var Redis=require(_0xaed5('0x4'));var db=require(_0xaed5('0x5'))['db'];var utils=require(_0xaed5('0x6'));var logger=require('../../config/logger')(_0xaed5('0x7'));var config=require(_0xaed5('0x8'));var jayson=require(_0xaed5('0x9'));var client=jayson['client'][_0xaed5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x635040,_0x47d506,_0x2f44da){return new BPromise(function(_0x321c17,_0x151afa){return client[_0xaed5('0xb')](_0x635040,_0x2f44da)[_0xaed5('0xc')](function(_0x5eb61e){logger[_0xaed5('0xd')](_0xaed5('0xe'),_0x47d506,_0xaed5('0xf'));logger[_0xaed5('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x47d506,'request\x20sent',JSON[_0xaed5('0x11')](_0x5eb61e));if(_0x5eb61e[_0xaed5('0x12')]){if(_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x13')]===0x1f4){logger[_0xaed5('0x12')](_0xaed5('0xe'),_0x47d506,_0x5eb61e['error'][_0xaed5('0x14')]);return _0x151afa(_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x14')]);}logger[_0xaed5('0x12')]('CmCustomField,\x20%s,\x20%s',_0x47d506,_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x14')]);return _0x321c17(_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x14')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x47d506,_0xaed5('0xf'));_0x321c17(_0x5eb61e[_0xaed5('0x15')]['message']);}})['catch'](function(_0x21101e){logger[_0xaed5('0x12')]('CmCustomField,\x20%s,\x20%s',_0x47d506,_0x21101e);_0x151afa(_0x21101e);});});} \ No newline at end of file +var _0x79b2=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79b2,0x1ef));var _0x279b=function(_0x36c1d9,_0x335758){_0x36c1d9=_0x36c1d9-0x0;var _0x279fa9=_0x79b2[_0x36c1d9];return _0x279fa9;};'use strict';var _=require(_0x279b('0x0'));var util=require(_0x279b('0x1'));var moment=require(_0x279b('0x2'));var BPromise=require(_0x279b('0x3'));var rs=require(_0x279b('0x4'));var fs=require('fs');var Redis=require(_0x279b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x279b('0x6'));var logger=require(_0x279b('0x7'))(_0x279b('0x8'));var config=require(_0x279b('0x9'));var jayson=require(_0x279b('0xa'));var client=jayson[_0x279b('0xb')][_0x279b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x349a62,_0x579f95,_0x451db5){return new BPromise(function(_0x5168dd,_0x352112){return client[_0x279b('0xd')](_0x349a62,_0x451db5)['then'](function(_0x4e306e){logger[_0x279b('0xe')](_0x279b('0xf'),_0x579f95,_0x279b('0x10'));logger[_0x279b('0x11')](_0x279b('0x12'),_0x579f95,_0x279b('0x10'),JSON[_0x279b('0x13')](_0x4e306e));if(_0x4e306e[_0x279b('0x14')]){if(_0x4e306e[_0x279b('0x14')][_0x279b('0x15')]===0x1f4){logger[_0x279b('0x14')]('CmCustomField,\x20%s,\x20%s',_0x579f95,_0x4e306e[_0x279b('0x14')]['message']);return _0x352112(_0x4e306e[_0x279b('0x14')][_0x279b('0x16')]);}logger['error'](_0x279b('0xf'),_0x579f95,_0x4e306e[_0x279b('0x14')][_0x279b('0x16')]);return _0x5168dd(_0x4e306e[_0x279b('0x14')]['message']);}else{logger[_0x279b('0xe')](_0x279b('0xf'),_0x579f95,_0x279b('0x10'));_0x5168dd(_0x4e306e[_0x279b('0x17')][_0x279b('0x16')]);}})[_0x279b('0x18')](function(_0xd93a70){logger['error'](_0x279b('0xf'),_0x579f95,_0xd93a70);_0x352112(_0xd93a70);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 26f8d87..32f1732 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 _0x0734=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5e8993,_0x27c0f3){var _0x498ba8=function(_0x4319d0){while(--_0x4319d0){_0x5e8993['push'](_0x5e8993['shift']());}};_0x498ba8(++_0x27c0f3);}(_0x0734,0xba));var _0x4073=function(_0x4b7056,_0x2a2759){_0x4b7056=_0x4b7056-0x0;var _0x3194c0=_0x0734[_0x4b7056];return _0x3194c0;};'use strict';var multer=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var path=require(_0x4073('0x2'));var timeout=require(_0x4073('0x3'));var express=require(_0x4073('0x4'));var router=express['Router']();var fs_extra=require(_0x4073('0x5'));var auth=require(_0x4073('0x6'));var interaction=require(_0x4073('0x7'));var config=require(_0x4073('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x4073('0x9')](),controller['index']);router[_0x4073('0xa')](_0x4073('0xb'),auth[_0x4073('0x9')](),controller[_0x4073('0xc')]);router['post']('/',auth[_0x4073('0x9')](),controller['create']);router[_0x4073('0xd')](_0x4073('0xb'),auth[_0x4073('0x9')](),controller[_0x4073('0xe')]);router['delete']('/:id',auth[_0x4073('0x9')](),controller[_0x4073('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6011=['create','put','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x37ed1f,_0x1710d2){var _0x551d5e=function(_0x244474){while(--_0x244474){_0x37ed1f['push'](_0x37ed1f['shift']());}};_0x551d5e(++_0x1710d2);}(_0x6011,0x196));var _0x1601=function(_0x4cc707,_0x40a663){_0x4cc707=_0x4cc707-0x0;var _0x347d79=_0x6011[_0x4cc707];return _0x347d79;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1601('0x0')]();var fs_extra=require(_0x1601('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x1601('0x2'));var config=require(_0x1601('0x3'));var controller=require(_0x1601('0x4'));router[_0x1601('0x5')]('/',auth[_0x1601('0x6')](),controller[_0x1601('0x7')]);router[_0x1601('0x5')](_0x1601('0x8'),auth[_0x1601('0x6')](),controller[_0x1601('0x9')]);router['post']('/',auth[_0x1601('0x6')](),controller[_0x1601('0xa')]);router[_0x1601('0xb')](_0x1601('0x8'),auth[_0x1601('0x6')](),controller['update']);router['delete']('/:id',auth[_0x1601('0x6')](),controller['destroy']);module[_0x1601('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 80f93db..700ee1c 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 _0xf88e=['moment','sequelize','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','contactListQueue'];(function(_0x405135,_0x575076){var _0x14a395=function(_0x67bfc8){while(--_0x67bfc8){_0x405135['push'](_0x405135['shift']());}};_0x14a395(++_0x575076);}(_0xf88e,0xe1));var _0xef88=function(_0x55e836,_0x50b958){_0x55e836=_0x55e836-0x0;var _0x5d1a4b=_0xf88e[_0x55e836];return _0x5d1a4b;};'use strict';var moment=require(_0xef88('0x0'));var Sequelize=require(_0xef88('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xef88('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xef88('0x3')],'defaultValue':moment()[_0xef88('0x4')](_0xef88('0x5'))},'countbusyretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xef88('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xef88('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xef88('0x3')]},'priority':{'type':Sequelize[_0xef88('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xef88('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xef88('0x6')],'unique':_0xef88('0x8')},'ListId':{'type':Sequelize[_0xef88('0x6')],'unique':_0xef88('0x8')},'UserId':{'type':Sequelize[_0xef88('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xef88('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xef88('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c2b=['DATE','format','INTEGER','STRING','UNSIGNED','contactListQueue','moment','exports','BOOLEAN'];(function(_0x223174,_0x286457){var _0x585b1d=function(_0x5102bb){while(--_0x5102bb){_0x223174['push'](_0x223174['shift']());}};_0x585b1d(++_0x286457);}(_0x4c2b,0xde));var _0xb4c2=function(_0x49a2c0,_0x29e20a){_0x49a2c0=_0x49a2c0-0x0;var _0x1a9578=_0x4c2b[_0x49a2c0];return _0x1a9578;};'use strict';var moment=require(_0xb4c2('0x0'));var Sequelize=require('sequelize');module[_0xb4c2('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xb4c2('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb4c2('0x3')],'defaultValue':moment()[_0xb4c2('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb4c2('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb4c2('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb4c2('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb4c2('0x3')]},'priority':{'type':Sequelize[_0xb4c2('0x5')](0x2)[_0xb4c2('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb4c2('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb4c2('0x5')],'unique':_0xb4c2('0x8')},'ListId':{'type':Sequelize[_0xb4c2('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xb4c2('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xb4c2('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xb4c2('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb4c2('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb4c2('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb4c2('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb4c2('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 e6d1cdd..1167e44 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 _0xa36a=['queue','CmContact','ContactId','firstName','calleridname','isNil','lastName','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','getOpenContacts','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','status','end','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','nolimit','order','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','state','statedesc','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype'];(function(_0x88ea59,_0x49fe20){var _0x5a2942=function(_0x1660f1){while(--_0x1660f1){_0x88ea59['push'](_0x88ea59['shift']());}};_0x5a2942(++_0x49fe20);}(_0xa36a,0x1dd));var _0xaa36=function(_0x50db97,_0x45f822){_0x50db97=_0x50db97-0x0;var _0x1db193=_0xa36a[_0x50db97];return _0x1db193;};'use strict';var emlformat=require(_0xaa36('0x0'));var rimraf=require(_0xaa36('0x1'));var zipdir=require(_0xaa36('0x2'));var jsonpatch=require(_0xaa36('0x3'));var rp=require('request-promise');var moment=require(_0xaa36('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa36('0x5'));var util=require('util');var path=require('path');var sox=require(_0xaa36('0x6'));var csv=require('to-csv');var ejs=require(_0xaa36('0x7'));var fs=require('fs');var fs_extra=require(_0xaa36('0x8'));var _=require(_0xaa36('0x9'));var squel=require(_0xaa36('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa36('0xb'));var deskjs=require(_0xaa36('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaa36('0xd'));var Papa=require(_0xaa36('0xe'));var Redis=require(_0xaa36('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa36('0x10'));var hardwareService=require(_0xaa36('0x11'));var logger=require(_0xaa36('0x12'))(_0xaa36('0x13'));var utils=require(_0xaa36('0x14'));var config=require(_0xaa36('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa36('0x16'))['db'];function respondWithStatusCode(_0x923242,_0xc6ec83){_0xc6ec83=_0xc6ec83||0xcc;return function(_0x17f2e6){if(_0x17f2e6){return _0x923242[_0xaa36('0x17')](_0xc6ec83);}return _0x923242['status'](_0xc6ec83)['end']();};}function respondWithResult(_0x318006,_0x1c276b){_0x1c276b=_0x1c276b||0xc8;return function(_0x24ed9b){if(_0x24ed9b){return _0x318006['status'](_0x1c276b)[_0xaa36('0x18')](_0x24ed9b);}};}function respondWithFilteredResult(_0x35c3d8,_0x2bcb63){return function(_0x53aef2){if(_0x53aef2){var _0x276f10=typeof _0x2bcb63[_0xaa36('0x19')]===_0xaa36('0x1a')&&typeof _0x2bcb63[_0xaa36('0x1b')]===_0xaa36('0x1a');var _0x119f82=_0x53aef2[_0xaa36('0x1c')];var _0x58b03c=_0x276f10?0x0:_0x2bcb63[_0xaa36('0x19')];var _0x56d407=_0x276f10?_0x53aef2[_0xaa36('0x1c')]:_0x2bcb63['offset']+_0x2bcb63['limit'];var _0xf2af61;if(_0x56d407>=_0x119f82){_0x56d407=_0x119f82;_0xf2af61=0xc8;}else{_0xf2af61=0xce;}_0x35c3d8['status'](_0xf2af61);return _0x35c3d8[_0xaa36('0x1d')](_0xaa36('0x1e'),_0x58b03c+'-'+_0x56d407+'/'+_0x119f82)[_0xaa36('0x18')](_0x53aef2);}return null;};}function patchUpdates(_0x5dfc8f){return function(_0x349c9b){try{jsonpatch['apply'](_0x349c9b,_0x5dfc8f,!![]);}catch(_0x30839a){return BPromise[_0xaa36('0x1f')](_0x30839a);}return _0x349c9b[_0xaa36('0x20')]();};}function saveUpdates(_0x383029,_0x5e65ec){return function(_0x594f29){if(_0x594f29){return _0x594f29[_0xaa36('0x21')](_0x383029)[_0xaa36('0x22')](function(_0x48e478){return _0x48e478;});}return null;};}function removeEntity(_0x11e72d,_0x1678a1){return function(_0x4a06b8){if(_0x4a06b8){return _0x4a06b8[_0xaa36('0x23')]()[_0xaa36('0x22')](function(){_0x11e72d[_0xaa36('0x24')](0xcc)[_0xaa36('0x25')]();});}};}function handleEntityNotFound(_0x17cb5b,_0x20e933){return function(_0x377c51){if(!_0x377c51){_0x17cb5b[_0xaa36('0x17')](0x194);}return _0x377c51;};}function handleError(_0x358e8d,_0x1333d2){_0x1333d2=_0x1333d2||0x1f4;return function(_0x23c477){logger['error'](_0x23c477[_0xaa36('0x26')]);if(_0x23c477[_0xaa36('0x27')]){delete _0x23c477[_0xaa36('0x27')];}_0x358e8d['status'](_0x1333d2)[_0xaa36('0x28')](_0x23c477);};}exports[_0xaa36('0x29')]=function(_0x2f761b,_0xde4cdb){var _0x1d24c6={},_0x521f65={},_0x8d4975={'count':0x0,'rows':[]};var _0x2202eb=_['map'](db[_0xaa36('0x2a')][_0xaa36('0x2b')],function(_0x4a9d7a){return{'name':_0x4a9d7a[_0xaa36('0x2c')],'type':_0x4a9d7a[_0xaa36('0x2d')][_0xaa36('0x2e')]};});_0x521f65[_0xaa36('0x2f')]=_[_0xaa36('0x30')](_0x2202eb,_0xaa36('0x27'));_0x521f65['query']=_[_0xaa36('0x31')](_0x2f761b[_0xaa36('0x32')]);_0x521f65[_0xaa36('0x33')]=_[_0xaa36('0x34')](_0x521f65[_0xaa36('0x2f')],_0x521f65['query']);_0x521f65[_0xaa36('0x33')]=_[_0xaa36('0x35')](_0x521f65[_0xaa36('0x33')],[_0xaa36('0x36'),_0xaa36('0x37'),_0xaa36('0x38'),_0xaa36('0x39'),'$lt',_0xaa36('0x3a'),_0xaa36('0x3b'),'$eq','$not',_0xaa36('0x3c'),_0xaa36('0x3d'),_0xaa36('0x3e'),_0xaa36('0x3f'),_0xaa36('0x40'),_0xaa36('0x41'),_0xaa36('0x42'),_0xaa36('0x43'),'$like',_0xaa36('0x44'),'$contains',_0xaa36('0x45'),_0xaa36('0x46')]);_0x1d24c6[_0xaa36('0x47')]=_[_0xaa36('0x34')](_0x521f65[_0xaa36('0x2f')],qs['fields'](_0x2f761b[_0xaa36('0x32')][_0xaa36('0x48')]));_0x1d24c6[_0xaa36('0x47')]=_0x1d24c6[_0xaa36('0x47')]['length']?_0x1d24c6[_0xaa36('0x47')]:_0x521f65[_0xaa36('0x2f')];if(!_0x2f761b['query']['hasOwnProperty'](_0xaa36('0x49'))){_0x1d24c6[_0xaa36('0x1b')]=qs[_0xaa36('0x1b')](_0x2f761b[_0xaa36('0x32')][_0xaa36('0x1b')]);_0x1d24c6['offset']=qs[_0xaa36('0x19')](_0x2f761b[_0xaa36('0x32')][_0xaa36('0x19')]);}_0x1d24c6[_0xaa36('0x4a')]=qs['sort'](_0x2f761b[_0xaa36('0x32')]['sort']);_0x1d24c6['where']=qs[_0xaa36('0x33')](_['pick'](_0x2f761b[_0xaa36('0x32')],_0x521f65['filters']),_0x2202eb);if(_0x2f761b[_0xaa36('0x32')][_0xaa36('0x4b')]){_0x1d24c6[_0xaa36('0x4c')]=_[_0xaa36('0x4d')](_0x1d24c6['where'],{'$or':_[_0xaa36('0x30')](_0x2202eb,function(_0x1cac46){if(_0x1cac46[_0xaa36('0x2d')]!==_0xaa36('0x4e')){var _0x17d1ea={};_0x17d1ea[_0x1cac46[_0xaa36('0x27')]]={'$like':'%'+_0x2f761b[_0xaa36('0x32')]['filter']+'%'};return _0x17d1ea;}})});}_0x1d24c6=_[_0xaa36('0x4d')]({},_0x1d24c6,_0x2f761b['options']);var _0x3e208e={'where':_0x1d24c6[_0xaa36('0x4c')]};return db['CmHopper'][_0xaa36('0x1c')](_0x3e208e)['then'](function(_0x1f8c97){_0x8d4975[_0xaa36('0x1c')]=_0x1f8c97;if(_0x2f761b[_0xaa36('0x32')][_0xaa36('0x4f')]){_0x1d24c6[_0xaa36('0x50')]=[{'all':!![]}];}return db['CmHopper'][_0xaa36('0x51')](_0x1d24c6);})[_0xaa36('0x22')](function(_0xa9b0ad){_0x8d4975[_0xaa36('0x52')]=_0xa9b0ad;return _0x8d4975;})[_0xaa36('0x22')](respondWithFilteredResult(_0xde4cdb,_0x1d24c6))[_0xaa36('0x53')](handleError(_0xde4cdb,null));};exports[_0xaa36('0x54')]=function(_0x332540,_0x28fb3b){var _0x3f5226={'raw':!![],'where':{'id':_0x332540[_0xaa36('0x55')]['id']}},_0x5345e9={};_0x5345e9[_0xaa36('0x2f')]=_['keys'](db[_0xaa36('0x2a')][_0xaa36('0x2b')]);_0x5345e9[_0xaa36('0x32')]=_[_0xaa36('0x31')](_0x332540[_0xaa36('0x32')]);_0x5345e9['filters']=_[_0xaa36('0x34')](_0x5345e9['model'],_0x5345e9[_0xaa36('0x32')]);_0x3f5226['attributes']=_[_0xaa36('0x34')](_0x5345e9['model'],qs[_0xaa36('0x48')](_0x332540[_0xaa36('0x32')][_0xaa36('0x48')]));_0x3f5226[_0xaa36('0x47')]=_0x3f5226[_0xaa36('0x47')][_0xaa36('0x56')]?_0x3f5226['attributes']:_0x5345e9['model'];if(_0x332540[_0xaa36('0x32')][_0xaa36('0x4f')]){_0x3f5226[_0xaa36('0x50')]=[{'all':!![]}];}_0x3f5226=_['merge']({},_0x3f5226,_0x332540['options']);return db[_0xaa36('0x2a')][_0xaa36('0x57')](_0x3f5226)[_0xaa36('0x22')](handleEntityNotFound(_0x28fb3b,null))[_0xaa36('0x22')](respondWithResult(_0x28fb3b,null))['catch'](handleError(_0x28fb3b,null));};exports[_0xaa36('0x58')]=function(_0x6aa700,_0x12534){return db[_0xaa36('0x2a')][_0xaa36('0x58')](_0x6aa700[_0xaa36('0x59')],{})[_0xaa36('0x22')](respondWithResult(_0x12534,0xc9))['catch'](handleError(_0x12534,null));};exports[_0xaa36('0x21')]=function(_0x3678ee,_0x179116){if(_0x3678ee[_0xaa36('0x59')]['id']){delete _0x3678ee[_0xaa36('0x59')]['id'];}return db[_0xaa36('0x2a')][_0xaa36('0x57')]({'where':{'id':_0x3678ee[_0xaa36('0x55')]['id']}})['then'](handleEntityNotFound(_0x179116,null))[_0xaa36('0x22')](saveUpdates(_0x3678ee[_0xaa36('0x59')],null))[_0xaa36('0x22')](respondWithResult(_0x179116,null))[_0xaa36('0x53')](handleError(_0x179116,null));};exports[_0xaa36('0x5a')]=function(_0x296eab,_0x13ccbe){return db[_0xaa36('0x2a')][_0xaa36('0x5a')]()['then'](respondWithResult(_0x13ccbe,null))[_0xaa36('0x53')](handleError(_0x13ccbe,null));};exports[_0xaa36('0x23')]=function(_0x5468a2,_0x5132d5){var _0x2af48d;return db[_0xaa36('0x2a')][_0xaa36('0x57')]({'where':{'id':_0x5468a2[_0xaa36('0x55')]['id']}})[_0xaa36('0x22')](handleEntityNotFound(_0x5132d5,null))[_0xaa36('0x22')](function(_0x28ae59){if(_0x28ae59){return _0x28ae59[_0xaa36('0x23')]()[_0xaa36('0x22')](function(_0x42b23d){return _0x42b23d;});}})[_0xaa36('0x22')](function(_0x527b0e){_0x2af48d=_0x527b0e;if(_0x527b0e){if(_0x527b0e[_0xaa36('0x5b')]||_0x527b0e[_0xaa36('0x5c')]){return db[_0x527b0e[_0xaa36('0x5b')]?_0xaa36('0x5d'):_0xaa36('0x5e')]['find']({'where':{'id':_0x527b0e[_0xaa36('0x5b')]?_0x527b0e[_0xaa36('0x5b')]:_0x527b0e[_0xaa36('0x5c')]},'attributes':['id',_0xaa36('0x27')],'raw':!![]});}}})['then'](function(_0x2dd3d1){var _0x18371c={};if(_0x2dd3d1){_[_0xaa36('0x4d')](_0x18371c,_['omit'](_0x2af48d[_0xaa36('0x5f')],[_0xaa36('0x60'),'updatedAt','id']));_0x18371c[_0xaa36('0x61')]=0x15;_0x18371c[_0xaa36('0x62')]=_0xaa36('0x63');_0x18371c['campaign']=_0x2dd3d1[_0xaa36('0x27')];_0x18371c['membername']=_0x5468a2[_0xaa36('0x64')][_0xaa36('0x27')];_0x18371c[_0xaa36('0x65')]=_0x5468a2[_0xaa36('0x64')]['id'];_0x18371c['deleted']=!![];_0x18371c[_0xaa36('0x66')]=moment()[_0xaa36('0x67')](_0xaa36('0x68'));_0x18371c['calleridnum']=_0x2af48d[_0xaa36('0x69')];_0x18371c[_0xaa36('0x6a')]=_0x2af48d['VoiceQueueId']?_0xaa36('0x6b'):'ivr';return db[_0xaa36('0x6c')][_0xaa36('0x57')]({'where':{'id':_0x18371c[_0xaa36('0x6d')]},'attributes':[_0xaa36('0x6e'),'lastName']})['then'](function(_0x4e1064){if(!_['isNil'](_0x5132d5)&&!_['isNil'](_0x4e1064[_0xaa36('0x6e')])){_0x18371c[_0xaa36('0x6f')]=_0x4e1064[_0xaa36('0x6e')];if(!_[_0xaa36('0x70')](_0x4e1064[_0xaa36('0x71')])){_0x18371c[_0xaa36('0x6f')]+='\x20'+_0x4e1064['lastName'];}}})['finally'](function(){return db[_0xaa36('0x72')][_0xaa36('0x58')](_0x18371c);});}})[_0xaa36('0x22')](function(){return _0x5132d5[_0xaa36('0x24')](0xcc)[_0xaa36('0x25')]();})[_0xaa36('0x53')](handleError(_0x5132d5,null));};exports[_0xaa36('0x73')]=function(_0x309b25,_0x54b012,_0x2cb7b2){var _0x1aed13=[];return db[_0xaa36('0x6c')][_0xaa36('0x5a')]()[_0xaa36('0x22')](function(_0x4323d4){_0x1aed13=_[_0xaa36('0x31')](_0x4323d4);return _0x309b25[_0xaa36('0x64')][_0xaa36('0x74')]({'where':{'type':_0xaa36('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xaa36('0x76')],'raw':!![]});})[_0xaa36('0x22')](function(_0x5816bb){if(_0x5816bb&&_0x5816bb[_0xaa36('0x56')]){return db[_0xaa36('0x77')]['transaction'](function(_0x1c3d52){var _0xabce04={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaa36('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaa36('0x30')](_0x5816bb,'id')},'$or':[{'UserId':null},{'UserId':_0x309b25[_0xaa36('0x64')]['id']}]};var _0x159c23=[];if(_0x309b25[_0xaa36('0x59')][_0xaa36('0x78')]&&_0x309b25[_0xaa36('0x59')][_0xaa36('0x78')]===_0xaa36('0x79')){if(!_[_0xaa36('0x7a')](_0x309b25['body'][_0xaa36('0x7b')])){_0xabce04['id']={'$in':_0x309b25['body'][_0xaa36('0x7b')]};}_0x159c23=[[_0xaa36('0x7c'),_0xaa36('0x7d')],[_0xaa36('0x7e'),_0x5816bb[0x0][_0xaa36('0x76')]==='ASC'?_0xaa36('0x7f'):_0xaa36('0x7d')],db[_0xaa36('0x77')][_0xaa36('0x80')](_0xaa36('0x81')),['id',_0xaa36('0x7f')]];}else{if(!_[_0xaa36('0x7a')](_0x309b25[_0xaa36('0x59')][_0xaa36('0x7b')])){_0xabce04['id']={'$notIn':_0x309b25['body']['hopperIds']};}_0x159c23=[['priority',_0xaa36('0x7f')],[_0xaa36('0x7e'),_0x5816bb[0x0][_0xaa36('0x76')]],db['sequelize']['literal'](_0xaa36('0x82')),['id',_0xaa36('0x7d')]];}return db[_0xaa36('0x2a')][_0xaa36('0x83')]({'attributes':['id',_0xaa36('0x84')],'where':_0xabce04,'order':_0x159c23,'transaction':_0x1c3d52,'lock':_0x1c3d52[_0xaa36('0x85')][_0xaa36('0x86')],'include':[{'model':db[_0xaa36('0x6c')],'as':_0xaa36('0x87'),'attributes':_0x1aed13,'include':[{'model':db[_0xaa36('0x88')],'as':_0xaa36('0x89'),'attributes':['id',_0xaa36('0x27')]}]},{'model':db[_0xaa36('0x8a')],'as':'List','attributes':['id','name']},{'model':db[_0xaa36('0x5d')],'as':_0xaa36('0x8b'),'attributes':['id',_0xaa36('0x27'),'dialActive']}]})[_0xaa36('0x22')](function(_0x3d63f8){if(_0x3d63f8){return _0x3d63f8[_0xaa36('0x21')]({'UserId':_0x309b25[_0xaa36('0x64')]['id']},{'transaction':_0x1c3d52});}});});}})[_0xaa36('0x22')](handleEntityNotFound(_0x54b012,null))['then'](respondWithResult(_0x54b012,null))[_0xaa36('0x53')](handleError(_0x54b012,null));};exports[_0xaa36('0x8c')]=function(_0x490bc0,_0x576db2,_0x2ef5d9){return _0x490bc0[_0xaa36('0x64')][_0xaa36('0x74')]({'where':{'type':_0xaa36('0x75'),'dialActive':!![],'dialMethod':_0xaa36('0x8d')},'attributes':['id'],'raw':!![]})['then'](function(_0xf96aa4){if(_0xf96aa4&&_0xf96aa4[_0xaa36('0x56')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaa36('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaa36('0x30')](_0xf96aa4,'id')},'$or':[{'UserId':null},{'UserId':_0x490bc0[_0xaa36('0x64')]['id']}]}});}return 0x0;})[_0xaa36('0x22')](function(_0x1623b2){if(!_[_0xaa36('0x70')](_0x1623b2)&&_[_0xaa36('0x8e')](_0x1623b2)){return _0x576db2[_0xaa36('0x24')](0xc8)[_0xaa36('0x18')]({'contacts':_0x1623b2});}else{logger[_0xaa36('0x8f')](_0xaa36('0x90'),_0xaa36('0x8c'),0x194,_0xaa36('0x91'));_0x576db2[_0xaa36('0x17')](0x194);}})['catch'](handleError(_0x576db2,null));}; \ No newline at end of file +var _0x4531=['dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','outbound','preview','isNumber','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','save','then','destroy','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$notLike','$iLike','$like','$overlap','$contains','$contained','$any','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','find','create','body','update','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','CmHopperFinal','getVoiceQueues'];(function(_0x3c6eb0,_0x2679fe){var _0x117e5d=function(_0x204ede){while(--_0x204ede){_0x3c6eb0['push'](_0x3c6eb0['shift']());}};_0x117e5d(++_0x2679fe);}(_0x4531,0xaf));var _0x1453=function(_0x449f52,_0x241fdf){_0x449f52=_0x449f52-0x0;var _0x30022a=_0x4531[_0x449f52];return _0x30022a;};'use strict';var emlformat=require(_0x1453('0x0'));var rimraf=require(_0x1453('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1453('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1453('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1453('0x4'));var sox=require(_0x1453('0x5'));var csv=require(_0x1453('0x6'));var ejs=require(_0x1453('0x7'));var fs=require('fs');var fs_extra=require(_0x1453('0x8'));var _=require(_0x1453('0x9'));var squel=require(_0x1453('0xa'));var crypto=require('crypto');var jsforce=require(_0x1453('0xb'));var deskjs=require(_0x1453('0xc'));var toCsv=require(_0x1453('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1453('0xd'));var qs=require(_0x1453('0xe'));var as=require(_0x1453('0xf'));var hardwareService=require(_0x1453('0x10'));var logger=require(_0x1453('0x11'))(_0x1453('0x12'));var utils=require(_0x1453('0x13'));var config=require(_0x1453('0x14'));var licenseUtil=require(_0x1453('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x181523,_0x16940b){_0x16940b=_0x16940b||0xcc;return function(_0x442514){if(_0x442514){return _0x181523[_0x1453('0x16')](_0x16940b);}return _0x181523[_0x1453('0x17')](_0x16940b)[_0x1453('0x18')]();};}function respondWithResult(_0x4897f0,_0x4dddc5){_0x4dddc5=_0x4dddc5||0xc8;return function(_0x302406){if(_0x302406){return _0x4897f0[_0x1453('0x17')](_0x4dddc5)[_0x1453('0x19')](_0x302406);}};}function respondWithFilteredResult(_0x2064bf,_0x476aba){return function(_0x3653c6){if(_0x3653c6){var _0x4c5b73=typeof _0x476aba[_0x1453('0x1a')]===_0x1453('0x1b')&&typeof _0x476aba[_0x1453('0x1c')]===_0x1453('0x1b');var _0x1af6ac=_0x3653c6['count'];var _0x52891a=_0x4c5b73?0x0:_0x476aba[_0x1453('0x1a')];var _0x217d09=_0x4c5b73?_0x3653c6[_0x1453('0x1d')]:_0x476aba['offset']+_0x476aba['limit'];var _0x4c173f;if(_0x217d09>=_0x1af6ac){_0x217d09=_0x1af6ac;_0x4c173f=0xc8;}else{_0x4c173f=0xce;}_0x2064bf[_0x1453('0x17')](_0x4c173f);return _0x2064bf['set']('Content-Range',_0x52891a+'-'+_0x217d09+'/'+_0x1af6ac)[_0x1453('0x19')](_0x3653c6);}return null;};}function patchUpdates(_0x504fe9){return function(_0x58a6ba){try{jsonpatch['apply'](_0x58a6ba,_0x504fe9,!![]);}catch(_0x58c16c){return BPromise['reject'](_0x58c16c);}return _0x58a6ba[_0x1453('0x1e')]();};}function saveUpdates(_0x5a6a01,_0x5ad31b){return function(_0xa49b5e){if(_0xa49b5e){return _0xa49b5e['update'](_0x5a6a01)[_0x1453('0x1f')](function(_0x3a0550){return _0x3a0550;});}return null;};}function removeEntity(_0x143c87,_0x542f3b){return function(_0x3120d6){if(_0x3120d6){return _0x3120d6[_0x1453('0x20')]()[_0x1453('0x1f')](function(){_0x143c87[_0x1453('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d2c62,_0x152e31){return function(_0x49e24d){if(!_0x49e24d){_0x5d2c62[_0x1453('0x16')](0x194);}return _0x49e24d;};}function handleError(_0x2c3d29,_0x1c6a15){_0x1c6a15=_0x1c6a15||0x1f4;return function(_0x3b5f64){logger[_0x1453('0x21')](_0x3b5f64[_0x1453('0x22')]);if(_0x3b5f64[_0x1453('0x23')]){delete _0x3b5f64[_0x1453('0x23')];}_0x2c3d29['status'](_0x1c6a15)[_0x1453('0x24')](_0x3b5f64);};}exports[_0x1453('0x25')]=function(_0x34be1d,_0xd270c9){var _0x994e05={},_0x177611={},_0x18bd99={'count':0x0,'rows':[]};var _0x3b47a0=_[_0x1453('0x26')](db[_0x1453('0x27')][_0x1453('0x28')],function(_0x44ccd5){return{'name':_0x44ccd5[_0x1453('0x29')],'type':_0x44ccd5[_0x1453('0x2a')][_0x1453('0x2b')]};});_0x177611[_0x1453('0x2c')]=_['map'](_0x3b47a0,_0x1453('0x23'));_0x177611['query']=_[_0x1453('0x2d')](_0x34be1d[_0x1453('0x2e')]);_0x177611[_0x1453('0x2f')]=_[_0x1453('0x30')](_0x177611[_0x1453('0x2c')],_0x177611[_0x1453('0x2e')]);_0x177611[_0x1453('0x2f')]=_['concat'](_0x177611[_0x1453('0x2f')],[_0x1453('0x31'),_0x1453('0x32'),'$gt',_0x1453('0x33'),_0x1453('0x34'),_0x1453('0x35'),_0x1453('0x36'),_0x1453('0x37'),_0x1453('0x38'),_0x1453('0x39'),_0x1453('0x3a'),'$in',_0x1453('0x3b'),'$like',_0x1453('0x3c'),_0x1453('0x3d'),'$notILike',_0x1453('0x3e'),_0x1453('0x3f'),_0x1453('0x40'),_0x1453('0x41'),_0x1453('0x42')]);_0x994e05['attributes']=_[_0x1453('0x30')](_0x177611[_0x1453('0x2c')],qs['fields'](_0x34be1d[_0x1453('0x2e')]['fields']));_0x994e05[_0x1453('0x43')]=_0x994e05[_0x1453('0x43')][_0x1453('0x44')]?_0x994e05[_0x1453('0x43')]:_0x177611[_0x1453('0x2c')];if(!_0x34be1d[_0x1453('0x2e')][_0x1453('0x45')](_0x1453('0x46'))){_0x994e05[_0x1453('0x1c')]=qs[_0x1453('0x1c')](_0x34be1d['query'][_0x1453('0x1c')]);_0x994e05[_0x1453('0x1a')]=qs['offset'](_0x34be1d[_0x1453('0x2e')][_0x1453('0x1a')]);}_0x994e05[_0x1453('0x47')]=qs[_0x1453('0x48')](_0x34be1d[_0x1453('0x2e')][_0x1453('0x48')]);_0x994e05[_0x1453('0x49')]=qs[_0x1453('0x2f')](_[_0x1453('0x4a')](_0x34be1d[_0x1453('0x2e')],_0x177611[_0x1453('0x2f')]),_0x3b47a0);if(_0x34be1d[_0x1453('0x2e')]['filter']){_0x994e05[_0x1453('0x49')]=_[_0x1453('0x4b')](_0x994e05[_0x1453('0x49')],{'$or':_['map'](_0x3b47a0,function(_0x526bf8){if(_0x526bf8[_0x1453('0x2a')]!==_0x1453('0x4c')){var _0x58b536={};_0x58b536[_0x526bf8[_0x1453('0x23')]]={'$like':'%'+_0x34be1d['query']['filter']+'%'};return _0x58b536;}})});}_0x994e05=_[_0x1453('0x4b')]({},_0x994e05,_0x34be1d['options']);var _0x581494={'where':_0x994e05[_0x1453('0x49')]};return db[_0x1453('0x27')][_0x1453('0x1d')](_0x581494)['then'](function(_0x56af9c){_0x18bd99[_0x1453('0x1d')]=_0x56af9c;if(_0x34be1d[_0x1453('0x2e')][_0x1453('0x4d')]){_0x994e05['include']=[{'all':!![]}];}return db['CmHopper'][_0x1453('0x4e')](_0x994e05);})[_0x1453('0x1f')](function(_0x3719db){_0x18bd99[_0x1453('0x4f')]=_0x3719db;return _0x18bd99;})[_0x1453('0x1f')](respondWithFilteredResult(_0xd270c9,_0x994e05))[_0x1453('0x50')](handleError(_0xd270c9,null));};exports[_0x1453('0x51')]=function(_0x1c0440,_0x8fdbd3){var _0x6e1625={'raw':!![],'where':{'id':_0x1c0440[_0x1453('0x52')]['id']}},_0x291ee8={};_0x291ee8[_0x1453('0x2c')]=_[_0x1453('0x2d')](db[_0x1453('0x27')][_0x1453('0x28')]);_0x291ee8['query']=_[_0x1453('0x2d')](_0x1c0440[_0x1453('0x2e')]);_0x291ee8['filters']=_[_0x1453('0x30')](_0x291ee8['model'],_0x291ee8[_0x1453('0x2e')]);_0x6e1625[_0x1453('0x43')]=_[_0x1453('0x30')](_0x291ee8['model'],qs[_0x1453('0x53')](_0x1c0440[_0x1453('0x2e')]['fields']));_0x6e1625[_0x1453('0x43')]=_0x6e1625['attributes'][_0x1453('0x44')]?_0x6e1625[_0x1453('0x43')]:_0x291ee8['model'];if(_0x1c0440[_0x1453('0x2e')][_0x1453('0x4d')]){_0x6e1625[_0x1453('0x54')]=[{'all':!![]}];}_0x6e1625=_['merge']({},_0x6e1625,_0x1c0440[_0x1453('0x55')]);return db[_0x1453('0x27')][_0x1453('0x56')](_0x6e1625)[_0x1453('0x1f')](handleEntityNotFound(_0x8fdbd3,null))['then'](respondWithResult(_0x8fdbd3,null))[_0x1453('0x50')](handleError(_0x8fdbd3,null));};exports[_0x1453('0x57')]=function(_0x12bb07,_0x9dfa8f){return db['CmHopper'][_0x1453('0x57')](_0x12bb07[_0x1453('0x58')],{})[_0x1453('0x1f')](respondWithResult(_0x9dfa8f,0xc9))[_0x1453('0x50')](handleError(_0x9dfa8f,null));};exports[_0x1453('0x59')]=function(_0x4a2996,_0x1ea7b9){if(_0x4a2996[_0x1453('0x58')]['id']){delete _0x4a2996[_0x1453('0x58')]['id'];}return db['CmHopper'][_0x1453('0x56')]({'where':{'id':_0x4a2996[_0x1453('0x52')]['id']}})['then'](handleEntityNotFound(_0x1ea7b9,null))['then'](saveUpdates(_0x4a2996[_0x1453('0x58')],null))[_0x1453('0x1f')](respondWithResult(_0x1ea7b9,null))[_0x1453('0x50')](handleError(_0x1ea7b9,null));};exports[_0x1453('0x5a')]=function(_0x47af3e,_0x11a25e){return db[_0x1453('0x27')]['describe']()[_0x1453('0x1f')](respondWithResult(_0x11a25e,null))[_0x1453('0x50')](handleError(_0x11a25e,null));};exports[_0x1453('0x20')]=function(_0x2fcaed,_0x45a4fe){var _0xee5067;return db['CmHopper']['find']({'where':{'id':_0x2fcaed[_0x1453('0x52')]['id']}})[_0x1453('0x1f')](handleEntityNotFound(_0x45a4fe,null))['then'](function(_0xc5fcf8){if(_0xc5fcf8){return _0xc5fcf8[_0x1453('0x20')]()[_0x1453('0x1f')](function(_0x2355b5){return _0x2355b5;});}})[_0x1453('0x1f')](function(_0x1180b9){_0xee5067=_0x1180b9;if(_0x1180b9){if(_0x1180b9[_0x1453('0x5b')]||_0x1180b9[_0x1453('0x5c')]){return db[_0x1180b9[_0x1453('0x5b')]?_0x1453('0x5d'):_0x1453('0x5e')][_0x1453('0x56')]({'where':{'id':_0x1180b9[_0x1453('0x5b')]?_0x1180b9['VoiceQueueId']:_0x1180b9[_0x1453('0x5c')]},'attributes':['id',_0x1453('0x23')],'raw':!![]});}}})['then'](function(_0x258d67){var _0x493adf={};if(_0x258d67){_[_0x1453('0x4b')](_0x493adf,_['omit'](_0xee5067[_0x1453('0x5f')],[_0x1453('0x60'),_0x1453('0x61'),'id']));_0x493adf[_0x1453('0x62')]=0x15;_0x493adf[_0x1453('0x63')]=_0x1453('0x64');_0x493adf[_0x1453('0x65')]=_0x258d67[_0x1453('0x23')];_0x493adf['membername']=_0x2fcaed['user']['name'];_0x493adf['UserId']=_0x2fcaed[_0x1453('0x66')]['id'];_0x493adf[_0x1453('0x64')]=!![];_0x493adf[_0x1453('0x67')]=moment()[_0x1453('0x68')](_0x1453('0x69'));_0x493adf[_0x1453('0x6a')]=_0xee5067[_0x1453('0x6b')];_0x493adf[_0x1453('0x6c')]=_0xee5067[_0x1453('0x5b')]?_0x1453('0x6d'):_0x1453('0x6e');return db[_0x1453('0x6f')]['find']({'where':{'id':_0x493adf[_0x1453('0x70')]},'attributes':[_0x1453('0x71'),'lastName']})[_0x1453('0x1f')](function(_0x4bd314){if(!_[_0x1453('0x72')](_0x45a4fe)&&!_[_0x1453('0x72')](_0x4bd314[_0x1453('0x71')])){_0x493adf[_0x1453('0x73')]=_0x4bd314[_0x1453('0x71')];if(!_['isNil'](_0x4bd314['lastName'])){_0x493adf['calleridname']+='\x20'+_0x4bd314[_0x1453('0x74')];}}})['finally'](function(){return db[_0x1453('0x75')][_0x1453('0x57')](_0x493adf);});}})[_0x1453('0x1f')](function(){return _0x45a4fe[_0x1453('0x17')](0xcc)['end']();})[_0x1453('0x50')](handleError(_0x45a4fe,null));};exports['getPreview']=function(_0xe12fa0,_0x3620a0,_0x2b75b1){var _0x551dcb=[];return db[_0x1453('0x6f')][_0x1453('0x5a')]()['then'](function(_0x453442){_0x551dcb=_[_0x1453('0x2d')](_0x453442);return _0xe12fa0[_0x1453('0x66')][_0x1453('0x76')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x1453('0x77')],'raw':!![]});})[_0x1453('0x1f')](function(_0x41de38){if(_0x41de38&&_0x41de38['length']){return db[_0x1453('0x78')][_0x1453('0x79')](function(_0x199c42){var _0x9d45ee={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1453('0x68')](_0x1453('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x41de38,'id')},'$or':[{'UserId':null},{'UserId':_0xe12fa0[_0x1453('0x66')]['id']}]};var _0x1f7c86=[];if(_0xe12fa0[_0x1453('0x58')][_0x1453('0x7a')]&&_0xe12fa0[_0x1453('0x58')][_0x1453('0x7a')]===_0x1453('0x7b')){if(!_[_0x1453('0x7c')](_0xe12fa0[_0x1453('0x58')][_0x1453('0x7d')])){_0x9d45ee['id']={'$in':_0xe12fa0[_0x1453('0x58')]['hopperIds']};}_0x1f7c86=[[_0x1453('0x7e'),_0x1453('0x7f')],['scheduledAt',_0x41de38[0x0][_0x1453('0x77')]==='ASC'?_0x1453('0x80'):_0x1453('0x7f')],db['sequelize']['literal'](_0x1453('0x81')),['id','DESC']];}else{if(!_[_0x1453('0x7c')](_0xe12fa0['body'][_0x1453('0x7d')])){_0x9d45ee['id']={'$notIn':_0xe12fa0[_0x1453('0x58')]['hopperIds']};}_0x1f7c86=[[_0x1453('0x7e'),_0x1453('0x80')],[_0x1453('0x82'),_0x41de38[0x0]['dialOrderByScheduledAt']],db[_0x1453('0x78')]['literal'](_0x1453('0x83')),['id',_0x1453('0x7f')]];}return db[_0x1453('0x27')][_0x1453('0x84')]({'attributes':['id','scheduledat'],'where':_0x9d45ee,'order':_0x1f7c86,'transaction':_0x199c42,'lock':_0x199c42[_0x1453('0x85')][_0x1453('0x86')],'include':[{'model':db['CmContact'],'as':_0x1453('0x87'),'attributes':_0x551dcb,'include':[{'model':db[_0x1453('0x88')],'as':_0x1453('0x89'),'attributes':['id',_0x1453('0x23')]}]},{'model':db[_0x1453('0x8a')],'as':_0x1453('0x8b'),'attributes':['id','name']},{'model':db[_0x1453('0x5d')],'as':_0x1453('0x8c'),'attributes':['id',_0x1453('0x23'),_0x1453('0x8d')]}]})['then'](function(_0x176645){if(_0x176645){return _0x176645[_0x1453('0x59')]({'UserId':_0xe12fa0[_0x1453('0x66')]['id']},{'transaction':_0x199c42});}});});}})[_0x1453('0x1f')](handleEntityNotFound(_0x3620a0,null))[_0x1453('0x1f')](respondWithResult(_0x3620a0,null))['catch'](handleError(_0x3620a0,null));};exports[_0x1453('0x8e')]=function(_0x464cfd,_0x37c963,_0x2253df){return _0x464cfd['user'][_0x1453('0x76')]({'where':{'type':_0x1453('0x8f'),'dialActive':!![],'dialMethod':_0x1453('0x90')},'attributes':['id'],'raw':!![]})[_0x1453('0x1f')](function(_0x3ea404){if(_0x3ea404&&_0x3ea404['length']){return db['CmHopper'][_0x1453('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1453('0x68')](_0x1453('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x3ea404,'id')},'$or':[{'UserId':null},{'UserId':_0x464cfd[_0x1453('0x66')]['id']}]}});}return 0x0;})['then'](function(_0x1256b2){if(!_[_0x1453('0x72')](_0x1256b2)&&_[_0x1453('0x91')](_0x1256b2)){return _0x37c963['status'](0xc8)['json']({'contacts':_0x1256b2});}else{logger[_0x1453('0x21')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1453('0x8e'),0x194,_0x1453('0x92'));_0x37c963[_0x1453('0x16')](0x194);}})['catch'](handleError(_0x37c963,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index e4d90a6..040c853 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 _0x5496=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1b7d10,_0x59d677){var _0x36ea4f=function(_0x3b9492){while(--_0x3b9492){_0x1b7d10['push'](_0x1b7d10['shift']());}};_0x36ea4f(++_0x59d677);}(_0x5496,0x175));var _0x6549=function(_0x54093f,_0x941d16){_0x54093f=_0x54093f-0x0;var _0x2d1b6f=_0x5496[_0x54093f];return _0x2d1b6f;};'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')]('CmHopper',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'phone','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0x22206a,_0x427496){var _0x38c2b3=function(_0x98a71a){while(--_0x98a71a){_0x22206a['push'](_0x22206a['shift']());}};_0x38c2b3(++_0x427496);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x5fc3[_0x4191af];return _0x27bebf;};'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')]('CmHopper',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]},{'name':_0x35fc('0xd'),'fields':[_0x35fc('0xd')]},{'name':_0x35fc('0xe'),'fields':[_0x35fc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index d43184d..4666451 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 _0xe3bb=['request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','message','error','result','GetCmHopper','CmHopper','findAll','options','attributes','limit','include','map','model','then','ShowCmHopper','find','raw','CreateCmHopper','create','body','catch','update','where','UpdateCmHopper','destroy','DestroyCmHopper','CmContact','describe','transaction','LOCK','Contact','Agent','length','UserId','push','all','GetContactDialer','sequelize','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','keys','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x1d65d8,_0x379eed){var _0x5e7880=function(_0x59d42d){while(--_0x59d42d){_0x1d65d8['push'](_0x1d65d8['shift']());}};_0x5e7880(++_0x379eed);}(_0xe3bb,0x14f));var _0xbe3b=function(_0x99181b,_0x7ec23a){_0x99181b=_0x99181b-0x0;var _0x31eb30=_0xe3bb[_0x99181b];return _0x31eb30;};'use strict';var _=require(_0xbe3b('0x0'));var util=require(_0xbe3b('0x1'));var moment=require(_0xbe3b('0x2'));var BPromise=require(_0xbe3b('0x3'));var rs=require(_0xbe3b('0x4'));var fs=require('fs');var Redis=require(_0xbe3b('0x5'));var db=require(_0xbe3b('0x6'))['db'];var utils=require(_0xbe3b('0x7'));var logger=require(_0xbe3b('0x8'))(_0xbe3b('0x9'));var config=require(_0xbe3b('0xa'));var jayson=require(_0xbe3b('0xb'));var client=jayson[_0xbe3b('0xc')][_0xbe3b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b2f18,_0x575ce8,_0x39c826){return new BPromise(function(_0x5b2205,_0x1bc92d){return client['request'](_0x1b2f18,_0x39c826)['then'](function(_0x31612a){logger[_0xbe3b('0xe')]('CmHopper,\x20%s,\x20%s',_0x575ce8,_0xbe3b('0xf'));logger[_0xbe3b('0x10')](_0xbe3b('0x11'),_0x575ce8,_0xbe3b('0xf'),JSON[_0xbe3b('0x12')](_0x31612a));if(_0x31612a['error']){if(_0x31612a['error']['code']===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x575ce8,_0x31612a['error'][_0xbe3b('0x13')]);return _0x1bc92d(_0x31612a[_0xbe3b('0x14')]['message']);}logger[_0xbe3b('0x14')]('CmHopper,\x20%s,\x20%s',_0x575ce8,_0x31612a['error'][_0xbe3b('0x13')]);return _0x5b2205(_0x31612a[_0xbe3b('0x14')][_0xbe3b('0x13')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x575ce8,_0xbe3b('0xf'));_0x5b2205(_0x31612a[_0xbe3b('0x15')]['message']);}})['catch'](function(_0x378765){logger[_0xbe3b('0x14')]('CmHopper,\x20%s,\x20%s',_0x575ce8,_0x378765);_0x1bc92d(_0x378765);});});}exports[_0xbe3b('0x16')]=function(_0x38a050){var _0x1f129e=this;return new Promise(function(_0x2e51c1,_0xe7fc17){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'raw':_0x38a050['options']?_0x38a050[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38a050[_0xbe3b('0x19')]?_0x38a050[_0xbe3b('0x19')]['where']||null:null,'attributes':_0x38a050['options']?_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'limit':_0x38a050[_0xbe3b('0x19')]?_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null,'include':_0x38a050['options']?_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1c')],function(_0x10c36e){return{'model':db[_0x10c36e['model']],'as':_0x10c36e['as'],'attributes':_0x10c36e['attributes'],'include':_0x10c36e[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x10c36e[_0xbe3b('0x1c')],function(_0x1c7c58){return{'model':db[_0x1c7c58[_0xbe3b('0x1e')]],'as':_0x1c7c58['as'],'attributes':_0x1c7c58[_0xbe3b('0x1a')],'include':_0x1c7c58[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x1c7c58[_0xbe3b('0x1c')],function(_0x28e914){return{'model':db[_0x28e914[_0xbe3b('0x1e')]],'as':_0x28e914['as'],'attributes':_0x28e914['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x35c62b){logger['info'](_0xbe3b('0x16'),_0x38a050);logger[_0xbe3b('0x10')](_0xbe3b('0x16'),_0x38a050,JSON[_0xbe3b('0x12')](_0x35c62b));_0x2e51c1(_0x35c62b);})['catch'](function(_0x27fa1f){logger[_0xbe3b('0x14')](_0xbe3b('0x16'),_0x27fa1f[_0xbe3b('0x13')],_0x38a050);_0xe7fc17(_0x1f129e[_0xbe3b('0x14')](0x1f4,_0x27fa1f[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x20')]=function(_0x3b2329){var _0x2c00d3=this;return new Promise(function(_0x508939,_0x4f2d32){return db[_0xbe3b('0x17')][_0xbe3b('0x21')]({'raw':_0x3b2329[_0xbe3b('0x19')]?_0x3b2329['options'][_0xbe3b('0x22')]===undefined?!![]:![]:!![],'where':_0x3b2329['options']?_0x3b2329['options']['where']||null:null,'attributes':_0x3b2329[_0xbe3b('0x19')]?_0x3b2329[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'include':_0x3b2329['options']?_0x3b2329['options']['include']?_[_0xbe3b('0x1d')](_0x3b2329[_0xbe3b('0x19')]['include'],function(_0x2d826b){return{'model':db[_0x2d826b['model']],'as':_0x2d826b['as'],'attributes':_0x2d826b[_0xbe3b('0x1a')],'include':_0x2d826b[_0xbe3b('0x1c')]?_['map'](_0x2d826b[_0xbe3b('0x1c')],function(_0xd3ead7){return{'model':db[_0xd3ead7[_0xbe3b('0x1e')]],'as':_0xd3ead7['as'],'attributes':_0xd3ead7['attributes'],'include':_0xd3ead7[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0xd3ead7[_0xbe3b('0x1c')],function(_0x4fe90e){return{'model':db[_0x4fe90e[_0xbe3b('0x1e')]],'as':_0x4fe90e['as'],'attributes':_0x4fe90e[_0xbe3b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x190c44){logger[_0xbe3b('0xe')](_0xbe3b('0x20'),_0x3b2329);logger['debug'](_0xbe3b('0x20'),_0x3b2329,JSON['stringify'](_0x190c44));_0x508939(_0x190c44);})['catch'](function(_0x312278){logger[_0xbe3b('0x14')](_0xbe3b('0x20'),_0x312278['message'],_0x3b2329);_0x4f2d32(_0x2c00d3[_0xbe3b('0x14')](0x1f4,_0x312278[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x23')]=function(_0x49c65f){var _0x2ac53a=this;return new Promise(function(_0x6714d7,_0x449a50){return db[_0xbe3b('0x17')][_0xbe3b('0x24')](_0x49c65f[_0xbe3b('0x25')],{'raw':_0x49c65f[_0xbe3b('0x19')]?_0x49c65f[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3fae1a){logger[_0xbe3b('0xe')]('CreateCmHopper',_0x49c65f);logger[_0xbe3b('0x10')](_0xbe3b('0x23'),_0x49c65f,JSON[_0xbe3b('0x12')](_0x3fae1a));_0x6714d7(_0x3fae1a);})[_0xbe3b('0x26')](function(_0x224663){logger[_0xbe3b('0x14')](_0xbe3b('0x23'),_0x224663['message'],_0x49c65f);_0x449a50(_0x2ac53a[_0xbe3b('0x14')](0x1f4,_0x224663['message']));});});};exports['UpdateCmHopper']=function(_0x4e39ea){var _0x601d0e=this;return new Promise(function(_0x45bce5,_0x3b74f8){return db[_0xbe3b('0x17')][_0xbe3b('0x27')](_0x4e39ea['body'],{'raw':_0x4e39ea['options']?_0x4e39ea['options'][_0xbe3b('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e39ea[_0xbe3b('0x19')]?_0x4e39ea['options'][_0xbe3b('0x28')]||null:null,'attributes':_0x4e39ea[_0xbe3b('0x19')]?_0x4e39ea[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'limit':_0x4e39ea[_0xbe3b('0x19')]?_0x4e39ea[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null})['then'](function(_0x3db85d){logger[_0xbe3b('0xe')]('UpdateCmHopper',_0x4e39ea);logger['debug'](_0xbe3b('0x29'),_0x4e39ea,JSON[_0xbe3b('0x12')](_0x3db85d));_0x45bce5(_0x3db85d);})[_0xbe3b('0x26')](function(_0xd7f3e){logger[_0xbe3b('0x14')]('UpdateCmHopper',_0xd7f3e['message'],_0x4e39ea);_0x3b74f8(_0x601d0e[_0xbe3b('0x14')](0x1f4,_0xd7f3e['message']));});});};exports['DestroyCmHopper']=function(_0x32ab7d){var _0x1c8253=this;return new Promise(function(_0x311668,_0x5de9bc){return db[_0xbe3b('0x17')][_0xbe3b('0x2a')]({'where':_0x32ab7d['options']?_0x32ab7d[_0xbe3b('0x19')]['where']||null:null})[_0xbe3b('0x1f')](function(_0x671187){logger[_0xbe3b('0xe')](_0xbe3b('0x2b'),_0x32ab7d);logger[_0xbe3b('0x10')](_0xbe3b('0x2b'),_0x32ab7d,JSON['stringify'](_0x671187));_0x311668(_0x671187);})[_0xbe3b('0x26')](function(_0x345cbf){logger[_0xbe3b('0x14')](_0xbe3b('0x2b'),_0x345cbf['message'],_0x32ab7d);_0x5de9bc(_0x1c8253[_0xbe3b('0x14')](0x1f4,_0x345cbf[_0xbe3b('0x13')]));});});};exports['GetContactDialer']=function(_0x3c65d4){var _0x676fdb=this;return new Promise(function(_0x42e39b,_0x56167a){return db[_0xbe3b('0x2c')][_0xbe3b('0x2d')]()[_0xbe3b('0x1f')](function(_0x18bac3){return db['sequelize'][_0xbe3b('0x2e')](function(_0x6606e){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'where':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4[_0xbe3b('0x19')][_0xbe3b('0x28')]||null:null,'attributes':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4['options'][_0xbe3b('0x1a')]||null:null,'limit':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null,'order':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4[_0xbe3b('0x19')]['order']||null:null,'transaction':_0x6606e,'lock':_0x6606e[_0xbe3b('0x2f')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xbe3b('0x30'),'attributes':_['keys'](_0x18bac3)},{'model':db['User'],'as':_0xbe3b('0x31'),'attributes':['id','name','voicePause']}]})['then'](function(_0x3527b9){var _0x4a6091=[];var _0x347404=[];for(var _0x5c90cf=0x0;_0x5c90cf<_0x3527b9[_0xbe3b('0x32')];_0x5c90cf+=0x1){var _0x354d13=_0x3527b9[_0x5c90cf][_0xbe3b('0x33')];if(_0x354d13===null){_0x4a6091[_0xbe3b('0x34')](_0x3527b9[_0x5c90cf][_0xbe3b('0x27')](_0x3c65d4[_0xbe3b('0x25')],{'transaction':_0x6606e}));}else if(!_0x347404['includes'](_0x354d13)){_0x347404['push'](_0x354d13);_0x4a6091['push'](_0x3527b9[_0x5c90cf][_0xbe3b('0x27')](_0x3c65d4[_0xbe3b('0x25')],{'transaction':_0x6606e}));}}return BPromise[_0xbe3b('0x35')](_0x4a6091);});})['then'](function(_0x5d62b4){logger[_0xbe3b('0xe')](_0xbe3b('0x36'),_0x3c65d4);logger['debug'](_0xbe3b('0x36'),_0x3c65d4,JSON['stringify'](_0x5d62b4));_0x42e39b(_0x5d62b4);})['catch'](function(_0xa67368){logger[_0xbe3b('0x14')](_0xbe3b('0x36'),_0xa67368[_0xbe3b('0x13')],_0x3c65d4);_0x56167a(_0x676fdb[_0xbe3b('0x14')](0x1f4,_0xa67368[_0xbe3b('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x2eed9f){var _0x21237b=this;return new Promise(function(_0x288713,_0x21f263){return db[_0xbe3b('0x37')][_0xbe3b('0x2e')](function(_0x2440da){return db['CmHopperFinal']['create'](_0x2eed9f['body'],{'raw':_0x2eed9f[_0xbe3b('0x19')]?_0x2eed9f[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x2440da})['then'](function(){return db[_0xbe3b('0x17')][_0xbe3b('0x2a')]({'where':_0x2eed9f[_0xbe3b('0x19')]?_0x2eed9f[_0xbe3b('0x19')][_0xbe3b('0x28')]||null:null,'transaction':_0x2440da});});})[_0xbe3b('0x1f')](function(_0x5e858a){logger[_0xbe3b('0xe')]('MoveContactManagedDialer',_0x2eed9f);logger[_0xbe3b('0x10')](_0xbe3b('0x38'),_0x2eed9f,JSON[_0xbe3b('0x12')](_0x5e858a));_0x288713(_0x5e858a);})[_0xbe3b('0x26')](function(_0x3a2a5f){logger[_0xbe3b('0x14')]('MoveContactManagedDialer',_0x3a2a5f[_0xbe3b('0x13')],_0x2eed9f);_0x21f263(_0x21237b['error'](0x1f4,_0x3a2a5f[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x39')]=function(_0x38ce68){var _0x213bc0=this;return new Promise(function(_0x22b98a,_0x57aa39){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'raw':_0x38ce68[_0xbe3b('0x19')]?_0x38ce68[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38ce68[_0xbe3b('0x19')]?_0x38ce68[_0xbe3b('0x19')][_0xbe3b('0x28')]||null:null,'attributes':[[db[_0xbe3b('0x37')]['fn'](_0xbe3b('0x3a'),db[_0xbe3b('0x37')]['fn']('IF',db[_0xbe3b('0x37')][_0xbe3b('0x3b')](_0xbe3b('0x3c')+util[_0xbe3b('0x3d')](_0xbe3b('0x3e'),moment()['format'](_0xbe3b('0x3f')))+_0xbe3b('0x40')))),_0xbe3b('0x41')]]})[_0xbe3b('0x1f')](function(_0x3c1bc6){logger[_0xbe3b('0xe')](_0xbe3b('0x39'),_0x38ce68);logger[_0xbe3b('0x10')](_0xbe3b('0x39'),_0x38ce68,JSON['stringify'](_0x3c1bc6));_0x22b98a(_0x3c1bc6);})[_0xbe3b('0x26')](function(_0x4dde01){logger[_0xbe3b('0x14')](_0xbe3b('0x39'),_0x4dde01[_0xbe3b('0x13')],_0x38ce68);_0x57aa39(_0x213bc0[_0xbe3b('0x14')](0x1f4,_0x4dde01[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x42')]=function(_0x135df3){var _0x23e50d=this;return new Promise(function(_0x18b39d,_0x5834b2){return db['CmContact']['describe']()[_0xbe3b('0x1f')](function(_0x5cc1f9){return db[_0xbe3b('0x37')][_0xbe3b('0x2e')](function(_0x1e4b51){return db['CmHopper'][_0xbe3b('0x18')]({'where':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')]['where']||null:null,'attributes':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'limit':0x1,'order':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x43')]||null:null,'group':db[_0xbe3b('0x17')][_0xbe3b('0x33')],'transaction':_0x1e4b51,'lock':_0x1e4b51[_0xbe3b('0x2f')][_0xbe3b('0x44')],'include':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x1c')]?_['map'](_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x1c')],function(_0x332582){return{'model':db[_0x332582[_0xbe3b('0x1e')]],'as':_0x332582['as'],'attributes':_0x332582[_0xbe3b('0x1a')],'include':_0x332582[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x332582['include'],function(_0x5476ed){return{'model':db[_0x5476ed['model']],'as':_0x5476ed['as'],'attributes':_0x5476ed[_0xbe3b('0x1a')],'include':_0x5476ed['include']?_['map'](_0x5476ed[_0xbe3b('0x1c')],function(_0x1c5c84){return{'model':db[_0x1c5c84['model']],'as':_0x1c5c84['as'],'attributes':_0x1c5c84['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x4c6519){var _0x80a9fe=[];for(var _0x2b6ddb=0x0;_0x2b6ddb<_0x4c6519[_0xbe3b('0x32')];_0x2b6ddb+=0x1){_0x80a9fe[_0xbe3b('0x34')](_0x4c6519[_0x2b6ddb][_0xbe3b('0x27')](_0x135df3[_0xbe3b('0x25')],{'transaction':_0x1e4b51}));}return BPromise[_0xbe3b('0x35')](_0x80a9fe);});})[_0xbe3b('0x1f')](function(_0x16c0da){logger[_0xbe3b('0xe')]('GetContactRecallMe',_0x135df3);logger[_0xbe3b('0x10')]('GetContactRecallMe',_0x135df3,JSON[_0xbe3b('0x12')](_0x16c0da));_0x18b39d(_0x16c0da);})[_0xbe3b('0x26')](function(_0x459f18){logger[_0xbe3b('0x14')](_0xbe3b('0x42'),_0x459f18[_0xbe3b('0x13')],_0x135df3);_0x5834b2(_0x23e50d[_0xbe3b('0x14')](0x1f4,_0x459f18['message']));});});});};exports['GetCmHopperPreview']=function(_0x49bb14){var _0x54a77d=this;return new Promise(function(_0x3df3b0,_0x109ec5){db[_0xbe3b('0x2c')][_0xbe3b('0x2d')]()[_0xbe3b('0x1f')](function(_0x4f1adf){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'raw':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14['options'][_0xbe3b('0x22')]===undefined?!![]:![]:!![],'where':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14['options'][_0xbe3b('0x28')]||null:null,'attributes':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14['options']['attributes']||null:null,'limit':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null,'include':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14[_0xbe3b('0x19')]['include']?_[_0xbe3b('0x1d')](_0x49bb14[_0xbe3b('0x19')]['include'],function(_0x1fd6eb){return{'model':db[_0x1fd6eb['model']],'as':_0x1fd6eb['as'],'attributes':_0x1fd6eb['as']===_0xbe3b('0x30')?_[_0xbe3b('0x45')](_0x4f1adf):_0x1fd6eb[_0xbe3b('0x1a')],'include':_0x1fd6eb['include']?_[_0xbe3b('0x1d')](_0x1fd6eb[_0xbe3b('0x1c')],function(_0x130475){return{'model':db[_0x130475[_0xbe3b('0x1e')]],'as':_0x130475['as'],'attributes':_0x130475[_0xbe3b('0x1a')],'include':_0x130475['include']?_[_0xbe3b('0x1d')](_0x130475[_0xbe3b('0x1c')],function(_0x2d774b){return{'model':db[_0x2d774b[_0xbe3b('0x1e')]],'as':_0x2d774b['as'],'attributes':_0x2d774b[_0xbe3b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x148a61){logger['info'](_0xbe3b('0x16'),_0x49bb14);logger[_0xbe3b('0x10')](_0xbe3b('0x16'),_0x49bb14,JSON['stringify'](_0x148a61));_0x3df3b0(_0x148a61);})['catch'](function(_0x3ec968){logger[_0xbe3b('0x14')](_0xbe3b('0x16'),_0x3ec968[_0xbe3b('0x13')],_0x49bb14);_0x109ec5(_0x54a77d[_0xbe3b('0x14')](0x1f4,_0x3ec968['message']));});});});}; \ No newline at end of file +var _0x3e79=['jayson/promise','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopper','findAll','options','where','include','map','model','GetCmHopper','find','attributes','ShowCmHopper','CreateCmHopper','create','raw','UpdateCmHopper','update','body','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','User','Agent','name','voicePause','UserId','includes','push','all','MoveContactManagedDialer','sequelize','CountReScheduled','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','length','GetContactRecallMe','GetCmHopperPreview','Contact','keys','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x27f9a7,_0x5ca1a7){var _0xd7f468=function(_0x98b4b6){while(--_0x98b4b6){_0x27f9a7['push'](_0x27f9a7['shift']());}};_0xd7f468(++_0x5ca1a7);}(_0x3e79,0x15c));var _0x93e7=function(_0x1c8fb1,_0xb39e81){_0x1c8fb1=_0x1c8fb1-0x0;var _0x57f8e8=_0x3e79[_0x1c8fb1];return _0x57f8e8;};'use strict';var _=require(_0x93e7('0x0'));var util=require(_0x93e7('0x1'));var moment=require('moment');var BPromise=require(_0x93e7('0x2'));var rs=require(_0x93e7('0x3'));var fs=require('fs');var Redis=require(_0x93e7('0x4'));var db=require(_0x93e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x93e7('0x6'));var jayson=require(_0x93e7('0x7'));var client=jayson['client'][_0x93e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ba29e,_0x3bfbe7,_0x365e84){return new BPromise(function(_0xac6e39,_0x3a1256){return client['request'](_0x2ba29e,_0x365e84)[_0x93e7('0x9')](function(_0x3eb595){logger[_0x93e7('0xa')](_0x93e7('0xb'),_0x3bfbe7,_0x93e7('0xc'));logger[_0x93e7('0xd')](_0x93e7('0xe'),_0x3bfbe7,'request\x20sent',JSON[_0x93e7('0xf')](_0x3eb595));if(_0x3eb595[_0x93e7('0x10')]){if(_0x3eb595[_0x93e7('0x10')][_0x93e7('0x11')]===0x1f4){logger[_0x93e7('0x10')](_0x93e7('0xb'),_0x3bfbe7,_0x3eb595[_0x93e7('0x10')][_0x93e7('0x12')]);return _0x3a1256(_0x3eb595['error']['message']);}logger[_0x93e7('0x10')](_0x93e7('0xb'),_0x3bfbe7,_0x3eb595['error'][_0x93e7('0x12')]);return _0xac6e39(_0x3eb595[_0x93e7('0x10')][_0x93e7('0x12')]);}else{logger[_0x93e7('0xa')](_0x93e7('0xb'),_0x3bfbe7,'request\x20sent');_0xac6e39(_0x3eb595[_0x93e7('0x13')][_0x93e7('0x12')]);}})[_0x93e7('0x14')](function(_0x1cba2f){logger[_0x93e7('0x10')]('CmHopper,\x20%s,\x20%s',_0x3bfbe7,_0x1cba2f);_0x3a1256(_0x1cba2f);});});}exports['GetCmHopper']=function(_0x9a1318){var _0x4e0a1a=this;return new Promise(function(_0x1087fa,_0x5c5597){return db[_0x93e7('0x15')][_0x93e7('0x16')]({'raw':_0x9a1318[_0x93e7('0x17')]?_0x9a1318[_0x93e7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x9a1318[_0x93e7('0x17')]?_0x9a1318[_0x93e7('0x17')][_0x93e7('0x18')]||null:null,'attributes':_0x9a1318[_0x93e7('0x17')]?_0x9a1318['options']['attributes']||null:null,'limit':_0x9a1318[_0x93e7('0x17')]?_0x9a1318[_0x93e7('0x17')]['limit']||null:null,'include':_0x9a1318[_0x93e7('0x17')]?_0x9a1318[_0x93e7('0x17')][_0x93e7('0x19')]?_[_0x93e7('0x1a')](_0x9a1318[_0x93e7('0x17')][_0x93e7('0x19')],function(_0x390e5e){return{'model':db[_0x390e5e[_0x93e7('0x1b')]],'as':_0x390e5e['as'],'attributes':_0x390e5e['attributes'],'include':_0x390e5e['include']?_[_0x93e7('0x1a')](_0x390e5e[_0x93e7('0x19')],function(_0x1b2e05){return{'model':db[_0x1b2e05[_0x93e7('0x1b')]],'as':_0x1b2e05['as'],'attributes':_0x1b2e05['attributes'],'include':_0x1b2e05[_0x93e7('0x19')]?_[_0x93e7('0x1a')](_0x1b2e05[_0x93e7('0x19')],function(_0x257770){return{'model':db[_0x257770[_0x93e7('0x1b')]],'as':_0x257770['as'],'attributes':_0x257770['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42410b){logger[_0x93e7('0xa')](_0x93e7('0x1c'),_0x9a1318);logger['debug']('GetCmHopper',_0x9a1318,JSON[_0x93e7('0xf')](_0x42410b));_0x1087fa(_0x42410b);})[_0x93e7('0x14')](function(_0x257f8c){logger[_0x93e7('0x10')](_0x93e7('0x1c'),_0x257f8c[_0x93e7('0x12')],_0x9a1318);_0x5c5597(_0x4e0a1a['error'](0x1f4,_0x257f8c['message']));});});};exports['ShowCmHopper']=function(_0x2e63b0){var _0x181b80=this;return new Promise(function(_0x4d528c,_0x3704b7){return db[_0x93e7('0x15')][_0x93e7('0x1d')]({'raw':_0x2e63b0['options']?_0x2e63b0[_0x93e7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e63b0[_0x93e7('0x17')]?_0x2e63b0[_0x93e7('0x17')]['where']||null:null,'attributes':_0x2e63b0[_0x93e7('0x17')]?_0x2e63b0['options'][_0x93e7('0x1e')]||null:null,'include':_0x2e63b0[_0x93e7('0x17')]?_0x2e63b0[_0x93e7('0x17')]['include']?_['map'](_0x2e63b0[_0x93e7('0x17')][_0x93e7('0x19')],function(_0x4cb763){return{'model':db[_0x4cb763[_0x93e7('0x1b')]],'as':_0x4cb763['as'],'attributes':_0x4cb763[_0x93e7('0x1e')],'include':_0x4cb763[_0x93e7('0x19')]?_[_0x93e7('0x1a')](_0x4cb763[_0x93e7('0x19')],function(_0x42eed2){return{'model':db[_0x42eed2[_0x93e7('0x1b')]],'as':_0x42eed2['as'],'attributes':_0x42eed2[_0x93e7('0x1e')],'include':_0x42eed2[_0x93e7('0x19')]?_['map'](_0x42eed2[_0x93e7('0x19')],function(_0x1908a1){return{'model':db[_0x1908a1[_0x93e7('0x1b')]],'as':_0x1908a1['as'],'attributes':_0x1908a1[_0x93e7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x93e7('0x9')](function(_0x14fa2c){logger[_0x93e7('0xa')](_0x93e7('0x1f'),_0x2e63b0);logger[_0x93e7('0xd')]('ShowCmHopper',_0x2e63b0,JSON['stringify'](_0x14fa2c));_0x4d528c(_0x14fa2c);})[_0x93e7('0x14')](function(_0x5ea0e9){logger[_0x93e7('0x10')]('ShowCmHopper',_0x5ea0e9[_0x93e7('0x12')],_0x2e63b0);_0x3704b7(_0x181b80[_0x93e7('0x10')](0x1f4,_0x5ea0e9[_0x93e7('0x12')]));});});};exports[_0x93e7('0x20')]=function(_0x4c5ce6){var _0x17a451=this;return new Promise(function(_0x2e5263,_0x4c4dbf){return db['CmHopper'][_0x93e7('0x21')](_0x4c5ce6['body'],{'raw':_0x4c5ce6[_0x93e7('0x17')]?_0x4c5ce6['options'][_0x93e7('0x22')]===undefined?!![]:![]:!![]})[_0x93e7('0x9')](function(_0x55981c){logger[_0x93e7('0xa')](_0x93e7('0x20'),_0x4c5ce6);logger[_0x93e7('0xd')](_0x93e7('0x20'),_0x4c5ce6,JSON['stringify'](_0x55981c));_0x2e5263(_0x55981c);})['catch'](function(_0x5f27d6){logger[_0x93e7('0x10')](_0x93e7('0x20'),_0x5f27d6[_0x93e7('0x12')],_0x4c5ce6);_0x4c4dbf(_0x17a451[_0x93e7('0x10')](0x1f4,_0x5f27d6['message']));});});};exports[_0x93e7('0x23')]=function(_0x10c2ed){var _0x518bcb=this;return new Promise(function(_0x3c96ee,_0x5cd3de){return db['CmHopper'][_0x93e7('0x24')](_0x10c2ed[_0x93e7('0x25')],{'raw':_0x10c2ed[_0x93e7('0x17')]?_0x10c2ed['options'][_0x93e7('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10c2ed['options']?_0x10c2ed['options'][_0x93e7('0x18')]||null:null,'attributes':_0x10c2ed[_0x93e7('0x17')]?_0x10c2ed['options']['attributes']||null:null,'limit':_0x10c2ed[_0x93e7('0x17')]?_0x10c2ed[_0x93e7('0x17')][_0x93e7('0x26')]||null:null})[_0x93e7('0x9')](function(_0x3bd16a){logger[_0x93e7('0xa')](_0x93e7('0x23'),_0x10c2ed);logger['debug']('UpdateCmHopper',_0x10c2ed,JSON['stringify'](_0x3bd16a));_0x3c96ee(_0x3bd16a);})[_0x93e7('0x14')](function(_0x112915){logger['error'](_0x93e7('0x23'),_0x112915[_0x93e7('0x12')],_0x10c2ed);_0x5cd3de(_0x518bcb['error'](0x1f4,_0x112915[_0x93e7('0x12')]));});});};exports[_0x93e7('0x27')]=function(_0x16e660){var _0x270127=this;return new Promise(function(_0x3d5912,_0x2e3c24){return db[_0x93e7('0x15')][_0x93e7('0x28')]({'where':_0x16e660[_0x93e7('0x17')]?_0x16e660[_0x93e7('0x17')]['where']||null:null})['then'](function(_0x233bd0){logger['info']('DestroyCmHopper',_0x16e660);logger['debug']('DestroyCmHopper',_0x16e660,JSON[_0x93e7('0xf')](_0x233bd0));_0x3d5912(_0x233bd0);})[_0x93e7('0x14')](function(_0xa69a37){logger['error'](_0x93e7('0x27'),_0xa69a37[_0x93e7('0x12')],_0x16e660);_0x2e3c24(_0x270127['error'](0x1f4,_0xa69a37[_0x93e7('0x12')]));});});};exports[_0x93e7('0x29')]=function(_0x1a5a4e){var _0x3aa554=this;return new Promise(function(_0x138d55,_0x45fec9){return db[_0x93e7('0x2a')][_0x93e7('0x2b')]()['then'](function(_0x55ac23){return db['sequelize'][_0x93e7('0x2c')](function(_0x552bbc){return db[_0x93e7('0x15')]['findAll']({'where':_0x1a5a4e[_0x93e7('0x17')]?_0x1a5a4e[_0x93e7('0x17')][_0x93e7('0x18')]||null:null,'attributes':_0x1a5a4e[_0x93e7('0x17')]?_0x1a5a4e['options'][_0x93e7('0x1e')]||null:null,'limit':_0x1a5a4e[_0x93e7('0x17')]?_0x1a5a4e[_0x93e7('0x17')]['limit']||null:null,'order':_0x1a5a4e['options']?_0x1a5a4e[_0x93e7('0x17')][_0x93e7('0x2d')]||null:null,'transaction':_0x552bbc,'lock':_0x552bbc[_0x93e7('0x2e')][_0x93e7('0x2f')],'include':[{'model':db[_0x93e7('0x2a')],'as':'Contact','attributes':_['keys'](_0x55ac23)},{'model':db[_0x93e7('0x30')],'as':_0x93e7('0x31'),'attributes':['id',_0x93e7('0x32'),_0x93e7('0x33')]}]})['then'](function(_0x2c5ae2){var _0x506fd6=[];var _0x3cd9d1=[];for(var _0x5b7c47=0x0;_0x5b7c47<_0x2c5ae2['length'];_0x5b7c47+=0x1){var _0x462f61=_0x2c5ae2[_0x5b7c47][_0x93e7('0x34')];if(_0x462f61===null){_0x506fd6['push'](_0x2c5ae2[_0x5b7c47][_0x93e7('0x24')](_0x1a5a4e[_0x93e7('0x25')],{'transaction':_0x552bbc}));}else if(!_0x3cd9d1[_0x93e7('0x35')](_0x462f61)){_0x3cd9d1[_0x93e7('0x36')](_0x462f61);_0x506fd6[_0x93e7('0x36')](_0x2c5ae2[_0x5b7c47][_0x93e7('0x24')](_0x1a5a4e[_0x93e7('0x25')],{'transaction':_0x552bbc}));}}return BPromise[_0x93e7('0x37')](_0x506fd6);});})[_0x93e7('0x9')](function(_0x4aaa18){logger[_0x93e7('0xa')]('GetContactDialer',_0x1a5a4e);logger[_0x93e7('0xd')](_0x93e7('0x29'),_0x1a5a4e,JSON['stringify'](_0x4aaa18));_0x138d55(_0x4aaa18);})[_0x93e7('0x14')](function(_0x58a8f0){logger[_0x93e7('0x10')]('GetContactDialer',_0x58a8f0[_0x93e7('0x12')],_0x1a5a4e);_0x45fec9(_0x3aa554['error'](0x1f4,_0x58a8f0[_0x93e7('0x12')]));});});});};exports[_0x93e7('0x38')]=function(_0x2d3ebd){var _0x23ba9a=this;return new Promise(function(_0x51c599,_0x256e62){return db[_0x93e7('0x39')][_0x93e7('0x2c')](function(_0x273275){return db['CmHopperFinal'][_0x93e7('0x21')](_0x2d3ebd['body'],{'raw':_0x2d3ebd[_0x93e7('0x17')]?_0x2d3ebd[_0x93e7('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x273275})['then'](function(){return db[_0x93e7('0x15')][_0x93e7('0x28')]({'where':_0x2d3ebd[_0x93e7('0x17')]?_0x2d3ebd[_0x93e7('0x17')][_0x93e7('0x18')]||null:null,'transaction':_0x273275});});})['then'](function(_0x1b92fc){logger[_0x93e7('0xa')](_0x93e7('0x38'),_0x2d3ebd);logger['debug'](_0x93e7('0x38'),_0x2d3ebd,JSON['stringify'](_0x1b92fc));_0x51c599(_0x1b92fc);})[_0x93e7('0x14')](function(_0xcf1630){logger[_0x93e7('0x10')](_0x93e7('0x38'),_0xcf1630['message'],_0x2d3ebd);_0x256e62(_0x23ba9a[_0x93e7('0x10')](0x1f4,_0xcf1630[_0x93e7('0x12')]));});});};exports[_0x93e7('0x3a')]=function(_0x4947e7){var _0x56d6a7=this;return new Promise(function(_0x2e166d,_0x89a96f){return db['CmHopper'][_0x93e7('0x16')]({'raw':_0x4947e7[_0x93e7('0x17')]?_0x4947e7[_0x93e7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4947e7[_0x93e7('0x17')]?_0x4947e7[_0x93e7('0x17')]['where']||null:null,'attributes':[[db[_0x93e7('0x39')]['fn']('COUNT',db[_0x93e7('0x39')]['fn']('IF',db[_0x93e7('0x39')][_0x93e7('0x3b')](_0x93e7('0x3c')+util['format'](_0x93e7('0x3d'),moment()[_0x93e7('0x3e')](_0x93e7('0x3f')))+_0x93e7('0x40')))),_0x93e7('0x41')]]})['then'](function(_0x14c98a){logger[_0x93e7('0xa')](_0x93e7('0x3a'),_0x4947e7);logger[_0x93e7('0xd')](_0x93e7('0x3a'),_0x4947e7,JSON[_0x93e7('0xf')](_0x14c98a));_0x2e166d(_0x14c98a);})['catch'](function(_0x11da72){logger[_0x93e7('0x10')](_0x93e7('0x3a'),_0x11da72[_0x93e7('0x12')],_0x4947e7);_0x89a96f(_0x56d6a7[_0x93e7('0x10')](0x1f4,_0x11da72[_0x93e7('0x12')]));});});};exports['GetContactRecallMe']=function(_0x3ae749){var _0x3e907e=this;return new Promise(function(_0xad79df,_0xd380d8){return db[_0x93e7('0x2a')][_0x93e7('0x2b')]()[_0x93e7('0x9')](function(_0x31008e){return db['sequelize'][_0x93e7('0x2c')](function(_0x521d5f){return db[_0x93e7('0x15')]['findAll']({'where':_0x3ae749[_0x93e7('0x17')]?_0x3ae749[_0x93e7('0x17')]['where']||null:null,'attributes':_0x3ae749['options']?_0x3ae749[_0x93e7('0x17')][_0x93e7('0x1e')]||null:null,'limit':0x1,'order':_0x3ae749[_0x93e7('0x17')]?_0x3ae749[_0x93e7('0x17')][_0x93e7('0x2d')]||null:null,'group':db[_0x93e7('0x15')][_0x93e7('0x34')],'transaction':_0x521d5f,'lock':_0x521d5f[_0x93e7('0x2e')][_0x93e7('0x2f')],'include':_0x3ae749[_0x93e7('0x17')]?_0x3ae749[_0x93e7('0x17')]['include']?_[_0x93e7('0x1a')](_0x3ae749[_0x93e7('0x17')][_0x93e7('0x19')],function(_0x5dc648){return{'model':db[_0x5dc648[_0x93e7('0x1b')]],'as':_0x5dc648['as'],'attributes':_0x5dc648[_0x93e7('0x1e')],'include':_0x5dc648[_0x93e7('0x19')]?_[_0x93e7('0x1a')](_0x5dc648[_0x93e7('0x19')],function(_0x538c2e){return{'model':db[_0x538c2e[_0x93e7('0x1b')]],'as':_0x538c2e['as'],'attributes':_0x538c2e['attributes'],'include':_0x538c2e[_0x93e7('0x19')]?_['map'](_0x538c2e[_0x93e7('0x19')],function(_0x2b03ff){return{'model':db[_0x2b03ff[_0x93e7('0x1b')]],'as':_0x2b03ff['as'],'attributes':_0x2b03ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16aade){var _0x203624=[];for(var _0xbbb70=0x0;_0xbbb70<_0x16aade[_0x93e7('0x42')];_0xbbb70+=0x1){_0x203624[_0x93e7('0x36')](_0x16aade[_0xbbb70]['update'](_0x3ae749['body'],{'transaction':_0x521d5f}));}return BPromise[_0x93e7('0x37')](_0x203624);});})[_0x93e7('0x9')](function(_0x4e6094){logger[_0x93e7('0xa')]('GetContactRecallMe',_0x3ae749);logger[_0x93e7('0xd')](_0x93e7('0x43'),_0x3ae749,JSON[_0x93e7('0xf')](_0x4e6094));_0xad79df(_0x4e6094);})[_0x93e7('0x14')](function(_0x3ea3e2){logger[_0x93e7('0x10')](_0x93e7('0x43'),_0x3ea3e2[_0x93e7('0x12')],_0x3ae749);_0xd380d8(_0x3e907e['error'](0x1f4,_0x3ea3e2[_0x93e7('0x12')]));});});});};exports[_0x93e7('0x44')]=function(_0x2bb988){var _0x293bb3=this;return new Promise(function(_0x1543c6,_0x348a27){db[_0x93e7('0x2a')][_0x93e7('0x2b')]()[_0x93e7('0x9')](function(_0x5b4a71){return db['CmHopper'][_0x93e7('0x16')]({'raw':_0x2bb988[_0x93e7('0x17')]?_0x2bb988[_0x93e7('0x17')][_0x93e7('0x22')]===undefined?!![]:![]:!![],'where':_0x2bb988['options']?_0x2bb988[_0x93e7('0x17')][_0x93e7('0x18')]||null:null,'attributes':_0x2bb988[_0x93e7('0x17')]?_0x2bb988[_0x93e7('0x17')][_0x93e7('0x1e')]||null:null,'limit':_0x2bb988[_0x93e7('0x17')]?_0x2bb988[_0x93e7('0x17')][_0x93e7('0x26')]||null:null,'include':_0x2bb988[_0x93e7('0x17')]?_0x2bb988[_0x93e7('0x17')][_0x93e7('0x19')]?_[_0x93e7('0x1a')](_0x2bb988[_0x93e7('0x17')][_0x93e7('0x19')],function(_0x3a3c5f){return{'model':db[_0x3a3c5f['model']],'as':_0x3a3c5f['as'],'attributes':_0x3a3c5f['as']===_0x93e7('0x45')?_[_0x93e7('0x46')](_0x5b4a71):_0x3a3c5f[_0x93e7('0x1e')],'include':_0x3a3c5f[_0x93e7('0x19')]?_[_0x93e7('0x1a')](_0x3a3c5f['include'],function(_0x368e89){return{'model':db[_0x368e89[_0x93e7('0x1b')]],'as':_0x368e89['as'],'attributes':_0x368e89['attributes'],'include':_0x368e89[_0x93e7('0x19')]?_[_0x93e7('0x1a')](_0x368e89['include'],function(_0xeefe88){return{'model':db[_0xeefe88[_0x93e7('0x1b')]],'as':_0xeefe88['as'],'attributes':_0xeefe88[_0x93e7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x93e7('0x9')](function(_0x1533db){logger[_0x93e7('0xa')](_0x93e7('0x1c'),_0x2bb988);logger[_0x93e7('0xd')](_0x93e7('0x1c'),_0x2bb988,JSON[_0x93e7('0xf')](_0x1533db));_0x1543c6(_0x1533db);})[_0x93e7('0x14')](function(_0x4ef8c8){logger['error'](_0x93e7('0x1c'),_0x4ef8c8[_0x93e7('0x12')],_0x2bb988);_0x348a27(_0x293bb3[_0x93e7('0x10')](0x1f4,_0x4ef8c8['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 32c8ab4..03efb7b 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 _0x9953=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','getPreview','put','update','delete','destroy'];(function(_0xf4afc6,_0x2e4df2){var _0x40c468=function(_0x41205b){while(--_0x41205b){_0xf4afc6['push'](_0xf4afc6['shift']());}};_0x40c468(++_0x2e4df2);}(_0x9953,0x14b));var _0x3995=function(_0x422d6a,_0x20d24f){_0x422d6a=_0x422d6a-0x0;var _0x3bff4b=_0x9953[_0x422d6a];return _0x3bff4b;};'use strict';var multer=require('multer');var util=require(_0x3995('0x0'));var path=require(_0x3995('0x1'));var timeout=require('connect-timeout');var express=require(_0x3995('0x2'));var router=express['Router']();var fs_extra=require(_0x3995('0x3'));var auth=require(_0x3995('0x4'));var interaction=require(_0x3995('0x5'));var config=require(_0x3995('0x6'));var controller=require(_0x3995('0x7'));router[_0x3995('0x8')]('/',auth['isAuthenticated'](),controller[_0x3995('0x9')]);router[_0x3995('0x8')](_0x3995('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3995('0x8')]('/opencontacts',auth[_0x3995('0xb')](),controller['getOpenContacts']);router[_0x3995('0x8')](_0x3995('0xc'),auth[_0x3995('0xb')](),controller[_0x3995('0xd')]);router[_0x3995('0xe')]('/',auth[_0x3995('0xb')](),controller[_0x3995('0xf')]);router[_0x3995('0xe')]('/preview',auth[_0x3995('0xb')](),controller[_0x3995('0x10')]);router[_0x3995('0x11')](_0x3995('0xc'),auth[_0x3995('0xb')](),controller[_0x3995('0x12')]);router[_0x3995('0x13')](_0x3995('0xc'),auth[_0x3995('0xb')](),controller[_0x3995('0x14')]);module[_0x3995('0x15')]=router; \ No newline at end of file +var _0x8669=['/:id','show','post','/preview','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/opencontacts'];(function(_0x469f97,_0x1d2bd0){var _0x557d30=function(_0xe4d2a5){while(--_0xe4d2a5){_0x469f97['push'](_0x469f97['shift']());}};_0x557d30(++_0x1d2bd0);}(_0x8669,0xb8));var _0x9866=function(_0x54586a,_0x2c0666){_0x54586a=_0x54586a-0x0;var _0x3e9a0d=_0x8669[_0x54586a];return _0x3e9a0d;};'use strict';var multer=require(_0x9866('0x0'));var util=require('util');var path=require(_0x9866('0x1'));var timeout=require(_0x9866('0x2'));var express=require(_0x9866('0x3'));var router=express[_0x9866('0x4')]();var fs_extra=require(_0x9866('0x5'));var auth=require(_0x9866('0x6'));var interaction=require(_0x9866('0x7'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0x9866('0x8')]('/',auth[_0x9866('0x9')](),controller[_0x9866('0xa')]);router['get'](_0x9866('0xb'),auth['isAuthenticated'](),controller[_0x9866('0xc')]);router['get'](_0x9866('0xd'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x9866('0x8')](_0x9866('0xe'),auth[_0x9866('0x9')](),controller[_0x9866('0xf')]);router[_0x9866('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9866('0x11'),auth[_0x9866('0x9')](),controller['getPreview']);router[_0x9866('0x12')](_0x9866('0xe'),auth[_0x9866('0x9')](),controller['update']);router[_0x9866('0x13')](_0x9866('0xe'),auth[_0x9866('0x9')](),controller[_0x9866('0x14')]);module[_0x9866('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 52e7dfc..2876ac8 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 _0x6c32=['contactListQueue','moment','exports','INTEGER'];(function(_0x182e6f,_0x57b3ab){var _0x57429f=function(_0x50bcc5){while(--_0x50bcc5){_0x182e6f['push'](_0x182e6f['shift']());}};_0x57429f(++_0x57b3ab);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x26c3('0x0'));var Sequelize=require('sequelize');module[_0x26c3('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x26c3('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x26c3('0x2')],'unique':_0x26c3('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x63f1=['sequelize','STRING','contactListQueue','INTEGER','moment'];(function(_0x200c98,_0x1a16fa){var _0x4a67ec=function(_0x33f26c){while(--_0x33f26c){_0x200c98['push'](_0x200c98['shift']());}};_0x4a67ec(++_0x1a16fa);}(_0x63f1,0x1da));var _0x163f=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x63f1[_0x599f41];return _0x2e4d58;};'use strict';var moment=require(_0x163f('0x0'));var Sequelize=require(_0x163f('0x1'));module['exports']={'phone':{'type':Sequelize[_0x163f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x163f('0x3')},'ListId':{'type':Sequelize[_0x163f('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x163f('0x4')],'unique':_0x163f('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 784cc72..9101c07 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 _0xe476=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','then','error','stack','name','send','index','map','fieldName','type','keys','filters','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','options','includeAll','findAll','rows','catch','show','params','CmHopperBlack','rawAttributes','intersection','merge','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0xe476,0x74));var _0x6e47=function(_0x3625cf,_0x4a7c01){_0x3625cf=_0x3625cf-0x0;var _0x11b6b=_0xe476[_0x3625cf];return _0x11b6b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e47('0x0'));var zipdir=require(_0x6e47('0x1'));var jsonpatch=require(_0x6e47('0x2'));var rp=require(_0x6e47('0x3'));var moment=require('moment');var BPromise=require(_0x6e47('0x4'));var Mustache=require('mustache');var util=require(_0x6e47('0x5'));var path=require(_0x6e47('0x6'));var sox=require(_0x6e47('0x7'));var csv=require(_0x6e47('0x8'));var ejs=require(_0x6e47('0x9'));var fs=require('fs');var fs_extra=require(_0x6e47('0xa'));var _=require(_0x6e47('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6e47('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6e47('0x8'));var querystring=require('querystring');var Papa=require(_0x6e47('0xd'));var Redis=require(_0x6e47('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6e47('0xf'));var as=require(_0x6e47('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e47('0x11'))(_0x6e47('0x12'));var utils=require('../../config/utils');var config=require(_0x6e47('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e47('0x14'))['db'];function respondWithStatusCode(_0xa38b82,_0x1eb4ad){_0x1eb4ad=_0x1eb4ad||0xcc;return function(_0x5f2dd2){if(_0x5f2dd2){return _0xa38b82[_0x6e47('0x15')](_0x1eb4ad);}return _0xa38b82[_0x6e47('0x16')](_0x1eb4ad)[_0x6e47('0x17')]();};}function respondWithResult(_0x29583a,_0x516c94){_0x516c94=_0x516c94||0xc8;return function(_0x5ee32c){if(_0x5ee32c){return _0x29583a[_0x6e47('0x16')](_0x516c94)[_0x6e47('0x18')](_0x5ee32c);}};}function respondWithFilteredResult(_0x4f135c,_0x4bcaa8){return function(_0x2f666d){if(_0x2f666d){var _0xe600d6=typeof _0x4bcaa8[_0x6e47('0x19')]===_0x6e47('0x1a')&&typeof _0x4bcaa8[_0x6e47('0x1b')]===_0x6e47('0x1a');var _0x902b8=_0x2f666d[_0x6e47('0x1c')];var _0x1863f0=_0xe600d6?0x0:_0x4bcaa8[_0x6e47('0x19')];var _0x1620ef=_0xe600d6?_0x2f666d[_0x6e47('0x1c')]:_0x4bcaa8[_0x6e47('0x19')]+_0x4bcaa8['limit'];var _0xc144f5;if(_0x1620ef>=_0x902b8){_0x1620ef=_0x902b8;_0xc144f5=0xc8;}else{_0xc144f5=0xce;}_0x4f135c[_0x6e47('0x16')](_0xc144f5);return _0x4f135c[_0x6e47('0x1d')]('Content-Range',_0x1863f0+'-'+_0x1620ef+'/'+_0x902b8)['json'](_0x2f666d);}return null;};}function patchUpdates(_0x37d9a1){return function(_0x5d66f5){try{jsonpatch['apply'](_0x5d66f5,_0x37d9a1,!![]);}catch(_0x5f7774){return BPromise[_0x6e47('0x1e')](_0x5f7774);}return _0x5d66f5[_0x6e47('0x1f')]();};}function saveUpdates(_0x29cdab,_0x24a1c9){return function(_0x57bff2){if(_0x57bff2){return _0x57bff2['update'](_0x29cdab)['then'](function(_0x2c0fbf){return _0x2c0fbf;});}return null;};}function removeEntity(_0x5d7b2a,_0x6c5a47){return function(_0x711f5f){if(_0x711f5f){return _0x711f5f[_0x6e47('0x20')]()[_0x6e47('0x21')](function(){_0x5d7b2a[_0x6e47('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e5f7c,_0x41c74a){return function(_0x29f1db){if(!_0x29f1db){_0x4e5f7c[_0x6e47('0x15')](0x194);}return _0x29f1db;};}function handleError(_0x15a2b5,_0x4f02eb){_0x4f02eb=_0x4f02eb||0x1f4;return function(_0x1daa0){logger[_0x6e47('0x22')](_0x1daa0[_0x6e47('0x23')]);if(_0x1daa0[_0x6e47('0x24')]){delete _0x1daa0[_0x6e47('0x24')];}_0x15a2b5[_0x6e47('0x16')](_0x4f02eb)[_0x6e47('0x25')](_0x1daa0);};}exports[_0x6e47('0x26')]=function(_0x1f541a,_0x2f9d62){var _0x385d30={},_0x1e43dc={},_0x2fdc5d={'count':0x0,'rows':[]};var _0x24ee91=_[_0x6e47('0x27')](db['CmHopperBlack']['rawAttributes'],function(_0x396eb0){return{'name':_0x396eb0[_0x6e47('0x28')],'type':_0x396eb0[_0x6e47('0x29')]['key']};});_0x1e43dc['model']=_[_0x6e47('0x27')](_0x24ee91,_0x6e47('0x24'));_0x1e43dc['query']=_[_0x6e47('0x2a')](_0x1f541a['query']);_0x1e43dc[_0x6e47('0x2b')]=_['intersection'](_0x1e43dc[_0x6e47('0x2c')],_0x1e43dc[_0x6e47('0x2d')]);_0x385d30[_0x6e47('0x2e')]=_['intersection'](_0x1e43dc[_0x6e47('0x2c')],qs[_0x6e47('0x2f')](_0x1f541a['query'][_0x6e47('0x2f')]));_0x385d30[_0x6e47('0x2e')]=_0x385d30[_0x6e47('0x2e')][_0x6e47('0x30')]?_0x385d30[_0x6e47('0x2e')]:_0x1e43dc['model'];if(!_0x1f541a[_0x6e47('0x2d')][_0x6e47('0x31')](_0x6e47('0x32'))){_0x385d30[_0x6e47('0x1b')]=qs[_0x6e47('0x1b')](_0x1f541a[_0x6e47('0x2d')][_0x6e47('0x1b')]);_0x385d30[_0x6e47('0x19')]=qs[_0x6e47('0x19')](_0x1f541a[_0x6e47('0x2d')]['offset']);}_0x385d30['order']=qs[_0x6e47('0x33')](_0x1f541a['query'][_0x6e47('0x33')]);_0x385d30['where']=qs[_0x6e47('0x2b')](_['pick'](_0x1f541a['query'],_0x1e43dc['filters']),_0x24ee91);if(_0x1f541a[_0x6e47('0x2d')]['filter']){_0x385d30[_0x6e47('0x34')]=_['merge'](_0x385d30['where'],{'$or':_['map'](_0x24ee91,function(_0x210cc0){if(_0x210cc0['type']!=='VIRTUAL'){var _0x4a1456={};_0x4a1456[_0x210cc0['name']]={'$like':'%'+_0x1f541a[_0x6e47('0x2d')]['filter']+'%'};return _0x4a1456;}})});}_0x385d30=_['merge']({},_0x385d30,_0x1f541a[_0x6e47('0x35')]);var _0x52dc62={'where':_0x385d30[_0x6e47('0x34')]};return db['CmHopperBlack'][_0x6e47('0x1c')](_0x52dc62)[_0x6e47('0x21')](function(_0x37ca7f){_0x2fdc5d[_0x6e47('0x1c')]=_0x37ca7f;if(_0x1f541a[_0x6e47('0x2d')][_0x6e47('0x36')]){_0x385d30['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6e47('0x37')](_0x385d30);})['then'](function(_0x232d5d){_0x2fdc5d[_0x6e47('0x38')]=_0x232d5d;return _0x2fdc5d;})[_0x6e47('0x21')](respondWithFilteredResult(_0x2f9d62,_0x385d30))[_0x6e47('0x39')](handleError(_0x2f9d62,null));};exports[_0x6e47('0x3a')]=function(_0x4bf974,_0x4537eb){var _0x18a5e7={'raw':!![],'where':{'id':_0x4bf974[_0x6e47('0x3b')]['id']}},_0x59f9c2={};_0x59f9c2[_0x6e47('0x2c')]=_[_0x6e47('0x2a')](db[_0x6e47('0x3c')][_0x6e47('0x3d')]);_0x59f9c2['query']=_[_0x6e47('0x2a')](_0x4bf974[_0x6e47('0x2d')]);_0x59f9c2[_0x6e47('0x2b')]=_['intersection'](_0x59f9c2[_0x6e47('0x2c')],_0x59f9c2[_0x6e47('0x2d')]);_0x18a5e7[_0x6e47('0x2e')]=_[_0x6e47('0x3e')](_0x59f9c2[_0x6e47('0x2c')],qs[_0x6e47('0x2f')](_0x4bf974[_0x6e47('0x2d')][_0x6e47('0x2f')]));_0x18a5e7[_0x6e47('0x2e')]=_0x18a5e7['attributes'][_0x6e47('0x30')]?_0x18a5e7[_0x6e47('0x2e')]:_0x59f9c2[_0x6e47('0x2c')];if(_0x4bf974[_0x6e47('0x2d')][_0x6e47('0x36')]){_0x18a5e7['include']=[{'all':!![]}];}_0x18a5e7=_[_0x6e47('0x3f')]({},_0x18a5e7,_0x4bf974['options']);return db[_0x6e47('0x3c')][_0x6e47('0x40')](_0x18a5e7)[_0x6e47('0x21')](handleEntityNotFound(_0x4537eb,null))['then'](respondWithResult(_0x4537eb,null))[_0x6e47('0x39')](handleError(_0x4537eb,null));};exports['update']=function(_0x464341,_0xe8756e){if(_0x464341[_0x6e47('0x41')]['id']){delete _0x464341[_0x6e47('0x41')]['id'];}return db[_0x6e47('0x3c')][_0x6e47('0x40')]({'where':{'id':_0x464341[_0x6e47('0x3b')]['id']}})[_0x6e47('0x21')](handleEntityNotFound(_0xe8756e,null))['then'](saveUpdates(_0x464341[_0x6e47('0x41')],null))[_0x6e47('0x21')](respondWithResult(_0xe8756e,null))[_0x6e47('0x39')](handleError(_0xe8756e,null));};exports[_0x6e47('0x20')]=function(_0x3df9b5,_0x35d8d9){return db[_0x6e47('0x3c')][_0x6e47('0x40')]({'where':{'id':_0x3df9b5[_0x6e47('0x3b')]['id']}})[_0x6e47('0x21')](handleEntityNotFound(_0x35d8d9,null))['then'](removeEntity(_0x35d8d9,null))[_0x6e47('0x39')](handleError(_0x35d8d9,null));};exports[_0x6e47('0x42')]=function(_0x34ea22,_0x1fa1a4){return db[_0x6e47('0x3c')]['describe']()[_0x6e47('0x21')](respondWithResult(_0x1fa1a4,null))['catch'](handleError(_0x1fa1a4,null));}; \ No newline at end of file +var _0xdd36=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd36,0x1f1));var _0x6dd3=function(_0x115ca1,_0x1042f6){_0x115ca1=_0x115ca1-0x0;var _0x44115d=_0xdd36[_0x115ca1];return _0x44115d;};'use strict';var emlformat=require(_0x6dd3('0x0'));var rimraf=require(_0x6dd3('0x1'));var zipdir=require(_0x6dd3('0x2'));var jsonpatch=require(_0x6dd3('0x3'));var rp=require('request-promise');var moment=require(_0x6dd3('0x4'));var BPromise=require(_0x6dd3('0x5'));var Mustache=require(_0x6dd3('0x6'));var util=require(_0x6dd3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6dd3('0x8'));var ejs=require(_0x6dd3('0x9'));var fs=require('fs');var fs_extra=require(_0x6dd3('0xa'));var _=require(_0x6dd3('0xb'));var squel=require(_0x6dd3('0xc'));var crypto=require(_0x6dd3('0xd'));var jsforce=require(_0x6dd3('0xe'));var deskjs=require(_0x6dd3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6dd3('0x10'));var Papa=require(_0x6dd3('0x11'));var Redis=require(_0x6dd3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6dd3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6dd3('0x14'));var utils=require('../../config/utils');var config=require(_0x6dd3('0x15'));var licenseUtil=require(_0x6dd3('0x16'));var db=require(_0x6dd3('0x17'))['db'];function respondWithStatusCode(_0x555c1d,_0x9da20b){_0x9da20b=_0x9da20b||0xcc;return function(_0x57c3cf){if(_0x57c3cf){return _0x555c1d[_0x6dd3('0x18')](_0x9da20b);}return _0x555c1d[_0x6dd3('0x19')](_0x9da20b)[_0x6dd3('0x1a')]();};}function respondWithResult(_0x348556,_0x571c2f){_0x571c2f=_0x571c2f||0xc8;return function(_0x42d2d7){if(_0x42d2d7){return _0x348556[_0x6dd3('0x19')](_0x571c2f)[_0x6dd3('0x1b')](_0x42d2d7);}};}function respondWithFilteredResult(_0x185786,_0x2230cb){return function(_0x2359eb){if(_0x2359eb){var _0x53623f=typeof _0x2230cb[_0x6dd3('0x1c')]==='undefined'&&typeof _0x2230cb[_0x6dd3('0x1d')]===_0x6dd3('0x1e');var _0x2e04d0=_0x2359eb[_0x6dd3('0x1f')];var _0x251457=_0x53623f?0x0:_0x2230cb[_0x6dd3('0x1c')];var _0x4641c6=_0x53623f?_0x2359eb['count']:_0x2230cb['offset']+_0x2230cb[_0x6dd3('0x1d')];var _0x4e71fd;if(_0x4641c6>=_0x2e04d0){_0x4641c6=_0x2e04d0;_0x4e71fd=0xc8;}else{_0x4e71fd=0xce;}_0x185786['status'](_0x4e71fd);return _0x185786[_0x6dd3('0x20')](_0x6dd3('0x21'),_0x251457+'-'+_0x4641c6+'/'+_0x2e04d0)[_0x6dd3('0x1b')](_0x2359eb);}return null;};}function patchUpdates(_0x2443af){return function(_0xef49c2){try{jsonpatch['apply'](_0xef49c2,_0x2443af,!![]);}catch(_0x28deb0){return BPromise['reject'](_0x28deb0);}return _0xef49c2[_0x6dd3('0x22')]();};}function saveUpdates(_0x361628,_0x10accb){return function(_0x163ec0){if(_0x163ec0){return _0x163ec0[_0x6dd3('0x23')](_0x361628)[_0x6dd3('0x24')](function(_0x3a0f92){return _0x3a0f92;});}return null;};}function removeEntity(_0xed1de4,_0x1c0b68){return function(_0x511c42){if(_0x511c42){return _0x511c42['destroy']()['then'](function(){_0xed1de4[_0x6dd3('0x19')](0xcc)[_0x6dd3('0x1a')]();});}};}function handleEntityNotFound(_0x1a880b,_0x331721){return function(_0x54ca7a){if(!_0x54ca7a){_0x1a880b[_0x6dd3('0x18')](0x194);}return _0x54ca7a;};}function handleError(_0x35f6dc,_0x188e47){_0x188e47=_0x188e47||0x1f4;return function(_0x103fcd){logger['error'](_0x103fcd[_0x6dd3('0x25')]);if(_0x103fcd['name']){delete _0x103fcd[_0x6dd3('0x26')];}_0x35f6dc[_0x6dd3('0x19')](_0x188e47)[_0x6dd3('0x27')](_0x103fcd);};}exports[_0x6dd3('0x28')]=function(_0x4b20aa,_0x149029){var _0x59e2b3={},_0x50f4c5={},_0x56cd82={'count':0x0,'rows':[]};var _0x3532e3=_[_0x6dd3('0x29')](db[_0x6dd3('0x2a')][_0x6dd3('0x2b')],function(_0x31f7ec){return{'name':_0x31f7ec[_0x6dd3('0x2c')],'type':_0x31f7ec[_0x6dd3('0x2d')][_0x6dd3('0x2e')]};});_0x50f4c5['model']=_['map'](_0x3532e3,_0x6dd3('0x26'));_0x50f4c5[_0x6dd3('0x2f')]=_[_0x6dd3('0x30')](_0x4b20aa[_0x6dd3('0x2f')]);_0x50f4c5['filters']=_[_0x6dd3('0x31')](_0x50f4c5[_0x6dd3('0x32')],_0x50f4c5[_0x6dd3('0x2f')]);_0x59e2b3[_0x6dd3('0x33')]=_[_0x6dd3('0x31')](_0x50f4c5[_0x6dd3('0x32')],qs[_0x6dd3('0x34')](_0x4b20aa[_0x6dd3('0x2f')]['fields']));_0x59e2b3[_0x6dd3('0x33')]=_0x59e2b3[_0x6dd3('0x33')][_0x6dd3('0x35')]?_0x59e2b3[_0x6dd3('0x33')]:_0x50f4c5[_0x6dd3('0x32')];if(!_0x4b20aa[_0x6dd3('0x2f')]['hasOwnProperty']('nolimit')){_0x59e2b3[_0x6dd3('0x1d')]=qs[_0x6dd3('0x1d')](_0x4b20aa[_0x6dd3('0x2f')][_0x6dd3('0x1d')]);_0x59e2b3[_0x6dd3('0x1c')]=qs[_0x6dd3('0x1c')](_0x4b20aa['query']['offset']);}_0x59e2b3[_0x6dd3('0x36')]=qs['sort'](_0x4b20aa['query'][_0x6dd3('0x37')]);_0x59e2b3[_0x6dd3('0x38')]=qs[_0x6dd3('0x39')](_[_0x6dd3('0x3a')](_0x4b20aa[_0x6dd3('0x2f')],_0x50f4c5[_0x6dd3('0x39')]),_0x3532e3);if(_0x4b20aa[_0x6dd3('0x2f')][_0x6dd3('0x3b')]){_0x59e2b3['where']=_[_0x6dd3('0x3c')](_0x59e2b3[_0x6dd3('0x38')],{'$or':_[_0x6dd3('0x29')](_0x3532e3,function(_0x525e57){if(_0x525e57['type']!==_0x6dd3('0x3d')){var _0x40dbc2={};_0x40dbc2[_0x525e57[_0x6dd3('0x26')]]={'$like':'%'+_0x4b20aa['query'][_0x6dd3('0x3b')]+'%'};return _0x40dbc2;}})});}_0x59e2b3=_[_0x6dd3('0x3c')]({},_0x59e2b3,_0x4b20aa[_0x6dd3('0x3e')]);var _0x12f4db={'where':_0x59e2b3['where']};return db[_0x6dd3('0x2a')][_0x6dd3('0x1f')](_0x12f4db)['then'](function(_0x1dc4bf){_0x56cd82[_0x6dd3('0x1f')]=_0x1dc4bf;if(_0x4b20aa[_0x6dd3('0x2f')]['includeAll']){_0x59e2b3[_0x6dd3('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x6dd3('0x40')](_0x59e2b3);})[_0x6dd3('0x24')](function(_0x5e3978){_0x56cd82[_0x6dd3('0x41')]=_0x5e3978;return _0x56cd82;})[_0x6dd3('0x24')](respondWithFilteredResult(_0x149029,_0x59e2b3))[_0x6dd3('0x42')](handleError(_0x149029,null));};exports[_0x6dd3('0x43')]=function(_0x12a23d,_0x3dda8f){var _0x1bfd20={'raw':!![],'where':{'id':_0x12a23d[_0x6dd3('0x44')]['id']}},_0x48aab5={};_0x48aab5['model']=_[_0x6dd3('0x30')](db[_0x6dd3('0x2a')][_0x6dd3('0x2b')]);_0x48aab5[_0x6dd3('0x2f')]=_[_0x6dd3('0x30')](_0x12a23d[_0x6dd3('0x2f')]);_0x48aab5[_0x6dd3('0x39')]=_['intersection'](_0x48aab5[_0x6dd3('0x32')],_0x48aab5['query']);_0x1bfd20['attributes']=_[_0x6dd3('0x31')](_0x48aab5['model'],qs[_0x6dd3('0x34')](_0x12a23d[_0x6dd3('0x2f')][_0x6dd3('0x34')]));_0x1bfd20['attributes']=_0x1bfd20[_0x6dd3('0x33')][_0x6dd3('0x35')]?_0x1bfd20[_0x6dd3('0x33')]:_0x48aab5[_0x6dd3('0x32')];if(_0x12a23d[_0x6dd3('0x2f')][_0x6dd3('0x45')]){_0x1bfd20[_0x6dd3('0x3f')]=[{'all':!![]}];}_0x1bfd20=_['merge']({},_0x1bfd20,_0x12a23d[_0x6dd3('0x3e')]);return db[_0x6dd3('0x2a')]['find'](_0x1bfd20)[_0x6dd3('0x24')](handleEntityNotFound(_0x3dda8f,null))[_0x6dd3('0x24')](respondWithResult(_0x3dda8f,null))['catch'](handleError(_0x3dda8f,null));};exports[_0x6dd3('0x23')]=function(_0x4118ac,_0x5109c6){if(_0x4118ac[_0x6dd3('0x46')]['id']){delete _0x4118ac[_0x6dd3('0x46')]['id'];}return db[_0x6dd3('0x2a')][_0x6dd3('0x47')]({'where':{'id':_0x4118ac[_0x6dd3('0x44')]['id']}})[_0x6dd3('0x24')](handleEntityNotFound(_0x5109c6,null))['then'](saveUpdates(_0x4118ac[_0x6dd3('0x46')],null))[_0x6dd3('0x24')](respondWithResult(_0x5109c6,null))['catch'](handleError(_0x5109c6,null));};exports[_0x6dd3('0x48')]=function(_0x3b5449,_0x18b1f4){return db[_0x6dd3('0x2a')][_0x6dd3('0x47')]({'where':{'id':_0x3b5449[_0x6dd3('0x44')]['id']}})['then'](handleEntityNotFound(_0x18b1f4,null))[_0x6dd3('0x24')](removeEntity(_0x18b1f4,null))['catch'](handleError(_0x18b1f4,null));};exports['describe']=function(_0x594937,_0xffa7a8){return db[_0x6dd3('0x2a')][_0x6dd3('0x49')]()['then'](respondWithResult(_0xffa7a8,null))['catch'](handleError(_0xffa7a8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 1419cca..fbad034 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 _0x3559=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','define'];(function(_0x5942e8,_0x152886){var _0x5f43cf=function(_0x47855a){while(--_0x47855a){_0x5942e8['push'](_0x5942e8['shift']());}};_0x5f43cf(++_0x152886);}(_0x3559,0x1be));var _0x9355=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3559[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9355('0x0'));var util=require(_0x9355('0x1'));var logger=require(_0x9355('0x2'))(_0x9355('0x3'));var moment=require(_0x9355('0x4'));var BPromise=require('bluebird');var rp=require(_0x9355('0x5'));var fs=require('fs');var path=require(_0x9355('0x6'));var rimraf=require('rimraf');var config=require(_0x9355('0x7'));var attributes=require(_0x9355('0x8'));module['exports']=function(_0x382ccf,_0xb801d7){return _0x382ccf[_0x9355('0x9')](_0x9355('0xa'),attributes,{'tableName':_0x9355('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2d1=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','lodash','util','api','moment','bluebird'];(function(_0x3e3221,_0x392851){var _0x190da4=function(_0x13d601){while(--_0x13d601){_0x3e3221['push'](_0x3e3221['shift']());}};_0x190da4(++_0x392851);}(_0xd2d1,0x16f));var _0x1d2d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd2d1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1d2d('0x0'));var util=require(_0x1d2d('0x1'));var logger=require('../../config/logger')(_0x1d2d('0x2'));var moment=require(_0x1d2d('0x3'));var BPromise=require(_0x1d2d('0x4'));var rp=require(_0x1d2d('0x5'));var fs=require('fs');var path=require(_0x1d2d('0x6'));var rimraf=require(_0x1d2d('0x7'));var config=require(_0x1d2d('0x8'));var attributes=require(_0x1d2d('0x9'));module['exports']=function(_0x4bc914,_0x2bc341){return _0x4bc914[_0x1d2d('0xa')](_0x1d2d('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 e4b996f..a4b97fd 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 _0xc2a2=['findAll','options','raw','where','attributes','include','map','model','then','info','catch','update','body','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCmHopperBlack','CmHopperBlack'];(function(_0x10d100,_0x26d4a5){var _0x1d300d=function(_0x5cf8b2){while(--_0x5cf8b2){_0x10d100['push'](_0x10d100['shift']());}};_0x1d300d(++_0x26d4a5);}(_0xc2a2,0x182));var _0x2c2a=function(_0xce822d,_0x437f44){_0xce822d=_0xce822d-0x0;var _0x2aece5=_0xc2a2[_0xce822d];return _0x2aece5;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var moment=require('moment');var BPromise=require(_0x2c2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c2a('0x4'));var logger=require(_0x2c2a('0x5'))(_0x2c2a('0x6'));var config=require(_0x2c2a('0x7'));var jayson=require(_0x2c2a('0x8'));var client=jayson[_0x2c2a('0x9')][_0x2c2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32ebfc,_0x9b687,_0x5058d8){return new BPromise(function(_0x19300a,_0x41c599){return client[_0x2c2a('0xb')](_0x32ebfc,_0x5058d8)['then'](function(_0x4cc0ba){logger['info'](_0x2c2a('0xc'),_0x9b687,_0x2c2a('0xd'));logger[_0x2c2a('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x9b687,_0x2c2a('0xd'),JSON[_0x2c2a('0xf')](_0x4cc0ba));if(_0x4cc0ba['error']){if(_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x11')]===0x1f4){logger['error'](_0x2c2a('0xc'),_0x9b687,_0x4cc0ba[_0x2c2a('0x10')]['message']);return _0x41c599(_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x12')]);}logger[_0x2c2a('0x10')](_0x2c2a('0xc'),_0x9b687,_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x12')]);return _0x19300a(_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x12')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x9b687,_0x2c2a('0xd'));_0x19300a(_0x4cc0ba['result'][_0x2c2a('0x12')]);}})['catch'](function(_0x1ff6a2){logger[_0x2c2a('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x9b687,_0x1ff6a2);_0x41c599(_0x1ff6a2);});});}exports[_0x2c2a('0x13')]=function(_0xede4f2){var _0x23655e=this;return new Promise(function(_0x404dbe,_0x45ca14){return db[_0x2c2a('0x14')][_0x2c2a('0x15')]({'raw':_0xede4f2[_0x2c2a('0x16')]?_0xede4f2['options'][_0x2c2a('0x17')]===undefined?!![]:![]:!![],'where':_0xede4f2['options']?_0xede4f2[_0x2c2a('0x16')][_0x2c2a('0x18')]||null:null,'attributes':_0xede4f2[_0x2c2a('0x16')]?_0xede4f2[_0x2c2a('0x16')][_0x2c2a('0x19')]||null:null,'limit':_0xede4f2['options']?_0xede4f2[_0x2c2a('0x16')]['limit']||null:null,'include':_0xede4f2['options']?_0xede4f2[_0x2c2a('0x16')][_0x2c2a('0x1a')]?_[_0x2c2a('0x1b')](_0xede4f2[_0x2c2a('0x16')]['include'],function(_0x541ce9){return{'model':db[_0x541ce9[_0x2c2a('0x1c')]],'as':_0x541ce9['as'],'attributes':_0x541ce9['attributes'],'include':_0x541ce9[_0x2c2a('0x1a')]?_['map'](_0x541ce9[_0x2c2a('0x1a')],function(_0x2db253){return{'model':db[_0x2db253['model']],'as':_0x2db253['as'],'attributes':_0x2db253[_0x2c2a('0x19')],'include':_0x2db253[_0x2c2a('0x1a')]?_['map'](_0x2db253['include'],function(_0x2871db){return{'model':db[_0x2871db[_0x2c2a('0x1c')]],'as':_0x2871db['as'],'attributes':_0x2871db[_0x2c2a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2c2a('0x1d')](function(_0x52c1e4){logger[_0x2c2a('0x1e')](_0x2c2a('0x13'),_0xede4f2);logger[_0x2c2a('0xe')]('GetCmHopperBlack',_0xede4f2,JSON[_0x2c2a('0xf')](_0x52c1e4));_0x404dbe(_0x52c1e4);})[_0x2c2a('0x1f')](function(_0x131bb8){logger[_0x2c2a('0x10')]('GetCmHopperBlack',_0x131bb8[_0x2c2a('0x12')],_0xede4f2);_0x45ca14(_0x23655e[_0x2c2a('0x10')](0x1f4,_0x131bb8[_0x2c2a('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x14625f){var _0x225ba9=this;return new Promise(function(_0x58486e,_0xb79511){return db[_0x2c2a('0x14')][_0x2c2a('0x20')](_0x14625f[_0x2c2a('0x21')],{'raw':_0x14625f[_0x2c2a('0x16')]?_0x14625f[_0x2c2a('0x16')][_0x2c2a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14625f[_0x2c2a('0x16')]?_0x14625f[_0x2c2a('0x16')]['where']||null:null,'attributes':_0x14625f[_0x2c2a('0x16')]?_0x14625f[_0x2c2a('0x16')][_0x2c2a('0x19')]||null:null,'limit':_0x14625f[_0x2c2a('0x16')]?_0x14625f['options'][_0x2c2a('0x22')]||null:null})['then'](function(_0x4c43e0){logger[_0x2c2a('0x1e')](_0x2c2a('0x23'),_0x14625f);logger[_0x2c2a('0xe')](_0x2c2a('0x23'),_0x14625f,JSON[_0x2c2a('0xf')](_0x4c43e0));_0x58486e(_0x4c43e0);})['catch'](function(_0x2bdffa){logger[_0x2c2a('0x10')](_0x2c2a('0x23'),_0x2bdffa[_0x2c2a('0x12')],_0x14625f);_0xb79511(_0x225ba9[_0x2c2a('0x10')](0x1f4,_0x2bdffa['message']));});});};exports['DestroyCmHopperBlack']=function(_0x3eb8d9){var _0x55de24=this;return new Promise(function(_0x4220e2,_0x4894d0){return db['CmHopperBlack']['destroy']({'where':_0x3eb8d9['options']?_0x3eb8d9[_0x2c2a('0x16')]['where']||null:null})[_0x2c2a('0x1d')](function(_0x153de8){logger[_0x2c2a('0x1e')](_0x2c2a('0x24'),_0x3eb8d9);logger[_0x2c2a('0xe')]('DestroyCmHopperBlack',_0x3eb8d9,JSON[_0x2c2a('0xf')](_0x153de8));_0x4220e2(_0x153de8);})[_0x2c2a('0x1f')](function(_0x55c268){logger['error']('DestroyCmHopperBlack',_0x55c268[_0x2c2a('0x12')],_0x3eb8d9);_0x4894d0(_0x55de24[_0x2c2a('0x10')](0x1f4,_0x55c268['message']));});});}; \ No newline at end of file +var _0xf435=['map','model','UpdateCmHopperBlack','CmHopperBlack','update','DestroyCmHopperBlack','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0xf435,0x193));var _0x5f43=function(_0xd680de,_0x75e351){_0xd680de=_0xd680de-0x0;var _0x6249d1=_0xf435[_0xd680de];return _0x6249d1;};'use strict';var _=require(_0x5f43('0x0'));var util=require(_0x5f43('0x1'));var moment=require(_0x5f43('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f43('0x3'));var fs=require('fs');var Redis=require(_0x5f43('0x4'));var db=require(_0x5f43('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5f43('0x6'));var config=require(_0x5f43('0x7'));var jayson=require(_0x5f43('0x8'));var client=jayson[_0x5f43('0x9')][_0x5f43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8df63b,_0x343879,_0x446d86){return new BPromise(function(_0x47a16d,_0x15367a){return client['request'](_0x8df63b,_0x446d86)[_0x5f43('0xb')](function(_0x4f742a){logger[_0x5f43('0xc')](_0x5f43('0xd'),_0x343879,_0x5f43('0xe'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x343879,_0x5f43('0xe'),JSON[_0x5f43('0xf')](_0x4f742a));if(_0x4f742a[_0x5f43('0x10')]){if(_0x4f742a[_0x5f43('0x10')][_0x5f43('0x11')]===0x1f4){logger[_0x5f43('0x10')](_0x5f43('0xd'),_0x343879,_0x4f742a[_0x5f43('0x10')][_0x5f43('0x12')]);return _0x15367a(_0x4f742a[_0x5f43('0x10')][_0x5f43('0x12')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x343879,_0x4f742a['error'][_0x5f43('0x12')]);return _0x47a16d(_0x4f742a[_0x5f43('0x10')][_0x5f43('0x12')]);}else{logger[_0x5f43('0xc')](_0x5f43('0xd'),_0x343879,_0x5f43('0xe'));_0x47a16d(_0x4f742a[_0x5f43('0x13')][_0x5f43('0x12')]);}})[_0x5f43('0x14')](function(_0x3827f6){logger['error'](_0x5f43('0xd'),_0x343879,_0x3827f6);_0x15367a(_0x3827f6);});});}exports[_0x5f43('0x15')]=function(_0x33555c){var _0x596237=this;return new Promise(function(_0x3a30ff,_0x22b224){return db['CmHopperBlack'][_0x5f43('0x16')]({'raw':_0x33555c[_0x5f43('0x17')]?_0x33555c[_0x5f43('0x17')][_0x5f43('0x18')]===undefined?!![]:![]:!![],'where':_0x33555c[_0x5f43('0x17')]?_0x33555c[_0x5f43('0x17')][_0x5f43('0x19')]||null:null,'attributes':_0x33555c[_0x5f43('0x17')]?_0x33555c[_0x5f43('0x17')][_0x5f43('0x1a')]||null:null,'limit':_0x33555c[_0x5f43('0x17')]?_0x33555c['options'][_0x5f43('0x1b')]||null:null,'include':_0x33555c[_0x5f43('0x17')]?_0x33555c[_0x5f43('0x17')][_0x5f43('0x1c')]?_['map'](_0x33555c['options']['include'],function(_0x4f1f0e){return{'model':db[_0x4f1f0e['model']],'as':_0x4f1f0e['as'],'attributes':_0x4f1f0e[_0x5f43('0x1a')],'include':_0x4f1f0e[_0x5f43('0x1c')]?_[_0x5f43('0x1d')](_0x4f1f0e[_0x5f43('0x1c')],function(_0x5a113f){return{'model':db[_0x5a113f[_0x5f43('0x1e')]],'as':_0x5a113f['as'],'attributes':_0x5a113f[_0x5f43('0x1a')],'include':_0x5a113f[_0x5f43('0x1c')]?_[_0x5f43('0x1d')](_0x5a113f['include'],function(_0x37f286){return{'model':db[_0x37f286[_0x5f43('0x1e')]],'as':_0x37f286['as'],'attributes':_0x37f286[_0x5f43('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5f43('0xb')](function(_0x50dad7){logger[_0x5f43('0xc')](_0x5f43('0x15'),_0x33555c);logger['debug']('GetCmHopperBlack',_0x33555c,JSON['stringify'](_0x50dad7));_0x3a30ff(_0x50dad7);})[_0x5f43('0x14')](function(_0xcc3b93){logger[_0x5f43('0x10')](_0x5f43('0x15'),_0xcc3b93[_0x5f43('0x12')],_0x33555c);_0x22b224(_0x596237[_0x5f43('0x10')](0x1f4,_0xcc3b93[_0x5f43('0x12')]));});});};exports[_0x5f43('0x1f')]=function(_0x5e2277){var _0x38b7dd=this;return new Promise(function(_0x1ff76a,_0x184302){return db[_0x5f43('0x20')][_0x5f43('0x21')](_0x5e2277['body'],{'raw':_0x5e2277[_0x5f43('0x17')]?_0x5e2277['options'][_0x5f43('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e2277['options']?_0x5e2277[_0x5f43('0x17')][_0x5f43('0x19')]||null:null,'attributes':_0x5e2277[_0x5f43('0x17')]?_0x5e2277[_0x5f43('0x17')][_0x5f43('0x1a')]||null:null,'limit':_0x5e2277[_0x5f43('0x17')]?_0x5e2277[_0x5f43('0x17')][_0x5f43('0x1b')]||null:null})['then'](function(_0x2072e4){logger[_0x5f43('0xc')]('UpdateCmHopperBlack',_0x5e2277);logger['debug'](_0x5f43('0x1f'),_0x5e2277,JSON['stringify'](_0x2072e4));_0x1ff76a(_0x2072e4);})['catch'](function(_0x1bcdd4){logger[_0x5f43('0x10')](_0x5f43('0x1f'),_0x1bcdd4[_0x5f43('0x12')],_0x5e2277);_0x184302(_0x38b7dd[_0x5f43('0x10')](0x1f4,_0x1bcdd4['message']));});});};exports[_0x5f43('0x22')]=function(_0x4ee565){var _0x362abc=this;return new Promise(function(_0x181a0b,_0x5bce95){return db[_0x5f43('0x20')]['destroy']({'where':_0x4ee565[_0x5f43('0x17')]?_0x4ee565[_0x5f43('0x17')]['where']||null:null})[_0x5f43('0xb')](function(_0xab27d2){logger[_0x5f43('0xc')](_0x5f43('0x22'),_0x4ee565);logger[_0x5f43('0x23')]('DestroyCmHopperBlack',_0x4ee565,JSON['stringify'](_0xab27d2));_0x181a0b(_0xab27d2);})[_0x5f43('0x14')](function(_0x3a1b77){logger['error'](_0x5f43('0x22'),_0x3a1b77[_0x5f43('0x12')],_0x4ee565);_0x5bce95(_0x362abc[_0x5f43('0x10')](0x1f4,_0x3a1b77[_0x5f43('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 3d166f0..a510b8e 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 _0xfdbd=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated','index','describe','get','show','put','/:id','update','delete','destroy'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x3ac312,_0x5d3903){_0x3ac312=_0x3ac312-0x0;var _0x36b673=_0xfdbd[_0x3ac312];return _0x36b673;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0x10'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x11')]);router[_0xdfdb('0x12')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0adf=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','get','/describe','describe','/:id','put','update','delete','multer','util'];(function(_0x28ee9c,_0x1ae563){var _0x36f796=function(_0x4b9d9a){while(--_0x4b9d9a){_0x28ee9c['push'](_0x28ee9c['shift']());}};_0x36f796(++_0x1ae563);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x33bd73,_0x450437){_0x33bd73=_0x33bd73-0x0;var _0x20373a=_0x0adf[_0x33bd73];return _0x20373a;};'use strict';var multer=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var path=require(_0xf0ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0ad('0x3'));var router=express[_0xf0ad('0x4')]();var fs_extra=require(_0xf0ad('0x5'));var auth=require(_0xf0ad('0x6'));var interaction=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var controller=require(_0xf0ad('0x9'));router['get']('/',auth[_0xf0ad('0xa')](),controller['index']);router[_0xf0ad('0xb')](_0xf0ad('0xc'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0xd')]);router[_0xf0ad('0xb')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['show']);router[_0xf0ad('0xf')]('/:id',auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x10')]);router[_0xf0ad('0x11')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 2cb5d05..9adc19f 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 _0x6c4b=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6c4b,0x93));var _0xb6c4=function(_0x41425c,_0x493768){_0x41425c=_0x41425c-0x0;var _0x21b2e2=_0x6c4b[_0x41425c];return _0x21b2e2;};'use strict';var Sequelize=require(_0xb6c4('0x0'));var moment=require(_0xb6c4('0x1'));module[_0xb6c4('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb6c4('0x3')]},'scheduledat':{'type':Sequelize[_0xb6c4('0x4')]},'countbusyretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb6c4('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb6c4('0x3')]},'starttime':{'type':Sequelize[_0xb6c4('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb6c4('0x4')]},'droptime':{'type':Sequelize[_0xb6c4('0x4')]},'endtime':{'type':Sequelize[_0xb6c4('0x4')]},'ringtime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb6c4('0x3')]},'campaigntype':{'type':Sequelize[_0xb6c4('0x3')]},'membername':{'type':Sequelize[_0xb6c4('0x3')]},'reason':{'type':Sequelize[_0xb6c4('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb6c4('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb6c4('0x3')]},'dispositionat':{'type':Sequelize[_0xb6c4('0x4')],'set':function(_0x3c9d32){var _0x465416=this[_0xb6c4('0x6')](_0xb6c4('0x7'));if(_0x465416&&_0x3c9d32){this[_0xb6c4('0x8')]('followuptime',moment(_0x3c9d32)['diff'](moment(_0x465416),_0xb6c4('0x9')));}return this['setDataValue'](_0xb6c4('0xa'),_0x3c9d32);}},'amd':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb6c4('0x4')]},'callback':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb6c4('0x4')]},'deleted':{'type':Sequelize[_0xb6c4('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb6c4('0x4')]},'recallme':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb6c4('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9fb7=['sequelize','exports','INTEGER','DATE','STRING','getDataValue','setDataValue','diff','seconds','dispositionat','BOOLEAN'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9fb7,0xfd));var _0x79fb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9fb7[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x79fb('0x0'));var moment=require('moment');module[_0x79fb('0x1')]={'state':{'type':Sequelize[_0x79fb('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x79fb('0x3')]},'countbusyretry':{'type':Sequelize[_0x79fb('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x79fb('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x79fb('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x79fb('0x4')]},'originatecalleridname':{'type':Sequelize[_0x79fb('0x4')]},'calleridnum':{'type':Sequelize[_0x79fb('0x4')]},'calleridname':{'type':Sequelize[_0x79fb('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x79fb('0x3')]},'answertime':{'type':Sequelize[_0x79fb('0x3')]},'droptime':{'type':Sequelize[_0x79fb('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x79fb('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x79fb('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x79fb('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x79fb('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x79fb('0x4')]},'campaigntype':{'type':Sequelize[_0x79fb('0x4')]},'membername':{'type':Sequelize[_0x79fb('0x4')]},'reason':{'type':Sequelize[_0x79fb('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x79fb('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x55bd5f){var _0x5b2d4b=this[_0x79fb('0x5')]('endtime');if(_0x5b2d4b&&_0x55bd5f){this[_0x79fb('0x6')]('followuptime',moment(_0x55bd5f)[_0x79fb('0x7')](moment(_0x5b2d4b),_0x79fb('0x8')));}return this[_0x79fb('0x6')](_0x79fb('0x9'),_0x55bd5f);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x79fb('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x79fb('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x79fb('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x79fb('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x79fb('0x3')]},'deleted':{'type':Sequelize[_0x79fb('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x79fb('0x3')]},'recallme':{'type':Sequelize[_0x79fb('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x79fb('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x79fb('0x2')],'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 06e40cd..c6a6a00 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 _0x4c60=['include','findAll','rows','catch','show','includeAll','find','describe','update','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','VoiceQueue','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','CmHopperFinal','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x128e41,_0x2808d6){var _0x544908=function(_0x530fa2){while(--_0x530fa2){_0x128e41['push'](_0x128e41['shift']());}};_0x544908(++_0x2808d6);}(_0x4c60,0xc1));var _0x04c6=function(_0x494510,_0x1b999a){_0x494510=_0x494510-0x0;var _0x9773e1=_0x4c60[_0x494510];return _0x9773e1;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['CmHopperFinal'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['CmHopperFinal'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['CmHopperFinal'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')]()['then'](respondWithResult(_0x4ef366,null))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0x2472ed,_0xee2822){if(_0x2472ed['body'][_0x04c6('0x44')]){delete _0x2472ed[_0x04c6('0x45')][_0x04c6('0x44')];}return db[_0x04c6('0x27')]['find']({'where':{'uniqueid':_0x2472ed[_0x04c6('0x46')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0xee2822,null))[_0x04c6('0x1f')](saveUpdates(_0x2472ed[_0x04c6('0x45')],null))['then'](respondWithResult(_0xee2822,null))[_0x04c6('0x3e')](handleError(_0xee2822,null));};exports[_0x04c6('0x47')]=function(_0x15ec61,_0x489361,_0x3119f0){return db[_0x04c6('0x27')][_0x04c6('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x15ec61[_0x04c6('0x46')]['id']},'attributes':[[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4b')))),_0x04c6('0x4c')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),_0x04c6('0x55')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x56')))),'answeringMachine']]})[_0x04c6('0x1f')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x1f')](respondWithResult(_0x489361,null))[_0x04c6('0x3e')](handleError(_0x489361,null));};exports[_0x04c6('0x57')]=function(_0x28299e,_0x5b536f,_0xf073a8){return db[_0x04c6('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x28299e[_0x04c6('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize']['literal'](_0x04c6('0x4b')))),'noSuchContacts'],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x04c6('0x58')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x59')))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),'reCallContacts'],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x56')))),_0x04c6('0x5a')]]})[_0x04c6('0x1f')](handleEntityNotFound(_0x5b536f,null))[_0x04c6('0x1f')](respondWithResult(_0x5b536f,null))[_0x04c6('0x3e')](handleError(_0x5b536f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x31cc93,_0x1b6242,_0x1f5b9a){return db[_0x04c6('0x5b')][_0x04c6('0x41')]({'where':{'id':_0x31cc93['params']['id']}})['then'](handleEntityNotFound(_0x1b6242,null))[_0x04c6('0x1f')](function(_0x598941){var _0x2df63b;if(_0x598941){_0x2df63b=squel['insert']()[_0x04c6('0x5c')](_0x04c6('0x5d'))['fromQuery']([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),_0x04c6('0x64')],squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),'scheduledAt')[_0x04c6('0x66')](_0x04c6('0x69'),'ContactId')[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))[_0x04c6('0x66')](_0x04c6('0x6b'),'VoiceQueueId')[_0x04c6('0x66')]('NOW()',_0x04c6('0x63'))['field'](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())[_0x04c6('0x35')]('state\x20=\x20?',_0x31cc93[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x04c6('0x35')](_0x04c6('0x71'),squel['select']()[_0x04c6('0x66')](_0x04c6('0x5e'))['from'](_0x04c6('0x5d'))[_0x04c6('0x35')]('VoiceQueueId\x20=\x20?',_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()['field']('calleridnum')['from'](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where'](_0x04c6('0x72')))[_0x04c6('0x73')](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db[_0x04c6('0x48')][_0x04c6('0x2b')](_0x2df63b);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x1b6242,null))['catch'](handleError(_0x1b6242,null));};exports[_0x04c6('0x74')]=function(_0x4f258c,_0x202761,_0x480c74){return db['Campaign'][_0x04c6('0x41')]({'where':{'id':_0x4f258c['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x202761,null))[_0x04c6('0x1f')](function(_0x174de6){var _0x425d01;if(_0x174de6){_0x425d01=squel[_0x04c6('0x75')]()['into']('cm_hopper')[_0x04c6('0x76')]([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x77'),'createdAt',_0x04c6('0x64')],squel['select']()['field'](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x5f'))[_0x04c6('0x66')](_0x04c6('0x69'),_0x04c6('0x60'))[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))['field'](_0x04c6('0x78'),'CampaignId')['field'](_0x04c6('0x68'),_0x04c6('0x63'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x20?',_0x4f258c[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')](_0x04c6('0x7a'))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x5e'))[_0x04c6('0x6c')](_0x04c6('0x5d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c['params']['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x7b'))[_0x04c6('0x6c')](_0x04c6('0x6d'))['where'](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x204'))['group'](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db['sequelize'][_0x04c6('0x2b')](_0x425d01);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x202761,null))[_0x04c6('0x3e')](handleError(_0x202761,null));};exports['checkContactHopper']=function(_0x343c1f,_0x485457,_0x1c0c74){return db[_0x04c6('0x7c')][_0x04c6('0x7d')]({'where':{'VoiceQueueId':_0x343c1f['body']['VoiceQueueId'],'CampaignId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x77')],'ContactId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x60')]}})['then'](handleEntityNotFound(_0x485457,null))['then'](function(_0x3e12a4){if(_0x3e12a4){return _0x3e12a4;}return null;})[_0x04c6('0x1f')](respondWithResult(_0x485457,null))[_0x04c6('0x3e')](handleError(_0x485457,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(_0x59d8c6,_0x592806){var _0x1b8895=function(_0x5be7a5){while(--_0x5be7a5){_0x59d8c6['push'](_0x59d8c6['shift']());}};_0x1b8895(++_0x592806);}(_0x5fab,0x177));var _0xb5fa=function(_0x3b58c9,_0x1f46c3){_0x3b58c9=_0x3b58c9-0x0;var _0x5b653a=_0x5fab[_0x3b58c9];return _0x5b653a;};'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 a21b366..1a2ba4d 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 _0xcab3=['bluebird','request-promise','rimraf','../../config/environment','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment'];(function(_0x172006,_0x5cca46){var _0x2802dc=function(_0x4a238f){while(--_0x4a238f){_0x172006['push'](_0x172006['shift']());}};_0x2802dc(++_0x5cca46);}(_0xcab3,0xb1));var _0x3cab=function(_0xe4e08f,_0x52b9d7){_0xe4e08f=_0xe4e08f-0x0;var _0x15507f=_0xcab3[_0xe4e08f];return _0x15507f;};'use strict';var _=require(_0x3cab('0x0'));var util=require(_0x3cab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3cab('0x2'));var BPromise=require(_0x3cab('0x3'));var rp=require(_0x3cab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cab('0x5'));var config=require(_0x3cab('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x3cab('0x7')]=function(_0x10922b,_0x21dadf){return _0x10922b['define'](_0x3cab('0x8'),attributes,{'tableName':_0x3cab('0x9'),'paranoid':![],'indexes':[{'name':_0x3cab('0xa'),'fields':[_0x3cab('0xa')]},{'name':_0x3cab('0xb'),'fields':[_0x3cab('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1684=['path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3f024f,_0x353b7a){var _0x1767c7=function(_0x21a238){while(--_0x21a238){_0x3f024f['push'](_0x3f024f['shift']());}};_0x1767c7(++_0x353b7a);}(_0x1684,0x181));var _0x4168=function(_0x35d506,_0xb50b52){_0x35d506=_0x35d506-0x0;var _0x239e54=_0x1684[_0x35d506];return _0x239e54;};'use strict';var _=require(_0x4168('0x0'));var util=require(_0x4168('0x1'));var logger=require(_0x4168('0x2'))('api');var moment=require(_0x4168('0x3'));var BPromise=require('bluebird');var rp=require(_0x4168('0x4'));var fs=require('fs');var path=require(_0x4168('0x5'));var rimraf=require('rimraf');var config=require(_0x4168('0x6'));var attributes=require(_0x4168('0x7'));module[_0x4168('0x8')]=function(_0x44bd0,_0x33f4db){return _0x44bd0[_0x4168('0x9')](_0x4168('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x4168('0xb'),'fields':['calleridnum']},{'name':_0x4168('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index d97a143..e6e1097 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 _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(_0x24756b,_0x3aa816){var _0x2c2ac4=function(_0x3b6c1a){while(--_0x3b6c1a){_0x24756b['push'](_0x24756b['shift']());}};_0x2c2ac4(++_0x3aa816);}(_0xb10b,0x12a));var _0xbb10=function(_0x133f81,_0x550e62){_0x133f81=_0x133f81-0x0;var _0x2eef30=_0xb10b[_0x133f81];return _0x2eef30;};'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 +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(_0x42b5e0,_0xa19112){var _0x3e9a61=function(_0x27e5b7){while(--_0x27e5b7){_0x42b5e0['push'](_0x42b5e0['shift']());}};_0x3e9a61(++_0xa19112);}(_0xb10b,0x12a));var _0xbb10=function(_0x311e78,_0xbcf8ca){_0x311e78=_0x311e78-0x0;var _0x44fef6=_0xb10b[_0x311e78];return _0x44fef6;};'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 1b2f568..94f630e 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 _0xf6ea=['../../config/environment','isAuthenticated','index','get','/describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','checkContactHopper','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x499c73,_0x2062bf){var _0xb3ba37=function(_0x44f68e){while(--_0x44f68e){_0x499c73['push'](_0x499c73['shift']());}};_0xb3ba37(++_0x2062bf);}(_0xf6ea,0x14c));var _0xaf6e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf6ea[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xaf6e('0x0'));var util=require(_0xaf6e('0x1'));var path=require(_0xaf6e('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf6e('0x3'));var router=express[_0xaf6e('0x4')]();var fs_extra=require(_0xaf6e('0x5'));var auth=require(_0xaf6e('0x6'));var interaction=require(_0xaf6e('0x7'));var config=require(_0xaf6e('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0xaf6e('0x9')](),controller[_0xaf6e('0xa')]);router[_0xaf6e('0xb')](_0xaf6e('0xc'),auth[_0xaf6e('0x9')](),controller['describe']);router[_0xaf6e('0xb')](_0xaf6e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xaf6e('0xb')](_0xaf6e('0xe'),auth[_0xaf6e('0x9')](),controller[_0xaf6e('0xf')]);router[_0xaf6e('0xb')]('/campaign/countAttributes/:id',auth[_0xaf6e('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xaf6e('0x10')](_0xaf6e('0x11'),auth[_0xaf6e('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xaf6e('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xaf6e('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xaf6e('0x10')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xaf6e('0x12')]);router['put']('/:id',auth[_0xaf6e('0x9')](),controller[_0xaf6e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9e6d=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','put','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x281a3b,_0x1df435){var _0x387721=function(_0x3efe71){while(--_0x3efe71){_0x281a3b['push'](_0x281a3b['shift']());}};_0x387721(++_0x1df435);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x523bf0,_0x2bbaf5){_0x523bf0=_0x523bf0-0x0;var _0x1e60b3=_0x9e6d[_0x523bf0];return _0x1e60b3;};'use strict';var multer=require(_0xd9e6('0x0'));var util=require('util');var path=require(_0xd9e6('0x1'));var timeout=require(_0xd9e6('0x2'));var express=require(_0xd9e6('0x3'));var router=express['Router']();var fs_extra=require(_0xd9e6('0x4'));var auth=require(_0xd9e6('0x5'));var interaction=require(_0xd9e6('0x6'));var config=require(_0xd9e6('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xd9e6('0x8')]('/',auth[_0xd9e6('0x9')](),controller['index']);router['get'](_0xd9e6('0xa'),auth[_0xd9e6('0x9')](),controller[_0xd9e6('0xb')]);router['get'](_0xd9e6('0xc'),auth[_0xd9e6('0x9')](),controller['show']);router[_0xd9e6('0x8')](_0xd9e6('0xd'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0xd9e6('0x8')](_0xd9e6('0xe'),auth[_0xd9e6('0x9')](),controller[_0xd9e6('0xf')]);router[_0xd9e6('0x10')](_0xd9e6('0x11'),auth[_0xd9e6('0x9')](),controller[_0xd9e6('0x12')]);router[_0xd9e6('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xd9e6('0x9')](),controller[_0xd9e6('0x13')]);router['post']('/checkContactHopper',auth[_0xd9e6('0x9')](),controller['checkContactHopper']);router[_0xd9e6('0x14')](_0xd9e6('0xc'),auth[_0xd9e6('0x9')](),controller[_0xd9e6('0x15')]);module[_0xd9e6('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 4e070f1..0468597 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 _0x9735=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x432b87,_0x289bd0){var _0x3aa78a=function(_0x1e03ca){while(--_0x1e03ca){_0x432b87['push'](_0x432b87['shift']());}};_0x3aa78a(++_0x289bd0);}(_0x9735,0x17e));var _0x5973=function(_0x2836a4,_0x1d2c36){_0x2836a4=_0x2836a4-0x0;var _0x3ea55b=_0x9735[_0x2836a4];return _0x3ea55b;};'use strict';var Sequelize=require(_0x5973('0x0'));module[_0x5973('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5973('0x2')]},'scheduledat':{'type':Sequelize[_0x5973('0x3')]},'countbusyretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5973('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x5973('0x2')]},'originatecalleridname':{'type':Sequelize[_0x5973('0x2')]},'calleridnum':{'type':Sequelize[_0x5973('0x2')]},'calleridname':{'type':Sequelize[_0x5973('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5973('0x3')]},'droptime':{'type':Sequelize[_0x5973('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5973('0x2')]},'campaign':{'type':Sequelize[_0x5973('0x2')]},'campaigntype':{'type':Sequelize[_0x5973('0x2')]},'membername':{'type':Sequelize[_0x5973('0x2')]},'reason':{'type':Sequelize[_0x5973('0x2')]},'amd':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5973('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5973('0x3')]},'recallme':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5973('0x3')]},'edited':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8b23=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x534d91,_0x3f7e09){var _0xd21e67=function(_0x44ae5b){while(--_0x44ae5b){_0x534d91['push'](_0x534d91['shift']());}};_0xd21e67(++_0x3f7e09);}(_0x8b23,0x12a));var _0x38b2=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8b23[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x38b2('0x0'));module[_0x38b2('0x1')]={'state':{'type':Sequelize[_0x38b2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x38b2('0x3')]},'scheduledat':{'type':Sequelize[_0x38b2('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x38b2('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x38b2('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x38b2('0x3')]},'calleridname':{'type':Sequelize[_0x38b2('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x38b2('0x4')]},'answertime':{'type':Sequelize[_0x38b2('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x38b2('0x4')]},'ringtime':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x38b2('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x38b2('0x3')]},'membername':{'type':Sequelize[_0x38b2('0x3')]},'reason':{'type':Sequelize[_0x38b2('0x3')]},'amd':{'type':Sequelize[_0x38b2('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x38b2('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x38b2('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x38b2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x38b2('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x38b2('0x4')]},'edited':{'type':Sequelize[_0x38b2('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x38b2('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 9b07533..dd9b43e 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 _0xb275=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','length','options','find','create','body','describe','uniqueid','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xb275,0x114));var _0x5b27=function(_0x2ddc8f,_0x48bd60){_0x2ddc8f=_0x2ddc8f-0x0;var _0x32f754=_0xb275[_0x2ddc8f];return _0x32f754;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5b27('0x0'));var rp=require(_0x5b27('0x1'));var moment=require('moment');var BPromise=require(_0x5b27('0x2'));var Mustache=require('mustache');var util=require(_0x5b27('0x3'));var path=require('path');var sox=require(_0x5b27('0x4'));var csv=require(_0x5b27('0x5'));var ejs=require(_0x5b27('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b27('0x7'));var crypto=require(_0x5b27('0x8'));var jsforce=require(_0x5b27('0x9'));var deskjs=require(_0x5b27('0xa'));var toCsv=require(_0x5b27('0x5'));var querystring=require(_0x5b27('0xb'));var Papa=require(_0x5b27('0xc'));var Redis=require(_0x5b27('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5b27('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b27('0xf'));var logger=require(_0x5b27('0x10'))(_0x5b27('0x11'));var utils=require(_0x5b27('0x12'));var config=require(_0x5b27('0x13'));var licenseUtil=require(_0x5b27('0x14'));var db=require(_0x5b27('0x15'))['db'];function respondWithStatusCode(_0x31ae41,_0x3d946f){_0x3d946f=_0x3d946f||0xcc;return function(_0x3c2faf){if(_0x3c2faf){return _0x31ae41['sendStatus'](_0x3d946f);}return _0x31ae41[_0x5b27('0x16')](_0x3d946f)[_0x5b27('0x17')]();};}function respondWithResult(_0x43abc0,_0x347772){_0x347772=_0x347772||0xc8;return function(_0xaa6df3){if(_0xaa6df3){return _0x43abc0[_0x5b27('0x16')](_0x347772)[_0x5b27('0x18')](_0xaa6df3);}};}function respondWithFilteredResult(_0x3f798f,_0x24ba16){return function(_0x1974e7){if(_0x1974e7){var _0x477b83=typeof _0x24ba16[_0x5b27('0x19')]===_0x5b27('0x1a')&&typeof _0x24ba16[_0x5b27('0x1b')]==='undefined';var _0x1294fe=_0x1974e7[_0x5b27('0x1c')];var _0x1d9ad5=_0x477b83?0x0:_0x24ba16[_0x5b27('0x19')];var _0x5b7946=_0x477b83?_0x1974e7['count']:_0x24ba16[_0x5b27('0x19')]+_0x24ba16[_0x5b27('0x1b')];var _0x21b3fb;if(_0x5b7946>=_0x1294fe){_0x5b7946=_0x1294fe;_0x21b3fb=0xc8;}else{_0x21b3fb=0xce;}_0x3f798f[_0x5b27('0x16')](_0x21b3fb);return _0x3f798f['set'](_0x5b27('0x1d'),_0x1d9ad5+'-'+_0x5b7946+'/'+_0x1294fe)[_0x5b27('0x18')](_0x1974e7);}return null;};}function patchUpdates(_0x20bf28){return function(_0x4101b9){try{jsonpatch[_0x5b27('0x1e')](_0x4101b9,_0x20bf28,!![]);}catch(_0x2605a6){return BPromise[_0x5b27('0x1f')](_0x2605a6);}return _0x4101b9[_0x5b27('0x20')]();};}function saveUpdates(_0x50a1e8,_0x2b6786){return function(_0x252982){if(_0x252982){return _0x252982[_0x5b27('0x21')](_0x50a1e8)[_0x5b27('0x22')](function(_0x52d91c){return _0x52d91c;});}return null;};}function removeEntity(_0x4abbd7,_0x26756f){return function(_0x5cdc57){if(_0x5cdc57){return _0x5cdc57[_0x5b27('0x23')]()[_0x5b27('0x22')](function(){_0x4abbd7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7617,_0x3d8ce1){return function(_0x3c81d6){if(!_0x3c81d6){_0x1e7617[_0x5b27('0x24')](0x194);}return _0x3c81d6;};}function handleError(_0x4e4170,_0xa42e6a){_0xa42e6a=_0xa42e6a||0x1f4;return function(_0x12b313){logger['error'](_0x12b313[_0x5b27('0x25')]);if(_0x12b313[_0x5b27('0x26')]){delete _0x12b313['name'];}_0x4e4170[_0x5b27('0x16')](_0xa42e6a)[_0x5b27('0x27')](_0x12b313);};}exports[_0x5b27('0x28')]=function(_0x1e7757,_0x2c0aed){var _0x527f35={},_0x468927={},_0x485cf3={'count':0x0,'rows':[]};var _0xeb9b18=_['map'](db[_0x5b27('0x29')][_0x5b27('0x2a')],function(_0x784d59){return{'name':_0x784d59[_0x5b27('0x2b')],'type':_0x784d59[_0x5b27('0x2c')][_0x5b27('0x2d')]};});_0x468927[_0x5b27('0x2e')]=_[_0x5b27('0x2f')](_0xeb9b18,_0x5b27('0x26'));_0x468927['query']=_[_0x5b27('0x30')](_0x1e7757[_0x5b27('0x31')]);_0x468927[_0x5b27('0x32')]=_[_0x5b27('0x33')](_0x468927[_0x5b27('0x2e')],_0x468927[_0x5b27('0x31')]);_0x527f35[_0x5b27('0x34')]=_[_0x5b27('0x33')](_0x468927[_0x5b27('0x2e')],qs[_0x5b27('0x35')](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x35')]));_0x527f35[_0x5b27('0x34')]=_0x527f35[_0x5b27('0x34')]['length']?_0x527f35[_0x5b27('0x34')]:_0x468927[_0x5b27('0x2e')];if(!_0x1e7757[_0x5b27('0x31')][_0x5b27('0x36')](_0x5b27('0x37'))){_0x527f35['limit']=qs['limit'](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x1b')]);_0x527f35[_0x5b27('0x19')]=qs[_0x5b27('0x19')](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x19')]);}_0x527f35[_0x5b27('0x38')]=qs[_0x5b27('0x39')](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x39')]);_0x527f35[_0x5b27('0x3a')]=qs[_0x5b27('0x32')](_[_0x5b27('0x3b')](_0x1e7757['query'],_0x468927['filters']),_0xeb9b18);if(_0x1e7757[_0x5b27('0x31')][_0x5b27('0x3c')]){_0x527f35['where']=_[_0x5b27('0x3d')](_0x527f35[_0x5b27('0x3a')],{'$or':_[_0x5b27('0x2f')](_0xeb9b18,function(_0x339c67){if(_0x339c67[_0x5b27('0x2c')]!==_0x5b27('0x3e')){var _0x567311={};_0x567311[_0x339c67[_0x5b27('0x26')]]={'$like':'%'+_0x1e7757['query'][_0x5b27('0x3c')]+'%'};return _0x567311;}})});}_0x527f35=_['merge']({},_0x527f35,_0x1e7757['options']);var _0x146bad={'where':_0x527f35[_0x5b27('0x3a')]};return db[_0x5b27('0x29')][_0x5b27('0x1c')](_0x146bad)[_0x5b27('0x22')](function(_0x3d0c75){_0x485cf3[_0x5b27('0x1c')]=_0x3d0c75;if(_0x1e7757[_0x5b27('0x31')]['includeAll']){_0x527f35['include']=[{'all':!![]}];}return db[_0x5b27('0x29')][_0x5b27('0x3f')](_0x527f35);})['then'](function(_0x2971af){_0x485cf3[_0x5b27('0x40')]=_0x2971af;return _0x485cf3;})[_0x5b27('0x22')](respondWithFilteredResult(_0x2c0aed,_0x527f35))[_0x5b27('0x41')](handleError(_0x2c0aed,null));};exports[_0x5b27('0x42')]=function(_0x4a305b,_0x21cedf){var _0x12b698={'raw':!![],'where':{'id':_0x4a305b[_0x5b27('0x43')]['id']}},_0x19d723={};_0x19d723[_0x5b27('0x2e')]=_[_0x5b27('0x30')](db['CmHopperHistory']['rawAttributes']);_0x19d723[_0x5b27('0x31')]=_[_0x5b27('0x30')](_0x4a305b['query']);_0x19d723[_0x5b27('0x32')]=_[_0x5b27('0x33')](_0x19d723['model'],_0x19d723[_0x5b27('0x31')]);_0x12b698[_0x5b27('0x34')]=_[_0x5b27('0x33')](_0x19d723['model'],qs[_0x5b27('0x35')](_0x4a305b[_0x5b27('0x31')][_0x5b27('0x35')]));_0x12b698[_0x5b27('0x34')]=_0x12b698['attributes'][_0x5b27('0x44')]?_0x12b698['attributes']:_0x19d723[_0x5b27('0x2e')];if(_0x4a305b['query']['includeAll']){_0x12b698['include']=[{'all':!![]}];}_0x12b698=_[_0x5b27('0x3d')]({},_0x12b698,_0x4a305b[_0x5b27('0x45')]);return db[_0x5b27('0x29')][_0x5b27('0x46')](_0x12b698)[_0x5b27('0x22')](handleEntityNotFound(_0x21cedf,null))[_0x5b27('0x22')](respondWithResult(_0x21cedf,null))[_0x5b27('0x41')](handleError(_0x21cedf,null));};exports[_0x5b27('0x47')]=function(_0x511667,_0x2098d4){return db['CmHopperHistory'][_0x5b27('0x47')](_0x511667[_0x5b27('0x48')],{})[_0x5b27('0x22')](respondWithResult(_0x2098d4,0xc9))[_0x5b27('0x41')](handleError(_0x2098d4,null));};exports[_0x5b27('0x49')]=function(_0x49c2a1,_0x3264c5){return db[_0x5b27('0x29')][_0x5b27('0x49')]()[_0x5b27('0x22')](respondWithResult(_0x3264c5,null))['catch'](handleError(_0x3264c5,null));};exports['update']=function(_0x566c22,_0x5b0adc){if(_0x566c22['body'][_0x5b27('0x4a')]){delete _0x566c22[_0x5b27('0x48')][_0x5b27('0x4a')];}return db[_0x5b27('0x29')][_0x5b27('0x46')]({'where':{'uniqueid':_0x566c22['params']['id']}})[_0x5b27('0x22')](handleEntityNotFound(_0x5b0adc,null))['then'](saveUpdates(_0x566c22[_0x5b27('0x48')],null))['then'](respondWithResult(_0x5b0adc,null))[_0x5b27('0x41')](handleError(_0x5b0adc,null));}; \ No newline at end of file +var _0x414f=['fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','CmHopperHistory','include','findAll','catch','show','params','keys','find','create','body','describe','uniqueid','rimraf','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','map','query','attributes','intersection','model'];(function(_0x4e0e08,_0x3a3b8c){var _0x391fd6=function(_0x14e515){while(--_0x14e515){_0x4e0e08['push'](_0x4e0e08['shift']());}};_0x391fd6(++_0x3a3b8c);}(_0x414f,0xa8));var _0xf414=function(_0x5a6ee4,_0x2e1727){_0x5a6ee4=_0x5a6ee4-0x0;var _0x5906fa=_0x414f[_0x5a6ee4];return _0x5906fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf414('0x0'));var zipdir=require(_0xf414('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf414('0x2'));var moment=require(_0xf414('0x3'));var BPromise=require(_0xf414('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf414('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf414('0x6'));var fs=require('fs');var fs_extra=require(_0xf414('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf414('0x8'));var jsforce=require(_0xf414('0x9'));var deskjs=require(_0xf414('0xa'));var toCsv=require(_0xf414('0xb'));var querystring=require(_0xf414('0xc'));var Papa=require('papaparse');var Redis=require(_0xf414('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf414('0xe'));var hardwareService=require(_0xf414('0xf'));var logger=require(_0xf414('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xf414('0x11'));var licenseUtil=require(_0xf414('0x12'));var db=require(_0xf414('0x13'))['db'];function respondWithStatusCode(_0x3de225,_0x1e16e7){_0x1e16e7=_0x1e16e7||0xcc;return function(_0x2bce14){if(_0x2bce14){return _0x3de225[_0xf414('0x14')](_0x1e16e7);}return _0x3de225[_0xf414('0x15')](_0x1e16e7)[_0xf414('0x16')]();};}function respondWithResult(_0x2be316,_0x215198){_0x215198=_0x215198||0xc8;return function(_0x21e8bd){if(_0x21e8bd){return _0x2be316['status'](_0x215198)[_0xf414('0x17')](_0x21e8bd);}};}function respondWithFilteredResult(_0x3e6292,_0x2122a7){return function(_0x4f5fd0){if(_0x4f5fd0){var _0x160ada=typeof _0x2122a7[_0xf414('0x18')]===_0xf414('0x19')&&typeof _0x2122a7[_0xf414('0x1a')]===_0xf414('0x19');var _0x16075a=_0x4f5fd0[_0xf414('0x1b')];var _0x2e6bbf=_0x160ada?0x0:_0x2122a7['offset'];var _0x55143a=_0x160ada?_0x4f5fd0[_0xf414('0x1b')]:_0x2122a7[_0xf414('0x18')]+_0x2122a7['limit'];var _0x23a7ce;if(_0x55143a>=_0x16075a){_0x55143a=_0x16075a;_0x23a7ce=0xc8;}else{_0x23a7ce=0xce;}_0x3e6292['status'](_0x23a7ce);return _0x3e6292[_0xf414('0x1c')](_0xf414('0x1d'),_0x2e6bbf+'-'+_0x55143a+'/'+_0x16075a)[_0xf414('0x17')](_0x4f5fd0);}return null;};}function patchUpdates(_0x2e7cf2){return function(_0x26da23){try{jsonpatch[_0xf414('0x1e')](_0x26da23,_0x2e7cf2,!![]);}catch(_0x4e797f){return BPromise[_0xf414('0x1f')](_0x4e797f);}return _0x26da23[_0xf414('0x20')]();};}function saveUpdates(_0x3e044f,_0x1544c3){return function(_0x5ae29f){if(_0x5ae29f){return _0x5ae29f[_0xf414('0x21')](_0x3e044f)[_0xf414('0x22')](function(_0x27ccb6){return _0x27ccb6;});}return null;};}function removeEntity(_0x22ce82,_0x35f719){return function(_0x45971c){if(_0x45971c){return _0x45971c[_0xf414('0x23')]()[_0xf414('0x22')](function(){_0x22ce82[_0xf414('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb45fa,_0x16597a){return function(_0x848a17){if(!_0x848a17){_0xcb45fa[_0xf414('0x14')](0x194);}return _0x848a17;};}function handleError(_0x1f6682,_0x3f9170){_0x3f9170=_0x3f9170||0x1f4;return function(_0x713ab8){logger['error'](_0x713ab8[_0xf414('0x24')]);if(_0x713ab8[_0xf414('0x25')]){delete _0x713ab8['name'];}_0x1f6682[_0xf414('0x15')](_0x3f9170)[_0xf414('0x26')](_0x713ab8);};}exports['index']=function(_0x3855ea,_0xcb05ac){var _0x140afe={},_0x361295={},_0x3bef60={'count':0x0,'rows':[]};var _0x30d78b=_['map'](db['CmHopperHistory'][_0xf414('0x27')],function(_0x559517){return{'name':_0x559517[_0xf414('0x28')],'type':_0x559517[_0xf414('0x29')][_0xf414('0x2a')]};});_0x361295['model']=_[_0xf414('0x2b')](_0x30d78b,_0xf414('0x25'));_0x361295[_0xf414('0x2c')]=_['keys'](_0x3855ea['query']);_0x361295['filters']=_['intersection'](_0x361295['model'],_0x361295[_0xf414('0x2c')]);_0x140afe[_0xf414('0x2d')]=_[_0xf414('0x2e')](_0x361295[_0xf414('0x2f')],qs[_0xf414('0x30')](_0x3855ea[_0xf414('0x2c')]['fields']));_0x140afe[_0xf414('0x2d')]=_0x140afe[_0xf414('0x2d')][_0xf414('0x31')]?_0x140afe['attributes']:_0x361295[_0xf414('0x2f')];if(!_0x3855ea[_0xf414('0x2c')][_0xf414('0x32')](_0xf414('0x33'))){_0x140afe['limit']=qs[_0xf414('0x1a')](_0x3855ea[_0xf414('0x2c')]['limit']);_0x140afe['offset']=qs[_0xf414('0x18')](_0x3855ea[_0xf414('0x2c')][_0xf414('0x18')]);}_0x140afe[_0xf414('0x34')]=qs[_0xf414('0x35')](_0x3855ea[_0xf414('0x2c')][_0xf414('0x35')]);_0x140afe['where']=qs['filters'](_['pick'](_0x3855ea[_0xf414('0x2c')],_0x361295[_0xf414('0x36')]),_0x30d78b);if(_0x3855ea['query'][_0xf414('0x37')]){_0x140afe[_0xf414('0x38')]=_[_0xf414('0x39')](_0x140afe[_0xf414('0x38')],{'$or':_[_0xf414('0x2b')](_0x30d78b,function(_0x333f20){if(_0x333f20[_0xf414('0x29')]!==_0xf414('0x3a')){var _0x463141={};_0x463141[_0x333f20[_0xf414('0x25')]]={'$like':'%'+_0x3855ea['query']['filter']+'%'};return _0x463141;}})});}_0x140afe=_[_0xf414('0x39')]({},_0x140afe,_0x3855ea[_0xf414('0x3b')]);var _0x9be384={'where':_0x140afe[_0xf414('0x38')]};return db[_0xf414('0x3c')]['count'](_0x9be384)[_0xf414('0x22')](function(_0x5ccc45){_0x3bef60[_0xf414('0x1b')]=_0x5ccc45;if(_0x3855ea[_0xf414('0x2c')]['includeAll']){_0x140afe[_0xf414('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf414('0x3e')](_0x140afe);})[_0xf414('0x22')](function(_0x4a5217){_0x3bef60['rows']=_0x4a5217;return _0x3bef60;})[_0xf414('0x22')](respondWithFilteredResult(_0xcb05ac,_0x140afe))[_0xf414('0x3f')](handleError(_0xcb05ac,null));};exports[_0xf414('0x40')]=function(_0x50a3f8,_0x4319f5){var _0x4d7095={'raw':!![],'where':{'id':_0x50a3f8[_0xf414('0x41')]['id']}},_0x48b1e6={};_0x48b1e6[_0xf414('0x2f')]=_['keys'](db['CmHopperHistory'][_0xf414('0x27')]);_0x48b1e6['query']=_[_0xf414('0x42')](_0x50a3f8[_0xf414('0x2c')]);_0x48b1e6[_0xf414('0x36')]=_[_0xf414('0x2e')](_0x48b1e6[_0xf414('0x2f')],_0x48b1e6[_0xf414('0x2c')]);_0x4d7095[_0xf414('0x2d')]=_[_0xf414('0x2e')](_0x48b1e6[_0xf414('0x2f')],qs[_0xf414('0x30')](_0x50a3f8[_0xf414('0x2c')]['fields']));_0x4d7095[_0xf414('0x2d')]=_0x4d7095[_0xf414('0x2d')]['length']?_0x4d7095['attributes']:_0x48b1e6[_0xf414('0x2f')];if(_0x50a3f8[_0xf414('0x2c')]['includeAll']){_0x4d7095['include']=[{'all':!![]}];}_0x4d7095=_['merge']({},_0x4d7095,_0x50a3f8[_0xf414('0x3b')]);return db['CmHopperHistory'][_0xf414('0x43')](_0x4d7095)[_0xf414('0x22')](handleEntityNotFound(_0x4319f5,null))[_0xf414('0x22')](respondWithResult(_0x4319f5,null))[_0xf414('0x3f')](handleError(_0x4319f5,null));};exports[_0xf414('0x44')]=function(_0x325411,_0x313ee3){return db[_0xf414('0x3c')][_0xf414('0x44')](_0x325411[_0xf414('0x45')],{})['then'](respondWithResult(_0x313ee3,0xc9))[_0xf414('0x3f')](handleError(_0x313ee3,null));};exports[_0xf414('0x46')]=function(_0x110567,_0x229fc7){return db[_0xf414('0x3c')][_0xf414('0x46')]()[_0xf414('0x22')](respondWithResult(_0x229fc7,null))[_0xf414('0x3f')](handleError(_0x229fc7,null));};exports['update']=function(_0x17e982,_0x2a3bbb){if(_0x17e982[_0xf414('0x45')][_0xf414('0x47')]){delete _0x17e982['body'][_0xf414('0x47')];}return db[_0xf414('0x3c')][_0xf414('0x43')]({'where':{'uniqueid':_0x17e982[_0xf414('0x41')]['id']}})[_0xf414('0x22')](handleEntityNotFound(_0x2a3bbb,null))[_0xf414('0x22')](saveUpdates(_0x17e982[_0xf414('0x45')],null))[_0xf414('0x22')](respondWithResult(_0x2a3bbb,null))[_0xf414('0x3f')](handleError(_0x2a3bbb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index c5fcee1..ba26e88 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 _0x2dd8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid','lodash','util'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x2dd8,0x143));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82dd('0x2'));var BPromise=require(_0x82dd('0x3'));var rp=require(_0x82dd('0x4'));var fs=require('fs');var path=require(_0x82dd('0x5'));var rimraf=require(_0x82dd('0x6'));var config=require(_0x82dd('0x7'));var attributes=require(_0x82dd('0x8'));module['exports']=function(_0x4026c3,_0x1cfdce){return _0x4026c3[_0x82dd('0x9')](_0x82dd('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x82dd('0xb'),'fields':[_0x82dd('0xb')]},{'name':_0x82dd('0xc'),'fields':[_0x82dd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffd6=['bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x28b064,_0x1add79){var _0x229c58=function(_0x3ab4a0){while(--_0x3ab4a0){_0x28b064['push'](_0x28b064['shift']());}};_0x229c58(++_0x1add79);}(_0xffd6,0x97));var _0x6ffd=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xffd6[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var logger=require(_0x6ffd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ffd('0x3'));var rp=require(_0x6ffd('0x4'));var fs=require('fs');var path=require(_0x6ffd('0x5'));var rimraf=require('rimraf');var config=require(_0x6ffd('0x6'));var attributes=require(_0x6ffd('0x7'));module[_0x6ffd('0x8')]=function(_0x2949a4,_0x561055){return _0x2949a4[_0x6ffd('0x9')](_0x6ffd('0xa'),attributes,{'tableName':_0x6ffd('0xb'),'paranoid':![],'indexes':[{'name':_0x6ffd('0xc'),'fields':[_0x6ffd('0xc')]},{'name':'uniqueid','fields':[_0x6ffd('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 69b685d..52068fd 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 _0x688a=['outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','result','catch','create','body','options','CreateCmHopperHistory','AvgHandleTime','CmHopperHistory','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','campaign','name','`state`\x20=\x200,\x201,\x20null'];(function(_0x381ac4,_0x521252){var _0x2b11a5=function(_0x17bc2c){while(--_0x17bc2c){_0x381ac4['push'](_0x381ac4['shift']());}};_0x2b11a5(++_0x521252);}(_0x688a,0x124));var _0xa688=function(_0x26e850,_0xe6592b){_0x26e850=_0x26e850-0x0;var _0x5b1cf9=_0x688a[_0x26e850];return _0x5b1cf9;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var moment=require(_0xa688('0x2'));var BPromise=require('bluebird');var rs=require(_0xa688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa688('0x4'))['db'];var utils=require(_0xa688('0x5'));var logger=require('../../config/logger')(_0xa688('0x6'));var config=require(_0xa688('0x7'));var jayson=require(_0xa688('0x8'));var client=jayson[_0xa688('0x9')][_0xa688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a362a,_0x49e75d,_0x5aee29){return new BPromise(function(_0x45c969,_0x3f3d81){return client[_0xa688('0xb')](_0x2a362a,_0x5aee29)['then'](function(_0x4d3b92){logger[_0xa688('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x49e75d,'request\x20sent');logger[_0xa688('0xd')](_0xa688('0xe'),_0x49e75d,_0xa688('0xf'),JSON[_0xa688('0x10')](_0x4d3b92));if(_0x4d3b92[_0xa688('0x11')]){if(_0x4d3b92[_0xa688('0x11')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x49e75d,_0x4d3b92[_0xa688('0x11')][_0xa688('0x12')]);return _0x3f3d81(_0x4d3b92['error'][_0xa688('0x12')]);}logger['error'](_0xa688('0x13'),_0x49e75d,_0x4d3b92[_0xa688('0x11')]['message']);return _0x45c969(_0x4d3b92['error'][_0xa688('0x12')]);}else{logger['info'](_0xa688('0x13'),_0x49e75d,'request\x20sent');_0x45c969(_0x4d3b92[_0xa688('0x14')][_0xa688('0x12')]);}})[_0xa688('0x15')](function(_0x25b453){logger[_0xa688('0x11')](_0xa688('0x13'),_0x49e75d,_0x25b453);_0x3f3d81(_0x25b453);});});}exports['CreateCmHopperHistory']=function(_0x59e392){var _0x14ca3c=this;return new Promise(function(_0x1330d5,_0x5dc07f){return db['CmHopperHistory'][_0xa688('0x16')](_0x59e392[_0xa688('0x17')],{'raw':_0x59e392['options']?_0x59e392[_0xa688('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x152cfe){logger[_0xa688('0xc')](_0xa688('0x19'),_0x59e392);logger[_0xa688('0xd')](_0xa688('0x19'),_0x59e392,JSON[_0xa688('0x10')](_0x152cfe));_0x1330d5(_0x152cfe);})[_0xa688('0x15')](function(_0x203214){logger[_0xa688('0x11')](_0xa688('0x19'),_0x203214[_0xa688('0x12')],_0x59e392);_0x5dc07f(_0x14ca3c[_0xa688('0x11')](0x1f4,_0x203214[_0xa688('0x12')]));});});};exports[_0xa688('0x1a')]=function(_0x48cb17){var _0x442672=this;return new Promise(function(_0x32a682,_0x4fa15e){return db[_0xa688('0x1b')][_0xa688('0x1c')]({'raw':_0x48cb17['options']?_0x48cb17[_0xa688('0x18')][_0xa688('0x1d')]===undefined?!![]:![]:!![],'where':_0x48cb17[_0xa688('0x18')]?_0x48cb17[_0xa688('0x18')][_0xa688('0x1e')]||null:null,'attributes':[[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')][_0xa688('0x21')]('id')),_0xa688('0x22')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xa688('0x24')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xa688('0x20'),db['sequelize']['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x25')))),_0xa688('0x26')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x27'),db[_0xa688('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x27'),db[_0xa688('0x1f')]['fn']('IF',db['sequelize'][_0xa688('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x376ad2){logger[_0xa688('0xc')](_0xa688('0x1a'),_0x48cb17);logger['debug']('AvgHandleTime',_0x48cb17,JSON[_0xa688('0x10')](_0x376ad2));_0x32a682(_0x376ad2);})[_0xa688('0x15')](function(_0x2ba000){logger[_0xa688('0x11')](_0xa688('0x1a'),_0x2ba000['message'],_0x48cb17);_0x4fa15e(_0x442672['error'](0x1f4,_0x2ba000[_0xa688('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x11806b){var _0x2f8f0d=this;return new Promise(function(_0x19e13b,_0x288171){return db['CmHopperHistory'][_0xa688('0x1c')]({'raw':_0x11806b['options']?_0x11806b['options'][_0xa688('0x1d')]===undefined?!![]:![]:!![],'where':_0x11806b['options']?_0x11806b[_0xa688('0x18')]['where']||null:null,'attributes':[[_0xa688('0x28'),_0xa688('0x29')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2a')))),_0xa688('0x2b')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2c')))),'outboundNoAnswerCallsDay'],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2d')))),'outboundAnswerCallsDay'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db['sequelize']['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2e')))),_0xa688('0x2f')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0xa688('0x30')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x31')))),_0xa688('0x32')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa688('0x33')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x34')))),_0xa688('0x35')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x36')))),_0xa688('0x37')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x38')))),_0xa688('0x39')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3a')))),_0xa688('0x3b')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3c')))),'outboundAnswerAgiCallsDay'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3d')))),'outboundRejectCallsDay'],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xa688('0x3e')))),_0xa688('0x3f')]],'group':[_0xa688('0x28')]})['then'](function(_0x4381a4){logger['info']('GetVoiceQueueHopperHistory',_0x11806b);logger['debug']('GetVoiceQueueHopperHistory',_0x11806b,JSON['stringify'](_0x4381a4));_0x19e13b(_0x4381a4);})[_0xa688('0x15')](function(_0x1b8be2){logger[_0xa688('0x11')]('GetVoiceQueueHopperHistory',_0x1b8be2[_0xa688('0x12')],_0x11806b);_0x288171(_0x2f8f0d['error'](0x1f4,_0x1b8be2[_0xa688('0x12')]));});});};exports[_0xa688('0x40')]=function(_0x3adf43){var _0x38defa=this;return new Promise(function(_0x25c618,_0x409b63){return db[_0xa688('0x1b')][_0xa688('0x1c')]({'raw':_0x3adf43[_0xa688('0x18')]?_0x3adf43[_0xa688('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3adf43['options']?_0x3adf43['options'][_0xa688('0x1e')]||null:null,'attributes':[[_0xa688('0x28'),_0xa688('0x29')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')][_0xa688('0x21')]('id')),_0xa688('0x41')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2d')))),_0xa688('0x42')]],'group':['campaign']})['then'](function(_0x2068cb){logger['info']('GetCampaignHopperHistory',_0x3adf43);logger[_0xa688('0xd')](_0xa688('0x40'),_0x3adf43,JSON['stringify'](_0x2068cb));_0x25c618(_0x2068cb);})[_0xa688('0x15')](function(_0x4ccb2f){logger[_0xa688('0x11')]('GetCampaignHopperHistory',_0x4ccb2f[_0xa688('0x12')],_0x3adf43);_0x409b63(_0x38defa['error'](0x1f4,_0x4ccb2f[_0xa688('0x12')]));});});}; \ No newline at end of file +var _0x475d=['outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateCmHopperHistory','body','options','raw','debug','catch','CmHopperHistory','findAll','COUNT','sequelize','col','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x475d,0x110));var _0xd475=function(_0x3c95a3,_0x1159f1){_0x3c95a3=_0x3c95a3-0x0;var _0x57b25b=_0x475d[_0x3c95a3];return _0x57b25b;};'use strict';var _=require(_0xd475('0x0'));var util=require(_0xd475('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd475('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd475('0x3'));var logger=require(_0xd475('0x4'))('rpc');var config=require(_0xd475('0x5'));var jayson=require(_0xd475('0x6'));var client=jayson[_0xd475('0x7')][_0xd475('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16a473,_0x55a8b9,_0x532324){return new BPromise(function(_0xb35147,_0x11b96d){return client[_0xd475('0x9')](_0x16a473,_0x532324)[_0xd475('0xa')](function(_0x207074){logger[_0xd475('0xb')](_0xd475('0xc'),_0x55a8b9,_0xd475('0xd'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x55a8b9,_0xd475('0xd'),JSON[_0xd475('0xe')](_0x207074));if(_0x207074[_0xd475('0xf')]){if(_0x207074['error'][_0xd475('0x10')]===0x1f4){logger[_0xd475('0xf')](_0xd475('0xc'),_0x55a8b9,_0x207074[_0xd475('0xf')][_0xd475('0x11')]);return _0x11b96d(_0x207074[_0xd475('0xf')][_0xd475('0x11')]);}logger[_0xd475('0xf')](_0xd475('0xc'),_0x55a8b9,_0x207074[_0xd475('0xf')]['message']);return _0xb35147(_0x207074[_0xd475('0xf')][_0xd475('0x11')]);}else{logger['info'](_0xd475('0xc'),_0x55a8b9,_0xd475('0xd'));_0xb35147(_0x207074[_0xd475('0x12')][_0xd475('0x11')]);}})['catch'](function(_0x167f60){logger[_0xd475('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x55a8b9,_0x167f60);_0x11b96d(_0x167f60);});});}exports[_0xd475('0x13')]=function(_0x31881f){var _0x199a94=this;return new Promise(function(_0x20d411,_0x372e66){return db['CmHopperHistory']['create'](_0x31881f[_0xd475('0x14')],{'raw':_0x31881f[_0xd475('0x15')]?_0x31881f[_0xd475('0x15')][_0xd475('0x16')]===undefined?!![]:![]:!![]})[_0xd475('0xa')](function(_0x3266fd){logger[_0xd475('0xb')](_0xd475('0x13'),_0x31881f);logger[_0xd475('0x17')](_0xd475('0x13'),_0x31881f,JSON[_0xd475('0xe')](_0x3266fd));_0x20d411(_0x3266fd);})[_0xd475('0x18')](function(_0x5baf12){logger[_0xd475('0xf')](_0xd475('0x13'),_0x5baf12[_0xd475('0x11')],_0x31881f);_0x372e66(_0x199a94[_0xd475('0xf')](0x1f4,_0x5baf12[_0xd475('0x11')]));});});};exports['AvgHandleTime']=function(_0x65f253){var _0x2f2847=this;return new Promise(function(_0x2dce0e,_0x1b07e1){return db[_0xd475('0x19')][_0xd475('0x1a')]({'raw':_0x65f253[_0xd475('0x15')]?_0x65f253[_0xd475('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x65f253[_0xd475('0x15')]?_0x65f253[_0xd475('0x15')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')][_0xd475('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')](_0xd475('0x1f')))),_0xd475('0x20')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xd475('0x21')))),_0xd475('0x22')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x23'),db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xd475('0x24')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x23'),db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xd475('0x25')]]})['then'](function(_0x117721){logger[_0xd475('0xb')](_0xd475('0x26'),_0x65f253);logger[_0xd475('0x17')](_0xd475('0x26'),_0x65f253,JSON[_0xd475('0xe')](_0x117721));_0x2dce0e(_0x117721);})[_0xd475('0x18')](function(_0x34f8c4){logger[_0xd475('0xf')](_0xd475('0x26'),_0x34f8c4[_0xd475('0x11')],_0x65f253);_0x1b07e1(_0x2f2847[_0xd475('0xf')](0x1f4,_0x34f8c4[_0xd475('0x11')]));});});};exports[_0xd475('0x27')]=function(_0x519c6f){var _0x1f9b86=this;return new Promise(function(_0x8c0199,_0x40d5bf){return db['CmHopperHistory']['findAll']({'raw':_0x519c6f['options']?_0x519c6f[_0xd475('0x15')][_0xd475('0x16')]===undefined?!![]:![]:!![],'where':_0x519c6f[_0xd475('0x15')]?_0x519c6f[_0xd475('0x15')][_0xd475('0x28')]||null:null,'attributes':[[_0xd475('0x29'),_0xd475('0x2a')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db['sequelize']['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')](_0xd475('0x2b')))),_0xd475('0x2c')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db['sequelize']['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')]('`state`\x20=\x203,\x201,\x20null'))),_0xd475('0x2d')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xd475('0x2e')))),_0xd475('0x2f')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')]('`state`\x20=\x205,\x201,\x20null'))),_0xd475('0x30')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db['sequelize']['fn']('IF',db[_0xd475('0x1c')]['literal'](_0xd475('0x31')))),_0xd475('0x32')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd475('0x33')],[db['sequelize']['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db['sequelize'][_0xd475('0x1e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xd475('0x34')],[db[_0xd475('0x1c')]['fn']('COUNT',db[_0xd475('0x1c')]['fn']('IF',db['sequelize'][_0xd475('0x1e')](_0xd475('0x35')))),_0xd475('0x36')],[db[_0xd475('0x1c')]['fn']('COUNT',db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')](_0xd475('0x37')))),_0xd475('0x38')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')](_0xd475('0x39')))),_0xd475('0x3a')],[db[_0xd475('0x1c')]['fn']('COUNT',db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xd475('0x3b')))),_0xd475('0x3c')],[db[_0xd475('0x1c')]['fn']('COUNT',db[_0xd475('0x1c')]['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')](_0xd475('0x3d')))),_0xd475('0x3e')],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')]['fn']('IF',db['sequelize'][_0xd475('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xd475('0x3f')]],'group':['campaign']})['then'](function(_0x4cccd2){logger[_0xd475('0xb')](_0xd475('0x27'),_0x519c6f);logger[_0xd475('0x17')](_0xd475('0x27'),_0x519c6f,JSON[_0xd475('0xe')](_0x4cccd2));_0x8c0199(_0x4cccd2);})[_0xd475('0x18')](function(_0x5d8db5){logger[_0xd475('0xf')](_0xd475('0x27'),_0x5d8db5['message'],_0x519c6f);_0x40d5bf(_0x1f9b86['error'](0x1f4,_0x5d8db5[_0xd475('0x11')]));});});};exports[_0xd475('0x40')]=function(_0x35ef19){var _0x386e69=this;return new Promise(function(_0x200857,_0x4f9f9e){return db['CmHopperHistory']['findAll']({'raw':_0x35ef19[_0xd475('0x15')]?_0x35ef19[_0xd475('0x15')][_0xd475('0x16')]===undefined?!![]:![]:!![],'where':_0x35ef19['options']?_0x35ef19[_0xd475('0x15')]['where']||null:null,'attributes':[[_0xd475('0x29'),'name'],[db[_0xd475('0x1c')]['fn'](_0xd475('0x1b'),db[_0xd475('0x1c')][_0xd475('0x1d')]('id')),_0xd475('0x41')],[db[_0xd475('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd475('0x1c')][_0xd475('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xd475('0x42')]],'group':[_0xd475('0x29')]})[_0xd475('0xa')](function(_0x3ec219){logger['info'](_0xd475('0x40'),_0x35ef19);logger[_0xd475('0x17')]('GetCampaignHopperHistory',_0x35ef19,JSON[_0xd475('0xe')](_0x3ec219));_0x200857(_0x3ec219);})[_0xd475('0x18')](function(_0x42a6bc){logger[_0xd475('0xf')](_0xd475('0x40'),_0x42a6bc[_0xd475('0x11')],_0x35ef19);_0x4f9f9e(_0x386e69[_0xd475('0xf')](0x1f4,_0x42a6bc[_0xd475('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 34d56a9..4a86654 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 _0x117e=['isAuthenticated','describe','/:id','show','create','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','index'];(function(_0x442f11,_0x31e94f){var _0x306c90=function(_0x43a914){while(--_0x43a914){_0x442f11['push'](_0x442f11['shift']());}};_0x306c90(++_0x31e94f);}(_0x117e,0x16c));var _0xe117=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x117e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe117('0x0'));var util=require(_0xe117('0x1'));var path=require(_0xe117('0x2'));var timeout=require('connect-timeout');var express=require(_0xe117('0x3'));var router=express[_0xe117('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe117('0x5'));var interaction=require(_0xe117('0x6'));var config=require('../../config/environment');var controller=require(_0xe117('0x7'));router[_0xe117('0x8')]('/',auth['isAuthenticated'](),controller[_0xe117('0x9')]);router['get']('/describe',auth[_0xe117('0xa')](),controller[_0xe117('0xb')]);router['get'](_0xe117('0xc'),auth[_0xe117('0xa')](),controller[_0xe117('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe117('0xe')]);router[_0xe117('0xf')](_0xe117('0xc'),auth[_0xe117('0xa')](),controller[_0xe117('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5e83=['./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x332520,_0x4a396f){var _0x21b68e=function(_0xbf9390){while(--_0xbf9390){_0x332520['push'](_0x332520['shift']());}};_0x21b68e(++_0x4a396f);}(_0x5e83,0x182));var _0x35e8=function(_0x3df935,_0x2f6877){_0x3df935=_0x3df935-0x0;var _0x152412=_0x5e83[_0x3df935];return _0x152412;};'use strict';var multer=require(_0x35e8('0x0'));var util=require(_0x35e8('0x1'));var path=require(_0x35e8('0x2'));var timeout=require(_0x35e8('0x3'));var express=require(_0x35e8('0x4'));var router=express[_0x35e8('0x5')]();var fs_extra=require(_0x35e8('0x6'));var auth=require(_0x35e8('0x7'));var interaction=require(_0x35e8('0x8'));var config=require(_0x35e8('0x9'));var controller=require(_0x35e8('0xa'));router['get']('/',auth[_0x35e8('0xb')](),controller[_0x35e8('0xc')]);router[_0x35e8('0xd')](_0x35e8('0xe'),auth[_0x35e8('0xb')](),controller[_0x35e8('0xf')]);router[_0x35e8('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x35e8('0x10')]);router[_0x35e8('0x11')]('/',auth[_0x35e8('0xb')](),controller[_0x35e8('0x12')]);router[_0x35e8('0x13')](_0x35e8('0x14'),auth[_0x35e8('0xb')](),controller['update']);module[_0x35e8('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index eee6ca8..53fecbd 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 _0x4677=['STRING','name','sequelize'];(function(_0x3b80dc,_0x3b8de9){var _0x463b73=function(_0x5c2cd5){while(--_0x5c2cd5){_0x3b80dc['push'](_0x3b80dc['shift']());}};_0x463b73(++_0x3b8de9);}(_0x4677,0x155));var _0x7467=function(_0x4deb1e,_0x59999a){_0x4deb1e=_0x4deb1e-0x0;var _0x5c4e3f=_0x4677[_0x4deb1e];return _0x5c4e3f;};'use strict';var Sequelize=require(_0x7467('0x0'));module['exports']={'name':{'type':Sequelize[_0x7467('0x1')],'unique':_0x7467('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7467('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2494=['name','sequelize','STRING'];(function(_0x50c93f,_0x460a10){var _0x38e593=function(_0x111a15){while(--_0x111a15){_0x50c93f['push'](_0x50c93f['shift']());}};_0x38e593(++_0x460a10);}(_0x2494,0x82));var _0x4249=function(_0xced203,_0x5739ba){_0xced203=_0xced203-0x0;var _0x40888f=_0x2494[_0xced203];return _0x40888f;};'use strict';var Sequelize=require(_0x4249('0x0'));module['exports']={'name':{'type':Sequelize[_0x4249('0x1')],'unique':_0x4249('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4249('0x1')]},'dialPrefix':{'type':Sequelize[_0x4249('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 9166f58..df7edea 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 _0xfd4a=['redis','defaults','localhost','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','destroy','get','Lists','UserProfileResource','end','stack','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','show','params','CmList','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','CmContact','tags','isArray','join','push','omit','success','errors','message','CmCustomField','cf_%d','raw','getContactsCsv','concat','format','getContacts','isEmpty','now','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','sendStatus','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5b60b3,_0x39467d){var _0x4b8879=function(_0x54d9db){while(--_0x54d9db){_0x5b60b3['push'](_0x5b60b3['shift']());}};_0x4b8879(++_0x39467d);}(_0xfd4a,0x10a));var _0xafd4=function(_0x424cfb,_0x13b059){_0x424cfb=_0x424cfb-0x0;var _0xc12bba=_0xfd4a[_0x424cfb];return _0xc12bba;};'use strict';var emlformat=require(_0xafd4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafd4('0x1'));var jsonpatch=require(_0xafd4('0x2'));var rp=require(_0xafd4('0x3'));var moment=require('moment');var BPromise=require(_0xafd4('0x4'));var Mustache=require('mustache');var util=require(_0xafd4('0x5'));var path=require(_0xafd4('0x6'));var sox=require(_0xafd4('0x7'));var csv=require('to-csv');var ejs=require(_0xafd4('0x8'));var fs=require('fs');var fs_extra=require(_0xafd4('0x9'));var _=require(_0xafd4('0xa'));var squel=require(_0xafd4('0xb'));var crypto=require(_0xafd4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xafd4('0xd'));var toCsv=require(_0xafd4('0xe'));var querystring=require(_0xafd4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafd4('0x10'));var as=require(_0xafd4('0x11'));var hardwareService=require(_0xafd4('0x12'));var logger=require('../../config/logger')(_0xafd4('0x13'));var utils=require(_0xafd4('0x14'));var config=require(_0xafd4('0x15'));var licenseUtil=require(_0xafd4('0x16'));var db=require(_0xafd4('0x17'))['db'];config[_0xafd4('0x18')]=_[_0xafd4('0x19')](config[_0xafd4('0x18')],{'host':_0xafd4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafd4('0x18')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x5a0c1e,_0x17b1ba){_0x17b1ba=_0x17b1ba||0xcc;return function(_0x4772fe){if(_0x4772fe){return _0x5a0c1e['sendStatus'](_0x17b1ba);}return _0x5a0c1e['status'](_0x17b1ba)['end']();};}function respondWithResult(_0xf08203,_0xbff16c){_0xbff16c=_0xbff16c||0xc8;return function(_0x490067){if(_0x490067){return _0xf08203['status'](_0xbff16c)['json'](_0x490067);}};}function respondWithFilteredResult(_0x32fa53,_0x278db9){return function(_0x120dd2){if(_0x120dd2){var _0x1db03b=typeof _0x278db9[_0xafd4('0x1b')]===_0xafd4('0x1c')&&typeof _0x278db9[_0xafd4('0x1d')]===_0xafd4('0x1c');var _0x350ae6=_0x120dd2['count'];var _0x418669=_0x1db03b?0x0:_0x278db9[_0xafd4('0x1b')];var _0x19e345=_0x1db03b?_0x120dd2[_0xafd4('0x1e')]:_0x278db9[_0xafd4('0x1b')]+_0x278db9['limit'];var _0x410dff;if(_0x19e345>=_0x350ae6){_0x19e345=_0x350ae6;_0x410dff=0xc8;}else{_0x410dff=0xce;}_0x32fa53[_0xafd4('0x1f')](_0x410dff);return _0x32fa53[_0xafd4('0x20')](_0xafd4('0x21'),_0x418669+'-'+_0x19e345+'/'+_0x350ae6)[_0xafd4('0x22')](_0x120dd2);}return null;};}function patchUpdates(_0x3d36d){return function(_0x3fecf9){try{jsonpatch[_0xafd4('0x23')](_0x3fecf9,_0x3d36d,!![]);}catch(_0x241bce){return BPromise['reject'](_0x241bce);}return _0x3fecf9[_0xafd4('0x24')]();};}function saveUpdates(_0x5a2252,_0x442ce0){return function(_0x68bc14){if(_0x68bc14){return _0x68bc14[_0xafd4('0x25')](_0x5a2252)[_0xafd4('0x26')](function(_0x2819ab){return _0x2819ab;});}return null;};}function removeEntity(_0x51cf6b,_0x10280a){return function(_0x336e1f){if(_0x336e1f){return _0x336e1f[_0xafd4('0x27')]()['then'](function(){var _0x65422c=_0x336e1f[_0xafd4('0x28')]({'plain':!![]});var _0x3039f6=_0xafd4('0x29');return db[_0xafd4('0x2a')][_0xafd4('0x27')]({'where':{'type':_0x3039f6,'resourceId':_0x65422c['id']}})[_0xafd4('0x26')](function(){return _0x336e1f;});})['then'](function(){_0x51cf6b['status'](0xcc)[_0xafd4('0x2b')]();});}};}function handleEntityNotFound(_0x4752a5,_0x4de2c8){return function(_0x153e94){if(!_0x153e94){_0x4752a5['sendStatus'](0x194);}return _0x153e94;};}function handleError(_0x4a5b48,_0xdfcded){_0xdfcded=_0xdfcded||0x1f4;return function(_0x2397d3){logger['error'](_0x2397d3[_0xafd4('0x2c')]);if(_0x2397d3['name']){delete _0x2397d3['name'];}_0x4a5b48[_0xafd4('0x1f')](_0xdfcded)['send'](_0x2397d3);};}exports[_0xafd4('0x2d')]=function(_0x567f91,_0x5966de){var _0x2ddbc4={},_0x4a7168={},_0x3de5f2={'count':0x0,'rows':[]};var _0x268309=_['map'](db['CmList']['rawAttributes'],function(_0xc3eee1){return{'name':_0xc3eee1[_0xafd4('0x2e')],'type':_0xc3eee1[_0xafd4('0x2f')][_0xafd4('0x30')]};});_0x4a7168[_0xafd4('0x31')]=_[_0xafd4('0x32')](_0x268309,'name');_0x4a7168[_0xafd4('0x33')]=_[_0xafd4('0x34')](_0x567f91[_0xafd4('0x33')]);_0x4a7168[_0xafd4('0x35')]=_['intersection'](_0x4a7168[_0xafd4('0x31')],_0x4a7168[_0xafd4('0x33')]);_0x2ddbc4[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x4a7168[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x567f91[_0xafd4('0x33')][_0xafd4('0x38')]));_0x2ddbc4[_0xafd4('0x36')]=_0x2ddbc4[_0xafd4('0x36')]['length']?_0x2ddbc4[_0xafd4('0x36')]:_0x4a7168['model'];if(!_0x567f91[_0xafd4('0x33')][_0xafd4('0x39')](_0xafd4('0x3a'))){_0x2ddbc4[_0xafd4('0x1d')]=qs['limit'](_0x567f91[_0xafd4('0x33')]['limit']);_0x2ddbc4['offset']=qs['offset'](_0x567f91[_0xafd4('0x33')][_0xafd4('0x1b')]);}_0x2ddbc4[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x567f91[_0xafd4('0x33')][_0xafd4('0x3c')]);_0x2ddbc4['where']=qs[_0xafd4('0x35')](_['pick'](_0x567f91[_0xafd4('0x33')],_0x4a7168['filters']),_0x268309);if(_0x567f91[_0xafd4('0x33')][_0xafd4('0x3d')]){_0x2ddbc4['where']=_['merge'](_0x2ddbc4[_0xafd4('0x3e')],{'$or':_[_0xafd4('0x32')](_0x268309,function(_0x1b828e){if(_0x1b828e['type']!==_0xafd4('0x3f')){var _0x5dcab5={};_0x5dcab5[_0x1b828e[_0xafd4('0x40')]]={'$like':'%'+_0x567f91[_0xafd4('0x33')][_0xafd4('0x3d')]+'%'};return _0x5dcab5;}})});}_0x2ddbc4=_[_0xafd4('0x41')]({},_0x2ddbc4,_0x567f91[_0xafd4('0x42')]);var _0x17d127={'where':_0x2ddbc4['where']};return db['CmList'][_0xafd4('0x1e')](_0x17d127)[_0xafd4('0x26')](function(_0x6cd381){_0x3de5f2[_0xafd4('0x1e')]=_0x6cd381;if(_0x567f91[_0xafd4('0x33')][_0xafd4('0x43')]){_0x2ddbc4[_0xafd4('0x44')]=[{'all':!![]}];}return db['CmList'][_0xafd4('0x45')](_0x2ddbc4);})[_0xafd4('0x26')](function(_0x1c4565){_0x3de5f2[_0xafd4('0x46')]=_0x1c4565;return _0x3de5f2;})[_0xafd4('0x26')](respondWithFilteredResult(_0x5966de,_0x2ddbc4))[_0xafd4('0x47')](handleError(_0x5966de,null));};exports[_0xafd4('0x48')]=function(_0x429722,_0xcfe58d){var _0x31dc41={'raw':![],'where':{'id':_0x429722[_0xafd4('0x49')]['id']}},_0x2d63fb={};_0x2d63fb[_0xafd4('0x31')]=_[_0xafd4('0x34')](db[_0xafd4('0x4a')][_0xafd4('0x4b')]);_0x2d63fb[_0xafd4('0x33')]=_[_0xafd4('0x34')](_0x429722['query']);_0x2d63fb[_0xafd4('0x35')]=_[_0xafd4('0x37')](_0x2d63fb[_0xafd4('0x31')],_0x2d63fb[_0xafd4('0x33')]);_0x31dc41[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x2d63fb[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x429722[_0xafd4('0x33')][_0xafd4('0x38')]));_0x31dc41[_0xafd4('0x36')]=_0x31dc41[_0xafd4('0x36')][_0xafd4('0x4c')]?_0x31dc41[_0xafd4('0x36')]:_0x2d63fb[_0xafd4('0x31')];if(_0x429722[_0xafd4('0x33')][_0xafd4('0x43')]){_0x31dc41[_0xafd4('0x44')]=[{'all':!![]}];}_0x31dc41=_[_0xafd4('0x41')]({},_0x31dc41,_0x429722[_0xafd4('0x42')]);return db[_0xafd4('0x4a')][_0xafd4('0x4d')](_0x31dc41)[_0xafd4('0x26')](handleEntityNotFound(_0xcfe58d,null))['then'](respondWithResult(_0xcfe58d,null))['catch'](handleError(_0xcfe58d,null));};exports[_0xafd4('0x4e')]=function(_0x3d4ea8,_0x23e0c7){return db[_0xafd4('0x4a')][_0xafd4('0x4e')](_0x3d4ea8[_0xafd4('0x4f')],{})[_0xafd4('0x26')](function(_0x3937dc){var _0x4e8722=_0x3d4ea8[_0xafd4('0x50')][_0xafd4('0x28')]({'plain':!![]});if(!_0x4e8722)throw new Error(_0xafd4('0x51'));if(_0x4e8722[_0xafd4('0x52')]===_0xafd4('0x50')){var _0x22ab5d=_0x3937dc['get']({'plain':!![]});var _0x80d264=_0xafd4('0x29');return db[_0xafd4('0x53')][_0xafd4('0x4d')]({'where':{'name':_0x80d264,'userProfileId':_0x4e8722[_0xafd4('0x54')]},'raw':!![]})[_0xafd4('0x26')](function(_0x30bdad){if(_0x30bdad&&_0x30bdad[_0xafd4('0x55')]===0x0){return db[_0xafd4('0x2a')][_0xafd4('0x4e')]({'name':_0x22ab5d[_0xafd4('0x40')],'resourceId':_0x22ab5d['id'],'type':_0x30bdad[_0xafd4('0x40')],'sectionId':_0x30bdad['id']},{})[_0xafd4('0x26')](function(){return _0x3937dc;});}else{return _0x3937dc;}})[_0xafd4('0x47')](function(_0x1f21e1){logger[_0xafd4('0x56')](_0xafd4('0x57'),_0x1f21e1);throw _0x1f21e1;});}return _0x3937dc;})['then'](respondWithResult(_0x23e0c7,0xc9))[_0xafd4('0x47')](handleError(_0x23e0c7,null));};exports[_0xafd4('0x25')]=function(_0x5b531a,_0x200d99){if(_0x5b531a[_0xafd4('0x4f')]['id']){delete _0x5b531a[_0xafd4('0x4f')]['id'];}return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x5b531a[_0xafd4('0x49')]['id']}})['then'](handleEntityNotFound(_0x200d99,null))[_0xafd4('0x26')](saveUpdates(_0x5b531a['body'],null))[_0xafd4('0x26')](respondWithResult(_0x200d99,null))[_0xafd4('0x47')](handleError(_0x200d99,null));};exports[_0xafd4('0x27')]=function(_0x591e68,_0x315ad){return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x591e68['params']['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x315ad,null))[_0xafd4('0x26')](removeEntity(_0x315ad,null))[_0xafd4('0x47')](handleError(_0x315ad,null));};exports[_0xafd4('0x58')]=function(_0x104219,_0x1075a5){return db['CmList']['describe']()[_0xafd4('0x26')](respondWithResult(_0x1075a5,null))[_0xafd4('0x47')](handleError(_0x1075a5,null));};exports[_0xafd4('0x59')]=function(_0x3fd91f,_0x21929d,_0x1c2d31){if(_0x3fd91f['body']['id']){delete _0x3fd91f['body']['id'];}return db['CmList']['find']({'where':{'id':_0x3fd91f[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x21929d,null))[_0xafd4('0x26')](function(_0x488291){if(_0x488291){_0x3fd91f[_0xafd4('0x4f')][_0xafd4('0x5a')]=_0x488291['id'];return db[_0xafd4('0x5b')][_0xafd4('0x4e')](_0x3fd91f[_0xafd4('0x4f')]);}})['then'](respondWithResult(_0x21929d,null))[_0xafd4('0x47')](handleError(_0x21929d,null));};exports[_0xafd4('0x5c')]=function(_0x8797b9,_0x154462,_0x5f59ce){var _0x5f3dda={'raw':![],'where':{}};var _0x65bb70={};var _0x2c0378={'count':0x0,'rows':[]};return db[_0xafd4('0x4a')][_0xafd4('0x5d')]({'where':{'id':_0x8797b9[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x154462,null))['then'](function(_0x5e09db){if(_0x5e09db){_0x65bb70[_0xafd4('0x31')]=_['keys'](db[_0xafd4('0x5b')][_0xafd4('0x4b')]);_0x65bb70[_0xafd4('0x33')]=_['keys'](_0x8797b9['query']);_0x65bb70[_0xafd4('0x35')]=_[_0xafd4('0x37')](_0x65bb70[_0xafd4('0x31')],_0x65bb70[_0xafd4('0x33')]);_0x5f3dda[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x65bb70[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x8797b9[_0xafd4('0x33')][_0xafd4('0x38')]));_0x5f3dda[_0xafd4('0x36')]=_0x5f3dda[_0xafd4('0x36')]['length']?_0x5f3dda['attributes']:_0x65bb70[_0xafd4('0x31')];if(!_0x8797b9[_0xafd4('0x33')][_0xafd4('0x39')](_0xafd4('0x3a'))){_0x5f3dda['limit']=qs[_0xafd4('0x1d')](_0x8797b9[_0xafd4('0x33')][_0xafd4('0x1d')]);_0x5f3dda[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x8797b9[_0xafd4('0x33')]['offset']);}_0x5f3dda['order']=qs['sort'](_0x8797b9['query'][_0xafd4('0x3c')]);_0x5f3dda['where']=qs[_0xafd4('0x35')](_[_0xafd4('0x5e')](_0x8797b9[_0xafd4('0x33')],_0x65bb70[_0xafd4('0x35')]));_0x5f3dda[_0xafd4('0x3e')]['ListId']=_0x5e09db['id'];if(_0x8797b9[_0xafd4('0x33')][_0xafd4('0x3d')]){_0x5f3dda[_0xafd4('0x3e')]=_[_0xafd4('0x41')](_0x5f3dda['where'],{'$or':_[_0xafd4('0x32')](_0x5f3dda[_0xafd4('0x36')],function(_0x1a1b9e){var _0x3d67bb={};_0x3d67bb[_0x1a1b9e]={'$like':'%'+_0x8797b9[_0xafd4('0x33')]['filter']+'%'};return _0x3d67bb;})});}_0x5f3dda=_[_0xafd4('0x41')]({},_0x5f3dda,_0x8797b9[_0xafd4('0x42')]);return db[_0xafd4('0x5b')][_0xafd4('0x1e')]({'where':_0x5f3dda['where']})[_0xafd4('0x26')](function(_0x6eff1f){_0x2c0378[_0xafd4('0x1e')]=_0x6eff1f;if(_0x8797b9[_0xafd4('0x33')][_0xafd4('0x43')]){_0x5f3dda[_0xafd4('0x44')]=[{'all':!![]}];}return db[_0xafd4('0x5b')]['findAll'](_0x5f3dda);})[_0xafd4('0x26')](function(_0x3ff965){_0x2c0378[_0xafd4('0x46')]=_0x3ff965;return _0x2c0378;});}})[_0xafd4('0x26')](respondWithFilteredResult(_0x154462,_0x5f3dda))[_0xafd4('0x47')](handleError(_0x154462,null));};exports[_0xafd4('0x5f')]=function(_0x419adf,_0x239755,_0x1d965c){return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x419adf[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x239755,null))['then'](function(_0x3ac923){if(_0x3ac923){return _0x3ac923[_0xafd4('0x5f')](_0x419adf[_0xafd4('0x33')][_0xafd4('0x60')]);}})[_0xafd4('0x26')](respondWithStatusCode(_0x239755,null))[_0xafd4('0x47')](handleError(_0x239755,null));};exports['addContacts']=function(_0x34e376,_0x570aa7,_0x58ec78){return db['CmList']['find']({'where':{'id':_0x34e376[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x570aa7,null))[_0xafd4('0x26')](function(_0x4dedff){if(_0x4dedff){var _0xdfb9ae=[];var _0x18c6a6={'success':[],'errors':[]};return db[_0xafd4('0x61')][_0xafd4('0x58')]()[_0xafd4('0x26')](function(_0x25988f){if(_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')]&&_[_0xafd4('0x63')](_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')])){if(_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')][_0xafd4('0x4c')]){_0x34e376[_0xafd4('0x4f')]['tags']=_0x34e376['body']['tags'][_0xafd4('0x64')](';')+';';}else{_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')]=null;}}else{_0x34e376['body'][_0xafd4('0x62')]=null;}if(_0x34e376['body']&&_['isArray'](_0x34e376['body'])){for(var _0x499024=0x0;_0x499024<_0x34e376[_0xafd4('0x4f')][_0xafd4('0x4c')];_0x499024+=0x1){_0x34e376[_0xafd4('0x4f')][_0x499024][_0xafd4('0x5a')]=_0x34e376['params']['id'];_0xdfb9ae[_0xafd4('0x65')](_0x34e376['body'][_0x499024]);}return BPromise['each'](_0xdfb9ae,function(_0x4b7b09){return db[_0xafd4('0x61')][_0xafd4('0x4e')](_[_0xafd4('0x66')](_0x4b7b09,['ids','id'])||{},{'fields':_[_0xafd4('0x34')](_0x25988f),'raw':!![]})[_0xafd4('0x26')](function(_0x269933){_0x18c6a6[_0xafd4('0x67')][_0xafd4('0x65')](_0x269933['dataValues']);})['catch'](function(_0x20b16a){_0x18c6a6[_0xafd4('0x68')][_0xafd4('0x65')]({'data':_0x4b7b09,'error':_0x20b16a[_0xafd4('0x69')]});});})[_0xafd4('0x26')](function(_0x1dfa3e){return _0x18c6a6;})[_0xafd4('0x47')](function(_0x539f8d){return _0x539f8d;});}else{_0x570aa7[_0xafd4('0x1f')](0x190)[_0xafd4('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xafd4('0x26')](respondWithResult(_0x570aa7,null))[_0xafd4('0x47')](handleError(_0x570aa7,null));};exports['getContacts']=function(_0x51cb82,_0x16f1ca,_0x4d16b3){var _0x585020;return db['CmList']['find']({'where':{'id':_0x51cb82['params']['id']},'include':[{'model':db[_0xafd4('0x6a')],'as':'CustomFields'}]})[_0xafd4('0x26')](handleEntityNotFound(_0x16f1ca,null))[_0xafd4('0x26')](function(_0x484ae7){if(_0x484ae7){_0x585020=_0x484ae7;return db[_0xafd4('0x61')]['rawAttributes'];}})[_0xafd4('0x26')](function(_0x5a624f){if(_0x5a624f){var _0x3be0e3={};var _0x3a1871={};_0x3a1871[_0xafd4('0x31')]=_['concat'](_[_0xafd4('0x34')](_0x5a624f),_[_0xafd4('0x32')](_0x585020['CustomFields'],function(_0x29ff6f){return util['format'](_0xafd4('0x6b'),_0x29ff6f['id']);}));_0x3a1871[_0xafd4('0x33')]=_[_0xafd4('0x34')](_0x51cb82[_0xafd4('0x33')]);_0x3a1871[_0xafd4('0x35')]=_[_0xafd4('0x37')](_0x3a1871['model'],_0x3a1871[_0xafd4('0x33')]);_0x3be0e3[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x3a1871[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x51cb82[_0xafd4('0x33')][_0xafd4('0x38')]));_0x3be0e3[_0xafd4('0x36')]=_0x3be0e3[_0xafd4('0x36')]['length']?_0x3be0e3['attributes']:_0x3a1871['model'];if(!_0x51cb82[_0xafd4('0x33')][_0xafd4('0x39')]('nolimit')){_0x3be0e3['limit']=qs['limit'](_0x51cb82['query'][_0xafd4('0x1d')]);_0x3be0e3[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x51cb82[_0xafd4('0x33')][_0xafd4('0x1b')]);}_0x3be0e3[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x51cb82[_0xafd4('0x33')][_0xafd4('0x3c')]);_0x3be0e3[_0xafd4('0x3e')]=qs[_0xafd4('0x35')](_[_0xafd4('0x5e')](_0x51cb82[_0xafd4('0x33')],_0x3a1871[_0xafd4('0x35')]));_0x3be0e3[_0xafd4('0x6c')]=!![];if(_0x51cb82['query'][_0xafd4('0x3d')]){_0x3be0e3[_0xafd4('0x3e')]=_['merge'](_0x3be0e3[_0xafd4('0x3e')],{'$or':_['map'](_0x3be0e3['attributes'],function(_0x29e2f9){var _0x49053b={};_0x49053b[_0x29e2f9]={'$like':'%'+_0x51cb82[_0xafd4('0x33')][_0xafd4('0x3d')]+'%'};return _0x49053b;})});}_0x3be0e3=_['merge']({},_0x3be0e3,_0x51cb82[_0xafd4('0x42')]);return _0x585020['getContacts'](_0x3be0e3);}})['then'](respondWithResult(_0x16f1ca,null))[_0xafd4('0x47')](handleError(_0x16f1ca,null));};exports[_0xafd4('0x6d')]=function(_0x419446,_0x492cbb,_0x1b4e40){var _0x270da9;return db[_0xafd4('0x4a')]['find']({'where':{'id':_0x419446['params']['id']},'include':[{'model':db[_0xafd4('0x6a')],'as':'CustomFields'}]})[_0xafd4('0x26')](handleEntityNotFound(_0x492cbb,null))['then'](function(_0x1bdcd7){if(_0x1bdcd7){_0x270da9=_0x1bdcd7;return db[_0xafd4('0x61')]['rawAttributes'];}})['then'](function(_0x2f995d){if(_0x2f995d){var _0x49efa3={};var _0x2dc84d={};_0x2dc84d['model']=_[_0xafd4('0x6e')](_[_0xafd4('0x34')](_0x2f995d),_[_0xafd4('0x32')](_0x270da9['CustomFields'],function(_0x213527){return util[_0xafd4('0x6f')](_0xafd4('0x6b'),_0x213527['id']);}));_0x2dc84d['query']=_[_0xafd4('0x34')](_0x419446['query']);_0x2dc84d[_0xafd4('0x35')]=_['intersection'](_0x2dc84d[_0xafd4('0x31')],_0x2dc84d[_0xafd4('0x33')]);_0x49efa3[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x2dc84d[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x419446[_0xafd4('0x33')][_0xafd4('0x38')]));_0x49efa3[_0xafd4('0x36')]=_0x49efa3[_0xafd4('0x36')][_0xafd4('0x4c')]?_0x49efa3['attributes']:_0x2dc84d[_0xafd4('0x31')];if(!_0x419446['query']['hasOwnProperty'](_0xafd4('0x3a'))){_0x49efa3[_0xafd4('0x1d')]=qs[_0xafd4('0x1d')](_0x419446['query'][_0xafd4('0x1d')]);_0x49efa3[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x419446[_0xafd4('0x33')][_0xafd4('0x1b')]);}_0x49efa3[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x419446['query'][_0xafd4('0x3c')]);_0x49efa3[_0xafd4('0x3e')]=qs['filters'](_[_0xafd4('0x5e')](_0x419446['query'],_0x2dc84d[_0xafd4('0x35')]));_0x49efa3[_0xafd4('0x6c')]=!![];if(_0x419446[_0xafd4('0x33')]['filter']){_0x49efa3[_0xafd4('0x3e')]=_[_0xafd4('0x41')](_0x49efa3[_0xafd4('0x3e')],{'$or':_['map'](_0x49efa3['attributes'],function(_0x2b338){var _0x53ddf5={};_0x53ddf5[_0x2b338]={'$like':'%'+_0x419446['query'][_0xafd4('0x3d')]+'%'};return _0x53ddf5;})});}_0x49efa3=_[_0xafd4('0x41')]({},_0x49efa3,_0x419446[_0xafd4('0x42')]);return _0x270da9[_0xafd4('0x70')](_0x49efa3);}})[_0xafd4('0x26')](function(_0x195e96){if(!_[_0xafd4('0x71')](_0x195e96)){var _0x372f43=toCsv(_0x195e96);var _0x35a793=Date[_0xafd4('0x72')]();fs['writeFileSync'](util[_0xafd4('0x6f')](_0xafd4('0x73'),_0x270da9['id'],_0x35a793),_0x372f43);_0x492cbb['setHeader'](_0xafd4('0x74'),_0xafd4('0x75')+util[_0xafd4('0x6f')](_0xafd4('0x76'),_0x270da9['id'],_0x35a793));_0x492cbb['setHeader'](_0xafd4('0x77'),_0xafd4('0x78'));return _0x492cbb['download'](util[_0xafd4('0x6f')](_0xafd4('0x73'),_0x270da9['id'],_0x35a793));}else{return _0x492cbb[_0xafd4('0x79')](0xcc);}})[_0xafd4('0x47')](handleError(_0x492cbb,null));};exports['addCustomField']=function(_0x401e71,_0x4134ba,_0xd5cf24){var _0x3c5e63;delete _0x401e71[_0xafd4('0x4f')]['id'];return db['CmList'][_0xafd4('0x5d')]({'where':{'id':_0x401e71[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x4134ba,null))['then'](function(_0x5e9baf){if(_0x5e9baf){return db[_0xafd4('0x7a')][_0xafd4('0x7b')](function(_0x1b74f9){return db['CmCustomField'][_0xafd4('0x4e')](_0x401e71[_0xafd4('0x4f')],{'transaction':_0x1b74f9})[_0xafd4('0x26')](function(_0x44e9f4){_0x3c5e63=_0x44e9f4;return _0x5e9baf[_0xafd4('0x7c')](_0x44e9f4,{'transaction':_0x1b74f9});})['then'](function(){var _0x475bfe={'type':db[_0xafd4('0x7d')]['TEXT'],'transaction':_0x1b74f9};switch(_0x401e71[_0xafd4('0x4f')]['type']){case _0xafd4('0x7e'):_0x475bfe[_0xafd4('0x2f')]=db[_0xafd4('0x7d')][_0xafd4('0x7f')];break;case _0xafd4('0x80'):_0x475bfe['type']=db[_0xafd4('0x7d')][_0xafd4('0x81')];break;case _0xafd4('0x82'):_0x475bfe[_0xafd4('0x2f')]=db['Sequelize']['BOOLEAN'];_0x475bfe[_0xafd4('0x83')]=![];break;default:}return db['sequelize'][_0xafd4('0x84')][_0xafd4('0x85')](_0xafd4('0x86'),util['format']('cf_%s',_0x3c5e63['id']),_0x475bfe);})[_0xafd4('0x26')](function(){return _0x3c5e63;});});}})[_0xafd4('0x26')](respondWithResult(_0x4134ba,null))['catch'](handleError(_0x4134ba,null));};exports[_0xafd4('0x87')]=function(_0x1f3ae2,_0x12bb8c,_0x5ccf7b){var _0x1c0164={};var _0x2dfa51={};var _0x4cd71d;var _0x42365f;return db[_0xafd4('0x4a')]['findOne']({'where':{'id':_0x1f3ae2[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x12bb8c,null))['then'](function(_0x57b739){if(_0x57b739){_0x4cd71d=_0x57b739;_0x2dfa51['model']=_[_0xafd4('0x34')](db[_0xafd4('0x6a')][_0xafd4('0x4b')]);_0x2dfa51[_0xafd4('0x33')]=_['keys'](_0x1f3ae2[_0xafd4('0x33')]);_0x2dfa51[_0xafd4('0x35')]=_['intersection'](_0x2dfa51['model'],_0x2dfa51[_0xafd4('0x33')]);_0x1c0164[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x2dfa51[_0xafd4('0x31')],qs['fields'](_0x1f3ae2[_0xafd4('0x33')][_0xafd4('0x38')]));_0x1c0164['attributes']=_0x1c0164['attributes'][_0xafd4('0x4c')]?_0x1c0164[_0xafd4('0x36')]:_0x2dfa51['model'];_0x1c0164[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x1f3ae2[_0xafd4('0x33')]['sort']);_0x1c0164['where']=qs[_0xafd4('0x35')](_[_0xafd4('0x5e')](_0x1f3ae2['query'],_0x2dfa51['filters']));_0x1c0164[_0xafd4('0x3e')]=_['merge'](_0x1c0164[_0xafd4('0x3e')],{'$or':[{'ListId':_0x57b739['id']},{'ListId':null}]});if(_0x1f3ae2[_0xafd4('0x33')][_0xafd4('0x3d')]){_0x1c0164['where']=_['merge'](_0x1c0164['where'],{'$or':_[_0xafd4('0x32')](_0x1c0164['attributes'],function(_0x1cb39d){var _0x5834af={};_0x5834af[_0x1cb39d]={'$like':'%'+_0x1f3ae2['query'][_0xafd4('0x3d')]+'%'};return _0x5834af;})});}_0x1c0164=_[_0xafd4('0x41')]({},_0x1c0164,_0x1f3ae2[_0xafd4('0x42')]);return db[_0xafd4('0x6a')][_0xafd4('0x88')](_0x1c0164);}})[_0xafd4('0x26')](respondWithResult(_0x12bb8c,null))[_0xafd4('0x47')](handleError(_0x12bb8c,null));};exports[_0xafd4('0x89')]=function(_0x721c22,_0x18eae4,_0x1f7ded){return db['CmList'][_0xafd4('0x4d')]({'where':{'id':_0x721c22[_0xafd4('0x49')]['id']}})['then'](handleEntityNotFound(_0x18eae4,null))[_0xafd4('0x26')](function(_0x184617){if(_0x184617){return _0x184617[_0xafd4('0x89')](_0x721c22[_0xafd4('0x4f')][_0xafd4('0x60')],_[_0xafd4('0x66')](_0x721c22['body'],[_0xafd4('0x60'),'id'])||{})[_0xafd4('0x8a')](function(_0x34eca0){for(var _0xe6964=0x0;_0xe6964<_0x721c22[_0xafd4('0x4f')][_0xafd4('0x60')][_0xafd4('0x4c')];_0xe6964+=0x1){socket['emit'](_0xafd4('0x8b'),{'UserId':_0x721c22[_0xafd4('0x4f')][_0xafd4('0x60')][_0xe6964],'CmListId':_0x721c22[_0xafd4('0x49')]['id']});}return _0x34eca0;});}})[_0xafd4('0x26')](respondWithResult(_0x18eae4,null))[_0xafd4('0x47')](handleError(_0x18eae4,null));};exports[_0xafd4('0x8c')]=function(_0x575621,_0x418210,_0x2b8eb0){return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x575621[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x418210,null))['then'](function(_0xdd371b){if(_0xdd371b){return _0xdd371b['removeAgents'](_0x575621['query'][_0xafd4('0x60')])[_0xafd4('0x26')](function(){if(_[_0xafd4('0x63')](_0x575621[_0xafd4('0x33')]['ids'])){for(var _0x1f7293=0x0;_0x1f7293<_0x575621['query']['ids'][_0xafd4('0x4c')];_0x1f7293+=0x1){socket[_0xafd4('0x8d')]('userCmList:remove',{'UserId':Number(_0x575621[_0xafd4('0x33')]['ids'][_0x1f7293]),'CmListId':Number(_0x575621[_0xafd4('0x49')]['id'])});}}else{socket['emit'](_0xafd4('0x8e'),{'UserId':Number(_0x575621[_0xafd4('0x33')][_0xafd4('0x60')]),'CmListId':Number(_0x575621[_0xafd4('0x49')]['id'])});}});}})[_0xafd4('0x26')](respondWithStatusCode(_0x418210,null))[_0xafd4('0x47')](handleError(_0x418210,null));};exports[_0xafd4('0x8f')]=function(_0x543b22,_0x465fcc,_0x5579e9){var _0x4daf5e={};var _0x379a58={};var _0x23c180;var _0x16fd3f;return db[_0xafd4('0x4a')][_0xafd4('0x5d')]({'where':{'id':_0x543b22[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x465fcc,null))[_0xafd4('0x26')](function(_0x5abde3){if(_0x5abde3){_0x23c180=_0x5abde3;_0x379a58['model']=_[_0xafd4('0x34')](db[_0xafd4('0x90')][_0xafd4('0x4b')]);_0x379a58['query']=_[_0xafd4('0x34')](_0x543b22[_0xafd4('0x33')]);_0x379a58['filters']=_[_0xafd4('0x37')](_0x379a58[_0xafd4('0x31')],_0x379a58[_0xafd4('0x33')]);_0x4daf5e[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x379a58[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x543b22[_0xafd4('0x33')][_0xafd4('0x38')]));_0x4daf5e['attributes']=_0x4daf5e['attributes']['length']?_0x4daf5e['attributes']:_0x379a58[_0xafd4('0x31')];_0x4daf5e[_0xafd4('0x3b')]=qs['sort'](_0x543b22[_0xafd4('0x33')][_0xafd4('0x3c')]);_0x4daf5e[_0xafd4('0x3e')]=qs['filters'](_[_0xafd4('0x5e')](_0x543b22[_0xafd4('0x33')],_0x379a58[_0xafd4('0x35')]));if(_0x543b22[_0xafd4('0x33')]['filter']){_0x4daf5e[_0xafd4('0x3e')]=_[_0xafd4('0x41')](_0x4daf5e[_0xafd4('0x3e')],{'$or':_[_0xafd4('0x32')](_0x4daf5e[_0xafd4('0x36')],function(_0x3de684){var _0x20bb6a={};_0x20bb6a[_0x3de684]={'$like':'%'+_0x543b22[_0xafd4('0x33')][_0xafd4('0x3d')]+'%'};return _0x20bb6a;})});}_0x4daf5e=_[_0xafd4('0x41')]({},_0x4daf5e,_0x543b22[_0xafd4('0x42')]);return _0x23c180[_0xafd4('0x8f')](_0x4daf5e);}})['then'](function(_0xc9d632){if(_0xc9d632){_0x16fd3f=_0xc9d632[_0xafd4('0x4c')];if(!_0x543b22[_0xafd4('0x33')][_0xafd4('0x39')](_0xafd4('0x3a'))){_0x4daf5e[_0xafd4('0x1d')]=qs[_0xafd4('0x1d')](_0x543b22[_0xafd4('0x33')][_0xafd4('0x1d')]);_0x4daf5e[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x543b22['query'][_0xafd4('0x1b')]);}return _0x23c180['getAgents'](_0x4daf5e);}})['then'](function(_0x1f9915){if(_0x1f9915){return _0x1f9915?{'count':_0x16fd3f,'rows':_0x1f9915}:null;}})[_0xafd4('0x26')](respondWithResult(_0x465fcc,null))['catch'](handleError(_0x465fcc,null));}; \ No newline at end of file +var _0x6fd1=['describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','order','merge','removeDispositions','ids','addContacts','tags','isArray','push','each','omit','success','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','CmContact','hasOwnProperty','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','addCustomField','sequelize','transaction','Sequelize','text','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','addAgents','spread','emit','getAgents','User','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Lists','UserProfileResource','error','stack','name','send','CmList','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','nolimit','sort','filters','pick','where','VIRTUAL','filter','options','include','findAll','rows','intersection','includeAll','find','catch','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x5a529d,_0x43231c){var _0x345432=function(_0xff55eb){while(--_0xff55eb){_0x5a529d['push'](_0x5a529d['shift']());}};_0x345432(++_0x43231c);}(_0x6fd1,0x14b));var _0x16fd=function(_0x49968e,_0x4cdd80){_0x49968e=_0x49968e-0x0;var _0x225140=_0x6fd1[_0x49968e];return _0x225140;};'use strict';var emlformat=require(_0x16fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16fd('0x1'));var jsonpatch=require(_0x16fd('0x2'));var rp=require('request-promise');var moment=require(_0x16fd('0x3'));var BPromise=require(_0x16fd('0x4'));var Mustache=require(_0x16fd('0x5'));var util=require('util');var path=require(_0x16fd('0x6'));var sox=require(_0x16fd('0x7'));var csv=require(_0x16fd('0x8'));var ejs=require(_0x16fd('0x9'));var fs=require('fs');var fs_extra=require(_0x16fd('0xa'));var _=require(_0x16fd('0xb'));var squel=require(_0x16fd('0xc'));var crypto=require(_0x16fd('0xd'));var jsforce=require(_0x16fd('0xe'));var deskjs=require(_0x16fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x16fd('0x10'));var Papa=require(_0x16fd('0x11'));var Redis=require('ioredis');var authService=require(_0x16fd('0x12'));var qs=require(_0x16fd('0x13'));var as=require(_0x16fd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16fd('0x15'))(_0x16fd('0x16'));var utils=require(_0x16fd('0x17'));var config=require(_0x16fd('0x18'));var licenseUtil=require(_0x16fd('0x19'));var db=require(_0x16fd('0x1a'))['db'];config['redis']=_[_0x16fd('0x1b')](config[_0x16fd('0x1c')],{'host':_0x16fd('0x1d'),'port':0x18eb});var socket=require(_0x16fd('0x1e'))(new Redis(config['redis']));require(_0x16fd('0x1f'))['register'](socket);function respondWithStatusCode(_0x2648f3,_0x74853){_0x74853=_0x74853||0xcc;return function(_0x15b2ab){if(_0x15b2ab){return _0x2648f3[_0x16fd('0x20')](_0x74853);}return _0x2648f3[_0x16fd('0x21')](_0x74853)[_0x16fd('0x22')]();};}function respondWithResult(_0x5e303b,_0x2a0feb){_0x2a0feb=_0x2a0feb||0xc8;return function(_0x579900){if(_0x579900){return _0x5e303b['status'](_0x2a0feb)[_0x16fd('0x23')](_0x579900);}};}function respondWithFilteredResult(_0x54cab7,_0x59cd1){return function(_0x12c4a8){if(_0x12c4a8){var _0x3dbf2a=typeof _0x59cd1[_0x16fd('0x24')]===_0x16fd('0x25')&&typeof _0x59cd1[_0x16fd('0x26')]===_0x16fd('0x25');var _0x21300f=_0x12c4a8['count'];var _0x3da761=_0x3dbf2a?0x0:_0x59cd1[_0x16fd('0x24')];var _0x14a541=_0x3dbf2a?_0x12c4a8[_0x16fd('0x27')]:_0x59cd1[_0x16fd('0x24')]+_0x59cd1[_0x16fd('0x26')];var _0x28b16e;if(_0x14a541>=_0x21300f){_0x14a541=_0x21300f;_0x28b16e=0xc8;}else{_0x28b16e=0xce;}_0x54cab7[_0x16fd('0x21')](_0x28b16e);return _0x54cab7[_0x16fd('0x28')](_0x16fd('0x29'),_0x3da761+'-'+_0x14a541+'/'+_0x21300f)[_0x16fd('0x23')](_0x12c4a8);}return null;};}function patchUpdates(_0x52f77e){return function(_0x374ef5){try{jsonpatch[_0x16fd('0x2a')](_0x374ef5,_0x52f77e,!![]);}catch(_0x576c82){return BPromise[_0x16fd('0x2b')](_0x576c82);}return _0x374ef5['save']();};}function saveUpdates(_0x2f602d,_0x5e51c3){return function(_0x1a37f0){if(_0x1a37f0){return _0x1a37f0[_0x16fd('0x2c')](_0x2f602d)['then'](function(_0xd30049){return _0xd30049;});}return null;};}function removeEntity(_0x5d7682,_0x5ac90b){return function(_0x1c96a7){if(_0x1c96a7){return _0x1c96a7[_0x16fd('0x2d')]()[_0x16fd('0x2e')](function(){var _0x197188=_0x1c96a7[_0x16fd('0x2f')]({'plain':!![]});var _0x1724e2=_0x16fd('0x30');return db[_0x16fd('0x31')][_0x16fd('0x2d')]({'where':{'type':_0x1724e2,'resourceId':_0x197188['id']}})[_0x16fd('0x2e')](function(){return _0x1c96a7;});})[_0x16fd('0x2e')](function(){_0x5d7682[_0x16fd('0x21')](0xcc)[_0x16fd('0x22')]();});}};}function handleEntityNotFound(_0x60f426,_0x19fee6){return function(_0x2557eb){if(!_0x2557eb){_0x60f426[_0x16fd('0x20')](0x194);}return _0x2557eb;};}function handleError(_0x1854f4,_0x56c459){_0x56c459=_0x56c459||0x1f4;return function(_0x59e806){logger[_0x16fd('0x32')](_0x59e806[_0x16fd('0x33')]);if(_0x59e806[_0x16fd('0x34')]){delete _0x59e806[_0x16fd('0x34')];}_0x1854f4['status'](_0x56c459)[_0x16fd('0x35')](_0x59e806);};}exports['index']=function(_0xb35c4d,_0x5ebd8e){var _0x3abc49={},_0x464a92={},_0x39bb9b={'count':0x0,'rows':[]};var _0x5bfe46=_['map'](db[_0x16fd('0x36')][_0x16fd('0x37')],function(_0x30eda9){return{'name':_0x30eda9[_0x16fd('0x38')],'type':_0x30eda9[_0x16fd('0x39')]['key']};});_0x464a92[_0x16fd('0x3a')]=_[_0x16fd('0x3b')](_0x5bfe46,'name');_0x464a92[_0x16fd('0x3c')]=_[_0x16fd('0x3d')](_0xb35c4d[_0x16fd('0x3c')]);_0x464a92['filters']=_['intersection'](_0x464a92['model'],_0x464a92[_0x16fd('0x3c')]);_0x3abc49[_0x16fd('0x3e')]=_['intersection'](_0x464a92[_0x16fd('0x3a')],qs[_0x16fd('0x3f')](_0xb35c4d[_0x16fd('0x3c')]['fields']));_0x3abc49[_0x16fd('0x3e')]=_0x3abc49['attributes']['length']?_0x3abc49[_0x16fd('0x3e')]:_0x464a92[_0x16fd('0x3a')];if(!_0xb35c4d[_0x16fd('0x3c')]['hasOwnProperty'](_0x16fd('0x40'))){_0x3abc49[_0x16fd('0x26')]=qs[_0x16fd('0x26')](_0xb35c4d[_0x16fd('0x3c')][_0x16fd('0x26')]);_0x3abc49[_0x16fd('0x24')]=qs[_0x16fd('0x24')](_0xb35c4d['query'][_0x16fd('0x24')]);}_0x3abc49['order']=qs[_0x16fd('0x41')](_0xb35c4d[_0x16fd('0x3c')][_0x16fd('0x41')]);_0x3abc49['where']=qs[_0x16fd('0x42')](_[_0x16fd('0x43')](_0xb35c4d[_0x16fd('0x3c')],_0x464a92['filters']),_0x5bfe46);if(_0xb35c4d[_0x16fd('0x3c')]['filter']){_0x3abc49[_0x16fd('0x44')]=_['merge'](_0x3abc49['where'],{'$or':_['map'](_0x5bfe46,function(_0x41c0c0){if(_0x41c0c0[_0x16fd('0x39')]!==_0x16fd('0x45')){var _0x3457e9={};_0x3457e9[_0x41c0c0[_0x16fd('0x34')]]={'$like':'%'+_0xb35c4d[_0x16fd('0x3c')][_0x16fd('0x46')]+'%'};return _0x3457e9;}})});}_0x3abc49=_['merge']({},_0x3abc49,_0xb35c4d[_0x16fd('0x47')]);var _0x12e655={'where':_0x3abc49[_0x16fd('0x44')]};return db[_0x16fd('0x36')][_0x16fd('0x27')](_0x12e655)[_0x16fd('0x2e')](function(_0x455126){_0x39bb9b[_0x16fd('0x27')]=_0x455126;if(_0xb35c4d[_0x16fd('0x3c')]['includeAll']){_0x3abc49[_0x16fd('0x48')]=[{'all':!![]}];}return db['CmList'][_0x16fd('0x49')](_0x3abc49);})[_0x16fd('0x2e')](function(_0x37ec8c){_0x39bb9b[_0x16fd('0x4a')]=_0x37ec8c;return _0x39bb9b;})['then'](respondWithFilteredResult(_0x5ebd8e,_0x3abc49))['catch'](handleError(_0x5ebd8e,null));};exports['show']=function(_0x8171e9,_0x4b8e89){var _0x527b8c={'raw':![],'where':{'id':_0x8171e9['params']['id']}},_0x3fe79d={};_0x3fe79d[_0x16fd('0x3a')]=_[_0x16fd('0x3d')](db['CmList'][_0x16fd('0x37')]);_0x3fe79d['query']=_[_0x16fd('0x3d')](_0x8171e9[_0x16fd('0x3c')]);_0x3fe79d[_0x16fd('0x42')]=_[_0x16fd('0x4b')](_0x3fe79d[_0x16fd('0x3a')],_0x3fe79d[_0x16fd('0x3c')]);_0x527b8c[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x3fe79d[_0x16fd('0x3a')],qs[_0x16fd('0x3f')](_0x8171e9[_0x16fd('0x3c')]['fields']));_0x527b8c[_0x16fd('0x3e')]=_0x527b8c['attributes']['length']?_0x527b8c[_0x16fd('0x3e')]:_0x3fe79d[_0x16fd('0x3a')];if(_0x8171e9[_0x16fd('0x3c')][_0x16fd('0x4c')]){_0x527b8c['include']=[{'all':!![]}];}_0x527b8c=_['merge']({},_0x527b8c,_0x8171e9[_0x16fd('0x47')]);return db[_0x16fd('0x36')][_0x16fd('0x4d')](_0x527b8c)[_0x16fd('0x2e')](handleEntityNotFound(_0x4b8e89,null))[_0x16fd('0x2e')](respondWithResult(_0x4b8e89,null))[_0x16fd('0x4e')](handleError(_0x4b8e89,null));};exports[_0x16fd('0x4f')]=function(_0x35937c,_0x143fa0){return db[_0x16fd('0x36')][_0x16fd('0x4f')](_0x35937c[_0x16fd('0x50')],{})[_0x16fd('0x2e')](function(_0x2020a0){var _0x13ec6a=_0x35937c['user']['get']({'plain':!![]});if(!_0x13ec6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13ec6a['role']===_0x16fd('0x51')){var _0x21dfdc=_0x2020a0[_0x16fd('0x2f')]({'plain':!![]});var _0x13075d=_0x16fd('0x30');return db['UserProfileSection'][_0x16fd('0x4d')]({'where':{'name':_0x13075d,'userProfileId':_0x13ec6a[_0x16fd('0x52')]},'raw':!![]})[_0x16fd('0x2e')](function(_0x22a6c5){if(_0x22a6c5&&_0x22a6c5[_0x16fd('0x53')]===0x0){return db[_0x16fd('0x31')][_0x16fd('0x4f')]({'name':_0x21dfdc[_0x16fd('0x34')],'resourceId':_0x21dfdc['id'],'type':_0x22a6c5[_0x16fd('0x34')],'sectionId':_0x22a6c5['id']},{})['then'](function(){return _0x2020a0;});}else{return _0x2020a0;}})[_0x16fd('0x4e')](function(_0x2069e0){logger[_0x16fd('0x32')](_0x16fd('0x54'),_0x2069e0);throw _0x2069e0;});}return _0x2020a0;})[_0x16fd('0x2e')](respondWithResult(_0x143fa0,0xc9))[_0x16fd('0x4e')](handleError(_0x143fa0,null));};exports[_0x16fd('0x2c')]=function(_0x1fe349,_0x3bfb9d){if(_0x1fe349[_0x16fd('0x50')]['id']){delete _0x1fe349[_0x16fd('0x50')]['id'];}return db['CmList']['find']({'where':{'id':_0x1fe349[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x3bfb9d,null))[_0x16fd('0x2e')](saveUpdates(_0x1fe349['body'],null))[_0x16fd('0x2e')](respondWithResult(_0x3bfb9d,null))[_0x16fd('0x4e')](handleError(_0x3bfb9d,null));};exports[_0x16fd('0x2d')]=function(_0x22e589,_0x217542){return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x22e589[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x217542,null))[_0x16fd('0x2e')](removeEntity(_0x217542,null))['catch'](handleError(_0x217542,null));};exports[_0x16fd('0x56')]=function(_0x42b06b,_0x25389d){return db[_0x16fd('0x36')][_0x16fd('0x56')]()[_0x16fd('0x2e')](respondWithResult(_0x25389d,null))['catch'](handleError(_0x25389d,null));};exports[_0x16fd('0x57')]=function(_0x52cdd0,_0x16e936,_0x5ead5c){if(_0x52cdd0[_0x16fd('0x50')]['id']){delete _0x52cdd0[_0x16fd('0x50')]['id'];}return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x52cdd0[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x16e936,null))[_0x16fd('0x2e')](function(_0x26af3b){if(_0x26af3b){_0x52cdd0[_0x16fd('0x50')][_0x16fd('0x58')]=_0x26af3b['id'];return db[_0x16fd('0x59')][_0x16fd('0x4f')](_0x52cdd0[_0x16fd('0x50')]);}})[_0x16fd('0x2e')](respondWithResult(_0x16e936,null))['catch'](handleError(_0x16e936,null));};exports[_0x16fd('0x5a')]=function(_0x2b958f,_0x444cc4,_0x5ecb1a){var _0x371442={'raw':![],'where':{}};var _0x42bf54={};var _0x15eae1={'count':0x0,'rows':[]};return db[_0x16fd('0x36')][_0x16fd('0x5b')]({'where':{'id':_0x2b958f['params']['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x444cc4,null))[_0x16fd('0x2e')](function(_0x32b246){if(_0x32b246){_0x42bf54['model']=_['keys'](db['Disposition'][_0x16fd('0x37')]);_0x42bf54[_0x16fd('0x3c')]=_['keys'](_0x2b958f['query']);_0x42bf54[_0x16fd('0x42')]=_[_0x16fd('0x4b')](_0x42bf54['model'],_0x42bf54[_0x16fd('0x3c')]);_0x371442[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x42bf54[_0x16fd('0x3a')],qs[_0x16fd('0x3f')](_0x2b958f[_0x16fd('0x3c')]['fields']));_0x371442[_0x16fd('0x3e')]=_0x371442[_0x16fd('0x3e')][_0x16fd('0x5c')]?_0x371442[_0x16fd('0x3e')]:_0x42bf54['model'];if(!_0x2b958f[_0x16fd('0x3c')]['hasOwnProperty'](_0x16fd('0x40'))){_0x371442[_0x16fd('0x26')]=qs[_0x16fd('0x26')](_0x2b958f[_0x16fd('0x3c')][_0x16fd('0x26')]);_0x371442[_0x16fd('0x24')]=qs[_0x16fd('0x24')](_0x2b958f[_0x16fd('0x3c')][_0x16fd('0x24')]);}_0x371442[_0x16fd('0x5d')]=qs[_0x16fd('0x41')](_0x2b958f[_0x16fd('0x3c')]['sort']);_0x371442[_0x16fd('0x44')]=qs[_0x16fd('0x42')](_[_0x16fd('0x43')](_0x2b958f[_0x16fd('0x3c')],_0x42bf54[_0x16fd('0x42')]));_0x371442[_0x16fd('0x44')][_0x16fd('0x58')]=_0x32b246['id'];if(_0x2b958f['query'][_0x16fd('0x46')]){_0x371442['where']=_[_0x16fd('0x5e')](_0x371442[_0x16fd('0x44')],{'$or':_[_0x16fd('0x3b')](_0x371442[_0x16fd('0x3e')],function(_0x2cb662){var _0x84926f={};_0x84926f[_0x2cb662]={'$like':'%'+_0x2b958f[_0x16fd('0x3c')][_0x16fd('0x46')]+'%'};return _0x84926f;})});}_0x371442=_[_0x16fd('0x5e')]({},_0x371442,_0x2b958f[_0x16fd('0x47')]);return db[_0x16fd('0x59')][_0x16fd('0x27')]({'where':_0x371442[_0x16fd('0x44')]})[_0x16fd('0x2e')](function(_0x1378da){_0x15eae1[_0x16fd('0x27')]=_0x1378da;if(_0x2b958f[_0x16fd('0x3c')][_0x16fd('0x4c')]){_0x371442['include']=[{'all':!![]}];}return db[_0x16fd('0x59')][_0x16fd('0x49')](_0x371442);})[_0x16fd('0x2e')](function(_0x48482c){_0x15eae1['rows']=_0x48482c;return _0x15eae1;});}})['then'](respondWithFilteredResult(_0x444cc4,_0x371442))['catch'](handleError(_0x444cc4,null));};exports[_0x16fd('0x5f')]=function(_0x24c3a8,_0x25887e,_0x44a08c){return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x24c3a8['params']['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x25887e,null))[_0x16fd('0x2e')](function(_0x1c7710){if(_0x1c7710){return _0x1c7710['removeDispositions'](_0x24c3a8[_0x16fd('0x3c')][_0x16fd('0x60')]);}})['then'](respondWithStatusCode(_0x25887e,null))[_0x16fd('0x4e')](handleError(_0x25887e,null));};exports[_0x16fd('0x61')]=function(_0x363a33,_0x113bce,_0x50fc89){return db[_0x16fd('0x36')]['find']({'where':{'id':_0x363a33[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x113bce,null))[_0x16fd('0x2e')](function(_0x529c31){if(_0x529c31){var _0x284334=[];var _0x5f418c={'success':[],'errors':[]};return db['CmContact'][_0x16fd('0x56')]()['then'](function(_0x2040bd){if(_0x363a33[_0x16fd('0x50')]['tags']&&_['isArray'](_0x363a33[_0x16fd('0x50')][_0x16fd('0x62')])){if(_0x363a33[_0x16fd('0x50')][_0x16fd('0x62')][_0x16fd('0x5c')]){_0x363a33['body']['tags']=_0x363a33[_0x16fd('0x50')]['tags']['join'](';')+';';}else{_0x363a33[_0x16fd('0x50')][_0x16fd('0x62')]=null;}}else{_0x363a33[_0x16fd('0x50')][_0x16fd('0x62')]=null;}if(_0x363a33[_0x16fd('0x50')]&&_[_0x16fd('0x63')](_0x363a33[_0x16fd('0x50')])){for(var _0x475ce0=0x0;_0x475ce0<_0x363a33[_0x16fd('0x50')][_0x16fd('0x5c')];_0x475ce0+=0x1){_0x363a33[_0x16fd('0x50')][_0x475ce0][_0x16fd('0x58')]=_0x363a33[_0x16fd('0x55')]['id'];_0x284334[_0x16fd('0x64')](_0x363a33[_0x16fd('0x50')][_0x475ce0]);}return BPromise[_0x16fd('0x65')](_0x284334,function(_0xfa407c){return db['CmContact'][_0x16fd('0x4f')](_[_0x16fd('0x66')](_0xfa407c,[_0x16fd('0x60'),'id'])||{},{'fields':_[_0x16fd('0x3d')](_0x2040bd),'raw':!![]})[_0x16fd('0x2e')](function(_0x199d2e){_0x5f418c[_0x16fd('0x67')]['push'](_0x199d2e['dataValues']);})[_0x16fd('0x4e')](function(_0x1f1008){_0x5f418c['errors'][_0x16fd('0x64')]({'data':_0xfa407c,'error':_0x1f1008[_0x16fd('0x68')]});});})[_0x16fd('0x2e')](function(_0x1be739){return _0x5f418c;})['catch'](function(_0x2448e0){return _0x2448e0;});}else{_0x113bce[_0x16fd('0x21')](0x190)[_0x16fd('0x23')]({'message':_0x16fd('0x69')});}});}})[_0x16fd('0x2e')](respondWithResult(_0x113bce,null))['catch'](handleError(_0x113bce,null));};exports['getContacts']=function(_0x50845d,_0x416c41,_0x47692d){var _0x340794;return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x50845d[_0x16fd('0x55')]['id']},'include':[{'model':db[_0x16fd('0x6a')],'as':_0x16fd('0x6b')}]})[_0x16fd('0x2e')](handleEntityNotFound(_0x416c41,null))['then'](function(_0x446be7){if(_0x446be7){_0x340794=_0x446be7;return db['CmContact'][_0x16fd('0x37')];}})[_0x16fd('0x2e')](function(_0x2260fc){if(_0x2260fc){var _0x3d7740={};var _0x542d7d={};_0x542d7d[_0x16fd('0x3a')]=_[_0x16fd('0x6c')](_[_0x16fd('0x3d')](_0x2260fc),_[_0x16fd('0x3b')](_0x340794[_0x16fd('0x6b')],function(_0x3896aa){return util[_0x16fd('0x6d')](_0x16fd('0x6e'),_0x3896aa['id']);}));_0x542d7d['query']=_['keys'](_0x50845d['query']);_0x542d7d[_0x16fd('0x42')]=_[_0x16fd('0x4b')](_0x542d7d[_0x16fd('0x3a')],_0x542d7d['query']);_0x3d7740[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x542d7d[_0x16fd('0x3a')],qs[_0x16fd('0x3f')](_0x50845d['query'][_0x16fd('0x3f')]));_0x3d7740[_0x16fd('0x3e')]=_0x3d7740[_0x16fd('0x3e')]['length']?_0x3d7740['attributes']:_0x542d7d[_0x16fd('0x3a')];if(!_0x50845d[_0x16fd('0x3c')]['hasOwnProperty'](_0x16fd('0x40'))){_0x3d7740['limit']=qs['limit'](_0x50845d['query'][_0x16fd('0x26')]);_0x3d7740[_0x16fd('0x24')]=qs[_0x16fd('0x24')](_0x50845d['query'][_0x16fd('0x24')]);}_0x3d7740[_0x16fd('0x5d')]=qs[_0x16fd('0x41')](_0x50845d[_0x16fd('0x3c')][_0x16fd('0x41')]);_0x3d7740['where']=qs[_0x16fd('0x42')](_[_0x16fd('0x43')](_0x50845d[_0x16fd('0x3c')],_0x542d7d['filters']));_0x3d7740[_0x16fd('0x6f')]=!![];if(_0x50845d[_0x16fd('0x3c')]['filter']){_0x3d7740[_0x16fd('0x44')]=_[_0x16fd('0x5e')](_0x3d7740[_0x16fd('0x44')],{'$or':_['map'](_0x3d7740[_0x16fd('0x3e')],function(_0x6b9a68){var _0x3535dc={};_0x3535dc[_0x6b9a68]={'$like':'%'+_0x50845d['query']['filter']+'%'};return _0x3535dc;})});}_0x3d7740=_['merge']({},_0x3d7740,_0x50845d['options']);return _0x340794[_0x16fd('0x70')](_0x3d7740);}})[_0x16fd('0x2e')](respondWithResult(_0x416c41,null))[_0x16fd('0x4e')](handleError(_0x416c41,null));};exports[_0x16fd('0x71')]=function(_0x52bc04,_0x137921,_0x3602c3){var _0x2c3d37;return db['CmList']['find']({'where':{'id':_0x52bc04['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x16fd('0x6b')}]})[_0x16fd('0x2e')](handleEntityNotFound(_0x137921,null))[_0x16fd('0x2e')](function(_0x122ba3){if(_0x122ba3){_0x2c3d37=_0x122ba3;return db[_0x16fd('0x72')][_0x16fd('0x37')];}})['then'](function(_0x2fdc56){if(_0x2fdc56){var _0x4483a1={};var _0x3e9b6d={};_0x3e9b6d['model']=_[_0x16fd('0x6c')](_['keys'](_0x2fdc56),_[_0x16fd('0x3b')](_0x2c3d37['CustomFields'],function(_0x27eaaf){return util[_0x16fd('0x6d')](_0x16fd('0x6e'),_0x27eaaf['id']);}));_0x3e9b6d[_0x16fd('0x3c')]=_['keys'](_0x52bc04[_0x16fd('0x3c')]);_0x3e9b6d[_0x16fd('0x42')]=_[_0x16fd('0x4b')](_0x3e9b6d[_0x16fd('0x3a')],_0x3e9b6d[_0x16fd('0x3c')]);_0x4483a1['attributes']=_['intersection'](_0x3e9b6d[_0x16fd('0x3a')],qs['fields'](_0x52bc04['query'][_0x16fd('0x3f')]));_0x4483a1[_0x16fd('0x3e')]=_0x4483a1[_0x16fd('0x3e')][_0x16fd('0x5c')]?_0x4483a1[_0x16fd('0x3e')]:_0x3e9b6d[_0x16fd('0x3a')];if(!_0x52bc04[_0x16fd('0x3c')][_0x16fd('0x73')](_0x16fd('0x40'))){_0x4483a1[_0x16fd('0x26')]=qs[_0x16fd('0x26')](_0x52bc04[_0x16fd('0x3c')]['limit']);_0x4483a1[_0x16fd('0x24')]=qs['offset'](_0x52bc04[_0x16fd('0x3c')][_0x16fd('0x24')]);}_0x4483a1[_0x16fd('0x5d')]=qs['sort'](_0x52bc04[_0x16fd('0x3c')][_0x16fd('0x41')]);_0x4483a1['where']=qs[_0x16fd('0x42')](_['pick'](_0x52bc04['query'],_0x3e9b6d[_0x16fd('0x42')]));_0x4483a1['raw']=!![];if(_0x52bc04[_0x16fd('0x3c')]['filter']){_0x4483a1[_0x16fd('0x44')]=_[_0x16fd('0x5e')](_0x4483a1[_0x16fd('0x44')],{'$or':_[_0x16fd('0x3b')](_0x4483a1[_0x16fd('0x3e')],function(_0xdd17bc){var _0x38ec81={};_0x38ec81[_0xdd17bc]={'$like':'%'+_0x52bc04['query']['filter']+'%'};return _0x38ec81;})});}_0x4483a1=_[_0x16fd('0x5e')]({},_0x4483a1,_0x52bc04[_0x16fd('0x47')]);return _0x2c3d37[_0x16fd('0x70')](_0x4483a1);}})[_0x16fd('0x2e')](function(_0x5c4cf){if(!_[_0x16fd('0x74')](_0x5c4cf)){var _0x2b2c3a=toCsv(_0x5c4cf);var _0x52062f=Date[_0x16fd('0x75')]();fs['writeFileSync'](util[_0x16fd('0x6d')](_0x16fd('0x76'),_0x2c3d37['id'],_0x52062f),_0x2b2c3a);_0x137921[_0x16fd('0x77')](_0x16fd('0x78'),_0x16fd('0x79')+util[_0x16fd('0x6d')](_0x16fd('0x7a'),_0x2c3d37['id'],_0x52062f));_0x137921[_0x16fd('0x77')]('Content-type','text/csv');return _0x137921['download'](util[_0x16fd('0x6d')](_0x16fd('0x76'),_0x2c3d37['id'],_0x52062f));}else{return _0x137921[_0x16fd('0x20')](0xcc);}})[_0x16fd('0x4e')](handleError(_0x137921,null));};exports[_0x16fd('0x7b')]=function(_0x5ac39,_0x200a76,_0x5aaec8){var _0x8d2da;delete _0x5ac39[_0x16fd('0x50')]['id'];return db[_0x16fd('0x36')][_0x16fd('0x5b')]({'where':{'id':_0x5ac39['params']['id']}})['then'](handleEntityNotFound(_0x200a76,null))[_0x16fd('0x2e')](function(_0x2dc853){if(_0x2dc853){return db[_0x16fd('0x7c')][_0x16fd('0x7d')](function(_0x466f57){return db[_0x16fd('0x6a')][_0x16fd('0x4f')](_0x5ac39[_0x16fd('0x50')],{'transaction':_0x466f57})[_0x16fd('0x2e')](function(_0x223bad){_0x8d2da=_0x223bad;return _0x2dc853['addCustomFields'](_0x223bad,{'transaction':_0x466f57});})[_0x16fd('0x2e')](function(){var _0x2ec34e={'type':db[_0x16fd('0x7e')]['TEXT'],'transaction':_0x466f57};switch(_0x5ac39[_0x16fd('0x50')]['type']){case _0x16fd('0x7f'):_0x2ec34e['type']=db[_0x16fd('0x7e')]['TEXT'];break;case'number':_0x2ec34e[_0x16fd('0x39')]=db[_0x16fd('0x7e')][_0x16fd('0x80')];break;case'switch':_0x2ec34e[_0x16fd('0x39')]=db['Sequelize'][_0x16fd('0x81')];_0x2ec34e[_0x16fd('0x82')]=![];break;default:}return db[_0x16fd('0x7c')]['queryInterface'][_0x16fd('0x83')](_0x16fd('0x84'),util[_0x16fd('0x6d')](_0x16fd('0x85'),_0x8d2da['id']),_0x2ec34e);})[_0x16fd('0x2e')](function(){return _0x8d2da;});});}})[_0x16fd('0x2e')](respondWithResult(_0x200a76,null))[_0x16fd('0x4e')](handleError(_0x200a76,null));};exports['getCustomFields']=function(_0x2332e9,_0x1e246d,_0x13ddf1){var _0x4030e4={};var _0x3ac224={};var _0xd02cac;var _0x845332;return db[_0x16fd('0x36')][_0x16fd('0x5b')]({'where':{'id':_0x2332e9[_0x16fd('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e246d,null))[_0x16fd('0x2e')](function(_0x1ea45b){if(_0x1ea45b){_0xd02cac=_0x1ea45b;_0x3ac224['model']=_[_0x16fd('0x3d')](db[_0x16fd('0x6a')][_0x16fd('0x37')]);_0x3ac224['query']=_[_0x16fd('0x3d')](_0x2332e9[_0x16fd('0x3c')]);_0x3ac224['filters']=_[_0x16fd('0x4b')](_0x3ac224['model'],_0x3ac224['query']);_0x4030e4[_0x16fd('0x3e')]=_[_0x16fd('0x4b')](_0x3ac224[_0x16fd('0x3a')],qs[_0x16fd('0x3f')](_0x2332e9['query'][_0x16fd('0x3f')]));_0x4030e4[_0x16fd('0x3e')]=_0x4030e4[_0x16fd('0x3e')][_0x16fd('0x5c')]?_0x4030e4['attributes']:_0x3ac224['model'];_0x4030e4['order']=qs['sort'](_0x2332e9[_0x16fd('0x3c')][_0x16fd('0x41')]);_0x4030e4[_0x16fd('0x44')]=qs[_0x16fd('0x42')](_[_0x16fd('0x43')](_0x2332e9[_0x16fd('0x3c')],_0x3ac224[_0x16fd('0x42')]));_0x4030e4['where']=_[_0x16fd('0x5e')](_0x4030e4['where'],{'$or':[{'ListId':_0x1ea45b['id']},{'ListId':null}]});if(_0x2332e9[_0x16fd('0x3c')][_0x16fd('0x46')]){_0x4030e4['where']=_['merge'](_0x4030e4['where'],{'$or':_[_0x16fd('0x3b')](_0x4030e4[_0x16fd('0x3e')],function(_0x2d27dc){var _0x5e5787={};_0x5e5787[_0x2d27dc]={'$like':'%'+_0x2332e9[_0x16fd('0x3c')][_0x16fd('0x46')]+'%'};return _0x5e5787;})});}_0x4030e4=_[_0x16fd('0x5e')]({},_0x4030e4,_0x2332e9[_0x16fd('0x47')]);return db['CmCustomField']['findAndCountAll'](_0x4030e4);}})[_0x16fd('0x2e')](respondWithResult(_0x1e246d,null))[_0x16fd('0x4e')](handleError(_0x1e246d,null));};exports[_0x16fd('0x86')]=function(_0x1efaac,_0x472e34,_0x37c5a5){return db[_0x16fd('0x36')][_0x16fd('0x4d')]({'where':{'id':_0x1efaac[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x472e34,null))[_0x16fd('0x2e')](function(_0xc1add2){if(_0xc1add2){return _0xc1add2[_0x16fd('0x86')](_0x1efaac[_0x16fd('0x50')]['ids'],_[_0x16fd('0x66')](_0x1efaac[_0x16fd('0x50')],['ids','id'])||{})[_0x16fd('0x87')](function(_0x59dac2){for(var _0x197aea=0x0;_0x197aea<_0x1efaac['body']['ids'][_0x16fd('0x5c')];_0x197aea+=0x1){socket[_0x16fd('0x88')]('userCmList:save',{'UserId':_0x1efaac[_0x16fd('0x50')][_0x16fd('0x60')][_0x197aea],'CmListId':_0x1efaac[_0x16fd('0x55')]['id']});}return _0x59dac2;});}})['then'](respondWithResult(_0x472e34,null))[_0x16fd('0x4e')](handleError(_0x472e34,null));};exports['removeAgents']=function(_0x2b2e6c,_0x573b00,_0x181681){return db['CmList'][_0x16fd('0x4d')]({'where':{'id':_0x2b2e6c[_0x16fd('0x55')]['id']}})[_0x16fd('0x2e')](handleEntityNotFound(_0x573b00,null))[_0x16fd('0x2e')](function(_0x14ea23){if(_0x14ea23){return _0x14ea23['removeAgents'](_0x2b2e6c[_0x16fd('0x3c')][_0x16fd('0x60')])[_0x16fd('0x2e')](function(){if(_['isArray'](_0x2b2e6c[_0x16fd('0x3c')][_0x16fd('0x60')])){for(var _0x3c869e=0x0;_0x3c869e<_0x2b2e6c[_0x16fd('0x3c')][_0x16fd('0x60')][_0x16fd('0x5c')];_0x3c869e+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x2b2e6c[_0x16fd('0x3c')][_0x16fd('0x60')][_0x3c869e]),'CmListId':Number(_0x2b2e6c[_0x16fd('0x55')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x2b2e6c['query'][_0x16fd('0x60')]),'CmListId':Number(_0x2b2e6c[_0x16fd('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x573b00,null))['catch'](handleError(_0x573b00,null));};exports[_0x16fd('0x89')]=function(_0x16b497,_0xd39870,_0x3c6a1d){var _0xac9fba={};var _0x290589={};var _0x3f615f;var _0x4e6027;return db[_0x16fd('0x36')]['findOne']({'where':{'id':_0x16b497['params']['id']}})['then'](handleEntityNotFound(_0xd39870,null))['then'](function(_0x145eec){if(_0x145eec){_0x3f615f=_0x145eec;_0x290589[_0x16fd('0x3a')]=_['keys'](db[_0x16fd('0x8a')]['rawAttributes']);_0x290589[_0x16fd('0x3c')]=_[_0x16fd('0x3d')](_0x16b497[_0x16fd('0x3c')]);_0x290589['filters']=_['intersection'](_0x290589[_0x16fd('0x3a')],_0x290589[_0x16fd('0x3c')]);_0xac9fba[_0x16fd('0x3e')]=_['intersection'](_0x290589['model'],qs[_0x16fd('0x3f')](_0x16b497[_0x16fd('0x3c')][_0x16fd('0x3f')]));_0xac9fba[_0x16fd('0x3e')]=_0xac9fba[_0x16fd('0x3e')][_0x16fd('0x5c')]?_0xac9fba['attributes']:_0x290589['model'];_0xac9fba['order']=qs['sort'](_0x16b497['query'][_0x16fd('0x41')]);_0xac9fba[_0x16fd('0x44')]=qs[_0x16fd('0x42')](_[_0x16fd('0x43')](_0x16b497[_0x16fd('0x3c')],_0x290589[_0x16fd('0x42')]));if(_0x16b497[_0x16fd('0x3c')][_0x16fd('0x46')]){_0xac9fba['where']=_[_0x16fd('0x5e')](_0xac9fba['where'],{'$or':_['map'](_0xac9fba[_0x16fd('0x3e')],function(_0x5c602c){var _0x416174={};_0x416174[_0x5c602c]={'$like':'%'+_0x16b497['query'][_0x16fd('0x46')]+'%'};return _0x416174;})});}_0xac9fba=_[_0x16fd('0x5e')]({},_0xac9fba,_0x16b497['options']);return _0x3f615f[_0x16fd('0x89')](_0xac9fba);}})[_0x16fd('0x2e')](function(_0x4b7fb0){if(_0x4b7fb0){_0x4e6027=_0x4b7fb0[_0x16fd('0x5c')];if(!_0x16b497[_0x16fd('0x3c')]['hasOwnProperty'](_0x16fd('0x40'))){_0xac9fba[_0x16fd('0x26')]=qs[_0x16fd('0x26')](_0x16b497[_0x16fd('0x3c')][_0x16fd('0x26')]);_0xac9fba[_0x16fd('0x24')]=qs['offset'](_0x16b497['query'][_0x16fd('0x24')]);}return _0x3f615f[_0x16fd('0x89')](_0xac9fba);}})[_0x16fd('0x2e')](function(_0x2271d7){if(_0x2271d7){return _0x2271d7?{'count':_0x4e6027,'rows':_0x2271d7}:null;}})['then'](respondWithResult(_0xd39870,null))[_0x16fd('0x4e')](handleError(_0xd39870,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 87ac4ba..eefff83 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe14b,0x93));var _0xbe14=function(_0x5dc694,_0x174d38){_0x5dc694=_0x5dc694-0x0;var _0x5741b6=_0xe14b[_0x5dc694];return _0x5741b6;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe14b,0x93));var _0xbe14=function(_0x1ae861,_0x3d11ad){_0x1ae861=_0x1ae861-0x0;var _0x121d0d=_0xe14b[_0x1ae861];return _0x121d0d;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9c1c3b1..c21f163 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 _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0xa75b,0x170));var _0xba75=function(_0x5b8a03,_0x4fc8a0){_0x5b8a03=_0x5b8a03-0x0;var _0x3f8545=_0xa75b[_0x5b8a03];return _0x3f8545;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x4e5613,_0x424739){var _0x238ab5=function(_0x34c56f){while(--_0x34c56f){_0x4e5613['push'](_0x4e5613['shift']());}};_0x238ab5(++_0x424739);}(_0x2dae,0xc3));var _0xe2da=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2dae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4af63d4..0deee30 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 _0x3576=['CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./cmList.socket','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x3576,0x170));var _0x6357=function(_0x19d1cf,_0x4e4258){_0x19d1cf=_0x19d1cf-0x0;var _0x3be17b=_0x3576[_0x19d1cf];return _0x3be17b;};'use strict';var _=require(_0x6357('0x0'));var util=require(_0x6357('0x1'));var moment=require(_0x6357('0x2'));var BPromise=require(_0x6357('0x3'));var rs=require(_0x6357('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6357('0x5'))['db'];var utils=require(_0x6357('0x6'));var logger=require(_0x6357('0x7'))(_0x6357('0x8'));var config=require('../../config/environment');var jayson=require(_0x6357('0x9'));var client=jayson[_0x6357('0xa')][_0x6357('0xb')]({'port':0x232a});config['redis']=_[_0x6357('0xc')](config['redis'],{'host':_0x6357('0xd'),'port':0x18eb});var socket=require(_0x6357('0xe'))(new Redis(config[_0x6357('0xf')]));require(_0x6357('0x10'))['register'](socket);function respondWithRpcPromise(_0x5c756f,_0x2a86ee,_0x323d40){return new BPromise(function(_0x14f8c7,_0xa02a4e){return client[_0x6357('0x11')](_0x5c756f,_0x323d40)[_0x6357('0x12')](function(_0x5d76cf){logger[_0x6357('0x13')]('CmList,\x20%s,\x20%s',_0x2a86ee,'request\x20sent');logger[_0x6357('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x2a86ee,_0x6357('0x15'),JSON[_0x6357('0x16')](_0x5d76cf));if(_0x5d76cf[_0x6357('0x17')]){if(_0x5d76cf['error']['code']===0x1f4){logger['error'](_0x6357('0x18'),_0x2a86ee,_0x5d76cf[_0x6357('0x17')][_0x6357('0x19')]);return _0xa02a4e(_0x5d76cf[_0x6357('0x17')][_0x6357('0x19')]);}logger['error'](_0x6357('0x18'),_0x2a86ee,_0x5d76cf['error']['message']);return _0x14f8c7(_0x5d76cf[_0x6357('0x17')][_0x6357('0x19')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x2a86ee,_0x6357('0x15'));_0x14f8c7(_0x5d76cf[_0x6357('0x1a')][_0x6357('0x19')]);}})[_0x6357('0x1b')](function(_0x4b08b1){logger[_0x6357('0x17')](_0x6357('0x18'),_0x2a86ee,_0x4b08b1);_0xa02a4e(_0x4b08b1);});});} \ No newline at end of file +var _0x3558=['client','http','redis','localhost','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x38b7eb,_0x339f6c){var _0xc013e2=function(_0xf59ed4){while(--_0xf59ed4){_0x38b7eb['push'](_0x38b7eb['shift']());}};_0xc013e2(++_0x339f6c);}(_0x3558,0x71));var _0x8355=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3558[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x8355('0x0'));var moment=require('moment');var BPromise=require(_0x8355('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8355('0x2'));var db=require(_0x8355('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8355('0x4'))('rpc');var config=require(_0x8355('0x5'));var jayson=require(_0x8355('0x6'));var client=jayson[_0x8355('0x7')][_0x8355('0x8')]({'port':0x232a});config[_0x8355('0x9')]=_['defaults'](config[_0x8355('0x9')],{'host':_0x8355('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8355('0xb'))[_0x8355('0xc')](socket);function respondWithRpcPromise(_0x20364c,_0x2d8d7d,_0x556760){return new BPromise(function(_0x4d8c5e,_0x4c2ba5){return client['request'](_0x20364c,_0x556760)[_0x8355('0xd')](function(_0x55789f){logger[_0x8355('0xe')](_0x8355('0xf'),_0x2d8d7d,_0x8355('0x10'));logger[_0x8355('0x11')](_0x8355('0x12'),_0x2d8d7d,_0x8355('0x10'),JSON[_0x8355('0x13')](_0x55789f));if(_0x55789f[_0x8355('0x14')]){if(_0x55789f[_0x8355('0x14')][_0x8355('0x15')]===0x1f4){logger[_0x8355('0x14')]('CmList,\x20%s,\x20%s',_0x2d8d7d,_0x55789f['error'][_0x8355('0x16')]);return _0x4c2ba5(_0x55789f['error']['message']);}logger['error'](_0x8355('0xf'),_0x2d8d7d,_0x55789f['error'][_0x8355('0x16')]);return _0x4d8c5e(_0x55789f[_0x8355('0x14')][_0x8355('0x16')]);}else{logger[_0x8355('0xe')](_0x8355('0xf'),_0x2d8d7d,_0x8355('0x10'));_0x4d8c5e(_0x55789f[_0x8355('0x17')]['message']);}})['catch'](function(_0x76e4cf){logger['error'](_0x8355('0xf'),_0x2d8d7d,_0x76e4cf);_0x4c2ba5(_0x76e4cf);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1abf1d3..30a3a46 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 _0x26a7=['save','update','emit','removeListener','length','./cmList.events'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x26a7,0x1a3));var _0x726a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x26a7[_0x397e5f];return _0x5302b8;};'use strict';var CmListEvents=require(_0x726a('0x0'));var events=[_0x726a('0x1'),'remove',_0x726a('0x2')];function createListener(_0x703407,_0x46a978){return function(_0x2ab7a0){_0x46a978[_0x726a('0x3')](_0x703407,_0x2ab7a0);};}function removeListener(_0xdbf6ff,_0x52ea36){return function(){CmListEvents[_0x726a('0x4')](_0xdbf6ff,_0x52ea36);};}exports['register']=function(_0x2a4f03){for(var _0x555c67=0x0,_0x184135=events[_0x726a('0x5')];_0x555c67<_0x184135;_0x555c67++){var _0x4e31bc=events[_0x555c67];var _0x31b98f=createListener('cmList:'+_0x4e31bc,_0x2a4f03);CmListEvents['on'](_0x4e31bc,_0x31b98f);}}; \ No newline at end of file +var _0x9919=['removeListener','cmList:','./cmList.events','save','emit'];(function(_0xeea5ca,_0x2d569b){var _0x1fdf07=function(_0x86809){while(--_0x86809){_0xeea5ca['push'](_0xeea5ca['shift']());}};_0x1fdf07(++_0x2d569b);}(_0x9919,0x1e7));var _0x9991=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0x9919[_0x334f9a];return _0x2b219d;};'use strict';var CmListEvents=require(_0x9991('0x0'));var events=[_0x9991('0x1'),'remove','update'];function createListener(_0x4c902a,_0x2a4dc3){return function(_0xe22108){_0x2a4dc3[_0x9991('0x2')](_0x4c902a,_0xe22108);};}function removeListener(_0x1fe763,_0x2be80f){return function(){CmListEvents[_0x9991('0x3')](_0x1fe763,_0x2be80f);};}exports['register']=function(_0x55e5b1){for(var _0x29f843=0x0,_0x6d1c7b=events['length'];_0x29f843<_0x6d1c7b;_0x29f843++){var _0x21711d=events[_0x29f843];var _0x54ad46=createListener(_0x9991('0x4')+_0x21711d,_0x55e5b1);CmListEvents['on'](_0x21711d,_0x54ad46);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8bd8d99..60d6958 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 _0xff42=['getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','addDisposition','post','/:id/contacts','addContacts','addCustomField','put','/:id','delete','removeDispositions','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','/:id/dispositions'];(function(_0x58260f,_0x137498){var _0x59ebc5=function(_0x2afd09){while(--_0x2afd09){_0x58260f['push'](_0x58260f['shift']());}};_0x59ebc5(++_0x137498);}(_0xff42,0x1f0));var _0x2ff4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xff42[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x2ff4('0x0'));var util=require(_0x2ff4('0x1'));var path=require(_0x2ff4('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ff4('0x3'));var router=express[_0x2ff4('0x4')]();var fs_extra=require(_0x2ff4('0x5'));var auth=require(_0x2ff4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ff4('0x7'));var controller=require(_0x2ff4('0x8'));router[_0x2ff4('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ff4('0xa')]);router[_0x2ff4('0x9')](_0x2ff4('0xb'),auth[_0x2ff4('0xc')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2ff4('0x9')](_0x2ff4('0xd'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0xe')]);router[_0x2ff4('0x9')]('/:id/contacts',auth[_0x2ff4('0xc')](),controller[_0x2ff4('0xf')]);router[_0x2ff4('0x9')](_0x2ff4('0x10'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x11')]);router['get'](_0x2ff4('0x12'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x13')]);router[_0x2ff4('0x9')](_0x2ff4('0x14'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2ff4('0x16')]);router['post'](_0x2ff4('0xd'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x17')]);router[_0x2ff4('0x18')](_0x2ff4('0x19'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x1a')]);router[_0x2ff4('0x18')]('/:id/fields',auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x1b')]);router[_0x2ff4('0x18')](_0x2ff4('0x14'),auth[_0x2ff4('0xc')](),controller['addAgents']);router[_0x2ff4('0x1c')](_0x2ff4('0x1d'),auth[_0x2ff4('0xc')](),controller['update']);router[_0x2ff4('0x1e')](_0x2ff4('0x1d'),auth['isAuthenticated'](),controller['destroy']);router[_0x2ff4('0x1e')](_0x2ff4('0xd'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x1f')]);router[_0x2ff4('0x1e')](_0x2ff4('0x14'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x20')]);module[_0x2ff4('0x21')]=router; \ No newline at end of file +var _0x87ee=['express','Router','fs-extra','../../components/auth/service','../../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','create','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util'];(function(_0x3cf282,_0x20d67d){var _0x21ad38=function(_0x3b6068){while(--_0x3b6068){_0x3cf282['push'](_0x3cf282['shift']());}};_0x21ad38(++_0x20d67d);}(_0x87ee,0x10e));var _0xe87e=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x87ee[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0xe87e('0x0'));var util=require(_0xe87e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe87e('0x2'));var router=express[_0xe87e('0x3')]();var fs_extra=require(_0xe87e('0x4'));var auth=require(_0xe87e('0x5'));var interaction=require(_0xe87e('0x6'));var config=require(_0xe87e('0x7'));var controller=require(_0xe87e('0x8'));router[_0xe87e('0x9')]('/',auth['isAuthenticated'](),controller[_0xe87e('0xa')]);router[_0xe87e('0x9')]('/describe',auth[_0xe87e('0xb')](),controller[_0xe87e('0xc')]);router[_0xe87e('0x9')](_0xe87e('0xd'),auth[_0xe87e('0xb')](),controller[_0xe87e('0xe')]);router[_0xe87e('0x9')](_0xe87e('0xf'),auth[_0xe87e('0xb')](),controller[_0xe87e('0x10')]);router['get'](_0xe87e('0x11'),auth['isAuthenticated'](),controller[_0xe87e('0x12')]);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xe87e('0x13')]);router[_0xe87e('0x9')](_0xe87e('0x14'),auth[_0xe87e('0xb')](),controller[_0xe87e('0x15')]);router[_0xe87e('0x9')](_0xe87e('0x16'),auth[_0xe87e('0xb')](),controller['getAgents']);router[_0xe87e('0x17')]('/',auth[_0xe87e('0xb')](),controller[_0xe87e('0x18')]);router[_0xe87e('0x17')](_0xe87e('0xf'),auth['isAuthenticated'](),controller[_0xe87e('0x19')]);router[_0xe87e('0x17')](_0xe87e('0x11'),auth['isAuthenticated'](),controller[_0xe87e('0x1a')]);router[_0xe87e('0x17')](_0xe87e('0x14'),auth['isAuthenticated'](),controller['addCustomField']);router[_0xe87e('0x17')](_0xe87e('0x16'),auth['isAuthenticated'](),controller[_0xe87e('0x1b')]);router[_0xe87e('0x1c')](_0xe87e('0xd'),auth['isAuthenticated'](),controller[_0xe87e('0x1d')]);router[_0xe87e('0x1e')](_0xe87e('0xd'),auth[_0xe87e('0xb')](),controller[_0xe87e('0x1f')]);router[_0xe87e('0x1e')](_0xe87e('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xe87e('0x1e')]('/:id/users',auth['isAuthenticated'](),controller[_0xe87e('0x20')]);module[_0xe87e('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 929c954..c753b77 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 _0xe9ff=['exports','getDataValue','field','STRING','sequelize'];(function(_0x46319c,_0x5a5ea4){var _0x4b741b=function(_0x37a168){while(--_0x37a168){_0x46319c['push'](_0x46319c['shift']());}};_0x4b741b(++_0x5a5ea4);}(_0xe9ff,0xcc));var _0xfe9f=function(_0x449b40,_0x57760d){_0x449b40=_0x449b40-0x0;var _0x5ec2d0=_0xe9ff[_0x449b40];return _0x5ec2d0;};'use strict';var Sequelize=require(_0xfe9f('0x0'));module[_0xfe9f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b6d8b){return this[_0xfe9f('0x2')](_0xfe9f('0x3'));}},'field':{'type':Sequelize[_0xfe9f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xfe9f('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xfe9f('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x21f8=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x411aea,_0x321121){var _0x7db619=function(_0x548f3e){while(--_0x548f3e){_0x411aea['push'](_0x411aea['shift']());}};_0x7db619(++_0x321121);}(_0x21f8,0x74));var _0x821f=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x21f8[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require('sequelize');module[_0x821f('0x0')]={'name':{'type':Sequelize[_0x821f('0x1')],'get':function(_0x10af39){return this[_0x821f('0x2')](_0x821f('0x3'));}},'field':{'type':Sequelize[_0x821f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x821f('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x821f('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 6e1c59d..c5482f7 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(_0x856777,_0x39027f){var _0x204d1a=function(_0x2a0f9d){while(--_0x2a0f9d){_0x856777['push'](_0x856777['shift']());}};_0x204d1a(++_0x39027f);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x46795e,_0x3c26cd){var _0x206c79=function(_0xf3ea2a){while(--_0xf3ea2a){_0x46795e['push'](_0x46795e['shift']());}};_0x206c79(++_0x3c26cd);}(_0x7a54,0x106));var _0x47a5=function(_0x462218,_0x52aa82){_0x462218=_0x462218-0x0;var _0x77350e=_0x7a54[_0x462218];return _0x77350e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index a35a6df..a4ce4b3 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 _0x5cfe=['../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','api','path','rimraf'];(function(_0x266752,_0x37641c){var _0x564b2a=function(_0x22080f){while(--_0x22080f){_0x266752['push'](_0x266752['shift']());}};_0x564b2a(++_0x37641c);}(_0x5cfe,0xe6));var _0xe5cf=function(_0x2648e7,_0x396ce5){_0x2648e7=_0x2648e7-0x0;var _0x2697c8=_0x5cfe[_0x2648e7];return _0x2697c8;};'use strict';var _=require(_0xe5cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe5cf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5cf('0x2'));var rimraf=require(_0xe5cf('0x3'));var config=require(_0xe5cf('0x4'));var attributes=require(_0xe5cf('0x5'));module['exports']=function(_0xb7a223,_0x33da02){return _0xb7a223[_0xe5cf('0x6')](_0xe5cf('0x7'),attributes,{'tableName':_0xe5cf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f6f=['../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','api','bluebird','request-promise','path'];(function(_0xaa7f12,_0x4958a0){var _0xdf0be1=function(_0x4400cc){while(--_0x4400cc){_0xaa7f12['push'](_0xaa7f12['shift']());}};_0xdf0be1(++_0x4958a0);}(_0x2f6f,0x181));var _0xf2f6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2f6f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf2f6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf2f6('0x1'));var moment=require('moment');var BPromise=require(_0xf2f6('0x2'));var rp=require(_0xf2f6('0x3'));var fs=require('fs');var path=require(_0xf2f6('0x4'));var rimraf=require('rimraf');var config=require(_0xf2f6('0x5'));var attributes=require(_0xf2f6('0x6'));module[_0xf2f6('0x7')]=function(_0x5c1e53,_0x37d236){return _0x5c1e53['define'](_0xf2f6('0x8'),attributes,{'tableName':_0xf2f6('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 cd28004..540de7b 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 _0x81a0=['request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','lodash','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x280c69,_0x51f7e2){var _0x475ad0=function(_0x34f71e){while(--_0x34f71e){_0x280c69['push'](_0x280c69['shift']());}};_0x475ad0(++_0x51f7e2);}(_0x81a0,0x1ec));var _0x081a=function(_0x4e3553,_0xfbb05a){_0x4e3553=_0x4e3553-0x0;var _0x2da08b=_0x81a0[_0x4e3553];return _0x2da08b;};'use strict';var _=require(_0x081a('0x0'));var util=require('util');var moment=require(_0x081a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x081a('0x2'));var logger=require('../../config/logger')(_0x081a('0x3'));var config=require(_0x081a('0x4'));var jayson=require(_0x081a('0x5'));var client=jayson[_0x081a('0x6')][_0x081a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b3b7f,_0x1b03ec,_0x5decf8){return new BPromise(function(_0x1d0b9,_0x460001){return client[_0x081a('0x8')](_0x1b3b7f,_0x5decf8)['then'](function(_0x26a5ab){logger[_0x081a('0x9')]('Condition,\x20%s,\x20%s',_0x1b03ec,'request\x20sent');logger[_0x081a('0xa')](_0x081a('0xb'),_0x1b03ec,_0x081a('0xc'),JSON[_0x081a('0xd')](_0x26a5ab));if(_0x26a5ab[_0x081a('0xe')]){if(_0x26a5ab[_0x081a('0xe')][_0x081a('0xf')]===0x1f4){logger['error'](_0x081a('0x10'),_0x1b03ec,_0x26a5ab['error'][_0x081a('0x11')]);return _0x460001(_0x26a5ab['error']['message']);}logger[_0x081a('0xe')](_0x081a('0x10'),_0x1b03ec,_0x26a5ab[_0x081a('0xe')][_0x081a('0x11')]);return _0x1d0b9(_0x26a5ab['error'][_0x081a('0x11')]);}else{logger[_0x081a('0x9')]('Condition,\x20%s,\x20%s',_0x1b03ec,_0x081a('0xc'));_0x1d0b9(_0x26a5ab['result'][_0x081a('0x11')]);}})['catch'](function(_0x2abe6e){logger['error'](_0x081a('0x10'),_0x1b03ec,_0x2abe6e);_0x460001(_0x2abe6e);});});} \ No newline at end of file +var _0x66a6=['message','Condition,\x20%s,\x20%s','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4787fe,_0x5b1dff){var _0x529750=function(_0x26b767){while(--_0x26b767){_0x4787fe['push'](_0x4787fe['shift']());}};_0x529750(++_0x5b1dff);}(_0x66a6,0x90));var _0x666a=function(_0x20034d,_0x1391bf){_0x20034d=_0x20034d-0x0;var _0x24bb9e=_0x66a6[_0x20034d];return _0x24bb9e;};'use strict';var _=require(_0x666a('0x0'));var util=require('util');var moment=require(_0x666a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x666a('0x2'))['db'];var utils=require(_0x666a('0x3'));var logger=require(_0x666a('0x4'))(_0x666a('0x5'));var config=require('../../config/environment');var jayson=require(_0x666a('0x6'));var client=jayson[_0x666a('0x7')][_0x666a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbe3a7a,_0x42100e,_0x1541c9){return new BPromise(function(_0xe472dd,_0xdbd7d7){return client[_0x666a('0x9')](_0xbe3a7a,_0x1541c9)[_0x666a('0xa')](function(_0x39252a){logger[_0x666a('0xb')]('Condition,\x20%s,\x20%s',_0x42100e,'request\x20sent');logger['debug'](_0x666a('0xc'),_0x42100e,_0x666a('0xd'),JSON['stringify'](_0x39252a));if(_0x39252a[_0x666a('0xe')]){if(_0x39252a[_0x666a('0xe')][_0x666a('0xf')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x42100e,_0x39252a[_0x666a('0xe')][_0x666a('0x10')]);return _0xdbd7d7(_0x39252a[_0x666a('0xe')]['message']);}logger[_0x666a('0xe')](_0x666a('0x11'),_0x42100e,_0x39252a['error'][_0x666a('0x10')]);return _0xe472dd(_0x39252a[_0x666a('0xe')][_0x666a('0x10')]);}else{logger['info'](_0x666a('0x11'),_0x42100e,_0x666a('0xd'));_0xe472dd(_0x39252a[_0x666a('0x12')][_0x666a('0x10')]);}})[_0x666a('0x13')](function(_0x4dc776){logger['error'](_0x666a('0x11'),_0x42100e,_0x4dc776);_0xdbd7d7(_0x4dc776);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 9929782..cd6837b 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 _0x292d=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x4ce296,_0xf36e86){var _0x378c9a=function(_0x5ea76e){while(--_0x5ea76e){_0x4ce296['push'](_0x4ce296['shift']());}};_0x378c9a(++_0xf36e86);}(_0x292d,0x178));var _0xd292=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x292d[_0x49beea];return _0x27693a;};'use strict';var multer=require('multer');var util=require(_0xd292('0x0'));var path=require(_0xd292('0x1'));var timeout=require(_0xd292('0x2'));var express=require(_0xd292('0x3'));var router=express[_0xd292('0x4')]();var fs_extra=require(_0xd292('0x5'));var auth=require(_0xd292('0x6'));var interaction=require(_0xd292('0x7'));var config=require('../../config/environment');var controller=require(_0xd292('0x8'));router[_0xd292('0x9')](_0xd292('0xa'),auth[_0xd292('0xb')](),controller[_0xd292('0xc')]);router[_0xd292('0xd')](_0xd292('0xa'),auth[_0xd292('0xb')](),controller[_0xd292('0xe')]);module['exports']=router; \ No newline at end of file +var _0x58eb=['Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','express'];(function(_0x3aad57,_0xff84c4){var _0x423e52=function(_0x25f92d){while(--_0x25f92d){_0x3aad57['push'](_0x3aad57['shift']());}};_0x423e52(++_0xff84c4);}(_0x58eb,0x16c));var _0xb58e=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x58eb[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require(_0xb58e('0x0'));var util=require(_0xb58e('0x1'));var path=require(_0xb58e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb58e('0x3'));var router=express[_0xb58e('0x4')]();var fs_extra=require(_0xb58e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb58e('0x6'));var config=require(_0xb58e('0x7'));var controller=require(_0xb58e('0x8'));router[_0xb58e('0x9')](_0xb58e('0xa'),auth['isAuthenticated'](),controller[_0xb58e('0xb')]);router[_0xb58e('0xc')](_0xb58e('0xa'),auth[_0xb58e('0xd')](),controller[_0xb58e('0xe')]);module[_0xb58e('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 10a19b0..eafa485 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 _0xe706=['STRING','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe706,0xa3));var _0x6e70=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xe706[_0x5805d7];return _0x170fe4;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x5d8c3a,_0x52c448){var _0x5fbe1b=function(_0x5a07b4){while(--_0x5a07b4){_0x5d8c3a['push'](_0x5d8c3a['shift']());}};_0x5fbe1b(++_0x52c448);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 285827c..fc7276a 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 _0xb4d6=['attrHourFormat','value','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','UserProfileResource','end','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','UserProfileSection','update','iframe','attrUrl','attrs','https://','attrPath','clock'];(function(_0x5bfe14,_0x55df2b){var _0x2889e9=function(_0x83cd83){while(--_0x83cd83){_0x5bfe14['push'](_0x5bfe14['shift']());}};_0x2889e9(++_0x55df2b);}(_0xb4d6,0x181));var _0x6b4d=function(_0x438cce,_0x404d76){_0x438cce=_0x438cce-0x0;var _0x31c2f7=_0xb4d6[_0x438cce];return _0x31c2f7;};'use strict';var emlformat=require(_0x6b4d('0x0'));var rimraf=require(_0x6b4d('0x1'));var zipdir=require(_0x6b4d('0x2'));var jsonpatch=require(_0x6b4d('0x3'));var rp=require(_0x6b4d('0x4'));var moment=require(_0x6b4d('0x5'));var BPromise=require(_0x6b4d('0x6'));var Mustache=require('mustache');var util=require(_0x6b4d('0x7'));var path=require('path');var sox=require(_0x6b4d('0x8'));var csv=require(_0x6b4d('0x9'));var ejs=require(_0x6b4d('0xa'));var fs=require('fs');var fs_extra=require(_0x6b4d('0xb'));var _=require(_0x6b4d('0xc'));var squel=require(_0x6b4d('0xd'));var crypto=require(_0x6b4d('0xe'));var jsforce=require(_0x6b4d('0xf'));var deskjs=require(_0x6b4d('0x10'));var toCsv=require(_0x6b4d('0x9'));var querystring=require(_0x6b4d('0x11'));var Papa=require(_0x6b4d('0x12'));var Redis=require(_0x6b4d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6b4d('0x14'));var as=require(_0x6b4d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b4d('0x16'))(_0x6b4d('0x17'));var utils=require(_0x6b4d('0x18'));var config=require(_0x6b4d('0x19'));var licenseUtil=require(_0x6b4d('0x1a'));var db=require(_0x6b4d('0x1b'))['db'];config['redis']=_[_0x6b4d('0x1c')](config[_0x6b4d('0x1d')],{'host':_0x6b4d('0x1e'),'port':0x18eb});var socket=require(_0x6b4d('0x1f'))(new Redis(config['redis']));require(_0x6b4d('0x20'))[_0x6b4d('0x21')](socket);function respondWithStatusCode(_0xf10c7,_0x4cac73){_0x4cac73=_0x4cac73||0xcc;return function(_0x567aaf){if(_0x567aaf){return _0xf10c7[_0x6b4d('0x22')](_0x4cac73);}return _0xf10c7['status'](_0x4cac73)['end']();};}function respondWithResult(_0x291abd,_0x22aa30){_0x22aa30=_0x22aa30||0xc8;return function(_0xf52b9d){if(_0xf52b9d){return _0x291abd[_0x6b4d('0x23')](_0x22aa30)[_0x6b4d('0x24')](_0xf52b9d);}};}function respondWithFilteredResult(_0x345e8a,_0x351076){return function(_0x27239c){if(_0x27239c){var _0x134196=typeof _0x351076[_0x6b4d('0x25')]===_0x6b4d('0x26')&&typeof _0x351076[_0x6b4d('0x27')]===_0x6b4d('0x26');var _0x560161=_0x27239c[_0x6b4d('0x28')];var _0x12e6e6=_0x134196?0x0:_0x351076['offset'];var _0x303a7c=_0x134196?_0x27239c[_0x6b4d('0x28')]:_0x351076['offset']+_0x351076[_0x6b4d('0x27')];var _0x15995c;if(_0x303a7c>=_0x560161){_0x303a7c=_0x560161;_0x15995c=0xc8;}else{_0x15995c=0xce;}_0x345e8a['status'](_0x15995c);return _0x345e8a[_0x6b4d('0x29')]('Content-Range',_0x12e6e6+'-'+_0x303a7c+'/'+_0x560161)[_0x6b4d('0x24')](_0x27239c);}return null;};}function patchUpdates(_0x30376a){return function(_0x334b06){try{jsonpatch[_0x6b4d('0x2a')](_0x334b06,_0x30376a,!![]);}catch(_0x2bc868){return BPromise[_0x6b4d('0x2b')](_0x2bc868);}return _0x334b06['save']();};}function saveUpdates(_0x192944,_0x471a1d){return function(_0x30b6f7){if(_0x30b6f7){return _0x30b6f7['update'](_0x192944)[_0x6b4d('0x2c')](function(_0x2b8a44){return _0x2b8a44;});}return null;};}function removeEntity(_0x5bd20a,_0x33bec3){return function(_0x333522){if(_0x333522){return _0x333522[_0x6b4d('0x2d')]()[_0x6b4d('0x2c')](function(){var _0x547082=_0x333522['get']({'plain':!![]});var _0x209d28='CustomDashboards';return db[_0x6b4d('0x2e')]['destroy']({'where':{'type':_0x209d28,'resourceId':_0x547082['id']}})[_0x6b4d('0x2c')](function(){return _0x333522;});})[_0x6b4d('0x2c')](function(){_0x5bd20a['status'](0xcc)[_0x6b4d('0x2f')]();});}};}function handleEntityNotFound(_0x271041,_0x25fbb6){return function(_0x5ed304){if(!_0x5ed304){_0x271041[_0x6b4d('0x22')](0x194);}return _0x5ed304;};}function handleError(_0x3d5ca0,_0x455450){_0x455450=_0x455450||0x1f4;return function(_0x3e2e28){logger['error'](_0x3e2e28[_0x6b4d('0x30')]);if(_0x3e2e28['name']){delete _0x3e2e28[_0x6b4d('0x31')];}_0x3d5ca0[_0x6b4d('0x23')](_0x455450)[_0x6b4d('0x32')](_0x3e2e28);};}exports[_0x6b4d('0x33')]=function(_0x5270b3,_0x1e6088){var _0x1a8028={},_0x2a40b7={},_0x48fe35={'count':0x0,'rows':[]};var _0x2328e4=_[_0x6b4d('0x34')](db[_0x6b4d('0x35')][_0x6b4d('0x36')],function(_0x41092a){return{'name':_0x41092a[_0x6b4d('0x37')],'type':_0x41092a['type'][_0x6b4d('0x38')]};});_0x2a40b7[_0x6b4d('0x39')]=_[_0x6b4d('0x34')](_0x2328e4,_0x6b4d('0x31'));_0x2a40b7[_0x6b4d('0x3a')]=_[_0x6b4d('0x3b')](_0x5270b3[_0x6b4d('0x3a')]);_0x2a40b7['filters']=_[_0x6b4d('0x3c')](_0x2a40b7[_0x6b4d('0x39')],_0x2a40b7['query']);_0x1a8028[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0x2a40b7['model'],qs[_0x6b4d('0x3e')](_0x5270b3[_0x6b4d('0x3a')][_0x6b4d('0x3e')]));_0x1a8028['attributes']=_0x1a8028[_0x6b4d('0x3d')][_0x6b4d('0x3f')]?_0x1a8028[_0x6b4d('0x3d')]:_0x2a40b7[_0x6b4d('0x39')];if(!_0x5270b3[_0x6b4d('0x3a')][_0x6b4d('0x40')](_0x6b4d('0x41'))){_0x1a8028[_0x6b4d('0x27')]=qs['limit'](_0x5270b3[_0x6b4d('0x3a')]['limit']);_0x1a8028[_0x6b4d('0x25')]=qs[_0x6b4d('0x25')](_0x5270b3[_0x6b4d('0x3a')][_0x6b4d('0x25')]);}_0x1a8028['order']=qs['sort'](_0x5270b3['query'][_0x6b4d('0x42')]);_0x1a8028[_0x6b4d('0x43')]=qs[_0x6b4d('0x44')](_['pick'](_0x5270b3[_0x6b4d('0x3a')],_0x2a40b7[_0x6b4d('0x44')]),_0x2328e4);if(_0x5270b3['query'][_0x6b4d('0x45')]){_0x1a8028[_0x6b4d('0x43')]=_['merge'](_0x1a8028[_0x6b4d('0x43')],{'$or':_[_0x6b4d('0x34')](_0x2328e4,function(_0x12cdff){if(_0x12cdff[_0x6b4d('0x46')]!==_0x6b4d('0x47')){var _0x550367={};_0x550367[_0x12cdff[_0x6b4d('0x31')]]={'$like':'%'+_0x5270b3['query']['filter']+'%'};return _0x550367;}})});}_0x1a8028=_[_0x6b4d('0x48')]({},_0x1a8028,_0x5270b3['options']);var _0x12fead={'where':_0x1a8028[_0x6b4d('0x43')]};return db[_0x6b4d('0x35')][_0x6b4d('0x28')](_0x12fead)[_0x6b4d('0x2c')](function(_0x2a286b){_0x48fe35[_0x6b4d('0x28')]=_0x2a286b;if(_0x5270b3['query'][_0x6b4d('0x49')]){_0x1a8028[_0x6b4d('0x4a')]=[{'all':!![]}];}return db['Dashboard'][_0x6b4d('0x4b')](_0x1a8028);})[_0x6b4d('0x2c')](function(_0x3a0285){_0x48fe35[_0x6b4d('0x4c')]=_0x3a0285;return _0x48fe35;})[_0x6b4d('0x2c')](respondWithFilteredResult(_0x1e6088,_0x1a8028))[_0x6b4d('0x4d')](handleError(_0x1e6088,null));};exports[_0x6b4d('0x4e')]=function(_0x3b610a,_0x4e2c9e){var _0x2a00ef={'raw':![],'where':{'id':_0x3b610a[_0x6b4d('0x4f')]['id']}},_0xd4b23b={};_0xd4b23b[_0x6b4d('0x39')]=_[_0x6b4d('0x3b')](db[_0x6b4d('0x35')][_0x6b4d('0x36')]);_0xd4b23b['query']=_[_0x6b4d('0x3b')](_0x3b610a[_0x6b4d('0x3a')]);_0xd4b23b['filters']=_[_0x6b4d('0x3c')](_0xd4b23b[_0x6b4d('0x39')],_0xd4b23b['query']);_0x2a00ef[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0xd4b23b[_0x6b4d('0x39')],qs[_0x6b4d('0x3e')](_0x3b610a[_0x6b4d('0x3a')][_0x6b4d('0x3e')]));_0x2a00ef['attributes']=_0x2a00ef[_0x6b4d('0x3d')][_0x6b4d('0x3f')]?_0x2a00ef[_0x6b4d('0x3d')]:_0xd4b23b[_0x6b4d('0x39')];if(_0x3b610a['query'][_0x6b4d('0x49')]){_0x2a00ef[_0x6b4d('0x4a')]=[{'all':!![]}];}_0x2a00ef=_['merge']({},_0x2a00ef,_0x3b610a[_0x6b4d('0x50')]);return db[_0x6b4d('0x35')][_0x6b4d('0x51')](_0x2a00ef)[_0x6b4d('0x2c')](handleEntityNotFound(_0x4e2c9e,null))['then'](respondWithResult(_0x4e2c9e,null))[_0x6b4d('0x4d')](handleError(_0x4e2c9e,null));};exports['create']=function(_0x2a9062,_0x4453c4){return db['Dashboard'][_0x6b4d('0x52')](_0x2a9062[_0x6b4d('0x53')],{})[_0x6b4d('0x2c')](function(_0x5640ac){var _0xa8a540=_0x2a9062[_0x6b4d('0x54')][_0x6b4d('0x55')]({'plain':!![]});if(!_0xa8a540)throw new Error(_0x6b4d('0x56'));if(_0xa8a540[_0x6b4d('0x57')]==='user'){var _0x7f492c=_0x5640ac['get']({'plain':!![]});var _0x267204=_0x6b4d('0x58');return db['UserProfileSection'][_0x6b4d('0x51')]({'where':{'name':_0x267204,'userProfileId':_0xa8a540[_0x6b4d('0x59')]},'raw':!![]})[_0x6b4d('0x2c')](function(_0x38fcf1){if(_0x38fcf1&&_0x38fcf1[_0x6b4d('0x5a')]===0x0){return db[_0x6b4d('0x2e')][_0x6b4d('0x52')]({'name':_0x7f492c[_0x6b4d('0x31')],'resourceId':_0x7f492c['id'],'type':_0x38fcf1[_0x6b4d('0x31')],'sectionId':_0x38fcf1['id']},{})[_0x6b4d('0x2c')](function(){return _0x5640ac;});}else{return _0x5640ac;}})[_0x6b4d('0x4d')](function(_0x1bf3a0){logger[_0x6b4d('0x5b')](_0x6b4d('0x5c'),_0x1bf3a0);throw _0x1bf3a0;});}return _0x5640ac;})[_0x6b4d('0x2c')](respondWithResult(_0x4453c4,0xc9))[_0x6b4d('0x4d')](handleError(_0x4453c4,null));};exports[_0x6b4d('0x5d')]=function(_0x2297a6,_0x524410){var _0x428e3f={'where':{'id':_0x2297a6[_0x6b4d('0x4f')]['id']}},_0x1d9fbc={};_0x1d9fbc[_0x6b4d('0x39')]=_[_0x6b4d('0x3b')](db[_0x6b4d('0x35')][_0x6b4d('0x36')]);_0x428e3f[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0x1d9fbc['model'],qs['fields'](_0x2297a6[_0x6b4d('0x3a')][_0x6b4d('0x3e')]));_0x428e3f[_0x6b4d('0x3d')]=_0x428e3f[_0x6b4d('0x3d')][_0x6b4d('0x3f')]?_0x428e3f[_0x6b4d('0x3d')]:_0x1d9fbc[_0x6b4d('0x39')];if(_0x2297a6[_0x6b4d('0x3a')]['includeAll']){_0x428e3f[_0x6b4d('0x4a')]=[{'all':!![]}];}_0x428e3f=_['merge']({},_0x428e3f,_0x2297a6['options']);return db['Dashboard'][_0x6b4d('0x51')](_0x428e3f)[_0x6b4d('0x2c')](handleEntityNotFound(_0x524410,null))[_0x6b4d('0x2c')](function(_0xefe6c0){if(_0xefe6c0){var _0x42c381=_0xefe6c0[_0x6b4d('0x55')]({'plain':!![]});_0x42c381=qs['omit'](_0x42c381,['id',_0x6b4d('0x5e'),'updatedAt']);_0x2297a6[_0x6b4d('0x53')]=_['omit'](_0x2297a6['body'],['id',_0x6b4d('0x5e'),'updatedAt']);return db[_0x6b4d('0x35')]['create'](_['merge'](_0x42c381,_0x2297a6['body']),{'include':_0x2297a6[_0x6b4d('0x3a')][_0x6b4d('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x56217a){var _0x5ab1dc=_0x2297a6['user'][_0x6b4d('0x55')]({'plain':!![]});if(!_0x5ab1dc)throw new Error(_0x6b4d('0x56'));if(_0x5ab1dc[_0x6b4d('0x57')]==='user'){var _0x98abd9=_0x56217a[_0x6b4d('0x55')]({'plain':!![]});var _0x1c4ba4=_0x6b4d('0x58');return db[_0x6b4d('0x5f')]['find']({'where':{'name':_0x1c4ba4,'userProfileId':_0x5ab1dc[_0x6b4d('0x59')]},'raw':!![]})[_0x6b4d('0x2c')](function(_0x450547){if(_0x450547&&_0x450547['autoAssociation']===0x0){return db[_0x6b4d('0x2e')]['create']({'name':_0x98abd9[_0x6b4d('0x31')],'resourceId':_0x98abd9['id'],'type':_0x450547['name'],'sectionId':_0x450547['id']},{})['then'](function(){return _0x56217a;});}else{return _0x56217a;}})['catch'](function(_0x493b09){logger[_0x6b4d('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x493b09);throw _0x493b09;});}return _0x56217a;});}})['then'](respondWithResult(_0x524410,0xc9))[_0x6b4d('0x4d')](handleError(_0x524410,null));};exports[_0x6b4d('0x60')]=function(_0x309cfd,_0x37dc5d){if(_0x309cfd[_0x6b4d('0x53')]['id']){delete _0x309cfd[_0x6b4d('0x53')]['id'];}return db[_0x6b4d('0x35')][_0x6b4d('0x51')]({'where':{'id':_0x309cfd['params']['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x37dc5d,null))[_0x6b4d('0x2c')](saveUpdates(_0x309cfd[_0x6b4d('0x53')],null))[_0x6b4d('0x2c')](respondWithResult(_0x37dc5d,null))['catch'](handleError(_0x37dc5d,null));};exports[_0x6b4d('0x2d')]=function(_0x2cc7ce,_0x1c720f){return db[_0x6b4d('0x35')][_0x6b4d('0x51')]({'where':{'id':_0x2cc7ce[_0x6b4d('0x4f')]['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x1c720f,null))[_0x6b4d('0x2c')](removeEntity(_0x1c720f,null))[_0x6b4d('0x4d')](handleError(_0x1c720f,null));};function widgetAttributes(_0x4b6f71){try{switch(_0x4b6f71['type']){case _0x6b4d('0x61'):return[{'name':_0x6b4d('0x62'),'value':_0x4b6f71[_0x6b4d('0x62')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71['attrs'][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0]['value']:undefined)||_0x6b4d('0x64')}];case'custom':return[{'name':_0x6b4d('0x65'),'value':_0x4b6f71[_0x6b4d('0x65')]||(_0x4b6f71['attrs']&&_0x4b6f71['attrs'][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0]['value']:undefined)||''}];case _0x6b4d('0x66'):return[{'name':_0x6b4d('0x67'),'value':_0x4b6f71['attrHourFormat']||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71['attrs'][0x0][_0x6b4d('0x68')]:undefined)||'HH:mm:ss'},{'name':_0x6b4d('0x69'),'value':_0x4b6f71[_0x6b4d('0x69')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71['attrs'][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1][_0x6b4d('0x68')]:undefined)||'0.00'},{'name':_0x6b4d('0x6a'),'value':_0x4b6f71[_0x6b4d('0x6a')]||(_0x4b6f71['attrs']&&_0x4b6f71[_0x6b4d('0x63')][0x2]?_0x4b6f71['attrs'][0x2][_0x6b4d('0x68')]:undefined)||0xc}];case'counter':return[{'name':_0x6b4d('0x6b'),'value':_0x4b6f71[_0x6b4d('0x6b')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x6b4d('0x6c'),'value':_0x4b6f71[_0x6b4d('0x6c')]||(_0x4b6f71['attrs']&&_0x4b6f71[_0x6b4d('0x63')][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1]['value']:undefined)||[]},{'name':_0x6b4d('0x6a'),'value':_0x4b6f71[_0x6b4d('0x6a')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71['attrs'][0x2]?_0x4b6f71[_0x6b4d('0x63')][0x2][_0x6b4d('0x68')]:undefined)||0x14}];case _0x6b4d('0x6d'):case _0x6b4d('0x6e'):return[{'name':_0x6b4d('0x6f'),'value':_0x4b6f71[_0x6b4d('0x6f')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0][_0x6b4d('0x68')]:undefined)||'total'},{'name':_0x6b4d('0x70'),'value':_0x4b6f71[_0x6b4d('0x70')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1][_0x6b4d('0x68')]:undefined)||null},{'name':'attrSerie3','value':_0x4b6f71['attrSerie3']||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x2]?_0x4b6f71[_0x6b4d('0x63')][0x2][_0x6b4d('0x68')]:undefined)||null},{'name':_0x6b4d('0x6c'),'value':_0x4b6f71[_0x6b4d('0x6c')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x3]?_0x4b6f71[_0x6b4d('0x63')][0x3][_0x6b4d('0x68')]:undefined)||[]}];case _0x6b4d('0x71'):return[{'name':_0x6b4d('0x72'),'type':_0x4b6f71[_0x6b4d('0x73')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71['attrs'][0x0][_0x6b4d('0x46')]:undefined)||null,'value':_0x4b6f71[_0x6b4d('0x72')]||(_0x4b6f71['attrs']&&_0x4b6f71['attrs'][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0][_0x6b4d('0x68')]:undefined)||null},{'name':_0x6b4d('0x74'),'value':_0x4b6f71[_0x6b4d('0x74')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1][_0x6b4d('0x68')]:undefined)||0x0}];default:return[];}}catch(_0x58d80b){logger[_0x6b4d('0x5b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x58d80b));return[];}}exports[_0x6b4d('0x75')]=function(_0x3655f7,_0x48e653,_0x417bb7){if(_0x3655f7[_0x6b4d('0x53')]['id']){delete _0x3655f7[_0x6b4d('0x53')]['id'];}return db[_0x6b4d('0x35')][_0x6b4d('0x51')]({'where':{'id':_0x3655f7['params']['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x48e653,null))[_0x6b4d('0x2c')](function(_0x375362){if(_0x375362){_0x3655f7[_0x6b4d('0x53')][_0x6b4d('0x76')]=_0x375362['id'];_0x3655f7[_0x6b4d('0x53')][_0x6b4d('0x63')]=widgetAttributes(_0x3655f7['body']);return db[_0x6b4d('0x77')][_0x6b4d('0x52')](_0x3655f7[_0x6b4d('0x53')]);}})[_0x6b4d('0x2c')](respondWithResult(_0x48e653,null))[_0x6b4d('0x4d')](handleError(_0x48e653,null));};exports[_0x6b4d('0x78')]=function(_0xd1167c,_0x42e5f4,_0x3a43f3){var _0x46401a={};var _0xd8a99={};var _0x269a26;var _0x5c3771;return db[_0x6b4d('0x35')][_0x6b4d('0x79')]({'where':{'id':_0xd1167c['params']['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x42e5f4,null))['then'](function(_0x482125){if(_0x482125){_0x269a26=_0x482125;_0xd8a99[_0x6b4d('0x39')]=_['keys'](db['DashboardItem'][_0x6b4d('0x36')]);_0xd8a99[_0x6b4d('0x3a')]=_['keys'](_0xd1167c[_0x6b4d('0x3a')]);_0xd8a99[_0x6b4d('0x44')]=_[_0x6b4d('0x3c')](_0xd8a99[_0x6b4d('0x39')],_0xd8a99[_0x6b4d('0x3a')]);_0x46401a[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0xd8a99[_0x6b4d('0x39')],qs[_0x6b4d('0x3e')](_0xd1167c['query'][_0x6b4d('0x3e')]));_0x46401a[_0x6b4d('0x3d')]=_0x46401a['attributes'][_0x6b4d('0x3f')]?_0x46401a['attributes']:_0xd8a99['model'];_0x46401a['order']=qs[_0x6b4d('0x42')](_0xd1167c[_0x6b4d('0x3a')][_0x6b4d('0x42')]);_0x46401a[_0x6b4d('0x43')]=qs[_0x6b4d('0x44')](_['pick'](_0xd1167c[_0x6b4d('0x3a')],_0xd8a99['filters']));if(_0xd1167c[_0x6b4d('0x3a')]['filter']){_0x46401a[_0x6b4d('0x43')]=_[_0x6b4d('0x48')](_0x46401a[_0x6b4d('0x43')],{'$or':_[_0x6b4d('0x34')](_0x46401a[_0x6b4d('0x3d')],function(_0x241c74){var _0x6728df={};_0x6728df[_0x241c74]={'$like':'%'+_0xd1167c[_0x6b4d('0x3a')]['filter']+'%'};return _0x6728df;})});}_0x46401a=_[_0x6b4d('0x48')]({},_0x46401a,_0xd1167c[_0x6b4d('0x50')]);return _0x269a26['getItems'](_0x46401a);}})['then'](function(_0x21b3b5){if(_0x21b3b5){_0x5c3771=_0x21b3b5[_0x6b4d('0x3f')];if(!_0xd1167c['query'][_0x6b4d('0x40')](_0x6b4d('0x41'))){_0x46401a[_0x6b4d('0x27')]=qs[_0x6b4d('0x27')](_0xd1167c['query']['limit']);_0x46401a['offset']=qs[_0x6b4d('0x25')](_0xd1167c['query'][_0x6b4d('0x25')]);}return _0x269a26[_0x6b4d('0x78')](_0x46401a);}})[_0x6b4d('0x2c')](function(_0x155e6a){if(_0x155e6a){return _0x155e6a?{'count':_0x5c3771,'rows':_0x155e6a}:null;}})[_0x6b4d('0x2c')](respondWithResult(_0x42e5f4,null))[_0x6b4d('0x4d')](handleError(_0x42e5f4,null));}; \ No newline at end of file +var _0xc83c=['reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','merge','filter','Dashboard','includeAll','findAll','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','body','autoAssociation','iframe','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./dashboard.socket','register','sendStatus','end','undefined','count','offset','limit','status','set','Content-Range','apply'];(function(_0x497fc7,_0xd67660){var _0x426350=function(_0x65858){while(--_0x65858){_0x497fc7['push'](_0x497fc7['shift']());}};_0x426350(++_0xd67660);}(_0xc83c,0x1ac));var _0xcc83=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xc83c[_0x313c96];return _0x522f53;};'use strict';var emlformat=require(_0xcc83('0x0'));var rimraf=require(_0xcc83('0x1'));var zipdir=require(_0xcc83('0x2'));var jsonpatch=require(_0xcc83('0x3'));var rp=require(_0xcc83('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcc83('0x5'));var util=require('util');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(_0xcc83('0x6'));var squel=require(_0xcc83('0x7'));var crypto=require('crypto');var jsforce=require(_0xcc83('0x8'));var deskjs=require(_0xcc83('0x9'));var toCsv=require(_0xcc83('0xa'));var querystring=require('querystring');var Papa=require(_0xcc83('0xb'));var Redis=require(_0xcc83('0xc'));var authService=require(_0xcc83('0xd'));var qs=require(_0xcc83('0xe'));var as=require(_0xcc83('0xf'));var hardwareService=require(_0xcc83('0x10'));var logger=require(_0xcc83('0x11'))('api');var utils=require(_0xcc83('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcc83('0x13'));var db=require(_0xcc83('0x14'))['db'];config['redis']=_[_0xcc83('0x15')](config[_0xcc83('0x16')],{'host':_0xcc83('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc83('0x16')]));require(_0xcc83('0x18'))[_0xcc83('0x19')](socket);function respondWithStatusCode(_0x4f17ab,_0x22a4c5){_0x22a4c5=_0x22a4c5||0xcc;return function(_0x2f6dcb){if(_0x2f6dcb){return _0x4f17ab[_0xcc83('0x1a')](_0x22a4c5);}return _0x4f17ab['status'](_0x22a4c5)[_0xcc83('0x1b')]();};}function respondWithResult(_0x111a08,_0x366911){_0x366911=_0x366911||0xc8;return function(_0x67dc67){if(_0x67dc67){return _0x111a08['status'](_0x366911)['json'](_0x67dc67);}};}function respondWithFilteredResult(_0xf2cb8b,_0x553918){return function(_0x5f0bdf){if(_0x5f0bdf){var _0x2492ce=typeof _0x553918['offset']===_0xcc83('0x1c')&&typeof _0x553918['limit']===_0xcc83('0x1c');var _0x45d615=_0x5f0bdf[_0xcc83('0x1d')];var _0x28c379=_0x2492ce?0x0:_0x553918[_0xcc83('0x1e')];var _0x4b5e1d=_0x2492ce?_0x5f0bdf[_0xcc83('0x1d')]:_0x553918[_0xcc83('0x1e')]+_0x553918[_0xcc83('0x1f')];var _0x1318d2;if(_0x4b5e1d>=_0x45d615){_0x4b5e1d=_0x45d615;_0x1318d2=0xc8;}else{_0x1318d2=0xce;}_0xf2cb8b[_0xcc83('0x20')](_0x1318d2);return _0xf2cb8b[_0xcc83('0x21')](_0xcc83('0x22'),_0x28c379+'-'+_0x4b5e1d+'/'+_0x45d615)['json'](_0x5f0bdf);}return null;};}function patchUpdates(_0x5a6272){return function(_0x44fa95){try{jsonpatch[_0xcc83('0x23')](_0x44fa95,_0x5a6272,!![]);}catch(_0x18bc4d){return BPromise[_0xcc83('0x24')](_0x18bc4d);}return _0x44fa95[_0xcc83('0x25')]();};}function saveUpdates(_0x10efc9,_0x8f9815){return function(_0x4bb7cc){if(_0x4bb7cc){return _0x4bb7cc[_0xcc83('0x26')](_0x10efc9)[_0xcc83('0x27')](function(_0x2b87ac){return _0x2b87ac;});}return null;};}function removeEntity(_0x1b54ca,_0x18393b){return function(_0x225d99){if(_0x225d99){return _0x225d99[_0xcc83('0x28')]()['then'](function(){var _0x27b908=_0x225d99[_0xcc83('0x29')]({'plain':!![]});var _0x4c629b=_0xcc83('0x2a');return db[_0xcc83('0x2b')][_0xcc83('0x28')]({'where':{'type':_0x4c629b,'resourceId':_0x27b908['id']}})['then'](function(){return _0x225d99;});})[_0xcc83('0x27')](function(){_0x1b54ca['status'](0xcc)[_0xcc83('0x1b')]();});}};}function handleEntityNotFound(_0x1f423f,_0x3208d5){return function(_0x5bb978){if(!_0x5bb978){_0x1f423f['sendStatus'](0x194);}return _0x5bb978;};}function handleError(_0x235afd,_0x4d6c2d){_0x4d6c2d=_0x4d6c2d||0x1f4;return function(_0x5d2f2c){logger['error'](_0x5d2f2c[_0xcc83('0x2c')]);if(_0x5d2f2c['name']){delete _0x5d2f2c[_0xcc83('0x2d')];}_0x235afd[_0xcc83('0x20')](_0x4d6c2d)['send'](_0x5d2f2c);};}exports[_0xcc83('0x2e')]=function(_0x2bcd1a,_0x340062){var _0x2a8b37={},_0x4ca389={},_0x2128b8={'count':0x0,'rows':[]};var _0x4586da=_[_0xcc83('0x2f')](db['Dashboard'][_0xcc83('0x30')],function(_0x2cee9a){return{'name':_0x2cee9a[_0xcc83('0x31')],'type':_0x2cee9a[_0xcc83('0x32')][_0xcc83('0x33')]};});_0x4ca389[_0xcc83('0x34')]=_[_0xcc83('0x2f')](_0x4586da,_0xcc83('0x2d'));_0x4ca389[_0xcc83('0x35')]=_[_0xcc83('0x36')](_0x2bcd1a[_0xcc83('0x35')]);_0x4ca389[_0xcc83('0x37')]=_[_0xcc83('0x38')](_0x4ca389['model'],_0x4ca389[_0xcc83('0x35')]);_0x2a8b37['attributes']=_['intersection'](_0x4ca389[_0xcc83('0x34')],qs['fields'](_0x2bcd1a['query'][_0xcc83('0x39')]));_0x2a8b37['attributes']=_0x2a8b37[_0xcc83('0x3a')][_0xcc83('0x3b')]?_0x2a8b37[_0xcc83('0x3a')]:_0x4ca389[_0xcc83('0x34')];if(!_0x2bcd1a[_0xcc83('0x35')][_0xcc83('0x3c')](_0xcc83('0x3d'))){_0x2a8b37['limit']=qs[_0xcc83('0x1f')](_0x2bcd1a[_0xcc83('0x35')][_0xcc83('0x1f')]);_0x2a8b37[_0xcc83('0x1e')]=qs[_0xcc83('0x1e')](_0x2bcd1a[_0xcc83('0x35')][_0xcc83('0x1e')]);}_0x2a8b37['order']=qs['sort'](_0x2bcd1a['query']['sort']);_0x2a8b37[_0xcc83('0x3e')]=qs[_0xcc83('0x37')](_[_0xcc83('0x3f')](_0x2bcd1a[_0xcc83('0x35')],_0x4ca389[_0xcc83('0x37')]),_0x4586da);if(_0x2bcd1a[_0xcc83('0x35')]['filter']){_0x2a8b37['where']=_[_0xcc83('0x40')](_0x2a8b37['where'],{'$or':_[_0xcc83('0x2f')](_0x4586da,function(_0x54db77){if(_0x54db77[_0xcc83('0x32')]!=='VIRTUAL'){var _0x5cd396={};_0x5cd396[_0x54db77['name']]={'$like':'%'+_0x2bcd1a['query'][_0xcc83('0x41')]+'%'};return _0x5cd396;}})});}_0x2a8b37=_[_0xcc83('0x40')]({},_0x2a8b37,_0x2bcd1a['options']);var _0x4b9c26={'where':_0x2a8b37[_0xcc83('0x3e')]};return db[_0xcc83('0x42')][_0xcc83('0x1d')](_0x4b9c26)[_0xcc83('0x27')](function(_0x239fd6){_0x2128b8[_0xcc83('0x1d')]=_0x239fd6;if(_0x2bcd1a[_0xcc83('0x35')][_0xcc83('0x43')]){_0x2a8b37['include']=[{'all':!![]}];}return db[_0xcc83('0x42')][_0xcc83('0x44')](_0x2a8b37);})[_0xcc83('0x27')](function(_0xb7709a){_0x2128b8['rows']=_0xb7709a;return _0x2128b8;})[_0xcc83('0x27')](respondWithFilteredResult(_0x340062,_0x2a8b37))[_0xcc83('0x45')](handleError(_0x340062,null));};exports[_0xcc83('0x46')]=function(_0x39f330,_0xad3ba3){var _0x1d0354={'raw':![],'where':{'id':_0x39f330[_0xcc83('0x47')]['id']}},_0x5e3f92={};_0x5e3f92[_0xcc83('0x34')]=_[_0xcc83('0x36')](db[_0xcc83('0x42')][_0xcc83('0x30')]);_0x5e3f92[_0xcc83('0x35')]=_[_0xcc83('0x36')](_0x39f330[_0xcc83('0x35')]);_0x5e3f92[_0xcc83('0x37')]=_[_0xcc83('0x38')](_0x5e3f92['model'],_0x5e3f92[_0xcc83('0x35')]);_0x1d0354[_0xcc83('0x3a')]=_[_0xcc83('0x38')](_0x5e3f92[_0xcc83('0x34')],qs['fields'](_0x39f330['query'][_0xcc83('0x39')]));_0x1d0354['attributes']=_0x1d0354[_0xcc83('0x3a')][_0xcc83('0x3b')]?_0x1d0354[_0xcc83('0x3a')]:_0x5e3f92[_0xcc83('0x34')];if(_0x39f330[_0xcc83('0x35')]['includeAll']){_0x1d0354['include']=[{'all':!![]}];}_0x1d0354=_['merge']({},_0x1d0354,_0x39f330[_0xcc83('0x48')]);return db['Dashboard']['find'](_0x1d0354)[_0xcc83('0x27')](handleEntityNotFound(_0xad3ba3,null))[_0xcc83('0x27')](respondWithResult(_0xad3ba3,null))[_0xcc83('0x45')](handleError(_0xad3ba3,null));};exports['create']=function(_0x221d49,_0x3b45de){return db['Dashboard'][_0xcc83('0x49')](_0x221d49['body'],{})[_0xcc83('0x27')](function(_0x53c5d1){var _0x513abe=_0x221d49[_0xcc83('0x4a')][_0xcc83('0x29')]({'plain':!![]});if(!_0x513abe)throw new Error(_0xcc83('0x4b'));if(_0x513abe['role']===_0xcc83('0x4a')){var _0x37cbcc=_0x53c5d1[_0xcc83('0x29')]({'plain':!![]});var _0x5ccf43=_0xcc83('0x2a');return db[_0xcc83('0x4c')][_0xcc83('0x4d')]({'where':{'name':_0x5ccf43,'userProfileId':_0x513abe[_0xcc83('0x4e')]},'raw':!![]})[_0xcc83('0x27')](function(_0x264b67){if(_0x264b67&&_0x264b67['autoAssociation']===0x0){return db[_0xcc83('0x2b')][_0xcc83('0x49')]({'name':_0x37cbcc[_0xcc83('0x2d')],'resourceId':_0x37cbcc['id'],'type':_0x264b67[_0xcc83('0x2d')],'sectionId':_0x264b67['id']},{})[_0xcc83('0x27')](function(){return _0x53c5d1;});}else{return _0x53c5d1;}})[_0xcc83('0x45')](function(_0x1adf63){logger['error'](_0xcc83('0x4f'),_0x1adf63);throw _0x1adf63;});}return _0x53c5d1;})[_0xcc83('0x27')](respondWithResult(_0x3b45de,0xc9))[_0xcc83('0x45')](handleError(_0x3b45de,null));};exports[_0xcc83('0x50')]=function(_0x43e761,_0x448d23){var _0x1f84c4={'where':{'id':_0x43e761[_0xcc83('0x47')]['id']}},_0x5a2ad0={};_0x5a2ad0['model']=_[_0xcc83('0x36')](db[_0xcc83('0x42')][_0xcc83('0x30')]);_0x1f84c4['attributes']=_[_0xcc83('0x38')](_0x5a2ad0['model'],qs[_0xcc83('0x39')](_0x43e761[_0xcc83('0x35')]['fields']));_0x1f84c4[_0xcc83('0x3a')]=_0x1f84c4[_0xcc83('0x3a')][_0xcc83('0x3b')]?_0x1f84c4['attributes']:_0x5a2ad0[_0xcc83('0x34')];if(_0x43e761['query'][_0xcc83('0x43')]){_0x1f84c4[_0xcc83('0x51')]=[{'all':!![]}];}_0x1f84c4=_[_0xcc83('0x40')]({},_0x1f84c4,_0x43e761[_0xcc83('0x48')]);return db['Dashboard'][_0xcc83('0x4d')](_0x1f84c4)['then'](handleEntityNotFound(_0x448d23,null))[_0xcc83('0x27')](function(_0x4911a4){if(_0x4911a4){var _0x321c9f=_0x4911a4[_0xcc83('0x29')]({'plain':!![]});_0x321c9f=qs[_0xcc83('0x52')](_0x321c9f,['id',_0xcc83('0x53'),_0xcc83('0x54')]);_0x43e761[_0xcc83('0x55')]=_[_0xcc83('0x52')](_0x43e761['body'],['id','createdAt',_0xcc83('0x54')]);return db[_0xcc83('0x42')][_0xcc83('0x49')](_[_0xcc83('0x40')](_0x321c9f,_0x43e761['body']),{'include':_0x43e761[_0xcc83('0x35')][_0xcc83('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x456e6a){var _0x1a1a11=_0x43e761[_0xcc83('0x4a')]['get']({'plain':!![]});if(!_0x1a1a11)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a1a11['role']===_0xcc83('0x4a')){var _0x3e0c10=_0x456e6a[_0xcc83('0x29')]({'plain':!![]});var _0x5f56e2=_0xcc83('0x2a');return db[_0xcc83('0x4c')][_0xcc83('0x4d')]({'where':{'name':_0x5f56e2,'userProfileId':_0x1a1a11[_0xcc83('0x4e')]},'raw':!![]})[_0xcc83('0x27')](function(_0x322049){if(_0x322049&&_0x322049[_0xcc83('0x56')]===0x0){return db[_0xcc83('0x2b')]['create']({'name':_0x3e0c10['name'],'resourceId':_0x3e0c10['id'],'type':_0x322049['name'],'sectionId':_0x322049['id']},{})[_0xcc83('0x27')](function(){return _0x456e6a;});}else{return _0x456e6a;}})[_0xcc83('0x45')](function(_0x3ffbfb){logger['error'](_0xcc83('0x4f'),_0x3ffbfb);throw _0x3ffbfb;});}return _0x456e6a;});}})['then'](respondWithResult(_0x448d23,0xc9))[_0xcc83('0x45')](handleError(_0x448d23,null));};exports['update']=function(_0x1ab0df,_0xbe444a){if(_0x1ab0df[_0xcc83('0x55')]['id']){delete _0x1ab0df[_0xcc83('0x55')]['id'];}return db['Dashboard'][_0xcc83('0x4d')]({'where':{'id':_0x1ab0df[_0xcc83('0x47')]['id']}})[_0xcc83('0x27')](handleEntityNotFound(_0xbe444a,null))[_0xcc83('0x27')](saveUpdates(_0x1ab0df[_0xcc83('0x55')],null))['then'](respondWithResult(_0xbe444a,null))[_0xcc83('0x45')](handleError(_0xbe444a,null));};exports['destroy']=function(_0x256911,_0x1cf6b5){return db[_0xcc83('0x42')][_0xcc83('0x4d')]({'where':{'id':_0x256911[_0xcc83('0x47')]['id']}})[_0xcc83('0x27')](handleEntityNotFound(_0x1cf6b5,null))['then'](removeEntity(_0x1cf6b5,null))[_0xcc83('0x45')](handleError(_0x1cf6b5,null));};function widgetAttributes(_0x53d254){try{switch(_0x53d254['type']){case _0xcc83('0x57'):return[{'name':'attrUrl','value':_0x53d254['attrUrl']||(_0x53d254[_0xcc83('0x58')]&&_0x53d254['attrs'][0x0]?_0x53d254['attrs'][0x0][_0xcc83('0x59')]:undefined)||_0xcc83('0x5a')}];case'custom':return[{'name':_0xcc83('0x5b'),'value':_0x53d254[_0xcc83('0x5b')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x0]?_0x53d254[_0xcc83('0x58')][0x0][_0xcc83('0x59')]:undefined)||''}];case _0xcc83('0x5c'):return[{'name':_0xcc83('0x5d'),'value':_0x53d254[_0xcc83('0x5d')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x0]?_0x53d254['attrs'][0x0][_0xcc83('0x59')]:undefined)||_0xcc83('0x5e')},{'name':_0xcc83('0x5f'),'value':_0x53d254[_0xcc83('0x5f')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254['attrs'][0x1]?_0x53d254['attrs'][0x1]['value']:undefined)||_0xcc83('0x60')},{'name':_0xcc83('0x61'),'value':_0x53d254[_0xcc83('0x61')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x2]?_0x53d254[_0xcc83('0x58')][0x2][_0xcc83('0x59')]:undefined)||0xc}];case _0xcc83('0x62'):return[{'name':_0xcc83('0x63'),'value':_0x53d254[_0xcc83('0x63')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x0]?_0x53d254[_0xcc83('0x58')][0x0][_0xcc83('0x59')]:undefined)||_0xcc83('0x64')},{'name':_0xcc83('0x65'),'value':_0x53d254[_0xcc83('0x65')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x1]?_0x53d254[_0xcc83('0x58')][0x1][_0xcc83('0x59')]:undefined)||[]},{'name':_0xcc83('0x61'),'value':_0x53d254[_0xcc83('0x61')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x2]?_0x53d254[_0xcc83('0x58')][0x2]['value']:undefined)||0x14}];case _0xcc83('0x66'):case _0xcc83('0x67'):return[{'name':_0xcc83('0x68'),'value':_0x53d254['attrSerie1']||(_0x53d254['attrs']&&_0x53d254[_0xcc83('0x58')][0x0]?_0x53d254[_0xcc83('0x58')][0x0][_0xcc83('0x59')]:undefined)||_0xcc83('0x64')},{'name':'attrSerie2','value':_0x53d254[_0xcc83('0x69')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x1]?_0x53d254[_0xcc83('0x58')][0x1][_0xcc83('0x59')]:undefined)||null},{'name':'attrSerie3','value':_0x53d254[_0xcc83('0x6a')]||(_0x53d254['attrs']&&_0x53d254[_0xcc83('0x58')][0x2]?_0x53d254[_0xcc83('0x58')][0x2][_0xcc83('0x59')]:undefined)||null},{'name':_0xcc83('0x65'),'value':_0x53d254[_0xcc83('0x65')]||(_0x53d254['attrs']&&_0x53d254[_0xcc83('0x58')][0x3]?_0x53d254[_0xcc83('0x58')][0x3]['value']:undefined)||[]}];case _0xcc83('0x6b'):return[{'name':_0xcc83('0x6c'),'type':_0x53d254['reportType']||(_0x53d254['attrs']&&_0x53d254[_0xcc83('0x58')][0x0]?_0x53d254[_0xcc83('0x58')][0x0][_0xcc83('0x32')]:undefined)||null,'value':_0x53d254[_0xcc83('0x6c')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x0]?_0x53d254[_0xcc83('0x58')][0x0][_0xcc83('0x59')]:undefined)||null},{'name':_0xcc83('0x6d'),'value':_0x53d254[_0xcc83('0x6d')]||(_0x53d254[_0xcc83('0x58')]&&_0x53d254[_0xcc83('0x58')][0x1]?_0x53d254[_0xcc83('0x58')][0x1][_0xcc83('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x281b4c){logger['error'](_0xcc83('0x6e'),JSON[_0xcc83('0x6f')](_0x281b4c));return[];}}exports['addItem']=function(_0x526e00,_0x21358b,_0x58f3cf){if(_0x526e00['body']['id']){delete _0x526e00[_0xcc83('0x55')]['id'];}return db[_0xcc83('0x42')]['find']({'where':{'id':_0x526e00['params']['id']}})[_0xcc83('0x27')](handleEntityNotFound(_0x21358b,null))[_0xcc83('0x27')](function(_0x4cc2c7){if(_0x4cc2c7){_0x526e00['body']['DashboardId']=_0x4cc2c7['id'];_0x526e00[_0xcc83('0x55')][_0xcc83('0x58')]=widgetAttributes(_0x526e00[_0xcc83('0x55')]);return db[_0xcc83('0x70')]['create'](_0x526e00['body']);}})[_0xcc83('0x27')](respondWithResult(_0x21358b,null))[_0xcc83('0x45')](handleError(_0x21358b,null));};exports[_0xcc83('0x71')]=function(_0x3e4bfa,_0x5b7448,_0xf0d704){var _0x3553a8={};var _0x3f42cd={};var _0x35c435;var _0x128bf0;return db[_0xcc83('0x42')][_0xcc83('0x72')]({'where':{'id':_0x3e4bfa[_0xcc83('0x47')]['id']}})[_0xcc83('0x27')](handleEntityNotFound(_0x5b7448,null))[_0xcc83('0x27')](function(_0x1265c3){if(_0x1265c3){_0x35c435=_0x1265c3;_0x3f42cd['model']=_[_0xcc83('0x36')](db[_0xcc83('0x70')][_0xcc83('0x30')]);_0x3f42cd[_0xcc83('0x35')]=_[_0xcc83('0x36')](_0x3e4bfa[_0xcc83('0x35')]);_0x3f42cd[_0xcc83('0x37')]=_[_0xcc83('0x38')](_0x3f42cd['model'],_0x3f42cd[_0xcc83('0x35')]);_0x3553a8['attributes']=_[_0xcc83('0x38')](_0x3f42cd[_0xcc83('0x34')],qs[_0xcc83('0x39')](_0x3e4bfa[_0xcc83('0x35')][_0xcc83('0x39')]));_0x3553a8[_0xcc83('0x3a')]=_0x3553a8[_0xcc83('0x3a')]['length']?_0x3553a8[_0xcc83('0x3a')]:_0x3f42cd['model'];_0x3553a8['order']=qs[_0xcc83('0x73')](_0x3e4bfa[_0xcc83('0x35')]['sort']);_0x3553a8[_0xcc83('0x3e')]=qs[_0xcc83('0x37')](_[_0xcc83('0x3f')](_0x3e4bfa['query'],_0x3f42cd[_0xcc83('0x37')]));if(_0x3e4bfa[_0xcc83('0x35')][_0xcc83('0x41')]){_0x3553a8['where']=_[_0xcc83('0x40')](_0x3553a8[_0xcc83('0x3e')],{'$or':_[_0xcc83('0x2f')](_0x3553a8[_0xcc83('0x3a')],function(_0x2082eb){var _0x4b4151={};_0x4b4151[_0x2082eb]={'$like':'%'+_0x3e4bfa['query']['filter']+'%'};return _0x4b4151;})});}_0x3553a8=_[_0xcc83('0x40')]({},_0x3553a8,_0x3e4bfa['options']);return _0x35c435[_0xcc83('0x71')](_0x3553a8);}})['then'](function(_0x420561){if(_0x420561){_0x128bf0=_0x420561[_0xcc83('0x3b')];if(!_0x3e4bfa[_0xcc83('0x35')][_0xcc83('0x3c')](_0xcc83('0x3d'))){_0x3553a8[_0xcc83('0x1f')]=qs[_0xcc83('0x1f')](_0x3e4bfa[_0xcc83('0x35')]['limit']);_0x3553a8[_0xcc83('0x1e')]=qs[_0xcc83('0x1e')](_0x3e4bfa[_0xcc83('0x35')][_0xcc83('0x1e')]);}return _0x35c435[_0xcc83('0x71')](_0x3553a8);}})[_0xcc83('0x27')](function(_0x3624f7){if(_0x3624f7){return _0x3624f7?{'count':_0x128bf0,'rows':_0x3624f7}:null;}})[_0xcc83('0x27')](respondWithResult(_0x5b7448,null))[_0xcc83('0x45')](handleError(_0x5b7448,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 03ddf9a..b65f84a 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 _0x5bd7=['update','emit','hook','exports','../../mysqldb','Dashboard','setMaxListeners'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x5bd7,0x12a));var _0x75bd=function(_0x1436d8,_0x5135aa){_0x1436d8=_0x1436d8-0x0;var _0x252c31=_0x5bd7[_0x1436d8];return _0x252c31;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x75bd('0x0'))['db'][_0x75bd('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x75bd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x75bd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45639e){return function(_0x24036f,_0x524c93,_0x440c0d){DashboardEvents[_0x75bd('0x4')](_0x45639e+':'+_0x24036f['id'],_0x24036f);DashboardEvents[_0x75bd('0x4')](_0x45639e,_0x24036f);_0x440c0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x75bd('0x5')](e,emitEvent(event));}}module[_0x75bd('0x6')]=DashboardEvents; \ No newline at end of file +var _0x724c=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x5bc6ff,_0x1b29af){var _0x2790c4=function(_0x1ed97a){while(--_0x1ed97a){_0x5bc6ff['push'](_0x5bc6ff['shift']());}};_0x2790c4(++_0x1b29af);}(_0x724c,0x1be));var _0xc724=function(_0x54fa58,_0x48cdbd){_0x54fa58=_0x54fa58-0x0;var _0x52394a=_0x724c[_0x54fa58];return _0x52394a;};'use strict';var EventEmitter=require(_0xc724('0x0'));var Dashboard=require(_0xc724('0x1'))['db'][_0xc724('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc724('0x3')](0x0);var events={'afterCreate':_0xc724('0x4'),'afterUpdate':_0xc724('0x5'),'afterDestroy':_0xc724('0x6')};function emitEvent(_0x2fcf63){return function(_0x203097,_0x325421,_0xb0250a){DashboardEvents[_0xc724('0x7')](_0x2fcf63+':'+_0x203097['id'],_0x203097);DashboardEvents[_0xc724('0x7')](_0x2fcf63,_0x203097);_0xb0250a(null);};}for(var e in events){if(events[_0xc724('0x8')](e)){var event=events[e];Dashboard[_0xc724('0x9')](e,emitEvent(event));}}module[_0xc724('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5f9a2a1..9520e54 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 _0x1546=['../../config/logger','request-promise','path','rimraf','../../config/environment','define','Dashboard','dashboards','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1546,0x18b));var _0x6154=function(_0x391862,_0x14772a){_0x391862=_0x391862-0x0;var _0x3cad7f=_0x1546[_0x391862];return _0x3cad7f;};'use strict';var _=require('lodash');var util=require(_0x6154('0x0'));var logger=require(_0x6154('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6154('0x2'));var fs=require('fs');var path=require(_0x6154('0x3'));var rimraf=require(_0x6154('0x4'));var config=require(_0x6154('0x5'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x37082f,_0xcf55bb){return _0x37082f[_0x6154('0x6')](_0x6154('0x7'),attributes,{'tableName':_0x6154('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2c2=['request-promise','path','rimraf','../../config/environment','exports','Dashboard','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2c2,0x132));var _0x2f2c=function(_0x4c1ba3,_0x2a7bf9){_0x4c1ba3=_0x4c1ba3-0x0;var _0x54e5a0=_0xf2c2[_0x4c1ba3];return _0x54e5a0;};'use strict';var _=require(_0x2f2c('0x0'));var util=require(_0x2f2c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2f2c('0x2'));var BPromise=require(_0x2f2c('0x3'));var rp=require(_0x2f2c('0x4'));var fs=require('fs');var path=require(_0x2f2c('0x5'));var rimraf=require(_0x2f2c('0x6'));var config=require(_0x2f2c('0x7'));var attributes=require('./dashboard.attributes');module[_0x2f2c('0x8')]=function(_0x1e868a,_0x4b6063){return _0x1e868a['define'](_0x2f2c('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index cb09492..56b6fb0 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 _0x3d61=['util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./dashboard.socket','register','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dashboard,\x20%s,\x20%s','result','catch','lodash'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0x3d61,0x10d));var _0x13d6=function(_0x1d23a8,_0x112e6d){_0x1d23a8=_0x1d23a8-0x0;var _0x2b1c6f=_0x3d61[_0x1d23a8];return _0x2b1c6f;};'use strict';var _=require(_0x13d6('0x0'));var util=require(_0x13d6('0x1'));var moment=require(_0x13d6('0x2'));var BPromise=require('bluebird');var rs=require(_0x13d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x13d6('0x4'))(_0x13d6('0x5'));var config=require(_0x13d6('0x6'));var jayson=require(_0x13d6('0x7'));var client=jayson[_0x13d6('0x8')][_0x13d6('0x9')]({'port':0x232a});config[_0x13d6('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x13d6('0xb'))(new Redis(config[_0x13d6('0xa')]));require(_0x13d6('0xc'))[_0x13d6('0xd')](socket);function respondWithRpcPromise(_0x28a420,_0x4a653a,_0x3053c7){return new BPromise(function(_0x100173,_0x7a4278){return client[_0x13d6('0xe')](_0x28a420,_0x3053c7)[_0x13d6('0xf')](function(_0x43efdf){logger[_0x13d6('0x10')]('Dashboard,\x20%s,\x20%s',_0x4a653a,'request\x20sent');logger[_0x13d6('0x11')](_0x13d6('0x12'),_0x4a653a,_0x13d6('0x13'),JSON[_0x13d6('0x14')](_0x43efdf));if(_0x43efdf[_0x13d6('0x15')]){if(_0x43efdf[_0x13d6('0x15')][_0x13d6('0x16')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x4a653a,_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);return _0x7a4278(_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);}logger[_0x13d6('0x15')](_0x13d6('0x18'),_0x4a653a,_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);return _0x100173(_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);}else{logger[_0x13d6('0x10')](_0x13d6('0x18'),_0x4a653a,_0x13d6('0x13'));_0x100173(_0x43efdf[_0x13d6('0x19')]['message']);}})[_0x13d6('0x1a')](function(_0x4d4b09){logger['error']('Dashboard,\x20%s,\x20%s',_0x4a653a,_0x4d4b09);_0x7a4278(_0x4d4b09);});});} \ No newline at end of file +var _0xe359=['debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x566747,_0x4db376){var _0x31b31a=function(_0xfd3697){while(--_0xfd3697){_0x566747['push'](_0x566747['shift']());}};_0x31b31a(++_0x4db376);}(_0xe359,0x1d3));var _0x9e35=function(_0x5a9904,_0x7d2763){_0x5a9904=_0x5a9904-0x0;var _0x2ea857=_0xe359[_0x5a9904];return _0x2ea857;};'use strict';var _=require(_0x9e35('0x0'));var util=require(_0x9e35('0x1'));var moment=require(_0x9e35('0x2'));var BPromise=require(_0x9e35('0x3'));var rs=require(_0x9e35('0x4'));var fs=require('fs');var Redis=require(_0x9e35('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e35('0x6'));var logger=require(_0x9e35('0x7'))(_0x9e35('0x8'));var config=require(_0x9e35('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9e35('0xa')]({'port':0x232a});config[_0x9e35('0xb')]=_[_0x9e35('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9e35('0xd'))[_0x9e35('0xe')](socket);function respondWithRpcPromise(_0x597d30,_0x1a46ef,_0xf82643){return new BPromise(function(_0x35b009,_0x52962d){return client[_0x9e35('0xf')](_0x597d30,_0xf82643)[_0x9e35('0x10')](function(_0x22c97f){logger['info'](_0x9e35('0x11'),_0x1a46ef,_0x9e35('0x12'));logger[_0x9e35('0x13')](_0x9e35('0x14'),_0x1a46ef,_0x9e35('0x12'),JSON['stringify'](_0x22c97f));if(_0x22c97f[_0x9e35('0x15')]){if(_0x22c97f[_0x9e35('0x15')][_0x9e35('0x16')]===0x1f4){logger[_0x9e35('0x15')](_0x9e35('0x11'),_0x1a46ef,_0x22c97f[_0x9e35('0x15')]['message']);return _0x52962d(_0x22c97f['error'][_0x9e35('0x17')]);}logger[_0x9e35('0x15')](_0x9e35('0x11'),_0x1a46ef,_0x22c97f[_0x9e35('0x15')][_0x9e35('0x17')]);return _0x35b009(_0x22c97f[_0x9e35('0x15')]['message']);}else{logger[_0x9e35('0x18')](_0x9e35('0x11'),_0x1a46ef,'request\x20sent');_0x35b009(_0x22c97f[_0x9e35('0x19')][_0x9e35('0x17')]);}})[_0x9e35('0x1a')](function(_0xdd773){logger['error'](_0x9e35('0x11'),_0x1a46ef,_0xdd773);_0x52962d(_0xdd773);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 66ca195..d5c5d12 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 _0xcc67=['removeListener','length','./dashboard.events','remove','update','emit'];(function(_0x507b08,_0x1fe1f4){var _0xe75256=function(_0x54c969){while(--_0x54c969){_0x507b08['push'](_0x507b08['shift']());}};_0xe75256(++_0x1fe1f4);}(_0xcc67,0x13a));var _0x7cc6=function(_0x19edc8,_0x33c32a){_0x19edc8=_0x19edc8-0x0;var _0x394b20=_0xcc67[_0x19edc8];return _0x394b20;};'use strict';var DashboardEvents=require(_0x7cc6('0x0'));var events=['save',_0x7cc6('0x1'),_0x7cc6('0x2')];function createListener(_0x474057,_0x2635a3){return function(_0x577418){_0x2635a3[_0x7cc6('0x3')](_0x474057,_0x577418);};}function removeListener(_0x5997c2,_0x293eba){return function(){DashboardEvents[_0x7cc6('0x4')](_0x5997c2,_0x293eba);};}exports['register']=function(_0x10835e){for(var _0x5d89c5=0x0,_0x911375=events[_0x7cc6('0x5')];_0x5d89c5<_0x911375;_0x5d89c5++){var _0x10e31b=events[_0x5d89c5];var _0x5a3975=createListener('dashboard:'+_0x10e31b,_0x10835e);DashboardEvents['on'](_0x10e31b,_0x5a3975);}}; \ No newline at end of file +var _0x327a=['removeListener','register','dashboard:','save','update','emit'];(function(_0x39f3f0,_0x61e51f){var _0xac8c70=function(_0x55fe05){while(--_0x55fe05){_0x39f3f0['push'](_0x39f3f0['shift']());}};_0xac8c70(++_0x61e51f);}(_0x327a,0x165));var _0xa327=function(_0x10898e,_0x24fdc1){_0x10898e=_0x10898e-0x0;var _0x406174=_0x327a[_0x10898e];return _0x406174;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xa327('0x0'),'remove',_0xa327('0x1')];function createListener(_0x55468a,_0x4e0a46){return function(_0x2718b6){_0x4e0a46[_0xa327('0x2')](_0x55468a,_0x2718b6);};}function removeListener(_0x459d46,_0x52cc8e){return function(){DashboardEvents[_0xa327('0x3')](_0x459d46,_0x52cc8e);};}exports[_0xa327('0x4')]=function(_0x1e9ea5){for(var _0x276b77=0x0,_0x522b5f=events['length'];_0x276b77<_0x522b5f;_0x276b77++){var _0x5eb18f=events[_0x276b77];var _0x2e28af=createListener(_0xa327('0x5')+_0x5eb18f,_0x1e9ea5);DashboardEvents['on'](_0x5eb18f,_0x2e28af);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 60dfffd..2a8963d 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 _0x9505=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','/:id/clone','put','delete','destroy','exports','path'];(function(_0x1620c7,_0x457d19){var _0x3406bd=function(_0x4b2177){while(--_0x4b2177){_0x1620c7['push'](_0x1620c7['shift']());}};_0x3406bd(++_0x457d19);}(_0x9505,0x1e2));var _0x5950=function(_0x3d42c3,_0x33782d){_0x3d42c3=_0x3d42c3-0x0;var _0x436928=_0x9505[_0x3d42c3];return _0x436928;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5950('0x0'));var timeout=require(_0x5950('0x1'));var express=require(_0x5950('0x2'));var router=express[_0x5950('0x3')]();var fs_extra=require(_0x5950('0x4'));var auth=require(_0x5950('0x5'));var interaction=require(_0x5950('0x6'));var config=require('../../config/environment');var controller=require(_0x5950('0x7'));router[_0x5950('0x8')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router[_0x5950('0x8')](_0x5950('0xb'),auth[_0x5950('0x9')](),controller[_0x5950('0xc')]);router[_0x5950('0x8')](_0x5950('0xd'),auth[_0x5950('0x9')](),controller['getItems']);router[_0x5950('0xe')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xf')]);router[_0x5950('0xe')](_0x5950('0x10'),auth[_0x5950('0x9')](),controller['clone']);router[_0x5950('0xe')]('/:id/items',auth[_0x5950('0x9')](),controller['addItem']);router[_0x5950('0x11')]('/:id',auth[_0x5950('0x9')](),controller['update']);router[_0x5950('0x12')]('/:id',auth[_0x5950('0x9')](),controller[_0x5950('0x13')]);module[_0x5950('0x14')]=router; \ No newline at end of file +var _0x15d7=['/:id','show','getItems','post','/:id/clone','clone','update','delete','destroy','multer','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x29f695,_0x411e52){var _0x25def8=function(_0x3b1ef0){while(--_0x3b1ef0){_0x29f695['push'](_0x29f695['shift']());}};_0x25def8(++_0x411e52);}(_0x15d7,0x1c9));var _0x715d=function(_0x1b4027,_0x228aaf){_0x1b4027=_0x1b4027-0x0;var _0x399ed6=_0x15d7[_0x1b4027];return _0x399ed6;};'use strict';var multer=require(_0x715d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x715d('0x1'));var auth=require(_0x715d('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x715d('0x3'));var controller=require(_0x715d('0x4'));router[_0x715d('0x5')]('/',auth[_0x715d('0x6')](),controller['index']);router[_0x715d('0x5')](_0x715d('0x7'),auth['isAuthenticated'](),controller[_0x715d('0x8')]);router[_0x715d('0x5')]('/:id/items',auth[_0x715d('0x6')](),controller[_0x715d('0x9')]);router[_0x715d('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x715d('0xa')](_0x715d('0xb'),auth[_0x715d('0x6')](),controller[_0x715d('0xc')]);router[_0x715d('0xa')]('/:id/items',auth['isAuthenticated'](),controller['addItem']);router['put']('/:id',auth[_0x715d('0x6')](),controller[_0x715d('0xd')]);router[_0x715d('0xe')](_0x715d('0x7'),auth[_0x715d('0x6')](),controller[_0x715d('0xf')]);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 e20fb10..e8f565a 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 _0x1261=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x1261,0x144));var _0x1126=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0x1261[_0x1795df];return _0x3f13c0;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x1126('0x0'));var _=require(_0x1126('0x1'));module[_0x1126('0x2')]={'title':{'type':Sequelize[_0x1126('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1126('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x1126('0x4')](_0x1126('0x5')),'get':function(){try{return JSON[_0x1126('0x6')](this[_0x1126('0x7')](_0x1126('0x8')));}catch(_0x5a2189){return[];}},'set':function(_0x5c68c8){try{this[_0x1126('0x9')](_0x1126('0x8'),JSON['stringify'](_0x5c68c8));}catch(_0x17e5f0){this[_0x1126('0x9')](_0x1126('0x8'),JSON[_0x1126('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x1126('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1126('0xb')]},'col':{'type':Sequelize[_0x1126('0xb')]},'background':{'type':Sequelize[_0x1126('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1126('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1126('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x9536=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x37d35e,_0x4b36fd){var _0x35943b=function(_0x989d27){while(--_0x989d27){_0x37d35e['push'](_0x37d35e['shift']());}};_0x35943b(++_0x4b36fd);}(_0x9536,0x179));var _0x6953=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x9536[_0x2ec2bf];return _0x2c279c;};'use strict';var Sequelize=require(_0x6953('0x0'));var squel=require(_0x6953('0x1'));var _=require(_0x6953('0x2'));module[_0x6953('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6953('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x6953('0x5')),'get':function(){try{return JSON[_0x6953('0x6')](this[_0x6953('0x7')](_0x6953('0x8')));}catch(_0x2f3cc3){return[];}},'set':function(_0x494ac2){try{this[_0x6953('0x9')](_0x6953('0x8'),JSON[_0x6953('0xa')](_0x494ac2));}catch(_0x3e1aff){this[_0x6953('0x9')]('attrs',JSON[_0x6953('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6953('0xb')]},'background':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6953('0x4')]},'titleFontSize':{'type':Sequelize[_0x6953('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 0da98ef..cca5df2 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 _0x68b5=['attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','params','DashboardItem','query','filters','intersection','model','attributes','fields','include','find','catch','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x68b5,0xc0));var _0x568b=function(_0x310d94,_0x27b519){_0x310d94=_0x310d94-0x0;var _0x377dc9=_0x68b5[_0x310d94];return _0x377dc9;};'use strict';var emlformat=require(_0x568b('0x0'));var rimraf=require(_0x568b('0x1'));var zipdir=require(_0x568b('0x2'));var jsonpatch=require(_0x568b('0x3'));var rp=require('request-promise');var moment=require(_0x568b('0x4'));var BPromise=require(_0x568b('0x5'));var Mustache=require(_0x568b('0x6'));var util=require(_0x568b('0x7'));var path=require('path');var sox=require(_0x568b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x568b('0x9'));var _=require(_0x568b('0xa'));var squel=require(_0x568b('0xb'));var crypto=require(_0x568b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x568b('0xd'));var toCsv=require(_0x568b('0xe'));var querystring=require(_0x568b('0xf'));var Papa=require(_0x568b('0x10'));var Redis=require(_0x568b('0x11'));var authService=require(_0x568b('0x12'));var qs=require(_0x568b('0x13'));var as=require(_0x568b('0x14'));var hardwareService=require(_0x568b('0x15'));var logger=require(_0x568b('0x16'))(_0x568b('0x17'));var utils=require('../../config/utils');var config=require(_0x568b('0x18'));var licenseUtil=require(_0x568b('0x19'));var db=require('../../mysqldb')['db'];config[_0x568b('0x1a')]=_[_0x568b('0x1b')](config[_0x568b('0x1a')],{'host':_0x568b('0x1c'),'port':0x18eb});var socket=require(_0x568b('0x1d'))(new Redis(config['redis']));require(_0x568b('0x1e'))[_0x568b('0x1f')](socket);function respondWithStatusCode(_0x2afded,_0xeed54b){_0xeed54b=_0xeed54b||0xcc;return function(_0x32ed80){if(_0x32ed80){return _0x2afded[_0x568b('0x20')](_0xeed54b);}return _0x2afded[_0x568b('0x21')](_0xeed54b)[_0x568b('0x22')]();};}function respondWithResult(_0x4074c1,_0x46e1a0){_0x46e1a0=_0x46e1a0||0xc8;return function(_0x5dd238){if(_0x5dd238){return _0x4074c1[_0x568b('0x21')](_0x46e1a0)[_0x568b('0x23')](_0x5dd238);}};}function respondWithFilteredResult(_0x73c855,_0x1716df){return function(_0x487d57){if(_0x487d57){var _0x2591ab=typeof _0x1716df['offset']===_0x568b('0x24')&&typeof _0x1716df[_0x568b('0x25')]===_0x568b('0x24');var _0x19e6a4=_0x487d57[_0x568b('0x26')];var _0x3d5098=_0x2591ab?0x0:_0x1716df['offset'];var _0x2a6d77=_0x2591ab?_0x487d57[_0x568b('0x26')]:_0x1716df[_0x568b('0x27')]+_0x1716df[_0x568b('0x25')];var _0x11e770;if(_0x2a6d77>=_0x19e6a4){_0x2a6d77=_0x19e6a4;_0x11e770=0xc8;}else{_0x11e770=0xce;}_0x73c855['status'](_0x11e770);return _0x73c855[_0x568b('0x28')](_0x568b('0x29'),_0x3d5098+'-'+_0x2a6d77+'/'+_0x19e6a4)[_0x568b('0x23')](_0x487d57);}return null;};}function patchUpdates(_0x5512c7){return function(_0x1440d0){try{jsonpatch[_0x568b('0x2a')](_0x1440d0,_0x5512c7,!![]);}catch(_0x436b59){return BPromise[_0x568b('0x2b')](_0x436b59);}return _0x1440d0[_0x568b('0x2c')]();};}function saveUpdates(_0x137570,_0x3523ed){return function(_0x3e448b){if(_0x3e448b){return _0x3e448b['update'](_0x137570)[_0x568b('0x2d')](function(_0x189027){return _0x189027;});}return null;};}function removeEntity(_0x16ead0,_0x4cc526){return function(_0x38fefa){if(_0x38fefa){return _0x38fefa[_0x568b('0x2e')]()[_0x568b('0x2d')](function(){_0x16ead0['status'](0xcc)[_0x568b('0x22')]();});}};}function handleEntityNotFound(_0x38c934,_0x9640e7){return function(_0x3d4a44){if(!_0x3d4a44){_0x38c934[_0x568b('0x20')](0x194);}return _0x3d4a44;};}function handleError(_0x413459,_0x12267e){_0x12267e=_0x12267e||0x1f4;return function(_0x1a6b76){logger[_0x568b('0x2f')](_0x1a6b76['stack']);if(_0x1a6b76[_0x568b('0x30')]){delete _0x1a6b76[_0x568b('0x30')];}_0x413459['status'](_0x12267e)[_0x568b('0x31')](_0x1a6b76);};}exports['show']=function(_0x1e1c92,_0x29389f){var _0x1650e7={'raw':![],'where':{'id':_0x1e1c92[_0x568b('0x32')]['id']}},_0x51c2de={};_0x51c2de['model']=_['keys'](db[_0x568b('0x33')]['rawAttributes']);_0x51c2de['query']=_['keys'](_0x1e1c92[_0x568b('0x34')]);_0x51c2de[_0x568b('0x35')]=_[_0x568b('0x36')](_0x51c2de[_0x568b('0x37')],_0x51c2de[_0x568b('0x34')]);_0x1650e7[_0x568b('0x38')]=_[_0x568b('0x36')](_0x51c2de[_0x568b('0x37')],qs[_0x568b('0x39')](_0x1e1c92[_0x568b('0x34')][_0x568b('0x39')]));_0x1650e7['attributes']=_0x1650e7['attributes']['length']?_0x1650e7[_0x568b('0x38')]:_0x51c2de['model'];if(_0x1e1c92['query']['includeAll']){_0x1650e7[_0x568b('0x3a')]=[{'all':!![]}];}_0x1650e7=_['merge']({},_0x1650e7,_0x1e1c92['options']);return db[_0x568b('0x33')][_0x568b('0x3b')](_0x1650e7)[_0x568b('0x2d')](handleEntityNotFound(_0x29389f,null))['then'](respondWithResult(_0x29389f,null))[_0x568b('0x3c')](handleError(_0x29389f,null));};exports['destroy']=function(_0x361b54,_0x598559){return db[_0x568b('0x33')]['find']({'where':{'id':_0x361b54[_0x568b('0x32')]['id']}})[_0x568b('0x2d')](handleEntityNotFound(_0x598559,null))[_0x568b('0x2d')](removeEntity(_0x598559,null))[_0x568b('0x3c')](handleError(_0x598559,null));};function widgetAttributes(_0x53927c){try{switch(_0x53927c['type']){case'iframe':return[{'name':'attrUrl','value':_0x53927c[_0x568b('0x3d')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0]['value']:undefined)||_0x568b('0x3f')}];case _0x568b('0x40'):return[{'name':_0x568b('0x41'),'value':_0x53927c[_0x568b('0x41')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||''}];case'clock':return[{'name':_0x568b('0x43'),'value':_0x53927c['attrHourFormat']||(_0x53927c[_0x568b('0x3e')]&&_0x53927c['attrs'][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||_0x568b('0x44')},{'name':_0x568b('0x45'),'value':_0x53927c[_0x568b('0x45')]||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x1]?_0x53927c[_0x568b('0x3e')][0x1][_0x568b('0x42')]:undefined)||'0.00'},{'name':_0x568b('0x46'),'value':_0x53927c['attrFontSize']||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x2]?_0x53927c['attrs'][0x2][_0x568b('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x568b('0x47'),'value':_0x53927c[_0x568b('0x47')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||_0x568b('0x48')},{'name':'attrVoiceQueues','value':_0x53927c[_0x568b('0x49')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x1]?_0x53927c['attrs'][0x1][_0x568b('0x42')]:undefined)||[]},{'name':_0x568b('0x46'),'value':_0x53927c['attrFontSize']||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x2]?_0x53927c['attrs'][0x2]['value']:undefined)||0x14}];case _0x568b('0x4a'):case _0x568b('0x4b'):return[{'name':_0x568b('0x4c'),'value':_0x53927c[_0x568b('0x4c')]||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c['attrs'][0x0][_0x568b('0x42')]:undefined)||_0x568b('0x48')},{'name':_0x568b('0x4d'),'value':_0x53927c[_0x568b('0x4d')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c['attrs'][0x1]?_0x53927c['attrs'][0x1]['value']:undefined)||null},{'name':_0x568b('0x4e'),'value':_0x53927c['attrSerie3']||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x2]?_0x53927c['attrs'][0x2][_0x568b('0x42')]:undefined)||null},{'name':_0x568b('0x49'),'value':_0x53927c[_0x568b('0x49')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x3]?_0x53927c[_0x568b('0x3e')][0x3][_0x568b('0x42')]:undefined)||[]}];case'web-report':return[{'name':_0x568b('0x4f'),'type':_0x53927c[_0x568b('0x50')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c['attrs'][0x0]['type']:undefined)||null,'value':_0x53927c[_0x568b('0x4f')]||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||null},{'name':_0x568b('0x51'),'value':_0x53927c[_0x568b('0x51')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x1]?_0x53927c['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1627ba){logger[_0x568b('0x2f')](_0x568b('0x52'),JSON[_0x568b('0x53')](_0x1627ba));return[];}}exports[_0x568b('0x54')]=function(_0x51b8d6,_0x54e8ce){if(_0x51b8d6[_0x568b('0x55')]){_0x51b8d6['body']['attrs']=widgetAttributes(_0x51b8d6[_0x568b('0x55')]);}return db[_0x568b('0x33')]['create'](_0x51b8d6['body'],{})['then'](respondWithResult(_0x54e8ce,0xc9))[_0x568b('0x3c')](handleError(_0x54e8ce,null));};exports[_0x568b('0x56')]=function(_0x22aa49,_0x38f38f){if(_0x22aa49[_0x568b('0x55')]['id']){delete _0x22aa49['body']['id'];}_0x22aa49[_0x568b('0x55')][_0x568b('0x3e')]=widgetAttributes(_0x22aa49[_0x568b('0x55')]);return db[_0x568b('0x33')][_0x568b('0x3b')]({'where':{'id':_0x22aa49[_0x568b('0x32')]['id']}})[_0x568b('0x2d')](handleEntityNotFound(_0x38f38f,null))[_0x568b('0x2d')](saveUpdates(_0x22aa49['body'],null))[_0x568b('0x2d')](respondWithResult(_0x38f38f,null))['catch'](handleError(_0x38f38f,null));}; \ No newline at end of file +var _0x7fa6=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./dashboardItem.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','params','keys','DashboardItem','query','filters','model','attributes','intersection','fields','length','include','options','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','find','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x33a0e4,_0x26d890){var _0xc1d4b0=function(_0x4c1870){while(--_0x4c1870){_0x33a0e4['push'](_0x33a0e4['shift']());}};_0xc1d4b0(++_0x26d890);}(_0x7fa6,0xb1));var _0x67fa=function(_0xa4adba,_0x30c8dc){_0xa4adba=_0xa4adba-0x0;var _0x29d702=_0x7fa6[_0xa4adba];return _0x29d702;};'use strict';var emlformat=require(_0x67fa('0x0'));var rimraf=require(_0x67fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67fa('0x2'));var rp=require(_0x67fa('0x3'));var moment=require(_0x67fa('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67fa('0x5'));var path=require(_0x67fa('0x6'));var sox=require('sox');var csv=require(_0x67fa('0x7'));var ejs=require(_0x67fa('0x8'));var fs=require('fs');var fs_extra=require(_0x67fa('0x9'));var _=require(_0x67fa('0xa'));var squel=require(_0x67fa('0xb'));var crypto=require(_0x67fa('0xc'));var jsforce=require(_0x67fa('0xd'));var deskjs=require(_0x67fa('0xe'));var toCsv=require(_0x67fa('0x7'));var querystring=require(_0x67fa('0xf'));var Papa=require(_0x67fa('0x10'));var Redis=require('ioredis');var authService=require(_0x67fa('0x11'));var qs=require(_0x67fa('0x12'));var as=require(_0x67fa('0x13'));var hardwareService=require(_0x67fa('0x14'));var logger=require(_0x67fa('0x15'))('api');var utils=require(_0x67fa('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x67fa('0x17'));var db=require(_0x67fa('0x18'))['db'];config['redis']=_[_0x67fa('0x19')](config[_0x67fa('0x1a')],{'host':_0x67fa('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67fa('0x1a')]));require(_0x67fa('0x1c'))[_0x67fa('0x1d')](socket);function respondWithStatusCode(_0x2b8e0a,_0xa3c355){_0xa3c355=_0xa3c355||0xcc;return function(_0x1d90a4){if(_0x1d90a4){return _0x2b8e0a[_0x67fa('0x1e')](_0xa3c355);}return _0x2b8e0a['status'](_0xa3c355)[_0x67fa('0x1f')]();};}function respondWithResult(_0x5bc5cb,_0x413946){_0x413946=_0x413946||0xc8;return function(_0x2be9aa){if(_0x2be9aa){return _0x5bc5cb[_0x67fa('0x20')](_0x413946)[_0x67fa('0x21')](_0x2be9aa);}};}function respondWithFilteredResult(_0x153b45,_0x205c53){return function(_0x5c42ae){if(_0x5c42ae){var _0x11797a=typeof _0x205c53['offset']===_0x67fa('0x22')&&typeof _0x205c53[_0x67fa('0x23')]===_0x67fa('0x22');var _0x29482f=_0x5c42ae[_0x67fa('0x24')];var _0x19cd01=_0x11797a?0x0:_0x205c53[_0x67fa('0x25')];var _0x44a094=_0x11797a?_0x5c42ae['count']:_0x205c53[_0x67fa('0x25')]+_0x205c53['limit'];var _0x3f589;if(_0x44a094>=_0x29482f){_0x44a094=_0x29482f;_0x3f589=0xc8;}else{_0x3f589=0xce;}_0x153b45[_0x67fa('0x20')](_0x3f589);return _0x153b45[_0x67fa('0x26')](_0x67fa('0x27'),_0x19cd01+'-'+_0x44a094+'/'+_0x29482f)['json'](_0x5c42ae);}return null;};}function patchUpdates(_0x3859ea){return function(_0x15decd){try{jsonpatch[_0x67fa('0x28')](_0x15decd,_0x3859ea,!![]);}catch(_0x3f15ed){return BPromise[_0x67fa('0x29')](_0x3f15ed);}return _0x15decd['save']();};}function saveUpdates(_0xe118bf,_0x2f0b90){return function(_0x12b4f6){if(_0x12b4f6){return _0x12b4f6[_0x67fa('0x2a')](_0xe118bf)['then'](function(_0x49cb0d){return _0x49cb0d;});}return null;};}function removeEntity(_0x5fd141,_0x411c71){return function(_0x3ca4f6){if(_0x3ca4f6){return _0x3ca4f6[_0x67fa('0x2b')]()[_0x67fa('0x2c')](function(){_0x5fd141[_0x67fa('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f17c,_0x9b2dce){return function(_0x181955){if(!_0x181955){_0x49f17c[_0x67fa('0x1e')](0x194);}return _0x181955;};}function handleError(_0x1e6d07,_0x3fa586){_0x3fa586=_0x3fa586||0x1f4;return function(_0x4fb7db){logger[_0x67fa('0x2d')](_0x4fb7db[_0x67fa('0x2e')]);if(_0x4fb7db[_0x67fa('0x2f')]){delete _0x4fb7db['name'];}_0x1e6d07['status'](_0x3fa586)[_0x67fa('0x30')](_0x4fb7db);};}exports['show']=function(_0x20d6dd,_0x989558){var _0xef79b8={'raw':![],'where':{'id':_0x20d6dd[_0x67fa('0x31')]['id']}},_0x182f32={};_0x182f32['model']=_[_0x67fa('0x32')](db[_0x67fa('0x33')]['rawAttributes']);_0x182f32[_0x67fa('0x34')]=_[_0x67fa('0x32')](_0x20d6dd[_0x67fa('0x34')]);_0x182f32[_0x67fa('0x35')]=_['intersection'](_0x182f32[_0x67fa('0x36')],_0x182f32[_0x67fa('0x34')]);_0xef79b8[_0x67fa('0x37')]=_[_0x67fa('0x38')](_0x182f32['model'],qs['fields'](_0x20d6dd['query'][_0x67fa('0x39')]));_0xef79b8[_0x67fa('0x37')]=_0xef79b8[_0x67fa('0x37')][_0x67fa('0x3a')]?_0xef79b8[_0x67fa('0x37')]:_0x182f32[_0x67fa('0x36')];if(_0x20d6dd[_0x67fa('0x34')]['includeAll']){_0xef79b8[_0x67fa('0x3b')]=[{'all':!![]}];}_0xef79b8=_['merge']({},_0xef79b8,_0x20d6dd[_0x67fa('0x3c')]);return db['DashboardItem']['find'](_0xef79b8)['then'](handleEntityNotFound(_0x989558,null))[_0x67fa('0x2c')](respondWithResult(_0x989558,null))[_0x67fa('0x3d')](handleError(_0x989558,null));};exports[_0x67fa('0x2b')]=function(_0x4a9dbe,_0x40d2a5){return db['DashboardItem']['find']({'where':{'id':_0x4a9dbe[_0x67fa('0x31')]['id']}})[_0x67fa('0x2c')](handleEntityNotFound(_0x40d2a5,null))['then'](removeEntity(_0x40d2a5,null))[_0x67fa('0x3d')](handleError(_0x40d2a5,null));};function widgetAttributes(_0x122d39){try{switch(_0x122d39['type']){case _0x67fa('0x3e'):return[{'name':_0x67fa('0x3f'),'value':_0x122d39['attrUrl']||(_0x122d39['attrs']&&_0x122d39[_0x67fa('0x40')][0x0]?_0x122d39['attrs'][0x0][_0x67fa('0x41')]:undefined)||_0x67fa('0x42')}];case _0x67fa('0x43'):return[{'name':_0x67fa('0x44'),'value':_0x122d39[_0x67fa('0x44')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39[_0x67fa('0x40')][0x0]?_0x122d39[_0x67fa('0x40')][0x0][_0x67fa('0x41')]:undefined)||''}];case _0x67fa('0x45'):return[{'name':_0x67fa('0x46'),'value':_0x122d39[_0x67fa('0x46')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39['attrs'][0x0]?_0x122d39['attrs'][0x0][_0x67fa('0x41')]:undefined)||_0x67fa('0x47')},{'name':'attrTimezone','value':_0x122d39[_0x67fa('0x48')]||(_0x122d39['attrs']&&_0x122d39[_0x67fa('0x40')][0x1]?_0x122d39[_0x67fa('0x40')][0x1][_0x67fa('0x41')]:undefined)||_0x67fa('0x49')},{'name':_0x67fa('0x4a'),'value':_0x122d39[_0x67fa('0x4a')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39[_0x67fa('0x40')][0x2]?_0x122d39['attrs'][0x2][_0x67fa('0x41')]:undefined)||0xc}];case _0x67fa('0x4b'):return[{'name':_0x67fa('0x4c'),'value':_0x122d39[_0x67fa('0x4c')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39[_0x67fa('0x40')][0x0]?_0x122d39[_0x67fa('0x40')][0x0]['value']:undefined)||_0x67fa('0x4d')},{'name':_0x67fa('0x4e'),'value':_0x122d39[_0x67fa('0x4e')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39['attrs'][0x1]?_0x122d39[_0x67fa('0x40')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x122d39[_0x67fa('0x4a')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39[_0x67fa('0x40')][0x2]?_0x122d39[_0x67fa('0x40')][0x2][_0x67fa('0x41')]:undefined)||0x14}];case'multibar-chart':case _0x67fa('0x4f'):return[{'name':_0x67fa('0x50'),'value':_0x122d39[_0x67fa('0x50')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39[_0x67fa('0x40')][0x0]?_0x122d39[_0x67fa('0x40')][0x0][_0x67fa('0x41')]:undefined)||'total'},{'name':_0x67fa('0x51'),'value':_0x122d39[_0x67fa('0x51')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39[_0x67fa('0x40')][0x1]?_0x122d39[_0x67fa('0x40')][0x1][_0x67fa('0x41')]:undefined)||null},{'name':_0x67fa('0x52'),'value':_0x122d39['attrSerie3']||(_0x122d39['attrs']&&_0x122d39[_0x67fa('0x40')][0x2]?_0x122d39[_0x67fa('0x40')][0x2]['value']:undefined)||null},{'name':_0x67fa('0x4e'),'value':_0x122d39[_0x67fa('0x4e')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39[_0x67fa('0x40')][0x3]?_0x122d39['attrs'][0x3][_0x67fa('0x41')]:undefined)||[]}];case _0x67fa('0x53'):return[{'name':_0x67fa('0x54'),'type':_0x122d39[_0x67fa('0x55')]||(_0x122d39[_0x67fa('0x40')]&&_0x122d39['attrs'][0x0]?_0x122d39[_0x67fa('0x40')][0x0][_0x67fa('0x56')]:undefined)||null,'value':_0x122d39['attrReport']||(_0x122d39['attrs']&&_0x122d39[_0x67fa('0x40')][0x0]?_0x122d39['attrs'][0x0][_0x67fa('0x41')]:undefined)||null},{'name':_0x67fa('0x57'),'value':_0x122d39[_0x67fa('0x57')]||(_0x122d39['attrs']&&_0x122d39[_0x67fa('0x40')][0x1]?_0x122d39[_0x67fa('0x40')][0x1][_0x67fa('0x41')]:undefined)||0x0}];default:return[];}}catch(_0xc7fc7d){logger[_0x67fa('0x2d')](_0x67fa('0x58'),JSON[_0x67fa('0x59')](_0xc7fc7d));return[];}}exports['create']=function(_0x5e00ef,_0x100b4a){if(_0x5e00ef[_0x67fa('0x5a')]){_0x5e00ef[_0x67fa('0x5a')]['attrs']=widgetAttributes(_0x5e00ef[_0x67fa('0x5a')]);}return db[_0x67fa('0x33')][_0x67fa('0x5b')](_0x5e00ef[_0x67fa('0x5a')],{})[_0x67fa('0x2c')](respondWithResult(_0x100b4a,0xc9))[_0x67fa('0x3d')](handleError(_0x100b4a,null));};exports[_0x67fa('0x2a')]=function(_0x51f7c5,_0x5901b5){if(_0x51f7c5['body']['id']){delete _0x51f7c5[_0x67fa('0x5a')]['id'];}_0x51f7c5[_0x67fa('0x5a')][_0x67fa('0x40')]=widgetAttributes(_0x51f7c5[_0x67fa('0x5a')]);return db[_0x67fa('0x33')][_0x67fa('0x5c')]({'where':{'id':_0x51f7c5[_0x67fa('0x31')]['id']}})[_0x67fa('0x2c')](handleEntityNotFound(_0x5901b5,null))[_0x67fa('0x2c')](saveUpdates(_0x51f7c5[_0x67fa('0x5a')],null))['then'](respondWithResult(_0x5901b5,null))[_0x67fa('0x3d')](handleError(_0x5901b5,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 2c7e275..5746245 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 _0x7276=['../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x256cc1,_0x568424){var _0x330d0a=function(_0x4c8cc1){while(--_0x4c8cc1){_0x256cc1['push'](_0x256cc1['shift']());}};_0x330d0a(++_0x568424);}(_0x7276,0xfb));var _0x6727=function(_0x404227,_0x5bcf4c){_0x404227=_0x404227-0x0;var _0x220eef=_0x7276[_0x404227];return _0x220eef;};'use strict';var EventEmitter=require(_0x6727('0x0'));var DashboardItem=require(_0x6727('0x1'))['db'][_0x6727('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6727('0x3')](0x0);var events={'afterCreate':_0x6727('0x4'),'afterUpdate':_0x6727('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2603b2){return function(_0x31b091,_0x2b6af0,_0x1b26ad){DashboardItemEvents[_0x6727('0x6')](_0x2603b2+':'+_0x31b091['id'],_0x31b091);DashboardItemEvents['emit'](_0x2603b2,_0x31b091);_0x1b26ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x6727('0x7')](e,emitEvent(event));}}module[_0x6727('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xc808=['../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty','events'];(function(_0x56cf5c,_0x4087ec){var _0x12e9bc=function(_0x19bd06){while(--_0x19bd06){_0x56cf5c['push'](_0x56cf5c['shift']());}};_0x12e9bc(++_0x4087ec);}(_0xc808,0x97));var _0x8c80=function(_0x326d35,_0x4f65b3){_0x326d35=_0x326d35-0x0;var _0xd3f8f3=_0xc808[_0x326d35];return _0xd3f8f3;};'use strict';var EventEmitter=require(_0x8c80('0x0'));var DashboardItem=require(_0x8c80('0x1'))['db'][_0x8c80('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c80('0x3'),'afterUpdate':_0x8c80('0x4'),'afterDestroy':_0x8c80('0x5')};function emitEvent(_0x3ecc01){return function(_0x27f9f5,_0x3e6da3,_0x180cdc){DashboardItemEvents[_0x8c80('0x6')](_0x3ecc01+':'+_0x27f9f5['id'],_0x27f9f5);DashboardItemEvents[_0x8c80('0x6')](_0x3ecc01,_0x27f9f5);_0x180cdc(null);};}for(var e in events){if(events[_0x8c80('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index e394772..cf8fc5b 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 _0x9aee=['path','rimraf','DashboardItem','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37ea31,_0xb5b1e1){var _0x11759d=function(_0x559982){while(--_0x559982){_0x37ea31['push'](_0x37ea31['shift']());}};_0x11759d(++_0xb5b1e1);}(_0x9aee,0x71));var _0xe9ae=function(_0x1d0946,_0x3732fc){_0x1d0946=_0x1d0946-0x0;var _0x205df=_0x9aee[_0x1d0946];return _0x205df;};'use strict';var _=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var logger=require(_0xe9ae('0x2'))(_0xe9ae('0x3'));var moment=require(_0xe9ae('0x4'));var BPromise=require(_0xe9ae('0x5'));var rp=require(_0xe9ae('0x6'));var fs=require('fs');var path=require(_0xe9ae('0x7'));var rimraf=require(_0xe9ae('0x8'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0xf3aa52,_0x4e889d){return _0xf3aa52['define'](_0xe9ae('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ba=['dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x416870,_0x2d1a4a){var _0x3030d3=function(_0x2e1492){while(--_0x2e1492){_0x416870['push'](_0x416870['shift']());}};_0x3030d3(++_0x2d1a4a);}(_0xd7ba,0xef));var _0xad7b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd7ba[_0x432682];return _0x463d05;};'use strict';var _=require(_0xad7b('0x0'));var util=require(_0xad7b('0x1'));var logger=require(_0xad7b('0x2'))(_0xad7b('0x3'));var moment=require(_0xad7b('0x4'));var BPromise=require(_0xad7b('0x5'));var rp=require(_0xad7b('0x6'));var fs=require('fs');var path=require(_0xad7b('0x7'));var rimraf=require(_0xad7b('0x8'));var config=require('../../config/environment');var attributes=require(_0xad7b('0x9'));module[_0xad7b('0xa')]=function(_0x21ce0a,_0x1c546d){return _0x21ce0a[_0xad7b('0xb')](_0xad7b('0xc'),attributes,{'tableName':_0xad7b('0xd'),'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 a1526d1..98453f8 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 _0x986c=['DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30f07a,_0x98341){var _0xb38461=function(_0x7b287a){while(--_0x7b287a){_0x30f07a['push'](_0x30f07a['shift']());}};_0xb38461(++_0x98341);}(_0x986c,0xbd));var _0xc986=function(_0x170664,_0x2c94ed){_0x170664=_0x170664-0x0;var _0x45b096=_0x986c[_0x170664];return _0x45b096;};'use strict';var _=require(_0xc986('0x0'));var util=require('util');var moment=require(_0xc986('0x1'));var BPromise=require(_0xc986('0x2'));var rs=require(_0xc986('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc986('0x4'));var logger=require(_0xc986('0x5'))(_0xc986('0x6'));var config=require(_0xc986('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc986('0x8')][_0xc986('0x9')]({'port':0x232a});config[_0xc986('0xa')]=_[_0xc986('0xb')](config[_0xc986('0xa')],{'host':_0xc986('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc986('0xa')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x2d7be4,_0x4be94e,_0x2ddcb0){return new BPromise(function(_0x33f1c3,_0x1b1567){return client[_0xc986('0xd')](_0x2d7be4,_0x2ddcb0)[_0xc986('0xe')](function(_0x4ae267){logger[_0xc986('0xf')](_0xc986('0x10'),_0x4be94e,_0xc986('0x11'));logger[_0xc986('0x12')](_0xc986('0x13'),_0x4be94e,_0xc986('0x11'),JSON[_0xc986('0x14')](_0x4ae267));if(_0x4ae267[_0xc986('0x15')]){if(_0x4ae267[_0xc986('0x15')][_0xc986('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x4be94e,_0x4ae267[_0xc986('0x15')][_0xc986('0x17')]);return _0x1b1567(_0x4ae267['error'][_0xc986('0x17')]);}logger['error'](_0xc986('0x10'),_0x4be94e,_0x4ae267[_0xc986('0x15')][_0xc986('0x17')]);return _0x33f1c3(_0x4ae267[_0xc986('0x15')][_0xc986('0x17')]);}else{logger[_0xc986('0xf')](_0xc986('0x10'),_0x4be94e,_0xc986('0x11'));_0x33f1c3(_0x4ae267[_0xc986('0x18')][_0xc986('0x17')]);}})[_0xc986('0x19')](function(_0x5e6fb5){logger[_0xc986('0x15')](_0xc986('0x10'),_0x4be94e,_0x5e6fb5);_0x1b1567(_0x5e6fb5);});});} \ No newline at end of file +var _0x816c=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0x816c,0xfd));var _0xc816=function(_0x11907c,_0x145aaa){_0x11907c=_0x11907c-0x0;var _0x13d7b7=_0x816c[_0x11907c];return _0x13d7b7;};'use strict';var _=require(_0xc816('0x0'));var util=require('util');var moment=require(_0xc816('0x1'));var BPromise=require(_0xc816('0x2'));var rs=require(_0xc816('0x3'));var fs=require('fs');var Redis=require(_0xc816('0x4'));var db=require(_0xc816('0x5'))['db'];var utils=require(_0xc816('0x6'));var logger=require(_0xc816('0x7'))(_0xc816('0x8'));var config=require(_0xc816('0x9'));var jayson=require(_0xc816('0xa'));var client=jayson[_0xc816('0xb')]['http']({'port':0x232a});config[_0xc816('0xc')]=_[_0xc816('0xd')](config[_0xc816('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc816('0xe'))(new Redis(config[_0xc816('0xc')]));require('./dashboardItem.socket')[_0xc816('0xf')](socket);function respondWithRpcPromise(_0x59716e,_0x5def17,_0x784331){return new BPromise(function(_0x1196c9,_0x3e3184){return client[_0xc816('0x10')](_0x59716e,_0x784331)[_0xc816('0x11')](function(_0x191410){logger[_0xc816('0x12')](_0xc816('0x13'),_0x5def17,_0xc816('0x14'));logger[_0xc816('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5def17,_0xc816('0x14'),JSON[_0xc816('0x16')](_0x191410));if(_0x191410[_0xc816('0x17')]){if(_0x191410[_0xc816('0x17')][_0xc816('0x18')]===0x1f4){logger[_0xc816('0x17')](_0xc816('0x13'),_0x5def17,_0x191410[_0xc816('0x17')][_0xc816('0x19')]);return _0x3e3184(_0x191410[_0xc816('0x17')][_0xc816('0x19')]);}logger['error'](_0xc816('0x13'),_0x5def17,_0x191410[_0xc816('0x17')]['message']);return _0x1196c9(_0x191410[_0xc816('0x17')][_0xc816('0x19')]);}else{logger[_0xc816('0x12')](_0xc816('0x13'),_0x5def17,'request\x20sent');_0x1196c9(_0x191410[_0xc816('0x1a')][_0xc816('0x19')]);}})[_0xc816('0x1b')](function(_0x19ce76){logger[_0xc816('0x17')](_0xc816('0x13'),_0x5def17,_0x19ce76);_0x3e3184(_0x19ce76);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 74f42f4..7aefc73 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 _0xd039=['dashboardItem:','./dashboardItem.events','save','emit','removeListener','register','length'];(function(_0x5d48da,_0x594257){var _0x15e846=function(_0x10defc){while(--_0x10defc){_0x5d48da['push'](_0x5d48da['shift']());}};_0x15e846(++_0x594257);}(_0xd039,0xef));var _0x9d03=function(_0x4bff30,_0x5d8caa){_0x4bff30=_0x4bff30-0x0;var _0x112bcf=_0xd039[_0x4bff30];return _0x112bcf;};'use strict';var DashboardItemEvents=require(_0x9d03('0x0'));var events=[_0x9d03('0x1'),'remove','update'];function createListener(_0x2ed894,_0xd68f7e){return function(_0x223759){_0xd68f7e[_0x9d03('0x2')](_0x2ed894,_0x223759);};}function removeListener(_0x2596b2,_0x59e0b5){return function(){DashboardItemEvents[_0x9d03('0x3')](_0x2596b2,_0x59e0b5);};}exports[_0x9d03('0x4')]=function(_0x12148d){for(var _0x4110d5=0x0,_0x2e8f98=events[_0x9d03('0x5')];_0x4110d5<_0x2e8f98;_0x4110d5++){var _0x3af2f9=events[_0x4110d5];var _0x46687b=createListener(_0x9d03('0x6')+_0x3af2f9,_0x12148d);DashboardItemEvents['on'](_0x3af2f9,_0x46687b);}}; \ No newline at end of file +var _0x4c33=['removeListener','length','dashboardItem:','./dashboardItem.events','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c33,0x1cb));var _0x34c3=function(_0xa0a031,_0x3e70b7){_0xa0a031=_0xa0a031-0x0;var _0x292dad=_0x4c33[_0xa0a031];return _0x292dad;};'use strict';var DashboardItemEvents=require(_0x34c3('0x0'));var events=[_0x34c3('0x1'),'remove',_0x34c3('0x2')];function createListener(_0x3661b6,_0x2fffcd){return function(_0x106f30){_0x2fffcd['emit'](_0x3661b6,_0x106f30);};}function removeListener(_0x156e19,_0x2602e7){return function(){DashboardItemEvents[_0x34c3('0x3')](_0x156e19,_0x2602e7);};}exports['register']=function(_0xac1c4b){for(var _0x2f4568=0x0,_0x249090=events[_0x34c3('0x4')];_0x2f4568<_0x249090;_0x2f4568++){var _0xac1eb8=events[_0x2f4568];var _0x18c114=createListener(_0x34c3('0x5')+_0xac1eb8,_0xac1c4b);DashboardItemEvents['on'](_0xac1eb8,_0x18c114);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index decc663..39a0211 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 _0xdd95=['post','create','/:id','update','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xdd95,0x66));var _0x5dd9=function(_0x154b4c,_0xa38e2){_0x154b4c=_0x154b4c-0x0;var _0x100586=_0xdd95[_0x154b4c];return _0x100586;};'use strict';var multer=require(_0x5dd9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dd9('0x1'));var router=express[_0x5dd9('0x2')]();var fs_extra=require(_0x5dd9('0x3'));var auth=require(_0x5dd9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5dd9('0x5'));var controller=require(_0x5dd9('0x6'));router[_0x5dd9('0x7')]('/:id',auth[_0x5dd9('0x8')](),controller[_0x5dd9('0x9')]);router[_0x5dd9('0xa')]('/',auth[_0x5dd9('0x8')](),controller[_0x5dd9('0xb')]);router['put'](_0x5dd9('0xc'),auth[_0x5dd9('0x8')](),controller[_0x5dd9('0xd')]);router[_0x5dd9('0xe')](_0x5dd9('0xc'),auth[_0x5dd9('0x8')](),controller[_0x5dd9('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd501=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy'];(function(_0x2bca2a,_0x4a365c){var _0x538596=function(_0x71b897){while(--_0x71b897){_0x2bca2a['push'](_0x2bca2a['shift']());}};_0x538596(++_0x4a365c);}(_0xd501,0x105));var _0x1d50=function(_0x268aff,_0x4eb305){_0x268aff=_0x268aff-0x0;var _0x1fcef3=_0xd501[_0x268aff];return _0x1fcef3;};'use strict';var multer=require('multer');var util=require(_0x1d50('0x0'));var path=require(_0x1d50('0x1'));var timeout=require(_0x1d50('0x2'));var express=require(_0x1d50('0x3'));var router=express[_0x1d50('0x4')]();var fs_extra=require(_0x1d50('0x5'));var auth=require(_0x1d50('0x6'));var interaction=require(_0x1d50('0x7'));var config=require(_0x1d50('0x8'));var controller=require(_0x1d50('0x9'));router[_0x1d50('0xa')](_0x1d50('0xb'),auth[_0x1d50('0xc')](),controller[_0x1d50('0xd')]);router[_0x1d50('0xe')]('/',auth[_0x1d50('0xc')](),controller[_0x1d50('0xf')]);router[_0x1d50('0x10')](_0x1d50('0xb'),auth[_0x1d50('0xc')](),controller[_0x1d50('0x11')]);router['delete'](_0x1d50('0xb'),auth[_0x1d50('0xc')](),controller[_0x1d50('0x12')]);module[_0x1d50('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index eef2582..6107702 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 _0xc783=['ENUM','second','sequelize','exports'];(function(_0x5ce1c1,_0x57c9b0){var _0x229af0=function(_0x5da1e2){while(--_0x5da1e2){_0x5ce1c1['push'](_0x5ce1c1['shift']());}};_0x229af0(++_0x57c9b0);}(_0xc783,0xf6));var _0x3c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc783[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3c78('0x0'));module[_0x3c78('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x3c78('0x2')]('first',_0x3c78('0x3'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x94fb=['STRING','ENUM','first','second','third','sequelize'];(function(_0x333261,_0x4a9644){var _0x4b1c8c=function(_0x54c88b){while(--_0x54c88b){_0x333261['push'](_0x333261['shift']());}};_0x4b1c8c(++_0x4a9644);}(_0x94fb,0xe9));var _0xb94f=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x94fb[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xb94f('0x0'));module['exports']={'name':{'type':Sequelize[_0xb94f('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xb94f('0x2')](_0xb94f('0x3'),_0xb94f('0x4'),_0xb94f('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xb94f('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 119d274..b3e9e17 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 _0x7ca8=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x592786,_0x583d26){var _0x2cfa5f=function(_0x3ec2e0){while(--_0x3ec2e0){_0x592786['push'](_0x592786['shift']());}};_0x2cfa5f(++_0x583d26);}(_0x7ca8,0xf5));var _0x87ca=function(_0x17c285,_0x5da6db){_0x17c285=_0x17c285-0x0;var _0xc8f50e=_0x7ca8[_0x17c285];return _0xc8f50e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87ca('0x0'));var zipdir=require(_0x87ca('0x1'));var jsonpatch=require(_0x87ca('0x2'));var rp=require(_0x87ca('0x3'));var moment=require(_0x87ca('0x4'));var BPromise=require(_0x87ca('0x5'));var Mustache=require(_0x87ca('0x6'));var util=require(_0x87ca('0x7'));var path=require(_0x87ca('0x8'));var sox=require(_0x87ca('0x9'));var csv=require(_0x87ca('0xa'));var ejs=require(_0x87ca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x87ca('0xc'));var crypto=require(_0x87ca('0xd'));var jsforce=require(_0x87ca('0xe'));var deskjs=require(_0x87ca('0xf'));var toCsv=require(_0x87ca('0xa'));var querystring=require(_0x87ca('0x10'));var Papa=require('papaparse');var Redis=require(_0x87ca('0x11'));var authService=require(_0x87ca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x87ca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87ca('0x14'))('api');var utils=require(_0x87ca('0x15'));var config=require(_0x87ca('0x16'));var licenseUtil=require(_0x87ca('0x17'));var db=require(_0x87ca('0x18'))['db'];function respondWithStatusCode(_0x3ed2a1,_0x393511){_0x393511=_0x393511||0xcc;return function(_0x298997){if(_0x298997){return _0x3ed2a1[_0x87ca('0x19')](_0x393511);}return _0x3ed2a1[_0x87ca('0x1a')](_0x393511)['end']();};}function respondWithResult(_0x25224f,_0x5644ee){_0x5644ee=_0x5644ee||0xc8;return function(_0xaaa33c){if(_0xaaa33c){return _0x25224f[_0x87ca('0x1a')](_0x5644ee)[_0x87ca('0x1b')](_0xaaa33c);}};}function respondWithFilteredResult(_0x32436b,_0x51c77a){return function(_0x3ef441){if(_0x3ef441){var _0x58f71f=typeof _0x51c77a[_0x87ca('0x1c')]===_0x87ca('0x1d')&&typeof _0x51c77a[_0x87ca('0x1e')]===_0x87ca('0x1d');var _0x5e855b=_0x3ef441[_0x87ca('0x1f')];var _0x5e9ef3=_0x58f71f?0x0:_0x51c77a[_0x87ca('0x1c')];var _0x69c241=_0x58f71f?_0x3ef441[_0x87ca('0x1f')]:_0x51c77a['offset']+_0x51c77a['limit'];var _0x1d1b97;if(_0x69c241>=_0x5e855b){_0x69c241=_0x5e855b;_0x1d1b97=0xc8;}else{_0x1d1b97=0xce;}_0x32436b[_0x87ca('0x1a')](_0x1d1b97);return _0x32436b[_0x87ca('0x20')](_0x87ca('0x21'),_0x5e9ef3+'-'+_0x69c241+'/'+_0x5e855b)[_0x87ca('0x1b')](_0x3ef441);}return null;};}function patchUpdates(_0x172669){return function(_0x30899e){try{jsonpatch[_0x87ca('0x22')](_0x30899e,_0x172669,!![]);}catch(_0x118d05){return BPromise[_0x87ca('0x23')](_0x118d05);}return _0x30899e[_0x87ca('0x24')]();};}function saveUpdates(_0x34e9f7,_0x591540){return function(_0x3060fc){if(_0x3060fc){return _0x3060fc[_0x87ca('0x25')](_0x34e9f7)[_0x87ca('0x26')](function(_0x581652){return _0x581652;});}return null;};}function removeEntity(_0x1d5d24,_0x17987c){return function(_0x1e09a3){if(_0x1e09a3){return _0x1e09a3[_0x87ca('0x27')]()[_0x87ca('0x26')](function(){var _0x484b0b=_0x1e09a3['get']({'plain':!![]});var _0x32b6b6=_0x87ca('0x28');return db[_0x87ca('0x29')][_0x87ca('0x27')]({'where':{'type':_0x32b6b6,'resourceId':_0x484b0b['id']}})[_0x87ca('0x26')](function(){return _0x1e09a3;});})['then'](function(){_0x1d5d24[_0x87ca('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x235697,_0x19e3d1){return function(_0x37a22f){if(!_0x37a22f){_0x235697[_0x87ca('0x19')](0x194);}return _0x37a22f;};}function handleError(_0x2016e7,_0x5cb8f4){_0x5cb8f4=_0x5cb8f4||0x1f4;return function(_0x35fa09){logger[_0x87ca('0x2a')](_0x35fa09[_0x87ca('0x2b')]);if(_0x35fa09[_0x87ca('0x2c')]){delete _0x35fa09[_0x87ca('0x2c')];}_0x2016e7[_0x87ca('0x1a')](_0x5cb8f4)[_0x87ca('0x2d')](_0x35fa09);};}exports['index']=function(_0x18b89f,_0x5535bd){var _0x302b5f={},_0x5ba1f5={},_0x436d08={'count':0x0,'rows':[]};var _0x123982=_[_0x87ca('0x2e')](db[_0x87ca('0x2f')][_0x87ca('0x30')],function(_0x2220a5){return{'name':_0x2220a5[_0x87ca('0x31')],'type':_0x2220a5['type'][_0x87ca('0x32')]};});_0x5ba1f5[_0x87ca('0x33')]=_['map'](_0x123982,'name');_0x5ba1f5[_0x87ca('0x34')]=_[_0x87ca('0x35')](_0x18b89f[_0x87ca('0x34')]);_0x5ba1f5[_0x87ca('0x36')]=_[_0x87ca('0x37')](_0x5ba1f5[_0x87ca('0x33')],_0x5ba1f5[_0x87ca('0x34')]);_0x302b5f[_0x87ca('0x38')]=_[_0x87ca('0x37')](_0x5ba1f5[_0x87ca('0x33')],qs[_0x87ca('0x39')](_0x18b89f[_0x87ca('0x34')]['fields']));_0x302b5f[_0x87ca('0x38')]=_0x302b5f[_0x87ca('0x38')][_0x87ca('0x3a')]?_0x302b5f[_0x87ca('0x38')]:_0x5ba1f5[_0x87ca('0x33')];if(!_0x18b89f[_0x87ca('0x34')][_0x87ca('0x3b')](_0x87ca('0x3c'))){_0x302b5f[_0x87ca('0x1e')]=qs['limit'](_0x18b89f['query'][_0x87ca('0x1e')]);_0x302b5f[_0x87ca('0x1c')]=qs[_0x87ca('0x1c')](_0x18b89f[_0x87ca('0x34')][_0x87ca('0x1c')]);}_0x302b5f[_0x87ca('0x3d')]=qs[_0x87ca('0x3e')](_0x18b89f['query'][_0x87ca('0x3e')]);_0x302b5f[_0x87ca('0x3f')]=qs[_0x87ca('0x36')](_[_0x87ca('0x40')](_0x18b89f['query'],_0x5ba1f5[_0x87ca('0x36')]),_0x123982);if(_0x18b89f[_0x87ca('0x34')][_0x87ca('0x41')]){_0x302b5f['where']=_[_0x87ca('0x42')](_0x302b5f[_0x87ca('0x3f')],{'$or':_[_0x87ca('0x2e')](_0x123982,function(_0xab4e2){if(_0xab4e2[_0x87ca('0x43')]!=='VIRTUAL'){var _0x98c84a={};_0x98c84a[_0xab4e2['name']]={'$like':'%'+_0x18b89f['query'][_0x87ca('0x41')]+'%'};return _0x98c84a;}})});}_0x302b5f=_['merge']({},_0x302b5f,_0x18b89f[_0x87ca('0x44')]);var _0x5707fc={'where':_0x302b5f['where']};return db['Disposition'][_0x87ca('0x1f')](_0x5707fc)[_0x87ca('0x26')](function(_0x4467cb){_0x436d08[_0x87ca('0x1f')]=_0x4467cb;if(_0x18b89f['query'][_0x87ca('0x45')]){_0x302b5f[_0x87ca('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x302b5f);})['then'](function(_0x3c6d20){_0x436d08[_0x87ca('0x47')]=_0x3c6d20;return _0x436d08;})[_0x87ca('0x26')](respondWithFilteredResult(_0x5535bd,_0x302b5f))['catch'](handleError(_0x5535bd,null));};exports['show']=function(_0x3c5022,_0x519da4){var _0x4ae6fe={'raw':!![],'where':{'id':_0x3c5022['params']['id']}},_0xfee87={};_0xfee87[_0x87ca('0x33')]=_[_0x87ca('0x35')](db[_0x87ca('0x2f')][_0x87ca('0x30')]);_0xfee87[_0x87ca('0x34')]=_[_0x87ca('0x35')](_0x3c5022[_0x87ca('0x34')]);_0xfee87['filters']=_[_0x87ca('0x37')](_0xfee87[_0x87ca('0x33')],_0xfee87[_0x87ca('0x34')]);_0x4ae6fe['attributes']=_[_0x87ca('0x37')](_0xfee87[_0x87ca('0x33')],qs[_0x87ca('0x39')](_0x3c5022['query']['fields']));_0x4ae6fe[_0x87ca('0x38')]=_0x4ae6fe[_0x87ca('0x38')][_0x87ca('0x3a')]?_0x4ae6fe[_0x87ca('0x38')]:_0xfee87['model'];if(_0x3c5022['query']['includeAll']){_0x4ae6fe[_0x87ca('0x46')]=[{'all':!![]}];}_0x4ae6fe=_['merge']({},_0x4ae6fe,_0x3c5022[_0x87ca('0x44')]);return db[_0x87ca('0x2f')][_0x87ca('0x48')](_0x4ae6fe)[_0x87ca('0x26')](handleEntityNotFound(_0x519da4,null))[_0x87ca('0x26')](respondWithResult(_0x519da4,null))[_0x87ca('0x49')](handleError(_0x519da4,null));};exports[_0x87ca('0x4a')]=function(_0x27ff1e,_0x40da77){return db['Disposition'][_0x87ca('0x4a')](_0x27ff1e[_0x87ca('0x4b')],{})[_0x87ca('0x26')](function(_0x26c7b6){var _0x2f0a4f=_0x27ff1e[_0x87ca('0x4c')][_0x87ca('0x4d')]({'plain':!![]});if(!_0x2f0a4f)throw new Error(_0x87ca('0x4e'));if(_0x2f0a4f['role']===_0x87ca('0x4c')){var _0x49687b=_0x26c7b6['get']({'plain':!![]});var _0x433a39=_0x87ca('0x28');return db[_0x87ca('0x4f')][_0x87ca('0x48')]({'where':{'name':_0x433a39,'userProfileId':_0x2f0a4f[_0x87ca('0x50')]},'raw':!![]})[_0x87ca('0x26')](function(_0x263191){if(_0x263191&&_0x263191[_0x87ca('0x51')]===0x0){return db['UserProfileResource'][_0x87ca('0x4a')]({'name':_0x49687b[_0x87ca('0x2c')],'resourceId':_0x49687b['id'],'type':_0x263191['name'],'sectionId':_0x263191['id']},{})[_0x87ca('0x26')](function(){return _0x26c7b6;});}else{return _0x26c7b6;}})[_0x87ca('0x49')](function(_0x45c6fa){logger[_0x87ca('0x2a')](_0x87ca('0x52'),_0x45c6fa);throw _0x45c6fa;});}return _0x26c7b6;})[_0x87ca('0x26')](respondWithResult(_0x40da77,0xc9))['catch'](handleError(_0x40da77,null));};exports[_0x87ca('0x25')]=function(_0x37d5d6,_0x53ea5e){if(_0x37d5d6['body']['id']){delete _0x37d5d6[_0x87ca('0x4b')]['id'];}return db[_0x87ca('0x2f')][_0x87ca('0x48')]({'where':{'id':_0x37d5d6['params']['id']}})[_0x87ca('0x26')](handleEntityNotFound(_0x53ea5e,null))['then'](saveUpdates(_0x37d5d6[_0x87ca('0x4b')],null))['then'](respondWithResult(_0x53ea5e,null))[_0x87ca('0x49')](handleError(_0x53ea5e,null));};exports[_0x87ca('0x27')]=function(_0x1ec309,_0x493665){return db[_0x87ca('0x2f')][_0x87ca('0x48')]({'where':{'id':_0x1ec309[_0x87ca('0x53')]['id']}})['then'](handleEntityNotFound(_0x493665,null))[_0x87ca('0x26')](removeEntity(_0x493665,null))['catch'](handleError(_0x493665,null));}; \ No newline at end of file +var _0xdb15=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','Dispositions','sendStatus','stack','name','send','map','Disposition','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','get','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xdb15,0x94));var _0x5db1=function(_0x3a87a0,_0x36f279){_0x3a87a0=_0x3a87a0-0x0;var _0x15edb8=_0xdb15[_0x3a87a0];return _0x15edb8;};'use strict';var emlformat=require(_0x5db1('0x0'));var rimraf=require(_0x5db1('0x1'));var zipdir=require(_0x5db1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5db1('0x3'));var moment=require(_0x5db1('0x4'));var BPromise=require(_0x5db1('0x5'));var Mustache=require(_0x5db1('0x6'));var util=require('util');var path=require(_0x5db1('0x7'));var sox=require(_0x5db1('0x8'));var csv=require(_0x5db1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5db1('0xa'));var _=require(_0x5db1('0xb'));var squel=require(_0x5db1('0xc'));var crypto=require(_0x5db1('0xd'));var jsforce=require(_0x5db1('0xe'));var deskjs=require(_0x5db1('0xf'));var toCsv=require(_0x5db1('0x9'));var querystring=require(_0x5db1('0x10'));var Papa=require(_0x5db1('0x11'));var Redis=require('ioredis');var authService=require(_0x5db1('0x12'));var qs=require(_0x5db1('0x13'));var as=require(_0x5db1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5db1('0x15'));var utils=require(_0x5db1('0x16'));var config=require(_0x5db1('0x17'));var licenseUtil=require(_0x5db1('0x18'));var db=require(_0x5db1('0x19'))['db'];function respondWithStatusCode(_0x5141a1,_0x1c696f){_0x1c696f=_0x1c696f||0xcc;return function(_0x1ad17d){if(_0x1ad17d){return _0x5141a1['sendStatus'](_0x1c696f);}return _0x5141a1[_0x5db1('0x1a')](_0x1c696f)[_0x5db1('0x1b')]();};}function respondWithResult(_0x52acd3,_0x30867b){_0x30867b=_0x30867b||0xc8;return function(_0x59cf6d){if(_0x59cf6d){return _0x52acd3[_0x5db1('0x1a')](_0x30867b)[_0x5db1('0x1c')](_0x59cf6d);}};}function respondWithFilteredResult(_0x3c7115,_0x30d7a){return function(_0x315f9e){if(_0x315f9e){var _0x1e660e=typeof _0x30d7a['offset']===_0x5db1('0x1d')&&typeof _0x30d7a[_0x5db1('0x1e')]===_0x5db1('0x1d');var _0x382a3a=_0x315f9e[_0x5db1('0x1f')];var _0x5d40e6=_0x1e660e?0x0:_0x30d7a[_0x5db1('0x20')];var _0x5c4f82=_0x1e660e?_0x315f9e[_0x5db1('0x1f')]:_0x30d7a[_0x5db1('0x20')]+_0x30d7a[_0x5db1('0x1e')];var _0x2154db;if(_0x5c4f82>=_0x382a3a){_0x5c4f82=_0x382a3a;_0x2154db=0xc8;}else{_0x2154db=0xce;}_0x3c7115[_0x5db1('0x1a')](_0x2154db);return _0x3c7115[_0x5db1('0x21')](_0x5db1('0x22'),_0x5d40e6+'-'+_0x5c4f82+'/'+_0x382a3a)[_0x5db1('0x1c')](_0x315f9e);}return null;};}function patchUpdates(_0x443afe){return function(_0x4f7ea8){try{jsonpatch['apply'](_0x4f7ea8,_0x443afe,!![]);}catch(_0x257a91){return BPromise[_0x5db1('0x23')](_0x257a91);}return _0x4f7ea8[_0x5db1('0x24')]();};}function saveUpdates(_0x5486b3,_0x2e9590){return function(_0x252393){if(_0x252393){return _0x252393['update'](_0x5486b3)[_0x5db1('0x25')](function(_0x1ea2ff){return _0x1ea2ff;});}return null;};}function removeEntity(_0x1a5728,_0x59e18e){return function(_0x508a69){if(_0x508a69){return _0x508a69[_0x5db1('0x26')]()[_0x5db1('0x25')](function(){var _0x199729=_0x508a69['get']({'plain':!![]});var _0x5b5f61=_0x5db1('0x27');return db['UserProfileResource'][_0x5db1('0x26')]({'where':{'type':_0x5b5f61,'resourceId':_0x199729['id']}})[_0x5db1('0x25')](function(){return _0x508a69;});})['then'](function(){_0x1a5728['status'](0xcc)[_0x5db1('0x1b')]();});}};}function handleEntityNotFound(_0x54075f,_0x2728bf){return function(_0xad8f5a){if(!_0xad8f5a){_0x54075f[_0x5db1('0x28')](0x194);}return _0xad8f5a;};}function handleError(_0x49d395,_0x122969){_0x122969=_0x122969||0x1f4;return function(_0x58aabb){logger['error'](_0x58aabb[_0x5db1('0x29')]);if(_0x58aabb[_0x5db1('0x2a')]){delete _0x58aabb[_0x5db1('0x2a')];}_0x49d395[_0x5db1('0x1a')](_0x122969)[_0x5db1('0x2b')](_0x58aabb);};}exports['index']=function(_0x1f0985,_0x5e395c){var _0x367f17={},_0x1771f9={},_0x3005cb={'count':0x0,'rows':[]};var _0x4e3b7c=_[_0x5db1('0x2c')](db[_0x5db1('0x2d')]['rawAttributes'],function(_0x375db2){return{'name':_0x375db2[_0x5db1('0x2e')],'type':_0x375db2['type'][_0x5db1('0x2f')]};});_0x1771f9['model']=_[_0x5db1('0x2c')](_0x4e3b7c,_0x5db1('0x2a'));_0x1771f9[_0x5db1('0x30')]=_[_0x5db1('0x31')](_0x1f0985[_0x5db1('0x30')]);_0x1771f9[_0x5db1('0x32')]=_[_0x5db1('0x33')](_0x1771f9[_0x5db1('0x34')],_0x1771f9[_0x5db1('0x30')]);_0x367f17['attributes']=_[_0x5db1('0x33')](_0x1771f9['model'],qs['fields'](_0x1f0985['query'][_0x5db1('0x35')]));_0x367f17[_0x5db1('0x36')]=_0x367f17[_0x5db1('0x36')]['length']?_0x367f17['attributes']:_0x1771f9['model'];if(!_0x1f0985[_0x5db1('0x30')][_0x5db1('0x37')](_0x5db1('0x38'))){_0x367f17[_0x5db1('0x1e')]=qs[_0x5db1('0x1e')](_0x1f0985[_0x5db1('0x30')][_0x5db1('0x1e')]);_0x367f17[_0x5db1('0x20')]=qs[_0x5db1('0x20')](_0x1f0985[_0x5db1('0x30')]['offset']);}_0x367f17[_0x5db1('0x39')]=qs[_0x5db1('0x3a')](_0x1f0985['query'][_0x5db1('0x3a')]);_0x367f17[_0x5db1('0x3b')]=qs[_0x5db1('0x32')](_[_0x5db1('0x3c')](_0x1f0985[_0x5db1('0x30')],_0x1771f9[_0x5db1('0x32')]),_0x4e3b7c);if(_0x1f0985[_0x5db1('0x30')]['filter']){_0x367f17[_0x5db1('0x3b')]=_[_0x5db1('0x3d')](_0x367f17['where'],{'$or':_[_0x5db1('0x2c')](_0x4e3b7c,function(_0x4c86fe){if(_0x4c86fe['type']!==_0x5db1('0x3e')){var _0x17a7da={};_0x17a7da[_0x4c86fe[_0x5db1('0x2a')]]={'$like':'%'+_0x1f0985[_0x5db1('0x30')]['filter']+'%'};return _0x17a7da;}})});}_0x367f17=_[_0x5db1('0x3d')]({},_0x367f17,_0x1f0985['options']);var _0x38a747={'where':_0x367f17[_0x5db1('0x3b')]};return db['Disposition'][_0x5db1('0x1f')](_0x38a747)[_0x5db1('0x25')](function(_0x14769b){_0x3005cb['count']=_0x14769b;if(_0x1f0985[_0x5db1('0x30')][_0x5db1('0x3f')]){_0x367f17[_0x5db1('0x40')]=[{'all':!![]}];}return db['Disposition'][_0x5db1('0x41')](_0x367f17);})[_0x5db1('0x25')](function(_0xa347ab){_0x3005cb[_0x5db1('0x42')]=_0xa347ab;return _0x3005cb;})[_0x5db1('0x25')](respondWithFilteredResult(_0x5e395c,_0x367f17))[_0x5db1('0x43')](handleError(_0x5e395c,null));};exports[_0x5db1('0x44')]=function(_0x4268bd,_0x5aaa84){var _0x56d322={'raw':!![],'where':{'id':_0x4268bd['params']['id']}},_0x5a1407={};_0x5a1407['model']=_[_0x5db1('0x31')](db[_0x5db1('0x2d')][_0x5db1('0x45')]);_0x5a1407[_0x5db1('0x30')]=_['keys'](_0x4268bd[_0x5db1('0x30')]);_0x5a1407[_0x5db1('0x32')]=_[_0x5db1('0x33')](_0x5a1407['model'],_0x5a1407['query']);_0x56d322[_0x5db1('0x36')]=_['intersection'](_0x5a1407[_0x5db1('0x34')],qs[_0x5db1('0x35')](_0x4268bd['query'][_0x5db1('0x35')]));_0x56d322[_0x5db1('0x36')]=_0x56d322[_0x5db1('0x36')]['length']?_0x56d322[_0x5db1('0x36')]:_0x5a1407[_0x5db1('0x34')];if(_0x4268bd[_0x5db1('0x30')][_0x5db1('0x3f')]){_0x56d322[_0x5db1('0x40')]=[{'all':!![]}];}_0x56d322=_['merge']({},_0x56d322,_0x4268bd[_0x5db1('0x46')]);return db[_0x5db1('0x2d')][_0x5db1('0x47')](_0x56d322)[_0x5db1('0x25')](handleEntityNotFound(_0x5aaa84,null))['then'](respondWithResult(_0x5aaa84,null))['catch'](handleError(_0x5aaa84,null));};exports[_0x5db1('0x48')]=function(_0x3c164c,_0xb1a473){return db['Disposition'][_0x5db1('0x48')](_0x3c164c[_0x5db1('0x49')],{})[_0x5db1('0x25')](function(_0x5b8557){var _0x30b59c=_0x3c164c['user'][_0x5db1('0x4a')]({'plain':!![]});if(!_0x30b59c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30b59c[_0x5db1('0x4b')]==='user'){var _0x4b0654=_0x5b8557[_0x5db1('0x4a')]({'plain':!![]});var _0x5b9cc4=_0x5db1('0x27');return db[_0x5db1('0x4c')][_0x5db1('0x47')]({'where':{'name':_0x5b9cc4,'userProfileId':_0x30b59c[_0x5db1('0x4d')]},'raw':!![]})[_0x5db1('0x25')](function(_0x30d509){if(_0x30d509&&_0x30d509['autoAssociation']===0x0){return db[_0x5db1('0x4e')][_0x5db1('0x48')]({'name':_0x4b0654[_0x5db1('0x2a')],'resourceId':_0x4b0654['id'],'type':_0x30d509[_0x5db1('0x2a')],'sectionId':_0x30d509['id']},{})[_0x5db1('0x25')](function(){return _0x5b8557;});}else{return _0x5b8557;}})[_0x5db1('0x43')](function(_0x362f4e){logger[_0x5db1('0x4f')](_0x5db1('0x50'),_0x362f4e);throw _0x362f4e;});}return _0x5b8557;})['then'](respondWithResult(_0xb1a473,0xc9))[_0x5db1('0x43')](handleError(_0xb1a473,null));};exports[_0x5db1('0x51')]=function(_0x1cb9b4,_0x61e82d){if(_0x1cb9b4[_0x5db1('0x49')]['id']){delete _0x1cb9b4[_0x5db1('0x49')]['id'];}return db[_0x5db1('0x2d')]['find']({'where':{'id':_0x1cb9b4['params']['id']}})[_0x5db1('0x25')](handleEntityNotFound(_0x61e82d,null))[_0x5db1('0x25')](saveUpdates(_0x1cb9b4['body'],null))[_0x5db1('0x25')](respondWithResult(_0x61e82d,null))[_0x5db1('0x43')](handleError(_0x61e82d,null));};exports[_0x5db1('0x26')]=function(_0x1bd889,_0x35e124){return db['Disposition'][_0x5db1('0x47')]({'where':{'id':_0x1bd889[_0x5db1('0x52')]['id']}})[_0x5db1('0x25')](handleEntityNotFound(_0x35e124,null))[_0x5db1('0x25')](removeEntity(_0x35e124,null))[_0x5db1('0x43')](handleError(_0x35e124,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index ac2d6b2..b28fc2d 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 _0x4cc4=['name_voice','name','ListId','name_chat','name_mail','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','../../config/logger','moment','bluebird','request-promise','path','./disposition.attributes','exports','Disposition','tools_dispositions'];(function(_0x5ce5fb,_0x251a6a){var _0xdb46a2=function(_0xc8c205){while(--_0xc8c205){_0x5ce5fb['push'](_0x5ce5fb['shift']());}};_0xdb46a2(++_0x251a6a);}(_0x4cc4,0x96));var _0x44cc=function(_0x8e1298,_0x1c6e8e){_0x8e1298=_0x8e1298-0x0;var _0x59e5dc=_0x4cc4[_0x8e1298];return _0x59e5dc;};'use strict';var _=require(_0x44cc('0x0'));var util=require('util');var logger=require(_0x44cc('0x1'))('api');var moment=require(_0x44cc('0x2'));var BPromise=require(_0x44cc('0x3'));var rp=require(_0x44cc('0x4'));var fs=require('fs');var path=require(_0x44cc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44cc('0x6'));module[_0x44cc('0x7')]=function(_0x4fd424,_0x2bf63f){return _0x4fd424['define'](_0x44cc('0x8'),attributes,{'tableName':_0x44cc('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x44cc('0xa'),'fields':[_0x44cc('0xb'),_0x44cc('0xc')]},{'unique':!![],'name':_0x44cc('0xd'),'fields':[_0x44cc('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0x44cc('0xe'),'fields':[_0x44cc('0xb'),'MailAccountId']},{'unique':!![],'name':_0x44cc('0xf'),'fields':[_0x44cc('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x44cc('0x10'),'fields':['name',_0x44cc('0x11')]},{'unique':!![],'name':_0x44cc('0x12'),'fields':[_0x44cc('0xb'),_0x44cc('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x44cc('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b48=['name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_sms','SmsAccountId','name_fax','FaxAccountId'];(function(_0x47aa8f,_0x8e92b0){var _0x2e8f79=function(_0x5317c2){while(--_0x5317c2){_0x47aa8f['push'](_0x47aa8f['shift']());}};_0x2e8f79(++_0x8e92b0);}(_0x7b48,0x1e4));var _0x87b4=function(_0x5d0792,_0x486759){_0x5d0792=_0x5d0792-0x0;var _0x2885a6=_0x7b48[_0x5d0792];return _0x2885a6;};'use strict';var _=require(_0x87b4('0x0'));var util=require('util');var logger=require(_0x87b4('0x1'))(_0x87b4('0x2'));var moment=require(_0x87b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x87b4('0x4'));var fs=require('fs');var path=require(_0x87b4('0x5'));var rimraf=require('rimraf');var config=require(_0x87b4('0x6'));var attributes=require(_0x87b4('0x7'));module[_0x87b4('0x8')]=function(_0x469ef4,_0x44cf0d){return _0x469ef4[_0x87b4('0x9')](_0x87b4('0xa'),attributes,{'tableName':_0x87b4('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x87b4('0xc'),'fields':[_0x87b4('0xd'),_0x87b4('0xe')]},{'unique':!![],'name':_0x87b4('0xf'),'fields':[_0x87b4('0xd'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x87b4('0xd'),'MailAccountId']},{'unique':!![],'name':_0x87b4('0x10'),'fields':[_0x87b4('0xd'),_0x87b4('0x11')]},{'unique':!![],'name':_0x87b4('0x12'),'fields':[_0x87b4('0xd'),_0x87b4('0x13')]},{'unique':!![],'name':_0x87b4('0x14'),'fields':['name',_0x87b4('0x15')]},{'unique':!![],'name':_0x87b4('0x16'),'fields':[_0x87b4('0xd'),_0x87b4('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ae620b4..077fbf2 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(_0x244785,_0x56d386){var _0x4a3724=function(_0x25dc1a){while(--_0x25dc1a){_0x244785['push'](_0x244785['shift']());}};_0x4a3724(++_0x56d386);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x3d783b,_0x3d5a3e){var _0x38fbc8=function(_0x19a285){while(--_0x19a285){_0x3d783b['push'](_0x3d783b['shift']());}};_0x38fbc8(++_0x3d5a3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 e13849e..94244fd 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 _0x1277=['../../config/environment','./disposition.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x1bb180,_0x4e9d4e){var _0x59d7fb=function(_0x22ad21){while(--_0x22ad21){_0x1bb180['push'](_0x1bb180['shift']());}};_0x59d7fb(++_0x4e9d4e);}(_0x1277,0x1bc));var _0x7127=function(_0x4ca551,_0x5b2728){_0x4ca551=_0x4ca551-0x0;var _0x5ee620=_0x1277[_0x4ca551];return _0x5ee620;};'use strict';var multer=require(_0x7127('0x0'));var util=require(_0x7127('0x1'));var path=require(_0x7127('0x2'));var timeout=require(_0x7127('0x3'));var express=require(_0x7127('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7127('0x5'));var config=require(_0x7127('0x6'));var controller=require(_0x7127('0x7'));router['get']('/',auth[_0x7127('0x8')](),controller[_0x7127('0x9')]);router['get'](_0x7127('0xa'),auth[_0x7127('0x8')](),controller[_0x7127('0xb')]);router[_0x7127('0xc')]('/',auth[_0x7127('0x8')](),controller[_0x7127('0xd')]);router[_0x7127('0xe')]('/:id',auth[_0x7127('0x8')](),controller[_0x7127('0xf')]);router[_0x7127('0x10')](_0x7127('0xa'),auth[_0x7127('0x8')](),controller[_0x7127('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2e07=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2e07,0x1a1));var _0x72e0=function(_0x256ccf,_0x53a69d){_0x256ccf=_0x256ccf-0x0;var _0x1ae9cc=_0x2e07[_0x256ccf];return _0x1ae9cc;};'use strict';var multer=require(_0x72e0('0x0'));var util=require(_0x72e0('0x1'));var path=require(_0x72e0('0x2'));var timeout=require(_0x72e0('0x3'));var express=require('express');var router=express[_0x72e0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x72e0('0x5'));var interaction=require(_0x72e0('0x6'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x72e0('0x7')]('/',auth[_0x72e0('0x8')](),controller['index']);router['get'](_0x72e0('0x9'),auth['isAuthenticated'](),controller[_0x72e0('0xa')]);router[_0x72e0('0xb')]('/',auth['isAuthenticated'](),controller[_0x72e0('0xc')]);router[_0x72e0('0xd')](_0x72e0('0x9'),auth[_0x72e0('0x8')](),controller[_0x72e0('0xe')]);router[_0x72e0('0xf')](_0x72e0('0x9'),auth[_0x72e0('0x8')](),controller[_0x72e0('0x10')]);module[_0x72e0('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index e1f4582..78f5a29 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 _0xcb39=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','STRING','v17,v27,v29','SIP','IAX','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x3e3f14,_0x3ccac3){var _0x17b619=function(_0x23640b){while(--_0x23640b){_0x3e3f14['push'](_0x3e3f14['shift']());}};_0x17b619(++_0x3ccac3);}(_0xcb39,0x76));var _0x9cb3=function(_0x585700,_0x5eaa85){_0x585700=_0x585700-0x0;var _0x57eebb=_0xcb39[_0x585700];return _0x57eebb;};'use strict';var Sequelize=require(_0x9cb3('0x0'));module[_0x9cb3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x9cb3('0x2')](_0x9cb3('0x3'),'no'),'defaultValue':_0x9cb3('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x9cb3('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x9cb3('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x9cb3('0x6'),_0x9cb3('0x7'),_0x9cb3('0x8'),_0x9cb3('0x9'),'12000',_0x9cb3('0xa')),'defaultValue':_0x9cb3('0x7')},'maxrate':{'type':Sequelize[_0x9cb3('0x2')](_0x9cb3('0x6'),_0x9cb3('0x7'),'7200',_0x9cb3('0x9'),'12000',_0x9cb3('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x9cb3('0xb')],'defaultValue':_0x9cb3('0xc')},'gateway':{'type':Sequelize[_0x9cb3('0xb')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9cb3('0xb')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9cb3('0x2')](_0x9cb3('0xd'),_0x9cb3('0xe'),'DADHI','KHOMP'),'defaultValue':_0x9cb3('0xd')},'key':{'type':Sequelize[_0x9cb3('0xb')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9cb3('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9cb3('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9cb3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9cb3('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9cb3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9cb3('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9cb3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9cb3('0x11')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x14c0fe){if(!_0x14c0fe)this[_0x9cb3('0x12')](_0x9cb3('0x13'),null);this[_0x9cb3('0x12')]('mandatoryDisposition',_0x14c0fe);}}}; \ No newline at end of file +var _0xe80d=['mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','9600','12000','14400','4800','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x298e16,_0x2c4521){var _0x11262e=function(_0x242ba9){while(--_0x242ba9){_0x298e16['push'](_0x298e16['shift']());}};_0x11262e(++_0x2c4521);}(_0xe80d,0xfb));var _0xde80=function(_0x5ee748,_0x552a2b){_0x5ee748=_0x5ee748-0x0;var _0x36da37=_0xe80d[_0x5ee748];return _0x36da37;};'use strict';var Sequelize=require(_0xde80('0x0'));module[_0xde80('0x1')]={'name':{'type':Sequelize[_0xde80('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xde80('0x3'),'no'),'defaultValue':_0xde80('0x3')},'headerinfo':{'type':Sequelize[_0xde80('0x2')],'defaultValue':_0xde80('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xde80('0x5')},'minrate':{'type':Sequelize[_0xde80('0x6')](_0xde80('0x7'),'4800','7200',_0xde80('0x8'),_0xde80('0x9'),_0xde80('0xa')),'defaultValue':_0xde80('0xb')},'maxrate':{'type':Sequelize[_0xde80('0x6')](_0xde80('0x7'),_0xde80('0xb'),_0xde80('0xc'),_0xde80('0x8'),'12000',_0xde80('0xa')),'defaultValue':_0xde80('0xa')},'modem':{'type':Sequelize[_0xde80('0x2')],'defaultValue':_0xde80('0xd')},'gateway':{'type':Sequelize[_0xde80('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xde80('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xde80('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xde80('0x6')](_0xde80('0xf'),_0xde80('0x10'),_0xde80('0x11'),_0xde80('0x12')),'defaultValue':_0xde80('0xf')},'key':{'type':Sequelize[_0xde80('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xde80('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xde80('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xde80('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xde80('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xde80('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde80('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde80('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde80('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde80('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xde80('0x14')],'defaultValue':![],'comment':_0xde80('0x15'),'set':function(_0xbc9c3e){if(!_0xbc9c3e)this[_0xde80('0x16')](_0xde80('0x17'),null);this['setDataValue'](_0xde80('0x18'),_0xbc9c3e);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9c44da7..7326a06 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 _0xc2c7=['fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','findOne','Disposition','sort','include','removeDispositions','ids','CannedAnswer','rows','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','tag','addApplications','transaction','FaxApplication','findAndCountAll','priority','getApplications','from-voip-provider','localstationid','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','ecm','gateway','headerinfo','maxrate','minrate','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','sequelize','bulkCreate','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection'];(function(_0x166833,_0x3762fa){var _0x2ebe30=function(_0x368bf4){while(--_0x368bf4){_0x166833['push'](_0x166833['shift']());}};_0x2ebe30(++_0x3762fa);}(_0xc2c7,0x134));var _0x7c2c=function(_0x270889,_0x418ff4){_0x270889=_0x270889-0x0;var _0x5f1615=_0xc2c7[_0x270889];return _0x5f1615;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];config[_0x7c2c('0x19')]=_[_0x7c2c('0x1a')](config[_0x7c2c('0x19')],{'host':_0x7c2c('0x1b'),'port':0x18eb});var socket=require(_0x7c2c('0x1c'))(new Redis(config[_0x7c2c('0x19')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x7c2c('0x1d'));var client=jayson[_0x7c2c('0x1e')][_0x7c2c('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x7c2c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x206ecd,_0x5e55e0,_0x88f54b,_0x5a5fe2){return new BPromise(function(_0x1aa355,_0x51b73c){var _0x342ea2=_0x5a5fe2||client;return _0x342ea2[_0x7c2c('0x20')](_0x206ecd,_0x88f54b)[_0x7c2c('0x21')](function(_0x2a9539){logger[_0x7c2c('0x22')](_0x7c2c('0x23'),_0x5e55e0,_0x7c2c('0x24'));logger[_0x7c2c('0x25')](_0x7c2c('0x26'),_0x5e55e0,_0x7c2c('0x24'),JSON[_0x7c2c('0x27')](_0x2a9539));if(_0x2a9539[_0x7c2c('0x28')]){if(_0x2a9539['error'][_0x7c2c('0x29')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5e55e0,_0x2a9539[_0x7c2c('0x28')][_0x7c2c('0x2a')]);return _0x51b73c(_0x2a9539[_0x7c2c('0x28')][_0x7c2c('0x2a')]);}logger[_0x7c2c('0x28')](_0x7c2c('0x23'),_0x5e55e0,_0x2a9539[_0x7c2c('0x28')]['message']);return _0x1aa355(_0x2a9539[_0x7c2c('0x28')]['message']);}else{logger[_0x7c2c('0x22')]('FaxAccount,\x20%s,\x20%s',_0x5e55e0,_0x7c2c('0x24'));_0x1aa355(_0x2a9539[_0x7c2c('0x2b')][_0x7c2c('0x2a')]);}})['catch'](function(_0x4d6ec7){logger[_0x7c2c('0x28')](_0x7c2c('0x23'),_0x5e55e0,_0x4d6ec7);_0x51b73c(_0x4d6ec7);});});}function respondWithStatusCode(_0x3d2b8d,_0x150690){_0x150690=_0x150690||0xcc;return function(_0x31d8f3){if(_0x31d8f3){return _0x3d2b8d[_0x7c2c('0x2c')](_0x150690);}return _0x3d2b8d[_0x7c2c('0x2d')](_0x150690)['end']();};}function respondWithResult(_0x358c67,_0xf39941){_0xf39941=_0xf39941||0xc8;return function(_0x3b2652){if(_0x3b2652){return _0x358c67[_0x7c2c('0x2d')](_0xf39941)[_0x7c2c('0x2e')](_0x3b2652);}};}function respondWithFilteredResult(_0x1f8846,_0xf2bfd1){return function(_0x26f472){if(_0x26f472){var _0xa040ff=typeof _0xf2bfd1['offset']===_0x7c2c('0x2f')&&typeof _0xf2bfd1[_0x7c2c('0x30')]===_0x7c2c('0x2f');var _0x720667=_0x26f472['count'];var _0xcb98ba=_0xa040ff?0x0:_0xf2bfd1[_0x7c2c('0x31')];var _0x4192c8=_0xa040ff?_0x26f472[_0x7c2c('0x32')]:_0xf2bfd1[_0x7c2c('0x31')]+_0xf2bfd1[_0x7c2c('0x30')];var _0x463ef7;if(_0x4192c8>=_0x720667){_0x4192c8=_0x720667;_0x463ef7=0xc8;}else{_0x463ef7=0xce;}_0x1f8846['status'](_0x463ef7);return _0x1f8846[_0x7c2c('0x33')](_0x7c2c('0x34'),_0xcb98ba+'-'+_0x4192c8+'/'+_0x720667)[_0x7c2c('0x2e')](_0x26f472);}return null;};}function patchUpdates(_0x1a8fce){return function(_0xf26fb3){try{jsonpatch['apply'](_0xf26fb3,_0x1a8fce,!![]);}catch(_0x47ef3c){return BPromise[_0x7c2c('0x35')](_0x47ef3c);}return _0xf26fb3['save']();};}function saveUpdates(_0x4b97bb,_0x15ee13){return function(_0x31b1f2){if(_0x31b1f2){return _0x31b1f2[_0x7c2c('0x36')](_0x4b97bb)[_0x7c2c('0x21')](function(_0x536dcf){return _0x536dcf;});}return null;};}function removeEntity(_0x447a52,_0x38a937){return function(_0x3980ba){if(_0x3980ba){return _0x3980ba[_0x7c2c('0x37')]()[_0x7c2c('0x21')](function(){var _0x6ef8c4=_0x3980ba[_0x7c2c('0x38')]({'plain':!![]});var _0xab5072=_0x7c2c('0x39');return db[_0x7c2c('0x3a')][_0x7c2c('0x37')]({'where':{'type':_0xab5072,'resourceId':_0x6ef8c4['id']}})[_0x7c2c('0x21')](function(){return _0x3980ba;});})[_0x7c2c('0x21')](function(){_0x447a52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd30d,_0x4acc5d){return function(_0x4c421c){if(!_0x4c421c){_0x3cd30d['sendStatus'](0x194);}return _0x4c421c;};}function handleError(_0x28e3cc,_0xc77f11){_0xc77f11=_0xc77f11||0x1f4;return function(_0x129bf0){logger[_0x7c2c('0x28')](_0x129bf0[_0x7c2c('0x3b')]);if(_0x129bf0[_0x7c2c('0x3c')]){delete _0x129bf0[_0x7c2c('0x3c')];}_0x28e3cc[_0x7c2c('0x2d')](_0xc77f11)[_0x7c2c('0x3d')](_0x129bf0);};}exports[_0x7c2c('0x3e')]=function(_0x6a9b35,_0x58696a){var _0x4c7402={'include':[{'model':db[_0x7c2c('0x3f')],'as':_0x7c2c('0x40')}]},_0x3920b6={},_0x360928={'count':0x0,'rows':[]};var _0x5e8c96=_[_0x7c2c('0x41')](db[_0x7c2c('0x42')][_0x7c2c('0x43')],function(_0x45fddf){return{'name':_0x45fddf[_0x7c2c('0x44')],'type':_0x45fddf[_0x7c2c('0x45')][_0x7c2c('0x46')]};});_0x3920b6[_0x7c2c('0x47')]=_[_0x7c2c('0x41')](_0x5e8c96,'name');_0x3920b6[_0x7c2c('0x48')]=_['keys'](_0x6a9b35[_0x7c2c('0x48')]);_0x3920b6[_0x7c2c('0x49')]=_['intersection'](_0x3920b6[_0x7c2c('0x47')],_0x3920b6['query']);_0x4c7402[_0x7c2c('0x4a')]=_[_0x7c2c('0x4b')](_0x3920b6[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x6a9b35['query'][_0x7c2c('0x4c')]));_0x4c7402['attributes']=_0x4c7402['attributes'][_0x7c2c('0x4d')]?_0x4c7402[_0x7c2c('0x4a')]:_0x3920b6[_0x7c2c('0x47')];if(!_0x6a9b35['query'][_0x7c2c('0x4e')](_0x7c2c('0x4f'))){_0x4c7402['limit']=qs[_0x7c2c('0x30')](_0x6a9b35['query'][_0x7c2c('0x30')]);_0x4c7402[_0x7c2c('0x31')]=qs['offset'](_0x6a9b35['query'][_0x7c2c('0x31')]);}_0x4c7402[_0x7c2c('0x50')]=qs['sort'](_0x6a9b35[_0x7c2c('0x48')]['sort']);_0x4c7402['where']=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x6a9b35[_0x7c2c('0x48')],_0x3920b6[_0x7c2c('0x49')]),_0x5e8c96);if(_0x6a9b35[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x4c7402[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x4c7402[_0x7c2c('0x53')],{'$or':_['map'](_0x5e8c96,function(_0x57eaf8){if(_0x57eaf8[_0x7c2c('0x45')]!==_0x7c2c('0x55')){var _0x3ce2fb={};_0x3ce2fb[_0x57eaf8['name']]={'$like':'%'+_0x6a9b35['query'][_0x7c2c('0x52')]+'%'};return _0x3ce2fb;}})});}_0x4c7402=_[_0x7c2c('0x54')]({},_0x4c7402,_0x6a9b35[_0x7c2c('0x56')]);var _0x2b79d5={'where':_0x4c7402['where']};return db['FaxAccount']['count'](_0x2b79d5)[_0x7c2c('0x21')](function(_0x36184a){_0x360928[_0x7c2c('0x32')]=_0x36184a;if(_0x6a9b35[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x4c7402['include']=[{'all':!![]}];}return db[_0x7c2c('0x42')][_0x7c2c('0x58')](_0x4c7402);})['then'](function(_0x19621a){_0x360928['rows']=_0x19621a;return _0x360928;})[_0x7c2c('0x21')](respondWithFilteredResult(_0x58696a,_0x4c7402))[_0x7c2c('0x59')](handleError(_0x58696a,null));};exports[_0x7c2c('0x5a')]=function(_0x55e123,_0x5835cd){var _0x327f3a={'raw':![],'where':{'id':_0x55e123[_0x7c2c('0x5b')]['id']},'include':[{'model':db[_0x7c2c('0x3f')],'as':'mandatoryDispositionPause'}]},_0x5e4bc3={};_0x5e4bc3[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db['FaxAccount'][_0x7c2c('0x43')]);_0x5e4bc3[_0x7c2c('0x48')]=_['keys'](_0x55e123[_0x7c2c('0x48')]);_0x5e4bc3[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x5e4bc3['model'],_0x5e4bc3[_0x7c2c('0x48')]);_0x327f3a['attributes']=_[_0x7c2c('0x4b')](_0x5e4bc3[_0x7c2c('0x47')],qs['fields'](_0x55e123[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x327f3a[_0x7c2c('0x4a')]=_0x327f3a[_0x7c2c('0x4a')]['length']?_0x327f3a[_0x7c2c('0x4a')]:_0x5e4bc3[_0x7c2c('0x47')];if(_0x55e123['query'][_0x7c2c('0x57')]){_0x327f3a['include']=[{'all':!![]}];}_0x327f3a=_[_0x7c2c('0x54')]({},_0x327f3a,_0x55e123[_0x7c2c('0x56')]);return db[_0x7c2c('0x42')][_0x7c2c('0x5d')](_0x327f3a)[_0x7c2c('0x21')](handleEntityNotFound(_0x5835cd,null))['then'](respondWithResult(_0x5835cd,null))[_0x7c2c('0x59')](handleError(_0x5835cd,null));};exports[_0x7c2c('0x5e')]=function(_0x4c4661,_0x53025a){return db['FaxAccount'][_0x7c2c('0x5e')](_0x4c4661['body'],{})[_0x7c2c('0x21')](function(_0x4bcef3){var _0x469515=_0x4c4661[_0x7c2c('0x5f')][_0x7c2c('0x38')]({'plain':!![]});if(!_0x469515)throw new Error(_0x7c2c('0x60'));if(_0x469515[_0x7c2c('0x61')]===_0x7c2c('0x5f')){var _0x2bb0f8=_0x4bcef3[_0x7c2c('0x38')]({'plain':!![]});var _0x5eb300='FaxAccounts';return db['UserProfileSection'][_0x7c2c('0x5d')]({'where':{'name':_0x5eb300,'userProfileId':_0x469515[_0x7c2c('0x62')]},'raw':!![]})[_0x7c2c('0x21')](function(_0x299c15){if(_0x299c15&&_0x299c15[_0x7c2c('0x63')]===0x0){return db[_0x7c2c('0x3a')][_0x7c2c('0x5e')]({'name':_0x2bb0f8[_0x7c2c('0x3c')],'resourceId':_0x2bb0f8['id'],'type':_0x299c15['name'],'sectionId':_0x299c15['id']},{})['then'](function(){return _0x4bcef3;});}else{return _0x4bcef3;}})[_0x7c2c('0x59')](function(_0x1b8126){logger['error'](_0x7c2c('0x64'),_0x1b8126);throw _0x1b8126;});}return _0x4bcef3;})['then'](respondWithResult(_0x53025a,0xc9))['catch'](handleError(_0x53025a,null));};exports[_0x7c2c('0x36')]=function(_0x118728,_0x2b4b31){if(_0x118728[_0x7c2c('0x65')]['id']){delete _0x118728[_0x7c2c('0x65')]['id'];}return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x118728[_0x7c2c('0x5b')]['id']},'include':[{'model':db[_0x7c2c('0x3f')],'as':_0x7c2c('0x40')}]})[_0x7c2c('0x21')](handleEntityNotFound(_0x2b4b31,null))[_0x7c2c('0x21')](saveUpdates(_0x118728[_0x7c2c('0x65')],null))[_0x7c2c('0x21')](respondWithResult(_0x2b4b31,null))['catch'](handleError(_0x2b4b31,null));};exports[_0x7c2c('0x37')]=function(_0x5404ec,_0x489f2c){return db['FaxAccount']['find']({'where':{'id':_0x5404ec[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x489f2c,null))[_0x7c2c('0x21')](removeEntity(_0x489f2c,null))[_0x7c2c('0x59')](handleError(_0x489f2c,null));};exports[_0x7c2c('0x66')]=function(_0x117f2a,_0x59e46d){return db[_0x7c2c('0x42')][_0x7c2c('0x66')]()[_0x7c2c('0x21')](respondWithResult(_0x59e46d,null))[_0x7c2c('0x59')](handleError(_0x59e46d,null));};exports[_0x7c2c('0x67')]=function(_0x43abd8,_0x49f520,_0x289091){if(_0x43abd8[_0x7c2c('0x65')]['id']){delete _0x43abd8['body']['id'];}return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x43abd8['params']['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x49f520,null))[_0x7c2c('0x21')](function(_0x5605ef){if(_0x5605ef){_0x43abd8['body'][_0x7c2c('0x68')]=_0x5605ef['id'];return db['Disposition'][_0x7c2c('0x5e')](_0x43abd8['body']);}})[_0x7c2c('0x21')](respondWithResult(_0x49f520,null))[_0x7c2c('0x59')](handleError(_0x49f520,null));};exports['getDispositions']=function(_0x222362,_0x5285f2,_0x1fe241){var _0x2b597d={'raw':![],'where':{}};var _0x20eb63={};var _0x56f737={'count':0x0,'rows':[]};return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x222362[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x5285f2,null))['then'](function(_0x158352){if(_0x158352){_0x20eb63[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x6a')][_0x7c2c('0x43')]);_0x20eb63[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x222362[_0x7c2c('0x48')]);_0x20eb63[_0x7c2c('0x49')]=_['intersection'](_0x20eb63[_0x7c2c('0x47')],_0x20eb63[_0x7c2c('0x48')]);_0x2b597d['attributes']=_[_0x7c2c('0x4b')](_0x20eb63['model'],qs['fields'](_0x222362[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x2b597d[_0x7c2c('0x4a')]=_0x2b597d['attributes'][_0x7c2c('0x4d')]?_0x2b597d[_0x7c2c('0x4a')]:_0x20eb63[_0x7c2c('0x47')];if(!_0x222362['query'][_0x7c2c('0x4e')](_0x7c2c('0x4f'))){_0x2b597d[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x222362['query'][_0x7c2c('0x30')]);_0x2b597d['offset']=qs[_0x7c2c('0x31')](_0x222362['query'][_0x7c2c('0x31')]);}_0x2b597d[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x222362[_0x7c2c('0x48')][_0x7c2c('0x6b')]);_0x2b597d[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_['pick'](_0x222362[_0x7c2c('0x48')],_0x20eb63[_0x7c2c('0x49')]));_0x2b597d[_0x7c2c('0x53')][_0x7c2c('0x68')]=_0x158352['id'];if(_0x222362[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x2b597d[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x2b597d['where'],{'$or':_[_0x7c2c('0x41')](_0x2b597d[_0x7c2c('0x4a')],function(_0x2391a7){var _0x308cdc={};_0x308cdc[_0x2391a7]={'$like':'%'+_0x222362[_0x7c2c('0x48')]['filter']+'%'};return _0x308cdc;})});}_0x2b597d=_[_0x7c2c('0x54')]({},_0x2b597d,_0x222362[_0x7c2c('0x56')]);return db['Disposition'][_0x7c2c('0x32')]({'where':_0x2b597d[_0x7c2c('0x53')]})['then'](function(_0x2d8d84){_0x56f737['count']=_0x2d8d84;if(_0x222362[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x2b597d[_0x7c2c('0x6c')]=[{'all':!![]}];}return db[_0x7c2c('0x6a')][_0x7c2c('0x58')](_0x2b597d);})[_0x7c2c('0x21')](function(_0x3fe323){_0x56f737['rows']=_0x3fe323;return _0x56f737;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0x5285f2,_0x2b597d))[_0x7c2c('0x59')](handleError(_0x5285f2,null));};exports['removeDispositions']=function(_0x33b491,_0x333a76,_0x2a188c){return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x33b491[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x333a76,null))[_0x7c2c('0x21')](function(_0x14fcb5){if(_0x14fcb5){return _0x14fcb5[_0x7c2c('0x6d')](_0x33b491[_0x7c2c('0x48')][_0x7c2c('0x6e')]);}})[_0x7c2c('0x21')](respondWithStatusCode(_0x333a76,null))[_0x7c2c('0x59')](handleError(_0x333a76,null));};exports['addAnswer']=function(_0x3e666f,_0x2bddbc,_0x551c44){if(_0x3e666f[_0x7c2c('0x65')]['id']){delete _0x3e666f[_0x7c2c('0x65')]['id'];}return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x3e666f[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2bddbc,null))[_0x7c2c('0x21')](function(_0x13dec1){if(_0x13dec1){_0x3e666f[_0x7c2c('0x65')]['FaxAccountId']=_0x13dec1['id'];return db[_0x7c2c('0x6f')][_0x7c2c('0x5e')](_0x3e666f[_0x7c2c('0x65')]);}})['then'](respondWithResult(_0x2bddbc,null))[_0x7c2c('0x59')](handleError(_0x2bddbc,null));};exports['getAnswers']=function(_0x342022,_0x5f2a6b,_0x481479){var _0x1684db={'raw':![],'where':{}};var _0x1a9698={};var _0x97011a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7c2c('0x69')]({'where':{'id':_0x342022[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x5f2a6b,null))[_0x7c2c('0x21')](function(_0x4d944d){if(_0x4d944d){_0x1a9698[_0x7c2c('0x47')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1a9698['query']=_['keys'](_0x342022[_0x7c2c('0x48')]);_0x1a9698[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x1a9698[_0x7c2c('0x47')],_0x1a9698[_0x7c2c('0x48')]);_0x1684db['attributes']=_[_0x7c2c('0x4b')](_0x1a9698[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x1684db[_0x7c2c('0x4a')]=_0x1684db['attributes']['length']?_0x1684db[_0x7c2c('0x4a')]:_0x1a9698[_0x7c2c('0x47')];if(!_0x342022[_0x7c2c('0x48')][_0x7c2c('0x4e')]('nolimit')){_0x1684db[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x30')]);_0x1684db[_0x7c2c('0x31')]=qs[_0x7c2c('0x31')](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x31')]);}_0x1684db[_0x7c2c('0x50')]=qs['sort'](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x6b')]);_0x1684db['where']=qs[_0x7c2c('0x49')](_['pick'](_0x342022[_0x7c2c('0x48')],_0x1a9698['filters']));_0x1684db[_0x7c2c('0x53')][_0x7c2c('0x68')]=_0x4d944d['id'];if(_0x342022[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x1684db[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x1684db[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x1684db[_0x7c2c('0x4a')],function(_0x4cd396){var _0x3b062e={};_0x3b062e[_0x4cd396]={'$like':'%'+_0x342022[_0x7c2c('0x48')][_0x7c2c('0x52')]+'%'};return _0x3b062e;})});}_0x1684db=_['merge']({},_0x1684db,_0x342022[_0x7c2c('0x56')]);return db[_0x7c2c('0x6f')]['count']({'where':_0x1684db[_0x7c2c('0x53')]})['then'](function(_0x11244c){_0x97011a['count']=_0x11244c;if(_0x342022[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x1684db[_0x7c2c('0x6c')]=[{'all':!![]}];}return db[_0x7c2c('0x6f')]['findAll'](_0x1684db);})[_0x7c2c('0x21')](function(_0x15db4c){_0x97011a[_0x7c2c('0x70')]=_0x15db4c;return _0x97011a;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0x5f2a6b,_0x1684db))[_0x7c2c('0x59')](handleError(_0x5f2a6b,null));};exports[_0x7c2c('0x71')]=function(_0x5c2983,_0x117076,_0x4c1f7e){return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x5c2983['params']['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x117076,null))[_0x7c2c('0x21')](function(_0x5e5c7c){if(_0x5e5c7c){return _0x5e5c7c[_0x7c2c('0x71')](_0x5c2983[_0x7c2c('0x48')][_0x7c2c('0x6e')]);}})['then'](respondWithStatusCode(_0x117076,null))['catch'](handleError(_0x117076,null));};exports[_0x7c2c('0x72')]=function(_0x6ffda9,_0x251235,_0x3f614b){return db[_0x7c2c('0x73')][_0x7c2c('0x5d')]({'where':{'id':_0x6ffda9[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x251235,null))[_0x7c2c('0x21')](function(_0x48ed26){if(_0x48ed26){return _0x48ed26['addInteraction'](_0x6ffda9[_0x7c2c('0x65')][_0x7c2c('0x6e')],_[_0x7c2c('0x74')](_0x6ffda9[_0x7c2c('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x251235,null))[_0x7c2c('0x59')](handleError(_0x251235,null));};exports[_0x7c2c('0x75')]=function(_0x4a0cfb,_0xd93d75,_0x5c83de){var _0x51078c={'raw':![],'where':{}};var _0x5692c1={};var _0x30774d={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7c2c('0x69')]({'where':{'id':_0x4a0cfb[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0xd93d75,null))[_0x7c2c('0x21')](function(_0x4fd8a2){if(_0x4fd8a2){_0x5692c1[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x73')][_0x7c2c('0x43')]);_0x5692c1[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x4a0cfb[_0x7c2c('0x48')]);_0x5692c1['filters']=_[_0x7c2c('0x4b')](_0x5692c1['model'],_0x5692c1[_0x7c2c('0x48')]);_0x51078c[_0x7c2c('0x4a')]=_[_0x7c2c('0x4b')](_0x5692c1[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x4a0cfb['query'][_0x7c2c('0x4c')]));_0x51078c[_0x7c2c('0x4a')]=_0x51078c['attributes'][_0x7c2c('0x4d')]?_0x51078c['attributes']:_0x5692c1[_0x7c2c('0x47')];if(!_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x4e')]('nolimit')){_0x51078c[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x4a0cfb[_0x7c2c('0x48')]['limit']);_0x51078c[_0x7c2c('0x31')]=qs['offset'](_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x31')]);}_0x51078c[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x6b')]);_0x51078c['where']=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x4a0cfb['query'],_0x5692c1[_0x7c2c('0x49')]));_0x51078c[_0x7c2c('0x53')][_0x7c2c('0x68')]=_0x4fd8a2['id'];if(_0x4a0cfb[_0x7c2c('0x48')]['filter']){_0x51078c['where']=_[_0x7c2c('0x54')](_0x51078c['where'],{'$or':_['map'](_0x51078c[_0x7c2c('0x4a')],function(_0x4356e7){var _0x53c0dd={};_0x53c0dd[_0x4356e7]={'$like':'%'+_0x4a0cfb['query']['filter']+'%'};return _0x53c0dd;})});}_0x51078c=_[_0x7c2c('0x54')]({},_0x51078c,_0x4a0cfb['options']);return db['FaxInteraction'][_0x7c2c('0x32')]({'where':_0x51078c['where']})[_0x7c2c('0x21')](function(_0x3f21d1){_0x30774d[_0x7c2c('0x32')]=_0x3f21d1;if(_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x51078c['include']=[{'model':db[_0x7c2c('0x76')],'as':'Contact','required':![]},{'model':db[_0x7c2c('0x77')],'as':_0x7c2c('0x78'),'attributes':[_0x7c2c('0x3c'),_0x7c2c('0x79'),_0x7c2c('0x7a')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x7b')]?{'id':_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x7b')]}:undefined,'required':_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x7b')]?!![]:![]}];}return db[_0x7c2c('0x73')][_0x7c2c('0x58')](_0x51078c);})[_0x7c2c('0x21')](function(_0x58afc2){_0x30774d[_0x7c2c('0x70')]=_0x58afc2;return _0x30774d;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0xd93d75,_0x51078c))[_0x7c2c('0x59')](handleError(_0xd93d75,null));};exports[_0x7c2c('0x7c')]=function(_0x160969,_0x17e4b9,_0x3ab9a6){return db['FaxAccount'][_0x7c2c('0x69')]({'where':{'id':_0x160969['params']['id']}})['then'](handleEntityNotFound(_0x17e4b9,null))[_0x7c2c('0x21')](function(_0x457561){if(_0x457561){return db['sequelize'][_0x7c2c('0x7d')](function(_0x2e29b9){return db[_0x7c2c('0x7e')][_0x7c2c('0x37')]({'where':{'FaxAccountId':_0x160969[_0x7c2c('0x5b')]['id']},'transaction':_0x2e29b9})[_0x7c2c('0x21')](function(_0x4c2811){var _0x1f318c=_[_0x7c2c('0x41')](_0x160969[_0x7c2c('0x65')],function(_0x15048a){_0x15048a[_0x7c2c('0x68')]=_0x160969[_0x7c2c('0x5b')]['id'];return _0x15048a;});return db[_0x7c2c('0x7e')]['bulkCreate'](_0x1f318c,{'transaction':_0x2e29b9});});})[_0x7c2c('0x21')](function(){return db[_0x7c2c('0x7e')][_0x7c2c('0x7f')]({'where':{'FaxAccountId':_0x160969['params']['id']},'order':_0x7c2c('0x80')});});}})[_0x7c2c('0x21')](respondWithResult(_0x17e4b9,null))[_0x7c2c('0x59')](handleError(_0x17e4b9,null));};exports[_0x7c2c('0x81')]=function(_0x3ae9fc,_0x42ecc2,_0x3416f3){var _0x450016={};var _0x3389a0={};var _0x16dc25;var _0x2fc37d;return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x3ae9fc[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x42ecc2,null))['then'](function(_0x2b6b19){if(_0x2b6b19){_0x16dc25=_0x2b6b19;_0x3389a0['model']=_[_0x7c2c('0x5c')](db[_0x7c2c('0x7e')]['rawAttributes']);_0x3389a0[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x3ae9fc['query']);_0x3389a0['filters']=_[_0x7c2c('0x4b')](_0x3389a0[_0x7c2c('0x47')],_0x3389a0[_0x7c2c('0x48')]);_0x450016[_0x7c2c('0x4a')]=_['intersection'](_0x3389a0['model'],qs[_0x7c2c('0x4c')](_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x450016[_0x7c2c('0x4a')]=_0x450016['attributes'][_0x7c2c('0x4d')]?_0x450016[_0x7c2c('0x4a')]:_0x3389a0[_0x7c2c('0x47')];_0x450016[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x3ae9fc['query'][_0x7c2c('0x6b')]);_0x450016[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x3ae9fc['query'],_0x3389a0[_0x7c2c('0x49')]));if(_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x450016['where']=_['merge'](_0x450016[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x450016['attributes'],function(_0x2d1397){var _0x3e23a2={};_0x3e23a2[_0x2d1397]={'$like':'%'+_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x52')]+'%'};return _0x3e23a2;})});}_0x450016=_['merge']({},_0x450016,_0x3ae9fc[_0x7c2c('0x56')]);return _0x16dc25[_0x7c2c('0x81')](_0x450016);}})[_0x7c2c('0x21')](function(_0x22f3aa){if(_0x22f3aa){_0x2fc37d=_0x22f3aa[_0x7c2c('0x4d')];if(!_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x4e')](_0x7c2c('0x4f'))){_0x450016['limit']=qs[_0x7c2c('0x30')](_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x30')]);_0x450016[_0x7c2c('0x31')]=qs[_0x7c2c('0x31')](_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x31')]);}return _0x16dc25['getApplications'](_0x450016);}})[_0x7c2c('0x21')](function(_0x1692cd){if(_0x1692cd){return _0x1692cd?{'count':_0x2fc37d,'rows':_0x1692cd}:null;}})[_0x7c2c('0x21')](respondWithResult(_0x42ecc2,null))['catch'](handleError(_0x42ecc2,null));};function Extension(_0x1c1005,_0x39545f,_0x39c65d,_0x21f7a6){this['context']=_0x7c2c('0x82');this['exten']=_0x1c1005[_0x7c2c('0x83')];this['app']=_0x21f7a6;this[_0x7c2c('0x45')]=_0x7c2c('0x84');this[_0x7c2c('0x85')]=_0x7c2c('0x86');this['FaxAccountId']=_0x1c1005['id'];this[_0x7c2c('0x80')]=_0x39545f;this['appdata']=_0x39c65d;}function createExtensionsReciveFax(_0x28119b){var _0x8f790f=0x1;var _0x4b8ada=[];_0x4b8ada[_0x7c2c('0x87')](new Extension(_0x28119b,_0x8f790f,'','Answer'));_0x8f790f+=0x1;_0x4b8ada['push'](new Extension(_0x28119b,_0x8f790f,_0x7c2c('0x88'),'Set'));_0x8f790f+=0x1;for(var _0x165179 in _0x28119b){if(_0x28119b[_0x7c2c('0x4e')](_0x165179)&&(_0x165179===_0x7c2c('0x89')||_0x165179===_0x7c2c('0x83')||_0x165179===_0x7c2c('0x8a')||_0x165179==='faxdetect'||_0x165179===_0x7c2c('0x8b')||_0x165179===_0x7c2c('0x8c')||_0x165179===_0x7c2c('0x8d')||_0x165179==='modem'||_0x165179===_0x7c2c('0x8e'))){_0x4b8ada[_0x7c2c('0x87')](new Extension(_0x28119b,_0x8f790f,_0x7c2c('0x8f')+_0x165179+')='+_0x28119b[_0x165179],'Set'));_0x8f790f+=0x1;}}_0x4b8ada[_0x7c2c('0x87')](new Extension(_0x28119b,_0x8f790f,'6',_0x7c2c('0x90')));_0x8f790f+=0x1;_0x4b8ada['push'](new Extension(_0x28119b,_0x8f790f,_0x7c2c('0x91'),_0x7c2c('0x92')));_0x8f790f=0x0;return _0x4b8ada;}exports[_0x7c2c('0x93')]=function(_0x350c95,_0x501a08,_0x3b4a14){var _0x110fba;return db[_0x7c2c('0x94')]['transaction'](function(_0xa623a){return db[_0x7c2c('0x42')]['create'](_0x350c95[_0x7c2c('0x65')],{'transaction':_0xa623a})['then'](function(_0x22b323){_0x110fba=_0x22b323[_0x7c2c('0x38')]({'plain':!![]});return db['VoiceExtension'][_0x7c2c('0x95')](createExtensionsReciveFax(_0x110fba),{'transaction':_0xa623a});});})[_0x7c2c('0x21')](function(){return _0x110fba;})[_0x7c2c('0x21')](respondWithResult(_0x501a08,null))[_0x7c2c('0x59')](handleError(_0x501a08,null));};exports[_0x7c2c('0x96')]=function(_0x1396e1,_0x5422cc,_0x152022){var _0x130bfd;return db[_0x7c2c('0x94')][_0x7c2c('0x7d')](function(_0x2fd6d8){return db[_0x7c2c('0x42')]['update'](_0x1396e1[_0x7c2c('0x65')],{'where':{'id':_0x1396e1[_0x7c2c('0x65')]['id']},'transaction':_0x2fd6d8})[_0x7c2c('0x21')](function(_0xf320b){return db[_0x7c2c('0x97')][_0x7c2c('0x37')]({'where':{'FaxAccountId':_0x1396e1[_0x7c2c('0x65')]['id']},'transaction':_0x2fd6d8})['then'](function(_0x349d46){return db[_0x7c2c('0x97')][_0x7c2c('0x95')](createExtensionsReciveFax(_['omit'](_0x1396e1[_0x7c2c('0x65')],[_0x7c2c('0x98'),_0x7c2c('0x46'),_0x7c2c('0x99'),_0x7c2c('0x9a'),_0x7c2c('0x9b'),_0x7c2c('0x9c')])),{'transaction':_0x2fd6d8});});});})[_0x7c2c('0x21')](function(){return db[_0x7c2c('0x42')][_0x7c2c('0x9d')](_0x1396e1[_0x7c2c('0x65')]['id']);})[_0x7c2c('0x21')](respondWithResult(_0x5422cc,null))[_0x7c2c('0x59')](handleError(_0x5422cc,null));};exports[_0x7c2c('0x9e')]=function(_0x51cea0,_0x422c09,_0x3ab457){var _0x442c1d={'raw':!![],'where':{}};var _0x3a1411={};var _0x190f8c={'count':0x0,'rows':[]};return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x51cea0[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x422c09,null))[_0x7c2c('0x21')](function(_0x545199){if(_0x545199){_0x3a1411[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x9f')][_0x7c2c('0x43')]);_0x3a1411['query']=_[_0x7c2c('0x5c')](_0x51cea0[_0x7c2c('0x48')]);_0x3a1411[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x3a1411[_0x7c2c('0x47')],_0x3a1411['query']);_0x442c1d[_0x7c2c('0x4a')]=_[_0x7c2c('0x4b')](_0x3a1411[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x51cea0[_0x7c2c('0x48')]['fields']));_0x442c1d[_0x7c2c('0x4a')]=_0x442c1d[_0x7c2c('0x4a')][_0x7c2c('0x4d')]?_0x442c1d[_0x7c2c('0x4a')]:_0x3a1411['model'];if(!_0x51cea0[_0x7c2c('0x48')]['hasOwnProperty'](_0x7c2c('0x4f'))){_0x442c1d[_0x7c2c('0x30')]=qs['limit'](_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x30')]);_0x442c1d['offset']=qs[_0x7c2c('0x31')](_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x31')]);}_0x442c1d[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x51cea0[_0x7c2c('0x48')]['sort']);_0x442c1d[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x51cea0[_0x7c2c('0x48')],_0x3a1411['filters']));_0x442c1d['where'][_0x7c2c('0x68')]=_0x545199['id'];if(_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x442c1d[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x442c1d[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x442c1d[_0x7c2c('0x4a')],function(_0x1a8847){var _0x5dcd29={};_0x5dcd29[_0x1a8847]={'$like':'%'+_0x51cea0['query']['filter']+'%'};return _0x5dcd29;})});}if(_0x51cea0['query']['$gte']){var _0x590f52=_0x51cea0['query'][_0x7c2c('0xa0')][_0x7c2c('0xa1')](',');var _0x5653dc={};_0x5653dc[_0x590f52[0x0]]={'$gte':moment(_0x590f52[0x1])[_0x7c2c('0xa2')](_0x7c2c('0xa3'))};_0x442c1d['where']=_[_0x7c2c('0x54')](_0x442c1d[_0x7c2c('0x53')],_0x5653dc);}_0x442c1d=_['merge']({},_0x442c1d,_0x51cea0[_0x7c2c('0x56')]);return db[_0x7c2c('0x9f')]['count']({'where':_0x442c1d[_0x7c2c('0x53')]})[_0x7c2c('0x21')](function(_0x549469){_0x190f8c[_0x7c2c('0x32')]=_0x549469;if(_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x442c1d[_0x7c2c('0x6c')]=[{'all':!![]}];}return db['FaxMessage'][_0x7c2c('0x58')](_0x442c1d);})[_0x7c2c('0x21')](function(_0x28ba24){_0x190f8c[_0x7c2c('0x70')]=_0x28ba24;return _0x190f8c;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0x422c09,_0x442c1d))[_0x7c2c('0x59')](handleError(_0x422c09,null));};exports[_0x7c2c('0x3d')]=function(_0x3c6eaf,_0x403916,_0x2f5e0e){var _0x3be1c6,_0x114e57={},_0x5cb619;if(_0x3c6eaf[_0x7c2c('0x65')]['to']){_0x5cb619=_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0];}return db[_0x7c2c('0x42')]['find']({'where':{'id':_0x3c6eaf[_0x7c2c('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x7c2c('0xa4'),'where':{'fax':_0x5cb619},'limit':0x1,'order':[[_0x7c2c('0x9a'),'DESC']]}]}]})[_0x7c2c('0x21')](handleEntityNotFound(_0x403916,null))['then'](function(_0x1de015){_0x3be1c6=_0x1de015;if(_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')]&&_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][_0x7c2c('0x4d')]){for(var _0x336e56=0x0;_0x336e56<_0x3c6eaf[_0x7c2c('0x65')]['attachments']['length'];_0x336e56+=0x1){_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][_0x336e56]={'filename':_0x3c6eaf[_0x7c2c('0x65')]['attachments'][_0x336e56][_0x7c2c('0x3c')],'id':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][_0x336e56]['id'],'path':path[_0x7c2c('0xa6')](config[_0x7c2c('0xa7')],'server/files/attachments',_0x3c6eaf[_0x7c2c('0x65')]['attachments'][_0x336e56][_0x7c2c('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend',_0x7c2c('0xa9'),{'FaxAccountId':_[_0x7c2c('0xaa')](_0x3c6eaf['params']['id'])?undefined:_0x3c6eaf[_0x7c2c('0x5b')]['id'],'path':_['isNil'](_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0][_0x7c2c('0xab')])?undefined:_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0][_0x7c2c('0xab')],'fax':_[_0x7c2c('0xaa')](_0x3c6eaf['body']['to'][0x0])?undefined:_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0]},client9002);})[_0x7c2c('0x21')](function(){if(_0x3be1c6){if(_['isNil'](_0x3c6eaf[_0x7c2c('0x65')]['from'])){_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xac')]=util[_0x7c2c('0xa2')](_0x7c2c('0xad'),_0x3be1c6[_0x7c2c('0x3c')],_0x3be1c6[_0x7c2c('0xae')]);}if(_0x3be1c6[_0x7c2c('0xaf')]){if(_0x3be1c6['List'][_0x7c2c('0xa4')][_0x7c2c('0x4d')]){return _0x3be1c6[_0x7c2c('0xaf')]['Contacts'][0x0];}else{return db['CmContact'][_0x7c2c('0x5e')](_[_0x7c2c('0x1a')](_0x3c6eaf[_0x7c2c('0x65')],{'firstName':_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'phone':_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'fax':_0x3c6eaf['body']['to'][0x0],'ListId':_0x3be1c6['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x7c2c('0x21')](function(_0xf21527){if(_0xf21527){return db[_0x7c2c('0x73')][_0x7c2c('0x5d')]({'where':{'ContactId':_0xf21527['id'],'closed':![],'FaxAccountId':_0x3be1c6['id']}})[_0x7c2c('0x21')](function(_0x31549a){if(_0x31549a){return[_0x31549a,![]];}return db[_0x7c2c('0x73')][_0x7c2c('0x5e')]({'UserId':_0x3c6eaf[_0x7c2c('0x5f')]['id'],'ContactId':_0xf21527['id'],'FaxAccountId':_0x3be1c6['id'],'fax':_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'firstMsgDirection':_0x7c2c('0xb0'),'Messages':[_[_0x7c2c('0x54')](_0x3c6eaf[_0x7c2c('0x65')],{'read':![],'body':_0x3c6eaf['body']['attachments'][0x0][_0x7c2c('0xb1')],'FaxAccountId':_0x3be1c6['id'],'UserId':_0x3c6eaf[_0x7c2c('0x5f')]['id'],'ContactId':_0xf21527['id'],'AttachmentId':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x7c2c('0xb2')}]})[_0x7c2c('0x21')](function(_0x132cb4){return[_0x132cb4,!![]];});});}else{throw new Error(_0x7c2c('0xb3'));}})[_0x7c2c('0xb4')](function(_0x2b0247,_0xfdff3a){if(_0xfdff3a){return _0x2b0247;}return db['FaxMessage']['create']({'direction':_0x7c2c('0xb0'),'read':![],'body':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0][_0x7c2c('0xb1')],'FaxAccountId':_0x3be1c6['id'],'FaxInteractionId':_0x2b0247['id'],'UserId':_0x3c6eaf['user']['id'],'ContactId':_0x2b0247[_0x7c2c('0xb5')],'AttachmentId':_0x3c6eaf['body']['attachments'][0x0]['id']})['then'](function(_0x3c162a){_0x2b0247['dataValues'][_0x7c2c('0xb2')]=[];_0x2b0247[_0x7c2c('0xb6')]['Messages'][_0x7c2c('0x87')](_0x3c162a[_0x7c2c('0xb6')]);return _0x2b0247;});})[_0x7c2c('0x21')](function(_0x31eac0){respondWithRpcPromise(_0x7c2c('0xb7'),'SendFax',{'FaxAccountId':_[_0x7c2c('0xaa')](_0x3c6eaf[_0x7c2c('0x5b')]['id'])?undefined:_0x3c6eaf['params']['id'],'path':_['isNil'](_0x3c6eaf['body'][_0x7c2c('0xa5')][0x0][_0x7c2c('0xab')])?undefined:_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0]['path'],'fax':_[_0x7c2c('0xaa')](_0x3c6eaf['body']['to'][0x0])?undefined:_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'AttachmentId':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0]['id']},client9002)[_0x7c2c('0x21')](function(_0x310ed1){logger[_0x7c2c('0x22')](_0x7c2c('0xb8'),_0x310ed1);})[_0x7c2c('0x59')](function(_0x547d90){logger[_0x7c2c('0x22')](_0x7c2c('0xb8'),_0x547d90);});return _0x31eac0;})[_0x7c2c('0x21')](respondWithResult(_0x403916,null))[_0x7c2c('0x59')](handleError(_0x403916,null));};exports[_0x7c2c('0xb9')]=function(_0x46e87c,_0x210c63,_0x5db9b6){return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x46e87c[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x210c63,null))['then'](function(_0x30f70d){if(_0x30f70d){return _0x30f70d[_0x7c2c('0xb9')](_0x46e87c[_0x7c2c('0x65')]['ids'],_['omit'](_0x46e87c[_0x7c2c('0x65')],[_0x7c2c('0x6e'),'id'])||{})[_0x7c2c('0xb4')](function(_0xae75d1){for(var _0x3f4d17=0x0;_0x3f4d17<_0x46e87c['body']['ids'][_0x7c2c('0x4d')];_0x3f4d17+=0x1){socket['emit'](_0x7c2c('0xba'),{'UserId':_0x46e87c[_0x7c2c('0x65')][_0x7c2c('0x6e')][_0x3f4d17],'FaxAccountId':_0x46e87c[_0x7c2c('0x5b')]['id']});}return _0xae75d1;});}})['then'](respondWithResult(_0x210c63,null))[_0x7c2c('0x59')](handleError(_0x210c63,null));};exports[_0x7c2c('0xbb')]=function(_0x5864d8,_0x502b84,_0x198343){return db[_0x7c2c('0x42')]['find']({'where':{'id':_0x5864d8[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x502b84,null))['then'](function(_0xc2c963){if(_0xc2c963){return _0xc2c963[_0x7c2c('0xbb')](_0x5864d8[_0x7c2c('0x48')][_0x7c2c('0x6e')])[_0x7c2c('0x21')](function(){if(_[_0x7c2c('0xbc')](_0x5864d8[_0x7c2c('0x48')][_0x7c2c('0x6e')])){for(var _0x21ebec=0x0;_0x21ebec<_0x5864d8[_0x7c2c('0x48')]['ids'][_0x7c2c('0x4d')];_0x21ebec+=0x1){socket[_0x7c2c('0xbd')](_0x7c2c('0xbe'),{'UserId':Number(_0x5864d8[_0x7c2c('0x48')][_0x7c2c('0x6e')][_0x21ebec]),'FaxAccountId':Number(_0x5864d8[_0x7c2c('0x5b')]['id'])});}}else{socket[_0x7c2c('0xbd')](_0x7c2c('0xbe'),{'UserId':Number(_0x5864d8[_0x7c2c('0x48')]['ids']),'FaxAccountId':Number(_0x5864d8[_0x7c2c('0x5b')]['id'])});}});}})[_0x7c2c('0x21')](respondWithStatusCode(_0x502b84,null))[_0x7c2c('0x59')](handleError(_0x502b84,null));};exports[_0x7c2c('0xbf')]=function(_0x201cd8,_0x18d3bc,_0x2f602a){var _0x19ef61={};var _0x375e2c={};var _0x56e7a5;var _0x2f4707;return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x201cd8[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x18d3bc,null))['then'](function(_0x46bffc){if(_0x46bffc){_0x56e7a5=_0x46bffc;_0x375e2c[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x77')][_0x7c2c('0x43')]);_0x375e2c[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x201cd8[_0x7c2c('0x48')]);_0x375e2c[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x375e2c[_0x7c2c('0x47')],_0x375e2c[_0x7c2c('0x48')]);_0x19ef61[_0x7c2c('0x4a')]=_['intersection'](_0x375e2c[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x19ef61[_0x7c2c('0x4a')]=_0x19ef61['attributes']['length']?_0x19ef61['attributes']:_0x375e2c[_0x7c2c('0x47')];_0x19ef61[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x201cd8[_0x7c2c('0x48')]['sort']);_0x19ef61[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x201cd8[_0x7c2c('0x48')],_0x375e2c[_0x7c2c('0x49')]));if(_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x19ef61[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x19ef61[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x19ef61['attributes'],function(_0x28bb65){var _0x1792f6={};_0x1792f6[_0x28bb65]={'$like':'%'+_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x52')]+'%'};return _0x1792f6;})});}_0x19ef61=_[_0x7c2c('0x54')]({},_0x19ef61,_0x201cd8[_0x7c2c('0x56')]);return _0x56e7a5[_0x7c2c('0xbf')](_0x19ef61);}})[_0x7c2c('0x21')](function(_0x331d0b){if(_0x331d0b){_0x2f4707=_0x331d0b['length'];if(!_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x4e')]('nolimit')){_0x19ef61[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x201cd8[_0x7c2c('0x48')]['limit']);_0x19ef61[_0x7c2c('0x31')]=qs['offset'](_0x201cd8['query'][_0x7c2c('0x31')]);}return _0x56e7a5[_0x7c2c('0xbf')](_0x19ef61);}})[_0x7c2c('0x21')](function(_0x184b3f){if(_0x184b3f){return _0x184b3f?{'count':_0x2f4707,'rows':_0x184b3f}:null;}})[_0x7c2c('0x21')](respondWithResult(_0x18d3bc,null))[_0x7c2c('0x59')](handleError(_0x18d3bc,null));}; \ No newline at end of file +var _0x7916=['getDispositions','findOne','rawAttributes','pick','options','Disposition','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','description','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','ListId','Send\x20Fax\x20failed','filename','Messages','spread','out','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','then','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','show','params','Pause','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','FaxAccountId'];(function(_0x242c4b,_0xaa6b78){var _0x4dbbcf=function(_0x377f0c){while(--_0x377f0c){_0x242c4b['push'](_0x242c4b['shift']());}};_0x4dbbcf(++_0xaa6b78);}(_0x7916,0x128));var _0x6791=function(_0x595cfc,_0x22ea3b){_0x595cfc=_0x595cfc-0x0;var _0x1213fd=_0x7916[_0x595cfc];return _0x1213fd;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var licenseUtil=require(_0x6791('0x15'));var db=require(_0x6791('0x16'))['db'];config[_0x6791('0x17')]=_[_0x6791('0x18')](config[_0x6791('0x17')],{'host':_0x6791('0x19'),'port':0x18eb});var socket=require(_0x6791('0x1a'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x6791('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6791('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x6791('0x1c')][_0x6791('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x517910,_0x3e4792,_0x4b80ed,_0x3856ac){return new BPromise(function(_0x150d1f,_0x596a06){var _0xbc35d=_0x3856ac||client;return _0xbc35d[_0x6791('0x1e')](_0x517910,_0x4b80ed)['then'](function(_0x1872f5){logger['info'](_0x6791('0x1f'),_0x3e4792,_0x6791('0x20'));logger[_0x6791('0x21')](_0x6791('0x22'),_0x3e4792,_0x6791('0x20'),JSON[_0x6791('0x23')](_0x1872f5));if(_0x1872f5[_0x6791('0x24')]){if(_0x1872f5['error'][_0x6791('0x25')]===0x1f4){logger[_0x6791('0x24')]('FaxAccount,\x20%s,\x20%s',_0x3e4792,_0x1872f5[_0x6791('0x24')][_0x6791('0x26')]);return _0x596a06(_0x1872f5['error'][_0x6791('0x26')]);}logger[_0x6791('0x24')](_0x6791('0x1f'),_0x3e4792,_0x1872f5[_0x6791('0x24')]['message']);return _0x150d1f(_0x1872f5[_0x6791('0x24')][_0x6791('0x26')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x3e4792,'request\x20sent');_0x150d1f(_0x1872f5[_0x6791('0x27')]['message']);}})[_0x6791('0x28')](function(_0x5409f1){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3e4792,_0x5409f1);_0x596a06(_0x5409f1);});});}function respondWithStatusCode(_0x5cadc,_0x23442e){_0x23442e=_0x23442e||0xcc;return function(_0xd49b84){if(_0xd49b84){return _0x5cadc['sendStatus'](_0x23442e);}return _0x5cadc[_0x6791('0x29')](_0x23442e)[_0x6791('0x2a')]();};}function respondWithResult(_0x493a59,_0x342107){_0x342107=_0x342107||0xc8;return function(_0x5cbb79){if(_0x5cbb79){return _0x493a59[_0x6791('0x29')](_0x342107)['json'](_0x5cbb79);}};}function respondWithFilteredResult(_0x4fc5d5,_0x270a1d){return function(_0x551718){if(_0x551718){var _0x2f56a2=typeof _0x270a1d[_0x6791('0x2b')]==='undefined'&&typeof _0x270a1d[_0x6791('0x2c')]===_0x6791('0x2d');var _0x234c5e=_0x551718[_0x6791('0x2e')];var _0x5d9d54=_0x2f56a2?0x0:_0x270a1d['offset'];var _0x348b9c=_0x2f56a2?_0x551718['count']:_0x270a1d[_0x6791('0x2b')]+_0x270a1d[_0x6791('0x2c')];var _0x30397e;if(_0x348b9c>=_0x234c5e){_0x348b9c=_0x234c5e;_0x30397e=0xc8;}else{_0x30397e=0xce;}_0x4fc5d5[_0x6791('0x29')](_0x30397e);return _0x4fc5d5[_0x6791('0x2f')](_0x6791('0x30'),_0x5d9d54+'-'+_0x348b9c+'/'+_0x234c5e)[_0x6791('0x31')](_0x551718);}return null;};}function patchUpdates(_0x14307e){return function(_0x152751){try{jsonpatch[_0x6791('0x32')](_0x152751,_0x14307e,!![]);}catch(_0x4cdf98){return BPromise[_0x6791('0x33')](_0x4cdf98);}return _0x152751[_0x6791('0x34')]();};}function saveUpdates(_0x28385c,_0xa1ed41){return function(_0x19cd22){if(_0x19cd22){return _0x19cd22[_0x6791('0x35')](_0x28385c)['then'](function(_0x4a304f){return _0x4a304f;});}return null;};}function removeEntity(_0x551357,_0x1de770){return function(_0x21a9cf){if(_0x21a9cf){return _0x21a9cf[_0x6791('0x36')]()['then'](function(){var _0x5657c0=_0x21a9cf[_0x6791('0x37')]({'plain':!![]});var _0x9b1ad2=_0x6791('0x38');return db[_0x6791('0x39')]['destroy']({'where':{'type':_0x9b1ad2,'resourceId':_0x5657c0['id']}})[_0x6791('0x3a')](function(){return _0x21a9cf;});})[_0x6791('0x3a')](function(){_0x551357[_0x6791('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31217d,_0x567e36){return function(_0x4ee010){if(!_0x4ee010){_0x31217d[_0x6791('0x3b')](0x194);}return _0x4ee010;};}function handleError(_0x1803ab,_0x530b13){_0x530b13=_0x530b13||0x1f4;return function(_0x764f15){logger[_0x6791('0x24')](_0x764f15[_0x6791('0x3c')]);if(_0x764f15[_0x6791('0x3d')]){delete _0x764f15[_0x6791('0x3d')];}_0x1803ab['status'](_0x530b13)[_0x6791('0x3e')](_0x764f15);};}exports[_0x6791('0x3f')]=function(_0x2d0dd8,_0x53f48d){var _0x3a6062={'include':[{'model':db['Pause'],'as':_0x6791('0x40')}]},_0x24955c={},_0x2349b0={'count':0x0,'rows':[]};var _0x31f2bb=_[_0x6791('0x41')](db[_0x6791('0x42')]['rawAttributes'],function(_0x18c478){return{'name':_0x18c478[_0x6791('0x43')],'type':_0x18c478[_0x6791('0x44')][_0x6791('0x45')]};});_0x24955c[_0x6791('0x46')]=_[_0x6791('0x41')](_0x31f2bb,_0x6791('0x3d'));_0x24955c[_0x6791('0x47')]=_[_0x6791('0x48')](_0x2d0dd8['query']);_0x24955c['filters']=_[_0x6791('0x49')](_0x24955c[_0x6791('0x46')],_0x24955c['query']);_0x3a6062[_0x6791('0x4a')]=_[_0x6791('0x49')](_0x24955c[_0x6791('0x46')],qs[_0x6791('0x4b')](_0x2d0dd8[_0x6791('0x47')][_0x6791('0x4b')]));_0x3a6062[_0x6791('0x4a')]=_0x3a6062['attributes'][_0x6791('0x4c')]?_0x3a6062['attributes']:_0x24955c[_0x6791('0x46')];if(!_0x2d0dd8[_0x6791('0x47')][_0x6791('0x4d')](_0x6791('0x4e'))){_0x3a6062['limit']=qs[_0x6791('0x2c')](_0x2d0dd8[_0x6791('0x47')][_0x6791('0x2c')]);_0x3a6062[_0x6791('0x2b')]=qs[_0x6791('0x2b')](_0x2d0dd8[_0x6791('0x47')][_0x6791('0x2b')]);}_0x3a6062[_0x6791('0x4f')]=qs['sort'](_0x2d0dd8[_0x6791('0x47')][_0x6791('0x50')]);_0x3a6062[_0x6791('0x51')]=qs[_0x6791('0x52')](_['pick'](_0x2d0dd8[_0x6791('0x47')],_0x24955c[_0x6791('0x52')]),_0x31f2bb);if(_0x2d0dd8['query'][_0x6791('0x53')]){_0x3a6062['where']=_[_0x6791('0x54')](_0x3a6062[_0x6791('0x51')],{'$or':_[_0x6791('0x41')](_0x31f2bb,function(_0x3ddccc){if(_0x3ddccc[_0x6791('0x44')]!==_0x6791('0x55')){var _0x4163f5={};_0x4163f5[_0x3ddccc[_0x6791('0x3d')]]={'$like':'%'+_0x2d0dd8[_0x6791('0x47')]['filter']+'%'};return _0x4163f5;}})});}_0x3a6062=_[_0x6791('0x54')]({},_0x3a6062,_0x2d0dd8['options']);var _0x10e806={'where':_0x3a6062[_0x6791('0x51')]};return db[_0x6791('0x42')][_0x6791('0x2e')](_0x10e806)[_0x6791('0x3a')](function(_0x5f5a74){_0x2349b0[_0x6791('0x2e')]=_0x5f5a74;if(_0x2d0dd8[_0x6791('0x47')][_0x6791('0x56')]){_0x3a6062[_0x6791('0x57')]=[{'all':!![]}];}return db[_0x6791('0x42')]['findAll'](_0x3a6062);})[_0x6791('0x3a')](function(_0x42948b){_0x2349b0['rows']=_0x42948b;return _0x2349b0;})[_0x6791('0x3a')](respondWithFilteredResult(_0x53f48d,_0x3a6062))['catch'](handleError(_0x53f48d,null));};exports[_0x6791('0x58')]=function(_0x22a4d3,_0x12f926){var _0x37e360={'raw':![],'where':{'id':_0x22a4d3[_0x6791('0x59')]['id']},'include':[{'model':db[_0x6791('0x5a')],'as':'mandatoryDispositionPause'}]},_0x558069={};_0x558069[_0x6791('0x46')]=_[_0x6791('0x48')](db[_0x6791('0x42')]['rawAttributes']);_0x558069[_0x6791('0x47')]=_[_0x6791('0x48')](_0x22a4d3['query']);_0x558069[_0x6791('0x52')]=_[_0x6791('0x49')](_0x558069['model'],_0x558069[_0x6791('0x47')]);_0x37e360[_0x6791('0x4a')]=_[_0x6791('0x49')](_0x558069[_0x6791('0x46')],qs['fields'](_0x22a4d3[_0x6791('0x47')][_0x6791('0x4b')]));_0x37e360[_0x6791('0x4a')]=_0x37e360['attributes']['length']?_0x37e360[_0x6791('0x4a')]:_0x558069[_0x6791('0x46')];if(_0x22a4d3[_0x6791('0x47')][_0x6791('0x56')]){_0x37e360[_0x6791('0x57')]=[{'all':!![]}];}_0x37e360=_['merge']({},_0x37e360,_0x22a4d3['options']);return db[_0x6791('0x42')]['find'](_0x37e360)['then'](handleEntityNotFound(_0x12f926,null))[_0x6791('0x3a')](respondWithResult(_0x12f926,null))[_0x6791('0x28')](handleError(_0x12f926,null));};exports[_0x6791('0x5b')]=function(_0x10b41b,_0x13089d){return db[_0x6791('0x42')]['create'](_0x10b41b['body'],{})[_0x6791('0x3a')](function(_0x2aeb6e){var _0x56e424=_0x10b41b[_0x6791('0x5c')]['get']({'plain':!![]});if(!_0x56e424)throw new Error(_0x6791('0x5d'));if(_0x56e424[_0x6791('0x5e')]==='user'){var _0x1ebfb6=_0x2aeb6e[_0x6791('0x37')]({'plain':!![]});var _0x3fd984='FaxAccounts';return db[_0x6791('0x5f')][_0x6791('0x60')]({'where':{'name':_0x3fd984,'userProfileId':_0x56e424[_0x6791('0x61')]},'raw':!![]})[_0x6791('0x3a')](function(_0x396698){if(_0x396698&&_0x396698['autoAssociation']===0x0){return db['UserProfileResource'][_0x6791('0x5b')]({'name':_0x1ebfb6[_0x6791('0x3d')],'resourceId':_0x1ebfb6['id'],'type':_0x396698['name'],'sectionId':_0x396698['id']},{})[_0x6791('0x3a')](function(){return _0x2aeb6e;});}else{return _0x2aeb6e;}})[_0x6791('0x28')](function(_0x66f6b4){logger[_0x6791('0x24')](_0x6791('0x62'),_0x66f6b4);throw _0x66f6b4;});}return _0x2aeb6e;})[_0x6791('0x3a')](respondWithResult(_0x13089d,0xc9))[_0x6791('0x28')](handleError(_0x13089d,null));};exports[_0x6791('0x35')]=function(_0x5b74b9,_0x2c5f12){if(_0x5b74b9[_0x6791('0x63')]['id']){delete _0x5b74b9[_0x6791('0x63')]['id'];}return db[_0x6791('0x42')]['find']({'where':{'id':_0x5b74b9[_0x6791('0x59')]['id']},'include':[{'model':db[_0x6791('0x5a')],'as':_0x6791('0x40')}]})['then'](handleEntityNotFound(_0x2c5f12,null))[_0x6791('0x3a')](saveUpdates(_0x5b74b9[_0x6791('0x63')],null))[_0x6791('0x3a')](respondWithResult(_0x2c5f12,null))[_0x6791('0x28')](handleError(_0x2c5f12,null));};exports['destroy']=function(_0x2c834f,_0x2843fb){return db['FaxAccount'][_0x6791('0x60')]({'where':{'id':_0x2c834f[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x2843fb,null))[_0x6791('0x3a')](removeEntity(_0x2843fb,null))[_0x6791('0x28')](handleError(_0x2843fb,null));};exports[_0x6791('0x64')]=function(_0x4a9e82,_0x301f2f){return db[_0x6791('0x42')][_0x6791('0x64')]()['then'](respondWithResult(_0x301f2f,null))[_0x6791('0x28')](handleError(_0x301f2f,null));};exports['addDisposition']=function(_0x2648fa,_0x11f3b2,_0xf0941a){if(_0x2648fa[_0x6791('0x63')]['id']){delete _0x2648fa[_0x6791('0x63')]['id'];}return db['FaxAccount'][_0x6791('0x60')]({'where':{'id':_0x2648fa[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x11f3b2,null))[_0x6791('0x3a')](function(_0x5f158f){if(_0x5f158f){_0x2648fa[_0x6791('0x63')][_0x6791('0x65')]=_0x5f158f['id'];return db['Disposition'][_0x6791('0x5b')](_0x2648fa[_0x6791('0x63')]);}})['then'](respondWithResult(_0x11f3b2,null))[_0x6791('0x28')](handleError(_0x11f3b2,null));};exports[_0x6791('0x66')]=function(_0x113d9f,_0x271b93,_0x55d389){var _0x35583a={'raw':![],'where':{}};var _0x3511c7={};var _0x505021={'count':0x0,'rows':[]};return db[_0x6791('0x42')][_0x6791('0x67')]({'where':{'id':_0x113d9f[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x271b93,null))[_0x6791('0x3a')](function(_0x4ecf62){if(_0x4ecf62){_0x3511c7[_0x6791('0x46')]=_[_0x6791('0x48')](db['Disposition'][_0x6791('0x68')]);_0x3511c7[_0x6791('0x47')]=_[_0x6791('0x48')](_0x113d9f['query']);_0x3511c7[_0x6791('0x52')]=_[_0x6791('0x49')](_0x3511c7[_0x6791('0x46')],_0x3511c7[_0x6791('0x47')]);_0x35583a[_0x6791('0x4a')]=_[_0x6791('0x49')](_0x3511c7[_0x6791('0x46')],qs[_0x6791('0x4b')](_0x113d9f['query'][_0x6791('0x4b')]));_0x35583a[_0x6791('0x4a')]=_0x35583a['attributes'][_0x6791('0x4c')]?_0x35583a[_0x6791('0x4a')]:_0x3511c7[_0x6791('0x46')];if(!_0x113d9f['query'][_0x6791('0x4d')]('nolimit')){_0x35583a[_0x6791('0x2c')]=qs[_0x6791('0x2c')](_0x113d9f[_0x6791('0x47')][_0x6791('0x2c')]);_0x35583a[_0x6791('0x2b')]=qs[_0x6791('0x2b')](_0x113d9f[_0x6791('0x47')][_0x6791('0x2b')]);}_0x35583a[_0x6791('0x4f')]=qs[_0x6791('0x50')](_0x113d9f[_0x6791('0x47')][_0x6791('0x50')]);_0x35583a[_0x6791('0x51')]=qs[_0x6791('0x52')](_[_0x6791('0x69')](_0x113d9f[_0x6791('0x47')],_0x3511c7[_0x6791('0x52')]));_0x35583a[_0x6791('0x51')][_0x6791('0x65')]=_0x4ecf62['id'];if(_0x113d9f['query']['filter']){_0x35583a['where']=_[_0x6791('0x54')](_0x35583a[_0x6791('0x51')],{'$or':_[_0x6791('0x41')](_0x35583a[_0x6791('0x4a')],function(_0xa0a3ec){var _0x4f95e3={};_0x4f95e3[_0xa0a3ec]={'$like':'%'+_0x113d9f[_0x6791('0x47')][_0x6791('0x53')]+'%'};return _0x4f95e3;})});}_0x35583a=_[_0x6791('0x54')]({},_0x35583a,_0x113d9f[_0x6791('0x6a')]);return db[_0x6791('0x6b')][_0x6791('0x2e')]({'where':_0x35583a[_0x6791('0x51')]})[_0x6791('0x3a')](function(_0x2dafe6){_0x505021[_0x6791('0x2e')]=_0x2dafe6;if(_0x113d9f[_0x6791('0x47')][_0x6791('0x56')]){_0x35583a[_0x6791('0x57')]=[{'all':!![]}];}return db[_0x6791('0x6b')][_0x6791('0x6c')](_0x35583a);})[_0x6791('0x3a')](function(_0x3007a0){_0x505021[_0x6791('0x6d')]=_0x3007a0;return _0x505021;});}})[_0x6791('0x3a')](respondWithFilteredResult(_0x271b93,_0x35583a))['catch'](handleError(_0x271b93,null));};exports[_0x6791('0x6e')]=function(_0x56aecf,_0x8d9556,_0x11eb22){return db['FaxAccount'][_0x6791('0x60')]({'where':{'id':_0x56aecf['params']['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x8d9556,null))[_0x6791('0x3a')](function(_0x5945cb){if(_0x5945cb){return _0x5945cb[_0x6791('0x6e')](_0x56aecf[_0x6791('0x47')][_0x6791('0x6f')]);}})['then'](respondWithStatusCode(_0x8d9556,null))[_0x6791('0x28')](handleError(_0x8d9556,null));};exports[_0x6791('0x70')]=function(_0x43f905,_0x2fc1c3,_0x2eb20b){if(_0x43f905[_0x6791('0x63')]['id']){delete _0x43f905['body']['id'];}return db[_0x6791('0x42')][_0x6791('0x60')]({'where':{'id':_0x43f905[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x2fc1c3,null))[_0x6791('0x3a')](function(_0xb34f91){if(_0xb34f91){_0x43f905[_0x6791('0x63')]['FaxAccountId']=_0xb34f91['id'];return db[_0x6791('0x71')]['create'](_0x43f905[_0x6791('0x63')]);}})['then'](respondWithResult(_0x2fc1c3,null))[_0x6791('0x28')](handleError(_0x2fc1c3,null));};exports[_0x6791('0x72')]=function(_0x1a117c,_0x37762e,_0xcc3155){var _0x17159d={'raw':![],'where':{}};var _0x5a7029={};var _0x25dab9={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6791('0x67')]({'where':{'id':_0x1a117c['params']['id']}})['then'](handleEntityNotFound(_0x37762e,null))['then'](function(_0x1c6eb1){if(_0x1c6eb1){_0x5a7029[_0x6791('0x46')]=_['keys'](db[_0x6791('0x71')]['rawAttributes']);_0x5a7029[_0x6791('0x47')]=_[_0x6791('0x48')](_0x1a117c['query']);_0x5a7029['filters']=_['intersection'](_0x5a7029[_0x6791('0x46')],_0x5a7029[_0x6791('0x47')]);_0x17159d[_0x6791('0x4a')]=_['intersection'](_0x5a7029[_0x6791('0x46')],qs[_0x6791('0x4b')](_0x1a117c[_0x6791('0x47')][_0x6791('0x4b')]));_0x17159d[_0x6791('0x4a')]=_0x17159d['attributes'][_0x6791('0x4c')]?_0x17159d[_0x6791('0x4a')]:_0x5a7029[_0x6791('0x46')];if(!_0x1a117c[_0x6791('0x47')][_0x6791('0x4d')]('nolimit')){_0x17159d[_0x6791('0x2c')]=qs[_0x6791('0x2c')](_0x1a117c['query'][_0x6791('0x2c')]);_0x17159d[_0x6791('0x2b')]=qs[_0x6791('0x2b')](_0x1a117c[_0x6791('0x47')]['offset']);}_0x17159d[_0x6791('0x4f')]=qs[_0x6791('0x50')](_0x1a117c[_0x6791('0x47')][_0x6791('0x50')]);_0x17159d[_0x6791('0x51')]=qs[_0x6791('0x52')](_[_0x6791('0x69')](_0x1a117c[_0x6791('0x47')],_0x5a7029['filters']));_0x17159d['where'][_0x6791('0x65')]=_0x1c6eb1['id'];if(_0x1a117c[_0x6791('0x47')][_0x6791('0x53')]){_0x17159d['where']=_[_0x6791('0x54')](_0x17159d['where'],{'$or':_[_0x6791('0x41')](_0x17159d[_0x6791('0x4a')],function(_0x47edee){var _0xc7b93={};_0xc7b93[_0x47edee]={'$like':'%'+_0x1a117c[_0x6791('0x47')][_0x6791('0x53')]+'%'};return _0xc7b93;})});}_0x17159d=_[_0x6791('0x54')]({},_0x17159d,_0x1a117c[_0x6791('0x6a')]);return db['CannedAnswer'][_0x6791('0x2e')]({'where':_0x17159d[_0x6791('0x51')]})[_0x6791('0x3a')](function(_0x5c4e05){_0x25dab9['count']=_0x5c4e05;if(_0x1a117c[_0x6791('0x47')][_0x6791('0x56')]){_0x17159d['include']=[{'all':!![]}];}return db[_0x6791('0x71')][_0x6791('0x6c')](_0x17159d);})[_0x6791('0x3a')](function(_0x5dbcf3){_0x25dab9[_0x6791('0x6d')]=_0x5dbcf3;return _0x25dab9;});}})['then'](respondWithFilteredResult(_0x37762e,_0x17159d))['catch'](handleError(_0x37762e,null));};exports[_0x6791('0x73')]=function(_0x5e7379,_0x3cb412,_0x456583){return db[_0x6791('0x42')][_0x6791('0x60')]({'where':{'id':_0x5e7379[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x3cb412,null))['then'](function(_0x242d63){if(_0x242d63){return _0x242d63['removeAnswers'](_0x5e7379[_0x6791('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x3cb412,null))[_0x6791('0x28')](handleError(_0x3cb412,null));};exports[_0x6791('0x74')]=function(_0x3ac91c,_0x244989,_0x13c601){return db[_0x6791('0x75')][_0x6791('0x60')]({'where':{'id':_0x3ac91c[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x244989,null))[_0x6791('0x3a')](function(_0x2fe37c){if(_0x2fe37c){return _0x2fe37c[_0x6791('0x74')](_0x3ac91c[_0x6791('0x63')][_0x6791('0x6f')],_[_0x6791('0x76')](_0x3ac91c[_0x6791('0x63')],[_0x6791('0x6f'),'id'])||{});}})[_0x6791('0x3a')](respondWithResult(_0x244989,null))[_0x6791('0x28')](handleError(_0x244989,null));};exports['getInteractions']=function(_0xfef30e,_0xf06510,_0x51f438){var _0x4dc5e1={'raw':![],'where':{}};var _0x4c6eb1={};var _0x4bce1d={'count':0x0,'rows':[]};return db[_0x6791('0x42')][_0x6791('0x67')]({'where':{'id':_0xfef30e['params']['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0xf06510,null))[_0x6791('0x3a')](function(_0x1aea01){if(_0x1aea01){_0x4c6eb1[_0x6791('0x46')]=_[_0x6791('0x48')](db[_0x6791('0x75')][_0x6791('0x68')]);_0x4c6eb1[_0x6791('0x47')]=_['keys'](_0xfef30e[_0x6791('0x47')]);_0x4c6eb1['filters']=_[_0x6791('0x49')](_0x4c6eb1[_0x6791('0x46')],_0x4c6eb1[_0x6791('0x47')]);_0x4dc5e1['attributes']=_['intersection'](_0x4c6eb1['model'],qs[_0x6791('0x4b')](_0xfef30e[_0x6791('0x47')][_0x6791('0x4b')]));_0x4dc5e1[_0x6791('0x4a')]=_0x4dc5e1['attributes'][_0x6791('0x4c')]?_0x4dc5e1[_0x6791('0x4a')]:_0x4c6eb1[_0x6791('0x46')];if(!_0xfef30e[_0x6791('0x47')]['hasOwnProperty']('nolimit')){_0x4dc5e1['limit']=qs[_0x6791('0x2c')](_0xfef30e['query'][_0x6791('0x2c')]);_0x4dc5e1[_0x6791('0x2b')]=qs[_0x6791('0x2b')](_0xfef30e[_0x6791('0x47')][_0x6791('0x2b')]);}_0x4dc5e1[_0x6791('0x4f')]=qs[_0x6791('0x50')](_0xfef30e[_0x6791('0x47')]['sort']);_0x4dc5e1[_0x6791('0x51')]=qs[_0x6791('0x52')](_['pick'](_0xfef30e[_0x6791('0x47')],_0x4c6eb1[_0x6791('0x52')]));_0x4dc5e1[_0x6791('0x51')][_0x6791('0x65')]=_0x1aea01['id'];if(_0xfef30e['query'][_0x6791('0x53')]){_0x4dc5e1[_0x6791('0x51')]=_[_0x6791('0x54')](_0x4dc5e1[_0x6791('0x51')],{'$or':_[_0x6791('0x41')](_0x4dc5e1[_0x6791('0x4a')],function(_0x456077){var _0x42a171={};_0x42a171[_0x456077]={'$like':'%'+_0xfef30e[_0x6791('0x47')]['filter']+'%'};return _0x42a171;})});}_0x4dc5e1=_[_0x6791('0x54')]({},_0x4dc5e1,_0xfef30e[_0x6791('0x6a')]);return db[_0x6791('0x75')][_0x6791('0x2e')]({'where':_0x4dc5e1[_0x6791('0x51')]})['then'](function(_0x57a350){_0x4bce1d[_0x6791('0x2e')]=_0x57a350;if(_0xfef30e[_0x6791('0x47')]['includeAll']){_0x4dc5e1[_0x6791('0x57')]=[{'model':db[_0x6791('0x77')],'as':_0x6791('0x78'),'required':![]},{'model':db[_0x6791('0x79')],'as':_0x6791('0x7a'),'attributes':[_0x6791('0x3d'),_0x6791('0x7b'),_0x6791('0x7c')],'required':![]},{'model':db[_0x6791('0x7d')],'as':'Tags','attributes':['id',_0x6791('0x3d'),_0x6791('0x7e')],'where':_0xfef30e['query'][_0x6791('0x7f')]?{'id':_0xfef30e['query'][_0x6791('0x7f')]}:undefined,'required':_0xfef30e[_0x6791('0x47')][_0x6791('0x7f')]?!![]:![]}];}return db[_0x6791('0x75')][_0x6791('0x6c')](_0x4dc5e1);})[_0x6791('0x3a')](function(_0x3a6ce4){_0x4bce1d[_0x6791('0x6d')]=_0x3a6ce4;return _0x4bce1d;});}})[_0x6791('0x3a')](respondWithFilteredResult(_0xf06510,_0x4dc5e1))[_0x6791('0x28')](handleError(_0xf06510,null));};exports[_0x6791('0x80')]=function(_0x3eb148,_0x1f06d8,_0x33e4a9){return db[_0x6791('0x42')][_0x6791('0x67')]({'where':{'id':_0x3eb148[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x1f06d8,null))[_0x6791('0x3a')](function(_0x4edb6e){if(_0x4edb6e){return db[_0x6791('0x81')]['transaction'](function(_0x41385c){return db[_0x6791('0x82')][_0x6791('0x36')]({'where':{'FaxAccountId':_0x3eb148[_0x6791('0x59')]['id']},'transaction':_0x41385c})[_0x6791('0x3a')](function(_0x28da4c){var _0x45aa07=_[_0x6791('0x41')](_0x3eb148['body'],function(_0x30a0a4){_0x30a0a4['FaxAccountId']=_0x3eb148['params']['id'];return _0x30a0a4;});return db[_0x6791('0x82')][_0x6791('0x83')](_0x45aa07,{'transaction':_0x41385c});});})[_0x6791('0x3a')](function(){return db[_0x6791('0x82')][_0x6791('0x84')]({'where':{'FaxAccountId':_0x3eb148[_0x6791('0x59')]['id']},'order':_0x6791('0x85')});});}})['then'](respondWithResult(_0x1f06d8,null))[_0x6791('0x28')](handleError(_0x1f06d8,null));};exports[_0x6791('0x86')]=function(_0x4151de,_0x146c85,_0x1fc7a6){var _0x400547={};var _0x550c19={};var _0x3a6909;var _0x704f62;return db['FaxAccount'][_0x6791('0x67')]({'where':{'id':_0x4151de[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x146c85,null))[_0x6791('0x3a')](function(_0x5ed450){if(_0x5ed450){_0x3a6909=_0x5ed450;_0x550c19[_0x6791('0x46')]=_[_0x6791('0x48')](db[_0x6791('0x82')][_0x6791('0x68')]);_0x550c19['query']=_['keys'](_0x4151de[_0x6791('0x47')]);_0x550c19[_0x6791('0x52')]=_[_0x6791('0x49')](_0x550c19['model'],_0x550c19[_0x6791('0x47')]);_0x400547[_0x6791('0x4a')]=_[_0x6791('0x49')](_0x550c19['model'],qs['fields'](_0x4151de['query'][_0x6791('0x4b')]));_0x400547['attributes']=_0x400547[_0x6791('0x4a')][_0x6791('0x4c')]?_0x400547[_0x6791('0x4a')]:_0x550c19['model'];_0x400547[_0x6791('0x4f')]=qs['sort'](_0x4151de[_0x6791('0x47')]['sort']);_0x400547[_0x6791('0x51')]=qs['filters'](_[_0x6791('0x69')](_0x4151de[_0x6791('0x47')],_0x550c19[_0x6791('0x52')]));if(_0x4151de[_0x6791('0x47')][_0x6791('0x53')]){_0x400547['where']=_[_0x6791('0x54')](_0x400547['where'],{'$or':_[_0x6791('0x41')](_0x400547['attributes'],function(_0x87286e){var _0x7e90f1={};_0x7e90f1[_0x87286e]={'$like':'%'+_0x4151de[_0x6791('0x47')][_0x6791('0x53')]+'%'};return _0x7e90f1;})});}_0x400547=_['merge']({},_0x400547,_0x4151de['options']);return _0x3a6909[_0x6791('0x86')](_0x400547);}})[_0x6791('0x3a')](function(_0x2611f1){if(_0x2611f1){_0x704f62=_0x2611f1[_0x6791('0x4c')];if(!_0x4151de['query'][_0x6791('0x4d')]('nolimit')){_0x400547[_0x6791('0x2c')]=qs[_0x6791('0x2c')](_0x4151de[_0x6791('0x47')][_0x6791('0x2c')]);_0x400547[_0x6791('0x2b')]=qs[_0x6791('0x2b')](_0x4151de[_0x6791('0x47')]['offset']);}return _0x3a6909[_0x6791('0x86')](_0x400547);}})[_0x6791('0x3a')](function(_0x204d3a){if(_0x204d3a){return _0x204d3a?{'count':_0x704f62,'rows':_0x204d3a}:null;}})[_0x6791('0x3a')](respondWithResult(_0x146c85,null))[_0x6791('0x28')](handleError(_0x146c85,null));};function Extension(_0x221d15,_0xa61fcc,_0x257b04,_0x7acebe){this[_0x6791('0x87')]=_0x6791('0x88');this[_0x6791('0x89')]=_0x221d15['localstationid'];this[_0x6791('0x8a')]=_0x7acebe;this[_0x6791('0x44')]='system';this[_0x6791('0x8b')]=_0x6791('0x8c');this[_0x6791('0x65')]=_0x221d15['id'];this['priority']=_0xa61fcc;this['appdata']=_0x257b04;}function createExtensionsReciveFax(_0x405363){var _0x54d569=0x1;var _0xc1a202=[];_0xc1a202[_0x6791('0x8d')](new Extension(_0x405363,_0x54d569,'','Answer'));_0x54d569+=0x1;_0xc1a202['push'](new Extension(_0x405363,_0x54d569,_0x6791('0x8e'),_0x6791('0x8f')));_0x54d569+=0x1;for(var _0x707d88 in _0x405363){if(_0x405363[_0x6791('0x4d')](_0x707d88)&&(_0x707d88===_0x6791('0x90')||_0x707d88===_0x6791('0x91')||_0x707d88===_0x6791('0x92')||_0x707d88===_0x6791('0x93')||_0x707d88===_0x6791('0x94')||_0x707d88===_0x6791('0x95')||_0x707d88===_0x6791('0x96')||_0x707d88==='modem'||_0x707d88===_0x6791('0x97'))){_0xc1a202['push'](new Extension(_0x405363,_0x54d569,_0x6791('0x98')+_0x707d88+')='+_0x405363[_0x707d88],_0x6791('0x8f')));_0x54d569+=0x1;}}_0xc1a202['push'](new Extension(_0x405363,_0x54d569,'6','Wait'));_0x54d569+=0x1;_0xc1a202[_0x6791('0x8d')](new Extension(_0x405363,_0x54d569,_0x6791('0x99'),'ReceiveFax'));_0x54d569=0x0;return _0xc1a202;}exports[_0x6791('0x9a')]=function(_0x158767,_0x54af89,_0x426d10){var _0x3297e7;return db[_0x6791('0x81')][_0x6791('0x9b')](function(_0x216b49){return db[_0x6791('0x42')][_0x6791('0x5b')](_0x158767[_0x6791('0x63')],{'transaction':_0x216b49})[_0x6791('0x3a')](function(_0x5c1a1a){_0x3297e7=_0x5c1a1a[_0x6791('0x37')]({'plain':!![]});return db[_0x6791('0x9c')][_0x6791('0x83')](createExtensionsReciveFax(_0x3297e7),{'transaction':_0x216b49});});})[_0x6791('0x3a')](function(){return _0x3297e7;})[_0x6791('0x3a')](respondWithResult(_0x54af89,null))[_0x6791('0x28')](handleError(_0x54af89,null));};exports[_0x6791('0x9d')]=function(_0x560c2d,_0x2b103f,_0x5a56b4){var _0x1d0385;return db['sequelize'][_0x6791('0x9b')](function(_0x461356){return db[_0x6791('0x42')]['update'](_0x560c2d['body'],{'where':{'id':_0x560c2d[_0x6791('0x63')]['id']},'transaction':_0x461356})[_0x6791('0x3a')](function(_0x3e2be2){return db[_0x6791('0x9c')][_0x6791('0x36')]({'where':{'FaxAccountId':_0x560c2d[_0x6791('0x63')]['id']},'transaction':_0x461356})[_0x6791('0x3a')](function(_0x206609){return db['VoiceExtension'][_0x6791('0x83')](createExtensionsReciveFax(_[_0x6791('0x76')](_0x560c2d[_0x6791('0x63')],[_0x6791('0x9e'),_0x6791('0x45'),_0x6791('0x9f'),_0x6791('0xa0'),_0x6791('0xa1'),'ListId'])),{'transaction':_0x461356});});});})[_0x6791('0x3a')](function(){return db[_0x6791('0x42')][_0x6791('0xa2')](_0x560c2d[_0x6791('0x63')]['id']);})[_0x6791('0x3a')](respondWithResult(_0x2b103f,null))[_0x6791('0x28')](handleError(_0x2b103f,null));};exports[_0x6791('0xa3')]=function(_0x2048dd,_0x465fc4,_0x54f969){var _0x5c995d={'raw':!![],'where':{}};var _0x5e3d05={};var _0x1abe6a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6791('0x67')]({'where':{'id':_0x2048dd[_0x6791('0x59')]['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x465fc4,null))['then'](function(_0x32ebc5){if(_0x32ebc5){_0x5e3d05['model']=_['keys'](db[_0x6791('0xa4')][_0x6791('0x68')]);_0x5e3d05[_0x6791('0x47')]=_[_0x6791('0x48')](_0x2048dd[_0x6791('0x47')]);_0x5e3d05[_0x6791('0x52')]=_[_0x6791('0x49')](_0x5e3d05[_0x6791('0x46')],_0x5e3d05[_0x6791('0x47')]);_0x5c995d[_0x6791('0x4a')]=_[_0x6791('0x49')](_0x5e3d05[_0x6791('0x46')],qs[_0x6791('0x4b')](_0x2048dd['query'][_0x6791('0x4b')]));_0x5c995d[_0x6791('0x4a')]=_0x5c995d[_0x6791('0x4a')][_0x6791('0x4c')]?_0x5c995d[_0x6791('0x4a')]:_0x5e3d05[_0x6791('0x46')];if(!_0x2048dd[_0x6791('0x47')][_0x6791('0x4d')](_0x6791('0x4e'))){_0x5c995d[_0x6791('0x2c')]=qs[_0x6791('0x2c')](_0x2048dd['query'][_0x6791('0x2c')]);_0x5c995d[_0x6791('0x2b')]=qs[_0x6791('0x2b')](_0x2048dd[_0x6791('0x47')][_0x6791('0x2b')]);}_0x5c995d['order']=qs[_0x6791('0x50')](_0x2048dd[_0x6791('0x47')][_0x6791('0x50')]);_0x5c995d['where']=qs[_0x6791('0x52')](_[_0x6791('0x69')](_0x2048dd['query'],_0x5e3d05['filters']));_0x5c995d[_0x6791('0x51')][_0x6791('0x65')]=_0x32ebc5['id'];if(_0x2048dd[_0x6791('0x47')]['filter']){_0x5c995d[_0x6791('0x51')]=_['merge'](_0x5c995d[_0x6791('0x51')],{'$or':_[_0x6791('0x41')](_0x5c995d[_0x6791('0x4a')],function(_0x46d04c){var _0x18f02e={};_0x18f02e[_0x46d04c]={'$like':'%'+_0x2048dd[_0x6791('0x47')][_0x6791('0x53')]+'%'};return _0x18f02e;})});}if(_0x2048dd[_0x6791('0x47')]['$gte']){var _0x3d11f6=_0x2048dd['query'][_0x6791('0xa5')][_0x6791('0xa6')](',');var _0xe2d681={};_0xe2d681[_0x3d11f6[0x0]]={'$gte':moment(_0x3d11f6[0x1])[_0x6791('0xa7')](_0x6791('0xa8'))};_0x5c995d[_0x6791('0x51')]=_[_0x6791('0x54')](_0x5c995d['where'],_0xe2d681);}_0x5c995d=_[_0x6791('0x54')]({},_0x5c995d,_0x2048dd['options']);return db['FaxMessage'][_0x6791('0x2e')]({'where':_0x5c995d[_0x6791('0x51')]})[_0x6791('0x3a')](function(_0x13be6b){_0x1abe6a[_0x6791('0x2e')]=_0x13be6b;if(_0x2048dd[_0x6791('0x47')]['includeAll']){_0x5c995d[_0x6791('0x57')]=[{'all':!![]}];}return db[_0x6791('0xa4')][_0x6791('0x6c')](_0x5c995d);})['then'](function(_0x42b729){_0x1abe6a[_0x6791('0x6d')]=_0x42b729;return _0x1abe6a;});}})[_0x6791('0x3a')](respondWithFilteredResult(_0x465fc4,_0x5c995d))[_0x6791('0x28')](handleError(_0x465fc4,null));};exports[_0x6791('0x3e')]=function(_0x2d5291,_0x881fc6,_0x8801cd){var _0x44bd43,_0x5b9d67={},_0x3e332f;if(_0x2d5291[_0x6791('0x63')]['to']){_0x3e332f=_0x2d5291['body']['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x2d5291[_0x6791('0x59')]['id']},'include':[{'model':db[_0x6791('0xa9')],'as':_0x6791('0xaa'),'include':[{'model':db[_0x6791('0x77')],'as':_0x6791('0xab'),'where':{'fax':_0x3e332f},'limit':0x1,'order':[[_0x6791('0xa0'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x881fc6,null))['then'](function(_0x48d62f){_0x44bd43=_0x48d62f;if(_0x2d5291[_0x6791('0x63')]['attachments']&&_0x2d5291['body'][_0x6791('0xac')][_0x6791('0x4c')]){for(var _0x11da2a=0x0;_0x11da2a<_0x2d5291['body'][_0x6791('0xac')][_0x6791('0x4c')];_0x11da2a+=0x1){_0x2d5291['body'][_0x6791('0xac')][_0x11da2a]={'filename':_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][_0x11da2a]['name'],'id':_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][_0x11da2a]['id'],'path':path[_0x6791('0xad')](config[_0x6791('0xae')],_0x6791('0xaf'),_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][_0x11da2a]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x6791('0xb0'),{'FaxAccountId':_[_0x6791('0xb1')](_0x2d5291[_0x6791('0x59')]['id'])?undefined:_0x2d5291[_0x6791('0x59')]['id'],'path':_[_0x6791('0xb1')](_0x2d5291['body'][_0x6791('0xac')][0x0][_0x6791('0xb2')])?undefined:_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][0x0]['path'],'fax':_['isNil'](_0x2d5291[_0x6791('0x63')]['to'][0x0])?undefined:_0x2d5291[_0x6791('0x63')]['to'][0x0]},client9002);})[_0x6791('0x3a')](function(){if(_0x44bd43){if(_[_0x6791('0xb1')](_0x2d5291[_0x6791('0x63')][_0x6791('0xb3')])){_0x2d5291[_0x6791('0x63')]['from']=util[_0x6791('0xa7')](_0x6791('0xb4'),_0x44bd43['name'],_0x44bd43[_0x6791('0xb5')]);}if(_0x44bd43[_0x6791('0xaa')]){if(_0x44bd43[_0x6791('0xaa')]['Contacts'][_0x6791('0x4c')]){return _0x44bd43[_0x6791('0xaa')][_0x6791('0xab')][0x0];}else{return db[_0x6791('0x77')]['create'](_[_0x6791('0x18')](_0x2d5291[_0x6791('0x63')],{'firstName':_0x2d5291[_0x6791('0x63')]['to'][0x0],'phone':_0x2d5291[_0x6791('0x63')]['to'][0x0],'fax':_0x2d5291['body']['to'][0x0],'ListId':_0x44bd43[_0x6791('0xb6')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6791('0xb7'));}})[_0x6791('0x3a')](function(_0x12109f){if(_0x12109f){return db[_0x6791('0x75')][_0x6791('0x60')]({'where':{'ContactId':_0x12109f['id'],'closed':![],'FaxAccountId':_0x44bd43['id']}})[_0x6791('0x3a')](function(_0x4842b3){if(_0x4842b3){return[_0x4842b3,![]];}return db[_0x6791('0x75')][_0x6791('0x5b')]({'UserId':_0x2d5291[_0x6791('0x5c')]['id'],'ContactId':_0x12109f['id'],'FaxAccountId':_0x44bd43['id'],'fax':_0x2d5291[_0x6791('0x63')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x2d5291['body'],{'read':![],'body':_0x2d5291['body'][_0x6791('0xac')][0x0][_0x6791('0xb8')],'FaxAccountId':_0x44bd43['id'],'UserId':_0x2d5291[_0x6791('0x5c')]['id'],'ContactId':_0x12109f['id'],'AttachmentId':_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x6791('0xa4')],'as':_0x6791('0xb9')}]})['then'](function(_0x11ddc8){return[_0x11ddc8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x6791('0xba')](function(_0x150b0e,_0x1564f9){if(_0x1564f9){return _0x150b0e;}return db['FaxMessage'][_0x6791('0x5b')]({'direction':_0x6791('0xbb'),'read':![],'body':_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][0x0][_0x6791('0xb8')],'FaxAccountId':_0x44bd43['id'],'FaxInteractionId':_0x150b0e['id'],'UserId':_0x2d5291[_0x6791('0x5c')]['id'],'ContactId':_0x150b0e['ContactId'],'AttachmentId':_0x2d5291[_0x6791('0x63')]['attachments'][0x0]['id']})['then'](function(_0x4ce391){_0x150b0e[_0x6791('0xbc')][_0x6791('0xb9')]=[];_0x150b0e[_0x6791('0xbc')][_0x6791('0xb9')][_0x6791('0x8d')](_0x4ce391[_0x6791('0xbc')]);return _0x150b0e;});})[_0x6791('0x3a')](function(_0x26976b){respondWithRpcPromise(_0x6791('0xbd'),'SendFax',{'FaxAccountId':_[_0x6791('0xb1')](_0x2d5291['params']['id'])?undefined:_0x2d5291[_0x6791('0x59')]['id'],'path':_[_0x6791('0xb1')](_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][0x0][_0x6791('0xb2')])?undefined:_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][0x0]['path'],'fax':_[_0x6791('0xb1')](_0x2d5291['body']['to'][0x0])?undefined:_0x2d5291['body']['to'][0x0],'AttachmentId':_0x2d5291[_0x6791('0x63')][_0x6791('0xac')][0x0]['id']},client9002)['then'](function(_0x3ef666){logger[_0x6791('0xbe')](_0x6791('0xbf'),_0x3ef666);})[_0x6791('0x28')](function(_0x45eeef){logger['info'](_0x6791('0xbf'),_0x45eeef);});return _0x26976b;})[_0x6791('0x3a')](respondWithResult(_0x881fc6,null))[_0x6791('0x28')](handleError(_0x881fc6,null));};exports[_0x6791('0xc0')]=function(_0x243933,_0x5b4ca4,_0x21bbae){return db['FaxAccount']['find']({'where':{'id':_0x243933[_0x6791('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b4ca4,null))[_0x6791('0x3a')](function(_0x53ce18){if(_0x53ce18){return _0x53ce18[_0x6791('0xc0')](_0x243933[_0x6791('0x63')][_0x6791('0x6f')],_[_0x6791('0x76')](_0x243933[_0x6791('0x63')],[_0x6791('0x6f'),'id'])||{})[_0x6791('0xba')](function(_0x10707e){for(var _0x2d4ddf=0x0;_0x2d4ddf<_0x243933['body']['ids']['length'];_0x2d4ddf+=0x1){socket[_0x6791('0xc1')](_0x6791('0xc2'),{'UserId':_0x243933[_0x6791('0x63')][_0x6791('0x6f')][_0x2d4ddf],'FaxAccountId':_0x243933[_0x6791('0x59')]['id']});}return _0x10707e;});}})[_0x6791('0x3a')](respondWithResult(_0x5b4ca4,null))['catch'](handleError(_0x5b4ca4,null));};exports['removeAgents']=function(_0x21e688,_0xd2e245,_0xb975f0){return db['FaxAccount'][_0x6791('0x60')]({'where':{'id':_0x21e688[_0x6791('0x59')]['id']}})['then'](handleEntityNotFound(_0xd2e245,null))['then'](function(_0x348ac3){if(_0x348ac3){return _0x348ac3[_0x6791('0xc3')](_0x21e688[_0x6791('0x47')][_0x6791('0x6f')])[_0x6791('0x3a')](function(){if(_[_0x6791('0xc4')](_0x21e688[_0x6791('0x47')][_0x6791('0x6f')])){for(var _0x1671ab=0x0;_0x1671ab<_0x21e688[_0x6791('0x47')][_0x6791('0x6f')][_0x6791('0x4c')];_0x1671ab+=0x1){socket[_0x6791('0xc1')](_0x6791('0xc5'),{'UserId':Number(_0x21e688[_0x6791('0x47')][_0x6791('0x6f')][_0x1671ab]),'FaxAccountId':Number(_0x21e688['params']['id'])});}}else{socket[_0x6791('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x21e688[_0x6791('0x47')][_0x6791('0x6f')]),'FaxAccountId':Number(_0x21e688['params']['id'])});}});}})[_0x6791('0x3a')](respondWithStatusCode(_0xd2e245,null))[_0x6791('0x28')](handleError(_0xd2e245,null));};exports['getAgents']=function(_0x4171b9,_0x5725a8,_0x1c6f23){var _0xd53708={};var _0x5cc96d={};var _0x5152ec;var _0x5dbf0c;return db[_0x6791('0x42')][_0x6791('0x67')]({'where':{'id':_0x4171b9['params']['id']}})[_0x6791('0x3a')](handleEntityNotFound(_0x5725a8,null))[_0x6791('0x3a')](function(_0x2dff7a){if(_0x2dff7a){_0x5152ec=_0x2dff7a;_0x5cc96d['model']=_[_0x6791('0x48')](db[_0x6791('0x79')][_0x6791('0x68')]);_0x5cc96d[_0x6791('0x47')]=_['keys'](_0x4171b9[_0x6791('0x47')]);_0x5cc96d['filters']=_[_0x6791('0x49')](_0x5cc96d[_0x6791('0x46')],_0x5cc96d[_0x6791('0x47')]);_0xd53708['attributes']=_[_0x6791('0x49')](_0x5cc96d[_0x6791('0x46')],qs['fields'](_0x4171b9[_0x6791('0x47')][_0x6791('0x4b')]));_0xd53708['attributes']=_0xd53708[_0x6791('0x4a')][_0x6791('0x4c')]?_0xd53708[_0x6791('0x4a')]:_0x5cc96d[_0x6791('0x46')];_0xd53708[_0x6791('0x4f')]=qs[_0x6791('0x50')](_0x4171b9[_0x6791('0x47')]['sort']);_0xd53708[_0x6791('0x51')]=qs[_0x6791('0x52')](_[_0x6791('0x69')](_0x4171b9[_0x6791('0x47')],_0x5cc96d[_0x6791('0x52')]));if(_0x4171b9[_0x6791('0x47')][_0x6791('0x53')]){_0xd53708[_0x6791('0x51')]=_[_0x6791('0x54')](_0xd53708[_0x6791('0x51')],{'$or':_[_0x6791('0x41')](_0xd53708[_0x6791('0x4a')],function(_0x363a32){var _0x3b3363={};_0x3b3363[_0x363a32]={'$like':'%'+_0x4171b9[_0x6791('0x47')]['filter']+'%'};return _0x3b3363;})});}_0xd53708=_['merge']({},_0xd53708,_0x4171b9[_0x6791('0x6a')]);return _0x5152ec[_0x6791('0xc6')](_0xd53708);}})['then'](function(_0x32a122){if(_0x32a122){_0x5dbf0c=_0x32a122['length'];if(!_0x4171b9[_0x6791('0x47')][_0x6791('0x4d')](_0x6791('0x4e'))){_0xd53708[_0x6791('0x2c')]=qs[_0x6791('0x2c')](_0x4171b9[_0x6791('0x47')][_0x6791('0x2c')]);_0xd53708[_0x6791('0x2b')]=qs[_0x6791('0x2b')](_0x4171b9[_0x6791('0x47')][_0x6791('0x2b')]);}return _0x5152ec[_0x6791('0xc6')](_0xd53708);}})['then'](function(_0x2a0bde){if(_0x2a0bde){return _0x2a0bde?{'count':_0x5dbf0c,'rows':_0x2a0bde}:null;}})[_0x6791('0x3a')](respondWithResult(_0x5725a8,null))[_0x6791('0x28')](handleError(_0x5725a8,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 6bb108e..e59816b 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 _0xa594=['events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x42f47f,_0x11ca9e){var _0x561d43=function(_0x29e50f){while(--_0x29e50f){_0x42f47f['push'](_0x42f47f['shift']());}};_0x561d43(++_0x11ca9e);}(_0xa594,0x18c));var _0x4a59=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xa594[_0x59342a];return _0x17abc9;};'use strict';var EventEmitter=require(_0x4a59('0x0'));var FaxAccount=require(_0x4a59('0x1'))['db'][_0x4a59('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4a59('0x3')](0x0);var events={'afterCreate':_0x4a59('0x4'),'afterUpdate':_0x4a59('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48bcec){return function(_0x57d871,_0x192529,_0x4f4636){FaxAccountEvents[_0x4a59('0x6')](_0x48bcec+':'+_0x57d871['id'],_0x57d871);FaxAccountEvents[_0x4a59('0x6')](_0x48bcec,_0x57d871);_0x4f4636(null);};}for(var e in events){if(events[_0x4a59('0x7')](e)){var event=events[e];FaxAccount[_0x4a59('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x4314=['emit','hasOwnProperty','hook','exports','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x4314,0xe5));var _0x4431=function(_0x2a25dc,_0x31eb66){_0x2a25dc=_0x2a25dc-0x0;var _0x179468=_0x4314[_0x2a25dc];return _0x179468;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x4431('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4431('0x1')](0x0);var events={'afterCreate':_0x4431('0x2'),'afterUpdate':_0x4431('0x3'),'afterDestroy':_0x4431('0x4')};function emitEvent(_0x512bed){return function(_0x1851cb,_0x3bcb91,_0x16fabd){FaxAccountEvents[_0x4431('0x5')](_0x512bed+':'+_0x1851cb['id'],_0x1851cb);FaxAccountEvents[_0x4431('0x5')](_0x512bed,_0x1851cb);_0x16fabd(null);};}for(var e in events){if(events[_0x4431('0x6')](e)){var event=events[e];FaxAccount[_0x4431('0x7')](e,emitEvent(event));}}module[_0x4431('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 39d591f..03c7429 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 _0xa42c=['rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4e6012,_0x1c4dec){var _0x25afd8=function(_0x778621){while(--_0x778621){_0x4e6012['push'](_0x4e6012['shift']());}};_0x25afd8(++_0x1c4dec);}(_0xa42c,0x1ce));var _0xca42=function(_0x3662b4,_0x503b4d){_0x3662b4=_0x3662b4-0x0;var _0x50928c=_0xa42c[_0x3662b4];return _0x50928c;};'use strict';var _=require(_0xca42('0x0'));var util=require('util');var logger=require(_0xca42('0x1'))(_0xca42('0x2'));var moment=require('moment');var BPromise=require(_0xca42('0x3'));var rp=require(_0xca42('0x4'));var fs=require('fs');var path=require(_0xca42('0x5'));var rimraf=require(_0xca42('0x6'));var config=require(_0xca42('0x7'));var attributes=require(_0xca42('0x8'));module['exports']=function(_0x433935,_0x5d2fd0){return _0x433935[_0xca42('0x9')](_0xca42('0xa'),attributes,{'tableName':_0xca42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd744=['bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x5c3270,_0x5d0a1c){var _0x10ffef=function(_0x442739){while(--_0x442739){_0x5c3270['push'](_0x5c3270['shift']());}};_0x10ffef(++_0x5d0a1c);}(_0xd744,0x159));var _0x4d74=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd744[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4d74('0x0'));var util=require(_0x4d74('0x1'));var logger=require(_0x4d74('0x2'))(_0x4d74('0x3'));var moment=require(_0x4d74('0x4'));var BPromise=require(_0x4d74('0x5'));var rp=require(_0x4d74('0x6'));var fs=require('fs');var path=require(_0x4d74('0x7'));var rimraf=require(_0x4d74('0x8'));var config=require('../../config/environment');var attributes=require(_0x4d74('0x9'));module[_0x4d74('0xa')]=function(_0x13b3d3,_0x3c7e7c){return _0x13b3d3[_0x4d74('0xb')](_0x4d74('0xc'),attributes,{'tableName':_0x4d74('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index ce600b6..deb845e 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 _0x8b5f=['interaction','FaxMessage','ContactId','AttachmentId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','findAll','raw','options','include','map','attributes','model','NotifyFaxAccount','body','Sequelize','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','CmContact','Contacts','DESC','Applications','applications','list','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','*,*,*,*','created'];(function(_0x48e88c,_0xa4471d){var _0x5067ad=function(_0x4e8743){while(--_0x4e8743){_0x48e88c['push'](_0x48e88c['shift']());}};_0x5067ad(++_0xa4471d);}(_0x8b5f,0x113));var _0xf8b5=function(_0x574d63,_0x26e925){_0x574d63=_0x574d63-0x0;var _0x4b0bb1=_0x8b5f[_0x574d63];return _0x4b0bb1;};'use strict';var _=require('lodash');var util=require(_0xf8b5('0x0'));var moment=require(_0xf8b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xf8b5('0x2'));var fs=require('fs');var Redis=require(_0xf8b5('0x3'));var db=require(_0xf8b5('0x4'))['db'];var utils=require(_0xf8b5('0x5'));var logger=require(_0xf8b5('0x6'))(_0xf8b5('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8b5('0x8'));var client=jayson['client'][_0xf8b5('0x9')]({'port':0x232c});config[_0xf8b5('0xa')]=_[_0xf8b5('0xb')](config[_0xf8b5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf8b5('0xc'))(new Redis(config[_0xf8b5('0xa')]));require(_0xf8b5('0xd'))[_0xf8b5('0xe')](socket);function respondWithRpcPromise(_0x4a8509,_0x5475f1,_0x427f10){return new BPromise(function(_0x20e143,_0x93a67a){return client[_0xf8b5('0xf')](_0x4a8509,_0x427f10)[_0xf8b5('0x10')](function(_0x3e995e){logger[_0xf8b5('0x11')](_0xf8b5('0x12'),_0x5475f1,_0xf8b5('0x13'));logger[_0xf8b5('0x14')](_0xf8b5('0x15'),_0x5475f1,_0xf8b5('0x13'),JSON[_0xf8b5('0x16')](_0x3e995e));if(_0x3e995e[_0xf8b5('0x17')]){if(_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x18')]===0x1f4){logger[_0xf8b5('0x17')](_0xf8b5('0x12'),_0x5475f1,_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x19')]);return _0x93a67a(_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x19')]);}logger[_0xf8b5('0x17')](_0xf8b5('0x12'),_0x5475f1,_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x19')]);return _0x20e143(_0x3e995e['error']['message']);}else{logger[_0xf8b5('0x11')]('FaxAccount,\x20%s,\x20%s',_0x5475f1,'request\x20sent');_0x20e143(_0x3e995e[_0xf8b5('0x1a')]['message']);}})['catch'](function(_0x32f0d7){logger[_0xf8b5('0x17')](_0xf8b5('0x12'),_0x5475f1,_0x32f0d7);_0x93a67a(_0x32f0d7);});});}exports[_0xf8b5('0x1b')]=function(_0x2fff03){var _0x42a7de=this;return new Promise(function(_0x1a5fd6,_0x578470){return db['FaxAccount'][_0xf8b5('0x1c')]({'raw':_0x2fff03['options']?_0x2fff03['options'][_0xf8b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03[_0xf8b5('0x1e')]['where']||null:null,'attributes':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03['options']['attributes']||null:null,'limit':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03[_0xf8b5('0x1e')]['limit']||null:null,'include':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03[_0xf8b5('0x1e')][_0xf8b5('0x1f')]?_[_0xf8b5('0x20')](_0x2fff03[_0xf8b5('0x1e')][_0xf8b5('0x1f')],function(_0x2a1e1f){return{'model':db[_0x2a1e1f['model']],'as':_0x2a1e1f['as'],'attributes':_0x2a1e1f[_0xf8b5('0x21')],'include':_0x2a1e1f[_0xf8b5('0x1f')]?_['map'](_0x2a1e1f['include'],function(_0x2253c0){return{'model':db[_0x2253c0[_0xf8b5('0x22')]],'as':_0x2253c0['as'],'attributes':_0x2253c0[_0xf8b5('0x21')],'include':_0x2253c0[_0xf8b5('0x1f')]?_[_0xf8b5('0x20')](_0x2253c0[_0xf8b5('0x1f')],function(_0x57911e){return{'model':db[_0x57911e[_0xf8b5('0x22')]],'as':_0x57911e['as'],'attributes':_0x57911e[_0xf8b5('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf8b5('0x10')](function(_0x52262d){logger['info'](_0xf8b5('0x1b'),_0x2fff03);logger[_0xf8b5('0x14')](_0xf8b5('0x1b'),_0x2fff03,JSON[_0xf8b5('0x16')](_0x52262d));_0x1a5fd6(_0x52262d);})['catch'](function(_0x30f994){logger[_0xf8b5('0x17')](_0xf8b5('0x1b'),_0x30f994[_0xf8b5('0x19')],_0x2fff03);_0x578470(_0x42a7de[_0xf8b5('0x17')](0x1f4,_0x30f994['message']));});});};exports[_0xf8b5('0x23')]=function(_0x245665,_0x1448c2,_0x3605fe){var _0x475bff=this;return new Promise(function(_0x5a7188,_0x30dfae){var _0x4b84d0={'body':_0x245665[_0xf8b5('0x24')],'channel':'fax'};var _0x38c1b9=[];var _0x911d1d=[];var _0x2756d9={};return db['CmContact']['describe']()[_0xf8b5('0x10')](function(_0x552f39){if(!_0x552f39){throw new db[(_0xf8b5('0x25'))]['ValidationError']('no\x20available\x20attributes');}_0x38c1b9=_[_0xf8b5('0x26')](_[_0xf8b5('0x27')](_0x552f39),['createdAt','updatedAt']);_0x911d1d=_[_0xf8b5('0x26')](_[_0xf8b5('0x27')](_0x552f39),[_0xf8b5('0x28'),_0xf8b5('0x29'),_0xf8b5('0x2a'),_0xf8b5('0x2b')]);if(_0x245665[_0xf8b5('0x24')]['id']){delete _0x245665['body']['id'];}if(_[_0xf8b5('0x2c')](_0x245665[_0xf8b5('0x24')][_0xf8b5('0x2d')])){throw new db[(_0xf8b5('0x25'))][(_0xf8b5('0x2e'))](_0xf8b5('0x2f'));}if(_[_0xf8b5('0x2c')](_0x245665[_0xf8b5('0x24')][_0xf8b5('0x24')])||_0x245665[_0xf8b5('0x24')][_0xf8b5('0x24')]===''){throw new db[(_0xf8b5('0x25'))][(_0xf8b5('0x2e'))](_0xf8b5('0x30'));}if(_[_0xf8b5('0x2c')](_0x245665[_0xf8b5('0x24')]['mapKey'])){throw new db['Sequelize'][(_0xf8b5('0x2e'))](_0xf8b5('0x31')+_0x911d1d);}if(!_[_0xf8b5('0x32')](_0x911d1d,_0x245665[_0xf8b5('0x24')][_0xf8b5('0x33')])){throw new db[(_0xf8b5('0x25'))][(_0xf8b5('0x2e'))](_0xf8b5('0x34')+_0x911d1d);}_0x2756d9[_0x245665[_0xf8b5('0x24')][_0xf8b5('0x33')]]=_0x245665[_0xf8b5('0x24')]['from'];})[_0xf8b5('0x10')](function(){return db[_0xf8b5('0x35')][_0xf8b5('0x36')]({'where':{'id':_0x245665[_0xf8b5('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xf8b5('0x38'),'include':[{'model':db[_0xf8b5('0x39')],'as':_0xf8b5('0x3a'),'where':_0x2756d9,'limit':0x1,'order':[['updatedAt',_0xf8b5('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0xf8b5('0x3c')}]});})['then'](function(_0x4acea5){if(_0x4acea5&&_0x4acea5[_0xf8b5('0x38')]){var _0x75de10=_0x4acea5['get']({'plain':!![]});_0x4b84d0[_0xf8b5('0x37')]=_0x75de10;_0x4b84d0[_0xf8b5('0x3d')]=_0x75de10[_0xf8b5('0x3c')];_0x4b84d0[_0xf8b5('0x3e')]=_0x75de10[_0xf8b5('0x38')];_0x4b84d0[_0xf8b5('0x3d')]=_[_0xf8b5('0x3f')](_0x4b84d0[_0xf8b5('0x3d')],[_0xf8b5('0x40')],[_0xf8b5('0x41')]);if(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x3c')]){delete _0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x3c')];}if(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x38')]&&_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x38')][_0xf8b5('0x3a')][_0xf8b5('0x42')]){return _0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x38')][_0xf8b5('0x3a')][0x0];}var _0x286a08=_['defaults'](_0x245665['body'],{'firstName':_0x245665['body'][_0xf8b5('0x2d')],'ListId':_0x75de10[_0xf8b5('0x2b')]});_0x286a08[_0x245665[_0xf8b5('0x24')][_0xf8b5('0x33')]]=_0x245665[_0xf8b5('0x24')][_0xf8b5('0x2d')];return db[_0xf8b5('0x39')][_0xf8b5('0x43')](_0x286a08,{'fields':_0x38c1b9,'raw':!![]});}})['then'](function(_0x10ec23){_0x4b84d0[_0xf8b5('0x44')]=_0x10ec23;if(_0x10ec23){var _0x5f2e13={'ContactId':_0x10ec23['id'],'FaxAccountId':_0x245665[_0xf8b5('0x37')]['id'],'fax':_0x10ec23['fax']};return db[_0xf8b5('0x45')]['find']({'where':{'ContactId':_0x10ec23['id'],'closed':![],'FaxAccountId':_0x245665[_0xf8b5('0x37')]['id']}})['then'](function(_0x1728c2){if(_0x1728c2){return[_0x1728c2,![]];}return db['FaxInteraction'][_0xf8b5('0x43')](_0x5f2e13)[_0xf8b5('0x10')](function(_0x4ba1ec){return[_0x4ba1ec,!![]];});});}else{throw new Error(_0xf8b5('0x46'));}})[_0xf8b5('0x47')](function(_0x354db8,_0x13f73d){var _0x3bb779=_0x354db8[_0xf8b5('0x48')]({'plain':!![]});if(_0x13f73d){if(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x49')]){_0x4b84d0[_0xf8b5('0x3d')][_0xf8b5('0x4a')]({'id':0x0,'priority':_0x4b84d0[_0xf8b5('0x3d')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xf8b5('0x4b')});}_0x3bb779[_0xf8b5('0x4c')]=!![];}else{_0x3bb779[_0xf8b5('0x4c')]=![];}_0x4b84d0[_0xf8b5('0x4d')]=_0x3bb779;return db[_0xf8b5('0x4e')][_0xf8b5('0x43')]({'body':_0x245665[_0xf8b5('0x24')]['body'],'FaxAccountId':_0x245665['account']['id'],'FaxInteractionId':_0x354db8['id'],'direction':'in','ContactId':_0x354db8[_0xf8b5('0x4f')],'AttachmentId':_0x245665[_0xf8b5('0x24')][_0xf8b5('0x50')]});})['then'](function(_0x1b2627){_0x4b84d0[_0xf8b5('0x19')]=_0x1b2627;if(_0x4b84d0[_0xf8b5('0x4d')]['UserId']){return db[_0xf8b5('0x51')]['find']({'attributes':['id',_0xf8b5('0x52')],'where':{'id':_0x4b84d0[_0xf8b5('0x4d')]['UserId']}})['then'](function(_0x510680){if(_0x510680){_0x4b84d0['applications'][_0xf8b5('0x53')]({'id':0x0,'priority':0x0,'app':_0xf8b5('0x54'),'appdata':_0x510680[_0xf8b5('0x52')]+','+(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x55')]||0xa),'interval':_0xf8b5('0x4b')});}return respondWithRpcPromise(_0xf8b5('0x56'),_0xf8b5('0x57'),_0x4b84d0);});}return respondWithRpcPromise(_0xf8b5('0x56'),_0xf8b5('0x57'),_0x4b84d0);})[_0xf8b5('0x10')](function(_0x3bfc1d){_0x5a7188(_0x3bfc1d);})['catch'](function(_0x313990){_0x30dfae(_0x475bff[_0xf8b5('0x17')](0x1f4,_0x313990[_0xf8b5('0x19')]));});});}; \ No newline at end of file +var _0xd676=['options','raw','where','attributes','include','map','model','GetFaxAccount','debug','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','keys','ListId','isNil','from','from\x20is\x20mandatory','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','priority','length','defaults','create','FaxInteraction','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','Start','startRouting','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll'];(function(_0x1f7e4e,_0x5592ae){var _0x7db922=function(_0x219e12){while(--_0x219e12){_0x1f7e4e['push'](_0x1f7e4e['shift']());}};_0x7db922(++_0x5592ae);}(_0xd676,0xed));var _0x6d67=function(_0x5332b1,_0x192941){_0x5332b1=_0x5332b1-0x0;var _0x129b49=_0xd676[_0x5332b1];return _0x129b49;};'use strict';var _=require(_0x6d67('0x0'));var util=require(_0x6d67('0x1'));var moment=require('moment');var BPromise=require(_0x6d67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d67('0x3'))['db'];var utils=require(_0x6d67('0x4'));var logger=require(_0x6d67('0x5'))(_0x6d67('0x6'));var config=require(_0x6d67('0x7'));var jayson=require(_0x6d67('0x8'));var client=jayson[_0x6d67('0x9')][_0x6d67('0xa')]({'port':0x232c});config[_0x6d67('0xb')]=_['defaults'](config[_0x6d67('0xb')],{'host':_0x6d67('0xc'),'port':0x18eb});var socket=require(_0x6d67('0xd'))(new Redis(config[_0x6d67('0xb')]));require(_0x6d67('0xe'))[_0x6d67('0xf')](socket);function respondWithRpcPromise(_0x5976f5,_0x296d02,_0x8d3092){return new BPromise(function(_0x12a109,_0x368119){return client[_0x6d67('0x10')](_0x5976f5,_0x8d3092)[_0x6d67('0x11')](function(_0x5189dd){logger[_0x6d67('0x12')](_0x6d67('0x13'),_0x296d02,_0x6d67('0x14'));logger['debug'](_0x6d67('0x15'),_0x296d02,'request\x20sent',JSON[_0x6d67('0x16')](_0x5189dd));if(_0x5189dd['error']){if(_0x5189dd[_0x6d67('0x17')][_0x6d67('0x18')]===0x1f4){logger[_0x6d67('0x17')](_0x6d67('0x13'),_0x296d02,_0x5189dd[_0x6d67('0x17')][_0x6d67('0x19')]);return _0x368119(_0x5189dd['error'][_0x6d67('0x19')]);}logger['error'](_0x6d67('0x13'),_0x296d02,_0x5189dd[_0x6d67('0x17')][_0x6d67('0x19')]);return _0x12a109(_0x5189dd[_0x6d67('0x17')][_0x6d67('0x19')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x296d02,'request\x20sent');_0x12a109(_0x5189dd[_0x6d67('0x1a')][_0x6d67('0x19')]);}})[_0x6d67('0x1b')](function(_0x2dd96d){logger[_0x6d67('0x17')]('FaxAccount,\x20%s,\x20%s',_0x296d02,_0x2dd96d);_0x368119(_0x2dd96d);});});}exports['GetFaxAccount']=function(_0x3e0425){var _0x3a4648=this;return new Promise(function(_0x37f95b,_0x208636){return db[_0x6d67('0x1c')][_0x6d67('0x1d')]({'raw':_0x3e0425[_0x6d67('0x1e')]?_0x3e0425[_0x6d67('0x1e')][_0x6d67('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e0425[_0x6d67('0x1e')]?_0x3e0425[_0x6d67('0x1e')][_0x6d67('0x20')]||null:null,'attributes':_0x3e0425[_0x6d67('0x1e')]?_0x3e0425['options'][_0x6d67('0x21')]||null:null,'limit':_0x3e0425['options']?_0x3e0425['options']['limit']||null:null,'include':_0x3e0425[_0x6d67('0x1e')]?_0x3e0425[_0x6d67('0x1e')][_0x6d67('0x22')]?_[_0x6d67('0x23')](_0x3e0425[_0x6d67('0x1e')][_0x6d67('0x22')],function(_0x28abb){return{'model':db[_0x28abb[_0x6d67('0x24')]],'as':_0x28abb['as'],'attributes':_0x28abb[_0x6d67('0x21')],'include':_0x28abb[_0x6d67('0x22')]?_[_0x6d67('0x23')](_0x28abb[_0x6d67('0x22')],function(_0x592b5f){return{'model':db[_0x592b5f['model']],'as':_0x592b5f['as'],'attributes':_0x592b5f['attributes'],'include':_0x592b5f[_0x6d67('0x22')]?_['map'](_0x592b5f['include'],function(_0x1c75bf){return{'model':db[_0x1c75bf['model']],'as':_0x1c75bf['as'],'attributes':_0x1c75bf[_0x6d67('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41fa2d){logger['info'](_0x6d67('0x25'),_0x3e0425);logger[_0x6d67('0x26')]('GetFaxAccount',_0x3e0425,JSON[_0x6d67('0x16')](_0x41fa2d));_0x37f95b(_0x41fa2d);})[_0x6d67('0x1b')](function(_0x1fee3a){logger[_0x6d67('0x17')]('GetFaxAccount',_0x1fee3a[_0x6d67('0x19')],_0x3e0425);_0x208636(_0x3a4648[_0x6d67('0x17')](0x1f4,_0x1fee3a[_0x6d67('0x19')]));});});};exports[_0x6d67('0x27')]=function(_0x5a9371,_0x3901bd,_0x1057b9){var _0x2dd6c3=this;return new Promise(function(_0x46de2f,_0x4d6af0){var _0x1806dc={'body':_0x5a9371[_0x6d67('0x28')],'channel':_0x6d67('0x29')};var _0x306a07=[];var _0x116b98=[];var _0x4dd98a={};return db[_0x6d67('0x2a')][_0x6d67('0x2b')]()[_0x6d67('0x11')](function(_0x201e93){if(!_0x201e93){throw new db[(_0x6d67('0x2c'))]['ValidationError'](_0x6d67('0x2d'));}_0x306a07=_['difference'](_['keys'](_0x201e93),[_0x6d67('0x2e'),_0x6d67('0x2f')]);_0x116b98=_[_0x6d67('0x30')](_[_0x6d67('0x31')](_0x201e93),[_0x6d67('0x2e'),'updatedAt','CompanyId',_0x6d67('0x32')]);if(_0x5a9371[_0x6d67('0x28')]['id']){delete _0x5a9371[_0x6d67('0x28')]['id'];}if(_[_0x6d67('0x33')](_0x5a9371[_0x6d67('0x28')][_0x6d67('0x34')])){throw new db[(_0x6d67('0x2c'))]['ValidationError'](_0x6d67('0x35'));}if(_['isNil'](_0x5a9371[_0x6d67('0x28')][_0x6d67('0x28')])||_0x5a9371['body'][_0x6d67('0x28')]===''){throw new db[(_0x6d67('0x2c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6d67('0x33')](_0x5a9371[_0x6d67('0x28')][_0x6d67('0x36')])){throw new db['Sequelize'][(_0x6d67('0x37'))](_0x6d67('0x38')+_0x116b98);}if(!_['includes'](_0x116b98,_0x5a9371[_0x6d67('0x28')][_0x6d67('0x36')])){throw new db[(_0x6d67('0x2c'))][(_0x6d67('0x37'))](_0x6d67('0x39')+_0x116b98);}_0x4dd98a[_0x5a9371[_0x6d67('0x28')][_0x6d67('0x36')]]=_0x5a9371[_0x6d67('0x28')][_0x6d67('0x34')];})['then'](function(){return db[_0x6d67('0x1c')][_0x6d67('0x3a')]({'where':{'id':_0x5a9371[_0x6d67('0x3b')]['id']},'include':[{'model':db[_0x6d67('0x3c')],'as':'List','include':[{'model':db['CmContact'],'as':_0x6d67('0x3d'),'where':_0x4dd98a,'limit':0x1,'order':[[_0x6d67('0x2f'),_0x6d67('0x3e')]]}]},{'model':db[_0x6d67('0x3f')],'as':_0x6d67('0x40')}]});})['then'](function(_0x52ae35){if(_0x52ae35&&_0x52ae35[_0x6d67('0x41')]){var _0x1d1194=_0x52ae35[_0x6d67('0x42')]({'plain':!![]});_0x1806dc[_0x6d67('0x3b')]=_0x1d1194;_0x1806dc[_0x6d67('0x43')]=_0x1d1194['Applications'];_0x1806dc[_0x6d67('0x44')]=_0x1d1194[_0x6d67('0x41')];_0x1806dc[_0x6d67('0x43')]=_[_0x6d67('0x45')](_0x1806dc[_0x6d67('0x43')],[_0x6d67('0x46')],['asc']);if(_0x1806dc['account'][_0x6d67('0x40')]){delete _0x1806dc['account'][_0x6d67('0x40')];}if(_0x1806dc[_0x6d67('0x3b')][_0x6d67('0x41')]&&_0x1806dc['account'][_0x6d67('0x41')][_0x6d67('0x3d')][_0x6d67('0x47')]){return _0x1806dc['account'][_0x6d67('0x41')][_0x6d67('0x3d')][0x0];}var _0x35d4de=_[_0x6d67('0x48')](_0x5a9371[_0x6d67('0x28')],{'firstName':_0x5a9371[_0x6d67('0x28')]['from'],'ListId':_0x1d1194[_0x6d67('0x32')]});_0x35d4de[_0x5a9371[_0x6d67('0x28')]['mapKey']]=_0x5a9371[_0x6d67('0x28')][_0x6d67('0x34')];return db[_0x6d67('0x2a')][_0x6d67('0x49')](_0x35d4de,{'fields':_0x306a07,'raw':!![]});}})[_0x6d67('0x11')](function(_0x19f269){_0x1806dc['contact']=_0x19f269;if(_0x19f269){var _0x54a25d={'ContactId':_0x19f269['id'],'FaxAccountId':_0x5a9371[_0x6d67('0x3b')]['id'],'fax':_0x19f269[_0x6d67('0x29')]};return db['FaxInteraction'][_0x6d67('0x3a')]({'where':{'ContactId':_0x19f269['id'],'closed':![],'FaxAccountId':_0x5a9371[_0x6d67('0x3b')]['id']}})[_0x6d67('0x11')](function(_0x424962){if(_0x424962){return[_0x424962,![]];}return db[_0x6d67('0x4a')][_0x6d67('0x49')](_0x54a25d)['then'](function(_0x329561){return[_0x329561,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x6d67('0x4b')](function(_0x105917,_0x287915){var _0x7d155=_0x105917[_0x6d67('0x42')]({'plain':!![]});if(_0x287915){if(_0x1806dc['account']['autoclose']){_0x1806dc[_0x6d67('0x43')][_0x6d67('0x4c')]({'id':0x0,'priority':_0x1806dc[_0x6d67('0x43')][_0x6d67('0x47')]+0x1,'app':_0x6d67('0x4d'),'appdata':_0x6d67('0x4e'),'interval':_0x6d67('0x4f')});}_0x7d155[_0x6d67('0x50')]=!![];}else{_0x7d155[_0x6d67('0x50')]=![];}_0x1806dc[_0x6d67('0x51')]=_0x7d155;return db[_0x6d67('0x52')][_0x6d67('0x49')]({'body':_0x5a9371[_0x6d67('0x28')][_0x6d67('0x28')],'FaxAccountId':_0x5a9371['account']['id'],'FaxInteractionId':_0x105917['id'],'direction':'in','ContactId':_0x105917[_0x6d67('0x53')],'AttachmentId':_0x5a9371[_0x6d67('0x28')][_0x6d67('0x54')]});})[_0x6d67('0x11')](function(_0x2c42c2){_0x1806dc[_0x6d67('0x19')]=_0x2c42c2;if(_0x1806dc[_0x6d67('0x51')][_0x6d67('0x55')]){return db['User'][_0x6d67('0x3a')]({'attributes':['id','name'],'where':{'id':_0x1806dc[_0x6d67('0x51')][_0x6d67('0x55')]}})[_0x6d67('0x11')](function(_0x2ac8f4){if(_0x2ac8f4){_0x1806dc[_0x6d67('0x43')][_0x6d67('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2ac8f4['name']+','+(_0x1806dc[_0x6d67('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0x6d67('0x4f')});}return respondWithRpcPromise(_0x6d67('0x57'),_0x6d67('0x58'),_0x1806dc);});}return respondWithRpcPromise(_0x6d67('0x57'),_0x6d67('0x58'),_0x1806dc);})[_0x6d67('0x11')](function(_0x1c521d){_0x46de2f(_0x1c521d);})[_0x6d67('0x1b')](function(_0x2b6faf){_0x4d6af0(_0x2dd6c3[_0x6d67('0x17')](0x1f4,_0x2b6faf[_0x6d67('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 7fe757d..49ef8ff 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 _0x2734=['length','./faxAccount.events','remove','update','emit','removeListener'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x2734,0x85));var _0x4273=function(_0x21033b,_0x43f9b1){_0x21033b=_0x21033b-0x0;var _0x173e97=_0x2734[_0x21033b];return _0x173e97;};'use strict';var FaxAccountEvents=require(_0x4273('0x0'));var events=['save',_0x4273('0x1'),_0x4273('0x2')];function createListener(_0x1a8cb9,_0x2e68c9){return function(_0x206d2c){_0x2e68c9[_0x4273('0x3')](_0x1a8cb9,_0x206d2c);};}function removeListener(_0x39ecb2,_0x29006d){return function(){FaxAccountEvents[_0x4273('0x4')](_0x39ecb2,_0x29006d);};}exports['register']=function(_0x65334c){for(var _0x36b3bc=0x0,_0x3960f6=events[_0x4273('0x5')];_0x36b3bc<_0x3960f6;_0x36b3bc++){var _0x56d603=events[_0x36b3bc];var _0x114506=createListener('faxAccount:'+_0x56d603,_0x65334c);FaxAccountEvents['on'](_0x56d603,_0x114506);}}; \ No newline at end of file +var _0x37d4=['faxAccount:','save','remove','update','removeListener','register','length'];(function(_0x747005,_0x3efd2a){var _0x77f86c=function(_0x4d3789){while(--_0x4d3789){_0x747005['push'](_0x747005['shift']());}};_0x77f86c(++_0x3efd2a);}(_0x37d4,0x6a));var _0x437d=function(_0x4a859e,_0x298f4e){_0x4a859e=_0x4a859e-0x0;var _0x1098ed=_0x37d4[_0x4a859e];return _0x1098ed;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x437d('0x0'),_0x437d('0x1'),_0x437d('0x2')];function createListener(_0x49f38c,_0x3a6701){return function(_0x3c3765){_0x3a6701['emit'](_0x49f38c,_0x3c3765);};}function removeListener(_0x4660cb,_0x2b984e){return function(){FaxAccountEvents[_0x437d('0x3')](_0x4660cb,_0x2b984e);};}exports[_0x437d('0x4')]=function(_0x4cc0bb){for(var _0x202512=0x0,_0x20e2a=events[_0x437d('0x5')];_0x202512<_0x20e2a;_0x202512++){var _0x154cae=events[_0x202512];var _0x5a3444=createListener(_0x437d('0x6')+_0x154cae,_0x4cc0bb);FaxAccountEvents['on'](_0x154cae,_0x5a3444);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 50d9e72..347beff 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(_0xb58ab4,_0x396977){var _0x5e30a5=function(_0xfbd8fd){while(--_0xfbd8fd){_0xb58ab4['push'](_0xb58ab4['shift']());}};_0x5e30a5(++_0x396977);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x31caa8,_0x3f5f6c){var _0x2f5c18=function(_0x4d6807){while(--_0x4d6807){_0x31caa8['push'](_0x31caa8['shift']());}};_0x2f5c18(++_0x3f5f6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 1550821..115e945 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 _0xbcf4=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0xb0d185,_0x4c85b7){var _0x2f03ec=function(_0x810848){while(--_0x810848){_0xb0d185['push'](_0xb0d185['shift']());}};_0x2f03ec(++_0x4c85b7);}(_0xbcf4,0x1d9));var _0x4bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4bcf('0x0'));module[_0x4bcf('0x1')]={'priority':{'type':Sequelize[_0x4bcf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4bcf('0x3')],'allowNull':![],'defaultValue':_0x4bcf('0x4')},'appdata':{'type':Sequelize[_0x4bcf('0x5')]()},'description':{'type':Sequelize[_0x4bcf('0x3')]},'interval':{'type':Sequelize[_0x4bcf('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8cd4=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x6f1933,_0x3ef2e6){var _0x379546=function(_0x83c3e9){while(--_0x83c3e9){_0x6f1933['push'](_0x6f1933['shift']());}};_0x379546(++_0x3ef2e6);}(_0x8cd4,0x1bd));var _0x48cd=function(_0x3c02e0,_0x49fbc5){_0x3c02e0=_0x3c02e0-0x0;var _0x344759=_0x8cd4[_0x3c02e0];return _0x344759;};'use strict';var Sequelize=require(_0x48cd('0x0'));module[_0x48cd('0x1')]={'priority':{'type':Sequelize[_0x48cd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x48cd('0x3')],'allowNull':![],'defaultValue':_0x48cd('0x4')},'appdata':{'type':Sequelize[_0x48cd('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x48cd('0x3')],'defaultValue':_0x48cd('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 2223b93..e577b74 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 _0x34dd=['stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','fields','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x2f1820,_0x59560e){var _0x51ea5f=function(_0x1764b3){while(--_0x1764b3){_0x2f1820['push'](_0x2f1820['shift']());}};_0x51ea5f(++_0x59560e);}(_0x34dd,0x71));var _0xd34d=function(_0x1fc691,_0x2d39a1){_0x1fc691=_0x1fc691-0x0;var _0x2a67f8=_0x34dd[_0x1fc691];return _0x2a67f8;};'use strict';var emlformat=require(_0xd34d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd34d('0x1'));var jsonpatch=require(_0xd34d('0x2'));var rp=require(_0xd34d('0x3'));var moment=require(_0xd34d('0x4'));var BPromise=require(_0xd34d('0x5'));var Mustache=require(_0xd34d('0x6'));var util=require(_0xd34d('0x7'));var path=require('path');var sox=require(_0xd34d('0x8'));var csv=require(_0xd34d('0x9'));var ejs=require(_0xd34d('0xa'));var fs=require('fs');var fs_extra=require(_0xd34d('0xb'));var _=require('lodash');var squel=require(_0xd34d('0xc'));var crypto=require(_0xd34d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd34d('0xe'));var toCsv=require(_0xd34d('0x9'));var querystring=require(_0xd34d('0xf'));var Papa=require(_0xd34d('0x10'));var Redis=require('ioredis');var authService=require(_0xd34d('0x11'));var qs=require(_0xd34d('0x12'));var as=require(_0xd34d('0x13'));var hardwareService=require(_0xd34d('0x14'));var logger=require(_0xd34d('0x15'))(_0xd34d('0x16'));var utils=require('../../config/utils');var config=require(_0xd34d('0x17'));var licenseUtil=require(_0xd34d('0x18'));var db=require(_0xd34d('0x19'))['db'];function respondWithStatusCode(_0x572b9a,_0x36c728){_0x36c728=_0x36c728||0xcc;return function(_0x2fc748){if(_0x2fc748){return _0x572b9a[_0xd34d('0x1a')](_0x36c728);}return _0x572b9a[_0xd34d('0x1b')](_0x36c728)['end']();};}function respondWithResult(_0x2e4435,_0x2c03ee){_0x2c03ee=_0x2c03ee||0xc8;return function(_0x191810){if(_0x191810){return _0x2e4435['status'](_0x2c03ee)['json'](_0x191810);}};}function respondWithFilteredResult(_0x1a0746,_0x523168){return function(_0x229589){if(_0x229589){var _0x1dfa3b=typeof _0x523168[_0xd34d('0x1c')]==='undefined'&&typeof _0x523168['limit']===_0xd34d('0x1d');var _0x476115=_0x229589[_0xd34d('0x1e')];var _0x36859c=_0x1dfa3b?0x0:_0x523168[_0xd34d('0x1c')];var _0x4e7241=_0x1dfa3b?_0x229589[_0xd34d('0x1e')]:_0x523168[_0xd34d('0x1c')]+_0x523168['limit'];var _0x376743;if(_0x4e7241>=_0x476115){_0x4e7241=_0x476115;_0x376743=0xc8;}else{_0x376743=0xce;}_0x1a0746[_0xd34d('0x1b')](_0x376743);return _0x1a0746[_0xd34d('0x1f')](_0xd34d('0x20'),_0x36859c+'-'+_0x4e7241+'/'+_0x476115)[_0xd34d('0x21')](_0x229589);}return null;};}function patchUpdates(_0x553b4c){return function(_0x150eba){try{jsonpatch[_0xd34d('0x22')](_0x150eba,_0x553b4c,!![]);}catch(_0x268082){return BPromise[_0xd34d('0x23')](_0x268082);}return _0x150eba[_0xd34d('0x24')]();};}function saveUpdates(_0x4c47a1,_0x226967){return function(_0x148bc2){if(_0x148bc2){return _0x148bc2[_0xd34d('0x25')](_0x4c47a1)[_0xd34d('0x26')](function(_0x48ab8e){return _0x48ab8e;});}return null;};}function removeEntity(_0x59fc00,_0x89aef){return function(_0x428b42){if(_0x428b42){return _0x428b42[_0xd34d('0x27')]()[_0xd34d('0x26')](function(){_0x59fc00[_0xd34d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x293cb5,_0x9c8b16){return function(_0xbb729a){if(!_0xbb729a){_0x293cb5[_0xd34d('0x1a')](0x194);}return _0xbb729a;};}function handleError(_0x24d03b,_0x346ea8){_0x346ea8=_0x346ea8||0x1f4;return function(_0x3ba85f){logger[_0xd34d('0x28')](_0x3ba85f[_0xd34d('0x29')]);if(_0x3ba85f['name']){delete _0x3ba85f[_0xd34d('0x2a')];}_0x24d03b['status'](_0x346ea8)[_0xd34d('0x2b')](_0x3ba85f);};}exports[_0xd34d('0x2c')]=function(_0x33e65a,_0x4afbf4){var _0xd97d72={},_0x26e08a={},_0x1e62c1={'count':0x0,'rows':[]};var _0x51b60f=_[_0xd34d('0x2d')](db[_0xd34d('0x2e')][_0xd34d('0x2f')],function(_0x47cc55){return{'name':_0x47cc55[_0xd34d('0x30')],'type':_0x47cc55['type'][_0xd34d('0x31')]};});_0x26e08a[_0xd34d('0x32')]=_[_0xd34d('0x2d')](_0x51b60f,_0xd34d('0x2a'));_0x26e08a['query']=_[_0xd34d('0x33')](_0x33e65a[_0xd34d('0x34')]);_0x26e08a[_0xd34d('0x35')]=_[_0xd34d('0x36')](_0x26e08a['model'],_0x26e08a[_0xd34d('0x34')]);_0xd97d72['attributes']=_['intersection'](_0x26e08a[_0xd34d('0x32')],qs['fields'](_0x33e65a[_0xd34d('0x34')]['fields']));_0xd97d72['attributes']=_0xd97d72['attributes']['length']?_0xd97d72[_0xd34d('0x37')]:_0x26e08a[_0xd34d('0x32')];if(!_0x33e65a['query'][_0xd34d('0x38')](_0xd34d('0x39'))){_0xd97d72[_0xd34d('0x3a')]=qs[_0xd34d('0x3a')](_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3a')]);_0xd97d72[_0xd34d('0x1c')]=qs[_0xd34d('0x1c')](_0x33e65a['query'][_0xd34d('0x1c')]);}_0xd97d72[_0xd34d('0x3b')]=qs[_0xd34d('0x3c')](_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3c')]);_0xd97d72[_0xd34d('0x3d')]=qs['filters'](_['pick'](_0x33e65a[_0xd34d('0x34')],_0x26e08a[_0xd34d('0x35')]),_0x51b60f);if(_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3e')]){_0xd97d72[_0xd34d('0x3d')]=_['merge'](_0xd97d72['where'],{'$or':_['map'](_0x51b60f,function(_0x7aa6df){if(_0x7aa6df[_0xd34d('0x3f')]!==_0xd34d('0x40')){var _0x43d71b={};_0x43d71b[_0x7aa6df[_0xd34d('0x2a')]]={'$like':'%'+_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3e')]+'%'};return _0x43d71b;}})});}_0xd97d72=_[_0xd34d('0x41')]({},_0xd97d72,_0x33e65a[_0xd34d('0x42')]);var _0x5a6a07={'where':_0xd97d72['where']};return db[_0xd34d('0x2e')][_0xd34d('0x1e')](_0x5a6a07)['then'](function(_0x277561){_0x1e62c1['count']=_0x277561;if(_0x33e65a['query'][_0xd34d('0x43')]){_0xd97d72['include']=[{'all':!![]}];}return db[_0xd34d('0x2e')]['findAll'](_0xd97d72);})[_0xd34d('0x26')](function(_0x16b446){_0x1e62c1[_0xd34d('0x44')]=_0x16b446;return _0x1e62c1;})[_0xd34d('0x26')](respondWithFilteredResult(_0x4afbf4,_0xd97d72))[_0xd34d('0x45')](handleError(_0x4afbf4,null));};exports[_0xd34d('0x46')]=function(_0x2aa386,_0x2aee95){var _0x2dea1b={'raw':!![],'where':{'id':_0x2aa386[_0xd34d('0x47')]['id']}},_0x4e5707={};_0x4e5707[_0xd34d('0x32')]=_['keys'](db[_0xd34d('0x2e')][_0xd34d('0x2f')]);_0x4e5707['query']=_['keys'](_0x2aa386[_0xd34d('0x34')]);_0x4e5707[_0xd34d('0x35')]=_['intersection'](_0x4e5707[_0xd34d('0x32')],_0x4e5707[_0xd34d('0x34')]);_0x2dea1b['attributes']=_[_0xd34d('0x36')](_0x4e5707[_0xd34d('0x32')],qs[_0xd34d('0x48')](_0x2aa386[_0xd34d('0x34')][_0xd34d('0x48')]));_0x2dea1b[_0xd34d('0x37')]=_0x2dea1b['attributes'][_0xd34d('0x49')]?_0x2dea1b[_0xd34d('0x37')]:_0x4e5707[_0xd34d('0x32')];if(_0x2aa386[_0xd34d('0x34')]['includeAll']){_0x2dea1b['include']=[{'all':!![]}];}_0x2dea1b=_['merge']({},_0x2dea1b,_0x2aa386[_0xd34d('0x42')]);return db[_0xd34d('0x2e')][_0xd34d('0x4a')](_0x2dea1b)[_0xd34d('0x26')](handleEntityNotFound(_0x2aee95,null))[_0xd34d('0x26')](respondWithResult(_0x2aee95,null))[_0xd34d('0x45')](handleError(_0x2aee95,null));};exports['create']=function(_0x1961ba,_0xd1ec0c){return db[_0xd34d('0x2e')][_0xd34d('0x4b')](_0x1961ba[_0xd34d('0x4c')],{})[_0xd34d('0x26')](respondWithResult(_0xd1ec0c,0xc9))[_0xd34d('0x45')](handleError(_0xd1ec0c,null));};exports['update']=function(_0x4c8c7e,_0x43e0bf){if(_0x4c8c7e[_0xd34d('0x4c')]['id']){delete _0x4c8c7e[_0xd34d('0x4c')]['id'];}return db[_0xd34d('0x2e')][_0xd34d('0x4a')]({'where':{'id':_0x4c8c7e['params']['id']}})[_0xd34d('0x26')](handleEntityNotFound(_0x43e0bf,null))['then'](saveUpdates(_0x4c8c7e[_0xd34d('0x4c')],null))[_0xd34d('0x26')](respondWithResult(_0x43e0bf,null))[_0xd34d('0x45')](handleError(_0x43e0bf,null));};exports[_0xd34d('0x27')]=function(_0x5f13a6,_0x2e5316){return db[_0xd34d('0x2e')][_0xd34d('0x4a')]({'where':{'id':_0x5f13a6['params']['id']}})[_0xd34d('0x26')](handleEntityNotFound(_0x2e5316,null))[_0xd34d('0x26')](removeEntity(_0x2e5316,null))[_0xd34d('0x45')](handleError(_0x2e5316,null));}; \ No newline at end of file +var _0x6766=['sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','FaxApplication','rawAttributes','options','catch','create','body','find','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order'];(function(_0x5efe84,_0x220ff4){var _0x4555f6=function(_0x11d22e){while(--_0x11d22e){_0x5efe84['push'](_0x5efe84['shift']());}};_0x4555f6(++_0x220ff4);}(_0x6766,0xde));var _0x6676=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x6766[_0x5c6244];return _0x5800ce;};'use strict';var emlformat=require(_0x6676('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6676('0x1'));var rp=require(_0x6676('0x2'));var moment=require(_0x6676('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6676('0x4'));var util=require(_0x6676('0x5'));var path=require('path');var sox=require(_0x6676('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6676('0x7'));var _=require(_0x6676('0x8'));var squel=require(_0x6676('0x9'));var crypto=require(_0x6676('0xa'));var jsforce=require(_0x6676('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6676('0xc'));var qs=require(_0x6676('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6676('0xe'))(_0x6676('0xf'));var utils=require(_0x6676('0x10'));var config=require(_0x6676('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x6676('0x12'))['db'];function respondWithStatusCode(_0x3a4377,_0x3c95b8){_0x3c95b8=_0x3c95b8||0xcc;return function(_0x359392){if(_0x359392){return _0x3a4377[_0x6676('0x13')](_0x3c95b8);}return _0x3a4377['status'](_0x3c95b8)[_0x6676('0x14')]();};}function respondWithResult(_0x1fa0ff,_0x56c4d2){_0x56c4d2=_0x56c4d2||0xc8;return function(_0x2a6673){if(_0x2a6673){return _0x1fa0ff[_0x6676('0x15')](_0x56c4d2)[_0x6676('0x16')](_0x2a6673);}};}function respondWithFilteredResult(_0x3d9235,_0x1bfb53){return function(_0x4c2da9){if(_0x4c2da9){var _0x288b9c=typeof _0x1bfb53[_0x6676('0x17')]===_0x6676('0x18')&&typeof _0x1bfb53[_0x6676('0x19')]==='undefined';var _0x1abd8e=_0x4c2da9['count'];var _0xb4c0bd=_0x288b9c?0x0:_0x1bfb53[_0x6676('0x17')];var _0x5d44b7=_0x288b9c?_0x4c2da9[_0x6676('0x1a')]:_0x1bfb53[_0x6676('0x17')]+_0x1bfb53['limit'];var _0x343ed1;if(_0x5d44b7>=_0x1abd8e){_0x5d44b7=_0x1abd8e;_0x343ed1=0xc8;}else{_0x343ed1=0xce;}_0x3d9235[_0x6676('0x15')](_0x343ed1);return _0x3d9235[_0x6676('0x1b')](_0x6676('0x1c'),_0xb4c0bd+'-'+_0x5d44b7+'/'+_0x1abd8e)['json'](_0x4c2da9);}return null;};}function patchUpdates(_0x260bc6){return function(_0x87184a){try{jsonpatch['apply'](_0x87184a,_0x260bc6,!![]);}catch(_0x1efcdd){return BPromise[_0x6676('0x1d')](_0x1efcdd);}return _0x87184a[_0x6676('0x1e')]();};}function saveUpdates(_0x2bbc58,_0x1875b3){return function(_0x8db317){if(_0x8db317){return _0x8db317[_0x6676('0x1f')](_0x2bbc58)[_0x6676('0x20')](function(_0x3c1a8c){return _0x3c1a8c;});}return null;};}function removeEntity(_0x5aaab3,_0x351649){return function(_0x5a5183){if(_0x5a5183){return _0x5a5183[_0x6676('0x21')]()['then'](function(){_0x5aaab3[_0x6676('0x15')](0xcc)[_0x6676('0x14')]();});}};}function handleEntityNotFound(_0xa285d6,_0x121a6c){return function(_0x547969){if(!_0x547969){_0xa285d6[_0x6676('0x13')](0x194);}return _0x547969;};}function handleError(_0x2349c1,_0x3f5835){_0x3f5835=_0x3f5835||0x1f4;return function(_0x368dca){logger[_0x6676('0x22')](_0x368dca['stack']);if(_0x368dca[_0x6676('0x23')]){delete _0x368dca[_0x6676('0x23')];}_0x2349c1['status'](_0x3f5835)['send'](_0x368dca);};}exports[_0x6676('0x24')]=function(_0x254124,_0xeab6e){var _0x4a28dc={},_0x59cea7={},_0x2aeb42={'count':0x0,'rows':[]};var _0x3b6b93=_[_0x6676('0x25')](db['FaxApplication']['rawAttributes'],function(_0x470478){return{'name':_0x470478[_0x6676('0x26')],'type':_0x470478[_0x6676('0x27')][_0x6676('0x28')]};});_0x59cea7['model']=_[_0x6676('0x25')](_0x3b6b93,_0x6676('0x23'));_0x59cea7[_0x6676('0x29')]=_[_0x6676('0x2a')](_0x254124[_0x6676('0x29')]);_0x59cea7[_0x6676('0x2b')]=_[_0x6676('0x2c')](_0x59cea7[_0x6676('0x2d')],_0x59cea7[_0x6676('0x29')]);_0x4a28dc[_0x6676('0x2e')]=_[_0x6676('0x2c')](_0x59cea7[_0x6676('0x2d')],qs[_0x6676('0x2f')](_0x254124[_0x6676('0x29')][_0x6676('0x2f')]));_0x4a28dc[_0x6676('0x2e')]=_0x4a28dc['attributes'][_0x6676('0x30')]?_0x4a28dc['attributes']:_0x59cea7[_0x6676('0x2d')];if(!_0x254124['query']['hasOwnProperty']('nolimit')){_0x4a28dc[_0x6676('0x19')]=qs['limit'](_0x254124[_0x6676('0x29')][_0x6676('0x19')]);_0x4a28dc[_0x6676('0x17')]=qs[_0x6676('0x17')](_0x254124[_0x6676('0x29')][_0x6676('0x17')]);}_0x4a28dc[_0x6676('0x31')]=qs[_0x6676('0x32')](_0x254124[_0x6676('0x29')][_0x6676('0x32')]);_0x4a28dc[_0x6676('0x33')]=qs[_0x6676('0x2b')](_[_0x6676('0x34')](_0x254124[_0x6676('0x29')],_0x59cea7[_0x6676('0x2b')]),_0x3b6b93);if(_0x254124[_0x6676('0x29')][_0x6676('0x35')]){_0x4a28dc[_0x6676('0x33')]=_['merge'](_0x4a28dc[_0x6676('0x33')],{'$or':_['map'](_0x3b6b93,function(_0x15be6b){if(_0x15be6b[_0x6676('0x27')]!==_0x6676('0x36')){var _0x1b0d85={};_0x1b0d85[_0x15be6b[_0x6676('0x23')]]={'$like':'%'+_0x254124['query'][_0x6676('0x35')]+'%'};return _0x1b0d85;}})});}_0x4a28dc=_[_0x6676('0x37')]({},_0x4a28dc,_0x254124['options']);var _0x3516cc={'where':_0x4a28dc[_0x6676('0x33')]};return db['FaxApplication'][_0x6676('0x1a')](_0x3516cc)[_0x6676('0x20')](function(_0x28ca78){_0x2aeb42['count']=_0x28ca78;if(_0x254124[_0x6676('0x29')]['includeAll']){_0x4a28dc[_0x6676('0x38')]=[{'all':!![]}];}return db['FaxApplication'][_0x6676('0x39')](_0x4a28dc);})[_0x6676('0x20')](function(_0x559be0){_0x2aeb42[_0x6676('0x3a')]=_0x559be0;return _0x2aeb42;})[_0x6676('0x20')](respondWithFilteredResult(_0xeab6e,_0x4a28dc))['catch'](handleError(_0xeab6e,null));};exports[_0x6676('0x3b')]=function(_0x51789e,_0x48da5b){var _0xfae74={'raw':!![],'where':{'id':_0x51789e[_0x6676('0x3c')]['id']}},_0x540ee2={};_0x540ee2[_0x6676('0x2d')]=_['keys'](db[_0x6676('0x3d')][_0x6676('0x3e')]);_0x540ee2[_0x6676('0x29')]=_[_0x6676('0x2a')](_0x51789e[_0x6676('0x29')]);_0x540ee2[_0x6676('0x2b')]=_[_0x6676('0x2c')](_0x540ee2[_0x6676('0x2d')],_0x540ee2['query']);_0xfae74[_0x6676('0x2e')]=_[_0x6676('0x2c')](_0x540ee2[_0x6676('0x2d')],qs[_0x6676('0x2f')](_0x51789e[_0x6676('0x29')][_0x6676('0x2f')]));_0xfae74['attributes']=_0xfae74['attributes']['length']?_0xfae74[_0x6676('0x2e')]:_0x540ee2['model'];if(_0x51789e['query']['includeAll']){_0xfae74[_0x6676('0x38')]=[{'all':!![]}];}_0xfae74=_[_0x6676('0x37')]({},_0xfae74,_0x51789e[_0x6676('0x3f')]);return db['FaxApplication']['find'](_0xfae74)['then'](handleEntityNotFound(_0x48da5b,null))['then'](respondWithResult(_0x48da5b,null))[_0x6676('0x40')](handleError(_0x48da5b,null));};exports[_0x6676('0x41')]=function(_0x3f5c6a,_0x50db42){return db[_0x6676('0x3d')][_0x6676('0x41')](_0x3f5c6a[_0x6676('0x42')],{})['then'](respondWithResult(_0x50db42,0xc9))[_0x6676('0x40')](handleError(_0x50db42,null));};exports[_0x6676('0x1f')]=function(_0x44f7e9,_0x375317){if(_0x44f7e9[_0x6676('0x42')]['id']){delete _0x44f7e9[_0x6676('0x42')]['id'];}return db[_0x6676('0x3d')]['find']({'where':{'id':_0x44f7e9[_0x6676('0x3c')]['id']}})[_0x6676('0x20')](handleEntityNotFound(_0x375317,null))[_0x6676('0x20')](saveUpdates(_0x44f7e9[_0x6676('0x42')],null))['then'](respondWithResult(_0x375317,null))['catch'](handleError(_0x375317,null));};exports[_0x6676('0x21')]=function(_0xd28414,_0x5681e5){return db[_0x6676('0x3d')][_0x6676('0x43')]({'where':{'id':_0xd28414['params']['id']}})[_0x6676('0x20')](handleEntityNotFound(_0x5681e5,null))['then'](removeEntity(_0x5681e5,null))['catch'](handleError(_0x5681e5,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4b86f52..50a523d 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 _0x54eb=['fax_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','define','FaxApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54eb,0x1ae));var _0xb54e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x54eb[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xb54e('0x0'));var util=require(_0xb54e('0x1'));var logger=require(_0xb54e('0x2'))(_0xb54e('0x3'));var moment=require(_0xb54e('0x4'));var BPromise=require(_0xb54e('0x5'));var rp=require(_0xb54e('0x6'));var fs=require('fs');var path=require(_0xb54e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x405aa1,_0x5317b7){return _0x405aa1[_0xb54e('0x8')](_0xb54e('0x9'),attributes,{'tableName':_0xb54e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7fd1=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x7fd1,0xf0));var _0x17fd=function(_0x2bbd42,_0x4feea3){_0x2bbd42=_0x2bbd42-0x0;var _0x27ccec=_0x7fd1[_0x2bbd42];return _0x27ccec;};'use strict';var _=require(_0x17fd('0x0'));var util=require('util');var logger=require(_0x17fd('0x1'))(_0x17fd('0x2'));var moment=require(_0x17fd('0x3'));var BPromise=require(_0x17fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17fd('0x5'));var rimraf=require(_0x17fd('0x6'));var config=require(_0x17fd('0x7'));var attributes=require(_0x17fd('0x8'));module[_0x17fd('0x9')]=function(_0x3858b5,_0x1aa55e){return _0x3858b5['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x17fd('0xa'),'collate':_0x17fd('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 48b937e..e8519a7 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 _0x8734=['FaxApplication,\x20%s,\x20%s','message','result','FaxApplication','update','options','raw','attributes','limit','UpdateFaxApplication','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','error','code'];(function(_0x25dfdf,_0x542333){var _0x5220da=function(_0x53accc){while(--_0x53accc){_0x25dfdf['push'](_0x25dfdf['shift']());}};_0x5220da(++_0x542333);}(_0x8734,0x134));var _0x4873=function(_0x1a48f2,_0x5d2109){_0x1a48f2=_0x1a48f2-0x0;var _0x2b46c6=_0x8734[_0x1a48f2];return _0x2b46c6;};'use strict';var _=require(_0x4873('0x0'));var util=require('util');var moment=require(_0x4873('0x1'));var BPromise=require(_0x4873('0x2'));var rs=require(_0x4873('0x3'));var fs=require('fs');var Redis=require(_0x4873('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4873('0x5'));var logger=require('../../config/logger')(_0x4873('0x6'));var config=require(_0x4873('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4873('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ea436,_0x567400,_0x22ed5c){return new BPromise(function(_0x54fdb5,_0x2833e5){return client[_0x4873('0x9')](_0x5ea436,_0x22ed5c)[_0x4873('0xa')](function(_0x41ecd9){logger[_0x4873('0xb')]('FaxApplication,\x20%s,\x20%s',_0x567400,_0x4873('0xc'));logger[_0x4873('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x567400,_0x4873('0xc'),JSON['stringify'](_0x41ecd9));if(_0x41ecd9[_0x4873('0xe')]){if(_0x41ecd9[_0x4873('0xe')][_0x4873('0xf')]===0x1f4){logger['error'](_0x4873('0x10'),_0x567400,_0x41ecd9['error'][_0x4873('0x11')]);return _0x2833e5(_0x41ecd9[_0x4873('0xe')][_0x4873('0x11')]);}logger['error'](_0x4873('0x10'),_0x567400,_0x41ecd9[_0x4873('0xe')][_0x4873('0x11')]);return _0x54fdb5(_0x41ecd9[_0x4873('0xe')]['message']);}else{logger['info'](_0x4873('0x10'),_0x567400,_0x4873('0xc'));_0x54fdb5(_0x41ecd9[_0x4873('0x12')][_0x4873('0x11')]);}})['catch'](function(_0x471eb3){logger[_0x4873('0xe')]('FaxApplication,\x20%s,\x20%s',_0x567400,_0x471eb3);_0x2833e5(_0x471eb3);});});}exports['UpdateFaxApplication']=function(_0x469b41){var _0x4d5801=this;return new Promise(function(_0x3075eb,_0x564c50){return db[_0x4873('0x13')][_0x4873('0x14')](_0x469b41['body'],{'raw':_0x469b41['options']?_0x469b41[_0x4873('0x15')][_0x4873('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469b41['options']?_0x469b41[_0x4873('0x15')]['where']||null:null,'attributes':_0x469b41[_0x4873('0x15')]?_0x469b41[_0x4873('0x15')][_0x4873('0x17')]||null:null,'limit':_0x469b41[_0x4873('0x15')]?_0x469b41['options'][_0x4873('0x18')]||null:null})[_0x4873('0xa')](function(_0x1baee1){logger[_0x4873('0xb')]('UpdateFaxApplication',_0x469b41);logger[_0x4873('0xd')](_0x4873('0x19'),_0x469b41,JSON['stringify'](_0x1baee1));_0x3075eb(_0x1baee1);})[_0x4873('0x1a')](function(_0x4a9cd6){logger[_0x4873('0xe')](_0x4873('0x19'),_0x4a9cd6[_0x4873('0x11')],_0x469b41);_0x564c50(_0x4d5801[_0x4873('0xe')](0x1f4,_0x4a9cd6[_0x4873('0x11')]));});});}; \ No newline at end of file +var _0x4ce1=['stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x48fcdd,_0xd91667){var _0x565f88=function(_0x3f1086){while(--_0x3f1086){_0x48fcdd['push'](_0x48fcdd['shift']());}};_0x565f88(++_0xd91667);}(_0x4ce1,0xba));var _0x14ce=function(_0x270fc6,_0x5e02d7){_0x270fc6=_0x270fc6-0x0;var _0x41c587=_0x4ce1[_0x270fc6];return _0x41c587;};'use strict';var _=require(_0x14ce('0x0'));var util=require(_0x14ce('0x1'));var moment=require(_0x14ce('0x2'));var BPromise=require(_0x14ce('0x3'));var rs=require(_0x14ce('0x4'));var fs=require('fs');var Redis=require(_0x14ce('0x5'));var db=require(_0x14ce('0x6'))['db'];var utils=require(_0x14ce('0x7'));var logger=require(_0x14ce('0x8'))(_0x14ce('0x9'));var config=require('../../config/environment');var jayson=require(_0x14ce('0xa'));var client=jayson[_0x14ce('0xb')][_0x14ce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x539441,_0x257b4c,_0x2f8b11){return new BPromise(function(_0x14f41b,_0x336401){return client[_0x14ce('0xd')](_0x539441,_0x2f8b11)['then'](function(_0x2ae2dc){logger[_0x14ce('0xe')](_0x14ce('0xf'),_0x257b4c,_0x14ce('0x10'));logger[_0x14ce('0x11')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x257b4c,'request\x20sent',JSON[_0x14ce('0x12')](_0x2ae2dc));if(_0x2ae2dc[_0x14ce('0x13')]){if(_0x2ae2dc[_0x14ce('0x13')][_0x14ce('0x14')]===0x1f4){logger['error'](_0x14ce('0xf'),_0x257b4c,_0x2ae2dc[_0x14ce('0x13')][_0x14ce('0x15')]);return _0x336401(_0x2ae2dc[_0x14ce('0x13')][_0x14ce('0x15')]);}logger[_0x14ce('0x13')](_0x14ce('0xf'),_0x257b4c,_0x2ae2dc['error']['message']);return _0x14f41b(_0x2ae2dc[_0x14ce('0x13')][_0x14ce('0x15')]);}else{logger[_0x14ce('0xe')](_0x14ce('0xf'),_0x257b4c,_0x14ce('0x10'));_0x14f41b(_0x2ae2dc[_0x14ce('0x16')]['message']);}})[_0x14ce('0x17')](function(_0x405a01){logger[_0x14ce('0x13')](_0x14ce('0xf'),_0x257b4c,_0x405a01);_0x336401(_0x405a01);});});}exports[_0x14ce('0x18')]=function(_0x1224fa){var _0x15bc50=this;return new Promise(function(_0xfde016,_0xb5bcb1){return db[_0x14ce('0x19')][_0x14ce('0x1a')](_0x1224fa[_0x14ce('0x1b')],{'raw':_0x1224fa[_0x14ce('0x1c')]?_0x1224fa[_0x14ce('0x1c')][_0x14ce('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1224fa['options']?_0x1224fa['options'][_0x14ce('0x1e')]||null:null,'attributes':_0x1224fa[_0x14ce('0x1c')]?_0x1224fa[_0x14ce('0x1c')][_0x14ce('0x1f')]||null:null,'limit':_0x1224fa[_0x14ce('0x1c')]?_0x1224fa[_0x14ce('0x1c')][_0x14ce('0x20')]||null:null})[_0x14ce('0x21')](function(_0x23999e){logger[_0x14ce('0xe')](_0x14ce('0x18'),_0x1224fa);logger[_0x14ce('0x11')]('UpdateFaxApplication',_0x1224fa,JSON[_0x14ce('0x12')](_0x23999e));_0xfde016(_0x23999e);})[_0x14ce('0x17')](function(_0x4e2027){logger[_0x14ce('0x13')]('UpdateFaxApplication',_0x4e2027[_0x14ce('0x15')],_0x1224fa);_0xb5bcb1(_0x15bc50['error'](0x1f4,_0x4e2027[_0x14ce('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index ea444d1..6316914 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 _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x276ff1,_0x8489c0){var _0x5e6000=function(_0xb7fe9d){while(--_0xb7fe9d){_0x276ff1['push'](_0x276ff1['shift']());}};_0x5e6000(++_0x8489c0);}(_0x5c00,0x17e));var _0x05c0=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x5c00[_0x425716];return _0x2d39af;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router; \ No newline at end of file +var _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea28,0x13a));var _0x8ea2=function(_0x215e7c,_0x505764){_0x215e7c=_0x215e7c-0x0;var _0x3b9b81=_0xea28[_0x215e7c];return _0x3b9b81;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('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 2409526..fcc8d73 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 _0xdb33=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0xdb33,0x18c));var _0x3db3=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xdb33[_0x44216d];return _0xeca523;};'use strict';var Sequelize=require(_0x3db3('0x0'));module[_0x3db3('0x1')]={'closed':{'type':Sequelize[_0x3db3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3db3('0x3')]},'disposition':{'type':Sequelize[_0x3db3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3db3('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3db3('0x3')]},'fax':{'type':Sequelize[_0x3db3('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3db3('0x5')]('in',_0x3db3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3db3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3db3('0x5')]('in',_0x3db3('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x86c7=['sequelize','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x32601f,_0x29b933){var _0xc76c37=function(_0x56d365){while(--_0x56d365){_0x32601f['push'](_0x32601f['shift']());}};_0xc76c37(++_0x29b933);}(_0x86c7,0xe0));var _0x786c=function(_0x5bc426,_0x4b1a63){_0x5bc426=_0x5bc426-0x0;var _0x475614=_0x86c7[_0x5bc426];return _0x475614;};'use strict';var Sequelize=require(_0x786c('0x0'));module[_0x786c('0x1')]={'closed':{'type':Sequelize[_0x786c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x786c('0x3')]},'secondDisposition':{'type':Sequelize[_0x786c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x786c('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x786c('0x4')]},'fax':{'type':Sequelize[_0x786c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x786c('0x5')]('in',_0x786c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x786c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x786c('0x5')]('in',_0x786c('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index da65e82..a963550 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 _0xd600=['root','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','./faxInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','Users','fullname','TagIds','push','catch','index','map','FaxInteraction','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','end','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?','body','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','include','options','create','destroy','describe','addMessage','FaxMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','faxInteractionTags:save','removeTags','download','unix','join','tmp'];(function(_0x23fcad,_0x2b4c2e){var _0x3e4d60=function(_0x2a25a9){while(--_0x2a25a9){_0x23fcad['push'](_0x23fcad['shift']());}};_0x3e4d60(++_0x2b4c2e);}(_0xd600,0x1d4));var _0x0d60=function(_0xcd3afd,_0x5c0dbe){_0xcd3afd=_0xcd3afd-0x0;var _0x1ee24b=_0xd600[_0xcd3afd];return _0x1ee24b;};'use strict';var emlformat=require(_0x0d60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d60('0x1'));var jsonpatch=require(_0x0d60('0x2'));var rp=require(_0x0d60('0x3'));var moment=require(_0x0d60('0x4'));var BPromise=require(_0x0d60('0x5'));var Mustache=require(_0x0d60('0x6'));var util=require(_0x0d60('0x7'));var path=require(_0x0d60('0x8'));var sox=require('sox');var csv=require(_0x0d60('0x9'));var ejs=require(_0x0d60('0xa'));var fs=require('fs');var fs_extra=require(_0x0d60('0xb'));var _=require(_0x0d60('0xc'));var squel=require(_0x0d60('0xd'));var crypto=require(_0x0d60('0xe'));var jsforce=require(_0x0d60('0xf'));var deskjs=require(_0x0d60('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d60('0x11'));var Redis=require(_0x0d60('0x12'));var authService=require(_0x0d60('0x13'));var qs=require(_0x0d60('0x14'));var as=require(_0x0d60('0x15'));var hardwareService=require(_0x0d60('0x16'));var logger=require(_0x0d60('0x17'))(_0x0d60('0x18'));var utils=require('../../config/utils');var config=require(_0x0d60('0x19'));var licenseUtil=require(_0x0d60('0x1a'));var db=require(_0x0d60('0x1b'))['db'];config[_0x0d60('0x1c')]=_[_0x0d60('0x1d')](config[_0x0d60('0x1c')],{'host':_0x0d60('0x1e'),'port':0x18eb});var socket=require(_0x0d60('0x1f'))(new Redis(config[_0x0d60('0x1c')]));require(_0x0d60('0x20'))['register'](socket);function respondWithStatusCode(_0x275c3d,_0x264d09){_0x264d09=_0x264d09||0xcc;return function(_0x2e47a0){if(_0x2e47a0){return _0x275c3d[_0x0d60('0x21')](_0x264d09);}return _0x275c3d['status'](_0x264d09)['end']();};}function respondWithResult(_0x5d0796,_0x57704e){_0x57704e=_0x57704e||0xc8;return function(_0x3478d5){if(_0x3478d5){return _0x5d0796[_0x0d60('0x22')](_0x57704e)[_0x0d60('0x23')](_0x3478d5);}};}function respondWithFilteredResult(_0x1b1178,_0x4f79ad){return function(_0x589cae){if(_0x589cae){var _0x12868b=typeof _0x4f79ad[_0x0d60('0x24')]===_0x0d60('0x25')&&typeof _0x4f79ad[_0x0d60('0x26')]==='undefined';var _0x2e5aae=_0x589cae[_0x0d60('0x27')];var _0x40b7b2=_0x12868b?0x0:_0x4f79ad[_0x0d60('0x24')];var _0x5abd01=_0x12868b?_0x589cae[_0x0d60('0x27')]:_0x4f79ad[_0x0d60('0x24')]+_0x4f79ad[_0x0d60('0x26')];var _0x35ed6f;if(_0x5abd01>=_0x2e5aae){_0x5abd01=_0x2e5aae;_0x35ed6f=0xc8;}else{_0x35ed6f=0xce;}_0x1b1178['status'](_0x35ed6f);return _0x1b1178[_0x0d60('0x28')](_0x0d60('0x29'),_0x40b7b2+'-'+_0x5abd01+'/'+_0x2e5aae)[_0x0d60('0x23')](_0x589cae);}return null;};}function patchUpdates(_0x35967d){return function(_0x39a4ba){try{jsonpatch[_0x0d60('0x2a')](_0x39a4ba,_0x35967d,!![]);}catch(_0x58ce5d){return BPromise[_0x0d60('0x2b')](_0x58ce5d);}return _0x39a4ba['save']();};}function saveUpdates(_0x36c3b5,_0x3414d3){return function(_0x18af63){if(_0x18af63){return _0x18af63[_0x0d60('0x2c')](_0x36c3b5)[_0x0d60('0x2d')](function(_0x572df3){return _0x572df3;});}return null;};}function removeEntity(_0x3c9c69,_0x408574){return function(_0x3dc7ed){if(_0x3dc7ed){return _0x3dc7ed['destroy']()['then'](function(){_0x3c9c69[_0x0d60('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a22d,_0x2f8e0d){return function(_0x2f69d0){if(!_0x2f69d0){_0x31a22d[_0x0d60('0x21')](0x194);}return _0x2f69d0;};}function handleError(_0x18f601,_0x415b5d){_0x415b5d=_0x415b5d||0x1f4;return function(_0x41f4ad){logger[_0x0d60('0x2e')](_0x41f4ad['stack']);if(_0x41f4ad[_0x0d60('0x2f')]){delete _0x41f4ad[_0x0d60('0x2f')];}_0x18f601[_0x0d60('0x22')](_0x415b5d)[_0x0d60('0x30')](_0x41f4ad);};}function getInteractionUsers(_0x297604,_0x7c0e72){return new BPromise(function(_0x3b3529,_0x229766){try{if(_0x7c0e72[_0x297604['id']]){_0x297604[_0x0d60('0x31')]=_['map'](_0x7c0e72[_0x297604['id']],function(_0x836cc9){return{'id':_0x836cc9['id'],'fullname':_0x836cc9[_0x0d60('0x32')]};});}}catch(_0x390848){_0x229766(_0x390848);}_0x3b3529(_0x297604);});}function getInteractionTags(_0xc6648e,_0x55aee1){return new BPromise(function(_0xd4cc92,_0x34c893){try{if(_0xc6648e[_0x0d60('0x33')]){_0xc6648e['Tags']=[];_0xc6648e[_0x0d60('0x33')]['split'](',')['forEach'](function(_0x5ba72c){_0xc6648e['Tags'][_0x0d60('0x34')](_0x55aee1[_0x5ba72c]);});}delete _0xc6648e[_0x0d60('0x33')];}catch(_0x32021c){_0x34c893(_0x32021c);}_0xd4cc92(_0xc6648e);});}function updateFaxInteraction(_0x145638,_0x2216d8,_0xd7ead){return new BPromise(function(_0x870d18,_0x18a368){return getInteractionUsers(_0x145638,_0xd7ead)[_0x0d60('0x2d')](function(_0x54e48e){return getInteractionTags(_0x54e48e,_0x2216d8);})['then'](function(_0x4926fb){_0x870d18(_0x4926fb);})[_0x0d60('0x35')](function(_0x2243c5){_0x18a368(_0x2243c5);});});}exports[_0x0d60('0x36')]=function(_0x222f70,_0x5f1a7){var _0x325d0d={},_0x17dbe9={},_0x4094e5={'count':0x0,'rows':[]};var _0xd8a24a=_[_0x0d60('0x37')](db[_0x0d60('0x38')][_0x0d60('0x39')],function(_0x3abb12){return{'name':_0x3abb12[_0x0d60('0x3a')],'type':_0x3abb12['type'][_0x0d60('0x3b')]};});_0x17dbe9['model']=_[_0x0d60('0x37')](_0xd8a24a,_0x0d60('0x2f'));_0x17dbe9[_0x0d60('0x3c')]=_[_0x0d60('0x3d')](_0x222f70[_0x0d60('0x3c')]);_0x17dbe9['filters']=_[_0x0d60('0x3e')](_0x17dbe9[_0x0d60('0x3f')],_0x17dbe9[_0x0d60('0x3c')]);_0x325d0d[_0x0d60('0x40')]=_[_0x0d60('0x3e')](_0x17dbe9[_0x0d60('0x3f')],qs[_0x0d60('0x41')](_0x222f70['query'][_0x0d60('0x41')]));_0x325d0d['attributes']=_0x325d0d[_0x0d60('0x40')][_0x0d60('0x42')]?_0x325d0d[_0x0d60('0x40')]:_0x17dbe9[_0x0d60('0x3f')];if(!_0x222f70['query'][_0x0d60('0x43')](_0x0d60('0x44'))){_0x325d0d[_0x0d60('0x26')]=qs['limit'](_0x222f70['query'][_0x0d60('0x26')]);_0x325d0d[_0x0d60('0x24')]=qs[_0x0d60('0x24')](_0x222f70['query']['offset']);}_0x325d0d[_0x0d60('0x45')]=qs[_0x0d60('0x46')](_0x222f70[_0x0d60('0x3c')]['sort']);_0x325d0d['where']=qs[_0x0d60('0x47')](_['pick'](_0x222f70['query'],_0x17dbe9[_0x0d60('0x47')]),_0xd8a24a);var _0x1d938b=[];var _0x594f2a=squel[_0x0d60('0x48')]()['field']('id')[_0x0d60('0x49')]('name')[_0x0d60('0x49')](_0x0d60('0x4a'))[_0x0d60('0x4b')](_0x0d60('0x4c'));var _0x429318=squel[_0x0d60('0x48')]()['field'](_0x0d60('0x4d'))[_0x0d60('0x49')](_0x0d60('0x4e'))[_0x0d60('0x49')]('ui.FaxInteractionId')[_0x0d60('0x4b')](_0x0d60('0x4f'),'ui')[_0x0d60('0x50')](_0x0d60('0x51'),'u',_0x0d60('0x52'));var _0x16c733=squel['select']()[_0x0d60('0x4b')](_0x0d60('0x53'),'i')[_0x0d60('0x50')]('cm_contacts','c',_0x0d60('0x54'))[_0x0d60('0x50')]('users','o','o.id\x20=\x20i.UserId')[_0x0d60('0x50')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0x0d60('0x50')](_0x0d60('0x55'),'me',_0x0d60('0x56'))[_0x0d60('0x50')](_0x0d60('0x57'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x0d60('0x50')]('tools_tags','t',_0x0d60('0x58'));var _0x38651b=squel[_0x0d60('0x59')]();var _0x2d14c8=[];var _0x475f5e=squel[_0x0d60('0x59')]();var _0x4ba778;if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x5a')]){_0x4ba778=as[_0x0d60('0x5b')](_0x222f70[_0x0d60('0x3c')]['search']);var _0x552e45=_0x4ba778[_0x0d60('0x5c')];for(var _0x46e860=0x0;_0x46e860<_0x4ba778[_0x0d60('0x5d')]['length'];_0x46e860++){var _0x58c6f7=_0x4ba778['conditions'][_0x46e860];var _0x177f77='i';var _0x3da343=_[_0x0d60('0x5e')](_0xd8a24a,[_0x0d60('0x2f'),_0x58c6f7[_0x0d60('0x49')]]);if(!_0x3da343){switch(_0x58c6f7['field']){case _0x0d60('0x5f'):if(_0x58c6f7[_0x0d60('0x60')]==0x1){_0x16c733['having']('`'+_0x58c6f7[_0x0d60('0x49')]+_0x0d60('0x61'));}else{_0x16c733[_0x0d60('0x62')]('`'+_0x58c6f7['field']+_0x0d60('0x63'));}break;case _0x0d60('0x64'):if(_0x58c6f7[_0x0d60('0x65')]===_0x0d60('0x66')){if(_0x58c6f7['value'][_0x0d60('0x67')]('\x20')[_0x0d60('0x42')]>0x1){_0x38651b[_0x552e45](_0x0d60('0x68'),qs[_0x0d60('0x69')](_0x58c6f7[_0x0d60('0x60')]),null);}else{var _0x543f15='%'+_0x58c6f7[_0x0d60('0x60')]+'%';_0x38651b[_0x552e45](_0x0d60('0x6a'),_0x543f15,_0x543f15,_0x543f15);}}else{_0x3da343=_[_0x0d60('0x5e')](_0xd8a24a,['name',_0x0d60('0x6b')]);_0x58c6f7['field']=_0x0d60('0x6b');_0x2c6872=as[_0x0d60('0x6c')](_0x177f77,_0x3da343[_0x0d60('0x6d')],_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872[_0x0d60('0x6e')],_0x2c6872[_0x0d60('0x60')][_0x0d60('0x6f')],_0x2c6872['value'][_0x0d60('0x70')]);}break;case _0x0d60('0x71'):var _0x164da7=_0x58c6f7[_0x0d60('0x60')]['split'](',')[_0x0d60('0x37')](function(_0x58531d){return Number(_0x58531d);});_0x164da7[_0x0d60('0x72')](function(_0x13a1ac){_0x475f5e['or'](_0x0d60('0x73'),'%,'+_0x13a1ac+',%');});_0x2d14c8=_[_0x0d60('0x74')](_0x2d14c8,_0x164da7);break;case _0x0d60('0x75'):if(_0x58c6f7['operator']==='$substring'){_0x38651b[_0x552e45](_0x0d60('0x76'),'%'+_0x58c6f7[_0x0d60('0x60')]+'%',null);}else{_0x3da343=_['find'](_0xd8a24a,['name','UserId']);_0x58c6f7[_0x0d60('0x49')]='UserId';_0x2c6872=as['buildExpression'](_0x177f77,_0x3da343['type'],_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872['text'],_0x2c6872[_0x0d60('0x60')][_0x0d60('0x6f')],_0x2c6872[_0x0d60('0x60')][_0x0d60('0x70')]);}break;case _0x0d60('0x77'):_0x2c6872=as[_0x0d60('0x6c')]('me',null,_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872[_0x0d60('0x6e')],_0x2c6872['value'][_0x0d60('0x6f')],_0x2c6872[_0x0d60('0x60')]['end']);break;}}else{var _0x2c6872=as[_0x0d60('0x6c')](_0x177f77,_0x3da343[_0x0d60('0x6d')],_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872[_0x0d60('0x6e')],_0x2c6872['value']['start'],_0x2c6872['value'][_0x0d60('0x70')]);}}}else{var _0x4420b7=_(_0x222f70[_0x0d60('0x3c')])[_0x0d60('0x3d')]()[_0x0d60('0x37')](function(_0x103799){return _['some'](_0xd8a24a,[_0x0d60('0x2f'),_0x103799])?_0x103799:undefined;})['compact']()[_0x0d60('0x60')]();if(!_[_0x0d60('0x78')](_0x4420b7)){_0x4420b7[_0x0d60('0x72')](function(_0x32dcfd){if(_0x32dcfd===_0x0d60('0x79')){_0x16c733[_0x0d60('0x7a')](_0x0d60('0x7b'),[][_0x0d60('0x7c')](_0x222f70[_0x0d60('0x3c')][_0x32dcfd]));}else if(_0x32dcfd==='createdAt'){var _0x39dc4c=JSON[_0x0d60('0x7d')](_0x222f70[_0x0d60('0x3c')][_0x32dcfd])[_0x0d60('0x7e')];var _0x4ece64=JSON[_0x0d60('0x7d')](_0x222f70['query'][_0x32dcfd])[_0x0d60('0x7f')];_0x16c733[_0x0d60('0x7a')](_0x0d60('0x80'),_0x39dc4c,_0x4ece64);}else{if(_0x222f70[_0x0d60('0x3c')][_0x32dcfd]===_0x0d60('0x81')){_0x16c733[_0x0d60('0x7a')]('i.'+_0x32dcfd+_0x0d60('0x82'));}else{_0x16c733[_0x0d60('0x7a')]('i.'+_0x32dcfd+_0x0d60('0x83'),_0x222f70[_0x0d60('0x3c')][_0x32dcfd]);}}});}if(_0x222f70['query'][_0x0d60('0x84')]){if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x84')]==0x1){_0x16c733['having'](_0x0d60('0x85'));}else{_0x16c733[_0x0d60('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x222f70[_0x0d60('0x3c')]['tag']){_0x2d14c8=_[_0x0d60('0x86')](_0x222f70[_0x0d60('0x3c')][_0x0d60('0x87')])?_0x222f70[_0x0d60('0x3c')][_0x0d60('0x87')]:new Array(_0x222f70[_0x0d60('0x3c')]['tag']);_0x2d14c8[_0x0d60('0x72')](function(_0x48b657){_0x475f5e['or'](_0x0d60('0x73'),'%,'+_0x48b657+',%');});}if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x88')]){var _0x228249=_0x222f70[_0x0d60('0x3c')][_0x0d60('0x88')][_0x0d60('0x89')]('\x5c','\x5c\x5c')[_0x0d60('0x89')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x228249)){_0x38651b['or'](_0x0d60('0x8a'),_0x228249+'%')['or'](_0x0d60('0x8b'),_0x228249+'%');}_0x38651b['or'](_0x0d60('0x8c'),_0x228249+'%');}}_0x16c733[_0x0d60('0x7a')](_0x38651b);_0x16c733[_0x0d60('0x8d')](_0x0d60('0x8e'));var _0xf7c98f={'type':db[_0x0d60('0x8f')][_0x0d60('0x90')][_0x0d60('0x91')],'raw':!![]};var _0x39a51c=_0x16c733[_0x0d60('0x92')]();_0x39a51c[_0x0d60('0x49')]('i.id');_0x39a51c['field'](_0x0d60('0x93'),_0x0d60('0x5f'));if(_0x325d0d['order']){_0x325d0d[_0x0d60('0x45')][_0x0d60('0x72')](function(_0x30458f){var _0x2baa4d=_0x30458f[0x0]===_0x0d60('0x94')?_0x30458f[0x0]:'i.'+_0x30458f[0x0];_0x16c733[_0x0d60('0x45')](_0x2baa4d,_0x30458f[0x1]===_0x0d60('0x95')?![]:!![]);});}if(!_[_0x0d60('0x78')](_0x2d14c8)){_0x16c733[_0x0d60('0x62')](_0x475f5e);_0x39a51c[_0x0d60('0x7a')](_0x0d60('0x96'),_0x2d14c8);}BPromise[_0x0d60('0x97')]()[_0x0d60('0x2d')](function(){if(!_0x4ba778){if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x79')])return;_0x39a51c[_0x0d60('0x7a')](_0x0d60('0x98'));_0x16c733[_0x0d60('0x7a')](_0x0d60('0x98'));return;}if(_0x222f70[_0x0d60('0x99')]['role']!==_0x0d60('0x9a'))return;return _0x222f70[_0x0d60('0x99')][_0x0d60('0x9b')]({'attributes':['id'],'raw':!![]})[_0x0d60('0x2d')](function(_0x52e5a1){if(_[_0x0d60('0x78')](_0x52e5a1)){_0x39a51c[_0x0d60('0x7a')](_0x0d60('0x9c'));_0x16c733[_0x0d60('0x7a')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x39a51c['where'](_0x0d60('0x7b'),_['map'](_0x52e5a1,'id'));_0x16c733['where'](_0x0d60('0x7b'),_['map'](_0x52e5a1,'id'));}});})[_0x0d60('0x2d')](function(){if(_0x222f70['user'][_0x0d60('0x9d')]===_0x0d60('0x9a')&&!_0x4ba778&&!_0x222f70['query'][_0x0d60('0x79')])return[];return db[_0x0d60('0x9e')][_0x0d60('0x3c')](_0x39a51c[_0x0d60('0x9f')](),_0xf7c98f);})[_0x0d60('0x2d')](function(_0x50c9a5){_0x4094e5[_0x0d60('0x27')]=_0x50c9a5[_0x0d60('0x42')];if(_0x4094e5[_0x0d60('0x27')]===0x0)return[];return db[_0x0d60('0x9e')]['query'](_0x594f2a[_0x0d60('0x9f')](),_0xf7c98f)[_0x0d60('0x2d')](function(_0x1a012d){_0x1d938b=_[_0x0d60('0xa0')](_0x1a012d,'id');_0xf7c98f=_[_0x0d60('0xa1')](_0xf7c98f,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x41')]){_0x325d0d[_0x0d60('0x40')][_0x0d60('0x72')](function(_0x59baf4){_0x16c733[_0x0d60('0x49')]('i.'+_0x59baf4);});}else{_0x16c733[_0x0d60('0x49')](_0x0d60('0x93'),_0x0d60('0x5f'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xa2'),_0x0d60('0xa3'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xa4'),_0x0d60('0xa5'));_0x16c733['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x0d60('0x94'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xa6'));_0x16c733['field'](_0x0d60('0xa7'),_0x0d60('0xa8'));_0x16c733[_0x0d60('0x49')]('c.lastName',_0x0d60('0xa9'));_0x16c733['field'](_0x0d60('0xaa'),_0x0d60('0xab'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xac'),_0x0d60('0xad'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xae'),_0x0d60('0xaf'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xb0'),_0x0d60('0xb1'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xb2'),_0x0d60('0xb3'));_0x16c733[_0x0d60('0x49')]('o.internal','Owner.internal');_0x16c733[_0x0d60('0x49')](_0x0d60('0xb4'),'TagIds');}if(_0x325d0d['limit'])_0x16c733[_0x0d60('0x26')](_0x325d0d[_0x0d60('0x26')]);if(_0x325d0d[_0x0d60('0x24')])_0x16c733[_0x0d60('0x24')](_0x325d0d[_0x0d60('0x24')]);return db[_0x0d60('0x9e')][_0x0d60('0x3c')](_0x16c733['toString'](),_0xf7c98f);})[_0x0d60('0x2d')](function(_0x557fb1){if(_0x557fb1[_0x0d60('0x42')]>0x0)_0x429318[_0x0d60('0x7a')](_0x0d60('0xb5'),_[_0x0d60('0x37')](_0x557fb1,'id'));return db[_0x0d60('0x9e')][_0x0d60('0x3c')](_0x429318[_0x0d60('0x9f')](),_0xf7c98f)['then'](function(_0x4bc648){var _0x341465=_[_0x0d60('0xb6')](_0x4bc648,_0x0d60('0xb7'));var _0x52084e=[];_0x557fb1[_0x0d60('0x72')](function(_0x1aaa65){_0x52084e[_0x0d60('0x34')](updateFaxInteraction(_0x1aaa65,_0x1d938b,_0x341465));});return BPromise[_0x0d60('0xb8')](_0x52084e);});});})['then'](function(_0x36efbd){_0x4094e5[_0x0d60('0xb9')]=_0x36efbd;return _0x4094e5;})[_0x0d60('0x2d')](respondWithFilteredResult(_0x5f1a7,_0x325d0d))[_0x0d60('0x35')](handleError(_0x5f1a7,null));};exports[_0x0d60('0xba')]=function(_0x2a2230,_0x35f617){var _0x5cead9={'raw':![],'where':{'id':_0x2a2230[_0x0d60('0xbb')]['id']}},_0x547652={};_0x547652[_0x0d60('0x3f')]=_['keys'](db[_0x0d60('0x38')]['rawAttributes']);_0x547652[_0x0d60('0x3c')]=_[_0x0d60('0x3d')](_0x2a2230[_0x0d60('0x3c')]);_0x547652[_0x0d60('0x47')]=_[_0x0d60('0x3e')](_0x547652[_0x0d60('0x3f')],_0x547652[_0x0d60('0x3c')]);_0x5cead9[_0x0d60('0x40')]=_[_0x0d60('0x3e')](_0x547652[_0x0d60('0x3f')],qs[_0x0d60('0x41')](_0x2a2230[_0x0d60('0x3c')][_0x0d60('0x41')]));_0x5cead9[_0x0d60('0x40')]=_0x5cead9[_0x0d60('0x40')][_0x0d60('0x42')]?_0x5cead9['attributes']:_0x547652[_0x0d60('0x3f')];if(_0x2a2230[_0x0d60('0x3c')]['includeAll']){_0x5cead9[_0x0d60('0xbc')]=[{'all':!![]}];}_0x5cead9=_[_0x0d60('0xa1')]({},_0x5cead9,_0x2a2230[_0x0d60('0xbd')]);return db['FaxInteraction'][_0x0d60('0x5e')](_0x5cead9)['then'](handleEntityNotFound(_0x35f617,null))[_0x0d60('0x2d')](respondWithResult(_0x35f617,null))[_0x0d60('0x35')](handleError(_0x35f617,null));};exports[_0x0d60('0xbe')]=function(_0x3eacab,_0x1d2900){return db[_0x0d60('0x38')][_0x0d60('0xbe')](_0x3eacab[_0x0d60('0x77')],{})[_0x0d60('0x2d')](respondWithResult(_0x1d2900,0xc9))[_0x0d60('0x35')](handleError(_0x1d2900,null));};exports['update']=function(_0x459d07,_0x40ca07){if(_0x459d07['body']['id']){delete _0x459d07[_0x0d60('0x77')]['id'];}return db[_0x0d60('0x38')]['find']({'where':{'id':_0x459d07['params']['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x40ca07,null))[_0x0d60('0x2d')](saveUpdates(_0x459d07[_0x0d60('0x77')],null))[_0x0d60('0x2d')](respondWithResult(_0x40ca07,null))['catch'](handleError(_0x40ca07,null));};exports[_0x0d60('0xbf')]=function(_0x8be095,_0x2ae682){return db['FaxInteraction']['find']({'where':{'id':_0x8be095['params']['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x2ae682,null))[_0x0d60('0x2d')](removeEntity(_0x2ae682,null))[_0x0d60('0x35')](handleError(_0x2ae682,null));};exports['describe']=function(_0x46d1d4,_0x5e8fc3){return db[_0x0d60('0x38')][_0x0d60('0xc0')]()['then'](respondWithResult(_0x5e8fc3,null))['catch'](handleError(_0x5e8fc3,null));};exports[_0x0d60('0xc1')]=function(_0x6393f0,_0x28f946,_0x41af3b){return db[_0x0d60('0xc2')][_0x0d60('0x5e')]({'where':{'id':_0x6393f0[_0x0d60('0xbb')]['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x28f946,null))[_0x0d60('0x2d')](function(_0x581d36){if(_0x581d36){return _0x581d36['addMessage'](_0x6393f0['body'][_0x0d60('0xc3')],_[_0x0d60('0xc4')](_0x6393f0[_0x0d60('0x77')],[_0x0d60('0xc3'),'id'])||{});}})[_0x0d60('0x2d')](respondWithResult(_0x28f946,null))[_0x0d60('0x35')](handleError(_0x28f946,null));};exports['getMessages']=function(_0x3b0b81,_0x11f7e2,_0x41a07d){var _0x3d3b5e={'raw':![],'where':{}};var _0x4f75f3={};var _0x71b36c={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x3b0b81['params']['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x11f7e2,null))['then'](function(_0x57850b){if(_0x57850b){_0x4f75f3['model']=_[_0x0d60('0x3d')](db[_0x0d60('0xc2')][_0x0d60('0x39')]);_0x4f75f3[_0x0d60('0x3c')]=_[_0x0d60('0x3d')](_0x3b0b81[_0x0d60('0x3c')]);_0x4f75f3[_0x0d60('0x47')]=_['intersection'](_0x4f75f3[_0x0d60('0x3f')],_0x4f75f3['query']);_0x3d3b5e[_0x0d60('0x40')]=_[_0x0d60('0x3e')](_0x4f75f3[_0x0d60('0x3f')],qs[_0x0d60('0x41')](_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x41')]));_0x3d3b5e[_0x0d60('0x40')]=_0x3d3b5e['attributes'][_0x0d60('0x42')]?_0x3d3b5e[_0x0d60('0x40')]:_0x4f75f3[_0x0d60('0x3f')];if(!_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x43')](_0x0d60('0x44'))){_0x3d3b5e[_0x0d60('0x26')]=qs['limit'](_0x3b0b81[_0x0d60('0x3c')]['limit']);_0x3d3b5e[_0x0d60('0x24')]=qs[_0x0d60('0x24')](_0x3b0b81['query'][_0x0d60('0x24')]);}_0x3d3b5e[_0x0d60('0x45')]=qs[_0x0d60('0x46')](_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x46')]);_0x3d3b5e[_0x0d60('0x7a')]=qs[_0x0d60('0x47')](_['pick'](_0x3b0b81[_0x0d60('0x3c')],_0x4f75f3[_0x0d60('0x47')]));_0x3d3b5e[_0x0d60('0x7a')][_0x0d60('0xb7')]=_0x57850b['id'];if(_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x88')]){_0x3d3b5e[_0x0d60('0x7a')]=_[_0x0d60('0xa1')](_0x3d3b5e['where'],{'$or':_[_0x0d60('0x37')](_0x3d3b5e['attributes'],function(_0xcfae0e){var _0xf7ecf0={};_0xf7ecf0[_0xcfae0e]={'$like':'%'+_0x3b0b81['query'][_0x0d60('0x88')]+'%'};return _0xf7ecf0;})});}if(_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x7e')]){var _0x20beaf=_0x3b0b81['query']['$gte']['split'](',');var _0x556474={};_0x556474[_0x20beaf[0x0]]={'$gte':moment(_0x20beaf[0x1])['format'](_0x0d60('0xc5'))};_0x3d3b5e[_0x0d60('0x7a')]=_['merge'](_0x3d3b5e['where'],_0x556474);}_0x3d3b5e=_[_0x0d60('0xa1')]({},_0x3d3b5e,_0x3b0b81[_0x0d60('0xbd')]);return db['FaxMessage'][_0x0d60('0x27')]({'where':_0x3d3b5e['where']})[_0x0d60('0x2d')](function(_0x2ff4fa){_0x71b36c['count']=_0x2ff4fa;if(_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0xc6')]){_0x3d3b5e[_0x0d60('0xbc')]=[{'all':!![]}];}return db[_0x0d60('0xc2')][_0x0d60('0xc7')](_0x3d3b5e);})['then'](function(_0x22e222){_0x71b36c[_0x0d60('0xb9')]=_0x22e222;return _0x71b36c;});}})[_0x0d60('0x2d')](respondWithFilteredResult(_0x11f7e2,_0x3d3b5e))[_0x0d60('0x35')](handleError(_0x11f7e2,null));};exports[_0x0d60('0xc8')]=function(_0x3fb267,_0x40ce5e,_0x18a73e){return db[_0x0d60('0x38')]['find']({'where':{'id':_0x3fb267[_0x0d60('0xbb')]['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x40ce5e,null))[_0x0d60('0x2d')](function(_0x16f50d){if(_0x16f50d){return _0x16f50d['setTags'](_0x3fb267[_0x0d60('0x77')]['ids'],_[_0x0d60('0xc4')](_0x3fb267[_0x0d60('0x77')],[_0x0d60('0xc3'),'id'])||{})['spread'](function(){return db[_0x0d60('0x71')][_0x0d60('0xc7')]({'attributes':['id','name','color'],'where':{'id':_0x3fb267['body'][_0x0d60('0xc3')]}});})[_0x0d60('0x2d')](function(_0x990263){socket['emit'](_0x0d60('0xc9'),{'id':Number(_0x3fb267['params']['id']),'tags':_0x990263||[]});return{'id':Number(_0x3fb267[_0x0d60('0xbb')]['id']),'tags':_0x990263||[]};});}})['then'](respondWithResult(_0x40ce5e,null))[_0x0d60('0x35')](handleError(_0x40ce5e,null));};exports[_0x0d60('0xca')]=function(_0x52803d,_0x33e3f3,_0x1243f0){return db[_0x0d60('0x38')][_0x0d60('0x5e')]({'where':{'id':_0x52803d[_0x0d60('0xbb')]['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x33e3f3,null))[_0x0d60('0x2d')](function(_0x4eca12){if(_0x4eca12){return _0x4eca12[_0x0d60('0xca')](_0x52803d[_0x0d60('0x3c')][_0x0d60('0xc3')]);}})[_0x0d60('0x2d')](respondWithStatusCode(_0x33e3f3,null))[_0x0d60('0x35')](handleError(_0x33e3f3,null));};exports[_0x0d60('0xcb')]=function(_0xb02f82,_0x25be7a){var _0x268a06=moment()[_0x0d60('0xcc')]()[_0x0d60('0x9f')]();var _0x4c60aa=path[_0x0d60('0xcd')](config['root'],'server','files',_0x0d60('0xce'));var _0x4af265=path[_0x0d60('0xcd')](config[_0x0d60('0xcf')],_0x0d60('0xd0'),_0x0d60('0xd1'),_0x0d60('0xd2'));var _0x37d3c1=path[_0x0d60('0xcd')](_0x4c60aa,_0x268a06);var _0x333095=util[_0x0d60('0xd3')](_0x0d60('0xd4'),_0xb02f82['params']['id'],_0x268a06);var _0x396e86=path[_0x0d60('0xcd')](_0x4c60aa,_0x333095);var _0x3fbb3c=[];_0x3fbb3c[_0x0d60('0x34')]({'model':db[_0x0d60('0xd5')],'as':_0x0d60('0xd5'),'raw':!![]});var _0x518012=[{'model':db[_0x0d60('0xc2')],'as':_0x0d60('0xd6'),'attributes':['id','body',_0x0d60('0xd7')],'include':_0x3fbb3c}];return db[_0x0d60('0x38')][_0x0d60('0x5e')]({'where':{'id':_0xb02f82[_0x0d60('0xbb')]['id']},'include':_0x518012})[_0x0d60('0x2d')](handleEntityNotFound(_0x25be7a,null))[_0x0d60('0x2d')](function(_0x4b2601){if(_0x4b2601&&_0x4b2601[_0x0d60('0xd6')]){var _0x45b0c1=_0x4b2601[_0x0d60('0xd8')]({'plain':!![]});fs[_0x0d60('0xd9')](_0x37d3c1);for(var _0x30b007=0x0;_0x30b007<_0x45b0c1['Messages'][_0x0d60('0x42')];_0x30b007++){var _0x174841=_0x45b0c1[_0x0d60('0xd6')][_0x30b007][_0x0d60('0xd5')];if(_0x174841){var _0x144e54=path[_0x0d60('0xcd')](_0x4af265,_0x174841['basename']);if(fs[_0x0d60('0xda')](_0x144e54)){fs[_0x0d60('0xdb')](_0x144e54)[_0x0d60('0xdc')](fs[_0x0d60('0xdd')](path[_0x0d60('0xcd')](_0x37d3c1,_0x174841[_0x0d60('0xde')])));}}}return BPromise[_0x0d60('0x97')]()[_0x0d60('0x2d')](function(){return new BPromise(function(_0x287128,_0x4c792f){zipdir(_0x37d3c1,{'saveTo':_0x396e86},function(_0x1abafd,_0x12ae45){if(_0x1abafd)return _0x4c792f(_0x1abafd);return _0x287128(_0x12ae45);});})[_0x0d60('0x2d')](function(){return new BPromise(function(_0x11cb28,_0x5e2cbd){rimraf(_0x37d3c1,function(_0x1d6906){if(_0x1d6906)_0x5e2cbd(_0x1d6906);return _0x11cb28();});});})[_0x0d60('0x2d')](function(){return _0x25be7a[_0x0d60('0xcb')](_0x396e86,_0x333095,function(_0x36fdaa){if(_0x36fdaa){console[_0x0d60('0xdf')]('err',_0x36fdaa);}else{fs[_0x0d60('0xe0')](_0x396e86);}});});});}else{return _0x25be7a['sendStatus'](0xc8);}})[_0x0d60('0x35')](handleError(_0x25be7a,null));}; \ No newline at end of file +var _0xbedc=['a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','includeAll','create','describe','addMessage','ids','omit','findOne','FaxMessage','$gte','format','include','addTags','setTags','spread','color','faxInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','createReadStream','pipe','basename','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','Users','TagIds','Tags','split','forEach','push','catch','index','map','FaxInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','pick','select','field','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','u.id\x20=\x20ui.UserId','fax_interactions','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','left_join','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','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','type','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?','find','UserId','buildExpression','start','body','some','compact','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','agent','user','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy'];(function(_0x35ceca,_0x47c728){var _0x1971cd=function(_0x2743e6){while(--_0x2743e6){_0x35ceca['push'](_0x35ceca['shift']());}};_0x1971cd(++_0x47c728);}(_0xbedc,0x1ea));var _0xcbed=function(_0x4acb29,_0x457d12){_0x4acb29=_0x4acb29-0x0;var _0x480a52=_0xbedc[_0x4acb29];return _0x480a52;};'use strict';var emlformat=require(_0xcbed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcbed('0x1'));var jsonpatch=require(_0xcbed('0x2'));var rp=require(_0xcbed('0x3'));var moment=require(_0xcbed('0x4'));var BPromise=require(_0xcbed('0x5'));var Mustache=require('mustache');var util=require(_0xcbed('0x6'));var path=require(_0xcbed('0x7'));var sox=require(_0xcbed('0x8'));var csv=require(_0xcbed('0x9'));var ejs=require(_0xcbed('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbed('0xb'));var squel=require(_0xcbed('0xc'));var crypto=require(_0xcbed('0xd'));var jsforce=require(_0xcbed('0xe'));var deskjs=require(_0xcbed('0xf'));var toCsv=require(_0xcbed('0x9'));var querystring=require(_0xcbed('0x10'));var Papa=require(_0xcbed('0x11'));var Redis=require(_0xcbed('0x12'));var authService=require(_0xcbed('0x13'));var qs=require(_0xcbed('0x14'));var as=require(_0xcbed('0x15'));var hardwareService=require(_0xcbed('0x16'));var logger=require(_0xcbed('0x17'))(_0xcbed('0x18'));var utils=require(_0xcbed('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcbed('0x1a'))['db'];config[_0xcbed('0x1b')]=_[_0xcbed('0x1c')](config[_0xcbed('0x1b')],{'host':_0xcbed('0x1d'),'port':0x18eb});var socket=require(_0xcbed('0x1e'))(new Redis(config[_0xcbed('0x1b')]));require(_0xcbed('0x1f'))[_0xcbed('0x20')](socket);function respondWithStatusCode(_0x10c1c2,_0x171896){_0x171896=_0x171896||0xcc;return function(_0x1d8c44){if(_0x1d8c44){return _0x10c1c2[_0xcbed('0x21')](_0x171896);}return _0x10c1c2['status'](_0x171896)[_0xcbed('0x22')]();};}function respondWithResult(_0x53b197,_0x506c0e){_0x506c0e=_0x506c0e||0xc8;return function(_0x2ecb19){if(_0x2ecb19){return _0x53b197[_0xcbed('0x23')](_0x506c0e)['json'](_0x2ecb19);}};}function respondWithFilteredResult(_0x2c6c8a,_0x1d5a2d){return function(_0x16478e){if(_0x16478e){var _0x466fb6=typeof _0x1d5a2d[_0xcbed('0x24')]===_0xcbed('0x25')&&typeof _0x1d5a2d['limit']===_0xcbed('0x25');var _0x1f3ff2=_0x16478e[_0xcbed('0x26')];var _0x236744=_0x466fb6?0x0:_0x1d5a2d[_0xcbed('0x24')];var _0xc6703c=_0x466fb6?_0x16478e['count']:_0x1d5a2d['offset']+_0x1d5a2d[_0xcbed('0x27')];var _0x3962eb;if(_0xc6703c>=_0x1f3ff2){_0xc6703c=_0x1f3ff2;_0x3962eb=0xc8;}else{_0x3962eb=0xce;}_0x2c6c8a['status'](_0x3962eb);return _0x2c6c8a[_0xcbed('0x28')](_0xcbed('0x29'),_0x236744+'-'+_0xc6703c+'/'+_0x1f3ff2)[_0xcbed('0x2a')](_0x16478e);}return null;};}function patchUpdates(_0x13cd11){return function(_0x3a9389){try{jsonpatch[_0xcbed('0x2b')](_0x3a9389,_0x13cd11,!![]);}catch(_0x4aaf1f){return BPromise[_0xcbed('0x2c')](_0x4aaf1f);}return _0x3a9389[_0xcbed('0x2d')]();};}function saveUpdates(_0x296e93,_0x59022d){return function(_0x2df254){if(_0x2df254){return _0x2df254[_0xcbed('0x2e')](_0x296e93)[_0xcbed('0x2f')](function(_0x483171){return _0x483171;});}return null;};}function removeEntity(_0x6bd5ca,_0x1e988a){return function(_0x50f8b3){if(_0x50f8b3){return _0x50f8b3[_0xcbed('0x30')]()[_0xcbed('0x2f')](function(){_0x6bd5ca[_0xcbed('0x23')](0xcc)[_0xcbed('0x22')]();});}};}function handleEntityNotFound(_0xd096b3,_0x12d48c){return function(_0x567126){if(!_0x567126){_0xd096b3[_0xcbed('0x21')](0x194);}return _0x567126;};}function handleError(_0x3e6ca9,_0x20f6f0){_0x20f6f0=_0x20f6f0||0x1f4;return function(_0x230070){logger[_0xcbed('0x31')](_0x230070[_0xcbed('0x32')]);if(_0x230070[_0xcbed('0x33')]){delete _0x230070[_0xcbed('0x33')];}_0x3e6ca9['status'](_0x20f6f0)['send'](_0x230070);};}function getInteractionUsers(_0x421f31,_0x2ee829){return new BPromise(function(_0x52ecad,_0x8e1cff){try{if(_0x2ee829[_0x421f31['id']]){_0x421f31[_0xcbed('0x34')]=_['map'](_0x2ee829[_0x421f31['id']],function(_0x47bb96){return{'id':_0x47bb96['id'],'fullname':_0x47bb96['fullname']};});}}catch(_0x4c168e){_0x8e1cff(_0x4c168e);}_0x52ecad(_0x421f31);});}function getInteractionTags(_0x1e1478,_0x43b6e4){return new BPromise(function(_0x3e8d46,_0xccca99){try{if(_0x1e1478[_0xcbed('0x35')]){_0x1e1478[_0xcbed('0x36')]=[];_0x1e1478['TagIds'][_0xcbed('0x37')](',')[_0xcbed('0x38')](function(_0x54013e){_0x1e1478[_0xcbed('0x36')][_0xcbed('0x39')](_0x43b6e4[_0x54013e]);});}delete _0x1e1478[_0xcbed('0x35')];}catch(_0x44fb66){_0xccca99(_0x44fb66);}_0x3e8d46(_0x1e1478);});}function updateFaxInteraction(_0x50dfa8,_0x789ce3,_0x40c776){return new BPromise(function(_0x1d1019,_0x5b7493){return getInteractionUsers(_0x50dfa8,_0x40c776)['then'](function(_0x2cb5c0){return getInteractionTags(_0x2cb5c0,_0x789ce3);})[_0xcbed('0x2f')](function(_0x35ec49){_0x1d1019(_0x35ec49);})[_0xcbed('0x3a')](function(_0x3ce022){_0x5b7493(_0x3ce022);});});}exports[_0xcbed('0x3b')]=function(_0xcdf84b,_0x51e8c5){var _0x14fbb4={},_0x6442e3={},_0x54d301={'count':0x0,'rows':[]};var _0x3355a3=_[_0xcbed('0x3c')](db[_0xcbed('0x3d')][_0xcbed('0x3e')],function(_0x26829d){return{'name':_0x26829d[_0xcbed('0x3f')],'type':_0x26829d['type'][_0xcbed('0x40')]};});_0x6442e3['model']=_['map'](_0x3355a3,'name');_0x6442e3[_0xcbed('0x41')]=_[_0xcbed('0x42')](_0xcdf84b[_0xcbed('0x41')]);_0x6442e3[_0xcbed('0x43')]=_[_0xcbed('0x44')](_0x6442e3['model'],_0x6442e3[_0xcbed('0x41')]);_0x14fbb4[_0xcbed('0x45')]=_[_0xcbed('0x44')](_0x6442e3['model'],qs[_0xcbed('0x46')](_0xcdf84b[_0xcbed('0x41')]['fields']));_0x14fbb4[_0xcbed('0x45')]=_0x14fbb4['attributes'][_0xcbed('0x47')]?_0x14fbb4[_0xcbed('0x45')]:_0x6442e3[_0xcbed('0x48')];if(!_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x49')](_0xcbed('0x4a'))){_0x14fbb4[_0xcbed('0x27')]=qs[_0xcbed('0x27')](_0xcdf84b['query']['limit']);_0x14fbb4[_0xcbed('0x24')]=qs[_0xcbed('0x24')](_0xcdf84b[_0xcbed('0x41')]['offset']);}_0x14fbb4['order']=qs[_0xcbed('0x4b')](_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x4b')]);_0x14fbb4['where']=qs[_0xcbed('0x43')](_[_0xcbed('0x4c')](_0xcdf84b[_0xcbed('0x41')],_0x6442e3[_0xcbed('0x43')]),_0x3355a3);var _0x356b7d=[];var _0x7082ce=squel[_0xcbed('0x4d')]()[_0xcbed('0x4e')]('id')[_0xcbed('0x4e')]('name')[_0xcbed('0x4e')]('color')[_0xcbed('0x4f')](_0xcbed('0x50'));var _0xcc3eae=squel[_0xcbed('0x4d')]()['field']('u.id')[_0xcbed('0x4e')](_0xcbed('0x51'))['field'](_0xcbed('0x52'))[_0xcbed('0x4f')](_0xcbed('0x53'),'ui')['left_join']('users','u',_0xcbed('0x54'));var _0x154b68=squel[_0xcbed('0x4d')]()[_0xcbed('0x4f')](_0xcbed('0x55'),'i')['left_join']('cm_contacts','c',_0xcbed('0x56'))['left_join']('users','o',_0xcbed('0x57'))['left_join'](_0xcbed('0x58'),'a',_0xcbed('0x59'))['left_join']('fax_messages','me',_0xcbed('0x5a'))[_0xcbed('0x5b')]('fax_interaction_has_tags','it',_0xcbed('0x5c'))[_0xcbed('0x5b')]('tools_tags','t',_0xcbed('0x5d'));var _0x5e6826=squel[_0xcbed('0x5e')]();var _0x1ce347=[];var _0x383d31=squel['expr']();var _0x3f25cd;if(_0xcdf84b[_0xcbed('0x41')]['search']){_0x3f25cd=as['parseSearch'](_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x5f')]);var _0x125045=_0x3f25cd[_0xcbed('0x60')];for(var _0x524b4e=0x0;_0x524b4e<_0x3f25cd['conditions']['length'];_0x524b4e++){var _0x19731c=_0x3f25cd[_0xcbed('0x61')][_0x524b4e];var _0x1d8e27='i';var _0x53dddb=_['find'](_0x3355a3,[_0xcbed('0x33'),_0x19731c[_0xcbed('0x4e')]]);if(!_0x53dddb){switch(_0x19731c[_0xcbed('0x4e')]){case _0xcbed('0x62'):if(_0x19731c['value']==0x1){_0x154b68[_0xcbed('0x63')]('`'+_0x19731c[_0xcbed('0x4e')]+'`\x20=\x200');}else{_0x154b68[_0xcbed('0x63')]('`'+_0x19731c[_0xcbed('0x4e')]+_0xcbed('0x64'));}break;case _0xcbed('0x65'):if(_0x19731c[_0xcbed('0x66')]===_0xcbed('0x67')){if(_0x19731c[_0xcbed('0x68')][_0xcbed('0x37')]('\x20')[_0xcbed('0x47')]>0x1){_0x5e6826[_0x125045](_0xcbed('0x69'),qs[_0xcbed('0x6a')](_0x19731c[_0xcbed('0x68')]),null);}else{var _0x39ca40='%'+_0x19731c[_0xcbed('0x68')]+'%';_0x5e6826[_0x125045](_0xcbed('0x6b'),_0x39ca40,_0x39ca40,_0x39ca40);}}else{_0x53dddb=_['find'](_0x3355a3,[_0xcbed('0x33'),_0xcbed('0x6c')]);_0x19731c[_0xcbed('0x4e')]='ContactId';_0x741c2c=as['buildExpression'](_0x1d8e27,_0x53dddb[_0xcbed('0x6d')],_0x19731c);_0x5e6826[_0x125045](_0x741c2c[_0xcbed('0x6e')],_0x741c2c[_0xcbed('0x68')]['start'],_0x741c2c[_0xcbed('0x68')][_0xcbed('0x22')]);}break;case _0xcbed('0x6f'):var _0x13cd66=_0x19731c['value'][_0xcbed('0x37')](',')[_0xcbed('0x3c')](function(_0x460f23){return Number(_0x460f23);});_0x13cd66[_0xcbed('0x38')](function(_0x2dc850){_0x383d31['or'](_0xcbed('0x70'),'%,'+_0x2dc850+',%');});_0x1ce347=_[_0xcbed('0x71')](_0x1ce347,_0x13cd66);break;case _0xcbed('0x72'):if(_0x19731c[_0xcbed('0x66')]==='$substring'){_0x5e6826[_0x125045](_0xcbed('0x73'),'%'+_0x19731c[_0xcbed('0x68')]+'%',null);}else{_0x53dddb=_[_0xcbed('0x74')](_0x3355a3,[_0xcbed('0x33'),_0xcbed('0x75')]);_0x19731c[_0xcbed('0x4e')]=_0xcbed('0x75');_0x741c2c=as[_0xcbed('0x76')](_0x1d8e27,_0x53dddb[_0xcbed('0x6d')],_0x19731c);_0x5e6826[_0x125045](_0x741c2c['text'],_0x741c2c[_0xcbed('0x68')][_0xcbed('0x77')],_0x741c2c[_0xcbed('0x68')]['end']);}break;case _0xcbed('0x78'):_0x741c2c=as[_0xcbed('0x76')]('me',null,_0x19731c);_0x5e6826[_0x125045](_0x741c2c[_0xcbed('0x6e')],_0x741c2c[_0xcbed('0x68')][_0xcbed('0x77')],_0x741c2c[_0xcbed('0x68')][_0xcbed('0x22')]);break;}}else{var _0x741c2c=as['buildExpression'](_0x1d8e27,_0x53dddb[_0xcbed('0x6d')],_0x19731c);_0x5e6826[_0x125045](_0x741c2c[_0xcbed('0x6e')],_0x741c2c[_0xcbed('0x68')][_0xcbed('0x77')],_0x741c2c[_0xcbed('0x68')][_0xcbed('0x22')]);}}}else{var _0x4c55d9=_(_0xcdf84b[_0xcbed('0x41')])[_0xcbed('0x42')]()[_0xcbed('0x3c')](function(_0x6d992b){return _[_0xcbed('0x79')](_0x3355a3,[_0xcbed('0x33'),_0x6d992b])?_0x6d992b:undefined;})[_0xcbed('0x7a')]()[_0xcbed('0x68')]();if(!_['isEmpty'](_0x4c55d9)){_0x4c55d9[_0xcbed('0x38')](function(_0x515b3e){if(_0x515b3e===_0xcbed('0x7b')){_0x154b68[_0xcbed('0x7c')](_0xcbed('0x7d'),[]['concat'](_0xcdf84b[_0xcbed('0x41')][_0x515b3e]));}else if(_0x515b3e===_0xcbed('0x7e')){var _0x14c4c8=JSON['parse'](_0xcdf84b['query'][_0x515b3e])['$gte'];var _0x7afd51=JSON[_0xcbed('0x7f')](_0xcdf84b[_0xcbed('0x41')][_0x515b3e])[_0xcbed('0x80')];_0x154b68['where'](_0xcbed('0x81'),_0x14c4c8,_0x7afd51);}else{if(_0xcdf84b['query'][_0x515b3e]===_0xcbed('0x82')){_0x154b68[_0xcbed('0x7c')]('i.'+_0x515b3e+'\x20IS\x20NULL');}else{_0x154b68[_0xcbed('0x7c')]('i.'+_0x515b3e+_0xcbed('0x83'),_0xcdf84b[_0xcbed('0x41')][_0x515b3e]);}}});}if(_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x84')]){if(_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x84')]==0x1){_0x154b68['having'](_0xcbed('0x85'));}else{_0x154b68[_0xcbed('0x63')](_0xcbed('0x86'));}}if(_0xcdf84b[_0xcbed('0x41')]['tag']){_0x1ce347=_[_0xcbed('0x87')](_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x88')])?_0xcdf84b['query'][_0xcbed('0x88')]:new Array(_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x88')]);_0x1ce347[_0xcbed('0x38')](function(_0x28ac59){_0x383d31['or'](_0xcbed('0x70'),'%,'+_0x28ac59+',%');});}if(_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x89')]){var _0x1cf87e=_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x89')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xcbed('0x8a')](_0x1cf87e)){_0x5e6826['or']('i.id\x20LIKE\x20?',_0x1cf87e+'%')['or'](_0xcbed('0x8b'),_0x1cf87e+'%');}_0x5e6826['or'](_0xcbed('0x8c'),_0x1cf87e+'%');}}_0x154b68['where'](_0x5e6826);_0x154b68[_0xcbed('0x8d')](_0xcbed('0x8e'));var _0x28f29a={'type':db['Sequelize'][_0xcbed('0x8f')][_0xcbed('0x90')],'raw':!![]};var _0x19fb82=_0x154b68['clone']();_0x19fb82['field'](_0xcbed('0x8e'));_0x19fb82[_0xcbed('0x4e')](_0xcbed('0x91'),_0xcbed('0x62'));if(_0x14fbb4['order']){_0x14fbb4[_0xcbed('0x92')][_0xcbed('0x38')](function(_0x466723){var _0x3825b7=_0x466723[0x0]===_0xcbed('0x93')?_0x466723[0x0]:'i.'+_0x466723[0x0];_0x154b68['order'](_0x3825b7,_0x466723[0x1]===_0xcbed('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x1ce347)){_0x154b68['having'](_0x383d31);_0x19fb82[_0xcbed('0x7c')](_0xcbed('0x95'),_0x1ce347);}BPromise[_0xcbed('0x96')]()[_0xcbed('0x2f')](function(){if(!_0x3f25cd){if(_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x7b')])return;_0x19fb82[_0xcbed('0x7c')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x154b68[_0xcbed('0x7c')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xcdf84b['user']['role']!==_0xcbed('0x97'))return;return _0xcdf84b[_0xcbed('0x98')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xcbed('0x2f')](function(_0x236e5f){if(_['isEmpty'](_0x236e5f)){_0x19fb82[_0xcbed('0x7c')]('i.FaxAccountId\x20IS\x20NULL');_0x154b68[_0xcbed('0x7c')](_0xcbed('0x99'));}else{_0x19fb82[_0xcbed('0x7c')](_0xcbed('0x7d'),_[_0xcbed('0x3c')](_0x236e5f,'id'));_0x154b68[_0xcbed('0x7c')]('i.FaxAccountId\x20IN\x20?',_[_0xcbed('0x3c')](_0x236e5f,'id'));}});})['then'](function(){if(_0xcdf84b[_0xcbed('0x98')][_0xcbed('0x9a')]==='agent'&&!_0x3f25cd&&!_0xcdf84b[_0xcbed('0x41')][_0xcbed('0x7b')])return[];return db['sequelize'][_0xcbed('0x41')](_0x19fb82['toString'](),_0x28f29a);})['then'](function(_0x35e064){_0x54d301['count']=_0x35e064[_0xcbed('0x47')];if(_0x54d301[_0xcbed('0x26')]===0x0)return[];return db[_0xcbed('0x9b')][_0xcbed('0x41')](_0x7082ce[_0xcbed('0x9c')](),_0x28f29a)[_0xcbed('0x2f')](function(_0x86610c){_0x356b7d=_[_0xcbed('0x9d')](_0x86610c,'id');_0x28f29a=_['merge'](_0x28f29a,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xcdf84b['query'][_0xcbed('0x46')]){_0x14fbb4[_0xcbed('0x45')]['forEach'](function(_0x5b3caa){_0x154b68['field']('i.'+_0x5b3caa);});}else{_0x154b68[_0xcbed('0x4e')](_0xcbed('0x91'),_0xcbed('0x62'));_0x154b68[_0xcbed('0x4e')](_0xcbed('0x9e'),'Account.key');_0x154b68[_0xcbed('0x4e')]('a.mandatoryDisposition',_0xcbed('0x9f'));_0x154b68[_0xcbed('0x4e')](_0xcbed('0xa0'),_0xcbed('0x93'));_0x154b68[_0xcbed('0x4e')](_0xcbed('0xa1'));_0x154b68['field'](_0xcbed('0xa2'),_0xcbed('0xa3'));_0x154b68['field'](_0xcbed('0xa4'),_0xcbed('0xa5'));_0x154b68[_0xcbed('0x4e')](_0xcbed('0xa6'),_0xcbed('0xa7'));_0x154b68[_0xcbed('0x4e')](_0xcbed('0xa8'),_0xcbed('0xa9'));_0x154b68[_0xcbed('0x4e')](_0xcbed('0xaa'),_0xcbed('0xab'));_0x154b68[_0xcbed('0x4e')](_0xcbed('0xac'),_0xcbed('0xad'));_0x154b68[_0xcbed('0x4e')]('o.fullname',_0xcbed('0xae'));_0x154b68['field'](_0xcbed('0xaf'),'Owner.internal');_0x154b68['field'](_0xcbed('0xb0'),_0xcbed('0x35'));}if(_0x14fbb4[_0xcbed('0x27')])_0x154b68[_0xcbed('0x27')](_0x14fbb4['limit']);if(_0x14fbb4[_0xcbed('0x24')])_0x154b68[_0xcbed('0x24')](_0x14fbb4[_0xcbed('0x24')]);return db['sequelize']['query'](_0x154b68['toString'](),_0x28f29a);})['then'](function(_0x100ce3){if(_0x100ce3[_0xcbed('0x47')]>0x0)_0xcc3eae[_0xcbed('0x7c')](_0xcbed('0xb1'),_[_0xcbed('0x3c')](_0x100ce3,'id'));return db[_0xcbed('0x9b')][_0xcbed('0x41')](_0xcc3eae[_0xcbed('0x9c')](),_0x28f29a)[_0xcbed('0x2f')](function(_0x48ef77){var _0x2464b0=_[_0xcbed('0xb2')](_0x48ef77,_0xcbed('0xb3'));var _0xf0e3e8=[];_0x100ce3[_0xcbed('0x38')](function(_0x32b8a4){_0xf0e3e8[_0xcbed('0x39')](updateFaxInteraction(_0x32b8a4,_0x356b7d,_0x2464b0));});return BPromise[_0xcbed('0xb4')](_0xf0e3e8);});});})[_0xcbed('0x2f')](function(_0x12bb72){_0x54d301['rows']=_0x12bb72;return _0x54d301;})[_0xcbed('0x2f')](respondWithFilteredResult(_0x51e8c5,_0x14fbb4))[_0xcbed('0x3a')](handleError(_0x51e8c5,null));};exports[_0xcbed('0xb5')]=function(_0x2187f4,_0x299213){var _0x34131f={'raw':![],'where':{'id':_0x2187f4[_0xcbed('0xb6')]['id']}},_0x55fd42={};_0x55fd42[_0xcbed('0x48')]=_[_0xcbed('0x42')](db['FaxInteraction'][_0xcbed('0x3e')]);_0x55fd42[_0xcbed('0x41')]=_[_0xcbed('0x42')](_0x2187f4['query']);_0x55fd42[_0xcbed('0x43')]=_[_0xcbed('0x44')](_0x55fd42['model'],_0x55fd42[_0xcbed('0x41')]);_0x34131f[_0xcbed('0x45')]=_[_0xcbed('0x44')](_0x55fd42[_0xcbed('0x48')],qs['fields'](_0x2187f4[_0xcbed('0x41')][_0xcbed('0x46')]));_0x34131f['attributes']=_0x34131f['attributes'][_0xcbed('0x47')]?_0x34131f[_0xcbed('0x45')]:_0x55fd42[_0xcbed('0x48')];if(_0x2187f4[_0xcbed('0x41')][_0xcbed('0xb7')]){_0x34131f['include']=[{'all':!![]}];}_0x34131f=_['merge']({},_0x34131f,_0x2187f4['options']);return db['FaxInteraction']['find'](_0x34131f)[_0xcbed('0x2f')](handleEntityNotFound(_0x299213,null))[_0xcbed('0x2f')](respondWithResult(_0x299213,null))[_0xcbed('0x3a')](handleError(_0x299213,null));};exports['create']=function(_0x51a164,_0x411d32){return db[_0xcbed('0x3d')][_0xcbed('0xb8')](_0x51a164['body'],{})['then'](respondWithResult(_0x411d32,0xc9))[_0xcbed('0x3a')](handleError(_0x411d32,null));};exports[_0xcbed('0x2e')]=function(_0x5c5dc4,_0x20565f){if(_0x5c5dc4[_0xcbed('0x78')]['id']){delete _0x5c5dc4[_0xcbed('0x78')]['id'];}return db[_0xcbed('0x3d')]['find']({'where':{'id':_0x5c5dc4['params']['id']}})[_0xcbed('0x2f')](handleEntityNotFound(_0x20565f,null))[_0xcbed('0x2f')](saveUpdates(_0x5c5dc4[_0xcbed('0x78')],null))[_0xcbed('0x2f')](respondWithResult(_0x20565f,null))['catch'](handleError(_0x20565f,null));};exports[_0xcbed('0x30')]=function(_0x45688b,_0x3b9d1a){return db['FaxInteraction'][_0xcbed('0x74')]({'where':{'id':_0x45688b['params']['id']}})['then'](handleEntityNotFound(_0x3b9d1a,null))[_0xcbed('0x2f')](removeEntity(_0x3b9d1a,null))[_0xcbed('0x3a')](handleError(_0x3b9d1a,null));};exports[_0xcbed('0xb9')]=function(_0x431d5a,_0x478ab0){return db[_0xcbed('0x3d')][_0xcbed('0xb9')]()['then'](respondWithResult(_0x478ab0,null))[_0xcbed('0x3a')](handleError(_0x478ab0,null));};exports[_0xcbed('0xba')]=function(_0x143058,_0x582f94,_0x594b68){return db['FaxMessage']['find']({'where':{'id':_0x143058[_0xcbed('0xb6')]['id']}})[_0xcbed('0x2f')](handleEntityNotFound(_0x582f94,null))[_0xcbed('0x2f')](function(_0x4632f6){if(_0x4632f6){return _0x4632f6['addMessage'](_0x143058[_0xcbed('0x78')][_0xcbed('0xbb')],_[_0xcbed('0xbc')](_0x143058[_0xcbed('0x78')],[_0xcbed('0xbb'),'id'])||{});}})[_0xcbed('0x2f')](respondWithResult(_0x582f94,null))['catch'](handleError(_0x582f94,null));};exports['getMessages']=function(_0x34ec63,_0x232122,_0x196ccc){var _0x1a729b={'raw':![],'where':{}};var _0x4400f8={};var _0xaf883c={'count':0x0,'rows':[]};return db[_0xcbed('0x3d')][_0xcbed('0xbd')]({'where':{'id':_0x34ec63[_0xcbed('0xb6')]['id']}})['then'](handleEntityNotFound(_0x232122,null))['then'](function(_0x4272d8){if(_0x4272d8){_0x4400f8['model']=_[_0xcbed('0x42')](db[_0xcbed('0xbe')][_0xcbed('0x3e')]);_0x4400f8[_0xcbed('0x41')]=_['keys'](_0x34ec63[_0xcbed('0x41')]);_0x4400f8[_0xcbed('0x43')]=_['intersection'](_0x4400f8[_0xcbed('0x48')],_0x4400f8[_0xcbed('0x41')]);_0x1a729b[_0xcbed('0x45')]=_['intersection'](_0x4400f8[_0xcbed('0x48')],qs['fields'](_0x34ec63[_0xcbed('0x41')][_0xcbed('0x46')]));_0x1a729b[_0xcbed('0x45')]=_0x1a729b[_0xcbed('0x45')]['length']?_0x1a729b[_0xcbed('0x45')]:_0x4400f8[_0xcbed('0x48')];if(!_0x34ec63[_0xcbed('0x41')][_0xcbed('0x49')](_0xcbed('0x4a'))){_0x1a729b[_0xcbed('0x27')]=qs['limit'](_0x34ec63[_0xcbed('0x41')][_0xcbed('0x27')]);_0x1a729b[_0xcbed('0x24')]=qs[_0xcbed('0x24')](_0x34ec63[_0xcbed('0x41')][_0xcbed('0x24')]);}_0x1a729b[_0xcbed('0x92')]=qs[_0xcbed('0x4b')](_0x34ec63[_0xcbed('0x41')][_0xcbed('0x4b')]);_0x1a729b['where']=qs[_0xcbed('0x43')](_[_0xcbed('0x4c')](_0x34ec63[_0xcbed('0x41')],_0x4400f8[_0xcbed('0x43')]));_0x1a729b['where'][_0xcbed('0xb3')]=_0x4272d8['id'];if(_0x34ec63[_0xcbed('0x41')][_0xcbed('0x89')]){_0x1a729b['where']=_['merge'](_0x1a729b['where'],{'$or':_[_0xcbed('0x3c')](_0x1a729b['attributes'],function(_0x33363c){var _0x21a0ec={};_0x21a0ec[_0x33363c]={'$like':'%'+_0x34ec63[_0xcbed('0x41')]['filter']+'%'};return _0x21a0ec;})});}if(_0x34ec63[_0xcbed('0x41')][_0xcbed('0xbf')]){var _0x306034=_0x34ec63[_0xcbed('0x41')][_0xcbed('0xbf')][_0xcbed('0x37')](',');var _0x3bc634={};_0x3bc634[_0x306034[0x0]]={'$gte':moment(_0x306034[0x1])[_0xcbed('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1a729b[_0xcbed('0x7c')]=_['merge'](_0x1a729b[_0xcbed('0x7c')],_0x3bc634);}_0x1a729b=_['merge']({},_0x1a729b,_0x34ec63['options']);return db['FaxMessage']['count']({'where':_0x1a729b['where']})['then'](function(_0x4ecfbb){_0xaf883c[_0xcbed('0x26')]=_0x4ecfbb;if(_0x34ec63[_0xcbed('0x41')][_0xcbed('0xb7')]){_0x1a729b[_0xcbed('0xc1')]=[{'all':!![]}];}return db[_0xcbed('0xbe')]['findAll'](_0x1a729b);})[_0xcbed('0x2f')](function(_0x327ca2){_0xaf883c['rows']=_0x327ca2;return _0xaf883c;});}})[_0xcbed('0x2f')](respondWithFilteredResult(_0x232122,_0x1a729b))['catch'](handleError(_0x232122,null));};exports[_0xcbed('0xc2')]=function(_0x369a24,_0x931954,_0x32a27d){return db[_0xcbed('0x3d')][_0xcbed('0x74')]({'where':{'id':_0x369a24[_0xcbed('0xb6')]['id']}})[_0xcbed('0x2f')](handleEntityNotFound(_0x931954,null))[_0xcbed('0x2f')](function(_0x4fe46d){if(_0x4fe46d){return _0x4fe46d[_0xcbed('0xc3')](_0x369a24[_0xcbed('0x78')][_0xcbed('0xbb')],_['omit'](_0x369a24['body'],['ids','id'])||{})[_0xcbed('0xc4')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xcbed('0xc5')],'where':{'id':_0x369a24[_0xcbed('0x78')]['ids']}});})['then'](function(_0x4e03e5){socket['emit'](_0xcbed('0xc6'),{'id':Number(_0x369a24['params']['id']),'tags':_0x4e03e5||[]});return{'id':Number(_0x369a24['params']['id']),'tags':_0x4e03e5||[]};});}})[_0xcbed('0x2f')](respondWithResult(_0x931954,null))['catch'](handleError(_0x931954,null));};exports[_0xcbed('0xc7')]=function(_0x10e10c,_0x161cba,_0x1c4673){return db[_0xcbed('0x3d')]['find']({'where':{'id':_0x10e10c['params']['id']}})[_0xcbed('0x2f')](handleEntityNotFound(_0x161cba,null))[_0xcbed('0x2f')](function(_0x3fc43c){if(_0x3fc43c){return _0x3fc43c[_0xcbed('0xc7')](_0x10e10c[_0xcbed('0x41')][_0xcbed('0xbb')]);}})['then'](respondWithStatusCode(_0x161cba,null))[_0xcbed('0x3a')](handleError(_0x161cba,null));};exports[_0xcbed('0xc8')]=function(_0x4deca4,_0x3090c1){var _0xa150b9=moment()['unix']()[_0xcbed('0x9c')]();var _0x485182=path[_0xcbed('0xc9')](config[_0xcbed('0xca')],_0xcbed('0xcb'),'files',_0xcbed('0xcc'));var _0x244766=path['join'](config[_0xcbed('0xca')],_0xcbed('0xcb'),_0xcbed('0xcd'),_0xcbed('0xce'));var _0x1b322b=path[_0xcbed('0xc9')](_0x485182,_0xa150b9);var _0x28a61d=util[_0xcbed('0xc0')](_0xcbed('0xcf'),_0x4deca4[_0xcbed('0xb6')]['id'],_0xa150b9);var _0x583847=path[_0xcbed('0xc9')](_0x485182,_0x28a61d);var _0x4d8cdf=[];_0x4d8cdf['push']({'model':db['Attachment'],'as':_0xcbed('0xd0'),'raw':!![]});var _0x4f6802=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xcbed('0x78'),_0xcbed('0x7e')],'include':_0x4d8cdf}];return db['FaxInteraction'][_0xcbed('0x74')]({'where':{'id':_0x4deca4[_0xcbed('0xb6')]['id']},'include':_0x4f6802})[_0xcbed('0x2f')](handleEntityNotFound(_0x3090c1,null))[_0xcbed('0x2f')](function(_0xc19151){if(_0xc19151&&_0xc19151[_0xcbed('0xd1')]){var _0x55cc5d=_0xc19151[_0xcbed('0xd2')]({'plain':!![]});fs[_0xcbed('0xd3')](_0x1b322b);for(var _0x44f240=0x0;_0x44f240<_0x55cc5d['Messages'][_0xcbed('0x47')];_0x44f240++){var _0x344590=_0x55cc5d['Messages'][_0x44f240][_0xcbed('0xd0')];if(_0x344590){var _0x5b6279=path[_0xcbed('0xc9')](_0x244766,_0x344590['basename']);if(fs['existsSync'](_0x5b6279)){fs[_0xcbed('0xd4')](_0x5b6279)[_0xcbed('0xd5')](fs['createWriteStream'](path['join'](_0x1b322b,_0x344590[_0xcbed('0xd6')])));}}}return BPromise[_0xcbed('0x96')]()[_0xcbed('0x2f')](function(){return new BPromise(function(_0x169060,_0x126183){zipdir(_0x1b322b,{'saveTo':_0x583847},function(_0x363595,_0xb76100){if(_0x363595)return _0x126183(_0x363595);return _0x169060(_0xb76100);});})[_0xcbed('0x2f')](function(){return new BPromise(function(_0x12d1c1,_0x51b7b8){rimraf(_0x1b322b,function(_0x574049){if(_0x574049)_0x51b7b8(_0x574049);return _0x12d1c1();});});})[_0xcbed('0x2f')](function(){return _0x3090c1['download'](_0x583847,_0x28a61d,function(_0x2dbcb1){if(_0x2dbcb1){console['log'](_0xcbed('0xd7'),_0x2dbcb1);}else{fs['unlinkSync'](_0x583847);}});});});}else{return _0x3090c1[_0xcbed('0x21')](0xc8);}})[_0xcbed('0x3a')](handleError(_0x3090c1,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b0b7d98..4ea391a 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 _0xfd32=['unreadMessages','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','findAll'];(function(_0x12c72d,_0x320832){var _0x211a39=function(_0x363f10){while(--_0x363f10){_0x12c72d['push'](_0x12c72d['shift']());}};_0x211a39(++_0x320832);}(_0xfd32,0x6b));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2fd3('0x0'));var FaxInteraction=require(_0x2fd3('0x1'))['db'][_0x2fd3('0x2')];var FaxMessage=require(_0x2fd3('0x1'))['db'][_0x2fd3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2fd3('0x4')](0x0);var events={'afterCreate':_0x2fd3('0x5'),'afterUpdate':_0x2fd3('0x6'),'afterDestroy':_0x2fd3('0x7')};function emitEvent(_0x2c3168){return function(_0x7aa4f7,_0x5c664d,_0x2c5466){_0x7aa4f7[_0x2fd3('0x8')]({'attributes':['id'],'raw':!![]})[_0x2fd3('0x9')](function(_0x30abf5){_0x7aa4f7[_0x2fd3('0xa')]('Users',_0x30abf5['map'](function(_0x4f2fe1){return{'id':_0x4f2fe1['id']};}));return FaxMessage[_0x2fd3('0xb')]({'where':{'FaxInteractionId':_0x7aa4f7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2fd3('0x9')](function(_0x58d37f){_0x7aa4f7['setDataValue'](_0x2fd3('0xc'),_0x58d37f['length']);FaxInteractionEvents['emit'](_0x2c3168+':'+_0x7aa4f7['id'],_0x7aa4f7);FaxInteractionEvents['emit'](_0x2c3168,_0x7aa4f7);_0x2c5466(null);})[_0x2fd3('0xd')](_0x2c5466(null));};}for(var e in events){if(events[_0x2fd3('0xe')](e)){var event=events[e];FaxInteraction[_0x2fd3('0xf')](e,emitEvent(event));}}module[_0x2fd3('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xf584=['map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','remove','getUsers','then'];(function(_0x208c0b,_0x287cc5){var _0x5beac6=function(_0x944681){while(--_0x944681){_0x208c0b['push'](_0x208c0b['shift']());}};_0x5beac6(++_0x287cc5);}(_0xf584,0x16f));var _0x4f58=function(_0x255f08,_0x3bca58){_0x255f08=_0x255f08-0x0;var _0x25334a=_0xf584[_0x255f08];return _0x25334a;};'use strict';var EventEmitter=require(_0x4f58('0x0'));var FaxInteraction=require(_0x4f58('0x1'))['db'][_0x4f58('0x2')];var FaxMessage=require(_0x4f58('0x1'))['db'][_0x4f58('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4f58('0x4')};function emitEvent(_0x377727){return function(_0xd69468,_0x38f1ae,_0x262222){_0xd69468[_0x4f58('0x5')]({'attributes':['id'],'raw':!![]})[_0x4f58('0x6')](function(_0x120aef){_0xd69468['setDataValue']('Users',_0x120aef[_0x4f58('0x7')](function(_0x4ced69){return{'id':_0x4ced69['id']};}));return FaxMessage[_0x4f58('0x8')]({'where':{'FaxInteractionId':_0xd69468['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f58('0x6')](function(_0x41261c){_0xd69468[_0x4f58('0x9')](_0x4f58('0xa'),_0x41261c[_0x4f58('0xb')]);FaxInteractionEvents[_0x4f58('0xc')](_0x377727+':'+_0xd69468['id'],_0xd69468);FaxInteractionEvents['emit'](_0x377727,_0xd69468);_0x262222(null);})[_0x4f58('0xd')](_0x262222(null));};}for(var e in events){if(events[_0x4f58('0xe')](e)){var event=events[e];FaxInteraction[_0x4f58('0xf')](e,emitEvent(event));}}module[_0x4f58('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 1f9e8b1..a8a6ebf 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 _0xea1d=['exports','define','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0xdabb0c,_0x3714f7){var _0x5553d3=function(_0x45197b){while(--_0x45197b){_0xdabb0c['push'](_0xdabb0c['shift']());}};_0x5553d3(++_0x3714f7);}(_0xea1d,0x1d1));var _0xdea1=function(_0x530788,_0x234040){_0x530788=_0x530788-0x0;var _0x3c9b88=_0xea1d[_0x530788];return _0x3c9b88;};'use strict';var _=require(_0xdea1('0x0'));var util=require(_0xdea1('0x1'));var logger=require(_0xdea1('0x2'))(_0xdea1('0x3'));var moment=require(_0xdea1('0x4'));var BPromise=require(_0xdea1('0x5'));var rp=require(_0xdea1('0x6'));var fs=require('fs');var path=require(_0xdea1('0x7'));var rimraf=require(_0xdea1('0x8'));var config=require(_0xdea1('0x9'));var attributes=require(_0xdea1('0xa'));module[_0xdea1('0xb')]=function(_0x467032,_0x320c10){return _0x467032[_0xdea1('0xc')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xed483e,_0x2f2032,_0x42a2f1){if(_0xed483e[_0xdea1('0xd')](_0xdea1('0xe'))){_0xed483e[_0xdea1('0xf')]=moment()['format'](_0xdea1('0x10'));}_0x42a2f1(null,_0xed483e);}}});}; \ No newline at end of file +var _0xa0c1=['lodash','util','../../config/logger','api','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x21d48e,_0x8aa202){var _0x4a578b=function(_0x1fc4e9){while(--_0x1fc4e9){_0x21d48e['push'](_0x21d48e['shift']());}};_0x4a578b(++_0x8aa202);}(_0xa0c1,0x8f));var _0x1a0c=function(_0x337ef3,_0xb02a66){_0x337ef3=_0x337ef3-0x0;var _0x138902=_0xa0c1[_0x337ef3];return _0x138902;};'use strict';var _=require(_0x1a0c('0x0'));var util=require(_0x1a0c('0x1'));var logger=require(_0x1a0c('0x2'))(_0x1a0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a0c('0x4'));var attributes=require('./faxInteraction.attributes');module[_0x1a0c('0x5')]=function(_0x980418,_0x5c54ef){return _0x980418[_0x1a0c('0x6')](_0x1a0c('0x7'),attributes,{'tableName':_0x1a0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x160b20,_0x1784bd,_0x21b8ef){if(_0x160b20[_0x1a0c('0x9')](_0x1a0c('0xa'))){_0x160b20[_0x1a0c('0xb')]=moment()['format'](_0x1a0c('0xc'));}_0x21b8ef(null,_0x160b20);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 2436cb9..e4d0ac9 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 _0xddd9=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxInteraction','update','options','raw','where','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','addTags','body','ids','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x546ac6,_0x21e5e5){var _0x1dfbf9=function(_0x4bc431){while(--_0x4bc431){_0x546ac6['push'](_0x546ac6['shift']());}};_0x1dfbf9(++_0x21e5e5);}(_0xddd9,0x119));var _0x9ddd=function(_0x3fae70,_0x2cfe67){_0x3fae70=_0x3fae70-0x0;var _0x940b32=_0xddd9[_0x3fae70];return _0x940b32;};'use strict';var _=require(_0x9ddd('0x0'));var util=require(_0x9ddd('0x1'));var moment=require(_0x9ddd('0x2'));var BPromise=require(_0x9ddd('0x3'));var rs=require(_0x9ddd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ddd('0x5'))['db'];var utils=require(_0x9ddd('0x6'));var logger=require(_0x9ddd('0x7'))('rpc');var config=require(_0x9ddd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ddd('0x9')][_0x9ddd('0xa')]({'port':0x232a});config[_0x9ddd('0xb')]=_[_0x9ddd('0xc')](config[_0x9ddd('0xb')],{'host':_0x9ddd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ddd('0xb')]));require(_0x9ddd('0xe'))[_0x9ddd('0xf')](socket);function respondWithRpcPromise(_0x277e84,_0x3e54a0,_0x1c23f8){return new BPromise(function(_0x32d8dc,_0x17b2cc){return client[_0x9ddd('0x10')](_0x277e84,_0x1c23f8)[_0x9ddd('0x11')](function(_0x54c922){logger[_0x9ddd('0x12')](_0x9ddd('0x13'),_0x3e54a0,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3e54a0,_0x9ddd('0x14'),JSON[_0x9ddd('0x15')](_0x54c922));if(_0x54c922[_0x9ddd('0x16')]){if(_0x54c922['error'][_0x9ddd('0x17')]===0x1f4){logger[_0x9ddd('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x3e54a0,_0x54c922[_0x9ddd('0x16')][_0x9ddd('0x18')]);return _0x17b2cc(_0x54c922['error']['message']);}logger[_0x9ddd('0x16')](_0x9ddd('0x13'),_0x3e54a0,_0x54c922[_0x9ddd('0x16')][_0x9ddd('0x18')]);return _0x32d8dc(_0x54c922['error'][_0x9ddd('0x18')]);}else{logger['info'](_0x9ddd('0x13'),_0x3e54a0,_0x9ddd('0x14'));_0x32d8dc(_0x54c922[_0x9ddd('0x19')][_0x9ddd('0x18')]);}})[_0x9ddd('0x1a')](function(_0x1f6c62){logger[_0x9ddd('0x16')](_0x9ddd('0x13'),_0x3e54a0,_0x1f6c62);_0x17b2cc(_0x1f6c62);});});}exports['UpdateFaxInteraction']=function(_0x16ca84){var _0x2fed81=this;return new Promise(function(_0x10d4c0,_0x3a89c9){return db[_0x9ddd('0x1b')][_0x9ddd('0x1c')](_0x16ca84['body'],{'raw':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84['options'][_0x9ddd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84[_0x9ddd('0x1d')][_0x9ddd('0x1f')]||null:null,'attributes':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84[_0x9ddd('0x1d')]['attributes']||null:null,'limit':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84[_0x9ddd('0x1d')][_0x9ddd('0x20')]||null:null})[_0x9ddd('0x11')](function(_0x139fce){logger[_0x9ddd('0x12')](_0x9ddd('0x21'),_0x16ca84);logger['debug'](_0x9ddd('0x21'),_0x16ca84,JSON[_0x9ddd('0x15')](_0x139fce));_0x10d4c0(_0x139fce);})['catch'](function(_0x476824){logger[_0x9ddd('0x16')]('UpdateFaxInteraction',_0x476824['message'],_0x16ca84);_0x3a89c9(_0x2fed81[_0x9ddd('0x16')](0x1f4,_0x476824[_0x9ddd('0x18')]));});});};exports[_0x9ddd('0x22')]=function(_0x41e5a9){return new Promise(function(_0x1d2c39,_0x3a5c0e){return db[_0x9ddd('0x1b')]['find']({'where':_0x41e5a9['options']?_0x41e5a9[_0x9ddd('0x1d')][_0x9ddd('0x1f')]||null:null})['then'](function(_0x2e692a){if(_0x2e692a){return _0x2e692a[_0x9ddd('0x23')](_0x41e5a9[_0x9ddd('0x24')][_0x9ddd('0x25')],_['omit'](_0x41e5a9[_0x9ddd('0x24')],[_0x9ddd('0x25'),'id'])||{});}})[_0x9ddd('0x26')](function(_0x3eb0a1){logger[_0x9ddd('0x12')]('AddTags',_0x41e5a9);logger[_0x9ddd('0x27')](_0x9ddd('0x28'),_0x41e5a9,JSON['stringify'](_0x3eb0a1));_0x1d2c39(_0x3eb0a1);})['catch'](function(_0x51a6d8){logger[_0x9ddd('0x16')](_0x9ddd('0x28'),_0x51a6d8[_0x9ddd('0x18')],_0x41e5a9);_0x3a5c0e(_this[_0x9ddd('0x16')](0x1f4,_0x51a6d8[_0x9ddd('0x18')]));});});}; \ No newline at end of file +var _0x3d3d=['options','raw','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','body'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x3d3d,0x1bc));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd3d3('0x0'));var util=require(_0xd3d3('0x1'));var moment=require(_0xd3d3('0x2'));var BPromise=require(_0xd3d3('0x3'));var rs=require(_0xd3d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3d3('0x5'))['db'];var utils=require(_0xd3d3('0x6'));var logger=require(_0xd3d3('0x7'))(_0xd3d3('0x8'));var config=require(_0xd3d3('0x9'));var jayson=require(_0xd3d3('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd3d3('0xb')](config[_0xd3d3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd3d3('0xc')]));require(_0xd3d3('0xd'))[_0xd3d3('0xe')](socket);function respondWithRpcPromise(_0x1e0589,_0x36ce59,_0x50d7f2){return new BPromise(function(_0x5a2aa9,_0x1d1b04){return client[_0xd3d3('0xf')](_0x1e0589,_0x50d7f2)[_0xd3d3('0x10')](function(_0x5c5ad4){logger['info'](_0xd3d3('0x11'),_0x36ce59,'request\x20sent');logger[_0xd3d3('0x12')](_0xd3d3('0x13'),_0x36ce59,_0xd3d3('0x14'),JSON[_0xd3d3('0x15')](_0x5c5ad4));if(_0x5c5ad4[_0xd3d3('0x16')]){if(_0x5c5ad4[_0xd3d3('0x16')][_0xd3d3('0x17')]===0x1f4){logger[_0xd3d3('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x36ce59,_0x5c5ad4[_0xd3d3('0x16')][_0xd3d3('0x18')]);return _0x1d1b04(_0x5c5ad4[_0xd3d3('0x16')]['message']);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x36ce59,_0x5c5ad4[_0xd3d3('0x16')][_0xd3d3('0x18')]);return _0x5a2aa9(_0x5c5ad4['error']['message']);}else{logger[_0xd3d3('0x19')](_0xd3d3('0x11'),_0x36ce59,_0xd3d3('0x14'));_0x5a2aa9(_0x5c5ad4[_0xd3d3('0x1a')][_0xd3d3('0x18')]);}})[_0xd3d3('0x1b')](function(_0x5adf4b){logger[_0xd3d3('0x16')](_0xd3d3('0x11'),_0x36ce59,_0x5adf4b);_0x1d1b04(_0x5adf4b);});});}exports['UpdateFaxInteraction']=function(_0x41d4df){var _0x58157e=this;return new Promise(function(_0x24e328,_0x39a0d8){return db['FaxInteraction']['update'](_0x41d4df[_0xd3d3('0x1c')],{'raw':_0x41d4df[_0xd3d3('0x1d')]?_0x41d4df['options'][_0xd3d3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41d4df[_0xd3d3('0x1d')]?_0x41d4df[_0xd3d3('0x1d')]['where']||null:null,'attributes':_0x41d4df[_0xd3d3('0x1d')]?_0x41d4df[_0xd3d3('0x1d')][_0xd3d3('0x1f')]||null:null,'limit':_0x41d4df['options']?_0x41d4df[_0xd3d3('0x1d')][_0xd3d3('0x20')]||null:null})[_0xd3d3('0x10')](function(_0x38f28f){logger['info'](_0xd3d3('0x21'),_0x41d4df);logger[_0xd3d3('0x12')]('UpdateFaxInteraction',_0x41d4df,JSON[_0xd3d3('0x15')](_0x38f28f));_0x24e328(_0x38f28f);})['catch'](function(_0x14b0d3){logger[_0xd3d3('0x16')]('UpdateFaxInteraction',_0x14b0d3[_0xd3d3('0x18')],_0x41d4df);_0x39a0d8(_0x58157e['error'](0x1f4,_0x14b0d3[_0xd3d3('0x18')]));});});};exports[_0xd3d3('0x22')]=function(_0x3f4d05){return new Promise(function(_0x46dda8,_0x3d6930){return db[_0xd3d3('0x23')][_0xd3d3('0x24')]({'where':_0x3f4d05[_0xd3d3('0x1d')]?_0x3f4d05[_0xd3d3('0x1d')][_0xd3d3('0x25')]||null:null})['then'](function(_0x17a4f7){if(_0x17a4f7){return _0x17a4f7[_0xd3d3('0x26')](_0x3f4d05['body']['ids'],_[_0xd3d3('0x27')](_0x3f4d05[_0xd3d3('0x1c')],[_0xd3d3('0x28'),'id'])||{});}})[_0xd3d3('0x29')](function(_0x34e153){logger[_0xd3d3('0x19')](_0xd3d3('0x2a'),_0x3f4d05);logger[_0xd3d3('0x12')](_0xd3d3('0x2a'),_0x3f4d05,JSON['stringify'](_0x34e153));_0x46dda8(_0x34e153);})[_0xd3d3('0x1b')](function(_0xd4d0a0){logger[_0xd3d3('0x16')](_0xd3d3('0x2a'),_0xd4d0a0[_0xd3d3('0x18')],_0x3f4d05);_0x3d6930(_this[_0xd3d3('0x16')](0x1f4,_0xd4d0a0[_0xd3d3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 0a7c98b..6956894 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 _0x397f=['register','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener'];(function(_0x1ee056,_0x35733f){var _0x2a26f8=function(_0x4a13b3){while(--_0x4a13b3){_0x1ee056['push'](_0x1ee056['shift']());}};_0x2a26f8(++_0x35733f);}(_0x397f,0x1bc));var _0xf397=function(_0x23dc03,_0x522814){_0x23dc03=_0x23dc03-0x0;var _0x317567=_0x397f[_0x23dc03];return _0x317567;};'use strict';var FaxInteractionEvents=require(_0xf397('0x0'));var events=[_0xf397('0x1'),_0xf397('0x2'),_0xf397('0x3')];function createListener(_0x2d82d2,_0x5df84a){return function(_0x5fed7d){_0x5df84a[_0xf397('0x4')](_0x2d82d2,_0x5fed7d);};}function removeListener(_0x1b545d,_0x4cde45){return function(){FaxInteractionEvents[_0xf397('0x5')](_0x1b545d,_0x4cde45);};}exports[_0xf397('0x6')]=function(_0x611156){for(var _0x2cc5f7=0x0,_0x197e5a=events[_0xf397('0x7')];_0x2cc5f7<_0x197e5a;_0x2cc5f7++){var _0x2bc9e7=events[_0x2cc5f7];var _0x2170af=createListener(_0xf397('0x8')+_0x2bc9e7,_0x611156);FaxInteractionEvents['on'](_0x2bc9e7,_0x2170af);}}; \ No newline at end of file +var _0x7d61=['emit','removeListener','register','length','./faxInteraction.events','save','update'];(function(_0x5a137c,_0x524bf7){var _0x39b11f=function(_0x5037e1){while(--_0x5037e1){_0x5a137c['push'](_0x5a137c['shift']());}};_0x39b11f(++_0x524bf7);}(_0x7d61,0x185));var _0x17d6=function(_0x4defe6,_0x345e66){_0x4defe6=_0x4defe6-0x0;var _0x288024=_0x7d61[_0x4defe6];return _0x288024;};'use strict';var FaxInteractionEvents=require(_0x17d6('0x0'));var events=[_0x17d6('0x1'),'remove',_0x17d6('0x2')];function createListener(_0x40cc15,_0x5de4ad){return function(_0x399ce6){_0x5de4ad[_0x17d6('0x3')](_0x40cc15,_0x399ce6);};}function removeListener(_0x5907db,_0x43d19f){return function(){FaxInteractionEvents[_0x17d6('0x4')](_0x5907db,_0x43d19f);};}exports[_0x17d6('0x5')]=function(_0x4edf8e){for(var _0x2217b7=0x0,_0x586cbf=events[_0x17d6('0x6')];_0x2217b7<_0x586cbf;_0x2217b7++){var _0x3f3dfc=events[_0x2217b7];var _0xc7d17f=createListener('faxInteraction:'+_0x3f3dfc,_0x4edf8e);FaxInteractionEvents['on'](_0x3f3dfc,_0xc7d17f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index d1a076c..454907f 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 _0x0e38=['delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','fax','addTags','put','faxinteraction:update'];(function(_0x48fa99,_0x1b3544){var _0x30547b=function(_0x1e74e5){while(--_0x1e74e5){_0x48fa99['push'](_0x48fa99['shift']());}};_0x30547b(++_0x1b3544);}(_0x0e38,0x1f3));var _0x80e3=function(_0x58faab,_0x1f257){_0x58faab=_0x58faab-0x0;var _0x46ec13=_0x0e38[_0x58faab];return _0x46ec13;};'use strict';var multer=require(_0x80e3('0x0'));var util=require(_0x80e3('0x1'));var path=require(_0x80e3('0x2'));var timeout=require(_0x80e3('0x3'));var express=require(_0x80e3('0x4'));var router=express[_0x80e3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x80e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x80e3('0x7'));var controller=require(_0x80e3('0x8'));router[_0x80e3('0x9')]('/',auth[_0x80e3('0xa')](),controller[_0x80e3('0xb')]);router[_0x80e3('0x9')](_0x80e3('0xc'),auth['isAuthenticated'](),controller[_0x80e3('0xd')]);router['get'](_0x80e3('0xe'),auth[_0x80e3('0xa')](),controller[_0x80e3('0xf')]);router['get'](_0x80e3('0x10'),auth[_0x80e3('0xa')](),controller[_0x80e3('0x11')]);router[_0x80e3('0x9')](_0x80e3('0x12'),auth['isAuthenticated'](),controller[_0x80e3('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x80e3('0x14')]);router[_0x80e3('0x15')](_0x80e3('0x10'),auth[_0x80e3('0xa')](),controller[_0x80e3('0x16')]);router[_0x80e3('0x15')](_0x80e3('0x17'),auth[_0x80e3('0xa')](),interaction[_0x80e3('0x18')](_0x80e3('0x19'),'faxinteraction:addtags'),controller[_0x80e3('0x1a')]);router[_0x80e3('0x1b')](_0x80e3('0xe'),auth[_0x80e3('0xa')](),interaction['tracked'](_0x80e3('0x19'),_0x80e3('0x1c')),controller['update']);router[_0x80e3('0x1d')](_0x80e3('0xe'),auth[_0x80e3('0xa')](),interaction[_0x80e3('0x18')](_0x80e3('0x19'),_0x80e3('0x1e')),controller['destroy']);router[_0x80e3('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x80e3('0x1f')]);module[_0x80e3('0x20')]=router; \ No newline at end of file +var _0x9264=['describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated'];(function(_0x34b022,_0x2b1f77){var _0x3ccfb7=function(_0x3874e8){while(--_0x3874e8){_0x34b022['push'](_0x34b022['shift']());}};_0x3ccfb7(++_0x2b1f77);}(_0x9264,0xae));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var path=require(_0x4926('0x2'));var timeout=require(_0x4926('0x3'));var express=require('express');var router=express[_0x4926('0x4')]();var fs_extra=require(_0x4926('0x5'));var auth=require(_0x4926('0x6'));var interaction=require(_0x4926('0x7'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x4926('0x8')]('/',auth['isAuthenticated'](),controller[_0x4926('0x9')]);router['get'](_0x4926('0xa'),auth[_0x4926('0xb')](),controller[_0x4926('0xc')]);router[_0x4926('0x8')](_0x4926('0xd'),auth['isAuthenticated'](),controller[_0x4926('0xe')]);router[_0x4926('0x8')](_0x4926('0xf'),auth[_0x4926('0xb')](),controller[_0x4926('0x10')]);router[_0x4926('0x8')](_0x4926('0x11'),auth['isAuthenticated'](),controller[_0x4926('0x12')]);router[_0x4926('0x13')]('/',auth[_0x4926('0xb')](),controller[_0x4926('0x14')]);router['post'](_0x4926('0xf'),auth[_0x4926('0xb')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x4926('0xb')](),interaction[_0x4926('0x15')](_0x4926('0x16'),_0x4926('0x17')),controller[_0x4926('0x18')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x4926('0x15')]('fax',_0x4926('0x19')),controller[_0x4926('0x1a')]);router['delete'](_0x4926('0xd'),auth[_0x4926('0xb')](),interaction[_0x4926('0x15')](_0x4926('0x16'),'faxinteraction:destroy'),controller[_0x4926('0x1b')]);router[_0x4926('0x1c')](_0x4926('0x1d'),auth[_0x4926('0xb')](),controller['removeTags']);module[_0x4926('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 44b6843..be9a696 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 _0x5636=['ENUM','out','DATE','sequelize','exports'];(function(_0x4fa0ea,_0x2cd534){var _0x51d027=function(_0xe67342){while(--_0xe67342){_0x4fa0ea['push'](_0x4fa0ea['shift']());}};_0x51d027(++_0x2cd534);}(_0x5636,0x102));var _0x6563=function(_0x1a2c1e,_0x7b5066){_0x1a2c1e=_0x1a2c1e-0x0;var _0x446072=_0x5636[_0x1a2c1e];return _0x446072;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6563('0x2')]('in',_0x6563('0x3')),'defaultValue':_0x6563('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6563('0x4')]}}; \ No newline at end of file +var _0xb7c8=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x54b5bf,_0x1550f9){var _0x51f4bf=function(_0x380cb8){while(--_0x380cb8){_0x54b5bf['push'](_0x54b5bf['shift']());}};_0x51f4bf(++_0x1550f9);}(_0xb7c8,0x119));var _0x8b7c=function(_0x48f5b5,_0x20b96e){_0x48f5b5=_0x48f5b5-0x0;var _0x37fe37=_0xb7c8[_0x48f5b5];return _0x37fe37;};'use strict';var Sequelize=require('sequelize');module[_0x8b7c('0x0')]={'body':{'type':Sequelize[_0x8b7c('0x1')](_0x8b7c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8b7c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b7c('0x4')]('in',_0x8b7c('0x5')),'defaultValue':_0x8b7c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x8b7c('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 0bf63f6..0357d7b 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 _0x1967=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','end','name','send','index','map','FaxMessage','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filters','filter','where','type','VIRTUAL','include','rows','show','params','rawAttributes','includeAll','merge','options','find','body','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','sequelize','SELECT','contact','User','fullname','email','internal','interface','channel','EventManager','acceptmessage','fax-interactions','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','event','create','findOne','Attachment','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','attachments','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','http','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1967,0x173));var _0x7196=function(_0x181881,_0x4523b2){_0x181881=_0x181881-0x0;var _0x135617=_0x1967[_0x181881];return _0x135617;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];config[_0x7196('0x1c')]=_[_0x7196('0x1d')](config[_0x7196('0x1c')],{'host':_0x7196('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7196('0x1c')]));require(_0x7196('0x1f'))[_0x7196('0x20')](socket);var jayson=require(_0x7196('0x21'));var client=jayson['client'][_0x7196('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x7196('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2590a6,_0xf7e97,_0x3ed1ad,_0x12dce7){return new BPromise(function(_0x2e3e0e,_0x22bd62){var _0x1ed296=_0x12dce7||client;return _0x1ed296[_0x7196('0x23')](_0x2590a6,_0x3ed1ad)[_0x7196('0x24')](function(_0x385f2d){logger['info']('FaxMessage,\x20%s,\x20%s',_0xf7e97,_0x7196('0x25'));logger[_0x7196('0x26')](_0x7196('0x27'),_0xf7e97,'request\x20sent',JSON[_0x7196('0x28')](_0x385f2d));if(_0x385f2d['error']){if(_0x385f2d['error'][_0x7196('0x29')]===0x1f4){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0xf7e97,_0x385f2d['error']['message']);return _0x22bd62(_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);}logger['error'](_0x7196('0x2b'),_0xf7e97,_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);return _0x2e3e0e(_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);}else{logger['info'](_0x7196('0x2b'),_0xf7e97,'request\x20sent');_0x2e3e0e(_0x385f2d[_0x7196('0x2d')][_0x7196('0x2c')]);}})[_0x7196('0x2e')](function(_0xa69810){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0xf7e97,_0xa69810);_0x22bd62(_0xa69810);});});}function respondWithStatusCode(_0x530ab5,_0x57c404){_0x57c404=_0x57c404||0xcc;return function(_0x1482e5){if(_0x1482e5){return _0x530ab5[_0x7196('0x2f')](_0x57c404);}return _0x530ab5[_0x7196('0x30')](_0x57c404)['end']();};}function respondWithResult(_0x5aa538,_0x41cfd2){_0x41cfd2=_0x41cfd2||0xc8;return function(_0x162cfc){if(_0x162cfc){return _0x5aa538[_0x7196('0x30')](_0x41cfd2)['json'](_0x162cfc);}};}function respondWithFilteredResult(_0x35eef9,_0x4ecea1){return function(_0x4fd339){if(_0x4fd339){var _0x59d79d=typeof _0x4ecea1[_0x7196('0x31')]===_0x7196('0x32')&&typeof _0x4ecea1[_0x7196('0x33')]==='undefined';var _0x35116f=_0x4fd339[_0x7196('0x34')];var _0x2f9583=_0x59d79d?0x0:_0x4ecea1[_0x7196('0x31')];var _0x50c386=_0x59d79d?_0x4fd339[_0x7196('0x34')]:_0x4ecea1[_0x7196('0x31')]+_0x4ecea1[_0x7196('0x33')];var _0x651d7e;if(_0x50c386>=_0x35116f){_0x50c386=_0x35116f;_0x651d7e=0xc8;}else{_0x651d7e=0xce;}_0x35eef9[_0x7196('0x30')](_0x651d7e);return _0x35eef9[_0x7196('0x35')](_0x7196('0x36'),_0x2f9583+'-'+_0x50c386+'/'+_0x35116f)[_0x7196('0x37')](_0x4fd339);}return null;};}function patchUpdates(_0x354175){return function(_0xf33b59){try{jsonpatch[_0x7196('0x38')](_0xf33b59,_0x354175,!![]);}catch(_0x54e46b){return BPromise[_0x7196('0x39')](_0x54e46b);}return _0xf33b59['save']();};}function saveUpdates(_0x2452f6,_0x4c3365){return function(_0x372ddc){if(_0x372ddc){return _0x372ddc[_0x7196('0x3a')](_0x2452f6)['then'](function(_0x628e7d){return _0x628e7d;});}return null;};}function removeEntity(_0x2bcadd,_0x4531d7){return function(_0x3a56b4){if(_0x3a56b4){return _0x3a56b4[_0x7196('0x3b')]()['then'](function(){_0x2bcadd[_0x7196('0x30')](0xcc)[_0x7196('0x3c')]();});}};}function handleEntityNotFound(_0x2174ca,_0xf2b652){return function(_0x3e8f98){if(!_0x3e8f98){_0x2174ca[_0x7196('0x2f')](0x194);}return _0x3e8f98;};}function handleError(_0x50a101,_0x23d7aa){_0x23d7aa=_0x23d7aa||0x1f4;return function(_0xe04e44){logger[_0x7196('0x2a')](_0xe04e44['stack']);if(_0xe04e44[_0x7196('0x3d')]){delete _0xe04e44[_0x7196('0x3d')];}_0x50a101[_0x7196('0x30')](_0x23d7aa)[_0x7196('0x3e')](_0xe04e44);};}exports[_0x7196('0x3f')]=function(_0x31fca7,_0x938e49){var _0x1ab720={},_0x92cfb1={},_0x3ee114={'count':0x0,'rows':[]};var _0x5354d3=_[_0x7196('0x40')](db[_0x7196('0x41')]['rawAttributes'],function(_0x186efe){return{'name':_0x186efe['fieldName'],'type':_0x186efe['type'][_0x7196('0x42')]};});_0x92cfb1[_0x7196('0x43')]=_['map'](_0x5354d3,'name');_0x92cfb1[_0x7196('0x44')]=_[_0x7196('0x45')](_0x31fca7[_0x7196('0x44')]);_0x92cfb1['filters']=_[_0x7196('0x46')](_0x92cfb1[_0x7196('0x43')],_0x92cfb1[_0x7196('0x44')]);_0x1ab720[_0x7196('0x47')]=_[_0x7196('0x46')](_0x92cfb1[_0x7196('0x43')],qs[_0x7196('0x48')](_0x31fca7[_0x7196('0x44')]['fields']));_0x1ab720[_0x7196('0x47')]=_0x1ab720[_0x7196('0x47')]['length']?_0x1ab720[_0x7196('0x47')]:_0x92cfb1[_0x7196('0x43')];if(!_0x31fca7['query'][_0x7196('0x49')](_0x7196('0x4a'))){_0x1ab720[_0x7196('0x33')]=qs['limit'](_0x31fca7[_0x7196('0x44')][_0x7196('0x33')]);_0x1ab720['offset']=qs[_0x7196('0x31')](_0x31fca7[_0x7196('0x44')]['offset']);}_0x1ab720[_0x7196('0x4b')]=qs['sort'](_0x31fca7['query']['sort']);_0x1ab720['where']=qs['filters'](_[_0x7196('0x4c')](_0x31fca7['query'],_0x92cfb1[_0x7196('0x4d')]),_0x5354d3);if(_0x31fca7[_0x7196('0x44')][_0x7196('0x4e')]){_0x1ab720[_0x7196('0x4f')]=_['merge'](_0x1ab720[_0x7196('0x4f')],{'$or':_['map'](_0x5354d3,function(_0x12ee76){if(_0x12ee76[_0x7196('0x50')]!==_0x7196('0x51')){var _0x5e34e8={};_0x5e34e8[_0x12ee76[_0x7196('0x3d')]]={'$like':'%'+_0x31fca7[_0x7196('0x44')][_0x7196('0x4e')]+'%'};return _0x5e34e8;}})});}_0x1ab720=_['merge']({},_0x1ab720,_0x31fca7['options']);var _0x1faa7b={'where':_0x1ab720['where']};return db[_0x7196('0x41')]['count'](_0x1faa7b)['then'](function(_0x14b489){_0x3ee114['count']=_0x14b489;if(_0x31fca7['query']['includeAll']){_0x1ab720[_0x7196('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1ab720);})[_0x7196('0x24')](function(_0x182c8b){_0x3ee114[_0x7196('0x53')]=_0x182c8b;return _0x3ee114;})[_0x7196('0x24')](respondWithFilteredResult(_0x938e49,_0x1ab720))['catch'](handleError(_0x938e49,null));};exports[_0x7196('0x54')]=function(_0x564688,_0x36844f){var _0x143c58={'raw':!![],'where':{'id':_0x564688[_0x7196('0x55')]['id']}},_0x513855={};_0x513855[_0x7196('0x43')]=_[_0x7196('0x45')](db['FaxMessage'][_0x7196('0x56')]);_0x513855['query']=_[_0x7196('0x45')](_0x564688[_0x7196('0x44')]);_0x513855[_0x7196('0x4d')]=_[_0x7196('0x46')](_0x513855[_0x7196('0x43')],_0x513855[_0x7196('0x44')]);_0x143c58[_0x7196('0x47')]=_[_0x7196('0x46')](_0x513855['model'],qs['fields'](_0x564688[_0x7196('0x44')][_0x7196('0x48')]));_0x143c58[_0x7196('0x47')]=_0x143c58[_0x7196('0x47')]['length']?_0x143c58[_0x7196('0x47')]:_0x513855[_0x7196('0x43')];if(_0x564688[_0x7196('0x44')][_0x7196('0x57')]){_0x143c58[_0x7196('0x52')]=[{'all':!![]}];}_0x143c58=_[_0x7196('0x58')]({},_0x143c58,_0x564688[_0x7196('0x59')]);return db[_0x7196('0x41')][_0x7196('0x5a')](_0x143c58)[_0x7196('0x24')](handleEntityNotFound(_0x36844f,null))[_0x7196('0x24')](respondWithResult(_0x36844f,null))['catch'](handleError(_0x36844f,null));};exports[_0x7196('0x3a')]=function(_0x6b65c1,_0x10ee13){if(_0x6b65c1['body']['id']){delete _0x6b65c1[_0x7196('0x5b')]['id'];}return db['FaxMessage'][_0x7196('0x5a')]({'where':{'id':_0x6b65c1[_0x7196('0x55')]['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x10ee13,null))[_0x7196('0x24')](saveUpdates(_0x6b65c1[_0x7196('0x5b')],null))['then'](respondWithResult(_0x10ee13,null))[_0x7196('0x2e')](handleError(_0x10ee13,null));};exports['destroy']=function(_0x4be36d,_0x5b9824){return db[_0x7196('0x41')][_0x7196('0x5a')]({'where':{'id':_0x4be36d[_0x7196('0x55')]['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x5b9824,null))[_0x7196('0x24')](removeEntity(_0x5b9824,null))[_0x7196('0x2e')](handleError(_0x5b9824,null));};exports[_0x7196('0x5c')]=function(_0x560ddb,_0x293467){return db[_0x7196('0x41')][_0x7196('0x5c')]()[_0x7196('0x24')](respondWithResult(_0x293467,null))[_0x7196('0x2e')](handleError(_0x293467,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x7196('0x5d')]=function(_0x1c7eb2,_0xeb7e6e,_0x799399){var _0x14cb38={'agent':{},'channel':_0x7196('0x5e')};if(_0x1c7eb2[_0x7196('0x5b')]['id']){delete _0x1c7eb2[_0x7196('0x5b')]['id'];}_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x5f')]=!![];_0x1c7eb2[_0x7196('0x5b')]['readAt']=moment()[_0x7196('0x60')](_0x7196('0x61'));_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x62')]=_0x1c7eb2['body'][_0x7196('0x62')]||_0x1c7eb2[_0x7196('0x63')]['id'];_0x14cb38[_0x7196('0x64')]['id']=_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x62')];return db[_0x7196('0x41')][_0x7196('0x5a')]({'where':{'id':_0x1c7eb2['params']['id'],'UserId':null}})[_0x7196('0x24')](handleEntityNotFound(_0xeb7e6e,null))[_0x7196('0x24')](saveUpdates(_0x1c7eb2[_0x7196('0x5b')],null))[_0x7196('0x24')](function(_0x52827f){if(_0x52827f){_0x14cb38[_0x7196('0x2c')]=_0x52827f[_0x7196('0x65')]({'plain':!![]});return db[_0x7196('0x66')][_0x7196('0x5a')]({'where':{'id':_0x52827f[_0x7196('0x67')]}});}return null;})[_0x7196('0x24')](handleEntityNotFound(_0xeb7e6e,null))[_0x7196('0x24')](function(_0x517dfb){if(_0x517dfb){return _0x517dfb['update']({'UserId':_0x1c7eb2['body'][_0x7196('0x62')],'read1stAt':_['isNil'](_0x517dfb[_0x7196('0x68')])?moment()[_0x7196('0x60')](_0x7196('0x61')):undefined});}return null;})[_0x7196('0x24')](function(_0x1f4f0a){if(_0x1f4f0a){_0x14cb38[_0x7196('0x69')]=_0x1f4f0a[_0x7196('0x65')]({'plain':!![]});interaction_log[_0x7196('0x6a')](_0x7196('0x6b'),_0x1c7eb2['user']['id'],_0x1c7eb2['user'][_0x7196('0x3d')],_0x1c7eb2[_0x7196('0x63')][_0x7196('0x6c')],_0x14cb38[_0x7196('0x69')]['id'],_0x1c7eb2[_0x7196('0x5b')]?JSON[_0x7196('0x28')](_0x1c7eb2[_0x7196('0x5b')]):_0x7196('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x14cb38);}return null;})[_0x7196('0x24')](function(_0x529f56){var _0x30d114='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x529f56[_0x7196('0x2c')][_0x7196('0x6e')];return db[_0x7196('0x6f')][_0x7196('0x44')](_0x30d114,{'type':db['Sequelize']['QueryTypes'][_0x7196('0x70')],'raw':!![]})['then'](function(_0x3d2bee){return _0x3d2bee;});})[_0x7196('0x24')](function(_0x4526e8){if(_0x4526e8){_0x14cb38[_0x7196('0x2c')][_0x7196('0x71')]=_0x4526e8[0x0];if(!_0x1c7eb2[_0x7196('0x5b')]['UserId'])return;return db[_0x7196('0x72')][_0x7196('0x5a')]({'where':{'id':_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x62')],'role':_0x7196('0x64')},'attributes':['id',_0x7196('0x3d'),_0x7196('0x73'),_0x7196('0x74'),_0x7196('0x75')],'raw':!![]});}return null;})[_0x7196('0x24')](function(_0x3d3768){if(!_0x3d3768)return null;_0x14cb38[_0x7196('0x2c')]['agent']=_0x3d3768;return _0x14cb38;})[_0x7196('0x24')](function(_0x13f802){if(_0x13f802){if(_0x1c7eb2['body']['manual']){_0x14cb38[_0x7196('0x2c')][_0x7196('0x76')]=util[_0x7196('0x60')]('SIP/%s',_0x1c7eb2[_0x7196('0x63')]['name']);_0x14cb38[_0x7196('0x2c')][_0x7196('0x77')]=_0x14cb38['channel'];_0x14cb38[_0x7196('0x2c')]['event']='accept';return respondWithRpcPromise(_0x7196('0x78'),_0x7196('0x78'),{'event':_0x7196('0x79'),'message':_0x14cb38['message']},client9002)[_0x7196('0x24')](function(){return _0x14cb38;});}return _0x14cb38;}return null;})['then'](respondWithResult(_0xeb7e6e,null))[_0x7196('0x2e')](handleError(_0xeb7e6e,null));};var interaction_log=require(_0x7196('0x16'))(_0x7196('0x7a'));exports[_0x7196('0x39')]=function(_0x2bb345,_0x5bd2f8,_0x20e96d){var _0x13c8c0={'agent':{},'channel':_0x7196('0x5e')};if(_0x2bb345[_0x7196('0x5b')]['id']){delete _0x2bb345[_0x7196('0x5b')]['id'];}_0x2bb345[_0x7196('0x5b')][_0x7196('0x62')]=_0x2bb345[_0x7196('0x5b')]['UserId']||_0x2bb345[_0x7196('0x63')]['id'];_0x13c8c0[_0x7196('0x64')]['id']=_0x2bb345[_0x7196('0x5b')][_0x7196('0x62')];return db['FaxMessage'][_0x7196('0x5a')]({'where':{'id':_0x2bb345[_0x7196('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5bd2f8,null))[_0x7196('0x24')](function(_0x53d470){if(_0x53d470){_0x13c8c0[_0x7196('0x2c')]=_0x53d470['get']({'plain':!![]});return db[_0x7196('0x66')][_0x7196('0x5a')]({'where':{'id':_0x53d470['FaxInteractionId']}});}return null;})[_0x7196('0x24')](handleEntityNotFound(_0x5bd2f8,null))[_0x7196('0x24')](function(_0x2c2c53){if(_0x2c2c53){_0x13c8c0['interaction']=_0x2c2c53['get']({'plain':!![]});interaction_log[_0x7196('0x6a')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bb345['user']['id'],_0x2bb345[_0x7196('0x63')][_0x7196('0x3d')],_0x2bb345[_0x7196('0x63')]['role'],_0x13c8c0[_0x7196('0x69')]['id'],_0x2bb345[_0x7196('0x5b')]?JSON[_0x7196('0x28')](_0x2bb345[_0x7196('0x5b')]):_0x7196('0x6d'));return respondWithRpcPromise(_0x7196('0x7b'),_0x7196('0x7c'),_0x13c8c0);}return null;})[_0x7196('0x24')](function(_0x32ba47){var _0x446f28=_0x7196('0x7d')+_0x32ba47['message']['ContactId'];return db[_0x7196('0x6f')]['query'](_0x446f28,{'type':db['Sequelize'][_0x7196('0x7e')][_0x7196('0x70')],'raw':!![]})[_0x7196('0x24')](function(_0x3fe7fd){return _0x3fe7fd;});})['then'](function(_0x50f2c4){if(_0x50f2c4){_0x13c8c0[_0x7196('0x2c')][_0x7196('0x71')]=_0x50f2c4[0x0];if(!_0x2bb345[_0x7196('0x5b')][_0x7196('0x62')])return;return db['User'][_0x7196('0x5a')]({'where':{'id':_0x2bb345['body']['UserId'],'role':_0x7196('0x64')},'attributes':['id',_0x7196('0x3d'),_0x7196('0x73'),'email',_0x7196('0x75')],'raw':!![]});}return null;})[_0x7196('0x24')](function(_0x1824e2){if(!_0x1824e2)return null;_0x13c8c0[_0x7196('0x2c')][_0x7196('0x64')]=_0x1824e2;return _0x13c8c0;})[_0x7196('0x24')](function(_0x214ec2){if(_0x214ec2){_0x214ec2[_0x7196('0x2c')]['interface']=util[_0x7196('0x60')](_0x7196('0x7f'),_0x2bb345[_0x7196('0x63')][_0x7196('0x3d')]);_0x214ec2[_0x7196('0x2c')]['channel']=_0x13c8c0[_0x7196('0x77')];_0x214ec2[_0x7196('0x2c')][_0x7196('0x80')]='reject';respondWithRpcPromise(_0x7196('0x78'),'EventManager',{'event':'rejectmessage','message':_0x214ec2[_0x7196('0x2c')]},client9002);return _0x13c8c0;}return null;})[_0x7196('0x24')](respondWithResult(_0x5bd2f8,null))['catch'](handleError(_0x5bd2f8,null));};exports[_0x7196('0x81')]=function(_0x40eb16,_0x48ceda){var _0x4cc782;return db[_0x7196('0x41')][_0x7196('0x81')](_0x40eb16[_0x7196('0x5b')],{})[_0x7196('0x24')](function(_0x34a46c){_0x4cc782=_0x34a46c;return db['CmContact'][_0x7196('0x82')]({'where':{'id':_0x4cc782[_0x7196('0x6e')]}});})[_0x7196('0x24')](function(_0x5b09a1){if(_['isNil'](_0x5b09a1)){return;}else{_0x4cc782['fax']=_0x5b09a1[_0x7196('0x5e')];return db[_0x7196('0x83')][_0x7196('0x82')]({'where':{'id':_0x4cc782['AttachmentId']}});}})[_0x7196('0x24')](function(_0x503d1f){return respondWithRpcPromise(_0x7196('0x84'),'SendFax',{'FaxAccountId':_[_0x7196('0x85')](_0x40eb16[_0x7196('0x5b')])?undefined:_0x40eb16[_0x7196('0x5b')][_0x7196('0x86')],'path':_[_0x7196('0x85')](_0x503d1f)?undefined:util[_0x7196('0x60')](_0x7196('0x87'),_0x503d1f['basename']),'fax':_[_0x7196('0x85')](_0x4cc782['fax'])?undefined:_0x4cc782['fax'],'AttachmentId':_0x4cc782['AttachmentId']},client9002);})['then'](respondWithResult(_0x48ceda,0xc9))['catch'](handleError(_0x48ceda,null));};exports[_0x7196('0x88')]=function(_0x12b032,_0x3fe3f5){var _0x5bab25=path[_0x7196('0x89')](config['root'],'server','files',_0x7196('0x8a'));return db['FaxMessage'][_0x7196('0x5a')]({'where':{'id':_0x12b032[_0x7196('0x55')]['id']},'include':[{'model':db[_0x7196('0x83')],'as':_0x7196('0x83')}]})[_0x7196('0x24')](handleEntityNotFound(_0x3fe3f5,null))[_0x7196('0x24')](function(_0x237a73){if(_0x237a73){return _0x3fe3f5[_0x7196('0x88')](path['join'](_0x5bab25,_0x237a73[_0x7196('0x83')][_0x7196('0x8b')]));}})[_0x7196('0x2e')](handleError(_0x3fe3f5,null));}; \ No newline at end of file +var _0x66fa=['/var/opt/motion2/server/files/attachments/%s','basename','fax','download','server','files','attachments','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','client','http','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','stack','name','index','map','FaxMessage','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','includeAll','include','body','find','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','agent','fullname','email','internal','manual','channel','event','EventManager','acceptmessage','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT','contact','interface','SIP/%s','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId'];(function(_0x5e718f,_0x204430){var _0x3a2594=function(_0x323e1a){while(--_0x323e1a){_0x5e718f['push'](_0x5e718f['shift']());}};_0x3a2594(++_0x204430);}(_0x66fa,0x117));var _0xa66f=function(_0x3d9c3b,_0x42cde0){_0x3d9c3b=_0x3d9c3b-0x0;var _0x37ffc1=_0x66fa[_0x3d9c3b];return _0x37ffc1;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];config[_0xa66f('0x15')]=_[_0xa66f('0x16')](config[_0xa66f('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa66f('0x15')]));require('./faxMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x17')][_0xa66f('0x18')]({'port':0x232c});var client9002=jayson[_0xa66f('0x17')][_0xa66f('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xd348f9,_0x567d4f,_0x5510dc,_0x19b5ac){return new BPromise(function(_0x32d338,_0x295acf){var _0x403f4d=_0x19b5ac||client;return _0x403f4d['request'](_0xd348f9,_0x5510dc)[_0xa66f('0x19')](function(_0x55b59d){logger['info'](_0xa66f('0x1a'),_0x567d4f,_0xa66f('0x1b'));logger[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x567d4f,_0xa66f('0x1b'),JSON[_0xa66f('0x1e')](_0x55b59d));if(_0x55b59d[_0xa66f('0x1f')]){if(_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x20')]===0x1f4){logger[_0xa66f('0x1f')](_0xa66f('0x1a'),_0x567d4f,_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);return _0x295acf(_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);}logger['error'](_0xa66f('0x1a'),_0x567d4f,_0x55b59d[_0xa66f('0x1f')][_0xa66f('0x21')]);return _0x32d338(_0x55b59d[_0xa66f('0x1f')]['message']);}else{logger[_0xa66f('0x22')](_0xa66f('0x1a'),_0x567d4f,_0xa66f('0x1b'));_0x32d338(_0x55b59d[_0xa66f('0x23')]['message']);}})['catch'](function(_0xed98b9){logger['error'](_0xa66f('0x1a'),_0x567d4f,_0xed98b9);_0x295acf(_0xed98b9);});});}function respondWithStatusCode(_0xc661f2,_0x384164){_0x384164=_0x384164||0xcc;return function(_0x57da7f){if(_0x57da7f){return _0xc661f2[_0xa66f('0x24')](_0x384164);}return _0xc661f2[_0xa66f('0x25')](_0x384164)[_0xa66f('0x26')]();};}function respondWithResult(_0x238eb2,_0x17c103){_0x17c103=_0x17c103||0xc8;return function(_0x236046){if(_0x236046){return _0x238eb2[_0xa66f('0x25')](_0x17c103)[_0xa66f('0x27')](_0x236046);}};}function respondWithFilteredResult(_0x20ee67,_0x117d03){return function(_0x45f71c){if(_0x45f71c){var _0x63650b=typeof _0x117d03[_0xa66f('0x28')]===_0xa66f('0x29')&&typeof _0x117d03['limit']==='undefined';var _0x38daac=_0x45f71c[_0xa66f('0x2a')];var _0x55f309=_0x63650b?0x0:_0x117d03[_0xa66f('0x28')];var _0x2de5f3=_0x63650b?_0x45f71c['count']:_0x117d03[_0xa66f('0x28')]+_0x117d03[_0xa66f('0x2b')];var _0x9d78d5;if(_0x2de5f3>=_0x38daac){_0x2de5f3=_0x38daac;_0x9d78d5=0xc8;}else{_0x9d78d5=0xce;}_0x20ee67[_0xa66f('0x25')](_0x9d78d5);return _0x20ee67[_0xa66f('0x2c')]('Content-Range',_0x55f309+'-'+_0x2de5f3+'/'+_0x38daac)[_0xa66f('0x27')](_0x45f71c);}return null;};}function patchUpdates(_0x4fcdc1){return function(_0x306b35){try{jsonpatch[_0xa66f('0x2d')](_0x306b35,_0x4fcdc1,!![]);}catch(_0x2e4dc8){return BPromise['reject'](_0x2e4dc8);}return _0x306b35[_0xa66f('0x2e')]();};}function saveUpdates(_0xadc17d,_0x4f1668){return function(_0x1a5d4a){if(_0x1a5d4a){return _0x1a5d4a[_0xa66f('0x2f')](_0xadc17d)[_0xa66f('0x19')](function(_0x3e7ac5){return _0x3e7ac5;});}return null;};}function removeEntity(_0x10a782,_0x2452d2){return function(_0x25c74c){if(_0x25c74c){return _0x25c74c[_0xa66f('0x30')]()[_0xa66f('0x19')](function(){_0x10a782[_0xa66f('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17984d,_0x5bf736){return function(_0x1c7eda){if(!_0x1c7eda){_0x17984d[_0xa66f('0x24')](0x194);}return _0x1c7eda;};}function handleError(_0x9c7756,_0x3b9261){_0x3b9261=_0x3b9261||0x1f4;return function(_0x3722d3){logger[_0xa66f('0x1f')](_0x3722d3[_0xa66f('0x31')]);if(_0x3722d3[_0xa66f('0x32')]){delete _0x3722d3['name'];}_0x9c7756[_0xa66f('0x25')](_0x3b9261)['send'](_0x3722d3);};}exports[_0xa66f('0x33')]=function(_0x45eeb8,_0x2ed1fb){var _0x47b21a={},_0x4d60f9={},_0x1b9174={'count':0x0,'rows':[]};var _0x4214db=_[_0xa66f('0x34')](db[_0xa66f('0x35')][_0xa66f('0x36')],function(_0x581dca){return{'name':_0x581dca['fieldName'],'type':_0x581dca['type'][_0xa66f('0x37')]};});_0x4d60f9['model']=_['map'](_0x4214db,'name');_0x4d60f9[_0xa66f('0x38')]=_['keys'](_0x45eeb8[_0xa66f('0x38')]);_0x4d60f9[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x4d60f9[_0xa66f('0x3b')],_0x4d60f9[_0xa66f('0x38')]);_0x47b21a[_0xa66f('0x3c')]=_[_0xa66f('0x3a')](_0x4d60f9[_0xa66f('0x3b')],qs[_0xa66f('0x3d')](_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x3d')]));_0x47b21a[_0xa66f('0x3c')]=_0x47b21a[_0xa66f('0x3c')][_0xa66f('0x3e')]?_0x47b21a['attributes']:_0x4d60f9[_0xa66f('0x3b')];if(!_0x45eeb8[_0xa66f('0x38')]['hasOwnProperty'](_0xa66f('0x3f'))){_0x47b21a['limit']=qs[_0xa66f('0x2b')](_0x45eeb8[_0xa66f('0x38')]['limit']);_0x47b21a[_0xa66f('0x28')]=qs[_0xa66f('0x28')](_0x45eeb8[_0xa66f('0x38')]['offset']);}_0x47b21a[_0xa66f('0x40')]=qs['sort'](_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x41')]);_0x47b21a[_0xa66f('0x42')]=qs[_0xa66f('0x39')](_[_0xa66f('0x43')](_0x45eeb8[_0xa66f('0x38')],_0x4d60f9[_0xa66f('0x39')]),_0x4214db);if(_0x45eeb8['query'][_0xa66f('0x44')]){_0x47b21a[_0xa66f('0x42')]=_[_0xa66f('0x45')](_0x47b21a[_0xa66f('0x42')],{'$or':_[_0xa66f('0x34')](_0x4214db,function(_0x50a5ac){if(_0x50a5ac['type']!==_0xa66f('0x46')){var _0x356b7c={};_0x356b7c[_0x50a5ac[_0xa66f('0x32')]]={'$like':'%'+_0x45eeb8[_0xa66f('0x38')][_0xa66f('0x44')]+'%'};return _0x356b7c;}})});}_0x47b21a=_[_0xa66f('0x45')]({},_0x47b21a,_0x45eeb8['options']);var _0x18f1b5={'where':_0x47b21a[_0xa66f('0x42')]};return db[_0xa66f('0x35')]['count'](_0x18f1b5)['then'](function(_0x4568f7){_0x1b9174[_0xa66f('0x2a')]=_0x4568f7;if(_0x45eeb8[_0xa66f('0x38')]['includeAll']){_0x47b21a['include']=[{'all':!![]}];}return db['FaxMessage'][_0xa66f('0x47')](_0x47b21a);})[_0xa66f('0x19')](function(_0x40d3b6){_0x1b9174[_0xa66f('0x48')]=_0x40d3b6;return _0x1b9174;})[_0xa66f('0x19')](respondWithFilteredResult(_0x2ed1fb,_0x47b21a))[_0xa66f('0x49')](handleError(_0x2ed1fb,null));};exports[_0xa66f('0x4a')]=function(_0x15de06,_0x56758a){var _0x1a299c={'raw':!![],'where':{'id':_0x15de06[_0xa66f('0x4b')]['id']}},_0x962415={};_0x962415[_0xa66f('0x3b')]=_[_0xa66f('0x4c')](db[_0xa66f('0x35')]['rawAttributes']);_0x962415[_0xa66f('0x38')]=_[_0xa66f('0x4c')](_0x15de06[_0xa66f('0x38')]);_0x962415[_0xa66f('0x39')]=_[_0xa66f('0x3a')](_0x962415['model'],_0x962415[_0xa66f('0x38')]);_0x1a299c['attributes']=_[_0xa66f('0x3a')](_0x962415['model'],qs['fields'](_0x15de06[_0xa66f('0x38')][_0xa66f('0x3d')]));_0x1a299c[_0xa66f('0x3c')]=_0x1a299c[_0xa66f('0x3c')][_0xa66f('0x3e')]?_0x1a299c[_0xa66f('0x3c')]:_0x962415['model'];if(_0x15de06[_0xa66f('0x38')][_0xa66f('0x4d')]){_0x1a299c[_0xa66f('0x4e')]=[{'all':!![]}];}_0x1a299c=_[_0xa66f('0x45')]({},_0x1a299c,_0x15de06['options']);return db[_0xa66f('0x35')]['find'](_0x1a299c)[_0xa66f('0x19')](handleEntityNotFound(_0x56758a,null))[_0xa66f('0x19')](respondWithResult(_0x56758a,null))[_0xa66f('0x49')](handleError(_0x56758a,null));};exports[_0xa66f('0x2f')]=function(_0x167015,_0x3a201f){if(_0x167015[_0xa66f('0x4f')]['id']){delete _0x167015['body']['id'];}return db[_0xa66f('0x35')][_0xa66f('0x50')]({'where':{'id':_0x167015[_0xa66f('0x4b')]['id']}})[_0xa66f('0x19')](handleEntityNotFound(_0x3a201f,null))[_0xa66f('0x19')](saveUpdates(_0x167015[_0xa66f('0x4f')],null))[_0xa66f('0x19')](respondWithResult(_0x3a201f,null))[_0xa66f('0x49')](handleError(_0x3a201f,null));};exports[_0xa66f('0x30')]=function(_0x4dfede,_0x5aed74){return db[_0xa66f('0x35')][_0xa66f('0x50')]({'where':{'id':_0x4dfede[_0xa66f('0x4b')]['id']}})[_0xa66f('0x19')](handleEntityNotFound(_0x5aed74,null))[_0xa66f('0x19')](removeEntity(_0x5aed74,null))[_0xa66f('0x49')](handleError(_0x5aed74,null));};exports[_0xa66f('0x51')]=function(_0x4b10cf,_0x1709eb){return db[_0xa66f('0x35')][_0xa66f('0x51')]()[_0xa66f('0x19')](respondWithResult(_0x1709eb,null))['catch'](handleError(_0x1709eb,null));};var interaction_log=require(_0xa66f('0x12'))(_0xa66f('0x52'));exports[_0xa66f('0x53')]=function(_0x3bf85a,_0x19f4b5,_0x400a46){var _0x509fc2={'agent':{},'channel':'fax'};if(_0x3bf85a[_0xa66f('0x4f')]['id']){delete _0x3bf85a[_0xa66f('0x4f')]['id'];}_0x3bf85a[_0xa66f('0x4f')]['read']=!![];_0x3bf85a[_0xa66f('0x4f')][_0xa66f('0x54')]=moment()[_0xa66f('0x55')](_0xa66f('0x56'));_0x3bf85a[_0xa66f('0x4f')][_0xa66f('0x57')]=_0x3bf85a[_0xa66f('0x4f')][_0xa66f('0x57')]||_0x3bf85a[_0xa66f('0x58')]['id'];_0x509fc2['agent']['id']=_0x3bf85a[_0xa66f('0x4f')][_0xa66f('0x57')];return db[_0xa66f('0x35')][_0xa66f('0x50')]({'where':{'id':_0x3bf85a[_0xa66f('0x4b')]['id'],'UserId':null}})[_0xa66f('0x19')](handleEntityNotFound(_0x19f4b5,null))[_0xa66f('0x19')](saveUpdates(_0x3bf85a[_0xa66f('0x4f')],null))['then'](function(_0x52f22d){if(_0x52f22d){_0x509fc2[_0xa66f('0x21')]=_0x52f22d[_0xa66f('0x59')]({'plain':!![]});return db[_0xa66f('0x5a')][_0xa66f('0x50')]({'where':{'id':_0x52f22d[_0xa66f('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x19f4b5,null))[_0xa66f('0x19')](function(_0x4c2b68){if(_0x4c2b68){return _0x4c2b68[_0xa66f('0x2f')]({'UserId':_0x3bf85a[_0xa66f('0x4f')][_0xa66f('0x57')],'read1stAt':_[_0xa66f('0x5c')](_0x4c2b68['read1stAt'])?moment()[_0xa66f('0x55')](_0xa66f('0x56')):undefined});}return null;})[_0xa66f('0x19')](function(_0x46ea11){if(_0x46ea11){_0x509fc2[_0xa66f('0x5d')]=_0x46ea11[_0xa66f('0x59')]({'plain':!![]});interaction_log[_0xa66f('0x22')](_0xa66f('0x5e'),_0x3bf85a[_0xa66f('0x58')]['id'],_0x3bf85a[_0xa66f('0x58')][_0xa66f('0x32')],_0x3bf85a[_0xa66f('0x58')]['role'],_0x509fc2[_0xa66f('0x5d')]['id'],_0x3bf85a[_0xa66f('0x4f')]?JSON[_0xa66f('0x1e')](_0x3bf85a[_0xa66f('0x4f')]):_0xa66f('0x5f'));return respondWithRpcPromise(_0xa66f('0x60'),_0xa66f('0x61'),_0x509fc2);}return null;})[_0xa66f('0x19')](function(_0x4df1f5){var _0x5173f0=_0xa66f('0x62')+_0x4df1f5[_0xa66f('0x21')][_0xa66f('0x63')];return db[_0xa66f('0x64')][_0xa66f('0x38')](_0x5173f0,{'type':db[_0xa66f('0x65')][_0xa66f('0x66')]['SELECT'],'raw':!![]})['then'](function(_0xd7191){return _0xd7191;});})[_0xa66f('0x19')](function(_0x34a590){if(_0x34a590){_0x509fc2['message']['contact']=_0x34a590[0x0];if(!_0x3bf85a[_0xa66f('0x4f')][_0xa66f('0x57')])return;return db[_0xa66f('0x67')][_0xa66f('0x50')]({'where':{'id':_0x3bf85a['body'][_0xa66f('0x57')],'role':_0xa66f('0x68')},'attributes':['id',_0xa66f('0x32'),_0xa66f('0x69'),_0xa66f('0x6a'),_0xa66f('0x6b')],'raw':!![]});}return null;})[_0xa66f('0x19')](function(_0x1396ae){if(!_0x1396ae)return null;_0x509fc2['message'][_0xa66f('0x68')]=_0x1396ae;return _0x509fc2;})[_0xa66f('0x19')](function(_0x5c6c40){if(_0x5c6c40){if(_0x3bf85a['body'][_0xa66f('0x6c')]){_0x509fc2[_0xa66f('0x21')]['interface']=util[_0xa66f('0x55')]('SIP/%s',_0x3bf85a[_0xa66f('0x58')]['name']);_0x509fc2['message']['channel']=_0x509fc2[_0xa66f('0x6d')];_0x509fc2[_0xa66f('0x21')][_0xa66f('0x6e')]=_0xa66f('0x53');return respondWithRpcPromise(_0xa66f('0x6f'),_0xa66f('0x6f'),{'event':_0xa66f('0x70'),'message':_0x509fc2[_0xa66f('0x21')]},client9002)[_0xa66f('0x19')](function(){return _0x509fc2;});}return _0x509fc2;}return null;})[_0xa66f('0x19')](respondWithResult(_0x19f4b5,null))[_0xa66f('0x49')](handleError(_0x19f4b5,null));};var interaction_log=require(_0xa66f('0x12'))(_0xa66f('0x52'));exports[_0xa66f('0x71')]=function(_0x5a7b97,_0x378538,_0x54a4af){var _0x2c18d9={'agent':{},'channel':'fax'};if(_0x5a7b97[_0xa66f('0x4f')]['id']){delete _0x5a7b97['body']['id'];}_0x5a7b97[_0xa66f('0x4f')][_0xa66f('0x57')]=_0x5a7b97[_0xa66f('0x4f')]['UserId']||_0x5a7b97['user']['id'];_0x2c18d9[_0xa66f('0x68')]['id']=_0x5a7b97[_0xa66f('0x4f')][_0xa66f('0x57')];return db[_0xa66f('0x35')][_0xa66f('0x50')]({'where':{'id':_0x5a7b97[_0xa66f('0x4b')]['id'],'UserId':null}})[_0xa66f('0x19')](handleEntityNotFound(_0x378538,null))['then'](function(_0x4013b9){if(_0x4013b9){_0x2c18d9[_0xa66f('0x21')]=_0x4013b9[_0xa66f('0x59')]({'plain':!![]});return db[_0xa66f('0x5a')][_0xa66f('0x50')]({'where':{'id':_0x4013b9[_0xa66f('0x5b')]}});}return null;})[_0xa66f('0x19')](handleEntityNotFound(_0x378538,null))[_0xa66f('0x19')](function(_0x15bff2){if(_0x15bff2){_0x2c18d9[_0xa66f('0x5d')]=_0x15bff2[_0xa66f('0x59')]({'plain':!![]});interaction_log[_0xa66f('0x22')](_0xa66f('0x72'),_0x5a7b97['user']['id'],_0x5a7b97[_0xa66f('0x58')][_0xa66f('0x32')],_0x5a7b97[_0xa66f('0x58')][_0xa66f('0x73')],_0x2c18d9[_0xa66f('0x5d')]['id'],_0x5a7b97[_0xa66f('0x4f')]?JSON[_0xa66f('0x1e')](_0x5a7b97[_0xa66f('0x4f')]):_0xa66f('0x5f'));return respondWithRpcPromise('RejectMessage',_0xa66f('0x74'),_0x2c18d9);}return null;})['then'](function(_0x57a828){var _0x5e19c5=_0xa66f('0x62')+_0x57a828['message'][_0xa66f('0x63')];return db['sequelize'][_0xa66f('0x38')](_0x5e19c5,{'type':db[_0xa66f('0x65')][_0xa66f('0x66')][_0xa66f('0x75')],'raw':!![]})[_0xa66f('0x19')](function(_0x4539ab){return _0x4539ab;});})['then'](function(_0x214ed2){if(_0x214ed2){_0x2c18d9[_0xa66f('0x21')][_0xa66f('0x76')]=_0x214ed2[0x0];if(!_0x5a7b97['body'][_0xa66f('0x57')])return;return db[_0xa66f('0x67')]['find']({'where':{'id':_0x5a7b97[_0xa66f('0x4f')][_0xa66f('0x57')],'role':'agent'},'attributes':['id','name',_0xa66f('0x69'),_0xa66f('0x6a'),_0xa66f('0x6b')],'raw':!![]});}return null;})[_0xa66f('0x19')](function(_0x2ad891){if(!_0x2ad891)return null;_0x2c18d9['message'][_0xa66f('0x68')]=_0x2ad891;return _0x2c18d9;})[_0xa66f('0x19')](function(_0x4ebc0f){if(_0x4ebc0f){_0x4ebc0f[_0xa66f('0x21')][_0xa66f('0x77')]=util['format'](_0xa66f('0x78'),_0x5a7b97[_0xa66f('0x58')][_0xa66f('0x32')]);_0x4ebc0f[_0xa66f('0x21')][_0xa66f('0x6d')]=_0x2c18d9['channel'];_0x4ebc0f[_0xa66f('0x21')][_0xa66f('0x6e')]=_0xa66f('0x71');respondWithRpcPromise(_0xa66f('0x6f'),_0xa66f('0x6f'),{'event':_0xa66f('0x79'),'message':_0x4ebc0f['message']},client9002);return _0x2c18d9;}return null;})[_0xa66f('0x19')](respondWithResult(_0x378538,null))[_0xa66f('0x49')](handleError(_0x378538,null));};exports[_0xa66f('0x7a')]=function(_0x1b7bf7,_0x1ffcf0){var _0x2b74ba;return db[_0xa66f('0x35')]['create'](_0x1b7bf7['body'],{})[_0xa66f('0x19')](function(_0x5bde35){_0x2b74ba=_0x5bde35;return db[_0xa66f('0x7b')][_0xa66f('0x7c')]({'where':{'id':_0x2b74ba['ContactId']}});})[_0xa66f('0x19')](function(_0x3bd880){if(_[_0xa66f('0x5c')](_0x3bd880)){return;}else{_0x2b74ba['fax']=_0x3bd880['fax'];return db[_0xa66f('0x7d')]['findOne']({'where':{'id':_0x2b74ba[_0xa66f('0x7e')]}});}})[_0xa66f('0x19')](function(_0x38b722){return respondWithRpcPromise('SendFax',_0xa66f('0x7f'),{'FaxAccountId':_['isNil'](_0x1b7bf7[_0xa66f('0x4f')])?undefined:_0x1b7bf7[_0xa66f('0x4f')][_0xa66f('0x80')],'path':_[_0xa66f('0x5c')](_0x38b722)?undefined:util['format'](_0xa66f('0x81'),_0x38b722[_0xa66f('0x82')]),'fax':_[_0xa66f('0x5c')](_0x2b74ba[_0xa66f('0x83')])?undefined:_0x2b74ba[_0xa66f('0x83')],'AttachmentId':_0x2b74ba[_0xa66f('0x7e')]},client9002);})['then'](respondWithResult(_0x1ffcf0,0xc9))[_0xa66f('0x49')](handleError(_0x1ffcf0,null));};exports[_0xa66f('0x84')]=function(_0xef3e9d,_0x2a893e){var _0x73ce06=path['join'](config['root'],_0xa66f('0x85'),_0xa66f('0x86'),_0xa66f('0x87'));return db[_0xa66f('0x35')][_0xa66f('0x50')]({'where':{'id':_0xef3e9d[_0xa66f('0x4b')]['id']},'include':[{'model':db[_0xa66f('0x7d')],'as':_0xa66f('0x7d')}]})[_0xa66f('0x19')](handleEntityNotFound(_0x2a893e,null))[_0xa66f('0x19')](function(_0x1cdbf5){if(_0x1cdbf5){return _0x2a893e[_0xa66f('0x84')](path['join'](_0x73ce06,_0x1cdbf5[_0xa66f('0x7d')][_0xa66f('0x82')]));}})['catch'](handleError(_0x2a893e,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 30e0f53..b573d46 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 _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','update','remove'];(function(_0x5dc684,_0xf3e38c){var _0x138b5a=function(_0x45e275){while(--_0x45e275){_0x5dc684['push'](_0x5dc684['shift']());}};_0x138b5a(++_0xf3e38c);}(_0xd634,0xf4));var _0x4d63=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xd634[_0x247fa1];return _0x244f35;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){FaxMessageEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);FaxMessageEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];FaxMessage[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xcfef=['../../mysqldb','FaxMessage','setMaxListeners','emit','hook'];(function(_0x18c191,_0x132a41){var _0x57f71c=function(_0x338371){while(--_0x338371){_0x18c191['push'](_0x18c191['shift']());}};_0x57f71c(++_0x132a41);}(_0xcfef,0x1cc));var _0xfcfe=function(_0x2eb994,_0x5e6a40){_0x2eb994=_0x2eb994-0x0;var _0x2d27e6=_0xcfef[_0x2eb994];return _0x2d27e6;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xfcfe('0x0'))['db'][_0xfcfe('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xfcfe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5e80c9){return function(_0x1bee79,_0x21c122,_0x3abede){FaxMessageEvents[_0xfcfe('0x3')](_0x5e80c9+':'+_0x1bee79['id'],_0x1bee79);FaxMessageEvents['emit'](_0x5e80c9,_0x1bee79);_0x3abede(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xfcfe('0x4')](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 56b9ade..620f67f 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 _0x6b12=['api','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x272ab5,_0x58a1be){var _0x37f52f=function(_0x437868){while(--_0x437868){_0x272ab5['push'](_0x272ab5['shift']());}};_0x37f52f(++_0x58a1be);}(_0x6b12,0x193));var _0x26b1=function(_0x51d3b1,_0x21fc0f){_0x51d3b1=_0x51d3b1-0x0;var _0x205d36=_0x6b12[_0x51d3b1];return _0x205d36;};'use strict';var _=require(_0x26b1('0x0'));var util=require(_0x26b1('0x1'));var logger=require('../../config/logger')(_0x26b1('0x2'));var moment=require(_0x26b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x26b1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26b1('0x5'));var config=require(_0x26b1('0x6'));var attributes=require(_0x26b1('0x7'));module['exports']=function(_0x29a61e,_0xeead96){return _0x29a61e[_0x26b1('0x8')](_0x26b1('0x9'),attributes,{'tableName':_0x26b1('0xa'),'paranoid':![],'indexes':[{'name':_0x26b1('0xb'),'fields':[_0x26b1('0xc')],'type':_0x26b1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf2a2b1,_0x185912,_0x2bd324){var _0x10f365=_0x29a61e[_0x26b1('0xe')];var _0x4929d8=_0xf2a2b1['get']({'plain':!![]});if(_0x4929d8['direction']['toLowerCase']()==='in'||_0x4929d8['direction'][_0x26b1('0xf')]()===_0x26b1('0x10')&&!_0x4929d8[_0x26b1('0x11')]&&!_[_0x26b1('0x12')](_0x4929d8[_0x26b1('0x13')])){_0x10f365['FaxInteraction'][_0x26b1('0x14')]({'where':{'id':_0x4929d8[_0x26b1('0x15')]}})['then'](function(_0x51f632){if(_0x51f632){_0x51f632[_0x26b1('0x16')]({'lastMsgAt':_0x4929d8[_0x26b1('0x17')],'lastMsgDirection':_0x4929d8['direction'][_0x26b1('0xf')]()});}})['catch'](function(_0x583e40){console[_0x26b1('0x18')](_0x583e40);});}_0x2bd324();}},'charset':_0x26b1('0x19'),'collate':_0x26b1('0x1a')});}; \ No newline at end of file +var _0x6674=['toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction'];(function(_0x58e677,_0x43219e){var _0xa18f27=function(_0x11907b){while(--_0x11907b){_0x58e677['push'](_0x58e677['shift']());}};_0xa18f27(++_0x43219e);}(_0x6674,0x1b1));var _0x4667=function(_0x5bb7f8,_0x2c1deb){_0x5bb7f8=_0x5bb7f8-0x0;var _0x42962b=_0x6674[_0x5bb7f8];return _0x42962b;};'use strict';var _=require(_0x4667('0x0'));var util=require(_0x4667('0x1'));var logger=require('../../config/logger')(_0x4667('0x2'));var moment=require(_0x4667('0x3'));var BPromise=require(_0x4667('0x4'));var rp=require(_0x4667('0x5'));var fs=require('fs');var path=require(_0x4667('0x6'));var rimraf=require(_0x4667('0x7'));var config=require('../../config/environment');var attributes=require(_0x4667('0x8'));module['exports']=function(_0x25470f,_0x303b65){return _0x25470f[_0x4667('0x9')]('FaxMessage',attributes,{'tableName':_0x4667('0xa'),'paranoid':![],'indexes':[{'name':_0x4667('0xb'),'fields':[_0x4667('0xc')],'type':_0x4667('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x989f90,_0x43959b,_0x4aef36){var _0x278e1a=_0x25470f[_0x4667('0xe')];var _0x2d2c2b=_0x989f90[_0x4667('0xf')]({'plain':!![]});if(_0x2d2c2b[_0x4667('0x10')][_0x4667('0x11')]()==='in'||_0x2d2c2b[_0x4667('0x10')][_0x4667('0x11')]()===_0x4667('0x12')&&!_0x2d2c2b[_0x4667('0x13')]&&!_[_0x4667('0x14')](_0x2d2c2b[_0x4667('0x15')])){_0x278e1a[_0x4667('0x16')][_0x4667('0x17')]({'where':{'id':_0x2d2c2b[_0x4667('0x18')]}})[_0x4667('0x19')](function(_0x102f2d){if(_0x102f2d){_0x102f2d[_0x4667('0x1a')]({'lastMsgAt':_0x2d2c2b['createdAt'],'lastMsgDirection':_0x2d2c2b[_0x4667('0x10')][_0x4667('0x11')]()});}})['catch'](function(_0x7bdaa2){console[_0x4667('0x1b')](_0x7bdaa2);});}_0x4aef36();}},'charset':_0x4667('0x1c'),'collate':_0x4667('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a009dd3..be2604f 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 _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x156750,_0x5d6c6f){var _0x4d7864=function(_0x5f4277){while(--_0x5f4277){_0x156750['push'](_0x156750['shift']());}};_0x4d7864(++_0x5d6c6f);}(_0x032e,0x124));var _0xe032=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x032e[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});}; \ No newline at end of file +var _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xed1f,0x6a));var _0xfed1=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xed1f[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8cc5b8a..0af0b88 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 _0x191c=['register','length','faxMessage:','./faxMessage.events','save','removeListener'];(function(_0x33edb5,_0x4e59d1){var _0x525435=function(_0x4b161b){while(--_0x4b161b){_0x33edb5['push'](_0x33edb5['shift']());}};_0x525435(++_0x4e59d1);}(_0x191c,0xb1));var _0xc191=function(_0xd7e22f,_0x2a75cd){_0xd7e22f=_0xd7e22f-0x0;var _0x354650=_0x191c[_0xd7e22f];return _0x354650;};'use strict';var FaxMessageEvents=require(_0xc191('0x0'));var events=[_0xc191('0x1'),'remove','update'];function createListener(_0x5c179c,_0x38b155){return function(_0x3066ac){_0x38b155['emit'](_0x5c179c,_0x3066ac);};}function removeListener(_0x397542,_0x4e892e){return function(){FaxMessageEvents[_0xc191('0x2')](_0x397542,_0x4e892e);};}exports[_0xc191('0x3')]=function(_0x4510a3){for(var _0x260641=0x0,_0x4f69ff=events[_0xc191('0x4')];_0x260641<_0x4f69ff;_0x260641++){var _0x317208=events[_0x260641];var _0x59cb62=createListener(_0xc191('0x5')+_0x317208,_0x4510a3);FaxMessageEvents['on'](_0x317208,_0x59cb62);}}; \ No newline at end of file +var _0x3b6e=['save','update','emit','removeListener','register','length','./faxMessage.events'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x3b6e,0xdf));var _0xe3b6=function(_0x18e4f7,_0xbc1278){_0x18e4f7=_0x18e4f7-0x0;var _0x3db117=_0x3b6e[_0x18e4f7];return _0x3db117;};'use strict';var FaxMessageEvents=require(_0xe3b6('0x0'));var events=[_0xe3b6('0x1'),'remove',_0xe3b6('0x2')];function createListener(_0x35ffd0,_0x1c188a){return function(_0x19cd78){_0x1c188a[_0xe3b6('0x3')](_0x35ffd0,_0x19cd78);};}function removeListener(_0x585d74,_0xe73072){return function(){FaxMessageEvents[_0xe3b6('0x4')](_0x585d74,_0xe73072);};}exports[_0xe3b6('0x5')]=function(_0x6a15a3){for(var _0xe0024e=0x0,_0x2d5277=events[_0xe3b6('0x6')];_0xe0024e<_0x2d5277;_0xe0024e++){var _0x3ece70=events[_0xe0024e];var _0x4c9b2c=createListener('faxMessage:'+_0x3ece70,_0x6a15a3);FaxMessageEvents['on'](_0x3ece70,_0x4c9b2c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b2f48fa..176e8a9 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 _0xcea2=['create','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x8b1a5e,_0x2744eb){var _0x1146b1=function(_0x5a9f50){while(--_0x5a9f50){_0x8b1a5e['push'](_0x8b1a5e['shift']());}};_0x1146b1(++_0x2744eb);}(_0xcea2,0x15a));var _0x2cea=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcea2[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0xd')]);router[_0x2cea('0x9')](_0x2cea('0xe'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xf')]);router[_0x2cea('0x10')]('/',auth[_0x2cea('0x8')](),interaction[_0x2cea('0x11')]('fax','faxmessage:create'),controller[_0x2cea('0x12')]);router[_0x2cea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2cea('0x14')]);router['put'](_0x2cea('0x15'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x2cea('0x17')]);router['delete'](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x18')]);module[_0x2cea('0x19')]=router; \ No newline at end of file +var _0x9354=['describe','/:id','show','/:id/download','download','post','fax','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x1d2b4b,_0x315d28){var _0xfb42ac=function(_0x29127f){while(--_0x29127f){_0x1d2b4b['push'](_0x1d2b4b['shift']());}};_0xfb42ac(++_0x315d28);}(_0x9354,0x96));var _0x4935=function(_0x35825e,_0x657421){_0x35825e=_0x35825e-0x0;var _0x4f4d90=_0x9354[_0x35825e];return _0x4f4d90;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4935('0x12'),'faxmessage:create'),controller['create']);router[_0x4935('0x13')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x13')](_0x4935('0x15'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);router[_0x4935('0x13')](_0x4935('0x17'),auth[_0x4935('0x9')](),controller[_0x4935('0x18')]);router[_0x4935('0x19')](_0x4935('0xd'),auth[_0x4935('0x9')](),controller[_0x4935('0x1a')]);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 e6a8f80..92ed76a 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 _0x1cd0=['roundrobin','exports','STRING','INTEGER','beepall'];(function(_0x427956,_0x2d1ec2){var _0x55ba46=function(_0x37ab97){while(--_0x37ab97){_0x427956['push'](_0x427956['shift']());}};_0x55ba46(++_0x2d1ec2);}(_0x1cd0,0x1e1));var _0x01cd=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1cd0[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require('sequelize');module[_0x01cd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x01cd('0x1')]},'timeout':{'type':Sequelize[_0x01cd('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x01cd('0x3'),_0x01cd('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4e32=['exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x1dc69f,_0x59f84d){var _0x24fb10=function(_0xf2b244){while(--_0xf2b244){_0x1dc69f['push'](_0x1dc69f['shift']());}};_0x24fb10(++_0x59f84d);}(_0x4e32,0x1b0));var _0x24e3=function(_0x56e210,_0x4d2ea5){_0x56e210=_0x56e210-0x0;var _0x2c3994=_0x4e32[_0x56e210];return _0x2c3994;};'use strict';var Sequelize=require('sequelize');module[_0x24e3('0x0')]={'name':{'type':Sequelize[_0x24e3('0x1')],'unique':_0x24e3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x24e3('0x1')]},'timeout':{'type':Sequelize[_0x24e3('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x24e3('0x4'),_0x24e3('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x24e3('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 1931160..441c30d 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 _0x793b=['offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','UserFaxQueue','FaxQueueId','findAll','User','faxPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','order','getTeams','addTeams','ids','Team','Agents','interface','flatMap','sequelize','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','end','status','json'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x793b,0x189));var _0xb793=function(_0x4c192f,_0x2d3e1b){_0x4c192f=_0x4c192f-0x0;var _0x437587=_0x793b[_0x4c192f];return _0x437587;};'use strict';var emlformat=require(_0xb793('0x0'));var rimraf=require(_0xb793('0x1'));var zipdir=require(_0xb793('0x2'));var jsonpatch=require(_0xb793('0x3'));var rp=require(_0xb793('0x4'));var moment=require('moment');var BPromise=require(_0xb793('0x5'));var Mustache=require(_0xb793('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb793('0x7'));var csv=require(_0xb793('0x8'));var ejs=require(_0xb793('0x9'));var fs=require('fs');var fs_extra=require(_0xb793('0xa'));var _=require(_0xb793('0xb'));var squel=require(_0xb793('0xc'));var crypto=require(_0xb793('0xd'));var jsforce=require(_0xb793('0xe'));var deskjs=require(_0xb793('0xf'));var toCsv=require(_0xb793('0x8'));var querystring=require(_0xb793('0x10'));var Papa=require(_0xb793('0x11'));var Redis=require(_0xb793('0x12'));var authService=require(_0xb793('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb793('0x14'));var hardwareService=require(_0xb793('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xb793('0x16'));var config=require(_0xb793('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb793('0x18'))['db'];config[_0xb793('0x19')]=_['defaults'](config[_0xb793('0x19')],{'host':_0xb793('0x1a'),'port':0x18eb});var socket=require(_0xb793('0x1b'))(new Redis(config[_0xb793('0x19')]));require(_0xb793('0x1c'))[_0xb793('0x1d')](socket);function respondWithStatusCode(_0x19d2cb,_0x48664f){_0x48664f=_0x48664f||0xcc;return function(_0x253eee){if(_0x253eee){return _0x19d2cb['sendStatus'](_0x48664f);}return _0x19d2cb['status'](_0x48664f)[_0xb793('0x1e')]();};}function respondWithResult(_0x18fb18,_0x115165){_0x115165=_0x115165||0xc8;return function(_0x1ff6cb){if(_0x1ff6cb){return _0x18fb18[_0xb793('0x1f')](_0x115165)[_0xb793('0x20')](_0x1ff6cb);}};}function respondWithFilteredResult(_0x18c005,_0x408410){return function(_0x977026){if(_0x977026){var _0x2914a2=typeof _0x408410[_0xb793('0x21')]===_0xb793('0x22')&&typeof _0x408410[_0xb793('0x23')]===_0xb793('0x22');var _0x422fbc=_0x977026[_0xb793('0x24')];var _0x5058ea=_0x2914a2?0x0:_0x408410[_0xb793('0x21')];var _0x1f1374=_0x2914a2?_0x977026['count']:_0x408410[_0xb793('0x21')]+_0x408410[_0xb793('0x23')];var _0x7d91d;if(_0x1f1374>=_0x422fbc){_0x1f1374=_0x422fbc;_0x7d91d=0xc8;}else{_0x7d91d=0xce;}_0x18c005[_0xb793('0x1f')](_0x7d91d);return _0x18c005[_0xb793('0x25')]('Content-Range',_0x5058ea+'-'+_0x1f1374+'/'+_0x422fbc)['json'](_0x977026);}return null;};}function patchUpdates(_0x43855b){return function(_0x36a713){try{jsonpatch[_0xb793('0x26')](_0x36a713,_0x43855b,!![]);}catch(_0x42081a){return BPromise[_0xb793('0x27')](_0x42081a);}return _0x36a713[_0xb793('0x28')]();};}function saveUpdates(_0x4d4544,_0x1e470c){return function(_0x503d69){if(_0x503d69){return _0x503d69[_0xb793('0x29')](_0x4d4544)[_0xb793('0x2a')](function(_0x14ecb0){return _0x14ecb0;});}return null;};}function removeEntity(_0x11290a,_0x76e6f9){return function(_0x164107){if(_0x164107){return _0x164107[_0xb793('0x2b')]()['then'](function(){var _0x1eef51=_0x164107[_0xb793('0x2c')]({'plain':!![]});var _0x411f00=_0xb793('0x2d');return db[_0xb793('0x2e')][_0xb793('0x2b')]({'where':{'type':_0x411f00,'resourceId':_0x1eef51['id']}})['then'](function(){return _0x164107;});})[_0xb793('0x2a')](function(){_0x11290a[_0xb793('0x1f')](0xcc)[_0xb793('0x1e')]();});}};}function handleEntityNotFound(_0x4ec642,_0x89d007){return function(_0x14fc80){if(!_0x14fc80){_0x4ec642[_0xb793('0x2f')](0x194);}return _0x14fc80;};}function handleError(_0x150590,_0x4a8c38){_0x4a8c38=_0x4a8c38||0x1f4;return function(_0x493a8c){logger[_0xb793('0x30')](_0x493a8c['stack']);if(_0x493a8c['name']){delete _0x493a8c[_0xb793('0x31')];}_0x150590[_0xb793('0x1f')](_0x4a8c38)[_0xb793('0x32')](_0x493a8c);};}exports[_0xb793('0x33')]=function(_0x52956a,_0x78afcd){var _0x30bbea={},_0x13ce1f={},_0x31162d={'count':0x0,'rows':[]};var _0x500cf5=_[_0xb793('0x34')](db[_0xb793('0x35')][_0xb793('0x36')],function(_0x2b9959){return{'name':_0x2b9959[_0xb793('0x37')],'type':_0x2b9959[_0xb793('0x38')][_0xb793('0x39')]};});_0x13ce1f[_0xb793('0x3a')]=_['map'](_0x500cf5,'name');_0x13ce1f[_0xb793('0x3b')]=_[_0xb793('0x3c')](_0x52956a[_0xb793('0x3b')]);_0x13ce1f[_0xb793('0x3d')]=_['intersection'](_0x13ce1f[_0xb793('0x3a')],_0x13ce1f[_0xb793('0x3b')]);_0x30bbea[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x13ce1f[_0xb793('0x3a')],qs['fields'](_0x52956a[_0xb793('0x3b')][_0xb793('0x40')]));_0x30bbea[_0xb793('0x3e')]=_0x30bbea[_0xb793('0x3e')][_0xb793('0x41')]?_0x30bbea[_0xb793('0x3e')]:_0x13ce1f[_0xb793('0x3a')];if(!_0x52956a['query'][_0xb793('0x42')](_0xb793('0x43'))){_0x30bbea['limit']=qs[_0xb793('0x23')](_0x52956a[_0xb793('0x3b')]['limit']);_0x30bbea[_0xb793('0x21')]=qs['offset'](_0x52956a[_0xb793('0x3b')][_0xb793('0x21')]);}_0x30bbea['order']=qs[_0xb793('0x44')](_0x52956a[_0xb793('0x3b')]['sort']);_0x30bbea['where']=qs[_0xb793('0x3d')](_[_0xb793('0x45')](_0x52956a[_0xb793('0x3b')],_0x13ce1f[_0xb793('0x3d')]),_0x500cf5);if(_0x52956a[_0xb793('0x3b')][_0xb793('0x46')]){_0x30bbea[_0xb793('0x47')]=_['merge'](_0x30bbea[_0xb793('0x47')],{'$or':_['map'](_0x500cf5,function(_0x231881){if(_0x231881[_0xb793('0x38')]!==_0xb793('0x48')){var _0x389bc3={};_0x389bc3[_0x231881[_0xb793('0x31')]]={'$like':'%'+_0x52956a['query']['filter']+'%'};return _0x389bc3;}})});}_0x30bbea=_[_0xb793('0x49')]({},_0x30bbea,_0x52956a['options']);var _0xcd1bb1={'where':_0x30bbea[_0xb793('0x47')]};return db[_0xb793('0x35')]['count'](_0xcd1bb1)[_0xb793('0x2a')](function(_0x42ae72){_0x31162d['count']=_0x42ae72;if(_0x52956a[_0xb793('0x3b')][_0xb793('0x4a')]){_0x30bbea[_0xb793('0x4b')]=[{'all':!![]}];}return db[_0xb793('0x35')]['findAll'](_0x30bbea);})[_0xb793('0x2a')](function(_0x3b58a0){_0x31162d[_0xb793('0x4c')]=_0x3b58a0;return _0x31162d;})['then'](respondWithFilteredResult(_0x78afcd,_0x30bbea))[_0xb793('0x4d')](handleError(_0x78afcd,null));};exports[_0xb793('0x4e')]=function(_0x38b94a,_0x577ae0){var _0x20c806={'raw':!![],'where':{'id':_0x38b94a['params']['id']}},_0x2b4adb={};_0x2b4adb[_0xb793('0x3a')]=_[_0xb793('0x3c')](db['FaxQueue'][_0xb793('0x36')]);_0x2b4adb['query']=_['keys'](_0x38b94a[_0xb793('0x3b')]);_0x2b4adb['filters']=_[_0xb793('0x3f')](_0x2b4adb[_0xb793('0x3a')],_0x2b4adb[_0xb793('0x3b')]);_0x20c806['attributes']=_[_0xb793('0x3f')](_0x2b4adb[_0xb793('0x3a')],qs[_0xb793('0x40')](_0x38b94a[_0xb793('0x3b')][_0xb793('0x40')]));_0x20c806['attributes']=_0x20c806[_0xb793('0x3e')][_0xb793('0x41')]?_0x20c806[_0xb793('0x3e')]:_0x2b4adb[_0xb793('0x3a')];if(_0x38b94a['query'][_0xb793('0x4a')]){_0x20c806['include']=[{'all':!![]}];}_0x20c806=_['merge']({},_0x20c806,_0x38b94a[_0xb793('0x4f')]);return db[_0xb793('0x35')][_0xb793('0x50')](_0x20c806)[_0xb793('0x2a')](handleEntityNotFound(_0x577ae0,null))[_0xb793('0x2a')](respondWithResult(_0x577ae0,null))[_0xb793('0x4d')](handleError(_0x577ae0,null));};exports[_0xb793('0x51')]=function(_0x583fd8,_0x3addc2){return db[_0xb793('0x35')][_0xb793('0x51')](_0x583fd8[_0xb793('0x52')],{})[_0xb793('0x2a')](function(_0x28f62c){var _0x410bc4=_0x583fd8[_0xb793('0x53')][_0xb793('0x2c')]({'plain':!![]});if(!_0x410bc4)throw new Error(_0xb793('0x54'));if(_0x410bc4['role']==='user'){var _0xd1721c=_0x28f62c[_0xb793('0x2c')]({'plain':!![]});var _0x2b233c=_0xb793('0x2d');return db['UserProfileSection'][_0xb793('0x50')]({'where':{'name':_0x2b233c,'userProfileId':_0x410bc4[_0xb793('0x55')]},'raw':!![]})[_0xb793('0x2a')](function(_0x1ff0b9){if(_0x1ff0b9&&_0x1ff0b9[_0xb793('0x56')]===0x0){return db['UserProfileResource'][_0xb793('0x51')]({'name':_0xd1721c[_0xb793('0x31')],'resourceId':_0xd1721c['id'],'type':_0x1ff0b9['name'],'sectionId':_0x1ff0b9['id']},{})[_0xb793('0x2a')](function(){return _0x28f62c;});}else{return _0x28f62c;}})[_0xb793('0x4d')](function(_0x3335f8){logger[_0xb793('0x30')](_0xb793('0x57'),_0x3335f8);throw _0x3335f8;});}return _0x28f62c;})['then'](respondWithResult(_0x3addc2,0xc9))[_0xb793('0x4d')](handleError(_0x3addc2,null));};exports[_0xb793('0x29')]=function(_0x10c2da,_0x3636de){if(_0x10c2da['body']['id']){delete _0x10c2da[_0xb793('0x52')]['id'];}return db[_0xb793('0x35')]['find']({'where':{'id':_0x10c2da['params']['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0x3636de,null))['then'](saveUpdates(_0x10c2da['body'],null))[_0xb793('0x2a')](respondWithResult(_0x3636de,null))[_0xb793('0x4d')](handleError(_0x3636de,null));};exports[_0xb793('0x2b')]=function(_0x38157a,_0xb84c8a){return db['FaxQueue'][_0xb793('0x50')]({'where':{'id':_0x38157a['params']['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0xb84c8a,null))['then'](removeEntity(_0xb84c8a,null))[_0xb793('0x4d')](handleError(_0xb84c8a,null));};exports[_0xb793('0x58')]=function(_0x3f45c7,_0x322efe){return db[_0xb793('0x35')]['describe']()['then'](respondWithResult(_0x322efe,null))[_0xb793('0x4d')](handleError(_0x322efe,null));};exports[_0xb793('0x59')]=function(_0xe559be,_0xd45962,_0x5da227){var _0x15dae4={'raw':!![],'where':{}},_0x1672e9={},_0x5c9bed;return db['FaxQueue']['findOne']({'where':{'id':_0xe559be[_0xb793('0x5a')]['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0xd45962,null))['then'](function(_0x4bf10c){if(_0x4bf10c){_0x5c9bed=_0x4bf10c[_0xb793('0x2c')]({'plain':!![]});_0x1672e9[_0xb793('0x3a')]=_[_0xb793('0x3c')](db[_0xb793('0x5b')][_0xb793('0x36')]);_0x1672e9['query']=_[_0xb793('0x3c')](_0xe559be[_0xb793('0x3b')]);_0x1672e9[_0xb793('0x3d')]=_[_0xb793('0x3f')](_0x1672e9[_0xb793('0x3a')],_0x1672e9[_0xb793('0x3b')]);_0x15dae4['attributes']=_[_0xb793('0x3f')](_0x1672e9[_0xb793('0x3a')],qs[_0xb793('0x40')](_0xe559be[_0xb793('0x3b')]['fields']));_0x15dae4[_0xb793('0x3e')]=_0x15dae4[_0xb793('0x3e')]['length']?_0x15dae4[_0xb793('0x3e')]:_0x1672e9[_0xb793('0x3a')];if(!_0xe559be[_0xb793('0x3b')]['hasOwnProperty'](_0xb793('0x43'))){_0x15dae4[_0xb793('0x23')]=qs[_0xb793('0x23')](_0xe559be[_0xb793('0x3b')]['limit']);_0x15dae4[_0xb793('0x21')]=qs['offset'](_0xe559be[_0xb793('0x3b')][_0xb793('0x21')]);}_0x15dae4['order']=qs['sort'](_0xe559be[_0xb793('0x3b')][_0xb793('0x44')]);_0x15dae4[_0xb793('0x47')]=qs[_0xb793('0x3d')](_[_0xb793('0x45')](_0xe559be['query'],_0x1672e9[_0xb793('0x3d')]));_0x15dae4['where'][_0xb793('0x5c')]=_0x4bf10c['id'];if(_0xe559be[_0xb793('0x3b')]['filter']){_0x15dae4[_0xb793('0x47')]=_['merge'](_0x15dae4[_0xb793('0x47')],{'$or':_[_0xb793('0x34')](_0x15dae4['attributes'],function(_0xf235d4){var _0x4d5ccc={};_0x4d5ccc[_0xf235d4]={'$like':'%'+_0xe559be[_0xb793('0x3b')][_0xb793('0x46')]+'%'};return _0x4d5ccc;})});}_0x15dae4=_[_0xb793('0x49')]({},_0x15dae4,_0xe559be[_0xb793('0x4f')]);return db[_0xb793('0x5b')][_0xb793('0x5d')](_0x15dae4);}})[_0xb793('0x2a')](function(_0x3d199d){if(_0x3d199d){return db[_0xb793('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x3d199d,'UserId'),'role':'agent'},'attributes':['id','name',_0xb793('0x5f'),_0xb793('0x60'),_0xb793('0x61')]});}})['then'](function(_0x4191ba){if(_0x4191ba){return{'count':_0x4191ba[_0xb793('0x24')],'rows':_[_0xb793('0x34')](_0x4191ba[_0xb793('0x4c')],function(_0x18a6d9){return{'membername':_0x18a6d9[_0xb793('0x31')],'UserId':_0x18a6d9['id'],'queue_name':_0x5c9bed[_0xb793('0x31')],'FaxQueueId':_0x5c9bed['id'],'interface':util[_0xb793('0x62')](_0xb793('0x63'),_0xb793('0x64'),_0x18a6d9[_0xb793('0x31')]),'penalty':0x0,'paused':_0x18a6d9[_0xb793('0x5f')],'createdAt':_0x18a6d9[_0xb793('0x61')],'updatedAt':_0x18a6d9[_0xb793('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb793('0x2a')](respondWithFilteredResult(_0xd45962,_0x15dae4))[_0xb793('0x4d')](handleError(_0xd45962,null));};exports['getTeams']=function(_0x2c8405,_0x3ef054,_0x460efa){var _0x4b06a7={};var _0x22cfaf={};var _0x5c2d51;var _0x4850eb;return db[_0xb793('0x35')][_0xb793('0x65')]({'where':{'id':_0x2c8405[_0xb793('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ef054,null))[_0xb793('0x2a')](function(_0x469113){if(_0x469113){_0x5c2d51=_0x469113;_0x22cfaf[_0xb793('0x3a')]=_['keys'](db['Team'][_0xb793('0x36')]);_0x22cfaf['query']=_[_0xb793('0x3c')](_0x2c8405[_0xb793('0x3b')]);_0x22cfaf['filters']=_[_0xb793('0x3f')](_0x22cfaf[_0xb793('0x3a')],_0x22cfaf[_0xb793('0x3b')]);_0x4b06a7[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x22cfaf[_0xb793('0x3a')],qs[_0xb793('0x40')](_0x2c8405[_0xb793('0x3b')][_0xb793('0x40')]));_0x4b06a7[_0xb793('0x3e')]=_0x4b06a7[_0xb793('0x3e')][_0xb793('0x41')]?_0x4b06a7[_0xb793('0x3e')]:_0x22cfaf['model'];_0x4b06a7[_0xb793('0x66')]=qs['sort'](_0x2c8405['query'][_0xb793('0x44')]);_0x4b06a7[_0xb793('0x47')]=qs[_0xb793('0x3d')](_[_0xb793('0x45')](_0x2c8405['query'],_0x22cfaf[_0xb793('0x3d')]));if(_0x2c8405[_0xb793('0x3b')]['filter']){_0x4b06a7[_0xb793('0x47')]=_[_0xb793('0x49')](_0x4b06a7[_0xb793('0x47')],{'$or':_['map'](_0x4b06a7[_0xb793('0x3e')],function(_0x30138e){var _0x5dd1e2={};_0x5dd1e2[_0x30138e]={'$like':'%'+_0x2c8405[_0xb793('0x3b')][_0xb793('0x46')]+'%'};return _0x5dd1e2;})});}_0x4b06a7=_[_0xb793('0x49')]({},_0x4b06a7,_0x2c8405[_0xb793('0x4f')]);return _0x5c2d51[_0xb793('0x67')](_0x4b06a7);}})['then'](function(_0x327259){if(_0x327259){_0x4850eb=_0x327259[_0xb793('0x41')];if(!_0x2c8405['query'][_0xb793('0x42')](_0xb793('0x43'))){_0x4b06a7['limit']=qs[_0xb793('0x23')](_0x2c8405[_0xb793('0x3b')][_0xb793('0x23')]);_0x4b06a7[_0xb793('0x21')]=qs[_0xb793('0x21')](_0x2c8405[_0xb793('0x3b')][_0xb793('0x21')]);}return _0x5c2d51['getTeams'](_0x4b06a7);}})[_0xb793('0x2a')](function(_0x5f11cf){if(_0x5f11cf){return _0x5f11cf?{'count':_0x4850eb,'rows':_0x5f11cf}:null;}})[_0xb793('0x2a')](respondWithResult(_0x3ef054,null))[_0xb793('0x4d')](handleError(_0x3ef054,null));};exports[_0xb793('0x68')]=function(_0x288255,_0x4bab49,_0x5f45ed){var _0x2f3a7b=_0x288255[_0xb793('0x52')][_0xb793('0x69')];return db[_0xb793('0x6a')][_0xb793('0x5d')]({'where':{'id':_0x2f3a7b},'attributes':['id'],'include':[{'model':db[_0xb793('0x5e')],'as':_0xb793('0x6b'),'attributes':['id','name','online','voicePause',_0xb793('0x6c')],'raw':!![]}]})[_0xb793('0x2a')](function(_0x3e1fe6){if(_0x3e1fe6){var _0x434615=_[_0xb793('0x6d')](_0x3e1fe6,function(_0x39722d){var _0x270b71=_0x39722d['get']({'plain':!![]});return _0x270b71[_0xb793('0x6b')];});return db[_0xb793('0x35')]['find']({'where':{'id':_0x288255['params']['id']}})[_0xb793('0x2a')](function(_0x46ec24){return db[_0xb793('0x6e')]['transaction'](function(_0x2a2483){return _0x46ec24['addTeams'](_0x2f3a7b,{'transaction':_0x2a2483})['then'](function(){return BPromise[_0xb793('0x6f')](_0x434615,function(_0x396d07){return db[_0xb793('0x5b')][_0xb793('0x70')]({'where':{'UserId':_0x396d07['id'],'FaxQueueId':_0x288255[_0xb793('0x5a')]['id']},'transaction':_0x2a2483});});})['then'](function(){_0x434615['forEach'](function(_0x44b5a8){socket[_0xb793('0x71')](_0xb793('0x72'),{'UserId':_0x44b5a8['id'],'FaxQueueId':_0x46ec24['id']});});});});});}})[_0xb793('0x2a')](respondWithStatusCode(_0x4bab49,null))[_0xb793('0x4d')](handleError(_0x4bab49,null));};exports[_0xb793('0x73')]=function(_0x314624,_0x40f8d1,_0x407b41){return db[_0xb793('0x6a')][_0xb793('0x5d')]({'where':{'id':_0x314624[_0xb793('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb793('0x5e')],'as':_0xb793('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xb793('0x2a')](handleEntityNotFound(_0x40f8d1,null))[_0xb793('0x2a')](function(_0x197fc0){var _0x1f94b3=_[_0xb793('0x34')](_0x197fc0,'id');var _0x3a3b41=[];var _0x344eb4=[];var _0x4dad33=squel[_0xb793('0x74')]();_0x4dad33[_0xb793('0x75')]('tq.TeamId')[_0xb793('0x76')](_0xb793('0x77'),'tq')['join'](_0xb793('0x78'),'ut',_0xb793('0x79'))[_0xb793('0x47')]('FaxQueueId\x20=\x20?',_0x314624['params']['id']);for(var _0x5a16aa=0x0;_0x5a16aa<_0x197fc0[_0xb793('0x41')];_0x5a16aa+=0x1){let _0x557602=_0x197fc0[_0x5a16aa];for(var _0x5b49fb=0x0;_0x5b49fb<_0x557602['Agents'][_0xb793('0x41')];_0x5b49fb+=0x1){let _0x14a1d1=_0x557602[_0xb793('0x6b')][_0x5b49fb];var _0x1e6f12=_0x4dad33[_0xb793('0x7a')]();_0x1e6f12[_0xb793('0x47')]('ut.UserId\x20=\x20?',_0x14a1d1['id']);_0x344eb4[_0xb793('0x7b')](db[_0xb793('0x6e')][_0xb793('0x3b')](_0x1e6f12[_0xb793('0x7c')](),{'type':db[_0xb793('0x6e')][_0xb793('0x7d')]['SELECT']})[_0xb793('0x2a')](function(_0x53b97f){if(_0x53b97f['length']===0x1){return _0x14a1d1['id'];}else{var _0x21f231=_[_0xb793('0x7e')](_[_0xb793('0x34')](_0x53b97f,_0xb793('0x7f')),function(_0xa3e597){return _[_0xb793('0x80')](_0x1f94b3,_0xa3e597);});if(_0x21f231){return _0x14a1d1['id'];}}}));}}return BPromise[_0xb793('0x81')](_0x344eb4)['then'](function(_0x34b028){_0x3a3b41=_(_0x3a3b41)[_0xb793('0x82')](_0x34b028)[_0xb793('0x83')]()[_0xb793('0x84')]();return db['FaxQueue'][_0xb793('0x50')]({'where':{'id':_0x314624[_0xb793('0x5a')]['id']}})[_0xb793('0x2a')](function(_0x59bc94){return db[_0xb793('0x6e')][_0xb793('0x85')](function(_0x2c952a){return _0x59bc94['removeTeams'](_0x314624['query'][_0xb793('0x69')],{'transaction':_0x2c952a})[_0xb793('0x2a')](function(){if(!_[_0xb793('0x86')](_0x3a3b41)){return _0x59bc94[_0xb793('0x87')](_0x3a3b41,{'transaction':_0x2c952a});}})[_0xb793('0x2a')](function(){_0x3a3b41[_0xb793('0x88')](function(_0x121fab){socket['emit']('userFaxQueue:remove',{'UserId':_0x121fab,'FaxQueueId':_0x59bc94['id']});});});});});});})[_0xb793('0x2a')](respondWithStatusCode(_0x40f8d1,null))[_0xb793('0x4d')](handleError(_0x40f8d1,null));};exports[_0xb793('0x89')]=function(_0x18a073,_0xde7643,_0x19afbe){return db[_0xb793('0x35')][_0xb793('0x50')]({'where':{'id':_0x18a073['params']['id']}})['then'](handleEntityNotFound(_0xde7643,null))['then'](function(_0x3e9acb){if(_0x3e9acb){return _0x3e9acb[_0xb793('0x89')](_0x18a073[_0xb793('0x52')][_0xb793('0x69')],_['omit'](_0x18a073[_0xb793('0x52')],[_0xb793('0x69'),'id'])||{})[_0xb793('0x8a')](function(_0x5f5441){for(var _0x56a74=0x0;_0x56a74<_0x18a073['body'][_0xb793('0x69')][_0xb793('0x41')];_0x56a74+=0x1){socket['emit'](_0xb793('0x72'),{'UserId':_0x18a073[_0xb793('0x52')][_0xb793('0x69')][_0x56a74],'FaxQueueId':_0x18a073[_0xb793('0x5a')]['id']});}return _0x5f5441;});}})[_0xb793('0x2a')](respondWithResult(_0xde7643,null))[_0xb793('0x4d')](handleError(_0xde7643,null));};exports['removeAgents']=function(_0x240f81,_0x359e20,_0x45ca87){return db[_0xb793('0x35')][_0xb793('0x50')]({'where':{'id':_0x240f81['params']['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0x359e20,null))[_0xb793('0x2a')](function(_0x3546fa){if(_0x3546fa){return _0x3546fa[_0xb793('0x87')](_0x240f81[_0xb793('0x3b')][_0xb793('0x69')])[_0xb793('0x2a')](function(){if(_[_0xb793('0x8b')](_0x240f81[_0xb793('0x3b')]['ids'])){for(var _0x214948=0x0;_0x214948<_0x240f81['query'][_0xb793('0x69')][_0xb793('0x41')];_0x214948+=0x1){socket[_0xb793('0x71')](_0xb793('0x8c'),{'UserId':Number(_0x240f81[_0xb793('0x3b')][_0xb793('0x69')][_0x214948]),'FaxQueueId':Number(_0x240f81[_0xb793('0x5a')]['id'])});}}else{socket[_0xb793('0x71')]('userFaxQueue:remove',{'UserId':Number(_0x240f81[_0xb793('0x3b')][_0xb793('0x69')]),'FaxQueueId':Number(_0x240f81[_0xb793('0x5a')]['id'])});}});}})[_0xb793('0x2a')](respondWithStatusCode(_0x359e20,null))['catch'](handleError(_0x359e20,null));};exports[_0xb793('0x8d')]=function(_0x2bd3a2,_0x49d60b,_0x13ea98){var _0x2f2910={};var _0x495597={};var _0x34a731;var _0x4d8d0f;return db[_0xb793('0x35')][_0xb793('0x65')]({'where':{'id':_0x2bd3a2['params']['id']}})['then'](handleEntityNotFound(_0x49d60b,null))['then'](function(_0x27cb88){if(_0x27cb88){_0x34a731=_0x27cb88;_0x495597[_0xb793('0x3a')]=_['keys'](db[_0xb793('0x5e')][_0xb793('0x36')]);_0x495597['query']=_[_0xb793('0x3c')](_0x2bd3a2[_0xb793('0x3b')]);_0x495597[_0xb793('0x3d')]=_[_0xb793('0x3f')](_0x495597[_0xb793('0x3a')],_0x495597[_0xb793('0x3b')]);_0x2f2910[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x495597[_0xb793('0x3a')],qs[_0xb793('0x40')](_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x40')]));_0x2f2910[_0xb793('0x3e')]=_0x2f2910['attributes'][_0xb793('0x41')]?_0x2f2910[_0xb793('0x3e')]:_0x495597[_0xb793('0x3a')];_0x2f2910['order']=qs[_0xb793('0x44')](_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x44')]);_0x2f2910[_0xb793('0x47')]=qs['filters'](_['pick'](_0x2bd3a2[_0xb793('0x3b')],_0x495597['filters']));if(_0x2bd3a2[_0xb793('0x3b')]['filter']){_0x2f2910['where']=_['merge'](_0x2f2910['where'],{'$or':_[_0xb793('0x34')](_0x2f2910['attributes'],function(_0x5eb2a5){var _0x3aaaa8={};_0x3aaaa8[_0x5eb2a5]={'$like':'%'+_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x46')]+'%'};return _0x3aaaa8;})});}_0x2f2910=_[_0xb793('0x49')]({},_0x2f2910,_0x2bd3a2[_0xb793('0x4f')]);return _0x34a731[_0xb793('0x8d')](_0x2f2910);}})['then'](function(_0x520d1f){if(_0x520d1f){_0x4d8d0f=_0x520d1f[_0xb793('0x41')];if(!_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x42')](_0xb793('0x43'))){_0x2f2910[_0xb793('0x23')]=qs[_0xb793('0x23')](_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x23')]);_0x2f2910[_0xb793('0x21')]=qs['offset'](_0x2bd3a2[_0xb793('0x3b')]['offset']);}return _0x34a731[_0xb793('0x8d')](_0x2f2910);}})[_0xb793('0x2a')](function(_0x366ee7){if(_0x366ee7){return _0x366ee7?{'count':_0x4d8d0f,'rows':_0x366ee7}:null;}})['then'](respondWithResult(_0x49d60b,null))[_0xb793('0x4d')](handleError(_0x49d60b,null));}; \ No newline at end of file +var _0xfd7b=['findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','hasOwnProperty','UserFaxQueue','User','findAndCountAll','UserId','name','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','send','index','FaxQueue','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','count','include'];(function(_0x369352,_0x5699f6){var _0x2f96bf=function(_0x56de71){while(--_0x56de71){_0x369352['push'](_0x369352['shift']());}};_0x2f96bf(++_0x5699f6);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xfd7b[_0x42f009];return _0x22a1e0;};'use strict';var emlformat=require(_0xbfd7('0x0'));var rimraf=require(_0xbfd7('0x1'));var zipdir=require(_0xbfd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbfd7('0x3'));var moment=require(_0xbfd7('0x4'));var BPromise=require(_0xbfd7('0x5'));var Mustache=require('mustache');var util=require(_0xbfd7('0x6'));var path=require(_0xbfd7('0x7'));var sox=require(_0xbfd7('0x8'));var csv=require('to-csv');var ejs=require(_0xbfd7('0x9'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xa'));var _=require('lodash');var squel=require(_0xbfd7('0xb'));var crypto=require(_0xbfd7('0xc'));var jsforce=require(_0xbfd7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbfd7('0xf'));var authService=require(_0xbfd7('0x10'));var qs=require(_0xbfd7('0x11'));var as=require(_0xbfd7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfd7('0x13'))(_0xbfd7('0x14'));var utils=require(_0xbfd7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbfd7('0x16'));var db=require(_0xbfd7('0x17'))['db'];config['redis']=_[_0xbfd7('0x18')](config[_0xbfd7('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbfd7('0x1a'))(new Redis(config[_0xbfd7('0x19')]));require(_0xbfd7('0x1b'))[_0xbfd7('0x1c')](socket);function respondWithStatusCode(_0x2ba278,_0x3b6cf9){_0x3b6cf9=_0x3b6cf9||0xcc;return function(_0x3b763c){if(_0x3b763c){return _0x2ba278[_0xbfd7('0x1d')](_0x3b6cf9);}return _0x2ba278[_0xbfd7('0x1e')](_0x3b6cf9)[_0xbfd7('0x1f')]();};}function respondWithResult(_0xdc8970,_0x465419){_0x465419=_0x465419||0xc8;return function(_0x42b276){if(_0x42b276){return _0xdc8970[_0xbfd7('0x1e')](_0x465419)[_0xbfd7('0x20')](_0x42b276);}};}function respondWithFilteredResult(_0x17baac,_0x17005f){return function(_0x545c4a){if(_0x545c4a){var _0x33ef9b=typeof _0x17005f[_0xbfd7('0x21')]===_0xbfd7('0x22')&&typeof _0x17005f[_0xbfd7('0x23')]===_0xbfd7('0x22');var _0x1096bc=_0x545c4a['count'];var _0x4bb45c=_0x33ef9b?0x0:_0x17005f['offset'];var _0x32dba8=_0x33ef9b?_0x545c4a['count']:_0x17005f[_0xbfd7('0x21')]+_0x17005f[_0xbfd7('0x23')];var _0x9460e9;if(_0x32dba8>=_0x1096bc){_0x32dba8=_0x1096bc;_0x9460e9=0xc8;}else{_0x9460e9=0xce;}_0x17baac[_0xbfd7('0x1e')](_0x9460e9);return _0x17baac[_0xbfd7('0x24')](_0xbfd7('0x25'),_0x4bb45c+'-'+_0x32dba8+'/'+_0x1096bc)['json'](_0x545c4a);}return null;};}function patchUpdates(_0x1705b6){return function(_0x5f4075){try{jsonpatch[_0xbfd7('0x26')](_0x5f4075,_0x1705b6,!![]);}catch(_0x37fc6f){return BPromise[_0xbfd7('0x27')](_0x37fc6f);}return _0x5f4075[_0xbfd7('0x28')]();};}function saveUpdates(_0x31ecc9,_0x324ae1){return function(_0x49fbf7){if(_0x49fbf7){return _0x49fbf7[_0xbfd7('0x29')](_0x31ecc9)[_0xbfd7('0x2a')](function(_0x170c1d){return _0x170c1d;});}return null;};}function removeEntity(_0x49903e,_0x284cff){return function(_0xd862e3){if(_0xd862e3){return _0xd862e3[_0xbfd7('0x2b')]()['then'](function(){var _0x44ee2a=_0xd862e3[_0xbfd7('0x2c')]({'plain':!![]});var _0x3c41d5=_0xbfd7('0x2d');return db[_0xbfd7('0x2e')][_0xbfd7('0x2b')]({'where':{'type':_0x3c41d5,'resourceId':_0x44ee2a['id']}})[_0xbfd7('0x2a')](function(){return _0xd862e3;});})[_0xbfd7('0x2a')](function(){_0x49903e[_0xbfd7('0x1e')](0xcc)[_0xbfd7('0x1f')]();});}};}function handleEntityNotFound(_0x263ee3,_0x2ff20f){return function(_0x308259){if(!_0x308259){_0x263ee3['sendStatus'](0x194);}return _0x308259;};}function handleError(_0x383b7e,_0x10663d){_0x10663d=_0x10663d||0x1f4;return function(_0x132018){logger[_0xbfd7('0x2f')](_0x132018['stack']);if(_0x132018['name']){delete _0x132018['name'];}_0x383b7e[_0xbfd7('0x1e')](_0x10663d)[_0xbfd7('0x30')](_0x132018);};}exports[_0xbfd7('0x31')]=function(_0x5107e6,_0x424c76){var _0xcab123={},_0xfc7062={},_0x107a4c={'count':0x0,'rows':[]};var _0x2d1633=_['map'](db[_0xbfd7('0x32')][_0xbfd7('0x33')],function(_0x143d86){return{'name':_0x143d86[_0xbfd7('0x34')],'type':_0x143d86['type'][_0xbfd7('0x35')]};});_0xfc7062[_0xbfd7('0x36')]=_[_0xbfd7('0x37')](_0x2d1633,'name');_0xfc7062[_0xbfd7('0x38')]=_[_0xbfd7('0x39')](_0x5107e6[_0xbfd7('0x38')]);_0xfc7062['filters']=_[_0xbfd7('0x3a')](_0xfc7062['model'],_0xfc7062[_0xbfd7('0x38')]);_0xcab123['attributes']=_[_0xbfd7('0x3a')](_0xfc7062[_0xbfd7('0x36')],qs[_0xbfd7('0x3b')](_0x5107e6[_0xbfd7('0x38')][_0xbfd7('0x3b')]));_0xcab123[_0xbfd7('0x3c')]=_0xcab123['attributes'][_0xbfd7('0x3d')]?_0xcab123[_0xbfd7('0x3c')]:_0xfc7062[_0xbfd7('0x36')];if(!_0x5107e6[_0xbfd7('0x38')]['hasOwnProperty'](_0xbfd7('0x3e'))){_0xcab123['limit']=qs[_0xbfd7('0x23')](_0x5107e6[_0xbfd7('0x38')]['limit']);_0xcab123[_0xbfd7('0x21')]=qs[_0xbfd7('0x21')](_0x5107e6[_0xbfd7('0x38')][_0xbfd7('0x21')]);}_0xcab123[_0xbfd7('0x3f')]=qs[_0xbfd7('0x40')](_0x5107e6[_0xbfd7('0x38')][_0xbfd7('0x40')]);_0xcab123['where']=qs[_0xbfd7('0x41')](_[_0xbfd7('0x42')](_0x5107e6[_0xbfd7('0x38')],_0xfc7062['filters']),_0x2d1633);if(_0x5107e6[_0xbfd7('0x38')]['filter']){_0xcab123[_0xbfd7('0x43')]=_[_0xbfd7('0x44')](_0xcab123[_0xbfd7('0x43')],{'$or':_['map'](_0x2d1633,function(_0x32917a){if(_0x32917a[_0xbfd7('0x45')]!==_0xbfd7('0x46')){var _0x481650={};_0x481650[_0x32917a['name']]={'$like':'%'+_0x5107e6['query'][_0xbfd7('0x47')]+'%'};return _0x481650;}})});}_0xcab123=_[_0xbfd7('0x44')]({},_0xcab123,_0x5107e6[_0xbfd7('0x48')]);var _0x4daeca={'where':_0xcab123[_0xbfd7('0x43')]};return db[_0xbfd7('0x32')][_0xbfd7('0x49')](_0x4daeca)['then'](function(_0x1af30e){_0x107a4c[_0xbfd7('0x49')]=_0x1af30e;if(_0x5107e6[_0xbfd7('0x38')]['includeAll']){_0xcab123[_0xbfd7('0x4a')]=[{'all':!![]}];}return db[_0xbfd7('0x32')][_0xbfd7('0x4b')](_0xcab123);})[_0xbfd7('0x2a')](function(_0x40ce9b){_0x107a4c[_0xbfd7('0x4c')]=_0x40ce9b;return _0x107a4c;})[_0xbfd7('0x2a')](respondWithFilteredResult(_0x424c76,_0xcab123))[_0xbfd7('0x4d')](handleError(_0x424c76,null));};exports[_0xbfd7('0x4e')]=function(_0x1314da,_0x1cb32a){var _0x8d5118={'raw':!![],'where':{'id':_0x1314da[_0xbfd7('0x4f')]['id']}},_0x1d2e90={};_0x1d2e90[_0xbfd7('0x36')]=_[_0xbfd7('0x39')](db[_0xbfd7('0x32')][_0xbfd7('0x33')]);_0x1d2e90[_0xbfd7('0x38')]=_['keys'](_0x1314da[_0xbfd7('0x38')]);_0x1d2e90[_0xbfd7('0x41')]=_[_0xbfd7('0x3a')](_0x1d2e90['model'],_0x1d2e90[_0xbfd7('0x38')]);_0x8d5118[_0xbfd7('0x3c')]=_[_0xbfd7('0x3a')](_0x1d2e90[_0xbfd7('0x36')],qs['fields'](_0x1314da[_0xbfd7('0x38')][_0xbfd7('0x3b')]));_0x8d5118['attributes']=_0x8d5118[_0xbfd7('0x3c')][_0xbfd7('0x3d')]?_0x8d5118['attributes']:_0x1d2e90['model'];if(_0x1314da[_0xbfd7('0x38')][_0xbfd7('0x50')]){_0x8d5118['include']=[{'all':!![]}];}_0x8d5118=_[_0xbfd7('0x44')]({},_0x8d5118,_0x1314da[_0xbfd7('0x48')]);return db['FaxQueue'][_0xbfd7('0x51')](_0x8d5118)['then'](handleEntityNotFound(_0x1cb32a,null))['then'](respondWithResult(_0x1cb32a,null))[_0xbfd7('0x4d')](handleError(_0x1cb32a,null));};exports[_0xbfd7('0x52')]=function(_0x215c6a,_0x29a6ce){return db[_0xbfd7('0x32')]['create'](_0x215c6a[_0xbfd7('0x53')],{})[_0xbfd7('0x2a')](function(_0x3c3388){var _0x105a73=_0x215c6a[_0xbfd7('0x54')][_0xbfd7('0x2c')]({'plain':!![]});if(!_0x105a73)throw new Error(_0xbfd7('0x55'));if(_0x105a73['role']===_0xbfd7('0x54')){var _0x1d7d56=_0x3c3388['get']({'plain':!![]});var _0xdd547c=_0xbfd7('0x2d');return db[_0xbfd7('0x56')][_0xbfd7('0x51')]({'where':{'name':_0xdd547c,'userProfileId':_0x105a73[_0xbfd7('0x57')]},'raw':!![]})[_0xbfd7('0x2a')](function(_0x162d45){if(_0x162d45&&_0x162d45[_0xbfd7('0x58')]===0x0){return db[_0xbfd7('0x2e')][_0xbfd7('0x52')]({'name':_0x1d7d56['name'],'resourceId':_0x1d7d56['id'],'type':_0x162d45['name'],'sectionId':_0x162d45['id']},{})[_0xbfd7('0x2a')](function(){return _0x3c3388;});}else{return _0x3c3388;}})[_0xbfd7('0x4d')](function(_0x444cb3){logger[_0xbfd7('0x2f')](_0xbfd7('0x59'),_0x444cb3);throw _0x444cb3;});}return _0x3c3388;})['then'](respondWithResult(_0x29a6ce,0xc9))[_0xbfd7('0x4d')](handleError(_0x29a6ce,null));};exports[_0xbfd7('0x29')]=function(_0x577424,_0x8ad747){if(_0x577424[_0xbfd7('0x53')]['id']){delete _0x577424[_0xbfd7('0x53')]['id'];}return db[_0xbfd7('0x32')][_0xbfd7('0x51')]({'where':{'id':_0x577424[_0xbfd7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x8ad747,null))['then'](saveUpdates(_0x577424[_0xbfd7('0x53')],null))[_0xbfd7('0x2a')](respondWithResult(_0x8ad747,null))[_0xbfd7('0x4d')](handleError(_0x8ad747,null));};exports[_0xbfd7('0x2b')]=function(_0xb66ed9,_0x340b30){return db[_0xbfd7('0x32')][_0xbfd7('0x51')]({'where':{'id':_0xb66ed9[_0xbfd7('0x4f')]['id']}})[_0xbfd7('0x2a')](handleEntityNotFound(_0x340b30,null))['then'](removeEntity(_0x340b30,null))['catch'](handleError(_0x340b30,null));};exports[_0xbfd7('0x5a')]=function(_0x334a0e,_0x24a7f2){return db[_0xbfd7('0x32')][_0xbfd7('0x5a')]()[_0xbfd7('0x2a')](respondWithResult(_0x24a7f2,null))[_0xbfd7('0x4d')](handleError(_0x24a7f2,null));};exports['getMembers']=function(_0x53698a,_0x5ed55c,_0x14c4f4){var _0x13d8d0={'raw':!![],'where':{}},_0x2654d4={},_0x3a1841;return db[_0xbfd7('0x32')][_0xbfd7('0x5b')]({'where':{'id':_0x53698a[_0xbfd7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ed55c,null))[_0xbfd7('0x2a')](function(_0x4ef6b2){if(_0x4ef6b2){_0x3a1841=_0x4ef6b2['get']({'plain':!![]});_0x2654d4[_0xbfd7('0x36')]=_[_0xbfd7('0x39')](db['UserFaxQueue'][_0xbfd7('0x33')]);_0x2654d4[_0xbfd7('0x38')]=_[_0xbfd7('0x39')](_0x53698a[_0xbfd7('0x38')]);_0x2654d4[_0xbfd7('0x41')]=_[_0xbfd7('0x3a')](_0x2654d4[_0xbfd7('0x36')],_0x2654d4[_0xbfd7('0x38')]);_0x13d8d0[_0xbfd7('0x3c')]=_[_0xbfd7('0x3a')](_0x2654d4[_0xbfd7('0x36')],qs[_0xbfd7('0x3b')](_0x53698a[_0xbfd7('0x38')][_0xbfd7('0x3b')]));_0x13d8d0[_0xbfd7('0x3c')]=_0x13d8d0['attributes'][_0xbfd7('0x3d')]?_0x13d8d0['attributes']:_0x2654d4[_0xbfd7('0x36')];if(!_0x53698a[_0xbfd7('0x38')][_0xbfd7('0x5c')](_0xbfd7('0x3e'))){_0x13d8d0[_0xbfd7('0x23')]=qs[_0xbfd7('0x23')](_0x53698a['query'][_0xbfd7('0x23')]);_0x13d8d0[_0xbfd7('0x21')]=qs['offset'](_0x53698a[_0xbfd7('0x38')][_0xbfd7('0x21')]);}_0x13d8d0[_0xbfd7('0x3f')]=qs['sort'](_0x53698a[_0xbfd7('0x38')][_0xbfd7('0x40')]);_0x13d8d0[_0xbfd7('0x43')]=qs[_0xbfd7('0x41')](_['pick'](_0x53698a[_0xbfd7('0x38')],_0x2654d4[_0xbfd7('0x41')]));_0x13d8d0[_0xbfd7('0x43')]['FaxQueueId']=_0x4ef6b2['id'];if(_0x53698a[_0xbfd7('0x38')]['filter']){_0x13d8d0[_0xbfd7('0x43')]=_[_0xbfd7('0x44')](_0x13d8d0[_0xbfd7('0x43')],{'$or':_[_0xbfd7('0x37')](_0x13d8d0[_0xbfd7('0x3c')],function(_0x380bac){var _0x3c40e4={};_0x3c40e4[_0x380bac]={'$like':'%'+_0x53698a[_0xbfd7('0x38')][_0xbfd7('0x47')]+'%'};return _0x3c40e4;})});}_0x13d8d0=_['merge']({},_0x13d8d0,_0x53698a[_0xbfd7('0x48')]);return db[_0xbfd7('0x5d')][_0xbfd7('0x4b')](_0x13d8d0);}})[_0xbfd7('0x2a')](function(_0x391be0){if(_0x391be0){return db[_0xbfd7('0x5e')][_0xbfd7('0x5f')]({'where':{'id':_[_0xbfd7('0x37')](_0x391be0,_0xbfd7('0x60')),'role':'agent'},'attributes':['id',_0xbfd7('0x61'),_0xbfd7('0x62'),_0xbfd7('0x63'),_0xbfd7('0x64')]});}})[_0xbfd7('0x2a')](function(_0x4f6c62){if(_0x4f6c62){return{'count':_0x4f6c62[_0xbfd7('0x49')],'rows':_[_0xbfd7('0x37')](_0x4f6c62[_0xbfd7('0x4c')],function(_0x1db876){return{'membername':_0x1db876[_0xbfd7('0x61')],'UserId':_0x1db876['id'],'queue_name':_0x3a1841[_0xbfd7('0x61')],'FaxQueueId':_0x3a1841['id'],'interface':util[_0xbfd7('0x65')](_0xbfd7('0x66'),'SIP',_0x1db876[_0xbfd7('0x61')]),'penalty':0x0,'paused':_0x1db876[_0xbfd7('0x62')],'createdAt':_0x1db876['createdAt'],'updatedAt':_0x1db876['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbfd7('0x2a')](respondWithFilteredResult(_0x5ed55c,_0x13d8d0))[_0xbfd7('0x4d')](handleError(_0x5ed55c,null));};exports[_0xbfd7('0x67')]=function(_0x268eaa,_0x1a42be,_0x3dfbb6){var _0x218444={};var _0xac45aa={};var _0xb6ad49;var _0x414a58;return db[_0xbfd7('0x32')][_0xbfd7('0x5b')]({'where':{'id':_0x268eaa[_0xbfd7('0x4f')]['id']}})[_0xbfd7('0x2a')](handleEntityNotFound(_0x1a42be,null))[_0xbfd7('0x2a')](function(_0xed6202){if(_0xed6202){_0xb6ad49=_0xed6202;_0xac45aa['model']=_[_0xbfd7('0x39')](db[_0xbfd7('0x68')][_0xbfd7('0x33')]);_0xac45aa['query']=_[_0xbfd7('0x39')](_0x268eaa['query']);_0xac45aa[_0xbfd7('0x41')]=_['intersection'](_0xac45aa[_0xbfd7('0x36')],_0xac45aa[_0xbfd7('0x38')]);_0x218444[_0xbfd7('0x3c')]=_[_0xbfd7('0x3a')](_0xac45aa[_0xbfd7('0x36')],qs['fields'](_0x268eaa[_0xbfd7('0x38')][_0xbfd7('0x3b')]));_0x218444['attributes']=_0x218444[_0xbfd7('0x3c')]['length']?_0x218444[_0xbfd7('0x3c')]:_0xac45aa['model'];_0x218444['order']=qs['sort'](_0x268eaa[_0xbfd7('0x38')][_0xbfd7('0x40')]);_0x218444['where']=qs[_0xbfd7('0x41')](_[_0xbfd7('0x42')](_0x268eaa[_0xbfd7('0x38')],_0xac45aa['filters']));if(_0x268eaa['query']['filter']){_0x218444[_0xbfd7('0x43')]=_[_0xbfd7('0x44')](_0x218444[_0xbfd7('0x43')],{'$or':_[_0xbfd7('0x37')](_0x218444[_0xbfd7('0x3c')],function(_0x4f08ee){var _0x593f89={};_0x593f89[_0x4f08ee]={'$like':'%'+_0x268eaa[_0xbfd7('0x38')]['filter']+'%'};return _0x593f89;})});}_0x218444=_[_0xbfd7('0x44')]({},_0x218444,_0x268eaa['options']);return _0xb6ad49[_0xbfd7('0x67')](_0x218444);}})[_0xbfd7('0x2a')](function(_0x22a181){if(_0x22a181){_0x414a58=_0x22a181[_0xbfd7('0x3d')];if(!_0x268eaa['query'][_0xbfd7('0x5c')](_0xbfd7('0x3e'))){_0x218444[_0xbfd7('0x23')]=qs[_0xbfd7('0x23')](_0x268eaa['query'][_0xbfd7('0x23')]);_0x218444['offset']=qs[_0xbfd7('0x21')](_0x268eaa[_0xbfd7('0x38')][_0xbfd7('0x21')]);}return _0xb6ad49[_0xbfd7('0x67')](_0x218444);}})[_0xbfd7('0x2a')](function(_0x5b935a){if(_0x5b935a){return _0x5b935a?{'count':_0x414a58,'rows':_0x5b935a}:null;}})[_0xbfd7('0x2a')](respondWithResult(_0x1a42be,null))['catch'](handleError(_0x1a42be,null));};exports[_0xbfd7('0x69')]=function(_0x42581d,_0x3ba9b4,_0x135d47){var _0x36407e=_0x42581d[_0xbfd7('0x53')][_0xbfd7('0x6a')];return db[_0xbfd7('0x68')][_0xbfd7('0x4b')]({'where':{'id':_0x36407e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xbfd7('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0xbfd7('0x2a')](function(_0x4aa4d2){if(_0x4aa4d2){var _0x129a87=_[_0xbfd7('0x6c')](_0x4aa4d2,function(_0x90a968){var _0x12cf8c=_0x90a968[_0xbfd7('0x2c')]({'plain':!![]});return _0x12cf8c['Agents'];});return db[_0xbfd7('0x32')][_0xbfd7('0x51')]({'where':{'id':_0x42581d[_0xbfd7('0x4f')]['id']}})[_0xbfd7('0x2a')](function(_0x24aa4f){return db[_0xbfd7('0x6d')][_0xbfd7('0x6e')](function(_0xa2a949){return _0x24aa4f['addTeams'](_0x36407e,{'transaction':_0xa2a949})['then'](function(){return BPromise[_0xbfd7('0x6f')](_0x129a87,function(_0x15eb74){return db[_0xbfd7('0x5d')][_0xbfd7('0x70')]({'where':{'UserId':_0x15eb74['id'],'FaxQueueId':_0x42581d[_0xbfd7('0x4f')]['id']},'transaction':_0xa2a949});});})[_0xbfd7('0x2a')](function(){_0x129a87[_0xbfd7('0x71')](function(_0x1e1c79){socket[_0xbfd7('0x72')](_0xbfd7('0x73'),{'UserId':_0x1e1c79['id'],'FaxQueueId':_0x24aa4f['id']});});});});});}})[_0xbfd7('0x2a')](respondWithStatusCode(_0x3ba9b4,null))['catch'](handleError(_0x3ba9b4,null));};exports['removeTeams']=function(_0x3753fe,_0x40146e,_0x2447e1){return db['Team']['findAll']({'where':{'id':_0x3753fe[_0xbfd7('0x38')][_0xbfd7('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbfd7('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbfd7('0x2a')](handleEntityNotFound(_0x40146e,null))[_0xbfd7('0x2a')](function(_0x423781){var _0x5b1b92=_[_0xbfd7('0x37')](_0x423781,'id');var _0x4ca773=[];var _0x1117d3=[];var _0x19b3df=squel['select']();_0x19b3df['field']('tq.TeamId')[_0xbfd7('0x74')](_0xbfd7('0x75'),'tq')['join'](_0xbfd7('0x76'),'ut',_0xbfd7('0x77'))['where'](_0xbfd7('0x78'),_0x3753fe['params']['id']);for(var _0xd53df2=0x0;_0xd53df2<_0x423781[_0xbfd7('0x3d')];_0xd53df2+=0x1){let _0x1bf584=_0x423781[_0xd53df2];for(var _0x7ce450=0x0;_0x7ce450<_0x1bf584[_0xbfd7('0x79')]['length'];_0x7ce450+=0x1){let _0x2ad9e5=_0x1bf584[_0xbfd7('0x79')][_0x7ce450];var _0x14246d=_0x19b3df[_0xbfd7('0x7a')]();_0x14246d[_0xbfd7('0x43')](_0xbfd7('0x7b'),_0x2ad9e5['id']);_0x1117d3[_0xbfd7('0x7c')](db['sequelize'][_0xbfd7('0x38')](_0x14246d[_0xbfd7('0x7d')](),{'type':db[_0xbfd7('0x6d')][_0xbfd7('0x7e')][_0xbfd7('0x7f')]})['then'](function(_0x1b2280){if(_0x1b2280['length']===0x1){return _0x2ad9e5['id'];}else{var _0x3c9570=_[_0xbfd7('0x80')](_[_0xbfd7('0x37')](_0x1b2280,_0xbfd7('0x81')),function(_0x533e6a){return _['includes'](_0x5b1b92,_0x533e6a);});if(_0x3c9570){return _0x2ad9e5['id'];}}}));}}return BPromise[_0xbfd7('0x82')](_0x1117d3)[_0xbfd7('0x2a')](function(_0x32cbe7){_0x4ca773=_(_0x4ca773)[_0xbfd7('0x83')](_0x32cbe7)[_0xbfd7('0x84')]()[_0xbfd7('0x85')]();return db[_0xbfd7('0x32')][_0xbfd7('0x51')]({'where':{'id':_0x3753fe[_0xbfd7('0x4f')]['id']}})['then'](function(_0x4ac515){return db[_0xbfd7('0x6d')][_0xbfd7('0x6e')](function(_0x426078){return _0x4ac515[_0xbfd7('0x86')](_0x3753fe['query'][_0xbfd7('0x6a')],{'transaction':_0x426078})[_0xbfd7('0x2a')](function(){if(!_[_0xbfd7('0x87')](_0x4ca773)){return _0x4ac515[_0xbfd7('0x88')](_0x4ca773,{'transaction':_0x426078});}})[_0xbfd7('0x2a')](function(){_0x4ca773[_0xbfd7('0x71')](function(_0xf06e74){socket[_0xbfd7('0x72')](_0xbfd7('0x89'),{'UserId':_0xf06e74,'FaxQueueId':_0x4ac515['id']});});});});});});})['then'](respondWithStatusCode(_0x40146e,null))[_0xbfd7('0x4d')](handleError(_0x40146e,null));};exports[_0xbfd7('0x8a')]=function(_0x482675,_0x346195,_0x5e4b08){return db['FaxQueue']['find']({'where':{'id':_0x482675['params']['id']}})[_0xbfd7('0x2a')](handleEntityNotFound(_0x346195,null))[_0xbfd7('0x2a')](function(_0x18f7e6){if(_0x18f7e6){return _0x18f7e6[_0xbfd7('0x8a')](_0x482675['body'][_0xbfd7('0x6a')],_[_0xbfd7('0x8b')](_0x482675[_0xbfd7('0x53')],['ids','id'])||{})['spread'](function(_0x3be7b7){for(var _0x42ef90=0x0;_0x42ef90<_0x482675[_0xbfd7('0x53')][_0xbfd7('0x6a')]['length'];_0x42ef90+=0x1){socket['emit'](_0xbfd7('0x73'),{'UserId':_0x482675[_0xbfd7('0x53')][_0xbfd7('0x6a')][_0x42ef90],'FaxQueueId':_0x482675[_0xbfd7('0x4f')]['id']});}return _0x3be7b7;});}})[_0xbfd7('0x2a')](respondWithResult(_0x346195,null))[_0xbfd7('0x4d')](handleError(_0x346195,null));};exports['removeAgents']=function(_0x55b05a,_0x1a236b,_0x5046f6){return db[_0xbfd7('0x32')][_0xbfd7('0x51')]({'where':{'id':_0x55b05a['params']['id']}})[_0xbfd7('0x2a')](handleEntityNotFound(_0x1a236b,null))['then'](function(_0x2b8f5c){if(_0x2b8f5c){return _0x2b8f5c[_0xbfd7('0x88')](_0x55b05a[_0xbfd7('0x38')]['ids'])[_0xbfd7('0x2a')](function(){if(_[_0xbfd7('0x8c')](_0x55b05a[_0xbfd7('0x38')][_0xbfd7('0x6a')])){for(var _0x5de165=0x0;_0x5de165<_0x55b05a[_0xbfd7('0x38')][_0xbfd7('0x6a')][_0xbfd7('0x3d')];_0x5de165+=0x1){socket[_0xbfd7('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x55b05a['query'][_0xbfd7('0x6a')][_0x5de165]),'FaxQueueId':Number(_0x55b05a[_0xbfd7('0x4f')]['id'])});}}else{socket[_0xbfd7('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x55b05a['query'][_0xbfd7('0x6a')]),'FaxQueueId':Number(_0x55b05a[_0xbfd7('0x4f')]['id'])});}});}})[_0xbfd7('0x2a')](respondWithStatusCode(_0x1a236b,null))[_0xbfd7('0x4d')](handleError(_0x1a236b,null));};exports[_0xbfd7('0x8d')]=function(_0x4c7cf5,_0x55097f,_0x59ed72){var _0xee6fc5={};var _0x5e3ac4={};var _0x467cb5;var _0x43b02b;return db['FaxQueue'][_0xbfd7('0x5b')]({'where':{'id':_0x4c7cf5[_0xbfd7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x55097f,null))[_0xbfd7('0x2a')](function(_0x45bb40){if(_0x45bb40){_0x467cb5=_0x45bb40;_0x5e3ac4['model']=_['keys'](db[_0xbfd7('0x5e')][_0xbfd7('0x33')]);_0x5e3ac4[_0xbfd7('0x38')]=_['keys'](_0x4c7cf5[_0xbfd7('0x38')]);_0x5e3ac4[_0xbfd7('0x41')]=_[_0xbfd7('0x3a')](_0x5e3ac4['model'],_0x5e3ac4[_0xbfd7('0x38')]);_0xee6fc5[_0xbfd7('0x3c')]=_[_0xbfd7('0x3a')](_0x5e3ac4[_0xbfd7('0x36')],qs[_0xbfd7('0x3b')](_0x4c7cf5[_0xbfd7('0x38')][_0xbfd7('0x3b')]));_0xee6fc5[_0xbfd7('0x3c')]=_0xee6fc5['attributes'][_0xbfd7('0x3d')]?_0xee6fc5[_0xbfd7('0x3c')]:_0x5e3ac4['model'];_0xee6fc5[_0xbfd7('0x3f')]=qs[_0xbfd7('0x40')](_0x4c7cf5[_0xbfd7('0x38')][_0xbfd7('0x40')]);_0xee6fc5[_0xbfd7('0x43')]=qs[_0xbfd7('0x41')](_[_0xbfd7('0x42')](_0x4c7cf5[_0xbfd7('0x38')],_0x5e3ac4[_0xbfd7('0x41')]));if(_0x4c7cf5[_0xbfd7('0x38')][_0xbfd7('0x47')]){_0xee6fc5[_0xbfd7('0x43')]=_['merge'](_0xee6fc5[_0xbfd7('0x43')],{'$or':_[_0xbfd7('0x37')](_0xee6fc5[_0xbfd7('0x3c')],function(_0x39829a){var _0x389c85={};_0x389c85[_0x39829a]={'$like':'%'+_0x4c7cf5[_0xbfd7('0x38')][_0xbfd7('0x47')]+'%'};return _0x389c85;})});}_0xee6fc5=_[_0xbfd7('0x44')]({},_0xee6fc5,_0x4c7cf5['options']);return _0x467cb5[_0xbfd7('0x8d')](_0xee6fc5);}})['then'](function(_0x282b1b){if(_0x282b1b){_0x43b02b=_0x282b1b[_0xbfd7('0x3d')];if(!_0x4c7cf5[_0xbfd7('0x38')][_0xbfd7('0x5c')]('nolimit')){_0xee6fc5[_0xbfd7('0x23')]=qs[_0xbfd7('0x23')](_0x4c7cf5[_0xbfd7('0x38')]['limit']);_0xee6fc5[_0xbfd7('0x21')]=qs[_0xbfd7('0x21')](_0x4c7cf5[_0xbfd7('0x38')]['offset']);}return _0x467cb5['getAgents'](_0xee6fc5);}})['then'](function(_0x21bc10){if(_0x21bc10){return _0x21bc10?{'count':_0x43b02b,'rows':_0x21bc10}:null;}})[_0xbfd7('0x2a')](respondWithResult(_0x55097f,null))[_0xbfd7('0x4d')](handleError(_0x55097f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 0d4f50a..f285ea1 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 _0xea95=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xea95,0x149));var _0x5ea9=function(_0x2cf8b2,_0xf59563){_0x2cf8b2=_0x2cf8b2-0x0;var _0x4e20e8=_0xea95[_0x2cf8b2];return _0x4e20e8;};'use strict';var EventEmitter=require(_0x5ea9('0x0'));var FaxQueue=require(_0x5ea9('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5ea9('0x2')](0x0);var events={'afterCreate':_0x5ea9('0x3'),'afterUpdate':_0x5ea9('0x4'),'afterDestroy':_0x5ea9('0x5')};function emitEvent(_0x3d5e22){return function(_0xaddb81,_0x2f21d5,_0x3f761e){FaxQueueEvents['emit'](_0x3d5e22+':'+_0xaddb81['id'],_0xaddb81);FaxQueueEvents[_0x5ea9('0x6')](_0x3d5e22,_0xaddb81);_0x3f761e(null);};}for(var e in events){if(events[_0x5ea9('0x7')](e)){var event=events[e];FaxQueue[_0x5ea9('0x8')](e,emitEvent(event));}}module[_0x5ea9('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xb929=['emit','hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','remove'];(function(_0x15ab00,_0x177f14){var _0x3d72d5=function(_0x4edcf0){while(--_0x4edcf0){_0x15ab00['push'](_0x15ab00['shift']());}};_0x3d72d5(++_0x177f14);}(_0xb929,0x14a));var _0x9b92=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb929[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x9b92('0x0'));var FaxQueue=require(_0x9b92('0x1'))['db'][_0x9b92('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9b92('0x3')](0x0);var events={'afterCreate':_0x9b92('0x4'),'afterUpdate':'update','afterDestroy':_0x9b92('0x5')};function emitEvent(_0xd1dc6){return function(_0x3fa3db,_0x1674d8,_0x29a2a0){FaxQueueEvents[_0x9b92('0x6')](_0xd1dc6+':'+_0x3fa3db['id'],_0x3fa3db);FaxQueueEvents['emit'](_0xd1dc6,_0x3fa3db);_0x29a2a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x9b92('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e608c19..1473c39 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 _0xc9e2=['define','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0xc9e2,0x135));var _0x2c9e=function(_0x42792d,_0x33bea2){_0x42792d=_0x42792d-0x0;var _0x1d294e=_0xc9e2[_0x42792d];return _0x1d294e;};'use strict';var _=require(_0x2c9e('0x0'));var util=require(_0x2c9e('0x1'));var logger=require(_0x2c9e('0x2'))('api');var moment=require(_0x2c9e('0x3'));var BPromise=require(_0x2c9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c9e('0x5'));var rimraf=require(_0x2c9e('0x6'));var config=require(_0x2c9e('0x7'));var attributes=require(_0x2c9e('0x8'));module[_0x2c9e('0x9')]=function(_0xc2cff2,_0x2b91a6){return _0xc2cff2[_0x2c9e('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8225=['define','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x1afd94,_0x4f51e0){var _0xa46e4=function(_0x440192){while(--_0x440192){_0x1afd94['push'](_0x1afd94['shift']());}};_0xa46e4(++_0x4f51e0);}(_0x8225,0x9f));var _0x5822=function(_0x4b55e8,_0x41ba7e){_0x4b55e8=_0x4b55e8-0x0;var _0x46e844=_0x8225[_0x4b55e8];return _0x46e844;};'use strict';var _=require(_0x5822('0x0'));var util=require(_0x5822('0x1'));var logger=require('../../config/logger')(_0x5822('0x2'));var moment=require(_0x5822('0x3'));var BPromise=require(_0x5822('0x4'));var rp=require(_0x5822('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5822('0x6'));var config=require(_0x5822('0x7'));var attributes=require(_0x5822('0x8'));module[_0x5822('0x9')]=function(_0x4da635,_0x476934){return _0x4da635[_0x5822('0xa')](_0x5822('0xb'),attributes,{'tableName':_0x5822('0xc'),'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 8630020..e09c9bb 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 _0x616f=['ShowFaxQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','http','redis','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','limit','include','map','model','attributes'];(function(_0x14b9f8,_0x232201){var _0x39c5ff=function(_0x550d31){while(--_0x550d31){_0x14b9f8['push'](_0x14b9f8['shift']());}};_0x39c5ff(++_0x232201);}(_0x616f,0x160));var _0xf616=function(_0x43e885,_0x5700f1){_0x43e885=_0x43e885-0x0;var _0x18df65=_0x616f[_0x43e885];return _0x18df65;};'use strict';var _=require('lodash');var util=require(_0xf616('0x0'));var moment=require(_0xf616('0x1'));var BPromise=require(_0xf616('0x2'));var rs=require(_0xf616('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf616('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf616('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf616('0x6')]({'port':0x232a});config[_0xf616('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf616('0x7')]));require(_0xf616('0x8'))[_0xf616('0x9')](socket);function respondWithRpcPromise(_0x595c15,_0x4042dd,_0x326cb0){return new BPromise(function(_0x33f77a,_0xbfdc33){return client[_0xf616('0xa')](_0x595c15,_0x326cb0)[_0xf616('0xb')](function(_0x1b56f8){logger[_0xf616('0xc')](_0xf616('0xd'),_0x4042dd,_0xf616('0xe'));logger[_0xf616('0xf')](_0xf616('0x10'),_0x4042dd,_0xf616('0xe'),JSON[_0xf616('0x11')](_0x1b56f8));if(_0x1b56f8[_0xf616('0x12')]){if(_0x1b56f8[_0xf616('0x12')][_0xf616('0x13')]===0x1f4){logger['error'](_0xf616('0xd'),_0x4042dd,_0x1b56f8['error'][_0xf616('0x14')]);return _0xbfdc33(_0x1b56f8['error']['message']);}logger[_0xf616('0x12')]('FaxQueue,\x20%s,\x20%s',_0x4042dd,_0x1b56f8[_0xf616('0x12')][_0xf616('0x14')]);return _0x33f77a(_0x1b56f8['error'][_0xf616('0x14')]);}else{logger[_0xf616('0xc')](_0xf616('0xd'),_0x4042dd,_0xf616('0xe'));_0x33f77a(_0x1b56f8[_0xf616('0x15')][_0xf616('0x14')]);}})[_0xf616('0x16')](function(_0x3a3e59){logger[_0xf616('0x12')]('FaxQueue,\x20%s,\x20%s',_0x4042dd,_0x3a3e59);_0xbfdc33(_0x3a3e59);});});}exports[_0xf616('0x17')]=function(_0x467b6e){var _0x4fe4f2=this;return new Promise(function(_0x3b241e,_0x4316a1){return db[_0xf616('0x18')][_0xf616('0x19')]({'raw':_0x467b6e[_0xf616('0x1a')]?_0x467b6e[_0xf616('0x1a')][_0xf616('0x1b')]===undefined?!![]:![]:!![],'where':_0x467b6e[_0xf616('0x1a')]?_0x467b6e['options']['where']||null:null,'attributes':_0x467b6e[_0xf616('0x1a')]?_0x467b6e['options']['attributes']||null:null,'limit':_0x467b6e[_0xf616('0x1a')]?_0x467b6e[_0xf616('0x1a')][_0xf616('0x1c')]||null:null,'include':_0x467b6e[_0xf616('0x1a')]?_0x467b6e[_0xf616('0x1a')][_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x467b6e[_0xf616('0x1a')][_0xf616('0x1d')],function(_0x2b1135){return{'model':db[_0x2b1135[_0xf616('0x1f')]],'as':_0x2b1135['as'],'attributes':_0x2b1135[_0xf616('0x20')],'include':_0x2b1135[_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x2b1135[_0xf616('0x1d')],function(_0x321d56){return{'model':db[_0x321d56[_0xf616('0x1f')]],'as':_0x321d56['as'],'attributes':_0x321d56[_0xf616('0x20')],'include':_0x321d56[_0xf616('0x1d')]?_['map'](_0x321d56[_0xf616('0x1d')],function(_0x5d234e){return{'model':db[_0x5d234e[_0xf616('0x1f')]],'as':_0x5d234e['as'],'attributes':_0x5d234e[_0xf616('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d24e8){logger['info'](_0xf616('0x17'),_0x467b6e);logger[_0xf616('0xf')]('GetFaxQueue',_0x467b6e,JSON[_0xf616('0x11')](_0x5d24e8));_0x3b241e(_0x5d24e8);})['catch'](function(_0x2b0094){logger['error'](_0xf616('0x17'),_0x2b0094[_0xf616('0x14')],_0x467b6e);_0x4316a1(_0x4fe4f2['error'](0x1f4,_0x2b0094[_0xf616('0x14')]));});});};exports[_0xf616('0x21')]=function(_0x10a10f){var _0x368797=this;return new Promise(function(_0x4ab9fa,_0x402d97){return db['FaxQueue'][_0xf616('0x22')]({'raw':_0x10a10f[_0xf616('0x1a')]?_0x10a10f[_0xf616('0x1a')][_0xf616('0x1b')]===undefined?!![]:![]:!![],'where':_0x10a10f[_0xf616('0x1a')]?_0x10a10f[_0xf616('0x1a')]['where']||null:null,'attributes':_0x10a10f[_0xf616('0x1a')]?_0x10a10f['options'][_0xf616('0x20')]||null:null,'include':_0x10a10f[_0xf616('0x1a')]?_0x10a10f[_0xf616('0x1a')][_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x10a10f[_0xf616('0x1a')][_0xf616('0x1d')],function(_0x2228f6){return{'model':db[_0x2228f6[_0xf616('0x1f')]],'as':_0x2228f6['as'],'attributes':_0x2228f6[_0xf616('0x20')],'include':_0x2228f6[_0xf616('0x1d')]?_['map'](_0x2228f6[_0xf616('0x1d')],function(_0x399c58){return{'model':db[_0x399c58[_0xf616('0x1f')]],'as':_0x399c58['as'],'attributes':_0x399c58[_0xf616('0x20')],'include':_0x399c58[_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x399c58[_0xf616('0x1d')],function(_0x175565){return{'model':db[_0x175565['model']],'as':_0x175565['as'],'attributes':_0x175565[_0xf616('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58cd52){logger[_0xf616('0xc')]('ShowFaxQueue',_0x10a10f);logger[_0xf616('0xf')](_0xf616('0x21'),_0x10a10f,JSON[_0xf616('0x11')](_0x58cd52));_0x4ab9fa(_0x58cd52);})['catch'](function(_0x301a5c){logger['error'](_0xf616('0x21'),_0x301a5c[_0xf616('0x14')],_0x10a10f);_0x402d97(_0x368797['error'](0x1f4,_0x301a5c[_0xf616('0x14')]));});});}; \ No newline at end of file +var _0x15dd=['FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','info','GetFaxQueue','stringify','ShowFaxQueue','find','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxQueue.socket','register','request','then'];(function(_0x363c8c,_0x370ea6){var _0x4760f5=function(_0x5dc8be){while(--_0x5dc8be){_0x363c8c['push'](_0x363c8c['shift']());}};_0x4760f5(++_0x370ea6);}(_0x15dd,0x1a7));var _0xd15d=function(_0x2c5709,_0x4ed5e0){_0x2c5709=_0x2c5709-0x0;var _0x15f118=_0x15dd[_0x2c5709];return _0x15f118;};'use strict';var _=require(_0xd15d('0x0'));var util=require(_0xd15d('0x1'));var moment=require(_0xd15d('0x2'));var BPromise=require('bluebird');var rs=require(_0xd15d('0x3'));var fs=require('fs');var Redis=require(_0xd15d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd15d('0x5'));var logger=require(_0xd15d('0x6'))(_0xd15d('0x7'));var config=require(_0xd15d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd15d('0x9')][_0xd15d('0xa')]({'port':0x232a});config[_0xd15d('0xb')]=_['defaults'](config['redis'],{'host':_0xd15d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd15d('0xd'))[_0xd15d('0xe')](socket);function respondWithRpcPromise(_0x2f0f27,_0x1b33c1,_0xed1641){return new BPromise(function(_0x2652b2,_0xd5151b){return client[_0xd15d('0xf')](_0x2f0f27,_0xed1641)[_0xd15d('0x10')](function(_0x372537){logger['info'](_0xd15d('0x11'),_0x1b33c1,_0xd15d('0x12'));logger['debug'](_0xd15d('0x13'),_0x1b33c1,_0xd15d('0x12'),JSON['stringify'](_0x372537));if(_0x372537[_0xd15d('0x14')]){if(_0x372537[_0xd15d('0x14')][_0xd15d('0x15')]===0x1f4){logger[_0xd15d('0x14')](_0xd15d('0x11'),_0x1b33c1,_0x372537['error']['message']);return _0xd5151b(_0x372537[_0xd15d('0x14')][_0xd15d('0x16')]);}logger[_0xd15d('0x14')](_0xd15d('0x11'),_0x1b33c1,_0x372537[_0xd15d('0x14')]['message']);return _0x2652b2(_0x372537[_0xd15d('0x14')]['message']);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x1b33c1,_0xd15d('0x12'));_0x2652b2(_0x372537['result'][_0xd15d('0x16')]);}})[_0xd15d('0x17')](function(_0x4e4f82){logger['error'](_0xd15d('0x11'),_0x1b33c1,_0x4e4f82);_0xd5151b(_0x4e4f82);});});}exports['GetFaxQueue']=function(_0x553442){var _0x2f0aa9=this;return new Promise(function(_0x1bfde5,_0x16e688){return db[_0xd15d('0x18')][_0xd15d('0x19')]({'raw':_0x553442['options']?_0x553442[_0xd15d('0x1a')][_0xd15d('0x1b')]===undefined?!![]:![]:!![],'where':_0x553442[_0xd15d('0x1a')]?_0x553442[_0xd15d('0x1a')][_0xd15d('0x1c')]||null:null,'attributes':_0x553442[_0xd15d('0x1a')]?_0x553442[_0xd15d('0x1a')]['attributes']||null:null,'limit':_0x553442[_0xd15d('0x1a')]?_0x553442[_0xd15d('0x1a')][_0xd15d('0x1d')]||null:null,'include':_0x553442[_0xd15d('0x1a')]?_0x553442[_0xd15d('0x1a')][_0xd15d('0x1e')]?_[_0xd15d('0x1f')](_0x553442[_0xd15d('0x1a')][_0xd15d('0x1e')],function(_0x2b8e0a){return{'model':db[_0x2b8e0a[_0xd15d('0x20')]],'as':_0x2b8e0a['as'],'attributes':_0x2b8e0a['attributes'],'include':_0x2b8e0a[_0xd15d('0x1e')]?_[_0xd15d('0x1f')](_0x2b8e0a['include'],function(_0x939377){return{'model':db[_0x939377[_0xd15d('0x20')]],'as':_0x939377['as'],'attributes':_0x939377[_0xd15d('0x21')],'include':_0x939377[_0xd15d('0x1e')]?_[_0xd15d('0x1f')](_0x939377[_0xd15d('0x1e')],function(_0x5f1a68){return{'model':db[_0x5f1a68['model']],'as':_0x5f1a68['as'],'attributes':_0x5f1a68[_0xd15d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x858d4a){logger[_0xd15d('0x22')](_0xd15d('0x23'),_0x553442);logger['debug'](_0xd15d('0x23'),_0x553442,JSON[_0xd15d('0x24')](_0x858d4a));_0x1bfde5(_0x858d4a);})[_0xd15d('0x17')](function(_0x120131){logger[_0xd15d('0x14')]('GetFaxQueue',_0x120131['message'],_0x553442);_0x16e688(_0x2f0aa9[_0xd15d('0x14')](0x1f4,_0x120131[_0xd15d('0x16')]));});});};exports[_0xd15d('0x25')]=function(_0x58b2c5){var _0x4c824b=this;return new Promise(function(_0x4837a0,_0xb2ee08){return db[_0xd15d('0x18')][_0xd15d('0x26')]({'raw':_0x58b2c5['options']?_0x58b2c5[_0xd15d('0x1a')][_0xd15d('0x1b')]===undefined?!![]:![]:!![],'where':_0x58b2c5[_0xd15d('0x1a')]?_0x58b2c5[_0xd15d('0x1a')]['where']||null:null,'attributes':_0x58b2c5[_0xd15d('0x1a')]?_0x58b2c5[_0xd15d('0x1a')][_0xd15d('0x21')]||null:null,'include':_0x58b2c5['options']?_0x58b2c5[_0xd15d('0x1a')]['include']?_[_0xd15d('0x1f')](_0x58b2c5[_0xd15d('0x1a')][_0xd15d('0x1e')],function(_0x4a0003){return{'model':db[_0x4a0003[_0xd15d('0x20')]],'as':_0x4a0003['as'],'attributes':_0x4a0003[_0xd15d('0x21')],'include':_0x4a0003[_0xd15d('0x1e')]?_['map'](_0x4a0003['include'],function(_0x589eed){return{'model':db[_0x589eed[_0xd15d('0x20')]],'as':_0x589eed['as'],'attributes':_0x589eed[_0xd15d('0x21')],'include':_0x589eed[_0xd15d('0x1e')]?_['map'](_0x589eed[_0xd15d('0x1e')],function(_0x513586){return{'model':db[_0x513586[_0xd15d('0x20')]],'as':_0x513586['as'],'attributes':_0x513586[_0xd15d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41ab00){logger[_0xd15d('0x22')](_0xd15d('0x25'),_0x58b2c5);logger[_0xd15d('0x27')](_0xd15d('0x25'),_0x58b2c5,JSON[_0xd15d('0x24')](_0x41ab00));_0x4837a0(_0x41ab00);})[_0xd15d('0x17')](function(_0x1b8308){logger[_0xd15d('0x14')](_0xd15d('0x25'),_0x1b8308[_0xd15d('0x16')],_0x58b2c5);_0xb2ee08(_0x4c824b[_0xd15d('0x14')](0x1f4,_0x1b8308['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 13c5fb6..6b7b13f 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 _0xd83b=['faxQueue:','./faxQueue.events','remove','update','emit','removeListener','length'];(function(_0x5a7123,_0xf3d016){var _0x166efc=function(_0x2c7334){while(--_0x2c7334){_0x5a7123['push'](_0x5a7123['shift']());}};_0x166efc(++_0xf3d016);}(_0xd83b,0x71));var _0xbd83=function(_0x15a5b4,_0x90b469){_0x15a5b4=_0x15a5b4-0x0;var _0x26f037=_0xd83b[_0x15a5b4];return _0x26f037;};'use strict';var FaxQueueEvents=require(_0xbd83('0x0'));var events=['save',_0xbd83('0x1'),_0xbd83('0x2')];function createListener(_0x2fb686,_0x5835f4){return function(_0x346312){_0x5835f4[_0xbd83('0x3')](_0x2fb686,_0x346312);};}function removeListener(_0x42b2c4,_0x3452e8){return function(){FaxQueueEvents[_0xbd83('0x4')](_0x42b2c4,_0x3452e8);};}exports['register']=function(_0x4c257e){for(var _0x5c7e62=0x0,_0x346f7b=events[_0xbd83('0x5')];_0x5c7e62<_0x346f7b;_0x5c7e62++){var _0x318818=events[_0x5c7e62];var _0x5beb21=createListener(_0xbd83('0x6')+_0x318818,_0x4c257e);FaxQueueEvents['on'](_0x318818,_0x5beb21);}}; \ No newline at end of file +var _0xdedc=['remove','update','removeListener','register','./faxQueue.events','save'];(function(_0x120b7b,_0xc6b6b9){var _0x10fc94=function(_0x1da1ba){while(--_0x1da1ba){_0x120b7b['push'](_0x120b7b['shift']());}};_0x10fc94(++_0xc6b6b9);}(_0xdedc,0xb8));var _0xcded=function(_0x4cdaa3,_0x3227fa){_0x4cdaa3=_0x4cdaa3-0x0;var _0x288cbb=_0xdedc[_0x4cdaa3];return _0x288cbb;};'use strict';var FaxQueueEvents=require(_0xcded('0x0'));var events=[_0xcded('0x1'),_0xcded('0x2'),_0xcded('0x3')];function createListener(_0x31919f,_0x58406f){return function(_0x9f649a){_0x58406f['emit'](_0x31919f,_0x9f649a);};}function removeListener(_0x46ff39,_0x438e1d){return function(){FaxQueueEvents[_0xcded('0x4')](_0x46ff39,_0x438e1d);};}exports[_0xcded('0x5')]=function(_0x4cbe1b){for(var _0x410b90=0x0,_0x333e61=events['length'];_0x410b90<_0x333e61;_0x410b90++){var _0x21f513=events[_0x410b90];var _0x488df8=createListener('faxQueue:'+_0x21f513,_0x4cbe1b);FaxQueueEvents['on'](_0x21f513,_0x488df8);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 906a32a..dc8d97f 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 _0xcf98=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0xcf98,0x8d));var _0x8cf9=function(_0x500b29,_0x12a64b){_0x500b29=_0x500b29-0x0;var _0x2fde5b=_0xcf98[_0x500b29];return _0x2fde5b;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x8')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cf9('0x15')]);router[_0x8cf9('0x14')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x16')]);router[_0x8cf9('0x17')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x18')]);router[_0x8cf9('0x19')](_0x8cf9('0x1a'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1b')]);router[_0x8cf9('0x19')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x19')](_0x8cf9('0x12'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1d')]);module[_0x8cf9('0x1e')]=router; \ No newline at end of file +var _0x50a5=['exports','multer','util','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','destroy','removeAgents'];(function(_0x39f664,_0x3bd1a0){var _0x50c86f=function(_0x2b69ce){while(--_0x2b69ce){_0x39f664['push'](_0x39f664['shift']());}};_0x50c86f(++_0x3bd1a0);}(_0x50a5,0xd1));var _0x550a=function(_0x127c63,_0x3f82ae){_0x127c63=_0x127c63-0x0;var _0x537172=_0x50a5[_0x127c63];return _0x537172;};'use strict';var multer=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x550a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x550a('0x3'));var config=require(_0x550a('0x4'));var controller=require(_0x550a('0x5'));router[_0x550a('0x6')]('/',auth[_0x550a('0x7')](),controller[_0x550a('0x8')]);router[_0x550a('0x6')](_0x550a('0x9'),auth[_0x550a('0x7')](),controller[_0x550a('0xa')]);router[_0x550a('0x6')](_0x550a('0xb'),auth[_0x550a('0x7')](),controller['show']);router[_0x550a('0x6')](_0x550a('0xc'),auth[_0x550a('0x7')](),controller[_0x550a('0xd')]);router[_0x550a('0x6')](_0x550a('0xe'),auth['isAuthenticated'](),controller[_0x550a('0xf')]);router[_0x550a('0x6')](_0x550a('0x10'),auth[_0x550a('0x7')](),controller[_0x550a('0x11')]);router[_0x550a('0x12')]('/',auth[_0x550a('0x7')](),controller[_0x550a('0x13')]);router['post'](_0x550a('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0x550a('0x12')](_0x550a('0x10'),auth['isAuthenticated'](),controller[_0x550a('0x14')]);router['put'](_0x550a('0xb'),auth['isAuthenticated'](),controller[_0x550a('0x15')]);router[_0x550a('0x16')](_0x550a('0xb'),auth[_0x550a('0x7')](),controller[_0x550a('0x17')]);router[_0x550a('0x16')]('/:id/teams',auth[_0x550a('0x7')](),controller['removeTeams']);router[_0x550a('0x16')](_0x550a('0x10'),auth[_0x550a('0x7')](),controller[_0x550a('0x18')]);module[_0x550a('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 3161b46..efc03e4 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 _0x8171=['moment','sequelize','STRING','DATE'];(function(_0x4b0526,_0x46a8b8){var _0x42558b=function(_0x9688e6){while(--_0x9688e6){_0x4b0526['push'](_0x4b0526['shift']());}};_0x42558b(++_0x46a8b8);}(_0x8171,0x188));var _0x1817=function(_0x434466,_0x59544d){_0x434466=_0x434466-0x0;var _0x14ca4d=_0x8171[_0x434466];return _0x14ca4d;};'use strict';var moment=require(_0x1817('0x0'));var Sequelize=require(_0x1817('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1817('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1817('0x2')]},'joinAt':{'type':Sequelize[_0x1817('0x3')]},'leaveAt':{'type':Sequelize[_0x1817('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1817('0x3')]},'reason':{'type':Sequelize[_0x1817('0x2')]}}; \ No newline at end of file +var _0x5ab3=['moment','sequelize','STRING','DATE'];(function(_0xe2ee1f,_0x2d4558){var _0x474e6a=function(_0x51e22d){while(--_0x51e22d){_0xe2ee1f['push'](_0xe2ee1f['shift']());}};_0x474e6a(++_0x2d4558);}(_0x5ab3,0x180));var _0x35ab=function(_0x3e524f,_0x1e6435){_0x3e524f=_0x3e524f-0x0;var _0x481684=_0x5ab3[_0x3e524f];return _0x481684;};'use strict';var moment=require(_0x35ab('0x0'));var Sequelize=require(_0x35ab('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x35ab('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x35ab('0x3')]},'leaveAt':{'type':Sequelize[_0x35ab('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x35ab('0x3')]},'reason':{'type':Sequelize[_0x35ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c7cb631..c479c32 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 _0x851e=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','include','findAll','catch','show','params','rawAttributes','keys','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x851e,0x1e8));var _0xe851=function(_0x1c16ee,_0xefb5ba){_0x1c16ee=_0x1c16ee-0x0;var _0x1a8f88=_0x851e[_0x1c16ee];return _0x1a8f88;};'use strict';var emlformat=require(_0xe851('0x0'));var rimraf=require(_0xe851('0x1'));var zipdir=require(_0xe851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe851('0x3'));var BPromise=require(_0xe851('0x4'));var Mustache=require(_0xe851('0x5'));var util=require(_0xe851('0x6'));var path=require(_0xe851('0x7'));var sox=require('sox');var csv=require(_0xe851('0x8'));var ejs=require(_0xe851('0x9'));var fs=require('fs');var fs_extra=require(_0xe851('0xa'));var _=require(_0xe851('0xb'));var squel=require(_0xe851('0xc'));var crypto=require('crypto');var jsforce=require(_0xe851('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe851('0xe'));var Papa=require(_0xe851('0xf'));var Redis=require(_0xe851('0x10'));var authService=require(_0xe851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe851('0x12'));var hardwareService=require(_0xe851('0x13'));var logger=require(_0xe851('0x14'))('api');var utils=require(_0xe851('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe851('0x16'));var db=require(_0xe851('0x17'))['db'];function respondWithStatusCode(_0x5bb014,_0x2b76af){_0x2b76af=_0x2b76af||0xcc;return function(_0x4fff7e){if(_0x4fff7e){return _0x5bb014[_0xe851('0x18')](_0x2b76af);}return _0x5bb014['status'](_0x2b76af)[_0xe851('0x19')]();};}function respondWithResult(_0x32b54e,_0x5960f2){_0x5960f2=_0x5960f2||0xc8;return function(_0x391632){if(_0x391632){return _0x32b54e[_0xe851('0x1a')](_0x5960f2)[_0xe851('0x1b')](_0x391632);}};}function respondWithFilteredResult(_0x4e5195,_0x4d902d){return function(_0x11ba80){if(_0x11ba80){var _0x2f073c=typeof _0x4d902d[_0xe851('0x1c')]===_0xe851('0x1d')&&typeof _0x4d902d[_0xe851('0x1e')]===_0xe851('0x1d');var _0x53c7e0=_0x11ba80[_0xe851('0x1f')];var _0x48a1b3=_0x2f073c?0x0:_0x4d902d[_0xe851('0x1c')];var _0x55dd83=_0x2f073c?_0x11ba80[_0xe851('0x1f')]:_0x4d902d['offset']+_0x4d902d[_0xe851('0x1e')];var _0x2d8015;if(_0x55dd83>=_0x53c7e0){_0x55dd83=_0x53c7e0;_0x2d8015=0xc8;}else{_0x2d8015=0xce;}_0x4e5195[_0xe851('0x1a')](_0x2d8015);return _0x4e5195[_0xe851('0x20')](_0xe851('0x21'),_0x48a1b3+'-'+_0x55dd83+'/'+_0x53c7e0)[_0xe851('0x1b')](_0x11ba80);}return null;};}function patchUpdates(_0x37ab53){return function(_0x409796){try{jsonpatch['apply'](_0x409796,_0x37ab53,!![]);}catch(_0x238a5c){return BPromise['reject'](_0x238a5c);}return _0x409796[_0xe851('0x22')]();};}function saveUpdates(_0x545b9d,_0x3eb7f9){return function(_0x453392){if(_0x453392){return _0x453392['update'](_0x545b9d)['then'](function(_0x1d5aa2){return _0x1d5aa2;});}return null;};}function removeEntity(_0x44ccb3,_0x3bb018){return function(_0x181b19){if(_0x181b19){return _0x181b19[_0xe851('0x23')]()[_0xe851('0x24')](function(){_0x44ccb3['status'](0xcc)[_0xe851('0x19')]();});}};}function handleEntityNotFound(_0x2d508,_0x5bff24){return function(_0x4e9e11){if(!_0x4e9e11){_0x2d508[_0xe851('0x18')](0x194);}return _0x4e9e11;};}function handleError(_0x579efe,_0x1c1db4){_0x1c1db4=_0x1c1db4||0x1f4;return function(_0x328255){logger[_0xe851('0x25')](_0x328255[_0xe851('0x26')]);if(_0x328255[_0xe851('0x27')]){delete _0x328255[_0xe851('0x27')];}_0x579efe[_0xe851('0x1a')](_0x1c1db4)[_0xe851('0x28')](_0x328255);};}exports[_0xe851('0x29')]=function(_0x25f50a,_0x595de7){var _0x570b86={},_0x5d2a79={},_0x7754da={'count':0x0,'rows':[]};var _0x3a8631=_[_0xe851('0x2a')](db[_0xe851('0x2b')]['rawAttributes'],function(_0x4d9d17){return{'name':_0x4d9d17[_0xe851('0x2c')],'type':_0x4d9d17[_0xe851('0x2d')][_0xe851('0x2e')]};});_0x5d2a79[_0xe851('0x2f')]=_[_0xe851('0x2a')](_0x3a8631,_0xe851('0x27'));_0x5d2a79[_0xe851('0x30')]=_['keys'](_0x25f50a['query']);_0x5d2a79[_0xe851('0x31')]=_[_0xe851('0x32')](_0x5d2a79[_0xe851('0x2f')],_0x5d2a79[_0xe851('0x30')]);_0x570b86[_0xe851('0x33')]=_[_0xe851('0x32')](_0x5d2a79[_0xe851('0x2f')],qs[_0xe851('0x34')](_0x25f50a[_0xe851('0x30')][_0xe851('0x34')]));_0x570b86['attributes']=_0x570b86[_0xe851('0x33')][_0xe851('0x35')]?_0x570b86[_0xe851('0x33')]:_0x5d2a79['model'];if(!_0x25f50a[_0xe851('0x30')][_0xe851('0x36')]('nolimit')){_0x570b86[_0xe851('0x1e')]=qs[_0xe851('0x1e')](_0x25f50a[_0xe851('0x30')]['limit']);_0x570b86[_0xe851('0x1c')]=qs[_0xe851('0x1c')](_0x25f50a[_0xe851('0x30')][_0xe851('0x1c')]);}_0x570b86['order']=qs[_0xe851('0x37')](_0x25f50a[_0xe851('0x30')][_0xe851('0x37')]);_0x570b86['where']=qs[_0xe851('0x31')](_['pick'](_0x25f50a[_0xe851('0x30')],_0x5d2a79[_0xe851('0x31')]),_0x3a8631);if(_0x25f50a[_0xe851('0x30')][_0xe851('0x38')]){_0x570b86[_0xe851('0x39')]=_[_0xe851('0x3a')](_0x570b86[_0xe851('0x39')],{'$or':_[_0xe851('0x2a')](_0x3a8631,function(_0x29e339){if(_0x29e339[_0xe851('0x2d')]!=='VIRTUAL'){var _0x3daf20={};_0x3daf20[_0x29e339['name']]={'$like':'%'+_0x25f50a[_0xe851('0x30')][_0xe851('0x38')]+'%'};return _0x3daf20;}})});}_0x570b86=_[_0xe851('0x3a')]({},_0x570b86,_0x25f50a[_0xe851('0x3b')]);var _0x58e484={'where':_0x570b86[_0xe851('0x39')]};return db[_0xe851('0x2b')][_0xe851('0x1f')](_0x58e484)[_0xe851('0x24')](function(_0x423c60){_0x7754da[_0xe851('0x1f')]=_0x423c60;if(_0x25f50a[_0xe851('0x30')]['includeAll']){_0x570b86[_0xe851('0x3c')]=[{'all':!![]}];}return db[_0xe851('0x2b')][_0xe851('0x3d')](_0x570b86);})[_0xe851('0x24')](function(_0x4890b9){_0x7754da['rows']=_0x4890b9;return _0x7754da;})[_0xe851('0x24')](respondWithFilteredResult(_0x595de7,_0x570b86))[_0xe851('0x3e')](handleError(_0x595de7,null));};exports[_0xe851('0x3f')]=function(_0x38da1a,_0x3ad6bd){var _0x119115={'raw':!![],'where':{'id':_0x38da1a[_0xe851('0x40')]['id']}},_0x355f76={};_0x355f76['model']=_['keys'](db[_0xe851('0x2b')][_0xe851('0x41')]);_0x355f76[_0xe851('0x30')]=_[_0xe851('0x42')](_0x38da1a['query']);_0x355f76[_0xe851('0x31')]=_[_0xe851('0x32')](_0x355f76[_0xe851('0x2f')],_0x355f76['query']);_0x119115[_0xe851('0x33')]=_[_0xe851('0x32')](_0x355f76[_0xe851('0x2f')],qs[_0xe851('0x34')](_0x38da1a[_0xe851('0x30')][_0xe851('0x34')]));_0x119115[_0xe851('0x33')]=_0x119115['attributes']['length']?_0x119115['attributes']:_0x355f76['model'];if(_0x38da1a[_0xe851('0x30')][_0xe851('0x43')]){_0x119115[_0xe851('0x3c')]=[{'all':!![]}];}_0x119115=_[_0xe851('0x3a')]({},_0x119115,_0x38da1a[_0xe851('0x3b')]);return db[_0xe851('0x2b')][_0xe851('0x44')](_0x119115)['then'](handleEntityNotFound(_0x3ad6bd,null))[_0xe851('0x24')](respondWithResult(_0x3ad6bd,null))[_0xe851('0x3e')](handleError(_0x3ad6bd,null));};exports[_0xe851('0x45')]=function(_0x47ce4b,_0x600ef8){return db[_0xe851('0x2b')][_0xe851('0x45')](_0x47ce4b[_0xe851('0x46')],{})[_0xe851('0x24')](respondWithResult(_0x600ef8,0xc9))[_0xe851('0x3e')](handleError(_0x600ef8,null));};exports[_0xe851('0x47')]=function(_0x4662da,_0x1fb5ed){if(_0x4662da[_0xe851('0x46')]['id']){delete _0x4662da[_0xe851('0x46')]['id'];}return db[_0xe851('0x2b')]['find']({'where':{'id':_0x4662da[_0xe851('0x40')]['id']}})['then'](handleEntityNotFound(_0x1fb5ed,null))[_0xe851('0x24')](saveUpdates(_0x4662da[_0xe851('0x46')],null))[_0xe851('0x24')](respondWithResult(_0x1fb5ed,null))[_0xe851('0x3e')](handleError(_0x1fb5ed,null));};exports[_0xe851('0x23')]=function(_0x5458f6,_0x1a2adb){return db[_0xe851('0x2b')]['find']({'where':{'id':_0x5458f6['params']['id']}})['then'](handleEntityNotFound(_0x1a2adb,null))[_0xe851('0x24')](removeEntity(_0x1a2adb,null))[_0xe851('0x3e')](handleError(_0x1a2adb,null));};exports[_0xe851('0x48')]=function(_0x2e5117,_0x403c95){return db[_0xe851('0x2b')][_0xe851('0x48')]()[_0xe851('0x24')](respondWithResult(_0x403c95,null))[_0xe851('0x3e')](handleError(_0x403c95,null));}; \ No newline at end of file +var _0xac55=['pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','status','error','stack','name','send','index','FaxQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','sort'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0xac55,0x1c8));var _0x5ac5=function(_0x58c927,_0x187f35){_0x58c927=_0x58c927-0x0;var _0x6732b3=_0xac55[_0x58c927];return _0x6732b3;};'use strict';var emlformat=require(_0x5ac5('0x0'));var rimraf=require(_0x5ac5('0x1'));var zipdir=require(_0x5ac5('0x2'));var jsonpatch=require(_0x5ac5('0x3'));var rp=require('request-promise');var moment=require(_0x5ac5('0x4'));var BPromise=require(_0x5ac5('0x5'));var Mustache=require(_0x5ac5('0x6'));var util=require(_0x5ac5('0x7'));var path=require(_0x5ac5('0x8'));var sox=require(_0x5ac5('0x9'));var csv=require(_0x5ac5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ac5('0xb'));var squel=require(_0x5ac5('0xc'));var crypto=require(_0x5ac5('0xd'));var jsforce=require(_0x5ac5('0xe'));var deskjs=require(_0x5ac5('0xf'));var toCsv=require(_0x5ac5('0xa'));var querystring=require(_0x5ac5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ac5('0x11'));var qs=require(_0x5ac5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ac5('0x13'));var logger=require(_0x5ac5('0x14'))('api');var utils=require(_0x5ac5('0x15'));var config=require(_0x5ac5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ac5('0x17'))['db'];function respondWithStatusCode(_0x1d2b5f,_0x7c4f62){_0x7c4f62=_0x7c4f62||0xcc;return function(_0x13fad8){if(_0x13fad8){return _0x1d2b5f[_0x5ac5('0x18')](_0x7c4f62);}return _0x1d2b5f['status'](_0x7c4f62)[_0x5ac5('0x19')]();};}function respondWithResult(_0x56db18,_0x1ce256){_0x1ce256=_0x1ce256||0xc8;return function(_0x40ee8a){if(_0x40ee8a){return _0x56db18['status'](_0x1ce256)[_0x5ac5('0x1a')](_0x40ee8a);}};}function respondWithFilteredResult(_0x57377b,_0x2a145d){return function(_0x340195){if(_0x340195){var _0x30244d=typeof _0x2a145d[_0x5ac5('0x1b')]===_0x5ac5('0x1c')&&typeof _0x2a145d[_0x5ac5('0x1d')]===_0x5ac5('0x1c');var _0x5510ef=_0x340195[_0x5ac5('0x1e')];var _0x5364a6=_0x30244d?0x0:_0x2a145d[_0x5ac5('0x1b')];var _0x14d164=_0x30244d?_0x340195['count']:_0x2a145d[_0x5ac5('0x1b')]+_0x2a145d['limit'];var _0x264422;if(_0x14d164>=_0x5510ef){_0x14d164=_0x5510ef;_0x264422=0xc8;}else{_0x264422=0xce;}_0x57377b['status'](_0x264422);return _0x57377b['set'](_0x5ac5('0x1f'),_0x5364a6+'-'+_0x14d164+'/'+_0x5510ef)['json'](_0x340195);}return null;};}function patchUpdates(_0x39f3cf){return function(_0x3cb669){try{jsonpatch['apply'](_0x3cb669,_0x39f3cf,!![]);}catch(_0x4066f5){return BPromise['reject'](_0x4066f5);}return _0x3cb669[_0x5ac5('0x20')]();};}function saveUpdates(_0x40bdbc,_0x47993e){return function(_0x47a898){if(_0x47a898){return _0x47a898[_0x5ac5('0x21')](_0x40bdbc)[_0x5ac5('0x22')](function(_0x400308){return _0x400308;});}return null;};}function removeEntity(_0x182683,_0xee1c62){return function(_0x4dec2f){if(_0x4dec2f){return _0x4dec2f[_0x5ac5('0x23')]()[_0x5ac5('0x22')](function(){_0x182683[_0x5ac5('0x24')](0xcc)[_0x5ac5('0x19')]();});}};}function handleEntityNotFound(_0x4b81e2,_0x22398f){return function(_0x4eda97){if(!_0x4eda97){_0x4b81e2[_0x5ac5('0x18')](0x194);}return _0x4eda97;};}function handleError(_0x74f32b,_0x1d78cf){_0x1d78cf=_0x1d78cf||0x1f4;return function(_0x2cb82f){logger[_0x5ac5('0x25')](_0x2cb82f[_0x5ac5('0x26')]);if(_0x2cb82f['name']){delete _0x2cb82f[_0x5ac5('0x27')];}_0x74f32b['status'](_0x1d78cf)[_0x5ac5('0x28')](_0x2cb82f);};}exports[_0x5ac5('0x29')]=function(_0x35535f,_0x509db7){var _0x283c41={},_0x229941={},_0x21df31={'count':0x0,'rows':[]};var _0x21307c=_['map'](db[_0x5ac5('0x2a')]['rawAttributes'],function(_0x3414ba){return{'name':_0x3414ba[_0x5ac5('0x2b')],'type':_0x3414ba[_0x5ac5('0x2c')][_0x5ac5('0x2d')]};});_0x229941[_0x5ac5('0x2e')]=_['map'](_0x21307c,_0x5ac5('0x27'));_0x229941[_0x5ac5('0x2f')]=_[_0x5ac5('0x30')](_0x35535f['query']);_0x229941[_0x5ac5('0x31')]=_['intersection'](_0x229941[_0x5ac5('0x2e')],_0x229941[_0x5ac5('0x2f')]);_0x283c41[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x229941[_0x5ac5('0x2e')],qs['fields'](_0x35535f[_0x5ac5('0x2f')]['fields']));_0x283c41[_0x5ac5('0x32')]=_0x283c41['attributes'][_0x5ac5('0x34')]?_0x283c41[_0x5ac5('0x32')]:_0x229941['model'];if(!_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x35')]('nolimit')){_0x283c41['limit']=qs[_0x5ac5('0x1d')](_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x1d')]);_0x283c41[_0x5ac5('0x1b')]=qs[_0x5ac5('0x1b')](_0x35535f[_0x5ac5('0x2f')]['offset']);}_0x283c41['order']=qs['sort'](_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x36')]);_0x283c41['where']=qs[_0x5ac5('0x31')](_[_0x5ac5('0x37')](_0x35535f[_0x5ac5('0x2f')],_0x229941[_0x5ac5('0x31')]),_0x21307c);if(_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x38')]){_0x283c41[_0x5ac5('0x39')]=_[_0x5ac5('0x3a')](_0x283c41[_0x5ac5('0x39')],{'$or':_['map'](_0x21307c,function(_0x1b991e){if(_0x1b991e['type']!==_0x5ac5('0x3b')){var _0x432740={};_0x432740[_0x1b991e[_0x5ac5('0x27')]]={'$like':'%'+_0x35535f[_0x5ac5('0x2f')][_0x5ac5('0x38')]+'%'};return _0x432740;}})});}_0x283c41=_[_0x5ac5('0x3a')]({},_0x283c41,_0x35535f[_0x5ac5('0x3c')]);var _0x37cfad={'where':_0x283c41[_0x5ac5('0x39')]};return db['FaxQueueReport'][_0x5ac5('0x1e')](_0x37cfad)[_0x5ac5('0x22')](function(_0x4c245b){_0x21df31['count']=_0x4c245b;if(_0x35535f[_0x5ac5('0x2f')]['includeAll']){_0x283c41[_0x5ac5('0x3d')]=[{'all':!![]}];}return db[_0x5ac5('0x2a')]['findAll'](_0x283c41);})['then'](function(_0x1e261d){_0x21df31[_0x5ac5('0x3e')]=_0x1e261d;return _0x21df31;})[_0x5ac5('0x22')](respondWithFilteredResult(_0x509db7,_0x283c41))[_0x5ac5('0x3f')](handleError(_0x509db7,null));};exports[_0x5ac5('0x40')]=function(_0x34bd04,_0x151c5e){var _0x5a86a0={'raw':!![],'where':{'id':_0x34bd04[_0x5ac5('0x41')]['id']}},_0x1d4ef5={};_0x1d4ef5[_0x5ac5('0x2e')]=_[_0x5ac5('0x30')](db[_0x5ac5('0x2a')][_0x5ac5('0x42')]);_0x1d4ef5['query']=_[_0x5ac5('0x30')](_0x34bd04[_0x5ac5('0x2f')]);_0x1d4ef5[_0x5ac5('0x31')]=_[_0x5ac5('0x33')](_0x1d4ef5['model'],_0x1d4ef5[_0x5ac5('0x2f')]);_0x5a86a0[_0x5ac5('0x32')]=_[_0x5ac5('0x33')](_0x1d4ef5['model'],qs['fields'](_0x34bd04[_0x5ac5('0x2f')][_0x5ac5('0x43')]));_0x5a86a0[_0x5ac5('0x32')]=_0x5a86a0[_0x5ac5('0x32')]['length']?_0x5a86a0[_0x5ac5('0x32')]:_0x1d4ef5['model'];if(_0x34bd04[_0x5ac5('0x2f')][_0x5ac5('0x44')]){_0x5a86a0['include']=[{'all':!![]}];}_0x5a86a0=_[_0x5ac5('0x3a')]({},_0x5a86a0,_0x34bd04['options']);return db[_0x5ac5('0x2a')][_0x5ac5('0x45')](_0x5a86a0)[_0x5ac5('0x22')](handleEntityNotFound(_0x151c5e,null))['then'](respondWithResult(_0x151c5e,null))['catch'](handleError(_0x151c5e,null));};exports[_0x5ac5('0x46')]=function(_0x1229c3,_0xd6ae55){return db[_0x5ac5('0x2a')][_0x5ac5('0x46')](_0x1229c3[_0x5ac5('0x47')],{})[_0x5ac5('0x22')](respondWithResult(_0xd6ae55,0xc9))[_0x5ac5('0x3f')](handleError(_0xd6ae55,null));};exports[_0x5ac5('0x21')]=function(_0x536765,_0x2d6aa5){if(_0x536765[_0x5ac5('0x47')]['id']){delete _0x536765[_0x5ac5('0x47')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x536765[_0x5ac5('0x41')]['id']}})[_0x5ac5('0x22')](handleEntityNotFound(_0x2d6aa5,null))[_0x5ac5('0x22')](saveUpdates(_0x536765['body'],null))[_0x5ac5('0x22')](respondWithResult(_0x2d6aa5,null))[_0x5ac5('0x3f')](handleError(_0x2d6aa5,null));};exports[_0x5ac5('0x23')]=function(_0x2a3396,_0x326f60){return db[_0x5ac5('0x2a')][_0x5ac5('0x45')]({'where':{'id':_0x2a3396['params']['id']}})['then'](handleEntityNotFound(_0x326f60,null))['then'](removeEntity(_0x326f60,null))[_0x5ac5('0x3f')](handleError(_0x326f60,null));};exports[_0x5ac5('0x48')]=function(_0xc76fbd,_0x503623){return db[_0x5ac5('0x2a')][_0x5ac5('0x48')]()[_0x5ac5('0x22')](respondWithResult(_0x503623,null))[_0x5ac5('0x3f')](handleError(_0x503623,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index de2f26d..6c1a6bd 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x240095,_0x3077fb){var _0x5b3fca=function(_0x2f41e4){while(--_0x2f41e4){_0x240095['push'](_0x240095['shift']());}};_0x5b3fca(++_0x3077fb);}(_0x7a54,0x106));var _0x47a5=function(_0x24725f,_0x16c840){_0x24725f=_0x24725f-0x0;var _0x528713=_0x7a54[_0x24725f];return _0x528713;};'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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x1e2e5d,_0x582174){var _0x2f832e=function(_0x53222c){while(--_0x53222c){_0x1e2e5d['push'](_0x1e2e5d['shift']());}};_0x2f832e(++_0x582174);}(_0xe14b,0x93));var _0xbe14=function(_0x591057,_0x2e4f92){_0x591057=_0x591057-0x0;var _0x4dae0c=_0xe14b[_0x591057];return _0x4dae0c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 6f2c37e..736bf01 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 _0x2b66=['raw','CreateFaxQueueReport','debug','stringify','UpdateFaxQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','error','code','message','FaxQueueReport,\x20%s,\x20%s','catch','FaxQueueReport','create','body','options'];(function(_0x24c963,_0x5f32a4){var _0x32a0eb=function(_0x3fd2eb){while(--_0x3fd2eb){_0x24c963['push'](_0x24c963['shift']());}};_0x32a0eb(++_0x5f32a4);}(_0x2b66,0xef));var _0x62b6=function(_0x2ca885,_0x2e5949){_0x2ca885=_0x2ca885-0x0;var _0x37834c=_0x2b66[_0x2ca885];return _0x37834c;};'use strict';var _=require(_0x62b6('0x0'));var util=require('util');var moment=require(_0x62b6('0x1'));var BPromise=require(_0x62b6('0x2'));var rs=require(_0x62b6('0x3'));var fs=require('fs');var Redis=require(_0x62b6('0x4'));var db=require(_0x62b6('0x5'))['db'];var utils=require(_0x62b6('0x6'));var logger=require(_0x62b6('0x7'))(_0x62b6('0x8'));var config=require(_0x62b6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x62b6('0xa')][_0x62b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208403,_0xf07a62,_0x40d027){return new BPromise(function(_0x4f1e7f,_0x145799){return client[_0x62b6('0xc')](_0x208403,_0x40d027)[_0x62b6('0xd')](function(_0x2c66db){logger[_0x62b6('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0xf07a62,_0x62b6('0xf'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0xf07a62,_0x62b6('0xf'),JSON['stringify'](_0x2c66db));if(_0x2c66db[_0x62b6('0x10')]){if(_0x2c66db[_0x62b6('0x10')][_0x62b6('0x11')]===0x1f4){logger[_0x62b6('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0xf07a62,_0x2c66db[_0x62b6('0x10')][_0x62b6('0x12')]);return _0x145799(_0x2c66db[_0x62b6('0x10')]['message']);}logger[_0x62b6('0x10')](_0x62b6('0x13'),_0xf07a62,_0x2c66db[_0x62b6('0x10')][_0x62b6('0x12')]);return _0x4f1e7f(_0x2c66db[_0x62b6('0x10')][_0x62b6('0x12')]);}else{logger[_0x62b6('0xe')](_0x62b6('0x13'),_0xf07a62,'request\x20sent');_0x4f1e7f(_0x2c66db['result']['message']);}})[_0x62b6('0x14')](function(_0x425d51){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xf07a62,_0x425d51);_0x145799(_0x425d51);});});}exports['CreateFaxQueueReport']=function(_0x3f03ec){var _0x39593c=this;return new Promise(function(_0x3de2a1,_0x116e3f){return db[_0x62b6('0x15')][_0x62b6('0x16')](_0x3f03ec[_0x62b6('0x17')],{'raw':_0x3f03ec[_0x62b6('0x18')]?_0x3f03ec['options'][_0x62b6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2388df){logger[_0x62b6('0xe')](_0x62b6('0x1a'),_0x3f03ec);logger[_0x62b6('0x1b')]('CreateFaxQueueReport',_0x3f03ec,JSON[_0x62b6('0x1c')](_0x2388df));_0x3de2a1(_0x2388df);})[_0x62b6('0x14')](function(_0xc1692f){logger[_0x62b6('0x10')](_0x62b6('0x1a'),_0xc1692f[_0x62b6('0x12')],_0x3f03ec);_0x116e3f(_0x39593c['error'](0x1f4,_0xc1692f['message']));});});};exports[_0x62b6('0x1d')]=function(_0x48c1d8){var _0x5dec41=this;return new Promise(function(_0x53a93a,_0x4a9eea){return db[_0x62b6('0x15')][_0x62b6('0x1e')](_0x48c1d8[_0x62b6('0x17')],{'raw':_0x48c1d8[_0x62b6('0x18')]?_0x48c1d8['options'][_0x62b6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48c1d8[_0x62b6('0x18')]?_0x48c1d8['options'][_0x62b6('0x1f')]||null:null,'attributes':_0x48c1d8['options']?_0x48c1d8[_0x62b6('0x18')]['attributes']||null:null,'limit':_0x48c1d8[_0x62b6('0x18')]?_0x48c1d8['options'][_0x62b6('0x20')]||null:null})[_0x62b6('0xd')](function(_0x4dc055){logger[_0x62b6('0xe')]('UpdateFaxQueueReport',_0x48c1d8);logger[_0x62b6('0x1b')](_0x62b6('0x1d'),_0x48c1d8,JSON[_0x62b6('0x1c')](_0x4dc055));_0x53a93a(_0x4dc055);})[_0x62b6('0x14')](function(_0x3d6ba3){logger['error'](_0x62b6('0x1d'),_0x3d6ba3[_0x62b6('0x12')],_0x48c1d8);_0x4a9eea(_0x5dec41['error'](0x1f4,_0x3d6ba3['message']));});});}; \ No newline at end of file +var _0x2e0c=['util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','FaxQueueReport','create','options','CreateFaxQueueReport','UpdateFaxQueueReport','update','body','raw','where','attributes','stringify'];(function(_0x1db498,_0x4589c4){var _0x5a171f=function(_0x24dd12){while(--_0x24dd12){_0x1db498['push'](_0x1db498['shift']());}};_0x5a171f(++_0x4589c4);}(_0x2e0c,0x10e));var _0xc2e0=function(_0x4b9d72,_0x2704e0){_0x4b9d72=_0x4b9d72-0x0;var _0x12466c=_0x2e0c[_0x4b9d72];return _0x12466c;};'use strict';var _=require('lodash');var util=require(_0xc2e0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc2e0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc2e0('0x2'));var logger=require(_0xc2e0('0x3'))(_0xc2e0('0x4'));var config=require('../../config/environment');var jayson=require(_0xc2e0('0x5'));var client=jayson[_0xc2e0('0x6')][_0xc2e0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x135535,_0x5217db,_0x124d43){return new BPromise(function(_0x829b81,_0x4b4609){return client[_0xc2e0('0x8')](_0x135535,_0x124d43)[_0xc2e0('0x9')](function(_0x36ccf5){logger[_0xc2e0('0xa')](_0xc2e0('0xb'),_0x5217db,_0xc2e0('0xc'));logger[_0xc2e0('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x5217db,_0xc2e0('0xc'),JSON['stringify'](_0x36ccf5));if(_0x36ccf5['error']){if(_0x36ccf5['error'][_0xc2e0('0xe')]===0x1f4){logger[_0xc2e0('0xf')](_0xc2e0('0xb'),_0x5217db,_0x36ccf5[_0xc2e0('0xf')]['message']);return _0x4b4609(_0x36ccf5[_0xc2e0('0xf')][_0xc2e0('0x10')]);}logger[_0xc2e0('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x5217db,_0x36ccf5[_0xc2e0('0xf')]['message']);return _0x829b81(_0x36ccf5[_0xc2e0('0xf')][_0xc2e0('0x10')]);}else{logger['info'](_0xc2e0('0xb'),_0x5217db,_0xc2e0('0xc'));_0x829b81(_0x36ccf5[_0xc2e0('0x11')][_0xc2e0('0x10')]);}})[_0xc2e0('0x12')](function(_0x5186e1){logger[_0xc2e0('0xf')](_0xc2e0('0xb'),_0x5217db,_0x5186e1);_0x4b4609(_0x5186e1);});});}exports['CreateFaxQueueReport']=function(_0x45a545){var _0x4e7068=this;return new Promise(function(_0x384e95,_0x347b95){return db[_0xc2e0('0x13')][_0xc2e0('0x14')](_0x45a545['body'],{'raw':_0x45a545[_0xc2e0('0x15')]?_0x45a545[_0xc2e0('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3a6816){logger['info'](_0xc2e0('0x16'),_0x45a545);logger[_0xc2e0('0xd')](_0xc2e0('0x16'),_0x45a545,JSON['stringify'](_0x3a6816));_0x384e95(_0x3a6816);})[_0xc2e0('0x12')](function(_0x319b63){logger[_0xc2e0('0xf')](_0xc2e0('0x16'),_0x319b63[_0xc2e0('0x10')],_0x45a545);_0x347b95(_0x4e7068['error'](0x1f4,_0x319b63[_0xc2e0('0x10')]));});});};exports[_0xc2e0('0x17')]=function(_0x1e4d5c){var _0x2eda65=this;return new Promise(function(_0xc61234,_0x259d55){return db[_0xc2e0('0x13')][_0xc2e0('0x18')](_0x1e4d5c[_0xc2e0('0x19')],{'raw':_0x1e4d5c['options']?_0x1e4d5c[_0xc2e0('0x15')][_0xc2e0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4d5c[_0xc2e0('0x15')]?_0x1e4d5c[_0xc2e0('0x15')][_0xc2e0('0x1b')]||null:null,'attributes':_0x1e4d5c[_0xc2e0('0x15')]?_0x1e4d5c[_0xc2e0('0x15')][_0xc2e0('0x1c')]||null:null,'limit':_0x1e4d5c[_0xc2e0('0x15')]?_0x1e4d5c[_0xc2e0('0x15')]['limit']||null:null})[_0xc2e0('0x9')](function(_0x57e204){logger[_0xc2e0('0xa')]('UpdateFaxQueueReport',_0x1e4d5c);logger['debug'](_0xc2e0('0x17'),_0x1e4d5c,JSON[_0xc2e0('0x1d')](_0x57e204));_0xc61234(_0x57e204);})['catch'](function(_0x46afb0){logger[_0xc2e0('0xf')](_0xc2e0('0x17'),_0x46afb0['message'],_0x1e4d5c);_0x259d55(_0x2eda65[_0xc2e0('0xf')](0x1f4,_0x46afb0[_0xc2e0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index eb54fe7..d3cb763 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 _0x671a=['post','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x475649,_0x5d6e75){var _0x3ccb2c=function(_0x140e13){while(--_0x140e13){_0x475649['push'](_0x475649['shift']());}};_0x3ccb2c(++_0x5d6e75);}(_0x671a,0xe9));var _0xa671=function(_0x20d435,_0x1c5415){_0x20d435=_0x20d435-0x0;var _0x54288d=_0x671a[_0x20d435];return _0x54288d;};'use strict';var multer=require(_0xa671('0x0'));var util=require(_0xa671('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa671('0x2'));var router=express[_0xa671('0x3')]();var fs_extra=require(_0xa671('0x4'));var auth=require(_0xa671('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa671('0x6'));var controller=require(_0xa671('0x7'));router['get']('/',auth[_0xa671('0x8')](),controller[_0xa671('0x9')]);router[_0xa671('0xa')](_0xa671('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa671('0xa')](_0xa671('0xc'),auth[_0xa671('0x8')](),controller[_0xa671('0xd')]);router[_0xa671('0xe')]('/',auth[_0xa671('0x8')](),controller['create']);router[_0xa671('0xf')](_0xa671('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa671('0x10')](_0xa671('0xc'),auth[_0xa671('0x8')](),controller[_0xa671('0x11')]);module[_0xa671('0x12')]=router; \ No newline at end of file +var _0xf20a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','util','path','express'];(function(_0x187f03,_0x3cd0c7){var _0x25d9ea=function(_0x54c4cf){while(--_0x54c4cf){_0x187f03['push'](_0x187f03['shift']());}};_0x25d9ea(++_0x3cd0c7);}(_0xf20a,0x1f1));var _0xaf20=function(_0xcdfd9e,_0x35b27e){_0xcdfd9e=_0xcdfd9e-0x0;var _0x354c64=_0xf20a[_0xcdfd9e];return _0x354c64;};'use strict';var multer=require('multer');var util=require(_0xaf20('0x0'));var path=require(_0xaf20('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf20('0x2'));var router=express[_0xaf20('0x3')]();var fs_extra=require(_0xaf20('0x4'));var auth=require(_0xaf20('0x5'));var interaction=require(_0xaf20('0x6'));var config=require('../../config/environment');var controller=require(_0xaf20('0x7'));router[_0xaf20('0x8')]('/',auth[_0xaf20('0x9')](),controller[_0xaf20('0xa')]);router[_0xaf20('0x8')](_0xaf20('0xb'),auth[_0xaf20('0x9')](),controller['describe']);router['get'](_0xaf20('0xc'),auth[_0xaf20('0x9')](),controller[_0xaf20('0xd')]);router['post']('/',auth[_0xaf20('0x9')](),controller[_0xaf20('0xe')]);router[_0xaf20('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xaf20('0x10')]);router[_0xaf20('0x11')](_0xaf20('0xc'),auth['isAuthenticated'](),controller[_0xaf20('0x12')]);module[_0xaf20('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 67a9b96..29362c8 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xd73239,_0x488346){var _0x41cee6=function(_0x4a8bb3){while(--_0x4a8bb3){_0xd73239['push'](_0xd73239['shift']());}};_0x41cee6(++_0x488346);}(_0x008c,0x188));var _0xc008=function(_0x4f1e23,_0x166b91){_0x4f1e23=_0x4f1e23-0x0;var _0x4354b1=_0x008c[_0x4f1e23];return _0x4354b1;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x269589,_0x6b27d8){var _0x496c01=function(_0x3a332d){while(--_0x3a332d){_0x269589['push'](_0x269589['shift']());}};_0x496c01(++_0x6b27d8);}(_0x70e0,0x17b));var _0x070e=function(_0x11a4bf,_0x933a3b){_0x11a4bf=_0x11a4bf-0x0;var _0x847bba=_0x70e0[_0x11a4bf];return _0x847bba;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 14fa2ca..1889cc4 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 _0x9b09=['rows','catch','show','params','merge','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','options','includeAll','include','findAll'];(function(_0x4e1857,_0x2a6ccc){var _0x2ddd26=function(_0x35495f){while(--_0x35495f){_0x4e1857['push'](_0x4e1857['shift']());}};_0x2ddd26(++_0x2a6ccc);}(_0x9b09,0xf3));var _0x99b0=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x9b09[_0x384231];return _0x2480bf;};'use strict';var emlformat=require(_0x99b0('0x0'));var rimraf=require(_0x99b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99b0('0x2'));var rp=require(_0x99b0('0x3'));var moment=require(_0x99b0('0x4'));var BPromise=require(_0x99b0('0x5'));var Mustache=require(_0x99b0('0x6'));var util=require(_0x99b0('0x7'));var path=require(_0x99b0('0x8'));var sox=require(_0x99b0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99b0('0xa'));var _=require(_0x99b0('0xb'));var squel=require(_0x99b0('0xc'));var crypto=require(_0x99b0('0xd'));var jsforce=require(_0x99b0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x99b0('0xf'));var Papa=require(_0x99b0('0x10'));var Redis=require(_0x99b0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x99b0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x99b0('0x13'));var logger=require(_0x99b0('0x14'))(_0x99b0('0x15'));var utils=require(_0x99b0('0x16'));var config=require(_0x99b0('0x17'));var licenseUtil=require(_0x99b0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x293141,_0x11e3cf){_0x11e3cf=_0x11e3cf||0xcc;return function(_0x103eb6){if(_0x103eb6){return _0x293141[_0x99b0('0x19')](_0x11e3cf);}return _0x293141[_0x99b0('0x1a')](_0x11e3cf)[_0x99b0('0x1b')]();};}function respondWithResult(_0x3c1ffe,_0x226a65){_0x226a65=_0x226a65||0xc8;return function(_0xcf3c17){if(_0xcf3c17){return _0x3c1ffe[_0x99b0('0x1a')](_0x226a65)[_0x99b0('0x1c')](_0xcf3c17);}};}function respondWithFilteredResult(_0x3678a5,_0x20920c){return function(_0x262aa5){if(_0x262aa5){var _0x2e52eb=typeof _0x20920c[_0x99b0('0x1d')]===_0x99b0('0x1e')&&typeof _0x20920c['limit']===_0x99b0('0x1e');var _0x533350=_0x262aa5['count'];var _0x19ad7a=_0x2e52eb?0x0:_0x20920c['offset'];var _0x4b5065=_0x2e52eb?_0x262aa5[_0x99b0('0x1f')]:_0x20920c[_0x99b0('0x1d')]+_0x20920c[_0x99b0('0x20')];var _0x270979;if(_0x4b5065>=_0x533350){_0x4b5065=_0x533350;_0x270979=0xc8;}else{_0x270979=0xce;}_0x3678a5[_0x99b0('0x1a')](_0x270979);return _0x3678a5['set'](_0x99b0('0x21'),_0x19ad7a+'-'+_0x4b5065+'/'+_0x533350)[_0x99b0('0x1c')](_0x262aa5);}return null;};}function patchUpdates(_0x45e729){return function(_0x292e6d){try{jsonpatch[_0x99b0('0x22')](_0x292e6d,_0x45e729,!![]);}catch(_0x53234b){return BPromise[_0x99b0('0x23')](_0x53234b);}return _0x292e6d[_0x99b0('0x24')]();};}function saveUpdates(_0x1bd72c,_0x4836ef){return function(_0x59a3ae){if(_0x59a3ae){return _0x59a3ae['update'](_0x1bd72c)['then'](function(_0x3ee296){return _0x3ee296;});}return null;};}function removeEntity(_0x41e5ca,_0x200e6b){return function(_0x4483fc){if(_0x4483fc){return _0x4483fc[_0x99b0('0x25')]()[_0x99b0('0x26')](function(){_0x41e5ca[_0x99b0('0x1a')](0xcc)[_0x99b0('0x1b')]();});}};}function handleEntityNotFound(_0x12ed8b,_0x1c7f51){return function(_0x33bd8e){if(!_0x33bd8e){_0x12ed8b[_0x99b0('0x19')](0x194);}return _0x33bd8e;};}function handleError(_0x1ec726,_0x4fc216){_0x4fc216=_0x4fc216||0x1f4;return function(_0x1b39e4){logger[_0x99b0('0x27')](_0x1b39e4[_0x99b0('0x28')]);if(_0x1b39e4[_0x99b0('0x29')]){delete _0x1b39e4['name'];}_0x1ec726[_0x99b0('0x1a')](_0x4fc216)[_0x99b0('0x2a')](_0x1b39e4);};}exports[_0x99b0('0x2b')]=function(_0x579c48,_0x276b9b){var _0xe5d21b={},_0x5944fa={},_0x5432e2={'count':0x0,'rows':[]};var _0x586813=_['map'](db[_0x99b0('0x2c')][_0x99b0('0x2d')],function(_0x184a90){return{'name':_0x184a90[_0x99b0('0x2e')],'type':_0x184a90['type'][_0x99b0('0x2f')]};});_0x5944fa['model']=_['map'](_0x586813,_0x99b0('0x29'));_0x5944fa['query']=_[_0x99b0('0x30')](_0x579c48[_0x99b0('0x31')]);_0x5944fa[_0x99b0('0x32')]=_[_0x99b0('0x33')](_0x5944fa[_0x99b0('0x34')],_0x5944fa[_0x99b0('0x31')]);_0xe5d21b[_0x99b0('0x35')]=_['intersection'](_0x5944fa[_0x99b0('0x34')],qs[_0x99b0('0x36')](_0x579c48['query']['fields']));_0xe5d21b[_0x99b0('0x35')]=_0xe5d21b[_0x99b0('0x35')][_0x99b0('0x37')]?_0xe5d21b['attributes']:_0x5944fa['model'];if(!_0x579c48['query'][_0x99b0('0x38')](_0x99b0('0x39'))){_0xe5d21b[_0x99b0('0x20')]=qs['limit'](_0x579c48['query'][_0x99b0('0x20')]);_0xe5d21b['offset']=qs[_0x99b0('0x1d')](_0x579c48[_0x99b0('0x31')]['offset']);}_0xe5d21b[_0x99b0('0x3a')]=qs[_0x99b0('0x3b')](_0x579c48[_0x99b0('0x31')]['sort']);_0xe5d21b[_0x99b0('0x3c')]=qs['filters'](_[_0x99b0('0x3d')](_0x579c48[_0x99b0('0x31')],_0x5944fa[_0x99b0('0x32')]),_0x586813);if(_0x579c48[_0x99b0('0x31')][_0x99b0('0x3e')]){_0xe5d21b[_0x99b0('0x3c')]=_['merge'](_0xe5d21b[_0x99b0('0x3c')],{'$or':_[_0x99b0('0x3f')](_0x586813,function(_0x20cddb){if(_0x20cddb[_0x99b0('0x40')]!=='VIRTUAL'){var _0x59e341={};_0x59e341[_0x20cddb[_0x99b0('0x29')]]={'$like':'%'+_0x579c48[_0x99b0('0x31')][_0x99b0('0x3e')]+'%'};return _0x59e341;}})});}_0xe5d21b=_['merge']({},_0xe5d21b,_0x579c48[_0x99b0('0x41')]);var _0x12361c={'where':_0xe5d21b[_0x99b0('0x3c')]};return db[_0x99b0('0x2c')][_0x99b0('0x1f')](_0x12361c)['then'](function(_0x33f6c1){_0x5432e2[_0x99b0('0x1f')]=_0x33f6c1;if(_0x579c48[_0x99b0('0x31')][_0x99b0('0x42')]){_0xe5d21b[_0x99b0('0x43')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x99b0('0x44')](_0xe5d21b);})[_0x99b0('0x26')](function(_0x1b94a3){_0x5432e2[_0x99b0('0x45')]=_0x1b94a3;return _0x5432e2;})[_0x99b0('0x26')](respondWithFilteredResult(_0x276b9b,_0xe5d21b))[_0x99b0('0x46')](handleError(_0x276b9b,null));};exports[_0x99b0('0x47')]=function(_0x2e5225,_0x32655b){var _0x3c77a5={'raw':!![],'where':{'id':_0x2e5225[_0x99b0('0x48')]['id']}},_0xb9a9b9={};_0xb9a9b9['model']=_[_0x99b0('0x30')](db[_0x99b0('0x2c')][_0x99b0('0x2d')]);_0xb9a9b9[_0x99b0('0x31')]=_[_0x99b0('0x30')](_0x2e5225['query']);_0xb9a9b9[_0x99b0('0x32')]=_['intersection'](_0xb9a9b9[_0x99b0('0x34')],_0xb9a9b9[_0x99b0('0x31')]);_0x3c77a5[_0x99b0('0x35')]=_[_0x99b0('0x33')](_0xb9a9b9[_0x99b0('0x34')],qs[_0x99b0('0x36')](_0x2e5225['query'][_0x99b0('0x36')]));_0x3c77a5[_0x99b0('0x35')]=_0x3c77a5[_0x99b0('0x35')][_0x99b0('0x37')]?_0x3c77a5[_0x99b0('0x35')]:_0xb9a9b9['model'];if(_0x2e5225[_0x99b0('0x31')][_0x99b0('0x42')]){_0x3c77a5['include']=[{'all':!![]}];}_0x3c77a5=_[_0x99b0('0x49')]({},_0x3c77a5,_0x2e5225[_0x99b0('0x41')]);return db['FaxTransferReport'][_0x99b0('0x4a')](_0x3c77a5)['then'](handleEntityNotFound(_0x32655b,null))[_0x99b0('0x26')](respondWithResult(_0x32655b,null))[_0x99b0('0x46')](handleError(_0x32655b,null));};exports[_0x99b0('0x4b')]=function(_0x5197ed,_0x36d066){return db['FaxTransferReport'][_0x99b0('0x4b')](_0x5197ed[_0x99b0('0x4c')],{})['then'](respondWithResult(_0x36d066,0xc9))[_0x99b0('0x46')](handleError(_0x36d066,null));};exports[_0x99b0('0x4d')]=function(_0x330dee,_0x4eba1c){if(_0x330dee[_0x99b0('0x4c')]['id']){delete _0x330dee['body']['id'];}return db[_0x99b0('0x2c')]['find']({'where':{'id':_0x330dee[_0x99b0('0x48')]['id']}})[_0x99b0('0x26')](handleEntityNotFound(_0x4eba1c,null))['then'](saveUpdates(_0x330dee[_0x99b0('0x4c')],null))['then'](respondWithResult(_0x4eba1c,null))[_0x99b0('0x46')](handleError(_0x4eba1c,null));};exports[_0x99b0('0x25')]=function(_0x20a401,_0x22a3da){return db[_0x99b0('0x2c')][_0x99b0('0x4a')]({'where':{'id':_0x20a401['params']['id']}})[_0x99b0('0x26')](handleEntityNotFound(_0x22a3da,null))['then'](removeEntity(_0x22a3da,null))[_0x99b0('0x46')](handleError(_0x22a3da,null));};exports['describe']=function(_0xdc0ec9,_0x20bf60){return db[_0x99b0('0x2c')]['describe']()['then'](respondWithResult(_0x20bf60,null))[_0x99b0('0x46')](handleError(_0x20bf60,null));}; \ No newline at end of file +var _0x12f3=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','length','options','FaxTransferReport','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','jsforce','desk.js'];(function(_0xca4d0c,_0xad1d7e){var _0x37d545=function(_0x9aeed7){while(--_0x9aeed7){_0xca4d0c['push'](_0xca4d0c['shift']());}};_0x37d545(++_0xad1d7e);}(_0x12f3,0x161));var _0x312f=function(_0x1a1199,_0xd173ac){_0x1a1199=_0x1a1199-0x0;var _0x3094be=_0x12f3[_0x1a1199];return _0x3094be;};'use strict';var emlformat=require(_0x312f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x312f('0x1'));var rp=require(_0x312f('0x2'));var moment=require(_0x312f('0x3'));var BPromise=require(_0x312f('0x4'));var Mustache=require(_0x312f('0x5'));var util=require(_0x312f('0x6'));var path=require(_0x312f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x312f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x312f('0x9'));var crypto=require('crypto');var jsforce=require(_0x312f('0xa'));var deskjs=require(_0x312f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x312f('0xc'));var Papa=require(_0x312f('0xd'));var Redis=require(_0x312f('0xe'));var authService=require(_0x312f('0xf'));var qs=require(_0x312f('0x10'));var as=require(_0x312f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x312f('0x12'));var utils=require(_0x312f('0x13'));var config=require(_0x312f('0x14'));var licenseUtil=require(_0x312f('0x15'));var db=require(_0x312f('0x16'))['db'];function respondWithStatusCode(_0x1f53b0,_0x50ab81){_0x50ab81=_0x50ab81||0xcc;return function(_0x3eb7e2){if(_0x3eb7e2){return _0x1f53b0[_0x312f('0x17')](_0x50ab81);}return _0x1f53b0[_0x312f('0x18')](_0x50ab81)[_0x312f('0x19')]();};}function respondWithResult(_0x415da4,_0x2c139a){_0x2c139a=_0x2c139a||0xc8;return function(_0x19c261){if(_0x19c261){return _0x415da4[_0x312f('0x18')](_0x2c139a)[_0x312f('0x1a')](_0x19c261);}};}function respondWithFilteredResult(_0x460d42,_0x1322f8){return function(_0x1e7ac7){if(_0x1e7ac7){var _0x1e0e04=typeof _0x1322f8[_0x312f('0x1b')]===_0x312f('0x1c')&&typeof _0x1322f8[_0x312f('0x1d')]==='undefined';var _0x406cb0=_0x1e7ac7['count'];var _0x367837=_0x1e0e04?0x0:_0x1322f8['offset'];var _0x504541=_0x1e0e04?_0x1e7ac7[_0x312f('0x1e')]:_0x1322f8[_0x312f('0x1b')]+_0x1322f8[_0x312f('0x1d')];var _0x53a595;if(_0x504541>=_0x406cb0){_0x504541=_0x406cb0;_0x53a595=0xc8;}else{_0x53a595=0xce;}_0x460d42['status'](_0x53a595);return _0x460d42['set'](_0x312f('0x1f'),_0x367837+'-'+_0x504541+'/'+_0x406cb0)[_0x312f('0x1a')](_0x1e7ac7);}return null;};}function patchUpdates(_0xf34d1c){return function(_0xf6b9d6){try{jsonpatch[_0x312f('0x20')](_0xf6b9d6,_0xf34d1c,!![]);}catch(_0x5a0d0e){return BPromise[_0x312f('0x21')](_0x5a0d0e);}return _0xf6b9d6['save']();};}function saveUpdates(_0x1bf31b,_0x1c1fcf){return function(_0x264b19){if(_0x264b19){return _0x264b19[_0x312f('0x22')](_0x1bf31b)[_0x312f('0x23')](function(_0xd9c0fa){return _0xd9c0fa;});}return null;};}function removeEntity(_0x1316bd,_0x27efa0){return function(_0x4eb319){if(_0x4eb319){return _0x4eb319[_0x312f('0x24')]()[_0x312f('0x23')](function(){_0x1316bd[_0x312f('0x18')](0xcc)[_0x312f('0x19')]();});}};}function handleEntityNotFound(_0x390e0f,_0x1d92e9){return function(_0x50a868){if(!_0x50a868){_0x390e0f[_0x312f('0x17')](0x194);}return _0x50a868;};}function handleError(_0x575c0a,_0x591e08){_0x591e08=_0x591e08||0x1f4;return function(_0x5a47de){logger[_0x312f('0x25')](_0x5a47de[_0x312f('0x26')]);if(_0x5a47de['name']){delete _0x5a47de[_0x312f('0x27')];}_0x575c0a[_0x312f('0x18')](_0x591e08)[_0x312f('0x28')](_0x5a47de);};}exports[_0x312f('0x29')]=function(_0x4a5c80,_0x4a1999){var _0x5e77e4={},_0x2dadc5={},_0x268d73={'count':0x0,'rows':[]};var _0x14e593=_['map'](db['FaxTransferReport'][_0x312f('0x2a')],function(_0x5ce62a){return{'name':_0x5ce62a['fieldName'],'type':_0x5ce62a[_0x312f('0x2b')]['key']};});_0x2dadc5[_0x312f('0x2c')]=_[_0x312f('0x2d')](_0x14e593,_0x312f('0x27'));_0x2dadc5[_0x312f('0x2e')]=_[_0x312f('0x2f')](_0x4a5c80[_0x312f('0x2e')]);_0x2dadc5[_0x312f('0x30')]=_['intersection'](_0x2dadc5[_0x312f('0x2c')],_0x2dadc5[_0x312f('0x2e')]);_0x5e77e4[_0x312f('0x31')]=_[_0x312f('0x32')](_0x2dadc5[_0x312f('0x2c')],qs[_0x312f('0x33')](_0x4a5c80[_0x312f('0x2e')][_0x312f('0x33')]));_0x5e77e4[_0x312f('0x31')]=_0x5e77e4[_0x312f('0x31')]['length']?_0x5e77e4[_0x312f('0x31')]:_0x2dadc5[_0x312f('0x2c')];if(!_0x4a5c80['query'][_0x312f('0x34')](_0x312f('0x35'))){_0x5e77e4[_0x312f('0x1d')]=qs['limit'](_0x4a5c80[_0x312f('0x2e')]['limit']);_0x5e77e4[_0x312f('0x1b')]=qs[_0x312f('0x1b')](_0x4a5c80['query'][_0x312f('0x1b')]);}_0x5e77e4[_0x312f('0x36')]=qs['sort'](_0x4a5c80[_0x312f('0x2e')]['sort']);_0x5e77e4[_0x312f('0x37')]=qs[_0x312f('0x30')](_[_0x312f('0x38')](_0x4a5c80[_0x312f('0x2e')],_0x2dadc5['filters']),_0x14e593);if(_0x4a5c80[_0x312f('0x2e')]['filter']){_0x5e77e4[_0x312f('0x37')]=_[_0x312f('0x39')](_0x5e77e4[_0x312f('0x37')],{'$or':_['map'](_0x14e593,function(_0xf8141b){if(_0xf8141b[_0x312f('0x2b')]!==_0x312f('0x3a')){var _0x2d1592={};_0x2d1592[_0xf8141b[_0x312f('0x27')]]={'$like':'%'+_0x4a5c80[_0x312f('0x2e')][_0x312f('0x3b')]+'%'};return _0x2d1592;}})});}_0x5e77e4=_[_0x312f('0x39')]({},_0x5e77e4,_0x4a5c80['options']);var _0x147cff={'where':_0x5e77e4[_0x312f('0x37')]};return db['FaxTransferReport'][_0x312f('0x1e')](_0x147cff)[_0x312f('0x23')](function(_0x5cae7e){_0x268d73[_0x312f('0x1e')]=_0x5cae7e;if(_0x4a5c80[_0x312f('0x2e')][_0x312f('0x3c')]){_0x5e77e4[_0x312f('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x312f('0x3e')](_0x5e77e4);})[_0x312f('0x23')](function(_0x42c38b){_0x268d73[_0x312f('0x3f')]=_0x42c38b;return _0x268d73;})['then'](respondWithFilteredResult(_0x4a1999,_0x5e77e4))[_0x312f('0x40')](handleError(_0x4a1999,null));};exports['show']=function(_0x581cb8,_0x33de07){var _0x111ff6={'raw':!![],'where':{'id':_0x581cb8['params']['id']}},_0x41da35={};_0x41da35['model']=_[_0x312f('0x2f')](db['FaxTransferReport'][_0x312f('0x2a')]);_0x41da35[_0x312f('0x2e')]=_[_0x312f('0x2f')](_0x581cb8[_0x312f('0x2e')]);_0x41da35[_0x312f('0x30')]=_['intersection'](_0x41da35[_0x312f('0x2c')],_0x41da35['query']);_0x111ff6[_0x312f('0x31')]=_['intersection'](_0x41da35[_0x312f('0x2c')],qs[_0x312f('0x33')](_0x581cb8['query'][_0x312f('0x33')]));_0x111ff6[_0x312f('0x31')]=_0x111ff6[_0x312f('0x31')][_0x312f('0x41')]?_0x111ff6[_0x312f('0x31')]:_0x41da35[_0x312f('0x2c')];if(_0x581cb8[_0x312f('0x2e')][_0x312f('0x3c')]){_0x111ff6[_0x312f('0x3d')]=[{'all':!![]}];}_0x111ff6=_[_0x312f('0x39')]({},_0x111ff6,_0x581cb8[_0x312f('0x42')]);return db[_0x312f('0x43')][_0x312f('0x44')](_0x111ff6)[_0x312f('0x23')](handleEntityNotFound(_0x33de07,null))[_0x312f('0x23')](respondWithResult(_0x33de07,null))[_0x312f('0x40')](handleError(_0x33de07,null));};exports['create']=function(_0x1c1048,_0x472f9a){return db['FaxTransferReport'][_0x312f('0x45')](_0x1c1048[_0x312f('0x46')],{})['then'](respondWithResult(_0x472f9a,0xc9))[_0x312f('0x40')](handleError(_0x472f9a,null));};exports[_0x312f('0x22')]=function(_0x5baca6,_0x3d1a17){if(_0x5baca6[_0x312f('0x46')]['id']){delete _0x5baca6['body']['id'];}return db['FaxTransferReport'][_0x312f('0x44')]({'where':{'id':_0x5baca6[_0x312f('0x47')]['id']}})[_0x312f('0x23')](handleEntityNotFound(_0x3d1a17,null))['then'](saveUpdates(_0x5baca6[_0x312f('0x46')],null))[_0x312f('0x23')](respondWithResult(_0x3d1a17,null))[_0x312f('0x40')](handleError(_0x3d1a17,null));};exports['destroy']=function(_0x4cb92a,_0x435c70){return db[_0x312f('0x43')][_0x312f('0x44')]({'where':{'id':_0x4cb92a[_0x312f('0x47')]['id']}})['then'](handleEntityNotFound(_0x435c70,null))[_0x312f('0x23')](removeEntity(_0x435c70,null))[_0x312f('0x40')](handleError(_0x435c70,null));};exports[_0x312f('0x48')]=function(_0x352805,_0x888504){return db[_0x312f('0x43')][_0x312f('0x48')]()[_0x312f('0x23')](respondWithResult(_0x888504,null))[_0x312f('0x40')](handleError(_0x888504,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f88e372..1b231fc 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 _0x584e=['report_fax_transfer','lodash','../../config/logger','api','moment','path','rimraf','./faxTransferReport.attributes','FaxTransferReport'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x584e,0xa3));var _0xe584=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x584e[_0x5beda8];return _0x2aa042;};'use strict';var _=require(_0xe584('0x0'));var util=require('util');var logger=require(_0xe584('0x1'))(_0xe584('0x2'));var moment=require(_0xe584('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe584('0x4'));var rimraf=require(_0xe584('0x5'));var config=require('../../config/environment');var attributes=require(_0xe584('0x6'));module['exports']=function(_0x59f5d0,_0x3413d9){return _0x59f5d0['define'](_0xe584('0x7'),attributes,{'tableName':_0xe584('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9512=['./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9512,0x75));var _0x2951=function(_0x684f8d,_0x35f431){_0x684f8d=_0x684f8d-0x0;var _0x1487d4=_0x9512[_0x684f8d];return _0x1487d4;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var logger=require(_0x2951('0x2'))(_0x2951('0x3'));var moment=require(_0x2951('0x4'));var BPromise=require(_0x2951('0x5'));var rp=require(_0x2951('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2951('0x7'));var config=require(_0x2951('0x8'));var attributes=require(_0x2951('0x9'));module[_0x2951('0xa')]=function(_0x15d4fa,_0x293a9c){return _0x15d4fa[_0x2951('0xb')]('FaxTransferReport',attributes,{'tableName':_0x2951('0xc'),'paranoid':![],'indexes':[{'name':_0x2951('0xd'),'fields':[_0x2951('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 4331351..6a6a90d 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 _0x0762=['stringify','error','message','result','catch','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2f8b7b,_0x2b2b1c){var _0x4c845f=function(_0x7132f6){while(--_0x7132f6){_0x2f8b7b['push'](_0x2f8b7b['shift']());}};_0x4c845f(++_0x2b2b1c);}(_0x0762,0xc0));var _0x2076=function(_0x849e8d,_0x21b681){_0x849e8d=_0x849e8d-0x0;var _0x53d15d=_0x0762[_0x849e8d];return _0x53d15d;};'use strict';var _=require('lodash');var util=require(_0x2076('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2076('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2076('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2076('0x3'))(_0x2076('0x4'));var config=require(_0x2076('0x5'));var jayson=require(_0x2076('0x6'));var client=jayson[_0x2076('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x360b5a,_0x4dcfd4,_0x14140b){return new BPromise(function(_0x2c458f,_0x527812){return client['request'](_0x360b5a,_0x14140b)['then'](function(_0x36bfe1){logger[_0x2076('0x8')](_0x2076('0x9'),_0x4dcfd4,_0x2076('0xa'));logger['debug'](_0x2076('0xb'),_0x4dcfd4,_0x2076('0xa'),JSON[_0x2076('0xc')](_0x36bfe1));if(_0x36bfe1['error']){if(_0x36bfe1[_0x2076('0xd')]['code']===0x1f4){logger['error'](_0x2076('0x9'),_0x4dcfd4,_0x36bfe1[_0x2076('0xd')][_0x2076('0xe')]);return _0x527812(_0x36bfe1[_0x2076('0xd')][_0x2076('0xe')]);}logger[_0x2076('0xd')](_0x2076('0x9'),_0x4dcfd4,_0x36bfe1[_0x2076('0xd')][_0x2076('0xe')]);return _0x2c458f(_0x36bfe1[_0x2076('0xd')]['message']);}else{logger[_0x2076('0x8')](_0x2076('0x9'),_0x4dcfd4,_0x2076('0xa'));_0x2c458f(_0x36bfe1[_0x2076('0xf')][_0x2076('0xe')]);}})[_0x2076('0x10')](function(_0xbc155f){logger[_0x2076('0xd')](_0x2076('0x9'),_0x4dcfd4,_0xbc155f);_0x527812(_0xbc155f);});});} \ No newline at end of file +var _0x3a1a=['http','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','FaxTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x35ac6c,_0xc950f6){var _0x2099e3=function(_0x37041d){while(--_0x37041d){_0x35ac6c['push'](_0x35ac6c['shift']());}};_0x2099e3(++_0xc950f6);}(_0x3a1a,0x199));var _0xa3a1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3a1a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa3a1('0x0'));var util=require(_0xa3a1('0x1'));var moment=require(_0xa3a1('0x2'));var BPromise=require(_0xa3a1('0x3'));var rs=require(_0xa3a1('0x4'));var fs=require('fs');var Redis=require(_0xa3a1('0x5'));var db=require(_0xa3a1('0x6'))['db'];var utils=require(_0xa3a1('0x7'));var logger=require(_0xa3a1('0x8'))(_0xa3a1('0x9'));var config=require('../../config/environment');var jayson=require(_0xa3a1('0xa'));var client=jayson['client'][_0xa3a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a48d5,_0x43a6f5,_0x1163c8){return new BPromise(function(_0x39a3b7,_0x522a2b){return client['request'](_0x5a48d5,_0x1163c8)['then'](function(_0x4d427c){logger[_0xa3a1('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x43a6f5,_0xa3a1('0xd'));logger['debug'](_0xa3a1('0xe'),_0x43a6f5,_0xa3a1('0xd'),JSON['stringify'](_0x4d427c));if(_0x4d427c[_0xa3a1('0xf')]){if(_0x4d427c['error'][_0xa3a1('0x10')]===0x1f4){logger[_0xa3a1('0xf')](_0xa3a1('0x11'),_0x43a6f5,_0x4d427c[_0xa3a1('0xf')][_0xa3a1('0x12')]);return _0x522a2b(_0x4d427c[_0xa3a1('0xf')]['message']);}logger[_0xa3a1('0xf')](_0xa3a1('0x11'),_0x43a6f5,_0x4d427c[_0xa3a1('0xf')][_0xa3a1('0x12')]);return _0x39a3b7(_0x4d427c[_0xa3a1('0xf')][_0xa3a1('0x12')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x43a6f5,_0xa3a1('0xd'));_0x39a3b7(_0x4d427c['result'][_0xa3a1('0x12')]);}})[_0xa3a1('0x13')](function(_0x51d009){logger[_0xa3a1('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x43a6f5,_0x51d009);_0x522a2b(_0x51d009);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 31d75dd..250855c 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 _0x94d3=['post','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x94d3,0x70));var _0x394d=function(_0x29e7a4,_0x549702){_0x29e7a4=_0x29e7a4-0x0;var _0x4ce914=_0x94d3[_0x29e7a4];return _0x4ce914;};'use strict';var multer=require(_0x394d('0x0'));var util=require(_0x394d('0x1'));var path=require(_0x394d('0x2'));var timeout=require(_0x394d('0x3'));var express=require(_0x394d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x394d('0x5'));var interaction=require(_0x394d('0x6'));var config=require('../../config/environment');var controller=require(_0x394d('0x7'));router['get']('/',auth[_0x394d('0x8')](),controller[_0x394d('0x9')]);router[_0x394d('0xa')](_0x394d('0xb'),auth[_0x394d('0x8')](),controller[_0x394d('0xc')]);router[_0x394d('0xa')](_0x394d('0xd'),auth[_0x394d('0x8')](),controller['show']);router[_0x394d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x394d('0xf')](_0x394d('0xd'),auth[_0x394d('0x8')](),controller[_0x394d('0x10')]);router['delete']('/:id',auth[_0x394d('0x8')](),controller[_0x394d('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdaf3=['exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy'];(function(_0x5e6094,_0x31919b){var _0xf4c05e=function(_0x248a11){while(--_0x248a11){_0x5e6094['push'](_0x5e6094['shift']());}};_0xf4c05e(++_0x31919b);}(_0xdaf3,0x18d));var _0x3daf=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0xdaf3[_0x1b8b95];return _0x3657ae;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3daf('0x0'));var express=require(_0x3daf('0x1'));var router=express[_0x3daf('0x2')]();var fs_extra=require(_0x3daf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3daf('0x4'));var config=require(_0x3daf('0x5'));var controller=require(_0x3daf('0x6'));router[_0x3daf('0x7')]('/',auth[_0x3daf('0x8')](),controller['index']);router[_0x3daf('0x7')](_0x3daf('0x9'),auth[_0x3daf('0x8')](),controller[_0x3daf('0xa')]);router[_0x3daf('0x7')](_0x3daf('0xb'),auth['isAuthenticated'](),controller[_0x3daf('0xc')]);router[_0x3daf('0xd')]('/',auth[_0x3daf('0x8')](),controller['create']);router[_0x3daf('0xe')](_0x3daf('0xb'),auth[_0x3daf('0x8')](),controller['update']);router[_0x3daf('0xf')]('/:id',auth[_0x3daf('0x8')](),controller[_0x3daf('0x10')]);module[_0x3daf('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a579b28..c233486 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 _0xa990=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','put','destroy','util','path'];(function(_0x4ccaba,_0x2494f8){var _0x126e09=function(_0x17eeb2){while(--_0x17eeb2){_0x4ccaba['push'](_0x4ccaba['shift']());}};_0x126e09(++_0x2494f8);}(_0xa990,0xf0));var _0x0a99=function(_0x28bf90,_0x3e9d56){_0x28bf90=_0x28bf90-0x0;var _0x24be81=_0xa990[_0x28bf90];return _0x24be81;};'use strict';var multer=require('multer');var util=require(_0x0a99('0x0'));var path=require(_0x0a99('0x1'));var timeout=require(_0x0a99('0x2'));var express=require(_0x0a99('0x3'));var router=express[_0x0a99('0x4')]();var fs_extra=require(_0x0a99('0x5'));var auth=require(_0x0a99('0x6'));var interaction=require(_0x0a99('0x7'));var config=require(_0x0a99('0x8'));var controller=require(_0x0a99('0x9'));router[_0x0a99('0xa')]('/',auth['isAuthenticated'](),controller[_0x0a99('0xb')]);router[_0x0a99('0xa')](_0x0a99('0xc'),auth[_0x0a99('0xd')](),controller[_0x0a99('0xe')]);router[_0x0a99('0xa')](_0x0a99('0xf'),auth[_0x0a99('0xd')](),controller['getConfigurations']);router[_0x0a99('0xa')]('/:id/fields',auth[_0x0a99('0xd')](),controller[_0x0a99('0x10')]);router[_0x0a99('0x11')]('/',auth[_0x0a99('0xd')](),controller[_0x0a99('0x12')]);router[_0x0a99('0x11')](_0x0a99('0xf'),auth['isAuthenticated'](),controller[_0x0a99('0x13')]);router[_0x0a99('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a99('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3d70=['multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete'];(function(_0x7a78d7,_0x4aa57c){var _0x33a5da=function(_0x1f6cad){while(--_0x1f6cad){_0x7a78d7['push'](_0x7a78d7['shift']());}};_0x33a5da(++_0x4aa57c);}(_0x3d70,0xe7));var _0x03d7=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x3d70[_0x152121];return _0x592a85;};'use strict';var multer=require(_0x03d7('0x0'));var util=require(_0x03d7('0x1'));var path=require(_0x03d7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x03d7('0x3')]();var fs_extra=require(_0x03d7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x03d7('0x5'));var config=require(_0x03d7('0x6'));var controller=require(_0x03d7('0x7'));router[_0x03d7('0x8')]('/',auth[_0x03d7('0x9')](),controller[_0x03d7('0xa')]);router[_0x03d7('0x8')](_0x03d7('0xb'),auth['isAuthenticated'](),controller[_0x03d7('0xc')]);router[_0x03d7('0x8')](_0x03d7('0xd'),auth[_0x03d7('0x9')](),controller[_0x03d7('0xe')]);router[_0x03d7('0x8')](_0x03d7('0xf'),auth[_0x03d7('0x9')](),controller['getFields']);router[_0x03d7('0x10')]('/',auth[_0x03d7('0x9')](),controller['create']);router[_0x03d7('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x03d7('0x11')]);router[_0x03d7('0x12')]('/:id',auth[_0x03d7('0x9')](),controller[_0x03d7('0x13')]);router[_0x03d7('0x14')]('/:id',auth[_0x03d7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 939cca9..cba4a79 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 _0x78f6=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x2dbdc3,_0x2435a0){var _0x538a79=function(_0x386fd0){while(--_0x386fd0){_0x2dbdc3['push'](_0x2dbdc3['shift']());}};_0x538a79(++_0x2435a0);}(_0x78f6,0x19f));var _0x678f=function(_0x1e3bd4,_0x29012e){_0x1e3bd4=_0x1e3bd4-0x0;var _0x273516=_0x78f6[_0x1e3bd4];return _0x273516;};'use strict';var Sequelize=require(_0x678f('0x0'));module[_0x678f('0x1')]={'name':{'type':Sequelize[_0x678f('0x2')]},'description':{'type':Sequelize[_0x678f('0x2')]},'username':{'type':Sequelize[_0x678f('0x2')]},'remoteUri':{'type':Sequelize[_0x678f('0x2')]},'authType':{'type':Sequelize[_0x678f('0x3')](_0x678f('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x678f('0x2')]},'consumerSecret':{'type':Sequelize[_0x678f('0x2')]},'token':{'type':Sequelize[_0x678f('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x678f('0x3')](_0x678f('0x5'),'newTab'),'defaultValue':_0x678f('0x5')}}; \ No newline at end of file +var _0x7a06=['exports','STRING','basic','ENUM','integrationTab','newTab','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a06,0x99));var _0x67a0=function(_0x4e91d7,_0x4059e5){_0x4e91d7=_0x4e91d7-0x0;var _0x2faacc=_0x7a06[_0x4e91d7];return _0x2faacc;};'use strict';var Sequelize=require(_0x67a0('0x0'));module[_0x67a0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x67a0('0x2')]},'username':{'type':Sequelize[_0x67a0('0x2')]},'remoteUri':{'type':Sequelize[_0x67a0('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x67a0('0x3')),'defaultValue':_0x67a0('0x3')},'password':{'type':Sequelize[_0x67a0('0x2')]},'consumerKey':{'type':Sequelize[_0x67a0('0x2')]},'consumerSecret':{'type':Sequelize[_0x67a0('0x2')]},'token':{'type':Sequelize[_0x67a0('0x2')]},'tokenSecret':{'type':Sequelize[_0x67a0('0x2')]},'serverUrl':{'type':Sequelize[_0x67a0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x67a0('0x4')](_0x67a0('0x5'),_0x67a0('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index ae514af..a68520a 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 _0x4738=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','end','offset','undefined','count','limit','json','reject','save','update','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','order','AccountId','getSubjects','Descriptions','getDescriptions','channel','DeskField','Subjects','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x4738,0xe8));var _0x8473=function(_0x8aadfe,_0x451fb6){_0x8aadfe=_0x8aadfe-0x0;var _0x3d148d=_0x4738[_0x8aadfe];return _0x3d148d;};'use strict';var emlformat=require(_0x8473('0x0'));var rimraf=require(_0x8473('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8473('0x2'));var rp=require(_0x8473('0x3'));var moment=require(_0x8473('0x4'));var BPromise=require(_0x8473('0x5'));var Mustache=require(_0x8473('0x6'));var util=require(_0x8473('0x7'));var path=require(_0x8473('0x8'));var sox=require(_0x8473('0x9'));var csv=require(_0x8473('0xa'));var ejs=require(_0x8473('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8473('0xc'));var squel=require(_0x8473('0xd'));var crypto=require(_0x8473('0xe'));var jsforce=require(_0x8473('0xf'));var deskjs=require(_0x8473('0x10'));var toCsv=require(_0x8473('0xa'));var querystring=require('querystring');var Papa=require(_0x8473('0x11'));var Redis=require('ioredis');var authService=require(_0x8473('0x12'));var qs=require(_0x8473('0x13'));var as=require(_0x8473('0x14'));var hardwareService=require(_0x8473('0x15'));var logger=require('../../config/logger')(_0x8473('0x16'));var utils=require(_0x8473('0x17'));var config=require(_0x8473('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8473('0x19'))['db'];var integrations=require(_0x8473('0x1a'));var jayson=require(_0x8473('0x1b'));var client=jayson[_0x8473('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43407e,_0x417050,_0x56d6ce,_0x151012){return new BPromise(function(_0xf4295a,_0x53c6d3){var _0x4f4bba=_0x151012||client;return _0x4f4bba[_0x8473('0x1d')](_0x43407e,_0x56d6ce)[_0x8473('0x1e')](function(_0x33c1e5){logger[_0x8473('0x1f')](_0x8473('0x20'),_0x417050,_0x8473('0x21'));logger[_0x8473('0x22')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x417050,_0x8473('0x21'),JSON[_0x8473('0x23')](_0x33c1e5));if(_0x33c1e5['error']){if(_0x33c1e5[_0x8473('0x24')]['code']===0x1f4){logger[_0x8473('0x24')](_0x8473('0x20'),_0x417050,_0x33c1e5['error']['message']);return _0x53c6d3(_0x33c1e5[_0x8473('0x24')][_0x8473('0x25')]);}logger[_0x8473('0x24')](_0x8473('0x20'),_0x417050,_0x33c1e5[_0x8473('0x24')][_0x8473('0x25')]);return _0xf4295a(_0x33c1e5[_0x8473('0x24')][_0x8473('0x25')]);}else{logger[_0x8473('0x1f')](_0x8473('0x20'),_0x417050,_0x8473('0x21'));_0xf4295a(_0x33c1e5['result']['message']);}})['catch'](function(_0x4702e0){logger['error']('DeskAccount,\x20%s,\x20%s',_0x417050,_0x4702e0);_0x53c6d3(_0x4702e0);});});}function respondWithStatusCode(_0x290110,_0x3a5cbc){_0x3a5cbc=_0x3a5cbc||0xcc;return function(_0x596df4){if(_0x596df4){return _0x290110[_0x8473('0x26')](_0x3a5cbc);}return _0x290110[_0x8473('0x27')](_0x3a5cbc)[_0x8473('0x28')]();};}function respondWithResult(_0x4c0017,_0x86e23f){_0x86e23f=_0x86e23f||0xc8;return function(_0x41e6f0){if(_0x41e6f0){return _0x4c0017[_0x8473('0x27')](_0x86e23f)['json'](_0x41e6f0);}};}function respondWithFilteredResult(_0x1d53aa,_0x58b773){return function(_0x555142){if(_0x555142){var _0x5d7cf2=typeof _0x58b773[_0x8473('0x29')]===_0x8473('0x2a')&&typeof _0x58b773['limit']===_0x8473('0x2a');var _0x5c560b=_0x555142[_0x8473('0x2b')];var _0x635758=_0x5d7cf2?0x0:_0x58b773[_0x8473('0x29')];var _0x505be8=_0x5d7cf2?_0x555142[_0x8473('0x2b')]:_0x58b773[_0x8473('0x29')]+_0x58b773[_0x8473('0x2c')];var _0x12edf2;if(_0x505be8>=_0x5c560b){_0x505be8=_0x5c560b;_0x12edf2=0xc8;}else{_0x12edf2=0xce;}_0x1d53aa[_0x8473('0x27')](_0x12edf2);return _0x1d53aa['set']('Content-Range',_0x635758+'-'+_0x505be8+'/'+_0x5c560b)[_0x8473('0x2d')](_0x555142);}return null;};}function patchUpdates(_0xb754b3){return function(_0x268424){try{jsonpatch['apply'](_0x268424,_0xb754b3,!![]);}catch(_0x3cbc51){return BPromise[_0x8473('0x2e')](_0x3cbc51);}return _0x268424[_0x8473('0x2f')]();};}function saveUpdates(_0x51b054,_0x2dbdf2){return function(_0x15fd6f){if(_0x15fd6f){return _0x15fd6f[_0x8473('0x30')](_0x51b054)[_0x8473('0x1e')](function(_0x43e621){return _0x43e621;});}return null;};}function removeEntity(_0x190537,_0x258a82){return function(_0x3d899a){if(_0x3d899a){return _0x3d899a['destroy']()[_0x8473('0x1e')](function(){_0x190537[_0x8473('0x27')](0xcc)[_0x8473('0x28')]();});}};}function handleEntityNotFound(_0x5a23ef,_0x1e8ff2){return function(_0x11d2d4){if(!_0x11d2d4){_0x5a23ef['sendStatus'](0x194);}return _0x11d2d4;};}function handleError(_0x1748bc,_0x3b7d63){_0x3b7d63=_0x3b7d63||0x1f4;return function(_0x32409b){logger[_0x8473('0x24')](_0x32409b['stack']);if(_0x32409b['name']){delete _0x32409b[_0x8473('0x31')];}_0x1748bc[_0x8473('0x27')](_0x3b7d63)[_0x8473('0x32')](_0x32409b);};}exports[_0x8473('0x33')]=function(_0xdcdce5,_0x710c3c){var _0x112a6e={},_0x3f21a4={},_0x78f04d={'count':0x0,'rows':[]};var _0x2d5801=_[_0x8473('0x34')](db[_0x8473('0x35')][_0x8473('0x36')],function(_0x37b00f){return{'name':_0x37b00f[_0x8473('0x37')],'type':_0x37b00f[_0x8473('0x38')][_0x8473('0x39')]};});_0x3f21a4[_0x8473('0x3a')]=_[_0x8473('0x34')](_0x2d5801,_0x8473('0x31'));_0x3f21a4[_0x8473('0x3b')]=_[_0x8473('0x3c')](_0xdcdce5['query']);_0x3f21a4['filters']=_[_0x8473('0x3d')](_0x3f21a4['model'],_0x3f21a4[_0x8473('0x3b')]);_0x112a6e[_0x8473('0x3e')]=_[_0x8473('0x3d')](_0x3f21a4[_0x8473('0x3a')],qs[_0x8473('0x3f')](_0xdcdce5['query'][_0x8473('0x3f')]));_0x112a6e['attributes']=_0x112a6e['attributes'][_0x8473('0x40')]?_0x112a6e[_0x8473('0x3e')]:_0x3f21a4[_0x8473('0x3a')];if(!_0xdcdce5[_0x8473('0x3b')][_0x8473('0x41')](_0x8473('0x42'))){_0x112a6e[_0x8473('0x2c')]=qs[_0x8473('0x2c')](_0xdcdce5[_0x8473('0x3b')]['limit']);_0x112a6e[_0x8473('0x29')]=qs['offset'](_0xdcdce5[_0x8473('0x3b')][_0x8473('0x29')]);}_0x112a6e['order']=qs[_0x8473('0x43')](_0xdcdce5[_0x8473('0x3b')][_0x8473('0x43')]);_0x112a6e['where']=qs[_0x8473('0x44')](_[_0x8473('0x45')](_0xdcdce5['query'],_0x3f21a4[_0x8473('0x44')]),_0x2d5801);if(_0xdcdce5[_0x8473('0x3b')][_0x8473('0x46')]){_0x112a6e[_0x8473('0x47')]=_[_0x8473('0x48')](_0x112a6e[_0x8473('0x47')],{'$or':_[_0x8473('0x34')](_0x2d5801,function(_0x293c95){if(_0x293c95[_0x8473('0x38')]!==_0x8473('0x49')){var _0xd617ba={};_0xd617ba[_0x293c95['name']]={'$like':'%'+_0xdcdce5[_0x8473('0x3b')][_0x8473('0x46')]+'%'};return _0xd617ba;}})});}_0x112a6e=_[_0x8473('0x48')]({},_0x112a6e,_0xdcdce5[_0x8473('0x4a')]);var _0x24eebe={'where':_0x112a6e[_0x8473('0x47')]};return db['DeskAccount'][_0x8473('0x2b')](_0x24eebe)[_0x8473('0x1e')](function(_0x3f0632){_0x78f04d[_0x8473('0x2b')]=_0x3f0632;if(_0xdcdce5[_0x8473('0x3b')][_0x8473('0x4b')]){_0x112a6e[_0x8473('0x4c')]=[{'all':!![]}];}return db[_0x8473('0x35')][_0x8473('0x4d')](_0x112a6e);})[_0x8473('0x1e')](function(_0x31db58){_0x78f04d['rows']=_0x31db58;return _0x78f04d;})['then'](respondWithFilteredResult(_0x710c3c,_0x112a6e))[_0x8473('0x4e')](handleError(_0x710c3c,null));};exports[_0x8473('0x4f')]=function(_0xde4f85,_0x583618){var _0x8d2fe2={'raw':![],'where':{'id':_0xde4f85[_0x8473('0x50')]['id']}},_0x4fb8e5={};_0x4fb8e5[_0x8473('0x3a')]=_[_0x8473('0x3c')](db[_0x8473('0x35')]['rawAttributes']);_0x4fb8e5[_0x8473('0x3b')]=_['keys'](_0xde4f85[_0x8473('0x3b')]);_0x4fb8e5[_0x8473('0x44')]=_[_0x8473('0x3d')](_0x4fb8e5[_0x8473('0x3a')],_0x4fb8e5['query']);_0x8d2fe2[_0x8473('0x3e')]=_[_0x8473('0x3d')](_0x4fb8e5[_0x8473('0x3a')],qs['fields'](_0xde4f85[_0x8473('0x3b')][_0x8473('0x3f')]));_0x8d2fe2[_0x8473('0x3e')]=_0x8d2fe2[_0x8473('0x3e')]['length']?_0x8d2fe2['attributes']:_0x4fb8e5[_0x8473('0x3a')];if(_0xde4f85[_0x8473('0x3b')][_0x8473('0x4b')]){_0x8d2fe2[_0x8473('0x4c')]=[{'all':!![]}];}_0x8d2fe2=_['merge']({},_0x8d2fe2,_0xde4f85[_0x8473('0x4a')]);return db[_0x8473('0x35')][_0x8473('0x51')](_0x8d2fe2)[_0x8473('0x1e')](handleEntityNotFound(_0x583618,null))[_0x8473('0x1e')](respondWithResult(_0x583618,null))[_0x8473('0x4e')](handleError(_0x583618,null));};exports['create']=function(_0x36efad,_0x1b6e0b){return db['DeskAccount'][_0x8473('0x52')](_0x36efad[_0x8473('0x53')],{})[_0x8473('0x1e')](respondWithResult(_0x1b6e0b,0xc9))[_0x8473('0x4e')](handleError(_0x1b6e0b,null));};exports[_0x8473('0x30')]=function(_0x42847e,_0x463a76){if(_0x42847e['body']['id']){delete _0x42847e[_0x8473('0x53')]['id'];}return db[_0x8473('0x35')]['find']({'where':{'id':_0x42847e[_0x8473('0x50')]['id']}})['then'](handleEntityNotFound(_0x463a76,null))[_0x8473('0x1e')](saveUpdates(_0x42847e[_0x8473('0x53')],null))[_0x8473('0x1e')](respondWithResult(_0x463a76,null))[_0x8473('0x4e')](handleError(_0x463a76,null));};exports['destroy']=function(_0x5c1a9b,_0x4db02e){return db[_0x8473('0x35')]['find']({'where':{'id':_0x5c1a9b[_0x8473('0x50')]['id']}})['then'](handleEntityNotFound(_0x4db02e,null))['then'](removeEntity(_0x4db02e,null))[_0x8473('0x4e')](handleError(_0x4db02e,null));};exports[_0x8473('0x54')]=function(_0x2510a5,_0x1f48ff,_0xabcfd9){var _0x39fc8f={};var _0x3aeb60={};var _0x25b9b4;var _0x108cee;return db['DeskAccount'][_0x8473('0x55')]({'where':{'id':_0x2510a5[_0x8473('0x50')]['id']}})['then'](handleEntityNotFound(_0x1f48ff,null))[_0x8473('0x1e')](function(_0x4756b0){if(_0x4756b0){_0x25b9b4=_0x4756b0;_0x3aeb60['model']=_[_0x8473('0x3c')](db[_0x8473('0x56')][_0x8473('0x36')]);_0x3aeb60[_0x8473('0x3b')]=_[_0x8473('0x3c')](_0x2510a5[_0x8473('0x3b')]);_0x3aeb60[_0x8473('0x44')]=_[_0x8473('0x3d')](_0x3aeb60['model'],_0x3aeb60['query']);_0x39fc8f[_0x8473('0x3e')]=_[_0x8473('0x3d')](_0x3aeb60[_0x8473('0x3a')],qs[_0x8473('0x3f')](_0x2510a5[_0x8473('0x3b')][_0x8473('0x3f')]));_0x39fc8f['attributes']=_0x39fc8f['attributes'][_0x8473('0x40')]?_0x39fc8f['attributes']:_0x3aeb60['model'];_0x39fc8f[_0x8473('0x57')]=qs[_0x8473('0x43')](_0x2510a5[_0x8473('0x3b')][_0x8473('0x43')]);_0x39fc8f['where']=qs[_0x8473('0x44')](_[_0x8473('0x45')](_0x2510a5[_0x8473('0x3b')],_0x3aeb60['filters']));if(_0x2510a5[_0x8473('0x3b')][_0x8473('0x46')]){_0x39fc8f['where']=_[_0x8473('0x48')](_0x39fc8f[_0x8473('0x47')],{'$or':_['map'](_0x39fc8f['attributes'],function(_0x4d0ffa){var _0x3a2fcc={};_0x3a2fcc[_0x4d0ffa]={'$like':'%'+_0x2510a5['query'][_0x8473('0x46')]+'%'};return _0x3a2fcc;})});}_0x39fc8f=_['merge']({},_0x39fc8f,_0x2510a5['options']);return _0x25b9b4['getConfigurations'](_0x39fc8f);}})[_0x8473('0x1e')](function(_0x32d151){if(_0x32d151){_0x108cee=_0x32d151[_0x8473('0x40')];if(!_0x2510a5[_0x8473('0x3b')][_0x8473('0x41')](_0x8473('0x42'))){_0x39fc8f[_0x8473('0x2c')]=qs[_0x8473('0x2c')](_0x2510a5[_0x8473('0x3b')][_0x8473('0x2c')]);_0x39fc8f[_0x8473('0x29')]=qs['offset'](_0x2510a5['query'][_0x8473('0x29')]);}return _0x25b9b4['getConfigurations'](_0x39fc8f);}})[_0x8473('0x1e')](function(_0x4e46c1){if(_0x4e46c1){return _0x4e46c1?{'count':_0x108cee,'rows':_0x4e46c1}:null;}})[_0x8473('0x1e')](respondWithResult(_0x1f48ff,null))[_0x8473('0x4e')](handleError(_0x1f48ff,null));};exports['addConfiguration']=function(_0x5b8b2a,_0x5b9441,_0x2aacb4){if(_0x5b8b2a[_0x8473('0x53')]['id']){delete _0x5b8b2a[_0x8473('0x53')]['id'];}return db[_0x8473('0x35')][_0x8473('0x55')]({'where':{'id':_0x5b8b2a[_0x8473('0x50')]['id']}})[_0x8473('0x1e')](handleEntityNotFound(_0x5b9441,null))[_0x8473('0x1e')](function(_0x9375a4){if(_0x9375a4){_0x5b8b2a[_0x8473('0x53')][_0x8473('0x58')]=_0x9375a4['id'];_0x5b8b2a['body']['Subjects']=integrations[_0x8473('0x59')](_0x5b8b2a['body']['channel'],_0x5b8b2a['body'][_0x8473('0x38')]);_0x5b8b2a['body'][_0x8473('0x5a')]=integrations[_0x8473('0x5b')](_0x5b8b2a[_0x8473('0x53')][_0x8473('0x5c')],_0x5b8b2a[_0x8473('0x53')]['type']);return db['DeskConfiguration'][_0x8473('0x52')](_0x5b8b2a['body'],{'include':[{'model':db[_0x8473('0x5d')],'as':_0x8473('0x5e')},{'model':db[_0x8473('0x5d')],'as':_0x8473('0x5a')}]});}return null;})[_0x8473('0x1e')](respondWithResult(_0x5b9441,null))[_0x8473('0x4e')](handleError(_0x5b9441,null));};exports['getFields']=function(_0x18cc1c,_0x1289be,_0x531b17){var _0x5dea13=[{'name':'priority','label':_0x8473('0x5f'),'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 _0x5c0b2c='';return db[_0x8473('0x35')][_0x8473('0x55')]({'where':{'id':_0x18cc1c[_0x8473('0x50')]['id']},'attributes':['id','remoteUri',_0x8473('0x60'),_0x8473('0x61'),_0x8473('0x62'),_0x8473('0x63'),_0x8473('0x64'),_0x8473('0x65'),_0x8473('0x66')]})['then'](handleEntityNotFound(_0x1289be,null))[_0x8473('0x1e')](function(_0xcbf496){if(_0xcbf496){_0x5c0b2c=_0xcbf496[_0x8473('0x67')];var _0x1b68bb=_0x5c0b2c[_0x8473('0x68')](-0x1);if(_0x1b68bb==='/'){_0x5c0b2c=_0x5c0b2c[_0x8473('0x69')](0x0,_0x5c0b2c[_0x8473('0x6a')](_0x1b68bb));}var _0x402ff6={'method':_0x8473('0x6b'),'uri':util[_0x8473('0x6c')](_0x8473('0x6d'),_0x5c0b2c),'headers':{'Content-Type':'application/json','Accept':_0x8473('0x6e')},'json':!![]};if(_0xcbf496[_0x8473('0x60')]===_0x8473('0x6f')){_0x402ff6[_0x8473('0x70')][_0x8473('0x71')]=util['format'](_0x8473('0x72'),new Buffer(util[_0x8473('0x6c')](_0x8473('0x73'),_0xcbf496[_0x8473('0x61')],_0xcbf496['password']))[_0x8473('0x74')](_0x8473('0x75')));}return rp(_0x402ff6)[_0x8473('0x1e')](function(_0x3787fa){return _0x5dea13[_0x8473('0x76')](_[_0x8473('0x34')](_0x3787fa['_embedded']['entries'],function(_0x4336a4){return{'id':_0x4336a4[_0x8473('0x31')],'name':_0x4336a4['name'],'type':_0x4336a4[_0x8473('0x38')],'active':_0x4336a4[_0x8473('0x77')],'label':_0x4336a4[_0x8473('0x78')],'custom':!![]};}));});}})['then'](function(_0x122012){return{'count':_0x122012['length'],'rows':_0x122012};})[_0x8473('0x1e')](respondWithResult(_0x1289be,null))['catch'](function(_0x34e1d8){var _0x53f366=_0x18cc1c[_0x8473('0x3b')]['test']?0x1f4:_0x34e1d8[_0x8473('0x79')]||0x1f4;logger['error'](_0x8473('0x7a'),_0x8473('0x7b'),_0x53f366,JSON[_0x8473('0x23')](_0x34e1d8));delete _0x34e1d8[_0x8473('0x31')];if(_0x53f366===0x191){_0x53f366=0x190;}_0x1289be[_0x8473('0x27')](_0x53f366)[_0x8473('0x32')](_0x18cc1c[_0x8473('0x3b')]['test']?{'message':_0x8473('0x7c'),'statusCode':_0x34e1d8['statusCode']}:_0x34e1d8);});}; \ No newline at end of file +var _0x859d=['getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','show','merge','find','create','body','params','getConfigurations','findOne','pick','options','addConfiguration','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','password','slice','substring','lastIndexOf','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test'];(function(_0x6942e0,_0x131e6d){var _0xb86490=function(_0x2fd5d7){while(--_0x2fd5d7){_0x6942e0['push'](_0x6942e0['shift']());}};_0xb86490(++_0x131e6d);}(_0x859d,0x183));var _0xd859=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x859d[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0xd859('0x0'));var rimraf=require(_0xd859('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd859('0x2'));var rp=require(_0xd859('0x3'));var moment=require(_0xd859('0x4'));var BPromise=require(_0xd859('0x5'));var Mustache=require(_0xd859('0x6'));var util=require(_0xd859('0x7'));var path=require(_0xd859('0x8'));var sox=require('sox');var csv=require(_0xd859('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd859('0xa'));var _=require(_0xd859('0xb'));var squel=require(_0xd859('0xc'));var crypto=require('crypto');var jsforce=require(_0xd859('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd859('0x9'));var querystring=require(_0xd859('0xe'));var Papa=require('papaparse');var Redis=require(_0xd859('0xf'));var authService=require(_0xd859('0x10'));var qs=require(_0xd859('0x11'));var as=require(_0xd859('0x12'));var hardwareService=require(_0xd859('0x13'));var logger=require(_0xd859('0x14'))(_0xd859('0x15'));var utils=require(_0xd859('0x16'));var config=require(_0xd859('0x17'));var licenseUtil=require(_0xd859('0x18'));var db=require(_0xd859('0x19'))['db'];var integrations=require(_0xd859('0x1a'));var jayson=require(_0xd859('0x1b'));var client=jayson['client'][_0xd859('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1e0ccb,_0x5bedf9,_0x49b431,_0x145836){return new BPromise(function(_0x54d51c,_0x3cfa0d){var _0x4edda7=_0x145836||client;return _0x4edda7[_0xd859('0x1d')](_0x1e0ccb,_0x49b431)['then'](function(_0x402b01){logger[_0xd859('0x1e')](_0xd859('0x1f'),_0x5bedf9,'request\x20sent');logger[_0xd859('0x20')](_0xd859('0x21'),_0x5bedf9,'request\x20sent',JSON[_0xd859('0x22')](_0x402b01));if(_0x402b01[_0xd859('0x23')]){if(_0x402b01['error'][_0xd859('0x24')]===0x1f4){logger[_0xd859('0x23')](_0xd859('0x1f'),_0x5bedf9,_0x402b01[_0xd859('0x23')]['message']);return _0x3cfa0d(_0x402b01[_0xd859('0x23')][_0xd859('0x25')]);}logger[_0xd859('0x23')](_0xd859('0x1f'),_0x5bedf9,_0x402b01['error'][_0xd859('0x25')]);return _0x54d51c(_0x402b01['error']['message']);}else{logger[_0xd859('0x1e')]('DeskAccount,\x20%s,\x20%s',_0x5bedf9,_0xd859('0x26'));_0x54d51c(_0x402b01[_0xd859('0x27')][_0xd859('0x25')]);}})[_0xd859('0x28')](function(_0x53c3de){logger['error'](_0xd859('0x1f'),_0x5bedf9,_0x53c3de);_0x3cfa0d(_0x53c3de);});});}function respondWithStatusCode(_0x5ac5c8,_0x1a92c1){_0x1a92c1=_0x1a92c1||0xcc;return function(_0x31147c){if(_0x31147c){return _0x5ac5c8['sendStatus'](_0x1a92c1);}return _0x5ac5c8['status'](_0x1a92c1)[_0xd859('0x29')]();};}function respondWithResult(_0x48dc3a,_0x11b3ae){_0x11b3ae=_0x11b3ae||0xc8;return function(_0x235964){if(_0x235964){return _0x48dc3a[_0xd859('0x2a')](_0x11b3ae)[_0xd859('0x2b')](_0x235964);}};}function respondWithFilteredResult(_0x281d39,_0xfbb3ae){return function(_0x2517dc){if(_0x2517dc){var _0x4df805=typeof _0xfbb3ae[_0xd859('0x2c')]===_0xd859('0x2d')&&typeof _0xfbb3ae[_0xd859('0x2e')]==='undefined';var _0x359eef=_0x2517dc['count'];var _0x44239e=_0x4df805?0x0:_0xfbb3ae['offset'];var _0x5f3a66=_0x4df805?_0x2517dc[_0xd859('0x2f')]:_0xfbb3ae['offset']+_0xfbb3ae[_0xd859('0x2e')];var _0x132834;if(_0x5f3a66>=_0x359eef){_0x5f3a66=_0x359eef;_0x132834=0xc8;}else{_0x132834=0xce;}_0x281d39[_0xd859('0x2a')](_0x132834);return _0x281d39['set'](_0xd859('0x30'),_0x44239e+'-'+_0x5f3a66+'/'+_0x359eef)[_0xd859('0x2b')](_0x2517dc);}return null;};}function patchUpdates(_0x3765cb){return function(_0x1b44bc){try{jsonpatch[_0xd859('0x31')](_0x1b44bc,_0x3765cb,!![]);}catch(_0x2935c3){return BPromise[_0xd859('0x32')](_0x2935c3);}return _0x1b44bc[_0xd859('0x33')]();};}function saveUpdates(_0x8ce1b,_0x396400){return function(_0x57e528){if(_0x57e528){return _0x57e528[_0xd859('0x34')](_0x8ce1b)[_0xd859('0x35')](function(_0x3a1fa8){return _0x3a1fa8;});}return null;};}function removeEntity(_0x4875b8,_0x5831da){return function(_0xe29fcb){if(_0xe29fcb){return _0xe29fcb[_0xd859('0x36')]()[_0xd859('0x35')](function(){_0x4875b8[_0xd859('0x2a')](0xcc)[_0xd859('0x29')]();});}};}function handleEntityNotFound(_0x26bb02,_0x10eb3f){return function(_0x20c015){if(!_0x20c015){_0x26bb02[_0xd859('0x37')](0x194);}return _0x20c015;};}function handleError(_0x29f591,_0x5861bb){_0x5861bb=_0x5861bb||0x1f4;return function(_0x5ceb0a){logger[_0xd859('0x23')](_0x5ceb0a[_0xd859('0x38')]);if(_0x5ceb0a[_0xd859('0x39')]){delete _0x5ceb0a[_0xd859('0x39')];}_0x29f591[_0xd859('0x2a')](_0x5861bb)[_0xd859('0x3a')](_0x5ceb0a);};}exports[_0xd859('0x3b')]=function(_0x133c57,_0x4def57){var _0x5fb532={},_0x1fd982={},_0x577acd={'count':0x0,'rows':[]};var _0x1645ba=_[_0xd859('0x3c')](db[_0xd859('0x3d')][_0xd859('0x3e')],function(_0x17f034){return{'name':_0x17f034[_0xd859('0x3f')],'type':_0x17f034[_0xd859('0x40')][_0xd859('0x41')]};});_0x1fd982['model']=_[_0xd859('0x3c')](_0x1645ba,_0xd859('0x39'));_0x1fd982[_0xd859('0x42')]=_[_0xd859('0x43')](_0x133c57[_0xd859('0x42')]);_0x1fd982[_0xd859('0x44')]=_[_0xd859('0x45')](_0x1fd982[_0xd859('0x46')],_0x1fd982[_0xd859('0x42')]);_0x5fb532['attributes']=_['intersection'](_0x1fd982[_0xd859('0x46')],qs[_0xd859('0x47')](_0x133c57[_0xd859('0x42')][_0xd859('0x47')]));_0x5fb532[_0xd859('0x48')]=_0x5fb532[_0xd859('0x48')][_0xd859('0x49')]?_0x5fb532['attributes']:_0x1fd982[_0xd859('0x46')];if(!_0x133c57[_0xd859('0x42')][_0xd859('0x4a')](_0xd859('0x4b'))){_0x5fb532[_0xd859('0x2e')]=qs[_0xd859('0x2e')](_0x133c57[_0xd859('0x42')]['limit']);_0x5fb532[_0xd859('0x2c')]=qs[_0xd859('0x2c')](_0x133c57[_0xd859('0x42')]['offset']);}_0x5fb532[_0xd859('0x4c')]=qs[_0xd859('0x4d')](_0x133c57[_0xd859('0x42')]['sort']);_0x5fb532[_0xd859('0x4e')]=qs['filters'](_['pick'](_0x133c57[_0xd859('0x42')],_0x1fd982[_0xd859('0x44')]),_0x1645ba);if(_0x133c57[_0xd859('0x42')][_0xd859('0x4f')]){_0x5fb532['where']=_['merge'](_0x5fb532[_0xd859('0x4e')],{'$or':_[_0xd859('0x3c')](_0x1645ba,function(_0xc55c6f){if(_0xc55c6f['type']!==_0xd859('0x50')){var _0x530cbb={};_0x530cbb[_0xc55c6f['name']]={'$like':'%'+_0x133c57['query'][_0xd859('0x4f')]+'%'};return _0x530cbb;}})});}_0x5fb532=_['merge']({},_0x5fb532,_0x133c57['options']);var _0x485d33={'where':_0x5fb532[_0xd859('0x4e')]};return db[_0xd859('0x3d')][_0xd859('0x2f')](_0x485d33)[_0xd859('0x35')](function(_0x586a69){_0x577acd[_0xd859('0x2f')]=_0x586a69;if(_0x133c57[_0xd859('0x42')][_0xd859('0x51')]){_0x5fb532[_0xd859('0x52')]=[{'all':!![]}];}return db[_0xd859('0x3d')][_0xd859('0x53')](_0x5fb532);})[_0xd859('0x35')](function(_0x4d2896){_0x577acd['rows']=_0x4d2896;return _0x577acd;})[_0xd859('0x35')](respondWithFilteredResult(_0x4def57,_0x5fb532))[_0xd859('0x28')](handleError(_0x4def57,null));};exports[_0xd859('0x54')]=function(_0xa101ba,_0x536650){var _0x4afe0f={'raw':![],'where':{'id':_0xa101ba['params']['id']}},_0x3754e0={};_0x3754e0[_0xd859('0x46')]=_[_0xd859('0x43')](db[_0xd859('0x3d')][_0xd859('0x3e')]);_0x3754e0[_0xd859('0x42')]=_[_0xd859('0x43')](_0xa101ba[_0xd859('0x42')]);_0x3754e0[_0xd859('0x44')]=_[_0xd859('0x45')](_0x3754e0[_0xd859('0x46')],_0x3754e0[_0xd859('0x42')]);_0x4afe0f[_0xd859('0x48')]=_[_0xd859('0x45')](_0x3754e0[_0xd859('0x46')],qs['fields'](_0xa101ba[_0xd859('0x42')][_0xd859('0x47')]));_0x4afe0f['attributes']=_0x4afe0f['attributes'][_0xd859('0x49')]?_0x4afe0f['attributes']:_0x3754e0[_0xd859('0x46')];if(_0xa101ba['query'][_0xd859('0x51')]){_0x4afe0f[_0xd859('0x52')]=[{'all':!![]}];}_0x4afe0f=_[_0xd859('0x55')]({},_0x4afe0f,_0xa101ba['options']);return db[_0xd859('0x3d')][_0xd859('0x56')](_0x4afe0f)[_0xd859('0x35')](handleEntityNotFound(_0x536650,null))[_0xd859('0x35')](respondWithResult(_0x536650,null))[_0xd859('0x28')](handleError(_0x536650,null));};exports[_0xd859('0x57')]=function(_0x29e004,_0x27b0e8){return db[_0xd859('0x3d')][_0xd859('0x57')](_0x29e004[_0xd859('0x58')],{})[_0xd859('0x35')](respondWithResult(_0x27b0e8,0xc9))['catch'](handleError(_0x27b0e8,null));};exports[_0xd859('0x34')]=function(_0x50374d,_0x15363b){if(_0x50374d[_0xd859('0x58')]['id']){delete _0x50374d[_0xd859('0x58')]['id'];}return db[_0xd859('0x3d')][_0xd859('0x56')]({'where':{'id':_0x50374d[_0xd859('0x59')]['id']}})[_0xd859('0x35')](handleEntityNotFound(_0x15363b,null))[_0xd859('0x35')](saveUpdates(_0x50374d[_0xd859('0x58')],null))[_0xd859('0x35')](respondWithResult(_0x15363b,null))['catch'](handleError(_0x15363b,null));};exports[_0xd859('0x36')]=function(_0x346e32,_0x271ea9){return db[_0xd859('0x3d')][_0xd859('0x56')]({'where':{'id':_0x346e32[_0xd859('0x59')]['id']}})[_0xd859('0x35')](handleEntityNotFound(_0x271ea9,null))[_0xd859('0x35')](removeEntity(_0x271ea9,null))[_0xd859('0x28')](handleError(_0x271ea9,null));};exports[_0xd859('0x5a')]=function(_0x44a3a0,_0x5e87e8,_0x2c1052){var _0x12fed5={};var _0xc2298a={};var _0x42b223;var _0xa2c954;return db[_0xd859('0x3d')][_0xd859('0x5b')]({'where':{'id':_0x44a3a0[_0xd859('0x59')]['id']}})[_0xd859('0x35')](handleEntityNotFound(_0x5e87e8,null))[_0xd859('0x35')](function(_0x324563){if(_0x324563){_0x42b223=_0x324563;_0xc2298a[_0xd859('0x46')]=_[_0xd859('0x43')](db['DeskConfiguration'][_0xd859('0x3e')]);_0xc2298a[_0xd859('0x42')]=_[_0xd859('0x43')](_0x44a3a0[_0xd859('0x42')]);_0xc2298a[_0xd859('0x44')]=_['intersection'](_0xc2298a[_0xd859('0x46')],_0xc2298a[_0xd859('0x42')]);_0x12fed5[_0xd859('0x48')]=_['intersection'](_0xc2298a[_0xd859('0x46')],qs[_0xd859('0x47')](_0x44a3a0['query'][_0xd859('0x47')]));_0x12fed5[_0xd859('0x48')]=_0x12fed5['attributes']['length']?_0x12fed5[_0xd859('0x48')]:_0xc2298a['model'];_0x12fed5[_0xd859('0x4c')]=qs[_0xd859('0x4d')](_0x44a3a0[_0xd859('0x42')][_0xd859('0x4d')]);_0x12fed5[_0xd859('0x4e')]=qs[_0xd859('0x44')](_[_0xd859('0x5c')](_0x44a3a0['query'],_0xc2298a[_0xd859('0x44')]));if(_0x44a3a0[_0xd859('0x42')][_0xd859('0x4f')]){_0x12fed5['where']=_[_0xd859('0x55')](_0x12fed5[_0xd859('0x4e')],{'$or':_[_0xd859('0x3c')](_0x12fed5['attributes'],function(_0xfaf95a){var _0x12a628={};_0x12a628[_0xfaf95a]={'$like':'%'+_0x44a3a0['query'][_0xd859('0x4f')]+'%'};return _0x12a628;})});}_0x12fed5=_['merge']({},_0x12fed5,_0x44a3a0[_0xd859('0x5d')]);return _0x42b223[_0xd859('0x5a')](_0x12fed5);}})['then'](function(_0x12774c){if(_0x12774c){_0xa2c954=_0x12774c[_0xd859('0x49')];if(!_0x44a3a0[_0xd859('0x42')][_0xd859('0x4a')](_0xd859('0x4b'))){_0x12fed5[_0xd859('0x2e')]=qs[_0xd859('0x2e')](_0x44a3a0[_0xd859('0x42')][_0xd859('0x2e')]);_0x12fed5[_0xd859('0x2c')]=qs[_0xd859('0x2c')](_0x44a3a0[_0xd859('0x42')][_0xd859('0x2c')]);}return _0x42b223[_0xd859('0x5a')](_0x12fed5);}})['then'](function(_0x3082f4){if(_0x3082f4){return _0x3082f4?{'count':_0xa2c954,'rows':_0x3082f4}:null;}})[_0xd859('0x35')](respondWithResult(_0x5e87e8,null))[_0xd859('0x28')](handleError(_0x5e87e8,null));};exports[_0xd859('0x5e')]=function(_0x4e3572,_0x59ffbc,_0x430e86){if(_0x4e3572[_0xd859('0x58')]['id']){delete _0x4e3572['body']['id'];}return db[_0xd859('0x3d')]['findOne']({'where':{'id':_0x4e3572['params']['id']}})[_0xd859('0x35')](handleEntityNotFound(_0x59ffbc,null))[_0xd859('0x35')](function(_0x40abf7){if(_0x40abf7){_0x4e3572[_0xd859('0x58')]['AccountId']=_0x40abf7['id'];_0x4e3572['body'][_0xd859('0x5f')]=integrations[_0xd859('0x60')](_0x4e3572[_0xd859('0x58')][_0xd859('0x61')],_0x4e3572[_0xd859('0x58')][_0xd859('0x40')]);_0x4e3572[_0xd859('0x58')][_0xd859('0x62')]=integrations['getDescriptions'](_0x4e3572['body'][_0xd859('0x61')],_0x4e3572[_0xd859('0x58')][_0xd859('0x40')]);return db['DeskConfiguration'][_0xd859('0x57')](_0x4e3572[_0xd859('0x58')],{'include':[{'model':db[_0xd859('0x63')],'as':'Subjects'},{'model':db[_0xd859('0x63')],'as':_0xd859('0x62')}]});}return null;})[_0xd859('0x35')](respondWithResult(_0x59ffbc,null))[_0xd859('0x28')](handleError(_0x59ffbc,null));};exports[_0xd859('0x64')]=function(_0x3bc52b,_0xb02e11,_0x52f492){var _0x2fba02=[{'name':_0xd859('0x65'),'label':_0xd859('0x65'),'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 _0x228dd5='';return db[_0xd859('0x3d')][_0xd859('0x5b')]({'where':{'id':_0x3bc52b['params']['id']},'attributes':['id',_0xd859('0x66'),_0xd859('0x67'),_0xd859('0x68'),_0xd859('0x69'),'consumerKey','consumerSecret','token','tokenSecret']})[_0xd859('0x35')](handleEntityNotFound(_0xb02e11,null))[_0xd859('0x35')](function(_0x192307){if(_0x192307){_0x228dd5=_0x192307[_0xd859('0x66')];var _0x3bdaab=_0x228dd5[_0xd859('0x6a')](-0x1);if(_0x3bdaab==='/'){_0x228dd5=_0x228dd5[_0xd859('0x6b')](0x0,_0x228dd5[_0xd859('0x6c')](_0x3bdaab));}var _0x356d45={'method':_0xd859('0x6d'),'uri':util[_0xd859('0x6e')]('%s/custom_fields',_0x228dd5),'headers':{'Content-Type':_0xd859('0x6f'),'Accept':_0xd859('0x6f')},'json':!![]};if(_0x192307['authType']===_0xd859('0x70')){_0x356d45[_0xd859('0x71')][_0xd859('0x72')]=util['format'](_0xd859('0x73'),new Buffer(util[_0xd859('0x6e')](_0xd859('0x74'),_0x192307[_0xd859('0x68')],_0x192307[_0xd859('0x69')]))[_0xd859('0x75')](_0xd859('0x76')));}return rp(_0x356d45)[_0xd859('0x35')](function(_0x51b12a){return _0x2fba02[_0xd859('0x77')](_[_0xd859('0x3c')](_0x51b12a[_0xd859('0x78')][_0xd859('0x79')],function(_0x8ebef9){return{'id':_0x8ebef9[_0xd859('0x39')],'name':_0x8ebef9['name'],'type':_0x8ebef9[_0xd859('0x40')],'active':_0x8ebef9[_0xd859('0x7a')],'label':_0x8ebef9[_0xd859('0x7b')],'custom':!![]};}));});}})[_0xd859('0x35')](function(_0x3618b6){return{'count':_0x3618b6['length'],'rows':_0x3618b6};})[_0xd859('0x35')](respondWithResult(_0xb02e11,null))['catch'](function(_0x515dac){var _0x3529bf=_0x3bc52b['query'][_0xd859('0x7c')]?0x1f4:_0x515dac['statusCode']||0x1f4;logger[_0xd859('0x23')](_0xd859('0x7d'),_0xd859('0x64'),_0x3529bf,JSON[_0xd859('0x22')](_0x515dac));delete _0x515dac['name'];if(_0x3529bf===0x191){_0x3529bf=0x190;}_0xb02e11[_0xd859('0x2a')](_0x3529bf)[_0xd859('0x3a')](_0x3bc52b[_0xd859('0x42')][_0xd859('0x7c')]?{'message':_0xd859('0x7e'),'statusCode':_0x515dac[_0xd859('0x7f')]}:_0x515dac);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 456bf3d..e7f4bd6 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 _0x3963=['int_desk_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount'];(function(_0x14b9fa,_0x78afa5){var _0xcf0855=function(_0x3a0c5b){while(--_0x3a0c5b){_0x14b9fa['push'](_0x14b9fa['shift']());}};_0xcf0855(++_0x78afa5);}(_0x3963,0x1e2));var _0x3396=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0x3963[_0x11f5ff];return _0x46eefb;};'use strict';var _=require(_0x3396('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3396('0x1'));var moment=require('moment');var BPromise=require(_0x3396('0x2'));var rp=require(_0x3396('0x3'));var fs=require('fs');var path=require(_0x3396('0x4'));var rimraf=require(_0x3396('0x5'));var config=require(_0x3396('0x6'));var attributes=require(_0x3396('0x7'));var integrations=require(_0x3396('0x8'));module[_0x3396('0x9')]=function(_0x5d69ec,_0x3cce55){return _0x5d69ec[_0x3396('0xa')](_0x3396('0xb'),attributes,{'tableName':_0x3396('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a9=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4ed836,_0x2bdd68){var _0x2bab5b=function(_0x4faf6a){while(--_0x4faf6a){_0x4ed836['push'](_0x4ed836['shift']());}};_0x2bab5b(++_0x2bdd68);}(_0x15a9,0x123));var _0x915a=function(_0x47dffe,_0x8c3cba){_0x47dffe=_0x47dffe-0x0;var _0x109b08=_0x15a9[_0x47dffe];return _0x109b08;};'use strict';var _=require(_0x915a('0x0'));var util=require(_0x915a('0x1'));var logger=require(_0x915a('0x2'))(_0x915a('0x3'));var moment=require(_0x915a('0x4'));var BPromise=require(_0x915a('0x5'));var rp=require(_0x915a('0x6'));var fs=require('fs');var path=require(_0x915a('0x7'));var rimraf=require(_0x915a('0x8'));var config=require(_0x915a('0x9'));var attributes=require(_0x915a('0xa'));var integrations=require(_0x915a('0xb'));module[_0x915a('0xc')]=function(_0xb80d96,_0x217c21){return _0xb80d96[_0x915a('0xd')](_0x915a('0xe'),attributes,{'tableName':_0x915a('0xf'),'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 d70d88f..7586d8f 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 _0x5d4d=['debug','stringify','ShowDeskAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d4d,0x162));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d4('0x0'));var util=require(_0xd5d4('0x1'));var moment=require(_0xd5d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5d4('0x4'))['db'];var utils=require(_0xd5d4('0x5'));var logger=require('../../config/logger')(_0xd5d4('0x6'));var config=require(_0xd5d4('0x7'));var jayson=require(_0xd5d4('0x8'));var client=jayson['client'][_0xd5d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8f8fec,_0x8ffb3e,_0x500ae4){return new BPromise(function(_0x359989,_0x57749a){return client[_0xd5d4('0xa')](_0x8f8fec,_0x500ae4)[_0xd5d4('0xb')](function(_0x10573c){logger[_0xd5d4('0xc')](_0xd5d4('0xd'),_0x8ffb3e,_0xd5d4('0xe'));logger['debug'](_0xd5d4('0xf'),_0x8ffb3e,_0xd5d4('0xe'),JSON['stringify'](_0x10573c));if(_0x10573c[_0xd5d4('0x10')]){if(_0x10573c[_0xd5d4('0x10')]['code']===0x1f4){logger['error'](_0xd5d4('0xd'),_0x8ffb3e,_0x10573c['error'][_0xd5d4('0x11')]);return _0x57749a(_0x10573c[_0xd5d4('0x10')][_0xd5d4('0x11')]);}logger[_0xd5d4('0x10')](_0xd5d4('0xd'),_0x8ffb3e,_0x10573c[_0xd5d4('0x10')][_0xd5d4('0x11')]);return _0x359989(_0x10573c[_0xd5d4('0x10')]['message']);}else{logger[_0xd5d4('0xc')](_0xd5d4('0xd'),_0x8ffb3e,_0xd5d4('0xe'));_0x359989(_0x10573c[_0xd5d4('0x12')]['message']);}})[_0xd5d4('0x13')](function(_0x47a621){logger[_0xd5d4('0x10')](_0xd5d4('0xd'),_0x8ffb3e,_0x47a621);_0x57749a(_0x47a621);});});}exports[_0xd5d4('0x14')]=function(_0x5103d4){var _0x38b13a=this;return new Promise(function(_0x5d24ac,_0x738a5){return db[_0xd5d4('0x15')][_0xd5d4('0x16')]({'raw':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x18')]===undefined?!![]:![]:!![],'where':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x19')]||null:null,'attributes':_0x5103d4['options']?_0x5103d4['options'][_0xd5d4('0x1a')]||null:null,'limit':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x1b')]||null:null,'include':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4['options'][_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x1c')],function(_0x2269c){return{'model':db[_0x2269c[_0xd5d4('0x1e')]],'as':_0x2269c['as'],'attributes':_0x2269c[_0xd5d4('0x1a')],'include':_0x2269c['include']?_[_0xd5d4('0x1d')](_0x2269c[_0xd5d4('0x1c')],function(_0x41366d){return{'model':db[_0x41366d[_0xd5d4('0x1e')]],'as':_0x41366d['as'],'attributes':_0x41366d[_0xd5d4('0x1a')],'include':_0x41366d[_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x41366d['include'],function(_0x5974e2){return{'model':db[_0x5974e2[_0xd5d4('0x1e')]],'as':_0x5974e2['as'],'attributes':_0x5974e2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f134f){logger['info']('GetDeskAccount',_0x5103d4);logger[_0xd5d4('0x1f')](_0xd5d4('0x14'),_0x5103d4,JSON[_0xd5d4('0x20')](_0x3f134f));_0x5d24ac(_0x3f134f);})['catch'](function(_0x46258c){logger[_0xd5d4('0x10')](_0xd5d4('0x14'),_0x46258c[_0xd5d4('0x11')],_0x5103d4);_0x738a5(_0x38b13a[_0xd5d4('0x10')](0x1f4,_0x46258c[_0xd5d4('0x11')]));});});};exports[_0xd5d4('0x21')]=function(_0x1e4918){var _0x3bc4ad=this;return new Promise(function(_0x42dc40,_0x4bc0c4){return db[_0xd5d4('0x15')][_0xd5d4('0x22')]({'raw':_0x1e4918[_0xd5d4('0x17')]?_0x1e4918['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e4918[_0xd5d4('0x17')]?_0x1e4918[_0xd5d4('0x17')]['where']||null:null,'attributes':_0x1e4918['options']?_0x1e4918[_0xd5d4('0x17')]['attributes']||null:null,'include':_0x1e4918['options']?_0x1e4918[_0xd5d4('0x17')][_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x1e4918[_0xd5d4('0x17')][_0xd5d4('0x1c')],function(_0x2deecc){return{'model':db[_0x2deecc[_0xd5d4('0x1e')]],'as':_0x2deecc['as'],'attributes':_0x2deecc[_0xd5d4('0x1a')],'include':_0x2deecc[_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x2deecc[_0xd5d4('0x1c')],function(_0x16717a){return{'model':db[_0x16717a[_0xd5d4('0x1e')]],'as':_0x16717a['as'],'attributes':_0x16717a[_0xd5d4('0x1a')],'include':_0x16717a[_0xd5d4('0x1c')]?_['map'](_0x16717a['include'],function(_0x5a3b8c){return{'model':db[_0x5a3b8c[_0xd5d4('0x1e')]],'as':_0x5a3b8c['as'],'attributes':_0x5a3b8c[_0xd5d4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd5d4('0xb')](function(_0x570942){logger[_0xd5d4('0xc')](_0xd5d4('0x21'),_0x1e4918);logger[_0xd5d4('0x1f')]('ShowDeskAccount',_0x1e4918,JSON[_0xd5d4('0x20')](_0x570942));_0x42dc40(_0x570942);})['catch'](function(_0x2e9bde){logger[_0xd5d4('0x10')]('ShowDeskAccount',_0x2e9bde[_0xd5d4('0x11')],_0x1e4918);_0x4bc0c4(_0x3bc4ad[_0xd5d4('0x10')](0x1f4,_0x2e9bde['message']));});});}; \ No newline at end of file +var _0xcf94=['DeskAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','options','raw','where','attributes','limit','include','model','map','info','ShowDeskAccount'];(function(_0x5a9896,_0x29fb94){var _0x4c5295=function(_0x12739c){while(--_0x12739c){_0x5a9896['push'](_0x5a9896['shift']());}};_0x4c5295(++_0x29fb94);}(_0xcf94,0x18d));var _0x4cf9=function(_0x5b7f5c,_0xb1ff7b){_0x5b7f5c=_0x5b7f5c-0x0;var _0x2e0d39=_0xcf94[_0x5b7f5c];return _0x2e0d39;};'use strict';var _=require('lodash');var util=require(_0x4cf9('0x0'));var moment=require(_0x4cf9('0x1'));var BPromise=require('bluebird');var rs=require(_0x4cf9('0x2'));var fs=require('fs');var Redis=require(_0x4cf9('0x3'));var db=require(_0x4cf9('0x4'))['db'];var utils=require(_0x4cf9('0x5'));var logger=require(_0x4cf9('0x6'))('rpc');var config=require(_0x4cf9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4cf9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54fe44,_0x4e744b,_0x25d4bc){return new BPromise(function(_0x2a1c1d,_0x221d73){return client[_0x4cf9('0x9')](_0x54fe44,_0x25d4bc)[_0x4cf9('0xa')](function(_0x126548){logger['info'](_0x4cf9('0xb'),_0x4e744b,_0x4cf9('0xc'));logger[_0x4cf9('0xd')](_0x4cf9('0xe'),_0x4e744b,'request\x20sent',JSON[_0x4cf9('0xf')](_0x126548));if(_0x126548[_0x4cf9('0x10')]){if(_0x126548[_0x4cf9('0x10')][_0x4cf9('0x11')]===0x1f4){logger[_0x4cf9('0x10')](_0x4cf9('0xb'),_0x4e744b,_0x126548['error'][_0x4cf9('0x12')]);return _0x221d73(_0x126548['error']['message']);}logger[_0x4cf9('0x10')](_0x4cf9('0xb'),_0x4e744b,_0x126548[_0x4cf9('0x10')][_0x4cf9('0x12')]);return _0x2a1c1d(_0x126548[_0x4cf9('0x10')][_0x4cf9('0x12')]);}else{logger['info'](_0x4cf9('0xb'),_0x4e744b,_0x4cf9('0xc'));_0x2a1c1d(_0x126548[_0x4cf9('0x13')]['message']);}})[_0x4cf9('0x14')](function(_0x14b640){logger['error'](_0x4cf9('0xb'),_0x4e744b,_0x14b640);_0x221d73(_0x14b640);});});}exports[_0x4cf9('0x15')]=function(_0x14500f){var _0x35ba46=this;return new Promise(function(_0x3807cc,_0x539e27){return db['DeskAccount']['findAll']({'raw':_0x14500f[_0x4cf9('0x16')]?_0x14500f['options'][_0x4cf9('0x17')]===undefined?!![]:![]:!![],'where':_0x14500f[_0x4cf9('0x16')]?_0x14500f['options'][_0x4cf9('0x18')]||null:null,'attributes':_0x14500f[_0x4cf9('0x16')]?_0x14500f[_0x4cf9('0x16')][_0x4cf9('0x19')]||null:null,'limit':_0x14500f[_0x4cf9('0x16')]?_0x14500f[_0x4cf9('0x16')][_0x4cf9('0x1a')]||null:null,'include':_0x14500f[_0x4cf9('0x16')]?_0x14500f['options'][_0x4cf9('0x1b')]?_['map'](_0x14500f[_0x4cf9('0x16')][_0x4cf9('0x1b')],function(_0x304a5a){return{'model':db[_0x304a5a[_0x4cf9('0x1c')]],'as':_0x304a5a['as'],'attributes':_0x304a5a[_0x4cf9('0x19')],'include':_0x304a5a[_0x4cf9('0x1b')]?_[_0x4cf9('0x1d')](_0x304a5a[_0x4cf9('0x1b')],function(_0x32e3ae){return{'model':db[_0x32e3ae['model']],'as':_0x32e3ae['as'],'attributes':_0x32e3ae[_0x4cf9('0x19')],'include':_0x32e3ae[_0x4cf9('0x1b')]?_[_0x4cf9('0x1d')](_0x32e3ae[_0x4cf9('0x1b')],function(_0x2c7c0b){return{'model':db[_0x2c7c0b[_0x4cf9('0x1c')]],'as':_0x2c7c0b['as'],'attributes':_0x2c7c0b[_0x4cf9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4cf9('0xa')](function(_0x4bdb6e){logger[_0x4cf9('0x1e')]('GetDeskAccount',_0x14500f);logger[_0x4cf9('0xd')](_0x4cf9('0x15'),_0x14500f,JSON[_0x4cf9('0xf')](_0x4bdb6e));_0x3807cc(_0x4bdb6e);})['catch'](function(_0x47e9ae){logger[_0x4cf9('0x10')](_0x4cf9('0x15'),_0x47e9ae[_0x4cf9('0x12')],_0x14500f);_0x539e27(_0x35ba46[_0x4cf9('0x10')](0x1f4,_0x47e9ae[_0x4cf9('0x12')]));});});};exports[_0x4cf9('0x1f')]=function(_0x12510b){var _0x19419e=this;return new Promise(function(_0xa1508e,_0x3d69ca){return db[_0x4cf9('0x20')]['find']({'raw':_0x12510b[_0x4cf9('0x16')]?_0x12510b[_0x4cf9('0x16')][_0x4cf9('0x17')]===undefined?!![]:![]:!![],'where':_0x12510b['options']?_0x12510b['options'][_0x4cf9('0x18')]||null:null,'attributes':_0x12510b['options']?_0x12510b[_0x4cf9('0x16')][_0x4cf9('0x19')]||null:null,'include':_0x12510b[_0x4cf9('0x16')]?_0x12510b['options'][_0x4cf9('0x1b')]?_[_0x4cf9('0x1d')](_0x12510b['options'][_0x4cf9('0x1b')],function(_0xf83483){return{'model':db[_0xf83483['model']],'as':_0xf83483['as'],'attributes':_0xf83483[_0x4cf9('0x19')],'include':_0xf83483['include']?_[_0x4cf9('0x1d')](_0xf83483['include'],function(_0x35e79e){return{'model':db[_0x35e79e[_0x4cf9('0x1c')]],'as':_0x35e79e['as'],'attributes':_0x35e79e['attributes'],'include':_0x35e79e[_0x4cf9('0x1b')]?_[_0x4cf9('0x1d')](_0x35e79e[_0x4cf9('0x1b')],function(_0x27bcdc){return{'model':db[_0x27bcdc[_0x4cf9('0x1c')]],'as':_0x27bcdc['as'],'attributes':_0x27bcdc[_0x4cf9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4cf9('0xa')](function(_0x1128b7){logger[_0x4cf9('0x1e')](_0x4cf9('0x1f'),_0x12510b);logger[_0x4cf9('0xd')](_0x4cf9('0x1f'),_0x12510b,JSON[_0x4cf9('0xf')](_0x1128b7));_0xa1508e(_0x1128b7);})[_0x4cf9('0x14')](function(_0x5bf4a3){logger[_0x4cf9('0x10')](_0x4cf9('0x1f'),_0x5bf4a3[_0x4cf9('0x12')],_0x12510b);_0x3d69ca(_0x19419e['error'](0x1f4,_0x5bf4a3[_0x4cf9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 3eabf42..11eff1d 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0xa69122,_0x3c1c3c){var _0x582a21=function(_0x514021){while(--_0x514021){_0xa69122['push'](_0xa69122['shift']());}};_0x582a21(++_0x3c1c3c);}(_0xedd9,0xfc));var _0x9edd=function(_0x55922d,_0x34145d){_0x55922d=_0x55922d-0x0;var _0x52d59c=_0xedd9[_0x55922d];return _0x52d59c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x271a55,_0x26f0c4){var _0x3761b3=function(_0x45e805){while(--_0x45e805){_0x271a55['push'](_0x271a55['shift']());}};_0x3761b3(++_0x26f0c4);}(_0x008c,0x188));var _0xc008=function(_0x593310,_0x17b9e9){_0x593310=_0x593310-0x0;var _0x1ea007=_0x008c[_0x593310];return _0x1ea007;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index a674e48..64e7400 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 _0x5f13=['sequelize','exports','STRING'];(function(_0x95396b,_0x1dd407){var _0x565040=function(_0x31938d){while(--_0x31938d){_0x95396b['push'](_0x95396b['shift']());}};_0x565040(++_0x1dd407);}(_0x5f13,0x192));var _0x35f1=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x5f13[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x35f1('0x0'));module[_0x35f1('0x1')]={'name':{'type':Sequelize[_0x35f1('0x2')]},'description':{'type':Sequelize[_0x35f1('0x2')]}}; \ No newline at end of file +var _0x3557=['STRING','exports'];(function(_0xa087f5,_0x34fd10){var _0x4c8806=function(_0x4b1cfe){while(--_0x4b1cfe){_0xa087f5['push'](_0xa087f5['shift']());}};_0x4c8806(++_0x34fd10);}(_0x3557,0x115));var _0x7355=function(_0x4e9fed,_0x19f4f3){_0x4e9fed=_0x4e9fed-0x0;var _0x5c8cc0=_0x3557[_0x4e9fed];return _0x5c8cc0;};'use strict';var Sequelize=require('sequelize');module[_0x7355('0x0')]={'name':{'type':Sequelize[_0x7355('0x1')]},'description':{'type':Sequelize[_0x7355('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index faa37c9..cb7a03d 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 _0xdf28=['getFields','getSubjects','findOne','DeskField','getDescriptions','hasOwnProperty','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','stack','name','index','DeskConfiguration','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','fields','length','nolimit','query','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params'];(function(_0x4eda24,_0x407afa){var _0x5300cf=function(_0x3b3e6f){while(--_0x3b3e6f){_0x4eda24['push'](_0x4eda24['shift']());}};_0x5300cf(++_0x407afa);}(_0xdf28,0x1e5));var _0x8df2=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xdf28[_0x4914ad];return _0x3cd61f;};'use strict';var emlformat=require(_0x8df2('0x0'));var rimraf=require(_0x8df2('0x1'));var zipdir=require(_0x8df2('0x2'));var jsonpatch=require(_0x8df2('0x3'));var rp=require('request-promise');var moment=require(_0x8df2('0x4'));var BPromise=require(_0x8df2('0x5'));var Mustache=require(_0x8df2('0x6'));var util=require('util');var path=require(_0x8df2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8df2('0x8'));var fs=require('fs');var fs_extra=require(_0x8df2('0x9'));var _=require(_0x8df2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8df2('0xb'));var deskjs=require(_0x8df2('0xc'));var toCsv=require(_0x8df2('0xd'));var querystring=require(_0x8df2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8df2('0xf'));var qs=require(_0x8df2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8df2('0x11'));var logger=require(_0x8df2('0x12'))(_0x8df2('0x13'));var utils=require(_0x8df2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8df2('0x15'));var db=require(_0x8df2('0x16'))['db'];var jayson=require(_0x8df2('0x17'));var client=jayson[_0x8df2('0x18')][_0x8df2('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x232140,_0x5a7ddd,_0x1921c9,_0x546ddb){return new BPromise(function(_0x449bca,_0x2f5b57){var _0x1aa2d0=_0x546ddb||client;return _0x1aa2d0[_0x8df2('0x1a')](_0x232140,_0x1921c9)[_0x8df2('0x1b')](function(_0x35f774){logger[_0x8df2('0x1c')](_0x8df2('0x1d'),_0x5a7ddd,_0x8df2('0x1e'));logger[_0x8df2('0x1f')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5a7ddd,_0x8df2('0x1e'),JSON[_0x8df2('0x20')](_0x35f774));if(_0x35f774[_0x8df2('0x21')]){if(_0x35f774[_0x8df2('0x21')]['code']===0x1f4){logger[_0x8df2('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x5a7ddd,_0x35f774[_0x8df2('0x21')][_0x8df2('0x22')]);return _0x2f5b57(_0x35f774[_0x8df2('0x21')]['message']);}logger[_0x8df2('0x21')](_0x8df2('0x1d'),_0x5a7ddd,_0x35f774[_0x8df2('0x21')][_0x8df2('0x22')]);return _0x449bca(_0x35f774[_0x8df2('0x21')][_0x8df2('0x22')]);}else{logger[_0x8df2('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x5a7ddd,_0x8df2('0x1e'));_0x449bca(_0x35f774[_0x8df2('0x23')][_0x8df2('0x22')]);}})['catch'](function(_0x54e24){logger['error'](_0x8df2('0x1d'),_0x5a7ddd,_0x54e24);_0x2f5b57(_0x54e24);});});}function respondWithStatusCode(_0x140ed9,_0x447db6){_0x447db6=_0x447db6||0xcc;return function(_0x1d984a){if(_0x1d984a){return _0x140ed9[_0x8df2('0x24')](_0x447db6);}return _0x140ed9[_0x8df2('0x25')](_0x447db6)['end']();};}function respondWithResult(_0xbbcf43,_0x2a4e9f){_0x2a4e9f=_0x2a4e9f||0xc8;return function(_0x1dcc71){if(_0x1dcc71){return _0xbbcf43[_0x8df2('0x25')](_0x2a4e9f)['json'](_0x1dcc71);}};}function respondWithFilteredResult(_0x395839,_0x2e55ae){return function(_0x56e7ee){if(_0x56e7ee){var _0x33d64d=typeof _0x2e55ae['offset']===_0x8df2('0x26')&&typeof _0x2e55ae[_0x8df2('0x27')]===_0x8df2('0x26');var _0x29c403=_0x56e7ee[_0x8df2('0x28')];var _0x208039=_0x33d64d?0x0:_0x2e55ae[_0x8df2('0x29')];var _0x5c4a74=_0x33d64d?_0x56e7ee[_0x8df2('0x28')]:_0x2e55ae[_0x8df2('0x29')]+_0x2e55ae[_0x8df2('0x27')];var _0x1b83cf;if(_0x5c4a74>=_0x29c403){_0x5c4a74=_0x29c403;_0x1b83cf=0xc8;}else{_0x1b83cf=0xce;}_0x395839[_0x8df2('0x25')](_0x1b83cf);return _0x395839[_0x8df2('0x2a')](_0x8df2('0x2b'),_0x208039+'-'+_0x5c4a74+'/'+_0x29c403)[_0x8df2('0x2c')](_0x56e7ee);}return null;};}function patchUpdates(_0x3257b1){return function(_0x24df90){try{jsonpatch[_0x8df2('0x2d')](_0x24df90,_0x3257b1,!![]);}catch(_0x42f971){return BPromise[_0x8df2('0x2e')](_0x42f971);}return _0x24df90['save']();};}function saveUpdates(_0x38ce0a,_0x21e2f4){return function(_0x23cc7e){if(_0x23cc7e){return _0x23cc7e[_0x8df2('0x2f')](_0x38ce0a)[_0x8df2('0x1b')](function(_0x48b9b4){return _0x48b9b4;});}return null;};}function removeEntity(_0x256d20,_0x4fd014){return function(_0x1293c1){if(_0x1293c1){return _0x1293c1[_0x8df2('0x30')]()[_0x8df2('0x1b')](function(){_0x256d20[_0x8df2('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4850df,_0x86f87b){return function(_0xe39487){if(!_0xe39487){_0x4850df['sendStatus'](0x194);}return _0xe39487;};}function handleError(_0x5c40e4,_0x3e64e9){_0x3e64e9=_0x3e64e9||0x1f4;return function(_0x1613fd){logger[_0x8df2('0x21')](_0x1613fd[_0x8df2('0x31')]);if(_0x1613fd[_0x8df2('0x32')]){delete _0x1613fd[_0x8df2('0x32')];}_0x5c40e4['status'](_0x3e64e9)['send'](_0x1613fd);};}exports[_0x8df2('0x33')]=function(_0x4abbee,_0x448726){var _0x471c97={},_0x2b4aee={},_0x1def4c={'count':0x0,'rows':[]};var _0x2b951e=_['map'](db[_0x8df2('0x34')][_0x8df2('0x35')],function(_0x511cdd){return{'name':_0x511cdd[_0x8df2('0x36')],'type':_0x511cdd['type'][_0x8df2('0x37')]};});_0x2b4aee[_0x8df2('0x38')]=_[_0x8df2('0x39')](_0x2b951e,'name');_0x2b4aee['query']=_[_0x8df2('0x3a')](_0x4abbee['query']);_0x2b4aee[_0x8df2('0x3b')]=_[_0x8df2('0x3c')](_0x2b4aee['model'],_0x2b4aee['query']);_0x471c97[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x2b4aee[_0x8df2('0x38')],qs[_0x8df2('0x3e')](_0x4abbee['query'][_0x8df2('0x3e')]));_0x471c97[_0x8df2('0x3d')]=_0x471c97[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x471c97[_0x8df2('0x3d')]:_0x2b4aee['model'];if(!_0x4abbee['query']['hasOwnProperty'](_0x8df2('0x40'))){_0x471c97[_0x8df2('0x27')]=qs['limit'](_0x4abbee[_0x8df2('0x41')][_0x8df2('0x27')]);_0x471c97[_0x8df2('0x29')]=qs['offset'](_0x4abbee[_0x8df2('0x41')][_0x8df2('0x29')]);}_0x471c97[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x4abbee['query'][_0x8df2('0x43')]);_0x471c97['where']=qs[_0x8df2('0x3b')](_[_0x8df2('0x44')](_0x4abbee[_0x8df2('0x41')],_0x2b4aee[_0x8df2('0x3b')]),_0x2b951e);if(_0x4abbee[_0x8df2('0x41')]['filter']){_0x471c97[_0x8df2('0x45')]=_[_0x8df2('0x46')](_0x471c97[_0x8df2('0x45')],{'$or':_[_0x8df2('0x39')](_0x2b951e,function(_0x272943){if(_0x272943[_0x8df2('0x47')]!==_0x8df2('0x48')){var _0x26c02a={};_0x26c02a[_0x272943[_0x8df2('0x32')]]={'$like':'%'+_0x4abbee['query'][_0x8df2('0x49')]+'%'};return _0x26c02a;}})});}_0x471c97=_[_0x8df2('0x46')]({},_0x471c97,_0x4abbee[_0x8df2('0x4a')]);var _0x5ab8d5={'where':_0x471c97[_0x8df2('0x45')]};return db['DeskConfiguration'][_0x8df2('0x28')](_0x5ab8d5)[_0x8df2('0x1b')](function(_0x8b592c){_0x1def4c[_0x8df2('0x28')]=_0x8b592c;if(_0x4abbee[_0x8df2('0x41')][_0x8df2('0x4b')]){_0x471c97[_0x8df2('0x4c')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x8df2('0x4d')](_0x471c97);})[_0x8df2('0x1b')](function(_0x5c4c64){_0x1def4c[_0x8df2('0x4e')]=_0x5c4c64;return _0x1def4c;})[_0x8df2('0x1b')](respondWithFilteredResult(_0x448726,_0x471c97))[_0x8df2('0x4f')](handleError(_0x448726,null));};exports[_0x8df2('0x50')]=function(_0x195a57,_0x536530){var _0x2cfa30={'raw':![],'where':{'id':_0x195a57['params']['id']}},_0x5904cd={};_0x5904cd[_0x8df2('0x38')]=_[_0x8df2('0x3a')](db['DeskConfiguration'][_0x8df2('0x35')]);_0x5904cd[_0x8df2('0x41')]=_[_0x8df2('0x3a')](_0x195a57[_0x8df2('0x41')]);_0x5904cd[_0x8df2('0x3b')]=_[_0x8df2('0x3c')](_0x5904cd[_0x8df2('0x38')],_0x5904cd[_0x8df2('0x41')]);_0x2cfa30[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x5904cd[_0x8df2('0x38')],qs['fields'](_0x195a57['query']['fields']));_0x2cfa30[_0x8df2('0x3d')]=_0x2cfa30[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x2cfa30[_0x8df2('0x3d')]:_0x5904cd[_0x8df2('0x38')];if(_0x195a57[_0x8df2('0x41')]['includeAll']){_0x2cfa30[_0x8df2('0x4c')]=[{'all':!![]}];}_0x2cfa30=_[_0x8df2('0x46')]({},_0x2cfa30,_0x195a57['options']);return db[_0x8df2('0x34')][_0x8df2('0x51')](_0x2cfa30)[_0x8df2('0x1b')](handleEntityNotFound(_0x536530,null))[_0x8df2('0x1b')](respondWithResult(_0x536530,null))[_0x8df2('0x4f')](handleError(_0x536530,null));};exports[_0x8df2('0x52')]=function(_0x25d854,_0x9c75f){return db[_0x8df2('0x34')]['create'](_0x25d854[_0x8df2('0x53')],{})[_0x8df2('0x1b')](respondWithResult(_0x9c75f,0xc9))[_0x8df2('0x4f')](handleError(_0x9c75f,null));};exports[_0x8df2('0x2f')]=function(_0x120a8e,_0x2c314a){if(_0x120a8e[_0x8df2('0x53')]['id']){delete _0x120a8e[_0x8df2('0x53')]['id'];}return db[_0x8df2('0x34')]['find']({'where':{'id':_0x120a8e[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x2c314a,null))['then'](saveUpdates(_0x120a8e[_0x8df2('0x53')],null))['then'](respondWithResult(_0x2c314a,null))[_0x8df2('0x4f')](handleError(_0x2c314a,null));};exports[_0x8df2('0x30')]=function(_0x651ed2,_0x5dfcb6){return db['DeskConfiguration'][_0x8df2('0x51')]({'where':{'id':_0x651ed2['params']['id']}})['then'](handleEntityNotFound(_0x5dfcb6,null))[_0x8df2('0x1b')](removeEntity(_0x5dfcb6,null))[_0x8df2('0x4f')](handleError(_0x5dfcb6,null));};exports[_0x8df2('0x55')]=function(_0x350cb9,_0x5e5ae9,_0x217978){var _0x393cf7={};var _0xdcd507={};var _0x5403c4;var _0x16fe75;return db[_0x8df2('0x34')]['findOne']({'where':{'id':_0x350cb9['params']['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x5e5ae9,null))[_0x8df2('0x1b')](function(_0x411967){if(_0x411967){_0x5403c4=_0x411967;_0xdcd507[_0x8df2('0x38')]=_['keys'](db['DeskField'][_0x8df2('0x35')]);_0xdcd507['query']=_['keys'](_0x350cb9[_0x8df2('0x41')]);_0xdcd507['filters']=_[_0x8df2('0x3c')](_0xdcd507['model'],_0xdcd507[_0x8df2('0x41')]);_0x393cf7[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0xdcd507[_0x8df2('0x38')],qs[_0x8df2('0x3e')](_0x350cb9[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x393cf7[_0x8df2('0x3d')]=_0x393cf7[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x393cf7[_0x8df2('0x3d')]:_0xdcd507[_0x8df2('0x38')];_0x393cf7[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x350cb9['query'][_0x8df2('0x43')]);_0x393cf7[_0x8df2('0x45')]=qs[_0x8df2('0x3b')](_['pick'](_0x350cb9['query'],_0xdcd507[_0x8df2('0x3b')]));if(_0x350cb9[_0x8df2('0x41')]['filter']){_0x393cf7[_0x8df2('0x45')]=_[_0x8df2('0x46')](_0x393cf7['where'],{'$or':_[_0x8df2('0x39')](_0x393cf7[_0x8df2('0x3d')],function(_0x31f9b6){var _0x88565a={};_0x88565a[_0x31f9b6]={'$like':'%'+_0x350cb9[_0x8df2('0x41')][_0x8df2('0x49')]+'%'};return _0x88565a;})});}_0x393cf7=_[_0x8df2('0x46')]({},_0x393cf7,_0x350cb9[_0x8df2('0x4a')]);return _0x5403c4['getFields'](_0x393cf7);}})[_0x8df2('0x1b')](function(_0x29889f){if(_0x29889f){_0x16fe75=_0x29889f[_0x8df2('0x3f')];if(!_0x350cb9['query']['hasOwnProperty'](_0x8df2('0x40'))){_0x393cf7[_0x8df2('0x27')]=qs[_0x8df2('0x27')](_0x350cb9[_0x8df2('0x41')][_0x8df2('0x27')]);_0x393cf7[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x350cb9[_0x8df2('0x41')][_0x8df2('0x29')]);}return _0x5403c4[_0x8df2('0x55')](_0x393cf7);}})[_0x8df2('0x1b')](function(_0x528d82){if(_0x528d82){return _0x528d82?{'count':_0x16fe75,'rows':_0x528d82}:null;}})[_0x8df2('0x1b')](respondWithResult(_0x5e5ae9,null))[_0x8df2('0x4f')](handleError(_0x5e5ae9,null));};exports[_0x8df2('0x56')]=function(_0x58d87d,_0x28a961,_0x567748){var _0x967884={};var _0x522e52={};var _0x4cbdfb;var _0x443217;return db['DeskConfiguration'][_0x8df2('0x57')]({'where':{'id':_0x58d87d[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x28a961,null))[_0x8df2('0x1b')](function(_0x46e5a6){if(_0x46e5a6){_0x4cbdfb=_0x46e5a6;_0x522e52[_0x8df2('0x38')]=_[_0x8df2('0x3a')](db[_0x8df2('0x58')][_0x8df2('0x35')]);_0x522e52[_0x8df2('0x41')]=_['keys'](_0x58d87d[_0x8df2('0x41')]);_0x522e52[_0x8df2('0x3b')]=_[_0x8df2('0x3c')](_0x522e52[_0x8df2('0x38')],_0x522e52[_0x8df2('0x41')]);_0x967884[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x522e52[_0x8df2('0x38')],qs['fields'](_0x58d87d[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x967884[_0x8df2('0x3d')]=_0x967884['attributes']['length']?_0x967884['attributes']:_0x522e52['model'];_0x967884[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x58d87d[_0x8df2('0x41')]['sort']);_0x967884[_0x8df2('0x45')]=qs[_0x8df2('0x3b')](_[_0x8df2('0x44')](_0x58d87d[_0x8df2('0x41')],_0x522e52[_0x8df2('0x3b')]));if(_0x58d87d[_0x8df2('0x41')][_0x8df2('0x49')]){_0x967884[_0x8df2('0x45')]=_['merge'](_0x967884['where'],{'$or':_['map'](_0x967884[_0x8df2('0x3d')],function(_0xb66d2a){var _0x3e5891={};_0x3e5891[_0xb66d2a]={'$like':'%'+_0x58d87d[_0x8df2('0x41')]['filter']+'%'};return _0x3e5891;})});}_0x967884=_[_0x8df2('0x46')]({},_0x967884,_0x58d87d[_0x8df2('0x4a')]);return _0x4cbdfb[_0x8df2('0x56')](_0x967884);}})[_0x8df2('0x1b')](function(_0x3709bc){if(_0x3709bc){_0x443217=_0x3709bc[_0x8df2('0x3f')];if(!_0x58d87d[_0x8df2('0x41')]['hasOwnProperty'](_0x8df2('0x40'))){_0x967884[_0x8df2('0x27')]=qs[_0x8df2('0x27')](_0x58d87d[_0x8df2('0x41')][_0x8df2('0x27')]);_0x967884[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x58d87d[_0x8df2('0x41')]['offset']);}return _0x4cbdfb['getSubjects'](_0x967884);}})[_0x8df2('0x1b')](function(_0x26f2b5){if(_0x26f2b5){return _0x26f2b5?{'count':_0x443217,'rows':_0x26f2b5}:null;}})['then'](respondWithResult(_0x28a961,null))[_0x8df2('0x4f')](handleError(_0x28a961,null));};exports[_0x8df2('0x59')]=function(_0x3f19a4,_0x237e87,_0x2c5717){var _0x2d0cc8={};var _0x2d5885={};var _0x24818e;var _0x48da3f;return db[_0x8df2('0x34')][_0x8df2('0x57')]({'where':{'id':_0x3f19a4[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x237e87,null))['then'](function(_0x4c7954){if(_0x4c7954){_0x24818e=_0x4c7954;_0x2d5885['model']=_[_0x8df2('0x3a')](db['DeskField'][_0x8df2('0x35')]);_0x2d5885[_0x8df2('0x41')]=_[_0x8df2('0x3a')](_0x3f19a4[_0x8df2('0x41')]);_0x2d5885['filters']=_[_0x8df2('0x3c')](_0x2d5885[_0x8df2('0x38')],_0x2d5885[_0x8df2('0x41')]);_0x2d0cc8['attributes']=_[_0x8df2('0x3c')](_0x2d5885[_0x8df2('0x38')],qs['fields'](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x2d0cc8[_0x8df2('0x3d')]=_0x2d0cc8[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x2d0cc8[_0x8df2('0x3d')]:_0x2d5885[_0x8df2('0x38')];_0x2d0cc8[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x43')]);_0x2d0cc8[_0x8df2('0x45')]=qs[_0x8df2('0x3b')](_[_0x8df2('0x44')](_0x3f19a4[_0x8df2('0x41')],_0x2d5885[_0x8df2('0x3b')]));if(_0x3f19a4['query'][_0x8df2('0x49')]){_0x2d0cc8[_0x8df2('0x45')]=_['merge'](_0x2d0cc8[_0x8df2('0x45')],{'$or':_[_0x8df2('0x39')](_0x2d0cc8['attributes'],function(_0x12482b){var _0x3b3b9c={};_0x3b3b9c[_0x12482b]={'$like':'%'+_0x3f19a4[_0x8df2('0x41')]['filter']+'%'};return _0x3b3b9c;})});}_0x2d0cc8=_[_0x8df2('0x46')]({},_0x2d0cc8,_0x3f19a4['options']);return _0x24818e[_0x8df2('0x59')](_0x2d0cc8);}})[_0x8df2('0x1b')](function(_0x3d2ac0){if(_0x3d2ac0){_0x48da3f=_0x3d2ac0['length'];if(!_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x5a')]('nolimit')){_0x2d0cc8['limit']=qs[_0x8df2('0x27')](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x27')]);_0x2d0cc8[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x29')]);}return _0x24818e['getDescriptions'](_0x2d0cc8);}})['then'](function(_0x112451){if(_0x112451){return _0x112451?{'count':_0x48da3f,'rows':_0x112451}:null;}})[_0x8df2('0x1b')](respondWithResult(_0x237e87,null))[_0x8df2('0x4f')](handleError(_0x237e87,null));};exports[_0x8df2('0x5b')]=function(_0x3a7f93,_0xb1f1e8,_0x1c597e){var _0x64efaa={};var _0x37f0b9={};var _0x5e799a;var _0x5bb750;return db['DeskConfiguration'][_0x8df2('0x57')]({'where':{'id':_0x3a7f93['params']['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0xb1f1e8,null))[_0x8df2('0x1b')](function(_0x58ab1b){if(_0x58ab1b){_0x5e799a=_0x58ab1b;_0x37f0b9[_0x8df2('0x38')]=_[_0x8df2('0x3a')](db[_0x8df2('0x5c')][_0x8df2('0x35')]);_0x37f0b9[_0x8df2('0x41')]=_[_0x8df2('0x3a')](_0x3a7f93[_0x8df2('0x41')]);_0x37f0b9[_0x8df2('0x3b')]=_['intersection'](_0x37f0b9[_0x8df2('0x38')],_0x37f0b9[_0x8df2('0x41')]);_0x64efaa[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x37f0b9[_0x8df2('0x38')],qs[_0x8df2('0x3e')](_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x64efaa['attributes']=_0x64efaa['attributes'][_0x8df2('0x3f')]?_0x64efaa[_0x8df2('0x3d')]:_0x37f0b9[_0x8df2('0x38')];_0x64efaa[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x43')]);_0x64efaa[_0x8df2('0x45')]=qs['filters'](_[_0x8df2('0x44')](_0x3a7f93['query'],_0x37f0b9[_0x8df2('0x3b')]));if(_0x3a7f93['query'][_0x8df2('0x49')]){_0x64efaa[_0x8df2('0x45')]=_[_0x8df2('0x46')](_0x64efaa[_0x8df2('0x45')],{'$or':_['map'](_0x64efaa[_0x8df2('0x3d')],function(_0x5ca7a4){var _0x436d5d={};_0x436d5d[_0x5ca7a4]={'$like':'%'+_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x49')]+'%'};return _0x436d5d;})});}_0x64efaa=_[_0x8df2('0x46')]({},_0x64efaa,_0x3a7f93['options']);return _0x5e799a['getTags'](_0x64efaa);}})[_0x8df2('0x1b')](function(_0x2b612a){if(_0x2b612a){_0x5bb750=_0x2b612a[_0x8df2('0x3f')];if(!_0x3a7f93['query']['hasOwnProperty'](_0x8df2('0x40'))){_0x64efaa[_0x8df2('0x27')]=qs[_0x8df2('0x27')](_0x3a7f93['query'][_0x8df2('0x27')]);_0x64efaa[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x29')]);}return _0x5e799a[_0x8df2('0x5b')](_0x64efaa);}})['then'](function(_0x4d0e03){if(_0x4d0e03){return _0x4d0e03?{'count':_0x5bb750,'rows':_0x4d0e03}:null;}})['then'](respondWithResult(_0xb1f1e8,null))['catch'](handleError(_0xb1f1e8,null));};exports[_0x8df2('0x5d')]=function(_0x107351,_0x29e069,_0x2949bc){if(_0x107351[_0x8df2('0x53')]['id']){delete _0x107351[_0x8df2('0x53')]['id'];}return db[_0x8df2('0x34')][_0x8df2('0x57')]({'where':{'id':_0x107351[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x29e069,null))[_0x8df2('0x1b')](function(_0x1dcaea){if(_0x1dcaea){return _0x1dcaea[_0x8df2('0x5d')](_0x107351[_0x8df2('0x53')][_0x8df2('0x5e')]||[]);}return null;})['then'](respondWithResult(_0x29e069,null))['catch'](handleError(_0x29e069,null));}; \ No newline at end of file +var _0x4550=['destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getFields','findOne','keys','order','pick','filter','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','info','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x22f6ea,_0xf212d4){var _0x47ad7c=function(_0x2e3d4e){while(--_0x2e3d4e){_0x22f6ea['push'](_0x22f6ea['shift']());}};_0x47ad7c(++_0xf212d4);}(_0x4550,0xec));var _0x0455=function(_0x316031,_0x47b9c7){_0x316031=_0x316031-0x0;var _0xc96aec=_0x4550[_0x316031];return _0xc96aec;};'use strict';var emlformat=require(_0x0455('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0455('0x1'));var moment=require(_0x0455('0x2'));var BPromise=require(_0x0455('0x3'));var Mustache=require('mustache');var util=require(_0x0455('0x4'));var path=require(_0x0455('0x5'));var sox=require(_0x0455('0x6'));var csv=require(_0x0455('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0455('0x8'));var squel=require(_0x0455('0x9'));var crypto=require(_0x0455('0xa'));var jsforce=require(_0x0455('0xb'));var deskjs=require(_0x0455('0xc'));var toCsv=require(_0x0455('0x7'));var querystring=require('querystring');var Papa=require(_0x0455('0xd'));var Redis=require(_0x0455('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0455('0xf'));var as=require(_0x0455('0x10'));var hardwareService=require(_0x0455('0x11'));var logger=require(_0x0455('0x12'))('api');var utils=require(_0x0455('0x13'));var config=require(_0x0455('0x14'));var licenseUtil=require(_0x0455('0x15'));var db=require(_0x0455('0x16'))['db'];var jayson=require(_0x0455('0x17'));var client=jayson['client'][_0x0455('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x56f7f4,_0x3ec115,_0xa21f64,_0x23809b){return new BPromise(function(_0x231f4b,_0x24614d){var _0x45a107=_0x23809b||client;return _0x45a107[_0x0455('0x19')](_0x56f7f4,_0xa21f64)[_0x0455('0x1a')](function(_0x314a50){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3ec115,_0x0455('0x1b'));logger[_0x0455('0x1c')](_0x0455('0x1d'),_0x3ec115,_0x0455('0x1b'),JSON[_0x0455('0x1e')](_0x314a50));if(_0x314a50[_0x0455('0x1f')]){if(_0x314a50[_0x0455('0x1f')][_0x0455('0x20')]===0x1f4){logger[_0x0455('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x3ec115,_0x314a50[_0x0455('0x1f')][_0x0455('0x21')]);return _0x24614d(_0x314a50[_0x0455('0x1f')][_0x0455('0x21')]);}logger[_0x0455('0x1f')](_0x0455('0x22'),_0x3ec115,_0x314a50['error'][_0x0455('0x21')]);return _0x231f4b(_0x314a50['error'][_0x0455('0x21')]);}else{logger[_0x0455('0x23')](_0x0455('0x22'),_0x3ec115,_0x0455('0x1b'));_0x231f4b(_0x314a50[_0x0455('0x24')][_0x0455('0x21')]);}})['catch'](function(_0x3a5383){logger[_0x0455('0x1f')](_0x0455('0x22'),_0x3ec115,_0x3a5383);_0x24614d(_0x3a5383);});});}function respondWithStatusCode(_0x40a2b6,_0x525af9){_0x525af9=_0x525af9||0xcc;return function(_0x41c88a){if(_0x41c88a){return _0x40a2b6[_0x0455('0x25')](_0x525af9);}return _0x40a2b6[_0x0455('0x26')](_0x525af9)[_0x0455('0x27')]();};}function respondWithResult(_0x57ee2b,_0x3a5e9d){_0x3a5e9d=_0x3a5e9d||0xc8;return function(_0xbf9ae6){if(_0xbf9ae6){return _0x57ee2b[_0x0455('0x26')](_0x3a5e9d)[_0x0455('0x28')](_0xbf9ae6);}};}function respondWithFilteredResult(_0x16e080,_0x503516){return function(_0x10fa89){if(_0x10fa89){var _0x191416=typeof _0x503516[_0x0455('0x29')]===_0x0455('0x2a')&&typeof _0x503516[_0x0455('0x2b')]==='undefined';var _0x209515=_0x10fa89[_0x0455('0x2c')];var _0x3e9278=_0x191416?0x0:_0x503516[_0x0455('0x29')];var _0x5a4682=_0x191416?_0x10fa89[_0x0455('0x2c')]:_0x503516[_0x0455('0x29')]+_0x503516[_0x0455('0x2b')];var _0x4316f9;if(_0x5a4682>=_0x209515){_0x5a4682=_0x209515;_0x4316f9=0xc8;}else{_0x4316f9=0xce;}_0x16e080[_0x0455('0x26')](_0x4316f9);return _0x16e080['set'](_0x0455('0x2d'),_0x3e9278+'-'+_0x5a4682+'/'+_0x209515)[_0x0455('0x28')](_0x10fa89);}return null;};}function patchUpdates(_0x24d138){return function(_0x1b04e4){try{jsonpatch[_0x0455('0x2e')](_0x1b04e4,_0x24d138,!![]);}catch(_0x370c04){return BPromise[_0x0455('0x2f')](_0x370c04);}return _0x1b04e4[_0x0455('0x30')]();};}function saveUpdates(_0x55ef18,_0x597683){return function(_0x179680){if(_0x179680){return _0x179680['update'](_0x55ef18)[_0x0455('0x1a')](function(_0xfb3259){return _0xfb3259;});}return null;};}function removeEntity(_0x3b3b4b,_0x275794){return function(_0x171999){if(_0x171999){return _0x171999[_0x0455('0x31')]()[_0x0455('0x1a')](function(){_0x3b3b4b[_0x0455('0x26')](0xcc)[_0x0455('0x27')]();});}};}function handleEntityNotFound(_0x374091,_0x729889){return function(_0x597a02){if(!_0x597a02){_0x374091[_0x0455('0x25')](0x194);}return _0x597a02;};}function handleError(_0x424c50,_0x468346){_0x468346=_0x468346||0x1f4;return function(_0x1c14a8){logger['error'](_0x1c14a8[_0x0455('0x32')]);if(_0x1c14a8['name']){delete _0x1c14a8[_0x0455('0x33')];}_0x424c50[_0x0455('0x26')](_0x468346)[_0x0455('0x34')](_0x1c14a8);};}exports[_0x0455('0x35')]=function(_0x1f45b0,_0x1585cc){var _0x3b9ba7={},_0x5a8fb2={},_0xa96437={'count':0x0,'rows':[]};var _0x13fec7=_['map'](db['DeskConfiguration'][_0x0455('0x36')],function(_0x3f4d36){return{'name':_0x3f4d36[_0x0455('0x37')],'type':_0x3f4d36[_0x0455('0x38')]['key']};});_0x5a8fb2[_0x0455('0x39')]=_[_0x0455('0x3a')](_0x13fec7,_0x0455('0x33'));_0x5a8fb2[_0x0455('0x3b')]=_['keys'](_0x1f45b0[_0x0455('0x3b')]);_0x5a8fb2[_0x0455('0x3c')]=_[_0x0455('0x3d')](_0x5a8fb2[_0x0455('0x39')],_0x5a8fb2[_0x0455('0x3b')]);_0x3b9ba7[_0x0455('0x3e')]=_['intersection'](_0x5a8fb2[_0x0455('0x39')],qs[_0x0455('0x3f')](_0x1f45b0['query'][_0x0455('0x3f')]));_0x3b9ba7[_0x0455('0x3e')]=_0x3b9ba7['attributes'][_0x0455('0x40')]?_0x3b9ba7[_0x0455('0x3e')]:_0x5a8fb2[_0x0455('0x39')];if(!_0x1f45b0[_0x0455('0x3b')]['hasOwnProperty'](_0x0455('0x41'))){_0x3b9ba7[_0x0455('0x2b')]=qs['limit'](_0x1f45b0[_0x0455('0x3b')][_0x0455('0x2b')]);_0x3b9ba7[_0x0455('0x29')]=qs[_0x0455('0x29')](_0x1f45b0[_0x0455('0x3b')][_0x0455('0x29')]);}_0x3b9ba7['order']=qs[_0x0455('0x42')](_0x1f45b0[_0x0455('0x3b')][_0x0455('0x42')]);_0x3b9ba7['where']=qs[_0x0455('0x3c')](_['pick'](_0x1f45b0['query'],_0x5a8fb2[_0x0455('0x3c')]),_0x13fec7);if(_0x1f45b0['query']['filter']){_0x3b9ba7[_0x0455('0x43')]=_['merge'](_0x3b9ba7[_0x0455('0x43')],{'$or':_[_0x0455('0x3a')](_0x13fec7,function(_0x518047){if(_0x518047[_0x0455('0x38')]!=='VIRTUAL'){var _0x6949b4={};_0x6949b4[_0x518047[_0x0455('0x33')]]={'$like':'%'+_0x1f45b0['query']['filter']+'%'};return _0x6949b4;}})});}_0x3b9ba7=_[_0x0455('0x44')]({},_0x3b9ba7,_0x1f45b0[_0x0455('0x45')]);var _0x4bc456={'where':_0x3b9ba7[_0x0455('0x43')]};return db[_0x0455('0x46')]['count'](_0x4bc456)[_0x0455('0x1a')](function(_0x3691c0){_0xa96437[_0x0455('0x2c')]=_0x3691c0;if(_0x1f45b0[_0x0455('0x3b')][_0x0455('0x47')]){_0x3b9ba7[_0x0455('0x48')]=[{'all':!![]}];}return db[_0x0455('0x46')][_0x0455('0x49')](_0x3b9ba7);})[_0x0455('0x1a')](function(_0x1f7615){_0xa96437[_0x0455('0x4a')]=_0x1f7615;return _0xa96437;})['then'](respondWithFilteredResult(_0x1585cc,_0x3b9ba7))[_0x0455('0x4b')](handleError(_0x1585cc,null));};exports[_0x0455('0x4c')]=function(_0x57a467,_0x1c28bd){var _0x3a1359={'raw':![],'where':{'id':_0x57a467[_0x0455('0x4d')]['id']}},_0xf68327={};_0xf68327[_0x0455('0x39')]=_['keys'](db[_0x0455('0x46')][_0x0455('0x36')]);_0xf68327['query']=_['keys'](_0x57a467[_0x0455('0x3b')]);_0xf68327[_0x0455('0x3c')]=_['intersection'](_0xf68327[_0x0455('0x39')],_0xf68327[_0x0455('0x3b')]);_0x3a1359[_0x0455('0x3e')]=_[_0x0455('0x3d')](_0xf68327[_0x0455('0x39')],qs['fields'](_0x57a467[_0x0455('0x3b')]['fields']));_0x3a1359['attributes']=_0x3a1359[_0x0455('0x3e')][_0x0455('0x40')]?_0x3a1359[_0x0455('0x3e')]:_0xf68327['model'];if(_0x57a467[_0x0455('0x3b')][_0x0455('0x47')]){_0x3a1359[_0x0455('0x48')]=[{'all':!![]}];}_0x3a1359=_['merge']({},_0x3a1359,_0x57a467[_0x0455('0x45')]);return db[_0x0455('0x46')][_0x0455('0x4e')](_0x3a1359)[_0x0455('0x1a')](handleEntityNotFound(_0x1c28bd,null))[_0x0455('0x1a')](respondWithResult(_0x1c28bd,null))[_0x0455('0x4b')](handleError(_0x1c28bd,null));};exports[_0x0455('0x4f')]=function(_0x22ed15,_0x2729bf){return db[_0x0455('0x46')][_0x0455('0x4f')](_0x22ed15[_0x0455('0x50')],{})[_0x0455('0x1a')](respondWithResult(_0x2729bf,0xc9))[_0x0455('0x4b')](handleError(_0x2729bf,null));};exports[_0x0455('0x51')]=function(_0x1452e0,_0xe5a05d){if(_0x1452e0['body']['id']){delete _0x1452e0['body']['id'];}return db['DeskConfiguration'][_0x0455('0x4e')]({'where':{'id':_0x1452e0['params']['id']}})[_0x0455('0x1a')](handleEntityNotFound(_0xe5a05d,null))[_0x0455('0x1a')](saveUpdates(_0x1452e0[_0x0455('0x50')],null))['then'](respondWithResult(_0xe5a05d,null))['catch'](handleError(_0xe5a05d,null));};exports[_0x0455('0x31')]=function(_0x495cf8,_0x26bfe4){return db[_0x0455('0x46')][_0x0455('0x4e')]({'where':{'id':_0x495cf8['params']['id']}})[_0x0455('0x1a')](handleEntityNotFound(_0x26bfe4,null))[_0x0455('0x1a')](removeEntity(_0x26bfe4,null))[_0x0455('0x4b')](handleError(_0x26bfe4,null));};exports[_0x0455('0x52')]=function(_0x388407,_0x25bab2,_0x2fa2be){var _0x2c7ba4={};var _0x3391eb={};var _0x4b8b90;var _0x56a578;return db[_0x0455('0x46')][_0x0455('0x53')]({'where':{'id':_0x388407[_0x0455('0x4d')]['id']}})['then'](handleEntityNotFound(_0x25bab2,null))['then'](function(_0x41a583){if(_0x41a583){_0x4b8b90=_0x41a583;_0x3391eb['model']=_[_0x0455('0x54')](db['DeskField'][_0x0455('0x36')]);_0x3391eb[_0x0455('0x3b')]=_[_0x0455('0x54')](_0x388407[_0x0455('0x3b')]);_0x3391eb[_0x0455('0x3c')]=_[_0x0455('0x3d')](_0x3391eb['model'],_0x3391eb[_0x0455('0x3b')]);_0x2c7ba4[_0x0455('0x3e')]=_[_0x0455('0x3d')](_0x3391eb[_0x0455('0x39')],qs[_0x0455('0x3f')](_0x388407[_0x0455('0x3b')][_0x0455('0x3f')]));_0x2c7ba4[_0x0455('0x3e')]=_0x2c7ba4[_0x0455('0x3e')][_0x0455('0x40')]?_0x2c7ba4[_0x0455('0x3e')]:_0x3391eb[_0x0455('0x39')];_0x2c7ba4[_0x0455('0x55')]=qs[_0x0455('0x42')](_0x388407[_0x0455('0x3b')][_0x0455('0x42')]);_0x2c7ba4[_0x0455('0x43')]=qs['filters'](_[_0x0455('0x56')](_0x388407[_0x0455('0x3b')],_0x3391eb['filters']));if(_0x388407['query'][_0x0455('0x57')]){_0x2c7ba4[_0x0455('0x43')]=_[_0x0455('0x44')](_0x2c7ba4[_0x0455('0x43')],{'$or':_['map'](_0x2c7ba4['attributes'],function(_0x257516){var _0x742e8b={};_0x742e8b[_0x257516]={'$like':'%'+_0x388407[_0x0455('0x3b')][_0x0455('0x57')]+'%'};return _0x742e8b;})});}_0x2c7ba4=_['merge']({},_0x2c7ba4,_0x388407[_0x0455('0x45')]);return _0x4b8b90['getFields'](_0x2c7ba4);}})['then'](function(_0x89529b){if(_0x89529b){_0x56a578=_0x89529b['length'];if(!_0x388407[_0x0455('0x3b')][_0x0455('0x58')](_0x0455('0x41'))){_0x2c7ba4[_0x0455('0x2b')]=qs[_0x0455('0x2b')](_0x388407[_0x0455('0x3b')][_0x0455('0x2b')]);_0x2c7ba4[_0x0455('0x29')]=qs[_0x0455('0x29')](_0x388407[_0x0455('0x3b')][_0x0455('0x29')]);}return _0x4b8b90[_0x0455('0x52')](_0x2c7ba4);}})[_0x0455('0x1a')](function(_0x3177e8){if(_0x3177e8){return _0x3177e8?{'count':_0x56a578,'rows':_0x3177e8}:null;}})[_0x0455('0x1a')](respondWithResult(_0x25bab2,null))[_0x0455('0x4b')](handleError(_0x25bab2,null));};exports[_0x0455('0x59')]=function(_0x1475d4,_0x2e1a40,_0x3b3ee7){var _0x2bb6ff={};var _0x4e021d={};var _0x35a0fd;var _0x2e6d85;return db['DeskConfiguration'][_0x0455('0x53')]({'where':{'id':_0x1475d4[_0x0455('0x4d')]['id']}})[_0x0455('0x1a')](handleEntityNotFound(_0x2e1a40,null))[_0x0455('0x1a')](function(_0x17403f){if(_0x17403f){_0x35a0fd=_0x17403f;_0x4e021d['model']=_[_0x0455('0x54')](db[_0x0455('0x5a')]['rawAttributes']);_0x4e021d['query']=_['keys'](_0x1475d4[_0x0455('0x3b')]);_0x4e021d[_0x0455('0x3c')]=_[_0x0455('0x3d')](_0x4e021d[_0x0455('0x39')],_0x4e021d['query']);_0x2bb6ff[_0x0455('0x3e')]=_[_0x0455('0x3d')](_0x4e021d['model'],qs[_0x0455('0x3f')](_0x1475d4[_0x0455('0x3b')][_0x0455('0x3f')]));_0x2bb6ff[_0x0455('0x3e')]=_0x2bb6ff[_0x0455('0x3e')][_0x0455('0x40')]?_0x2bb6ff[_0x0455('0x3e')]:_0x4e021d['model'];_0x2bb6ff[_0x0455('0x55')]=qs[_0x0455('0x42')](_0x1475d4[_0x0455('0x3b')][_0x0455('0x42')]);_0x2bb6ff['where']=qs[_0x0455('0x3c')](_['pick'](_0x1475d4[_0x0455('0x3b')],_0x4e021d[_0x0455('0x3c')]));if(_0x1475d4[_0x0455('0x3b')][_0x0455('0x57')]){_0x2bb6ff[_0x0455('0x43')]=_[_0x0455('0x44')](_0x2bb6ff[_0x0455('0x43')],{'$or':_['map'](_0x2bb6ff[_0x0455('0x3e')],function(_0x5ac2ce){var _0x50ae41={};_0x50ae41[_0x5ac2ce]={'$like':'%'+_0x1475d4[_0x0455('0x3b')]['filter']+'%'};return _0x50ae41;})});}_0x2bb6ff=_[_0x0455('0x44')]({},_0x2bb6ff,_0x1475d4[_0x0455('0x45')]);return _0x35a0fd[_0x0455('0x59')](_0x2bb6ff);}})[_0x0455('0x1a')](function(_0x16c1cc){if(_0x16c1cc){_0x2e6d85=_0x16c1cc[_0x0455('0x40')];if(!_0x1475d4['query'][_0x0455('0x58')](_0x0455('0x41'))){_0x2bb6ff[_0x0455('0x2b')]=qs['limit'](_0x1475d4[_0x0455('0x3b')][_0x0455('0x2b')]);_0x2bb6ff[_0x0455('0x29')]=qs[_0x0455('0x29')](_0x1475d4[_0x0455('0x3b')][_0x0455('0x29')]);}return _0x35a0fd[_0x0455('0x59')](_0x2bb6ff);}})[_0x0455('0x1a')](function(_0x28e674){if(_0x28e674){return _0x28e674?{'count':_0x2e6d85,'rows':_0x28e674}:null;}})[_0x0455('0x1a')](respondWithResult(_0x2e1a40,null))['catch'](handleError(_0x2e1a40,null));};exports['getDescriptions']=function(_0xfc7349,_0x2e27fe,_0x1825f5){var _0xc217b5={};var _0x487d4a={};var _0x2f82b5;var _0x6b5848;return db['DeskConfiguration']['findOne']({'where':{'id':_0xfc7349[_0x0455('0x4d')]['id']}})[_0x0455('0x1a')](handleEntityNotFound(_0x2e27fe,null))[_0x0455('0x1a')](function(_0x30bd45){if(_0x30bd45){_0x2f82b5=_0x30bd45;_0x487d4a[_0x0455('0x39')]=_['keys'](db[_0x0455('0x5a')]['rawAttributes']);_0x487d4a[_0x0455('0x3b')]=_[_0x0455('0x54')](_0xfc7349[_0x0455('0x3b')]);_0x487d4a[_0x0455('0x3c')]=_[_0x0455('0x3d')](_0x487d4a[_0x0455('0x39')],_0x487d4a['query']);_0xc217b5[_0x0455('0x3e')]=_[_0x0455('0x3d')](_0x487d4a[_0x0455('0x39')],qs[_0x0455('0x3f')](_0xfc7349[_0x0455('0x3b')]['fields']));_0xc217b5[_0x0455('0x3e')]=_0xc217b5['attributes'][_0x0455('0x40')]?_0xc217b5[_0x0455('0x3e')]:_0x487d4a[_0x0455('0x39')];_0xc217b5[_0x0455('0x55')]=qs[_0x0455('0x42')](_0xfc7349[_0x0455('0x3b')]['sort']);_0xc217b5[_0x0455('0x43')]=qs[_0x0455('0x3c')](_[_0x0455('0x56')](_0xfc7349[_0x0455('0x3b')],_0x487d4a[_0x0455('0x3c')]));if(_0xfc7349[_0x0455('0x3b')][_0x0455('0x57')]){_0xc217b5['where']=_[_0x0455('0x44')](_0xc217b5[_0x0455('0x43')],{'$or':_[_0x0455('0x3a')](_0xc217b5[_0x0455('0x3e')],function(_0x49f5dd){var _0x3ac5ac={};_0x3ac5ac[_0x49f5dd]={'$like':'%'+_0xfc7349[_0x0455('0x3b')]['filter']+'%'};return _0x3ac5ac;})});}_0xc217b5=_[_0x0455('0x44')]({},_0xc217b5,_0xfc7349[_0x0455('0x45')]);return _0x2f82b5['getDescriptions'](_0xc217b5);}})[_0x0455('0x1a')](function(_0xdbf8b0){if(_0xdbf8b0){_0x6b5848=_0xdbf8b0[_0x0455('0x40')];if(!_0xfc7349[_0x0455('0x3b')][_0x0455('0x58')](_0x0455('0x41'))){_0xc217b5[_0x0455('0x2b')]=qs[_0x0455('0x2b')](_0xfc7349[_0x0455('0x3b')]['limit']);_0xc217b5[_0x0455('0x29')]=qs[_0x0455('0x29')](_0xfc7349[_0x0455('0x3b')][_0x0455('0x29')]);}return _0x2f82b5[_0x0455('0x5b')](_0xc217b5);}})[_0x0455('0x1a')](function(_0x6b6df4){if(_0x6b6df4){return _0x6b6df4?{'count':_0x6b5848,'rows':_0x6b6df4}:null;}})['then'](respondWithResult(_0x2e27fe,null))['catch'](handleError(_0x2e27fe,null));};exports[_0x0455('0x5c')]=function(_0x3ad30e,_0xcc23fd,_0x14ea45){var _0x3969d4={};var _0x194e67={};var _0x4a1bea;var _0x5425a0;return db[_0x0455('0x46')]['findOne']({'where':{'id':_0x3ad30e[_0x0455('0x4d')]['id']}})[_0x0455('0x1a')](handleEntityNotFound(_0xcc23fd,null))['then'](function(_0x13a2fd){if(_0x13a2fd){_0x4a1bea=_0x13a2fd;_0x194e67[_0x0455('0x39')]=_[_0x0455('0x54')](db[_0x0455('0x5d')][_0x0455('0x36')]);_0x194e67[_0x0455('0x3b')]=_[_0x0455('0x54')](_0x3ad30e[_0x0455('0x3b')]);_0x194e67[_0x0455('0x3c')]=_[_0x0455('0x3d')](_0x194e67[_0x0455('0x39')],_0x194e67[_0x0455('0x3b')]);_0x3969d4[_0x0455('0x3e')]=_[_0x0455('0x3d')](_0x194e67[_0x0455('0x39')],qs[_0x0455('0x3f')](_0x3ad30e[_0x0455('0x3b')]['fields']));_0x3969d4[_0x0455('0x3e')]=_0x3969d4[_0x0455('0x3e')][_0x0455('0x40')]?_0x3969d4['attributes']:_0x194e67[_0x0455('0x39')];_0x3969d4['order']=qs[_0x0455('0x42')](_0x3ad30e[_0x0455('0x3b')][_0x0455('0x42')]);_0x3969d4[_0x0455('0x43')]=qs[_0x0455('0x3c')](_[_0x0455('0x56')](_0x3ad30e[_0x0455('0x3b')],_0x194e67[_0x0455('0x3c')]));if(_0x3ad30e[_0x0455('0x3b')][_0x0455('0x57')]){_0x3969d4[_0x0455('0x43')]=_['merge'](_0x3969d4[_0x0455('0x43')],{'$or':_['map'](_0x3969d4['attributes'],function(_0x460f61){var _0x464f30={};_0x464f30[_0x460f61]={'$like':'%'+_0x3ad30e['query'][_0x0455('0x57')]+'%'};return _0x464f30;})});}_0x3969d4=_[_0x0455('0x44')]({},_0x3969d4,_0x3ad30e[_0x0455('0x45')]);return _0x4a1bea[_0x0455('0x5c')](_0x3969d4);}})[_0x0455('0x1a')](function(_0x1fe414){if(_0x1fe414){_0x5425a0=_0x1fe414[_0x0455('0x40')];if(!_0x3ad30e[_0x0455('0x3b')][_0x0455('0x58')]('nolimit')){_0x3969d4[_0x0455('0x2b')]=qs['limit'](_0x3ad30e[_0x0455('0x3b')][_0x0455('0x2b')]);_0x3969d4[_0x0455('0x29')]=qs[_0x0455('0x29')](_0x3ad30e[_0x0455('0x3b')][_0x0455('0x29')]);}return _0x4a1bea['getTags'](_0x3969d4);}})[_0x0455('0x1a')](function(_0x35b279){if(_0x35b279){return _0x35b279?{'count':_0x5425a0,'rows':_0x35b279}:null;}})[_0x0455('0x1a')](respondWithResult(_0xcc23fd,null))['catch'](handleError(_0xcc23fd,null));};exports['setTags']=function(_0x37cb78,_0x2894ea,_0xca1509){if(_0x37cb78[_0x0455('0x50')]['id']){delete _0x37cb78[_0x0455('0x50')]['id'];}return db[_0x0455('0x46')]['findOne']({'where':{'id':_0x37cb78[_0x0455('0x4d')]['id']}})[_0x0455('0x1a')](handleEntityNotFound(_0x2894ea,null))[_0x0455('0x1a')](function(_0x426408){if(_0x426408){return _0x426408[_0x0455('0x5e')](_0x37cb78[_0x0455('0x50')]['ids']||[]);}return null;})['then'](respondWithResult(_0x2894ea,null))['catch'](handleError(_0x2894ea,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index bd4dd08..18f113f 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 _0xcf60=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash'];(function(_0x5ee24a,_0x1a77ef){var _0x36bbee=function(_0x1bee26){while(--_0x1bee26){_0x5ee24a['push'](_0x5ee24a['shift']());}};_0x36bbee(++_0x1a77ef);}(_0xcf60,0xef));var _0x0cf6=function(_0x1d2793,_0x19d93f){_0x1d2793=_0x1d2793-0x0;var _0x39f938=_0xcf60[_0x1d2793];return _0x39f938;};'use strict';var _=require(_0x0cf6('0x0'));var util=require(_0x0cf6('0x1'));var logger=require(_0x0cf6('0x2'))(_0x0cf6('0x3'));var moment=require(_0x0cf6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cf6('0x5'));var rimraf=require(_0x0cf6('0x6'));var config=require(_0x0cf6('0x7'));var attributes=require(_0x0cf6('0x8'));module[_0x0cf6('0x9')]=function(_0x3b376a,_0x23d569){return _0x3b376a[_0x0cf6('0xa')](_0x0cf6('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ff6=['DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x1798af,_0x23ad7f){var _0x1af9f9=function(_0x4a69f8){while(--_0x4a69f8){_0x1798af['push'](_0x1798af['shift']());}};_0x1af9f9(++_0x23ad7f);}(_0x6ff6,0x115));var _0x66ff=function(_0x3bae42,_0x1073b7){_0x3bae42=_0x3bae42-0x0;var _0x2edcf3=_0x6ff6[_0x3bae42];return _0x2edcf3;};'use strict';var _=require(_0x66ff('0x0'));var util=require(_0x66ff('0x1'));var logger=require('../../config/logger')(_0x66ff('0x2'));var moment=require(_0x66ff('0x3'));var BPromise=require(_0x66ff('0x4'));var rp=require(_0x66ff('0x5'));var fs=require('fs');var path=require(_0x66ff('0x6'));var rimraf=require(_0x66ff('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x66ff('0x8')]=function(_0x13db5e,_0x33f9f5){return _0x13db5e['define'](_0x66ff('0x9'),attributes,{'tableName':_0x66ff('0xa'),'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 609534a..4aec64c 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 _0x659c=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x86b6c1,_0x83a6c8){var _0x5f059f=function(_0xce399){while(--_0xce399){_0x86b6c1['push'](_0x86b6c1['shift']());}};_0x5f059f(++_0x83a6c8);}(_0x659c,0x1aa));var _0xc659=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0x659c[_0x1a7edf];return _0x56c1d9;};'use strict';var _=require(_0xc659('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc659('0x1'));var rs=require(_0xc659('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc659('0x3'))['db'];var utils=require(_0xc659('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc659('0x5'));var jayson=require(_0xc659('0x6'));var client=jayson[_0xc659('0x7')][_0xc659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15e20b,_0x33e9d9,_0x536208){return new BPromise(function(_0x51b67f,_0x2cc93d){return client['request'](_0x15e20b,_0x536208)['then'](function(_0x4fadc2){logger[_0xc659('0x9')](_0xc659('0xa'),_0x33e9d9,_0xc659('0xb'));logger[_0xc659('0xc')](_0xc659('0xd'),_0x33e9d9,_0xc659('0xb'),JSON[_0xc659('0xe')](_0x4fadc2));if(_0x4fadc2[_0xc659('0xf')]){if(_0x4fadc2['error'][_0xc659('0x10')]===0x1f4){logger[_0xc659('0xf')](_0xc659('0xa'),_0x33e9d9,_0x4fadc2['error']['message']);return _0x2cc93d(_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);}logger['error'](_0xc659('0xa'),_0x33e9d9,_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);return _0x51b67f(_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);}else{logger[_0xc659('0x9')](_0xc659('0xa'),_0x33e9d9,_0xc659('0xb'));_0x51b67f(_0x4fadc2[_0xc659('0x12')][_0xc659('0x11')]);}})['catch'](function(_0x272210){logger[_0xc659('0xf')](_0xc659('0xa'),_0x33e9d9,_0x272210);_0x2cc93d(_0x272210);});});} \ No newline at end of file +var _0x598a=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x598a,0x1c9));var _0xa598=function(_0x347608,_0x249e14){_0x347608=_0x347608-0x0;var _0x1fde9b=_0x598a[_0x347608];return _0x1fde9b;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var moment=require(_0xa598('0x2'));var BPromise=require(_0xa598('0x3'));var rs=require(_0xa598('0x4'));var fs=require('fs');var Redis=require(_0xa598('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa598('0x6'));var logger=require(_0xa598('0x7'))('rpc');var config=require(_0xa598('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa598('0x9')][_0xa598('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fe11c,_0x16e4a7,_0x35aa05){return new BPromise(function(_0x3ba3e7,_0x1462cc){return client[_0xa598('0xb')](_0x4fe11c,_0x35aa05)[_0xa598('0xc')](function(_0x506164){logger[_0xa598('0xd')](_0xa598('0xe'),_0x16e4a7,_0xa598('0xf'));logger['debug'](_0xa598('0x10'),_0x16e4a7,_0xa598('0xf'),JSON[_0xa598('0x11')](_0x506164));if(_0x506164['error']){if(_0x506164[_0xa598('0x12')]['code']===0x1f4){logger['error'](_0xa598('0xe'),_0x16e4a7,_0x506164[_0xa598('0x12')]['message']);return _0x1462cc(_0x506164[_0xa598('0x12')][_0xa598('0x13')]);}logger[_0xa598('0x12')](_0xa598('0xe'),_0x16e4a7,_0x506164[_0xa598('0x12')]['message']);return _0x3ba3e7(_0x506164['error'][_0xa598('0x13')]);}else{logger['info'](_0xa598('0xe'),_0x16e4a7,_0xa598('0xf'));_0x3ba3e7(_0x506164[_0xa598('0x14')][_0xa598('0x13')]);}})['catch'](function(_0xcf7b45){logger[_0xa598('0x12')](_0xa598('0xe'),_0x16e4a7,_0xcf7b45);_0x1462cc(_0xcf7b45);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 13a648b..b9e43d7 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 _0x0f97=['get','/:id','isAuthenticated','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index'];(function(_0x159fe4,_0x5ef1ba){var _0x14a745=function(_0x504bb8){while(--_0x504bb8){_0x159fe4['push'](_0x159fe4['shift']());}};_0x14a745(++_0x5ef1ba);}(_0x0f97,0x196));var _0x70f9=function(_0x37768b,_0xedcc5a){_0x37768b=_0x37768b-0x0;var _0x1f3c43=_0x0f97[_0x37768b];return _0x1f3c43;};'use strict';var multer=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var path=require(_0x70f9('0x2'));var timeout=require(_0x70f9('0x3'));var express=require(_0x70f9('0x4'));var router=express[_0x70f9('0x5')]();var fs_extra=require(_0x70f9('0x6'));var auth=require(_0x70f9('0x7'));var interaction=require(_0x70f9('0x8'));var config=require(_0x70f9('0x9'));var controller=require(_0x70f9('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x70f9('0xb')]);router[_0x70f9('0xc')](_0x70f9('0xd'),auth[_0x70f9('0xe')](),controller['show']);router['post']('/',auth[_0x70f9('0xe')](),controller[_0x70f9('0xf')]);router[_0x70f9('0x10')](_0x70f9('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x70f9('0xe')](),controller[_0x70f9('0x11')]);module[_0x70f9('0x12')]=router; \ No newline at end of file +var _0xa7b3=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','show','create','/:id','update','delete'];(function(_0x1d2d16,_0x2d4710){var _0x516fa6=function(_0x370095){while(--_0x370095){_0x1d2d16['push'](_0x1d2d16['shift']());}};_0x516fa6(++_0x2d4710);}(_0xa7b3,0x1ee));var _0x3a7b=function(_0x34a05f,_0x2e6b27){_0x34a05f=_0x34a05f-0x0;var _0x49b72b=_0xa7b3[_0x34a05f];return _0x49b72b;};'use strict';var multer=require('multer');var util=require(_0x3a7b('0x0'));var path=require(_0x3a7b('0x1'));var timeout=require(_0x3a7b('0x2'));var express=require(_0x3a7b('0x3'));var router=express[_0x3a7b('0x4')]();var fs_extra=require(_0x3a7b('0x5'));var auth=require(_0x3a7b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3a7b('0x7'));var controller=require(_0x3a7b('0x8'));router['get']('/',auth[_0x3a7b('0x9')](),controller[_0x3a7b('0xa')]);router['get']('/:id',auth[_0x3a7b('0x9')](),controller[_0x3a7b('0xb')]);router['post']('/',auth[_0x3a7b('0x9')](),controller[_0x3a7b('0xc')]);router['put'](_0x3a7b('0xd'),auth[_0x3a7b('0x9')](),controller[_0x3a7b('0xe')]);router[_0x3a7b('0xf')](_0x3a7b('0xd'),auth[_0x3a7b('0x9')](),controller['destroy']);module[_0x3a7b('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index c90a2ad..a7460f4 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 _0x14f0=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x28e7e1,_0x45f235){var _0x1d8a9e=function(_0x3e50cc){while(--_0x3e50cc){_0x28e7e1['push'](_0x28e7e1['shift']());}};_0x1d8a9e(++_0x45f235);}(_0x14f0,0x193));var _0x014f=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x14f0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x014f('0x0'));module[_0x014f('0x1')]={'type':{'type':Sequelize[_0x014f('0x2')](_0x014f('0x3'),_0x014f('0x4'),_0x014f('0x5'),_0x014f('0x6'),_0x014f('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x014f('0x8')]},'key':{'type':Sequelize[_0x014f('0x8')]},'keyType':{'type':Sequelize[_0x014f('0x2')](_0x014f('0x3'),'variable',_0x014f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x014f('0x8')]},'nameField':{'type':Sequelize[_0x014f('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x014f('0x8')]}}; \ No newline at end of file +var _0x4898=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x236ce3,_0xb8d03f){var _0x4a3f88=function(_0x233607){while(--_0x233607){_0x236ce3['push'](_0x236ce3['shift']());}};_0x4a3f88(++_0xb8d03f);}(_0x4898,0x172));var _0x8489=function(_0x45c11f,_0x1faa95){_0x45c11f=_0x45c11f-0x0;var _0x14fbdb=_0x4898[_0x45c11f];return _0x14fbdb;};'use strict';var Sequelize=require(_0x8489('0x0'));module[_0x8489('0x1')]={'type':{'type':Sequelize[_0x8489('0x2')](_0x8489('0x3'),_0x8489('0x4'),'customVariable',_0x8489('0x5'),'picklist'),'defaultValue':_0x8489('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8489('0x6')]},'keyType':{'type':Sequelize[_0x8489('0x2')](_0x8489('0x3'),_0x8489('0x4'),_0x8489('0x7'))},'keyContent':{'type':Sequelize[_0x8489('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8489('0x6')]},'customField':{'type':Sequelize[_0x8489('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8489('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index f5e10bd..fa75509 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 _0x9483=['nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','DeskField','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x468ab2,_0x17feeb){var _0x198ad7=function(_0x1a366c){while(--_0x1a366c){_0x468ab2['push'](_0x468ab2['shift']());}};_0x198ad7(++_0x17feeb);}(_0x9483,0x12e));var _0x3948=function(_0x3623c6,_0xee8f88){_0x3623c6=_0x3623c6-0x0;var _0x5651c2=_0x9483[_0x3623c6];return _0x5651c2;};'use strict';var emlformat=require(_0x3948('0x0'));var rimraf=require(_0x3948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3948('0x2'));var rp=require(_0x3948('0x3'));var moment=require(_0x3948('0x4'));var BPromise=require(_0x3948('0x5'));var Mustache=require('mustache');var util=require(_0x3948('0x6'));var path=require(_0x3948('0x7'));var sox=require('sox');var csv=require(_0x3948('0x8'));var ejs=require(_0x3948('0x9'));var fs=require('fs');var fs_extra=require(_0x3948('0xa'));var _=require(_0x3948('0xb'));var squel=require(_0x3948('0xc'));var crypto=require(_0x3948('0xd'));var jsforce=require(_0x3948('0xe'));var deskjs=require(_0x3948('0xf'));var toCsv=require(_0x3948('0x8'));var querystring=require(_0x3948('0x10'));var Papa=require(_0x3948('0x11'));var Redis=require(_0x3948('0x12'));var authService=require(_0x3948('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3948('0x14'));var hardwareService=require(_0x3948('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3948('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485d92,_0x227c19){_0x227c19=_0x227c19||0xcc;return function(_0x1004f2){if(_0x1004f2){return _0x485d92[_0x3948('0x17')](_0x227c19);}return _0x485d92[_0x3948('0x18')](_0x227c19)[_0x3948('0x19')]();};}function respondWithResult(_0x3b2cc4,_0xf0c470){_0xf0c470=_0xf0c470||0xc8;return function(_0x56dd18){if(_0x56dd18){return _0x3b2cc4[_0x3948('0x18')](_0xf0c470)[_0x3948('0x1a')](_0x56dd18);}};}function respondWithFilteredResult(_0x4309b1,_0x1f0e90){return function(_0x16ec7f){if(_0x16ec7f){var _0x3aa26f=typeof _0x1f0e90[_0x3948('0x1b')]==='undefined'&&typeof _0x1f0e90[_0x3948('0x1c')]==='undefined';var _0x1bee8e=_0x16ec7f['count'];var _0x47d732=_0x3aa26f?0x0:_0x1f0e90[_0x3948('0x1b')];var _0x49f85c=_0x3aa26f?_0x16ec7f[_0x3948('0x1d')]:_0x1f0e90['offset']+_0x1f0e90[_0x3948('0x1c')];var _0x2acc56;if(_0x49f85c>=_0x1bee8e){_0x49f85c=_0x1bee8e;_0x2acc56=0xc8;}else{_0x2acc56=0xce;}_0x4309b1[_0x3948('0x18')](_0x2acc56);return _0x4309b1[_0x3948('0x1e')](_0x3948('0x1f'),_0x47d732+'-'+_0x49f85c+'/'+_0x1bee8e)[_0x3948('0x1a')](_0x16ec7f);}return null;};}function patchUpdates(_0x3d9177){return function(_0x390ef0){try{jsonpatch['apply'](_0x390ef0,_0x3d9177,!![]);}catch(_0x23402e){return BPromise[_0x3948('0x20')](_0x23402e);}return _0x390ef0[_0x3948('0x21')]();};}function saveUpdates(_0x2af58b,_0x2734b8){return function(_0x30a0b2){if(_0x30a0b2){return _0x30a0b2[_0x3948('0x22')](_0x2af58b)[_0x3948('0x23')](function(_0x41602d){return _0x41602d;});}return null;};}function removeEntity(_0x59d526,_0x595277){return function(_0x2adc0a){if(_0x2adc0a){return _0x2adc0a[_0x3948('0x24')]()['then'](function(){_0x59d526[_0x3948('0x18')](0xcc)[_0x3948('0x19')]();});}};}function handleEntityNotFound(_0x29b8e6,_0x2b246b){return function(_0x1e0eba){if(!_0x1e0eba){_0x29b8e6[_0x3948('0x17')](0x194);}return _0x1e0eba;};}function handleError(_0x6360c5,_0x1ae121){_0x1ae121=_0x1ae121||0x1f4;return function(_0x50258e){logger[_0x3948('0x25')](_0x50258e['stack']);if(_0x50258e[_0x3948('0x26')]){delete _0x50258e[_0x3948('0x26')];}_0x6360c5[_0x3948('0x18')](_0x1ae121)[_0x3948('0x27')](_0x50258e);};}exports[_0x3948('0x28')]=function(_0x3e1f11,_0x41f0a2){var _0x2d7ee0={},_0x302bd2={},_0x5888d4={'count':0x0,'rows':[]};var _0x208709=_[_0x3948('0x29')](db[_0x3948('0x2a')][_0x3948('0x2b')],function(_0x123038){return{'name':_0x123038['fieldName'],'type':_0x123038['type'][_0x3948('0x2c')]};});_0x302bd2[_0x3948('0x2d')]=_[_0x3948('0x29')](_0x208709,_0x3948('0x26'));_0x302bd2['query']=_['keys'](_0x3e1f11[_0x3948('0x2e')]);_0x302bd2[_0x3948('0x2f')]=_[_0x3948('0x30')](_0x302bd2['model'],_0x302bd2[_0x3948('0x2e')]);_0x2d7ee0[_0x3948('0x31')]=_[_0x3948('0x30')](_0x302bd2[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x3e1f11['query'][_0x3948('0x32')]));_0x2d7ee0[_0x3948('0x31')]=_0x2d7ee0[_0x3948('0x31')][_0x3948('0x33')]?_0x2d7ee0['attributes']:_0x302bd2['model'];if(!_0x3e1f11[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x2d7ee0[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x3e1f11[_0x3948('0x2e')]['limit']);_0x2d7ee0['offset']=qs['offset'](_0x3e1f11[_0x3948('0x2e')][_0x3948('0x1b')]);}_0x2d7ee0['order']=qs[_0x3948('0x36')](_0x3e1f11['query'][_0x3948('0x36')]);_0x2d7ee0['where']=qs[_0x3948('0x2f')](_[_0x3948('0x37')](_0x3e1f11[_0x3948('0x2e')],_0x302bd2[_0x3948('0x2f')]),_0x208709);if(_0x3e1f11[_0x3948('0x2e')][_0x3948('0x38')]){_0x2d7ee0[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x2d7ee0[_0x3948('0x39')],{'$or':_['map'](_0x208709,function(_0x1096cb){if(_0x1096cb['type']!=='VIRTUAL'){var _0x2ef665={};_0x2ef665[_0x1096cb[_0x3948('0x26')]]={'$like':'%'+_0x3e1f11['query'][_0x3948('0x38')]+'%'};return _0x2ef665;}})});}_0x2d7ee0=_[_0x3948('0x3a')]({},_0x2d7ee0,_0x3e1f11[_0x3948('0x3b')]);var _0x4052f7={'where':_0x2d7ee0[_0x3948('0x39')]};return db[_0x3948('0x2a')][_0x3948('0x1d')](_0x4052f7)[_0x3948('0x23')](function(_0x2600eb){_0x5888d4[_0x3948('0x1d')]=_0x2600eb;if(_0x3e1f11['query']['includeAll']){_0x2d7ee0[_0x3948('0x3c')]=[{'all':!![]}];}return db[_0x3948('0x2a')][_0x3948('0x3d')](_0x2d7ee0);})[_0x3948('0x23')](function(_0x5266f0){_0x5888d4[_0x3948('0x3e')]=_0x5266f0;return _0x5888d4;})[_0x3948('0x23')](respondWithFilteredResult(_0x41f0a2,_0x2d7ee0))[_0x3948('0x3f')](handleError(_0x41f0a2,null));};exports[_0x3948('0x40')]=function(_0x5a528c,_0x190f9e){var _0x2aff13={'raw':!![],'where':{'id':_0x5a528c[_0x3948('0x41')]['id']}},_0x149b98={};_0x149b98['model']=_[_0x3948('0x42')](db[_0x3948('0x2a')][_0x3948('0x2b')]);_0x149b98['query']=_['keys'](_0x5a528c[_0x3948('0x2e')]);_0x149b98[_0x3948('0x2f')]=_['intersection'](_0x149b98[_0x3948('0x2d')],_0x149b98[_0x3948('0x2e')]);_0x2aff13[_0x3948('0x31')]=_[_0x3948('0x30')](_0x149b98[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x5a528c[_0x3948('0x2e')]['fields']));_0x2aff13['attributes']=_0x2aff13['attributes'][_0x3948('0x33')]?_0x2aff13[_0x3948('0x31')]:_0x149b98[_0x3948('0x2d')];if(_0x5a528c['query'][_0x3948('0x43')]){_0x2aff13[_0x3948('0x3c')]=[{'all':!![]}];}_0x2aff13=_[_0x3948('0x3a')]({},_0x2aff13,_0x5a528c[_0x3948('0x3b')]);return db['DeskField'][_0x3948('0x44')](_0x2aff13)[_0x3948('0x23')](handleEntityNotFound(_0x190f9e,null))[_0x3948('0x23')](respondWithResult(_0x190f9e,null))[_0x3948('0x3f')](handleError(_0x190f9e,null));};exports[_0x3948('0x45')]=function(_0x2c5130,_0x4fe2a3){return db['DeskField'][_0x3948('0x45')](_0x2c5130['body'],{})[_0x3948('0x23')](respondWithResult(_0x4fe2a3,0xc9))['catch'](handleError(_0x4fe2a3,null));};exports[_0x3948('0x22')]=function(_0x5543ed,_0x5ddfbc){if(_0x5543ed['body']['id']){delete _0x5543ed['body']['id'];}return db['DeskField'][_0x3948('0x44')]({'where':{'id':_0x5543ed[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x5ddfbc,null))[_0x3948('0x23')](saveUpdates(_0x5543ed[_0x3948('0x46')],null))['then'](respondWithResult(_0x5ddfbc,null))[_0x3948('0x3f')](handleError(_0x5ddfbc,null));};exports['destroy']=function(_0x23d8e7,_0x612cd){return db[_0x3948('0x2a')]['find']({'where':{'id':_0x23d8e7[_0x3948('0x41')]['id']}})['then'](handleEntityNotFound(_0x612cd,null))[_0x3948('0x23')](removeEntity(_0x612cd,null))[_0x3948('0x3f')](handleError(_0x612cd,null));}; \ No newline at end of file +var _0x5502=['model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','includeAll','findAll','rows','catch','show','params','length','include','merge','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0x5502,0x69));var _0x2550=function(_0x1ce8fd,_0x1fd875){_0x1ce8fd=_0x1ce8fd-0x0;var _0xd5cdb5=_0x5502[_0x1ce8fd];return _0xd5cdb5;};'use strict';var emlformat=require(_0x2550('0x0'));var rimraf=require(_0x2550('0x1'));var zipdir=require(_0x2550('0x2'));var jsonpatch=require(_0x2550('0x3'));var rp=require(_0x2550('0x4'));var moment=require(_0x2550('0x5'));var BPromise=require(_0x2550('0x6'));var Mustache=require(_0x2550('0x7'));var util=require(_0x2550('0x8'));var path=require(_0x2550('0x9'));var sox=require(_0x2550('0xa'));var csv=require(_0x2550('0xb'));var ejs=require(_0x2550('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2550('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2550('0xe'));var deskjs=require(_0x2550('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2550('0x10'));var Papa=require('papaparse');var Redis=require(_0x2550('0x11'));var authService=require(_0x2550('0x12'));var qs=require(_0x2550('0x13'));var as=require(_0x2550('0x14'));var hardwareService=require(_0x2550('0x15'));var logger=require(_0x2550('0x16'))('api');var utils=require(_0x2550('0x17'));var config=require(_0x2550('0x18'));var licenseUtil=require(_0x2550('0x19'));var db=require(_0x2550('0x1a'))['db'];function respondWithStatusCode(_0x4ee238,_0x3bc4f0){_0x3bc4f0=_0x3bc4f0||0xcc;return function(_0xcd1bbb){if(_0xcd1bbb){return _0x4ee238['sendStatus'](_0x3bc4f0);}return _0x4ee238[_0x2550('0x1b')](_0x3bc4f0)[_0x2550('0x1c')]();};}function respondWithResult(_0x154c18,_0x19a17f){_0x19a17f=_0x19a17f||0xc8;return function(_0x3fef28){if(_0x3fef28){return _0x154c18[_0x2550('0x1b')](_0x19a17f)['json'](_0x3fef28);}};}function respondWithFilteredResult(_0x2aa2ed,_0x2f7587){return function(_0x366848){if(_0x366848){var _0x179866=typeof _0x2f7587[_0x2550('0x1d')]===_0x2550('0x1e')&&typeof _0x2f7587['limit']===_0x2550('0x1e');var _0x2d06e1=_0x366848[_0x2550('0x1f')];var _0x5c1bcb=_0x179866?0x0:_0x2f7587[_0x2550('0x1d')];var _0x5451de=_0x179866?_0x366848['count']:_0x2f7587[_0x2550('0x1d')]+_0x2f7587['limit'];var _0x2324ce;if(_0x5451de>=_0x2d06e1){_0x5451de=_0x2d06e1;_0x2324ce=0xc8;}else{_0x2324ce=0xce;}_0x2aa2ed[_0x2550('0x1b')](_0x2324ce);return _0x2aa2ed[_0x2550('0x20')](_0x2550('0x21'),_0x5c1bcb+'-'+_0x5451de+'/'+_0x2d06e1)[_0x2550('0x22')](_0x366848);}return null;};}function patchUpdates(_0x4d3e1e){return function(_0x5177e2){try{jsonpatch['apply'](_0x5177e2,_0x4d3e1e,!![]);}catch(_0x15581e){return BPromise[_0x2550('0x23')](_0x15581e);}return _0x5177e2[_0x2550('0x24')]();};}function saveUpdates(_0x295f3b,_0x20c942){return function(_0x28359b){if(_0x28359b){return _0x28359b[_0x2550('0x25')](_0x295f3b)[_0x2550('0x26')](function(_0x1d3d19){return _0x1d3d19;});}return null;};}function removeEntity(_0x534608,_0x3dadc8){return function(_0x4715f6){if(_0x4715f6){return _0x4715f6['destroy']()[_0x2550('0x26')](function(){_0x534608[_0x2550('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x418828,_0x3e15d2){return function(_0x1431ea){if(!_0x1431ea){_0x418828[_0x2550('0x27')](0x194);}return _0x1431ea;};}function handleError(_0x3a4d65,_0x1db6ec){_0x1db6ec=_0x1db6ec||0x1f4;return function(_0x66ac37){logger[_0x2550('0x28')](_0x66ac37[_0x2550('0x29')]);if(_0x66ac37[_0x2550('0x2a')]){delete _0x66ac37[_0x2550('0x2a')];}_0x3a4d65[_0x2550('0x1b')](_0x1db6ec)[_0x2550('0x2b')](_0x66ac37);};}exports['index']=function(_0x2e1fc6,_0x1f05d6){var _0x219f17={},_0x38f07a={},_0x2693b1={'count':0x0,'rows':[]};var _0x171567=_[_0x2550('0x2c')](db[_0x2550('0x2d')][_0x2550('0x2e')],function(_0x256509){return{'name':_0x256509[_0x2550('0x2f')],'type':_0x256509[_0x2550('0x30')]['key']};});_0x38f07a[_0x2550('0x31')]=_[_0x2550('0x2c')](_0x171567,_0x2550('0x2a'));_0x38f07a[_0x2550('0x32')]=_[_0x2550('0x33')](_0x2e1fc6['query']);_0x38f07a['filters']=_[_0x2550('0x34')](_0x38f07a[_0x2550('0x31')],_0x38f07a[_0x2550('0x32')]);_0x219f17['attributes']=_[_0x2550('0x34')](_0x38f07a[_0x2550('0x31')],qs[_0x2550('0x35')](_0x2e1fc6['query'][_0x2550('0x35')]));_0x219f17[_0x2550('0x36')]=_0x219f17[_0x2550('0x36')]['length']?_0x219f17[_0x2550('0x36')]:_0x38f07a['model'];if(!_0x2e1fc6[_0x2550('0x32')][_0x2550('0x37')](_0x2550('0x38'))){_0x219f17['limit']=qs[_0x2550('0x39')](_0x2e1fc6[_0x2550('0x32')]['limit']);_0x219f17['offset']=qs[_0x2550('0x1d')](_0x2e1fc6[_0x2550('0x32')][_0x2550('0x1d')]);}_0x219f17[_0x2550('0x3a')]=qs[_0x2550('0x3b')](_0x2e1fc6[_0x2550('0x32')][_0x2550('0x3b')]);_0x219f17[_0x2550('0x3c')]=qs[_0x2550('0x3d')](_[_0x2550('0x3e')](_0x2e1fc6[_0x2550('0x32')],_0x38f07a[_0x2550('0x3d')]),_0x171567);if(_0x2e1fc6[_0x2550('0x32')][_0x2550('0x3f')]){_0x219f17[_0x2550('0x3c')]=_['merge'](_0x219f17['where'],{'$or':_[_0x2550('0x2c')](_0x171567,function(_0x5d1542){if(_0x5d1542[_0x2550('0x30')]!=='VIRTUAL'){var _0x1d4b15={};_0x1d4b15[_0x5d1542[_0x2550('0x2a')]]={'$like':'%'+_0x2e1fc6[_0x2550('0x32')]['filter']+'%'};return _0x1d4b15;}})});}_0x219f17=_['merge']({},_0x219f17,_0x2e1fc6['options']);var _0x5ae274={'where':_0x219f17[_0x2550('0x3c')]};return db['DeskField'][_0x2550('0x1f')](_0x5ae274)[_0x2550('0x26')](function(_0x1b49d8){_0x2693b1[_0x2550('0x1f')]=_0x1b49d8;if(_0x2e1fc6[_0x2550('0x32')][_0x2550('0x40')]){_0x219f17['include']=[{'all':!![]}];}return db[_0x2550('0x2d')][_0x2550('0x41')](_0x219f17);})[_0x2550('0x26')](function(_0x49a6a1){_0x2693b1[_0x2550('0x42')]=_0x49a6a1;return _0x2693b1;})['then'](respondWithFilteredResult(_0x1f05d6,_0x219f17))[_0x2550('0x43')](handleError(_0x1f05d6,null));};exports[_0x2550('0x44')]=function(_0x9c54,_0x31f3fa){var _0x1b3280={'raw':!![],'where':{'id':_0x9c54[_0x2550('0x45')]['id']}},_0xf81abf={};_0xf81abf[_0x2550('0x31')]=_['keys'](db['DeskField'][_0x2550('0x2e')]);_0xf81abf[_0x2550('0x32')]=_[_0x2550('0x33')](_0x9c54[_0x2550('0x32')]);_0xf81abf['filters']=_['intersection'](_0xf81abf[_0x2550('0x31')],_0xf81abf[_0x2550('0x32')]);_0x1b3280[_0x2550('0x36')]=_[_0x2550('0x34')](_0xf81abf[_0x2550('0x31')],qs[_0x2550('0x35')](_0x9c54[_0x2550('0x32')][_0x2550('0x35')]));_0x1b3280[_0x2550('0x36')]=_0x1b3280[_0x2550('0x36')][_0x2550('0x46')]?_0x1b3280['attributes']:_0xf81abf['model'];if(_0x9c54['query']['includeAll']){_0x1b3280[_0x2550('0x47')]=[{'all':!![]}];}_0x1b3280=_[_0x2550('0x48')]({},_0x1b3280,_0x9c54[_0x2550('0x49')]);return db[_0x2550('0x2d')][_0x2550('0x4a')](_0x1b3280)[_0x2550('0x26')](handleEntityNotFound(_0x31f3fa,null))[_0x2550('0x26')](respondWithResult(_0x31f3fa,null))[_0x2550('0x43')](handleError(_0x31f3fa,null));};exports['create']=function(_0x1d8cc0,_0x2910b8){return db[_0x2550('0x2d')][_0x2550('0x4b')](_0x1d8cc0[_0x2550('0x4c')],{})[_0x2550('0x26')](respondWithResult(_0x2910b8,0xc9))[_0x2550('0x43')](handleError(_0x2910b8,null));};exports[_0x2550('0x25')]=function(_0x30b93d,_0x5bcdb2){if(_0x30b93d['body']['id']){delete _0x30b93d[_0x2550('0x4c')]['id'];}return db[_0x2550('0x2d')][_0x2550('0x4a')]({'where':{'id':_0x30b93d[_0x2550('0x45')]['id']}})[_0x2550('0x26')](handleEntityNotFound(_0x5bcdb2,null))[_0x2550('0x26')](saveUpdates(_0x30b93d[_0x2550('0x4c')],null))[_0x2550('0x26')](respondWithResult(_0x5bcdb2,null))[_0x2550('0x43')](handleError(_0x5bcdb2,null));};exports['destroy']=function(_0x144f94,_0x2b122a){return db[_0x2550('0x2d')][_0x2550('0x4a')]({'where':{'id':_0x144f94[_0x2550('0x45')]['id']}})[_0x2550('0x26')](handleEntityNotFound(_0x2b122a,null))[_0x2550('0x26')](removeEntity(_0x2b122a,null))[_0x2550('0x43')](handleError(_0x2b122a,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index e548938..bc2795d 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 _0x512c=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util'];(function(_0x22a3fd,_0x4bcdef){var _0x477357=function(_0x5b191e){while(--_0x5b191e){_0x22a3fd['push'](_0x22a3fd['shift']());}};_0x477357(++_0x4bcdef);}(_0x512c,0x194));var _0xc512=function(_0xede61b,_0x2615f9){_0xede61b=_0xede61b-0x0;var _0x1c6340=_0x512c[_0xede61b];return _0x1c6340;};'use strict';var _=require(_0xc512('0x0'));var util=require(_0xc512('0x1'));var logger=require('../../config/logger')(_0xc512('0x2'));var moment=require('moment');var BPromise=require(_0xc512('0x3'));var rp=require(_0xc512('0x4'));var fs=require('fs');var path=require(_0xc512('0x5'));var rimraf=require(_0xc512('0x6'));var config=require(_0xc512('0x7'));var attributes=require(_0xc512('0x8'));module['exports']=function(_0x289b46,_0x3db3c3){return _0x289b46['define'](_0xc512('0x9'),attributes,{'tableName':_0xc512('0xa'),'paranoid':![],'indexes':[{'name':_0xc512('0xb'),'fields':[_0xc512('0xc'),_0xc512('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bbd=['DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x25c385,_0x41126e){var _0x1663be=function(_0x100812){while(--_0x100812){_0x25c385['push'](_0x25c385['shift']());}};_0x1663be(++_0x41126e);}(_0x2bbd,0x9e));var _0xd2bb=function(_0x5377ca,_0x543609){_0x5377ca=_0x5377ca-0x0;var _0x4a6430=_0x2bbd[_0x5377ca];return _0x4a6430;};'use strict';var _=require(_0xd2bb('0x0'));var util=require(_0xd2bb('0x1'));var logger=require(_0xd2bb('0x2'))(_0xd2bb('0x3'));var moment=require(_0xd2bb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2bb('0x5'));var rimraf=require(_0xd2bb('0x6'));var config=require(_0xd2bb('0x7'));var attributes=require('./intDeskField.attributes');module[_0xd2bb('0x8')]=function(_0x8d06ef,_0xda3670){return _0x8d06ef[_0xd2bb('0x9')](_0xd2bb('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xd2bb('0xb'),'fields':[_0xd2bb('0xc'),_0xd2bb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 508807d..b867e97 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 _0xd757=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch'];(function(_0x53a2b3,_0x33995a){var _0x34e018=function(_0x1f0a89){while(--_0x1f0a89){_0x53a2b3['push'](_0x53a2b3['shift']());}};_0x34e018(++_0x33995a);}(_0xd757,0x8c));var _0x7d75=function(_0x353d59,_0x1bd2b1){_0x353d59=_0x353d59-0x0;var _0x268555=_0xd757[_0x353d59];return _0x268555;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var moment=require('moment');var BPromise=require(_0x7d75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d75('0x3'));var db=require(_0x7d75('0x4'))['db'];var utils=require(_0x7d75('0x5'));var logger=require('../../config/logger')(_0x7d75('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7d75('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xff466a,_0x2af99b,_0x356c6a){return new BPromise(function(_0x4feb63,_0xa8d08){return client[_0x7d75('0x8')](_0xff466a,_0x356c6a)[_0x7d75('0x9')](function(_0x1f28b6){logger[_0x7d75('0xa')](_0x7d75('0xb'),_0x2af99b,_0x7d75('0xc'));logger[_0x7d75('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2af99b,_0x7d75('0xc'),JSON[_0x7d75('0xe')](_0x1f28b6));if(_0x1f28b6['error']){if(_0x1f28b6['error'][_0x7d75('0xf')]===0x1f4){logger[_0x7d75('0x10')](_0x7d75('0xb'),_0x2af99b,_0x1f28b6['error'][_0x7d75('0x11')]);return _0xa8d08(_0x1f28b6[_0x7d75('0x10')][_0x7d75('0x11')]);}logger['error'](_0x7d75('0xb'),_0x2af99b,_0x1f28b6[_0x7d75('0x10')][_0x7d75('0x11')]);return _0x4feb63(_0x1f28b6[_0x7d75('0x10')][_0x7d75('0x11')]);}else{logger[_0x7d75('0xa')](_0x7d75('0xb'),_0x2af99b,_0x7d75('0xc'));_0x4feb63(_0x1f28b6[_0x7d75('0x12')]['message']);}})[_0x7d75('0x13')](function(_0x46e1c1){logger[_0x7d75('0x10')](_0x7d75('0xb'),_0x2af99b,_0x46e1c1);_0xa8d08(_0x46e1c1);});});} \ No newline at end of file +var _0x7dc9=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x5c3511,_0x59082e){var _0x3a4bf2=function(_0x323f47){while(--_0x323f47){_0x5c3511['push'](_0x5c3511['shift']());}};_0x3a4bf2(++_0x59082e);}(_0x7dc9,0x7f));var _0x97dc=function(_0x1e0336,_0x1374a4){_0x1e0336=_0x1e0336-0x0;var _0x530d5d=_0x7dc9[_0x1e0336];return _0x530d5d;};'use strict';var _=require(_0x97dc('0x0'));var util=require(_0x97dc('0x1'));var moment=require(_0x97dc('0x2'));var BPromise=require(_0x97dc('0x3'));var rs=require(_0x97dc('0x4'));var fs=require('fs');var Redis=require(_0x97dc('0x5'));var db=require(_0x97dc('0x6'))['db'];var utils=require(_0x97dc('0x7'));var logger=require('../../config/logger')(_0x97dc('0x8'));var config=require('../../config/environment');var jayson=require(_0x97dc('0x9'));var client=jayson['client'][_0x97dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4511,_0x17a812,_0x42ee01){return new BPromise(function(_0x385fd8,_0x2ed263){return client[_0x97dc('0xb')](_0x5e4511,_0x42ee01)[_0x97dc('0xc')](function(_0x43b063){logger[_0x97dc('0xd')](_0x97dc('0xe'),_0x17a812,_0x97dc('0xf'));logger[_0x97dc('0x10')](_0x97dc('0x11'),_0x17a812,_0x97dc('0xf'),JSON['stringify'](_0x43b063));if(_0x43b063[_0x97dc('0x12')]){if(_0x43b063[_0x97dc('0x12')][_0x97dc('0x13')]===0x1f4){logger[_0x97dc('0x12')]('DeskField,\x20%s,\x20%s',_0x17a812,_0x43b063[_0x97dc('0x12')][_0x97dc('0x14')]);return _0x2ed263(_0x43b063['error'][_0x97dc('0x14')]);}logger[_0x97dc('0x12')](_0x97dc('0xe'),_0x17a812,_0x43b063[_0x97dc('0x12')][_0x97dc('0x14')]);return _0x385fd8(_0x43b063[_0x97dc('0x12')][_0x97dc('0x14')]);}else{logger[_0x97dc('0xd')](_0x97dc('0xe'),_0x17a812,_0x97dc('0xf'));_0x385fd8(_0x43b063[_0x97dc('0x15')]['message']);}})[_0x97dc('0x16')](function(_0x450340){logger['error'](_0x97dc('0xe'),_0x17a812,_0x450340);_0x2ed263(_0x450340);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index d19d583..cd4417a 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 _0x2f3d=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x38d519,_0x392d75){var _0x2cbed8=function(_0x1a282f){while(--_0x1a282f){_0x38d519['push'](_0x38d519['shift']());}};_0x2cbed8(++_0x392d75);}(_0x2f3d,0x1c4));var _0xd2f3=function(_0x10c664,_0x26a9fe){_0x10c664=_0x10c664-0x0;var _0x271092=_0x2f3d[_0x10c664];return _0x271092;};'use strict';var multer=require('multer');var util=require(_0xd2f3('0x0'));var path=require(_0xd2f3('0x1'));var timeout=require(_0xd2f3('0x2'));var express=require(_0xd2f3('0x3'));var router=express[_0xd2f3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd2f3('0x5'));var interaction=require(_0xd2f3('0x6'));var config=require(_0xd2f3('0x7'));var controller=require(_0xd2f3('0x8'));router[_0xd2f3('0x9')]('/',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xb')]);router[_0xd2f3('0x9')](_0xd2f3('0xc'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xd')]);router[_0xd2f3('0x9')]('/:id/configurations',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xe')]);router[_0xd2f3('0x9')]('/:id/fields',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xf')]);router['post']('/',auth[_0xd2f3('0xa')](),controller['create']);router[_0xd2f3('0x10')](_0xd2f3('0x11'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x12')]);router[_0xd2f3('0x13')](_0xd2f3('0xc'),auth['isAuthenticated'](),controller[_0xd2f3('0x14')]);router[_0xd2f3('0x15')](_0xd2f3('0xc'),auth[_0xd2f3('0xa')](),controller['destroy']);module[_0xd2f3('0x16')]=router; \ No newline at end of file +var _0x3e10=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x3e10,0x12e));var _0x03e1=function(_0x1b0a06,_0x7677f4){_0x1b0a06=_0x1b0a06-0x0;var _0x13d55a=_0x3e10[_0x1b0a06];return _0x13d55a;};'use strict';var multer=require(_0x03e1('0x0'));var util=require('util');var path=require(_0x03e1('0x1'));var timeout=require(_0x03e1('0x2'));var express=require(_0x03e1('0x3'));var router=express[_0x03e1('0x4')]();var fs_extra=require(_0x03e1('0x5'));var auth=require(_0x03e1('0x6'));var interaction=require(_0x03e1('0x7'));var config=require(_0x03e1('0x8'));var controller=require(_0x03e1('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x03e1('0xa')]);router[_0x03e1('0xb')](_0x03e1('0xc'),auth[_0x03e1('0xd')](),controller['show']);router[_0x03e1('0xb')](_0x03e1('0xe'),auth[_0x03e1('0xd')](),controller[_0x03e1('0xf')]);router[_0x03e1('0xb')](_0x03e1('0x10'),auth[_0x03e1('0xd')](),controller[_0x03e1('0x11')]);router[_0x03e1('0x12')]('/',auth[_0x03e1('0xd')](),controller['create']);router[_0x03e1('0x12')](_0x03e1('0xe'),auth[_0x03e1('0xd')](),controller['addConfiguration']);router['put'](_0x03e1('0xc'),auth[_0x03e1('0xd')](),controller[_0x03e1('0x13')]);router[_0x03e1('0x14')](_0x03e1('0xc'),auth[_0x03e1('0xd')](),controller['destroy']);module[_0x03e1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 54510f5..6cbe01f 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 _0x23fb=['STRING','sequelize','exports'];(function(_0x3042d5,_0x349534){var _0x1acfef=function(_0x5a920f){while(--_0x5a920f){_0x3042d5['push'](_0x3042d5['shift']());}};_0x1acfef(++_0x349534);}(_0x23fb,0x11b));var _0xb23f=function(_0x53a356,_0x9da31a){_0x53a356=_0x53a356-0x0;var _0xc2b531=_0x23fb[_0x53a356];return _0xc2b531;};'use strict';var Sequelize=require(_0xb23f('0x0'));module[_0xb23f('0x1')]={'name':{'type':Sequelize[_0xb23f('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb23f('0x2')]},'remoteUri':{'type':Sequelize[_0xb23f('0x2')]},'tenantId':{'type':Sequelize[_0xb23f('0x2')]},'clientId':{'type':Sequelize[_0xb23f('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb23f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb23f('0x2')]}}; \ No newline at end of file +var _0x745c=['sequelize','exports','STRING'];(function(_0x18f9b5,_0x28e948){var _0x43443e=function(_0x33f8e2){while(--_0x33f8e2){_0x18f9b5['push'](_0x18f9b5['shift']());}};_0x43443e(++_0x28e948);}(_0x745c,0xa2));var _0xc745=function(_0x553837,_0x161714){_0x553837=_0x553837-0x0;var _0x124212=_0x745c[_0x553837];return _0x124212;};'use strict';var Sequelize=require(_0xc745('0x0'));module[_0xc745('0x1')]={'name':{'type':Sequelize[_0xc745('0x2')]},'username':{'type':Sequelize[_0xc745('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc745('0x2')]},'tenantId':{'type':Sequelize[_0xc745('0x2')]},'clientId':{'type':Sequelize[_0xc745('0x2')]},'clientSecret':{'type':Sequelize[_0xc745('0x2')]},'serverUrl':{'type':Sequelize[_0xc745('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc745('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 70a6e0c..2f56ef0 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 _0xeb56=['VIRTUAL','includeAll','include','show','params','rawAttributes','keys','options','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','subject','phonenumber','directioncode','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','remoteUri','slice','substring','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','username','password','clientSecret','GET','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','all','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','push','concat','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','Dynamics365Account','fieldName','type','filters','intersection','model','fields','query','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x323c7e,_0x3d16ec){var _0x2b0f72=function(_0x5a2310){while(--_0x5a2310){_0x323c7e['push'](_0x323c7e['shift']());}};_0x2b0f72(++_0x3d16ec);}(_0xeb56,0x90));var _0x6eb5=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xeb56[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x6eb5('0x0'));var rimraf=require(_0x6eb5('0x1'));var zipdir=require(_0x6eb5('0x2'));var jsonpatch=require(_0x6eb5('0x3'));var rp=require(_0x6eb5('0x4'));var moment=require('moment');var BPromise=require(_0x6eb5('0x5'));var Mustache=require(_0x6eb5('0x6'));var util=require(_0x6eb5('0x7'));var path=require(_0x6eb5('0x8'));var sox=require(_0x6eb5('0x9'));var csv=require(_0x6eb5('0xa'));var ejs=require(_0x6eb5('0xb'));var fs=require('fs');var fs_extra=require(_0x6eb5('0xc'));var _=require(_0x6eb5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6eb5('0xa'));var querystring=require(_0x6eb5('0xe'));var Papa=require(_0x6eb5('0xf'));var Redis=require(_0x6eb5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6eb5('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6eb5('0x12'));var config=require(_0x6eb5('0x13'));var licenseUtil=require(_0x6eb5('0x14'));var db=require(_0x6eb5('0x15'))['db'];var integrations=require(_0x6eb5('0x16'));var jayson=require(_0x6eb5('0x17'));var client=jayson[_0x6eb5('0x18')][_0x6eb5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x24892a,_0x26a68f,_0x1cbb9f,_0x185e09){return new BPromise(function(_0x3bdc8a,_0x34bc3b){var _0x42538d=_0x185e09||client;return _0x42538d[_0x6eb5('0x1a')](_0x24892a,_0x1cbb9f)['then'](function(_0x376a5b){logger[_0x6eb5('0x1b')](_0x6eb5('0x1c'),_0x26a68f,'request\x20sent');logger[_0x6eb5('0x1d')](_0x6eb5('0x1e'),_0x26a68f,_0x6eb5('0x1f'),JSON[_0x6eb5('0x20')](_0x376a5b));if(_0x376a5b[_0x6eb5('0x21')]){if(_0x376a5b[_0x6eb5('0x21')][_0x6eb5('0x22')]===0x1f4){logger[_0x6eb5('0x21')](_0x6eb5('0x1c'),_0x26a68f,_0x376a5b['error'][_0x6eb5('0x23')]);return _0x34bc3b(_0x376a5b[_0x6eb5('0x21')][_0x6eb5('0x23')]);}logger[_0x6eb5('0x21')](_0x6eb5('0x1c'),_0x26a68f,_0x376a5b[_0x6eb5('0x21')][_0x6eb5('0x23')]);return _0x3bdc8a(_0x376a5b['error']['message']);}else{logger[_0x6eb5('0x1b')](_0x6eb5('0x1c'),_0x26a68f,_0x6eb5('0x1f'));_0x3bdc8a(_0x376a5b[_0x6eb5('0x24')]['message']);}})[_0x6eb5('0x25')](function(_0x488266){logger[_0x6eb5('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x26a68f,_0x488266);_0x34bc3b(_0x488266);});});}function respondWithStatusCode(_0x219405,_0xe9cf90){_0xe9cf90=_0xe9cf90||0xcc;return function(_0x1b5502){if(_0x1b5502){return _0x219405[_0x6eb5('0x26')](_0xe9cf90);}return _0x219405['status'](_0xe9cf90)[_0x6eb5('0x27')]();};}function respondWithResult(_0x429fc2,_0x2e600c){_0x2e600c=_0x2e600c||0xc8;return function(_0x1be4fd){if(_0x1be4fd){return _0x429fc2['status'](_0x2e600c)[_0x6eb5('0x28')](_0x1be4fd);}};}function respondWithFilteredResult(_0x375c94,_0x1d629a){return function(_0x1ca4f2){if(_0x1ca4f2){var _0x341d35=typeof _0x1d629a[_0x6eb5('0x29')]===_0x6eb5('0x2a')&&typeof _0x1d629a['limit']===_0x6eb5('0x2a');var _0xcca7be=_0x1ca4f2[_0x6eb5('0x2b')];var _0x67e80b=_0x341d35?0x0:_0x1d629a[_0x6eb5('0x29')];var _0x1b41e3=_0x341d35?_0x1ca4f2[_0x6eb5('0x2b')]:_0x1d629a[_0x6eb5('0x29')]+_0x1d629a[_0x6eb5('0x2c')];var _0x9199f9;if(_0x1b41e3>=_0xcca7be){_0x1b41e3=_0xcca7be;_0x9199f9=0xc8;}else{_0x9199f9=0xce;}_0x375c94[_0x6eb5('0x2d')](_0x9199f9);return _0x375c94[_0x6eb5('0x2e')](_0x6eb5('0x2f'),_0x67e80b+'-'+_0x1b41e3+'/'+_0xcca7be)[_0x6eb5('0x28')](_0x1ca4f2);}return null;};}function patchUpdates(_0x402173){return function(_0x36bbd4){try{jsonpatch[_0x6eb5('0x30')](_0x36bbd4,_0x402173,!![]);}catch(_0x1dce3f){return BPromise[_0x6eb5('0x31')](_0x1dce3f);}return _0x36bbd4['save']();};}function saveUpdates(_0x5b1e51,_0x4de546){return function(_0x35c97a){if(_0x35c97a){return _0x35c97a['update'](_0x5b1e51)[_0x6eb5('0x32')](function(_0x2a8bba){return _0x2a8bba;});}return null;};}function removeEntity(_0x37ad37,_0x20451b){return function(_0x272fb7){if(_0x272fb7){return _0x272fb7[_0x6eb5('0x33')]()['then'](function(){_0x37ad37['status'](0xcc)[_0x6eb5('0x27')]();});}};}function handleEntityNotFound(_0x2bfe43,_0x15ee0f){return function(_0x47cf7f){if(!_0x47cf7f){_0x2bfe43[_0x6eb5('0x26')](0x194);}return _0x47cf7f;};}function handleError(_0x200d67,_0x4bb1a9){_0x4bb1a9=_0x4bb1a9||0x1f4;return function(_0x18f5c8){logger['error'](_0x18f5c8[_0x6eb5('0x34')]);if(_0x18f5c8[_0x6eb5('0x35')]){delete _0x18f5c8[_0x6eb5('0x35')];}_0x200d67[_0x6eb5('0x2d')](_0x4bb1a9)[_0x6eb5('0x36')](_0x18f5c8);};}exports[_0x6eb5('0x37')]=function(_0x2b4465,_0x3143b9){var _0x23ad19={},_0x556f76={},_0x3dc8fe={'count':0x0,'rows':[]};var _0x597e7c=_[_0x6eb5('0x38')](db[_0x6eb5('0x39')]['rawAttributes'],function(_0x5079a4){return{'name':_0x5079a4[_0x6eb5('0x3a')],'type':_0x5079a4[_0x6eb5('0x3b')]['key']};});_0x556f76['model']=_[_0x6eb5('0x38')](_0x597e7c,'name');_0x556f76['query']=_['keys'](_0x2b4465['query']);_0x556f76[_0x6eb5('0x3c')]=_[_0x6eb5('0x3d')](_0x556f76[_0x6eb5('0x3e')],_0x556f76['query']);_0x23ad19['attributes']=_[_0x6eb5('0x3d')](_0x556f76[_0x6eb5('0x3e')],qs[_0x6eb5('0x3f')](_0x2b4465[_0x6eb5('0x40')]['fields']));_0x23ad19['attributes']=_0x23ad19['attributes'][_0x6eb5('0x41')]?_0x23ad19[_0x6eb5('0x42')]:_0x556f76[_0x6eb5('0x3e')];if(!_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x43')](_0x6eb5('0x44'))){_0x23ad19['limit']=qs['limit'](_0x2b4465['query'][_0x6eb5('0x2c')]);_0x23ad19[_0x6eb5('0x29')]=qs['offset'](_0x2b4465['query'][_0x6eb5('0x29')]);}_0x23ad19[_0x6eb5('0x45')]=qs[_0x6eb5('0x46')](_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x46')]);_0x23ad19['where']=qs[_0x6eb5('0x3c')](_[_0x6eb5('0x47')](_0x2b4465[_0x6eb5('0x40')],_0x556f76['filters']),_0x597e7c);if(_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x48')]){_0x23ad19[_0x6eb5('0x49')]=_[_0x6eb5('0x4a')](_0x23ad19[_0x6eb5('0x49')],{'$or':_[_0x6eb5('0x38')](_0x597e7c,function(_0x108430){if(_0x108430[_0x6eb5('0x3b')]!==_0x6eb5('0x4b')){var _0x55be70={};_0x55be70[_0x108430['name']]={'$like':'%'+_0x2b4465['query'][_0x6eb5('0x48')]+'%'};return _0x55be70;}})});}_0x23ad19=_[_0x6eb5('0x4a')]({},_0x23ad19,_0x2b4465['options']);var _0x16f5e9={'where':_0x23ad19[_0x6eb5('0x49')]};return db[_0x6eb5('0x39')][_0x6eb5('0x2b')](_0x16f5e9)[_0x6eb5('0x32')](function(_0x43e9fe){_0x3dc8fe[_0x6eb5('0x2b')]=_0x43e9fe;if(_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x4c')]){_0x23ad19[_0x6eb5('0x4d')]=[{'all':!![]}];}return db[_0x6eb5('0x39')]['findAll'](_0x23ad19);})[_0x6eb5('0x32')](function(_0x3a52a3){_0x3dc8fe['rows']=_0x3a52a3;return _0x3dc8fe;})[_0x6eb5('0x32')](respondWithFilteredResult(_0x3143b9,_0x23ad19))[_0x6eb5('0x25')](handleError(_0x3143b9,null));};exports[_0x6eb5('0x4e')]=function(_0x3f86ff,_0x144922){var _0x4436b5={'raw':![],'where':{'id':_0x3f86ff[_0x6eb5('0x4f')]['id']}},_0x5952c5={};_0x5952c5['model']=_['keys'](db[_0x6eb5('0x39')][_0x6eb5('0x50')]);_0x5952c5[_0x6eb5('0x40')]=_[_0x6eb5('0x51')](_0x3f86ff['query']);_0x5952c5[_0x6eb5('0x3c')]=_[_0x6eb5('0x3d')](_0x5952c5[_0x6eb5('0x3e')],_0x5952c5[_0x6eb5('0x40')]);_0x4436b5['attributes']=_['intersection'](_0x5952c5['model'],qs[_0x6eb5('0x3f')](_0x3f86ff[_0x6eb5('0x40')][_0x6eb5('0x3f')]));_0x4436b5[_0x6eb5('0x42')]=_0x4436b5[_0x6eb5('0x42')][_0x6eb5('0x41')]?_0x4436b5[_0x6eb5('0x42')]:_0x5952c5[_0x6eb5('0x3e')];if(_0x3f86ff[_0x6eb5('0x40')][_0x6eb5('0x4c')]){_0x4436b5['include']=[{'all':!![]}];}_0x4436b5=_[_0x6eb5('0x4a')]({},_0x4436b5,_0x3f86ff[_0x6eb5('0x52')]);return db[_0x6eb5('0x39')][_0x6eb5('0x53')](_0x4436b5)[_0x6eb5('0x32')](handleEntityNotFound(_0x144922,null))[_0x6eb5('0x32')](respondWithResult(_0x144922,null))[_0x6eb5('0x25')](handleError(_0x144922,null));};exports[_0x6eb5('0x54')]=function(_0x51639f,_0x1f9df0){return db[_0x6eb5('0x39')][_0x6eb5('0x54')](_0x51639f[_0x6eb5('0x55')],{})['then'](respondWithResult(_0x1f9df0,0xc9))[_0x6eb5('0x25')](handleError(_0x1f9df0,null));};exports[_0x6eb5('0x56')]=function(_0x1ed248,_0x3aa48f){if(_0x1ed248[_0x6eb5('0x55')]['id']){delete _0x1ed248[_0x6eb5('0x55')]['id'];}return db['Dynamics365Account'][_0x6eb5('0x53')]({'where':{'id':_0x1ed248[_0x6eb5('0x4f')]['id']}})[_0x6eb5('0x32')](handleEntityNotFound(_0x3aa48f,null))[_0x6eb5('0x32')](saveUpdates(_0x1ed248['body'],null))[_0x6eb5('0x32')](respondWithResult(_0x3aa48f,null))['catch'](handleError(_0x3aa48f,null));};exports[_0x6eb5('0x33')]=function(_0x3e53e1,_0x3b3568){return db[_0x6eb5('0x39')][_0x6eb5('0x53')]({'where':{'id':_0x3e53e1[_0x6eb5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3b3568,null))[_0x6eb5('0x32')](removeEntity(_0x3b3568,null))[_0x6eb5('0x25')](handleError(_0x3b3568,null));};exports[_0x6eb5('0x57')]=function(_0x37c92a,_0x422dfa,_0xea2129){var _0x48752f={};var _0x5c09ad={};var _0x4c3bdb;var _0x2387b4;return db[_0x6eb5('0x39')][_0x6eb5('0x58')]({'where':{'id':_0x37c92a[_0x6eb5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x422dfa,null))[_0x6eb5('0x32')](function(_0xecf07d){if(_0xecf07d){_0x4c3bdb=_0xecf07d;_0x5c09ad[_0x6eb5('0x3e')]=_[_0x6eb5('0x51')](db[_0x6eb5('0x59')][_0x6eb5('0x50')]);_0x5c09ad[_0x6eb5('0x40')]=_[_0x6eb5('0x51')](_0x37c92a[_0x6eb5('0x40')]);_0x5c09ad[_0x6eb5('0x3c')]=_['intersection'](_0x5c09ad[_0x6eb5('0x3e')],_0x5c09ad[_0x6eb5('0x40')]);_0x48752f['attributes']=_['intersection'](_0x5c09ad[_0x6eb5('0x3e')],qs[_0x6eb5('0x3f')](_0x37c92a['query'][_0x6eb5('0x3f')]));_0x48752f[_0x6eb5('0x42')]=_0x48752f[_0x6eb5('0x42')][_0x6eb5('0x41')]?_0x48752f['attributes']:_0x5c09ad[_0x6eb5('0x3e')];_0x48752f[_0x6eb5('0x45')]=qs[_0x6eb5('0x46')](_0x37c92a[_0x6eb5('0x40')]['sort']);_0x48752f[_0x6eb5('0x49')]=qs[_0x6eb5('0x3c')](_[_0x6eb5('0x47')](_0x37c92a['query'],_0x5c09ad[_0x6eb5('0x3c')]));if(_0x37c92a[_0x6eb5('0x40')]['filter']){_0x48752f[_0x6eb5('0x49')]=_[_0x6eb5('0x4a')](_0x48752f[_0x6eb5('0x49')],{'$or':_[_0x6eb5('0x38')](_0x48752f[_0x6eb5('0x42')],function(_0x3e08bd){var _0x4a29f2={};_0x4a29f2[_0x3e08bd]={'$like':'%'+_0x37c92a[_0x6eb5('0x40')][_0x6eb5('0x48')]+'%'};return _0x4a29f2;})});}_0x48752f=_[_0x6eb5('0x4a')]({},_0x48752f,_0x37c92a[_0x6eb5('0x52')]);return _0x4c3bdb[_0x6eb5('0x57')](_0x48752f);}})[_0x6eb5('0x32')](function(_0x38eac9){if(_0x38eac9){_0x2387b4=_0x38eac9['length'];if(!_0x37c92a['query'][_0x6eb5('0x43')](_0x6eb5('0x44'))){_0x48752f[_0x6eb5('0x2c')]=qs[_0x6eb5('0x2c')](_0x37c92a[_0x6eb5('0x40')][_0x6eb5('0x2c')]);_0x48752f[_0x6eb5('0x29')]=qs['offset'](_0x37c92a[_0x6eb5('0x40')][_0x6eb5('0x29')]);}return _0x4c3bdb[_0x6eb5('0x57')](_0x48752f);}})[_0x6eb5('0x32')](function(_0x5a1e26){if(_0x5a1e26){return _0x5a1e26?{'count':_0x2387b4,'rows':_0x5a1e26}:null;}})[_0x6eb5('0x32')](respondWithResult(_0x422dfa,null))[_0x6eb5('0x25')](handleError(_0x422dfa,null));};exports[_0x6eb5('0x5a')]=function(_0x2630dd,_0x451436,_0x15083c){if(_0x2630dd[_0x6eb5('0x55')]['id']){delete _0x2630dd[_0x6eb5('0x55')]['id'];}return db[_0x6eb5('0x39')][_0x6eb5('0x58')]({'where':{'id':_0x2630dd['params']['id']}})[_0x6eb5('0x32')](handleEntityNotFound(_0x451436,null))['then'](function(_0x5cae6c){if(_0x5cae6c){_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5b')]=_0x5cae6c['id'];_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5c')]=integrations[_0x6eb5('0x5d')](_0x2630dd['body'][_0x6eb5('0x5e')],_0x2630dd[_0x6eb5('0x55')]['type']);_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5f')]=integrations[_0x6eb5('0x60')](_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5e')],_0x2630dd[_0x6eb5('0x55')]['type']);return db[_0x6eb5('0x59')][_0x6eb5('0x54')](_0x2630dd[_0x6eb5('0x55')],{'include':[{'model':db[_0x6eb5('0x61')],'as':_0x6eb5('0x5c')},{'model':db[_0x6eb5('0x61')],'as':_0x6eb5('0x5f')}]});}return null;})[_0x6eb5('0x32')](respondWithResult(_0x451436,null))['catch'](handleError(_0x451436,null));};exports[_0x6eb5('0x62')]=function(_0x1302d6,_0x22889a,_0xb588ef){var _0x2d007f=_0x1302d6['query'][_0x6eb5('0x63')];var _0x181a65=_0x2d007f===_0x6eb5('0x64')?_0x6eb5('0x65'):_0x6eb5('0x66');var _0x130093='';var _0x4d60d8='';var _0x18d2c2='';var _0x24c267='';var _0x5d268f='';var _0xec4683='';var _0x229666='';var _0x1b2da3='';var _0x54e1f9=['title',_0x6eb5('0x67'),_0x6eb5('0x68'),_0x6eb5('0x69'),'caseorigincode',_0x6eb5('0x6a'),_0x6eb5('0x6b'),'regardingobjectid',_0x6eb5('0x6c'),'phonecall_activity_parties'];var _0x459997=['accountidname',_0x6eb5('0x6d'),_0x6eb5('0x6e'),_0x6eb5('0x6f'),_0x6eb5('0x70'),'contactidyominame',_0x6eb5('0x71'),_0x6eb5('0x72'),'createdbyexternalpartyname',_0x6eb5('0x73'),_0x6eb5('0x74'),_0x6eb5('0x75'),'createdon',_0x6eb5('0x76'),'createdonbehalfbyyominame',_0x6eb5('0x77'),'customeridtype',_0x6eb5('0x78'),_0x6eb5('0x79'),_0x6eb5('0x7a'),_0x6eb5('0x7b'),_0x6eb5('0x7c'),_0x6eb5('0x7d'),_0x6eb5('0x7e'),_0x6eb5('0x7f'),_0x6eb5('0x80'),_0x6eb5('0x81'),_0x6eb5('0x82'),_0x6eb5('0x83'),_0x6eb5('0x84'),_0x6eb5('0x85'),_0x6eb5('0x86'),_0x6eb5('0x87'),_0x6eb5('0x88'),_0x6eb5('0x89'),_0x6eb5('0x8a'),_0x6eb5('0x8b'),_0x6eb5('0x8c'),'msdyn_incidenttypename','msdyn_iotalertname',_0x6eb5('0x8d'),_0x6eb5('0x8e'),_0x6eb5('0x8f'),_0x6eb5('0x90'),_0x6eb5('0x91'),_0x6eb5('0x92'),_0x6eb5('0x93'),'primarycontactidname','primarycontactidyominame','prioritycodename','productidname',_0x6eb5('0x94'),_0x6eb5('0x95'),_0x6eb5('0x96'),_0x6eb5('0x97'),_0x6eb5('0x98'),'responsiblecontactidyominame',_0x6eb5('0x99'),'slainvokedidname','slaname',_0x6eb5('0x9a'),_0x6eb5('0x9b'),_0x6eb5('0x9c'),_0x6eb5('0x9d'),_0x6eb5('0x9e'),_0x6eb5('0x9f'),_0x6eb5('0xa0'),_0x6eb5('0xa1'),_0x6eb5('0xa2'),_0x6eb5('0xa3')];var _0x573922=_0x54e1f9['concat'](_0x459997);return db[_0x6eb5('0x39')][_0x6eb5('0x58')]({'where':{'id':_0x1302d6[_0x6eb5('0x4f')]['id']},'attributes':['id','username','password',_0x6eb5('0xa4'),'tenantId','clientId','clientSecret']})[_0x6eb5('0x32')](handleEntityNotFound(_0x22889a,null))['then'](function(_0x2c752f){if(_0x2c752f){_0x1b2da3=_0x2c752f[_0x6eb5('0xa4')];var _0x2a44d7=_0x1b2da3[_0x6eb5('0xa5')](-0x1);if(_0x2a44d7==='/'){_0x1b2da3=_0x1b2da3[_0x6eb5('0xa6')](0x0,_0x1b2da3['lastIndexOf'](_0x2a44d7));}_0x229666=util[_0x6eb5('0xa7')](_0x6eb5('0xa8'),_0x1b2da3);var _0x12fc5a={'method':'POST','uri':_0x6eb5('0xa9')+_0x2c752f[_0x6eb5('0xaa')]+_0x6eb5('0xab'),'form':{'client_id':_0x2c752f[_0x6eb5('0xac')],'resource':_0x1b2da3,'username':_0x2c752f[_0x6eb5('0xad')],'password':_0x2c752f[_0x6eb5('0xae')],'grant_type':_0x6eb5('0xae'),'client_secret':_0x2c752f[_0x6eb5('0xaf')]},'json':!![]};return rp(_0x12fc5a);}})[_0x6eb5('0x32')](function(_0x3efd87){_0xec4683=_0x3efd87['access_token'];var _0x3fd53a={'method':_0x6eb5('0xb0'),'uri':encodeURI(_0x229666+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x181a65+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xec4683,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3fd53a);})[_0x6eb5('0x32')](function(_0x1fb507){var _0x1e2a1f=_0x1fb507[_0x6eb5('0xb1')][0x0];var _0x1b6ad4=_0x1e2a1f[_0x6eb5('0xb2')];var _0x40281c={'method':_0x6eb5('0xb0'),'uri':_0x229666+_0x6eb5('0xb3')+_0x1b6ad4+_0x6eb5('0xb4'),'headers':{'Authorization':_0x6eb5('0xb5')+_0xec4683,'If-None-Match':null,'OData-Version':_0x6eb5('0xb6')},'json':!![]};return rp(_0x40281c);})['then'](function(_0x9fa6d1){_0x130093=_0x9fa6d1;_0x4d60d8=_0x130093[_0x6eb5('0xb7')];_0x4d60d8=_[_0x6eb5('0xb8')](_0x4d60d8,function(_0x6aec07){return!_0x573922[_0x6eb5('0xb9')](_0x6aec07[_0x6eb5('0xba')]);});var _0x3dbc35=[];var _0x14bf4e=[];_0x4d60d8[_0x6eb5('0xbb')](function(_0x309e52){if(_0x309e52[_0x6eb5('0xbc')]){var _0x47d0c4=_0x309e52[_0x6eb5('0xbc')][_0x6eb5('0xa6')](_0x309e52[_0x6eb5('0xbc')]['lastIndexOf']('.')+0x1);if(_0x47d0c4==='PicklistAttributeMetadata'){_0x3dbc35['push'](getSelectList(_0x229666,_0x2d007f,_0x14bf4e,_0x130093[_0x6eb5('0xb2')],_0x309e52[_0x6eb5('0xb2')],_0xec4683));}}});return Promise[_0x6eb5('0xbd')](_0x3dbc35);})['then'](function(_0x1c110a){_0x18d2c2=_0x1c110a[0x0];var _0x19051b=[];var _0x3e790f=[];_0x4d60d8['forEach'](function(_0x1734f3){if(!_[_0x6eb5('0xbe')](_0x1734f3[_0x6eb5('0xbc')])){var _0x2c76b9=_0x1734f3[_0x6eb5('0xbc')][_0x6eb5('0xa6')](_0x1734f3[_0x6eb5('0xbc')][_0x6eb5('0xbf')]('.')+0x1);if(_0x2c76b9===_0x6eb5('0xc0')){_0x19051b['push'](getBooleanList(_0x229666,_0x2d007f,_0x3e790f,_0x130093['MetadataId'],_0x1734f3[_0x6eb5('0xb2')],_0xec4683));}}});return Promise[_0x6eb5('0xbd')](_0x19051b);})[_0x6eb5('0x32')](function(_0x20a790){_0x24c267=_0x20a790[0x0];var _0x801fee=[];var _0x22efb2=[];_0x4d60d8[_0x6eb5('0xbb')](function(_0x2a5024){if(_0x2a5024[_0x6eb5('0xbc')]){var _0x24ca6a=_0x2a5024['@odata.type'][_0x6eb5('0xa6')](_0x2a5024[_0x6eb5('0xbc')]['lastIndexOf']('.')+0x1);if(_0x24ca6a===_0x6eb5('0xc1')||_0x24ca6a===_0x6eb5('0xc2')||_0x24ca6a===_0x6eb5('0xc3')||_0x24ca6a==='IntegerAttributeMetadata'||_0x24ca6a===_0x6eb5('0xc4')||_0x24ca6a===_0x6eb5('0xc5')||_0x24ca6a===_0x6eb5('0xc6')||_0x24ca6a===_0x6eb5('0xc7')||_0x24ca6a==='StateAttributeMetadata'||_0x24ca6a===_0x6eb5('0xc8')){_0x801fee[_0x6eb5('0xc9')](getInputList(_0x229666,_0x2d007f,_0x24ca6a,_0x22efb2,_0x130093['MetadataId'],_0x2a5024['MetadataId'],_0xec4683));}}});return Promise['all'](_0x801fee);})['then'](function(_0x1b57d0){_0x5d268f=_0x1b57d0[0x0];var _0x12dc0b=_0x18d2c2[_0x6eb5('0xca')](_0x24c267)['concat'](_0x5d268f);var _0x1d10d4={'count':_0x12dc0b['length'],'rows':_0x12dc0b};return _0x1d10d4;})[_0x6eb5('0x32')](respondWithResult(_0x22889a,null))[_0x6eb5('0x25')](function(_0x474098){var _0x30a50d=_0x1302d6[_0x6eb5('0x40')][_0x6eb5('0xcb')]?0x1f4:_0x474098[_0x6eb5('0xcc')]||0x1f4;logger['error'](_0x474098['stack']);delete _0x474098[_0x6eb5('0x35')];if(_0x30a50d===0x191){_0x30a50d=0x190;}_0x22889a[_0x6eb5('0x2d')](_0x30a50d)['send'](_0x1302d6[_0x6eb5('0x40')][_0x6eb5('0xcb')]?{'message':_0x6eb5('0xcd'),'statusCode':_0x474098['statusCode']}:_0x474098);});};function getSelectList(_0x22380e,_0x3a48be,_0x203e84,_0x44637a,_0x4ea35a,_0x41116d){var _0x8cba8e={'method':_0x6eb5('0xb0'),'uri':_0x22380e+_0x6eb5('0xb3')+_0x44637a+')/Attributes('+_0x4ea35a+_0x6eb5('0xce')+_0x6eb5('0xcf'),'headers':{'Authorization':_0x6eb5('0xb5')+_0x41116d,'If-None-Match':null,'OData-Version':_0x6eb5('0xb6')},'json':!![]};return rp(_0x8cba8e)[_0x6eb5('0x32')](function(_0x39f711){var _0x45f6d2=[];var _0x4d5449=_0x39f711[_0x6eb5('0xd0')][_0x6eb5('0xd1')];_0x4d5449['forEach'](function(_0x58a0ed){_0x45f6d2['push']({'name':_0x58a0ed[_0x6eb5('0xd2')][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'value':String(_0x58a0ed['Value'])});});var _0x11eda3={'id':_0x3a48be+'_'+_0x39f711[_0x6eb5('0xba')],'name':_0x39f711[_0x6eb5('0xd4')]['UserLocalizedLabel'][_0x6eb5('0xd2')],'custom':![],'options':_0x45f6d2};_0x203e84['push'](_0x11eda3);return _0x203e84;});}function getBooleanList(_0x2ede21,_0x5e1a8a,_0x608457,_0x3107f7,_0x513204,_0x35234b){var _0x45f203={'method':'GET','uri':_0x2ede21+_0x6eb5('0xb3')+_0x3107f7+_0x6eb5('0xd5')+_0x513204+_0x6eb5('0xd6'),'headers':{'Authorization':_0x6eb5('0xb5')+_0x35234b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x45f203)[_0x6eb5('0x32')](function(_0x526744){var _0x4325cd=[];_0x4325cd[_0x6eb5('0xc9')]({'name':_0x526744[_0x6eb5('0xd0')][_0x6eb5('0xd7')]['Label'][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'value':_0x6eb5('0xd8')},{'name':_0x526744[_0x6eb5('0xd0')]['FalseOption'][_0x6eb5('0xd2')][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'value':_0x6eb5('0xd9')});var _0x225630={'id':_0x5e1a8a+'_'+_0x526744['LogicalName'],'name':_0x526744[_0x6eb5('0xd4')][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'custom':![],'options':_0x4325cd};_0x608457[_0x6eb5('0xc9')](_0x225630);return _0x608457;});}function getInputList(_0x3a7a3d,_0x18cdb7,_0x25874f,_0x5d999a,_0x5a06fd,_0x1e9641,_0x544a59){var _0xbce53a={'method':_0x6eb5('0xb0'),'uri':_0x3a7a3d+_0x6eb5('0xb3')+_0x5a06fd+')/Attributes('+_0x1e9641+')/Microsoft.Dynamics.CRM.'+_0x25874f+_0x6eb5('0xda'),'headers':{'Authorization':_0x6eb5('0xb5')+_0x544a59,'If-None-Match':null,'OData-Version':_0x6eb5('0xb6')},'json':!![]};return rp(_0xbce53a)['then'](function(_0x2caf89){var _0x1d2bba={'id':_0x18cdb7+'_'+_0x2caf89[_0x6eb5('0xba')],'name':_0x2caf89['DisplayName'][_0x6eb5('0xd3')]?_0x2caf89[_0x6eb5('0xd4')][_0x6eb5('0xd3')][_0x6eb5('0xd2')]:_0x2caf89[_0x6eb5('0xba')],'custom':![],'options':[]};_0x5d999a[_0x6eb5('0xc9')](_0x1d2bba);return _0x5d999a;});} \ No newline at end of file +var _0x25b3=['Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','clientId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','@odata.type','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','findOne','Dynamics365Configuration','getConfigurations','nolimit','offset','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x2bece8,_0x27c181){var _0xc01f33=function(_0x343e2b){while(--_0x343e2b){_0x2bece8['push'](_0x2bece8['shift']());}};_0xc01f33(++_0x27c181);}(_0x25b3,0x7b));var _0x325b=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0x25b3[_0xee3051];return _0x139e81;};'use strict';var emlformat=require(_0x325b('0x0'));var rimraf=require(_0x325b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x325b('0x2'));var rp=require(_0x325b('0x3'));var moment=require(_0x325b('0x4'));var BPromise=require(_0x325b('0x5'));var Mustache=require('mustache');var util=require(_0x325b('0x6'));var path=require(_0x325b('0x7'));var sox=require('sox');var csv=require(_0x325b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x325b('0x9'));var _=require(_0x325b('0xa'));var squel=require('squel');var crypto=require(_0x325b('0xb'));var jsforce=require(_0x325b('0xc'));var deskjs=require(_0x325b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x325b('0xe'));var Redis=require(_0x325b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x325b('0x10'));var as=require(_0x325b('0x11'));var hardwareService=require(_0x325b('0x12'));var logger=require('../../config/logger')(_0x325b('0x13'));var utils=require(_0x325b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x325b('0x15'));var db=require(_0x325b('0x16'))['db'];var integrations=require(_0x325b('0x17'));var jayson=require(_0x325b('0x18'));var client=jayson['client'][_0x325b('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x9c6cc0,_0x45f10f,_0x1e48c9,_0x4c3a08){return new BPromise(function(_0x3f28c0,_0x2c425a){var _0x3154fb=_0x4c3a08||client;return _0x3154fb[_0x325b('0x1a')](_0x9c6cc0,_0x1e48c9)['then'](function(_0x52bf49){logger[_0x325b('0x1b')](_0x325b('0x1c'),_0x45f10f,_0x325b('0x1d'));logger[_0x325b('0x1e')](_0x325b('0x1f'),_0x45f10f,_0x325b('0x1d'),JSON[_0x325b('0x20')](_0x52bf49));if(_0x52bf49[_0x325b('0x21')]){if(_0x52bf49[_0x325b('0x21')][_0x325b('0x22')]===0x1f4){logger[_0x325b('0x21')](_0x325b('0x1c'),_0x45f10f,_0x52bf49[_0x325b('0x21')]['message']);return _0x2c425a(_0x52bf49['error'][_0x325b('0x23')]);}logger[_0x325b('0x21')](_0x325b('0x1c'),_0x45f10f,_0x52bf49[_0x325b('0x21')][_0x325b('0x23')]);return _0x3f28c0(_0x52bf49['error'][_0x325b('0x23')]);}else{logger[_0x325b('0x1b')]('Dynamics365Account,\x20%s,\x20%s',_0x45f10f,_0x325b('0x1d'));_0x3f28c0(_0x52bf49[_0x325b('0x24')]['message']);}})[_0x325b('0x25')](function(_0x5d1223){logger[_0x325b('0x21')](_0x325b('0x1c'),_0x45f10f,_0x5d1223);_0x2c425a(_0x5d1223);});});}function respondWithStatusCode(_0x2ebf94,_0x19f2d0){_0x19f2d0=_0x19f2d0||0xcc;return function(_0xba08ad){if(_0xba08ad){return _0x2ebf94['sendStatus'](_0x19f2d0);}return _0x2ebf94['status'](_0x19f2d0)['end']();};}function respondWithResult(_0x4621e7,_0x4af2ef){_0x4af2ef=_0x4af2ef||0xc8;return function(_0x39331c){if(_0x39331c){return _0x4621e7[_0x325b('0x26')](_0x4af2ef)[_0x325b('0x27')](_0x39331c);}};}function respondWithFilteredResult(_0x29a5c,_0x5f05c8){return function(_0x15aff4){if(_0x15aff4){var _0x8afe27=typeof _0x5f05c8['offset']===_0x325b('0x28')&&typeof _0x5f05c8[_0x325b('0x29')]==='undefined';var _0x5524b4=_0x15aff4[_0x325b('0x2a')];var _0x686a1=_0x8afe27?0x0:_0x5f05c8['offset'];var _0x56b471=_0x8afe27?_0x15aff4[_0x325b('0x2a')]:_0x5f05c8['offset']+_0x5f05c8[_0x325b('0x29')];var _0x2bca68;if(_0x56b471>=_0x5524b4){_0x56b471=_0x5524b4;_0x2bca68=0xc8;}else{_0x2bca68=0xce;}_0x29a5c[_0x325b('0x26')](_0x2bca68);return _0x29a5c[_0x325b('0x2b')](_0x325b('0x2c'),_0x686a1+'-'+_0x56b471+'/'+_0x5524b4)[_0x325b('0x27')](_0x15aff4);}return null;};}function patchUpdates(_0x38819e){return function(_0x9ecb25){try{jsonpatch['apply'](_0x9ecb25,_0x38819e,!![]);}catch(_0x1f3700){return BPromise[_0x325b('0x2d')](_0x1f3700);}return _0x9ecb25[_0x325b('0x2e')]();};}function saveUpdates(_0x2f6151,_0x2e9822){return function(_0x5c8498){if(_0x5c8498){return _0x5c8498[_0x325b('0x2f')](_0x2f6151)[_0x325b('0x30')](function(_0x17c398){return _0x17c398;});}return null;};}function removeEntity(_0x18ce62,_0x437694){return function(_0xcc9624){if(_0xcc9624){return _0xcc9624[_0x325b('0x31')]()['then'](function(){_0x18ce62[_0x325b('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b7623,_0x1d8cce){return function(_0x10d059){if(!_0x10d059){_0x1b7623[_0x325b('0x32')](0x194);}return _0x10d059;};}function handleError(_0x1799cd,_0x23e616){_0x23e616=_0x23e616||0x1f4;return function(_0x1bf2ea){logger[_0x325b('0x21')](_0x1bf2ea[_0x325b('0x33')]);if(_0x1bf2ea[_0x325b('0x34')]){delete _0x1bf2ea['name'];}_0x1799cd[_0x325b('0x26')](_0x23e616)[_0x325b('0x35')](_0x1bf2ea);};}exports['index']=function(_0x374919,_0x4654d2){var _0x72785b={},_0x3d68a3={},_0x295d37={'count':0x0,'rows':[]};var _0x5d06ec=_['map'](db[_0x325b('0x36')][_0x325b('0x37')],function(_0x4b7e89){return{'name':_0x4b7e89[_0x325b('0x38')],'type':_0x4b7e89[_0x325b('0x39')][_0x325b('0x3a')]};});_0x3d68a3[_0x325b('0x3b')]=_[_0x325b('0x3c')](_0x5d06ec,_0x325b('0x34'));_0x3d68a3[_0x325b('0x3d')]=_[_0x325b('0x3e')](_0x374919['query']);_0x3d68a3[_0x325b('0x3f')]=_['intersection'](_0x3d68a3[_0x325b('0x3b')],_0x3d68a3['query']);_0x72785b[_0x325b('0x40')]=_[_0x325b('0x41')](_0x3d68a3[_0x325b('0x3b')],qs['fields'](_0x374919[_0x325b('0x3d')][_0x325b('0x42')]));_0x72785b[_0x325b('0x40')]=_0x72785b[_0x325b('0x40')][_0x325b('0x43')]?_0x72785b['attributes']:_0x3d68a3['model'];if(!_0x374919[_0x325b('0x3d')][_0x325b('0x44')]('nolimit')){_0x72785b[_0x325b('0x29')]=qs[_0x325b('0x29')](_0x374919[_0x325b('0x3d')]['limit']);_0x72785b['offset']=qs['offset'](_0x374919[_0x325b('0x3d')]['offset']);}_0x72785b[_0x325b('0x45')]=qs[_0x325b('0x46')](_0x374919[_0x325b('0x3d')][_0x325b('0x46')]);_0x72785b['where']=qs[_0x325b('0x3f')](_[_0x325b('0x47')](_0x374919[_0x325b('0x3d')],_0x3d68a3[_0x325b('0x3f')]),_0x5d06ec);if(_0x374919[_0x325b('0x3d')][_0x325b('0x48')]){_0x72785b['where']=_[_0x325b('0x49')](_0x72785b[_0x325b('0x4a')],{'$or':_[_0x325b('0x3c')](_0x5d06ec,function(_0x4bbb3d){if(_0x4bbb3d[_0x325b('0x39')]!==_0x325b('0x4b')){var _0x5dcc21={};_0x5dcc21[_0x4bbb3d[_0x325b('0x34')]]={'$like':'%'+_0x374919[_0x325b('0x3d')]['filter']+'%'};return _0x5dcc21;}})});}_0x72785b=_[_0x325b('0x49')]({},_0x72785b,_0x374919[_0x325b('0x4c')]);var _0x54aa62={'where':_0x72785b[_0x325b('0x4a')]};return db['Dynamics365Account']['count'](_0x54aa62)[_0x325b('0x30')](function(_0x681758){_0x295d37[_0x325b('0x2a')]=_0x681758;if(_0x374919[_0x325b('0x3d')][_0x325b('0x4d')]){_0x72785b[_0x325b('0x4e')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x325b('0x4f')](_0x72785b);})[_0x325b('0x30')](function(_0x282a4a){_0x295d37['rows']=_0x282a4a;return _0x295d37;})[_0x325b('0x30')](respondWithFilteredResult(_0x4654d2,_0x72785b))['catch'](handleError(_0x4654d2,null));};exports[_0x325b('0x50')]=function(_0xc585b1,_0x2689a8){var _0x420056={'raw':![],'where':{'id':_0xc585b1[_0x325b('0x51')]['id']}},_0x583ef1={};_0x583ef1[_0x325b('0x3b')]=_[_0x325b('0x3e')](db['Dynamics365Account'][_0x325b('0x37')]);_0x583ef1[_0x325b('0x3d')]=_[_0x325b('0x3e')](_0xc585b1[_0x325b('0x3d')]);_0x583ef1[_0x325b('0x3f')]=_[_0x325b('0x41')](_0x583ef1['model'],_0x583ef1[_0x325b('0x3d')]);_0x420056[_0x325b('0x40')]=_[_0x325b('0x41')](_0x583ef1['model'],qs['fields'](_0xc585b1[_0x325b('0x3d')]['fields']));_0x420056['attributes']=_0x420056[_0x325b('0x40')]['length']?_0x420056['attributes']:_0x583ef1[_0x325b('0x3b')];if(_0xc585b1[_0x325b('0x3d')][_0x325b('0x4d')]){_0x420056[_0x325b('0x4e')]=[{'all':!![]}];}_0x420056=_[_0x325b('0x49')]({},_0x420056,_0xc585b1[_0x325b('0x4c')]);return db[_0x325b('0x36')][_0x325b('0x52')](_0x420056)[_0x325b('0x30')](handleEntityNotFound(_0x2689a8,null))[_0x325b('0x30')](respondWithResult(_0x2689a8,null))[_0x325b('0x25')](handleError(_0x2689a8,null));};exports[_0x325b('0x53')]=function(_0x5479ac,_0x2e06b6){return db[_0x325b('0x36')][_0x325b('0x53')](_0x5479ac[_0x325b('0x54')],{})[_0x325b('0x30')](respondWithResult(_0x2e06b6,0xc9))[_0x325b('0x25')](handleError(_0x2e06b6,null));};exports[_0x325b('0x2f')]=function(_0xa34821,_0x4549d0){if(_0xa34821[_0x325b('0x54')]['id']){delete _0xa34821[_0x325b('0x54')]['id'];}return db[_0x325b('0x36')]['find']({'where':{'id':_0xa34821[_0x325b('0x51')]['id']}})[_0x325b('0x30')](handleEntityNotFound(_0x4549d0,null))[_0x325b('0x30')](saveUpdates(_0xa34821[_0x325b('0x54')],null))[_0x325b('0x30')](respondWithResult(_0x4549d0,null))['catch'](handleError(_0x4549d0,null));};exports['destroy']=function(_0x2be349,_0x23c6d2){return db['Dynamics365Account']['find']({'where':{'id':_0x2be349['params']['id']}})[_0x325b('0x30')](handleEntityNotFound(_0x23c6d2,null))[_0x325b('0x30')](removeEntity(_0x23c6d2,null))[_0x325b('0x25')](handleError(_0x23c6d2,null));};exports['getConfigurations']=function(_0x408099,_0x23a9de,_0x136617){var _0x3b9a92={};var _0x169514={};var _0xe4c560;var _0x23db7b;return db['Dynamics365Account'][_0x325b('0x55')]({'where':{'id':_0x408099[_0x325b('0x51')]['id']}})[_0x325b('0x30')](handleEntityNotFound(_0x23a9de,null))[_0x325b('0x30')](function(_0x57983d){if(_0x57983d){_0xe4c560=_0x57983d;_0x169514['model']=_['keys'](db[_0x325b('0x56')][_0x325b('0x37')]);_0x169514['query']=_['keys'](_0x408099[_0x325b('0x3d')]);_0x169514[_0x325b('0x3f')]=_[_0x325b('0x41')](_0x169514[_0x325b('0x3b')],_0x169514[_0x325b('0x3d')]);_0x3b9a92[_0x325b('0x40')]=_[_0x325b('0x41')](_0x169514['model'],qs[_0x325b('0x42')](_0x408099[_0x325b('0x3d')][_0x325b('0x42')]));_0x3b9a92[_0x325b('0x40')]=_0x3b9a92[_0x325b('0x40')][_0x325b('0x43')]?_0x3b9a92[_0x325b('0x40')]:_0x169514[_0x325b('0x3b')];_0x3b9a92[_0x325b('0x45')]=qs[_0x325b('0x46')](_0x408099[_0x325b('0x3d')][_0x325b('0x46')]);_0x3b9a92['where']=qs[_0x325b('0x3f')](_[_0x325b('0x47')](_0x408099['query'],_0x169514[_0x325b('0x3f')]));if(_0x408099[_0x325b('0x3d')][_0x325b('0x48')]){_0x3b9a92[_0x325b('0x4a')]=_[_0x325b('0x49')](_0x3b9a92[_0x325b('0x4a')],{'$or':_[_0x325b('0x3c')](_0x3b9a92['attributes'],function(_0x369794){var _0x2e6d84={};_0x2e6d84[_0x369794]={'$like':'%'+_0x408099[_0x325b('0x3d')]['filter']+'%'};return _0x2e6d84;})});}_0x3b9a92=_[_0x325b('0x49')]({},_0x3b9a92,_0x408099[_0x325b('0x4c')]);return _0xe4c560[_0x325b('0x57')](_0x3b9a92);}})[_0x325b('0x30')](function(_0x156486){if(_0x156486){_0x23db7b=_0x156486[_0x325b('0x43')];if(!_0x408099[_0x325b('0x3d')][_0x325b('0x44')](_0x325b('0x58'))){_0x3b9a92[_0x325b('0x29')]=qs['limit'](_0x408099['query'][_0x325b('0x29')]);_0x3b9a92[_0x325b('0x59')]=qs[_0x325b('0x59')](_0x408099[_0x325b('0x3d')]['offset']);}return _0xe4c560[_0x325b('0x57')](_0x3b9a92);}})[_0x325b('0x30')](function(_0x3a70d2){if(_0x3a70d2){return _0x3a70d2?{'count':_0x23db7b,'rows':_0x3a70d2}:null;}})[_0x325b('0x30')](respondWithResult(_0x23a9de,null))[_0x325b('0x25')](handleError(_0x23a9de,null));};exports[_0x325b('0x5a')]=function(_0x3beaaa,_0x26d12e,_0x510f1c){if(_0x3beaaa['body']['id']){delete _0x3beaaa[_0x325b('0x54')]['id'];}return db[_0x325b('0x36')]['findOne']({'where':{'id':_0x3beaaa[_0x325b('0x51')]['id']}})['then'](handleEntityNotFound(_0x26d12e,null))['then'](function(_0x2deba4){if(_0x2deba4){_0x3beaaa['body'][_0x325b('0x5b')]=_0x2deba4['id'];_0x3beaaa[_0x325b('0x54')][_0x325b('0x5c')]=integrations[_0x325b('0x5d')](_0x3beaaa[_0x325b('0x54')][_0x325b('0x5e')],_0x3beaaa[_0x325b('0x54')][_0x325b('0x39')]);_0x3beaaa['body'][_0x325b('0x5f')]=integrations[_0x325b('0x60')](_0x3beaaa['body'][_0x325b('0x5e')],_0x3beaaa['body'][_0x325b('0x39')]);return db[_0x325b('0x56')][_0x325b('0x53')](_0x3beaaa[_0x325b('0x54')],{'include':[{'model':db[_0x325b('0x61')],'as':_0x325b('0x5c')},{'model':db[_0x325b('0x61')],'as':_0x325b('0x5f')}]});}return null;})['then'](respondWithResult(_0x26d12e,null))['catch'](handleError(_0x26d12e,null));};exports['getFields']=function(_0x2d4832,_0x1ac59e,_0x57ad18){var _0x5cd78c=_0x2d4832[_0x325b('0x3d')][_0x325b('0x62')];var _0x5a976f=_0x5cd78c===_0x325b('0x63')?_0x325b('0x64'):_0x325b('0x65');var _0x22c7e9='';var _0x52a291='';var _0x30bcc7='';var _0x4bfe75='';var _0x59b39a='';var _0x67059f='';var _0x2bea6f='';var _0x419c30='';var _0x274c62=[_0x325b('0x66'),_0x325b('0x67'),_0x325b('0x68'),_0x325b('0x69'),_0x325b('0x6a'),_0x325b('0x6b'),_0x325b('0x6c'),'regardingobjectid','directioncode','phonecall_activity_parties'];var _0xd2b41a=[_0x325b('0x6d'),_0x325b('0x6e'),_0x325b('0x6f'),'billedserviceunits',_0x325b('0x70'),_0x325b('0x71'),_0x325b('0x72'),_0x325b('0x73'),_0x325b('0x74'),_0x325b('0x75'),_0x325b('0x76'),_0x325b('0x77'),'createdon',_0x325b('0x78'),_0x325b('0x79'),_0x325b('0x7a'),_0x325b('0x7b'),_0x325b('0x7c'),'emailaddress',_0x325b('0x7d'),_0x325b('0x7e'),_0x325b('0x7f'),'escalatedon',_0x325b('0x80'),_0x325b('0x81'),'followupby','importsequencenumber','influencescore',_0x325b('0x82'),_0x325b('0x83'),'masteridname',_0x325b('0x84'),_0x325b('0x85'),_0x325b('0x86'),_0x325b('0x87'),'modifiedon',_0x325b('0x88'),_0x325b('0x89'),_0x325b('0x8a'),'msdyn_iotalertname',_0x325b('0x8b'),_0x325b('0x8c'),_0x325b('0x8d'),_0x325b('0x8e'),'owneridtype',_0x325b('0x8f'),_0x325b('0x90'),_0x325b('0x91'),_0x325b('0x92'),_0x325b('0x93'),_0x325b('0x94'),_0x325b('0x95'),_0x325b('0x96'),_0x325b('0x97'),'responseby',_0x325b('0x98'),_0x325b('0x99'),_0x325b('0x9a'),'slainvokedidname',_0x325b('0x9b'),_0x325b('0x9c'),_0x325b('0x9d'),_0x325b('0x9e'),'subjectidname',_0x325b('0x9f'),_0x325b('0xa0'),'transactioncurrencyidname',_0x325b('0xa1'),_0x325b('0xa2'),_0x325b('0xa3')];var _0x391746=_0x274c62[_0x325b('0xa4')](_0xd2b41a);return db['Dynamics365Account'][_0x325b('0x55')]({'where':{'id':_0x2d4832[_0x325b('0x51')]['id']},'attributes':['id','username',_0x325b('0xa5'),_0x325b('0xa6'),'tenantId',_0x325b('0xa7'),'clientSecret']})['then'](handleEntityNotFound(_0x1ac59e,null))[_0x325b('0x30')](function(_0xed7fe4){if(_0xed7fe4){_0x419c30=_0xed7fe4[_0x325b('0xa6')];var _0x3a6fc7=_0x419c30[_0x325b('0xa8')](-0x1);if(_0x3a6fc7==='/'){_0x419c30=_0x419c30[_0x325b('0xa9')](0x0,_0x419c30[_0x325b('0xaa')](_0x3a6fc7));}_0x2bea6f=util[_0x325b('0xab')](_0x325b('0xac'),_0x419c30);var _0x482d98={'method':'POST','uri':_0x325b('0xad')+_0xed7fe4[_0x325b('0xae')]+_0x325b('0xaf'),'form':{'client_id':_0xed7fe4[_0x325b('0xa7')],'resource':_0x419c30,'username':_0xed7fe4['username'],'password':_0xed7fe4[_0x325b('0xa5')],'grant_type':_0x325b('0xa5'),'client_secret':_0xed7fe4[_0x325b('0xb0')]},'json':!![]};return rp(_0x482d98);}})['then'](function(_0x206ac8){_0x67059f=_0x206ac8['access_token'];var _0x588d67={'method':'GET','uri':encodeURI(_0x2bea6f+_0x325b('0xb1')+_0x5a976f+'\x27'),'headers':{'Authorization':_0x325b('0xb2')+_0x67059f,'If-None-Match':null,'OData-Version':_0x325b('0xb3')},'json':!![]};return rp(_0x588d67);})[_0x325b('0x30')](function(_0x506ce4){var _0x163b61=_0x506ce4[_0x325b('0xb4')][0x0];var _0x385b36=_0x163b61[_0x325b('0xb5')];var _0x4f6fed={'method':_0x325b('0xb6'),'uri':_0x2bea6f+_0x325b('0xb7')+_0x385b36+_0x325b('0xb8'),'headers':{'Authorization':_0x325b('0xb2')+_0x67059f,'If-None-Match':null,'OData-Version':_0x325b('0xb3')},'json':!![]};return rp(_0x4f6fed);})[_0x325b('0x30')](function(_0x30f6f8){_0x22c7e9=_0x30f6f8;_0x52a291=_0x22c7e9[_0x325b('0xb9')];_0x52a291=_[_0x325b('0xba')](_0x52a291,function(_0x5986ba){return!_0x391746['includes'](_0x5986ba[_0x325b('0xbb')]);});var _0x4431d7=[];var _0x4d2a84=[];_0x52a291['forEach'](function(_0x20f73f){if(_0x20f73f[_0x325b('0xbc')]){var _0x58393a=_0x20f73f[_0x325b('0xbc')][_0x325b('0xa9')](_0x20f73f[_0x325b('0xbc')][_0x325b('0xaa')]('.')+0x1);if(_0x58393a==='PicklistAttributeMetadata'){_0x4431d7[_0x325b('0xbd')](getSelectList(_0x2bea6f,_0x5cd78c,_0x4d2a84,_0x22c7e9[_0x325b('0xb5')],_0x20f73f[_0x325b('0xb5')],_0x67059f));}}});return Promise[_0x325b('0xbe')](_0x4431d7);})['then'](function(_0x5ac35e){_0x30bcc7=_0x5ac35e[0x0];var _0x56ce09=[];var _0x32d5af=[];_0x52a291['forEach'](function(_0x212b8a){if(!_['isNil'](_0x212b8a[_0x325b('0xbc')])){var _0x577d40=_0x212b8a[_0x325b('0xbc')][_0x325b('0xa9')](_0x212b8a[_0x325b('0xbc')]['lastIndexOf']('.')+0x1);if(_0x577d40===_0x325b('0xbf')){_0x56ce09[_0x325b('0xbd')](getBooleanList(_0x2bea6f,_0x5cd78c,_0x32d5af,_0x22c7e9[_0x325b('0xb5')],_0x212b8a[_0x325b('0xb5')],_0x67059f));}}});return Promise[_0x325b('0xbe')](_0x56ce09);})[_0x325b('0x30')](function(_0x555a95){_0x4bfe75=_0x555a95[0x0];var _0x42b544=[];var _0x4c1cf6=[];_0x52a291['forEach'](function(_0x5e7df0){if(_0x5e7df0[_0x325b('0xbc')]){var _0x5cf6e1=_0x5e7df0[_0x325b('0xbc')][_0x325b('0xa9')](_0x5e7df0[_0x325b('0xbc')][_0x325b('0xaa')]('.')+0x1);if(_0x5cf6e1===_0x325b('0xc0')||_0x5cf6e1===_0x325b('0xc1')||_0x5cf6e1===_0x325b('0xc2')||_0x5cf6e1===_0x325b('0xc3')||_0x5cf6e1===_0x325b('0xc4')||_0x5cf6e1===_0x325b('0xc5')||_0x5cf6e1===_0x325b('0xc6')||_0x5cf6e1===_0x325b('0xc7')||_0x5cf6e1===_0x325b('0xc8')||_0x5cf6e1===_0x325b('0xc9')){_0x42b544[_0x325b('0xbd')](getInputList(_0x2bea6f,_0x5cd78c,_0x5cf6e1,_0x4c1cf6,_0x22c7e9['MetadataId'],_0x5e7df0[_0x325b('0xb5')],_0x67059f));}}});return Promise[_0x325b('0xbe')](_0x42b544);})[_0x325b('0x30')](function(_0x41ea92){_0x59b39a=_0x41ea92[0x0];var _0x25226b=_0x30bcc7['concat'](_0x4bfe75)[_0x325b('0xa4')](_0x59b39a);var _0x10b5f7={'count':_0x25226b['length'],'rows':_0x25226b};return _0x10b5f7;})[_0x325b('0x30')](respondWithResult(_0x1ac59e,null))[_0x325b('0x25')](function(_0x4609f3){var _0x3d708a=_0x2d4832[_0x325b('0x3d')][_0x325b('0xca')]?0x1f4:_0x4609f3[_0x325b('0xcb')]||0x1f4;logger[_0x325b('0x21')](_0x4609f3[_0x325b('0x33')]);delete _0x4609f3[_0x325b('0x34')];if(_0x3d708a===0x191){_0x3d708a=0x190;}_0x1ac59e[_0x325b('0x26')](_0x3d708a)['send'](_0x2d4832[_0x325b('0x3d')][_0x325b('0xca')]?{'message':_0x325b('0xcc'),'statusCode':_0x4609f3[_0x325b('0xcb')]}:_0x4609f3);});};function getSelectList(_0x21d2b2,_0x1ce0f5,_0x215adb,_0x1d166c,_0x45ee37,_0x3a4431){var _0x150d7c={'method':'GET','uri':_0x21d2b2+_0x325b('0xb7')+_0x1d166c+_0x325b('0xcd')+_0x45ee37+_0x325b('0xce')+_0x325b('0xcf'),'headers':{'Authorization':_0x325b('0xb2')+_0x3a4431,'If-None-Match':null,'OData-Version':_0x325b('0xb3')},'json':!![]};return rp(_0x150d7c)[_0x325b('0x30')](function(_0x2d15cb){var _0x25c1bf=[];var _0x483ec6=_0x2d15cb[_0x325b('0xd0')][_0x325b('0xd1')];_0x483ec6['forEach'](function(_0x420838){_0x25c1bf[_0x325b('0xbd')]({'name':_0x420838[_0x325b('0xd2')][_0x325b('0xd3')][_0x325b('0xd2')],'value':String(_0x420838[_0x325b('0xd4')])});});var _0x4c71d5={'id':_0x1ce0f5+'_'+_0x2d15cb[_0x325b('0xbb')],'name':_0x2d15cb[_0x325b('0xd5')][_0x325b('0xd3')][_0x325b('0xd2')],'custom':![],'options':_0x25c1bf};_0x215adb[_0x325b('0xbd')](_0x4c71d5);return _0x215adb;});}function getBooleanList(_0x432b05,_0x5a6712,_0x39dae6,_0xcdf195,_0x58f438,_0x26732a){var _0x1d13a6={'method':_0x325b('0xb6'),'uri':_0x432b05+_0x325b('0xb7')+_0xcdf195+_0x325b('0xcd')+_0x58f438+_0x325b('0xd6'),'headers':{'Authorization':_0x325b('0xb2')+_0x26732a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1d13a6)[_0x325b('0x30')](function(_0x59f4c7){var _0x1f1d2d=[];_0x1f1d2d[_0x325b('0xbd')]({'name':_0x59f4c7[_0x325b('0xd0')][_0x325b('0xd7')][_0x325b('0xd2')][_0x325b('0xd3')][_0x325b('0xd2')],'value':_0x325b('0xd8')},{'name':_0x59f4c7[_0x325b('0xd0')]['FalseOption'][_0x325b('0xd2')][_0x325b('0xd3')][_0x325b('0xd2')],'value':_0x325b('0xd9')});var _0x1c12c3={'id':_0x5a6712+'_'+_0x59f4c7[_0x325b('0xbb')],'name':_0x59f4c7['DisplayName'][_0x325b('0xd3')][_0x325b('0xd2')],'custom':![],'options':_0x1f1d2d};_0x39dae6[_0x325b('0xbd')](_0x1c12c3);return _0x39dae6;});}function getInputList(_0x20ca0e,_0x513bfc,_0x3ab95b,_0x2e27b1,_0x135d8b,_0x3f0037,_0x2d0a5c){var _0x2a692b={'method':_0x325b('0xb6'),'uri':_0x20ca0e+_0x325b('0xb7')+_0x135d8b+_0x325b('0xcd')+_0x3f0037+_0x325b('0xda')+_0x3ab95b+_0x325b('0xdb'),'headers':{'Authorization':'Bearer\x20'+_0x2d0a5c,'If-None-Match':null,'OData-Version':_0x325b('0xb3')},'json':!![]};return rp(_0x2a692b)[_0x325b('0x30')](function(_0x154006){var _0x90dd4d={'id':_0x513bfc+'_'+_0x154006['LogicalName'],'name':_0x154006[_0x325b('0xd5')]['UserLocalizedLabel']?_0x154006[_0x325b('0xd5')]['UserLocalizedLabel'][_0x325b('0xd2')]:_0x154006[_0x325b('0xbb')],'custom':![],'options':[]};_0x2e27b1[_0x325b('0xbd')](_0x90dd4d);return _0x2e27b1;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 46428ae..313c22f 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4387a8,_0x47f48c){var _0x47acb6=function(_0x19cadc){while(--_0x19cadc){_0x4387a8['push'](_0x4387a8['shift']());}};_0x47acb6(++_0x47f48c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 20bd41d..99487f4 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 _0x9e70=['request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','map','attributes','catch','ShowDynamics365Account','find','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x1d33dd,_0x5f00e0){var _0x2356d7=function(_0x3300c5){while(--_0x3300c5){_0x1d33dd['push'](_0x1d33dd['shift']());}};_0x2356d7(++_0x5f00e0);}(_0x9e70,0x121));var _0x09e7=function(_0x18e6d9,_0x362a7e){_0x18e6d9=_0x18e6d9-0x0;var _0x1e9fa5=_0x9e70[_0x18e6d9];return _0x1e9fa5;};'use strict';var _=require(_0x09e7('0x0'));var util=require('util');var moment=require(_0x09e7('0x1'));var BPromise=require(_0x09e7('0x2'));var rs=require(_0x09e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x09e7('0x4'));var logger=require(_0x09e7('0x5'))('rpc');var config=require(_0x09e7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x09e7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x561501,_0x1a8a84,_0x1665f0){return new BPromise(function(_0x11815b,_0x5eb576){return client[_0x09e7('0x8')](_0x561501,_0x1665f0)[_0x09e7('0x9')](function(_0x26e7e8){logger[_0x09e7('0xa')](_0x09e7('0xb'),_0x1a8a84,_0x09e7('0xc'));logger[_0x09e7('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1a8a84,_0x09e7('0xc'),JSON[_0x09e7('0xe')](_0x26e7e8));if(_0x26e7e8[_0x09e7('0xf')]){if(_0x26e7e8[_0x09e7('0xf')][_0x09e7('0x10')]===0x1f4){logger[_0x09e7('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x1a8a84,_0x26e7e8[_0x09e7('0xf')][_0x09e7('0x11')]);return _0x5eb576(_0x26e7e8[_0x09e7('0xf')][_0x09e7('0x11')]);}logger['error'](_0x09e7('0xb'),_0x1a8a84,_0x26e7e8['error']['message']);return _0x11815b(_0x26e7e8[_0x09e7('0xf')]['message']);}else{logger[_0x09e7('0xa')](_0x09e7('0xb'),_0x1a8a84,_0x09e7('0xc'));_0x11815b(_0x26e7e8[_0x09e7('0x12')]['message']);}})['catch'](function(_0x2b40ed){logger['error'](_0x09e7('0xb'),_0x1a8a84,_0x2b40ed);_0x5eb576(_0x2b40ed);});});}exports[_0x09e7('0x13')]=function(_0x4d249a){var _0x493e82=this;return new Promise(function(_0x5e673f,_0x17eab6){return db[_0x09e7('0x14')][_0x09e7('0x15')]({'raw':_0x4d249a['options']?_0x4d249a[_0x09e7('0x16')][_0x09e7('0x17')]===undefined?!![]:![]:!![],'where':_0x4d249a[_0x09e7('0x16')]?_0x4d249a['options'][_0x09e7('0x18')]||null:null,'attributes':_0x4d249a[_0x09e7('0x16')]?_0x4d249a[_0x09e7('0x16')]['attributes']||null:null,'limit':_0x4d249a[_0x09e7('0x16')]?_0x4d249a[_0x09e7('0x16')][_0x09e7('0x19')]||null:null,'include':_0x4d249a[_0x09e7('0x16')]?_0x4d249a[_0x09e7('0x16')]['include']?_['map'](_0x4d249a[_0x09e7('0x16')][_0x09e7('0x1a')],function(_0x3401fd){return{'model':db[_0x3401fd[_0x09e7('0x1b')]],'as':_0x3401fd['as'],'attributes':_0x3401fd['attributes'],'include':_0x3401fd[_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x3401fd[_0x09e7('0x1a')],function(_0x552de7){return{'model':db[_0x552de7[_0x09e7('0x1b')]],'as':_0x552de7['as'],'attributes':_0x552de7[_0x09e7('0x1d')],'include':_0x552de7['include']?_[_0x09e7('0x1c')](_0x552de7['include'],function(_0x2054a3){return{'model':db[_0x2054a3[_0x09e7('0x1b')]],'as':_0x2054a3['as'],'attributes':_0x2054a3[_0x09e7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x09e7('0x9')](function(_0x1c81ad){logger[_0x09e7('0xa')](_0x09e7('0x13'),_0x4d249a);logger['debug']('GetDynamics365Account',_0x4d249a,JSON[_0x09e7('0xe')](_0x1c81ad));_0x5e673f(_0x1c81ad);})[_0x09e7('0x1e')](function(_0x52e511){logger[_0x09e7('0xf')](_0x09e7('0x13'),_0x52e511['message'],_0x4d249a);_0x17eab6(_0x493e82[_0x09e7('0xf')](0x1f4,_0x52e511[_0x09e7('0x11')]));});});};exports[_0x09e7('0x1f')]=function(_0x3aa2b7){var _0x3ccd0f=this;return new Promise(function(_0x6aa96b,_0x102823){return db[_0x09e7('0x14')][_0x09e7('0x20')]({'raw':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')][_0x09e7('0x18')]||null:null,'attributes':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')]['attributes']||null:null,'include':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')][_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x3aa2b7[_0x09e7('0x16')][_0x09e7('0x1a')],function(_0x5abf6e){return{'model':db[_0x5abf6e['model']],'as':_0x5abf6e['as'],'attributes':_0x5abf6e[_0x09e7('0x1d')],'include':_0x5abf6e[_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x5abf6e[_0x09e7('0x1a')],function(_0x3d8a48){return{'model':db[_0x3d8a48[_0x09e7('0x1b')]],'as':_0x3d8a48['as'],'attributes':_0x3d8a48[_0x09e7('0x1d')],'include':_0x3d8a48[_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x3d8a48['include'],function(_0x2ff79a){return{'model':db[_0x2ff79a['model']],'as':_0x2ff79a['as'],'attributes':_0x2ff79a['attributes']};}):[]};}):[]};}):[]:[]})[_0x09e7('0x9')](function(_0x4df50f){logger[_0x09e7('0xa')]('ShowDynamics365Account',_0x3aa2b7);logger[_0x09e7('0xd')]('ShowDynamics365Account',_0x3aa2b7,JSON['stringify'](_0x4df50f));_0x6aa96b(_0x4df50f);})[_0x09e7('0x1e')](function(_0x32fa0b){logger['error'](_0x09e7('0x1f'),_0x32fa0b[_0x09e7('0x11')],_0x3aa2b7);_0x102823(_0x3ccd0f[_0x09e7('0xf')](0x1f4,_0x32fa0b[_0x09e7('0x11')]));});});}; \ No newline at end of file +var _0x2e5d=['ShowDynamics365Account','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Dynamics365Account,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','findAll','options','raw','where','attributes','limit','map','include','model','GetDynamics365Account','stringify','catch','Dynamics365Account','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e5d,0x6a));var _0xd2e5=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x2e5d[_0x3df223];return _0x562d11;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd2e5('0x0'));var BPromise=require(_0xd2e5('0x1'));var rs=require(_0xd2e5('0x2'));var fs=require('fs');var Redis=require(_0xd2e5('0x3'));var db=require(_0xd2e5('0x4'))['db'];var utils=require(_0xd2e5('0x5'));var logger=require(_0xd2e5('0x6'))(_0xd2e5('0x7'));var config=require(_0xd2e5('0x8'));var jayson=require(_0xd2e5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb91fc,_0x519d16,_0x11bc15){return new BPromise(function(_0x594846,_0x3a6898){return client[_0xd2e5('0xa')](_0xb91fc,_0x11bc15)[_0xd2e5('0xb')](function(_0x476521){logger['info'](_0xd2e5('0xc'),_0x519d16,'request\x20sent');logger[_0xd2e5('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x519d16,'request\x20sent',JSON['stringify'](_0x476521));if(_0x476521[_0xd2e5('0xe')]){if(_0x476521[_0xd2e5('0xe')][_0xd2e5('0xf')]===0x1f4){logger['error'](_0xd2e5('0xc'),_0x519d16,_0x476521[_0xd2e5('0xe')][_0xd2e5('0x10')]);return _0x3a6898(_0x476521[_0xd2e5('0xe')]['message']);}logger[_0xd2e5('0xe')](_0xd2e5('0xc'),_0x519d16,_0x476521['error'][_0xd2e5('0x10')]);return _0x594846(_0x476521[_0xd2e5('0xe')][_0xd2e5('0x10')]);}else{logger[_0xd2e5('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x519d16,_0xd2e5('0x12'));_0x594846(_0x476521[_0xd2e5('0x13')][_0xd2e5('0x10')]);}})['catch'](function(_0x28fd22){logger[_0xd2e5('0xe')](_0xd2e5('0xc'),_0x519d16,_0x28fd22);_0x3a6898(_0x28fd22);});});}exports['GetDynamics365Account']=function(_0x45e1d1){var _0x5dda32=this;return new Promise(function(_0x2386f4,_0x5ce88c){return db['Dynamics365Account'][_0xd2e5('0x14')]({'raw':_0x45e1d1[_0xd2e5('0x15')]?_0x45e1d1['options'][_0xd2e5('0x16')]===undefined?!![]:![]:!![],'where':_0x45e1d1[_0xd2e5('0x15')]?_0x45e1d1['options'][_0xd2e5('0x17')]||null:null,'attributes':_0x45e1d1['options']?_0x45e1d1[_0xd2e5('0x15')][_0xd2e5('0x18')]||null:null,'limit':_0x45e1d1[_0xd2e5('0x15')]?_0x45e1d1[_0xd2e5('0x15')][_0xd2e5('0x19')]||null:null,'include':_0x45e1d1[_0xd2e5('0x15')]?_0x45e1d1[_0xd2e5('0x15')]['include']?_[_0xd2e5('0x1a')](_0x45e1d1[_0xd2e5('0x15')][_0xd2e5('0x1b')],function(_0x280dce){return{'model':db[_0x280dce[_0xd2e5('0x1c')]],'as':_0x280dce['as'],'attributes':_0x280dce['attributes'],'include':_0x280dce['include']?_[_0xd2e5('0x1a')](_0x280dce[_0xd2e5('0x1b')],function(_0x45b3a5){return{'model':db[_0x45b3a5[_0xd2e5('0x1c')]],'as':_0x45b3a5['as'],'attributes':_0x45b3a5[_0xd2e5('0x18')],'include':_0x45b3a5['include']?_['map'](_0x45b3a5[_0xd2e5('0x1b')],function(_0x586a67){return{'model':db[_0x586a67[_0xd2e5('0x1c')]],'as':_0x586a67['as'],'attributes':_0x586a67['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4972de){logger[_0xd2e5('0x11')](_0xd2e5('0x1d'),_0x45e1d1);logger[_0xd2e5('0xd')](_0xd2e5('0x1d'),_0x45e1d1,JSON[_0xd2e5('0x1e')](_0x4972de));_0x2386f4(_0x4972de);})[_0xd2e5('0x1f')](function(_0x4cd30f){logger[_0xd2e5('0xe')](_0xd2e5('0x1d'),_0x4cd30f[_0xd2e5('0x10')],_0x45e1d1);_0x5ce88c(_0x5dda32[_0xd2e5('0xe')](0x1f4,_0x4cd30f[_0xd2e5('0x10')]));});});};exports['ShowDynamics365Account']=function(_0x3ef2f9){var _0x3430dd=this;return new Promise(function(_0x6e410d,_0x5cfe61){return db[_0xd2e5('0x20')][_0xd2e5('0x21')]({'raw':_0x3ef2f9[_0xd2e5('0x15')]?_0x3ef2f9[_0xd2e5('0x15')][_0xd2e5('0x16')]===undefined?!![]:![]:!![],'where':_0x3ef2f9[_0xd2e5('0x15')]?_0x3ef2f9[_0xd2e5('0x15')][_0xd2e5('0x17')]||null:null,'attributes':_0x3ef2f9['options']?_0x3ef2f9[_0xd2e5('0x15')][_0xd2e5('0x18')]||null:null,'include':_0x3ef2f9[_0xd2e5('0x15')]?_0x3ef2f9['options'][_0xd2e5('0x1b')]?_[_0xd2e5('0x1a')](_0x3ef2f9[_0xd2e5('0x15')][_0xd2e5('0x1b')],function(_0x333e40){return{'model':db[_0x333e40[_0xd2e5('0x1c')]],'as':_0x333e40['as'],'attributes':_0x333e40[_0xd2e5('0x18')],'include':_0x333e40['include']?_[_0xd2e5('0x1a')](_0x333e40[_0xd2e5('0x1b')],function(_0x7dc46c){return{'model':db[_0x7dc46c[_0xd2e5('0x1c')]],'as':_0x7dc46c['as'],'attributes':_0x7dc46c['attributes'],'include':_0x7dc46c[_0xd2e5('0x1b')]?_[_0xd2e5('0x1a')](_0x7dc46c['include'],function(_0xa10444){return{'model':db[_0xa10444[_0xd2e5('0x1c')]],'as':_0xa10444['as'],'attributes':_0xa10444['attributes']};}):[]};}):[]};}):[]:[]})[_0xd2e5('0xb')](function(_0x5623bd){logger[_0xd2e5('0x11')]('ShowDynamics365Account',_0x3ef2f9);logger[_0xd2e5('0xd')]('ShowDynamics365Account',_0x3ef2f9,JSON[_0xd2e5('0x1e')](_0x5623bd));_0x6e410d(_0x5623bd);})['catch'](function(_0x2c34b5){logger[_0xd2e5('0xe')](_0xd2e5('0x22'),_0x2c34b5['message'],_0x3ef2f9);_0x5cfe61(_0x3430dd['error'](0x1f4,_0x2c34b5[_0xd2e5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 78100d0..d03d293 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 _0x3070=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x3070,0x75));var _0x0307=function(_0x38266e,_0x1215ca){_0x38266e=_0x38266e-0x0;var _0x372c2d=_0x3070[_0x38266e];return _0x372c2d;};'use strict';var multer=require('multer');var util=require(_0x0307('0x0'));var path=require('path');var timeout=require(_0x0307('0x1'));var express=require(_0x0307('0x2'));var router=express[_0x0307('0x3')]();var fs_extra=require(_0x0307('0x4'));var auth=require(_0x0307('0x5'));var interaction=require(_0x0307('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x0307('0x7')]('/',auth[_0x0307('0x8')](),controller[_0x0307('0x9')]);router[_0x0307('0x7')]('/:id',auth[_0x0307('0x8')](),controller[_0x0307('0xa')]);router['get'](_0x0307('0xb'),auth[_0x0307('0x8')](),controller[_0x0307('0xc')]);router[_0x0307('0x7')](_0x0307('0xd'),auth[_0x0307('0x8')](),controller[_0x0307('0xe')]);router[_0x0307('0x7')](_0x0307('0xf'),auth['isAuthenticated'](),controller[_0x0307('0x10')]);router['post']('/',auth[_0x0307('0x8')](),controller[_0x0307('0x11')]);router[_0x0307('0x12')](_0x0307('0x13'),auth[_0x0307('0x8')](),controller[_0x0307('0x14')]);router[_0x0307('0x15')](_0x0307('0x13'),auth[_0x0307('0x8')](),controller[_0x0307('0x16')]);module[_0x0307('0x17')]=router; \ No newline at end of file +var _0xbfa1=['get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','/:id','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index'];(function(_0x58fdfd,_0x46f063){var _0x3a4613=function(_0x4b6a77){while(--_0x4b6a77){_0x58fdfd['push'](_0x58fdfd['shift']());}};_0x3a4613(++_0x46f063);}(_0xbfa1,0x140));var _0x1bfa=function(_0xa6b30e,_0x44d675){_0xa6b30e=_0xa6b30e-0x0;var _0x27a3c6=_0xbfa1[_0xa6b30e];return _0x27a3c6;};'use strict';var multer=require(_0x1bfa('0x0'));var util=require('util');var path=require(_0x1bfa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1bfa('0x2')]();var fs_extra=require(_0x1bfa('0x3'));var auth=require(_0x1bfa('0x4'));var interaction=require(_0x1bfa('0x5'));var config=require(_0x1bfa('0x6'));var controller=require(_0x1bfa('0x7'));router['get']('/',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x9')]);router[_0x1bfa('0xa')]('/:id',auth[_0x1bfa('0x8')](),controller['show']);router[_0x1bfa('0xa')](_0x1bfa('0xb'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xc')]);router['get']('/:id/subjects',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xd')]);router[_0x1bfa('0xa')](_0x1bfa('0xe'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0xf')]);router[_0x1bfa('0x10')]('/',auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x11')]);router['put']('/:id',auth[_0x1bfa('0x8')](),controller['update']);router[_0x1bfa('0x12')](_0x1bfa('0x13'),auth[_0x1bfa('0x8')](),controller[_0x1bfa('0x14')]);module[_0x1bfa('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index bca2e78..7e084f4 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 _0xfae0=['STRING','ENUM','incident','phonecall','exports'];(function(_0x4bcbfc,_0x312cea){var _0x520817=function(_0x32cc21){while(--_0x32cc21){_0x4bcbfc['push'](_0x4bcbfc['shift']());}};_0x520817(++_0x312cea);}(_0xfae0,0xdb));var _0x0fae=function(_0x5352d0,_0x41e8b4){_0x5352d0=_0x5352d0-0x0;var _0x352b00=_0xfae0[_0x5352d0];return _0x352b00;};'use strict';var Sequelize=require('sequelize');module[_0x0fae('0x0')]={'name':{'type':Sequelize[_0x0fae('0x1')]},'description':{'type':Sequelize[_0x0fae('0x1')]},'ticketType':{'type':Sequelize[_0x0fae('0x2')](_0x0fae('0x3'),_0x0fae('0x4')),'defaultValue':_0x0fae('0x3')}}; \ No newline at end of file +var _0x2191=['ENUM','incident','sequelize','STRING'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x2191,0x13a));var _0x1219=function(_0x48281d,_0x3adfeb){_0x48281d=_0x48281d-0x0;var _0x4980f9=_0x2191[_0x48281d];return _0x4980f9;};'use strict';var Sequelize=require(_0x1219('0x0'));module['exports']={'name':{'type':Sequelize[_0x1219('0x1')]},'description':{'type':Sequelize[_0x1219('0x1')]},'ticketType':{'type':Sequelize[_0x1219('0x2')]('incident','phonecall'),'defaultValue':_0x1219('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 3ef0e66..59743ba 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 _0xf646=['count','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','merge','filter','options','includeAll','rows','params','length','include','create','body','catch','find','getFields','findOne','order','nolimit','getSubjects','Dynamics365Field','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','offset','undefined','limit'];(function(_0x20167a,_0x1b650f){var _0x1579f6=function(_0x3bc981){while(--_0x3bc981){_0x20167a['push'](_0x20167a['shift']());}};_0x1579f6(++_0x1b650f);}(_0xf646,0xe6));var _0x6f64=function(_0x3e2b25,_0x4cacf1){_0x3e2b25=_0x3e2b25-0x0;var _0x3df5b8=_0xf646[_0x3e2b25];return _0x3df5b8;};'use strict';var emlformat=require(_0x6f64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f64('0x1'));var jsonpatch=require(_0x6f64('0x2'));var rp=require(_0x6f64('0x3'));var moment=require(_0x6f64('0x4'));var BPromise=require(_0x6f64('0x5'));var Mustache=require(_0x6f64('0x6'));var util=require('util');var path=require(_0x6f64('0x7'));var sox=require(_0x6f64('0x8'));var csv=require('to-csv');var ejs=require(_0x6f64('0x9'));var fs=require('fs');var fs_extra=require(_0x6f64('0xa'));var _=require(_0x6f64('0xb'));var squel=require(_0x6f64('0xc'));var crypto=require(_0x6f64('0xd'));var jsforce=require(_0x6f64('0xe'));var deskjs=require(_0x6f64('0xf'));var toCsv=require(_0x6f64('0x10'));var querystring=require(_0x6f64('0x11'));var Papa=require('papaparse');var Redis=require(_0x6f64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6f64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f64('0x14'));var logger=require(_0x6f64('0x15'))(_0x6f64('0x16'));var utils=require(_0x6f64('0x17'));var config=require(_0x6f64('0x18'));var licenseUtil=require(_0x6f64('0x19'));var db=require(_0x6f64('0x1a'))['db'];var jayson=require(_0x6f64('0x1b'));var client=jayson['client'][_0x6f64('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3cc798,_0x5d3f36,_0x230e7f,_0x461a1d){return new BPromise(function(_0x5cd840,_0x1ec5b3){var _0x5c0d75=_0x461a1d||client;return _0x5c0d75[_0x6f64('0x1d')](_0x3cc798,_0x230e7f)[_0x6f64('0x1e')](function(_0x1628fb){logger[_0x6f64('0x1f')](_0x6f64('0x20'),_0x5d3f36,'request\x20sent');logger[_0x6f64('0x21')](_0x6f64('0x22'),_0x5d3f36,_0x6f64('0x23'),JSON[_0x6f64('0x24')](_0x1628fb));if(_0x1628fb[_0x6f64('0x25')]){if(_0x1628fb['error'][_0x6f64('0x26')]===0x1f4){logger[_0x6f64('0x25')](_0x6f64('0x20'),_0x5d3f36,_0x1628fb['error']['message']);return _0x1ec5b3(_0x1628fb[_0x6f64('0x25')][_0x6f64('0x27')]);}logger[_0x6f64('0x25')](_0x6f64('0x20'),_0x5d3f36,_0x1628fb[_0x6f64('0x25')][_0x6f64('0x27')]);return _0x5cd840(_0x1628fb[_0x6f64('0x25')][_0x6f64('0x27')]);}else{logger[_0x6f64('0x1f')](_0x6f64('0x20'),_0x5d3f36,_0x6f64('0x23'));_0x5cd840(_0x1628fb[_0x6f64('0x28')][_0x6f64('0x27')]);}})['catch'](function(_0xa7b06b){logger[_0x6f64('0x25')](_0x6f64('0x20'),_0x5d3f36,_0xa7b06b);_0x1ec5b3(_0xa7b06b);});});}function respondWithStatusCode(_0x3815c4,_0x5e8e47){_0x5e8e47=_0x5e8e47||0xcc;return function(_0x413dd2){if(_0x413dd2){return _0x3815c4['sendStatus'](_0x5e8e47);}return _0x3815c4[_0x6f64('0x29')](_0x5e8e47)[_0x6f64('0x2a')]();};}function respondWithResult(_0x55044f,_0x4a7995){_0x4a7995=_0x4a7995||0xc8;return function(_0x267c52){if(_0x267c52){return _0x55044f[_0x6f64('0x29')](_0x4a7995)['json'](_0x267c52);}};}function respondWithFilteredResult(_0x101273,_0x2a2741){return function(_0x47c509){if(_0x47c509){var _0x379945=typeof _0x2a2741[_0x6f64('0x2b')]===_0x6f64('0x2c')&&typeof _0x2a2741[_0x6f64('0x2d')]===_0x6f64('0x2c');var _0x439095=_0x47c509['count'];var _0x3603dd=_0x379945?0x0:_0x2a2741[_0x6f64('0x2b')];var _0x1c1d8f=_0x379945?_0x47c509[_0x6f64('0x2e')]:_0x2a2741['offset']+_0x2a2741[_0x6f64('0x2d')];var _0x4e131b;if(_0x1c1d8f>=_0x439095){_0x1c1d8f=_0x439095;_0x4e131b=0xc8;}else{_0x4e131b=0xce;}_0x101273['status'](_0x4e131b);return _0x101273[_0x6f64('0x2f')](_0x6f64('0x30'),_0x3603dd+'-'+_0x1c1d8f+'/'+_0x439095)['json'](_0x47c509);}return null;};}function patchUpdates(_0x4574ed){return function(_0x508d66){try{jsonpatch[_0x6f64('0x31')](_0x508d66,_0x4574ed,!![]);}catch(_0x2a9bca){return BPromise[_0x6f64('0x32')](_0x2a9bca);}return _0x508d66['save']();};}function saveUpdates(_0x36c5d0,_0x3b0b77){return function(_0x4e1aa8){if(_0x4e1aa8){return _0x4e1aa8[_0x6f64('0x33')](_0x36c5d0)[_0x6f64('0x1e')](function(_0x14c6a7){return _0x14c6a7;});}return null;};}function removeEntity(_0x316969,_0x5714fb){return function(_0x583433){if(_0x583433){return _0x583433[_0x6f64('0x34')]()[_0x6f64('0x1e')](function(){_0x316969['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x565318,_0x43d9a8){return function(_0x286b64){if(!_0x286b64){_0x565318[_0x6f64('0x35')](0x194);}return _0x286b64;};}function handleError(_0x32860d,_0x179f55){_0x179f55=_0x179f55||0x1f4;return function(_0x326f33){logger[_0x6f64('0x25')](_0x326f33[_0x6f64('0x36')]);if(_0x326f33[_0x6f64('0x37')]){delete _0x326f33[_0x6f64('0x37')];}_0x32860d[_0x6f64('0x29')](_0x179f55)['send'](_0x326f33);};}exports['index']=function(_0x46a0fa,_0x32faf6){var _0x3b29d0={},_0x20ac73={},_0x70654={'count':0x0,'rows':[]};var _0x28c216=_['map'](db[_0x6f64('0x38')][_0x6f64('0x39')],function(_0x4b5666){return{'name':_0x4b5666[_0x6f64('0x3a')],'type':_0x4b5666[_0x6f64('0x3b')][_0x6f64('0x3c')]};});_0x20ac73[_0x6f64('0x3d')]=_[_0x6f64('0x3e')](_0x28c216,'name');_0x20ac73[_0x6f64('0x3f')]=_[_0x6f64('0x40')](_0x46a0fa['query']);_0x20ac73[_0x6f64('0x41')]=_[_0x6f64('0x42')](_0x20ac73[_0x6f64('0x3d')],_0x20ac73[_0x6f64('0x3f')]);_0x3b29d0[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x20ac73[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x3b29d0[_0x6f64('0x43')]=_0x3b29d0[_0x6f64('0x43')]['length']?_0x3b29d0['attributes']:_0x20ac73['model'];if(!_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x45')]('nolimit')){_0x3b29d0['limit']=qs[_0x6f64('0x2d')](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0x3b29d0[_0x6f64('0x2b')]=qs[_0x6f64('0x2b')](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x2b')]);}_0x3b29d0['order']=qs['sort'](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x46')]);_0x3b29d0['where']=qs[_0x6f64('0x41')](_[_0x6f64('0x47')](_0x46a0fa[_0x6f64('0x3f')],_0x20ac73[_0x6f64('0x41')]),_0x28c216);if(_0x46a0fa[_0x6f64('0x3f')]['filter']){_0x3b29d0[_0x6f64('0x48')]=_[_0x6f64('0x49')](_0x3b29d0[_0x6f64('0x48')],{'$or':_[_0x6f64('0x3e')](_0x28c216,function(_0x3fb5c9){if(_0x3fb5c9['type']!=='VIRTUAL'){var _0x1d8cdc={};_0x1d8cdc[_0x3fb5c9[_0x6f64('0x37')]]={'$like':'%'+_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x4a')]+'%'};return _0x1d8cdc;}})});}_0x3b29d0=_[_0x6f64('0x49')]({},_0x3b29d0,_0x46a0fa[_0x6f64('0x4b')]);var _0x33a966={'where':_0x3b29d0[_0x6f64('0x48')]};return db['Dynamics365Configuration'][_0x6f64('0x2e')](_0x33a966)[_0x6f64('0x1e')](function(_0x152e2e){_0x70654[_0x6f64('0x2e')]=_0x152e2e;if(_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x4c')]){_0x3b29d0['include']=[{'all':!![]}];}return db[_0x6f64('0x38')]['findAll'](_0x3b29d0);})[_0x6f64('0x1e')](function(_0x80a83d){_0x70654[_0x6f64('0x4d')]=_0x80a83d;return _0x70654;})[_0x6f64('0x1e')](respondWithFilteredResult(_0x32faf6,_0x3b29d0))['catch'](handleError(_0x32faf6,null));};exports['show']=function(_0x53eaa2,_0x423add){var _0x415c1c={'raw':![],'where':{'id':_0x53eaa2[_0x6f64('0x4e')]['id']}},_0x2fb674={};_0x2fb674['model']=_[_0x6f64('0x40')](db[_0x6f64('0x38')][_0x6f64('0x39')]);_0x2fb674[_0x6f64('0x3f')]=_[_0x6f64('0x40')](_0x53eaa2[_0x6f64('0x3f')]);_0x2fb674['filters']=_['intersection'](_0x2fb674['model'],_0x2fb674[_0x6f64('0x3f')]);_0x415c1c[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x2fb674[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0x53eaa2[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x415c1c['attributes']=_0x415c1c[_0x6f64('0x43')][_0x6f64('0x4f')]?_0x415c1c[_0x6f64('0x43')]:_0x2fb674[_0x6f64('0x3d')];if(_0x53eaa2['query'][_0x6f64('0x4c')]){_0x415c1c[_0x6f64('0x50')]=[{'all':!![]}];}_0x415c1c=_[_0x6f64('0x49')]({},_0x415c1c,_0x53eaa2[_0x6f64('0x4b')]);return db[_0x6f64('0x38')]['find'](_0x415c1c)[_0x6f64('0x1e')](handleEntityNotFound(_0x423add,null))[_0x6f64('0x1e')](respondWithResult(_0x423add,null))['catch'](handleError(_0x423add,null));};exports[_0x6f64('0x51')]=function(_0x322bfc,_0x307018){return db[_0x6f64('0x38')][_0x6f64('0x51')](_0x322bfc[_0x6f64('0x52')],{})['then'](respondWithResult(_0x307018,0xc9))[_0x6f64('0x53')](handleError(_0x307018,null));};exports[_0x6f64('0x33')]=function(_0x866e41,_0x2b28d9){if(_0x866e41['body']['id']){delete _0x866e41[_0x6f64('0x52')]['id'];}return db[_0x6f64('0x38')]['find']({'where':{'id':_0x866e41['params']['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x2b28d9,null))[_0x6f64('0x1e')](saveUpdates(_0x866e41['body'],null))[_0x6f64('0x1e')](respondWithResult(_0x2b28d9,null))[_0x6f64('0x53')](handleError(_0x2b28d9,null));};exports['destroy']=function(_0x240dc2,_0x35e8cd){return db['Dynamics365Configuration'][_0x6f64('0x54')]({'where':{'id':_0x240dc2['params']['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x35e8cd,null))[_0x6f64('0x1e')](removeEntity(_0x35e8cd,null))[_0x6f64('0x53')](handleError(_0x35e8cd,null));};exports[_0x6f64('0x55')]=function(_0xa96eeb,_0x40d5b8,_0x37b1ed){var _0x1fa1e1={};var _0x62b39f={};var _0x2b2c38;var _0x3e21a9;return db[_0x6f64('0x38')][_0x6f64('0x56')]({'where':{'id':_0xa96eeb[_0x6f64('0x4e')]['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x40d5b8,null))[_0x6f64('0x1e')](function(_0x48fc56){if(_0x48fc56){_0x2b2c38=_0x48fc56;_0x62b39f[_0x6f64('0x3d')]=_[_0x6f64('0x40')](db['Dynamics365Field']['rawAttributes']);_0x62b39f[_0x6f64('0x3f')]=_['keys'](_0xa96eeb[_0x6f64('0x3f')]);_0x62b39f[_0x6f64('0x41')]=_[_0x6f64('0x42')](_0x62b39f[_0x6f64('0x3d')],_0x62b39f[_0x6f64('0x3f')]);_0x1fa1e1[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x62b39f[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x1fa1e1[_0x6f64('0x43')]=_0x1fa1e1[_0x6f64('0x43')][_0x6f64('0x4f')]?_0x1fa1e1[_0x6f64('0x43')]:_0x62b39f[_0x6f64('0x3d')];_0x1fa1e1[_0x6f64('0x57')]=qs['sort'](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x46')]);_0x1fa1e1['where']=qs[_0x6f64('0x41')](_[_0x6f64('0x47')](_0xa96eeb[_0x6f64('0x3f')],_0x62b39f[_0x6f64('0x41')]));if(_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x4a')]){_0x1fa1e1[_0x6f64('0x48')]=_[_0x6f64('0x49')](_0x1fa1e1[_0x6f64('0x48')],{'$or':_[_0x6f64('0x3e')](_0x1fa1e1[_0x6f64('0x43')],function(_0x509ac3){var _0x363d79={};_0x363d79[_0x509ac3]={'$like':'%'+_0xa96eeb['query'][_0x6f64('0x4a')]+'%'};return _0x363d79;})});}_0x1fa1e1=_[_0x6f64('0x49')]({},_0x1fa1e1,_0xa96eeb[_0x6f64('0x4b')]);return _0x2b2c38['getFields'](_0x1fa1e1);}})[_0x6f64('0x1e')](function(_0x135803){if(_0x135803){_0x3e21a9=_0x135803[_0x6f64('0x4f')];if(!_0xa96eeb[_0x6f64('0x3f')]['hasOwnProperty'](_0x6f64('0x58'))){_0x1fa1e1[_0x6f64('0x2d')]=qs[_0x6f64('0x2d')](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0x1fa1e1[_0x6f64('0x2b')]=qs['offset'](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x2b')]);}return _0x2b2c38[_0x6f64('0x55')](_0x1fa1e1);}})['then'](function(_0xb6c335){if(_0xb6c335){return _0xb6c335?{'count':_0x3e21a9,'rows':_0xb6c335}:null;}})['then'](respondWithResult(_0x40d5b8,null))[_0x6f64('0x53')](handleError(_0x40d5b8,null));};exports[_0x6f64('0x59')]=function(_0x468434,_0x22e3e1,_0x131f38){var _0xbe5686={};var _0x11ea7f={};var _0x12059b;var _0x2ad88c;return db['Dynamics365Configuration'][_0x6f64('0x56')]({'where':{'id':_0x468434[_0x6f64('0x4e')]['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x22e3e1,null))['then'](function(_0x150233){if(_0x150233){_0x12059b=_0x150233;_0x11ea7f[_0x6f64('0x3d')]=_['keys'](db[_0x6f64('0x5a')][_0x6f64('0x39')]);_0x11ea7f['query']=_['keys'](_0x468434[_0x6f64('0x3f')]);_0x11ea7f[_0x6f64('0x41')]=_[_0x6f64('0x42')](_0x11ea7f[_0x6f64('0x3d')],_0x11ea7f[_0x6f64('0x3f')]);_0xbe5686[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x11ea7f[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0x468434[_0x6f64('0x3f')][_0x6f64('0x44')]));_0xbe5686[_0x6f64('0x43')]=_0xbe5686['attributes'][_0x6f64('0x4f')]?_0xbe5686[_0x6f64('0x43')]:_0x11ea7f['model'];_0xbe5686[_0x6f64('0x57')]=qs['sort'](_0x468434[_0x6f64('0x3f')]['sort']);_0xbe5686['where']=qs['filters'](_['pick'](_0x468434['query'],_0x11ea7f['filters']));if(_0x468434[_0x6f64('0x3f')][_0x6f64('0x4a')]){_0xbe5686[_0x6f64('0x48')]=_['merge'](_0xbe5686['where'],{'$or':_['map'](_0xbe5686['attributes'],function(_0x1acb55){var _0x2c50f0={};_0x2c50f0[_0x1acb55]={'$like':'%'+_0x468434[_0x6f64('0x3f')][_0x6f64('0x4a')]+'%'};return _0x2c50f0;})});}_0xbe5686=_[_0x6f64('0x49')]({},_0xbe5686,_0x468434['options']);return _0x12059b['getSubjects'](_0xbe5686);}})[_0x6f64('0x1e')](function(_0x4d737d){if(_0x4d737d){_0x2ad88c=_0x4d737d[_0x6f64('0x4f')];if(!_0x468434[_0x6f64('0x3f')][_0x6f64('0x45')](_0x6f64('0x58'))){_0xbe5686['limit']=qs['limit'](_0x468434[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0xbe5686[_0x6f64('0x2b')]=qs['offset'](_0x468434[_0x6f64('0x3f')][_0x6f64('0x2b')]);}return _0x12059b[_0x6f64('0x59')](_0xbe5686);}})['then'](function(_0x1518fd){if(_0x1518fd){return _0x1518fd?{'count':_0x2ad88c,'rows':_0x1518fd}:null;}})[_0x6f64('0x1e')](respondWithResult(_0x22e3e1,null))[_0x6f64('0x53')](handleError(_0x22e3e1,null));};exports[_0x6f64('0x5b')]=function(_0x321d45,_0x2cb1bf,_0x1353d2){var _0x23145b={};var _0x4861a0={};var _0x4590d2;var _0x158913;return db[_0x6f64('0x38')]['findOne']({'where':{'id':_0x321d45[_0x6f64('0x4e')]['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x2cb1bf,null))[_0x6f64('0x1e')](function(_0x49e778){if(_0x49e778){_0x4590d2=_0x49e778;_0x4861a0['model']=_[_0x6f64('0x40')](db[_0x6f64('0x5a')][_0x6f64('0x39')]);_0x4861a0[_0x6f64('0x3f')]=_[_0x6f64('0x40')](_0x321d45[_0x6f64('0x3f')]);_0x4861a0[_0x6f64('0x41')]=_['intersection'](_0x4861a0['model'],_0x4861a0[_0x6f64('0x3f')]);_0x23145b[_0x6f64('0x43')]=_['intersection'](_0x4861a0[_0x6f64('0x3d')],qs['fields'](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x23145b['attributes']=_0x23145b[_0x6f64('0x43')][_0x6f64('0x4f')]?_0x23145b['attributes']:_0x4861a0[_0x6f64('0x3d')];_0x23145b['order']=qs[_0x6f64('0x46')](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x46')]);_0x23145b[_0x6f64('0x48')]=qs[_0x6f64('0x41')](_[_0x6f64('0x47')](_0x321d45[_0x6f64('0x3f')],_0x4861a0['filters']));if(_0x321d45['query'][_0x6f64('0x4a')]){_0x23145b['where']=_[_0x6f64('0x49')](_0x23145b['where'],{'$or':_[_0x6f64('0x3e')](_0x23145b[_0x6f64('0x43')],function(_0x3ef908){var _0x572642={};_0x572642[_0x3ef908]={'$like':'%'+_0x321d45['query'][_0x6f64('0x4a')]+'%'};return _0x572642;})});}_0x23145b=_[_0x6f64('0x49')]({},_0x23145b,_0x321d45[_0x6f64('0x4b')]);return _0x4590d2[_0x6f64('0x5b')](_0x23145b);}})['then'](function(_0x225db9){if(_0x225db9){_0x158913=_0x225db9[_0x6f64('0x4f')];if(!_0x321d45[_0x6f64('0x3f')][_0x6f64('0x45')](_0x6f64('0x58'))){_0x23145b[_0x6f64('0x2d')]=qs[_0x6f64('0x2d')](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0x23145b[_0x6f64('0x2b')]=qs[_0x6f64('0x2b')](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x2b')]);}return _0x4590d2['getDescriptions'](_0x23145b);}})['then'](function(_0x137538){if(_0x137538){return _0x137538?{'count':_0x158913,'rows':_0x137538}:null;}})[_0x6f64('0x1e')](respondWithResult(_0x2cb1bf,null))[_0x6f64('0x53')](handleError(_0x2cb1bf,null));}; \ No newline at end of file +var _0xf6c0=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','name','send','index','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','Dynamics365Configuration','includeAll','include','rows','show','params','rawAttributes','find','create','body','getFields','findOne','Dynamics365Field','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53ee0e,_0xa04d22){var _0x151607=function(_0x512888){while(--_0x512888){_0x53ee0e['push'](_0x53ee0e['shift']());}};_0x151607(++_0xa04d22);}(_0xf6c0,0x1ad));var _0x0f6c=function(_0x15bf58,_0x170ea4){_0x15bf58=_0x15bf58-0x0;var _0x5d6c96=_0xf6c0[_0x15bf58];return _0x5d6c96;};'use strict';var emlformat=require(_0x0f6c('0x0'));var rimraf=require(_0x0f6c('0x1'));var zipdir=require(_0x0f6c('0x2'));var jsonpatch=require(_0x0f6c('0x3'));var rp=require(_0x0f6c('0x4'));var moment=require(_0x0f6c('0x5'));var BPromise=require(_0x0f6c('0x6'));var Mustache=require(_0x0f6c('0x7'));var util=require(_0x0f6c('0x8'));var path=require(_0x0f6c('0x9'));var sox=require(_0x0f6c('0xa'));var csv=require(_0x0f6c('0xb'));var ejs=require(_0x0f6c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f6c('0xd'));var crypto=require(_0x0f6c('0xe'));var jsforce=require(_0x0f6c('0xf'));var deskjs=require(_0x0f6c('0x10'));var toCsv=require(_0x0f6c('0xb'));var querystring=require(_0x0f6c('0x11'));var Papa=require(_0x0f6c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f6c('0x13'));var hardwareService=require(_0x0f6c('0x14'));var logger=require('../../config/logger')(_0x0f6c('0x15'));var utils=require(_0x0f6c('0x16'));var config=require(_0x0f6c('0x17'));var licenseUtil=require(_0x0f6c('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0f6c('0x19'));var client=jayson[_0x0f6c('0x1a')][_0x0f6c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xc0d26,_0x10a4a1,_0x2ae68a,_0x230464){return new BPromise(function(_0x51fec8,_0x5685aa){var _0x378727=_0x230464||client;return _0x378727[_0x0f6c('0x1c')](_0xc0d26,_0x2ae68a)[_0x0f6c('0x1d')](function(_0x48829f){logger[_0x0f6c('0x1e')](_0x0f6c('0x1f'),_0x10a4a1,_0x0f6c('0x20'));logger[_0x0f6c('0x21')](_0x0f6c('0x22'),_0x10a4a1,_0x0f6c('0x20'),JSON[_0x0f6c('0x23')](_0x48829f));if(_0x48829f[_0x0f6c('0x24')]){if(_0x48829f[_0x0f6c('0x24')][_0x0f6c('0x25')]===0x1f4){logger[_0x0f6c('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x10a4a1,_0x48829f['error'][_0x0f6c('0x26')]);return _0x5685aa(_0x48829f[_0x0f6c('0x24')][_0x0f6c('0x26')]);}logger[_0x0f6c('0x24')](_0x0f6c('0x1f'),_0x10a4a1,_0x48829f[_0x0f6c('0x24')]['message']);return _0x51fec8(_0x48829f['error']['message']);}else{logger[_0x0f6c('0x1e')](_0x0f6c('0x1f'),_0x10a4a1,_0x0f6c('0x20'));_0x51fec8(_0x48829f['result'][_0x0f6c('0x26')]);}})[_0x0f6c('0x27')](function(_0x52dcc1){logger[_0x0f6c('0x24')](_0x0f6c('0x1f'),_0x10a4a1,_0x52dcc1);_0x5685aa(_0x52dcc1);});});}function respondWithStatusCode(_0x23bed9,_0x571d1e){_0x571d1e=_0x571d1e||0xcc;return function(_0x387e12){if(_0x387e12){return _0x23bed9[_0x0f6c('0x28')](_0x571d1e);}return _0x23bed9[_0x0f6c('0x29')](_0x571d1e)[_0x0f6c('0x2a')]();};}function respondWithResult(_0x1dc8f5,_0x35259f){_0x35259f=_0x35259f||0xc8;return function(_0x1fdcbb){if(_0x1fdcbb){return _0x1dc8f5[_0x0f6c('0x29')](_0x35259f)[_0x0f6c('0x2b')](_0x1fdcbb);}};}function respondWithFilteredResult(_0x37151d,_0x1f184d){return function(_0x49e657){if(_0x49e657){var _0x4d7a9e=typeof _0x1f184d[_0x0f6c('0x2c')]===_0x0f6c('0x2d')&&typeof _0x1f184d[_0x0f6c('0x2e')]===_0x0f6c('0x2d');var _0xce0a63=_0x49e657[_0x0f6c('0x2f')];var _0xfcc99a=_0x4d7a9e?0x0:_0x1f184d[_0x0f6c('0x2c')];var _0x4a2905=_0x4d7a9e?_0x49e657['count']:_0x1f184d[_0x0f6c('0x2c')]+_0x1f184d[_0x0f6c('0x2e')];var _0x51b740;if(_0x4a2905>=_0xce0a63){_0x4a2905=_0xce0a63;_0x51b740=0xc8;}else{_0x51b740=0xce;}_0x37151d['status'](_0x51b740);return _0x37151d[_0x0f6c('0x30')](_0x0f6c('0x31'),_0xfcc99a+'-'+_0x4a2905+'/'+_0xce0a63)['json'](_0x49e657);}return null;};}function patchUpdates(_0x30edbe){return function(_0x4aba8d){try{jsonpatch['apply'](_0x4aba8d,_0x30edbe,!![]);}catch(_0x3d076e){return BPromise[_0x0f6c('0x32')](_0x3d076e);}return _0x4aba8d[_0x0f6c('0x33')]();};}function saveUpdates(_0x5f4d90,_0x9e382a){return function(_0x202d7d){if(_0x202d7d){return _0x202d7d[_0x0f6c('0x34')](_0x5f4d90)[_0x0f6c('0x1d')](function(_0x29daf2){return _0x29daf2;});}return null;};}function removeEntity(_0xaf50ed,_0x131e58){return function(_0x29d203){if(_0x29d203){return _0x29d203[_0x0f6c('0x35')]()[_0x0f6c('0x1d')](function(){_0xaf50ed['status'](0xcc)[_0x0f6c('0x2a')]();});}};}function handleEntityNotFound(_0xac289e,_0x3b9ed5){return function(_0x5a4ce5){if(!_0x5a4ce5){_0xac289e['sendStatus'](0x194);}return _0x5a4ce5;};}function handleError(_0x2995f9,_0x510705){_0x510705=_0x510705||0x1f4;return function(_0x47efac){logger[_0x0f6c('0x24')](_0x47efac['stack']);if(_0x47efac[_0x0f6c('0x36')]){delete _0x47efac[_0x0f6c('0x36')];}_0x2995f9[_0x0f6c('0x29')](_0x510705)[_0x0f6c('0x37')](_0x47efac);};}exports[_0x0f6c('0x38')]=function(_0x360534,_0x2cc6ef){var _0x29de7c={},_0x40ee79={},_0x1979a5={'count':0x0,'rows':[]};var _0x56b20a=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x2506a3){return{'name':_0x2506a3[_0x0f6c('0x39')],'type':_0x2506a3[_0x0f6c('0x3a')]['key']};});_0x40ee79[_0x0f6c('0x3b')]=_[_0x0f6c('0x3c')](_0x56b20a,'name');_0x40ee79[_0x0f6c('0x3d')]=_[_0x0f6c('0x3e')](_0x360534[_0x0f6c('0x3d')]);_0x40ee79[_0x0f6c('0x3f')]=_['intersection'](_0x40ee79[_0x0f6c('0x3b')],_0x40ee79['query']);_0x29de7c[_0x0f6c('0x40')]=_[_0x0f6c('0x41')](_0x40ee79[_0x0f6c('0x3b')],qs['fields'](_0x360534['query'][_0x0f6c('0x42')]));_0x29de7c['attributes']=_0x29de7c[_0x0f6c('0x40')][_0x0f6c('0x43')]?_0x29de7c[_0x0f6c('0x40')]:_0x40ee79[_0x0f6c('0x3b')];if(!_0x360534[_0x0f6c('0x3d')][_0x0f6c('0x44')]('nolimit')){_0x29de7c['limit']=qs[_0x0f6c('0x2e')](_0x360534['query'][_0x0f6c('0x2e')]);_0x29de7c[_0x0f6c('0x2c')]=qs[_0x0f6c('0x2c')](_0x360534['query'][_0x0f6c('0x2c')]);}_0x29de7c[_0x0f6c('0x45')]=qs[_0x0f6c('0x46')](_0x360534[_0x0f6c('0x3d')][_0x0f6c('0x46')]);_0x29de7c[_0x0f6c('0x47')]=qs[_0x0f6c('0x3f')](_['pick'](_0x360534[_0x0f6c('0x3d')],_0x40ee79[_0x0f6c('0x3f')]),_0x56b20a);if(_0x360534['query']['filter']){_0x29de7c[_0x0f6c('0x47')]=_[_0x0f6c('0x48')](_0x29de7c[_0x0f6c('0x47')],{'$or':_[_0x0f6c('0x3c')](_0x56b20a,function(_0x2314b1){if(_0x2314b1['type']!==_0x0f6c('0x49')){var _0x31d8cc={};_0x31d8cc[_0x2314b1[_0x0f6c('0x36')]]={'$like':'%'+_0x360534[_0x0f6c('0x3d')][_0x0f6c('0x4a')]+'%'};return _0x31d8cc;}})});}_0x29de7c=_[_0x0f6c('0x48')]({},_0x29de7c,_0x360534[_0x0f6c('0x4b')]);var _0xfb0d2b={'where':_0x29de7c[_0x0f6c('0x47')]};return db[_0x0f6c('0x4c')]['count'](_0xfb0d2b)[_0x0f6c('0x1d')](function(_0x2c7bb3){_0x1979a5[_0x0f6c('0x2f')]=_0x2c7bb3;if(_0x360534[_0x0f6c('0x3d')][_0x0f6c('0x4d')]){_0x29de7c[_0x0f6c('0x4e')]=[{'all':!![]}];}return db[_0x0f6c('0x4c')]['findAll'](_0x29de7c);})[_0x0f6c('0x1d')](function(_0x3389c7){_0x1979a5[_0x0f6c('0x4f')]=_0x3389c7;return _0x1979a5;})['then'](respondWithFilteredResult(_0x2cc6ef,_0x29de7c))[_0x0f6c('0x27')](handleError(_0x2cc6ef,null));};exports[_0x0f6c('0x50')]=function(_0x358280,_0x34b3be){var _0x546c0d={'raw':![],'where':{'id':_0x358280[_0x0f6c('0x51')]['id']}},_0x2ed30a={};_0x2ed30a[_0x0f6c('0x3b')]=_[_0x0f6c('0x3e')](db[_0x0f6c('0x4c')][_0x0f6c('0x52')]);_0x2ed30a[_0x0f6c('0x3d')]=_['keys'](_0x358280['query']);_0x2ed30a[_0x0f6c('0x3f')]=_[_0x0f6c('0x41')](_0x2ed30a[_0x0f6c('0x3b')],_0x2ed30a[_0x0f6c('0x3d')]);_0x546c0d[_0x0f6c('0x40')]=_[_0x0f6c('0x41')](_0x2ed30a[_0x0f6c('0x3b')],qs['fields'](_0x358280['query']['fields']));_0x546c0d[_0x0f6c('0x40')]=_0x546c0d['attributes'][_0x0f6c('0x43')]?_0x546c0d[_0x0f6c('0x40')]:_0x2ed30a[_0x0f6c('0x3b')];if(_0x358280[_0x0f6c('0x3d')][_0x0f6c('0x4d')]){_0x546c0d[_0x0f6c('0x4e')]=[{'all':!![]}];}_0x546c0d=_[_0x0f6c('0x48')]({},_0x546c0d,_0x358280[_0x0f6c('0x4b')]);return db[_0x0f6c('0x4c')][_0x0f6c('0x53')](_0x546c0d)[_0x0f6c('0x1d')](handleEntityNotFound(_0x34b3be,null))[_0x0f6c('0x1d')](respondWithResult(_0x34b3be,null))[_0x0f6c('0x27')](handleError(_0x34b3be,null));};exports[_0x0f6c('0x54')]=function(_0xf5a258,_0x5b52f0){return db[_0x0f6c('0x4c')][_0x0f6c('0x54')](_0xf5a258['body'],{})[_0x0f6c('0x1d')](respondWithResult(_0x5b52f0,0xc9))[_0x0f6c('0x27')](handleError(_0x5b52f0,null));};exports['update']=function(_0x2de72c,_0x4a84e2){if(_0x2de72c[_0x0f6c('0x55')]['id']){delete _0x2de72c[_0x0f6c('0x55')]['id'];}return db[_0x0f6c('0x4c')][_0x0f6c('0x53')]({'where':{'id':_0x2de72c[_0x0f6c('0x51')]['id']}})[_0x0f6c('0x1d')](handleEntityNotFound(_0x4a84e2,null))['then'](saveUpdates(_0x2de72c[_0x0f6c('0x55')],null))['then'](respondWithResult(_0x4a84e2,null))['catch'](handleError(_0x4a84e2,null));};exports[_0x0f6c('0x35')]=function(_0x4588e6,_0x67657){return db[_0x0f6c('0x4c')][_0x0f6c('0x53')]({'where':{'id':_0x4588e6[_0x0f6c('0x51')]['id']}})[_0x0f6c('0x1d')](handleEntityNotFound(_0x67657,null))[_0x0f6c('0x1d')](removeEntity(_0x67657,null))['catch'](handleError(_0x67657,null));};exports[_0x0f6c('0x56')]=function(_0x4fdca7,_0x96db53,_0x2cb3d3){var _0x8679fa={};var _0x26e086={};var _0x3383b4;var _0x3b626f;return db['Dynamics365Configuration'][_0x0f6c('0x57')]({'where':{'id':_0x4fdca7[_0x0f6c('0x51')]['id']}})[_0x0f6c('0x1d')](handleEntityNotFound(_0x96db53,null))[_0x0f6c('0x1d')](function(_0x2b7621){if(_0x2b7621){_0x3383b4=_0x2b7621;_0x26e086['model']=_[_0x0f6c('0x3e')](db[_0x0f6c('0x58')]['rawAttributes']);_0x26e086[_0x0f6c('0x3d')]=_['keys'](_0x4fdca7[_0x0f6c('0x3d')]);_0x26e086['filters']=_['intersection'](_0x26e086[_0x0f6c('0x3b')],_0x26e086['query']);_0x8679fa[_0x0f6c('0x40')]=_[_0x0f6c('0x41')](_0x26e086[_0x0f6c('0x3b')],qs[_0x0f6c('0x42')](_0x4fdca7['query']['fields']));_0x8679fa[_0x0f6c('0x40')]=_0x8679fa[_0x0f6c('0x40')][_0x0f6c('0x43')]?_0x8679fa[_0x0f6c('0x40')]:_0x26e086[_0x0f6c('0x3b')];_0x8679fa[_0x0f6c('0x45')]=qs[_0x0f6c('0x46')](_0x4fdca7[_0x0f6c('0x3d')][_0x0f6c('0x46')]);_0x8679fa[_0x0f6c('0x47')]=qs[_0x0f6c('0x3f')](_[_0x0f6c('0x59')](_0x4fdca7[_0x0f6c('0x3d')],_0x26e086[_0x0f6c('0x3f')]));if(_0x4fdca7['query'][_0x0f6c('0x4a')]){_0x8679fa[_0x0f6c('0x47')]=_[_0x0f6c('0x48')](_0x8679fa[_0x0f6c('0x47')],{'$or':_[_0x0f6c('0x3c')](_0x8679fa[_0x0f6c('0x40')],function(_0x5c7a8b){var _0x55fcc1={};_0x55fcc1[_0x5c7a8b]={'$like':'%'+_0x4fdca7[_0x0f6c('0x3d')][_0x0f6c('0x4a')]+'%'};return _0x55fcc1;})});}_0x8679fa=_[_0x0f6c('0x48')]({},_0x8679fa,_0x4fdca7[_0x0f6c('0x4b')]);return _0x3383b4[_0x0f6c('0x56')](_0x8679fa);}})[_0x0f6c('0x1d')](function(_0x57e8a0){if(_0x57e8a0){_0x3b626f=_0x57e8a0['length'];if(!_0x4fdca7[_0x0f6c('0x3d')][_0x0f6c('0x44')](_0x0f6c('0x5a'))){_0x8679fa['limit']=qs['limit'](_0x4fdca7[_0x0f6c('0x3d')]['limit']);_0x8679fa[_0x0f6c('0x2c')]=qs[_0x0f6c('0x2c')](_0x4fdca7['query']['offset']);}return _0x3383b4[_0x0f6c('0x56')](_0x8679fa);}})[_0x0f6c('0x1d')](function(_0x271d4b){if(_0x271d4b){return _0x271d4b?{'count':_0x3b626f,'rows':_0x271d4b}:null;}})['then'](respondWithResult(_0x96db53,null))[_0x0f6c('0x27')](handleError(_0x96db53,null));};exports['getSubjects']=function(_0x1df6c4,_0xbc0e13,_0x5f34cf){var _0x3726d6={};var _0x3bd11e={};var _0x1fc911;var _0x428f28;return db[_0x0f6c('0x4c')]['findOne']({'where':{'id':_0x1df6c4['params']['id']}})[_0x0f6c('0x1d')](handleEntityNotFound(_0xbc0e13,null))[_0x0f6c('0x1d')](function(_0x29f67d){if(_0x29f67d){_0x1fc911=_0x29f67d;_0x3bd11e['model']=_['keys'](db[_0x0f6c('0x58')][_0x0f6c('0x52')]);_0x3bd11e[_0x0f6c('0x3d')]=_['keys'](_0x1df6c4['query']);_0x3bd11e[_0x0f6c('0x3f')]=_['intersection'](_0x3bd11e[_0x0f6c('0x3b')],_0x3bd11e[_0x0f6c('0x3d')]);_0x3726d6[_0x0f6c('0x40')]=_[_0x0f6c('0x41')](_0x3bd11e[_0x0f6c('0x3b')],qs[_0x0f6c('0x42')](_0x1df6c4[_0x0f6c('0x3d')][_0x0f6c('0x42')]));_0x3726d6[_0x0f6c('0x40')]=_0x3726d6[_0x0f6c('0x40')][_0x0f6c('0x43')]?_0x3726d6['attributes']:_0x3bd11e['model'];_0x3726d6[_0x0f6c('0x45')]=qs['sort'](_0x1df6c4[_0x0f6c('0x3d')][_0x0f6c('0x46')]);_0x3726d6[_0x0f6c('0x47')]=qs[_0x0f6c('0x3f')](_[_0x0f6c('0x59')](_0x1df6c4[_0x0f6c('0x3d')],_0x3bd11e[_0x0f6c('0x3f')]));if(_0x1df6c4['query'][_0x0f6c('0x4a')]){_0x3726d6[_0x0f6c('0x47')]=_[_0x0f6c('0x48')](_0x3726d6[_0x0f6c('0x47')],{'$or':_[_0x0f6c('0x3c')](_0x3726d6[_0x0f6c('0x40')],function(_0x5a0ff7){var _0x2d44c6={};_0x2d44c6[_0x5a0ff7]={'$like':'%'+_0x1df6c4['query'][_0x0f6c('0x4a')]+'%'};return _0x2d44c6;})});}_0x3726d6=_[_0x0f6c('0x48')]({},_0x3726d6,_0x1df6c4[_0x0f6c('0x4b')]);return _0x1fc911[_0x0f6c('0x5b')](_0x3726d6);}})[_0x0f6c('0x1d')](function(_0x56178d){if(_0x56178d){_0x428f28=_0x56178d['length'];if(!_0x1df6c4[_0x0f6c('0x3d')][_0x0f6c('0x44')](_0x0f6c('0x5a'))){_0x3726d6[_0x0f6c('0x2e')]=qs[_0x0f6c('0x2e')](_0x1df6c4[_0x0f6c('0x3d')][_0x0f6c('0x2e')]);_0x3726d6['offset']=qs['offset'](_0x1df6c4['query'][_0x0f6c('0x2c')]);}return _0x1fc911[_0x0f6c('0x5b')](_0x3726d6);}})[_0x0f6c('0x1d')](function(_0x5d549b){if(_0x5d549b){return _0x5d549b?{'count':_0x428f28,'rows':_0x5d549b}:null;}})[_0x0f6c('0x1d')](respondWithResult(_0xbc0e13,null))[_0x0f6c('0x27')](handleError(_0xbc0e13,null));};exports[_0x0f6c('0x5c')]=function(_0x27b7ca,_0x675c94,_0x246842){var _0x4d34ab={};var _0x2f4fb2={};var _0xc81641;var _0x1aa668;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x27b7ca[_0x0f6c('0x51')]['id']}})[_0x0f6c('0x1d')](handleEntityNotFound(_0x675c94,null))[_0x0f6c('0x1d')](function(_0xb29c91){if(_0xb29c91){_0xc81641=_0xb29c91;_0x2f4fb2[_0x0f6c('0x3b')]=_['keys'](db[_0x0f6c('0x58')]['rawAttributes']);_0x2f4fb2['query']=_['keys'](_0x27b7ca[_0x0f6c('0x3d')]);_0x2f4fb2[_0x0f6c('0x3f')]=_[_0x0f6c('0x41')](_0x2f4fb2[_0x0f6c('0x3b')],_0x2f4fb2[_0x0f6c('0x3d')]);_0x4d34ab[_0x0f6c('0x40')]=_[_0x0f6c('0x41')](_0x2f4fb2[_0x0f6c('0x3b')],qs['fields'](_0x27b7ca[_0x0f6c('0x3d')][_0x0f6c('0x42')]));_0x4d34ab['attributes']=_0x4d34ab[_0x0f6c('0x40')][_0x0f6c('0x43')]?_0x4d34ab[_0x0f6c('0x40')]:_0x2f4fb2[_0x0f6c('0x3b')];_0x4d34ab[_0x0f6c('0x45')]=qs[_0x0f6c('0x46')](_0x27b7ca[_0x0f6c('0x3d')][_0x0f6c('0x46')]);_0x4d34ab[_0x0f6c('0x47')]=qs[_0x0f6c('0x3f')](_['pick'](_0x27b7ca[_0x0f6c('0x3d')],_0x2f4fb2['filters']));if(_0x27b7ca['query'][_0x0f6c('0x4a')]){_0x4d34ab[_0x0f6c('0x47')]=_['merge'](_0x4d34ab[_0x0f6c('0x47')],{'$or':_[_0x0f6c('0x3c')](_0x4d34ab[_0x0f6c('0x40')],function(_0x5c30ed){var _0x414ad6={};_0x414ad6[_0x5c30ed]={'$like':'%'+_0x27b7ca[_0x0f6c('0x3d')][_0x0f6c('0x4a')]+'%'};return _0x414ad6;})});}_0x4d34ab=_['merge']({},_0x4d34ab,_0x27b7ca[_0x0f6c('0x4b')]);return _0xc81641[_0x0f6c('0x5c')](_0x4d34ab);}})[_0x0f6c('0x1d')](function(_0x301030){if(_0x301030){_0x1aa668=_0x301030[_0x0f6c('0x43')];if(!_0x27b7ca[_0x0f6c('0x3d')][_0x0f6c('0x44')]('nolimit')){_0x4d34ab['limit']=qs[_0x0f6c('0x2e')](_0x27b7ca[_0x0f6c('0x3d')][_0x0f6c('0x2e')]);_0x4d34ab[_0x0f6c('0x2c')]=qs[_0x0f6c('0x2c')](_0x27b7ca[_0x0f6c('0x3d')][_0x0f6c('0x2c')]);}return _0xc81641[_0x0f6c('0x5c')](_0x4d34ab);}})[_0x0f6c('0x1d')](function(_0x1f7070){if(_0x1f7070){return _0x1f7070?{'count':_0x1aa668,'rows':_0x1f7070}:null;}})[_0x0f6c('0x1d')](respondWithResult(_0x675c94,null))[_0x0f6c('0x27')](handleError(_0x675c94,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index eaf66b4..ced1184 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 _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xe5b3,0x133));var _0x3e5b=function(_0x30bb07,_0x32682a){_0x30bb07=_0x30bb07-0x0;var _0x36a1d6=_0xe5b3[_0x30bb07];return _0x36a1d6;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x51c710,_0x168438){var _0x400168=function(_0x251e31){while(--_0x251e31){_0x51c710['push'](_0x51c710['shift']());}};_0x400168(++_0x168438);}(_0xedd9,0xfc));var _0x9edd=function(_0x5dac83,_0x5a5bae){_0x5dac83=_0x5dac83-0x0;var _0x4e9767=_0xedd9[_0x5dac83];return _0x4e9767;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 0125138..4930c81 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 _0x7c36=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','moment'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x7c36,0xfa));var _0x67c3=function(_0x18e617,_0xdc2aa1){_0x18e617=_0x18e617-0x0;var _0x525be6=_0x7c36[_0x18e617];return _0x525be6;};'use strict';var _=require(_0x67c3('0x0'));var util=require('util');var moment=require(_0x67c3('0x1'));var BPromise=require(_0x67c3('0x2'));var rs=require(_0x67c3('0x3'));var fs=require('fs');var Redis=require(_0x67c3('0x4'));var db=require(_0x67c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x67c3('0x6'))(_0x67c3('0x7'));var config=require(_0x67c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67c3('0x9')][_0x67c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24de7b,_0x3bd084,_0x202773){return new BPromise(function(_0x2b6451,_0x44ad14){return client['request'](_0x24de7b,_0x202773)[_0x67c3('0xb')](function(_0x24435b){logger['info'](_0x67c3('0xc'),_0x3bd084,'request\x20sent');logger['debug'](_0x67c3('0xd'),_0x3bd084,'request\x20sent',JSON[_0x67c3('0xe')](_0x24435b));if(_0x24435b[_0x67c3('0xf')]){if(_0x24435b[_0x67c3('0xf')]['code']===0x1f4){logger[_0x67c3('0xf')](_0x67c3('0xc'),_0x3bd084,_0x24435b[_0x67c3('0xf')][_0x67c3('0x10')]);return _0x44ad14(_0x24435b[_0x67c3('0xf')][_0x67c3('0x10')]);}logger[_0x67c3('0xf')](_0x67c3('0xc'),_0x3bd084,_0x24435b[_0x67c3('0xf')]['message']);return _0x2b6451(_0x24435b['error'][_0x67c3('0x10')]);}else{logger[_0x67c3('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3bd084,_0x67c3('0x12'));_0x2b6451(_0x24435b[_0x67c3('0x13')][_0x67c3('0x10')]);}})[_0x67c3('0x14')](function(_0x3b2148){logger['error'](_0x67c3('0xc'),_0x3bd084,_0x3b2148);_0x44ad14(_0x3b2148);});});} \ No newline at end of file +var _0xbee9=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x454338,_0x21e351){var _0x6687e6=function(_0x1bc6dd){while(--_0x1bc6dd){_0x454338['push'](_0x454338['shift']());}};_0x6687e6(++_0x21e351);}(_0xbee9,0x97));var _0x9bee=function(_0x571559,_0x23ae55){_0x571559=_0x571559-0x0;var _0x55eec2=_0xbee9[_0x571559];return _0x55eec2;};'use strict';var _=require(_0x9bee('0x0'));var util=require(_0x9bee('0x1'));var moment=require(_0x9bee('0x2'));var BPromise=require(_0x9bee('0x3'));var rs=require(_0x9bee('0x4'));var fs=require('fs');var Redis=require(_0x9bee('0x5'));var db=require(_0x9bee('0x6'))['db'];var utils=require(_0x9bee('0x7'));var logger=require(_0x9bee('0x8'))('rpc');var config=require(_0x9bee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9bee('0xa')][_0x9bee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x248727,_0x32cfd9,_0x12afd9){return new BPromise(function(_0x5ba700,_0x5c5982){return client[_0x9bee('0xc')](_0x248727,_0x12afd9)[_0x9bee('0xd')](function(_0x37ba5b){logger['info'](_0x9bee('0xe'),_0x32cfd9,_0x9bee('0xf'));logger[_0x9bee('0x10')](_0x9bee('0x11'),_0x32cfd9,_0x9bee('0xf'),JSON[_0x9bee('0x12')](_0x37ba5b));if(_0x37ba5b['error']){if(_0x37ba5b['error'][_0x9bee('0x13')]===0x1f4){logger[_0x9bee('0x14')](_0x9bee('0xe'),_0x32cfd9,_0x37ba5b[_0x9bee('0x14')]['message']);return _0x5c5982(_0x37ba5b['error'][_0x9bee('0x15')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x32cfd9,_0x37ba5b[_0x9bee('0x14')][_0x9bee('0x15')]);return _0x5ba700(_0x37ba5b['error']['message']);}else{logger['info'](_0x9bee('0xe'),_0x32cfd9,_0x9bee('0xf'));_0x5ba700(_0x37ba5b[_0x9bee('0x16')][_0x9bee('0x15')]);}})[_0x9bee('0x17')](function(_0x3ad49d){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x32cfd9,_0x3ad49d);_0x5c5982(_0x3ad49d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 6af4992..d3b1804 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 _0x5590=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer'];(function(_0x1d7eb1,_0x31f2a8){var _0x23f655=function(_0x47f740){while(--_0x47f740){_0x1d7eb1['push'](_0x1d7eb1['shift']());}};_0x23f655(++_0x31f2a8);}(_0x5590,0xaa));var _0x0559=function(_0x4d0ee9,_0x2c7166){_0x4d0ee9=_0x4d0ee9-0x0;var _0x47d782=_0x5590[_0x4d0ee9];return _0x47d782;};'use strict';var multer=require(_0x0559('0x0'));var util=require(_0x0559('0x1'));var path=require('path');var timeout=require(_0x0559('0x2'));var express=require('express');var router=express[_0x0559('0x3')]();var fs_extra=require(_0x0559('0x4'));var auth=require(_0x0559('0x5'));var interaction=require(_0x0559('0x6'));var config=require(_0x0559('0x7'));var controller=require(_0x0559('0x8'));router[_0x0559('0x9')]('/',auth[_0x0559('0xa')](),controller[_0x0559('0xb')]);router['get']('/:id',auth[_0x0559('0xa')](),controller[_0x0559('0xc')]);router['post']('/',auth[_0x0559('0xa')](),controller[_0x0559('0xd')]);router['put'](_0x0559('0xe'),auth['isAuthenticated'](),controller[_0x0559('0xf')]);router[_0x0559('0x10')](_0x0559('0xe'),auth[_0x0559('0xa')](),controller[_0x0559('0x11')]);module[_0x0559('0x12')]=router; \ No newline at end of file +var _0x785c=['get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller'];(function(_0x430829,_0x508486){var _0x5e756c=function(_0x18f7d2){while(--_0x18f7d2){_0x430829['push'](_0x430829['shift']());}};_0x5e756c(++_0x508486);}(_0x785c,0x1c0));var _0xc785=function(_0x5e2cde,_0x20dae0){_0x5e2cde=_0x5e2cde-0x0;var _0x33b759=_0x785c[_0x5e2cde];return _0x33b759;};'use strict';var multer=require(_0xc785('0x0'));var util=require(_0xc785('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc785('0x2'));var router=express[_0xc785('0x3')]();var fs_extra=require(_0xc785('0x4'));var auth=require(_0xc785('0x5'));var interaction=require(_0xc785('0x6'));var config=require('../../config/environment');var controller=require(_0xc785('0x7'));router[_0xc785('0x8')]('/',auth['isAuthenticated'](),controller[_0xc785('0x9')]);router['get']('/:id',auth[_0xc785('0xa')](),controller[_0xc785('0xb')]);router['post']('/',auth[_0xc785('0xa')](),controller[_0xc785('0xc')]);router[_0xc785('0xd')](_0xc785('0xe'),auth[_0xc785('0xa')](),controller[_0xc785('0xf')]);router[_0xc785('0x10')](_0xc785('0xe'),auth['isAuthenticated'](),controller[_0xc785('0x11')]);module[_0xc785('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a76fc45..6bba4de 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 _0xf751=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x204a15,_0x55b155){var _0x36ce8a=function(_0x1b4a2c){while(--_0x1b4a2c){_0x204a15['push'](_0x204a15['shift']());}};_0x36ce8a(++_0x55b155);}(_0xf751,0xac));var _0x1f75=function(_0x3e90e9,_0x1f2bcb){_0x3e90e9=_0x3e90e9-0x0;var _0x43e62b=_0xf751[_0x3e90e9];return _0x43e62b;};'use strict';var Sequelize=require(_0x1f75('0x0'));module[_0x1f75('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1f75('0x2'),_0x1f75('0x3'),_0x1f75('0x4'),_0x1f75('0x5'),'picklist'),'defaultValue':_0x1f75('0x2')},'content':{'type':Sequelize[_0x1f75('0x6')]},'key':{'type':Sequelize[_0x1f75('0x6')]},'keyType':{'type':Sequelize[_0x1f75('0x7')](_0x1f75('0x2'),_0x1f75('0x3'),_0x1f75('0x4'))},'keyContent':{'type':Sequelize[_0x1f75('0x6')]},'idField':{'type':Sequelize[_0x1f75('0x6')]},'nameField':{'type':Sequelize[_0x1f75('0x6')]},'customField':{'type':Sequelize[_0x1f75('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f75('0x6')]}}; \ No newline at end of file +var _0x8129=['keyValue','picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x8129,0xf4));var _0x9812=function(_0x1f4241,_0x51a7f6){_0x1f4241=_0x1f4241-0x0;var _0x4348c1=_0x8129[_0x1f4241];return _0x4348c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9812('0x0')](_0x9812('0x1'),_0x9812('0x2'),_0x9812('0x3'),_0x9812('0x4'),_0x9812('0x5')),'defaultValue':_0x9812('0x1')},'content':{'type':Sequelize[_0x9812('0x6')]},'key':{'type':Sequelize[_0x9812('0x6')]},'keyType':{'type':Sequelize[_0x9812('0x0')]('string',_0x9812('0x2'),_0x9812('0x3'))},'keyContent':{'type':Sequelize[_0x9812('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9812('0x6')]},'customField':{'type':Sequelize[_0x9812('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9812('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ee1b6e7..d16701c 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 _0xbd1a=['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/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x5a2c92,_0x13c851){var _0xaf6cf7=function(_0x2bc2f6){while(--_0x2bc2f6){_0x5a2c92['push'](_0x5a2c92['shift']());}};_0xaf6cf7(++_0x13c851);}(_0xbd1a,0x90));var _0xabd1=function(_0x31a16a,_0x1d60e3){_0x31a16a=_0x31a16a-0x0;var _0x21c892=_0xbd1a[_0x31a16a];return _0x21c892;};'use strict';var emlformat=require(_0xabd1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xabd1('0x1'));var rp=require('request-promise');var moment=require(_0xabd1('0x2'));var BPromise=require(_0xabd1('0x3'));var Mustache=require(_0xabd1('0x4'));var util=require(_0xabd1('0x5'));var path=require(_0xabd1('0x6'));var sox=require(_0xabd1('0x7'));var csv=require('to-csv');var ejs=require(_0xabd1('0x8'));var fs=require('fs');var fs_extra=require(_0xabd1('0x9'));var _=require(_0xabd1('0xa'));var squel=require(_0xabd1('0xb'));var crypto=require(_0xabd1('0xc'));var jsforce=require(_0xabd1('0xd'));var deskjs=require(_0xabd1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xabd1('0xf'));var Papa=require(_0xabd1('0x10'));var Redis=require('ioredis');var authService=require(_0xabd1('0x11'));var qs=require(_0xabd1('0x12'));var as=require(_0xabd1('0x13'));var hardwareService=require(_0xabd1('0x14'));var logger=require(_0xabd1('0x15'))(_0xabd1('0x16'));var utils=require(_0xabd1('0x17'));var config=require(_0xabd1('0x18'));var licenseUtil=require(_0xabd1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e1dba,_0x6ccea5){_0x6ccea5=_0x6ccea5||0xcc;return function(_0xe3b3c6){if(_0xe3b3c6){return _0x1e1dba[_0xabd1('0x1a')](_0x6ccea5);}return _0x1e1dba[_0xabd1('0x1b')](_0x6ccea5)[_0xabd1('0x1c')]();};}function respondWithResult(_0x1d2969,_0xc9090b){_0xc9090b=_0xc9090b||0xc8;return function(_0x9c0d0b){if(_0x9c0d0b){return _0x1d2969[_0xabd1('0x1b')](_0xc9090b)['json'](_0x9c0d0b);}};}function respondWithFilteredResult(_0x25e2b3,_0x1282fe){return function(_0x4f1671){if(_0x4f1671){var _0x2ec2a1=typeof _0x1282fe[_0xabd1('0x1d')]===_0xabd1('0x1e')&&typeof _0x1282fe['limit']===_0xabd1('0x1e');var _0x429e44=_0x4f1671[_0xabd1('0x1f')];var _0x1cea4a=_0x2ec2a1?0x0:_0x1282fe[_0xabd1('0x1d')];var _0x516e6f=_0x2ec2a1?_0x4f1671[_0xabd1('0x1f')]:_0x1282fe[_0xabd1('0x1d')]+_0x1282fe[_0xabd1('0x20')];var _0x13d629;if(_0x516e6f>=_0x429e44){_0x516e6f=_0x429e44;_0x13d629=0xc8;}else{_0x13d629=0xce;}_0x25e2b3['status'](_0x13d629);return _0x25e2b3['set'](_0xabd1('0x21'),_0x1cea4a+'-'+_0x516e6f+'/'+_0x429e44)[_0xabd1('0x22')](_0x4f1671);}return null;};}function patchUpdates(_0x59bbec){return function(_0x526b57){try{jsonpatch[_0xabd1('0x23')](_0x526b57,_0x59bbec,!![]);}catch(_0x44d472){return BPromise[_0xabd1('0x24')](_0x44d472);}return _0x526b57['save']();};}function saveUpdates(_0x2c33da,_0x39a883){return function(_0x1bd3b3){if(_0x1bd3b3){return _0x1bd3b3['update'](_0x2c33da)[_0xabd1('0x25')](function(_0x695560){return _0x695560;});}return null;};}function removeEntity(_0x5cb02c,_0x32f890){return function(_0x1ae1ae){if(_0x1ae1ae){return _0x1ae1ae[_0xabd1('0x26')]()[_0xabd1('0x25')](function(){_0x5cb02c[_0xabd1('0x1b')](0xcc)[_0xabd1('0x1c')]();});}};}function handleEntityNotFound(_0x2d3680,_0x3fd91c){return function(_0x24efe1){if(!_0x24efe1){_0x2d3680[_0xabd1('0x1a')](0x194);}return _0x24efe1;};}function handleError(_0x15be36,_0x3c1520){_0x3c1520=_0x3c1520||0x1f4;return function(_0x35f922){logger[_0xabd1('0x27')](_0x35f922['stack']);if(_0x35f922[_0xabd1('0x28')]){delete _0x35f922[_0xabd1('0x28')];}_0x15be36[_0xabd1('0x1b')](_0x3c1520)[_0xabd1('0x29')](_0x35f922);};}exports[_0xabd1('0x2a')]=function(_0x7f7469,_0x2e10b9){var _0xdb907f={},_0x1dd4d2={},_0xb1dc03={'count':0x0,'rows':[]};var _0x4c6403=_[_0xabd1('0x2b')](db[_0xabd1('0x2c')][_0xabd1('0x2d')],function(_0x39c76f){return{'name':_0x39c76f[_0xabd1('0x2e')],'type':_0x39c76f[_0xabd1('0x2f')][_0xabd1('0x30')]};});_0x1dd4d2['model']=_[_0xabd1('0x2b')](_0x4c6403,_0xabd1('0x28'));_0x1dd4d2[_0xabd1('0x31')]=_[_0xabd1('0x32')](_0x7f7469[_0xabd1('0x31')]);_0x1dd4d2[_0xabd1('0x33')]=_['intersection'](_0x1dd4d2['model'],_0x1dd4d2[_0xabd1('0x31')]);_0xdb907f['attributes']=_[_0xabd1('0x34')](_0x1dd4d2['model'],qs[_0xabd1('0x35')](_0x7f7469[_0xabd1('0x31')][_0xabd1('0x35')]));_0xdb907f[_0xabd1('0x36')]=_0xdb907f[_0xabd1('0x36')]['length']?_0xdb907f[_0xabd1('0x36')]:_0x1dd4d2[_0xabd1('0x37')];if(!_0x7f7469[_0xabd1('0x31')][_0xabd1('0x38')](_0xabd1('0x39'))){_0xdb907f[_0xabd1('0x20')]=qs[_0xabd1('0x20')](_0x7f7469[_0xabd1('0x31')][_0xabd1('0x20')]);_0xdb907f[_0xabd1('0x1d')]=qs[_0xabd1('0x1d')](_0x7f7469[_0xabd1('0x31')]['offset']);}_0xdb907f[_0xabd1('0x3a')]=qs['sort'](_0x7f7469[_0xabd1('0x31')][_0xabd1('0x3b')]);_0xdb907f[_0xabd1('0x3c')]=qs[_0xabd1('0x33')](_[_0xabd1('0x3d')](_0x7f7469[_0xabd1('0x31')],_0x1dd4d2[_0xabd1('0x33')]),_0x4c6403);if(_0x7f7469['query'][_0xabd1('0x3e')]){_0xdb907f['where']=_[_0xabd1('0x3f')](_0xdb907f['where'],{'$or':_[_0xabd1('0x2b')](_0x4c6403,function(_0x360c25){if(_0x360c25[_0xabd1('0x2f')]!==_0xabd1('0x40')){var _0x21a00c={};_0x21a00c[_0x360c25[_0xabd1('0x28')]]={'$like':'%'+_0x7f7469[_0xabd1('0x31')][_0xabd1('0x3e')]+'%'};return _0x21a00c;}})});}_0xdb907f=_['merge']({},_0xdb907f,_0x7f7469['options']);var _0x777d4f={'where':_0xdb907f[_0xabd1('0x3c')]};return db[_0xabd1('0x2c')][_0xabd1('0x1f')](_0x777d4f)['then'](function(_0xbc760e){_0xb1dc03[_0xabd1('0x1f')]=_0xbc760e;if(_0x7f7469['query'][_0xabd1('0x41')]){_0xdb907f[_0xabd1('0x42')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0xdb907f);})[_0xabd1('0x25')](function(_0x33584b){_0xb1dc03[_0xabd1('0x43')]=_0x33584b;return _0xb1dc03;})[_0xabd1('0x25')](respondWithFilteredResult(_0x2e10b9,_0xdb907f))[_0xabd1('0x44')](handleError(_0x2e10b9,null));};exports[_0xabd1('0x45')]=function(_0xced3a4,_0x1c261b){var _0x40109d={'raw':!![],'where':{'id':_0xced3a4[_0xabd1('0x46')]['id']}},_0x15c4f9={};_0x15c4f9[_0xabd1('0x37')]=_[_0xabd1('0x32')](db[_0xabd1('0x2c')][_0xabd1('0x2d')]);_0x15c4f9[_0xabd1('0x31')]=_[_0xabd1('0x32')](_0xced3a4[_0xabd1('0x31')]);_0x15c4f9[_0xabd1('0x33')]=_[_0xabd1('0x34')](_0x15c4f9['model'],_0x15c4f9[_0xabd1('0x31')]);_0x40109d['attributes']=_[_0xabd1('0x34')](_0x15c4f9[_0xabd1('0x37')],qs[_0xabd1('0x35')](_0xced3a4[_0xabd1('0x31')][_0xabd1('0x35')]));_0x40109d['attributes']=_0x40109d['attributes'][_0xabd1('0x47')]?_0x40109d[_0xabd1('0x36')]:_0x15c4f9[_0xabd1('0x37')];if(_0xced3a4['query'][_0xabd1('0x41')]){_0x40109d['include']=[{'all':!![]}];}_0x40109d=_[_0xabd1('0x3f')]({},_0x40109d,_0xced3a4[_0xabd1('0x48')]);return db[_0xabd1('0x2c')][_0xabd1('0x49')](_0x40109d)[_0xabd1('0x25')](handleEntityNotFound(_0x1c261b,null))[_0xabd1('0x25')](respondWithResult(_0x1c261b,null))['catch'](handleError(_0x1c261b,null));};exports[_0xabd1('0x4a')]=function(_0x55a3a4,_0x11b05e){return db[_0xabd1('0x2c')][_0xabd1('0x4a')](_0x55a3a4[_0xabd1('0x4b')],{})[_0xabd1('0x25')](respondWithResult(_0x11b05e,0xc9))['catch'](handleError(_0x11b05e,null));};exports['update']=function(_0x53ba07,_0x5c9524){if(_0x53ba07['body']['id']){delete _0x53ba07[_0xabd1('0x4b')]['id'];}return db['Dynamics365Field'][_0xabd1('0x49')]({'where':{'id':_0x53ba07[_0xabd1('0x46')]['id']}})[_0xabd1('0x25')](handleEntityNotFound(_0x5c9524,null))[_0xabd1('0x25')](saveUpdates(_0x53ba07[_0xabd1('0x4b')],null))[_0xabd1('0x25')](respondWithResult(_0x5c9524,null))[_0xabd1('0x44')](handleError(_0x5c9524,null));};exports[_0xabd1('0x26')]=function(_0x26e426,_0x5075e6){return db['Dynamics365Field']['find']({'where':{'id':_0x26e426[_0xabd1('0x46')]['id']}})[_0xabd1('0x25')](handleEntityNotFound(_0x5075e6,null))[_0xabd1('0x25')](removeEntity(_0x5075e6,null))[_0xabd1('0x44')](handleError(_0x5075e6,null));}; \ No newline at end of file +var _0xc0c2=['count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Dynamics365Field','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','includeAll','include','catch','show','params','keys','fields','merge','options','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','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/license/util','status','json','undefined','limit'];(function(_0x598aaf,_0xb2b2c1){var _0x592139=function(_0x4eab4e){while(--_0x4eab4e){_0x598aaf['push'](_0x598aaf['shift']());}};_0x592139(++_0xb2b2c1);}(_0xc0c2,0x14d));var _0x2c0c=function(_0xccd9b7,_0x2ea6bd){_0xccd9b7=_0xccd9b7-0x0;var _0x26301d=_0xc0c2[_0xccd9b7];return _0x26301d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c0c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2c0c('0x1'));var moment=require(_0x2c0c('0x2'));var BPromise=require(_0x2c0c('0x3'));var Mustache=require(_0x2c0c('0x4'));var util=require(_0x2c0c('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2c0c('0x6'));var fs=require('fs');var fs_extra=require(_0x2c0c('0x7'));var _=require(_0x2c0c('0x8'));var squel=require(_0x2c0c('0x9'));var crypto=require(_0x2c0c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2c0c('0xb'));var toCsv=require(_0x2c0c('0xc'));var querystring=require(_0x2c0c('0xd'));var Papa=require(_0x2c0c('0xe'));var Redis=require(_0x2c0c('0xf'));var authService=require(_0x2c0c('0x10'));var qs=require(_0x2c0c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c0c('0x12'));var logger=require(_0x2c0c('0x13'))(_0x2c0c('0x14'));var utils=require(_0x2c0c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2c0c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc00fd3,_0x5c5042){_0x5c5042=_0x5c5042||0xcc;return function(_0x4b1815){if(_0x4b1815){return _0xc00fd3['sendStatus'](_0x5c5042);}return _0xc00fd3[_0x2c0c('0x17')](_0x5c5042)['end']();};}function respondWithResult(_0x39150a,_0x511215){_0x511215=_0x511215||0xc8;return function(_0x37674){if(_0x37674){return _0x39150a[_0x2c0c('0x17')](_0x511215)[_0x2c0c('0x18')](_0x37674);}};}function respondWithFilteredResult(_0x110a45,_0x1412e9){return function(_0x1a41c8){if(_0x1a41c8){var _0x323d6f=typeof _0x1412e9['offset']===_0x2c0c('0x19')&&typeof _0x1412e9[_0x2c0c('0x1a')]===_0x2c0c('0x19');var _0x3ceb4f=_0x1a41c8[_0x2c0c('0x1b')];var _0x1d8150=_0x323d6f?0x0:_0x1412e9[_0x2c0c('0x1c')];var _0x1a9faa=_0x323d6f?_0x1a41c8[_0x2c0c('0x1b')]:_0x1412e9[_0x2c0c('0x1c')]+_0x1412e9[_0x2c0c('0x1a')];var _0x2a6d7e;if(_0x1a9faa>=_0x3ceb4f){_0x1a9faa=_0x3ceb4f;_0x2a6d7e=0xc8;}else{_0x2a6d7e=0xce;}_0x110a45[_0x2c0c('0x17')](_0x2a6d7e);return _0x110a45[_0x2c0c('0x1d')](_0x2c0c('0x1e'),_0x1d8150+'-'+_0x1a9faa+'/'+_0x3ceb4f)[_0x2c0c('0x18')](_0x1a41c8);}return null;};}function patchUpdates(_0x15014b){return function(_0x13d397){try{jsonpatch[_0x2c0c('0x1f')](_0x13d397,_0x15014b,!![]);}catch(_0x1e719a){return BPromise[_0x2c0c('0x20')](_0x1e719a);}return _0x13d397[_0x2c0c('0x21')]();};}function saveUpdates(_0x2c55a6,_0x2c213c){return function(_0x310b24){if(_0x310b24){return _0x310b24[_0x2c0c('0x22')](_0x2c55a6)[_0x2c0c('0x23')](function(_0x41993e){return _0x41993e;});}return null;};}function removeEntity(_0x254478,_0xd0c23){return function(_0x438399){if(_0x438399){return _0x438399[_0x2c0c('0x24')]()[_0x2c0c('0x23')](function(){_0x254478['status'](0xcc)[_0x2c0c('0x25')]();});}};}function handleEntityNotFound(_0x321182,_0x4d3355){return function(_0x2711cf){if(!_0x2711cf){_0x321182['sendStatus'](0x194);}return _0x2711cf;};}function handleError(_0x34581d,_0x2a3043){_0x2a3043=_0x2a3043||0x1f4;return function(_0x35bec5){logger[_0x2c0c('0x26')](_0x35bec5[_0x2c0c('0x27')]);if(_0x35bec5[_0x2c0c('0x28')]){delete _0x35bec5[_0x2c0c('0x28')];}_0x34581d[_0x2c0c('0x17')](_0x2a3043)['send'](_0x35bec5);};}exports[_0x2c0c('0x29')]=function(_0x148eb8,_0x1583e){var _0x24b4ca={},_0x1741e5={},_0x1b3e3d={'count':0x0,'rows':[]};var _0x5b7ba0=_[_0x2c0c('0x2a')](db[_0x2c0c('0x2b')]['rawAttributes'],function(_0x15f816){return{'name':_0x15f816[_0x2c0c('0x2c')],'type':_0x15f816[_0x2c0c('0x2d')][_0x2c0c('0x2e')]};});_0x1741e5[_0x2c0c('0x2f')]=_['map'](_0x5b7ba0,_0x2c0c('0x28'));_0x1741e5[_0x2c0c('0x30')]=_['keys'](_0x148eb8[_0x2c0c('0x30')]);_0x1741e5[_0x2c0c('0x31')]=_[_0x2c0c('0x32')](_0x1741e5['model'],_0x1741e5[_0x2c0c('0x30')]);_0x24b4ca['attributes']=_[_0x2c0c('0x32')](_0x1741e5[_0x2c0c('0x2f')],qs['fields'](_0x148eb8[_0x2c0c('0x30')]['fields']));_0x24b4ca[_0x2c0c('0x33')]=_0x24b4ca['attributes'][_0x2c0c('0x34')]?_0x24b4ca[_0x2c0c('0x33')]:_0x1741e5['model'];if(!_0x148eb8[_0x2c0c('0x30')][_0x2c0c('0x35')]('nolimit')){_0x24b4ca[_0x2c0c('0x1a')]=qs['limit'](_0x148eb8[_0x2c0c('0x30')]['limit']);_0x24b4ca[_0x2c0c('0x1c')]=qs[_0x2c0c('0x1c')](_0x148eb8[_0x2c0c('0x30')][_0x2c0c('0x1c')]);}_0x24b4ca[_0x2c0c('0x36')]=qs['sort'](_0x148eb8[_0x2c0c('0x30')][_0x2c0c('0x37')]);_0x24b4ca[_0x2c0c('0x38')]=qs[_0x2c0c('0x31')](_[_0x2c0c('0x39')](_0x148eb8[_0x2c0c('0x30')],_0x1741e5[_0x2c0c('0x31')]),_0x5b7ba0);if(_0x148eb8[_0x2c0c('0x30')][_0x2c0c('0x3a')]){_0x24b4ca[_0x2c0c('0x38')]=_['merge'](_0x24b4ca[_0x2c0c('0x38')],{'$or':_[_0x2c0c('0x2a')](_0x5b7ba0,function(_0x4f7060){if(_0x4f7060[_0x2c0c('0x2d')]!==_0x2c0c('0x3b')){var _0x154475={};_0x154475[_0x4f7060[_0x2c0c('0x28')]]={'$like':'%'+_0x148eb8[_0x2c0c('0x30')][_0x2c0c('0x3a')]+'%'};return _0x154475;}})});}_0x24b4ca=_['merge']({},_0x24b4ca,_0x148eb8['options']);var _0xc22730={'where':_0x24b4ca[_0x2c0c('0x38')]};return db['Dynamics365Field'][_0x2c0c('0x1b')](_0xc22730)[_0x2c0c('0x23')](function(_0xc59a5b){_0x1b3e3d[_0x2c0c('0x1b')]=_0xc59a5b;if(_0x148eb8[_0x2c0c('0x30')][_0x2c0c('0x3c')]){_0x24b4ca[_0x2c0c('0x3d')]=[{'all':!![]}];}return db[_0x2c0c('0x2b')]['findAll'](_0x24b4ca);})[_0x2c0c('0x23')](function(_0x19ff55){_0x1b3e3d['rows']=_0x19ff55;return _0x1b3e3d;})['then'](respondWithFilteredResult(_0x1583e,_0x24b4ca))[_0x2c0c('0x3e')](handleError(_0x1583e,null));};exports[_0x2c0c('0x3f')]=function(_0x5712af,_0x1c768e){var _0x9eb401={'raw':!![],'where':{'id':_0x5712af[_0x2c0c('0x40')]['id']}},_0x4f83dc={};_0x4f83dc['model']=_[_0x2c0c('0x41')](db[_0x2c0c('0x2b')]['rawAttributes']);_0x4f83dc[_0x2c0c('0x30')]=_[_0x2c0c('0x41')](_0x5712af['query']);_0x4f83dc[_0x2c0c('0x31')]=_[_0x2c0c('0x32')](_0x4f83dc[_0x2c0c('0x2f')],_0x4f83dc['query']);_0x9eb401['attributes']=_[_0x2c0c('0x32')](_0x4f83dc['model'],qs[_0x2c0c('0x42')](_0x5712af[_0x2c0c('0x30')][_0x2c0c('0x42')]));_0x9eb401[_0x2c0c('0x33')]=_0x9eb401[_0x2c0c('0x33')][_0x2c0c('0x34')]?_0x9eb401[_0x2c0c('0x33')]:_0x4f83dc[_0x2c0c('0x2f')];if(_0x5712af[_0x2c0c('0x30')][_0x2c0c('0x3c')]){_0x9eb401[_0x2c0c('0x3d')]=[{'all':!![]}];}_0x9eb401=_[_0x2c0c('0x43')]({},_0x9eb401,_0x5712af[_0x2c0c('0x44')]);return db['Dynamics365Field'][_0x2c0c('0x45')](_0x9eb401)[_0x2c0c('0x23')](handleEntityNotFound(_0x1c768e,null))[_0x2c0c('0x23')](respondWithResult(_0x1c768e,null))[_0x2c0c('0x3e')](handleError(_0x1c768e,null));};exports[_0x2c0c('0x46')]=function(_0x555f45,_0x2a913d){return db[_0x2c0c('0x2b')][_0x2c0c('0x46')](_0x555f45[_0x2c0c('0x47')],{})[_0x2c0c('0x23')](respondWithResult(_0x2a913d,0xc9))[_0x2c0c('0x3e')](handleError(_0x2a913d,null));};exports[_0x2c0c('0x22')]=function(_0x163e33,_0x5c2015){if(_0x163e33[_0x2c0c('0x47')]['id']){delete _0x163e33[_0x2c0c('0x47')]['id'];}return db[_0x2c0c('0x2b')][_0x2c0c('0x45')]({'where':{'id':_0x163e33[_0x2c0c('0x40')]['id']}})[_0x2c0c('0x23')](handleEntityNotFound(_0x5c2015,null))[_0x2c0c('0x23')](saveUpdates(_0x163e33[_0x2c0c('0x47')],null))['then'](respondWithResult(_0x5c2015,null))[_0x2c0c('0x3e')](handleError(_0x5c2015,null));};exports[_0x2c0c('0x24')]=function(_0x33b5ab,_0x330166){return db[_0x2c0c('0x2b')]['find']({'where':{'id':_0x33b5ab['params']['id']}})[_0x2c0c('0x23')](handleEntityNotFound(_0x330166,null))[_0x2c0c('0x23')](removeEntity(_0x330166,null))['catch'](handleError(_0x330166,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index d2b4b0c..4405418 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 _0x77a4=['lodash','util','api','moment','bluebird','request-promise','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId'];(function(_0x130c28,_0x5ac312){var _0x1a7ced=function(_0x353911){while(--_0x353911){_0x130c28['push'](_0x130c28['shift']());}};_0x1a7ced(++_0x5ac312);}(_0x77a4,0x15f));var _0x477a=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0x77a4[_0x3a13cf];return _0x4817c;};'use strict';var _=require(_0x477a('0x0'));var util=require(_0x477a('0x1'));var logger=require('../../config/logger')(_0x477a('0x2'));var moment=require(_0x477a('0x3'));var BPromise=require(_0x477a('0x4'));var rp=require(_0x477a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x477a('0x6'));var config=require('../../config/environment');var attributes=require(_0x477a('0x7'));module['exports']=function(_0x15965e,_0x4c49dd){return _0x15965e[_0x477a('0x8')](_0x477a('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x477a('0xa'),'fields':[_0x477a('0xb'),_0x477a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b43=['path','rimraf','../../config/environment','exports','Dynamics365Field','int_dynamics365_fields','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7b43,0x1c1));var _0x37b4=function(_0x44b40c,_0x5c4838){_0x44b40c=_0x44b40c-0x0;var _0x543e38=_0x7b43[_0x44b40c];return _0x543e38;};'use strict';var _=require(_0x37b4('0x0'));var util=require(_0x37b4('0x1'));var logger=require(_0x37b4('0x2'))(_0x37b4('0x3'));var moment=require(_0x37b4('0x4'));var BPromise=require(_0x37b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37b4('0x6'));var rimraf=require(_0x37b4('0x7'));var config=require(_0x37b4('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x37b4('0x9')]=function(_0x3e807f,_0x38b8c4){return _0x3e807f['define'](_0x37b4('0xa'),attributes,{'tableName':_0x37b4('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x37b4('0xc'),'FieldId'],'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 10c8694..b051d8f 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 _0x772f=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x772f,0xbb));var _0xf772=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x772f[_0x308213];return _0x2e1619;};'use strict';var _=require(_0xf772('0x0'));var util=require(_0xf772('0x1'));var moment=require(_0xf772('0x2'));var BPromise=require(_0xf772('0x3'));var rs=require(_0xf772('0x4'));var fs=require('fs');var Redis=require(_0xf772('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf772('0x6'));var logger=require(_0xf772('0x7'))(_0xf772('0x8'));var config=require(_0xf772('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf772('0xa')][_0xf772('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cb72a,_0x317331,_0x4167a9){return new BPromise(function(_0x584d77,_0x4ebc58){return client[_0xf772('0xc')](_0x3cb72a,_0x4167a9)[_0xf772('0xd')](function(_0x194166){logger[_0xf772('0xe')](_0xf772('0xf'),_0x317331,_0xf772('0x10'));logger[_0xf772('0x11')](_0xf772('0x12'),_0x317331,'request\x20sent',JSON['stringify'](_0x194166));if(_0x194166[_0xf772('0x13')]){if(_0x194166[_0xf772('0x13')][_0xf772('0x14')]===0x1f4){logger[_0xf772('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x317331,_0x194166[_0xf772('0x13')][_0xf772('0x15')]);return _0x4ebc58(_0x194166[_0xf772('0x13')]['message']);}logger[_0xf772('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x317331,_0x194166[_0xf772('0x13')][_0xf772('0x15')]);return _0x584d77(_0x194166[_0xf772('0x13')][_0xf772('0x15')]);}else{logger[_0xf772('0xe')](_0xf772('0xf'),_0x317331,_0xf772('0x10'));_0x584d77(_0x194166[_0xf772('0x16')][_0xf772('0x15')]);}})['catch'](function(_0x243a94){logger[_0xf772('0x13')](_0xf772('0xf'),_0x317331,_0x243a94);_0x4ebc58(_0x243a94);});});} \ No newline at end of file +var _0xc072=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x3e3ef6,_0x4d93bc){var _0x56fb38=function(_0x4596c6){while(--_0x4596c6){_0x3e3ef6['push'](_0x3e3ef6['shift']());}};_0x56fb38(++_0x4d93bc);}(_0xc072,0x1dd));var _0x2c07=function(_0x1ab96c,_0xc77804){_0x1ab96c=_0x1ab96c-0x0;var _0x185823=_0xc072[_0x1ab96c];return _0x185823;};'use strict';var _=require(_0x2c07('0x0'));var util=require(_0x2c07('0x1'));var moment=require(_0x2c07('0x2'));var BPromise=require(_0x2c07('0x3'));var rs=require(_0x2c07('0x4'));var fs=require('fs');var Redis=require(_0x2c07('0x5'));var db=require(_0x2c07('0x6'))['db'];var utils=require(_0x2c07('0x7'));var logger=require(_0x2c07('0x8'))(_0x2c07('0x9'));var config=require('../../config/environment');var jayson=require(_0x2c07('0xa'));var client=jayson[_0x2c07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x214387,_0x153b1f,_0x56e4df){return new BPromise(function(_0x53711b,_0x4caf36){return client[_0x2c07('0xc')](_0x214387,_0x56e4df)[_0x2c07('0xd')](function(_0x529e69){logger[_0x2c07('0xe')](_0x2c07('0xf'),_0x153b1f,_0x2c07('0x10'));logger[_0x2c07('0x11')](_0x2c07('0x12'),_0x153b1f,_0x2c07('0x10'),JSON[_0x2c07('0x13')](_0x529e69));if(_0x529e69['error']){if(_0x529e69[_0x2c07('0x14')]['code']===0x1f4){logger[_0x2c07('0x14')](_0x2c07('0xf'),_0x153b1f,_0x529e69[_0x2c07('0x14')]['message']);return _0x4caf36(_0x529e69[_0x2c07('0x14')][_0x2c07('0x15')]);}logger[_0x2c07('0x14')](_0x2c07('0xf'),_0x153b1f,_0x529e69['error'][_0x2c07('0x15')]);return _0x53711b(_0x529e69[_0x2c07('0x14')][_0x2c07('0x15')]);}else{logger['info'](_0x2c07('0xf'),_0x153b1f,_0x2c07('0x10'));_0x53711b(_0x529e69[_0x2c07('0x16')][_0x2c07('0x15')]);}})[_0x2c07('0x17')](function(_0x34f125){logger[_0x2c07('0x14')](_0x2c07('0xf'),_0x153b1f,_0x34f125);_0x4caf36(_0x34f125);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index ff13add..98eb85f 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 _0x74ca=['./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e6702,_0x4c8d19){var _0x5debfe=function(_0x1a4275){while(--_0x1a4275){_0x1e6702['push'](_0x1e6702['shift']());}};_0x5debfe(++_0x4c8d19);}(_0x74ca,0x8b));var _0xa74c=function(_0x350507,_0x5599cc){_0x350507=_0x350507-0x0;var _0x3d8898=_0x74ca[_0x350507];return _0x3d8898;};'use strict';var multer=require(_0xa74c('0x0'));var util=require(_0xa74c('0x1'));var path=require(_0xa74c('0x2'));var timeout=require(_0xa74c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa74c('0x4'));var auth=require(_0xa74c('0x5'));var interaction=require(_0xa74c('0x6'));var config=require(_0xa74c('0x7'));var controller=require(_0xa74c('0x8'));router[_0xa74c('0x9')]('/',auth[_0xa74c('0xa')](),controller['index']);router['get'](_0xa74c('0xb'),auth[_0xa74c('0xa')](),controller[_0xa74c('0xc')]);router[_0xa74c('0x9')](_0xa74c('0xd'),auth[_0xa74c('0xa')](),controller[_0xa74c('0xe')]);router['get'](_0xa74c('0xf'),auth[_0xa74c('0xa')](),controller[_0xa74c('0x10')]);router[_0xa74c('0x11')]('/',auth[_0xa74c('0xa')](),controller['create']);router[_0xa74c('0x11')](_0xa74c('0xd'),auth['isAuthenticated'](),controller[_0xa74c('0x12')]);router[_0xa74c('0x13')](_0xa74c('0xb'),auth[_0xa74c('0xa')](),controller[_0xa74c('0x14')]);router['delete']('/:id',auth[_0xa74c('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb630=['get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','update','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x544e46,_0xf1cc88){var _0x5d9d89=function(_0x5855ef){while(--_0x5855ef){_0x544e46['push'](_0x544e46['shift']());}};_0x5d9d89(++_0xf1cc88);}(_0xb630,0xa1));var _0x0b63=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xb630[_0x5f5cce];return _0x705ecf;};'use strict';var multer=require(_0x0b63('0x0'));var util=require('util');var path=require(_0x0b63('0x1'));var timeout=require(_0x0b63('0x2'));var express=require(_0x0b63('0x3'));var router=express[_0x0b63('0x4')]();var fs_extra=require(_0x0b63('0x5'));var auth=require(_0x0b63('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x0b63('0x7')]('/',auth[_0x0b63('0x8')](),controller[_0x0b63('0x9')]);router[_0x0b63('0x7')]('/:id',auth[_0x0b63('0x8')](),controller[_0x0b63('0xa')]);router[_0x0b63('0x7')](_0x0b63('0xb'),auth[_0x0b63('0x8')](),controller['getConfigurations']);router[_0x0b63('0x7')](_0x0b63('0xc'),auth[_0x0b63('0x8')](),controller[_0x0b63('0xd')]);router['post']('/',auth[_0x0b63('0x8')](),controller[_0x0b63('0xe')]);router[_0x0b63('0xf')](_0x0b63('0xb'),auth['isAuthenticated'](),controller[_0x0b63('0x10')]);router['put']('/:id',auth[_0x0b63('0x8')](),controller[_0x0b63('0x11')]);router['delete'](_0x0b63('0x12'),auth['isAuthenticated'](),controller[_0x0b63('0x13')]);module[_0x0b63('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3710ac7..e8175cd 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 _0x5204=['exports','STRING','username','sequelize'];(function(_0x375611,_0x47201c){var _0x2ca53d=function(_0x2adac1){while(--_0x2adac1){_0x375611['push'](_0x375611['shift']());}};_0x2ca53d(++_0x47201c);}(_0x5204,0xdf));var _0x4520=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0x5204[_0x596c43];return _0x4e1315;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xb016,0x159));var _0x6b01=function(_0x2635ea,_0xa79c1e){_0x2635ea=_0x2635ea-0x0;var _0x45b838=_0xb016[_0x2635ea];return _0x45b838;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 3a58680..beeb896 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 _0x55d7=['http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FreshdeskAccount','count','include','findAll','rows','show','includeAll','options','find','create','body','params','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','description','group','source','ticket_type','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x55d7,0x65));var _0x755d=function(_0x13eca7,_0x29b30d){_0x13eca7=_0x13eca7-0x0;var _0x1abd34=_0x55d7[_0x13eca7];return _0x1abd34;};'use strict';var emlformat=require(_0x755d('0x0'));var rimraf=require(_0x755d('0x1'));var zipdir=require(_0x755d('0x2'));var jsonpatch=require(_0x755d('0x3'));var rp=require(_0x755d('0x4'));var moment=require('moment');var BPromise=require(_0x755d('0x5'));var Mustache=require(_0x755d('0x6'));var util=require(_0x755d('0x7'));var path=require(_0x755d('0x8'));var sox=require(_0x755d('0x9'));var csv=require(_0x755d('0xa'));var ejs=require(_0x755d('0xb'));var fs=require('fs');var fs_extra=require(_0x755d('0xc'));var _=require('lodash');var squel=require(_0x755d('0xd'));var crypto=require(_0x755d('0xe'));var jsforce=require(_0x755d('0xf'));var deskjs=require(_0x755d('0x10'));var toCsv=require(_0x755d('0xa'));var querystring=require(_0x755d('0x11'));var Papa=require(_0x755d('0x12'));var Redis=require(_0x755d('0x13'));var authService=require(_0x755d('0x14'));var qs=require(_0x755d('0x15'));var as=require(_0x755d('0x16'));var hardwareService=require(_0x755d('0x17'));var logger=require('../../config/logger')(_0x755d('0x18'));var utils=require(_0x755d('0x19'));var config=require(_0x755d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x755d('0x1b'))['db'];var integrations=require(_0x755d('0x1c'));var jayson=require('jayson/promise');var client=jayson[_0x755d('0x1d')][_0x755d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x56f8ad,_0x315da0,_0x204eea,_0x1c74ff){return new BPromise(function(_0x19b9ac,_0x69001){var _0x4ba416=_0x1c74ff||client;return _0x4ba416['request'](_0x56f8ad,_0x204eea)[_0x755d('0x1f')](function(_0x1e982d){logger['info'](_0x755d('0x20'),_0x315da0,_0x755d('0x21'));logger[_0x755d('0x22')](_0x755d('0x23'),_0x315da0,_0x755d('0x21'),JSON[_0x755d('0x24')](_0x1e982d));if(_0x1e982d[_0x755d('0x25')]){if(_0x1e982d[_0x755d('0x25')][_0x755d('0x26')]===0x1f4){logger[_0x755d('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x315da0,_0x1e982d[_0x755d('0x25')]['message']);return _0x69001(_0x1e982d[_0x755d('0x25')][_0x755d('0x27')]);}logger[_0x755d('0x25')](_0x755d('0x20'),_0x315da0,_0x1e982d[_0x755d('0x25')][_0x755d('0x27')]);return _0x19b9ac(_0x1e982d[_0x755d('0x25')][_0x755d('0x27')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x315da0,_0x755d('0x21'));_0x19b9ac(_0x1e982d[_0x755d('0x28')][_0x755d('0x27')]);}})[_0x755d('0x29')](function(_0x15ad68){logger[_0x755d('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x315da0,_0x15ad68);_0x69001(_0x15ad68);});});}function respondWithStatusCode(_0x5724fb,_0x228fb0){_0x228fb0=_0x228fb0||0xcc;return function(_0x49c076){if(_0x49c076){return _0x5724fb['sendStatus'](_0x228fb0);}return _0x5724fb[_0x755d('0x2a')](_0x228fb0)[_0x755d('0x2b')]();};}function respondWithResult(_0x335ffa,_0x4c6c3e){_0x4c6c3e=_0x4c6c3e||0xc8;return function(_0xf6d9d4){if(_0xf6d9d4){return _0x335ffa[_0x755d('0x2a')](_0x4c6c3e)[_0x755d('0x2c')](_0xf6d9d4);}};}function respondWithFilteredResult(_0x404155,_0x119712){return function(_0x11837f){if(_0x11837f){var _0x1d5132=typeof _0x119712[_0x755d('0x2d')]===_0x755d('0x2e')&&typeof _0x119712['limit']===_0x755d('0x2e');var _0x3d92fa=_0x11837f['count'];var _0x157139=_0x1d5132?0x0:_0x119712[_0x755d('0x2d')];var _0x5321ae=_0x1d5132?_0x11837f['count']:_0x119712['offset']+_0x119712[_0x755d('0x2f')];var _0x359c77;if(_0x5321ae>=_0x3d92fa){_0x5321ae=_0x3d92fa;_0x359c77=0xc8;}else{_0x359c77=0xce;}_0x404155[_0x755d('0x2a')](_0x359c77);return _0x404155[_0x755d('0x30')](_0x755d('0x31'),_0x157139+'-'+_0x5321ae+'/'+_0x3d92fa)[_0x755d('0x2c')](_0x11837f);}return null;};}function patchUpdates(_0x3e5b25){return function(_0x58bc02){try{jsonpatch[_0x755d('0x32')](_0x58bc02,_0x3e5b25,!![]);}catch(_0x2aa971){return BPromise[_0x755d('0x33')](_0x2aa971);}return _0x58bc02[_0x755d('0x34')]();};}function saveUpdates(_0x2bc300,_0x5bf99d){return function(_0x42e7e4){if(_0x42e7e4){return _0x42e7e4[_0x755d('0x35')](_0x2bc300)[_0x755d('0x1f')](function(_0x108b23){return _0x108b23;});}return null;};}function removeEntity(_0x285666,_0x189569){return function(_0x294cc9){if(_0x294cc9){return _0x294cc9[_0x755d('0x36')]()['then'](function(){_0x285666[_0x755d('0x2a')](0xcc)[_0x755d('0x2b')]();});}};}function handleEntityNotFound(_0x29a7bd,_0x36938d){return function(_0x3d25d8){if(!_0x3d25d8){_0x29a7bd['sendStatus'](0x194);}return _0x3d25d8;};}function handleError(_0x5ec1dc,_0x43f275){_0x43f275=_0x43f275||0x1f4;return function(_0x287713){logger[_0x755d('0x25')](_0x287713[_0x755d('0x37')]);if(_0x287713[_0x755d('0x38')]){delete _0x287713['name'];}_0x5ec1dc['status'](_0x43f275)[_0x755d('0x39')](_0x287713);};}exports[_0x755d('0x3a')]=function(_0x2302b1,_0x16271d){var _0x112206={},_0x555503={},_0x5d8a4d={'count':0x0,'rows':[]};var _0x14011a=_['map'](db['FreshdeskAccount'][_0x755d('0x3b')],function(_0xb0ab1e){return{'name':_0xb0ab1e[_0x755d('0x3c')],'type':_0xb0ab1e[_0x755d('0x3d')]['key']};});_0x555503[_0x755d('0x3e')]=_[_0x755d('0x3f')](_0x14011a,_0x755d('0x38'));_0x555503['query']=_[_0x755d('0x40')](_0x2302b1['query']);_0x555503[_0x755d('0x41')]=_[_0x755d('0x42')](_0x555503[_0x755d('0x3e')],_0x555503[_0x755d('0x43')]);_0x112206[_0x755d('0x44')]=_[_0x755d('0x42')](_0x555503[_0x755d('0x3e')],qs[_0x755d('0x45')](_0x2302b1[_0x755d('0x43')][_0x755d('0x45')]));_0x112206[_0x755d('0x44')]=_0x112206[_0x755d('0x44')][_0x755d('0x46')]?_0x112206[_0x755d('0x44')]:_0x555503[_0x755d('0x3e')];if(!_0x2302b1['query'][_0x755d('0x47')](_0x755d('0x48'))){_0x112206[_0x755d('0x2f')]=qs[_0x755d('0x2f')](_0x2302b1[_0x755d('0x43')][_0x755d('0x2f')]);_0x112206['offset']=qs[_0x755d('0x2d')](_0x2302b1['query'][_0x755d('0x2d')]);}_0x112206[_0x755d('0x49')]=qs[_0x755d('0x4a')](_0x2302b1[_0x755d('0x43')][_0x755d('0x4a')]);_0x112206[_0x755d('0x4b')]=qs[_0x755d('0x41')](_[_0x755d('0x4c')](_0x2302b1[_0x755d('0x43')],_0x555503['filters']),_0x14011a);if(_0x2302b1['query'][_0x755d('0x4d')]){_0x112206[_0x755d('0x4b')]=_['merge'](_0x112206[_0x755d('0x4b')],{'$or':_[_0x755d('0x3f')](_0x14011a,function(_0x3906dd){if(_0x3906dd[_0x755d('0x3d')]!==_0x755d('0x4e')){var _0x4931ee={};_0x4931ee[_0x3906dd['name']]={'$like':'%'+_0x2302b1['query']['filter']+'%'};return _0x4931ee;}})});}_0x112206=_[_0x755d('0x4f')]({},_0x112206,_0x2302b1['options']);var _0x1ecfff={'where':_0x112206[_0x755d('0x4b')]};return db[_0x755d('0x50')][_0x755d('0x51')](_0x1ecfff)[_0x755d('0x1f')](function(_0x59efea){_0x5d8a4d[_0x755d('0x51')]=_0x59efea;if(_0x2302b1['query']['includeAll']){_0x112206[_0x755d('0x52')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x755d('0x53')](_0x112206);})[_0x755d('0x1f')](function(_0xc88fe0){_0x5d8a4d[_0x755d('0x54')]=_0xc88fe0;return _0x5d8a4d;})[_0x755d('0x1f')](respondWithFilteredResult(_0x16271d,_0x112206))[_0x755d('0x29')](handleError(_0x16271d,null));};exports[_0x755d('0x55')]=function(_0xc515f7,_0x1959b1){var _0x350cb8={'raw':![],'where':{'id':_0xc515f7['params']['id']}},_0x305b16={};_0x305b16[_0x755d('0x3e')]=_[_0x755d('0x40')](db[_0x755d('0x50')][_0x755d('0x3b')]);_0x305b16[_0x755d('0x43')]=_[_0x755d('0x40')](_0xc515f7[_0x755d('0x43')]);_0x305b16['filters']=_[_0x755d('0x42')](_0x305b16['model'],_0x305b16[_0x755d('0x43')]);_0x350cb8['attributes']=_[_0x755d('0x42')](_0x305b16['model'],qs['fields'](_0xc515f7[_0x755d('0x43')]['fields']));_0x350cb8[_0x755d('0x44')]=_0x350cb8[_0x755d('0x44')]['length']?_0x350cb8[_0x755d('0x44')]:_0x305b16[_0x755d('0x3e')];if(_0xc515f7[_0x755d('0x43')][_0x755d('0x56')]){_0x350cb8[_0x755d('0x52')]=[{'all':!![]}];}_0x350cb8=_[_0x755d('0x4f')]({},_0x350cb8,_0xc515f7[_0x755d('0x57')]);return db[_0x755d('0x50')][_0x755d('0x58')](_0x350cb8)['then'](handleEntityNotFound(_0x1959b1,null))[_0x755d('0x1f')](respondWithResult(_0x1959b1,null))[_0x755d('0x29')](handleError(_0x1959b1,null));};exports['create']=function(_0x69c44a,_0x4504fa){return db[_0x755d('0x50')][_0x755d('0x59')](_0x69c44a[_0x755d('0x5a')],{})[_0x755d('0x1f')](respondWithResult(_0x4504fa,0xc9))[_0x755d('0x29')](handleError(_0x4504fa,null));};exports[_0x755d('0x35')]=function(_0x1a487d,_0x49f98a){if(_0x1a487d[_0x755d('0x5a')]['id']){delete _0x1a487d['body']['id'];}return db['FreshdeskAccount'][_0x755d('0x58')]({'where':{'id':_0x1a487d['params']['id']}})['then'](handleEntityNotFound(_0x49f98a,null))[_0x755d('0x1f')](saveUpdates(_0x1a487d[_0x755d('0x5a')],null))[_0x755d('0x1f')](respondWithResult(_0x49f98a,null))[_0x755d('0x29')](handleError(_0x49f98a,null));};exports[_0x755d('0x36')]=function(_0x47d8c8,_0x5bd76e){return db[_0x755d('0x50')][_0x755d('0x58')]({'where':{'id':_0x47d8c8[_0x755d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5bd76e,null))[_0x755d('0x1f')](removeEntity(_0x5bd76e,null))['catch'](handleError(_0x5bd76e,null));};exports[_0x755d('0x5c')]=function(_0x5f3f36,_0x2ed535,_0x2b55e7){var _0x3f5706={};var _0x492a04={};var _0x260bdb;var _0x545c7c;return db[_0x755d('0x50')]['findOne']({'where':{'id':_0x5f3f36[_0x755d('0x5b')]['id']}})[_0x755d('0x1f')](handleEntityNotFound(_0x2ed535,null))['then'](function(_0x5edad5){if(_0x5edad5){_0x260bdb=_0x5edad5;_0x492a04[_0x755d('0x3e')]=_[_0x755d('0x40')](db[_0x755d('0x5d')][_0x755d('0x3b')]);_0x492a04[_0x755d('0x43')]=_[_0x755d('0x40')](_0x5f3f36[_0x755d('0x43')]);_0x492a04['filters']=_[_0x755d('0x42')](_0x492a04[_0x755d('0x3e')],_0x492a04[_0x755d('0x43')]);_0x3f5706['attributes']=_['intersection'](_0x492a04[_0x755d('0x3e')],qs['fields'](_0x5f3f36[_0x755d('0x43')][_0x755d('0x45')]));_0x3f5706[_0x755d('0x44')]=_0x3f5706[_0x755d('0x44')][_0x755d('0x46')]?_0x3f5706[_0x755d('0x44')]:_0x492a04['model'];_0x3f5706[_0x755d('0x49')]=qs[_0x755d('0x4a')](_0x5f3f36[_0x755d('0x43')][_0x755d('0x4a')]);_0x3f5706[_0x755d('0x4b')]=qs[_0x755d('0x41')](_[_0x755d('0x4c')](_0x5f3f36[_0x755d('0x43')],_0x492a04[_0x755d('0x41')]));if(_0x5f3f36[_0x755d('0x43')][_0x755d('0x4d')]){_0x3f5706[_0x755d('0x4b')]=_['merge'](_0x3f5706[_0x755d('0x4b')],{'$or':_['map'](_0x3f5706[_0x755d('0x44')],function(_0x3b1619){var _0x427abf={};_0x427abf[_0x3b1619]={'$like':'%'+_0x5f3f36[_0x755d('0x43')][_0x755d('0x4d')]+'%'};return _0x427abf;})});}_0x3f5706=_[_0x755d('0x4f')]({},_0x3f5706,_0x5f3f36['options']);return _0x260bdb['getConfigurations'](_0x3f5706);}})['then'](function(_0x10ee72){if(_0x10ee72){_0x545c7c=_0x10ee72['length'];if(!_0x5f3f36[_0x755d('0x43')][_0x755d('0x47')]('nolimit')){_0x3f5706[_0x755d('0x2f')]=qs[_0x755d('0x2f')](_0x5f3f36[_0x755d('0x43')]['limit']);_0x3f5706['offset']=qs[_0x755d('0x2d')](_0x5f3f36[_0x755d('0x43')]['offset']);}return _0x260bdb[_0x755d('0x5c')](_0x3f5706);}})[_0x755d('0x1f')](function(_0x4ab156){if(_0x4ab156){return _0x4ab156?{'count':_0x545c7c,'rows':_0x4ab156}:null;}})[_0x755d('0x1f')](respondWithResult(_0x2ed535,null))[_0x755d('0x29')](handleError(_0x2ed535,null));};exports[_0x755d('0x5e')]=function(_0x13ec1b,_0xbcfe9b,_0x15b490){if(_0x13ec1b[_0x755d('0x5a')]['id']){delete _0x13ec1b[_0x755d('0x5a')]['id'];}return db[_0x755d('0x50')][_0x755d('0x5f')]({'where':{'id':_0x13ec1b[_0x755d('0x5b')]['id']}})[_0x755d('0x1f')](handleEntityNotFound(_0xbcfe9b,null))['then'](function(_0xeca893){if(_0xeca893){_0x13ec1b['body'][_0x755d('0x60')]=_0xeca893['id'];_0x13ec1b[_0x755d('0x5a')][_0x755d('0x61')]=integrations[_0x755d('0x62')](_0x13ec1b['body'][_0x755d('0x63')],_0x13ec1b[_0x755d('0x5a')]['type']);_0x13ec1b[_0x755d('0x5a')]['Descriptions']=integrations['getDescriptions'](_0x13ec1b[_0x755d('0x5a')][_0x755d('0x63')],_0x13ec1b[_0x755d('0x5a')][_0x755d('0x3d')]);return db[_0x755d('0x5d')][_0x755d('0x59')](_0x13ec1b[_0x755d('0x5a')],{'include':[{'model':db[_0x755d('0x64')],'as':_0x755d('0x61')},{'model':db[_0x755d('0x64')],'as':_0x755d('0x65')}]});}return null;})[_0x755d('0x1f')](respondWithResult(_0xbcfe9b,null))[_0x755d('0x29')](handleError(_0xbcfe9b,null));};exports[_0x755d('0x66')]=function(_0x35ec23,_0x1f0047,_0x541b9d){var _0x28dad5='';return db[_0x755d('0x50')]['findOne']({'where':{'id':_0x35ec23[_0x755d('0x5b')]['id']},'attributes':['id',_0x755d('0x67'),_0x755d('0x68')]})[_0x755d('0x1f')](handleEntityNotFound(_0x1f0047,null))[_0x755d('0x1f')](function(_0x2ffbbc){if(_0x2ffbbc){_0x28dad5=_0x2ffbbc[_0x755d('0x67')];var _0x1817e8=_0x28dad5[_0x755d('0x69')](-0x1);if(_0x1817e8==='/'){_0x28dad5=_0x28dad5[_0x755d('0x6a')](0x0,_0x28dad5[_0x755d('0x6b')](_0x1817e8));}return rp({'method':'GET','uri':util[_0x755d('0x6c')](_0x755d('0x6d'),_0x28dad5,_0x755d('0x6e')),'headers':{'Authorization':util[_0x755d('0x6c')](_0x755d('0x6f'),new Buffer(util[_0x755d('0x6c')](_0x755d('0x70'),_0x2ffbbc[_0x755d('0x68')]))[_0x755d('0x71')]('base64'))},'json':!![]});}})[_0x755d('0x1f')](function(_0x16c338){if(_0x16c338){var _0x2d0c53=[_0x755d('0x72'),_0x755d('0x73'),_0x755d('0x74'),_0x755d('0x75'),_0x755d('0x2a'),'priority',_0x755d('0x76'),_0x755d('0x77'),_0x755d('0x78'),_0x755d('0x76'),_0x755d('0x79')];_[_0x755d('0x7a')](_0x16c338,function(_0x559940){return _0x2d0c53['includes'](_0x559940[_0x755d('0x38')])||!_0x559940[_0x755d('0x7b')]&&_0x559940[_0x755d('0x3d')]!==_0x755d('0x7c')&&_0x559940[_0x755d('0x3d')]!==_0x755d('0x7d');});return{'count':_0x16c338[_0x755d('0x46')],'rows':_[_0x755d('0x3f')](_0x16c338,function(_0x2cd6cd){return{'id':_0x2cd6cd[_0x755d('0x38')],'name':_0x2cd6cd[_0x755d('0x7e')],'custom':!_0x2cd6cd['default'],'options':_0x2cd6cd[_0x755d('0x7f')]?_['map'](_0x2cd6cd['choices'],function(_0x30c690){return{'name':_[_0x755d('0x80')](_0x30c690),'value':_0x30c690};}):[]};})};}})[_0x755d('0x1f')](respondWithResult(_0x1f0047,null))['catch'](function(_0x49747c){var _0x280845=_0x35ec23[_0x755d('0x43')][_0x755d('0x81')]?0x1f4:_0x49747c['statusCode']||0x1f4;logger[_0x755d('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x280845,JSON[_0x755d('0x24')](_0x49747c));delete _0x49747c[_0x755d('0x38')];if(_0x280845===0x191){_0x280845=0x190;}_0x1f0047[_0x755d('0x2a')](_0x280845)['send'](_0x35ec23['query'][_0x755d('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x49747c[_0x755d('0x82')]}:_0x49747c);});}; \ No newline at end of file +var _0xcc92=['FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','length','include','find','create','body','getConfigurations','FreshdeskConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','base64','requester','agent','description','priority','group','company','remove','default','custom_dropdown','label','capitalize','test','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map'];(function(_0x51022e,_0x159c49){var _0x47f821=function(_0x33122e){while(--_0x33122e){_0x51022e['push'](_0x51022e['shift']());}};_0x47f821(++_0x159c49);}(_0xcc92,0x141));var _0x2cc9=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xcc92[_0x53cf8e];return _0x459197;};'use strict';var emlformat=require(_0x2cc9('0x0'));var rimraf=require(_0x2cc9('0x1'));var zipdir=require(_0x2cc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cc9('0x3'));var moment=require(_0x2cc9('0x4'));var BPromise=require(_0x2cc9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2cc9('0x6'));var sox=require(_0x2cc9('0x7'));var csv=require('to-csv');var ejs=require(_0x2cc9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cc9('0x9'));var squel=require(_0x2cc9('0xa'));var crypto=require(_0x2cc9('0xb'));var jsforce=require(_0x2cc9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2cc9('0xd'));var querystring=require('querystring');var Papa=require(_0x2cc9('0xe'));var Redis=require(_0x2cc9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cc9('0x10'));var hardwareService=require(_0x2cc9('0x11'));var logger=require(_0x2cc9('0x12'))(_0x2cc9('0x13'));var utils=require(_0x2cc9('0x14'));var config=require(_0x2cc9('0x15'));var licenseUtil=require(_0x2cc9('0x16'));var db=require(_0x2cc9('0x17'))['db'];var integrations=require(_0x2cc9('0x18'));var jayson=require(_0x2cc9('0x19'));var client=jayson[_0x2cc9('0x1a')][_0x2cc9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5ada00,_0x4276ca,_0x45a3d4,_0x149488){return new BPromise(function(_0x22237e,_0x4eb6ac){var _0x59769b=_0x149488||client;return _0x59769b[_0x2cc9('0x1c')](_0x5ada00,_0x45a3d4)[_0x2cc9('0x1d')](function(_0x39aa00){logger['info'](_0x2cc9('0x1e'),_0x4276ca,_0x2cc9('0x1f'));logger[_0x2cc9('0x20')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x4276ca,_0x2cc9('0x1f'),JSON[_0x2cc9('0x21')](_0x39aa00));if(_0x39aa00['error']){if(_0x39aa00['error'][_0x2cc9('0x22')]===0x1f4){logger['error'](_0x2cc9('0x1e'),_0x4276ca,_0x39aa00['error'][_0x2cc9('0x23')]);return _0x4eb6ac(_0x39aa00[_0x2cc9('0x24')][_0x2cc9('0x23')]);}logger['error'](_0x2cc9('0x1e'),_0x4276ca,_0x39aa00[_0x2cc9('0x24')][_0x2cc9('0x23')]);return _0x22237e(_0x39aa00['error']['message']);}else{logger[_0x2cc9('0x25')](_0x2cc9('0x1e'),_0x4276ca,'request\x20sent');_0x22237e(_0x39aa00[_0x2cc9('0x26')][_0x2cc9('0x23')]);}})[_0x2cc9('0x27')](function(_0x39d151){logger[_0x2cc9('0x24')](_0x2cc9('0x1e'),_0x4276ca,_0x39d151);_0x4eb6ac(_0x39d151);});});}function respondWithStatusCode(_0x565ece,_0x1ed11a){_0x1ed11a=_0x1ed11a||0xcc;return function(_0x2eff68){if(_0x2eff68){return _0x565ece[_0x2cc9('0x28')](_0x1ed11a);}return _0x565ece[_0x2cc9('0x29')](_0x1ed11a)[_0x2cc9('0x2a')]();};}function respondWithResult(_0x3b9f47,_0x57f8ae){_0x57f8ae=_0x57f8ae||0xc8;return function(_0x3267d8){if(_0x3267d8){return _0x3b9f47[_0x2cc9('0x29')](_0x57f8ae)[_0x2cc9('0x2b')](_0x3267d8);}};}function respondWithFilteredResult(_0x5a456e,_0x38a88c){return function(_0x2b775d){if(_0x2b775d){var _0x29a8c5=typeof _0x38a88c[_0x2cc9('0x2c')]===_0x2cc9('0x2d')&&typeof _0x38a88c[_0x2cc9('0x2e')]==='undefined';var _0x4790bb=_0x2b775d['count'];var _0x454117=_0x29a8c5?0x0:_0x38a88c[_0x2cc9('0x2c')];var _0x15b5f0=_0x29a8c5?_0x2b775d[_0x2cc9('0x2f')]:_0x38a88c[_0x2cc9('0x2c')]+_0x38a88c[_0x2cc9('0x2e')];var _0x10aeb6;if(_0x15b5f0>=_0x4790bb){_0x15b5f0=_0x4790bb;_0x10aeb6=0xc8;}else{_0x10aeb6=0xce;}_0x5a456e[_0x2cc9('0x29')](_0x10aeb6);return _0x5a456e[_0x2cc9('0x30')](_0x2cc9('0x31'),_0x454117+'-'+_0x15b5f0+'/'+_0x4790bb)[_0x2cc9('0x2b')](_0x2b775d);}return null;};}function patchUpdates(_0x24450b){return function(_0x14451d){try{jsonpatch[_0x2cc9('0x32')](_0x14451d,_0x24450b,!![]);}catch(_0x4b95ce){return BPromise[_0x2cc9('0x33')](_0x4b95ce);}return _0x14451d[_0x2cc9('0x34')]();};}function saveUpdates(_0x41e578,_0x52d079){return function(_0x4908bc){if(_0x4908bc){return _0x4908bc[_0x2cc9('0x35')](_0x41e578)['then'](function(_0x1a8dda){return _0x1a8dda;});}return null;};}function removeEntity(_0x12789b,_0x402ae0){return function(_0x26619c){if(_0x26619c){return _0x26619c[_0x2cc9('0x36')]()[_0x2cc9('0x1d')](function(){_0x12789b[_0x2cc9('0x29')](0xcc)[_0x2cc9('0x2a')]();});}};}function handleEntityNotFound(_0x471f67,_0x41e6c9){return function(_0x2ea3c4){if(!_0x2ea3c4){_0x471f67[_0x2cc9('0x28')](0x194);}return _0x2ea3c4;};}function handleError(_0x36e11e,_0x4d0c50){_0x4d0c50=_0x4d0c50||0x1f4;return function(_0x3373d3){logger['error'](_0x3373d3[_0x2cc9('0x37')]);if(_0x3373d3[_0x2cc9('0x38')]){delete _0x3373d3['name'];}_0x36e11e[_0x2cc9('0x29')](_0x4d0c50)[_0x2cc9('0x39')](_0x3373d3);};}exports[_0x2cc9('0x3a')]=function(_0xb158e9,_0x1bdce9){var _0x2b9bdb={},_0x17da48={},_0xa70d7={'count':0x0,'rows':[]};var _0x1a07af=_[_0x2cc9('0x3b')](db[_0x2cc9('0x3c')][_0x2cc9('0x3d')],function(_0x202767){return{'name':_0x202767[_0x2cc9('0x3e')],'type':_0x202767[_0x2cc9('0x3f')][_0x2cc9('0x40')]};});_0x17da48[_0x2cc9('0x41')]=_[_0x2cc9('0x3b')](_0x1a07af,'name');_0x17da48[_0x2cc9('0x42')]=_[_0x2cc9('0x43')](_0xb158e9[_0x2cc9('0x42')]);_0x17da48[_0x2cc9('0x44')]=_[_0x2cc9('0x45')](_0x17da48[_0x2cc9('0x41')],_0x17da48[_0x2cc9('0x42')]);_0x2b9bdb['attributes']=_[_0x2cc9('0x45')](_0x17da48[_0x2cc9('0x41')],qs[_0x2cc9('0x46')](_0xb158e9[_0x2cc9('0x42')][_0x2cc9('0x46')]));_0x2b9bdb[_0x2cc9('0x47')]=_0x2b9bdb[_0x2cc9('0x47')]['length']?_0x2b9bdb['attributes']:_0x17da48[_0x2cc9('0x41')];if(!_0xb158e9[_0x2cc9('0x42')][_0x2cc9('0x48')](_0x2cc9('0x49'))){_0x2b9bdb['limit']=qs[_0x2cc9('0x2e')](_0xb158e9[_0x2cc9('0x42')][_0x2cc9('0x2e')]);_0x2b9bdb[_0x2cc9('0x2c')]=qs['offset'](_0xb158e9['query'][_0x2cc9('0x2c')]);}_0x2b9bdb[_0x2cc9('0x4a')]=qs[_0x2cc9('0x4b')](_0xb158e9['query'][_0x2cc9('0x4b')]);_0x2b9bdb[_0x2cc9('0x4c')]=qs['filters'](_['pick'](_0xb158e9[_0x2cc9('0x42')],_0x17da48[_0x2cc9('0x44')]),_0x1a07af);if(_0xb158e9['query'][_0x2cc9('0x4d')]){_0x2b9bdb[_0x2cc9('0x4c')]=_[_0x2cc9('0x4e')](_0x2b9bdb['where'],{'$or':_[_0x2cc9('0x3b')](_0x1a07af,function(_0x4c924c){if(_0x4c924c['type']!==_0x2cc9('0x4f')){var _0x28e29a={};_0x28e29a[_0x4c924c[_0x2cc9('0x38')]]={'$like':'%'+_0xb158e9[_0x2cc9('0x42')][_0x2cc9('0x4d')]+'%'};return _0x28e29a;}})});}_0x2b9bdb=_[_0x2cc9('0x4e')]({},_0x2b9bdb,_0xb158e9[_0x2cc9('0x50')]);var _0x24f7de={'where':_0x2b9bdb[_0x2cc9('0x4c')]};return db[_0x2cc9('0x3c')][_0x2cc9('0x2f')](_0x24f7de)[_0x2cc9('0x1d')](function(_0x11f773){_0xa70d7['count']=_0x11f773;if(_0xb158e9[_0x2cc9('0x42')][_0x2cc9('0x51')]){_0x2b9bdb['include']=[{'all':!![]}];}return db[_0x2cc9('0x3c')]['findAll'](_0x2b9bdb);})[_0x2cc9('0x1d')](function(_0x156cc2){_0xa70d7[_0x2cc9('0x52')]=_0x156cc2;return _0xa70d7;})[_0x2cc9('0x1d')](respondWithFilteredResult(_0x1bdce9,_0x2b9bdb))[_0x2cc9('0x27')](handleError(_0x1bdce9,null));};exports[_0x2cc9('0x53')]=function(_0x3c06c8,_0x4c8bc9){var _0x6126fc={'raw':![],'where':{'id':_0x3c06c8[_0x2cc9('0x54')]['id']}},_0x2a502f={};_0x2a502f[_0x2cc9('0x41')]=_[_0x2cc9('0x43')](db[_0x2cc9('0x3c')][_0x2cc9('0x3d')]);_0x2a502f[_0x2cc9('0x42')]=_[_0x2cc9('0x43')](_0x3c06c8[_0x2cc9('0x42')]);_0x2a502f[_0x2cc9('0x44')]=_['intersection'](_0x2a502f['model'],_0x2a502f['query']);_0x6126fc[_0x2cc9('0x47')]=_[_0x2cc9('0x45')](_0x2a502f[_0x2cc9('0x41')],qs['fields'](_0x3c06c8['query']['fields']));_0x6126fc[_0x2cc9('0x47')]=_0x6126fc[_0x2cc9('0x47')][_0x2cc9('0x55')]?_0x6126fc['attributes']:_0x2a502f[_0x2cc9('0x41')];if(_0x3c06c8[_0x2cc9('0x42')][_0x2cc9('0x51')]){_0x6126fc[_0x2cc9('0x56')]=[{'all':!![]}];}_0x6126fc=_[_0x2cc9('0x4e')]({},_0x6126fc,_0x3c06c8[_0x2cc9('0x50')]);return db['FreshdeskAccount'][_0x2cc9('0x57')](_0x6126fc)[_0x2cc9('0x1d')](handleEntityNotFound(_0x4c8bc9,null))[_0x2cc9('0x1d')](respondWithResult(_0x4c8bc9,null))[_0x2cc9('0x27')](handleError(_0x4c8bc9,null));};exports[_0x2cc9('0x58')]=function(_0x28ff9f,_0x2a412f){return db['FreshdeskAccount'][_0x2cc9('0x58')](_0x28ff9f[_0x2cc9('0x59')],{})['then'](respondWithResult(_0x2a412f,0xc9))[_0x2cc9('0x27')](handleError(_0x2a412f,null));};exports[_0x2cc9('0x35')]=function(_0x166450,_0x372f4e){if(_0x166450[_0x2cc9('0x59')]['id']){delete _0x166450[_0x2cc9('0x59')]['id'];}return db['FreshdeskAccount'][_0x2cc9('0x57')]({'where':{'id':_0x166450[_0x2cc9('0x54')]['id']}})[_0x2cc9('0x1d')](handleEntityNotFound(_0x372f4e,null))[_0x2cc9('0x1d')](saveUpdates(_0x166450[_0x2cc9('0x59')],null))[_0x2cc9('0x1d')](respondWithResult(_0x372f4e,null))[_0x2cc9('0x27')](handleError(_0x372f4e,null));};exports[_0x2cc9('0x36')]=function(_0x4432c7,_0x257d52){return db[_0x2cc9('0x3c')][_0x2cc9('0x57')]({'where':{'id':_0x4432c7[_0x2cc9('0x54')]['id']}})[_0x2cc9('0x1d')](handleEntityNotFound(_0x257d52,null))[_0x2cc9('0x1d')](removeEntity(_0x257d52,null))['catch'](handleError(_0x257d52,null));};exports[_0x2cc9('0x5a')]=function(_0x283208,_0x37062b,_0x1417e9){var _0x7460ec={};var _0x345fad={};var _0x2ec4b3;var _0x10bf86;return db[_0x2cc9('0x3c')]['findOne']({'where':{'id':_0x283208['params']['id']}})[_0x2cc9('0x1d')](handleEntityNotFound(_0x37062b,null))['then'](function(_0x149953){if(_0x149953){_0x2ec4b3=_0x149953;_0x345fad['model']=_['keys'](db[_0x2cc9('0x5b')][_0x2cc9('0x3d')]);_0x345fad[_0x2cc9('0x42')]=_['keys'](_0x283208[_0x2cc9('0x42')]);_0x345fad[_0x2cc9('0x44')]=_[_0x2cc9('0x45')](_0x345fad[_0x2cc9('0x41')],_0x345fad[_0x2cc9('0x42')]);_0x7460ec[_0x2cc9('0x47')]=_['intersection'](_0x345fad[_0x2cc9('0x41')],qs['fields'](_0x283208['query'][_0x2cc9('0x46')]));_0x7460ec[_0x2cc9('0x47')]=_0x7460ec[_0x2cc9('0x47')][_0x2cc9('0x55')]?_0x7460ec[_0x2cc9('0x47')]:_0x345fad['model'];_0x7460ec[_0x2cc9('0x4a')]=qs[_0x2cc9('0x4b')](_0x283208['query'][_0x2cc9('0x4b')]);_0x7460ec[_0x2cc9('0x4c')]=qs['filters'](_[_0x2cc9('0x5c')](_0x283208[_0x2cc9('0x42')],_0x345fad[_0x2cc9('0x44')]));if(_0x283208['query'][_0x2cc9('0x4d')]){_0x7460ec[_0x2cc9('0x4c')]=_['merge'](_0x7460ec[_0x2cc9('0x4c')],{'$or':_['map'](_0x7460ec[_0x2cc9('0x47')],function(_0x4cd240){var _0x49ef18={};_0x49ef18[_0x4cd240]={'$like':'%'+_0x283208['query'][_0x2cc9('0x4d')]+'%'};return _0x49ef18;})});}_0x7460ec=_[_0x2cc9('0x4e')]({},_0x7460ec,_0x283208[_0x2cc9('0x50')]);return _0x2ec4b3[_0x2cc9('0x5a')](_0x7460ec);}})[_0x2cc9('0x1d')](function(_0x14af26){if(_0x14af26){_0x10bf86=_0x14af26[_0x2cc9('0x55')];if(!_0x283208[_0x2cc9('0x42')][_0x2cc9('0x48')](_0x2cc9('0x49'))){_0x7460ec[_0x2cc9('0x2e')]=qs['limit'](_0x283208['query'][_0x2cc9('0x2e')]);_0x7460ec[_0x2cc9('0x2c')]=qs[_0x2cc9('0x2c')](_0x283208[_0x2cc9('0x42')][_0x2cc9('0x2c')]);}return _0x2ec4b3['getConfigurations'](_0x7460ec);}})[_0x2cc9('0x1d')](function(_0x479ee4){if(_0x479ee4){return _0x479ee4?{'count':_0x10bf86,'rows':_0x479ee4}:null;}})['then'](respondWithResult(_0x37062b,null))[_0x2cc9('0x27')](handleError(_0x37062b,null));};exports[_0x2cc9('0x5d')]=function(_0x5a16f8,_0x18fc4e,_0x261e60){if(_0x5a16f8[_0x2cc9('0x59')]['id']){delete _0x5a16f8[_0x2cc9('0x59')]['id'];}return db[_0x2cc9('0x3c')][_0x2cc9('0x5e')]({'where':{'id':_0x5a16f8[_0x2cc9('0x54')]['id']}})[_0x2cc9('0x1d')](handleEntityNotFound(_0x18fc4e,null))[_0x2cc9('0x1d')](function(_0x1f9601){if(_0x1f9601){_0x5a16f8['body'][_0x2cc9('0x5f')]=_0x1f9601['id'];_0x5a16f8[_0x2cc9('0x59')][_0x2cc9('0x60')]=integrations[_0x2cc9('0x61')](_0x5a16f8[_0x2cc9('0x59')][_0x2cc9('0x62')],_0x5a16f8[_0x2cc9('0x59')]['type']);_0x5a16f8[_0x2cc9('0x59')][_0x2cc9('0x63')]=integrations[_0x2cc9('0x64')](_0x5a16f8['body'][_0x2cc9('0x62')],_0x5a16f8[_0x2cc9('0x59')][_0x2cc9('0x3f')]);return db['FreshdeskConfiguration'][_0x2cc9('0x58')](_0x5a16f8['body'],{'include':[{'model':db[_0x2cc9('0x65')],'as':_0x2cc9('0x60')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x2cc9('0x1d')](respondWithResult(_0x18fc4e,null))[_0x2cc9('0x27')](handleError(_0x18fc4e,null));};exports[_0x2cc9('0x66')]=function(_0x29678a,_0x5191bc,_0x127cdc){var _0x360a07='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x29678a['params']['id']},'attributes':['id',_0x2cc9('0x67'),_0x2cc9('0x68')]})['then'](handleEntityNotFound(_0x5191bc,null))['then'](function(_0x58db2f){if(_0x58db2f){_0x360a07=_0x58db2f['remoteUri'];var _0xd157aa=_0x360a07[_0x2cc9('0x69')](-0x1);if(_0xd157aa==='/'){_0x360a07=_0x360a07[_0x2cc9('0x6a')](0x0,_0x360a07[_0x2cc9('0x6b')](_0xd157aa));}return rp({'method':_0x2cc9('0x6c'),'uri':util[_0x2cc9('0x6d')](_0x2cc9('0x6e'),_0x360a07,_0x2cc9('0x6f')),'headers':{'Authorization':util[_0x2cc9('0x6d')]('Basic\x20%s',new Buffer(util[_0x2cc9('0x6d')](_0x2cc9('0x70'),_0x58db2f['apiKey']))['toString'](_0x2cc9('0x71')))},'json':!![]});}})['then'](function(_0x19ebaf){if(_0x19ebaf){var _0x5c4dd2=[_0x2cc9('0x72'),'subject',_0x2cc9('0x73'),_0x2cc9('0x74'),_0x2cc9('0x29'),_0x2cc9('0x75'),_0x2cc9('0x76'),'source','ticket_type','group',_0x2cc9('0x77')];_[_0x2cc9('0x78')](_0x19ebaf,function(_0x3d4f0b){return _0x5c4dd2['includes'](_0x3d4f0b['name'])||!_0x3d4f0b[_0x2cc9('0x79')]&&_0x3d4f0b[_0x2cc9('0x3f')]!=='custom_text'&&_0x3d4f0b[_0x2cc9('0x3f')]!==_0x2cc9('0x7a');});return{'count':_0x19ebaf[_0x2cc9('0x55')],'rows':_[_0x2cc9('0x3b')](_0x19ebaf,function(_0x235b5d){return{'id':_0x235b5d[_0x2cc9('0x38')],'name':_0x235b5d[_0x2cc9('0x7b')],'custom':!_0x235b5d[_0x2cc9('0x79')],'options':_0x235b5d['choices']?_[_0x2cc9('0x3b')](_0x235b5d['choices'],function(_0x4386ab){return{'name':_[_0x2cc9('0x7c')](_0x4386ab),'value':_0x4386ab};}):[]};})};}})[_0x2cc9('0x1d')](respondWithResult(_0x5191bc,null))[_0x2cc9('0x27')](function(_0x1af925){var _0x1538e2=_0x29678a['query'][_0x2cc9('0x7d')]?0x1f4:_0x1af925[_0x2cc9('0x7e')]||0x1f4;logger[_0x2cc9('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x2cc9('0x66'),_0x1538e2,JSON['stringify'](_0x1af925));delete _0x1af925[_0x2cc9('0x38')];if(_0x1538e2===0x191){_0x1538e2=0x190;}_0x5191bc[_0x2cc9('0x29')](_0x1538e2)['send'](_0x29678a['query'][_0x2cc9('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x1af925[_0x2cc9('0x7e')]}:_0x1af925);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 3cea8ff..ed1ac7d 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 _0x69f5=['path','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x450d4d,_0x4a4112){var _0x5317ad=function(_0x4b9ec0){while(--_0x4b9ec0){_0x450d4d['push'](_0x450d4d['shift']());}};_0x5317ad(++_0x4a4112);}(_0x69f5,0x1a7));var _0x569f=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x69f5[_0x5a636f];return _0x6a8cfb;};'use strict';var _=require(_0x569f('0x0'));var util=require(_0x569f('0x1'));var logger=require(_0x569f('0x2'))('api');var moment=require(_0x569f('0x3'));var BPromise=require(_0x569f('0x4'));var rp=require(_0x569f('0x5'));var fs=require('fs');var path=require(_0x569f('0x6'));var rimraf=require('rimraf');var config=require(_0x569f('0x7'));var attributes=require(_0x569f('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x569f('0x9')]=function(_0x26c25c,_0x5d26bb){return _0x26c25c[_0x569f('0xa')](_0x569f('0xb'),attributes,{'tableName':_0x569f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbcd=['define','FreshdeskAccount','int_freshdesk_accounts','util','request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1cb091,_0x2ac12e){var _0x3ffaee=function(_0x5eed4d){while(--_0x5eed4d){_0x1cb091['push'](_0x1cb091['shift']());}};_0x3ffaee(++_0x2ac12e);}(_0xdbcd,0x12f));var _0xddbc=function(_0x25d250,_0x2fc437){_0x25d250=_0x25d250-0x0;var _0x458775=_0xdbcd[_0x25d250];return _0x458775;};'use strict';var _=require('lodash');var util=require(_0xddbc('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xddbc('0x1'));var fs=require('fs');var path=require(_0xddbc('0x2'));var rimraf=require(_0xddbc('0x3'));var config=require('../../config/environment');var attributes=require(_0xddbc('0x4'));var integrations=require(_0xddbc('0x5'));module[_0xddbc('0x6')]=function(_0x51ef99,_0x313f90){return _0x51ef99[_0xddbc('0x7')](_0xddbc('0x8'),attributes,{'tableName':_0xddbc('0x9'),'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 c2f71d9..9f514e2 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 _0xec3d=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','FreshdeskAccount,\x20%s,\x20%s','result','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowFreshdeskAccount','FreshdeskAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x5de42e,_0x21f72f){var _0x3b3199=function(_0x18fd86){while(--_0x18fd86){_0x5de42e['push'](_0x5de42e['shift']());}};_0x3b3199(++_0x21f72f);}(_0xec3d,0x1a1));var _0xdec3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdec3('0x0'));var util=require(_0xdec3('0x1'));var moment=require(_0xdec3('0x2'));var BPromise=require(_0xdec3('0x3'));var rs=require(_0xdec3('0x4'));var fs=require('fs');var Redis=require(_0xdec3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdec3('0x6'));var logger=require(_0xdec3('0x7'))('rpc');var config=require(_0xdec3('0x8'));var jayson=require(_0xdec3('0x9'));var client=jayson[_0xdec3('0xa')][_0xdec3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f80e2,_0x195f79,_0x28d7e7){return new BPromise(function(_0x345cf3,_0x199f54){return client[_0xdec3('0xc')](_0x1f80e2,_0x28d7e7)[_0xdec3('0xd')](function(_0x4342aa){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0xdec3('0xe'));logger['debug'](_0xdec3('0xf'),_0x195f79,_0xdec3('0xe'),JSON['stringify'](_0x4342aa));if(_0x4342aa[_0xdec3('0x10')]){if(_0x4342aa['error'][_0xdec3('0x11')]===0x1f4){logger[_0xdec3('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0x4342aa['error'][_0xdec3('0x12')]);return _0x199f54(_0x4342aa[_0xdec3('0x10')][_0xdec3('0x12')]);}logger[_0xdec3('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0x4342aa[_0xdec3('0x10')][_0xdec3('0x12')]);return _0x345cf3(_0x4342aa[_0xdec3('0x10')][_0xdec3('0x12')]);}else{logger[_0xdec3('0x13')](_0xdec3('0x14'),_0x195f79,'request\x20sent');_0x345cf3(_0x4342aa[_0xdec3('0x15')]['message']);}})['catch'](function(_0x2c34da){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0x2c34da);_0x199f54(_0x2c34da);});});}exports[_0xdec3('0x16')]=function(_0x307b1b){var _0x2da1b3=this;return new Promise(function(_0x41e9f9,_0x2ebbdf){return db['FreshdeskAccount'][_0xdec3('0x17')]({'raw':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x19')]===undefined?!![]:![]:!![],'where':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1a')]||null:null,'attributes':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1b')]||null:null,'limit':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1c')]||null:null,'include':_0x307b1b['options']?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1d')]?_['map'](_0x307b1b['options'][_0xdec3('0x1d')],function(_0x343bde){return{'model':db[_0x343bde[_0xdec3('0x1e')]],'as':_0x343bde['as'],'attributes':_0x343bde[_0xdec3('0x1b')],'include':_0x343bde[_0xdec3('0x1d')]?_['map'](_0x343bde[_0xdec3('0x1d')],function(_0x64aac3){return{'model':db[_0x64aac3[_0xdec3('0x1e')]],'as':_0x64aac3['as'],'attributes':_0x64aac3[_0xdec3('0x1b')],'include':_0x64aac3[_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x64aac3['include'],function(_0x37a0b0){return{'model':db[_0x37a0b0[_0xdec3('0x1e')]],'as':_0x37a0b0['as'],'attributes':_0x37a0b0[_0xdec3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14d1b7){logger[_0xdec3('0x13')](_0xdec3('0x16'),_0x307b1b);logger['debug'](_0xdec3('0x16'),_0x307b1b,JSON['stringify'](_0x14d1b7));_0x41e9f9(_0x14d1b7);})[_0xdec3('0x20')](function(_0x228d9d){logger[_0xdec3('0x10')](_0xdec3('0x16'),_0x228d9d[_0xdec3('0x12')],_0x307b1b);_0x2ebbdf(_0x2da1b3[_0xdec3('0x10')](0x1f4,_0x228d9d[_0xdec3('0x12')]));});});};exports[_0xdec3('0x21')]=function(_0x4f8343){var _0x13f083=this;return new Promise(function(_0x1b30bd,_0x4b550a){return db[_0xdec3('0x22')]['find']({'raw':_0x4f8343['options']?_0x4f8343[_0xdec3('0x18')][_0xdec3('0x19')]===undefined?!![]:![]:!![],'where':_0x4f8343[_0xdec3('0x18')]?_0x4f8343[_0xdec3('0x18')][_0xdec3('0x1a')]||null:null,'attributes':_0x4f8343[_0xdec3('0x18')]?_0x4f8343['options'][_0xdec3('0x1b')]||null:null,'include':_0x4f8343[_0xdec3('0x18')]?_0x4f8343['options'][_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x4f8343[_0xdec3('0x18')][_0xdec3('0x1d')],function(_0x6bd915){return{'model':db[_0x6bd915[_0xdec3('0x1e')]],'as':_0x6bd915['as'],'attributes':_0x6bd915[_0xdec3('0x1b')],'include':_0x6bd915[_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x6bd915[_0xdec3('0x1d')],function(_0x3efd57){return{'model':db[_0x3efd57['model']],'as':_0x3efd57['as'],'attributes':_0x3efd57[_0xdec3('0x1b')],'include':_0x3efd57[_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x3efd57[_0xdec3('0x1d')],function(_0x1603c6){return{'model':db[_0x1603c6[_0xdec3('0x1e')]],'as':_0x1603c6['as'],'attributes':_0x1603c6[_0xdec3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdec3('0xd')](function(_0x41eb67){logger[_0xdec3('0x13')](_0xdec3('0x21'),_0x4f8343);logger['debug'](_0xdec3('0x21'),_0x4f8343,JSON[_0xdec3('0x23')](_0x41eb67));_0x1b30bd(_0x41eb67);})[_0xdec3('0x20')](function(_0x196517){logger[_0xdec3('0x10')]('ShowFreshdeskAccount',_0x196517[_0xdec3('0x12')],_0x4f8343);_0x4b550a(_0x13f083[_0xdec3('0x10')](0x1f4,_0x196517[_0xdec3('0x12')]));});});}; \ No newline at end of file +var _0x5400=['lodash','util','../../config/utils','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','include','model','then','stringify','ShowFreshdeskAccount','find','map'];(function(_0x6595d5,_0x3f84e1){var _0x1b7304=function(_0x44f4f8){while(--_0x44f4f8){_0x6595d5['push'](_0x6595d5['shift']());}};_0x1b7304(++_0x3f84e1);}(_0x5400,0x15f));var _0x0540=function(_0x4e8224,_0x3d9649){_0x4e8224=_0x4e8224-0x0;var _0x78c86e=_0x5400[_0x4e8224];return _0x78c86e;};'use strict';var _=require(_0x0540('0x0'));var util=require(_0x0540('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0540('0x2'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0540('0x3'));var client=jayson[_0x0540('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29ea75,_0x3fbcc5,_0x26f274){return new BPromise(function(_0x4c9ab7,_0x4b27b0){return client[_0x0540('0x5')](_0x29ea75,_0x26f274)['then'](function(_0x351171){logger[_0x0540('0x6')](_0x0540('0x7'),_0x3fbcc5,_0x0540('0x8'));logger[_0x0540('0x9')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3fbcc5,_0x0540('0x8'),JSON['stringify'](_0x351171));if(_0x351171['error']){if(_0x351171[_0x0540('0xa')]['code']===0x1f4){logger[_0x0540('0xa')](_0x0540('0x7'),_0x3fbcc5,_0x351171[_0x0540('0xa')]['message']);return _0x4b27b0(_0x351171[_0x0540('0xa')]['message']);}logger[_0x0540('0xa')](_0x0540('0x7'),_0x3fbcc5,_0x351171[_0x0540('0xa')][_0x0540('0xb')]);return _0x4c9ab7(_0x351171[_0x0540('0xa')][_0x0540('0xb')]);}else{logger[_0x0540('0x6')](_0x0540('0x7'),_0x3fbcc5,_0x0540('0x8'));_0x4c9ab7(_0x351171[_0x0540('0xc')][_0x0540('0xb')]);}})[_0x0540('0xd')](function(_0x3f2169){logger[_0x0540('0xa')](_0x0540('0x7'),_0x3fbcc5,_0x3f2169);_0x4b27b0(_0x3f2169);});});}exports[_0x0540('0xe')]=function(_0x578a6a){var _0x4bbb48=this;return new Promise(function(_0xea8485,_0x554b88){return db[_0x0540('0xf')][_0x0540('0x10')]({'raw':_0x578a6a[_0x0540('0x11')]?_0x578a6a[_0x0540('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x578a6a[_0x0540('0x11')]?_0x578a6a[_0x0540('0x11')][_0x0540('0x12')]||null:null,'attributes':_0x578a6a[_0x0540('0x11')]?_0x578a6a[_0x0540('0x11')][_0x0540('0x13')]||null:null,'limit':_0x578a6a[_0x0540('0x11')]?_0x578a6a[_0x0540('0x11')]['limit']||null:null,'include':_0x578a6a[_0x0540('0x11')]?_0x578a6a[_0x0540('0x11')][_0x0540('0x14')]?_['map'](_0x578a6a[_0x0540('0x11')][_0x0540('0x14')],function(_0x5ca246){return{'model':db[_0x5ca246[_0x0540('0x15')]],'as':_0x5ca246['as'],'attributes':_0x5ca246[_0x0540('0x13')],'include':_0x5ca246[_0x0540('0x14')]?_['map'](_0x5ca246[_0x0540('0x14')],function(_0x46ac08){return{'model':db[_0x46ac08['model']],'as':_0x46ac08['as'],'attributes':_0x46ac08['attributes'],'include':_0x46ac08[_0x0540('0x14')]?_['map'](_0x46ac08[_0x0540('0x14')],function(_0x5ce6b0){return{'model':db[_0x5ce6b0[_0x0540('0x15')]],'as':_0x5ce6b0['as'],'attributes':_0x5ce6b0[_0x0540('0x13')]};}):[]};}):[]};}):[]:[]})[_0x0540('0x16')](function(_0x3e1216){logger[_0x0540('0x6')](_0x0540('0xe'),_0x578a6a);logger[_0x0540('0x9')]('GetFreshdeskAccount',_0x578a6a,JSON[_0x0540('0x17')](_0x3e1216));_0xea8485(_0x3e1216);})[_0x0540('0xd')](function(_0x3d3ffa){logger['error'](_0x0540('0xe'),_0x3d3ffa[_0x0540('0xb')],_0x578a6a);_0x554b88(_0x4bbb48[_0x0540('0xa')](0x1f4,_0x3d3ffa[_0x0540('0xb')]));});});};exports[_0x0540('0x18')]=function(_0x31dc45){var _0x5bcb01=this;return new Promise(function(_0x156018,_0x491f24){return db[_0x0540('0xf')][_0x0540('0x19')]({'raw':_0x31dc45[_0x0540('0x11')]?_0x31dc45[_0x0540('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x31dc45[_0x0540('0x11')]?_0x31dc45['options'][_0x0540('0x12')]||null:null,'attributes':_0x31dc45[_0x0540('0x11')]?_0x31dc45[_0x0540('0x11')][_0x0540('0x13')]||null:null,'include':_0x31dc45[_0x0540('0x11')]?_0x31dc45[_0x0540('0x11')][_0x0540('0x14')]?_[_0x0540('0x1a')](_0x31dc45['options'][_0x0540('0x14')],function(_0xcea782){return{'model':db[_0xcea782['model']],'as':_0xcea782['as'],'attributes':_0xcea782[_0x0540('0x13')],'include':_0xcea782['include']?_[_0x0540('0x1a')](_0xcea782[_0x0540('0x14')],function(_0x223e9e){return{'model':db[_0x223e9e[_0x0540('0x15')]],'as':_0x223e9e['as'],'attributes':_0x223e9e[_0x0540('0x13')],'include':_0x223e9e[_0x0540('0x14')]?_[_0x0540('0x1a')](_0x223e9e['include'],function(_0x275a1c){return{'model':db[_0x275a1c[_0x0540('0x15')]],'as':_0x275a1c['as'],'attributes':_0x275a1c[_0x0540('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e4b05){logger[_0x0540('0x6')](_0x0540('0x18'),_0x31dc45);logger[_0x0540('0x9')](_0x0540('0x18'),_0x31dc45,JSON[_0x0540('0x17')](_0x1e4b05));_0x156018(_0x1e4b05);})[_0x0540('0xd')](function(_0x174526){logger[_0x0540('0xa')](_0x0540('0x18'),_0x174526[_0x0540('0xb')],_0x31dc45);_0x491f24(_0x5bcb01[_0x0540('0xa')](0x1f4,_0x174526[_0x0540('0xb')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 751d31f..48790cc 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 _0x0718=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1e1982,_0x5f5093){var _0x533112=function(_0xafcaa1){while(--_0xafcaa1){_0x1e1982['push'](_0x1e1982['shift']());}};_0x533112(++_0x5f5093);}(_0x0718,0xf5));var _0x8071=function(_0x1db36f,_0x2ecd35){_0x1db36f=_0x1db36f-0x0;var _0x1d0fa9=_0x0718[_0x1db36f];return _0x1d0fa9;};'use strict';var multer=require(_0x8071('0x0'));var util=require(_0x8071('0x1'));var path=require('path');var timeout=require(_0x8071('0x2'));var express=require(_0x8071('0x3'));var router=express[_0x8071('0x4')]();var fs_extra=require(_0x8071('0x5'));var auth=require(_0x8071('0x6'));var interaction=require(_0x8071('0x7'));var config=require(_0x8071('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x8071('0x9')]('/',auth[_0x8071('0xa')](),controller[_0x8071('0xb')]);router[_0x8071('0x9')](_0x8071('0xc'),auth[_0x8071('0xa')](),controller[_0x8071('0xd')]);router[_0x8071('0x9')](_0x8071('0xe'),auth[_0x8071('0xa')](),controller[_0x8071('0xf')]);router['get'](_0x8071('0x10'),auth[_0x8071('0xa')](),controller[_0x8071('0x11')]);router['get'](_0x8071('0x12'),auth[_0x8071('0xa')](),controller[_0x8071('0x13')]);router[_0x8071('0x9')](_0x8071('0x14'),auth['isAuthenticated'](),controller[_0x8071('0x15')]);router[_0x8071('0x16')]('/',auth[_0x8071('0xa')](),controller['create']);router[_0x8071('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x8071('0x17')](_0x8071('0xc'),auth[_0x8071('0xa')](),controller[_0x8071('0x18')]);router[_0x8071('0x19')](_0x8071('0xc'),auth['isAuthenticated'](),controller[_0x8071('0x1a')]);module[_0x8071('0x1b')]=router; \ No newline at end of file +var _0x346d=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','setTags','put','update','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x346d,0x158));var _0xd346=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0x346d[_0x17823f];return _0x51fc21;};'use strict';var multer=require(_0xd346('0x0'));var util=require(_0xd346('0x1'));var path=require(_0xd346('0x2'));var timeout=require(_0xd346('0x3'));var express=require('express');var router=express[_0xd346('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd346('0x5'));var interaction=require(_0xd346('0x6'));var config=require('../../config/environment');var controller=require(_0xd346('0x7'));router['get']('/',auth[_0xd346('0x8')](),controller[_0xd346('0x9')]);router[_0xd346('0xa')](_0xd346('0xb'),auth['isAuthenticated'](),controller[_0xd346('0xc')]);router[_0xd346('0xa')](_0xd346('0xd'),auth[_0xd346('0x8')](),controller[_0xd346('0xe')]);router['get'](_0xd346('0xf'),auth['isAuthenticated'](),controller[_0xd346('0x10')]);router[_0xd346('0xa')]('/:id/descriptions',auth[_0xd346('0x8')](),controller[_0xd346('0x11')]);router[_0xd346('0xa')]('/:id/tags',auth[_0xd346('0x8')](),controller['getTags']);router[_0xd346('0x12')]('/',auth[_0xd346('0x8')](),controller[_0xd346('0x13')]);router[_0xd346('0x12')]('/:id/tags',auth[_0xd346('0x8')](),controller[_0xd346('0x14')]);router[_0xd346('0x15')](_0xd346('0xb'),auth[_0xd346('0x8')](),controller[_0xd346('0x16')]);router['delete'](_0xd346('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index e047442..a4d231c 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 _0x3b01=['exports','STRING'];(function(_0x5de5e7,_0x194091){var _0x3afaec=function(_0xbce5f0){while(--_0xbce5f0){_0x5de5e7['push'](_0x5de5e7['shift']());}};_0x3afaec(++_0x194091);}(_0x3b01,0x1f0));var _0x13b0=function(_0x4ecc45,_0x51fb59){_0x4ecc45=_0x4ecc45-0x0;var _0x3c9671=_0x3b01[_0x4ecc45];return _0x3c9671;};'use strict';var Sequelize=require('sequelize');module[_0x13b0('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x13b0('0x1')]}}; \ No newline at end of file +var _0xa3fe=['sequelize','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa3fe,0xab));var _0xea3f=function(_0x26dde3,_0x564b62){_0x26dde3=_0x26dde3-0x0;var _0x3a481a=_0xa3fe[_0x26dde3];return _0x3a481a;};'use strict';var Sequelize=require(_0xea3f('0x0'));module[_0xea3f('0x1')]={'name':{'type':Sequelize[_0xea3f('0x2')]},'description':{'type':Sequelize[_0xea3f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 06831cf..95761c2 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 _0x00ef=['fields','length','nolimit','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','FreshdeskField','sort','hasOwnProperty','getSubjects','getDescriptions','order','pick','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x4566db,_0x5da9a1){var _0x3167e6=function(_0x154ed8){while(--_0x154ed8){_0x4566db['push'](_0x4566db['shift']());}};_0x3167e6(++_0x5da9a1);}(_0x00ef,0x19d));var _0xf00e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x00ef[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xf00e('0x0'));var rimraf=require(_0xf00e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf00e('0x2'));var moment=require(_0xf00e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf00e('0x4'));var util=require(_0xf00e('0x5'));var path=require(_0xf00e('0x6'));var sox=require(_0xf00e('0x7'));var csv=require('to-csv');var ejs=require(_0xf00e('0x8'));var fs=require('fs');var fs_extra=require(_0xf00e('0x9'));var _=require(_0xf00e('0xa'));var squel=require(_0xf00e('0xb'));var crypto=require(_0xf00e('0xc'));var jsforce=require(_0xf00e('0xd'));var deskjs=require(_0xf00e('0xe'));var toCsv=require(_0xf00e('0xf'));var querystring=require(_0xf00e('0x10'));var Papa=require(_0xf00e('0x11'));var Redis=require(_0xf00e('0x12'));var authService=require(_0xf00e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf00e('0x14'));var hardwareService=require(_0xf00e('0x15'));var logger=require(_0xf00e('0x16'))('api');var utils=require(_0xf00e('0x17'));var config=require(_0xf00e('0x18'));var licenseUtil=require(_0xf00e('0x19'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xf00e('0x1a')][_0xf00e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x23255d,_0x376c72,_0x5df05c,_0x1116de){return new BPromise(function(_0x1b78c4,_0x21ee37){var _0x1fe93f=_0x1116de||client;return _0x1fe93f['request'](_0x23255d,_0x5df05c)[_0xf00e('0x1c')](function(_0x1cfb37){logger[_0xf00e('0x1d')](_0xf00e('0x1e'),_0x376c72,_0xf00e('0x1f'));logger['debug'](_0xf00e('0x20'),_0x376c72,_0xf00e('0x1f'),JSON[_0xf00e('0x21')](_0x1cfb37));if(_0x1cfb37[_0xf00e('0x22')]){if(_0x1cfb37['error'][_0xf00e('0x23')]===0x1f4){logger['error'](_0xf00e('0x1e'),_0x376c72,_0x1cfb37[_0xf00e('0x22')][_0xf00e('0x24')]);return _0x21ee37(_0x1cfb37[_0xf00e('0x22')][_0xf00e('0x24')]);}logger[_0xf00e('0x22')](_0xf00e('0x1e'),_0x376c72,_0x1cfb37[_0xf00e('0x22')][_0xf00e('0x24')]);return _0x1b78c4(_0x1cfb37[_0xf00e('0x22')]['message']);}else{logger[_0xf00e('0x1d')](_0xf00e('0x1e'),_0x376c72,_0xf00e('0x1f'));_0x1b78c4(_0x1cfb37[_0xf00e('0x25')]['message']);}})[_0xf00e('0x26')](function(_0xc9cf2a){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x376c72,_0xc9cf2a);_0x21ee37(_0xc9cf2a);});});}function respondWithStatusCode(_0x20be86,_0x45baa3){_0x45baa3=_0x45baa3||0xcc;return function(_0xe52ad5){if(_0xe52ad5){return _0x20be86[_0xf00e('0x27')](_0x45baa3);}return _0x20be86['status'](_0x45baa3)[_0xf00e('0x28')]();};}function respondWithResult(_0x5775c0,_0x66edf7){_0x66edf7=_0x66edf7||0xc8;return function(_0x6fd553){if(_0x6fd553){return _0x5775c0[_0xf00e('0x29')](_0x66edf7)[_0xf00e('0x2a')](_0x6fd553);}};}function respondWithFilteredResult(_0x16adb9,_0x561553){return function(_0x28022a){if(_0x28022a){var _0x57c401=typeof _0x561553['offset']==='undefined'&&typeof _0x561553[_0xf00e('0x2b')]===_0xf00e('0x2c');var _0x164a61=_0x28022a[_0xf00e('0x2d')];var _0x563187=_0x57c401?0x0:_0x561553['offset'];var _0x13e519=_0x57c401?_0x28022a['count']:_0x561553[_0xf00e('0x2e')]+_0x561553[_0xf00e('0x2b')];var _0x27f3a6;if(_0x13e519>=_0x164a61){_0x13e519=_0x164a61;_0x27f3a6=0xc8;}else{_0x27f3a6=0xce;}_0x16adb9[_0xf00e('0x29')](_0x27f3a6);return _0x16adb9[_0xf00e('0x2f')](_0xf00e('0x30'),_0x563187+'-'+_0x13e519+'/'+_0x164a61)[_0xf00e('0x2a')](_0x28022a);}return null;};}function patchUpdates(_0xe9066){return function(_0xdf469d){try{jsonpatch[_0xf00e('0x31')](_0xdf469d,_0xe9066,!![]);}catch(_0x5a5145){return BPromise['reject'](_0x5a5145);}return _0xdf469d[_0xf00e('0x32')]();};}function saveUpdates(_0x1f6f3f,_0x436005){return function(_0x26aedd){if(_0x26aedd){return _0x26aedd[_0xf00e('0x33')](_0x1f6f3f)[_0xf00e('0x1c')](function(_0x3370d4){return _0x3370d4;});}return null;};}function removeEntity(_0x586b23,_0x216356){return function(_0x53ad45){if(_0x53ad45){return _0x53ad45[_0xf00e('0x34')]()[_0xf00e('0x1c')](function(){_0x586b23[_0xf00e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a2e6a,_0x18a6a9){return function(_0x11617d){if(!_0x11617d){_0x9a2e6a[_0xf00e('0x27')](0x194);}return _0x11617d;};}function handleError(_0x2103a2,_0x274ee1){_0x274ee1=_0x274ee1||0x1f4;return function(_0x106ce5){logger[_0xf00e('0x22')](_0x106ce5[_0xf00e('0x35')]);if(_0x106ce5[_0xf00e('0x36')]){delete _0x106ce5[_0xf00e('0x36')];}_0x2103a2[_0xf00e('0x29')](_0x274ee1)['send'](_0x106ce5);};}exports['index']=function(_0x3eea4c,_0x581773){var _0x44822c={},_0x43d866={},_0x525a6e={'count':0x0,'rows':[]};var _0x327cff=_['map'](db[_0xf00e('0x37')][_0xf00e('0x38')],function(_0x303d4e){return{'name':_0x303d4e[_0xf00e('0x39')],'type':_0x303d4e[_0xf00e('0x3a')][_0xf00e('0x3b')]};});_0x43d866[_0xf00e('0x3c')]=_[_0xf00e('0x3d')](_0x327cff,_0xf00e('0x36'));_0x43d866[_0xf00e('0x3e')]=_[_0xf00e('0x3f')](_0x3eea4c[_0xf00e('0x3e')]);_0x43d866[_0xf00e('0x40')]=_[_0xf00e('0x41')](_0x43d866[_0xf00e('0x3c')],_0x43d866[_0xf00e('0x3e')]);_0x44822c[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x43d866['model'],qs[_0xf00e('0x43')](_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x44822c[_0xf00e('0x42')]=_0x44822c[_0xf00e('0x42')][_0xf00e('0x44')]?_0x44822c[_0xf00e('0x42')]:_0x43d866[_0xf00e('0x3c')];if(!_0x3eea4c[_0xf00e('0x3e')]['hasOwnProperty'](_0xf00e('0x45'))){_0x44822c[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x2b')]);_0x44822c[_0xf00e('0x2e')]=qs[_0xf00e('0x2e')](_0x3eea4c[_0xf00e('0x3e')]['offset']);}_0x44822c['order']=qs['sort'](_0x3eea4c[_0xf00e('0x3e')]['sort']);_0x44822c[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_['pick'](_0x3eea4c[_0xf00e('0x3e')],_0x43d866['filters']),_0x327cff);if(_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x47')]){_0x44822c[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x44822c[_0xf00e('0x46')],{'$or':_['map'](_0x327cff,function(_0x184887){if(_0x184887['type']!==_0xf00e('0x49')){var _0x5bad9c={};_0x5bad9c[_0x184887[_0xf00e('0x36')]]={'$like':'%'+_0x3eea4c[_0xf00e('0x3e')]['filter']+'%'};return _0x5bad9c;}})});}_0x44822c=_['merge']({},_0x44822c,_0x3eea4c[_0xf00e('0x4a')]);var _0x1cdcc2={'where':_0x44822c[_0xf00e('0x46')]};return db[_0xf00e('0x37')][_0xf00e('0x2d')](_0x1cdcc2)[_0xf00e('0x1c')](function(_0xacbdaf){_0x525a6e[_0xf00e('0x2d')]=_0xacbdaf;if(_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x4b')]){_0x44822c['include']=[{'all':!![]}];}return db[_0xf00e('0x37')][_0xf00e('0x4c')](_0x44822c);})[_0xf00e('0x1c')](function(_0x2e1bcf){_0x525a6e[_0xf00e('0x4d')]=_0x2e1bcf;return _0x525a6e;})[_0xf00e('0x1c')](respondWithFilteredResult(_0x581773,_0x44822c))[_0xf00e('0x26')](handleError(_0x581773,null));};exports[_0xf00e('0x4e')]=function(_0x158d24,_0x4a4011){var _0x1534a8={'raw':![],'where':{'id':_0x158d24[_0xf00e('0x4f')]['id']}},_0x47eefd={};_0x47eefd[_0xf00e('0x3c')]=_[_0xf00e('0x3f')](db[_0xf00e('0x37')][_0xf00e('0x38')]);_0x47eefd[_0xf00e('0x3e')]=_[_0xf00e('0x3f')](_0x158d24[_0xf00e('0x3e')]);_0x47eefd['filters']=_[_0xf00e('0x41')](_0x47eefd[_0xf00e('0x3c')],_0x47eefd[_0xf00e('0x3e')]);_0x1534a8['attributes']=_[_0xf00e('0x41')](_0x47eefd[_0xf00e('0x3c')],qs[_0xf00e('0x43')](_0x158d24[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x1534a8[_0xf00e('0x42')]=_0x1534a8[_0xf00e('0x42')][_0xf00e('0x44')]?_0x1534a8[_0xf00e('0x42')]:_0x47eefd[_0xf00e('0x3c')];if(_0x158d24['query'][_0xf00e('0x4b')]){_0x1534a8['include']=[{'all':!![]}];}_0x1534a8=_['merge']({},_0x1534a8,_0x158d24['options']);return db[_0xf00e('0x37')][_0xf00e('0x50')](_0x1534a8)['then'](handleEntityNotFound(_0x4a4011,null))[_0xf00e('0x1c')](respondWithResult(_0x4a4011,null))[_0xf00e('0x26')](handleError(_0x4a4011,null));};exports[_0xf00e('0x51')]=function(_0x291d3d,_0x4ef7a4){return db[_0xf00e('0x37')][_0xf00e('0x51')](_0x291d3d['body'],{})[_0xf00e('0x1c')](respondWithResult(_0x4ef7a4,0xc9))['catch'](handleError(_0x4ef7a4,null));};exports[_0xf00e('0x33')]=function(_0x31ac51,_0x68715e){if(_0x31ac51['body']['id']){delete _0x31ac51[_0xf00e('0x52')]['id'];}return db[_0xf00e('0x37')][_0xf00e('0x50')]({'where':{'id':_0x31ac51[_0xf00e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x68715e,null))[_0xf00e('0x1c')](saveUpdates(_0x31ac51[_0xf00e('0x52')],null))[_0xf00e('0x1c')](respondWithResult(_0x68715e,null))[_0xf00e('0x26')](handleError(_0x68715e,null));};exports[_0xf00e('0x34')]=function(_0x5b8e05,_0x47fb0a){return db[_0xf00e('0x37')][_0xf00e('0x50')]({'where':{'id':_0x5b8e05[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x47fb0a,null))['then'](removeEntity(_0x47fb0a,null))['catch'](handleError(_0x47fb0a,null));};exports[_0xf00e('0x53')]=function(_0x293f98,_0x42e877,_0x26d970){var _0x3c9ca8={};var _0x392cf4={};var _0x21c0ab;var _0x43f77b;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x293f98[_0xf00e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42e877,null))[_0xf00e('0x1c')](function(_0x2a120a){if(_0x2a120a){_0x21c0ab=_0x2a120a;_0x392cf4[_0xf00e('0x3c')]=_['keys'](db[_0xf00e('0x55')][_0xf00e('0x38')]);_0x392cf4[_0xf00e('0x3e')]=_['keys'](_0x293f98[_0xf00e('0x3e')]);_0x392cf4[_0xf00e('0x40')]=_[_0xf00e('0x41')](_0x392cf4['model'],_0x392cf4[_0xf00e('0x3e')]);_0x3c9ca8[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x392cf4[_0xf00e('0x3c')],qs[_0xf00e('0x43')](_0x293f98['query'][_0xf00e('0x43')]));_0x3c9ca8[_0xf00e('0x42')]=_0x3c9ca8[_0xf00e('0x42')][_0xf00e('0x44')]?_0x3c9ca8[_0xf00e('0x42')]:_0x392cf4[_0xf00e('0x3c')];_0x3c9ca8['order']=qs[_0xf00e('0x56')](_0x293f98[_0xf00e('0x3e')][_0xf00e('0x56')]);_0x3c9ca8[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_['pick'](_0x293f98[_0xf00e('0x3e')],_0x392cf4[_0xf00e('0x40')]));if(_0x293f98['query'][_0xf00e('0x47')]){_0x3c9ca8[_0xf00e('0x46')]=_['merge'](_0x3c9ca8[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x3c9ca8[_0xf00e('0x42')],function(_0x5dbd83){var _0x4d0e5c={};_0x4d0e5c[_0x5dbd83]={'$like':'%'+_0x293f98[_0xf00e('0x3e')][_0xf00e('0x47')]+'%'};return _0x4d0e5c;})});}_0x3c9ca8=_[_0xf00e('0x48')]({},_0x3c9ca8,_0x293f98[_0xf00e('0x4a')]);return _0x21c0ab[_0xf00e('0x53')](_0x3c9ca8);}})[_0xf00e('0x1c')](function(_0x2f4249){if(_0x2f4249){_0x43f77b=_0x2f4249['length'];if(!_0x293f98[_0xf00e('0x3e')][_0xf00e('0x57')](_0xf00e('0x45'))){_0x3c9ca8[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x293f98['query'][_0xf00e('0x2b')]);_0x3c9ca8[_0xf00e('0x2e')]=qs[_0xf00e('0x2e')](_0x293f98[_0xf00e('0x3e')][_0xf00e('0x2e')]);}return _0x21c0ab[_0xf00e('0x53')](_0x3c9ca8);}})['then'](function(_0x1429e2){if(_0x1429e2){return _0x1429e2?{'count':_0x43f77b,'rows':_0x1429e2}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x42e877,null))['catch'](handleError(_0x42e877,null));};exports[_0xf00e('0x58')]=function(_0x54c642,_0x2f1fee,_0x569f61){var _0x26ffb8={};var _0x6c143c={};var _0x13c7f2;var _0x3b0e84;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x54c642[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x2f1fee,null))[_0xf00e('0x1c')](function(_0xaff8f1){if(_0xaff8f1){_0x13c7f2=_0xaff8f1;_0x6c143c[_0xf00e('0x3c')]=_[_0xf00e('0x3f')](db['FreshdeskField'][_0xf00e('0x38')]);_0x6c143c[_0xf00e('0x3e')]=_[_0xf00e('0x3f')](_0x54c642[_0xf00e('0x3e')]);_0x6c143c['filters']=_[_0xf00e('0x41')](_0x6c143c[_0xf00e('0x3c')],_0x6c143c['query']);_0x26ffb8[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x6c143c['model'],qs['fields'](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x26ffb8[_0xf00e('0x42')]=_0x26ffb8['attributes'][_0xf00e('0x44')]?_0x26ffb8[_0xf00e('0x42')]:_0x6c143c['model'];_0x26ffb8['order']=qs[_0xf00e('0x56')](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x56')]);_0x26ffb8[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_['pick'](_0x54c642[_0xf00e('0x3e')],_0x6c143c[_0xf00e('0x40')]));if(_0x54c642['query']['filter']){_0x26ffb8[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x26ffb8[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x26ffb8[_0xf00e('0x42')],function(_0x1a0eb1){var _0x2a76b0={};_0x2a76b0[_0x1a0eb1]={'$like':'%'+_0x54c642[_0xf00e('0x3e')][_0xf00e('0x47')]+'%'};return _0x2a76b0;})});}_0x26ffb8=_['merge']({},_0x26ffb8,_0x54c642[_0xf00e('0x4a')]);return _0x13c7f2['getSubjects'](_0x26ffb8);}})[_0xf00e('0x1c')](function(_0x4c792d){if(_0x4c792d){_0x3b0e84=_0x4c792d[_0xf00e('0x44')];if(!_0x54c642[_0xf00e('0x3e')][_0xf00e('0x57')](_0xf00e('0x45'))){_0x26ffb8[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x2b')]);_0x26ffb8['offset']=qs[_0xf00e('0x2e')](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x2e')]);}return _0x13c7f2['getSubjects'](_0x26ffb8);}})[_0xf00e('0x1c')](function(_0x3f33d9){if(_0x3f33d9){return _0x3f33d9?{'count':_0x3b0e84,'rows':_0x3f33d9}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x2f1fee,null))[_0xf00e('0x26')](handleError(_0x2f1fee,null));};exports[_0xf00e('0x59')]=function(_0x2d1fa6,_0x40be85,_0x48ba3b){var _0x49d71a={};var _0x28c1fa={};var _0x5e3c0e;var _0x35dbed;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x2d1fa6[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x40be85,null))['then'](function(_0x49993b){if(_0x49993b){_0x5e3c0e=_0x49993b;_0x28c1fa[_0xf00e('0x3c')]=_['keys'](db['FreshdeskField'][_0xf00e('0x38')]);_0x28c1fa[_0xf00e('0x3e')]=_['keys'](_0x2d1fa6[_0xf00e('0x3e')]);_0x28c1fa['filters']=_[_0xf00e('0x41')](_0x28c1fa[_0xf00e('0x3c')],_0x28c1fa[_0xf00e('0x3e')]);_0x49d71a['attributes']=_[_0xf00e('0x41')](_0x28c1fa['model'],qs[_0xf00e('0x43')](_0x2d1fa6[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x49d71a[_0xf00e('0x42')]=_0x49d71a[_0xf00e('0x42')][_0xf00e('0x44')]?_0x49d71a['attributes']:_0x28c1fa[_0xf00e('0x3c')];_0x49d71a[_0xf00e('0x5a')]=qs[_0xf00e('0x56')](_0x2d1fa6['query'][_0xf00e('0x56')]);_0x49d71a[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_[_0xf00e('0x5b')](_0x2d1fa6[_0xf00e('0x3e')],_0x28c1fa[_0xf00e('0x40')]));if(_0x2d1fa6['query'][_0xf00e('0x47')]){_0x49d71a[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x49d71a[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x49d71a['attributes'],function(_0x59bea5){var _0x2760d8={};_0x2760d8[_0x59bea5]={'$like':'%'+_0x2d1fa6[_0xf00e('0x3e')]['filter']+'%'};return _0x2760d8;})});}_0x49d71a=_['merge']({},_0x49d71a,_0x2d1fa6[_0xf00e('0x4a')]);return _0x5e3c0e[_0xf00e('0x59')](_0x49d71a);}})[_0xf00e('0x1c')](function(_0x3334b7){if(_0x3334b7){_0x35dbed=_0x3334b7[_0xf00e('0x44')];if(!_0x2d1fa6[_0xf00e('0x3e')][_0xf00e('0x57')]('nolimit')){_0x49d71a[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x2d1fa6['query']['limit']);_0x49d71a[_0xf00e('0x2e')]=qs['offset'](_0x2d1fa6[_0xf00e('0x3e')][_0xf00e('0x2e')]);}return _0x5e3c0e[_0xf00e('0x59')](_0x49d71a);}})['then'](function(_0x195bec){if(_0x195bec){return _0x195bec?{'count':_0x35dbed,'rows':_0x195bec}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x40be85,null))[_0xf00e('0x26')](handleError(_0x40be85,null));};exports[_0xf00e('0x5c')]=function(_0x31a53b,_0x2659a2,_0x1fcba2){var _0x361904={};var _0x2c30f1={};var _0x187b3d;var _0x47110b;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x31a53b['params']['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x2659a2,null))[_0xf00e('0x1c')](function(_0x5b47c1){if(_0x5b47c1){_0x187b3d=_0x5b47c1;_0x2c30f1[_0xf00e('0x3c')]=_[_0xf00e('0x3f')](db[_0xf00e('0x5d')][_0xf00e('0x38')]);_0x2c30f1['query']=_[_0xf00e('0x3f')](_0x31a53b['query']);_0x2c30f1[_0xf00e('0x40')]=_[_0xf00e('0x41')](_0x2c30f1['model'],_0x2c30f1[_0xf00e('0x3e')]);_0x361904[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x2c30f1['model'],qs[_0xf00e('0x43')](_0x31a53b[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x361904[_0xf00e('0x42')]=_0x361904[_0xf00e('0x42')][_0xf00e('0x44')]?_0x361904['attributes']:_0x2c30f1[_0xf00e('0x3c')];_0x361904[_0xf00e('0x5a')]=qs[_0xf00e('0x56')](_0x31a53b[_0xf00e('0x3e')][_0xf00e('0x56')]);_0x361904[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_[_0xf00e('0x5b')](_0x31a53b['query'],_0x2c30f1[_0xf00e('0x40')]));if(_0x31a53b[_0xf00e('0x3e')][_0xf00e('0x47')]){_0x361904[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x361904[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x361904[_0xf00e('0x42')],function(_0x333cc2){var _0x5f22ac={};_0x5f22ac[_0x333cc2]={'$like':'%'+_0x31a53b[_0xf00e('0x3e')]['filter']+'%'};return _0x5f22ac;})});}_0x361904=_[_0xf00e('0x48')]({},_0x361904,_0x31a53b['options']);return _0x187b3d[_0xf00e('0x5c')](_0x361904);}})[_0xf00e('0x1c')](function(_0x124963){if(_0x124963){_0x47110b=_0x124963[_0xf00e('0x44')];if(!_0x31a53b['query']['hasOwnProperty'](_0xf00e('0x45'))){_0x361904[_0xf00e('0x2b')]=qs['limit'](_0x31a53b['query'][_0xf00e('0x2b')]);_0x361904[_0xf00e('0x2e')]=qs[_0xf00e('0x2e')](_0x31a53b[_0xf00e('0x3e')]['offset']);}return _0x187b3d['getTags'](_0x361904);}})[_0xf00e('0x1c')](function(_0xb6f3c1){if(_0xb6f3c1){return _0xb6f3c1?{'count':_0x47110b,'rows':_0xb6f3c1}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x2659a2,null))[_0xf00e('0x26')](handleError(_0x2659a2,null));};exports[_0xf00e('0x5e')]=function(_0x15affa,_0x48f661,_0x160644){if(_0x15affa[_0xf00e('0x52')]['id']){delete _0x15affa[_0xf00e('0x52')]['id'];}return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x15affa[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x48f661,null))[_0xf00e('0x1c')](function(_0x573f03){if(_0x573f03){return _0x573f03['setTags'](_0x15affa[_0xf00e('0x52')][_0xf00e('0x5f')]||[]);}return null;})[_0xf00e('0x1c')](respondWithResult(_0x48f661,null))['catch'](handleError(_0x48f661,null));}; \ No newline at end of file +var _0xcbc2=['message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','send','index','map','FreshdeskConfiguration','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','body','params','getFields','FreshdeskField','rawAttributes','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','findOne','Tag','setTags','ids','eml-format','request-promise','moment','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/logger','api','../../config/license/util','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4eab24,_0x1f2d0d){var _0x26b315=function(_0x274479){while(--_0x274479){_0x4eab24['push'](_0x4eab24['shift']());}};_0x26b315(++_0x1f2d0d);}(_0xcbc2,0x1b9));var _0x2cbc=function(_0x260b6f,_0x1edc36){_0x260b6f=_0x260b6f-0x0;var _0x3f672e=_0xcbc2[_0x260b6f];return _0x3f672e;};'use strict';var emlformat=require(_0x2cbc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2cbc('0x1'));var moment=require(_0x2cbc('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2cbc('0x3'));var path=require(_0x2cbc('0x4'));var sox=require(_0x2cbc('0x5'));var csv=require(_0x2cbc('0x6'));var ejs=require(_0x2cbc('0x7'));var fs=require('fs');var fs_extra=require(_0x2cbc('0x8'));var _=require(_0x2cbc('0x9'));var squel=require(_0x2cbc('0xa'));var crypto=require(_0x2cbc('0xb'));var jsforce=require(_0x2cbc('0xc'));var deskjs=require(_0x2cbc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2cbc('0xe'));var Papa=require(_0x2cbc('0xf'));var Redis=require(_0x2cbc('0x10'));var authService=require(_0x2cbc('0x11'));var qs=require(_0x2cbc('0x12'));var as=require(_0x2cbc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cbc('0x14'))(_0x2cbc('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2cbc('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x2cbc('0x17')][_0x2cbc('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x454730,_0x3e0990,_0x2a56f3,_0x237aab){return new BPromise(function(_0x585275,_0x1c89be){var _0x903f38=_0x237aab||client;return _0x903f38[_0x2cbc('0x19')](_0x454730,_0x2a56f3)[_0x2cbc('0x1a')](function(_0x554bb4){logger[_0x2cbc('0x1b')](_0x2cbc('0x1c'),_0x3e0990,_0x2cbc('0x1d'));logger[_0x2cbc('0x1e')](_0x2cbc('0x1f'),_0x3e0990,'request\x20sent',JSON['stringify'](_0x554bb4));if(_0x554bb4[_0x2cbc('0x20')]){if(_0x554bb4[_0x2cbc('0x20')][_0x2cbc('0x21')]===0x1f4){logger['error'](_0x2cbc('0x1c'),_0x3e0990,_0x554bb4['error']['message']);return _0x1c89be(_0x554bb4[_0x2cbc('0x20')][_0x2cbc('0x22')]);}logger['error'](_0x2cbc('0x1c'),_0x3e0990,_0x554bb4[_0x2cbc('0x20')][_0x2cbc('0x22')]);return _0x585275(_0x554bb4[_0x2cbc('0x20')][_0x2cbc('0x22')]);}else{logger[_0x2cbc('0x1b')](_0x2cbc('0x1c'),_0x3e0990,_0x2cbc('0x1d'));_0x585275(_0x554bb4[_0x2cbc('0x23')][_0x2cbc('0x22')]);}})[_0x2cbc('0x24')](function(_0x470e7d){logger[_0x2cbc('0x20')](_0x2cbc('0x1c'),_0x3e0990,_0x470e7d);_0x1c89be(_0x470e7d);});});}function respondWithStatusCode(_0x26ec7e,_0x4eb33f){_0x4eb33f=_0x4eb33f||0xcc;return function(_0x1fbcf4){if(_0x1fbcf4){return _0x26ec7e[_0x2cbc('0x25')](_0x4eb33f);}return _0x26ec7e[_0x2cbc('0x26')](_0x4eb33f)[_0x2cbc('0x27')]();};}function respondWithResult(_0x3cb814,_0x519660){_0x519660=_0x519660||0xc8;return function(_0x27ee45){if(_0x27ee45){return _0x3cb814[_0x2cbc('0x26')](_0x519660)[_0x2cbc('0x28')](_0x27ee45);}};}function respondWithFilteredResult(_0xbf0e96,_0x367666){return function(_0xd196dd){if(_0xd196dd){var _0x378781=typeof _0x367666[_0x2cbc('0x29')]===_0x2cbc('0x2a')&&typeof _0x367666['limit']===_0x2cbc('0x2a');var _0x25c661=_0xd196dd[_0x2cbc('0x2b')];var _0x3bab45=_0x378781?0x0:_0x367666[_0x2cbc('0x29')];var _0x429788=_0x378781?_0xd196dd[_0x2cbc('0x2b')]:_0x367666[_0x2cbc('0x29')]+_0x367666[_0x2cbc('0x2c')];var _0x509894;if(_0x429788>=_0x25c661){_0x429788=_0x25c661;_0x509894=0xc8;}else{_0x509894=0xce;}_0xbf0e96[_0x2cbc('0x26')](_0x509894);return _0xbf0e96[_0x2cbc('0x2d')](_0x2cbc('0x2e'),_0x3bab45+'-'+_0x429788+'/'+_0x25c661)[_0x2cbc('0x28')](_0xd196dd);}return null;};}function patchUpdates(_0x17a95b){return function(_0x41c1a1){try{jsonpatch[_0x2cbc('0x2f')](_0x41c1a1,_0x17a95b,!![]);}catch(_0x12ffc4){return BPromise[_0x2cbc('0x30')](_0x12ffc4);}return _0x41c1a1[_0x2cbc('0x31')]();};}function saveUpdates(_0xeb9c96,_0x36c588){return function(_0x30e0bc){if(_0x30e0bc){return _0x30e0bc[_0x2cbc('0x32')](_0xeb9c96)[_0x2cbc('0x1a')](function(_0x148de6){return _0x148de6;});}return null;};}function removeEntity(_0x16f6c0,_0x4734c1){return function(_0x31da21){if(_0x31da21){return _0x31da21['destroy']()['then'](function(){_0x16f6c0[_0x2cbc('0x26')](0xcc)[_0x2cbc('0x27')]();});}};}function handleEntityNotFound(_0x35e769,_0x1d10de){return function(_0x456b48){if(!_0x456b48){_0x35e769[_0x2cbc('0x25')](0x194);}return _0x456b48;};}function handleError(_0x1b6743,_0x43de00){_0x43de00=_0x43de00||0x1f4;return function(_0x182a1d){logger[_0x2cbc('0x20')](_0x182a1d[_0x2cbc('0x33')]);if(_0x182a1d['name']){delete _0x182a1d['name'];}_0x1b6743[_0x2cbc('0x26')](_0x43de00)[_0x2cbc('0x34')](_0x182a1d);};}exports[_0x2cbc('0x35')]=function(_0x510d98,_0x216357){var _0x29cfee={},_0x21500d={},_0x53a644={'count':0x0,'rows':[]};var _0x1ab716=_[_0x2cbc('0x36')](db[_0x2cbc('0x37')]['rawAttributes'],function(_0x155a06){return{'name':_0x155a06['fieldName'],'type':_0x155a06[_0x2cbc('0x38')][_0x2cbc('0x39')]};});_0x21500d[_0x2cbc('0x3a')]=_[_0x2cbc('0x36')](_0x1ab716,_0x2cbc('0x3b'));_0x21500d[_0x2cbc('0x3c')]=_[_0x2cbc('0x3d')](_0x510d98[_0x2cbc('0x3c')]);_0x21500d[_0x2cbc('0x3e')]=_[_0x2cbc('0x3f')](_0x21500d[_0x2cbc('0x3a')],_0x21500d[_0x2cbc('0x3c')]);_0x29cfee['attributes']=_[_0x2cbc('0x3f')](_0x21500d[_0x2cbc('0x3a')],qs['fields'](_0x510d98[_0x2cbc('0x3c')][_0x2cbc('0x40')]));_0x29cfee['attributes']=_0x29cfee[_0x2cbc('0x41')][_0x2cbc('0x42')]?_0x29cfee[_0x2cbc('0x41')]:_0x21500d['model'];if(!_0x510d98[_0x2cbc('0x3c')]['hasOwnProperty']('nolimit')){_0x29cfee[_0x2cbc('0x2c')]=qs[_0x2cbc('0x2c')](_0x510d98['query']['limit']);_0x29cfee['offset']=qs[_0x2cbc('0x29')](_0x510d98[_0x2cbc('0x3c')][_0x2cbc('0x29')]);}_0x29cfee[_0x2cbc('0x43')]=qs['sort'](_0x510d98[_0x2cbc('0x3c')][_0x2cbc('0x44')]);_0x29cfee[_0x2cbc('0x45')]=qs[_0x2cbc('0x3e')](_[_0x2cbc('0x46')](_0x510d98[_0x2cbc('0x3c')],_0x21500d['filters']),_0x1ab716);if(_0x510d98[_0x2cbc('0x3c')][_0x2cbc('0x47')]){_0x29cfee['where']=_[_0x2cbc('0x48')](_0x29cfee['where'],{'$or':_['map'](_0x1ab716,function(_0x321dbc){if(_0x321dbc[_0x2cbc('0x38')]!==_0x2cbc('0x49')){var _0xf5afcf={};_0xf5afcf[_0x321dbc['name']]={'$like':'%'+_0x510d98['query'][_0x2cbc('0x47')]+'%'};return _0xf5afcf;}})});}_0x29cfee=_[_0x2cbc('0x48')]({},_0x29cfee,_0x510d98[_0x2cbc('0x4a')]);var _0x51c54c={'where':_0x29cfee[_0x2cbc('0x45')]};return db['FreshdeskConfiguration'][_0x2cbc('0x2b')](_0x51c54c)[_0x2cbc('0x1a')](function(_0x345d94){_0x53a644[_0x2cbc('0x2b')]=_0x345d94;if(_0x510d98['query'][_0x2cbc('0x4b')]){_0x29cfee[_0x2cbc('0x4c')]=[{'all':!![]}];}return db[_0x2cbc('0x37')]['findAll'](_0x29cfee);})['then'](function(_0x3d60c4){_0x53a644[_0x2cbc('0x4d')]=_0x3d60c4;return _0x53a644;})[_0x2cbc('0x1a')](respondWithFilteredResult(_0x216357,_0x29cfee))['catch'](handleError(_0x216357,null));};exports[_0x2cbc('0x4e')]=function(_0x45b3f9,_0x2db769){var _0x32fa97={'raw':![],'where':{'id':_0x45b3f9['params']['id']}},_0xa1a826={};_0xa1a826[_0x2cbc('0x3a')]=_[_0x2cbc('0x3d')](db[_0x2cbc('0x37')]['rawAttributes']);_0xa1a826[_0x2cbc('0x3c')]=_[_0x2cbc('0x3d')](_0x45b3f9[_0x2cbc('0x3c')]);_0xa1a826[_0x2cbc('0x3e')]=_['intersection'](_0xa1a826[_0x2cbc('0x3a')],_0xa1a826[_0x2cbc('0x3c')]);_0x32fa97[_0x2cbc('0x41')]=_[_0x2cbc('0x3f')](_0xa1a826[_0x2cbc('0x3a')],qs[_0x2cbc('0x40')](_0x45b3f9[_0x2cbc('0x3c')][_0x2cbc('0x40')]));_0x32fa97['attributes']=_0x32fa97[_0x2cbc('0x41')][_0x2cbc('0x42')]?_0x32fa97[_0x2cbc('0x41')]:_0xa1a826[_0x2cbc('0x3a')];if(_0x45b3f9[_0x2cbc('0x3c')]['includeAll']){_0x32fa97[_0x2cbc('0x4c')]=[{'all':!![]}];}_0x32fa97=_['merge']({},_0x32fa97,_0x45b3f9['options']);return db[_0x2cbc('0x37')][_0x2cbc('0x4f')](_0x32fa97)[_0x2cbc('0x1a')](handleEntityNotFound(_0x2db769,null))['then'](respondWithResult(_0x2db769,null))[_0x2cbc('0x24')](handleError(_0x2db769,null));};exports[_0x2cbc('0x50')]=function(_0x9d92d5,_0x4b8866){return db[_0x2cbc('0x37')][_0x2cbc('0x50')](_0x9d92d5[_0x2cbc('0x51')],{})['then'](respondWithResult(_0x4b8866,0xc9))[_0x2cbc('0x24')](handleError(_0x4b8866,null));};exports[_0x2cbc('0x32')]=function(_0x170851,_0x16b53c){if(_0x170851['body']['id']){delete _0x170851[_0x2cbc('0x51')]['id'];}return db[_0x2cbc('0x37')]['find']({'where':{'id':_0x170851[_0x2cbc('0x52')]['id']}})[_0x2cbc('0x1a')](handleEntityNotFound(_0x16b53c,null))[_0x2cbc('0x1a')](saveUpdates(_0x170851['body'],null))[_0x2cbc('0x1a')](respondWithResult(_0x16b53c,null))[_0x2cbc('0x24')](handleError(_0x16b53c,null));};exports['destroy']=function(_0x35029a,_0xc6dd5f){return db[_0x2cbc('0x37')]['find']({'where':{'id':_0x35029a[_0x2cbc('0x52')]['id']}})['then'](handleEntityNotFound(_0xc6dd5f,null))['then'](removeEntity(_0xc6dd5f,null))[_0x2cbc('0x24')](handleError(_0xc6dd5f,null));};exports[_0x2cbc('0x53')]=function(_0x66d565,_0x4f97d2,_0x3ddbb){var _0x29997c={};var _0x26edf3={};var _0x3b6e0b;var _0x27f11b;return db[_0x2cbc('0x37')]['findOne']({'where':{'id':_0x66d565[_0x2cbc('0x52')]['id']}})['then'](handleEntityNotFound(_0x4f97d2,null))['then'](function(_0x5ee661){if(_0x5ee661){_0x3b6e0b=_0x5ee661;_0x26edf3[_0x2cbc('0x3a')]=_[_0x2cbc('0x3d')](db[_0x2cbc('0x54')][_0x2cbc('0x55')]);_0x26edf3[_0x2cbc('0x3c')]=_[_0x2cbc('0x3d')](_0x66d565[_0x2cbc('0x3c')]);_0x26edf3[_0x2cbc('0x3e')]=_[_0x2cbc('0x3f')](_0x26edf3[_0x2cbc('0x3a')],_0x26edf3[_0x2cbc('0x3c')]);_0x29997c[_0x2cbc('0x41')]=_['intersection'](_0x26edf3[_0x2cbc('0x3a')],qs[_0x2cbc('0x40')](_0x66d565[_0x2cbc('0x3c')][_0x2cbc('0x40')]));_0x29997c[_0x2cbc('0x41')]=_0x29997c[_0x2cbc('0x41')][_0x2cbc('0x42')]?_0x29997c['attributes']:_0x26edf3[_0x2cbc('0x3a')];_0x29997c[_0x2cbc('0x43')]=qs[_0x2cbc('0x44')](_0x66d565[_0x2cbc('0x3c')][_0x2cbc('0x44')]);_0x29997c[_0x2cbc('0x45')]=qs[_0x2cbc('0x3e')](_[_0x2cbc('0x46')](_0x66d565[_0x2cbc('0x3c')],_0x26edf3[_0x2cbc('0x3e')]));if(_0x66d565[_0x2cbc('0x3c')]['filter']){_0x29997c['where']=_[_0x2cbc('0x48')](_0x29997c[_0x2cbc('0x45')],{'$or':_['map'](_0x29997c[_0x2cbc('0x41')],function(_0x4ca7cb){var _0x133fc4={};_0x133fc4[_0x4ca7cb]={'$like':'%'+_0x66d565[_0x2cbc('0x3c')]['filter']+'%'};return _0x133fc4;})});}_0x29997c=_[_0x2cbc('0x48')]({},_0x29997c,_0x66d565[_0x2cbc('0x4a')]);return _0x3b6e0b[_0x2cbc('0x53')](_0x29997c);}})[_0x2cbc('0x1a')](function(_0x3c691e){if(_0x3c691e){_0x27f11b=_0x3c691e[_0x2cbc('0x42')];if(!_0x66d565[_0x2cbc('0x3c')][_0x2cbc('0x56')](_0x2cbc('0x57'))){_0x29997c['limit']=qs[_0x2cbc('0x2c')](_0x66d565[_0x2cbc('0x3c')][_0x2cbc('0x2c')]);_0x29997c[_0x2cbc('0x29')]=qs[_0x2cbc('0x29')](_0x66d565[_0x2cbc('0x3c')][_0x2cbc('0x29')]);}return _0x3b6e0b[_0x2cbc('0x53')](_0x29997c);}})[_0x2cbc('0x1a')](function(_0x427d68){if(_0x427d68){return _0x427d68?{'count':_0x27f11b,'rows':_0x427d68}:null;}})[_0x2cbc('0x1a')](respondWithResult(_0x4f97d2,null))['catch'](handleError(_0x4f97d2,null));};exports[_0x2cbc('0x58')]=function(_0x3d2c3c,_0x4af185,_0x5e308d){var _0xbb009b={};var _0x2f3134={};var _0x5252c5;var _0x118926;return db[_0x2cbc('0x37')]['findOne']({'where':{'id':_0x3d2c3c[_0x2cbc('0x52')]['id']}})[_0x2cbc('0x1a')](handleEntityNotFound(_0x4af185,null))['then'](function(_0x249d12){if(_0x249d12){_0x5252c5=_0x249d12;_0x2f3134[_0x2cbc('0x3a')]=_['keys'](db[_0x2cbc('0x54')][_0x2cbc('0x55')]);_0x2f3134[_0x2cbc('0x3c')]=_['keys'](_0x3d2c3c[_0x2cbc('0x3c')]);_0x2f3134['filters']=_[_0x2cbc('0x3f')](_0x2f3134['model'],_0x2f3134[_0x2cbc('0x3c')]);_0xbb009b[_0x2cbc('0x41')]=_['intersection'](_0x2f3134[_0x2cbc('0x3a')],qs[_0x2cbc('0x40')](_0x3d2c3c[_0x2cbc('0x3c')][_0x2cbc('0x40')]));_0xbb009b[_0x2cbc('0x41')]=_0xbb009b[_0x2cbc('0x41')][_0x2cbc('0x42')]?_0xbb009b[_0x2cbc('0x41')]:_0x2f3134['model'];_0xbb009b[_0x2cbc('0x43')]=qs[_0x2cbc('0x44')](_0x3d2c3c[_0x2cbc('0x3c')][_0x2cbc('0x44')]);_0xbb009b[_0x2cbc('0x45')]=qs[_0x2cbc('0x3e')](_[_0x2cbc('0x46')](_0x3d2c3c[_0x2cbc('0x3c')],_0x2f3134[_0x2cbc('0x3e')]));if(_0x3d2c3c[_0x2cbc('0x3c')][_0x2cbc('0x47')]){_0xbb009b['where']=_[_0x2cbc('0x48')](_0xbb009b[_0x2cbc('0x45')],{'$or':_[_0x2cbc('0x36')](_0xbb009b['attributes'],function(_0x4fa61d){var _0x1713da={};_0x1713da[_0x4fa61d]={'$like':'%'+_0x3d2c3c['query'][_0x2cbc('0x47')]+'%'};return _0x1713da;})});}_0xbb009b=_[_0x2cbc('0x48')]({},_0xbb009b,_0x3d2c3c[_0x2cbc('0x4a')]);return _0x5252c5[_0x2cbc('0x58')](_0xbb009b);}})['then'](function(_0x9960bc){if(_0x9960bc){_0x118926=_0x9960bc[_0x2cbc('0x42')];if(!_0x3d2c3c['query'][_0x2cbc('0x56')](_0x2cbc('0x57'))){_0xbb009b[_0x2cbc('0x2c')]=qs['limit'](_0x3d2c3c[_0x2cbc('0x3c')][_0x2cbc('0x2c')]);_0xbb009b[_0x2cbc('0x29')]=qs['offset'](_0x3d2c3c[_0x2cbc('0x3c')][_0x2cbc('0x29')]);}return _0x5252c5[_0x2cbc('0x58')](_0xbb009b);}})[_0x2cbc('0x1a')](function(_0x3d6c90){if(_0x3d6c90){return _0x3d6c90?{'count':_0x118926,'rows':_0x3d6c90}:null;}})[_0x2cbc('0x1a')](respondWithResult(_0x4af185,null))['catch'](handleError(_0x4af185,null));};exports[_0x2cbc('0x59')]=function(_0x3eb151,_0x198acc,_0x33ae0a){var _0x4928e0={};var _0x6fde8e={};var _0x558b7a;var _0x275197;return db[_0x2cbc('0x37')]['findOne']({'where':{'id':_0x3eb151[_0x2cbc('0x52')]['id']}})['then'](handleEntityNotFound(_0x198acc,null))[_0x2cbc('0x1a')](function(_0x367116){if(_0x367116){_0x558b7a=_0x367116;_0x6fde8e[_0x2cbc('0x3a')]=_['keys'](db['FreshdeskField'][_0x2cbc('0x55')]);_0x6fde8e[_0x2cbc('0x3c')]=_[_0x2cbc('0x3d')](_0x3eb151[_0x2cbc('0x3c')]);_0x6fde8e[_0x2cbc('0x3e')]=_[_0x2cbc('0x3f')](_0x6fde8e[_0x2cbc('0x3a')],_0x6fde8e[_0x2cbc('0x3c')]);_0x4928e0['attributes']=_[_0x2cbc('0x3f')](_0x6fde8e['model'],qs['fields'](_0x3eb151['query']['fields']));_0x4928e0['attributes']=_0x4928e0[_0x2cbc('0x41')][_0x2cbc('0x42')]?_0x4928e0[_0x2cbc('0x41')]:_0x6fde8e[_0x2cbc('0x3a')];_0x4928e0[_0x2cbc('0x43')]=qs[_0x2cbc('0x44')](_0x3eb151[_0x2cbc('0x3c')][_0x2cbc('0x44')]);_0x4928e0['where']=qs['filters'](_['pick'](_0x3eb151['query'],_0x6fde8e[_0x2cbc('0x3e')]));if(_0x3eb151[_0x2cbc('0x3c')][_0x2cbc('0x47')]){_0x4928e0['where']=_[_0x2cbc('0x48')](_0x4928e0[_0x2cbc('0x45')],{'$or':_[_0x2cbc('0x36')](_0x4928e0[_0x2cbc('0x41')],function(_0x29ce54){var _0x29a889={};_0x29a889[_0x29ce54]={'$like':'%'+_0x3eb151[_0x2cbc('0x3c')][_0x2cbc('0x47')]+'%'};return _0x29a889;})});}_0x4928e0=_['merge']({},_0x4928e0,_0x3eb151[_0x2cbc('0x4a')]);return _0x558b7a['getDescriptions'](_0x4928e0);}})[_0x2cbc('0x1a')](function(_0x49c503){if(_0x49c503){_0x275197=_0x49c503['length'];if(!_0x3eb151[_0x2cbc('0x3c')]['hasOwnProperty'](_0x2cbc('0x57'))){_0x4928e0['limit']=qs[_0x2cbc('0x2c')](_0x3eb151['query'][_0x2cbc('0x2c')]);_0x4928e0[_0x2cbc('0x29')]=qs[_0x2cbc('0x29')](_0x3eb151[_0x2cbc('0x3c')][_0x2cbc('0x29')]);}return _0x558b7a['getDescriptions'](_0x4928e0);}})[_0x2cbc('0x1a')](function(_0x5622bd){if(_0x5622bd){return _0x5622bd?{'count':_0x275197,'rows':_0x5622bd}:null;}})['then'](respondWithResult(_0x198acc,null))[_0x2cbc('0x24')](handleError(_0x198acc,null));};exports[_0x2cbc('0x5a')]=function(_0x53711c,_0x416381,_0x456e17){var _0x191701={};var _0x34e30d={};var _0xef38ae;var _0x40cc48;return db[_0x2cbc('0x37')][_0x2cbc('0x5b')]({'where':{'id':_0x53711c['params']['id']}})[_0x2cbc('0x1a')](handleEntityNotFound(_0x416381,null))[_0x2cbc('0x1a')](function(_0x404a3f){if(_0x404a3f){_0xef38ae=_0x404a3f;_0x34e30d[_0x2cbc('0x3a')]=_[_0x2cbc('0x3d')](db[_0x2cbc('0x5c')][_0x2cbc('0x55')]);_0x34e30d['query']=_[_0x2cbc('0x3d')](_0x53711c['query']);_0x34e30d[_0x2cbc('0x3e')]=_['intersection'](_0x34e30d[_0x2cbc('0x3a')],_0x34e30d[_0x2cbc('0x3c')]);_0x191701[_0x2cbc('0x41')]=_[_0x2cbc('0x3f')](_0x34e30d[_0x2cbc('0x3a')],qs[_0x2cbc('0x40')](_0x53711c[_0x2cbc('0x3c')][_0x2cbc('0x40')]));_0x191701['attributes']=_0x191701[_0x2cbc('0x41')][_0x2cbc('0x42')]?_0x191701[_0x2cbc('0x41')]:_0x34e30d[_0x2cbc('0x3a')];_0x191701[_0x2cbc('0x43')]=qs[_0x2cbc('0x44')](_0x53711c['query'][_0x2cbc('0x44')]);_0x191701[_0x2cbc('0x45')]=qs['filters'](_[_0x2cbc('0x46')](_0x53711c['query'],_0x34e30d['filters']));if(_0x53711c['query'][_0x2cbc('0x47')]){_0x191701[_0x2cbc('0x45')]=_[_0x2cbc('0x48')](_0x191701[_0x2cbc('0x45')],{'$or':_['map'](_0x191701[_0x2cbc('0x41')],function(_0x717b38){var _0x59025b={};_0x59025b[_0x717b38]={'$like':'%'+_0x53711c[_0x2cbc('0x3c')][_0x2cbc('0x47')]+'%'};return _0x59025b;})});}_0x191701=_[_0x2cbc('0x48')]({},_0x191701,_0x53711c[_0x2cbc('0x4a')]);return _0xef38ae[_0x2cbc('0x5a')](_0x191701);}})[_0x2cbc('0x1a')](function(_0x5292ef){if(_0x5292ef){_0x40cc48=_0x5292ef[_0x2cbc('0x42')];if(!_0x53711c[_0x2cbc('0x3c')][_0x2cbc('0x56')](_0x2cbc('0x57'))){_0x191701[_0x2cbc('0x2c')]=qs[_0x2cbc('0x2c')](_0x53711c['query']['limit']);_0x191701['offset']=qs[_0x2cbc('0x29')](_0x53711c['query'][_0x2cbc('0x29')]);}return _0xef38ae['getTags'](_0x191701);}})[_0x2cbc('0x1a')](function(_0x24033f){if(_0x24033f){return _0x24033f?{'count':_0x40cc48,'rows':_0x24033f}:null;}})[_0x2cbc('0x1a')](respondWithResult(_0x416381,null))[_0x2cbc('0x24')](handleError(_0x416381,null));};exports[_0x2cbc('0x5d')]=function(_0x55e3ae,_0x2cfd3a,_0x4a142d){if(_0x55e3ae[_0x2cbc('0x51')]['id']){delete _0x55e3ae[_0x2cbc('0x51')]['id'];}return db[_0x2cbc('0x37')]['findOne']({'where':{'id':_0x55e3ae[_0x2cbc('0x52')]['id']}})['then'](handleEntityNotFound(_0x2cfd3a,null))['then'](function(_0x5d11da){if(_0x5d11da){return _0x5d11da['setTags'](_0x55e3ae['body'][_0x2cbc('0x5e')]||[]);}return null;})[_0x2cbc('0x1a')](respondWithResult(_0x2cfd3a,null))[_0x2cbc('0x24')](handleError(_0x2cfd3a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 33d6b9a..afcafc9 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 _0xfd76=['path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x334524,_0x1fca82){var _0x870ae9=function(_0x422546){while(--_0x422546){_0x334524['push'](_0x334524['shift']());}};_0x870ae9(++_0x1fca82);}(_0xfd76,0x1cf));var _0x6fd7=function(_0x54375f,_0x17956c){_0x54375f=_0x54375f-0x0;var _0x1de28e=_0xfd76[_0x54375f];return _0x1de28e;};'use strict';var _=require(_0x6fd7('0x0'));var util=require('util');var logger=require(_0x6fd7('0x1'))('api');var moment=require(_0x6fd7('0x2'));var BPromise=require(_0x6fd7('0x3'));var rp=require(_0x6fd7('0x4'));var fs=require('fs');var path=require(_0x6fd7('0x5'));var rimraf=require(_0x6fd7('0x6'));var config=require(_0x6fd7('0x7'));var attributes=require(_0x6fd7('0x8'));module['exports']=function(_0x178e1c,_0x2db372){return _0x178e1c[_0x6fd7('0x9')](_0x6fd7('0xa'),attributes,{'tableName':_0x6fd7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e8=['../../config/logger','api','moment','bluebird','path','./intFreshdeskConfiguration.attributes','exports','int_freshdesk_configurations','lodash','util'];(function(_0x5693b0,_0x521a65){var _0x2b5e39=function(_0x51bffd){while(--_0x51bffd){_0x5693b0['push'](_0x5693b0['shift']());}};_0x2b5e39(++_0x521a65);}(_0x70e8,0xa8));var _0x870e=function(_0x1b5af8,_0x8ef856){_0x1b5af8=_0x1b5af8-0x0;var _0x24e994=_0x70e8[_0x1b5af8];return _0x24e994;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var logger=require(_0x870e('0x2'))(_0x870e('0x3'));var moment=require(_0x870e('0x4'));var BPromise=require(_0x870e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x870e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x870e('0x7'));module[_0x870e('0x8')]=function(_0x4f4de8,_0x2e5f5e){return _0x4f4de8['define']('FreshdeskConfiguration',attributes,{'tableName':_0x870e('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 d4cb56e..fdacbaa 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 _0xff02=['jayson/promise','client','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xff02,0x84));var _0x2ff0=function(_0x1cba4d,_0x25452c){_0x1cba4d=_0x1cba4d-0x0;var _0x2e8e1f=_0xff02[_0x1cba4d];return _0x2e8e1f;};'use strict';var _=require('lodash');var util=require(_0x2ff0('0x0'));var moment=require(_0x2ff0('0x1'));var BPromise=require(_0x2ff0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ff0('0x3'));var db=require(_0x2ff0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ff0('0x5'))(_0x2ff0('0x6'));var config=require(_0x2ff0('0x7'));var jayson=require(_0x2ff0('0x8'));var client=jayson[_0x2ff0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x514ad1,_0x807d18,_0x280a37){return new BPromise(function(_0x193bfa,_0x2570ba){return client[_0x2ff0('0xa')](_0x514ad1,_0x280a37)['then'](function(_0x5f5588){logger[_0x2ff0('0xb')](_0x2ff0('0xc'),_0x807d18,_0x2ff0('0xd'));logger[_0x2ff0('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x807d18,_0x2ff0('0xd'),JSON['stringify'](_0x5f5588));if(_0x5f5588[_0x2ff0('0xf')]){if(_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x10')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x807d18,_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x11')]);return _0x2570ba(_0x5f5588['error'][_0x2ff0('0x11')]);}logger[_0x2ff0('0xf')](_0x2ff0('0xc'),_0x807d18,_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x11')]);return _0x193bfa(_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x11')]);}else{logger[_0x2ff0('0xb')](_0x2ff0('0xc'),_0x807d18,_0x2ff0('0xd'));_0x193bfa(_0x5f5588[_0x2ff0('0x12')][_0x2ff0('0x11')]);}})[_0x2ff0('0x13')](function(_0x1a7951){logger[_0x2ff0('0xf')](_0x2ff0('0xc'),_0x807d18,_0x1a7951);_0x2570ba(_0x1a7951);});});} \ No newline at end of file +var _0xe635=['stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x5864ef,_0x496812){var _0x21c244=function(_0x433f8a){while(--_0x433f8a){_0x5864ef['push'](_0x5864ef['shift']());}};_0x21c244(++_0x496812);}(_0xe635,0xfe));var _0x5e63=function(_0xec69df,_0x2a8cc1){_0xec69df=_0xec69df-0x0;var _0x23f3d1=_0xe635[_0xec69df];return _0x23f3d1;};'use strict';var _=require(_0x5e63('0x0'));var util=require('util');var moment=require(_0x5e63('0x1'));var BPromise=require(_0x5e63('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e63('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e63('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5e63('0x5'));var client=jayson[_0x5e63('0x6')][_0x5e63('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24a392,_0x38ca97,_0x2f7091){return new BPromise(function(_0x45e067,_0x2b54e6){return client[_0x5e63('0x8')](_0x24a392,_0x2f7091)[_0x5e63('0x9')](function(_0x3caa8c){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x38ca97,_0x5e63('0xa'));logger[_0x5e63('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x38ca97,_0x5e63('0xa'),JSON[_0x5e63('0xc')](_0x3caa8c));if(_0x3caa8c[_0x5e63('0xd')]){if(_0x3caa8c[_0x5e63('0xd')][_0x5e63('0xe')]===0x1f4){logger[_0x5e63('0xd')](_0x5e63('0xf'),_0x38ca97,_0x3caa8c[_0x5e63('0xd')]['message']);return _0x2b54e6(_0x3caa8c[_0x5e63('0xd')][_0x5e63('0x10')]);}logger['error'](_0x5e63('0xf'),_0x38ca97,_0x3caa8c[_0x5e63('0xd')][_0x5e63('0x10')]);return _0x45e067(_0x3caa8c['error'][_0x5e63('0x10')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x38ca97,_0x5e63('0xa'));_0x45e067(_0x3caa8c[_0x5e63('0x11')][_0x5e63('0x10')]);}})[_0x5e63('0x12')](function(_0x28a730){logger[_0x5e63('0xd')](_0x5e63('0xf'),_0x38ca97,_0x28a730);_0x2b54e6(_0x28a730);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5d3e54b..78e2a83 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 _0x8694=['isAuthenticated','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','show','post','put'];(function(_0x56e159,_0x33a6bd){var _0x1d3efa=function(_0x2100e5){while(--_0x2100e5){_0x56e159['push'](_0x56e159['shift']());}};_0x1d3efa(++_0x33a6bd);}(_0x8694,0x77));var _0x4869=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x8694[_0x162780];return _0x1ea2dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4869('0x0'));var timeout=require(_0x4869('0x1'));var express=require(_0x4869('0x2'));var router=express[_0x4869('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4869('0x4'));var interaction=require(_0x4869('0x5'));var config=require(_0x4869('0x6'));var controller=require(_0x4869('0x7'));router[_0x4869('0x8')]('/',auth['isAuthenticated'](),controller[_0x4869('0x9')]);router[_0x4869('0x8')](_0x4869('0xa'),auth['isAuthenticated'](),controller[_0x4869('0xb')]);router[_0x4869('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4869('0xd')](_0x4869('0xa'),auth[_0x4869('0xe')](),controller[_0x4869('0xf')]);router[_0x4869('0x10')](_0x4869('0xa'),auth[_0x4869('0xe')](),controller[_0x4869('0x11')]);module[_0x4869('0x12')]=router; \ No newline at end of file +var _0x0d18=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','get','show','post','create'];(function(_0x60c914,_0x46a7d7){var _0x50c889=function(_0x1587bb){while(--_0x1587bb){_0x60c914['push'](_0x60c914['shift']());}};_0x50c889(++_0x46a7d7);}(_0x0d18,0x1bb));var _0x80d1=function(_0x1b854d,_0x61b824){_0x1b854d=_0x1b854d-0x0;var _0x3de3a4=_0x0d18[_0x1b854d];return _0x3de3a4;};'use strict';var multer=require(_0x80d1('0x0'));var util=require(_0x80d1('0x1'));var path=require(_0x80d1('0x2'));var timeout=require(_0x80d1('0x3'));var express=require('express');var router=express[_0x80d1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x80d1('0x5'));var config=require(_0x80d1('0x6'));var controller=require(_0x80d1('0x7'));router['get']('/',auth[_0x80d1('0x8')](),controller['index']);router[_0x80d1('0x9')]('/:id',auth[_0x80d1('0x8')](),controller[_0x80d1('0xa')]);router[_0x80d1('0xb')]('/',auth[_0x80d1('0x8')](),controller[_0x80d1('0xc')]);router[_0x80d1('0xd')](_0x80d1('0xe'),auth[_0x80d1('0x8')](),controller[_0x80d1('0xf')]);router[_0x80d1('0x10')](_0x80d1('0xe'),auth[_0x80d1('0x8')](),controller[_0x80d1('0x11')]);module[_0x80d1('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index d90782e..012a7e9 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 _0xc480=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x2636ea,_0x2222c5){var _0x27a5ee=function(_0x361cf5){while(--_0x361cf5){_0x2636ea['push'](_0x2636ea['shift']());}};_0x27a5ee(++_0x2222c5);}(_0xc480,0xf2));var _0x0c48=function(_0x901a37,_0x1b0b67){_0x901a37=_0x901a37-0x0;var _0x138d9d=_0xc480[_0x901a37];return _0x138d9d;};'use strict';var Sequelize=require(_0x0c48('0x0'));module[_0x0c48('0x1')]={'type':{'type':Sequelize[_0x0c48('0x2')](_0x0c48('0x3'),_0x0c48('0x4'),_0x0c48('0x5'),_0x0c48('0x6'),'picklist'),'defaultValue':_0x0c48('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0c48('0x7')]},'keyType':{'type':Sequelize[_0x0c48('0x2')]('string',_0x0c48('0x4'),_0x0c48('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0c48('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0c48('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0c48('0x7')]}}; \ No newline at end of file +var _0x2421=['STRING','BOOLEAN','sequelize','exports','string','variable','picklist','ENUM','customVariable'];(function(_0x514ac4,_0x2f63ee){var _0x547d8e=function(_0x84e07a){while(--_0x84e07a){_0x514ac4['push'](_0x514ac4['shift']());}};_0x547d8e(++_0x2f63ee);}(_0x2421,0x92));var _0x1242=function(_0x41cb33,_0x5ba2d9){_0x41cb33=_0x41cb33-0x0;var _0x5ac3d6=_0x2421[_0x41cb33];return _0x5ac3d6;};'use strict';var Sequelize=require(_0x1242('0x0'));module[_0x1242('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1242('0x2'),_0x1242('0x3'),'customVariable','keyValue',_0x1242('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1242('0x5')]('string',_0x1242('0x3'),_0x1242('0x6'))},'keyContent':{'type':Sequelize[_0x1242('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1242('0x7')]},'customField':{'type':Sequelize[_0x1242('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1242('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8c57496..d925279 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 _0xad95=['offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','FreshdeskField','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x51f492,_0x6b3e08){var _0x4c76eb=function(_0x21ee25){while(--_0x21ee25){_0x51f492['push'](_0x51f492['shift']());}};_0x4c76eb(++_0x6b3e08);}(_0xad95,0x70));var _0x5ad9=function(_0x2d46e0,_0x5e6cd4){_0x2d46e0=_0x2d46e0-0x0;var _0x452cae=_0xad95[_0x2d46e0];return _0x452cae;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){_0x5b816d[_0x5ad9('0x14')](0xcc)[_0x5ad9('0x20')]();});}};}function handleEntityNotFound(_0x1252e6,_0x36da5f){return function(_0x11d919){if(!_0x11d919){_0x1252e6['sendStatus'](0x194);}return _0x11d919;};}function handleError(_0x54e9dd,_0xe6540f){_0xe6540f=_0xe6540f||0x1f4;return function(_0x4f3889){logger[_0x5ad9('0x21')](_0x4f3889['stack']);if(_0x4f3889[_0x5ad9('0x22')]){delete _0x4f3889['name'];}_0x54e9dd['status'](_0xe6540f)[_0x5ad9('0x23')](_0x4f3889);};}exports[_0x5ad9('0x24')]=function(_0x49b3df,_0x509d41){var _0x3942fa={},_0x129804={},_0x1b6faf={'count':0x0,'rows':[]};var _0x2ad078=_[_0x5ad9('0x25')](db[_0x5ad9('0x26')]['rawAttributes'],function(_0x132ec6){return{'name':_0x132ec6[_0x5ad9('0x27')],'type':_0x132ec6[_0x5ad9('0x28')][_0x5ad9('0x29')]};});_0x129804['model']=_['map'](_0x2ad078,_0x5ad9('0x22'));_0x129804[_0x5ad9('0x2a')]=_['keys'](_0x49b3df['query']);_0x129804['filters']=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],_0x129804['query']);_0x3942fa[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],qs[_0x5ad9('0x2e')](_0x49b3df['query']['fields']));_0x3942fa[_0x5ad9('0x2d')]=_0x3942fa[_0x5ad9('0x2d')][_0x5ad9('0x2f')]?_0x3942fa[_0x5ad9('0x2d')]:_0x129804[_0x5ad9('0x2c')];if(!_0x49b3df['query'][_0x5ad9('0x30')](_0x5ad9('0x31'))){_0x3942fa[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x18')]);_0x3942fa['offset']=qs[_0x5ad9('0x16')](_0x49b3df[_0x5ad9('0x2a')]['offset']);}_0x3942fa[_0x5ad9('0x32')]=qs[_0x5ad9('0x33')](_0x49b3df['query'][_0x5ad9('0x33')]);_0x3942fa[_0x5ad9('0x34')]=qs[_0x5ad9('0x35')](_['pick'](_0x49b3df[_0x5ad9('0x2a')],_0x129804[_0x5ad9('0x35')]),_0x2ad078);if(_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x36')]){_0x3942fa['where']=_[_0x5ad9('0x37')](_0x3942fa[_0x5ad9('0x34')],{'$or':_[_0x5ad9('0x25')](_0x2ad078,function(_0x143700){if(_0x143700[_0x5ad9('0x28')]!==_0x5ad9('0x38')){var _0x1f0c06={};_0x1f0c06[_0x143700[_0x5ad9('0x22')]]={'$like':'%'+_0x49b3df[_0x5ad9('0x2a')]['filter']+'%'};return _0x1f0c06;}})});}_0x3942fa=_[_0x5ad9('0x37')]({},_0x3942fa,_0x49b3df[_0x5ad9('0x39')]);var _0x41d733={'where':_0x3942fa[_0x5ad9('0x34')]};return db[_0x5ad9('0x26')]['count'](_0x41d733)[_0x5ad9('0x1f')](function(_0xbbfaa0){_0x1b6faf[_0x5ad9('0x19')]=_0xbbfaa0;if(_0x49b3df['query'][_0x5ad9('0x3a')]){_0x3942fa[_0x5ad9('0x3b')]=[{'all':!![]}];}return db[_0x5ad9('0x26')]['findAll'](_0x3942fa);})[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x1b6faf['rows']=_0x5cfe5b;return _0x1b6faf;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x509d41,_0x3942fa))[_0x5ad9('0x3c')](handleError(_0x509d41,null));};exports[_0x5ad9('0x3d')]=function(_0x24f377,_0x5b8608){var _0x526fda={'raw':!![],'where':{'id':_0x24f377['params']['id']}},_0x552c39={};_0x552c39[_0x5ad9('0x2c')]=_['keys'](db[_0x5ad9('0x26')]['rawAttributes']);_0x552c39[_0x5ad9('0x2a')]=_[_0x5ad9('0x3e')](_0x24f377[_0x5ad9('0x2a')]);_0x552c39[_0x5ad9('0x35')]=_[_0x5ad9('0x2b')](_0x552c39[_0x5ad9('0x2c')],_0x552c39[_0x5ad9('0x2a')]);_0x526fda[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x552c39['model'],qs[_0x5ad9('0x2e')](_0x24f377[_0x5ad9('0x2a')][_0x5ad9('0x2e')]));_0x526fda[_0x5ad9('0x2d')]=_0x526fda[_0x5ad9('0x2d')]['length']?_0x526fda[_0x5ad9('0x2d')]:_0x552c39['model'];if(_0x24f377['query']['includeAll']){_0x526fda[_0x5ad9('0x3b')]=[{'all':!![]}];}_0x526fda=_[_0x5ad9('0x37')]({},_0x526fda,_0x24f377[_0x5ad9('0x39')]);return db['FreshdeskField'][_0x5ad9('0x3f')](_0x526fda)[_0x5ad9('0x1f')](handleEntityNotFound(_0x5b8608,null))[_0x5ad9('0x1f')](respondWithResult(_0x5b8608,null))[_0x5ad9('0x3c')](handleError(_0x5b8608,null));};exports['create']=function(_0x126086,_0x420677){return db[_0x5ad9('0x26')][_0x5ad9('0x40')](_0x126086['body'],{})[_0x5ad9('0x1f')](respondWithResult(_0x420677,0xc9))[_0x5ad9('0x3c')](handleError(_0x420677,null));};exports[_0x5ad9('0x1d')]=function(_0x1e03f,_0x479bbc){if(_0x1e03f[_0x5ad9('0x41')]['id']){delete _0x1e03f[_0x5ad9('0x41')]['id'];}return db['FreshdeskField'][_0x5ad9('0x3f')]({'where':{'id':_0x1e03f['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x479bbc,null))[_0x5ad9('0x1f')](saveUpdates(_0x1e03f[_0x5ad9('0x41')],null))[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,null))[_0x5ad9('0x3c')](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1e')]=function(_0xa0f426,_0x2c3945){return db[_0x5ad9('0x26')][_0x5ad9('0x3f')]({'where':{'id':_0xa0f426[_0x5ad9('0x42')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x2c3945,null))[_0x5ad9('0x1f')](removeEntity(_0x2c3945,null))[_0x5ad9('0x3c')](handleError(_0x2c3945,null));}; \ No newline at end of file +var _0xae60=['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','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','FreshdeskField','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x37263c,_0x5a628e){var _0x4e0240=function(_0x25e275){while(--_0x25e275){_0x37263c['push'](_0x37263c['shift']());}};_0x4e0240(++_0x5a628e);}(_0xae60,0x1c7));var _0x0ae6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xae60[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x5b86fe,_0x3630e6){return function(_0x2dcdb7){if(!_0x2dcdb7){_0x5b86fe['sendStatus'](0x194);}return _0x2dcdb7;};}function handleError(_0x55dbe1,_0x44eb95){_0x44eb95=_0x44eb95||0x1f4;return function(_0x3255a7){logger[_0x0ae6('0x2b')](_0x3255a7['stack']);if(_0x3255a7[_0x0ae6('0x2c')]){delete _0x3255a7[_0x0ae6('0x2c')];}_0x55dbe1[_0x0ae6('0x1d')](_0x44eb95)['send'](_0x3255a7);};}exports[_0x0ae6('0x2d')]=function(_0x29fef3,_0x449c33){var _0x232fbd={},_0x14eed5={},_0x257af5={'count':0x0,'rows':[]};var _0x4fc7bd=_['map'](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')],function(_0x4e6df8){return{'name':_0x4e6df8['fieldName'],'type':_0x4e6df8[_0x0ae6('0x30')][_0x0ae6('0x31')]};});_0x14eed5[_0x0ae6('0x32')]=_[_0x0ae6('0x33')](_0x4fc7bd,'name');_0x14eed5[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x29fef3[_0x0ae6('0x34')]);_0x14eed5['filters']=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],_0x14eed5[_0x0ae6('0x34')]);_0x232fbd[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x38')]));_0x232fbd[_0x0ae6('0x37')]=_0x232fbd['attributes'][_0x0ae6('0x39')]?_0x232fbd[_0x0ae6('0x37')]:_0x14eed5['model'];if(!_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3a')](_0x0ae6('0x3b'))){_0x232fbd['limit']=qs[_0x0ae6('0x22')](_0x29fef3['query']['limit']);_0x232fbd[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x20')]);}_0x232fbd[_0x0ae6('0x3c')]=qs['sort'](_0x29fef3['query'][_0x0ae6('0x3d')]);_0x232fbd['where']=qs[_0x0ae6('0x3e')](_['pick'](_0x29fef3[_0x0ae6('0x34')],_0x14eed5['filters']),_0x4fc7bd);if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3f')]){_0x232fbd[_0x0ae6('0x40')]=_[_0x0ae6('0x41')](_0x232fbd['where'],{'$or':_['map'](_0x4fc7bd,function(_0x43414c){if(_0x43414c[_0x0ae6('0x30')]!==_0x0ae6('0x42')){var _0x59480a={};_0x59480a[_0x43414c[_0x0ae6('0x2c')]]={'$like':'%'+_0x29fef3['query'][_0x0ae6('0x3f')]+'%'};return _0x59480a;}})});}_0x232fbd=_[_0x0ae6('0x41')]({},_0x232fbd,_0x29fef3[_0x0ae6('0x43')]);var _0x19403c={'where':_0x232fbd[_0x0ae6('0x40')]};return db[_0x0ae6('0x2e')]['count'](_0x19403c)[_0x0ae6('0x29')](function(_0x601ef9){_0x257af5[_0x0ae6('0x23')]=_0x601ef9;if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x44')]){_0x232fbd[_0x0ae6('0x45')]=[{'all':!![]}];}return db[_0x0ae6('0x2e')][_0x0ae6('0x46')](_0x232fbd);})['then'](function(_0x38faeb){_0x257af5[_0x0ae6('0x47')]=_0x38faeb;return _0x257af5;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x449c33,_0x232fbd))[_0x0ae6('0x48')](handleError(_0x449c33,null));};exports[_0x0ae6('0x49')]=function(_0x167ed1,_0x24c021){var _0x21431e={'raw':!![],'where':{'id':_0x167ed1[_0x0ae6('0x4a')]['id']}},_0xb38cbb={};_0xb38cbb[_0x0ae6('0x32')]=_[_0x0ae6('0x35')](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')]);_0xb38cbb[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x167ed1[_0x0ae6('0x34')]);_0xb38cbb[_0x0ae6('0x3e')]=_['intersection'](_0xb38cbb[_0x0ae6('0x32')],_0xb38cbb[_0x0ae6('0x34')]);_0x21431e[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0xb38cbb[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x167ed1['query'][_0x0ae6('0x38')]));_0x21431e[_0x0ae6('0x37')]=_0x21431e[_0x0ae6('0x37')][_0x0ae6('0x39')]?_0x21431e['attributes']:_0xb38cbb['model'];if(_0x167ed1['query'][_0x0ae6('0x44')]){_0x21431e[_0x0ae6('0x45')]=[{'all':!![]}];}_0x21431e=_[_0x0ae6('0x41')]({},_0x21431e,_0x167ed1['options']);return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')](_0x21431e)['then'](handleEntityNotFound(_0x24c021,null))[_0x0ae6('0x29')](respondWithResult(_0x24c021,null))[_0x0ae6('0x48')](handleError(_0x24c021,null));};exports['create']=function(_0x354efd,_0x3d1e75){return db['FreshdeskField'][_0x0ae6('0x4c')](_0x354efd[_0x0ae6('0x4d')],{})[_0x0ae6('0x29')](respondWithResult(_0x3d1e75,0xc9))['catch'](handleError(_0x3d1e75,null));};exports[_0x0ae6('0x28')]=function(_0x21de54,_0x46075a){if(_0x21de54[_0x0ae6('0x4d')]['id']){delete _0x21de54[_0x0ae6('0x4d')]['id'];}return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x21de54['params']['id']}})['then'](handleEntityNotFound(_0x46075a,null))[_0x0ae6('0x29')](saveUpdates(_0x21de54[_0x0ae6('0x4d')],null))[_0x0ae6('0x29')](respondWithResult(_0x46075a,null))['catch'](handleError(_0x46075a,null));};exports[_0x0ae6('0x2a')]=function(_0x51df5c,_0x582a5e){return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x51df5c[_0x0ae6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582a5e,null))[_0x0ae6('0x29')](removeEntity(_0x582a5e,null))[_0x0ae6('0x48')](handleError(_0x582a5e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 242cf9d..5756eec 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 _0x1928=['../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1928,0x138));var _0x8192=function(_0x3ed024,_0x2d5789){_0x3ed024=_0x3ed024-0x0;var _0x52bb99=_0x1928[_0x3ed024];return _0x52bb99;};'use strict';var _=require(_0x8192('0x0'));var util=require(_0x8192('0x1'));var logger=require(_0x8192('0x2'))('api');var moment=require(_0x8192('0x3'));var BPromise=require(_0x8192('0x4'));var rp=require(_0x8192('0x5'));var fs=require('fs');var path=require(_0x8192('0x6'));var rimraf=require(_0x8192('0x7'));var config=require(_0x8192('0x8'));var attributes=require(_0x8192('0x9'));module[_0x8192('0xa')]=function(_0x426163,_0x25f90e){return _0x426163[_0x8192('0xb')](_0x8192('0xc'),attributes,{'tableName':_0x8192('0xd'),'paranoid':![],'indexes':[{'name':_0x8192('0xe'),'fields':['idField',_0x8192('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x110f=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0x110f,0x188));var _0xf110=function(_0x10134a,_0x151bc0){_0x10134a=_0x10134a-0x0;var _0x398856=_0x110f[_0x10134a];return _0x398856;};'use strict';var _=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var logger=require(_0xf110('0x2'))(_0xf110('0x3'));var moment=require(_0xf110('0x4'));var BPromise=require(_0xf110('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf110('0x6'));var rimraf=require(_0xf110('0x7'));var config=require(_0xf110('0x8'));var attributes=require(_0xf110('0x9'));module[_0xf110('0xa')]=function(_0x58a164,_0x178a62){return _0x58a164[_0xf110('0xb')](_0xf110('0xc'),attributes,{'tableName':_0xf110('0xd'),'paranoid':![],'indexes':[{'name':_0xf110('0xe'),'fields':[_0xf110('0xf'),_0xf110('0x10')],'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 77d88c9..c45af4b 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 _0xe300=['../../config/logger','../../config/environment','jayson/promise','request','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x16ec41,_0x5b2974){var _0x4973f7=function(_0x400c3b){while(--_0x400c3b){_0x16ec41['push'](_0x16ec41['shift']());}};_0x4973f7(++_0x5b2974);}(_0xe300,0xdf));var _0x0e30=function(_0x121f69,_0x4412c2){_0x121f69=_0x121f69-0x0;var _0x240a3f=_0xe300[_0x121f69];return _0x240a3f;};'use strict';var _=require('lodash');var util=require(_0x0e30('0x0'));var moment=require(_0x0e30('0x1'));var BPromise=require(_0x0e30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e30('0x3'))['db'];var utils=require(_0x0e30('0x4'));var logger=require(_0x0e30('0x5'))('rpc');var config=require(_0x0e30('0x6'));var jayson=require(_0x0e30('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x549b25,_0x5e335a,_0x1fe6ff){return new BPromise(function(_0x5be0b5,_0xb62281){return client[_0x0e30('0x8')](_0x549b25,_0x1fe6ff)['then'](function(_0xc6f53e){logger[_0x0e30('0x9')](_0x0e30('0xa'),_0x5e335a,'request\x20sent');logger[_0x0e30('0xb')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x5e335a,_0x0e30('0xc'),JSON[_0x0e30('0xd')](_0xc6f53e));if(_0xc6f53e[_0x0e30('0xe')]){if(_0xc6f53e[_0x0e30('0xe')][_0x0e30('0xf')]===0x1f4){logger[_0x0e30('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5e335a,_0xc6f53e[_0x0e30('0xe')][_0x0e30('0x10')]);return _0xb62281(_0xc6f53e[_0x0e30('0xe')][_0x0e30('0x10')]);}logger['error'](_0x0e30('0xa'),_0x5e335a,_0xc6f53e['error'][_0x0e30('0x10')]);return _0x5be0b5(_0xc6f53e[_0x0e30('0xe')][_0x0e30('0x10')]);}else{logger[_0x0e30('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x5e335a,_0x0e30('0xc'));_0x5be0b5(_0xc6f53e[_0x0e30('0x11')]['message']);}})[_0x0e30('0x12')](function(_0x2e46a2){logger[_0x0e30('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5e335a,_0x2e46a2);_0xb62281(_0x2e46a2);});});} \ No newline at end of file +var _0x1e89=['client','request','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','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x208c57,_0x40db45){var _0x287671=function(_0x51c9b9){while(--_0x51c9b9){_0x208c57['push'](_0x208c57['shift']());}};_0x287671(++_0x40db45);}(_0x1e89,0x16e));var _0x91e8=function(_0x33232e,_0x153984){_0x33232e=_0x33232e-0x0;var _0x1cbda7=_0x1e89[_0x33232e];return _0x1cbda7;};'use strict';var _=require(_0x91e8('0x0'));var util=require(_0x91e8('0x1'));var moment=require(_0x91e8('0x2'));var BPromise=require(_0x91e8('0x3'));var rs=require(_0x91e8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x91e8('0x5'));var logger=require('../../config/logger')(_0x91e8('0x6'));var config=require(_0x91e8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x91e8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x550795,_0x5b4cad,_0x24df1a){return new BPromise(function(_0x1971e1,_0x4e193b){return client[_0x91e8('0x9')](_0x550795,_0x24df1a)[_0x91e8('0xa')](function(_0x40473b){logger[_0x91e8('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x5b4cad,_0x91e8('0xc'));logger[_0x91e8('0xd')](_0x91e8('0xe'),_0x5b4cad,_0x91e8('0xc'),JSON[_0x91e8('0xf')](_0x40473b));if(_0x40473b[_0x91e8('0x10')]){if(_0x40473b[_0x91e8('0x10')][_0x91e8('0x11')]===0x1f4){logger[_0x91e8('0x10')](_0x91e8('0x12'),_0x5b4cad,_0x40473b['error']['message']);return _0x4e193b(_0x40473b[_0x91e8('0x10')]['message']);}logger[_0x91e8('0x10')](_0x91e8('0x12'),_0x5b4cad,_0x40473b['error'][_0x91e8('0x13')]);return _0x1971e1(_0x40473b['error'][_0x91e8('0x13')]);}else{logger['info'](_0x91e8('0x12'),_0x5b4cad,'request\x20sent');_0x1971e1(_0x40473b[_0x91e8('0x14')][_0x91e8('0x13')]);}})[_0x91e8('0x15')](function(_0x13ed11){logger['error'](_0x91e8('0x12'),_0x5b4cad,_0x13ed11);_0x4e193b(_0x13ed11);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 3098674..577d5a9 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 _0xe511=['get','index','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x4b5b68,_0x3c02bd){var _0x3108ae=function(_0xdb9d31){while(--_0xdb9d31){_0x4b5b68['push'](_0x4b5b68['shift']());}};_0x3108ae(++_0x3c02bd);}(_0xe511,0x16f));var _0x1e51=function(_0x3ed0ec,_0x44ece7){_0x3ed0ec=_0x3ed0ec-0x0;var _0x4b32f4=_0xe511[_0x3ed0ec];return _0x4b32f4;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x10')]);router[_0x1e51('0xf')](_0x1e51('0x11'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x14')]);router[_0x1e51('0x15')](_0x1e51('0x16'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x17')]);module[_0x1e51('0x18')]=router; \ No newline at end of file +var _0x0565=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','delete','/:id','exports'];(function(_0x29b09d,_0x15af00){var _0x118548=function(_0x5b8126){while(--_0x5b8126){_0x29b09d['push'](_0x29b09d['shift']());}};_0x118548(++_0x15af00);}(_0x0565,0xf2));var _0x5056=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0565[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var path=require(_0x5056('0x2'));var timeout=require(_0x5056('0x3'));var express=require(_0x5056('0x4'));var router=express[_0x5056('0x5')]();var fs_extra=require(_0x5056('0x6'));var auth=require(_0x5056('0x7'));var interaction=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var controller=require('./intFreshsalesAccount.controller');router[_0x5056('0xa')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0xc')]);router[_0x5056('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5056('0xd')]);router[_0x5056('0xa')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller[_0x5056('0xf')]);router[_0x5056('0xa')](_0x5056('0x10'),auth[_0x5056('0xb')](),controller['getFields']);router[_0x5056('0x11')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0x12')]);router['post']('/:id/configurations',auth[_0x5056('0xb')](),controller['addConfiguration']);router['put']('/:id',auth[_0x5056('0xb')](),controller['update']);router[_0x5056('0x13')](_0x5056('0x14'),auth[_0x5056('0xb')](),controller['destroy']);module[_0x5056('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 9ed5ac7..418cbb5 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(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x524e,0x15e));var _0xe524=function(_0x26529a,_0x3ba5d9){_0x26529a=_0x26529a-0x0;var _0x1af2ea=_0x524e[_0x26529a];return _0x1af2ea;};'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 _0x4888=['exports','STRING','username'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x4888,0x198));var _0x8488=function(_0x42bfc9,_0x92ccf5){_0x42bfc9=_0x42bfc9-0x0;var _0x645e2b=_0x4888[_0x42bfc9];return _0x645e2b;};'use strict';var Sequelize=require('sequelize');module[_0x8488('0x0')]={'name':{'type':Sequelize[_0x8488('0x1')]},'description':{'type':Sequelize[_0x8488('0x1')]},'username':{'type':Sequelize[_0x8488('0x1')],'unique':_0x8488('0x2')},'apiKey':{'type':Sequelize[_0x8488('0x1')]},'remoteUri':{'type':Sequelize[_0x8488('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x8488('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 5a8f69d..1359472 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 _0x87f8=['Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','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','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','status','end','json','limit','undefined','count','offset','set','apply','reject','save','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','params','find','body','findOne','sort','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87f8,0x152));var _0x887f=function(_0x5e373c,_0x3235fe){_0x5e373c=_0x5e373c-0x0;var _0x186161=_0x87f8[_0x5e373c];return _0x186161;};'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 hardwareService=require(_0x887f('0x11'));var logger=require('../../config/logger')(_0x887f('0x12'));var utils=require(_0x887f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x887f('0x14'))['db'];var integrations=require(_0x887f('0x15'));var jayson=require(_0x887f('0x16'));var client=jayson['client'][_0x887f('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3abe48,_0x571066,_0x16bbc4,_0x58152e){return new BPromise(function(_0x59b7ab,_0xabcefd){var _0x46920e=_0x58152e||client;return _0x46920e['request'](_0x3abe48,_0x16bbc4)[_0x887f('0x18')](function(_0xf69779){logger[_0x887f('0x19')]('FreshsalesAccount,\x20%s,\x20%s',_0x571066,_0x887f('0x1a'));logger[_0x887f('0x1b')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x571066,_0x887f('0x1a'),JSON[_0x887f('0x1c')](_0xf69779));if(_0xf69779[_0x887f('0x1d')]){if(_0xf69779[_0x887f('0x1d')][_0x887f('0x1e')]===0x1f4){logger[_0x887f('0x1d')](_0x887f('0x1f'),_0x571066,_0xf69779[_0x887f('0x1d')][_0x887f('0x20')]);return _0xabcefd(_0xf69779[_0x887f('0x1d')][_0x887f('0x20')]);}logger[_0x887f('0x1d')](_0x887f('0x1f'),_0x571066,_0xf69779['error'][_0x887f('0x20')]);return _0x59b7ab(_0xf69779[_0x887f('0x1d')]['message']);}else{logger[_0x887f('0x19')](_0x887f('0x1f'),_0x571066,'request\x20sent');_0x59b7ab(_0xf69779[_0x887f('0x21')]['message']);}})[_0x887f('0x22')](function(_0x23c0ea){logger['error'](_0x887f('0x1f'),_0x571066,_0x23c0ea);_0xabcefd(_0x23c0ea);});});}function respondWithStatusCode(_0x3af68e,_0x3d6948){_0x3d6948=_0x3d6948||0xcc;return function(_0x9f7131){if(_0x9f7131){return _0x3af68e['sendStatus'](_0x3d6948);}return _0x3af68e[_0x887f('0x23')](_0x3d6948)[_0x887f('0x24')]();};}function respondWithResult(_0x5c7f41,_0x1a1657){_0x1a1657=_0x1a1657||0xc8;return function(_0x42c8bd){if(_0x42c8bd){return _0x5c7f41['status'](_0x1a1657)[_0x887f('0x25')](_0x42c8bd);}};}function respondWithFilteredResult(_0x7eef96,_0x108890){return function(_0x4f25b1){if(_0x4f25b1){var _0x267e67=typeof _0x108890['offset']==='undefined'&&typeof _0x108890[_0x887f('0x26')]===_0x887f('0x27');var _0xee5126=_0x4f25b1[_0x887f('0x28')];var _0x1c5ce3=_0x267e67?0x0:_0x108890['offset'];var _0x59d489=_0x267e67?_0x4f25b1[_0x887f('0x28')]:_0x108890[_0x887f('0x29')]+_0x108890[_0x887f('0x26')];var _0x36cbf0;if(_0x59d489>=_0xee5126){_0x59d489=_0xee5126;_0x36cbf0=0xc8;}else{_0x36cbf0=0xce;}_0x7eef96['status'](_0x36cbf0);return _0x7eef96[_0x887f('0x2a')]('Content-Range',_0x1c5ce3+'-'+_0x59d489+'/'+_0xee5126)[_0x887f('0x25')](_0x4f25b1);}return null;};}function patchUpdates(_0x543c26){return function(_0xbc9cea){try{jsonpatch[_0x887f('0x2b')](_0xbc9cea,_0x543c26,!![]);}catch(_0x32c332){return BPromise[_0x887f('0x2c')](_0x32c332);}return _0xbc9cea[_0x887f('0x2d')]();};}function saveUpdates(_0x3375c7,_0x21040d){return function(_0x173944){if(_0x173944){return _0x173944['update'](_0x3375c7)[_0x887f('0x18')](function(_0x3d395d){return _0x3d395d;});}return null;};}function removeEntity(_0x8f6faf,_0x470578){return function(_0x372ff2){if(_0x372ff2){return _0x372ff2[_0x887f('0x2e')]()['then'](function(){_0x8f6faf[_0x887f('0x23')](0xcc)[_0x887f('0x24')]();});}};}function handleEntityNotFound(_0x450f83,_0x785968){return function(_0x297d6e){if(!_0x297d6e){_0x450f83['sendStatus'](0x194);}return _0x297d6e;};}function handleError(_0x2a4d88,_0x1bd047){_0x1bd047=_0x1bd047||0x1f4;return function(_0x4efdff){logger[_0x887f('0x1d')](_0x4efdff[_0x887f('0x2f')]);if(_0x4efdff[_0x887f('0x30')]){delete _0x4efdff['name'];}_0x2a4d88[_0x887f('0x23')](_0x1bd047)[_0x887f('0x31')](_0x4efdff);};}exports[_0x887f('0x32')]=function(_0x202c99,_0x580bae){var _0x474a9c={},_0x22295f={},_0x4c1219={'count':0x0,'rows':[]};var _0x51e449=_[_0x887f('0x33')](db[_0x887f('0x34')][_0x887f('0x35')],function(_0x5a4d32){return{'name':_0x5a4d32[_0x887f('0x36')],'type':_0x5a4d32['type']['key']};});_0x22295f[_0x887f('0x37')]=_[_0x887f('0x33')](_0x51e449,_0x887f('0x30'));_0x22295f['query']=_[_0x887f('0x38')](_0x202c99[_0x887f('0x39')]);_0x22295f[_0x887f('0x3a')]=_['intersection'](_0x22295f[_0x887f('0x37')],_0x22295f[_0x887f('0x39')]);_0x474a9c['attributes']=_[_0x887f('0x3b')](_0x22295f[_0x887f('0x37')],qs[_0x887f('0x3c')](_0x202c99[_0x887f('0x39')][_0x887f('0x3c')]));_0x474a9c[_0x887f('0x3d')]=_0x474a9c['attributes'][_0x887f('0x3e')]?_0x474a9c[_0x887f('0x3d')]:_0x22295f[_0x887f('0x37')];if(!_0x202c99[_0x887f('0x39')][_0x887f('0x3f')](_0x887f('0x40'))){_0x474a9c[_0x887f('0x26')]=qs['limit'](_0x202c99[_0x887f('0x39')][_0x887f('0x26')]);_0x474a9c[_0x887f('0x29')]=qs[_0x887f('0x29')](_0x202c99['query'][_0x887f('0x29')]);}_0x474a9c[_0x887f('0x41')]=qs['sort'](_0x202c99[_0x887f('0x39')]['sort']);_0x474a9c['where']=qs[_0x887f('0x3a')](_[_0x887f('0x42')](_0x202c99[_0x887f('0x39')],_0x22295f[_0x887f('0x3a')]),_0x51e449);if(_0x202c99[_0x887f('0x39')][_0x887f('0x43')]){_0x474a9c['where']=_[_0x887f('0x44')](_0x474a9c[_0x887f('0x45')],{'$or':_[_0x887f('0x33')](_0x51e449,function(_0x39d3a5){if(_0x39d3a5[_0x887f('0x46')]!==_0x887f('0x47')){var _0x3a0e95={};_0x3a0e95[_0x39d3a5[_0x887f('0x30')]]={'$like':'%'+_0x202c99[_0x887f('0x39')][_0x887f('0x43')]+'%'};return _0x3a0e95;}})});}_0x474a9c=_['merge']({},_0x474a9c,_0x202c99[_0x887f('0x48')]);var _0x9d59f3={'where':_0x474a9c[_0x887f('0x45')]};return db['FreshsalesAccount'][_0x887f('0x28')](_0x9d59f3)[_0x887f('0x18')](function(_0x5a354f){_0x4c1219[_0x887f('0x28')]=_0x5a354f;if(_0x202c99[_0x887f('0x39')][_0x887f('0x49')]){_0x474a9c[_0x887f('0x4a')]=[{'all':!![]}];}return db[_0x887f('0x34')][_0x887f('0x4b')](_0x474a9c);})[_0x887f('0x18')](function(_0x514e59){_0x4c1219['rows']=_0x514e59;return _0x4c1219;})[_0x887f('0x18')](respondWithFilteredResult(_0x580bae,_0x474a9c))[_0x887f('0x22')](handleError(_0x580bae,null));};exports['show']=function(_0x297021,_0x3fcd12){var _0x2bdd65={'raw':![],'where':{'id':_0x297021[_0x887f('0x4c')]['id']}},_0x26a960={};_0x26a960[_0x887f('0x37')]=_['keys'](db['FreshsalesAccount'][_0x887f('0x35')]);_0x26a960['query']=_[_0x887f('0x38')](_0x297021['query']);_0x26a960[_0x887f('0x3a')]=_[_0x887f('0x3b')](_0x26a960[_0x887f('0x37')],_0x26a960[_0x887f('0x39')]);_0x2bdd65[_0x887f('0x3d')]=_['intersection'](_0x26a960[_0x887f('0x37')],qs[_0x887f('0x3c')](_0x297021[_0x887f('0x39')][_0x887f('0x3c')]));_0x2bdd65[_0x887f('0x3d')]=_0x2bdd65[_0x887f('0x3d')][_0x887f('0x3e')]?_0x2bdd65[_0x887f('0x3d')]:_0x26a960['model'];if(_0x297021[_0x887f('0x39')][_0x887f('0x49')]){_0x2bdd65[_0x887f('0x4a')]=[{'all':!![]}];}_0x2bdd65=_[_0x887f('0x44')]({},_0x2bdd65,_0x297021[_0x887f('0x48')]);return db[_0x887f('0x34')][_0x887f('0x4d')](_0x2bdd65)[_0x887f('0x18')](handleEntityNotFound(_0x3fcd12,null))['then'](respondWithResult(_0x3fcd12,null))[_0x887f('0x22')](handleError(_0x3fcd12,null));};exports['create']=function(_0x5188d1,_0x5f1e2a){return db['FreshsalesAccount']['create'](_0x5188d1['body'],{})['then'](respondWithResult(_0x5f1e2a,0xc9))[_0x887f('0x22')](handleError(_0x5f1e2a,null));};exports['update']=function(_0xa34900,_0x3cc7a7){if(_0xa34900['body']['id']){delete _0xa34900['body']['id'];}return db['FreshsalesAccount'][_0x887f('0x4d')]({'where':{'id':_0xa34900[_0x887f('0x4c')]['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x3cc7a7,null))['then'](saveUpdates(_0xa34900[_0x887f('0x4e')],null))['then'](respondWithResult(_0x3cc7a7,null))[_0x887f('0x22')](handleError(_0x3cc7a7,null));};exports['destroy']=function(_0x2dc255,_0x563350){return db[_0x887f('0x34')]['find']({'where':{'id':_0x2dc255['params']['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x563350,null))[_0x887f('0x18')](removeEntity(_0x563350,null))[_0x887f('0x22')](handleError(_0x563350,null));};exports['getConfigurations']=function(_0x10974b,_0x3f57bf,_0x3ccb7c){var _0x24bea4={};var _0x300a04={};var _0x2f7420;var _0x405c8e;return db[_0x887f('0x34')][_0x887f('0x4f')]({'where':{'id':_0x10974b[_0x887f('0x4c')]['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x3f57bf,null))[_0x887f('0x18')](function(_0x22ba5d){if(_0x22ba5d){_0x2f7420=_0x22ba5d;_0x300a04[_0x887f('0x37')]=_[_0x887f('0x38')](db['FreshsalesConfiguration'][_0x887f('0x35')]);_0x300a04[_0x887f('0x39')]=_[_0x887f('0x38')](_0x10974b['query']);_0x300a04['filters']=_[_0x887f('0x3b')](_0x300a04[_0x887f('0x37')],_0x300a04[_0x887f('0x39')]);_0x24bea4['attributes']=_[_0x887f('0x3b')](_0x300a04[_0x887f('0x37')],qs[_0x887f('0x3c')](_0x10974b[_0x887f('0x39')][_0x887f('0x3c')]));_0x24bea4[_0x887f('0x3d')]=_0x24bea4[_0x887f('0x3d')]['length']?_0x24bea4[_0x887f('0x3d')]:_0x300a04[_0x887f('0x37')];_0x24bea4[_0x887f('0x41')]=qs[_0x887f('0x50')](_0x10974b['query'][_0x887f('0x50')]);_0x24bea4[_0x887f('0x45')]=qs[_0x887f('0x3a')](_[_0x887f('0x42')](_0x10974b[_0x887f('0x39')],_0x300a04[_0x887f('0x3a')]));if(_0x10974b[_0x887f('0x39')]['filter']){_0x24bea4[_0x887f('0x45')]=_[_0x887f('0x44')](_0x24bea4['where'],{'$or':_[_0x887f('0x33')](_0x24bea4[_0x887f('0x3d')],function(_0xfe151d){var _0x45a36b={};_0x45a36b[_0xfe151d]={'$like':'%'+_0x10974b[_0x887f('0x39')][_0x887f('0x43')]+'%'};return _0x45a36b;})});}_0x24bea4=_['merge']({},_0x24bea4,_0x10974b[_0x887f('0x48')]);return _0x2f7420[_0x887f('0x51')](_0x24bea4);}})['then'](function(_0x49f7f8){if(_0x49f7f8){_0x405c8e=_0x49f7f8[_0x887f('0x3e')];if(!_0x10974b[_0x887f('0x39')]['hasOwnProperty']('nolimit')){_0x24bea4[_0x887f('0x26')]=qs[_0x887f('0x26')](_0x10974b[_0x887f('0x39')]['limit']);_0x24bea4['offset']=qs[_0x887f('0x29')](_0x10974b[_0x887f('0x39')]['offset']);}return _0x2f7420[_0x887f('0x51')](_0x24bea4);}})[_0x887f('0x18')](function(_0x5773a8){if(_0x5773a8){return _0x5773a8?{'count':_0x405c8e,'rows':_0x5773a8}:null;}})[_0x887f('0x18')](respondWithResult(_0x3f57bf,null))['catch'](handleError(_0x3f57bf,null));};exports[_0x887f('0x52')]=function(_0x23647d,_0x3f54e2,_0x4db87e){if(_0x23647d[_0x887f('0x4e')]['id']){delete _0x23647d[_0x887f('0x4e')]['id'];}return db[_0x887f('0x34')][_0x887f('0x4f')]({'where':{'id':_0x23647d[_0x887f('0x4c')]['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x3f54e2,null))[_0x887f('0x18')](function(_0x72f49f){if(_0x72f49f){_0x23647d['body'][_0x887f('0x53')]=_0x72f49f['id'];_0x23647d[_0x887f('0x4e')][_0x887f('0x54')]=integrations[_0x887f('0x55')](_0x23647d[_0x887f('0x4e')][_0x887f('0x56')],_0x23647d[_0x887f('0x4e')][_0x887f('0x46')]);_0x23647d['body']['Descriptions']=integrations[_0x887f('0x57')](_0x23647d['body'][_0x887f('0x56')],_0x23647d[_0x887f('0x4e')][_0x887f('0x46')]);return db[_0x887f('0x58')][_0x887f('0x59')](_0x23647d[_0x887f('0x4e')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x887f('0x5a')}]});}return null;})['then'](respondWithResult(_0x3f54e2,null))['catch'](handleError(_0x3f54e2,null));};exports[_0x887f('0x5b')]=function(_0x4c9241,_0x23e566,_0x12ce96){var _0x4f3383='';var _0x5ae8c3='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x4c9241['params']['id']},'attributes':['id',_0x887f('0x5c'),_0x887f('0x5d'),_0x887f('0x5e')]})['then'](handleEntityNotFound(_0x23e566,null))[_0x887f('0x18')](function(_0x36344e){if(_0x36344e){_0x5ae8c3=_0x36344e[_0x887f('0x5c')];_0x4f3383=_0x36344e['remoteUri'];var _0x2c39db=_0x36344e['remoteUri'][_0x887f('0x5f')](-0x1);if(_0x2c39db==='/'){_0x4f3383=_0x4f3383['substring'](0x0,_0x4f3383[_0x887f('0x60')](_0x2c39db));}return rp({'method':_0x887f('0x61'),'uri':util['format'](_0x887f('0x62'),_0x4f3383,_0x887f('0x63')),'headers':{'Authorization':_0x887f('0x64')+_0x36344e[_0x887f('0x5e')]},'json':!![]});}})[_0x887f('0x18')](function(_0x1787f5){if(_0x1787f5){var _0x1ef2e0=_0x1787f5[_0x887f('0x65')];var _0x419dc1=![];var _0xc95a0c=null;for(_0xc95a0c=0x0;_0xc95a0c<_0x1ef2e0['length'];_0xc95a0c++){if(_0x1ef2e0[_0xc95a0c][_0x887f('0x66')]===_0x5ae8c3){_0x419dc1=!![];}}if(_0x419dc1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x887f('0x67')});}}})[_0x887f('0x18')](respondWithResult(_0x23e566,null))[_0x887f('0x22')](function(_0x7622ed){var _0x30f7bb=_0x4c9241['query'][_0x887f('0x68')]?0x1f4:_0x7622ed['statusCode']||0x1f4;logger[_0x887f('0x1d')](_0x887f('0x69'),'getFields',_0x30f7bb,JSON[_0x887f('0x1c')](_0x7622ed));delete _0x7622ed[_0x887f('0x30')];if(_0x30f7bb===0x191){_0x30f7bb=0x190;}_0x23e566[_0x887f('0x23')](_0x30f7bb)['send'](_0x4c9241['query'][_0x887f('0x68')]?{'message':'Wrong\x20credentials','statusCode':_0x7622ed[_0x887f('0x6a')]}:_0x7622ed);});}; \ No newline at end of file +var _0x3c17=['info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','sendStatus','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','show','keys','include','find','create','body','update','params','getConfigurations','findOne','length','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x548bfe,_0x2ca053){var _0x366a2d=function(_0x45e3a9){while(--_0x45e3a9){_0x548bfe['push'](_0x548bfe['shift']());}};_0x366a2d(++_0x2ca053);}(_0x3c17,0x1a1));var _0x73c1=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x3c17[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x73c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73c1('0x2'));var moment=require(_0x73c1('0x3'));var BPromise=require(_0x73c1('0x4'));var Mustache=require('mustache');var util=require(_0x73c1('0x5'));var path=require(_0x73c1('0x6'));var sox=require(_0x73c1('0x7'));var csv=require(_0x73c1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73c1('0x9'));var _=require('lodash');var squel=require(_0x73c1('0xa'));var crypto=require(_0x73c1('0xb'));var jsforce=require(_0x73c1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x73c1('0xd'));var Papa=require(_0x73c1('0xe'));var Redis=require(_0x73c1('0xf'));var authService=require(_0x73c1('0x10'));var qs=require(_0x73c1('0x11'));var as=require(_0x73c1('0x12'));var hardwareService=require(_0x73c1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x73c1('0x14'));var config=require(_0x73c1('0x15'));var licenseUtil=require(_0x73c1('0x16'));var db=require(_0x73c1('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x73c1('0x18'));var client=jayson['client'][_0x73c1('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5f3799,_0x3a83ae,_0x3ecf5a,_0x57cb11){return new BPromise(function(_0x537965,_0x1cc555){var _0x4a3c51=_0x57cb11||client;return _0x4a3c51[_0x73c1('0x1a')](_0x5f3799,_0x3ecf5a)['then'](function(_0xe5d5c8){logger['info'](_0x73c1('0x1b'),_0x3a83ae,_0x73c1('0x1c'));logger[_0x73c1('0x1d')](_0x73c1('0x1e'),_0x3a83ae,_0x73c1('0x1c'),JSON[_0x73c1('0x1f')](_0xe5d5c8));if(_0xe5d5c8[_0x73c1('0x20')]){if(_0xe5d5c8[_0x73c1('0x20')][_0x73c1('0x21')]===0x1f4){logger['error'](_0x73c1('0x1b'),_0x3a83ae,_0xe5d5c8[_0x73c1('0x20')][_0x73c1('0x22')]);return _0x1cc555(_0xe5d5c8[_0x73c1('0x20')]['message']);}logger[_0x73c1('0x20')](_0x73c1('0x1b'),_0x3a83ae,_0xe5d5c8[_0x73c1('0x20')][_0x73c1('0x22')]);return _0x537965(_0xe5d5c8[_0x73c1('0x20')][_0x73c1('0x22')]);}else{logger[_0x73c1('0x23')](_0x73c1('0x1b'),_0x3a83ae,'request\x20sent');_0x537965(_0xe5d5c8[_0x73c1('0x24')][_0x73c1('0x22')]);}})[_0x73c1('0x25')](function(_0x5eafe2){logger[_0x73c1('0x20')](_0x73c1('0x1b'),_0x3a83ae,_0x5eafe2);_0x1cc555(_0x5eafe2);});});}function respondWithStatusCode(_0x1125ff,_0x3abaab){_0x3abaab=_0x3abaab||0xcc;return function(_0x934640){if(_0x934640){return _0x1125ff['sendStatus'](_0x3abaab);}return _0x1125ff[_0x73c1('0x26')](_0x3abaab)['end']();};}function respondWithResult(_0x54feeb,_0x2301b7){_0x2301b7=_0x2301b7||0xc8;return function(_0x1c567d){if(_0x1c567d){return _0x54feeb[_0x73c1('0x26')](_0x2301b7)[_0x73c1('0x27')](_0x1c567d);}};}function respondWithFilteredResult(_0x123cc0,_0x30ec73){return function(_0x419d19){if(_0x419d19){var _0x9bae95=typeof _0x30ec73[_0x73c1('0x28')]===_0x73c1('0x29')&&typeof _0x30ec73[_0x73c1('0x2a')]===_0x73c1('0x29');var _0xf2bf43=_0x419d19[_0x73c1('0x2b')];var _0x5bf2b1=_0x9bae95?0x0:_0x30ec73[_0x73c1('0x28')];var _0x9050fd=_0x9bae95?_0x419d19[_0x73c1('0x2b')]:_0x30ec73[_0x73c1('0x28')]+_0x30ec73[_0x73c1('0x2a')];var _0x35c4c4;if(_0x9050fd>=_0xf2bf43){_0x9050fd=_0xf2bf43;_0x35c4c4=0xc8;}else{_0x35c4c4=0xce;}_0x123cc0[_0x73c1('0x26')](_0x35c4c4);return _0x123cc0[_0x73c1('0x2c')](_0x73c1('0x2d'),_0x5bf2b1+'-'+_0x9050fd+'/'+_0xf2bf43)['json'](_0x419d19);}return null;};}function patchUpdates(_0x56c0a5){return function(_0xf8fa4c){try{jsonpatch[_0x73c1('0x2e')](_0xf8fa4c,_0x56c0a5,!![]);}catch(_0x382502){return BPromise[_0x73c1('0x2f')](_0x382502);}return _0xf8fa4c['save']();};}function saveUpdates(_0x3e54b2,_0x11432d){return function(_0x1a23ea){if(_0x1a23ea){return _0x1a23ea['update'](_0x3e54b2)[_0x73c1('0x30')](function(_0x1bebb6){return _0x1bebb6;});}return null;};}function removeEntity(_0x5d0a84,_0x270f63){return function(_0x7921b8){if(_0x7921b8){return _0x7921b8[_0x73c1('0x31')]()['then'](function(){_0x5d0a84[_0x73c1('0x26')](0xcc)[_0x73c1('0x32')]();});}};}function handleEntityNotFound(_0x359b2c,_0x770875){return function(_0xc0ea9b){if(!_0xc0ea9b){_0x359b2c[_0x73c1('0x33')](0x194);}return _0xc0ea9b;};}function handleError(_0x40b4e9,_0x16da7e){_0x16da7e=_0x16da7e||0x1f4;return function(_0x3103ec){logger[_0x73c1('0x20')](_0x3103ec['stack']);if(_0x3103ec[_0x73c1('0x34')]){delete _0x3103ec['name'];}_0x40b4e9[_0x73c1('0x26')](_0x16da7e)[_0x73c1('0x35')](_0x3103ec);};}exports[_0x73c1('0x36')]=function(_0x18587f,_0x544cef){var _0x5e9258={},_0x5a87a5={},_0x26ab79={'count':0x0,'rows':[]};var _0x4e5da5=_[_0x73c1('0x37')](db[_0x73c1('0x38')][_0x73c1('0x39')],function(_0x1234a6){return{'name':_0x1234a6[_0x73c1('0x3a')],'type':_0x1234a6[_0x73c1('0x3b')][_0x73c1('0x3c')]};});_0x5a87a5[_0x73c1('0x3d')]=_[_0x73c1('0x37')](_0x4e5da5,_0x73c1('0x34'));_0x5a87a5[_0x73c1('0x3e')]=_['keys'](_0x18587f[_0x73c1('0x3e')]);_0x5a87a5[_0x73c1('0x3f')]=_[_0x73c1('0x40')](_0x5a87a5[_0x73c1('0x3d')],_0x5a87a5[_0x73c1('0x3e')]);_0x5e9258[_0x73c1('0x41')]=_['intersection'](_0x5a87a5[_0x73c1('0x3d')],qs[_0x73c1('0x42')](_0x18587f[_0x73c1('0x3e')][_0x73c1('0x42')]));_0x5e9258[_0x73c1('0x41')]=_0x5e9258[_0x73c1('0x41')]['length']?_0x5e9258[_0x73c1('0x41')]:_0x5a87a5['model'];if(!_0x18587f[_0x73c1('0x3e')][_0x73c1('0x43')]('nolimit')){_0x5e9258['limit']=qs[_0x73c1('0x2a')](_0x18587f[_0x73c1('0x3e')][_0x73c1('0x2a')]);_0x5e9258[_0x73c1('0x28')]=qs[_0x73c1('0x28')](_0x18587f[_0x73c1('0x3e')]['offset']);}_0x5e9258['order']=qs[_0x73c1('0x44')](_0x18587f[_0x73c1('0x3e')]['sort']);_0x5e9258['where']=qs[_0x73c1('0x3f')](_['pick'](_0x18587f[_0x73c1('0x3e')],_0x5a87a5[_0x73c1('0x3f')]),_0x4e5da5);if(_0x18587f[_0x73c1('0x3e')][_0x73c1('0x45')]){_0x5e9258[_0x73c1('0x46')]=_[_0x73c1('0x47')](_0x5e9258[_0x73c1('0x46')],{'$or':_[_0x73c1('0x37')](_0x4e5da5,function(_0x5831d3){if(_0x5831d3['type']!==_0x73c1('0x48')){var _0x340a51={};_0x340a51[_0x5831d3[_0x73c1('0x34')]]={'$like':'%'+_0x18587f['query'][_0x73c1('0x45')]+'%'};return _0x340a51;}})});}_0x5e9258=_[_0x73c1('0x47')]({},_0x5e9258,_0x18587f[_0x73c1('0x49')]);var _0x2400c7={'where':_0x5e9258[_0x73c1('0x46')]};return db[_0x73c1('0x38')][_0x73c1('0x2b')](_0x2400c7)[_0x73c1('0x30')](function(_0x3cb74b){_0x26ab79[_0x73c1('0x2b')]=_0x3cb74b;if(_0x18587f[_0x73c1('0x3e')][_0x73c1('0x4a')]){_0x5e9258['include']=[{'all':!![]}];}return db[_0x73c1('0x38')]['findAll'](_0x5e9258);})[_0x73c1('0x30')](function(_0x2c5c02){_0x26ab79[_0x73c1('0x4b')]=_0x2c5c02;return _0x26ab79;})[_0x73c1('0x30')](respondWithFilteredResult(_0x544cef,_0x5e9258))[_0x73c1('0x25')](handleError(_0x544cef,null));};exports[_0x73c1('0x4c')]=function(_0x5a0417,_0x34093c){var _0x2ccd11={'raw':![],'where':{'id':_0x5a0417['params']['id']}},_0x97da7={};_0x97da7[_0x73c1('0x3d')]=_[_0x73c1('0x4d')](db[_0x73c1('0x38')][_0x73c1('0x39')]);_0x97da7[_0x73c1('0x3e')]=_[_0x73c1('0x4d')](_0x5a0417[_0x73c1('0x3e')]);_0x97da7[_0x73c1('0x3f')]=_[_0x73c1('0x40')](_0x97da7['model'],_0x97da7[_0x73c1('0x3e')]);_0x2ccd11['attributes']=_['intersection'](_0x97da7['model'],qs['fields'](_0x5a0417['query'][_0x73c1('0x42')]));_0x2ccd11['attributes']=_0x2ccd11[_0x73c1('0x41')]['length']?_0x2ccd11['attributes']:_0x97da7['model'];if(_0x5a0417[_0x73c1('0x3e')]['includeAll']){_0x2ccd11[_0x73c1('0x4e')]=[{'all':!![]}];}_0x2ccd11=_[_0x73c1('0x47')]({},_0x2ccd11,_0x5a0417['options']);return db[_0x73c1('0x38')][_0x73c1('0x4f')](_0x2ccd11)[_0x73c1('0x30')](handleEntityNotFound(_0x34093c,null))[_0x73c1('0x30')](respondWithResult(_0x34093c,null))[_0x73c1('0x25')](handleError(_0x34093c,null));};exports[_0x73c1('0x50')]=function(_0x37b6ff,_0x3076c9){return db[_0x73c1('0x38')][_0x73c1('0x50')](_0x37b6ff[_0x73c1('0x51')],{})[_0x73c1('0x30')](respondWithResult(_0x3076c9,0xc9))[_0x73c1('0x25')](handleError(_0x3076c9,null));};exports[_0x73c1('0x52')]=function(_0x25bba3,_0x14deb0){if(_0x25bba3[_0x73c1('0x51')]['id']){delete _0x25bba3[_0x73c1('0x51')]['id'];}return db[_0x73c1('0x38')][_0x73c1('0x4f')]({'where':{'id':_0x25bba3[_0x73c1('0x53')]['id']}})['then'](handleEntityNotFound(_0x14deb0,null))['then'](saveUpdates(_0x25bba3[_0x73c1('0x51')],null))['then'](respondWithResult(_0x14deb0,null))['catch'](handleError(_0x14deb0,null));};exports[_0x73c1('0x31')]=function(_0x854ef6,_0x7eb0e){return db[_0x73c1('0x38')][_0x73c1('0x4f')]({'where':{'id':_0x854ef6[_0x73c1('0x53')]['id']}})[_0x73c1('0x30')](handleEntityNotFound(_0x7eb0e,null))[_0x73c1('0x30')](removeEntity(_0x7eb0e,null))[_0x73c1('0x25')](handleError(_0x7eb0e,null));};exports[_0x73c1('0x54')]=function(_0x1d5dd2,_0xb61bb7,_0x557062){var _0x385817={};var _0xb4edbf={};var _0x124f9c;var _0x5cec5b;return db[_0x73c1('0x38')][_0x73c1('0x55')]({'where':{'id':_0x1d5dd2[_0x73c1('0x53')]['id']}})['then'](handleEntityNotFound(_0xb61bb7,null))['then'](function(_0x55e926){if(_0x55e926){_0x124f9c=_0x55e926;_0xb4edbf[_0x73c1('0x3d')]=_[_0x73c1('0x4d')](db['FreshsalesConfiguration'][_0x73c1('0x39')]);_0xb4edbf[_0x73c1('0x3e')]=_[_0x73c1('0x4d')](_0x1d5dd2['query']);_0xb4edbf[_0x73c1('0x3f')]=_[_0x73c1('0x40')](_0xb4edbf[_0x73c1('0x3d')],_0xb4edbf[_0x73c1('0x3e')]);_0x385817[_0x73c1('0x41')]=_[_0x73c1('0x40')](_0xb4edbf[_0x73c1('0x3d')],qs[_0x73c1('0x42')](_0x1d5dd2[_0x73c1('0x3e')][_0x73c1('0x42')]));_0x385817[_0x73c1('0x41')]=_0x385817[_0x73c1('0x41')][_0x73c1('0x56')]?_0x385817['attributes']:_0xb4edbf[_0x73c1('0x3d')];_0x385817['order']=qs[_0x73c1('0x44')](_0x1d5dd2[_0x73c1('0x3e')]['sort']);_0x385817[_0x73c1('0x46')]=qs[_0x73c1('0x3f')](_['pick'](_0x1d5dd2[_0x73c1('0x3e')],_0xb4edbf['filters']));if(_0x1d5dd2[_0x73c1('0x3e')][_0x73c1('0x45')]){_0x385817[_0x73c1('0x46')]=_[_0x73c1('0x47')](_0x385817[_0x73c1('0x46')],{'$or':_[_0x73c1('0x37')](_0x385817[_0x73c1('0x41')],function(_0x2bdc49){var _0x241d73={};_0x241d73[_0x2bdc49]={'$like':'%'+_0x1d5dd2[_0x73c1('0x3e')]['filter']+'%'};return _0x241d73;})});}_0x385817=_[_0x73c1('0x47')]({},_0x385817,_0x1d5dd2[_0x73c1('0x49')]);return _0x124f9c[_0x73c1('0x54')](_0x385817);}})[_0x73c1('0x30')](function(_0x578a1d){if(_0x578a1d){_0x5cec5b=_0x578a1d['length'];if(!_0x1d5dd2[_0x73c1('0x3e')][_0x73c1('0x43')](_0x73c1('0x57'))){_0x385817[_0x73c1('0x2a')]=qs[_0x73c1('0x2a')](_0x1d5dd2[_0x73c1('0x3e')][_0x73c1('0x2a')]);_0x385817['offset']=qs[_0x73c1('0x28')](_0x1d5dd2['query'][_0x73c1('0x28')]);}return _0x124f9c[_0x73c1('0x54')](_0x385817);}})['then'](function(_0x17fce4){if(_0x17fce4){return _0x17fce4?{'count':_0x5cec5b,'rows':_0x17fce4}:null;}})[_0x73c1('0x30')](respondWithResult(_0xb61bb7,null))[_0x73c1('0x25')](handleError(_0xb61bb7,null));};exports[_0x73c1('0x58')]=function(_0x56b7a8,_0x91630,_0x2eb4f1){if(_0x56b7a8['body']['id']){delete _0x56b7a8['body']['id'];}return db[_0x73c1('0x38')][_0x73c1('0x55')]({'where':{'id':_0x56b7a8['params']['id']}})['then'](handleEntityNotFound(_0x91630,null))[_0x73c1('0x30')](function(_0x750e5d){if(_0x750e5d){_0x56b7a8[_0x73c1('0x51')][_0x73c1('0x59')]=_0x750e5d['id'];_0x56b7a8[_0x73c1('0x51')][_0x73c1('0x5a')]=integrations[_0x73c1('0x5b')](_0x56b7a8['body']['channel'],_0x56b7a8[_0x73c1('0x51')][_0x73c1('0x3b')]);_0x56b7a8[_0x73c1('0x51')][_0x73c1('0x5c')]=integrations['getDescriptions'](_0x56b7a8['body'][_0x73c1('0x5d')],_0x56b7a8[_0x73c1('0x51')][_0x73c1('0x3b')]);return db[_0x73c1('0x5e')][_0x73c1('0x50')](_0x56b7a8[_0x73c1('0x51')],{'include':[{'model':db[_0x73c1('0x5f')],'as':_0x73c1('0x5a')},{'model':db[_0x73c1('0x5f')],'as':_0x73c1('0x5c')}]});}return null;})[_0x73c1('0x30')](respondWithResult(_0x91630,null))[_0x73c1('0x25')](handleError(_0x91630,null));};exports[_0x73c1('0x60')]=function(_0x1e0bb2,_0x3e422b,_0x49dd45){var _0x39bc86='';var _0x517dac='';return db[_0x73c1('0x38')]['findOne']({'where':{'id':_0x1e0bb2[_0x73c1('0x53')]['id']},'attributes':['id',_0x73c1('0x61'),_0x73c1('0x62'),_0x73c1('0x63')]})['then'](handleEntityNotFound(_0x3e422b,null))['then'](function(_0x2ba275){if(_0x2ba275){_0x517dac=_0x2ba275[_0x73c1('0x61')];_0x39bc86=_0x2ba275[_0x73c1('0x62')];var _0x299497=_0x2ba275[_0x73c1('0x62')][_0x73c1('0x64')](-0x1);if(_0x299497==='/'){_0x39bc86=_0x39bc86[_0x73c1('0x65')](0x0,_0x39bc86[_0x73c1('0x66')](_0x299497));}return rp({'method':_0x73c1('0x67'),'uri':util['format'](_0x73c1('0x68'),_0x39bc86,_0x73c1('0x69')),'headers':{'Authorization':_0x73c1('0x6a')+_0x2ba275[_0x73c1('0x63')]},'json':!![]});}})['then'](function(_0x54c92a){if(_0x54c92a){var _0x1840b2=_0x54c92a[_0x73c1('0x6b')];var _0x2002ce=![];var _0x1a8a2e=null;for(_0x1a8a2e=0x0;_0x1a8a2e<_0x1840b2[_0x73c1('0x56')];_0x1a8a2e++){if(_0x1840b2[_0x1a8a2e][_0x73c1('0x6c')]===_0x517dac){_0x2002ce=!![];}}if(_0x2002ce){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x73c1('0x6d')});}}})['then'](respondWithResult(_0x3e422b,null))[_0x73c1('0x25')](function(_0x1040b4){var _0x101169=_0x1e0bb2[_0x73c1('0x3e')][_0x73c1('0x6e')]?0x1f4:_0x1040b4[_0x73c1('0x6f')]||0x1f4;logger[_0x73c1('0x20')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x101169,JSON[_0x73c1('0x1f')](_0x1040b4));delete _0x1040b4[_0x73c1('0x34')];if(_0x101169===0x191){_0x101169=0x190;}_0x3e422b[_0x73c1('0x26')](_0x101169)[_0x73c1('0x35')](_0x1e0bb2['query']['test']?{'message':_0x73c1('0x70'),'statusCode':_0x1040b4[_0x73c1('0x6f')]}:_0x1040b4);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index f63b68b..bc9f03f 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 _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x36eea2,_0x463488){var _0x187729=function(_0x558db7){while(--_0x558db7){_0x36eea2['push'](_0x36eea2['shift']());}};_0x187729(++_0x463488);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intFreshsalesAccount.attributes'];(function(_0x1fc3ea,_0x51c25b){var _0x25f4ee=function(_0x17af49){while(--_0x17af49){_0x1fc3ea['push'](_0x1fc3ea['shift']());}};_0x25f4ee(++_0x51c25b);}(_0x2ef3,0xba));var _0x32ef=function(_0x33f73a,_0xf274df){_0x33f73a=_0x33f73a-0x0;var _0x33d7b4=_0x2ef3[_0x33f73a];return _0x33d7b4;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));var integrations=require(_0x32ef('0x9'));module['exports']=function(_0x5dfa09,_0x2c0089){return _0x5dfa09[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'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 ea048d2..72dd84c 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 _0x77d4=['util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowFreshsalesAccount','find'];(function(_0x487b42,_0x4e903c){var _0x2982cf=function(_0x3c4421){while(--_0x3c4421){_0x487b42['push'](_0x487b42['shift']());}};_0x2982cf(++_0x4e903c);}(_0x77d4,0x108));var _0x477d=function(_0x428d78,_0x372962){_0x428d78=_0x428d78-0x0;var _0x3f8d3f=_0x77d4[_0x428d78];return _0x3f8d3f;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ca2d,_0x5153df,_0x4f4fb4){return new BPromise(function(_0x2dd5d2,_0x579859){return client['request'](_0x45ca2d,_0x4f4fb4)[_0x477d('0x9')](function(_0x29f11b){logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));logger['debug'](_0x477d('0xd'),_0x5153df,'request\x20sent',JSON[_0x477d('0xe')](_0x29f11b));if(_0x29f11b[_0x477d('0xf')]){if(_0x29f11b['error'][_0x477d('0x10')]===0x1f4){logger[_0x477d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x5153df,_0x29f11b['error'][_0x477d('0x11')]);return _0x579859(_0x29f11b[_0x477d('0xf')]['message']);}logger[_0x477d('0xf')](_0x477d('0xb'),_0x5153df,_0x29f11b['error']['message']);return _0x2dd5d2(_0x29f11b[_0x477d('0xf')]['message']);}else{logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));_0x2dd5d2(_0x29f11b['result'][_0x477d('0x11')]);}})[_0x477d('0x12')](function(_0x29c6f8){logger[_0x477d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x5153df,_0x29c6f8);_0x579859(_0x29c6f8);});});}exports[_0x477d('0x13')]=function(_0x5d5553){var _0x367965=this;return new Promise(function(_0x1399d7,_0x159beb){return db[_0x477d('0x14')][_0x477d('0x15')]({'raw':_0x5d5553[_0x477d('0x16')]?_0x5d5553['options'][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x5d5553['options']?_0x5d5553[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x19')]||null:null,'limit':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1a')]||null:null,'include':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')],function(_0x4e6a44){return{'model':db[_0x4e6a44[_0x477d('0x1d')]],'as':_0x4e6a44['as'],'attributes':_0x4e6a44['attributes'],'include':_0x4e6a44[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x4e6a44[_0x477d('0x1b')],function(_0x2287b4){return{'model':db[_0x2287b4['model']],'as':_0x2287b4['as'],'attributes':_0x2287b4[_0x477d('0x19')],'include':_0x2287b4[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x2287b4['include'],function(_0x585648){return{'model':db[_0x585648[_0x477d('0x1d')]],'as':_0x585648['as'],'attributes':_0x585648[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x5c8ef1){logger[_0x477d('0xa')](_0x477d('0x13'),_0x5d5553);logger[_0x477d('0x1e')](_0x477d('0x13'),_0x5d5553,JSON[_0x477d('0xe')](_0x5c8ef1));_0x1399d7(_0x5c8ef1);})['catch'](function(_0x2fc959){logger[_0x477d('0xf')](_0x477d('0x13'),_0x2fc959[_0x477d('0x11')],_0x5d5553);_0x159beb(_0x367965[_0x477d('0xf')](0x1f4,_0x2fc959[_0x477d('0x11')]));});});};exports[_0x477d('0x1f')]=function(_0x98b5d9){var _0x204541=this;return new Promise(function(_0x8fe6c4,_0x41b790){return db[_0x477d('0x14')][_0x477d('0x20')]({'raw':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9['options'][_0x477d('0x19')]||null:null,'include':_0x98b5d9['options']?_0x98b5d9[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x98b5d9['options'][_0x477d('0x1b')],function(_0x1201a9){return{'model':db[_0x1201a9[_0x477d('0x1d')]],'as':_0x1201a9['as'],'attributes':_0x1201a9[_0x477d('0x19')],'include':_0x1201a9[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x1201a9[_0x477d('0x1b')],function(_0xf84c4c){return{'model':db[_0xf84c4c[_0x477d('0x1d')]],'as':_0xf84c4c['as'],'attributes':_0xf84c4c[_0x477d('0x19')],'include':_0xf84c4c['include']?_[_0x477d('0x1c')](_0xf84c4c[_0x477d('0x1b')],function(_0xb41cd8){return{'model':db[_0xb41cd8['model']],'as':_0xb41cd8['as'],'attributes':_0xb41cd8[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x1b0410){logger['info']('ShowFreshsalesAccount',_0x98b5d9);logger[_0x477d('0x1e')](_0x477d('0x1f'),_0x98b5d9,JSON[_0x477d('0xe')](_0x1b0410));_0x8fe6c4(_0x1b0410);})[_0x477d('0x12')](function(_0x1c0d86){logger['error'](_0x477d('0x1f'),_0x1c0d86['message'],_0x98b5d9);_0x41b790(_0x204541[_0x477d('0xf')](0x1f4,_0x1c0d86[_0x477d('0x11')]));});});}; \ No newline at end of file +var _0x77d4=['util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowFreshsalesAccount','find'];(function(_0x1698a4,_0x39a64b){var _0x3b0fcf=function(_0x39a301){while(--_0x39a301){_0x1698a4['push'](_0x1698a4['shift']());}};_0x3b0fcf(++_0x39a64b);}(_0x77d4,0x108));var _0x477d=function(_0x2a0421,_0x2530ae){_0x2a0421=_0x2a0421-0x0;var _0x2fd8de=_0x77d4[_0x2a0421];return _0x2fd8de;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ca2d,_0x5153df,_0x4f4fb4){return new BPromise(function(_0x2dd5d2,_0x579859){return client['request'](_0x45ca2d,_0x4f4fb4)[_0x477d('0x9')](function(_0x29f11b){logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));logger['debug'](_0x477d('0xd'),_0x5153df,'request\x20sent',JSON[_0x477d('0xe')](_0x29f11b));if(_0x29f11b[_0x477d('0xf')]){if(_0x29f11b['error'][_0x477d('0x10')]===0x1f4){logger[_0x477d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x5153df,_0x29f11b['error'][_0x477d('0x11')]);return _0x579859(_0x29f11b[_0x477d('0xf')]['message']);}logger[_0x477d('0xf')](_0x477d('0xb'),_0x5153df,_0x29f11b['error']['message']);return _0x2dd5d2(_0x29f11b[_0x477d('0xf')]['message']);}else{logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));_0x2dd5d2(_0x29f11b['result'][_0x477d('0x11')]);}})[_0x477d('0x12')](function(_0x29c6f8){logger[_0x477d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x5153df,_0x29c6f8);_0x579859(_0x29c6f8);});});}exports[_0x477d('0x13')]=function(_0x5d5553){var _0x367965=this;return new Promise(function(_0x1399d7,_0x159beb){return db[_0x477d('0x14')][_0x477d('0x15')]({'raw':_0x5d5553[_0x477d('0x16')]?_0x5d5553['options'][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x5d5553['options']?_0x5d5553[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x19')]||null:null,'limit':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1a')]||null:null,'include':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')],function(_0x4e6a44){return{'model':db[_0x4e6a44[_0x477d('0x1d')]],'as':_0x4e6a44['as'],'attributes':_0x4e6a44['attributes'],'include':_0x4e6a44[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x4e6a44[_0x477d('0x1b')],function(_0x2287b4){return{'model':db[_0x2287b4['model']],'as':_0x2287b4['as'],'attributes':_0x2287b4[_0x477d('0x19')],'include':_0x2287b4[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x2287b4['include'],function(_0x585648){return{'model':db[_0x585648[_0x477d('0x1d')]],'as':_0x585648['as'],'attributes':_0x585648[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x5c8ef1){logger[_0x477d('0xa')](_0x477d('0x13'),_0x5d5553);logger[_0x477d('0x1e')](_0x477d('0x13'),_0x5d5553,JSON[_0x477d('0xe')](_0x5c8ef1));_0x1399d7(_0x5c8ef1);})['catch'](function(_0x2fc959){logger[_0x477d('0xf')](_0x477d('0x13'),_0x2fc959[_0x477d('0x11')],_0x5d5553);_0x159beb(_0x367965[_0x477d('0xf')](0x1f4,_0x2fc959[_0x477d('0x11')]));});});};exports[_0x477d('0x1f')]=function(_0x98b5d9){var _0x204541=this;return new Promise(function(_0x8fe6c4,_0x41b790){return db[_0x477d('0x14')][_0x477d('0x20')]({'raw':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9['options'][_0x477d('0x19')]||null:null,'include':_0x98b5d9['options']?_0x98b5d9[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x98b5d9['options'][_0x477d('0x1b')],function(_0x1201a9){return{'model':db[_0x1201a9[_0x477d('0x1d')]],'as':_0x1201a9['as'],'attributes':_0x1201a9[_0x477d('0x19')],'include':_0x1201a9[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x1201a9[_0x477d('0x1b')],function(_0xf84c4c){return{'model':db[_0xf84c4c[_0x477d('0x1d')]],'as':_0xf84c4c['as'],'attributes':_0xf84c4c[_0x477d('0x19')],'include':_0xf84c4c['include']?_[_0x477d('0x1c')](_0xf84c4c[_0x477d('0x1b')],function(_0xb41cd8){return{'model':db[_0xb41cd8['model']],'as':_0xb41cd8['as'],'attributes':_0xb41cd8[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x1b0410){logger['info']('ShowFreshsalesAccount',_0x98b5d9);logger[_0x477d('0x1e')](_0x477d('0x1f'),_0x98b5d9,JSON[_0x477d('0xe')](_0x1b0410));_0x8fe6c4(_0x1b0410);})[_0x477d('0x12')](function(_0x1c0d86){logger['error'](_0x477d('0x1f'),_0x1c0d86['message'],_0x98b5d9);_0x41b790(_0x204541[_0x477d('0xf')](0x1f4,_0x1c0d86[_0x477d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6a1c040..95be690 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 _0x30bd=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','put','update'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x30bd,0x96));var _0xd30b=function(_0x449521,_0x291181){_0x449521=_0x449521-0x0;var _0x2cca8b=_0x30bd[_0x449521];return _0x2cca8b;};'use strict';var multer=require(_0xd30b('0x0'));var util=require(_0xd30b('0x1'));var path=require('path');var timeout=require(_0xd30b('0x2'));var express=require('express');var router=express[_0xd30b('0x3')]();var fs_extra=require(_0xd30b('0x4'));var auth=require(_0xd30b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd30b('0x6'));router[_0xd30b('0x7')]('/',auth[_0xd30b('0x8')](),controller[_0xd30b('0x9')]);router['get'](_0xd30b('0xa'),auth['isAuthenticated'](),controller[_0xd30b('0xb')]);router[_0xd30b('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xd30b('0x7')]('/:id/descriptions',auth[_0xd30b('0x8')](),controller['getDescriptions']);router['get'](_0xd30b('0xc'),auth[_0xd30b('0x8')](),controller[_0xd30b('0xd')]);router[_0xd30b('0xe')]('/',auth[_0xd30b('0x8')](),controller[_0xd30b('0xf')]);router[_0xd30b('0x10')]('/:id',auth[_0xd30b('0x8')](),controller[_0xd30b('0x11')]);router[_0xd30b('0x12')](_0xd30b('0xa'),auth[_0xd30b('0x8')](),controller[_0xd30b('0x13')]);module[_0xd30b('0x14')]=router; \ No newline at end of file +var _0xc537=['post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getFields'];(function(_0x3f0dda,_0x342566){var _0x42a632=function(_0xdcfb){while(--_0xdcfb){_0x3f0dda['push'](_0x3f0dda['shift']());}};_0x42a632(++_0x342566);}(_0xc537,0x17f));var _0x7c53=function(_0x43c571,_0x136311){_0x43c571=_0x43c571-0x0;var _0x5673d5=_0xc537[_0x43c571];return _0x5673d5;};'use strict';var multer=require(_0x7c53('0x0'));var util=require(_0x7c53('0x1'));var path=require('path');var timeout=require(_0x7c53('0x2'));var express=require(_0x7c53('0x3'));var router=express[_0x7c53('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c53('0x5'));var interaction=require(_0x7c53('0x6'));var config=require(_0x7c53('0x7'));var controller=require(_0x7c53('0x8'));router[_0x7c53('0x9')]('/',auth[_0x7c53('0xa')](),controller[_0x7c53('0xb')]);router[_0x7c53('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7c53('0xc')]);router['get'](_0x7c53('0xd'),auth[_0x7c53('0xa')](),controller[_0x7c53('0xe')]);router[_0x7c53('0x9')](_0x7c53('0xf'),auth[_0x7c53('0xa')](),controller['getDescriptions']);router[_0x7c53('0x9')]('/:id/fields',auth[_0x7c53('0xa')](),controller[_0x7c53('0x10')]);router[_0x7c53('0x11')]('/',auth['isAuthenticated'](),controller[_0x7c53('0x12')]);router[_0x7c53('0x13')](_0x7c53('0x14'),auth[_0x7c53('0xa')](),controller[_0x7c53('0x15')]);router[_0x7c53('0x16')](_0x7c53('0x14'),auth[_0x7c53('0xa')](),controller[_0x7c53('0x17')]);module[_0x7c53('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 509cf23..f8fc653 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 _0x5003=['sequelize','exports','STRING'];(function(_0x316a88,_0x451333){var _0x2d35b1=function(_0x234608){while(--_0x234608){_0x316a88['push'](_0x316a88['shift']());}};_0x2d35b1(++_0x451333);}(_0x5003,0x138));var _0x3500=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5003[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3500('0x0'));module[_0x3500('0x1')]={'name':{'type':Sequelize[_0x3500('0x2')]},'description':{'type':Sequelize[_0x3500('0x2')]}}; \ No newline at end of file +var _0x267b=['STRING','sequelize','exports'];(function(_0xee20d1,_0x4cb1eb){var _0x1b6504=function(_0x43526c){while(--_0x43526c){_0xee20d1['push'](_0xee20d1['shift']());}};_0x1b6504(++_0x4cb1eb);}(_0x267b,0x121));var _0xb267=function(_0x5b7779,_0x248e47){_0x5b7779=_0x5b7779-0x0;var _0x3322c2=_0x267b[_0x5b7779];return _0x3322c2;};'use strict';var Sequelize=require(_0xb267('0x0'));module[_0xb267('0x1')]={'name':{'type':Sequelize[_0xb267('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 68cabbf..fc07aed 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 _0x01dc=['stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','FreshsalesConfiguration','findAll','rows','params','keys','includeAll','include','body','find','findOne','FreshsalesField','getSubjects','getDescriptions','order','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','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','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xda0e17,_0x3db08b){var _0x441135=function(_0x293190){while(--_0x293190){_0xda0e17['push'](_0xda0e17['shift']());}};_0x441135(++_0x3db08b);}(_0x01dc,0x1bb));var _0xc01d=function(_0x3b386a,_0x3a33c5){_0x3b386a=_0x3b386a-0x0;var _0x468fbe=_0x01dc[_0x3b386a];return _0x468fbe;};'use strict';var emlformat=require(_0xc01d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc01d('0x1'));var jsonpatch=require(_0xc01d('0x2'));var rp=require(_0xc01d('0x3'));var moment=require(_0xc01d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc01d('0x5'));var util=require('util');var path=require(_0xc01d('0x6'));var sox=require(_0xc01d('0x7'));var csv=require(_0xc01d('0x8'));var ejs=require(_0xc01d('0x9'));var fs=require('fs');var fs_extra=require(_0xc01d('0xa'));var _=require(_0xc01d('0xb'));var squel=require(_0xc01d('0xc'));var crypto=require(_0xc01d('0xd'));var jsforce=require(_0xc01d('0xe'));var deskjs=require(_0xc01d('0xf'));var toCsv=require(_0xc01d('0x8'));var querystring=require(_0xc01d('0x10'));var Papa=require(_0xc01d('0x11'));var Redis=require(_0xc01d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc01d('0x13'));var as=require(_0xc01d('0x14'));var hardwareService=require(_0xc01d('0x15'));var logger=require(_0xc01d('0x16'))(_0xc01d('0x17'));var utils=require('../../config/utils');var config=require(_0xc01d('0x18'));var licenseUtil=require(_0xc01d('0x19'));var db=require(_0xc01d('0x1a'))['db'];var jayson=require(_0xc01d('0x1b'));var client=jayson[_0xc01d('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ac933,_0x47fa22,_0x370a6f,_0x2328b3){return new BPromise(function(_0x399cc7,_0xdcd6b2){var _0x166bd4=_0x2328b3||client;return _0x166bd4['request'](_0x4ac933,_0x370a6f)['then'](function(_0x50a7a7){logger[_0xc01d('0x1d')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x47fa22,'request\x20sent');logger[_0xc01d('0x1e')](_0xc01d('0x1f'),_0x47fa22,'request\x20sent',JSON[_0xc01d('0x20')](_0x50a7a7));if(_0x50a7a7[_0xc01d('0x21')]){if(_0x50a7a7[_0xc01d('0x21')]['code']===0x1f4){logger[_0xc01d('0x21')](_0xc01d('0x22'),_0x47fa22,_0x50a7a7[_0xc01d('0x21')][_0xc01d('0x23')]);return _0xdcd6b2(_0x50a7a7['error'][_0xc01d('0x23')]);}logger[_0xc01d('0x21')](_0xc01d('0x22'),_0x47fa22,_0x50a7a7[_0xc01d('0x21')][_0xc01d('0x23')]);return _0x399cc7(_0x50a7a7[_0xc01d('0x21')]['message']);}else{logger[_0xc01d('0x1d')](_0xc01d('0x22'),_0x47fa22,_0xc01d('0x24'));_0x399cc7(_0x50a7a7[_0xc01d('0x25')][_0xc01d('0x23')]);}})[_0xc01d('0x26')](function(_0x34bba9){logger[_0xc01d('0x21')](_0xc01d('0x22'),_0x47fa22,_0x34bba9);_0xdcd6b2(_0x34bba9);});});}function respondWithStatusCode(_0x47fd18,_0xb91618){_0xb91618=_0xb91618||0xcc;return function(_0x36ad37){if(_0x36ad37){return _0x47fd18['sendStatus'](_0xb91618);}return _0x47fd18[_0xc01d('0x27')](_0xb91618)[_0xc01d('0x28')]();};}function respondWithResult(_0x51dded,_0x177343){_0x177343=_0x177343||0xc8;return function(_0x5d95d9){if(_0x5d95d9){return _0x51dded[_0xc01d('0x27')](_0x177343)['json'](_0x5d95d9);}};}function respondWithFilteredResult(_0x31d310,_0x517e18){return function(_0x21132b){if(_0x21132b){var _0x251f0c=typeof _0x517e18[_0xc01d('0x29')]==='undefined'&&typeof _0x517e18['limit']===_0xc01d('0x2a');var _0x22185d=_0x21132b['count'];var _0x32a956=_0x251f0c?0x0:_0x517e18[_0xc01d('0x29')];var _0x563097=_0x251f0c?_0x21132b[_0xc01d('0x2b')]:_0x517e18[_0xc01d('0x29')]+_0x517e18[_0xc01d('0x2c')];var _0x4fae63;if(_0x563097>=_0x22185d){_0x563097=_0x22185d;_0x4fae63=0xc8;}else{_0x4fae63=0xce;}_0x31d310[_0xc01d('0x27')](_0x4fae63);return _0x31d310[_0xc01d('0x2d')](_0xc01d('0x2e'),_0x32a956+'-'+_0x563097+'/'+_0x22185d)[_0xc01d('0x2f')](_0x21132b);}return null;};}function patchUpdates(_0x5a7697){return function(_0x488f88){try{jsonpatch[_0xc01d('0x30')](_0x488f88,_0x5a7697,!![]);}catch(_0x109cda){return BPromise[_0xc01d('0x31')](_0x109cda);}return _0x488f88[_0xc01d('0x32')]();};}function saveUpdates(_0x107a13,_0x316819){return function(_0x5250ab){if(_0x5250ab){return _0x5250ab[_0xc01d('0x33')](_0x107a13)[_0xc01d('0x34')](function(_0xae5fe7){return _0xae5fe7;});}return null;};}function removeEntity(_0x1610b8,_0x3d473e){return function(_0x146dcd){if(_0x146dcd){return _0x146dcd[_0xc01d('0x35')]()[_0xc01d('0x34')](function(){_0x1610b8[_0xc01d('0x27')](0xcc)[_0xc01d('0x28')]();});}};}function handleEntityNotFound(_0x3a24a1,_0x10f002){return function(_0x2a18e4){if(!_0x2a18e4){_0x3a24a1[_0xc01d('0x36')](0x194);}return _0x2a18e4;};}function handleError(_0x5a4f69,_0x36ab63){_0x36ab63=_0x36ab63||0x1f4;return function(_0x396b20){logger[_0xc01d('0x21')](_0x396b20[_0xc01d('0x37')]);if(_0x396b20[_0xc01d('0x38')]){delete _0x396b20[_0xc01d('0x38')];}_0x5a4f69['status'](_0x36ab63)[_0xc01d('0x39')](_0x396b20);};}exports[_0xc01d('0x3a')]=function(_0x249325,_0x3d57f3){var _0x24a325={},_0x5c6837={},_0x28e33c={'count':0x0,'rows':[]};var _0x23c4ed=_[_0xc01d('0x3b')](db['FreshsalesConfiguration'][_0xc01d('0x3c')],function(_0x1c7495){return{'name':_0x1c7495[_0xc01d('0x3d')],'type':_0x1c7495['type'][_0xc01d('0x3e')]};});_0x5c6837['model']=_[_0xc01d('0x3b')](_0x23c4ed,_0xc01d('0x38'));_0x5c6837[_0xc01d('0x3f')]=_['keys'](_0x249325[_0xc01d('0x3f')]);_0x5c6837[_0xc01d('0x40')]=_[_0xc01d('0x41')](_0x5c6837[_0xc01d('0x42')],_0x5c6837[_0xc01d('0x3f')]);_0x24a325[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0x5c6837[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x249325[_0xc01d('0x3f')][_0xc01d('0x44')]));_0x24a325[_0xc01d('0x43')]=_0x24a325[_0xc01d('0x43')][_0xc01d('0x45')]?_0x24a325[_0xc01d('0x43')]:_0x5c6837[_0xc01d('0x42')];if(!_0x249325[_0xc01d('0x3f')][_0xc01d('0x46')](_0xc01d('0x47'))){_0x24a325[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x249325['query'][_0xc01d('0x2c')]);_0x24a325['offset']=qs[_0xc01d('0x29')](_0x249325[_0xc01d('0x3f')][_0xc01d('0x29')]);}_0x24a325['order']=qs[_0xc01d('0x48')](_0x249325[_0xc01d('0x3f')][_0xc01d('0x48')]);_0x24a325[_0xc01d('0x49')]=qs['filters'](_[_0xc01d('0x4a')](_0x249325[_0xc01d('0x3f')],_0x5c6837['filters']),_0x23c4ed);if(_0x249325['query'][_0xc01d('0x4b')]){_0x24a325[_0xc01d('0x49')]=_['merge'](_0x24a325[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0x23c4ed,function(_0x542a46){if(_0x542a46[_0xc01d('0x4c')]!==_0xc01d('0x4d')){var _0x1bca4e={};_0x1bca4e[_0x542a46[_0xc01d('0x38')]]={'$like':'%'+_0x249325[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x1bca4e;}})});}_0x24a325=_[_0xc01d('0x4e')]({},_0x24a325,_0x249325[_0xc01d('0x4f')]);var _0x23d548={'where':_0x24a325[_0xc01d('0x49')]};return db[_0xc01d('0x50')][_0xc01d('0x2b')](_0x23d548)['then'](function(_0x44c9bf){_0x28e33c['count']=_0x44c9bf;if(_0x249325[_0xc01d('0x3f')]['includeAll']){_0x24a325['include']=[{'all':!![]}];}return db[_0xc01d('0x50')][_0xc01d('0x51')](_0x24a325);})[_0xc01d('0x34')](function(_0x5cbbb8){_0x28e33c[_0xc01d('0x52')]=_0x5cbbb8;return _0x28e33c;})['then'](respondWithFilteredResult(_0x3d57f3,_0x24a325))[_0xc01d('0x26')](handleError(_0x3d57f3,null));};exports['show']=function(_0x39181d,_0x45c00c){var _0x45fcdc={'raw':![],'where':{'id':_0x39181d[_0xc01d('0x53')]['id']}},_0xdb8683={};_0xdb8683['model']=_[_0xc01d('0x54')](db[_0xc01d('0x50')][_0xc01d('0x3c')]);_0xdb8683['query']=_[_0xc01d('0x54')](_0x39181d[_0xc01d('0x3f')]);_0xdb8683[_0xc01d('0x40')]=_['intersection'](_0xdb8683[_0xc01d('0x42')],_0xdb8683[_0xc01d('0x3f')]);_0x45fcdc[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0xdb8683[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x39181d[_0xc01d('0x3f')][_0xc01d('0x44')]));_0x45fcdc[_0xc01d('0x43')]=_0x45fcdc['attributes'][_0xc01d('0x45')]?_0x45fcdc[_0xc01d('0x43')]:_0xdb8683[_0xc01d('0x42')];if(_0x39181d['query'][_0xc01d('0x55')]){_0x45fcdc[_0xc01d('0x56')]=[{'all':!![]}];}_0x45fcdc=_[_0xc01d('0x4e')]({},_0x45fcdc,_0x39181d[_0xc01d('0x4f')]);return db['FreshsalesConfiguration']['find'](_0x45fcdc)[_0xc01d('0x34')](handleEntityNotFound(_0x45c00c,null))[_0xc01d('0x34')](respondWithResult(_0x45c00c,null))['catch'](handleError(_0x45c00c,null));};exports['create']=function(_0x827e05,_0x243307){return db[_0xc01d('0x50')]['create'](_0x827e05[_0xc01d('0x57')],{})['then'](respondWithResult(_0x243307,0xc9))['catch'](handleError(_0x243307,null));};exports[_0xc01d('0x33')]=function(_0x42c74c,_0x162779){if(_0x42c74c[_0xc01d('0x57')]['id']){delete _0x42c74c['body']['id'];}return db[_0xc01d('0x50')][_0xc01d('0x58')]({'where':{'id':_0x42c74c[_0xc01d('0x53')]['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x162779,null))[_0xc01d('0x34')](saveUpdates(_0x42c74c[_0xc01d('0x57')],null))[_0xc01d('0x34')](respondWithResult(_0x162779,null))[_0xc01d('0x26')](handleError(_0x162779,null));};exports[_0xc01d('0x35')]=function(_0x2fb5ff,_0x1d4ddf){return db[_0xc01d('0x50')][_0xc01d('0x58')]({'where':{'id':_0x2fb5ff[_0xc01d('0x53')]['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x1d4ddf,null))['then'](removeEntity(_0x1d4ddf,null))[_0xc01d('0x26')](handleError(_0x1d4ddf,null));};exports['getSubjects']=function(_0x48e265,_0x449065,_0x127896){var _0xc86479={};var _0x2cb054={};var _0xbac2e3;var _0x508d0a;return db[_0xc01d('0x50')][_0xc01d('0x59')]({'where':{'id':_0x48e265[_0xc01d('0x53')]['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x449065,null))[_0xc01d('0x34')](function(_0x7f1ec){if(_0x7f1ec){_0xbac2e3=_0x7f1ec;_0x2cb054[_0xc01d('0x42')]=_[_0xc01d('0x54')](db[_0xc01d('0x5a')][_0xc01d('0x3c')]);_0x2cb054[_0xc01d('0x3f')]=_[_0xc01d('0x54')](_0x48e265[_0xc01d('0x3f')]);_0x2cb054[_0xc01d('0x40')]=_[_0xc01d('0x41')](_0x2cb054['model'],_0x2cb054['query']);_0xc86479['attributes']=_['intersection'](_0x2cb054[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x44')]));_0xc86479[_0xc01d('0x43')]=_0xc86479[_0xc01d('0x43')][_0xc01d('0x45')]?_0xc86479[_0xc01d('0x43')]:_0x2cb054[_0xc01d('0x42')];_0xc86479['order']=qs['sort'](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x48')]);_0xc86479[_0xc01d('0x49')]=qs[_0xc01d('0x40')](_[_0xc01d('0x4a')](_0x48e265['query'],_0x2cb054[_0xc01d('0x40')]));if(_0x48e265[_0xc01d('0x3f')][_0xc01d('0x4b')]){_0xc86479[_0xc01d('0x49')]=_[_0xc01d('0x4e')](_0xc86479[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0xc86479[_0xc01d('0x43')],function(_0x123ade){var _0x519bb4={};_0x519bb4[_0x123ade]={'$like':'%'+_0x48e265[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x519bb4;})});}_0xc86479=_['merge']({},_0xc86479,_0x48e265['options']);return _0xbac2e3[_0xc01d('0x5b')](_0xc86479);}})[_0xc01d('0x34')](function(_0xe8f2c2){if(_0xe8f2c2){_0x508d0a=_0xe8f2c2[_0xc01d('0x45')];if(!_0x48e265['query'][_0xc01d('0x46')](_0xc01d('0x47'))){_0xc86479[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x2c')]);_0xc86479[_0xc01d('0x29')]=qs[_0xc01d('0x29')](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x29')]);}return _0xbac2e3['getSubjects'](_0xc86479);}})[_0xc01d('0x34')](function(_0x3a8f0a){if(_0x3a8f0a){return _0x3a8f0a?{'count':_0x508d0a,'rows':_0x3a8f0a}:null;}})['then'](respondWithResult(_0x449065,null))['catch'](handleError(_0x449065,null));};exports[_0xc01d('0x5c')]=function(_0x45b597,_0x579137,_0x420dfc){var _0xcda393={};var _0x364121={};var _0x1e66c6;var _0x1ebd3a;return db[_0xc01d('0x50')][_0xc01d('0x59')]({'where':{'id':_0x45b597['params']['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x579137,null))[_0xc01d('0x34')](function(_0x21e8e8){if(_0x21e8e8){_0x1e66c6=_0x21e8e8;_0x364121[_0xc01d('0x42')]=_[_0xc01d('0x54')](db[_0xc01d('0x5a')][_0xc01d('0x3c')]);_0x364121[_0xc01d('0x3f')]=_[_0xc01d('0x54')](_0x45b597[_0xc01d('0x3f')]);_0x364121[_0xc01d('0x40')]=_[_0xc01d('0x41')](_0x364121[_0xc01d('0x42')],_0x364121['query']);_0xcda393[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0x364121[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x45b597['query'][_0xc01d('0x44')]));_0xcda393[_0xc01d('0x43')]=_0xcda393[_0xc01d('0x43')][_0xc01d('0x45')]?_0xcda393[_0xc01d('0x43')]:_0x364121[_0xc01d('0x42')];_0xcda393[_0xc01d('0x5d')]=qs['sort'](_0x45b597[_0xc01d('0x3f')][_0xc01d('0x48')]);_0xcda393[_0xc01d('0x49')]=qs['filters'](_[_0xc01d('0x4a')](_0x45b597[_0xc01d('0x3f')],_0x364121[_0xc01d('0x40')]));if(_0x45b597[_0xc01d('0x3f')]['filter']){_0xcda393[_0xc01d('0x49')]=_[_0xc01d('0x4e')](_0xcda393[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0xcda393[_0xc01d('0x43')],function(_0x53eb26){var _0x443d26={};_0x443d26[_0x53eb26]={'$like':'%'+_0x45b597[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x443d26;})});}_0xcda393=_[_0xc01d('0x4e')]({},_0xcda393,_0x45b597[_0xc01d('0x4f')]);return _0x1e66c6[_0xc01d('0x5c')](_0xcda393);}})['then'](function(_0x142eee){if(_0x142eee){_0x1ebd3a=_0x142eee[_0xc01d('0x45')];if(!_0x45b597[_0xc01d('0x3f')][_0xc01d('0x46')](_0xc01d('0x47'))){_0xcda393[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x45b597[_0xc01d('0x3f')][_0xc01d('0x2c')]);_0xcda393['offset']=qs[_0xc01d('0x29')](_0x45b597[_0xc01d('0x3f')][_0xc01d('0x29')]);}return _0x1e66c6[_0xc01d('0x5c')](_0xcda393);}})['then'](function(_0x1416eb){if(_0x1416eb){return _0x1416eb?{'count':_0x1ebd3a,'rows':_0x1416eb}:null;}})[_0xc01d('0x34')](respondWithResult(_0x579137,null))[_0xc01d('0x26')](handleError(_0x579137,null));};exports['getFields']=function(_0x20a163,_0x633b75,_0x518f3a){var _0x158f76={};var _0x11f551={};var _0x1ea90f;var _0x28c5ac;return db[_0xc01d('0x50')]['findOne']({'where':{'id':_0x20a163['params']['id']}})['then'](handleEntityNotFound(_0x633b75,null))[_0xc01d('0x34')](function(_0x547cf9){if(_0x547cf9){_0x1ea90f=_0x547cf9;_0x11f551[_0xc01d('0x42')]=_[_0xc01d('0x54')](db[_0xc01d('0x5a')][_0xc01d('0x3c')]);_0x11f551['query']=_[_0xc01d('0x54')](_0x20a163[_0xc01d('0x3f')]);_0x11f551[_0xc01d('0x40')]=_['intersection'](_0x11f551[_0xc01d('0x42')],_0x11f551[_0xc01d('0x3f')]);_0x158f76[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0x11f551[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x44')]));_0x158f76[_0xc01d('0x43')]=_0x158f76[_0xc01d('0x43')]['length']?_0x158f76[_0xc01d('0x43')]:_0x11f551[_0xc01d('0x42')];_0x158f76[_0xc01d('0x5d')]=qs[_0xc01d('0x48')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x48')]);_0x158f76[_0xc01d('0x49')]=qs['filters'](_['pick'](_0x20a163[_0xc01d('0x3f')],_0x11f551[_0xc01d('0x40')]));if(_0x20a163[_0xc01d('0x3f')][_0xc01d('0x4b')]){_0x158f76[_0xc01d('0x49')]=_[_0xc01d('0x4e')](_0x158f76[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0x158f76['attributes'],function(_0x19bdaf){var _0x8a93e8={};_0x8a93e8[_0x19bdaf]={'$like':'%'+_0x20a163[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x8a93e8;})});}_0x158f76=_[_0xc01d('0x4e')]({},_0x158f76,_0x20a163[_0xc01d('0x4f')]);return _0x1ea90f[_0xc01d('0x5e')](_0x158f76);}})[_0xc01d('0x34')](function(_0x306f71){if(_0x306f71){_0x28c5ac=_0x306f71['length'];if(!_0x20a163[_0xc01d('0x3f')][_0xc01d('0x46')](_0xc01d('0x47'))){_0x158f76[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x2c')]);_0x158f76['offset']=qs[_0xc01d('0x29')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x29')]);}return _0x1ea90f[_0xc01d('0x5e')](_0x158f76);}})[_0xc01d('0x34')](function(_0x3ecefd){if(_0x3ecefd){return _0x3ecefd?{'count':_0x28c5ac,'rows':_0x3ecefd}:null;}})[_0xc01d('0x34')](respondWithResult(_0x633b75,null))[_0xc01d('0x26')](handleError(_0x633b75,null));}; \ No newline at end of file +var _0x74b6=['undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','FreshsalesConfiguration','includeAll','include','findAll','show','params','merge','find','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','json','offset'];(function(_0x572c0a,_0x4d242c){var _0x43a5db=function(_0x7f4393){while(--_0x7f4393){_0x572c0a['push'](_0x572c0a['shift']());}};_0x43a5db(++_0x4d242c);}(_0x74b6,0x135));var _0x674b=function(_0x1ebd2e,_0x55aaa6){_0x1ebd2e=_0x1ebd2e-0x0;var _0x2bf685=_0x74b6[_0x1ebd2e];return _0x2bf685;};'use strict';var emlformat=require(_0x674b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x674b('0x1'));var jsonpatch=require(_0x674b('0x2'));var rp=require('request-promise');var moment=require(_0x674b('0x3'));var BPromise=require(_0x674b('0x4'));var Mustache=require('mustache');var util=require(_0x674b('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x674b('0x6'));var fs=require('fs');var fs_extra=require(_0x674b('0x7'));var _=require('lodash');var squel=require(_0x674b('0x8'));var crypto=require(_0x674b('0x9'));var jsforce=require(_0x674b('0xa'));var deskjs=require(_0x674b('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x674b('0xc'));var Redis=require('ioredis');var authService=require(_0x674b('0xd'));var qs=require(_0x674b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x674b('0xf'));var logger=require(_0x674b('0x10'))(_0x674b('0x11'));var utils=require(_0x674b('0x12'));var config=require(_0x674b('0x13'));var licenseUtil=require(_0x674b('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x674b('0x15'));var client=jayson['client'][_0x674b('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x80b956,_0x316594,_0x2de017,_0x384906){return new BPromise(function(_0xf38f31,_0x2df1be){var _0x55ed1c=_0x384906||client;return _0x55ed1c[_0x674b('0x17')](_0x80b956,_0x2de017)[_0x674b('0x18')](function(_0x18d56e){logger[_0x674b('0x19')](_0x674b('0x1a'),_0x316594,_0x674b('0x1b'));logger[_0x674b('0x1c')](_0x674b('0x1d'),_0x316594,'request\x20sent',JSON['stringify'](_0x18d56e));if(_0x18d56e[_0x674b('0x1e')]){if(_0x18d56e[_0x674b('0x1e')][_0x674b('0x1f')]===0x1f4){logger['error'](_0x674b('0x1a'),_0x316594,_0x18d56e['error'][_0x674b('0x20')]);return _0x2df1be(_0x18d56e[_0x674b('0x1e')][_0x674b('0x20')]);}logger[_0x674b('0x1e')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x316594,_0x18d56e['error'][_0x674b('0x20')]);return _0xf38f31(_0x18d56e[_0x674b('0x1e')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x316594,'request\x20sent');_0xf38f31(_0x18d56e['result'][_0x674b('0x20')]);}})[_0x674b('0x21')](function(_0x5a52db){logger[_0x674b('0x1e')](_0x674b('0x1a'),_0x316594,_0x5a52db);_0x2df1be(_0x5a52db);});});}function respondWithStatusCode(_0x5954a5,_0x240da5){_0x240da5=_0x240da5||0xcc;return function(_0x549989){if(_0x549989){return _0x5954a5[_0x674b('0x22')](_0x240da5);}return _0x5954a5['status'](_0x240da5)[_0x674b('0x23')]();};}function respondWithResult(_0xb43b00,_0x294d9b){_0x294d9b=_0x294d9b||0xc8;return function(_0x3174d2){if(_0x3174d2){return _0xb43b00[_0x674b('0x24')](_0x294d9b)[_0x674b('0x25')](_0x3174d2);}};}function respondWithFilteredResult(_0x290739,_0x527ebc){return function(_0x4de076){if(_0x4de076){var _0x5b0ec6=typeof _0x527ebc[_0x674b('0x26')]===_0x674b('0x27')&&typeof _0x527ebc[_0x674b('0x28')]===_0x674b('0x27');var _0xc7ed9f=_0x4de076[_0x674b('0x29')];var _0x47586a=_0x5b0ec6?0x0:_0x527ebc[_0x674b('0x26')];var _0x46884b=_0x5b0ec6?_0x4de076[_0x674b('0x29')]:_0x527ebc[_0x674b('0x26')]+_0x527ebc['limit'];var _0x4223d9;if(_0x46884b>=_0xc7ed9f){_0x46884b=_0xc7ed9f;_0x4223d9=0xc8;}else{_0x4223d9=0xce;}_0x290739['status'](_0x4223d9);return _0x290739[_0x674b('0x2a')](_0x674b('0x2b'),_0x47586a+'-'+_0x46884b+'/'+_0xc7ed9f)[_0x674b('0x25')](_0x4de076);}return null;};}function patchUpdates(_0x597988){return function(_0x58381b){try{jsonpatch[_0x674b('0x2c')](_0x58381b,_0x597988,!![]);}catch(_0x20ec5a){return BPromise[_0x674b('0x2d')](_0x20ec5a);}return _0x58381b[_0x674b('0x2e')]();};}function saveUpdates(_0x347c69,_0x2bbe5a){return function(_0x3d3adc){if(_0x3d3adc){return _0x3d3adc['update'](_0x347c69)[_0x674b('0x18')](function(_0x1d9b49){return _0x1d9b49;});}return null;};}function removeEntity(_0x207bd2,_0x23ff5a){return function(_0x4de597){if(_0x4de597){return _0x4de597[_0x674b('0x2f')]()['then'](function(){_0x207bd2[_0x674b('0x24')](0xcc)[_0x674b('0x23')]();});}};}function handleEntityNotFound(_0x2e3af7,_0xad539c){return function(_0x5c1f1c){if(!_0x5c1f1c){_0x2e3af7[_0x674b('0x22')](0x194);}return _0x5c1f1c;};}function handleError(_0x322703,_0xd5037b){_0xd5037b=_0xd5037b||0x1f4;return function(_0x39ea32){logger[_0x674b('0x1e')](_0x39ea32[_0x674b('0x30')]);if(_0x39ea32[_0x674b('0x31')]){delete _0x39ea32[_0x674b('0x31')];}_0x322703['status'](_0xd5037b)['send'](_0x39ea32);};}exports[_0x674b('0x32')]=function(_0x3200dc,_0x2c7c70){var _0x59827a={},_0x16d4c9={},_0x2aa482={'count':0x0,'rows':[]};var _0x53f8e7=_[_0x674b('0x33')](db['FreshsalesConfiguration'][_0x674b('0x34')],function(_0x5d113d){return{'name':_0x5d113d['fieldName'],'type':_0x5d113d['type'][_0x674b('0x35')]};});_0x16d4c9[_0x674b('0x36')]=_[_0x674b('0x33')](_0x53f8e7,_0x674b('0x31'));_0x16d4c9[_0x674b('0x37')]=_[_0x674b('0x38')](_0x3200dc[_0x674b('0x37')]);_0x16d4c9[_0x674b('0x39')]=_[_0x674b('0x3a')](_0x16d4c9['model'],_0x16d4c9['query']);_0x59827a[_0x674b('0x3b')]=_[_0x674b('0x3a')](_0x16d4c9[_0x674b('0x36')],qs[_0x674b('0x3c')](_0x3200dc[_0x674b('0x37')][_0x674b('0x3c')]));_0x59827a['attributes']=_0x59827a[_0x674b('0x3b')][_0x674b('0x3d')]?_0x59827a[_0x674b('0x3b')]:_0x16d4c9[_0x674b('0x36')];if(!_0x3200dc[_0x674b('0x37')]['hasOwnProperty'](_0x674b('0x3e'))){_0x59827a[_0x674b('0x28')]=qs[_0x674b('0x28')](_0x3200dc[_0x674b('0x37')]['limit']);_0x59827a[_0x674b('0x26')]=qs[_0x674b('0x26')](_0x3200dc['query'][_0x674b('0x26')]);}_0x59827a[_0x674b('0x3f')]=qs['sort'](_0x3200dc[_0x674b('0x37')][_0x674b('0x40')]);_0x59827a[_0x674b('0x41')]=qs[_0x674b('0x39')](_[_0x674b('0x42')](_0x3200dc[_0x674b('0x37')],_0x16d4c9[_0x674b('0x39')]),_0x53f8e7);if(_0x3200dc['query'][_0x674b('0x43')]){_0x59827a[_0x674b('0x41')]=_['merge'](_0x59827a[_0x674b('0x41')],{'$or':_['map'](_0x53f8e7,function(_0x5bbab6){if(_0x5bbab6[_0x674b('0x44')]!==_0x674b('0x45')){var _0x5004cc={};_0x5004cc[_0x5bbab6[_0x674b('0x31')]]={'$like':'%'+_0x3200dc[_0x674b('0x37')]['filter']+'%'};return _0x5004cc;}})});}_0x59827a=_['merge']({},_0x59827a,_0x3200dc[_0x674b('0x46')]);var _0x3b0abc={'where':_0x59827a[_0x674b('0x41')]};return db[_0x674b('0x47')][_0x674b('0x29')](_0x3b0abc)[_0x674b('0x18')](function(_0x1fef51){_0x2aa482[_0x674b('0x29')]=_0x1fef51;if(_0x3200dc[_0x674b('0x37')][_0x674b('0x48')]){_0x59827a[_0x674b('0x49')]=[{'all':!![]}];}return db[_0x674b('0x47')][_0x674b('0x4a')](_0x59827a);})['then'](function(_0x4475fc){_0x2aa482['rows']=_0x4475fc;return _0x2aa482;})[_0x674b('0x18')](respondWithFilteredResult(_0x2c7c70,_0x59827a))[_0x674b('0x21')](handleError(_0x2c7c70,null));};exports[_0x674b('0x4b')]=function(_0x4cf215,_0x4ec5df){var _0x5cee03={'raw':![],'where':{'id':_0x4cf215[_0x674b('0x4c')]['id']}},_0x4d87c9={};_0x4d87c9[_0x674b('0x36')]=_[_0x674b('0x38')](db['FreshsalesConfiguration'][_0x674b('0x34')]);_0x4d87c9[_0x674b('0x37')]=_[_0x674b('0x38')](_0x4cf215[_0x674b('0x37')]);_0x4d87c9[_0x674b('0x39')]=_['intersection'](_0x4d87c9['model'],_0x4d87c9[_0x674b('0x37')]);_0x5cee03[_0x674b('0x3b')]=_['intersection'](_0x4d87c9[_0x674b('0x36')],qs[_0x674b('0x3c')](_0x4cf215[_0x674b('0x37')][_0x674b('0x3c')]));_0x5cee03[_0x674b('0x3b')]=_0x5cee03[_0x674b('0x3b')][_0x674b('0x3d')]?_0x5cee03[_0x674b('0x3b')]:_0x4d87c9['model'];if(_0x4cf215['query']['includeAll']){_0x5cee03[_0x674b('0x49')]=[{'all':!![]}];}_0x5cee03=_[_0x674b('0x4d')]({},_0x5cee03,_0x4cf215[_0x674b('0x46')]);return db['FreshsalesConfiguration'][_0x674b('0x4e')](_0x5cee03)[_0x674b('0x18')](handleEntityNotFound(_0x4ec5df,null))['then'](respondWithResult(_0x4ec5df,null))[_0x674b('0x21')](handleError(_0x4ec5df,null));};exports[_0x674b('0x4f')]=function(_0x4adcb1,_0x77dcca){return db[_0x674b('0x47')][_0x674b('0x4f')](_0x4adcb1[_0x674b('0x50')],{})[_0x674b('0x18')](respondWithResult(_0x77dcca,0xc9))[_0x674b('0x21')](handleError(_0x77dcca,null));};exports['update']=function(_0x2b9b31,_0x2a4908){if(_0x2b9b31[_0x674b('0x50')]['id']){delete _0x2b9b31['body']['id'];}return db[_0x674b('0x47')][_0x674b('0x4e')]({'where':{'id':_0x2b9b31['params']['id']}})[_0x674b('0x18')](handleEntityNotFound(_0x2a4908,null))[_0x674b('0x18')](saveUpdates(_0x2b9b31['body'],null))[_0x674b('0x18')](respondWithResult(_0x2a4908,null))[_0x674b('0x21')](handleError(_0x2a4908,null));};exports[_0x674b('0x2f')]=function(_0x59e9f4,_0x3edc22){return db[_0x674b('0x47')][_0x674b('0x4e')]({'where':{'id':_0x59e9f4['params']['id']}})['then'](handleEntityNotFound(_0x3edc22,null))[_0x674b('0x18')](removeEntity(_0x3edc22,null))[_0x674b('0x21')](handleError(_0x3edc22,null));};exports[_0x674b('0x51')]=function(_0x230036,_0x202808,_0x5b26b9){var _0x3f70c7={};var _0x353edc={};var _0x16c62e;var _0x59b7ed;return db[_0x674b('0x47')][_0x674b('0x52')]({'where':{'id':_0x230036[_0x674b('0x4c')]['id']}})[_0x674b('0x18')](handleEntityNotFound(_0x202808,null))['then'](function(_0x469b27){if(_0x469b27){_0x16c62e=_0x469b27;_0x353edc[_0x674b('0x36')]=_['keys'](db[_0x674b('0x53')][_0x674b('0x34')]);_0x353edc[_0x674b('0x37')]=_[_0x674b('0x38')](_0x230036[_0x674b('0x37')]);_0x353edc[_0x674b('0x39')]=_[_0x674b('0x3a')](_0x353edc[_0x674b('0x36')],_0x353edc[_0x674b('0x37')]);_0x3f70c7[_0x674b('0x3b')]=_[_0x674b('0x3a')](_0x353edc[_0x674b('0x36')],qs[_0x674b('0x3c')](_0x230036[_0x674b('0x37')]['fields']));_0x3f70c7['attributes']=_0x3f70c7['attributes'][_0x674b('0x3d')]?_0x3f70c7[_0x674b('0x3b')]:_0x353edc[_0x674b('0x36')];_0x3f70c7[_0x674b('0x3f')]=qs[_0x674b('0x40')](_0x230036[_0x674b('0x37')][_0x674b('0x40')]);_0x3f70c7[_0x674b('0x41')]=qs['filters'](_[_0x674b('0x42')](_0x230036[_0x674b('0x37')],_0x353edc['filters']));if(_0x230036[_0x674b('0x37')]['filter']){_0x3f70c7[_0x674b('0x41')]=_[_0x674b('0x4d')](_0x3f70c7[_0x674b('0x41')],{'$or':_[_0x674b('0x33')](_0x3f70c7[_0x674b('0x3b')],function(_0x33c78f){var _0x1ab497={};_0x1ab497[_0x33c78f]={'$like':'%'+_0x230036[_0x674b('0x37')][_0x674b('0x43')]+'%'};return _0x1ab497;})});}_0x3f70c7=_['merge']({},_0x3f70c7,_0x230036[_0x674b('0x46')]);return _0x16c62e[_0x674b('0x51')](_0x3f70c7);}})['then'](function(_0x1bb46b){if(_0x1bb46b){_0x59b7ed=_0x1bb46b[_0x674b('0x3d')];if(!_0x230036[_0x674b('0x37')][_0x674b('0x54')]('nolimit')){_0x3f70c7[_0x674b('0x28')]=qs[_0x674b('0x28')](_0x230036[_0x674b('0x37')][_0x674b('0x28')]);_0x3f70c7[_0x674b('0x26')]=qs[_0x674b('0x26')](_0x230036['query'][_0x674b('0x26')]);}return _0x16c62e[_0x674b('0x51')](_0x3f70c7);}})[_0x674b('0x18')](function(_0x3d3517){if(_0x3d3517){return _0x3d3517?{'count':_0x59b7ed,'rows':_0x3d3517}:null;}})[_0x674b('0x18')](respondWithResult(_0x202808,null))[_0x674b('0x21')](handleError(_0x202808,null));};exports['getDescriptions']=function(_0x2a751e,_0x3745ed,_0x190416){var _0x313334={};var _0x4c5695={};var _0x4f6fba;var _0x372b8a;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x2a751e['params']['id']}})['then'](handleEntityNotFound(_0x3745ed,null))[_0x674b('0x18')](function(_0x5c03da){if(_0x5c03da){_0x4f6fba=_0x5c03da;_0x4c5695[_0x674b('0x36')]=_['keys'](db[_0x674b('0x53')][_0x674b('0x34')]);_0x4c5695[_0x674b('0x37')]=_[_0x674b('0x38')](_0x2a751e['query']);_0x4c5695[_0x674b('0x39')]=_[_0x674b('0x3a')](_0x4c5695[_0x674b('0x36')],_0x4c5695[_0x674b('0x37')]);_0x313334[_0x674b('0x3b')]=_[_0x674b('0x3a')](_0x4c5695[_0x674b('0x36')],qs[_0x674b('0x3c')](_0x2a751e[_0x674b('0x37')][_0x674b('0x3c')]));_0x313334[_0x674b('0x3b')]=_0x313334[_0x674b('0x3b')][_0x674b('0x3d')]?_0x313334[_0x674b('0x3b')]:_0x4c5695[_0x674b('0x36')];_0x313334['order']=qs['sort'](_0x2a751e[_0x674b('0x37')][_0x674b('0x40')]);_0x313334[_0x674b('0x41')]=qs[_0x674b('0x39')](_['pick'](_0x2a751e[_0x674b('0x37')],_0x4c5695[_0x674b('0x39')]));if(_0x2a751e[_0x674b('0x37')]['filter']){_0x313334[_0x674b('0x41')]=_[_0x674b('0x4d')](_0x313334[_0x674b('0x41')],{'$or':_[_0x674b('0x33')](_0x313334[_0x674b('0x3b')],function(_0x25d3a2){var _0x1ad55e={};_0x1ad55e[_0x25d3a2]={'$like':'%'+_0x2a751e[_0x674b('0x37')][_0x674b('0x43')]+'%'};return _0x1ad55e;})});}_0x313334=_['merge']({},_0x313334,_0x2a751e[_0x674b('0x46')]);return _0x4f6fba[_0x674b('0x55')](_0x313334);}})[_0x674b('0x18')](function(_0x29b3f9){if(_0x29b3f9){_0x372b8a=_0x29b3f9[_0x674b('0x3d')];if(!_0x2a751e[_0x674b('0x37')][_0x674b('0x54')](_0x674b('0x3e'))){_0x313334[_0x674b('0x28')]=qs['limit'](_0x2a751e[_0x674b('0x37')]['limit']);_0x313334[_0x674b('0x26')]=qs[_0x674b('0x26')](_0x2a751e[_0x674b('0x37')][_0x674b('0x26')]);}return _0x4f6fba['getDescriptions'](_0x313334);}})[_0x674b('0x18')](function(_0x201ded){if(_0x201ded){return _0x201ded?{'count':_0x372b8a,'rows':_0x201ded}:null;}})[_0x674b('0x18')](respondWithResult(_0x3745ed,null))['catch'](handleError(_0x3745ed,null));};exports[_0x674b('0x56')]=function(_0x2b0c27,_0x18a979,_0x583b56){var _0x4ee9d1={};var _0xebd7a0={};var _0x17fda6;var _0x3a9fb3;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x2b0c27['params']['id']}})['then'](handleEntityNotFound(_0x18a979,null))[_0x674b('0x18')](function(_0x23c830){if(_0x23c830){_0x17fda6=_0x23c830;_0xebd7a0[_0x674b('0x36')]=_[_0x674b('0x38')](db[_0x674b('0x53')][_0x674b('0x34')]);_0xebd7a0[_0x674b('0x37')]=_[_0x674b('0x38')](_0x2b0c27[_0x674b('0x37')]);_0xebd7a0[_0x674b('0x39')]=_['intersection'](_0xebd7a0[_0x674b('0x36')],_0xebd7a0[_0x674b('0x37')]);_0x4ee9d1[_0x674b('0x3b')]=_[_0x674b('0x3a')](_0xebd7a0[_0x674b('0x36')],qs['fields'](_0x2b0c27[_0x674b('0x37')][_0x674b('0x3c')]));_0x4ee9d1[_0x674b('0x3b')]=_0x4ee9d1[_0x674b('0x3b')][_0x674b('0x3d')]?_0x4ee9d1[_0x674b('0x3b')]:_0xebd7a0['model'];_0x4ee9d1[_0x674b('0x3f')]=qs['sort'](_0x2b0c27[_0x674b('0x37')]['sort']);_0x4ee9d1[_0x674b('0x41')]=qs[_0x674b('0x39')](_[_0x674b('0x42')](_0x2b0c27[_0x674b('0x37')],_0xebd7a0[_0x674b('0x39')]));if(_0x2b0c27[_0x674b('0x37')][_0x674b('0x43')]){_0x4ee9d1[_0x674b('0x41')]=_['merge'](_0x4ee9d1[_0x674b('0x41')],{'$or':_[_0x674b('0x33')](_0x4ee9d1[_0x674b('0x3b')],function(_0x221e3a){var _0x5da690={};_0x5da690[_0x221e3a]={'$like':'%'+_0x2b0c27[_0x674b('0x37')][_0x674b('0x43')]+'%'};return _0x5da690;})});}_0x4ee9d1=_[_0x674b('0x4d')]({},_0x4ee9d1,_0x2b0c27[_0x674b('0x46')]);return _0x17fda6[_0x674b('0x56')](_0x4ee9d1);}})[_0x674b('0x18')](function(_0x53592e){if(_0x53592e){_0x3a9fb3=_0x53592e[_0x674b('0x3d')];if(!_0x2b0c27['query'][_0x674b('0x54')](_0x674b('0x3e'))){_0x4ee9d1['limit']=qs[_0x674b('0x28')](_0x2b0c27['query'][_0x674b('0x28')]);_0x4ee9d1[_0x674b('0x26')]=qs[_0x674b('0x26')](_0x2b0c27['query'][_0x674b('0x26')]);}return _0x17fda6[_0x674b('0x56')](_0x4ee9d1);}})['then'](function(_0x109573){if(_0x109573){return _0x109573?{'count':_0x3a9fb3,'rows':_0x109573}:null;}})[_0x674b('0x18')](respondWithResult(_0x18a979,null))['catch'](handleError(_0x18a979,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index acf18ab..4be494d 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 _0xc0e7=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','int_freshsales_configurations'];(function(_0x425355,_0x53d26b){var _0x4a3d30=function(_0x51b9a7){while(--_0x51b9a7){_0x425355['push'](_0x425355['shift']());}};_0x4a3d30(++_0x53d26b);}(_0xc0e7,0x16b));var _0x7c0e=function(_0x4d120d,_0x55a2c9){_0x4d120d=_0x4d120d-0x0;var _0x12b156=_0xc0e7[_0x4d120d];return _0x12b156;};'use strict';var _=require(_0x7c0e('0x0'));var util=require(_0x7c0e('0x1'));var logger=require('../../config/logger')(_0x7c0e('0x2'));var moment=require(_0x7c0e('0x3'));var BPromise=require(_0x7c0e('0x4'));var rp=require(_0x7c0e('0x5'));var fs=require('fs');var path=require(_0x7c0e('0x6'));var rimraf=require('rimraf');var config=require(_0x7c0e('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x7c0e('0x8')]=function(_0x16e34b,_0x1709a5){return _0x16e34b[_0x7c0e('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x7c0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6f1=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x34ecea,_0x3d11ce){var _0x44b6a8=function(_0x5843a1){while(--_0x5843a1){_0x34ecea['push'](_0x34ecea['shift']());}};_0x44b6a8(++_0x3d11ce);}(_0xa6f1,0xb6));var _0x1a6f=function(_0x16360c,_0x37c098){_0x16360c=_0x16360c-0x0;var _0x17dd2d=_0xa6f1[_0x16360c];return _0x17dd2d;};'use strict';var _=require('lodash');var util=require(_0x1a6f('0x0'));var logger=require(_0x1a6f('0x1'))('api');var moment=require(_0x1a6f('0x2'));var BPromise=require(_0x1a6f('0x3'));var rp=require(_0x1a6f('0x4'));var fs=require('fs');var path=require(_0x1a6f('0x5'));var rimraf=require(_0x1a6f('0x6'));var config=require(_0x1a6f('0x7'));var attributes=require(_0x1a6f('0x8'));module[_0x1a6f('0x9')]=function(_0x1140ed,_0xdb1bcb){return _0x1140ed[_0x1a6f('0xa')](_0x1a6f('0xb'),attributes,{'tableName':_0x1a6f('0xc'),'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 0c2ccb6..75f23d3 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 _0xcb86=['client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4807d9,_0x1ee2e7){var _0x1283f1=function(_0x1ab8a6){while(--_0x1ab8a6){_0x4807d9['push'](_0x4807d9['shift']());}};_0x1283f1(++_0x1ee2e7);}(_0xcb86,0xd5));var _0x6cb8=function(_0x5d0e7c,_0x265ef9){_0x5d0e7c=_0x5d0e7c-0x0;var _0x43f8f2=_0xcb86[_0x5d0e7c];return _0x43f8f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6cb8('0x0'));var BPromise=require(_0x6cb8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cb8('0x2'));var db=require(_0x6cb8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cb8('0x4'))(_0x6cb8('0x5'));var config=require('../../config/environment');var jayson=require(_0x6cb8('0x6'));var client=jayson[_0x6cb8('0x7')][_0x6cb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30d676,_0x28093a,_0x18a9ac){return new BPromise(function(_0x561858,_0x551d17){return client[_0x6cb8('0x9')](_0x30d676,_0x18a9ac)[_0x6cb8('0xa')](function(_0x119cad){logger['info'](_0x6cb8('0xb'),_0x28093a,_0x6cb8('0xc'));logger[_0x6cb8('0xd')](_0x6cb8('0xe'),_0x28093a,_0x6cb8('0xc'),JSON[_0x6cb8('0xf')](_0x119cad));if(_0x119cad[_0x6cb8('0x10')]){if(_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x11')]===0x1f4){logger[_0x6cb8('0x10')](_0x6cb8('0xb'),_0x28093a,_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x12')]);return _0x551d17(_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x12')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x28093a,_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x12')]);return _0x561858(_0x119cad['error']['message']);}else{logger[_0x6cb8('0x13')](_0x6cb8('0xb'),_0x28093a,'request\x20sent');_0x561858(_0x119cad[_0x6cb8('0x14')][_0x6cb8('0x12')]);}})[_0x6cb8('0x15')](function(_0x3b6239){logger[_0x6cb8('0x10')](_0x6cb8('0xb'),_0x28093a,_0x3b6239);_0x551d17(_0x3b6239);});});} \ No newline at end of file +var _0x69de=['request','then','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x20b78e,_0x59fdae){var _0x386b8e=function(_0x153be0){while(--_0x153be0){_0x20b78e['push'](_0x20b78e['shift']());}};_0x386b8e(++_0x59fdae);}(_0x69de,0x19b));var _0xe69d=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x69de[_0x255c48];return _0xaebda3;};'use strict';var _=require(_0xe69d('0x0'));var util=require(_0xe69d('0x1'));var moment=require(_0xe69d('0x2'));var BPromise=require('bluebird');var rs=require(_0xe69d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe69d('0x4'))(_0xe69d('0x5'));var config=require('../../config/environment');var jayson=require(_0xe69d('0x6'));var client=jayson[_0xe69d('0x7')][_0xe69d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36a5a1,_0x2d9ec9,_0x52892d){return new BPromise(function(_0x81c4aa,_0x2575a2){return client[_0xe69d('0x9')](_0x36a5a1,_0x52892d)[_0xe69d('0xa')](function(_0x2a5772){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2d9ec9,_0xe69d('0xb'));logger['debug'](_0xe69d('0xc'),_0x2d9ec9,_0xe69d('0xb'),JSON[_0xe69d('0xd')](_0x2a5772));if(_0x2a5772[_0xe69d('0xe')]){if(_0x2a5772[_0xe69d('0xe')][_0xe69d('0xf')]===0x1f4){logger[_0xe69d('0xe')](_0xe69d('0x10'),_0x2d9ec9,_0x2a5772[_0xe69d('0xe')][_0xe69d('0x11')]);return _0x2575a2(_0x2a5772[_0xe69d('0xe')][_0xe69d('0x11')]);}logger[_0xe69d('0xe')](_0xe69d('0x10'),_0x2d9ec9,_0x2a5772[_0xe69d('0xe')][_0xe69d('0x11')]);return _0x81c4aa(_0x2a5772['error']['message']);}else{logger[_0xe69d('0x12')](_0xe69d('0x10'),_0x2d9ec9,'request\x20sent');_0x81c4aa(_0x2a5772[_0xe69d('0x13')]['message']);}})[_0xe69d('0x14')](function(_0x54cf9a){logger[_0xe69d('0xe')](_0xe69d('0x10'),_0x2d9ec9,_0x54cf9a);_0x2575a2(_0x54cf9a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index af50b1e..89132b1 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 _0x98e5=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','put','update','exports','connect-timeout','express'];(function(_0x4d13eb,_0x187a20){var _0x25ec2a=function(_0x1e7b32){while(--_0x1e7b32){_0x4d13eb['push'](_0x4d13eb['shift']());}};_0x25ec2a(++_0x187a20);}(_0x98e5,0x8a));var _0x598e=function(_0x35caa8,_0x100229){_0x35caa8=_0x35caa8-0x0;var _0x72dcf0=_0x98e5[_0x35caa8];return _0x72dcf0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x598e('0x0'));var express=require(_0x598e('0x1'));var router=express['Router']();var fs_extra=require(_0x598e('0x2'));var auth=require(_0x598e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x598e('0x4'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x598e('0x5')](),controller['index']);router[_0x598e('0x6')](_0x598e('0x7'),auth[_0x598e('0x5')](),controller[_0x598e('0x8')]);router[_0x598e('0x9')]('/',auth[_0x598e('0x5')](),controller[_0x598e('0xa')]);router[_0x598e('0xb')](_0x598e('0x7'),auth[_0x598e('0x5')](),controller[_0x598e('0xc')]);router['delete'](_0x598e('0x7'),auth[_0x598e('0x5')](),controller['destroy']);module[_0x598e('0xd')]=router; \ No newline at end of file +var _0x33a1=['put','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','post','create'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x33a1,0x7c));var _0x133a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x33a1[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x133a('0x2'));var auth=require(_0x133a('0x3'));var interaction=require(_0x133a('0x4'));var config=require('../../config/environment');var controller=require(_0x133a('0x5'));router[_0x133a('0x6')]('/',auth[_0x133a('0x7')](),controller['index']);router[_0x133a('0x6')](_0x133a('0x8'),auth[_0x133a('0x7')](),controller['show']);router[_0x133a('0x9')]('/',auth[_0x133a('0x7')](),controller[_0x133a('0xa')]);router[_0x133a('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x133a('0xc')](_0x133a('0x8'),auth[_0x133a('0x7')](),controller[_0x133a('0xd')]);module[_0x133a('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 908faa3..702088c 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 _0xd86d=['ENUM','customVariable','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x100623,_0x311484){var _0x21b00f=function(_0x1085c6){while(--_0x1085c6){_0x100623['push'](_0x100623['shift']());}};_0x21b00f(++_0x311484);}(_0xd86d,0x76));var _0xdd86=function(_0x11df53,_0x3fd765){_0x11df53=_0x11df53-0x0;var _0x3e10a9=_0xd86d[_0x11df53];return _0x3e10a9;};'use strict';var Sequelize=require(_0xdd86('0x0'));module[_0xdd86('0x1')]={'type':{'type':Sequelize[_0xdd86('0x2')]('string','variable',_0xdd86('0x3'),'keyValue',_0xdd86('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdd86('0x5')]},'keyType':{'type':Sequelize[_0xdd86('0x2')]('string',_0xdd86('0x6'),_0xdd86('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdd86('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdd86('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdd86('0x5')]}}; \ No newline at end of file +var _0xee61=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x1e4045,_0x4906c2){var _0x2ef060=function(_0xcf8c){while(--_0xcf8c){_0x1e4045['push'](_0x1e4045['shift']());}};_0x2ef060(++_0x4906c2);}(_0xee61,0x18e));var _0x1ee6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee61[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1ee6('0x0'));module[_0x1ee6('0x1')]={'type':{'type':Sequelize[_0x1ee6('0x2')](_0x1ee6('0x3'),_0x1ee6('0x4'),_0x1ee6('0x5'),_0x1ee6('0x6'),'picklist'),'defaultValue':_0x1ee6('0x3')},'content':{'type':Sequelize[_0x1ee6('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1ee6('0x2')](_0x1ee6('0x3'),_0x1ee6('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x1ee6('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1ee6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1ee6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 9eb50ff..4aef3d5 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 _0x84b0=['../../mysqldb','sendStatus','end','json','limit','undefined','offset','count','status','set','apply','reject','save','then','error','name','index','map','FreshsalesField','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','update','find','eml-format','rimraf','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x47c2f6,_0x33bc6b){var _0x5df17a=function(_0x590bad){while(--_0x590bad){_0x47c2f6['push'](_0x47c2f6['shift']());}};_0x5df17a(++_0x33bc6b);}(_0x84b0,0x1d4));var _0x084b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x84b0[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x084b('0x0'));var rimraf=require(_0x084b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x084b('0x2'));var moment=require(_0x084b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x084b('0x4'));var path=require(_0x084b('0x5'));var sox=require(_0x084b('0x6'));var csv=require('to-csv');var ejs=require(_0x084b('0x7'));var fs=require('fs');var fs_extra=require(_0x084b('0x8'));var _=require('lodash');var squel=require(_0x084b('0x9'));var crypto=require('crypto');var jsforce=require(_0x084b('0xa'));var deskjs=require(_0x084b('0xb'));var toCsv=require(_0x084b('0xc'));var querystring=require(_0x084b('0xd'));var Papa=require(_0x084b('0xe'));var Redis=require(_0x084b('0xf'));var authService=require(_0x084b('0x10'));var qs=require(_0x084b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x084b('0x12'))(_0x084b('0x13'));var utils=require('../../config/utils');var config=require(_0x084b('0x14'));var licenseUtil=require(_0x084b('0x15'));var db=require(_0x084b('0x16'))['db'];function respondWithStatusCode(_0xdf9f1c,_0x3b3309){_0x3b3309=_0x3b3309||0xcc;return function(_0x5897e8){if(_0x5897e8){return _0xdf9f1c[_0x084b('0x17')](_0x3b3309);}return _0xdf9f1c['status'](_0x3b3309)[_0x084b('0x18')]();};}function respondWithResult(_0x39b4c7,_0x1e9467){_0x1e9467=_0x1e9467||0xc8;return function(_0x14992d){if(_0x14992d){return _0x39b4c7['status'](_0x1e9467)[_0x084b('0x19')](_0x14992d);}};}function respondWithFilteredResult(_0x30b227,_0xe01edc){return function(_0x3c9d53){if(_0x3c9d53){var _0x5870b2=typeof _0xe01edc['offset']==='undefined'&&typeof _0xe01edc[_0x084b('0x1a')]===_0x084b('0x1b');var _0x2f7e54=_0x3c9d53['count'];var _0x22926d=_0x5870b2?0x0:_0xe01edc[_0x084b('0x1c')];var _0x223db7=_0x5870b2?_0x3c9d53[_0x084b('0x1d')]:_0xe01edc[_0x084b('0x1c')]+_0xe01edc[_0x084b('0x1a')];var _0x57b303;if(_0x223db7>=_0x2f7e54){_0x223db7=_0x2f7e54;_0x57b303=0xc8;}else{_0x57b303=0xce;}_0x30b227[_0x084b('0x1e')](_0x57b303);return _0x30b227[_0x084b('0x1f')]('Content-Range',_0x22926d+'-'+_0x223db7+'/'+_0x2f7e54)[_0x084b('0x19')](_0x3c9d53);}return null;};}function patchUpdates(_0x243ac3){return function(_0x2eb448){try{jsonpatch[_0x084b('0x20')](_0x2eb448,_0x243ac3,!![]);}catch(_0x2a4768){return BPromise[_0x084b('0x21')](_0x2a4768);}return _0x2eb448[_0x084b('0x22')]();};}function saveUpdates(_0x2da2c1,_0x2d7ada){return function(_0x242f60){if(_0x242f60){return _0x242f60['update'](_0x2da2c1)[_0x084b('0x23')](function(_0x586e63){return _0x586e63;});}return null;};}function removeEntity(_0x1ae297,_0x31a701){return function(_0x39c90b){if(_0x39c90b){return _0x39c90b['destroy']()[_0x084b('0x23')](function(){_0x1ae297['status'](0xcc)[_0x084b('0x18')]();});}};}function handleEntityNotFound(_0x2668b0,_0x22b12a){return function(_0x458a25){if(!_0x458a25){_0x2668b0['sendStatus'](0x194);}return _0x458a25;};}function handleError(_0x37eb2a,_0x50656f){_0x50656f=_0x50656f||0x1f4;return function(_0x227618){logger[_0x084b('0x24')](_0x227618['stack']);if(_0x227618['name']){delete _0x227618[_0x084b('0x25')];}_0x37eb2a[_0x084b('0x1e')](_0x50656f)['send'](_0x227618);};}exports[_0x084b('0x26')]=function(_0x18ef3e,_0x57662c){var _0x3fdf36={},_0x1acee6={},_0x119c2e={'count':0x0,'rows':[]};var _0x4e8c48=_[_0x084b('0x27')](db[_0x084b('0x28')]['rawAttributes'],function(_0x39566f){return{'name':_0x39566f['fieldName'],'type':_0x39566f['type']['key']};});_0x1acee6[_0x084b('0x29')]=_[_0x084b('0x27')](_0x4e8c48,_0x084b('0x25'));_0x1acee6[_0x084b('0x2a')]=_[_0x084b('0x2b')](_0x18ef3e[_0x084b('0x2a')]);_0x1acee6['filters']=_[_0x084b('0x2c')](_0x1acee6[_0x084b('0x29')],_0x1acee6[_0x084b('0x2a')]);_0x3fdf36[_0x084b('0x2d')]=_[_0x084b('0x2c')](_0x1acee6[_0x084b('0x29')],qs['fields'](_0x18ef3e[_0x084b('0x2a')][_0x084b('0x2e')]));_0x3fdf36['attributes']=_0x3fdf36[_0x084b('0x2d')][_0x084b('0x2f')]?_0x3fdf36[_0x084b('0x2d')]:_0x1acee6[_0x084b('0x29')];if(!_0x18ef3e['query'][_0x084b('0x30')](_0x084b('0x31'))){_0x3fdf36[_0x084b('0x1a')]=qs[_0x084b('0x1a')](_0x18ef3e['query'][_0x084b('0x1a')]);_0x3fdf36[_0x084b('0x1c')]=qs[_0x084b('0x1c')](_0x18ef3e[_0x084b('0x2a')][_0x084b('0x1c')]);}_0x3fdf36[_0x084b('0x32')]=qs[_0x084b('0x33')](_0x18ef3e[_0x084b('0x2a')][_0x084b('0x33')]);_0x3fdf36[_0x084b('0x34')]=qs[_0x084b('0x35')](_['pick'](_0x18ef3e[_0x084b('0x2a')],_0x1acee6['filters']),_0x4e8c48);if(_0x18ef3e['query']['filter']){_0x3fdf36[_0x084b('0x34')]=_[_0x084b('0x36')](_0x3fdf36[_0x084b('0x34')],{'$or':_[_0x084b('0x27')](_0x4e8c48,function(_0x39c705){if(_0x39c705[_0x084b('0x37')]!==_0x084b('0x38')){var _0x4eb251={};_0x4eb251[_0x39c705['name']]={'$like':'%'+_0x18ef3e[_0x084b('0x2a')][_0x084b('0x39')]+'%'};return _0x4eb251;}})});}_0x3fdf36=_[_0x084b('0x36')]({},_0x3fdf36,_0x18ef3e[_0x084b('0x3a')]);var _0x1e3932={'where':_0x3fdf36[_0x084b('0x34')]};return db[_0x084b('0x28')][_0x084b('0x1d')](_0x1e3932)[_0x084b('0x23')](function(_0x4dc7cf){_0x119c2e[_0x084b('0x1d')]=_0x4dc7cf;if(_0x18ef3e['query'][_0x084b('0x3b')]){_0x3fdf36[_0x084b('0x3c')]=[{'all':!![]}];}return db[_0x084b('0x28')]['findAll'](_0x3fdf36);})[_0x084b('0x23')](function(_0x3bf293){_0x119c2e[_0x084b('0x3d')]=_0x3bf293;return _0x119c2e;})[_0x084b('0x23')](respondWithFilteredResult(_0x57662c,_0x3fdf36))[_0x084b('0x3e')](handleError(_0x57662c,null));};exports[_0x084b('0x3f')]=function(_0x11ffb4,_0x22a548){var _0x1453b0={'raw':!![],'where':{'id':_0x11ffb4[_0x084b('0x40')]['id']}},_0x14085c={};_0x14085c[_0x084b('0x29')]=_['keys'](db[_0x084b('0x28')][_0x084b('0x41')]);_0x14085c[_0x084b('0x2a')]=_[_0x084b('0x2b')](_0x11ffb4[_0x084b('0x2a')]);_0x14085c[_0x084b('0x35')]=_['intersection'](_0x14085c[_0x084b('0x29')],_0x14085c['query']);_0x1453b0[_0x084b('0x2d')]=_[_0x084b('0x2c')](_0x14085c[_0x084b('0x29')],qs['fields'](_0x11ffb4['query'][_0x084b('0x2e')]));_0x1453b0[_0x084b('0x2d')]=_0x1453b0['attributes'][_0x084b('0x2f')]?_0x1453b0[_0x084b('0x2d')]:_0x14085c['model'];if(_0x11ffb4[_0x084b('0x2a')][_0x084b('0x3b')]){_0x1453b0['include']=[{'all':!![]}];}_0x1453b0=_[_0x084b('0x36')]({},_0x1453b0,_0x11ffb4[_0x084b('0x3a')]);return db[_0x084b('0x28')]['find'](_0x1453b0)[_0x084b('0x23')](handleEntityNotFound(_0x22a548,null))[_0x084b('0x23')](respondWithResult(_0x22a548,null))[_0x084b('0x3e')](handleError(_0x22a548,null));};exports[_0x084b('0x42')]=function(_0xb62eb2,_0x4e8926){return db[_0x084b('0x28')][_0x084b('0x42')](_0xb62eb2[_0x084b('0x43')],{})[_0x084b('0x23')](respondWithResult(_0x4e8926,0xc9))['catch'](handleError(_0x4e8926,null));};exports[_0x084b('0x44')]=function(_0x393c87,_0xba8ea1){if(_0x393c87[_0x084b('0x43')]['id']){delete _0x393c87[_0x084b('0x43')]['id'];}return db[_0x084b('0x28')]['find']({'where':{'id':_0x393c87['params']['id']}})['then'](handleEntityNotFound(_0xba8ea1,null))[_0x084b('0x23')](saveUpdates(_0x393c87[_0x084b('0x43')],null))[_0x084b('0x23')](respondWithResult(_0xba8ea1,null))[_0x084b('0x3e')](handleError(_0xba8ea1,null));};exports['destroy']=function(_0x530ea0,_0x1a4849){return db[_0x084b('0x28')][_0x084b('0x45')]({'where':{'id':_0x530ea0[_0x084b('0x40')]['id']}})[_0x084b('0x23')](handleEntityNotFound(_0x1a4849,null))[_0x084b('0x23')](removeEntity(_0x1a4849,null))[_0x084b('0x3e')](handleError(_0x1a4849,null));}; \ No newline at end of file +var _0x642b=['includeAll','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','rows','show','params','keys'];(function(_0x3cc6b4,_0x58b1aa){var _0x1c07b8=function(_0x156458){while(--_0x156458){_0x3cc6b4['push'](_0x3cc6b4['shift']());}};_0x1c07b8(++_0x58b1aa);}(_0x642b,0x1e0));var _0xb642=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x642b[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0xb642('0x0'));var rimraf=require(_0xb642('0x1'));var zipdir=require(_0xb642('0x2'));var jsonpatch=require(_0xb642('0x3'));var rp=require(_0xb642('0x4'));var moment=require(_0xb642('0x5'));var BPromise=require(_0xb642('0x6'));var Mustache=require('mustache');var util=require(_0xb642('0x7'));var path=require(_0xb642('0x8'));var sox=require('sox');var csv=require(_0xb642('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb642('0xa'));var _=require(_0xb642('0xb'));var squel=require(_0xb642('0xc'));var crypto=require('crypto');var jsforce=require(_0xb642('0xd'));var deskjs=require(_0xb642('0xe'));var toCsv=require(_0xb642('0x9'));var querystring=require(_0xb642('0xf'));var Papa=require(_0xb642('0x10'));var Redis=require(_0xb642('0x11'));var authService=require(_0xb642('0x12'));var qs=require(_0xb642('0x13'));var as=require(_0xb642('0x14'));var hardwareService=require(_0xb642('0x15'));var logger=require(_0xb642('0x16'))(_0xb642('0x17'));var utils=require(_0xb642('0x18'));var config=require(_0xb642('0x19'));var licenseUtil=require(_0xb642('0x1a'));var db=require(_0xb642('0x1b'))['db'];function respondWithStatusCode(_0x4e4d94,_0xd395a4){_0xd395a4=_0xd395a4||0xcc;return function(_0x46e011){if(_0x46e011){return _0x4e4d94[_0xb642('0x1c')](_0xd395a4);}return _0x4e4d94[_0xb642('0x1d')](_0xd395a4)[_0xb642('0x1e')]();};}function respondWithResult(_0x33d786,_0x29a181){_0x29a181=_0x29a181||0xc8;return function(_0x1754a2){if(_0x1754a2){return _0x33d786[_0xb642('0x1d')](_0x29a181)[_0xb642('0x1f')](_0x1754a2);}};}function respondWithFilteredResult(_0x2fee2b,_0x5a781a){return function(_0x29f8ce){if(_0x29f8ce){var _0xdcda7b=typeof _0x5a781a[_0xb642('0x20')]==='undefined'&&typeof _0x5a781a['limit']===_0xb642('0x21');var _0x890906=_0x29f8ce[_0xb642('0x22')];var _0x33fb1a=_0xdcda7b?0x0:_0x5a781a['offset'];var _0x255231=_0xdcda7b?_0x29f8ce[_0xb642('0x22')]:_0x5a781a[_0xb642('0x20')]+_0x5a781a[_0xb642('0x23')];var _0x4e0284;if(_0x255231>=_0x890906){_0x255231=_0x890906;_0x4e0284=0xc8;}else{_0x4e0284=0xce;}_0x2fee2b[_0xb642('0x1d')](_0x4e0284);return _0x2fee2b[_0xb642('0x24')](_0xb642('0x25'),_0x33fb1a+'-'+_0x255231+'/'+_0x890906)[_0xb642('0x1f')](_0x29f8ce);}return null;};}function patchUpdates(_0x158d28){return function(_0x2ae517){try{jsonpatch['apply'](_0x2ae517,_0x158d28,!![]);}catch(_0x567d87){return BPromise[_0xb642('0x26')](_0x567d87);}return _0x2ae517[_0xb642('0x27')]();};}function saveUpdates(_0x3e4b46,_0x2a549c){return function(_0x358349){if(_0x358349){return _0x358349[_0xb642('0x28')](_0x3e4b46)[_0xb642('0x29')](function(_0x11ae1a){return _0x11ae1a;});}return null;};}function removeEntity(_0x465013,_0x44f989){return function(_0x1eaa84){if(_0x1eaa84){return _0x1eaa84[_0xb642('0x2a')]()[_0xb642('0x29')](function(){_0x465013['status'](0xcc)[_0xb642('0x1e')]();});}};}function handleEntityNotFound(_0x5636e2,_0x50484f){return function(_0x4a6ff6){if(!_0x4a6ff6){_0x5636e2[_0xb642('0x1c')](0x194);}return _0x4a6ff6;};}function handleError(_0x1b18f4,_0x3b37b7){_0x3b37b7=_0x3b37b7||0x1f4;return function(_0x5b0abc){logger['error'](_0x5b0abc[_0xb642('0x2b')]);if(_0x5b0abc[_0xb642('0x2c')]){delete _0x5b0abc['name'];}_0x1b18f4[_0xb642('0x1d')](_0x3b37b7)[_0xb642('0x2d')](_0x5b0abc);};}exports[_0xb642('0x2e')]=function(_0x1fe5bd,_0x47897e){var _0x1646f3={},_0x32d008={},_0x187514={'count':0x0,'rows':[]};var _0x31e910=_[_0xb642('0x2f')](db[_0xb642('0x30')][_0xb642('0x31')],function(_0x416fde){return{'name':_0x416fde[_0xb642('0x32')],'type':_0x416fde[_0xb642('0x33')][_0xb642('0x34')]};});_0x32d008[_0xb642('0x35')]=_[_0xb642('0x2f')](_0x31e910,'name');_0x32d008[_0xb642('0x36')]=_['keys'](_0x1fe5bd[_0xb642('0x36')]);_0x32d008[_0xb642('0x37')]=_[_0xb642('0x38')](_0x32d008[_0xb642('0x35')],_0x32d008[_0xb642('0x36')]);_0x1646f3['attributes']=_[_0xb642('0x38')](_0x32d008[_0xb642('0x35')],qs[_0xb642('0x39')](_0x1fe5bd['query'][_0xb642('0x39')]));_0x1646f3[_0xb642('0x3a')]=_0x1646f3[_0xb642('0x3a')][_0xb642('0x3b')]?_0x1646f3[_0xb642('0x3a')]:_0x32d008['model'];if(!_0x1fe5bd[_0xb642('0x36')][_0xb642('0x3c')](_0xb642('0x3d'))){_0x1646f3['limit']=qs['limit'](_0x1fe5bd[_0xb642('0x36')]['limit']);_0x1646f3[_0xb642('0x20')]=qs[_0xb642('0x20')](_0x1fe5bd[_0xb642('0x36')]['offset']);}_0x1646f3[_0xb642('0x3e')]=qs[_0xb642('0x3f')](_0x1fe5bd['query'][_0xb642('0x3f')]);_0x1646f3[_0xb642('0x40')]=qs['filters'](_['pick'](_0x1fe5bd[_0xb642('0x36')],_0x32d008['filters']),_0x31e910);if(_0x1fe5bd['query']['filter']){_0x1646f3['where']=_[_0xb642('0x41')](_0x1646f3[_0xb642('0x40')],{'$or':_[_0xb642('0x2f')](_0x31e910,function(_0x1c8a06){if(_0x1c8a06[_0xb642('0x33')]!==_0xb642('0x42')){var _0x1347d2={};_0x1347d2[_0x1c8a06[_0xb642('0x2c')]]={'$like':'%'+_0x1fe5bd[_0xb642('0x36')]['filter']+'%'};return _0x1347d2;}})});}_0x1646f3=_[_0xb642('0x41')]({},_0x1646f3,_0x1fe5bd['options']);var _0x3cb7c0={'where':_0x1646f3[_0xb642('0x40')]};return db[_0xb642('0x30')][_0xb642('0x22')](_0x3cb7c0)['then'](function(_0x4c097c){_0x187514[_0xb642('0x22')]=_0x4c097c;if(_0x1fe5bd[_0xb642('0x36')]['includeAll']){_0x1646f3[_0xb642('0x43')]=[{'all':!![]}];}return db[_0xb642('0x30')][_0xb642('0x44')](_0x1646f3);})[_0xb642('0x29')](function(_0x22d9eb){_0x187514[_0xb642('0x45')]=_0x22d9eb;return _0x187514;})[_0xb642('0x29')](respondWithFilteredResult(_0x47897e,_0x1646f3))['catch'](handleError(_0x47897e,null));};exports[_0xb642('0x46')]=function(_0x2a6c2b,_0x3cf3be){var _0x43956c={'raw':!![],'where':{'id':_0x2a6c2b[_0xb642('0x47')]['id']}},_0x4cc0d9={};_0x4cc0d9[_0xb642('0x35')]=_[_0xb642('0x48')](db[_0xb642('0x30')][_0xb642('0x31')]);_0x4cc0d9[_0xb642('0x36')]=_[_0xb642('0x48')](_0x2a6c2b[_0xb642('0x36')]);_0x4cc0d9[_0xb642('0x37')]=_[_0xb642('0x38')](_0x4cc0d9[_0xb642('0x35')],_0x4cc0d9[_0xb642('0x36')]);_0x43956c['attributes']=_[_0xb642('0x38')](_0x4cc0d9['model'],qs[_0xb642('0x39')](_0x2a6c2b[_0xb642('0x36')][_0xb642('0x39')]));_0x43956c[_0xb642('0x3a')]=_0x43956c[_0xb642('0x3a')][_0xb642('0x3b')]?_0x43956c[_0xb642('0x3a')]:_0x4cc0d9[_0xb642('0x35')];if(_0x2a6c2b[_0xb642('0x36')][_0xb642('0x49')]){_0x43956c['include']=[{'all':!![]}];}_0x43956c=_[_0xb642('0x41')]({},_0x43956c,_0x2a6c2b[_0xb642('0x4a')]);return db['FreshsalesField'][_0xb642('0x4b')](_0x43956c)['then'](handleEntityNotFound(_0x3cf3be,null))[_0xb642('0x29')](respondWithResult(_0x3cf3be,null))['catch'](handleError(_0x3cf3be,null));};exports[_0xb642('0x4c')]=function(_0xf1631c,_0x199de4){return db[_0xb642('0x30')][_0xb642('0x4c')](_0xf1631c[_0xb642('0x4d')],{})[_0xb642('0x29')](respondWithResult(_0x199de4,0xc9))[_0xb642('0x4e')](handleError(_0x199de4,null));};exports[_0xb642('0x28')]=function(_0x384978,_0x123fb3){if(_0x384978['body']['id']){delete _0x384978[_0xb642('0x4d')]['id'];}return db['FreshsalesField'][_0xb642('0x4b')]({'where':{'id':_0x384978[_0xb642('0x47')]['id']}})[_0xb642('0x29')](handleEntityNotFound(_0x123fb3,null))[_0xb642('0x29')](saveUpdates(_0x384978[_0xb642('0x4d')],null))[_0xb642('0x29')](respondWithResult(_0x123fb3,null))['catch'](handleError(_0x123fb3,null));};exports[_0xb642('0x2a')]=function(_0x4a70b7,_0x57fa1a){return db[_0xb642('0x30')][_0xb642('0x4b')]({'where':{'id':_0x4a70b7[_0xb642('0x47')]['id']}})[_0xb642('0x29')](handleEntityNotFound(_0x57fa1a,null))[_0xb642('0x29')](removeEntity(_0x57fa1a,null))[_0xb642('0x4e')](handleError(_0x57fa1a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 21305ec..fc443ec 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 _0x6132=['util','api','moment','bluebird','rimraf','./intFreshsalesField.attributes','define','int_freshsales_fields','freshsales_unique_index'];(function(_0x330caa,_0x4f781c){var _0x1159b9=function(_0x546557){while(--_0x546557){_0x330caa['push'](_0x330caa['shift']());}};_0x1159b9(++_0x4f781c);}(_0x6132,0xf3));var _0x2613=function(_0x58e9a1,_0x4eabdb){_0x58e9a1=_0x58e9a1-0x0;var _0x44ca4b=_0x6132[_0x58e9a1];return _0x44ca4b;};'use strict';var _=require('lodash');var util=require(_0x2613('0x0'));var logger=require('../../config/logger')(_0x2613('0x1'));var moment=require(_0x2613('0x2'));var BPromise=require(_0x2613('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2613('0x4'));var config=require('../../config/environment');var attributes=require(_0x2613('0x5'));module['exports']=function(_0x4479f6,_0x3f8ef6){return _0x4479f6[_0x2613('0x6')]('FreshsalesField',attributes,{'tableName':_0x2613('0x7'),'paranoid':![],'indexes':[{'name':_0x2613('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0424=['define','FreshsalesField','int_freshsales_fields','FieldId','../../config/logger','api','moment','bluebird','path','./intFreshsalesField.attributes','exports'];(function(_0x18779c,_0x285818){var _0x2f9137=function(_0x325d34){while(--_0x325d34){_0x18779c['push'](_0x18779c['shift']());}};_0x2f9137(++_0x285818);}(_0x0424,0x159));var _0x4042=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0x0424[_0x7f3667];return _0x2c4c24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));module[_0x4042('0x6')]=function(_0x472795,_0xc0fba0){return _0x472795[_0x4042('0x7')](_0x4042('0x8'),attributes,{'tableName':_0x4042('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0x4042('0xa')],'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 066b556..d2307dd 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 _0x46ed=['FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x46ed,0x168));var _0xd46e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x46ed[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xf494,0x1c6));var _0x4f49=function(_0x3e8479,_0xcacd11){_0x3e8479=_0x3e8479-0x0;var _0x28e20e=_0xf494[_0x3e8479];return _0x28e20e;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 65c8d5e..10d4979 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3425ab,_0x3af47b){var _0x20a6b3=function(_0xe8de8c){while(--_0xe8de8c){_0x3425ab['push'](_0x3425ab['shift']());}};_0x20a6b3(++_0x3af47b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x37e443,_0x10121d){var _0x47559f=function(_0x282097){while(--_0x282097){_0x37e443['push'](_0x37e443['shift']());}};_0x47559f(++_0x10121d);}(_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('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 c137993..04f7bc9 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 _0xde3a=['ENUM','integrationTab','sequelize','exports','username','STRING'];(function(_0x100303,_0x94e9a6){var _0x2281d1=function(_0xae8f7e){while(--_0xae8f7e){_0x100303['push'](_0x100303['shift']());}};_0x2281d1(++_0x94e9a6);}(_0xde3a,0x140));var _0xade3=function(_0x43d50f,_0x1a5ec3){_0x43d50f=_0x43d50f-0x0;var _0xd30928=_0xde3a[_0x43d50f];return _0xd30928;};'use strict';var Sequelize=require(_0xade3('0x0'));module[_0xade3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xade3('0x2')},'remoteUri':{'type':Sequelize[_0xade3('0x3')]},'password':{'type':Sequelize[_0xade3('0x3')]},'clientId':{'type':Sequelize[_0xade3('0x3')]},'clientSecret':{'type':Sequelize[_0xade3('0x3')]},'securityToken':{'type':Sequelize[_0xade3('0x3')]},'serverUrl':{'type':Sequelize[_0xade3('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xade3('0x4')](_0xade3('0x5'),'newTab'),'defaultValue':_0xade3('0x5')}}; \ No newline at end of file +var _0x15b8=['integrationTab','exports','STRING','username','ENUM','newTab'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x15b8,0xcd));var _0x815b=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x15b8[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0x815b('0x0')]={'name':{'type':Sequelize[_0x815b('0x1')]},'description':{'type':Sequelize[_0x815b('0x1')]},'username':{'type':Sequelize[_0x815b('0x1')],'unique':_0x815b('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x815b('0x1')]},'clientId':{'type':Sequelize[_0x815b('0x1')]},'clientSecret':{'type':Sequelize[_0x815b('0x1')]},'securityToken':{'type':Sequelize[_0x815b('0x1')]},'serverUrl':{'type':Sequelize[_0x815b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x815b('0x3')]('integrationTab',_0x815b('0x4')),'defaultValue':_0x815b('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index dd61725..42ec155 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 _0x624c=['phone','remove','includes','custom','picklistValues','label','value','True','False','test','statusCode','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','map','SalesforceAccount','rawAttributes','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','keys','fields','create','body','find','getConfigurations','findOne','SalesforceConfiguration','order','nolimit','addConfiguration','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','picklist','boolean','email'];(function(_0x432351,_0x20ae89){var _0x24ca09=function(_0x2bf186){while(--_0x2bf186){_0x432351['push'](_0x432351['shift']());}};_0x24ca09(++_0x20ae89);}(_0x624c,0x195));var _0xc624=function(_0x38b3cb,_0x4ad7b3){_0x38b3cb=_0x38b3cb-0x0;var _0x5a9a84=_0x624c[_0x38b3cb];return _0x5a9a84;};'use strict';var emlformat=require(_0xc624('0x0'));var rimraf=require(_0xc624('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc624('0x2'));var moment=require('moment');var BPromise=require(_0xc624('0x3'));var Mustache=require(_0xc624('0x4'));var util=require(_0xc624('0x5'));var path=require(_0xc624('0x6'));var sox=require(_0xc624('0x7'));var csv=require(_0xc624('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc624('0x9'));var _=require(_0xc624('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc624('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc624('0x8'));var querystring=require(_0xc624('0xc'));var Papa=require(_0xc624('0xd'));var Redis=require('ioredis');var authService=require(_0xc624('0xe'));var qs=require(_0xc624('0xf'));var as=require(_0xc624('0x10'));var hardwareService=require(_0xc624('0x11'));var logger=require('../../config/logger')(_0xc624('0x12'));var utils=require(_0xc624('0x13'));var config=require(_0xc624('0x14'));var licenseUtil=require(_0xc624('0x15'));var db=require(_0xc624('0x16'))['db'];var integrations=require(_0xc624('0x17'));var jayson=require(_0xc624('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e13ee,_0x94dbc,_0x1182d1,_0x51dea2){return new BPromise(function(_0x388717,_0x258add){var _0x486ece=_0x51dea2||client;return _0x486ece[_0xc624('0x19')](_0x1e13ee,_0x1182d1)[_0xc624('0x1a')](function(_0x485794){logger[_0xc624('0x1b')](_0xc624('0x1c'),_0x94dbc,'request\x20sent');logger[_0xc624('0x1d')](_0xc624('0x1e'),_0x94dbc,_0xc624('0x1f'),JSON[_0xc624('0x20')](_0x485794));if(_0x485794[_0xc624('0x21')]){if(_0x485794[_0xc624('0x21')][_0xc624('0x22')]===0x1f4){logger['error'](_0xc624('0x1c'),_0x94dbc,_0x485794[_0xc624('0x21')][_0xc624('0x23')]);return _0x258add(_0x485794[_0xc624('0x21')][_0xc624('0x23')]);}logger[_0xc624('0x21')](_0xc624('0x1c'),_0x94dbc,_0x485794['error'][_0xc624('0x23')]);return _0x388717(_0x485794[_0xc624('0x21')][_0xc624('0x23')]);}else{logger[_0xc624('0x1b')]('SalesforceAccount,\x20%s,\x20%s',_0x94dbc,_0xc624('0x1f'));_0x388717(_0x485794[_0xc624('0x24')][_0xc624('0x23')]);}})[_0xc624('0x25')](function(_0x34e0af){logger[_0xc624('0x21')](_0xc624('0x1c'),_0x94dbc,_0x34e0af);_0x258add(_0x34e0af);});});}function respondWithStatusCode(_0x1a1b29,_0x2e5b1e){_0x2e5b1e=_0x2e5b1e||0xcc;return function(_0x2a2005){if(_0x2a2005){return _0x1a1b29[_0xc624('0x26')](_0x2e5b1e);}return _0x1a1b29[_0xc624('0x27')](_0x2e5b1e)[_0xc624('0x28')]();};}function respondWithResult(_0x22036c,_0x54d159){_0x54d159=_0x54d159||0xc8;return function(_0x466a9c){if(_0x466a9c){return _0x22036c[_0xc624('0x27')](_0x54d159)[_0xc624('0x29')](_0x466a9c);}};}function respondWithFilteredResult(_0x2aead5,_0x2cf43b){return function(_0x321300){if(_0x321300){var _0x51c0b6=typeof _0x2cf43b[_0xc624('0x2a')]===_0xc624('0x2b')&&typeof _0x2cf43b[_0xc624('0x2c')]==='undefined';var _0x52f3f2=_0x321300['count'];var _0x182ae8=_0x51c0b6?0x0:_0x2cf43b[_0xc624('0x2a')];var _0x2700eb=_0x51c0b6?_0x321300['count']:_0x2cf43b[_0xc624('0x2a')]+_0x2cf43b[_0xc624('0x2c')];var _0xdf9097;if(_0x2700eb>=_0x52f3f2){_0x2700eb=_0x52f3f2;_0xdf9097=0xc8;}else{_0xdf9097=0xce;}_0x2aead5[_0xc624('0x27')](_0xdf9097);return _0x2aead5[_0xc624('0x2d')](_0xc624('0x2e'),_0x182ae8+'-'+_0x2700eb+'/'+_0x52f3f2)['json'](_0x321300);}return null;};}function patchUpdates(_0x234fa7){return function(_0x56c518){try{jsonpatch[_0xc624('0x2f')](_0x56c518,_0x234fa7,!![]);}catch(_0x491265){return BPromise[_0xc624('0x30')](_0x491265);}return _0x56c518[_0xc624('0x31')]();};}function saveUpdates(_0x32f7fa,_0x467b2f){return function(_0x2e8040){if(_0x2e8040){return _0x2e8040['update'](_0x32f7fa)['then'](function(_0x11cf67){return _0x11cf67;});}return null;};}function removeEntity(_0x1c8324,_0x2924ad){return function(_0x355597){if(_0x355597){return _0x355597[_0xc624('0x32')]()[_0xc624('0x1a')](function(){_0x1c8324[_0xc624('0x27')](0xcc)[_0xc624('0x28')]();});}};}function handleEntityNotFound(_0xd57f7b,_0x1a9df5){return function(_0x2fe641){if(!_0x2fe641){_0xd57f7b[_0xc624('0x26')](0x194);}return _0x2fe641;};}function handleError(_0x1265ec,_0x4dfcf2){_0x4dfcf2=_0x4dfcf2||0x1f4;return function(_0x8e1f19){logger[_0xc624('0x21')](_0x8e1f19[_0xc624('0x33')]);if(_0x8e1f19[_0xc624('0x34')]){delete _0x8e1f19[_0xc624('0x34')];}_0x1265ec[_0xc624('0x27')](_0x4dfcf2)[_0xc624('0x35')](_0x8e1f19);};}exports['index']=function(_0x1ca79b,_0x144abc){var _0x536599={},_0x20e940={},_0x4830d1={'count':0x0,'rows':[]};var _0x5d1aad=_[_0xc624('0x36')](db[_0xc624('0x37')][_0xc624('0x38')],function(_0x8a2975){return{'name':_0x8a2975['fieldName'],'type':_0x8a2975['type'][_0xc624('0x39')]};});_0x20e940[_0xc624('0x3a')]=_['map'](_0x5d1aad,_0xc624('0x34'));_0x20e940[_0xc624('0x3b')]=_['keys'](_0x1ca79b[_0xc624('0x3b')]);_0x20e940[_0xc624('0x3c')]=_[_0xc624('0x3d')](_0x20e940[_0xc624('0x3a')],_0x20e940[_0xc624('0x3b')]);_0x536599[_0xc624('0x3e')]=_[_0xc624('0x3d')](_0x20e940['model'],qs['fields'](_0x1ca79b[_0xc624('0x3b')]['fields']));_0x536599[_0xc624('0x3e')]=_0x536599[_0xc624('0x3e')][_0xc624('0x3f')]?_0x536599['attributes']:_0x20e940['model'];if(!_0x1ca79b[_0xc624('0x3b')][_0xc624('0x40')]('nolimit')){_0x536599[_0xc624('0x2c')]=qs[_0xc624('0x2c')](_0x1ca79b['query'][_0xc624('0x2c')]);_0x536599[_0xc624('0x2a')]=qs[_0xc624('0x2a')](_0x1ca79b[_0xc624('0x3b')][_0xc624('0x2a')]);}_0x536599['order']=qs[_0xc624('0x41')](_0x1ca79b[_0xc624('0x3b')][_0xc624('0x41')]);_0x536599[_0xc624('0x42')]=qs[_0xc624('0x3c')](_[_0xc624('0x43')](_0x1ca79b[_0xc624('0x3b')],_0x20e940[_0xc624('0x3c')]),_0x5d1aad);if(_0x1ca79b[_0xc624('0x3b')][_0xc624('0x44')]){_0x536599[_0xc624('0x42')]=_[_0xc624('0x45')](_0x536599[_0xc624('0x42')],{'$or':_[_0xc624('0x36')](_0x5d1aad,function(_0x232aa2){if(_0x232aa2['type']!==_0xc624('0x46')){var _0xa2fd07={};_0xa2fd07[_0x232aa2[_0xc624('0x34')]]={'$like':'%'+_0x1ca79b['query'][_0xc624('0x44')]+'%'};return _0xa2fd07;}})});}_0x536599=_[_0xc624('0x45')]({},_0x536599,_0x1ca79b[_0xc624('0x47')]);var _0x1bd80c={'where':_0x536599[_0xc624('0x42')]};return db[_0xc624('0x37')][_0xc624('0x48')](_0x1bd80c)[_0xc624('0x1a')](function(_0x22b712){_0x4830d1[_0xc624('0x48')]=_0x22b712;if(_0x1ca79b['query'][_0xc624('0x49')]){_0x536599[_0xc624('0x4a')]=[{'all':!![]}];}return db[_0xc624('0x37')]['findAll'](_0x536599);})[_0xc624('0x1a')](function(_0x19832e){_0x4830d1['rows']=_0x19832e;return _0x4830d1;})['then'](respondWithFilteredResult(_0x144abc,_0x536599))[_0xc624('0x25')](handleError(_0x144abc,null));};exports[_0xc624('0x4b')]=function(_0x3c57cb,_0x50ca89){var _0x299369={'raw':![],'where':{'id':_0x3c57cb[_0xc624('0x4c')]['id']}},_0xbdd479={};_0xbdd479['model']=_['keys'](db[_0xc624('0x37')][_0xc624('0x38')]);_0xbdd479['query']=_[_0xc624('0x4d')](_0x3c57cb[_0xc624('0x3b')]);_0xbdd479['filters']=_[_0xc624('0x3d')](_0xbdd479[_0xc624('0x3a')],_0xbdd479['query']);_0x299369[_0xc624('0x3e')]=_['intersection'](_0xbdd479[_0xc624('0x3a')],qs['fields'](_0x3c57cb[_0xc624('0x3b')][_0xc624('0x4e')]));_0x299369[_0xc624('0x3e')]=_0x299369['attributes']['length']?_0x299369['attributes']:_0xbdd479['model'];if(_0x3c57cb[_0xc624('0x3b')][_0xc624('0x49')]){_0x299369['include']=[{'all':!![]}];}_0x299369=_[_0xc624('0x45')]({},_0x299369,_0x3c57cb[_0xc624('0x47')]);return db[_0xc624('0x37')]['find'](_0x299369)[_0xc624('0x1a')](handleEntityNotFound(_0x50ca89,null))['then'](respondWithResult(_0x50ca89,null))[_0xc624('0x25')](handleError(_0x50ca89,null));};exports[_0xc624('0x4f')]=function(_0x2e0a43,_0x22b625){return db[_0xc624('0x37')]['create'](_0x2e0a43[_0xc624('0x50')],{})['then'](respondWithResult(_0x22b625,0xc9))[_0xc624('0x25')](handleError(_0x22b625,null));};exports['update']=function(_0x4333fd,_0x39fac6){if(_0x4333fd[_0xc624('0x50')]['id']){delete _0x4333fd[_0xc624('0x50')]['id'];}return db[_0xc624('0x37')][_0xc624('0x51')]({'where':{'id':_0x4333fd['params']['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0x39fac6,null))[_0xc624('0x1a')](saveUpdates(_0x4333fd[_0xc624('0x50')],null))[_0xc624('0x1a')](respondWithResult(_0x39fac6,null))[_0xc624('0x25')](handleError(_0x39fac6,null));};exports[_0xc624('0x32')]=function(_0x53fddb,_0xc985ee){return db[_0xc624('0x37')][_0xc624('0x51')]({'where':{'id':_0x53fddb[_0xc624('0x4c')]['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0xc985ee,null))[_0xc624('0x1a')](removeEntity(_0xc985ee,null))[_0xc624('0x25')](handleError(_0xc985ee,null));};exports[_0xc624('0x52')]=function(_0x514a73,_0x82e770,_0x6aafb0){var _0x4a3471={};var _0x2cd261={};var _0x2b942e;var _0x3fc850;return db['SalesforceAccount'][_0xc624('0x53')]({'where':{'id':_0x514a73[_0xc624('0x4c')]['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0x82e770,null))[_0xc624('0x1a')](function(_0x436af0){if(_0x436af0){_0x2b942e=_0x436af0;_0x2cd261[_0xc624('0x3a')]=_[_0xc624('0x4d')](db[_0xc624('0x54')][_0xc624('0x38')]);_0x2cd261[_0xc624('0x3b')]=_[_0xc624('0x4d')](_0x514a73[_0xc624('0x3b')]);_0x2cd261['filters']=_['intersection'](_0x2cd261[_0xc624('0x3a')],_0x2cd261['query']);_0x4a3471['attributes']=_[_0xc624('0x3d')](_0x2cd261[_0xc624('0x3a')],qs['fields'](_0x514a73['query'][_0xc624('0x4e')]));_0x4a3471[_0xc624('0x3e')]=_0x4a3471[_0xc624('0x3e')][_0xc624('0x3f')]?_0x4a3471[_0xc624('0x3e')]:_0x2cd261[_0xc624('0x3a')];_0x4a3471[_0xc624('0x55')]=qs[_0xc624('0x41')](_0x514a73[_0xc624('0x3b')][_0xc624('0x41')]);_0x4a3471[_0xc624('0x42')]=qs[_0xc624('0x3c')](_[_0xc624('0x43')](_0x514a73[_0xc624('0x3b')],_0x2cd261[_0xc624('0x3c')]));if(_0x514a73['query'][_0xc624('0x44')]){_0x4a3471[_0xc624('0x42')]=_[_0xc624('0x45')](_0x4a3471[_0xc624('0x42')],{'$or':_[_0xc624('0x36')](_0x4a3471['attributes'],function(_0x5e774a){var _0x32776f={};_0x32776f[_0x5e774a]={'$like':'%'+_0x514a73[_0xc624('0x3b')]['filter']+'%'};return _0x32776f;})});}_0x4a3471=_[_0xc624('0x45')]({},_0x4a3471,_0x514a73[_0xc624('0x47')]);return _0x2b942e[_0xc624('0x52')](_0x4a3471);}})['then'](function(_0x37cc11){if(_0x37cc11){_0x3fc850=_0x37cc11[_0xc624('0x3f')];if(!_0x514a73[_0xc624('0x3b')][_0xc624('0x40')](_0xc624('0x56'))){_0x4a3471[_0xc624('0x2c')]=qs['limit'](_0x514a73[_0xc624('0x3b')]['limit']);_0x4a3471['offset']=qs[_0xc624('0x2a')](_0x514a73[_0xc624('0x3b')][_0xc624('0x2a')]);}return _0x2b942e[_0xc624('0x52')](_0x4a3471);}})['then'](function(_0x459fed){if(_0x459fed){return _0x459fed?{'count':_0x3fc850,'rows':_0x459fed}:null;}})['then'](respondWithResult(_0x82e770,null))[_0xc624('0x25')](handleError(_0x82e770,null));};exports[_0xc624('0x57')]=function(_0x1da5ac,_0x3c3cd7,_0x139ffd){if(_0x1da5ac[_0xc624('0x50')]['id']){delete _0x1da5ac[_0xc624('0x50')]['id'];}return db[_0xc624('0x37')][_0xc624('0x53')]({'where':{'id':_0x1da5ac[_0xc624('0x4c')]['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0x3c3cd7,null))[_0xc624('0x1a')](function(_0x4d9b85){if(_0x4d9b85){_0x1da5ac[_0xc624('0x50')]['AccountId']=_0x4d9b85['id'];_0x1da5ac[_0xc624('0x50')][_0xc624('0x58')]=integrations[_0xc624('0x59')](_0x1da5ac[_0xc624('0x50')]['channel'],_0x1da5ac[_0xc624('0x50')][_0xc624('0x5a')]);_0x1da5ac['body'][_0xc624('0x5b')]=integrations[_0xc624('0x5c')](_0x1da5ac['body'][_0xc624('0x5d')],_0x1da5ac['body']['type']);return db['SalesforceConfiguration']['create'](_0x1da5ac[_0xc624('0x50')],{'include':[{'model':db['SalesforceField'],'as':_0xc624('0x58')},{'model':db[_0xc624('0x5e')],'as':_0xc624('0x5b')}]});}return null;})[_0xc624('0x1a')](respondWithResult(_0x3c3cd7,null))[_0xc624('0x25')](handleError(_0x3c3cd7,null));};exports[_0xc624('0x5f')]=function(_0x4e1bae,_0x146b8d,_0x2c6587){var _0x27bf20;var _0x312a39='';var _0x38adfb=_0xc624('0x60');return db[_0xc624('0x37')][_0xc624('0x53')]({'where':{'id':_0x4e1bae[_0xc624('0x4c')]['id']},'attributes':['id','remoteUri',_0xc624('0x61'),_0xc624('0x62'),_0xc624('0x63'),_0xc624('0x64'),_0xc624('0x65')]})['then'](handleEntityNotFound(_0x146b8d,null))[_0xc624('0x1a')](function(_0x46f912){if(_0x46f912){_0x312a39=_0x46f912[_0xc624('0x66')];var _0x1071ef=_0x312a39['slice'](-0x1);if(_0x1071ef==='/'){_0x312a39=_0x312a39[_0xc624('0x67')](0x0,_0x312a39[_0xc624('0x68')](_0x1071ef));}_0x27bf20=new jsforce[(_0xc624('0x69'))]({'oauth2':{'loginUrl':_0x312a39,'clientId':_0x46f912[_0xc624('0x61')],'clientSecret':_0x46f912[_0xc624('0x62')]}});return _0x27bf20[_0xc624('0x6a')](_0x46f912[_0xc624('0x63')],_0x46f912[_0xc624('0x64')][_0xc624('0x6b')](_0x46f912['securityToken']));}})['then'](function(_0x384b29){if(_0x384b29){if(!_[_0xc624('0x6c')](_0x4e1bae[_0xc624('0x3b')][_0xc624('0x6d')])){_0x38adfb=_0x4e1bae['query'][_0xc624('0x6d')];}return _0x27bf20['sobject'](_0x38adfb)['describe']();}})[_0xc624('0x1a')](function(_0xd7a1b5){var _0x543e7a=[_0xc624('0x6e'),_0xc624('0x6f'),_0xc624('0x70'),_0xc624('0x71'),_0xc624('0x72'),_0xc624('0x73')];var _0x220101=['string','int',_0xc624('0x74'),_0xc624('0x75'),_0xc624('0x76'),'textarea',_0xc624('0x77')];if(_0xd7a1b5){_[_0xc624('0x78')](_0xd7a1b5['fields'],function(_0x20e701){return _0x543e7a[_0xc624('0x79')](_0x20e701[_0xc624('0x34')])||!_0x220101[_0xc624('0x79')](_0x20e701[_0xc624('0x5a')]);});return{'count':_0xd7a1b5[_0xc624('0x4e')][_0xc624('0x3f')],'rows':_[_0xc624('0x36')](_0xd7a1b5[_0xc624('0x4e')],function(_0x530125){return{'id':_0x530125[_0xc624('0x34')],'name':_0x530125['label'],'custom':_0x530125[_0xc624('0x7a')],'options':_0x530125[_0xc624('0x7b')][_0xc624('0x3f')]>0x0?_[_0xc624('0x36')](_0x530125['picklistValues'],function(_0x41a52c){return{'name':_0x41a52c[_0xc624('0x7c')],'value':_0x41a52c[_0xc624('0x7d')]};}):_0x530125[_0xc624('0x5a')]==_0xc624('0x75')?[{'name':_0xc624('0x7e'),'value':'true'},{'name':_0xc624('0x7f'),'value':'false'}]:[]};})};}})[_0xc624('0x1a')](respondWithResult(_0x146b8d,null))[_0xc624('0x25')](function(_0x38c4e8){var _0xe5da0=_0x4e1bae[_0xc624('0x3b')][_0xc624('0x80')]?0x1f4:_0x38c4e8[_0xc624('0x81')]||0x1f4;logger[_0xc624('0x21')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xe5da0,JSON[_0xc624('0x20')](_0x38c4e8));delete _0x38c4e8[_0xc624('0x34')];if(_0xe5da0===0x191){_0xe5da0=0x190;}_0x146b8d[_0xc624('0x27')](_0xe5da0)[_0xc624('0x35')](_0x4e1bae[_0xc624('0x3b')][_0xc624('0x80')]?{'message':_0xc624('0x82'),'statusCode':_0x38c4e8[_0xc624('0x81')]}:_0x38c4e8);});}; \ No newline at end of file +var _0x47f4=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','create','body','find','params','getConfigurations','findOne','SalesforceConfiguration','AccountId','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','clientId','username','password','securityToken','slice','Connection','clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','picklist','boolean','email','textarea','phone','includes','custom','picklistValues','label','value','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','SalesforceAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x38b322,_0x1edede){var _0x4dd98b=function(_0x3497f6){while(--_0x3497f6){_0x38b322['push'](_0x38b322['shift']());}};_0x4dd98b(++_0x1edede);}(_0x47f4,0xbc));var _0x447f=function(_0x121f5e,_0x5dfa07){_0x121f5e=_0x121f5e-0x0;var _0x47f849=_0x47f4[_0x121f5e];return _0x47f849;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x447f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x447f('0x1'));var moment=require(_0x447f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x447f('0x3'));var util=require(_0x447f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x447f('0x5'));var ejs=require(_0x447f('0x6'));var fs=require('fs');var fs_extra=require(_0x447f('0x7'));var _=require(_0x447f('0x8'));var squel=require('squel');var crypto=require(_0x447f('0x9'));var jsforce=require(_0x447f('0xa'));var deskjs=require(_0x447f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x447f('0xc'));var Papa=require(_0x447f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x447f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x447f('0xf'))(_0x447f('0x10'));var utils=require(_0x447f('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x447f('0x12'))['db'];var integrations=require(_0x447f('0x13'));var jayson=require('jayson/promise');var client=jayson['client'][_0x447f('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x487e92,_0x4d2a04,_0x198831,_0x2ffe5e){return new BPromise(function(_0x56e4f1,_0x3e5cc8){var _0x27dfa8=_0x2ffe5e||client;return _0x27dfa8[_0x447f('0x15')](_0x487e92,_0x198831)['then'](function(_0x1692ff){logger[_0x447f('0x16')](_0x447f('0x17'),_0x4d2a04,_0x447f('0x18'));logger[_0x447f('0x19')](_0x447f('0x1a'),_0x4d2a04,_0x447f('0x18'),JSON[_0x447f('0x1b')](_0x1692ff));if(_0x1692ff[_0x447f('0x1c')]){if(_0x1692ff['error'][_0x447f('0x1d')]===0x1f4){logger[_0x447f('0x1c')](_0x447f('0x17'),_0x4d2a04,_0x1692ff[_0x447f('0x1c')][_0x447f('0x1e')]);return _0x3e5cc8(_0x1692ff[_0x447f('0x1c')][_0x447f('0x1e')]);}logger[_0x447f('0x1c')](_0x447f('0x17'),_0x4d2a04,_0x1692ff[_0x447f('0x1c')][_0x447f('0x1e')]);return _0x56e4f1(_0x1692ff[_0x447f('0x1c')]['message']);}else{logger[_0x447f('0x16')](_0x447f('0x17'),_0x4d2a04,_0x447f('0x18'));_0x56e4f1(_0x1692ff[_0x447f('0x1f')][_0x447f('0x1e')]);}})[_0x447f('0x20')](function(_0x2b87af){logger[_0x447f('0x1c')](_0x447f('0x17'),_0x4d2a04,_0x2b87af);_0x3e5cc8(_0x2b87af);});});}function respondWithStatusCode(_0x4de503,_0x1cfa85){_0x1cfa85=_0x1cfa85||0xcc;return function(_0x27172f){if(_0x27172f){return _0x4de503[_0x447f('0x21')](_0x1cfa85);}return _0x4de503[_0x447f('0x22')](_0x1cfa85)[_0x447f('0x23')]();};}function respondWithResult(_0x218dda,_0xf815e7){_0xf815e7=_0xf815e7||0xc8;return function(_0x1474a8){if(_0x1474a8){return _0x218dda['status'](_0xf815e7)[_0x447f('0x24')](_0x1474a8);}};}function respondWithFilteredResult(_0x1da825,_0x5bb5d9){return function(_0x419edf){if(_0x419edf){var _0xa42926=typeof _0x5bb5d9[_0x447f('0x25')]==='undefined'&&typeof _0x5bb5d9[_0x447f('0x26')]==='undefined';var _0x128ead=_0x419edf['count'];var _0x36e79e=_0xa42926?0x0:_0x5bb5d9[_0x447f('0x25')];var _0x1a0217=_0xa42926?_0x419edf[_0x447f('0x27')]:_0x5bb5d9['offset']+_0x5bb5d9['limit'];var _0x4c220e;if(_0x1a0217>=_0x128ead){_0x1a0217=_0x128ead;_0x4c220e=0xc8;}else{_0x4c220e=0xce;}_0x1da825['status'](_0x4c220e);return _0x1da825['set'](_0x447f('0x28'),_0x36e79e+'-'+_0x1a0217+'/'+_0x128ead)[_0x447f('0x24')](_0x419edf);}return null;};}function patchUpdates(_0x153da2){return function(_0x5d5535){try{jsonpatch['apply'](_0x5d5535,_0x153da2,!![]);}catch(_0x189dd9){return BPromise[_0x447f('0x29')](_0x189dd9);}return _0x5d5535[_0x447f('0x2a')]();};}function saveUpdates(_0x30b71a,_0x2b05b4){return function(_0x1cf5e3){if(_0x1cf5e3){return _0x1cf5e3[_0x447f('0x2b')](_0x30b71a)[_0x447f('0x2c')](function(_0x48bac4){return _0x48bac4;});}return null;};}function removeEntity(_0x231682,_0x193c9e){return function(_0x318df9){if(_0x318df9){return _0x318df9[_0x447f('0x2d')]()[_0x447f('0x2c')](function(){_0x231682['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27742b,_0x49e42d){return function(_0x3ff7ca){if(!_0x3ff7ca){_0x27742b[_0x447f('0x21')](0x194);}return _0x3ff7ca;};}function handleError(_0x848bc4,_0x1a8d16){_0x1a8d16=_0x1a8d16||0x1f4;return function(_0x8d824){logger[_0x447f('0x1c')](_0x8d824[_0x447f('0x2e')]);if(_0x8d824[_0x447f('0x2f')]){delete _0x8d824['name'];}_0x848bc4[_0x447f('0x22')](_0x1a8d16)['send'](_0x8d824);};}exports['index']=function(_0x37c55a,_0x56a877){var _0x45dad1={},_0x5a9c39={},_0x4a1ea9={'count':0x0,'rows':[]};var _0x3bd9fd=_['map'](db[_0x447f('0x30')][_0x447f('0x31')],function(_0x4e5a95){return{'name':_0x4e5a95['fieldName'],'type':_0x4e5a95[_0x447f('0x32')][_0x447f('0x33')]};});_0x5a9c39[_0x447f('0x34')]=_[_0x447f('0x35')](_0x3bd9fd,_0x447f('0x2f'));_0x5a9c39[_0x447f('0x36')]=_[_0x447f('0x37')](_0x37c55a[_0x447f('0x36')]);_0x5a9c39[_0x447f('0x38')]=_[_0x447f('0x39')](_0x5a9c39[_0x447f('0x34')],_0x5a9c39['query']);_0x45dad1['attributes']=_[_0x447f('0x39')](_0x5a9c39['model'],qs[_0x447f('0x3a')](_0x37c55a['query']['fields']));_0x45dad1[_0x447f('0x3b')]=_0x45dad1[_0x447f('0x3b')]['length']?_0x45dad1[_0x447f('0x3b')]:_0x5a9c39['model'];if(!_0x37c55a[_0x447f('0x36')][_0x447f('0x3c')](_0x447f('0x3d'))){_0x45dad1[_0x447f('0x26')]=qs[_0x447f('0x26')](_0x37c55a['query'][_0x447f('0x26')]);_0x45dad1['offset']=qs[_0x447f('0x25')](_0x37c55a[_0x447f('0x36')][_0x447f('0x25')]);}_0x45dad1[_0x447f('0x3e')]=qs[_0x447f('0x3f')](_0x37c55a['query']['sort']);_0x45dad1['where']=qs[_0x447f('0x38')](_[_0x447f('0x40')](_0x37c55a[_0x447f('0x36')],_0x5a9c39[_0x447f('0x38')]),_0x3bd9fd);if(_0x37c55a[_0x447f('0x36')][_0x447f('0x41')]){_0x45dad1[_0x447f('0x42')]=_[_0x447f('0x43')](_0x45dad1[_0x447f('0x42')],{'$or':_[_0x447f('0x35')](_0x3bd9fd,function(_0x467831){if(_0x467831[_0x447f('0x32')]!==_0x447f('0x44')){var _0x26313a={};_0x26313a[_0x467831['name']]={'$like':'%'+_0x37c55a[_0x447f('0x36')][_0x447f('0x41')]+'%'};return _0x26313a;}})});}_0x45dad1=_[_0x447f('0x43')]({},_0x45dad1,_0x37c55a[_0x447f('0x45')]);var _0x26abba={'where':_0x45dad1[_0x447f('0x42')]};return db[_0x447f('0x30')][_0x447f('0x27')](_0x26abba)[_0x447f('0x2c')](function(_0x1c5939){_0x4a1ea9[_0x447f('0x27')]=_0x1c5939;if(_0x37c55a[_0x447f('0x36')][_0x447f('0x46')]){_0x45dad1[_0x447f('0x47')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x447f('0x48')](_0x45dad1);})[_0x447f('0x2c')](function(_0x5984eb){_0x4a1ea9[_0x447f('0x49')]=_0x5984eb;return _0x4a1ea9;})[_0x447f('0x2c')](respondWithFilteredResult(_0x56a877,_0x45dad1))[_0x447f('0x20')](handleError(_0x56a877,null));};exports[_0x447f('0x4a')]=function(_0x2f5095,_0x351293){var _0xad64fb={'raw':![],'where':{'id':_0x2f5095['params']['id']}},_0x508b64={};_0x508b64['model']=_['keys'](db[_0x447f('0x30')]['rawAttributes']);_0x508b64['query']=_[_0x447f('0x37')](_0x2f5095[_0x447f('0x36')]);_0x508b64[_0x447f('0x38')]=_['intersection'](_0x508b64['model'],_0x508b64[_0x447f('0x36')]);_0xad64fb['attributes']=_[_0x447f('0x39')](_0x508b64[_0x447f('0x34')],qs['fields'](_0x2f5095[_0x447f('0x36')][_0x447f('0x3a')]));_0xad64fb[_0x447f('0x3b')]=_0xad64fb[_0x447f('0x3b')][_0x447f('0x4b')]?_0xad64fb[_0x447f('0x3b')]:_0x508b64[_0x447f('0x34')];if(_0x2f5095[_0x447f('0x36')][_0x447f('0x46')]){_0xad64fb[_0x447f('0x47')]=[{'all':!![]}];}_0xad64fb=_[_0x447f('0x43')]({},_0xad64fb,_0x2f5095[_0x447f('0x45')]);return db[_0x447f('0x30')]['find'](_0xad64fb)['then'](handleEntityNotFound(_0x351293,null))[_0x447f('0x2c')](respondWithResult(_0x351293,null))[_0x447f('0x20')](handleError(_0x351293,null));};exports[_0x447f('0x4c')]=function(_0x11c01b,_0x1f1491){return db[_0x447f('0x30')]['create'](_0x11c01b[_0x447f('0x4d')],{})[_0x447f('0x2c')](respondWithResult(_0x1f1491,0xc9))[_0x447f('0x20')](handleError(_0x1f1491,null));};exports[_0x447f('0x2b')]=function(_0x502986,_0x57de7e){if(_0x502986[_0x447f('0x4d')]['id']){delete _0x502986[_0x447f('0x4d')]['id'];}return db[_0x447f('0x30')][_0x447f('0x4e')]({'where':{'id':_0x502986['params']['id']}})[_0x447f('0x2c')](handleEntityNotFound(_0x57de7e,null))[_0x447f('0x2c')](saveUpdates(_0x502986[_0x447f('0x4d')],null))[_0x447f('0x2c')](respondWithResult(_0x57de7e,null))['catch'](handleError(_0x57de7e,null));};exports[_0x447f('0x2d')]=function(_0x11925f,_0x24a2b4){return db[_0x447f('0x30')]['find']({'where':{'id':_0x11925f[_0x447f('0x4f')]['id']}})[_0x447f('0x2c')](handleEntityNotFound(_0x24a2b4,null))[_0x447f('0x2c')](removeEntity(_0x24a2b4,null))[_0x447f('0x20')](handleError(_0x24a2b4,null));};exports[_0x447f('0x50')]=function(_0x4c749b,_0x4c753e,_0x48a164){var _0x42b066={};var _0x2e3a51={};var _0x5e7dc0;var _0x51e4ab;return db['SalesforceAccount'][_0x447f('0x51')]({'where':{'id':_0x4c749b[_0x447f('0x4f')]['id']}})[_0x447f('0x2c')](handleEntityNotFound(_0x4c753e,null))[_0x447f('0x2c')](function(_0x53aa46){if(_0x53aa46){_0x5e7dc0=_0x53aa46;_0x2e3a51[_0x447f('0x34')]=_[_0x447f('0x37')](db[_0x447f('0x52')][_0x447f('0x31')]);_0x2e3a51[_0x447f('0x36')]=_[_0x447f('0x37')](_0x4c749b[_0x447f('0x36')]);_0x2e3a51['filters']=_[_0x447f('0x39')](_0x2e3a51[_0x447f('0x34')],_0x2e3a51[_0x447f('0x36')]);_0x42b066[_0x447f('0x3b')]=_[_0x447f('0x39')](_0x2e3a51[_0x447f('0x34')],qs[_0x447f('0x3a')](_0x4c749b[_0x447f('0x36')][_0x447f('0x3a')]));_0x42b066[_0x447f('0x3b')]=_0x42b066[_0x447f('0x3b')]['length']?_0x42b066[_0x447f('0x3b')]:_0x2e3a51[_0x447f('0x34')];_0x42b066[_0x447f('0x3e')]=qs[_0x447f('0x3f')](_0x4c749b[_0x447f('0x36')][_0x447f('0x3f')]);_0x42b066[_0x447f('0x42')]=qs[_0x447f('0x38')](_[_0x447f('0x40')](_0x4c749b['query'],_0x2e3a51[_0x447f('0x38')]));if(_0x4c749b[_0x447f('0x36')]['filter']){_0x42b066[_0x447f('0x42')]=_[_0x447f('0x43')](_0x42b066[_0x447f('0x42')],{'$or':_[_0x447f('0x35')](_0x42b066[_0x447f('0x3b')],function(_0x5506f3){var _0x1a32f3={};_0x1a32f3[_0x5506f3]={'$like':'%'+_0x4c749b[_0x447f('0x36')][_0x447f('0x41')]+'%'};return _0x1a32f3;})});}_0x42b066=_['merge']({},_0x42b066,_0x4c749b[_0x447f('0x45')]);return _0x5e7dc0[_0x447f('0x50')](_0x42b066);}})['then'](function(_0x3e4b50){if(_0x3e4b50){_0x51e4ab=_0x3e4b50[_0x447f('0x4b')];if(!_0x4c749b[_0x447f('0x36')]['hasOwnProperty'](_0x447f('0x3d'))){_0x42b066['limit']=qs[_0x447f('0x26')](_0x4c749b['query']['limit']);_0x42b066[_0x447f('0x25')]=qs[_0x447f('0x25')](_0x4c749b[_0x447f('0x36')]['offset']);}return _0x5e7dc0[_0x447f('0x50')](_0x42b066);}})[_0x447f('0x2c')](function(_0x4709a9){if(_0x4709a9){return _0x4709a9?{'count':_0x51e4ab,'rows':_0x4709a9}:null;}})['then'](respondWithResult(_0x4c753e,null))[_0x447f('0x20')](handleError(_0x4c753e,null));};exports['addConfiguration']=function(_0x41875c,_0x1391ea,_0x4dc61d){if(_0x41875c[_0x447f('0x4d')]['id']){delete _0x41875c[_0x447f('0x4d')]['id'];}return db[_0x447f('0x30')][_0x447f('0x51')]({'where':{'id':_0x41875c[_0x447f('0x4f')]['id']}})[_0x447f('0x2c')](handleEntityNotFound(_0x1391ea,null))[_0x447f('0x2c')](function(_0x495510){if(_0x495510){_0x41875c[_0x447f('0x4d')][_0x447f('0x53')]=_0x495510['id'];_0x41875c[_0x447f('0x4d')]['Subjects']=integrations['getSubjects'](_0x41875c[_0x447f('0x4d')][_0x447f('0x54')],_0x41875c['body'][_0x447f('0x32')]);_0x41875c[_0x447f('0x4d')][_0x447f('0x55')]=integrations[_0x447f('0x56')](_0x41875c[_0x447f('0x4d')][_0x447f('0x54')],_0x41875c[_0x447f('0x4d')][_0x447f('0x32')]);return db[_0x447f('0x52')][_0x447f('0x4c')](_0x41875c['body'],{'include':[{'model':db[_0x447f('0x57')],'as':_0x447f('0x58')},{'model':db[_0x447f('0x57')],'as':_0x447f('0x55')}]});}return null;})[_0x447f('0x2c')](respondWithResult(_0x1391ea,null))[_0x447f('0x20')](handleError(_0x1391ea,null));};exports[_0x447f('0x59')]=function(_0x3b7160,_0x117531,_0x18ac02){var _0x587ec6;var _0xde2ad6='';var _0x3954ba='Task';return db[_0x447f('0x30')][_0x447f('0x51')]({'where':{'id':_0x3b7160[_0x447f('0x4f')]['id']},'attributes':['id','remoteUri',_0x447f('0x5a'),'clientSecret',_0x447f('0x5b'),_0x447f('0x5c'),_0x447f('0x5d')]})[_0x447f('0x2c')](handleEntityNotFound(_0x117531,null))[_0x447f('0x2c')](function(_0x2d4f38){if(_0x2d4f38){_0xde2ad6=_0x2d4f38['remoteUri'];var _0xc13f51=_0xde2ad6[_0x447f('0x5e')](-0x1);if(_0xc13f51==='/'){_0xde2ad6=_0xde2ad6['substring'](0x0,_0xde2ad6['lastIndexOf'](_0xc13f51));}_0x587ec6=new jsforce[(_0x447f('0x5f'))]({'oauth2':{'loginUrl':_0xde2ad6,'clientId':_0x2d4f38['clientId'],'clientSecret':_0x2d4f38[_0x447f('0x60')]}});return _0x587ec6[_0x447f('0x61')](_0x2d4f38[_0x447f('0x5b')],_0x2d4f38[_0x447f('0x5c')][_0x447f('0x62')](_0x2d4f38[_0x447f('0x5d')]));}})[_0x447f('0x2c')](function(_0x18a204){if(_0x18a204){if(!_[_0x447f('0x63')](_0x3b7160['query'][_0x447f('0x64')])){_0x3954ba=_0x3b7160[_0x447f('0x36')][_0x447f('0x64')];}return _0x587ec6[_0x447f('0x65')](_0x3954ba)[_0x447f('0x66')]();}})['then'](function(_0x35ff9d){var _0x363a17=[_0x447f('0x67'),_0x447f('0x68'),_0x447f('0x69'),_0x447f('0x6a'),_0x447f('0x6b'),_0x447f('0x6c')];var _0x4a2bda=['string','int',_0x447f('0x6d'),_0x447f('0x6e'),_0x447f('0x6f'),_0x447f('0x70'),_0x447f('0x71')];if(_0x35ff9d){_['remove'](_0x35ff9d['fields'],function(_0x48bbb5){return _0x363a17[_0x447f('0x72')](_0x48bbb5[_0x447f('0x2f')])||!_0x4a2bda[_0x447f('0x72')](_0x48bbb5[_0x447f('0x32')]);});return{'count':_0x35ff9d[_0x447f('0x3a')][_0x447f('0x4b')],'rows':_[_0x447f('0x35')](_0x35ff9d['fields'],function(_0x353d61){return{'id':_0x353d61['name'],'name':_0x353d61['label'],'custom':_0x353d61[_0x447f('0x73')],'options':_0x353d61[_0x447f('0x74')][_0x447f('0x4b')]>0x0?_[_0x447f('0x35')](_0x353d61['picklistValues'],function(_0x20b869){return{'name':_0x20b869[_0x447f('0x75')],'value':_0x20b869[_0x447f('0x76')]};}):_0x353d61[_0x447f('0x32')]=='boolean'?[{'name':'True','value':_0x447f('0x77')},{'name':_0x447f('0x78'),'value':_0x447f('0x79')}]:[]};})};}})['then'](respondWithResult(_0x117531,null))[_0x447f('0x20')](function(_0x4ef794){var _0xcc26c=_0x3b7160[_0x447f('0x36')][_0x447f('0x7a')]?0x1f4:_0x4ef794[_0x447f('0x7b')]||0x1f4;logger[_0x447f('0x1c')](_0x447f('0x7c'),_0x447f('0x59'),_0xcc26c,JSON['stringify'](_0x4ef794));delete _0x4ef794[_0x447f('0x2f')];if(_0xcc26c===0x191){_0xcc26c=0x190;}_0x117531[_0x447f('0x22')](_0xcc26c)[_0x447f('0x7d')](_0x3b7160[_0x447f('0x36')][_0x447f('0x7a')]?{'message':_0x447f('0x7e'),'statusCode':_0x4ef794[_0x447f('0x7b')]}:_0x4ef794);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 52fb71d..c3d0e1b 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 _0x98e4=['rimraf','../../config/environment','../../components/integrations/configuration','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x34b7a0,_0x5620fb){var _0x5df4ff=function(_0x4ca55b){while(--_0x4ca55b){_0x34b7a0['push'](_0x34b7a0['shift']());}};_0x5df4ff(++_0x5620fb);}(_0x98e4,0x160));var _0x498e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x98e4[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x498e('0x0'));var util=require(_0x498e('0x1'));var logger=require(_0x498e('0x2'))(_0x498e('0x3'));var moment=require(_0x498e('0x4'));var BPromise=require(_0x498e('0x5'));var rp=require(_0x498e('0x6'));var fs=require('fs');var path=require(_0x498e('0x7'));var rimraf=require(_0x498e('0x8'));var config=require(_0x498e('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x498e('0xa'));module['exports']=function(_0x69b73a,_0x3f9808){return _0x69b73a['define']('SalesforceAccount',attributes,{'tableName':_0x498e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcddd=['int_salesforce_accounts','lodash','api','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0xff1bd2,_0x285598){var _0x32629f=function(_0xd910b6){while(--_0xd910b6){_0xff1bd2['push'](_0xff1bd2['shift']());}};_0x32629f(++_0x285598);}(_0xcddd,0x97));var _0xdcdd=function(_0x54fdac,_0x1ed961){_0x54fdac=_0x54fdac-0x0;var _0x289def=_0xcddd[_0x54fdac];return _0x289def;};'use strict';var _=require(_0xdcdd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdcdd('0x1'));var moment=require('moment');var BPromise=require(_0xdcdd('0x2'));var rp=require(_0xdcdd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdcdd('0x4'));var integrations=require(_0xdcdd('0x5'));module[_0xdcdd('0x6')]=function(_0x18e77f,_0x1043eb){return _0x18e77f[_0xdcdd('0x7')](_0xdcdd('0x8'),attributes,{'tableName':_0xdcdd('0x9'),'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 2f6f171..9ef87ee 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 _0x66c7=['info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','attributes','map','model','then','find','raw','ShowSalesforceAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2584b8,_0x5e096c){var _0x28a489=function(_0x438912){while(--_0x438912){_0x2584b8['push'](_0x2584b8['shift']());}};_0x28a489(++_0x5e096c);}(_0x66c7,0x15c));var _0x766c=function(_0x412860,_0x23dfcc){_0x412860=_0x412860-0x0;var _0x59a702=_0x66c7[_0x412860];return _0x59a702;};'use strict';var _=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var moment=require(_0x766c('0x2'));var BPromise=require('bluebird');var rs=require(_0x766c('0x3'));var fs=require('fs');var Redis=require(_0x766c('0x4'));var db=require(_0x766c('0x5'))['db'];var utils=require(_0x766c('0x6'));var logger=require(_0x766c('0x7'))(_0x766c('0x8'));var config=require('../../config/environment');var jayson=require(_0x766c('0x9'));var client=jayson[_0x766c('0xa')][_0x766c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb0b5f7,_0x46d290,_0x3c4683){return new BPromise(function(_0x22a524,_0x4488b8){return client['request'](_0xb0b5f7,_0x3c4683)['then'](function(_0x141744){logger[_0x766c('0xc')](_0x766c('0xd'),_0x46d290,'request\x20sent');logger[_0x766c('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x46d290,_0x766c('0xf'),JSON[_0x766c('0x10')](_0x141744));if(_0x141744[_0x766c('0x11')]){if(_0x141744[_0x766c('0x11')][_0x766c('0x12')]===0x1f4){logger[_0x766c('0x11')](_0x766c('0xd'),_0x46d290,_0x141744[_0x766c('0x11')][_0x766c('0x13')]);return _0x4488b8(_0x141744[_0x766c('0x11')][_0x766c('0x13')]);}logger[_0x766c('0x11')](_0x766c('0xd'),_0x46d290,_0x141744[_0x766c('0x11')][_0x766c('0x13')]);return _0x22a524(_0x141744['error']['message']);}else{logger['info'](_0x766c('0xd'),_0x46d290,_0x766c('0xf'));_0x22a524(_0x141744[_0x766c('0x14')][_0x766c('0x13')]);}})[_0x766c('0x15')](function(_0x357602){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x46d290,_0x357602);_0x4488b8(_0x357602);});});}exports[_0x766c('0x16')]=function(_0x23c566){var _0x105f60=this;return new Promise(function(_0x47c887,_0x2cd2e7){return db[_0x766c('0x17')][_0x766c('0x18')]({'raw':_0x23c566['options']?_0x23c566['options']['raw']===undefined?!![]:![]:!![],'where':_0x23c566[_0x766c('0x19')]?_0x23c566['options'][_0x766c('0x1a')]||null:null,'attributes':_0x23c566[_0x766c('0x19')]?_0x23c566['options']['attributes']||null:null,'limit':_0x23c566[_0x766c('0x19')]?_0x23c566[_0x766c('0x19')][_0x766c('0x1b')]||null:null,'include':_0x23c566['options']?_0x23c566[_0x766c('0x19')][_0x766c('0x1c')]?_['map'](_0x23c566['options']['include'],function(_0x43d91f){return{'model':db[_0x43d91f['model']],'as':_0x43d91f['as'],'attributes':_0x43d91f[_0x766c('0x1d')],'include':_0x43d91f[_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x43d91f['include'],function(_0x44659e){return{'model':db[_0x44659e[_0x766c('0x1f')]],'as':_0x44659e['as'],'attributes':_0x44659e[_0x766c('0x1d')],'include':_0x44659e[_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x44659e[_0x766c('0x1c')],function(_0x5ad1d6){return{'model':db[_0x5ad1d6[_0x766c('0x1f')]],'as':_0x5ad1d6['as'],'attributes':_0x5ad1d6[_0x766c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x766c('0x20')](function(_0x3a6757){logger[_0x766c('0xc')]('GetSalesforceAccount',_0x23c566);logger['debug'](_0x766c('0x16'),_0x23c566,JSON[_0x766c('0x10')](_0x3a6757));_0x47c887(_0x3a6757);})[_0x766c('0x15')](function(_0x549dde){logger[_0x766c('0x11')](_0x766c('0x16'),_0x549dde['message'],_0x23c566);_0x2cd2e7(_0x105f60[_0x766c('0x11')](0x1f4,_0x549dde['message']));});});};exports['ShowSalesforceAccount']=function(_0x3a4561){var _0x10421d=this;return new Promise(function(_0x1eac49,_0x5b94cf){return db[_0x766c('0x17')][_0x766c('0x21')]({'raw':_0x3a4561[_0x766c('0x19')]?_0x3a4561[_0x766c('0x19')][_0x766c('0x22')]===undefined?!![]:![]:!![],'where':_0x3a4561['options']?_0x3a4561['options'][_0x766c('0x1a')]||null:null,'attributes':_0x3a4561[_0x766c('0x19')]?_0x3a4561[_0x766c('0x19')][_0x766c('0x1d')]||null:null,'include':_0x3a4561[_0x766c('0x19')]?_0x3a4561['options'][_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x3a4561[_0x766c('0x19')]['include'],function(_0x17f5c6){return{'model':db[_0x17f5c6['model']],'as':_0x17f5c6['as'],'attributes':_0x17f5c6['attributes'],'include':_0x17f5c6[_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x17f5c6[_0x766c('0x1c')],function(_0x182a81){return{'model':db[_0x182a81[_0x766c('0x1f')]],'as':_0x182a81['as'],'attributes':_0x182a81[_0x766c('0x1d')],'include':_0x182a81['include']?_['map'](_0x182a81[_0x766c('0x1c')],function(_0xad7de3){return{'model':db[_0xad7de3[_0x766c('0x1f')]],'as':_0xad7de3['as'],'attributes':_0xad7de3[_0x766c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x766c('0x20')](function(_0x20a900){logger[_0x766c('0xc')](_0x766c('0x23'),_0x3a4561);logger[_0x766c('0xe')](_0x766c('0x23'),_0x3a4561,JSON[_0x766c('0x10')](_0x20a900));_0x1eac49(_0x20a900);})[_0x766c('0x15')](function(_0x18b9b0){logger['error'](_0x766c('0x23'),_0x18b9b0['message'],_0x3a4561);_0x5b94cf(_0x10421d[_0x766c('0x11')](0x1f4,_0x18b9b0['message']));});});}; \ No newline at end of file +var _0x704f=['ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','include','map','model'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x704f,0x93));var _0xf704=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x704f[_0x39772f];return _0xc9edbf;};'use strict';var _=require(_0xf704('0x0'));var util=require(_0xf704('0x1'));var moment=require(_0xf704('0x2'));var BPromise=require(_0xf704('0x3'));var rs=require(_0xf704('0x4'));var fs=require('fs');var Redis=require(_0xf704('0x5'));var db=require(_0xf704('0x6'))['db'];var utils=require(_0xf704('0x7'));var logger=require(_0xf704('0x8'))('rpc');var config=require(_0xf704('0x9'));var jayson=require(_0xf704('0xa'));var client=jayson[_0xf704('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29a773,_0x38db55,_0x400c07){return new BPromise(function(_0x22f06a,_0x614501){return client[_0xf704('0xc')](_0x29a773,_0x400c07)[_0xf704('0xd')](function(_0x1e4edd){logger[_0xf704('0xe')](_0xf704('0xf'),_0x38db55,_0xf704('0x10'));logger[_0xf704('0x11')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x38db55,_0xf704('0x10'),JSON[_0xf704('0x12')](_0x1e4edd));if(_0x1e4edd[_0xf704('0x13')]){if(_0x1e4edd[_0xf704('0x13')][_0xf704('0x14')]===0x1f4){logger[_0xf704('0x13')](_0xf704('0xf'),_0x38db55,_0x1e4edd[_0xf704('0x13')]['message']);return _0x614501(_0x1e4edd[_0xf704('0x13')][_0xf704('0x15')]);}logger[_0xf704('0x13')](_0xf704('0xf'),_0x38db55,_0x1e4edd[_0xf704('0x13')][_0xf704('0x15')]);return _0x22f06a(_0x1e4edd[_0xf704('0x13')][_0xf704('0x15')]);}else{logger['info'](_0xf704('0xf'),_0x38db55,_0xf704('0x10'));_0x22f06a(_0x1e4edd[_0xf704('0x16')][_0xf704('0x15')]);}})[_0xf704('0x17')](function(_0x47ebb8){logger['error'](_0xf704('0xf'),_0x38db55,_0x47ebb8);_0x614501(_0x47ebb8);});});}exports[_0xf704('0x18')]=function(_0x4d687f){var _0x1861e4=this;return new Promise(function(_0x448d5b,_0x795efc){return db[_0xf704('0x19')][_0xf704('0x1a')]({'raw':_0x4d687f[_0xf704('0x1b')]?_0x4d687f[_0xf704('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4d687f[_0xf704('0x1b')]?_0x4d687f[_0xf704('0x1b')]['where']||null:null,'attributes':_0x4d687f['options']?_0x4d687f[_0xf704('0x1b')][_0xf704('0x1c')]||null:null,'limit':_0x4d687f[_0xf704('0x1b')]?_0x4d687f[_0xf704('0x1b')][_0xf704('0x1d')]||null:null,'include':_0x4d687f[_0xf704('0x1b')]?_0x4d687f[_0xf704('0x1b')][_0xf704('0x1e')]?_[_0xf704('0x1f')](_0x4d687f['options']['include'],function(_0x23351f){return{'model':db[_0x23351f[_0xf704('0x20')]],'as':_0x23351f['as'],'attributes':_0x23351f['attributes'],'include':_0x23351f[_0xf704('0x1e')]?_[_0xf704('0x1f')](_0x23351f[_0xf704('0x1e')],function(_0x546f3c){return{'model':db[_0x546f3c[_0xf704('0x20')]],'as':_0x546f3c['as'],'attributes':_0x546f3c[_0xf704('0x1c')],'include':_0x546f3c[_0xf704('0x1e')]?_[_0xf704('0x1f')](_0x546f3c[_0xf704('0x1e')],function(_0x2feb9f){return{'model':db[_0x2feb9f['model']],'as':_0x2feb9f['as'],'attributes':_0x2feb9f[_0xf704('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf704('0xd')](function(_0x1f6e31){logger[_0xf704('0xe')](_0xf704('0x18'),_0x4d687f);logger[_0xf704('0x11')]('GetSalesforceAccount',_0x4d687f,JSON[_0xf704('0x12')](_0x1f6e31));_0x448d5b(_0x1f6e31);})[_0xf704('0x17')](function(_0x1bd041){logger['error']('GetSalesforceAccount',_0x1bd041['message'],_0x4d687f);_0x795efc(_0x1861e4[_0xf704('0x13')](0x1f4,_0x1bd041[_0xf704('0x15')]));});});};exports[_0xf704('0x21')]=function(_0x454401){var _0x35efd3=this;return new Promise(function(_0x36ffba,_0x3cf334){return db[_0xf704('0x19')][_0xf704('0x22')]({'raw':_0x454401[_0xf704('0x1b')]?_0x454401['options'][_0xf704('0x23')]===undefined?!![]:![]:!![],'where':_0x454401[_0xf704('0x1b')]?_0x454401[_0xf704('0x1b')]['where']||null:null,'attributes':_0x454401[_0xf704('0x1b')]?_0x454401['options']['attributes']||null:null,'include':_0x454401['options']?_0x454401[_0xf704('0x1b')][_0xf704('0x1e')]?_[_0xf704('0x1f')](_0x454401[_0xf704('0x1b')][_0xf704('0x1e')],function(_0x42e150){return{'model':db[_0x42e150[_0xf704('0x20')]],'as':_0x42e150['as'],'attributes':_0x42e150[_0xf704('0x1c')],'include':_0x42e150[_0xf704('0x1e')]?_[_0xf704('0x1f')](_0x42e150['include'],function(_0x1250d7){return{'model':db[_0x1250d7[_0xf704('0x20')]],'as':_0x1250d7['as'],'attributes':_0x1250d7[_0xf704('0x1c')],'include':_0x1250d7['include']?_[_0xf704('0x1f')](_0x1250d7['include'],function(_0xae9b99){return{'model':db[_0xae9b99[_0xf704('0x20')]],'as':_0xae9b99['as'],'attributes':_0xae9b99[_0xf704('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf704('0xd')](function(_0x5a2c34){logger[_0xf704('0xe')](_0xf704('0x21'),_0x454401);logger['debug'](_0xf704('0x21'),_0x454401,JSON['stringify'](_0x5a2c34));_0x36ffba(_0x5a2c34);})[_0xf704('0x17')](function(_0x2c1ca1){logger[_0xf704('0x13')](_0xf704('0x21'),_0x2c1ca1[_0xf704('0x15')],_0x454401);_0x3cf334(_0x35efd3[_0xf704('0x13')](0x1f4,_0x2c1ca1[_0xf704('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 5d4ea03..92db2da 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x430852,_0x318a72){var _0x23e3e8=function(_0x34dd61){while(--_0x34dd61){_0x430852['push'](_0x430852['shift']());}};_0x23e3e8(++_0x318a72);}(_0x2ef3,0xba));var _0x32ef=function(_0x220b2c,_0x26c763){_0x220b2c=_0x220b2c-0x0;var _0x5af126=_0x2ef3[_0x220b2c];return _0x5af126;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0xb71cd3,_0x2b5d2e){var _0x5f470f=function(_0x2f3c94){while(--_0x2f3c94){_0xb71cd3['push'](_0xb71cd3['shift']());}};_0x5f470f(++_0x2b5d2e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 1da19c2..d4ac722 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 _0x96bc=['account','sequelize','STRING','ENUM','Case','contact_lead','contact','lead'];(function(_0x2293a1,_0x28b408){var _0x96ae80=function(_0x3be9d){while(--_0x3be9d){_0x2293a1['push'](_0x2293a1['shift']());}};_0x96ae80(++_0x28b408);}(_0x96bc,0x91));var _0xc96b=function(_0x38e95c,_0x48160f){_0x38e95c=_0x38e95c-0x0;var _0x144381=_0x96bc[_0x38e95c];return _0x144381;};'use strict';var Sequelize=require(_0xc96b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc96b('0x1')]},'ticketType':{'type':Sequelize[_0xc96b('0x2')]('Task',_0xc96b('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xc96b('0x2')](_0xc96b('0x4'),_0xc96b('0x5'),_0xc96b('0x6'),'account_contact_lead',_0xc96b('0x7')),'defaultValue':_0xc96b('0x4')},'moduleCreate':{'type':Sequelize[_0xc96b('0x2')]('nothing',_0xc96b('0x5'),_0xc96b('0x6'),_0xc96b('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xc96b('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xc96b('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xc96b('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xc96b('0x1')]}}; \ No newline at end of file +var _0x3621=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3621,0x1ef));var _0x1362=function(_0xf00724,_0x5018b2){_0xf00724=_0xf00724-0x0;var _0x1adcbb=_0x3621[_0xf00724];return _0x1adcbb;};'use strict';var Sequelize=require('sequelize');module[_0x1362('0x0')]={'name':{'type':Sequelize[_0x1362('0x1')]},'description':{'type':Sequelize[_0x1362('0x1')]},'ticketType':{'type':Sequelize[_0x1362('0x2')](_0x1362('0x3'),_0x1362('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x1362('0x5'),_0x1362('0x6'),_0x1362('0x7'),_0x1362('0x8'),_0x1362('0x9')),'defaultValue':_0x1362('0x5')},'moduleCreate':{'type':Sequelize[_0x1362('0x2')](_0x1362('0xa'),_0x1362('0x6'),_0x1362('0x7'),_0x1362('0x9')),'defaultValue':_0x1362('0x7')},'leadId':{'type':Sequelize[_0x1362('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x1362('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x1362('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x1362('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 16f461d..8617bca 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 _0x0763=['stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','where','merge','filter','options','count','includeAll','include','findAll','show','params','length','create','body','find','getFields','SalesforceField','nolimit','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','limit','set','apply','reject','update','destroy','end','sendStatus'];(function(_0x14278e,_0x326950){var _0x5b3191=function(_0x143000){while(--_0x143000){_0x14278e['push'](_0x14278e['shift']());}};_0x5b3191(++_0x326950);}(_0x0763,0x87));var _0x3076=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0x0763[_0x35d775];return _0x59384d;};'use strict';var emlformat=require(_0x3076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3076('0x1'));var jsonpatch=require(_0x3076('0x2'));var rp=require('request-promise');var moment=require(_0x3076('0x3'));var BPromise=require(_0x3076('0x4'));var Mustache=require(_0x3076('0x5'));var util=require(_0x3076('0x6'));var path=require('path');var sox=require(_0x3076('0x7'));var csv=require(_0x3076('0x8'));var ejs=require(_0x3076('0x9'));var fs=require('fs');var fs_extra=require(_0x3076('0xa'));var _=require(_0x3076('0xb'));var squel=require(_0x3076('0xc'));var crypto=require(_0x3076('0xd'));var jsforce=require(_0x3076('0xe'));var deskjs=require(_0x3076('0xf'));var toCsv=require(_0x3076('0x8'));var querystring=require('querystring');var Papa=require(_0x3076('0x10'));var Redis=require(_0x3076('0x11'));var authService=require(_0x3076('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3076('0x13'));var logger=require(_0x3076('0x14'))(_0x3076('0x15'));var utils=require(_0x3076('0x16'));var config=require(_0x3076('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3076('0x18'))['db'];var jayson=require(_0x3076('0x19'));var client=jayson[_0x3076('0x1a')][_0x3076('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3dfb6f,_0xb7c119,_0x43f24d,_0x3a6f74){return new BPromise(function(_0x54ff6a,_0x5542c7){var _0x2a296b=_0x3a6f74||client;return _0x2a296b[_0x3076('0x1c')](_0x3dfb6f,_0x43f24d)[_0x3076('0x1d')](function(_0x1b2256){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0xb7c119,_0x3076('0x1e'));logger[_0x3076('0x1f')](_0x3076('0x20'),_0xb7c119,_0x3076('0x1e'),JSON[_0x3076('0x21')](_0x1b2256));if(_0x1b2256[_0x3076('0x22')]){if(_0x1b2256[_0x3076('0x22')][_0x3076('0x23')]===0x1f4){logger[_0x3076('0x22')](_0x3076('0x24'),_0xb7c119,_0x1b2256[_0x3076('0x22')][_0x3076('0x25')]);return _0x5542c7(_0x1b2256['error'][_0x3076('0x25')]);}logger[_0x3076('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0xb7c119,_0x1b2256[_0x3076('0x22')]['message']);return _0x54ff6a(_0x1b2256[_0x3076('0x22')][_0x3076('0x25')]);}else{logger[_0x3076('0x26')]('SalesforceConfiguration,\x20%s,\x20%s',_0xb7c119,_0x3076('0x1e'));_0x54ff6a(_0x1b2256[_0x3076('0x27')][_0x3076('0x25')]);}})[_0x3076('0x28')](function(_0x58f284){logger[_0x3076('0x22')](_0x3076('0x24'),_0xb7c119,_0x58f284);_0x5542c7(_0x58f284);});});}function respondWithStatusCode(_0xa975bc,_0x195606){_0x195606=_0x195606||0xcc;return function(_0x39a33c){if(_0x39a33c){return _0xa975bc['sendStatus'](_0x195606);}return _0xa975bc[_0x3076('0x29')](_0x195606)['end']();};}function respondWithResult(_0x116de4,_0x4f4bdc){_0x4f4bdc=_0x4f4bdc||0xc8;return function(_0x53b45d){if(_0x53b45d){return _0x116de4[_0x3076('0x29')](_0x4f4bdc)[_0x3076('0x2a')](_0x53b45d);}};}function respondWithFilteredResult(_0x2f0848,_0x1b169b){return function(_0x28d834){if(_0x28d834){var _0x258427=typeof _0x1b169b[_0x3076('0x2b')]===_0x3076('0x2c')&&typeof _0x1b169b[_0x3076('0x2d')]===_0x3076('0x2c');var _0x11ac48=_0x28d834['count'];var _0x181591=_0x258427?0x0:_0x1b169b[_0x3076('0x2b')];var _0x32bdbd=_0x258427?_0x28d834['count']:_0x1b169b[_0x3076('0x2b')]+_0x1b169b[_0x3076('0x2d')];var _0x587585;if(_0x32bdbd>=_0x11ac48){_0x32bdbd=_0x11ac48;_0x587585=0xc8;}else{_0x587585=0xce;}_0x2f0848[_0x3076('0x29')](_0x587585);return _0x2f0848[_0x3076('0x2e')]('Content-Range',_0x181591+'-'+_0x32bdbd+'/'+_0x11ac48)[_0x3076('0x2a')](_0x28d834);}return null;};}function patchUpdates(_0x5337bc){return function(_0x4d6f8f){try{jsonpatch[_0x3076('0x2f')](_0x4d6f8f,_0x5337bc,!![]);}catch(_0x3aa320){return BPromise[_0x3076('0x30')](_0x3aa320);}return _0x4d6f8f['save']();};}function saveUpdates(_0x269302,_0x3c1e76){return function(_0x344b84){if(_0x344b84){return _0x344b84[_0x3076('0x31')](_0x269302)['then'](function(_0x44fd84){return _0x44fd84;});}return null;};}function removeEntity(_0x298127,_0x326c5f){return function(_0x1958c4){if(_0x1958c4){return _0x1958c4[_0x3076('0x32')]()['then'](function(){_0x298127[_0x3076('0x29')](0xcc)[_0x3076('0x33')]();});}};}function handleEntityNotFound(_0x17be06,_0x468564){return function(_0x2f53c6){if(!_0x2f53c6){_0x17be06[_0x3076('0x34')](0x194);}return _0x2f53c6;};}function handleError(_0x545614,_0x171d0a){_0x171d0a=_0x171d0a||0x1f4;return function(_0x538502){logger[_0x3076('0x22')](_0x538502[_0x3076('0x35')]);if(_0x538502[_0x3076('0x36')]){delete _0x538502[_0x3076('0x36')];}_0x545614[_0x3076('0x29')](_0x171d0a)[_0x3076('0x37')](_0x538502);};}exports[_0x3076('0x38')]=function(_0x45e543,_0x27dbee){var _0x2c912c={},_0x2ea216={},_0xda5264={'count':0x0,'rows':[]};var _0x130944=_[_0x3076('0x39')](db[_0x3076('0x3a')][_0x3076('0x3b')],function(_0xf7dc05){return{'name':_0xf7dc05[_0x3076('0x3c')],'type':_0xf7dc05[_0x3076('0x3d')][_0x3076('0x3e')]};});_0x2ea216[_0x3076('0x3f')]=_[_0x3076('0x39')](_0x130944,_0x3076('0x36'));_0x2ea216[_0x3076('0x40')]=_[_0x3076('0x41')](_0x45e543[_0x3076('0x40')]);_0x2ea216[_0x3076('0x42')]=_['intersection'](_0x2ea216[_0x3076('0x3f')],_0x2ea216[_0x3076('0x40')]);_0x2c912c[_0x3076('0x43')]=_[_0x3076('0x44')](_0x2ea216['model'],qs[_0x3076('0x45')](_0x45e543[_0x3076('0x40')][_0x3076('0x45')]));_0x2c912c[_0x3076('0x43')]=_0x2c912c[_0x3076('0x43')]['length']?_0x2c912c[_0x3076('0x43')]:_0x2ea216[_0x3076('0x3f')];if(!_0x45e543[_0x3076('0x40')][_0x3076('0x46')]('nolimit')){_0x2c912c[_0x3076('0x2d')]=qs[_0x3076('0x2d')](_0x45e543[_0x3076('0x40')][_0x3076('0x2d')]);_0x2c912c[_0x3076('0x2b')]=qs[_0x3076('0x2b')](_0x45e543[_0x3076('0x40')][_0x3076('0x2b')]);}_0x2c912c[_0x3076('0x47')]=qs['sort'](_0x45e543[_0x3076('0x40')][_0x3076('0x48')]);_0x2c912c['where']=qs['filters'](_[_0x3076('0x49')](_0x45e543[_0x3076('0x40')],_0x2ea216[_0x3076('0x42')]),_0x130944);if(_0x45e543[_0x3076('0x40')]['filter']){_0x2c912c[_0x3076('0x4a')]=_[_0x3076('0x4b')](_0x2c912c[_0x3076('0x4a')],{'$or':_['map'](_0x130944,function(_0x146d3b){if(_0x146d3b[_0x3076('0x3d')]!=='VIRTUAL'){var _0x47d67b={};_0x47d67b[_0x146d3b['name']]={'$like':'%'+_0x45e543['query'][_0x3076('0x4c')]+'%'};return _0x47d67b;}})});}_0x2c912c=_['merge']({},_0x2c912c,_0x45e543[_0x3076('0x4d')]);var _0x5f09bd={'where':_0x2c912c['where']};return db[_0x3076('0x3a')][_0x3076('0x4e')](_0x5f09bd)[_0x3076('0x1d')](function(_0x7405d6){_0xda5264[_0x3076('0x4e')]=_0x7405d6;if(_0x45e543[_0x3076('0x40')][_0x3076('0x4f')]){_0x2c912c[_0x3076('0x50')]=[{'all':!![]}];}return db[_0x3076('0x3a')][_0x3076('0x51')](_0x2c912c);})[_0x3076('0x1d')](function(_0x46fdf0){_0xda5264['rows']=_0x46fdf0;return _0xda5264;})[_0x3076('0x1d')](respondWithFilteredResult(_0x27dbee,_0x2c912c))['catch'](handleError(_0x27dbee,null));};exports[_0x3076('0x52')]=function(_0x4043ef,_0x4bd856){var _0x5a7b95={'raw':![],'where':{'id':_0x4043ef[_0x3076('0x53')]['id']}},_0x431a9e={};_0x431a9e[_0x3076('0x3f')]=_[_0x3076('0x41')](db['SalesforceConfiguration'][_0x3076('0x3b')]);_0x431a9e[_0x3076('0x40')]=_['keys'](_0x4043ef[_0x3076('0x40')]);_0x431a9e['filters']=_['intersection'](_0x431a9e[_0x3076('0x3f')],_0x431a9e[_0x3076('0x40')]);_0x5a7b95[_0x3076('0x43')]=_[_0x3076('0x44')](_0x431a9e[_0x3076('0x3f')],qs[_0x3076('0x45')](_0x4043ef[_0x3076('0x40')]['fields']));_0x5a7b95[_0x3076('0x43')]=_0x5a7b95['attributes'][_0x3076('0x54')]?_0x5a7b95[_0x3076('0x43')]:_0x431a9e['model'];if(_0x4043ef['query']['includeAll']){_0x5a7b95[_0x3076('0x50')]=[{'all':!![]}];}_0x5a7b95=_[_0x3076('0x4b')]({},_0x5a7b95,_0x4043ef[_0x3076('0x4d')]);return db['SalesforceConfiguration']['find'](_0x5a7b95)['then'](handleEntityNotFound(_0x4bd856,null))[_0x3076('0x1d')](respondWithResult(_0x4bd856,null))[_0x3076('0x28')](handleError(_0x4bd856,null));};exports[_0x3076('0x55')]=function(_0x4d3983,_0xca559d){return db['SalesforceConfiguration'][_0x3076('0x55')](_0x4d3983[_0x3076('0x56')],{})[_0x3076('0x1d')](respondWithResult(_0xca559d,0xc9))[_0x3076('0x28')](handleError(_0xca559d,null));};exports[_0x3076('0x31')]=function(_0x12acfe,_0x5a19a8){if(_0x12acfe[_0x3076('0x56')]['id']){delete _0x12acfe[_0x3076('0x56')]['id'];}return db[_0x3076('0x3a')][_0x3076('0x57')]({'where':{'id':_0x12acfe[_0x3076('0x53')]['id']}})['then'](handleEntityNotFound(_0x5a19a8,null))[_0x3076('0x1d')](saveUpdates(_0x12acfe[_0x3076('0x56')],null))['then'](respondWithResult(_0x5a19a8,null))[_0x3076('0x28')](handleError(_0x5a19a8,null));};exports['destroy']=function(_0x336be0,_0x37098d){return db[_0x3076('0x3a')][_0x3076('0x57')]({'where':{'id':_0x336be0[_0x3076('0x53')]['id']}})[_0x3076('0x1d')](handleEntityNotFound(_0x37098d,null))[_0x3076('0x1d')](removeEntity(_0x37098d,null))[_0x3076('0x28')](handleError(_0x37098d,null));};exports[_0x3076('0x58')]=function(_0x4f70f9,_0x4edccb,_0x15aa1f){var _0x5b83ca={};var _0xcc85e={};var _0x3edeca;var _0x2ef926;return db[_0x3076('0x3a')]['findOne']({'where':{'id':_0x4f70f9['params']['id']}})['then'](handleEntityNotFound(_0x4edccb,null))[_0x3076('0x1d')](function(_0x905476){if(_0x905476){_0x3edeca=_0x905476;_0xcc85e[_0x3076('0x3f')]=_[_0x3076('0x41')](db[_0x3076('0x59')][_0x3076('0x3b')]);_0xcc85e[_0x3076('0x40')]=_[_0x3076('0x41')](_0x4f70f9[_0x3076('0x40')]);_0xcc85e[_0x3076('0x42')]=_['intersection'](_0xcc85e[_0x3076('0x3f')],_0xcc85e['query']);_0x5b83ca[_0x3076('0x43')]=_[_0x3076('0x44')](_0xcc85e[_0x3076('0x3f')],qs[_0x3076('0x45')](_0x4f70f9['query'][_0x3076('0x45')]));_0x5b83ca['attributes']=_0x5b83ca[_0x3076('0x43')][_0x3076('0x54')]?_0x5b83ca[_0x3076('0x43')]:_0xcc85e['model'];_0x5b83ca[_0x3076('0x47')]=qs[_0x3076('0x48')](_0x4f70f9['query'][_0x3076('0x48')]);_0x5b83ca['where']=qs[_0x3076('0x42')](_['pick'](_0x4f70f9[_0x3076('0x40')],_0xcc85e[_0x3076('0x42')]));if(_0x4f70f9[_0x3076('0x40')]['filter']){_0x5b83ca[_0x3076('0x4a')]=_['merge'](_0x5b83ca[_0x3076('0x4a')],{'$or':_[_0x3076('0x39')](_0x5b83ca[_0x3076('0x43')],function(_0x436d8b){var _0x12ede1={};_0x12ede1[_0x436d8b]={'$like':'%'+_0x4f70f9['query']['filter']+'%'};return _0x12ede1;})});}_0x5b83ca=_[_0x3076('0x4b')]({},_0x5b83ca,_0x4f70f9['options']);return _0x3edeca[_0x3076('0x58')](_0x5b83ca);}})[_0x3076('0x1d')](function(_0x510534){if(_0x510534){_0x2ef926=_0x510534[_0x3076('0x54')];if(!_0x4f70f9['query'][_0x3076('0x46')](_0x3076('0x5a'))){_0x5b83ca['limit']=qs[_0x3076('0x2d')](_0x4f70f9[_0x3076('0x40')][_0x3076('0x2d')]);_0x5b83ca[_0x3076('0x2b')]=qs[_0x3076('0x2b')](_0x4f70f9[_0x3076('0x40')][_0x3076('0x2b')]);}return _0x3edeca[_0x3076('0x58')](_0x5b83ca);}})[_0x3076('0x1d')](function(_0x45b55a){if(_0x45b55a){return _0x45b55a?{'count':_0x2ef926,'rows':_0x45b55a}:null;}})[_0x3076('0x1d')](respondWithResult(_0x4edccb,null))[_0x3076('0x28')](handleError(_0x4edccb,null));};exports['getSubjects']=function(_0x3ca81a,_0x2c482d,_0x39bf51){var _0xa57207={};var _0x5bc813={};var _0x55b00e;var _0xc24f26;return db[_0x3076('0x3a')][_0x3076('0x5b')]({'where':{'id':_0x3ca81a['params']['id']}})[_0x3076('0x1d')](handleEntityNotFound(_0x2c482d,null))[_0x3076('0x1d')](function(_0x3b0355){if(_0x3b0355){_0x55b00e=_0x3b0355;_0x5bc813[_0x3076('0x3f')]=_[_0x3076('0x41')](db[_0x3076('0x59')][_0x3076('0x3b')]);_0x5bc813[_0x3076('0x40')]=_[_0x3076('0x41')](_0x3ca81a[_0x3076('0x40')]);_0x5bc813['filters']=_[_0x3076('0x44')](_0x5bc813[_0x3076('0x3f')],_0x5bc813['query']);_0xa57207[_0x3076('0x43')]=_[_0x3076('0x44')](_0x5bc813['model'],qs[_0x3076('0x45')](_0x3ca81a[_0x3076('0x40')][_0x3076('0x45')]));_0xa57207[_0x3076('0x43')]=_0xa57207[_0x3076('0x43')]['length']?_0xa57207[_0x3076('0x43')]:_0x5bc813['model'];_0xa57207[_0x3076('0x47')]=qs[_0x3076('0x48')](_0x3ca81a['query'][_0x3076('0x48')]);_0xa57207[_0x3076('0x4a')]=qs['filters'](_[_0x3076('0x49')](_0x3ca81a['query'],_0x5bc813[_0x3076('0x42')]));if(_0x3ca81a[_0x3076('0x40')][_0x3076('0x4c')]){_0xa57207[_0x3076('0x4a')]=_[_0x3076('0x4b')](_0xa57207[_0x3076('0x4a')],{'$or':_[_0x3076('0x39')](_0xa57207[_0x3076('0x43')],function(_0x1e65ce){var _0x14e42e={};_0x14e42e[_0x1e65ce]={'$like':'%'+_0x3ca81a[_0x3076('0x40')]['filter']+'%'};return _0x14e42e;})});}_0xa57207=_[_0x3076('0x4b')]({},_0xa57207,_0x3ca81a[_0x3076('0x4d')]);return _0x55b00e[_0x3076('0x5c')](_0xa57207);}})[_0x3076('0x1d')](function(_0x3b2476){if(_0x3b2476){_0xc24f26=_0x3b2476[_0x3076('0x54')];if(!_0x3ca81a[_0x3076('0x40')]['hasOwnProperty'](_0x3076('0x5a'))){_0xa57207[_0x3076('0x2d')]=qs[_0x3076('0x2d')](_0x3ca81a[_0x3076('0x40')]['limit']);_0xa57207[_0x3076('0x2b')]=qs['offset'](_0x3ca81a[_0x3076('0x40')][_0x3076('0x2b')]);}return _0x55b00e[_0x3076('0x5c')](_0xa57207);}})[_0x3076('0x1d')](function(_0x3b2a35){if(_0x3b2a35){return _0x3b2a35?{'count':_0xc24f26,'rows':_0x3b2a35}:null;}})[_0x3076('0x1d')](respondWithResult(_0x2c482d,null))[_0x3076('0x28')](handleError(_0x2c482d,null));};exports[_0x3076('0x5d')]=function(_0x3d356b,_0x3ded42,_0x418a62){var _0x1b0808={};var _0x41ea57={};var _0x52ed53;var _0x206e37;return db[_0x3076('0x3a')][_0x3076('0x5b')]({'where':{'id':_0x3d356b[_0x3076('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ded42,null))[_0x3076('0x1d')](function(_0x170b13){if(_0x170b13){_0x52ed53=_0x170b13;_0x41ea57[_0x3076('0x3f')]=_[_0x3076('0x41')](db[_0x3076('0x59')][_0x3076('0x3b')]);_0x41ea57[_0x3076('0x40')]=_['keys'](_0x3d356b[_0x3076('0x40')]);_0x41ea57['filters']=_[_0x3076('0x44')](_0x41ea57['model'],_0x41ea57[_0x3076('0x40')]);_0x1b0808[_0x3076('0x43')]=_[_0x3076('0x44')](_0x41ea57[_0x3076('0x3f')],qs[_0x3076('0x45')](_0x3d356b['query'][_0x3076('0x45')]));_0x1b0808[_0x3076('0x43')]=_0x1b0808['attributes'][_0x3076('0x54')]?_0x1b0808[_0x3076('0x43')]:_0x41ea57[_0x3076('0x3f')];_0x1b0808[_0x3076('0x47')]=qs[_0x3076('0x48')](_0x3d356b[_0x3076('0x40')][_0x3076('0x48')]);_0x1b0808[_0x3076('0x4a')]=qs['filters'](_[_0x3076('0x49')](_0x3d356b[_0x3076('0x40')],_0x41ea57[_0x3076('0x42')]));if(_0x3d356b[_0x3076('0x40')][_0x3076('0x4c')]){_0x1b0808[_0x3076('0x4a')]=_[_0x3076('0x4b')](_0x1b0808['where'],{'$or':_['map'](_0x1b0808['attributes'],function(_0x392654){var _0x477e52={};_0x477e52[_0x392654]={'$like':'%'+_0x3d356b['query'][_0x3076('0x4c')]+'%'};return _0x477e52;})});}_0x1b0808=_[_0x3076('0x4b')]({},_0x1b0808,_0x3d356b[_0x3076('0x4d')]);return _0x52ed53[_0x3076('0x5d')](_0x1b0808);}})[_0x3076('0x1d')](function(_0x61570a){if(_0x61570a){_0x206e37=_0x61570a[_0x3076('0x54')];if(!_0x3d356b[_0x3076('0x40')][_0x3076('0x46')](_0x3076('0x5a'))){_0x1b0808[_0x3076('0x2d')]=qs[_0x3076('0x2d')](_0x3d356b['query'][_0x3076('0x2d')]);_0x1b0808[_0x3076('0x2b')]=qs[_0x3076('0x2b')](_0x3d356b[_0x3076('0x40')]['offset']);}return _0x52ed53[_0x3076('0x5d')](_0x1b0808);}})[_0x3076('0x1d')](function(_0x2ddf75){if(_0x2ddf75){return _0x2ddf75?{'count':_0x206e37,'rows':_0x2ddf75}:null;}})['then'](respondWithResult(_0x3ded42,null))['catch'](handleError(_0x3ded42,null));}; \ No newline at end of file +var _0xe93b=['info','request\x20sent','debug','stringify','code','error','message','SalesforceConfiguration,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','destroy','getFields','SalesforceField','pick','findOne','rawAttributes','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','request','then'];(function(_0x356cd6,_0x362338){var _0x4f3745=function(_0x4645da){while(--_0x4645da){_0x356cd6['push'](_0x356cd6['shift']());}};_0x4f3745(++_0x362338);}(_0xe93b,0x1c2));var _0xbe93=function(_0x58659b,_0xd9814d){_0x58659b=_0x58659b-0x0;var _0x43aebc=_0xe93b[_0x58659b];return _0x43aebc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe93('0x0'));var zipdir=require(_0xbe93('0x1'));var jsonpatch=require(_0xbe93('0x2'));var rp=require('request-promise');var moment=require(_0xbe93('0x3'));var BPromise=require(_0xbe93('0x4'));var Mustache=require(_0xbe93('0x5'));var util=require(_0xbe93('0x6'));var path=require(_0xbe93('0x7'));var sox=require(_0xbe93('0x8'));var csv=require(_0xbe93('0x9'));var ejs=require(_0xbe93('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbe93('0xb'));var squel=require(_0xbe93('0xc'));var crypto=require(_0xbe93('0xd'));var jsforce=require(_0xbe93('0xe'));var deskjs=require(_0xbe93('0xf'));var toCsv=require(_0xbe93('0x9'));var querystring=require(_0xbe93('0x10'));var Papa=require(_0xbe93('0x11'));var Redis=require(_0xbe93('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbe93('0x13'));var as=require(_0xbe93('0x14'));var hardwareService=require(_0xbe93('0x15'));var logger=require(_0xbe93('0x16'))(_0xbe93('0x17'));var utils=require(_0xbe93('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbe93('0x19'));var db=require(_0xbe93('0x1a'))['db'];var jayson=require(_0xbe93('0x1b'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf87f23,_0x34b431,_0x26174b,_0x5c9c57){return new BPromise(function(_0x527a2f,_0x24ae1c){var _0x223a49=_0x5c9c57||client;return _0x223a49[_0xbe93('0x1c')](_0xf87f23,_0x26174b)[_0xbe93('0x1d')](function(_0x2a4f52){logger[_0xbe93('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x34b431,_0xbe93('0x1f'));logger[_0xbe93('0x20')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x34b431,_0xbe93('0x1f'),JSON[_0xbe93('0x21')](_0x2a4f52));if(_0x2a4f52['error']){if(_0x2a4f52['error'][_0xbe93('0x22')]===0x1f4){logger[_0xbe93('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x34b431,_0x2a4f52[_0xbe93('0x23')][_0xbe93('0x24')]);return _0x24ae1c(_0x2a4f52[_0xbe93('0x23')][_0xbe93('0x24')]);}logger[_0xbe93('0x23')](_0xbe93('0x25'),_0x34b431,_0x2a4f52[_0xbe93('0x23')]['message']);return _0x527a2f(_0x2a4f52[_0xbe93('0x23')][_0xbe93('0x24')]);}else{logger[_0xbe93('0x1e')](_0xbe93('0x25'),_0x34b431,_0xbe93('0x1f'));_0x527a2f(_0x2a4f52['result'][_0xbe93('0x24')]);}})[_0xbe93('0x26')](function(_0x104f97){logger[_0xbe93('0x23')](_0xbe93('0x25'),_0x34b431,_0x104f97);_0x24ae1c(_0x104f97);});});}function respondWithStatusCode(_0x52ae45,_0x4d80ac){_0x4d80ac=_0x4d80ac||0xcc;return function(_0x14629a){if(_0x14629a){return _0x52ae45[_0xbe93('0x27')](_0x4d80ac);}return _0x52ae45[_0xbe93('0x28')](_0x4d80ac)[_0xbe93('0x29')]();};}function respondWithResult(_0x513572,_0x26470f){_0x26470f=_0x26470f||0xc8;return function(_0x171279){if(_0x171279){return _0x513572[_0xbe93('0x28')](_0x26470f)[_0xbe93('0x2a')](_0x171279);}};}function respondWithFilteredResult(_0x24e8ac,_0x153d40){return function(_0x34d124){if(_0x34d124){var _0x2d1de2=typeof _0x153d40[_0xbe93('0x2b')]===_0xbe93('0x2c')&&typeof _0x153d40[_0xbe93('0x2d')]===_0xbe93('0x2c');var _0x4c3fce=_0x34d124[_0xbe93('0x2e')];var _0x431b88=_0x2d1de2?0x0:_0x153d40[_0xbe93('0x2b')];var _0x37ef07=_0x2d1de2?_0x34d124['count']:_0x153d40[_0xbe93('0x2b')]+_0x153d40['limit'];var _0x5ec553;if(_0x37ef07>=_0x4c3fce){_0x37ef07=_0x4c3fce;_0x5ec553=0xc8;}else{_0x5ec553=0xce;}_0x24e8ac[_0xbe93('0x28')](_0x5ec553);return _0x24e8ac[_0xbe93('0x2f')](_0xbe93('0x30'),_0x431b88+'-'+_0x37ef07+'/'+_0x4c3fce)[_0xbe93('0x2a')](_0x34d124);}return null;};}function patchUpdates(_0x4fd4d1){return function(_0x50da57){try{jsonpatch[_0xbe93('0x31')](_0x50da57,_0x4fd4d1,!![]);}catch(_0x353bfe){return BPromise[_0xbe93('0x32')](_0x353bfe);}return _0x50da57[_0xbe93('0x33')]();};}function saveUpdates(_0x3c5790,_0x11ce49){return function(_0x3fb06c){if(_0x3fb06c){return _0x3fb06c[_0xbe93('0x34')](_0x3c5790)[_0xbe93('0x1d')](function(_0x42362c){return _0x42362c;});}return null;};}function removeEntity(_0x1b761f,_0xde4ff2){return function(_0x5802de){if(_0x5802de){return _0x5802de['destroy']()[_0xbe93('0x1d')](function(){_0x1b761f[_0xbe93('0x28')](0xcc)[_0xbe93('0x29')]();});}};}function handleEntityNotFound(_0xf4185b,_0x115b2b){return function(_0x5dd4ea){if(!_0x5dd4ea){_0xf4185b[_0xbe93('0x27')](0x194);}return _0x5dd4ea;};}function handleError(_0x1d5310,_0x4c62dd){_0x4c62dd=_0x4c62dd||0x1f4;return function(_0x11a166){logger[_0xbe93('0x23')](_0x11a166[_0xbe93('0x35')]);if(_0x11a166[_0xbe93('0x36')]){delete _0x11a166[_0xbe93('0x36')];}_0x1d5310[_0xbe93('0x28')](_0x4c62dd)[_0xbe93('0x37')](_0x11a166);};}exports[_0xbe93('0x38')]=function(_0x57bf56,_0x11baa2){var _0x2facf0={},_0x378edc={},_0x1ff4be={'count':0x0,'rows':[]};var _0x320cd8=_[_0xbe93('0x39')](db[_0xbe93('0x3a')]['rawAttributes'],function(_0x173b8b){return{'name':_0x173b8b[_0xbe93('0x3b')],'type':_0x173b8b[_0xbe93('0x3c')][_0xbe93('0x3d')]};});_0x378edc[_0xbe93('0x3e')]=_[_0xbe93('0x39')](_0x320cd8,_0xbe93('0x36'));_0x378edc[_0xbe93('0x3f')]=_['keys'](_0x57bf56[_0xbe93('0x3f')]);_0x378edc[_0xbe93('0x40')]=_[_0xbe93('0x41')](_0x378edc[_0xbe93('0x3e')],_0x378edc[_0xbe93('0x3f')]);_0x2facf0['attributes']=_['intersection'](_0x378edc[_0xbe93('0x3e')],qs[_0xbe93('0x42')](_0x57bf56[_0xbe93('0x3f')][_0xbe93('0x42')]));_0x2facf0[_0xbe93('0x43')]=_0x2facf0[_0xbe93('0x43')][_0xbe93('0x44')]?_0x2facf0[_0xbe93('0x43')]:_0x378edc['model'];if(!_0x57bf56[_0xbe93('0x3f')][_0xbe93('0x45')](_0xbe93('0x46'))){_0x2facf0[_0xbe93('0x2d')]=qs['limit'](_0x57bf56[_0xbe93('0x3f')][_0xbe93('0x2d')]);_0x2facf0[_0xbe93('0x2b')]=qs[_0xbe93('0x2b')](_0x57bf56['query'][_0xbe93('0x2b')]);}_0x2facf0[_0xbe93('0x47')]=qs[_0xbe93('0x48')](_0x57bf56[_0xbe93('0x3f')][_0xbe93('0x48')]);_0x2facf0[_0xbe93('0x49')]=qs[_0xbe93('0x40')](_['pick'](_0x57bf56[_0xbe93('0x3f')],_0x378edc[_0xbe93('0x40')]),_0x320cd8);if(_0x57bf56[_0xbe93('0x3f')][_0xbe93('0x4a')]){_0x2facf0[_0xbe93('0x49')]=_[_0xbe93('0x4b')](_0x2facf0[_0xbe93('0x49')],{'$or':_[_0xbe93('0x39')](_0x320cd8,function(_0x1c6f38){if(_0x1c6f38[_0xbe93('0x3c')]!==_0xbe93('0x4c')){var _0x48af0e={};_0x48af0e[_0x1c6f38[_0xbe93('0x36')]]={'$like':'%'+_0x57bf56[_0xbe93('0x3f')][_0xbe93('0x4a')]+'%'};return _0x48af0e;}})});}_0x2facf0=_[_0xbe93('0x4b')]({},_0x2facf0,_0x57bf56[_0xbe93('0x4d')]);var _0x595be3={'where':_0x2facf0[_0xbe93('0x49')]};return db[_0xbe93('0x3a')][_0xbe93('0x2e')](_0x595be3)[_0xbe93('0x1d')](function(_0x5649fd){_0x1ff4be['count']=_0x5649fd;if(_0x57bf56['query'][_0xbe93('0x4e')]){_0x2facf0['include']=[{'all':!![]}];}return db[_0xbe93('0x3a')][_0xbe93('0x4f')](_0x2facf0);})[_0xbe93('0x1d')](function(_0x532f95){_0x1ff4be[_0xbe93('0x50')]=_0x532f95;return _0x1ff4be;})['then'](respondWithFilteredResult(_0x11baa2,_0x2facf0))[_0xbe93('0x26')](handleError(_0x11baa2,null));};exports[_0xbe93('0x51')]=function(_0x351b92,_0xcad392){var _0x4bd315={'raw':![],'where':{'id':_0x351b92[_0xbe93('0x52')]['id']}},_0x3c3bc6={};_0x3c3bc6['model']=_[_0xbe93('0x53')](db['SalesforceConfiguration']['rawAttributes']);_0x3c3bc6['query']=_[_0xbe93('0x53')](_0x351b92['query']);_0x3c3bc6[_0xbe93('0x40')]=_['intersection'](_0x3c3bc6[_0xbe93('0x3e')],_0x3c3bc6['query']);_0x4bd315['attributes']=_['intersection'](_0x3c3bc6['model'],qs[_0xbe93('0x42')](_0x351b92['query'][_0xbe93('0x42')]));_0x4bd315[_0xbe93('0x43')]=_0x4bd315[_0xbe93('0x43')]['length']?_0x4bd315[_0xbe93('0x43')]:_0x3c3bc6[_0xbe93('0x3e')];if(_0x351b92['query'][_0xbe93('0x4e')]){_0x4bd315[_0xbe93('0x54')]=[{'all':!![]}];}_0x4bd315=_['merge']({},_0x4bd315,_0x351b92[_0xbe93('0x4d')]);return db[_0xbe93('0x3a')][_0xbe93('0x55')](_0x4bd315)[_0xbe93('0x1d')](handleEntityNotFound(_0xcad392,null))[_0xbe93('0x1d')](respondWithResult(_0xcad392,null))[_0xbe93('0x26')](handleError(_0xcad392,null));};exports[_0xbe93('0x56')]=function(_0x3ccbbe,_0x44aaa2){return db['SalesforceConfiguration'][_0xbe93('0x56')](_0x3ccbbe['body'],{})['then'](respondWithResult(_0x44aaa2,0xc9))[_0xbe93('0x26')](handleError(_0x44aaa2,null));};exports['update']=function(_0x926251,_0x5ee2ac){if(_0x926251[_0xbe93('0x57')]['id']){delete _0x926251[_0xbe93('0x57')]['id'];}return db[_0xbe93('0x3a')]['find']({'where':{'id':_0x926251[_0xbe93('0x52')]['id']}})[_0xbe93('0x1d')](handleEntityNotFound(_0x5ee2ac,null))[_0xbe93('0x1d')](saveUpdates(_0x926251['body'],null))[_0xbe93('0x1d')](respondWithResult(_0x5ee2ac,null))[_0xbe93('0x26')](handleError(_0x5ee2ac,null));};exports[_0xbe93('0x58')]=function(_0xce2bf1,_0x4840c8){return db[_0xbe93('0x3a')][_0xbe93('0x55')]({'where':{'id':_0xce2bf1[_0xbe93('0x52')]['id']}})[_0xbe93('0x1d')](handleEntityNotFound(_0x4840c8,null))[_0xbe93('0x1d')](removeEntity(_0x4840c8,null))[_0xbe93('0x26')](handleError(_0x4840c8,null));};exports[_0xbe93('0x59')]=function(_0x1a2fac,_0x36cbd1,_0x1af937){var _0x41b0e1={};var _0x11a17e={};var _0x5d221a;var _0x100d23;return db[_0xbe93('0x3a')]['findOne']({'where':{'id':_0x1a2fac[_0xbe93('0x52')]['id']}})[_0xbe93('0x1d')](handleEntityNotFound(_0x36cbd1,null))[_0xbe93('0x1d')](function(_0x3bfb72){if(_0x3bfb72){_0x5d221a=_0x3bfb72;_0x11a17e['model']=_[_0xbe93('0x53')](db[_0xbe93('0x5a')]['rawAttributes']);_0x11a17e['query']=_[_0xbe93('0x53')](_0x1a2fac[_0xbe93('0x3f')]);_0x11a17e[_0xbe93('0x40')]=_[_0xbe93('0x41')](_0x11a17e[_0xbe93('0x3e')],_0x11a17e[_0xbe93('0x3f')]);_0x41b0e1[_0xbe93('0x43')]=_[_0xbe93('0x41')](_0x11a17e[_0xbe93('0x3e')],qs['fields'](_0x1a2fac[_0xbe93('0x3f')]['fields']));_0x41b0e1[_0xbe93('0x43')]=_0x41b0e1['attributes'][_0xbe93('0x44')]?_0x41b0e1['attributes']:_0x11a17e[_0xbe93('0x3e')];_0x41b0e1[_0xbe93('0x47')]=qs[_0xbe93('0x48')](_0x1a2fac[_0xbe93('0x3f')][_0xbe93('0x48')]);_0x41b0e1[_0xbe93('0x49')]=qs['filters'](_[_0xbe93('0x5b')](_0x1a2fac[_0xbe93('0x3f')],_0x11a17e[_0xbe93('0x40')]));if(_0x1a2fac[_0xbe93('0x3f')][_0xbe93('0x4a')]){_0x41b0e1[_0xbe93('0x49')]=_[_0xbe93('0x4b')](_0x41b0e1[_0xbe93('0x49')],{'$or':_['map'](_0x41b0e1[_0xbe93('0x43')],function(_0x3aecf6){var _0x551f28={};_0x551f28[_0x3aecf6]={'$like':'%'+_0x1a2fac['query'][_0xbe93('0x4a')]+'%'};return _0x551f28;})});}_0x41b0e1=_[_0xbe93('0x4b')]({},_0x41b0e1,_0x1a2fac[_0xbe93('0x4d')]);return _0x5d221a[_0xbe93('0x59')](_0x41b0e1);}})[_0xbe93('0x1d')](function(_0x261b0a){if(_0x261b0a){_0x100d23=_0x261b0a[_0xbe93('0x44')];if(!_0x1a2fac['query'][_0xbe93('0x45')](_0xbe93('0x46'))){_0x41b0e1[_0xbe93('0x2d')]=qs[_0xbe93('0x2d')](_0x1a2fac[_0xbe93('0x3f')]['limit']);_0x41b0e1[_0xbe93('0x2b')]=qs['offset'](_0x1a2fac[_0xbe93('0x3f')][_0xbe93('0x2b')]);}return _0x5d221a[_0xbe93('0x59')](_0x41b0e1);}})[_0xbe93('0x1d')](function(_0x4684c1){if(_0x4684c1){return _0x4684c1?{'count':_0x100d23,'rows':_0x4684c1}:null;}})['then'](respondWithResult(_0x36cbd1,null))['catch'](handleError(_0x36cbd1,null));};exports['getSubjects']=function(_0x574529,_0x3b1a6e,_0x4ce30f){var _0xe96c78={};var _0xf241ad={};var _0x327ca6;var _0x1f20dc;return db[_0xbe93('0x3a')][_0xbe93('0x5c')]({'where':{'id':_0x574529[_0xbe93('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b1a6e,null))[_0xbe93('0x1d')](function(_0x61c606){if(_0x61c606){_0x327ca6=_0x61c606;_0xf241ad['model']=_[_0xbe93('0x53')](db[_0xbe93('0x5a')][_0xbe93('0x5d')]);_0xf241ad['query']=_[_0xbe93('0x53')](_0x574529[_0xbe93('0x3f')]);_0xf241ad[_0xbe93('0x40')]=_[_0xbe93('0x41')](_0xf241ad[_0xbe93('0x3e')],_0xf241ad['query']);_0xe96c78['attributes']=_[_0xbe93('0x41')](_0xf241ad[_0xbe93('0x3e')],qs[_0xbe93('0x42')](_0x574529[_0xbe93('0x3f')][_0xbe93('0x42')]));_0xe96c78['attributes']=_0xe96c78[_0xbe93('0x43')][_0xbe93('0x44')]?_0xe96c78[_0xbe93('0x43')]:_0xf241ad[_0xbe93('0x3e')];_0xe96c78['order']=qs[_0xbe93('0x48')](_0x574529['query'][_0xbe93('0x48')]);_0xe96c78['where']=qs[_0xbe93('0x40')](_['pick'](_0x574529[_0xbe93('0x3f')],_0xf241ad['filters']));if(_0x574529['query'][_0xbe93('0x4a')]){_0xe96c78[_0xbe93('0x49')]=_[_0xbe93('0x4b')](_0xe96c78[_0xbe93('0x49')],{'$or':_[_0xbe93('0x39')](_0xe96c78[_0xbe93('0x43')],function(_0xa5c51b){var _0x9e9465={};_0x9e9465[_0xa5c51b]={'$like':'%'+_0x574529[_0xbe93('0x3f')][_0xbe93('0x4a')]+'%'};return _0x9e9465;})});}_0xe96c78=_[_0xbe93('0x4b')]({},_0xe96c78,_0x574529['options']);return _0x327ca6[_0xbe93('0x5e')](_0xe96c78);}})[_0xbe93('0x1d')](function(_0x243915){if(_0x243915){_0x1f20dc=_0x243915[_0xbe93('0x44')];if(!_0x574529['query'][_0xbe93('0x45')](_0xbe93('0x46'))){_0xe96c78[_0xbe93('0x2d')]=qs[_0xbe93('0x2d')](_0x574529[_0xbe93('0x3f')][_0xbe93('0x2d')]);_0xe96c78[_0xbe93('0x2b')]=qs['offset'](_0x574529['query']['offset']);}return _0x327ca6['getSubjects'](_0xe96c78);}})[_0xbe93('0x1d')](function(_0x200110){if(_0x200110){return _0x200110?{'count':_0x1f20dc,'rows':_0x200110}:null;}})[_0xbe93('0x1d')](respondWithResult(_0x3b1a6e,null))[_0xbe93('0x26')](handleError(_0x3b1a6e,null));};exports[_0xbe93('0x5f')]=function(_0x4a44dc,_0x270166,_0x58682d){var _0x5ad59b={};var _0x28048a={};var _0x396a7a;var _0x2fe983;return db['SalesforceConfiguration'][_0xbe93('0x5c')]({'where':{'id':_0x4a44dc['params']['id']}})[_0xbe93('0x1d')](handleEntityNotFound(_0x270166,null))[_0xbe93('0x1d')](function(_0x831291){if(_0x831291){_0x396a7a=_0x831291;_0x28048a[_0xbe93('0x3e')]=_[_0xbe93('0x53')](db[_0xbe93('0x5a')][_0xbe93('0x5d')]);_0x28048a[_0xbe93('0x3f')]=_[_0xbe93('0x53')](_0x4a44dc[_0xbe93('0x3f')]);_0x28048a[_0xbe93('0x40')]=_[_0xbe93('0x41')](_0x28048a[_0xbe93('0x3e')],_0x28048a[_0xbe93('0x3f')]);_0x5ad59b['attributes']=_['intersection'](_0x28048a[_0xbe93('0x3e')],qs['fields'](_0x4a44dc[_0xbe93('0x3f')]['fields']));_0x5ad59b[_0xbe93('0x43')]=_0x5ad59b[_0xbe93('0x43')][_0xbe93('0x44')]?_0x5ad59b['attributes']:_0x28048a[_0xbe93('0x3e')];_0x5ad59b[_0xbe93('0x47')]=qs['sort'](_0x4a44dc['query']['sort']);_0x5ad59b[_0xbe93('0x49')]=qs[_0xbe93('0x40')](_[_0xbe93('0x5b')](_0x4a44dc['query'],_0x28048a[_0xbe93('0x40')]));if(_0x4a44dc[_0xbe93('0x3f')][_0xbe93('0x4a')]){_0x5ad59b[_0xbe93('0x49')]=_[_0xbe93('0x4b')](_0x5ad59b[_0xbe93('0x49')],{'$or':_[_0xbe93('0x39')](_0x5ad59b[_0xbe93('0x43')],function(_0x5251a8){var _0x5a6b1b={};_0x5a6b1b[_0x5251a8]={'$like':'%'+_0x4a44dc[_0xbe93('0x3f')][_0xbe93('0x4a')]+'%'};return _0x5a6b1b;})});}_0x5ad59b=_[_0xbe93('0x4b')]({},_0x5ad59b,_0x4a44dc[_0xbe93('0x4d')]);return _0x396a7a[_0xbe93('0x5f')](_0x5ad59b);}})[_0xbe93('0x1d')](function(_0x44ccc8){if(_0x44ccc8){_0x2fe983=_0x44ccc8[_0xbe93('0x44')];if(!_0x4a44dc[_0xbe93('0x3f')][_0xbe93('0x45')]('nolimit')){_0x5ad59b[_0xbe93('0x2d')]=qs[_0xbe93('0x2d')](_0x4a44dc['query'][_0xbe93('0x2d')]);_0x5ad59b[_0xbe93('0x2b')]=qs[_0xbe93('0x2b')](_0x4a44dc[_0xbe93('0x3f')]['offset']);}return _0x396a7a[_0xbe93('0x5f')](_0x5ad59b);}})[_0xbe93('0x1d')](function(_0x577f9b){if(_0x577f9b){return _0x577f9b?{'count':_0x2fe983,'rows':_0x577f9b}:null;}})[_0xbe93('0x1d')](respondWithResult(_0x270166,null))['catch'](handleError(_0x270166,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d25b2f9..285bf71 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 _0xea7b=['path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','lodash','util','moment','request-promise'];(function(_0x4e5e7b,_0x5c3d23){var _0x333893=function(_0x4b45f9){while(--_0x4b45f9){_0x4e5e7b['push'](_0x4e5e7b['shift']());}};_0x333893(++_0x5c3d23);}(_0xea7b,0x114));var _0xbea7=function(_0x21a95e,_0x4de45e){_0x21a95e=_0x21a95e-0x0;var _0x828e72=_0xea7b[_0x21a95e];return _0x828e72;};'use strict';var _=require(_0xbea7('0x0'));var util=require(_0xbea7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbea7('0x2'));var BPromise=require('bluebird');var rp=require(_0xbea7('0x3'));var fs=require('fs');var path=require(_0xbea7('0x4'));var rimraf=require(_0xbea7('0x5'));var config=require(_0xbea7('0x6'));var attributes=require(_0xbea7('0x7'));module['exports']=function(_0x4b4d25,_0x4d1d22){return _0x4b4d25[_0xbea7('0x8')](_0xbea7('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c0c=['request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6c0c,0x7c));var _0xc6c0=function(_0x566723,_0x2cbb84){_0x566723=_0x566723-0x0;var _0x4a2328=_0x6c0c[_0x566723];return _0x4a2328;};'use strict';var _=require(_0xc6c0('0x0'));var util=require(_0xc6c0('0x1'));var logger=require(_0xc6c0('0x2'))(_0xc6c0('0x3'));var moment=require(_0xc6c0('0x4'));var BPromise=require(_0xc6c0('0x5'));var rp=require(_0xc6c0('0x6'));var fs=require('fs');var path=require(_0xc6c0('0x7'));var rimraf=require(_0xc6c0('0x8'));var config=require('../../config/environment');var attributes=require(_0xc6c0('0x9'));module[_0xc6c0('0xa')]=function(_0x2d9477,_0x4f723f){return _0x2d9477['define'](_0xc6c0('0xb'),attributes,{'tableName':_0xc6c0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 4ed2c22..b7db3f9 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 _0x2f77=['util','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x2f77,0xd1));var _0x72f7=function(_0x28d1db,_0x36a119){_0x28d1db=_0x28d1db-0x0;var _0x22b879=_0x2f77[_0x28d1db];return _0x22b879;};'use strict';var _=require(_0x72f7('0x0'));var util=require(_0x72f7('0x1'));var moment=require('moment');var BPromise=require(_0x72f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x72f7('0x4'));var logger=require('../../config/logger')(_0x72f7('0x5'));var config=require('../../config/environment');var jayson=require(_0x72f7('0x6'));var client=jayson[_0x72f7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d9bb2,_0x358f79,_0x2d906a){return new BPromise(function(_0x132b28,_0x14de6c){return client[_0x72f7('0x8')](_0x3d9bb2,_0x2d906a)[_0x72f7('0x9')](function(_0x48ed6a){logger[_0x72f7('0xa')](_0x72f7('0xb'),_0x358f79,_0x72f7('0xc'));logger[_0x72f7('0xd')](_0x72f7('0xe'),_0x358f79,'request\x20sent',JSON[_0x72f7('0xf')](_0x48ed6a));if(_0x48ed6a[_0x72f7('0x10')]){if(_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x11')]===0x1f4){logger[_0x72f7('0x10')](_0x72f7('0xb'),_0x358f79,_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);return _0x14de6c(_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);}logger[_0x72f7('0x10')](_0x72f7('0xb'),_0x358f79,_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);return _0x132b28(_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);}else{logger[_0x72f7('0xa')](_0x72f7('0xb'),_0x358f79,'request\x20sent');_0x132b28(_0x48ed6a[_0x72f7('0x13')][_0x72f7('0x12')]);}})[_0x72f7('0x14')](function(_0x409780){logger[_0x72f7('0x10')](_0x72f7('0xb'),_0x358f79,_0x409780);_0x14de6c(_0x409780);});});} \ No newline at end of file +var _0x3bde=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x3a3ef7,_0x3ae99b){var _0xcb8a15=function(_0x2781ec){while(--_0x2781ec){_0x3a3ef7['push'](_0x3a3ef7['shift']());}};_0xcb8a15(++_0x3ae99b);}(_0x3bde,0x1df));var _0xe3bd=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x3bde[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xe3bd('0x0'));var util=require(_0xe3bd('0x1'));var moment=require(_0xe3bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3bd('0x3'));var fs=require('fs');var Redis=require(_0xe3bd('0x4'));var db=require(_0xe3bd('0x5'))['db'];var utils=require(_0xe3bd('0x6'));var logger=require(_0xe3bd('0x7'))('rpc');var config=require(_0xe3bd('0x8'));var jayson=require(_0xe3bd('0x9'));var client=jayson[_0xe3bd('0xa')][_0xe3bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ceef3,_0x3ffd65,_0x2a0827){return new BPromise(function(_0x28ddee,_0x2627b7){return client['request'](_0x1ceef3,_0x2a0827)[_0xe3bd('0xc')](function(_0x49e613){logger[_0xe3bd('0xd')](_0xe3bd('0xe'),_0x3ffd65,'request\x20sent');logger[_0xe3bd('0xf')](_0xe3bd('0x10'),_0x3ffd65,_0xe3bd('0x11'),JSON[_0xe3bd('0x12')](_0x49e613));if(_0x49e613[_0xe3bd('0x13')]){if(_0x49e613[_0xe3bd('0x13')][_0xe3bd('0x14')]===0x1f4){logger['error'](_0xe3bd('0xe'),_0x3ffd65,_0x49e613[_0xe3bd('0x13')][_0xe3bd('0x15')]);return _0x2627b7(_0x49e613[_0xe3bd('0x13')]['message']);}logger[_0xe3bd('0x13')](_0xe3bd('0xe'),_0x3ffd65,_0x49e613['error'][_0xe3bd('0x15')]);return _0x28ddee(_0x49e613[_0xe3bd('0x13')][_0xe3bd('0x15')]);}else{logger[_0xe3bd('0xd')](_0xe3bd('0xe'),_0x3ffd65,_0xe3bd('0x11'));_0x28ddee(_0x49e613[_0xe3bd('0x16')][_0xe3bd('0x15')]);}})[_0xe3bd('0x17')](function(_0x56a02f){logger[_0xe3bd('0x13')](_0xe3bd('0xe'),_0x3ffd65,_0x56a02f);_0x2627b7(_0x56a02f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 6759c00..f9baace 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 _0x0c0c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x2a8390,_0x4fc1fb){var _0x36c91c=function(_0x455bb2){while(--_0x455bb2){_0x2a8390['push'](_0x2a8390['shift']());}};_0x36c91c(++_0x4fc1fb);}(_0x0c0c,0x1cc));var _0xc0c0=function(_0x1b53b5,_0x52512b){_0x1b53b5=_0x1b53b5-0x0;var _0x1fe62c=_0x0c0c[_0x1b53b5];return _0x1fe62c;};'use strict';var multer=require(_0xc0c0('0x0'));var util=require(_0xc0c0('0x1'));var path=require(_0xc0c0('0x2'));var timeout=require(_0xc0c0('0x3'));var express=require(_0xc0c0('0x4'));var router=express[_0xc0c0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc0c0('0x6'));var interaction=require(_0xc0c0('0x7'));var config=require('../../config/environment');var controller=require(_0xc0c0('0x8'));router[_0xc0c0('0x9')]('/',auth[_0xc0c0('0xa')](),controller[_0xc0c0('0xb')]);router[_0xc0c0('0x9')](_0xc0c0('0xc'),auth[_0xc0c0('0xa')](),controller[_0xc0c0('0xd')]);router[_0xc0c0('0xe')]('/',auth[_0xc0c0('0xa')](),controller[_0xc0c0('0xf')]);router['put'](_0xc0c0('0xc'),auth[_0xc0c0('0xa')](),controller[_0xc0c0('0x10')]);router[_0xc0c0('0x11')](_0xc0c0('0xc'),auth[_0xc0c0('0xa')](),controller[_0xc0c0('0x12')]);module[_0xc0c0('0x13')]=router; \ No newline at end of file +var _0xbea4=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','post','update','delete','destroy','exports','multer','util','path'];(function(_0x101eba,_0x2cd004){var _0x56e4ca=function(_0x4bb6a5){while(--_0x4bb6a5){_0x101eba['push'](_0x101eba['shift']());}};_0x56e4ca(++_0x2cd004);}(_0xbea4,0x107));var _0x4bea=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xbea4[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x4bea('0x0'));var util=require(_0x4bea('0x1'));var path=require(_0x4bea('0x2'));var timeout=require(_0x4bea('0x3'));var express=require('express');var router=express[_0x4bea('0x4')]();var fs_extra=require(_0x4bea('0x5'));var auth=require(_0x4bea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4bea('0x7'));var controller=require(_0x4bea('0x8'));router[_0x4bea('0x9')]('/',auth['isAuthenticated'](),controller[_0x4bea('0xa')]);router[_0x4bea('0x9')](_0x4bea('0xb'),auth[_0x4bea('0xc')](),controller[_0x4bea('0xd')]);router[_0x4bea('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4bea('0xb'),auth[_0x4bea('0xc')](),controller[_0x4bea('0xf')]);router[_0x4bea('0x10')](_0x4bea('0xb'),auth[_0x4bea('0xc')](),controller[_0x4bea('0x11')]);module[_0x4bea('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 fe17731..a09f4c5 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 _0x4614=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x1a1091,_0x2f8505){var _0x171a98=function(_0xd5db19){while(--_0xd5db19){_0x1a1091['push'](_0x1a1091['shift']());}};_0x171a98(++_0x2f8505);}(_0x4614,0x179));var _0x4461=function(_0x4b98fc,_0x1bba86){_0x4b98fc=_0x4b98fc-0x0;var _0x2fd1ec=_0x4614[_0x4b98fc];return _0x2fd1ec;};'use strict';var Sequelize=require(_0x4461('0x0'));module[_0x4461('0x1')]={'type':{'type':Sequelize[_0x4461('0x2')](_0x4461('0x3'),_0x4461('0x4'),_0x4461('0x5'),_0x4461('0x6'),_0x4461('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4461('0x8')]},'keyType':{'type':Sequelize[_0x4461('0x2')](_0x4461('0x3'),_0x4461('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4461('0x8')]},'idField':{'type':Sequelize[_0x4461('0x8')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x94e9=['STRING','variable','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x20232c,_0x2eb619){var _0x544ad0=function(_0x55de53){while(--_0x55de53){_0x20232c['push'](_0x20232c['shift']());}};_0x544ad0(++_0x2eb619);}(_0x94e9,0xb6));var _0x994e=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0x94e9[_0x34bc94];return _0xee41e7;};'use strict';var Sequelize=require(_0x994e('0x0'));module[_0x994e('0x1')]={'type':{'type':Sequelize[_0x994e('0x2')](_0x994e('0x3'),'variable',_0x994e('0x4'),_0x994e('0x5'),_0x994e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x994e('0x7')]},'key':{'type':Sequelize[_0x994e('0x7')]},'keyType':{'type':Sequelize[_0x994e('0x2')](_0x994e('0x3'),_0x994e('0x8'),_0x994e('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a40a37f..c7f990c 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 _0x514d=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','then','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','findAll','show','params','include','options','create','catch','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x1d9ff0,_0x5baadb){var _0x48d3d8=function(_0x15bcb8){while(--_0x15bcb8){_0x1d9ff0['push'](_0x1d9ff0['shift']());}};_0x48d3d8(++_0x5baadb);}(_0x514d,0x87));var _0xd514=function(_0x3bb836,_0x3e5ed9){_0x3bb836=_0x3bb836-0x0;var _0x27483a=_0x514d[_0x3bb836];return _0x27483a;};'use strict';var emlformat=require(_0xd514('0x0'));var rimraf=require(_0xd514('0x1'));var zipdir=require(_0xd514('0x2'));var jsonpatch=require(_0xd514('0x3'));var rp=require(_0xd514('0x4'));var moment=require(_0xd514('0x5'));var BPromise=require(_0xd514('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd514('0x7'));var sox=require(_0xd514('0x8'));var csv=require(_0xd514('0x9'));var ejs=require(_0xd514('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd514('0xb'));var squel=require(_0xd514('0xc'));var crypto=require('crypto');var jsforce=require(_0xd514('0xd'));var deskjs=require(_0xd514('0xe'));var toCsv=require(_0xd514('0x9'));var querystring=require(_0xd514('0xf'));var Papa=require(_0xd514('0x10'));var Redis=require('ioredis');var authService=require(_0xd514('0x11'));var qs=require(_0xd514('0x12'));var as=require(_0xd514('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd514('0x14'))(_0xd514('0x15'));var utils=require(_0xd514('0x16'));var config=require(_0xd514('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd514('0x18'))['db'];function respondWithStatusCode(_0x52c1cd,_0x4e49b1){_0x4e49b1=_0x4e49b1||0xcc;return function(_0x17c8e2){if(_0x17c8e2){return _0x52c1cd[_0xd514('0x19')](_0x4e49b1);}return _0x52c1cd[_0xd514('0x1a')](_0x4e49b1)[_0xd514('0x1b')]();};}function respondWithResult(_0x4ad26d,_0x3085f0){_0x3085f0=_0x3085f0||0xc8;return function(_0x534ae9){if(_0x534ae9){return _0x4ad26d['status'](_0x3085f0)[_0xd514('0x1c')](_0x534ae9);}};}function respondWithFilteredResult(_0x654e8f,_0xece449){return function(_0x36adcd){if(_0x36adcd){var _0x52cec3=typeof _0xece449[_0xd514('0x1d')]==='undefined'&&typeof _0xece449['limit']==='undefined';var _0xa11f68=_0x36adcd[_0xd514('0x1e')];var _0x3e6752=_0x52cec3?0x0:_0xece449[_0xd514('0x1d')];var _0x28bc79=_0x52cec3?_0x36adcd['count']:_0xece449[_0xd514('0x1d')]+_0xece449[_0xd514('0x1f')];var _0x572ebc;if(_0x28bc79>=_0xa11f68){_0x28bc79=_0xa11f68;_0x572ebc=0xc8;}else{_0x572ebc=0xce;}_0x654e8f[_0xd514('0x1a')](_0x572ebc);return _0x654e8f[_0xd514('0x20')](_0xd514('0x21'),_0x3e6752+'-'+_0x28bc79+'/'+_0xa11f68)[_0xd514('0x1c')](_0x36adcd);}return null;};}function patchUpdates(_0x21b7ed){return function(_0x5429ff){try{jsonpatch['apply'](_0x5429ff,_0x21b7ed,!![]);}catch(_0x44fc19){return BPromise[_0xd514('0x22')](_0x44fc19);}return _0x5429ff[_0xd514('0x23')]();};}function saveUpdates(_0x232886,_0x2eff39){return function(_0x2a3c10){if(_0x2a3c10){return _0x2a3c10[_0xd514('0x24')](_0x232886)[_0xd514('0x25')](function(_0x4960b7){return _0x4960b7;});}return null;};}function removeEntity(_0x39a16d,_0x41f04d){return function(_0x53a87e){if(_0x53a87e){return _0x53a87e['destroy']()[_0xd514('0x25')](function(){_0x39a16d[_0xd514('0x1a')](0xcc)[_0xd514('0x1b')]();});}};}function handleEntityNotFound(_0x3b97d5,_0xd0c22f){return function(_0x44e909){if(!_0x44e909){_0x3b97d5[_0xd514('0x19')](0x194);}return _0x44e909;};}function handleError(_0x1c834b,_0x6244b2){_0x6244b2=_0x6244b2||0x1f4;return function(_0x391c56){logger['error'](_0x391c56['stack']);if(_0x391c56['name']){delete _0x391c56[_0xd514('0x26')];}_0x1c834b[_0xd514('0x1a')](_0x6244b2)[_0xd514('0x27')](_0x391c56);};}exports[_0xd514('0x28')]=function(_0x39dac0,_0x203f7d){var _0x360a4b={},_0x4691a9={},_0x58801a={'count':0x0,'rows':[]};var _0x53bb7a=_[_0xd514('0x29')](db[_0xd514('0x2a')][_0xd514('0x2b')],function(_0x43cb45){return{'name':_0x43cb45[_0xd514('0x2c')],'type':_0x43cb45[_0xd514('0x2d')][_0xd514('0x2e')]};});_0x4691a9['model']=_[_0xd514('0x29')](_0x53bb7a,_0xd514('0x26'));_0x4691a9[_0xd514('0x2f')]=_[_0xd514('0x30')](_0x39dac0['query']);_0x4691a9['filters']=_[_0xd514('0x31')](_0x4691a9[_0xd514('0x32')],_0x4691a9['query']);_0x360a4b['attributes']=_[_0xd514('0x31')](_0x4691a9[_0xd514('0x32')],qs['fields'](_0x39dac0['query'][_0xd514('0x33')]));_0x360a4b[_0xd514('0x34')]=_0x360a4b[_0xd514('0x34')][_0xd514('0x35')]?_0x360a4b[_0xd514('0x34')]:_0x4691a9[_0xd514('0x32')];if(!_0x39dac0[_0xd514('0x2f')][_0xd514('0x36')](_0xd514('0x37'))){_0x360a4b[_0xd514('0x1f')]=qs[_0xd514('0x1f')](_0x39dac0[_0xd514('0x2f')][_0xd514('0x1f')]);_0x360a4b['offset']=qs['offset'](_0x39dac0[_0xd514('0x2f')][_0xd514('0x1d')]);}_0x360a4b[_0xd514('0x38')]=qs[_0xd514('0x39')](_0x39dac0[_0xd514('0x2f')][_0xd514('0x39')]);_0x360a4b['where']=qs[_0xd514('0x3a')](_[_0xd514('0x3b')](_0x39dac0[_0xd514('0x2f')],_0x4691a9[_0xd514('0x3a')]),_0x53bb7a);if(_0x39dac0[_0xd514('0x2f')]['filter']){_0x360a4b[_0xd514('0x3c')]=_[_0xd514('0x3d')](_0x360a4b[_0xd514('0x3c')],{'$or':_['map'](_0x53bb7a,function(_0x54bda5){if(_0x54bda5[_0xd514('0x2d')]!==_0xd514('0x3e')){var _0x4386bb={};_0x4386bb[_0x54bda5[_0xd514('0x26')]]={'$like':'%'+_0x39dac0[_0xd514('0x2f')][_0xd514('0x3f')]+'%'};return _0x4386bb;}})});}_0x360a4b=_[_0xd514('0x3d')]({},_0x360a4b,_0x39dac0['options']);var _0x3a885f={'where':_0x360a4b[_0xd514('0x3c')]};return db[_0xd514('0x2a')]['count'](_0x3a885f)[_0xd514('0x25')](function(_0x5b84ed){_0x58801a['count']=_0x5b84ed;if(_0x39dac0['query'][_0xd514('0x40')]){_0x360a4b['include']=[{'all':!![]}];}return db[_0xd514('0x2a')][_0xd514('0x41')](_0x360a4b);})['then'](function(_0x44838d){_0x58801a['rows']=_0x44838d;return _0x58801a;})[_0xd514('0x25')](respondWithFilteredResult(_0x203f7d,_0x360a4b))['catch'](handleError(_0x203f7d,null));};exports[_0xd514('0x42')]=function(_0x267eb9,_0x4edaf4){var _0x16303e={'raw':!![],'where':{'id':_0x267eb9[_0xd514('0x43')]['id']}},_0x2b723d={};_0x2b723d[_0xd514('0x32')]=_[_0xd514('0x30')](db[_0xd514('0x2a')]['rawAttributes']);_0x2b723d[_0xd514('0x2f')]=_[_0xd514('0x30')](_0x267eb9[_0xd514('0x2f')]);_0x2b723d[_0xd514('0x3a')]=_[_0xd514('0x31')](_0x2b723d[_0xd514('0x32')],_0x2b723d['query']);_0x16303e['attributes']=_[_0xd514('0x31')](_0x2b723d[_0xd514('0x32')],qs[_0xd514('0x33')](_0x267eb9[_0xd514('0x2f')][_0xd514('0x33')]));_0x16303e[_0xd514('0x34')]=_0x16303e[_0xd514('0x34')][_0xd514('0x35')]?_0x16303e[_0xd514('0x34')]:_0x2b723d[_0xd514('0x32')];if(_0x267eb9[_0xd514('0x2f')][_0xd514('0x40')]){_0x16303e[_0xd514('0x44')]=[{'all':!![]}];}_0x16303e=_['merge']({},_0x16303e,_0x267eb9[_0xd514('0x45')]);return db['SalesforceField']['find'](_0x16303e)[_0xd514('0x25')](handleEntityNotFound(_0x4edaf4,null))[_0xd514('0x25')](respondWithResult(_0x4edaf4,null))['catch'](handleError(_0x4edaf4,null));};exports[_0xd514('0x46')]=function(_0x3b8cc0,_0x483e71){return db[_0xd514('0x2a')][_0xd514('0x46')](_0x3b8cc0['body'],{})[_0xd514('0x25')](respondWithResult(_0x483e71,0xc9))[_0xd514('0x47')](handleError(_0x483e71,null));};exports['update']=function(_0x5528ed,_0x4eed5e){if(_0x5528ed[_0xd514('0x48')]['id']){delete _0x5528ed['body']['id'];}return db[_0xd514('0x2a')][_0xd514('0x49')]({'where':{'id':_0x5528ed['params']['id']}})[_0xd514('0x25')](handleEntityNotFound(_0x4eed5e,null))[_0xd514('0x25')](saveUpdates(_0x5528ed[_0xd514('0x48')],null))[_0xd514('0x25')](respondWithResult(_0x4eed5e,null))[_0xd514('0x47')](handleError(_0x4eed5e,null));};exports[_0xd514('0x4a')]=function(_0x40d606,_0x38d278){return db['SalesforceField'][_0xd514('0x49')]({'where':{'id':_0x40d606[_0xd514('0x43')]['id']}})[_0xd514('0x25')](handleEntityNotFound(_0x38d278,null))[_0xd514('0x25')](removeEntity(_0x38d278,null))[_0xd514('0x47')](handleError(_0x38d278,null));}; \ No newline at end of file +var _0xb4a2=['type','key','model','map','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','fields','options','catch','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName'];(function(_0x5337e3,_0x4cc3d0){var _0x1fa604=function(_0x430c86){while(--_0x430c86){_0x5337e3['push'](_0x5337e3['shift']());}};_0x1fa604(++_0x4cc3d0);}(_0xb4a2,0xf5));var _0x2b4a=function(_0x1c37a5,_0x59ee51){_0x1c37a5=_0x1c37a5-0x0;var _0x389d03=_0xb4a2[_0x1c37a5];return _0x389d03;};'use strict';var emlformat=require(_0x2b4a('0x0'));var rimraf=require(_0x2b4a('0x1'));var zipdir=require(_0x2b4a('0x2'));var jsonpatch=require(_0x2b4a('0x3'));var rp=require('request-promise');var moment=require(_0x2b4a('0x4'));var BPromise=require(_0x2b4a('0x5'));var Mustache=require(_0x2b4a('0x6'));var util=require(_0x2b4a('0x7'));var path=require(_0x2b4a('0x8'));var sox=require(_0x2b4a('0x9'));var csv=require(_0x2b4a('0xa'));var ejs=require(_0x2b4a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b4a('0xc'));var squel=require(_0x2b4a('0xd'));var crypto=require(_0x2b4a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2b4a('0xf'));var toCsv=require(_0x2b4a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2b4a('0x10'));var authService=require(_0x2b4a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b4a('0x12'));var hardwareService=require(_0x2b4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2b4a('0x14'));var config=require(_0x2b4a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403724,_0x185cac){_0x185cac=_0x185cac||0xcc;return function(_0x38118b){if(_0x38118b){return _0x403724[_0x2b4a('0x16')](_0x185cac);}return _0x403724['status'](_0x185cac)[_0x2b4a('0x17')]();};}function respondWithResult(_0x9f1cdf,_0x119d32){_0x119d32=_0x119d32||0xc8;return function(_0xe837ea){if(_0xe837ea){return _0x9f1cdf[_0x2b4a('0x18')](_0x119d32)['json'](_0xe837ea);}};}function respondWithFilteredResult(_0xce4ff8,_0x36cd15){return function(_0x20f26){if(_0x20f26){var _0x11d65f=typeof _0x36cd15[_0x2b4a('0x19')]===_0x2b4a('0x1a')&&typeof _0x36cd15[_0x2b4a('0x1b')]==='undefined';var _0x33041b=_0x20f26[_0x2b4a('0x1c')];var _0x1e1b95=_0x11d65f?0x0:_0x36cd15[_0x2b4a('0x19')];var _0x319e71=_0x11d65f?_0x20f26['count']:_0x36cd15[_0x2b4a('0x19')]+_0x36cd15[_0x2b4a('0x1b')];var _0x1211db;if(_0x319e71>=_0x33041b){_0x319e71=_0x33041b;_0x1211db=0xc8;}else{_0x1211db=0xce;}_0xce4ff8[_0x2b4a('0x18')](_0x1211db);return _0xce4ff8[_0x2b4a('0x1d')](_0x2b4a('0x1e'),_0x1e1b95+'-'+_0x319e71+'/'+_0x33041b)['json'](_0x20f26);}return null;};}function patchUpdates(_0x452c90){return function(_0x2dc485){try{jsonpatch[_0x2b4a('0x1f')](_0x2dc485,_0x452c90,!![]);}catch(_0x4e777c){return BPromise['reject'](_0x4e777c);}return _0x2dc485[_0x2b4a('0x20')]();};}function saveUpdates(_0x6da924,_0x5a3475){return function(_0x191705){if(_0x191705){return _0x191705[_0x2b4a('0x21')](_0x6da924)[_0x2b4a('0x22')](function(_0x362330){return _0x362330;});}return null;};}function removeEntity(_0x14e1a6,_0x328b2d){return function(_0x4126dc){if(_0x4126dc){return _0x4126dc['destroy']()[_0x2b4a('0x22')](function(){_0x14e1a6['status'](0xcc)[_0x2b4a('0x17')]();});}};}function handleEntityNotFound(_0x267801,_0x1cbab3){return function(_0x362449){if(!_0x362449){_0x267801[_0x2b4a('0x16')](0x194);}return _0x362449;};}function handleError(_0x1a1f08,_0x3a299d){_0x3a299d=_0x3a299d||0x1f4;return function(_0x4f7ae5){logger[_0x2b4a('0x23')](_0x4f7ae5[_0x2b4a('0x24')]);if(_0x4f7ae5[_0x2b4a('0x25')]){delete _0x4f7ae5[_0x2b4a('0x25')];}_0x1a1f08['status'](_0x3a299d)[_0x2b4a('0x26')](_0x4f7ae5);};}exports[_0x2b4a('0x27')]=function(_0x14f45c,_0x591df2){var _0x177eab={},_0x3fa7c1={},_0x1bda2e={'count':0x0,'rows':[]};var _0x4450b9=_['map'](db[_0x2b4a('0x28')][_0x2b4a('0x29')],function(_0x5eaa47){return{'name':_0x5eaa47[_0x2b4a('0x2a')],'type':_0x5eaa47[_0x2b4a('0x2b')][_0x2b4a('0x2c')]};});_0x3fa7c1[_0x2b4a('0x2d')]=_[_0x2b4a('0x2e')](_0x4450b9,_0x2b4a('0x25'));_0x3fa7c1[_0x2b4a('0x2f')]=_[_0x2b4a('0x30')](_0x14f45c['query']);_0x3fa7c1[_0x2b4a('0x31')]=_[_0x2b4a('0x32')](_0x3fa7c1['model'],_0x3fa7c1[_0x2b4a('0x2f')]);_0x177eab['attributes']=_[_0x2b4a('0x32')](_0x3fa7c1[_0x2b4a('0x2d')],qs['fields'](_0x14f45c['query']['fields']));_0x177eab[_0x2b4a('0x33')]=_0x177eab[_0x2b4a('0x33')]['length']?_0x177eab[_0x2b4a('0x33')]:_0x3fa7c1[_0x2b4a('0x2d')];if(!_0x14f45c[_0x2b4a('0x2f')]['hasOwnProperty'](_0x2b4a('0x34'))){_0x177eab[_0x2b4a('0x1b')]=qs[_0x2b4a('0x1b')](_0x14f45c[_0x2b4a('0x2f')][_0x2b4a('0x1b')]);_0x177eab[_0x2b4a('0x19')]=qs[_0x2b4a('0x19')](_0x14f45c['query']['offset']);}_0x177eab[_0x2b4a('0x35')]=qs[_0x2b4a('0x36')](_0x14f45c[_0x2b4a('0x2f')][_0x2b4a('0x36')]);_0x177eab[_0x2b4a('0x37')]=qs['filters'](_[_0x2b4a('0x38')](_0x14f45c[_0x2b4a('0x2f')],_0x3fa7c1[_0x2b4a('0x31')]),_0x4450b9);if(_0x14f45c[_0x2b4a('0x2f')][_0x2b4a('0x39')]){_0x177eab[_0x2b4a('0x37')]=_[_0x2b4a('0x3a')](_0x177eab[_0x2b4a('0x37')],{'$or':_[_0x2b4a('0x2e')](_0x4450b9,function(_0x72ee1){if(_0x72ee1[_0x2b4a('0x2b')]!==_0x2b4a('0x3b')){var _0x548795={};_0x548795[_0x72ee1[_0x2b4a('0x25')]]={'$like':'%'+_0x14f45c[_0x2b4a('0x2f')][_0x2b4a('0x39')]+'%'};return _0x548795;}})});}_0x177eab=_[_0x2b4a('0x3a')]({},_0x177eab,_0x14f45c['options']);var _0x3e1b38={'where':_0x177eab[_0x2b4a('0x37')]};return db['SalesforceField'][_0x2b4a('0x1c')](_0x3e1b38)[_0x2b4a('0x22')](function(_0x482691){_0x1bda2e[_0x2b4a('0x1c')]=_0x482691;if(_0x14f45c[_0x2b4a('0x2f')][_0x2b4a('0x3c')]){_0x177eab[_0x2b4a('0x3d')]=[{'all':!![]}];}return db['SalesforceField'][_0x2b4a('0x3e')](_0x177eab);})[_0x2b4a('0x22')](function(_0x2da481){_0x1bda2e['rows']=_0x2da481;return _0x1bda2e;})[_0x2b4a('0x22')](respondWithFilteredResult(_0x591df2,_0x177eab))['catch'](handleError(_0x591df2,null));};exports[_0x2b4a('0x3f')]=function(_0x21a18b,_0x4b9012){var _0x31fe92={'raw':!![],'where':{'id':_0x21a18b['params']['id']}},_0x286299={};_0x286299[_0x2b4a('0x2d')]=_['keys'](db[_0x2b4a('0x28')][_0x2b4a('0x29')]);_0x286299[_0x2b4a('0x2f')]=_[_0x2b4a('0x30')](_0x21a18b[_0x2b4a('0x2f')]);_0x286299['filters']=_[_0x2b4a('0x32')](_0x286299[_0x2b4a('0x2d')],_0x286299[_0x2b4a('0x2f')]);_0x31fe92[_0x2b4a('0x33')]=_['intersection'](_0x286299[_0x2b4a('0x2d')],qs[_0x2b4a('0x40')](_0x21a18b[_0x2b4a('0x2f')][_0x2b4a('0x40')]));_0x31fe92[_0x2b4a('0x33')]=_0x31fe92[_0x2b4a('0x33')]['length']?_0x31fe92[_0x2b4a('0x33')]:_0x286299[_0x2b4a('0x2d')];if(_0x21a18b[_0x2b4a('0x2f')]['includeAll']){_0x31fe92[_0x2b4a('0x3d')]=[{'all':!![]}];}_0x31fe92=_[_0x2b4a('0x3a')]({},_0x31fe92,_0x21a18b[_0x2b4a('0x41')]);return db[_0x2b4a('0x28')]['find'](_0x31fe92)[_0x2b4a('0x22')](handleEntityNotFound(_0x4b9012,null))['then'](respondWithResult(_0x4b9012,null))[_0x2b4a('0x42')](handleError(_0x4b9012,null));};exports[_0x2b4a('0x43')]=function(_0x3a516d,_0x4908eb){return db[_0x2b4a('0x28')][_0x2b4a('0x43')](_0x3a516d[_0x2b4a('0x44')],{})[_0x2b4a('0x22')](respondWithResult(_0x4908eb,0xc9))['catch'](handleError(_0x4908eb,null));};exports[_0x2b4a('0x21')]=function(_0x8609e8,_0x50bb1f){if(_0x8609e8[_0x2b4a('0x44')]['id']){delete _0x8609e8[_0x2b4a('0x44')]['id'];}return db[_0x2b4a('0x28')][_0x2b4a('0x45')]({'where':{'id':_0x8609e8[_0x2b4a('0x46')]['id']}})[_0x2b4a('0x22')](handleEntityNotFound(_0x50bb1f,null))['then'](saveUpdates(_0x8609e8[_0x2b4a('0x44')],null))[_0x2b4a('0x22')](respondWithResult(_0x50bb1f,null))[_0x2b4a('0x42')](handleError(_0x50bb1f,null));};exports[_0x2b4a('0x47')]=function(_0x16fa05,_0x352f85){return db[_0x2b4a('0x28')][_0x2b4a('0x45')]({'where':{'id':_0x16fa05[_0x2b4a('0x46')]['id']}})[_0x2b4a('0x22')](handleEntityNotFound(_0x352f85,null))[_0x2b4a('0x22')](removeEntity(_0x352f85,null))[_0x2b4a('0x42')](handleError(_0x352f85,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 939edcb..c150832 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 _0x4aad=['FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','int_salesforce_fields','idField'];(function(_0x49c3f0,_0x4bb280){var _0x25689e=function(_0x427247){while(--_0x427247){_0x49c3f0['push'](_0x49c3f0['shift']());}};_0x25689e(++_0x4bb280);}(_0x4aad,0x175));var _0xd4aa=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x4aad[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0xd4aa('0x0'));var logger=require(_0xd4aa('0x1'))(_0xd4aa('0x2'));var moment=require(_0xd4aa('0x3'));var BPromise=require(_0xd4aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4aa('0x5'));var rimraf=require(_0xd4aa('0x6'));var config=require(_0xd4aa('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0xd4aa('0x8')]=function(_0x57cc7a,_0x3ecc31){return _0x57cc7a['define']('SalesforceField',attributes,{'tableName':_0xd4aa('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xd4aa('0xa'),_0xd4aa('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e0d=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3874ab,_0x1e2dec){var _0x3b90e8=function(_0x7ab124){while(--_0x7ab124){_0x3874ab['push'](_0x3874ab['shift']());}};_0x3b90e8(++_0x1e2dec);}(_0x6e0d,0x9e));var _0xd6e0=function(_0x52b06b,_0x530b98){_0x52b06b=_0x52b06b-0x0;var _0x521d04=_0x6e0d[_0x52b06b];return _0x521d04;};'use strict';var _=require('lodash');var util=require(_0xd6e0('0x0'));var logger=require(_0xd6e0('0x1'))(_0xd6e0('0x2'));var moment=require(_0xd6e0('0x3'));var BPromise=require(_0xd6e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6e0('0x5'));var rimraf=require(_0xd6e0('0x6'));var config=require(_0xd6e0('0x7'));var attributes=require(_0xd6e0('0x8'));module[_0xd6e0('0x9')]=function(_0x4a0330,_0x5bc42b){return _0x4a0330[_0xd6e0('0xa')](_0xd6e0('0xb'),attributes,{'tableName':_0xd6e0('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xd6e0('0xd'),_0xd6e0('0xe')],'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 0bdd8a4..e079a73 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 _0x1e6b=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','SalesforceField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x44caf4,_0x238750){var _0x117cad=function(_0x3e64c8){while(--_0x3e64c8){_0x44caf4['push'](_0x44caf4['shift']());}};_0x117cad(++_0x238750);}(_0x1e6b,0x1dc));var _0xb1e6=function(_0x15b742,_0x3c0f98){_0x15b742=_0x15b742-0x0;var _0x36a6c5=_0x1e6b[_0x15b742];return _0x36a6c5;};'use strict';var _=require(_0xb1e6('0x0'));var util=require(_0xb1e6('0x1'));var moment=require(_0xb1e6('0x2'));var BPromise=require(_0xb1e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1e6('0x4'))['db'];var utils=require(_0xb1e6('0x5'));var logger=require(_0xb1e6('0x6'))(_0xb1e6('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1e6('0x8'));var client=jayson[_0xb1e6('0x9')][_0xb1e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x233613,_0x339231,_0x427804){return new BPromise(function(_0x39b68d,_0x564978){return client[_0xb1e6('0xb')](_0x233613,_0x427804)[_0xb1e6('0xc')](function(_0x36b36d){logger[_0xb1e6('0xd')]('SalesforceField,\x20%s,\x20%s',_0x339231,_0xb1e6('0xe'));logger[_0xb1e6('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x339231,'request\x20sent',JSON['stringify'](_0x36b36d));if(_0x36b36d[_0xb1e6('0x10')]){if(_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x11')]===0x1f4){logger[_0xb1e6('0x10')](_0xb1e6('0x12'),_0x339231,_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x13')]);return _0x564978(_0x36b36d['error'][_0xb1e6('0x13')]);}logger[_0xb1e6('0x10')](_0xb1e6('0x12'),_0x339231,_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x13')]);return _0x39b68d(_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x13')]);}else{logger[_0xb1e6('0xd')](_0xb1e6('0x12'),_0x339231,'request\x20sent');_0x39b68d(_0x36b36d[_0xb1e6('0x14')][_0xb1e6('0x13')]);}})['catch'](function(_0x520aac){logger[_0xb1e6('0x10')]('SalesforceField,\x20%s,\x20%s',_0x339231,_0x520aac);_0x564978(_0x520aac);});});} \ No newline at end of file +var _0x5e3a=['../../config/environment','jayson/promise','client','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x430953,_0x4b6180){var _0x2945b=function(_0x176676){while(--_0x176676){_0x430953['push'](_0x430953['shift']());}};_0x2945b(++_0x4b6180);}(_0x5e3a,0xf6));var _0xa5e3=function(_0x592a89,_0x54ad3d){_0x592a89=_0x592a89-0x0;var _0x537c37=_0x5e3a[_0x592a89];return _0x537c37;};'use strict';var _=require(_0xa5e3('0x0'));var util=require(_0xa5e3('0x1'));var moment=require(_0xa5e3('0x2'));var BPromise=require(_0xa5e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5e3('0x4'))['db'];var utils=require(_0xa5e3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5e3('0x6'));var jayson=require(_0xa5e3('0x7'));var client=jayson[_0xa5e3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3df254,_0x1eae2a,_0x2b19bf){return new BPromise(function(_0xbc58a,_0x495706){return client[_0xa5e3('0x9')](_0x3df254,_0x2b19bf)[_0xa5e3('0xa')](function(_0x1ef4ac){logger['info'](_0xa5e3('0xb'),_0x1eae2a,_0xa5e3('0xc'));logger[_0xa5e3('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1eae2a,'request\x20sent',JSON['stringify'](_0x1ef4ac));if(_0x1ef4ac[_0xa5e3('0xe')]){if(_0x1ef4ac[_0xa5e3('0xe')][_0xa5e3('0xf')]===0x1f4){logger[_0xa5e3('0xe')]('SalesforceField,\x20%s,\x20%s',_0x1eae2a,_0x1ef4ac[_0xa5e3('0xe')][_0xa5e3('0x10')]);return _0x495706(_0x1ef4ac['error'][_0xa5e3('0x10')]);}logger[_0xa5e3('0xe')](_0xa5e3('0xb'),_0x1eae2a,_0x1ef4ac['error'][_0xa5e3('0x10')]);return _0xbc58a(_0x1ef4ac[_0xa5e3('0xe')][_0xa5e3('0x10')]);}else{logger['info'](_0xa5e3('0xb'),_0x1eae2a,_0xa5e3('0xc'));_0xbc58a(_0x1ef4ac['result']['message']);}})[_0xa5e3('0x11')](function(_0x111fe3){logger[_0xa5e3('0xe')](_0xa5e3('0xb'),_0x1eae2a,_0x111fe3);_0x495706(_0x111fe3);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 5ca5534..5ed6ca7 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 _0x0f49=['../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x0f49,0xb2));var _0x90f4=function(_0x3a9815,_0x47eb16){_0x3a9815=_0x3a9815-0x0;var _0x188653=_0x0f49[_0x3a9815];return _0x188653;};'use strict';var multer=require('multer');var util=require(_0x90f4('0x0'));var path=require(_0x90f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x90f4('0x2'));var router=express[_0x90f4('0x3')]();var fs_extra=require(_0x90f4('0x4'));var auth=require(_0x90f4('0x5'));var interaction=require(_0x90f4('0x6'));var config=require(_0x90f4('0x7'));var controller=require(_0x90f4('0x8'));router[_0x90f4('0x9')]('/',auth[_0x90f4('0xa')](),controller[_0x90f4('0xb')]);router[_0x90f4('0x9')]('/:id',auth[_0x90f4('0xa')](),controller[_0x90f4('0xc')]);router[_0x90f4('0x9')](_0x90f4('0xd'),auth[_0x90f4('0xa')](),controller[_0x90f4('0xe')]);router[_0x90f4('0x9')](_0x90f4('0xf'),auth[_0x90f4('0xa')](),controller['getFields']);router[_0x90f4('0x10')]('/',auth[_0x90f4('0xa')](),controller[_0x90f4('0x11')]);router[_0x90f4('0x10')](_0x90f4('0xd'),auth[_0x90f4('0xa')](),controller[_0x90f4('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x90f4('0x13')]);router[_0x90f4('0x14')](_0x90f4('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x90f4('0x16')]=router; \ No newline at end of file +var _0xbbdc=['get','isAuthenticated','index','getFields','create','post','/:id/configurations','addConfiguration','put','/:id','exports','multer','util','../../components/interaction/service','./intServicenowAccount.controller'];(function(_0xc89e63,_0x598838){var _0xb8c874=function(_0x535aaa){while(--_0x535aaa){_0xc89e63['push'](_0xc89e63['shift']());}};_0xb8c874(++_0x598838);}(_0xbbdc,0x1eb));var _0xcbbd=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0xbbdc[_0x43026b];return _0x4a96cd;};'use strict';var multer=require(_0xcbbd('0x0'));var util=require(_0xcbbd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcbbd('0x2'));var config=require('../../config/environment');var controller=require(_0xcbbd('0x3'));router[_0xcbbd('0x4')]('/',auth[_0xcbbd('0x5')](),controller[_0xcbbd('0x6')]);router[_0xcbbd('0x4')]('/:id',auth[_0xcbbd('0x5')](),controller['show']);router['get']('/:id/configurations',auth[_0xcbbd('0x5')](),controller['getConfigurations']);router[_0xcbbd('0x4')]('/:id/fields',auth[_0xcbbd('0x5')](),controller[_0xcbbd('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcbbd('0x8')]);router[_0xcbbd('0x9')](_0xcbbd('0xa'),auth[_0xcbbd('0x5')](),controller[_0xcbbd('0xb')]);router[_0xcbbd('0xc')](_0xcbbd('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcbbd('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xcbbd('0xe')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 79ddb93..e4272b8 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 _0xf0dd=['sequelize','STRING','username','remoteUri'];(function(_0x1cbfe1,_0x50e351){var _0x462030=function(_0x572c21){while(--_0x572c21){_0x1cbfe1['push'](_0x1cbfe1['shift']());}};_0x462030(++_0x50e351);}(_0xf0dd,0x84));var _0xdf0d=function(_0x226212,_0x3471a3){_0x226212=_0x226212-0x0;var _0x37e7bf=_0xf0dd[_0x226212];return _0x37e7bf;};'use strict';var Sequelize=require(_0xdf0d('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf0d('0x1')]},'description':{'type':Sequelize[_0xdf0d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xdf0d('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xdf0d('0x1')]},'remoteUri':{'type':Sequelize[_0xdf0d('0x1')],'unique':_0xdf0d('0x3')},'serverUrl':{'type':Sequelize[_0xdf0d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7ce4=['username','remoteUri','sequelize','exports','STRING'];(function(_0xa30ffb,_0x91bee0){var _0x165256=function(_0x9b44c9){while(--_0x9b44c9){_0xa30ffb['push'](_0xa30ffb['shift']());}};_0x165256(++_0x91bee0);}(_0x7ce4,0x138));var _0x47ce=function(_0xbb8eba,_0x4eeb8b){_0xbb8eba=_0xbb8eba-0x0;var _0x26534f=_0x7ce4[_0xbb8eba];return _0x26534f;};'use strict';var Sequelize=require(_0x47ce('0x0'));module[_0x47ce('0x1')]={'name':{'type':Sequelize[_0x47ce('0x2')]},'description':{'type':Sequelize[_0x47ce('0x2')]},'username':{'type':Sequelize[_0x47ce('0x2')],'unique':_0x47ce('0x3')},'password':{'type':Sequelize[_0x47ce('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x47ce('0x2')],'unique':_0x47ce('0x4')},'serverUrl':{'type':Sequelize[_0x47ce('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 29840d5..82a1bfa 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 _0x0d00=['includes','forEach','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','statusCode','test','boolean','true','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','rawAttributes','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','catch','show','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','filters','length','hasOwnProperty','AccountId','Subjects','channel','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','work_notes','short_description','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','escalation','upon_approval','correlation_id','location','category','username','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove'];(function(_0x50efab,_0x44bb23){var _0x3d83b2=function(_0x231b40){while(--_0x231b40){_0x50efab['push'](_0x50efab['shift']());}};_0x3d83b2(++_0x44bb23);}(_0x0d00,0x186));var _0x00d0=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x0d00[_0x590b63];return _0x3c9380;};'use strict';var emlformat=require(_0x00d0('0x0'));var rimraf=require(_0x00d0('0x1'));var zipdir=require(_0x00d0('0x2'));var jsonpatch=require(_0x00d0('0x3'));var rp=require(_0x00d0('0x4'));var moment=require('moment');var BPromise=require(_0x00d0('0x5'));var Mustache=require(_0x00d0('0x6'));var util=require(_0x00d0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x00d0('0x8'));var ejs=require(_0x00d0('0x9'));var fs=require('fs');var fs_extra=require(_0x00d0('0xa'));var _=require(_0x00d0('0xb'));var squel=require(_0x00d0('0xc'));var crypto=require(_0x00d0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x00d0('0xe'));var toCsv=require(_0x00d0('0x8'));var querystring=require(_0x00d0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00d0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x00d0('0x11'));var hardwareService=require(_0x00d0('0x12'));var logger=require(_0x00d0('0x13'))(_0x00d0('0x14'));var utils=require(_0x00d0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x00d0('0x16'));var db=require(_0x00d0('0x17'))['db'];var integrations=require(_0x00d0('0x18'));var jayson=require(_0x00d0('0x19'));var client=jayson[_0x00d0('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3f7a,_0x1dd312,_0x4da1b5,_0xaf4c17){return new BPromise(function(_0x930248,_0xe7b506){var _0x341ef9=_0xaf4c17||client;return _0x341ef9[_0x00d0('0x1b')](_0x4a3f7a,_0x4da1b5)[_0x00d0('0x1c')](function(_0x3063c3){logger[_0x00d0('0x1d')](_0x00d0('0x1e'),_0x1dd312,_0x00d0('0x1f'));logger[_0x00d0('0x20')](_0x00d0('0x21'),_0x1dd312,'request\x20sent',JSON['stringify'](_0x3063c3));if(_0x3063c3[_0x00d0('0x22')]){if(_0x3063c3[_0x00d0('0x22')][_0x00d0('0x23')]===0x1f4){logger[_0x00d0('0x22')](_0x00d0('0x1e'),_0x1dd312,_0x3063c3[_0x00d0('0x22')][_0x00d0('0x24')]);return _0xe7b506(_0x3063c3[_0x00d0('0x22')]['message']);}logger[_0x00d0('0x22')](_0x00d0('0x1e'),_0x1dd312,_0x3063c3[_0x00d0('0x22')][_0x00d0('0x24')]);return _0x930248(_0x3063c3[_0x00d0('0x22')][_0x00d0('0x24')]);}else{logger[_0x00d0('0x1d')](_0x00d0('0x1e'),_0x1dd312,_0x00d0('0x1f'));_0x930248(_0x3063c3['result'][_0x00d0('0x24')]);}})['catch'](function(_0x2c4c77){logger[_0x00d0('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x1dd312,_0x2c4c77);_0xe7b506(_0x2c4c77);});});}function respondWithStatusCode(_0x564eeb,_0x3dce43){_0x3dce43=_0x3dce43||0xcc;return function(_0x583ccc){if(_0x583ccc){return _0x564eeb[_0x00d0('0x25')](_0x3dce43);}return _0x564eeb[_0x00d0('0x26')](_0x3dce43)[_0x00d0('0x27')]();};}function respondWithResult(_0x45c0a0,_0x41213b){_0x41213b=_0x41213b||0xc8;return function(_0x596348){if(_0x596348){return _0x45c0a0[_0x00d0('0x26')](_0x41213b)[_0x00d0('0x28')](_0x596348);}};}function respondWithFilteredResult(_0x463c82,_0x57d57e){return function(_0x1981f0){if(_0x1981f0){var _0x4d62cb=typeof _0x57d57e[_0x00d0('0x29')]===_0x00d0('0x2a')&&typeof _0x57d57e[_0x00d0('0x2b')]===_0x00d0('0x2a');var _0x2c4ab2=_0x1981f0[_0x00d0('0x2c')];var _0x334ecc=_0x4d62cb?0x0:_0x57d57e[_0x00d0('0x29')];var _0x3e1828=_0x4d62cb?_0x1981f0[_0x00d0('0x2c')]:_0x57d57e[_0x00d0('0x29')]+_0x57d57e[_0x00d0('0x2b')];var _0x426c87;if(_0x3e1828>=_0x2c4ab2){_0x3e1828=_0x2c4ab2;_0x426c87=0xc8;}else{_0x426c87=0xce;}_0x463c82['status'](_0x426c87);return _0x463c82[_0x00d0('0x2d')](_0x00d0('0x2e'),_0x334ecc+'-'+_0x3e1828+'/'+_0x2c4ab2)[_0x00d0('0x28')](_0x1981f0);}return null;};}function patchUpdates(_0x3ef727){return function(_0x54b044){try{jsonpatch[_0x00d0('0x2f')](_0x54b044,_0x3ef727,!![]);}catch(_0x4361e1){return BPromise['reject'](_0x4361e1);}return _0x54b044[_0x00d0('0x30')]();};}function saveUpdates(_0x1c3fba,_0x3a292e){return function(_0x153958){if(_0x153958){return _0x153958[_0x00d0('0x31')](_0x1c3fba)['then'](function(_0x38d3b7){return _0x38d3b7;});}return null;};}function removeEntity(_0x5cafad,_0x25fd84){return function(_0x1cb040){if(_0x1cb040){return _0x1cb040[_0x00d0('0x32')]()['then'](function(){_0x5cafad['status'](0xcc)[_0x00d0('0x27')]();});}};}function handleEntityNotFound(_0x43f3bb,_0x388202){return function(_0x55ba21){if(!_0x55ba21){_0x43f3bb[_0x00d0('0x25')](0x194);}return _0x55ba21;};}function handleError(_0x490c18,_0x125b98){_0x125b98=_0x125b98||0x1f4;return function(_0x29b1b3){logger[_0x00d0('0x22')](_0x29b1b3[_0x00d0('0x33')]);if(_0x29b1b3['name']){delete _0x29b1b3[_0x00d0('0x34')];}_0x490c18[_0x00d0('0x26')](_0x125b98)[_0x00d0('0x35')](_0x29b1b3);};}exports[_0x00d0('0x36')]=function(_0x16f56d,_0x3f89b8){var _0x2281cf={},_0x5a0f69={},_0x532ba9={'count':0x0,'rows':[]};var _0x160fa3=_[_0x00d0('0x37')](db['ServicenowAccount'][_0x00d0('0x38')],function(_0x4bfc6c){return{'name':_0x4bfc6c['fieldName'],'type':_0x4bfc6c['type'][_0x00d0('0x39')]};});_0x5a0f69[_0x00d0('0x3a')]=_[_0x00d0('0x37')](_0x160fa3,'name');_0x5a0f69[_0x00d0('0x3b')]=_[_0x00d0('0x3c')](_0x16f56d[_0x00d0('0x3b')]);_0x5a0f69['filters']=_[_0x00d0('0x3d')](_0x5a0f69[_0x00d0('0x3a')],_0x5a0f69[_0x00d0('0x3b')]);_0x2281cf['attributes']=_[_0x00d0('0x3d')](_0x5a0f69[_0x00d0('0x3a')],qs[_0x00d0('0x3e')](_0x16f56d['query'][_0x00d0('0x3e')]));_0x2281cf[_0x00d0('0x3f')]=_0x2281cf[_0x00d0('0x3f')]['length']?_0x2281cf[_0x00d0('0x3f')]:_0x5a0f69[_0x00d0('0x3a')];if(!_0x16f56d[_0x00d0('0x3b')]['hasOwnProperty'](_0x00d0('0x40'))){_0x2281cf[_0x00d0('0x2b')]=qs[_0x00d0('0x2b')](_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x2b')]);_0x2281cf[_0x00d0('0x29')]=qs[_0x00d0('0x29')](_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x29')]);}_0x2281cf[_0x00d0('0x41')]=qs[_0x00d0('0x42')](_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x42')]);_0x2281cf[_0x00d0('0x43')]=qs['filters'](_[_0x00d0('0x44')](_0x16f56d[_0x00d0('0x3b')],_0x5a0f69['filters']),_0x160fa3);if(_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x45')]){_0x2281cf[_0x00d0('0x43')]=_[_0x00d0('0x46')](_0x2281cf['where'],{'$or':_[_0x00d0('0x37')](_0x160fa3,function(_0x49e208){if(_0x49e208[_0x00d0('0x47')]!==_0x00d0('0x48')){var _0x5d388f={};_0x5d388f[_0x49e208[_0x00d0('0x34')]]={'$like':'%'+_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x45')]+'%'};return _0x5d388f;}})});}_0x2281cf=_[_0x00d0('0x46')]({},_0x2281cf,_0x16f56d[_0x00d0('0x49')]);var _0x2db28e={'where':_0x2281cf[_0x00d0('0x43')]};return db[_0x00d0('0x4a')][_0x00d0('0x2c')](_0x2db28e)[_0x00d0('0x1c')](function(_0x23db37){_0x532ba9[_0x00d0('0x2c')]=_0x23db37;if(_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x4b')]){_0x2281cf[_0x00d0('0x4c')]=[{'all':!![]}];}return db[_0x00d0('0x4a')][_0x00d0('0x4d')](_0x2281cf);})[_0x00d0('0x1c')](function(_0x16c96b){_0x532ba9['rows']=_0x16c96b;return _0x532ba9;})['then'](respondWithFilteredResult(_0x3f89b8,_0x2281cf))[_0x00d0('0x4e')](handleError(_0x3f89b8,null));};exports[_0x00d0('0x4f')]=function(_0x2348e8,_0x3458e4){var _0x15a1a2={'raw':![],'where':{'id':_0x2348e8['params']['id']}},_0x4395f6={};_0x4395f6[_0x00d0('0x3a')]=_[_0x00d0('0x3c')](db[_0x00d0('0x4a')][_0x00d0('0x38')]);_0x4395f6[_0x00d0('0x3b')]=_['keys'](_0x2348e8[_0x00d0('0x3b')]);_0x4395f6['filters']=_[_0x00d0('0x3d')](_0x4395f6['model'],_0x4395f6['query']);_0x15a1a2[_0x00d0('0x3f')]=_[_0x00d0('0x3d')](_0x4395f6[_0x00d0('0x3a')],qs['fields'](_0x2348e8[_0x00d0('0x3b')][_0x00d0('0x3e')]));_0x15a1a2[_0x00d0('0x3f')]=_0x15a1a2['attributes']['length']?_0x15a1a2[_0x00d0('0x3f')]:_0x4395f6[_0x00d0('0x3a')];if(_0x2348e8['query'][_0x00d0('0x4b')]){_0x15a1a2[_0x00d0('0x4c')]=[{'all':!![]}];}_0x15a1a2=_['merge']({},_0x15a1a2,_0x2348e8[_0x00d0('0x49')]);return db[_0x00d0('0x4a')][_0x00d0('0x50')](_0x15a1a2)[_0x00d0('0x1c')](handleEntityNotFound(_0x3458e4,null))[_0x00d0('0x1c')](respondWithResult(_0x3458e4,null))[_0x00d0('0x4e')](handleError(_0x3458e4,null));};exports[_0x00d0('0x51')]=function(_0x51dba5,_0x46fb08){return db['ServicenowAccount']['create'](_0x51dba5[_0x00d0('0x52')],{})[_0x00d0('0x1c')](respondWithResult(_0x46fb08,0xc9))[_0x00d0('0x4e')](handleError(_0x46fb08,null));};exports[_0x00d0('0x31')]=function(_0x4b6a11,_0x1d42ba){if(_0x4b6a11[_0x00d0('0x52')]['id']){delete _0x4b6a11[_0x00d0('0x52')]['id'];}return db[_0x00d0('0x4a')][_0x00d0('0x50')]({'where':{'id':_0x4b6a11[_0x00d0('0x53')]['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x1d42ba,null))[_0x00d0('0x1c')](saveUpdates(_0x4b6a11[_0x00d0('0x52')],null))[_0x00d0('0x1c')](respondWithResult(_0x1d42ba,null))[_0x00d0('0x4e')](handleError(_0x1d42ba,null));};exports[_0x00d0('0x32')]=function(_0x26b541,_0x508e3f){return db[_0x00d0('0x4a')][_0x00d0('0x50')]({'where':{'id':_0x26b541[_0x00d0('0x53')]['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x508e3f,null))[_0x00d0('0x1c')](removeEntity(_0x508e3f,null))[_0x00d0('0x4e')](handleError(_0x508e3f,null));};exports[_0x00d0('0x54')]=function(_0x407e2c,_0x556dee,_0x2e5687){var _0x163c85={};var _0x1a9fa5={};var _0x49edcd;var _0xd489bf;return db[_0x00d0('0x4a')][_0x00d0('0x55')]({'where':{'id':_0x407e2c[_0x00d0('0x53')]['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x556dee,null))[_0x00d0('0x1c')](function(_0x2027ce){if(_0x2027ce){_0x49edcd=_0x2027ce;_0x1a9fa5[_0x00d0('0x3a')]=_['keys'](db[_0x00d0('0x56')][_0x00d0('0x38')]);_0x1a9fa5[_0x00d0('0x3b')]=_[_0x00d0('0x3c')](_0x407e2c[_0x00d0('0x3b')]);_0x1a9fa5[_0x00d0('0x57')]=_[_0x00d0('0x3d')](_0x1a9fa5[_0x00d0('0x3a')],_0x1a9fa5[_0x00d0('0x3b')]);_0x163c85[_0x00d0('0x3f')]=_['intersection'](_0x1a9fa5[_0x00d0('0x3a')],qs[_0x00d0('0x3e')](_0x407e2c['query'][_0x00d0('0x3e')]));_0x163c85['attributes']=_0x163c85[_0x00d0('0x3f')][_0x00d0('0x58')]?_0x163c85[_0x00d0('0x3f')]:_0x1a9fa5[_0x00d0('0x3a')];_0x163c85[_0x00d0('0x41')]=qs['sort'](_0x407e2c['query'][_0x00d0('0x42')]);_0x163c85[_0x00d0('0x43')]=qs[_0x00d0('0x57')](_[_0x00d0('0x44')](_0x407e2c[_0x00d0('0x3b')],_0x1a9fa5[_0x00d0('0x57')]));if(_0x407e2c['query'][_0x00d0('0x45')]){_0x163c85[_0x00d0('0x43')]=_['merge'](_0x163c85['where'],{'$or':_[_0x00d0('0x37')](_0x163c85[_0x00d0('0x3f')],function(_0x85fa7e){var _0x3e7dd1={};_0x3e7dd1[_0x85fa7e]={'$like':'%'+_0x407e2c[_0x00d0('0x3b')][_0x00d0('0x45')]+'%'};return _0x3e7dd1;})});}_0x163c85=_['merge']({},_0x163c85,_0x407e2c[_0x00d0('0x49')]);return _0x49edcd['getConfigurations'](_0x163c85);}})['then'](function(_0x97df65){if(_0x97df65){_0xd489bf=_0x97df65[_0x00d0('0x58')];if(!_0x407e2c[_0x00d0('0x3b')][_0x00d0('0x59')](_0x00d0('0x40'))){_0x163c85[_0x00d0('0x2b')]=qs[_0x00d0('0x2b')](_0x407e2c[_0x00d0('0x3b')][_0x00d0('0x2b')]);_0x163c85['offset']=qs[_0x00d0('0x29')](_0x407e2c['query']['offset']);}return _0x49edcd[_0x00d0('0x54')](_0x163c85);}})[_0x00d0('0x1c')](function(_0x412853){if(_0x412853){return _0x412853?{'count':_0xd489bf,'rows':_0x412853}:null;}})[_0x00d0('0x1c')](respondWithResult(_0x556dee,null))[_0x00d0('0x4e')](handleError(_0x556dee,null));};exports['addConfiguration']=function(_0x3d3eaa,_0x32a6c7,_0x29960b){if(_0x3d3eaa[_0x00d0('0x52')]['id']){delete _0x3d3eaa['body']['id'];}return db['ServicenowAccount'][_0x00d0('0x55')]({'where':{'id':_0x3d3eaa['params']['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x32a6c7,null))['then'](function(_0xedb25d){if(_0xedb25d){_0x3d3eaa[_0x00d0('0x52')][_0x00d0('0x5a')]=_0xedb25d['id'];_0x3d3eaa['body'][_0x00d0('0x5b')]=integrations['getSubjects'](_0x3d3eaa[_0x00d0('0x52')]['channel'],_0x3d3eaa['body'][_0x00d0('0x47')]);_0x3d3eaa[_0x00d0('0x52')]['Descriptions']=integrations['getDescriptions'](_0x3d3eaa['body'][_0x00d0('0x5c')],_0x3d3eaa[_0x00d0('0x52')][_0x00d0('0x47')]);return db[_0x00d0('0x56')][_0x00d0('0x51')](_0x3d3eaa[_0x00d0('0x52')],{'include':[{'model':db[_0x00d0('0x5d')],'as':_0x00d0('0x5b')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x32a6c7,null))[_0x00d0('0x4e')](handleError(_0x32a6c7,null));};exports[_0x00d0('0x5e')]=function(_0x3bea08,_0x49f1d0,_0x2a4271){var _0x45d202=['made_sla',_0x00d0('0x5f'),_0x00d0('0x60'),_0x00d0('0x61'),_0x00d0('0x62'),_0x00d0('0x63'),_0x00d0('0x64'),_0x00d0('0x65'),'category'];var _0x3e2897=[_0x00d0('0x66'),_0x00d0('0x67'),_0x00d0('0x68'),_0x00d0('0x69'),_0x00d0('0x6a'),_0x00d0('0x6b'),'child_incidents','hold_reason',_0x00d0('0x6c'),_0x00d0('0x6d'),_0x00d0('0x6e'),_0x00d0('0x6f'),_0x00d0('0x70'),'user_input',_0x00d0('0x71'),_0x00d0('0x72'),'state',_0x00d0('0x73'),_0x00d0('0x60'),_0x00d0('0x41'),_0x00d0('0x74'),_0x00d0('0x75'),_0x00d0('0x76'),_0x00d0('0x77'),'impact',_0x00d0('0x78'),_0x00d0('0x79'),'business_service',_0x00d0('0x7a'),_0x00d0('0x7b'),_0x00d0('0x7c'),_0x00d0('0x7d'),_0x00d0('0x7e'),_0x00d0('0x7f'),_0x00d0('0x80'),'group_list',_0x00d0('0x81'),'reopened_time','resolved_at','caller_id','approval_set',_0x00d0('0x61'),_0x00d0('0x82'),_0x00d0('0x83'),_0x00d0('0x62'),_0x00d0('0x84'),'delivery_task','work_start',_0x00d0('0x85'),_0x00d0('0x86'),_0x00d0('0x87'),_0x00d0('0x88'),_0x00d0('0x89'),_0x00d0('0x63'),'sys_class_name',_0x00d0('0x8a'),_0x00d0('0x8b'),'follow_up','parent_incident','sys_id','contact_type',_0x00d0('0x8c'),_0x00d0('0x64'),_0x00d0('0x8d'),_0x00d0('0x8e'),_0x00d0('0x8f'),_0x00d0('0x90'),_0x00d0('0x91'),_0x00d0('0x92'),_0x00d0('0x65'),_0x00d0('0x93'),_0x00d0('0x94'),_0x00d0('0x95'),_0x00d0('0x96'),_0x00d0('0x97'),'sys_mod_count','reopen_count','sys_tags',_0x00d0('0x98'),_0x00d0('0x99'),_0x00d0('0x9a'),_0x00d0('0x9b'),_0x00d0('0x9c')];var _0x10fb54='';var _0x21bae0='';var _0x4c56a2=[];var _0x2289b4='';var _0x2562ae='';var _0x2c7468=[];var _0x1823d7='';var _0x9b84b4='';var _0x4a39fd={};var _0x4569cc='';return db['ServicenowAccount'][_0x00d0('0x55')]({'where':{'id':_0x3bea08[_0x00d0('0x53')]['id']},'attributes':['id',_0x00d0('0x9d'),'password',_0x00d0('0x9e'),_0x00d0('0x9f'),'serverUrl']})[_0x00d0('0x1c')](handleEntityNotFound(_0x49f1d0,null))[_0x00d0('0x1c')](function(_0xdd9404){if(_0xdd9404){_0x4569cc=_0xdd9404[_0x00d0('0x9f')];var _0x1a4582=_0x4569cc[_0x00d0('0xa0')](-0x1);if(_0x1a4582==='/'){_0x4569cc=_0x4569cc[_0x00d0('0xa1')](0x0,_0x4569cc[_0x00d0('0xa2')](_0x1a4582));}_0x9b84b4=util[_0x00d0('0xa3')](_0x00d0('0xa4'),_0x4569cc);_0x1823d7=util[_0x00d0('0xa3')](_0x00d0('0xa5'),_0x4569cc);_0x4a39fd={'user':_0xdd9404[_0x00d0('0x9d')],'pass':_0xdd9404[_0x00d0('0xa6')]};var _0xf08fed={'method':_0x00d0('0xa7'),'uri':_0x9b84b4+_0x00d0('0xa8'),'auth':_0x4a39fd,'json':!![]};return rp(_0xf08fed);}})['then'](function(_0x26a45f){if(_0x26a45f[_0x00d0('0xa9')][_0x00d0('0x58')]>0x0){_0x10fb54=_0x26a45f[_0x00d0('0xa9')];}console[_0x00d0('0xaa')](_0x00d0('0xab'),_0x10fb54);_0x2c7468=[];_0x21bae0=Object[_0x00d0('0xac')]([],_0x10fb54);_[_0x00d0('0xad')](_0x21bae0,function(_0x41c2ba){return!_0x45d202[_0x00d0('0xae')](_0x41c2ba[_0x00d0('0x34')]);});_0x21bae0[_0x00d0('0xaf')](function(_0x12bf71){var _0x2a51e4=createFieldObject(_0x1823d7,_0x4a39fd,_0x12bf71['internalType'],_0x12bf71[_0x00d0('0x34')],_0x12bf71[_0x00d0('0xb0')],![]);_0x2c7468[_0x00d0('0xb1')](_0x2a51e4);});return Promise[_0x00d0('0xb2')](_0x2c7468);})[_0x00d0('0x1c')](function(_0x5d4afb){_0x4c56a2=_0x5d4afb;_0x2289b4=Object['assign']([],_0x10fb54);console[_0x00d0('0xaa')](_0x00d0('0xb3'),_0x10fb54);_[_0x00d0('0xad')](_0x2289b4,function(_0x4246f7){return _0x3e2897[_0x00d0('0xae')](_0x4246f7[_0x00d0('0x34')]);});console[_0x00d0('0xaa')](_0x00d0('0xb4'),_0x2289b4);_0x2c7468=[];_0x2289b4['forEach'](function(_0x39b8f6){var _0xae0382=createFieldObject(_0x1823d7,_0x4a39fd,_0x39b8f6[_0x00d0('0xb5')],_0x39b8f6[_0x00d0('0x34')],_0x39b8f6[_0x00d0('0xb0')],!![]);_0x2c7468[_0x00d0('0xb1')](_0xae0382);});return Promise[_0x00d0('0xb2')](_0x2c7468);})['then'](function(_0x30d2ff){_0x2562ae=_0x30d2ff;var _0xb3f9d2=_0x4c56a2[_0x00d0('0xb6')](_0x2562ae);return{'count':_0xb3f9d2[_0x00d0('0x58')],'rows':_0xb3f9d2};})[_0x00d0('0x1c')](respondWithResult(_0x49f1d0,null))[_0x00d0('0x4e')](function(_0x14fe2b){console[_0x00d0('0xaa')]('ServiceNow\x20error:\x20'+_0x14fe2b);var _0x502333=_0x3bea08['query']['test']?0x1f4:_0x14fe2b[_0x00d0('0xb7')]||0x1f4;logger[_0x00d0('0x22')](_0x14fe2b[_0x00d0('0x33')]);delete _0x14fe2b[_0x00d0('0x34')];if(_0x502333===0x191){_0x502333=0x190;}_0x49f1d0[_0x00d0('0x26')](_0x502333)['send'](_0x3bea08[_0x00d0('0x3b')][_0x00d0('0xb8')]?{'message':'Wrong\x20credentials','statusCode':_0x14fe2b['statusCode']}:_0x14fe2b);});};function createFieldObject(_0xc921e0,_0x5a5472,_0x47f27b,_0x243bdd,_0x37a51c,_0x37f90c){return new Promise(function(_0x348f21,_0x22aad7){var _0x1fa3ff={'id':_0x243bdd,'name':_0x37a51c,'custom':_0x37f90c};if(_0x47f27b===_0x00d0('0xb9')){_0x1fa3ff[_0x00d0('0x49')]=[{'name':'True','value':_0x00d0('0xba')},{'name':'False','value':'false'}];_0x348f21(_0x1fa3ff);}else{var _0x2a3a03={'method':'GET','uri':_0xc921e0+'sys_choice?sysparm_query=name=incident^element='+_0x243bdd,'auth':_0x5a5472,'json':!![]};return rp(_0x2a3a03)['then'](function(_0x3edeba){var _0x3c6507=[];if(_0x3edeba['result'][_0x00d0('0x58')]>0x0){_0x3edeba['result'][_0x00d0('0xaf')](function(_0x24ee20){if(_0x24ee20['inactive']===_0x00d0('0xbb')){var _0x214484={'name':_0x24ee20[_0x00d0('0xb0')],'value':_0x24ee20['value']};_0x3c6507[_0x00d0('0xb1')](_0x214484);}});}_0x1fa3ff[_0x00d0('0x49')]=_0x3c6507;if(_0x1fa3ff[_0x00d0('0x49')]['length']>0x0){_0x348f21(_0x1fa3ff);}else{if(_0x37f90c==![]){_0x348f21();}else{_0x348f21(_0x1fa3ff);}}});}});} \ No newline at end of file +var _0x39aa=['description','sys_class_name','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','password','email','remoteUri','serverUrl','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','assign','remove','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','stack','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','client','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','map','ServicenowAccount','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','Subjects','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list'];(function(_0x3ed91d,_0x5447b2){var _0xfbd6e7=function(_0x43e7c9){while(--_0x43e7c9){_0x3ed91d['push'](_0x3ed91d['shift']());}};_0xfbd6e7(++_0x5447b2);}(_0x39aa,0x1c2));var _0xa39a=function(_0x2dfd28,_0x153b3c){_0x2dfd28=_0x2dfd28-0x0;var _0x49c016=_0x39aa[_0x2dfd28];return _0x49c016;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa39a('0x0'));var zipdir=require(_0xa39a('0x1'));var jsonpatch=require(_0xa39a('0x2'));var rp=require(_0xa39a('0x3'));var moment=require(_0xa39a('0x4'));var BPromise=require(_0xa39a('0x5'));var Mustache=require(_0xa39a('0x6'));var util=require(_0xa39a('0x7'));var path=require('path');var sox=require(_0xa39a('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(_0xa39a('0x9'));var crypto=require('crypto');var jsforce=require(_0xa39a('0xa'));var deskjs=require(_0xa39a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa39a('0xc'));var Papa=require(_0xa39a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa39a('0xe'));var hardwareService=require(_0xa39a('0xf'));var logger=require(_0xa39a('0x10'))(_0xa39a('0x11'));var utils=require(_0xa39a('0x12'));var config=require(_0xa39a('0x13'));var licenseUtil=require(_0xa39a('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa39a('0x15'));var jayson=require('jayson/promise');var client=jayson[_0xa39a('0x16')][_0xa39a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x338048,_0x2b949a,_0x45043,_0x3df05e){return new BPromise(function(_0x3f9287,_0x3d2276){var _0x55146a=_0x3df05e||client;return _0x55146a[_0xa39a('0x18')](_0x338048,_0x45043)[_0xa39a('0x19')](function(_0x5ead2b){logger[_0xa39a('0x1a')]('ServicenowAccount,\x20%s,\x20%s',_0x2b949a,_0xa39a('0x1b'));logger[_0xa39a('0x1c')](_0xa39a('0x1d'),_0x2b949a,_0xa39a('0x1b'),JSON[_0xa39a('0x1e')](_0x5ead2b));if(_0x5ead2b['error']){if(_0x5ead2b[_0xa39a('0x1f')][_0xa39a('0x20')]===0x1f4){logger[_0xa39a('0x1f')](_0xa39a('0x21'),_0x2b949a,_0x5ead2b[_0xa39a('0x1f')][_0xa39a('0x22')]);return _0x3d2276(_0x5ead2b[_0xa39a('0x1f')][_0xa39a('0x22')]);}logger[_0xa39a('0x1f')](_0xa39a('0x21'),_0x2b949a,_0x5ead2b['error'][_0xa39a('0x22')]);return _0x3f9287(_0x5ead2b[_0xa39a('0x1f')][_0xa39a('0x22')]);}else{logger[_0xa39a('0x1a')](_0xa39a('0x21'),_0x2b949a,_0xa39a('0x1b'));_0x3f9287(_0x5ead2b['result'][_0xa39a('0x22')]);}})[_0xa39a('0x23')](function(_0x144c95){logger[_0xa39a('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0x2b949a,_0x144c95);_0x3d2276(_0x144c95);});});}function respondWithStatusCode(_0x28c5e7,_0x1c50a2){_0x1c50a2=_0x1c50a2||0xcc;return function(_0xe0d3c6){if(_0xe0d3c6){return _0x28c5e7['sendStatus'](_0x1c50a2);}return _0x28c5e7[_0xa39a('0x24')](_0x1c50a2)[_0xa39a('0x25')]();};}function respondWithResult(_0x1c414d,_0x36aae3){_0x36aae3=_0x36aae3||0xc8;return function(_0xfa86d5){if(_0xfa86d5){return _0x1c414d[_0xa39a('0x24')](_0x36aae3)['json'](_0xfa86d5);}};}function respondWithFilteredResult(_0x2d2c12,_0x17e91f){return function(_0x4fe8a3){if(_0x4fe8a3){var _0x457f07=typeof _0x17e91f[_0xa39a('0x26')]===_0xa39a('0x27')&&typeof _0x17e91f['limit']==='undefined';var _0x3ce20d=_0x4fe8a3[_0xa39a('0x28')];var _0x4266f7=_0x457f07?0x0:_0x17e91f['offset'];var _0x58951c=_0x457f07?_0x4fe8a3[_0xa39a('0x28')]:_0x17e91f[_0xa39a('0x26')]+_0x17e91f[_0xa39a('0x29')];var _0x3c351f;if(_0x58951c>=_0x3ce20d){_0x58951c=_0x3ce20d;_0x3c351f=0xc8;}else{_0x3c351f=0xce;}_0x2d2c12[_0xa39a('0x24')](_0x3c351f);return _0x2d2c12[_0xa39a('0x2a')](_0xa39a('0x2b'),_0x4266f7+'-'+_0x58951c+'/'+_0x3ce20d)[_0xa39a('0x2c')](_0x4fe8a3);}return null;};}function patchUpdates(_0x5c6aac){return function(_0xf2a50){try{jsonpatch[_0xa39a('0x2d')](_0xf2a50,_0x5c6aac,!![]);}catch(_0x7c0ad0){return BPromise[_0xa39a('0x2e')](_0x7c0ad0);}return _0xf2a50[_0xa39a('0x2f')]();};}function saveUpdates(_0x623e46,_0x229b08){return function(_0x411e74){if(_0x411e74){return _0x411e74[_0xa39a('0x30')](_0x623e46)[_0xa39a('0x19')](function(_0x3e3184){return _0x3e3184;});}return null;};}function removeEntity(_0x3c5be6,_0x4572b){return function(_0x3ac316){if(_0x3ac316){return _0x3ac316[_0xa39a('0x31')]()[_0xa39a('0x19')](function(){_0x3c5be6[_0xa39a('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2a116,_0x4e64d4){return function(_0x11d5d8){if(!_0x11d5d8){_0xb2a116[_0xa39a('0x32')](0x194);}return _0x11d5d8;};}function handleError(_0x29a3bb,_0x13be4b){_0x13be4b=_0x13be4b||0x1f4;return function(_0x271325){logger[_0xa39a('0x1f')](_0x271325['stack']);if(_0x271325['name']){delete _0x271325[_0xa39a('0x33')];}_0x29a3bb[_0xa39a('0x24')](_0x13be4b)[_0xa39a('0x34')](_0x271325);};}exports['index']=function(_0x32a4a4,_0x5e375c){var _0xe56726={},_0x37cc4b={},_0x2d6d6d={'count':0x0,'rows':[]};var _0x23de95=_[_0xa39a('0x35')](db[_0xa39a('0x36')]['rawAttributes'],function(_0x89d759){return{'name':_0x89d759[_0xa39a('0x37')],'type':_0x89d759['type'][_0xa39a('0x38')]};});_0x37cc4b[_0xa39a('0x39')]=_['map'](_0x23de95,_0xa39a('0x33'));_0x37cc4b[_0xa39a('0x3a')]=_[_0xa39a('0x3b')](_0x32a4a4[_0xa39a('0x3a')]);_0x37cc4b['filters']=_['intersection'](_0x37cc4b[_0xa39a('0x39')],_0x37cc4b['query']);_0xe56726['attributes']=_[_0xa39a('0x3c')](_0x37cc4b[_0xa39a('0x39')],qs[_0xa39a('0x3d')](_0x32a4a4[_0xa39a('0x3a')][_0xa39a('0x3d')]));_0xe56726[_0xa39a('0x3e')]=_0xe56726[_0xa39a('0x3e')][_0xa39a('0x3f')]?_0xe56726[_0xa39a('0x3e')]:_0x37cc4b[_0xa39a('0x39')];if(!_0x32a4a4['query'][_0xa39a('0x40')]('nolimit')){_0xe56726['limit']=qs[_0xa39a('0x29')](_0x32a4a4[_0xa39a('0x3a')][_0xa39a('0x29')]);_0xe56726['offset']=qs[_0xa39a('0x26')](_0x32a4a4[_0xa39a('0x3a')]['offset']);}_0xe56726[_0xa39a('0x41')]=qs[_0xa39a('0x42')](_0x32a4a4[_0xa39a('0x3a')][_0xa39a('0x42')]);_0xe56726['where']=qs[_0xa39a('0x43')](_[_0xa39a('0x44')](_0x32a4a4[_0xa39a('0x3a')],_0x37cc4b['filters']),_0x23de95);if(_0x32a4a4[_0xa39a('0x3a')][_0xa39a('0x45')]){_0xe56726[_0xa39a('0x46')]=_[_0xa39a('0x47')](_0xe56726[_0xa39a('0x46')],{'$or':_[_0xa39a('0x35')](_0x23de95,function(_0x5f23e9){if(_0x5f23e9[_0xa39a('0x48')]!==_0xa39a('0x49')){var _0x40a6e0={};_0x40a6e0[_0x5f23e9[_0xa39a('0x33')]]={'$like':'%'+_0x32a4a4['query'][_0xa39a('0x45')]+'%'};return _0x40a6e0;}})});}_0xe56726=_[_0xa39a('0x47')]({},_0xe56726,_0x32a4a4['options']);var _0x2c76a0={'where':_0xe56726[_0xa39a('0x46')]};return db[_0xa39a('0x36')][_0xa39a('0x28')](_0x2c76a0)[_0xa39a('0x19')](function(_0x43caf6){_0x2d6d6d[_0xa39a('0x28')]=_0x43caf6;if(_0x32a4a4[_0xa39a('0x3a')][_0xa39a('0x4a')]){_0xe56726[_0xa39a('0x4b')]=[{'all':!![]}];}return db[_0xa39a('0x36')][_0xa39a('0x4c')](_0xe56726);})[_0xa39a('0x19')](function(_0x366a27){_0x2d6d6d[_0xa39a('0x4d')]=_0x366a27;return _0x2d6d6d;})['then'](respondWithFilteredResult(_0x5e375c,_0xe56726))[_0xa39a('0x23')](handleError(_0x5e375c,null));};exports[_0xa39a('0x4e')]=function(_0x252d1f,_0x32b43f){var _0x2c5605={'raw':![],'where':{'id':_0x252d1f[_0xa39a('0x4f')]['id']}},_0x4b1d5a={};_0x4b1d5a[_0xa39a('0x39')]=_[_0xa39a('0x3b')](db[_0xa39a('0x36')]['rawAttributes']);_0x4b1d5a[_0xa39a('0x3a')]=_[_0xa39a('0x3b')](_0x252d1f['query']);_0x4b1d5a[_0xa39a('0x43')]=_[_0xa39a('0x3c')](_0x4b1d5a[_0xa39a('0x39')],_0x4b1d5a[_0xa39a('0x3a')]);_0x2c5605[_0xa39a('0x3e')]=_[_0xa39a('0x3c')](_0x4b1d5a['model'],qs['fields'](_0x252d1f[_0xa39a('0x3a')][_0xa39a('0x3d')]));_0x2c5605[_0xa39a('0x3e')]=_0x2c5605['attributes'][_0xa39a('0x3f')]?_0x2c5605[_0xa39a('0x3e')]:_0x4b1d5a['model'];if(_0x252d1f[_0xa39a('0x3a')][_0xa39a('0x4a')]){_0x2c5605[_0xa39a('0x4b')]=[{'all':!![]}];}_0x2c5605=_[_0xa39a('0x47')]({},_0x2c5605,_0x252d1f[_0xa39a('0x50')]);return db[_0xa39a('0x36')][_0xa39a('0x51')](_0x2c5605)[_0xa39a('0x19')](handleEntityNotFound(_0x32b43f,null))['then'](respondWithResult(_0x32b43f,null))[_0xa39a('0x23')](handleError(_0x32b43f,null));};exports[_0xa39a('0x52')]=function(_0x56b62f,_0x2bd92a){return db['ServicenowAccount']['create'](_0x56b62f['body'],{})[_0xa39a('0x19')](respondWithResult(_0x2bd92a,0xc9))[_0xa39a('0x23')](handleError(_0x2bd92a,null));};exports['update']=function(_0x46a3cc,_0x568559){if(_0x46a3cc[_0xa39a('0x53')]['id']){delete _0x46a3cc[_0xa39a('0x53')]['id'];}return db[_0xa39a('0x36')][_0xa39a('0x51')]({'where':{'id':_0x46a3cc[_0xa39a('0x4f')]['id']}})[_0xa39a('0x19')](handleEntityNotFound(_0x568559,null))[_0xa39a('0x19')](saveUpdates(_0x46a3cc['body'],null))[_0xa39a('0x19')](respondWithResult(_0x568559,null))[_0xa39a('0x23')](handleError(_0x568559,null));};exports[_0xa39a('0x31')]=function(_0x40a5f1,_0x4b1f3e){return db[_0xa39a('0x36')][_0xa39a('0x51')]({'where':{'id':_0x40a5f1[_0xa39a('0x4f')]['id']}})[_0xa39a('0x19')](handleEntityNotFound(_0x4b1f3e,null))[_0xa39a('0x19')](removeEntity(_0x4b1f3e,null))[_0xa39a('0x23')](handleError(_0x4b1f3e,null));};exports[_0xa39a('0x54')]=function(_0x27edfd,_0x5529cd,_0x3b20fb){var _0x3df90d={};var _0x9e34d6={};var _0x2d5b83;var _0x13527b;return db[_0xa39a('0x36')]['findOne']({'where':{'id':_0x27edfd['params']['id']}})['then'](handleEntityNotFound(_0x5529cd,null))[_0xa39a('0x19')](function(_0x4348a3){if(_0x4348a3){_0x2d5b83=_0x4348a3;_0x9e34d6[_0xa39a('0x39')]=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0x9e34d6[_0xa39a('0x3a')]=_[_0xa39a('0x3b')](_0x27edfd[_0xa39a('0x3a')]);_0x9e34d6[_0xa39a('0x43')]=_[_0xa39a('0x3c')](_0x9e34d6[_0xa39a('0x39')],_0x9e34d6[_0xa39a('0x3a')]);_0x3df90d[_0xa39a('0x3e')]=_[_0xa39a('0x3c')](_0x9e34d6[_0xa39a('0x39')],qs['fields'](_0x27edfd[_0xa39a('0x3a')][_0xa39a('0x3d')]));_0x3df90d[_0xa39a('0x3e')]=_0x3df90d[_0xa39a('0x3e')]['length']?_0x3df90d['attributes']:_0x9e34d6[_0xa39a('0x39')];_0x3df90d['order']=qs[_0xa39a('0x42')](_0x27edfd[_0xa39a('0x3a')][_0xa39a('0x42')]);_0x3df90d[_0xa39a('0x46')]=qs['filters'](_['pick'](_0x27edfd[_0xa39a('0x3a')],_0x9e34d6['filters']));if(_0x27edfd[_0xa39a('0x3a')][_0xa39a('0x45')]){_0x3df90d[_0xa39a('0x46')]=_[_0xa39a('0x47')](_0x3df90d['where'],{'$or':_['map'](_0x3df90d[_0xa39a('0x3e')],function(_0x4a82d3){var _0x5130e9={};_0x5130e9[_0x4a82d3]={'$like':'%'+_0x27edfd[_0xa39a('0x3a')]['filter']+'%'};return _0x5130e9;})});}_0x3df90d=_[_0xa39a('0x47')]({},_0x3df90d,_0x27edfd[_0xa39a('0x50')]);return _0x2d5b83[_0xa39a('0x54')](_0x3df90d);}})[_0xa39a('0x19')](function(_0x1da216){if(_0x1da216){_0x13527b=_0x1da216[_0xa39a('0x3f')];if(!_0x27edfd[_0xa39a('0x3a')][_0xa39a('0x40')]('nolimit')){_0x3df90d['limit']=qs[_0xa39a('0x29')](_0x27edfd[_0xa39a('0x3a')][_0xa39a('0x29')]);_0x3df90d[_0xa39a('0x26')]=qs[_0xa39a('0x26')](_0x27edfd[_0xa39a('0x3a')][_0xa39a('0x26')]);}return _0x2d5b83[_0xa39a('0x54')](_0x3df90d);}})[_0xa39a('0x19')](function(_0x34a3ab){if(_0x34a3ab){return _0x34a3ab?{'count':_0x13527b,'rows':_0x34a3ab}:null;}})[_0xa39a('0x19')](respondWithResult(_0x5529cd,null))[_0xa39a('0x23')](handleError(_0x5529cd,null));};exports[_0xa39a('0x55')]=function(_0x426e58,_0x1acb0c,_0x2d64ea){if(_0x426e58[_0xa39a('0x53')]['id']){delete _0x426e58[_0xa39a('0x53')]['id'];}return db[_0xa39a('0x36')][_0xa39a('0x56')]({'where':{'id':_0x426e58[_0xa39a('0x4f')]['id']}})[_0xa39a('0x19')](handleEntityNotFound(_0x1acb0c,null))[_0xa39a('0x19')](function(_0x31bc7b){if(_0x31bc7b){_0x426e58['body'][_0xa39a('0x57')]=_0x31bc7b['id'];_0x426e58[_0xa39a('0x53')]['Subjects']=integrations[_0xa39a('0x58')](_0x426e58['body'][_0xa39a('0x59')],_0x426e58[_0xa39a('0x53')]['type']);_0x426e58['body'][_0xa39a('0x5a')]=integrations[_0xa39a('0x5b')](_0x426e58[_0xa39a('0x53')][_0xa39a('0x59')],_0x426e58[_0xa39a('0x53')][_0xa39a('0x48')]);return db[_0xa39a('0x5c')][_0xa39a('0x52')](_0x426e58[_0xa39a('0x53')],{'include':[{'model':db[_0xa39a('0x5d')],'as':_0xa39a('0x5e')},{'model':db[_0xa39a('0x5d')],'as':_0xa39a('0x5a')}]});}return null;})['then'](respondWithResult(_0x1acb0c,null))[_0xa39a('0x23')](handleError(_0x1acb0c,null));};exports[_0xa39a('0x5f')]=function(_0x4358e6,_0x37eabc,_0x5969df){var _0x23b926=[_0xa39a('0x60'),'hold_reason',_0xa39a('0x61'),_0xa39a('0x62'),_0xa39a('0x63'),_0xa39a('0x64'),_0xa39a('0x65'),_0xa39a('0x66'),'category'];var _0x1dcec5=[_0xa39a('0x67'),_0xa39a('0x60'),_0xa39a('0x68'),'watch_list',_0xa39a('0x69'),_0xa39a('0x6a'),_0xa39a('0x6b'),_0xa39a('0x6c'),_0xa39a('0x6d'),'number',_0xa39a('0x6e'),_0xa39a('0x6f'),'opened_by','user_input',_0xa39a('0x70'),_0xa39a('0x71'),_0xa39a('0x72'),'sys_created_by',_0xa39a('0x61'),_0xa39a('0x41'),_0xa39a('0x73'),_0xa39a('0x74'),'cmdb_ci',_0xa39a('0x75'),_0xa39a('0x76'),_0xa39a('0x77'),_0xa39a('0x78'),_0xa39a('0x79'),'priority','sys_domain_path',_0xa39a('0x7a'),_0xa39a('0x7b'),'expected_start',_0xa39a('0x7c'),_0xa39a('0x7d'),_0xa39a('0x7e'),_0xa39a('0x7f'),_0xa39a('0x80'),_0xa39a('0x81'),_0xa39a('0x82'),_0xa39a('0x83'),'subcategory','work_notes',_0xa39a('0x84'),'close_code',_0xa39a('0x85'),_0xa39a('0x86'),_0xa39a('0x87'),_0xa39a('0x88'),'business_stc',_0xa39a('0x89'),_0xa39a('0x8a'),'calendar_duration',_0xa39a('0x64'),_0xa39a('0x8b'),'close_notes','closed_by',_0xa39a('0x8c'),_0xa39a('0x8d'),_0xa39a('0x8e'),_0xa39a('0x8f'),_0xa39a('0x90'),_0xa39a('0x65'),_0xa39a('0x91'),_0xa39a('0x92'),_0xa39a('0x93'),_0xa39a('0x94'),_0xa39a('0x95'),_0xa39a('0x96'),_0xa39a('0x66'),_0xa39a('0x97'),_0xa39a('0x98'),_0xa39a('0x99'),_0xa39a('0x9a'),_0xa39a('0x9b'),_0xa39a('0x9c'),_0xa39a('0x9d'),_0xa39a('0x9e'),_0xa39a('0x9f'),_0xa39a('0xa0'),'correlation_id',_0xa39a('0xa1'),'category'];var _0x581fbf='';var _0x2c9971='';var _0x18ffce=[];var _0x16674d='';var _0x3e9263='';var _0x5345df=[];var _0x43dbd2='';var _0x1e113b='';var _0x339224={};var _0x13b2d5='';return db[_0xa39a('0x36')][_0xa39a('0x56')]({'where':{'id':_0x4358e6[_0xa39a('0x4f')]['id']},'attributes':['id',_0xa39a('0xa2'),_0xa39a('0xa3'),_0xa39a('0xa4'),_0xa39a('0xa5'),_0xa39a('0xa6')]})[_0xa39a('0x19')](handleEntityNotFound(_0x37eabc,null))[_0xa39a('0x19')](function(_0x23ee17){if(_0x23ee17){_0x13b2d5=_0x23ee17[_0xa39a('0xa5')];var _0x51d0d9=_0x13b2d5[_0xa39a('0xa7')](-0x1);if(_0x51d0d9==='/'){_0x13b2d5=_0x13b2d5['substring'](0x0,_0x13b2d5['lastIndexOf'](_0x51d0d9));}_0x1e113b=util[_0xa39a('0xa8')](_0xa39a('0xa9'),_0x13b2d5);_0x43dbd2=util[_0xa39a('0xa8')](_0xa39a('0xaa'),_0x13b2d5);_0x339224={'user':_0x23ee17[_0xa39a('0xa2')],'pass':_0x23ee17[_0xa39a('0xa3')]};var _0x527ec2={'method':_0xa39a('0xab'),'uri':_0x1e113b+'incident?sysparm_display_value=all','auth':_0x339224,'json':!![]};return rp(_0x527ec2);}})['then'](function(_0x5bf8d9){if(_0x5bf8d9['result'][_0xa39a('0x3f')]>0x0){_0x581fbf=_0x5bf8d9[_0xa39a('0xac')];}console[_0xa39a('0xad')](_0xa39a('0xae'),_0x581fbf);_0x5345df=[];_0x2c9971=Object[_0xa39a('0xaf')]([],_0x581fbf);_[_0xa39a('0xb0')](_0x2c9971,function(_0x4237f4){return!_0x23b926['includes'](_0x4237f4[_0xa39a('0x33')]);});_0x2c9971['forEach'](function(_0xf93107){var _0xa87f6b=createFieldObject(_0x43dbd2,_0x339224,_0xf93107[_0xa39a('0xb1')],_0xf93107['name'],_0xf93107[_0xa39a('0xb2')],![]);_0x5345df[_0xa39a('0xb3')](_0xa87f6b);});return Promise[_0xa39a('0xb4')](_0x5345df);})[_0xa39a('0x19')](function(_0x438947){_0x18ffce=_0x438947;_0x16674d=Object['assign']([],_0x581fbf);console['log'](_0xa39a('0xb5'),_0x581fbf);_['remove'](_0x16674d,function(_0x89a87d){return _0x1dcec5[_0xa39a('0xb6')](_0x89a87d[_0xa39a('0x33')]);});console[_0xa39a('0xad')](_0xa39a('0xb7'),_0x16674d);_0x5345df=[];_0x16674d['forEach'](function(_0x5571ea){var _0x1feac3=createFieldObject(_0x43dbd2,_0x339224,_0x5571ea[_0xa39a('0xb1')],_0x5571ea[_0xa39a('0x33')],_0x5571ea[_0xa39a('0xb2')],!![]);_0x5345df[_0xa39a('0xb3')](_0x1feac3);});return Promise['all'](_0x5345df);})[_0xa39a('0x19')](function(_0x1f8238){_0x3e9263=_0x1f8238;var _0x5e9124=_0x18ffce[_0xa39a('0xb8')](_0x3e9263);return{'count':_0x5e9124[_0xa39a('0x3f')],'rows':_0x5e9124};})[_0xa39a('0x19')](respondWithResult(_0x37eabc,null))[_0xa39a('0x23')](function(_0x26f9bf){console[_0xa39a('0xad')](_0xa39a('0xb9')+_0x26f9bf);var _0x4c0fb5=_0x4358e6[_0xa39a('0x3a')][_0xa39a('0xba')]?0x1f4:_0x26f9bf[_0xa39a('0xbb')]||0x1f4;logger[_0xa39a('0x1f')](_0x26f9bf[_0xa39a('0xbc')]);delete _0x26f9bf[_0xa39a('0x33')];if(_0x4c0fb5===0x191){_0x4c0fb5=0x190;}_0x37eabc[_0xa39a('0x24')](_0x4c0fb5)[_0xa39a('0x34')](_0x4358e6[_0xa39a('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x26f9bf['statusCode']}:_0x26f9bf);});};function createFieldObject(_0x37b979,_0x59c85d,_0x5af081,_0x12e46e,_0x15c952,_0x4816c3){return new Promise(function(_0x214c7c,_0x42c7a4){var _0x502c23={'id':_0x12e46e,'name':_0x15c952,'custom':_0x4816c3};if(_0x5af081===_0xa39a('0xbd')){_0x502c23[_0xa39a('0x50')]=[{'name':_0xa39a('0xbe'),'value':_0xa39a('0xbf')},{'name':_0xa39a('0xc0'),'value':_0xa39a('0xc1')}];_0x214c7c(_0x502c23);}else{var _0x226f82={'method':_0xa39a('0xab'),'uri':_0x37b979+_0xa39a('0xc2')+_0x12e46e,'auth':_0x59c85d,'json':!![]};return rp(_0x226f82)[_0xa39a('0x19')](function(_0x381e96){var _0x500be=[];if(_0x381e96['result'][_0xa39a('0x3f')]>0x0){_0x381e96[_0xa39a('0xac')]['forEach'](function(_0x2ae34a){if(_0x2ae34a['inactive']===_0xa39a('0xc1')){var _0x1e1dd4={'name':_0x2ae34a[_0xa39a('0xb2')],'value':_0x2ae34a[_0xa39a('0xc3')]};_0x500be['push'](_0x1e1dd4);}});}_0x502c23[_0xa39a('0x50')]=_0x500be;if(_0x502c23[_0xa39a('0x50')][_0xa39a('0x3f')]>0x0){_0x214c7c(_0x502c23);}else{if(_0x4816c3==![]){_0x214c7c();}else{_0x214c7c(_0x502c23);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 3a8f8af..3619afa 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 _0x53ec=['path','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x53ec,0x192));var _0xc53e=function(_0x57fd0d,_0x2630ea){_0x57fd0d=_0x57fd0d-0x0;var _0x4b57f6=_0x53ec[_0x57fd0d];return _0x4b57f6;};'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'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('ServicenowAccount',attributes,{'tableName':_0xc53e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c09=['rimraf','../../config/environment','./intServicenowAccount.attributes','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2c0529,_0x5ec1ca){var _0x3d990f=function(_0x2dc8f2){while(--_0x2dc8f2){_0x2c0529['push'](_0x2c0529['shift']());}};_0x3d990f(++_0x5ec1ca);}(_0x7c09,0x102));var _0x97c0=function(_0x4908d6,_0x83d5c0){_0x4908d6=_0x4908d6-0x0;var _0x55f2f1=_0x7c09[_0x4908d6];return _0x55f2f1;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x590368,_0x46fdd9){return _0x590368[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'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 e72c8b0..41bfca2 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 _0x4baa=['catch','ShowServicenowAccount','find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetServicenowAccount','ServicenowAccount','raw','options','where','attributes','limit','include','map','model','stringify'];(function(_0x1be9bf,_0x24e8d4){var _0xc71541=function(_0x35b045){while(--_0x35b045){_0x1be9bf['push'](_0x1be9bf['shift']());}};_0xc71541(++_0x24e8d4);}(_0x4baa,0x151));var _0xa4ba=function(_0x2b3bb9,_0x1556ce){_0x2b3bb9=_0x2b3bb9-0x0;var _0x5d3da5=_0x4baa[_0x2b3bb9];return _0x5d3da5;};'use strict';var _=require('lodash');var util=require(_0xa4ba('0x0'));var moment=require(_0xa4ba('0x1'));var BPromise=require(_0xa4ba('0x2'));var rs=require(_0xa4ba('0x3'));var fs=require('fs');var Redis=require(_0xa4ba('0x4'));var db=require(_0xa4ba('0x5'))['db'];var utils=require(_0xa4ba('0x6'));var logger=require(_0xa4ba('0x7'))(_0xa4ba('0x8'));var config=require(_0xa4ba('0x9'));var jayson=require(_0xa4ba('0xa'));var client=jayson['client'][_0xa4ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21986a,_0x4b768e,_0x47d3bf){return new BPromise(function(_0x9e6f8b,_0x42eda6){return client[_0xa4ba('0xc')](_0x21986a,_0x47d3bf)['then'](function(_0x4c0486){logger[_0xa4ba('0xd')](_0xa4ba('0xe'),_0x4b768e,_0xa4ba('0xf'));logger[_0xa4ba('0x10')](_0xa4ba('0x11'),_0x4b768e,_0xa4ba('0xf'),JSON['stringify'](_0x4c0486));if(_0x4c0486[_0xa4ba('0x12')]){if(_0x4c0486[_0xa4ba('0x12')][_0xa4ba('0x13')]===0x1f4){logger[_0xa4ba('0x12')](_0xa4ba('0xe'),_0x4b768e,_0x4c0486[_0xa4ba('0x12')]['message']);return _0x42eda6(_0x4c0486['error'][_0xa4ba('0x14')]);}logger[_0xa4ba('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x4b768e,_0x4c0486[_0xa4ba('0x12')][_0xa4ba('0x14')]);return _0x9e6f8b(_0x4c0486['error'][_0xa4ba('0x14')]);}else{logger[_0xa4ba('0xd')](_0xa4ba('0xe'),_0x4b768e,_0xa4ba('0xf'));_0x9e6f8b(_0x4c0486[_0xa4ba('0x15')]['message']);}})['catch'](function(_0x34d17d){logger[_0xa4ba('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x4b768e,_0x34d17d);_0x42eda6(_0x34d17d);});});}exports[_0xa4ba('0x16')]=function(_0x26d23a){var _0x20f168=this;return new Promise(function(_0x5dda10,_0x3fd0ee){return db[_0xa4ba('0x17')]['findAll']({'raw':_0x26d23a['options']?_0x26d23a['options'][_0xa4ba('0x18')]===undefined?!![]:![]:!![],'where':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a[_0xa4ba('0x19')][_0xa4ba('0x1a')]||null:null,'attributes':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a[_0xa4ba('0x19')][_0xa4ba('0x1b')]||null:null,'limit':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a['options'][_0xa4ba('0x1c')]||null:null,'include':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a[_0xa4ba('0x19')][_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0x26d23a[_0xa4ba('0x19')]['include'],function(_0x562559){return{'model':db[_0x562559[_0xa4ba('0x1f')]],'as':_0x562559['as'],'attributes':_0x562559[_0xa4ba('0x1b')],'include':_0x562559[_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0x562559[_0xa4ba('0x1d')],function(_0xb7a16c){return{'model':db[_0xb7a16c[_0xa4ba('0x1f')]],'as':_0xb7a16c['as'],'attributes':_0xb7a16c[_0xa4ba('0x1b')],'include':_0xb7a16c[_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0xb7a16c[_0xa4ba('0x1d')],function(_0x449e43){return{'model':db[_0x449e43[_0xa4ba('0x1f')]],'as':_0x449e43['as'],'attributes':_0x449e43[_0xa4ba('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13e1e7){logger[_0xa4ba('0xd')](_0xa4ba('0x16'),_0x26d23a);logger[_0xa4ba('0x10')](_0xa4ba('0x16'),_0x26d23a,JSON[_0xa4ba('0x20')](_0x13e1e7));_0x5dda10(_0x13e1e7);})[_0xa4ba('0x21')](function(_0x5fec32){logger[_0xa4ba('0x12')](_0xa4ba('0x16'),_0x5fec32[_0xa4ba('0x14')],_0x26d23a);_0x3fd0ee(_0x20f168[_0xa4ba('0x12')](0x1f4,_0x5fec32['message']));});});};exports[_0xa4ba('0x22')]=function(_0x184cbf){var _0x490a28=this;return new Promise(function(_0x75787e,_0x4f1d42){return db[_0xa4ba('0x17')][_0xa4ba('0x23')]({'raw':_0x184cbf['options']?_0x184cbf['options']['raw']===undefined?!![]:![]:!![],'where':_0x184cbf[_0xa4ba('0x19')]?_0x184cbf['options']['where']||null:null,'attributes':_0x184cbf[_0xa4ba('0x19')]?_0x184cbf['options'][_0xa4ba('0x1b')]||null:null,'include':_0x184cbf[_0xa4ba('0x19')]?_0x184cbf[_0xa4ba('0x19')][_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0x184cbf[_0xa4ba('0x19')][_0xa4ba('0x1d')],function(_0xb56708){return{'model':db[_0xb56708[_0xa4ba('0x1f')]],'as':_0xb56708['as'],'attributes':_0xb56708[_0xa4ba('0x1b')],'include':_0xb56708[_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0xb56708[_0xa4ba('0x1d')],function(_0x301246){return{'model':db[_0x301246[_0xa4ba('0x1f')]],'as':_0x301246['as'],'attributes':_0x301246[_0xa4ba('0x1b')],'include':_0x301246[_0xa4ba('0x1d')]?_['map'](_0x301246[_0xa4ba('0x1d')],function(_0x57c4d2){return{'model':db[_0x57c4d2[_0xa4ba('0x1f')]],'as':_0x57c4d2['as'],'attributes':_0x57c4d2['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4ba('0x24')](function(_0x3690e2){logger['info'](_0xa4ba('0x22'),_0x184cbf);logger[_0xa4ba('0x10')](_0xa4ba('0x22'),_0x184cbf,JSON[_0xa4ba('0x20')](_0x3690e2));_0x75787e(_0x3690e2);})[_0xa4ba('0x21')](function(_0x6d2a0e){logger[_0xa4ba('0x12')](_0xa4ba('0x22'),_0x6d2a0e['message'],_0x184cbf);_0x4f1d42(_0x490a28[_0xa4ba('0x12')](0x1f4,_0x6d2a0e['message']));});});}; \ No newline at end of file +var _0x3984=['../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','GetServicenowAccount','find','ShowServicenowAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x3984,0x65));var _0x4398=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0x3984[_0x421c56];return _0x49b244;};'use strict';var _=require(_0x4398('0x0'));var util=require(_0x4398('0x1'));var moment=require('moment');var BPromise=require(_0x4398('0x2'));var rs=require(_0x4398('0x3'));var fs=require('fs');var Redis=require(_0x4398('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4398('0x5'));var logger=require('../../config/logger')(_0x4398('0x6'));var config=require(_0x4398('0x7'));var jayson=require(_0x4398('0x8'));var client=jayson[_0x4398('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x151144,_0x5dbe9e,_0x129001){return new BPromise(function(_0x2e8825,_0xb15666){return client[_0x4398('0xa')](_0x151144,_0x129001)[_0x4398('0xb')](function(_0x1686cc){logger[_0x4398('0xc')](_0x4398('0xd'),_0x5dbe9e,_0x4398('0xe'));logger['debug'](_0x4398('0xf'),_0x5dbe9e,_0x4398('0xe'),JSON[_0x4398('0x10')](_0x1686cc));if(_0x1686cc[_0x4398('0x11')]){if(_0x1686cc['error'][_0x4398('0x12')]===0x1f4){logger[_0x4398('0x11')](_0x4398('0xd'),_0x5dbe9e,_0x1686cc['error'][_0x4398('0x13')]);return _0xb15666(_0x1686cc['error'][_0x4398('0x13')]);}logger[_0x4398('0x11')](_0x4398('0xd'),_0x5dbe9e,_0x1686cc[_0x4398('0x11')][_0x4398('0x13')]);return _0x2e8825(_0x1686cc['error'][_0x4398('0x13')]);}else{logger[_0x4398('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x5dbe9e,_0x4398('0xe'));_0x2e8825(_0x1686cc[_0x4398('0x14')][_0x4398('0x13')]);}})['catch'](function(_0x38b52a){logger[_0x4398('0x11')](_0x4398('0xd'),_0x5dbe9e,_0x38b52a);_0xb15666(_0x38b52a);});});}exports['GetServicenowAccount']=function(_0x406dbb){var _0x516423=this;return new Promise(function(_0x3058c9,_0x14151c){return db[_0x4398('0x15')][_0x4398('0x16')]({'raw':_0x406dbb['options']?_0x406dbb[_0x4398('0x17')][_0x4398('0x18')]===undefined?!![]:![]:!![],'where':_0x406dbb[_0x4398('0x17')]?_0x406dbb[_0x4398('0x17')][_0x4398('0x19')]||null:null,'attributes':_0x406dbb[_0x4398('0x17')]?_0x406dbb[_0x4398('0x17')][_0x4398('0x1a')]||null:null,'limit':_0x406dbb[_0x4398('0x17')]?_0x406dbb['options'][_0x4398('0x1b')]||null:null,'include':_0x406dbb['options']?_0x406dbb[_0x4398('0x17')][_0x4398('0x1c')]?_['map'](_0x406dbb[_0x4398('0x17')][_0x4398('0x1c')],function(_0xcdc551){return{'model':db[_0xcdc551[_0x4398('0x1d')]],'as':_0xcdc551['as'],'attributes':_0xcdc551[_0x4398('0x1a')],'include':_0xcdc551['include']?_[_0x4398('0x1e')](_0xcdc551[_0x4398('0x1c')],function(_0x47a82c){return{'model':db[_0x47a82c[_0x4398('0x1d')]],'as':_0x47a82c['as'],'attributes':_0x47a82c[_0x4398('0x1a')],'include':_0x47a82c[_0x4398('0x1c')]?_['map'](_0x47a82c[_0x4398('0x1c')],function(_0x4533e4){return{'model':db[_0x4533e4[_0x4398('0x1d')]],'as':_0x4533e4['as'],'attributes':_0x4533e4[_0x4398('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4398('0xb')](function(_0x21cc66){logger[_0x4398('0xc')]('GetServicenowAccount',_0x406dbb);logger[_0x4398('0x1f')]('GetServicenowAccount',_0x406dbb,JSON[_0x4398('0x10')](_0x21cc66));_0x3058c9(_0x21cc66);})[_0x4398('0x20')](function(_0x42a793){logger[_0x4398('0x11')](_0x4398('0x21'),_0x42a793[_0x4398('0x13')],_0x406dbb);_0x14151c(_0x516423['error'](0x1f4,_0x42a793[_0x4398('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x4e521e){var _0x5d2cb6=this;return new Promise(function(_0x45562f,_0x4d78c5){return db['ServicenowAccount'][_0x4398('0x22')]({'raw':_0x4e521e['options']?_0x4e521e[_0x4398('0x17')][_0x4398('0x18')]===undefined?!![]:![]:!![],'where':_0x4e521e[_0x4398('0x17')]?_0x4e521e['options'][_0x4398('0x19')]||null:null,'attributes':_0x4e521e[_0x4398('0x17')]?_0x4e521e[_0x4398('0x17')][_0x4398('0x1a')]||null:null,'include':_0x4e521e[_0x4398('0x17')]?_0x4e521e[_0x4398('0x17')][_0x4398('0x1c')]?_[_0x4398('0x1e')](_0x4e521e[_0x4398('0x17')][_0x4398('0x1c')],function(_0x1f6090){return{'model':db[_0x1f6090[_0x4398('0x1d')]],'as':_0x1f6090['as'],'attributes':_0x1f6090['attributes'],'include':_0x1f6090[_0x4398('0x1c')]?_['map'](_0x1f6090[_0x4398('0x1c')],function(_0x532faf){return{'model':db[_0x532faf[_0x4398('0x1d')]],'as':_0x532faf['as'],'attributes':_0x532faf[_0x4398('0x1a')],'include':_0x532faf[_0x4398('0x1c')]?_[_0x4398('0x1e')](_0x532faf['include'],function(_0x469ed0){return{'model':db[_0x469ed0[_0x4398('0x1d')]],'as':_0x469ed0['as'],'attributes':_0x469ed0[_0x4398('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4398('0xb')](function(_0x37f3c6){logger['info']('ShowServicenowAccount',_0x4e521e);logger['debug'](_0x4398('0x23'),_0x4e521e,JSON['stringify'](_0x37f3c6));_0x45562f(_0x37f3c6);})[_0x4398('0x20')](function(_0x58fe55){logger[_0x4398('0x11')](_0x4398('0x23'),_0x58fe55[_0x4398('0x13')],_0x4e521e);_0x4d78c5(_0x5d2cb6[_0x4398('0x11')](0x1f4,_0x58fe55[_0x4398('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 77dcb70..b268c34 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 _0x5615=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5615,0x1cf));var _0x5561=function(_0x1dc4e8,_0x12744c){_0x1dc4e8=_0x1dc4e8-0x0;var _0x566bf1=_0x5615[_0x1dc4e8];return _0x566bf1;};'use strict';var multer=require(_0x5561('0x0'));var util=require(_0x5561('0x1'));var path=require(_0x5561('0x2'));var timeout=require(_0x5561('0x3'));var express=require(_0x5561('0x4'));var router=express['Router']();var fs_extra=require(_0x5561('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5561('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x5561('0x7')]('/',auth[_0x5561('0x8')](),controller[_0x5561('0x9')]);router[_0x5561('0x7')]('/:id',auth[_0x5561('0x8')](),controller[_0x5561('0xa')]);router[_0x5561('0x7')]('/:id/fields',auth[_0x5561('0x8')](),controller[_0x5561('0xb')]);router[_0x5561('0x7')](_0x5561('0xc'),auth[_0x5561('0x8')](),controller[_0x5561('0xd')]);router[_0x5561('0x7')]('/:id/descriptions',auth[_0x5561('0x8')](),controller[_0x5561('0xe')]);router[_0x5561('0xf')]('/',auth[_0x5561('0x8')](),controller[_0x5561('0x10')]);router[_0x5561('0x11')](_0x5561('0x12'),auth['isAuthenticated'](),controller[_0x5561('0x13')]);router[_0x5561('0x14')](_0x5561('0x12'),auth[_0x5561('0x8')](),controller[_0x5561('0x15')]);module[_0x5561('0x16')]=router; \ No newline at end of file +var _0x7d8c=['isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x385a4c,_0x447726){var _0x2282cf=function(_0x44a44e){while(--_0x44a44e){_0x385a4c['push'](_0x385a4c['shift']());}};_0x2282cf(++_0x447726);}(_0x7d8c,0x139));var _0xc7d8=function(_0x570a01,_0x1d2204){_0x570a01=_0x570a01-0x0;var _0x2f88cc=_0x7d8c[_0x570a01];return _0x2f88cc;};'use strict';var multer=require('multer');var util=require(_0xc7d8('0x0'));var path=require(_0xc7d8('0x1'));var timeout=require('connect-timeout');var express=require(_0xc7d8('0x2'));var router=express['Router']();var fs_extra=require(_0xc7d8('0x3'));var auth=require(_0xc7d8('0x4'));var interaction=require(_0xc7d8('0x5'));var config=require(_0xc7d8('0x6'));var controller=require(_0xc7d8('0x7'));router[_0xc7d8('0x8')]('/',auth[_0xc7d8('0x9')](),controller[_0xc7d8('0xa')]);router[_0xc7d8('0x8')](_0xc7d8('0xb'),auth[_0xc7d8('0x9')](),controller[_0xc7d8('0xc')]);router[_0xc7d8('0x8')](_0xc7d8('0xd'),auth['isAuthenticated'](),controller[_0xc7d8('0xe')]);router[_0xc7d8('0x8')](_0xc7d8('0xf'),auth[_0xc7d8('0x9')](),controller[_0xc7d8('0x10')]);router[_0xc7d8('0x8')](_0xc7d8('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xc7d8('0x12')]('/',auth[_0xc7d8('0x9')](),controller['create']);router[_0xc7d8('0x13')]('/:id',auth[_0xc7d8('0x9')](),controller[_0xc7d8('0x14')]);router[_0xc7d8('0x15')]('/:id',auth[_0xc7d8('0x9')](),controller[_0xc7d8('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 95d7394..af5d6e1 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 _0xaae8=['exports','STRING','sequelize'];(function(_0x4ccf96,_0x34978e){var _0xd103b7=function(_0x55736b){while(--_0x55736b){_0x4ccf96['push'](_0x4ccf96['shift']());}};_0xd103b7(++_0x34978e);}(_0xaae8,0x80));var _0x8aae=function(_0x37bec9,_0x312463){_0x37bec9=_0x37bec9-0x0;var _0x3ac88d=_0xaae8[_0x37bec9];return _0x3ac88d;};'use strict';var Sequelize=require(_0x8aae('0x0'));module[_0x8aae('0x1')]={'name':{'type':Sequelize[_0x8aae('0x2')]},'description':{'type':Sequelize[_0x8aae('0x2')]}}; \ No newline at end of file +var _0xb98f=['sequelize','exports','STRING'];(function(_0x514a08,_0x28a8c7){var _0x8da53a=function(_0x547f09){while(--_0x547f09){_0x514a08['push'](_0x514a08['shift']());}};_0x8da53a(++_0x28a8c7);}(_0xb98f,0x11a));var _0xfb98=function(_0x2010aa,_0x2b3810){_0x2010aa=_0x2010aa-0x0;var _0x396aea=_0xb98f[_0x2010aa];return _0x396aea;};'use strict';var Sequelize=require(_0xfb98('0x0'));module[_0xfb98('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfb98('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index c6da4f7..8d96c01 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 _0xbbfa=['model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','where','merge','filter','include','findAll','rows','catch','show','params','length','options','find','create','body','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type'];(function(_0xbcb6,_0x8e00a9){var _0x58899b=function(_0x35e0c4){while(--_0x35e0c4){_0xbcb6['push'](_0xbcb6['shift']());}};_0x58899b(++_0x8e00a9);}(_0xbbfa,0x133));var _0xabbf=function(_0x32917a,_0x3559ea){_0x32917a=_0x32917a-0x0;var _0x1881e1=_0xbbfa[_0x32917a];return _0x1881e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabbf('0x1'));var rp=require(_0xabbf('0x2'));var moment=require(_0xabbf('0x3'));var BPromise=require(_0xabbf('0x4'));var Mustache=require('mustache');var util=require(_0xabbf('0x5'));var path=require(_0xabbf('0x6'));var sox=require(_0xabbf('0x7'));var csv=require('to-csv');var ejs=require(_0xabbf('0x8'));var fs=require('fs');var fs_extra=require(_0xabbf('0x9'));var _=require(_0xabbf('0xa'));var squel=require(_0xabbf('0xb'));var crypto=require(_0xabbf('0xc'));var jsforce=require(_0xabbf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xabbf('0xe'));var querystring=require('querystring');var Papa=require(_0xabbf('0xf'));var Redis=require(_0xabbf('0x10'));var authService=require(_0xabbf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xabbf('0x12'));var hardwareService=require(_0xabbf('0x13'));var logger=require(_0xabbf('0x14'))('api');var utils=require(_0xabbf('0x15'));var config=require(_0xabbf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xabbf('0x17'))['db'];var jayson=require(_0xabbf('0x18'));var client=jayson[_0xabbf('0x19')][_0xabbf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4e7089,_0x11b4bd,_0x14f54f,_0x5367a9){return new BPromise(function(_0x59cf47,_0x5290f0){var _0x1d0700=_0x5367a9||client;return _0x1d0700[_0xabbf('0x1b')](_0x4e7089,_0x14f54f)['then'](function(_0x17d3b2){logger[_0xabbf('0x1c')](_0xabbf('0x1d'),_0x11b4bd,_0xabbf('0x1e'));logger[_0xabbf('0x1f')](_0xabbf('0x20'),_0x11b4bd,'request\x20sent',JSON[_0xabbf('0x21')](_0x17d3b2));if(_0x17d3b2[_0xabbf('0x22')]){if(_0x17d3b2[_0xabbf('0x22')][_0xabbf('0x23')]===0x1f4){logger[_0xabbf('0x22')](_0xabbf('0x1d'),_0x11b4bd,_0x17d3b2[_0xabbf('0x22')][_0xabbf('0x24')]);return _0x5290f0(_0x17d3b2[_0xabbf('0x22')][_0xabbf('0x24')]);}logger[_0xabbf('0x22')]('ServicenowConfiguration,\x20%s,\x20%s',_0x11b4bd,_0x17d3b2[_0xabbf('0x22')]['message']);return _0x59cf47(_0x17d3b2[_0xabbf('0x22')]['message']);}else{logger[_0xabbf('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x11b4bd,'request\x20sent');_0x59cf47(_0x17d3b2['result'][_0xabbf('0x24')]);}})['catch'](function(_0x34c336){logger['error'](_0xabbf('0x1d'),_0x11b4bd,_0x34c336);_0x5290f0(_0x34c336);});});}function respondWithStatusCode(_0x163cfb,_0x5d53cd){_0x5d53cd=_0x5d53cd||0xcc;return function(_0x1792be){if(_0x1792be){return _0x163cfb[_0xabbf('0x25')](_0x5d53cd);}return _0x163cfb[_0xabbf('0x26')](_0x5d53cd)['end']();};}function respondWithResult(_0xedd6d9,_0x34e43f){_0x34e43f=_0x34e43f||0xc8;return function(_0x23ac9e){if(_0x23ac9e){return _0xedd6d9[_0xabbf('0x26')](_0x34e43f)[_0xabbf('0x27')](_0x23ac9e);}};}function respondWithFilteredResult(_0x398cb3,_0xa968fc){return function(_0x242a94){if(_0x242a94){var _0x27bb06=typeof _0xa968fc[_0xabbf('0x28')]===_0xabbf('0x29')&&typeof _0xa968fc[_0xabbf('0x2a')]==='undefined';var _0x517b3a=_0x242a94[_0xabbf('0x2b')];var _0x3f446e=_0x27bb06?0x0:_0xa968fc[_0xabbf('0x28')];var _0x369f83=_0x27bb06?_0x242a94['count']:_0xa968fc[_0xabbf('0x28')]+_0xa968fc['limit'];var _0x55fe1a;if(_0x369f83>=_0x517b3a){_0x369f83=_0x517b3a;_0x55fe1a=0xc8;}else{_0x55fe1a=0xce;}_0x398cb3['status'](_0x55fe1a);return _0x398cb3[_0xabbf('0x2c')](_0xabbf('0x2d'),_0x3f446e+'-'+_0x369f83+'/'+_0x517b3a)[_0xabbf('0x27')](_0x242a94);}return null;};}function patchUpdates(_0x5499ea){return function(_0x4a6d06){try{jsonpatch[_0xabbf('0x2e')](_0x4a6d06,_0x5499ea,!![]);}catch(_0x4ff3ac){return BPromise[_0xabbf('0x2f')](_0x4ff3ac);}return _0x4a6d06['save']();};}function saveUpdates(_0x2ff01e,_0x54e250){return function(_0x4e8f59){if(_0x4e8f59){return _0x4e8f59[_0xabbf('0x30')](_0x2ff01e)[_0xabbf('0x31')](function(_0x35db0d){return _0x35db0d;});}return null;};}function removeEntity(_0x17a09c,_0x5a43c0){return function(_0x18f2c0){if(_0x18f2c0){return _0x18f2c0[_0xabbf('0x32')]()['then'](function(){_0x17a09c['status'](0xcc)[_0xabbf('0x33')]();});}};}function handleEntityNotFound(_0x39e47b,_0x74aa6f){return function(_0x2a0bbb){if(!_0x2a0bbb){_0x39e47b[_0xabbf('0x25')](0x194);}return _0x2a0bbb;};}function handleError(_0x30354e,_0x3174ea){_0x3174ea=_0x3174ea||0x1f4;return function(_0x6442e3){logger[_0xabbf('0x22')](_0x6442e3[_0xabbf('0x34')]);if(_0x6442e3[_0xabbf('0x35')]){delete _0x6442e3[_0xabbf('0x35')];}_0x30354e['status'](_0x3174ea)[_0xabbf('0x36')](_0x6442e3);};}exports[_0xabbf('0x37')]=function(_0xca8f72,_0x2b59e3){var _0x23fe97={},_0x364d32={},_0x1a663c={'count':0x0,'rows':[]};var _0x5ee186=_[_0xabbf('0x38')](db[_0xabbf('0x39')][_0xabbf('0x3a')],function(_0x3d6748){return{'name':_0x3d6748[_0xabbf('0x3b')],'type':_0x3d6748[_0xabbf('0x3c')]['key']};});_0x364d32[_0xabbf('0x3d')]=_['map'](_0x5ee186,'name');_0x364d32[_0xabbf('0x3e')]=_[_0xabbf('0x3f')](_0xca8f72[_0xabbf('0x3e')]);_0x364d32['filters']=_['intersection'](_0x364d32['model'],_0x364d32[_0xabbf('0x3e')]);_0x23fe97[_0xabbf('0x40')]=_[_0xabbf('0x41')](_0x364d32[_0xabbf('0x3d')],qs[_0xabbf('0x42')](_0xca8f72['query'][_0xabbf('0x42')]));_0x23fe97[_0xabbf('0x40')]=_0x23fe97[_0xabbf('0x40')]['length']?_0x23fe97[_0xabbf('0x40')]:_0x364d32[_0xabbf('0x3d')];if(!_0xca8f72['query'][_0xabbf('0x43')]('nolimit')){_0x23fe97[_0xabbf('0x2a')]=qs['limit'](_0xca8f72['query'][_0xabbf('0x2a')]);_0x23fe97['offset']=qs['offset'](_0xca8f72['query'][_0xabbf('0x28')]);}_0x23fe97[_0xabbf('0x44')]=qs['sort'](_0xca8f72[_0xabbf('0x3e')][_0xabbf('0x45')]);_0x23fe97['where']=qs[_0xabbf('0x46')](_[_0xabbf('0x47')](_0xca8f72[_0xabbf('0x3e')],_0x364d32[_0xabbf('0x46')]),_0x5ee186);if(_0xca8f72[_0xabbf('0x3e')]['filter']){_0x23fe97[_0xabbf('0x48')]=_[_0xabbf('0x49')](_0x23fe97[_0xabbf('0x48')],{'$or':_[_0xabbf('0x38')](_0x5ee186,function(_0x51893f){if(_0x51893f[_0xabbf('0x3c')]!=='VIRTUAL'){var _0x2db236={};_0x2db236[_0x51893f[_0xabbf('0x35')]]={'$like':'%'+_0xca8f72[_0xabbf('0x3e')][_0xabbf('0x4a')]+'%'};return _0x2db236;}})});}_0x23fe97=_['merge']({},_0x23fe97,_0xca8f72['options']);var _0x599d39={'where':_0x23fe97[_0xabbf('0x48')]};return db[_0xabbf('0x39')][_0xabbf('0x2b')](_0x599d39)['then'](function(_0x49d810){_0x1a663c[_0xabbf('0x2b')]=_0x49d810;if(_0xca8f72[_0xabbf('0x3e')]['includeAll']){_0x23fe97[_0xabbf('0x4b')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xabbf('0x4c')](_0x23fe97);})[_0xabbf('0x31')](function(_0x513725){_0x1a663c[_0xabbf('0x4d')]=_0x513725;return _0x1a663c;})[_0xabbf('0x31')](respondWithFilteredResult(_0x2b59e3,_0x23fe97))[_0xabbf('0x4e')](handleError(_0x2b59e3,null));};exports[_0xabbf('0x4f')]=function(_0x2a8a1a,_0x2fa4ed){var _0x3d546a={'raw':![],'where':{'id':_0x2a8a1a[_0xabbf('0x50')]['id']}},_0x210bbe={};_0x210bbe[_0xabbf('0x3d')]=_['keys'](db['ServicenowConfiguration'][_0xabbf('0x3a')]);_0x210bbe[_0xabbf('0x3e')]=_['keys'](_0x2a8a1a['query']);_0x210bbe[_0xabbf('0x46')]=_[_0xabbf('0x41')](_0x210bbe[_0xabbf('0x3d')],_0x210bbe[_0xabbf('0x3e')]);_0x3d546a[_0xabbf('0x40')]=_[_0xabbf('0x41')](_0x210bbe['model'],qs['fields'](_0x2a8a1a[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x3d546a[_0xabbf('0x40')]=_0x3d546a[_0xabbf('0x40')][_0xabbf('0x51')]?_0x3d546a[_0xabbf('0x40')]:_0x210bbe['model'];if(_0x2a8a1a[_0xabbf('0x3e')]['includeAll']){_0x3d546a[_0xabbf('0x4b')]=[{'all':!![]}];}_0x3d546a=_[_0xabbf('0x49')]({},_0x3d546a,_0x2a8a1a[_0xabbf('0x52')]);return db[_0xabbf('0x39')][_0xabbf('0x53')](_0x3d546a)[_0xabbf('0x31')](handleEntityNotFound(_0x2fa4ed,null))['then'](respondWithResult(_0x2fa4ed,null))[_0xabbf('0x4e')](handleError(_0x2fa4ed,null));};exports[_0xabbf('0x54')]=function(_0x5b9af3,_0x389cf9){return db[_0xabbf('0x39')][_0xabbf('0x54')](_0x5b9af3[_0xabbf('0x55')],{})[_0xabbf('0x31')](respondWithResult(_0x389cf9,0xc9))[_0xabbf('0x4e')](handleError(_0x389cf9,null));};exports['update']=function(_0x51eb63,_0x2513a4){if(_0x51eb63[_0xabbf('0x55')]['id']){delete _0x51eb63[_0xabbf('0x55')]['id'];}return db['ServicenowConfiguration'][_0xabbf('0x53')]({'where':{'id':_0x51eb63['params']['id']}})[_0xabbf('0x31')](handleEntityNotFound(_0x2513a4,null))[_0xabbf('0x31')](saveUpdates(_0x51eb63[_0xabbf('0x55')],null))['then'](respondWithResult(_0x2513a4,null))[_0xabbf('0x4e')](handleError(_0x2513a4,null));};exports[_0xabbf('0x32')]=function(_0x150d67,_0x33de93){return db[_0xabbf('0x39')][_0xabbf('0x53')]({'where':{'id':_0x150d67[_0xabbf('0x50')]['id']}})[_0xabbf('0x31')](handleEntityNotFound(_0x33de93,null))['then'](removeEntity(_0x33de93,null))[_0xabbf('0x4e')](handleError(_0x33de93,null));};exports[_0xabbf('0x56')]=function(_0x3ff762,_0xae482,_0x334c89){var _0x31e78c={};var _0x393d09={};var _0x1a5a08;var _0x55b5e1;return db['ServicenowConfiguration'][_0xabbf('0x57')]({'where':{'id':_0x3ff762[_0xabbf('0x50')]['id']}})['then'](handleEntityNotFound(_0xae482,null))[_0xabbf('0x31')](function(_0x16be8){if(_0x16be8){_0x1a5a08=_0x16be8;_0x393d09[_0xabbf('0x3d')]=_[_0xabbf('0x3f')](db[_0xabbf('0x58')]['rawAttributes']);_0x393d09[_0xabbf('0x3e')]=_[_0xabbf('0x3f')](_0x3ff762[_0xabbf('0x3e')]);_0x393d09[_0xabbf('0x46')]=_[_0xabbf('0x41')](_0x393d09[_0xabbf('0x3d')],_0x393d09[_0xabbf('0x3e')]);_0x31e78c['attributes']=_['intersection'](_0x393d09[_0xabbf('0x3d')],qs[_0xabbf('0x42')](_0x3ff762[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x31e78c[_0xabbf('0x40')]=_0x31e78c[_0xabbf('0x40')][_0xabbf('0x51')]?_0x31e78c[_0xabbf('0x40')]:_0x393d09[_0xabbf('0x3d')];_0x31e78c[_0xabbf('0x44')]=qs['sort'](_0x3ff762['query'][_0xabbf('0x45')]);_0x31e78c[_0xabbf('0x48')]=qs[_0xabbf('0x46')](_[_0xabbf('0x47')](_0x3ff762[_0xabbf('0x3e')],_0x393d09[_0xabbf('0x46')]));if(_0x3ff762[_0xabbf('0x3e')]['filter']){_0x31e78c['where']=_[_0xabbf('0x49')](_0x31e78c['where'],{'$or':_[_0xabbf('0x38')](_0x31e78c[_0xabbf('0x40')],function(_0x5c3124){var _0x316386={};_0x316386[_0x5c3124]={'$like':'%'+_0x3ff762['query'][_0xabbf('0x4a')]+'%'};return _0x316386;})});}_0x31e78c=_[_0xabbf('0x49')]({},_0x31e78c,_0x3ff762[_0xabbf('0x52')]);return _0x1a5a08[_0xabbf('0x56')](_0x31e78c);}})[_0xabbf('0x31')](function(_0x5749b9){if(_0x5749b9){_0x55b5e1=_0x5749b9[_0xabbf('0x51')];if(!_0x3ff762[_0xabbf('0x3e')]['hasOwnProperty'](_0xabbf('0x59'))){_0x31e78c[_0xabbf('0x2a')]=qs['limit'](_0x3ff762[_0xabbf('0x3e')][_0xabbf('0x2a')]);_0x31e78c[_0xabbf('0x28')]=qs[_0xabbf('0x28')](_0x3ff762['query']['offset']);}return _0x1a5a08[_0xabbf('0x56')](_0x31e78c);}})[_0xabbf('0x31')](function(_0x229f80){if(_0x229f80){return _0x229f80?{'count':_0x55b5e1,'rows':_0x229f80}:null;}})['then'](respondWithResult(_0xae482,null))[_0xabbf('0x4e')](handleError(_0xae482,null));};exports[_0xabbf('0x5a')]=function(_0x16b00c,_0x23535a,_0x20383e){var _0x222a66={};var _0x340eca={};var _0x1e8b70;var _0x568ff3;return db[_0xabbf('0x39')][_0xabbf('0x57')]({'where':{'id':_0x16b00c['params']['id']}})['then'](handleEntityNotFound(_0x23535a,null))[_0xabbf('0x31')](function(_0x41f9fa){if(_0x41f9fa){_0x1e8b70=_0x41f9fa;_0x340eca[_0xabbf('0x3d')]=_[_0xabbf('0x3f')](db[_0xabbf('0x58')][_0xabbf('0x3a')]);_0x340eca[_0xabbf('0x3e')]=_['keys'](_0x16b00c[_0xabbf('0x3e')]);_0x340eca['filters']=_[_0xabbf('0x41')](_0x340eca[_0xabbf('0x3d')],_0x340eca[_0xabbf('0x3e')]);_0x222a66[_0xabbf('0x40')]=_['intersection'](_0x340eca['model'],qs[_0xabbf('0x42')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x222a66[_0xabbf('0x40')]=_0x222a66[_0xabbf('0x40')][_0xabbf('0x51')]?_0x222a66[_0xabbf('0x40')]:_0x340eca['model'];_0x222a66[_0xabbf('0x44')]=qs[_0xabbf('0x45')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x45')]);_0x222a66[_0xabbf('0x48')]=qs[_0xabbf('0x46')](_[_0xabbf('0x47')](_0x16b00c['query'],_0x340eca[_0xabbf('0x46')]));if(_0x16b00c['query']['filter']){_0x222a66[_0xabbf('0x48')]=_[_0xabbf('0x49')](_0x222a66['where'],{'$or':_['map'](_0x222a66[_0xabbf('0x40')],function(_0x2fd0fd){var _0x18667d={};_0x18667d[_0x2fd0fd]={'$like':'%'+_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x4a')]+'%'};return _0x18667d;})});}_0x222a66=_[_0xabbf('0x49')]({},_0x222a66,_0x16b00c['options']);return _0x1e8b70[_0xabbf('0x5a')](_0x222a66);}})[_0xabbf('0x31')](function(_0x88f0e5){if(_0x88f0e5){_0x568ff3=_0x88f0e5[_0xabbf('0x51')];if(!_0x16b00c['query'][_0xabbf('0x43')](_0xabbf('0x59'))){_0x222a66[_0xabbf('0x2a')]=qs[_0xabbf('0x2a')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x2a')]);_0x222a66[_0xabbf('0x28')]=qs[_0xabbf('0x28')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x28')]);}return _0x1e8b70['getSubjects'](_0x222a66);}})[_0xabbf('0x31')](function(_0x4dac27){if(_0x4dac27){return _0x4dac27?{'count':_0x568ff3,'rows':_0x4dac27}:null;}})[_0xabbf('0x31')](respondWithResult(_0x23535a,null))[_0xabbf('0x4e')](handleError(_0x23535a,null));};exports[_0xabbf('0x5b')]=function(_0x1fbab1,_0x502208,_0x2a1792){var _0x56fa90={};var _0x394708={};var _0x15d05b;var _0x25947b;return db[_0xabbf('0x39')][_0xabbf('0x57')]({'where':{'id':_0x1fbab1[_0xabbf('0x50')]['id']}})[_0xabbf('0x31')](handleEntityNotFound(_0x502208,null))[_0xabbf('0x31')](function(_0x39705f){if(_0x39705f){_0x15d05b=_0x39705f;_0x394708[_0xabbf('0x3d')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x394708[_0xabbf('0x3e')]=_[_0xabbf('0x3f')](_0x1fbab1['query']);_0x394708[_0xabbf('0x46')]=_[_0xabbf('0x41')](_0x394708[_0xabbf('0x3d')],_0x394708['query']);_0x56fa90[_0xabbf('0x40')]=_[_0xabbf('0x41')](_0x394708['model'],qs['fields'](_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x56fa90[_0xabbf('0x40')]=_0x56fa90[_0xabbf('0x40')][_0xabbf('0x51')]?_0x56fa90[_0xabbf('0x40')]:_0x394708[_0xabbf('0x3d')];_0x56fa90[_0xabbf('0x44')]=qs[_0xabbf('0x45')](_0x1fbab1[_0xabbf('0x3e')]['sort']);_0x56fa90[_0xabbf('0x48')]=qs['filters'](_[_0xabbf('0x47')](_0x1fbab1[_0xabbf('0x3e')],_0x394708[_0xabbf('0x46')]));if(_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x4a')]){_0x56fa90[_0xabbf('0x48')]=_['merge'](_0x56fa90['where'],{'$or':_[_0xabbf('0x38')](_0x56fa90[_0xabbf('0x40')],function(_0x4f0a11){var _0x68b4aa={};_0x68b4aa[_0x4f0a11]={'$like':'%'+_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x4a')]+'%'};return _0x68b4aa;})});}_0x56fa90=_[_0xabbf('0x49')]({},_0x56fa90,_0x1fbab1[_0xabbf('0x52')]);return _0x15d05b[_0xabbf('0x5b')](_0x56fa90);}})['then'](function(_0x48b934){if(_0x48b934){_0x25947b=_0x48b934[_0xabbf('0x51')];if(!_0x1fbab1[_0xabbf('0x3e')]['hasOwnProperty'](_0xabbf('0x59'))){_0x56fa90[_0xabbf('0x2a')]=qs[_0xabbf('0x2a')](_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x2a')]);_0x56fa90[_0xabbf('0x28')]=qs[_0xabbf('0x28')](_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x28')]);}return _0x15d05b['getDescriptions'](_0x56fa90);}})[_0xabbf('0x31')](function(_0x38f06b){if(_0x38f06b){return _0x38f06b?{'count':_0x25947b,'rows':_0x38f06b}:null;}})['then'](respondWithResult(_0x502208,null))[_0xabbf('0x4e')](handleError(_0x502208,null));}; \ No newline at end of file +var _0x90bd=['send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','ServicenowConfiguration','includeAll','include','show','params','find','create','body','destroy','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','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/environment','../../config/license/util','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','apply','reject','save','sendStatus','stack','name'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x90bd,0x1ed));var _0xd90b=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x90bd[_0x20ef64];return _0x3707d8;};'use strict';var emlformat=require(_0xd90b('0x0'));var rimraf=require(_0xd90b('0x1'));var zipdir=require(_0xd90b('0x2'));var jsonpatch=require(_0xd90b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd90b('0x4'));var Mustache=require(_0xd90b('0x5'));var util=require('util');var path=require(_0xd90b('0x6'));var sox=require(_0xd90b('0x7'));var csv=require(_0xd90b('0x8'));var ejs=require(_0xd90b('0x9'));var fs=require('fs');var fs_extra=require(_0xd90b('0xa'));var _=require(_0xd90b('0xb'));var squel=require(_0xd90b('0xc'));var crypto=require(_0xd90b('0xd'));var jsforce=require(_0xd90b('0xe'));var deskjs=require(_0xd90b('0xf'));var toCsv=require(_0xd90b('0x8'));var querystring=require(_0xd90b('0x10'));var Papa=require(_0xd90b('0x11'));var Redis=require(_0xd90b('0x12'));var authService=require(_0xd90b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd90b('0x14'));var hardwareService=require(_0xd90b('0x15'));var logger=require(_0xd90b('0x16'))(_0xd90b('0x17'));var utils=require('../../config/utils');var config=require(_0xd90b('0x18'));var licenseUtil=require(_0xd90b('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd90b('0x1a'));var client=jayson[_0xd90b('0x1b')][_0xd90b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4c165c,_0x5ac2bf,_0x3e2e5a,_0x441b13){return new BPromise(function(_0x80331f,_0x438628){var _0x314664=_0x441b13||client;return _0x314664[_0xd90b('0x1d')](_0x4c165c,_0x3e2e5a)[_0xd90b('0x1e')](function(_0x29ba61){logger[_0xd90b('0x1f')](_0xd90b('0x20'),_0x5ac2bf,_0xd90b('0x21'));logger[_0xd90b('0x22')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5ac2bf,'request\x20sent',JSON[_0xd90b('0x23')](_0x29ba61));if(_0x29ba61['error']){if(_0x29ba61[_0xd90b('0x24')]['code']===0x1f4){logger[_0xd90b('0x24')](_0xd90b('0x20'),_0x5ac2bf,_0x29ba61[_0xd90b('0x24')][_0xd90b('0x25')]);return _0x438628(_0x29ba61[_0xd90b('0x24')][_0xd90b('0x25')]);}logger[_0xd90b('0x24')](_0xd90b('0x20'),_0x5ac2bf,_0x29ba61[_0xd90b('0x24')][_0xd90b('0x25')]);return _0x80331f(_0x29ba61[_0xd90b('0x24')][_0xd90b('0x25')]);}else{logger[_0xd90b('0x1f')](_0xd90b('0x20'),_0x5ac2bf,'request\x20sent');_0x80331f(_0x29ba61[_0xd90b('0x26')][_0xd90b('0x25')]);}})[_0xd90b('0x27')](function(_0x23ef79){logger[_0xd90b('0x24')](_0xd90b('0x20'),_0x5ac2bf,_0x23ef79);_0x438628(_0x23ef79);});});}function respondWithStatusCode(_0x588841,_0xcf4fa3){_0xcf4fa3=_0xcf4fa3||0xcc;return function(_0x18919a){if(_0x18919a){return _0x588841['sendStatus'](_0xcf4fa3);}return _0x588841[_0xd90b('0x28')](_0xcf4fa3)[_0xd90b('0x29')]();};}function respondWithResult(_0xc647d8,_0x1812ff){_0x1812ff=_0x1812ff||0xc8;return function(_0x527760){if(_0x527760){return _0xc647d8[_0xd90b('0x28')](_0x1812ff)['json'](_0x527760);}};}function respondWithFilteredResult(_0x63dd47,_0x338e48){return function(_0x175847){if(_0x175847){var _0x3809f0=typeof _0x338e48[_0xd90b('0x2a')]===_0xd90b('0x2b')&&typeof _0x338e48[_0xd90b('0x2c')]===_0xd90b('0x2b');var _0x35719b=_0x175847[_0xd90b('0x2d')];var _0x2260e9=_0x3809f0?0x0:_0x338e48[_0xd90b('0x2a')];var _0x46c206=_0x3809f0?_0x175847[_0xd90b('0x2d')]:_0x338e48['offset']+_0x338e48[_0xd90b('0x2c')];var _0x5a9400;if(_0x46c206>=_0x35719b){_0x46c206=_0x35719b;_0x5a9400=0xc8;}else{_0x5a9400=0xce;}_0x63dd47['status'](_0x5a9400);return _0x63dd47[_0xd90b('0x2e')]('Content-Range',_0x2260e9+'-'+_0x46c206+'/'+_0x35719b)['json'](_0x175847);}return null;};}function patchUpdates(_0x2f9ca1){return function(_0x2f00f1){try{jsonpatch[_0xd90b('0x2f')](_0x2f00f1,_0x2f9ca1,!![]);}catch(_0x3a7a94){return BPromise[_0xd90b('0x30')](_0x3a7a94);}return _0x2f00f1[_0xd90b('0x31')]();};}function saveUpdates(_0x43372d,_0x48a6f1){return function(_0x4e1da0){if(_0x4e1da0){return _0x4e1da0['update'](_0x43372d)[_0xd90b('0x1e')](function(_0x3bfb13){return _0x3bfb13;});}return null;};}function removeEntity(_0x13e6ea,_0x1d705a){return function(_0x7ae32d){if(_0x7ae32d){return _0x7ae32d['destroy']()[_0xd90b('0x1e')](function(){_0x13e6ea['status'](0xcc)[_0xd90b('0x29')]();});}};}function handleEntityNotFound(_0x3eec73,_0x25418b){return function(_0x102728){if(!_0x102728){_0x3eec73[_0xd90b('0x32')](0x194);}return _0x102728;};}function handleError(_0x15d7df,_0x469955){_0x469955=_0x469955||0x1f4;return function(_0x5bfc30){logger[_0xd90b('0x24')](_0x5bfc30[_0xd90b('0x33')]);if(_0x5bfc30[_0xd90b('0x34')]){delete _0x5bfc30['name'];}_0x15d7df[_0xd90b('0x28')](_0x469955)[_0xd90b('0x35')](_0x5bfc30);};}exports[_0xd90b('0x36')]=function(_0x8438da,_0x11a7b7){var _0x56b304={},_0x260bf8={},_0x28ef3f={'count':0x0,'rows':[]};var _0x14d22a=_[_0xd90b('0x37')](db['ServicenowConfiguration']['rawAttributes'],function(_0x190a2f){return{'name':_0x190a2f['fieldName'],'type':_0x190a2f[_0xd90b('0x38')][_0xd90b('0x39')]};});_0x260bf8[_0xd90b('0x3a')]=_[_0xd90b('0x37')](_0x14d22a,_0xd90b('0x34'));_0x260bf8[_0xd90b('0x3b')]=_[_0xd90b('0x3c')](_0x8438da[_0xd90b('0x3b')]);_0x260bf8[_0xd90b('0x3d')]=_[_0xd90b('0x3e')](_0x260bf8[_0xd90b('0x3a')],_0x260bf8['query']);_0x56b304[_0xd90b('0x3f')]=_[_0xd90b('0x3e')](_0x260bf8[_0xd90b('0x3a')],qs[_0xd90b('0x40')](_0x8438da[_0xd90b('0x3b')][_0xd90b('0x40')]));_0x56b304[_0xd90b('0x3f')]=_0x56b304['attributes'][_0xd90b('0x41')]?_0x56b304[_0xd90b('0x3f')]:_0x260bf8['model'];if(!_0x8438da[_0xd90b('0x3b')][_0xd90b('0x42')]('nolimit')){_0x56b304[_0xd90b('0x2c')]=qs[_0xd90b('0x2c')](_0x8438da[_0xd90b('0x3b')][_0xd90b('0x2c')]);_0x56b304[_0xd90b('0x2a')]=qs[_0xd90b('0x2a')](_0x8438da['query'][_0xd90b('0x2a')]);}_0x56b304[_0xd90b('0x43')]=qs[_0xd90b('0x44')](_0x8438da['query'][_0xd90b('0x44')]);_0x56b304['where']=qs[_0xd90b('0x3d')](_[_0xd90b('0x45')](_0x8438da['query'],_0x260bf8[_0xd90b('0x3d')]),_0x14d22a);if(_0x8438da[_0xd90b('0x3b')]['filter']){_0x56b304['where']=_[_0xd90b('0x46')](_0x56b304[_0xd90b('0x47')],{'$or':_['map'](_0x14d22a,function(_0x33876c){if(_0x33876c['type']!==_0xd90b('0x48')){var _0x4d4c0e={};_0x4d4c0e[_0x33876c[_0xd90b('0x34')]]={'$like':'%'+_0x8438da[_0xd90b('0x3b')][_0xd90b('0x49')]+'%'};return _0x4d4c0e;}})});}_0x56b304=_['merge']({},_0x56b304,_0x8438da[_0xd90b('0x4a')]);var _0x3b2882={'where':_0x56b304[_0xd90b('0x47')]};return db[_0xd90b('0x4b')][_0xd90b('0x2d')](_0x3b2882)[_0xd90b('0x1e')](function(_0x507d18){_0x28ef3f['count']=_0x507d18;if(_0x8438da[_0xd90b('0x3b')][_0xd90b('0x4c')]){_0x56b304[_0xd90b('0x4d')]=[{'all':!![]}];}return db[_0xd90b('0x4b')]['findAll'](_0x56b304);})['then'](function(_0x1aef3c){_0x28ef3f['rows']=_0x1aef3c;return _0x28ef3f;})[_0xd90b('0x1e')](respondWithFilteredResult(_0x11a7b7,_0x56b304))[_0xd90b('0x27')](handleError(_0x11a7b7,null));};exports[_0xd90b('0x4e')]=function(_0x42b6fc,_0x4ffd64){var _0xd66fd8={'raw':![],'where':{'id':_0x42b6fc[_0xd90b('0x4f')]['id']}},_0xde1c14={};_0xde1c14[_0xd90b('0x3a')]=_[_0xd90b('0x3c')](db[_0xd90b('0x4b')]['rawAttributes']);_0xde1c14[_0xd90b('0x3b')]=_['keys'](_0x42b6fc[_0xd90b('0x3b')]);_0xde1c14[_0xd90b('0x3d')]=_['intersection'](_0xde1c14[_0xd90b('0x3a')],_0xde1c14[_0xd90b('0x3b')]);_0xd66fd8['attributes']=_['intersection'](_0xde1c14[_0xd90b('0x3a')],qs[_0xd90b('0x40')](_0x42b6fc[_0xd90b('0x3b')]['fields']));_0xd66fd8['attributes']=_0xd66fd8[_0xd90b('0x3f')]['length']?_0xd66fd8[_0xd90b('0x3f')]:_0xde1c14[_0xd90b('0x3a')];if(_0x42b6fc['query'][_0xd90b('0x4c')]){_0xd66fd8[_0xd90b('0x4d')]=[{'all':!![]}];}_0xd66fd8=_['merge']({},_0xd66fd8,_0x42b6fc[_0xd90b('0x4a')]);return db[_0xd90b('0x4b')][_0xd90b('0x50')](_0xd66fd8)[_0xd90b('0x1e')](handleEntityNotFound(_0x4ffd64,null))[_0xd90b('0x1e')](respondWithResult(_0x4ffd64,null))['catch'](handleError(_0x4ffd64,null));};exports[_0xd90b('0x51')]=function(_0x3b629c,_0x4d57fe){return db[_0xd90b('0x4b')]['create'](_0x3b629c['body'],{})['then'](respondWithResult(_0x4d57fe,0xc9))['catch'](handleError(_0x4d57fe,null));};exports['update']=function(_0x2cd86d,_0x164d64){if(_0x2cd86d[_0xd90b('0x52')]['id']){delete _0x2cd86d[_0xd90b('0x52')]['id'];}return db[_0xd90b('0x4b')][_0xd90b('0x50')]({'where':{'id':_0x2cd86d[_0xd90b('0x4f')]['id']}})[_0xd90b('0x1e')](handleEntityNotFound(_0x164d64,null))['then'](saveUpdates(_0x2cd86d[_0xd90b('0x52')],null))[_0xd90b('0x1e')](respondWithResult(_0x164d64,null))[_0xd90b('0x27')](handleError(_0x164d64,null));};exports[_0xd90b('0x53')]=function(_0xd823e0,_0x424aca){return db[_0xd90b('0x4b')][_0xd90b('0x50')]({'where':{'id':_0xd823e0[_0xd90b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x424aca,null))[_0xd90b('0x1e')](removeEntity(_0x424aca,null))[_0xd90b('0x27')](handleError(_0x424aca,null));};exports[_0xd90b('0x54')]=function(_0x28d4c7,_0xa538f7,_0x5e002a){var _0x4cba1d={};var _0x5d1de4={};var _0x14f7ca;var _0x30097a;return db[_0xd90b('0x4b')][_0xd90b('0x55')]({'where':{'id':_0x28d4c7['params']['id']}})[_0xd90b('0x1e')](handleEntityNotFound(_0xa538f7,null))[_0xd90b('0x1e')](function(_0xf4b8ac){if(_0xf4b8ac){_0x14f7ca=_0xf4b8ac;_0x5d1de4[_0xd90b('0x3a')]=_[_0xd90b('0x3c')](db[_0xd90b('0x56')]['rawAttributes']);_0x5d1de4[_0xd90b('0x3b')]=_[_0xd90b('0x3c')](_0x28d4c7['query']);_0x5d1de4['filters']=_[_0xd90b('0x3e')](_0x5d1de4[_0xd90b('0x3a')],_0x5d1de4[_0xd90b('0x3b')]);_0x4cba1d[_0xd90b('0x3f')]=_[_0xd90b('0x3e')](_0x5d1de4[_0xd90b('0x3a')],qs['fields'](_0x28d4c7['query'][_0xd90b('0x40')]));_0x4cba1d[_0xd90b('0x3f')]=_0x4cba1d[_0xd90b('0x3f')]['length']?_0x4cba1d[_0xd90b('0x3f')]:_0x5d1de4[_0xd90b('0x3a')];_0x4cba1d[_0xd90b('0x43')]=qs['sort'](_0x28d4c7[_0xd90b('0x3b')][_0xd90b('0x44')]);_0x4cba1d[_0xd90b('0x47')]=qs[_0xd90b('0x3d')](_[_0xd90b('0x45')](_0x28d4c7['query'],_0x5d1de4[_0xd90b('0x3d')]));if(_0x28d4c7[_0xd90b('0x3b')][_0xd90b('0x49')]){_0x4cba1d['where']=_[_0xd90b('0x46')](_0x4cba1d['where'],{'$or':_['map'](_0x4cba1d['attributes'],function(_0x1c0f66){var _0xd77957={};_0xd77957[_0x1c0f66]={'$like':'%'+_0x28d4c7[_0xd90b('0x3b')][_0xd90b('0x49')]+'%'};return _0xd77957;})});}_0x4cba1d=_[_0xd90b('0x46')]({},_0x4cba1d,_0x28d4c7[_0xd90b('0x4a')]);return _0x14f7ca[_0xd90b('0x54')](_0x4cba1d);}})[_0xd90b('0x1e')](function(_0x23a67f){if(_0x23a67f){_0x30097a=_0x23a67f[_0xd90b('0x41')];if(!_0x28d4c7[_0xd90b('0x3b')][_0xd90b('0x42')](_0xd90b('0x57'))){_0x4cba1d[_0xd90b('0x2c')]=qs[_0xd90b('0x2c')](_0x28d4c7[_0xd90b('0x3b')][_0xd90b('0x2c')]);_0x4cba1d['offset']=qs[_0xd90b('0x2a')](_0x28d4c7[_0xd90b('0x3b')][_0xd90b('0x2a')]);}return _0x14f7ca[_0xd90b('0x54')](_0x4cba1d);}})['then'](function(_0x1cc764){if(_0x1cc764){return _0x1cc764?{'count':_0x30097a,'rows':_0x1cc764}:null;}})[_0xd90b('0x1e')](respondWithResult(_0xa538f7,null))[_0xd90b('0x27')](handleError(_0xa538f7,null));};exports[_0xd90b('0x58')]=function(_0x594034,_0x171c8d,_0x4f46cc){var _0x504d9c={};var _0xe61c9e={};var _0x229ed3;var _0x486b21;return db[_0xd90b('0x4b')][_0xd90b('0x55')]({'where':{'id':_0x594034[_0xd90b('0x4f')]['id']}})[_0xd90b('0x1e')](handleEntityNotFound(_0x171c8d,null))[_0xd90b('0x1e')](function(_0x2bb9ed){if(_0x2bb9ed){_0x229ed3=_0x2bb9ed;_0xe61c9e[_0xd90b('0x3a')]=_['keys'](db[_0xd90b('0x56')]['rawAttributes']);_0xe61c9e[_0xd90b('0x3b')]=_[_0xd90b('0x3c')](_0x594034[_0xd90b('0x3b')]);_0xe61c9e['filters']=_[_0xd90b('0x3e')](_0xe61c9e[_0xd90b('0x3a')],_0xe61c9e[_0xd90b('0x3b')]);_0x504d9c[_0xd90b('0x3f')]=_[_0xd90b('0x3e')](_0xe61c9e[_0xd90b('0x3a')],qs['fields'](_0x594034['query'][_0xd90b('0x40')]));_0x504d9c[_0xd90b('0x3f')]=_0x504d9c[_0xd90b('0x3f')]['length']?_0x504d9c[_0xd90b('0x3f')]:_0xe61c9e['model'];_0x504d9c[_0xd90b('0x43')]=qs[_0xd90b('0x44')](_0x594034[_0xd90b('0x3b')]['sort']);_0x504d9c[_0xd90b('0x47')]=qs[_0xd90b('0x3d')](_[_0xd90b('0x45')](_0x594034[_0xd90b('0x3b')],_0xe61c9e[_0xd90b('0x3d')]));if(_0x594034[_0xd90b('0x3b')][_0xd90b('0x49')]){_0x504d9c['where']=_[_0xd90b('0x46')](_0x504d9c[_0xd90b('0x47')],{'$or':_[_0xd90b('0x37')](_0x504d9c['attributes'],function(_0x10217e){var _0x12f7c5={};_0x12f7c5[_0x10217e]={'$like':'%'+_0x594034[_0xd90b('0x3b')][_0xd90b('0x49')]+'%'};return _0x12f7c5;})});}_0x504d9c=_[_0xd90b('0x46')]({},_0x504d9c,_0x594034['options']);return _0x229ed3[_0xd90b('0x58')](_0x504d9c);}})[_0xd90b('0x1e')](function(_0x43bc52){if(_0x43bc52){_0x486b21=_0x43bc52[_0xd90b('0x41')];if(!_0x594034[_0xd90b('0x3b')][_0xd90b('0x42')]('nolimit')){_0x504d9c[_0xd90b('0x2c')]=qs[_0xd90b('0x2c')](_0x594034[_0xd90b('0x3b')][_0xd90b('0x2c')]);_0x504d9c[_0xd90b('0x2a')]=qs[_0xd90b('0x2a')](_0x594034['query']['offset']);}return _0x229ed3[_0xd90b('0x58')](_0x504d9c);}})['then'](function(_0x5291e1){if(_0x5291e1){return _0x5291e1?{'count':_0x486b21,'rows':_0x5291e1}:null;}})['then'](respondWithResult(_0x171c8d,null))[_0xd90b('0x27')](handleError(_0x171c8d,null));};exports[_0xd90b('0x59')]=function(_0x11aaa8,_0x5147d9,_0x3b0d4b){var _0x4887d0={};var _0x2fd137={};var _0xf90bad;var _0x52d8ae;return db['ServicenowConfiguration'][_0xd90b('0x55')]({'where':{'id':_0x11aaa8['params']['id']}})[_0xd90b('0x1e')](handleEntityNotFound(_0x5147d9,null))[_0xd90b('0x1e')](function(_0x5ab4ba){if(_0x5ab4ba){_0xf90bad=_0x5ab4ba;_0x2fd137['model']=_[_0xd90b('0x3c')](db[_0xd90b('0x56')][_0xd90b('0x5a')]);_0x2fd137['query']=_[_0xd90b('0x3c')](_0x11aaa8['query']);_0x2fd137[_0xd90b('0x3d')]=_[_0xd90b('0x3e')](_0x2fd137[_0xd90b('0x3a')],_0x2fd137[_0xd90b('0x3b')]);_0x4887d0[_0xd90b('0x3f')]=_[_0xd90b('0x3e')](_0x2fd137[_0xd90b('0x3a')],qs[_0xd90b('0x40')](_0x11aaa8[_0xd90b('0x3b')][_0xd90b('0x40')]));_0x4887d0[_0xd90b('0x3f')]=_0x4887d0['attributes'][_0xd90b('0x41')]?_0x4887d0[_0xd90b('0x3f')]:_0x2fd137[_0xd90b('0x3a')];_0x4887d0[_0xd90b('0x43')]=qs['sort'](_0x11aaa8[_0xd90b('0x3b')]['sort']);_0x4887d0[_0xd90b('0x47')]=qs[_0xd90b('0x3d')](_['pick'](_0x11aaa8[_0xd90b('0x3b')],_0x2fd137[_0xd90b('0x3d')]));if(_0x11aaa8['query']['filter']){_0x4887d0[_0xd90b('0x47')]=_[_0xd90b('0x46')](_0x4887d0[_0xd90b('0x47')],{'$or':_[_0xd90b('0x37')](_0x4887d0['attributes'],function(_0x2ee339){var _0x2b3580={};_0x2b3580[_0x2ee339]={'$like':'%'+_0x11aaa8[_0xd90b('0x3b')][_0xd90b('0x49')]+'%'};return _0x2b3580;})});}_0x4887d0=_[_0xd90b('0x46')]({},_0x4887d0,_0x11aaa8[_0xd90b('0x4a')]);return _0xf90bad[_0xd90b('0x59')](_0x4887d0);}})[_0xd90b('0x1e')](function(_0xaa3739){if(_0xaa3739){_0x52d8ae=_0xaa3739[_0xd90b('0x41')];if(!_0x11aaa8[_0xd90b('0x3b')][_0xd90b('0x42')](_0xd90b('0x57'))){_0x4887d0['limit']=qs[_0xd90b('0x2c')](_0x11aaa8[_0xd90b('0x3b')][_0xd90b('0x2c')]);_0x4887d0[_0xd90b('0x2a')]=qs['offset'](_0x11aaa8[_0xd90b('0x3b')][_0xd90b('0x2a')]);}return _0xf90bad[_0xd90b('0x59')](_0x4887d0);}})[_0xd90b('0x1e')](function(_0x3c59a5){if(_0x3c59a5){return _0x3c59a5?{'count':_0x52d8ae,'rows':_0x3c59a5}:null;}})['then'](respondWithResult(_0x5147d9,null))[_0xd90b('0x27')](handleError(_0x5147d9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 82319c6..8996a82 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 _0x7fb3=['api','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','util','../../config/logger'];(function(_0x41c4a0,_0x4e61a7){var _0x4d9326=function(_0x4dd574){while(--_0x4dd574){_0x41c4a0['push'](_0x41c4a0['shift']());}};_0x4d9326(++_0x4e61a7);}(_0x7fb3,0xf9));var _0x37fb=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x7fb3[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x37fb('0x0'));var util=require(_0x37fb('0x1'));var logger=require(_0x37fb('0x2'))(_0x37fb('0x3'));var moment=require('moment');var BPromise=require(_0x37fb('0x4'));var rp=require(_0x37fb('0x5'));var fs=require('fs');var path=require(_0x37fb('0x6'));var rimraf=require(_0x37fb('0x7'));var config=require('../../config/environment');var attributes=require(_0x37fb('0x8'));module[_0x37fb('0x9')]=function(_0x2443bd,_0x23a839){return _0x2443bd[_0x37fb('0xa')](_0x37fb('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcae2=['int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x142156,_0x5169f8){var _0x5b1ea3=function(_0x26080b){while(--_0x26080b){_0x142156['push'](_0x142156['shift']());}};_0x5b1ea3(++_0x5169f8);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var logger=require(_0x2cae('0x2'))(_0x2cae('0x3'));var moment=require(_0x2cae('0x4'));var BPromise=require(_0x2cae('0x5'));var rp=require(_0x2cae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cae('0x7'));var config=require(_0x2cae('0x8'));var attributes=require(_0x2cae('0x9'));module[_0x2cae('0xa')]=function(_0x57cbf8,_0x3a3e3b){return _0x57cbf8[_0x2cae('0xb')](_0x2cae('0xc'),attributes,{'tableName':_0x2cae('0xd'),'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 5ce9591..55cf9c0 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 _0xbc89=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1dd6a1,_0x532dd0){var _0x301dca=function(_0x1dc56f){while(--_0x1dc56f){_0x1dd6a1['push'](_0x1dd6a1['shift']());}};_0x301dca(++_0x532dd0);}(_0xbc89,0x9c));var _0x9bc8=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0xbc89[_0x2d5934];return _0x5807c8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9bc8('0x0'));var rs=require(_0x9bc8('0x1'));var fs=require('fs');var Redis=require(_0x9bc8('0x2'));var db=require(_0x9bc8('0x3'))['db'];var utils=require(_0x9bc8('0x4'));var logger=require(_0x9bc8('0x5'))(_0x9bc8('0x6'));var config=require(_0x9bc8('0x7'));var jayson=require(_0x9bc8('0x8'));var client=jayson[_0x9bc8('0x9')][_0x9bc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x417bb1,_0x5f16c8,_0x5eb132){return new BPromise(function(_0x486e97,_0x578b31){return client[_0x9bc8('0xb')](_0x417bb1,_0x5eb132)[_0x9bc8('0xc')](function(_0x212f43){logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,_0x9bc8('0xf'));logger[_0x9bc8('0x10')](_0x9bc8('0x11'),_0x5f16c8,_0x9bc8('0xf'),JSON[_0x9bc8('0x12')](_0x212f43));if(_0x212f43[_0x9bc8('0x13')]){if(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x14')]===0x1f4){logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')]['message']);return _0x578b31(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);return _0x486e97(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}else{logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,'request\x20sent');_0x486e97(_0x212f43[_0x9bc8('0x16')][_0x9bc8('0x15')]);}})[_0x9bc8('0x17')](function(_0x16d830){logger[_0x9bc8('0x13')](_0x9bc8('0xe'),_0x5f16c8,_0x16d830);_0x578b31(_0x16d830);});});} \ No newline at end of file +var _0x1702=['jayson/promise','client','http','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3f186c,_0x407d8c){var _0x16f766=function(_0x145a9f){while(--_0x145a9f){_0x3f186c['push'](_0x3f186c['shift']());}};_0x16f766(++_0x407d8c);}(_0x1702,0x114));var _0x2170=function(_0x2a4a08,_0x2fe082){_0x2a4a08=_0x2a4a08-0x0;var _0x4e7860=_0x1702[_0x2a4a08];return _0x4e7860;};'use strict';var _=require(_0x2170('0x0'));var util=require(_0x2170('0x1'));var moment=require(_0x2170('0x2'));var BPromise=require(_0x2170('0x3'));var rs=require(_0x2170('0x4'));var fs=require('fs');var Redis=require(_0x2170('0x5'));var db=require(_0x2170('0x6'))['db'];var utils=require(_0x2170('0x7'));var logger=require('../../config/logger')(_0x2170('0x8'));var config=require(_0x2170('0x9'));var jayson=require(_0x2170('0xa'));var client=jayson[_0x2170('0xb')][_0x2170('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b6233,_0x4446d8,_0x34151f){return new BPromise(function(_0x2f937f,_0xe8569e){return client[_0x2170('0xd')](_0x4b6233,_0x34151f)[_0x2170('0xe')](function(_0x5ee74f){logger[_0x2170('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4446d8,'request\x20sent');logger[_0x2170('0x10')](_0x2170('0x11'),_0x4446d8,_0x2170('0x12'),JSON[_0x2170('0x13')](_0x5ee74f));if(_0x5ee74f[_0x2170('0x14')]){if(_0x5ee74f[_0x2170('0x14')][_0x2170('0x15')]===0x1f4){logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x5ee74f['error'][_0x2170('0x17')]);return _0xe8569e(_0x5ee74f[_0x2170('0x14')][_0x2170('0x17')]);}logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x5ee74f['error'][_0x2170('0x17')]);return _0x2f937f(_0x5ee74f['error'][_0x2170('0x17')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x4446d8,_0x2170('0x12'));_0x2f937f(_0x5ee74f[_0x2170('0x18')][_0x2170('0x17')]);}})[_0x2170('0x19')](function(_0x455ee2){logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x455ee2);_0xe8569e(_0x455ee2);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 0bd1e1a..2291281 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 _0x4c46=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x38ea20,_0x5f3c35){var _0x273671=function(_0x3cb6f6){while(--_0x3cb6f6){_0x38ea20['push'](_0x38ea20['shift']());}};_0x273671(++_0x5f3c35);}(_0x4c46,0x1e2));var _0x64c4=function(_0x575d43,_0x5b74ce){_0x575d43=_0x575d43-0x0;var _0x5d0e4a=_0x4c46[_0x575d43];return _0x5d0e4a;};'use strict';var multer=require('multer');var util=require(_0x64c4('0x0'));var path=require(_0x64c4('0x1'));var timeout=require(_0x64c4('0x2'));var express=require(_0x64c4('0x3'));var router=express[_0x64c4('0x4')]();var fs_extra=require(_0x64c4('0x5'));var auth=require(_0x64c4('0x6'));var interaction=require(_0x64c4('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x64c4('0x8')](),controller[_0x64c4('0x9')]);router[_0x64c4('0xa')](_0x64c4('0xb'),auth[_0x64c4('0x8')](),controller[_0x64c4('0xc')]);router[_0x64c4('0xd')]('/',auth[_0x64c4('0x8')](),controller[_0x64c4('0xe')]);router[_0x64c4('0xf')](_0x64c4('0xb'),auth[_0x64c4('0x8')](),controller[_0x64c4('0x10')]);router[_0x64c4('0x11')](_0x64c4('0xb'),auth['isAuthenticated'](),controller[_0x64c4('0x12')]);module[_0x64c4('0x13')]=router; \ No newline at end of file +var _0x1136=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1136,0x1ae));var _0x6113=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1136[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x6113('0x0'));var util=require('util');var path=require(_0x6113('0x1'));var timeout=require(_0x6113('0x2'));var express=require(_0x6113('0x3'));var router=express[_0x6113('0x4')]();var fs_extra=require(_0x6113('0x5'));var auth=require(_0x6113('0x6'));var interaction=require(_0x6113('0x7'));var config=require(_0x6113('0x8'));var controller=require(_0x6113('0x9'));router[_0x6113('0xa')]('/',auth[_0x6113('0xb')](),controller[_0x6113('0xc')]);router[_0x6113('0xa')](_0x6113('0xd'),auth[_0x6113('0xb')](),controller['show']);router[_0x6113('0xe')]('/',auth[_0x6113('0xb')](),controller['create']);router[_0x6113('0xf')]('/:id',auth[_0x6113('0xb')](),controller[_0x6113('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6113('0x11')]);module[_0x6113('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 84c83a6..3d55684 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 _0x3f63=['STRING','ENUM','string','variable','customVariable','picklist'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3f63,0x73));var _0x33f6=function(_0x55a0ca,_0x4e62a4){_0x55a0ca=_0x55a0ca-0x0;var _0x1d726e=_0x3f63[_0x55a0ca];return _0x1d726e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x33f6('0x0')](_0x33f6('0x1'),_0x33f6('0x2'),_0x33f6('0x3'),'keyValue',_0x33f6('0x4')),'defaultValue':_0x33f6('0x1')},'content':{'type':Sequelize[_0x33f6('0x5')]},'key':{'type':Sequelize[_0x33f6('0x5')]},'keyType':{'type':Sequelize[_0x33f6('0x0')](_0x33f6('0x1'),_0x33f6('0x2'),_0x33f6('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x33f6('0x5')]},'nameField':{'type':Sequelize[_0x33f6('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x33f6('0x5')]}}; \ No newline at end of file +var _0x2508=['variable','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x5c374a,_0x1bf759){var _0x55baa6=function(_0x8c1a09){while(--_0x8c1a09){_0x5c374a['push'](_0x5c374a['shift']());}};_0x55baa6(++_0x1bf759);}(_0x2508,0x1e9));var _0x8250=function(_0x51c6e1,_0x37c29c){_0x51c6e1=_0x51c6e1-0x0;var _0x5c63a4=_0x2508[_0x51c6e1];return _0x5c63a4;};'use strict';var Sequelize=require('sequelize');module[_0x8250('0x0')]={'type':{'type':Sequelize[_0x8250('0x1')](_0x8250('0x2'),'variable',_0x8250('0x3'),_0x8250('0x4'),_0x8250('0x5')),'defaultValue':_0x8250('0x2')},'content':{'type':Sequelize[_0x8250('0x6')]},'key':{'type':Sequelize[_0x8250('0x6')]},'keyType':{'type':Sequelize[_0x8250('0x1')]('string',_0x8250('0x7'),_0x8250('0x3'))},'keyContent':{'type':Sequelize[_0x8250('0x6')]},'idField':{'type':Sequelize[_0x8250('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8250('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 2f15cbf..b9b7a00 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 _0xb647=['where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ServicenowField','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter'];(function(_0x40a07f,_0x35d50e){var _0x4b8246=function(_0x3ffb30){while(--_0x3ffb30){_0x40a07f['push'](_0x40a07f['shift']());}};_0x4b8246(++_0x35d50e);}(_0xb647,0x181));var _0x7b64=function(_0x406733,_0x58036c){_0x406733=_0x406733-0x0;var _0x4e4994=_0xb647[_0x406733];return _0x4e4994;};'use strict';var emlformat=require(_0x7b64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b64('0x1'));var jsonpatch=require(_0x7b64('0x2'));var rp=require(_0x7b64('0x3'));var moment=require(_0x7b64('0x4'));var BPromise=require(_0x7b64('0x5'));var Mustache=require('mustache');var util=require(_0x7b64('0x6'));var path=require(_0x7b64('0x7'));var sox=require(_0x7b64('0x8'));var csv=require(_0x7b64('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b64('0xa'));var _=require(_0x7b64('0xb'));var squel=require(_0x7b64('0xc'));var crypto=require(_0x7b64('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7b64('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b64('0xf'));var Papa=require(_0x7b64('0x10'));var Redis=require(_0x7b64('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7b64('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b64('0x13'))('api');var utils=require(_0x7b64('0x14'));var config=require(_0x7b64('0x15'));var licenseUtil=require(_0x7b64('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f16b8,_0xb00b43){_0xb00b43=_0xb00b43||0xcc;return function(_0x164133){if(_0x164133){return _0x4f16b8['sendStatus'](_0xb00b43);}return _0x4f16b8[_0x7b64('0x17')](_0xb00b43)[_0x7b64('0x18')]();};}function respondWithResult(_0x1f13bb,_0x5476f5){_0x5476f5=_0x5476f5||0xc8;return function(_0x3c3f71){if(_0x3c3f71){return _0x1f13bb[_0x7b64('0x17')](_0x5476f5)[_0x7b64('0x19')](_0x3c3f71);}};}function respondWithFilteredResult(_0x4cd3b8,_0x2a2c1b){return function(_0x1fa737){if(_0x1fa737){var _0x18d691=typeof _0x2a2c1b[_0x7b64('0x1a')]===_0x7b64('0x1b')&&typeof _0x2a2c1b[_0x7b64('0x1c')]===_0x7b64('0x1b');var _0x407560=_0x1fa737['count'];var _0x29f0ce=_0x18d691?0x0:_0x2a2c1b[_0x7b64('0x1a')];var _0x100ca7=_0x18d691?_0x1fa737[_0x7b64('0x1d')]:_0x2a2c1b['offset']+_0x2a2c1b[_0x7b64('0x1c')];var _0x18db0e;if(_0x100ca7>=_0x407560){_0x100ca7=_0x407560;_0x18db0e=0xc8;}else{_0x18db0e=0xce;}_0x4cd3b8[_0x7b64('0x17')](_0x18db0e);return _0x4cd3b8[_0x7b64('0x1e')](_0x7b64('0x1f'),_0x29f0ce+'-'+_0x100ca7+'/'+_0x407560)[_0x7b64('0x19')](_0x1fa737);}return null;};}function patchUpdates(_0x4a73e3){return function(_0x205316){try{jsonpatch[_0x7b64('0x20')](_0x205316,_0x4a73e3,!![]);}catch(_0x557da4){return BPromise[_0x7b64('0x21')](_0x557da4);}return _0x205316[_0x7b64('0x22')]();};}function saveUpdates(_0x367d23,_0x2543a6){return function(_0x4d294d){if(_0x4d294d){return _0x4d294d[_0x7b64('0x23')](_0x367d23)[_0x7b64('0x24')](function(_0x45acb1){return _0x45acb1;});}return null;};}function removeEntity(_0x5b2239,_0x5db75b){return function(_0xfd19f0){if(_0xfd19f0){return _0xfd19f0[_0x7b64('0x25')]()['then'](function(){_0x5b2239[_0x7b64('0x17')](0xcc)[_0x7b64('0x18')]();});}};}function handleEntityNotFound(_0x30c83f,_0x2d5bb5){return function(_0x373411){if(!_0x373411){_0x30c83f[_0x7b64('0x26')](0x194);}return _0x373411;};}function handleError(_0x432b7d,_0x11b47a){_0x11b47a=_0x11b47a||0x1f4;return function(_0x319840){logger['error'](_0x319840[_0x7b64('0x27')]);if(_0x319840['name']){delete _0x319840[_0x7b64('0x28')];}_0x432b7d[_0x7b64('0x17')](_0x11b47a)[_0x7b64('0x29')](_0x319840);};}exports[_0x7b64('0x2a')]=function(_0x4c6fa1,_0x587ab3){var _0x5c1cb1={},_0x5ba8d7={},_0x5b966f={'count':0x0,'rows':[]};var _0x4cf119=_[_0x7b64('0x2b')](db[_0x7b64('0x2c')][_0x7b64('0x2d')],function(_0x3a29cb){return{'name':_0x3a29cb['fieldName'],'type':_0x3a29cb[_0x7b64('0x2e')][_0x7b64('0x2f')]};});_0x5ba8d7[_0x7b64('0x30')]=_[_0x7b64('0x2b')](_0x4cf119,_0x7b64('0x28'));_0x5ba8d7[_0x7b64('0x31')]=_['keys'](_0x4c6fa1['query']);_0x5ba8d7[_0x7b64('0x32')]=_[_0x7b64('0x33')](_0x5ba8d7[_0x7b64('0x30')],_0x5ba8d7[_0x7b64('0x31')]);_0x5c1cb1[_0x7b64('0x34')]=_[_0x7b64('0x33')](_0x5ba8d7[_0x7b64('0x30')],qs[_0x7b64('0x35')](_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x35')]));_0x5c1cb1[_0x7b64('0x34')]=_0x5c1cb1[_0x7b64('0x34')]['length']?_0x5c1cb1['attributes']:_0x5ba8d7[_0x7b64('0x30')];if(!_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x36')](_0x7b64('0x37'))){_0x5c1cb1['limit']=qs[_0x7b64('0x1c')](_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x1c')]);_0x5c1cb1[_0x7b64('0x1a')]=qs['offset'](_0x4c6fa1['query'][_0x7b64('0x1a')]);}_0x5c1cb1[_0x7b64('0x38')]=qs['sort'](_0x4c6fa1[_0x7b64('0x31')]['sort']);_0x5c1cb1['where']=qs[_0x7b64('0x32')](_[_0x7b64('0x39')](_0x4c6fa1['query'],_0x5ba8d7[_0x7b64('0x32')]),_0x4cf119);if(_0x4c6fa1['query'][_0x7b64('0x3a')]){_0x5c1cb1[_0x7b64('0x3b')]=_['merge'](_0x5c1cb1[_0x7b64('0x3b')],{'$or':_[_0x7b64('0x2b')](_0x4cf119,function(_0x21b28d){if(_0x21b28d[_0x7b64('0x2e')]!==_0x7b64('0x3c')){var _0x258956={};_0x258956[_0x21b28d[_0x7b64('0x28')]]={'$like':'%'+_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x3a')]+'%'};return _0x258956;}})});}_0x5c1cb1=_[_0x7b64('0x3d')]({},_0x5c1cb1,_0x4c6fa1[_0x7b64('0x3e')]);var _0x4fdf17={'where':_0x5c1cb1[_0x7b64('0x3b')]};return db[_0x7b64('0x2c')]['count'](_0x4fdf17)[_0x7b64('0x24')](function(_0x57238f){_0x5b966f[_0x7b64('0x1d')]=_0x57238f;if(_0x4c6fa1['query'][_0x7b64('0x3f')]){_0x5c1cb1[_0x7b64('0x40')]=[{'all':!![]}];}return db[_0x7b64('0x2c')][_0x7b64('0x41')](_0x5c1cb1);})[_0x7b64('0x24')](function(_0x5cb85f){_0x5b966f[_0x7b64('0x42')]=_0x5cb85f;return _0x5b966f;})[_0x7b64('0x24')](respondWithFilteredResult(_0x587ab3,_0x5c1cb1))[_0x7b64('0x43')](handleError(_0x587ab3,null));};exports['show']=function(_0x3b1ed1,_0x5e9446){var _0x1c58cb={'raw':!![],'where':{'id':_0x3b1ed1[_0x7b64('0x44')]['id']}},_0x306872={};_0x306872[_0x7b64('0x30')]=_['keys'](db[_0x7b64('0x2c')][_0x7b64('0x2d')]);_0x306872[_0x7b64('0x31')]=_[_0x7b64('0x45')](_0x3b1ed1[_0x7b64('0x31')]);_0x306872['filters']=_[_0x7b64('0x33')](_0x306872[_0x7b64('0x30')],_0x306872[_0x7b64('0x31')]);_0x1c58cb['attributes']=_[_0x7b64('0x33')](_0x306872[_0x7b64('0x30')],qs[_0x7b64('0x35')](_0x3b1ed1[_0x7b64('0x31')]['fields']));_0x1c58cb['attributes']=_0x1c58cb['attributes'][_0x7b64('0x46')]?_0x1c58cb[_0x7b64('0x34')]:_0x306872[_0x7b64('0x30')];if(_0x3b1ed1['query'][_0x7b64('0x3f')]){_0x1c58cb[_0x7b64('0x40')]=[{'all':!![]}];}_0x1c58cb=_['merge']({},_0x1c58cb,_0x3b1ed1['options']);return db['ServicenowField'][_0x7b64('0x47')](_0x1c58cb)[_0x7b64('0x24')](handleEntityNotFound(_0x5e9446,null))[_0x7b64('0x24')](respondWithResult(_0x5e9446,null))[_0x7b64('0x43')](handleError(_0x5e9446,null));};exports['create']=function(_0x56b0d8,_0xe67049){return db['ServicenowField'][_0x7b64('0x48')](_0x56b0d8[_0x7b64('0x49')],{})['then'](respondWithResult(_0xe67049,0xc9))[_0x7b64('0x43')](handleError(_0xe67049,null));};exports[_0x7b64('0x23')]=function(_0x18d415,_0x39414a){if(_0x18d415[_0x7b64('0x49')]['id']){delete _0x18d415[_0x7b64('0x49')]['id'];}return db[_0x7b64('0x2c')]['find']({'where':{'id':_0x18d415[_0x7b64('0x44')]['id']}})[_0x7b64('0x24')](handleEntityNotFound(_0x39414a,null))[_0x7b64('0x24')](saveUpdates(_0x18d415[_0x7b64('0x49')],null))['then'](respondWithResult(_0x39414a,null))[_0x7b64('0x43')](handleError(_0x39414a,null));};exports[_0x7b64('0x25')]=function(_0x1c6de8,_0x2a7856){return db['ServicenowField'][_0x7b64('0x47')]({'where':{'id':_0x1c6de8['params']['id']}})[_0x7b64('0x24')](handleEntityNotFound(_0x2a7856,null))[_0x7b64('0x24')](removeEntity(_0x2a7856,null))['catch'](handleError(_0x2a7856,null));}; \ No newline at end of file +var _0x6c95=['destroy','end','error','stack','name','send','index','map','ServicenowField','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','rows','catch','params','includeAll','find','create','body','update','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save'];(function(_0x1993fd,_0x1effdc){var _0x1667ef=function(_0xd0e07){while(--_0xd0e07){_0x1993fd['push'](_0x1993fd['shift']());}};_0x1667ef(++_0x1effdc);}(_0x6c95,0xc2));var _0x56c9=function(_0x37bb98,_0x30908c){_0x37bb98=_0x37bb98-0x0;var _0x2d1751=_0x6c95[_0x37bb98];return _0x2d1751;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x56c9('0x0'));var jsonpatch=require(_0x56c9('0x1'));var rp=require(_0x56c9('0x2'));var moment=require(_0x56c9('0x3'));var BPromise=require(_0x56c9('0x4'));var Mustache=require(_0x56c9('0x5'));var util=require(_0x56c9('0x6'));var path=require(_0x56c9('0x7'));var sox=require(_0x56c9('0x8'));var csv=require(_0x56c9('0x9'));var ejs=require(_0x56c9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56c9('0xb'));var squel=require(_0x56c9('0xc'));var crypto=require(_0x56c9('0xd'));var jsforce=require(_0x56c9('0xe'));var deskjs=require(_0x56c9('0xf'));var toCsv=require(_0x56c9('0x9'));var querystring=require(_0x56c9('0x10'));var Papa=require(_0x56c9('0x11'));var Redis=require(_0x56c9('0x12'));var authService=require(_0x56c9('0x13'));var qs=require(_0x56c9('0x14'));var as=require(_0x56c9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56c9('0x16'))(_0x56c9('0x17'));var utils=require(_0x56c9('0x18'));var config=require(_0x56c9('0x19'));var licenseUtil=require(_0x56c9('0x1a'));var db=require(_0x56c9('0x1b'))['db'];function respondWithStatusCode(_0x1ddbdb,_0x1a9d7c){_0x1a9d7c=_0x1a9d7c||0xcc;return function(_0x560228){if(_0x560228){return _0x1ddbdb[_0x56c9('0x1c')](_0x1a9d7c);}return _0x1ddbdb[_0x56c9('0x1d')](_0x1a9d7c)['end']();};}function respondWithResult(_0x57ab05,_0x1d32c9){_0x1d32c9=_0x1d32c9||0xc8;return function(_0x4a16c9){if(_0x4a16c9){return _0x57ab05[_0x56c9('0x1d')](_0x1d32c9)['json'](_0x4a16c9);}};}function respondWithFilteredResult(_0x48865f,_0xf97151){return function(_0x434a4c){if(_0x434a4c){var _0x332f5d=typeof _0xf97151[_0x56c9('0x1e')]===_0x56c9('0x1f')&&typeof _0xf97151[_0x56c9('0x20')]===_0x56c9('0x1f');var _0x3d8a3b=_0x434a4c[_0x56c9('0x21')];var _0x16e988=_0x332f5d?0x0:_0xf97151[_0x56c9('0x1e')];var _0xf528ce=_0x332f5d?_0x434a4c[_0x56c9('0x21')]:_0xf97151[_0x56c9('0x1e')]+_0xf97151[_0x56c9('0x20')];var _0x1ffe16;if(_0xf528ce>=_0x3d8a3b){_0xf528ce=_0x3d8a3b;_0x1ffe16=0xc8;}else{_0x1ffe16=0xce;}_0x48865f['status'](_0x1ffe16);return _0x48865f[_0x56c9('0x22')](_0x56c9('0x23'),_0x16e988+'-'+_0xf528ce+'/'+_0x3d8a3b)[_0x56c9('0x24')](_0x434a4c);}return null;};}function patchUpdates(_0x3285fa){return function(_0x206345){try{jsonpatch[_0x56c9('0x25')](_0x206345,_0x3285fa,!![]);}catch(_0x1a18d5){return BPromise[_0x56c9('0x26')](_0x1a18d5);}return _0x206345[_0x56c9('0x27')]();};}function saveUpdates(_0x2902b7,_0x2771a7){return function(_0x2ae6c2){if(_0x2ae6c2){return _0x2ae6c2['update'](_0x2902b7)['then'](function(_0x28f82a){return _0x28f82a;});}return null;};}function removeEntity(_0x43bbf4,_0x437bf7){return function(_0x825fc3){if(_0x825fc3){return _0x825fc3[_0x56c9('0x28')]()['then'](function(){_0x43bbf4[_0x56c9('0x1d')](0xcc)[_0x56c9('0x29')]();});}};}function handleEntityNotFound(_0x3bbbe1,_0x5507ce){return function(_0x3e576f){if(!_0x3e576f){_0x3bbbe1['sendStatus'](0x194);}return _0x3e576f;};}function handleError(_0x27b2ee,_0x5356b6){_0x5356b6=_0x5356b6||0x1f4;return function(_0x5ebe6a){logger[_0x56c9('0x2a')](_0x5ebe6a[_0x56c9('0x2b')]);if(_0x5ebe6a[_0x56c9('0x2c')]){delete _0x5ebe6a['name'];}_0x27b2ee[_0x56c9('0x1d')](_0x5356b6)[_0x56c9('0x2d')](_0x5ebe6a);};}exports[_0x56c9('0x2e')]=function(_0x3fa438,_0x9ac1b2){var _0x2b737c={},_0x1344c4={},_0x2fbd48={'count':0x0,'rows':[]};var _0x315f12=_[_0x56c9('0x2f')](db[_0x56c9('0x30')]['rawAttributes'],function(_0x5b8f4a){return{'name':_0x5b8f4a['fieldName'],'type':_0x5b8f4a[_0x56c9('0x31')][_0x56c9('0x32')]};});_0x1344c4[_0x56c9('0x33')]=_[_0x56c9('0x2f')](_0x315f12,_0x56c9('0x2c'));_0x1344c4['query']=_[_0x56c9('0x34')](_0x3fa438[_0x56c9('0x35')]);_0x1344c4[_0x56c9('0x36')]=_[_0x56c9('0x37')](_0x1344c4[_0x56c9('0x33')],_0x1344c4[_0x56c9('0x35')]);_0x2b737c[_0x56c9('0x38')]=_[_0x56c9('0x37')](_0x1344c4[_0x56c9('0x33')],qs[_0x56c9('0x39')](_0x3fa438[_0x56c9('0x35')][_0x56c9('0x39')]));_0x2b737c['attributes']=_0x2b737c[_0x56c9('0x38')][_0x56c9('0x3a')]?_0x2b737c[_0x56c9('0x38')]:_0x1344c4[_0x56c9('0x33')];if(!_0x3fa438[_0x56c9('0x35')][_0x56c9('0x3b')]('nolimit')){_0x2b737c[_0x56c9('0x20')]=qs[_0x56c9('0x20')](_0x3fa438['query'][_0x56c9('0x20')]);_0x2b737c[_0x56c9('0x1e')]=qs[_0x56c9('0x1e')](_0x3fa438[_0x56c9('0x35')][_0x56c9('0x1e')]);}_0x2b737c[_0x56c9('0x3c')]=qs['sort'](_0x3fa438[_0x56c9('0x35')][_0x56c9('0x3d')]);_0x2b737c[_0x56c9('0x3e')]=qs[_0x56c9('0x36')](_[_0x56c9('0x3f')](_0x3fa438['query'],_0x1344c4[_0x56c9('0x36')]),_0x315f12);if(_0x3fa438['query'][_0x56c9('0x40')]){_0x2b737c[_0x56c9('0x3e')]=_[_0x56c9('0x41')](_0x2b737c[_0x56c9('0x3e')],{'$or':_['map'](_0x315f12,function(_0x2c555b){if(_0x2c555b[_0x56c9('0x31')]!==_0x56c9('0x42')){var _0x44e1a0={};_0x44e1a0[_0x2c555b[_0x56c9('0x2c')]]={'$like':'%'+_0x3fa438[_0x56c9('0x35')]['filter']+'%'};return _0x44e1a0;}})});}_0x2b737c=_[_0x56c9('0x41')]({},_0x2b737c,_0x3fa438[_0x56c9('0x43')]);var _0x40149d={'where':_0x2b737c[_0x56c9('0x3e')]};return db[_0x56c9('0x30')]['count'](_0x40149d)[_0x56c9('0x44')](function(_0x21ba82){_0x2fbd48['count']=_0x21ba82;if(_0x3fa438[_0x56c9('0x35')]['includeAll']){_0x2b737c['include']=[{'all':!![]}];}return db[_0x56c9('0x30')][_0x56c9('0x45')](_0x2b737c);})['then'](function(_0x287264){_0x2fbd48[_0x56c9('0x46')]=_0x287264;return _0x2fbd48;})[_0x56c9('0x44')](respondWithFilteredResult(_0x9ac1b2,_0x2b737c))[_0x56c9('0x47')](handleError(_0x9ac1b2,null));};exports['show']=function(_0x358ab8,_0x23abec){var _0x3c2d3f={'raw':!![],'where':{'id':_0x358ab8[_0x56c9('0x48')]['id']}},_0x563c3c={};_0x563c3c['model']=_[_0x56c9('0x34')](db[_0x56c9('0x30')]['rawAttributes']);_0x563c3c['query']=_[_0x56c9('0x34')](_0x358ab8['query']);_0x563c3c[_0x56c9('0x36')]=_[_0x56c9('0x37')](_0x563c3c[_0x56c9('0x33')],_0x563c3c[_0x56c9('0x35')]);_0x3c2d3f[_0x56c9('0x38')]=_[_0x56c9('0x37')](_0x563c3c['model'],qs[_0x56c9('0x39')](_0x358ab8['query'][_0x56c9('0x39')]));_0x3c2d3f[_0x56c9('0x38')]=_0x3c2d3f['attributes']['length']?_0x3c2d3f['attributes']:_0x563c3c['model'];if(_0x358ab8[_0x56c9('0x35')][_0x56c9('0x49')]){_0x3c2d3f['include']=[{'all':!![]}];}_0x3c2d3f=_['merge']({},_0x3c2d3f,_0x358ab8[_0x56c9('0x43')]);return db[_0x56c9('0x30')][_0x56c9('0x4a')](_0x3c2d3f)[_0x56c9('0x44')](handleEntityNotFound(_0x23abec,null))[_0x56c9('0x44')](respondWithResult(_0x23abec,null))[_0x56c9('0x47')](handleError(_0x23abec,null));};exports[_0x56c9('0x4b')]=function(_0x359779,_0x489b84){return db[_0x56c9('0x30')][_0x56c9('0x4b')](_0x359779[_0x56c9('0x4c')],{})[_0x56c9('0x44')](respondWithResult(_0x489b84,0xc9))[_0x56c9('0x47')](handleError(_0x489b84,null));};exports[_0x56c9('0x4d')]=function(_0x563101,_0xb8d093){if(_0x563101[_0x56c9('0x4c')]['id']){delete _0x563101['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x563101[_0x56c9('0x48')]['id']}})[_0x56c9('0x44')](handleEntityNotFound(_0xb8d093,null))['then'](saveUpdates(_0x563101[_0x56c9('0x4c')],null))[_0x56c9('0x44')](respondWithResult(_0xb8d093,null))[_0x56c9('0x47')](handleError(_0xb8d093,null));};exports[_0x56c9('0x28')]=function(_0x558805,_0x58043c){return db[_0x56c9('0x30')]['find']({'where':{'id':_0x558805[_0x56c9('0x48')]['id']}})['then'](handleEntityNotFound(_0x58043c,null))[_0x56c9('0x44')](removeEntity(_0x58043c,null))[_0x56c9('0x47')](handleError(_0x58043c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 2d0131c..b9cdf44 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 _0x9202=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','idField','FieldId','lodash','util','moment','bluebird'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x9202,0x1c3));var _0x2920=function(_0x185ba0,_0x2dad2b){_0x185ba0=_0x185ba0-0x0;var _0x595a59=_0x9202[_0x185ba0];return _0x595a59;};'use strict';var _=require(_0x2920('0x0'));var util=require(_0x2920('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2920('0x2'));var BPromise=require(_0x2920('0x3'));var rp=require(_0x2920('0x4'));var fs=require('fs');var path=require(_0x2920('0x5'));var rimraf=require(_0x2920('0x6'));var config=require(_0x2920('0x7'));var attributes=require(_0x2920('0x8'));module[_0x2920('0x9')]=function(_0x52ae35,_0x4efe4c){return _0x52ae35[_0x2920('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x2920('0xb'),_0x2920('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0146=['../../config/environment','exports','define','servicenow_unique_index','FieldId','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x1c208e,_0x2a0a5b){var _0x5104ff=function(_0x3ca41f){while(--_0x3ca41f){_0x1c208e['push'](_0x1c208e['shift']());}};_0x5104ff(++_0x2a0a5b);}(_0x0146,0x118));var _0x6014=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x0146[_0x3c51d4];return _0x53c45f;};'use strict';var _=require('lodash');var util=require(_0x6014('0x0'));var logger=require(_0x6014('0x1'))('api');var moment=require(_0x6014('0x2'));var BPromise=require('bluebird');var rp=require(_0x6014('0x3'));var fs=require('fs');var path=require(_0x6014('0x4'));var rimraf=require(_0x6014('0x5'));var config=require(_0x6014('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x6014('0x7')]=function(_0xcd7dd6,_0x53f9a9){return _0xcd7dd6[_0x6014('0x8')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x6014('0x9'),'fields':['idField',_0x6014('0xa')],'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 a816f86..797f2ad 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x551add,_0x417d26){_0x551add=_0x551add-0x0;var _0x143014=_0xac4a[_0x551add];return _0x143014;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x506bce,_0x3a3ba7){var _0x5650c3=function(_0x54340d){while(--_0x54340d){_0x506bce['push'](_0x506bce['shift']());}};_0x5650c3(++_0x3a3ba7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xcb91[_0x1abeb2];return _0x48da20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 9f08200..d00c292 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x112168,_0x105574){var _0x1a72e7=function(_0x56bfb1){while(--_0x56bfb1){_0x112168['push'](_0x112168['shift']());}};_0x1a72e7(++_0x105574);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x54e178,_0x40f48a){var _0x141c7f=function(_0x2d114a){while(--_0x2d114a){_0x54e178['push'](_0x54e178['shift']());}};_0x141c7f(++_0x40f48a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 3d827bf..9236547 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(_0x2ae3c6,_0x4fdd28){var _0x4af38f=function(_0x58512f){while(--_0x58512f){_0x2ae3c6['push'](_0x2ae3c6['shift']());}};_0x4af38f(++_0x4fdd28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x1b48da,_0x233621){var _0x25dea0=function(_0x76559c){while(--_0x76559c){_0x1b48da['push'](_0x1b48da['shift']());}};_0x25dea0(++_0x233621);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 98019f0..d6d5e5b 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 _0xa705=['show','options','create','update','find','params','getConfigurations','findOne','body','AccountId','Subjects','getSubjects','channel','SugarcrmConfiguration','SugarcrmField','Descriptions','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x15482e,_0x25b23c){var _0x4a0651=function(_0x5afab4){while(--_0x5afab4){_0x15482e['push'](_0x15482e['shift']());}};_0x4a0651(++_0x25b23c);}(_0xa705,0xb5));var _0x5a70=function(_0x1a06af,_0x9679e7){_0x1a06af=_0x1a06af-0x0;var _0x3d5ea9=_0xa705[_0x1a06af];return _0x3d5ea9;};'use strict';var emlformat=require(_0x5a70('0x0'));var rimraf=require(_0x5a70('0x1'));var zipdir=require(_0x5a70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a70('0x3'));var moment=require('moment');var BPromise=require(_0x5a70('0x4'));var Mustache=require('mustache');var util=require(_0x5a70('0x5'));var path=require(_0x5a70('0x6'));var sox=require('sox');var csv=require(_0x5a70('0x7'));var ejs=require(_0x5a70('0x8'));var fs=require('fs');var fs_extra=require(_0x5a70('0x9'));var _=require(_0x5a70('0xa'));var squel=require(_0x5a70('0xb'));var crypto=require('crypto');var jsforce=require(_0x5a70('0xc'));var deskjs=require(_0x5a70('0xd'));var toCsv=require(_0x5a70('0x7'));var querystring=require(_0x5a70('0xe'));var Papa=require('papaparse');var Redis=require(_0x5a70('0xf'));var authService=require(_0x5a70('0x10'));var qs=require(_0x5a70('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a70('0x12'));var logger=require(_0x5a70('0x13'))(_0x5a70('0x14'));var utils=require(_0x5a70('0x15'));var config=require(_0x5a70('0x16'));var licenseUtil=require(_0x5a70('0x17'));var db=require(_0x5a70('0x18'))['db'];var integrations=require(_0x5a70('0x19'));var jayson=require(_0x5a70('0x1a'));var client=jayson[_0x5a70('0x1b')][_0x5a70('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4b28c3,_0x5c6c72,_0x482699,_0x5c8194){return new BPromise(function(_0x5f4568,_0x3b9fee){var _0x96e559=_0x5c8194||client;return _0x96e559[_0x5a70('0x1d')](_0x4b28c3,_0x482699)['then'](function(_0x1058f4){logger['info'](_0x5a70('0x1e'),_0x5c6c72,_0x5a70('0x1f'));logger[_0x5a70('0x20')](_0x5a70('0x21'),_0x5c6c72,'request\x20sent',JSON[_0x5a70('0x22')](_0x1058f4));if(_0x1058f4[_0x5a70('0x23')]){if(_0x1058f4['error'][_0x5a70('0x24')]===0x1f4){logger['error'](_0x5a70('0x1e'),_0x5c6c72,_0x1058f4[_0x5a70('0x23')][_0x5a70('0x25')]);return _0x3b9fee(_0x1058f4['error']['message']);}logger[_0x5a70('0x23')](_0x5a70('0x1e'),_0x5c6c72,_0x1058f4[_0x5a70('0x23')][_0x5a70('0x25')]);return _0x5f4568(_0x1058f4['error'][_0x5a70('0x25')]);}else{logger[_0x5a70('0x26')](_0x5a70('0x1e'),_0x5c6c72,_0x5a70('0x1f'));_0x5f4568(_0x1058f4[_0x5a70('0x27')][_0x5a70('0x25')]);}})[_0x5a70('0x28')](function(_0x4ad30a){logger[_0x5a70('0x23')](_0x5a70('0x1e'),_0x5c6c72,_0x4ad30a);_0x3b9fee(_0x4ad30a);});});}function respondWithStatusCode(_0x4e9d68,_0x2c0cbb){_0x2c0cbb=_0x2c0cbb||0xcc;return function(_0x54ea3e){if(_0x54ea3e){return _0x4e9d68[_0x5a70('0x29')](_0x2c0cbb);}return _0x4e9d68[_0x5a70('0x2a')](_0x2c0cbb)[_0x5a70('0x2b')]();};}function respondWithResult(_0x5bbe2a,_0x1ded3c){_0x1ded3c=_0x1ded3c||0xc8;return function(_0xa5edb1){if(_0xa5edb1){return _0x5bbe2a[_0x5a70('0x2a')](_0x1ded3c)[_0x5a70('0x2c')](_0xa5edb1);}};}function respondWithFilteredResult(_0x9afa2c,_0x29c8a1){return function(_0x13307e){if(_0x13307e){var _0x40cda1=typeof _0x29c8a1[_0x5a70('0x2d')]===_0x5a70('0x2e')&&typeof _0x29c8a1[_0x5a70('0x2f')]==='undefined';var _0x19355a=_0x13307e[_0x5a70('0x30')];var _0x20d8a9=_0x40cda1?0x0:_0x29c8a1['offset'];var _0x28953e=_0x40cda1?_0x13307e['count']:_0x29c8a1['offset']+_0x29c8a1[_0x5a70('0x2f')];var _0x31f4b4;if(_0x28953e>=_0x19355a){_0x28953e=_0x19355a;_0x31f4b4=0xc8;}else{_0x31f4b4=0xce;}_0x9afa2c[_0x5a70('0x2a')](_0x31f4b4);return _0x9afa2c[_0x5a70('0x31')](_0x5a70('0x32'),_0x20d8a9+'-'+_0x28953e+'/'+_0x19355a)[_0x5a70('0x2c')](_0x13307e);}return null;};}function patchUpdates(_0x3493a1){return function(_0x581ce3){try{jsonpatch[_0x5a70('0x33')](_0x581ce3,_0x3493a1,!![]);}catch(_0x87d139){return BPromise[_0x5a70('0x34')](_0x87d139);}return _0x581ce3[_0x5a70('0x35')]();};}function saveUpdates(_0x179884,_0x56bf17){return function(_0x29d48a){if(_0x29d48a){return _0x29d48a['update'](_0x179884)[_0x5a70('0x36')](function(_0xbb1b0d){return _0xbb1b0d;});}return null;};}function removeEntity(_0x333b36,_0x1467fa){return function(_0x5cfbc2){if(_0x5cfbc2){return _0x5cfbc2[_0x5a70('0x37')]()[_0x5a70('0x36')](function(){_0x333b36[_0x5a70('0x2a')](0xcc)[_0x5a70('0x2b')]();});}};}function handleEntityNotFound(_0x11e2e3,_0x55bbce){return function(_0x109959){if(!_0x109959){_0x11e2e3[_0x5a70('0x29')](0x194);}return _0x109959;};}function handleError(_0x47a61d,_0x58f447){_0x58f447=_0x58f447||0x1f4;return function(_0x1a376b){logger['error'](_0x1a376b[_0x5a70('0x38')]);if(_0x1a376b[_0x5a70('0x39')]){delete _0x1a376b[_0x5a70('0x39')];}_0x47a61d[_0x5a70('0x2a')](_0x58f447)[_0x5a70('0x3a')](_0x1a376b);};}exports[_0x5a70('0x3b')]=function(_0x34e7a0,_0x598355){var _0x4ce9e9={},_0x59dc9f={},_0x43f6ad={'count':0x0,'rows':[]};var _0x4191e4=_[_0x5a70('0x3c')](db[_0x5a70('0x3d')]['rawAttributes'],function(_0x277a86){return{'name':_0x277a86[_0x5a70('0x3e')],'type':_0x277a86[_0x5a70('0x3f')][_0x5a70('0x40')]};});_0x59dc9f[_0x5a70('0x41')]=_[_0x5a70('0x3c')](_0x4191e4,_0x5a70('0x39'));_0x59dc9f[_0x5a70('0x42')]=_[_0x5a70('0x43')](_0x34e7a0['query']);_0x59dc9f['filters']=_[_0x5a70('0x44')](_0x59dc9f[_0x5a70('0x41')],_0x59dc9f[_0x5a70('0x42')]);_0x4ce9e9[_0x5a70('0x45')]=_[_0x5a70('0x44')](_0x59dc9f[_0x5a70('0x41')],qs[_0x5a70('0x46')](_0x34e7a0['query']['fields']));_0x4ce9e9[_0x5a70('0x45')]=_0x4ce9e9[_0x5a70('0x45')][_0x5a70('0x47')]?_0x4ce9e9[_0x5a70('0x45')]:_0x59dc9f[_0x5a70('0x41')];if(!_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x48')](_0x5a70('0x49'))){_0x4ce9e9['limit']=qs[_0x5a70('0x2f')](_0x34e7a0['query'][_0x5a70('0x2f')]);_0x4ce9e9['offset']=qs['offset'](_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x2d')]);}_0x4ce9e9[_0x5a70('0x4a')]=qs[_0x5a70('0x4b')](_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x4b')]);_0x4ce9e9[_0x5a70('0x4c')]=qs[_0x5a70('0x4d')](_[_0x5a70('0x4e')](_0x34e7a0[_0x5a70('0x42')],_0x59dc9f['filters']),_0x4191e4);if(_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x4f')]){_0x4ce9e9['where']=_[_0x5a70('0x50')](_0x4ce9e9['where'],{'$or':_['map'](_0x4191e4,function(_0x27b137){if(_0x27b137[_0x5a70('0x3f')]!==_0x5a70('0x51')){var _0x4df307={};_0x4df307[_0x27b137['name']]={'$like':'%'+_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x4f')]+'%'};return _0x4df307;}})});}_0x4ce9e9=_[_0x5a70('0x50')]({},_0x4ce9e9,_0x34e7a0['options']);var _0x5c3f71={'where':_0x4ce9e9[_0x5a70('0x4c')]};return db[_0x5a70('0x3d')]['count'](_0x5c3f71)[_0x5a70('0x36')](function(_0x2f9b5c){_0x43f6ad[_0x5a70('0x30')]=_0x2f9b5c;if(_0x34e7a0['query'][_0x5a70('0x52')]){_0x4ce9e9[_0x5a70('0x53')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x5a70('0x54')](_0x4ce9e9);})[_0x5a70('0x36')](function(_0x40848a){_0x43f6ad['rows']=_0x40848a;return _0x43f6ad;})['then'](respondWithFilteredResult(_0x598355,_0x4ce9e9))[_0x5a70('0x28')](handleError(_0x598355,null));};exports[_0x5a70('0x55')]=function(_0x2e431c,_0x59d35a){var _0x245bcb={'raw':![],'where':{'id':_0x2e431c['params']['id']}},_0x1bf74a={};_0x1bf74a['model']=_['keys'](db[_0x5a70('0x3d')]['rawAttributes']);_0x1bf74a['query']=_[_0x5a70('0x43')](_0x2e431c[_0x5a70('0x42')]);_0x1bf74a[_0x5a70('0x4d')]=_['intersection'](_0x1bf74a['model'],_0x1bf74a[_0x5a70('0x42')]);_0x245bcb[_0x5a70('0x45')]=_['intersection'](_0x1bf74a['model'],qs['fields'](_0x2e431c[_0x5a70('0x42')][_0x5a70('0x46')]));_0x245bcb[_0x5a70('0x45')]=_0x245bcb[_0x5a70('0x45')]['length']?_0x245bcb[_0x5a70('0x45')]:_0x1bf74a[_0x5a70('0x41')];if(_0x2e431c[_0x5a70('0x42')][_0x5a70('0x52')]){_0x245bcb[_0x5a70('0x53')]=[{'all':!![]}];}_0x245bcb=_[_0x5a70('0x50')]({},_0x245bcb,_0x2e431c[_0x5a70('0x56')]);return db[_0x5a70('0x3d')]['find'](_0x245bcb)[_0x5a70('0x36')](handleEntityNotFound(_0x59d35a,null))['then'](respondWithResult(_0x59d35a,null))[_0x5a70('0x28')](handleError(_0x59d35a,null));};exports[_0x5a70('0x57')]=function(_0x32c0c0,_0x55215d){return db[_0x5a70('0x3d')]['create'](_0x32c0c0['body'],{})[_0x5a70('0x36')](respondWithResult(_0x55215d,0xc9))[_0x5a70('0x28')](handleError(_0x55215d,null));};exports[_0x5a70('0x58')]=function(_0x461b81,_0x367715){if(_0x461b81['body']['id']){delete _0x461b81['body']['id'];}return db[_0x5a70('0x3d')][_0x5a70('0x59')]({'where':{'id':_0x461b81['params']['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x367715,null))[_0x5a70('0x36')](saveUpdates(_0x461b81['body'],null))[_0x5a70('0x36')](respondWithResult(_0x367715,null))['catch'](handleError(_0x367715,null));};exports['destroy']=function(_0x3c41e6,_0x4dd33e){return db[_0x5a70('0x3d')][_0x5a70('0x59')]({'where':{'id':_0x3c41e6[_0x5a70('0x5a')]['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x4dd33e,null))[_0x5a70('0x36')](removeEntity(_0x4dd33e,null))['catch'](handleError(_0x4dd33e,null));};exports[_0x5a70('0x5b')]=function(_0x3fed8b,_0x5e3e93,_0x519092){var _0x1a2037={};var _0x308f44={};var _0x4d6191;var _0x4bee77;return db[_0x5a70('0x3d')][_0x5a70('0x5c')]({'where':{'id':_0x3fed8b[_0x5a70('0x5a')]['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x5e3e93,null))['then'](function(_0x215678){if(_0x215678){_0x4d6191=_0x215678;_0x308f44[_0x5a70('0x41')]=_[_0x5a70('0x43')](db['SugarcrmConfiguration']['rawAttributes']);_0x308f44['query']=_[_0x5a70('0x43')](_0x3fed8b[_0x5a70('0x42')]);_0x308f44['filters']=_[_0x5a70('0x44')](_0x308f44[_0x5a70('0x41')],_0x308f44['query']);_0x1a2037[_0x5a70('0x45')]=_[_0x5a70('0x44')](_0x308f44[_0x5a70('0x41')],qs['fields'](_0x3fed8b[_0x5a70('0x42')]['fields']));_0x1a2037[_0x5a70('0x45')]=_0x1a2037[_0x5a70('0x45')][_0x5a70('0x47')]?_0x1a2037[_0x5a70('0x45')]:_0x308f44[_0x5a70('0x41')];_0x1a2037['order']=qs[_0x5a70('0x4b')](_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x4b')]);_0x1a2037[_0x5a70('0x4c')]=qs[_0x5a70('0x4d')](_[_0x5a70('0x4e')](_0x3fed8b[_0x5a70('0x42')],_0x308f44[_0x5a70('0x4d')]));if(_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x4f')]){_0x1a2037['where']=_['merge'](_0x1a2037[_0x5a70('0x4c')],{'$or':_[_0x5a70('0x3c')](_0x1a2037[_0x5a70('0x45')],function(_0x31a7d4){var _0x682a5e={};_0x682a5e[_0x31a7d4]={'$like':'%'+_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x4f')]+'%'};return _0x682a5e;})});}_0x1a2037=_['merge']({},_0x1a2037,_0x3fed8b[_0x5a70('0x56')]);return _0x4d6191[_0x5a70('0x5b')](_0x1a2037);}})[_0x5a70('0x36')](function(_0x2cd42f){if(_0x2cd42f){_0x4bee77=_0x2cd42f[_0x5a70('0x47')];if(!_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x48')](_0x5a70('0x49'))){_0x1a2037[_0x5a70('0x2f')]=qs[_0x5a70('0x2f')](_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x2f')]);_0x1a2037[_0x5a70('0x2d')]=qs['offset'](_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x2d')]);}return _0x4d6191['getConfigurations'](_0x1a2037);}})['then'](function(_0x45c369){if(_0x45c369){return _0x45c369?{'count':_0x4bee77,'rows':_0x45c369}:null;}})[_0x5a70('0x36')](respondWithResult(_0x5e3e93,null))[_0x5a70('0x28')](handleError(_0x5e3e93,null));};exports['addConfiguration']=function(_0x4d365c,_0x46387e,_0x3a61a9){if(_0x4d365c[_0x5a70('0x5d')]['id']){delete _0x4d365c[_0x5a70('0x5d')]['id'];}return db[_0x5a70('0x3d')][_0x5a70('0x5c')]({'where':{'id':_0x4d365c[_0x5a70('0x5a')]['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x46387e,null))[_0x5a70('0x36')](function(_0x540a75){if(_0x540a75){_0x4d365c['body'][_0x5a70('0x5e')]=_0x540a75['id'];_0x4d365c[_0x5a70('0x5d')][_0x5a70('0x5f')]=integrations[_0x5a70('0x60')](_0x4d365c['body'][_0x5a70('0x61')],_0x4d365c['body'][_0x5a70('0x3f')]);_0x4d365c[_0x5a70('0x5d')]['Descriptions']=integrations['getDescriptions'](_0x4d365c['body'][_0x5a70('0x61')],_0x4d365c[_0x5a70('0x5d')]['type']);return db[_0x5a70('0x62')][_0x5a70('0x57')](_0x4d365c[_0x5a70('0x5d')],{'include':[{'model':db[_0x5a70('0x63')],'as':_0x5a70('0x5f')},{'model':db[_0x5a70('0x63')],'as':_0x5a70('0x64')}]});}return null;})[_0x5a70('0x36')](respondWithResult(_0x46387e,null))[_0x5a70('0x28')](handleError(_0x46387e,null));};exports['getFields']=function(_0x2af748,_0xe663f4,_0xc625ba){var _0x47ba85='';var _0x1c006c=['id',_0x5a70('0x39'),_0x5a70('0x65'),'created_by',_0x5a70('0x66'),'date_start',_0x5a70('0x67'),_0x5a70('0x68'),_0x5a70('0x69'),_0x5a70('0x6a'),_0x5a70('0x6b'),_0x5a70('0x6c')];return db[_0x5a70('0x3d')][_0x5a70('0x5c')]({'where':{'id':_0x2af748[_0x5a70('0x5a')]['id']},'attributes':['id',_0x5a70('0x6d'),_0x5a70('0x6e'),_0x5a70('0x6f')]})[_0x5a70('0x36')](handleEntityNotFound(_0xe663f4,null))['then'](function(_0x778262){if(_0x778262){_0x47ba85=_0x778262[_0x5a70('0x6f')];var _0x3f618a=_0x47ba85['slice'](-0x1);if(_0x3f618a==='/'){_0x47ba85=_0x47ba85[_0x5a70('0x70')](0x0,_0x47ba85[_0x5a70('0x71')](_0x3f618a));}return rp({'method':_0x5a70('0x72'),'uri':util[_0x5a70('0x73')]('%s%s',_0x47ba85,_0x5a70('0x74')),'json':!![],'form':{'method':_0x5a70('0x75'),'input_type':'JSON','response_type':_0x5a70('0x76'),'rest_data':JSON[_0x5a70('0x22')]({'user_auth':{'user_name':_0x778262[_0x5a70('0x6d')],'password':_0x778262[_0x5a70('0x6e')],'encryption':'PLAIN'},'application':_0x5a70('0x77')})}});}})[_0x5a70('0x36')](function(_0x3413e8){if(_0x3413e8&&_0x3413e8[_0x5a70('0x39')]!==_0x5a70('0x78')&&_0x3413e8[_0x5a70('0x39')]!==_0x5a70('0x79')){return rp({'method':_0x5a70('0x72'),'uri':util['format']('%s%s',_0x47ba85,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x5a70('0x76'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3413e8['id'],'module_name':_0x5a70('0x7a')})}})[_0x5a70('0x36')](function(_0xa660){if(_0xa660){var _0x55e8d4=_['values'](_0xa660[_0x5a70('0x7b')]);_[_0x5a70('0x7c')](_0x55e8d4,function(_0x55983c){return _0x1c006c['includes'](_0x55983c['name']);});return{'count':_0x55e8d4[_0x5a70('0x47')],'rows':_[_0x5a70('0x3c')](_0x55e8d4,function(_0x5f5074){return{'id':_0x5f5074['name'],'name':_0x5f5074[_0x5a70('0x7d')],'custom':_[_0x5a70('0x7e')](_0x5f5074['name'],'_c')?!![]:![],'options':_0x5f5074['options']?_[_0x5a70('0x3c')](_['values'](_0x5f5074['options']),function(_0x408c0a){return{'name':_0x408c0a[_0x5a70('0x7f')],'value':_0x408c0a[_0x5a70('0x39')]};}):[]};})};}})['then'](respondWithResult(_0xe663f4,null))[_0x5a70('0x28')](function(_0x2654d7){var _0x582fb7=_0x2af748[_0x5a70('0x42')][_0x5a70('0x80')]?0x1f4:_0x2654d7[_0x5a70('0x81')]||0x1f4;logger['error'](_0x5a70('0x82'),_0x5a70('0x83'),_0x582fb7,JSON[_0x5a70('0x22')](_0x2654d7));delete _0x2654d7['name'];if(_0x582fb7===0x191){_0x582fb7=0x190;}_0xe663f4['status'](_0x582fb7)[_0x5a70('0x3a')](_0x2af748[_0x5a70('0x42')][_0x5a70('0x80')]?{'message':_0x5a70('0x84'),'statusCode':_0x2654d7[_0x5a70('0x81')]}:_0x2654d7);});}else{var _0x48845e=0x1f4;_0xe663f4[_0x5a70('0x2a')](_0x48845e)['send']({'message':_0x5a70('0x84'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6c79=['rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../components/integrations/configuration','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','destroy','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','options','include','SugarcrmAccount','rows','catch','show','params','rawAttributes','length','includeAll','merge','create','body','update','find','findOne','SugarcrmConfiguration','getConfigurations','hasOwnProperty','addConfiguration','Subjects','channel','getDescriptions','SugarcrmField','Descriptions','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','JSON','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','Calls','values','module_fields','remove','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format'];(function(_0x3c78e8,_0x49b38e){var _0x5f382f=function(_0x1996f1){while(--_0x1996f1){_0x3c78e8['push'](_0x3c78e8['shift']());}};_0x5f382f(++_0x49b38e);}(_0x6c79,0xed));var _0x96c7=function(_0x3f8219,_0x454879){_0x3f8219=_0x3f8219-0x0;var _0x4148e8=_0x6c79[_0x3f8219];return _0x4148e8;};'use strict';var emlformat=require(_0x96c7('0x0'));var rimraf=require(_0x96c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96c7('0x2'));var rp=require(_0x96c7('0x3'));var moment=require('moment');var BPromise=require(_0x96c7('0x4'));var Mustache=require('mustache');var util=require(_0x96c7('0x5'));var path=require('path');var sox=require(_0x96c7('0x6'));var csv=require(_0x96c7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96c7('0x8'));var _=require(_0x96c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x96c7('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c7('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x96c7('0xc'));var qs=require(_0x96c7('0xd'));var as=require(_0x96c7('0xe'));var hardwareService=require(_0x96c7('0xf'));var logger=require(_0x96c7('0x10'))('api');var utils=require(_0x96c7('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x96c7('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x96c7('0x13')][_0x96c7('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4bd591,_0x566a04,_0x1bb3e9,_0x217ad8){return new BPromise(function(_0x2cefc6,_0x57b947){var _0xd20c3b=_0x217ad8||client;return _0xd20c3b[_0x96c7('0x15')](_0x4bd591,_0x1bb3e9)[_0x96c7('0x16')](function(_0x267d02){logger[_0x96c7('0x17')](_0x96c7('0x18'),_0x566a04,_0x96c7('0x19'));logger[_0x96c7('0x1a')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x566a04,'request\x20sent',JSON[_0x96c7('0x1b')](_0x267d02));if(_0x267d02[_0x96c7('0x1c')]){if(_0x267d02['error'][_0x96c7('0x1d')]===0x1f4){logger[_0x96c7('0x1c')](_0x96c7('0x18'),_0x566a04,_0x267d02[_0x96c7('0x1c')]['message']);return _0x57b947(_0x267d02['error'][_0x96c7('0x1e')]);}logger[_0x96c7('0x1c')](_0x96c7('0x18'),_0x566a04,_0x267d02[_0x96c7('0x1c')][_0x96c7('0x1e')]);return _0x2cefc6(_0x267d02[_0x96c7('0x1c')][_0x96c7('0x1e')]);}else{logger[_0x96c7('0x17')](_0x96c7('0x18'),_0x566a04,_0x96c7('0x19'));_0x2cefc6(_0x267d02['result']['message']);}})['catch'](function(_0x32df63){logger[_0x96c7('0x1c')](_0x96c7('0x18'),_0x566a04,_0x32df63);_0x57b947(_0x32df63);});});}function respondWithStatusCode(_0x4dca36,_0x37d7e9){_0x37d7e9=_0x37d7e9||0xcc;return function(_0x18564a){if(_0x18564a){return _0x4dca36[_0x96c7('0x1f')](_0x37d7e9);}return _0x4dca36['status'](_0x37d7e9)[_0x96c7('0x20')]();};}function respondWithResult(_0x59d7b2,_0x22c02b){_0x22c02b=_0x22c02b||0xc8;return function(_0x2e2bdd){if(_0x2e2bdd){return _0x59d7b2[_0x96c7('0x21')](_0x22c02b)['json'](_0x2e2bdd);}};}function respondWithFilteredResult(_0x222b29,_0x3bf727){return function(_0x25e8ad){if(_0x25e8ad){var _0x3d9b72=typeof _0x3bf727[_0x96c7('0x22')]==='undefined'&&typeof _0x3bf727[_0x96c7('0x23')]===_0x96c7('0x24');var _0xec4809=_0x25e8ad[_0x96c7('0x25')];var _0x474fc8=_0x3d9b72?0x0:_0x3bf727[_0x96c7('0x22')];var _0x32a4a6=_0x3d9b72?_0x25e8ad[_0x96c7('0x25')]:_0x3bf727['offset']+_0x3bf727[_0x96c7('0x23')];var _0xab6225;if(_0x32a4a6>=_0xec4809){_0x32a4a6=_0xec4809;_0xab6225=0xc8;}else{_0xab6225=0xce;}_0x222b29[_0x96c7('0x21')](_0xab6225);return _0x222b29['set'](_0x96c7('0x26'),_0x474fc8+'-'+_0x32a4a6+'/'+_0xec4809)[_0x96c7('0x27')](_0x25e8ad);}return null;};}function patchUpdates(_0x5144c0){return function(_0x5676b7){try{jsonpatch[_0x96c7('0x28')](_0x5676b7,_0x5144c0,!![]);}catch(_0x2b76b0){return BPromise[_0x96c7('0x29')](_0x2b76b0);}return _0x5676b7['save']();};}function saveUpdates(_0xeaa799,_0x3994a){return function(_0x18efcf){if(_0x18efcf){return _0x18efcf['update'](_0xeaa799)[_0x96c7('0x16')](function(_0x749226){return _0x749226;});}return null;};}function removeEntity(_0x5872e8,_0x56fabe){return function(_0x9c59bd){if(_0x9c59bd){return _0x9c59bd[_0x96c7('0x2a')]()[_0x96c7('0x16')](function(){_0x5872e8['status'](0xcc)[_0x96c7('0x20')]();});}};}function handleEntityNotFound(_0x3cc645,_0x3eaab2){return function(_0x3b780a){if(!_0x3b780a){_0x3cc645[_0x96c7('0x1f')](0x194);}return _0x3b780a;};}function handleError(_0x3995ec,_0x470e8a){_0x470e8a=_0x470e8a||0x1f4;return function(_0x31bb39){logger[_0x96c7('0x1c')](_0x31bb39[_0x96c7('0x2b')]);if(_0x31bb39[_0x96c7('0x2c')]){delete _0x31bb39['name'];}_0x3995ec[_0x96c7('0x21')](_0x470e8a)['send'](_0x31bb39);};}exports[_0x96c7('0x2d')]=function(_0x19c35d,_0x316d6b){var _0x416495={},_0x43f99f={},_0x254aaa={'count':0x0,'rows':[]};var _0x1866c4=_[_0x96c7('0x2e')](db['SugarcrmAccount']['rawAttributes'],function(_0xfe1663){return{'name':_0xfe1663[_0x96c7('0x2f')],'type':_0xfe1663[_0x96c7('0x30')]['key']};});_0x43f99f[_0x96c7('0x31')]=_[_0x96c7('0x2e')](_0x1866c4,_0x96c7('0x2c'));_0x43f99f[_0x96c7('0x32')]=_[_0x96c7('0x33')](_0x19c35d[_0x96c7('0x32')]);_0x43f99f[_0x96c7('0x34')]=_[_0x96c7('0x35')](_0x43f99f[_0x96c7('0x31')],_0x43f99f[_0x96c7('0x32')]);_0x416495[_0x96c7('0x36')]=_['intersection'](_0x43f99f[_0x96c7('0x31')],qs['fields'](_0x19c35d[_0x96c7('0x32')][_0x96c7('0x37')]));_0x416495[_0x96c7('0x36')]=_0x416495[_0x96c7('0x36')]['length']?_0x416495[_0x96c7('0x36')]:_0x43f99f[_0x96c7('0x31')];if(!_0x19c35d[_0x96c7('0x32')]['hasOwnProperty'](_0x96c7('0x38'))){_0x416495[_0x96c7('0x23')]=qs[_0x96c7('0x23')](_0x19c35d['query'][_0x96c7('0x23')]);_0x416495['offset']=qs[_0x96c7('0x22')](_0x19c35d[_0x96c7('0x32')][_0x96c7('0x22')]);}_0x416495[_0x96c7('0x39')]=qs['sort'](_0x19c35d[_0x96c7('0x32')][_0x96c7('0x3a')]);_0x416495[_0x96c7('0x3b')]=qs[_0x96c7('0x34')](_[_0x96c7('0x3c')](_0x19c35d[_0x96c7('0x32')],_0x43f99f[_0x96c7('0x34')]),_0x1866c4);if(_0x19c35d[_0x96c7('0x32')][_0x96c7('0x3d')]){_0x416495[_0x96c7('0x3b')]=_['merge'](_0x416495[_0x96c7('0x3b')],{'$or':_[_0x96c7('0x2e')](_0x1866c4,function(_0x408295){if(_0x408295[_0x96c7('0x30')]!=='VIRTUAL'){var _0x4aa777={};_0x4aa777[_0x408295[_0x96c7('0x2c')]]={'$like':'%'+_0x19c35d[_0x96c7('0x32')][_0x96c7('0x3d')]+'%'};return _0x4aa777;}})});}_0x416495=_['merge']({},_0x416495,_0x19c35d[_0x96c7('0x3e')]);var _0x3afcb1={'where':_0x416495[_0x96c7('0x3b')]};return db['SugarcrmAccount']['count'](_0x3afcb1)['then'](function(_0x3936c7){_0x254aaa[_0x96c7('0x25')]=_0x3936c7;if(_0x19c35d['query']['includeAll']){_0x416495[_0x96c7('0x3f')]=[{'all':!![]}];}return db[_0x96c7('0x40')]['findAll'](_0x416495);})['then'](function(_0x146519){_0x254aaa[_0x96c7('0x41')]=_0x146519;return _0x254aaa;})['then'](respondWithFilteredResult(_0x316d6b,_0x416495))[_0x96c7('0x42')](handleError(_0x316d6b,null));};exports[_0x96c7('0x43')]=function(_0x1f544a,_0x5613a0){var _0x535fc1={'raw':![],'where':{'id':_0x1f544a[_0x96c7('0x44')]['id']}},_0x2f3a81={};_0x2f3a81['model']=_[_0x96c7('0x33')](db[_0x96c7('0x40')][_0x96c7('0x45')]);_0x2f3a81[_0x96c7('0x32')]=_['keys'](_0x1f544a[_0x96c7('0x32')]);_0x2f3a81[_0x96c7('0x34')]=_[_0x96c7('0x35')](_0x2f3a81[_0x96c7('0x31')],_0x2f3a81['query']);_0x535fc1[_0x96c7('0x36')]=_[_0x96c7('0x35')](_0x2f3a81[_0x96c7('0x31')],qs['fields'](_0x1f544a[_0x96c7('0x32')][_0x96c7('0x37')]));_0x535fc1['attributes']=_0x535fc1[_0x96c7('0x36')][_0x96c7('0x46')]?_0x535fc1[_0x96c7('0x36')]:_0x2f3a81[_0x96c7('0x31')];if(_0x1f544a[_0x96c7('0x32')][_0x96c7('0x47')]){_0x535fc1[_0x96c7('0x3f')]=[{'all':!![]}];}_0x535fc1=_[_0x96c7('0x48')]({},_0x535fc1,_0x1f544a[_0x96c7('0x3e')]);return db[_0x96c7('0x40')]['find'](_0x535fc1)[_0x96c7('0x16')](handleEntityNotFound(_0x5613a0,null))[_0x96c7('0x16')](respondWithResult(_0x5613a0,null))[_0x96c7('0x42')](handleError(_0x5613a0,null));};exports['create']=function(_0x412642,_0x440883){return db[_0x96c7('0x40')][_0x96c7('0x49')](_0x412642[_0x96c7('0x4a')],{})[_0x96c7('0x16')](respondWithResult(_0x440883,0xc9))['catch'](handleError(_0x440883,null));};exports[_0x96c7('0x4b')]=function(_0x205027,_0x1d1401){if(_0x205027['body']['id']){delete _0x205027[_0x96c7('0x4a')]['id'];}return db['SugarcrmAccount'][_0x96c7('0x4c')]({'where':{'id':_0x205027['params']['id']}})[_0x96c7('0x16')](handleEntityNotFound(_0x1d1401,null))[_0x96c7('0x16')](saveUpdates(_0x205027[_0x96c7('0x4a')],null))[_0x96c7('0x16')](respondWithResult(_0x1d1401,null))[_0x96c7('0x42')](handleError(_0x1d1401,null));};exports[_0x96c7('0x2a')]=function(_0x5319cf,_0x15c542){return db[_0x96c7('0x40')][_0x96c7('0x4c')]({'where':{'id':_0x5319cf[_0x96c7('0x44')]['id']}})[_0x96c7('0x16')](handleEntityNotFound(_0x15c542,null))['then'](removeEntity(_0x15c542,null))[_0x96c7('0x42')](handleError(_0x15c542,null));};exports['getConfigurations']=function(_0x4b039b,_0xf3c5aa,_0x2ed79c){var _0x133748={};var _0x4713c7={};var _0x5b093e;var _0x4f9554;return db[_0x96c7('0x40')][_0x96c7('0x4d')]({'where':{'id':_0x4b039b['params']['id']}})[_0x96c7('0x16')](handleEntityNotFound(_0xf3c5aa,null))[_0x96c7('0x16')](function(_0x45f605){if(_0x45f605){_0x5b093e=_0x45f605;_0x4713c7[_0x96c7('0x31')]=_['keys'](db[_0x96c7('0x4e')][_0x96c7('0x45')]);_0x4713c7[_0x96c7('0x32')]=_[_0x96c7('0x33')](_0x4b039b[_0x96c7('0x32')]);_0x4713c7['filters']=_[_0x96c7('0x35')](_0x4713c7[_0x96c7('0x31')],_0x4713c7[_0x96c7('0x32')]);_0x133748[_0x96c7('0x36')]=_[_0x96c7('0x35')](_0x4713c7[_0x96c7('0x31')],qs[_0x96c7('0x37')](_0x4b039b[_0x96c7('0x32')][_0x96c7('0x37')]));_0x133748['attributes']=_0x133748['attributes'][_0x96c7('0x46')]?_0x133748['attributes']:_0x4713c7[_0x96c7('0x31')];_0x133748[_0x96c7('0x39')]=qs['sort'](_0x4b039b[_0x96c7('0x32')][_0x96c7('0x3a')]);_0x133748[_0x96c7('0x3b')]=qs['filters'](_[_0x96c7('0x3c')](_0x4b039b[_0x96c7('0x32')],_0x4713c7[_0x96c7('0x34')]));if(_0x4b039b[_0x96c7('0x32')][_0x96c7('0x3d')]){_0x133748[_0x96c7('0x3b')]=_['merge'](_0x133748[_0x96c7('0x3b')],{'$or':_['map'](_0x133748[_0x96c7('0x36')],function(_0x3ed78b){var _0x28c914={};_0x28c914[_0x3ed78b]={'$like':'%'+_0x4b039b[_0x96c7('0x32')][_0x96c7('0x3d')]+'%'};return _0x28c914;})});}_0x133748=_[_0x96c7('0x48')]({},_0x133748,_0x4b039b[_0x96c7('0x3e')]);return _0x5b093e[_0x96c7('0x4f')](_0x133748);}})[_0x96c7('0x16')](function(_0x4e8947){if(_0x4e8947){_0x4f9554=_0x4e8947['length'];if(!_0x4b039b['query'][_0x96c7('0x50')](_0x96c7('0x38'))){_0x133748['limit']=qs[_0x96c7('0x23')](_0x4b039b[_0x96c7('0x32')][_0x96c7('0x23')]);_0x133748['offset']=qs[_0x96c7('0x22')](_0x4b039b[_0x96c7('0x32')][_0x96c7('0x22')]);}return _0x5b093e[_0x96c7('0x4f')](_0x133748);}})[_0x96c7('0x16')](function(_0x28b99d){if(_0x28b99d){return _0x28b99d?{'count':_0x4f9554,'rows':_0x28b99d}:null;}})[_0x96c7('0x16')](respondWithResult(_0xf3c5aa,null))['catch'](handleError(_0xf3c5aa,null));};exports[_0x96c7('0x51')]=function(_0x32825a,_0x38e849,_0x69dc67){if(_0x32825a[_0x96c7('0x4a')]['id']){delete _0x32825a[_0x96c7('0x4a')]['id'];}return db[_0x96c7('0x40')]['findOne']({'where':{'id':_0x32825a['params']['id']}})['then'](handleEntityNotFound(_0x38e849,null))[_0x96c7('0x16')](function(_0x43cafa){if(_0x43cafa){_0x32825a['body']['AccountId']=_0x43cafa['id'];_0x32825a[_0x96c7('0x4a')][_0x96c7('0x52')]=integrations['getSubjects'](_0x32825a[_0x96c7('0x4a')][_0x96c7('0x53')],_0x32825a['body']['type']);_0x32825a[_0x96c7('0x4a')]['Descriptions']=integrations[_0x96c7('0x54')](_0x32825a['body'][_0x96c7('0x53')],_0x32825a['body'][_0x96c7('0x30')]);return db[_0x96c7('0x4e')][_0x96c7('0x49')](_0x32825a['body'],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x96c7('0x55')],'as':_0x96c7('0x56')}]});}return null;})[_0x96c7('0x16')](respondWithResult(_0x38e849,null))[_0x96c7('0x42')](handleError(_0x38e849,null));};exports['getFields']=function(_0x3fc2a1,_0x19e633,_0xdfea72){var _0x1c9961='';var _0x5aab6b=['id',_0x96c7('0x2c'),'assigned_user_id','created_by',_0x96c7('0x57'),_0x96c7('0x58'),_0x96c7('0x59'),_0x96c7('0x5a'),_0x96c7('0x5b'),_0x96c7('0x5c'),'parent_name',_0x96c7('0x5d')];return db['SugarcrmAccount'][_0x96c7('0x4d')]({'where':{'id':_0x3fc2a1[_0x96c7('0x44')]['id']},'attributes':['id',_0x96c7('0x5e'),_0x96c7('0x5f'),_0x96c7('0x60')]})[_0x96c7('0x16')](handleEntityNotFound(_0x19e633,null))['then'](function(_0x3f4ee4){if(_0x3f4ee4){_0x1c9961=_0x3f4ee4[_0x96c7('0x60')];var _0x4df421=_0x1c9961[_0x96c7('0x61')](-0x1);if(_0x4df421==='/'){_0x1c9961=_0x1c9961[_0x96c7('0x62')](0x0,_0x1c9961[_0x96c7('0x63')](_0x4df421));}return rp({'method':_0x96c7('0x64'),'uri':util[_0x96c7('0x65')]('%s%s',_0x1c9961,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x96c7('0x66'),'response_type':_0x96c7('0x66'),'rest_data':JSON[_0x96c7('0x1b')]({'user_auth':{'user_name':_0x3f4ee4['username'],'password':_0x3f4ee4[_0x96c7('0x5f')],'encryption':'PLAIN'},'application':_0x96c7('0x67')})}});}})['then'](function(_0x117f54){if(_0x117f54&&_0x117f54[_0x96c7('0x2c')]!=='Invalid\x20Login'&&_0x117f54[_0x96c7('0x2c')]!==_0x96c7('0x68')){return rp({'method':'POST','uri':util[_0x96c7('0x65')]('%s%s',_0x1c9961,_0x96c7('0x69')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x96c7('0x66'),'response_type':_0x96c7('0x66'),'rest_data':JSON[_0x96c7('0x1b')]({'session':_0x117f54['id'],'module_name':_0x96c7('0x6a')})}})['then'](function(_0x26756){if(_0x26756){var _0x337c41=_[_0x96c7('0x6b')](_0x26756[_0x96c7('0x6c')]);_[_0x96c7('0x6d')](_0x337c41,function(_0x345349){return _0x5aab6b[_0x96c7('0x6e')](_0x345349[_0x96c7('0x2c')]);});return{'count':_0x337c41[_0x96c7('0x46')],'rows':_['map'](_0x337c41,function(_0x2d4973){return{'id':_0x2d4973[_0x96c7('0x2c')],'name':_0x2d4973[_0x96c7('0x6f')],'custom':_[_0x96c7('0x70')](_0x2d4973['name'],'_c')?!![]:![],'options':_0x2d4973[_0x96c7('0x3e')]?_[_0x96c7('0x2e')](_[_0x96c7('0x6b')](_0x2d4973[_0x96c7('0x3e')]),function(_0xa5f308){return{'name':_0xa5f308['value'],'value':_0xa5f308[_0x96c7('0x2c')]};}):[]};})};}})['then'](respondWithResult(_0x19e633,null))[_0x96c7('0x42')](function(_0x187b66){var _0x35d8c9=_0x3fc2a1[_0x96c7('0x32')][_0x96c7('0x71')]?0x1f4:_0x187b66[_0x96c7('0x72')]||0x1f4;logger[_0x96c7('0x1c')](_0x96c7('0x73'),_0x96c7('0x74'),_0x35d8c9,JSON[_0x96c7('0x1b')](_0x187b66));delete _0x187b66[_0x96c7('0x2c')];if(_0x35d8c9===0x191){_0x35d8c9=0x190;}_0x19e633[_0x96c7('0x21')](_0x35d8c9)[_0x96c7('0x75')](_0x3fc2a1[_0x96c7('0x32')][_0x96c7('0x71')]?{'message':_0x96c7('0x76'),'statusCode':_0x187b66[_0x96c7('0x72')]}:_0x187b66);});}else{var _0x4a90f0=0x1f4;_0x19e633[_0x96c7('0x21')](_0x4a90f0)[_0x96c7('0x75')]({'message':_0x96c7('0x76'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index c39c60a..f914747 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 _0xb249=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment'];(function(_0x712903,_0x999dad){var _0x474a06=function(_0x1932d7){while(--_0x1932d7){_0x712903['push'](_0x712903['shift']());}};_0x474a06(++_0x999dad);}(_0xb249,0x98));var _0x9b24=function(_0x5c8651,_0x69d79){_0x5c8651=_0x5c8651-0x0;var _0xcd4997=_0xb249[_0x5c8651];return _0xcd4997;};'use strict';var _=require(_0x9b24('0x0'));var util=require('util');var logger=require(_0x9b24('0x1'))(_0x9b24('0x2'));var moment=require(_0x9b24('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b24('0x4'));var fs=require('fs');var path=require(_0x9b24('0x5'));var rimraf=require(_0x9b24('0x6'));var config=require(_0x9b24('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x9b24('0x8'));module[_0x9b24('0x9')]=function(_0x5ad450,_0x3cb15d){return _0x5ad450['define'](_0x9b24('0xa'),attributes,{'tableName':_0x9b24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe13=['../../config/logger','api','moment','bluebird','request-promise','path','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfe13,0x178));var _0x3fe1=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xfe13[_0xf2f332];return _0x56cce3;};'use strict';var _=require(_0x3fe1('0x0'));var util=require('util');var logger=require(_0x3fe1('0x1'))(_0x3fe1('0x2'));var moment=require(_0x3fe1('0x3'));var BPromise=require(_0x3fe1('0x4'));var rp=require(_0x3fe1('0x5'));var fs=require('fs');var path=require(_0x3fe1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fe1('0x7'));var integrations=require(_0x3fe1('0x8'));module[_0x3fe1('0x9')]=function(_0x5caa2e,_0xe33444){return _0x5caa2e[_0x3fe1('0xa')](_0x3fe1('0xb'),attributes,{'tableName':_0x3fe1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index bf909a5..e2c9e29 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 _0x3beb=['map','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x50f9ab,_0x5009b4){var _0x58dda4=function(_0x5f1ff5){while(--_0x5f1ff5){_0x50f9ab['push'](_0x50f9ab['shift']());}};_0x58dda4(++_0x5009b4);}(_0x3beb,0x1b6));var _0xb3be=function(_0xcd2ed0,_0x472b1b){_0xcd2ed0=_0xcd2ed0-0x0;var _0x197b6a=_0x3beb[_0xcd2ed0];return _0x197b6a;};'use strict';var _=require(_0xb3be('0x0'));var util=require(_0xb3be('0x1'));var moment=require('moment');var BPromise=require(_0xb3be('0x2'));var rs=require(_0xb3be('0x3'));var fs=require('fs');var Redis=require(_0xb3be('0x4'));var db=require(_0xb3be('0x5'))['db'];var utils=require(_0xb3be('0x6'));var logger=require('../../config/logger')(_0xb3be('0x7'));var config=require(_0xb3be('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb3be('0x9')][_0xb3be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x177b4c,_0x18c323,_0x20a729){return new BPromise(function(_0x3dec70,_0x2262fb){return client[_0xb3be('0xb')](_0x177b4c,_0x20a729)[_0xb3be('0xc')](function(_0x164b19){logger[_0xb3be('0xd')](_0xb3be('0xe'),_0x18c323,'request\x20sent');logger[_0xb3be('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x18c323,_0xb3be('0x10'),JSON['stringify'](_0x164b19));if(_0x164b19[_0xb3be('0x11')]){if(_0x164b19[_0xb3be('0x11')][_0xb3be('0x12')]===0x1f4){logger[_0xb3be('0x11')](_0xb3be('0xe'),_0x18c323,_0x164b19['error'][_0xb3be('0x13')]);return _0x2262fb(_0x164b19[_0xb3be('0x11')][_0xb3be('0x13')]);}logger[_0xb3be('0x11')](_0xb3be('0xe'),_0x18c323,_0x164b19['error'][_0xb3be('0x13')]);return _0x3dec70(_0x164b19[_0xb3be('0x11')]['message']);}else{logger[_0xb3be('0xd')](_0xb3be('0xe'),_0x18c323,_0xb3be('0x10'));_0x3dec70(_0x164b19[_0xb3be('0x14')][_0xb3be('0x13')]);}})[_0xb3be('0x15')](function(_0x3aef35){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x18c323,_0x3aef35);_0x2262fb(_0x3aef35);});});}exports['GetSugarcrmAccount']=function(_0x52b30b){var _0x24e91a=this;return new Promise(function(_0x469d26,_0x131c5a){return db['SugarcrmAccount'][_0xb3be('0x16')]({'raw':_0x52b30b[_0xb3be('0x17')]?_0x52b30b['options'][_0xb3be('0x18')]===undefined?!![]:![]:!![],'where':_0x52b30b['options']?_0x52b30b[_0xb3be('0x17')][_0xb3be('0x19')]||null:null,'attributes':_0x52b30b[_0xb3be('0x17')]?_0x52b30b['options'][_0xb3be('0x1a')]||null:null,'limit':_0x52b30b['options']?_0x52b30b[_0xb3be('0x17')][_0xb3be('0x1b')]||null:null,'include':_0x52b30b[_0xb3be('0x17')]?_0x52b30b[_0xb3be('0x17')][_0xb3be('0x1c')]?_['map'](_0x52b30b[_0xb3be('0x17')][_0xb3be('0x1c')],function(_0x2c6e63){return{'model':db[_0x2c6e63[_0xb3be('0x1d')]],'as':_0x2c6e63['as'],'attributes':_0x2c6e63[_0xb3be('0x1a')],'include':_0x2c6e63[_0xb3be('0x1c')]?_[_0xb3be('0x1e')](_0x2c6e63[_0xb3be('0x1c')],function(_0x20bfe5){return{'model':db[_0x20bfe5[_0xb3be('0x1d')]],'as':_0x20bfe5['as'],'attributes':_0x20bfe5[_0xb3be('0x1a')],'include':_0x20bfe5[_0xb3be('0x1c')]?_[_0xb3be('0x1e')](_0x20bfe5[_0xb3be('0x1c')],function(_0x5665a9){return{'model':db[_0x5665a9[_0xb3be('0x1d')]],'as':_0x5665a9['as'],'attributes':_0x5665a9[_0xb3be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb3be('0xc')](function(_0x2fa04c){logger[_0xb3be('0xd')](_0xb3be('0x1f'),_0x52b30b);logger[_0xb3be('0xf')]('GetSugarcrmAccount',_0x52b30b,JSON[_0xb3be('0x20')](_0x2fa04c));_0x469d26(_0x2fa04c);})['catch'](function(_0x591009){logger[_0xb3be('0x11')](_0xb3be('0x1f'),_0x591009[_0xb3be('0x13')],_0x52b30b);_0x131c5a(_0x24e91a[_0xb3be('0x11')](0x1f4,_0x591009['message']));});});};exports[_0xb3be('0x21')]=function(_0x4851a8){var _0x470578=this;return new Promise(function(_0x443f8c,_0x146064){return db[_0xb3be('0x22')][_0xb3be('0x23')]({'raw':_0x4851a8[_0xb3be('0x17')]?_0x4851a8[_0xb3be('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4851a8[_0xb3be('0x17')]?_0x4851a8[_0xb3be('0x17')][_0xb3be('0x19')]||null:null,'attributes':_0x4851a8['options']?_0x4851a8[_0xb3be('0x17')][_0xb3be('0x1a')]||null:null,'include':_0x4851a8[_0xb3be('0x17')]?_0x4851a8[_0xb3be('0x17')][_0xb3be('0x1c')]?_['map'](_0x4851a8['options']['include'],function(_0x4750bf){return{'model':db[_0x4750bf[_0xb3be('0x1d')]],'as':_0x4750bf['as'],'attributes':_0x4750bf[_0xb3be('0x1a')],'include':_0x4750bf[_0xb3be('0x1c')]?_[_0xb3be('0x1e')](_0x4750bf[_0xb3be('0x1c')],function(_0x28a9f2){return{'model':db[_0x28a9f2[_0xb3be('0x1d')]],'as':_0x28a9f2['as'],'attributes':_0x28a9f2[_0xb3be('0x1a')],'include':_0x28a9f2[_0xb3be('0x1c')]?_['map'](_0x28a9f2['include'],function(_0x3d5b8c){return{'model':db[_0x3d5b8c['model']],'as':_0x3d5b8c['as'],'attributes':_0x3d5b8c[_0xb3be('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x452118){logger[_0xb3be('0xd')](_0xb3be('0x21'),_0x4851a8);logger['debug']('ShowSugarcrmAccount',_0x4851a8,JSON[_0xb3be('0x20')](_0x452118));_0x443f8c(_0x452118);})[_0xb3be('0x15')](function(_0x2de602){logger[_0xb3be('0x11')]('ShowSugarcrmAccount',_0x2de602[_0xb3be('0x13')],_0x4851a8);_0x146064(_0x470578['error'](0x1f4,_0x2de602[_0xb3be('0x13')]));});});}; \ No newline at end of file +var _0x6b79=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowSugarcrmAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent'];(function(_0x44e5cc,_0x4a51fd){var _0x4d9c16=function(_0x25b444){while(--_0x25b444){_0x44e5cc['push'](_0x44e5cc['shift']());}};_0x4d9c16(++_0x4a51fd);}(_0x6b79,0x154));var _0x96b7=function(_0x33579e,_0x2d5c7a){_0x33579e=_0x33579e-0x0;var _0x377aeb=_0x6b79[_0x33579e];return _0x377aeb;};'use strict';var _=require(_0x96b7('0x0'));var util=require(_0x96b7('0x1'));var moment=require('moment');var BPromise=require(_0x96b7('0x2'));var rs=require(_0x96b7('0x3'));var fs=require('fs');var Redis=require(_0x96b7('0x4'));var db=require(_0x96b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x96b7('0x6'))(_0x96b7('0x7'));var config=require(_0x96b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x96b7('0x9')][_0x96b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27c179,_0xa4ec73,_0x5e76ee){return new BPromise(function(_0x382659,_0x2ce012){return client[_0x96b7('0xb')](_0x27c179,_0x5e76ee)[_0x96b7('0xc')](function(_0xa042f6){logger[_0x96b7('0xd')](_0x96b7('0xe'),_0xa4ec73,'request\x20sent');logger[_0x96b7('0xf')](_0x96b7('0x10'),_0xa4ec73,'request\x20sent',JSON['stringify'](_0xa042f6));if(_0xa042f6[_0x96b7('0x11')]){if(_0xa042f6[_0x96b7('0x11')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0xa4ec73,_0xa042f6[_0x96b7('0x11')][_0x96b7('0x12')]);return _0x2ce012(_0xa042f6[_0x96b7('0x11')][_0x96b7('0x12')]);}logger[_0x96b7('0x11')](_0x96b7('0xe'),_0xa4ec73,_0xa042f6[_0x96b7('0x11')][_0x96b7('0x12')]);return _0x382659(_0xa042f6[_0x96b7('0x11')][_0x96b7('0x12')]);}else{logger[_0x96b7('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0xa4ec73,_0x96b7('0x13'));_0x382659(_0xa042f6[_0x96b7('0x14')][_0x96b7('0x12')]);}})[_0x96b7('0x15')](function(_0xbbeb2){logger[_0x96b7('0x11')](_0x96b7('0xe'),_0xa4ec73,_0xbbeb2);_0x2ce012(_0xbbeb2);});});}exports[_0x96b7('0x16')]=function(_0x262583){var _0x55da2c=this;return new Promise(function(_0x23b966,_0x674c70){return db[_0x96b7('0x17')][_0x96b7('0x18')]({'raw':_0x262583['options']?_0x262583[_0x96b7('0x19')][_0x96b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x262583['options']?_0x262583['options'][_0x96b7('0x1b')]||null:null,'attributes':_0x262583[_0x96b7('0x19')]?_0x262583[_0x96b7('0x19')][_0x96b7('0x1c')]||null:null,'limit':_0x262583[_0x96b7('0x19')]?_0x262583[_0x96b7('0x19')][_0x96b7('0x1d')]||null:null,'include':_0x262583[_0x96b7('0x19')]?_0x262583['options']['include']?_['map'](_0x262583['options'][_0x96b7('0x1e')],function(_0x539c46){return{'model':db[_0x539c46[_0x96b7('0x1f')]],'as':_0x539c46['as'],'attributes':_0x539c46[_0x96b7('0x1c')],'include':_0x539c46['include']?_[_0x96b7('0x20')](_0x539c46[_0x96b7('0x1e')],function(_0x1a507e){return{'model':db[_0x1a507e[_0x96b7('0x1f')]],'as':_0x1a507e['as'],'attributes':_0x1a507e['attributes'],'include':_0x1a507e['include']?_[_0x96b7('0x20')](_0x1a507e[_0x96b7('0x1e')],function(_0x14a656){return{'model':db[_0x14a656[_0x96b7('0x1f')]],'as':_0x14a656['as'],'attributes':_0x14a656[_0x96b7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x96b7('0xc')](function(_0x143a94){logger[_0x96b7('0xd')](_0x96b7('0x16'),_0x262583);logger[_0x96b7('0xf')](_0x96b7('0x16'),_0x262583,JSON[_0x96b7('0x21')](_0x143a94));_0x23b966(_0x143a94);})[_0x96b7('0x15')](function(_0x111ff1){logger[_0x96b7('0x11')](_0x96b7('0x16'),_0x111ff1[_0x96b7('0x12')],_0x262583);_0x674c70(_0x55da2c[_0x96b7('0x11')](0x1f4,_0x111ff1[_0x96b7('0x12')]));});});};exports[_0x96b7('0x22')]=function(_0x2f20fc){var _0x507d52=this;return new Promise(function(_0x3a1102,_0x28ba09){return db[_0x96b7('0x17')][_0x96b7('0x23')]({'raw':_0x2f20fc['options']?_0x2f20fc['options'][_0x96b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f20fc['options']?_0x2f20fc['options'][_0x96b7('0x1b')]||null:null,'attributes':_0x2f20fc[_0x96b7('0x19')]?_0x2f20fc[_0x96b7('0x19')][_0x96b7('0x1c')]||null:null,'include':_0x2f20fc[_0x96b7('0x19')]?_0x2f20fc['options']['include']?_['map'](_0x2f20fc[_0x96b7('0x19')]['include'],function(_0xfa3d58){return{'model':db[_0xfa3d58[_0x96b7('0x1f')]],'as':_0xfa3d58['as'],'attributes':_0xfa3d58[_0x96b7('0x1c')],'include':_0xfa3d58[_0x96b7('0x1e')]?_[_0x96b7('0x20')](_0xfa3d58[_0x96b7('0x1e')],function(_0x2149c9){return{'model':db[_0x2149c9['model']],'as':_0x2149c9['as'],'attributes':_0x2149c9['attributes'],'include':_0x2149c9[_0x96b7('0x1e')]?_[_0x96b7('0x20')](_0x2149c9[_0x96b7('0x1e')],function(_0x1b7f1f){return{'model':db[_0x1b7f1f[_0x96b7('0x1f')]],'as':_0x1b7f1f['as'],'attributes':_0x1b7f1f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x106f38){logger[_0x96b7('0xd')](_0x96b7('0x22'),_0x2f20fc);logger['debug'](_0x96b7('0x22'),_0x2f20fc,JSON[_0x96b7('0x21')](_0x106f38));_0x3a1102(_0x106f38);})[_0x96b7('0x15')](function(_0x322ecf){logger[_0x96b7('0x11')]('ShowSugarcrmAccount',_0x322ecf[_0x96b7('0x12')],_0x2f20fc);_0x28ba09(_0x507d52['error'](0x1f4,_0x322ecf[_0x96b7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 6b08685..5bf8e42 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 _0xecec=['show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3471d5,_0x40e815){var _0x39aa45=function(_0x39dfd4){while(--_0x39dfd4){_0x3471d5['push'](_0x3471d5['shift']());}};_0x39aa45(++_0x40e815);}(_0xecec,0x14a));var _0xcece=function(_0x37317d,_0x1a4d90){_0x37317d=_0x37317d-0x0;var _0x26fa30=_0xecec[_0x37317d];return _0x26fa30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcece('0x0'));var timeout=require(_0xcece('0x1'));var express=require('express');var router=express[_0xcece('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcece('0x3'));var interaction=require(_0xcece('0x4'));var config=require(_0xcece('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xcece('0x6')]('/',auth[_0xcece('0x7')](),controller[_0xcece('0x8')]);router['get'](_0xcece('0x9'),auth[_0xcece('0x7')](),controller[_0xcece('0xa')]);router[_0xcece('0x6')](_0xcece('0xb'),auth[_0xcece('0x7')](),controller[_0xcece('0xc')]);router[_0xcece('0x6')](_0xcece('0xd'),auth[_0xcece('0x7')](),controller['getSubjects']);router[_0xcece('0x6')](_0xcece('0xe'),auth[_0xcece('0x7')](),controller[_0xcece('0xf')]);router[_0xcece('0x10')]('/',auth[_0xcece('0x7')](),controller[_0xcece('0x11')]);router['put'](_0xcece('0x9'),auth[_0xcece('0x7')](),controller[_0xcece('0x12')]);router[_0xcece('0x13')](_0xcece('0x9'),auth[_0xcece('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7be8=['fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','exports','multer','path','connect-timeout','Router'];(function(_0x3f9edd,_0x4c76f4){var _0x4b97c1=function(_0x288f69){while(--_0x288f69){_0x3f9edd['push'](_0x3f9edd['shift']());}};_0x4b97c1(++_0x4c76f4);}(_0x7be8,0x1a0));var _0x87be=function(_0x1a8c72,_0x976e6b){_0x1a8c72=_0x1a8c72-0x0;var _0x2f3961=_0x7be8[_0x1a8c72];return _0x2f3961;};'use strict';var multer=require(_0x87be('0x0'));var util=require('util');var path=require(_0x87be('0x1'));var timeout=require(_0x87be('0x2'));var express=require('express');var router=express[_0x87be('0x3')]();var fs_extra=require(_0x87be('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x87be('0x5'));var config=require(_0x87be('0x6'));var controller=require(_0x87be('0x7'));router[_0x87be('0x8')]('/',auth[_0x87be('0x9')](),controller['index']);router['get'](_0x87be('0xa'),auth[_0x87be('0x9')](),controller['show']);router['get'](_0x87be('0xb'),auth[_0x87be('0x9')](),controller[_0x87be('0xc')]);router[_0x87be('0x8')]('/:id/subjects',auth[_0x87be('0x9')](),controller[_0x87be('0xd')]);router[_0x87be('0x8')](_0x87be('0xe'),auth['isAuthenticated'](),controller[_0x87be('0xf')]);router[_0x87be('0x10')]('/',auth[_0x87be('0x9')](),controller['create']);router[_0x87be('0x11')](_0x87be('0xa'),auth[_0x87be('0x9')](),controller['update']);router[_0x87be('0x12')](_0x87be('0xa'),auth[_0x87be('0x9')](),controller['destroy']);module[_0x87be('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index baab035..b1197ea 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 _0x5f88=['STRING','sequelize'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0x5f88,0x1af));var _0x85f8=function(_0xdead2d,_0x5ea9f6){_0xdead2d=_0xdead2d-0x0;var _0x22bbfb=_0x5f88[_0xdead2d];return _0x22bbfb;};'use strict';var Sequelize=require(_0x85f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x85f8('0x1')]},'description':{'type':Sequelize[_0x85f8('0x1')]}}; \ No newline at end of file +var _0x9b5e=['sequelize','exports','STRING'];(function(_0x312a07,_0x40f7b5){var _0x2bc20b=function(_0x3e3914){while(--_0x3e3914){_0x312a07['push'](_0x312a07['shift']());}};_0x2bc20b(++_0x40f7b5);}(_0x9b5e,0x117));var _0xe9b5=function(_0x571c65,_0x321f37){_0x571c65=_0x571c65-0x0;var _0x563767=_0x9b5e[_0x571c65];return _0x563767;};'use strict';var Sequelize=require(_0xe9b5('0x0'));module[_0xe9b5('0x1')]={'name':{'type':Sequelize[_0xe9b5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 77c588e..d9dbd0f 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 _0xf3a5=['options','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','jayson/promise','client','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','map','include','findAll','rows','show','params','length','includeAll','find','create','body','getFields','SugarcrmField','sort','merge'];(function(_0x378ed6,_0x36e1aa){var _0x3fbb9f=function(_0x28d101){while(--_0x28d101){_0x378ed6['push'](_0x378ed6['shift']());}};_0x3fbb9f(++_0x36e1aa);}(_0xf3a5,0xb6));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5f3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f3a('0x1'));var jsonpatch=require(_0x5f3a('0x2'));var rp=require(_0x5f3a('0x3'));var moment=require('moment');var BPromise=require(_0x5f3a('0x4'));var Mustache=require('mustache');var util=require(_0x5f3a('0x5'));var path=require(_0x5f3a('0x6'));var sox=require('sox');var csv=require(_0x5f3a('0x7'));var ejs=require(_0x5f3a('0x8'));var fs=require('fs');var fs_extra=require(_0x5f3a('0x9'));var _=require(_0x5f3a('0xa'));var squel=require(_0x5f3a('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f3a('0xc'));var deskjs=require(_0x5f3a('0xd'));var toCsv=require(_0x5f3a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f3a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5f3a('0xf'));var as=require(_0x5f3a('0x10'));var hardwareService=require(_0x5f3a('0x11'));var logger=require('../../config/logger')(_0x5f3a('0x12'));var utils=require('../../config/utils');var config=require(_0x5f3a('0x13'));var licenseUtil=require(_0x5f3a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5f3a('0x15'));var client=jayson[_0x5f3a('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5c3c,_0x5cb5b7,_0xc44b12,_0x5f3960){return new BPromise(function(_0x18d62,_0x79c9ee){var _0x2c54e8=_0x5f3960||client;return _0x2c54e8[_0x5f3a('0x17')](_0x5c5c3c,_0xc44b12)[_0x5f3a('0x18')](function(_0x160a59){logger['info'](_0x5f3a('0x19'),_0x5cb5b7,_0x5f3a('0x1a'));logger['debug'](_0x5f3a('0x1b'),_0x5cb5b7,_0x5f3a('0x1a'),JSON[_0x5f3a('0x1c')](_0x160a59));if(_0x160a59[_0x5f3a('0x1d')]){if(_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1e')]===0x1f4){logger[_0x5f3a('0x1d')](_0x5f3a('0x19'),_0x5cb5b7,_0x160a59['error'][_0x5f3a('0x1f')]);return _0x79c9ee(_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1f')]);}logger[_0x5f3a('0x1d')](_0x5f3a('0x19'),_0x5cb5b7,_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1f')]);return _0x18d62(_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1f')]);}else{logger[_0x5f3a('0x20')](_0x5f3a('0x19'),_0x5cb5b7,'request\x20sent');_0x18d62(_0x160a59[_0x5f3a('0x21')][_0x5f3a('0x1f')]);}})[_0x5f3a('0x22')](function(_0x57f6d0){logger[_0x5f3a('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5cb5b7,_0x57f6d0);_0x79c9ee(_0x57f6d0);});});}function respondWithStatusCode(_0x40e4c4,_0x4a5316){_0x4a5316=_0x4a5316||0xcc;return function(_0x3fa346){if(_0x3fa346){return _0x40e4c4['sendStatus'](_0x4a5316);}return _0x40e4c4['status'](_0x4a5316)['end']();};}function respondWithResult(_0x5a2e38,_0x230a19){_0x230a19=_0x230a19||0xc8;return function(_0x2cca0c){if(_0x2cca0c){return _0x5a2e38[_0x5f3a('0x23')](_0x230a19)[_0x5f3a('0x24')](_0x2cca0c);}};}function respondWithFilteredResult(_0x31da0d,_0x26d346){return function(_0x5b2e4b){if(_0x5b2e4b){var _0x311a3c=typeof _0x26d346[_0x5f3a('0x25')]===_0x5f3a('0x26')&&typeof _0x26d346[_0x5f3a('0x27')]===_0x5f3a('0x26');var _0x46527a=_0x5b2e4b[_0x5f3a('0x28')];var _0x38b5ad=_0x311a3c?0x0:_0x26d346['offset'];var _0x3491f3=_0x311a3c?_0x5b2e4b[_0x5f3a('0x28')]:_0x26d346[_0x5f3a('0x25')]+_0x26d346[_0x5f3a('0x27')];var _0x49bb46;if(_0x3491f3>=_0x46527a){_0x3491f3=_0x46527a;_0x49bb46=0xc8;}else{_0x49bb46=0xce;}_0x31da0d[_0x5f3a('0x23')](_0x49bb46);return _0x31da0d[_0x5f3a('0x29')](_0x5f3a('0x2a'),_0x38b5ad+'-'+_0x3491f3+'/'+_0x46527a)[_0x5f3a('0x24')](_0x5b2e4b);}return null;};}function patchUpdates(_0x4d95a6){return function(_0x7741b5){try{jsonpatch['apply'](_0x7741b5,_0x4d95a6,!![]);}catch(_0x3e4e1b){return BPromise[_0x5f3a('0x2b')](_0x3e4e1b);}return _0x7741b5[_0x5f3a('0x2c')]();};}function saveUpdates(_0xd02cd1,_0x4aacad){return function(_0x3af4f1){if(_0x3af4f1){return _0x3af4f1[_0x5f3a('0x2d')](_0xd02cd1)['then'](function(_0x47b54f){return _0x47b54f;});}return null;};}function removeEntity(_0xce0a6,_0x31a5db){return function(_0x334530){if(_0x334530){return _0x334530[_0x5f3a('0x2e')]()['then'](function(){_0xce0a6[_0x5f3a('0x23')](0xcc)[_0x5f3a('0x2f')]();});}};}function handleEntityNotFound(_0x52fd01,_0x55c5d9){return function(_0x3b29c7){if(!_0x3b29c7){_0x52fd01[_0x5f3a('0x30')](0x194);}return _0x3b29c7;};}function handleError(_0x312f5c,_0xb947dd){_0xb947dd=_0xb947dd||0x1f4;return function(_0x5dca94){logger[_0x5f3a('0x1d')](_0x5dca94[_0x5f3a('0x31')]);if(_0x5dca94[_0x5f3a('0x32')]){delete _0x5dca94[_0x5f3a('0x32')];}_0x312f5c['status'](_0xb947dd)['send'](_0x5dca94);};}exports[_0x5f3a('0x33')]=function(_0x524ba2,_0x18c430){var _0x41545c={},_0x12e7b8={},_0x530d9e={'count':0x0,'rows':[]};var _0xec85ec=_['map'](db[_0x5f3a('0x34')][_0x5f3a('0x35')],function(_0x32e648){return{'name':_0x32e648[_0x5f3a('0x36')],'type':_0x32e648[_0x5f3a('0x37')][_0x5f3a('0x38')]};});_0x12e7b8[_0x5f3a('0x39')]=_['map'](_0xec85ec,'name');_0x12e7b8[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x524ba2[_0x5f3a('0x3a')]);_0x12e7b8[_0x5f3a('0x3c')]=_['intersection'](_0x12e7b8[_0x5f3a('0x39')],_0x12e7b8[_0x5f3a('0x3a')]);_0x41545c[_0x5f3a('0x3d')]=_[_0x5f3a('0x3e')](_0x12e7b8[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x41545c[_0x5f3a('0x3d')]=_0x41545c['attributes']['length']?_0x41545c[_0x5f3a('0x3d')]:_0x12e7b8[_0x5f3a('0x39')];if(!_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x40')](_0x5f3a('0x41'))){_0x41545c[_0x5f3a('0x27')]=qs[_0x5f3a('0x27')](_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x27')]);_0x41545c['offset']=qs[_0x5f3a('0x25')](_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x25')]);}_0x41545c[_0x5f3a('0x42')]=qs['sort'](_0x524ba2[_0x5f3a('0x3a')]['sort']);_0x41545c[_0x5f3a('0x43')]=qs[_0x5f3a('0x3c')](_[_0x5f3a('0x44')](_0x524ba2['query'],_0x12e7b8[_0x5f3a('0x3c')]),_0xec85ec);if(_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x45')]){_0x41545c[_0x5f3a('0x43')]=_['merge'](_0x41545c[_0x5f3a('0x43')],{'$or':_[_0x5f3a('0x46')](_0xec85ec,function(_0x5cbea6){if(_0x5cbea6[_0x5f3a('0x37')]!=='VIRTUAL'){var _0x3711e9={};_0x3711e9[_0x5cbea6[_0x5f3a('0x32')]]={'$like':'%'+_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x45')]+'%'};return _0x3711e9;}})});}_0x41545c=_['merge']({},_0x41545c,_0x524ba2['options']);var _0x860c38={'where':_0x41545c[_0x5f3a('0x43')]};return db[_0x5f3a('0x34')][_0x5f3a('0x28')](_0x860c38)['then'](function(_0x50a190){_0x530d9e['count']=_0x50a190;if(_0x524ba2['query']['includeAll']){_0x41545c[_0x5f3a('0x47')]=[{'all':!![]}];}return db[_0x5f3a('0x34')][_0x5f3a('0x48')](_0x41545c);})[_0x5f3a('0x18')](function(_0x5c0aff){_0x530d9e[_0x5f3a('0x49')]=_0x5c0aff;return _0x530d9e;})[_0x5f3a('0x18')](respondWithFilteredResult(_0x18c430,_0x41545c))[_0x5f3a('0x22')](handleError(_0x18c430,null));};exports[_0x5f3a('0x4a')]=function(_0x223134,_0x2e042a){var _0x50c148={'raw':![],'where':{'id':_0x223134[_0x5f3a('0x4b')]['id']}},_0x418764={};_0x418764[_0x5f3a('0x39')]=_['keys'](db[_0x5f3a('0x34')]['rawAttributes']);_0x418764[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x223134[_0x5f3a('0x3a')]);_0x418764['filters']=_['intersection'](_0x418764['model'],_0x418764[_0x5f3a('0x3a')]);_0x50c148[_0x5f3a('0x3d')]=_['intersection'](_0x418764[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x223134[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x50c148['attributes']=_0x50c148[_0x5f3a('0x3d')][_0x5f3a('0x4c')]?_0x50c148[_0x5f3a('0x3d')]:_0x418764[_0x5f3a('0x39')];if(_0x223134[_0x5f3a('0x3a')][_0x5f3a('0x4d')]){_0x50c148[_0x5f3a('0x47')]=[{'all':!![]}];}_0x50c148=_['merge']({},_0x50c148,_0x223134['options']);return db[_0x5f3a('0x34')][_0x5f3a('0x4e')](_0x50c148)[_0x5f3a('0x18')](handleEntityNotFound(_0x2e042a,null))[_0x5f3a('0x18')](respondWithResult(_0x2e042a,null))[_0x5f3a('0x22')](handleError(_0x2e042a,null));};exports[_0x5f3a('0x4f')]=function(_0x1323c8,_0x49242c){return db[_0x5f3a('0x34')][_0x5f3a('0x4f')](_0x1323c8[_0x5f3a('0x50')],{})[_0x5f3a('0x18')](respondWithResult(_0x49242c,0xc9))[_0x5f3a('0x22')](handleError(_0x49242c,null));};exports['update']=function(_0x5044ad,_0x560416){if(_0x5044ad[_0x5f3a('0x50')]['id']){delete _0x5044ad[_0x5f3a('0x50')]['id'];}return db[_0x5f3a('0x34')][_0x5f3a('0x4e')]({'where':{'id':_0x5044ad[_0x5f3a('0x4b')]['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x560416,null))['then'](saveUpdates(_0x5044ad['body'],null))[_0x5f3a('0x18')](respondWithResult(_0x560416,null))[_0x5f3a('0x22')](handleError(_0x560416,null));};exports['destroy']=function(_0xfb54a,_0x29a8fe){return db[_0x5f3a('0x34')]['find']({'where':{'id':_0xfb54a[_0x5f3a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29a8fe,null))['then'](removeEntity(_0x29a8fe,null))[_0x5f3a('0x22')](handleError(_0x29a8fe,null));};exports[_0x5f3a('0x51')]=function(_0x4b1014,_0x1f89d1,_0x11c360){var _0x377248={};var _0x494062={};var _0x59e224;var _0x1f84e4;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4b1014[_0x5f3a('0x4b')]['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x1f89d1,null))[_0x5f3a('0x18')](function(_0x31afd3){if(_0x31afd3){_0x59e224=_0x31afd3;_0x494062['model']=_[_0x5f3a('0x3b')](db[_0x5f3a('0x52')]['rawAttributes']);_0x494062[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x4b1014['query']);_0x494062[_0x5f3a('0x3c')]=_[_0x5f3a('0x3e')](_0x494062[_0x5f3a('0x39')],_0x494062[_0x5f3a('0x3a')]);_0x377248['attributes']=_['intersection'](_0x494062[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x377248[_0x5f3a('0x3d')]=_0x377248[_0x5f3a('0x3d')][_0x5f3a('0x4c')]?_0x377248['attributes']:_0x494062[_0x5f3a('0x39')];_0x377248[_0x5f3a('0x42')]=qs[_0x5f3a('0x53')](_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x53')]);_0x377248[_0x5f3a('0x43')]=qs[_0x5f3a('0x3c')](_[_0x5f3a('0x44')](_0x4b1014[_0x5f3a('0x3a')],_0x494062[_0x5f3a('0x3c')]));if(_0x4b1014[_0x5f3a('0x3a')]['filter']){_0x377248[_0x5f3a('0x43')]=_[_0x5f3a('0x54')](_0x377248[_0x5f3a('0x43')],{'$or':_[_0x5f3a('0x46')](_0x377248[_0x5f3a('0x3d')],function(_0x1d23b6){var _0x31685b={};_0x31685b[_0x1d23b6]={'$like':'%'+_0x4b1014['query']['filter']+'%'};return _0x31685b;})});}_0x377248=_['merge']({},_0x377248,_0x4b1014[_0x5f3a('0x55')]);return _0x59e224['getFields'](_0x377248);}})[_0x5f3a('0x18')](function(_0x536f31){if(_0x536f31){_0x1f84e4=_0x536f31[_0x5f3a('0x4c')];if(!_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x40')]('nolimit')){_0x377248[_0x5f3a('0x27')]=qs['limit'](_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x27')]);_0x377248[_0x5f3a('0x25')]=qs[_0x5f3a('0x25')](_0x4b1014['query'][_0x5f3a('0x25')]);}return _0x59e224['getFields'](_0x377248);}})[_0x5f3a('0x18')](function(_0xb1701a){if(_0xb1701a){return _0xb1701a?{'count':_0x1f84e4,'rows':_0xb1701a}:null;}})['then'](respondWithResult(_0x1f89d1,null))[_0x5f3a('0x22')](handleError(_0x1f89d1,null));};exports['getSubjects']=function(_0x66d598,_0x1713ef,_0x566ab2){var _0x198d5b={};var _0x1b2522={};var _0x9cd6d2;var _0x1367c3;return db[_0x5f3a('0x34')][_0x5f3a('0x56')]({'where':{'id':_0x66d598['params']['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x1713ef,null))[_0x5f3a('0x18')](function(_0x51085b){if(_0x51085b){_0x9cd6d2=_0x51085b;_0x1b2522[_0x5f3a('0x39')]=_[_0x5f3a('0x3b')](db[_0x5f3a('0x52')]['rawAttributes']);_0x1b2522['query']=_[_0x5f3a('0x3b')](_0x66d598[_0x5f3a('0x3a')]);_0x1b2522[_0x5f3a('0x3c')]=_[_0x5f3a('0x3e')](_0x1b2522[_0x5f3a('0x39')],_0x1b2522[_0x5f3a('0x3a')]);_0x198d5b[_0x5f3a('0x3d')]=_[_0x5f3a('0x3e')](_0x1b2522[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x198d5b[_0x5f3a('0x3d')]=_0x198d5b[_0x5f3a('0x3d')]['length']?_0x198d5b[_0x5f3a('0x3d')]:_0x1b2522['model'];_0x198d5b[_0x5f3a('0x42')]=qs[_0x5f3a('0x53')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x53')]);_0x198d5b[_0x5f3a('0x43')]=qs[_0x5f3a('0x3c')](_['pick'](_0x66d598['query'],_0x1b2522[_0x5f3a('0x3c')]));if(_0x66d598['query'][_0x5f3a('0x45')]){_0x198d5b[_0x5f3a('0x43')]=_[_0x5f3a('0x54')](_0x198d5b[_0x5f3a('0x43')],{'$or':_['map'](_0x198d5b[_0x5f3a('0x3d')],function(_0x59930e){var _0x15cd5b={};_0x15cd5b[_0x59930e]={'$like':'%'+_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x45')]+'%'};return _0x15cd5b;})});}_0x198d5b=_[_0x5f3a('0x54')]({},_0x198d5b,_0x66d598[_0x5f3a('0x55')]);return _0x9cd6d2[_0x5f3a('0x57')](_0x198d5b);}})[_0x5f3a('0x18')](function(_0xbd06aa){if(_0xbd06aa){_0x1367c3=_0xbd06aa[_0x5f3a('0x4c')];if(!_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x40')](_0x5f3a('0x41'))){_0x198d5b[_0x5f3a('0x27')]=qs[_0x5f3a('0x27')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x27')]);_0x198d5b[_0x5f3a('0x25')]=qs[_0x5f3a('0x25')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x25')]);}return _0x9cd6d2[_0x5f3a('0x57')](_0x198d5b);}})[_0x5f3a('0x18')](function(_0x43172e){if(_0x43172e){return _0x43172e?{'count':_0x1367c3,'rows':_0x43172e}:null;}})['then'](respondWithResult(_0x1713ef,null))[_0x5f3a('0x22')](handleError(_0x1713ef,null));};exports[_0x5f3a('0x58')]=function(_0x52eb99,_0x122d1a,_0x56ad75){var _0x4b9b91={};var _0x4a32ba={};var _0x5155b8;var _0x48a626;return db[_0x5f3a('0x34')][_0x5f3a('0x56')]({'where':{'id':_0x52eb99[_0x5f3a('0x4b')]['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x122d1a,null))['then'](function(_0x5bb2f3){if(_0x5bb2f3){_0x5155b8=_0x5bb2f3;_0x4a32ba[_0x5f3a('0x39')]=_['keys'](db[_0x5f3a('0x52')][_0x5f3a('0x35')]);_0x4a32ba[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x52eb99[_0x5f3a('0x3a')]);_0x4a32ba['filters']=_['intersection'](_0x4a32ba[_0x5f3a('0x39')],_0x4a32ba[_0x5f3a('0x3a')]);_0x4b9b91[_0x5f3a('0x3d')]=_[_0x5f3a('0x3e')](_0x4a32ba['model'],qs[_0x5f3a('0x3f')](_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x4b9b91[_0x5f3a('0x3d')]=_0x4b9b91[_0x5f3a('0x3d')][_0x5f3a('0x4c')]?_0x4b9b91[_0x5f3a('0x3d')]:_0x4a32ba[_0x5f3a('0x39')];_0x4b9b91['order']=qs[_0x5f3a('0x53')](_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x53')]);_0x4b9b91['where']=qs['filters'](_[_0x5f3a('0x44')](_0x52eb99[_0x5f3a('0x3a')],_0x4a32ba[_0x5f3a('0x3c')]));if(_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x45')]){_0x4b9b91[_0x5f3a('0x43')]=_['merge'](_0x4b9b91[_0x5f3a('0x43')],{'$or':_[_0x5f3a('0x46')](_0x4b9b91[_0x5f3a('0x3d')],function(_0x237e3a){var _0x369368={};_0x369368[_0x237e3a]={'$like':'%'+_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x45')]+'%'};return _0x369368;})});}_0x4b9b91=_[_0x5f3a('0x54')]({},_0x4b9b91,_0x52eb99[_0x5f3a('0x55')]);return _0x5155b8[_0x5f3a('0x58')](_0x4b9b91);}})[_0x5f3a('0x18')](function(_0xa8922d){if(_0xa8922d){_0x48a626=_0xa8922d[_0x5f3a('0x4c')];if(!_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x40')](_0x5f3a('0x41'))){_0x4b9b91[_0x5f3a('0x27')]=qs[_0x5f3a('0x27')](_0x52eb99['query'][_0x5f3a('0x27')]);_0x4b9b91[_0x5f3a('0x25')]=qs[_0x5f3a('0x25')](_0x52eb99['query'][_0x5f3a('0x25')]);}return _0x5155b8[_0x5f3a('0x58')](_0x4b9b91);}})[_0x5f3a('0x18')](function(_0x255e67){if(_0x255e67){return _0x255e67?{'count':_0x48a626,'rows':_0x255e67}:null;}})[_0x5f3a('0x18')](respondWithResult(_0x122d1a,null))[_0x5f3a('0x22')](handleError(_0x122d1a,null));}; \ No newline at end of file +var _0x0adf=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','create','body','find','getFields','SugarcrmField','order','getSubjects','findOne','map','getDescriptions','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','send','SugarcrmConfiguration','rawAttributes','type','key','query','keys','filters','model'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x0adf,0xcc));var _0xf0ad=function(_0x2001d3,_0x45c1d8){_0x2001d3=_0x2001d3-0x0;var _0x341053=_0x0adf[_0x2001d3];return _0x341053;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0ad('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0ad('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ad('0x2'));var Mustache=require(_0xf0ad('0x3'));var util=require('util');var path=require(_0xf0ad('0x4'));var sox=require(_0xf0ad('0x5'));var csv=require(_0xf0ad('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0ad('0x7'));var _=require(_0xf0ad('0x8'));var squel=require(_0xf0ad('0x9'));var crypto=require(_0xf0ad('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf0ad('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf0ad('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0xd'));var as=require(_0xf0ad('0xe'));var hardwareService=require(_0xf0ad('0xf'));var logger=require(_0xf0ad('0x10'))(_0xf0ad('0x11'));var utils=require('../../config/utils');var config=require(_0xf0ad('0x12'));var licenseUtil=require(_0xf0ad('0x13'));var db=require(_0xf0ad('0x14'))['db'];var jayson=require(_0xf0ad('0x15'));var client=jayson[_0xf0ad('0x16')][_0xf0ad('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x30148a,_0x45a3ce,_0x49bcf2,_0x6183c9){return new BPromise(function(_0x533653,_0x306609){var _0x518d6a=_0x6183c9||client;return _0x518d6a[_0xf0ad('0x18')](_0x30148a,_0x49bcf2)[_0xf0ad('0x19')](function(_0x3c793c){logger[_0xf0ad('0x1a')](_0xf0ad('0x1b'),_0x45a3ce,_0xf0ad('0x1c'));logger[_0xf0ad('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x45a3ce,_0xf0ad('0x1c'),JSON[_0xf0ad('0x1e')](_0x3c793c));if(_0x3c793c[_0xf0ad('0x1f')]){if(_0x3c793c[_0xf0ad('0x1f')][_0xf0ad('0x20')]===0x1f4){logger['error'](_0xf0ad('0x1b'),_0x45a3ce,_0x3c793c[_0xf0ad('0x1f')]['message']);return _0x306609(_0x3c793c[_0xf0ad('0x1f')][_0xf0ad('0x21')]);}logger['error'](_0xf0ad('0x1b'),_0x45a3ce,_0x3c793c[_0xf0ad('0x1f')][_0xf0ad('0x21')]);return _0x533653(_0x3c793c[_0xf0ad('0x1f')][_0xf0ad('0x21')]);}else{logger['info'](_0xf0ad('0x1b'),_0x45a3ce,_0xf0ad('0x1c'));_0x533653(_0x3c793c[_0xf0ad('0x22')][_0xf0ad('0x21')]);}})[_0xf0ad('0x23')](function(_0x4fa84e){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x45a3ce,_0x4fa84e);_0x306609(_0x4fa84e);});});}function respondWithStatusCode(_0xc38841,_0x44e12c){_0x44e12c=_0x44e12c||0xcc;return function(_0x35146e){if(_0x35146e){return _0xc38841[_0xf0ad('0x24')](_0x44e12c);}return _0xc38841[_0xf0ad('0x25')](_0x44e12c)[_0xf0ad('0x26')]();};}function respondWithResult(_0x37d67c,_0x2fdc5f){_0x2fdc5f=_0x2fdc5f||0xc8;return function(_0x57638f){if(_0x57638f){return _0x37d67c['status'](_0x2fdc5f)[_0xf0ad('0x27')](_0x57638f);}};}function respondWithFilteredResult(_0x43e11f,_0x195d6a){return function(_0x49f247){if(_0x49f247){var _0x39cfef=typeof _0x195d6a[_0xf0ad('0x28')]===_0xf0ad('0x29')&&typeof _0x195d6a[_0xf0ad('0x2a')]===_0xf0ad('0x29');var _0x468698=_0x49f247[_0xf0ad('0x2b')];var _0x33b7f8=_0x39cfef?0x0:_0x195d6a[_0xf0ad('0x28')];var _0x4e03de=_0x39cfef?_0x49f247['count']:_0x195d6a[_0xf0ad('0x28')]+_0x195d6a[_0xf0ad('0x2a')];var _0x2829cc;if(_0x4e03de>=_0x468698){_0x4e03de=_0x468698;_0x2829cc=0xc8;}else{_0x2829cc=0xce;}_0x43e11f[_0xf0ad('0x25')](_0x2829cc);return _0x43e11f[_0xf0ad('0x2c')]('Content-Range',_0x33b7f8+'-'+_0x4e03de+'/'+_0x468698)['json'](_0x49f247);}return null;};}function patchUpdates(_0x2f1853){return function(_0x5bbf22){try{jsonpatch[_0xf0ad('0x2d')](_0x5bbf22,_0x2f1853,!![]);}catch(_0x29352b){return BPromise['reject'](_0x29352b);}return _0x5bbf22[_0xf0ad('0x2e')]();};}function saveUpdates(_0x2f186e,_0x162c31){return function(_0x2d1d04){if(_0x2d1d04){return _0x2d1d04[_0xf0ad('0x2f')](_0x2f186e)[_0xf0ad('0x19')](function(_0x37ff2c){return _0x37ff2c;});}return null;};}function removeEntity(_0x45e22d,_0x468c89){return function(_0x1bb884){if(_0x1bb884){return _0x1bb884[_0xf0ad('0x30')]()[_0xf0ad('0x19')](function(){_0x45e22d[_0xf0ad('0x25')](0xcc)[_0xf0ad('0x26')]();});}};}function handleEntityNotFound(_0x35441b,_0x5898af){return function(_0x6e89dd){if(!_0x6e89dd){_0x35441b['sendStatus'](0x194);}return _0x6e89dd;};}function handleError(_0x760d87,_0x391f05){_0x391f05=_0x391f05||0x1f4;return function(_0x5f565e){logger[_0xf0ad('0x1f')](_0x5f565e[_0xf0ad('0x31')]);if(_0x5f565e[_0xf0ad('0x32')]){delete _0x5f565e[_0xf0ad('0x32')];}_0x760d87['status'](_0x391f05)[_0xf0ad('0x33')](_0x5f565e);};}exports['index']=function(_0xf36618,_0x229778){var _0x3f2aa3={},_0x25d633={},_0xeca25a={'count':0x0,'rows':[]};var _0x3b21a0=_['map'](db[_0xf0ad('0x34')][_0xf0ad('0x35')],function(_0x22f2e3){return{'name':_0x22f2e3['fieldName'],'type':_0x22f2e3[_0xf0ad('0x36')][_0xf0ad('0x37')]};});_0x25d633['model']=_['map'](_0x3b21a0,_0xf0ad('0x32'));_0x25d633[_0xf0ad('0x38')]=_[_0xf0ad('0x39')](_0xf36618[_0xf0ad('0x38')]);_0x25d633[_0xf0ad('0x3a')]=_['intersection'](_0x25d633[_0xf0ad('0x3b')],_0x25d633[_0xf0ad('0x38')]);_0x3f2aa3[_0xf0ad('0x3c')]=_[_0xf0ad('0x3d')](_0x25d633[_0xf0ad('0x3b')],qs[_0xf0ad('0x3e')](_0xf36618[_0xf0ad('0x38')]['fields']));_0x3f2aa3['attributes']=_0x3f2aa3[_0xf0ad('0x3c')][_0xf0ad('0x3f')]?_0x3f2aa3[_0xf0ad('0x3c')]:_0x25d633[_0xf0ad('0x3b')];if(!_0xf36618[_0xf0ad('0x38')][_0xf0ad('0x40')](_0xf0ad('0x41'))){_0x3f2aa3[_0xf0ad('0x2a')]=qs[_0xf0ad('0x2a')](_0xf36618['query']['limit']);_0x3f2aa3[_0xf0ad('0x28')]=qs[_0xf0ad('0x28')](_0xf36618[_0xf0ad('0x38')][_0xf0ad('0x28')]);}_0x3f2aa3['order']=qs[_0xf0ad('0x42')](_0xf36618[_0xf0ad('0x38')]['sort']);_0x3f2aa3[_0xf0ad('0x43')]=qs['filters'](_[_0xf0ad('0x44')](_0xf36618['query'],_0x25d633[_0xf0ad('0x3a')]),_0x3b21a0);if(_0xf36618['query'][_0xf0ad('0x45')]){_0x3f2aa3[_0xf0ad('0x43')]=_[_0xf0ad('0x46')](_0x3f2aa3['where'],{'$or':_['map'](_0x3b21a0,function(_0x4cc740){if(_0x4cc740['type']!==_0xf0ad('0x47')){var _0x449b42={};_0x449b42[_0x4cc740['name']]={'$like':'%'+_0xf36618['query']['filter']+'%'};return _0x449b42;}})});}_0x3f2aa3=_[_0xf0ad('0x46')]({},_0x3f2aa3,_0xf36618[_0xf0ad('0x48')]);var _0xebb2e={'where':_0x3f2aa3[_0xf0ad('0x43')]};return db[_0xf0ad('0x34')]['count'](_0xebb2e)[_0xf0ad('0x19')](function(_0x449442){_0xeca25a[_0xf0ad('0x2b')]=_0x449442;if(_0xf36618[_0xf0ad('0x38')][_0xf0ad('0x49')]){_0x3f2aa3[_0xf0ad('0x4a')]=[{'all':!![]}];}return db[_0xf0ad('0x34')]['findAll'](_0x3f2aa3);})[_0xf0ad('0x19')](function(_0x300cbc){_0xeca25a[_0xf0ad('0x4b')]=_0x300cbc;return _0xeca25a;})[_0xf0ad('0x19')](respondWithFilteredResult(_0x229778,_0x3f2aa3))[_0xf0ad('0x23')](handleError(_0x229778,null));};exports[_0xf0ad('0x4c')]=function(_0x2e6a8d,_0x4110b4){var _0x2c1ace={'raw':![],'where':{'id':_0x2e6a8d[_0xf0ad('0x4d')]['id']}},_0x532a20={};_0x532a20[_0xf0ad('0x3b')]=_[_0xf0ad('0x39')](db[_0xf0ad('0x34')]['rawAttributes']);_0x532a20[_0xf0ad('0x38')]=_[_0xf0ad('0x39')](_0x2e6a8d[_0xf0ad('0x38')]);_0x532a20['filters']=_[_0xf0ad('0x3d')](_0x532a20[_0xf0ad('0x3b')],_0x532a20[_0xf0ad('0x38')]);_0x2c1ace['attributes']=_[_0xf0ad('0x3d')](_0x532a20[_0xf0ad('0x3b')],qs['fields'](_0x2e6a8d[_0xf0ad('0x38')][_0xf0ad('0x3e')]));_0x2c1ace[_0xf0ad('0x3c')]=_0x2c1ace[_0xf0ad('0x3c')][_0xf0ad('0x3f')]?_0x2c1ace[_0xf0ad('0x3c')]:_0x532a20[_0xf0ad('0x3b')];if(_0x2e6a8d['query'][_0xf0ad('0x49')]){_0x2c1ace['include']=[{'all':!![]}];}_0x2c1ace=_['merge']({},_0x2c1ace,_0x2e6a8d[_0xf0ad('0x48')]);return db['SugarcrmConfiguration']['find'](_0x2c1ace)['then'](handleEntityNotFound(_0x4110b4,null))[_0xf0ad('0x19')](respondWithResult(_0x4110b4,null))[_0xf0ad('0x23')](handleError(_0x4110b4,null));};exports[_0xf0ad('0x4e')]=function(_0x2913d8,_0x5160af){return db['SugarcrmConfiguration'][_0xf0ad('0x4e')](_0x2913d8[_0xf0ad('0x4f')],{})['then'](respondWithResult(_0x5160af,0xc9))[_0xf0ad('0x23')](handleError(_0x5160af,null));};exports[_0xf0ad('0x2f')]=function(_0x35fa10,_0x1b0e6b){if(_0x35fa10['body']['id']){delete _0x35fa10['body']['id'];}return db[_0xf0ad('0x34')][_0xf0ad('0x50')]({'where':{'id':_0x35fa10[_0xf0ad('0x4d')]['id']}})[_0xf0ad('0x19')](handleEntityNotFound(_0x1b0e6b,null))[_0xf0ad('0x19')](saveUpdates(_0x35fa10[_0xf0ad('0x4f')],null))[_0xf0ad('0x19')](respondWithResult(_0x1b0e6b,null))['catch'](handleError(_0x1b0e6b,null));};exports[_0xf0ad('0x30')]=function(_0x2fce57,_0xad32ce){return db[_0xf0ad('0x34')][_0xf0ad('0x50')]({'where':{'id':_0x2fce57[_0xf0ad('0x4d')]['id']}})[_0xf0ad('0x19')](handleEntityNotFound(_0xad32ce,null))['then'](removeEntity(_0xad32ce,null))[_0xf0ad('0x23')](handleError(_0xad32ce,null));};exports[_0xf0ad('0x51')]=function(_0x46dc3e,_0x1534d1,_0x5ed220){var _0x35b848={};var _0x3d27d7={};var _0x4551ee;var _0x291e2c;return db[_0xf0ad('0x34')]['findOne']({'where':{'id':_0x46dc3e[_0xf0ad('0x4d')]['id']}})[_0xf0ad('0x19')](handleEntityNotFound(_0x1534d1,null))['then'](function(_0x43d870){if(_0x43d870){_0x4551ee=_0x43d870;_0x3d27d7[_0xf0ad('0x3b')]=_['keys'](db[_0xf0ad('0x52')][_0xf0ad('0x35')]);_0x3d27d7[_0xf0ad('0x38')]=_[_0xf0ad('0x39')](_0x46dc3e[_0xf0ad('0x38')]);_0x3d27d7['filters']=_[_0xf0ad('0x3d')](_0x3d27d7[_0xf0ad('0x3b')],_0x3d27d7[_0xf0ad('0x38')]);_0x35b848[_0xf0ad('0x3c')]=_['intersection'](_0x3d27d7[_0xf0ad('0x3b')],qs['fields'](_0x46dc3e[_0xf0ad('0x38')]['fields']));_0x35b848['attributes']=_0x35b848['attributes'][_0xf0ad('0x3f')]?_0x35b848['attributes']:_0x3d27d7[_0xf0ad('0x3b')];_0x35b848[_0xf0ad('0x53')]=qs[_0xf0ad('0x42')](_0x46dc3e[_0xf0ad('0x38')]['sort']);_0x35b848[_0xf0ad('0x43')]=qs['filters'](_['pick'](_0x46dc3e[_0xf0ad('0x38')],_0x3d27d7[_0xf0ad('0x3a')]));if(_0x46dc3e[_0xf0ad('0x38')][_0xf0ad('0x45')]){_0x35b848['where']=_['merge'](_0x35b848[_0xf0ad('0x43')],{'$or':_['map'](_0x35b848[_0xf0ad('0x3c')],function(_0x26e2b6){var _0x1d93d7={};_0x1d93d7[_0x26e2b6]={'$like':'%'+_0x46dc3e[_0xf0ad('0x38')][_0xf0ad('0x45')]+'%'};return _0x1d93d7;})});}_0x35b848=_[_0xf0ad('0x46')]({},_0x35b848,_0x46dc3e[_0xf0ad('0x48')]);return _0x4551ee[_0xf0ad('0x51')](_0x35b848);}})[_0xf0ad('0x19')](function(_0x4864d2){if(_0x4864d2){_0x291e2c=_0x4864d2[_0xf0ad('0x3f')];if(!_0x46dc3e[_0xf0ad('0x38')][_0xf0ad('0x40')](_0xf0ad('0x41'))){_0x35b848[_0xf0ad('0x2a')]=qs['limit'](_0x46dc3e['query'][_0xf0ad('0x2a')]);_0x35b848[_0xf0ad('0x28')]=qs['offset'](_0x46dc3e[_0xf0ad('0x38')][_0xf0ad('0x28')]);}return _0x4551ee[_0xf0ad('0x51')](_0x35b848);}})[_0xf0ad('0x19')](function(_0x2ccaf7){if(_0x2ccaf7){return _0x2ccaf7?{'count':_0x291e2c,'rows':_0x2ccaf7}:null;}})['then'](respondWithResult(_0x1534d1,null))[_0xf0ad('0x23')](handleError(_0x1534d1,null));};exports[_0xf0ad('0x54')]=function(_0x4593e2,_0x47c0bf,_0x554b20){var _0x36e172={};var _0x59f79c={};var _0x5b78dd;var _0x4fb2ab;return db['SugarcrmConfiguration'][_0xf0ad('0x55')]({'where':{'id':_0x4593e2['params']['id']}})[_0xf0ad('0x19')](handleEntityNotFound(_0x47c0bf,null))['then'](function(_0x3a6993){if(_0x3a6993){_0x5b78dd=_0x3a6993;_0x59f79c[_0xf0ad('0x3b')]=_[_0xf0ad('0x39')](db[_0xf0ad('0x52')]['rawAttributes']);_0x59f79c['query']=_[_0xf0ad('0x39')](_0x4593e2[_0xf0ad('0x38')]);_0x59f79c[_0xf0ad('0x3a')]=_[_0xf0ad('0x3d')](_0x59f79c[_0xf0ad('0x3b')],_0x59f79c[_0xf0ad('0x38')]);_0x36e172[_0xf0ad('0x3c')]=_[_0xf0ad('0x3d')](_0x59f79c[_0xf0ad('0x3b')],qs[_0xf0ad('0x3e')](_0x4593e2[_0xf0ad('0x38')][_0xf0ad('0x3e')]));_0x36e172[_0xf0ad('0x3c')]=_0x36e172[_0xf0ad('0x3c')][_0xf0ad('0x3f')]?_0x36e172[_0xf0ad('0x3c')]:_0x59f79c[_0xf0ad('0x3b')];_0x36e172[_0xf0ad('0x53')]=qs[_0xf0ad('0x42')](_0x4593e2['query']['sort']);_0x36e172[_0xf0ad('0x43')]=qs[_0xf0ad('0x3a')](_[_0xf0ad('0x44')](_0x4593e2['query'],_0x59f79c[_0xf0ad('0x3a')]));if(_0x4593e2[_0xf0ad('0x38')][_0xf0ad('0x45')]){_0x36e172['where']=_[_0xf0ad('0x46')](_0x36e172[_0xf0ad('0x43')],{'$or':_[_0xf0ad('0x56')](_0x36e172[_0xf0ad('0x3c')],function(_0x496b63){var _0x21ce18={};_0x21ce18[_0x496b63]={'$like':'%'+_0x4593e2[_0xf0ad('0x38')]['filter']+'%'};return _0x21ce18;})});}_0x36e172=_[_0xf0ad('0x46')]({},_0x36e172,_0x4593e2['options']);return _0x5b78dd[_0xf0ad('0x54')](_0x36e172);}})[_0xf0ad('0x19')](function(_0x2c5722){if(_0x2c5722){_0x4fb2ab=_0x2c5722[_0xf0ad('0x3f')];if(!_0x4593e2[_0xf0ad('0x38')][_0xf0ad('0x40')](_0xf0ad('0x41'))){_0x36e172['limit']=qs[_0xf0ad('0x2a')](_0x4593e2[_0xf0ad('0x38')][_0xf0ad('0x2a')]);_0x36e172[_0xf0ad('0x28')]=qs[_0xf0ad('0x28')](_0x4593e2[_0xf0ad('0x38')]['offset']);}return _0x5b78dd[_0xf0ad('0x54')](_0x36e172);}})[_0xf0ad('0x19')](function(_0x320219){if(_0x320219){return _0x320219?{'count':_0x4fb2ab,'rows':_0x320219}:null;}})['then'](respondWithResult(_0x47c0bf,null))[_0xf0ad('0x23')](handleError(_0x47c0bf,null));};exports[_0xf0ad('0x57')]=function(_0x48569c,_0x35dcb7,_0x1d18d8){var _0x41f1bd={};var _0x4cb1f3={};var _0x4cb1cc;var _0x2a01d6;return db[_0xf0ad('0x34')][_0xf0ad('0x55')]({'where':{'id':_0x48569c['params']['id']}})[_0xf0ad('0x19')](handleEntityNotFound(_0x35dcb7,null))[_0xf0ad('0x19')](function(_0x4358e4){if(_0x4358e4){_0x4cb1cc=_0x4358e4;_0x4cb1f3[_0xf0ad('0x3b')]=_[_0xf0ad('0x39')](db[_0xf0ad('0x52')][_0xf0ad('0x35')]);_0x4cb1f3[_0xf0ad('0x38')]=_['keys'](_0x48569c[_0xf0ad('0x38')]);_0x4cb1f3[_0xf0ad('0x3a')]=_[_0xf0ad('0x3d')](_0x4cb1f3['model'],_0x4cb1f3[_0xf0ad('0x38')]);_0x41f1bd[_0xf0ad('0x3c')]=_[_0xf0ad('0x3d')](_0x4cb1f3[_0xf0ad('0x3b')],qs[_0xf0ad('0x3e')](_0x48569c[_0xf0ad('0x38')][_0xf0ad('0x3e')]));_0x41f1bd[_0xf0ad('0x3c')]=_0x41f1bd[_0xf0ad('0x3c')][_0xf0ad('0x3f')]?_0x41f1bd[_0xf0ad('0x3c')]:_0x4cb1f3[_0xf0ad('0x3b')];_0x41f1bd[_0xf0ad('0x53')]=qs[_0xf0ad('0x42')](_0x48569c[_0xf0ad('0x38')][_0xf0ad('0x42')]);_0x41f1bd[_0xf0ad('0x43')]=qs['filters'](_[_0xf0ad('0x44')](_0x48569c[_0xf0ad('0x38')],_0x4cb1f3['filters']));if(_0x48569c[_0xf0ad('0x38')]['filter']){_0x41f1bd[_0xf0ad('0x43')]=_[_0xf0ad('0x46')](_0x41f1bd[_0xf0ad('0x43')],{'$or':_['map'](_0x41f1bd['attributes'],function(_0x15ef39){var _0x4cc92a={};_0x4cc92a[_0x15ef39]={'$like':'%'+_0x48569c[_0xf0ad('0x38')][_0xf0ad('0x45')]+'%'};return _0x4cc92a;})});}_0x41f1bd=_[_0xf0ad('0x46')]({},_0x41f1bd,_0x48569c[_0xf0ad('0x48')]);return _0x4cb1cc[_0xf0ad('0x57')](_0x41f1bd);}})[_0xf0ad('0x19')](function(_0x539e4f){if(_0x539e4f){_0x2a01d6=_0x539e4f[_0xf0ad('0x3f')];if(!_0x48569c[_0xf0ad('0x38')][_0xf0ad('0x40')](_0xf0ad('0x41'))){_0x41f1bd[_0xf0ad('0x2a')]=qs[_0xf0ad('0x2a')](_0x48569c[_0xf0ad('0x38')]['limit']);_0x41f1bd[_0xf0ad('0x28')]=qs['offset'](_0x48569c[_0xf0ad('0x38')][_0xf0ad('0x28')]);}return _0x4cb1cc['getDescriptions'](_0x41f1bd);}})[_0xf0ad('0x19')](function(_0x37edb9){if(_0x37edb9){return _0x37edb9?{'count':_0x2a01d6,'rows':_0x37edb9}:null;}})['then'](respondWithResult(_0x35dcb7,null))[_0xf0ad('0x23')](handleError(_0x35dcb7,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 823f72f..5ccdc75 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 _0xb30d=['define','int_sugarcrm_configurations','util','../../config/logger','api','bluebird','path','rimraf','./intSugarcrmConfiguration.attributes','exports'];(function(_0x5375e0,_0x41ca48){var _0x488322=function(_0x4d0e2c){while(--_0x4d0e2c){_0x5375e0['push'](_0x5375e0['shift']());}};_0x488322(++_0x41ca48);}(_0xb30d,0xf2));var _0xdb30=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0xb30d[_0x191154];return _0x3dcd73;};'use strict';var _=require('lodash');var util=require(_0xdb30('0x0'));var logger=require(_0xdb30('0x1'))(_0xdb30('0x2'));var moment=require('moment');var BPromise=require(_0xdb30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb30('0x4'));var rimraf=require(_0xdb30('0x5'));var config=require('../../config/environment');var attributes=require(_0xdb30('0x6'));module[_0xdb30('0x7')]=function(_0x56fb72,_0x5abee4){return _0x56fb72[_0xdb30('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xdb30('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4c1=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x193569,_0x991672){var _0x330ab9=function(_0x3427eb){while(--_0x3427eb){_0x193569['push'](_0x193569['shift']());}};_0x330ab9(++_0x991672);}(_0xf4c1,0x67));var _0x1f4c=function(_0x1d0456,_0x353c0b){_0x1d0456=_0x1d0456-0x0;var _0x1f4fbf=_0xf4c1[_0x1d0456];return _0x1f4fbf;};'use strict';var _=require(_0x1f4c('0x0'));var util=require(_0x1f4c('0x1'));var logger=require(_0x1f4c('0x2'))(_0x1f4c('0x3'));var moment=require('moment');var BPromise=require(_0x1f4c('0x4'));var rp=require(_0x1f4c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f4c('0x6'));var attributes=require(_0x1f4c('0x7'));module[_0x1f4c('0x8')]=function(_0x9f76d9,_0x56cb51){return _0x9f76d9['define'](_0x1f4c('0x9'),attributes,{'tableName':_0x1f4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index f29a151..ba7b143 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 _0x5442=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','SugarcrmConfiguration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x430412,_0x41489b){var _0x222658=function(_0xfa0890){while(--_0xfa0890){_0x430412['push'](_0x430412['shift']());}};_0x222658(++_0x41489b);}(_0x5442,0xec));var _0x2544=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0x5442[_0x3e5bc8];return _0xfd84bc;};'use strict';var _=require(_0x2544('0x0'));var util=require(_0x2544('0x1'));var moment=require(_0x2544('0x2'));var BPromise=require(_0x2544('0x3'));var rs=require(_0x2544('0x4'));var fs=require('fs');var Redis=require(_0x2544('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2544('0x6'));var logger=require(_0x2544('0x7'))(_0x2544('0x8'));var config=require(_0x2544('0x9'));var jayson=require(_0x2544('0xa'));var client=jayson[_0x2544('0xb')][_0x2544('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10fa21,_0x4170f2,_0x50875a){return new BPromise(function(_0x54070a,_0x3bc002){return client[_0x2544('0xd')](_0x10fa21,_0x50875a)[_0x2544('0xe')](function(_0x1ec139){logger[_0x2544('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4170f2,'request\x20sent');logger[_0x2544('0x10')](_0x2544('0x11'),_0x4170f2,'request\x20sent',JSON['stringify'](_0x1ec139));if(_0x1ec139[_0x2544('0x12')]){if(_0x1ec139[_0x2544('0x12')]['code']===0x1f4){logger['error'](_0x2544('0x13'),_0x4170f2,_0x1ec139[_0x2544('0x12')][_0x2544('0x14')]);return _0x3bc002(_0x1ec139[_0x2544('0x12')][_0x2544('0x14')]);}logger[_0x2544('0x12')](_0x2544('0x13'),_0x4170f2,_0x1ec139[_0x2544('0x12')]['message']);return _0x54070a(_0x1ec139['error']['message']);}else{logger[_0x2544('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4170f2,_0x2544('0x15'));_0x54070a(_0x1ec139[_0x2544('0x16')][_0x2544('0x14')]);}})['catch'](function(_0x249db5){logger[_0x2544('0x12')](_0x2544('0x13'),_0x4170f2,_0x249db5);_0x3bc002(_0x249db5);});});} \ No newline at end of file +var _0x5e12=['error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1863c3,_0x5801dd){var _0x2e38b5=function(_0x430929){while(--_0x430929){_0x1863c3['push'](_0x1863c3['shift']());}};_0x2e38b5(++_0x5801dd);}(_0x5e12,0x13b));var _0x25e1=function(_0x5e03db,_0x2ada0a){_0x5e03db=_0x5e03db-0x0;var _0x1c09f1=_0x5e12[_0x5e03db];return _0x1c09f1;};'use strict';var _=require(_0x25e1('0x0'));var util=require('util');var moment=require(_0x25e1('0x1'));var BPromise=require(_0x25e1('0x2'));var rs=require(_0x25e1('0x3'));var fs=require('fs');var Redis=require(_0x25e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25e1('0x5'));var logger=require(_0x25e1('0x6'))('rpc');var config=require(_0x25e1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x25e1('0x8')][_0x25e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8afa,_0x211e58,_0x178ed0){return new BPromise(function(_0x42b569,_0x4c061c){return client['request'](_0x1d8afa,_0x178ed0)[_0x25e1('0xa')](function(_0x11a210){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x211e58,'request\x20sent');logger[_0x25e1('0xb')](_0x25e1('0xc'),_0x211e58,_0x25e1('0xd'),JSON[_0x25e1('0xe')](_0x11a210));if(_0x11a210['error']){if(_0x11a210[_0x25e1('0xf')][_0x25e1('0x10')]===0x1f4){logger[_0x25e1('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x211e58,_0x11a210['error'][_0x25e1('0x11')]);return _0x4c061c(_0x11a210[_0x25e1('0xf')][_0x25e1('0x11')]);}logger[_0x25e1('0xf')](_0x25e1('0x12'),_0x211e58,_0x11a210[_0x25e1('0xf')][_0x25e1('0x11')]);return _0x42b569(_0x11a210[_0x25e1('0xf')][_0x25e1('0x11')]);}else{logger[_0x25e1('0x13')](_0x25e1('0x12'),_0x211e58,_0x25e1('0xd'));_0x42b569(_0x11a210[_0x25e1('0x14')][_0x25e1('0x11')]);}})[_0x25e1('0x15')](function(_0x376850){logger[_0x25e1('0xf')](_0x25e1('0x12'),_0x211e58,_0x376850);_0x4c061c(_0x376850);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 580f189..8d2810a 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 _0xc596=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','post','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x3fe8c8,_0x1e5dda){var _0x5dc1f3=function(_0x13a227){while(--_0x13a227){_0x3fe8c8['push'](_0x3fe8c8['shift']());}};_0x5dc1f3(++_0x1e5dda);}(_0xc596,0x1e1));var _0x6c59=function(_0x4f4de2,_0x257b5d){_0x4f4de2=_0x4f4de2-0x0;var _0x1cbf3a=_0xc596[_0x4f4de2];return _0x1cbf3a;};'use strict';var multer=require('multer');var util=require(_0x6c59('0x0'));var path=require(_0x6c59('0x1'));var timeout=require(_0x6c59('0x2'));var express=require(_0x6c59('0x3'));var router=express[_0x6c59('0x4')]();var fs_extra=require(_0x6c59('0x5'));var auth=require(_0x6c59('0x6'));var interaction=require(_0x6c59('0x7'));var config=require(_0x6c59('0x8'));var controller=require(_0x6c59('0x9'));router[_0x6c59('0xa')]('/',auth[_0x6c59('0xb')](),controller['index']);router['get'](_0x6c59('0xc'),auth[_0x6c59('0xb')](),controller['show']);router[_0x6c59('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6c59('0xe')]('/:id',auth[_0x6c59('0xb')](),controller[_0x6c59('0xf')]);router[_0x6c59('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6c59('0x11')]=router; \ No newline at end of file +var _0x0f7a=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','show'];(function(_0x6bddc3,_0x36563e){var _0x868581=function(_0x3a2628){while(--_0x3a2628){_0x6bddc3['push'](_0x6bddc3['shift']());}};_0x868581(++_0x36563e);}(_0x0f7a,0xcf));var _0xa0f7=function(_0x35b219,_0x4270ad){_0x35b219=_0x35b219-0x0;var _0x388615=_0x0f7a[_0x35b219];return _0x388615;};'use strict';var multer=require(_0xa0f7('0x0'));var util=require(_0xa0f7('0x1'));var path=require(_0xa0f7('0x2'));var timeout=require(_0xa0f7('0x3'));var express=require(_0xa0f7('0x4'));var router=express[_0xa0f7('0x5')]();var fs_extra=require(_0xa0f7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa0f7('0x7'));var config=require('../../config/environment');var controller=require(_0xa0f7('0x8'));router[_0xa0f7('0x9')]('/',auth[_0xa0f7('0xa')](),controller[_0xa0f7('0xb')]);router[_0xa0f7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa0f7('0xc')]);router[_0xa0f7('0xd')]('/',auth[_0xa0f7('0xa')](),controller[_0xa0f7('0xe')]);router[_0xa0f7('0xf')](_0xa0f7('0x10'),auth[_0xa0f7('0xa')](),controller[_0xa0f7('0x11')]);router['delete'](_0xa0f7('0x10'),auth[_0xa0f7('0xa')](),controller[_0xa0f7('0x12')]);module[_0xa0f7('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 6af25d3..01581cb 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 _0xd802=['BOOLEAN','sequelize','exports','variable','picklist','ENUM','STRING'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xd802,0x1c8));var _0x2d80=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0xd802[_0x161f59];return _0x3ffa0e;};'use strict';var Sequelize=require(_0x2d80('0x0'));module[_0x2d80('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x2d80('0x2'),'customVariable','keyValue',_0x2d80('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2d80('0x4')]('string',_0x2d80('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x2d80('0x5')]},'idField':{'type':Sequelize[_0x2d80('0x5')]},'nameField':{'type':Sequelize[_0x2d80('0x5')]},'customField':{'type':Sequelize[_0x2d80('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d80('0x5')]}}; \ No newline at end of file +var _0x6a35=['STRING','BOOLEAN','sequelize','ENUM','string','variable','keyValue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6a35,0xb1));var _0x56a3=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x6a35[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0x56a3('0x0'));module['exports']={'type':{'type':Sequelize[_0x56a3('0x1')](_0x56a3('0x2'),_0x56a3('0x3'),'customVariable',_0x56a3('0x4'),'picklist'),'defaultValue':_0x56a3('0x2')},'content':{'type':Sequelize[_0x56a3('0x5')]},'key':{'type':Sequelize[_0x56a3('0x5')]},'keyType':{'type':Sequelize[_0x56a3('0x1')](_0x56a3('0x2'),_0x56a3('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x56a3('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x56a3('0x5')]},'customField':{'type':Sequelize[_0x56a3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x56a3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 151fa97..e4682a3 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 _0x9b8c=['../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','includeAll','include','SugarcrmField','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x45e96d,_0xa4a268){var _0x237c53=function(_0x537f86){while(--_0x537f86){_0x45e96d['push'](_0x45e96d['shift']());}};_0x237c53(++_0xa4a268);}(_0x9b8c,0x84));var _0xc9b8=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x9b8c[_0x16eb11];return _0x3ae7ef;};'use strict';var emlformat=require(_0xc9b8('0x0'));var rimraf=require(_0xc9b8('0x1'));var zipdir=require(_0xc9b8('0x2'));var jsonpatch=require(_0xc9b8('0x3'));var rp=require(_0xc9b8('0x4'));var moment=require(_0xc9b8('0x5'));var BPromise=require(_0xc9b8('0x6'));var Mustache=require('mustache');var util=require(_0xc9b8('0x7'));var path=require(_0xc9b8('0x8'));var sox=require(_0xc9b8('0x9'));var csv=require(_0xc9b8('0xa'));var ejs=require(_0xc9b8('0xb'));var fs=require('fs');var fs_extra=require(_0xc9b8('0xc'));var _=require(_0xc9b8('0xd'));var squel=require('squel');var crypto=require(_0xc9b8('0xe'));var jsforce=require(_0xc9b8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9b8('0x10'));var Papa=require(_0xc9b8('0x11'));var Redis=require('ioredis');var authService=require(_0xc9b8('0x12'));var qs=require(_0xc9b8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9b8('0x14'));var logger=require(_0xc9b8('0x15'))('api');var utils=require(_0xc9b8('0x16'));var config=require(_0xc9b8('0x17'));var licenseUtil=require(_0xc9b8('0x18'));var db=require(_0xc9b8('0x19'))['db'];function respondWithStatusCode(_0x3511c5,_0x401c1a){_0x401c1a=_0x401c1a||0xcc;return function(_0x1a7867){if(_0x1a7867){return _0x3511c5[_0xc9b8('0x1a')](_0x401c1a);}return _0x3511c5['status'](_0x401c1a)[_0xc9b8('0x1b')]();};}function respondWithResult(_0x4d218f,_0x1002d9){_0x1002d9=_0x1002d9||0xc8;return function(_0x45a4c9){if(_0x45a4c9){return _0x4d218f[_0xc9b8('0x1c')](_0x1002d9)['json'](_0x45a4c9);}};}function respondWithFilteredResult(_0x4ff95a,_0x52b7e5){return function(_0x11c0ac){if(_0x11c0ac){var _0x3ac810=typeof _0x52b7e5[_0xc9b8('0x1d')]===_0xc9b8('0x1e')&&typeof _0x52b7e5[_0xc9b8('0x1f')]===_0xc9b8('0x1e');var _0x5cb28a=_0x11c0ac[_0xc9b8('0x20')];var _0x1ad2bc=_0x3ac810?0x0:_0x52b7e5[_0xc9b8('0x1d')];var _0x52ba07=_0x3ac810?_0x11c0ac[_0xc9b8('0x20')]:_0x52b7e5['offset']+_0x52b7e5['limit'];var _0xe1e84e;if(_0x52ba07>=_0x5cb28a){_0x52ba07=_0x5cb28a;_0xe1e84e=0xc8;}else{_0xe1e84e=0xce;}_0x4ff95a[_0xc9b8('0x1c')](_0xe1e84e);return _0x4ff95a[_0xc9b8('0x21')](_0xc9b8('0x22'),_0x1ad2bc+'-'+_0x52ba07+'/'+_0x5cb28a)['json'](_0x11c0ac);}return null;};}function patchUpdates(_0x20dbaf){return function(_0x1dd3f9){try{jsonpatch[_0xc9b8('0x23')](_0x1dd3f9,_0x20dbaf,!![]);}catch(_0x431e14){return BPromise[_0xc9b8('0x24')](_0x431e14);}return _0x1dd3f9[_0xc9b8('0x25')]();};}function saveUpdates(_0x14222c,_0x389cc9){return function(_0x3b5be9){if(_0x3b5be9){return _0x3b5be9[_0xc9b8('0x26')](_0x14222c)[_0xc9b8('0x27')](function(_0x518fc0){return _0x518fc0;});}return null;};}function removeEntity(_0x25823f,_0x43365e){return function(_0x3dd394){if(_0x3dd394){return _0x3dd394[_0xc9b8('0x28')]()[_0xc9b8('0x27')](function(){_0x25823f[_0xc9b8('0x1c')](0xcc)[_0xc9b8('0x1b')]();});}};}function handleEntityNotFound(_0x1a8d72,_0x3082c7){return function(_0x148a1a){if(!_0x148a1a){_0x1a8d72[_0xc9b8('0x1a')](0x194);}return _0x148a1a;};}function handleError(_0x214e56,_0x18611f){_0x18611f=_0x18611f||0x1f4;return function(_0x45df5c){logger[_0xc9b8('0x29')](_0x45df5c[_0xc9b8('0x2a')]);if(_0x45df5c['name']){delete _0x45df5c[_0xc9b8('0x2b')];}_0x214e56[_0xc9b8('0x1c')](_0x18611f)[_0xc9b8('0x2c')](_0x45df5c);};}exports[_0xc9b8('0x2d')]=function(_0x48fb8a,_0x4d4648){var _0x3cc640={},_0x1e9554={},_0x1dc6e7={'count':0x0,'rows':[]};var _0x2f1c56=_['map'](db['SugarcrmField'][_0xc9b8('0x2e')],function(_0x4bfdae){return{'name':_0x4bfdae[_0xc9b8('0x2f')],'type':_0x4bfdae[_0xc9b8('0x30')][_0xc9b8('0x31')]};});_0x1e9554[_0xc9b8('0x32')]=_['map'](_0x2f1c56,_0xc9b8('0x2b'));_0x1e9554[_0xc9b8('0x33')]=_[_0xc9b8('0x34')](_0x48fb8a['query']);_0x1e9554['filters']=_[_0xc9b8('0x35')](_0x1e9554['model'],_0x1e9554[_0xc9b8('0x33')]);_0x3cc640[_0xc9b8('0x36')]=_[_0xc9b8('0x35')](_0x1e9554['model'],qs[_0xc9b8('0x37')](_0x48fb8a['query']['fields']));_0x3cc640[_0xc9b8('0x36')]=_0x3cc640[_0xc9b8('0x36')][_0xc9b8('0x38')]?_0x3cc640['attributes']:_0x1e9554[_0xc9b8('0x32')];if(!_0x48fb8a[_0xc9b8('0x33')]['hasOwnProperty'](_0xc9b8('0x39'))){_0x3cc640[_0xc9b8('0x1f')]=qs[_0xc9b8('0x1f')](_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x1f')]);_0x3cc640['offset']=qs['offset'](_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x1d')]);}_0x3cc640[_0xc9b8('0x3a')]=qs[_0xc9b8('0x3b')](_0x48fb8a[_0xc9b8('0x33')]['sort']);_0x3cc640[_0xc9b8('0x3c')]=qs['filters'](_[_0xc9b8('0x3d')](_0x48fb8a[_0xc9b8('0x33')],_0x1e9554[_0xc9b8('0x3e')]),_0x2f1c56);if(_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x3f')]){_0x3cc640[_0xc9b8('0x3c')]=_['merge'](_0x3cc640[_0xc9b8('0x3c')],{'$or':_[_0xc9b8('0x40')](_0x2f1c56,function(_0x2d5613){if(_0x2d5613[_0xc9b8('0x30')]!==_0xc9b8('0x41')){var _0x4d735a={};_0x4d735a[_0x2d5613[_0xc9b8('0x2b')]]={'$like':'%'+_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x3f')]+'%'};return _0x4d735a;}})});}_0x3cc640=_[_0xc9b8('0x42')]({},_0x3cc640,_0x48fb8a[_0xc9b8('0x43')]);var _0x57d0fc={'where':_0x3cc640[_0xc9b8('0x3c')]};return db['SugarcrmField']['count'](_0x57d0fc)[_0xc9b8('0x27')](function(_0x332f4c){_0x1dc6e7['count']=_0x332f4c;if(_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x44')]){_0x3cc640[_0xc9b8('0x45')]=[{'all':!![]}];}return db[_0xc9b8('0x46')][_0xc9b8('0x47')](_0x3cc640);})['then'](function(_0x37199f){_0x1dc6e7[_0xc9b8('0x48')]=_0x37199f;return _0x1dc6e7;})[_0xc9b8('0x27')](respondWithFilteredResult(_0x4d4648,_0x3cc640))[_0xc9b8('0x49')](handleError(_0x4d4648,null));};exports[_0xc9b8('0x4a')]=function(_0x5f238f,_0x5ba885){var _0x3ab09c={'raw':!![],'where':{'id':_0x5f238f['params']['id']}},_0x439235={};_0x439235['model']=_[_0xc9b8('0x34')](db[_0xc9b8('0x46')][_0xc9b8('0x2e')]);_0x439235[_0xc9b8('0x33')]=_['keys'](_0x5f238f[_0xc9b8('0x33')]);_0x439235[_0xc9b8('0x3e')]=_['intersection'](_0x439235['model'],_0x439235[_0xc9b8('0x33')]);_0x3ab09c[_0xc9b8('0x36')]=_[_0xc9b8('0x35')](_0x439235['model'],qs[_0xc9b8('0x37')](_0x5f238f[_0xc9b8('0x33')]['fields']));_0x3ab09c[_0xc9b8('0x36')]=_0x3ab09c['attributes'][_0xc9b8('0x38')]?_0x3ab09c['attributes']:_0x439235['model'];if(_0x5f238f['query'][_0xc9b8('0x44')]){_0x3ab09c[_0xc9b8('0x45')]=[{'all':!![]}];}_0x3ab09c=_['merge']({},_0x3ab09c,_0x5f238f['options']);return db['SugarcrmField'][_0xc9b8('0x4b')](_0x3ab09c)[_0xc9b8('0x27')](handleEntityNotFound(_0x5ba885,null))['then'](respondWithResult(_0x5ba885,null))[_0xc9b8('0x49')](handleError(_0x5ba885,null));};exports['create']=function(_0x1b0ef9,_0x155585){return db[_0xc9b8('0x46')]['create'](_0x1b0ef9['body'],{})[_0xc9b8('0x27')](respondWithResult(_0x155585,0xc9))[_0xc9b8('0x49')](handleError(_0x155585,null));};exports[_0xc9b8('0x26')]=function(_0x1bc461,_0x3cae75){if(_0x1bc461[_0xc9b8('0x4c')]['id']){delete _0x1bc461[_0xc9b8('0x4c')]['id'];}return db['SugarcrmField'][_0xc9b8('0x4b')]({'where':{'id':_0x1bc461[_0xc9b8('0x4d')]['id']}})[_0xc9b8('0x27')](handleEntityNotFound(_0x3cae75,null))[_0xc9b8('0x27')](saveUpdates(_0x1bc461[_0xc9b8('0x4c')],null))[_0xc9b8('0x27')](respondWithResult(_0x3cae75,null))[_0xc9b8('0x49')](handleError(_0x3cae75,null));};exports['destroy']=function(_0x20fdaa,_0x2debf7){return db['SugarcrmField'][_0xc9b8('0x4b')]({'where':{'id':_0x20fdaa[_0xc9b8('0x4d')]['id']}})[_0xc9b8('0x27')](handleEntityNotFound(_0x2debf7,null))['then'](removeEntity(_0x2debf7,null))[_0xc9b8('0x49')](handleError(_0x2debf7,null));}; \ No newline at end of file +var _0x7e07=['error','stack','name','send','SugarcrmField','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','type','VIRTUAL','count','includeAll','include','rows','catch','show','params','keys','options','create','body','find','destroy','eml-format','rimraf','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/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then'];(function(_0x10a1ac,_0x25f5b0){var _0x45b99e=function(_0x2fe46a){while(--_0x2fe46a){_0x10a1ac['push'](_0x10a1ac['shift']());}};_0x45b99e(++_0x25f5b0);}(_0x7e07,0x10c));var _0x77e0=function(_0x4b9ce5,_0x59edd6){_0x4b9ce5=_0x4b9ce5-0x0;var _0x293252=_0x7e07[_0x4b9ce5];return _0x293252;};'use strict';var emlformat=require(_0x77e0('0x0'));var rimraf=require(_0x77e0('0x1'));var zipdir=require(_0x77e0('0x2'));var jsonpatch=require(_0x77e0('0x3'));var rp=require(_0x77e0('0x4'));var moment=require(_0x77e0('0x5'));var BPromise=require(_0x77e0('0x6'));var Mustache=require(_0x77e0('0x7'));var util=require(_0x77e0('0x8'));var path=require(_0x77e0('0x9'));var sox=require(_0x77e0('0xa'));var csv=require(_0x77e0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77e0('0xc'));var _=require(_0x77e0('0xd'));var squel=require(_0x77e0('0xe'));var crypto=require('crypto');var jsforce=require(_0x77e0('0xf'));var deskjs=require(_0x77e0('0x10'));var toCsv=require(_0x77e0('0xb'));var querystring=require(_0x77e0('0x11'));var Papa=require(_0x77e0('0x12'));var Redis=require(_0x77e0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x77e0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x77e0('0x15'))(_0x77e0('0x16'));var utils=require(_0x77e0('0x17'));var config=require(_0x77e0('0x18'));var licenseUtil=require(_0x77e0('0x19'));var db=require(_0x77e0('0x1a'))['db'];function respondWithStatusCode(_0x3d65cf,_0x5ecac0){_0x5ecac0=_0x5ecac0||0xcc;return function(_0x1b5e8f){if(_0x1b5e8f){return _0x3d65cf[_0x77e0('0x1b')](_0x5ecac0);}return _0x3d65cf[_0x77e0('0x1c')](_0x5ecac0)[_0x77e0('0x1d')]();};}function respondWithResult(_0x390c83,_0x36c72f){_0x36c72f=_0x36c72f||0xc8;return function(_0x18f9bd){if(_0x18f9bd){return _0x390c83[_0x77e0('0x1c')](_0x36c72f)[_0x77e0('0x1e')](_0x18f9bd);}};}function respondWithFilteredResult(_0x1aa776,_0x9ab449){return function(_0x3d2f19){if(_0x3d2f19){var _0x159a16=typeof _0x9ab449[_0x77e0('0x1f')]===_0x77e0('0x20')&&typeof _0x9ab449['limit']===_0x77e0('0x20');var _0x3b5019=_0x3d2f19['count'];var _0x520bde=_0x159a16?0x0:_0x9ab449[_0x77e0('0x1f')];var _0x1ebe1e=_0x159a16?_0x3d2f19['count']:_0x9ab449[_0x77e0('0x1f')]+_0x9ab449[_0x77e0('0x21')];var _0x4df412;if(_0x1ebe1e>=_0x3b5019){_0x1ebe1e=_0x3b5019;_0x4df412=0xc8;}else{_0x4df412=0xce;}_0x1aa776[_0x77e0('0x1c')](_0x4df412);return _0x1aa776[_0x77e0('0x22')]('Content-Range',_0x520bde+'-'+_0x1ebe1e+'/'+_0x3b5019)[_0x77e0('0x1e')](_0x3d2f19);}return null;};}function patchUpdates(_0x4eb7a2){return function(_0x23b696){try{jsonpatch[_0x77e0('0x23')](_0x23b696,_0x4eb7a2,!![]);}catch(_0x4ed29f){return BPromise[_0x77e0('0x24')](_0x4ed29f);}return _0x23b696[_0x77e0('0x25')]();};}function saveUpdates(_0x5d2e60,_0x132e59){return function(_0x426978){if(_0x426978){return _0x426978[_0x77e0('0x26')](_0x5d2e60)[_0x77e0('0x27')](function(_0x949366){return _0x949366;});}return null;};}function removeEntity(_0xa259ac,_0x4f3529){return function(_0x4da1b7){if(_0x4da1b7){return _0x4da1b7['destroy']()[_0x77e0('0x27')](function(){_0xa259ac[_0x77e0('0x1c')](0xcc)[_0x77e0('0x1d')]();});}};}function handleEntityNotFound(_0x3553c2,_0x4489e0){return function(_0x187d62){if(!_0x187d62){_0x3553c2[_0x77e0('0x1b')](0x194);}return _0x187d62;};}function handleError(_0x243f91,_0x5433b5){_0x5433b5=_0x5433b5||0x1f4;return function(_0xd1e2c8){logger[_0x77e0('0x28')](_0xd1e2c8[_0x77e0('0x29')]);if(_0xd1e2c8[_0x77e0('0x2a')]){delete _0xd1e2c8['name'];}_0x243f91[_0x77e0('0x1c')](_0x5433b5)[_0x77e0('0x2b')](_0xd1e2c8);};}exports['index']=function(_0x52a23f,_0x13eb0f){var _0x1c7dbf={},_0x38d0cb={},_0x1b8f0d={'count':0x0,'rows':[]};var _0x502df4=_['map'](db[_0x77e0('0x2c')][_0x77e0('0x2d')],function(_0x3b19a3){return{'name':_0x3b19a3[_0x77e0('0x2e')],'type':_0x3b19a3['type'][_0x77e0('0x2f')]};});_0x38d0cb[_0x77e0('0x30')]=_['map'](_0x502df4,_0x77e0('0x2a'));_0x38d0cb['query']=_['keys'](_0x52a23f[_0x77e0('0x31')]);_0x38d0cb['filters']=_['intersection'](_0x38d0cb[_0x77e0('0x30')],_0x38d0cb[_0x77e0('0x31')]);_0x1c7dbf[_0x77e0('0x32')]=_[_0x77e0('0x33')](_0x38d0cb['model'],qs[_0x77e0('0x34')](_0x52a23f[_0x77e0('0x31')][_0x77e0('0x34')]));_0x1c7dbf['attributes']=_0x1c7dbf[_0x77e0('0x32')][_0x77e0('0x35')]?_0x1c7dbf[_0x77e0('0x32')]:_0x38d0cb[_0x77e0('0x30')];if(!_0x52a23f['query'][_0x77e0('0x36')](_0x77e0('0x37'))){_0x1c7dbf[_0x77e0('0x21')]=qs[_0x77e0('0x21')](_0x52a23f[_0x77e0('0x31')][_0x77e0('0x21')]);_0x1c7dbf[_0x77e0('0x1f')]=qs[_0x77e0('0x1f')](_0x52a23f[_0x77e0('0x31')][_0x77e0('0x1f')]);}_0x1c7dbf[_0x77e0('0x38')]=qs['sort'](_0x52a23f[_0x77e0('0x31')]['sort']);_0x1c7dbf[_0x77e0('0x39')]=qs['filters'](_[_0x77e0('0x3a')](_0x52a23f['query'],_0x38d0cb[_0x77e0('0x3b')]),_0x502df4);if(_0x52a23f[_0x77e0('0x31')][_0x77e0('0x3c')]){_0x1c7dbf['where']=_[_0x77e0('0x3d')](_0x1c7dbf[_0x77e0('0x39')],{'$or':_['map'](_0x502df4,function(_0x290c77){if(_0x290c77[_0x77e0('0x3e')]!==_0x77e0('0x3f')){var _0x476173={};_0x476173[_0x290c77['name']]={'$like':'%'+_0x52a23f['query'][_0x77e0('0x3c')]+'%'};return _0x476173;}})});}_0x1c7dbf=_['merge']({},_0x1c7dbf,_0x52a23f['options']);var _0x14a50e={'where':_0x1c7dbf[_0x77e0('0x39')]};return db[_0x77e0('0x2c')][_0x77e0('0x40')](_0x14a50e)['then'](function(_0x4ca4ad){_0x1b8f0d['count']=_0x4ca4ad;if(_0x52a23f[_0x77e0('0x31')][_0x77e0('0x41')]){_0x1c7dbf[_0x77e0('0x42')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x1c7dbf);})[_0x77e0('0x27')](function(_0x9aaa10){_0x1b8f0d[_0x77e0('0x43')]=_0x9aaa10;return _0x1b8f0d;})[_0x77e0('0x27')](respondWithFilteredResult(_0x13eb0f,_0x1c7dbf))[_0x77e0('0x44')](handleError(_0x13eb0f,null));};exports[_0x77e0('0x45')]=function(_0x1c09b3,_0xf5a19a){var _0x4d940f={'raw':!![],'where':{'id':_0x1c09b3[_0x77e0('0x46')]['id']}},_0x40c627={};_0x40c627['model']=_[_0x77e0('0x47')](db[_0x77e0('0x2c')][_0x77e0('0x2d')]);_0x40c627[_0x77e0('0x31')]=_[_0x77e0('0x47')](_0x1c09b3['query']);_0x40c627[_0x77e0('0x3b')]=_[_0x77e0('0x33')](_0x40c627[_0x77e0('0x30')],_0x40c627[_0x77e0('0x31')]);_0x4d940f[_0x77e0('0x32')]=_[_0x77e0('0x33')](_0x40c627['model'],qs[_0x77e0('0x34')](_0x1c09b3[_0x77e0('0x31')][_0x77e0('0x34')]));_0x4d940f['attributes']=_0x4d940f[_0x77e0('0x32')][_0x77e0('0x35')]?_0x4d940f[_0x77e0('0x32')]:_0x40c627[_0x77e0('0x30')];if(_0x1c09b3[_0x77e0('0x31')][_0x77e0('0x41')]){_0x4d940f[_0x77e0('0x42')]=[{'all':!![]}];}_0x4d940f=_['merge']({},_0x4d940f,_0x1c09b3[_0x77e0('0x48')]);return db[_0x77e0('0x2c')]['find'](_0x4d940f)[_0x77e0('0x27')](handleEntityNotFound(_0xf5a19a,null))['then'](respondWithResult(_0xf5a19a,null))['catch'](handleError(_0xf5a19a,null));};exports[_0x77e0('0x49')]=function(_0xbc0172,_0x2e7994){return db[_0x77e0('0x2c')][_0x77e0('0x49')](_0xbc0172['body'],{})[_0x77e0('0x27')](respondWithResult(_0x2e7994,0xc9))['catch'](handleError(_0x2e7994,null));};exports[_0x77e0('0x26')]=function(_0x3158d8,_0x49513f){if(_0x3158d8[_0x77e0('0x4a')]['id']){delete _0x3158d8[_0x77e0('0x4a')]['id'];}return db['SugarcrmField'][_0x77e0('0x4b')]({'where':{'id':_0x3158d8[_0x77e0('0x46')]['id']}})['then'](handleEntityNotFound(_0x49513f,null))['then'](saveUpdates(_0x3158d8['body'],null))[_0x77e0('0x27')](respondWithResult(_0x49513f,null))['catch'](handleError(_0x49513f,null));};exports[_0x77e0('0x4c')]=function(_0x589894,_0x570317){return db[_0x77e0('0x2c')][_0x77e0('0x4b')]({'where':{'id':_0x589894[_0x77e0('0x46')]['id']}})[_0x77e0('0x27')](handleEntityNotFound(_0x570317,null))[_0x77e0('0x27')](removeEntity(_0x570317,null))[_0x77e0('0x44')](handleError(_0x570317,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 688ce52..7900649 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 _0x19c1=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','rimraf','./intSugarcrmField.attributes','exports','define'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x19c1,0x1f3));var _0x119c=function(_0x2d2460,_0x2f98ef){_0x2d2460=_0x2d2460-0x0;var _0x2c0186=_0x19c1[_0x2d2460];return _0x2c0186;};'use strict';var _=require('lodash');var util=require(_0x119c('0x0'));var logger=require(_0x119c('0x1'))('api');var moment=require(_0x119c('0x2'));var BPromise=require(_0x119c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x119c('0x4'));var config=require('../../config/environment');var attributes=require(_0x119c('0x5'));module[_0x119c('0x6')]=function(_0x516204,_0x1517ed){return _0x516204[_0x119c('0x7')](_0x119c('0x8'),attributes,{'tableName':_0x119c('0x9'),'paranoid':![],'indexes':[{'name':_0x119c('0xa'),'fields':[_0x119c('0xb'),_0x119c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e37=['sugarcrm_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','../../config/environment','exports','int_sugarcrm_fields'];(function(_0x15ee0b,_0x40da91){var _0x9d702a=function(_0x48a202){while(--_0x48a202){_0x15ee0b['push'](_0x15ee0b['shift']());}};_0x9d702a(++_0x40da91);}(_0x3e37,0x184));var _0x73e3=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3e37[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x73e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x73e3('0x1'));var moment=require(_0x73e3('0x2'));var BPromise=require(_0x73e3('0x3'));var rp=require(_0x73e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x73e3('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x73e3('0x6')]=function(_0x29e93e,_0x2b37f9){return _0x29e93e['define']('SugarcrmField',attributes,{'tableName':_0x73e3('0x7'),'paranoid':![],'indexes':[{'name':_0x73e3('0x8'),'fields':[_0x73e3('0x9'),_0x73e3('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 0c3d239..d8fd847 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 _0x50f4=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x50f4,0xf8));var _0x450f=function(_0x23b7dd,_0x198cf7){_0x23b7dd=_0x23b7dd-0x0;var _0xc39796=_0x50f4[_0x23b7dd];return _0xc39796;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x450f('0x0'));var rs=require(_0x450f('0x1'));var fs=require('fs');var Redis=require(_0x450f('0x2'));var db=require(_0x450f('0x3'))['db'];var utils=require(_0x450f('0x4'));var logger=require(_0x450f('0x5'))(_0x450f('0x6'));var config=require(_0x450f('0x7'));var jayson=require(_0x450f('0x8'));var client=jayson[_0x450f('0x9')][_0x450f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570642,_0x3d23dd,_0x5980e8){return new BPromise(function(_0x107b65,_0x1fcee6){return client[_0x450f('0xb')](_0x570642,_0x5980e8)[_0x450f('0xc')](function(_0x3097cf){logger[_0x450f('0xd')](_0x450f('0xe'),_0x3d23dd,'request\x20sent');logger[_0x450f('0xf')](_0x450f('0x10'),_0x3d23dd,_0x450f('0x11'),JSON[_0x450f('0x12')](_0x3097cf));if(_0x3097cf[_0x450f('0x13')]){if(_0x3097cf['error'][_0x450f('0x14')]===0x1f4){logger[_0x450f('0x13')](_0x450f('0xe'),_0x3d23dd,_0x3097cf['error'][_0x450f('0x15')]);return _0x1fcee6(_0x3097cf['error'][_0x450f('0x15')]);}logger[_0x450f('0x13')](_0x450f('0xe'),_0x3d23dd,_0x3097cf[_0x450f('0x13')][_0x450f('0x15')]);return _0x107b65(_0x3097cf[_0x450f('0x13')][_0x450f('0x15')]);}else{logger[_0x450f('0xd')](_0x450f('0xe'),_0x3d23dd,_0x450f('0x11'));_0x107b65(_0x3097cf[_0x450f('0x16')][_0x450f('0x15')]);}})[_0x450f('0x17')](function(_0x38992a){logger['error'](_0x450f('0xe'),_0x3d23dd,_0x38992a);_0x1fcee6(_0x38992a);});});} \ No newline at end of file +var _0x007b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','error','code','SugarcrmField,\x20%s,\x20%s','message','result'];(function(_0x531dee,_0x236ce0){var _0x4c023d=function(_0x51be0e){while(--_0x51be0e){_0x531dee['push'](_0x531dee['shift']());}};_0x4c023d(++_0x236ce0);}(_0x007b,0x18d));var _0xb007=function(_0x209ec2,_0x1973fd){_0x209ec2=_0x209ec2-0x0;var _0xd9b9a0=_0x007b[_0x209ec2];return _0xd9b9a0;};'use strict';var _=require(_0xb007('0x0'));var util=require(_0xb007('0x1'));var moment=require(_0xb007('0x2'));var BPromise=require(_0xb007('0x3'));var rs=require(_0xb007('0x4'));var fs=require('fs');var Redis=require(_0xb007('0x5'));var db=require(_0xb007('0x6'))['db'];var utils=require(_0xb007('0x7'));var logger=require(_0xb007('0x8'))(_0xb007('0x9'));var config=require('../../config/environment');var jayson=require(_0xb007('0xa'));var client=jayson['client'][_0xb007('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x249d52,_0x4d2c6b,_0x2ae248){return new BPromise(function(_0x2401cd,_0x1baf0f){return client[_0xb007('0xc')](_0x249d52,_0x2ae248)['then'](function(_0x4d033a){logger[_0xb007('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x4d2c6b,_0xb007('0xe'));logger[_0xb007('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x4d2c6b,'request\x20sent',JSON['stringify'](_0x4d033a));if(_0x4d033a['error']){if(_0x4d033a[_0xb007('0x10')][_0xb007('0x11')]===0x1f4){logger[_0xb007('0x10')](_0xb007('0x12'),_0x4d2c6b,_0x4d033a[_0xb007('0x10')][_0xb007('0x13')]);return _0x1baf0f(_0x4d033a[_0xb007('0x10')][_0xb007('0x13')]);}logger['error'](_0xb007('0x12'),_0x4d2c6b,_0x4d033a[_0xb007('0x10')][_0xb007('0x13')]);return _0x2401cd(_0x4d033a[_0xb007('0x10')]['message']);}else{logger[_0xb007('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x4d2c6b,_0xb007('0xe'));_0x2401cd(_0x4d033a[_0xb007('0x14')]['message']);}})[_0xb007('0x15')](function(_0x5580eb){logger[_0xb007('0x10')](_0xb007('0x12'),_0x4d2c6b,_0x5580eb);_0x1baf0f(_0x5580eb);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index dcfbf3d..8555cbc 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 _0xa5ca=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete'];(function(_0x4c63a5,_0x595700){var _0x3754e9=function(_0x426eb4){while(--_0x426eb4){_0x4c63a5['push'](_0x4c63a5['shift']());}};_0x3754e9(++_0x595700);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xa5ca[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var path=require(_0xaa5c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa5c('0x3')]();var fs_extra=require(_0xaa5c('0x4'));var auth=require(_0xaa5c('0x5'));var interaction=require(_0xaa5c('0x6'));var config=require(_0xaa5c('0x7'));var controller=require(_0xaa5c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaa5c('0x9')](_0xaa5c('0xa'),auth[_0xaa5c('0xb')](),controller['show']);router['get'](_0xaa5c('0xc'),auth[_0xaa5c('0xb')](),controller[_0xaa5c('0xd')]);router['get'](_0xaa5c('0xe'),auth[_0xaa5c('0xb')](),controller[_0xaa5c('0xf')]);router[_0xaa5c('0x10')]('/',auth[_0xaa5c('0xb')](),controller[_0xaa5c('0x11')]);router[_0xaa5c('0x10')](_0xaa5c('0xc'),auth[_0xaa5c('0xb')](),controller[_0xaa5c('0x12')]);router[_0xaa5c('0x13')](_0xaa5c('0xa'),auth[_0xaa5c('0xb')](),controller['update']);router[_0xaa5c('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xaa5c('0x15')]=router; \ No newline at end of file +var _0xf3dc=['delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','get','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','/:id','update'];(function(_0x30df3b,_0x90abb5){var _0xe1b865=function(_0x290722){while(--_0x290722){_0x30df3b['push'](_0x30df3b['shift']());}};_0xe1b865(++_0x90abb5);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x2e93d0,_0x5d6526){_0x2e93d0=_0x2e93d0-0x0;var _0x2a88a6=_0xf3dc[_0x2e93d0];return _0x2a88a6;};'use strict';var multer=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var path=require(_0xcf3d('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf3d('0x3'));var router=express[_0xcf3d('0x4')]();var fs_extra=require(_0xcf3d('0x5'));var auth=require(_0xcf3d('0x6'));var interaction=require(_0xcf3d('0x7'));var config=require(_0xcf3d('0x8'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xcf3d('0x9')](),controller[_0xcf3d('0xa')]);router[_0xcf3d('0xb')](_0xcf3d('0xc'),auth[_0xcf3d('0x9')](),controller[_0xcf3d('0xd')]);router[_0xcf3d('0xb')](_0xcf3d('0xe'),auth[_0xcf3d('0x9')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xcf3d('0xf')]);router['post'](_0xcf3d('0xc'),auth[_0xcf3d('0x9')](),controller[_0xcf3d('0x10')]);router[_0xcf3d('0x11')](_0xcf3d('0x12'),auth[_0xcf3d('0x9')](),controller[_0xcf3d('0x13')]);router[_0xcf3d('0x14')](_0xcf3d('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xcf3d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index d3b3151..2718748 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 _0x4e48=['sequelize','STRING'];(function(_0x28f183,_0x64a30a){var _0x1ade64=function(_0x56cb29){while(--_0x56cb29){_0x28f183['push'](_0x28f183['shift']());}};_0x1ade64(++_0x64a30a);}(_0x4e48,0x120));var _0x84e4=function(_0xe6b3da,_0x4dd32e){_0xe6b3da=_0xe6b3da-0x0;var _0x21a666=_0x4e48[_0xe6b3da];return _0x21a666;};'use strict';var Sequelize=require(_0x84e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x84e4('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x609a=['STRING','sequelize','exports'];(function(_0x34936d,_0x8f8efe){var _0xab425b=function(_0x22f709){while(--_0x22f709){_0x34936d['push'](_0x34936d['shift']());}};_0xab425b(++_0x8f8efe);}(_0x609a,0x16f));var _0xa609=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x609a[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xa609('0x0'));module[_0xa609('0x1')]={'name':{'type':Sequelize[_0xa609('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa609('0x2')]},'username':{'type':Sequelize[_0xa609('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa609('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa609('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 fba9df8..f554fea 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 _0xb682=['end','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','getConfigurations','VtigerConfiguration','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','Subjects','VtigerField','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','token','GET','describe','sessionName','reference','remove','editable','false','startsWith','cf_','picklistValues','label','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','destroy','then'];(function(_0x58cca0,_0x49b8e3){var _0x143bf4=function(_0x3c581a){while(--_0x3c581a){_0x58cca0['push'](_0x58cca0['shift']());}};_0x143bf4(++_0x49b8e3);}(_0xb682,0xce));var _0x2b68=function(_0x37e0a8,_0x184bc8){_0x37e0a8=_0x37e0a8-0x0;var _0x5ca63c=_0xb682[_0x37e0a8];return _0x5ca63c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b68('0x0'));var zipdir=require(_0x2b68('0x1'));var jsonpatch=require(_0x2b68('0x2'));var rp=require('request-promise');var moment=require(_0x2b68('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2b68('0x4'));var sox=require(_0x2b68('0x5'));var csv=require(_0x2b68('0x6'));var ejs=require(_0x2b68('0x7'));var fs=require('fs');var fs_extra=require(_0x2b68('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b68('0x9'));var jsforce=require(_0x2b68('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2b68('0x6'));var querystring=require(_0x2b68('0xb'));var Papa=require('papaparse');var Redis=require(_0x2b68('0xc'));var authService=require(_0x2b68('0xd'));var qs=require(_0x2b68('0xe'));var as=require(_0x2b68('0xf'));var hardwareService=require(_0x2b68('0x10'));var logger=require(_0x2b68('0x11'))('api');var utils=require(_0x2b68('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2b68('0x13'));var db=require(_0x2b68('0x14'))['db'];var integrations=require(_0x2b68('0x15'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d6455,_0x13397d,_0x30fae0,_0x206863){return new BPromise(function(_0x532263,_0x5a70d1){var _0x402f7f=_0x206863||client;return _0x402f7f[_0x2b68('0x16')](_0x5d6455,_0x30fae0)['then'](function(_0x22439e){logger[_0x2b68('0x17')](_0x2b68('0x18'),_0x13397d,_0x2b68('0x19'));logger[_0x2b68('0x1a')](_0x2b68('0x1b'),_0x13397d,_0x2b68('0x19'),JSON[_0x2b68('0x1c')](_0x22439e));if(_0x22439e[_0x2b68('0x1d')]){if(_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1e')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x13397d,_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1f')]);return _0x5a70d1(_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1f')]);}logger[_0x2b68('0x1d')](_0x2b68('0x18'),_0x13397d,_0x22439e['error'][_0x2b68('0x1f')]);return _0x532263(_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1f')]);}else{logger[_0x2b68('0x17')]('VtigerAccount,\x20%s,\x20%s',_0x13397d,'request\x20sent');_0x532263(_0x22439e[_0x2b68('0x20')][_0x2b68('0x1f')]);}})[_0x2b68('0x21')](function(_0x5a4fed){logger['error'](_0x2b68('0x18'),_0x13397d,_0x5a4fed);_0x5a70d1(_0x5a4fed);});});}function respondWithStatusCode(_0x403bdb,_0x268501){_0x268501=_0x268501||0xcc;return function(_0x4427bb){if(_0x4427bb){return _0x403bdb[_0x2b68('0x22')](_0x268501);}return _0x403bdb[_0x2b68('0x23')](_0x268501)['end']();};}function respondWithResult(_0xc97a4,_0x3bc0d9){_0x3bc0d9=_0x3bc0d9||0xc8;return function(_0x16c462){if(_0x16c462){return _0xc97a4[_0x2b68('0x23')](_0x3bc0d9)['json'](_0x16c462);}};}function respondWithFilteredResult(_0x5aab41,_0x51bbac){return function(_0x3eb03a){if(_0x3eb03a){var _0x8a20a6=typeof _0x51bbac[_0x2b68('0x24')]==='undefined'&&typeof _0x51bbac[_0x2b68('0x25')]==='undefined';var _0x38aace=_0x3eb03a['count'];var _0x137493=_0x8a20a6?0x0:_0x51bbac[_0x2b68('0x24')];var _0x28b12d=_0x8a20a6?_0x3eb03a[_0x2b68('0x26')]:_0x51bbac[_0x2b68('0x24')]+_0x51bbac[_0x2b68('0x25')];var _0x416d2a;if(_0x28b12d>=_0x38aace){_0x28b12d=_0x38aace;_0x416d2a=0xc8;}else{_0x416d2a=0xce;}_0x5aab41[_0x2b68('0x23')](_0x416d2a);return _0x5aab41[_0x2b68('0x27')](_0x2b68('0x28'),_0x137493+'-'+_0x28b12d+'/'+_0x38aace)[_0x2b68('0x29')](_0x3eb03a);}return null;};}function patchUpdates(_0x43661f){return function(_0x371927){try{jsonpatch[_0x2b68('0x2a')](_0x371927,_0x43661f,!![]);}catch(_0xa005f0){return BPromise['reject'](_0xa005f0);}return _0x371927[_0x2b68('0x2b')]();};}function saveUpdates(_0x6b2f14,_0x464dc5){return function(_0x20f776){if(_0x20f776){return _0x20f776['update'](_0x6b2f14)['then'](function(_0x2272c4){return _0x2272c4;});}return null;};}function removeEntity(_0x25a304,_0xc7032a){return function(_0x5b9b9f){if(_0x5b9b9f){return _0x5b9b9f[_0x2b68('0x2c')]()[_0x2b68('0x2d')](function(){_0x25a304[_0x2b68('0x23')](0xcc)[_0x2b68('0x2e')]();});}};}function handleEntityNotFound(_0x4538e9,_0x32d295){return function(_0x19743f){if(!_0x19743f){_0x4538e9['sendStatus'](0x194);}return _0x19743f;};}function handleError(_0x1a8c53,_0x1dbc12){_0x1dbc12=_0x1dbc12||0x1f4;return function(_0x47ab09){logger['error'](_0x47ab09[_0x2b68('0x2f')]);if(_0x47ab09[_0x2b68('0x30')]){delete _0x47ab09[_0x2b68('0x30')];}_0x1a8c53[_0x2b68('0x23')](_0x1dbc12)[_0x2b68('0x31')](_0x47ab09);};}exports[_0x2b68('0x32')]=function(_0x9aa3d3,_0x455175){var _0x51212d={},_0x123225={},_0x3bc2a3={'count':0x0,'rows':[]};var _0x4762d2=_[_0x2b68('0x33')](db[_0x2b68('0x34')][_0x2b68('0x35')],function(_0x21fed6){return{'name':_0x21fed6[_0x2b68('0x36')],'type':_0x21fed6[_0x2b68('0x37')][_0x2b68('0x38')]};});_0x123225[_0x2b68('0x39')]=_[_0x2b68('0x33')](_0x4762d2,_0x2b68('0x30'));_0x123225[_0x2b68('0x3a')]=_['keys'](_0x9aa3d3['query']);_0x123225[_0x2b68('0x3b')]=_[_0x2b68('0x3c')](_0x123225[_0x2b68('0x39')],_0x123225[_0x2b68('0x3a')]);_0x51212d['attributes']=_[_0x2b68('0x3c')](_0x123225[_0x2b68('0x39')],qs[_0x2b68('0x3d')](_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x3d')]));_0x51212d[_0x2b68('0x3e')]=_0x51212d[_0x2b68('0x3e')][_0x2b68('0x3f')]?_0x51212d[_0x2b68('0x3e')]:_0x123225[_0x2b68('0x39')];if(!_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x40')](_0x2b68('0x41'))){_0x51212d[_0x2b68('0x25')]=qs[_0x2b68('0x25')](_0x9aa3d3['query'][_0x2b68('0x25')]);_0x51212d[_0x2b68('0x24')]=qs[_0x2b68('0x24')](_0x9aa3d3['query']['offset']);}_0x51212d[_0x2b68('0x42')]=qs[_0x2b68('0x43')](_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x43')]);_0x51212d[_0x2b68('0x44')]=qs[_0x2b68('0x3b')](_[_0x2b68('0x45')](_0x9aa3d3[_0x2b68('0x3a')],_0x123225['filters']),_0x4762d2);if(_0x9aa3d3[_0x2b68('0x3a')]['filter']){_0x51212d[_0x2b68('0x44')]=_[_0x2b68('0x46')](_0x51212d[_0x2b68('0x44')],{'$or':_[_0x2b68('0x33')](_0x4762d2,function(_0x4ea8e7){if(_0x4ea8e7[_0x2b68('0x37')]!=='VIRTUAL'){var _0x19a469={};_0x19a469[_0x4ea8e7[_0x2b68('0x30')]]={'$like':'%'+_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x47')]+'%'};return _0x19a469;}})});}_0x51212d=_[_0x2b68('0x46')]({},_0x51212d,_0x9aa3d3[_0x2b68('0x48')]);var _0x533e41={'where':_0x51212d[_0x2b68('0x44')]};return db[_0x2b68('0x34')][_0x2b68('0x26')](_0x533e41)[_0x2b68('0x2d')](function(_0x36783e){_0x3bc2a3[_0x2b68('0x26')]=_0x36783e;if(_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x49')]){_0x51212d['include']=[{'all':!![]}];}return db[_0x2b68('0x34')][_0x2b68('0x4a')](_0x51212d);})[_0x2b68('0x2d')](function(_0x2e0814){_0x3bc2a3[_0x2b68('0x4b')]=_0x2e0814;return _0x3bc2a3;})[_0x2b68('0x2d')](respondWithFilteredResult(_0x455175,_0x51212d))[_0x2b68('0x21')](handleError(_0x455175,null));};exports[_0x2b68('0x4c')]=function(_0x1a5f59,_0x2469ae){var _0x49dd37={'raw':![],'where':{'id':_0x1a5f59[_0x2b68('0x4d')]['id']}},_0x560342={};_0x560342[_0x2b68('0x39')]=_[_0x2b68('0x4e')](db[_0x2b68('0x34')][_0x2b68('0x35')]);_0x560342['query']=_['keys'](_0x1a5f59['query']);_0x560342[_0x2b68('0x3b')]=_[_0x2b68('0x3c')](_0x560342[_0x2b68('0x39')],_0x560342[_0x2b68('0x3a')]);_0x49dd37['attributes']=_[_0x2b68('0x3c')](_0x560342['model'],qs['fields'](_0x1a5f59[_0x2b68('0x3a')]['fields']));_0x49dd37[_0x2b68('0x3e')]=_0x49dd37[_0x2b68('0x3e')]['length']?_0x49dd37[_0x2b68('0x3e')]:_0x560342[_0x2b68('0x39')];if(_0x1a5f59[_0x2b68('0x3a')][_0x2b68('0x49')]){_0x49dd37[_0x2b68('0x4f')]=[{'all':!![]}];}_0x49dd37=_[_0x2b68('0x46')]({},_0x49dd37,_0x1a5f59['options']);return db[_0x2b68('0x34')][_0x2b68('0x50')](_0x49dd37)['then'](handleEntityNotFound(_0x2469ae,null))[_0x2b68('0x2d')](respondWithResult(_0x2469ae,null))['catch'](handleError(_0x2469ae,null));};exports[_0x2b68('0x51')]=function(_0xb0aea4,_0x45ce28){return db[_0x2b68('0x34')][_0x2b68('0x51')](_0xb0aea4[_0x2b68('0x52')],{})[_0x2b68('0x2d')](respondWithResult(_0x45ce28,0xc9))[_0x2b68('0x21')](handleError(_0x45ce28,null));};exports['update']=function(_0x19a844,_0x45a7c4){if(_0x19a844[_0x2b68('0x52')]['id']){delete _0x19a844[_0x2b68('0x52')]['id'];}return db[_0x2b68('0x34')]['find']({'where':{'id':_0x19a844['params']['id']}})[_0x2b68('0x2d')](handleEntityNotFound(_0x45a7c4,null))[_0x2b68('0x2d')](saveUpdates(_0x19a844[_0x2b68('0x52')],null))[_0x2b68('0x2d')](respondWithResult(_0x45a7c4,null))[_0x2b68('0x21')](handleError(_0x45a7c4,null));};exports[_0x2b68('0x2c')]=function(_0x2f1f51,_0x1aa879){return db['VtigerAccount'][_0x2b68('0x50')]({'where':{'id':_0x2f1f51[_0x2b68('0x4d')]['id']}})[_0x2b68('0x2d')](handleEntityNotFound(_0x1aa879,null))[_0x2b68('0x2d')](removeEntity(_0x1aa879,null))[_0x2b68('0x21')](handleError(_0x1aa879,null));};exports[_0x2b68('0x53')]=function(_0x5c15a2,_0x4c873c,_0x48991e){var _0xcce213={};var _0x47a65={};var _0x568b31;var _0x4fbac5;return db['VtigerAccount']['findOne']({'where':{'id':_0x5c15a2[_0x2b68('0x4d')]['id']}})[_0x2b68('0x2d')](handleEntityNotFound(_0x4c873c,null))['then'](function(_0x10e7c1){if(_0x10e7c1){_0x568b31=_0x10e7c1;_0x47a65[_0x2b68('0x39')]=_[_0x2b68('0x4e')](db[_0x2b68('0x54')][_0x2b68('0x35')]);_0x47a65['query']=_[_0x2b68('0x4e')](_0x5c15a2[_0x2b68('0x3a')]);_0x47a65['filters']=_['intersection'](_0x47a65['model'],_0x47a65[_0x2b68('0x3a')]);_0xcce213[_0x2b68('0x3e')]=_['intersection'](_0x47a65[_0x2b68('0x39')],qs[_0x2b68('0x3d')](_0x5c15a2['query'][_0x2b68('0x3d')]));_0xcce213[_0x2b68('0x3e')]=_0xcce213[_0x2b68('0x3e')]['length']?_0xcce213['attributes']:_0x47a65[_0x2b68('0x39')];_0xcce213[_0x2b68('0x42')]=qs[_0x2b68('0x43')](_0x5c15a2[_0x2b68('0x3a')]['sort']);_0xcce213[_0x2b68('0x44')]=qs[_0x2b68('0x3b')](_[_0x2b68('0x45')](_0x5c15a2[_0x2b68('0x3a')],_0x47a65[_0x2b68('0x3b')]));if(_0x5c15a2[_0x2b68('0x3a')][_0x2b68('0x47')]){_0xcce213[_0x2b68('0x44')]=_[_0x2b68('0x46')](_0xcce213[_0x2b68('0x44')],{'$or':_['map'](_0xcce213['attributes'],function(_0x3b439e){var _0xff00e={};_0xff00e[_0x3b439e]={'$like':'%'+_0x5c15a2[_0x2b68('0x3a')][_0x2b68('0x47')]+'%'};return _0xff00e;})});}_0xcce213=_[_0x2b68('0x46')]({},_0xcce213,_0x5c15a2[_0x2b68('0x48')]);return _0x568b31[_0x2b68('0x53')](_0xcce213);}})[_0x2b68('0x2d')](function(_0x26b550){if(_0x26b550){_0x4fbac5=_0x26b550[_0x2b68('0x3f')];if(!_0x5c15a2[_0x2b68('0x3a')][_0x2b68('0x40')](_0x2b68('0x41'))){_0xcce213['limit']=qs['limit'](_0x5c15a2[_0x2b68('0x3a')]['limit']);_0xcce213['offset']=qs['offset'](_0x5c15a2['query']['offset']);}return _0x568b31[_0x2b68('0x53')](_0xcce213);}})['then'](function(_0x514b9a){if(_0x514b9a){return _0x514b9a?{'count':_0x4fbac5,'rows':_0x514b9a}:null;}})['then'](respondWithResult(_0x4c873c,null))[_0x2b68('0x21')](handleError(_0x4c873c,null));};exports[_0x2b68('0x55')]=function(_0x2660a7,_0x1d3dff,_0x19a803){if(_0x2660a7[_0x2b68('0x52')]['id']){delete _0x2660a7[_0x2b68('0x52')]['id'];}return db[_0x2b68('0x34')][_0x2b68('0x56')]({'where':{'id':_0x2660a7['params']['id']}})['then'](handleEntityNotFound(_0x1d3dff,null))[_0x2b68('0x2d')](function(_0x5d1f9c){if(_0x5d1f9c){_0x2660a7[_0x2b68('0x52')][_0x2b68('0x57')]=_0x5d1f9c['id'];_0x2660a7[_0x2b68('0x52')]['Subjects']=integrations[_0x2b68('0x58')](_0x2660a7[_0x2b68('0x52')][_0x2b68('0x59')],_0x2660a7[_0x2b68('0x52')][_0x2b68('0x37')]);_0x2660a7[_0x2b68('0x52')][_0x2b68('0x5a')]=integrations['getDescriptions'](_0x2660a7[_0x2b68('0x52')]['channel'],_0x2660a7[_0x2b68('0x52')][_0x2b68('0x37')]);return db[_0x2b68('0x54')][_0x2b68('0x51')](_0x2660a7['body'],{'include':[{'model':db['VtigerField'],'as':_0x2b68('0x5b')},{'model':db[_0x2b68('0x5c')],'as':_0x2b68('0x5a')}]});}return null;})[_0x2b68('0x2d')](respondWithResult(_0x1d3dff,null))[_0x2b68('0x21')](handleError(_0x1d3dff,null));};var md5=require(_0x2b68('0x5d'));exports[_0x2b68('0x5e')]=function(_0x2b646e,_0x1e548e,_0x51a4a2){var _0x56e1c8=null;var _0x573e9a=null;var _0x15e8b3=null;var _0x5ac78d=null;var _0x3362cc='';return db[_0x2b68('0x34')][_0x2b68('0x56')]({'where':{'id':_0x2b646e[_0x2b68('0x4d')]['id']},'attributes':['id','name',_0x2b68('0x5f'),_0x2b68('0x60'),'moduleName',_0x2b68('0x61'),_0x2b68('0x62'),_0x2b68('0x63')]})[_0x2b68('0x2d')](handleEntityNotFound(_0x1e548e,null))[_0x2b68('0x2d')](function(_0x4f5e98){if(_0x4f5e98){_0x56e1c8=_0x4f5e98['username'];_0x573e9a=_0x4f5e98[_0x2b68('0x63')];_0x15e8b3=_0x4f5e98[_0x2b68('0x64')];_0x3362cc=_0x4f5e98[_0x2b68('0x61')];var _0x5b0bc7=_0x3362cc[_0x2b68('0x65')](-0x1);if(_0x5b0bc7==='/'){_0x3362cc=_0x3362cc[_0x2b68('0x66')](0x0,_0x3362cc[_0x2b68('0x67')](_0x5b0bc7));}_0x5ac78d=util['format'](_0x2b68('0x68'),_0x3362cc);var _0x3756a6={'method':'GET','uri':_0x5ac78d,'qs':{'operation':_0x2b68('0x69'),'username':_0x4f5e98[_0x2b68('0x5f')]},'json':!![]};return rp(_0x3756a6);}})[_0x2b68('0x2d')](function(_0x34fee7){if(_0x34fee7[_0x2b68('0x6a')]){var _0x3d287b={'method':_0x2b68('0x6b'),'uri':_0x5ac78d,'form':{'operation':_0x2b68('0x6c'),'username':_0x56e1c8,'accessKey':md5(_0x34fee7[_0x2b68('0x20')][_0x2b68('0x6d')]+_0x573e9a)},'json':!![]};return rp(_0x3d287b);}})[_0x2b68('0x2d')](function(_0x20b17b){if(_0x20b17b[_0x2b68('0x6a')]){var _0x2b5720={'method':_0x2b68('0x6e'),'uri':_0x5ac78d,'qs':{'operation':_0x2b68('0x6f'),'username':_0x56e1c8,'sessionName':_0x20b17b['result'][_0x2b68('0x70')],'elementType':_0x15e8b3},'json':!![]};return rp(_0x2b5720);}})[_0x2b68('0x2d')](function(_0x1f605b){if(_0x1f605b[_0x2b68('0x6a')]){var _0x110b6d=['autogenerated',_0x2b68('0x71'),'owner'];_[_0x2b68('0x72')](_0x1f605b['result'][_0x2b68('0x3d')],function(_0x1e4dfe){return _0x110b6d['includes'](_0x1e4dfe[_0x2b68('0x37')][_0x2b68('0x30')]);});_[_0x2b68('0x72')](_0x1f605b[_0x2b68('0x20')]['fields'],function(_0x7448bd){return _0x7448bd[_0x2b68('0x73')]===_0x2b68('0x74');});return{'count':_0x1f605b[_0x2b68('0x20')][_0x2b68('0x3d')][_0x2b68('0x3f')],'rows':_[_0x2b68('0x33')](_0x1f605b[_0x2b68('0x20')][_0x2b68('0x3d')],function(_0x29a9ee){return{'id':_0x29a9ee[_0x2b68('0x30')],'name':_0x29a9ee['label'],'custom':_[_0x2b68('0x75')](_0x29a9ee['name'],_0x2b68('0x76'))?!![]:![],'options':_0x29a9ee[_0x2b68('0x37')][_0x2b68('0x30')]==='picklist'&&_0x29a9ee['type']['picklistValues'][_0x2b68('0x3f')]>0x0?_[_0x2b68('0x33')](_0x29a9ee[_0x2b68('0x37')][_0x2b68('0x77')],function(_0x5dee8a){return{'name':_0x5dee8a[_0x2b68('0x78')],'value':_0x5dee8a['value']};}):[]};})};}})['then'](respondWithResult(_0x1e548e,null))[_0x2b68('0x21')](function(_0x4a0825){console[_0x2b68('0x79')]('vTiger\x20error:\x20'+_0x4a0825);var _0x2986d6=_0x2b646e[_0x2b68('0x3a')][_0x2b68('0x7a')]?0x1f4:_0x4a0825[_0x2b68('0x7b')]||0x1f4;logger[_0x2b68('0x1d')](_0x2b68('0x7c'),_0x2b68('0x5e'),_0x2986d6,JSON[_0x2b68('0x1c')](_0x4a0825));delete _0x4a0825[_0x2b68('0x30')];if(_0x2986d6===0x191){_0x2986d6=0x190;}_0x1e548e['status'](_0x2986d6)[_0x2b68('0x31')](_0x2b646e['query'][_0x2b68('0x7a')]?{'message':_0x2b68('0x7d'),'statusCode':_0x4a0825[_0x2b68('0x7b')]}:_0x4a0825);});}; \ No newline at end of file +var _0x9671=['save','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerConfiguration','Descriptions','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','format','%s/webservice.php','GET','getchallenge','POST','login','success','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject'];(function(_0x57fd96,_0x4f1efc){var _0x378eea=function(_0x5b0a75){while(--_0x5b0a75){_0x57fd96['push'](_0x57fd96['shift']());}};_0x378eea(++_0x4f1efc);}(_0x9671,0xdf));var _0x1967=function(_0x1c6017,_0x268ca3){_0x1c6017=_0x1c6017-0x0;var _0x4308c3=_0x9671[_0x1c6017];return _0x4308c3;};'use strict';var emlformat=require(_0x1967('0x0'));var rimraf=require(_0x1967('0x1'));var zipdir=require(_0x1967('0x2'));var jsonpatch=require(_0x1967('0x3'));var rp=require('request-promise');var moment=require(_0x1967('0x4'));var BPromise=require(_0x1967('0x5'));var Mustache=require(_0x1967('0x6'));var util=require(_0x1967('0x7'));var path=require(_0x1967('0x8'));var sox=require(_0x1967('0x9'));var csv=require(_0x1967('0xa'));var ejs=require(_0x1967('0xb'));var fs=require('fs');var fs_extra=require(_0x1967('0xc'));var _=require(_0x1967('0xd'));var squel=require(_0x1967('0xe'));var crypto=require(_0x1967('0xf'));var jsforce=require(_0x1967('0x10'));var deskjs=require(_0x1967('0x11'));var toCsv=require(_0x1967('0xa'));var querystring=require(_0x1967('0x12'));var Papa=require(_0x1967('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1967('0x14'));var as=require(_0x1967('0x15'));var hardwareService=require(_0x1967('0x16'));var logger=require('../../config/logger')(_0x1967('0x17'));var utils=require(_0x1967('0x18'));var config=require(_0x1967('0x19'));var licenseUtil=require(_0x1967('0x1a'));var db=require(_0x1967('0x1b'))['db'];var integrations=require(_0x1967('0x1c'));var jayson=require(_0x1967('0x1d'));var client=jayson[_0x1967('0x1e')][_0x1967('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x40f91d,_0x44deba,_0x4fec24,_0x584acb){return new BPromise(function(_0x498b35,_0x430d6f){var _0x35ab6b=_0x584acb||client;return _0x35ab6b[_0x1967('0x20')](_0x40f91d,_0x4fec24)[_0x1967('0x21')](function(_0xe545a2){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x44deba,'request\x20sent');logger[_0x1967('0x22')](_0x1967('0x23'),_0x44deba,'request\x20sent',JSON[_0x1967('0x24')](_0xe545a2));if(_0xe545a2[_0x1967('0x25')]){if(_0xe545a2['error'][_0x1967('0x26')]===0x1f4){logger[_0x1967('0x25')](_0x1967('0x27'),_0x44deba,_0xe545a2[_0x1967('0x25')]['message']);return _0x430d6f(_0xe545a2[_0x1967('0x25')]['message']);}logger[_0x1967('0x25')](_0x1967('0x27'),_0x44deba,_0xe545a2[_0x1967('0x25')][_0x1967('0x28')]);return _0x498b35(_0xe545a2[_0x1967('0x25')]['message']);}else{logger[_0x1967('0x29')](_0x1967('0x27'),_0x44deba,_0x1967('0x2a'));_0x498b35(_0xe545a2[_0x1967('0x2b')]['message']);}})[_0x1967('0x2c')](function(_0x14d5dc){logger[_0x1967('0x25')](_0x1967('0x27'),_0x44deba,_0x14d5dc);_0x430d6f(_0x14d5dc);});});}function respondWithStatusCode(_0x5df9bc,_0x20e01d){_0x20e01d=_0x20e01d||0xcc;return function(_0x599417){if(_0x599417){return _0x5df9bc[_0x1967('0x2d')](_0x20e01d);}return _0x5df9bc[_0x1967('0x2e')](_0x20e01d)[_0x1967('0x2f')]();};}function respondWithResult(_0x4b7dfa,_0x1864d6){_0x1864d6=_0x1864d6||0xc8;return function(_0x31ce7f){if(_0x31ce7f){return _0x4b7dfa[_0x1967('0x2e')](_0x1864d6)[_0x1967('0x30')](_0x31ce7f);}};}function respondWithFilteredResult(_0x225656,_0x2714d2){return function(_0x2ccc41){if(_0x2ccc41){var _0x4f33bb=typeof _0x2714d2[_0x1967('0x31')]===_0x1967('0x32')&&typeof _0x2714d2['limit']===_0x1967('0x32');var _0x14a15d=_0x2ccc41[_0x1967('0x33')];var _0x48e0ac=_0x4f33bb?0x0:_0x2714d2[_0x1967('0x31')];var _0x28fad8=_0x4f33bb?_0x2ccc41['count']:_0x2714d2['offset']+_0x2714d2[_0x1967('0x34')];var _0x45bab4;if(_0x28fad8>=_0x14a15d){_0x28fad8=_0x14a15d;_0x45bab4=0xc8;}else{_0x45bab4=0xce;}_0x225656[_0x1967('0x2e')](_0x45bab4);return _0x225656['set']('Content-Range',_0x48e0ac+'-'+_0x28fad8+'/'+_0x14a15d)['json'](_0x2ccc41);}return null;};}function patchUpdates(_0x5d17f9){return function(_0x280525){try{jsonpatch[_0x1967('0x35')](_0x280525,_0x5d17f9,!![]);}catch(_0x588915){return BPromise[_0x1967('0x36')](_0x588915);}return _0x280525[_0x1967('0x37')]();};}function saveUpdates(_0x5ccb54,_0x4fa9c0){return function(_0x3f0f8b){if(_0x3f0f8b){return _0x3f0f8b['update'](_0x5ccb54)['then'](function(_0x3e06f5){return _0x3e06f5;});}return null;};}function removeEntity(_0x236c6f,_0x150def){return function(_0x6abc2){if(_0x6abc2){return _0x6abc2['destroy']()[_0x1967('0x21')](function(){_0x236c6f['status'](0xcc)[_0x1967('0x2f')]();});}};}function handleEntityNotFound(_0x57ee1a,_0x4d1e84){return function(_0x426016){if(!_0x426016){_0x57ee1a[_0x1967('0x2d')](0x194);}return _0x426016;};}function handleError(_0x3366b2,_0x30a8bc){_0x30a8bc=_0x30a8bc||0x1f4;return function(_0xb6617a){logger['error'](_0xb6617a[_0x1967('0x38')]);if(_0xb6617a[_0x1967('0x39')]){delete _0xb6617a[_0x1967('0x39')];}_0x3366b2['status'](_0x30a8bc)[_0x1967('0x3a')](_0xb6617a);};}exports[_0x1967('0x3b')]=function(_0x583866,_0x3d4621){var _0x91017a={},_0x502678={},_0xd99782={'count':0x0,'rows':[]};var _0x950e04=_['map'](db[_0x1967('0x3c')][_0x1967('0x3d')],function(_0x37ce14){return{'name':_0x37ce14[_0x1967('0x3e')],'type':_0x37ce14[_0x1967('0x3f')][_0x1967('0x40')]};});_0x502678['model']=_['map'](_0x950e04,_0x1967('0x39'));_0x502678[_0x1967('0x41')]=_[_0x1967('0x42')](_0x583866['query']);_0x502678[_0x1967('0x43')]=_[_0x1967('0x44')](_0x502678[_0x1967('0x45')],_0x502678[_0x1967('0x41')]);_0x91017a[_0x1967('0x46')]=_[_0x1967('0x44')](_0x502678[_0x1967('0x45')],qs[_0x1967('0x47')](_0x583866[_0x1967('0x41')]['fields']));_0x91017a['attributes']=_0x91017a['attributes'][_0x1967('0x48')]?_0x91017a[_0x1967('0x46')]:_0x502678[_0x1967('0x45')];if(!_0x583866[_0x1967('0x41')][_0x1967('0x49')](_0x1967('0x4a'))){_0x91017a[_0x1967('0x34')]=qs[_0x1967('0x34')](_0x583866[_0x1967('0x41')]['limit']);_0x91017a['offset']=qs[_0x1967('0x31')](_0x583866['query'][_0x1967('0x31')]);}_0x91017a['order']=qs['sort'](_0x583866[_0x1967('0x41')][_0x1967('0x4b')]);_0x91017a[_0x1967('0x4c')]=qs[_0x1967('0x43')](_[_0x1967('0x4d')](_0x583866[_0x1967('0x41')],_0x502678[_0x1967('0x43')]),_0x950e04);if(_0x583866['query']['filter']){_0x91017a['where']=_[_0x1967('0x4e')](_0x91017a[_0x1967('0x4c')],{'$or':_[_0x1967('0x4f')](_0x950e04,function(_0x19dcaf){if(_0x19dcaf[_0x1967('0x3f')]!==_0x1967('0x50')){var _0x26c71a={};_0x26c71a[_0x19dcaf[_0x1967('0x39')]]={'$like':'%'+_0x583866['query'][_0x1967('0x51')]+'%'};return _0x26c71a;}})});}_0x91017a=_[_0x1967('0x4e')]({},_0x91017a,_0x583866[_0x1967('0x52')]);var _0x39ba24={'where':_0x91017a[_0x1967('0x4c')]};return db[_0x1967('0x3c')][_0x1967('0x33')](_0x39ba24)[_0x1967('0x21')](function(_0x139f28){_0xd99782[_0x1967('0x33')]=_0x139f28;if(_0x583866['query'][_0x1967('0x53')]){_0x91017a[_0x1967('0x54')]=[{'all':!![]}];}return db[_0x1967('0x3c')][_0x1967('0x55')](_0x91017a);})[_0x1967('0x21')](function(_0x5896c5){_0xd99782[_0x1967('0x56')]=_0x5896c5;return _0xd99782;})[_0x1967('0x21')](respondWithFilteredResult(_0x3d4621,_0x91017a))[_0x1967('0x2c')](handleError(_0x3d4621,null));};exports[_0x1967('0x57')]=function(_0x4f1561,_0x5ce8ed){var _0x3d244b={'raw':![],'where':{'id':_0x4f1561[_0x1967('0x58')]['id']}},_0x4919b4={};_0x4919b4[_0x1967('0x45')]=_[_0x1967('0x42')](db['VtigerAccount']['rawAttributes']);_0x4919b4[_0x1967('0x41')]=_['keys'](_0x4f1561[_0x1967('0x41')]);_0x4919b4['filters']=_[_0x1967('0x44')](_0x4919b4[_0x1967('0x45')],_0x4919b4[_0x1967('0x41')]);_0x3d244b[_0x1967('0x46')]=_[_0x1967('0x44')](_0x4919b4[_0x1967('0x45')],qs['fields'](_0x4f1561['query'][_0x1967('0x47')]));_0x3d244b['attributes']=_0x3d244b[_0x1967('0x46')]['length']?_0x3d244b[_0x1967('0x46')]:_0x4919b4[_0x1967('0x45')];if(_0x4f1561[_0x1967('0x41')][_0x1967('0x53')]){_0x3d244b['include']=[{'all':!![]}];}_0x3d244b=_[_0x1967('0x4e')]({},_0x3d244b,_0x4f1561[_0x1967('0x52')]);return db[_0x1967('0x3c')][_0x1967('0x59')](_0x3d244b)[_0x1967('0x21')](handleEntityNotFound(_0x5ce8ed,null))['then'](respondWithResult(_0x5ce8ed,null))[_0x1967('0x2c')](handleError(_0x5ce8ed,null));};exports[_0x1967('0x5a')]=function(_0x49f9c7,_0x186f01){return db[_0x1967('0x3c')][_0x1967('0x5a')](_0x49f9c7[_0x1967('0x5b')],{})[_0x1967('0x21')](respondWithResult(_0x186f01,0xc9))[_0x1967('0x2c')](handleError(_0x186f01,null));};exports[_0x1967('0x5c')]=function(_0x4e4b4a,_0x14d0fe){if(_0x4e4b4a['body']['id']){delete _0x4e4b4a[_0x1967('0x5b')]['id'];}return db['VtigerAccount'][_0x1967('0x59')]({'where':{'id':_0x4e4b4a['params']['id']}})[_0x1967('0x21')](handleEntityNotFound(_0x14d0fe,null))['then'](saveUpdates(_0x4e4b4a[_0x1967('0x5b')],null))[_0x1967('0x21')](respondWithResult(_0x14d0fe,null))[_0x1967('0x2c')](handleError(_0x14d0fe,null));};exports[_0x1967('0x5d')]=function(_0x1b569c,_0x2a344d){return db[_0x1967('0x3c')][_0x1967('0x59')]({'where':{'id':_0x1b569c[_0x1967('0x58')]['id']}})['then'](handleEntityNotFound(_0x2a344d,null))['then'](removeEntity(_0x2a344d,null))[_0x1967('0x2c')](handleError(_0x2a344d,null));};exports[_0x1967('0x5e')]=function(_0x12bd69,_0x200db9,_0x18c58d){var _0x48b8be={};var _0x2f4e2c={};var _0x23adc4;var _0x5787b5;return db[_0x1967('0x3c')][_0x1967('0x5f')]({'where':{'id':_0x12bd69[_0x1967('0x58')]['id']}})[_0x1967('0x21')](handleEntityNotFound(_0x200db9,null))[_0x1967('0x21')](function(_0x1bd948){if(_0x1bd948){_0x23adc4=_0x1bd948;_0x2f4e2c[_0x1967('0x45')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x2f4e2c['query']=_[_0x1967('0x42')](_0x12bd69[_0x1967('0x41')]);_0x2f4e2c[_0x1967('0x43')]=_['intersection'](_0x2f4e2c[_0x1967('0x45')],_0x2f4e2c['query']);_0x48b8be[_0x1967('0x46')]=_[_0x1967('0x44')](_0x2f4e2c[_0x1967('0x45')],qs[_0x1967('0x47')](_0x12bd69['query']['fields']));_0x48b8be[_0x1967('0x46')]=_0x48b8be[_0x1967('0x46')][_0x1967('0x48')]?_0x48b8be['attributes']:_0x2f4e2c[_0x1967('0x45')];_0x48b8be['order']=qs[_0x1967('0x4b')](_0x12bd69['query'][_0x1967('0x4b')]);_0x48b8be[_0x1967('0x4c')]=qs[_0x1967('0x43')](_['pick'](_0x12bd69['query'],_0x2f4e2c[_0x1967('0x43')]));if(_0x12bd69['query']['filter']){_0x48b8be[_0x1967('0x4c')]=_[_0x1967('0x4e')](_0x48b8be[_0x1967('0x4c')],{'$or':_[_0x1967('0x4f')](_0x48b8be['attributes'],function(_0x398a03){var _0x1bf1ab={};_0x1bf1ab[_0x398a03]={'$like':'%'+_0x12bd69[_0x1967('0x41')][_0x1967('0x51')]+'%'};return _0x1bf1ab;})});}_0x48b8be=_[_0x1967('0x4e')]({},_0x48b8be,_0x12bd69[_0x1967('0x52')]);return _0x23adc4['getConfigurations'](_0x48b8be);}})[_0x1967('0x21')](function(_0x58981e){if(_0x58981e){_0x5787b5=_0x58981e['length'];if(!_0x12bd69[_0x1967('0x41')]['hasOwnProperty'](_0x1967('0x4a'))){_0x48b8be[_0x1967('0x34')]=qs[_0x1967('0x34')](_0x12bd69[_0x1967('0x41')]['limit']);_0x48b8be[_0x1967('0x31')]=qs[_0x1967('0x31')](_0x12bd69[_0x1967('0x41')]['offset']);}return _0x23adc4[_0x1967('0x5e')](_0x48b8be);}})[_0x1967('0x21')](function(_0x38e645){if(_0x38e645){return _0x38e645?{'count':_0x5787b5,'rows':_0x38e645}:null;}})[_0x1967('0x21')](respondWithResult(_0x200db9,null))[_0x1967('0x2c')](handleError(_0x200db9,null));};exports[_0x1967('0x60')]=function(_0x5e2ece,_0x428a29,_0x253083){if(_0x5e2ece['body']['id']){delete _0x5e2ece[_0x1967('0x5b')]['id'];}return db[_0x1967('0x3c')][_0x1967('0x5f')]({'where':{'id':_0x5e2ece[_0x1967('0x58')]['id']}})['then'](handleEntityNotFound(_0x428a29,null))[_0x1967('0x21')](function(_0x1eb3b7){if(_0x1eb3b7){_0x5e2ece['body'][_0x1967('0x61')]=_0x1eb3b7['id'];_0x5e2ece['body'][_0x1967('0x62')]=integrations[_0x1967('0x63')](_0x5e2ece['body'][_0x1967('0x64')],_0x5e2ece['body'][_0x1967('0x3f')]);_0x5e2ece[_0x1967('0x5b')]['Descriptions']=integrations[_0x1967('0x65')](_0x5e2ece[_0x1967('0x5b')][_0x1967('0x64')],_0x5e2ece['body'][_0x1967('0x3f')]);return db[_0x1967('0x66')][_0x1967('0x5a')](_0x5e2ece[_0x1967('0x5b')],{'include':[{'model':db['VtigerField'],'as':_0x1967('0x62')},{'model':db['VtigerField'],'as':_0x1967('0x67')}]});}return null;})[_0x1967('0x21')](respondWithResult(_0x428a29,null))[_0x1967('0x2c')](handleError(_0x428a29,null));};var md5=require(_0x1967('0x68'));exports['getFields']=function(_0x526863,_0x2a7e7d,_0x1cfd21){var _0x5c8192=null;var _0x161c2a=null;var _0x359eed=null;var _0x58207f=null;var _0xf6e6ba='';return db[_0x1967('0x3c')][_0x1967('0x5f')]({'where':{'id':_0x526863['params']['id']},'attributes':['id','name',_0x1967('0x69'),_0x1967('0x6a'),'moduleName',_0x1967('0x6b'),_0x1967('0x6c'),'accessKey']})[_0x1967('0x21')](handleEntityNotFound(_0x2a7e7d,null))[_0x1967('0x21')](function(_0x35e02d){if(_0x35e02d){_0x5c8192=_0x35e02d[_0x1967('0x69')];_0x161c2a=_0x35e02d[_0x1967('0x6d')];_0x359eed=_0x35e02d[_0x1967('0x6e')];_0xf6e6ba=_0x35e02d[_0x1967('0x6b')];var _0x5141cd=_0xf6e6ba[_0x1967('0x6f')](-0x1);if(_0x5141cd==='/'){_0xf6e6ba=_0xf6e6ba[_0x1967('0x70')](0x0,_0xf6e6ba['lastIndexOf'](_0x5141cd));}_0x58207f=util[_0x1967('0x71')](_0x1967('0x72'),_0xf6e6ba);var _0x432c26={'method':_0x1967('0x73'),'uri':_0x58207f,'qs':{'operation':_0x1967('0x74'),'username':_0x35e02d[_0x1967('0x69')]},'json':!![]};return rp(_0x432c26);}})[_0x1967('0x21')](function(_0x3edefa){if(_0x3edefa['success']){var _0x11dca3={'method':_0x1967('0x75'),'uri':_0x58207f,'form':{'operation':_0x1967('0x76'),'username':_0x5c8192,'accessKey':md5(_0x3edefa[_0x1967('0x2b')]['token']+_0x161c2a)},'json':!![]};return rp(_0x11dca3);}})[_0x1967('0x21')](function(_0x1d99f7){if(_0x1d99f7[_0x1967('0x77')]){var _0x155ca0={'method':_0x1967('0x73'),'uri':_0x58207f,'qs':{'operation':_0x1967('0x78'),'username':_0x5c8192,'sessionName':_0x1d99f7['result'][_0x1967('0x79')],'elementType':_0x359eed},'json':!![]};return rp(_0x155ca0);}})[_0x1967('0x21')](function(_0x4c8a40){if(_0x4c8a40[_0x1967('0x77')]){var _0x20c89d=[_0x1967('0x7a'),_0x1967('0x7b'),_0x1967('0x7c')];_[_0x1967('0x7d')](_0x4c8a40[_0x1967('0x2b')][_0x1967('0x47')],function(_0x161424){return _0x20c89d[_0x1967('0x7e')](_0x161424[_0x1967('0x3f')][_0x1967('0x39')]);});_[_0x1967('0x7d')](_0x4c8a40[_0x1967('0x2b')]['fields'],function(_0x34bcd3){return _0x34bcd3[_0x1967('0x7f')]===_0x1967('0x80');});return{'count':_0x4c8a40[_0x1967('0x2b')][_0x1967('0x47')][_0x1967('0x48')],'rows':_[_0x1967('0x4f')](_0x4c8a40['result'][_0x1967('0x47')],function(_0x343a54){return{'id':_0x343a54[_0x1967('0x39')],'name':_0x343a54[_0x1967('0x81')],'custom':_['startsWith'](_0x343a54['name'],'cf_')?!![]:![],'options':_0x343a54[_0x1967('0x3f')][_0x1967('0x39')]===_0x1967('0x82')&&_0x343a54[_0x1967('0x3f')][_0x1967('0x83')]['length']>0x0?_[_0x1967('0x4f')](_0x343a54[_0x1967('0x3f')][_0x1967('0x83')],function(_0x33de63){return{'name':_0x33de63[_0x1967('0x81')],'value':_0x33de63[_0x1967('0x84')]};}):[]};})};}})[_0x1967('0x21')](respondWithResult(_0x2a7e7d,null))[_0x1967('0x2c')](function(_0x3fee3e){console[_0x1967('0x85')]('vTiger\x20error:\x20'+_0x3fee3e);var _0x183ee1=_0x526863[_0x1967('0x41')][_0x1967('0x86')]?0x1f4:_0x3fee3e[_0x1967('0x87')]||0x1f4;logger[_0x1967('0x25')](_0x1967('0x88'),_0x1967('0x89'),_0x183ee1,JSON[_0x1967('0x24')](_0x3fee3e));delete _0x3fee3e[_0x1967('0x39')];if(_0x183ee1===0x191){_0x183ee1=0x190;}_0x2a7e7d['status'](_0x183ee1)['send'](_0x526863[_0x1967('0x41')][_0x1967('0x86')]?{'message':_0x1967('0x8a'),'statusCode':_0x3fee3e[_0x1967('0x87')]}:_0x3fee3e);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index c433b85..5134a74 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 _0x0a8a=['api','moment','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','int_vtiger_accounts','lodash','util'];(function(_0x312776,_0x433590){var _0x148a74=function(_0x4cd919){while(--_0x4cd919){_0x312776['push'](_0x312776['shift']());}};_0x148a74(++_0x433590);}(_0x0a8a,0x1e8));var _0xa0a8=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x0a8a[_0x188a93];return _0x23b40d;};'use strict';var _=require(_0xa0a8('0x0'));var util=require(_0xa0a8('0x1'));var logger=require('../../config/logger')(_0xa0a8('0x2'));var moment=require(_0xa0a8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa0a8('0x4'));var fs=require('fs');var path=require(_0xa0a8('0x5'));var rimraf=require(_0xa0a8('0x6'));var config=require('../../config/environment');var attributes=require(_0xa0a8('0x7'));var integrations=require(_0xa0a8('0x8'));module['exports']=function(_0x586dca,_0x5e54ce){return _0x586dca['define']('VtigerAccount',attributes,{'tableName':_0xa0a8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5af5=['define','VtigerAccount','int_vtiger_accounts','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1afedc,_0x17ee2f){var _0x3520db=function(_0x46b771){while(--_0x46b771){_0x1afedc['push'](_0x1afedc['shift']());}};_0x3520db(++_0x17ee2f);}(_0x5af5,0x13b));var _0x55af=function(_0x5c0ca6,_0x3587ff){_0x5c0ca6=_0x5c0ca6-0x0;var _0x54dbec=_0x5af5[_0x5c0ca6];return _0x54dbec;};'use strict';var _=require('lodash');var util=require(_0x55af('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x55af('0x1'));var BPromise=require(_0x55af('0x2'));var rp=require(_0x55af('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55af('0x4'));var config=require(_0x55af('0x5'));var attributes=require(_0x55af('0x6'));var integrations=require(_0x55af('0x7'));module[_0x55af('0x8')]=function(_0x448045,_0x2cd858){return _0x448045[_0x55af('0x9')](_0x55af('0xa'),attributes,{'tableName':_0x55af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index edebf73..0fba36d 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 _0x5c00=['where','limit','include','map','model','attributes','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVtigerAccount','findAll','options','raw'];(function(_0x2245da,_0x43164d){var _0x1c2998=function(_0x3b980e){while(--_0x3b980e){_0x2245da['push'](_0x2245da['shift']());}};_0x1c2998(++_0x43164d);}(_0x5c00,0x17e));var _0x05c0=function(_0x2a2799,_0x5e25a8){_0x2a2799=_0x2a2799-0x0;var _0x17f761=_0x5c00[_0x2a2799];return _0x17f761;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}exports[_0x05c0('0x16')]=function(_0x521cbd){var _0x422401=this;return new Promise(function(_0x1230e5,_0x4613c0){return db['VtigerAccount'][_0x05c0('0x17')]({'raw':_0x521cbd[_0x05c0('0x18')]?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x19')]===undefined?!![]:![]:!![],'where':_0x521cbd[_0x05c0('0x18')]?_0x521cbd['options'][_0x05c0('0x1a')]||null:null,'attributes':_0x521cbd[_0x05c0('0x18')]?_0x521cbd['options']['attributes']||null:null,'limit':_0x521cbd['options']?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x1b')]||null:null,'include':_0x521cbd[_0x05c0('0x18')]?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x521cbd[_0x05c0('0x18')]['include'],function(_0x9b4930){return{'model':db[_0x9b4930[_0x05c0('0x1e')]],'as':_0x9b4930['as'],'attributes':_0x9b4930['attributes'],'include':_0x9b4930['include']?_['map'](_0x9b4930['include'],function(_0x56aa78){return{'model':db[_0x56aa78[_0x05c0('0x1e')]],'as':_0x56aa78['as'],'attributes':_0x56aa78[_0x05c0('0x1f')],'include':_0x56aa78['include']?_[_0x05c0('0x1d')](_0x56aa78[_0x05c0('0x1c')],function(_0x3617dc){return{'model':db[_0x3617dc[_0x05c0('0x1e')]],'as':_0x3617dc['as'],'attributes':_0x3617dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x05c0('0xb')](function(_0x1c14b1){logger[_0x05c0('0xc')](_0x05c0('0x16'),_0x521cbd);logger[_0x05c0('0xf')](_0x05c0('0x16'),_0x521cbd,JSON['stringify'](_0x1c14b1));_0x1230e5(_0x1c14b1);})['catch'](function(_0x2df109){logger[_0x05c0('0x11')](_0x05c0('0x16'),_0x2df109[_0x05c0('0x13')],_0x521cbd);_0x4613c0(_0x422401[_0x05c0('0x11')](0x1f4,_0x2df109[_0x05c0('0x13')]));});});};exports[_0x05c0('0x20')]=function(_0x3c9eb1){var _0x33eff3=this;return new Promise(function(_0x87b07c,_0x3e38f0){return db[_0x05c0('0x21')]['find']({'raw':_0x3c9eb1['options']?_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x19')]===undefined?!![]:![]:!![],'where':_0x3c9eb1[_0x05c0('0x18')]?_0x3c9eb1['options'][_0x05c0('0x1a')]||null:null,'attributes':_0x3c9eb1[_0x05c0('0x18')]?_0x3c9eb1['options'][_0x05c0('0x1f')]||null:null,'include':_0x3c9eb1['options']?_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x1c')],function(_0x2a9e82){return{'model':db[_0x2a9e82[_0x05c0('0x1e')]],'as':_0x2a9e82['as'],'attributes':_0x2a9e82[_0x05c0('0x1f')],'include':_0x2a9e82[_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x2a9e82[_0x05c0('0x1c')],function(_0x3a9c63){return{'model':db[_0x3a9c63[_0x05c0('0x1e')]],'as':_0x3a9c63['as'],'attributes':_0x3a9c63[_0x05c0('0x1f')],'include':_0x3a9c63[_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x3a9c63[_0x05c0('0x1c')],function(_0x21c22){return{'model':db[_0x21c22[_0x05c0('0x1e')]],'as':_0x21c22['as'],'attributes':_0x21c22[_0x05c0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x05c0('0xb')](function(_0x337847){logger[_0x05c0('0xc')](_0x05c0('0x20'),_0x3c9eb1);logger[_0x05c0('0xf')](_0x05c0('0x20'),_0x3c9eb1,JSON[_0x05c0('0x10')](_0x337847));_0x87b07c(_0x337847);})[_0x05c0('0x15')](function(_0x40d4db){logger[_0x05c0('0x11')](_0x05c0('0x20'),_0x40d4db[_0x05c0('0x13')],_0x3c9eb1);_0x3e38f0(_0x33eff3[_0x05c0('0x11')](0x1f4,_0x40d4db['message']));});});}; \ No newline at end of file +var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','include','map','model','then','ShowVtigerAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xcb91[_0x5678b5];return _0x4c09a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetVtigerAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['VtigerAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowVtigerAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index b682a26..bc8816b 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 _0x896a=['./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getDescriptions','post','create','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4d88f6,_0x52f758){var _0x2041c8=function(_0x16f556){while(--_0x16f556){_0x4d88f6['push'](_0x4d88f6['shift']());}};_0x2041c8(++_0x52f758);}(_0x896a,0xd4));var _0xa896=function(_0x554221,_0x1018ed){_0x554221=_0x554221-0x0;var _0x47a7b2=_0x896a[_0x554221];return _0x47a7b2;};'use strict';var multer=require(_0xa896('0x0'));var util=require(_0xa896('0x1'));var path=require(_0xa896('0x2'));var timeout=require(_0xa896('0x3'));var express=require('express');var router=express[_0xa896('0x4')]();var fs_extra=require(_0xa896('0x5'));var auth=require(_0xa896('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa896('0x7'));var controller=require(_0xa896('0x8'));router[_0xa896('0x9')]('/',auth[_0xa896('0xa')](),controller[_0xa896('0xb')]);router[_0xa896('0x9')](_0xa896('0xc'),auth[_0xa896('0xa')](),controller[_0xa896('0xd')]);router[_0xa896('0x9')](_0xa896('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xa896('0x9')](_0xa896('0xf'),auth[_0xa896('0xa')](),controller['getSubjects']);router[_0xa896('0x9')]('/:id/descriptions',auth[_0xa896('0xa')](),controller[_0xa896('0x10')]);router[_0xa896('0x11')]('/',auth[_0xa896('0xa')](),controller[_0xa896('0x12')]);router['put'](_0xa896('0xc'),auth[_0xa896('0xa')](),controller['update']);router['delete'](_0xa896('0xc'),auth[_0xa896('0xa')](),controller['destroy']);module[_0xa896('0x13')]=router; \ No newline at end of file +var _0xdb99=['../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0xa1f488,_0x330f3c){var _0x459487=function(_0x3a7e08){while(--_0x3a7e08){_0xa1f488['push'](_0xa1f488['shift']());}};_0x459487(++_0x330f3c);}(_0xdb99,0x119));var _0x9db9=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xdb99[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9db9('0x0'));var timeout=require(_0x9db9('0x1'));var express=require(_0x9db9('0x2'));var router=express[_0x9db9('0x3')]();var fs_extra=require(_0x9db9('0x4'));var auth=require(_0x9db9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9db9('0x6'));var controller=require(_0x9db9('0x7'));router[_0x9db9('0x8')]('/',auth[_0x9db9('0x9')](),controller[_0x9db9('0xa')]);router[_0x9db9('0x8')](_0x9db9('0xb'),auth['isAuthenticated'](),controller[_0x9db9('0xc')]);router[_0x9db9('0x8')](_0x9db9('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x9db9('0x8')](_0x9db9('0xe'),auth[_0x9db9('0x9')](),controller['getSubjects']);router[_0x9db9('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x9db9('0xf')]('/',auth[_0x9db9('0x9')](),controller[_0x9db9('0x10')]);router[_0x9db9('0x11')](_0x9db9('0xb'),auth[_0x9db9('0x9')](),controller[_0x9db9('0x12')]);router[_0x9db9('0x13')](_0x9db9('0xb'),auth[_0x9db9('0x9')](),controller[_0x9db9('0x14')]);module[_0x9db9('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 660abb2..e1a0165 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 _0x49df=['exports','STRING','sequelize'];(function(_0x16a62e,_0x736189){var _0x1d5fa8=function(_0x1bd322){while(--_0x1bd322){_0x16a62e['push'](_0x16a62e['shift']());}};_0x1d5fa8(++_0x736189);}(_0x49df,0x179));var _0xf49d=function(_0x4fbc20,_0x33bbc4){_0x4fbc20=_0x4fbc20-0x0;var _0x419740=_0x49df[_0x4fbc20];return _0x419740;};'use strict';var Sequelize=require(_0xf49d('0x0'));module[_0xf49d('0x1')]={'name':{'type':Sequelize[_0xf49d('0x2')]},'description':{'type':Sequelize[_0xf49d('0x2')]}}; \ No newline at end of file +var _0x5d00=['exports','STRING','sequelize'];(function(_0xde735c,_0x118bce){var _0x10c962=function(_0x5b3288){while(--_0x5b3288){_0xde735c['push'](_0xde735c['shift']());}};_0x10c962(++_0x118bce);}(_0x5d00,0xc2));var _0x05d0=function(_0x2e819c,_0x3f99a5){_0x2e819c=_0x2e819c-0x0;var _0x24e271=_0x5d00[_0x2e819c];return _0x24e271;};'use strict';var Sequelize=require(_0x05d0('0x0'));module[_0x05d0('0x1')]={'name':{'type':Sequelize[_0x05d0('0x2')]},'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 86e8513..494daac 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 _0xeb28=['destroy','getFields','keys','getSubjects','findOne','getDescriptions','VtigerField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','VtigerConfiguration','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','body'];(function(_0x239193,_0x1585ef){var _0x4f51c3=function(_0x8eba2c){while(--_0x8eba2c){_0x239193['push'](_0x239193['shift']());}};_0x4f51c3(++_0x1585ef);}(_0xeb28,0xc3));var _0x8eb2=function(_0x19eefd,_0x2c68dd){_0x19eefd=_0x19eefd-0x0;var _0x5f4f82=_0xeb28[_0x19eefd];return _0x5f4f82;};'use strict';var emlformat=require(_0x8eb2('0x0'));var rimraf=require(_0x8eb2('0x1'));var zipdir=require(_0x8eb2('0x2'));var jsonpatch=require(_0x8eb2('0x3'));var rp=require(_0x8eb2('0x4'));var moment=require(_0x8eb2('0x5'));var BPromise=require(_0x8eb2('0x6'));var Mustache=require(_0x8eb2('0x7'));var util=require(_0x8eb2('0x8'));var path=require(_0x8eb2('0x9'));var sox=require(_0x8eb2('0xa'));var csv=require(_0x8eb2('0xb'));var ejs=require(_0x8eb2('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8eb2('0xd'));var jsforce=require(_0x8eb2('0xe'));var deskjs=require(_0x8eb2('0xf'));var toCsv=require(_0x8eb2('0xb'));var querystring=require(_0x8eb2('0x10'));var Papa=require(_0x8eb2('0x11'));var Redis=require(_0x8eb2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8eb2('0x13'));var as=require(_0x8eb2('0x14'));var hardwareService=require(_0x8eb2('0x15'));var logger=require(_0x8eb2('0x16'))(_0x8eb2('0x17'));var utils=require(_0x8eb2('0x18'));var config=require(_0x8eb2('0x19'));var licenseUtil=require(_0x8eb2('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8eb2('0x1b'));var client=jayson[_0x8eb2('0x1c')][_0x8eb2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xc26dd0,_0x100065,_0x1dbc34,_0x1eb911){return new BPromise(function(_0x3491aa,_0x293e86){var _0x44842=_0x1eb911||client;return _0x44842['request'](_0xc26dd0,_0x1dbc34)['then'](function(_0x267837){logger[_0x8eb2('0x1e')](_0x8eb2('0x1f'),_0x100065,_0x8eb2('0x20'));logger[_0x8eb2('0x21')](_0x8eb2('0x22'),_0x100065,'request\x20sent',JSON['stringify'](_0x267837));if(_0x267837[_0x8eb2('0x23')]){if(_0x267837[_0x8eb2('0x23')][_0x8eb2('0x24')]===0x1f4){logger['error'](_0x8eb2('0x1f'),_0x100065,_0x267837[_0x8eb2('0x23')][_0x8eb2('0x25')]);return _0x293e86(_0x267837[_0x8eb2('0x23')][_0x8eb2('0x25')]);}logger[_0x8eb2('0x23')](_0x8eb2('0x1f'),_0x100065,_0x267837[_0x8eb2('0x23')][_0x8eb2('0x25')]);return _0x3491aa(_0x267837['error'][_0x8eb2('0x25')]);}else{logger[_0x8eb2('0x1e')](_0x8eb2('0x1f'),_0x100065,_0x8eb2('0x20'));_0x3491aa(_0x267837[_0x8eb2('0x26')]['message']);}})['catch'](function(_0x3781e5){logger[_0x8eb2('0x23')](_0x8eb2('0x1f'),_0x100065,_0x3781e5);_0x293e86(_0x3781e5);});});}function respondWithStatusCode(_0xde38bf,_0x55c680){_0x55c680=_0x55c680||0xcc;return function(_0x45e112){if(_0x45e112){return _0xde38bf[_0x8eb2('0x27')](_0x55c680);}return _0xde38bf['status'](_0x55c680)[_0x8eb2('0x28')]();};}function respondWithResult(_0x102fc6,_0x115f71){_0x115f71=_0x115f71||0xc8;return function(_0x3b51dd){if(_0x3b51dd){return _0x102fc6[_0x8eb2('0x29')](_0x115f71)[_0x8eb2('0x2a')](_0x3b51dd);}};}function respondWithFilteredResult(_0x48a210,_0x44ad1d){return function(_0x56e24e){if(_0x56e24e){var _0x581e61=typeof _0x44ad1d[_0x8eb2('0x2b')]===_0x8eb2('0x2c')&&typeof _0x44ad1d[_0x8eb2('0x2d')]==='undefined';var _0x42ccd8=_0x56e24e[_0x8eb2('0x2e')];var _0x21847f=_0x581e61?0x0:_0x44ad1d[_0x8eb2('0x2b')];var _0x478697=_0x581e61?_0x56e24e[_0x8eb2('0x2e')]:_0x44ad1d['offset']+_0x44ad1d[_0x8eb2('0x2d')];var _0xf77d9f;if(_0x478697>=_0x42ccd8){_0x478697=_0x42ccd8;_0xf77d9f=0xc8;}else{_0xf77d9f=0xce;}_0x48a210[_0x8eb2('0x29')](_0xf77d9f);return _0x48a210[_0x8eb2('0x2f')]('Content-Range',_0x21847f+'-'+_0x478697+'/'+_0x42ccd8)[_0x8eb2('0x2a')](_0x56e24e);}return null;};}function patchUpdates(_0x2e30ab){return function(_0x538a07){try{jsonpatch[_0x8eb2('0x30')](_0x538a07,_0x2e30ab,!![]);}catch(_0x5dd5ca){return BPromise[_0x8eb2('0x31')](_0x5dd5ca);}return _0x538a07[_0x8eb2('0x32')]();};}function saveUpdates(_0x171317,_0x433f8b){return function(_0x5a720f){if(_0x5a720f){return _0x5a720f[_0x8eb2('0x33')](_0x171317)[_0x8eb2('0x34')](function(_0x3c3efe){return _0x3c3efe;});}return null;};}function removeEntity(_0x111512,_0x45b7cc){return function(_0x1f1f9b){if(_0x1f1f9b){return _0x1f1f9b['destroy']()[_0x8eb2('0x34')](function(){_0x111512['status'](0xcc)[_0x8eb2('0x28')]();});}};}function handleEntityNotFound(_0x3d59f9,_0x5c14c5){return function(_0x21c8c6){if(!_0x21c8c6){_0x3d59f9['sendStatus'](0x194);}return _0x21c8c6;};}function handleError(_0xc3b497,_0x2a00ec){_0x2a00ec=_0x2a00ec||0x1f4;return function(_0x1d640a){logger[_0x8eb2('0x23')](_0x1d640a[_0x8eb2('0x35')]);if(_0x1d640a[_0x8eb2('0x36')]){delete _0x1d640a[_0x8eb2('0x36')];}_0xc3b497[_0x8eb2('0x29')](_0x2a00ec)[_0x8eb2('0x37')](_0x1d640a);};}exports[_0x8eb2('0x38')]=function(_0x13f02a,_0x2f3236){var _0x44d38a={},_0x4c1b35={},_0xc49666={'count':0x0,'rows':[]};var _0x521925=_['map'](db[_0x8eb2('0x39')][_0x8eb2('0x3a')],function(_0xbbafea){return{'name':_0xbbafea['fieldName'],'type':_0xbbafea[_0x8eb2('0x3b')][_0x8eb2('0x3c')]};});_0x4c1b35[_0x8eb2('0x3d')]=_[_0x8eb2('0x3e')](_0x521925,_0x8eb2('0x36'));_0x4c1b35['query']=_['keys'](_0x13f02a[_0x8eb2('0x3f')]);_0x4c1b35[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0x4c1b35['model'],_0x4c1b35[_0x8eb2('0x3f')]);_0x44d38a[_0x8eb2('0x42')]=_[_0x8eb2('0x41')](_0x4c1b35[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0x13f02a['query'][_0x8eb2('0x43')]));_0x44d38a['attributes']=_0x44d38a[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x44d38a['attributes']:_0x4c1b35[_0x8eb2('0x3d')];if(!_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x45')](_0x8eb2('0x46'))){_0x44d38a['limit']=qs[_0x8eb2('0x2d')](_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x2d')]);_0x44d38a[_0x8eb2('0x2b')]=qs[_0x8eb2('0x2b')](_0x13f02a[_0x8eb2('0x3f')]['offset']);}_0x44d38a[_0x8eb2('0x47')]=qs[_0x8eb2('0x48')](_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x48')]);_0x44d38a[_0x8eb2('0x49')]=qs[_0x8eb2('0x40')](_[_0x8eb2('0x4a')](_0x13f02a[_0x8eb2('0x3f')],_0x4c1b35[_0x8eb2('0x40')]),_0x521925);if(_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x4b')]){_0x44d38a[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x44d38a[_0x8eb2('0x49')],{'$or':_[_0x8eb2('0x3e')](_0x521925,function(_0x271c12){if(_0x271c12[_0x8eb2('0x3b')]!=='VIRTUAL'){var _0x4b84a1={};_0x4b84a1[_0x271c12[_0x8eb2('0x36')]]={'$like':'%'+_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x4b')]+'%'};return _0x4b84a1;}})});}_0x44d38a=_[_0x8eb2('0x4c')]({},_0x44d38a,_0x13f02a[_0x8eb2('0x4d')]);var _0x13a257={'where':_0x44d38a[_0x8eb2('0x49')]};return db[_0x8eb2('0x39')][_0x8eb2('0x2e')](_0x13a257)[_0x8eb2('0x34')](function(_0x5a8e7a){_0xc49666['count']=_0x5a8e7a;if(_0x13f02a['query'][_0x8eb2('0x4e')]){_0x44d38a['include']=[{'all':!![]}];}return db[_0x8eb2('0x39')][_0x8eb2('0x4f')](_0x44d38a);})[_0x8eb2('0x34')](function(_0x577c72){_0xc49666['rows']=_0x577c72;return _0xc49666;})['then'](respondWithFilteredResult(_0x2f3236,_0x44d38a))[_0x8eb2('0x50')](handleError(_0x2f3236,null));};exports[_0x8eb2('0x51')]=function(_0x2814ae,_0xd9faa7){var _0x564daa={'raw':![],'where':{'id':_0x2814ae[_0x8eb2('0x52')]['id']}},_0x3b112f={};_0x3b112f[_0x8eb2('0x3d')]=_['keys'](db[_0x8eb2('0x39')][_0x8eb2('0x3a')]);_0x3b112f['query']=_['keys'](_0x2814ae[_0x8eb2('0x3f')]);_0x3b112f[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0x3b112f['model'],_0x3b112f['query']);_0x564daa[_0x8eb2('0x42')]=_[_0x8eb2('0x41')](_0x3b112f[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0x2814ae['query'][_0x8eb2('0x43')]));_0x564daa[_0x8eb2('0x42')]=_0x564daa[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x564daa[_0x8eb2('0x42')]:_0x3b112f[_0x8eb2('0x3d')];if(_0x2814ae[_0x8eb2('0x3f')][_0x8eb2('0x4e')]){_0x564daa[_0x8eb2('0x53')]=[{'all':!![]}];}_0x564daa=_[_0x8eb2('0x4c')]({},_0x564daa,_0x2814ae[_0x8eb2('0x4d')]);return db[_0x8eb2('0x39')][_0x8eb2('0x54')](_0x564daa)[_0x8eb2('0x34')](handleEntityNotFound(_0xd9faa7,null))[_0x8eb2('0x34')](respondWithResult(_0xd9faa7,null))[_0x8eb2('0x50')](handleError(_0xd9faa7,null));};exports[_0x8eb2('0x55')]=function(_0x26b021,_0x825699){return db['VtigerConfiguration']['create'](_0x26b021['body'],{})[_0x8eb2('0x34')](respondWithResult(_0x825699,0xc9))['catch'](handleError(_0x825699,null));};exports[_0x8eb2('0x33')]=function(_0x1a9826,_0x12aaf5){if(_0x1a9826[_0x8eb2('0x56')]['id']){delete _0x1a9826[_0x8eb2('0x56')]['id'];}return db[_0x8eb2('0x39')][_0x8eb2('0x54')]({'where':{'id':_0x1a9826[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x12aaf5,null))[_0x8eb2('0x34')](saveUpdates(_0x1a9826[_0x8eb2('0x56')],null))[_0x8eb2('0x34')](respondWithResult(_0x12aaf5,null))['catch'](handleError(_0x12aaf5,null));};exports[_0x8eb2('0x57')]=function(_0x22d38e,_0x4bc80b){return db[_0x8eb2('0x39')][_0x8eb2('0x54')]({'where':{'id':_0x22d38e[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x4bc80b,null))[_0x8eb2('0x34')](removeEntity(_0x4bc80b,null))[_0x8eb2('0x50')](handleError(_0x4bc80b,null));};exports[_0x8eb2('0x58')]=function(_0xe55e60,_0x2599da,_0x2f7e5d){var _0x27bdf4={};var _0xeab7ec={};var _0x2b8763;var _0x1ff980;return db[_0x8eb2('0x39')]['findOne']({'where':{'id':_0xe55e60[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x2599da,null))[_0x8eb2('0x34')](function(_0x2651c2){if(_0x2651c2){_0x2b8763=_0x2651c2;_0xeab7ec['model']=_[_0x8eb2('0x59')](db['VtigerField'][_0x8eb2('0x3a')]);_0xeab7ec[_0x8eb2('0x3f')]=_[_0x8eb2('0x59')](_0xe55e60[_0x8eb2('0x3f')]);_0xeab7ec[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0xeab7ec[_0x8eb2('0x3d')],_0xeab7ec[_0x8eb2('0x3f')]);_0x27bdf4[_0x8eb2('0x42')]=_['intersection'](_0xeab7ec[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0xe55e60['query']['fields']));_0x27bdf4[_0x8eb2('0x42')]=_0x27bdf4[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x27bdf4[_0x8eb2('0x42')]:_0xeab7ec['model'];_0x27bdf4['order']=qs[_0x8eb2('0x48')](_0xe55e60[_0x8eb2('0x3f')][_0x8eb2('0x48')]);_0x27bdf4[_0x8eb2('0x49')]=qs[_0x8eb2('0x40')](_[_0x8eb2('0x4a')](_0xe55e60[_0x8eb2('0x3f')],_0xeab7ec[_0x8eb2('0x40')]));if(_0xe55e60[_0x8eb2('0x3f')]['filter']){_0x27bdf4[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x27bdf4['where'],{'$or':_['map'](_0x27bdf4['attributes'],function(_0x217751){var _0x36b0c9={};_0x36b0c9[_0x217751]={'$like':'%'+_0xe55e60[_0x8eb2('0x3f')][_0x8eb2('0x4b')]+'%'};return _0x36b0c9;})});}_0x27bdf4=_[_0x8eb2('0x4c')]({},_0x27bdf4,_0xe55e60['options']);return _0x2b8763['getFields'](_0x27bdf4);}})[_0x8eb2('0x34')](function(_0x1e4e72){if(_0x1e4e72){_0x1ff980=_0x1e4e72[_0x8eb2('0x44')];if(!_0xe55e60['query']['hasOwnProperty'](_0x8eb2('0x46'))){_0x27bdf4['limit']=qs[_0x8eb2('0x2d')](_0xe55e60[_0x8eb2('0x3f')][_0x8eb2('0x2d')]);_0x27bdf4['offset']=qs[_0x8eb2('0x2b')](_0xe55e60[_0x8eb2('0x3f')]['offset']);}return _0x2b8763[_0x8eb2('0x58')](_0x27bdf4);}})[_0x8eb2('0x34')](function(_0x34ba58){if(_0x34ba58){return _0x34ba58?{'count':_0x1ff980,'rows':_0x34ba58}:null;}})[_0x8eb2('0x34')](respondWithResult(_0x2599da,null))['catch'](handleError(_0x2599da,null));};exports[_0x8eb2('0x5a')]=function(_0x5af3c1,_0x55055d,_0x40316d){var _0x197355={};var _0x54a404={};var _0x3b7516;var _0x233aa5;return db[_0x8eb2('0x39')][_0x8eb2('0x5b')]({'where':{'id':_0x5af3c1[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x55055d,null))[_0x8eb2('0x34')](function(_0x51ca72){if(_0x51ca72){_0x3b7516=_0x51ca72;_0x54a404[_0x8eb2('0x3d')]=_[_0x8eb2('0x59')](db['VtigerField'][_0x8eb2('0x3a')]);_0x54a404[_0x8eb2('0x3f')]=_['keys'](_0x5af3c1[_0x8eb2('0x3f')]);_0x54a404[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0x54a404[_0x8eb2('0x3d')],_0x54a404[_0x8eb2('0x3f')]);_0x197355[_0x8eb2('0x42')]=_[_0x8eb2('0x41')](_0x54a404[_0x8eb2('0x3d')],qs['fields'](_0x5af3c1['query']['fields']));_0x197355[_0x8eb2('0x42')]=_0x197355[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x197355[_0x8eb2('0x42')]:_0x54a404[_0x8eb2('0x3d')];_0x197355[_0x8eb2('0x47')]=qs[_0x8eb2('0x48')](_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x48')]);_0x197355['where']=qs['filters'](_[_0x8eb2('0x4a')](_0x5af3c1[_0x8eb2('0x3f')],_0x54a404['filters']));if(_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x4b')]){_0x197355[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x197355[_0x8eb2('0x49')],{'$or':_[_0x8eb2('0x3e')](_0x197355[_0x8eb2('0x42')],function(_0x145515){var _0x221602={};_0x221602[_0x145515]={'$like':'%'+_0x5af3c1[_0x8eb2('0x3f')]['filter']+'%'};return _0x221602;})});}_0x197355=_[_0x8eb2('0x4c')]({},_0x197355,_0x5af3c1[_0x8eb2('0x4d')]);return _0x3b7516[_0x8eb2('0x5a')](_0x197355);}})['then'](function(_0x1cd1d9){if(_0x1cd1d9){_0x233aa5=_0x1cd1d9[_0x8eb2('0x44')];if(!_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x45')]('nolimit')){_0x197355[_0x8eb2('0x2d')]=qs[_0x8eb2('0x2d')](_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x2d')]);_0x197355[_0x8eb2('0x2b')]=qs['offset'](_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x2b')]);}return _0x3b7516[_0x8eb2('0x5a')](_0x197355);}})[_0x8eb2('0x34')](function(_0xcd8c74){if(_0xcd8c74){return _0xcd8c74?{'count':_0x233aa5,'rows':_0xcd8c74}:null;}})[_0x8eb2('0x34')](respondWithResult(_0x55055d,null))['catch'](handleError(_0x55055d,null));};exports[_0x8eb2('0x5c')]=function(_0x357ac1,_0xbce895,_0x583d0d){var _0x5675c6={};var _0x22674e={};var _0x1a608b;var _0x1ab95c;return db[_0x8eb2('0x39')][_0x8eb2('0x5b')]({'where':{'id':_0x357ac1['params']['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0xbce895,null))[_0x8eb2('0x34')](function(_0x25e92b){if(_0x25e92b){_0x1a608b=_0x25e92b;_0x22674e['model']=_[_0x8eb2('0x59')](db[_0x8eb2('0x5d')][_0x8eb2('0x3a')]);_0x22674e[_0x8eb2('0x3f')]=_[_0x8eb2('0x59')](_0x357ac1['query']);_0x22674e['filters']=_['intersection'](_0x22674e[_0x8eb2('0x3d')],_0x22674e[_0x8eb2('0x3f')]);_0x5675c6[_0x8eb2('0x42')]=_['intersection'](_0x22674e[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0x357ac1[_0x8eb2('0x3f')]['fields']));_0x5675c6[_0x8eb2('0x42')]=_0x5675c6[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x5675c6[_0x8eb2('0x42')]:_0x22674e[_0x8eb2('0x3d')];_0x5675c6[_0x8eb2('0x47')]=qs['sort'](_0x357ac1['query']['sort']);_0x5675c6['where']=qs['filters'](_[_0x8eb2('0x4a')](_0x357ac1[_0x8eb2('0x3f')],_0x22674e[_0x8eb2('0x40')]));if(_0x357ac1[_0x8eb2('0x3f')]['filter']){_0x5675c6[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x5675c6['where'],{'$or':_[_0x8eb2('0x3e')](_0x5675c6[_0x8eb2('0x42')],function(_0x2c550b){var _0x520206={};_0x520206[_0x2c550b]={'$like':'%'+_0x357ac1[_0x8eb2('0x3f')][_0x8eb2('0x4b')]+'%'};return _0x520206;})});}_0x5675c6=_['merge']({},_0x5675c6,_0x357ac1[_0x8eb2('0x4d')]);return _0x1a608b[_0x8eb2('0x5c')](_0x5675c6);}})['then'](function(_0x3c44){if(_0x3c44){_0x1ab95c=_0x3c44[_0x8eb2('0x44')];if(!_0x357ac1[_0x8eb2('0x3f')][_0x8eb2('0x45')](_0x8eb2('0x46'))){_0x5675c6[_0x8eb2('0x2d')]=qs[_0x8eb2('0x2d')](_0x357ac1['query'][_0x8eb2('0x2d')]);_0x5675c6[_0x8eb2('0x2b')]=qs[_0x8eb2('0x2b')](_0x357ac1[_0x8eb2('0x3f')][_0x8eb2('0x2b')]);}return _0x1a608b[_0x8eb2('0x5c')](_0x5675c6);}})['then'](function(_0x517c8c){if(_0x517c8c){return _0x517c8c?{'count':_0x1ab95c,'rows':_0x517c8c}:null;}})[_0x8eb2('0x34')](respondWithResult(_0xbce895,null))[_0x8eb2('0x50')](handleError(_0xbce895,null));}; \ No newline at end of file +var _0x2bae=['request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','stack','name','VtigerConfiguration','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','keys','intersection','find','body','params','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','rimraf'];(function(_0x3124f6,_0xebeaf9){var _0x2f9390=function(_0x4164d2){while(--_0x4164d2){_0x3124f6['push'](_0x3124f6['shift']());}};_0x2f9390(++_0xebeaf9);}(_0x2bae,0x14f));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2ba('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ba('0x1'));var moment=require(_0xe2ba('0x2'));var BPromise=require(_0xe2ba('0x3'));var Mustache=require(_0xe2ba('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe2ba('0x5'));var csv=require(_0xe2ba('0x6'));var ejs=require(_0xe2ba('0x7'));var fs=require('fs');var fs_extra=require(_0xe2ba('0x8'));var _=require(_0xe2ba('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe2ba('0xa'));var deskjs=require(_0xe2ba('0xb'));var toCsv=require(_0xe2ba('0x6'));var querystring=require(_0xe2ba('0xc'));var Papa=require(_0xe2ba('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe2ba('0xe'));var as=require(_0xe2ba('0xf'));var hardwareService=require(_0xe2ba('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe2ba('0x11'));var licenseUtil=require(_0xe2ba('0x12'));var db=require(_0xe2ba('0x13'))['db'];var jayson=require(_0xe2ba('0x14'));var client=jayson[_0xe2ba('0x15')][_0xe2ba('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x4855d2,_0x252620,_0x10d3bf,_0x2ac97c){return new BPromise(function(_0xcfe09e,_0x1ee94d){var _0x3cb4d1=_0x2ac97c||client;return _0x3cb4d1[_0xe2ba('0x17')](_0x4855d2,_0x10d3bf)[_0xe2ba('0x18')](function(_0x5def56){logger['info'](_0xe2ba('0x19'),_0x252620,_0xe2ba('0x1a'));logger['debug'](_0xe2ba('0x1b'),_0x252620,_0xe2ba('0x1a'),JSON[_0xe2ba('0x1c')](_0x5def56));if(_0x5def56['error']){if(_0x5def56['error'][_0xe2ba('0x1d')]===0x1f4){logger[_0xe2ba('0x1e')](_0xe2ba('0x19'),_0x252620,_0x5def56['error'][_0xe2ba('0x1f')]);return _0x1ee94d(_0x5def56[_0xe2ba('0x1e')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x252620,_0x5def56[_0xe2ba('0x1e')]['message']);return _0xcfe09e(_0x5def56['error']['message']);}else{logger[_0xe2ba('0x20')](_0xe2ba('0x19'),_0x252620,'request\x20sent');_0xcfe09e(_0x5def56[_0xe2ba('0x21')]['message']);}})[_0xe2ba('0x22')](function(_0x362992){logger[_0xe2ba('0x1e')](_0xe2ba('0x19'),_0x252620,_0x362992);_0x1ee94d(_0x362992);});});}function respondWithStatusCode(_0x1f7c8b,_0x5642df){_0x5642df=_0x5642df||0xcc;return function(_0x9bd101){if(_0x9bd101){return _0x1f7c8b[_0xe2ba('0x23')](_0x5642df);}return _0x1f7c8b[_0xe2ba('0x24')](_0x5642df)[_0xe2ba('0x25')]();};}function respondWithResult(_0x289ac0,_0x4ff3ac){_0x4ff3ac=_0x4ff3ac||0xc8;return function(_0x2b6fbb){if(_0x2b6fbb){return _0x289ac0[_0xe2ba('0x24')](_0x4ff3ac)[_0xe2ba('0x26')](_0x2b6fbb);}};}function respondWithFilteredResult(_0x40dc5b,_0x51dbab){return function(_0x12213f){if(_0x12213f){var _0x148697=typeof _0x51dbab[_0xe2ba('0x27')]===_0xe2ba('0x28')&&typeof _0x51dbab[_0xe2ba('0x29')]===_0xe2ba('0x28');var _0x5b74b=_0x12213f[_0xe2ba('0x2a')];var _0x47691c=_0x148697?0x0:_0x51dbab['offset'];var _0x45d93d=_0x148697?_0x12213f[_0xe2ba('0x2a')]:_0x51dbab[_0xe2ba('0x27')]+_0x51dbab[_0xe2ba('0x29')];var _0x594ab3;if(_0x45d93d>=_0x5b74b){_0x45d93d=_0x5b74b;_0x594ab3=0xc8;}else{_0x594ab3=0xce;}_0x40dc5b[_0xe2ba('0x24')](_0x594ab3);return _0x40dc5b['set'](_0xe2ba('0x2b'),_0x47691c+'-'+_0x45d93d+'/'+_0x5b74b)[_0xe2ba('0x26')](_0x12213f);}return null;};}function patchUpdates(_0x245751){return function(_0x47ab00){try{jsonpatch[_0xe2ba('0x2c')](_0x47ab00,_0x245751,!![]);}catch(_0xc9add7){return BPromise['reject'](_0xc9add7);}return _0x47ab00['save']();};}function saveUpdates(_0x5677b6,_0x1692ff){return function(_0x490403){if(_0x490403){return _0x490403['update'](_0x5677b6)[_0xe2ba('0x18')](function(_0x1a0256){return _0x1a0256;});}return null;};}function removeEntity(_0x33d892,_0x47a3da){return function(_0x49442e){if(_0x49442e){return _0x49442e[_0xe2ba('0x2d')]()[_0xe2ba('0x18')](function(){_0x33d892[_0xe2ba('0x24')](0xcc)[_0xe2ba('0x25')]();});}};}function handleEntityNotFound(_0x59d689,_0x4f21fc){return function(_0x20bf07){if(!_0x20bf07){_0x59d689[_0xe2ba('0x23')](0x194);}return _0x20bf07;};}function handleError(_0x19d220,_0xd918b7){_0xd918b7=_0xd918b7||0x1f4;return function(_0x2d6f8c){logger[_0xe2ba('0x1e')](_0x2d6f8c[_0xe2ba('0x2e')]);if(_0x2d6f8c['name']){delete _0x2d6f8c[_0xe2ba('0x2f')];}_0x19d220[_0xe2ba('0x24')](_0xd918b7)['send'](_0x2d6f8c);};}exports['index']=function(_0x4e778c,_0x1e820b){var _0x1c76fc={},_0x5c34a6={},_0x95ec09={'count':0x0,'rows':[]};var _0x31e268=_['map'](db[_0xe2ba('0x30')][_0xe2ba('0x31')],function(_0x36979e){return{'name':_0x36979e[_0xe2ba('0x32')],'type':_0x36979e[_0xe2ba('0x33')][_0xe2ba('0x34')]};});_0x5c34a6['model']=_['map'](_0x31e268,'name');_0x5c34a6[_0xe2ba('0x35')]=_['keys'](_0x4e778c['query']);_0x5c34a6[_0xe2ba('0x36')]=_['intersection'](_0x5c34a6[_0xe2ba('0x37')],_0x5c34a6[_0xe2ba('0x35')]);_0x1c76fc[_0xe2ba('0x38')]=_['intersection'](_0x5c34a6[_0xe2ba('0x37')],qs[_0xe2ba('0x39')](_0x4e778c[_0xe2ba('0x35')]['fields']));_0x1c76fc[_0xe2ba('0x38')]=_0x1c76fc['attributes'][_0xe2ba('0x3a')]?_0x1c76fc[_0xe2ba('0x38')]:_0x5c34a6[_0xe2ba('0x37')];if(!_0x4e778c[_0xe2ba('0x35')][_0xe2ba('0x3b')](_0xe2ba('0x3c'))){_0x1c76fc[_0xe2ba('0x29')]=qs[_0xe2ba('0x29')](_0x4e778c[_0xe2ba('0x35')][_0xe2ba('0x29')]);_0x1c76fc[_0xe2ba('0x27')]=qs['offset'](_0x4e778c['query'][_0xe2ba('0x27')]);}_0x1c76fc['order']=qs[_0xe2ba('0x3d')](_0x4e778c[_0xe2ba('0x35')][_0xe2ba('0x3d')]);_0x1c76fc[_0xe2ba('0x3e')]=qs['filters'](_[_0xe2ba('0x3f')](_0x4e778c[_0xe2ba('0x35')],_0x5c34a6[_0xe2ba('0x36')]),_0x31e268);if(_0x4e778c[_0xe2ba('0x35')][_0xe2ba('0x40')]){_0x1c76fc['where']=_[_0xe2ba('0x41')](_0x1c76fc[_0xe2ba('0x3e')],{'$or':_[_0xe2ba('0x42')](_0x31e268,function(_0x517508){if(_0x517508[_0xe2ba('0x33')]!==_0xe2ba('0x43')){var _0x9de835={};_0x9de835[_0x517508[_0xe2ba('0x2f')]]={'$like':'%'+_0x4e778c[_0xe2ba('0x35')][_0xe2ba('0x40')]+'%'};return _0x9de835;}})});}_0x1c76fc=_['merge']({},_0x1c76fc,_0x4e778c[_0xe2ba('0x44')]);var _0x44854a={'where':_0x1c76fc[_0xe2ba('0x3e')]};return db[_0xe2ba('0x30')]['count'](_0x44854a)[_0xe2ba('0x18')](function(_0x18e14f){_0x95ec09[_0xe2ba('0x2a')]=_0x18e14f;if(_0x4e778c[_0xe2ba('0x35')][_0xe2ba('0x45')]){_0x1c76fc[_0xe2ba('0x46')]=[{'all':!![]}];}return db[_0xe2ba('0x30')][_0xe2ba('0x47')](_0x1c76fc);})['then'](function(_0x170046){_0x95ec09['rows']=_0x170046;return _0x95ec09;})[_0xe2ba('0x18')](respondWithFilteredResult(_0x1e820b,_0x1c76fc))[_0xe2ba('0x22')](handleError(_0x1e820b,null));};exports[_0xe2ba('0x48')]=function(_0x297c8c,_0x506c4f){var _0x3a1e9c={'raw':![],'where':{'id':_0x297c8c['params']['id']}},_0x38df02={};_0x38df02[_0xe2ba('0x37')]=_[_0xe2ba('0x49')](db['VtigerConfiguration'][_0xe2ba('0x31')]);_0x38df02[_0xe2ba('0x35')]=_['keys'](_0x297c8c[_0xe2ba('0x35')]);_0x38df02[_0xe2ba('0x36')]=_[_0xe2ba('0x4a')](_0x38df02[_0xe2ba('0x37')],_0x38df02[_0xe2ba('0x35')]);_0x3a1e9c[_0xe2ba('0x38')]=_[_0xe2ba('0x4a')](_0x38df02[_0xe2ba('0x37')],qs[_0xe2ba('0x39')](_0x297c8c[_0xe2ba('0x35')]['fields']));_0x3a1e9c[_0xe2ba('0x38')]=_0x3a1e9c[_0xe2ba('0x38')]['length']?_0x3a1e9c['attributes']:_0x38df02[_0xe2ba('0x37')];if(_0x297c8c[_0xe2ba('0x35')][_0xe2ba('0x45')]){_0x3a1e9c[_0xe2ba('0x46')]=[{'all':!![]}];}_0x3a1e9c=_[_0xe2ba('0x41')]({},_0x3a1e9c,_0x297c8c[_0xe2ba('0x44')]);return db['VtigerConfiguration'][_0xe2ba('0x4b')](_0x3a1e9c)['then'](handleEntityNotFound(_0x506c4f,null))['then'](respondWithResult(_0x506c4f,null))[_0xe2ba('0x22')](handleError(_0x506c4f,null));};exports['create']=function(_0x2cbdb0,_0x214e41){return db[_0xe2ba('0x30')]['create'](_0x2cbdb0[_0xe2ba('0x4c')],{})[_0xe2ba('0x18')](respondWithResult(_0x214e41,0xc9))[_0xe2ba('0x22')](handleError(_0x214e41,null));};exports['update']=function(_0x487567,_0x3f779c){if(_0x487567[_0xe2ba('0x4c')]['id']){delete _0x487567[_0xe2ba('0x4c')]['id'];}return db[_0xe2ba('0x30')][_0xe2ba('0x4b')]({'where':{'id':_0x487567[_0xe2ba('0x4d')]['id']}})[_0xe2ba('0x18')](handleEntityNotFound(_0x3f779c,null))[_0xe2ba('0x18')](saveUpdates(_0x487567['body'],null))[_0xe2ba('0x18')](respondWithResult(_0x3f779c,null))[_0xe2ba('0x22')](handleError(_0x3f779c,null));};exports['destroy']=function(_0x20962f,_0x16ecf7){return db[_0xe2ba('0x30')][_0xe2ba('0x4b')]({'where':{'id':_0x20962f[_0xe2ba('0x4d')]['id']}})['then'](handleEntityNotFound(_0x16ecf7,null))[_0xe2ba('0x18')](removeEntity(_0x16ecf7,null))[_0xe2ba('0x22')](handleError(_0x16ecf7,null));};exports[_0xe2ba('0x4e')]=function(_0x26e2f9,_0x3af107,_0x23247a){var _0x3245ef={};var _0x29f002={};var _0x1d0a8a;var _0x398ec9;return db[_0xe2ba('0x30')][_0xe2ba('0x4f')]({'where':{'id':_0x26e2f9[_0xe2ba('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3af107,null))[_0xe2ba('0x18')](function(_0x418d39){if(_0x418d39){_0x1d0a8a=_0x418d39;_0x29f002[_0xe2ba('0x37')]=_['keys'](db[_0xe2ba('0x50')]['rawAttributes']);_0x29f002[_0xe2ba('0x35')]=_[_0xe2ba('0x49')](_0x26e2f9['query']);_0x29f002[_0xe2ba('0x36')]=_[_0xe2ba('0x4a')](_0x29f002[_0xe2ba('0x37')],_0x29f002[_0xe2ba('0x35')]);_0x3245ef[_0xe2ba('0x38')]=_[_0xe2ba('0x4a')](_0x29f002[_0xe2ba('0x37')],qs[_0xe2ba('0x39')](_0x26e2f9[_0xe2ba('0x35')][_0xe2ba('0x39')]));_0x3245ef[_0xe2ba('0x38')]=_0x3245ef[_0xe2ba('0x38')][_0xe2ba('0x3a')]?_0x3245ef['attributes']:_0x29f002[_0xe2ba('0x37')];_0x3245ef[_0xe2ba('0x51')]=qs[_0xe2ba('0x3d')](_0x26e2f9['query'][_0xe2ba('0x3d')]);_0x3245ef[_0xe2ba('0x3e')]=qs[_0xe2ba('0x36')](_[_0xe2ba('0x3f')](_0x26e2f9[_0xe2ba('0x35')],_0x29f002[_0xe2ba('0x36')]));if(_0x26e2f9['query'][_0xe2ba('0x40')]){_0x3245ef[_0xe2ba('0x3e')]=_[_0xe2ba('0x41')](_0x3245ef[_0xe2ba('0x3e')],{'$or':_[_0xe2ba('0x42')](_0x3245ef[_0xe2ba('0x38')],function(_0x389a77){var _0x58cb7e={};_0x58cb7e[_0x389a77]={'$like':'%'+_0x26e2f9[_0xe2ba('0x35')][_0xe2ba('0x40')]+'%'};return _0x58cb7e;})});}_0x3245ef=_[_0xe2ba('0x41')]({},_0x3245ef,_0x26e2f9[_0xe2ba('0x44')]);return _0x1d0a8a[_0xe2ba('0x4e')](_0x3245ef);}})[_0xe2ba('0x18')](function(_0x58ce27){if(_0x58ce27){_0x398ec9=_0x58ce27['length'];if(!_0x26e2f9[_0xe2ba('0x35')]['hasOwnProperty'](_0xe2ba('0x3c'))){_0x3245ef['limit']=qs[_0xe2ba('0x29')](_0x26e2f9['query'][_0xe2ba('0x29')]);_0x3245ef['offset']=qs[_0xe2ba('0x27')](_0x26e2f9[_0xe2ba('0x35')][_0xe2ba('0x27')]);}return _0x1d0a8a['getFields'](_0x3245ef);}})[_0xe2ba('0x18')](function(_0xa91a0){if(_0xa91a0){return _0xa91a0?{'count':_0x398ec9,'rows':_0xa91a0}:null;}})['then'](respondWithResult(_0x3af107,null))[_0xe2ba('0x22')](handleError(_0x3af107,null));};exports[_0xe2ba('0x52')]=function(_0x105551,_0x32b2da,_0x28f6b9){var _0x17910e={};var _0x369e23={};var _0x2b9f3f;var _0x3ea8ab;return db[_0xe2ba('0x30')]['findOne']({'where':{'id':_0x105551[_0xe2ba('0x4d')]['id']}})[_0xe2ba('0x18')](handleEntityNotFound(_0x32b2da,null))[_0xe2ba('0x18')](function(_0x2976ba){if(_0x2976ba){_0x2b9f3f=_0x2976ba;_0x369e23[_0xe2ba('0x37')]=_[_0xe2ba('0x49')](db[_0xe2ba('0x50')][_0xe2ba('0x31')]);_0x369e23['query']=_[_0xe2ba('0x49')](_0x105551['query']);_0x369e23['filters']=_[_0xe2ba('0x4a')](_0x369e23['model'],_0x369e23[_0xe2ba('0x35')]);_0x17910e[_0xe2ba('0x38')]=_[_0xe2ba('0x4a')](_0x369e23[_0xe2ba('0x37')],qs[_0xe2ba('0x39')](_0x105551[_0xe2ba('0x35')][_0xe2ba('0x39')]));_0x17910e[_0xe2ba('0x38')]=_0x17910e['attributes'][_0xe2ba('0x3a')]?_0x17910e[_0xe2ba('0x38')]:_0x369e23[_0xe2ba('0x37')];_0x17910e[_0xe2ba('0x51')]=qs[_0xe2ba('0x3d')](_0x105551[_0xe2ba('0x35')][_0xe2ba('0x3d')]);_0x17910e['where']=qs['filters'](_[_0xe2ba('0x3f')](_0x105551['query'],_0x369e23[_0xe2ba('0x36')]));if(_0x105551[_0xe2ba('0x35')][_0xe2ba('0x40')]){_0x17910e[_0xe2ba('0x3e')]=_[_0xe2ba('0x41')](_0x17910e[_0xe2ba('0x3e')],{'$or':_[_0xe2ba('0x42')](_0x17910e[_0xe2ba('0x38')],function(_0x8a243){var _0x57ef11={};_0x57ef11[_0x8a243]={'$like':'%'+_0x105551[_0xe2ba('0x35')][_0xe2ba('0x40')]+'%'};return _0x57ef11;})});}_0x17910e=_[_0xe2ba('0x41')]({},_0x17910e,_0x105551[_0xe2ba('0x44')]);return _0x2b9f3f[_0xe2ba('0x52')](_0x17910e);}})[_0xe2ba('0x18')](function(_0x53e29c){if(_0x53e29c){_0x3ea8ab=_0x53e29c[_0xe2ba('0x3a')];if(!_0x105551[_0xe2ba('0x35')][_0xe2ba('0x3b')](_0xe2ba('0x3c'))){_0x17910e[_0xe2ba('0x29')]=qs[_0xe2ba('0x29')](_0x105551[_0xe2ba('0x35')][_0xe2ba('0x29')]);_0x17910e[_0xe2ba('0x27')]=qs[_0xe2ba('0x27')](_0x105551[_0xe2ba('0x35')][_0xe2ba('0x27')]);}return _0x2b9f3f[_0xe2ba('0x52')](_0x17910e);}})[_0xe2ba('0x18')](function(_0x576541){if(_0x576541){return _0x576541?{'count':_0x3ea8ab,'rows':_0x576541}:null;}})[_0xe2ba('0x18')](respondWithResult(_0x32b2da,null))[_0xe2ba('0x22')](handleError(_0x32b2da,null));};exports[_0xe2ba('0x53')]=function(_0x21aa6c,_0x1d1d6b,_0x5c7e7d){var _0x1bd76b={};var _0x1501ce={};var _0x4cec4b;var _0x535507;return db['VtigerConfiguration'][_0xe2ba('0x4f')]({'where':{'id':_0x21aa6c['params']['id']}})[_0xe2ba('0x18')](handleEntityNotFound(_0x1d1d6b,null))[_0xe2ba('0x18')](function(_0x128570){if(_0x128570){_0x4cec4b=_0x128570;_0x1501ce['model']=_[_0xe2ba('0x49')](db[_0xe2ba('0x50')][_0xe2ba('0x31')]);_0x1501ce[_0xe2ba('0x35')]=_['keys'](_0x21aa6c[_0xe2ba('0x35')]);_0x1501ce['filters']=_['intersection'](_0x1501ce['model'],_0x1501ce[_0xe2ba('0x35')]);_0x1bd76b['attributes']=_['intersection'](_0x1501ce[_0xe2ba('0x37')],qs[_0xe2ba('0x39')](_0x21aa6c['query'][_0xe2ba('0x39')]));_0x1bd76b[_0xe2ba('0x38')]=_0x1bd76b[_0xe2ba('0x38')]['length']?_0x1bd76b['attributes']:_0x1501ce[_0xe2ba('0x37')];_0x1bd76b[_0xe2ba('0x51')]=qs[_0xe2ba('0x3d')](_0x21aa6c[_0xe2ba('0x35')][_0xe2ba('0x3d')]);_0x1bd76b[_0xe2ba('0x3e')]=qs[_0xe2ba('0x36')](_[_0xe2ba('0x3f')](_0x21aa6c['query'],_0x1501ce[_0xe2ba('0x36')]));if(_0x21aa6c['query'][_0xe2ba('0x40')]){_0x1bd76b['where']=_[_0xe2ba('0x41')](_0x1bd76b[_0xe2ba('0x3e')],{'$or':_[_0xe2ba('0x42')](_0x1bd76b[_0xe2ba('0x38')],function(_0x551087){var _0x1c1a6b={};_0x1c1a6b[_0x551087]={'$like':'%'+_0x21aa6c[_0xe2ba('0x35')][_0xe2ba('0x40')]+'%'};return _0x1c1a6b;})});}_0x1bd76b=_['merge']({},_0x1bd76b,_0x21aa6c[_0xe2ba('0x44')]);return _0x4cec4b['getDescriptions'](_0x1bd76b);}})[_0xe2ba('0x18')](function(_0x39f962){if(_0x39f962){_0x535507=_0x39f962[_0xe2ba('0x3a')];if(!_0x21aa6c[_0xe2ba('0x35')]['hasOwnProperty']('nolimit')){_0x1bd76b['limit']=qs[_0xe2ba('0x29')](_0x21aa6c['query'][_0xe2ba('0x29')]);_0x1bd76b[_0xe2ba('0x27')]=qs[_0xe2ba('0x27')](_0x21aa6c[_0xe2ba('0x35')][_0xe2ba('0x27')]);}return _0x4cec4b['getDescriptions'](_0x1bd76b);}})['then'](function(_0x596304){if(_0x596304){return _0x596304?{'count':_0x535507,'rows':_0x596304}:null;}})[_0xe2ba('0x18')](respondWithResult(_0x1d1d6b,null))['catch'](handleError(_0x1d1d6b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 1d0a530..c7cc8f7 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 _0x2586=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x2586,0x169));var _0x6258=function(_0xb04c93,_0x311321){_0xb04c93=_0xb04c93-0x0;var _0x41bc02=_0x2586[_0xb04c93];return _0x41bc02;};'use strict';var _=require(_0x6258('0x0'));var util=require(_0x6258('0x1'));var logger=require(_0x6258('0x2'))('api');var moment=require(_0x6258('0x3'));var BPromise=require(_0x6258('0x4'));var rp=require(_0x6258('0x5'));var fs=require('fs');var path=require(_0x6258('0x6'));var rimraf=require(_0x6258('0x7'));var config=require(_0x6258('0x8'));var attributes=require(_0x6258('0x9'));module[_0x6258('0xa')]=function(_0x1c4b8f,_0xa2395b){return _0x1c4b8f[_0x6258('0xb')](_0x6258('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25c9=['request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','../../config/logger','api','moment'];(function(_0x31a119,_0x17e6ca){var _0x2d6e6a=function(_0x3faa80){while(--_0x3faa80){_0x31a119['push'](_0x31a119['shift']());}};_0x2d6e6a(++_0x17e6ca);}(_0x25c9,0x1dc));var _0x925c=function(_0x415f89,_0x279cbe){_0x415f89=_0x415f89-0x0;var _0x4cc7f0=_0x25c9[_0x415f89];return _0x4cc7f0;};'use strict';var _=require(_0x925c('0x0'));var util=require('util');var logger=require(_0x925c('0x1'))(_0x925c('0x2'));var moment=require(_0x925c('0x3'));var BPromise=require('bluebird');var rp=require(_0x925c('0x4'));var fs=require('fs');var path=require(_0x925c('0x5'));var rimraf=require(_0x925c('0x6'));var config=require(_0x925c('0x7'));var attributes=require(_0x925c('0x8'));module[_0x925c('0x9')]=function(_0x5c4433,_0x297874){return _0x5c4433[_0x925c('0xa')](_0x925c('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 73d14a8..5b2190f 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 _0x9162=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x21558d,_0x4fd784){var _0x4eb5f7=function(_0x2ec466){while(--_0x2ec466){_0x21558d['push'](_0x21558d['shift']());}};_0x4eb5f7(++_0x4fd784);}(_0x9162,0x138));var _0x2916=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x9162[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x2916('0x0'));var util=require(_0x2916('0x1'));var moment=require(_0x2916('0x2'));var BPromise=require(_0x2916('0x3'));var rs=require(_0x2916('0x4'));var fs=require('fs');var Redis=require(_0x2916('0x5'));var db=require(_0x2916('0x6'))['db'];var utils=require(_0x2916('0x7'));var logger=require(_0x2916('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2916('0x9'));var client=jayson[_0x2916('0xa')][_0x2916('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x575f45,_0x1423ba,_0x4c1b59){return new BPromise(function(_0x4b2a62,_0x26f18d){return client[_0x2916('0xc')](_0x575f45,_0x4c1b59)[_0x2916('0xd')](function(_0x270b41){logger[_0x2916('0xe')](_0x2916('0xf'),_0x1423ba,_0x2916('0x10'));logger[_0x2916('0x11')](_0x2916('0x12'),_0x1423ba,'request\x20sent',JSON[_0x2916('0x13')](_0x270b41));if(_0x270b41[_0x2916('0x14')]){if(_0x270b41[_0x2916('0x14')]['code']===0x1f4){logger[_0x2916('0x14')](_0x2916('0xf'),_0x1423ba,_0x270b41[_0x2916('0x14')][_0x2916('0x15')]);return _0x26f18d(_0x270b41[_0x2916('0x14')][_0x2916('0x15')]);}logger[_0x2916('0x14')](_0x2916('0xf'),_0x1423ba,_0x270b41[_0x2916('0x14')]['message']);return _0x4b2a62(_0x270b41[_0x2916('0x14')]['message']);}else{logger[_0x2916('0xe')](_0x2916('0xf'),_0x1423ba,_0x2916('0x10'));_0x4b2a62(_0x270b41[_0x2916('0x16')][_0x2916('0x15')]);}})[_0x2916('0x17')](function(_0x5c69b0){logger['error'](_0x2916('0xf'),_0x1423ba,_0x5c69b0);_0x26f18d(_0x5c69b0);});});} \ No newline at end of file +var _0x0bda=['../../config/utils','../../config/environment','http','request','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0bda,0x1d8));var _0xa0bd=function(_0x262b4f,_0x4b8118){_0x262b4f=_0x262b4f-0x0;var _0x4e8db7=_0x0bda[_0x262b4f];return _0x4e8db7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa0bd('0x0'));var rs=require(_0xa0bd('0x1'));var fs=require('fs');var Redis=require(_0xa0bd('0x2'));var db=require(_0xa0bd('0x3'))['db'];var utils=require(_0xa0bd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa0bd('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa0bd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4c7f70,_0x4835bc,_0x4768c8){return new BPromise(function(_0x1e3ab8,_0xbd818d){return client[_0xa0bd('0x7')](_0x4c7f70,_0x4768c8)['then'](function(_0x2e73b3){logger[_0xa0bd('0x8')]('VtigerConfiguration,\x20%s,\x20%s',_0x4835bc,_0xa0bd('0x9'));logger[_0xa0bd('0xa')](_0xa0bd('0xb'),_0x4835bc,'request\x20sent',JSON['stringify'](_0x2e73b3));if(_0x2e73b3['error']){if(_0x2e73b3[_0xa0bd('0xc')]['code']===0x1f4){logger[_0xa0bd('0xc')](_0xa0bd('0xd'),_0x4835bc,_0x2e73b3['error'][_0xa0bd('0xe')]);return _0xbd818d(_0x2e73b3[_0xa0bd('0xc')][_0xa0bd('0xe')]);}logger[_0xa0bd('0xc')](_0xa0bd('0xd'),_0x4835bc,_0x2e73b3[_0xa0bd('0xc')][_0xa0bd('0xe')]);return _0x1e3ab8(_0x2e73b3['error'][_0xa0bd('0xe')]);}else{logger[_0xa0bd('0x8')]('VtigerConfiguration,\x20%s,\x20%s',_0x4835bc,_0xa0bd('0x9'));_0x1e3ab8(_0x2e73b3[_0xa0bd('0xf')][_0xa0bd('0xe')]);}})[_0xa0bd('0x10')](function(_0x5e44d5){logger['error'](_0xa0bd('0xd'),_0x4835bc,_0x5e44d5);_0xbd818d(_0x5e44d5);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d61afbc..f36dc39 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 _0xf654=['delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x231d02,_0x28b7f2){var _0x29aa92=function(_0x53541c){while(--_0x53541c){_0x231d02['push'](_0x231d02['shift']());}};_0x29aa92(++_0x28b7f2);}(_0xf654,0x146));var _0x4f65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf654[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4f65('0x0'));var express=require(_0x4f65('0x1'));var router=express[_0x4f65('0x2')]();var fs_extra=require(_0x4f65('0x3'));var auth=require(_0x4f65('0x4'));var interaction=require(_0x4f65('0x5'));var config=require(_0x4f65('0x6'));var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4f65('0x7')]);router[_0x4f65('0x8')](_0x4f65('0x9'),auth[_0x4f65('0xa')](),controller[_0x4f65('0xb')]);router[_0x4f65('0xc')]('/',auth[_0x4f65('0xa')](),controller[_0x4f65('0xd')]);router[_0x4f65('0xe')](_0x4f65('0x9'),auth[_0x4f65('0xa')](),controller[_0x4f65('0xf')]);router[_0x4f65('0x10')]('/:id',auth[_0x4f65('0xa')](),controller[_0x4f65('0x11')]);module[_0x4f65('0x12')]=router; \ No newline at end of file +var _0xfa45=['put','/:id','delete','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','isAuthenticated','show','post'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0xfa45,0x113));var _0x5fa4=function(_0x3f181d,_0x14f217){_0x3f181d=_0x3f181d-0x0;var _0x37d246=_0xfa45[_0x3f181d];return _0x37d246;};'use strict';var multer=require(_0x5fa4('0x0'));var util=require(_0x5fa4('0x1'));var path=require(_0x5fa4('0x2'));var timeout=require(_0x5fa4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5fa4('0x4'));var interaction=require(_0x5fa4('0x5'));var config=require(_0x5fa4('0x6'));var controller=require(_0x5fa4('0x7'));router[_0x5fa4('0x8')]('/',auth['isAuthenticated'](),controller[_0x5fa4('0x9')]);router['get']('/:id',auth[_0x5fa4('0xa')](),controller[_0x5fa4('0xb')]);router[_0x5fa4('0xc')]('/',auth[_0x5fa4('0xa')](),controller['create']);router[_0x5fa4('0xd')](_0x5fa4('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5fa4('0xf')]('/:id',auth[_0x5fa4('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 9235cc9..5fd7b08 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 _0x1cee=['variable','customVariable','keyValue','STRING','ENUM','string','BOOLEAN','sequelize'];(function(_0x28cefb,_0x4c294c){var _0x2c251e=function(_0x35ad3c){while(--_0x35ad3c){_0x28cefb['push'](_0x28cefb['shift']());}};_0x2c251e(++_0x4c294c);}(_0x1cee,0x1df));var _0xe1ce=function(_0x5c2b4c,_0x348620){_0x5c2b4c=_0x5c2b4c-0x0;var _0x567ba5=_0x1cee[_0x5c2b4c];return _0x567ba5;};'use strict';var Sequelize=require(_0xe1ce('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xe1ce('0x1'),_0xe1ce('0x2'),_0xe1ce('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe1ce('0x4')]},'keyType':{'type':Sequelize[_0xe1ce('0x5')](_0xe1ce('0x6'),_0xe1ce('0x1'),_0xe1ce('0x2'))},'keyContent':{'type':Sequelize[_0xe1ce('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe1ce('0x4')]},'customField':{'type':Sequelize[_0xe1ce('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe1ce('0x4')]}}; \ No newline at end of file +var _0xaf4c=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x409742,_0x1c2b98){var _0x3fee58=function(_0x3b1125){while(--_0x3b1125){_0x409742['push'](_0x409742['shift']());}};_0x3fee58(++_0x1c2b98);}(_0xaf4c,0xdb));var _0xcaf4=function(_0x2b2678,_0xa66908){_0x2b2678=_0x2b2678-0x0;var _0x2d60b1=_0xaf4c[_0x2b2678];return _0x2d60b1;};'use strict';var Sequelize=require(_0xcaf4('0x0'));module[_0xcaf4('0x1')]={'type':{'type':Sequelize[_0xcaf4('0x2')](_0xcaf4('0x3'),_0xcaf4('0x4'),_0xcaf4('0x5'),_0xcaf4('0x6'),_0xcaf4('0x7')),'defaultValue':_0xcaf4('0x3')},'content':{'type':Sequelize[_0xcaf4('0x8')]},'key':{'type':Sequelize[_0xcaf4('0x8')]},'keyType':{'type':Sequelize[_0xcaf4('0x2')](_0xcaf4('0x3'),_0xcaf4('0x4'),_0xcaf4('0x5'))},'keyContent':{'type':Sequelize[_0xcaf4('0x8')]},'idField':{'type':Sequelize[_0xcaf4('0x8')]},'nameField':{'type':Sequelize[_0xcaf4('0x8')]},'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 ad6c0b8..bedaff4 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 _0x8e12=['pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e12,0x191));var _0x28e1=function(_0x58c578,_0xb9c575){_0x58c578=_0x58c578-0x0;var _0x219f47=_0x8e12[_0x58c578];return _0x219f47;};'use strict';var emlformat=require(_0x28e1('0x0'));var rimraf=require(_0x28e1('0x1'));var zipdir=require(_0x28e1('0x2'));var jsonpatch=require(_0x28e1('0x3'));var rp=require(_0x28e1('0x4'));var moment=require(_0x28e1('0x5'));var BPromise=require(_0x28e1('0x6'));var Mustache=require('mustache');var util=require(_0x28e1('0x7'));var path=require(_0x28e1('0x8'));var sox=require(_0x28e1('0x9'));var csv=require(_0x28e1('0xa'));var ejs=require(_0x28e1('0xb'));var fs=require('fs');var fs_extra=require(_0x28e1('0xc'));var _=require('lodash');var squel=require(_0x28e1('0xd'));var crypto=require('crypto');var jsforce=require(_0x28e1('0xe'));var deskjs=require(_0x28e1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28e1('0x10'));var Papa=require(_0x28e1('0x11'));var Redis=require(_0x28e1('0x12'));var authService=require(_0x28e1('0x13'));var qs=require(_0x28e1('0x14'));var as=require(_0x28e1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x28e1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x28e1('0x17'))['db'];function respondWithStatusCode(_0x3c4db9,_0x44f6c1){_0x44f6c1=_0x44f6c1||0xcc;return function(_0x4ae44e){if(_0x4ae44e){return _0x3c4db9['sendStatus'](_0x44f6c1);}return _0x3c4db9[_0x28e1('0x18')](_0x44f6c1)[_0x28e1('0x19')]();};}function respondWithResult(_0x3850e4,_0x22d8ed){_0x22d8ed=_0x22d8ed||0xc8;return function(_0x12e114){if(_0x12e114){return _0x3850e4[_0x28e1('0x18')](_0x22d8ed)[_0x28e1('0x1a')](_0x12e114);}};}function respondWithFilteredResult(_0x3e11bd,_0x1211d7){return function(_0x1119f5){if(_0x1119f5){var _0x590c5d=typeof _0x1211d7[_0x28e1('0x1b')]===_0x28e1('0x1c')&&typeof _0x1211d7[_0x28e1('0x1d')]===_0x28e1('0x1c');var _0x15df1b=_0x1119f5[_0x28e1('0x1e')];var _0x48262e=_0x590c5d?0x0:_0x1211d7[_0x28e1('0x1b')];var _0x3b988b=_0x590c5d?_0x1119f5[_0x28e1('0x1e')]:_0x1211d7[_0x28e1('0x1b')]+_0x1211d7[_0x28e1('0x1d')];var _0x463e13;if(_0x3b988b>=_0x15df1b){_0x3b988b=_0x15df1b;_0x463e13=0xc8;}else{_0x463e13=0xce;}_0x3e11bd[_0x28e1('0x18')](_0x463e13);return _0x3e11bd[_0x28e1('0x1f')]('Content-Range',_0x48262e+'-'+_0x3b988b+'/'+_0x15df1b)[_0x28e1('0x1a')](_0x1119f5);}return null;};}function patchUpdates(_0x4a6e22){return function(_0x22012d){try{jsonpatch[_0x28e1('0x20')](_0x22012d,_0x4a6e22,!![]);}catch(_0x3bdc60){return BPromise[_0x28e1('0x21')](_0x3bdc60);}return _0x22012d[_0x28e1('0x22')]();};}function saveUpdates(_0x4b578a,_0x90ab2a){return function(_0x3bfb7e){if(_0x3bfb7e){return _0x3bfb7e[_0x28e1('0x23')](_0x4b578a)[_0x28e1('0x24')](function(_0x16fc14){return _0x16fc14;});}return null;};}function removeEntity(_0x587bef,_0x40fd8c){return function(_0x28d605){if(_0x28d605){return _0x28d605['destroy']()['then'](function(){_0x587bef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x402776,_0x36f272){return function(_0x1ec27d){if(!_0x1ec27d){_0x402776['sendStatus'](0x194);}return _0x1ec27d;};}function handleError(_0x343b34,_0x34ff87){_0x34ff87=_0x34ff87||0x1f4;return function(_0x456a91){logger[_0x28e1('0x25')](_0x456a91[_0x28e1('0x26')]);if(_0x456a91[_0x28e1('0x27')]){delete _0x456a91[_0x28e1('0x27')];}_0x343b34[_0x28e1('0x18')](_0x34ff87)[_0x28e1('0x28')](_0x456a91);};}exports[_0x28e1('0x29')]=function(_0x293358,_0x3da202){var _0x439778={},_0x1b3fe6={},_0x4eefcf={'count':0x0,'rows':[]};var _0x344ac8=_[_0x28e1('0x2a')](db[_0x28e1('0x2b')][_0x28e1('0x2c')],function(_0x349db2){return{'name':_0x349db2[_0x28e1('0x2d')],'type':_0x349db2[_0x28e1('0x2e')][_0x28e1('0x2f')]};});_0x1b3fe6[_0x28e1('0x30')]=_[_0x28e1('0x2a')](_0x344ac8,_0x28e1('0x27'));_0x1b3fe6[_0x28e1('0x31')]=_[_0x28e1('0x32')](_0x293358[_0x28e1('0x31')]);_0x1b3fe6[_0x28e1('0x33')]=_[_0x28e1('0x34')](_0x1b3fe6[_0x28e1('0x30')],_0x1b3fe6['query']);_0x439778[_0x28e1('0x35')]=_[_0x28e1('0x34')](_0x1b3fe6[_0x28e1('0x30')],qs[_0x28e1('0x36')](_0x293358[_0x28e1('0x31')][_0x28e1('0x36')]));_0x439778[_0x28e1('0x35')]=_0x439778['attributes'][_0x28e1('0x37')]?_0x439778[_0x28e1('0x35')]:_0x1b3fe6[_0x28e1('0x30')];if(!_0x293358[_0x28e1('0x31')][_0x28e1('0x38')](_0x28e1('0x39'))){_0x439778[_0x28e1('0x1d')]=qs['limit'](_0x293358[_0x28e1('0x31')][_0x28e1('0x1d')]);_0x439778['offset']=qs[_0x28e1('0x1b')](_0x293358[_0x28e1('0x31')]['offset']);}_0x439778[_0x28e1('0x3a')]=qs[_0x28e1('0x3b')](_0x293358[_0x28e1('0x31')][_0x28e1('0x3b')]);_0x439778[_0x28e1('0x3c')]=qs[_0x28e1('0x33')](_[_0x28e1('0x3d')](_0x293358['query'],_0x1b3fe6['filters']),_0x344ac8);if(_0x293358[_0x28e1('0x31')][_0x28e1('0x3e')]){_0x439778[_0x28e1('0x3c')]=_['merge'](_0x439778[_0x28e1('0x3c')],{'$or':_[_0x28e1('0x2a')](_0x344ac8,function(_0x227936){if(_0x227936[_0x28e1('0x2e')]!==_0x28e1('0x3f')){var _0x3300fe={};_0x3300fe[_0x227936['name']]={'$like':'%'+_0x293358[_0x28e1('0x31')][_0x28e1('0x3e')]+'%'};return _0x3300fe;}})});}_0x439778=_[_0x28e1('0x40')]({},_0x439778,_0x293358['options']);var _0x9befac={'where':_0x439778['where']};return db['VtigerField'][_0x28e1('0x1e')](_0x9befac)[_0x28e1('0x24')](function(_0x2d0271){_0x4eefcf[_0x28e1('0x1e')]=_0x2d0271;if(_0x293358['query'][_0x28e1('0x41')]){_0x439778[_0x28e1('0x42')]=[{'all':!![]}];}return db[_0x28e1('0x2b')][_0x28e1('0x43')](_0x439778);})['then'](function(_0x2a689a){_0x4eefcf[_0x28e1('0x44')]=_0x2a689a;return _0x4eefcf;})[_0x28e1('0x24')](respondWithFilteredResult(_0x3da202,_0x439778))[_0x28e1('0x45')](handleError(_0x3da202,null));};exports[_0x28e1('0x46')]=function(_0x4cafe3,_0x1fee51){var _0x134b7a={'raw':!![],'where':{'id':_0x4cafe3[_0x28e1('0x47')]['id']}},_0x36d8d9={};_0x36d8d9[_0x28e1('0x30')]=_['keys'](db[_0x28e1('0x2b')]['rawAttributes']);_0x36d8d9[_0x28e1('0x31')]=_[_0x28e1('0x32')](_0x4cafe3['query']);_0x36d8d9[_0x28e1('0x33')]=_['intersection'](_0x36d8d9[_0x28e1('0x30')],_0x36d8d9[_0x28e1('0x31')]);_0x134b7a[_0x28e1('0x35')]=_['intersection'](_0x36d8d9[_0x28e1('0x30')],qs['fields'](_0x4cafe3[_0x28e1('0x31')][_0x28e1('0x36')]));_0x134b7a['attributes']=_0x134b7a['attributes'][_0x28e1('0x37')]?_0x134b7a['attributes']:_0x36d8d9[_0x28e1('0x30')];if(_0x4cafe3['query'][_0x28e1('0x41')]){_0x134b7a[_0x28e1('0x42')]=[{'all':!![]}];}_0x134b7a=_[_0x28e1('0x40')]({},_0x134b7a,_0x4cafe3[_0x28e1('0x48')]);return db[_0x28e1('0x2b')][_0x28e1('0x49')](_0x134b7a)[_0x28e1('0x24')](handleEntityNotFound(_0x1fee51,null))['then'](respondWithResult(_0x1fee51,null))['catch'](handleError(_0x1fee51,null));};exports[_0x28e1('0x4a')]=function(_0x46fd20,_0x4d0abd){return db[_0x28e1('0x2b')][_0x28e1('0x4a')](_0x46fd20[_0x28e1('0x4b')],{})[_0x28e1('0x24')](respondWithResult(_0x4d0abd,0xc9))[_0x28e1('0x45')](handleError(_0x4d0abd,null));};exports[_0x28e1('0x23')]=function(_0x13ef2c,_0x17beef){if(_0x13ef2c[_0x28e1('0x4b')]['id']){delete _0x13ef2c[_0x28e1('0x4b')]['id'];}return db[_0x28e1('0x2b')]['find']({'where':{'id':_0x13ef2c[_0x28e1('0x47')]['id']}})[_0x28e1('0x24')](handleEntityNotFound(_0x17beef,null))[_0x28e1('0x24')](saveUpdates(_0x13ef2c[_0x28e1('0x4b')],null))['then'](respondWithResult(_0x17beef,null))[_0x28e1('0x45')](handleError(_0x17beef,null));};exports[_0x28e1('0x4c')]=function(_0x5a870a,_0x502fab){return db[_0x28e1('0x2b')][_0x28e1('0x49')]({'where':{'id':_0x5a870a[_0x28e1('0x47')]['id']}})['then'](handleEntityNotFound(_0x502fab,null))[_0x28e1('0x24')](removeEntity(_0x502fab,null))[_0x28e1('0x45')](handleError(_0x502fab,null));}; \ No newline at end of file +var _0x8579=['then','findAll','rows','catch','show','params','filters','includeAll','include','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','error','name','send','index','VtigerField','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x8579,0x9d));var _0x9857=function(_0x256ea8,_0x35de49){_0x256ea8=_0x256ea8-0x0;var _0x4e8ac5=_0x8579[_0x256ea8];return _0x4e8ac5;};'use strict';var emlformat=require(_0x9857('0x0'));var rimraf=require(_0x9857('0x1'));var zipdir=require(_0x9857('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9857('0x3'));var moment=require(_0x9857('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9857('0x5'));var util=require(_0x9857('0x6'));var path=require('path');var sox=require(_0x9857('0x7'));var csv=require(_0x9857('0x8'));var ejs=require(_0x9857('0x9'));var fs=require('fs');var fs_extra=require(_0x9857('0xa'));var _=require('lodash');var squel=require(_0x9857('0xb'));var crypto=require(_0x9857('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9857('0x8'));var querystring=require(_0x9857('0xd'));var Papa=require(_0x9857('0xe'));var Redis=require(_0x9857('0xf'));var authService=require(_0x9857('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9857('0x11'));var hardwareService=require(_0x9857('0x12'));var logger=require('../../config/logger')(_0x9857('0x13'));var utils=require(_0x9857('0x14'));var config=require(_0x9857('0x15'));var licenseUtil=require(_0x9857('0x16'));var db=require(_0x9857('0x17'))['db'];function respondWithStatusCode(_0x416d0c,_0x592033){_0x592033=_0x592033||0xcc;return function(_0x41f2b0){if(_0x41f2b0){return _0x416d0c[_0x9857('0x18')](_0x592033);}return _0x416d0c[_0x9857('0x19')](_0x592033)[_0x9857('0x1a')]();};}function respondWithResult(_0x520e39,_0x492334){_0x492334=_0x492334||0xc8;return function(_0xafa971){if(_0xafa971){return _0x520e39[_0x9857('0x19')](_0x492334)[_0x9857('0x1b')](_0xafa971);}};}function respondWithFilteredResult(_0xbbe9b8,_0x4c96f0){return function(_0xdc3b8a){if(_0xdc3b8a){var _0x27ca41=typeof _0x4c96f0[_0x9857('0x1c')]==='undefined'&&typeof _0x4c96f0['limit']===_0x9857('0x1d');var _0xfddeb7=_0xdc3b8a[_0x9857('0x1e')];var _0x17566f=_0x27ca41?0x0:_0x4c96f0[_0x9857('0x1c')];var _0x34a57d=_0x27ca41?_0xdc3b8a[_0x9857('0x1e')]:_0x4c96f0[_0x9857('0x1c')]+_0x4c96f0[_0x9857('0x1f')];var _0x26426c;if(_0x34a57d>=_0xfddeb7){_0x34a57d=_0xfddeb7;_0x26426c=0xc8;}else{_0x26426c=0xce;}_0xbbe9b8[_0x9857('0x19')](_0x26426c);return _0xbbe9b8[_0x9857('0x20')](_0x9857('0x21'),_0x17566f+'-'+_0x34a57d+'/'+_0xfddeb7)[_0x9857('0x1b')](_0xdc3b8a);}return null;};}function patchUpdates(_0x55c5d1){return function(_0x9f08a9){try{jsonpatch['apply'](_0x9f08a9,_0x55c5d1,!![]);}catch(_0x4dd136){return BPromise['reject'](_0x4dd136);}return _0x9f08a9[_0x9857('0x22')]();};}function saveUpdates(_0x11b51f,_0x3cf394){return function(_0x1312ac){if(_0x1312ac){return _0x1312ac['update'](_0x11b51f)['then'](function(_0x48c0cb){return _0x48c0cb;});}return null;};}function removeEntity(_0x2a4b74,_0x2ba230){return function(_0xa1036){if(_0xa1036){return _0xa1036['destroy']()['then'](function(){_0x2a4b74[_0x9857('0x19')](0xcc)[_0x9857('0x1a')]();});}};}function handleEntityNotFound(_0x4d0e8e,_0x149081){return function(_0x386242){if(!_0x386242){_0x4d0e8e[_0x9857('0x18')](0x194);}return _0x386242;};}function handleError(_0xc2d08,_0x2e0263){_0x2e0263=_0x2e0263||0x1f4;return function(_0x189d0c){logger[_0x9857('0x23')](_0x189d0c['stack']);if(_0x189d0c[_0x9857('0x24')]){delete _0x189d0c['name'];}_0xc2d08[_0x9857('0x19')](_0x2e0263)[_0x9857('0x25')](_0x189d0c);};}exports[_0x9857('0x26')]=function(_0x36606c,_0x17e39b){var _0xb814a={},_0x3651ee={},_0x582606={'count':0x0,'rows':[]};var _0x35b9d5=_['map'](db[_0x9857('0x27')][_0x9857('0x28')],function(_0x5f32b4){return{'name':_0x5f32b4['fieldName'],'type':_0x5f32b4[_0x9857('0x29')][_0x9857('0x2a')]};});_0x3651ee[_0x9857('0x2b')]=_[_0x9857('0x2c')](_0x35b9d5,_0x9857('0x24'));_0x3651ee[_0x9857('0x2d')]=_[_0x9857('0x2e')](_0x36606c[_0x9857('0x2d')]);_0x3651ee['filters']=_[_0x9857('0x2f')](_0x3651ee[_0x9857('0x2b')],_0x3651ee[_0x9857('0x2d')]);_0xb814a[_0x9857('0x30')]=_[_0x9857('0x2f')](_0x3651ee['model'],qs[_0x9857('0x31')](_0x36606c[_0x9857('0x2d')]['fields']));_0xb814a[_0x9857('0x30')]=_0xb814a['attributes'][_0x9857('0x32')]?_0xb814a['attributes']:_0x3651ee[_0x9857('0x2b')];if(!_0x36606c[_0x9857('0x2d')][_0x9857('0x33')](_0x9857('0x34'))){_0xb814a['limit']=qs['limit'](_0x36606c[_0x9857('0x2d')][_0x9857('0x1f')]);_0xb814a['offset']=qs[_0x9857('0x1c')](_0x36606c[_0x9857('0x2d')][_0x9857('0x1c')]);}_0xb814a['order']=qs[_0x9857('0x35')](_0x36606c['query'][_0x9857('0x35')]);_0xb814a[_0x9857('0x36')]=qs['filters'](_[_0x9857('0x37')](_0x36606c['query'],_0x3651ee['filters']),_0x35b9d5);if(_0x36606c[_0x9857('0x2d')][_0x9857('0x38')]){_0xb814a[_0x9857('0x36')]=_[_0x9857('0x39')](_0xb814a['where'],{'$or':_[_0x9857('0x2c')](_0x35b9d5,function(_0x2cfe09){if(_0x2cfe09['type']!==_0x9857('0x3a')){var _0x21c958={};_0x21c958[_0x2cfe09[_0x9857('0x24')]]={'$like':'%'+_0x36606c[_0x9857('0x2d')][_0x9857('0x38')]+'%'};return _0x21c958;}})});}_0xb814a=_[_0x9857('0x39')]({},_0xb814a,_0x36606c['options']);var _0x6b7c00={'where':_0xb814a[_0x9857('0x36')]};return db[_0x9857('0x27')][_0x9857('0x1e')](_0x6b7c00)[_0x9857('0x3b')](function(_0x245e77){_0x582606[_0x9857('0x1e')]=_0x245e77;if(_0x36606c['query']['includeAll']){_0xb814a['include']=[{'all':!![]}];}return db['VtigerField'][_0x9857('0x3c')](_0xb814a);})[_0x9857('0x3b')](function(_0x26ea4d){_0x582606[_0x9857('0x3d')]=_0x26ea4d;return _0x582606;})[_0x9857('0x3b')](respondWithFilteredResult(_0x17e39b,_0xb814a))[_0x9857('0x3e')](handleError(_0x17e39b,null));};exports[_0x9857('0x3f')]=function(_0x159e73,_0xb1bcf6){var _0x2a9687={'raw':!![],'where':{'id':_0x159e73[_0x9857('0x40')]['id']}},_0x49862d={};_0x49862d[_0x9857('0x2b')]=_[_0x9857('0x2e')](db[_0x9857('0x27')][_0x9857('0x28')]);_0x49862d[_0x9857('0x2d')]=_[_0x9857('0x2e')](_0x159e73[_0x9857('0x2d')]);_0x49862d[_0x9857('0x41')]=_[_0x9857('0x2f')](_0x49862d[_0x9857('0x2b')],_0x49862d['query']);_0x2a9687[_0x9857('0x30')]=_['intersection'](_0x49862d[_0x9857('0x2b')],qs[_0x9857('0x31')](_0x159e73[_0x9857('0x2d')][_0x9857('0x31')]));_0x2a9687[_0x9857('0x30')]=_0x2a9687[_0x9857('0x30')][_0x9857('0x32')]?_0x2a9687[_0x9857('0x30')]:_0x49862d[_0x9857('0x2b')];if(_0x159e73['query'][_0x9857('0x42')]){_0x2a9687[_0x9857('0x43')]=[{'all':!![]}];}_0x2a9687=_[_0x9857('0x39')]({},_0x2a9687,_0x159e73[_0x9857('0x44')]);return db[_0x9857('0x27')][_0x9857('0x45')](_0x2a9687)['then'](handleEntityNotFound(_0xb1bcf6,null))[_0x9857('0x3b')](respondWithResult(_0xb1bcf6,null))[_0x9857('0x3e')](handleError(_0xb1bcf6,null));};exports['create']=function(_0x3db93b,_0x5b6f22){return db[_0x9857('0x27')][_0x9857('0x46')](_0x3db93b[_0x9857('0x47')],{})[_0x9857('0x3b')](respondWithResult(_0x5b6f22,0xc9))[_0x9857('0x3e')](handleError(_0x5b6f22,null));};exports['update']=function(_0xc91802,_0x402bd5){if(_0xc91802[_0x9857('0x47')]['id']){delete _0xc91802['body']['id'];}return db[_0x9857('0x27')][_0x9857('0x45')]({'where':{'id':_0xc91802[_0x9857('0x40')]['id']}})[_0x9857('0x3b')](handleEntityNotFound(_0x402bd5,null))[_0x9857('0x3b')](saveUpdates(_0xc91802['body'],null))['then'](respondWithResult(_0x402bd5,null))['catch'](handleError(_0x402bd5,null));};exports['destroy']=function(_0x1d5cbc,_0x569d91){return db[_0x9857('0x27')][_0x9857('0x45')]({'where':{'id':_0x1d5cbc['params']['id']}})[_0x9857('0x3b')](handleEntityNotFound(_0x569d91,null))[_0x9857('0x3b')](removeEntity(_0x569d91,null))[_0x9857('0x3e')](handleError(_0x569d91,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d594282..d3c1a3e 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 _0x06dc=['util','api','moment','bluebird','path','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x06dc,0xd1));var _0xc06d=function(_0x361e5d,_0x15e1a4){_0x361e5d=_0x361e5d-0x0;var _0x4c303d=_0x06dc[_0x361e5d];return _0x4c303d;};'use strict';var _=require(_0xc06d('0x0'));var util=require(_0xc06d('0x1'));var logger=require('../../config/logger')(_0xc06d('0x2'));var moment=require(_0xc06d('0x3'));var BPromise=require(_0xc06d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc06d('0x5'));var rimraf=require('rimraf');var config=require(_0xc06d('0x6'));var attributes=require(_0xc06d('0x7'));module[_0xc06d('0x8')]=function(_0x10654d,_0x2672db){return _0x10654d['define'](_0xc06d('0x9'),attributes,{'tableName':_0xc06d('0xa'),'paranoid':![],'indexes':[{'name':_0xc06d('0xb'),'fields':[_0xc06d('0xc'),_0xc06d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x499a=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x577011,_0x30cce1){var _0x52b00e=function(_0x2e7897){while(--_0x2e7897){_0x577011['push'](_0x577011['shift']());}};_0x52b00e(++_0x30cce1);}(_0x499a,0xaf));var _0xa499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x499a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa499('0x0'));var logger=require(_0xa499('0x1'))(_0xa499('0x2'));var moment=require(_0xa499('0x3'));var BPromise=require(_0xa499('0x4'));var rp=require(_0xa499('0x5'));var fs=require('fs');var path=require(_0xa499('0x6'));var rimraf=require(_0xa499('0x7'));var config=require(_0xa499('0x8'));var attributes=require(_0xa499('0x9'));module[_0xa499('0xa')]=function(_0x41ea2d,_0x141022){return _0x41ea2d[_0xa499('0xb')](_0xa499('0xc'),attributes,{'tableName':_0xa499('0xd'),'paranoid':![],'indexes':[{'name':_0xa499('0xe'),'fields':[_0xa499('0xf'),_0xa499('0x10')],'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 4dfe055..ecaa0c2 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 _0x0257=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2c94ed,_0x2d1010){var _0x11af16=function(_0x5b5480){while(--_0x5b5480){_0x2c94ed['push'](_0x2c94ed['shift']());}};_0x11af16(++_0x2d1010);}(_0x0257,0x104));var _0x7025=function(_0x44f315,_0x5a799f){_0x44f315=_0x44f315-0x0;var _0x20478e=_0x0257[_0x44f315];return _0x20478e;};'use strict';var _=require(_0x7025('0x0'));var util=require(_0x7025('0x1'));var moment=require(_0x7025('0x2'));var BPromise=require(_0x7025('0x3'));var rs=require(_0x7025('0x4'));var fs=require('fs');var Redis=require(_0x7025('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7025('0x6'));var logger=require(_0x7025('0x7'))(_0x7025('0x8'));var config=require(_0x7025('0x9'));var jayson=require(_0x7025('0xa'));var client=jayson[_0x7025('0xb')][_0x7025('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19cb6e,_0x88099f,_0x3240bc){return new BPromise(function(_0x24a0dc,_0xe34541){return client['request'](_0x19cb6e,_0x3240bc)[_0x7025('0xd')](function(_0x2d50b2){logger[_0x7025('0xe')](_0x7025('0xf'),_0x88099f,_0x7025('0x10'));logger[_0x7025('0x11')](_0x7025('0x12'),_0x88099f,_0x7025('0x10'),JSON[_0x7025('0x13')](_0x2d50b2));if(_0x2d50b2[_0x7025('0x14')]){if(_0x2d50b2['error'][_0x7025('0x15')]===0x1f4){logger[_0x7025('0x14')](_0x7025('0xf'),_0x88099f,_0x2d50b2[_0x7025('0x14')][_0x7025('0x16')]);return _0xe34541(_0x2d50b2['error'][_0x7025('0x16')]);}logger[_0x7025('0x14')](_0x7025('0xf'),_0x88099f,_0x2d50b2[_0x7025('0x14')][_0x7025('0x16')]);return _0x24a0dc(_0x2d50b2['error']['message']);}else{logger[_0x7025('0xe')](_0x7025('0xf'),_0x88099f,_0x7025('0x10'));_0x24a0dc(_0x2d50b2[_0x7025('0x17')][_0x7025('0x16')]);}})[_0x7025('0x18')](function(_0x272cdc){logger['error'](_0x7025('0xf'),_0x88099f,_0x272cdc);_0xe34541(_0x272cdc);});});} \ No newline at end of file +var _0x83c7=['request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x83c7,0xc4));var _0x783c=function(_0xfd7fc5,_0x4d8717){_0xfd7fc5=_0xfd7fc5-0x0;var _0x476949=_0x83c7[_0xfd7fc5];return _0x476949;};'use strict';var _=require(_0x783c('0x0'));var util=require(_0x783c('0x1'));var moment=require(_0x783c('0x2'));var BPromise=require(_0x783c('0x3'));var rs=require(_0x783c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x783c('0x5'))['db'];var utils=require(_0x783c('0x6'));var logger=require(_0x783c('0x7'))(_0x783c('0x8'));var config=require(_0x783c('0x9'));var jayson=require(_0x783c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x239f79,_0x1eb26e,_0x3ca847){return new BPromise(function(_0xb9b7dd,_0x357203){return client[_0x783c('0xb')](_0x239f79,_0x3ca847)['then'](function(_0x31323c){logger[_0x783c('0xc')](_0x783c('0xd'),_0x1eb26e,_0x783c('0xe'));logger[_0x783c('0xf')](_0x783c('0x10'),_0x1eb26e,'request\x20sent',JSON[_0x783c('0x11')](_0x31323c));if(_0x31323c[_0x783c('0x12')]){if(_0x31323c['error'][_0x783c('0x13')]===0x1f4){logger[_0x783c('0x12')]('VtigerField,\x20%s,\x20%s',_0x1eb26e,_0x31323c[_0x783c('0x12')][_0x783c('0x14')]);return _0x357203(_0x31323c[_0x783c('0x12')][_0x783c('0x14')]);}logger[_0x783c('0x12')](_0x783c('0xd'),_0x1eb26e,_0x31323c[_0x783c('0x12')][_0x783c('0x14')]);return _0xb9b7dd(_0x31323c[_0x783c('0x12')][_0x783c('0x14')]);}else{logger[_0x783c('0xc')]('VtigerField,\x20%s,\x20%s',_0x1eb26e,_0x783c('0xe'));_0xb9b7dd(_0x31323c[_0x783c('0x15')]['message']);}})[_0x783c('0x16')](function(_0x3579ca){logger[_0x783c('0x12')](_0x783c('0xd'),_0x1eb26e,_0x3579ca);_0x357203(_0x3579ca);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 71b9d45..0101654 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 _0x9ad9=['put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x9ad9,0x1a8));var _0x99ad=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x9ad9[_0x16629d];return _0x56ccee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x99ad('0x0'));var timeout=require(_0x99ad('0x1'));var express=require(_0x99ad('0x2'));var router=express[_0x99ad('0x3')]();var fs_extra=require(_0x99ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x99ad('0x5'));var config=require(_0x99ad('0x6'));var controller=require(_0x99ad('0x7'));router[_0x99ad('0x8')]('/',auth[_0x99ad('0x9')](),controller[_0x99ad('0xa')]);router[_0x99ad('0x8')](_0x99ad('0xb'),auth['isAuthenticated'](),controller[_0x99ad('0xc')]);router[_0x99ad('0x8')](_0x99ad('0xd'),auth[_0x99ad('0x9')](),controller[_0x99ad('0xe')]);router['get']('/:id/fields',auth[_0x99ad('0x9')](),controller['getFields']);router[_0x99ad('0xf')]('/',auth['isAuthenticated'](),controller[_0x99ad('0x10')]);router['post'](_0x99ad('0xd'),auth[_0x99ad('0x9')](),controller['addConfiguration']);router[_0x99ad('0x11')](_0x99ad('0xb'),auth['isAuthenticated'](),controller[_0x99ad('0x12')]);router[_0x99ad('0x13')](_0x99ad('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x99ad('0x14')]=router; \ No newline at end of file +var _0x7ed3=['post','create','put','update','delete','destroy','exports','multer','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x568238,_0x4a1765){var _0x2474f6=function(_0x4da1d0){while(--_0x4da1d0){_0x568238['push'](_0x568238['shift']());}};_0x2474f6(++_0x4a1765);}(_0x7ed3,0x137));var _0x37ed=function(_0x1c7838,_0x33237a){_0x1c7838=_0x1c7838-0x0;var _0x2c0754=_0x7ed3[_0x1c7838];return _0x2c0754;};'use strict';var multer=require(_0x37ed('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37ed('0x1'));var interaction=require(_0x37ed('0x2'));var config=require(_0x37ed('0x3'));var controller=require('./intZendeskAccount.controller');router[_0x37ed('0x4')]('/',auth[_0x37ed('0x5')](),controller['index']);router['get'](_0x37ed('0x6'),auth[_0x37ed('0x5')](),controller[_0x37ed('0x7')]);router[_0x37ed('0x4')](_0x37ed('0x8'),auth[_0x37ed('0x5')](),controller[_0x37ed('0x9')]);router['get'](_0x37ed('0xa'),auth[_0x37ed('0x5')](),controller[_0x37ed('0xb')]);router[_0x37ed('0xc')]('/',auth[_0x37ed('0x5')](),controller[_0x37ed('0xd')]);router[_0x37ed('0xc')](_0x37ed('0x8'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x37ed('0xe')](_0x37ed('0x6'),auth[_0x37ed('0x5')](),controller[_0x37ed('0xf')]);router[_0x37ed('0x10')](_0x37ed('0x6'),auth[_0x37ed('0x5')](),controller[_0x37ed('0x11')]);module[_0x37ed('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index d1285fb..8e12086 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 _0xaa64=['ENUM','password','token','integrationTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x20cf7e,_0x54c9e8){var _0x2a7427=function(_0x2993d5){while(--_0x2993d5){_0x20cf7e['push'](_0x20cf7e['shift']());}};_0x2a7427(++_0x54c9e8);}(_0xaa64,0xf7));var _0x4aa6=function(_0xfdab07,_0x2220b4){_0xfdab07=_0xfdab07-0x0;var _0x34b9c4=_0xaa64[_0xfdab07];return _0x34b9c4;};'use strict';var Sequelize=require(_0x4aa6('0x0'));module[_0x4aa6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4aa6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4aa6('0x3')},'password':{'type':Sequelize[_0x4aa6('0x2')]},'token':{'type':Sequelize[_0x4aa6('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4aa6('0x4')},'authType':{'type':Sequelize[_0x4aa6('0x5')](_0x4aa6('0x6'),_0x4aa6('0x7')),'defaultValue':_0x4aa6('0x6')},'serverUrl':{'type':Sequelize[_0x4aa6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4aa6('0x5')]('integrationTab','newTab'),'defaultValue':_0x4aa6('0x8')}}; \ No newline at end of file +var _0xcf71=['username','remoteUri','ENUM','password','token','integrationTab','sequelize','exports','STRING'];(function(_0x15df2b,_0x537eab){var _0x2f6662=function(_0x43bff9){while(--_0x43bff9){_0x15df2b['push'](_0x15df2b['shift']());}};_0x2f6662(++_0x537eab);}(_0xcf71,0xba));var _0x1cf7=function(_0x43d604,_0x38a6d3){_0x43d604=_0x43d604-0x0;var _0x2f0f74=_0xcf71[_0x43d604];return _0x2f0f74;};'use strict';var Sequelize=require(_0x1cf7('0x0'));module[_0x1cf7('0x1')]={'name':{'type':Sequelize[_0x1cf7('0x2')]},'description':{'type':Sequelize[_0x1cf7('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1cf7('0x3')},'password':{'type':Sequelize[_0x1cf7('0x2')]},'token':{'type':Sequelize[_0x1cf7('0x2')]},'remoteUri':{'type':Sequelize[_0x1cf7('0x2')],'unique':_0x1cf7('0x4')},'authType':{'type':Sequelize[_0x1cf7('0x5')](_0x1cf7('0x6'),_0x1cf7('0x7')),'defaultValue':_0x1cf7('0x6')},'serverUrl':{'type':Sequelize[_0x1cf7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1cf7('0x5')](_0x1cf7('0x8'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index c133a1b..dfae0ac 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 _0xb66a=['title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','includeAll','find','create','body','params','ZendeskConfiguration','nolimit','getConfigurations','addConfiguration','findOne','Subjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','password','token','authType','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','username','toString','base64','headers','%s/token:%s','Sequelize','ValidationError','subject','description','group','remove','includes','position'];(function(_0x280364,_0x3d81ab){var _0x2eaa58=function(_0x7341df){while(--_0x7341df){_0x280364['push'](_0x280364['shift']());}};_0x2eaa58(++_0x3d81ab);}(_0xb66a,0x102));var _0xab66=function(_0x1853d3,_0x2f473c){_0x1853d3=_0x1853d3-0x0;var _0x2d6a0e=_0xb66a[_0x1853d3];return _0x2d6a0e;};'use strict';var emlformat=require(_0xab66('0x0'));var rimraf=require(_0xab66('0x1'));var zipdir=require(_0xab66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab66('0x3'));var BPromise=require(_0xab66('0x4'));var Mustache=require('mustache');var util=require(_0xab66('0x5'));var path=require(_0xab66('0x6'));var sox=require(_0xab66('0x7'));var csv=require('to-csv');var ejs=require(_0xab66('0x8'));var fs=require('fs');var fs_extra=require(_0xab66('0x9'));var _=require('lodash');var squel=require(_0xab66('0xa'));var crypto=require(_0xab66('0xb'));var jsforce=require(_0xab66('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab66('0xd'));var Papa=require(_0xab66('0xe'));var Redis=require(_0xab66('0xf'));var authService=require(_0xab66('0x10'));var qs=require(_0xab66('0x11'));var as=require(_0xab66('0x12'));var hardwareService=require(_0xab66('0x13'));var logger=require(_0xab66('0x14'))('api');var utils=require(_0xab66('0x15'));var config=require(_0xab66('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xab66('0x17'))['db'];var integrations=require(_0xab66('0x18'));var jayson=require(_0xab66('0x19'));var client=jayson['client'][_0xab66('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xd3075e,_0x593bbb,_0x563f55,_0x27c19b){return new BPromise(function(_0x243f8b,_0x39e226){var _0x25f4fc=_0x27c19b||client;return _0x25f4fc[_0xab66('0x1b')](_0xd3075e,_0x563f55)[_0xab66('0x1c')](function(_0x4da51d){logger[_0xab66('0x1d')](_0xab66('0x1e'),_0x593bbb,_0xab66('0x1f'));logger[_0xab66('0x20')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x593bbb,_0xab66('0x1f'),JSON[_0xab66('0x21')](_0x4da51d));if(_0x4da51d[_0xab66('0x22')]){if(_0x4da51d['error']['code']===0x1f4){logger[_0xab66('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x593bbb,_0x4da51d['error']['message']);return _0x39e226(_0x4da51d[_0xab66('0x22')]['message']);}logger[_0xab66('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x593bbb,_0x4da51d[_0xab66('0x22')][_0xab66('0x23')]);return _0x243f8b(_0x4da51d['error'][_0xab66('0x23')]);}else{logger[_0xab66('0x1d')](_0xab66('0x1e'),_0x593bbb,'request\x20sent');_0x243f8b(_0x4da51d[_0xab66('0x24')]['message']);}})[_0xab66('0x25')](function(_0x234c27){logger[_0xab66('0x22')](_0xab66('0x1e'),_0x593bbb,_0x234c27);_0x39e226(_0x234c27);});});}function respondWithStatusCode(_0x3444fc,_0x4f4c5b){_0x4f4c5b=_0x4f4c5b||0xcc;return function(_0x48ed20){if(_0x48ed20){return _0x3444fc[_0xab66('0x26')](_0x4f4c5b);}return _0x3444fc[_0xab66('0x27')](_0x4f4c5b)[_0xab66('0x28')]();};}function respondWithResult(_0x565c71,_0x30ff12){_0x30ff12=_0x30ff12||0xc8;return function(_0x1ee28f){if(_0x1ee28f){return _0x565c71[_0xab66('0x27')](_0x30ff12)['json'](_0x1ee28f);}};}function respondWithFilteredResult(_0x3a1554,_0x594156){return function(_0x164450){if(_0x164450){var _0x14e014=typeof _0x594156[_0xab66('0x29')]===_0xab66('0x2a')&&typeof _0x594156[_0xab66('0x2b')]==='undefined';var _0x23e546=_0x164450[_0xab66('0x2c')];var _0x271ac1=_0x14e014?0x0:_0x594156['offset'];var _0x4dd40c=_0x14e014?_0x164450['count']:_0x594156[_0xab66('0x29')]+_0x594156[_0xab66('0x2b')];var _0x983d5b;if(_0x4dd40c>=_0x23e546){_0x4dd40c=_0x23e546;_0x983d5b=0xc8;}else{_0x983d5b=0xce;}_0x3a1554[_0xab66('0x27')](_0x983d5b);return _0x3a1554[_0xab66('0x2d')](_0xab66('0x2e'),_0x271ac1+'-'+_0x4dd40c+'/'+_0x23e546)[_0xab66('0x2f')](_0x164450);}return null;};}function patchUpdates(_0x24805c){return function(_0x38a1d7){try{jsonpatch['apply'](_0x38a1d7,_0x24805c,!![]);}catch(_0x19f574){return BPromise['reject'](_0x19f574);}return _0x38a1d7[_0xab66('0x30')]();};}function saveUpdates(_0x20342c,_0x2f43ff){return function(_0x51abb9){if(_0x51abb9){return _0x51abb9[_0xab66('0x31')](_0x20342c)['then'](function(_0x2636c3){return _0x2636c3;});}return null;};}function removeEntity(_0x48a98f,_0xd41739){return function(_0x552ba){if(_0x552ba){return _0x552ba[_0xab66('0x32')]()['then'](function(){_0x48a98f[_0xab66('0x27')](0xcc)[_0xab66('0x28')]();});}};}function handleEntityNotFound(_0xa3bc77,_0x24ad95){return function(_0x52c871){if(!_0x52c871){_0xa3bc77[_0xab66('0x26')](0x194);}return _0x52c871;};}function handleError(_0x5bf50a,_0x481d3f){_0x481d3f=_0x481d3f||0x1f4;return function(_0x20f5fa){logger['error'](_0x20f5fa[_0xab66('0x33')]);if(_0x20f5fa[_0xab66('0x34')]){delete _0x20f5fa[_0xab66('0x34')];}_0x5bf50a[_0xab66('0x27')](_0x481d3f)[_0xab66('0x35')](_0x20f5fa);};}exports[_0xab66('0x36')]=function(_0x394326,_0xfaa6b1){var _0x5eeeb9={},_0x51d68f={},_0x5b3af7={'count':0x0,'rows':[]};var _0x142c51=_[_0xab66('0x37')](db[_0xab66('0x38')][_0xab66('0x39')],function(_0x17d459){return{'name':_0x17d459['fieldName'],'type':_0x17d459['type'][_0xab66('0x3a')]};});_0x51d68f[_0xab66('0x3b')]=_[_0xab66('0x37')](_0x142c51,_0xab66('0x34'));_0x51d68f[_0xab66('0x3c')]=_[_0xab66('0x3d')](_0x394326['query']);_0x51d68f['filters']=_[_0xab66('0x3e')](_0x51d68f[_0xab66('0x3b')],_0x51d68f[_0xab66('0x3c')]);_0x5eeeb9[_0xab66('0x3f')]=_[_0xab66('0x3e')](_0x51d68f[_0xab66('0x3b')],qs['fields'](_0x394326[_0xab66('0x3c')][_0xab66('0x40')]));_0x5eeeb9[_0xab66('0x3f')]=_0x5eeeb9['attributes'][_0xab66('0x41')]?_0x5eeeb9[_0xab66('0x3f')]:_0x51d68f[_0xab66('0x3b')];if(!_0x394326['query'][_0xab66('0x42')]('nolimit')){_0x5eeeb9[_0xab66('0x2b')]=qs[_0xab66('0x2b')](_0x394326[_0xab66('0x3c')]['limit']);_0x5eeeb9[_0xab66('0x29')]=qs[_0xab66('0x29')](_0x394326[_0xab66('0x3c')]['offset']);}_0x5eeeb9[_0xab66('0x43')]=qs['sort'](_0x394326['query'][_0xab66('0x44')]);_0x5eeeb9[_0xab66('0x45')]=qs[_0xab66('0x46')](_[_0xab66('0x47')](_0x394326['query'],_0x51d68f[_0xab66('0x46')]),_0x142c51);if(_0x394326['query'][_0xab66('0x48')]){_0x5eeeb9['where']=_[_0xab66('0x49')](_0x5eeeb9[_0xab66('0x45')],{'$or':_[_0xab66('0x37')](_0x142c51,function(_0x12539f){if(_0x12539f[_0xab66('0x4a')]!==_0xab66('0x4b')){var _0x4fa031={};_0x4fa031[_0x12539f[_0xab66('0x34')]]={'$like':'%'+_0x394326[_0xab66('0x3c')][_0xab66('0x48')]+'%'};return _0x4fa031;}})});}_0x5eeeb9=_[_0xab66('0x49')]({},_0x5eeeb9,_0x394326[_0xab66('0x4c')]);var _0x4177e7={'where':_0x5eeeb9['where']};return db['ZendeskAccount'][_0xab66('0x2c')](_0x4177e7)[_0xab66('0x1c')](function(_0x4eec94){_0x5b3af7[_0xab66('0x2c')]=_0x4eec94;if(_0x394326[_0xab66('0x3c')]['includeAll']){_0x5eeeb9[_0xab66('0x4d')]=[{'all':!![]}];}return db[_0xab66('0x38')][_0xab66('0x4e')](_0x5eeeb9);})[_0xab66('0x1c')](function(_0x5c0c9b){_0x5b3af7[_0xab66('0x4f')]=_0x5c0c9b;return _0x5b3af7;})[_0xab66('0x1c')](respondWithFilteredResult(_0xfaa6b1,_0x5eeeb9))[_0xab66('0x25')](handleError(_0xfaa6b1,null));};exports[_0xab66('0x50')]=function(_0x1da31d,_0x53b6c3){var _0x5ce4a8={'raw':![],'where':{'id':_0x1da31d['params']['id']}},_0x467ebd={};_0x467ebd['model']=_['keys'](db[_0xab66('0x38')][_0xab66('0x39')]);_0x467ebd['query']=_['keys'](_0x1da31d[_0xab66('0x3c')]);_0x467ebd[_0xab66('0x46')]=_[_0xab66('0x3e')](_0x467ebd[_0xab66('0x3b')],_0x467ebd['query']);_0x5ce4a8[_0xab66('0x3f')]=_['intersection'](_0x467ebd['model'],qs[_0xab66('0x40')](_0x1da31d[_0xab66('0x3c')][_0xab66('0x40')]));_0x5ce4a8[_0xab66('0x3f')]=_0x5ce4a8[_0xab66('0x3f')][_0xab66('0x41')]?_0x5ce4a8[_0xab66('0x3f')]:_0x467ebd['model'];if(_0x1da31d[_0xab66('0x3c')][_0xab66('0x51')]){_0x5ce4a8['include']=[{'all':!![]}];}_0x5ce4a8=_['merge']({},_0x5ce4a8,_0x1da31d[_0xab66('0x4c')]);return db[_0xab66('0x38')][_0xab66('0x52')](_0x5ce4a8)[_0xab66('0x1c')](handleEntityNotFound(_0x53b6c3,null))[_0xab66('0x1c')](respondWithResult(_0x53b6c3,null))[_0xab66('0x25')](handleError(_0x53b6c3,null));};exports[_0xab66('0x53')]=function(_0x4f1fc0,_0x1a0a18){return db[_0xab66('0x38')][_0xab66('0x53')](_0x4f1fc0[_0xab66('0x54')],{})[_0xab66('0x1c')](respondWithResult(_0x1a0a18,0xc9))[_0xab66('0x25')](handleError(_0x1a0a18,null));};exports[_0xab66('0x31')]=function(_0x446149,_0x4b9bbd){if(_0x446149[_0xab66('0x54')]['id']){delete _0x446149[_0xab66('0x54')]['id'];}return db[_0xab66('0x38')][_0xab66('0x52')]({'where':{'id':_0x446149[_0xab66('0x55')]['id']}})['then'](handleEntityNotFound(_0x4b9bbd,null))[_0xab66('0x1c')](saveUpdates(_0x446149['body'],null))[_0xab66('0x1c')](respondWithResult(_0x4b9bbd,null))['catch'](handleError(_0x4b9bbd,null));};exports['destroy']=function(_0x595cdc,_0x4473e8){return db[_0xab66('0x38')][_0xab66('0x52')]({'where':{'id':_0x595cdc[_0xab66('0x55')]['id']}})['then'](handleEntityNotFound(_0x4473e8,null))[_0xab66('0x1c')](removeEntity(_0x4473e8,null))['catch'](handleError(_0x4473e8,null));};exports['getConfigurations']=function(_0x459f58,_0x2f3226,_0x2ce2fd){var _0x1835c3={};var _0x203daf={};var _0x5722aa;var _0x53dd29;return db[_0xab66('0x38')]['findOne']({'where':{'id':_0x459f58[_0xab66('0x55')]['id']}})[_0xab66('0x1c')](handleEntityNotFound(_0x2f3226,null))[_0xab66('0x1c')](function(_0x5d522e){if(_0x5d522e){_0x5722aa=_0x5d522e;_0x203daf[_0xab66('0x3b')]=_['keys'](db[_0xab66('0x56')][_0xab66('0x39')]);_0x203daf[_0xab66('0x3c')]=_[_0xab66('0x3d')](_0x459f58[_0xab66('0x3c')]);_0x203daf[_0xab66('0x46')]=_['intersection'](_0x203daf['model'],_0x203daf['query']);_0x1835c3[_0xab66('0x3f')]=_[_0xab66('0x3e')](_0x203daf[_0xab66('0x3b')],qs[_0xab66('0x40')](_0x459f58[_0xab66('0x3c')]['fields']));_0x1835c3[_0xab66('0x3f')]=_0x1835c3['attributes'][_0xab66('0x41')]?_0x1835c3['attributes']:_0x203daf[_0xab66('0x3b')];_0x1835c3['order']=qs[_0xab66('0x44')](_0x459f58[_0xab66('0x3c')][_0xab66('0x44')]);_0x1835c3['where']=qs[_0xab66('0x46')](_[_0xab66('0x47')](_0x459f58[_0xab66('0x3c')],_0x203daf[_0xab66('0x46')]));if(_0x459f58[_0xab66('0x3c')]['filter']){_0x1835c3['where']=_[_0xab66('0x49')](_0x1835c3[_0xab66('0x45')],{'$or':_[_0xab66('0x37')](_0x1835c3[_0xab66('0x3f')],function(_0x3bfa7c){var _0x327552={};_0x327552[_0x3bfa7c]={'$like':'%'+_0x459f58[_0xab66('0x3c')][_0xab66('0x48')]+'%'};return _0x327552;})});}_0x1835c3=_[_0xab66('0x49')]({},_0x1835c3,_0x459f58[_0xab66('0x4c')]);return _0x5722aa['getConfigurations'](_0x1835c3);}})[_0xab66('0x1c')](function(_0x2ff8c3){if(_0x2ff8c3){_0x53dd29=_0x2ff8c3['length'];if(!_0x459f58[_0xab66('0x3c')][_0xab66('0x42')](_0xab66('0x57'))){_0x1835c3[_0xab66('0x2b')]=qs['limit'](_0x459f58[_0xab66('0x3c')]['limit']);_0x1835c3[_0xab66('0x29')]=qs[_0xab66('0x29')](_0x459f58[_0xab66('0x3c')][_0xab66('0x29')]);}return _0x5722aa[_0xab66('0x58')](_0x1835c3);}})[_0xab66('0x1c')](function(_0x1ba1ed){if(_0x1ba1ed){return _0x1ba1ed?{'count':_0x53dd29,'rows':_0x1ba1ed}:null;}})['then'](respondWithResult(_0x2f3226,null))[_0xab66('0x25')](handleError(_0x2f3226,null));};exports[_0xab66('0x59')]=function(_0x5428c5,_0x494ce7,_0x1eae0d){if(_0x5428c5['body']['id']){delete _0x5428c5[_0xab66('0x54')]['id'];}return db[_0xab66('0x38')][_0xab66('0x5a')]({'where':{'id':_0x5428c5[_0xab66('0x55')]['id']}})[_0xab66('0x1c')](handleEntityNotFound(_0x494ce7,null))[_0xab66('0x1c')](function(_0xe47d70){if(_0xe47d70){_0x5428c5['body']['AccountId']=_0xe47d70['id'];_0x5428c5[_0xab66('0x54')][_0xab66('0x5b')]=integrations['getSubjects'](_0x5428c5[_0xab66('0x54')][_0xab66('0x5c')],_0x5428c5[_0xab66('0x54')]['type']);_0x5428c5[_0xab66('0x54')]['Descriptions']=integrations[_0xab66('0x5d')](_0x5428c5[_0xab66('0x54')][_0xab66('0x5c')],_0x5428c5[_0xab66('0x54')][_0xab66('0x4a')]);return db['ZendeskConfiguration'][_0xab66('0x53')](_0x5428c5[_0xab66('0x54')],{'include':[{'model':db[_0xab66('0x5e')],'as':_0xab66('0x5b')},{'model':db[_0xab66('0x5e')],'as':_0xab66('0x5f')}]});}return null;})[_0xab66('0x1c')](respondWithResult(_0x494ce7,null))[_0xab66('0x25')](handleError(_0x494ce7,null));};exports[_0xab66('0x60')]=function(_0x547252,_0x192142,_0x4c2e1f){var _0xc64e1b='';return db[_0xab66('0x38')][_0xab66('0x5a')]({'where':{'id':_0x547252[_0xab66('0x55')]['id']},'attributes':['id','username',_0xab66('0x61'),_0xab66('0x62'),_0xab66('0x63'),'remoteUri']})['then'](handleEntityNotFound(_0x192142,null))['then'](function(_0x41f112){if(_0x41f112){_0xc64e1b=_0x41f112['remoteUri'];var _0x1377e9=_0xc64e1b['slice'](-0x1);if(_0x1377e9==='/'){_0xc64e1b=_0xc64e1b[_0xab66('0x64')](0x0,_0xc64e1b[_0xab66('0x65')](_0x1377e9));}var _0x14e55d={'method':_0xab66('0x66'),'uri':util[_0xab66('0x67')](_0xab66('0x68'),_0xc64e1b,_0xab66('0x69')),'json':!![]};switch(_0x41f112['authType']){case'password':_0x14e55d['headers']={'Authorization':util['format'](_0xab66('0x6a'),new Buffer(util[_0xab66('0x67')]('%s:%s',_0x41f112[_0xab66('0x6b')],_0x41f112[_0xab66('0x61')]))[_0xab66('0x6c')](_0xab66('0x6d')))};break;case _0xab66('0x62'):_0x14e55d[_0xab66('0x6e')]={'Authorization':util['format'](_0xab66('0x6a'),new Buffer(util[_0xab66('0x67')](_0xab66('0x6f'),_0x41f112['username'],_0x41f112['token']))[_0xab66('0x6c')]('base64'))};break;default:throw new db[(_0xab66('0x70'))][(_0xab66('0x71'))]('Unknown\x20authentication\x20type');}return rp(_0x14e55d);}})[_0xab66('0x1c')](function(_0x103025){if(_0x103025){var _0x31188a=[_0xab66('0x72'),_0xab66('0x73'),_0xab66('0x74'),'assignee'];_[_0xab66('0x75')](_0x103025[_0xab66('0x69')],function(_0x14fe5f){return _0x31188a[_0xab66('0x76')](_0x14fe5f['type']);});return{'count':_0x103025[_0xab66('0x69')][_0xab66('0x41')],'rows':_['map'](_0x103025[_0xab66('0x69')],function(_0x49f9f6){return{'id':_0x49f9f6['id'],'name':_0x49f9f6[_0xab66('0x77')]>0x7?_0x49f9f6[_0xab66('0x78')]:_0x49f9f6[_0xab66('0x4a')],'custom':_0x49f9f6[_0xab66('0x77')]>0x7?!![]:![],'options':_0x49f9f6['system_field_options']?_0x49f9f6[_0xab66('0x79')]:_0x49f9f6[_0xab66('0x7a')]?_0x49f9f6[_0xab66('0x7a')]:[]};})};}})[_0xab66('0x1c')](respondWithResult(_0x192142,null))[_0xab66('0x25')](function(_0x4fbd54){var _0x1bc8fa=_0x547252[_0xab66('0x3c')][_0xab66('0x7b')]?0x1f4:_0x4fbd54[_0xab66('0x7c')]||0x1f4;logger[_0xab66('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xab66('0x60'),_0x1bc8fa,JSON[_0xab66('0x21')](_0x4fbd54));delete _0x4fbd54['name'];if(_0x1bc8fa===0x191){_0x1bc8fa=0x190;}_0x192142[_0xab66('0x27')](_0x1bc8fa)[_0xab66('0x35')](_0x547252[_0xab66('0x3c')]['test']?{'message':_0xab66('0x7d'),'statusCode':_0x4fbd54[_0xab66('0x7c')]}:_0x4fbd54);});}; \ No newline at end of file +var _0x7639=['intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ZendeskAccount','includeAll','include','show','params','rawAttributes','find','body','findOne','ZendeskConfiguration','getConfigurations','length','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','create','ZendeskField','Subjects','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','base64','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','update','destroy','stack','name','index','map','model','query','keys','filters'];(function(_0x4d058e,_0x20c78b){var _0x31501c=function(_0xd8d3d6){while(--_0xd8d3d6){_0x4d058e['push'](_0x4d058e['shift']());}};_0x31501c(++_0x20c78b);}(_0x7639,0x140));var _0x9763=function(_0x1eae0a,_0x54e5a3){_0x1eae0a=_0x1eae0a-0x0;var _0x1f251d=_0x7639[_0x1eae0a];return _0x1f251d;};'use strict';var emlformat=require(_0x9763('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9763('0x1'));var jsonpatch=require(_0x9763('0x2'));var rp=require(_0x9763('0x3'));var moment=require(_0x9763('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9763('0x5'));var util=require(_0x9763('0x6'));var path=require(_0x9763('0x7'));var sox=require(_0x9763('0x8'));var csv=require(_0x9763('0x9'));var ejs=require(_0x9763('0xa'));var fs=require('fs');var fs_extra=require(_0x9763('0xb'));var _=require('lodash');var squel=require(_0x9763('0xc'));var crypto=require(_0x9763('0xd'));var jsforce=require(_0x9763('0xe'));var deskjs=require(_0x9763('0xf'));var toCsv=require(_0x9763('0x9'));var querystring=require(_0x9763('0x10'));var Papa=require(_0x9763('0x11'));var Redis=require(_0x9763('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9763('0x13'));var as=require(_0x9763('0x14'));var hardwareService=require(_0x9763('0x15'));var logger=require(_0x9763('0x16'))('api');var utils=require(_0x9763('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9763('0x18'));var db=require(_0x9763('0x19'))['db'];var integrations=require(_0x9763('0x1a'));var jayson=require(_0x9763('0x1b'));var client=jayson['client'][_0x9763('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x25f0b4,_0x2b42b0,_0x341075,_0x3cfeb5){return new BPromise(function(_0x5bbb93,_0x4f9f6d){var _0x2ccece=_0x3cfeb5||client;return _0x2ccece[_0x9763('0x1d')](_0x25f0b4,_0x341075)[_0x9763('0x1e')](function(_0x4dbc56){logger['info'](_0x9763('0x1f'),_0x2b42b0,_0x9763('0x20'));logger[_0x9763('0x21')](_0x9763('0x22'),_0x2b42b0,_0x9763('0x20'),JSON['stringify'](_0x4dbc56));if(_0x4dbc56['error']){if(_0x4dbc56['error'][_0x9763('0x23')]===0x1f4){logger[_0x9763('0x24')](_0x9763('0x1f'),_0x2b42b0,_0x4dbc56['error'][_0x9763('0x25')]);return _0x4f9f6d(_0x4dbc56[_0x9763('0x24')]['message']);}logger[_0x9763('0x24')](_0x9763('0x1f'),_0x2b42b0,_0x4dbc56['error'][_0x9763('0x25')]);return _0x5bbb93(_0x4dbc56['error'][_0x9763('0x25')]);}else{logger['info'](_0x9763('0x1f'),_0x2b42b0,_0x9763('0x20'));_0x5bbb93(_0x4dbc56['result'][_0x9763('0x25')]);}})[_0x9763('0x26')](function(_0x337a3e){logger['error'](_0x9763('0x1f'),_0x2b42b0,_0x337a3e);_0x4f9f6d(_0x337a3e);});});}function respondWithStatusCode(_0x45c2c9,_0x40bee2){_0x40bee2=_0x40bee2||0xcc;return function(_0x225f43){if(_0x225f43){return _0x45c2c9[_0x9763('0x27')](_0x40bee2);}return _0x45c2c9['status'](_0x40bee2)[_0x9763('0x28')]();};}function respondWithResult(_0x3e5215,_0x32bb63){_0x32bb63=_0x32bb63||0xc8;return function(_0x12e0c4){if(_0x12e0c4){return _0x3e5215[_0x9763('0x29')](_0x32bb63)[_0x9763('0x2a')](_0x12e0c4);}};}function respondWithFilteredResult(_0x58e668,_0x944f7e){return function(_0x29b96d){if(_0x29b96d){var _0x4ac107=typeof _0x944f7e[_0x9763('0x2b')]===_0x9763('0x2c')&&typeof _0x944f7e[_0x9763('0x2d')]==='undefined';var _0x21269b=_0x29b96d['count'];var _0x36a5ba=_0x4ac107?0x0:_0x944f7e[_0x9763('0x2b')];var _0x387bd7=_0x4ac107?_0x29b96d[_0x9763('0x2e')]:_0x944f7e[_0x9763('0x2b')]+_0x944f7e[_0x9763('0x2d')];var _0xab4205;if(_0x387bd7>=_0x21269b){_0x387bd7=_0x21269b;_0xab4205=0xc8;}else{_0xab4205=0xce;}_0x58e668[_0x9763('0x29')](_0xab4205);return _0x58e668[_0x9763('0x2f')]('Content-Range',_0x36a5ba+'-'+_0x387bd7+'/'+_0x21269b)[_0x9763('0x2a')](_0x29b96d);}return null;};}function patchUpdates(_0x46fa0a){return function(_0x360cbb){try{jsonpatch['apply'](_0x360cbb,_0x46fa0a,!![]);}catch(_0x17f1f1){return BPromise['reject'](_0x17f1f1);}return _0x360cbb['save']();};}function saveUpdates(_0x50d4e1,_0x16a56a){return function(_0x3ee1d7){if(_0x3ee1d7){return _0x3ee1d7[_0x9763('0x30')](_0x50d4e1)[_0x9763('0x1e')](function(_0x54b0ee){return _0x54b0ee;});}return null;};}function removeEntity(_0x4b9b7f,_0x39eb24){return function(_0x9a5f08){if(_0x9a5f08){return _0x9a5f08[_0x9763('0x31')]()[_0x9763('0x1e')](function(){_0x4b9b7f[_0x9763('0x29')](0xcc)[_0x9763('0x28')]();});}};}function handleEntityNotFound(_0x560fc2,_0x5304da){return function(_0x4dcc85){if(!_0x4dcc85){_0x560fc2[_0x9763('0x27')](0x194);}return _0x4dcc85;};}function handleError(_0x2fc7f6,_0x440f9d){_0x440f9d=_0x440f9d||0x1f4;return function(_0x2e4362){logger[_0x9763('0x24')](_0x2e4362[_0x9763('0x32')]);if(_0x2e4362[_0x9763('0x33')]){delete _0x2e4362[_0x9763('0x33')];}_0x2fc7f6['status'](_0x440f9d)['send'](_0x2e4362);};}exports[_0x9763('0x34')]=function(_0x391651,_0x36160d){var _0x399ea3={},_0x2191e1={},_0x3ce64d={'count':0x0,'rows':[]};var _0x563eb3=_[_0x9763('0x35')](db['ZendeskAccount']['rawAttributes'],function(_0x1a5c49){return{'name':_0x1a5c49['fieldName'],'type':_0x1a5c49['type']['key']};});_0x2191e1[_0x9763('0x36')]=_[_0x9763('0x35')](_0x563eb3,_0x9763('0x33'));_0x2191e1[_0x9763('0x37')]=_[_0x9763('0x38')](_0x391651['query']);_0x2191e1[_0x9763('0x39')]=_[_0x9763('0x3a')](_0x2191e1['model'],_0x2191e1[_0x9763('0x37')]);_0x399ea3['attributes']=_['intersection'](_0x2191e1[_0x9763('0x36')],qs['fields'](_0x391651[_0x9763('0x37')][_0x9763('0x3b')]));_0x399ea3[_0x9763('0x3c')]=_0x399ea3['attributes']['length']?_0x399ea3[_0x9763('0x3c')]:_0x2191e1[_0x9763('0x36')];if(!_0x391651['query']['hasOwnProperty'](_0x9763('0x3d'))){_0x399ea3[_0x9763('0x2d')]=qs[_0x9763('0x2d')](_0x391651['query'][_0x9763('0x2d')]);_0x399ea3['offset']=qs['offset'](_0x391651[_0x9763('0x37')][_0x9763('0x2b')]);}_0x399ea3[_0x9763('0x3e')]=qs[_0x9763('0x3f')](_0x391651['query'][_0x9763('0x3f')]);_0x399ea3[_0x9763('0x40')]=qs[_0x9763('0x39')](_[_0x9763('0x41')](_0x391651[_0x9763('0x37')],_0x2191e1[_0x9763('0x39')]),_0x563eb3);if(_0x391651[_0x9763('0x37')][_0x9763('0x42')]){_0x399ea3[_0x9763('0x40')]=_[_0x9763('0x43')](_0x399ea3[_0x9763('0x40')],{'$or':_['map'](_0x563eb3,function(_0xf3b48f){if(_0xf3b48f[_0x9763('0x44')]!==_0x9763('0x45')){var _0x8e7d8e={};_0x8e7d8e[_0xf3b48f[_0x9763('0x33')]]={'$like':'%'+_0x391651['query'][_0x9763('0x42')]+'%'};return _0x8e7d8e;}})});}_0x399ea3=_[_0x9763('0x43')]({},_0x399ea3,_0x391651[_0x9763('0x46')]);var _0x1dfd94={'where':_0x399ea3[_0x9763('0x40')]};return db[_0x9763('0x47')][_0x9763('0x2e')](_0x1dfd94)[_0x9763('0x1e')](function(_0x1ce038){_0x3ce64d[_0x9763('0x2e')]=_0x1ce038;if(_0x391651['query'][_0x9763('0x48')]){_0x399ea3[_0x9763('0x49')]=[{'all':!![]}];}return db[_0x9763('0x47')]['findAll'](_0x399ea3);})[_0x9763('0x1e')](function(_0x2114d8){_0x3ce64d['rows']=_0x2114d8;return _0x3ce64d;})[_0x9763('0x1e')](respondWithFilteredResult(_0x36160d,_0x399ea3))[_0x9763('0x26')](handleError(_0x36160d,null));};exports[_0x9763('0x4a')]=function(_0x3d384d,_0x140780){var _0xaef78d={'raw':![],'where':{'id':_0x3d384d[_0x9763('0x4b')]['id']}},_0xb6bed6={};_0xb6bed6[_0x9763('0x36')]=_[_0x9763('0x38')](db['ZendeskAccount'][_0x9763('0x4c')]);_0xb6bed6[_0x9763('0x37')]=_[_0x9763('0x38')](_0x3d384d[_0x9763('0x37')]);_0xb6bed6['filters']=_[_0x9763('0x3a')](_0xb6bed6[_0x9763('0x36')],_0xb6bed6[_0x9763('0x37')]);_0xaef78d[_0x9763('0x3c')]=_[_0x9763('0x3a')](_0xb6bed6[_0x9763('0x36')],qs['fields'](_0x3d384d[_0x9763('0x37')][_0x9763('0x3b')]));_0xaef78d['attributes']=_0xaef78d[_0x9763('0x3c')]['length']?_0xaef78d['attributes']:_0xb6bed6[_0x9763('0x36')];if(_0x3d384d[_0x9763('0x37')][_0x9763('0x48')]){_0xaef78d['include']=[{'all':!![]}];}_0xaef78d=_[_0x9763('0x43')]({},_0xaef78d,_0x3d384d['options']);return db['ZendeskAccount'][_0x9763('0x4d')](_0xaef78d)[_0x9763('0x1e')](handleEntityNotFound(_0x140780,null))[_0x9763('0x1e')](respondWithResult(_0x140780,null))[_0x9763('0x26')](handleError(_0x140780,null));};exports['create']=function(_0x19a832,_0x15ea03){return db[_0x9763('0x47')]['create'](_0x19a832[_0x9763('0x4e')],{})[_0x9763('0x1e')](respondWithResult(_0x15ea03,0xc9))[_0x9763('0x26')](handleError(_0x15ea03,null));};exports[_0x9763('0x30')]=function(_0x47e69f,_0x2084bd){if(_0x47e69f[_0x9763('0x4e')]['id']){delete _0x47e69f[_0x9763('0x4e')]['id'];}return db[_0x9763('0x47')][_0x9763('0x4d')]({'where':{'id':_0x47e69f[_0x9763('0x4b')]['id']}})[_0x9763('0x1e')](handleEntityNotFound(_0x2084bd,null))[_0x9763('0x1e')](saveUpdates(_0x47e69f[_0x9763('0x4e')],null))[_0x9763('0x1e')](respondWithResult(_0x2084bd,null))[_0x9763('0x26')](handleError(_0x2084bd,null));};exports['destroy']=function(_0x4266e3,_0xe8f8a6){return db[_0x9763('0x47')][_0x9763('0x4d')]({'where':{'id':_0x4266e3[_0x9763('0x4b')]['id']}})[_0x9763('0x1e')](handleEntityNotFound(_0xe8f8a6,null))[_0x9763('0x1e')](removeEntity(_0xe8f8a6,null))[_0x9763('0x26')](handleError(_0xe8f8a6,null));};exports['getConfigurations']=function(_0x490e24,_0x475a18,_0x46727b){var _0x51bfed={};var _0x14661d={};var _0x5e1e0b;var _0x4fe9b4;return db[_0x9763('0x47')][_0x9763('0x4f')]({'where':{'id':_0x490e24[_0x9763('0x4b')]['id']}})[_0x9763('0x1e')](handleEntityNotFound(_0x475a18,null))[_0x9763('0x1e')](function(_0x3a5cbb){if(_0x3a5cbb){_0x5e1e0b=_0x3a5cbb;_0x14661d['model']=_[_0x9763('0x38')](db[_0x9763('0x50')]['rawAttributes']);_0x14661d[_0x9763('0x37')]=_[_0x9763('0x38')](_0x490e24[_0x9763('0x37')]);_0x14661d['filters']=_[_0x9763('0x3a')](_0x14661d['model'],_0x14661d[_0x9763('0x37')]);_0x51bfed[_0x9763('0x3c')]=_[_0x9763('0x3a')](_0x14661d[_0x9763('0x36')],qs[_0x9763('0x3b')](_0x490e24[_0x9763('0x37')]['fields']));_0x51bfed[_0x9763('0x3c')]=_0x51bfed[_0x9763('0x3c')]['length']?_0x51bfed['attributes']:_0x14661d[_0x9763('0x36')];_0x51bfed[_0x9763('0x3e')]=qs[_0x9763('0x3f')](_0x490e24[_0x9763('0x37')][_0x9763('0x3f')]);_0x51bfed[_0x9763('0x40')]=qs[_0x9763('0x39')](_[_0x9763('0x41')](_0x490e24[_0x9763('0x37')],_0x14661d[_0x9763('0x39')]));if(_0x490e24['query'][_0x9763('0x42')]){_0x51bfed[_0x9763('0x40')]=_[_0x9763('0x43')](_0x51bfed['where'],{'$or':_['map'](_0x51bfed[_0x9763('0x3c')],function(_0x4fcf24){var _0x1d3771={};_0x1d3771[_0x4fcf24]={'$like':'%'+_0x490e24[_0x9763('0x37')][_0x9763('0x42')]+'%'};return _0x1d3771;})});}_0x51bfed=_[_0x9763('0x43')]({},_0x51bfed,_0x490e24[_0x9763('0x46')]);return _0x5e1e0b[_0x9763('0x51')](_0x51bfed);}})[_0x9763('0x1e')](function(_0x3027c5){if(_0x3027c5){_0x4fe9b4=_0x3027c5[_0x9763('0x52')];if(!_0x490e24[_0x9763('0x37')][_0x9763('0x53')](_0x9763('0x3d'))){_0x51bfed[_0x9763('0x2d')]=qs[_0x9763('0x2d')](_0x490e24[_0x9763('0x37')]['limit']);_0x51bfed[_0x9763('0x2b')]=qs[_0x9763('0x2b')](_0x490e24['query'][_0x9763('0x2b')]);}return _0x5e1e0b[_0x9763('0x51')](_0x51bfed);}})[_0x9763('0x1e')](function(_0x363c41){if(_0x363c41){return _0x363c41?{'count':_0x4fe9b4,'rows':_0x363c41}:null;}})[_0x9763('0x1e')](respondWithResult(_0x475a18,null))[_0x9763('0x26')](handleError(_0x475a18,null));};exports[_0x9763('0x54')]=function(_0x25a6ca,_0x4853ec,_0x4f849a){if(_0x25a6ca[_0x9763('0x4e')]['id']){delete _0x25a6ca[_0x9763('0x4e')]['id'];}return db['ZendeskAccount'][_0x9763('0x4f')]({'where':{'id':_0x25a6ca[_0x9763('0x4b')]['id']}})[_0x9763('0x1e')](handleEntityNotFound(_0x4853ec,null))[_0x9763('0x1e')](function(_0x430cb2){if(_0x430cb2){_0x25a6ca[_0x9763('0x4e')]['AccountId']=_0x430cb2['id'];_0x25a6ca[_0x9763('0x4e')]['Subjects']=integrations[_0x9763('0x55')](_0x25a6ca[_0x9763('0x4e')][_0x9763('0x56')],_0x25a6ca[_0x9763('0x4e')][_0x9763('0x44')]);_0x25a6ca['body'][_0x9763('0x57')]=integrations[_0x9763('0x58')](_0x25a6ca[_0x9763('0x4e')][_0x9763('0x56')],_0x25a6ca[_0x9763('0x4e')][_0x9763('0x44')]);return db[_0x9763('0x50')][_0x9763('0x59')](_0x25a6ca[_0x9763('0x4e')],{'include':[{'model':db[_0x9763('0x5a')],'as':_0x9763('0x5b')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x9763('0x1e')](respondWithResult(_0x4853ec,null))[_0x9763('0x26')](handleError(_0x4853ec,null));};exports['getFields']=function(_0x20ebe3,_0x14fb90,_0x2bac03){var _0x496b57='';return db['ZendeskAccount'][_0x9763('0x4f')]({'where':{'id':_0x20ebe3['params']['id']},'attributes':['id','username',_0x9763('0x5c'),_0x9763('0x5d'),_0x9763('0x5e'),'remoteUri']})[_0x9763('0x1e')](handleEntityNotFound(_0x14fb90,null))[_0x9763('0x1e')](function(_0x2fb10f){if(_0x2fb10f){_0x496b57=_0x2fb10f[_0x9763('0x5f')];var _0x360d75=_0x496b57[_0x9763('0x60')](-0x1);if(_0x360d75==='/'){_0x496b57=_0x496b57[_0x9763('0x61')](0x0,_0x496b57[_0x9763('0x62')](_0x360d75));}var _0x4e6b00={'method':_0x9763('0x63'),'uri':util['format']('%s/%s',_0x496b57,_0x9763('0x64')),'json':!![]};switch(_0x2fb10f[_0x9763('0x5e')]){case _0x9763('0x5c'):_0x4e6b00[_0x9763('0x65')]={'Authorization':util[_0x9763('0x66')](_0x9763('0x67'),new Buffer(util[_0x9763('0x66')](_0x9763('0x68'),_0x2fb10f['username'],_0x2fb10f[_0x9763('0x5c')]))[_0x9763('0x69')](_0x9763('0x6a')))};break;case _0x9763('0x5d'):_0x4e6b00['headers']={'Authorization':util[_0x9763('0x66')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x2fb10f[_0x9763('0x6b')],_0x2fb10f[_0x9763('0x5d')]))[_0x9763('0x69')](_0x9763('0x6a')))};break;default:throw new db[(_0x9763('0x6c'))][(_0x9763('0x6d'))](_0x9763('0x6e'));}return rp(_0x4e6b00);}})[_0x9763('0x1e')](function(_0x51582b){if(_0x51582b){var _0x2ed58f=[_0x9763('0x6f'),_0x9763('0x70'),_0x9763('0x71'),_0x9763('0x72')];_[_0x9763('0x73')](_0x51582b[_0x9763('0x64')],function(_0x2ed9e9){return _0x2ed58f[_0x9763('0x74')](_0x2ed9e9[_0x9763('0x44')]);});return{'count':_0x51582b[_0x9763('0x64')][_0x9763('0x52')],'rows':_[_0x9763('0x35')](_0x51582b[_0x9763('0x64')],function(_0x4ac687){return{'id':_0x4ac687['id'],'name':_0x4ac687[_0x9763('0x75')]>0x7?_0x4ac687[_0x9763('0x76')]:_0x4ac687['type'],'custom':_0x4ac687[_0x9763('0x75')]>0x7?!![]:![],'options':_0x4ac687['system_field_options']?_0x4ac687[_0x9763('0x77')]:_0x4ac687[_0x9763('0x78')]?_0x4ac687[_0x9763('0x78')]:[]};})};}})['then'](respondWithResult(_0x14fb90,null))['catch'](function(_0x417a9e){var _0xde3c7d=_0x20ebe3[_0x9763('0x37')][_0x9763('0x79')]?0x1f4:_0x417a9e[_0x9763('0x7a')]||0x1f4;logger['error'](_0x9763('0x7b'),'getFields',_0xde3c7d,JSON[_0x9763('0x7c')](_0x417a9e));delete _0x417a9e[_0x9763('0x33')];if(_0xde3c7d===0x191){_0xde3c7d=0x190;}_0x14fb90[_0x9763('0x29')](_0xde3c7d)[_0x9763('0x7d')](_0x20ebe3[_0x9763('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x417a9e['statusCode']}:_0x417a9e);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 195ca05..b18ed7f 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 _0x9f85=['moment','bluebird','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x3cf418,_0x48945d){var _0x2518cc=function(_0xc83156){while(--_0xc83156){_0x3cf418['push'](_0x3cf418['shift']());}};_0x2518cc(++_0x48945d);}(_0x9f85,0x184));var _0x59f8=function(_0x512f55,_0x42cdce){_0x512f55=_0x512f55-0x0;var _0x19050a=_0x9f85[_0x512f55];return _0x19050a;};'use strict';var _=require(_0x59f8('0x0'));var util=require(_0x59f8('0x1'));var logger=require(_0x59f8('0x2'))(_0x59f8('0x3'));var moment=require(_0x59f8('0x4'));var BPromise=require(_0x59f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x59f8('0x6'));var config=require(_0x59f8('0x7'));var attributes=require(_0x59f8('0x8'));var integrations=require(_0x59f8('0x9'));module[_0x59f8('0xa')]=function(_0x298161,_0x1402fe){return _0x298161[_0x59f8('0xb')](_0x59f8('0xc'),attributes,{'tableName':_0x59f8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe908=['request-promise','path','../../config/environment','./intZendeskAccount.attributes','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x31cd9d,_0x3bb927){var _0x3f7b19=function(_0x5bf0ae){while(--_0x5bf0ae){_0x31cd9d['push'](_0x31cd9d['shift']());}};_0x3f7b19(++_0x3bb927);}(_0xe908,0x10f));var _0x8e90=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xe908[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x8e90('0x0'));var util=require(_0x8e90('0x1'));var logger=require(_0x8e90('0x2'))(_0x8e90('0x3'));var moment=require(_0x8e90('0x4'));var BPromise=require('bluebird');var rp=require(_0x8e90('0x5'));var fs=require('fs');var path=require(_0x8e90('0x6'));var rimraf=require('rimraf');var config=require(_0x8e90('0x7'));var attributes=require(_0x8e90('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8e90('0x9')]=function(_0x3a9b37,_0x29e879){return _0x3a9b37[_0x8e90('0xa')]('ZendeskAccount',attributes,{'tableName':_0x8e90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 820fb5c..2cefd16 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 _0x9772=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','model','include','map','ShowZendeskAccount','find','raw','lodash','bluebird','ioredis'];(function(_0x26e2d9,_0x55f20f){var _0x496105=function(_0x2e78ca){while(--_0x2e78ca){_0x26e2d9['push'](_0x26e2d9['shift']());}};_0x496105(++_0x55f20f);}(_0x9772,0x189));var _0x2977=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x9772[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x2977('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2977('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2977('0x2'));var db=require(_0x2977('0x3'))['db'];var utils=require(_0x2977('0x4'));var logger=require(_0x2977('0x5'))(_0x2977('0x6'));var config=require('../../config/environment');var jayson=require(_0x2977('0x7'));var client=jayson[_0x2977('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43b555,_0x473577,_0x4e0567){return new BPromise(function(_0x1df08f,_0x1ac290){return client[_0x2977('0x9')](_0x43b555,_0x4e0567)[_0x2977('0xa')](function(_0x271450){logger[_0x2977('0xb')](_0x2977('0xc'),_0x473577,_0x2977('0xd'));logger[_0x2977('0xe')](_0x2977('0xf'),_0x473577,_0x2977('0xd'),JSON[_0x2977('0x10')](_0x271450));if(_0x271450['error']){if(_0x271450['error']['code']===0x1f4){logger[_0x2977('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x473577,_0x271450[_0x2977('0x11')][_0x2977('0x12')]);return _0x1ac290(_0x271450[_0x2977('0x11')]['message']);}logger[_0x2977('0x11')](_0x2977('0xc'),_0x473577,_0x271450[_0x2977('0x11')]['message']);return _0x1df08f(_0x271450['error'][_0x2977('0x12')]);}else{logger[_0x2977('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x473577,'request\x20sent');_0x1df08f(_0x271450[_0x2977('0x13')][_0x2977('0x12')]);}})[_0x2977('0x14')](function(_0x47a095){logger[_0x2977('0x11')](_0x2977('0xc'),_0x473577,_0x47a095);_0x1ac290(_0x47a095);});});}exports[_0x2977('0x15')]=function(_0x41528e){var _0x4ae1d4=this;return new Promise(function(_0x1cf4c1,_0x2a3702){return db[_0x2977('0x16')][_0x2977('0x17')]({'raw':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')][_0x2977('0x19')]||null:null,'attributes':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')][_0x2977('0x1a')]||null:null,'limit':_0x41528e['options']?_0x41528e[_0x2977('0x18')]['limit']||null:null,'include':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')]['include']?_['map'](_0x41528e['options']['include'],function(_0x719fda){return{'model':db[_0x719fda[_0x2977('0x1b')]],'as':_0x719fda['as'],'attributes':_0x719fda[_0x2977('0x1a')],'include':_0x719fda[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x719fda[_0x2977('0x1c')],function(_0x10cac4){return{'model':db[_0x10cac4['model']],'as':_0x10cac4['as'],'attributes':_0x10cac4[_0x2977('0x1a')],'include':_0x10cac4[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x10cac4[_0x2977('0x1c')],function(_0x1a23eb){return{'model':db[_0x1a23eb[_0x2977('0x1b')]],'as':_0x1a23eb['as'],'attributes':_0x1a23eb[_0x2977('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f7bd0){logger[_0x2977('0xb')](_0x2977('0x15'),_0x41528e);logger[_0x2977('0xe')](_0x2977('0x15'),_0x41528e,JSON[_0x2977('0x10')](_0x4f7bd0));_0x1cf4c1(_0x4f7bd0);})[_0x2977('0x14')](function(_0x43d5f5){logger[_0x2977('0x11')]('GetZendeskAccount',_0x43d5f5[_0x2977('0x12')],_0x41528e);_0x2a3702(_0x4ae1d4[_0x2977('0x11')](0x1f4,_0x43d5f5[_0x2977('0x12')]));});});};exports[_0x2977('0x1e')]=function(_0xe9fe86){var _0x34d232=this;return new Promise(function(_0x4ce4b6,_0x6ef04c){return db[_0x2977('0x16')][_0x2977('0x1f')]({'raw':_0xe9fe86['options']?_0xe9fe86[_0x2977('0x18')][_0x2977('0x20')]===undefined?!![]:![]:!![],'where':_0xe9fe86[_0x2977('0x18')]?_0xe9fe86['options'][_0x2977('0x19')]||null:null,'attributes':_0xe9fe86[_0x2977('0x18')]?_0xe9fe86['options'][_0x2977('0x1a')]||null:null,'include':_0xe9fe86['options']?_0xe9fe86['options'][_0x2977('0x1c')]?_[_0x2977('0x1d')](_0xe9fe86[_0x2977('0x18')]['include'],function(_0x4d7fd2){return{'model':db[_0x4d7fd2[_0x2977('0x1b')]],'as':_0x4d7fd2['as'],'attributes':_0x4d7fd2['attributes'],'include':_0x4d7fd2[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x4d7fd2['include'],function(_0x3bd961){return{'model':db[_0x3bd961[_0x2977('0x1b')]],'as':_0x3bd961['as'],'attributes':_0x3bd961[_0x2977('0x1a')],'include':_0x3bd961[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x3bd961[_0x2977('0x1c')],function(_0x55e17e){return{'model':db[_0x55e17e[_0x2977('0x1b')]],'as':_0x55e17e['as'],'attributes':_0x55e17e[_0x2977('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2977('0xa')](function(_0x422ceb){logger[_0x2977('0xb')](_0x2977('0x1e'),_0xe9fe86);logger[_0x2977('0xe')]('ShowZendeskAccount',_0xe9fe86,JSON[_0x2977('0x10')](_0x422ceb));_0x4ce4b6(_0x422ceb);})[_0x2977('0x14')](function(_0x21f7f6){logger['error']('ShowZendeskAccount',_0x21f7f6[_0x2977('0x12')],_0xe9fe86);_0x6ef04c(_0x34d232[_0x2977('0x11')](0x1f4,_0x21f7f6['message']));});});}; \ No newline at end of file +var _0x299c=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowZendeskAccount','find'];(function(_0x79116f,_0x2d53c6){var _0x44f4cd=function(_0x2c2ddf){while(--_0x2c2ddf){_0x79116f['push'](_0x79116f['shift']());}};_0x44f4cd(++_0x2d53c6);}(_0x299c,0x180));var _0xc299=function(_0x57a491,_0x4d1428){_0x57a491=_0x57a491-0x0;var _0x14f6fc=_0x299c[_0x57a491];return _0x14f6fc;};'use strict';var _=require(_0xc299('0x0'));var util=require('util');var moment=require(_0xc299('0x1'));var BPromise=require('bluebird');var rs=require(_0xc299('0x2'));var fs=require('fs');var Redis=require(_0xc299('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc299('0x4'));var logger=require(_0xc299('0x5'))(_0xc299('0x6'));var config=require('../../config/environment');var jayson=require(_0xc299('0x7'));var client=jayson[_0xc299('0x8')][_0xc299('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x524cb6,_0x66d9ab,_0x2a3d21){return new BPromise(function(_0x1ea44d,_0x59c929){return client[_0xc299('0xa')](_0x524cb6,_0x2a3d21)['then'](function(_0x50ad75){logger[_0xc299('0xb')](_0xc299('0xc'),_0x66d9ab,_0xc299('0xd'));logger[_0xc299('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x66d9ab,_0xc299('0xd'),JSON['stringify'](_0x50ad75));if(_0x50ad75['error']){if(_0x50ad75[_0xc299('0xf')][_0xc299('0x10')]===0x1f4){logger[_0xc299('0xf')](_0xc299('0xc'),_0x66d9ab,_0x50ad75[_0xc299('0xf')]['message']);return _0x59c929(_0x50ad75[_0xc299('0xf')][_0xc299('0x11')]);}logger[_0xc299('0xf')](_0xc299('0xc'),_0x66d9ab,_0x50ad75[_0xc299('0xf')][_0xc299('0x11')]);return _0x1ea44d(_0x50ad75[_0xc299('0xf')][_0xc299('0x11')]);}else{logger[_0xc299('0xb')](_0xc299('0xc'),_0x66d9ab,_0xc299('0xd'));_0x1ea44d(_0x50ad75['result'][_0xc299('0x11')]);}})['catch'](function(_0x6bb4d4){logger[_0xc299('0xf')](_0xc299('0xc'),_0x66d9ab,_0x6bb4d4);_0x59c929(_0x6bb4d4);});});}exports[_0xc299('0x12')]=function(_0x8239dc){var _0x440405=this;return new Promise(function(_0xd29c4b,_0x1aaf4d){return db[_0xc299('0x13')][_0xc299('0x14')]({'raw':_0x8239dc[_0xc299('0x15')]?_0x8239dc[_0xc299('0x15')][_0xc299('0x16')]===undefined?!![]:![]:!![],'where':_0x8239dc[_0xc299('0x15')]?_0x8239dc[_0xc299('0x15')][_0xc299('0x17')]||null:null,'attributes':_0x8239dc[_0xc299('0x15')]?_0x8239dc[_0xc299('0x15')][_0xc299('0x18')]||null:null,'limit':_0x8239dc[_0xc299('0x15')]?_0x8239dc['options'][_0xc299('0x19')]||null:null,'include':_0x8239dc[_0xc299('0x15')]?_0x8239dc[_0xc299('0x15')][_0xc299('0x1a')]?_[_0xc299('0x1b')](_0x8239dc[_0xc299('0x15')][_0xc299('0x1a')],function(_0x3d7dca){return{'model':db[_0x3d7dca['model']],'as':_0x3d7dca['as'],'attributes':_0x3d7dca[_0xc299('0x18')],'include':_0x3d7dca['include']?_['map'](_0x3d7dca[_0xc299('0x1a')],function(_0x568014){return{'model':db[_0x568014['model']],'as':_0x568014['as'],'attributes':_0x568014[_0xc299('0x18')],'include':_0x568014['include']?_[_0xc299('0x1b')](_0x568014[_0xc299('0x1a')],function(_0xfb451c){return{'model':db[_0xfb451c[_0xc299('0x1c')]],'as':_0xfb451c['as'],'attributes':_0xfb451c[_0xc299('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50e0b2){logger[_0xc299('0xb')]('GetZendeskAccount',_0x8239dc);logger['debug'](_0xc299('0x12'),_0x8239dc,JSON['stringify'](_0x50e0b2));_0xd29c4b(_0x50e0b2);})[_0xc299('0x1d')](function(_0x708e17){logger[_0xc299('0xf')]('GetZendeskAccount',_0x708e17[_0xc299('0x11')],_0x8239dc);_0x1aaf4d(_0x440405[_0xc299('0xf')](0x1f4,_0x708e17[_0xc299('0x11')]));});});};exports[_0xc299('0x1e')]=function(_0xadb70b){var _0x46ad1d=this;return new Promise(function(_0x107ea0,_0x91f74d){return db[_0xc299('0x13')][_0xc299('0x1f')]({'raw':_0xadb70b['options']?_0xadb70b[_0xc299('0x15')][_0xc299('0x16')]===undefined?!![]:![]:!![],'where':_0xadb70b[_0xc299('0x15')]?_0xadb70b['options'][_0xc299('0x17')]||null:null,'attributes':_0xadb70b[_0xc299('0x15')]?_0xadb70b['options'][_0xc299('0x18')]||null:null,'include':_0xadb70b['options']?_0xadb70b['options'][_0xc299('0x1a')]?_[_0xc299('0x1b')](_0xadb70b[_0xc299('0x15')][_0xc299('0x1a')],function(_0x1dfae5){return{'model':db[_0x1dfae5[_0xc299('0x1c')]],'as':_0x1dfae5['as'],'attributes':_0x1dfae5['attributes'],'include':_0x1dfae5[_0xc299('0x1a')]?_[_0xc299('0x1b')](_0x1dfae5[_0xc299('0x1a')],function(_0x27c80e){return{'model':db[_0x27c80e[_0xc299('0x1c')]],'as':_0x27c80e['as'],'attributes':_0x27c80e[_0xc299('0x18')],'include':_0x27c80e[_0xc299('0x1a')]?_[_0xc299('0x1b')](_0x27c80e[_0xc299('0x1a')],function(_0x2981be){return{'model':db[_0x2981be[_0xc299('0x1c')]],'as':_0x2981be['as'],'attributes':_0x2981be[_0xc299('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32f78f){logger['info'](_0xc299('0x1e'),_0xadb70b);logger[_0xc299('0xe')](_0xc299('0x1e'),_0xadb70b,JSON['stringify'](_0x32f78f));_0x107ea0(_0x32f78f);})[_0xc299('0x1d')](function(_0x2db7fe){logger[_0xc299('0xf')]('ShowZendeskAccount',_0x2db7fe[_0xc299('0x11')],_0xadb70b);_0x91f74d(_0x46ad1d[_0xc299('0xf')](0x1f4,_0x2db7fe[_0xc299('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 9cd1de6..7e15e2d 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 _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file +var _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','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'];(function(_0xbe966f,_0x25d018){var _0x4f253f=function(_0x194c2a){while(--_0x194c2a){_0xbe966f['push'](_0xbe966f['shift']());}};_0x4f253f(++_0x25d018);}(_0x5eb8,0xb0));var _0x85eb=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0x5eb8[_0x156a0d];return _0x98a9ba;};'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('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 436e490..14146b4 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 _0x6812=['STRING','sequelize','exports'];(function(_0x2adc0d,_0x371b7a){var _0x4b5786=function(_0x4edd35){while(--_0x4edd35){_0x2adc0d['push'](_0x2adc0d['shift']());}};_0x4b5786(++_0x371b7a);}(_0x6812,0x1ab));var _0x2681=function(_0x2e7671,_0xc64e5e){_0x2e7671=_0x2e7671-0x0;var _0x342a67=_0x6812[_0x2e7671];return _0x342a67;};'use strict';var Sequelize=require(_0x2681('0x0'));module[_0x2681('0x1')]={'name':{'type':Sequelize[_0x2681('0x2')]},'description':{'type':Sequelize[_0x2681('0x2')]}}; \ No newline at end of file +var _0xc1fc=['sequelize','STRING'];(function(_0x146dd7,_0x4d877d){var _0x2af0bb=function(_0x2327bc){while(--_0x2327bc){_0x146dd7['push'](_0x146dd7['shift']());}};_0x2af0bb(++_0x4d877d);}(_0xc1fc,0x82));var _0xcc1f=function(_0x5ad495,_0x1288f3){_0x5ad495=_0x5ad495-0x0;var _0x42dfda=_0xc1fc[_0x5ad495];return _0x42dfda;};'use strict';var Sequelize=require(_0xcc1f('0x0'));module['exports']={'name':{'type':Sequelize[_0xcc1f('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 935071c..ab9c8a0 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 _0x44f5=['mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','end','stack','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','includeAll','include','create','body','update','find','params','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x1f610a,_0x3f0858){var _0x47dd00=function(_0x184b4c){while(--_0x184b4c){_0x1f610a['push'](_0x1f610a['shift']());}};_0x47dd00(++_0x3f0858);}(_0x44f5,0x173));var _0x544f=function(_0x563fc0,_0x1ae0b0){_0x563fc0=_0x563fc0-0x0;var _0x11dfce=_0x44f5[_0x563fc0];return _0x11dfce;};'use strict';var emlformat=require(_0x544f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x544f('0x1'));var jsonpatch=require(_0x544f('0x2'));var rp=require('request-promise');var moment=require(_0x544f('0x3'));var BPromise=require(_0x544f('0x4'));var Mustache=require(_0x544f('0x5'));var util=require(_0x544f('0x6'));var path=require(_0x544f('0x7'));var sox=require(_0x544f('0x8'));var csv=require(_0x544f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x544f('0xa'));var squel=require(_0x544f('0xb'));var crypto=require(_0x544f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x544f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x544f('0xe'));var Papa=require('papaparse');var Redis=require(_0x544f('0xf'));var authService=require(_0x544f('0x10'));var qs=require(_0x544f('0x11'));var as=require(_0x544f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x544f('0x13'))('api');var utils=require(_0x544f('0x14'));var config=require(_0x544f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x544f('0x16'))['db'];var jayson=require(_0x544f('0x17'));var client=jayson[_0x544f('0x18')][_0x544f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2f03ae,_0x59f0fa,_0x5eb513,_0x5b0e88){return new BPromise(function(_0x5608c0,_0x57fe5f){var _0x1f980c=_0x5b0e88||client;return _0x1f980c[_0x544f('0x1a')](_0x2f03ae,_0x5eb513)['then'](function(_0x1ee079){logger[_0x544f('0x1b')](_0x544f('0x1c'),_0x59f0fa,_0x544f('0x1d'));logger[_0x544f('0x1e')](_0x544f('0x1f'),_0x59f0fa,_0x544f('0x1d'),JSON['stringify'](_0x1ee079));if(_0x1ee079[_0x544f('0x20')]){if(_0x1ee079[_0x544f('0x20')][_0x544f('0x21')]===0x1f4){logger[_0x544f('0x20')](_0x544f('0x1c'),_0x59f0fa,_0x1ee079['error'][_0x544f('0x22')]);return _0x57fe5f(_0x1ee079[_0x544f('0x20')][_0x544f('0x22')]);}logger[_0x544f('0x20')](_0x544f('0x1c'),_0x59f0fa,_0x1ee079[_0x544f('0x20')]['message']);return _0x5608c0(_0x1ee079[_0x544f('0x20')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x59f0fa,_0x544f('0x1d'));_0x5608c0(_0x1ee079[_0x544f('0x23')][_0x544f('0x22')]);}})[_0x544f('0x24')](function(_0x7b828b){logger[_0x544f('0x20')](_0x544f('0x1c'),_0x59f0fa,_0x7b828b);_0x57fe5f(_0x7b828b);});});}function respondWithStatusCode(_0x2e4ad8,_0x78af30){_0x78af30=_0x78af30||0xcc;return function(_0x39baf9){if(_0x39baf9){return _0x2e4ad8[_0x544f('0x25')](_0x78af30);}return _0x2e4ad8[_0x544f('0x26')](_0x78af30)['end']();};}function respondWithResult(_0x15346b,_0x23f848){_0x23f848=_0x23f848||0xc8;return function(_0x5d8c55){if(_0x5d8c55){return _0x15346b['status'](_0x23f848)[_0x544f('0x27')](_0x5d8c55);}};}function respondWithFilteredResult(_0x236a7d,_0x3007a6){return function(_0x4c42f2){if(_0x4c42f2){var _0x1c1896=typeof _0x3007a6[_0x544f('0x28')]===_0x544f('0x29')&&typeof _0x3007a6[_0x544f('0x2a')]===_0x544f('0x29');var _0x8949ea=_0x4c42f2[_0x544f('0x2b')];var _0x379fef=_0x1c1896?0x0:_0x3007a6['offset'];var _0x25b14b=_0x1c1896?_0x4c42f2['count']:_0x3007a6[_0x544f('0x28')]+_0x3007a6[_0x544f('0x2a')];var _0x1c9f15;if(_0x25b14b>=_0x8949ea){_0x25b14b=_0x8949ea;_0x1c9f15=0xc8;}else{_0x1c9f15=0xce;}_0x236a7d[_0x544f('0x26')](_0x1c9f15);return _0x236a7d[_0x544f('0x2c')]('Content-Range',_0x379fef+'-'+_0x25b14b+'/'+_0x8949ea)[_0x544f('0x27')](_0x4c42f2);}return null;};}function patchUpdates(_0x32cff6){return function(_0x312e25){try{jsonpatch[_0x544f('0x2d')](_0x312e25,_0x32cff6,!![]);}catch(_0x34e7e5){return BPromise[_0x544f('0x2e')](_0x34e7e5);}return _0x312e25['save']();};}function saveUpdates(_0x339caf,_0x3ca429){return function(_0x44e47e){if(_0x44e47e){return _0x44e47e['update'](_0x339caf)[_0x544f('0x2f')](function(_0x395fce){return _0x395fce;});}return null;};}function removeEntity(_0x48e1ee,_0x4dd011){return function(_0x4dc272){if(_0x4dc272){return _0x4dc272[_0x544f('0x30')]()['then'](function(){_0x48e1ee[_0x544f('0x26')](0xcc)[_0x544f('0x31')]();});}};}function handleEntityNotFound(_0x3e4aec,_0x21ca76){return function(_0x1e7f27){if(!_0x1e7f27){_0x3e4aec[_0x544f('0x25')](0x194);}return _0x1e7f27;};}function handleError(_0x5d6ee6,_0x4e7b1e){_0x4e7b1e=_0x4e7b1e||0x1f4;return function(_0x3bdda6){logger[_0x544f('0x20')](_0x3bdda6[_0x544f('0x32')]);if(_0x3bdda6['name']){delete _0x3bdda6['name'];}_0x5d6ee6[_0x544f('0x26')](_0x4e7b1e)['send'](_0x3bdda6);};}exports['index']=function(_0x4524db,_0x591e18){var _0x238b93={},_0x7ed48b={},_0x42ba69={'count':0x0,'rows':[]};var _0x4af17d=_[_0x544f('0x33')](db[_0x544f('0x34')][_0x544f('0x35')],function(_0x558bdd){return{'name':_0x558bdd[_0x544f('0x36')],'type':_0x558bdd[_0x544f('0x37')][_0x544f('0x38')]};});_0x7ed48b[_0x544f('0x39')]=_['map'](_0x4af17d,_0x544f('0x3a'));_0x7ed48b[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x4524db[_0x544f('0x3b')]);_0x7ed48b[_0x544f('0x3d')]=_['intersection'](_0x7ed48b[_0x544f('0x39')],_0x7ed48b[_0x544f('0x3b')]);_0x238b93['attributes']=_[_0x544f('0x3e')](_0x7ed48b[_0x544f('0x39')],qs[_0x544f('0x3f')](_0x4524db[_0x544f('0x3b')][_0x544f('0x3f')]));_0x238b93[_0x544f('0x40')]=_0x238b93['attributes'][_0x544f('0x41')]?_0x238b93[_0x544f('0x40')]:_0x7ed48b[_0x544f('0x39')];if(!_0x4524db[_0x544f('0x3b')]['hasOwnProperty'](_0x544f('0x42'))){_0x238b93[_0x544f('0x2a')]=qs['limit'](_0x4524db[_0x544f('0x3b')][_0x544f('0x2a')]);_0x238b93[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x4524db[_0x544f('0x3b')][_0x544f('0x28')]);}_0x238b93[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x4524db[_0x544f('0x3b')]['sort']);_0x238b93[_0x544f('0x45')]=qs[_0x544f('0x3d')](_[_0x544f('0x46')](_0x4524db[_0x544f('0x3b')],_0x7ed48b['filters']),_0x4af17d);if(_0x4524db[_0x544f('0x3b')][_0x544f('0x47')]){_0x238b93[_0x544f('0x45')]=_[_0x544f('0x48')](_0x238b93[_0x544f('0x45')],{'$or':_['map'](_0x4af17d,function(_0x3b4d32){if(_0x3b4d32[_0x544f('0x37')]!==_0x544f('0x49')){var _0x4fafbb={};_0x4fafbb[_0x3b4d32[_0x544f('0x3a')]]={'$like':'%'+_0x4524db['query'][_0x544f('0x47')]+'%'};return _0x4fafbb;}})});}_0x238b93=_[_0x544f('0x48')]({},_0x238b93,_0x4524db[_0x544f('0x4a')]);var _0xf0c6c9={'where':_0x238b93[_0x544f('0x45')]};return db['ZendeskConfiguration'][_0x544f('0x2b')](_0xf0c6c9)[_0x544f('0x2f')](function(_0x59c504){_0x42ba69[_0x544f('0x2b')]=_0x59c504;if(_0x4524db[_0x544f('0x3b')]['includeAll']){_0x238b93['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x238b93);})['then'](function(_0x44c90e){_0x42ba69[_0x544f('0x4b')]=_0x44c90e;return _0x42ba69;})[_0x544f('0x2f')](respondWithFilteredResult(_0x591e18,_0x238b93))[_0x544f('0x24')](handleError(_0x591e18,null));};exports[_0x544f('0x4c')]=function(_0x4c2604,_0x2bfdeb){var _0x28580c={'raw':![],'where':{'id':_0x4c2604['params']['id']}},_0x364e23={};_0x364e23[_0x544f('0x39')]=_['keys'](db[_0x544f('0x34')][_0x544f('0x35')]);_0x364e23[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x4c2604['query']);_0x364e23[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x364e23[_0x544f('0x39')],_0x364e23[_0x544f('0x3b')]);_0x28580c[_0x544f('0x40')]=_['intersection'](_0x364e23[_0x544f('0x39')],qs[_0x544f('0x3f')](_0x4c2604[_0x544f('0x3b')][_0x544f('0x3f')]));_0x28580c['attributes']=_0x28580c[_0x544f('0x40')][_0x544f('0x41')]?_0x28580c['attributes']:_0x364e23['model'];if(_0x4c2604[_0x544f('0x3b')][_0x544f('0x4d')]){_0x28580c[_0x544f('0x4e')]=[{'all':!![]}];}_0x28580c=_['merge']({},_0x28580c,_0x4c2604[_0x544f('0x4a')]);return db[_0x544f('0x34')]['find'](_0x28580c)[_0x544f('0x2f')](handleEntityNotFound(_0x2bfdeb,null))[_0x544f('0x2f')](respondWithResult(_0x2bfdeb,null))['catch'](handleError(_0x2bfdeb,null));};exports[_0x544f('0x4f')]=function(_0x5e448e,_0x5be276){return db[_0x544f('0x34')][_0x544f('0x4f')](_0x5e448e[_0x544f('0x50')],{})['then'](respondWithResult(_0x5be276,0xc9))[_0x544f('0x24')](handleError(_0x5be276,null));};exports[_0x544f('0x51')]=function(_0x32c1fe,_0x223340){if(_0x32c1fe[_0x544f('0x50')]['id']){delete _0x32c1fe[_0x544f('0x50')]['id'];}return db[_0x544f('0x34')][_0x544f('0x52')]({'where':{'id':_0x32c1fe['params']['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x223340,null))[_0x544f('0x2f')](saveUpdates(_0x32c1fe[_0x544f('0x50')],null))[_0x544f('0x2f')](respondWithResult(_0x223340,null))[_0x544f('0x24')](handleError(_0x223340,null));};exports['destroy']=function(_0x1ac523,_0x5c1433){return db['ZendeskConfiguration'][_0x544f('0x52')]({'where':{'id':_0x1ac523[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x5c1433,null))['then'](removeEntity(_0x5c1433,null))['catch'](handleError(_0x5c1433,null));};exports[_0x544f('0x54')]=function(_0x81c225,_0x3b5db1,_0xa92eaa){var _0x2f627a={};var _0x581e9d={};var _0x351e55;var _0x314ba4;return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x81c225[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x3b5db1,null))[_0x544f('0x2f')](function(_0x1fcd82){if(_0x1fcd82){_0x351e55=_0x1fcd82;_0x581e9d[_0x544f('0x39')]=_['keys'](db[_0x544f('0x56')][_0x544f('0x35')]);_0x581e9d[_0x544f('0x3b')]=_['keys'](_0x81c225[_0x544f('0x3b')]);_0x581e9d['filters']=_['intersection'](_0x581e9d[_0x544f('0x39')],_0x581e9d['query']);_0x2f627a[_0x544f('0x40')]=_[_0x544f('0x3e')](_0x581e9d['model'],qs[_0x544f('0x3f')](_0x81c225[_0x544f('0x3b')]['fields']));_0x2f627a[_0x544f('0x40')]=_0x2f627a[_0x544f('0x40')][_0x544f('0x41')]?_0x2f627a['attributes']:_0x581e9d['model'];_0x2f627a[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x81c225['query'][_0x544f('0x44')]);_0x2f627a[_0x544f('0x45')]=qs[_0x544f('0x3d')](_['pick'](_0x81c225[_0x544f('0x3b')],_0x581e9d[_0x544f('0x3d')]));if(_0x81c225[_0x544f('0x3b')][_0x544f('0x47')]){_0x2f627a['where']=_[_0x544f('0x48')](_0x2f627a[_0x544f('0x45')],{'$or':_[_0x544f('0x33')](_0x2f627a[_0x544f('0x40')],function(_0x16247e){var _0x186c02={};_0x186c02[_0x16247e]={'$like':'%'+_0x81c225[_0x544f('0x3b')]['filter']+'%'};return _0x186c02;})});}_0x2f627a=_[_0x544f('0x48')]({},_0x2f627a,_0x81c225[_0x544f('0x4a')]);return _0x351e55[_0x544f('0x54')](_0x2f627a);}})[_0x544f('0x2f')](function(_0x4b7a1e){if(_0x4b7a1e){_0x314ba4=_0x4b7a1e[_0x544f('0x41')];if(!_0x81c225[_0x544f('0x3b')][_0x544f('0x57')](_0x544f('0x42'))){_0x2f627a[_0x544f('0x2a')]=qs[_0x544f('0x2a')](_0x81c225[_0x544f('0x3b')]['limit']);_0x2f627a[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x81c225['query']['offset']);}return _0x351e55['getFields'](_0x2f627a);}})[_0x544f('0x2f')](function(_0x17d291){if(_0x17d291){return _0x17d291?{'count':_0x314ba4,'rows':_0x17d291}:null;}})[_0x544f('0x2f')](respondWithResult(_0x3b5db1,null))[_0x544f('0x24')](handleError(_0x3b5db1,null));};exports[_0x544f('0x58')]=function(_0x3b35e0,_0xff3e2a,_0xb5a9d0){var _0x2facdc={};var _0x2e1c83={};var _0x42f7d2;var _0x59e97a;return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x3b35e0[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0xff3e2a,null))['then'](function(_0x3e5f12){if(_0x3e5f12){_0x42f7d2=_0x3e5f12;_0x2e1c83[_0x544f('0x39')]=_['keys'](db[_0x544f('0x56')][_0x544f('0x35')]);_0x2e1c83[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x3b35e0[_0x544f('0x3b')]);_0x2e1c83[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x2e1c83['model'],_0x2e1c83[_0x544f('0x3b')]);_0x2facdc[_0x544f('0x40')]=_[_0x544f('0x3e')](_0x2e1c83[_0x544f('0x39')],qs[_0x544f('0x3f')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x3f')]));_0x2facdc[_0x544f('0x40')]=_0x2facdc[_0x544f('0x40')]['length']?_0x2facdc[_0x544f('0x40')]:_0x2e1c83[_0x544f('0x39')];_0x2facdc[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x44')]);_0x2facdc[_0x544f('0x45')]=qs[_0x544f('0x3d')](_[_0x544f('0x46')](_0x3b35e0[_0x544f('0x3b')],_0x2e1c83[_0x544f('0x3d')]));if(_0x3b35e0[_0x544f('0x3b')]['filter']){_0x2facdc['where']=_['merge'](_0x2facdc[_0x544f('0x45')],{'$or':_[_0x544f('0x33')](_0x2facdc[_0x544f('0x40')],function(_0x4699d3){var _0x252dc7={};_0x252dc7[_0x4699d3]={'$like':'%'+_0x3b35e0[_0x544f('0x3b')][_0x544f('0x47')]+'%'};return _0x252dc7;})});}_0x2facdc=_['merge']({},_0x2facdc,_0x3b35e0[_0x544f('0x4a')]);return _0x42f7d2[_0x544f('0x58')](_0x2facdc);}})[_0x544f('0x2f')](function(_0xc699ed){if(_0xc699ed){_0x59e97a=_0xc699ed[_0x544f('0x41')];if(!_0x3b35e0[_0x544f('0x3b')][_0x544f('0x57')](_0x544f('0x42'))){_0x2facdc[_0x544f('0x2a')]=qs[_0x544f('0x2a')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x2a')]);_0x2facdc[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x28')]);}return _0x42f7d2[_0x544f('0x58')](_0x2facdc);}})['then'](function(_0x491814){if(_0x491814){return _0x491814?{'count':_0x59e97a,'rows':_0x491814}:null;}})[_0x544f('0x2f')](respondWithResult(_0xff3e2a,null))[_0x544f('0x24')](handleError(_0xff3e2a,null));};exports[_0x544f('0x59')]=function(_0x39fac7,_0x2fa94a,_0x43a522){var _0x432e32={};var _0x4692ee={};var _0x572e7c;var _0x2a46ca;return db[_0x544f('0x34')]['findOne']({'where':{'id':_0x39fac7[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x2fa94a,null))[_0x544f('0x2f')](function(_0x16b303){if(_0x16b303){_0x572e7c=_0x16b303;_0x4692ee[_0x544f('0x39')]=_[_0x544f('0x3c')](db['ZendeskField'][_0x544f('0x35')]);_0x4692ee[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x39fac7[_0x544f('0x3b')]);_0x4692ee[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x4692ee['model'],_0x4692ee['query']);_0x432e32[_0x544f('0x40')]=_['intersection'](_0x4692ee['model'],qs[_0x544f('0x3f')](_0x39fac7['query'][_0x544f('0x3f')]));_0x432e32[_0x544f('0x40')]=_0x432e32[_0x544f('0x40')][_0x544f('0x41')]?_0x432e32['attributes']:_0x4692ee[_0x544f('0x39')];_0x432e32['order']=qs[_0x544f('0x44')](_0x39fac7[_0x544f('0x3b')][_0x544f('0x44')]);_0x432e32['where']=qs['filters'](_[_0x544f('0x46')](_0x39fac7[_0x544f('0x3b')],_0x4692ee[_0x544f('0x3d')]));if(_0x39fac7[_0x544f('0x3b')][_0x544f('0x47')]){_0x432e32[_0x544f('0x45')]=_[_0x544f('0x48')](_0x432e32[_0x544f('0x45')],{'$or':_['map'](_0x432e32[_0x544f('0x40')],function(_0x5474c0){var _0x2260f0={};_0x2260f0[_0x5474c0]={'$like':'%'+_0x39fac7['query'][_0x544f('0x47')]+'%'};return _0x2260f0;})});}_0x432e32=_[_0x544f('0x48')]({},_0x432e32,_0x39fac7['options']);return _0x572e7c[_0x544f('0x59')](_0x432e32);}})['then'](function(_0x28f16a){if(_0x28f16a){_0x2a46ca=_0x28f16a[_0x544f('0x41')];if(!_0x39fac7['query']['hasOwnProperty'](_0x544f('0x42'))){_0x432e32['limit']=qs[_0x544f('0x2a')](_0x39fac7['query'][_0x544f('0x2a')]);_0x432e32[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x39fac7[_0x544f('0x3b')]['offset']);}return _0x572e7c[_0x544f('0x59')](_0x432e32);}})[_0x544f('0x2f')](function(_0x301385){if(_0x301385){return _0x301385?{'count':_0x2a46ca,'rows':_0x301385}:null;}})['then'](respondWithResult(_0x2fa94a,null))[_0x544f('0x24')](handleError(_0x2fa94a,null));};exports[_0x544f('0x5a')]=function(_0x454669,_0x4437c1,_0x59ccd9){var _0x4524e1={};var _0x4b3d2f={};var _0x2174e3;var _0x2df89e;return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x454669['params']['id']}})['then'](handleEntityNotFound(_0x4437c1,null))[_0x544f('0x2f')](function(_0x42ccd0){if(_0x42ccd0){_0x2174e3=_0x42ccd0;_0x4b3d2f[_0x544f('0x39')]=_[_0x544f('0x3c')](db[_0x544f('0x5b')][_0x544f('0x35')]);_0x4b3d2f['query']=_[_0x544f('0x3c')](_0x454669[_0x544f('0x3b')]);_0x4b3d2f[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x4b3d2f[_0x544f('0x39')],_0x4b3d2f[_0x544f('0x3b')]);_0x4524e1[_0x544f('0x40')]=_[_0x544f('0x3e')](_0x4b3d2f[_0x544f('0x39')],qs['fields'](_0x454669[_0x544f('0x3b')][_0x544f('0x3f')]));_0x4524e1[_0x544f('0x40')]=_0x4524e1[_0x544f('0x40')]['length']?_0x4524e1[_0x544f('0x40')]:_0x4b3d2f[_0x544f('0x39')];_0x4524e1[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x454669[_0x544f('0x3b')][_0x544f('0x44')]);_0x4524e1[_0x544f('0x45')]=qs[_0x544f('0x3d')](_[_0x544f('0x46')](_0x454669['query'],_0x4b3d2f[_0x544f('0x3d')]));if(_0x454669[_0x544f('0x3b')]['filter']){_0x4524e1['where']=_[_0x544f('0x48')](_0x4524e1[_0x544f('0x45')],{'$or':_[_0x544f('0x33')](_0x4524e1[_0x544f('0x40')],function(_0x98e4a0){var _0x5bb854={};_0x5bb854[_0x98e4a0]={'$like':'%'+_0x454669[_0x544f('0x3b')]['filter']+'%'};return _0x5bb854;})});}_0x4524e1=_[_0x544f('0x48')]({},_0x4524e1,_0x454669[_0x544f('0x4a')]);return _0x2174e3[_0x544f('0x5a')](_0x4524e1);}})[_0x544f('0x2f')](function(_0x28c65c){if(_0x28c65c){_0x2df89e=_0x28c65c[_0x544f('0x41')];if(!_0x454669[_0x544f('0x3b')][_0x544f('0x57')]('nolimit')){_0x4524e1[_0x544f('0x2a')]=qs[_0x544f('0x2a')](_0x454669[_0x544f('0x3b')][_0x544f('0x2a')]);_0x4524e1['offset']=qs[_0x544f('0x28')](_0x454669[_0x544f('0x3b')][_0x544f('0x28')]);}return _0x2174e3[_0x544f('0x5a')](_0x4524e1);}})[_0x544f('0x2f')](function(_0x1e7566){if(_0x1e7566){return _0x1e7566?{'count':_0x2df89e,'rows':_0x1e7566}:null;}})['then'](respondWithResult(_0x4437c1,null))['catch'](handleError(_0x4437c1,null));};exports['setTags']=function(_0x252b4c,_0x23a433,_0x44b3c0){if(_0x252b4c[_0x544f('0x50')]['id']){delete _0x252b4c[_0x544f('0x50')]['id'];}return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x252b4c[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x23a433,null))[_0x544f('0x2f')](function(_0xc40e77){if(_0xc40e77){return _0xc40e77[_0x544f('0x5c')](_0x252b4c[_0x544f('0x50')][_0x544f('0x5d')]||[]);}return null;})[_0x544f('0x2f')](respondWithResult(_0x23a433,null))[_0x544f('0x24')](handleError(_0x23a433,null));}; \ No newline at end of file +var _0x8ab4=['find','create','body','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','end','sendStatus','name','send','index','map','ZendeskConfiguration','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x8ab4,0x180));var _0x48ab=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x8ab4[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x48ab('0x0'));var rimraf=require(_0x48ab('0x1'));var zipdir=require(_0x48ab('0x2'));var jsonpatch=require(_0x48ab('0x3'));var rp=require(_0x48ab('0x4'));var moment=require(_0x48ab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x48ab('0x6'));var util=require(_0x48ab('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x48ab('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48ab('0x9'));var _=require(_0x48ab('0xa'));var squel=require(_0x48ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x48ab('0xc'));var deskjs=require(_0x48ab('0xd'));var toCsv=require(_0x48ab('0x8'));var querystring=require(_0x48ab('0xe'));var Papa=require(_0x48ab('0xf'));var Redis=require(_0x48ab('0x10'));var authService=require(_0x48ab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x48ab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48ab('0x13'))('api');var utils=require(_0x48ab('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48ab('0x15'))['db'];var jayson=require(_0x48ab('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17da80,_0xffcb3a,_0x434a10,_0x393874){return new BPromise(function(_0x143c04,_0x509cb){var _0xa2b157=_0x393874||client;return _0xa2b157[_0x48ab('0x17')](_0x17da80,_0x434a10)['then'](function(_0x37e4ea){logger[_0x48ab('0x18')](_0x48ab('0x19'),_0xffcb3a,_0x48ab('0x1a'));logger[_0x48ab('0x1b')](_0x48ab('0x1c'),_0xffcb3a,_0x48ab('0x1a'),JSON[_0x48ab('0x1d')](_0x37e4ea));if(_0x37e4ea[_0x48ab('0x1e')]){if(_0x37e4ea['error'][_0x48ab('0x1f')]===0x1f4){logger[_0x48ab('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s',_0xffcb3a,_0x37e4ea['error']['message']);return _0x509cb(_0x37e4ea['error'][_0x48ab('0x20')]);}logger[_0x48ab('0x1e')](_0x48ab('0x19'),_0xffcb3a,_0x37e4ea[_0x48ab('0x1e')][_0x48ab('0x20')]);return _0x143c04(_0x37e4ea[_0x48ab('0x1e')][_0x48ab('0x20')]);}else{logger[_0x48ab('0x18')]('ZendeskConfiguration,\x20%s,\x20%s',_0xffcb3a,'request\x20sent');_0x143c04(_0x37e4ea[_0x48ab('0x21')][_0x48ab('0x20')]);}})[_0x48ab('0x22')](function(_0x45d50f){logger['error'](_0x48ab('0x19'),_0xffcb3a,_0x45d50f);_0x509cb(_0x45d50f);});});}function respondWithStatusCode(_0x364bc9,_0x34971d){_0x34971d=_0x34971d||0xcc;return function(_0xfc47f4){if(_0xfc47f4){return _0x364bc9['sendStatus'](_0x34971d);}return _0x364bc9['status'](_0x34971d)['end']();};}function respondWithResult(_0x1c103b,_0x2bfa9c){_0x2bfa9c=_0x2bfa9c||0xc8;return function(_0x2846e8){if(_0x2846e8){return _0x1c103b[_0x48ab('0x23')](_0x2bfa9c)[_0x48ab('0x24')](_0x2846e8);}};}function respondWithFilteredResult(_0x2f24dc,_0x26c625){return function(_0x23ad2f){if(_0x23ad2f){var _0x3e608a=typeof _0x26c625['offset']===_0x48ab('0x25')&&typeof _0x26c625[_0x48ab('0x26')]===_0x48ab('0x25');var _0x34c68b=_0x23ad2f[_0x48ab('0x27')];var _0x2b62a4=_0x3e608a?0x0:_0x26c625[_0x48ab('0x28')];var _0x163a1f=_0x3e608a?_0x23ad2f[_0x48ab('0x27')]:_0x26c625[_0x48ab('0x28')]+_0x26c625[_0x48ab('0x26')];var _0x2a410a;if(_0x163a1f>=_0x34c68b){_0x163a1f=_0x34c68b;_0x2a410a=0xc8;}else{_0x2a410a=0xce;}_0x2f24dc[_0x48ab('0x23')](_0x2a410a);return _0x2f24dc[_0x48ab('0x29')]('Content-Range',_0x2b62a4+'-'+_0x163a1f+'/'+_0x34c68b)[_0x48ab('0x24')](_0x23ad2f);}return null;};}function patchUpdates(_0x381e7a){return function(_0x444bd5){try{jsonpatch[_0x48ab('0x2a')](_0x444bd5,_0x381e7a,!![]);}catch(_0x94a866){return BPromise['reject'](_0x94a866);}return _0x444bd5[_0x48ab('0x2b')]();};}function saveUpdates(_0x386ff7,_0x3f6312){return function(_0x283122){if(_0x283122){return _0x283122[_0x48ab('0x2c')](_0x386ff7)[_0x48ab('0x2d')](function(_0x328a02){return _0x328a02;});}return null;};}function removeEntity(_0x4242ae,_0x1d8b65){return function(_0x2c8a72){if(_0x2c8a72){return _0x2c8a72[_0x48ab('0x2e')]()[_0x48ab('0x2d')](function(){_0x4242ae[_0x48ab('0x23')](0xcc)[_0x48ab('0x2f')]();});}};}function handleEntityNotFound(_0x4b23b7,_0x3cc301){return function(_0x2f32ed){if(!_0x2f32ed){_0x4b23b7[_0x48ab('0x30')](0x194);}return _0x2f32ed;};}function handleError(_0x1de1f0,_0x2162bc){_0x2162bc=_0x2162bc||0x1f4;return function(_0x4b4a36){logger[_0x48ab('0x1e')](_0x4b4a36['stack']);if(_0x4b4a36[_0x48ab('0x31')]){delete _0x4b4a36[_0x48ab('0x31')];}_0x1de1f0[_0x48ab('0x23')](_0x2162bc)[_0x48ab('0x32')](_0x4b4a36);};}exports[_0x48ab('0x33')]=function(_0x4d5657,_0x4502e3){var _0x56e976={},_0x545b68={},_0x3ef311={'count':0x0,'rows':[]};var _0x2beb44=_[_0x48ab('0x34')](db[_0x48ab('0x35')]['rawAttributes'],function(_0x3dedd6){return{'name':_0x3dedd6['fieldName'],'type':_0x3dedd6[_0x48ab('0x36')][_0x48ab('0x37')]};});_0x545b68[_0x48ab('0x38')]=_['map'](_0x2beb44,_0x48ab('0x31'));_0x545b68[_0x48ab('0x39')]=_[_0x48ab('0x3a')](_0x4d5657['query']);_0x545b68['filters']=_[_0x48ab('0x3b')](_0x545b68[_0x48ab('0x38')],_0x545b68['query']);_0x56e976[_0x48ab('0x3c')]=_[_0x48ab('0x3b')](_0x545b68[_0x48ab('0x38')],qs[_0x48ab('0x3d')](_0x4d5657['query'][_0x48ab('0x3d')]));_0x56e976[_0x48ab('0x3c')]=_0x56e976['attributes'][_0x48ab('0x3e')]?_0x56e976[_0x48ab('0x3c')]:_0x545b68['model'];if(!_0x4d5657[_0x48ab('0x39')][_0x48ab('0x3f')](_0x48ab('0x40'))){_0x56e976[_0x48ab('0x26')]=qs['limit'](_0x4d5657['query'][_0x48ab('0x26')]);_0x56e976[_0x48ab('0x28')]=qs[_0x48ab('0x28')](_0x4d5657[_0x48ab('0x39')][_0x48ab('0x28')]);}_0x56e976[_0x48ab('0x41')]=qs['sort'](_0x4d5657['query'][_0x48ab('0x42')]);_0x56e976['where']=qs[_0x48ab('0x43')](_[_0x48ab('0x44')](_0x4d5657[_0x48ab('0x39')],_0x545b68[_0x48ab('0x43')]),_0x2beb44);if(_0x4d5657['query'][_0x48ab('0x45')]){_0x56e976[_0x48ab('0x46')]=_[_0x48ab('0x47')](_0x56e976[_0x48ab('0x46')],{'$or':_[_0x48ab('0x34')](_0x2beb44,function(_0x2fd075){if(_0x2fd075[_0x48ab('0x36')]!==_0x48ab('0x48')){var _0x3d622c={};_0x3d622c[_0x2fd075['name']]={'$like':'%'+_0x4d5657[_0x48ab('0x39')][_0x48ab('0x45')]+'%'};return _0x3d622c;}})});}_0x56e976=_[_0x48ab('0x47')]({},_0x56e976,_0x4d5657[_0x48ab('0x49')]);var _0x50985b={'where':_0x56e976[_0x48ab('0x46')]};return db[_0x48ab('0x35')][_0x48ab('0x27')](_0x50985b)['then'](function(_0x66d4bb){_0x3ef311['count']=_0x66d4bb;if(_0x4d5657[_0x48ab('0x39')][_0x48ab('0x4a')]){_0x56e976[_0x48ab('0x4b')]=[{'all':!![]}];}return db[_0x48ab('0x35')][_0x48ab('0x4c')](_0x56e976);})[_0x48ab('0x2d')](function(_0x1c6437){_0x3ef311[_0x48ab('0x4d')]=_0x1c6437;return _0x3ef311;})[_0x48ab('0x2d')](respondWithFilteredResult(_0x4502e3,_0x56e976))[_0x48ab('0x22')](handleError(_0x4502e3,null));};exports[_0x48ab('0x4e')]=function(_0x43be3d,_0x519c22){var _0x2c6b1f={'raw':![],'where':{'id':_0x43be3d[_0x48ab('0x4f')]['id']}},_0x59dae9={};_0x59dae9[_0x48ab('0x38')]=_['keys'](db['ZendeskConfiguration'][_0x48ab('0x50')]);_0x59dae9[_0x48ab('0x39')]=_[_0x48ab('0x3a')](_0x43be3d['query']);_0x59dae9[_0x48ab('0x43')]=_[_0x48ab('0x3b')](_0x59dae9[_0x48ab('0x38')],_0x59dae9[_0x48ab('0x39')]);_0x2c6b1f[_0x48ab('0x3c')]=_[_0x48ab('0x3b')](_0x59dae9['model'],qs['fields'](_0x43be3d[_0x48ab('0x39')][_0x48ab('0x3d')]));_0x2c6b1f[_0x48ab('0x3c')]=_0x2c6b1f['attributes']['length']?_0x2c6b1f['attributes']:_0x59dae9[_0x48ab('0x38')];if(_0x43be3d['query'][_0x48ab('0x4a')]){_0x2c6b1f['include']=[{'all':!![]}];}_0x2c6b1f=_[_0x48ab('0x47')]({},_0x2c6b1f,_0x43be3d['options']);return db[_0x48ab('0x35')][_0x48ab('0x51')](_0x2c6b1f)[_0x48ab('0x2d')](handleEntityNotFound(_0x519c22,null))[_0x48ab('0x2d')](respondWithResult(_0x519c22,null))[_0x48ab('0x22')](handleError(_0x519c22,null));};exports['create']=function(_0x42f989,_0x4f30c3){return db[_0x48ab('0x35')][_0x48ab('0x52')](_0x42f989['body'],{})[_0x48ab('0x2d')](respondWithResult(_0x4f30c3,0xc9))[_0x48ab('0x22')](handleError(_0x4f30c3,null));};exports[_0x48ab('0x2c')]=function(_0x196b5f,_0x361a59){if(_0x196b5f[_0x48ab('0x53')]['id']){delete _0x196b5f['body']['id'];}return db[_0x48ab('0x35')][_0x48ab('0x51')]({'where':{'id':_0x196b5f[_0x48ab('0x4f')]['id']}})[_0x48ab('0x2d')](handleEntityNotFound(_0x361a59,null))[_0x48ab('0x2d')](saveUpdates(_0x196b5f['body'],null))['then'](respondWithResult(_0x361a59,null))['catch'](handleError(_0x361a59,null));};exports[_0x48ab('0x2e')]=function(_0x7e007c,_0x5185e8){return db['ZendeskConfiguration']['find']({'where':{'id':_0x7e007c[_0x48ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5185e8,null))[_0x48ab('0x2d')](removeEntity(_0x5185e8,null))[_0x48ab('0x22')](handleError(_0x5185e8,null));};exports['getFields']=function(_0x512a56,_0x54f37f,_0x261a8e){var _0x2c9f97={};var _0xc5eb23={};var _0x3eaf9b;var _0x35f604;return db[_0x48ab('0x35')][_0x48ab('0x54')]({'where':{'id':_0x512a56[_0x48ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x54f37f,null))[_0x48ab('0x2d')](function(_0x53a135){if(_0x53a135){_0x3eaf9b=_0x53a135;_0xc5eb23[_0x48ab('0x38')]=_[_0x48ab('0x3a')](db[_0x48ab('0x55')][_0x48ab('0x50')]);_0xc5eb23[_0x48ab('0x39')]=_[_0x48ab('0x3a')](_0x512a56[_0x48ab('0x39')]);_0xc5eb23[_0x48ab('0x43')]=_[_0x48ab('0x3b')](_0xc5eb23[_0x48ab('0x38')],_0xc5eb23['query']);_0x2c9f97[_0x48ab('0x3c')]=_[_0x48ab('0x3b')](_0xc5eb23[_0x48ab('0x38')],qs['fields'](_0x512a56['query'][_0x48ab('0x3d')]));_0x2c9f97[_0x48ab('0x3c')]=_0x2c9f97[_0x48ab('0x3c')]['length']?_0x2c9f97['attributes']:_0xc5eb23['model'];_0x2c9f97['order']=qs[_0x48ab('0x42')](_0x512a56[_0x48ab('0x39')][_0x48ab('0x42')]);_0x2c9f97['where']=qs[_0x48ab('0x43')](_[_0x48ab('0x44')](_0x512a56[_0x48ab('0x39')],_0xc5eb23[_0x48ab('0x43')]));if(_0x512a56[_0x48ab('0x39')][_0x48ab('0x45')]){_0x2c9f97[_0x48ab('0x46')]=_['merge'](_0x2c9f97[_0x48ab('0x46')],{'$or':_[_0x48ab('0x34')](_0x2c9f97[_0x48ab('0x3c')],function(_0x17382a){var _0x231008={};_0x231008[_0x17382a]={'$like':'%'+_0x512a56[_0x48ab('0x39')]['filter']+'%'};return _0x231008;})});}_0x2c9f97=_[_0x48ab('0x47')]({},_0x2c9f97,_0x512a56['options']);return _0x3eaf9b['getFields'](_0x2c9f97);}})['then'](function(_0x5f1787){if(_0x5f1787){_0x35f604=_0x5f1787[_0x48ab('0x3e')];if(!_0x512a56[_0x48ab('0x39')][_0x48ab('0x3f')](_0x48ab('0x40'))){_0x2c9f97[_0x48ab('0x26')]=qs[_0x48ab('0x26')](_0x512a56['query']['limit']);_0x2c9f97[_0x48ab('0x28')]=qs[_0x48ab('0x28')](_0x512a56['query']['offset']);}return _0x3eaf9b[_0x48ab('0x56')](_0x2c9f97);}})[_0x48ab('0x2d')](function(_0x3947b1){if(_0x3947b1){return _0x3947b1?{'count':_0x35f604,'rows':_0x3947b1}:null;}})[_0x48ab('0x2d')](respondWithResult(_0x54f37f,null))[_0x48ab('0x22')](handleError(_0x54f37f,null));};exports['getSubjects']=function(_0x38cf42,_0x1d6e79,_0x311d05){var _0x5cc461={};var _0x5398f1={};var _0x552d44;var _0x1a778e;return db['ZendeskConfiguration'][_0x48ab('0x54')]({'where':{'id':_0x38cf42[_0x48ab('0x4f')]['id']}})[_0x48ab('0x2d')](handleEntityNotFound(_0x1d6e79,null))[_0x48ab('0x2d')](function(_0x144a70){if(_0x144a70){_0x552d44=_0x144a70;_0x5398f1[_0x48ab('0x38')]=_[_0x48ab('0x3a')](db['ZendeskField']['rawAttributes']);_0x5398f1[_0x48ab('0x39')]=_[_0x48ab('0x3a')](_0x38cf42[_0x48ab('0x39')]);_0x5398f1[_0x48ab('0x43')]=_['intersection'](_0x5398f1[_0x48ab('0x38')],_0x5398f1[_0x48ab('0x39')]);_0x5cc461[_0x48ab('0x3c')]=_[_0x48ab('0x3b')](_0x5398f1[_0x48ab('0x38')],qs['fields'](_0x38cf42[_0x48ab('0x39')][_0x48ab('0x3d')]));_0x5cc461[_0x48ab('0x3c')]=_0x5cc461['attributes']['length']?_0x5cc461['attributes']:_0x5398f1[_0x48ab('0x38')];_0x5cc461[_0x48ab('0x41')]=qs[_0x48ab('0x42')](_0x38cf42[_0x48ab('0x39')][_0x48ab('0x42')]);_0x5cc461[_0x48ab('0x46')]=qs[_0x48ab('0x43')](_[_0x48ab('0x44')](_0x38cf42[_0x48ab('0x39')],_0x5398f1['filters']));if(_0x38cf42[_0x48ab('0x39')][_0x48ab('0x45')]){_0x5cc461[_0x48ab('0x46')]=_[_0x48ab('0x47')](_0x5cc461[_0x48ab('0x46')],{'$or':_[_0x48ab('0x34')](_0x5cc461[_0x48ab('0x3c')],function(_0x1dd1ad){var _0x164bc9={};_0x164bc9[_0x1dd1ad]={'$like':'%'+_0x38cf42[_0x48ab('0x39')][_0x48ab('0x45')]+'%'};return _0x164bc9;})});}_0x5cc461=_[_0x48ab('0x47')]({},_0x5cc461,_0x38cf42[_0x48ab('0x49')]);return _0x552d44['getSubjects'](_0x5cc461);}})[_0x48ab('0x2d')](function(_0x5e61a2){if(_0x5e61a2){_0x1a778e=_0x5e61a2[_0x48ab('0x3e')];if(!_0x38cf42[_0x48ab('0x39')][_0x48ab('0x3f')](_0x48ab('0x40'))){_0x5cc461['limit']=qs[_0x48ab('0x26')](_0x38cf42[_0x48ab('0x39')][_0x48ab('0x26')]);_0x5cc461[_0x48ab('0x28')]=qs[_0x48ab('0x28')](_0x38cf42['query']['offset']);}return _0x552d44[_0x48ab('0x57')](_0x5cc461);}})[_0x48ab('0x2d')](function(_0x1d30bb){if(_0x1d30bb){return _0x1d30bb?{'count':_0x1a778e,'rows':_0x1d30bb}:null;}})[_0x48ab('0x2d')](respondWithResult(_0x1d6e79,null))['catch'](handleError(_0x1d6e79,null));};exports[_0x48ab('0x58')]=function(_0x2b7e2f,_0x57ee99,_0x216de4){var _0x18176e={};var _0x10b6d9={};var _0x50eef9;var _0x3b4015;return db[_0x48ab('0x35')][_0x48ab('0x54')]({'where':{'id':_0x2b7e2f[_0x48ab('0x4f')]['id']}})[_0x48ab('0x2d')](handleEntityNotFound(_0x57ee99,null))[_0x48ab('0x2d')](function(_0x5889d9){if(_0x5889d9){_0x50eef9=_0x5889d9;_0x10b6d9[_0x48ab('0x38')]=_[_0x48ab('0x3a')](db[_0x48ab('0x55')][_0x48ab('0x50')]);_0x10b6d9['query']=_[_0x48ab('0x3a')](_0x2b7e2f[_0x48ab('0x39')]);_0x10b6d9[_0x48ab('0x43')]=_[_0x48ab('0x3b')](_0x10b6d9[_0x48ab('0x38')],_0x10b6d9[_0x48ab('0x39')]);_0x18176e[_0x48ab('0x3c')]=_['intersection'](_0x10b6d9[_0x48ab('0x38')],qs['fields'](_0x2b7e2f[_0x48ab('0x39')]['fields']));_0x18176e[_0x48ab('0x3c')]=_0x18176e['attributes'][_0x48ab('0x3e')]?_0x18176e[_0x48ab('0x3c')]:_0x10b6d9[_0x48ab('0x38')];_0x18176e[_0x48ab('0x41')]=qs[_0x48ab('0x42')](_0x2b7e2f[_0x48ab('0x39')][_0x48ab('0x42')]);_0x18176e[_0x48ab('0x46')]=qs[_0x48ab('0x43')](_[_0x48ab('0x44')](_0x2b7e2f['query'],_0x10b6d9[_0x48ab('0x43')]));if(_0x2b7e2f[_0x48ab('0x39')][_0x48ab('0x45')]){_0x18176e[_0x48ab('0x46')]=_[_0x48ab('0x47')](_0x18176e[_0x48ab('0x46')],{'$or':_['map'](_0x18176e[_0x48ab('0x3c')],function(_0x1328bc){var _0x5d72b0={};_0x5d72b0[_0x1328bc]={'$like':'%'+_0x2b7e2f[_0x48ab('0x39')][_0x48ab('0x45')]+'%'};return _0x5d72b0;})});}_0x18176e=_[_0x48ab('0x47')]({},_0x18176e,_0x2b7e2f[_0x48ab('0x49')]);return _0x50eef9[_0x48ab('0x58')](_0x18176e);}})['then'](function(_0x4193fc){if(_0x4193fc){_0x3b4015=_0x4193fc[_0x48ab('0x3e')];if(!_0x2b7e2f[_0x48ab('0x39')][_0x48ab('0x3f')](_0x48ab('0x40'))){_0x18176e[_0x48ab('0x26')]=qs[_0x48ab('0x26')](_0x2b7e2f[_0x48ab('0x39')][_0x48ab('0x26')]);_0x18176e['offset']=qs[_0x48ab('0x28')](_0x2b7e2f[_0x48ab('0x39')]['offset']);}return _0x50eef9['getDescriptions'](_0x18176e);}})[_0x48ab('0x2d')](function(_0x4c7ed2){if(_0x4c7ed2){return _0x4c7ed2?{'count':_0x3b4015,'rows':_0x4c7ed2}:null;}})['then'](respondWithResult(_0x57ee99,null))[_0x48ab('0x22')](handleError(_0x57ee99,null));};exports[_0x48ab('0x59')]=function(_0x2789ea,_0x2a95c3,_0x202f33){var _0x37f2db={};var _0x5dc2ec={};var _0x513188;var _0x320dc8;return db[_0x48ab('0x35')][_0x48ab('0x54')]({'where':{'id':_0x2789ea[_0x48ab('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a95c3,null))[_0x48ab('0x2d')](function(_0x3097da){if(_0x3097da){_0x513188=_0x3097da;_0x5dc2ec[_0x48ab('0x38')]=_[_0x48ab('0x3a')](db[_0x48ab('0x5a')][_0x48ab('0x50')]);_0x5dc2ec['query']=_[_0x48ab('0x3a')](_0x2789ea[_0x48ab('0x39')]);_0x5dc2ec[_0x48ab('0x43')]=_[_0x48ab('0x3b')](_0x5dc2ec[_0x48ab('0x38')],_0x5dc2ec[_0x48ab('0x39')]);_0x37f2db[_0x48ab('0x3c')]=_[_0x48ab('0x3b')](_0x5dc2ec[_0x48ab('0x38')],qs[_0x48ab('0x3d')](_0x2789ea[_0x48ab('0x39')][_0x48ab('0x3d')]));_0x37f2db[_0x48ab('0x3c')]=_0x37f2db[_0x48ab('0x3c')][_0x48ab('0x3e')]?_0x37f2db['attributes']:_0x5dc2ec[_0x48ab('0x38')];_0x37f2db['order']=qs[_0x48ab('0x42')](_0x2789ea['query']['sort']);_0x37f2db[_0x48ab('0x46')]=qs[_0x48ab('0x43')](_[_0x48ab('0x44')](_0x2789ea['query'],_0x5dc2ec[_0x48ab('0x43')]));if(_0x2789ea[_0x48ab('0x39')][_0x48ab('0x45')]){_0x37f2db['where']=_[_0x48ab('0x47')](_0x37f2db[_0x48ab('0x46')],{'$or':_['map'](_0x37f2db[_0x48ab('0x3c')],function(_0x3b9af2){var _0x278362={};_0x278362[_0x3b9af2]={'$like':'%'+_0x2789ea[_0x48ab('0x39')][_0x48ab('0x45')]+'%'};return _0x278362;})});}_0x37f2db=_[_0x48ab('0x47')]({},_0x37f2db,_0x2789ea[_0x48ab('0x49')]);return _0x513188[_0x48ab('0x59')](_0x37f2db);}})[_0x48ab('0x2d')](function(_0x96b946){if(_0x96b946){_0x320dc8=_0x96b946[_0x48ab('0x3e')];if(!_0x2789ea[_0x48ab('0x39')]['hasOwnProperty']('nolimit')){_0x37f2db['limit']=qs[_0x48ab('0x26')](_0x2789ea['query'][_0x48ab('0x26')]);_0x37f2db['offset']=qs[_0x48ab('0x28')](_0x2789ea[_0x48ab('0x39')][_0x48ab('0x28')]);}return _0x513188[_0x48ab('0x59')](_0x37f2db);}})[_0x48ab('0x2d')](function(_0x3b636f){if(_0x3b636f){return _0x3b636f?{'count':_0x320dc8,'rows':_0x3b636f}:null;}})[_0x48ab('0x2d')](respondWithResult(_0x2a95c3,null))['catch'](handleError(_0x2a95c3,null));};exports[_0x48ab('0x5b')]=function(_0x21948f,_0x4c3fb4,_0x1ecb2c){if(_0x21948f[_0x48ab('0x53')]['id']){delete _0x21948f[_0x48ab('0x53')]['id'];}return db[_0x48ab('0x35')][_0x48ab('0x54')]({'where':{'id':_0x21948f[_0x48ab('0x4f')]['id']}})[_0x48ab('0x2d')](handleEntityNotFound(_0x4c3fb4,null))[_0x48ab('0x2d')](function(_0x120cd6){if(_0x120cd6){return _0x120cd6[_0x48ab('0x5b')](_0x21948f[_0x48ab('0x53')][_0x48ab('0x5c')]||[]);}return null;})[_0x48ab('0x2d')](respondWithResult(_0x4c3fb4,null))[_0x48ab('0x22')](handleError(_0x4c3fb4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index d9c27ac..3f235a6 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 _0xd914=['util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x4b4e70,_0x30d09b){var _0x7771a0=function(_0x2181b1){while(--_0x2181b1){_0x4b4e70['push'](_0x4b4e70['shift']());}};_0x7771a0(++_0x30d09b);}(_0xd914,0x17f));var _0x4d91=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0xd914[_0x4df85c];return _0x4e2a61;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var logger=require('../../config/logger')(_0x4d91('0x2'));var moment=require(_0x4d91('0x3'));var BPromise=require(_0x4d91('0x4'));var rp=require(_0x4d91('0x5'));var fs=require('fs');var path=require(_0x4d91('0x6'));var rimraf=require(_0x4d91('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d91('0x8'));module['exports']=function(_0x3ab6f8,_0x42d7ae){return _0x3ab6f8[_0x4d91('0x9')](_0x4d91('0xa'),attributes,{'tableName':_0x4d91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb94=['lodash','util','../../config/logger','api','moment','request-promise','path','./intZendeskConfiguration.attributes','ZendeskConfiguration'];(function(_0x4db250,_0x53ba8a){var _0x4e59da=function(_0x327a77){while(--_0x327a77){_0x4db250['push'](_0x4db250['shift']());}};_0x4e59da(++_0x53ba8a);}(_0xdb94,0xab));var _0x4db9=function(_0x2bf13a,_0x102528){_0x2bf13a=_0x2bf13a-0x0;var _0x469946=_0xdb94[_0x2bf13a];return _0x469946;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require(_0x4db9('0x2'))(_0x4db9('0x3'));var moment=require(_0x4db9('0x4'));var BPromise=require('bluebird');var rp=require(_0x4db9('0x5'));var fs=require('fs');var path=require(_0x4db9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4db9('0x7'));module['exports']=function(_0x47a3f5,_0x31dd9f){return _0x47a3f5['define'](_0x4db9('0x8'),attributes,{'tableName':'int_zendesk_configurations','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 fccedce..8630e77 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 _0xb842=['http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x3e2fa6,_0x51be36){var _0x33cad2=function(_0x237356){while(--_0x237356){_0x3e2fa6['push'](_0x3e2fa6['shift']());}};_0x33cad2(++_0x51be36);}(_0xb842,0xf4));var _0x2b84=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0xb842[_0x19e08e];return _0x14c229;};'use strict';var _=require(_0x2b84('0x0'));var util=require(_0x2b84('0x1'));var moment=require('moment');var BPromise=require(_0x2b84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b84('0x3'));var db=require(_0x2b84('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b84('0x5'));var config=require(_0x2b84('0x6'));var jayson=require(_0x2b84('0x7'));var client=jayson[_0x2b84('0x8')][_0x2b84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x401a8d,_0x20345a,_0x59737c){return new BPromise(function(_0x21a2d8,_0x2faac4){return client[_0x2b84('0xa')](_0x401a8d,_0x59737c)[_0x2b84('0xb')](function(_0x370582){logger[_0x2b84('0xc')](_0x2b84('0xd'),_0x20345a,'request\x20sent');logger[_0x2b84('0xe')](_0x2b84('0xf'),_0x20345a,_0x2b84('0x10'),JSON[_0x2b84('0x11')](_0x370582));if(_0x370582[_0x2b84('0x12')]){if(_0x370582['error'][_0x2b84('0x13')]===0x1f4){logger[_0x2b84('0x12')](_0x2b84('0xd'),_0x20345a,_0x370582[_0x2b84('0x12')][_0x2b84('0x14')]);return _0x2faac4(_0x370582[_0x2b84('0x12')][_0x2b84('0x14')]);}logger[_0x2b84('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x20345a,_0x370582[_0x2b84('0x12')]['message']);return _0x21a2d8(_0x370582[_0x2b84('0x12')][_0x2b84('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x20345a,_0x2b84('0x10'));_0x21a2d8(_0x370582[_0x2b84('0x15')][_0x2b84('0x14')]);}})[_0x2b84('0x16')](function(_0x7beb36){logger[_0x2b84('0x12')](_0x2b84('0xd'),_0x20345a,_0x7beb36);_0x2faac4(_0x7beb36);});});} \ No newline at end of file +var _0xadb7=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x586ef6,_0x52099e){var _0x49fca8=function(_0x196d04){while(--_0x196d04){_0x586ef6['push'](_0x586ef6['shift']());}};_0x49fca8(++_0x52099e);}(_0xadb7,0xe4));var _0x7adb=function(_0x2c2e5d,_0x6bce17){_0x2c2e5d=_0x2c2e5d-0x0;var _0x49bec8=_0xadb7[_0x2c2e5d];return _0x49bec8;};'use strict';var _=require(_0x7adb('0x0'));var util=require(_0x7adb('0x1'));var moment=require(_0x7adb('0x2'));var BPromise=require(_0x7adb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7adb('0x4'))['db'];var utils=require(_0x7adb('0x5'));var logger=require(_0x7adb('0x6'))(_0x7adb('0x7'));var config=require(_0x7adb('0x8'));var jayson=require(_0x7adb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d5fc6,_0x3d7518,_0x324b16){return new BPromise(function(_0xc43121,_0x815b88){return client[_0x7adb('0xa')](_0x5d5fc6,_0x324b16)[_0x7adb('0xb')](function(_0x5f082a){logger[_0x7adb('0xc')](_0x7adb('0xd'),_0x3d7518,_0x7adb('0xe'));logger['debug'](_0x7adb('0xf'),_0x3d7518,_0x7adb('0xe'),JSON[_0x7adb('0x10')](_0x5f082a));if(_0x5f082a['error']){if(_0x5f082a[_0x7adb('0x11')][_0x7adb('0x12')]===0x1f4){logger[_0x7adb('0x11')](_0x7adb('0xd'),_0x3d7518,_0x5f082a[_0x7adb('0x11')][_0x7adb('0x13')]);return _0x815b88(_0x5f082a[_0x7adb('0x11')][_0x7adb('0x13')]);}logger[_0x7adb('0x11')](_0x7adb('0xd'),_0x3d7518,_0x5f082a[_0x7adb('0x11')][_0x7adb('0x13')]);return _0xc43121(_0x5f082a[_0x7adb('0x11')][_0x7adb('0x13')]);}else{logger[_0x7adb('0xc')](_0x7adb('0xd'),_0x3d7518,_0x7adb('0xe'));_0xc43121(_0x5f082a[_0x7adb('0x14')][_0x7adb('0x13')]);}})['catch'](function(_0x74b274){logger[_0x7adb('0x11')](_0x7adb('0xd'),_0x3d7518,_0x74b274);_0x815b88(_0x74b274);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5479ee4..7879ac0 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 _0xc561=['./intZendeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xc561,0x191));var _0x1c56=function(_0x53ea1c,_0x2d4c01){_0x53ea1c=_0x53ea1c-0x0;var _0x29dbb5=_0xc561[_0x53ea1c];return _0x29dbb5;};'use strict';var multer=require(_0x1c56('0x0'));var util=require(_0x1c56('0x1'));var path=require(_0x1c56('0x2'));var timeout=require(_0x1c56('0x3'));var express=require('express');var router=express[_0x1c56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1c56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1c56('0x6'));var controller=require(_0x1c56('0x7'));router[_0x1c56('0x8')]('/',auth[_0x1c56('0x9')](),controller[_0x1c56('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1c56('0xb')]);router[_0x1c56('0xc')]('/',auth[_0x1c56('0x9')](),controller[_0x1c56('0xd')]);router[_0x1c56('0xe')](_0x1c56('0xf'),auth[_0x1c56('0x9')](),controller['update']);router['delete'](_0x1c56('0xf'),auth[_0x1c56('0x9')](),controller[_0x1c56('0x10')]);module['exports']=router; \ No newline at end of file +var _0x94fd=['post','create','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1ea88f,_0x14d0de){var _0x2c81af=function(_0x200995){while(--_0x200995){_0x1ea88f['push'](_0x1ea88f['shift']());}};_0x2c81af(++_0x14d0de);}(_0x94fd,0x190));var _0xd94f=function(_0x29fafb,_0x3ebc65){_0x29fafb=_0x29fafb-0x0;var _0x11b1b6=_0x94fd[_0x29fafb];return _0x11b1b6;};'use strict';var multer=require(_0xd94f('0x0'));var util=require(_0xd94f('0x1'));var path=require(_0xd94f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd94f('0x3')]();var fs_extra=require(_0xd94f('0x4'));var auth=require(_0xd94f('0x5'));var interaction=require(_0xd94f('0x6'));var config=require(_0xd94f('0x7'));var controller=require(_0xd94f('0x8'));router[_0xd94f('0x9')]('/',auth[_0xd94f('0xa')](),controller[_0xd94f('0xb')]);router[_0xd94f('0x9')](_0xd94f('0xc'),auth[_0xd94f('0xa')](),controller[_0xd94f('0xd')]);router[_0xd94f('0xe')]('/',auth[_0xd94f('0xa')](),controller[_0xd94f('0xf')]);router['put'](_0xd94f('0xc'),auth['isAuthenticated'](),controller[_0xd94f('0x10')]);router['delete'](_0xd94f('0xc'),auth[_0xd94f('0xa')](),controller['destroy']);module[_0xd94f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2d98b61..ad96fd8 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 _0x3585=['BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING','customVariable'];(function(_0x3a517b,_0x3bda2c){var _0x18c595=function(_0x3a8185){while(--_0x3a8185){_0x3a517b['push'](_0x3a517b['shift']());}};_0x18c595(++_0x3bda2c);}(_0x3585,0x83));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5358('0x0'));module[_0x5358('0x1')]={'type':{'type':Sequelize[_0x5358('0x2')]('string',_0x5358('0x3'),'customVariable',_0x5358('0x4'),_0x5358('0x5')),'defaultValue':_0x5358('0x6')},'content':{'type':Sequelize[_0x5358('0x7')]},'key':{'type':Sequelize[_0x5358('0x7')]},'keyType':{'type':Sequelize[_0x5358('0x2')](_0x5358('0x6'),_0x5358('0x3'),_0x5358('0x8'))},'keyContent':{'type':Sequelize[_0x5358('0x7')]},'idField':{'type':Sequelize[_0x5358('0x7')]},'nameField':{'type':Sequelize[_0x5358('0x7')]},'customField':{'type':Sequelize[_0x5358('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd47a=['STRING','sequelize','string','variable','customVariable','picklist'];(function(_0x133ccf,_0x296c61){var _0x36c6d9=function(_0x1e622f){while(--_0x1e622f){_0x133ccf['push'](_0x133ccf['shift']());}};_0x36c6d9(++_0x296c61);}(_0xd47a,0x115));var _0xad47=function(_0x4586f9,_0x39aee8){_0x4586f9=_0x4586f9-0x0;var _0x41d034=_0xd47a[_0x4586f9];return _0x41d034;};'use strict';var Sequelize=require(_0xad47('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xad47('0x1'),_0xad47('0x2'),_0xad47('0x3'),'keyValue',_0xad47('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xad47('0x5')]},'key':{'type':Sequelize[_0xad47('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xad47('0x1'),'variable',_0xad47('0x3'))},'keyContent':{'type':Sequelize[_0xad47('0x5')]},'idField':{'type':Sequelize[_0xad47('0x5')]},'nameField':{'type':Sequelize[_0xad47('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad47('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index cdce3c2..0d0074d 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 _0x3ef3=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','map','ZendeskField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x272876,_0x478630){var _0x11619e=function(_0x213469){while(--_0x213469){_0x272876['push'](_0x272876['shift']());}};_0x11619e(++_0x478630);}(_0x3ef3,0x1ee));var _0x33ef=function(_0x40788e,_0x539bc0){_0x40788e=_0x40788e-0x0;var _0x3323db=_0x3ef3[_0x40788e];return _0x3323db;};'use strict';var emlformat=require(_0x33ef('0x0'));var rimraf=require(_0x33ef('0x1'));var zipdir=require(_0x33ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33ef('0x3'));var moment=require(_0x33ef('0x4'));var BPromise=require(_0x33ef('0x5'));var Mustache=require(_0x33ef('0x6'));var util=require(_0x33ef('0x7'));var path=require('path');var sox=require(_0x33ef('0x8'));var csv=require('to-csv');var ejs=require(_0x33ef('0x9'));var fs=require('fs');var fs_extra=require(_0x33ef('0xa'));var _=require(_0x33ef('0xb'));var squel=require(_0x33ef('0xc'));var crypto=require(_0x33ef('0xd'));var jsforce=require(_0x33ef('0xe'));var deskjs=require(_0x33ef('0xf'));var toCsv=require(_0x33ef('0x10'));var querystring=require(_0x33ef('0x11'));var Papa=require(_0x33ef('0x12'));var Redis=require(_0x33ef('0x13'));var authService=require(_0x33ef('0x14'));var qs=require(_0x33ef('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33ef('0x16'));var logger=require(_0x33ef('0x17'))(_0x33ef('0x18'));var utils=require(_0x33ef('0x19'));var config=require(_0x33ef('0x1a'));var licenseUtil=require(_0x33ef('0x1b'));var db=require(_0x33ef('0x1c'))['db'];function respondWithStatusCode(_0x4d63fb,_0x5dda39){_0x5dda39=_0x5dda39||0xcc;return function(_0x26f1b9){if(_0x26f1b9){return _0x4d63fb[_0x33ef('0x1d')](_0x5dda39);}return _0x4d63fb['status'](_0x5dda39)['end']();};}function respondWithResult(_0x5ce840,_0x32fd71){_0x32fd71=_0x32fd71||0xc8;return function(_0x5a825b){if(_0x5a825b){return _0x5ce840[_0x33ef('0x1e')](_0x32fd71)[_0x33ef('0x1f')](_0x5a825b);}};}function respondWithFilteredResult(_0x2d78da,_0x576598){return function(_0x2aa1e7){if(_0x2aa1e7){var _0x567f85=typeof _0x576598[_0x33ef('0x20')]===_0x33ef('0x21')&&typeof _0x576598[_0x33ef('0x22')]===_0x33ef('0x21');var _0xd24586=_0x2aa1e7['count'];var _0x427bee=_0x567f85?0x0:_0x576598[_0x33ef('0x20')];var _0x57f99a=_0x567f85?_0x2aa1e7[_0x33ef('0x23')]:_0x576598[_0x33ef('0x20')]+_0x576598['limit'];var _0x5cadba;if(_0x57f99a>=_0xd24586){_0x57f99a=_0xd24586;_0x5cadba=0xc8;}else{_0x5cadba=0xce;}_0x2d78da[_0x33ef('0x1e')](_0x5cadba);return _0x2d78da[_0x33ef('0x24')]('Content-Range',_0x427bee+'-'+_0x57f99a+'/'+_0xd24586)[_0x33ef('0x1f')](_0x2aa1e7);}return null;};}function patchUpdates(_0x439286){return function(_0x501a46){try{jsonpatch[_0x33ef('0x25')](_0x501a46,_0x439286,!![]);}catch(_0x1224d3){return BPromise[_0x33ef('0x26')](_0x1224d3);}return _0x501a46[_0x33ef('0x27')]();};}function saveUpdates(_0x249c80,_0x256c62){return function(_0xaa8f5c){if(_0xaa8f5c){return _0xaa8f5c[_0x33ef('0x28')](_0x249c80)[_0x33ef('0x29')](function(_0x255a1d){return _0x255a1d;});}return null;};}function removeEntity(_0x4d4ded,_0x597f12){return function(_0x42efd3){if(_0x42efd3){return _0x42efd3['destroy']()[_0x33ef('0x29')](function(){_0x4d4ded[_0x33ef('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb9f4,_0x426531){return function(_0x4bf11e){if(!_0x4bf11e){_0x1fb9f4[_0x33ef('0x1d')](0x194);}return _0x4bf11e;};}function handleError(_0x8a4d03,_0x3eaa6a){_0x3eaa6a=_0x3eaa6a||0x1f4;return function(_0x548225){logger['error'](_0x548225[_0x33ef('0x2a')]);if(_0x548225[_0x33ef('0x2b')]){delete _0x548225['name'];}_0x8a4d03[_0x33ef('0x1e')](_0x3eaa6a)[_0x33ef('0x2c')](_0x548225);};}exports['index']=function(_0x24beed,_0x170cd3){var _0x38e812={},_0x213b08={},_0x22096d={'count':0x0,'rows':[]};var _0x2ed17a=_[_0x33ef('0x2d')](db[_0x33ef('0x2e')][_0x33ef('0x2f')],function(_0x37dbeb){return{'name':_0x37dbeb['fieldName'],'type':_0x37dbeb[_0x33ef('0x30')][_0x33ef('0x31')]};});_0x213b08[_0x33ef('0x32')]=_[_0x33ef('0x2d')](_0x2ed17a,'name');_0x213b08['query']=_[_0x33ef('0x33')](_0x24beed[_0x33ef('0x34')]);_0x213b08[_0x33ef('0x35')]=_[_0x33ef('0x36')](_0x213b08[_0x33ef('0x32')],_0x213b08[_0x33ef('0x34')]);_0x38e812[_0x33ef('0x37')]=_[_0x33ef('0x36')](_0x213b08['model'],qs[_0x33ef('0x38')](_0x24beed[_0x33ef('0x34')]['fields']));_0x38e812[_0x33ef('0x37')]=_0x38e812['attributes'][_0x33ef('0x39')]?_0x38e812[_0x33ef('0x37')]:_0x213b08[_0x33ef('0x32')];if(!_0x24beed[_0x33ef('0x34')][_0x33ef('0x3a')](_0x33ef('0x3b'))){_0x38e812[_0x33ef('0x22')]=qs[_0x33ef('0x22')](_0x24beed[_0x33ef('0x34')][_0x33ef('0x22')]);_0x38e812['offset']=qs[_0x33ef('0x20')](_0x24beed[_0x33ef('0x34')][_0x33ef('0x20')]);}_0x38e812[_0x33ef('0x3c')]=qs['sort'](_0x24beed[_0x33ef('0x34')]['sort']);_0x38e812[_0x33ef('0x3d')]=qs['filters'](_['pick'](_0x24beed[_0x33ef('0x34')],_0x213b08[_0x33ef('0x35')]),_0x2ed17a);if(_0x24beed['query'][_0x33ef('0x3e')]){_0x38e812[_0x33ef('0x3d')]=_[_0x33ef('0x3f')](_0x38e812['where'],{'$or':_[_0x33ef('0x2d')](_0x2ed17a,function(_0x421f9c){if(_0x421f9c[_0x33ef('0x30')]!==_0x33ef('0x40')){var _0x1d9220={};_0x1d9220[_0x421f9c[_0x33ef('0x2b')]]={'$like':'%'+_0x24beed['query'][_0x33ef('0x3e')]+'%'};return _0x1d9220;}})});}_0x38e812=_[_0x33ef('0x3f')]({},_0x38e812,_0x24beed[_0x33ef('0x41')]);var _0x563a76={'where':_0x38e812[_0x33ef('0x3d')]};return db[_0x33ef('0x2e')][_0x33ef('0x23')](_0x563a76)[_0x33ef('0x29')](function(_0x1e4005){_0x22096d[_0x33ef('0x23')]=_0x1e4005;if(_0x24beed[_0x33ef('0x34')][_0x33ef('0x42')]){_0x38e812[_0x33ef('0x43')]=[{'all':!![]}];}return db[_0x33ef('0x2e')][_0x33ef('0x44')](_0x38e812);})[_0x33ef('0x29')](function(_0x2cb2ac){_0x22096d['rows']=_0x2cb2ac;return _0x22096d;})[_0x33ef('0x29')](respondWithFilteredResult(_0x170cd3,_0x38e812))['catch'](handleError(_0x170cd3,null));};exports[_0x33ef('0x45')]=function(_0x5da4d3,_0x9cf06d){var _0x28bf5d={'raw':!![],'where':{'id':_0x5da4d3[_0x33ef('0x46')]['id']}},_0x517db3={};_0x517db3[_0x33ef('0x32')]=_[_0x33ef('0x33')](db[_0x33ef('0x2e')][_0x33ef('0x2f')]);_0x517db3[_0x33ef('0x34')]=_[_0x33ef('0x33')](_0x5da4d3['query']);_0x517db3[_0x33ef('0x35')]=_[_0x33ef('0x36')](_0x517db3['model'],_0x517db3[_0x33ef('0x34')]);_0x28bf5d[_0x33ef('0x37')]=_[_0x33ef('0x36')](_0x517db3[_0x33ef('0x32')],qs[_0x33ef('0x38')](_0x5da4d3[_0x33ef('0x34')]['fields']));_0x28bf5d['attributes']=_0x28bf5d[_0x33ef('0x37')][_0x33ef('0x39')]?_0x28bf5d[_0x33ef('0x37')]:_0x517db3[_0x33ef('0x32')];if(_0x5da4d3[_0x33ef('0x34')][_0x33ef('0x42')]){_0x28bf5d[_0x33ef('0x43')]=[{'all':!![]}];}_0x28bf5d=_['merge']({},_0x28bf5d,_0x5da4d3[_0x33ef('0x41')]);return db['ZendeskField']['find'](_0x28bf5d)[_0x33ef('0x29')](handleEntityNotFound(_0x9cf06d,null))[_0x33ef('0x29')](respondWithResult(_0x9cf06d,null))[_0x33ef('0x47')](handleError(_0x9cf06d,null));};exports[_0x33ef('0x48')]=function(_0x4d98d2,_0x5cc663){return db[_0x33ef('0x2e')][_0x33ef('0x48')](_0x4d98d2['body'],{})['then'](respondWithResult(_0x5cc663,0xc9))[_0x33ef('0x47')](handleError(_0x5cc663,null));};exports[_0x33ef('0x28')]=function(_0x50f0ce,_0x38b75c){if(_0x50f0ce['body']['id']){delete _0x50f0ce['body']['id'];}return db[_0x33ef('0x2e')][_0x33ef('0x49')]({'where':{'id':_0x50f0ce[_0x33ef('0x46')]['id']}})['then'](handleEntityNotFound(_0x38b75c,null))[_0x33ef('0x29')](saveUpdates(_0x50f0ce['body'],null))['then'](respondWithResult(_0x38b75c,null))['catch'](handleError(_0x38b75c,null));};exports[_0x33ef('0x4a')]=function(_0x2286da,_0x43737a){return db[_0x33ef('0x2e')][_0x33ef('0x49')]({'where':{'id':_0x2286da['params']['id']}})[_0x33ef('0x29')](handleEntityNotFound(_0x43737a,null))[_0x33ef('0x29')](removeEntity(_0x43737a,null))[_0x33ef('0x47')](handleError(_0x43737a,null));}; \ No newline at end of file +var _0x57f4=['sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','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'];(function(_0x48788c,_0x22c6cf){var _0x111b0f=function(_0x4087db){while(--_0x4087db){_0x48788c['push'](_0x48788c['shift']());}};_0x111b0f(++_0x22c6cf);}(_0x57f4,0xcb));var _0x457f=function(_0x58c36e,_0x26eb72){_0x58c36e=_0x58c36e-0x0;var _0x5af133=_0x57f4[_0x58c36e];return _0x5af133;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x457f('0x0'));var zipdir=require(_0x457f('0x1'));var jsonpatch=require(_0x457f('0x2'));var rp=require(_0x457f('0x3'));var moment=require('moment');var BPromise=require(_0x457f('0x4'));var Mustache=require('mustache');var util=require(_0x457f('0x5'));var path=require(_0x457f('0x6'));var sox=require('sox');var csv=require(_0x457f('0x7'));var ejs=require(_0x457f('0x8'));var fs=require('fs');var fs_extra=require(_0x457f('0x9'));var _=require(_0x457f('0xa'));var squel=require(_0x457f('0xb'));var crypto=require(_0x457f('0xc'));var jsforce=require(_0x457f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x457f('0xe'));var Papa=require(_0x457f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x457f('0x10'));var as=require(_0x457f('0x11'));var hardwareService=require(_0x457f('0x12'));var logger=require(_0x457f('0x13'))(_0x457f('0x14'));var utils=require(_0x457f('0x15'));var config=require(_0x457f('0x16'));var licenseUtil=require(_0x457f('0x17'));var db=require(_0x457f('0x18'))['db'];function respondWithStatusCode(_0xdb1f1e,_0x6eef44){_0x6eef44=_0x6eef44||0xcc;return function(_0x1ca3ca){if(_0x1ca3ca){return _0xdb1f1e[_0x457f('0x19')](_0x6eef44);}return _0xdb1f1e[_0x457f('0x1a')](_0x6eef44)[_0x457f('0x1b')]();};}function respondWithResult(_0x5342f1,_0x31b91d){_0x31b91d=_0x31b91d||0xc8;return function(_0x36ef93){if(_0x36ef93){return _0x5342f1[_0x457f('0x1a')](_0x31b91d)['json'](_0x36ef93);}};}function respondWithFilteredResult(_0x44ebe1,_0x46dda3){return function(_0x593f2e){if(_0x593f2e){var _0x5e4d61=typeof _0x46dda3['offset']===_0x457f('0x1c')&&typeof _0x46dda3[_0x457f('0x1d')]===_0x457f('0x1c');var _0x3709f8=_0x593f2e[_0x457f('0x1e')];var _0x1c0320=_0x5e4d61?0x0:_0x46dda3[_0x457f('0x1f')];var _0x5dd555=_0x5e4d61?_0x593f2e[_0x457f('0x1e')]:_0x46dda3[_0x457f('0x1f')]+_0x46dda3[_0x457f('0x1d')];var _0x55aacf;if(_0x5dd555>=_0x3709f8){_0x5dd555=_0x3709f8;_0x55aacf=0xc8;}else{_0x55aacf=0xce;}_0x44ebe1[_0x457f('0x1a')](_0x55aacf);return _0x44ebe1['set'](_0x457f('0x20'),_0x1c0320+'-'+_0x5dd555+'/'+_0x3709f8)[_0x457f('0x21')](_0x593f2e);}return null;};}function patchUpdates(_0x63561d){return function(_0x3dd189){try{jsonpatch[_0x457f('0x22')](_0x3dd189,_0x63561d,!![]);}catch(_0x2ef45a){return BPromise[_0x457f('0x23')](_0x2ef45a);}return _0x3dd189[_0x457f('0x24')]();};}function saveUpdates(_0x18a8df,_0x2f7d47){return function(_0x537816){if(_0x537816){return _0x537816[_0x457f('0x25')](_0x18a8df)[_0x457f('0x26')](function(_0x59b9ce){return _0x59b9ce;});}return null;};}function removeEntity(_0x37f6aa,_0x269f53){return function(_0x1839dd){if(_0x1839dd){return _0x1839dd[_0x457f('0x27')]()[_0x457f('0x26')](function(){_0x37f6aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b2e4,_0x66d6e){return function(_0x421bb4){if(!_0x421bb4){_0x48b2e4[_0x457f('0x19')](0x194);}return _0x421bb4;};}function handleError(_0x2be7be,_0x15848e){_0x15848e=_0x15848e||0x1f4;return function(_0x61959b){logger[_0x457f('0x28')](_0x61959b[_0x457f('0x29')]);if(_0x61959b[_0x457f('0x2a')]){delete _0x61959b[_0x457f('0x2a')];}_0x2be7be[_0x457f('0x1a')](_0x15848e)[_0x457f('0x2b')](_0x61959b);};}exports[_0x457f('0x2c')]=function(_0x25d4bb,_0x261708){var _0x37ac6d={},_0x59836d={},_0x455999={'count':0x0,'rows':[]};var _0x3e846f=_[_0x457f('0x2d')](db[_0x457f('0x2e')][_0x457f('0x2f')],function(_0x322dfa){return{'name':_0x322dfa[_0x457f('0x30')],'type':_0x322dfa['type']['key']};});_0x59836d[_0x457f('0x31')]=_[_0x457f('0x2d')](_0x3e846f,_0x457f('0x2a'));_0x59836d[_0x457f('0x32')]=_[_0x457f('0x33')](_0x25d4bb[_0x457f('0x32')]);_0x59836d[_0x457f('0x34')]=_[_0x457f('0x35')](_0x59836d['model'],_0x59836d[_0x457f('0x32')]);_0x37ac6d['attributes']=_[_0x457f('0x35')](_0x59836d[_0x457f('0x31')],qs[_0x457f('0x36')](_0x25d4bb[_0x457f('0x32')][_0x457f('0x36')]));_0x37ac6d[_0x457f('0x37')]=_0x37ac6d['attributes'][_0x457f('0x38')]?_0x37ac6d['attributes']:_0x59836d[_0x457f('0x31')];if(!_0x25d4bb[_0x457f('0x32')][_0x457f('0x39')]('nolimit')){_0x37ac6d[_0x457f('0x1d')]=qs[_0x457f('0x1d')](_0x25d4bb[_0x457f('0x32')]['limit']);_0x37ac6d[_0x457f('0x1f')]=qs['offset'](_0x25d4bb['query'][_0x457f('0x1f')]);}_0x37ac6d[_0x457f('0x3a')]=qs[_0x457f('0x3b')](_0x25d4bb[_0x457f('0x32')][_0x457f('0x3b')]);_0x37ac6d[_0x457f('0x3c')]=qs[_0x457f('0x34')](_[_0x457f('0x3d')](_0x25d4bb[_0x457f('0x32')],_0x59836d['filters']),_0x3e846f);if(_0x25d4bb[_0x457f('0x32')]['filter']){_0x37ac6d['where']=_[_0x457f('0x3e')](_0x37ac6d[_0x457f('0x3c')],{'$or':_['map'](_0x3e846f,function(_0x45f3ee){if(_0x45f3ee[_0x457f('0x3f')]!==_0x457f('0x40')){var _0x1c3d42={};_0x1c3d42[_0x45f3ee['name']]={'$like':'%'+_0x25d4bb['query']['filter']+'%'};return _0x1c3d42;}})});}_0x37ac6d=_['merge']({},_0x37ac6d,_0x25d4bb['options']);var _0x471d4e={'where':_0x37ac6d[_0x457f('0x3c')]};return db[_0x457f('0x2e')][_0x457f('0x1e')](_0x471d4e)[_0x457f('0x26')](function(_0x1c9d1d){_0x455999[_0x457f('0x1e')]=_0x1c9d1d;if(_0x25d4bb[_0x457f('0x32')][_0x457f('0x41')]){_0x37ac6d[_0x457f('0x42')]=[{'all':!![]}];}return db[_0x457f('0x2e')][_0x457f('0x43')](_0x37ac6d);})[_0x457f('0x26')](function(_0x120f96){_0x455999[_0x457f('0x44')]=_0x120f96;return _0x455999;})[_0x457f('0x26')](respondWithFilteredResult(_0x261708,_0x37ac6d))[_0x457f('0x45')](handleError(_0x261708,null));};exports[_0x457f('0x46')]=function(_0x4e5b67,_0x27b3e1){var _0x4b7410={'raw':!![],'where':{'id':_0x4e5b67[_0x457f('0x47')]['id']}},_0x23000c={};_0x23000c[_0x457f('0x31')]=_[_0x457f('0x33')](db[_0x457f('0x2e')]['rawAttributes']);_0x23000c[_0x457f('0x32')]=_[_0x457f('0x33')](_0x4e5b67[_0x457f('0x32')]);_0x23000c[_0x457f('0x34')]=_[_0x457f('0x35')](_0x23000c[_0x457f('0x31')],_0x23000c[_0x457f('0x32')]);_0x4b7410[_0x457f('0x37')]=_[_0x457f('0x35')](_0x23000c[_0x457f('0x31')],qs['fields'](_0x4e5b67['query'][_0x457f('0x36')]));_0x4b7410[_0x457f('0x37')]=_0x4b7410[_0x457f('0x37')]['length']?_0x4b7410[_0x457f('0x37')]:_0x23000c[_0x457f('0x31')];if(_0x4e5b67[_0x457f('0x32')][_0x457f('0x41')]){_0x4b7410[_0x457f('0x42')]=[{'all':!![]}];}_0x4b7410=_['merge']({},_0x4b7410,_0x4e5b67[_0x457f('0x48')]);return db[_0x457f('0x2e')][_0x457f('0x49')](_0x4b7410)[_0x457f('0x26')](handleEntityNotFound(_0x27b3e1,null))['then'](respondWithResult(_0x27b3e1,null))[_0x457f('0x45')](handleError(_0x27b3e1,null));};exports[_0x457f('0x4a')]=function(_0x1cb24a,_0x31129a){return db[_0x457f('0x2e')]['create'](_0x1cb24a[_0x457f('0x4b')],{})[_0x457f('0x26')](respondWithResult(_0x31129a,0xc9))[_0x457f('0x45')](handleError(_0x31129a,null));};exports[_0x457f('0x25')]=function(_0x4128d7,_0x52754f){if(_0x4128d7['body']['id']){delete _0x4128d7['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x4128d7[_0x457f('0x47')]['id']}})[_0x457f('0x26')](handleEntityNotFound(_0x52754f,null))[_0x457f('0x26')](saveUpdates(_0x4128d7[_0x457f('0x4b')],null))[_0x457f('0x26')](respondWithResult(_0x52754f,null))[_0x457f('0x45')](handleError(_0x52754f,null));};exports[_0x457f('0x27')]=function(_0x317b4d,_0x423605){return db[_0x457f('0x2e')][_0x457f('0x49')]({'where':{'id':_0x317b4d[_0x457f('0x47')]['id']}})[_0x457f('0x26')](handleEntityNotFound(_0x423605,null))[_0x457f('0x26')](removeEntity(_0x423605,null))[_0x457f('0x45')](handleError(_0x423605,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 6e07123..ff816db 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 _0xf23b=['idField','FieldId','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x308953,_0x3893a4){var _0x3b4197=function(_0x1e676a){while(--_0x1e676a){_0x308953['push'](_0x308953['shift']());}};_0x3b4197(++_0x3893a4);}(_0xf23b,0x72));var _0xbf23=function(_0x5413b1,_0x67022d){_0x5413b1=_0x5413b1-0x0;var _0x23347e=_0xf23b[_0x5413b1];return _0x23347e;};'use strict';var _=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var logger=require('../../config/logger')(_0xbf23('0x2'));var moment=require(_0xbf23('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf23('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf23('0x5'));var config=require(_0xbf23('0x6'));var attributes=require(_0xbf23('0x7'));module['exports']=function(_0x12a0f1,_0x3227fa){return _0x12a0f1[_0xbf23('0x8')](_0xbf23('0x9'),attributes,{'tableName':_0xbf23('0xa'),'paranoid':![],'indexes':[{'name':_0xbf23('0xb'),'fields':[_0xbf23('0xc'),_0xbf23('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x565c=['../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x153091,_0x5722dc){var _0x435a6d=function(_0x5358b1){while(--_0x5358b1){_0x153091['push'](_0x153091['shift']());}};_0x435a6d(++_0x5722dc);}(_0x565c,0xe9));var _0xc565=function(_0x51d25f,_0x4037e3){_0x51d25f=_0x51d25f-0x0;var _0x2c8a01=_0x565c[_0x51d25f];return _0x2c8a01;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc565('0x0'))(_0xc565('0x1'));var moment=require(_0xc565('0x2'));var BPromise=require(_0xc565('0x3'));var rp=require(_0xc565('0x4'));var fs=require('fs');var path=require(_0xc565('0x5'));var rimraf=require(_0xc565('0x6'));var config=require(_0xc565('0x7'));var attributes=require('./intZendeskField.attributes');module[_0xc565('0x8')]=function(_0x234032,_0x3c39c0){return _0x234032[_0xc565('0x9')](_0xc565('0xa'),attributes,{'tableName':_0xc565('0xb'),'paranoid':![],'indexes':[{'name':_0xc565('0xc'),'fields':[_0xc565('0xd'),_0xc565('0xe')],'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 714cc2a..fe1272f 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 _0x8216=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x8216,0x183));var _0x6821=function(_0x3d3950,_0x471be7){_0x3d3950=_0x3d3950-0x0;var _0x27d361=_0x8216[_0x3d3950];return _0x27d361;};'use strict';var _=require(_0x6821('0x0'));var util=require(_0x6821('0x1'));var moment=require(_0x6821('0x2'));var BPromise=require(_0x6821('0x3'));var rs=require(_0x6821('0x4'));var fs=require('fs');var Redis=require(_0x6821('0x5'));var db=require(_0x6821('0x6'))['db'];var utils=require(_0x6821('0x7'));var logger=require(_0x6821('0x8'))(_0x6821('0x9'));var config=require(_0x6821('0xa'));var jayson=require(_0x6821('0xb'));var client=jayson[_0x6821('0xc')][_0x6821('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x134893,_0x18d46f,_0x369dc1){return new BPromise(function(_0x465d35,_0x41b713){return client[_0x6821('0xe')](_0x134893,_0x369dc1)[_0x6821('0xf')](function(_0x13473c){logger[_0x6821('0x10')](_0x6821('0x11'),_0x18d46f,_0x6821('0x12'));logger[_0x6821('0x13')](_0x6821('0x14'),_0x18d46f,'request\x20sent',JSON[_0x6821('0x15')](_0x13473c));if(_0x13473c[_0x6821('0x16')]){if(_0x13473c[_0x6821('0x16')]['code']===0x1f4){logger[_0x6821('0x16')](_0x6821('0x11'),_0x18d46f,_0x13473c['error']['message']);return _0x41b713(_0x13473c[_0x6821('0x16')]['message']);}logger[_0x6821('0x16')](_0x6821('0x11'),_0x18d46f,_0x13473c[_0x6821('0x16')][_0x6821('0x17')]);return _0x465d35(_0x13473c[_0x6821('0x16')][_0x6821('0x17')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x18d46f,'request\x20sent');_0x465d35(_0x13473c[_0x6821('0x18')][_0x6821('0x17')]);}})[_0x6821('0x19')](function(_0x5692b3){logger['error']('ZendeskField,\x20%s,\x20%s',_0x18d46f,_0x5692b3);_0x41b713(_0x5692b3);});});} \ No newline at end of file +var _0xb963=['message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c8540,_0x1243ae){var _0x32f264=function(_0x4b3cd7){while(--_0x4b3cd7){_0x4c8540['push'](_0x4c8540['shift']());}};_0x32f264(++_0x1243ae);}(_0xb963,0x17e));var _0x3b96=function(_0x146108,_0x49550d){_0x146108=_0x146108-0x0;var _0x1ae345=_0xb963[_0x146108];return _0x1ae345;};'use strict';var _=require('lodash');var util=require(_0x3b96('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3b96('0x1'));var fs=require('fs');var Redis=require(_0x3b96('0x2'));var db=require(_0x3b96('0x3'))['db'];var utils=require(_0x3b96('0x4'));var logger=require('../../config/logger')(_0x3b96('0x5'));var config=require(_0x3b96('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3b96('0x7')][_0x3b96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49fe57,_0x1fd9f5,_0x24b9db){return new BPromise(function(_0x195e50,_0x586600){return client[_0x3b96('0x9')](_0x49fe57,_0x24b9db)[_0x3b96('0xa')](function(_0x168c42){logger[_0x3b96('0xb')](_0x3b96('0xc'),_0x1fd9f5,_0x3b96('0xd'));logger['debug'](_0x3b96('0xe'),_0x1fd9f5,'request\x20sent',JSON[_0x3b96('0xf')](_0x168c42));if(_0x168c42[_0x3b96('0x10')]){if(_0x168c42[_0x3b96('0x10')][_0x3b96('0x11')]===0x1f4){logger['error'](_0x3b96('0xc'),_0x1fd9f5,_0x168c42[_0x3b96('0x10')][_0x3b96('0x12')]);return _0x586600(_0x168c42[_0x3b96('0x10')][_0x3b96('0x12')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x1fd9f5,_0x168c42[_0x3b96('0x10')][_0x3b96('0x12')]);return _0x195e50(_0x168c42[_0x3b96('0x10')][_0x3b96('0x12')]);}else{logger[_0x3b96('0xb')](_0x3b96('0xc'),_0x1fd9f5,_0x3b96('0xd'));_0x195e50(_0x168c42['result']['message']);}})[_0x3b96('0x13')](function(_0x38bdc4){logger[_0x3b96('0x10')](_0x3b96('0xc'),_0x1fd9f5,_0x38bdc4);_0x586600(_0x38bdc4);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 2cb8c82..ee48e30 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 _0x33cf=['../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x282630,_0x1fcf6a){var _0x34078b=function(_0x43cc9e){while(--_0x43cc9e){_0x282630['push'](_0x282630['shift']());}};_0x34078b(++_0x1fcf6a);}(_0x33cf,0x14a));var _0xf33c=function(_0x425da6,_0x20676f){_0x425da6=_0x425da6-0x0;var _0x360ed1=_0x33cf[_0x425da6];return _0x360ed1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf33c('0x0'));var timeout=require(_0xf33c('0x1'));var express=require(_0xf33c('0x2'));var router=express[_0xf33c('0x3')]();var fs_extra=require(_0xf33c('0x4'));var auth=require(_0xf33c('0x5'));var interaction=require(_0xf33c('0x6'));var config=require(_0xf33c('0x7'));var controller=require(_0xf33c('0x8'));router['get']('/',auth[_0xf33c('0x9')](),controller[_0xf33c('0xa')]);router['get']('/:id',auth[_0xf33c('0x9')](),controller['show']);router[_0xf33c('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xf33c('0xc')]);router[_0xf33c('0xb')]('/:id/fields',auth[_0xf33c('0x9')](),controller[_0xf33c('0xd')]);router[_0xf33c('0xe')]('/',auth[_0xf33c('0x9')](),controller[_0xf33c('0xf')]);router[_0xf33c('0xe')](_0xf33c('0x10'),auth[_0xf33c('0x9')](),controller[_0xf33c('0x11')]);router['put'](_0xf33c('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xf33c('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf33c('0x14')]=router; \ No newline at end of file +var _0xc803=['put','update','delete','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','/:id/configurations','/:id/fields','getFields','create','post'];(function(_0xbf215b,_0x5abb5d){var _0x4bb0cc=function(_0x46ac58){while(--_0x46ac58){_0xbf215b['push'](_0xbf215b['shift']());}};_0x4bb0cc(++_0x5abb5d);}(_0xc803,0x1b9));var _0x3c80=function(_0xf549a4,_0x58c9cd){_0xf549a4=_0xf549a4-0x0;var _0x57bf42=_0xc803[_0xf549a4];return _0x57bf42;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3c80('0x0'));var express=require(_0x3c80('0x1'));var router=express[_0x3c80('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3c80('0x3'));var interaction=require(_0x3c80('0x4'));var config=require(_0x3c80('0x5'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x3c80('0x6')](),controller[_0x3c80('0x7')]);router['get']('/:id',auth[_0x3c80('0x6')](),controller[_0x3c80('0x8')]);router[_0x3c80('0x9')](_0x3c80('0xa'),auth[_0x3c80('0x6')](),controller['getConfigurations']);router['get'](_0x3c80('0xb'),auth[_0x3c80('0x6')](),controller[_0x3c80('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3c80('0xd')]);router[_0x3c80('0xe')](_0x3c80('0xa'),auth[_0x3c80('0x6')](),controller['addConfiguration']);router[_0x3c80('0xf')]('/:id',auth[_0x3c80('0x6')](),controller[_0x3c80('0x10')]);router[_0x3c80('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3c80('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index b12d461..1e2b776 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 _0xedd9=['exports','STRING'];(function(_0x233e15,_0x1a5399){var _0x187723=function(_0x33a369){while(--_0x33a369){_0x233e15['push'](_0x233e15['shift']());}};_0x187723(++_0x1a5399);}(_0xedd9,0xfc));var _0x9edd=function(_0x36936b,_0x47abad){_0x36936b=_0x36936b-0x0;var _0x5ebf66=_0xedd9[_0x36936b];return _0x5ebf66;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')]},'description':{'type':Sequelize[_0x9edd('0x1')]},'host':{'type':Sequelize[_0x9edd('0x1')]},'zone':{'type':Sequelize[_0x9edd('0x1')]},'clientId':{'type':Sequelize[_0x9edd('0x1')]},'clientSecret':{'type':Sequelize[_0x9edd('0x1')]},'serverUrl':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x9edd('0x1')]}}; \ No newline at end of file +var _0xee5b=['sequelize','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x24e21b,_0xaa339a){_0x24e21b=_0x24e21b-0x0;var _0x304420=_0xee5b[_0x24e21b];return _0x304420;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')]},'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbee5('0x1')]},'clientId':{'type':Sequelize[_0xbee5('0x1')]},'clientSecret':{'type':Sequelize[_0xbee5('0x1')]},'serverUrl':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index d7b2bea..ba0fb7c 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 _0x8bee=['create','body','update','params','ZohoConfiguration','sort','getConfigurations','hasOwnProperty','findOne','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','zoho.eu','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','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','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','limit','count','set','reject','save','destroy','sendStatus','stack','name','send','map','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','keys','find'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8bee,0xc5));var _0xe8be=function(_0x18b301,_0x1cbde4){_0x18b301=_0x18b301-0x0;var _0x4287f8=_0x8bee[_0x18b301];return _0x4287f8;};'use strict';var emlformat=require(_0xe8be('0x0'));var rimraf=require(_0xe8be('0x1'));var zipdir=require(_0xe8be('0x2'));var jsonpatch=require(_0xe8be('0x3'));var rp=require(_0xe8be('0x4'));var moment=require(_0xe8be('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe8be('0x6'));var path=require('path');var sox=require(_0xe8be('0x7'));var csv=require(_0xe8be('0x8'));var ejs=require(_0xe8be('0x9'));var fs=require('fs');var fs_extra=require(_0xe8be('0xa'));var _=require(_0xe8be('0xb'));var squel=require(_0xe8be('0xc'));var crypto=require(_0xe8be('0xd'));var jsforce=require(_0xe8be('0xe'));var deskjs=require(_0xe8be('0xf'));var toCsv=require(_0xe8be('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe8be('0x10'));var authService=require(_0xe8be('0x11'));var qs=require(_0xe8be('0x12'));var as=require(_0xe8be('0x13'));var hardwareService=require(_0xe8be('0x14'));var logger=require(_0xe8be('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe8be('0x16'))['db'];var integrations=require(_0xe8be('0x17'));var jayson=require(_0xe8be('0x18'));var client=jayson[_0xe8be('0x19')][_0xe8be('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2704b3,_0x3d9467,_0x506e97,_0x5b0ce5){return new BPromise(function(_0x1754ab,_0x56c4b9){var _0x4f792b=_0x5b0ce5||client;return _0x4f792b[_0xe8be('0x1b')](_0x2704b3,_0x506e97)[_0xe8be('0x1c')](function(_0x547a90){logger[_0xe8be('0x1d')]('ZohoAccount,\x20%s,\x20%s',_0x3d9467,'request\x20sent');logger['debug'](_0xe8be('0x1e'),_0x3d9467,_0xe8be('0x1f'),JSON[_0xe8be('0x20')](_0x547a90));if(_0x547a90[_0xe8be('0x21')]){if(_0x547a90[_0xe8be('0x21')]['code']===0x1f4){logger['error'](_0xe8be('0x22'),_0x3d9467,_0x547a90['error'][_0xe8be('0x23')]);return _0x56c4b9(_0x547a90[_0xe8be('0x21')][_0xe8be('0x23')]);}logger[_0xe8be('0x21')](_0xe8be('0x22'),_0x3d9467,_0x547a90[_0xe8be('0x21')][_0xe8be('0x23')]);return _0x1754ab(_0x547a90[_0xe8be('0x21')]['message']);}else{logger[_0xe8be('0x1d')](_0xe8be('0x22'),_0x3d9467,'request\x20sent');_0x1754ab(_0x547a90[_0xe8be('0x24')][_0xe8be('0x23')]);}})[_0xe8be('0x25')](function(_0xd861bb){logger[_0xe8be('0x21')](_0xe8be('0x22'),_0x3d9467,_0xd861bb);_0x56c4b9(_0xd861bb);});});}function respondWithStatusCode(_0x780099,_0x3818e4){_0x3818e4=_0x3818e4||0xcc;return function(_0x21c6ca){if(_0x21c6ca){return _0x780099['sendStatus'](_0x3818e4);}return _0x780099['status'](_0x3818e4)[_0xe8be('0x26')]();};}function respondWithResult(_0x586774,_0x3a0a00){_0x3a0a00=_0x3a0a00||0xc8;return function(_0x11edf3){if(_0x11edf3){return _0x586774[_0xe8be('0x27')](_0x3a0a00)[_0xe8be('0x28')](_0x11edf3);}};}function respondWithFilteredResult(_0x26ee1e,_0x3e84dd){return function(_0xfe56bf){if(_0xfe56bf){var _0x206480=typeof _0x3e84dd[_0xe8be('0x29')]===_0xe8be('0x2a')&&typeof _0x3e84dd[_0xe8be('0x2b')]===_0xe8be('0x2a');var _0x10dcb6=_0xfe56bf['count'];var _0x59a277=_0x206480?0x0:_0x3e84dd[_0xe8be('0x29')];var _0x25facf=_0x206480?_0xfe56bf[_0xe8be('0x2c')]:_0x3e84dd['offset']+_0x3e84dd[_0xe8be('0x2b')];var _0x11cfd4;if(_0x25facf>=_0x10dcb6){_0x25facf=_0x10dcb6;_0x11cfd4=0xc8;}else{_0x11cfd4=0xce;}_0x26ee1e['status'](_0x11cfd4);return _0x26ee1e[_0xe8be('0x2d')]('Content-Range',_0x59a277+'-'+_0x25facf+'/'+_0x10dcb6)[_0xe8be('0x28')](_0xfe56bf);}return null;};}function patchUpdates(_0x32547d){return function(_0x318d2c){try{jsonpatch['apply'](_0x318d2c,_0x32547d,!![]);}catch(_0x5be5d1){return BPromise[_0xe8be('0x2e')](_0x5be5d1);}return _0x318d2c[_0xe8be('0x2f')]();};}function saveUpdates(_0x58d226,_0xb6d610){return function(_0x2f8e64){if(_0x2f8e64){return _0x2f8e64['update'](_0x58d226)[_0xe8be('0x1c')](function(_0x492cd9){return _0x492cd9;});}return null;};}function removeEntity(_0x11c97e,_0x55da7c){return function(_0x3cbdbc){if(_0x3cbdbc){return _0x3cbdbc[_0xe8be('0x30')]()[_0xe8be('0x1c')](function(){_0x11c97e[_0xe8be('0x27')](0xcc)[_0xe8be('0x26')]();});}};}function handleEntityNotFound(_0x909b4,_0xe6febe){return function(_0x5d5986){if(!_0x5d5986){_0x909b4[_0xe8be('0x31')](0x194);}return _0x5d5986;};}function handleError(_0x56d95c,_0x204015){_0x204015=_0x204015||0x1f4;return function(_0x2b1102){logger[_0xe8be('0x21')](_0x2b1102[_0xe8be('0x32')]);if(_0x2b1102['name']){delete _0x2b1102[_0xe8be('0x33')];}_0x56d95c[_0xe8be('0x27')](_0x204015)[_0xe8be('0x34')](_0x2b1102);};}exports['index']=function(_0x23ace7,_0x2cc3ba){var _0x522c4d={},_0x5b4d8e={},_0x13f7b5={'count':0x0,'rows':[]};var _0x30b0cc=_[_0xe8be('0x35')](db['ZohoAccount'][_0xe8be('0x36')],function(_0x3349d4){return{'name':_0x3349d4['fieldName'],'type':_0x3349d4['type']['key']};});_0x5b4d8e[_0xe8be('0x37')]=_[_0xe8be('0x35')](_0x30b0cc,'name');_0x5b4d8e[_0xe8be('0x38')]=_['keys'](_0x23ace7[_0xe8be('0x38')]);_0x5b4d8e[_0xe8be('0x39')]=_[_0xe8be('0x3a')](_0x5b4d8e[_0xe8be('0x37')],_0x5b4d8e[_0xe8be('0x38')]);_0x522c4d[_0xe8be('0x3b')]=_['intersection'](_0x5b4d8e[_0xe8be('0x37')],qs[_0xe8be('0x3c')](_0x23ace7[_0xe8be('0x38')][_0xe8be('0x3c')]));_0x522c4d['attributes']=_0x522c4d[_0xe8be('0x3b')][_0xe8be('0x3d')]?_0x522c4d[_0xe8be('0x3b')]:_0x5b4d8e[_0xe8be('0x37')];if(!_0x23ace7[_0xe8be('0x38')]['hasOwnProperty'](_0xe8be('0x3e'))){_0x522c4d[_0xe8be('0x2b')]=qs['limit'](_0x23ace7['query'][_0xe8be('0x2b')]);_0x522c4d[_0xe8be('0x29')]=qs[_0xe8be('0x29')](_0x23ace7[_0xe8be('0x38')]['offset']);}_0x522c4d[_0xe8be('0x3f')]=qs['sort'](_0x23ace7['query']['sort']);_0x522c4d[_0xe8be('0x40')]=qs[_0xe8be('0x39')](_[_0xe8be('0x41')](_0x23ace7[_0xe8be('0x38')],_0x5b4d8e['filters']),_0x30b0cc);if(_0x23ace7[_0xe8be('0x38')][_0xe8be('0x42')]){_0x522c4d[_0xe8be('0x40')]=_[_0xe8be('0x43')](_0x522c4d[_0xe8be('0x40')],{'$or':_[_0xe8be('0x35')](_0x30b0cc,function(_0x54f5be){if(_0x54f5be['type']!==_0xe8be('0x44')){var _0x4a841e={};_0x4a841e[_0x54f5be['name']]={'$like':'%'+_0x23ace7[_0xe8be('0x38')][_0xe8be('0x42')]+'%'};return _0x4a841e;}})});}_0x522c4d=_[_0xe8be('0x43')]({},_0x522c4d,_0x23ace7[_0xe8be('0x45')]);var _0x334404={'where':_0x522c4d[_0xe8be('0x40')]};return db[_0xe8be('0x46')][_0xe8be('0x2c')](_0x334404)[_0xe8be('0x1c')](function(_0xd3aa4e){_0x13f7b5[_0xe8be('0x2c')]=_0xd3aa4e;if(_0x23ace7[_0xe8be('0x38')][_0xe8be('0x47')]){_0x522c4d[_0xe8be('0x48')]=[{'all':!![]}];}return db[_0xe8be('0x46')][_0xe8be('0x49')](_0x522c4d);})[_0xe8be('0x1c')](function(_0x4ae9e4){_0x13f7b5[_0xe8be('0x4a')]=_0x4ae9e4;return _0x13f7b5;})['then'](respondWithFilteredResult(_0x2cc3ba,_0x522c4d))[_0xe8be('0x25')](handleError(_0x2cc3ba,null));};exports['show']=function(_0x4577ef,_0x204245){var _0x4fe15e={'raw':![],'where':{'id':_0x4577ef['params']['id']}},_0x25acca={};_0x25acca[_0xe8be('0x37')]=_[_0xe8be('0x4b')](db[_0xe8be('0x46')][_0xe8be('0x36')]);_0x25acca['query']=_['keys'](_0x4577ef[_0xe8be('0x38')]);_0x25acca[_0xe8be('0x39')]=_[_0xe8be('0x3a')](_0x25acca[_0xe8be('0x37')],_0x25acca['query']);_0x4fe15e[_0xe8be('0x3b')]=_[_0xe8be('0x3a')](_0x25acca[_0xe8be('0x37')],qs[_0xe8be('0x3c')](_0x4577ef['query'][_0xe8be('0x3c')]));_0x4fe15e[_0xe8be('0x3b')]=_0x4fe15e['attributes'][_0xe8be('0x3d')]?_0x4fe15e['attributes']:_0x25acca['model'];if(_0x4577ef[_0xe8be('0x38')][_0xe8be('0x47')]){_0x4fe15e[_0xe8be('0x48')]=[{'all':!![]}];}_0x4fe15e=_[_0xe8be('0x43')]({},_0x4fe15e,_0x4577ef['options']);return db[_0xe8be('0x46')][_0xe8be('0x4c')](_0x4fe15e)[_0xe8be('0x1c')](handleEntityNotFound(_0x204245,null))[_0xe8be('0x1c')](respondWithResult(_0x204245,null))[_0xe8be('0x25')](handleError(_0x204245,null));};exports['create']=function(_0x5eaa65,_0x396f57){return db['ZohoAccount'][_0xe8be('0x4d')](_0x5eaa65[_0xe8be('0x4e')],{})[_0xe8be('0x1c')](respondWithResult(_0x396f57,0xc9))['catch'](handleError(_0x396f57,null));};exports[_0xe8be('0x4f')]=function(_0x355604,_0x1b4af7){if(_0x355604['body']['id']){delete _0x355604[_0xe8be('0x4e')]['id'];}return db[_0xe8be('0x46')][_0xe8be('0x4c')]({'where':{'id':_0x355604[_0xe8be('0x50')]['id']}})[_0xe8be('0x1c')](handleEntityNotFound(_0x1b4af7,null))[_0xe8be('0x1c')](saveUpdates(_0x355604[_0xe8be('0x4e')],null))[_0xe8be('0x1c')](respondWithResult(_0x1b4af7,null))[_0xe8be('0x25')](handleError(_0x1b4af7,null));};exports[_0xe8be('0x30')]=function(_0x2df838,_0x39a7d7){return db[_0xe8be('0x46')][_0xe8be('0x4c')]({'where':{'id':_0x2df838[_0xe8be('0x50')]['id']}})[_0xe8be('0x1c')](handleEntityNotFound(_0x39a7d7,null))[_0xe8be('0x1c')](removeEntity(_0x39a7d7,null))[_0xe8be('0x25')](handleError(_0x39a7d7,null));};exports['getConfigurations']=function(_0x57ca6b,_0x4cf23c,_0x17dab7){var _0x16a7a7={};var _0x3ddda3={};var _0x57b4a8;var _0x354c52;return db['ZohoAccount']['findOne']({'where':{'id':_0x57ca6b[_0xe8be('0x50')]['id']}})['then'](handleEntityNotFound(_0x4cf23c,null))[_0xe8be('0x1c')](function(_0x5309e7){if(_0x5309e7){_0x57b4a8=_0x5309e7;_0x3ddda3[_0xe8be('0x37')]=_[_0xe8be('0x4b')](db[_0xe8be('0x51')][_0xe8be('0x36')]);_0x3ddda3['query']=_[_0xe8be('0x4b')](_0x57ca6b[_0xe8be('0x38')]);_0x3ddda3[_0xe8be('0x39')]=_[_0xe8be('0x3a')](_0x3ddda3[_0xe8be('0x37')],_0x3ddda3[_0xe8be('0x38')]);_0x16a7a7[_0xe8be('0x3b')]=_[_0xe8be('0x3a')](_0x3ddda3[_0xe8be('0x37')],qs['fields'](_0x57ca6b[_0xe8be('0x38')][_0xe8be('0x3c')]));_0x16a7a7[_0xe8be('0x3b')]=_0x16a7a7[_0xe8be('0x3b')]['length']?_0x16a7a7['attributes']:_0x3ddda3[_0xe8be('0x37')];_0x16a7a7[_0xe8be('0x3f')]=qs[_0xe8be('0x52')](_0x57ca6b[_0xe8be('0x38')][_0xe8be('0x52')]);_0x16a7a7['where']=qs['filters'](_['pick'](_0x57ca6b[_0xe8be('0x38')],_0x3ddda3[_0xe8be('0x39')]));if(_0x57ca6b['query'][_0xe8be('0x42')]){_0x16a7a7[_0xe8be('0x40')]=_['merge'](_0x16a7a7[_0xe8be('0x40')],{'$or':_[_0xe8be('0x35')](_0x16a7a7[_0xe8be('0x3b')],function(_0x33a2eb){var _0x2710df={};_0x2710df[_0x33a2eb]={'$like':'%'+_0x57ca6b[_0xe8be('0x38')]['filter']+'%'};return _0x2710df;})});}_0x16a7a7=_[_0xe8be('0x43')]({},_0x16a7a7,_0x57ca6b[_0xe8be('0x45')]);return _0x57b4a8[_0xe8be('0x53')](_0x16a7a7);}})['then'](function(_0x9dd133){if(_0x9dd133){_0x354c52=_0x9dd133['length'];if(!_0x57ca6b[_0xe8be('0x38')][_0xe8be('0x54')](_0xe8be('0x3e'))){_0x16a7a7['limit']=qs[_0xe8be('0x2b')](_0x57ca6b['query'][_0xe8be('0x2b')]);_0x16a7a7[_0xe8be('0x29')]=qs['offset'](_0x57ca6b[_0xe8be('0x38')]['offset']);}return _0x57b4a8[_0xe8be('0x53')](_0x16a7a7);}})['then'](function(_0x227abc){if(_0x227abc){return _0x227abc?{'count':_0x354c52,'rows':_0x227abc}:null;}})[_0xe8be('0x1c')](respondWithResult(_0x4cf23c,null))[_0xe8be('0x25')](handleError(_0x4cf23c,null));};exports['addConfiguration']=function(_0x16d48d,_0x105d70,_0x53a028){if(_0x16d48d['body']['id']){delete _0x16d48d[_0xe8be('0x4e')]['id'];}return db[_0xe8be('0x46')][_0xe8be('0x55')]({'where':{'id':_0x16d48d[_0xe8be('0x50')]['id']}})['then'](handleEntityNotFound(_0x105d70,null))[_0xe8be('0x1c')](function(_0x2a97b5){if(_0x2a97b5){_0x16d48d[_0xe8be('0x4e')]['AccountId']=_0x2a97b5['id'];_0x16d48d['body'][_0xe8be('0x56')]=integrations[_0xe8be('0x57')](_0x16d48d[_0xe8be('0x4e')][_0xe8be('0x58')],_0x16d48d[_0xe8be('0x4e')][_0xe8be('0x59')]);_0x16d48d[_0xe8be('0x4e')][_0xe8be('0x5a')]=integrations[_0xe8be('0x5b')](_0x16d48d['body'][_0xe8be('0x58')],_0x16d48d['body'][_0xe8be('0x59')]);return db['ZohoConfiguration'][_0xe8be('0x4d')](_0x16d48d[_0xe8be('0x4e')],{'include':[{'model':db[_0xe8be('0x5c')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xe8be('0x5a')}]});}return null;})[_0xe8be('0x1c')](respondWithResult(_0x105d70,null))[_0xe8be('0x25')](handleError(_0x105d70,null));};function getAccessToken(_0x15ba62){return new Promise(function(_0xf761d6,_0x2bf481){var _0x44068d;switch(_0x15ba62[_0xe8be('0x5d')]){case'US':_0x44068d=_0xe8be('0x5e');break;case'AU':_0x44068d=_0xe8be('0x5f');break;case'EU':_0x44068d=_0xe8be('0x60');break;case'IN':_0x44068d=_0xe8be('0x61');break;case'CN':_0x44068d=_0xe8be('0x62');break;default:_0x44068d=_0xe8be('0x60');break;}var _0x3c4c17={'method':_0xe8be('0x63'),'uri':_0x44068d+_0xe8be('0x64'),'qs':{'refresh_token':_0x15ba62[_0xe8be('0x65')],'client_id':_0x15ba62[_0xe8be('0x66')],'client_secret':_0x15ba62[_0xe8be('0x67')],'grant_type':_0xe8be('0x68')},'json':!![]};return rp(_0x3c4c17)[_0xe8be('0x1c')](function(_0x5a32cc){if(_0x5a32cc[_0xe8be('0x69')]){_0xf761d6(_0x5a32cc[_0xe8be('0x69')]);}else{_0x2bf481(_0xe8be('0x6a'));}})[_0xe8be('0x25')](function(_0x945620){_0x2bf481(_0x945620);});});}exports[_0xe8be('0x6b')]=function(_0x4ab010,_0x203255,_0x3be272){var _0x2054ae,_0x4bdfb5,_0x45d59d,_0x38e282,_0x5cd123;return db[_0xe8be('0x46')][_0xe8be('0x55')]({'where':{'id':_0x4ab010[_0xe8be('0x50')]['id']},'attributes':['id','host',_0xe8be('0x5d'),_0xe8be('0x66'),'clientSecret',_0xe8be('0x6c'),_0xe8be('0x6d'),_0xe8be('0x65')]})[_0xe8be('0x1c')](handleEntityNotFound(_0x203255,null))['then'](function(_0x2a3fe6){_0x5cd123=_0x2a3fe6;_0x2054ae=_0x5cd123['host'];_0x4bdfb5=_0x2054ae===_0xe8be('0x6e')?'eu':'com';_0x45d59d=_0x5cd123[_0xe8be('0x6c')];var _0x12e606=_0x45d59d['slice'](-0x1);if(_0x12e606==='/'||_0x12e606==='\x5c'||_0x12e606===':'){_0x45d59d=_0x45d59d['substring'](0x0,_0x45d59d[_0xe8be('0x6f')](_0x12e606));}if(!_0x5cd123[_0xe8be('0x65')]){throw new Error(_0xe8be('0x70'));}return getAccessToken(_0x5cd123);})[_0xe8be('0x1c')](function(_0x6746b2){if(_0x6746b2){return rp({'method':_0xe8be('0x71'),'uri':util[_0xe8be('0x72')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4bdfb5),'qs':{'module':'Calls'},'headers':{'Authorization':_0xe8be('0x73')+_0x6746b2},'json':!![]});}})[_0xe8be('0x1c')](function(_0x483c62){if(_0x483c62){if(_0x483c62[_0xe8be('0x74')]&&_0x483c62[_0xe8be('0x74')][_0xe8be('0x21')]){throw new Error(_0x483c62['response'][_0xe8be('0x21')][_0xe8be('0x23')]);}var _0xcb31=[];var _0x105f30=[];var _0x1b2693=['Owner',_0xe8be('0x75'),_0xe8be('0x76'),_0xe8be('0x77'),_0xe8be('0x78'),_0xe8be('0x79'),_0xe8be('0x7a'),_0xe8be('0x7b')];_0x105f30=_['remove'](_0x483c62['fields'],function(_0x58dbbf){return _0x1b2693[_0xe8be('0x7c')](_0x58dbbf[_0xe8be('0x7d')]);});for(var _0x35b757=0x0;_0x35b757<_0x105f30[_0xe8be('0x3d')];_0x35b757++){if(_0x105f30[_0x35b757][_0xe8be('0x7e')]===![]){_0xcb31[_0xe8be('0x7f')]({'id':_0x105f30[_0x35b757]['id'],'name':_0x105f30[_0x35b757][_0xe8be('0x80')],'custom':_0x105f30[_0x35b757][_0xe8be('0x81')],'options':_0x105f30[_0x35b757][_0xe8be('0x82')]===_0xe8be('0x83')&&_0x105f30[_0x35b757][_0xe8be('0x84')][_0xe8be('0x3d')]>-0x1?_[_0xe8be('0x35')](_0x105f30[_0x35b757][_0xe8be('0x84')],function(_0x29e707){return{'name':_0x29e707,'value':_0x29e707};}):[]});}}return{'count':_0xcb31[_0xe8be('0x3d')],'rows':_0xcb31};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x203255,null))[_0xe8be('0x25')](function(_0x499e34){var _0x38f78e=_0x4ab010['query'][_0xe8be('0x85')]?0x1f4:_0x499e34[_0xe8be('0x86')]||0x1f4;logger['error'](_0xe8be('0x87'),_0xe8be('0x6b'),_0x38f78e,JSON[_0xe8be('0x20')](_0x499e34));delete _0x499e34[_0xe8be('0x33')];if(_0x38f78e===0x191){_0x38f78e=0x190;}_0x203255[_0xe8be('0x27')](_0x38f78e)[_0xe8be('0x34')](_0x4ab010[_0xe8be('0x38')]['test']?{'message':_0xe8be('0x88'),'statusCode':_0x499e34[_0xe8be('0x86')]}:_0x499e34);});}; \ No newline at end of file +var _0xa1d2=['https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','getFields','clientId','serverUrl','host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../components/integrations/configuration','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','stack','name','send','index','map','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','filter','options','ZohoAccount','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','update','destroy','getConfigurations','findOne','ZohoConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x1e35dd,_0x2799ca){var _0x12cf8c=function(_0x39ab34){while(--_0x39ab34){_0x1e35dd['push'](_0x1e35dd['shift']());}};_0x12cf8c(++_0x2799ca);}(_0xa1d2,0x1d2));var _0x2a1d=function(_0x559755,_0x44e7c2){_0x559755=_0x559755-0x0;var _0x1af585=_0xa1d2[_0x559755];return _0x1af585;};'use strict';var emlformat=require(_0x2a1d('0x0'));var rimraf=require(_0x2a1d('0x1'));var zipdir=require(_0x2a1d('0x2'));var jsonpatch=require(_0x2a1d('0x3'));var rp=require(_0x2a1d('0x4'));var moment=require(_0x2a1d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2a1d('0x6'));var util=require(_0x2a1d('0x7'));var path=require('path');var sox=require(_0x2a1d('0x8'));var csv=require(_0x2a1d('0x9'));var ejs=require(_0x2a1d('0xa'));var fs=require('fs');var fs_extra=require(_0x2a1d('0xb'));var _=require(_0x2a1d('0xc'));var squel=require(_0x2a1d('0xd'));var crypto=require(_0x2a1d('0xe'));var jsforce=require(_0x2a1d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2a1d('0x10'));var Papa=require(_0x2a1d('0x11'));var Redis=require(_0x2a1d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2a1d('0x13'));var as=require(_0x2a1d('0x14'));var hardwareService=require(_0x2a1d('0x15'));var logger=require(_0x2a1d('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2a1d('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2a1d('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x2a1d('0x19')][_0x2a1d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x53ef5f,_0x339363,_0x20ad7b,_0x2a253b){return new BPromise(function(_0x21a1ae,_0x58a14f){var _0x3143db=_0x2a253b||client;return _0x3143db[_0x2a1d('0x1b')](_0x53ef5f,_0x20ad7b)[_0x2a1d('0x1c')](function(_0x33320f){logger[_0x2a1d('0x1d')](_0x2a1d('0x1e'),_0x339363,_0x2a1d('0x1f'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x339363,_0x2a1d('0x1f'),JSON['stringify'](_0x33320f));if(_0x33320f['error']){if(_0x33320f['error'][_0x2a1d('0x20')]===0x1f4){logger[_0x2a1d('0x21')](_0x2a1d('0x1e'),_0x339363,_0x33320f[_0x2a1d('0x21')]['message']);return _0x58a14f(_0x33320f['error'][_0x2a1d('0x22')]);}logger[_0x2a1d('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x339363,_0x33320f['error']['message']);return _0x21a1ae(_0x33320f['error'][_0x2a1d('0x22')]);}else{logger[_0x2a1d('0x1d')](_0x2a1d('0x1e'),_0x339363,_0x2a1d('0x1f'));_0x21a1ae(_0x33320f[_0x2a1d('0x23')][_0x2a1d('0x22')]);}})[_0x2a1d('0x24')](function(_0x33d29c){logger[_0x2a1d('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x339363,_0x33d29c);_0x58a14f(_0x33d29c);});});}function respondWithStatusCode(_0x38a0be,_0x5c235a){_0x5c235a=_0x5c235a||0xcc;return function(_0x546d60){if(_0x546d60){return _0x38a0be[_0x2a1d('0x25')](_0x5c235a);}return _0x38a0be[_0x2a1d('0x26')](_0x5c235a)[_0x2a1d('0x27')]();};}function respondWithResult(_0x50a1a9,_0x3c0976){_0x3c0976=_0x3c0976||0xc8;return function(_0x134908){if(_0x134908){return _0x50a1a9['status'](_0x3c0976)[_0x2a1d('0x28')](_0x134908);}};}function respondWithFilteredResult(_0x270972,_0xcfd46e){return function(_0x2abb6c){if(_0x2abb6c){var _0x47cf87=typeof _0xcfd46e[_0x2a1d('0x29')]===_0x2a1d('0x2a')&&typeof _0xcfd46e[_0x2a1d('0x2b')]==='undefined';var _0x52edbe=_0x2abb6c[_0x2a1d('0x2c')];var _0x12e1ae=_0x47cf87?0x0:_0xcfd46e[_0x2a1d('0x29')];var _0x36fc69=_0x47cf87?_0x2abb6c[_0x2a1d('0x2c')]:_0xcfd46e[_0x2a1d('0x29')]+_0xcfd46e[_0x2a1d('0x2b')];var _0x47fe1f;if(_0x36fc69>=_0x52edbe){_0x36fc69=_0x52edbe;_0x47fe1f=0xc8;}else{_0x47fe1f=0xce;}_0x270972['status'](_0x47fe1f);return _0x270972[_0x2a1d('0x2d')](_0x2a1d('0x2e'),_0x12e1ae+'-'+_0x36fc69+'/'+_0x52edbe)[_0x2a1d('0x28')](_0x2abb6c);}return null;};}function patchUpdates(_0x38b1a1){return function(_0x700f62){try{jsonpatch[_0x2a1d('0x2f')](_0x700f62,_0x38b1a1,!![]);}catch(_0x4c37c5){return BPromise['reject'](_0x4c37c5);}return _0x700f62[_0x2a1d('0x30')]();};}function saveUpdates(_0x44984d,_0x59a858){return function(_0x4d322a){if(_0x4d322a){return _0x4d322a['update'](_0x44984d)[_0x2a1d('0x1c')](function(_0x5254d5){return _0x5254d5;});}return null;};}function removeEntity(_0x1df495,_0x349d02){return function(_0x58751b){if(_0x58751b){return _0x58751b['destroy']()[_0x2a1d('0x1c')](function(){_0x1df495['status'](0xcc)[_0x2a1d('0x27')]();});}};}function handleEntityNotFound(_0x1c6899,_0x2c7606){return function(_0xd271ba){if(!_0xd271ba){_0x1c6899['sendStatus'](0x194);}return _0xd271ba;};}function handleError(_0x3dc9fa,_0x1d213f){_0x1d213f=_0x1d213f||0x1f4;return function(_0x1ab1db){logger[_0x2a1d('0x21')](_0x1ab1db[_0x2a1d('0x31')]);if(_0x1ab1db[_0x2a1d('0x32')]){delete _0x1ab1db['name'];}_0x3dc9fa[_0x2a1d('0x26')](_0x1d213f)[_0x2a1d('0x33')](_0x1ab1db);};}exports[_0x2a1d('0x34')]=function(_0x4c9fb8,_0x4bf544){var _0x5c487b={},_0x1f9560={},_0x52755a={'count':0x0,'rows':[]};var _0x5d1d4c=_[_0x2a1d('0x35')](db['ZohoAccount']['rawAttributes'],function(_0x549c71){return{'name':_0x549c71[_0x2a1d('0x36')],'type':_0x549c71['type'][_0x2a1d('0x37')]};});_0x1f9560[_0x2a1d('0x38')]=_['map'](_0x5d1d4c,_0x2a1d('0x32'));_0x1f9560[_0x2a1d('0x39')]=_[_0x2a1d('0x3a')](_0x4c9fb8['query']);_0x1f9560['filters']=_['intersection'](_0x1f9560['model'],_0x1f9560['query']);_0x5c487b[_0x2a1d('0x3b')]=_[_0x2a1d('0x3c')](_0x1f9560['model'],qs[_0x2a1d('0x3d')](_0x4c9fb8[_0x2a1d('0x39')][_0x2a1d('0x3d')]));_0x5c487b[_0x2a1d('0x3b')]=_0x5c487b[_0x2a1d('0x3b')][_0x2a1d('0x3e')]?_0x5c487b[_0x2a1d('0x3b')]:_0x1f9560[_0x2a1d('0x38')];if(!_0x4c9fb8[_0x2a1d('0x39')][_0x2a1d('0x3f')]('nolimit')){_0x5c487b[_0x2a1d('0x2b')]=qs[_0x2a1d('0x2b')](_0x4c9fb8[_0x2a1d('0x39')][_0x2a1d('0x2b')]);_0x5c487b['offset']=qs[_0x2a1d('0x29')](_0x4c9fb8[_0x2a1d('0x39')]['offset']);}_0x5c487b[_0x2a1d('0x40')]=qs[_0x2a1d('0x41')](_0x4c9fb8[_0x2a1d('0x39')][_0x2a1d('0x41')]);_0x5c487b[_0x2a1d('0x42')]=qs[_0x2a1d('0x43')](_[_0x2a1d('0x44')](_0x4c9fb8[_0x2a1d('0x39')],_0x1f9560[_0x2a1d('0x43')]),_0x5d1d4c);if(_0x4c9fb8[_0x2a1d('0x39')]['filter']){_0x5c487b[_0x2a1d('0x42')]=_[_0x2a1d('0x45')](_0x5c487b[_0x2a1d('0x42')],{'$or':_[_0x2a1d('0x35')](_0x5d1d4c,function(_0x32d559){if(_0x32d559[_0x2a1d('0x46')]!=='VIRTUAL'){var _0x482b05={};_0x482b05[_0x32d559[_0x2a1d('0x32')]]={'$like':'%'+_0x4c9fb8[_0x2a1d('0x39')][_0x2a1d('0x47')]+'%'};return _0x482b05;}})});}_0x5c487b=_['merge']({},_0x5c487b,_0x4c9fb8[_0x2a1d('0x48')]);var _0x23ca29={'where':_0x5c487b[_0x2a1d('0x42')]};return db[_0x2a1d('0x49')][_0x2a1d('0x2c')](_0x23ca29)[_0x2a1d('0x1c')](function(_0x3b56eb){_0x52755a['count']=_0x3b56eb;if(_0x4c9fb8[_0x2a1d('0x39')][_0x2a1d('0x4a')]){_0x5c487b['include']=[{'all':!![]}];}return db[_0x2a1d('0x49')][_0x2a1d('0x4b')](_0x5c487b);})['then'](function(_0x2f7429){_0x52755a[_0x2a1d('0x4c')]=_0x2f7429;return _0x52755a;})[_0x2a1d('0x1c')](respondWithFilteredResult(_0x4bf544,_0x5c487b))['catch'](handleError(_0x4bf544,null));};exports[_0x2a1d('0x4d')]=function(_0x53d182,_0x4d4266){var _0x35504e={'raw':![],'where':{'id':_0x53d182[_0x2a1d('0x4e')]['id']}},_0xe56b1d={};_0xe56b1d['model']=_[_0x2a1d('0x3a')](db[_0x2a1d('0x49')][_0x2a1d('0x4f')]);_0xe56b1d[_0x2a1d('0x39')]=_[_0x2a1d('0x3a')](_0x53d182[_0x2a1d('0x39')]);_0xe56b1d[_0x2a1d('0x43')]=_['intersection'](_0xe56b1d[_0x2a1d('0x38')],_0xe56b1d[_0x2a1d('0x39')]);_0x35504e[_0x2a1d('0x3b')]=_[_0x2a1d('0x3c')](_0xe56b1d[_0x2a1d('0x38')],qs[_0x2a1d('0x3d')](_0x53d182[_0x2a1d('0x39')][_0x2a1d('0x3d')]));_0x35504e[_0x2a1d('0x3b')]=_0x35504e['attributes'][_0x2a1d('0x3e')]?_0x35504e[_0x2a1d('0x3b')]:_0xe56b1d[_0x2a1d('0x38')];if(_0x53d182['query'][_0x2a1d('0x4a')]){_0x35504e[_0x2a1d('0x50')]=[{'all':!![]}];}_0x35504e=_[_0x2a1d('0x45')]({},_0x35504e,_0x53d182['options']);return db[_0x2a1d('0x49')][_0x2a1d('0x51')](_0x35504e)['then'](handleEntityNotFound(_0x4d4266,null))[_0x2a1d('0x1c')](respondWithResult(_0x4d4266,null))['catch'](handleError(_0x4d4266,null));};exports['create']=function(_0x347b9e,_0x4f9002){return db['ZohoAccount'][_0x2a1d('0x52')](_0x347b9e[_0x2a1d('0x53')],{})[_0x2a1d('0x1c')](respondWithResult(_0x4f9002,0xc9))[_0x2a1d('0x24')](handleError(_0x4f9002,null));};exports[_0x2a1d('0x54')]=function(_0x3704db,_0x256223){if(_0x3704db[_0x2a1d('0x53')]['id']){delete _0x3704db[_0x2a1d('0x53')]['id'];}return db[_0x2a1d('0x49')][_0x2a1d('0x51')]({'where':{'id':_0x3704db['params']['id']}})[_0x2a1d('0x1c')](handleEntityNotFound(_0x256223,null))[_0x2a1d('0x1c')](saveUpdates(_0x3704db['body'],null))[_0x2a1d('0x1c')](respondWithResult(_0x256223,null))['catch'](handleError(_0x256223,null));};exports[_0x2a1d('0x55')]=function(_0x2dd771,_0x149ffd){return db[_0x2a1d('0x49')][_0x2a1d('0x51')]({'where':{'id':_0x2dd771['params']['id']}})['then'](handleEntityNotFound(_0x149ffd,null))[_0x2a1d('0x1c')](removeEntity(_0x149ffd,null))[_0x2a1d('0x24')](handleError(_0x149ffd,null));};exports[_0x2a1d('0x56')]=function(_0x1ff7b4,_0x109a76,_0x50216f){var _0x340e41={};var _0x160d8a={};var _0x2109c1;var _0x4c7719;return db[_0x2a1d('0x49')][_0x2a1d('0x57')]({'where':{'id':_0x1ff7b4[_0x2a1d('0x4e')]['id']}})[_0x2a1d('0x1c')](handleEntityNotFound(_0x109a76,null))[_0x2a1d('0x1c')](function(_0x366e21){if(_0x366e21){_0x2109c1=_0x366e21;_0x160d8a[_0x2a1d('0x38')]=_['keys'](db[_0x2a1d('0x58')][_0x2a1d('0x4f')]);_0x160d8a[_0x2a1d('0x39')]=_[_0x2a1d('0x3a')](_0x1ff7b4[_0x2a1d('0x39')]);_0x160d8a[_0x2a1d('0x43')]=_[_0x2a1d('0x3c')](_0x160d8a['model'],_0x160d8a['query']);_0x340e41['attributes']=_['intersection'](_0x160d8a[_0x2a1d('0x38')],qs[_0x2a1d('0x3d')](_0x1ff7b4[_0x2a1d('0x39')][_0x2a1d('0x3d')]));_0x340e41[_0x2a1d('0x3b')]=_0x340e41[_0x2a1d('0x3b')]['length']?_0x340e41[_0x2a1d('0x3b')]:_0x160d8a[_0x2a1d('0x38')];_0x340e41[_0x2a1d('0x40')]=qs[_0x2a1d('0x41')](_0x1ff7b4[_0x2a1d('0x39')][_0x2a1d('0x41')]);_0x340e41[_0x2a1d('0x42')]=qs['filters'](_[_0x2a1d('0x44')](_0x1ff7b4['query'],_0x160d8a[_0x2a1d('0x43')]));if(_0x1ff7b4[_0x2a1d('0x39')][_0x2a1d('0x47')]){_0x340e41[_0x2a1d('0x42')]=_['merge'](_0x340e41[_0x2a1d('0x42')],{'$or':_[_0x2a1d('0x35')](_0x340e41[_0x2a1d('0x3b')],function(_0x3f2f78){var _0x25529d={};_0x25529d[_0x3f2f78]={'$like':'%'+_0x1ff7b4[_0x2a1d('0x39')][_0x2a1d('0x47')]+'%'};return _0x25529d;})});}_0x340e41=_[_0x2a1d('0x45')]({},_0x340e41,_0x1ff7b4[_0x2a1d('0x48')]);return _0x2109c1[_0x2a1d('0x56')](_0x340e41);}})[_0x2a1d('0x1c')](function(_0x199244){if(_0x199244){_0x4c7719=_0x199244[_0x2a1d('0x3e')];if(!_0x1ff7b4[_0x2a1d('0x39')]['hasOwnProperty'](_0x2a1d('0x59'))){_0x340e41['limit']=qs[_0x2a1d('0x2b')](_0x1ff7b4['query']['limit']);_0x340e41[_0x2a1d('0x29')]=qs['offset'](_0x1ff7b4[_0x2a1d('0x39')][_0x2a1d('0x29')]);}return _0x2109c1['getConfigurations'](_0x340e41);}})[_0x2a1d('0x1c')](function(_0x18f9f9){if(_0x18f9f9){return _0x18f9f9?{'count':_0x4c7719,'rows':_0x18f9f9}:null;}})[_0x2a1d('0x1c')](respondWithResult(_0x109a76,null))['catch'](handleError(_0x109a76,null));};exports[_0x2a1d('0x5a')]=function(_0x3e90a3,_0x8dfe44,_0x1f3705){if(_0x3e90a3[_0x2a1d('0x53')]['id']){delete _0x3e90a3[_0x2a1d('0x53')]['id'];}return db['ZohoAccount'][_0x2a1d('0x57')]({'where':{'id':_0x3e90a3[_0x2a1d('0x4e')]['id']}})[_0x2a1d('0x1c')](handleEntityNotFound(_0x8dfe44,null))[_0x2a1d('0x1c')](function(_0x46ebc3){if(_0x46ebc3){_0x3e90a3['body'][_0x2a1d('0x5b')]=_0x46ebc3['id'];_0x3e90a3[_0x2a1d('0x53')][_0x2a1d('0x5c')]=integrations[_0x2a1d('0x5d')](_0x3e90a3[_0x2a1d('0x53')][_0x2a1d('0x5e')],_0x3e90a3[_0x2a1d('0x53')][_0x2a1d('0x46')]);_0x3e90a3[_0x2a1d('0x53')][_0x2a1d('0x5f')]=integrations[_0x2a1d('0x60')](_0x3e90a3[_0x2a1d('0x53')]['channel'],_0x3e90a3[_0x2a1d('0x53')][_0x2a1d('0x46')]);return db[_0x2a1d('0x58')][_0x2a1d('0x52')](_0x3e90a3[_0x2a1d('0x53')],{'include':[{'model':db[_0x2a1d('0x61')],'as':_0x2a1d('0x5c')},{'model':db['ZohoField'],'as':_0x2a1d('0x5f')}]});}return null;})[_0x2a1d('0x1c')](respondWithResult(_0x8dfe44,null))['catch'](handleError(_0x8dfe44,null));};function getAccessToken(_0x94f4de){return new Promise(function(_0x168e64,_0x445401){var _0x22a8f3;switch(_0x94f4de[_0x2a1d('0x62')]){case'US':_0x22a8f3=_0x2a1d('0x63');break;case'AU':_0x22a8f3=_0x2a1d('0x64');break;case'EU':_0x22a8f3=_0x2a1d('0x65');break;case'IN':_0x22a8f3='https://accounts.zoho.in';break;case'CN':_0x22a8f3=_0x2a1d('0x66');break;default:_0x22a8f3='https://accounts.zoho.eu';break;}var _0x35f3f={'method':_0x2a1d('0x67'),'uri':_0x22a8f3+_0x2a1d('0x68'),'qs':{'refresh_token':_0x94f4de[_0x2a1d('0x69')],'client_id':_0x94f4de['clientId'],'client_secret':_0x94f4de[_0x2a1d('0x6a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x35f3f)[_0x2a1d('0x1c')](function(_0x3e707c){if(_0x3e707c[_0x2a1d('0x6b')]){_0x168e64(_0x3e707c['access_token']);}else{_0x445401('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x249846){_0x445401(_0x249846);});});}exports[_0x2a1d('0x6c')]=function(_0x41d22e,_0x501da9,_0x1eec2b){var _0x20d4aa,_0x3d5ea7,_0x49d093,_0xe2184b,_0x3b7f71;return db[_0x2a1d('0x49')]['findOne']({'where':{'id':_0x41d22e[_0x2a1d('0x4e')]['id']},'attributes':['id','host',_0x2a1d('0x62'),_0x2a1d('0x6d'),_0x2a1d('0x6a'),_0x2a1d('0x6e'),_0x2a1d('0x20'),'refreshToken']})['then'](handleEntityNotFound(_0x501da9,null))[_0x2a1d('0x1c')](function(_0x56b238){_0x3b7f71=_0x56b238;_0x20d4aa=_0x3b7f71[_0x2a1d('0x6f')];_0x3d5ea7=_0x20d4aa===_0x2a1d('0x70')?'eu':_0x2a1d('0x71');_0x49d093=_0x3b7f71[_0x2a1d('0x6e')];var _0x4eabd8=_0x49d093[_0x2a1d('0x72')](-0x1);if(_0x4eabd8==='/'||_0x4eabd8==='\x5c'||_0x4eabd8===':'){_0x49d093=_0x49d093[_0x2a1d('0x73')](0x0,_0x49d093[_0x2a1d('0x74')](_0x4eabd8));}if(!_0x3b7f71[_0x2a1d('0x69')]){throw new Error(_0x2a1d('0x75'));}return getAccessToken(_0x3b7f71);})['then'](function(_0x271260){if(_0x271260){return rp({'method':_0x2a1d('0x76'),'uri':util[_0x2a1d('0x77')](_0x2a1d('0x78'),_0x3d5ea7),'qs':{'module':_0x2a1d('0x79')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x271260},'json':!![]});}})[_0x2a1d('0x1c')](function(_0x4f494a){if(_0x4f494a){if(_0x4f494a[_0x2a1d('0x7a')]&&_0x4f494a[_0x2a1d('0x7a')][_0x2a1d('0x21')]){throw new Error(_0x4f494a[_0x2a1d('0x7a')]['error'][_0x2a1d('0x22')]);}var _0x481512=[];var _0x15a2b8=[];var _0x2f98da=[_0x2a1d('0x7b'),_0x2a1d('0x7c'),'Description',_0x2a1d('0x7d'),_0x2a1d('0x7e'),_0x2a1d('0x7f'),_0x2a1d('0x80'),'Call_Type'];_0x15a2b8=_['remove'](_0x4f494a[_0x2a1d('0x3d')],function(_0x594a35){return _0x2f98da[_0x2a1d('0x81')](_0x594a35[_0x2a1d('0x82')]);});for(var _0xd1c41f=0x0;_0xd1c41f<_0x15a2b8[_0x2a1d('0x3e')];_0xd1c41f++){if(_0x15a2b8[_0xd1c41f][_0x2a1d('0x83')]===![]){_0x481512[_0x2a1d('0x84')]({'id':_0x15a2b8[_0xd1c41f]['id'],'name':_0x15a2b8[_0xd1c41f][_0x2a1d('0x85')],'custom':_0x15a2b8[_0xd1c41f][_0x2a1d('0x86')],'options':_0x15a2b8[_0xd1c41f][_0x2a1d('0x87')]===_0x2a1d('0x88')&&_0x15a2b8[_0xd1c41f]['pick_list_values'][_0x2a1d('0x3e')]>-0x1?_[_0x2a1d('0x35')](_0x15a2b8[_0xd1c41f][_0x2a1d('0x89')],function(_0x3cf5d9){return{'name':_0x3cf5d9,'value':_0x3cf5d9};}):[]});}}return{'count':_0x481512[_0x2a1d('0x3e')],'rows':_0x481512};}else{return{'count':0x0,'rows':[]};}})[_0x2a1d('0x1c')](respondWithResult(_0x501da9,null))[_0x2a1d('0x24')](function(_0x2a2639){var _0x437ad1=_0x41d22e['query']['test']?0x1f4:_0x2a2639[_0x2a1d('0x8a')]||0x1f4;logger[_0x2a1d('0x21')](_0x2a1d('0x8b'),_0x2a1d('0x6c'),_0x437ad1,JSON['stringify'](_0x2a2639));delete _0x2a2639['name'];if(_0x437ad1===0x191){_0x437ad1=0x190;}_0x501da9['status'](_0x437ad1)['send'](_0x41d22e[_0x2a1d('0x39')][_0x2a1d('0x8c')]?{'message':_0x2a1d('0x8d'),'statusCode':_0x2a2639['statusCode']}:_0x2a2639);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 3ada302..e5fe063 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 _0xae4c=['substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','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','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','host','slice'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0xae4c,0x96));var _0xcae4=function(_0x4ef77b,_0x6a3df){_0x4ef77b=_0x4ef77b-0x0;var _0x58d1a6=_0xae4c[_0x4ef77b];return _0x58d1a6;};'use strict';var _=require(_0xcae4('0x0'));var util=require(_0xcae4('0x1'));var logger=require(_0xcae4('0x2'))(_0xcae4('0x3'));var moment=require(_0xcae4('0x4'));var BPromise=require(_0xcae4('0x5'));var rp=require(_0xcae4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcae4('0x7'));var config=require('../../config/environment');var attributes=require(_0xcae4('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xcae4('0x9')]=function(_0x2d02f3,_0x1f42e1){return _0x2d02f3['define'](_0xcae4('0xa'),attributes,{'tableName':_0xcae4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1bc52b,_0x3efa5a,_0x13707a){if(_0x1bc52b[_0xcae4('0xc')](_0xcae4('0xd'))||_0x1bc52b[_0xcae4('0xc')](_0xcae4('0xe'))||_0x1bc52b[_0xcae4('0xc')](_0xcae4('0xf'))||_0x1bc52b[_0xcae4('0xc')]('clientSecret')||_0x1bc52b['changed']('code')||_0x1bc52b[_0xcae4('0xc')](_0xcae4('0x10'))){var _0x503f81,_0x386247;_0x503f81=_0x1bc52b[_0xcae4('0xe')];var _0x20af53=_0x503f81[_0xcae4('0x11')](-0x1);if(_0x20af53==='/'||_0x20af53==='\x5c'||_0x20af53===':'){_0x503f81=_0x503f81[_0xcae4('0x12')](0x0,_0x503f81['lastIndexOf'](_0x20af53));}switch(_0x1bc52b[_0xcae4('0xd')]){case'US':_0x386247=_0xcae4('0x13');break;case'AU':_0x386247=_0xcae4('0x14');break;case'IN':_0x386247='https://accounts.zoho.in';break;case'CN':_0x386247=_0xcae4('0x15');break;default:_0x386247=_0xcae4('0x16');break;}var _0x10875f={'method':_0xcae4('0x17'),'uri':_0x386247+_0xcae4('0x18'),'form':{'grant_type':_0xcae4('0x19'),'client_id':_0x1bc52b['clientId'],'client_secret':_0x1bc52b[_0xcae4('0x1a')],'redirect_uri':_0x1bc52b[_0xcae4('0xe')],'code':_0x1bc52b[_0xcae4('0x1b')]},'headers':{'Content-Type':_0xcae4('0x1c')}};return rp(_0x10875f)[_0xcae4('0x1d')](function(_0x3cf8e8){var _0x3d3721=JSON[_0xcae4('0x1e')](_0x3cf8e8);if(_0x3d3721[_0xcae4('0x1f')]){_0x1bc52b[_0xcae4('0x20')]=_0x3d3721[_0xcae4('0x1f')];logger[_0xcae4('0x21')](util[_0xcae4('0x22')](_0xcae4('0x23'),_0x1bc52b[_0xcae4('0x24')],_0x1bc52b['id']));}else{logger[_0xcae4('0x25')](util[_0xcae4('0x22')](_0xcae4('0x26'),_0x1bc52b[_0xcae4('0x24')],_0x1bc52b['id']),util[_0xcae4('0x27')](_0x3d3721,{'showHidden':![],'depth':null}));}return _0x13707a(null,_0x3efa5a);})[_0xcae4('0x28')](function(_0x27639e){logger[_0xcae4('0x25')](util['format'](_0xcae4('0x26'),_0x1bc52b[_0xcae4('0x24')],_0x1bc52b['id']),util[_0xcae4('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x13707a(_0x27639e);});}else{return _0x13707a(null,_0x3efa5a);}},'beforeUpdate':function(_0x5f38b3,_0x557f24,_0x59b9c6){if(_0x5f38b3[_0xcae4('0xc')](_0xcae4('0xd'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0xe'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0xf'))||_0x5f38b3['changed'](_0xcae4('0x1a'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0x1b'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0x10'))){var _0xa6867e,_0x37fe6d;_0xa6867e=_0x5f38b3[_0xcae4('0xe')];var _0x43b4a4=_0xa6867e[_0xcae4('0x11')](-0x1);if(_0x43b4a4==='/'||_0x43b4a4==='\x5c'||_0x43b4a4===':'){_0xa6867e=_0xa6867e[_0xcae4('0x12')](0x0,_0xa6867e['lastIndexOf'](_0x43b4a4));}switch(_0x5f38b3[_0xcae4('0xd')]){case'US':_0x37fe6d=_0xcae4('0x13');break;case'AU':_0x37fe6d='https://accounts.zoho.com.au';break;case'IN':_0x37fe6d=_0xcae4('0x29');break;case'CN':_0x37fe6d='https://accounts.zoho.com.cn';break;default:_0x37fe6d='https://accounts.zoho.eu';break;}var _0x4b5f28={'method':_0xcae4('0x17'),'uri':_0x37fe6d+'/oauth/v2/token','form':{'grant_type':_0xcae4('0x19'),'client_id':_0x5f38b3[_0xcae4('0xf')],'client_secret':_0x5f38b3[_0xcae4('0x1a')],'redirect_uri':_0x5f38b3[_0xcae4('0xe')],'code':_0x5f38b3[_0xcae4('0x1b')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4b5f28)[_0xcae4('0x1d')](function(_0x120d60){var _0x97ea21=JSON['parse'](_0x120d60);if(_0x97ea21[_0xcae4('0x1f')]){_0x5f38b3['refreshToken']=_0x97ea21[_0xcae4('0x1f')];logger[_0xcae4('0x21')](util[_0xcae4('0x22')](_0xcae4('0x23'),_0x5f38b3[_0xcae4('0x24')],_0x5f38b3['id']));}else{logger[_0xcae4('0x25')](util[_0xcae4('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5f38b3[_0xcae4('0x24')],_0x5f38b3['id']),util['inspect'](_0x97ea21,{'showHidden':![],'depth':null}));}return _0x59b9c6(null,_0x557f24);})[_0xcae4('0x28')](function(_0x4e3aa3){logger[_0xcae4('0x25')](util['format'](_0xcae4('0x26'),_0x5f38b3[_0xcae4('0x24')],_0x5f38b3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x59b9c6(_0x4e3aa3);});}else{return _0x59b9c6(null,_0x557f24);}}}});}; \ No newline at end of file +var _0xd472=['../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','format','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','slice','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x190691,_0x2cb8f7){var _0xf6b7d4=function(_0x291495){while(--_0x291495){_0x190691['push'](_0x190691['shift']());}};_0xf6b7d4(++_0x2cb8f7);}(_0xd472,0x149));var _0x2d47=function(_0x2bf022,_0x518614){_0x2bf022=_0x2bf022-0x0;var _0x26f522=_0xd472[_0x2bf022];return _0x26f522;};'use strict';var _=require(_0x2d47('0x0'));var util=require(_0x2d47('0x1'));var logger=require('../../config/logger')(_0x2d47('0x2'));var moment=require(_0x2d47('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d47('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d47('0x5'));var config=require(_0x2d47('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x2d47('0x7'));module[_0x2d47('0x8')]=function(_0x211e0e,_0x2f1aa6){return _0x211e0e['define'](_0x2d47('0x9'),attributes,{'tableName':_0x2d47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x14b7bd,_0x3b344d,_0x5d987e){if(_0x14b7bd[_0x2d47('0xb')](_0x2d47('0xc'))||_0x14b7bd[_0x2d47('0xb')](_0x2d47('0xd'))||_0x14b7bd[_0x2d47('0xb')](_0x2d47('0xe'))||_0x14b7bd['changed']('clientSecret')||_0x14b7bd[_0x2d47('0xb')](_0x2d47('0xf'))||_0x14b7bd[_0x2d47('0xb')](_0x2d47('0x10'))){var _0x235737,_0x3a90b0;_0x235737=_0x14b7bd[_0x2d47('0xd')];var _0x34a4ca=_0x235737['slice'](-0x1);if(_0x34a4ca==='/'||_0x34a4ca==='\x5c'||_0x34a4ca===':'){_0x235737=_0x235737[_0x2d47('0x11')](0x0,_0x235737[_0x2d47('0x12')](_0x34a4ca));}switch(_0x14b7bd[_0x2d47('0xc')]){case'US':_0x3a90b0=_0x2d47('0x13');break;case'AU':_0x3a90b0=_0x2d47('0x14');break;case'IN':_0x3a90b0=_0x2d47('0x15');break;case'CN':_0x3a90b0=_0x2d47('0x16');break;default:_0x3a90b0=_0x2d47('0x17');break;}var _0x268d3c={'method':_0x2d47('0x18'),'uri':_0x3a90b0+_0x2d47('0x19'),'form':{'grant_type':_0x2d47('0x1a'),'client_id':_0x14b7bd['clientId'],'client_secret':_0x14b7bd[_0x2d47('0x1b')],'redirect_uri':_0x14b7bd['serverUrl'],'code':_0x14b7bd[_0x2d47('0xf')]},'headers':{'Content-Type':_0x2d47('0x1c')}};return rp(_0x268d3c)[_0x2d47('0x1d')](function(_0x141434){var _0x4569c4=JSON[_0x2d47('0x1e')](_0x141434);if(_0x4569c4['refresh_token']){_0x14b7bd[_0x2d47('0x1f')]=_0x4569c4[_0x2d47('0x20')];logger['info'](util[_0x2d47('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x14b7bd[_0x2d47('0x22')],_0x14b7bd['id']));}else{logger['error'](util[_0x2d47('0x21')](_0x2d47('0x23'),_0x14b7bd[_0x2d47('0x22')],_0x14b7bd['id']),util[_0x2d47('0x24')](_0x4569c4,{'showHidden':![],'depth':null}));}return _0x5d987e(null,_0x3b344d);})[_0x2d47('0x25')](function(_0x7e544c){logger[_0x2d47('0x26')](util[_0x2d47('0x21')](_0x2d47('0x23'),_0x14b7bd['name'],_0x14b7bd['id']),util[_0x2d47('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x5d987e(_0x7e544c);});}else{return _0x5d987e(null,_0x3b344d);}},'beforeUpdate':function(_0x3184b3,_0x2d5447,_0x4940c8){if(_0x3184b3['changed'](_0x2d47('0xc'))||_0x3184b3[_0x2d47('0xb')](_0x2d47('0xd'))||_0x3184b3['changed']('clientId')||_0x3184b3['changed']('clientSecret')||_0x3184b3[_0x2d47('0xb')]('code')||_0x3184b3[_0x2d47('0xb')](_0x2d47('0x10'))){var _0x3c0ce0,_0x2f9420;_0x3c0ce0=_0x3184b3[_0x2d47('0xd')];var _0x5d9bd3=_0x3c0ce0[_0x2d47('0x27')](-0x1);if(_0x5d9bd3==='/'||_0x5d9bd3==='\x5c'||_0x5d9bd3===':'){_0x3c0ce0=_0x3c0ce0[_0x2d47('0x11')](0x0,_0x3c0ce0[_0x2d47('0x12')](_0x5d9bd3));}switch(_0x3184b3[_0x2d47('0xc')]){case'US':_0x2f9420=_0x2d47('0x13');break;case'AU':_0x2f9420=_0x2d47('0x14');break;case'IN':_0x2f9420=_0x2d47('0x15');break;case'CN':_0x2f9420=_0x2d47('0x16');break;default:_0x2f9420='https://accounts.zoho.eu';break;}var _0x3e4465={'method':_0x2d47('0x18'),'uri':_0x2f9420+_0x2d47('0x19'),'form':{'grant_type':_0x2d47('0x1a'),'client_id':_0x3184b3[_0x2d47('0xe')],'client_secret':_0x3184b3['clientSecret'],'redirect_uri':_0x3184b3[_0x2d47('0xd')],'code':_0x3184b3[_0x2d47('0xf')]},'headers':{'Content-Type':_0x2d47('0x1c')}};return rp(_0x3e4465)[_0x2d47('0x1d')](function(_0x5688c3){var _0x5a1912=JSON[_0x2d47('0x1e')](_0x5688c3);if(_0x5a1912['refresh_token']){_0x3184b3['refreshToken']=_0x5a1912[_0x2d47('0x20')];logger[_0x2d47('0x28')](util[_0x2d47('0x21')](_0x2d47('0x29'),_0x3184b3[_0x2d47('0x22')],_0x3184b3['id']));}else{logger[_0x2d47('0x26')](util['format'](_0x2d47('0x23'),_0x3184b3['name'],_0x3184b3['id']),util[_0x2d47('0x24')](_0x5a1912,{'showHidden':![],'depth':null}));}return _0x4940c8(null,_0x2d5447);})[_0x2d47('0x25')](function(_0x208ef5){logger[_0x2d47('0x26')](util['format'](_0x2d47('0x23'),_0x3184b3[_0x2d47('0x22')],_0x3184b3['id']),util[_0x2d47('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x4940c8(_0x208ef5);});}else{return _0x4940c8(null,_0x2d5447);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index bf1c6ed..ce3ca83 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 _0x79a3=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','GetZohoAccount','stringify','catch','ShowZohoAccount','find','raw','debug','lodash','moment','bluebird','ioredis'];(function(_0x327394,_0x5abcc9){var _0x306213=function(_0x73c8de){while(--_0x73c8de){_0x327394['push'](_0x327394['shift']());}};_0x306213(++_0x5abcc9);}(_0x79a3,0x80));var _0x379a=function(_0x341781,_0x207d7e){_0x341781=_0x341781-0x0;var _0x2f9145=_0x79a3[_0x341781];return _0x2f9145;};'use strict';var _=require(_0x379a('0x0'));var util=require('util');var moment=require(_0x379a('0x1'));var BPromise=require(_0x379a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x379a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x379a('0x4'));var config=require(_0x379a('0x5'));var jayson=require(_0x379a('0x6'));var client=jayson[_0x379a('0x7')][_0x379a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eacbe,_0x4d0435,_0x484a91){return new BPromise(function(_0x23e684,_0x11d27d){return client[_0x379a('0x9')](_0x4eacbe,_0x484a91)[_0x379a('0xa')](function(_0x37a440){logger[_0x379a('0xb')](_0x379a('0xc'),_0x4d0435,'request\x20sent');logger['debug'](_0x379a('0xd'),_0x4d0435,'request\x20sent',JSON['stringify'](_0x37a440));if(_0x37a440[_0x379a('0xe')]){if(_0x37a440[_0x379a('0xe')][_0x379a('0xf')]===0x1f4){logger[_0x379a('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4d0435,_0x37a440['error']['message']);return _0x11d27d(_0x37a440[_0x379a('0xe')][_0x379a('0x10')]);}logger[_0x379a('0xe')](_0x379a('0xc'),_0x4d0435,_0x37a440['error']['message']);return _0x23e684(_0x37a440[_0x379a('0xe')][_0x379a('0x10')]);}else{logger[_0x379a('0xb')](_0x379a('0xc'),_0x4d0435,'request\x20sent');_0x23e684(_0x37a440['result'][_0x379a('0x10')]);}})['catch'](function(_0x3124f1){logger[_0x379a('0xe')](_0x379a('0xc'),_0x4d0435,_0x3124f1);_0x11d27d(_0x3124f1);});});}exports['GetZohoAccount']=function(_0x48f0a9){var _0x3f994d=this;return new Promise(function(_0xd6cc17,_0x499923){return db[_0x379a('0x11')][_0x379a('0x12')]({'raw':_0x48f0a9['options']?_0x48f0a9['options']['raw']===undefined?!![]:![]:!![],'where':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9['options'][_0x379a('0x14')]||null:null,'attributes':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9[_0x379a('0x13')][_0x379a('0x15')]||null:null,'limit':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9[_0x379a('0x13')][_0x379a('0x16')]||null:null,'include':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9['options'][_0x379a('0x17')]?_[_0x379a('0x18')](_0x48f0a9[_0x379a('0x13')][_0x379a('0x17')],function(_0x31752c){return{'model':db[_0x31752c[_0x379a('0x19')]],'as':_0x31752c['as'],'attributes':_0x31752c[_0x379a('0x15')],'include':_0x31752c['include']?_[_0x379a('0x18')](_0x31752c[_0x379a('0x17')],function(_0x18bb37){return{'model':db[_0x18bb37['model']],'as':_0x18bb37['as'],'attributes':_0x18bb37['attributes'],'include':_0x18bb37[_0x379a('0x17')]?_['map'](_0x18bb37[_0x379a('0x17')],function(_0xc1fc5a){return{'model':db[_0xc1fc5a['model']],'as':_0xc1fc5a['as'],'attributes':_0xc1fc5a[_0x379a('0x15')]};}):[]};}):[]};}):[]:[]})[_0x379a('0xa')](function(_0x19f945){logger['info'](_0x379a('0x1a'),_0x48f0a9);logger['debug'](_0x379a('0x1a'),_0x48f0a9,JSON[_0x379a('0x1b')](_0x19f945));_0xd6cc17(_0x19f945);})[_0x379a('0x1c')](function(_0x3f92b1){logger['error'](_0x379a('0x1a'),_0x3f92b1[_0x379a('0x10')],_0x48f0a9);_0x499923(_0x3f994d[_0x379a('0xe')](0x1f4,_0x3f92b1[_0x379a('0x10')]));});});};exports[_0x379a('0x1d')]=function(_0x5c68f2){var _0x23a45b=this;return new Promise(function(_0x37f538,_0x16d8a1){return db[_0x379a('0x11')][_0x379a('0x1e')]({'raw':_0x5c68f2['options']?_0x5c68f2[_0x379a('0x13')][_0x379a('0x1f')]===undefined?!![]:![]:!![],'where':_0x5c68f2[_0x379a('0x13')]?_0x5c68f2[_0x379a('0x13')][_0x379a('0x14')]||null:null,'attributes':_0x5c68f2[_0x379a('0x13')]?_0x5c68f2['options']['attributes']||null:null,'include':_0x5c68f2[_0x379a('0x13')]?_0x5c68f2['options'][_0x379a('0x17')]?_[_0x379a('0x18')](_0x5c68f2[_0x379a('0x13')]['include'],function(_0x5525ba){return{'model':db[_0x5525ba[_0x379a('0x19')]],'as':_0x5525ba['as'],'attributes':_0x5525ba[_0x379a('0x15')],'include':_0x5525ba[_0x379a('0x17')]?_[_0x379a('0x18')](_0x5525ba['include'],function(_0xdaf60f){return{'model':db[_0xdaf60f[_0x379a('0x19')]],'as':_0xdaf60f['as'],'attributes':_0xdaf60f[_0x379a('0x15')],'include':_0xdaf60f[_0x379a('0x17')]?_['map'](_0xdaf60f[_0x379a('0x17')],function(_0x415b6f){return{'model':db[_0x415b6f[_0x379a('0x19')]],'as':_0x415b6f['as'],'attributes':_0x415b6f[_0x379a('0x15')]};}):[]};}):[]};}):[]:[]})[_0x379a('0xa')](function(_0x297e63){logger[_0x379a('0xb')](_0x379a('0x1d'),_0x5c68f2);logger[_0x379a('0x20')](_0x379a('0x1d'),_0x5c68f2,JSON['stringify'](_0x297e63));_0x37f538(_0x297e63);})[_0x379a('0x1c')](function(_0x3111bd){logger[_0x379a('0xe')]('ShowZohoAccount',_0x3111bd[_0x379a('0x10')],_0x5c68f2);_0x16d8a1(_0x23a45b[_0x379a('0xe')](0x1f4,_0x3111bd['message']));});});}; \ No newline at end of file +var _0x47d6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetZohoAccount','options','raw','where','limit','include','map','model','attributes','ShowZohoAccount','lodash','util','moment','bluebird','randomstring'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x47d6,0x13f));var _0x647d=function(_0x3a73e1,_0x4954a0){_0x3a73e1=_0x3a73e1-0x0;var _0x25e598=_0x47d6[_0x3a73e1];return _0x25e598;};'use strict';var _=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var moment=require(_0x647d('0x2'));var BPromise=require(_0x647d('0x3'));var rs=require(_0x647d('0x4'));var fs=require('fs');var Redis=require(_0x647d('0x5'));var db=require(_0x647d('0x6'))['db'];var utils=require(_0x647d('0x7'));var logger=require(_0x647d('0x8'))(_0x647d('0x9'));var config=require(_0x647d('0xa'));var jayson=require(_0x647d('0xb'));var client=jayson[_0x647d('0xc')][_0x647d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db1db,_0x1c6a88,_0x4baa1e){return new BPromise(function(_0x119c54,_0x348540){return client[_0x647d('0xe')](_0x1db1db,_0x4baa1e)[_0x647d('0xf')](function(_0x414518){logger[_0x647d('0x10')](_0x647d('0x11'),_0x1c6a88,_0x647d('0x12'));logger[_0x647d('0x13')](_0x647d('0x14'),_0x1c6a88,_0x647d('0x12'),JSON[_0x647d('0x15')](_0x414518));if(_0x414518['error']){if(_0x414518['error'][_0x647d('0x16')]===0x1f4){logger[_0x647d('0x17')](_0x647d('0x11'),_0x1c6a88,_0x414518[_0x647d('0x17')][_0x647d('0x18')]);return _0x348540(_0x414518[_0x647d('0x17')][_0x647d('0x18')]);}logger[_0x647d('0x17')]('ZohoAccount,\x20%s,\x20%s',_0x1c6a88,_0x414518[_0x647d('0x17')][_0x647d('0x18')]);return _0x119c54(_0x414518['error'][_0x647d('0x18')]);}else{logger[_0x647d('0x10')](_0x647d('0x11'),_0x1c6a88,'request\x20sent');_0x119c54(_0x414518['result'][_0x647d('0x18')]);}})[_0x647d('0x19')](function(_0x433cc1){logger['error'](_0x647d('0x11'),_0x1c6a88,_0x433cc1);_0x348540(_0x433cc1);});});}exports[_0x647d('0x1a')]=function(_0x5d53de){var _0x1c66d1=this;return new Promise(function(_0x14e1d1,_0x1a1bd0){return db['ZohoAccount']['findAll']({'raw':_0x5d53de['options']?_0x5d53de[_0x647d('0x1b')][_0x647d('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d53de[_0x647d('0x1b')]?_0x5d53de['options'][_0x647d('0x1d')]||null:null,'attributes':_0x5d53de[_0x647d('0x1b')]?_0x5d53de['options']['attributes']||null:null,'limit':_0x5d53de['options']?_0x5d53de[_0x647d('0x1b')][_0x647d('0x1e')]||null:null,'include':_0x5d53de['options']?_0x5d53de[_0x647d('0x1b')][_0x647d('0x1f')]?_[_0x647d('0x20')](_0x5d53de[_0x647d('0x1b')]['include'],function(_0x5e43e7){return{'model':db[_0x5e43e7[_0x647d('0x21')]],'as':_0x5e43e7['as'],'attributes':_0x5e43e7['attributes'],'include':_0x5e43e7[_0x647d('0x1f')]?_[_0x647d('0x20')](_0x5e43e7[_0x647d('0x1f')],function(_0xdd1cf6){return{'model':db[_0xdd1cf6[_0x647d('0x21')]],'as':_0xdd1cf6['as'],'attributes':_0xdd1cf6[_0x647d('0x22')],'include':_0xdd1cf6[_0x647d('0x1f')]?_[_0x647d('0x20')](_0xdd1cf6[_0x647d('0x1f')],function(_0x266206){return{'model':db[_0x266206[_0x647d('0x21')]],'as':_0x266206['as'],'attributes':_0x266206[_0x647d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x647d('0xf')](function(_0x398c33){logger[_0x647d('0x10')](_0x647d('0x1a'),_0x5d53de);logger['debug']('GetZohoAccount',_0x5d53de,JSON['stringify'](_0x398c33));_0x14e1d1(_0x398c33);})[_0x647d('0x19')](function(_0x58c102){logger[_0x647d('0x17')](_0x647d('0x1a'),_0x58c102['message'],_0x5d53de);_0x1a1bd0(_0x1c66d1[_0x647d('0x17')](0x1f4,_0x58c102[_0x647d('0x18')]));});});};exports[_0x647d('0x23')]=function(_0x51295a){var _0x45391f=this;return new Promise(function(_0x3d15c5,_0x46d8f2){return db['ZohoAccount']['find']({'raw':_0x51295a[_0x647d('0x1b')]?_0x51295a[_0x647d('0x1b')][_0x647d('0x1c')]===undefined?!![]:![]:!![],'where':_0x51295a['options']?_0x51295a[_0x647d('0x1b')][_0x647d('0x1d')]||null:null,'attributes':_0x51295a[_0x647d('0x1b')]?_0x51295a[_0x647d('0x1b')][_0x647d('0x22')]||null:null,'include':_0x51295a[_0x647d('0x1b')]?_0x51295a[_0x647d('0x1b')][_0x647d('0x1f')]?_[_0x647d('0x20')](_0x51295a[_0x647d('0x1b')][_0x647d('0x1f')],function(_0x57a6a5){return{'model':db[_0x57a6a5[_0x647d('0x21')]],'as':_0x57a6a5['as'],'attributes':_0x57a6a5[_0x647d('0x22')],'include':_0x57a6a5[_0x647d('0x1f')]?_[_0x647d('0x20')](_0x57a6a5[_0x647d('0x1f')],function(_0x14caef){return{'model':db[_0x14caef[_0x647d('0x21')]],'as':_0x14caef['as'],'attributes':_0x14caef[_0x647d('0x22')],'include':_0x14caef['include']?_['map'](_0x14caef[_0x647d('0x1f')],function(_0x367161){return{'model':db[_0x367161[_0x647d('0x21')]],'as':_0x367161['as'],'attributes':_0x367161[_0x647d('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34a107){logger[_0x647d('0x10')]('ShowZohoAccount',_0x51295a);logger[_0x647d('0x13')](_0x647d('0x23'),_0x51295a,JSON['stringify'](_0x34a107));_0x3d15c5(_0x34a107);})[_0x647d('0x19')](function(_0x18a517){logger[_0x647d('0x17')](_0x647d('0x23'),_0x18a517[_0x647d('0x18')],_0x51295a);_0x46d8f2(_0x45391f[_0x647d('0x17')](0x1f4,_0x18a517[_0x647d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1b16306..fcc7b34 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 _0xe26c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','exports','util','path','connect-timeout'];(function(_0x4da65f,_0x24ef59){var _0x488cae=function(_0x260edb){while(--_0x260edb){_0x4da65f['push'](_0x4da65f['shift']());}};_0x488cae(++_0x24ef59);}(_0xe26c,0x189));var _0xce26=function(_0x37332e,_0x17f0cd){_0x37332e=_0x37332e-0x0;var _0x292647=_0xe26c[_0x37332e];return _0x292647;};'use strict';var multer=require('multer');var util=require(_0xce26('0x0'));var path=require(_0xce26('0x1'));var timeout=require(_0xce26('0x2'));var express=require(_0xce26('0x3'));var router=express[_0xce26('0x4')]();var fs_extra=require(_0xce26('0x5'));var auth=require(_0xce26('0x6'));var interaction=require(_0xce26('0x7'));var config=require(_0xce26('0x8'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0xce26('0x9')](),controller['index']);router[_0xce26('0xa')](_0xce26('0xb'),auth['isAuthenticated'](),controller[_0xce26('0xc')]);router[_0xce26('0xa')]('/:id/fields',auth[_0xce26('0x9')](),controller[_0xce26('0xd')]);router[_0xce26('0xa')]('/:id/subjects',auth[_0xce26('0x9')](),controller[_0xce26('0xe')]);router[_0xce26('0xa')](_0xce26('0xf'),auth[_0xce26('0x9')](),controller[_0xce26('0x10')]);router[_0xce26('0x11')]('/',auth[_0xce26('0x9')](),controller['create']);router[_0xce26('0x12')](_0xce26('0xb'),auth[_0xce26('0x9')](),controller[_0xce26('0x13')]);router[_0xce26('0x14')](_0xce26('0xb'),auth[_0xce26('0x9')](),controller['destroy']);module[_0xce26('0x15')]=router; \ No newline at end of file +var _0xb4db=['getDescriptions','post','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x57a15a,_0x20f022){var _0x3ca930=function(_0x17b032){while(--_0x17b032){_0x57a15a['push'](_0x57a15a['shift']());}};_0x3ca930(++_0x20f022);}(_0xb4db,0x19e));var _0xbb4d=function(_0x177e75,_0x3222cf){_0x177e75=_0x177e75-0x0;var _0x464a27=_0xb4db[_0x177e75];return _0x464a27;};'use strict';var multer=require(_0xbb4d('0x0'));var util=require('util');var path=require(_0xbb4d('0x1'));var timeout=require(_0xbb4d('0x2'));var express=require('express');var router=express[_0xbb4d('0x3')]();var fs_extra=require(_0xbb4d('0x4'));var auth=require(_0xbb4d('0x5'));var interaction=require(_0xbb4d('0x6'));var config=require(_0xbb4d('0x7'));var controller=require(_0xbb4d('0x8'));router['get']('/',auth[_0xbb4d('0x9')](),controller[_0xbb4d('0xa')]);router['get'](_0xbb4d('0xb'),auth['isAuthenticated'](),controller[_0xbb4d('0xc')]);router[_0xbb4d('0xd')](_0xbb4d('0xe'),auth[_0xbb4d('0x9')](),controller['getFields']);router[_0xbb4d('0xd')](_0xbb4d('0xf'),auth['isAuthenticated'](),controller[_0xbb4d('0x10')]);router['get'](_0xbb4d('0x11'),auth[_0xbb4d('0x9')](),controller[_0xbb4d('0x12')]);router[_0xbb4d('0x13')]('/',auth[_0xbb4d('0x9')](),controller['create']);router[_0xbb4d('0x14')](_0xbb4d('0xb'),auth[_0xbb4d('0x9')](),controller[_0xbb4d('0x15')]);router[_0xbb4d('0x16')]('/:id',auth[_0xbb4d('0x9')](),controller[_0xbb4d('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 76149f6..ffab5a9 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 _0xdd12=['contact','sequelize','exports','ENUM','lead','nothing','contact_lead'];(function(_0x1cab41,_0x4bfa57){var _0x511deb=function(_0x3d1a43){while(--_0x3d1a43){_0x1cab41['push'](_0x1cab41['shift']());}};_0x511deb(++_0x4bfa57);}(_0xdd12,0xf6));var _0x2dd1=function(_0x10d0db,_0x490773){_0x10d0db=_0x10d0db-0x0;var _0x1ccef3=_0xdd12[_0x10d0db];return _0x1ccef3;};'use strict';var Sequelize=require(_0x2dd1('0x0'));module[_0x2dd1('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x2dd1('0x2')](_0x2dd1('0x3'),'contact',_0x2dd1('0x4')),'defaultValue':_0x2dd1('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x2dd1('0x5'),_0x2dd1('0x6'),_0x2dd1('0x3')),'defaultValue':_0x2dd1('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x31dc=['lead','contact','nothing','contact_lead','exports','STRING','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x31dc,0xeb));var _0xc31d=function(_0x1936e4,_0xafc149){_0x1936e4=_0x1936e4-0x0;var _0x18495f=_0x31dc[_0x1936e4];return _0x18495f;};'use strict';var Sequelize=require('sequelize');module[_0xc31d('0x0')]={'name':{'type':Sequelize[_0xc31d('0x1')]},'moduleCreate':{'type':Sequelize[_0xc31d('0x2')](_0xc31d('0x3'),_0xc31d('0x4'),_0xc31d('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xc31d('0x2')](_0xc31d('0x6'),'contact','lead'),'defaultValue':_0xc31d('0x6')},'description':{'type':Sequelize[_0xc31d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index c136b9f..98e7711 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 _0xa79c=['key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type'];(function(_0x26721c,_0x247642){var _0x5b2a9c=function(_0x4e73b5){while(--_0x4e73b5){_0x26721c['push'](_0x26721c['shift']());}};_0x5b2a9c(++_0x247642);}(_0xa79c,0x198));var _0xca79=function(_0x5e0842,_0x21f6d4){_0x5e0842=_0x5e0842-0x0;var _0x3d7d42=_0xa79c[_0x5e0842];return _0x3d7d42;};'use strict';var emlformat=require(_0xca79('0x0'));var rimraf=require(_0xca79('0x1'));var zipdir=require(_0xca79('0x2'));var jsonpatch=require(_0xca79('0x3'));var rp=require(_0xca79('0x4'));var moment=require(_0xca79('0x5'));var BPromise=require(_0xca79('0x6'));var Mustache=require(_0xca79('0x7'));var util=require(_0xca79('0x8'));var path=require(_0xca79('0x9'));var sox=require(_0xca79('0xa'));var csv=require(_0xca79('0xb'));var ejs=require(_0xca79('0xc'));var fs=require('fs');var fs_extra=require(_0xca79('0xd'));var _=require(_0xca79('0xe'));var squel=require(_0xca79('0xf'));var crypto=require(_0xca79('0x10'));var jsforce=require(_0xca79('0x11'));var deskjs=require(_0xca79('0x12'));var toCsv=require('to-csv');var querystring=require(_0xca79('0x13'));var Papa=require(_0xca79('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca79('0x15'));var as=require(_0xca79('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca79('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xca79('0x18'));var licenseUtil=require(_0xca79('0x19'));var db=require(_0xca79('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xca79('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5cb463,_0x262e1f,_0x55d784,_0x54861e){return new BPromise(function(_0x2fa59a,_0x388207){var _0x5ddd88=_0x54861e||client;return _0x5ddd88[_0xca79('0x1c')](_0x5cb463,_0x55d784)['then'](function(_0x52a9d4){logger[_0xca79('0x1d')](_0xca79('0x1e'),_0x262e1f,_0xca79('0x1f'));logger['debug'](_0xca79('0x20'),_0x262e1f,_0xca79('0x1f'),JSON[_0xca79('0x21')](_0x52a9d4));if(_0x52a9d4[_0xca79('0x22')]){if(_0x52a9d4[_0xca79('0x22')][_0xca79('0x23')]===0x1f4){logger[_0xca79('0x22')](_0xca79('0x1e'),_0x262e1f,_0x52a9d4[_0xca79('0x22')][_0xca79('0x24')]);return _0x388207(_0x52a9d4[_0xca79('0x22')]['message']);}logger[_0xca79('0x22')]('ZohoConfiguration,\x20%s,\x20%s',_0x262e1f,_0x52a9d4[_0xca79('0x22')][_0xca79('0x24')]);return _0x2fa59a(_0x52a9d4[_0xca79('0x22')][_0xca79('0x24')]);}else{logger[_0xca79('0x1d')]('ZohoConfiguration,\x20%s,\x20%s',_0x262e1f,_0xca79('0x1f'));_0x2fa59a(_0x52a9d4['result'][_0xca79('0x24')]);}})[_0xca79('0x25')](function(_0x4231b4){logger[_0xca79('0x22')](_0xca79('0x1e'),_0x262e1f,_0x4231b4);_0x388207(_0x4231b4);});});}function respondWithStatusCode(_0x1d30fc,_0x503199){_0x503199=_0x503199||0xcc;return function(_0x178b8b){if(_0x178b8b){return _0x1d30fc[_0xca79('0x26')](_0x503199);}return _0x1d30fc[_0xca79('0x27')](_0x503199)[_0xca79('0x28')]();};}function respondWithResult(_0x3e3ab8,_0x634b61){_0x634b61=_0x634b61||0xc8;return function(_0x1ab430){if(_0x1ab430){return _0x3e3ab8[_0xca79('0x27')](_0x634b61)[_0xca79('0x29')](_0x1ab430);}};}function respondWithFilteredResult(_0x122383,_0x294301){return function(_0x355922){if(_0x355922){var _0x55d9c9=typeof _0x294301[_0xca79('0x2a')]===_0xca79('0x2b')&&typeof _0x294301['limit']===_0xca79('0x2b');var _0x26db8a=_0x355922[_0xca79('0x2c')];var _0x30e262=_0x55d9c9?0x0:_0x294301['offset'];var _0x41f88e=_0x55d9c9?_0x355922[_0xca79('0x2c')]:_0x294301[_0xca79('0x2a')]+_0x294301[_0xca79('0x2d')];var _0x38625b;if(_0x41f88e>=_0x26db8a){_0x41f88e=_0x26db8a;_0x38625b=0xc8;}else{_0x38625b=0xce;}_0x122383[_0xca79('0x27')](_0x38625b);return _0x122383[_0xca79('0x2e')](_0xca79('0x2f'),_0x30e262+'-'+_0x41f88e+'/'+_0x26db8a)[_0xca79('0x29')](_0x355922);}return null;};}function patchUpdates(_0x213db0){return function(_0x5d0e99){try{jsonpatch[_0xca79('0x30')](_0x5d0e99,_0x213db0,!![]);}catch(_0x4cb3df){return BPromise[_0xca79('0x31')](_0x4cb3df);}return _0x5d0e99[_0xca79('0x32')]();};}function saveUpdates(_0x19e6ad,_0x3ad9cc){return function(_0x1989a5){if(_0x1989a5){return _0x1989a5[_0xca79('0x33')](_0x19e6ad)['then'](function(_0x153279){return _0x153279;});}return null;};}function removeEntity(_0x5b4373,_0x2cf1ff){return function(_0x232bd1){if(_0x232bd1){return _0x232bd1[_0xca79('0x34')]()[_0xca79('0x35')](function(){_0x5b4373[_0xca79('0x27')](0xcc)[_0xca79('0x28')]();});}};}function handleEntityNotFound(_0x4ffa10,_0x44ef10){return function(_0x138171){if(!_0x138171){_0x4ffa10['sendStatus'](0x194);}return _0x138171;};}function handleError(_0x236f0f,_0x4d4f08){_0x4d4f08=_0x4d4f08||0x1f4;return function(_0x50015c){logger['error'](_0x50015c[_0xca79('0x36')]);if(_0x50015c[_0xca79('0x37')]){delete _0x50015c[_0xca79('0x37')];}_0x236f0f['status'](_0x4d4f08)[_0xca79('0x38')](_0x50015c);};}exports[_0xca79('0x39')]=function(_0x5311c0,_0x41996a){var _0x5c214c={},_0x26b406={},_0xd38387={'count':0x0,'rows':[]};var _0x77774c=_['map'](db[_0xca79('0x3a')][_0xca79('0x3b')],function(_0x99246c){return{'name':_0x99246c[_0xca79('0x3c')],'type':_0x99246c[_0xca79('0x3d')][_0xca79('0x3e')]};});_0x26b406['model']=_[_0xca79('0x3f')](_0x77774c,_0xca79('0x37'));_0x26b406[_0xca79('0x40')]=_[_0xca79('0x41')](_0x5311c0[_0xca79('0x40')]);_0x26b406['filters']=_[_0xca79('0x42')](_0x26b406[_0xca79('0x43')],_0x26b406[_0xca79('0x40')]);_0x5c214c[_0xca79('0x44')]=_['intersection'](_0x26b406[_0xca79('0x43')],qs[_0xca79('0x45')](_0x5311c0[_0xca79('0x40')]['fields']));_0x5c214c[_0xca79('0x44')]=_0x5c214c[_0xca79('0x44')][_0xca79('0x46')]?_0x5c214c['attributes']:_0x26b406[_0xca79('0x43')];if(!_0x5311c0[_0xca79('0x40')][_0xca79('0x47')](_0xca79('0x48'))){_0x5c214c['limit']=qs[_0xca79('0x2d')](_0x5311c0['query'][_0xca79('0x2d')]);_0x5c214c[_0xca79('0x2a')]=qs['offset'](_0x5311c0['query'][_0xca79('0x2a')]);}_0x5c214c[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x5311c0[_0xca79('0x40')][_0xca79('0x4a')]);_0x5c214c['where']=qs[_0xca79('0x4b')](_[_0xca79('0x4c')](_0x5311c0[_0xca79('0x40')],_0x26b406['filters']),_0x77774c);if(_0x5311c0['query'][_0xca79('0x4d')]){_0x5c214c[_0xca79('0x4e')]=_[_0xca79('0x4f')](_0x5c214c['where'],{'$or':_[_0xca79('0x3f')](_0x77774c,function(_0x2ca78b){if(_0x2ca78b[_0xca79('0x3d')]!==_0xca79('0x50')){var _0x3c0418={};_0x3c0418[_0x2ca78b[_0xca79('0x37')]]={'$like':'%'+_0x5311c0[_0xca79('0x40')][_0xca79('0x4d')]+'%'};return _0x3c0418;}})});}_0x5c214c=_[_0xca79('0x4f')]({},_0x5c214c,_0x5311c0[_0xca79('0x51')]);var _0x248112={'where':_0x5c214c[_0xca79('0x4e')]};return db[_0xca79('0x3a')][_0xca79('0x2c')](_0x248112)[_0xca79('0x35')](function(_0x229db1){_0xd38387[_0xca79('0x2c')]=_0x229db1;if(_0x5311c0[_0xca79('0x40')][_0xca79('0x52')]){_0x5c214c[_0xca79('0x53')]=[{'all':!![]}];}return db[_0xca79('0x3a')]['findAll'](_0x5c214c);})['then'](function(_0xa50a79){_0xd38387['rows']=_0xa50a79;return _0xd38387;})['then'](respondWithFilteredResult(_0x41996a,_0x5c214c))[_0xca79('0x25')](handleError(_0x41996a,null));};exports[_0xca79('0x54')]=function(_0x545a60,_0x2ff0e0){var _0x5846c={'raw':![],'where':{'id':_0x545a60[_0xca79('0x55')]['id']}},_0x293af6={};_0x293af6[_0xca79('0x43')]=_[_0xca79('0x41')](db['ZohoConfiguration'][_0xca79('0x3b')]);_0x293af6['query']=_['keys'](_0x545a60['query']);_0x293af6[_0xca79('0x4b')]=_[_0xca79('0x42')](_0x293af6[_0xca79('0x43')],_0x293af6[_0xca79('0x40')]);_0x5846c[_0xca79('0x44')]=_[_0xca79('0x42')](_0x293af6[_0xca79('0x43')],qs['fields'](_0x545a60[_0xca79('0x40')][_0xca79('0x45')]));_0x5846c['attributes']=_0x5846c[_0xca79('0x44')][_0xca79('0x46')]?_0x5846c[_0xca79('0x44')]:_0x293af6[_0xca79('0x43')];if(_0x545a60[_0xca79('0x40')][_0xca79('0x52')]){_0x5846c['include']=[{'all':!![]}];}_0x5846c=_['merge']({},_0x5846c,_0x545a60[_0xca79('0x51')]);return db[_0xca79('0x3a')][_0xca79('0x56')](_0x5846c)[_0xca79('0x35')](handleEntityNotFound(_0x2ff0e0,null))[_0xca79('0x35')](respondWithResult(_0x2ff0e0,null))[_0xca79('0x25')](handleError(_0x2ff0e0,null));};exports[_0xca79('0x57')]=function(_0x53ef13,_0x590df1){return db[_0xca79('0x3a')][_0xca79('0x57')](_0x53ef13[_0xca79('0x58')],{})[_0xca79('0x35')](respondWithResult(_0x590df1,0xc9))['catch'](handleError(_0x590df1,null));};exports[_0xca79('0x33')]=function(_0x2d45ec,_0x2b0734){if(_0x2d45ec[_0xca79('0x58')]['id']){delete _0x2d45ec[_0xca79('0x58')]['id'];}return db[_0xca79('0x3a')][_0xca79('0x56')]({'where':{'id':_0x2d45ec[_0xca79('0x55')]['id']}})[_0xca79('0x35')](handleEntityNotFound(_0x2b0734,null))[_0xca79('0x35')](saveUpdates(_0x2d45ec[_0xca79('0x58')],null))['then'](respondWithResult(_0x2b0734,null))[_0xca79('0x25')](handleError(_0x2b0734,null));};exports[_0xca79('0x34')]=function(_0x76381c,_0x3e639c){return db[_0xca79('0x3a')][_0xca79('0x56')]({'where':{'id':_0x76381c['params']['id']}})[_0xca79('0x35')](handleEntityNotFound(_0x3e639c,null))[_0xca79('0x35')](removeEntity(_0x3e639c,null))[_0xca79('0x25')](handleError(_0x3e639c,null));};exports[_0xca79('0x59')]=function(_0x2022d3,_0xb7bcd4,_0xd44e73){var _0x4086c9={};var _0xe492eb={};var _0x1f2d1f;var _0x2fc357;return db[_0xca79('0x3a')][_0xca79('0x5a')]({'where':{'id':_0x2022d3['params']['id']}})[_0xca79('0x35')](handleEntityNotFound(_0xb7bcd4,null))[_0xca79('0x35')](function(_0x31f7f3){if(_0x31f7f3){_0x1f2d1f=_0x31f7f3;_0xe492eb[_0xca79('0x43')]=_[_0xca79('0x41')](db[_0xca79('0x5b')][_0xca79('0x3b')]);_0xe492eb[_0xca79('0x40')]=_[_0xca79('0x41')](_0x2022d3[_0xca79('0x40')]);_0xe492eb[_0xca79('0x4b')]=_['intersection'](_0xe492eb[_0xca79('0x43')],_0xe492eb[_0xca79('0x40')]);_0x4086c9[_0xca79('0x44')]=_['intersection'](_0xe492eb[_0xca79('0x43')],qs[_0xca79('0x45')](_0x2022d3['query'][_0xca79('0x45')]));_0x4086c9[_0xca79('0x44')]=_0x4086c9[_0xca79('0x44')][_0xca79('0x46')]?_0x4086c9['attributes']:_0xe492eb[_0xca79('0x43')];_0x4086c9[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x2022d3['query'][_0xca79('0x4a')]);_0x4086c9[_0xca79('0x4e')]=qs[_0xca79('0x4b')](_['pick'](_0x2022d3[_0xca79('0x40')],_0xe492eb['filters']));if(_0x2022d3['query'][_0xca79('0x4d')]){_0x4086c9['where']=_[_0xca79('0x4f')](_0x4086c9[_0xca79('0x4e')],{'$or':_[_0xca79('0x3f')](_0x4086c9[_0xca79('0x44')],function(_0x550e9b){var _0x56bb70={};_0x56bb70[_0x550e9b]={'$like':'%'+_0x2022d3['query']['filter']+'%'};return _0x56bb70;})});}_0x4086c9=_[_0xca79('0x4f')]({},_0x4086c9,_0x2022d3[_0xca79('0x51')]);return _0x1f2d1f[_0xca79('0x59')](_0x4086c9);}})[_0xca79('0x35')](function(_0x19cd30){if(_0x19cd30){_0x2fc357=_0x19cd30[_0xca79('0x46')];if(!_0x2022d3[_0xca79('0x40')]['hasOwnProperty']('nolimit')){_0x4086c9[_0xca79('0x2d')]=qs[_0xca79('0x2d')](_0x2022d3[_0xca79('0x40')]['limit']);_0x4086c9[_0xca79('0x2a')]=qs[_0xca79('0x2a')](_0x2022d3[_0xca79('0x40')][_0xca79('0x2a')]);}return _0x1f2d1f[_0xca79('0x59')](_0x4086c9);}})[_0xca79('0x35')](function(_0xf864c){if(_0xf864c){return _0xf864c?{'count':_0x2fc357,'rows':_0xf864c}:null;}})['then'](respondWithResult(_0xb7bcd4,null))[_0xca79('0x25')](handleError(_0xb7bcd4,null));};exports['getSubjects']=function(_0x27c010,_0x4c6999,_0x44a28c){var _0xd22eb3={};var _0x17c1ae={};var _0x131c5f;var _0x46874f;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x27c010[_0xca79('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c6999,null))['then'](function(_0x79bcb){if(_0x79bcb){_0x131c5f=_0x79bcb;_0x17c1ae[_0xca79('0x43')]=_['keys'](db[_0xca79('0x5b')][_0xca79('0x3b')]);_0x17c1ae[_0xca79('0x40')]=_[_0xca79('0x41')](_0x27c010[_0xca79('0x40')]);_0x17c1ae[_0xca79('0x4b')]=_[_0xca79('0x42')](_0x17c1ae['model'],_0x17c1ae['query']);_0xd22eb3[_0xca79('0x44')]=_[_0xca79('0x42')](_0x17c1ae[_0xca79('0x43')],qs[_0xca79('0x45')](_0x27c010[_0xca79('0x40')][_0xca79('0x45')]));_0xd22eb3[_0xca79('0x44')]=_0xd22eb3['attributes'][_0xca79('0x46')]?_0xd22eb3[_0xca79('0x44')]:_0x17c1ae[_0xca79('0x43')];_0xd22eb3[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x27c010['query'][_0xca79('0x4a')]);_0xd22eb3[_0xca79('0x4e')]=qs[_0xca79('0x4b')](_[_0xca79('0x4c')](_0x27c010[_0xca79('0x40')],_0x17c1ae[_0xca79('0x4b')]));if(_0x27c010[_0xca79('0x40')][_0xca79('0x4d')]){_0xd22eb3['where']=_[_0xca79('0x4f')](_0xd22eb3[_0xca79('0x4e')],{'$or':_[_0xca79('0x3f')](_0xd22eb3[_0xca79('0x44')],function(_0xf03467){var _0x23b574={};_0x23b574[_0xf03467]={'$like':'%'+_0x27c010[_0xca79('0x40')][_0xca79('0x4d')]+'%'};return _0x23b574;})});}_0xd22eb3=_[_0xca79('0x4f')]({},_0xd22eb3,_0x27c010['options']);return _0x131c5f['getSubjects'](_0xd22eb3);}})[_0xca79('0x35')](function(_0x225cbc){if(_0x225cbc){_0x46874f=_0x225cbc[_0xca79('0x46')];if(!_0x27c010['query'][_0xca79('0x47')](_0xca79('0x48'))){_0xd22eb3['limit']=qs[_0xca79('0x2d')](_0x27c010['query'][_0xca79('0x2d')]);_0xd22eb3['offset']=qs['offset'](_0x27c010[_0xca79('0x40')][_0xca79('0x2a')]);}return _0x131c5f[_0xca79('0x5c')](_0xd22eb3);}})[_0xca79('0x35')](function(_0x2956ea){if(_0x2956ea){return _0x2956ea?{'count':_0x46874f,'rows':_0x2956ea}:null;}})[_0xca79('0x35')](respondWithResult(_0x4c6999,null))[_0xca79('0x25')](handleError(_0x4c6999,null));};exports[_0xca79('0x5d')]=function(_0x40dcbd,_0xf6d05c,_0x171a8a){var _0x1d0abf={};var _0x529f58={};var _0x14b551;var _0x272dcd;return db[_0xca79('0x3a')][_0xca79('0x5a')]({'where':{'id':_0x40dcbd[_0xca79('0x55')]['id']}})[_0xca79('0x35')](handleEntityNotFound(_0xf6d05c,null))[_0xca79('0x35')](function(_0x44ed53){if(_0x44ed53){_0x14b551=_0x44ed53;_0x529f58[_0xca79('0x43')]=_[_0xca79('0x41')](db[_0xca79('0x5b')]['rawAttributes']);_0x529f58[_0xca79('0x40')]=_['keys'](_0x40dcbd[_0xca79('0x40')]);_0x529f58[_0xca79('0x4b')]=_[_0xca79('0x42')](_0x529f58[_0xca79('0x43')],_0x529f58[_0xca79('0x40')]);_0x1d0abf['attributes']=_[_0xca79('0x42')](_0x529f58[_0xca79('0x43')],qs[_0xca79('0x45')](_0x40dcbd[_0xca79('0x40')][_0xca79('0x45')]));_0x1d0abf[_0xca79('0x44')]=_0x1d0abf['attributes'][_0xca79('0x46')]?_0x1d0abf[_0xca79('0x44')]:_0x529f58[_0xca79('0x43')];_0x1d0abf[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x40dcbd['query'][_0xca79('0x4a')]);_0x1d0abf[_0xca79('0x4e')]=qs['filters'](_[_0xca79('0x4c')](_0x40dcbd[_0xca79('0x40')],_0x529f58[_0xca79('0x4b')]));if(_0x40dcbd[_0xca79('0x40')][_0xca79('0x4d')]){_0x1d0abf[_0xca79('0x4e')]=_[_0xca79('0x4f')](_0x1d0abf[_0xca79('0x4e')],{'$or':_['map'](_0x1d0abf['attributes'],function(_0x20645f){var _0x5d79e5={};_0x5d79e5[_0x20645f]={'$like':'%'+_0x40dcbd[_0xca79('0x40')]['filter']+'%'};return _0x5d79e5;})});}_0x1d0abf=_[_0xca79('0x4f')]({},_0x1d0abf,_0x40dcbd[_0xca79('0x51')]);return _0x14b551[_0xca79('0x5d')](_0x1d0abf);}})[_0xca79('0x35')](function(_0x84ff27){if(_0x84ff27){_0x272dcd=_0x84ff27[_0xca79('0x46')];if(!_0x40dcbd[_0xca79('0x40')]['hasOwnProperty'](_0xca79('0x48'))){_0x1d0abf['limit']=qs['limit'](_0x40dcbd[_0xca79('0x40')][_0xca79('0x2d')]);_0x1d0abf['offset']=qs[_0xca79('0x2a')](_0x40dcbd[_0xca79('0x40')][_0xca79('0x2a')]);}return _0x14b551[_0xca79('0x5d')](_0x1d0abf);}})[_0xca79('0x35')](function(_0x2802c6){if(_0x2802c6){return _0x2802c6?{'count':_0x272dcd,'rows':_0x2802c6}:null;}})[_0xca79('0x35')](respondWithResult(_0xf6d05c,null))['catch'](handleError(_0xf6d05c,null));}; \ No newline at end of file +var _0xf498=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','getFields','findOne','order','getSubjects','ZohoField','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis'];(function(_0x21885d,_0x1599ed){var _0x2149f8=function(_0x1a5c17){while(--_0x1a5c17){_0x21885d['push'](_0x21885d['shift']());}};_0x2149f8(++_0x1599ed);}(_0xf498,0x108));var _0x8f49=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xf498[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x8f49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f49('0x1'));var jsonpatch=require(_0x8f49('0x2'));var rp=require('request-promise');var moment=require(_0x8f49('0x3'));var BPromise=require(_0x8f49('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8f49('0x5'));var sox=require(_0x8f49('0x6'));var csv=require(_0x8f49('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f49('0x8'));var _=require(_0x8f49('0x9'));var squel=require(_0x8f49('0xa'));var crypto=require(_0x8f49('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8f49('0xc'));var toCsv=require(_0x8f49('0x7'));var querystring=require('querystring');var Papa=require(_0x8f49('0xd'));var Redis=require(_0x8f49('0xe'));var authService=require(_0x8f49('0xf'));var qs=require(_0x8f49('0x10'));var as=require(_0x8f49('0x11'));var hardwareService=require(_0x8f49('0x12'));var logger=require(_0x8f49('0x13'))(_0x8f49('0x14'));var utils=require(_0x8f49('0x15'));var config=require(_0x8f49('0x16'));var licenseUtil=require(_0x8f49('0x17'));var db=require(_0x8f49('0x18'))['db'];var jayson=require(_0x8f49('0x19'));var client=jayson[_0x8f49('0x1a')][_0x8f49('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xcb52a1,_0x5a8f90,_0x15ac90,_0x14dbbd){return new BPromise(function(_0x1d5b82,_0x3d38f2){var _0x394f87=_0x14dbbd||client;return _0x394f87[_0x8f49('0x1c')](_0xcb52a1,_0x15ac90)[_0x8f49('0x1d')](function(_0x305613){logger[_0x8f49('0x1e')](_0x8f49('0x1f'),_0x5a8f90,_0x8f49('0x20'));logger[_0x8f49('0x21')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5a8f90,_0x8f49('0x20'),JSON[_0x8f49('0x22')](_0x305613));if(_0x305613['error']){if(_0x305613[_0x8f49('0x23')][_0x8f49('0x24')]===0x1f4){logger[_0x8f49('0x23')](_0x8f49('0x1f'),_0x5a8f90,_0x305613[_0x8f49('0x23')][_0x8f49('0x25')]);return _0x3d38f2(_0x305613[_0x8f49('0x23')][_0x8f49('0x25')]);}logger[_0x8f49('0x23')](_0x8f49('0x1f'),_0x5a8f90,_0x305613[_0x8f49('0x23')]['message']);return _0x1d5b82(_0x305613[_0x8f49('0x23')][_0x8f49('0x25')]);}else{logger[_0x8f49('0x1e')](_0x8f49('0x1f'),_0x5a8f90,_0x8f49('0x20'));_0x1d5b82(_0x305613['result'][_0x8f49('0x25')]);}})[_0x8f49('0x26')](function(_0x47a33b){logger['error'](_0x8f49('0x1f'),_0x5a8f90,_0x47a33b);_0x3d38f2(_0x47a33b);});});}function respondWithStatusCode(_0x448ac3,_0x2dad23){_0x2dad23=_0x2dad23||0xcc;return function(_0x5f2f88){if(_0x5f2f88){return _0x448ac3[_0x8f49('0x27')](_0x2dad23);}return _0x448ac3[_0x8f49('0x28')](_0x2dad23)[_0x8f49('0x29')]();};}function respondWithResult(_0x35709d,_0x175526){_0x175526=_0x175526||0xc8;return function(_0x2a34c0){if(_0x2a34c0){return _0x35709d['status'](_0x175526)[_0x8f49('0x2a')](_0x2a34c0);}};}function respondWithFilteredResult(_0x9fd032,_0x3ad2f5){return function(_0x42fdd2){if(_0x42fdd2){var _0x38106c=typeof _0x3ad2f5[_0x8f49('0x2b')]===_0x8f49('0x2c')&&typeof _0x3ad2f5[_0x8f49('0x2d')]===_0x8f49('0x2c');var _0x8146f8=_0x42fdd2[_0x8f49('0x2e')];var _0x354ad4=_0x38106c?0x0:_0x3ad2f5[_0x8f49('0x2b')];var _0x4eac20=_0x38106c?_0x42fdd2['count']:_0x3ad2f5[_0x8f49('0x2b')]+_0x3ad2f5['limit'];var _0x50ab7b;if(_0x4eac20>=_0x8146f8){_0x4eac20=_0x8146f8;_0x50ab7b=0xc8;}else{_0x50ab7b=0xce;}_0x9fd032[_0x8f49('0x28')](_0x50ab7b);return _0x9fd032['set']('Content-Range',_0x354ad4+'-'+_0x4eac20+'/'+_0x8146f8)['json'](_0x42fdd2);}return null;};}function patchUpdates(_0x45cb24){return function(_0x40c941){try{jsonpatch[_0x8f49('0x2f')](_0x40c941,_0x45cb24,!![]);}catch(_0x5f6783){return BPromise[_0x8f49('0x30')](_0x5f6783);}return _0x40c941[_0x8f49('0x31')]();};}function saveUpdates(_0xaa5d0e,_0x2ca470){return function(_0x271e30){if(_0x271e30){return _0x271e30[_0x8f49('0x32')](_0xaa5d0e)[_0x8f49('0x1d')](function(_0x1b6949){return _0x1b6949;});}return null;};}function removeEntity(_0x14df64,_0x2ba9ad){return function(_0x5cf4c3){if(_0x5cf4c3){return _0x5cf4c3[_0x8f49('0x33')]()[_0x8f49('0x1d')](function(){_0x14df64['status'](0xcc)[_0x8f49('0x29')]();});}};}function handleEntityNotFound(_0x193789,_0x5bb815){return function(_0x50a5c0){if(!_0x50a5c0){_0x193789[_0x8f49('0x27')](0x194);}return _0x50a5c0;};}function handleError(_0x2dfd42,_0x1e1b91){_0x1e1b91=_0x1e1b91||0x1f4;return function(_0x33264a){logger[_0x8f49('0x23')](_0x33264a['stack']);if(_0x33264a[_0x8f49('0x34')]){delete _0x33264a[_0x8f49('0x34')];}_0x2dfd42['status'](_0x1e1b91)[_0x8f49('0x35')](_0x33264a);};}exports[_0x8f49('0x36')]=function(_0x28ca30,_0x194617){var _0xdc3912={},_0x45ab8e={},_0x1bae10={'count':0x0,'rows':[]};var _0x193d49=_[_0x8f49('0x37')](db[_0x8f49('0x38')][_0x8f49('0x39')],function(_0x48ca13){return{'name':_0x48ca13[_0x8f49('0x3a')],'type':_0x48ca13[_0x8f49('0x3b')][_0x8f49('0x3c')]};});_0x45ab8e[_0x8f49('0x3d')]=_[_0x8f49('0x37')](_0x193d49,_0x8f49('0x34'));_0x45ab8e[_0x8f49('0x3e')]=_[_0x8f49('0x3f')](_0x28ca30[_0x8f49('0x3e')]);_0x45ab8e[_0x8f49('0x40')]=_[_0x8f49('0x41')](_0x45ab8e[_0x8f49('0x3d')],_0x45ab8e[_0x8f49('0x3e')]);_0xdc3912[_0x8f49('0x42')]=_[_0x8f49('0x41')](_0x45ab8e['model'],qs[_0x8f49('0x43')](_0x28ca30[_0x8f49('0x3e')][_0x8f49('0x43')]));_0xdc3912[_0x8f49('0x42')]=_0xdc3912[_0x8f49('0x42')][_0x8f49('0x44')]?_0xdc3912[_0x8f49('0x42')]:_0x45ab8e[_0x8f49('0x3d')];if(!_0x28ca30[_0x8f49('0x3e')][_0x8f49('0x45')](_0x8f49('0x46'))){_0xdc3912['limit']=qs[_0x8f49('0x2d')](_0x28ca30[_0x8f49('0x3e')][_0x8f49('0x2d')]);_0xdc3912['offset']=qs[_0x8f49('0x2b')](_0x28ca30[_0x8f49('0x3e')]['offset']);}_0xdc3912['order']=qs['sort'](_0x28ca30[_0x8f49('0x3e')][_0x8f49('0x47')]);_0xdc3912[_0x8f49('0x48')]=qs[_0x8f49('0x40')](_[_0x8f49('0x49')](_0x28ca30[_0x8f49('0x3e')],_0x45ab8e[_0x8f49('0x40')]),_0x193d49);if(_0x28ca30[_0x8f49('0x3e')][_0x8f49('0x4a')]){_0xdc3912['where']=_[_0x8f49('0x4b')](_0xdc3912[_0x8f49('0x48')],{'$or':_[_0x8f49('0x37')](_0x193d49,function(_0x26ce3e){if(_0x26ce3e[_0x8f49('0x3b')]!==_0x8f49('0x4c')){var _0x56a61f={};_0x56a61f[_0x26ce3e[_0x8f49('0x34')]]={'$like':'%'+_0x28ca30['query']['filter']+'%'};return _0x56a61f;}})});}_0xdc3912=_[_0x8f49('0x4b')]({},_0xdc3912,_0x28ca30[_0x8f49('0x4d')]);var _0x206018={'where':_0xdc3912[_0x8f49('0x48')]};return db[_0x8f49('0x38')]['count'](_0x206018)[_0x8f49('0x1d')](function(_0x30e578){_0x1bae10[_0x8f49('0x2e')]=_0x30e578;if(_0x28ca30[_0x8f49('0x3e')][_0x8f49('0x4e')]){_0xdc3912[_0x8f49('0x4f')]=[{'all':!![]}];}return db[_0x8f49('0x38')][_0x8f49('0x50')](_0xdc3912);})[_0x8f49('0x1d')](function(_0x551e90){_0x1bae10[_0x8f49('0x51')]=_0x551e90;return _0x1bae10;})[_0x8f49('0x1d')](respondWithFilteredResult(_0x194617,_0xdc3912))[_0x8f49('0x26')](handleError(_0x194617,null));};exports[_0x8f49('0x52')]=function(_0x3e1d99,_0xae57ee){var _0x3f09ee={'raw':![],'where':{'id':_0x3e1d99[_0x8f49('0x53')]['id']}},_0x5159d5={};_0x5159d5[_0x8f49('0x3d')]=_[_0x8f49('0x3f')](db[_0x8f49('0x38')][_0x8f49('0x39')]);_0x5159d5['query']=_[_0x8f49('0x3f')](_0x3e1d99['query']);_0x5159d5['filters']=_[_0x8f49('0x41')](_0x5159d5[_0x8f49('0x3d')],_0x5159d5['query']);_0x3f09ee['attributes']=_[_0x8f49('0x41')](_0x5159d5[_0x8f49('0x3d')],qs[_0x8f49('0x43')](_0x3e1d99[_0x8f49('0x3e')][_0x8f49('0x43')]));_0x3f09ee[_0x8f49('0x42')]=_0x3f09ee['attributes'][_0x8f49('0x44')]?_0x3f09ee[_0x8f49('0x42')]:_0x5159d5[_0x8f49('0x3d')];if(_0x3e1d99[_0x8f49('0x3e')]['includeAll']){_0x3f09ee[_0x8f49('0x4f')]=[{'all':!![]}];}_0x3f09ee=_[_0x8f49('0x4b')]({},_0x3f09ee,_0x3e1d99[_0x8f49('0x4d')]);return db['ZohoConfiguration']['find'](_0x3f09ee)[_0x8f49('0x1d')](handleEntityNotFound(_0xae57ee,null))[_0x8f49('0x1d')](respondWithResult(_0xae57ee,null))[_0x8f49('0x26')](handleError(_0xae57ee,null));};exports['create']=function(_0x494e20,_0x1b69e0){return db[_0x8f49('0x38')][_0x8f49('0x54')](_0x494e20[_0x8f49('0x55')],{})[_0x8f49('0x1d')](respondWithResult(_0x1b69e0,0xc9))[_0x8f49('0x26')](handleError(_0x1b69e0,null));};exports['update']=function(_0x1f7c02,_0x18bf07){if(_0x1f7c02['body']['id']){delete _0x1f7c02[_0x8f49('0x55')]['id'];}return db[_0x8f49('0x38')][_0x8f49('0x56')]({'where':{'id':_0x1f7c02[_0x8f49('0x53')]['id']}})[_0x8f49('0x1d')](handleEntityNotFound(_0x18bf07,null))[_0x8f49('0x1d')](saveUpdates(_0x1f7c02[_0x8f49('0x55')],null))['then'](respondWithResult(_0x18bf07,null))[_0x8f49('0x26')](handleError(_0x18bf07,null));};exports[_0x8f49('0x33')]=function(_0x341f53,_0x5496bb){return db['ZohoConfiguration'][_0x8f49('0x56')]({'where':{'id':_0x341f53['params']['id']}})[_0x8f49('0x1d')](handleEntityNotFound(_0x5496bb,null))[_0x8f49('0x1d')](removeEntity(_0x5496bb,null))[_0x8f49('0x26')](handleError(_0x5496bb,null));};exports[_0x8f49('0x57')]=function(_0x5b811e,_0x26c6d6,_0x2fe75f){var _0x1e9640={};var _0x974b57={};var _0x5f0c11;var _0xf25ccc;return db[_0x8f49('0x38')][_0x8f49('0x58')]({'where':{'id':_0x5b811e[_0x8f49('0x53')]['id']}})[_0x8f49('0x1d')](handleEntityNotFound(_0x26c6d6,null))[_0x8f49('0x1d')](function(_0x1b32c6){if(_0x1b32c6){_0x5f0c11=_0x1b32c6;_0x974b57[_0x8f49('0x3d')]=_['keys'](db['ZohoField'][_0x8f49('0x39')]);_0x974b57['query']=_['keys'](_0x5b811e[_0x8f49('0x3e')]);_0x974b57[_0x8f49('0x40')]=_['intersection'](_0x974b57[_0x8f49('0x3d')],_0x974b57[_0x8f49('0x3e')]);_0x1e9640[_0x8f49('0x42')]=_[_0x8f49('0x41')](_0x974b57[_0x8f49('0x3d')],qs[_0x8f49('0x43')](_0x5b811e[_0x8f49('0x3e')]['fields']));_0x1e9640[_0x8f49('0x42')]=_0x1e9640[_0x8f49('0x42')]['length']?_0x1e9640[_0x8f49('0x42')]:_0x974b57['model'];_0x1e9640[_0x8f49('0x59')]=qs[_0x8f49('0x47')](_0x5b811e[_0x8f49('0x3e')][_0x8f49('0x47')]);_0x1e9640['where']=qs[_0x8f49('0x40')](_['pick'](_0x5b811e['query'],_0x974b57[_0x8f49('0x40')]));if(_0x5b811e[_0x8f49('0x3e')][_0x8f49('0x4a')]){_0x1e9640['where']=_['merge'](_0x1e9640[_0x8f49('0x48')],{'$or':_['map'](_0x1e9640[_0x8f49('0x42')],function(_0x2111d9){var _0x41b59b={};_0x41b59b[_0x2111d9]={'$like':'%'+_0x5b811e[_0x8f49('0x3e')][_0x8f49('0x4a')]+'%'};return _0x41b59b;})});}_0x1e9640=_['merge']({},_0x1e9640,_0x5b811e[_0x8f49('0x4d')]);return _0x5f0c11['getFields'](_0x1e9640);}})[_0x8f49('0x1d')](function(_0x4eca83){if(_0x4eca83){_0xf25ccc=_0x4eca83[_0x8f49('0x44')];if(!_0x5b811e[_0x8f49('0x3e')][_0x8f49('0x45')](_0x8f49('0x46'))){_0x1e9640[_0x8f49('0x2d')]=qs[_0x8f49('0x2d')](_0x5b811e['query'][_0x8f49('0x2d')]);_0x1e9640['offset']=qs[_0x8f49('0x2b')](_0x5b811e[_0x8f49('0x3e')]['offset']);}return _0x5f0c11[_0x8f49('0x57')](_0x1e9640);}})[_0x8f49('0x1d')](function(_0xc2b302){if(_0xc2b302){return _0xc2b302?{'count':_0xf25ccc,'rows':_0xc2b302}:null;}})[_0x8f49('0x1d')](respondWithResult(_0x26c6d6,null))[_0x8f49('0x26')](handleError(_0x26c6d6,null));};exports[_0x8f49('0x5a')]=function(_0x34f510,_0x21cf19,_0x826249){var _0x2966f={};var _0x52e045={};var _0x58c03e;var _0x171c16;return db[_0x8f49('0x38')][_0x8f49('0x58')]({'where':{'id':_0x34f510[_0x8f49('0x53')]['id']}})[_0x8f49('0x1d')](handleEntityNotFound(_0x21cf19,null))['then'](function(_0x2ebf53){if(_0x2ebf53){_0x58c03e=_0x2ebf53;_0x52e045[_0x8f49('0x3d')]=_[_0x8f49('0x3f')](db[_0x8f49('0x5b')][_0x8f49('0x39')]);_0x52e045[_0x8f49('0x3e')]=_[_0x8f49('0x3f')](_0x34f510[_0x8f49('0x3e')]);_0x52e045[_0x8f49('0x40')]=_[_0x8f49('0x41')](_0x52e045[_0x8f49('0x3d')],_0x52e045['query']);_0x2966f[_0x8f49('0x42')]=_['intersection'](_0x52e045[_0x8f49('0x3d')],qs[_0x8f49('0x43')](_0x34f510[_0x8f49('0x3e')][_0x8f49('0x43')]));_0x2966f[_0x8f49('0x42')]=_0x2966f[_0x8f49('0x42')]['length']?_0x2966f[_0x8f49('0x42')]:_0x52e045[_0x8f49('0x3d')];_0x2966f['order']=qs['sort'](_0x34f510[_0x8f49('0x3e')][_0x8f49('0x47')]);_0x2966f['where']=qs[_0x8f49('0x40')](_[_0x8f49('0x49')](_0x34f510[_0x8f49('0x3e')],_0x52e045[_0x8f49('0x40')]));if(_0x34f510[_0x8f49('0x3e')][_0x8f49('0x4a')]){_0x2966f[_0x8f49('0x48')]=_[_0x8f49('0x4b')](_0x2966f[_0x8f49('0x48')],{'$or':_[_0x8f49('0x37')](_0x2966f['attributes'],function(_0x28ed5d){var _0x2156b0={};_0x2156b0[_0x28ed5d]={'$like':'%'+_0x34f510['query'][_0x8f49('0x4a')]+'%'};return _0x2156b0;})});}_0x2966f=_[_0x8f49('0x4b')]({},_0x2966f,_0x34f510[_0x8f49('0x4d')]);return _0x58c03e[_0x8f49('0x5a')](_0x2966f);}})[_0x8f49('0x1d')](function(_0x942a0){if(_0x942a0){_0x171c16=_0x942a0[_0x8f49('0x44')];if(!_0x34f510['query']['hasOwnProperty'](_0x8f49('0x46'))){_0x2966f[_0x8f49('0x2d')]=qs[_0x8f49('0x2d')](_0x34f510[_0x8f49('0x3e')][_0x8f49('0x2d')]);_0x2966f[_0x8f49('0x2b')]=qs['offset'](_0x34f510[_0x8f49('0x3e')][_0x8f49('0x2b')]);}return _0x58c03e[_0x8f49('0x5a')](_0x2966f);}})[_0x8f49('0x1d')](function(_0x1bb689){if(_0x1bb689){return _0x1bb689?{'count':_0x171c16,'rows':_0x1bb689}:null;}})[_0x8f49('0x1d')](respondWithResult(_0x21cf19,null))[_0x8f49('0x26')](handleError(_0x21cf19,null));};exports[_0x8f49('0x5c')]=function(_0x16878f,_0x52ae3b,_0x6bb4d5){var _0x1fb265={};var _0x18e082={};var _0x4fba91;var _0x3abc5f;return db[_0x8f49('0x38')][_0x8f49('0x58')]({'where':{'id':_0x16878f[_0x8f49('0x53')]['id']}})[_0x8f49('0x1d')](handleEntityNotFound(_0x52ae3b,null))[_0x8f49('0x1d')](function(_0x2b91fb){if(_0x2b91fb){_0x4fba91=_0x2b91fb;_0x18e082['model']=_['keys'](db['ZohoField'][_0x8f49('0x39')]);_0x18e082[_0x8f49('0x3e')]=_[_0x8f49('0x3f')](_0x16878f[_0x8f49('0x3e')]);_0x18e082[_0x8f49('0x40')]=_['intersection'](_0x18e082['model'],_0x18e082[_0x8f49('0x3e')]);_0x1fb265[_0x8f49('0x42')]=_[_0x8f49('0x41')](_0x18e082['model'],qs['fields'](_0x16878f[_0x8f49('0x3e')][_0x8f49('0x43')]));_0x1fb265[_0x8f49('0x42')]=_0x1fb265[_0x8f49('0x42')]['length']?_0x1fb265[_0x8f49('0x42')]:_0x18e082[_0x8f49('0x3d')];_0x1fb265[_0x8f49('0x59')]=qs[_0x8f49('0x47')](_0x16878f[_0x8f49('0x3e')][_0x8f49('0x47')]);_0x1fb265[_0x8f49('0x48')]=qs[_0x8f49('0x40')](_[_0x8f49('0x49')](_0x16878f['query'],_0x18e082['filters']));if(_0x16878f[_0x8f49('0x3e')][_0x8f49('0x4a')]){_0x1fb265[_0x8f49('0x48')]=_[_0x8f49('0x4b')](_0x1fb265[_0x8f49('0x48')],{'$or':_[_0x8f49('0x37')](_0x1fb265[_0x8f49('0x42')],function(_0x305710){var _0x134755={};_0x134755[_0x305710]={'$like':'%'+_0x16878f[_0x8f49('0x3e')]['filter']+'%'};return _0x134755;})});}_0x1fb265=_['merge']({},_0x1fb265,_0x16878f['options']);return _0x4fba91[_0x8f49('0x5c')](_0x1fb265);}})[_0x8f49('0x1d')](function(_0x1e488d){if(_0x1e488d){_0x3abc5f=_0x1e488d[_0x8f49('0x44')];if(!_0x16878f[_0x8f49('0x3e')][_0x8f49('0x45')](_0x8f49('0x46'))){_0x1fb265[_0x8f49('0x2d')]=qs[_0x8f49('0x2d')](_0x16878f[_0x8f49('0x3e')][_0x8f49('0x2d')]);_0x1fb265[_0x8f49('0x2b')]=qs[_0x8f49('0x2b')](_0x16878f[_0x8f49('0x3e')][_0x8f49('0x2b')]);}return _0x4fba91[_0x8f49('0x5c')](_0x1fb265);}})[_0x8f49('0x1d')](function(_0x36a469){if(_0x36a469){return _0x36a469?{'count':_0x3abc5f,'rows':_0x36a469}:null;}})['then'](respondWithResult(_0x52ae3b,null))[_0x8f49('0x26')](handleError(_0x52ae3b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b8a8250..78e89d9 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 _0x9ba1=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x439e58,_0x42e1ff){var _0x5db31f=function(_0xe4c8ff){while(--_0xe4c8ff){_0x439e58['push'](_0x439e58['shift']());}};_0x5db31f(++_0x42e1ff);}(_0x9ba1,0x73));var _0x19ba=function(_0x9c27f3,_0x1522c4){_0x9c27f3=_0x9c27f3-0x0;var _0x46c1b6=_0x9ba1[_0x9c27f3];return _0x46c1b6;};'use strict';var _=require(_0x19ba('0x0'));var util=require(_0x19ba('0x1'));var logger=require(_0x19ba('0x2'))(_0x19ba('0x3'));var moment=require(_0x19ba('0x4'));var BPromise=require(_0x19ba('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19ba('0x6'));var rimraf=require(_0x19ba('0x7'));var config=require(_0x19ba('0x8'));var attributes=require(_0x19ba('0x9'));module[_0x19ba('0xa')]=function(_0x99a82b,_0x5c51c3){return _0x99a82b[_0x19ba('0xb')](_0x19ba('0xc'),attributes,{'tableName':_0x19ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1d1=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','moment','bluebird'];(function(_0x2dc806,_0x5a494d){var _0xac5920=function(_0x47a8ce){while(--_0x47a8ce){_0x2dc806['push'](_0x2dc806['shift']());}};_0xac5920(++_0x5a494d);}(_0xe1d1,0x134));var _0x1e1d=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xe1d1[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var util=require(_0x1e1d('0x0'));var logger=require(_0x1e1d('0x1'))('api');var moment=require(_0x1e1d('0x2'));var BPromise=require(_0x1e1d('0x3'));var rp=require(_0x1e1d('0x4'));var fs=require('fs');var path=require(_0x1e1d('0x5'));var rimraf=require(_0x1e1d('0x6'));var config=require(_0x1e1d('0x7'));var attributes=require(_0x1e1d('0x8'));module[_0x1e1d('0x9')]=function(_0x5568ce,_0x3e0804){return _0x5568ce['define'](_0x1e1d('0xa'),attributes,{'tableName':_0x1e1d('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 2847f94..c48b9cc 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 _0x013b=['message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x013b,0x1e8));var _0xb013=function(_0x38b8c6,_0x541f91){_0x38b8c6=_0x38b8c6-0x0;var _0x3104d6=_0x013b[_0x38b8c6];return _0x3104d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb013('0x0'));var BPromise=require(_0xb013('0x1'));var rs=require(_0xb013('0x2'));var fs=require('fs');var Redis=require(_0xb013('0x3'));var db=require(_0xb013('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb013('0x5'))(_0xb013('0x6'));var config=require(_0xb013('0x7'));var jayson=require(_0xb013('0x8'));var client=jayson[_0xb013('0x9')][_0xb013('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x752b18,_0x53bf02,_0x419ba9){return new BPromise(function(_0x4bd2a1,_0x303057){return client['request'](_0x752b18,_0x419ba9)[_0xb013('0xb')](function(_0x223210){logger[_0xb013('0xc')](_0xb013('0xd'),_0x53bf02,_0xb013('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x53bf02,_0xb013('0xe'),JSON['stringify'](_0x223210));if(_0x223210[_0xb013('0xf')]){if(_0x223210[_0xb013('0xf')]['code']===0x1f4){logger[_0xb013('0xf')](_0xb013('0xd'),_0x53bf02,_0x223210['error']['message']);return _0x303057(_0x223210[_0xb013('0xf')]['message']);}logger[_0xb013('0xf')](_0xb013('0xd'),_0x53bf02,_0x223210[_0xb013('0xf')]['message']);return _0x4bd2a1(_0x223210[_0xb013('0xf')][_0xb013('0x10')]);}else{logger[_0xb013('0xc')](_0xb013('0xd'),_0x53bf02,'request\x20sent');_0x4bd2a1(_0x223210['result'][_0xb013('0x10')]);}})[_0xb013('0x11')](function(_0x1b5c6e){logger[_0xb013('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x53bf02,_0x1b5c6e);_0x303057(_0x1b5c6e);});});} \ No newline at end of file +var _0x0012=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x0012,0x77));var _0x2001=function(_0x3da0bd,_0x577295){_0x3da0bd=_0x3da0bd-0x0;var _0x310b01=_0x0012[_0x3da0bd];return _0x310b01;};'use strict';var _=require(_0x2001('0x0'));var util=require(_0x2001('0x1'));var moment=require(_0x2001('0x2'));var BPromise=require(_0x2001('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2001('0x4'));var db=require(_0x2001('0x5'))['db'];var utils=require(_0x2001('0x6'));var logger=require(_0x2001('0x7'))(_0x2001('0x8'));var config=require(_0x2001('0x9'));var jayson=require(_0x2001('0xa'));var client=jayson[_0x2001('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x67a03b,_0x1f8c71,_0x38f2c8){return new BPromise(function(_0x24ae0e,_0x4f8dfc){return client[_0x2001('0xc')](_0x67a03b,_0x38f2c8)[_0x2001('0xd')](function(_0x3695f2){logger[_0x2001('0xe')](_0x2001('0xf'),_0x1f8c71,_0x2001('0x10'));logger[_0x2001('0x11')](_0x2001('0x12'),_0x1f8c71,_0x2001('0x10'),JSON[_0x2001('0x13')](_0x3695f2));if(_0x3695f2['error']){if(_0x3695f2[_0x2001('0x14')][_0x2001('0x15')]===0x1f4){logger['error'](_0x2001('0xf'),_0x1f8c71,_0x3695f2[_0x2001('0x14')][_0x2001('0x16')]);return _0x4f8dfc(_0x3695f2[_0x2001('0x14')][_0x2001('0x16')]);}logger[_0x2001('0x14')](_0x2001('0xf'),_0x1f8c71,_0x3695f2[_0x2001('0x14')][_0x2001('0x16')]);return _0x24ae0e(_0x3695f2['error'][_0x2001('0x16')]);}else{logger['info'](_0x2001('0xf'),_0x1f8c71,_0x2001('0x10'));_0x24ae0e(_0x3695f2[_0x2001('0x17')]['message']);}})['catch'](function(_0xdbed44){logger['error'](_0x2001('0xf'),_0x1f8c71,_0xdbed44);_0x4f8dfc(_0xdbed44);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6bc760d..ac3cdd7 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 _0x9974=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x4c825c,_0x123fbd){var _0x510e46=function(_0x4d78a9){while(--_0x4d78a9){_0x4c825c['push'](_0x4c825c['shift']());}};_0x510e46(++_0x123fbd);}(_0x9974,0xb1));var _0x4997=function(_0x57d9e0,_0xadcc2f){_0x57d9e0=_0x57d9e0-0x0;var _0x2a2e6a=_0x9974[_0x57d9e0];return _0x2a2e6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4997('0x0'));var timeout=require(_0x4997('0x1'));var express=require(_0x4997('0x2'));var router=express[_0x4997('0x3')]();var fs_extra=require(_0x4997('0x4'));var auth=require(_0x4997('0x5'));var interaction=require(_0x4997('0x6'));var config=require(_0x4997('0x7'));var controller=require('./intZohoField.controller');router[_0x4997('0x8')]('/',auth['isAuthenticated'](),controller[_0x4997('0x9')]);router[_0x4997('0x8')](_0x4997('0xa'),auth[_0x4997('0xb')](),controller[_0x4997('0xc')]);router[_0x4997('0xd')]('/',auth['isAuthenticated'](),controller[_0x4997('0xe')]);router[_0x4997('0xf')](_0x4997('0xa'),auth[_0x4997('0xb')](),controller[_0x4997('0x10')]);router[_0x4997('0x11')]('/:id',auth[_0x4997('0xb')](),controller[_0x4997('0x12')]);module[_0x4997('0x13')]=router; \ No newline at end of file +var _0xf245=['update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated','post','create'];(function(_0x8d44b8,_0x467f83){var _0xab2476=function(_0x33d39c){while(--_0x33d39c){_0x8d44b8['push'](_0x8d44b8['shift']());}};_0xab2476(++_0x467f83);}(_0xf245,0x1bd));var _0x5f24=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xf245[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x5f24('0x0'));var path=require(_0x5f24('0x1'));var timeout=require(_0x5f24('0x2'));var express=require('express');var router=express[_0x5f24('0x3')]();var fs_extra=require(_0x5f24('0x4'));var auth=require(_0x5f24('0x5'));var interaction=require(_0x5f24('0x6'));var config=require(_0x5f24('0x7'));var controller=require(_0x5f24('0x8'));router[_0x5f24('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5f24('0x9')](_0x5f24('0xa'),auth[_0x5f24('0xb')](),controller['show']);router[_0x5f24('0xc')]('/',auth[_0x5f24('0xb')](),controller[_0x5f24('0xd')]);router['put'](_0x5f24('0xa'),auth['isAuthenticated'](),controller[_0x5f24('0xe')]);router['delete'](_0x5f24('0xa'),auth['isAuthenticated'](),controller[_0x5f24('0xf')]);module[_0x5f24('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index d9677b3..9c3ffa1 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 _0x95f9=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0xb72e55,_0x1e6520){var _0x2b6271=function(_0x2ea164){while(--_0x2ea164){_0xb72e55['push'](_0xb72e55['shift']());}};_0x2b6271(++_0x1e6520);}(_0x95f9,0x105));var _0x995f=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x95f9[_0x2df507];return _0x1f7167;};'use strict';var Sequelize=require(_0x995f('0x0'));module[_0x995f('0x1')]={'type':{'type':Sequelize[_0x995f('0x2')](_0x995f('0x3'),_0x995f('0x4'),_0x995f('0x5'),_0x995f('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x995f('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x995f('0x2')](_0x995f('0x3'),_0x995f('0x4'),_0x995f('0x5'))},'keyContent':{'type':Sequelize[_0x995f('0x7')]},'idField':{'type':Sequelize[_0x995f('0x7')]},'nameField':{'type':Sequelize[_0x995f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfd67=['customVariable','BOOLEAN','sequelize','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x5a11f,_0x210234){var _0x44aa6b=function(_0x2ca937){while(--_0x2ca937){_0x5a11f['push'](_0x5a11f['shift']());}};_0x44aa6b(++_0x210234);}(_0xfd67,0xec));var _0x7fd6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xfd67[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x7fd6('0x0'));module['exports']={'type':{'type':Sequelize[_0x7fd6('0x1')](_0x7fd6('0x2'),_0x7fd6('0x3'),'customVariable',_0x7fd6('0x4'),_0x7fd6('0x5')),'defaultValue':_0x7fd6('0x2')},'content':{'type':Sequelize[_0x7fd6('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7fd6('0x2'),'variable',_0x7fd6('0x7'))},'keyContent':{'type':Sequelize[_0x7fd6('0x6')]},'idField':{'type':Sequelize[_0x7fd6('0x6')]},'nameField':{'type':Sequelize[_0x7fd6('0x6')]},'customField':{'type':Sequelize[_0x7fd6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7fd6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 569d8a4..535ae98 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 _0x802a=['includeAll','include','rows','catch','show','length','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options'];(function(_0x4932a6,_0x530e29){var _0x3b45b9=function(_0x1d1eb7){while(--_0x1d1eb7){_0x4932a6['push'](_0x4932a6['shift']());}};_0x3b45b9(++_0x530e29);}(_0x802a,0xe5));var _0xa802=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x802a[_0x1da527];return _0x40fc7c;};'use strict';var emlformat=require(_0xa802('0x0'));var rimraf=require(_0xa802('0x1'));var zipdir=require(_0xa802('0x2'));var jsonpatch=require(_0xa802('0x3'));var rp=require('request-promise');var moment=require(_0xa802('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa802('0x5'));var path=require(_0xa802('0x6'));var sox=require(_0xa802('0x7'));var csv=require(_0xa802('0x8'));var ejs=require(_0xa802('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa802('0xa'));var squel=require('squel');var crypto=require(_0xa802('0xb'));var jsforce=require(_0xa802('0xc'));var deskjs=require(_0xa802('0xd'));var toCsv=require(_0xa802('0x8'));var querystring=require(_0xa802('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa802('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa802('0x10'));var hardwareService=require(_0xa802('0x11'));var logger=require(_0xa802('0x12'))(_0xa802('0x13'));var utils=require(_0xa802('0x14'));var config=require(_0xa802('0x15'));var licenseUtil=require(_0xa802('0x16'));var db=require(_0xa802('0x17'))['db'];function respondWithStatusCode(_0x527853,_0x34bbee){_0x34bbee=_0x34bbee||0xcc;return function(_0x56e947){if(_0x56e947){return _0x527853[_0xa802('0x18')](_0x34bbee);}return _0x527853[_0xa802('0x19')](_0x34bbee)['end']();};}function respondWithResult(_0x1d145d,_0x3b5bba){_0x3b5bba=_0x3b5bba||0xc8;return function(_0x8ef489){if(_0x8ef489){return _0x1d145d[_0xa802('0x19')](_0x3b5bba)[_0xa802('0x1a')](_0x8ef489);}};}function respondWithFilteredResult(_0x3f23f5,_0x490b7c){return function(_0x53e939){if(_0x53e939){var _0x5dbaff=typeof _0x490b7c[_0xa802('0x1b')]===_0xa802('0x1c')&&typeof _0x490b7c[_0xa802('0x1d')]===_0xa802('0x1c');var _0x4e3dd3=_0x53e939[_0xa802('0x1e')];var _0x245cb9=_0x5dbaff?0x0:_0x490b7c[_0xa802('0x1b')];var _0x35fbf2=_0x5dbaff?_0x53e939[_0xa802('0x1e')]:_0x490b7c['offset']+_0x490b7c[_0xa802('0x1d')];var _0x52ecac;if(_0x35fbf2>=_0x4e3dd3){_0x35fbf2=_0x4e3dd3;_0x52ecac=0xc8;}else{_0x52ecac=0xce;}_0x3f23f5[_0xa802('0x19')](_0x52ecac);return _0x3f23f5[_0xa802('0x1f')](_0xa802('0x20'),_0x245cb9+'-'+_0x35fbf2+'/'+_0x4e3dd3)[_0xa802('0x1a')](_0x53e939);}return null;};}function patchUpdates(_0x213c0c){return function(_0x21d633){try{jsonpatch[_0xa802('0x21')](_0x21d633,_0x213c0c,!![]);}catch(_0x4391cc){return BPromise['reject'](_0x4391cc);}return _0x21d633[_0xa802('0x22')]();};}function saveUpdates(_0x235fea,_0x469993){return function(_0x4daadc){if(_0x4daadc){return _0x4daadc[_0xa802('0x23')](_0x235fea)['then'](function(_0x7c8a3d){return _0x7c8a3d;});}return null;};}function removeEntity(_0x51ef76,_0xad1791){return function(_0x1b4d99){if(_0x1b4d99){return _0x1b4d99[_0xa802('0x24')]()[_0xa802('0x25')](function(){_0x51ef76[_0xa802('0x19')](0xcc)[_0xa802('0x26')]();});}};}function handleEntityNotFound(_0x37a5e8,_0x578974){return function(_0x55e06a){if(!_0x55e06a){_0x37a5e8['sendStatus'](0x194);}return _0x55e06a;};}function handleError(_0x3f5f77,_0x3edd86){_0x3edd86=_0x3edd86||0x1f4;return function(_0x1a19fb){logger[_0xa802('0x27')](_0x1a19fb['stack']);if(_0x1a19fb[_0xa802('0x28')]){delete _0x1a19fb[_0xa802('0x28')];}_0x3f5f77[_0xa802('0x19')](_0x3edd86)[_0xa802('0x29')](_0x1a19fb);};}exports[_0xa802('0x2a')]=function(_0xb79b07,_0x36db64){var _0x475ca4={},_0x2d4f23={},_0x4b82a3={'count':0x0,'rows':[]};var _0x86a18d=_[_0xa802('0x2b')](db[_0xa802('0x2c')][_0xa802('0x2d')],function(_0x34afc5){return{'name':_0x34afc5[_0xa802('0x2e')],'type':_0x34afc5[_0xa802('0x2f')]['key']};});_0x2d4f23[_0xa802('0x30')]=_[_0xa802('0x2b')](_0x86a18d,_0xa802('0x28'));_0x2d4f23[_0xa802('0x31')]=_[_0xa802('0x32')](_0xb79b07['query']);_0x2d4f23[_0xa802('0x33')]=_[_0xa802('0x34')](_0x2d4f23[_0xa802('0x30')],_0x2d4f23[_0xa802('0x31')]);_0x475ca4[_0xa802('0x35')]=_[_0xa802('0x34')](_0x2d4f23[_0xa802('0x30')],qs['fields'](_0xb79b07[_0xa802('0x31')][_0xa802('0x36')]));_0x475ca4['attributes']=_0x475ca4[_0xa802('0x35')]['length']?_0x475ca4[_0xa802('0x35')]:_0x2d4f23['model'];if(!_0xb79b07[_0xa802('0x31')][_0xa802('0x37')]('nolimit')){_0x475ca4[_0xa802('0x1d')]=qs[_0xa802('0x1d')](_0xb79b07['query'][_0xa802('0x1d')]);_0x475ca4[_0xa802('0x1b')]=qs['offset'](_0xb79b07['query'][_0xa802('0x1b')]);}_0x475ca4[_0xa802('0x38')]=qs[_0xa802('0x39')](_0xb79b07[_0xa802('0x31')][_0xa802('0x39')]);_0x475ca4[_0xa802('0x3a')]=qs['filters'](_['pick'](_0xb79b07[_0xa802('0x31')],_0x2d4f23[_0xa802('0x33')]),_0x86a18d);if(_0xb79b07['query']['filter']){_0x475ca4['where']=_[_0xa802('0x3b')](_0x475ca4['where'],{'$or':_[_0xa802('0x2b')](_0x86a18d,function(_0x5b4fe3){if(_0x5b4fe3[_0xa802('0x2f')]!==_0xa802('0x3c')){var _0x18758d={};_0x18758d[_0x5b4fe3[_0xa802('0x28')]]={'$like':'%'+_0xb79b07[_0xa802('0x31')][_0xa802('0x3d')]+'%'};return _0x18758d;}})});}_0x475ca4=_['merge']({},_0x475ca4,_0xb79b07[_0xa802('0x3e')]);var _0x1cce9e={'where':_0x475ca4[_0xa802('0x3a')]};return db['ZohoField'][_0xa802('0x1e')](_0x1cce9e)[_0xa802('0x25')](function(_0x5f29bd){_0x4b82a3[_0xa802('0x1e')]=_0x5f29bd;if(_0xb79b07['query'][_0xa802('0x3f')]){_0x475ca4[_0xa802('0x40')]=[{'all':!![]}];}return db[_0xa802('0x2c')]['findAll'](_0x475ca4);})[_0xa802('0x25')](function(_0x323823){_0x4b82a3[_0xa802('0x41')]=_0x323823;return _0x4b82a3;})[_0xa802('0x25')](respondWithFilteredResult(_0x36db64,_0x475ca4))[_0xa802('0x42')](handleError(_0x36db64,null));};exports[_0xa802('0x43')]=function(_0x585eac,_0x48024c){var _0x14eff3={'raw':!![],'where':{'id':_0x585eac['params']['id']}},_0x30d193={};_0x30d193[_0xa802('0x30')]=_['keys'](db['ZohoField'][_0xa802('0x2d')]);_0x30d193[_0xa802('0x31')]=_[_0xa802('0x32')](_0x585eac[_0xa802('0x31')]);_0x30d193[_0xa802('0x33')]=_[_0xa802('0x34')](_0x30d193[_0xa802('0x30')],_0x30d193[_0xa802('0x31')]);_0x14eff3['attributes']=_[_0xa802('0x34')](_0x30d193['model'],qs[_0xa802('0x36')](_0x585eac[_0xa802('0x31')]['fields']));_0x14eff3['attributes']=_0x14eff3[_0xa802('0x35')][_0xa802('0x44')]?_0x14eff3[_0xa802('0x35')]:_0x30d193[_0xa802('0x30')];if(_0x585eac[_0xa802('0x31')]['includeAll']){_0x14eff3['include']=[{'all':!![]}];}_0x14eff3=_[_0xa802('0x3b')]({},_0x14eff3,_0x585eac[_0xa802('0x3e')]);return db[_0xa802('0x2c')]['find'](_0x14eff3)[_0xa802('0x25')](handleEntityNotFound(_0x48024c,null))['then'](respondWithResult(_0x48024c,null))[_0xa802('0x42')](handleError(_0x48024c,null));};exports[_0xa802('0x45')]=function(_0x5ab6a4,_0x1f17ab){return db['ZohoField'][_0xa802('0x45')](_0x5ab6a4[_0xa802('0x46')],{})[_0xa802('0x25')](respondWithResult(_0x1f17ab,0xc9))[_0xa802('0x42')](handleError(_0x1f17ab,null));};exports[_0xa802('0x23')]=function(_0x56edde,_0x4e71c0){if(_0x56edde[_0xa802('0x46')]['id']){delete _0x56edde[_0xa802('0x46')]['id'];}return db[_0xa802('0x2c')][_0xa802('0x47')]({'where':{'id':_0x56edde[_0xa802('0x48')]['id']}})[_0xa802('0x25')](handleEntityNotFound(_0x4e71c0,null))[_0xa802('0x25')](saveUpdates(_0x56edde[_0xa802('0x46')],null))[_0xa802('0x25')](respondWithResult(_0x4e71c0,null))[_0xa802('0x42')](handleError(_0x4e71c0,null));};exports['destroy']=function(_0xc150c9,_0x17e1cf){return db[_0xa802('0x2c')][_0xa802('0x47')]({'where':{'id':_0xc150c9[_0xa802('0x48')]['id']}})[_0xa802('0x25')](handleEntityNotFound(_0x17e1cf,null))[_0xa802('0x25')](removeEntity(_0x17e1cf,null))['catch'](handleError(_0x17e1cf,null));}; \ No newline at end of file +var _0xf349=['type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','length','includeAll','include','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','ZohoField','rawAttributes','fieldName'];(function(_0x110b69,_0x39c0ad){var _0x2d1cdd=function(_0x38862e){while(--_0x38862e){_0x110b69['push'](_0x110b69['shift']());}};_0x2d1cdd(++_0x39c0ad);}(_0xf349,0xab));var _0x9f34=function(_0x812b4,_0x5c732f){_0x812b4=_0x812b4-0x0;var _0x1b1950=_0xf349[_0x812b4];return _0x1b1950;};'use strict';var emlformat=require(_0x9f34('0x0'));var rimraf=require(_0x9f34('0x1'));var zipdir=require(_0x9f34('0x2'));var jsonpatch=require(_0x9f34('0x3'));var rp=require(_0x9f34('0x4'));var moment=require(_0x9f34('0x5'));var BPromise=require(_0x9f34('0x6'));var Mustache=require(_0x9f34('0x7'));var util=require(_0x9f34('0x8'));var path=require(_0x9f34('0x9'));var sox=require(_0x9f34('0xa'));var csv=require(_0x9f34('0xb'));var ejs=require(_0x9f34('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f34('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9f34('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9f34('0xf'));var Papa=require('papaparse');var Redis=require(_0x9f34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9f34('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f34('0x12'));var logger=require(_0x9f34('0x13'))(_0x9f34('0x14'));var utils=require('../../config/utils');var config=require(_0x9f34('0x15'));var licenseUtil=require(_0x9f34('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x163984,_0xd7aef2){_0xd7aef2=_0xd7aef2||0xcc;return function(_0x5973dd){if(_0x5973dd){return _0x163984['sendStatus'](_0xd7aef2);}return _0x163984[_0x9f34('0x17')](_0xd7aef2)[_0x9f34('0x18')]();};}function respondWithResult(_0x2a56f6,_0x536b4c){_0x536b4c=_0x536b4c||0xc8;return function(_0x266697){if(_0x266697){return _0x2a56f6[_0x9f34('0x17')](_0x536b4c)[_0x9f34('0x19')](_0x266697);}};}function respondWithFilteredResult(_0x3be4cd,_0x29a0d6){return function(_0x424ae4){if(_0x424ae4){var _0x38c004=typeof _0x29a0d6['offset']===_0x9f34('0x1a')&&typeof _0x29a0d6[_0x9f34('0x1b')]===_0x9f34('0x1a');var _0x2ce371=_0x424ae4[_0x9f34('0x1c')];var _0x52b9d1=_0x38c004?0x0:_0x29a0d6[_0x9f34('0x1d')];var _0x4cbbce=_0x38c004?_0x424ae4[_0x9f34('0x1c')]:_0x29a0d6[_0x9f34('0x1d')]+_0x29a0d6[_0x9f34('0x1b')];var _0x4b5706;if(_0x4cbbce>=_0x2ce371){_0x4cbbce=_0x2ce371;_0x4b5706=0xc8;}else{_0x4b5706=0xce;}_0x3be4cd['status'](_0x4b5706);return _0x3be4cd[_0x9f34('0x1e')](_0x9f34('0x1f'),_0x52b9d1+'-'+_0x4cbbce+'/'+_0x2ce371)['json'](_0x424ae4);}return null;};}function patchUpdates(_0x368c7d){return function(_0x25077f){try{jsonpatch[_0x9f34('0x20')](_0x25077f,_0x368c7d,!![]);}catch(_0x52cbbd){return BPromise[_0x9f34('0x21')](_0x52cbbd);}return _0x25077f['save']();};}function saveUpdates(_0x37497d,_0x492b9){return function(_0x28dc80){if(_0x28dc80){return _0x28dc80[_0x9f34('0x22')](_0x37497d)[_0x9f34('0x23')](function(_0x205539){return _0x205539;});}return null;};}function removeEntity(_0x1bfecf,_0x402241){return function(_0x23bef){if(_0x23bef){return _0x23bef[_0x9f34('0x24')]()['then'](function(){_0x1bfecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a978,_0x45149c){return function(_0x1c852f){if(!_0x1c852f){_0x42a978['sendStatus'](0x194);}return _0x1c852f;};}function handleError(_0x39a6ee,_0x1a8cfc){_0x1a8cfc=_0x1a8cfc||0x1f4;return function(_0x48e82d){logger[_0x9f34('0x25')](_0x48e82d[_0x9f34('0x26')]);if(_0x48e82d[_0x9f34('0x27')]){delete _0x48e82d['name'];}_0x39a6ee['status'](_0x1a8cfc)[_0x9f34('0x28')](_0x48e82d);};}exports['index']=function(_0x114b19,_0x1b85df){var _0x24600b={},_0x1455e={},_0x27d3f0={'count':0x0,'rows':[]};var _0x165ef7=_[_0x9f34('0x29')](db[_0x9f34('0x2a')][_0x9f34('0x2b')],function(_0x3d650d){return{'name':_0x3d650d[_0x9f34('0x2c')],'type':_0x3d650d[_0x9f34('0x2d')][_0x9f34('0x2e')]};});_0x1455e['model']=_['map'](_0x165ef7,_0x9f34('0x27'));_0x1455e[_0x9f34('0x2f')]=_[_0x9f34('0x30')](_0x114b19[_0x9f34('0x2f')]);_0x1455e['filters']=_[_0x9f34('0x31')](_0x1455e[_0x9f34('0x32')],_0x1455e[_0x9f34('0x2f')]);_0x24600b[_0x9f34('0x33')]=_[_0x9f34('0x31')](_0x1455e['model'],qs[_0x9f34('0x34')](_0x114b19[_0x9f34('0x2f')][_0x9f34('0x34')]));_0x24600b[_0x9f34('0x33')]=_0x24600b[_0x9f34('0x33')]['length']?_0x24600b[_0x9f34('0x33')]:_0x1455e[_0x9f34('0x32')];if(!_0x114b19[_0x9f34('0x2f')][_0x9f34('0x35')](_0x9f34('0x36'))){_0x24600b['limit']=qs['limit'](_0x114b19[_0x9f34('0x2f')][_0x9f34('0x1b')]);_0x24600b[_0x9f34('0x1d')]=qs[_0x9f34('0x1d')](_0x114b19[_0x9f34('0x2f')][_0x9f34('0x1d')]);}_0x24600b[_0x9f34('0x37')]=qs['sort'](_0x114b19[_0x9f34('0x2f')]['sort']);_0x24600b[_0x9f34('0x38')]=qs[_0x9f34('0x39')](_[_0x9f34('0x3a')](_0x114b19[_0x9f34('0x2f')],_0x1455e[_0x9f34('0x39')]),_0x165ef7);if(_0x114b19[_0x9f34('0x2f')][_0x9f34('0x3b')]){_0x24600b['where']=_[_0x9f34('0x3c')](_0x24600b[_0x9f34('0x38')],{'$or':_[_0x9f34('0x29')](_0x165ef7,function(_0x597f90){if(_0x597f90['type']!==_0x9f34('0x3d')){var _0x3b149b={};_0x3b149b[_0x597f90[_0x9f34('0x27')]]={'$like':'%'+_0x114b19[_0x9f34('0x2f')][_0x9f34('0x3b')]+'%'};return _0x3b149b;}})});}_0x24600b=_[_0x9f34('0x3c')]({},_0x24600b,_0x114b19[_0x9f34('0x3e')]);var _0x548ae3={'where':_0x24600b[_0x9f34('0x38')]};return db[_0x9f34('0x2a')][_0x9f34('0x1c')](_0x548ae3)['then'](function(_0x4be7b4){_0x27d3f0[_0x9f34('0x1c')]=_0x4be7b4;if(_0x114b19[_0x9f34('0x2f')]['includeAll']){_0x24600b['include']=[{'all':!![]}];}return db[_0x9f34('0x2a')][_0x9f34('0x3f')](_0x24600b);})['then'](function(_0x139528){_0x27d3f0[_0x9f34('0x40')]=_0x139528;return _0x27d3f0;})[_0x9f34('0x23')](respondWithFilteredResult(_0x1b85df,_0x24600b))[_0x9f34('0x41')](handleError(_0x1b85df,null));};exports['show']=function(_0x36d661,_0xb1403c){var _0x317a38={'raw':!![],'where':{'id':_0x36d661[_0x9f34('0x42')]['id']}},_0x5d4632={};_0x5d4632[_0x9f34('0x32')]=_[_0x9f34('0x30')](db[_0x9f34('0x2a')][_0x9f34('0x2b')]);_0x5d4632['query']=_[_0x9f34('0x30')](_0x36d661['query']);_0x5d4632[_0x9f34('0x39')]=_['intersection'](_0x5d4632['model'],_0x5d4632[_0x9f34('0x2f')]);_0x317a38[_0x9f34('0x33')]=_[_0x9f34('0x31')](_0x5d4632[_0x9f34('0x32')],qs[_0x9f34('0x34')](_0x36d661[_0x9f34('0x2f')][_0x9f34('0x34')]));_0x317a38[_0x9f34('0x33')]=_0x317a38['attributes'][_0x9f34('0x43')]?_0x317a38[_0x9f34('0x33')]:_0x5d4632[_0x9f34('0x32')];if(_0x36d661[_0x9f34('0x2f')][_0x9f34('0x44')]){_0x317a38[_0x9f34('0x45')]=[{'all':!![]}];}_0x317a38=_[_0x9f34('0x3c')]({},_0x317a38,_0x36d661[_0x9f34('0x3e')]);return db[_0x9f34('0x2a')]['find'](_0x317a38)[_0x9f34('0x23')](handleEntityNotFound(_0xb1403c,null))[_0x9f34('0x23')](respondWithResult(_0xb1403c,null))[_0x9f34('0x41')](handleError(_0xb1403c,null));};exports['create']=function(_0x20977e,_0x333389){return db['ZohoField']['create'](_0x20977e['body'],{})['then'](respondWithResult(_0x333389,0xc9))['catch'](handleError(_0x333389,null));};exports[_0x9f34('0x22')]=function(_0x1c5a06,_0x300708){if(_0x1c5a06[_0x9f34('0x46')]['id']){delete _0x1c5a06['body']['id'];}return db[_0x9f34('0x2a')][_0x9f34('0x47')]({'where':{'id':_0x1c5a06[_0x9f34('0x42')]['id']}})[_0x9f34('0x23')](handleEntityNotFound(_0x300708,null))[_0x9f34('0x23')](saveUpdates(_0x1c5a06[_0x9f34('0x46')],null))[_0x9f34('0x23')](respondWithResult(_0x300708,null))[_0x9f34('0x41')](handleError(_0x300708,null));};exports[_0x9f34('0x24')]=function(_0x1ba303,_0x381005){return db[_0x9f34('0x2a')][_0x9f34('0x47')]({'where':{'id':_0x1ba303[_0x9f34('0x42')]['id']}})[_0x9f34('0x23')](handleEntityNotFound(_0x381005,null))[_0x9f34('0x23')](removeEntity(_0x381005,null))[_0x9f34('0x41')](handleError(_0x381005,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8cc6008..32d6122 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 _0x4137=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9c6e38,_0x1fc24e){var _0x148e08=function(_0x415b66){while(--_0x415b66){_0x9c6e38['push'](_0x9c6e38['shift']());}};_0x148e08(++_0x1fc24e);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));module[_0x7413('0xb')]=function(_0x4fbade,_0xc808cd){return _0x4fbade[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':_0x7413('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x7413('0xf'),_0x7413('0x10')],'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(_0x428af3,_0x6d102d){var _0x43c032=function(_0x5ab516){while(--_0x5ab516){_0x428af3['push'](_0x428af3['shift']());}};_0x43c032(++_0x6d102d);}(_0x1a85,0x178));var _0x51a8=function(_0x59df9c,_0x5668b9){_0x59df9c=_0x59df9c-0x0;var _0x248b8a=_0x1a85[_0x59df9c];return _0x248b8a;};'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 c36071f..44976ff 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 _0xe392=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug'];(function(_0xa704d,_0x1fc249){var _0x39d517=function(_0x3cbf8b){while(--_0x3cbf8b){_0xa704d['push'](_0xa704d['shift']());}};_0x39d517(++_0x1fc249);}(_0xe392,0x11c));var _0x2e39=function(_0x3fc170,_0x3045fc){_0x3fc170=_0x3fc170-0x0;var _0x404f7f=_0xe392[_0x3fc170];return _0x404f7f;};'use strict';var _=require(_0x2e39('0x0'));var util=require(_0x2e39('0x1'));var moment=require('moment');var BPromise=require(_0x2e39('0x2'));var rs=require(_0x2e39('0x3'));var fs=require('fs');var Redis=require(_0x2e39('0x4'));var db=require(_0x2e39('0x5'))['db'];var utils=require(_0x2e39('0x6'));var logger=require(_0x2e39('0x7'))(_0x2e39('0x8'));var config=require(_0x2e39('0x9'));var jayson=require(_0x2e39('0xa'));var client=jayson['client'][_0x2e39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x730c5b,_0x5477dc,_0x47e628){return new BPromise(function(_0x40b556,_0x175ea1){return client['request'](_0x730c5b,_0x47e628)['then'](function(_0x2c4d78){logger[_0x2e39('0xc')]('ZohoField,\x20%s,\x20%s',_0x5477dc,_0x2e39('0xd'));logger[_0x2e39('0xe')](_0x2e39('0xf'),_0x5477dc,_0x2e39('0xd'),JSON[_0x2e39('0x10')](_0x2c4d78));if(_0x2c4d78[_0x2e39('0x11')]){if(_0x2c4d78[_0x2e39('0x11')][_0x2e39('0x12')]===0x1f4){logger['error'](_0x2e39('0x13'),_0x5477dc,_0x2c4d78['error']['message']);return _0x175ea1(_0x2c4d78[_0x2e39('0x11')]['message']);}logger[_0x2e39('0x11')](_0x2e39('0x13'),_0x5477dc,_0x2c4d78[_0x2e39('0x11')][_0x2e39('0x14')]);return _0x40b556(_0x2c4d78[_0x2e39('0x11')]['message']);}else{logger[_0x2e39('0xc')](_0x2e39('0x13'),_0x5477dc,'request\x20sent');_0x40b556(_0x2c4d78[_0x2e39('0x15')][_0x2e39('0x14')]);}})[_0x2e39('0x16')](function(_0x258e50){logger[_0x2e39('0x11')](_0x2e39('0x13'),_0x5477dc,_0x258e50);_0x175ea1(_0x258e50);});});} \ No newline at end of file +var _0xaf66=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xaf66,0x10f));var _0x6af6=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0xaf66[_0x2605dc];return _0x4568c9;};'use strict';var _=require(_0x6af6('0x0'));var util=require(_0x6af6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6af6('0x2'));var fs=require('fs');var Redis=require(_0x6af6('0x3'));var db=require(_0x6af6('0x4'))['db'];var utils=require(_0x6af6('0x5'));var logger=require('../../config/logger')(_0x6af6('0x6'));var config=require(_0x6af6('0x7'));var jayson=require(_0x6af6('0x8'));var client=jayson[_0x6af6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18068f,_0x4fe15f,_0x1b9ba7){return new BPromise(function(_0x32e0ae,_0x1d83fc){return client['request'](_0x18068f,_0x1b9ba7)[_0x6af6('0xa')](function(_0x58b006){logger[_0x6af6('0xb')](_0x6af6('0xc'),_0x4fe15f,_0x6af6('0xd'));logger[_0x6af6('0xe')](_0x6af6('0xf'),_0x4fe15f,'request\x20sent',JSON[_0x6af6('0x10')](_0x58b006));if(_0x58b006[_0x6af6('0x11')]){if(_0x58b006['error'][_0x6af6('0x12')]===0x1f4){logger['error'](_0x6af6('0xc'),_0x4fe15f,_0x58b006[_0x6af6('0x11')][_0x6af6('0x13')]);return _0x1d83fc(_0x58b006[_0x6af6('0x11')]['message']);}logger[_0x6af6('0x11')]('ZohoField,\x20%s,\x20%s',_0x4fe15f,_0x58b006[_0x6af6('0x11')]['message']);return _0x32e0ae(_0x58b006['error'][_0x6af6('0x13')]);}else{logger[_0x6af6('0xb')](_0x6af6('0xc'),_0x4fe15f,'request\x20sent');_0x32e0ae(_0x58b006['result'][_0x6af6('0x13')]);}})[_0x6af6('0x14')](function(_0x504e55){logger[_0x6af6('0x11')](_0x6af6('0xc'),_0x4fe15f,_0x504e55);_0x1d83fc(_0x504e55);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 632d400..036bf32 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xd4d369,_0x4f6ad2){var _0x293e5d=function(_0xb0e6a4){while(--_0xb0e6a4){_0xd4d369['push'](_0xd4d369['shift']());}};_0x293e5d(++_0x4f6ad2);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x553c98,_0x5efa64){var _0x308095=function(_0x584796){while(--_0x584796){_0x553c98['push'](_0x553c98['shift']());}};_0x308095(++_0x5efa64);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xcb91[_0x3438cf];return _0x278698;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index c7bb4ab..d9b7166 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 _0xbe06=['STRING','unique_name_and_version','app.js','INTEGER','sequelize'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xbe06,0x144));var _0x6be0=function(_0x4c1f32,_0x124738){_0x4c1f32=_0x4c1f32-0x0;var _0x5b0e7f=_0xbe06[_0x4c1f32];return _0x5b0e7f;};'use strict';var Sequelize=require(_0x6be0('0x0'));module['exports']={'name':{'type':Sequelize[_0x6be0('0x1')],'allowNull':![],'unique':_0x6be0('0x2')},'version':{'type':Sequelize[_0x6be0('0x1')],'allowNull':![],'unique':_0x6be0('0x2')},'main':{'type':Sequelize[_0x6be0('0x1')],'defaultValue':_0x6be0('0x3')},'filename':{'type':Sequelize[_0x6be0('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6be0('0x1')]},'size':{'type':Sequelize[_0x6be0('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x6be0('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x6be0('0x1')]},'title':{'type':Sequelize[_0x6be0('0x1')]},'remoteUri':{'type':Sequelize[_0x6be0('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x94b0=['app.js','INTEGER','BOOLEAN','sequelize','exports','STRING','unique_name_and_version'];(function(_0x250b88,_0x1240c3){var _0x2498e0=function(_0x59cd6f){while(--_0x59cd6f){_0x250b88['push'](_0x250b88['shift']());}};_0x2498e0(++_0x1240c3);}(_0x94b0,0x168));var _0x094b=function(_0x2d0071,_0x430471){_0x2d0071=_0x2d0071-0x0;var _0x12e5c0=_0x94b0[_0x2d0071];return _0x12e5c0;};'use strict';var Sequelize=require(_0x094b('0x0'));module[_0x094b('0x1')]={'name':{'type':Sequelize[_0x094b('0x2')],'allowNull':![],'unique':_0x094b('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x094b('0x3')},'main':{'type':Sequelize[_0x094b('0x2')],'defaultValue':_0x094b('0x4')},'filename':{'type':Sequelize[_0x094b('0x2')]},'path':{'type':Sequelize[_0x094b('0x2')]},'type':{'type':Sequelize[_0x094b('0x2')]},'size':{'type':Sequelize[_0x094b('0x5')]},'active':{'type':Sequelize[_0x094b('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x094b('0x2')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x094b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x094b('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 66909fa..301a6e0 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 _0x9f0e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x4eacbe,_0x2a0b4f){var _0x33e818=function(_0x2bf3a4){while(--_0x2bf3a4){_0x4eacbe['push'](_0x4eacbe['shift']());}};_0x33e818(++_0x2a0b4f);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4e6c76,_0x30a298){_0x4e6c76=_0x4e6c76-0x0;var _0x141ffa=_0x9f0e[_0x4e6c76];return _0x141ffa;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['Integration'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['Integration'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['Integration'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));}; \ No newline at end of file +var _0x4137=['map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index'];(function(_0x566df9,_0x37db95){var _0x4cc950=function(_0x144088){while(--_0x144088){_0x566df9['push'](_0x566df9['shift']());}};_0x4cc950(++_0x37db95);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['Integration'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['Integration']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 15254fe..48f2f5e 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 _0x1363=['moment','bluebird','request-promise','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util'];(function(_0x1bb030,_0x27d05f){var _0x28ef4f=function(_0xb1150e){while(--_0xb1150e){_0x1bb030['push'](_0x1bb030['shift']());}};_0x28ef4f(++_0x27d05f);}(_0x1363,0x1d7));var _0x3136=function(_0x54b19a,_0x123ecc){_0x54b19a=_0x54b19a-0x0;var _0x5cff5b=_0x1363[_0x54b19a];return _0x5cff5b;};'use strict';var _=require(_0x3136('0x0'));var util=require(_0x3136('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3136('0x2'));var BPromise=require(_0x3136('0x3'));var rp=require(_0x3136('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3136('0x5'));var attributes=require(_0x3136('0x6'));module[_0x3136('0x7')]=function(_0x4f20b8,_0x59602b){return _0x4f20b8[_0x3136('0x8')](_0x3136('0x9'),attributes,{'tableName':_0x3136('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x298a=['util','../../config/logger','api','moment','path','rimraf','exports','define','Integration','integrations','lodash'];(function(_0x215cd8,_0x186835){var _0x52685b=function(_0x3c3117){while(--_0x3c3117){_0x215cd8['push'](_0x215cd8['shift']());}};_0x52685b(++_0x186835);}(_0x298a,0x180));var _0xa298=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x298a[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xa298('0x0'));var util=require(_0xa298('0x1'));var logger=require(_0xa298('0x2'))(_0xa298('0x3'));var moment=require(_0xa298('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa298('0x5'));var rimraf=require(_0xa298('0x6'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xa298('0x7')]=function(_0x5dcd1c,_0x12a255){return _0x5dcd1c[_0xa298('0x8')](_0xa298('0x9'),attributes,{'tableName':_0xa298('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 0da794f..c44603f 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x4975,0x86));var _0x5497=function(_0x301e17,_0x58a7b3){_0x301e17=_0x301e17-0x0;var _0x5eaaf6=_0x4975[_0x301e17];return _0x5eaaf6;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x1967=['then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x1967,0x173));var _0x7196=function(_0x27badc,_0x111821){_0x27badc=_0x27badc-0x0;var _0x1fae9a=_0x1967[_0x27badc];return _0x1fae9a;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 47a6a52..23f5932 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 _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x2e2a52,_0x23c72e){var _0x22da43=function(_0x35c486){while(--_0x35c486){_0x2e2a52['push'](_0x2e2a52['shift']());}};_0x22da43(++_0x23c72e);}(_0x7880,0x1f4));var _0x0788=function(_0x27a0bd,_0x41e831){_0x27a0bd=_0x27a0bd-0x0;var _0xa68da6=_0x7880[_0x27a0bd];return _0xa68da6;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a344573..136aea3 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 _0x9eca=['exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENDING','FAILED','sequelize'];(function(_0xa6a3e4,_0x2254e5){var _0x5cb899=function(_0x9b5728){while(--_0x9b5728){_0xa6a3e4['push'](_0xa6a3e4['shift']());}};_0x5cb899(++_0x2254e5);}(_0x9eca,0x1e9));var _0xa9ec=function(_0x497a8b,_0x1df4ea){_0x497a8b=_0x497a8b-0x0;var _0x142cc3=_0x9eca[_0x497a8b];return _0x142cc3;};'use strict';var Sequelize=require(_0xa9ec('0x0'));module[_0xa9ec('0x1')]={'integration':{'type':Sequelize[_0xa9ec('0x2')]},'eventChannel':{'type':Sequelize[_0xa9ec('0x2')]},'exitStatus':{'type':Sequelize[_0xa9ec('0x2')]},'ticketId':{'type':Sequelize[_0xa9ec('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xa9ec('0x2')]},'uniqueid':{'type':Sequelize[_0xa9ec('0x2')]},'calleridnum':{'type':Sequelize[_0xa9ec('0x2')]},'calleridname':{'type':Sequelize[_0xa9ec('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xa9ec('0x2')]},'membername':{'type':Sequelize[_0xa9ec('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa9ec('0x3')]},'agentconnectAt':{'type':Sequelize[_0xa9ec('0x3')]},'holdtime':{'type':Sequelize[_0xa9ec('0x4')]},'agentcomplete':{'type':Sequelize[_0xa9ec('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa9ec('0x3')]},'talktime':{'type':Sequelize[_0xa9ec('0x4')]},'agentacw':{'type':Sequelize[_0xa9ec('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa9ec('0x4')]},'reason':{'type':Sequelize[_0xa9ec('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xa9ec('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa9ec('0x3')]},'lastevent':{'type':Sequelize[_0xa9ec('0x2')]},'channel':{'type':Sequelize[_0xa9ec('0x2')]},'channelstate':{'type':Sequelize[_0xa9ec('0x4')]},'channelstatedesc':{'type':Sequelize[_0xa9ec('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa9ec('0x2')]},'connectedlinename':{'type':Sequelize[_0xa9ec('0x2')]},'language':{'type':Sequelize[_0xa9ec('0x2')]},'accountcode':{'type':Sequelize[_0xa9ec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa9ec('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xa9ec('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa9ec('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xa9ec('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa9ec('0x2')]},'destlanguage':{'type':Sequelize[_0xa9ec('0x2')]},'destaccountcode':{'type':Sequelize[_0xa9ec('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xa9ec('0x2')]},'messageId':{'type':Sequelize[_0xa9ec('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa9ec('0x2')]},'to':{'type':Sequelize[_0xa9ec('0x2')]},'cc':{'type':Sequelize[_0xa9ec('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xa9ec('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xa9ec('0x7')]('SENT',_0xa9ec('0x8'),'RECEIVED',_0xa9ec('0x9'))},'url':{'type':Sequelize[_0xa9ec('0x2')]},'app':{'type':Sequelize[_0xa9ec('0x2')]},'appdata':{'type':Sequelize[_0xa9ec('0x2')]},'projectId':{'type':Sequelize[_0xa9ec('0x4')]}}; \ No newline at end of file +var _0x02f9=['RECEIVED','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x236e4b,_0x136c92){var _0x5cce4e=function(_0x4c29eb){while(--_0x4c29eb){_0x236e4b['push'](_0x236e4b['shift']());}};_0x5cce4e(++_0x136c92);}(_0x02f9,0x6d));var _0x902f=function(_0x4dd11a,_0x5517d7){_0x4dd11a=_0x4dd11a-0x0;var _0x366497=_0x02f9[_0x4dd11a];return _0x366497;};'use strict';var Sequelize=require('sequelize');module[_0x902f('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x902f('0x1')]},'exitStatus':{'type':Sequelize[_0x902f('0x1')]},'ticketId':{'type':Sequelize[_0x902f('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x902f('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x902f('0x1')]},'calleridname':{'type':Sequelize[_0x902f('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x902f('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x902f('0x2')]},'agentconnectAt':{'type':Sequelize[_0x902f('0x2')]},'holdtime':{'type':Sequelize[_0x902f('0x3')]},'agentcomplete':{'type':Sequelize[_0x902f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x902f('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x902f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x902f('0x3')]},'reason':{'type':Sequelize[_0x902f('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x902f('0x2')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x902f('0x1')]},'channel':{'type':Sequelize[_0x902f('0x1')]},'channelstate':{'type':Sequelize[_0x902f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x902f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x902f('0x1')]},'connectedlinename':{'type':Sequelize[_0x902f('0x1')]},'language':{'type':Sequelize[_0x902f('0x1')]},'accountcode':{'type':Sequelize[_0x902f('0x1')]},'context':{'type':Sequelize[_0x902f('0x1')]},'exten':{'type':Sequelize[_0x902f('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x902f('0x1')]},'destchannelstate':{'type':Sequelize[_0x902f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x902f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x902f('0x1')]},'destcalleridname':{'type':Sequelize[_0x902f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x902f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x902f('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x902f('0x1')]},'destcontext':{'type':Sequelize[_0x902f('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x902f('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x902f('0x1')]},'subject':{'type':Sequelize[_0x902f('0x1')]},'from':{'type':Sequelize[_0x902f('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x902f('0x1')]},'attachment':{'type':Sequelize[_0x902f('0x5')]},'html':{'type':Sequelize[_0x902f('0x5')]},'text':{'type':Sequelize[_0x902f('0x5')]},'status':{'type':Sequelize['ENUM'](_0x902f('0x6'),_0x902f('0x7'),_0x902f('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x902f('0x1')]},'appdata':{'type':Sequelize[_0x902f('0x1')]},'projectId':{'type':Sequelize[_0x902f('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 8748e5d..c53ca9d 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 _0x979c=['save','update','destroy','error','stack','name','map','IntegrationReport','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','then','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x18e4ef,_0x5bf4ae){var _0xbab6ac=function(_0x43b12f){while(--_0x43b12f){_0x18e4ef['push'](_0x18e4ef['shift']());}};_0xbab6ac(++_0x5bf4ae);}(_0x979c,0xc1));var _0xc979=function(_0x56c358,_0x9a557f){_0x56c358=_0x56c358-0x0;var _0x5d138b=_0x979c[_0x56c358];return _0x5d138b;};'use strict';var emlformat=require(_0xc979('0x0'));var rimraf=require(_0xc979('0x1'));var zipdir=require(_0xc979('0x2'));var jsonpatch=require(_0xc979('0x3'));var rp=require('request-promise');var moment=require(_0xc979('0x4'));var BPromise=require(_0xc979('0x5'));var Mustache=require(_0xc979('0x6'));var util=require(_0xc979('0x7'));var path=require(_0xc979('0x8'));var sox=require(_0xc979('0x9'));var csv=require('to-csv');var ejs=require(_0xc979('0xa'));var fs=require('fs');var fs_extra=require(_0xc979('0xb'));var _=require(_0xc979('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc979('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc979('0xe'));var querystring=require(_0xc979('0xf'));var Papa=require(_0xc979('0x10'));var Redis=require(_0xc979('0x11'));var authService=require(_0xc979('0x12'));var qs=require(_0xc979('0x13'));var as=require(_0xc979('0x14'));var hardwareService=require(_0xc979('0x15'));var logger=require(_0xc979('0x16'))(_0xc979('0x17'));var utils=require('../../config/utils');var config=require(_0xc979('0x18'));var licenseUtil=require(_0xc979('0x19'));var db=require(_0xc979('0x1a'))['db'];function respondWithStatusCode(_0x1819f9,_0x1a9e0b){_0x1a9e0b=_0x1a9e0b||0xcc;return function(_0x4be947){if(_0x4be947){return _0x1819f9[_0xc979('0x1b')](_0x1a9e0b);}return _0x1819f9[_0xc979('0x1c')](_0x1a9e0b)[_0xc979('0x1d')]();};}function respondWithResult(_0x2a1ab9,_0x24c5aa){_0x24c5aa=_0x24c5aa||0xc8;return function(_0x51b002){if(_0x51b002){return _0x2a1ab9[_0xc979('0x1c')](_0x24c5aa)[_0xc979('0x1e')](_0x51b002);}};}function respondWithFilteredResult(_0x4546f6,_0xeebeb2){return function(_0x13bdc0){if(_0x13bdc0){var _0x3d458e=typeof _0xeebeb2['offset']===_0xc979('0x1f')&&typeof _0xeebeb2[_0xc979('0x20')]==='undefined';var _0x251f3c=_0x13bdc0[_0xc979('0x21')];var _0x3cd931=_0x3d458e?0x0:_0xeebeb2[_0xc979('0x22')];var _0x4eab6f=_0x3d458e?_0x13bdc0[_0xc979('0x21')]:_0xeebeb2[_0xc979('0x22')]+_0xeebeb2['limit'];var _0x2a832e;if(_0x4eab6f>=_0x251f3c){_0x4eab6f=_0x251f3c;_0x2a832e=0xc8;}else{_0x2a832e=0xce;}_0x4546f6[_0xc979('0x1c')](_0x2a832e);return _0x4546f6['set'](_0xc979('0x23'),_0x3cd931+'-'+_0x4eab6f+'/'+_0x251f3c)[_0xc979('0x1e')](_0x13bdc0);}return null;};}function patchUpdates(_0x49f6fe){return function(_0x61bdfb){try{jsonpatch[_0xc979('0x24')](_0x61bdfb,_0x49f6fe,!![]);}catch(_0x37660a){return BPromise[_0xc979('0x25')](_0x37660a);}return _0x61bdfb[_0xc979('0x26')]();};}function saveUpdates(_0xa4e8a9,_0x4465ed){return function(_0x3a29b8){if(_0x3a29b8){return _0x3a29b8[_0xc979('0x27')](_0xa4e8a9)['then'](function(_0x3336b8){return _0x3336b8;});}return null;};}function removeEntity(_0xf130f7,_0x24abb0){return function(_0x3fc4df){if(_0x3fc4df){return _0x3fc4df[_0xc979('0x28')]()['then'](function(){_0xf130f7[_0xc979('0x1c')](0xcc)[_0xc979('0x1d')]();});}};}function handleEntityNotFound(_0xbc3077,_0x10abb2){return function(_0x52f84f){if(!_0x52f84f){_0xbc3077['sendStatus'](0x194);}return _0x52f84f;};}function handleError(_0x5a3ee9,_0x5a9bfc){_0x5a9bfc=_0x5a9bfc||0x1f4;return function(_0x15e1dd){logger[_0xc979('0x29')](_0x15e1dd[_0xc979('0x2a')]);if(_0x15e1dd[_0xc979('0x2b')]){delete _0x15e1dd[_0xc979('0x2b')];}_0x5a3ee9['status'](_0x5a9bfc)['send'](_0x15e1dd);};}exports['index']=function(_0x45eaf5,_0x379c25){var _0x4aaba6={},_0x109142={},_0x313833={'count':0x0,'rows':[]};var _0x25f3fc=_[_0xc979('0x2c')](db[_0xc979('0x2d')][_0xc979('0x2e')],function(_0x559080){return{'name':_0x559080[_0xc979('0x2f')],'type':_0x559080['type'][_0xc979('0x30')]};});_0x109142[_0xc979('0x31')]=_[_0xc979('0x2c')](_0x25f3fc,'name');_0x109142['query']=_[_0xc979('0x32')](_0x45eaf5[_0xc979('0x33')]);_0x109142['filters']=_[_0xc979('0x34')](_0x109142[_0xc979('0x31')],_0x109142['query']);_0x4aaba6[_0xc979('0x35')]=_['intersection'](_0x109142[_0xc979('0x31')],qs['fields'](_0x45eaf5[_0xc979('0x33')][_0xc979('0x36')]));_0x4aaba6['attributes']=_0x4aaba6[_0xc979('0x35')][_0xc979('0x37')]?_0x4aaba6[_0xc979('0x35')]:_0x109142['model'];if(!_0x45eaf5[_0xc979('0x33')]['hasOwnProperty']('nolimit')){_0x4aaba6['limit']=qs[_0xc979('0x20')](_0x45eaf5['query'][_0xc979('0x20')]);_0x4aaba6['offset']=qs['offset'](_0x45eaf5['query']['offset']);}_0x4aaba6[_0xc979('0x38')]=qs[_0xc979('0x39')](_0x45eaf5[_0xc979('0x33')][_0xc979('0x39')]);_0x4aaba6['where']=qs[_0xc979('0x3a')](_[_0xc979('0x3b')](_0x45eaf5[_0xc979('0x33')],_0x109142[_0xc979('0x3a')]),_0x25f3fc);if(_0x45eaf5[_0xc979('0x33')][_0xc979('0x3c')]){_0x4aaba6[_0xc979('0x3d')]=_['merge'](_0x4aaba6[_0xc979('0x3d')],{'$or':_['map'](_0x25f3fc,function(_0x69e954){if(_0x69e954[_0xc979('0x3e')]!==_0xc979('0x3f')){var _0x17cc62={};_0x17cc62[_0x69e954['name']]={'$like':'%'+_0x45eaf5[_0xc979('0x33')][_0xc979('0x3c')]+'%'};return _0x17cc62;}})});}_0x4aaba6=_[_0xc979('0x40')]({},_0x4aaba6,_0x45eaf5[_0xc979('0x41')]);var _0x44382b={'where':_0x4aaba6[_0xc979('0x3d')]};return db[_0xc979('0x2d')][_0xc979('0x21')](_0x44382b)[_0xc979('0x42')](function(_0x5a172e){_0x313833[_0xc979('0x21')]=_0x5a172e;if(_0x45eaf5['query']['includeAll']){_0x4aaba6[_0xc979('0x43')]=[{'all':!![]}];}return db[_0xc979('0x2d')][_0xc979('0x44')](_0x4aaba6);})[_0xc979('0x42')](function(_0x45e2a9){_0x313833[_0xc979('0x45')]=_0x45e2a9;return _0x313833;})[_0xc979('0x42')](respondWithFilteredResult(_0x379c25,_0x4aaba6))[_0xc979('0x46')](handleError(_0x379c25,null));};exports[_0xc979('0x47')]=function(_0x1f7046,_0x249015){var _0x5cc062={'raw':![],'where':{'id':_0x1f7046[_0xc979('0x48')]['id']}},_0x2f2e8e={};_0x2f2e8e[_0xc979('0x31')]=_[_0xc979('0x32')](db[_0xc979('0x2d')][_0xc979('0x2e')]);_0x2f2e8e[_0xc979('0x33')]=_[_0xc979('0x32')](_0x1f7046['query']);_0x2f2e8e['filters']=_[_0xc979('0x34')](_0x2f2e8e[_0xc979('0x31')],_0x2f2e8e[_0xc979('0x33')]);_0x5cc062[_0xc979('0x35')]=_['intersection'](_0x2f2e8e['model'],qs[_0xc979('0x36')](_0x1f7046[_0xc979('0x33')]['fields']));_0x5cc062[_0xc979('0x35')]=_0x5cc062[_0xc979('0x35')][_0xc979('0x37')]?_0x5cc062['attributes']:_0x2f2e8e[_0xc979('0x31')];if(_0x1f7046[_0xc979('0x33')]['includeAll']){_0x5cc062[_0xc979('0x43')]=[{'all':!![]}];}_0x5cc062=_[_0xc979('0x40')]({},_0x5cc062,_0x1f7046[_0xc979('0x41')]);return db[_0xc979('0x2d')][_0xc979('0x49')](_0x5cc062)[_0xc979('0x42')](handleEntityNotFound(_0x249015,null))[_0xc979('0x42')](respondWithResult(_0x249015,null))['catch'](handleError(_0x249015,null));};exports[_0xc979('0x4a')]=function(_0x3ac315,_0x10498b){return db[_0xc979('0x2d')][_0xc979('0x4a')](_0x3ac315['body'],{})[_0xc979('0x42')](respondWithResult(_0x10498b,0xc9))['catch'](handleError(_0x10498b,null));};exports[_0xc979('0x27')]=function(_0x10e08a,_0x255925){if(_0x10e08a[_0xc979('0x4b')]['id']){delete _0x10e08a[_0xc979('0x4b')]['id'];}return db[_0xc979('0x2d')][_0xc979('0x49')]({'where':{'id':_0x10e08a[_0xc979('0x48')]['id']}})[_0xc979('0x42')](handleEntityNotFound(_0x255925,null))[_0xc979('0x42')](saveUpdates(_0x10e08a[_0xc979('0x4b')],null))[_0xc979('0x42')](respondWithResult(_0x255925,null))[_0xc979('0x46')](handleError(_0x255925,null));};exports[_0xc979('0x28')]=function(_0xe3c078,_0x45897d){return db[_0xc979('0x2d')]['find']({'where':{'id':_0xe3c078[_0xc979('0x48')]['id']}})[_0xc979('0x42')](handleEntityNotFound(_0x45897d,null))[_0xc979('0x42')](removeEntity(_0x45897d,null))['catch'](handleError(_0x45897d,null));};exports[_0xc979('0x4c')]=function(_0xb2ba72,_0x38387f){return db[_0xc979('0x2d')][_0xc979('0x4c')]()[_0xc979('0x42')](respondWithResult(_0x38387f,null))['catch'](handleError(_0x38387f,null));}; \ No newline at end of file +var _0xfaaf=['pick','merge','VIRTUAL','filter','IntegrationReport','includeAll','include','rows','catch','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xda21e8,_0x19d184){var _0x28904b=function(_0x10c833){while(--_0x10c833){_0xda21e8['push'](_0xda21e8['shift']());}};_0x28904b(++_0x19d184);}(_0xfaaf,0xfd));var _0xffaa=function(_0x13188a,_0x2f635f){_0x13188a=_0x13188a-0x0;var _0x2f5716=_0xfaaf[_0x13188a];return _0x2f5716;};'use strict';var emlformat=require(_0xffaa('0x0'));var rimraf=require(_0xffaa('0x1'));var zipdir=require(_0xffaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffaa('0x3'));var moment=require(_0xffaa('0x4'));var BPromise=require(_0xffaa('0x5'));var Mustache=require(_0xffaa('0x6'));var util=require(_0xffaa('0x7'));var path=require(_0xffaa('0x8'));var sox=require(_0xffaa('0x9'));var csv=require(_0xffaa('0xa'));var ejs=require(_0xffaa('0xb'));var fs=require('fs');var fs_extra=require(_0xffaa('0xc'));var _=require(_0xffaa('0xd'));var squel=require(_0xffaa('0xe'));var crypto=require('crypto');var jsforce=require(_0xffaa('0xf'));var deskjs=require(_0xffaa('0x10'));var toCsv=require(_0xffaa('0xa'));var querystring=require(_0xffaa('0x11'));var Papa=require(_0xffaa('0x12'));var Redis=require(_0xffaa('0x13'));var authService=require(_0xffaa('0x14'));var qs=require(_0xffaa('0x15'));var as=require(_0xffaa('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffaa('0x17'))('api');var utils=require(_0xffaa('0x18'));var config=require(_0xffaa('0x19'));var licenseUtil=require(_0xffaa('0x1a'));var db=require(_0xffaa('0x1b'))['db'];function respondWithStatusCode(_0x2d8248,_0x28aaff){_0x28aaff=_0x28aaff||0xcc;return function(_0x1409bf){if(_0x1409bf){return _0x2d8248['sendStatus'](_0x28aaff);}return _0x2d8248[_0xffaa('0x1c')](_0x28aaff)[_0xffaa('0x1d')]();};}function respondWithResult(_0x323fad,_0x741a9){_0x741a9=_0x741a9||0xc8;return function(_0x238cff){if(_0x238cff){return _0x323fad[_0xffaa('0x1c')](_0x741a9)['json'](_0x238cff);}};}function respondWithFilteredResult(_0x13d882,_0x59e07e){return function(_0x48ab7c){if(_0x48ab7c){var _0x15aa71=typeof _0x59e07e['offset']===_0xffaa('0x1e')&&typeof _0x59e07e[_0xffaa('0x1f')]===_0xffaa('0x1e');var _0x19418a=_0x48ab7c['count'];var _0x4f8c06=_0x15aa71?0x0:_0x59e07e['offset'];var _0x4c82bb=_0x15aa71?_0x48ab7c[_0xffaa('0x20')]:_0x59e07e[_0xffaa('0x21')]+_0x59e07e[_0xffaa('0x1f')];var _0x402002;if(_0x4c82bb>=_0x19418a){_0x4c82bb=_0x19418a;_0x402002=0xc8;}else{_0x402002=0xce;}_0x13d882[_0xffaa('0x1c')](_0x402002);return _0x13d882[_0xffaa('0x22')](_0xffaa('0x23'),_0x4f8c06+'-'+_0x4c82bb+'/'+_0x19418a)[_0xffaa('0x24')](_0x48ab7c);}return null;};}function patchUpdates(_0x5896b6){return function(_0x3d3bb2){try{jsonpatch[_0xffaa('0x25')](_0x3d3bb2,_0x5896b6,!![]);}catch(_0x59d306){return BPromise[_0xffaa('0x26')](_0x59d306);}return _0x3d3bb2[_0xffaa('0x27')]();};}function saveUpdates(_0xccb43a,_0x408849){return function(_0x44bfbf){if(_0x44bfbf){return _0x44bfbf['update'](_0xccb43a)[_0xffaa('0x28')](function(_0x45b919){return _0x45b919;});}return null;};}function removeEntity(_0x941229,_0xde13c2){return function(_0x44ee57){if(_0x44ee57){return _0x44ee57['destroy']()[_0xffaa('0x28')](function(){_0x941229['status'](0xcc)[_0xffaa('0x1d')]();});}};}function handleEntityNotFound(_0x256a3a,_0x3fcbd6){return function(_0x2f89be){if(!_0x2f89be){_0x256a3a['sendStatus'](0x194);}return _0x2f89be;};}function handleError(_0x22d798,_0x211692){_0x211692=_0x211692||0x1f4;return function(_0x11af5e){logger['error'](_0x11af5e[_0xffaa('0x29')]);if(_0x11af5e[_0xffaa('0x2a')]){delete _0x11af5e[_0xffaa('0x2a')];}_0x22d798[_0xffaa('0x1c')](_0x211692)[_0xffaa('0x2b')](_0x11af5e);};}exports[_0xffaa('0x2c')]=function(_0x5c5ab1,_0x34813c){var _0xc32f7b={},_0x2a910b={},_0x6c5437={'count':0x0,'rows':[]};var _0x1141a0=_[_0xffaa('0x2d')](db['IntegrationReport'][_0xffaa('0x2e')],function(_0xdfc57){return{'name':_0xdfc57[_0xffaa('0x2f')],'type':_0xdfc57[_0xffaa('0x30')][_0xffaa('0x31')]};});_0x2a910b[_0xffaa('0x32')]=_[_0xffaa('0x2d')](_0x1141a0,_0xffaa('0x2a'));_0x2a910b[_0xffaa('0x33')]=_[_0xffaa('0x34')](_0x5c5ab1[_0xffaa('0x33')]);_0x2a910b[_0xffaa('0x35')]=_[_0xffaa('0x36')](_0x2a910b['model'],_0x2a910b[_0xffaa('0x33')]);_0xc32f7b[_0xffaa('0x37')]=_[_0xffaa('0x36')](_0x2a910b['model'],qs[_0xffaa('0x38')](_0x5c5ab1[_0xffaa('0x33')][_0xffaa('0x38')]));_0xc32f7b[_0xffaa('0x37')]=_0xc32f7b['attributes'][_0xffaa('0x39')]?_0xc32f7b[_0xffaa('0x37')]:_0x2a910b[_0xffaa('0x32')];if(!_0x5c5ab1['query'][_0xffaa('0x3a')](_0xffaa('0x3b'))){_0xc32f7b['limit']=qs[_0xffaa('0x1f')](_0x5c5ab1[_0xffaa('0x33')][_0xffaa('0x1f')]);_0xc32f7b[_0xffaa('0x21')]=qs['offset'](_0x5c5ab1[_0xffaa('0x33')][_0xffaa('0x21')]);}_0xc32f7b[_0xffaa('0x3c')]=qs[_0xffaa('0x3d')](_0x5c5ab1['query']['sort']);_0xc32f7b[_0xffaa('0x3e')]=qs['filters'](_[_0xffaa('0x3f')](_0x5c5ab1[_0xffaa('0x33')],_0x2a910b['filters']),_0x1141a0);if(_0x5c5ab1[_0xffaa('0x33')]['filter']){_0xc32f7b['where']=_[_0xffaa('0x40')](_0xc32f7b[_0xffaa('0x3e')],{'$or':_['map'](_0x1141a0,function(_0x7f23e2){if(_0x7f23e2[_0xffaa('0x30')]!==_0xffaa('0x41')){var _0x13f019={};_0x13f019[_0x7f23e2['name']]={'$like':'%'+_0x5c5ab1[_0xffaa('0x33')][_0xffaa('0x42')]+'%'};return _0x13f019;}})});}_0xc32f7b=_[_0xffaa('0x40')]({},_0xc32f7b,_0x5c5ab1['options']);var _0x5993df={'where':_0xc32f7b['where']};return db[_0xffaa('0x43')][_0xffaa('0x20')](_0x5993df)['then'](function(_0x495f96){_0x6c5437[_0xffaa('0x20')]=_0x495f96;if(_0x5c5ab1[_0xffaa('0x33')][_0xffaa('0x44')]){_0xc32f7b[_0xffaa('0x45')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0xc32f7b);})['then'](function(_0x223a4c){_0x6c5437[_0xffaa('0x46')]=_0x223a4c;return _0x6c5437;})['then'](respondWithFilteredResult(_0x34813c,_0xc32f7b))[_0xffaa('0x47')](handleError(_0x34813c,null));};exports['show']=function(_0x10277f,_0x592630){var _0x1963fb={'raw':![],'where':{'id':_0x10277f[_0xffaa('0x48')]['id']}},_0x52f6c0={};_0x52f6c0[_0xffaa('0x32')]=_['keys'](db[_0xffaa('0x43')][_0xffaa('0x2e')]);_0x52f6c0[_0xffaa('0x33')]=_[_0xffaa('0x34')](_0x10277f[_0xffaa('0x33')]);_0x52f6c0['filters']=_[_0xffaa('0x36')](_0x52f6c0[_0xffaa('0x32')],_0x52f6c0[_0xffaa('0x33')]);_0x1963fb['attributes']=_[_0xffaa('0x36')](_0x52f6c0[_0xffaa('0x32')],qs[_0xffaa('0x38')](_0x10277f[_0xffaa('0x33')][_0xffaa('0x38')]));_0x1963fb[_0xffaa('0x37')]=_0x1963fb['attributes'][_0xffaa('0x39')]?_0x1963fb[_0xffaa('0x37')]:_0x52f6c0[_0xffaa('0x32')];if(_0x10277f[_0xffaa('0x33')][_0xffaa('0x44')]){_0x1963fb[_0xffaa('0x45')]=[{'all':!![]}];}_0x1963fb=_['merge']({},_0x1963fb,_0x10277f[_0xffaa('0x49')]);return db[_0xffaa('0x43')][_0xffaa('0x4a')](_0x1963fb)[_0xffaa('0x28')](handleEntityNotFound(_0x592630,null))[_0xffaa('0x28')](respondWithResult(_0x592630,null))[_0xffaa('0x47')](handleError(_0x592630,null));};exports[_0xffaa('0x4b')]=function(_0x1c87df,_0x465fea){return db[_0xffaa('0x43')]['create'](_0x1c87df['body'],{})[_0xffaa('0x28')](respondWithResult(_0x465fea,0xc9))['catch'](handleError(_0x465fea,null));};exports['update']=function(_0x3a2073,_0x33dc02){if(_0x3a2073[_0xffaa('0x4c')]['id']){delete _0x3a2073[_0xffaa('0x4c')]['id'];}return db[_0xffaa('0x43')][_0xffaa('0x4a')]({'where':{'id':_0x3a2073[_0xffaa('0x48')]['id']}})[_0xffaa('0x28')](handleEntityNotFound(_0x33dc02,null))[_0xffaa('0x28')](saveUpdates(_0x3a2073[_0xffaa('0x4c')],null))[_0xffaa('0x28')](respondWithResult(_0x33dc02,null))[_0xffaa('0x47')](handleError(_0x33dc02,null));};exports[_0xffaa('0x4d')]=function(_0x2511f1,_0xf022ad){return db[_0xffaa('0x43')][_0xffaa('0x4a')]({'where':{'id':_0x2511f1[_0xffaa('0x48')]['id']}})[_0xffaa('0x28')](handleEntityNotFound(_0xf022ad,null))[_0xffaa('0x28')](removeEntity(_0xf022ad,null))[_0xffaa('0x47')](handleError(_0xf022ad,null));};exports[_0xffaa('0x4e')]=function(_0x1c602c,_0x34aef7){return db[_0xffaa('0x43')][_0xffaa('0x4e')]()[_0xffaa('0x28')](respondWithResult(_0x34aef7,null))['catch'](handleError(_0x34aef7,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 278ad9b..b244728 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 _0xbfd0=['moment','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','../../config/logger','api'];(function(_0x336d54,_0x4cb876){var _0x571a8d=function(_0x3746f6){while(--_0x3746f6){_0x336d54['push'](_0x336d54['shift']());}};_0x571a8d(++_0x4cb876);}(_0xbfd0,0x194));var _0x0bfd=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xbfd0[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x0bfd('0x0'));var util=require(_0x0bfd('0x1'));var logger=require(_0x0bfd('0x2'))(_0x0bfd('0x3'));var moment=require(_0x0bfd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bfd('0x5'));var rimraf=require(_0x0bfd('0x6'));var config=require(_0x0bfd('0x7'));var attributes=require(_0x0bfd('0x8'));module[_0x0bfd('0x9')]=function(_0x5c989e,_0x1a5570){return _0x5c989e[_0x0bfd('0xa')](_0x0bfd('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77f3=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','util','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x77f3,0x1a0));var _0x377f=function(_0x560107,_0x22bbdb){_0x560107=_0x560107-0x0;var _0x5cf4c9=_0x77f3[_0x560107];return _0x5cf4c9;};'use strict';var _=require('lodash');var util=require(_0x377f('0x0'));var logger=require(_0x377f('0x1'))(_0x377f('0x2'));var moment=require(_0x377f('0x3'));var BPromise=require(_0x377f('0x4'));var rp=require(_0x377f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x377f('0x6'));var config=require(_0x377f('0x7'));var attributes=require(_0x377f('0x8'));module[_0x377f('0x9')]=function(_0x5b25f2,_0x2b6f5e){return _0x5b25f2['define'](_0x377f('0xa'),attributes,{'tableName':'report_integration','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 48a601c..8806d91 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 _0xc6ac=['http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5766c6,_0x168e65){var _0x967949=function(_0x357ef3){while(--_0x357ef3){_0x5766c6['push'](_0x5766c6['shift']());}};_0x967949(++_0x168e65);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x30b591,_0x51a633){_0x30b591=_0x30b591-0x0;var _0x1b0281=_0xc6ac[_0x30b591];return _0x1b0281;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5cdcde,_0xb001a9){var _0x5202ba=function(_0x295037){while(--_0x295037){_0x5cdcde['push'](_0x5cdcde['shift']());}};_0x5202ba(++_0xb001a9);}(_0x1261,0x144));var _0x1126=function(_0x34f8ba,_0x2bb6a8){_0x34f8ba=_0x34f8ba-0x0;var _0xa5ed05=_0x1261[_0x34f8ba];return _0xa5ed05;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index eea559a..36a310c 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 _0xaac6=['../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0xaac6,0x11b));var _0x6aac=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xaac6[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x6aac('0x0'));var util=require(_0x6aac('0x1'));var path=require(_0x6aac('0x2'));var timeout=require(_0x6aac('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aac('0x4'));var auth=require(_0x6aac('0x5'));var interaction=require(_0x6aac('0x6'));var config=require('../../config/environment');var controller=require(_0x6aac('0x7'));router[_0x6aac('0x8')]('/',auth[_0x6aac('0x9')](),controller[_0x6aac('0xa')]);router['get'](_0x6aac('0xb'),auth[_0x6aac('0x9')](),controller['show']);router[_0x6aac('0x8')](_0x6aac('0xc'),auth[_0x6aac('0x9')](),controller[_0x6aac('0xd')]);router[_0x6aac('0xe')]('/',auth[_0x6aac('0x9')](),controller[_0x6aac('0xf')]);router[_0x6aac('0xe')](_0x6aac('0xc'),auth['isAuthenticated'](),controller[_0x6aac('0x10')]);router['post'](_0x6aac('0x11'),auth[_0x6aac('0x9')](),controller[_0x6aac('0x12')]);router[_0x6aac('0x13')](_0x6aac('0xb'),auth['isAuthenticated'](),controller[_0x6aac('0x14')]);router[_0x6aac('0x15')]('/:id',auth[_0x6aac('0x9')](),controller[_0x6aac('0x16')]);module[_0x6aac('0x17')]=router; \ No newline at end of file +var _0x1cfd=['get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x135d5f,_0x52dd8c){var _0x18f16d=function(_0x113e61){while(--_0x113e61){_0x135d5f['push'](_0x135d5f['shift']());}};_0x18f16d(++_0x52dd8c);}(_0x1cfd,0x1db));var _0xd1cf=function(_0x553a4a,_0x254536){_0x553a4a=_0x553a4a-0x0;var _0x3370b7=_0x1cfd[_0x553a4a];return _0x3370b7;};'use strict';var multer=require(_0xd1cf('0x0'));var util=require(_0xd1cf('0x1'));var path=require(_0xd1cf('0x2'));var timeout=require(_0xd1cf('0x3'));var express=require(_0xd1cf('0x4'));var router=express['Router']();var fs_extra=require(_0xd1cf('0x5'));var auth=require(_0xd1cf('0x6'));var interaction=require(_0xd1cf('0x7'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0xd1cf('0x8')]('/',auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xa')]);router['get'](_0xd1cf('0xb'),auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xc')]);router[_0xd1cf('0x8')]('/:id/sub_intervals',auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xd')]);router[_0xd1cf('0xe')]('/',auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xf')]);router[_0xd1cf('0xe')](_0xd1cf('0x10'),auth['isAuthenticated'](),controller[_0xd1cf('0x11')]);router[_0xd1cf('0xe')](_0xd1cf('0x12'),auth[_0xd1cf('0x9')](),controller[_0xd1cf('0x13')]);router['put'](_0xd1cf('0xb'),auth[_0xd1cf('0x9')](),controller[_0xd1cf('0x14')]);router[_0xd1cf('0x15')](_0xd1cf('0xb'),auth[_0xd1cf('0x9')](),controller['destroy']);module[_0xd1cf('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 315cbfb..f10ef05 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 _0x2d6e=['STRING','sequelize'];(function(_0x5a8fd7,_0x50c51c){var _0x5c1279=function(_0x7d6711){while(--_0x7d6711){_0x5a8fd7['push'](_0x5a8fd7['shift']());}};_0x5c1279(++_0x50c51c);}(_0x2d6e,0xc9));var _0xe2d6=function(_0x17228c,_0x110d1f){_0x17228c=_0x17228c-0x0;var _0x520b28=_0x2d6e[_0x17228c];return _0x520b28;};'use strict';var Sequelize=require(_0xe2d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2d6('0x1')]},'description':{'type':Sequelize[_0xe2d6('0x1')]},'interval':{'type':Sequelize[_0xe2d6('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x3f8d=['exports','STRING','sequelize'];(function(_0x278146,_0x1afe08){var _0x2cd8d9=function(_0x4fa0c0){while(--_0x4fa0c0){_0x278146['push'](_0x278146['shift']());}};_0x2cd8d9(++_0x1afe08);}(_0x3f8d,0xe3));var _0xd3f8=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x3f8d[_0x45313f];return _0x402910;};'use strict';var Sequelize=require(_0xd3f8('0x0'));module[_0xd3f8('0x1')]={'name':{'type':Sequelize[_0xd3f8('0x2')]},'description':{'type':Sequelize[_0xd3f8('0x2')]},'interval':{'type':Sequelize[_0xd3f8('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 653e196..8664729 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 _0xbb20=['moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','name','index','map','fieldName','model','keys','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','type','VIRTUAL','options','Interval','includeAll','include','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','IntervalId','getIntervals','findOne','rawAttributes','pick','hasOwnProperty','nolimit','addIntervals','findAll','eml-format','rimraf','request-promise'];(function(_0x5be989,_0x5657e5){var _0x183d1d=function(_0x4ebd60){while(--_0x4ebd60){_0x5be989['push'](_0x5be989['shift']());}};_0x183d1d(++_0x5657e5);}(_0xbb20,0x1a1));var _0x0bb2=function(_0x48defc,_0x32d1f3){_0x48defc=_0x48defc-0x0;var _0x4fef2b=_0xbb20[_0x48defc];return _0x4fef2b;};'use strict';var emlformat=require(_0x0bb2('0x0'));var rimraf=require(_0x0bb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bb2('0x2'));var moment=require(_0x0bb2('0x3'));var BPromise=require(_0x0bb2('0x4'));var Mustache=require(_0x0bb2('0x5'));var util=require(_0x0bb2('0x6'));var path=require('path');var sox=require(_0x0bb2('0x7'));var csv=require('to-csv');var ejs=require(_0x0bb2('0x8'));var fs=require('fs');var fs_extra=require(_0x0bb2('0x9'));var _=require(_0x0bb2('0xa'));var squel=require(_0x0bb2('0xb'));var crypto=require(_0x0bb2('0xc'));var jsforce=require(_0x0bb2('0xd'));var deskjs=require(_0x0bb2('0xe'));var toCsv=require(_0x0bb2('0xf'));var querystring=require(_0x0bb2('0x10'));var Papa=require(_0x0bb2('0x11'));var Redis=require(_0x0bb2('0x12'));var authService=require(_0x0bb2('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bb2('0x14'))(_0x0bb2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x0bb2('0x16'));function respondWithStatusCode(_0x5e4c66,_0x1d4ee6){_0x1d4ee6=_0x1d4ee6||0xcc;return function(_0x1ba0a5){if(_0x1ba0a5){return _0x5e4c66[_0x0bb2('0x17')](_0x1d4ee6);}return _0x5e4c66[_0x0bb2('0x18')](_0x1d4ee6)[_0x0bb2('0x19')]();};}function respondWithResult(_0x5f05f0,_0x1af47d){_0x1af47d=_0x1af47d||0xc8;return function(_0x3c167e){if(_0x3c167e){return _0x5f05f0[_0x0bb2('0x18')](_0x1af47d)['json'](_0x3c167e);}};}function respondWithFilteredResult(_0x1a8a5e,_0x4196d5){return function(_0x30b0d8){if(_0x30b0d8){var _0x454b1b=typeof _0x4196d5[_0x0bb2('0x1a')]==='undefined'&&typeof _0x4196d5['limit']===_0x0bb2('0x1b');var _0x27a421=_0x30b0d8[_0x0bb2('0x1c')];var _0x50c5d2=_0x454b1b?0x0:_0x4196d5[_0x0bb2('0x1a')];var _0x4657e4=_0x454b1b?_0x30b0d8[_0x0bb2('0x1c')]:_0x4196d5['offset']+_0x4196d5[_0x0bb2('0x1d')];var _0x427bfa;if(_0x4657e4>=_0x27a421){_0x4657e4=_0x27a421;_0x427bfa=0xc8;}else{_0x427bfa=0xce;}_0x1a8a5e['status'](_0x427bfa);return _0x1a8a5e['set'](_0x0bb2('0x1e'),_0x50c5d2+'-'+_0x4657e4+'/'+_0x27a421)[_0x0bb2('0x1f')](_0x30b0d8);}return null;};}function patchUpdates(_0x257f90){return function(_0x540288){try{jsonpatch['apply'](_0x540288,_0x257f90,!![]);}catch(_0x17ccfb){return BPromise[_0x0bb2('0x20')](_0x17ccfb);}return _0x540288[_0x0bb2('0x21')]();};}function saveUpdates(_0x2b102b,_0x1a9d14){return function(_0x203c1d){if(_0x203c1d){return _0x203c1d[_0x0bb2('0x22')](_0x2b102b)[_0x0bb2('0x23')](function(_0x4a517b){return _0x4a517b;});}return null;};}function removeEntity(_0x149e4c,_0x1d713c){return function(_0x5ba8b2){if(_0x5ba8b2){return _0x5ba8b2[_0x0bb2('0x24')]()['then'](function(){var _0x298226=_0x5ba8b2[_0x0bb2('0x25')]({'plain':!![]});var _0x144d0f=_0x0bb2('0x26');return db[_0x0bb2('0x27')][_0x0bb2('0x24')]({'where':{'type':_0x144d0f,'resourceId':_0x298226['id']}})[_0x0bb2('0x23')](function(){return _0x5ba8b2;});})[_0x0bb2('0x23')](function(){_0x149e4c[_0x0bb2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93b871,_0x46e5cb){return function(_0x3e7c89){if(!_0x3e7c89){_0x93b871[_0x0bb2('0x17')](0x194);}return _0x3e7c89;};}function handleError(_0x30dddf,_0x1e1e22){_0x1e1e22=_0x1e1e22||0x1f4;return function(_0x10699a){logger[_0x0bb2('0x28')](_0x10699a['stack']);if(_0x10699a[_0x0bb2('0x29')]){delete _0x10699a['name'];}_0x30dddf[_0x0bb2('0x18')](_0x1e1e22)['send'](_0x10699a);};}exports[_0x0bb2('0x2a')]=function(_0x253e0e,_0x4af95d){var _0x3cdb56={},_0x443c14={},_0x14decf={'count':0x0,'rows':[]};var _0x24c9a0=_[_0x0bb2('0x2b')](db['Interval']['rawAttributes'],function(_0x38273a){return{'name':_0x38273a[_0x0bb2('0x2c')],'type':_0x38273a['type']['key']};});_0x443c14[_0x0bb2('0x2d')]=_[_0x0bb2('0x2b')](_0x24c9a0,'name');_0x443c14['query']=_[_0x0bb2('0x2e')](_0x253e0e[_0x0bb2('0x2f')]);_0x443c14[_0x0bb2('0x30')]=_[_0x0bb2('0x31')](_0x443c14['model'],_0x443c14['query']);_0x3cdb56[_0x0bb2('0x32')]=_[_0x0bb2('0x31')](_0x443c14[_0x0bb2('0x2d')],qs[_0x0bb2('0x33')](_0x253e0e[_0x0bb2('0x2f')]['fields']));_0x3cdb56['attributes']=_0x3cdb56['attributes']['length']?_0x3cdb56[_0x0bb2('0x32')]:_0x443c14[_0x0bb2('0x2d')];if(!_0x253e0e[_0x0bb2('0x2f')]['hasOwnProperty']('nolimit')){_0x3cdb56[_0x0bb2('0x1d')]=qs['limit'](_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x1d')]);_0x3cdb56[_0x0bb2('0x1a')]=qs[_0x0bb2('0x1a')](_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x1a')]);}_0x3cdb56[_0x0bb2('0x34')]=qs[_0x0bb2('0x35')](_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x35')]);_0x3cdb56[_0x0bb2('0x36')]=qs[_0x0bb2('0x30')](_['pick'](_0x253e0e[_0x0bb2('0x2f')],_0x443c14[_0x0bb2('0x30')]),_0x24c9a0);if(_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x37')]){_0x3cdb56[_0x0bb2('0x36')]=_[_0x0bb2('0x38')](_0x3cdb56[_0x0bb2('0x36')],{'$or':_[_0x0bb2('0x2b')](_0x24c9a0,function(_0x3939af){if(_0x3939af[_0x0bb2('0x39')]!==_0x0bb2('0x3a')){var _0xeb8b0a={};_0xeb8b0a[_0x3939af[_0x0bb2('0x29')]]={'$like':'%'+_0x253e0e[_0x0bb2('0x2f')]['filter']+'%'};return _0xeb8b0a;}})});}_0x3cdb56=_['merge']({},_0x3cdb56,_0x253e0e[_0x0bb2('0x3b')]);var _0x5637c9={'where':_0x3cdb56[_0x0bb2('0x36')]};return db[_0x0bb2('0x3c')][_0x0bb2('0x1c')](_0x5637c9)[_0x0bb2('0x23')](function(_0x5d55a9){_0x14decf['count']=_0x5d55a9;if(_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x3d')]){_0x3cdb56[_0x0bb2('0x3e')]=[{'all':!![]}];}return db[_0x0bb2('0x3c')]['findAll'](_0x3cdb56);})['then'](function(_0x56c9e9){_0x14decf[_0x0bb2('0x3f')]=_0x56c9e9;return _0x14decf;})[_0x0bb2('0x23')](respondWithFilteredResult(_0x4af95d,_0x3cdb56))[_0x0bb2('0x40')](handleError(_0x4af95d,null));};exports[_0x0bb2('0x41')]=function(_0x2024b6,_0x40aa50){var _0x2b8597={'raw':!![],'where':{'id':_0x2024b6[_0x0bb2('0x42')]['id']}},_0x3eaa0e={};_0x3eaa0e['model']=_[_0x0bb2('0x2e')](db['Interval']['rawAttributes']);_0x3eaa0e[_0x0bb2('0x2f')]=_['keys'](_0x2024b6[_0x0bb2('0x2f')]);_0x3eaa0e['filters']=_[_0x0bb2('0x31')](_0x3eaa0e[_0x0bb2('0x2d')],_0x3eaa0e[_0x0bb2('0x2f')]);_0x2b8597[_0x0bb2('0x32')]=_['intersection'](_0x3eaa0e['model'],qs[_0x0bb2('0x33')](_0x2024b6[_0x0bb2('0x2f')]['fields']));_0x2b8597[_0x0bb2('0x32')]=_0x2b8597[_0x0bb2('0x32')][_0x0bb2('0x43')]?_0x2b8597[_0x0bb2('0x32')]:_0x3eaa0e['model'];if(_0x2024b6[_0x0bb2('0x2f')][_0x0bb2('0x3d')]){_0x2b8597['include']=[{'all':!![]}];}_0x2b8597=_[_0x0bb2('0x38')]({},_0x2b8597,_0x2024b6[_0x0bb2('0x3b')]);return db[_0x0bb2('0x3c')]['find'](_0x2b8597)['then'](handleEntityNotFound(_0x40aa50,null))[_0x0bb2('0x23')](respondWithResult(_0x40aa50,null))['catch'](handleError(_0x40aa50,null));};exports['create']=function(_0x34af5f,_0x4202c1){return db['Interval'][_0x0bb2('0x44')](_0x34af5f[_0x0bb2('0x45')],{})[_0x0bb2('0x23')](function(_0x568c19){var _0x1ac0dd=_0x34af5f[_0x0bb2('0x46')][_0x0bb2('0x25')]({'plain':!![]});if(!_0x1ac0dd)throw new Error(_0x0bb2('0x47'));if(_0x1ac0dd['role']===_0x0bb2('0x46')){var _0x1a03c0=_0x568c19[_0x0bb2('0x25')]({'plain':!![]});var _0x33d7e7='Intervals';return db[_0x0bb2('0x48')][_0x0bb2('0x49')]({'where':{'name':_0x33d7e7,'userProfileId':_0x1ac0dd[_0x0bb2('0x4a')]},'raw':!![]})[_0x0bb2('0x23')](function(_0x52f398){if(_0x52f398&&_0x52f398['autoAssociation']===0x0){return db[_0x0bb2('0x27')]['create']({'name':_0x1a03c0[_0x0bb2('0x29')],'resourceId':_0x1a03c0['id'],'type':_0x52f398[_0x0bb2('0x29')],'sectionId':_0x52f398['id']},{})[_0x0bb2('0x23')](function(){return _0x568c19;});}else{return _0x568c19;}})[_0x0bb2('0x40')](function(_0x1c3db5){logger[_0x0bb2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c3db5);throw _0x1c3db5;});}return _0x568c19;})[_0x0bb2('0x23')](respondWithResult(_0x4202c1,0xc9))[_0x0bb2('0x40')](handleError(_0x4202c1,null));};exports[_0x0bb2('0x22')]=function(_0x4e4a7a,_0x1dcf85){if(_0x4e4a7a[_0x0bb2('0x45')]['id']){delete _0x4e4a7a[_0x0bb2('0x45')]['id'];}return db['Interval']['find']({'where':{'id':_0x4e4a7a['params']['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x1dcf85,null))[_0x0bb2('0x23')](saveUpdates(_0x4e4a7a[_0x0bb2('0x45')],null))['then'](respondWithResult(_0x1dcf85,null))[_0x0bb2('0x40')](handleError(_0x1dcf85,null));};exports[_0x0bb2('0x24')]=function(_0x17e204,_0x18f22b){return db[_0x0bb2('0x3c')][_0x0bb2('0x49')]({'where':{'id':_0x17e204['params']['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x18f22b,null))[_0x0bb2('0x23')](removeEntity(_0x18f22b,null))[_0x0bb2('0x40')](handleError(_0x18f22b,null));};exports['addInterval']=function(_0xb2493c,_0x1f7e02,_0x26c4c3){if(_0xb2493c[_0x0bb2('0x45')]['id']){delete _0xb2493c[_0x0bb2('0x45')]['id'];}return db['Interval'][_0x0bb2('0x49')]({'where':{'id':_0xb2493c[_0x0bb2('0x42')]['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x1f7e02,null))[_0x0bb2('0x23')](function(_0x4277fc){if(_0x4277fc){_0xb2493c['body'][_0x0bb2('0x4b')]=_0x4277fc['id'];return db[_0x0bb2('0x3c')]['create'](_0xb2493c[_0x0bb2('0x45')]);}})[_0x0bb2('0x23')](respondWithResult(_0x1f7e02,null))[_0x0bb2('0x40')](handleError(_0x1f7e02,null));};exports[_0x0bb2('0x4c')]=function(_0x47815d,_0x4e16e9,_0x3efacc){var _0x278f39={};var _0x13a0ea={};var _0x116043;var _0x42ae80;return db[_0x0bb2('0x3c')][_0x0bb2('0x4d')]({'where':{'id':_0x47815d['params']['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x4e16e9,null))[_0x0bb2('0x23')](function(_0x4eaac7){if(_0x4eaac7){_0x116043=_0x4eaac7;_0x13a0ea[_0x0bb2('0x2d')]=_[_0x0bb2('0x2e')](db[_0x0bb2('0x3c')][_0x0bb2('0x4e')]);_0x13a0ea[_0x0bb2('0x2f')]=_[_0x0bb2('0x2e')](_0x47815d[_0x0bb2('0x2f')]);_0x13a0ea[_0x0bb2('0x30')]=_['intersection'](_0x13a0ea['model'],_0x13a0ea['query']);_0x278f39['attributes']=_['intersection'](_0x13a0ea[_0x0bb2('0x2d')],qs[_0x0bb2('0x33')](_0x47815d[_0x0bb2('0x2f')][_0x0bb2('0x33')]));_0x278f39[_0x0bb2('0x32')]=_0x278f39['attributes'][_0x0bb2('0x43')]?_0x278f39[_0x0bb2('0x32')]:_0x13a0ea[_0x0bb2('0x2d')];_0x278f39[_0x0bb2('0x34')]=qs['sort'](_0x47815d['query'][_0x0bb2('0x35')]);_0x278f39['where']=qs['filters'](_[_0x0bb2('0x4f')](_0x47815d[_0x0bb2('0x2f')],_0x13a0ea['filters']));if(_0x47815d[_0x0bb2('0x2f')]['filter']){_0x278f39[_0x0bb2('0x36')]=_[_0x0bb2('0x38')](_0x278f39['where'],{'$or':_[_0x0bb2('0x2b')](_0x278f39[_0x0bb2('0x32')],function(_0x511cb9){var _0x487055={};_0x487055[_0x511cb9]={'$like':'%'+_0x47815d[_0x0bb2('0x2f')][_0x0bb2('0x37')]+'%'};return _0x487055;})});}_0x278f39=_['merge']({},_0x278f39,_0x47815d[_0x0bb2('0x3b')]);return _0x116043['getIntervals'](_0x278f39);}})[_0x0bb2('0x23')](function(_0x308639){if(_0x308639){_0x42ae80=_0x308639['length'];if(!_0x47815d['query'][_0x0bb2('0x50')](_0x0bb2('0x51'))){_0x278f39['limit']=qs[_0x0bb2('0x1d')](_0x47815d['query'][_0x0bb2('0x1d')]);_0x278f39[_0x0bb2('0x1a')]=qs['offset'](_0x47815d[_0x0bb2('0x2f')][_0x0bb2('0x1a')]);}return _0x116043[_0x0bb2('0x4c')](_0x278f39);}})[_0x0bb2('0x23')](function(_0x2713f3){if(_0x2713f3){return _0x2713f3?{'count':_0x42ae80,'rows':_0x2713f3}:null;}})[_0x0bb2('0x23')](respondWithResult(_0x4e16e9,null))[_0x0bb2('0x40')](handleError(_0x4e16e9,null));};exports[_0x0bb2('0x52')]=function(_0xc6851e,_0x5e3a30,_0x3b2c){return db[_0x0bb2('0x3c')][_0x0bb2('0x4d')]({'where':{'id':_0xc6851e[_0x0bb2('0x42')]['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x5e3a30,null))[_0x0bb2('0x23')](function(_0x38806e){if(_0x38806e){return db['sequelize']['transaction'](function(_0xc6b427){return db[_0x0bb2('0x3c')]['destroy']({'where':{'IntervalId':_0xc6851e[_0x0bb2('0x42')]['id']},'transaction':_0xc6b427})[_0x0bb2('0x23')](function(_0x589b11){var _0x492c87=_['map'](_0xc6851e[_0x0bb2('0x45')],function(_0x370ffc){delete _0x370ffc['id'];_0x370ffc[_0x0bb2('0x4b')]=_0xc6851e[_0x0bb2('0x42')]['id'];return _0x370ffc;});return db[_0x0bb2('0x3c')]['bulkCreate'](_0x492c87,{'transaction':_0xc6b427});});})[_0x0bb2('0x23')](function(){return db['Interval'][_0x0bb2('0x53')]({'where':{'IntervalId':_0xc6851e[_0x0bb2('0x42')]['id']}});});}})[_0x0bb2('0x23')](respondWithResult(_0x5e3a30,null))[_0x0bb2('0x40')](handleError(_0x5e3a30,null));}; \ No newline at end of file +var _0xf7e6=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','filter','hasOwnProperty','sequelize','transaction','IntervalId','bulkCreate','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf7e6,0x199));var _0x6f7e=function(_0x409f97,_0x176a12){_0x409f97=_0x409f97-0x0;var _0x4e02e1=_0xf7e6[_0x409f97];return _0x4e02e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f7e('0x0'));var jsonpatch=require(_0x6f7e('0x1'));var rp=require(_0x6f7e('0x2'));var moment=require(_0x6f7e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6f7e('0x4'));var csv=require(_0x6f7e('0x5'));var ejs=require(_0x6f7e('0x6'));var fs=require('fs');var fs_extra=require(_0x6f7e('0x7'));var _=require(_0x6f7e('0x8'));var squel=require(_0x6f7e('0x9'));var crypto=require(_0x6f7e('0xa'));var jsforce=require(_0x6f7e('0xb'));var deskjs=require(_0x6f7e('0xc'));var toCsv=require(_0x6f7e('0x5'));var querystring=require('querystring');var Papa=require(_0x6f7e('0xd'));var Redis=require(_0x6f7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6f7e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f7e('0x10'));var logger=require(_0x6f7e('0x11'))('api');var utils=require(_0x6f7e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6f7e('0x13'));var db=require(_0x6f7e('0x14'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x3454e8,_0x94d1f4){_0x94d1f4=_0x94d1f4||0xcc;return function(_0x168ca9){if(_0x168ca9){return _0x3454e8[_0x6f7e('0x15')](_0x94d1f4);}return _0x3454e8['status'](_0x94d1f4)[_0x6f7e('0x16')]();};}function respondWithResult(_0x3da133,_0x4f6343){_0x4f6343=_0x4f6343||0xc8;return function(_0x15dc2a){if(_0x15dc2a){return _0x3da133[_0x6f7e('0x17')](_0x4f6343)[_0x6f7e('0x18')](_0x15dc2a);}};}function respondWithFilteredResult(_0x51f142,_0x58d3ed){return function(_0x1a7e60){if(_0x1a7e60){var _0x4fa712=typeof _0x58d3ed['offset']===_0x6f7e('0x19')&&typeof _0x58d3ed[_0x6f7e('0x1a')]==='undefined';var _0x154685=_0x1a7e60[_0x6f7e('0x1b')];var _0x15fa4f=_0x4fa712?0x0:_0x58d3ed[_0x6f7e('0x1c')];var _0x598540=_0x4fa712?_0x1a7e60[_0x6f7e('0x1b')]:_0x58d3ed[_0x6f7e('0x1c')]+_0x58d3ed[_0x6f7e('0x1a')];var _0x3582aa;if(_0x598540>=_0x154685){_0x598540=_0x154685;_0x3582aa=0xc8;}else{_0x3582aa=0xce;}_0x51f142[_0x6f7e('0x17')](_0x3582aa);return _0x51f142['set'](_0x6f7e('0x1d'),_0x15fa4f+'-'+_0x598540+'/'+_0x154685)[_0x6f7e('0x18')](_0x1a7e60);}return null;};}function patchUpdates(_0x2f3fae){return function(_0x5220ca){try{jsonpatch[_0x6f7e('0x1e')](_0x5220ca,_0x2f3fae,!![]);}catch(_0x335c34){return BPromise['reject'](_0x335c34);}return _0x5220ca['save']();};}function saveUpdates(_0x5dcbe9,_0x11a4b0){return function(_0x40e9aa){if(_0x40e9aa){return _0x40e9aa[_0x6f7e('0x1f')](_0x5dcbe9)['then'](function(_0x1148f7){return _0x1148f7;});}return null;};}function removeEntity(_0x42ab95,_0x12328e){return function(_0x565450){if(_0x565450){return _0x565450[_0x6f7e('0x20')]()[_0x6f7e('0x21')](function(){var _0x1da684=_0x565450[_0x6f7e('0x22')]({'plain':!![]});var _0x47e559=_0x6f7e('0x23');return db[_0x6f7e('0x24')][_0x6f7e('0x20')]({'where':{'type':_0x47e559,'resourceId':_0x1da684['id']}})[_0x6f7e('0x21')](function(){return _0x565450;});})[_0x6f7e('0x21')](function(){_0x42ab95[_0x6f7e('0x17')](0xcc)[_0x6f7e('0x16')]();});}};}function handleEntityNotFound(_0x4507c2,_0x18c629){return function(_0xe3115a){if(!_0xe3115a){_0x4507c2[_0x6f7e('0x15')](0x194);}return _0xe3115a;};}function handleError(_0x12c4dd,_0x39d6c2){_0x39d6c2=_0x39d6c2||0x1f4;return function(_0x4df4f0){logger[_0x6f7e('0x25')](_0x4df4f0[_0x6f7e('0x26')]);if(_0x4df4f0[_0x6f7e('0x27')]){delete _0x4df4f0[_0x6f7e('0x27')];}_0x12c4dd[_0x6f7e('0x17')](_0x39d6c2)[_0x6f7e('0x28')](_0x4df4f0);};}exports[_0x6f7e('0x29')]=function(_0x1755bf,_0x365b6b){var _0x300a0d={},_0x2a7b74={},_0xe2c037={'count':0x0,'rows':[]};var _0x2337c3=_[_0x6f7e('0x2a')](db[_0x6f7e('0x2b')][_0x6f7e('0x2c')],function(_0x2b38de){return{'name':_0x2b38de['fieldName'],'type':_0x2b38de[_0x6f7e('0x2d')]['key']};});_0x2a7b74[_0x6f7e('0x2e')]=_['map'](_0x2337c3,'name');_0x2a7b74[_0x6f7e('0x2f')]=_[_0x6f7e('0x30')](_0x1755bf[_0x6f7e('0x2f')]);_0x2a7b74[_0x6f7e('0x31')]=_[_0x6f7e('0x32')](_0x2a7b74['model'],_0x2a7b74[_0x6f7e('0x2f')]);_0x300a0d[_0x6f7e('0x33')]=_['intersection'](_0x2a7b74[_0x6f7e('0x2e')],qs[_0x6f7e('0x34')](_0x1755bf[_0x6f7e('0x2f')][_0x6f7e('0x34')]));_0x300a0d['attributes']=_0x300a0d[_0x6f7e('0x33')][_0x6f7e('0x35')]?_0x300a0d[_0x6f7e('0x33')]:_0x2a7b74[_0x6f7e('0x2e')];if(!_0x1755bf['query']['hasOwnProperty'](_0x6f7e('0x36'))){_0x300a0d[_0x6f7e('0x1a')]=qs['limit'](_0x1755bf['query']['limit']);_0x300a0d[_0x6f7e('0x1c')]=qs['offset'](_0x1755bf['query'][_0x6f7e('0x1c')]);}_0x300a0d[_0x6f7e('0x37')]=qs['sort'](_0x1755bf['query'][_0x6f7e('0x38')]);_0x300a0d['where']=qs[_0x6f7e('0x31')](_[_0x6f7e('0x39')](_0x1755bf[_0x6f7e('0x2f')],_0x2a7b74[_0x6f7e('0x31')]),_0x2337c3);if(_0x1755bf[_0x6f7e('0x2f')]['filter']){_0x300a0d[_0x6f7e('0x3a')]=_[_0x6f7e('0x3b')](_0x300a0d[_0x6f7e('0x3a')],{'$or':_[_0x6f7e('0x2a')](_0x2337c3,function(_0x5a975b){if(_0x5a975b[_0x6f7e('0x2d')]!=='VIRTUAL'){var _0x230ce2={};_0x230ce2[_0x5a975b[_0x6f7e('0x27')]]={'$like':'%'+_0x1755bf[_0x6f7e('0x2f')]['filter']+'%'};return _0x230ce2;}})});}_0x300a0d=_[_0x6f7e('0x3b')]({},_0x300a0d,_0x1755bf[_0x6f7e('0x3c')]);var _0xa96380={'where':_0x300a0d[_0x6f7e('0x3a')]};return db['Interval']['count'](_0xa96380)['then'](function(_0x88cd90){_0xe2c037[_0x6f7e('0x1b')]=_0x88cd90;if(_0x1755bf[_0x6f7e('0x2f')][_0x6f7e('0x3d')]){_0x300a0d[_0x6f7e('0x3e')]=[{'all':!![]}];}return db['Interval'][_0x6f7e('0x3f')](_0x300a0d);})[_0x6f7e('0x21')](function(_0x5b38fe){_0xe2c037[_0x6f7e('0x40')]=_0x5b38fe;return _0xe2c037;})['then'](respondWithFilteredResult(_0x365b6b,_0x300a0d))[_0x6f7e('0x41')](handleError(_0x365b6b,null));};exports[_0x6f7e('0x42')]=function(_0x131d08,_0x7d543){var _0x50d570={'raw':!![],'where':{'id':_0x131d08[_0x6f7e('0x43')]['id']}},_0x16b643={};_0x16b643[_0x6f7e('0x2e')]=_[_0x6f7e('0x30')](db[_0x6f7e('0x2b')][_0x6f7e('0x2c')]);_0x16b643[_0x6f7e('0x2f')]=_[_0x6f7e('0x30')](_0x131d08['query']);_0x16b643['filters']=_[_0x6f7e('0x32')](_0x16b643[_0x6f7e('0x2e')],_0x16b643[_0x6f7e('0x2f')]);_0x50d570[_0x6f7e('0x33')]=_[_0x6f7e('0x32')](_0x16b643['model'],qs['fields'](_0x131d08['query'][_0x6f7e('0x34')]));_0x50d570[_0x6f7e('0x33')]=_0x50d570['attributes'][_0x6f7e('0x35')]?_0x50d570[_0x6f7e('0x33')]:_0x16b643[_0x6f7e('0x2e')];if(_0x131d08[_0x6f7e('0x2f')][_0x6f7e('0x3d')]){_0x50d570[_0x6f7e('0x3e')]=[{'all':!![]}];}_0x50d570=_[_0x6f7e('0x3b')]({},_0x50d570,_0x131d08[_0x6f7e('0x3c')]);return db[_0x6f7e('0x2b')][_0x6f7e('0x44')](_0x50d570)[_0x6f7e('0x21')](handleEntityNotFound(_0x7d543,null))[_0x6f7e('0x21')](respondWithResult(_0x7d543,null))[_0x6f7e('0x41')](handleError(_0x7d543,null));};exports[_0x6f7e('0x45')]=function(_0x33104d,_0x594847){return db[_0x6f7e('0x2b')][_0x6f7e('0x45')](_0x33104d[_0x6f7e('0x46')],{})[_0x6f7e('0x21')](function(_0x2e75b6){var _0x2261e6=_0x33104d[_0x6f7e('0x47')]['get']({'plain':!![]});if(!_0x2261e6)throw new Error(_0x6f7e('0x48'));if(_0x2261e6[_0x6f7e('0x49')]==='user'){var _0x5a2d3f=_0x2e75b6[_0x6f7e('0x22')]({'plain':!![]});var _0x2e587d=_0x6f7e('0x23');return db['UserProfileSection'][_0x6f7e('0x44')]({'where':{'name':_0x2e587d,'userProfileId':_0x2261e6['userProfileId']},'raw':!![]})[_0x6f7e('0x21')](function(_0x1a01c3){if(_0x1a01c3&&_0x1a01c3[_0x6f7e('0x4a')]===0x0){return db[_0x6f7e('0x24')][_0x6f7e('0x45')]({'name':_0x5a2d3f[_0x6f7e('0x27')],'resourceId':_0x5a2d3f['id'],'type':_0x1a01c3[_0x6f7e('0x27')],'sectionId':_0x1a01c3['id']},{})[_0x6f7e('0x21')](function(){return _0x2e75b6;});}else{return _0x2e75b6;}})[_0x6f7e('0x41')](function(_0x2387aa){logger[_0x6f7e('0x25')](_0x6f7e('0x4b'),_0x2387aa);throw _0x2387aa;});}return _0x2e75b6;})[_0x6f7e('0x21')](respondWithResult(_0x594847,0xc9))[_0x6f7e('0x41')](handleError(_0x594847,null));};exports[_0x6f7e('0x1f')]=function(_0x7b4026,_0x549cc3){if(_0x7b4026[_0x6f7e('0x46')]['id']){delete _0x7b4026['body']['id'];}return db['Interval'][_0x6f7e('0x44')]({'where':{'id':_0x7b4026['params']['id']}})['then'](handleEntityNotFound(_0x549cc3,null))[_0x6f7e('0x21')](saveUpdates(_0x7b4026['body'],null))[_0x6f7e('0x21')](respondWithResult(_0x549cc3,null))[_0x6f7e('0x41')](handleError(_0x549cc3,null));};exports[_0x6f7e('0x20')]=function(_0x381dcd,_0x4d3e58){return db[_0x6f7e('0x2b')][_0x6f7e('0x44')]({'where':{'id':_0x381dcd['params']['id']}})[_0x6f7e('0x21')](handleEntityNotFound(_0x4d3e58,null))['then'](removeEntity(_0x4d3e58,null))[_0x6f7e('0x41')](handleError(_0x4d3e58,null));};exports[_0x6f7e('0x4c')]=function(_0x2226a5,_0x14d8b0,_0x38025d){if(_0x2226a5[_0x6f7e('0x46')]['id']){delete _0x2226a5[_0x6f7e('0x46')]['id'];}return db[_0x6f7e('0x2b')][_0x6f7e('0x44')]({'where':{'id':_0x2226a5['params']['id']}})[_0x6f7e('0x21')](handleEntityNotFound(_0x14d8b0,null))[_0x6f7e('0x21')](function(_0x5c6cb0){if(_0x5c6cb0){_0x2226a5['body']['IntervalId']=_0x5c6cb0['id'];return db[_0x6f7e('0x2b')][_0x6f7e('0x45')](_0x2226a5['body']);}})[_0x6f7e('0x21')](respondWithResult(_0x14d8b0,null))['catch'](handleError(_0x14d8b0,null));};exports[_0x6f7e('0x4d')]=function(_0x40e36c,_0x2349a3,_0x3856cb){var _0x2c98b2={};var _0x1d4b1a={};var _0x34c097;var _0x133e71;return db['Interval'][_0x6f7e('0x4e')]({'where':{'id':_0x40e36c['params']['id']}})[_0x6f7e('0x21')](handleEntityNotFound(_0x2349a3,null))[_0x6f7e('0x21')](function(_0x38714b){if(_0x38714b){_0x34c097=_0x38714b;_0x1d4b1a[_0x6f7e('0x2e')]=_[_0x6f7e('0x30')](db['Interval']['rawAttributes']);_0x1d4b1a['query']=_[_0x6f7e('0x30')](_0x40e36c[_0x6f7e('0x2f')]);_0x1d4b1a[_0x6f7e('0x31')]=_[_0x6f7e('0x32')](_0x1d4b1a[_0x6f7e('0x2e')],_0x1d4b1a[_0x6f7e('0x2f')]);_0x2c98b2[_0x6f7e('0x33')]=_['intersection'](_0x1d4b1a[_0x6f7e('0x2e')],qs[_0x6f7e('0x34')](_0x40e36c[_0x6f7e('0x2f')][_0x6f7e('0x34')]));_0x2c98b2[_0x6f7e('0x33')]=_0x2c98b2[_0x6f7e('0x33')][_0x6f7e('0x35')]?_0x2c98b2[_0x6f7e('0x33')]:_0x1d4b1a[_0x6f7e('0x2e')];_0x2c98b2['order']=qs['sort'](_0x40e36c[_0x6f7e('0x2f')]['sort']);_0x2c98b2[_0x6f7e('0x3a')]=qs[_0x6f7e('0x31')](_[_0x6f7e('0x39')](_0x40e36c[_0x6f7e('0x2f')],_0x1d4b1a[_0x6f7e('0x31')]));if(_0x40e36c['query'][_0x6f7e('0x4f')]){_0x2c98b2[_0x6f7e('0x3a')]=_['merge'](_0x2c98b2[_0x6f7e('0x3a')],{'$or':_[_0x6f7e('0x2a')](_0x2c98b2[_0x6f7e('0x33')],function(_0x558ab1){var _0x1745bb={};_0x1745bb[_0x558ab1]={'$like':'%'+_0x40e36c[_0x6f7e('0x2f')][_0x6f7e('0x4f')]+'%'};return _0x1745bb;})});}_0x2c98b2=_['merge']({},_0x2c98b2,_0x40e36c[_0x6f7e('0x3c')]);return _0x34c097['getIntervals'](_0x2c98b2);}})[_0x6f7e('0x21')](function(_0x4a6185){if(_0x4a6185){_0x133e71=_0x4a6185['length'];if(!_0x40e36c[_0x6f7e('0x2f')][_0x6f7e('0x50')](_0x6f7e('0x36'))){_0x2c98b2[_0x6f7e('0x1a')]=qs[_0x6f7e('0x1a')](_0x40e36c[_0x6f7e('0x2f')][_0x6f7e('0x1a')]);_0x2c98b2['offset']=qs[_0x6f7e('0x1c')](_0x40e36c[_0x6f7e('0x2f')][_0x6f7e('0x1c')]);}return _0x34c097['getIntervals'](_0x2c98b2);}})[_0x6f7e('0x21')](function(_0x198097){if(_0x198097){return _0x198097?{'count':_0x133e71,'rows':_0x198097}:null;}})[_0x6f7e('0x21')](respondWithResult(_0x2349a3,null))['catch'](handleError(_0x2349a3,null));};exports['addIntervals']=function(_0x5a99f5,_0x153041,_0x1f5a63){return db[_0x6f7e('0x2b')][_0x6f7e('0x4e')]({'where':{'id':_0x5a99f5['params']['id']}})[_0x6f7e('0x21')](handleEntityNotFound(_0x153041,null))[_0x6f7e('0x21')](function(_0x2fdad4){if(_0x2fdad4){return db[_0x6f7e('0x51')][_0x6f7e('0x52')](function(_0x1d3869){return db[_0x6f7e('0x2b')][_0x6f7e('0x20')]({'where':{'IntervalId':_0x5a99f5[_0x6f7e('0x43')]['id']},'transaction':_0x1d3869})[_0x6f7e('0x21')](function(_0x272b8c){var _0xb14985=_['map'](_0x5a99f5[_0x6f7e('0x46')],function(_0x3dbd3b){delete _0x3dbd3b['id'];_0x3dbd3b[_0x6f7e('0x53')]=_0x5a99f5[_0x6f7e('0x43')]['id'];return _0x3dbd3b;});return db[_0x6f7e('0x2b')][_0x6f7e('0x54')](_0xb14985,{'transaction':_0x1d3869});});})['then'](function(){return db['Interval'][_0x6f7e('0x3f')]({'where':{'IntervalId':_0x5a99f5[_0x6f7e('0x43')]['id']}});});}})[_0x6f7e('0x21')](respondWithResult(_0x153041,null))[_0x6f7e('0x41')](handleError(_0x153041,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index a6fd2bc..2d0f69b 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 _0x76c1=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./interval.attributes','Interval','tools_intervals','rewrite','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76c1,0x15b));var _0x176c=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0x76c1[_0x52e0ee];return _0x32534c;};'use strict';var _=require(_0x176c('0x0'));var util=require(_0x176c('0x1'));var logger=require(_0x176c('0x2'))(_0x176c('0x3'));var moment=require(_0x176c('0x4'));var BPromise=require(_0x176c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x176c('0x6'));var config=require(_0x176c('0x7'));var attributes=require(_0x176c('0x8'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0xc28671,_0x329a5e){return _0xc28671['define'](_0x176c('0x9'),attributes,{'tableName':_0x176c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x40c110,_0x5d58ba){extensions['rewrite'](_0xc28671,_0x40c110);},'afterBulkCreate':function(_0x27c52f,_0x1efd0a,_0x4951b1){_0x4951b1();extensions[_0x176c('0xb')](_0xc28671,_0x27c52f[0x0]);},'afterUpdate':function(_0x3ec9f0,_0x54dc22){extensions[_0x176c('0xb')](_0xc28671,_0x3ec9f0);},'afterDestroy':function(_0x7eb046,_0x38e660){extensions['rewrite'](_0xc28671,_0x7eb046);}}});}; \ No newline at end of file +var _0xdd0c=['path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x432bab,_0x3618f2){var _0x476e53=function(_0x4e0539){while(--_0x4e0539){_0x432bab['push'](_0x432bab['shift']());}};_0x476e53(++_0x3618f2);}(_0xdd0c,0x1ad));var _0xcdd0=function(_0x10d698,_0x1993f8){_0x10d698=_0x10d698-0x0;var _0x3f4cca=_0xdd0c[_0x10d698];return _0x3f4cca;};'use strict';var _=require(_0xcdd0('0x0'));var util=require(_0xcdd0('0x1'));var logger=require(_0xcdd0('0x2'))(_0xcdd0('0x3'));var moment=require('moment');var BPromise=require(_0xcdd0('0x4'));var rp=require(_0xcdd0('0x5'));var fs=require('fs');var path=require(_0xcdd0('0x6'));var rimraf=require(_0xcdd0('0x7'));var config=require(_0xcdd0('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0xcdd0('0x9'));module[_0xcdd0('0xa')]=function(_0x59a94f,_0x94394b){return _0x59a94f[_0xcdd0('0xb')](_0xcdd0('0xc'),attributes,{'tableName':_0xcdd0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e0482,_0x1f7ae0){extensions[_0xcdd0('0xe')](_0x59a94f,_0x1e0482);},'afterBulkCreate':function(_0xcbc640,_0x40ec4d,_0x2de69f){_0x2de69f();extensions[_0xcdd0('0xe')](_0x59a94f,_0xcbc640[0x0]);},'afterUpdate':function(_0xfeab34,_0x2ed31b){extensions[_0xcdd0('0xe')](_0x59a94f,_0xfeab34);},'afterDestroy':function(_0x6f650d,_0x4405b7){extensions[_0xcdd0('0xe')](_0x59a94f,_0x6f650d);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 602dbe8..8eee18a 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(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_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);});});}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(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 2f9af39..c131eb6 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x27e8a1,_0x527a3a){var _0x78f8d4=function(_0xc02e23){while(--_0xc02e23){_0x27e8a1['push'](_0x27e8a1['shift']());}};_0x78f8d4(++_0x527a3a);}(_0x2ef3,0xba));var _0x32ef=function(_0x30d946,_0x2ecd91){_0x30d946=_0x30d946-0x0;var _0x3b74ae=_0x2ef3[_0x30d946];return _0x3b74ae;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x1aa1ef,_0x3e75ab){var _0x323937=function(_0x5bf85d){while(--_0x5bf85d){_0x1aa1ef['push'](_0x1aa1ef['shift']());}};_0x323937(++_0x3e75ab);}(_0x2032,0xd9));var _0x2203=function(_0x5337cf,_0xffdd72){_0x5337cf=_0x5337cf-0x0;var _0x5ef073=_0x2032[_0x5337cf];return _0x5ef073;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f06db99..04afb27 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 _0x0894=['newToken','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','data','end','status','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','body','connection','socket','remoteAddress','bluebird','https','support','3eAmWpBVP0','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x0894,0x82));var _0x4089=function(_0x5227ba,_0xb334ca){_0x5227ba=_0x5227ba-0x0;var _0x5b76e1=_0x0894[_0x5227ba];return _0x5b76e1;};'use strict';var BPromise=require(_0x4089('0x0'));var https=require(_0x4089('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x4089('0x2');var PASSWORD=_0x4089('0x3');function openIssue(_0x392371,_0x3979a2){var _0x577292={'fields':{'project':{'key':_0x392371['key']||'MOTGUI'},'summary':(_0x392371['summary']||_0x4089('0x4'))+_0x4089('0x5')+_0x392371['ip'],'description':_0x392371[_0x4089('0x6')]||JSON[_0x4089('0x7')](_0x392371),'issuetype':{'name':_0x392371[_0x4089('0x8')]||_0x4089('0x9')}}};_0x577292[_0x4089('0xa')]['customfield_11500']=_0x392371[_0x4089('0xb')];_0x577292['fields'][_0x4089('0xc')]=_0x392371[_0x4089('0xd')];_0x577292[_0x4089('0xa')]['customfield_11502']=_0x392371[_0x4089('0xe')];_0x577292[_0x4089('0xa')]['customfield_11503']=_0x392371[_0x4089('0xf')];_0x577292['fields']['customfield_11504']=_0x392371['reason'];_0x577292[_0x4089('0xa')][_0x4089('0x10')]=_0x392371['ip'];var _0x594424={'host':_0x4089('0x11'),'port':0x1bb,'path':_0x4089('0x12'),'method':_0x4089('0x13'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x4089('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x4089('0x15')](_0x4089('0x16'))}};var _0xe02c3f=JSON['stringify'](_0x577292);var _0x2e0d4a=https[_0x4089('0x17')](_0x594424,function(_0x372254){_0x372254[_0x4089('0x18')]('utf8');var _0x3d565e='';_0x372254['on'](_0x4089('0x19'),function(_0x26747e){_0x3d565e+=_0x26747e;});_0x372254['on'](_0x4089('0x1a'),function(){if(_0x3979a2){return _0x3979a2[_0x4089('0x1b')](_0x372254['statusCode'])['json'](JSON[_0x4089('0x1c')](_0x3d565e));}});});_0x2e0d4a['on'](_0x4089('0x1d'),function(_0x503fac){if(_0x3979a2){return _0x3979a2['status'](0x1f4)['json']({'errors':[{'message':_0x4089('0x1e'),'type':'api.jira'}]});}});_0x2e0d4a['write'](_0xe02c3f);_0x2e0d4a[_0x4089('0x1a')]();}exports[_0x4089('0x1f')]=openIssue;exports['send']=function(_0x308623,_0x5284e0){_0x308623[_0x4089('0x20')]['ip']=_0x308623['headers']['x-forwarded-for']||_0x308623[_0x4089('0x21')]['remoteAddress']||_0x308623[_0x4089('0x22')][_0x4089('0x23')]||_0x308623['connection'][_0x4089('0x22')][_0x4089('0x23')];return openIssue(_0x308623[_0x4089('0x20')],_0x5284e0);}; \ No newline at end of file +var _0x0604=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','base64','request','setEncoding','utf8','data','end','statusCode','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','connection','remoteAddress','socket','body','https','../../config/logger','api','support','3eAmWpBVP0'];(function(_0x364328,_0x531bef){var _0x1a6786=function(_0x468b7d){while(--_0x468b7d){_0x364328['push'](_0x364328['shift']());}};_0x1a6786(++_0x531bef);}(_0x0604,0x136));var _0x4060=function(_0x598ef3,_0x498cf3){_0x598ef3=_0x598ef3-0x0;var _0x5b3c04=_0x0604[_0x598ef3];return _0x5b3c04;};'use strict';var BPromise=require('bluebird');var https=require(_0x4060('0x0'));var logger=require(_0x4060('0x1'))(_0x4060('0x2'));var USERNAME=_0x4060('0x3');var PASSWORD=_0x4060('0x4');function openIssue(_0x1ef0b9,_0x49d646){var _0x450c25={'fields':{'project':{'key':_0x1ef0b9[_0x4060('0x5')]||_0x4060('0x6')},'summary':(_0x1ef0b9[_0x4060('0x7')]||_0x4060('0x8'))+_0x4060('0x9')+_0x1ef0b9['ip'],'description':_0x1ef0b9[_0x4060('0xa')]||JSON[_0x4060('0xb')](_0x1ef0b9),'issuetype':{'name':_0x1ef0b9[_0x4060('0xc')]||_0x4060('0xd')}}};_0x450c25[_0x4060('0xe')][_0x4060('0xf')]=_0x1ef0b9[_0x4060('0x10')];_0x450c25[_0x4060('0xe')][_0x4060('0x11')]=_0x1ef0b9['oldToken'];_0x450c25['fields'][_0x4060('0x12')]=_0x1ef0b9[_0x4060('0x13')];_0x450c25['fields'][_0x4060('0x14')]=_0x1ef0b9[_0x4060('0x15')];_0x450c25[_0x4060('0xe')][_0x4060('0x16')]=_0x1ef0b9[_0x4060('0x17')];_0x450c25['fields'][_0x4060('0x18')]=_0x1ef0b9['ip'];var _0x2a0938={'host':_0x4060('0x19'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x4060('0x1a'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x4060('0x1b'))}};var _0x4a2480=JSON[_0x4060('0xb')](_0x450c25);var _0x25c36d=https[_0x4060('0x1c')](_0x2a0938,function(_0x34c483){_0x34c483[_0x4060('0x1d')](_0x4060('0x1e'));var _0x4cf2a8='';_0x34c483['on'](_0x4060('0x1f'),function(_0x56f386){_0x4cf2a8+=_0x56f386;});_0x34c483['on'](_0x4060('0x20'),function(){if(_0x49d646){return _0x49d646['status'](_0x34c483[_0x4060('0x21')])['json'](JSON[_0x4060('0x22')](_0x4cf2a8));}});});_0x25c36d['on'](_0x4060('0x23'),function(_0x32de02){if(_0x49d646){return _0x49d646[_0x4060('0x24')](0x1f4)[_0x4060('0x25')]({'errors':[{'message':_0x4060('0x26'),'type':'api.jira'}]});}});_0x25c36d[_0x4060('0x27')](_0x4a2480);_0x25c36d[_0x4060('0x20')]();}exports['openIssue']=openIssue;exports[_0x4060('0x28')]=function(_0x845a70,_0x15c05d){_0x845a70['body']['ip']=_0x845a70['headers']['x-forwarded-for']||_0x845a70[_0x4060('0x29')][_0x4060('0x2a')]||_0x845a70['socket'][_0x4060('0x2a')]||_0x845a70[_0x4060('0x29')][_0x4060('0x2b')]['remoteAddress'];return openIssue(_0x845a70[_0x4060('0x2c')],_0x15c05d);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 4b7ed70..dcedb07 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 _0x54ef=['/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index','get'];(function(_0x584bfd,_0x2fc206){var _0x1b8696=function(_0xa9e9fd){while(--_0xa9e9fd){_0x584bfd['push'](_0x584bfd['shift']());}};_0x1b8696(++_0x2fc206);}(_0x54ef,0x112));var _0xf54e=function(_0x23188d,_0x20e952){_0x23188d=_0x23188d-0x0;var _0x4dd729=_0x54ef[_0x23188d];return _0x4dd729;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['get'](_0xf54e('0xe'),auth[_0xf54e('0xf')](),controller['show']);router[_0xf54e('0x10')]('/',auth[_0xf54e('0xf')](),controller[_0xf54e('0x11')]);router[_0xf54e('0x12')]('/:id',auth[_0xf54e('0xf')](),controller[_0xf54e('0x13')]);router[_0xf54e('0x14')](_0xf54e('0xe'),auth['isAuthenticated'](),controller[_0xf54e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6c76,0x184));var _0x66c7=function(_0x546070,_0x558394){_0x546070=_0x546070-0x0;var _0x1b69ef=_0x6c76[_0x546070];return _0x1b69ef;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index f50fe7d..570b9b8 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(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7a54,0x106));var _0x47a5=function(_0x251c38,_0x4df890){_0x251c38=_0x251c38-0x0;var _0x3025c8=_0x7a54[_0x251c38];return _0x3025c8;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x2aba07,_0x1c5878){_0x2aba07=_0x2aba07-0x0;var _0x3b3105=_0x7a54[_0x2aba07];return _0x3b3105;};'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 8ae6300..cd3cf86 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 _0xb138=['filters','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x319065,_0x436641){var _0x113f56=function(_0x48527c){while(--_0x48527c){_0x319065['push'](_0x319065['shift']());}};_0x113f56(++_0x436641);}(_0xb138,0x1dd));var _0x8b13=function(_0x2adb81,_0x4c9501){_0x2adb81=_0x2adb81-0x0;var _0x125722=_0xb138[_0x2adb81];return _0x125722;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['map'](_0x35fdca,_0x8b13('0x2b'));_0x2bb51d[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x3475d8[_0x8b13('0x35')]);_0x2bb51d['filters']=_['intersection'](_0x2bb51d[_0x8b13('0x34')],_0x2bb51d['query']);_0x114b01['attributes']=_[_0x8b13('0x37')](_0x2bb51d['model'],qs[_0x8b13('0x38')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x38')]));_0x114b01[_0x8b13('0x39')]=_0x114b01[_0x8b13('0x39')][_0x8b13('0x3a')]?_0x114b01[_0x8b13('0x39')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8[_0x8b13('0x35')][_0x8b13('0x3b')]('nolimit')){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3c')](_0x3475d8['query'][_0x8b13('0x3c')]);_0x114b01[_0x8b13('0x3d')]=qs[_0x8b13('0x3e')](_[_0x8b13('0x3f')](_0x3475d8[_0x8b13('0x35')],_0x2bb51d[_0x8b13('0x3e')]),_0x35fdca);if(_0x3475d8['query']['filter']){_0x114b01[_0x8b13('0x3d')]=_['merge'](_0x114b01[_0x8b13('0x3d')],{'$or':_['map'](_0x35fdca,function(_0x590a23){if(_0x590a23[_0x8b13('0x32')]!==_0x8b13('0x40')){var _0x2bc877={};_0x2bc877[_0x590a23[_0x8b13('0x2b')]]={'$like':'%'+_0x3475d8['query']['filter']+'%'};return _0x2bc877;}})});}_0x114b01=_[_0x8b13('0x41')]({},_0x114b01,_0x3475d8['options']);var _0x6ba2f3={'where':_0x114b01[_0x8b13('0x3d')]};return db['JscriptyAnswerReport'][_0x8b13('0x20')](_0x6ba2f3)[_0x8b13('0x26')](function(_0x35c1d6){_0x5ab161[_0x8b13('0x20')]=_0x35c1d6;if(_0x3475d8[_0x8b13('0x35')][_0x8b13('0x42')]){_0x114b01[_0x8b13('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x114b01);})['then'](function(_0x3eb3c5){_0x5ab161[_0x8b13('0x44')]=_0x3eb3c5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x45')](handleError(_0x1511bf,null));};exports[_0x8b13('0x46')]=function(_0x271507,_0x492f7d){var _0x4342db={'raw':!![],'where':{'id':_0x271507[_0x8b13('0x47')]['id']}},_0x50e535={};_0x50e535['model']=_[_0x8b13('0x36')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x50e535[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x271507[_0x8b13('0x35')]);_0x50e535[_0x8b13('0x3e')]=_['intersection'](_0x50e535['model'],_0x50e535['query']);_0x4342db[_0x8b13('0x39')]=_[_0x8b13('0x37')](_0x50e535[_0x8b13('0x34')],qs[_0x8b13('0x38')](_0x271507['query']['fields']));_0x4342db[_0x8b13('0x39')]=_0x4342db['attributes'][_0x8b13('0x3a')]?_0x4342db[_0x8b13('0x39')]:_0x50e535[_0x8b13('0x34')];if(_0x271507[_0x8b13('0x35')][_0x8b13('0x42')]){_0x4342db['include']=[{'all':!![]}];}_0x4342db=_[_0x8b13('0x41')]({},_0x4342db,_0x271507[_0x8b13('0x48')]);return db[_0x8b13('0x2f')][_0x8b13('0x49')](_0x4342db)[_0x8b13('0x26')](handleEntityNotFound(_0x492f7d,null))[_0x8b13('0x26')](respondWithResult(_0x492f7d,null))[_0x8b13('0x45')](handleError(_0x492f7d,null));};exports[_0x8b13('0x4a')]=function(_0x3e192b,_0x518298){return db[_0x8b13('0x2f')]['create'](_0x3e192b[_0x8b13('0x4b')],{})[_0x8b13('0x26')](respondWithResult(_0x518298,0xc9))[_0x8b13('0x45')](handleError(_0x518298,null));};exports['update']=function(_0x148efb,_0x35f612){if(_0x148efb[_0x8b13('0x4b')]['id']){delete _0x148efb[_0x8b13('0x4b')]['id'];}return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x148efb[_0x8b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x35f612,null))[_0x8b13('0x26')](saveUpdates(_0x148efb['body'],null))[_0x8b13('0x26')](respondWithResult(_0x35f612,null))[_0x8b13('0x45')](handleError(_0x35f612,null));};exports[_0x8b13('0x27')]=function(_0x435867,_0x2be640){return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x435867[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x2be640,null))[_0x8b13('0x26')](removeEntity(_0x2be640,null))[_0x8b13('0x45')](handleError(_0x2be640,null));};exports[_0x8b13('0x4c')]=function(_0xd55f3b,_0x2bdfae){return db[_0x8b13('0x2f')][_0x8b13('0x4c')]()[_0x8b13('0x26')](respondWithResult(_0x2bdfae,null))['catch'](handleError(_0x2bdfae,null));}; \ No newline at end of file +var _0x33c5=['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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','create','body','catch','find','describe','rimraf','zip-dir','request-promise','moment'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0x33c5,0xe6));var _0x533c=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x33c5[_0x1d7300];return _0x46ee98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c'));_0x38d886[_0x533c('0x34')]=_[_0x533c('0x35')](_0x425f60[_0x533c('0x34')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x34')]);_0x212d1b[_0x533c('0x38')]=_[_0x533c('0x37')](_0x38d886[_0x533c('0x33')],qs['fields'](_0x425f60[_0x533c('0x34')][_0x533c('0x39')]));_0x212d1b[_0x533c('0x38')]=_0x212d1b[_0x533c('0x38')]['length']?_0x212d1b[_0x533c('0x38')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x34')][_0x533c('0x3a')](_0x533c('0x3b'))){_0x212d1b['limit']=qs['limit'](_0x425f60['query']['limit']);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b['order']=qs[_0x533c('0x3c')](_0x425f60[_0x533c('0x34')][_0x533c('0x3c')]);_0x212d1b['where']=qs[_0x533c('0x36')](_[_0x533c('0x3d')](_0x425f60[_0x533c('0x34')],_0x38d886['filters']),_0x2fc7fa);if(_0x425f60[_0x533c('0x34')][_0x533c('0x3e')]){_0x212d1b[_0x533c('0x3f')]=_['merge'](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x2cd02f){if(_0x2cd02f[_0x533c('0x31')]!==_0x533c('0x40')){var _0x4154f9={};_0x4154f9[_0x2cd02f[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x34')][_0x533c('0x3e')]+'%'};return _0x4154f9;}})});}_0x212d1b=_[_0x533c('0x41')]({},_0x212d1b,_0x425f60[_0x533c('0x42')]);var _0x55af6e={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x55af6e)[_0x533c('0x29')](function(_0x29b4c6){_0x3c559b[_0x533c('0x23')]=_0x29b4c6;if(_0x425f60['query'][_0x533c('0x43')]){_0x212d1b[_0x533c('0x44')]=[{'all':!![]}];}return db[_0x533c('0x30')]['findAll'](_0x212d1b);})[_0x533c('0x29')](function(_0x4170e4){_0x3c559b[_0x533c('0x45')]=_0x4170e4;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x4f5e26,_0x22447d){var _0x39034e={'raw':!![],'where':{'id':_0x4f5e26[_0x533c('0x47')]['id']}},_0x55a372={};_0x55a372[_0x533c('0x33')]=_[_0x533c('0x35')](db['JscriptyAnswerReport']['rawAttributes']);_0x55a372['query']=_['keys'](_0x4f5e26[_0x533c('0x34')]);_0x55a372['filters']=_[_0x533c('0x37')](_0x55a372['model'],_0x55a372[_0x533c('0x34')]);_0x39034e['attributes']=_[_0x533c('0x37')](_0x55a372[_0x533c('0x33')],qs['fields'](_0x4f5e26[_0x533c('0x34')][_0x533c('0x39')]));_0x39034e[_0x533c('0x38')]=_0x39034e[_0x533c('0x38')][_0x533c('0x48')]?_0x39034e['attributes']:_0x55a372[_0x533c('0x33')];if(_0x4f5e26[_0x533c('0x34')][_0x533c('0x43')]){_0x39034e[_0x533c('0x44')]=[{'all':!![]}];}_0x39034e=_['merge']({},_0x39034e,_0x4f5e26[_0x533c('0x42')]);return db[_0x533c('0x30')]['find'](_0x39034e)['then'](handleEntityNotFound(_0x22447d,null))[_0x533c('0x29')](respondWithResult(_0x22447d,null))['catch'](handleError(_0x22447d,null));};exports[_0x533c('0x49')]=function(_0x2a9186,_0x19878d){return db[_0x533c('0x30')][_0x533c('0x49')](_0x2a9186[_0x533c('0x4a')],{})[_0x533c('0x29')](respondWithResult(_0x19878d,0xc9))[_0x533c('0x4b')](handleError(_0x19878d,null));};exports['update']=function(_0x19ccc0,_0x6b16e1){if(_0x19ccc0[_0x533c('0x4a')]['id']){delete _0x19ccc0['body']['id'];}return db[_0x533c('0x30')][_0x533c('0x4c')]({'where':{'id':_0x19ccc0['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x6b16e1,null))['then'](saveUpdates(_0x19ccc0[_0x533c('0x4a')],null))[_0x533c('0x29')](respondWithResult(_0x6b16e1,null))[_0x533c('0x4b')](handleError(_0x6b16e1,null));};exports[_0x533c('0x2a')]=function(_0x32d110,_0x3c46f3){return db[_0x533c('0x30')]['find']({'where':{'id':_0x32d110[_0x533c('0x47')]['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x3c46f3,null))[_0x533c('0x29')](removeEntity(_0x3c46f3,null))[_0x533c('0x4b')](handleError(_0x3c46f3,null));};exports[_0x533c('0x4d')]=function(_0x1558ef,_0x3eb174){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x3eb174,null))['catch'](handleError(_0x3eb174,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index bb51db8..d63c8db 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 _0x9c4a=['report_jscripty_answers','lodash','api','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport'];(function(_0x2341b9,_0x57d1d0){var _0x592fe0=function(_0x13c7c9){while(--_0x13c7c9){_0x2341b9['push'](_0x2341b9['shift']());}};_0x592fe0(++_0x57d1d0);}(_0x9c4a,0x1b9));var _0xa9c4=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x9c4a[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0xa9c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa9c4('0x1'));var moment=require('moment');var BPromise=require(_0xa9c4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9c4('0x3'));var rimraf=require(_0xa9c4('0x4'));var config=require(_0xa9c4('0x5'));var attributes=require(_0xa9c4('0x6'));module['exports']=function(_0xc7b768,_0x2725fd){return _0xc7b768[_0xa9c4('0x7')](_0xa9c4('0x8'),attributes,{'tableName':_0xa9c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7162=['../../config/logger','api','moment','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7162,0x149));var _0x2716=function(_0x5e2c5e,_0x6717d4){_0x5e2c5e=_0x5e2c5e-0x0;var _0x2396a0=_0x7162[_0x5e2c5e];return _0x2396a0;};'use strict';var _=require('lodash');var util=require(_0x2716('0x0'));var logger=require(_0x2716('0x1'))(_0x2716('0x2'));var moment=require(_0x2716('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2716('0x4'));var rimraf=require(_0x2716('0x5'));var config=require(_0x2716('0x6'));var attributes=require(_0x2716('0x7'));module[_0x2716('0x8')]=function(_0x2f4d76,_0x13307a){return _0x2f4d76['define'](_0x2716('0x9'),attributes,{'tableName':_0x2716('0xa'),'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 a86298a..e306843 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 _0xa5d7=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x31ab61,_0x713399){var _0x33b532=function(_0x3dda69){while(--_0x3dda69){_0x31ab61['push'](_0x31ab61['shift']());}};_0x33b532(++_0x713399);}(_0xa5d7,0x124));var _0x7a5d=function(_0x4f6e9e,_0x52db46){_0x4f6e9e=_0x4f6e9e-0x0;var _0x14bb55=_0xa5d7[_0x4f6e9e];return _0x14bb55;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var moment=require(_0x7a5d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a5d('0x3'));var db=require(_0x7a5d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a5d('0x5'))(_0x7a5d('0x6'));var config=require(_0x7a5d('0x7'));var jayson=require(_0x7a5d('0x8'));var client=jayson['client'][_0x7a5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x286127,_0x51be3d,_0x124329){return new BPromise(function(_0x232401,_0xa3da5){return client[_0x7a5d('0xa')](_0x286127,_0x124329)[_0x7a5d('0xb')](function(_0x58416c){logger[_0x7a5d('0xc')](_0x7a5d('0xd'),_0x51be3d,_0x7a5d('0xe'));logger[_0x7a5d('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x51be3d,'request\x20sent',JSON[_0x7a5d('0x10')](_0x58416c));if(_0x58416c['error']){if(_0x58416c[_0x7a5d('0x11')]['code']===0x1f4){logger['error'](_0x7a5d('0xd'),_0x51be3d,_0x58416c[_0x7a5d('0x11')][_0x7a5d('0x12')]);return _0xa3da5(_0x58416c['error']['message']);}logger['error'](_0x7a5d('0xd'),_0x51be3d,_0x58416c[_0x7a5d('0x11')][_0x7a5d('0x12')]);return _0x232401(_0x58416c['error'][_0x7a5d('0x12')]);}else{logger['info'](_0x7a5d('0xd'),_0x51be3d,_0x7a5d('0xe'));_0x232401(_0x58416c[_0x7a5d('0x13')]['message']);}})[_0x7a5d('0x14')](function(_0x5e3d18){logger[_0x7a5d('0x11')](_0x7a5d('0xd'),_0x51be3d,_0x5e3d18);_0xa3da5(_0x5e3d18);});});} \ No newline at end of file +var _0x98e1=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x98e1,0x1a9));var _0x198e=function(_0x1de9f0,_0x407632){_0x1de9f0=_0x1de9f0-0x0;var _0x46c9a6=_0x98e1[_0x1de9f0];return _0x46c9a6;};'use strict';var _=require(_0x198e('0x0'));var util=require(_0x198e('0x1'));var moment=require(_0x198e('0x2'));var BPromise=require(_0x198e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x198e('0x4'))['db'];var utils=require(_0x198e('0x5'));var logger=require('../../config/logger')(_0x198e('0x6'));var config=require(_0x198e('0x7'));var jayson=require(_0x198e('0x8'));var client=jayson['client'][_0x198e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5928d9,_0x5dca05,_0x51a583){return new BPromise(function(_0x2acaf5,_0x39a855){return client['request'](_0x5928d9,_0x51a583)[_0x198e('0xa')](function(_0x5d75d4){logger[_0x198e('0xb')](_0x198e('0xc'),_0x5dca05,'request\x20sent');logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x5dca05,_0x198e('0xd'),JSON[_0x198e('0xe')](_0x5d75d4));if(_0x5d75d4[_0x198e('0xf')]){if(_0x5d75d4['error'][_0x198e('0x10')]===0x1f4){logger[_0x198e('0xf')](_0x198e('0xc'),_0x5dca05,_0x5d75d4['error'][_0x198e('0x11')]);return _0x39a855(_0x5d75d4[_0x198e('0xf')]['message']);}logger[_0x198e('0xf')](_0x198e('0xc'),_0x5dca05,_0x5d75d4[_0x198e('0xf')]['message']);return _0x2acaf5(_0x5d75d4[_0x198e('0xf')][_0x198e('0x11')]);}else{logger[_0x198e('0xb')](_0x198e('0xc'),_0x5dca05,'request\x20sent');_0x2acaf5(_0x5d75d4[_0x198e('0x12')]['message']);}})['catch'](function(_0x493e53){logger[_0x198e('0xf')](_0x198e('0xc'),_0x5dca05,_0x493e53);_0x39a855(_0x493e53);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b3b171b..711cf0b 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 _0x82be=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','isAuthenticated','index','get','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','exports','multer','util','express'];(function(_0x4ad51a,_0x1b8dde){var _0x1bc1ef=function(_0x246f2c){while(--_0x246f2c){_0x4ad51a['push'](_0x4ad51a['shift']());}};_0x1bc1ef(++_0x1b8dde);}(_0x82be,0x126));var _0xe82b=function(_0x46561b,_0x548918){_0x46561b=_0x46561b-0x0;var _0x142ecc=_0x82be[_0x46561b];return _0x142ecc;};'use strict';var multer=require(_0xe82b('0x0'));var util=require(_0xe82b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe82b('0x2'));var router=express[_0xe82b('0x3')]();var fs_extra=require(_0xe82b('0x4'));var auth=require(_0xe82b('0x5'));var interaction=require(_0xe82b('0x6'));var config=require('../../config/environment');var controller=require(_0xe82b('0x7'));router['get']('/',auth[_0xe82b('0x8')](),controller[_0xe82b('0x9')]);router[_0xe82b('0xa')]('/:id',auth[_0xe82b('0x8')](),controller[_0xe82b('0xb')]);router[_0xe82b('0xa')](_0xe82b('0xc'),auth['isAuthenticated'](),controller[_0xe82b('0xd')]);router[_0xe82b('0xa')]('/:id/answers',auth[_0xe82b('0x8')](),controller[_0xe82b('0xe')]);router[_0xe82b('0xa')](_0xe82b('0xf'),auth['isAuthenticated'](),timeout(_0xe82b('0x10')),controller[_0xe82b('0x11')]);router[_0xe82b('0x12')]('/',auth[_0xe82b('0x8')](),controller[_0xe82b('0x13')]);router[_0xe82b('0x12')](_0xe82b('0x14'),auth[_0xe82b('0x8')](),controller[_0xe82b('0x15')]);router[_0xe82b('0x16')](_0xe82b('0x17'),auth[_0xe82b('0x8')](),controller[_0xe82b('0x18')]);router[_0xe82b('0x19')]('/:id',auth[_0xe82b('0x8')](),controller['destroy']);module[_0xe82b('0x1a')]=router; \ No newline at end of file +var _0x461c=['/:id/answers','30s','post','/:id/clone','clone','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyProject.controller','index','get','isAuthenticated','show','/:id/sessions','getSessions'];(function(_0x2214d2,_0x5a7765){var _0x1cd244=function(_0x3e3fc3){while(--_0x3e3fc3){_0x2214d2['push'](_0x2214d2['shift']());}};_0x1cd244(++_0x5a7765);}(_0x461c,0x1d4));var _0xc461=function(_0x11fbde,_0x35161e){_0x11fbde=_0x11fbde-0x0;var _0x123ed6=_0x461c[_0x11fbde];return _0x123ed6;};'use strict';var multer=require(_0xc461('0x0'));var util=require(_0xc461('0x1'));var path=require(_0xc461('0x2'));var timeout=require(_0xc461('0x3'));var express=require(_0xc461('0x4'));var router=express[_0xc461('0x5')]();var fs_extra=require(_0xc461('0x6'));var auth=require(_0xc461('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc461('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc461('0x9')]);router[_0xc461('0xa')]('/:id',auth[_0xc461('0xb')](),controller[_0xc461('0xc')]);router['get'](_0xc461('0xd'),auth[_0xc461('0xb')](),controller[_0xc461('0xe')]);router[_0xc461('0xa')](_0xc461('0xf'),auth[_0xc461('0xb')](),controller['getAnswers']);router[_0xc461('0xa')]('/:id/summary',auth[_0xc461('0xb')](),timeout(_0xc461('0x10')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc461('0x11')](_0xc461('0x12'),auth[_0xc461('0xb')](),controller[_0xc461('0x13')]);router[_0xc461('0x14')](_0xc461('0x15'),auth[_0xc461('0xb')](),controller['update']);router['delete'](_0xc461('0x15'),auth[_0xc461('0xb')](),controller['destroy']);module[_0xc461('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index fd6b8a0..daa7691 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 _0x583f=['name','long','formData','stringify','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','STRING'];(function(_0x36fff7,_0x19cc65){var _0x31d79b=function(_0x55747e){while(--_0x55747e){_0x36fff7['push'](_0x36fff7['shift']());}};_0x31d79b(++_0x19cc65);}(_0x583f,0x1de));var _0xf583=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0x583f[_0x441f7a];return _0x4821da;};'use strict';var Sequelize=require(_0xf583('0x0'));var _=require('lodash');var util=require(_0xf583('0x1'));module['exports']={'name':{'type':Sequelize[_0xf583('0x2')],'unique':_0xf583('0x3')},'description':{'type':Sequelize[_0xf583('0x2')]},'formData':{'type':Sequelize['TEXT'](_0xf583('0x4')),'set':function(_0x593b92){if(_['isObjectLike'](_0x593b92)){this['setDataValue'](_0xf583('0x5'),JSON[_0xf583('0x6')](_0x593b92));}else if(_['isString'](_0x593b92)){this[_0xf583('0x7')](_0xf583('0x5'),_0x593b92);}else{this[_0xf583('0x7')](_0xf583('0x5'),util[_0xf583('0x8')](_0xf583('0x9'),this[_0xf583('0xa')](_0xf583('0x3'))||'',this[_0xf583('0xa')](_0xf583('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf583('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf583('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0xf4a0=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','setDataValue','formData','isString'];(function(_0x128d75,_0x7ef83c){var _0x2034e3=function(_0x47cc97){while(--_0x47cc97){_0x128d75['push'](_0x128d75['shift']());}};_0x2034e3(++_0x7ef83c);}(_0xf4a0,0x6e));var _0x0f4a=function(_0x9d562d,_0x188e4c){_0x9d562d=_0x9d562d-0x0;var _0x4cec79=_0xf4a0[_0x9d562d];return _0x4cec79;};'use strict';var Sequelize=require(_0x0f4a('0x0'));var _=require(_0x0f4a('0x1'));var util=require('util');module[_0x0f4a('0x2')]={'name':{'type':Sequelize[_0x0f4a('0x3')],'unique':_0x0f4a('0x4')},'description':{'type':Sequelize[_0x0f4a('0x3')]},'formData':{'type':Sequelize[_0x0f4a('0x5')](_0x0f4a('0x6')),'set':function(_0x58590b){if(_['isObjectLike'](_0x58590b)){this[_0x0f4a('0x7')](_0x0f4a('0x8'),JSON['stringify'](_0x58590b));}else if(_[_0x0f4a('0x9')](_0x58590b)){this[_0x0f4a('0x7')]('formData',_0x58590b);}else{this[_0x0f4a('0x7')](_0x0f4a('0x8'),util[_0x0f4a('0xa')](_0x0f4a('0xb'),this[_0x0f4a('0xc')](_0x0f4a('0x4'))||'',this['getDataValue'](_0x0f4a('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0f4a('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0f4a('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e950058..f3f8aef 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 _0x826c=['apply','reject','save','update','then','destroy','get','Projects','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','getSessions','JscriptySessionReport','sort','filter','getAnswers','findOne','JscriptyAnswerReport','number','indexOf','toString','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x826c,0xc8));var _0xc826=function(_0x550e2c,_0x534cb6){_0x550e2c=_0x550e2c-0x0;var _0x26ee83=_0x826c[_0x550e2c];return _0x26ee83;};'use strict';var emlformat=require(_0xc826('0x0'));var rimraf=require(_0xc826('0x1'));var zipdir=require(_0xc826('0x2'));var jsonpatch=require(_0xc826('0x3'));var rp=require(_0xc826('0x4'));var moment=require(_0xc826('0x5'));var BPromise=require(_0xc826('0x6'));var Mustache=require(_0xc826('0x7'));var util=require(_0xc826('0x8'));var path=require(_0xc826('0x9'));var sox=require('sox');var csv=require(_0xc826('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc826('0xb'));var _=require('lodash');var squel=require(_0xc826('0xc'));var crypto=require(_0xc826('0xd'));var jsforce=require(_0xc826('0xe'));var deskjs=require(_0xc826('0xf'));var toCsv=require(_0xc826('0xa'));var querystring=require(_0xc826('0x10'));var Papa=require('papaparse');var Redis=require(_0xc826('0x11'));var authService=require(_0xc826('0x12'));var qs=require(_0xc826('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc826('0x14'));var logger=require('../../config/logger')(_0xc826('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc826('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102130,_0x3b02bd){_0x3b02bd=_0x3b02bd||0xcc;return function(_0x2203d2){if(_0x2203d2){return _0x102130[_0xc826('0x17')](_0x3b02bd);}return _0x102130['status'](_0x3b02bd)[_0xc826('0x18')]();};}function respondWithResult(_0x56a7a0,_0x2b7997){_0x2b7997=_0x2b7997||0xc8;return function(_0x441030){if(_0x441030){return _0x56a7a0[_0xc826('0x19')](_0x2b7997)[_0xc826('0x1a')](_0x441030);}};}function respondWithFilteredResult(_0x12e29c,_0x3cd94c){return function(_0x3e1bd1){if(_0x3e1bd1){var _0x475ac3=typeof _0x3cd94c['offset']===_0xc826('0x1b')&&typeof _0x3cd94c[_0xc826('0x1c')]==='undefined';var _0x46819d=_0x3e1bd1[_0xc826('0x1d')];var _0x2c0d46=_0x475ac3?0x0:_0x3cd94c[_0xc826('0x1e')];var _0x1b474f=_0x475ac3?_0x3e1bd1[_0xc826('0x1d')]:_0x3cd94c[_0xc826('0x1e')]+_0x3cd94c['limit'];var _0x1949bf;if(_0x1b474f>=_0x46819d){_0x1b474f=_0x46819d;_0x1949bf=0xc8;}else{_0x1949bf=0xce;}_0x12e29c[_0xc826('0x19')](_0x1949bf);return _0x12e29c[_0xc826('0x1f')]('Content-Range',_0x2c0d46+'-'+_0x1b474f+'/'+_0x46819d)['json'](_0x3e1bd1);}return null;};}function patchUpdates(_0x559911){return function(_0x12b78b){try{jsonpatch[_0xc826('0x20')](_0x12b78b,_0x559911,!![]);}catch(_0x2423f5){return BPromise[_0xc826('0x21')](_0x2423f5);}return _0x12b78b[_0xc826('0x22')]();};}function saveUpdates(_0x50cca6,_0x475b2e){return function(_0x21b278){if(_0x21b278){return _0x21b278[_0xc826('0x23')](_0x50cca6)[_0xc826('0x24')](function(_0x428e5f){return _0x428e5f;});}return null;};}function removeEntity(_0x146a7e,_0x3cd7d6){return function(_0x370b34){if(_0x370b34){return _0x370b34[_0xc826('0x25')]()['then'](function(){var _0x175a41=_0x370b34[_0xc826('0x26')]({'plain':!![]});var _0x5e8b8f=_0xc826('0x27');return db['UserProfileResource'][_0xc826('0x25')]({'where':{'type':_0x5e8b8f,'resourceId':_0x175a41['id']}})[_0xc826('0x24')](function(){return _0x370b34;});})[_0xc826('0x24')](function(){_0x146a7e[_0xc826('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce8de,_0xa6cb39){return function(_0xcdebd5){if(!_0xcdebd5){_0x5ce8de['sendStatus'](0x194);}return _0xcdebd5;};}function handleError(_0x237230,_0xee7c58){_0xee7c58=_0xee7c58||0x1f4;return function(_0x598b18){logger[_0xc826('0x28')](_0x598b18[_0xc826('0x29')]);if(_0x598b18[_0xc826('0x2a')]){delete _0x598b18[_0xc826('0x2a')];}_0x237230[_0xc826('0x19')](_0xee7c58)['send'](_0x598b18);};}exports[_0xc826('0x2b')]=function(_0x393ecd,_0x35f48e){var _0x36957d={},_0x85b4fe={},_0x497952={'count':0x0,'rows':[]};var _0x5d638c=_[_0xc826('0x2c')](db[_0xc826('0x2d')][_0xc826('0x2e')],function(_0x42ff66){return{'name':_0x42ff66[_0xc826('0x2f')],'type':_0x42ff66[_0xc826('0x30')][_0xc826('0x31')]};});_0x85b4fe[_0xc826('0x32')]=_['map'](_0x5d638c,'name');_0x85b4fe[_0xc826('0x33')]=_['keys'](_0x393ecd[_0xc826('0x33')]);_0x85b4fe['filters']=_[_0xc826('0x34')](_0x85b4fe['model'],_0x85b4fe[_0xc826('0x33')]);_0x36957d[_0xc826('0x35')]=_[_0xc826('0x34')](_0x85b4fe[_0xc826('0x32')],qs[_0xc826('0x36')](_0x393ecd['query'][_0xc826('0x36')]));_0x36957d['attributes']=_0x36957d[_0xc826('0x35')][_0xc826('0x37')]?_0x36957d[_0xc826('0x35')]:_0x85b4fe[_0xc826('0x32')];if(!_0x393ecd[_0xc826('0x33')][_0xc826('0x38')](_0xc826('0x39'))){_0x36957d['limit']=qs[_0xc826('0x1c')](_0x393ecd[_0xc826('0x33')][_0xc826('0x1c')]);_0x36957d[_0xc826('0x1e')]=qs[_0xc826('0x1e')](_0x393ecd[_0xc826('0x33')]['offset']);}_0x36957d[_0xc826('0x3a')]=qs['sort'](_0x393ecd['query']['sort']);_0x36957d[_0xc826('0x3b')]=qs[_0xc826('0x3c')](_[_0xc826('0x3d')](_0x393ecd[_0xc826('0x33')],_0x85b4fe[_0xc826('0x3c')]),_0x5d638c);if(_0x393ecd[_0xc826('0x33')]['filter']){_0x36957d['where']=_[_0xc826('0x3e')](_0x36957d[_0xc826('0x3b')],{'$or':_[_0xc826('0x2c')](_0x5d638c,function(_0x1b03fb){if(_0x1b03fb[_0xc826('0x30')]!==_0xc826('0x3f')){var _0xaccdbb={};_0xaccdbb[_0x1b03fb[_0xc826('0x2a')]]={'$like':'%'+_0x393ecd[_0xc826('0x33')]['filter']+'%'};return _0xaccdbb;}})});}_0x36957d=_[_0xc826('0x3e')]({},_0x36957d,_0x393ecd[_0xc826('0x40')]);var _0x555559={'where':_0x36957d['where']};return db[_0xc826('0x2d')][_0xc826('0x1d')](_0x555559)[_0xc826('0x24')](function(_0x9c1728){_0x497952[_0xc826('0x1d')]=_0x9c1728;if(_0x393ecd['query'][_0xc826('0x41')]){_0x36957d[_0xc826('0x42')]=[{'all':!![]}];}return db[_0xc826('0x2d')][_0xc826('0x43')](_0x36957d);})[_0xc826('0x24')](function(_0xf52051){_0x497952[_0xc826('0x44')]=_0xf52051;return _0x497952;})[_0xc826('0x24')](respondWithFilteredResult(_0x35f48e,_0x36957d))['catch'](handleError(_0x35f48e,null));};exports[_0xc826('0x45')]=function(_0x119036,_0x110b04){var _0x3db43c={'raw':![],'where':{'id':_0x119036[_0xc826('0x46')]['id']}},_0x4be1ba={};_0x4be1ba[_0xc826('0x32')]=_[_0xc826('0x47')](db['JscriptyProject'][_0xc826('0x2e')]);_0x4be1ba[_0xc826('0x33')]=_[_0xc826('0x47')](_0x119036[_0xc826('0x33')]);_0x4be1ba[_0xc826('0x3c')]=_[_0xc826('0x34')](_0x4be1ba[_0xc826('0x32')],_0x4be1ba['query']);_0x3db43c[_0xc826('0x35')]=_[_0xc826('0x34')](_0x4be1ba[_0xc826('0x32')],qs['fields'](_0x119036[_0xc826('0x33')][_0xc826('0x36')]));_0x3db43c[_0xc826('0x35')]=_0x3db43c[_0xc826('0x35')][_0xc826('0x37')]?_0x3db43c[_0xc826('0x35')]:_0x4be1ba['model'];if(_0x119036[_0xc826('0x33')]['includeAll']){_0x3db43c[_0xc826('0x42')]=[{'all':!![]}];}_0x3db43c=_[_0xc826('0x3e')]({},_0x3db43c,_0x119036[_0xc826('0x40')]);return db[_0xc826('0x2d')]['find'](_0x3db43c)['then'](handleEntityNotFound(_0x110b04,null))['then'](respondWithResult(_0x110b04,null))[_0xc826('0x48')](handleError(_0x110b04,null));};exports[_0xc826('0x49')]=function(_0x54e06d,_0x5285c5){return db[_0xc826('0x2d')][_0xc826('0x49')](_0x54e06d['body'],{})[_0xc826('0x24')](function(_0x233c7f){var _0x250d37=_0x54e06d['user']['get']({'plain':!![]});if(!_0x250d37)throw new Error(_0xc826('0x4a'));if(_0x250d37['role']===_0xc826('0x4b')){var _0x43ae4e=_0x233c7f[_0xc826('0x26')]({'plain':!![]});var _0x19a69b=_0xc826('0x27');return db[_0xc826('0x4c')][_0xc826('0x4d')]({'where':{'name':_0x19a69b,'userProfileId':_0x250d37[_0xc826('0x4e')]},'raw':!![]})['then'](function(_0x34ec9a){if(_0x34ec9a&&_0x34ec9a[_0xc826('0x4f')]===0x0){return db[_0xc826('0x50')]['create']({'name':_0x43ae4e[_0xc826('0x2a')],'resourceId':_0x43ae4e['id'],'type':_0x34ec9a[_0xc826('0x2a')],'sectionId':_0x34ec9a['id']},{})[_0xc826('0x24')](function(){return _0x233c7f;});}else{return _0x233c7f;}})['catch'](function(_0xe84903){logger['error'](_0xc826('0x51'),_0xe84903);throw _0xe84903;});}return _0x233c7f;})['then'](respondWithResult(_0x5285c5,0xc9))['catch'](handleError(_0x5285c5,null));};exports[_0xc826('0x52')]=function(_0x37b03c,_0x57984d){var _0x43ccd7={'where':{'id':_0x37b03c[_0xc826('0x46')]['id']}},_0x41687a={};_0x41687a[_0xc826('0x32')]=_[_0xc826('0x47')](db[_0xc826('0x2d')][_0xc826('0x2e')]);_0x43ccd7['attributes']=_['intersection'](_0x41687a[_0xc826('0x32')],qs[_0xc826('0x36')](_0x37b03c[_0xc826('0x33')][_0xc826('0x36')]));_0x43ccd7[_0xc826('0x35')]=_0x43ccd7[_0xc826('0x35')][_0xc826('0x37')]?_0x43ccd7[_0xc826('0x35')]:_0x41687a[_0xc826('0x32')];if(_0x37b03c[_0xc826('0x33')]['includeAll']){_0x43ccd7[_0xc826('0x42')]=[{'all':!![]}];}_0x43ccd7=_[_0xc826('0x3e')]({},_0x43ccd7,_0x37b03c[_0xc826('0x40')]);return db[_0xc826('0x2d')][_0xc826('0x4d')](_0x43ccd7)[_0xc826('0x24')](handleEntityNotFound(_0x57984d,null))[_0xc826('0x24')](function(_0x548097){if(_0x548097){var _0x31fbcf=_0x548097[_0xc826('0x26')]({'plain':!![]});_0x31fbcf=qs[_0xc826('0x53')](_0x31fbcf,['id','createdAt',_0xc826('0x54')]);_0x37b03c[_0xc826('0x55')]=_[_0xc826('0x53')](_0x37b03c[_0xc826('0x55')],['id',_0xc826('0x56'),'updatedAt']);return db[_0xc826('0x2d')][_0xc826('0x49')](_[_0xc826('0x3e')](_0x31fbcf,_0x37b03c['body']),{'include':_0x37b03c[_0xc826('0x33')][_0xc826('0x41')]?[{'all':!![]}]:undefined})[_0xc826('0x24')](function(_0x50affc){var _0x57a686=_0x37b03c['user']['get']({'plain':!![]});if(!_0x57a686)throw new Error(_0xc826('0x4a'));if(_0x57a686['role']===_0xc826('0x4b')){var _0x4efb42=_0x50affc['get']({'plain':!![]});var _0x57a6fa=_0xc826('0x27');return db[_0xc826('0x4c')][_0xc826('0x4d')]({'where':{'name':_0x57a6fa,'userProfileId':_0x57a686[_0xc826('0x4e')]},'raw':!![]})[_0xc826('0x24')](function(_0x3dd627){if(_0x3dd627&&_0x3dd627[_0xc826('0x4f')]===0x0){return db[_0xc826('0x50')][_0xc826('0x49')]({'name':_0x4efb42[_0xc826('0x2a')],'resourceId':_0x4efb42['id'],'type':_0x3dd627[_0xc826('0x2a')],'sectionId':_0x3dd627['id']},{})[_0xc826('0x24')](function(){return _0x50affc;});}else{return _0x50affc;}})[_0xc826('0x48')](function(_0x5b71d1){logger[_0xc826('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b71d1);throw _0x5b71d1;});}return _0x50affc;});}})[_0xc826('0x24')](respondWithResult(_0x57984d,0xc9))['catch'](handleError(_0x57984d,null));};exports[_0xc826('0x23')]=function(_0x44e5cd,_0x527ee9){if(_0x44e5cd[_0xc826('0x55')]['id']){delete _0x44e5cd[_0xc826('0x55')]['id'];}return db['JscriptyProject'][_0xc826('0x4d')]({'where':{'id':_0x44e5cd['params']['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x527ee9,null))['then'](saveUpdates(_0x44e5cd[_0xc826('0x55')],null))['then'](respondWithResult(_0x527ee9,null))[_0xc826('0x48')](handleError(_0x527ee9,null));};exports[_0xc826('0x25')]=function(_0x410099,_0x278260){return db['JscriptyProject'][_0xc826('0x4d')]({'where':{'id':_0x410099[_0xc826('0x46')]['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x278260,null))['then'](removeEntity(_0x278260,null))['catch'](handleError(_0x278260,null));};exports[_0xc826('0x57')]=function(_0x36cc8d,_0x23d226,_0x42f1c4){var _0x32a102={'raw':!![],'where':{}};var _0x416d17={};var _0x1d5009={'count':0x0,'rows':[]};return db[_0xc826('0x2d')]['findOne']({'where':{'id':_0x36cc8d[_0xc826('0x46')]['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x23d226,null))[_0xc826('0x24')](function(_0x212551){if(_0x212551){_0x416d17['model']=_[_0xc826('0x47')](db[_0xc826('0x58')]['rawAttributes']);_0x416d17[_0xc826('0x33')]=_['keys'](_0x36cc8d['query']);_0x416d17[_0xc826('0x3c')]=_['intersection'](_0x416d17[_0xc826('0x32')],_0x416d17[_0xc826('0x33')]);_0x32a102['attributes']=_['intersection'](_0x416d17[_0xc826('0x32')],qs[_0xc826('0x36')](_0x36cc8d['query'][_0xc826('0x36')]));_0x32a102['attributes']=_0x32a102[_0xc826('0x35')][_0xc826('0x37')]?_0x32a102[_0xc826('0x35')]:_0x416d17['model'];if(!_0x36cc8d[_0xc826('0x33')][_0xc826('0x38')](_0xc826('0x39'))){_0x32a102[_0xc826('0x1c')]=qs[_0xc826('0x1c')](_0x36cc8d['query']['limit']);_0x32a102[_0xc826('0x1e')]=qs[_0xc826('0x1e')](_0x36cc8d['query'][_0xc826('0x1e')]);}_0x32a102[_0xc826('0x3a')]=qs[_0xc826('0x59')](_0x36cc8d[_0xc826('0x33')][_0xc826('0x59')]);_0x32a102[_0xc826('0x3b')]=qs[_0xc826('0x3c')](_[_0xc826('0x3d')](_0x36cc8d[_0xc826('0x33')],_0x416d17['filters']));_0x32a102['where']['ProjectId']=_0x212551['id'];if(_0x36cc8d[_0xc826('0x33')]['filter']){_0x32a102[_0xc826('0x3b')]=_['merge'](_0x32a102['where'],{'$or':_[_0xc826('0x2c')](_0x32a102[_0xc826('0x35')],function(_0x2480f8){var _0x105ece={};_0x105ece[_0x2480f8]={'$like':'%'+_0x36cc8d['query'][_0xc826('0x5a')]+'%'};return _0x105ece;})});}_0x32a102=_[_0xc826('0x3e')]({},_0x32a102,_0x36cc8d[_0xc826('0x40')]);return db[_0xc826('0x58')]['count']({'where':_0x32a102[_0xc826('0x3b')]})['then'](function(_0x5bf056){_0x1d5009[_0xc826('0x1d')]=_0x5bf056;if(_0x36cc8d[_0xc826('0x33')][_0xc826('0x41')]){_0x32a102[_0xc826('0x42')]=[{'all':!![]}];}return db[_0xc826('0x58')][_0xc826('0x43')](_0x32a102);})[_0xc826('0x24')](function(_0x588aba){_0x1d5009['rows']=_0x588aba;return _0x1d5009;});}})[_0xc826('0x24')](respondWithFilteredResult(_0x23d226,_0x32a102))['catch'](handleError(_0x23d226,null));};exports[_0xc826('0x5b')]=function(_0x5b8188,_0x1916fa,_0x5b9ba2){var _0x5c6540={'raw':!![],'where':{}};var _0x85850b={};var _0x2ec552={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc826('0x5c')]({'where':{'id':_0x5b8188[_0xc826('0x46')]['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x1916fa,null))[_0xc826('0x24')](function(_0x1d5540){if(_0x1d5540){_0x85850b[_0xc826('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0xc826('0x2e')]);_0x85850b[_0xc826('0x33')]=_[_0xc826('0x47')](_0x5b8188['query']);_0x85850b['filters']=_[_0xc826('0x34')](_0x85850b[_0xc826('0x32')],_0x85850b[_0xc826('0x33')]);_0x5c6540['attributes']=_[_0xc826('0x34')](_0x85850b[_0xc826('0x32')],qs[_0xc826('0x36')](_0x5b8188[_0xc826('0x33')][_0xc826('0x36')]));_0x5c6540['attributes']=_0x5c6540[_0xc826('0x35')][_0xc826('0x37')]?_0x5c6540['attributes']:_0x85850b['model'];if(!_0x5b8188[_0xc826('0x33')][_0xc826('0x38')]('nolimit')){_0x5c6540['limit']=qs[_0xc826('0x1c')](_0x5b8188[_0xc826('0x33')][_0xc826('0x1c')]);_0x5c6540[_0xc826('0x1e')]=qs[_0xc826('0x1e')](_0x5b8188[_0xc826('0x33')]['offset']);}_0x5c6540[_0xc826('0x3a')]=qs[_0xc826('0x59')](_0x5b8188['query'][_0xc826('0x59')]);_0x5c6540[_0xc826('0x3b')]=qs[_0xc826('0x3c')](_['pick'](_0x5b8188[_0xc826('0x33')],_0x85850b[_0xc826('0x3c')]));_0x5c6540[_0xc826('0x3b')]['ProjectId']=_0x1d5540['id'];if(_0x5b8188['query'][_0xc826('0x5a')]){_0x5c6540[_0xc826('0x3b')]=_[_0xc826('0x3e')](_0x5c6540['where'],{'$or':_[_0xc826('0x2c')](_0x5c6540[_0xc826('0x35')],function(_0xa4867f){var _0x37485e={};_0x37485e[_0xa4867f]={'$like':'%'+_0x5b8188[_0xc826('0x33')]['filter']+'%'};return _0x37485e;})});}_0x5c6540=_['merge']({},_0x5c6540,_0x5b8188[_0xc826('0x40')]);return db[_0xc826('0x5d')]['count']({'where':_0x5c6540[_0xc826('0x3b')]})[_0xc826('0x24')](function(_0x66f4c1){_0x2ec552['count']=_0x66f4c1;if(_0x5b8188['query'][_0xc826('0x41')]){_0x5c6540['include']=[{'all':!![]}];}return db[_0xc826('0x5d')][_0xc826('0x43')](_0x5c6540);})[_0xc826('0x24')](function(_0xcb0a0c){_0x2ec552[_0xc826('0x44')]=_0xcb0a0c;return _0x2ec552;});}})[_0xc826('0x24')](respondWithFilteredResult(_0x1916fa,_0x5c6540))[_0xc826('0x48')](handleError(_0x1916fa,null));};function char(_0x4311bf){return _0xc826('0x5e')===typeof _0x4311bf?String['fromCharCode']['apply'](null,arguments):_0x4311bf;}function needsEncapsulation(_0xad6a84){return!!_0xad6a84&&(_0xad6a84['toString']()[_0xc826('0x5f')](char(0xd))>=0x0||_0xad6a84[_0xc826('0x60')]()[_0xc826('0x5f')](char(0xa))>=0x0||_0xad6a84[_0xc826('0x60')]()[_0xc826('0x5f')](char(0x2c))>=0x0||_0xad6a84[_0xc826('0x60')]()[_0xc826('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x50588){var _0x5a2ce9=char(0x22),_0x3b9318='\x5c'+char(0x22),_0x5309fa=_0x50588[_0xc826('0x60')]()['replace'](new RegExp(_0x5a2ce9,'g'),_0x3b9318);return _0x5a2ce9+_0x5309fa+_0x5a2ce9;}exports[_0xc826('0x61')]=function(_0x460aed,_0x1c931c,_0x3f7d9d){var _0x280b5,_0x45ddf2;var _0x132931={'where':{'ProjectId':_0x460aed[_0xc826('0x46')]['id']}};if(_0x460aed[_0xc826('0x33')]['startTime']){_0x132931[_0xc826('0x3b')][_0xc826('0x62')]=JSON[_0xc826('0x63')](_0x460aed[_0xc826('0x33')][_0xc826('0x64')]);}return db[_0xc826('0x58')][_0xc826('0x43')](_0x132931)[_0xc826('0x24')](handleEntityNotFound(_0x1c931c,null))[_0xc826('0x24')](function(_0xaf00bf){if(_0xaf00bf){_0x280b5=_0xaf00bf;return db[_0xc826('0x65')][_0xc826('0x43')]({'where':{'SessionId':{'$in':_[_0xc826('0x2c')](_0x280b5,'id')},'ProjectId':_0x460aed['params']['id']},'order':'-createdAt'});}})[_0xc826('0x24')](handleEntityNotFound(_0x1c931c,null))[_0xc826('0x24')](function(_0x527996){if(_0x527996){_0x45ddf2=_0x527996;var _0x40b966={};for(var _0x133a5d=0x0,_0xd8ecba=_0x45ddf2[_0xc826('0x37')];_0x133a5d<_0xd8ecba;_0x133a5d++){if(!_0x40b966[_0xc826('0x38')](_0x45ddf2[_0x133a5d][_0xc826('0x66')])){_0x40b966[_0x45ddf2[_0x133a5d]['questionId']]=needsEncapsulation(_0x45ddf2[_0x133a5d][_0xc826('0x67')])?encapsulate(_0x45ddf2[_0x133a5d][_0xc826('0x67')]):_0x45ddf2[_0x133a5d]['question'];}}var _0x506df7=[],_0x33424a={};for(var _0x991e03=0x0,_0x7dc484=_0x280b5[_0xc826('0x37')];_0x991e03<_0x7dc484;_0x991e03++){_0x33424a={'ProjectId':_0x460aed['params']['id'],'SessionId':_0x280b5[_0x991e03]['id'],'StartTime':moment(_0x280b5[_0x991e03][_0xc826('0x62')])[_0xc826('0x68')](_0xc826('0x69'))};for(var _0x4146cf=0x0,_0x7c8d85=_0x45ddf2[_0xc826('0x37')];_0x4146cf<_0x7c8d85;_0x4146cf++){if(_0x45ddf2[_0x4146cf][_0xc826('0x6a')]==_0x280b5[_0x991e03]['id']&&_0x40b966[_0xc826('0x38')](_0x45ddf2[_0x4146cf][_0xc826('0x66')])){_0x33424a[_0x40b966[_0x45ddf2[_0x4146cf][_0xc826('0x66')]]]=_0x45ddf2[_0x4146cf]['answer'];}}for(var _0x32dece in _0x40b966){if(!_0x33424a[_0xc826('0x38')](_0x40b966[_0x32dece])){_0x33424a[_0x40b966[_0x32dece]]=null;}}_0x506df7['push'](_0x33424a);}return _0x506df7;}})['then'](function(_0x3c6734){if(!_[_0xc826('0x6b')](_0x3c6734)){var _0xc5f297=toCsv(_0x3c6734);var _0x4d09cf=Date['now']();fs[_0xc826('0x6c')](util['format'](_0xc826('0x6d'),_0x460aed[_0xc826('0x46')]['id'],_0x4d09cf),_0xc5f297);_0x1c931c['setHeader'](_0xc826('0x6e'),_0xc826('0x6f')+util[_0xc826('0x68')](_0xc826('0x70'),_0x460aed[_0xc826('0x46')]['id'],_0x4d09cf));_0x1c931c[_0xc826('0x71')]('Content-type',_0xc826('0x72'));return _0x1c931c[_0xc826('0x73')](util['format'](_0xc826('0x6d'),_0x460aed[_0xc826('0x46')]['id'],_0x4d09cf));}else{return _0x1c931c[_0xc826('0x17')](0xcc);}})[_0xc826('0x48')](handleError(_0x1c931c,null));}; \ No newline at end of file +var _0xe386=['findOne','hasOwnProperty','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','format','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','get','Projects','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','JscriptyProject','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','omit','updatedAt','createdAt','role','destroy','getSessions'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xe386,0x11c));var _0x6e38=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe386[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e38('0x0'));var zipdir=require(_0x6e38('0x1'));var jsonpatch=require(_0x6e38('0x2'));var rp=require('request-promise');var moment=require(_0x6e38('0x3'));var BPromise=require(_0x6e38('0x4'));var Mustache=require(_0x6e38('0x5'));var util=require(_0x6e38('0x6'));var path=require(_0x6e38('0x7'));var sox=require(_0x6e38('0x8'));var csv=require(_0x6e38('0x9'));var ejs=require(_0x6e38('0xa'));var fs=require('fs');var fs_extra=require(_0x6e38('0xb'));var _=require(_0x6e38('0xc'));var squel=require(_0x6e38('0xd'));var crypto=require(_0x6e38('0xe'));var jsforce=require(_0x6e38('0xf'));var deskjs=require(_0x6e38('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6e38('0x11'));var Papa=require(_0x6e38('0x12'));var Redis=require(_0x6e38('0x13'));var authService=require(_0x6e38('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6e38('0x15'));var hardwareService=require(_0x6e38('0x16'));var logger=require(_0x6e38('0x17'))(_0x6e38('0x18'));var utils=require(_0x6e38('0x19'));var config=require(_0x6e38('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e38('0x1b'))['db'];function respondWithStatusCode(_0x4c5fed,_0x15fe3d){_0x15fe3d=_0x15fe3d||0xcc;return function(_0xfb28a3){if(_0xfb28a3){return _0x4c5fed[_0x6e38('0x1c')](_0x15fe3d);}return _0x4c5fed[_0x6e38('0x1d')](_0x15fe3d)[_0x6e38('0x1e')]();};}function respondWithResult(_0x5998e1,_0xa36036){_0xa36036=_0xa36036||0xc8;return function(_0x4af0e7){if(_0x4af0e7){return _0x5998e1[_0x6e38('0x1d')](_0xa36036)['json'](_0x4af0e7);}};}function respondWithFilteredResult(_0x578594,_0x5aa051){return function(_0x2ef592){if(_0x2ef592){var _0x40bcac=typeof _0x5aa051[_0x6e38('0x1f')]===_0x6e38('0x20')&&typeof _0x5aa051[_0x6e38('0x21')]===_0x6e38('0x20');var _0x572564=_0x2ef592['count'];var _0x209dde=_0x40bcac?0x0:_0x5aa051['offset'];var _0x198f95=_0x40bcac?_0x2ef592[_0x6e38('0x22')]:_0x5aa051[_0x6e38('0x1f')]+_0x5aa051['limit'];var _0x4ef81a;if(_0x198f95>=_0x572564){_0x198f95=_0x572564;_0x4ef81a=0xc8;}else{_0x4ef81a=0xce;}_0x578594[_0x6e38('0x1d')](_0x4ef81a);return _0x578594[_0x6e38('0x23')](_0x6e38('0x24'),_0x209dde+'-'+_0x198f95+'/'+_0x572564)[_0x6e38('0x25')](_0x2ef592);}return null;};}function patchUpdates(_0x4cc727){return function(_0x22bb9f){try{jsonpatch['apply'](_0x22bb9f,_0x4cc727,!![]);}catch(_0x511877){return BPromise[_0x6e38('0x26')](_0x511877);}return _0x22bb9f[_0x6e38('0x27')]();};}function saveUpdates(_0x1efdca,_0x2efc9b){return function(_0x5dbc10){if(_0x5dbc10){return _0x5dbc10[_0x6e38('0x28')](_0x1efdca)[_0x6e38('0x29')](function(_0x2f47fb){return _0x2f47fb;});}return null;};}function removeEntity(_0x16f17d,_0x105bcf){return function(_0x55ff8d){if(_0x55ff8d){return _0x55ff8d['destroy']()[_0x6e38('0x29')](function(){var _0x2ca0cf=_0x55ff8d[_0x6e38('0x2a')]({'plain':!![]});var _0x48a5df=_0x6e38('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x48a5df,'resourceId':_0x2ca0cf['id']}})['then'](function(){return _0x55ff8d;});})['then'](function(){_0x16f17d[_0x6e38('0x1d')](0xcc)[_0x6e38('0x1e')]();});}};}function handleEntityNotFound(_0x5dfc01,_0x2fc92e){return function(_0x263044){if(!_0x263044){_0x5dfc01['sendStatus'](0x194);}return _0x263044;};}function handleError(_0x59d77a,_0x238e50){_0x238e50=_0x238e50||0x1f4;return function(_0x65c2c5){logger['error'](_0x65c2c5['stack']);if(_0x65c2c5['name']){delete _0x65c2c5[_0x6e38('0x2c')];}_0x59d77a[_0x6e38('0x1d')](_0x238e50)[_0x6e38('0x2d')](_0x65c2c5);};}exports[_0x6e38('0x2e')]=function(_0x3c330c,_0x3378bb){var _0x1b8364={},_0x55d31e={},_0x100f66={'count':0x0,'rows':[]};var _0x391b02=_[_0x6e38('0x2f')](db['JscriptyProject'][_0x6e38('0x30')],function(_0x5e653d){return{'name':_0x5e653d[_0x6e38('0x31')],'type':_0x5e653d['type'][_0x6e38('0x32')]};});_0x55d31e[_0x6e38('0x33')]=_[_0x6e38('0x2f')](_0x391b02,'name');_0x55d31e[_0x6e38('0x34')]=_[_0x6e38('0x35')](_0x3c330c[_0x6e38('0x34')]);_0x55d31e[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x55d31e['model'],_0x55d31e[_0x6e38('0x34')]);_0x1b8364['attributes']=_['intersection'](_0x55d31e[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x38')]));_0x1b8364[_0x6e38('0x39')]=_0x1b8364[_0x6e38('0x39')][_0x6e38('0x3a')]?_0x1b8364[_0x6e38('0x39')]:_0x55d31e[_0x6e38('0x33')];if(!_0x3c330c[_0x6e38('0x34')]['hasOwnProperty'](_0x6e38('0x3b'))){_0x1b8364[_0x6e38('0x21')]=qs[_0x6e38('0x21')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x21')]);_0x1b8364[_0x6e38('0x1f')]=qs[_0x6e38('0x1f')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x1f')]);}_0x1b8364[_0x6e38('0x3c')]=qs[_0x6e38('0x3d')](_0x3c330c[_0x6e38('0x34')][_0x6e38('0x3d')]);_0x1b8364['where']=qs[_0x6e38('0x36')](_[_0x6e38('0x3e')](_0x3c330c['query'],_0x55d31e[_0x6e38('0x36')]),_0x391b02);if(_0x3c330c[_0x6e38('0x34')]['filter']){_0x1b8364[_0x6e38('0x3f')]=_['merge'](_0x1b8364[_0x6e38('0x3f')],{'$or':_[_0x6e38('0x2f')](_0x391b02,function(_0x2acda3){if(_0x2acda3[_0x6e38('0x40')]!==_0x6e38('0x41')){var _0x5b6527={};_0x5b6527[_0x2acda3[_0x6e38('0x2c')]]={'$like':'%'+_0x3c330c['query'][_0x6e38('0x42')]+'%'};return _0x5b6527;}})});}_0x1b8364=_[_0x6e38('0x43')]({},_0x1b8364,_0x3c330c[_0x6e38('0x44')]);var _0x4b8a2a={'where':_0x1b8364[_0x6e38('0x3f')]};return db['JscriptyProject'][_0x6e38('0x22')](_0x4b8a2a)[_0x6e38('0x29')](function(_0x210c22){_0x100f66['count']=_0x210c22;if(_0x3c330c[_0x6e38('0x34')][_0x6e38('0x45')]){_0x1b8364[_0x6e38('0x46')]=[{'all':!![]}];}return db['JscriptyProject'][_0x6e38('0x47')](_0x1b8364);})[_0x6e38('0x29')](function(_0x577d38){_0x100f66[_0x6e38('0x48')]=_0x577d38;return _0x100f66;})[_0x6e38('0x29')](respondWithFilteredResult(_0x3378bb,_0x1b8364))[_0x6e38('0x49')](handleError(_0x3378bb,null));};exports[_0x6e38('0x4a')]=function(_0x5d3594,_0x2e1218){var _0x56d798={'raw':![],'where':{'id':_0x5d3594[_0x6e38('0x4b')]['id']}},_0x3e3c7a={};_0x3e3c7a[_0x6e38('0x33')]=_[_0x6e38('0x35')](db['JscriptyProject'][_0x6e38('0x30')]);_0x3e3c7a[_0x6e38('0x34')]=_['keys'](_0x5d3594['query']);_0x3e3c7a[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x3e3c7a[_0x6e38('0x33')],_0x3e3c7a['query']);_0x56d798[_0x6e38('0x39')]=_['intersection'](_0x3e3c7a[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x5d3594[_0x6e38('0x34')][_0x6e38('0x38')]));_0x56d798[_0x6e38('0x39')]=_0x56d798[_0x6e38('0x39')]['length']?_0x56d798[_0x6e38('0x39')]:_0x3e3c7a[_0x6e38('0x33')];if(_0x5d3594[_0x6e38('0x34')]['includeAll']){_0x56d798[_0x6e38('0x46')]=[{'all':!![]}];}_0x56d798=_[_0x6e38('0x43')]({},_0x56d798,_0x5d3594['options']);return db['JscriptyProject']['find'](_0x56d798)[_0x6e38('0x29')](handleEntityNotFound(_0x2e1218,null))['then'](respondWithResult(_0x2e1218,null))[_0x6e38('0x49')](handleError(_0x2e1218,null));};exports['create']=function(_0x9c0e09,_0x277a12){return db[_0x6e38('0x4c')][_0x6e38('0x4d')](_0x9c0e09[_0x6e38('0x4e')],{})[_0x6e38('0x29')](function(_0xbcdfd5){var _0x1a348b=_0x9c0e09[_0x6e38('0x4f')][_0x6e38('0x2a')]({'plain':!![]});if(!_0x1a348b)throw new Error(_0x6e38('0x50'));if(_0x1a348b['role']===_0x6e38('0x4f')){var _0xed62c1=_0xbcdfd5[_0x6e38('0x2a')]({'plain':!![]});var _0x56e705='Projects';return db[_0x6e38('0x51')]['find']({'where':{'name':_0x56e705,'userProfileId':_0x1a348b[_0x6e38('0x52')]},'raw':!![]})[_0x6e38('0x29')](function(_0x49be99){if(_0x49be99&&_0x49be99[_0x6e38('0x53')]===0x0){return db[_0x6e38('0x54')][_0x6e38('0x4d')]({'name':_0xed62c1['name'],'resourceId':_0xed62c1['id'],'type':_0x49be99[_0x6e38('0x2c')],'sectionId':_0x49be99['id']},{})[_0x6e38('0x29')](function(){return _0xbcdfd5;});}else{return _0xbcdfd5;}})['catch'](function(_0x4031a4){logger[_0x6e38('0x55')](_0x6e38('0x56'),_0x4031a4);throw _0x4031a4;});}return _0xbcdfd5;})['then'](respondWithResult(_0x277a12,0xc9))[_0x6e38('0x49')](handleError(_0x277a12,null));};exports['clone']=function(_0x48f542,_0x436340){var _0x5bcefc={'where':{'id':_0x48f542[_0x6e38('0x4b')]['id']}},_0x2ba790={};_0x2ba790[_0x6e38('0x33')]=_['keys'](db[_0x6e38('0x4c')][_0x6e38('0x30')]);_0x5bcefc['attributes']=_[_0x6e38('0x37')](_0x2ba790['model'],qs[_0x6e38('0x38')](_0x48f542[_0x6e38('0x34')][_0x6e38('0x38')]));_0x5bcefc['attributes']=_0x5bcefc[_0x6e38('0x39')][_0x6e38('0x3a')]?_0x5bcefc[_0x6e38('0x39')]:_0x2ba790[_0x6e38('0x33')];if(_0x48f542['query'][_0x6e38('0x45')]){_0x5bcefc['include']=[{'all':!![]}];}_0x5bcefc=_['merge']({},_0x5bcefc,_0x48f542['options']);return db['JscriptyProject'][_0x6e38('0x57')](_0x5bcefc)[_0x6e38('0x29')](handleEntityNotFound(_0x436340,null))[_0x6e38('0x29')](function(_0x10d3f6){if(_0x10d3f6){var _0x4ca10c=_0x10d3f6[_0x6e38('0x2a')]({'plain':!![]});_0x4ca10c=qs[_0x6e38('0x58')](_0x4ca10c,['id','createdAt',_0x6e38('0x59')]);_0x48f542[_0x6e38('0x4e')]=_[_0x6e38('0x58')](_0x48f542['body'],['id',_0x6e38('0x5a'),_0x6e38('0x59')]);return db['JscriptyProject'][_0x6e38('0x4d')](_[_0x6e38('0x43')](_0x4ca10c,_0x48f542[_0x6e38('0x4e')]),{'include':_0x48f542['query'][_0x6e38('0x45')]?[{'all':!![]}]:undefined})[_0x6e38('0x29')](function(_0x1de65a){var _0x1fb095=_0x48f542[_0x6e38('0x4f')][_0x6e38('0x2a')]({'plain':!![]});if(!_0x1fb095)throw new Error(_0x6e38('0x50'));if(_0x1fb095[_0x6e38('0x5b')]==='user'){var _0x217a6f=_0x1de65a[_0x6e38('0x2a')]({'plain':!![]});var _0x23363d=_0x6e38('0x2b');return db[_0x6e38('0x51')][_0x6e38('0x57')]({'where':{'name':_0x23363d,'userProfileId':_0x1fb095[_0x6e38('0x52')]},'raw':!![]})['then'](function(_0x5f47e4){if(_0x5f47e4&&_0x5f47e4[_0x6e38('0x53')]===0x0){return db['UserProfileResource'][_0x6e38('0x4d')]({'name':_0x217a6f['name'],'resourceId':_0x217a6f['id'],'type':_0x5f47e4[_0x6e38('0x2c')],'sectionId':_0x5f47e4['id']},{})['then'](function(){return _0x1de65a;});}else{return _0x1de65a;}})[_0x6e38('0x49')](function(_0x494342){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x494342);throw _0x494342;});}return _0x1de65a;});}})[_0x6e38('0x29')](respondWithResult(_0x436340,0xc9))[_0x6e38('0x49')](handleError(_0x436340,null));};exports[_0x6e38('0x28')]=function(_0x6e5989,_0x1a98d3){if(_0x6e5989[_0x6e38('0x4e')]['id']){delete _0x6e5989[_0x6e38('0x4e')]['id'];}return db[_0x6e38('0x4c')]['find']({'where':{'id':_0x6e5989[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x1a98d3,null))[_0x6e38('0x29')](saveUpdates(_0x6e5989['body'],null))[_0x6e38('0x29')](respondWithResult(_0x1a98d3,null))[_0x6e38('0x49')](handleError(_0x1a98d3,null));};exports[_0x6e38('0x5c')]=function(_0x26141f,_0x2571b7){return db[_0x6e38('0x4c')][_0x6e38('0x57')]({'where':{'id':_0x26141f[_0x6e38('0x4b')]['id']}})[_0x6e38('0x29')](handleEntityNotFound(_0x2571b7,null))['then'](removeEntity(_0x2571b7,null))[_0x6e38('0x49')](handleError(_0x2571b7,null));};exports[_0x6e38('0x5d')]=function(_0x34fdb5,_0x36c8a7,_0x270065){var _0x271f86={'raw':!![],'where':{}};var _0x20c34e={};var _0x21ad87={'count':0x0,'rows':[]};return db[_0x6e38('0x4c')][_0x6e38('0x5e')]({'where':{'id':_0x34fdb5[_0x6e38('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36c8a7,null))[_0x6e38('0x29')](function(_0x5a27a9){if(_0x5a27a9){_0x20c34e[_0x6e38('0x33')]=_['keys'](db['JscriptySessionReport'][_0x6e38('0x30')]);_0x20c34e[_0x6e38('0x34')]=_[_0x6e38('0x35')](_0x34fdb5[_0x6e38('0x34')]);_0x20c34e[_0x6e38('0x36')]=_[_0x6e38('0x37')](_0x20c34e[_0x6e38('0x33')],_0x20c34e[_0x6e38('0x34')]);_0x271f86[_0x6e38('0x39')]=_[_0x6e38('0x37')](_0x20c34e[_0x6e38('0x33')],qs['fields'](_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x38')]));_0x271f86[_0x6e38('0x39')]=_0x271f86[_0x6e38('0x39')][_0x6e38('0x3a')]?_0x271f86['attributes']:_0x20c34e[_0x6e38('0x33')];if(!_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x5f')](_0x6e38('0x3b'))){_0x271f86[_0x6e38('0x21')]=qs['limit'](_0x34fdb5['query'][_0x6e38('0x21')]);_0x271f86[_0x6e38('0x1f')]=qs['offset'](_0x34fdb5['query'][_0x6e38('0x1f')]);}_0x271f86[_0x6e38('0x3c')]=qs['sort'](_0x34fdb5[_0x6e38('0x34')]['sort']);_0x271f86[_0x6e38('0x3f')]=qs[_0x6e38('0x36')](_[_0x6e38('0x3e')](_0x34fdb5[_0x6e38('0x34')],_0x20c34e[_0x6e38('0x36')]));_0x271f86['where'][_0x6e38('0x60')]=_0x5a27a9['id'];if(_0x34fdb5[_0x6e38('0x34')]['filter']){_0x271f86[_0x6e38('0x3f')]=_[_0x6e38('0x43')](_0x271f86['where'],{'$or':_['map'](_0x271f86['attributes'],function(_0x494b57){var _0x462499={};_0x462499[_0x494b57]={'$like':'%'+_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x42')]+'%'};return _0x462499;})});}_0x271f86=_[_0x6e38('0x43')]({},_0x271f86,_0x34fdb5['options']);return db[_0x6e38('0x61')][_0x6e38('0x22')]({'where':_0x271f86[_0x6e38('0x3f')]})[_0x6e38('0x29')](function(_0x1785b7){_0x21ad87[_0x6e38('0x22')]=_0x1785b7;if(_0x34fdb5[_0x6e38('0x34')][_0x6e38('0x45')]){_0x271f86[_0x6e38('0x46')]=[{'all':!![]}];}return db[_0x6e38('0x61')][_0x6e38('0x47')](_0x271f86);})[_0x6e38('0x29')](function(_0x3bd792){_0x21ad87['rows']=_0x3bd792;return _0x21ad87;});}})[_0x6e38('0x29')](respondWithFilteredResult(_0x36c8a7,_0x271f86))[_0x6e38('0x49')](handleError(_0x36c8a7,null));};exports[_0x6e38('0x62')]=function(_0x342c8e,_0x465a2a,_0x218199){var _0x54a9f0={'raw':!![],'where':{}};var _0x4a2c25={};var _0x435c0d={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x6e38('0x5e')]({'where':{'id':_0x342c8e[_0x6e38('0x4b')]['id']}})['then'](handleEntityNotFound(_0x465a2a,null))['then'](function(_0xd2eb44){if(_0xd2eb44){_0x4a2c25['model']=_[_0x6e38('0x35')](db[_0x6e38('0x63')][_0x6e38('0x30')]);_0x4a2c25['query']=_[_0x6e38('0x35')](_0x342c8e[_0x6e38('0x34')]);_0x4a2c25['filters']=_[_0x6e38('0x37')](_0x4a2c25[_0x6e38('0x33')],_0x4a2c25['query']);_0x54a9f0[_0x6e38('0x39')]=_['intersection'](_0x4a2c25[_0x6e38('0x33')],qs[_0x6e38('0x38')](_0x342c8e['query'][_0x6e38('0x38')]));_0x54a9f0[_0x6e38('0x39')]=_0x54a9f0['attributes'][_0x6e38('0x3a')]?_0x54a9f0['attributes']:_0x4a2c25['model'];if(!_0x342c8e[_0x6e38('0x34')][_0x6e38('0x5f')](_0x6e38('0x3b'))){_0x54a9f0[_0x6e38('0x21')]=qs[_0x6e38('0x21')](_0x342c8e[_0x6e38('0x34')][_0x6e38('0x21')]);_0x54a9f0['offset']=qs['offset'](_0x342c8e[_0x6e38('0x34')][_0x6e38('0x1f')]);}_0x54a9f0[_0x6e38('0x3c')]=qs['sort'](_0x342c8e[_0x6e38('0x34')]['sort']);_0x54a9f0[_0x6e38('0x3f')]=qs['filters'](_[_0x6e38('0x3e')](_0x342c8e[_0x6e38('0x34')],_0x4a2c25[_0x6e38('0x36')]));_0x54a9f0[_0x6e38('0x3f')][_0x6e38('0x60')]=_0xd2eb44['id'];if(_0x342c8e['query'][_0x6e38('0x42')]){_0x54a9f0['where']=_[_0x6e38('0x43')](_0x54a9f0[_0x6e38('0x3f')],{'$or':_['map'](_0x54a9f0[_0x6e38('0x39')],function(_0x16a0b3){var _0x22fbfc={};_0x22fbfc[_0x16a0b3]={'$like':'%'+_0x342c8e[_0x6e38('0x34')][_0x6e38('0x42')]+'%'};return _0x22fbfc;})});}_0x54a9f0=_[_0x6e38('0x43')]({},_0x54a9f0,_0x342c8e[_0x6e38('0x44')]);return db['JscriptyAnswerReport'][_0x6e38('0x22')]({'where':_0x54a9f0[_0x6e38('0x3f')]})[_0x6e38('0x29')](function(_0x52fc79){_0x435c0d['count']=_0x52fc79;if(_0x342c8e[_0x6e38('0x34')]['includeAll']){_0x54a9f0[_0x6e38('0x46')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6e38('0x47')](_0x54a9f0);})[_0x6e38('0x29')](function(_0x44a9ab){_0x435c0d[_0x6e38('0x48')]=_0x44a9ab;return _0x435c0d;});}})[_0x6e38('0x29')](respondWithFilteredResult(_0x465a2a,_0x54a9f0))[_0x6e38('0x49')](handleError(_0x465a2a,null));};function char(_0x2072e2){return _0x6e38('0x64')===typeof _0x2072e2?String[_0x6e38('0x65')][_0x6e38('0x66')](null,arguments):_0x2072e2;}function needsEncapsulation(_0x5c63f6){return!!_0x5c63f6&&(_0x5c63f6[_0x6e38('0x67')]()[_0x6e38('0x68')](char(0xd))>=0x0||_0x5c63f6[_0x6e38('0x67')]()[_0x6e38('0x68')](char(0xa))>=0x0||_0x5c63f6[_0x6e38('0x67')]()[_0x6e38('0x68')](char(0x2c))>=0x0||_0x5c63f6[_0x6e38('0x67')]()[_0x6e38('0x68')](char(0x22))>=0x0);}function encapsulate(_0x49962a){var _0x32ef3a=char(0x22),_0x1d03bf='\x5c'+char(0x22),_0x17509e=_0x49962a['toString']()[_0x6e38('0x69')](new RegExp(_0x32ef3a,'g'),_0x1d03bf);return _0x32ef3a+_0x17509e+_0x32ef3a;}exports[_0x6e38('0x6a')]=function(_0x968dcc,_0x5761af,_0x22de3d){var _0x4a6173,_0x469ff7;var _0x524a0e={'where':{'ProjectId':_0x968dcc[_0x6e38('0x4b')]['id']}};if(_0x968dcc[_0x6e38('0x34')][_0x6e38('0x6b')]){_0x524a0e['where']['starttime']=JSON[_0x6e38('0x6c')](_0x968dcc[_0x6e38('0x34')][_0x6e38('0x6b')]);}return db[_0x6e38('0x61')][_0x6e38('0x47')](_0x524a0e)[_0x6e38('0x29')](handleEntityNotFound(_0x5761af,null))[_0x6e38('0x29')](function(_0x207c5a){if(_0x207c5a){_0x4a6173=_0x207c5a;return db[_0x6e38('0x6d')][_0x6e38('0x47')]({'where':{'SessionId':{'$in':_[_0x6e38('0x2f')](_0x4a6173,'id')},'ProjectId':_0x968dcc[_0x6e38('0x4b')]['id']},'order':_0x6e38('0x6e')});}})[_0x6e38('0x29')](handleEntityNotFound(_0x5761af,null))['then'](function(_0x49c1bc){if(_0x49c1bc){_0x469ff7=_0x49c1bc;var _0x4768cc={};for(var _0x308e0c=0x0,_0x53b6c4=_0x469ff7[_0x6e38('0x3a')];_0x308e0c<_0x53b6c4;_0x308e0c++){if(!_0x4768cc[_0x6e38('0x5f')](_0x469ff7[_0x308e0c]['questionId'])){_0x4768cc[_0x469ff7[_0x308e0c][_0x6e38('0x6f')]]=needsEncapsulation(_0x469ff7[_0x308e0c][_0x6e38('0x70')])?encapsulate(_0x469ff7[_0x308e0c][_0x6e38('0x70')]):_0x469ff7[_0x308e0c][_0x6e38('0x70')];}}var _0xb06e82=[],_0x58cf1b={};for(var _0x4c35b4=0x0,_0x13ca1b=_0x4a6173[_0x6e38('0x3a')];_0x4c35b4<_0x13ca1b;_0x4c35b4++){_0x58cf1b={'ProjectId':_0x968dcc[_0x6e38('0x4b')]['id'],'SessionId':_0x4a6173[_0x4c35b4]['id'],'StartTime':moment(_0x4a6173[_0x4c35b4]['starttime'])['format'](_0x6e38('0x71'))};for(var _0x423c26=0x0,_0x5e7ddc=_0x469ff7[_0x6e38('0x3a')];_0x423c26<_0x5e7ddc;_0x423c26++){if(_0x469ff7[_0x423c26][_0x6e38('0x72')]==_0x4a6173[_0x4c35b4]['id']&&_0x4768cc['hasOwnProperty'](_0x469ff7[_0x423c26]['questionId'])){_0x58cf1b[_0x4768cc[_0x469ff7[_0x423c26][_0x6e38('0x6f')]]]=_0x469ff7[_0x423c26]['answer'];}}for(var _0x5517f7 in _0x4768cc){if(!_0x58cf1b[_0x6e38('0x5f')](_0x4768cc[_0x5517f7])){_0x58cf1b[_0x4768cc[_0x5517f7]]=null;}}_0xb06e82[_0x6e38('0x73')](_0x58cf1b);}return _0xb06e82;}})[_0x6e38('0x29')](function(_0x56df1a){if(!_[_0x6e38('0x74')](_0x56df1a)){var _0x2b5940=toCsv(_0x56df1a);var _0x324bbe=Date[_0x6e38('0x75')]();fs[_0x6e38('0x76')](util['format'](_0x6e38('0x77'),_0x968dcc[_0x6e38('0x4b')]['id'],_0x324bbe),_0x2b5940);_0x5761af[_0x6e38('0x78')]('Content-disposition',_0x6e38('0x79')+util[_0x6e38('0x7a')]('Jscripty_Project_%d_Summary_%s.csv',_0x968dcc[_0x6e38('0x4b')]['id'],_0x324bbe));_0x5761af[_0x6e38('0x78')](_0x6e38('0x7b'),_0x6e38('0x7c'));return _0x5761af[_0x6e38('0x7d')](util[_0x6e38('0x7a')](_0x6e38('0x77'),_0x968dcc[_0x6e38('0x4b')]['id'],_0x324bbe));}else{return _0x5761af[_0x6e38('0x1c')](0xcc);}})[_0x6e38('0x49')](handleError(_0x5761af,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 8428b2a..be77735 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 _0xaeab=['jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject'];(function(_0x4d2314,_0x4364cc){var _0x4bc371=function(_0xa750d6){while(--_0xa750d6){_0x4d2314['push'](_0x4d2314['shift']());}};_0x4bc371(++_0x4364cc);}(_0xaeab,0x91));var _0xbaea=function(_0x4c1b4a,_0x117b33){_0x4c1b4a=_0x4c1b4a-0x0;var _0x2452e9=_0xaeab[_0x4c1b4a];return _0x2452e9;};'use strict';var _=require(_0xbaea('0x0'));var util=require('util');var logger=require(_0xbaea('0x1'))('api');var moment=require(_0xbaea('0x2'));var BPromise=require(_0xbaea('0x3'));var rp=require(_0xbaea('0x4'));var fs=require('fs');var path=require(_0xbaea('0x5'));var rimraf=require(_0xbaea('0x6'));var config=require(_0xbaea('0x7'));var attributes=require(_0xbaea('0x8'));module[_0xbaea('0x9')]=function(_0x1ae44e,_0x1e4331){return _0x1ae44e['define'](_0xbaea('0xa'),attributes,{'tableName':_0xbaea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b84=['moment','path','rimraf','../../config/environment','JscriptyProject','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x4b84[_0x2b8077];return _0x308091;};'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('./jscriptyProject.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'jscripty_projects','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 2200600..a0c635d 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x47003c,_0x91c41a){var _0x5a7479=function(_0x35291c){while(--_0x35291c){_0x47003c['push'](_0x47003c['shift']());}};_0x5a7479(++_0x91c41a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x5b6c99,_0x19e285){var _0x51d461=function(_0x163102){while(--_0x163102){_0x5b6c99['push'](_0x5b6c99['shift']());}};_0x51d461(++_0x19e285);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0xcb91[_0x4067ac];return _0x53d74d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index f2a2c19..7400b60 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 _0xf6ea=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xf6ea,0x1e5));var _0xaf6e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf6ea[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0xaf6e('0x0'));var path=require(_0xaf6e('0x1'));var timeout=require(_0xaf6e('0x2'));var express=require(_0xaf6e('0x3'));var router=express[_0xaf6e('0x4')]();var fs_extra=require(_0xaf6e('0x5'));var auth=require(_0xaf6e('0x6'));var interaction=require(_0xaf6e('0x7'));var config=require(_0xaf6e('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0xaf6e('0x9')]('/',auth[_0xaf6e('0xa')](),controller[_0xaf6e('0xb')]);router[_0xaf6e('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xaf6e('0x9')](_0xaf6e('0xc'),auth[_0xaf6e('0xa')](),controller[_0xaf6e('0xd')]);router[_0xaf6e('0xe')]('/',auth[_0xaf6e('0xa')](),controller[_0xaf6e('0xf')]);router[_0xaf6e('0x10')](_0xaf6e('0xc'),auth[_0xaf6e('0xa')](),controller[_0xaf6e('0x11')]);router[_0xaf6e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xaf6e('0x13')]);module[_0xaf6e('0x14')]=router; \ No newline at end of file +var _0xd459=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put','delete'];(function(_0x180c24,_0x43ae05){var _0x249d71=function(_0x4adadd){while(--_0x4adadd){_0x180c24['push'](_0x180c24['shift']());}};_0x249d71(++_0x43ae05);}(_0xd459,0xb6));var _0x9d45=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xd459[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x9d45('0x0'));var util=require(_0x9d45('0x1'));var path=require(_0x9d45('0x2'));var timeout=require('connect-timeout');var express=require(_0x9d45('0x3'));var router=express['Router']();var fs_extra=require(_0x9d45('0x4'));var auth=require(_0x9d45('0x5'));var interaction=require(_0x9d45('0x6'));var config=require(_0x9d45('0x7'));var controller=require(_0x9d45('0x8'));router[_0x9d45('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9d45('0x9')](_0x9d45('0xa'),auth['isAuthenticated'](),controller[_0x9d45('0xb')]);router[_0x9d45('0x9')](_0x9d45('0xc'),auth[_0x9d45('0xd')](),controller[_0x9d45('0xe')]);router[_0x9d45('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9d45('0x10')](_0x9d45('0xc'),auth[_0x9d45('0xd')](),controller['update']);router[_0x9d45('0x11')](_0x9d45('0xc'),auth[_0x9d45('0xd')](),controller[_0x9d45('0x12')]);module[_0x9d45('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9d8429f..bbbab24 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(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7a54,0x106));var _0x47a5=function(_0x241d3b,_0x114909){_0x241d3b=_0x241d3b-0x0;var _0x44212b=_0x7a54[_0x241d3b];return _0x44212b;};'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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x4142b7,_0x341334){_0x4142b7=_0x4142b7-0x0;var _0x4a13d3=_0x7a54[_0x4142b7];return _0x4a13d3;};'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 e559709..145f065 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 _0xcb1a=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','fieldName','type','key','model','map','query','intersection','attributes','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','fields','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3d193b,_0x16b5f2){var _0x1cb07d=function(_0x275e7f){while(--_0x275e7f){_0x3d193b['push'](_0x3d193b['shift']());}};_0x1cb07d(++_0x16b5f2);}(_0xcb1a,0x1e9));var _0xacb1=function(_0x3c7ad7,_0xcbea9e){_0x3c7ad7=_0x3c7ad7-0x0;var _0x2d73d4=_0xcb1a[_0x3c7ad7];return _0x2d73d4;};'use strict';var emlformat=require(_0xacb1('0x0'));var rimraf=require(_0xacb1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xacb1('0x2'));var rp=require(_0xacb1('0x3'));var moment=require('moment');var BPromise=require(_0xacb1('0x4'));var Mustache=require('mustache');var util=require(_0xacb1('0x5'));var path=require('path');var sox=require(_0xacb1('0x6'));var csv=require(_0xacb1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacb1('0x8'));var squel=require(_0xacb1('0x9'));var crypto=require(_0xacb1('0xa'));var jsforce=require(_0xacb1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xacb1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xacb1('0xc'));var authService=require(_0xacb1('0xd'));var qs=require(_0xacb1('0xe'));var as=require(_0xacb1('0xf'));var hardwareService=require(_0xacb1('0x10'));var logger=require('../../config/logger')(_0xacb1('0x11'));var utils=require(_0xacb1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xacb1('0x13'));var db=require(_0xacb1('0x14'))['db'];function respondWithStatusCode(_0x1ad07d,_0x2feefe){_0x2feefe=_0x2feefe||0xcc;return function(_0x5ceb47){if(_0x5ceb47){return _0x1ad07d[_0xacb1('0x15')](_0x2feefe);}return _0x1ad07d[_0xacb1('0x16')](_0x2feefe)[_0xacb1('0x17')]();};}function respondWithResult(_0x216253,_0x14ea10){_0x14ea10=_0x14ea10||0xc8;return function(_0x784919){if(_0x784919){return _0x216253[_0xacb1('0x16')](_0x14ea10)['json'](_0x784919);}};}function respondWithFilteredResult(_0xbac68a,_0x1f7e24){return function(_0x1dd24f){if(_0x1dd24f){var _0x18b1f6=typeof _0x1f7e24['offset']===_0xacb1('0x18')&&typeof _0x1f7e24[_0xacb1('0x19')]===_0xacb1('0x18');var _0x3cc033=_0x1dd24f[_0xacb1('0x1a')];var _0x72bdd8=_0x18b1f6?0x0:_0x1f7e24[_0xacb1('0x1b')];var _0x253e90=_0x18b1f6?_0x1dd24f['count']:_0x1f7e24[_0xacb1('0x1b')]+_0x1f7e24[_0xacb1('0x19')];var _0x12b02e;if(_0x253e90>=_0x3cc033){_0x253e90=_0x3cc033;_0x12b02e=0xc8;}else{_0x12b02e=0xce;}_0xbac68a['status'](_0x12b02e);return _0xbac68a['set'](_0xacb1('0x1c'),_0x72bdd8+'-'+_0x253e90+'/'+_0x3cc033)[_0xacb1('0x1d')](_0x1dd24f);}return null;};}function patchUpdates(_0x5403a7){return function(_0x691c94){try{jsonpatch[_0xacb1('0x1e')](_0x691c94,_0x5403a7,!![]);}catch(_0x1fe68b){return BPromise[_0xacb1('0x1f')](_0x1fe68b);}return _0x691c94['save']();};}function saveUpdates(_0x382911,_0x6e0652){return function(_0x318228){if(_0x318228){return _0x318228[_0xacb1('0x20')](_0x382911)['then'](function(_0x48b5db){return _0x48b5db;});}return null;};}function removeEntity(_0x2221c5,_0xae1e01){return function(_0x5effe0){if(_0x5effe0){return _0x5effe0[_0xacb1('0x21')]()[_0xacb1('0x22')](function(){_0x2221c5[_0xacb1('0x16')](0xcc)[_0xacb1('0x17')]();});}};}function handleEntityNotFound(_0x29a6ac,_0x4ef623){return function(_0x4b4eb8){if(!_0x4b4eb8){_0x29a6ac[_0xacb1('0x15')](0x194);}return _0x4b4eb8;};}function handleError(_0xdf6701,_0x23a823){_0x23a823=_0x23a823||0x1f4;return function(_0x12a240){logger[_0xacb1('0x23')](_0x12a240[_0xacb1('0x24')]);if(_0x12a240[_0xacb1('0x25')]){delete _0x12a240[_0xacb1('0x25')];}_0xdf6701['status'](_0x23a823)[_0xacb1('0x26')](_0x12a240);};}exports[_0xacb1('0x27')]=function(_0x167d75,_0x31231e){var _0x1808af={},_0x3965ab={},_0x26f161={'count':0x0,'rows':[]};var _0x3850ac=_['map'](db[_0xacb1('0x28')]['rawAttributes'],function(_0x1739c7){return{'name':_0x1739c7[_0xacb1('0x29')],'type':_0x1739c7[_0xacb1('0x2a')][_0xacb1('0x2b')]};});_0x3965ab[_0xacb1('0x2c')]=_[_0xacb1('0x2d')](_0x3850ac,'name');_0x3965ab[_0xacb1('0x2e')]=_['keys'](_0x167d75['query']);_0x3965ab['filters']=_[_0xacb1('0x2f')](_0x3965ab['model'],_0x3965ab[_0xacb1('0x2e')]);_0x1808af[_0xacb1('0x30')]=_[_0xacb1('0x2f')](_0x3965ab[_0xacb1('0x2c')],qs['fields'](_0x167d75['query']['fields']));_0x1808af['attributes']=_0x1808af['attributes']['length']?_0x1808af[_0xacb1('0x30')]:_0x3965ab[_0xacb1('0x2c')];if(!_0x167d75[_0xacb1('0x2e')]['hasOwnProperty'](_0xacb1('0x31'))){_0x1808af[_0xacb1('0x19')]=qs[_0xacb1('0x19')](_0x167d75['query'][_0xacb1('0x19')]);_0x1808af[_0xacb1('0x1b')]=qs[_0xacb1('0x1b')](_0x167d75[_0xacb1('0x2e')][_0xacb1('0x1b')]);}_0x1808af[_0xacb1('0x32')]=qs[_0xacb1('0x33')](_0x167d75[_0xacb1('0x2e')][_0xacb1('0x33')]);_0x1808af['where']=qs[_0xacb1('0x34')](_[_0xacb1('0x35')](_0x167d75[_0xacb1('0x2e')],_0x3965ab['filters']),_0x3850ac);if(_0x167d75['query'][_0xacb1('0x36')]){_0x1808af[_0xacb1('0x37')]=_[_0xacb1('0x38')](_0x1808af[_0xacb1('0x37')],{'$or':_[_0xacb1('0x2d')](_0x3850ac,function(_0xb7a74f){if(_0xb7a74f['type']!==_0xacb1('0x39')){var _0x5b4e57={};_0x5b4e57[_0xb7a74f['name']]={'$like':'%'+_0x167d75[_0xacb1('0x2e')]['filter']+'%'};return _0x5b4e57;}})});}_0x1808af=_[_0xacb1('0x38')]({},_0x1808af,_0x167d75[_0xacb1('0x3a')]);var _0x193038={'where':_0x1808af[_0xacb1('0x37')]};return db[_0xacb1('0x28')][_0xacb1('0x1a')](_0x193038)[_0xacb1('0x22')](function(_0x321620){_0x26f161[_0xacb1('0x1a')]=_0x321620;if(_0x167d75['query'][_0xacb1('0x3b')]){_0x1808af['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x1808af);})[_0xacb1('0x22')](function(_0x25ffd6){_0x26f161[_0xacb1('0x3c')]=_0x25ffd6;return _0x26f161;})[_0xacb1('0x22')](respondWithFilteredResult(_0x31231e,_0x1808af))[_0xacb1('0x3d')](handleError(_0x31231e,null));};exports[_0xacb1('0x3e')]=function(_0x12ff06,_0x54426e){var _0x48e9b2={'raw':!![],'where':{'id':_0x12ff06[_0xacb1('0x3f')]['id']}},_0x35bcf2={};_0x35bcf2['model']=_[_0xacb1('0x40')](db['JscriptyQuestionReport'][_0xacb1('0x41')]);_0x35bcf2[_0xacb1('0x2e')]=_[_0xacb1('0x40')](_0x12ff06[_0xacb1('0x2e')]);_0x35bcf2[_0xacb1('0x34')]=_['intersection'](_0x35bcf2[_0xacb1('0x2c')],_0x35bcf2[_0xacb1('0x2e')]);_0x48e9b2[_0xacb1('0x30')]=_[_0xacb1('0x2f')](_0x35bcf2['model'],qs[_0xacb1('0x42')](_0x12ff06[_0xacb1('0x2e')]['fields']));_0x48e9b2[_0xacb1('0x30')]=_0x48e9b2[_0xacb1('0x30')][_0xacb1('0x43')]?_0x48e9b2[_0xacb1('0x30')]:_0x35bcf2[_0xacb1('0x2c')];if(_0x12ff06[_0xacb1('0x2e')][_0xacb1('0x3b')]){_0x48e9b2['include']=[{'all':!![]}];}_0x48e9b2=_[_0xacb1('0x38')]({},_0x48e9b2,_0x12ff06[_0xacb1('0x3a')]);return db[_0xacb1('0x28')]['find'](_0x48e9b2)[_0xacb1('0x22')](handleEntityNotFound(_0x54426e,null))['then'](respondWithResult(_0x54426e,null))[_0xacb1('0x3d')](handleError(_0x54426e,null));};exports[_0xacb1('0x44')]=function(_0x216b67,_0x15893d){return db[_0xacb1('0x28')]['create'](_0x216b67[_0xacb1('0x45')],{})[_0xacb1('0x22')](respondWithResult(_0x15893d,0xc9))['catch'](handleError(_0x15893d,null));};exports['update']=function(_0x3d07f7,_0x33c09b){if(_0x3d07f7['body']['id']){delete _0x3d07f7[_0xacb1('0x45')]['id'];}return db[_0xacb1('0x28')][_0xacb1('0x46')]({'where':{'id':_0x3d07f7[_0xacb1('0x3f')]['id']}})[_0xacb1('0x22')](handleEntityNotFound(_0x33c09b,null))[_0xacb1('0x22')](saveUpdates(_0x3d07f7[_0xacb1('0x45')],null))['then'](respondWithResult(_0x33c09b,null))[_0xacb1('0x3d')](handleError(_0x33c09b,null));};exports[_0xacb1('0x21')]=function(_0x19c65e,_0x5edc18){return db[_0xacb1('0x28')][_0xacb1('0x46')]({'where':{'id':_0x19c65e['params']['id']}})[_0xacb1('0x22')](handleEntityNotFound(_0x5edc18,null))[_0xacb1('0x22')](removeEntity(_0x5edc18,null))[_0xacb1('0x3d')](handleError(_0x5edc18,null));};exports['describe']=function(_0x1593f2,_0x47ac11){return db[_0xacb1('0x28')][_0xacb1('0x47')]()[_0xacb1('0x22')](respondWithResult(_0x47ac11,null))[_0xacb1('0x3d')](handleError(_0x47ac11,null));}; \ No newline at end of file +var _0x869f=['limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','options','JscriptyQuestionReport','then','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','offset','undefined'];(function(_0xcd2cd3,_0x50113f){var _0xb8e4e9=function(_0x10a0c7){while(--_0x10a0c7){_0xcd2cd3['push'](_0xcd2cd3['shift']());}};_0xb8e4e9(++_0x50113f);}(_0x869f,0xca));var _0xf869=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x869f[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xf869('0x0'));var rimraf=require(_0xf869('0x1'));var zipdir=require(_0xf869('0x2'));var jsonpatch=require(_0xf869('0x3'));var rp=require(_0xf869('0x4'));var moment=require(_0xf869('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf869('0x6'));var path=require(_0xf869('0x7'));var sox=require(_0xf869('0x8'));var csv=require(_0xf869('0x9'));var ejs=require(_0xf869('0xa'));var fs=require('fs');var fs_extra=require(_0xf869('0xb'));var _=require(_0xf869('0xc'));var squel=require(_0xf869('0xd'));var crypto=require(_0xf869('0xe'));var jsforce=require(_0xf869('0xf'));var deskjs=require(_0xf869('0x10'));var toCsv=require(_0xf869('0x9'));var querystring=require(_0xf869('0x11'));var Papa=require(_0xf869('0x12'));var Redis=require(_0xf869('0x13'));var authService=require(_0xf869('0x14'));var qs=require(_0xf869('0x15'));var as=require(_0xf869('0x16'));var hardwareService=require(_0xf869('0x17'));var logger=require(_0xf869('0x18'))('api');var utils=require(_0xf869('0x19'));var config=require(_0xf869('0x1a'));var licenseUtil=require(_0xf869('0x1b'));var db=require(_0xf869('0x1c'))['db'];function respondWithStatusCode(_0x446f20,_0x382f46){_0x382f46=_0x382f46||0xcc;return function(_0x55ee88){if(_0x55ee88){return _0x446f20[_0xf869('0x1d')](_0x382f46);}return _0x446f20[_0xf869('0x1e')](_0x382f46)[_0xf869('0x1f')]();};}function respondWithResult(_0x357a30,_0x12c63d){_0x12c63d=_0x12c63d||0xc8;return function(_0x21b2f6){if(_0x21b2f6){return _0x357a30[_0xf869('0x1e')](_0x12c63d)[_0xf869('0x20')](_0x21b2f6);}};}function respondWithFilteredResult(_0x267721,_0x29ec03){return function(_0x3406dc){if(_0x3406dc){var _0xd718cd=typeof _0x29ec03[_0xf869('0x21')]===_0xf869('0x22')&&typeof _0x29ec03[_0xf869('0x23')]==='undefined';var _0x57480f=_0x3406dc[_0xf869('0x24')];var _0x3975aa=_0xd718cd?0x0:_0x29ec03[_0xf869('0x21')];var _0x57f58a=_0xd718cd?_0x3406dc[_0xf869('0x24')]:_0x29ec03[_0xf869('0x21')]+_0x29ec03[_0xf869('0x23')];var _0x2a1f93;if(_0x57f58a>=_0x57480f){_0x57f58a=_0x57480f;_0x2a1f93=0xc8;}else{_0x2a1f93=0xce;}_0x267721[_0xf869('0x1e')](_0x2a1f93);return _0x267721['set'](_0xf869('0x25'),_0x3975aa+'-'+_0x57f58a+'/'+_0x57480f)['json'](_0x3406dc);}return null;};}function patchUpdates(_0x5bff26){return function(_0x174cb3){try{jsonpatch[_0xf869('0x26')](_0x174cb3,_0x5bff26,!![]);}catch(_0x56d295){return BPromise[_0xf869('0x27')](_0x56d295);}return _0x174cb3[_0xf869('0x28')]();};}function saveUpdates(_0x3fc90a,_0x527d35){return function(_0x12b061){if(_0x12b061){return _0x12b061[_0xf869('0x29')](_0x3fc90a)['then'](function(_0x35d68c){return _0x35d68c;});}return null;};}function removeEntity(_0x4287f3,_0x391e06){return function(_0x24c20f){if(_0x24c20f){return _0x24c20f[_0xf869('0x2a')]()['then'](function(){_0x4287f3[_0xf869('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae0d9,_0x3f02a1){return function(_0x57aeee){if(!_0x57aeee){_0x1ae0d9[_0xf869('0x1d')](0x194);}return _0x57aeee;};}function handleError(_0x54807f,_0x5cc419){_0x5cc419=_0x5cc419||0x1f4;return function(_0x576a7e){logger[_0xf869('0x2b')](_0x576a7e[_0xf869('0x2c')]);if(_0x576a7e['name']){delete _0x576a7e[_0xf869('0x2d')];}_0x54807f[_0xf869('0x1e')](_0x5cc419)['send'](_0x576a7e);};}exports[_0xf869('0x2e')]=function(_0x437122,_0x167921){var _0x55b3b0={},_0x28aa4e={},_0x433cd4={'count':0x0,'rows':[]};var _0x4e1433=_[_0xf869('0x2f')](db['JscriptyQuestionReport'][_0xf869('0x30')],function(_0x2246b0){return{'name':_0x2246b0[_0xf869('0x31')],'type':_0x2246b0[_0xf869('0x32')]['key']};});_0x28aa4e[_0xf869('0x33')]=_[_0xf869('0x2f')](_0x4e1433,_0xf869('0x2d'));_0x28aa4e[_0xf869('0x34')]=_[_0xf869('0x35')](_0x437122['query']);_0x28aa4e['filters']=_['intersection'](_0x28aa4e[_0xf869('0x33')],_0x28aa4e['query']);_0x55b3b0[_0xf869('0x36')]=_[_0xf869('0x37')](_0x28aa4e[_0xf869('0x33')],qs['fields'](_0x437122['query'][_0xf869('0x38')]));_0x55b3b0[_0xf869('0x36')]=_0x55b3b0['attributes']['length']?_0x55b3b0['attributes']:_0x28aa4e['model'];if(!_0x437122['query'][_0xf869('0x39')](_0xf869('0x3a'))){_0x55b3b0[_0xf869('0x23')]=qs[_0xf869('0x23')](_0x437122[_0xf869('0x34')][_0xf869('0x23')]);_0x55b3b0[_0xf869('0x21')]=qs[_0xf869('0x21')](_0x437122[_0xf869('0x34')][_0xf869('0x21')]);}_0x55b3b0['order']=qs['sort'](_0x437122[_0xf869('0x34')][_0xf869('0x3b')]);_0x55b3b0[_0xf869('0x3c')]=qs[_0xf869('0x3d')](_['pick'](_0x437122[_0xf869('0x34')],_0x28aa4e[_0xf869('0x3d')]),_0x4e1433);if(_0x437122[_0xf869('0x34')][_0xf869('0x3e')]){_0x55b3b0[_0xf869('0x3c')]=_['merge'](_0x55b3b0[_0xf869('0x3c')],{'$or':_[_0xf869('0x2f')](_0x4e1433,function(_0x287949){if(_0x287949[_0xf869('0x32')]!==_0xf869('0x3f')){var _0xe6733e={};_0xe6733e[_0x287949['name']]={'$like':'%'+_0x437122['query'][_0xf869('0x3e')]+'%'};return _0xe6733e;}})});}_0x55b3b0=_['merge']({},_0x55b3b0,_0x437122[_0xf869('0x40')]);var _0x63525={'where':_0x55b3b0[_0xf869('0x3c')]};return db[_0xf869('0x41')][_0xf869('0x24')](_0x63525)[_0xf869('0x42')](function(_0x348c3a){_0x433cd4[_0xf869('0x24')]=_0x348c3a;if(_0x437122[_0xf869('0x34')][_0xf869('0x43')]){_0x55b3b0[_0xf869('0x44')]=[{'all':!![]}];}return db[_0xf869('0x41')][_0xf869('0x45')](_0x55b3b0);})[_0xf869('0x42')](function(_0x5869b5){_0x433cd4[_0xf869('0x46')]=_0x5869b5;return _0x433cd4;})[_0xf869('0x42')](respondWithFilteredResult(_0x167921,_0x55b3b0))[_0xf869('0x47')](handleError(_0x167921,null));};exports[_0xf869('0x48')]=function(_0x149de8,_0x58d3ba){var _0x9d2a4c={'raw':!![],'where':{'id':_0x149de8[_0xf869('0x49')]['id']}},_0x26cc1c={};_0x26cc1c['model']=_[_0xf869('0x35')](db[_0xf869('0x41')][_0xf869('0x30')]);_0x26cc1c['query']=_['keys'](_0x149de8[_0xf869('0x34')]);_0x26cc1c[_0xf869('0x3d')]=_['intersection'](_0x26cc1c[_0xf869('0x33')],_0x26cc1c[_0xf869('0x34')]);_0x9d2a4c['attributes']=_['intersection'](_0x26cc1c['model'],qs[_0xf869('0x38')](_0x149de8[_0xf869('0x34')][_0xf869('0x38')]));_0x9d2a4c[_0xf869('0x36')]=_0x9d2a4c[_0xf869('0x36')]['length']?_0x9d2a4c[_0xf869('0x36')]:_0x26cc1c['model'];if(_0x149de8[_0xf869('0x34')]['includeAll']){_0x9d2a4c[_0xf869('0x44')]=[{'all':!![]}];}_0x9d2a4c=_[_0xf869('0x4a')]({},_0x9d2a4c,_0x149de8[_0xf869('0x40')]);return db[_0xf869('0x41')][_0xf869('0x4b')](_0x9d2a4c)[_0xf869('0x42')](handleEntityNotFound(_0x58d3ba,null))[_0xf869('0x42')](respondWithResult(_0x58d3ba,null))['catch'](handleError(_0x58d3ba,null));};exports[_0xf869('0x4c')]=function(_0x5ef359,_0x38b7be){return db[_0xf869('0x41')][_0xf869('0x4c')](_0x5ef359[_0xf869('0x4d')],{})['then'](respondWithResult(_0x38b7be,0xc9))[_0xf869('0x47')](handleError(_0x38b7be,null));};exports['update']=function(_0x3d048c,_0x2adf66){if(_0x3d048c['body']['id']){delete _0x3d048c['body']['id'];}return db[_0xf869('0x41')][_0xf869('0x4b')]({'where':{'id':_0x3d048c[_0xf869('0x49')]['id']}})[_0xf869('0x42')](handleEntityNotFound(_0x2adf66,null))[_0xf869('0x42')](saveUpdates(_0x3d048c[_0xf869('0x4d')],null))[_0xf869('0x42')](respondWithResult(_0x2adf66,null))['catch'](handleError(_0x2adf66,null));};exports[_0xf869('0x2a')]=function(_0x3540de,_0x2baad6){return db['JscriptyQuestionReport'][_0xf869('0x4b')]({'where':{'id':_0x3540de[_0xf869('0x49')]['id']}})[_0xf869('0x42')](handleEntityNotFound(_0x2baad6,null))[_0xf869('0x42')](removeEntity(_0x2baad6,null))[_0xf869('0x47')](handleError(_0x2baad6,null));};exports[_0xf869('0x4e')]=function(_0x4d53c9,_0x3973ce){return db['JscriptyQuestionReport'][_0xf869('0x4e')]()[_0xf869('0x42')](respondWithResult(_0x3973ce,null))[_0xf869('0x47')](handleError(_0x3973ce,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 93d2c90..6245971 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 _0x0be2=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x39701b,_0x41d9bb){var _0x2edf15=function(_0x182e1c){while(--_0x182e1c){_0x39701b['push'](_0x39701b['shift']());}};_0x2edf15(++_0x41d9bb);}(_0x0be2,0x123));var _0x20be=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x0be2[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x20be('0x0'));var util=require('util');var logger=require(_0x20be('0x1'))('api');var moment=require(_0x20be('0x2'));var BPromise=require(_0x20be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20be('0x4'));var rimraf=require(_0x20be('0x5'));var config=require(_0x20be('0x6'));var attributes=require(_0x20be('0x7'));module[_0x20be('0x8')]=function(_0x58a919,_0x4e5e6d){return _0x58a919[_0x20be('0x9')](_0x20be('0xa'),attributes,{'tableName':_0x20be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c35=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x6c35,0x6e));var _0x56c3=function(_0x190b10,_0x3066f7){_0x190b10=_0x190b10-0x0;var _0x20b409=_0x6c35[_0x190b10];return _0x20b409;};'use strict';var _=require('lodash');var util=require(_0x56c3('0x0'));var logger=require(_0x56c3('0x1'))('api');var moment=require(_0x56c3('0x2'));var BPromise=require(_0x56c3('0x3'));var rp=require(_0x56c3('0x4'));var fs=require('fs');var path=require(_0x56c3('0x5'));var rimraf=require(_0x56c3('0x6'));var config=require(_0x56c3('0x7'));var attributes=require(_0x56c3('0x8'));module[_0x56c3('0x9')]=function(_0x13ddc1,_0x5d5803){return _0x13ddc1[_0x56c3('0xa')](_0x56c3('0xb'),attributes,{'tableName':_0x56c3('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 3f0554c..3027002 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 _0x8826=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x8826,0x6e));var _0x6882=function(_0x68a411,_0x538590){_0x68a411=_0x68a411-0x0;var _0x4e9326=_0x8826[_0x68a411];return _0x4e9326;};'use strict';var _=require(_0x6882('0x0'));var util=require('util');var moment=require(_0x6882('0x1'));var BPromise=require(_0x6882('0x2'));var rs=require(_0x6882('0x3'));var fs=require('fs');var Redis=require(_0x6882('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6882('0x5'));var logger=require('../../config/logger')(_0x6882('0x6'));var config=require(_0x6882('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6882('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55c557,_0x4981ec,_0x54fd53){return new BPromise(function(_0x23f135,_0x1c0aed){return client[_0x6882('0x9')](_0x55c557,_0x54fd53)[_0x6882('0xa')](function(_0x382a0d){logger['info'](_0x6882('0xb'),_0x4981ec,_0x6882('0xc'));logger[_0x6882('0xd')](_0x6882('0xe'),_0x4981ec,_0x6882('0xc'),JSON[_0x6882('0xf')](_0x382a0d));if(_0x382a0d[_0x6882('0x10')]){if(_0x382a0d[_0x6882('0x10')][_0x6882('0x11')]===0x1f4){logger[_0x6882('0x10')](_0x6882('0xb'),_0x4981ec,_0x382a0d['error']['message']);return _0x1c0aed(_0x382a0d['error']['message']);}logger['error'](_0x6882('0xb'),_0x4981ec,_0x382a0d['error'][_0x6882('0x12')]);return _0x23f135(_0x382a0d[_0x6882('0x10')][_0x6882('0x12')]);}else{logger[_0x6882('0x13')](_0x6882('0xb'),_0x4981ec,_0x6882('0xc'));_0x23f135(_0x382a0d[_0x6882('0x14')][_0x6882('0x12')]);}})[_0x6882('0x15')](function(_0x31715d){logger[_0x6882('0x10')](_0x6882('0xb'),_0x4981ec,_0x31715d);_0x1c0aed(_0x31715d);});});} \ No newline at end of file +var _0x3029=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug'];(function(_0x5e25b8,_0x19bd6f){var _0x123ce4=function(_0x501183){while(--_0x501183){_0x5e25b8['push'](_0x5e25b8['shift']());}};_0x123ce4(++_0x19bd6f);}(_0x3029,0x10b));var _0x9302=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0x3029[_0x33ebf5];return _0x66957b;};'use strict';var _=require(_0x9302('0x0'));var util=require('util');var moment=require(_0x9302('0x1'));var BPromise=require('bluebird');var rs=require(_0x9302('0x2'));var fs=require('fs');var Redis=require(_0x9302('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9302('0x4'));var logger=require(_0x9302('0x5'))(_0x9302('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9302('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f5725,_0x2d58ca,_0x9812cf){return new BPromise(function(_0x4c18ab,_0xcbb09e){return client[_0x9302('0x8')](_0x1f5725,_0x9812cf)[_0x9302('0x9')](function(_0x2ed737){logger[_0x9302('0xa')](_0x9302('0xb'),_0x2d58ca,'request\x20sent');logger[_0x9302('0xc')](_0x9302('0xd'),_0x2d58ca,'request\x20sent',JSON[_0x9302('0xe')](_0x2ed737));if(_0x2ed737[_0x9302('0xf')]){if(_0x2ed737[_0x9302('0xf')][_0x9302('0x10')]===0x1f4){logger[_0x9302('0xf')](_0x9302('0xb'),_0x2d58ca,_0x2ed737[_0x9302('0xf')]['message']);return _0xcbb09e(_0x2ed737[_0x9302('0xf')]['message']);}logger[_0x9302('0xf')](_0x9302('0xb'),_0x2d58ca,_0x2ed737[_0x9302('0xf')][_0x9302('0x11')]);return _0x4c18ab(_0x2ed737['error'][_0x9302('0x11')]);}else{logger['info'](_0x9302('0xb'),_0x2d58ca,_0x9302('0x12'));_0x4c18ab(_0x2ed737[_0x9302('0x13')][_0x9302('0x11')]);}})['catch'](function(_0x32136c){logger[_0x9302('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2d58ca,_0x32136c);_0xcbb09e(_0x32136c);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 3e39748..81b4781 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 _0x7b09=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','getQuestions','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1a628b,_0x2faaf0){var _0x5360c9=function(_0x107643){while(--_0x107643){_0x1a628b['push'](_0x1a628b['shift']());}};_0x5360c9(++_0x2faaf0);}(_0x7b09,0x176));var _0x97b0=function(_0x23755f,_0x573cb3){_0x23755f=_0x23755f-0x0;var _0x3c9da1=_0x7b09[_0x23755f];return _0x3c9da1;};'use strict';var multer=require(_0x97b0('0x0'));var util=require('util');var path=require(_0x97b0('0x1'));var timeout=require(_0x97b0('0x2'));var express=require(_0x97b0('0x3'));var router=express[_0x97b0('0x4')]();var fs_extra=require(_0x97b0('0x5'));var auth=require(_0x97b0('0x6'));var interaction=require(_0x97b0('0x7'));var config=require(_0x97b0('0x8'));var controller=require(_0x97b0('0x9'));router[_0x97b0('0xa')]('/',auth[_0x97b0('0xb')](),controller[_0x97b0('0xc')]);router['get'](_0x97b0('0xd'),auth['isAuthenticated'](),controller[_0x97b0('0xe')]);router[_0x97b0('0xa')]('/:id',auth[_0x97b0('0xb')](),controller[_0x97b0('0xf')]);router[_0x97b0('0xa')]('/:id/questions',auth[_0x97b0('0xb')](),controller[_0x97b0('0x10')]);router[_0x97b0('0x11')]('/',auth[_0x97b0('0xb')](),controller[_0x97b0('0x12')]);router[_0x97b0('0x13')](_0x97b0('0x14'),auth[_0x97b0('0xb')](),controller[_0x97b0('0x15')]);router[_0x97b0('0x16')](_0x97b0('0x14'),auth['isAuthenticated'](),controller[_0x97b0('0x17')]);module[_0x97b0('0x18')]=router; \ No newline at end of file +var _0xc954=['../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','/describe','isAuthenticated','describe','/:id','show','get','/:id/questions','getQuestions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x405c58,_0x152d14){var _0x44a0f4=function(_0x1f9733){while(--_0x1f9733){_0x405c58['push'](_0x405c58['shift']());}};_0x44a0f4(++_0x152d14);}(_0xc954,0x101));var _0x4c95=function(_0x247d26,_0x2766d7){_0x247d26=_0x247d26-0x0;var _0x32796a=_0xc954[_0x247d26];return _0x32796a;};'use strict';var multer=require(_0x4c95('0x0'));var util=require(_0x4c95('0x1'));var path=require(_0x4c95('0x2'));var timeout=require(_0x4c95('0x3'));var express=require(_0x4c95('0x4'));var router=express[_0x4c95('0x5')]();var fs_extra=require(_0x4c95('0x6'));var auth=require(_0x4c95('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4c95('0x8'));var controller=require(_0x4c95('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4c95('0xa'),auth[_0x4c95('0xb')](),controller[_0x4c95('0xc')]);router['get'](_0x4c95('0xd'),auth['isAuthenticated'](),controller[_0x4c95('0xe')]);router[_0x4c95('0xf')](_0x4c95('0x10'),auth[_0x4c95('0xb')](),controller[_0x4c95('0x11')]);router[_0x4c95('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c95('0x13')](_0x4c95('0xd'),auth[_0x4c95('0xb')](),controller[_0x4c95('0x14')]);router[_0x4c95('0x15')](_0x4c95('0xd'),auth[_0x4c95('0xb')](),controller[_0x4c95('0x16')]);module[_0x4c95('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 9841b35..d5f38f7 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 _0xc702=['BOOLEAN','moment','sequelize','DATE','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x3c1772,_0xa741f5){var _0x306d26=function(_0x56189f){while(--_0x56189f){_0x3c1772['push'](_0x3c1772['shift']());}};_0x306d26(++_0xa741f5);}(_0xc702,0xb0));var _0x2c70=function(_0x5f0e92,_0xe1a915){_0x5f0e92=_0x5f0e92-0x0;var _0x2fd607=_0xc702[_0x5f0e92];return _0x2fd607;};'use strict';var moment=require(_0x2c70('0x0'));var Sequelize=require(_0x2c70('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x2c70('0x2')],'set':function(_0x24d56a){this['setDataValue']('starttime',_0x24d56a);this[_0x2c70('0x3')]('endtime',moment()['format'](_0x2c70('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2c70('0x5')]},'projectname':{'type':Sequelize[_0x2c70('0x5')]},'queue':{'type':Sequelize[_0x2c70('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x2c70('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xf8f9=['sequelize','exports','setDataValue','endtime','DATE','STRING','BOOLEAN'];(function(_0x22826b,_0x2b28dc){var _0x259a47=function(_0x30fc75){while(--_0x30fc75){_0x22826b['push'](_0x22826b['shift']());}};_0x259a47(++_0x2b28dc);}(_0xf8f9,0x1b9));var _0x9f8f=function(_0x554687,_0x533791){_0x554687=_0x554687-0x0;var _0x1277fe=_0xf8f9[_0x554687];return _0x1277fe;};'use strict';var moment=require('moment');var Sequelize=require(_0x9f8f('0x0'));module[_0x9f8f('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0xd0af0c){this['setDataValue']('starttime',_0xd0af0c);this[_0x9f8f('0x2')](_0x9f8f('0x3'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x9f8f('0x4')]},'membername':{'type':Sequelize[_0x9f8f('0x5')]},'projectname':{'type':Sequelize[_0x9f8f('0x5')]},'queue':{'type':Sequelize[_0x9f8f('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x9f8f('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 9dd0725..4539ad1 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 _0xac04=['merge','find','create','body','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','length','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','update','then','error','name','index','map','rawAttributes','fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','JscriptySessionReport','includeAll','findAll','rows','catch','include'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0xac04,0x140));var _0x4ac0=function(_0x16f4ff,_0xb6dc74){_0x16f4ff=_0x16f4ff-0x0;var _0x248169=_0xac04[_0x16f4ff];return _0x248169;};'use strict';var emlformat=require(_0x4ac0('0x0'));var rimraf=require(_0x4ac0('0x1'));var zipdir=require(_0x4ac0('0x2'));var jsonpatch=require(_0x4ac0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ac0('0x4'));var Mustache=require(_0x4ac0('0x5'));var util=require(_0x4ac0('0x6'));var path=require(_0x4ac0('0x7'));var sox=require('sox');var csv=require(_0x4ac0('0x8'));var ejs=require(_0x4ac0('0x9'));var fs=require('fs');var fs_extra=require(_0x4ac0('0xa'));var _=require('lodash');var squel=require(_0x4ac0('0xb'));var crypto=require(_0x4ac0('0xc'));var jsforce=require(_0x4ac0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4ac0('0x8'));var querystring=require('querystring');var Papa=require(_0x4ac0('0xe'));var Redis=require(_0x4ac0('0xf'));var authService=require(_0x4ac0('0x10'));var qs=require(_0x4ac0('0x11'));var as=require(_0x4ac0('0x12'));var hardwareService=require(_0x4ac0('0x13'));var logger=require(_0x4ac0('0x14'))(_0x4ac0('0x15'));var utils=require(_0x4ac0('0x16'));var config=require(_0x4ac0('0x17'));var licenseUtil=require(_0x4ac0('0x18'));var db=require(_0x4ac0('0x19'))['db'];function respondWithStatusCode(_0x2a6a5c,_0x6e9365){_0x6e9365=_0x6e9365||0xcc;return function(_0x1a8fa5){if(_0x1a8fa5){return _0x2a6a5c[_0x4ac0('0x1a')](_0x6e9365);}return _0x2a6a5c[_0x4ac0('0x1b')](_0x6e9365)['end']();};}function respondWithResult(_0x154ff3,_0x3df4ed){_0x3df4ed=_0x3df4ed||0xc8;return function(_0x549e73){if(_0x549e73){return _0x154ff3['status'](_0x3df4ed)[_0x4ac0('0x1c')](_0x549e73);}};}function respondWithFilteredResult(_0x1e9ffb,_0x5ac3a4){return function(_0x2e7c4b){if(_0x2e7c4b){var _0x8645b5=typeof _0x5ac3a4[_0x4ac0('0x1d')]==='undefined'&&typeof _0x5ac3a4[_0x4ac0('0x1e')]===_0x4ac0('0x1f');var _0x3d0c75=_0x2e7c4b[_0x4ac0('0x20')];var _0x448966=_0x8645b5?0x0:_0x5ac3a4[_0x4ac0('0x1d')];var _0x25d825=_0x8645b5?_0x2e7c4b['count']:_0x5ac3a4['offset']+_0x5ac3a4[_0x4ac0('0x1e')];var _0x27794d;if(_0x25d825>=_0x3d0c75){_0x25d825=_0x3d0c75;_0x27794d=0xc8;}else{_0x27794d=0xce;}_0x1e9ffb[_0x4ac0('0x1b')](_0x27794d);return _0x1e9ffb['set'](_0x4ac0('0x21'),_0x448966+'-'+_0x25d825+'/'+_0x3d0c75)['json'](_0x2e7c4b);}return null;};}function patchUpdates(_0x4e015e){return function(_0x52e34f){try{jsonpatch['apply'](_0x52e34f,_0x4e015e,!![]);}catch(_0x2e950c){return BPromise[_0x4ac0('0x22')](_0x2e950c);}return _0x52e34f['save']();};}function saveUpdates(_0x580eda,_0x581e43){return function(_0x3550ac){if(_0x3550ac){return _0x3550ac[_0x4ac0('0x23')](_0x580eda)[_0x4ac0('0x24')](function(_0x280808){return _0x280808;});}return null;};}function removeEntity(_0xcd7447,_0x37d3db){return function(_0x5ddc8e){if(_0x5ddc8e){return _0x5ddc8e['destroy']()[_0x4ac0('0x24')](function(){_0xcd7447[_0x4ac0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50333c,_0x27fa84){return function(_0x28be08){if(!_0x28be08){_0x50333c[_0x4ac0('0x1a')](0x194);}return _0x28be08;};}function handleError(_0x196f1b,_0x369f9e){_0x369f9e=_0x369f9e||0x1f4;return function(_0x46223b){logger[_0x4ac0('0x25')](_0x46223b['stack']);if(_0x46223b[_0x4ac0('0x26')]){delete _0x46223b[_0x4ac0('0x26')];}_0x196f1b[_0x4ac0('0x1b')](_0x369f9e)['send'](_0x46223b);};}exports[_0x4ac0('0x27')]=function(_0x49134d,_0x6ba11){var _0x2c0118={},_0x352764={},_0x341917={'count':0x0,'rows':[]};var _0x4b9550=_[_0x4ac0('0x28')](db['JscriptySessionReport'][_0x4ac0('0x29')],function(_0x433068){return{'name':_0x433068[_0x4ac0('0x2a')],'type':_0x433068['type']['key']};});_0x352764['model']=_['map'](_0x4b9550,'name');_0x352764['query']=_[_0x4ac0('0x2b')](_0x49134d['query']);_0x352764[_0x4ac0('0x2c')]=_[_0x4ac0('0x2d')](_0x352764[_0x4ac0('0x2e')],_0x352764[_0x4ac0('0x2f')]);_0x2c0118[_0x4ac0('0x30')]=_['intersection'](_0x352764[_0x4ac0('0x2e')],qs[_0x4ac0('0x31')](_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x31')]));_0x2c0118['attributes']=_0x2c0118[_0x4ac0('0x30')]['length']?_0x2c0118[_0x4ac0('0x30')]:_0x352764[_0x4ac0('0x2e')];if(!_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x32')](_0x4ac0('0x33'))){_0x2c0118[_0x4ac0('0x1e')]=qs['limit'](_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x1e')]);_0x2c0118[_0x4ac0('0x1d')]=qs[_0x4ac0('0x1d')](_0x49134d[_0x4ac0('0x2f')]['offset']);}_0x2c0118[_0x4ac0('0x34')]=qs[_0x4ac0('0x35')](_0x49134d['query'][_0x4ac0('0x35')]);_0x2c0118[_0x4ac0('0x36')]=qs['filters'](_[_0x4ac0('0x37')](_0x49134d['query'],_0x352764[_0x4ac0('0x2c')]),_0x4b9550);if(_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x38')]){_0x2c0118['where']=_['merge'](_0x2c0118['where'],{'$or':_[_0x4ac0('0x28')](_0x4b9550,function(_0x1248ba){if(_0x1248ba[_0x4ac0('0x39')]!=='VIRTUAL'){var _0xf19014={};_0xf19014[_0x1248ba[_0x4ac0('0x26')]]={'$like':'%'+_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x38')]+'%'};return _0xf19014;}})});}_0x2c0118=_['merge']({},_0x2c0118,_0x49134d[_0x4ac0('0x3a')]);var _0x235cb1={'where':_0x2c0118[_0x4ac0('0x36')]};return db[_0x4ac0('0x3b')][_0x4ac0('0x20')](_0x235cb1)[_0x4ac0('0x24')](function(_0x19599b){_0x341917[_0x4ac0('0x20')]=_0x19599b;if(_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x3c')]){_0x2c0118['include']=[{'all':!![]}];}return db[_0x4ac0('0x3b')][_0x4ac0('0x3d')](_0x2c0118);})[_0x4ac0('0x24')](function(_0x3ffda3){_0x341917[_0x4ac0('0x3e')]=_0x3ffda3;return _0x341917;})[_0x4ac0('0x24')](respondWithFilteredResult(_0x6ba11,_0x2c0118))[_0x4ac0('0x3f')](handleError(_0x6ba11,null));};exports['show']=function(_0x252cd6,_0x28c5a0){var _0x19ef43={'raw':!![],'where':{'id':_0x252cd6['params']['id']}},_0xb502d2={};_0xb502d2[_0x4ac0('0x2e')]=_['keys'](db['JscriptySessionReport'][_0x4ac0('0x29')]);_0xb502d2[_0x4ac0('0x2f')]=_['keys'](_0x252cd6[_0x4ac0('0x2f')]);_0xb502d2[_0x4ac0('0x2c')]=_[_0x4ac0('0x2d')](_0xb502d2[_0x4ac0('0x2e')],_0xb502d2['query']);_0x19ef43['attributes']=_[_0x4ac0('0x2d')](_0xb502d2[_0x4ac0('0x2e')],qs['fields'](_0x252cd6['query'][_0x4ac0('0x31')]));_0x19ef43[_0x4ac0('0x30')]=_0x19ef43['attributes']['length']?_0x19ef43['attributes']:_0xb502d2[_0x4ac0('0x2e')];if(_0x252cd6['query'][_0x4ac0('0x3c')]){_0x19ef43[_0x4ac0('0x40')]=[{'all':!![]}];}_0x19ef43=_[_0x4ac0('0x41')]({},_0x19ef43,_0x252cd6[_0x4ac0('0x3a')]);return db[_0x4ac0('0x3b')][_0x4ac0('0x42')](_0x19ef43)[_0x4ac0('0x24')](handleEntityNotFound(_0x28c5a0,null))['then'](respondWithResult(_0x28c5a0,null))['catch'](handleError(_0x28c5a0,null));};exports[_0x4ac0('0x43')]=function(_0x8adac1,_0x47d726){return db[_0x4ac0('0x3b')]['create'](_0x8adac1[_0x4ac0('0x44')],{})[_0x4ac0('0x24')](respondWithResult(_0x47d726,0xc9))[_0x4ac0('0x3f')](handleError(_0x47d726,null));};exports['update']=function(_0x281f1e,_0x474768){if(_0x281f1e[_0x4ac0('0x44')]['id']){delete _0x281f1e[_0x4ac0('0x44')]['id'];}return db['JscriptySessionReport'][_0x4ac0('0x42')]({'where':{'id':_0x281f1e[_0x4ac0('0x45')]['id']}})[_0x4ac0('0x24')](handleEntityNotFound(_0x474768,null))[_0x4ac0('0x24')](saveUpdates(_0x281f1e[_0x4ac0('0x44')],null))['then'](respondWithResult(_0x474768,null))[_0x4ac0('0x3f')](handleError(_0x474768,null));};exports[_0x4ac0('0x46')]=function(_0x288168,_0x39cca0){return db[_0x4ac0('0x3b')][_0x4ac0('0x42')]({'where':{'id':_0x288168[_0x4ac0('0x45')]['id']}})[_0x4ac0('0x24')](handleEntityNotFound(_0x39cca0,null))[_0x4ac0('0x24')](removeEntity(_0x39cca0,null))['catch'](handleError(_0x39cca0,null));};exports[_0x4ac0('0x47')]=function(_0x542ee9,_0x1f8f49){return db[_0x4ac0('0x3b')][_0x4ac0('0x47')]()[_0x4ac0('0x24')](respondWithResult(_0x1f8f49,null))['catch'](handleError(_0x1f8f49,null));};exports[_0x4ac0('0x48')]=function(_0x27410b,_0x42ae16,_0x6a087f){var _0x8e32e6={'raw':!![],'where':{}};var _0x3b5750={};var _0x385f53={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4ac0('0x49')]({'where':{'id':_0x27410b[_0x4ac0('0x45')]['id']}})[_0x4ac0('0x24')](handleEntityNotFound(_0x42ae16,null))[_0x4ac0('0x24')](function(_0x562bc9){if(_0x562bc9){_0x3b5750['model']=_['keys'](db[_0x4ac0('0x4a')][_0x4ac0('0x29')]);_0x3b5750[_0x4ac0('0x2f')]=_[_0x4ac0('0x2b')](_0x27410b[_0x4ac0('0x2f')]);_0x3b5750[_0x4ac0('0x2c')]=_['intersection'](_0x3b5750[_0x4ac0('0x2e')],_0x3b5750['query']);_0x8e32e6[_0x4ac0('0x30')]=_[_0x4ac0('0x2d')](_0x3b5750[_0x4ac0('0x2e')],qs[_0x4ac0('0x31')](_0x27410b['query'][_0x4ac0('0x31')]));_0x8e32e6[_0x4ac0('0x30')]=_0x8e32e6[_0x4ac0('0x30')][_0x4ac0('0x4b')]?_0x8e32e6['attributes']:_0x3b5750[_0x4ac0('0x2e')];if(!_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x32')]('nolimit')){_0x8e32e6['limit']=qs[_0x4ac0('0x1e')](_0x27410b['query'][_0x4ac0('0x1e')]);_0x8e32e6[_0x4ac0('0x1d')]=qs[_0x4ac0('0x1d')](_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x1d')]);}_0x8e32e6['order']=qs[_0x4ac0('0x35')](_0x27410b[_0x4ac0('0x2f')]['sort']);_0x8e32e6['where']=qs[_0x4ac0('0x2c')](_[_0x4ac0('0x37')](_0x27410b[_0x4ac0('0x2f')],_0x3b5750[_0x4ac0('0x2c')]));_0x8e32e6[_0x4ac0('0x36')][_0x4ac0('0x4c')]=_0x562bc9['id'];if(_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x38')]){_0x8e32e6[_0x4ac0('0x36')]=_['merge'](_0x8e32e6[_0x4ac0('0x36')],{'$or':_[_0x4ac0('0x28')](_0x8e32e6[_0x4ac0('0x30')],function(_0x32ec36){var _0x363682={};_0x363682[_0x32ec36]={'$like':'%'+_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x38')]+'%'};return _0x363682;})});}_0x8e32e6=_[_0x4ac0('0x41')]({},_0x8e32e6,_0x27410b['options']);return db[_0x4ac0('0x4a')][_0x4ac0('0x20')]({'where':_0x8e32e6['where']})[_0x4ac0('0x24')](function(_0x11f526){_0x385f53[_0x4ac0('0x20')]=_0x11f526;if(_0x27410b['query'][_0x4ac0('0x3c')]){_0x8e32e6[_0x4ac0('0x40')]=[{'all':!![]}];}return db[_0x4ac0('0x4a')][_0x4ac0('0x3d')](_0x8e32e6);})[_0x4ac0('0x24')](function(_0x31cc1e){_0x385f53[_0x4ac0('0x3e')]=_0x31cc1e;return _0x385f53;});}})[_0x4ac0('0x24')](respondWithFilteredResult(_0x42ae16,_0x8e32e6))[_0x4ac0('0x3f')](handleError(_0x42ae16,null));}; \ No newline at end of file +var _0xe2c9=['reject','save','update','then','end','error','stack','name','index','map','JscriptySessionReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','params','keys','include','create','body','catch','destroy','find','describe','getQuestions','findOne','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x15ef2d,_0x461494){var _0x3197f5=function(_0x2c6dfb){while(--_0x2c6dfb){_0x15ef2d['push'](_0x15ef2d['shift']());}};_0x3197f5(++_0x461494);}(_0xe2c9,0xc8));var _0x9e2c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe2c9[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0x9e2c('0x0'));var rimraf=require(_0x9e2c('0x1'));var zipdir=require(_0x9e2c('0x2'));var jsonpatch=require(_0x9e2c('0x3'));var rp=require('request-promise');var moment=require(_0x9e2c('0x4'));var BPromise=require(_0x9e2c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9e2c('0x6'));var sox=require(_0x9e2c('0x7'));var csv=require(_0x9e2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e2c('0x9'));var squel=require(_0x9e2c('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e2c('0xb'));var deskjs=require(_0x9e2c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9e2c('0xd'));var Redis=require(_0x9e2c('0xe'));var authService=require(_0x9e2c('0xf'));var qs=require(_0x9e2c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e2c('0x11'));var logger=require(_0x9e2c('0x12'))(_0x9e2c('0x13'));var utils=require(_0x9e2c('0x14'));var config=require(_0x9e2c('0x15'));var licenseUtil=require(_0x9e2c('0x16'));var db=require(_0x9e2c('0x17'))['db'];function respondWithStatusCode(_0x47398e,_0x1bdc55){_0x1bdc55=_0x1bdc55||0xcc;return function(_0x54b4f9){if(_0x54b4f9){return _0x47398e[_0x9e2c('0x18')](_0x1bdc55);}return _0x47398e[_0x9e2c('0x19')](_0x1bdc55)['end']();};}function respondWithResult(_0x280f58,_0x77e191){_0x77e191=_0x77e191||0xc8;return function(_0x3d358f){if(_0x3d358f){return _0x280f58['status'](_0x77e191)[_0x9e2c('0x1a')](_0x3d358f);}};}function respondWithFilteredResult(_0x476bc1,_0x2f6a28){return function(_0x23ac97){if(_0x23ac97){var _0x203e8e=typeof _0x2f6a28[_0x9e2c('0x1b')]==='undefined'&&typeof _0x2f6a28[_0x9e2c('0x1c')]===_0x9e2c('0x1d');var _0x15538e=_0x23ac97['count'];var _0x3d3513=_0x203e8e?0x0:_0x2f6a28[_0x9e2c('0x1b')];var _0x2e8a64=_0x203e8e?_0x23ac97[_0x9e2c('0x1e')]:_0x2f6a28['offset']+_0x2f6a28['limit'];var _0x4b45ef;if(_0x2e8a64>=_0x15538e){_0x2e8a64=_0x15538e;_0x4b45ef=0xc8;}else{_0x4b45ef=0xce;}_0x476bc1[_0x9e2c('0x19')](_0x4b45ef);return _0x476bc1[_0x9e2c('0x1f')](_0x9e2c('0x20'),_0x3d3513+'-'+_0x2e8a64+'/'+_0x15538e)['json'](_0x23ac97);}return null;};}function patchUpdates(_0x1ee3fe){return function(_0x4ef6ee){try{jsonpatch[_0x9e2c('0x21')](_0x4ef6ee,_0x1ee3fe,!![]);}catch(_0x2d0dbc){return BPromise[_0x9e2c('0x22')](_0x2d0dbc);}return _0x4ef6ee[_0x9e2c('0x23')]();};}function saveUpdates(_0x316696,_0x1c0084){return function(_0x12e2aa){if(_0x12e2aa){return _0x12e2aa[_0x9e2c('0x24')](_0x316696)[_0x9e2c('0x25')](function(_0x121527){return _0x121527;});}return null;};}function removeEntity(_0x484ba4,_0x335f8f){return function(_0x291680){if(_0x291680){return _0x291680['destroy']()[_0x9e2c('0x25')](function(){_0x484ba4[_0x9e2c('0x19')](0xcc)[_0x9e2c('0x26')]();});}};}function handleEntityNotFound(_0x3b41e2,_0x1465b1){return function(_0x2daee2){if(!_0x2daee2){_0x3b41e2[_0x9e2c('0x18')](0x194);}return _0x2daee2;};}function handleError(_0x45044c,_0x252347){_0x252347=_0x252347||0x1f4;return function(_0x13f22a){logger[_0x9e2c('0x27')](_0x13f22a[_0x9e2c('0x28')]);if(_0x13f22a[_0x9e2c('0x29')]){delete _0x13f22a['name'];}_0x45044c['status'](_0x252347)['send'](_0x13f22a);};}exports[_0x9e2c('0x2a')]=function(_0x1d1a3a,_0x262c7e){var _0x5997ac={},_0x465480={},_0x21979c={'count':0x0,'rows':[]};var _0x3f0ce9=_[_0x9e2c('0x2b')](db[_0x9e2c('0x2c')]['rawAttributes'],function(_0x3340fd){return{'name':_0x3340fd[_0x9e2c('0x2d')],'type':_0x3340fd['type'][_0x9e2c('0x2e')]};});_0x465480[_0x9e2c('0x2f')]=_[_0x9e2c('0x2b')](_0x3f0ce9,'name');_0x465480[_0x9e2c('0x30')]=_['keys'](_0x1d1a3a['query']);_0x465480[_0x9e2c('0x31')]=_[_0x9e2c('0x32')](_0x465480[_0x9e2c('0x2f')],_0x465480['query']);_0x5997ac[_0x9e2c('0x33')]=_[_0x9e2c('0x32')](_0x465480['model'],qs[_0x9e2c('0x34')](_0x1d1a3a[_0x9e2c('0x30')]['fields']));_0x5997ac[_0x9e2c('0x33')]=_0x5997ac[_0x9e2c('0x33')][_0x9e2c('0x35')]?_0x5997ac[_0x9e2c('0x33')]:_0x465480['model'];if(!_0x1d1a3a[_0x9e2c('0x30')][_0x9e2c('0x36')](_0x9e2c('0x37'))){_0x5997ac[_0x9e2c('0x1c')]=qs[_0x9e2c('0x1c')](_0x1d1a3a['query'][_0x9e2c('0x1c')]);_0x5997ac[_0x9e2c('0x1b')]=qs[_0x9e2c('0x1b')](_0x1d1a3a[_0x9e2c('0x30')][_0x9e2c('0x1b')]);}_0x5997ac['order']=qs['sort'](_0x1d1a3a[_0x9e2c('0x30')][_0x9e2c('0x38')]);_0x5997ac[_0x9e2c('0x39')]=qs[_0x9e2c('0x31')](_[_0x9e2c('0x3a')](_0x1d1a3a[_0x9e2c('0x30')],_0x465480['filters']),_0x3f0ce9);if(_0x1d1a3a[_0x9e2c('0x30')][_0x9e2c('0x3b')]){_0x5997ac[_0x9e2c('0x39')]=_[_0x9e2c('0x3c')](_0x5997ac[_0x9e2c('0x39')],{'$or':_[_0x9e2c('0x2b')](_0x3f0ce9,function(_0x427e0b){if(_0x427e0b[_0x9e2c('0x3d')]!==_0x9e2c('0x3e')){var _0x2fef7e={};_0x2fef7e[_0x427e0b[_0x9e2c('0x29')]]={'$like':'%'+_0x1d1a3a[_0x9e2c('0x30')][_0x9e2c('0x3b')]+'%'};return _0x2fef7e;}})});}_0x5997ac=_[_0x9e2c('0x3c')]({},_0x5997ac,_0x1d1a3a[_0x9e2c('0x3f')]);var _0x51a230={'where':_0x5997ac['where']};return db[_0x9e2c('0x2c')][_0x9e2c('0x1e')](_0x51a230)['then'](function(_0x17012d){_0x21979c['count']=_0x17012d;if(_0x1d1a3a[_0x9e2c('0x30')][_0x9e2c('0x40')]){_0x5997ac['include']=[{'all':!![]}];}return db[_0x9e2c('0x2c')]['findAll'](_0x5997ac);})[_0x9e2c('0x25')](function(_0x2ed087){_0x21979c[_0x9e2c('0x41')]=_0x2ed087;return _0x21979c;})[_0x9e2c('0x25')](respondWithFilteredResult(_0x262c7e,_0x5997ac))['catch'](handleError(_0x262c7e,null));};exports['show']=function(_0x412193,_0x4a21ec){var _0x5ed344={'raw':!![],'where':{'id':_0x412193[_0x9e2c('0x42')]['id']}},_0x489bc9={};_0x489bc9[_0x9e2c('0x2f')]=_['keys'](db[_0x9e2c('0x2c')]['rawAttributes']);_0x489bc9['query']=_[_0x9e2c('0x43')](_0x412193[_0x9e2c('0x30')]);_0x489bc9['filters']=_[_0x9e2c('0x32')](_0x489bc9[_0x9e2c('0x2f')],_0x489bc9[_0x9e2c('0x30')]);_0x5ed344['attributes']=_[_0x9e2c('0x32')](_0x489bc9[_0x9e2c('0x2f')],qs[_0x9e2c('0x34')](_0x412193[_0x9e2c('0x30')][_0x9e2c('0x34')]));_0x5ed344[_0x9e2c('0x33')]=_0x5ed344['attributes'][_0x9e2c('0x35')]?_0x5ed344[_0x9e2c('0x33')]:_0x489bc9['model'];if(_0x412193[_0x9e2c('0x30')][_0x9e2c('0x40')]){_0x5ed344[_0x9e2c('0x44')]=[{'all':!![]}];}_0x5ed344=_[_0x9e2c('0x3c')]({},_0x5ed344,_0x412193[_0x9e2c('0x3f')]);return db[_0x9e2c('0x2c')]['find'](_0x5ed344)[_0x9e2c('0x25')](handleEntityNotFound(_0x4a21ec,null))[_0x9e2c('0x25')](respondWithResult(_0x4a21ec,null))['catch'](handleError(_0x4a21ec,null));};exports[_0x9e2c('0x45')]=function(_0x2ed2c8,_0x563732){return db[_0x9e2c('0x2c')][_0x9e2c('0x45')](_0x2ed2c8[_0x9e2c('0x46')],{})['then'](respondWithResult(_0x563732,0xc9))[_0x9e2c('0x47')](handleError(_0x563732,null));};exports[_0x9e2c('0x24')]=function(_0x325100,_0x2fa5e4){if(_0x325100[_0x9e2c('0x46')]['id']){delete _0x325100['body']['id'];}return db[_0x9e2c('0x2c')]['find']({'where':{'id':_0x325100[_0x9e2c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2fa5e4,null))['then'](saveUpdates(_0x325100[_0x9e2c('0x46')],null))[_0x9e2c('0x25')](respondWithResult(_0x2fa5e4,null))['catch'](handleError(_0x2fa5e4,null));};exports[_0x9e2c('0x48')]=function(_0x11ccfc,_0x4dfdb3){return db[_0x9e2c('0x2c')][_0x9e2c('0x49')]({'where':{'id':_0x11ccfc[_0x9e2c('0x42')]['id']}})['then'](handleEntityNotFound(_0x4dfdb3,null))[_0x9e2c('0x25')](removeEntity(_0x4dfdb3,null))['catch'](handleError(_0x4dfdb3,null));};exports[_0x9e2c('0x4a')]=function(_0x307f21,_0x3c1021){return db[_0x9e2c('0x2c')][_0x9e2c('0x4a')]()[_0x9e2c('0x25')](respondWithResult(_0x3c1021,null))['catch'](handleError(_0x3c1021,null));};exports[_0x9e2c('0x4b')]=function(_0x4f7481,_0x41b47a,_0x1eacae){var _0x36d6d6={'raw':!![],'where':{}};var _0xec6ba={};var _0x18d7f3={'count':0x0,'rows':[]};return db[_0x9e2c('0x2c')][_0x9e2c('0x4c')]({'where':{'id':_0x4f7481[_0x9e2c('0x42')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x41b47a,null))[_0x9e2c('0x25')](function(_0x24cc64){if(_0x24cc64){_0xec6ba[_0x9e2c('0x2f')]=_[_0x9e2c('0x43')](db[_0x9e2c('0x4d')]['rawAttributes']);_0xec6ba[_0x9e2c('0x30')]=_[_0x9e2c('0x43')](_0x4f7481[_0x9e2c('0x30')]);_0xec6ba[_0x9e2c('0x31')]=_[_0x9e2c('0x32')](_0xec6ba[_0x9e2c('0x2f')],_0xec6ba[_0x9e2c('0x30')]);_0x36d6d6[_0x9e2c('0x33')]=_[_0x9e2c('0x32')](_0xec6ba[_0x9e2c('0x2f')],qs[_0x9e2c('0x34')](_0x4f7481[_0x9e2c('0x30')][_0x9e2c('0x34')]));_0x36d6d6[_0x9e2c('0x33')]=_0x36d6d6[_0x9e2c('0x33')][_0x9e2c('0x35')]?_0x36d6d6[_0x9e2c('0x33')]:_0xec6ba[_0x9e2c('0x2f')];if(!_0x4f7481[_0x9e2c('0x30')][_0x9e2c('0x36')](_0x9e2c('0x37'))){_0x36d6d6[_0x9e2c('0x1c')]=qs[_0x9e2c('0x1c')](_0x4f7481[_0x9e2c('0x30')][_0x9e2c('0x1c')]);_0x36d6d6['offset']=qs[_0x9e2c('0x1b')](_0x4f7481['query'][_0x9e2c('0x1b')]);}_0x36d6d6['order']=qs['sort'](_0x4f7481['query'][_0x9e2c('0x38')]);_0x36d6d6['where']=qs['filters'](_['pick'](_0x4f7481['query'],_0xec6ba[_0x9e2c('0x31')]));_0x36d6d6['where']['SessionId']=_0x24cc64['id'];if(_0x4f7481[_0x9e2c('0x30')][_0x9e2c('0x3b')]){_0x36d6d6[_0x9e2c('0x39')]=_['merge'](_0x36d6d6[_0x9e2c('0x39')],{'$or':_['map'](_0x36d6d6[_0x9e2c('0x33')],function(_0xd038c3){var _0x501d69={};_0x501d69[_0xd038c3]={'$like':'%'+_0x4f7481[_0x9e2c('0x30')][_0x9e2c('0x3b')]+'%'};return _0x501d69;})});}_0x36d6d6=_[_0x9e2c('0x3c')]({},_0x36d6d6,_0x4f7481[_0x9e2c('0x3f')]);return db[_0x9e2c('0x4d')][_0x9e2c('0x1e')]({'where':_0x36d6d6['where']})[_0x9e2c('0x25')](function(_0x354537){_0x18d7f3['count']=_0x354537;if(_0x4f7481[_0x9e2c('0x30')][_0x9e2c('0x40')]){_0x36d6d6[_0x9e2c('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x36d6d6);})['then'](function(_0x30cd83){_0x18d7f3[_0x9e2c('0x41')]=_0x30cd83;return _0x18d7f3;});}})[_0x9e2c('0x25')](respondWithFilteredResult(_0x41b47a,_0x36d6d6))[_0x9e2c('0x47')](handleError(_0x41b47a,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 02474d8..620f717 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 _0xd101=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd101,0xc1));var _0x1d10=function(_0x23fc42,_0x4f70f6){_0x23fc42=_0x23fc42-0x0;var _0x2743ee=_0xd101[_0x23fc42];return _0x2743ee;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var logger=require(_0x1d10('0x1'))(_0x1d10('0x2'));var moment=require(_0x1d10('0x3'));var BPromise=require(_0x1d10('0x4'));var rp=require(_0x1d10('0x5'));var fs=require('fs');var path=require(_0x1d10('0x6'));var rimraf=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var attributes=require('./jscriptySessionReport.attributes');module[_0x1d10('0x9')]=function(_0x203072,_0x2a4e2d){return _0x203072[_0x1d10('0xa')](_0x1d10('0xb'),attributes,{'tableName':_0x1d10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e24=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash'];(function(_0x5aad9b,_0x4875bf){var _0x4fedde=function(_0x234ff0){while(--_0x234ff0){_0x5aad9b['push'](_0x5aad9b['shift']());}};_0x4fedde(++_0x4875bf);}(_0x3e24,0x167));var _0x43e2=function(_0x168107,_0x27a857){_0x168107=_0x168107-0x0;var _0x4a9762=_0x3e24[_0x168107];return _0x4a9762;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var logger=require(_0x43e2('0x2'))(_0x43e2('0x3'));var moment=require(_0x43e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x43e2('0x5'));var fs=require('fs');var path=require(_0x43e2('0x6'));var rimraf=require('rimraf');var config=require(_0x43e2('0x7'));var attributes=require(_0x43e2('0x8'));module[_0x43e2('0x9')]=function(_0x28b144,_0x43b5a7){return _0x28b144[_0x43e2('0xa')](_0x43e2('0xb'),attributes,{'tableName':'report_jscripty_sessions','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 f831d4d..b710f0c 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 _0x4e2e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x7ed58b,_0x1bf233){var _0x2322db=function(_0x5b5787){while(--_0x5b5787){_0x7ed58b['push'](_0x7ed58b['shift']());}};_0x2322db(++_0x1bf233);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x26219f,_0x3207a2){_0x26219f=_0x26219f-0x0;var _0x20bed7=_0x4e2e[_0x26219f];return _0x20bed7;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});} \ No newline at end of file +var _0x32b6=['JscriptySessionReport,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0xf370ee,_0x4f6dbc){var _0x5496dc=function(_0x55ca45){while(--_0x55ca45){_0xf370ee['push'](_0xf370ee['shift']());}};_0x5496dc(++_0x4f6dbc);}(_0x32b6,0x1d1));var _0x632b=function(_0x4ea29e,_0xc5d67a){_0x4ea29e=_0x4ea29e-0x0;var _0x5b3cfc=_0x32b6[_0x4ea29e];return _0x5b3cfc;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 0c40e59..c04905a 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 _0x8d0e=['./license.controller','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x581c23,_0x485718){var _0x2dea41=function(_0x16cfaa){while(--_0x16cfaa){_0x581c23['push'](_0x581c23['shift']());}};_0x2dea41(++_0x485718);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x281eaa,_0x453dd6){_0x281eaa=_0x281eaa-0x0;var _0x287af4=_0x8d0e[_0x281eaa];return _0x287af4;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',controller['index']);router[_0xe8d0('0xa')](_0xe8d0('0xb'),auth[_0xe8d0('0xc')](),controller[_0xe8d0('0xd')]);module[_0xe8d0('0xe')]=router; \ No newline at end of file +var _0xdcd9=['put','/:id','isAuthenticated','update','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x19f651,_0x566272){var _0x3658a1=function(_0x3a2da7){while(--_0x3a2da7){_0x19f651['push'](_0x19f651['shift']());}};_0x3658a1(++_0x566272);}(_0xdcd9,0xf5));var _0x9dcd=function(_0x228913,_0xea0421){_0x228913=_0x228913-0x0;var _0x4efe3d=_0xdcd9[_0x228913];return _0x4efe3d;};'use strict';var multer=require('multer');var util=require(_0x9dcd('0x0'));var path=require('path');var timeout=require(_0x9dcd('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9dcd('0x2'));var auth=require(_0x9dcd('0x3'));var interaction=require(_0x9dcd('0x4'));var config=require(_0x9dcd('0x5'));var controller=require(_0x9dcd('0x6'));router['get']('/',controller['index']);router[_0x9dcd('0x7')](_0x9dcd('0x8'),auth[_0x9dcd('0x9')](),controller[_0x9dcd('0xa')]);module[_0x9dcd('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9201653..132d903 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 _0x08d8=['exports','TEXT','INTEGER'];(function(_0x1df8b8,_0x25c2bb){var _0x5696db=function(_0xcf4ffb){while(--_0xcf4ffb){_0x1df8b8['push'](_0x1df8b8['shift']());}};_0x5696db(++_0x25c2bb);}(_0x08d8,0x99));var _0x808d=function(_0xca19df,_0xda79a5){_0xca19df=_0xca19df-0x0;var _0x512318=_0x08d8[_0xca19df];return _0x512318;};'use strict';var Sequelize=require('sequelize');module[_0x808d('0x0')]={'license':{'type':Sequelize[_0x808d('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x808d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d6e=['INTEGER','sequelize','exports','TEXT'];(function(_0x2af848,_0x575deb){var _0x56c89e=function(_0x23fcc0){while(--_0x23fcc0){_0x2af848['push'](_0x2af848['shift']());}};_0x56c89e(++_0x575deb);}(_0x2d6e,0xd9));var _0xe2d6=function(_0x4786cb,_0x56aad7){_0x4786cb=_0x4786cb-0x0;var _0x34a608=_0x2d6e[_0x4786cb];return _0x34a608;};'use strict';var Sequelize=require(_0xe2d6('0x0'));module[_0xe2d6('0x1')]={'license':{'type':Sequelize[_0xe2d6('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xe2d6('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 4d98479..a36e68d 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 _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(_0x1c9d4c,_0x37ff13){var _0x28e069=function(_0x3524b6){while(--_0x3524b6){_0x1c9d4c['push'](_0x1c9d4c['shift']());}};_0x28e069(++_0x37ff13);}(_0x4975,0x86));var _0x5497=function(_0x81e65e,_0x57cd6d){_0x81e65e=_0x81e65e-0x0;var _0x313776=_0x4975[_0x81e65e];return _0x313776;};'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 +var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xf494,0x1c6));var _0x4f49=function(_0x503884,_0x4741fe){_0x503884=_0x503884-0x0;var _0x5d4596=_0xf494[_0x503884];return _0x5d4596;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index c7823ed..914ea97 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 _0x0833=['path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0833,0x167));var _0x3083=function(_0x25ccdb,_0x207235){_0x25ccdb=_0x25ccdb-0x0;var _0x2bb45d=_0x0833[_0x25ccdb];return _0x2bb45d;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var logger=require(_0x3083('0x2'))(_0x3083('0x3'));var moment=require('moment');var BPromise=require(_0x3083('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3083('0x5'));var rimraf=require(_0x3083('0x6'));var config=require(_0x3083('0x7'));var attributes=require(_0x3083('0x8'));module[_0x3083('0x9')]=function(_0x515284,_0x53c513){return _0x515284[_0x3083('0xa')](_0x3083('0xb'),attributes,{'tableName':_0x3083('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fa6=['path','rimraf','exports','define','license','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ab819,_0x131b90){var _0x6ca84f=function(_0x3080c5){while(--_0x3080c5){_0x1ab819['push'](_0x1ab819['shift']());}};_0x6ca84f(++_0x131b90);}(_0x6fa6,0x102));var _0x66fa=function(_0x2b12fa,_0x26df75){_0x2b12fa=_0x2b12fa-0x0;var _0x17d80b=_0x6fa6[_0x2b12fa];return _0x17d80b;};'use strict';var _=require('lodash');var util=require(_0x66fa('0x0'));var logger=require(_0x66fa('0x1'))(_0x66fa('0x2'));var moment=require(_0x66fa('0x3'));var BPromise=require(_0x66fa('0x4'));var rp=require(_0x66fa('0x5'));var fs=require('fs');var path=require(_0x66fa('0x6'));var rimraf=require(_0x66fa('0x7'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0x66fa('0x8')]=function(_0x50600f,_0x158962){return _0x50600f[_0x66fa('0x9')]('License',attributes,{'tableName':_0x66fa('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 7b388c3..862aa0f 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 _0xc259=['License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x405b0d,_0x5533a2){var _0x6ef51=function(_0x28fce0){while(--_0x28fce0){_0x405b0d['push'](_0x405b0d['shift']());}};_0x6ef51(++_0x5533a2);}(_0xc259,0x66));var _0x9c25=function(_0x45f062,_0x788c49){_0x45f062=_0x45f062-0x0;var _0xeb972=_0xc259[_0x45f062];return _0xeb972;};'use strict';var _=require('lodash');var util=require(_0x9c25('0x0'));var moment=require(_0x9c25('0x1'));var BPromise=require(_0x9c25('0x2'));var rs=require(_0x9c25('0x3'));var fs=require('fs');var Redis=require(_0x9c25('0x4'));var db=require(_0x9c25('0x5'))['db'];var utils=require(_0x9c25('0x6'));var logger=require(_0x9c25('0x7'))(_0x9c25('0x8'));var config=require(_0x9c25('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9c25('0xa')][_0x9c25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3dd956,_0x3380da,_0x129f6b){return new BPromise(function(_0x310f7b,_0x2ad92d){return client[_0x9c25('0xc')](_0x3dd956,_0x129f6b)[_0x9c25('0xd')](function(_0x5e9187){logger[_0x9c25('0xe')](_0x9c25('0xf'),_0x3380da,_0x9c25('0x10'));logger[_0x9c25('0x11')](_0x9c25('0x12'),_0x3380da,_0x9c25('0x10'),JSON['stringify'](_0x5e9187));if(_0x5e9187['error']){if(_0x5e9187[_0x9c25('0x13')][_0x9c25('0x14')]===0x1f4){logger[_0x9c25('0x13')](_0x9c25('0xf'),_0x3380da,_0x5e9187[_0x9c25('0x13')]['message']);return _0x2ad92d(_0x5e9187[_0x9c25('0x13')]['message']);}logger['error'](_0x9c25('0xf'),_0x3380da,_0x5e9187[_0x9c25('0x13')][_0x9c25('0x15')]);return _0x310f7b(_0x5e9187[_0x9c25('0x13')][_0x9c25('0x15')]);}else{logger[_0x9c25('0xe')](_0x9c25('0xf'),_0x3380da,'request\x20sent');_0x310f7b(_0x5e9187[_0x9c25('0x16')]['message']);}})[_0x9c25('0x17')](function(_0x44c762){logger[_0x9c25('0x13')]('License,\x20%s,\x20%s',_0x3380da,_0x44c762);_0x2ad92d(_0x44c762);});});} \ No newline at end of file +var _0xa906=['../../config/environment','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x267771,_0x46c84b){var _0x38c948=function(_0x456833){while(--_0x456833){_0x267771['push'](_0x267771['shift']());}};_0x38c948(++_0x46c84b);}(_0xa906,0x1f1));var _0x6a90=function(_0x4c6671,_0x44fc02){_0x4c6671=_0x4c6671-0x0;var _0x4497a4=_0xa906[_0x4c6671];return _0x4497a4;};'use strict';var _=require(_0x6a90('0x0'));var util=require(_0x6a90('0x1'));var moment=require(_0x6a90('0x2'));var BPromise=require(_0x6a90('0x3'));var rs=require(_0x6a90('0x4'));var fs=require('fs');var Redis=require(_0x6a90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a90('0x6'));var logger=require(_0x6a90('0x7'))(_0x6a90('0x8'));var config=require(_0x6a90('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6a90('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x233c03,_0xd284dd,_0x5a1c92){return new BPromise(function(_0x5f3108,_0x4910d8){return client[_0x6a90('0xb')](_0x233c03,_0x5a1c92)[_0x6a90('0xc')](function(_0x126ec2){logger[_0x6a90('0xd')](_0x6a90('0xe'),_0xd284dd,_0x6a90('0xf'));logger[_0x6a90('0x10')](_0x6a90('0x11'),_0xd284dd,_0x6a90('0xf'),JSON[_0x6a90('0x12')](_0x126ec2));if(_0x126ec2[_0x6a90('0x13')]){if(_0x126ec2[_0x6a90('0x13')][_0x6a90('0x14')]===0x1f4){logger[_0x6a90('0x13')](_0x6a90('0xe'),_0xd284dd,_0x126ec2[_0x6a90('0x13')]['message']);return _0x4910d8(_0x126ec2['error']['message']);}logger[_0x6a90('0x13')](_0x6a90('0xe'),_0xd284dd,_0x126ec2['error'][_0x6a90('0x15')]);return _0x5f3108(_0x126ec2[_0x6a90('0x13')][_0x6a90('0x15')]);}else{logger[_0x6a90('0xd')](_0x6a90('0xe'),_0xd284dd,_0x6a90('0xf'));_0x5f3108(_0x126ec2['result']['message']);}})[_0x6a90('0x16')](function(_0x8a9740){logger['error'](_0x6a90('0xe'),_0xd284dd,_0x8a9740);_0x4910d8(_0x8a9740);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 98daab2..de1de41 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 _0xde26=['/:id/messages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addApplications','/:id/send','addAgents','put','update','delete','/:id/dispositions','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x2a86bd,_0x2155e4){var _0x257408=function(_0x2c96e2){while(--_0x2c96e2){_0x2a86bd['push'](_0x2a86bd['shift']());}};_0x257408(++_0x2155e4);}(_0xde26,0xa9));var _0x6de2=function(_0x44d28c,_0x3a197b){_0x44d28c=_0x44d28c-0x0;var _0x754673=_0xde26[_0x44d28c];return _0x754673;};'use strict';var multer=require(_0x6de2('0x0'));var util=require(_0x6de2('0x1'));var path=require(_0x6de2('0x2'));var timeout=require(_0x6de2('0x3'));var express=require(_0x6de2('0x4'));var router=express['Router']();var fs_extra=require(_0x6de2('0x5'));var auth=require(_0x6de2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6de2('0x7'));var controller=require(_0x6de2('0x8'));router[_0x6de2('0x9')]('/',auth[_0x6de2('0xa')](),controller[_0x6de2('0xb')]);router['get'](_0x6de2('0xc'),auth[_0x6de2('0xa')](),controller[_0x6de2('0xd')]);router['get'](_0x6de2('0xe'),auth[_0x6de2('0xa')](),controller[_0x6de2('0xf')]);router[_0x6de2('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6de2('0x10')]);router[_0x6de2('0x9')](_0x6de2('0x11'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x12')]);router[_0x6de2('0x9')](_0x6de2('0x13'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x14')]);router[_0x6de2('0x9')](_0x6de2('0x15'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x16')]);router[_0x6de2('0x9')](_0x6de2('0x17'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x18')]);router[_0x6de2('0x9')](_0x6de2('0x19'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x1a')]);router[_0x6de2('0x9')](_0x6de2('0x1b'),auth[_0x6de2('0xa')](),controller['getMessages']);router[_0x6de2('0x9')](_0x6de2('0x1c'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x1d')]);router[_0x6de2('0x9')](_0x6de2('0x1e'),auth[_0x6de2('0xa')](),controller['getAgents']);router[_0x6de2('0x1f')]('/:id/dispositions',auth[_0x6de2('0xa')](),controller[_0x6de2('0x20')]);router['post'](_0x6de2('0x11'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x21')]);router['post']('/',auth[_0x6de2('0xa')](),controller[_0x6de2('0x22')]);router[_0x6de2('0x1f')](_0x6de2('0x13'),auth['isAuthenticated'](),controller['addImap']);router['post']('/:id/out_servers',auth[_0x6de2('0xa')](),controller['addSmtp']);router[_0x6de2('0x1f')](_0x6de2('0x17'),auth[_0x6de2('0xa')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x6de2('0x23')]);router['post'](_0x6de2('0x24'),auth[_0x6de2('0xa')](),controller['send']);router[_0x6de2('0x1f')](_0x6de2('0x1e'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x25')]);router[_0x6de2('0x26')](_0x6de2('0xe'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x27')]);router[_0x6de2('0x28')](_0x6de2('0x29'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x2a')]);router[_0x6de2('0x28')](_0x6de2('0x11'),auth['isAuthenticated'](),controller[_0x6de2('0x2b')]);router[_0x6de2('0x28')]('/:id/in_servers',auth[_0x6de2('0xa')](),controller[_0x6de2('0x2c')]);router['delete']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x6de2('0x2d')]);router[_0x6de2('0x28')]('/:id',auth[_0x6de2('0xa')](),controller[_0x6de2('0x2e')]);router[_0x6de2('0x28')](_0x6de2('0x1e'),auth['isAuthenticated'](),controller[_0x6de2('0x2f')]);module[_0x6de2('0x30')]=router; \ No newline at end of file +var _0xcff9=['/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','send','/:id/users','addAgents','put','update','delete','removeAnswers','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x40ef2f,_0x58f7ea){var _0x18c283=function(_0x2df62f){while(--_0x2df62f){_0x40ef2f['push'](_0x40ef2f['shift']());}};_0x18c283(++_0x58f7ea);}(_0xcff9,0xeb));var _0x9cff=function(_0x9b3115,_0x5f24e3){_0x9b3115=_0x9b3115-0x0;var _0x27ea2c=_0xcff9[_0x9b3115];return _0x27ea2c;};'use strict';var multer=require(_0x9cff('0x0'));var util=require(_0x9cff('0x1'));var path=require(_0x9cff('0x2'));var timeout=require(_0x9cff('0x3'));var express=require('express');var router=express[_0x9cff('0x4')]();var fs_extra=require(_0x9cff('0x5'));var auth=require(_0x9cff('0x6'));var interaction=require(_0x9cff('0x7'));var config=require(_0x9cff('0x8'));var controller=require(_0x9cff('0x9'));router[_0x9cff('0xa')]('/',auth[_0x9cff('0xb')](),controller[_0x9cff('0xc')]);router['get'](_0x9cff('0xd'),auth['isAuthenticated'](),controller[_0x9cff('0xe')]);router['get'](_0x9cff('0xf'),auth['isAuthenticated'](),controller[_0x9cff('0x10')]);router[_0x9cff('0xa')](_0x9cff('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x9cff('0xa')](_0x9cff('0x12'),auth['isAuthenticated'](),controller[_0x9cff('0x13')]);router[_0x9cff('0xa')]('/:id/in_servers',auth['isAuthenticated'](),controller['getImap']);router[_0x9cff('0xa')](_0x9cff('0x14'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x15')]);router[_0x9cff('0xa')](_0x9cff('0x16'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x17')]);router[_0x9cff('0xa')](_0x9cff('0x18'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x19')]);router[_0x9cff('0xa')](_0x9cff('0x1a'),auth[_0x9cff('0xb')](),controller['getMessages']);router[_0x9cff('0xa')](_0x9cff('0x1b'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x1c')]);router[_0x9cff('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x9cff('0x1d')]);router[_0x9cff('0x1e')]('/:id/dispositions',auth[_0x9cff('0xb')](),controller[_0x9cff('0x1f')]);router[_0x9cff('0x1e')]('/:id/canned_answers',auth[_0x9cff('0xb')](),controller[_0x9cff('0x20')]);router['post']('/',auth[_0x9cff('0xb')](),controller[_0x9cff('0x21')]);router[_0x9cff('0x1e')](_0x9cff('0x22'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x23')]);router['post'](_0x9cff('0x14'),auth['isAuthenticated'](),controller[_0x9cff('0x24')]);router[_0x9cff('0x1e')](_0x9cff('0x16'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x25')]);router['post']('/:id/applications',auth[_0x9cff('0xb')](),controller[_0x9cff('0x26')]);router[_0x9cff('0x1e')]('/:id/send',auth[_0x9cff('0xb')](),controller[_0x9cff('0x27')]);router[_0x9cff('0x1e')](_0x9cff('0x28'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x29')]);router[_0x9cff('0x2a')](_0x9cff('0xf'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x2b')]);router[_0x9cff('0x2c')](_0x9cff('0x11'),auth[_0x9cff('0xb')](),controller['removeDispositions']);router[_0x9cff('0x2c')]('/:id/canned_answers',auth[_0x9cff('0xb')](),controller[_0x9cff('0x2d')]);router[_0x9cff('0x2c')](_0x9cff('0x22'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x2e')]);router[_0x9cff('0x2c')]('/:id/out_servers',auth['isAuthenticated'](),controller['removeSmtp']);router[_0x9cff('0x2c')](_0x9cff('0xf'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x2f')]);router[_0x9cff('0x2c')](_0x9cff('0x28'),auth[_0x9cff('0xb')](),controller[_0x9cff('0x30')]);module[_0x9cff('0x31')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index c26f5be..0b1a034 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 _0xfd7b=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports'];(function(_0x187ee1,_0x486fdd){var _0x174752=function(_0xd96a00){while(--_0xd96a00){_0x187ee1['push'](_0x187ee1['shift']());}};_0x174752(++_0x486fdd);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xfd7b[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require('sequelize');module[_0xbfd7('0x0')]={'description':{'type':Sequelize[_0xbfd7('0x1')]},'name':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xbfd7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xbfd7('0x3')]},'markAsUnread':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![],'defaultValue':_0xbfd7('0x4')},'fontSize':{'type':Sequelize[_0xbfd7('0x5')](0x2)[_0xbfd7('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbfd7('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbfd7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbfd7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xbfd7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x53ad21){if(!_0x53ad21)this[_0xbfd7('0x9')](_0xbfd7('0xa'),null);this[_0xbfd7('0x9')](_0xbfd7('0xb'),_0x53ad21);}}}; \ No newline at end of file +var _0x2121=['TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','exports','BOOLEAN','STRING'];(function(_0xdd98a7,_0x322d6b){var _0x21bb81=function(_0x58b300){while(--_0x58b300){_0xdd98a7['push'](_0xdd98a7['shift']());}};_0x21bb81(++_0x322d6b);}(_0x2121,0x1b4));var _0x1212=function(_0x450c9d,_0x3b60fe){_0x450c9d=_0x450c9d-0x0;var _0x1776e0=_0x2121[_0x450c9d];return _0x1776e0;};'use strict';var Sequelize=require(_0x1212('0x0'));module[_0x1212('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x1212('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1212('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1212('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x1212('0x3')],'allowNull':![]},'template':{'type':Sequelize[_0x1212('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1212('0x3')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x1212('0x5')](0x2)[_0x1212('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1212('0x4')],'defaultValue':function(){return _0x1212('0x7');}},'notificationSound':{'type':Sequelize[_0x1212('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1212('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1212('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1212('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1212('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1212('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1212('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1212('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5cd5d6){if(!_0x5cd5d6)this[_0x1212('0x9')](_0x1212('0xa'),null);this[_0x1212('0x9')]('mandatoryDisposition',_0x5cd5d6);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index ec6f872..3b94a87 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 _0x425d=['Disposition','create','getDispositions','findAll','rows','removeDispositions','CannedAnswer','getAnswers','includeAll','removeAnswers','ids','email','isNil','active','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','findOne','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','getInteractions','include','Contact','User','Owner','internal','Tag','color','tag','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','true','List','CmContact','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','secure','auth','List\x20not\x20found','Contacts','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','UserProfileResource','name','send','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','MailAccount','params','Pause','body','find','describe','addDisposition','MailAccountId'];(function(_0x9aad68,_0x45377){var _0x281340=function(_0x494ac1){while(--_0x494ac1){_0x9aad68['push'](_0x9aad68['shift']());}};_0x281340(++_0x45377);}(_0x425d,0x1e0));var _0xd425=function(_0x1a34ab,_0x5bb305){_0x1a34ab=_0x1a34ab-0x0;var _0x46379e=_0x425d[_0x1a34ab];return _0x46379e;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var htmlToText=require(_0xd425('0x12'));var juice=require(_0xd425('0x13'));var Redis=require(_0xd425('0x14'));var authService=require(_0xd425('0x15'));var qs=require(_0xd425('0x16'));var as=require(_0xd425('0x17'));var hardwareService=require(_0xd425('0x18'));var logger=require(_0xd425('0x19'))(_0xd425('0x1a'));var utils=require(_0xd425('0x1b'));var config=require(_0xd425('0x1c'));var licenseUtil=require(_0xd425('0x1d'));var db=require(_0xd425('0x1e'))['db'];config[_0xd425('0x1f')]=_[_0xd425('0x20')](config['redis'],{'host':_0xd425('0x21'),'port':0x18eb});var socket=require(_0xd425('0x22'))(new Redis(config[_0xd425('0x1f')]));require('./mailAccount.socket')[_0xd425('0x23')](socket);var jayson=require(_0xd425('0x24'));var client=jayson[_0xd425('0x25')][_0xd425('0x26')]({'port':0x232b});function respondWithRpcPromise(_0x1fc822,_0x538a0a,_0x278626,_0x471267){return new BPromise(function(_0x7e267e,_0x5dda0c){var _0x5d6585=_0x471267||client;return _0x5d6585[_0xd425('0x27')](_0x1fc822,_0x278626)[_0xd425('0x28')](function(_0x467a6c){logger[_0xd425('0x29')]('MailAccount,\x20%s,\x20%s',_0x538a0a,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x538a0a,_0xd425('0x2a'),JSON[_0xd425('0x2b')](_0x467a6c));if(_0x467a6c[_0xd425('0x2c')]){if(_0x467a6c['error'][_0xd425('0x2d')]===0x1f4){logger[_0xd425('0x2c')]('MailAccount,\x20%s,\x20%s',_0x538a0a,_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);return _0x5dda0c(_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);}logger[_0xd425('0x2c')](_0xd425('0x2f'),_0x538a0a,_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);return _0x7e267e(_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);}else{logger[_0xd425('0x29')](_0xd425('0x2f'),_0x538a0a,'request\x20sent');_0x7e267e(_0x467a6c[_0xd425('0x30')][_0xd425('0x2e')]);}})[_0xd425('0x31')](function(_0x1908a5){logger[_0xd425('0x2c')](_0xd425('0x2f'),_0x538a0a,_0x1908a5);_0x5dda0c(_0x1908a5);});});}function respondWithStatusCode(_0x3c3402,_0x577e4b){_0x577e4b=_0x577e4b||0xcc;return function(_0x12f951){if(_0x12f951){return _0x3c3402[_0xd425('0x32')](_0x577e4b);}return _0x3c3402[_0xd425('0x33')](_0x577e4b)['end']();};}function respondWithResult(_0x27ef8a,_0x3ad9bd){_0x3ad9bd=_0x3ad9bd||0xc8;return function(_0x433189){if(_0x433189){return _0x27ef8a[_0xd425('0x33')](_0x3ad9bd)[_0xd425('0x34')](_0x433189);}};}function respondWithFilteredResult(_0x185d7e,_0x2fd17a){return function(_0x37b63c){if(_0x37b63c){var _0x24da23=typeof _0x2fd17a[_0xd425('0x35')]==='undefined'&&typeof _0x2fd17a[_0xd425('0x36')]===_0xd425('0x37');var _0x298602=_0x37b63c[_0xd425('0x38')];var _0x3275b1=_0x24da23?0x0:_0x2fd17a[_0xd425('0x35')];var _0x47405f=_0x24da23?_0x37b63c[_0xd425('0x38')]:_0x2fd17a[_0xd425('0x35')]+_0x2fd17a[_0xd425('0x36')];var _0x3583b0;if(_0x47405f>=_0x298602){_0x47405f=_0x298602;_0x3583b0=0xc8;}else{_0x3583b0=0xce;}_0x185d7e['status'](_0x3583b0);return _0x185d7e[_0xd425('0x39')](_0xd425('0x3a'),_0x3275b1+'-'+_0x47405f+'/'+_0x298602)[_0xd425('0x34')](_0x37b63c);}return null;};}function patchUpdates(_0x21e0bd){return function(_0x28870f){try{jsonpatch['apply'](_0x28870f,_0x21e0bd,!![]);}catch(_0x4aa168){return BPromise[_0xd425('0x3b')](_0x4aa168);}return _0x28870f['save']();};}function saveUpdates(_0x574962,_0x51669d){return function(_0x2ffb5b){if(_0x2ffb5b){return _0x2ffb5b[_0xd425('0x3c')](_0x574962)[_0xd425('0x28')](function(_0x2d586f){return _0x2d586f;});}return null;};}function removeEntity(_0x4aa5b2,_0x42b974){return function(_0x1d4414){if(_0x1d4414){return _0x1d4414[_0xd425('0x3d')]()[_0xd425('0x28')](function(){var _0x27b9e2=_0x1d4414[_0xd425('0x3e')]({'plain':!![]});var _0x35bbec='MailAccounts';return db[_0xd425('0x3f')]['destroy']({'where':{'type':_0x35bbec,'resourceId':_0x27b9e2['id']}})[_0xd425('0x28')](function(){return _0x1d4414;});})[_0xd425('0x28')](function(){_0x4aa5b2[_0xd425('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ccbed,_0x26806c){return function(_0xbbb05f){if(!_0xbbb05f){_0x3ccbed[_0xd425('0x32')](0x194);}return _0xbbb05f;};}function handleError(_0x58f36d,_0x1d38fa){_0x1d38fa=_0x1d38fa||0x1f4;return function(_0x3cf540){logger['error'](_0x3cf540['stack']);if(_0x3cf540['name']){delete _0x3cf540[_0xd425('0x40')];}_0x58f36d[_0xd425('0x33')](_0x1d38fa)[_0xd425('0x41')](_0x3cf540);};}exports['index']=function(_0x4f8323,_0x58ebb1){var _0x2fcfb9={'include':[{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')},{'model':db[_0xd425('0x44')],'as':_0xd425('0x45')},{'model':db['Pause'],'as':_0xd425('0x46')}]},_0x3f9090={},_0xe72957={'count':0x0,'rows':[]};var _0x3c88a8=_[_0xd425('0x47')](db['MailAccount'][_0xd425('0x48')],function(_0x2dffc7){return{'name':_0x2dffc7[_0xd425('0x49')],'type':_0x2dffc7['type'][_0xd425('0x4a')]};});_0x3f9090[_0xd425('0x4b')]=_[_0xd425('0x47')](_0x3c88a8,_0xd425('0x40'));_0x3f9090['query']=_[_0xd425('0x4c')](_0x4f8323[_0xd425('0x4d')]);_0x3f9090[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x3f9090[_0xd425('0x4b')],_0x3f9090[_0xd425('0x4d')]);_0x2fcfb9[_0xd425('0x50')]=_['intersection'](_0x3f9090[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x4f8323['query'][_0xd425('0x51')]));_0x2fcfb9['attributes']=_0x2fcfb9['attributes'][_0xd425('0x52')]?_0x2fcfb9['attributes']:_0x3f9090[_0xd425('0x4b')];if(!_0x4f8323['query'][_0xd425('0x53')](_0xd425('0x54'))){_0x2fcfb9[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x4f8323[_0xd425('0x4d')]['limit']);_0x2fcfb9[_0xd425('0x35')]=qs['offset'](_0x4f8323[_0xd425('0x4d')]['offset']);}_0x2fcfb9[_0xd425('0x55')]=qs[_0xd425('0x56')](_0x4f8323[_0xd425('0x4d')][_0xd425('0x56')]);_0x2fcfb9[_0xd425('0x57')]=qs['filters'](_[_0xd425('0x58')](_0x4f8323[_0xd425('0x4d')],_0x3f9090[_0xd425('0x4e')]),_0x3c88a8);if(_0x4f8323[_0xd425('0x4d')][_0xd425('0x59')]){_0x2fcfb9['where']=_[_0xd425('0x5a')](_0x2fcfb9[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x3c88a8,function(_0x2a2ab4){if(_0x2a2ab4[_0xd425('0x5b')]!==_0xd425('0x5c')){var _0x5870dd={};_0x5870dd[_0x2a2ab4[_0xd425('0x40')]]={'$like':'%'+_0x4f8323[_0xd425('0x4d')]['filter']+'%'};return _0x5870dd;}})});}_0x2fcfb9=_[_0xd425('0x5a')]({},_0x2fcfb9,_0x4f8323[_0xd425('0x5d')]);var _0x1b416b={'where':_0x2fcfb9[_0xd425('0x57')]};return db['MailAccount'][_0xd425('0x38')](_0x1b416b)[_0xd425('0x28')](function(_0x4552cd){_0xe72957[_0xd425('0x38')]=_0x4552cd;if(_0x4f8323[_0xd425('0x4d')]['includeAll']){_0x2fcfb9['include']=[{'all':!![]}];}return db[_0xd425('0x5e')]['findAll'](_0x2fcfb9);})[_0xd425('0x28')](function(_0x1072bf){_0xe72957['rows']=_0x1072bf;return _0xe72957;})[_0xd425('0x28')](respondWithFilteredResult(_0x58ebb1,_0x2fcfb9))['catch'](handleError(_0x58ebb1,null));};exports['show']=function(_0x39f588,_0x111905){var _0xe6451f={'raw':![],'where':{'id':_0x39f588[_0xd425('0x5f')]['id']},'include':[{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')},{'model':db[_0xd425('0x44')],'as':'Smtp'},{'model':db[_0xd425('0x60')],'as':_0xd425('0x46')}]},_0x1bcd39={};_0x1bcd39[_0xd425('0x4b')]=_[_0xd425('0x4c')](db[_0xd425('0x5e')][_0xd425('0x48')]);_0x1bcd39[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x39f588['query']);_0x1bcd39['filters']=_['intersection'](_0x1bcd39[_0xd425('0x4b')],_0x1bcd39[_0xd425('0x4d')]);_0xe6451f[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x1bcd39['model'],qs['fields'](_0x39f588['query']['fields']));_0xe6451f[_0xd425('0x50')]=_0xe6451f[_0xd425('0x50')]['length']?_0xe6451f[_0xd425('0x50')]:_0x1bcd39[_0xd425('0x4b')];if(_0x39f588[_0xd425('0x4d')]['includeAll']){_0xe6451f['include']=[{'all':!![]}];}_0xe6451f=_[_0xd425('0x5a')]({},_0xe6451f,_0x39f588['options']);return db['MailAccount']['find'](_0xe6451f)[_0xd425('0x28')](handleEntityNotFound(_0x111905,null))[_0xd425('0x28')](respondWithResult(_0x111905,null))[_0xd425('0x31')](handleError(_0x111905,null));};exports['update']=function(_0x3395d8,_0x48bd20){if(_0x3395d8[_0xd425('0x61')]['id']){delete _0x3395d8[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x3395d8[_0xd425('0x5f')]['id']},'include':[{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')},{'model':db[_0xd425('0x44')],'as':_0xd425('0x45')},{'model':db['Pause'],'as':_0xd425('0x46')}]})[_0xd425('0x28')](handleEntityNotFound(_0x48bd20,null))[_0xd425('0x28')](saveUpdates(_0x3395d8[_0xd425('0x61')],null))['then'](function(_0x4f5d01){if(_0x4f5d01&&_0x3395d8[_0xd425('0x61')][_0xd425('0x43')]){return db[_0xd425('0x42')][_0xd425('0x3c')](_0x3395d8[_0xd425('0x61')][_0xd425('0x43')],{'where':{'MailAccountId':_0x4f5d01['id']}})[_0xd425('0x28')](function(){return _0x4f5d01;});}return _0x4f5d01;})[_0xd425('0x28')](function(_0x1fcde4){if(_0x1fcde4&&_0x3395d8[_0xd425('0x61')][_0xd425('0x45')]){return db[_0xd425('0x44')][_0xd425('0x3c')](_0x3395d8[_0xd425('0x61')]['Smtp'],{'where':{'MailAccountId':_0x1fcde4['id']}})[_0xd425('0x28')](function(){return _0x1fcde4;});}return _0x1fcde4;})[_0xd425('0x28')](respondWithResult(_0x48bd20,null))[_0xd425('0x31')](handleError(_0x48bd20,null));};exports['describe']=function(_0x5aff3c,_0x5ade1a){return db[_0xd425('0x5e')][_0xd425('0x63')]()[_0xd425('0x28')](respondWithResult(_0x5ade1a,null))['catch'](handleError(_0x5ade1a,null));};exports[_0xd425('0x64')]=function(_0x4c1878,_0x2811a4,_0xdc942c){if(_0x4c1878[_0xd425('0x61')]['id']){delete _0x4c1878['body']['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x4c1878[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x2811a4,null))[_0xd425('0x28')](function(_0x43b1a9){if(_0x43b1a9){_0x4c1878[_0xd425('0x61')][_0xd425('0x65')]=_0x43b1a9['id'];return db[_0xd425('0x66')][_0xd425('0x67')](_0x4c1878[_0xd425('0x61')]);}})[_0xd425('0x28')](respondWithResult(_0x2811a4,null))[_0xd425('0x31')](handleError(_0x2811a4,null));};exports[_0xd425('0x68')]=function(_0x445f98,_0x443126,_0x623ff5){var _0x25cae6={'raw':![],'where':{}};var _0x541218={};var _0x583073={'count':0x0,'rows':[]};return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x445f98[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x443126,null))[_0xd425('0x28')](function(_0x1ae1e3){if(_0x1ae1e3){_0x541218['model']=_[_0xd425('0x4c')](db[_0xd425('0x66')][_0xd425('0x48')]);_0x541218[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x445f98[_0xd425('0x4d')]);_0x541218['filters']=_['intersection'](_0x541218[_0xd425('0x4b')],_0x541218[_0xd425('0x4d')]);_0x25cae6['attributes']=_[_0xd425('0x4f')](_0x541218['model'],qs[_0xd425('0x51')](_0x445f98[_0xd425('0x4d')][_0xd425('0x51')]));_0x25cae6[_0xd425('0x50')]=_0x25cae6[_0xd425('0x50')][_0xd425('0x52')]?_0x25cae6[_0xd425('0x50')]:_0x541218['model'];if(!_0x445f98[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x25cae6[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x445f98['query'][_0xd425('0x36')]);_0x25cae6[_0xd425('0x35')]=qs['offset'](_0x445f98[_0xd425('0x4d')][_0xd425('0x35')]);}_0x25cae6['order']=qs[_0xd425('0x56')](_0x445f98[_0xd425('0x4d')][_0xd425('0x56')]);_0x25cae6[_0xd425('0x57')]=qs[_0xd425('0x4e')](_['pick'](_0x445f98[_0xd425('0x4d')],_0x541218['filters']));_0x25cae6[_0xd425('0x57')][_0xd425('0x65')]=_0x1ae1e3['id'];if(_0x445f98['query'][_0xd425('0x59')]){_0x25cae6[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x25cae6[_0xd425('0x57')],{'$or':_['map'](_0x25cae6['attributes'],function(_0x23e6e5){var _0x2312c1={};_0x2312c1[_0x23e6e5]={'$like':'%'+_0x445f98[_0xd425('0x4d')]['filter']+'%'};return _0x2312c1;})});}_0x25cae6=_[_0xd425('0x5a')]({},_0x25cae6,_0x445f98[_0xd425('0x5d')]);return db['Disposition'][_0xd425('0x38')]({'where':_0x25cae6['where']})[_0xd425('0x28')](function(_0x46346c){_0x583073[_0xd425('0x38')]=_0x46346c;if(_0x445f98[_0xd425('0x4d')]['includeAll']){_0x25cae6['include']=[{'all':!![]}];}return db[_0xd425('0x66')][_0xd425('0x69')](_0x25cae6);})['then'](function(_0x61349a){_0x583073[_0xd425('0x6a')]=_0x61349a;return _0x583073;});}})['then'](respondWithFilteredResult(_0x443126,_0x25cae6))[_0xd425('0x31')](handleError(_0x443126,null));};exports[_0xd425('0x6b')]=function(_0x20e80d,_0xfb6553,_0x455fff){return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x20e80d['params']['id']}})['then'](handleEntityNotFound(_0xfb6553,null))[_0xd425('0x28')](function(_0x4ba218){if(_0x4ba218){return _0x4ba218[_0xd425('0x6b')](_0x20e80d[_0xd425('0x4d')]['ids']);}})[_0xd425('0x28')](respondWithStatusCode(_0xfb6553,null))[_0xd425('0x31')](handleError(_0xfb6553,null));};exports['addAnswer']=function(_0x592c40,_0x750685,_0x242ed8){if(_0x592c40[_0xd425('0x61')]['id']){delete _0x592c40[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x592c40[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x750685,null))['then'](function(_0x2cff42){if(_0x2cff42){_0x592c40[_0xd425('0x61')]['MailAccountId']=_0x2cff42['id'];return db[_0xd425('0x6c')][_0xd425('0x67')](_0x592c40[_0xd425('0x61')]);}})[_0xd425('0x28')](respondWithResult(_0x750685,null))[_0xd425('0x31')](handleError(_0x750685,null));};exports[_0xd425('0x6d')]=function(_0x27c24e,_0x2c3995,_0x334062){var _0x26649f={'raw':![],'where':{}};var _0x14cebc={};var _0x572452={'count':0x0,'rows':[]};return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x27c24e['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x2c3995,null))['then'](function(_0x229d7d){if(_0x229d7d){_0x14cebc[_0xd425('0x4b')]=_[_0xd425('0x4c')](db[_0xd425('0x6c')][_0xd425('0x48')]);_0x14cebc[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x27c24e['query']);_0x14cebc[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x14cebc[_0xd425('0x4b')],_0x14cebc[_0xd425('0x4d')]);_0x26649f[_0xd425('0x50')]=_['intersection'](_0x14cebc[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x27c24e[_0xd425('0x4d')][_0xd425('0x51')]));_0x26649f[_0xd425('0x50')]=_0x26649f[_0xd425('0x50')][_0xd425('0x52')]?_0x26649f[_0xd425('0x50')]:_0x14cebc[_0xd425('0x4b')];if(!_0x27c24e[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x26649f['limit']=qs[_0xd425('0x36')](_0x27c24e['query'][_0xd425('0x36')]);_0x26649f[_0xd425('0x35')]=qs[_0xd425('0x35')](_0x27c24e[_0xd425('0x4d')][_0xd425('0x35')]);}_0x26649f['order']=qs[_0xd425('0x56')](_0x27c24e[_0xd425('0x4d')][_0xd425('0x56')]);_0x26649f[_0xd425('0x57')]=qs[_0xd425('0x4e')](_[_0xd425('0x58')](_0x27c24e[_0xd425('0x4d')],_0x14cebc['filters']));_0x26649f[_0xd425('0x57')]['MailAccountId']=_0x229d7d['id'];if(_0x27c24e[_0xd425('0x4d')][_0xd425('0x59')]){_0x26649f['where']=_[_0xd425('0x5a')](_0x26649f[_0xd425('0x57')],{'$or':_['map'](_0x26649f[_0xd425('0x50')],function(_0x8c2e48){var _0xca2955={};_0xca2955[_0x8c2e48]={'$like':'%'+_0x27c24e[_0xd425('0x4d')][_0xd425('0x59')]+'%'};return _0xca2955;})});}_0x26649f=_[_0xd425('0x5a')]({},_0x26649f,_0x27c24e['options']);return db[_0xd425('0x6c')]['count']({'where':_0x26649f[_0xd425('0x57')]})['then'](function(_0x9e8b08){_0x572452[_0xd425('0x38')]=_0x9e8b08;if(_0x27c24e[_0xd425('0x4d')][_0xd425('0x6e')]){_0x26649f['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x26649f);})['then'](function(_0x2bbad4){_0x572452['rows']=_0x2bbad4;return _0x572452;});}})[_0xd425('0x28')](respondWithFilteredResult(_0x2c3995,_0x26649f))[_0xd425('0x31')](handleError(_0x2c3995,null));};exports[_0xd425('0x6f')]=function(_0x331a14,_0x284f4b,_0x1309d7){return db['MailAccount'][_0xd425('0x62')]({'where':{'id':_0x331a14[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x284f4b,null))[_0xd425('0x28')](function(_0x476edf){if(_0x476edf){return _0x476edf['removeAnswers'](_0x331a14[_0xd425('0x4d')][_0xd425('0x70')]);}})[_0xd425('0x28')](respondWithStatusCode(_0x284f4b,null))['catch'](handleError(_0x284f4b,null));};exports[_0xd425('0x67')]=function(_0xf0939e,_0x3054d7){var _0x3fc022={'name':_0xf0939e[_0xd425('0x61')]['name'],'key':_0xf0939e[_0xd425('0x61')]['key'],'email':_0xf0939e[_0xd425('0x61')][_0xd425('0x71')],'ListId':_0xf0939e['body']['ListId'],'active':!_[_0xd425('0x72')](_0xf0939e['body'][_0xd425('0x73')])?_0xf0939e[_0xd425('0x61')][_0xd425('0x73')]:!![],'description':_0xf0939e[_0xd425('0x61')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xd425('0x72')](_0xf0939e[_0xd425('0x61')][_0xd425('0x74')])){if(_0xf0939e[_0xd425('0x61')][_0xd425('0x75')]){_0x3fc022[_0xd425('0x43')]['user']=_0x3fc022[_0xd425('0x45')][_0xd425('0x76')]=_0xf0939e[_0xd425('0x61')][_0xd425('0x77')];_0x3fc022[_0xd425('0x43')][_0xd425('0x78')]=_0x3fc022['Smtp'][_0xd425('0x79')]=_0xf0939e[_0xd425('0x61')]['cpassword'];}else{_0x3fc022[_0xd425('0x43')][_0xd425('0x7a')]=_0x3fc022['Smtp'][_0xd425('0x7a')]=![];}_0x3fc022[_0xd425('0x43')][_0xd425('0x7b')]=_0xf0939e[_0xd425('0x61')]['Imap'][_0xd425('0x7b')];_0x3fc022[_0xd425('0x43')]['port']=_0xf0939e[_0xd425('0x61')][_0xd425('0x43')][_0xd425('0x7c')];_0x3fc022[_0xd425('0x45')][_0xd425('0x7b')]=_0xf0939e[_0xd425('0x61')][_0xd425('0x45')]['host'];_0x3fc022[_0xd425('0x45')]['port']=_0xf0939e[_0xd425('0x61')][_0xd425('0x45')]['port'];}else{_0x3fc022['Imap'][_0xd425('0x7d')]=_0x3fc022[_0xd425('0x45')][_0xd425('0x7d')]=_0xf0939e['body'][_0xd425('0x74')];_0x3fc022['Imap']['user']=_0x3fc022[_0xd425('0x45')][_0xd425('0x76')]=_0xf0939e[_0xd425('0x61')][_0xd425('0x77')];_0x3fc022[_0xd425('0x43')]['password']=_0x3fc022[_0xd425('0x45')][_0xd425('0x79')]=_0xf0939e[_0xd425('0x61')]['cpassword'];}return db[_0xd425('0x5e')][_0xd425('0x67')](_0x3fc022,{'include':[{'model':db[_0xd425('0x44')],'as':_0xd425('0x45')},{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')}]})['then'](function(_0x57ec67){var _0x4aa9aa=_0xf0939e[_0xd425('0x76')]['get']({'plain':!![]});if(!_0x4aa9aa)throw new Error(_0xd425('0x7e'));if(_0x4aa9aa[_0xd425('0x7f')]===_0xd425('0x76')){var _0x1335ba=_0x57ec67[_0xd425('0x3e')]({'plain':!![]});return db[_0xd425('0x80')][_0xd425('0x62')]({'where':{'name':_0xd425('0x81'),'userProfileId':_0x4aa9aa[_0xd425('0x82')]},'raw':!![]})[_0xd425('0x28')](function(_0x234a9e){if(_0x234a9e&&_0x234a9e['autoAssociation']===0x0){return db[_0xd425('0x3f')][_0xd425('0x67')]({'name':_0x1335ba[_0xd425('0x40')],'resourceId':_0x1335ba['id'],'type':_0x234a9e[_0xd425('0x40')],'sectionId':_0x234a9e['id']},{})[_0xd425('0x28')](function(){return _0x57ec67;});}else{return _0x57ec67;}})[_0xd425('0x31')](function(_0x5e796d){logger[_0xd425('0x2c')](_0xd425('0x83'),_0x5e796d);throw _0x5e796d;});}return _0x57ec67;})[_0xd425('0x28')](respondWithResult(_0x3054d7,0xc9))['catch'](handleError(_0x3054d7,null));};exports[_0xd425('0x84')]=function(_0x45b627,_0x47d918,_0x1b407c){return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x45b627[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x47d918,null))['then'](function(_0x23cc22){if(_0x23cc22){return _0x23cc22[_0xd425('0x84')]();}return null;})[_0xd425('0x28')](respondWithResult(_0x47d918,null))[_0xd425('0x31')](handleError(_0x47d918,null));};exports[_0xd425('0x85')]=function(_0x158d96,_0x45dd61,_0x3f12ae){if(_0x158d96[_0xd425('0x61')]['id']){delete _0x158d96[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x158d96[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x45dd61,null))['then'](function(_0x1a3fe7){if(_0x1a3fe7){_0x158d96[_0xd425('0x61')]['MailAccountId']=_0x1a3fe7['id'];return db[_0xd425('0x42')][_0xd425('0x67')](_0x158d96['body']);}})['then'](respondWithResult(_0x45dd61,null))[_0xd425('0x31')](handleError(_0x45dd61,null));};exports[_0xd425('0x86')]=function(_0x532ad1,_0x1d8dc1,_0x266c83){return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x532ad1[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x1d8dc1,null))[_0xd425('0x28')](function(_0x408909){if(_0x408909){return _0x408909[_0xd425('0x88')](null);}return null;})[_0xd425('0x28')](respondWithStatusCode(_0x1d8dc1,null))[_0xd425('0x31')](handleError(_0x1d8dc1,null));};exports[_0xd425('0x89')]=function(_0x3d7a1c,_0x16e1d8,_0x2a3da8){return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x3d7a1c[_0xd425('0x5f')]['id']}})['then'](handleEntityNotFound(_0x16e1d8,null))['then'](function(_0x37dde5){if(_0x37dde5){return _0x37dde5[_0xd425('0x89')]();}return null;})[_0xd425('0x28')](respondWithResult(_0x16e1d8,null))['catch'](handleError(_0x16e1d8,null));};exports[_0xd425('0x8a')]=function(_0x2fb2f4,_0x72c33a,_0x46730c){if(_0x2fb2f4[_0xd425('0x61')]['id']){delete _0x2fb2f4[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x2fb2f4[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x72c33a,null))[_0xd425('0x28')](function(_0x548d6c){if(_0x548d6c){_0x2fb2f4[_0xd425('0x61')][_0xd425('0x65')]=_0x548d6c['id'];return db[_0xd425('0x44')][_0xd425('0x67')](_0x2fb2f4[_0xd425('0x61')]);}})[_0xd425('0x28')](respondWithResult(_0x72c33a,null))[_0xd425('0x31')](handleError(_0x72c33a,null));};exports[_0xd425('0x8b')]=function(_0x30368d,_0x4dd27e,_0x791285){return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x30368d[_0xd425('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4dd27e,null))[_0xd425('0x28')](function(_0x5d13ec){if(_0x5d13ec){return _0x5d13ec['setSmtp'](null);}return null;})[_0xd425('0x28')](respondWithStatusCode(_0x4dd27e,null))[_0xd425('0x31')](handleError(_0x4dd27e,null));};exports['addInteraction']=function(_0x53e176,_0x5def4a,_0x173363){return db[_0xd425('0x8c')][_0xd425('0x62')]({'where':{'id':_0x53e176['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x5def4a,null))[_0xd425('0x28')](function(_0x5ca9ab){if(_0x5ca9ab){return _0x5ca9ab[_0xd425('0x8d')](_0x53e176['body'][_0xd425('0x70')],_[_0xd425('0x8e')](_0x53e176[_0xd425('0x61')],['ids','id'])||{});}})[_0xd425('0x28')](respondWithResult(_0x5def4a,null))['catch'](handleError(_0x5def4a,null));};exports[_0xd425('0x8f')]=function(_0x1e2702,_0x5686ae,_0x892c7){var _0x253625={'raw':![],'where':{}};var _0x172fce={};var _0x49d449={'count':0x0,'rows':[]};return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x1e2702[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x5686ae,null))[_0xd425('0x28')](function(_0x2c3db3){if(_0x2c3db3){_0x172fce['model']=_[_0xd425('0x4c')](db['MailInteraction'][_0xd425('0x48')]);_0x172fce[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x1e2702[_0xd425('0x4d')]);_0x172fce[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x172fce[_0xd425('0x4b')],_0x172fce['query']);_0x253625[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x172fce[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x1e2702[_0xd425('0x4d')][_0xd425('0x51')]));_0x253625[_0xd425('0x50')]=_0x253625[_0xd425('0x50')]['length']?_0x253625['attributes']:_0x172fce['model'];if(!_0x1e2702['query'][_0xd425('0x53')](_0xd425('0x54'))){_0x253625['limit']=qs[_0xd425('0x36')](_0x1e2702['query'][_0xd425('0x36')]);_0x253625['offset']=qs[_0xd425('0x35')](_0x1e2702[_0xd425('0x4d')]['offset']);}_0x253625[_0xd425('0x55')]=qs['sort'](_0x1e2702[_0xd425('0x4d')][_0xd425('0x56')]);_0x253625[_0xd425('0x57')]=qs['filters'](_['pick'](_0x1e2702[_0xd425('0x4d')],_0x172fce['filters']));_0x253625[_0xd425('0x57')][_0xd425('0x65')]=_0x2c3db3['id'];if(_0x1e2702[_0xd425('0x4d')]['filter']){_0x253625[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x253625[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x253625[_0xd425('0x50')],function(_0x5f468a){var _0x36bbaf={};_0x36bbaf[_0x5f468a]={'$like':'%'+_0x1e2702['query'][_0xd425('0x59')]+'%'};return _0x36bbaf;})});}_0x253625=_[_0xd425('0x5a')]({},_0x253625,_0x1e2702[_0xd425('0x5d')]);return db[_0xd425('0x8c')][_0xd425('0x38')]({'where':_0x253625[_0xd425('0x57')]})[_0xd425('0x28')](function(_0x28f8c2){_0x49d449[_0xd425('0x38')]=_0x28f8c2;if(_0x1e2702['query']['includeAll']){_0x253625[_0xd425('0x90')]=[{'model':db['CmContact'],'as':_0xd425('0x91'),'required':![]},{'model':db[_0xd425('0x92')],'as':_0xd425('0x93'),'attributes':[_0xd425('0x40'),'fullname',_0xd425('0x94')],'required':![]},{'model':db[_0xd425('0x95')],'as':'Tags','attributes':['id',_0xd425('0x40'),_0xd425('0x96')],'where':_0x1e2702['query'][_0xd425('0x97')]?{'id':_0x1e2702[_0xd425('0x4d')]['tag']}:undefined,'required':_0x1e2702[_0xd425('0x4d')][_0xd425('0x97')]?!![]:![]}];}return db[_0xd425('0x8c')]['findAll'](_0x253625);})[_0xd425('0x28')](function(_0x50afc2){_0x49d449[_0xd425('0x6a')]=_0x50afc2;return _0x49d449;});}})['then'](respondWithFilteredResult(_0x5686ae,_0x253625))['catch'](handleError(_0x5686ae,null));};exports['addApplications']=function(_0x11c95d,_0x3244d4,_0x2819e8){return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x11c95d[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x3244d4,null))[_0xd425('0x28')](function(_0xb43eb0){if(_0xb43eb0){return db['sequelize'][_0xd425('0x98')](function(_0x26e97b){return db[_0xd425('0x99')][_0xd425('0x3d')]({'where':{'MailAccountId':_0x11c95d[_0xd425('0x5f')]['id']},'transaction':_0x26e97b})[_0xd425('0x28')](function(_0x328b6f){var _0x52fd55=_[_0xd425('0x47')](_0x11c95d[_0xd425('0x61')],function(_0xd4d911){_0xd4d911['MailAccountId']=_0x11c95d[_0xd425('0x5f')]['id'];return _0xd4d911;});return db[_0xd425('0x99')][_0xd425('0x9a')](_0x52fd55,{'transaction':_0x26e97b});});})[_0xd425('0x28')](function(){return db['MailApplication'][_0xd425('0x9b')]({'where':{'MailAccountId':_0x11c95d['params']['id']},'order':_0xd425('0x9c')});});}})[_0xd425('0x28')](respondWithResult(_0x3244d4,null))[_0xd425('0x31')](handleError(_0x3244d4,null));};exports['getApplications']=function(_0x1030e1,_0x17ab99,_0xd43b8){var _0xa7142d={};var _0x297d41={};var _0x154018;var _0x294318;return db['MailAccount'][_0xd425('0x87')]({'where':{'id':_0x1030e1[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x17ab99,null))['then'](function(_0x3388e7){if(_0x3388e7){_0x154018=_0x3388e7;_0x297d41[_0xd425('0x4b')]=_['keys'](db['MailApplication'][_0xd425('0x48')]);_0x297d41[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x1030e1[_0xd425('0x4d')]);_0x297d41[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x297d41['model'],_0x297d41['query']);_0xa7142d[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x297d41[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x1030e1[_0xd425('0x4d')][_0xd425('0x51')]));_0xa7142d['attributes']=_0xa7142d['attributes'][_0xd425('0x52')]?_0xa7142d[_0xd425('0x50')]:_0x297d41[_0xd425('0x4b')];_0xa7142d[_0xd425('0x55')]=qs['sort'](_0x1030e1['query'][_0xd425('0x56')]);_0xa7142d[_0xd425('0x57')]=qs[_0xd425('0x4e')](_[_0xd425('0x58')](_0x1030e1[_0xd425('0x4d')],_0x297d41[_0xd425('0x4e')]));if(_0x1030e1[_0xd425('0x4d')][_0xd425('0x59')]){_0xa7142d['where']=_[_0xd425('0x5a')](_0xa7142d[_0xd425('0x57')],{'$or':_['map'](_0xa7142d[_0xd425('0x50')],function(_0x4fd860){var _0x2da817={};_0x2da817[_0x4fd860]={'$like':'%'+_0x1030e1[_0xd425('0x4d')][_0xd425('0x59')]+'%'};return _0x2da817;})});}_0xa7142d=_[_0xd425('0x5a')]({},_0xa7142d,_0x1030e1['options']);return _0x154018[_0xd425('0x9d')](_0xa7142d);}})[_0xd425('0x28')](function(_0x96d34){if(_0x96d34){_0x294318=_0x96d34[_0xd425('0x52')];if(!_0x1030e1[_0xd425('0x4d')]['hasOwnProperty'](_0xd425('0x54'))){_0xa7142d[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x1030e1[_0xd425('0x4d')][_0xd425('0x36')]);_0xa7142d[_0xd425('0x35')]=qs[_0xd425('0x35')](_0x1030e1[_0xd425('0x4d')]['offset']);}return _0x154018[_0xd425('0x9d')](_0xa7142d);}})[_0xd425('0x28')](function(_0x3cd344){if(_0x3cd344){return _0x3cd344?{'count':_0x294318,'rows':_0x3cd344}:null;}})['then'](respondWithResult(_0x17ab99,null))[_0xd425('0x31')](handleError(_0x17ab99,null));};exports[_0xd425('0x9e')]=function(_0x5ae8a9,_0x3e6e21,_0x556aa2){var _0x2324e9={'raw':!![],'where':{}};var _0x2ae39f={};var _0x3ef200={'count':0x0,'rows':[]};return db['MailAccount'][_0xd425('0x87')]({'where':{'id':_0x5ae8a9[_0xd425('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e6e21,null))[_0xd425('0x28')](function(_0x345fe8){if(_0x345fe8){_0x2ae39f[_0xd425('0x4b')]=_[_0xd425('0x4c')](db[_0xd425('0x9f')]['rawAttributes']);_0x2ae39f[_0xd425('0x4d')]=_['keys'](_0x5ae8a9[_0xd425('0x4d')]);_0x2ae39f[_0xd425('0x4e')]=_['intersection'](_0x2ae39f[_0xd425('0x4b')],_0x2ae39f[_0xd425('0x4d')]);_0x2324e9['attributes']=_[_0xd425('0x4f')](_0x2ae39f['model'],qs['fields'](_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x51')]));_0x2324e9[_0xd425('0x50')]=_0x2324e9[_0xd425('0x50')]['length']?_0x2324e9[_0xd425('0x50')]:_0x2ae39f['model'];if(!_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x2324e9['limit']=qs[_0xd425('0x36')](_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x36')]);_0x2324e9[_0xd425('0x35')]=qs['offset'](_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x35')]);}_0x2324e9['order']=qs[_0xd425('0x56')](_0x5ae8a9['query'][_0xd425('0x56')]);_0x2324e9['where']=qs[_0xd425('0x4e')](_[_0xd425('0x58')](_0x5ae8a9[_0xd425('0x4d')],_0x2ae39f[_0xd425('0x4e')]));_0x2324e9[_0xd425('0x57')]['MailAccountId']=_0x345fe8['id'];if(_0x5ae8a9['query'][_0xd425('0x59')]){_0x2324e9[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x2324e9[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x2324e9[_0xd425('0x50')],function(_0x16c6fe){var _0x2ddcf8={};_0x2ddcf8[_0x16c6fe]={'$like':'%'+_0x5ae8a9['query'][_0xd425('0x59')]+'%'};return _0x2ddcf8;})});}if(_0x5ae8a9[_0xd425('0x4d')][_0xd425('0xa0')]){var _0x5e3eb5=_0x5ae8a9[_0xd425('0x4d')][_0xd425('0xa0')][_0xd425('0xa1')](',');var _0x396acc={};_0x396acc[_0x5e3eb5[0x0]]={'$gte':moment(_0x5e3eb5[0x1])[_0xd425('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2324e9[_0xd425('0x57')]=_['merge'](_0x2324e9['where'],_0x396acc);}_0x2324e9=_['merge']({},_0x2324e9,_0x5ae8a9[_0xd425('0x5d')]);return db['MailMessage'][_0xd425('0x38')]({'where':_0x2324e9[_0xd425('0x57')]})['then'](function(_0x1c7a0c){_0x3ef200['count']=_0x1c7a0c;if(_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x6e')]){_0x2324e9[_0xd425('0x90')]=[{'all':!![]}];}return db[_0xd425('0x9f')][_0xd425('0x69')](_0x2324e9);})[_0xd425('0x28')](function(_0x3a0d64){if(_0x5ae8a9[_0xd425('0x4d')]['inlineCss']===_0xd425('0xa3')){for(var _0x9b7949=0x0;_0x9b7949<_0x3a0d64[_0xd425('0x52')];_0x9b7949++){_0x3a0d64[_0x9b7949][_0xd425('0x61')]=juice(_0x3a0d64[_0x9b7949][_0xd425('0x61')]);}}_0x3ef200[_0xd425('0x6a')]=_0x3a0d64;return _0x3ef200;});}})[_0xd425('0x28')](respondWithFilteredResult(_0x3e6e21,_0x2324e9))[_0xd425('0x31')](handleError(_0x3e6e21,null));};exports[_0xd425('0x41')]=function(_0x432e6c,_0x257565,_0xb75c5d){var _0x5b4d87,_0xd36525={},_0x5d3a93;if(_0x432e6c['body']['to']){_0x5d3a93=_0x432e6c[_0xd425('0x61')]['to'][_0xd425('0xa1')](',')[0x0];}return db[_0xd425('0x5e')]['find']({'where':{'id':_0x432e6c[_0xd425('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xd425('0xa4'),'include':[{'model':db[_0xd425('0xa5')],'as':'Contacts','where':{'email':_0x5d3a93},'limit':0x1,'order':[[_0xd425('0xa6'),_0xd425('0xa7')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x257565,null))['then'](function(_0x377cfd){if(_0x377cfd){_0x5b4d87=_0x377cfd;if(_0x377cfd[_0xd425('0x45')]){if(_['isNil'](_0x432e6c[_0xd425('0x61')][_0xd425('0xa8')])){_0x432e6c[_0xd425('0x61')]['from']=util[_0xd425('0xa2')](_0xd425('0xa9'),_0x377cfd['name'],_0x377cfd[_0xd425('0x71')]||_0x377cfd[_0xd425('0x45')][_0xd425('0x76')]);}if(_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')]&&_0x432e6c['body']['attachments'][_0xd425('0x52')]){for(var _0x297b5e=0x0;_0x297b5e<_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0xd425('0x52')];_0x297b5e+=0x1){_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0x297b5e]={'filename':_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0x297b5e][_0xd425('0x40')],'path':path[_0xd425('0xab')](config[_0xd425('0xac')],_0xd425('0xad'),_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0x297b5e][_0xd425('0xae')])};}}var _0xdda4f0={'tls':{'rejectUnauthorized':![]}};if(_[_0xd425('0x72')](_0x377cfd[_0xd425('0x45')][_0xd425('0x7d')])){if(_0x377cfd['Smtp'][_0xd425('0x7a')]){_0xdda4f0['auth']={'user':_0x377cfd[_0xd425('0x45')][_0xd425('0x76')],'pass':_0x377cfd[_0xd425('0x45')][_0xd425('0x79')]};}_0xdda4f0[_0xd425('0x7b')]=_0x377cfd[_0xd425('0x45')][_0xd425('0x7b')];_0xdda4f0['port']=_0x377cfd['Smtp'][_0xd425('0x7c')];_0xdda4f0[_0xd425('0xaf')]=_0x377cfd[_0xd425('0x45')][_0xd425('0xaf')];}else{_0xdda4f0['service']=_0x377cfd['Smtp'][_0xd425('0x7d')];_0xdda4f0[_0xd425('0xb0')]={'user':_0x377cfd[_0xd425('0x45')]['user'],'pass':_0x377cfd['Smtp'][_0xd425('0x79')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0xdda4f0,'message':_0x432e6c[_0xd425('0x61')]});}else{throw new Error(_0xd425('0xb1'));}}})[_0xd425('0x28')](function(_0x17de44){if(_0x17de44){_0xd36525=_0x17de44;if(_0x5b4d87[_0xd425('0xa4')]){if(_0x5b4d87[_0xd425('0xa4')][_0xd425('0xb2')][_0xd425('0x52')]){return _0x5b4d87['List']['Contacts'][0x0];}else{return db[_0xd425('0xa5')][_0xd425('0x67')](_[_0xd425('0x20')](_0x432e6c[_0xd425('0x61')],{'firstName':_0x432e6c[_0xd425('0x61')]['to'],'email':_0x432e6c['body']['to'],'phone':_0x432e6c[_0xd425('0x61')]['to'],'ListId':_0x5b4d87['ListId']}));}}else{throw new Error(_0xd425('0xb1'));}}})[_0xd425('0x28')](function(_0x286ce3){if(_0x286ce3){var _0xcc0054={'UserId':_0x432e6c['user']['id'],'ContactId':_0x286ce3['id'],'MailAccountId':_0x5b4d87['id'],'inReplyTo':_0xd36525[_0xd425('0xb3')],'to':_0x432e6c[_0xd425('0x61')]['from'],'cc':_0x432e6c[_0xd425('0x61')]['cc'],'subject':_0x432e6c[_0xd425('0x61')][_0xd425('0xb4')],'attach':_0x432e6c[_0xd425('0x61')]['attach'],'firstMsgDirection':_0xd425('0xb5'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xd425('0xb5'),'Messages':[_[_0xd425('0x5a')](_0x432e6c[_0xd425('0x61')],{'messageId':_0xd36525[_0xd425('0xb3')],'sentAt':moment()['format'](_0xd425('0xb6')),'read':!![],'MailAccountId':_0x5b4d87['id'],'UserId':_0x432e6c[_0xd425('0x76')]['id'],'ContactId':_0x286ce3['id']})]};if(_0x432e6c['body']['Interaction']){_0xcc0054=_[_0xd425('0x5a')](_0xcc0054,_0x432e6c[_0xd425('0x61')]['Interaction']);}return db[_0xd425('0x8c')]['create'](_0xcc0054,{'include':[{'model':db['MailMessage'],'as':_0xd425('0xb7')}]});}})[_0xd425('0x28')](respondWithResult(_0x257565,null))[_0xd425('0x31')](handleError(_0x257565,null));};exports[_0xd425('0xb8')]=function(_0x2b1820,_0x3fe209,_0x5ddf36){return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x2b1820['params']['id']},'include':[{'model':db[_0xd425('0x44')],'as':'Smtp','raw':!![]}]})[_0xd425('0x28')](handleEntityNotFound(_0x3fe209,null))[_0xd425('0x28')](function(_0x1f3170){if(_0x1f3170&&_0x1f3170[_0xd425('0x45')]){var _0x2f31f4={'id':_0x1f3170['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1f3170['Smtp'][_0xd425('0x7d')]){_0x2f31f4[_0xd425('0x7d')]=_0x1f3170['Smtp']['service'];}else{_0x2f31f4[_0xd425('0x7b')]=_0x1f3170[_0xd425('0x45')][_0xd425('0x7b')];_0x2f31f4[_0xd425('0x7c')]=_0x1f3170[_0xd425('0x45')][_0xd425('0x7c')];_0x2f31f4['secure']=_0x1f3170['Smtp'][_0xd425('0xaf')];}if(_0x1f3170[_0xd425('0x45')][_0xd425('0x7a')]){_0x2f31f4['auth']={'user':_0x1f3170[_0xd425('0x45')]['user'],'pass':_0x1f3170[_0xd425('0x45')][_0xd425('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0xd425('0xb8'),{'account':_0x2f31f4});}})[_0xd425('0x28')](respondWithResult(_0x3fe209,null))['catch'](handleError(_0x3fe209,null));};exports[_0xd425('0x3d')]=function(_0x28bb88,_0x572e7a){return db[_0xd425('0x5e')]['find']({'where':{'id':_0x28bb88[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x572e7a,null))[_0xd425('0x28')](function(_0x3db7f2){if(_0x3db7f2&&_0x3db7f2[_0xd425('0x7d')]){throw new db['Sequelize'][(_0xd425('0xb9'))](_0xd425('0xba'));}return _0x3db7f2;})[_0xd425('0x28')](removeEntity(_0x572e7a,null))[_0xd425('0x31')](handleError(_0x572e7a,null));};exports[_0xd425('0xbb')]=function(_0x577d95,_0x772d54,_0x25511a){return db['MailAccount'][_0xd425('0x62')]({'where':{'id':_0x577d95['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x772d54,null))[_0xd425('0x28')](function(_0x1a4c25){if(_0x1a4c25){return _0x1a4c25[_0xd425('0xbb')](_0x577d95['body']['ids'],_['omit'](_0x577d95[_0xd425('0x61')],[_0xd425('0x70'),'id'])||{})[_0xd425('0xbc')](function(_0x565239){for(var _0x168c21=0x0;_0x168c21<_0x577d95[_0xd425('0x61')][_0xd425('0x70')]['length'];_0x168c21+=0x1){socket[_0xd425('0xbd')]('userMailAccount:save',{'UserId':_0x577d95[_0xd425('0x61')][_0xd425('0x70')][_0x168c21],'MailAccountId':_0x577d95[_0xd425('0x5f')]['id']});}return _0x565239;});}})[_0xd425('0x28')](respondWithResult(_0x772d54,null))[_0xd425('0x31')](handleError(_0x772d54,null));};exports[_0xd425('0xbe')]=function(_0x3938a0,_0x12ad46,_0x39877e){return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x3938a0['params']['id']}})['then'](handleEntityNotFound(_0x12ad46,null))['then'](function(_0x90cf9c){if(_0x90cf9c){return _0x90cf9c['removeAgents'](_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')])['then'](function(){if(_[_0xd425('0xbf')](_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')])){for(var _0x45038a=0x0;_0x45038a<_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')][_0xd425('0x52')];_0x45038a+=0x1){socket[_0xd425('0xbd')](_0xd425('0xc0'),{'UserId':Number(_0x3938a0[_0xd425('0x4d')]['ids'][_0x45038a]),'MailAccountId':Number(_0x3938a0[_0xd425('0x5f')]['id'])});}}else{socket['emit'](_0xd425('0xc0'),{'UserId':Number(_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')]),'MailAccountId':Number(_0x3938a0[_0xd425('0x5f')]['id'])});}});}})[_0xd425('0x28')](respondWithStatusCode(_0x12ad46,null))[_0xd425('0x31')](handleError(_0x12ad46,null));};exports[_0xd425('0xc1')]=function(_0x35db3a,_0x4cba04,_0x5d97b6){var _0x1d5cb9={};var _0x257fad={};var _0x48372c;var _0x569c7e;return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x35db3a['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x4cba04,null))['then'](function(_0x511853){if(_0x511853){_0x48372c=_0x511853;_0x257fad['model']=_[_0xd425('0x4c')](db[_0xd425('0x92')][_0xd425('0x48')]);_0x257fad['query']=_[_0xd425('0x4c')](_0x35db3a['query']);_0x257fad[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x257fad['model'],_0x257fad[_0xd425('0x4d')]);_0x1d5cb9[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x257fad[_0xd425('0x4b')],qs['fields'](_0x35db3a[_0xd425('0x4d')]['fields']));_0x1d5cb9[_0xd425('0x50')]=_0x1d5cb9[_0xd425('0x50')][_0xd425('0x52')]?_0x1d5cb9['attributes']:_0x257fad[_0xd425('0x4b')];_0x1d5cb9[_0xd425('0x55')]=qs[_0xd425('0x56')](_0x35db3a[_0xd425('0x4d')][_0xd425('0x56')]);_0x1d5cb9[_0xd425('0x57')]=qs['filters'](_[_0xd425('0x58')](_0x35db3a[_0xd425('0x4d')],_0x257fad[_0xd425('0x4e')]));if(_0x35db3a[_0xd425('0x4d')][_0xd425('0x59')]){_0x1d5cb9[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x1d5cb9[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x1d5cb9[_0xd425('0x50')],function(_0x3c41b5){var _0x281df0={};_0x281df0[_0x3c41b5]={'$like':'%'+_0x35db3a[_0xd425('0x4d')][_0xd425('0x59')]+'%'};return _0x281df0;})});}_0x1d5cb9=_[_0xd425('0x5a')]({},_0x1d5cb9,_0x35db3a['options']);return _0x48372c[_0xd425('0xc1')](_0x1d5cb9);}})[_0xd425('0x28')](function(_0x1cc5e6){if(_0x1cc5e6){_0x569c7e=_0x1cc5e6[_0xd425('0x52')];if(!_0x35db3a[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x1d5cb9[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x35db3a[_0xd425('0x4d')][_0xd425('0x36')]);_0x1d5cb9[_0xd425('0x35')]=qs['offset'](_0x35db3a[_0xd425('0x4d')][_0xd425('0x35')]);}return _0x48372c[_0xd425('0xc1')](_0x1d5cb9);}})[_0xd425('0x28')](function(_0x56234a){if(_0x56234a){return _0x56234a?{'count':_0x569c7e,'rows':_0x56234a}:null;}})[_0xd425('0x28')](respondWithResult(_0x4cba04,null))[_0xd425('0x31')](handleError(_0x4cba04,null));}; \ No newline at end of file +var _0x24ca=['UserProfileResource','end','stack','name','send','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','update','body','MailServerOut','describe','addDisposition','params','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','order','map','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','cservice','user','cuser','password','cpassword','authentication','host','port','service','pass','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','User','fullname','internal','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmContact','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth','secure','sendMail','List\x20not\x20found','List','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','html-to-text','juice','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','get'];(function(_0x5ce36e,_0x4fe3aa){var _0x48204f=function(_0xb0607d){while(--_0xb0607d){_0x5ce36e['push'](_0x5ce36e['shift']());}};_0x48204f(++_0x4fe3aa);}(_0x24ca,0x8c));var _0xa24c=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x24ca[_0x39cf70];return _0x580424;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var htmlToText=require(_0xa24c('0xd'));var juice=require(_0xa24c('0xe'));var Redis=require(_0xa24c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa24c('0x10'));var hardwareService=require(_0xa24c('0x11'));var logger=require(_0xa24c('0x12'))(_0xa24c('0x13'));var utils=require(_0xa24c('0x14'));var config=require(_0xa24c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa24c('0x16')](config[_0xa24c('0x17')],{'host':_0xa24c('0x18'),'port':0x18eb});var socket=require(_0xa24c('0x19'))(new Redis(config[_0xa24c('0x17')]));require('./mailAccount.socket')[_0xa24c('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x2e8dc9,_0x2a4270,_0x3f762e,_0x267762){return new BPromise(function(_0x204e7a,_0x419f2e){var _0x2197da=_0x267762||client;return _0x2197da[_0xa24c('0x1b')](_0x2e8dc9,_0x3f762e)[_0xa24c('0x1c')](function(_0x117177){logger[_0xa24c('0x1d')](_0xa24c('0x1e'),_0x2a4270,_0xa24c('0x1f'));logger[_0xa24c('0x20')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2a4270,_0xa24c('0x1f'),JSON['stringify'](_0x117177));if(_0x117177[_0xa24c('0x21')]){if(_0x117177[_0xa24c('0x21')][_0xa24c('0x22')]===0x1f4){logger[_0xa24c('0x21')](_0xa24c('0x1e'),_0x2a4270,_0x117177[_0xa24c('0x21')][_0xa24c('0x23')]);return _0x419f2e(_0x117177[_0xa24c('0x21')][_0xa24c('0x23')]);}logger[_0xa24c('0x21')](_0xa24c('0x1e'),_0x2a4270,_0x117177['error']['message']);return _0x204e7a(_0x117177[_0xa24c('0x21')][_0xa24c('0x23')]);}else{logger[_0xa24c('0x1d')](_0xa24c('0x1e'),_0x2a4270,_0xa24c('0x1f'));_0x204e7a(_0x117177[_0xa24c('0x24')][_0xa24c('0x23')]);}})[_0xa24c('0x25')](function(_0x304d6c){logger['error'](_0xa24c('0x1e'),_0x2a4270,_0x304d6c);_0x419f2e(_0x304d6c);});});}function respondWithStatusCode(_0x4ce48a,_0x1f347b){_0x1f347b=_0x1f347b||0xcc;return function(_0x256fbc){if(_0x256fbc){return _0x4ce48a[_0xa24c('0x26')](_0x1f347b);}return _0x4ce48a[_0xa24c('0x27')](_0x1f347b)['end']();};}function respondWithResult(_0x58ff62,_0x4c86c6){_0x4c86c6=_0x4c86c6||0xc8;return function(_0x4e5d2c){if(_0x4e5d2c){return _0x58ff62[_0xa24c('0x27')](_0x4c86c6)[_0xa24c('0x28')](_0x4e5d2c);}};}function respondWithFilteredResult(_0xab6197,_0x1cdee4){return function(_0x37cbd3){if(_0x37cbd3){var _0x5361d4=typeof _0x1cdee4['offset']===_0xa24c('0x29')&&typeof _0x1cdee4[_0xa24c('0x2a')]===_0xa24c('0x29');var _0x1d500e=_0x37cbd3[_0xa24c('0x2b')];var _0x3f7102=_0x5361d4?0x0:_0x1cdee4[_0xa24c('0x2c')];var _0x1e30a9=_0x5361d4?_0x37cbd3[_0xa24c('0x2b')]:_0x1cdee4[_0xa24c('0x2c')]+_0x1cdee4['limit'];var _0x2dd4f1;if(_0x1e30a9>=_0x1d500e){_0x1e30a9=_0x1d500e;_0x2dd4f1=0xc8;}else{_0x2dd4f1=0xce;}_0xab6197[_0xa24c('0x27')](_0x2dd4f1);return _0xab6197['set'](_0xa24c('0x2d'),_0x3f7102+'-'+_0x1e30a9+'/'+_0x1d500e)[_0xa24c('0x28')](_0x37cbd3);}return null;};}function patchUpdates(_0x33f0c9){return function(_0x1de2ef){try{jsonpatch[_0xa24c('0x2e')](_0x1de2ef,_0x33f0c9,!![]);}catch(_0x44d282){return BPromise[_0xa24c('0x2f')](_0x44d282);}return _0x1de2ef[_0xa24c('0x30')]();};}function saveUpdates(_0x33824b,_0x3eed7d){return function(_0x4b0719){if(_0x4b0719){return _0x4b0719['update'](_0x33824b)['then'](function(_0x44c3b0){return _0x44c3b0;});}return null;};}function removeEntity(_0x577949,_0x1fcc11){return function(_0x34142f){if(_0x34142f){return _0x34142f[_0xa24c('0x31')]()['then'](function(){var _0xe1a798=_0x34142f[_0xa24c('0x32')]({'plain':!![]});var _0x59b153='MailAccounts';return db[_0xa24c('0x33')][_0xa24c('0x31')]({'where':{'type':_0x59b153,'resourceId':_0xe1a798['id']}})['then'](function(){return _0x34142f;});})[_0xa24c('0x1c')](function(){_0x577949[_0xa24c('0x27')](0xcc)[_0xa24c('0x34')]();});}};}function handleEntityNotFound(_0x570d7c,_0x45c429){return function(_0x2c63da){if(!_0x2c63da){_0x570d7c[_0xa24c('0x26')](0x194);}return _0x2c63da;};}function handleError(_0x2c7ded,_0x12e184){_0x12e184=_0x12e184||0x1f4;return function(_0x4a9d2d){logger[_0xa24c('0x21')](_0x4a9d2d[_0xa24c('0x35')]);if(_0x4a9d2d['name']){delete _0x4a9d2d[_0xa24c('0x36')];}_0x2c7ded[_0xa24c('0x27')](_0x12e184)[_0xa24c('0x37')](_0x4a9d2d);};}exports['index']=function(_0x5f2262,_0x1f7535){var _0xa5c873={'include':[{'model':db[_0xa24c('0x38')],'as':_0xa24c('0x39')},{'model':db['MailServerOut'],'as':_0xa24c('0x3a')},{'model':db[_0xa24c('0x3b')],'as':_0xa24c('0x3c')}]},_0x219b2c={},_0x3c707b={'count':0x0,'rows':[]};var _0x137a1d=_['map'](db[_0xa24c('0x3d')][_0xa24c('0x3e')],function(_0x20390c){return{'name':_0x20390c[_0xa24c('0x3f')],'type':_0x20390c[_0xa24c('0x40')][_0xa24c('0x41')]};});_0x219b2c[_0xa24c('0x42')]=_['map'](_0x137a1d,'name');_0x219b2c[_0xa24c('0x43')]=_['keys'](_0x5f2262[_0xa24c('0x43')]);_0x219b2c['filters']=_[_0xa24c('0x44')](_0x219b2c[_0xa24c('0x42')],_0x219b2c[_0xa24c('0x43')]);_0xa5c873[_0xa24c('0x45')]=_[_0xa24c('0x44')](_0x219b2c[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x5f2262[_0xa24c('0x43')][_0xa24c('0x46')]));_0xa5c873[_0xa24c('0x45')]=_0xa5c873[_0xa24c('0x45')][_0xa24c('0x47')]?_0xa5c873[_0xa24c('0x45')]:_0x219b2c[_0xa24c('0x42')];if(!_0x5f2262[_0xa24c('0x43')][_0xa24c('0x48')]('nolimit')){_0xa5c873[_0xa24c('0x2a')]=qs[_0xa24c('0x2a')](_0x5f2262[_0xa24c('0x43')]['limit']);_0xa5c873[_0xa24c('0x2c')]=qs[_0xa24c('0x2c')](_0x5f2262[_0xa24c('0x43')][_0xa24c('0x2c')]);}_0xa5c873['order']=qs[_0xa24c('0x49')](_0x5f2262[_0xa24c('0x43')][_0xa24c('0x49')]);_0xa5c873[_0xa24c('0x4a')]=qs[_0xa24c('0x4b')](_[_0xa24c('0x4c')](_0x5f2262[_0xa24c('0x43')],_0x219b2c[_0xa24c('0x4b')]),_0x137a1d);if(_0x5f2262[_0xa24c('0x43')][_0xa24c('0x4d')]){_0xa5c873[_0xa24c('0x4a')]=_[_0xa24c('0x4e')](_0xa5c873[_0xa24c('0x4a')],{'$or':_['map'](_0x137a1d,function(_0x19b05a){if(_0x19b05a['type']!==_0xa24c('0x4f')){var _0x201065={};_0x201065[_0x19b05a[_0xa24c('0x36')]]={'$like':'%'+_0x5f2262[_0xa24c('0x43')][_0xa24c('0x4d')]+'%'};return _0x201065;}})});}_0xa5c873=_[_0xa24c('0x4e')]({},_0xa5c873,_0x5f2262[_0xa24c('0x50')]);var _0x4f1024={'where':_0xa5c873[_0xa24c('0x4a')]};return db[_0xa24c('0x3d')][_0xa24c('0x2b')](_0x4f1024)[_0xa24c('0x1c')](function(_0x14c813){_0x3c707b['count']=_0x14c813;if(_0x5f2262[_0xa24c('0x43')][_0xa24c('0x51')]){_0xa5c873[_0xa24c('0x52')]=[{'all':!![]}];}return db[_0xa24c('0x3d')]['findAll'](_0xa5c873);})[_0xa24c('0x1c')](function(_0xd09fd4){_0x3c707b[_0xa24c('0x53')]=_0xd09fd4;return _0x3c707b;})['then'](respondWithFilteredResult(_0x1f7535,_0xa5c873))['catch'](handleError(_0x1f7535,null));};exports[_0xa24c('0x54')]=function(_0x1c8980,_0x4992ee){var _0x1629e6={'raw':![],'where':{'id':_0x1c8980['params']['id']},'include':[{'model':db[_0xa24c('0x38')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xa24c('0x3a')},{'model':db['Pause'],'as':_0xa24c('0x3c')}]},_0xeed9fe={};_0xeed9fe[_0xa24c('0x42')]=_['keys'](db[_0xa24c('0x3d')][_0xa24c('0x3e')]);_0xeed9fe[_0xa24c('0x43')]=_[_0xa24c('0x55')](_0x1c8980['query']);_0xeed9fe[_0xa24c('0x4b')]=_['intersection'](_0xeed9fe[_0xa24c('0x42')],_0xeed9fe[_0xa24c('0x43')]);_0x1629e6['attributes']=_['intersection'](_0xeed9fe[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x1c8980[_0xa24c('0x43')][_0xa24c('0x46')]));_0x1629e6[_0xa24c('0x45')]=_0x1629e6['attributes'][_0xa24c('0x47')]?_0x1629e6['attributes']:_0xeed9fe[_0xa24c('0x42')];if(_0x1c8980['query']['includeAll']){_0x1629e6['include']=[{'all':!![]}];}_0x1629e6=_[_0xa24c('0x4e')]({},_0x1629e6,_0x1c8980['options']);return db['MailAccount'][_0xa24c('0x56')](_0x1629e6)['then'](handleEntityNotFound(_0x4992ee,null))[_0xa24c('0x1c')](respondWithResult(_0x4992ee,null))[_0xa24c('0x25')](handleError(_0x4992ee,null));};exports[_0xa24c('0x57')]=function(_0x14c819,_0x33c5f7){if(_0x14c819[_0xa24c('0x58')]['id']){delete _0x14c819[_0xa24c('0x58')]['id'];}return db[_0xa24c('0x3d')]['find']({'where':{'id':_0x14c819['params']['id']},'include':[{'model':db[_0xa24c('0x38')],'as':_0xa24c('0x39')},{'model':db['MailServerOut'],'as':_0xa24c('0x3a')},{'model':db[_0xa24c('0x3b')],'as':'mandatoryDispositionPause'}]})[_0xa24c('0x1c')](handleEntityNotFound(_0x33c5f7,null))[_0xa24c('0x1c')](saveUpdates(_0x14c819[_0xa24c('0x58')],null))['then'](function(_0x4693a8){if(_0x4693a8&&_0x14c819[_0xa24c('0x58')]['Imap']){return db[_0xa24c('0x38')]['update'](_0x14c819[_0xa24c('0x58')][_0xa24c('0x39')],{'where':{'MailAccountId':_0x4693a8['id']}})[_0xa24c('0x1c')](function(){return _0x4693a8;});}return _0x4693a8;})[_0xa24c('0x1c')](function(_0xe19b91){if(_0xe19b91&&_0x14c819[_0xa24c('0x58')][_0xa24c('0x3a')]){return db[_0xa24c('0x59')][_0xa24c('0x57')](_0x14c819[_0xa24c('0x58')][_0xa24c('0x3a')],{'where':{'MailAccountId':_0xe19b91['id']}})[_0xa24c('0x1c')](function(){return _0xe19b91;});}return _0xe19b91;})[_0xa24c('0x1c')](respondWithResult(_0x33c5f7,null))[_0xa24c('0x25')](handleError(_0x33c5f7,null));};exports[_0xa24c('0x5a')]=function(_0x154188,_0x3d8185){return db[_0xa24c('0x3d')]['describe']()[_0xa24c('0x1c')](respondWithResult(_0x3d8185,null))['catch'](handleError(_0x3d8185,null));};exports[_0xa24c('0x5b')]=function(_0xc5353e,_0xe54de4,_0x120042){if(_0xc5353e['body']['id']){delete _0xc5353e['body']['id'];}return db[_0xa24c('0x3d')][_0xa24c('0x56')]({'where':{'id':_0xc5353e[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0xe54de4,null))[_0xa24c('0x1c')](function(_0x30513f){if(_0x30513f){_0xc5353e[_0xa24c('0x58')][_0xa24c('0x5d')]=_0x30513f['id'];return db[_0xa24c('0x5e')][_0xa24c('0x5f')](_0xc5353e[_0xa24c('0x58')]);}})[_0xa24c('0x1c')](respondWithResult(_0xe54de4,null))[_0xa24c('0x25')](handleError(_0xe54de4,null));};exports[_0xa24c('0x60')]=function(_0x2cb64e,_0x19c87a,_0x3b68d7){var _0x1860b7={'raw':![],'where':{}};var _0x34acae={};var _0xa3cb6a={'count':0x0,'rows':[]};return db[_0xa24c('0x3d')][_0xa24c('0x61')]({'where':{'id':_0x2cb64e[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x19c87a,null))[_0xa24c('0x1c')](function(_0x2bd28b){if(_0x2bd28b){_0x34acae[_0xa24c('0x42')]=_[_0xa24c('0x55')](db[_0xa24c('0x5e')][_0xa24c('0x3e')]);_0x34acae[_0xa24c('0x43')]=_[_0xa24c('0x55')](_0x2cb64e[_0xa24c('0x43')]);_0x34acae[_0xa24c('0x4b')]=_['intersection'](_0x34acae[_0xa24c('0x42')],_0x34acae['query']);_0x1860b7[_0xa24c('0x45')]=_[_0xa24c('0x44')](_0x34acae[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x2cb64e['query'][_0xa24c('0x46')]));_0x1860b7[_0xa24c('0x45')]=_0x1860b7[_0xa24c('0x45')]['length']?_0x1860b7[_0xa24c('0x45')]:_0x34acae['model'];if(!_0x2cb64e[_0xa24c('0x43')][_0xa24c('0x48')](_0xa24c('0x62'))){_0x1860b7['limit']=qs[_0xa24c('0x2a')](_0x2cb64e[_0xa24c('0x43')]['limit']);_0x1860b7[_0xa24c('0x2c')]=qs[_0xa24c('0x2c')](_0x2cb64e[_0xa24c('0x43')][_0xa24c('0x2c')]);}_0x1860b7[_0xa24c('0x63')]=qs[_0xa24c('0x49')](_0x2cb64e[_0xa24c('0x43')][_0xa24c('0x49')]);_0x1860b7[_0xa24c('0x4a')]=qs[_0xa24c('0x4b')](_[_0xa24c('0x4c')](_0x2cb64e[_0xa24c('0x43')],_0x34acae[_0xa24c('0x4b')]));_0x1860b7[_0xa24c('0x4a')][_0xa24c('0x5d')]=_0x2bd28b['id'];if(_0x2cb64e[_0xa24c('0x43')]['filter']){_0x1860b7[_0xa24c('0x4a')]=_[_0xa24c('0x4e')](_0x1860b7[_0xa24c('0x4a')],{'$or':_[_0xa24c('0x64')](_0x1860b7[_0xa24c('0x45')],function(_0x52fe24){var _0x5cb30c={};_0x5cb30c[_0x52fe24]={'$like':'%'+_0x2cb64e[_0xa24c('0x43')][_0xa24c('0x4d')]+'%'};return _0x5cb30c;})});}_0x1860b7=_[_0xa24c('0x4e')]({},_0x1860b7,_0x2cb64e[_0xa24c('0x50')]);return db[_0xa24c('0x5e')]['count']({'where':_0x1860b7[_0xa24c('0x4a')]})[_0xa24c('0x1c')](function(_0x86fa83){_0xa3cb6a['count']=_0x86fa83;if(_0x2cb64e[_0xa24c('0x43')]['includeAll']){_0x1860b7['include']=[{'all':!![]}];}return db['Disposition'][_0xa24c('0x65')](_0x1860b7);})[_0xa24c('0x1c')](function(_0x83bfa6){_0xa3cb6a[_0xa24c('0x53')]=_0x83bfa6;return _0xa3cb6a;});}})['then'](respondWithFilteredResult(_0x19c87a,_0x1860b7))[_0xa24c('0x25')](handleError(_0x19c87a,null));};exports[_0xa24c('0x66')]=function(_0x406fab,_0x1b3471,_0x3b7213){return db['MailAccount'][_0xa24c('0x56')]({'where':{'id':_0x406fab[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1b3471,null))['then'](function(_0x239269){if(_0x239269){return _0x239269[_0xa24c('0x66')](_0x406fab[_0xa24c('0x43')][_0xa24c('0x67')]);}})[_0xa24c('0x1c')](respondWithStatusCode(_0x1b3471,null))[_0xa24c('0x25')](handleError(_0x1b3471,null));};exports[_0xa24c('0x68')]=function(_0x1df820,_0x47cfc8,_0x4f98c2){if(_0x1df820[_0xa24c('0x58')]['id']){delete _0x1df820[_0xa24c('0x58')]['id'];}return db[_0xa24c('0x3d')][_0xa24c('0x56')]({'where':{'id':_0x1df820[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x47cfc8,null))[_0xa24c('0x1c')](function(_0x55fc27){if(_0x55fc27){_0x1df820['body'][_0xa24c('0x5d')]=_0x55fc27['id'];return db[_0xa24c('0x69')]['create'](_0x1df820[_0xa24c('0x58')]);}})[_0xa24c('0x1c')](respondWithResult(_0x47cfc8,null))[_0xa24c('0x25')](handleError(_0x47cfc8,null));};exports[_0xa24c('0x6a')]=function(_0x450629,_0x4a2ced,_0x448353){var _0xfe7ca9={'raw':![],'where':{}};var _0x131efb={};var _0x17973a={'count':0x0,'rows':[]};return db[_0xa24c('0x3d')][_0xa24c('0x61')]({'where':{'id':_0x450629[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x4a2ced,null))[_0xa24c('0x1c')](function(_0x286b89){if(_0x286b89){_0x131efb[_0xa24c('0x42')]=_[_0xa24c('0x55')](db[_0xa24c('0x69')]['rawAttributes']);_0x131efb['query']=_[_0xa24c('0x55')](_0x450629[_0xa24c('0x43')]);_0x131efb[_0xa24c('0x4b')]=_[_0xa24c('0x44')](_0x131efb[_0xa24c('0x42')],_0x131efb[_0xa24c('0x43')]);_0xfe7ca9[_0xa24c('0x45')]=_[_0xa24c('0x44')](_0x131efb[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x450629[_0xa24c('0x43')]['fields']));_0xfe7ca9[_0xa24c('0x45')]=_0xfe7ca9[_0xa24c('0x45')][_0xa24c('0x47')]?_0xfe7ca9[_0xa24c('0x45')]:_0x131efb[_0xa24c('0x42')];if(!_0x450629[_0xa24c('0x43')]['hasOwnProperty'](_0xa24c('0x62'))){_0xfe7ca9[_0xa24c('0x2a')]=qs[_0xa24c('0x2a')](_0x450629['query'][_0xa24c('0x2a')]);_0xfe7ca9['offset']=qs[_0xa24c('0x2c')](_0x450629[_0xa24c('0x43')][_0xa24c('0x2c')]);}_0xfe7ca9['order']=qs[_0xa24c('0x49')](_0x450629[_0xa24c('0x43')][_0xa24c('0x49')]);_0xfe7ca9[_0xa24c('0x4a')]=qs[_0xa24c('0x4b')](_[_0xa24c('0x4c')](_0x450629[_0xa24c('0x43')],_0x131efb[_0xa24c('0x4b')]));_0xfe7ca9[_0xa24c('0x4a')][_0xa24c('0x5d')]=_0x286b89['id'];if(_0x450629[_0xa24c('0x43')][_0xa24c('0x4d')]){_0xfe7ca9['where']=_[_0xa24c('0x4e')](_0xfe7ca9[_0xa24c('0x4a')],{'$or':_[_0xa24c('0x64')](_0xfe7ca9[_0xa24c('0x45')],function(_0x295ed8){var _0x54cad0={};_0x54cad0[_0x295ed8]={'$like':'%'+_0x450629[_0xa24c('0x43')]['filter']+'%'};return _0x54cad0;})});}_0xfe7ca9=_[_0xa24c('0x4e')]({},_0xfe7ca9,_0x450629[_0xa24c('0x50')]);return db[_0xa24c('0x69')]['count']({'where':_0xfe7ca9[_0xa24c('0x4a')]})['then'](function(_0x109a36){_0x17973a[_0xa24c('0x2b')]=_0x109a36;if(_0x450629[_0xa24c('0x43')]['includeAll']){_0xfe7ca9[_0xa24c('0x52')]=[{'all':!![]}];}return db[_0xa24c('0x69')]['findAll'](_0xfe7ca9);})[_0xa24c('0x1c')](function(_0xc502c8){_0x17973a[_0xa24c('0x53')]=_0xc502c8;return _0x17973a;});}})[_0xa24c('0x1c')](respondWithFilteredResult(_0x4a2ced,_0xfe7ca9))[_0xa24c('0x25')](handleError(_0x4a2ced,null));};exports[_0xa24c('0x6b')]=function(_0x243485,_0x7ca19a,_0x97b8ab){return db[_0xa24c('0x3d')][_0xa24c('0x56')]({'where':{'id':_0x243485[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x7ca19a,null))[_0xa24c('0x1c')](function(_0x15efd4){if(_0x15efd4){return _0x15efd4[_0xa24c('0x6b')](_0x243485['query'][_0xa24c('0x67')]);}})[_0xa24c('0x1c')](respondWithStatusCode(_0x7ca19a,null))[_0xa24c('0x25')](handleError(_0x7ca19a,null));};exports['create']=function(_0xa38bc1,_0x402a6a){var _0xc8496f={'name':_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x36')],'key':_0xa38bc1[_0xa24c('0x58')]['key'],'email':_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x6c')],'ListId':_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x6d')],'active':!_[_0xa24c('0x6e')](_0xa38bc1['body'][_0xa24c('0x6f')])?_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x6f')]:!![],'description':_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x70')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0xa38bc1['body'][_0xa24c('0x71')])){if(_0xa38bc1[_0xa24c('0x58')]['cauthentication']){_0xc8496f[_0xa24c('0x39')][_0xa24c('0x72')]=_0xc8496f[_0xa24c('0x3a')][_0xa24c('0x72')]=_0xa38bc1['body'][_0xa24c('0x73')];_0xc8496f[_0xa24c('0x39')][_0xa24c('0x74')]=_0xc8496f[_0xa24c('0x3a')]['pass']=_0xa38bc1['body'][_0xa24c('0x75')];}else{_0xc8496f[_0xa24c('0x39')][_0xa24c('0x76')]=_0xc8496f[_0xa24c('0x3a')]['authentication']=![];}_0xc8496f[_0xa24c('0x39')][_0xa24c('0x77')]=_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x39')][_0xa24c('0x77')];_0xc8496f[_0xa24c('0x39')][_0xa24c('0x78')]=_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x39')][_0xa24c('0x78')];_0xc8496f[_0xa24c('0x3a')][_0xa24c('0x77')]=_0xa38bc1[_0xa24c('0x58')]['Smtp'][_0xa24c('0x77')];_0xc8496f[_0xa24c('0x3a')][_0xa24c('0x78')]=_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x3a')]['port'];}else{_0xc8496f[_0xa24c('0x39')][_0xa24c('0x79')]=_0xc8496f['Smtp']['service']=_0xa38bc1['body'][_0xa24c('0x71')];_0xc8496f['Imap'][_0xa24c('0x72')]=_0xc8496f[_0xa24c('0x3a')]['user']=_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x73')];_0xc8496f['Imap']['password']=_0xc8496f[_0xa24c('0x3a')][_0xa24c('0x7a')]=_0xa38bc1[_0xa24c('0x58')][_0xa24c('0x75')];}return db['MailAccount'][_0xa24c('0x5f')](_0xc8496f,{'include':[{'model':db[_0xa24c('0x59')],'as':'Smtp'},{'model':db[_0xa24c('0x38')],'as':_0xa24c('0x39')}]})[_0xa24c('0x1c')](function(_0x27c52f){var _0x2c8cde=_0xa38bc1[_0xa24c('0x72')][_0xa24c('0x32')]({'plain':!![]});if(!_0x2c8cde)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c8cde['role']===_0xa24c('0x72')){var _0x3bf57c=_0x27c52f['get']({'plain':!![]});return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0xa24c('0x7b'),'userProfileId':_0x2c8cde[_0xa24c('0x7c')]},'raw':!![]})['then'](function(_0x469d56){if(_0x469d56&&_0x469d56[_0xa24c('0x7d')]===0x0){return db[_0xa24c('0x33')][_0xa24c('0x5f')]({'name':_0x3bf57c[_0xa24c('0x36')],'resourceId':_0x3bf57c['id'],'type':_0x469d56[_0xa24c('0x36')],'sectionId':_0x469d56['id']},{})[_0xa24c('0x1c')](function(){return _0x27c52f;});}else{return _0x27c52f;}})[_0xa24c('0x25')](function(_0x54cd76){logger['error'](_0xa24c('0x7e'),_0x54cd76);throw _0x54cd76;});}return _0x27c52f;})[_0xa24c('0x1c')](respondWithResult(_0x402a6a,0xc9))['catch'](handleError(_0x402a6a,null));};exports['getImap']=function(_0x3a511f,_0x17c452,_0x3a7ace){return db[_0xa24c('0x3d')][_0xa24c('0x61')]({'where':{'id':_0x3a511f[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x17c452,null))[_0xa24c('0x1c')](function(_0x4d23d1){if(_0x4d23d1){return _0x4d23d1[_0xa24c('0x7f')]();}return null;})[_0xa24c('0x1c')](respondWithResult(_0x17c452,null))[_0xa24c('0x25')](handleError(_0x17c452,null));};exports[_0xa24c('0x80')]=function(_0x22db07,_0x2b568c,_0x12da83){if(_0x22db07[_0xa24c('0x58')]['id']){delete _0x22db07[_0xa24c('0x58')]['id'];}return db[_0xa24c('0x3d')][_0xa24c('0x56')]({'where':{'id':_0x22db07[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x2b568c,null))[_0xa24c('0x1c')](function(_0x3fbb72){if(_0x3fbb72){_0x22db07[_0xa24c('0x58')]['MailAccountId']=_0x3fbb72['id'];return db['MailServerIn'][_0xa24c('0x5f')](_0x22db07[_0xa24c('0x58')]);}})[_0xa24c('0x1c')](respondWithResult(_0x2b568c,null))[_0xa24c('0x25')](handleError(_0x2b568c,null));};exports[_0xa24c('0x81')]=function(_0x995fbe,_0x2d47ca,_0x49dd83){return db['MailAccount']['findOne']({'where':{'id':_0x995fbe['params']['id']}})['then'](handleEntityNotFound(_0x2d47ca,null))[_0xa24c('0x1c')](function(_0x28f207){if(_0x28f207){return _0x28f207[_0xa24c('0x82')](null);}return null;})[_0xa24c('0x1c')](respondWithStatusCode(_0x2d47ca,null))[_0xa24c('0x25')](handleError(_0x2d47ca,null));};exports[_0xa24c('0x83')]=function(_0x2ba431,_0x4e6d40,_0x2bbec6){return db['MailAccount'][_0xa24c('0x61')]({'where':{'id':_0x2ba431[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x4e6d40,null))[_0xa24c('0x1c')](function(_0x5722df){if(_0x5722df){return _0x5722df['getSmtp']();}return null;})['then'](respondWithResult(_0x4e6d40,null))[_0xa24c('0x25')](handleError(_0x4e6d40,null));};exports[_0xa24c('0x84')]=function(_0x553926,_0x457e9c,_0x57eb5b){if(_0x553926[_0xa24c('0x58')]['id']){delete _0x553926[_0xa24c('0x58')]['id'];}return db[_0xa24c('0x3d')][_0xa24c('0x56')]({'where':{'id':_0x553926[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x457e9c,null))[_0xa24c('0x1c')](function(_0x148438){if(_0x148438){_0x553926[_0xa24c('0x58')][_0xa24c('0x5d')]=_0x148438['id'];return db[_0xa24c('0x59')]['create'](_0x553926['body']);}})[_0xa24c('0x1c')](respondWithResult(_0x457e9c,null))[_0xa24c('0x25')](handleError(_0x457e9c,null));};exports[_0xa24c('0x85')]=function(_0x4f79f8,_0x16009c,_0x45cf2e){return db[_0xa24c('0x3d')][_0xa24c('0x61')]({'where':{'id':_0x4f79f8[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x16009c,null))['then'](function(_0x237532){if(_0x237532){return _0x237532['setSmtp'](null);}return null;})[_0xa24c('0x1c')](respondWithStatusCode(_0x16009c,null))[_0xa24c('0x25')](handleError(_0x16009c,null));};exports[_0xa24c('0x86')]=function(_0xd6aab2,_0x3c5b2f,_0x1abe89){return db[_0xa24c('0x87')]['find']({'where':{'id':_0xd6aab2[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x3c5b2f,null))[_0xa24c('0x1c')](function(_0x2dedbf){if(_0x2dedbf){return _0x2dedbf[_0xa24c('0x86')](_0xd6aab2[_0xa24c('0x58')]['ids'],_[_0xa24c('0x88')](_0xd6aab2[_0xa24c('0x58')],['ids','id'])||{});}})['then'](respondWithResult(_0x3c5b2f,null))[_0xa24c('0x25')](handleError(_0x3c5b2f,null));};exports[_0xa24c('0x89')]=function(_0x1addc7,_0x58b872,_0x368a19){var _0x4ab8e0={'raw':![],'where':{}};var _0x46d9a7={};var _0x18d4e0={'count':0x0,'rows':[]};return db[_0xa24c('0x3d')][_0xa24c('0x61')]({'where':{'id':_0x1addc7[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x58b872,null))['then'](function(_0x59940a){if(_0x59940a){_0x46d9a7[_0xa24c('0x42')]=_[_0xa24c('0x55')](db[_0xa24c('0x87')][_0xa24c('0x3e')]);_0x46d9a7['query']=_[_0xa24c('0x55')](_0x1addc7['query']);_0x46d9a7['filters']=_['intersection'](_0x46d9a7[_0xa24c('0x42')],_0x46d9a7['query']);_0x4ab8e0[_0xa24c('0x45')]=_[_0xa24c('0x44')](_0x46d9a7[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x1addc7[_0xa24c('0x43')][_0xa24c('0x46')]));_0x4ab8e0[_0xa24c('0x45')]=_0x4ab8e0[_0xa24c('0x45')][_0xa24c('0x47')]?_0x4ab8e0[_0xa24c('0x45')]:_0x46d9a7[_0xa24c('0x42')];if(!_0x1addc7[_0xa24c('0x43')]['hasOwnProperty'](_0xa24c('0x62'))){_0x4ab8e0[_0xa24c('0x2a')]=qs[_0xa24c('0x2a')](_0x1addc7[_0xa24c('0x43')][_0xa24c('0x2a')]);_0x4ab8e0[_0xa24c('0x2c')]=qs['offset'](_0x1addc7[_0xa24c('0x43')]['offset']);}_0x4ab8e0['order']=qs[_0xa24c('0x49')](_0x1addc7['query']['sort']);_0x4ab8e0[_0xa24c('0x4a')]=qs[_0xa24c('0x4b')](_[_0xa24c('0x4c')](_0x1addc7['query'],_0x46d9a7['filters']));_0x4ab8e0[_0xa24c('0x4a')]['MailAccountId']=_0x59940a['id'];if(_0x1addc7['query']['filter']){_0x4ab8e0[_0xa24c('0x4a')]=_['merge'](_0x4ab8e0[_0xa24c('0x4a')],{'$or':_[_0xa24c('0x64')](_0x4ab8e0[_0xa24c('0x45')],function(_0x5f49fc){var _0x1b6766={};_0x1b6766[_0x5f49fc]={'$like':'%'+_0x1addc7[_0xa24c('0x43')][_0xa24c('0x4d')]+'%'};return _0x1b6766;})});}_0x4ab8e0=_[_0xa24c('0x4e')]({},_0x4ab8e0,_0x1addc7['options']);return db[_0xa24c('0x87')][_0xa24c('0x2b')]({'where':_0x4ab8e0[_0xa24c('0x4a')]})[_0xa24c('0x1c')](function(_0x446a73){_0x18d4e0[_0xa24c('0x2b')]=_0x446a73;if(_0x1addc7[_0xa24c('0x43')][_0xa24c('0x51')]){_0x4ab8e0[_0xa24c('0x52')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa24c('0x8a')],'as':'Owner','attributes':[_0xa24c('0x36'),_0xa24c('0x8b'),_0xa24c('0x8c')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xa24c('0x8d')],'where':_0x1addc7[_0xa24c('0x43')][_0xa24c('0x8e')]?{'id':_0x1addc7[_0xa24c('0x43')][_0xa24c('0x8e')]}:undefined,'required':_0x1addc7['query']['tag']?!![]:![]}];}return db[_0xa24c('0x87')][_0xa24c('0x65')](_0x4ab8e0);})['then'](function(_0x391318){_0x18d4e0['rows']=_0x391318;return _0x18d4e0;});}})['then'](respondWithFilteredResult(_0x58b872,_0x4ab8e0))[_0xa24c('0x25')](handleError(_0x58b872,null));};exports[_0xa24c('0x8f')]=function(_0x2e20e1,_0x61861e,_0x5516c8){return db['MailAccount'][_0xa24c('0x61')]({'where':{'id':_0x2e20e1[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x61861e,null))[_0xa24c('0x1c')](function(_0x1ad05d){if(_0x1ad05d){return db[_0xa24c('0x90')][_0xa24c('0x91')](function(_0x4f17dc){return db['MailApplication'][_0xa24c('0x31')]({'where':{'MailAccountId':_0x2e20e1['params']['id']},'transaction':_0x4f17dc})[_0xa24c('0x1c')](function(_0x5f5227){var _0x310da3=_['map'](_0x2e20e1['body'],function(_0x13bfad){_0x13bfad['MailAccountId']=_0x2e20e1[_0xa24c('0x5c')]['id'];return _0x13bfad;});return db[_0xa24c('0x92')][_0xa24c('0x93')](_0x310da3,{'transaction':_0x4f17dc});});})[_0xa24c('0x1c')](function(){return db[_0xa24c('0x92')][_0xa24c('0x94')]({'where':{'MailAccountId':_0x2e20e1['params']['id']},'order':_0xa24c('0x95')});});}})[_0xa24c('0x1c')](respondWithResult(_0x61861e,null))[_0xa24c('0x25')](handleError(_0x61861e,null));};exports[_0xa24c('0x96')]=function(_0x32819a,_0x5ce5b6,_0x167d1e){var _0x4194f7={};var _0x5e44a4={};var _0x154fe3;var _0x14fc72;return db[_0xa24c('0x3d')][_0xa24c('0x61')]({'where':{'id':_0x32819a[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x5ce5b6,null))[_0xa24c('0x1c')](function(_0x3df310){if(_0x3df310){_0x154fe3=_0x3df310;_0x5e44a4[_0xa24c('0x42')]=_['keys'](db[_0xa24c('0x92')][_0xa24c('0x3e')]);_0x5e44a4['query']=_['keys'](_0x32819a[_0xa24c('0x43')]);_0x5e44a4[_0xa24c('0x4b')]=_[_0xa24c('0x44')](_0x5e44a4[_0xa24c('0x42')],_0x5e44a4['query']);_0x4194f7['attributes']=_[_0xa24c('0x44')](_0x5e44a4[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x32819a[_0xa24c('0x43')]['fields']));_0x4194f7[_0xa24c('0x45')]=_0x4194f7[_0xa24c('0x45')][_0xa24c('0x47')]?_0x4194f7[_0xa24c('0x45')]:_0x5e44a4['model'];_0x4194f7[_0xa24c('0x63')]=qs[_0xa24c('0x49')](_0x32819a[_0xa24c('0x43')][_0xa24c('0x49')]);_0x4194f7[_0xa24c('0x4a')]=qs[_0xa24c('0x4b')](_[_0xa24c('0x4c')](_0x32819a[_0xa24c('0x43')],_0x5e44a4[_0xa24c('0x4b')]));if(_0x32819a[_0xa24c('0x43')][_0xa24c('0x4d')]){_0x4194f7[_0xa24c('0x4a')]=_['merge'](_0x4194f7[_0xa24c('0x4a')],{'$or':_['map'](_0x4194f7['attributes'],function(_0x58e905){var _0x5bfde4={};_0x5bfde4[_0x58e905]={'$like':'%'+_0x32819a[_0xa24c('0x43')]['filter']+'%'};return _0x5bfde4;})});}_0x4194f7=_['merge']({},_0x4194f7,_0x32819a['options']);return _0x154fe3[_0xa24c('0x96')](_0x4194f7);}})[_0xa24c('0x1c')](function(_0x3ce85b){if(_0x3ce85b){_0x14fc72=_0x3ce85b['length'];if(!_0x32819a['query'][_0xa24c('0x48')](_0xa24c('0x62'))){_0x4194f7[_0xa24c('0x2a')]=qs[_0xa24c('0x2a')](_0x32819a[_0xa24c('0x43')][_0xa24c('0x2a')]);_0x4194f7[_0xa24c('0x2c')]=qs[_0xa24c('0x2c')](_0x32819a['query'][_0xa24c('0x2c')]);}return _0x154fe3[_0xa24c('0x96')](_0x4194f7);}})[_0xa24c('0x1c')](function(_0x45d4db){if(_0x45d4db){return _0x45d4db?{'count':_0x14fc72,'rows':_0x45d4db}:null;}})['then'](respondWithResult(_0x5ce5b6,null))['catch'](handleError(_0x5ce5b6,null));};exports[_0xa24c('0x97')]=function(_0x16748b,_0x39dc23,_0x2d6338){var _0x1be7e9={'raw':!![],'where':{}};var _0x50c574={};var _0x5d2f1d={'count':0x0,'rows':[]};return db[_0xa24c('0x3d')]['findOne']({'where':{'id':_0x16748b[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x39dc23,null))[_0xa24c('0x1c')](function(_0x21c58f){if(_0x21c58f){_0x50c574[_0xa24c('0x42')]=_[_0xa24c('0x55')](db[_0xa24c('0x98')]['rawAttributes']);_0x50c574[_0xa24c('0x43')]=_['keys'](_0x16748b['query']);_0x50c574[_0xa24c('0x4b')]=_[_0xa24c('0x44')](_0x50c574[_0xa24c('0x42')],_0x50c574[_0xa24c('0x43')]);_0x1be7e9[_0xa24c('0x45')]=_[_0xa24c('0x44')](_0x50c574[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x16748b[_0xa24c('0x43')][_0xa24c('0x46')]));_0x1be7e9[_0xa24c('0x45')]=_0x1be7e9['attributes']['length']?_0x1be7e9[_0xa24c('0x45')]:_0x50c574[_0xa24c('0x42')];if(!_0x16748b[_0xa24c('0x43')]['hasOwnProperty'](_0xa24c('0x62'))){_0x1be7e9[_0xa24c('0x2a')]=qs['limit'](_0x16748b[_0xa24c('0x43')][_0xa24c('0x2a')]);_0x1be7e9[_0xa24c('0x2c')]=qs[_0xa24c('0x2c')](_0x16748b[_0xa24c('0x43')]['offset']);}_0x1be7e9[_0xa24c('0x63')]=qs[_0xa24c('0x49')](_0x16748b[_0xa24c('0x43')]['sort']);_0x1be7e9[_0xa24c('0x4a')]=qs[_0xa24c('0x4b')](_[_0xa24c('0x4c')](_0x16748b[_0xa24c('0x43')],_0x50c574[_0xa24c('0x4b')]));_0x1be7e9[_0xa24c('0x4a')][_0xa24c('0x5d')]=_0x21c58f['id'];if(_0x16748b[_0xa24c('0x43')][_0xa24c('0x4d')]){_0x1be7e9[_0xa24c('0x4a')]=_['merge'](_0x1be7e9[_0xa24c('0x4a')],{'$or':_['map'](_0x1be7e9[_0xa24c('0x45')],function(_0x194e69){var _0x386f5f={};_0x386f5f[_0x194e69]={'$like':'%'+_0x16748b[_0xa24c('0x43')]['filter']+'%'};return _0x386f5f;})});}if(_0x16748b[_0xa24c('0x43')][_0xa24c('0x99')]){var _0x465b58=_0x16748b[_0xa24c('0x43')]['$gte'][_0xa24c('0x9a')](',');var _0x25af86={};_0x25af86[_0x465b58[0x0]]={'$gte':moment(_0x465b58[0x1])[_0xa24c('0x9b')](_0xa24c('0x9c'))};_0x1be7e9[_0xa24c('0x4a')]=_[_0xa24c('0x4e')](_0x1be7e9['where'],_0x25af86);}_0x1be7e9=_[_0xa24c('0x4e')]({},_0x1be7e9,_0x16748b[_0xa24c('0x50')]);return db[_0xa24c('0x98')][_0xa24c('0x2b')]({'where':_0x1be7e9[_0xa24c('0x4a')]})[_0xa24c('0x1c')](function(_0x1b0e51){_0x5d2f1d[_0xa24c('0x2b')]=_0x1b0e51;if(_0x16748b['query'][_0xa24c('0x51')]){_0x1be7e9[_0xa24c('0x52')]=[{'all':!![]}];}return db[_0xa24c('0x98')]['findAll'](_0x1be7e9);})[_0xa24c('0x1c')](function(_0x206e6b){if(_0x16748b[_0xa24c('0x43')][_0xa24c('0x9d')]===_0xa24c('0x9e')){for(var _0x3c339e=0x0;_0x3c339e<_0x206e6b['length'];_0x3c339e++){_0x206e6b[_0x3c339e][_0xa24c('0x58')]=juice(_0x206e6b[_0x3c339e][_0xa24c('0x58')]);}}_0x5d2f1d[_0xa24c('0x53')]=_0x206e6b;return _0x5d2f1d;});}})[_0xa24c('0x1c')](respondWithFilteredResult(_0x39dc23,_0x1be7e9))[_0xa24c('0x25')](handleError(_0x39dc23,null));};exports['send']=function(_0x48d97e,_0x47f668,_0x21b24e){var _0x524be5,_0xca5db7={},_0x363f52;if(_0x48d97e[_0xa24c('0x58')]['to']){_0x363f52=_0x48d97e[_0xa24c('0x58')]['to']['split'](',')[0x0];}return db['MailAccount'][_0xa24c('0x56')]({'where':{'id':_0x48d97e['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xa24c('0x9f')],'as':'Contacts','where':{'email':_0x363f52},'limit':0x1,'order':[[_0xa24c('0xa0'),_0xa24c('0xa1')]]}]},{'model':db[_0xa24c('0x59')],'as':_0xa24c('0x3a'),'raw':!![]}]})[_0xa24c('0x1c')](handleEntityNotFound(_0x47f668,null))['then'](function(_0xfc891d){if(_0xfc891d){_0x524be5=_0xfc891d;if(_0xfc891d[_0xa24c('0x3a')]){if(_[_0xa24c('0x6e')](_0x48d97e['body'][_0xa24c('0xa2')])){_0x48d97e['body'][_0xa24c('0xa2')]=util[_0xa24c('0x9b')](_0xa24c('0xa3'),_0xfc891d[_0xa24c('0x36')],_0xfc891d['email']||_0xfc891d[_0xa24c('0x3a')]['user']);}if(_0x48d97e[_0xa24c('0x58')][_0xa24c('0xa4')]&&_0x48d97e[_0xa24c('0x58')][_0xa24c('0xa4')][_0xa24c('0x47')]){for(var _0x19237c=0x0;_0x19237c<_0x48d97e[_0xa24c('0x58')][_0xa24c('0xa4')][_0xa24c('0x47')];_0x19237c+=0x1){_0x48d97e[_0xa24c('0x58')][_0xa24c('0xa4')][_0x19237c]={'filename':_0x48d97e[_0xa24c('0x58')]['attachments'][_0x19237c]['name'],'path':path[_0xa24c('0xa5')](config[_0xa24c('0xa6')],'server/files/attachments',_0x48d97e[_0xa24c('0x58')][_0xa24c('0xa4')][_0x19237c][_0xa24c('0xa7')])};}}var _0x4d6c89={'tls':{'rejectUnauthorized':![]}};if(_[_0xa24c('0x6e')](_0xfc891d[_0xa24c('0x3a')][_0xa24c('0x79')])){if(_0xfc891d['Smtp'][_0xa24c('0x76')]){_0x4d6c89[_0xa24c('0xa8')]={'user':_0xfc891d[_0xa24c('0x3a')][_0xa24c('0x72')],'pass':_0xfc891d[_0xa24c('0x3a')][_0xa24c('0x7a')]};}_0x4d6c89[_0xa24c('0x77')]=_0xfc891d['Smtp']['host'];_0x4d6c89[_0xa24c('0x78')]=_0xfc891d[_0xa24c('0x3a')]['port'];_0x4d6c89[_0xa24c('0xa9')]=_0xfc891d[_0xa24c('0x3a')][_0xa24c('0xa9')];}else{_0x4d6c89[_0xa24c('0x79')]=_0xfc891d[_0xa24c('0x3a')][_0xa24c('0x79')];_0x4d6c89['auth']={'user':_0xfc891d[_0xa24c('0x3a')][_0xa24c('0x72')],'pass':_0xfc891d[_0xa24c('0x3a')][_0xa24c('0x7a')]};}return respondWithRpcPromise('SendMail',_0xa24c('0xaa'),{'account':_0x4d6c89,'message':_0x48d97e[_0xa24c('0x58')]});}else{throw new Error(_0xa24c('0xab'));}}})[_0xa24c('0x1c')](function(_0x2bb8e5){if(_0x2bb8e5){_0xca5db7=_0x2bb8e5;if(_0x524be5[_0xa24c('0xac')]){if(_0x524be5['List'][_0xa24c('0xad')][_0xa24c('0x47')]){return _0x524be5[_0xa24c('0xac')][_0xa24c('0xad')][0x0];}else{return db[_0xa24c('0x9f')][_0xa24c('0x5f')](_[_0xa24c('0x16')](_0x48d97e[_0xa24c('0x58')],{'firstName':_0x48d97e[_0xa24c('0x58')]['to'],'email':_0x48d97e[_0xa24c('0x58')]['to'],'phone':_0x48d97e[_0xa24c('0x58')]['to'],'ListId':_0x524be5[_0xa24c('0x6d')]}));}}else{throw new Error(_0xa24c('0xab'));}}})['then'](function(_0x1964d9){if(_0x1964d9){var _0x8dc70f={'UserId':_0x48d97e[_0xa24c('0x72')]['id'],'ContactId':_0x1964d9['id'],'MailAccountId':_0x524be5['id'],'inReplyTo':_0xca5db7[_0xa24c('0xae')],'to':_0x48d97e[_0xa24c('0x58')][_0xa24c('0xa2')],'cc':_0x48d97e[_0xa24c('0x58')]['cc'],'subject':_0x48d97e[_0xa24c('0x58')][_0xa24c('0xaf')],'attach':_0x48d97e[_0xa24c('0x58')][_0xa24c('0xb0')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xa24c('0x9b')](_0xa24c('0x9c')),'lastMsgDirection':_0xa24c('0xb1'),'Messages':[_[_0xa24c('0x4e')](_0x48d97e[_0xa24c('0x58')],{'messageId':_0xca5db7['messageId'],'sentAt':moment()[_0xa24c('0x9b')](_0xa24c('0x9c')),'read':!![],'MailAccountId':_0x524be5['id'],'UserId':_0x48d97e['user']['id'],'ContactId':_0x1964d9['id']})]};if(_0x48d97e[_0xa24c('0x58')][_0xa24c('0xb2')]){_0x8dc70f=_[_0xa24c('0x4e')](_0x8dc70f,_0x48d97e[_0xa24c('0x58')][_0xa24c('0xb2')]);}return db['MailInteraction'][_0xa24c('0x5f')](_0x8dc70f,{'include':[{'model':db['MailMessage'],'as':_0xa24c('0xb3')}]});}})[_0xa24c('0x1c')](respondWithResult(_0x47f668,null))[_0xa24c('0x25')](handleError(_0x47f668,null));};exports[_0xa24c('0xb4')]=function(_0xa49584,_0xe172ce,_0x3a561e){return db[_0xa24c('0x3d')][_0xa24c('0x56')]({'where':{'id':_0xa49584['params']['id']},'include':[{'model':db[_0xa24c('0x59')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0xe172ce,null))[_0xa24c('0x1c')](function(_0x3a2818){if(_0x3a2818&&_0x3a2818[_0xa24c('0x3a')]){var _0x1b72af={'id':_0x3a2818['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3a2818[_0xa24c('0x3a')]['service']){_0x1b72af[_0xa24c('0x79')]=_0x3a2818['Smtp'][_0xa24c('0x79')];}else{_0x1b72af['host']=_0x3a2818[_0xa24c('0x3a')]['host'];_0x1b72af['port']=_0x3a2818[_0xa24c('0x3a')]['port'];_0x1b72af['secure']=_0x3a2818[_0xa24c('0x3a')][_0xa24c('0xa9')];}if(_0x3a2818[_0xa24c('0x3a')]['authentication']){_0x1b72af[_0xa24c('0xa8')]={'user':_0x3a2818[_0xa24c('0x3a')][_0xa24c('0x72')],'pass':_0x3a2818['Smtp'][_0xa24c('0x7a')]};}return respondWithRpcPromise(_0xa24c('0xb5'),_0xa24c('0xb4'),{'account':_0x1b72af});}})[_0xa24c('0x1c')](respondWithResult(_0xe172ce,null))[_0xa24c('0x25')](handleError(_0xe172ce,null));};exports['destroy']=function(_0x4c6eb9,_0x2012f9){return db[_0xa24c('0x3d')]['find']({'where':{'id':_0x4c6eb9[_0xa24c('0x5c')]['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x2012f9,null))[_0xa24c('0x1c')](function(_0x30e2aa){if(_0x30e2aa&&_0x30e2aa[_0xa24c('0x79')]){throw new db[(_0xa24c('0xb6'))]['ValidationError'](_0xa24c('0xb7'));}return _0x30e2aa;})[_0xa24c('0x1c')](removeEntity(_0x2012f9,null))['catch'](handleError(_0x2012f9,null));};exports[_0xa24c('0xb8')]=function(_0x4f2642,_0x3f3aef,_0x162eb3){return db[_0xa24c('0x3d')][_0xa24c('0x56')]({'where':{'id':_0x4f2642[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3f3aef,null))[_0xa24c('0x1c')](function(_0x24c4cb){if(_0x24c4cb){return _0x24c4cb[_0xa24c('0xb8')](_0x4f2642[_0xa24c('0x58')][_0xa24c('0x67')],_['omit'](_0x4f2642[_0xa24c('0x58')],['ids','id'])||{})[_0xa24c('0xb9')](function(_0x42c403){for(var _0x2af9a0=0x0;_0x2af9a0<_0x4f2642['body'][_0xa24c('0x67')][_0xa24c('0x47')];_0x2af9a0+=0x1){socket[_0xa24c('0xba')]('userMailAccount:save',{'UserId':_0x4f2642[_0xa24c('0x58')]['ids'][_0x2af9a0],'MailAccountId':_0x4f2642['params']['id']});}return _0x42c403;});}})['then'](respondWithResult(_0x3f3aef,null))[_0xa24c('0x25')](handleError(_0x3f3aef,null));};exports[_0xa24c('0xbb')]=function(_0x224686,_0x5026f5,_0x4f1c30){return db['MailAccount'][_0xa24c('0x56')]({'where':{'id':_0x224686[_0xa24c('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5026f5,null))['then'](function(_0x447739){if(_0x447739){return _0x447739[_0xa24c('0xbb')](_0x224686[_0xa24c('0x43')][_0xa24c('0x67')])[_0xa24c('0x1c')](function(){if(_[_0xa24c('0xbc')](_0x224686[_0xa24c('0x43')][_0xa24c('0x67')])){for(var _0x39220a=0x0;_0x39220a<_0x224686[_0xa24c('0x43')][_0xa24c('0x67')][_0xa24c('0x47')];_0x39220a+=0x1){socket[_0xa24c('0xba')](_0xa24c('0xbd'),{'UserId':Number(_0x224686[_0xa24c('0x43')]['ids'][_0x39220a]),'MailAccountId':Number(_0x224686[_0xa24c('0x5c')]['id'])});}}else{socket[_0xa24c('0xba')](_0xa24c('0xbd'),{'UserId':Number(_0x224686[_0xa24c('0x43')][_0xa24c('0x67')]),'MailAccountId':Number(_0x224686[_0xa24c('0x5c')]['id'])});}});}})[_0xa24c('0x1c')](respondWithStatusCode(_0x5026f5,null))[_0xa24c('0x25')](handleError(_0x5026f5,null));};exports['getAgents']=function(_0x53b569,_0x55b4c7,_0x169cc7){var _0x199d09={};var _0x4bddb7={};var _0x475a00;var _0x405279;return db[_0xa24c('0x3d')]['findOne']({'where':{'id':_0x53b569['params']['id']}})[_0xa24c('0x1c')](handleEntityNotFound(_0x55b4c7,null))[_0xa24c('0x1c')](function(_0x20311b){if(_0x20311b){_0x475a00=_0x20311b;_0x4bddb7[_0xa24c('0x42')]=_[_0xa24c('0x55')](db['User'][_0xa24c('0x3e')]);_0x4bddb7[_0xa24c('0x43')]=_[_0xa24c('0x55')](_0x53b569[_0xa24c('0x43')]);_0x4bddb7[_0xa24c('0x4b')]=_[_0xa24c('0x44')](_0x4bddb7[_0xa24c('0x42')],_0x4bddb7[_0xa24c('0x43')]);_0x199d09[_0xa24c('0x45')]=_[_0xa24c('0x44')](_0x4bddb7[_0xa24c('0x42')],qs[_0xa24c('0x46')](_0x53b569[_0xa24c('0x43')]['fields']));_0x199d09['attributes']=_0x199d09[_0xa24c('0x45')][_0xa24c('0x47')]?_0x199d09[_0xa24c('0x45')]:_0x4bddb7[_0xa24c('0x42')];_0x199d09['order']=qs[_0xa24c('0x49')](_0x53b569[_0xa24c('0x43')][_0xa24c('0x49')]);_0x199d09[_0xa24c('0x4a')]=qs[_0xa24c('0x4b')](_[_0xa24c('0x4c')](_0x53b569[_0xa24c('0x43')],_0x4bddb7[_0xa24c('0x4b')]));if(_0x53b569['query'][_0xa24c('0x4d')]){_0x199d09[_0xa24c('0x4a')]=_[_0xa24c('0x4e')](_0x199d09[_0xa24c('0x4a')],{'$or':_['map'](_0x199d09[_0xa24c('0x45')],function(_0xc8f4a7){var _0x54df5c={};_0x54df5c[_0xc8f4a7]={'$like':'%'+_0x53b569[_0xa24c('0x43')]['filter']+'%'};return _0x54df5c;})});}_0x199d09=_[_0xa24c('0x4e')]({},_0x199d09,_0x53b569[_0xa24c('0x50')]);return _0x475a00[_0xa24c('0xbe')](_0x199d09);}})[_0xa24c('0x1c')](function(_0x4b8893){if(_0x4b8893){_0x405279=_0x4b8893['length'];if(!_0x53b569[_0xa24c('0x43')]['hasOwnProperty'](_0xa24c('0x62'))){_0x199d09[_0xa24c('0x2a')]=qs['limit'](_0x53b569[_0xa24c('0x43')][_0xa24c('0x2a')]);_0x199d09[_0xa24c('0x2c')]=qs[_0xa24c('0x2c')](_0x53b569['query']['offset']);}return _0x475a00[_0xa24c('0xbe')](_0x199d09);}})[_0xa24c('0x1c')](function(_0x9c3210){if(_0x9c3210){return _0x9c3210?{'count':_0x405279,'rows':_0x9c3210}:null;}})[_0xa24c('0x1c')](respondWithResult(_0x55b4c7,null))['catch'](handleError(_0x55b4c7,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 294d3bd..3d0cfc5 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 _0xad5f=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1d5a18,_0x585dc8){var _0x411450=function(_0x3f4ad8){while(--_0x3f4ad8){_0x1d5a18['push'](_0x1d5a18['shift']());}};_0x411450(++_0x585dc8);}(_0xad5f,0x1a8));var _0xfad5=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0xad5f[_0x1876b2];return _0x9fb1e0;};'use strict';var EventEmitter=require(_0xfad5('0x0'));var MailAccount=require(_0xfad5('0x1'))['db'][_0xfad5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xfad5('0x3')](0x0);var events={'afterCreate':_0xfad5('0x4'),'afterUpdate':_0xfad5('0x5'),'afterDestroy':'remove'};function emitEvent(_0xcc61b1){return function(_0x316561,_0x1ae06d,_0x2da73e){MailAccountEvents[_0xfad5('0x6')](_0xcc61b1+':'+_0x316561['id'],_0x316561);MailAccountEvents[_0xfad5('0x6')](_0xcc61b1,_0x316561);_0x2da73e(null);};}for(var e in events){if(events[_0xfad5('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xfad5('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xf1c6=['remove','emit','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update'];(function(_0x5e64bb,_0x1abf81){var _0x32cd6c=function(_0x22e596){while(--_0x22e596){_0x5e64bb['push'](_0x5e64bb['shift']());}};_0x32cd6c(++_0x1abf81);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x2516e3,_0x2fd130){_0x2516e3=_0x2516e3-0x0;var _0xbae508=_0xf1c6[_0x2516e3];return _0xbae508;};'use strict';var EventEmitter=require(_0x6f1c('0x0'));var MailAccount=require(_0x6f1c('0x1'))['db'][_0x6f1c('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6f1c('0x3')](0x0);var events={'afterCreate':_0x6f1c('0x4'),'afterUpdate':_0x6f1c('0x5'),'afterDestroy':_0x6f1c('0x6')};function emitEvent(_0x48b5bf){return function(_0x3747f8,_0x2c875e,_0x2af48e){MailAccountEvents[_0x6f1c('0x7')](_0x48b5bf+':'+_0x3747f8['id'],_0x3747f8);MailAccountEvents['emit'](_0x48b5bf,_0x3747f8);_0x2af48e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x6f1c('0x8')](e,emitEvent(event));}}module[_0x6f1c('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index d26d80c..2cb6e50 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 _0x547b=['api','moment','request-promise','rimraf','../../config/environment','./mailAccount.attributes','MailAccount','mail_accounts','lodash','util'];(function(_0x7655fc,_0x37b951){var _0x46d2d0=function(_0x1f571c){while(--_0x1f571c){_0x7655fc['push'](_0x7655fc['shift']());}};_0x46d2d0(++_0x37b951);}(_0x547b,0xa8));var _0xb547=function(_0x16da3c,_0x3e89b8){_0x16da3c=_0x16da3c-0x0;var _0x5840b6=_0x547b[_0x16da3c];return _0x5840b6;};'use strict';var _=require(_0xb547('0x0'));var util=require(_0xb547('0x1'));var logger=require('../../config/logger')(_0xb547('0x2'));var moment=require(_0xb547('0x3'));var BPromise=require('bluebird');var rp=require(_0xb547('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb547('0x5'));var config=require(_0xb547('0x6'));var attributes=require(_0xb547('0x7'));module['exports']=function(_0x4f026e,_0x45006e){return _0x4f026e['define'](_0xb547('0x8'),attributes,{'tableName':_0xb547('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d91=['moment','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','../../config/logger'];(function(_0x4e77f3,_0x596d06){var _0x32c25a=function(_0x3bc78f){while(--_0x3bc78f){_0x4e77f3['push'](_0x4e77f3['shift']());}};_0x32c25a(++_0x596d06);}(_0x7d91,0x1a6));var _0x17d9=function(_0x4146d8,_0x869d79){_0x4146d8=_0x4146d8-0x0;var _0x48c0d2=_0x7d91[_0x4146d8];return _0x48c0d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x17d9('0x0'))('api');var moment=require(_0x17d9('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x17d9('0x2'));var config=require(_0x17d9('0x3'));var attributes=require(_0x17d9('0x4'));module[_0x17d9('0x5')]=function(_0x4c6f99,_0x47c090){return _0x4c6f99[_0x17d9('0x6')](_0x17d9('0x7'),attributes,{'tableName':_0x17d9('0x8'),'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 43be6e1..8f76d8b 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 _0x67db=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','MailAccount','findAll','raw','options','attributes','limit','include','map','model','then','info','GetMailAccount','debug','ShowMailAccount','find','where','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','List','applications','orderBy','priority','asc','push','autoclose','*,*,*,*','length','defaults','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','get','interaction','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','bluebird','randomstring','ioredis'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x67db,0x69));var _0xb67d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x67db[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0xb67d('0x0'));var moment=require('moment');var BPromise=require(_0xb67d('0x1'));var rs=require(_0xb67d('0x2'));var fs=require('fs');var Redis=require(_0xb67d('0x3'));var db=require(_0xb67d('0x4'))['db'];var utils=require(_0xb67d('0x5'));var logger=require(_0xb67d('0x6'))(_0xb67d('0x7'));var config=require(_0xb67d('0x8'));var jayson=require(_0xb67d('0x9'));var client=jayson[_0xb67d('0xa')]['http']({'port':0x232c});config[_0xb67d('0xb')]=_['defaults'](config[_0xb67d('0xb')],{'host':_0xb67d('0xc'),'port':0x18eb});var socket=require(_0xb67d('0xd'))(new Redis(config[_0xb67d('0xb')]));require(_0xb67d('0xe'))[_0xb67d('0xf')](socket);function respondWithRpcPromise(_0x51c26d,_0x26ef2f,_0x3ad225){return new BPromise(function(_0x3b80bf,_0x1e0b57){return client[_0xb67d('0x10')](_0x51c26d,_0x3ad225)['then'](function(_0x289bb1){logger['info']('MailAccount,\x20%s,\x20%s',_0x26ef2f,_0xb67d('0x11'));logger['debug'](_0xb67d('0x12'),_0x26ef2f,_0xb67d('0x11'),JSON[_0xb67d('0x13')](_0x289bb1));if(_0x289bb1['error']){if(_0x289bb1[_0xb67d('0x14')][_0xb67d('0x15')]===0x1f4){logger[_0xb67d('0x14')](_0xb67d('0x16'),_0x26ef2f,_0x289bb1[_0xb67d('0x14')][_0xb67d('0x17')]);return _0x1e0b57(_0x289bb1[_0xb67d('0x14')][_0xb67d('0x17')]);}logger[_0xb67d('0x14')](_0xb67d('0x16'),_0x26ef2f,_0x289bb1[_0xb67d('0x14')][_0xb67d('0x17')]);return _0x3b80bf(_0x289bb1[_0xb67d('0x14')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x26ef2f,'request\x20sent');_0x3b80bf(_0x289bb1[_0xb67d('0x18')][_0xb67d('0x17')]);}})[_0xb67d('0x19')](function(_0x426968){logger['error']('MailAccount,\x20%s,\x20%s',_0x26ef2f,_0x426968);_0x1e0b57(_0x426968);});});}exports['GetMailAccount']=function(_0x163119){var _0x5ed00c=this;return new Promise(function(_0x24d16f,_0x2d88b7){return db[_0xb67d('0x1a')][_0xb67d('0x1b')]({'raw':_0x163119['options']?_0x163119['options'][_0xb67d('0x1c')]===undefined?!![]:![]:!![],'where':_0x163119['options']?_0x163119['options']['where']||null:null,'attributes':_0x163119[_0xb67d('0x1d')]?_0x163119['options'][_0xb67d('0x1e')]||null:null,'limit':_0x163119[_0xb67d('0x1d')]?_0x163119[_0xb67d('0x1d')][_0xb67d('0x1f')]||null:null,'include':_0x163119[_0xb67d('0x1d')]?_0x163119[_0xb67d('0x1d')][_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x163119['options']['include'],function(_0x32f09f){return{'model':db[_0x32f09f[_0xb67d('0x22')]],'as':_0x32f09f['as'],'attributes':_0x32f09f[_0xb67d('0x1e')],'include':_0x32f09f[_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x32f09f[_0xb67d('0x20')],function(_0x6dc152){return{'model':db[_0x6dc152[_0xb67d('0x22')]],'as':_0x6dc152['as'],'attributes':_0x6dc152[_0xb67d('0x1e')],'include':_0x6dc152['include']?_['map'](_0x6dc152[_0xb67d('0x20')],function(_0x2304c8){return{'model':db[_0x2304c8[_0xb67d('0x22')]],'as':_0x2304c8['as'],'attributes':_0x2304c8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb67d('0x23')](function(_0x11334a){logger[_0xb67d('0x24')](_0xb67d('0x25'),_0x163119);logger[_0xb67d('0x26')]('GetMailAccount',_0x163119,JSON[_0xb67d('0x13')](_0x11334a));_0x24d16f(_0x11334a);})[_0xb67d('0x19')](function(_0x130bcc){logger[_0xb67d('0x14')](_0xb67d('0x25'),_0x130bcc[_0xb67d('0x17')],_0x163119);_0x2d88b7(_0x5ed00c[_0xb67d('0x14')](0x1f4,_0x130bcc[_0xb67d('0x17')]));});});};exports[_0xb67d('0x27')]=function(_0x3a58c3){var _0x30161b=this;return new Promise(function(_0x166c31,_0x5dba99){return db[_0xb67d('0x1a')][_0xb67d('0x28')]({'raw':_0x3a58c3[_0xb67d('0x1d')]?_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a58c3['options']?_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x29')]||null:null,'attributes':_0x3a58c3[_0xb67d('0x1d')]?_0x3a58c3['options']['attributes']||null:null,'include':_0x3a58c3[_0xb67d('0x1d')]?_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x20')],function(_0x5d5b06){return{'model':db[_0x5d5b06['model']],'as':_0x5d5b06['as'],'attributes':_0x5d5b06[_0xb67d('0x1e')],'include':_0x5d5b06[_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x5d5b06[_0xb67d('0x20')],function(_0x41f486){return{'model':db[_0x41f486['model']],'as':_0x41f486['as'],'attributes':_0x41f486[_0xb67d('0x1e')],'include':_0x41f486[_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x41f486['include'],function(_0x339cc1){return{'model':db[_0x339cc1[_0xb67d('0x22')]],'as':_0x339cc1['as'],'attributes':_0x339cc1[_0xb67d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a3232){logger[_0xb67d('0x24')](_0xb67d('0x27'),_0x3a58c3);logger[_0xb67d('0x26')](_0xb67d('0x27'),_0x3a58c3,JSON[_0xb67d('0x13')](_0x1a3232));_0x166c31(_0x1a3232);})[_0xb67d('0x19')](function(_0x1af8fd){logger['error'](_0xb67d('0x27'),_0x1af8fd[_0xb67d('0x17')],_0x3a58c3);_0x5dba99(_0x30161b[_0xb67d('0x14')](0x1f4,_0x1af8fd['message']));});});};exports[_0xb67d('0x2a')]=function(_0x4aedd1){var _0x10da42=this;return new Promise(function(_0xd585fc,_0x4ebc95){var _0x30e1d0={'body':_0x4aedd1[_0xb67d('0x2b')],'channel':_0xb67d('0x2c')};var _0x3c9ad8=_[_0xb67d('0x2d')](_['keys'](db[_0xb67d('0x2e')][_0xb67d('0x2f')]),[_0xb67d('0x30'),_0xb67d('0x31'),_0xb67d('0x32'),_0xb67d('0x33')]);var _0x38de8c=![];if(_0x4aedd1[_0xb67d('0x2b')]['id']){delete _0x4aedd1['body']['id'];}if(_[_0xb67d('0x34')](_0x4aedd1[_0xb67d('0x2b')]['from'])){return _0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,_0xb67d('0x35')));}if(_[_0xb67d('0x34')](_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x2b')])||_0x4aedd1[_0xb67d('0x2b')]['body']===''){return _0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,_0xb67d('0x36')));}if(_['isNil'](_0x4aedd1['body']['mapKey'])){return _0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c9ad8));}if(!_[_0xb67d('0x37')](_0x3c9ad8,_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x38')])){return _0x4ebc95(_0x10da42['error'](0x1f4,_0xb67d('0x39')+_0x3c9ad8));}var _0xe3923d={};_0xe3923d[_0x4aedd1[_0xb67d('0x2b')]['mapKey']]=_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x3a')];return db[_0xb67d('0x1a')][_0xb67d('0x28')]({'where':{'id':_0x4aedd1[_0xb67d('0x3b')]['id']},'include':[{'model':db[_0xb67d('0x3c')],'as':'List','include':[{'model':db[_0xb67d('0x2e')],'as':_0xb67d('0x3d'),'where':_0xe3923d,'limit':0x1,'order':[[_0xb67d('0x31'),_0xb67d('0x3e')]]}]},{'model':db[_0xb67d('0x3f')],'as':_0xb67d('0x40')},{'model':db[_0xb67d('0x41')],'as':_0xb67d('0x42')}]})[_0xb67d('0x23')](function(_0x2fee69){if(_0x2fee69&&_0x2fee69[_0xb67d('0x43')]){var _0x8042b1=_0x2fee69['get']({'plain':!![]});_0x30e1d0['account']=_['omit'](_0x8042b1,[_0xb67d('0x40'),'List']);_0x30e1d0[_0xb67d('0x44')]=_0x8042b1['Applications'];_0x30e1d0['list']=_0x8042b1['List'];_0x30e1d0[_0xb67d('0x44')]=_[_0xb67d('0x45')](_0x30e1d0['applications'],[_0xb67d('0x46')],[_0xb67d('0x47')]);if(_0x30e1d0['account']&&_0x30e1d0['account']['autoclose']){_0x30e1d0[_0xb67d('0x44')][_0xb67d('0x48')]({'id':0x0,'priority':_0x30e1d0['applications']['length']+0x1,'app':'close','appdata':_0xb67d('0x49'),'interval':_0xb67d('0x4a')});}if(_0x30e1d0[_0xb67d('0x3b')]['Applications']){delete _0x30e1d0[_0xb67d('0x3b')][_0xb67d('0x40')];}if(_0x30e1d0[_0xb67d('0x3b')]['List']){delete _0x30e1d0[_0xb67d('0x3b')][_0xb67d('0x43')];}if(_0x8042b1['List'][_0xb67d('0x3d')][_0xb67d('0x4b')]){return _0x8042b1[_0xb67d('0x43')][_0xb67d('0x3d')][0x0];}var _0x156b01=_[_0xb67d('0x4c')](_0x4aedd1[_0xb67d('0x2b')],{'firstName':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x3a')],'ListId':_0x8042b1['ListId']});_0x156b01[_0x4aedd1['body'][_0xb67d('0x38')]]=_0x4aedd1[_0xb67d('0x2b')]['from'];return db[_0xb67d('0x2e')][_0xb67d('0x4d')](_0x156b01);}else{throw new Error(_0xb67d('0x4e'));}})[_0xb67d('0x23')](function(_0x2fdb4b){_0x30e1d0[_0xb67d('0x4f')]=_0x2fdb4b;if(_0x2fdb4b){if(!_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x50')]){_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x50')]=rs[_0xb67d('0x51')]()+'\x20'+_0x4aedd1['body']['message'][_0xb67d('0x3a')];}var _0x3ecf7e={'ContactId':_0x2fdb4b['id'],'MailAccountId':_0x4aedd1[_0xb67d('0x3b')]['id'],'inReplyTo':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x50')],'to':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x3a')],'cc':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['cc'],'subject':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x52')],'attach':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x53')],'lastMsgAt':moment()[_0xb67d('0x54')](_0xb67d('0x55')),'lastMsgDirection':'in'};return db[_0xb67d('0x56')][_0xb67d('0x28')]({'where':{'closed':![],'MailAccountId':_0x4aedd1['account']['id']},'include':[{'model':db[_0xb67d('0x57')],'as':_0xb67d('0x58'),'attributes':[_0xb67d('0x50')],'where':{'messageId':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x59')]}}]})[_0xb67d('0x23')](function(_0x1ce43f){if(_0x1ce43f){return[_0x1ce43f,![]];}return db[_0xb67d('0x56')]['create'](_0x3ecf7e)['then'](function(_0x4e0362){return[_0x4e0362,!![]];});});}else{throw new Error(_0xb67d('0x5a'));}})['spread'](function(_0x58493d,_0x28380d){if(_0x58493d){_0x38de8c=_0x28380d;if(!_0x28380d){return _0x58493d[_0xb67d('0x5b')]({'inReplyTo':_0x4aedd1['body']['message'][_0xb67d('0x50')],'to':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['from'],'cc':_0x4aedd1[_0xb67d('0x2b')]['message']['cc'],'subject':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x52')],'attach':_0x58493d['attach']?_0x58493d['attach']:_0x4aedd1['body'][_0xb67d('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xb67d('0x54')](_0xb67d('0x55')),'lastMsgAt':moment()[_0xb67d('0x54')](_0xb67d('0x55')),'lastMsgDirection':'in'});}else{return _0x58493d;}}})[_0xb67d('0x23')](function(_0x5117c7){_0x30e1d0['interaction']=_0x5117c7[_0xb67d('0x5c')]({'plain':!![]});_0x30e1d0[_0xb67d('0x5d')]['created']=_0x38de8c;return db[_0xb67d('0x57')][_0xb67d('0x4d')]({'body':_0x4aedd1[_0xb67d('0x2b')]['body'],'MailAccountId':_0x4aedd1[_0xb67d('0x3b')]['id'],'MailInteractionId':_0x5117c7['id'],'direction':'in','ContactId':_0x30e1d0[_0xb67d('0x4f')]['id'],'messageId':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x50')],'from':_0x4aedd1[_0xb67d('0x2b')]['message']['from'],'to':_0x4aedd1['body'][_0xb67d('0x17')]['to'],'cc':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['cc'],'subject':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x52')],'attach':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x53')],'Attachments':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['attachments'],'originTo':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x5e')],'originCc':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x5f')],'bcc':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x60')],'ChatWebsiteId':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x61')]||null,'originChannel':_0x4aedd1[_0xb67d('0x2b')]['message']['originChannel']||_0xb67d('0x62'),'ChatOfflineMessageId':_0x4aedd1[_0xb67d('0x2b')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb67d('0x63')],'as':_0xb67d('0x64')}]});})[_0xb67d('0x23')](function(_0x589a74){_0x30e1d0[_0xb67d('0x17')]=_0x589a74;if(_0x30e1d0[_0xb67d('0x5d')]['UserId']){return db[_0xb67d('0x65')][_0xb67d('0x28')]({'attributes':['id',_0xb67d('0x66')],'where':{'id':_0x30e1d0['interaction'][_0xb67d('0x67')]}})[_0xb67d('0x23')](function(_0x1ce34b){if(_0x1ce34b){_0x30e1d0[_0xb67d('0x44')][_0xb67d('0x68')]({'id':0x0,'priority':0x0,'app':_0xb67d('0x69'),'appdata':_0x1ce34b['name']+','+(_0x30e1d0['account'][_0xb67d('0x6a')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb67d('0x6b'),'startRouting',_0x30e1d0);});}return respondWithRpcPromise(_0xb67d('0x6b'),_0xb67d('0x6c'),_0x30e1d0);})['then'](function(_0x34e4bf){_0xd585fc(_0x34e4bf);})[_0xb67d('0x19')](function(_0x591aa7){_0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,_0x591aa7[_0xb67d('0x17')]));});});}; \ No newline at end of file +var _0x5dc5=['body','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','account','CmList','Contacts','updatedAt','MailApplication','MailServerOut','Smtp','List','get','Applications','list','orderBy','priority','asc','autoclose','applications','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','MailMessage','contact','originTo','originCc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','User','name','unshift','agent','startRouting','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowMailAccount','where','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','CompanyId','ListId','isNil','from','from\x20is\x20mandatory'];(function(_0x5bc8c7,_0x149bf2){var _0xad70dc=function(_0xbe2aea){while(--_0xbe2aea){_0x5bc8c7['push'](_0x5bc8c7['shift']());}};_0xad70dc(++_0x149bf2);}(_0x5dc5,0x10f));var _0x55dc=function(_0x5342f5,_0x3d3f33){_0x5342f5=_0x5342f5-0x0;var _0x7565d6=_0x5dc5[_0x5342f5];return _0x7565d6;};'use strict';var _=require(_0x55dc('0x0'));var util=require(_0x55dc('0x1'));var moment=require(_0x55dc('0x2'));var BPromise=require(_0x55dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55dc('0x4'));var db=require(_0x55dc('0x5'))['db'];var utils=require(_0x55dc('0x6'));var logger=require(_0x55dc('0x7'))(_0x55dc('0x8'));var config=require(_0x55dc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x55dc('0xa')][_0x55dc('0xb')]({'port':0x232c});config[_0x55dc('0xc')]=_[_0x55dc('0xd')](config['redis'],{'host':_0x55dc('0xe'),'port':0x18eb});var socket=require(_0x55dc('0xf'))(new Redis(config[_0x55dc('0xc')]));require(_0x55dc('0x10'))[_0x55dc('0x11')](socket);function respondWithRpcPromise(_0x47c1f1,_0x296136,_0x49ff76){return new BPromise(function(_0x338591,_0x2a8085){return client['request'](_0x47c1f1,_0x49ff76)[_0x55dc('0x12')](function(_0x224aea){logger[_0x55dc('0x13')](_0x55dc('0x14'),_0x296136,_0x55dc('0x15'));logger[_0x55dc('0x16')](_0x55dc('0x17'),_0x296136,_0x55dc('0x15'),JSON['stringify'](_0x224aea));if(_0x224aea[_0x55dc('0x18')]){if(_0x224aea[_0x55dc('0x18')][_0x55dc('0x19')]===0x1f4){logger[_0x55dc('0x18')](_0x55dc('0x14'),_0x296136,_0x224aea[_0x55dc('0x18')][_0x55dc('0x1a')]);return _0x2a8085(_0x224aea[_0x55dc('0x18')]['message']);}logger[_0x55dc('0x18')](_0x55dc('0x14'),_0x296136,_0x224aea['error']['message']);return _0x338591(_0x224aea[_0x55dc('0x18')]['message']);}else{logger['info'](_0x55dc('0x14'),_0x296136,'request\x20sent');_0x338591(_0x224aea[_0x55dc('0x1b')][_0x55dc('0x1a')]);}})[_0x55dc('0x1c')](function(_0x599ae9){logger[_0x55dc('0x18')]('MailAccount,\x20%s,\x20%s',_0x296136,_0x599ae9);_0x2a8085(_0x599ae9);});});}exports[_0x55dc('0x1d')]=function(_0x38c4db){var _0x1e961d=this;return new Promise(function(_0x3d9aff,_0x869a79){return db[_0x55dc('0x1e')][_0x55dc('0x1f')]({'raw':_0x38c4db['options']?_0x38c4db[_0x55dc('0x20')][_0x55dc('0x21')]===undefined?!![]:![]:!![],'where':_0x38c4db[_0x55dc('0x20')]?_0x38c4db['options']['where']||null:null,'attributes':_0x38c4db['options']?_0x38c4db[_0x55dc('0x20')][_0x55dc('0x22')]||null:null,'limit':_0x38c4db[_0x55dc('0x20')]?_0x38c4db[_0x55dc('0x20')][_0x55dc('0x23')]||null:null,'include':_0x38c4db[_0x55dc('0x20')]?_0x38c4db[_0x55dc('0x20')][_0x55dc('0x24')]?_[_0x55dc('0x25')](_0x38c4db['options'][_0x55dc('0x24')],function(_0x34620e){return{'model':db[_0x34620e[_0x55dc('0x26')]],'as':_0x34620e['as'],'attributes':_0x34620e[_0x55dc('0x22')],'include':_0x34620e[_0x55dc('0x24')]?_[_0x55dc('0x25')](_0x34620e[_0x55dc('0x24')],function(_0x331635){return{'model':db[_0x331635[_0x55dc('0x26')]],'as':_0x331635['as'],'attributes':_0x331635[_0x55dc('0x22')],'include':_0x331635[_0x55dc('0x24')]?_[_0x55dc('0x25')](_0x331635[_0x55dc('0x24')],function(_0x103604){return{'model':db[_0x103604[_0x55dc('0x26')]],'as':_0x103604['as'],'attributes':_0x103604[_0x55dc('0x22')]};}):[]};}):[]};}):[]:[]})[_0x55dc('0x12')](function(_0x4231de){logger[_0x55dc('0x13')](_0x55dc('0x1d'),_0x38c4db);logger['debug'](_0x55dc('0x1d'),_0x38c4db,JSON[_0x55dc('0x27')](_0x4231de));_0x3d9aff(_0x4231de);})[_0x55dc('0x1c')](function(_0x11d619){logger[_0x55dc('0x18')]('GetMailAccount',_0x11d619[_0x55dc('0x1a')],_0x38c4db);_0x869a79(_0x1e961d[_0x55dc('0x18')](0x1f4,_0x11d619[_0x55dc('0x1a')]));});});};exports[_0x55dc('0x28')]=function(_0x43513d){var _0x475d48=this;return new Promise(function(_0x533ebe,_0x58ce03){return db[_0x55dc('0x1e')]['find']({'raw':_0x43513d['options']?_0x43513d[_0x55dc('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x43513d[_0x55dc('0x20')]?_0x43513d[_0x55dc('0x20')][_0x55dc('0x29')]||null:null,'attributes':_0x43513d[_0x55dc('0x20')]?_0x43513d['options']['attributes']||null:null,'include':_0x43513d['options']?_0x43513d[_0x55dc('0x20')][_0x55dc('0x24')]?_[_0x55dc('0x25')](_0x43513d[_0x55dc('0x20')][_0x55dc('0x24')],function(_0x465b0c){return{'model':db[_0x465b0c['model']],'as':_0x465b0c['as'],'attributes':_0x465b0c[_0x55dc('0x22')],'include':_0x465b0c[_0x55dc('0x24')]?_['map'](_0x465b0c[_0x55dc('0x24')],function(_0x31bcd2){return{'model':db[_0x31bcd2[_0x55dc('0x26')]],'as':_0x31bcd2['as'],'attributes':_0x31bcd2['attributes'],'include':_0x31bcd2[_0x55dc('0x24')]?_[_0x55dc('0x25')](_0x31bcd2[_0x55dc('0x24')],function(_0x9d944b){return{'model':db[_0x9d944b[_0x55dc('0x26')]],'as':_0x9d944b['as'],'attributes':_0x9d944b['attributes']};}):[]};}):[]};}):[]:[]})[_0x55dc('0x12')](function(_0x364759){logger[_0x55dc('0x13')](_0x55dc('0x28'),_0x43513d);logger[_0x55dc('0x16')](_0x55dc('0x28'),_0x43513d,JSON[_0x55dc('0x27')](_0x364759));_0x533ebe(_0x364759);})[_0x55dc('0x1c')](function(_0x21baee){logger['error'](_0x55dc('0x28'),_0x21baee[_0x55dc('0x1a')],_0x43513d);_0x58ce03(_0x475d48[_0x55dc('0x18')](0x1f4,_0x21baee['message']));});});};exports[_0x55dc('0x2a')]=function(_0x366f76){var _0x16a253=this;return new Promise(function(_0x3724ce,_0x4f16ca){var _0x34b56f={'body':_0x366f76['body'],'channel':_0x55dc('0x2b')};var _0x1b6078=_[_0x55dc('0x2c')](_[_0x55dc('0x2d')](db[_0x55dc('0x2e')][_0x55dc('0x2f')]),['createdAt','updatedAt',_0x55dc('0x30'),_0x55dc('0x31')]);var _0x286c16=![];if(_0x366f76['body']['id']){delete _0x366f76['body']['id'];}if(_[_0x55dc('0x32')](_0x366f76['body'][_0x55dc('0x33')])){return _0x4f16ca(_0x16a253[_0x55dc('0x18')](0x1f4,_0x55dc('0x34')));}if(_[_0x55dc('0x32')](_0x366f76[_0x55dc('0x35')][_0x55dc('0x35')])||_0x366f76['body'][_0x55dc('0x35')]===''){return _0x4f16ca(_0x16a253[_0x55dc('0x18')](0x1f4,_0x55dc('0x36')));}if(_[_0x55dc('0x32')](_0x366f76[_0x55dc('0x35')]['mapKey'])){return _0x4f16ca(_0x16a253[_0x55dc('0x18')](0x1f4,_0x55dc('0x37')+_0x1b6078));}if(!_[_0x55dc('0x38')](_0x1b6078,_0x366f76[_0x55dc('0x35')][_0x55dc('0x39')])){return _0x4f16ca(_0x16a253[_0x55dc('0x18')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b6078));}var _0x1fbaa9={};_0x1fbaa9[_0x366f76[_0x55dc('0x35')][_0x55dc('0x39')]]=_0x366f76[_0x55dc('0x35')]['from'];return db[_0x55dc('0x1e')][_0x55dc('0x3a')]({'where':{'id':_0x366f76[_0x55dc('0x3b')]['id']},'include':[{'model':db[_0x55dc('0x3c')],'as':'List','include':[{'model':db['CmContact'],'as':_0x55dc('0x3d'),'where':_0x1fbaa9,'limit':0x1,'order':[[_0x55dc('0x3e'),'DESC']]}]},{'model':db[_0x55dc('0x3f')],'as':'Applications'},{'model':db[_0x55dc('0x40')],'as':_0x55dc('0x41')}]})['then'](function(_0x2765c8){if(_0x2765c8&&_0x2765c8[_0x55dc('0x42')]){var _0x20798e=_0x2765c8[_0x55dc('0x43')]({'plain':!![]});_0x34b56f['account']=_['omit'](_0x20798e,['Applications',_0x55dc('0x42')]);_0x34b56f['applications']=_0x20798e[_0x55dc('0x44')];_0x34b56f[_0x55dc('0x45')]=_0x20798e[_0x55dc('0x42')];_0x34b56f['applications']=_[_0x55dc('0x46')](_0x34b56f['applications'],[_0x55dc('0x47')],[_0x55dc('0x48')]);if(_0x34b56f[_0x55dc('0x3b')]&&_0x34b56f[_0x55dc('0x3b')][_0x55dc('0x49')]){_0x34b56f[_0x55dc('0x4a')]['push']({'id':0x0,'priority':_0x34b56f[_0x55dc('0x4a')]['length']+0x1,'app':'close','appdata':'autoclose','interval':_0x55dc('0x4b')});}if(_0x34b56f[_0x55dc('0x3b')][_0x55dc('0x44')]){delete _0x34b56f[_0x55dc('0x3b')]['Applications'];}if(_0x34b56f[_0x55dc('0x3b')][_0x55dc('0x42')]){delete _0x34b56f['account'][_0x55dc('0x42')];}if(_0x20798e[_0x55dc('0x42')]['Contacts']['length']){return _0x20798e[_0x55dc('0x42')]['Contacts'][0x0];}var _0x4fa7f0=_[_0x55dc('0xd')](_0x366f76[_0x55dc('0x35')],{'firstName':_0x366f76[_0x55dc('0x35')][_0x55dc('0x33')],'ListId':_0x20798e[_0x55dc('0x31')]});_0x4fa7f0[_0x366f76[_0x55dc('0x35')][_0x55dc('0x39')]]=_0x366f76[_0x55dc('0x35')][_0x55dc('0x33')];return db[_0x55dc('0x2e')][_0x55dc('0x4c')](_0x4fa7f0);}else{throw new Error(_0x55dc('0x4d'));}})[_0x55dc('0x12')](function(_0x4302e1){_0x34b56f['contact']=_0x4302e1;if(_0x4302e1){if(!_0x366f76[_0x55dc('0x35')]['message'][_0x55dc('0x4e')]){_0x366f76['body'][_0x55dc('0x1a')][_0x55dc('0x4e')]=rs[_0x55dc('0x4f')]()+'\x20'+_0x366f76['body'][_0x55dc('0x1a')][_0x55dc('0x33')];}var _0x144b5f={'ContactId':_0x4302e1['id'],'MailAccountId':_0x366f76[_0x55dc('0x3b')]['id'],'inReplyTo':_0x366f76[_0x55dc('0x35')]['message']['messageId'],'to':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x33')],'cc':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')]['cc'],'subject':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x50')],'attach':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x51')],'lastMsgAt':moment()['format'](_0x55dc('0x52')),'lastMsgDirection':'in'};return db[_0x55dc('0x53')][_0x55dc('0x3a')]({'where':{'closed':![],'MailAccountId':_0x366f76['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x55dc('0x54'),'attributes':['messageId'],'where':{'messageId':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x55')]}}]})[_0x55dc('0x12')](function(_0x22474d){if(_0x22474d){return[_0x22474d,![]];}return db[_0x55dc('0x53')][_0x55dc('0x4c')](_0x144b5f)[_0x55dc('0x12')](function(_0x546eda){return[_0x546eda,!![]];});});}else{throw new Error(_0x55dc('0x56'));}})[_0x55dc('0x57')](function(_0x5c5652,_0x4175dd){if(_0x5c5652){_0x286c16=_0x4175dd;if(!_0x4175dd){return _0x5c5652[_0x55dc('0x58')]({'inReplyTo':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')]['messageId'],'to':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x33')],'cc':_0x366f76[_0x55dc('0x35')]['message']['cc'],'subject':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x50')],'attach':_0x5c5652[_0x55dc('0x51')]?_0x5c5652['attach']:_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x55dc('0x59')](_0x55dc('0x52')),'lastMsgAt':moment()[_0x55dc('0x59')](_0x55dc('0x52')),'lastMsgDirection':'in'});}else{return _0x5c5652;}}})[_0x55dc('0x12')](function(_0x592653){_0x34b56f[_0x55dc('0x5a')]=_0x592653[_0x55dc('0x43')]({'plain':!![]});_0x34b56f[_0x55dc('0x5a')][_0x55dc('0x5b')]=_0x286c16;return db[_0x55dc('0x5c')][_0x55dc('0x4c')]({'body':_0x366f76[_0x55dc('0x35')][_0x55dc('0x35')],'MailAccountId':_0x366f76[_0x55dc('0x3b')]['id'],'MailInteractionId':_0x592653['id'],'direction':'in','ContactId':_0x34b56f[_0x55dc('0x5d')]['id'],'messageId':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')]['messageId'],'from':_0x366f76['body'][_0x55dc('0x1a')][_0x55dc('0x33')],'to':_0x366f76['body'][_0x55dc('0x1a')]['to'],'cc':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')]['cc'],'subject':_0x366f76[_0x55dc('0x35')]['message'][_0x55dc('0x50')],'attach':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x51')],'Attachments':_0x366f76[_0x55dc('0x35')]['message']['attachments'],'originTo':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x5e')],'originCc':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x5f')],'bcc':_0x366f76['body'][_0x55dc('0x1a')]['bcc'],'ChatWebsiteId':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x60')]||null,'originChannel':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')][_0x55dc('0x61')]||_0x55dc('0x62'),'ChatOfflineMessageId':_0x366f76[_0x55dc('0x35')][_0x55dc('0x1a')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x55dc('0x63')],'as':_0x55dc('0x64')}]});})[_0x55dc('0x12')](function(_0x2f15bb){_0x34b56f[_0x55dc('0x1a')]=_0x2f15bb;if(_0x34b56f[_0x55dc('0x5a')][_0x55dc('0x65')]){return db[_0x55dc('0x66')]['find']({'attributes':['id',_0x55dc('0x67')],'where':{'id':_0x34b56f[_0x55dc('0x5a')]['UserId']}})[_0x55dc('0x12')](function(_0x29d781){if(_0x29d781){_0x34b56f['applications'][_0x55dc('0x68')]({'id':0x0,'priority':0x0,'app':_0x55dc('0x69'),'appdata':_0x29d781['name']+','+(_0x34b56f[_0x55dc('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0x55dc('0x4b')});}return respondWithRpcPromise('Start',_0x55dc('0x6a'),_0x34b56f);});}return respondWithRpcPromise(_0x55dc('0x6b'),_0x55dc('0x6a'),_0x34b56f);})[_0x55dc('0x12')](function(_0x4d5200){_0x3724ce(_0x4d5200);})['catch'](function(_0x1f9a83){_0x4f16ca(_0x16a253[_0x55dc('0x18')](0x1f4,_0x1f9a83[_0x55dc('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 4ed62cb..9202a5c 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 _0x10ee=['update','emit','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x8f6a2c,_0x435996){var _0x42a718=function(_0x572dd2){while(--_0x572dd2){_0x8f6a2c['push'](_0x8f6a2c['shift']());}};_0x42a718(++_0x435996);}(_0x10ee,0xed));var _0xe10e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x10ee[_0x138adb];return _0x1b27f2;};'use strict';var MailAccountEvents=require(_0xe10e('0x0'));var events=[_0xe10e('0x1'),_0xe10e('0x2'),_0xe10e('0x3')];function createListener(_0x4d97a4,_0x372b84){return function(_0x1258b6){_0x372b84[_0xe10e('0x4')](_0x4d97a4,_0x1258b6);};}function removeListener(_0x9c5bde,_0x368cea){return function(){MailAccountEvents['removeListener'](_0x9c5bde,_0x368cea);};}exports[_0xe10e('0x5')]=function(_0x37487b){for(var _0x1e2f90=0x0,_0x4d7b2e=events[_0xe10e('0x6')];_0x1e2f90<_0x4d7b2e;_0x1e2f90++){var _0x682ce0=events[_0x1e2f90];var _0x33430b=createListener(_0xe10e('0x7')+_0x682ce0,_0x37487b);MailAccountEvents['on'](_0x682ce0,_0x33430b);}}; \ No newline at end of file +var _0xdc1b=['emit','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x4cb95a,_0x2d4e59){var _0x478057=function(_0x1b8166){while(--_0x1b8166){_0x4cb95a['push'](_0x4cb95a['shift']());}};_0x478057(++_0x2d4e59);}(_0xdc1b,0x1f0));var _0xbdc1=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xdc1b[_0x576266];return _0x18234f;};'use strict';var MailAccountEvents=require(_0xbdc1('0x0'));var events=[_0xbdc1('0x1'),'remove','update'];function createListener(_0x25b21d,_0x28834c){return function(_0x46cbc6){_0x28834c[_0xbdc1('0x2')](_0x25b21d,_0x46cbc6);};}function removeListener(_0x564436,_0x47c4f8){return function(){MailAccountEvents['removeListener'](_0x564436,_0x47c4f8);};}exports[_0xbdc1('0x3')]=function(_0x4e0d5d){for(var _0x41b892=0x0,_0x5e2482=events[_0xbdc1('0x4')];_0x41b892<_0x5e2482;_0x41b892++){var _0x44273f=events[_0x41b892];var _0x1d144e=createListener(_0xbdc1('0x5')+_0x44273f,_0x4e0d5d);MailAccountEvents['on'](_0x44273f,_0x1d144e);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index ea073ef..38a5805 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 _0x8906=['isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id'];(function(_0x1dc6ba,_0x403191){var _0x2a0240=function(_0xd066e4){while(--_0xd066e4){_0x1dc6ba['push'](_0x1dc6ba['shift']());}};_0x2a0240(++_0x403191);}(_0x8906,0x180));var _0x6890=function(_0x2bf2e3,_0x58acc4){_0x2bf2e3=_0x2bf2e3-0x0;var _0x2bf5ca=_0x8906[_0x2bf2e3];return _0x2bf5ca;};'use strict';var multer=require(_0x6890('0x0'));var util=require(_0x6890('0x1'));var path=require(_0x6890('0x2'));var timeout=require(_0x6890('0x3'));var express=require(_0x6890('0x4'));var router=express[_0x6890('0x5')]();var fs_extra=require(_0x6890('0x6'));var auth=require(_0x6890('0x7'));var interaction=require(_0x6890('0x8'));var config=require(_0x6890('0x9'));var controller=require(_0x6890('0xa'));router['get'](_0x6890('0xb'),auth[_0x6890('0xc')](),controller[_0x6890('0xd')]);router[_0x6890('0xe')](_0x6890('0xb'),auth[_0x6890('0xc')](),controller[_0x6890('0xf')]);router[_0x6890('0x10')]('/:id',auth[_0x6890('0xc')](),controller[_0x6890('0x11')]);module['exports']=router; \ No newline at end of file +var _0x507b=['/:id','isAuthenticated','show','put','update','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0x14405c,_0x12b9b9){var _0x5d54ba=function(_0x5eaba7){while(--_0x5eaba7){_0x14405c['push'](_0x14405c['shift']());}};_0x5d54ba(++_0x12b9b9);}(_0x507b,0x7e));var _0xb507=function(_0x4dbbd4,_0x50e909){_0x4dbbd4=_0x4dbbd4-0x0;var _0x155d0b=_0x507b[_0x4dbbd4];return _0x155d0b;};'use strict';var multer=require(_0xb507('0x0'));var util=require(_0xb507('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb507('0x2'));var router=express['Router']();var fs_extra=require(_0xb507('0x3'));var auth=require(_0xb507('0x4'));var interaction=require(_0xb507('0x5'));var config=require(_0xb507('0x6'));var controller=require(_0xb507('0x7'));router[_0xb507('0x8')](_0xb507('0x9'),auth[_0xb507('0xa')](),controller[_0xb507('0xb')]);router[_0xb507('0xc')](_0xb507('0x9'),auth[_0xb507('0xa')](),controller[_0xb507('0xd')]);router[_0xb507('0xe')]('/:id',auth[_0xb507('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index bbe479e..6c6fc2b 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 _0x84e6=['TEXT','*,*,*,*','exports','STRING','noop'];(function(_0x111bab,_0x271498){var _0x5999fa=function(_0x9512f4){while(--_0x9512f4){_0x111bab['push'](_0x111bab['shift']());}};_0x5999fa(++_0x271498);}(_0x84e6,0x160));var _0x684e=function(_0x41e113,_0x4c2f91){_0x41e113=_0x41e113-0x0;var _0x10d34a=_0x84e6[_0x41e113];return _0x10d34a;};'use strict';var Sequelize=require('sequelize');module[_0x684e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x684e('0x1')],'allowNull':![],'defaultValue':_0x684e('0x2')},'appdata':{'type':Sequelize[_0x684e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x684e('0x1')],'defaultValue':_0x684e('0x4')}}; \ No newline at end of file +var _0x561c=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x20fec4,_0x6047b8){var _0x16d6f5=function(_0x72754f){while(--_0x72754f){_0x20fec4['push'](_0x20fec4['shift']());}};_0x16d6f5(++_0x6047b8);}(_0x561c,0x68));var _0xc561=function(_0x113bcb,_0x21fea5){_0x113bcb=_0x113bcb-0x0;var _0x272163=_0x561c[_0x113bcb];return _0x272163;};'use strict';var Sequelize=require(_0xc561('0x0'));module[_0xc561('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc561('0x2')],'allowNull':![],'defaultValue':_0xc561('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc561('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc561('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index afa39bf..39eeeb7 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 _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(_0x1e697e,_0x55d484){var _0x158d2e=function(_0x89b971){while(--_0x89b971){_0x1e697e['push'](_0x1e697e['shift']());}};_0x158d2e(++_0x55d484);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 +var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x544700,_0x37f134){_0x544700=_0x544700-0x0;var _0x39260b=_0xbdb7[_0x544700];return _0x39260b;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 97ed867..b4d572b 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 _0x0e7a=['path','rimraf','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x364ee4,_0x4ff7f1){var _0x3ea730=function(_0x2f9ff6){while(--_0x2f9ff6){_0x364ee4['push'](_0x364ee4['shift']());}};_0x3ea730(++_0x4ff7f1);}(_0x0e7a,0xf7));var _0xa0e7=function(_0x3df12f,_0xe54256){_0x3df12f=_0x3df12f-0x0;var _0x49a2db=_0x0e7a[_0x3df12f];return _0x49a2db;};'use strict';var _=require(_0xa0e7('0x0'));var util=require(_0xa0e7('0x1'));var logger=require(_0xa0e7('0x2'))(_0xa0e7('0x3'));var moment=require(_0xa0e7('0x4'));var BPromise=require(_0xa0e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0e7('0x6'));var rimraf=require(_0xa0e7('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xa0e7('0x8')]=function(_0x5558ab,_0x4183c8){return _0x5558ab[_0xa0e7('0x9')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa0e7('0xa')});}; \ No newline at end of file +var _0xf45c=['api','moment','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf45c,0x1ee));var _0xcf45=function(_0x1daae4,_0x5d6c91){_0x1daae4=_0x1daae4-0x0;var _0x130d62=_0xf45c[_0x1daae4];return _0x130d62;};'use strict';var _=require(_0xcf45('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf45('0x1'));var moment=require(_0xcf45('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf45('0x3'));var rimraf=require(_0xcf45('0x4'));var config=require(_0xcf45('0x5'));var attributes=require(_0xcf45('0x6'));module[_0xcf45('0x7')]=function(_0x9a6c35,_0x29bafe){return _0x9a6c35[_0xcf45('0x8')](_0xcf45('0x9'),attributes,{'tableName':_0xcf45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index b0ddb27..e2e529d 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 _0x9f75=['error','MailApplication,\x20%s,\x20%s','message','result','UpdateMailApplication','MailApplication','options','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x9f75,0x65));var _0x59f7=function(_0x4c7a90,_0x2c3aa4){_0x4c7a90=_0x4c7a90-0x0;var _0x3a32ae=_0x9f75[_0x4c7a90];return _0x3a32ae;};'use strict';var _=require(_0x59f7('0x0'));var util=require(_0x59f7('0x1'));var moment=require('moment');var BPromise=require(_0x59f7('0x2'));var rs=require(_0x59f7('0x3'));var fs=require('fs');var Redis=require(_0x59f7('0x4'));var db=require(_0x59f7('0x5'))['db'];var utils=require(_0x59f7('0x6'));var logger=require(_0x59f7('0x7'))('rpc');var config=require(_0x59f7('0x8'));var jayson=require(_0x59f7('0x9'));var client=jayson[_0x59f7('0xa')][_0x59f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe45e85,_0x344d45,_0x219d84){return new BPromise(function(_0xe773be,_0x159487){return client[_0x59f7('0xc')](_0xe45e85,_0x219d84)[_0x59f7('0xd')](function(_0x3f6692){logger[_0x59f7('0xe')]('MailApplication,\x20%s,\x20%s',_0x344d45,'request\x20sent');logger[_0x59f7('0xf')](_0x59f7('0x10'),_0x344d45,_0x59f7('0x11'),JSON[_0x59f7('0x12')](_0x3f6692));if(_0x3f6692[_0x59f7('0x13')]){if(_0x3f6692[_0x59f7('0x13')]['code']===0x1f4){logger['error'](_0x59f7('0x14'),_0x344d45,_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);return _0x159487(_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);}logger[_0x59f7('0x13')](_0x59f7('0x14'),_0x344d45,_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);return _0xe773be(_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);}else{logger[_0x59f7('0xe')](_0x59f7('0x14'),_0x344d45,_0x59f7('0x11'));_0xe773be(_0x3f6692[_0x59f7('0x16')]['message']);}})['catch'](function(_0x20c5ea){logger['error'](_0x59f7('0x14'),_0x344d45,_0x20c5ea);_0x159487(_0x20c5ea);});});}exports[_0x59f7('0x17')]=function(_0x589d82){var _0x59460b=this;return new Promise(function(_0x418794,_0x29581a){return db[_0x59f7('0x18')]['update'](_0x589d82['body'],{'raw':_0x589d82[_0x59f7('0x19')]?_0x589d82['options'][_0x59f7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x589d82[_0x59f7('0x19')]?_0x589d82[_0x59f7('0x19')][_0x59f7('0x1b')]||null:null,'attributes':_0x589d82[_0x59f7('0x19')]?_0x589d82[_0x59f7('0x19')][_0x59f7('0x1c')]||null:null,'limit':_0x589d82[_0x59f7('0x19')]?_0x589d82[_0x59f7('0x19')][_0x59f7('0x1d')]||null:null})[_0x59f7('0xd')](function(_0x326624){logger[_0x59f7('0xe')]('UpdateMailApplication',_0x589d82);logger[_0x59f7('0xf')](_0x59f7('0x17'),_0x589d82,JSON[_0x59f7('0x12')](_0x326624));_0x418794(_0x326624);})['catch'](function(_0x192a11){logger[_0x59f7('0x13')](_0x59f7('0x17'),_0x192a11['message'],_0x589d82);_0x29581a(_0x59460b['error'](0x1f4,_0x192a11[_0x59f7('0x15')]));});});}; \ No newline at end of file +var _0x048c=['request','then','info','request\x20sent','debug','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','body','options','attributes','limit','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x49e867,_0x21e11a){var _0x4b86e5=function(_0x2b330c){while(--_0x2b330c){_0x49e867['push'](_0x49e867['shift']());}};_0x4b86e5(++_0x21e11a);}(_0x048c,0x1e6));var _0xc048=function(_0x324b72,_0x5ebb37){_0x324b72=_0x324b72-0x0;var _0x5c992f=_0x048c[_0x324b72];return _0x5c992f;};'use strict';var _=require('lodash');var util=require(_0xc048('0x0'));var moment=require(_0xc048('0x1'));var BPromise=require('bluebird');var rs=require(_0xc048('0x2'));var fs=require('fs');var Redis=require(_0xc048('0x3'));var db=require(_0xc048('0x4'))['db'];var utils=require(_0xc048('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc048('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc048('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe94f6b,_0x40e607,_0x21beae){return new BPromise(function(_0x502542,_0x2bba13){return client[_0xc048('0x8')](_0xe94f6b,_0x21beae)[_0xc048('0x9')](function(_0x2bf5c9){logger[_0xc048('0xa')]('MailApplication,\x20%s,\x20%s',_0x40e607,_0xc048('0xb'));logger[_0xc048('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x40e607,'request\x20sent',JSON['stringify'](_0x2bf5c9));if(_0x2bf5c9[_0xc048('0xd')]){if(_0x2bf5c9[_0xc048('0xd')][_0xc048('0xe')]===0x1f4){logger[_0xc048('0xd')](_0xc048('0xf'),_0x40e607,_0x2bf5c9[_0xc048('0xd')][_0xc048('0x10')]);return _0x2bba13(_0x2bf5c9[_0xc048('0xd')]['message']);}logger[_0xc048('0xd')](_0xc048('0xf'),_0x40e607,_0x2bf5c9[_0xc048('0xd')][_0xc048('0x10')]);return _0x502542(_0x2bf5c9[_0xc048('0xd')][_0xc048('0x10')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x40e607,'request\x20sent');_0x502542(_0x2bf5c9[_0xc048('0x11')][_0xc048('0x10')]);}})[_0xc048('0x12')](function(_0x9559c5){logger['error'](_0xc048('0xf'),_0x40e607,_0x9559c5);_0x2bba13(_0x9559c5);});});}exports[_0xc048('0x13')]=function(_0x8cb5f4){var _0x474048=this;return new Promise(function(_0x1ddbd5,_0x3530db){return db['MailApplication'][_0xc048('0x14')](_0x8cb5f4[_0xc048('0x15')],{'raw':_0x8cb5f4[_0xc048('0x16')]?_0x8cb5f4[_0xc048('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8cb5f4[_0xc048('0x16')]?_0x8cb5f4[_0xc048('0x16')]['where']||null:null,'attributes':_0x8cb5f4['options']?_0x8cb5f4[_0xc048('0x16')][_0xc048('0x17')]||null:null,'limit':_0x8cb5f4[_0xc048('0x16')]?_0x8cb5f4[_0xc048('0x16')][_0xc048('0x18')]||null:null})[_0xc048('0x9')](function(_0x6a147b){logger[_0xc048('0xa')]('UpdateMailApplication',_0x8cb5f4);logger[_0xc048('0xc')]('UpdateMailApplication',_0x8cb5f4,JSON[_0xc048('0x19')](_0x6a147b));_0x1ddbd5(_0x6a147b);})[_0xc048('0x12')](function(_0x3caa7e){logger[_0xc048('0xd')]('UpdateMailApplication',_0x3caa7e[_0xc048('0x10')],_0x8cb5f4);_0x3530db(_0x474048[_0xc048('0xd')](0x1f4,_0x3caa7e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a7cb298..7c99417 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 _0xe0a9=['post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x439597,_0x23c725){var _0x3aa98f=function(_0x175cc2){while(--_0x175cc2){_0x439597['push'](_0x439597['shift']());}};_0x3aa98f(++_0x23c725);}(_0xe0a9,0x1ec));var _0x9e0a=function(_0x2ab729,_0x15247a){_0x2ab729=_0x2ab729-0x0;var _0x234d4c=_0xe0a9[_0x2ab729];return _0x234d4c;};'use strict';var multer=require(_0x9e0a('0x0'));var util=require('util');var path=require(_0x9e0a('0x1'));var timeout=require(_0x9e0a('0x2'));var express=require('express');var router=express[_0x9e0a('0x3')]();var fs_extra=require(_0x9e0a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e0a('0x5'));var config=require(_0x9e0a('0x6'));var controller=require(_0x9e0a('0x7'));router[_0x9e0a('0x8')]('/',auth[_0x9e0a('0x9')](),controller[_0x9e0a('0xa')]);router[_0x9e0a('0x8')](_0x9e0a('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9e0a('0xc'),auth['isAuthenticated'](),controller[_0x9e0a('0xd')]);router['get'](_0x9e0a('0xe'),auth[_0x9e0a('0x9')](),controller[_0x9e0a('0xf')]);router[_0x9e0a('0x8')](_0x9e0a('0x10'),auth[_0x9e0a('0x9')](),controller[_0x9e0a('0x11')]);router[_0x9e0a('0x12')]('/',auth[_0x9e0a('0x9')](),controller[_0x9e0a('0x13')]);router[_0x9e0a('0x12')](_0x9e0a('0xe'),auth[_0x9e0a('0x9')](),controller['addMessage']);router[_0x9e0a('0x12')](_0x9e0a('0x14'),auth[_0x9e0a('0x9')](),interaction[_0x9e0a('0x15')](_0x9e0a('0x16'),_0x9e0a('0x17')),controller[_0x9e0a('0x18')]);router[_0x9e0a('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x9e0a('0x15')](_0x9e0a('0x16'),'mailinteraction:update'),controller['update']);router['delete'](_0x9e0a('0xc'),auth[_0x9e0a('0x9')](),interaction[_0x9e0a('0x15')](_0x9e0a('0x16'),_0x9e0a('0x1a')),controller[_0x9e0a('0x1b')]);router[_0x9e0a('0x1c')](_0x9e0a('0x14'),auth['isAuthenticated'](),controller[_0x9e0a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xec19=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailInteraction.controller','get','index','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','tracked','addTags','mail','mailinteraction:update','update','delete','/:id/tags','removeTags','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec19,0x95));var _0x9ec1=function(_0x5611b6,_0x3422c8){_0x5611b6=_0x5611b6-0x0;var _0x1b5ca9=_0xec19[_0x5611b6];return _0x1b5ca9;};'use strict';var multer=require(_0x9ec1('0x0'));var util=require('util');var path=require(_0x9ec1('0x1'));var timeout=require(_0x9ec1('0x2'));var express=require(_0x9ec1('0x3'));var router=express[_0x9ec1('0x4')]();var fs_extra=require(_0x9ec1('0x5'));var auth=require(_0x9ec1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9ec1('0x7'));var controller=require(_0x9ec1('0x8'));router[_0x9ec1('0x9')]('/',auth['isAuthenticated'](),controller[_0x9ec1('0xa')]);router['get']('/describe',auth[_0x9ec1('0xb')](),controller['describe']);router[_0x9ec1('0x9')](_0x9ec1('0xc'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0xd')]);router[_0x9ec1('0x9')](_0x9ec1('0xe'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0xf')]);router[_0x9ec1('0x9')](_0x9ec1('0x10'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x11')]);router['post']('/',auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x12')]);router[_0x9ec1('0x13')](_0x9ec1('0xe'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x14')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x9ec1('0x15')]('mail','mailinteraction:addtags'),controller[_0x9ec1('0x16')]);router['put'](_0x9ec1('0xc'),auth[_0x9ec1('0xb')](),interaction[_0x9ec1('0x15')](_0x9ec1('0x17'),_0x9ec1('0x18')),controller[_0x9ec1('0x19')]);router[_0x9ec1('0x1a')](_0x9ec1('0xc'),auth[_0x9ec1('0xb')](),interaction[_0x9ec1('0x15')](_0x9ec1('0x17'),'mailinteraction:destroy'),controller['destroy']);router[_0x9ec1('0x1a')](_0x9ec1('0x1b'),auth[_0x9ec1('0xb')](),controller[_0x9ec1('0x1c')]);module[_0x9ec1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 7324f72..9df35ee 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 _0x3a0f=['long','BOOLEAN','DATE','out','ENUM','exports','STRING','TEXT'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x3d8cd3,_0x1cf912){_0x3d8cd3=_0x3d8cd3-0x0;var _0x10768c=_0x3a0f[_0x3d8cd3];return _0x10768c;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0xf3a0('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf3a0('0x1')]},'secondDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'thirdDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'note':{'type':Sequelize[_0xf3a0('0x1')]},'inReplyTo':{'type':Sequelize[_0xf3a0('0x1')](0x1fe)},'to':{'type':Sequelize[_0xf3a0('0x1')]},'cc':{'type':Sequelize[_0xf3a0('0x2')](_0xf3a0('0x3'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xf3a0('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf3a0('0x5')]},'substatus':{'type':Sequelize[_0xf3a0('0x1')](0x3c)},'substatusAt':{'type':Sequelize[_0xf3a0('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf3a0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf3a0('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xf3a0('0x7')]('in',_0xf3a0('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf3a0('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x43f7=['exports','STRING','TEXT','long','DATE','ENUM','out','sequelize','iconv'];(function(_0x5b3b38,_0x373f0d){var _0x48e796=function(_0x5811db){while(--_0x5811db){_0x5b3b38['push'](_0x5b3b38['shift']());}};_0x48e796(++_0x373f0d);}(_0x43f7,0x8e));var _0x743f=function(_0x1d6d9b,_0x5d50db){_0x1d6d9b=_0x1d6d9b-0x0;var _0x55baa5=_0x43f7[_0x1d6d9b];return _0x55baa5;};'use strict';var Sequelize=require(_0x743f('0x0'));var iconv=require(_0x743f('0x1'));module[_0x743f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x743f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x743f('0x3')]},'note':{'type':Sequelize[_0x743f('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x743f('0x4')](_0x743f('0x5'))},'subject':{'type':Sequelize[_0x743f('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x743f('0x6')]},'substatus':{'type':Sequelize[_0x743f('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x743f('0x7')]('in',_0x743f('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x743f('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x743f('0x7')]('in',_0x743f('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index edeae56..36cee8c 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 _0x8f1b=['intersection','model','fields','attributes','query','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','unreadMessages','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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.closedAt','i.attach','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','rows','show','params','includeAll','include','options','create','body','describe','addMessage','omit','ids','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','addTags','setTags','spread','mailInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','createdAt','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','log','err','unlinkSync','rimraf','moment','mustache','util','path','sox','ejs','fs-extra','jsforce','querystring','papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Users','map','TagIds','split','forEach','Tags','push','MailMessage','findOne','out','plainBody','lastMsgText','catch','MailInteraction','rawAttributes','fieldName','type','key','keys','filters'];(function(_0x170e17,_0x8c5d96){var _0x2e5602=function(_0x22b0a9){while(--_0x22b0a9){_0x170e17['push'](_0x170e17['shift']());}};_0x2e5602(++_0x8c5d96);}(_0x8f1b,0xaf));var _0xb8f1=function(_0x2a85d3,_0x109b3b){_0x2a85d3=_0x2a85d3-0x0;var _0x2d9ed8=_0x8f1b[_0x2a85d3];return _0x2d9ed8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb8f1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb8f1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xb8f1('0x2'));var util=require(_0xb8f1('0x3'));var path=require(_0xb8f1('0x4'));var sox=require(_0xb8f1('0x5'));var csv=require('to-csv');var ejs=require(_0xb8f1('0x6'));var fs=require('fs');var fs_extra=require(_0xb8f1('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb8f1('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb8f1('0x9'));var Papa=require(_0xb8f1('0xa'));var htmlToText=require(_0xb8f1('0xb'));var juice=require(_0xb8f1('0xc'));var Redis=require('ioredis');var authService=require(_0xb8f1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb8f1('0xe'));var hardwareService=require(_0xb8f1('0xf'));var logger=require(_0xb8f1('0x10'))(_0xb8f1('0x11'));var utils=require(_0xb8f1('0x12'));var config=require(_0xb8f1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb8f1('0x14')]=_[_0xb8f1('0x15')](config[_0xb8f1('0x14')],{'host':_0xb8f1('0x16'),'port':0x18eb});var socket=require(_0xb8f1('0x17'))(new Redis(config[_0xb8f1('0x14')]));require(_0xb8f1('0x18'))[_0xb8f1('0x19')](socket);function respondWithStatusCode(_0x59c2c3,_0x50f1ef){_0x50f1ef=_0x50f1ef||0xcc;return function(_0x1d9a7b){if(_0x1d9a7b){return _0x59c2c3[_0xb8f1('0x1a')](_0x50f1ef);}return _0x59c2c3['status'](_0x50f1ef)[_0xb8f1('0x1b')]();};}function respondWithResult(_0x173764,_0x5d4081){_0x5d4081=_0x5d4081||0xc8;return function(_0x358555){if(_0x358555){return _0x173764[_0xb8f1('0x1c')](_0x5d4081)[_0xb8f1('0x1d')](_0x358555);}};}function respondWithFilteredResult(_0x3322bc,_0x51f396){return function(_0x559286){if(_0x559286){var _0x5a85e1=typeof _0x51f396['offset']===_0xb8f1('0x1e')&&typeof _0x51f396[_0xb8f1('0x1f')]===_0xb8f1('0x1e');var _0x1d5274=_0x559286[_0xb8f1('0x20')];var _0x56d60d=_0x5a85e1?0x0:_0x51f396[_0xb8f1('0x21')];var _0x1926bf=_0x5a85e1?_0x559286[_0xb8f1('0x20')]:_0x51f396['offset']+_0x51f396[_0xb8f1('0x1f')];var _0x46f250;if(_0x1926bf>=_0x1d5274){_0x1926bf=_0x1d5274;_0x46f250=0xc8;}else{_0x46f250=0xce;}_0x3322bc['status'](_0x46f250);return _0x3322bc[_0xb8f1('0x22')](_0xb8f1('0x23'),_0x56d60d+'-'+_0x1926bf+'/'+_0x1d5274)['json'](_0x559286);}return null;};}function patchUpdates(_0x4b5a41){return function(_0x57e063){try{jsonpatch[_0xb8f1('0x24')](_0x57e063,_0x4b5a41,!![]);}catch(_0x21a2fa){return BPromise[_0xb8f1('0x25')](_0x21a2fa);}return _0x57e063[_0xb8f1('0x26')]();};}function saveUpdates(_0xa2e3ca,_0x452576){return function(_0x103bea){if(_0x103bea){return _0x103bea[_0xb8f1('0x27')](_0xa2e3ca)[_0xb8f1('0x28')](function(_0x329d7a){return _0x329d7a;});}return null;};}function removeEntity(_0x14e0e1,_0x4fd3c7){return function(_0x36219b){if(_0x36219b){return _0x36219b[_0xb8f1('0x29')]()['then'](function(){_0x14e0e1[_0xb8f1('0x1c')](0xcc)[_0xb8f1('0x1b')]();});}};}function handleEntityNotFound(_0x335395,_0x3d679b){return function(_0x642126){if(!_0x642126){_0x335395[_0xb8f1('0x1a')](0x194);}return _0x642126;};}function handleError(_0x204d9c,_0x45131a){_0x45131a=_0x45131a||0x1f4;return function(_0x1634b6){logger[_0xb8f1('0x2a')](_0x1634b6[_0xb8f1('0x2b')]);if(_0x1634b6[_0xb8f1('0x2c')]){delete _0x1634b6[_0xb8f1('0x2c')];}_0x204d9c[_0xb8f1('0x1c')](_0x45131a)['send'](_0x1634b6);};}function getInteractionUsers(_0x454c74,_0x798dfc){return new BPromise(function(_0x862af1,_0x5d6663){try{if(_0x798dfc[_0x454c74['id']]){_0x454c74[_0xb8f1('0x2d')]=_[_0xb8f1('0x2e')](_0x798dfc[_0x454c74['id']],function(_0x554327){return{'id':_0x554327['id'],'fullname':_0x554327['fullname']};});}}catch(_0x42b195){_0x5d6663(_0x42b195);}_0x862af1(_0x454c74);});}function getInteractionTags(_0x23a23d,_0x3522a0){return new BPromise(function(_0x1e05ab,_0x12401a){try{if(_0x23a23d[_0xb8f1('0x2f')]){_0x23a23d['Tags']=[];_0x23a23d['TagIds'][_0xb8f1('0x30')](',')[_0xb8f1('0x31')](function(_0x53076a){_0x23a23d[_0xb8f1('0x32')][_0xb8f1('0x33')](_0x3522a0[_0x53076a]);});}delete _0x23a23d['TagIds'];}catch(_0x56a1f2){_0x12401a(_0x56a1f2);}_0x1e05ab(_0x23a23d);});}function getLastMessageText(_0x31fdbb){return new BPromise(function(_0x41ab75,_0x3efc66){return db[_0xb8f1('0x34')][_0xb8f1('0x35')]({'where':{'$and':[{'MailInteractionId':_0x31fdbb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb8f1('0x36')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xb8f1('0x28')](function(_0x52fe8f){if(_0x52fe8f&&_0x52fe8f[_0xb8f1('0x37')]){_0x31fdbb[_0xb8f1('0x38')]=_['trimStart'](_0x52fe8f[_0xb8f1('0x37')]);}_0x41ab75(_0x31fdbb);})[_0xb8f1('0x39')](function(_0x1da9d2){_0x3efc66(_0x1da9d2);});});}function updateMailInteraction(_0x139414,_0xbc63ed,_0xb72b47,_0x58dc4e){return new BPromise(function(_0x2c7f07,_0x86ec71){return getInteractionUsers(_0x139414,_0xb72b47)[_0xb8f1('0x28')](function(_0x1e618d){return getInteractionTags(_0x1e618d,_0xbc63ed);})['then'](function(_0x220eeb){if(_0x58dc4e){_0x2c7f07(getLastMessageText(_0x220eeb));}else{_0x2c7f07(_0x220eeb);}})['catch'](function(_0x2a05c3){_0x86ec71(_0x2a05c3);});});}exports['index']=function(_0x25b3a8,_0x23b575){var _0xdee854={},_0x3f697c={},_0x1ebf07={'count':0x0,'rows':[]};var _0x2914e8=_[_0xb8f1('0x2e')](db[_0xb8f1('0x3a')][_0xb8f1('0x3b')],function(_0x4f513d){return{'name':_0x4f513d[_0xb8f1('0x3c')],'type':_0x4f513d[_0xb8f1('0x3d')][_0xb8f1('0x3e')]};});_0x3f697c['model']=_[_0xb8f1('0x2e')](_0x2914e8,'name');_0x3f697c['query']=_[_0xb8f1('0x3f')](_0x25b3a8['query']);_0x3f697c[_0xb8f1('0x40')]=_[_0xb8f1('0x41')](_0x3f697c[_0xb8f1('0x42')],_0x3f697c['query']);_0xdee854['attributes']=_['intersection'](_0x3f697c[_0xb8f1('0x42')],qs[_0xb8f1('0x43')](_0x25b3a8['query'][_0xb8f1('0x43')]));_0xdee854['attributes']=_0xdee854[_0xb8f1('0x44')]['length']?_0xdee854[_0xb8f1('0x44')]:_0x3f697c['model'];if(!_0x25b3a8[_0xb8f1('0x45')]['hasOwnProperty'](_0xb8f1('0x46'))){_0xdee854[_0xb8f1('0x1f')]=qs['limit'](_0x25b3a8[_0xb8f1('0x45')]['limit']);_0xdee854[_0xb8f1('0x21')]=qs[_0xb8f1('0x21')](_0x25b3a8['query'][_0xb8f1('0x21')]);}_0xdee854[_0xb8f1('0x47')]=qs[_0xb8f1('0x48')](_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x48')]);_0xdee854[_0xb8f1('0x49')]=qs[_0xb8f1('0x40')](_['pick'](_0x25b3a8[_0xb8f1('0x45')],_0x3f697c[_0xb8f1('0x40')]),_0x2914e8);var _0x21cad9=[];var _0x4cc3c0=squel[_0xb8f1('0x4a')]()[_0xb8f1('0x4b')]('id')[_0xb8f1('0x4b')](_0xb8f1('0x2c'))[_0xb8f1('0x4b')](_0xb8f1('0x4c'))[_0xb8f1('0x4d')](_0xb8f1('0x4e'));var _0x51fb08=squel[_0xb8f1('0x4a')]()['field'](_0xb8f1('0x4f'))[_0xb8f1('0x4b')](_0xb8f1('0x50'))[_0xb8f1('0x4b')]('ui.MailInteractionId')[_0xb8f1('0x4d')](_0xb8f1('0x51'),'ui')[_0xb8f1('0x52')](_0xb8f1('0x53'),'u',_0xb8f1('0x54'));var _0x4fe890=squel['select']()[_0xb8f1('0x4d')](_0xb8f1('0x55'),'i')[_0xb8f1('0x52')](_0xb8f1('0x56'),'c',_0xb8f1('0x57'))[_0xb8f1('0x52')](_0xb8f1('0x53'),'o',_0xb8f1('0x58'))[_0xb8f1('0x52')](_0xb8f1('0x59'),'a',_0xb8f1('0x5a'))[_0xb8f1('0x52')]('mail_messages','me',_0xb8f1('0x5b'))[_0xb8f1('0x52')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0xb8f1('0x4e'),'t',_0xb8f1('0x5c'));var _0x4ed6fc=squel[_0xb8f1('0x5d')]();var _0x36e0fc=[];var _0x5b4e50=squel[_0xb8f1('0x5d')]();var _0x4acd9d;if(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x5e')]){_0x4acd9d=as[_0xb8f1('0x5f')](_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x5e')]);var _0x47454c=_0x4acd9d[_0xb8f1('0x60')];for(var _0x40270f=0x0;_0x40270f<_0x4acd9d[_0xb8f1('0x61')][_0xb8f1('0x62')];_0x40270f++){var _0xba046d=_0x4acd9d[_0xb8f1('0x61')][_0x40270f];var _0x4e006e='i';var _0x1e9da6=_[_0xb8f1('0x63')](_0x2914e8,[_0xb8f1('0x2c'),_0xba046d[_0xb8f1('0x4b')]]);if(!_0x1e9da6){switch(_0xba046d[_0xb8f1('0x4b')]){case'unreadMessages':if(_0xba046d[_0xb8f1('0x64')]==0x1){_0x4fe890[_0xb8f1('0x65')]('`'+_0xba046d[_0xb8f1('0x4b')]+_0xb8f1('0x66'));}else{_0x4fe890[_0xb8f1('0x65')]('`'+_0xba046d[_0xb8f1('0x4b')]+_0xb8f1('0x67'));}break;case _0xb8f1('0x68'):if(_0xba046d[_0xb8f1('0x69')]===_0xb8f1('0x6a')){if(_0xba046d[_0xb8f1('0x64')][_0xb8f1('0x30')]('\x20')['length']>0x1){_0x4ed6fc[_0x47454c](_0xb8f1('0x6b'),qs[_0xb8f1('0x6c')](_0xba046d['value']),null);}else{var _0x2a5274='%'+_0xba046d[_0xb8f1('0x64')]+'%';_0x4ed6fc[_0x47454c](_0xb8f1('0x6d'),_0x2a5274,_0x2a5274,_0x2a5274);}}else{_0x1e9da6=_['find'](_0x2914e8,[_0xb8f1('0x2c'),_0xb8f1('0x6e')]);_0xba046d['field']=_0xb8f1('0x6e');_0x335810=as[_0xb8f1('0x6f')](_0x4e006e,_0x1e9da6[_0xb8f1('0x3d')],_0xba046d);_0x4ed6fc[_0x47454c](_0x335810[_0xb8f1('0x70')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')]['end']);}break;case _0xb8f1('0x72'):var _0x4719c7=_0xba046d[_0xb8f1('0x64')][_0xb8f1('0x30')](',')[_0xb8f1('0x2e')](function(_0xbc833f){return Number(_0xbc833f);});_0x4719c7['forEach'](function(_0x47f672){_0x5b4e50['or'](_0xb8f1('0x73'),'%,'+_0x47f672+',%');});_0x36e0fc=_['union'](_0x36e0fc,_0x4719c7);break;case _0xb8f1('0x74'):if(_0xba046d['operator']===_0xb8f1('0x6a')){_0x4ed6fc[_0x47454c](_0xb8f1('0x75'),'%'+_0xba046d['value']+'%',null);}else{_0x1e9da6=_[_0xb8f1('0x63')](_0x2914e8,['name','UserId']);_0xba046d[_0xb8f1('0x4b')]=_0xb8f1('0x76');_0x335810=as[_0xb8f1('0x6f')](_0x4e006e,_0x1e9da6[_0xb8f1('0x3d')],_0xba046d);_0x4ed6fc[_0x47454c](_0x335810['text'],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x1b')]);}break;case _0xb8f1('0x37'):_0x335810=as[_0xb8f1('0x6f')]('me',null,_0xba046d);_0x4ed6fc[_0x47454c](_0x335810[_0xb8f1('0x70')],_0x335810['value'][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x1b')]);break;}}else{var _0x335810=as['buildExpression'](_0x4e006e,_0x1e9da6['type'],_0xba046d);_0x4ed6fc[_0x47454c](_0x335810[_0xb8f1('0x70')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x1b')]);}}}else{var _0x4389b4=_(_0x25b3a8[_0xb8f1('0x45')])[_0xb8f1('0x3f')]()[_0xb8f1('0x2e')](function(_0x2a7625){return _[_0xb8f1('0x77')](_0x2914e8,[_0xb8f1('0x2c'),_0x2a7625])?_0x2a7625:undefined;})[_0xb8f1('0x78')]()[_0xb8f1('0x64')]();if(!_['isEmpty'](_0x4389b4)){_0x4389b4['forEach'](function(_0x1624b5){if(_0x1624b5===_0xb8f1('0x79')){_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x7a'),[]['concat'](_0x25b3a8['query'][_0x1624b5]));}else if(_0x1624b5==='createdAt'){var _0x458326=JSON[_0xb8f1('0x7b')](_0x25b3a8['query'][_0x1624b5])[_0xb8f1('0x7c')];var _0x5365f1=JSON[_0xb8f1('0x7b')](_0x25b3a8[_0xb8f1('0x45')][_0x1624b5])[_0xb8f1('0x7d')];_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x7e'),_0x458326,_0x5365f1);}else{if(_0x25b3a8[_0xb8f1('0x45')][_0x1624b5]===_0xb8f1('0x7f')){_0x4fe890[_0xb8f1('0x49')]('i.'+_0x1624b5+'\x20IS\x20NULL');}else{_0x4fe890['where']('i.'+_0x1624b5+'\x20=\x20?',_0x25b3a8['query'][_0x1624b5]);}}});}if(_0x25b3a8[_0xb8f1('0x45')]['read']){if(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x80')]==0x1){_0x4fe890['having'](_0xb8f1('0x81'));}else{_0x4fe890['having']('`unreadMessages`\x20>\x200');}}if(_0x25b3a8['query'][_0xb8f1('0x82')]){_0x36e0fc=_[_0xb8f1('0x83')](_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x82')])?_0x25b3a8[_0xb8f1('0x45')]['tag']:new Array(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x82')]);_0x36e0fc[_0xb8f1('0x31')](function(_0x331530){_0x5b4e50['or'](_0xb8f1('0x73'),'%,'+_0x331530+',%');});}if(_0x25b3a8[_0xb8f1('0x45')]['filter']){var _0x25ab93=_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x84')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xb8f1('0x85')](_0x25ab93)){_0x4ed6fc['or'](_0xb8f1('0x86'),_0x25ab93+'%');}else if(qs['isEmail'](_0x25ab93)){_0x4ed6fc['or'](_0xb8f1('0x87'),_0x25ab93+'%');}else{_0x4ed6fc['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb8f1('0x6c')](_0x25ab93))['or'](_0xb8f1('0x88'),qs['getFullTextValue'](_0x25ab93));}}}_0x4fe890['where'](_0x4ed6fc);_0x4fe890[_0xb8f1('0x89')](_0xb8f1('0x8a'));var _0xd984a2={'type':db[_0xb8f1('0x8b')]['QueryTypes'][_0xb8f1('0x8c')],'raw':!![]};var _0x3bad18=_0x4fe890[_0xb8f1('0x8d')]();_0x3bad18['field'](_0xb8f1('0x8a'));_0x3bad18[_0xb8f1('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb8f1('0x8e'));if(_0xdee854['order']){_0xdee854[_0xb8f1('0x47')][_0xb8f1('0x31')](function(_0x45f499){var _0x488603=_0x45f499[0x0]===_0xb8f1('0x8f')?_0x45f499[0x0]:'i.'+_0x45f499[0x0];_0x4fe890[_0xb8f1('0x47')](_0x488603,_0x45f499[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb8f1('0x90')](_0x36e0fc)){_0x4fe890[_0xb8f1('0x65')](_0x5b4e50);_0x3bad18['where'](_0xb8f1('0x91'),_0x36e0fc);}BPromise[_0xb8f1('0x92')]()[_0xb8f1('0x28')](function(){if(!_0x4acd9d){if(_0x25b3a8[_0xb8f1('0x45')]['MailAccountId'])return;_0x3bad18[_0xb8f1('0x49')](_0xb8f1('0x93'));_0x4fe890['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x25b3a8[_0xb8f1('0x94')][_0xb8f1('0x95')]!==_0xb8f1('0x96'))return;return _0x25b3a8[_0xb8f1('0x94')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xb8f1('0x28')](function(_0x229d3d){if(_[_0xb8f1('0x90')](_0x229d3d)){_0x3bad18[_0xb8f1('0x49')]('i.MailAccountId\x20IS\x20NULL');_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x97'));}else{_0x3bad18['where'](_0xb8f1('0x7a'),_[_0xb8f1('0x2e')](_0x229d3d,'id'));_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x7a'),_['map'](_0x229d3d,'id'));}});})['then'](function(){if(_0x25b3a8[_0xb8f1('0x94')][_0xb8f1('0x95')]===_0xb8f1('0x96')&&!_0x4acd9d&&!_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x79')])return[];return db[_0xb8f1('0x98')][_0xb8f1('0x45')](_0x3bad18['toString'](),_0xd984a2);})[_0xb8f1('0x28')](function(_0x5ba4ad){_0x1ebf07[_0xb8f1('0x20')]=_0x5ba4ad[_0xb8f1('0x62')];if(_0x1ebf07[_0xb8f1('0x20')]===0x0)return[];return db['sequelize'][_0xb8f1('0x45')](_0x4cc3c0[_0xb8f1('0x99')](),_0xd984a2)[_0xb8f1('0x28')](function(_0x1b308f){_0x21cad9=_[_0xb8f1('0x9a')](_0x1b308f,'id');_0xd984a2=_[_0xb8f1('0x9b')](_0xd984a2,{'model':db[_0xb8f1('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x43')]){_0xdee854['attributes'][_0xb8f1('0x31')](function(_0x15c8a0){_0x4fe890[_0xb8f1('0x4b')]('i.'+_0x15c8a0);});}else{_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0x9c'),_0xb8f1('0x8e'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0x9d'),'Account.key');_0x4fe890['field'](_0xb8f1('0x9e'),_0xb8f1('0x9f'));_0x4fe890['field'](_0xb8f1('0xa0'),'contactName');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0x8a'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa1'));_0x4fe890[_0xb8f1('0x4b')]('i.updatedAt');_0x4fe890['field']('i.closed');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa2'));_0x4fe890['field'](_0xb8f1('0xa3'));_0x4fe890[_0xb8f1('0x4b')]('i.lastMsgAt');_0x4fe890[_0xb8f1('0x4b')]('i.lastMsgDirection');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa4'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa5'));_0x4fe890[_0xb8f1('0x4b')]('i.secondDisposition');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa6'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa7'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa8'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa9'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xaa'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xab'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xac'),_0xb8f1('0xad'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xae'),'Contact.lastName');_0x4fe890['field'](_0xb8f1('0xaf'),_0xb8f1('0xb0'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xb1'),_0xb8f1('0xb2'));_0x4fe890['field']('c.mobile',_0xb8f1('0xb3'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xb4'),_0xb8f1('0xb5'));_0x4fe890[_0xb8f1('0x4b')]('o.fullname','Owner.fullname');_0x4fe890['field'](_0xb8f1('0xb6'),_0xb8f1('0xb7'));_0x4fe890[_0xb8f1('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb8f1('0x2f'));}if(_0xdee854['limit'])_0x4fe890[_0xb8f1('0x1f')](_0xdee854[_0xb8f1('0x1f')]);if(_0xdee854[_0xb8f1('0x21')])_0x4fe890['offset'](_0xdee854[_0xb8f1('0x21')]);return db['sequelize'][_0xb8f1('0x45')](_0x4fe890[_0xb8f1('0x99')](),_0xd984a2);})[_0xb8f1('0x28')](function(_0xc26b38){if(_0xc26b38[_0xb8f1('0x62')]>0x0)_0x51fb08[_0xb8f1('0x49')](_0xb8f1('0xb8'),_[_0xb8f1('0x2e')](_0xc26b38,'id'));return db[_0xb8f1('0x98')][_0xb8f1('0x45')](_0x51fb08[_0xb8f1('0x99')](),_0xd984a2)[_0xb8f1('0x28')](function(_0x10bdbd){var _0x1c1ba6=_[_0xb8f1('0xb9')](_0x10bdbd,'MailInteractionId');var _0x131a96=[];return db[_0xb8f1('0xba')][_0xb8f1('0x35')]({'attributes':[_0xb8f1('0xbb')],'raw':!![]})['then'](function(_0x871bce){var _0x407df8=_0x871bce[_0xb8f1('0xbb')];_0xc26b38[_0xb8f1('0x31')](function(_0x3e437c){_0x131a96[_0xb8f1('0x33')](updateMailInteraction(_0x3e437c,_0x21cad9,_0x1c1ba6,_0x407df8));});return BPromise['all'](_0x131a96);});});});})[_0xb8f1('0x28')](function(_0x5297eb){_0x1ebf07[_0xb8f1('0xbc')]=_0x5297eb;return _0x1ebf07;})[_0xb8f1('0x28')](respondWithFilteredResult(_0x23b575,_0xdee854))[_0xb8f1('0x39')](handleError(_0x23b575,null));};exports[_0xb8f1('0xbd')]=function(_0x253724,_0x513a5d){var _0x3d0ab7={'raw':![],'where':{'id':_0x253724[_0xb8f1('0xbe')]['id']}},_0xc3b2ed={};_0xc3b2ed[_0xb8f1('0x42')]=_[_0xb8f1('0x3f')](db[_0xb8f1('0x3a')]['rawAttributes']);_0xc3b2ed[_0xb8f1('0x45')]=_[_0xb8f1('0x3f')](_0x253724[_0xb8f1('0x45')]);_0xc3b2ed[_0xb8f1('0x40')]=_[_0xb8f1('0x41')](_0xc3b2ed[_0xb8f1('0x42')],_0xc3b2ed['query']);_0x3d0ab7[_0xb8f1('0x44')]=_[_0xb8f1('0x41')](_0xc3b2ed[_0xb8f1('0x42')],qs[_0xb8f1('0x43')](_0x253724[_0xb8f1('0x45')]['fields']));_0x3d0ab7[_0xb8f1('0x44')]=_0x3d0ab7[_0xb8f1('0x44')][_0xb8f1('0x62')]?_0x3d0ab7[_0xb8f1('0x44')]:_0xc3b2ed[_0xb8f1('0x42')];if(_0x253724['query'][_0xb8f1('0xbf')]){_0x3d0ab7[_0xb8f1('0xc0')]=[{'all':!![]}];}_0x3d0ab7=_[_0xb8f1('0x9b')]({},_0x3d0ab7,_0x253724[_0xb8f1('0xc1')]);return db[_0xb8f1('0x3a')]['find'](_0x3d0ab7)[_0xb8f1('0x28')](handleEntityNotFound(_0x513a5d,null))[_0xb8f1('0x28')](respondWithResult(_0x513a5d,null))[_0xb8f1('0x39')](handleError(_0x513a5d,null));};exports[_0xb8f1('0xc2')]=function(_0xbe1f05,_0x59c137){return db['MailInteraction'][_0xb8f1('0xc2')](_0xbe1f05['body'],{})[_0xb8f1('0x28')](respondWithResult(_0x59c137,0xc9))[_0xb8f1('0x39')](handleError(_0x59c137,null));};exports[_0xb8f1('0x27')]=function(_0x5781b6,_0x35cb45){if(_0x5781b6[_0xb8f1('0xc3')]['id']){delete _0x5781b6[_0xb8f1('0xc3')]['id'];}return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x5781b6[_0xb8f1('0xbe')]['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x35cb45,null))[_0xb8f1('0x28')](saveUpdates(_0x5781b6['body'],null))[_0xb8f1('0x28')](respondWithResult(_0x35cb45,null))[_0xb8f1('0x39')](handleError(_0x35cb45,null));};exports[_0xb8f1('0x29')]=function(_0x5bd9cf,_0x1a00c4){return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x5bd9cf['params']['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x1a00c4,null))[_0xb8f1('0x28')](removeEntity(_0x1a00c4,null))[_0xb8f1('0x39')](handleError(_0x1a00c4,null));};exports[_0xb8f1('0xc4')]=function(_0x4d138e,_0x5bec39){return db[_0xb8f1('0x3a')]['describe']()['then'](respondWithResult(_0x5bec39,null))['catch'](handleError(_0x5bec39,null));};exports['addMessage']=function(_0x492e37,_0x36cf99,_0x6ee73){return db['MailMessage'][_0xb8f1('0x63')]({'where':{'id':_0x492e37[_0xb8f1('0xbe')]['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x36cf99,null))[_0xb8f1('0x28')](function(_0x70ffb0){if(_0x70ffb0){return _0x70ffb0[_0xb8f1('0xc5')](_0x492e37[_0xb8f1('0xc3')]['ids'],_[_0xb8f1('0xc6')](_0x492e37[_0xb8f1('0xc3')],[_0xb8f1('0xc7'),'id'])||{});}})[_0xb8f1('0x28')](respondWithResult(_0x36cf99,null))[_0xb8f1('0x39')](handleError(_0x36cf99,null));};exports['getMessages']=function(_0xc08d47,_0x3911e8,_0x193693){var _0x375c3a={'raw':![],'where':{}};var _0x3d74af={};var _0x23d567={'count':0x0,'rows':[]};return db['MailInteraction'][_0xb8f1('0x35')]({'where':{'id':_0xc08d47[_0xb8f1('0xbe')]['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x3911e8,null))['then'](function(_0x144e19){if(_0x144e19){_0x3d74af['model']=_[_0xb8f1('0x3f')](db[_0xb8f1('0x34')][_0xb8f1('0x3b')]);_0x3d74af['query']=_[_0xb8f1('0x3f')](_0xc08d47[_0xb8f1('0x45')]);_0x3d74af['filters']=_[_0xb8f1('0x41')](_0x3d74af['model'],_0x3d74af[_0xb8f1('0x45')]);_0x375c3a[_0xb8f1('0x44')]=_[_0xb8f1('0x41')](_0x3d74af[_0xb8f1('0x42')],qs['fields'](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x43')]));_0x375c3a[_0xb8f1('0x44')]=_0x375c3a[_0xb8f1('0x44')][_0xb8f1('0x62')]?_0x375c3a['attributes']:_0x3d74af['model'];if(!_0xc08d47[_0xb8f1('0x45')]['hasOwnProperty'](_0xb8f1('0x46'))){_0x375c3a['limit']=qs[_0xb8f1('0x1f')](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x1f')]);_0x375c3a[_0xb8f1('0x21')]=qs['offset'](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x21')]);}_0x375c3a['order']=qs[_0xb8f1('0x48')](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x48')]);_0x375c3a['where']=qs[_0xb8f1('0x40')](_['pick'](_0xc08d47[_0xb8f1('0x45')],_0x3d74af[_0xb8f1('0x40')]));_0x375c3a[_0xb8f1('0x49')][_0xb8f1('0xc8')]=_0x144e19['id'];if(_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x84')]){_0x375c3a[_0xb8f1('0x49')]=_[_0xb8f1('0x9b')](_0x375c3a[_0xb8f1('0x49')],{'$or':_[_0xb8f1('0x2e')](_0x375c3a[_0xb8f1('0x44')],function(_0x4fd903){var _0x4d9df1={};_0x4d9df1[_0x4fd903]={'$like':'%'+_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x84')]+'%'};return _0x4d9df1;})});}if(_0xc08d47[_0xb8f1('0x45')]['$gte']){var _0x49b45f=_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x7c')][_0xb8f1('0x30')](',');var _0x544ed9={};_0x544ed9[_0x49b45f[0x0]]={'$gte':moment(_0x49b45f[0x1])[_0xb8f1('0xc9')](_0xb8f1('0xca'))};_0x375c3a[_0xb8f1('0x49')]=_['merge'](_0x375c3a['where'],_0x544ed9);}_0x375c3a=_['merge']({},_0x375c3a,_0xc08d47[_0xb8f1('0xc1')]);return db['MailMessage']['count']({'where':_0x375c3a[_0xb8f1('0x49')]})[_0xb8f1('0x28')](function(_0x4545ee){_0x23d567['count']=_0x4545ee;if(_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0xbf')]){_0x375c3a[_0xb8f1('0xc0')]=[{'all':!![]}];}return db[_0xb8f1('0x34')][_0xb8f1('0xcb')](_0x375c3a);})[_0xb8f1('0x28')](function(_0x312495){if(_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0xcc')]==='true'){for(var _0x2c83bf=0x0;_0x2c83bf<_0x312495[_0xb8f1('0x62')];_0x2c83bf++){_0x312495[_0x2c83bf]['body']=juice(_0x312495[_0x2c83bf][_0xb8f1('0xc3')]);}}_0x23d567['rows']=_0x312495;return _0x23d567;});}})[_0xb8f1('0x28')](respondWithFilteredResult(_0x3911e8,_0x375c3a))['catch'](handleError(_0x3911e8,null));};exports[_0xb8f1('0xcd')]=function(_0x1b0615,_0x42b6a6,_0x3fd463){return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x1b0615[_0xb8f1('0xbe')]['id']}})['then'](handleEntityNotFound(_0x42b6a6,null))[_0xb8f1('0x28')](function(_0x132eaf){if(_0x132eaf){return _0x132eaf[_0xb8f1('0xce')](_0x1b0615[_0xb8f1('0xc3')][_0xb8f1('0xc7')],_['omit'](_0x1b0615[_0xb8f1('0xc3')],[_0xb8f1('0xc7'),'id'])||{})[_0xb8f1('0xcf')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xb8f1('0x4c')],'where':{'id':_0x1b0615['body'][_0xb8f1('0xc7')]}});})[_0xb8f1('0x28')](function(_0x2baa90){socket['emit'](_0xb8f1('0xd0'),{'id':Number(_0x1b0615[_0xb8f1('0xbe')]['id']),'tags':_0x2baa90||[]});return{'id':Number(_0x1b0615['params']['id']),'tags':_0x2baa90||[]};});}})[_0xb8f1('0x28')](respondWithResult(_0x42b6a6,null))[_0xb8f1('0x39')](handleError(_0x42b6a6,null));};exports[_0xb8f1('0xd1')]=function(_0x489990,_0x2cd775,_0x469d24){return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x489990[_0xb8f1('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2cd775,null))[_0xb8f1('0x28')](function(_0x3c3420){if(_0x3c3420){return _0x3c3420['removeTags'](_0x489990['query'][_0xb8f1('0xc7')]);}})['then'](respondWithStatusCode(_0x2cd775,null))[_0xb8f1('0x39')](handleError(_0x2cd775,null));};exports[_0xb8f1('0xd2')]=function(_0x300c43,_0x1c25ae){var _0x358e44=moment()[_0xb8f1('0xd3')]()[_0xb8f1('0x99')]();var _0x35b735=path[_0xb8f1('0xd4')](config['root'],_0xb8f1('0xd5'),_0xb8f1('0xd6'),_0xb8f1('0xd7'));var _0x39cb4b=path[_0xb8f1('0xd4')](config[_0xb8f1('0xd8')],_0xb8f1('0xd5'),'files',_0xb8f1('0xd9'));var _0x35e1a4=path[_0xb8f1('0xd4')](_0x35b735,_0x358e44);var _0x3320dd=util[_0xb8f1('0xc9')](_0xb8f1('0xda'),_0x300c43[_0xb8f1('0xbe')]['id'],_0x358e44);var _0x2824a3=path[_0xb8f1('0xd4')](_0x35b735,_0x3320dd);var _0x524a98=[];if(_0x300c43['query'][_0xb8f1('0xd9')]){_0x524a98[_0xb8f1('0x33')]({'model':db[_0xb8f1('0xdb')],'as':'Attachments','raw':!![]});}var _0x3dda09=[{'model':db[_0xb8f1('0x34')],'as':_0xb8f1('0xdc'),'attributes':['id',_0xb8f1('0xc3'),_0xb8f1('0x4d'),'to','cc',_0xb8f1('0xdd'),_0xb8f1('0xde'),_0xb8f1('0xdf')],'where':{'secret':![]},'order':qs[_0xb8f1('0x48')]('id'),'include':_0x524a98}];return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x300c43[_0xb8f1('0xbe')]['id']},'include':_0x3dda09})[_0xb8f1('0x28')](handleEntityNotFound(_0x1c25ae,null))[_0xb8f1('0x28')](function(_0x2b82bb){if(_0x2b82bb&&_0x2b82bb[_0xb8f1('0xdc')]){var _0x5d32b6=_0x2b82bb[_0xb8f1('0xe0')]({'plain':!![]});fs[_0xb8f1('0xe1')](_0x35e1a4);return BPromise[_0xb8f1('0xe2')](_0x5d32b6[_0xb8f1('0xdc')],function(_0x145e08,_0x215bbf){var _0xbc1f39={'from':_0x145e08[_0xb8f1('0x4d')],'to':_0x145e08['to'],'subject':_0x145e08[_0xb8f1('0xde')],'html':_0x145e08[_0xb8f1('0xc3')],'headers':{'Date':moment(_0x145e08[_0xb8f1('0xdf')])[_0xb8f1('0xc9')](_0xb8f1('0xe3'))},'attachments':[]};if(_0x145e08['cc']){_0xbc1f39['headers']['Cc']=_0x145e08['cc'];}if(_0x145e08['bcc']){_0xbc1f39[_0xb8f1('0xe4')][_0xb8f1('0xe5')]=_0x145e08['bcc'];}return new BPromise(function(_0x3be5c1,_0x4b3940){if(_0x145e08['Attachments']){for(var _0xe2327a=0x0;_0xe2327a<_0x145e08['Attachments'][_0xb8f1('0x62')];_0xe2327a++){var _0x52565c=_0x145e08[_0xb8f1('0xe6')][_0xe2327a];var _0x33ff41=path[_0xb8f1('0xd4')](_0x39cb4b,_0x52565c[_0xb8f1('0xe7')]);if(fs[_0xb8f1('0xe8')](_0x33ff41)){_0xbc1f39[_0xb8f1('0xd9')]['push']({'name':_0x52565c[_0xb8f1('0x2c')],'contentType':_0x52565c[_0xb8f1('0x3d')],'data':fs[_0xb8f1('0xe9')](_0x33ff41)});}}}emlformat[_0xb8f1('0xea')](_0xbc1f39,function(_0x455514,_0x583688){if(_0x455514)return _0x4b3940(_0x455514);fs[_0xb8f1('0xeb')](path[_0xb8f1('0xd4')](_0x35e1a4,util[_0xb8f1('0xc9')](_0xb8f1('0xec'),_0x215bbf)),_0x583688);return _0x3be5c1(_0x583688);});});})[_0xb8f1('0x28')](function(){return new BPromise(function(_0x27d04c,_0x381ebc){zipdir(_0x35e1a4,{'saveTo':_0x2824a3},function(_0x8e5b1,_0x379ea0){if(_0x8e5b1)return _0x381ebc(_0x8e5b1);return _0x27d04c(_0x379ea0);});})[_0xb8f1('0x28')](function(){return new BPromise(function(_0x4aca56,_0x130b39){rimraf(_0x35e1a4,function(_0x19b32c){if(_0x19b32c)_0x130b39(_0x19b32c);return _0x4aca56();});});})[_0xb8f1('0x28')](function(){return _0x1c25ae[_0xb8f1('0xd2')](_0x2824a3,_0x3320dd,function(_0x536f35){if(_0x536f35){console[_0xb8f1('0xed')](_0xb8f1('0xee'),_0x536f35);}else{fs[_0xb8f1('0xef')](_0x2824a3);}});});});}else{return _0x1c25ae[_0xb8f1('0x1a')](0xc8);}})['catch'](handleError(_0x1c25ae,null));}; \ No newline at end of file +var _0x14ac=['c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','all','rows','params','include','options','create','body','update','describe','addMessage','ids','getMessages','rawAttributes','filter','format','MailMessage','includeAll','findAll','inlineCss','true','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','mkdirSync','each','Messages','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','log','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','juice','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','sendStatus','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','color','from','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','ContactId','buildExpression','text','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','MailAccountId','where','concat','createdAt','parse','$gte','$lte','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?','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IN\x20?','sequelize','toString','merge','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.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x14ac,0x13b));var _0xc14a=function(_0x3f3125,_0x3f49d2){_0x3f3125=_0x3f3125-0x0;var _0x28bf12=_0x14ac[_0x3f3125];return _0x28bf12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc14a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc14a('0x1'));var moment=require(_0xc14a('0x2'));var BPromise=require(_0xc14a('0x3'));var Mustache=require(_0xc14a('0x4'));var util=require(_0xc14a('0x5'));var path=require(_0xc14a('0x6'));var sox=require(_0xc14a('0x7'));var csv=require('to-csv');var ejs=require(_0xc14a('0x8'));var fs=require('fs');var fs_extra=require(_0xc14a('0x9'));var _=require(_0xc14a('0xa'));var squel=require(_0xc14a('0xb'));var crypto=require(_0xc14a('0xc'));var jsforce=require(_0xc14a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc14a('0xe'));var querystring=require('querystring');var Papa=require(_0xc14a('0xf'));var htmlToText=require('html-to-text');var juice=require(_0xc14a('0x10'));var Redis=require('ioredis');var authService=require(_0xc14a('0x11'));var qs=require(_0xc14a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc14a('0x13'))(_0xc14a('0x14'));var utils=require(_0xc14a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc14a('0x16'));var db=require(_0xc14a('0x17'))['db'];config[_0xc14a('0x18')]=_[_0xc14a('0x19')](config[_0xc14a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc14a('0x1a'))(new Redis(config['redis']));require(_0xc14a('0x1b'))[_0xc14a('0x1c')](socket);function respondWithStatusCode(_0x5dd503,_0x5e836a){_0x5e836a=_0x5e836a||0xcc;return function(_0x2dd203){if(_0x2dd203){return _0x5dd503['sendStatus'](_0x5e836a);}return _0x5dd503[_0xc14a('0x1d')](_0x5e836a)[_0xc14a('0x1e')]();};}function respondWithResult(_0x48a496,_0x55b0d6){_0x55b0d6=_0x55b0d6||0xc8;return function(_0x16a86e){if(_0x16a86e){return _0x48a496[_0xc14a('0x1d')](_0x55b0d6)[_0xc14a('0x1f')](_0x16a86e);}};}function respondWithFilteredResult(_0x1bc646,_0x33b7ec){return function(_0x26d8d1){if(_0x26d8d1){var _0x1c0c09=typeof _0x33b7ec[_0xc14a('0x20')]===_0xc14a('0x21')&&typeof _0x33b7ec[_0xc14a('0x22')]===_0xc14a('0x21');var _0x579cfa=_0x26d8d1[_0xc14a('0x23')];var _0x482930=_0x1c0c09?0x0:_0x33b7ec[_0xc14a('0x20')];var _0x341aea=_0x1c0c09?_0x26d8d1[_0xc14a('0x23')]:_0x33b7ec['offset']+_0x33b7ec[_0xc14a('0x22')];var _0x3378ab;if(_0x341aea>=_0x579cfa){_0x341aea=_0x579cfa;_0x3378ab=0xc8;}else{_0x3378ab=0xce;}_0x1bc646[_0xc14a('0x1d')](_0x3378ab);return _0x1bc646[_0xc14a('0x24')](_0xc14a('0x25'),_0x482930+'-'+_0x341aea+'/'+_0x579cfa)['json'](_0x26d8d1);}return null;};}function patchUpdates(_0x465bf6){return function(_0x1f8cc9){try{jsonpatch[_0xc14a('0x26')](_0x1f8cc9,_0x465bf6,!![]);}catch(_0x1e8f4c){return BPromise['reject'](_0x1e8f4c);}return _0x1f8cc9[_0xc14a('0x27')]();};}function saveUpdates(_0x2fcbc7,_0x23eddd){return function(_0x5742d3){if(_0x5742d3){return _0x5742d3['update'](_0x2fcbc7)[_0xc14a('0x28')](function(_0x2ae3e7){return _0x2ae3e7;});}return null;};}function removeEntity(_0x3ef40a,_0x3d168a){return function(_0x4a2463){if(_0x4a2463){return _0x4a2463['destroy']()[_0xc14a('0x28')](function(){_0x3ef40a[_0xc14a('0x1d')](0xcc)[_0xc14a('0x1e')]();});}};}function handleEntityNotFound(_0x4491d6,_0x535f7f){return function(_0x5caf2d){if(!_0x5caf2d){_0x4491d6[_0xc14a('0x29')](0x194);}return _0x5caf2d;};}function handleError(_0x3cf213,_0x303934){_0x303934=_0x303934||0x1f4;return function(_0x327bc7){logger[_0xc14a('0x2a')](_0x327bc7[_0xc14a('0x2b')]);if(_0x327bc7[_0xc14a('0x2c')]){delete _0x327bc7[_0xc14a('0x2c')];}_0x3cf213[_0xc14a('0x1d')](_0x303934)[_0xc14a('0x2d')](_0x327bc7);};}function getInteractionUsers(_0x3d6197,_0xb76d9f){return new BPromise(function(_0x1e1fb1,_0x12be80){try{if(_0xb76d9f[_0x3d6197['id']]){_0x3d6197['Users']=_[_0xc14a('0x2e')](_0xb76d9f[_0x3d6197['id']],function(_0x14e5f3){return{'id':_0x14e5f3['id'],'fullname':_0x14e5f3[_0xc14a('0x2f')]};});}}catch(_0x36fd79){_0x12be80(_0x36fd79);}_0x1e1fb1(_0x3d6197);});}function getInteractionTags(_0x4d19e3,_0x3f20bb){return new BPromise(function(_0x2010ff,_0x7f35ae){try{if(_0x4d19e3[_0xc14a('0x30')]){_0x4d19e3[_0xc14a('0x31')]=[];_0x4d19e3['TagIds'][_0xc14a('0x32')](',')[_0xc14a('0x33')](function(_0x5c1072){_0x4d19e3[_0xc14a('0x31')][_0xc14a('0x34')](_0x3f20bb[_0x5c1072]);});}delete _0x4d19e3['TagIds'];}catch(_0x540625){_0x7f35ae(_0x540625);}_0x2010ff(_0x4d19e3);});}function getLastMessageText(_0x353dcf){return new BPromise(function(_0x1f4065,_0x313aaa){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x353dcf['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc14a('0x35')],'order':_0xc14a('0x36'),'raw':!![]})[_0xc14a('0x28')](function(_0x437f3d){if(_0x437f3d&&_0x437f3d[_0xc14a('0x35')]){_0x353dcf[_0xc14a('0x37')]=_[_0xc14a('0x38')](_0x437f3d['plainBody']);}_0x1f4065(_0x353dcf);})['catch'](function(_0x1573bc){_0x313aaa(_0x1573bc);});});}function updateMailInteraction(_0x2cffbc,_0x1b70ac,_0x25f718,_0x1e375b){return new BPromise(function(_0x5969bf,_0x23e169){return getInteractionUsers(_0x2cffbc,_0x25f718)[_0xc14a('0x28')](function(_0x1d2cc1){return getInteractionTags(_0x1d2cc1,_0x1b70ac);})[_0xc14a('0x28')](function(_0x379f4e){if(_0x1e375b){_0x5969bf(getLastMessageText(_0x379f4e));}else{_0x5969bf(_0x379f4e);}})[_0xc14a('0x39')](function(_0x5dfe18){_0x23e169(_0x5dfe18);});});}exports[_0xc14a('0x3a')]=function(_0x49d66f,_0x7da603){var _0x4d5981={},_0x16b57a={},_0x58a39c={'count':0x0,'rows':[]};var _0x5f0264=_[_0xc14a('0x2e')](db[_0xc14a('0x3b')]['rawAttributes'],function(_0x403951){return{'name':_0x403951[_0xc14a('0x3c')],'type':_0x403951[_0xc14a('0x3d')][_0xc14a('0x3e')]};});_0x16b57a['model']=_[_0xc14a('0x2e')](_0x5f0264,'name');_0x16b57a[_0xc14a('0x3f')]=_[_0xc14a('0x40')](_0x49d66f[_0xc14a('0x3f')]);_0x16b57a[_0xc14a('0x41')]=_[_0xc14a('0x42')](_0x16b57a[_0xc14a('0x43')],_0x16b57a[_0xc14a('0x3f')]);_0x4d5981[_0xc14a('0x44')]=_[_0xc14a('0x42')](_0x16b57a['model'],qs[_0xc14a('0x45')](_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x45')]));_0x4d5981['attributes']=_0x4d5981['attributes'][_0xc14a('0x46')]?_0x4d5981[_0xc14a('0x44')]:_0x16b57a[_0xc14a('0x43')];if(!_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x47')](_0xc14a('0x48'))){_0x4d5981[_0xc14a('0x22')]=qs[_0xc14a('0x22')](_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x22')]);_0x4d5981[_0xc14a('0x20')]=qs['offset'](_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x20')]);}_0x4d5981[_0xc14a('0x49')]=qs['sort'](_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x4a')]);_0x4d5981['where']=qs[_0xc14a('0x41')](_[_0xc14a('0x4b')](_0x49d66f[_0xc14a('0x3f')],_0x16b57a[_0xc14a('0x41')]),_0x5f0264);var _0x536e11=[];var _0x1c97fc=squel['select']()[_0xc14a('0x4c')]('id')[_0xc14a('0x4c')]('name')[_0xc14a('0x4c')](_0xc14a('0x4d'))[_0xc14a('0x4e')]('tools_tags');var _0x2dacaf=squel['select']()[_0xc14a('0x4c')]('u.id')[_0xc14a('0x4c')](_0xc14a('0x4f'))[_0xc14a('0x4c')]('ui.MailInteractionId')[_0xc14a('0x4e')]('user_has_mail_interactions','ui')[_0xc14a('0x50')](_0xc14a('0x51'),'u',_0xc14a('0x52'));var _0x52d146=squel['select']()[_0xc14a('0x4e')](_0xc14a('0x53'),'i')['left_join'](_0xc14a('0x54'),'c',_0xc14a('0x55'))['left_join']('users','o',_0xc14a('0x56'))['left_join'](_0xc14a('0x57'),'a',_0xc14a('0x58'))[_0xc14a('0x50')](_0xc14a('0x59'),'me',_0xc14a('0x5a'))['left_join'](_0xc14a('0x5b'),'it',_0xc14a('0x5c'))[_0xc14a('0x50')](_0xc14a('0x5d'),'t',_0xc14a('0x5e'));var _0x18737c=squel['expr']();var _0x36c6c0=[];var _0x73144c=squel['expr']();var _0x114249;if(_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x5f')]){_0x114249=as['parseSearch'](_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x5f')]);var _0x25292d=_0x114249[_0xc14a('0x60')];for(var _0x569965=0x0;_0x569965<_0x114249[_0xc14a('0x61')][_0xc14a('0x46')];_0x569965++){var _0x32bddd=_0x114249[_0xc14a('0x61')][_0x569965];var _0x1aefbe='i';var _0x23c9fc=_[_0xc14a('0x62')](_0x5f0264,['name',_0x32bddd[_0xc14a('0x4c')]]);if(!_0x23c9fc){switch(_0x32bddd[_0xc14a('0x4c')]){case _0xc14a('0x63'):if(_0x32bddd[_0xc14a('0x64')]==0x1){_0x52d146[_0xc14a('0x65')]('`'+_0x32bddd[_0xc14a('0x4c')]+_0xc14a('0x66'));}else{_0x52d146[_0xc14a('0x65')]('`'+_0x32bddd['field']+_0xc14a('0x67'));}break;case _0xc14a('0x68'):if(_0x32bddd['operator']===_0xc14a('0x69')){if(_0x32bddd[_0xc14a('0x64')][_0xc14a('0x32')]('\x20')[_0xc14a('0x46')]>0x1){_0x18737c[_0x25292d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x32bddd['value']),null);}else{var _0x468ba3='%'+_0x32bddd[_0xc14a('0x64')]+'%';_0x18737c[_0x25292d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x468ba3,_0x468ba3,_0x468ba3);}}else{_0x23c9fc=_[_0xc14a('0x62')](_0x5f0264,[_0xc14a('0x2c'),_0xc14a('0x6a')]);_0x32bddd[_0xc14a('0x4c')]=_0xc14a('0x6a');_0xc73aa0=as[_0xc14a('0x6b')](_0x1aefbe,_0x23c9fc[_0xc14a('0x3d')],_0x32bddd);_0x18737c[_0x25292d](_0xc73aa0[_0xc14a('0x6c')],_0xc73aa0['value'][_0xc14a('0x6d')],_0xc73aa0[_0xc14a('0x64')][_0xc14a('0x1e')]);}break;case'Tag':var _0x34ac30=_0x32bddd['value'][_0xc14a('0x32')](',')[_0xc14a('0x2e')](function(_0x2a2759){return Number(_0x2a2759);});_0x34ac30[_0xc14a('0x33')](function(_0x91087e){_0x73144c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x91087e+',%');});_0x36c6c0=_[_0xc14a('0x6e')](_0x36c6c0,_0x34ac30);break;case _0xc14a('0x6f'):if(_0x32bddd[_0xc14a('0x70')]===_0xc14a('0x69')){_0x18737c[_0x25292d](_0xc14a('0x71'),'%'+_0x32bddd[_0xc14a('0x64')]+'%',null);}else{_0x23c9fc=_[_0xc14a('0x62')](_0x5f0264,[_0xc14a('0x2c'),_0xc14a('0x72')]);_0x32bddd['field']='UserId';_0xc73aa0=as['buildExpression'](_0x1aefbe,_0x23c9fc[_0xc14a('0x3d')],_0x32bddd);_0x18737c[_0x25292d](_0xc73aa0[_0xc14a('0x6c')],_0xc73aa0[_0xc14a('0x64')][_0xc14a('0x6d')],_0xc73aa0[_0xc14a('0x64')][_0xc14a('0x1e')]);}break;case _0xc14a('0x35'):_0xc73aa0=as[_0xc14a('0x6b')]('me',null,_0x32bddd);_0x18737c[_0x25292d](_0xc73aa0[_0xc14a('0x6c')],_0xc73aa0[_0xc14a('0x64')][_0xc14a('0x6d')],_0xc73aa0[_0xc14a('0x64')]['end']);break;}}else{var _0xc73aa0=as['buildExpression'](_0x1aefbe,_0x23c9fc[_0xc14a('0x3d')],_0x32bddd);_0x18737c[_0x25292d](_0xc73aa0[_0xc14a('0x6c')],_0xc73aa0[_0xc14a('0x64')][_0xc14a('0x6d')],_0xc73aa0[_0xc14a('0x64')][_0xc14a('0x1e')]);}}}else{var _0x5efec7=_(_0x49d66f[_0xc14a('0x3f')])[_0xc14a('0x40')]()[_0xc14a('0x2e')](function(_0x1849ae){return _['some'](_0x5f0264,[_0xc14a('0x2c'),_0x1849ae])?_0x1849ae:undefined;})[_0xc14a('0x73')]()[_0xc14a('0x64')]();if(!_[_0xc14a('0x74')](_0x5efec7)){_0x5efec7['forEach'](function(_0x1d96f8){if(_0x1d96f8===_0xc14a('0x75')){_0x52d146[_0xc14a('0x76')]('i.MailAccountId\x20IN\x20?',[][_0xc14a('0x77')](_0x49d66f[_0xc14a('0x3f')][_0x1d96f8]));}else if(_0x1d96f8===_0xc14a('0x78')){var _0xef4d1c=JSON[_0xc14a('0x79')](_0x49d66f[_0xc14a('0x3f')][_0x1d96f8])[_0xc14a('0x7a')];var _0x470853=JSON[_0xc14a('0x79')](_0x49d66f[_0xc14a('0x3f')][_0x1d96f8])[_0xc14a('0x7b')];_0x52d146[_0xc14a('0x76')](_0xc14a('0x7c'),_0xef4d1c,_0x470853);}else{if(_0x49d66f[_0xc14a('0x3f')][_0x1d96f8]===_0xc14a('0x7d')){_0x52d146['where']('i.'+_0x1d96f8+_0xc14a('0x7e'));}else{_0x52d146[_0xc14a('0x76')]('i.'+_0x1d96f8+_0xc14a('0x7f'),_0x49d66f[_0xc14a('0x3f')][_0x1d96f8]);}}});}if(_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x80')]){if(_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x80')]==0x1){_0x52d146['having'](_0xc14a('0x81'));}else{_0x52d146[_0xc14a('0x65')](_0xc14a('0x82'));}}if(_0x49d66f['query'][_0xc14a('0x83')]){_0x36c6c0=_[_0xc14a('0x84')](_0x49d66f['query'][_0xc14a('0x83')])?_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x83')]:new Array(_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x83')]);_0x36c6c0[_0xc14a('0x33')](function(_0x19f6ce){_0x73144c['or'](_0xc14a('0x85'),'%,'+_0x19f6ce+',%');});}if(_0x49d66f[_0xc14a('0x3f')]['filter']){var _0x5ad146=_0x49d66f[_0xc14a('0x3f')]['filter'][_0xc14a('0x86')]('\x5c','\x5c\x5c')[_0xc14a('0x86')](/'/g,'\x27\x27');if(qs[_0xc14a('0x87')](_0x5ad146)){_0x18737c['or'](_0xc14a('0x88'),_0x5ad146+'%');}else if(qs[_0xc14a('0x89')](_0x5ad146)){_0x18737c['or'](_0xc14a('0x8a'),_0x5ad146+'%');}else{_0x18737c['or'](_0xc14a('0x8b'),qs[_0xc14a('0x8c')](_0x5ad146))['or'](_0xc14a('0x8d'),qs['getFullTextValue'](_0x5ad146));}}}_0x52d146[_0xc14a('0x76')](_0x18737c);_0x52d146[_0xc14a('0x8e')]('i.id');var _0x706e6e={'type':db[_0xc14a('0x8f')][_0xc14a('0x90')][_0xc14a('0x91')],'raw':!![]};var _0x547610=_0x52d146[_0xc14a('0x92')]();_0x547610[_0xc14a('0x4c')](_0xc14a('0x93'));_0x547610[_0xc14a('0x4c')](_0xc14a('0x94'),_0xc14a('0x63'));if(_0x4d5981['order']){_0x4d5981['order'][_0xc14a('0x33')](function(_0x5056ff){var _0x2672b7=_0x5056ff[0x0]===_0xc14a('0x95')?_0x5056ff[0x0]:'i.'+_0x5056ff[0x0];_0x52d146[_0xc14a('0x49')](_0x2672b7,_0x5056ff[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x36c6c0)){_0x52d146['having'](_0x73144c);_0x547610[_0xc14a('0x76')]('t.id\x20IN\x20?',_0x36c6c0);}BPromise['resolve']()[_0xc14a('0x28')](function(){if(!_0x114249){if(_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x75')])return;_0x547610[_0xc14a('0x76')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x52d146[_0xc14a('0x76')](_0xc14a('0x96'));return;}if(_0x49d66f[_0xc14a('0x97')][_0xc14a('0x98')]!==_0xc14a('0x99'))return;return _0x49d66f[_0xc14a('0x97')][_0xc14a('0x9a')]({'attributes':['id'],'raw':!![]})[_0xc14a('0x28')](function(_0x139bae){if(_[_0xc14a('0x74')](_0x139bae)){_0x547610[_0xc14a('0x76')]('i.MailAccountId\x20IS\x20NULL');_0x52d146[_0xc14a('0x76')]('i.MailAccountId\x20IS\x20NULL');}else{_0x547610[_0xc14a('0x76')](_0xc14a('0x9b'),_[_0xc14a('0x2e')](_0x139bae,'id'));_0x52d146[_0xc14a('0x76')](_0xc14a('0x9b'),_[_0xc14a('0x2e')](_0x139bae,'id'));}});})[_0xc14a('0x28')](function(){if(_0x49d66f[_0xc14a('0x97')][_0xc14a('0x98')]==='agent'&&!_0x114249&&!_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x75')])return[];return db['sequelize']['query'](_0x547610['toString'](),_0x706e6e);})['then'](function(_0x525728){_0x58a39c[_0xc14a('0x23')]=_0x525728[_0xc14a('0x46')];if(_0x58a39c['count']===0x0)return[];return db[_0xc14a('0x9c')][_0xc14a('0x3f')](_0x1c97fc[_0xc14a('0x9d')](),_0x706e6e)[_0xc14a('0x28')](function(_0x17688c){_0x536e11=_['keyBy'](_0x17688c,'id');_0x706e6e=_[_0xc14a('0x9e')](_0x706e6e,{'model':db[_0xc14a('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49d66f[_0xc14a('0x3f')][_0xc14a('0x45')]){_0x4d5981[_0xc14a('0x44')][_0xc14a('0x33')](function(_0x4de711){_0x52d146[_0xc14a('0x4c')]('i.'+_0x4de711);});}else{_0x52d146[_0xc14a('0x4c')](_0xc14a('0x94'),'unreadMessages');_0x52d146[_0xc14a('0x4c')](_0xc14a('0x9f'),_0xc14a('0xa0'));_0x52d146[_0xc14a('0x4c')]('a.mandatoryDisposition',_0xc14a('0xa1'));_0x52d146['field'](_0xc14a('0xa2'),_0xc14a('0x95'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0x93'));_0x52d146[_0xc14a('0x4c')]('i.createdAt');_0x52d146[_0xc14a('0x4c')](_0xc14a('0xa3'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xa4'));_0x52d146['field']('i.closedAt');_0x52d146[_0xc14a('0x4c')](_0xc14a('0xa5'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xa6'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xa7'));_0x52d146['field']('i.subject');_0x52d146['field'](_0xc14a('0xa8'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xa9'));_0x52d146['field'](_0xc14a('0xaa'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xab'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xac'));_0x52d146['field']('i.ContactId');_0x52d146[_0xc14a('0x4c')]('i.MailAccountId');_0x52d146[_0xc14a('0x4c')]('i.UserId');_0x52d146[_0xc14a('0x4c')](_0xc14a('0xad'),_0xc14a('0xae'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xaf'),_0xc14a('0xb0'));_0x52d146['field'](_0xc14a('0xb1'),_0xc14a('0xb2'));_0x52d146[_0xc14a('0x4c')]('c.phone',_0xc14a('0xb3'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xb4'),_0xc14a('0xb5'));_0x52d146['field'](_0xc14a('0xb6'),_0xc14a('0xb7'));_0x52d146[_0xc14a('0x4c')](_0xc14a('0xb8'),_0xc14a('0xb9'));_0x52d146['field']('o.internal',_0xc14a('0xba'));_0x52d146[_0xc14a('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x4d5981['limit'])_0x52d146[_0xc14a('0x22')](_0x4d5981[_0xc14a('0x22')]);if(_0x4d5981['offset'])_0x52d146['offset'](_0x4d5981[_0xc14a('0x20')]);return db[_0xc14a('0x9c')][_0xc14a('0x3f')](_0x52d146[_0xc14a('0x9d')](),_0x706e6e);})[_0xc14a('0x28')](function(_0x38fd0f){if(_0x38fd0f[_0xc14a('0x46')]>0x0)_0x2dacaf[_0xc14a('0x76')]('ui.MailInteractionId\x20IN\x20?',_[_0xc14a('0x2e')](_0x38fd0f,'id'));return db[_0xc14a('0x9c')]['query'](_0x2dacaf[_0xc14a('0x9d')](),_0x706e6e)[_0xc14a('0x28')](function(_0x56eecc){var _0x2645c0=_[_0xc14a('0xbb')](_0x56eecc,_0xc14a('0xbc'));var _0x3ffff2=[];return db[_0xc14a('0xbd')][_0xc14a('0xbe')]({'attributes':[_0xc14a('0xbf')],'raw':!![]})[_0xc14a('0x28')](function(_0x32d044){var _0x29dc73=_0x32d044[_0xc14a('0xbf')];_0x38fd0f[_0xc14a('0x33')](function(_0x2964c9){_0x3ffff2[_0xc14a('0x34')](updateMailInteraction(_0x2964c9,_0x536e11,_0x2645c0,_0x29dc73));});return BPromise[_0xc14a('0xc0')](_0x3ffff2);});});});})[_0xc14a('0x28')](function(_0x8f4683){_0x58a39c[_0xc14a('0xc1')]=_0x8f4683;return _0x58a39c;})['then'](respondWithFilteredResult(_0x7da603,_0x4d5981))[_0xc14a('0x39')](handleError(_0x7da603,null));};exports['show']=function(_0x224e01,_0x570970){var _0x4424a8={'raw':![],'where':{'id':_0x224e01[_0xc14a('0xc2')]['id']}},_0x3ba7e8={};_0x3ba7e8[_0xc14a('0x43')]=_[_0xc14a('0x40')](db[_0xc14a('0x3b')]['rawAttributes']);_0x3ba7e8[_0xc14a('0x3f')]=_[_0xc14a('0x40')](_0x224e01[_0xc14a('0x3f')]);_0x3ba7e8[_0xc14a('0x41')]=_[_0xc14a('0x42')](_0x3ba7e8[_0xc14a('0x43')],_0x3ba7e8['query']);_0x4424a8[_0xc14a('0x44')]=_[_0xc14a('0x42')](_0x3ba7e8[_0xc14a('0x43')],qs[_0xc14a('0x45')](_0x224e01['query']['fields']));_0x4424a8[_0xc14a('0x44')]=_0x4424a8[_0xc14a('0x44')][_0xc14a('0x46')]?_0x4424a8[_0xc14a('0x44')]:_0x3ba7e8[_0xc14a('0x43')];if(_0x224e01[_0xc14a('0x3f')]['includeAll']){_0x4424a8[_0xc14a('0xc3')]=[{'all':!![]}];}_0x4424a8=_['merge']({},_0x4424a8,_0x224e01[_0xc14a('0xc4')]);return db[_0xc14a('0x3b')][_0xc14a('0x62')](_0x4424a8)[_0xc14a('0x28')](handleEntityNotFound(_0x570970,null))['then'](respondWithResult(_0x570970,null))[_0xc14a('0x39')](handleError(_0x570970,null));};exports[_0xc14a('0xc5')]=function(_0x4c2246,_0x46bb11){return db['MailInteraction'][_0xc14a('0xc5')](_0x4c2246[_0xc14a('0xc6')],{})[_0xc14a('0x28')](respondWithResult(_0x46bb11,0xc9))[_0xc14a('0x39')](handleError(_0x46bb11,null));};exports[_0xc14a('0xc7')]=function(_0x1f7207,_0x1888b3){if(_0x1f7207[_0xc14a('0xc6')]['id']){delete _0x1f7207[_0xc14a('0xc6')]['id'];}return db[_0xc14a('0x3b')][_0xc14a('0x62')]({'where':{'id':_0x1f7207[_0xc14a('0xc2')]['id']}})[_0xc14a('0x28')](handleEntityNotFound(_0x1888b3,null))[_0xc14a('0x28')](saveUpdates(_0x1f7207[_0xc14a('0xc6')],null))[_0xc14a('0x28')](respondWithResult(_0x1888b3,null))[_0xc14a('0x39')](handleError(_0x1888b3,null));};exports['destroy']=function(_0x5973ec,_0x554c5c){return db[_0xc14a('0x3b')][_0xc14a('0x62')]({'where':{'id':_0x5973ec[_0xc14a('0xc2')]['id']}})[_0xc14a('0x28')](handleEntityNotFound(_0x554c5c,null))[_0xc14a('0x28')](removeEntity(_0x554c5c,null))[_0xc14a('0x39')](handleError(_0x554c5c,null));};exports[_0xc14a('0xc8')]=function(_0xcf9285,_0x4ca404){return db[_0xc14a('0x3b')][_0xc14a('0xc8')]()[_0xc14a('0x28')](respondWithResult(_0x4ca404,null))[_0xc14a('0x39')](handleError(_0x4ca404,null));};exports['addMessage']=function(_0x3b6ea2,_0x45a684,_0x256921){return db['MailMessage'][_0xc14a('0x62')]({'where':{'id':_0x3b6ea2['params']['id']}})[_0xc14a('0x28')](handleEntityNotFound(_0x45a684,null))[_0xc14a('0x28')](function(_0x54a964){if(_0x54a964){return _0x54a964[_0xc14a('0xc9')](_0x3b6ea2[_0xc14a('0xc6')]['ids'],_['omit'](_0x3b6ea2[_0xc14a('0xc6')],[_0xc14a('0xca'),'id'])||{});}})['then'](respondWithResult(_0x45a684,null))[_0xc14a('0x39')](handleError(_0x45a684,null));};exports[_0xc14a('0xcb')]=function(_0x10fbf9,_0x3905a7,_0x5a4ca3){var _0xaf15f3={'raw':![],'where':{}};var _0x4ac3f7={};var _0x3e63fa={'count':0x0,'rows':[]};return db[_0xc14a('0x3b')]['findOne']({'where':{'id':_0x10fbf9[_0xc14a('0xc2')]['id']}})['then'](handleEntityNotFound(_0x3905a7,null))[_0xc14a('0x28')](function(_0xe6a5f0){if(_0xe6a5f0){_0x4ac3f7[_0xc14a('0x43')]=_[_0xc14a('0x40')](db['MailMessage'][_0xc14a('0xcc')]);_0x4ac3f7[_0xc14a('0x3f')]=_[_0xc14a('0x40')](_0x10fbf9['query']);_0x4ac3f7[_0xc14a('0x41')]=_[_0xc14a('0x42')](_0x4ac3f7['model'],_0x4ac3f7['query']);_0xaf15f3[_0xc14a('0x44')]=_[_0xc14a('0x42')](_0x4ac3f7[_0xc14a('0x43')],qs[_0xc14a('0x45')](_0x10fbf9[_0xc14a('0x3f')][_0xc14a('0x45')]));_0xaf15f3['attributes']=_0xaf15f3[_0xc14a('0x44')]['length']?_0xaf15f3[_0xc14a('0x44')]:_0x4ac3f7[_0xc14a('0x43')];if(!_0x10fbf9[_0xc14a('0x3f')][_0xc14a('0x47')](_0xc14a('0x48'))){_0xaf15f3['limit']=qs[_0xc14a('0x22')](_0x10fbf9['query'][_0xc14a('0x22')]);_0xaf15f3[_0xc14a('0x20')]=qs[_0xc14a('0x20')](_0x10fbf9[_0xc14a('0x3f')]['offset']);}_0xaf15f3['order']=qs['sort'](_0x10fbf9[_0xc14a('0x3f')][_0xc14a('0x4a')]);_0xaf15f3['where']=qs['filters'](_[_0xc14a('0x4b')](_0x10fbf9[_0xc14a('0x3f')],_0x4ac3f7['filters']));_0xaf15f3['where'][_0xc14a('0xbc')]=_0xe6a5f0['id'];if(_0x10fbf9[_0xc14a('0x3f')][_0xc14a('0xcd')]){_0xaf15f3['where']=_['merge'](_0xaf15f3['where'],{'$or':_['map'](_0xaf15f3[_0xc14a('0x44')],function(_0x510b2e){var _0x1e740a={};_0x1e740a[_0x510b2e]={'$like':'%'+_0x10fbf9[_0xc14a('0x3f')][_0xc14a('0xcd')]+'%'};return _0x1e740a;})});}if(_0x10fbf9[_0xc14a('0x3f')]['$gte']){var _0x75512a=_0x10fbf9[_0xc14a('0x3f')]['$gte'][_0xc14a('0x32')](',');var _0x232235={};_0x232235[_0x75512a[0x0]]={'$gte':moment(_0x75512a[0x1])[_0xc14a('0xce')]('YYYY-MM-DD\x20HH:mm:ss')};_0xaf15f3[_0xc14a('0x76')]=_[_0xc14a('0x9e')](_0xaf15f3['where'],_0x232235);}_0xaf15f3=_[_0xc14a('0x9e')]({},_0xaf15f3,_0x10fbf9['options']);return db[_0xc14a('0xcf')][_0xc14a('0x23')]({'where':_0xaf15f3[_0xc14a('0x76')]})[_0xc14a('0x28')](function(_0x14b37c){_0x3e63fa['count']=_0x14b37c;if(_0x10fbf9[_0xc14a('0x3f')][_0xc14a('0xd0')]){_0xaf15f3[_0xc14a('0xc3')]=[{'all':!![]}];}return db[_0xc14a('0xcf')][_0xc14a('0xd1')](_0xaf15f3);})[_0xc14a('0x28')](function(_0x1ae3e1){if(_0x10fbf9['query'][_0xc14a('0xd2')]===_0xc14a('0xd3')){for(var _0x28fb0a=0x0;_0x28fb0a<_0x1ae3e1[_0xc14a('0x46')];_0x28fb0a++){_0x1ae3e1[_0x28fb0a][_0xc14a('0xc6')]=juice(_0x1ae3e1[_0x28fb0a][_0xc14a('0xc6')]);}}_0x3e63fa[_0xc14a('0xc1')]=_0x1ae3e1;return _0x3e63fa;});}})[_0xc14a('0x28')](respondWithFilteredResult(_0x3905a7,_0xaf15f3))[_0xc14a('0x39')](handleError(_0x3905a7,null));};exports[_0xc14a('0xd4')]=function(_0x5c65fc,_0x4d1e12,_0x1db800){return db['MailInteraction']['find']({'where':{'id':_0x5c65fc['params']['id']}})[_0xc14a('0x28')](handleEntityNotFound(_0x4d1e12,null))[_0xc14a('0x28')](function(_0x10b735){if(_0x10b735){return _0x10b735[_0xc14a('0xd5')](_0x5c65fc['body'][_0xc14a('0xca')],_['omit'](_0x5c65fc[_0xc14a('0xc6')],[_0xc14a('0xca'),'id'])||{})[_0xc14a('0xd6')](function(){return db[_0xc14a('0xd7')]['findAll']({'attributes':['id',_0xc14a('0x2c'),_0xc14a('0x4d')],'where':{'id':_0x5c65fc[_0xc14a('0xc6')][_0xc14a('0xca')]}});})[_0xc14a('0x28')](function(_0x4415b8){socket[_0xc14a('0xd8')](_0xc14a('0xd9'),{'id':Number(_0x5c65fc[_0xc14a('0xc2')]['id']),'tags':_0x4415b8||[]});return{'id':Number(_0x5c65fc[_0xc14a('0xc2')]['id']),'tags':_0x4415b8||[]};});}})['then'](respondWithResult(_0x4d1e12,null))[_0xc14a('0x39')](handleError(_0x4d1e12,null));};exports['removeTags']=function(_0xe683e,_0x1cd157,_0x56d0d8){return db[_0xc14a('0x3b')]['find']({'where':{'id':_0xe683e[_0xc14a('0xc2')]['id']}})[_0xc14a('0x28')](handleEntityNotFound(_0x1cd157,null))[_0xc14a('0x28')](function(_0x1d39ff){if(_0x1d39ff){return _0x1d39ff[_0xc14a('0xda')](_0xe683e[_0xc14a('0x3f')][_0xc14a('0xca')]);}})[_0xc14a('0x28')](respondWithStatusCode(_0x1cd157,null))[_0xc14a('0x39')](handleError(_0x1cd157,null));};exports[_0xc14a('0xdb')]=function(_0x53b017,_0x98f493){var _0x1b6885=moment()[_0xc14a('0xdc')]()[_0xc14a('0x9d')]();var _0x30adcb=path['join'](config[_0xc14a('0xdd')],_0xc14a('0xde'),'files',_0xc14a('0xdf'));var _0x2296fe=path[_0xc14a('0xe0')](config[_0xc14a('0xdd')],'server',_0xc14a('0xe1'),_0xc14a('0xe2'));var _0x29d043=path[_0xc14a('0xe0')](_0x30adcb,_0x1b6885);var _0xbfdbee=util['format'](_0xc14a('0xe3'),_0x53b017[_0xc14a('0xc2')]['id'],_0x1b6885);var _0x2e0c56=path[_0xc14a('0xe0')](_0x30adcb,_0xbfdbee);var _0x338e2e=[];if(_0x53b017['query'][_0xc14a('0xe2')]){_0x338e2e[_0xc14a('0x34')]({'model':db[_0xc14a('0xe4')],'as':_0xc14a('0xe5'),'raw':!![]});}var _0x5e4ea0=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0xc14a('0xc6'),'from','to','cc',_0xc14a('0xe6'),_0xc14a('0xe7'),'createdAt'],'where':{'secret':![]},'order':qs[_0xc14a('0x4a')]('id'),'include':_0x338e2e}];return db[_0xc14a('0x3b')]['find']({'where':{'id':_0x53b017[_0xc14a('0xc2')]['id']},'include':_0x5e4ea0})[_0xc14a('0x28')](handleEntityNotFound(_0x98f493,null))[_0xc14a('0x28')](function(_0x51d34e){if(_0x51d34e&&_0x51d34e['Messages']){var _0xa9fe91=_0x51d34e['get']({'plain':!![]});fs[_0xc14a('0xe8')](_0x29d043);return BPromise[_0xc14a('0xe9')](_0xa9fe91[_0xc14a('0xea')],function(_0x94f224,_0x212e99){var _0x5bcdae={'from':_0x94f224['from'],'to':_0x94f224['to'],'subject':_0x94f224[_0xc14a('0xe7')],'html':_0x94f224['body'],'headers':{'Date':moment(_0x94f224[_0xc14a('0x78')])[_0xc14a('0xce')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x94f224['cc']){_0x5bcdae[_0xc14a('0xeb')]['Cc']=_0x94f224['cc'];}if(_0x94f224[_0xc14a('0xe6')]){_0x5bcdae[_0xc14a('0xeb')][_0xc14a('0xec')]=_0x94f224['bcc'];}return new BPromise(function(_0xf9eda1,_0x2378ec){if(_0x94f224[_0xc14a('0xe5')]){for(var _0x1b37e0=0x0;_0x1b37e0<_0x94f224['Attachments']['length'];_0x1b37e0++){var _0x24759b=_0x94f224[_0xc14a('0xe5')][_0x1b37e0];var _0x4d4a3a=path[_0xc14a('0xe0')](_0x2296fe,_0x24759b[_0xc14a('0xed')]);if(fs[_0xc14a('0xee')](_0x4d4a3a)){_0x5bcdae[_0xc14a('0xe2')][_0xc14a('0x34')]({'name':_0x24759b[_0xc14a('0x2c')],'contentType':_0x24759b[_0xc14a('0x3d')],'data':fs[_0xc14a('0xef')](_0x4d4a3a)});}}}emlformat['build'](_0x5bcdae,function(_0x156495,_0x5ae566){if(_0x156495)return _0x2378ec(_0x156495);fs[_0xc14a('0xf0')](path[_0xc14a('0xe0')](_0x29d043,util[_0xc14a('0xce')]('message%d.eml',_0x212e99)),_0x5ae566);return _0xf9eda1(_0x5ae566);});});})['then'](function(){return new BPromise(function(_0x32c419,_0x1baa82){zipdir(_0x29d043,{'saveTo':_0x2e0c56},function(_0x1c4a9a,_0x15f4b3){if(_0x1c4a9a)return _0x1baa82(_0x1c4a9a);return _0x32c419(_0x15f4b3);});})['then'](function(){return new BPromise(function(_0x106247,_0x5aa361){rimraf(_0x29d043,function(_0x3027a5){if(_0x3027a5)_0x5aa361(_0x3027a5);return _0x106247();});});})[_0xc14a('0x28')](function(){return _0x98f493['download'](_0x2e0c56,_0xbfdbee,function(_0x5f421b){if(_0x5f421b){console[_0xc14a('0xf1')](_0xc14a('0xf2'),_0x5f421b);}else{fs[_0xc14a('0xf3')](_0x2e0c56);}});});});}else{return _0x98f493[_0xc14a('0x29')](0xc8);}})[_0xc14a('0x39')](handleError(_0x98f493,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index ec0ccdf..c965706 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 _0xe96f=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x3e0fed,_0x22e5c3){var _0x4f2bd6=function(_0x178f58){while(--_0x178f58){_0x3e0fed['push'](_0x3e0fed['shift']());}};_0x4f2bd6(++_0x22e5c3);}(_0xe96f,0xe3));var _0xfe96=function(_0x20c1c1,_0x338552){_0x20c1c1=_0x20c1c1-0x0;var _0x5f3592=_0xe96f[_0x20c1c1];return _0x5f3592;};'use strict';var EventEmitter=require(_0xfe96('0x0'));var MailInteraction=require(_0xfe96('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xfe96('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xfe96('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe96('0x4'),'afterDestroy':_0xfe96('0x5')};function emitEvent(_0x13212d){return function(_0x2c9812,_0x263da7,_0x296a8c){_0x2c9812[_0xfe96('0x6')]({'attributes':['id'],'raw':!![]})[_0xfe96('0x7')](function(_0x573fae){_0x2c9812[_0xfe96('0x8')](_0xfe96('0x9'),_0x573fae[_0xfe96('0xa')](function(_0x2ce95e){return{'id':_0x2ce95e['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2c9812['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2dc832){_0x2c9812[_0xfe96('0x8')]('unreadMessages',_0x2dc832[_0xfe96('0xb')]);MailInteractionEvents[_0xfe96('0xc')](_0x13212d+':'+_0x2c9812['id'],_0x2c9812);MailInteractionEvents[_0xfe96('0xc')](_0x13212d,_0x2c9812);_0x296a8c(null);})[_0xfe96('0xd')](_0x296a8c(null));};}for(var e in events){if(events[_0xfe96('0xe')](e)){var event=events[e];MailInteraction[_0xfe96('0xf')](e,emitEvent(event));}}module[_0xfe96('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x3034=['events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','Users','map','findAll','setDataValue','length','emit','hook','exports'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x3034,0x132));var _0x4303=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3034[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x4303('0x0'));var MailInteraction=require(_0x4303('0x1'))['db'][_0x4303('0x2')];var MailMessage=require(_0x4303('0x1'))['db'][_0x4303('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4303('0x4')](0x0);var events={'afterCreate':_0x4303('0x5'),'afterUpdate':_0x4303('0x6'),'afterDestroy':_0x4303('0x7')};function emitEvent(_0x1af4ca){return function(_0x2c2b50,_0x2a855e,_0x5651d2){_0x2c2b50['getUsers']({'attributes':['id'],'raw':!![]})[_0x4303('0x8')](function(_0x331e91){_0x2c2b50['setDataValue'](_0x4303('0x9'),_0x331e91[_0x4303('0xa')](function(_0x1136f3){return{'id':_0x1136f3['id']};}));return MailMessage[_0x4303('0xb')]({'where':{'MailInteractionId':_0x2c2b50['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4303('0x8')](function(_0x21113c){_0x2c2b50[_0x4303('0xc')]('unreadMessages',_0x21113c[_0x4303('0xd')]);MailInteractionEvents['emit'](_0x1af4ca+':'+_0x2c2b50['id'],_0x2c2b50);MailInteractionEvents[_0x4303('0xe')](_0x1af4ca,_0x2c2b50);_0x5651d2(null);})['catch'](_0x5651d2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x4303('0xf')](e,emitEvent(event));}}module[_0x4303('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 5c7f12e..d142882 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 _0x8aeb=['bluebird','exports','define','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','models','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','api'];(function(_0x3caa1b,_0x1e41c8){var _0x2d37b8=function(_0x3a4ba5){while(--_0x3a4ba5){_0x3caa1b['push'](_0x3caa1b['shift']());}};_0x2d37b8(++_0x1e41c8);}(_0x8aeb,0xda));var _0xb8ae=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0x8aeb[_0x421725];return _0x51b322;};'use strict';var _=require(_0xb8ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb8ae('0x1'));var moment=require('moment');var BPromise=require(_0xb8ae('0x2'));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('./mailInteraction.attributes');module[_0xb8ae('0x3')]=function(_0x5313fd,_0x3e2278){return _0x5313fd[_0xb8ae('0x4')]('MailInteraction',attributes,{'tableName':_0xb8ae('0x5'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xb8ae('0x6'),'to'],'type':_0xb8ae('0x7')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f21b0,_0x323f3d,_0x5759eb){if(_0x2f21b0[_0xb8ae('0x8')]){_0x2f21b0[_0xb8ae('0x9')]=moment()['format'](_0xb8ae('0xa'));}if(_0x2f21b0[_0xb8ae('0xb')]){_0x2f21b0['closedAt']=moment()[_0xb8ae('0xc')](_0xb8ae('0xa'));}_0x5759eb(null,_0x323f3d);},'beforeUpdate':function(_0x2ac880,_0x51d252,_0x263efd){if(_0x2ac880['changed'](_0xb8ae('0x8'))){_0x2ac880[_0xb8ae('0x9')]=_0x2ac880[_0xb8ae('0x8')]?moment()['format'](_0xb8ae('0xa')):null;}if(_0x2ac880[_0xb8ae('0xd')]('closed')){_0x2ac880['closedAt']=moment()[_0xb8ae('0xc')](_0xb8ae('0xa'));_0x2ac880['substatus']=null;_0x2ac880['substatusAt']=null;}_0x263efd(null,_0x2ac880);},'afterUpdate':function(_0x124235,_0x30eb41,_0x20dad8){var _0x540d21=_0x5313fd[_0xb8ae('0xe')];var _0x483cf6=_0x124235['get']({'plain':!![]});if(_0x483cf6[_0xb8ae('0xb')]){return _0x540d21[_0xb8ae('0xf')][_0xb8ae('0x10')]({'read':!![]},{'where':{'MailInteractionId':_0x483cf6['id']}})[_0xb8ae('0x11')](function(){_0x20dad8();})[_0xb8ae('0x12')](function(_0x23c5f6){_0x20dad8(_0x23c5f6);});}else{_0x20dad8();}}},'charset':'utf8mb4','collate':_0xb8ae('0x13')});}; \ No newline at end of file +var _0xfd98=['YYYY-MM-DD\x20HH:mm:ss','changed','substatusAt','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','../../config/environment','define','MailInteraction','subject','substatus','closed','closedAt','format'];(function(_0x414658,_0x32591f){var _0x3f33b8=function(_0x1ce3f3){while(--_0x1ce3f3){_0x414658['push'](_0x414658['shift']());}};_0x3f33b8(++_0x32591f);}(_0xfd98,0x13d));var _0x8fd9=function(_0x3370aa,_0x282cfc){_0x3370aa=_0x3370aa-0x0;var _0xa5801a=_0xfd98[_0x3370aa];return _0xa5801a;};'use strict';var _=require(_0x8fd9('0x0'));var util=require(_0x8fd9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8fd9('0x2'));var BPromise=require(_0x8fd9('0x3'));var rp=require(_0x8fd9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8fd9('0x5'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x4c1f8f,_0xa9211f){return _0x4c1f8f[_0x8fd9('0x6')](_0x8fd9('0x7'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x8fd9('0x8'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1de57f,_0x5aec84,_0x124878){if(_0x1de57f[_0x8fd9('0x9')]){_0x1de57f['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1de57f[_0x8fd9('0xa')]){_0x1de57f[_0x8fd9('0xb')]=moment()[_0x8fd9('0xc')](_0x8fd9('0xd'));}_0x124878(null,_0x5aec84);},'beforeUpdate':function(_0x5376b5,_0x12e0af,_0x4cd97a){if(_0x5376b5[_0x8fd9('0xe')]('substatus')){_0x5376b5[_0x8fd9('0xf')]=_0x5376b5[_0x8fd9('0x9')]?moment()[_0x8fd9('0xc')](_0x8fd9('0xd')):null;}if(_0x5376b5['changed'](_0x8fd9('0xa'))){_0x5376b5[_0x8fd9('0xb')]=moment()[_0x8fd9('0xc')](_0x8fd9('0xd'));_0x5376b5[_0x8fd9('0x9')]=null;_0x5376b5[_0x8fd9('0xf')]=null;}_0x4cd97a(null,_0x5376b5);},'afterUpdate':function(_0x161457,_0x30483d,_0xd17283){var _0x34a77b=_0x4c1f8f[_0x8fd9('0x10')];var _0x76d545=_0x161457['get']({'plain':!![]});if(_0x76d545[_0x8fd9('0xa')]){return _0x34a77b[_0x8fd9('0x11')][_0x8fd9('0x12')]({'read':!![]},{'where':{'MailInteractionId':_0x76d545['id']}})['then'](function(){_0xd17283();})[_0x8fd9('0x13')](function(_0x5621a0){_0xd17283(_0x5621a0);});}else{_0xd17283();}}},'charset':_0x8fd9('0x14'),'collate':_0x8fd9('0x15')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 12f4bdc..c4da05f 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 _0x273b=['body','options','raw','attributes','limit','AddTagsToMailInteraction','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update'];(function(_0x522d67,_0x57eb35){var _0x38f1c1=function(_0x4e7c86){while(--_0x4e7c86){_0x522d67['push'](_0x522d67['shift']());}};_0x38f1c1(++_0x57eb35);}(_0x273b,0xb8));var _0xb273=function(_0x55725f,_0x81a704){_0x55725f=_0x55725f-0x0;var _0x486997=_0x273b[_0x55725f];return _0x486997;};'use strict';var _=require('lodash');var util=require(_0xb273('0x0'));var moment=require(_0xb273('0x1'));var BPromise=require(_0xb273('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb273('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb273('0x4'));var logger=require(_0xb273('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb273('0x6'));var client=jayson[_0xb273('0x7')][_0xb273('0x8')]({'port':0x232a});config[_0xb273('0x9')]=_[_0xb273('0xa')](config[_0xb273('0x9')],{'host':_0xb273('0xb'),'port':0x18eb});var socket=require(_0xb273('0xc'))(new Redis(config[_0xb273('0x9')]));require(_0xb273('0xd'))[_0xb273('0xe')](socket);function respondWithRpcPromise(_0x2c39c9,_0x9cce80,_0x3a8a2e){return new BPromise(function(_0x263b5e,_0x33f44f){return client[_0xb273('0xf')](_0x2c39c9,_0x3a8a2e)[_0xb273('0x10')](function(_0xe1cf38){logger['info'](_0xb273('0x11'),_0x9cce80,_0xb273('0x12'));logger[_0xb273('0x13')](_0xb273('0x14'),_0x9cce80,_0xb273('0x12'),JSON[_0xb273('0x15')](_0xe1cf38));if(_0xe1cf38['error']){if(_0xe1cf38[_0xb273('0x16')][_0xb273('0x17')]===0x1f4){logger[_0xb273('0x16')](_0xb273('0x11'),_0x9cce80,_0xe1cf38['error'][_0xb273('0x18')]);return _0x33f44f(_0xe1cf38[_0xb273('0x16')][_0xb273('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x9cce80,_0xe1cf38[_0xb273('0x16')][_0xb273('0x18')]);return _0x263b5e(_0xe1cf38[_0xb273('0x16')][_0xb273('0x18')]);}else{logger[_0xb273('0x19')]('MailInteraction,\x20%s,\x20%s',_0x9cce80,_0xb273('0x12'));_0x263b5e(_0xe1cf38[_0xb273('0x1a')][_0xb273('0x18')]);}})[_0xb273('0x1b')](function(_0x556779){logger[_0xb273('0x16')]('MailInteraction,\x20%s,\x20%s',_0x9cce80,_0x556779);_0x33f44f(_0x556779);});});}exports[_0xb273('0x1c')]=function(_0x26749e){var _0x142d5f=this;return new Promise(function(_0x4f1e73,_0x2a4f39){return db[_0xb273('0x1d')][_0xb273('0x1e')](_0x26749e[_0xb273('0x1f')],{'raw':_0x26749e[_0xb273('0x20')]?_0x26749e[_0xb273('0x20')][_0xb273('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26749e[_0xb273('0x20')]?_0x26749e['options']['where']||null:null,'attributes':_0x26749e['options']?_0x26749e[_0xb273('0x20')][_0xb273('0x22')]||null:null,'limit':_0x26749e[_0xb273('0x20')]?_0x26749e[_0xb273('0x20')][_0xb273('0x23')]||null:null})['then'](function(_0x32a2b7){logger[_0xb273('0x19')]('UpdateMailInteraction',_0x26749e);logger[_0xb273('0x13')]('UpdateMailInteraction',_0x26749e,JSON['stringify'](_0x32a2b7));_0x4f1e73(_0x32a2b7);})[_0xb273('0x1b')](function(_0x42ef7e){logger[_0xb273('0x16')](_0xb273('0x1c'),_0x42ef7e[_0xb273('0x18')],_0x26749e);_0x2a4f39(_0x142d5f[_0xb273('0x16')](0x1f4,_0x42ef7e[_0xb273('0x18')]));});});};exports[_0xb273('0x24')]=function(_0x1d9a8b){return new Promise(function(_0x4a8697,_0x193bbe){return db['MailInteraction']['find']({'where':_0x1d9a8b[_0xb273('0x20')]?_0x1d9a8b[_0xb273('0x20')][_0xb273('0x25')]||null:null})[_0xb273('0x10')](function(_0x240d80){if(_0x240d80){return _0x240d80[_0xb273('0x26')](_0x1d9a8b['body'][_0xb273('0x27')],_[_0xb273('0x28')](_0x1d9a8b[_0xb273('0x1f')],[_0xb273('0x27'),'id'])||{});}})[_0xb273('0x29')](function(_0x2d8a55){logger[_0xb273('0x19')]('AddTags',_0x1d9a8b);logger[_0xb273('0x13')]('AddTags',_0x1d9a8b,JSON['stringify'](_0x2d8a55));_0x4a8697(_0x2d8a55);})[_0xb273('0x1b')](function(_0x4819d7){logger[_0xb273('0x16')](_0xb273('0x2a'),_0x4819d7[_0xb273('0x18')],_0x1d9a8b);_0x193bbe(_this[_0xb273('0x16')](0x1f4,_0x4819d7[_0xb273('0x18')]));});});}; \ No newline at end of file +var _0x60f3=['body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','register','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','limit','AddTagsToMailInteraction','find','addTags'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x60f3,0xd2));var _0x360f=function(_0x33be9d,_0x41618e){_0x33be9d=_0x33be9d-0x0;var _0x4a9267=_0x60f3[_0x33be9d];return _0x4a9267;};'use strict';var _=require(_0x360f('0x0'));var util=require(_0x360f('0x1'));var moment=require(_0x360f('0x2'));var BPromise=require(_0x360f('0x3'));var rs=require(_0x360f('0x4'));var fs=require('fs');var Redis=require(_0x360f('0x5'));var db=require(_0x360f('0x6'))['db'];var utils=require(_0x360f('0x7'));var logger=require(_0x360f('0x8'))('rpc');var config=require(_0x360f('0x9'));var jayson=require(_0x360f('0xa'));var client=jayson[_0x360f('0xb')]['http']({'port':0x232a});config['redis']=_[_0x360f('0xc')](config[_0x360f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x360f('0xd')]));require('./mailInteraction.socket')[_0x360f('0xe')](socket);function respondWithRpcPromise(_0x12b4a6,_0x217186,_0x3ddff7){return new BPromise(function(_0x26502c,_0x4a8a5a){return client['request'](_0x12b4a6,_0x3ddff7)[_0x360f('0xf')](function(_0x2fe236){logger['info'](_0x360f('0x10'),_0x217186,'request\x20sent');logger[_0x360f('0x11')](_0x360f('0x12'),_0x217186,_0x360f('0x13'),JSON[_0x360f('0x14')](_0x2fe236));if(_0x2fe236[_0x360f('0x15')]){if(_0x2fe236[_0x360f('0x15')][_0x360f('0x16')]===0x1f4){logger[_0x360f('0x15')](_0x360f('0x10'),_0x217186,_0x2fe236['error'][_0x360f('0x17')]);return _0x4a8a5a(_0x2fe236[_0x360f('0x15')][_0x360f('0x17')]);}logger[_0x360f('0x15')](_0x360f('0x10'),_0x217186,_0x2fe236['error'][_0x360f('0x17')]);return _0x26502c(_0x2fe236['error']['message']);}else{logger[_0x360f('0x18')](_0x360f('0x10'),_0x217186,'request\x20sent');_0x26502c(_0x2fe236['result'][_0x360f('0x17')]);}})[_0x360f('0x19')](function(_0x547e27){logger[_0x360f('0x15')](_0x360f('0x10'),_0x217186,_0x547e27);_0x4a8a5a(_0x547e27);});});}exports[_0x360f('0x1a')]=function(_0x5733dc){var _0xf3278e=this;return new Promise(function(_0xccdd8e,_0x5c915b){return db[_0x360f('0x1b')][_0x360f('0x1c')](_0x5733dc['body'],{'raw':_0x5733dc[_0x360f('0x1d')]?_0x5733dc[_0x360f('0x1d')][_0x360f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5733dc['options']?_0x5733dc[_0x360f('0x1d')][_0x360f('0x1f')]||null:null,'attributes':_0x5733dc['options']?_0x5733dc['options']['attributes']||null:null,'limit':_0x5733dc[_0x360f('0x1d')]?_0x5733dc[_0x360f('0x1d')][_0x360f('0x20')]||null:null})['then'](function(_0x2f3757){logger[_0x360f('0x18')]('UpdateMailInteraction',_0x5733dc);logger['debug'](_0x360f('0x1a'),_0x5733dc,JSON[_0x360f('0x14')](_0x2f3757));_0xccdd8e(_0x2f3757);})[_0x360f('0x19')](function(_0xfa29fc){logger[_0x360f('0x15')]('UpdateMailInteraction',_0xfa29fc[_0x360f('0x17')],_0x5733dc);_0x5c915b(_0xf3278e[_0x360f('0x15')](0x1f4,_0xfa29fc[_0x360f('0x17')]));});});};exports[_0x360f('0x21')]=function(_0x15c6ad){return new Promise(function(_0x8f3285,_0x3e05d2){return db[_0x360f('0x1b')][_0x360f('0x22')]({'where':_0x15c6ad[_0x360f('0x1d')]?_0x15c6ad[_0x360f('0x1d')][_0x360f('0x1f')]||null:null})[_0x360f('0xf')](function(_0x1c2beb){if(_0x1c2beb){return _0x1c2beb[_0x360f('0x23')](_0x15c6ad[_0x360f('0x24')][_0x360f('0x25')],_[_0x360f('0x26')](_0x15c6ad[_0x360f('0x24')],['ids','id'])||{});}})[_0x360f('0x27')](function(_0x37c465){logger['info'](_0x360f('0x28'),_0x15c6ad);logger[_0x360f('0x11')](_0x360f('0x28'),_0x15c6ad,JSON[_0x360f('0x14')](_0x37c465));_0x8f3285(_0x37c465);})[_0x360f('0x19')](function(_0x17d3a7){logger[_0x360f('0x15')](_0x360f('0x28'),_0x17d3a7['message'],_0x15c6ad);_0x3e05d2(_this[_0x360f('0x15')](0x1f4,_0x17d3a7[_0x360f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 63ef4dd..028c3cb 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 _0x701c=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0x701c,0x9f));var _0xc701=function(_0x4e71f7,_0x147594){_0x4e71f7=_0x4e71f7-0x0;var _0x29970b=_0x701c[_0x4e71f7];return _0x29970b;};'use strict';var MailInteractionEvents=require(_0xc701('0x0'));var events=[_0xc701('0x1'),_0xc701('0x2'),_0xc701('0x3')];function createListener(_0x49d417,_0x5d8a8d){return function(_0x416dcc){_0x5d8a8d[_0xc701('0x4')](_0x49d417,_0x416dcc);};}function removeListener(_0x1bc212,_0x46dc00){return function(){MailInteractionEvents[_0xc701('0x5')](_0x1bc212,_0x46dc00);};}exports[_0xc701('0x6')]=function(_0x3ea957){for(var _0x57d9e2=0x0,_0x1575ce=events[_0xc701('0x7')];_0x57d9e2<_0x1575ce;_0x57d9e2++){var _0x5cca7f=events[_0x57d9e2];var _0x457486=createListener(_0xc701('0x8')+_0x5cca7f,_0x3ea957);MailInteractionEvents['on'](_0x5cca7f,_0x457486);}}; \ No newline at end of file +var _0x6086=['length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6086,0x107));var _0x6608=function(_0x1ccf78,_0x2e338b){_0x1ccf78=_0x1ccf78-0x0;var _0x2dca07=_0x6086[_0x1ccf78];return _0x2dca07;};'use strict';var MailInteractionEvents=require(_0x6608('0x0'));var events=[_0x6608('0x1'),_0x6608('0x2'),_0x6608('0x3')];function createListener(_0x37cbe3,_0x209160){return function(_0x27e234){_0x209160[_0x6608('0x4')](_0x37cbe3,_0x27e234);};}function removeListener(_0x5b6e15,_0x228bcc){return function(){MailInteractionEvents[_0x6608('0x5')](_0x5b6e15,_0x228bcc);};}exports[_0x6608('0x6')]=function(_0x548ca0){for(var _0x17c36e=0x0,_0x16468d=events[_0x6608('0x7')];_0x17c36e<_0x16468d;_0x17c36e++){var _0x3f53a4=events[_0x17c36e];var _0x16da8e=createListener(_0x6608('0x8')+_0x3f53a4,_0x548ca0);MailInteractionEvents['on'](_0x3f53a4,_0x16da8e);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 39fc583..df66332 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 _0x3670=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x3670,0x16c));var _0x0367=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3670[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x0367('0x0'));var path=require(_0x0367('0x1'));var timeout=require(_0x0367('0x2'));var express=require(_0x0367('0x3'));var router=express[_0x0367('0x4')]();var fs_extra=require(_0x0367('0x5'));var auth=require(_0x0367('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0367('0x7'));var controller=require(_0x0367('0x8'));router[_0x0367('0x9')]('/',auth[_0x0367('0xa')](),controller[_0x0367('0xb')]);router[_0x0367('0x9')](_0x0367('0xc'),auth[_0x0367('0xa')](),controller[_0x0367('0xd')]);router[_0x0367('0x9')](_0x0367('0xe'),auth[_0x0367('0xa')](),controller[_0x0367('0xf')]);router[_0x0367('0x9')](_0x0367('0x10'),auth[_0x0367('0xa')](),controller['download']);router[_0x0367('0x11')]('/',auth['isAuthenticated'](),interaction[_0x0367('0x12')](_0x0367('0x13'),_0x0367('0x14')),controller[_0x0367('0x15')]);router[_0x0367('0x16')](_0x0367('0xe'),auth[_0x0367('0xa')](),controller[_0x0367('0x17')]);router['put'](_0x0367('0x18'),auth[_0x0367('0xa')](),controller['accept']);router[_0x0367('0x16')](_0x0367('0x19'),auth[_0x0367('0xa')](),controller['reject']);router[_0x0367('0x1a')](_0x0367('0xe'),auth[_0x0367('0xa')](),controller[_0x0367('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x19ea=['/:id/reject','reject','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','tracked','mail','create','put','update','/:id/accept','accept'];(function(_0x1772c8,_0x4792f4){var _0x4ad8b0=function(_0x3ee3f8){while(--_0x3ee3f8){_0x1772c8['push'](_0x1772c8['shift']());}};_0x4ad8b0(++_0x4792f4);}(_0x19ea,0xfe));var _0xa19e=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x19ea[_0x37b7b6];return _0x10c4c3;};'use strict';var multer=require(_0xa19e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa19e('0x1'));var express=require('express');var router=express[_0xa19e('0x2')]();var fs_extra=require(_0xa19e('0x3'));var auth=require(_0xa19e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa19e('0x5'));router[_0xa19e('0x6')]('/',auth[_0xa19e('0x7')](),controller[_0xa19e('0x8')]);router[_0xa19e('0x6')](_0xa19e('0x9'),auth[_0xa19e('0x7')](),controller[_0xa19e('0xa')]);router[_0xa19e('0x6')](_0xa19e('0xb'),auth[_0xa19e('0x7')](),controller['show']);router[_0xa19e('0x6')](_0xa19e('0xc'),auth[_0xa19e('0x7')](),controller[_0xa19e('0xd')]);router['post']('/',auth[_0xa19e('0x7')](),interaction[_0xa19e('0xe')](_0xa19e('0xf'),'mailmessage:create'),controller[_0xa19e('0x10')]);router[_0xa19e('0x11')](_0xa19e('0xb'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x12')]);router['put'](_0xa19e('0x13'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x14')]);router[_0xa19e('0x11')](_0xa19e('0x15'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x16')]);router[_0xa19e('0x17')](_0xa19e('0xb'),auth[_0xa19e('0x7')](),controller[_0xa19e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7409848..3d2766d 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 _0xcbf0=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','INTEGER','DATE','Email','sequelize','lodash'];(function(_0x5b2cb2,_0x53265f){var _0xe1d1e6=function(_0x510687){while(--_0x510687){_0x5b2cb2['push'](_0x5b2cb2['shift']());}};_0xe1d1e6(++_0x53265f);}(_0xcbf0,0xc1));var _0x0cbf=function(_0x4dc620,_0x2b341f){_0x4dc620=_0x4dc620-0x0;var _0x2f0c2c=_0xcbf0[_0x4dc620];return _0x2f0c2c;};'use strict';var Sequelize=require(_0x0cbf('0x0'));var _=require(_0x0cbf('0x1'));module[_0x0cbf('0x2')]={'body':{'type':Sequelize[_0x0cbf('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x0cbf('0x4'))},'read':{'type':Sequelize[_0x0cbf('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0cbf('0x6')]('in',_0x0cbf('0x7')),'defaultValue':_0x0cbf('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0cbf('0x8')](0x1fe)},'from':{'type':Sequelize[_0x0cbf('0x8')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0x0cbf('0x9'))},'bcc':{'type':Sequelize['TEXT'](_0x0cbf('0x9'))},'subject':{'type':Sequelize[_0x0cbf('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x0cbf('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0cbf('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0cbf('0xb')]},'originTo':{'type':Sequelize[_0x0cbf('0x3')](_0x0cbf('0x9'))},'originCc':{'type':Sequelize[_0x0cbf('0x3')](_0x0cbf('0x9'))},'originChannel':{'type':Sequelize[_0x0cbf('0x6')](_0x0cbf('0xc'),'Chat'),'defaultValue':_0x0cbf('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x528e=['DATE','INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x528e,0x1d2));var _0xe528=function(_0x4430d7,_0x19f497){_0x4430d7=_0x4430d7-0x0;var _0x5c46df=_0x528e[_0x4430d7];return _0x5c46df;};'use strict';var Sequelize=require(_0xe528('0x0'));var _=require(_0xe528('0x1'));module[_0xe528('0x2')]={'body':{'type':Sequelize[_0xe528('0x3')](_0xe528('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe528('0x3')](_0xe528('0x5'))},'read':{'type':Sequelize[_0xe528('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe528('0x7')]('in',_0xe528('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe528('0x9')](0x1fe)},'from':{'type':Sequelize[_0xe528('0x9')]},'to':{'type':Sequelize[_0xe528('0x3')](_0xe528('0x4'))},'cc':{'type':Sequelize['TEXT'](_0xe528('0x4'))},'bcc':{'type':Sequelize[_0xe528('0x3')](_0xe528('0x4'))},'subject':{'type':Sequelize[_0xe528('0x3')]},'sentAt':{'type':Sequelize[_0xe528('0xa')]},'attach':{'type':Sequelize[_0xe528('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe528('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0xe528('0x4'))},'originCc':{'type':Sequelize[_0xe528('0x3')](_0xe528('0x4'))},'originChannel':{'type':Sequelize[_0xe528('0x7')](_0xe528('0xc'),_0xe528('0xd')),'defaultValue':_0xe528('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index b44e7ad..a95b60c 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 _0x5fc3=['to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','index','map','MailMessage','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','auth','user','pass','secure','attachments','join','root','server/files/attachments','basename','defaults','ListId','SendMail','sendMail','update','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','channel','event','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','contact','fullname','rejectmessage','download','unix','toString','server','files','message-%s.eml','bcc','subject','createdAt','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x5fc3,0xa8));var _0x35fc=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x5fc3[_0x128bef];return _0x1ba862;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var htmlToText=require('html-to-text');var db=require('../../mysqldb')['db'];config[_0x35fc('0x17')]=_['defaults'](config[_0x35fc('0x17')],{'host':_0x35fc('0x18'),'port':0x18eb});var socket=require(_0x35fc('0x19'))(new Redis(config[_0x35fc('0x17')]));require(_0x35fc('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x35fc('0x1b')][_0x35fc('0x1c')]({'port':0x232b});var client9002=jayson[_0x35fc('0x1b')][_0x35fc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x227a49,_0x1121fa,_0x480851,_0x26ba54){return new BPromise(function(_0x45c8b7,_0x553677){var _0x41e165=_0x26ba54||client;return _0x41e165[_0x35fc('0x1d')](_0x227a49,_0x480851)[_0x35fc('0x1e')](function(_0x5f56c6){logger[_0x35fc('0x1f')](_0x35fc('0x20'),_0x1121fa,_0x35fc('0x21'));logger['debug'](_0x35fc('0x22'),_0x1121fa,_0x35fc('0x21'),JSON[_0x35fc('0x23')](_0x5f56c6));if(_0x5f56c6[_0x35fc('0x24')]){if(_0x5f56c6[_0x35fc('0x24')][_0x35fc('0x25')]===0x1f4){logger[_0x35fc('0x24')](_0x35fc('0x20'),_0x1121fa,_0x5f56c6[_0x35fc('0x24')][_0x35fc('0x26')]);return _0x553677(_0x5f56c6['error'][_0x35fc('0x26')]);}logger[_0x35fc('0x24')](_0x35fc('0x20'),_0x1121fa,_0x5f56c6[_0x35fc('0x24')][_0x35fc('0x26')]);return _0x45c8b7(_0x5f56c6['error'][_0x35fc('0x26')]);}else{logger[_0x35fc('0x1f')]('MailMessage,\x20%s,\x20%s',_0x1121fa,_0x35fc('0x21'));_0x45c8b7(_0x5f56c6[_0x35fc('0x27')][_0x35fc('0x26')]);}})['catch'](function(_0x4086e9){logger['error'](_0x35fc('0x20'),_0x1121fa,_0x4086e9);_0x553677(_0x4086e9);});});}function respondWithStatusCode(_0xdfab9f,_0x5cb986){_0x5cb986=_0x5cb986||0xcc;return function(_0x519264){if(_0x519264){return _0xdfab9f[_0x35fc('0x28')](_0x5cb986);}return _0xdfab9f['status'](_0x5cb986)[_0x35fc('0x29')]();};}function respondWithResult(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0xc8;return function(_0x26b7cb){if(_0x26b7cb){return _0x1a5d92[_0x35fc('0x2a')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);}};}function respondWithFilteredResult(_0x9f3c8a,_0x3735da){return function(_0x134dfa){if(_0x134dfa){var _0x11ccdb=typeof _0x3735da[_0x35fc('0x2c')]==='undefined'&&typeof _0x3735da[_0x35fc('0x2d')]===_0x35fc('0x2e');var _0x22af18=_0x134dfa['count'];var _0xe79f52=_0x11ccdb?0x0:_0x3735da[_0x35fc('0x2c')];var _0x3822a8=_0x11ccdb?_0x134dfa[_0x35fc('0x2f')]:_0x3735da[_0x35fc('0x2c')]+_0x3735da[_0x35fc('0x2d')];var _0x222ddb;if(_0x3822a8>=_0x22af18){_0x3822a8=_0x22af18;_0x222ddb=0xc8;}else{_0x222ddb=0xce;}_0x9f3c8a[_0x35fc('0x2a')](_0x222ddb);return _0x9f3c8a[_0x35fc('0x30')](_0x35fc('0x31'),_0xe79f52+'-'+_0x3822a8+'/'+_0x22af18)['json'](_0x134dfa);}return null;};}function patchUpdates(_0x5e0313){return function(_0x114bc1){try{jsonpatch['apply'](_0x114bc1,_0x5e0313,!![]);}catch(_0x37b394){return BPromise[_0x35fc('0x32')](_0x37b394);}return _0x114bc1[_0x35fc('0x33')]();};}function saveUpdates(_0x227471,_0x271ba9){return function(_0x12e78f){if(_0x12e78f){return _0x12e78f['update'](_0x227471)[_0x35fc('0x1e')](function(_0x330a14){return _0x330a14;});}return null;};}function removeEntity(_0x46b9ef,_0x4441d8){return function(_0x2bbd36){if(_0x2bbd36){return _0x2bbd36[_0x35fc('0x34')]()['then'](function(){_0x46b9ef[_0x35fc('0x2a')](0xcc)[_0x35fc('0x29')]();});}};}function handleEntityNotFound(_0x1fecdf,_0x52f53d){return function(_0x2c657d){if(!_0x2c657d){_0x1fecdf['sendStatus'](0x194);}return _0x2c657d;};}function handleError(_0x2ecb2e,_0x33a377){_0x33a377=_0x33a377||0x1f4;return function(_0x266a11){logger[_0x35fc('0x24')](_0x266a11['stack']);if(_0x266a11['name']){delete _0x266a11['name'];}_0x2ecb2e[_0x35fc('0x2a')](_0x33a377)['send'](_0x266a11);};}exports[_0x35fc('0x35')]=function(_0x4b4d4a,_0x9c6b65){var _0x1f2d66={},_0x2ca9ac={},_0x22b724={'count':0x0,'rows':[]};var _0x1c10e0=_[_0x35fc('0x36')](db[_0x35fc('0x37')]['rawAttributes'],function(_0x4467f8){return{'name':_0x4467f8[_0x35fc('0x38')],'type':_0x4467f8['type'][_0x35fc('0x39')]};});_0x2ca9ac[_0x35fc('0x3a')]=_[_0x35fc('0x36')](_0x1c10e0,_0x35fc('0x3b'));_0x2ca9ac[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x4b4d4a['query']);_0x2ca9ac[_0x35fc('0x3e')]=_[_0x35fc('0x3f')](_0x2ca9ac[_0x35fc('0x3a')],_0x2ca9ac['query']);_0x1f2d66[_0x35fc('0x40')]=_[_0x35fc('0x3f')](_0x2ca9ac['model'],qs[_0x35fc('0x41')](_0x4b4d4a[_0x35fc('0x3c')][_0x35fc('0x41')]));_0x1f2d66[_0x35fc('0x40')]=_0x1f2d66[_0x35fc('0x40')][_0x35fc('0x42')]?_0x1f2d66[_0x35fc('0x40')]:_0x2ca9ac[_0x35fc('0x3a')];if(!_0x4b4d4a['query']['hasOwnProperty'](_0x35fc('0x43'))){_0x1f2d66[_0x35fc('0x2d')]=qs['limit'](_0x4b4d4a['query']['limit']);_0x1f2d66[_0x35fc('0x2c')]=qs[_0x35fc('0x2c')](_0x4b4d4a['query'][_0x35fc('0x2c')]);}_0x1f2d66[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x4b4d4a[_0x35fc('0x3c')]['sort']);_0x1f2d66['where']=qs['filters'](_['pick'](_0x4b4d4a['query'],_0x2ca9ac[_0x35fc('0x3e')]),_0x1c10e0);if(_0x4b4d4a[_0x35fc('0x3c')]['filter']){_0x1f2d66[_0x35fc('0x46')]=_['merge'](_0x1f2d66[_0x35fc('0x46')],{'$or':_[_0x35fc('0x36')](_0x1c10e0,function(_0x350237){if(_0x350237[_0x35fc('0x47')]!==_0x35fc('0x48')){var _0x5d3d0f={};_0x5d3d0f[_0x350237[_0x35fc('0x3b')]]={'$like':'%'+_0x4b4d4a[_0x35fc('0x3c')]['filter']+'%'};return _0x5d3d0f;}})});}_0x1f2d66=_[_0x35fc('0x49')]({},_0x1f2d66,_0x4b4d4a[_0x35fc('0x4a')]);var _0x2a8a09={'where':_0x1f2d66[_0x35fc('0x46')]};return db['MailMessage'][_0x35fc('0x2f')](_0x2a8a09)['then'](function(_0x583f67){_0x22b724[_0x35fc('0x2f')]=_0x583f67;if(_0x4b4d4a[_0x35fc('0x3c')][_0x35fc('0x4b')]){_0x1f2d66[_0x35fc('0x4c')]=[{'all':!![]}];}return db[_0x35fc('0x37')][_0x35fc('0x4d')](_0x1f2d66);})[_0x35fc('0x1e')](function(_0x16afa6){_0x22b724['rows']=_0x16afa6;return _0x22b724;})[_0x35fc('0x1e')](respondWithFilteredResult(_0x9c6b65,_0x1f2d66))[_0x35fc('0x4e')](handleError(_0x9c6b65,null));};exports[_0x35fc('0x4f')]=function(_0x40b5c7,_0x2ad481){var _0x1e3221={'raw':!![],'where':{'id':_0x40b5c7[_0x35fc('0x50')]['id']}},_0x1b8229={};_0x1b8229[_0x35fc('0x3a')]=_[_0x35fc('0x3d')](db[_0x35fc('0x37')][_0x35fc('0x51')]);_0x1b8229[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x40b5c7['query']);_0x1b8229['filters']=_[_0x35fc('0x3f')](_0x1b8229[_0x35fc('0x3a')],_0x1b8229[_0x35fc('0x3c')]);_0x1e3221[_0x35fc('0x40')]=_[_0x35fc('0x3f')](_0x1b8229[_0x35fc('0x3a')],qs['fields'](_0x40b5c7['query'][_0x35fc('0x41')]));_0x1e3221[_0x35fc('0x40')]=_0x1e3221[_0x35fc('0x40')][_0x35fc('0x42')]?_0x1e3221['attributes']:_0x1b8229[_0x35fc('0x3a')];if(_0x40b5c7[_0x35fc('0x3c')]['includeAll']){_0x1e3221[_0x35fc('0x4c')]=[{'all':!![]}];}_0x1e3221=_[_0x35fc('0x49')]({},_0x1e3221,_0x40b5c7['options']);return db[_0x35fc('0x37')][_0x35fc('0x52')](_0x1e3221)[_0x35fc('0x1e')](handleEntityNotFound(_0x2ad481,null))[_0x35fc('0x1e')](respondWithResult(_0x2ad481,null))['catch'](handleError(_0x2ad481,null));};exports['update']=function(_0x502a15,_0x240338){if(_0x502a15[_0x35fc('0x53')]['id']){delete _0x502a15['body']['id'];}return db[_0x35fc('0x37')][_0x35fc('0x52')]({'where':{'id':_0x502a15[_0x35fc('0x50')]['id']}})[_0x35fc('0x1e')](handleEntityNotFound(_0x240338,null))[_0x35fc('0x1e')](saveUpdates(_0x502a15['body'],null))[_0x35fc('0x1e')](respondWithResult(_0x240338,null))[_0x35fc('0x4e')](handleError(_0x240338,null));};exports[_0x35fc('0x34')]=function(_0x509e77,_0x304dba){return db[_0x35fc('0x37')]['find']({'where':{'id':_0x509e77[_0x35fc('0x50')]['id']}})[_0x35fc('0x1e')](handleEntityNotFound(_0x304dba,null))[_0x35fc('0x1e')](removeEntity(_0x304dba,null))[_0x35fc('0x4e')](handleError(_0x304dba,null));};exports[_0x35fc('0x54')]=function(_0x41453b,_0x8501d1){return db[_0x35fc('0x37')]['describe']()[_0x35fc('0x1e')](respondWithResult(_0x8501d1,null))[_0x35fc('0x4e')](handleError(_0x8501d1,null));};exports[_0x35fc('0x55')]=function(_0x4fabd4,_0x243871){return db['MailMessage']['create'](_0x4fabd4['body'])[_0x35fc('0x1e')](function(_0xb1c68a){if(_0xb1c68a){if(_0xb1c68a[_0x35fc('0x56')]===_0x35fc('0x57')&&!_0xb1c68a[_0x35fc('0x58')]){var _0x4bbea0,_0x579f5a,_0x5353ea;if(_0x4fabd4['body']['to']){_0x579f5a=_0x4fabd4['body']['to'][_0x35fc('0x59')](',')[0x0];}return db[_0x35fc('0x5a')][_0x35fc('0x5b')]({'where':{'id':_0xb1c68a[_0x35fc('0x5c')]},'include':[{'model':db['CmList'],'as':_0x35fc('0x5d'),'include':[{'model':db[_0x35fc('0x5e')],'as':_0x35fc('0x5f'),'where':{'email':_0x579f5a},'limit':0x1,'order':[[_0x35fc('0x60'),_0x35fc('0x61')]]}]},{'model':db[_0x35fc('0x62')],'as':_0x35fc('0x63'),'raw':!![]}]})[_0x35fc('0x1e')](function(_0x462ceb){_0x4bbea0=_0x462ceb;if(_0x4bbea0&&_0x4bbea0['Smtp']){var _0x35d7c8={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x64')])){_0x35d7c8[_0x35fc('0x65')]=_0x4bbea0[_0x35fc('0x63')]['host'];_0x35d7c8[_0x35fc('0x66')]=_0x4bbea0['Smtp']['port'];_0x35d7c8['secure']=_0x4bbea0[_0x35fc('0x63')]['secure'];if(_0x4bbea0[_0x35fc('0x63')]['authentication']){_0x35d7c8[_0x35fc('0x67')]={'user':_0x4bbea0['Smtp'][_0x35fc('0x68')],'pass':_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x69')]};}}else{_0x35d7c8[_0x35fc('0x64')]=_0x4bbea0['Smtp'][_0x35fc('0x64')];_0x35d7c8[_0x35fc('0x67')]={'user':_0x4bbea0[_0x35fc('0x63')]['user'],'pass':_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x69')]};_0x35d7c8[_0x35fc('0x6a')]=_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x6a')];}if(_0x4fabd4[_0x35fc('0x53')][_0x35fc('0x6b')]&&_0x4fabd4[_0x35fc('0x53')]['attachments'][_0x35fc('0x42')]){for(var _0x2008b3=0x0;_0x2008b3<_0x4fabd4[_0x35fc('0x53')]['attachments'][_0x35fc('0x42')];_0x2008b3+=0x1){_0x4fabd4[_0x35fc('0x53')]['attachments'][_0x2008b3]={'filename':_0x4fabd4['body'][_0x35fc('0x6b')][_0x2008b3]['name'],'path':path[_0x35fc('0x6c')](config[_0x35fc('0x6d')],_0x35fc('0x6e'),_0x4fabd4[_0x35fc('0x53')][_0x35fc('0x6b')][_0x2008b3][_0x35fc('0x6f')])};}}_0x5353ea={'account':_0x35d7c8,'message':_0x4fabd4[_0x35fc('0x53')]};return;}})[_0x35fc('0x1e')](function(){if(_0x4bbea0[_0x35fc('0x5d')]){if(_0x4bbea0[_0x35fc('0x5d')][_0x35fc('0x5f')][_0x35fc('0x42')]){return _0x4bbea0[_0x35fc('0x5d')][_0x35fc('0x5f')][0x0];}else{return db[_0x35fc('0x5e')][_0x35fc('0x55')](_[_0x35fc('0x70')](_0x4fabd4[_0x35fc('0x53')],{'firstName':_0x4fabd4[_0x35fc('0x53')]['to'],'email':_0x4fabd4[_0x35fc('0x53')]['to'],'phone':_0x4fabd4['body']['to'],'ListId':_0x4bbea0[_0x35fc('0x71')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x35fc('0x1e')](function(){if(_0x5353ea){return respondWithRpcPromise(_0x35fc('0x72'),_0x35fc('0x73'),_0x5353ea,client9003)[_0x35fc('0x1e')](function(_0x25af78){return _0xb1c68a[_0x35fc('0x74')]({'read':!![],'messageId':_0x25af78[_0x35fc('0x75')],'sentAt':moment()[_0x35fc('0x76')](_0x35fc('0x77'))});})[_0x35fc('0x4e')](function(_0x2ee880){logger['error']('%s',JSON[_0x35fc('0x23')](_0x2ee880));return _0xb1c68a;});}return _0xb1c68a;});}return _0xb1c68a;}})[_0x35fc('0x1e')](respondWithResult(_0x243871,0xc9))[_0x35fc('0x4e')](handleError(_0x243871,null));};var interaction_log=require(_0x35fc('0x13'))(_0x35fc('0x78'));exports[_0x35fc('0x79')]=function(_0x5416cd,_0x43ef1f,_0x3353e0){var _0x277514={'agent':{},'channel':_0x35fc('0x7a')};if(_0x5416cd[_0x35fc('0x53')]['id']){delete _0x5416cd[_0x35fc('0x53')]['id'];}_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7b')]=!![];_0x5416cd[_0x35fc('0x53')]['readAt']=moment()[_0x35fc('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7c')]=_0x5416cd['body'][_0x35fc('0x7c')]||_0x5416cd[_0x35fc('0x68')]['id'];_0x277514[_0x35fc('0x7d')]['id']=_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7c')];return db[_0x35fc('0x37')][_0x35fc('0x52')]({'where':{'id':_0x5416cd[_0x35fc('0x50')]['id'],'UserId':null}})[_0x35fc('0x1e')](handleEntityNotFound(_0x43ef1f,null))['then'](saveUpdates(_0x5416cd['body'],null))['then'](function(_0x531117){if(_0x531117){_0x277514[_0x35fc('0x26')]=_0x531117[_0x35fc('0x7e')]({'plain':!![]});return db[_0x35fc('0x7f')][_0x35fc('0x52')]({'where':{'id':_0x531117[_0x35fc('0x80')]}});}return null;})['then'](handleEntityNotFound(_0x43ef1f,null))[_0x35fc('0x1e')](function(_0x19682e){if(_0x19682e){return _0x19682e[_0x35fc('0x74')]({'UserId':_0x5416cd[_0x35fc('0x53')]['UserId'],'read1stAt':_[_0x35fc('0x81')](_0x19682e[_0x35fc('0x82')])?moment()[_0x35fc('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x35fc('0x1e')](function(_0xb94316){if(_0xb94316){_0x277514[_0x35fc('0x83')]=_0xb94316[_0x35fc('0x7e')]({'plain':!![]});interaction_log[_0x35fc('0x1f')](_0x35fc('0x84'),_0x5416cd[_0x35fc('0x68')]['id'],_0x5416cd[_0x35fc('0x68')]['name'],_0x5416cd[_0x35fc('0x68')][_0x35fc('0x85')],_0x277514[_0x35fc('0x83')]['id'],_0x5416cd[_0x35fc('0x53')]?JSON[_0x35fc('0x23')](_0x5416cd[_0x35fc('0x53')]):'null');return respondWithRpcPromise(_0x35fc('0x86'),'acceptMessage',_0x277514);}return null;})['then'](function(_0x1a2da0){var _0x597670=_0x35fc('0x87')+_0x1a2da0[_0x35fc('0x26')][_0x35fc('0x88')];return db['sequelize'][_0x35fc('0x3c')](_0x597670,{'type':db[_0x35fc('0x89')][_0x35fc('0x8a')][_0x35fc('0x8b')],'raw':!![]})[_0x35fc('0x1e')](function(_0x5abdf9){return _0x5abdf9;});})['then'](function(_0x487cb5){if(_0x487cb5){_0x277514[_0x35fc('0x26')]['contact']=_0x487cb5[0x0];if(!_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7c')])return;return db[_0x35fc('0x8c')][_0x35fc('0x52')]({'where':{'id':_0x5416cd['body'][_0x35fc('0x7c')],'role':_0x35fc('0x7d')},'attributes':['id',_0x35fc('0x3b'),'fullname',_0x35fc('0x8d'),_0x35fc('0x8e')],'raw':!![]});}return null;})[_0x35fc('0x1e')](function(_0x5957bc){if(!_0x5957bc)return null;_0x277514['message']['agent']=_0x5957bc;return _0x277514;})[_0x35fc('0x1e')](function(_0x2edb1b){if(_0x2edb1b){if(_0x5416cd[_0x35fc('0x53')][_0x35fc('0x8f')]){_0x277514['message'][_0x35fc('0x90')]=util[_0x35fc('0x76')]('SIP/%s',_0x5416cd['user'][_0x35fc('0x3b')]);_0x277514[_0x35fc('0x26')][_0x35fc('0x91')]=_0x277514['channel'];_0x277514['message'][_0x35fc('0x92')]=_0x35fc('0x79');_0x277514['message'][_0x35fc('0x53')]=htmlToText[_0x35fc('0x93')](_0x277514[_0x35fc('0x26')]['body']);return respondWithRpcPromise(_0x35fc('0x94'),_0x35fc('0x94'),{'event':_0x35fc('0x95'),'message':_0x277514[_0x35fc('0x26')]},client9002)['then'](function(){return _0x277514;});}return _0x277514;}return null;})[_0x35fc('0x1e')](respondWithResult(_0x43ef1f,null))[_0x35fc('0x4e')](handleError(_0x43ef1f,null));};var interaction_log=require(_0x35fc('0x13'))('mail-interactions');exports[_0x35fc('0x32')]=function(_0x26d242,_0x425f72,_0x5c6c2b){var _0x30d779={'agent':{},'channel':_0x35fc('0x7a')};if(_0x26d242['body']['id']){delete _0x26d242[_0x35fc('0x53')]['id'];}_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')]=_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')]||_0x26d242[_0x35fc('0x68')]['id'];_0x30d779[_0x35fc('0x7d')]['id']=_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')];return db['MailMessage'][_0x35fc('0x52')]({'where':{'id':_0x26d242[_0x35fc('0x50')]['id'],'UserId':null}})[_0x35fc('0x1e')](handleEntityNotFound(_0x425f72,null))[_0x35fc('0x1e')](function(_0x53857f){if(_0x53857f){_0x30d779[_0x35fc('0x26')]=_0x53857f[_0x35fc('0x7e')]({'plain':!![]});return db[_0x35fc('0x7f')][_0x35fc('0x52')]({'where':{'id':_0x53857f[_0x35fc('0x80')]}});}return null;})[_0x35fc('0x1e')](handleEntityNotFound(_0x425f72,null))[_0x35fc('0x1e')](function(_0xeedb53){if(_0xeedb53){_0x30d779['interaction']=_0xeedb53['get']({'plain':!![]});interaction_log[_0x35fc('0x1f')](_0x35fc('0x96'),_0x26d242[_0x35fc('0x68')]['id'],_0x26d242['user'][_0x35fc('0x3b')],_0x26d242[_0x35fc('0x68')][_0x35fc('0x85')],_0x30d779[_0x35fc('0x83')]['id'],_0x26d242['body']?JSON['stringify'](_0x26d242[_0x35fc('0x53')]):'null');return respondWithRpcPromise(_0x35fc('0x97'),_0x35fc('0x98'),_0x30d779);}return null;})['then'](function(_0x52712e){var _0x471c59=_0x35fc('0x87')+_0x52712e[_0x35fc('0x26')]['ContactId'];return db[_0x35fc('0x99')][_0x35fc('0x3c')](_0x471c59,{'type':db[_0x35fc('0x89')]['QueryTypes'][_0x35fc('0x8b')],'raw':!![]})[_0x35fc('0x1e')](function(_0x18b4bd){return _0x18b4bd;});})[_0x35fc('0x1e')](function(_0x5f374c){if(_0x5f374c){_0x30d779[_0x35fc('0x26')][_0x35fc('0x9a')]=_0x5f374c[0x0];if(!_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')])return;return db[_0x35fc('0x8c')][_0x35fc('0x52')]({'where':{'id':_0x26d242['body'][_0x35fc('0x7c')],'role':_0x35fc('0x7d')},'attributes':['id','name',_0x35fc('0x9b'),_0x35fc('0x8d'),'internal'],'raw':!![]});}return null;})[_0x35fc('0x1e')](function(_0x31541e){if(!_0x31541e)return null;_0x30d779[_0x35fc('0x26')][_0x35fc('0x7d')]=_0x31541e;return _0x30d779;})[_0x35fc('0x1e')](function(_0x51e8fb){if(_0x51e8fb){_0x51e8fb[_0x35fc('0x26')][_0x35fc('0x90')]=util[_0x35fc('0x76')]('SIP/%s',_0x26d242[_0x35fc('0x68')]['name']);_0x51e8fb['message'][_0x35fc('0x91')]=_0x30d779[_0x35fc('0x91')];_0x51e8fb[_0x35fc('0x26')][_0x35fc('0x92')]=_0x35fc('0x32');_0x51e8fb['message'][_0x35fc('0x53')]=htmlToText[_0x35fc('0x93')](_0x30d779[_0x35fc('0x26')]['body']);respondWithRpcPromise(_0x35fc('0x94'),_0x35fc('0x94'),{'event':_0x35fc('0x9c'),'message':_0x51e8fb[_0x35fc('0x26')]},client9002);return _0x30d779;}return null;})[_0x35fc('0x1e')](respondWithResult(_0x425f72,null))['catch'](handleError(_0x425f72,null));};exports[_0x35fc('0x9d')]=function(_0x1bd27f,_0x47b52e){var _0x4d4e5f=moment()[_0x35fc('0x9e')]()[_0x35fc('0x9f')]();var _0x207336=path[_0x35fc('0x6c')](config[_0x35fc('0x6d')],_0x35fc('0xa0'),_0x35fc('0xa1'),'tmp');var _0x5dc286=path[_0x35fc('0x6c')](config[_0x35fc('0x6d')],_0x35fc('0xa0'),_0x35fc('0xa1'),_0x35fc('0x6b'));var _0x4e40ad=util['format'](_0x35fc('0xa2'),_0x4d4e5f);return db[_0x35fc('0x37')][_0x35fc('0x52')]({'where':{'id':_0x1bd27f[_0x35fc('0x50')]['id']},'attributes':['id','body','from','to','cc',_0x35fc('0xa3'),_0x35fc('0xa4'),_0x35fc('0xa5')],'include':_0x1bd27f[_0x35fc('0x3c')]['attachments']?[{'model':db['Attachment'],'as':_0x35fc('0xa6')}]:undefined})[_0x35fc('0x1e')](handleEntityNotFound(_0x47b52e,null))['then'](function(_0x6382dd){if(_0x6382dd){var _0x155ee2=_0x6382dd;var _0x2e9097={'from':_0x155ee2[_0x35fc('0xa7')],'to':_0x155ee2['to'],'subject':_0x155ee2[_0x35fc('0xa4')],'html':_0x155ee2[_0x35fc('0x53')],'headers':{'Date':moment(_0x155ee2[_0x35fc('0xa5')])[_0x35fc('0x76')](_0x35fc('0xa8'))},'attachments':[]};if(_0x6382dd['cc']){_0x2e9097[_0x35fc('0xa9')]['Cc']=_0x6382dd['cc'];}if(_0x6382dd[_0x35fc('0xa3')]){_0x2e9097[_0x35fc('0xa9')][_0x35fc('0xaa')]=_0x6382dd[_0x35fc('0xa3')];}return new BPromise(function(_0x3e1b55,_0x70cca3){if(_0x6382dd['Attachments']){for(var _0x345026=0x0;_0x345026<_0x6382dd['Attachments'][_0x35fc('0x42')];_0x345026++){var _0x5d677a=_0x6382dd['Attachments'][_0x345026];var _0x3c96ef=path[_0x35fc('0x6c')](_0x5dc286,_0x5d677a[_0x35fc('0x6f')]);if(fs['existsSync'](_0x3c96ef)){_0x2e9097[_0x35fc('0x6b')][_0x35fc('0xab')]({'name':_0x5d677a[_0x35fc('0x3b')],'contentType':_0x5d677a[_0x35fc('0x47')],'data':fs[_0x35fc('0xac')](_0x3c96ef)});}}}emlformat[_0x35fc('0xad')](_0x2e9097,function(_0x59f733,_0x4f3342){if(_0x59f733)return _0x70cca3(_0x59f733);fs[_0x35fc('0xae')](path['join'](_0x207336,_0x4e40ad),_0x4f3342);return _0x3e1b55(_0x4f3342);});});}})['then'](function(_0x262f9a){if(_0x262f9a){return _0x47b52e['download'](path['join'](_0x207336,_0x4e40ad),_0x4e40ad,function(_0x5ae83f){if(_0x5ae83f){console[_0x35fc('0xaf')]('err',_0x5ae83f);}else{fs[_0x35fc('0xb0')](path[_0x35fc('0x6c')](_0x207336,_0x4e40ad));}});}})[_0x35fc('0x4e')](handleError(_0x47b52e,null));}; \ No newline at end of file +var _0xcf98=['message','catch','end','status','json','undefined','count','offset','limit','set','apply','reject','save','update','sendStatus','name','send','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','findAll','rows','params','length','find','body','destroy','describe','create','out','secret','split','MailAccount','MailAccountId','CmList','Contacts','updatedAt','DESC','MailServerOut','Smtp','host','port','secure','authentication','auth','user','pass','service','attachments','join','root','server/files/attachments','basename','List','CmContact','defaults','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','channel','event','fromString','EventManager','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','push','readFileSync','writeFileSync','log','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2b5f52,_0x19d973){var _0x4a8839=function(_0x2f52){while(--_0x2f52){_0x2b5f52['push'](_0x2b5f52['shift']());}};_0x4a8839(++_0x19d973);}(_0xcf98,0x8d));var _0x8cf9=function(_0xe570d1,_0x5c286d){_0xe570d1=_0xe570d1-0x0;var _0x2987e9=_0xcf98[_0xe570d1];return _0x2987e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cf9('0x0'));var zipdir=require(_0x8cf9('0x1'));var jsonpatch=require(_0x8cf9('0x2'));var rp=require(_0x8cf9('0x3'));var moment=require(_0x8cf9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8cf9('0x5'));var path=require(_0x8cf9('0x6'));var sox=require(_0x8cf9('0x7'));var csv=require(_0x8cf9('0x8'));var ejs=require(_0x8cf9('0x9'));var fs=require('fs');var fs_extra=require(_0x8cf9('0xa'));var _=require(_0x8cf9('0xb'));var squel=require(_0x8cf9('0xc'));var crypto=require(_0x8cf9('0xd'));var jsforce=require(_0x8cf9('0xe'));var deskjs=require(_0x8cf9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8cf9('0x10'));var Papa=require(_0x8cf9('0x11'));var Redis=require('ioredis');var authService=require(_0x8cf9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8cf9('0x13'));var hardwareService=require(_0x8cf9('0x14'));var logger=require(_0x8cf9('0x15'))(_0x8cf9('0x16'));var utils=require(_0x8cf9('0x17'));var config=require(_0x8cf9('0x18'));var licenseUtil=require(_0x8cf9('0x19'));var htmlToText=require('html-to-text');var db=require(_0x8cf9('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8cf9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8cf9('0x1c'))[_0x8cf9('0x1d')](socket);var jayson=require(_0x8cf9('0x1e'));var client=jayson['client'][_0x8cf9('0x1f')]({'port':0x232c});var client9003=jayson[_0x8cf9('0x20')]['http']({'port':0x232b});var client9002=jayson[_0x8cf9('0x20')][_0x8cf9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2417d8,_0x46a573,_0xbba7f9,_0x160b9f){return new BPromise(function(_0x21f397,_0x21efd3){var _0x309866=_0x160b9f||client;return _0x309866[_0x8cf9('0x21')](_0x2417d8,_0xbba7f9)[_0x8cf9('0x22')](function(_0x2929ee){logger[_0x8cf9('0x23')](_0x8cf9('0x24'),_0x46a573,_0x8cf9('0x25'));logger[_0x8cf9('0x26')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x46a573,'request\x20sent',JSON[_0x8cf9('0x27')](_0x2929ee));if(_0x2929ee['error']){if(_0x2929ee[_0x8cf9('0x28')][_0x8cf9('0x29')]===0x1f4){logger[_0x8cf9('0x28')](_0x8cf9('0x24'),_0x46a573,_0x2929ee[_0x8cf9('0x28')][_0x8cf9('0x2a')]);return _0x21efd3(_0x2929ee[_0x8cf9('0x28')][_0x8cf9('0x2a')]);}logger['error'](_0x8cf9('0x24'),_0x46a573,_0x2929ee['error']['message']);return _0x21f397(_0x2929ee[_0x8cf9('0x28')][_0x8cf9('0x2a')]);}else{logger['info'](_0x8cf9('0x24'),_0x46a573,'request\x20sent');_0x21f397(_0x2929ee['result'][_0x8cf9('0x2a')]);}})[_0x8cf9('0x2b')](function(_0x4fd970){logger[_0x8cf9('0x28')](_0x8cf9('0x24'),_0x46a573,_0x4fd970);_0x21efd3(_0x4fd970);});});}function respondWithStatusCode(_0x170414,_0x36dbcc){_0x36dbcc=_0x36dbcc||0xcc;return function(_0x475566){if(_0x475566){return _0x170414['sendStatus'](_0x36dbcc);}return _0x170414['status'](_0x36dbcc)[_0x8cf9('0x2c')]();};}function respondWithResult(_0x30f245,_0x2a4466){_0x2a4466=_0x2a4466||0xc8;return function(_0x9922a2){if(_0x9922a2){return _0x30f245[_0x8cf9('0x2d')](_0x2a4466)[_0x8cf9('0x2e')](_0x9922a2);}};}function respondWithFilteredResult(_0x13fa60,_0xf08a05){return function(_0x1175a9){if(_0x1175a9){var _0x4ff672=typeof _0xf08a05['offset']===_0x8cf9('0x2f')&&typeof _0xf08a05['limit']===_0x8cf9('0x2f');var _0x2c2e6e=_0x1175a9[_0x8cf9('0x30')];var _0x443ca1=_0x4ff672?0x0:_0xf08a05['offset'];var _0x211629=_0x4ff672?_0x1175a9[_0x8cf9('0x30')]:_0xf08a05[_0x8cf9('0x31')]+_0xf08a05[_0x8cf9('0x32')];var _0xa434c0;if(_0x211629>=_0x2c2e6e){_0x211629=_0x2c2e6e;_0xa434c0=0xc8;}else{_0xa434c0=0xce;}_0x13fa60[_0x8cf9('0x2d')](_0xa434c0);return _0x13fa60[_0x8cf9('0x33')]('Content-Range',_0x443ca1+'-'+_0x211629+'/'+_0x2c2e6e)['json'](_0x1175a9);}return null;};}function patchUpdates(_0x1b9972){return function(_0x2710cf){try{jsonpatch[_0x8cf9('0x34')](_0x2710cf,_0x1b9972,!![]);}catch(_0x2add05){return BPromise[_0x8cf9('0x35')](_0x2add05);}return _0x2710cf[_0x8cf9('0x36')]();};}function saveUpdates(_0x49eb0a,_0x288990){return function(_0x43057b){if(_0x43057b){return _0x43057b[_0x8cf9('0x37')](_0x49eb0a)[_0x8cf9('0x22')](function(_0x2a8688){return _0x2a8688;});}return null;};}function removeEntity(_0x11e272,_0x1d37a3){return function(_0x1df0f9){if(_0x1df0f9){return _0x1df0f9['destroy']()[_0x8cf9('0x22')](function(){_0x11e272[_0x8cf9('0x2d')](0xcc)[_0x8cf9('0x2c')]();});}};}function handleEntityNotFound(_0x4b9cb8,_0x2dcf1f){return function(_0x4ba272){if(!_0x4ba272){_0x4b9cb8[_0x8cf9('0x38')](0x194);}return _0x4ba272;};}function handleError(_0x5a8c30,_0x25870e){_0x25870e=_0x25870e||0x1f4;return function(_0x5a577d){logger[_0x8cf9('0x28')](_0x5a577d['stack']);if(_0x5a577d[_0x8cf9('0x39')]){delete _0x5a577d['name'];}_0x5a8c30['status'](_0x25870e)[_0x8cf9('0x3a')](_0x5a577d);};}exports['index']=function(_0x45f701,_0x5b6d1b){var _0x8ecc6={},_0x4f50ff={},_0x236a22={'count':0x0,'rows':[]};var _0x4542d5=_[_0x8cf9('0x3b')](db[_0x8cf9('0x3c')][_0x8cf9('0x3d')],function(_0x19db48){return{'name':_0x19db48[_0x8cf9('0x3e')],'type':_0x19db48[_0x8cf9('0x3f')][_0x8cf9('0x40')]};});_0x4f50ff[_0x8cf9('0x41')]=_[_0x8cf9('0x3b')](_0x4542d5,_0x8cf9('0x39'));_0x4f50ff[_0x8cf9('0x42')]=_[_0x8cf9('0x43')](_0x45f701['query']);_0x4f50ff[_0x8cf9('0x44')]=_[_0x8cf9('0x45')](_0x4f50ff[_0x8cf9('0x41')],_0x4f50ff[_0x8cf9('0x42')]);_0x8ecc6[_0x8cf9('0x46')]=_[_0x8cf9('0x45')](_0x4f50ff[_0x8cf9('0x41')],qs['fields'](_0x45f701[_0x8cf9('0x42')][_0x8cf9('0x47')]));_0x8ecc6[_0x8cf9('0x46')]=_0x8ecc6[_0x8cf9('0x46')]['length']?_0x8ecc6[_0x8cf9('0x46')]:_0x4f50ff[_0x8cf9('0x41')];if(!_0x45f701[_0x8cf9('0x42')][_0x8cf9('0x48')](_0x8cf9('0x49'))){_0x8ecc6[_0x8cf9('0x32')]=qs[_0x8cf9('0x32')](_0x45f701['query'][_0x8cf9('0x32')]);_0x8ecc6[_0x8cf9('0x31')]=qs[_0x8cf9('0x31')](_0x45f701[_0x8cf9('0x42')]['offset']);}_0x8ecc6['order']=qs[_0x8cf9('0x4a')](_0x45f701[_0x8cf9('0x42')]['sort']);_0x8ecc6[_0x8cf9('0x4b')]=qs[_0x8cf9('0x44')](_[_0x8cf9('0x4c')](_0x45f701[_0x8cf9('0x42')],_0x4f50ff[_0x8cf9('0x44')]),_0x4542d5);if(_0x45f701[_0x8cf9('0x42')]['filter']){_0x8ecc6[_0x8cf9('0x4b')]=_[_0x8cf9('0x4d')](_0x8ecc6['where'],{'$or':_[_0x8cf9('0x3b')](_0x4542d5,function(_0x626fd1){if(_0x626fd1[_0x8cf9('0x3f')]!=='VIRTUAL'){var _0x42755e={};_0x42755e[_0x626fd1[_0x8cf9('0x39')]]={'$like':'%'+_0x45f701['query'][_0x8cf9('0x4e')]+'%'};return _0x42755e;}})});}_0x8ecc6=_['merge']({},_0x8ecc6,_0x45f701['options']);var _0xd5f84b={'where':_0x8ecc6[_0x8cf9('0x4b')]};return db[_0x8cf9('0x3c')][_0x8cf9('0x30')](_0xd5f84b)[_0x8cf9('0x22')](function(_0x14da1a){_0x236a22[_0x8cf9('0x30')]=_0x14da1a;if(_0x45f701['query'][_0x8cf9('0x4f')]){_0x8ecc6[_0x8cf9('0x50')]=[{'all':!![]}];}return db[_0x8cf9('0x3c')][_0x8cf9('0x51')](_0x8ecc6);})['then'](function(_0x18a09e){_0x236a22[_0x8cf9('0x52')]=_0x18a09e;return _0x236a22;})[_0x8cf9('0x22')](respondWithFilteredResult(_0x5b6d1b,_0x8ecc6))['catch'](handleError(_0x5b6d1b,null));};exports['show']=function(_0x4c06a3,_0x18d6a9){var _0x2ca190={'raw':!![],'where':{'id':_0x4c06a3[_0x8cf9('0x53')]['id']}},_0x4d697e={};_0x4d697e[_0x8cf9('0x41')]=_[_0x8cf9('0x43')](db[_0x8cf9('0x3c')][_0x8cf9('0x3d')]);_0x4d697e['query']=_[_0x8cf9('0x43')](_0x4c06a3[_0x8cf9('0x42')]);_0x4d697e[_0x8cf9('0x44')]=_[_0x8cf9('0x45')](_0x4d697e[_0x8cf9('0x41')],_0x4d697e[_0x8cf9('0x42')]);_0x2ca190[_0x8cf9('0x46')]=_['intersection'](_0x4d697e[_0x8cf9('0x41')],qs[_0x8cf9('0x47')](_0x4c06a3[_0x8cf9('0x42')][_0x8cf9('0x47')]));_0x2ca190[_0x8cf9('0x46')]=_0x2ca190[_0x8cf9('0x46')][_0x8cf9('0x54')]?_0x2ca190[_0x8cf9('0x46')]:_0x4d697e[_0x8cf9('0x41')];if(_0x4c06a3[_0x8cf9('0x42')][_0x8cf9('0x4f')]){_0x2ca190[_0x8cf9('0x50')]=[{'all':!![]}];}_0x2ca190=_[_0x8cf9('0x4d')]({},_0x2ca190,_0x4c06a3['options']);return db[_0x8cf9('0x3c')][_0x8cf9('0x55')](_0x2ca190)['then'](handleEntityNotFound(_0x18d6a9,null))[_0x8cf9('0x22')](respondWithResult(_0x18d6a9,null))[_0x8cf9('0x2b')](handleError(_0x18d6a9,null));};exports[_0x8cf9('0x37')]=function(_0x3cbe73,_0x35f5dc){if(_0x3cbe73[_0x8cf9('0x56')]['id']){delete _0x3cbe73[_0x8cf9('0x56')]['id'];}return db[_0x8cf9('0x3c')][_0x8cf9('0x55')]({'where':{'id':_0x3cbe73[_0x8cf9('0x53')]['id']}})[_0x8cf9('0x22')](handleEntityNotFound(_0x35f5dc,null))['then'](saveUpdates(_0x3cbe73[_0x8cf9('0x56')],null))['then'](respondWithResult(_0x35f5dc,null))['catch'](handleError(_0x35f5dc,null));};exports[_0x8cf9('0x57')]=function(_0x77a403,_0x5d03a4){return db[_0x8cf9('0x3c')][_0x8cf9('0x55')]({'where':{'id':_0x77a403['params']['id']}})[_0x8cf9('0x22')](handleEntityNotFound(_0x5d03a4,null))[_0x8cf9('0x22')](removeEntity(_0x5d03a4,null))[_0x8cf9('0x2b')](handleError(_0x5d03a4,null));};exports[_0x8cf9('0x58')]=function(_0x3f9245,_0x35c3d6){return db['MailMessage'][_0x8cf9('0x58')]()['then'](respondWithResult(_0x35c3d6,null))[_0x8cf9('0x2b')](handleError(_0x35c3d6,null));};exports['create']=function(_0x5614d4,_0x2737b6){return db['MailMessage'][_0x8cf9('0x59')](_0x5614d4['body'])[_0x8cf9('0x22')](function(_0xde1219){if(_0xde1219){if(_0xde1219['direction']===_0x8cf9('0x5a')&&!_0xde1219[_0x8cf9('0x5b')]){var _0x4a7f75,_0x5e270b,_0x63486c;if(_0x5614d4[_0x8cf9('0x56')]['to']){_0x5e270b=_0x5614d4['body']['to'][_0x8cf9('0x5c')](',')[0x0];}return db[_0x8cf9('0x5d')]['findOne']({'where':{'id':_0xde1219[_0x8cf9('0x5e')]},'include':[{'model':db[_0x8cf9('0x5f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8cf9('0x60'),'where':{'email':_0x5e270b},'limit':0x1,'order':[[_0x8cf9('0x61'),_0x8cf9('0x62')]]}]},{'model':db[_0x8cf9('0x63')],'as':'Smtp','raw':!![]}]})[_0x8cf9('0x22')](function(_0x5fc6fe){_0x4a7f75=_0x5fc6fe;if(_0x4a7f75&&_0x4a7f75[_0x8cf9('0x64')]){var _0x5bda72={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4a7f75[_0x8cf9('0x64')]['service'])){_0x5bda72[_0x8cf9('0x65')]=_0x4a7f75[_0x8cf9('0x64')][_0x8cf9('0x65')];_0x5bda72[_0x8cf9('0x66')]=_0x4a7f75['Smtp']['port'];_0x5bda72[_0x8cf9('0x67')]=_0x4a7f75[_0x8cf9('0x64')]['secure'];if(_0x4a7f75['Smtp'][_0x8cf9('0x68')]){_0x5bda72[_0x8cf9('0x69')]={'user':_0x4a7f75[_0x8cf9('0x64')][_0x8cf9('0x6a')],'pass':_0x4a7f75[_0x8cf9('0x64')][_0x8cf9('0x6b')]};}}else{_0x5bda72[_0x8cf9('0x6c')]=_0x4a7f75['Smtp']['service'];_0x5bda72['auth']={'user':_0x4a7f75[_0x8cf9('0x64')]['user'],'pass':_0x4a7f75['Smtp']['pass']};_0x5bda72['secure']=_0x4a7f75[_0x8cf9('0x64')][_0x8cf9('0x67')];}if(_0x5614d4[_0x8cf9('0x56')][_0x8cf9('0x6d')]&&_0x5614d4['body'][_0x8cf9('0x6d')]['length']){for(var _0x50046b=0x0;_0x50046b<_0x5614d4[_0x8cf9('0x56')]['attachments'][_0x8cf9('0x54')];_0x50046b+=0x1){_0x5614d4[_0x8cf9('0x56')][_0x8cf9('0x6d')][_0x50046b]={'filename':_0x5614d4['body'][_0x8cf9('0x6d')][_0x50046b]['name'],'path':path[_0x8cf9('0x6e')](config[_0x8cf9('0x6f')],_0x8cf9('0x70'),_0x5614d4[_0x8cf9('0x56')][_0x8cf9('0x6d')][_0x50046b][_0x8cf9('0x71')])};}}_0x63486c={'account':_0x5bda72,'message':_0x5614d4[_0x8cf9('0x56')]};return;}})[_0x8cf9('0x22')](function(){if(_0x4a7f75[_0x8cf9('0x72')]){if(_0x4a7f75['List'][_0x8cf9('0x60')]['length']){return _0x4a7f75[_0x8cf9('0x72')][_0x8cf9('0x60')][0x0];}else{return db[_0x8cf9('0x73')][_0x8cf9('0x59')](_[_0x8cf9('0x74')](_0x5614d4[_0x8cf9('0x56')],{'firstName':_0x5614d4[_0x8cf9('0x56')]['to'],'email':_0x5614d4[_0x8cf9('0x56')]['to'],'phone':_0x5614d4[_0x8cf9('0x56')]['to'],'ListId':_0x4a7f75[_0x8cf9('0x75')]}));}}else{throw new Error(_0x8cf9('0x76'));}})[_0x8cf9('0x22')](function(){if(_0x63486c){return respondWithRpcPromise(_0x8cf9('0x77'),'sendMail',_0x63486c,client9003)[_0x8cf9('0x22')](function(_0x405324){return _0xde1219[_0x8cf9('0x37')]({'read':!![],'messageId':_0x405324[_0x8cf9('0x78')],'sentAt':moment()[_0x8cf9('0x79')](_0x8cf9('0x7a'))});})[_0x8cf9('0x2b')](function(_0x4917cc){logger[_0x8cf9('0x28')]('%s',JSON[_0x8cf9('0x27')](_0x4917cc));return _0xde1219;});}return _0xde1219;});}return _0xde1219;}})[_0x8cf9('0x22')](respondWithResult(_0x2737b6,0xc9))['catch'](handleError(_0x2737b6,null));};var interaction_log=require('../../config/logger')(_0x8cf9('0x7b'));exports[_0x8cf9('0x7c')]=function(_0x34df06,_0x32c94a,_0x4536dc){var _0xbe7cd={'agent':{},'channel':'mail'};if(_0x34df06['body']['id']){delete _0x34df06[_0x8cf9('0x56')]['id'];}_0x34df06[_0x8cf9('0x56')][_0x8cf9('0x7d')]=!![];_0x34df06['body'][_0x8cf9('0x7e')]=moment()[_0x8cf9('0x79')](_0x8cf9('0x7a'));_0x34df06[_0x8cf9('0x56')][_0x8cf9('0x7f')]=_0x34df06[_0x8cf9('0x56')][_0x8cf9('0x7f')]||_0x34df06[_0x8cf9('0x6a')]['id'];_0xbe7cd[_0x8cf9('0x80')]['id']=_0x34df06[_0x8cf9('0x56')][_0x8cf9('0x7f')];return db[_0x8cf9('0x3c')][_0x8cf9('0x55')]({'where':{'id':_0x34df06['params']['id'],'UserId':null}})[_0x8cf9('0x22')](handleEntityNotFound(_0x32c94a,null))[_0x8cf9('0x22')](saveUpdates(_0x34df06[_0x8cf9('0x56')],null))[_0x8cf9('0x22')](function(_0x547b8f){if(_0x547b8f){_0xbe7cd[_0x8cf9('0x2a')]=_0x547b8f[_0x8cf9('0x81')]({'plain':!![]});return db[_0x8cf9('0x82')][_0x8cf9('0x55')]({'where':{'id':_0x547b8f[_0x8cf9('0x83')]}});}return null;})[_0x8cf9('0x22')](handleEntityNotFound(_0x32c94a,null))[_0x8cf9('0x22')](function(_0xcd0edb){if(_0xcd0edb){return _0xcd0edb[_0x8cf9('0x37')]({'UserId':_0x34df06[_0x8cf9('0x56')][_0x8cf9('0x7f')],'read1stAt':_[_0x8cf9('0x84')](_0xcd0edb[_0x8cf9('0x85')])?moment()[_0x8cf9('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8cf9('0x22')](function(_0x29588e){if(_0x29588e){_0xbe7cd[_0x8cf9('0x86')]=_0x29588e['get']({'plain':!![]});interaction_log[_0x8cf9('0x23')](_0x8cf9('0x87'),_0x34df06[_0x8cf9('0x6a')]['id'],_0x34df06['user'][_0x8cf9('0x39')],_0x34df06['user'][_0x8cf9('0x88')],_0xbe7cd[_0x8cf9('0x86')]['id'],_0x34df06[_0x8cf9('0x56')]?JSON[_0x8cf9('0x27')](_0x34df06['body']):_0x8cf9('0x89'));return respondWithRpcPromise(_0x8cf9('0x8a'),_0x8cf9('0x8b'),_0xbe7cd);}return null;})['then'](function(_0x3ee4e9){var _0x207d3f=_0x8cf9('0x8c')+_0x3ee4e9[_0x8cf9('0x2a')]['ContactId'];return db[_0x8cf9('0x8d')]['query'](_0x207d3f,{'type':db[_0x8cf9('0x8e')][_0x8cf9('0x8f')][_0x8cf9('0x90')],'raw':!![]})[_0x8cf9('0x22')](function(_0x4edd1b){return _0x4edd1b;});})[_0x8cf9('0x22')](function(_0x3f3ab1){if(_0x3f3ab1){_0xbe7cd[_0x8cf9('0x2a')]['contact']=_0x3f3ab1[0x0];if(!_0x34df06[_0x8cf9('0x56')][_0x8cf9('0x7f')])return;return db[_0x8cf9('0x91')][_0x8cf9('0x55')]({'where':{'id':_0x34df06[_0x8cf9('0x56')][_0x8cf9('0x7f')],'role':_0x8cf9('0x80')},'attributes':['id',_0x8cf9('0x39'),_0x8cf9('0x92'),_0x8cf9('0x93'),_0x8cf9('0x94')],'raw':!![]});}return null;})['then'](function(_0x84f8cc){if(!_0x84f8cc)return null;_0xbe7cd['message']['agent']=_0x84f8cc;return _0xbe7cd;})[_0x8cf9('0x22')](function(_0x3f3a61){if(_0x3f3a61){if(_0x34df06['body'][_0x8cf9('0x95')]){_0xbe7cd[_0x8cf9('0x2a')][_0x8cf9('0x96')]=util[_0x8cf9('0x79')]('SIP/%s',_0x34df06[_0x8cf9('0x6a')][_0x8cf9('0x39')]);_0xbe7cd[_0x8cf9('0x2a')][_0x8cf9('0x97')]=_0xbe7cd[_0x8cf9('0x97')];_0xbe7cd[_0x8cf9('0x2a')][_0x8cf9('0x98')]=_0x8cf9('0x7c');_0xbe7cd['message'][_0x8cf9('0x56')]=htmlToText[_0x8cf9('0x99')](_0xbe7cd['message'][_0x8cf9('0x56')]);return respondWithRpcPromise(_0x8cf9('0x9a'),_0x8cf9('0x9a'),{'event':_0x8cf9('0x9b'),'message':_0xbe7cd[_0x8cf9('0x2a')]},client9002)[_0x8cf9('0x22')](function(){return _0xbe7cd;});}return _0xbe7cd;}return null;})[_0x8cf9('0x22')](respondWithResult(_0x32c94a,null))[_0x8cf9('0x2b')](handleError(_0x32c94a,null));};var interaction_log=require(_0x8cf9('0x15'))(_0x8cf9('0x7b'));exports[_0x8cf9('0x35')]=function(_0x2ec8e0,_0x34cbf3,_0x1f8537){var _0x48e326={'agent':{},'channel':_0x8cf9('0x9c')};if(_0x2ec8e0[_0x8cf9('0x56')]['id']){delete _0x2ec8e0[_0x8cf9('0x56')]['id'];}_0x2ec8e0[_0x8cf9('0x56')]['UserId']=_0x2ec8e0['body'][_0x8cf9('0x7f')]||_0x2ec8e0['user']['id'];_0x48e326[_0x8cf9('0x80')]['id']=_0x2ec8e0[_0x8cf9('0x56')][_0x8cf9('0x7f')];return db[_0x8cf9('0x3c')][_0x8cf9('0x55')]({'where':{'id':_0x2ec8e0[_0x8cf9('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34cbf3,null))['then'](function(_0x2c4ddb){if(_0x2c4ddb){_0x48e326['message']=_0x2c4ddb[_0x8cf9('0x81')]({'plain':!![]});return db[_0x8cf9('0x82')][_0x8cf9('0x55')]({'where':{'id':_0x2c4ddb[_0x8cf9('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x34cbf3,null))[_0x8cf9('0x22')](function(_0x1e6e49){if(_0x1e6e49){_0x48e326[_0x8cf9('0x86')]=_0x1e6e49['get']({'plain':!![]});interaction_log['info'](_0x8cf9('0x9d'),_0x2ec8e0['user']['id'],_0x2ec8e0[_0x8cf9('0x6a')][_0x8cf9('0x39')],_0x2ec8e0[_0x8cf9('0x6a')]['role'],_0x48e326[_0x8cf9('0x86')]['id'],_0x2ec8e0[_0x8cf9('0x56')]?JSON[_0x8cf9('0x27')](_0x2ec8e0[_0x8cf9('0x56')]):_0x8cf9('0x89'));return respondWithRpcPromise(_0x8cf9('0x9e'),_0x8cf9('0x9f'),_0x48e326);}return null;})[_0x8cf9('0x22')](function(_0x566da5){var _0x2c9a2=_0x8cf9('0x8c')+_0x566da5[_0x8cf9('0x2a')]['ContactId'];return db[_0x8cf9('0x8d')][_0x8cf9('0x42')](_0x2c9a2,{'type':db[_0x8cf9('0x8e')][_0x8cf9('0x8f')][_0x8cf9('0x90')],'raw':!![]})[_0x8cf9('0x22')](function(_0x369529){return _0x369529;});})['then'](function(_0x1959cf){if(_0x1959cf){_0x48e326[_0x8cf9('0x2a')]['contact']=_0x1959cf[0x0];if(!_0x2ec8e0[_0x8cf9('0x56')]['UserId'])return;return db['User'][_0x8cf9('0x55')]({'where':{'id':_0x2ec8e0[_0x8cf9('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x8cf9('0x39'),_0x8cf9('0x92'),'email',_0x8cf9('0x94')],'raw':!![]});}return null;})[_0x8cf9('0x22')](function(_0x48055f){if(!_0x48055f)return null;_0x48e326[_0x8cf9('0x2a')][_0x8cf9('0x80')]=_0x48055f;return _0x48e326;})[_0x8cf9('0x22')](function(_0x50195f){if(_0x50195f){_0x50195f[_0x8cf9('0x2a')][_0x8cf9('0x96')]=util[_0x8cf9('0x79')](_0x8cf9('0xa0'),_0x2ec8e0[_0x8cf9('0x6a')][_0x8cf9('0x39')]);_0x50195f['message'][_0x8cf9('0x97')]=_0x48e326[_0x8cf9('0x97')];_0x50195f[_0x8cf9('0x2a')][_0x8cf9('0x98')]=_0x8cf9('0x35');_0x50195f[_0x8cf9('0x2a')][_0x8cf9('0x56')]=htmlToText[_0x8cf9('0x99')](_0x48e326[_0x8cf9('0x2a')][_0x8cf9('0x56')]);respondWithRpcPromise(_0x8cf9('0x9a'),'EventManager',{'event':_0x8cf9('0xa1'),'message':_0x50195f[_0x8cf9('0x2a')]},client9002);return _0x48e326;}return null;})['then'](respondWithResult(_0x34cbf3,null))['catch'](handleError(_0x34cbf3,null));};exports[_0x8cf9('0xa2')]=function(_0x2fc28f,_0x38b1a1){var _0x3af0cd=moment()[_0x8cf9('0xa3')]()[_0x8cf9('0xa4')]();var _0xfd175e=path[_0x8cf9('0x6e')](config[_0x8cf9('0x6f')],_0x8cf9('0xa5'),_0x8cf9('0xa6'),_0x8cf9('0xa7'));var _0x207f9f=path[_0x8cf9('0x6e')](config[_0x8cf9('0x6f')],_0x8cf9('0xa5'),_0x8cf9('0xa6'),_0x8cf9('0x6d'));var _0x164694=util[_0x8cf9('0x79')](_0x8cf9('0xa8'),_0x3af0cd);return db['MailMessage'][_0x8cf9('0x55')]({'where':{'id':_0x2fc28f['params']['id']},'attributes':['id','body',_0x8cf9('0xa9'),'to','cc',_0x8cf9('0xaa'),_0x8cf9('0xab'),_0x8cf9('0xac')],'include':_0x2fc28f[_0x8cf9('0x42')][_0x8cf9('0x6d')]?[{'model':db[_0x8cf9('0xad')],'as':'Attachments'}]:undefined})[_0x8cf9('0x22')](handleEntityNotFound(_0x38b1a1,null))[_0x8cf9('0x22')](function(_0x373559){if(_0x373559){var _0x45cbdd=_0x373559;var _0x452837={'from':_0x45cbdd['from'],'to':_0x45cbdd['to'],'subject':_0x45cbdd['subject'],'html':_0x45cbdd['body'],'headers':{'Date':moment(_0x45cbdd[_0x8cf9('0xac')])[_0x8cf9('0x79')](_0x8cf9('0xae'))},'attachments':[]};if(_0x373559['cc']){_0x452837['headers']['Cc']=_0x373559['cc'];}if(_0x373559[_0x8cf9('0xaa')]){_0x452837[_0x8cf9('0xaf')][_0x8cf9('0xb0')]=_0x373559[_0x8cf9('0xaa')];}return new BPromise(function(_0x1fee14,_0x567c41){if(_0x373559[_0x8cf9('0xb1')]){for(var _0x7ecc8c=0x0;_0x7ecc8c<_0x373559[_0x8cf9('0xb1')][_0x8cf9('0x54')];_0x7ecc8c++){var _0x3e1505=_0x373559['Attachments'][_0x7ecc8c];var _0x5e4c79=path[_0x8cf9('0x6e')](_0x207f9f,_0x3e1505[_0x8cf9('0x71')]);if(fs['existsSync'](_0x5e4c79)){_0x452837['attachments'][_0x8cf9('0xb2')]({'name':_0x3e1505['name'],'contentType':_0x3e1505[_0x8cf9('0x3f')],'data':fs[_0x8cf9('0xb3')](_0x5e4c79)});}}}emlformat['build'](_0x452837,function(_0x304b79,_0x2eb855){if(_0x304b79)return _0x567c41(_0x304b79);fs[_0x8cf9('0xb4')](path['join'](_0xfd175e,_0x164694),_0x2eb855);return _0x1fee14(_0x2eb855);});});}})[_0x8cf9('0x22')](function(_0x568945){if(_0x568945){return _0x38b1a1[_0x8cf9('0xa2')](path['join'](_0xfd175e,_0x164694),_0x164694,function(_0x91683e){if(_0x91683e){console[_0x8cf9('0xb5')](_0x8cf9('0xb6'),_0x91683e);}else{fs['unlinkSync'](path[_0x8cf9('0x6e')](_0xfd175e,_0x164694));}});}})[_0x8cf9('0x2b')](handleError(_0x38b1a1,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 16e0196..871c961 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 _0x31ac=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x363b89,_0x2f2e75){var _0x2ffc54=function(_0x314260){while(--_0x314260){_0x363b89['push'](_0x363b89['shift']());}};_0x2ffc54(++_0x2f2e75);}(_0x31ac,0x10e));var _0xc31a=function(_0x13865d,_0x40f28b){_0x13865d=_0x13865d-0x0;var _0x7858d5=_0x31ac[_0x13865d];return _0x7858d5;};'use strict';var EventEmitter=require(_0xc31a('0x0'));var MailMessage=require(_0xc31a('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc31a('0x2')](0x0);var events={'afterCreate':_0xc31a('0x3'),'afterUpdate':'update','afterDestroy':_0xc31a('0x4')};function emitEvent(_0x2fc0e3){return function(_0x42409e,_0x17d333,_0x137ca6){MailMessageEvents[_0xc31a('0x5')](_0x2fc0e3+':'+_0x42409e['id'],_0x42409e);MailMessageEvents[_0xc31a('0x5')](_0x2fc0e3,_0x42409e);_0x137ca6(null);};}for(var e in events){if(events[_0xc31a('0x6')](e)){var event=events[e];MailMessage[_0xc31a('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xb5a2=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3af63c,_0x580adb){var _0x4fbf4a=function(_0x1d1893){while(--_0x1d1893){_0x3af63c['push'](_0x3af63c['shift']());}};_0x4fbf4a(++_0x580adb);}(_0xb5a2,0xcc));var _0x2b5a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb5a2[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x2b5a('0x0'));var MailMessage=require(_0x2b5a('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x2b5a('0x2')](0x0);var events={'afterCreate':_0x2b5a('0x3'),'afterUpdate':'update','afterDestroy':_0x2b5a('0x4')};function emitEvent(_0x160edc){return function(_0x55264d,_0x27447c,_0x4ef5dc){MailMessageEvents['emit'](_0x160edc+':'+_0x55264d['id'],_0x55264d);MailMessageEvents['emit'](_0x160edc,_0x55264d);_0x4ef5dc(null);};}for(var e in events){if(events[_0x2b5a('0x5')](e)){var event=events[e];MailMessage[_0x2b5a('0x6')](e,emitEvent(event));}}module[_0x2b5a('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 692f73d..e288fcb 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 _0x15d7=['secret','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','html-to-text','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','toLowerCase','direction','out'];(function(_0x51786e,_0x5ee24e){var _0x25b5e2=function(_0x3ce85f){while(--_0x3ce85f){_0x51786e['push'](_0x51786e['shift']());}};_0x25b5e2(++_0x5ee24e);}(_0x15d7,0xdc));var _0x715d=function(_0xcee593,_0x9886e7){_0xcee593=_0xcee593-0x0;var _0x4fa243=_0x15d7[_0xcee593];return _0x4fa243;};'use strict';var _=require(_0x715d('0x0'));var util=require('util');var logger=require(_0x715d('0x1'))(_0x715d('0x2'));var moment=require(_0x715d('0x3'));var BPromise=require(_0x715d('0x4'));var rp=require('request-promise');var htmlToText=require(_0x715d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x715d('0x6'));module[_0x715d('0x7')]=function(_0x5edbd4,_0x12b13c){return _0x5edbd4[_0x715d('0x8')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x715d('0x9'),'fields':[_0x715d('0x9')]},{'name':_0x715d('0xa'),'fields':[_0x715d('0xb'),_0x715d('0xc')],'type':_0x715d('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a1e95,_0x7f322c,_0x337f39){if(_0x2a1e95[_0x715d('0xe')]){_0x2a1e95[_0x715d('0xb')]=htmlToText[_0x715d('0xf')](_0x2a1e95[_0x715d('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x337f39(null,_0x7f322c);},'afterCreate':function(_0x3e5428,_0x546472,_0x824df0){var _0x5958bf=_0x5edbd4[_0x715d('0x10')];var _0x450c18=_0x3e5428['get']({'plain':!![]});if(_0x450c18['direction'][_0x715d('0x11')]()==='in'||_0x450c18[_0x715d('0x12')][_0x715d('0x11')]()===_0x715d('0x13')&&!_0x450c18[_0x715d('0x14')]&&!_['isNil'](_0x450c18[_0x715d('0x15')])){_0x5958bf['MailInteraction'][_0x715d('0x16')]({'where':{'id':_0x450c18[_0x715d('0x17')]}})[_0x715d('0x18')](function(_0x3c05ac){if(_0x3c05ac){_0x3c05ac[_0x715d('0x19')]({'lastMsgAt':_0x450c18[_0x715d('0x1a')],'lastMsgDirection':_0x450c18[_0x715d('0x12')][_0x715d('0x11')]()});}})[_0x715d('0x1b')](function(_0x36c84b){console[_0x715d('0x1c')](_0x36c84b);});}_0x824df0();}},'charset':'utf8mb4','collate':_0x715d('0x1d')});}; \ No newline at end of file +var _0x3247=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','mail_messages','messageId','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','util','api'];(function(_0x1b6e9c,_0x961900){var _0x4fcdff=function(_0x304823){while(--_0x304823){_0x1b6e9c['push'](_0x1b6e9c['shift']());}};_0x4fcdff(++_0x961900);}(_0x3247,0x72));var _0x7324=function(_0x1351c5,_0x3ab56b){_0x1351c5=_0x1351c5-0x0;var _0x23d1e6=_0x3247[_0x1351c5];return _0x23d1e6;};'use strict';var _=require('lodash');var util=require(_0x7324('0x0'));var logger=require('../../config/logger')(_0x7324('0x1'));var moment=require(_0x7324('0x2'));var BPromise=require(_0x7324('0x3'));var rp=require(_0x7324('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x7324('0x5'));var rimraf=require(_0x7324('0x6'));var config=require(_0x7324('0x7'));var attributes=require('./mailMessage.attributes');module[_0x7324('0x8')]=function(_0x2de2bd,_0x1889f4){return _0x2de2bd['define']('MailMessage',attributes,{'tableName':_0x7324('0x9'),'paranoid':![],'indexes':[{'name':_0x7324('0xa'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x7324('0xb'),'subject'],'type':_0x7324('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1b7cdc,_0x55dab8,_0x1aa9f3){if(_0x1b7cdc[_0x7324('0xd')]){_0x1b7cdc['plainBody']=htmlToText[_0x7324('0xe')](_0x1b7cdc[_0x7324('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1aa9f3(null,_0x55dab8);},'afterCreate':function(_0x3bee92,_0x3dfc9d,_0x3e9185){var _0x20539d=_0x2de2bd[_0x7324('0xf')];var _0x549425=_0x3bee92[_0x7324('0x10')]({'plain':!![]});if(_0x549425[_0x7324('0x11')][_0x7324('0x12')]()==='in'||_0x549425[_0x7324('0x11')]['toLowerCase']()===_0x7324('0x13')&&!_0x549425['secret']&&!_[_0x7324('0x14')](_0x549425['UserId'])){_0x20539d[_0x7324('0x15')]['findOne']({'where':{'id':_0x549425[_0x7324('0x16')]}})[_0x7324('0x17')](function(_0x48e428){if(_0x48e428){_0x48e428[_0x7324('0x18')]({'lastMsgAt':_0x549425[_0x7324('0x19')],'lastMsgDirection':_0x549425['direction'][_0x7324('0x12')]()});}})[_0x7324('0x1a')](function(_0x5d2147){console[_0x7324('0x1b')](_0x5d2147);});}_0x3e9185();}},'charset':_0x7324('0x1c'),'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 47e85b0..82de86c 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 _0x3de3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','CreateMailMessage','MailMessage','create','options','catch','lodash','moment','bluebird'];(function(_0x4a4345,_0x6ac5f1){var _0xfcc719=function(_0x1afd2f){while(--_0x1afd2f){_0x4a4345['push'](_0x4a4345['shift']());}};_0xfcc719(++_0x6ac5f1);}(_0x3de3,0x1ce));var _0x33de=function(_0x56d2c0,_0x3cb4fb){_0x56d2c0=_0x56d2c0-0x0;var _0x29fef6=_0x3de3[_0x56d2c0];return _0x29fef6;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});config['redis']=_[_0x33de('0xa')](config[_0x33de('0xb')],{'host':_0x33de('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33de('0xb')]));require(_0x33de('0xd'))[_0x33de('0xe')](socket);function respondWithRpcPromise(_0x5e1be7,_0x2cbf35,_0x348720){return new BPromise(function(_0x8b655d,_0x241211){return client[_0x33de('0xf')](_0x5e1be7,_0x348720)[_0x33de('0x10')](function(_0x8dfa3b){logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,_0x33de('0x13'));logger[_0x33de('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2cbf35,_0x33de('0x13'),JSON[_0x33de('0x15')](_0x8dfa3b));if(_0x8dfa3b['error']){if(_0x8dfa3b['error'][_0x33de('0x16')]===0x1f4){logger[_0x33de('0x17')](_0x33de('0x12'),_0x2cbf35,_0x8dfa3b[_0x33de('0x17')]['message']);return _0x241211(_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);return _0x8b655d(_0x8dfa3b[_0x33de('0x17')]['message']);}else{logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,'request\x20sent');_0x8b655d(_0x8dfa3b[_0x33de('0x19')][_0x33de('0x18')]);}})['catch'](function(_0x5bb74e){logger[_0x33de('0x17')]('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x5bb74e);_0x241211(_0x5bb74e);});});}exports[_0x33de('0x1a')]=function(_0x2f0529){var _0x3810b5=this;return new Promise(function(_0x315c9b,_0xc4f1a4){return db[_0x33de('0x1b')][_0x33de('0x1c')](_0x2f0529['body'],{'raw':_0x2f0529['options']?_0x2f0529[_0x33de('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x33de('0x10')](function(_0x4cd8db){logger[_0x33de('0x11')](_0x33de('0x1a'),_0x2f0529);logger['debug'](_0x33de('0x1a'),_0x2f0529,JSON['stringify'](_0x4cd8db));_0x315c9b(_0x4cd8db);})[_0x33de('0x1e')](function(_0x5c602d){logger[_0x33de('0x17')](_0x33de('0x1a'),_0x5c602d[_0x33de('0x18')],_0x2f0529);_0xc4f1a4(_0x3810b5['error'](0x1f4,_0x5c602d[_0x33de('0x18')]));});});}; \ No newline at end of file +var _0x7334=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','create','body','options','raw','CreateMailMessage','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x29ad16,_0x316135){var _0x148f24=function(_0x22d562){while(--_0x22d562){_0x29ad16['push'](_0x29ad16['shift']());}};_0x148f24(++_0x316135);}(_0x7334,0x184));var _0x4733=function(_0x22bd80,_0x2f0177){_0x22bd80=_0x22bd80-0x0;var _0x153ae1=_0x7334[_0x22bd80];return _0x153ae1;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});config[_0x4733('0xb')]=_[_0x4733('0xc')](config[_0x4733('0xb')],{'host':_0x4733('0xd'),'port':0x18eb});var socket=require(_0x4733('0xe'))(new Redis(config[_0x4733('0xb')]));require(_0x4733('0xf'))[_0x4733('0x10')](socket);function respondWithRpcPromise(_0x1bc511,_0x2bafad,_0x49032d){return new BPromise(function(_0x42b97f,_0x1e6fcf){return client['request'](_0x1bc511,_0x49032d)[_0x4733('0x11')](function(_0x5240a4){logger[_0x4733('0x12')](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));logger[_0x4733('0x15')](_0x4733('0x16'),_0x2bafad,_0x4733('0x14'),JSON[_0x4733('0x17')](_0x5240a4));if(_0x5240a4['error']){if(_0x5240a4[_0x4733('0x18')]['code']===0x1f4){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);return _0x1e6fcf(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')]['message']);return _0x42b97f(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}else{logger['info'](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));_0x42b97f(_0x5240a4[_0x4733('0x1a')][_0x4733('0x19')]);}})['catch'](function(_0x517fbc){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x517fbc);_0x1e6fcf(_0x517fbc);});});}exports['CreateMailMessage']=function(_0x32f166){var _0x1943bc=this;return new Promise(function(_0x15339c,_0x7a4e0){return db['MailMessage'][_0x4733('0x1b')](_0x32f166[_0x4733('0x1c')],{'raw':_0x32f166['options']?_0x32f166[_0x4733('0x1d')][_0x4733('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x15a291){logger[_0x4733('0x12')](_0x4733('0x1f'),_0x32f166);logger[_0x4733('0x15')](_0x4733('0x1f'),_0x32f166,JSON[_0x4733('0x17')](_0x15a291));_0x15339c(_0x15a291);})[_0x4733('0x20')](function(_0x2bb78f){logger['error'](_0x4733('0x1f'),_0x2bb78f[_0x4733('0x19')],_0x32f166);_0x7a4e0(_0x1943bc[_0x4733('0x18')](0x1f4,_0x2bb78f[_0x4733('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f2e1127..7a2bc38 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 _0xa162=['mailMessage:','./mailMessage.events','update','emit','removeListener','length'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa162,0x169));var _0x2a16=function(_0x482e6b,_0x31020a){_0x482e6b=_0x482e6b-0x0;var _0x212b7a=_0xa162[_0x482e6b];return _0x212b7a;};'use strict';var MailMessageEvents=require(_0x2a16('0x0'));var events=['save','remove',_0x2a16('0x1')];function createListener(_0x2a8169,_0x180c68){return function(_0xd7f882){_0x180c68[_0x2a16('0x2')](_0x2a8169,_0xd7f882);};}function removeListener(_0x3b6064,_0x4270c0){return function(){MailMessageEvents[_0x2a16('0x3')](_0x3b6064,_0x4270c0);};}exports['register']=function(_0x2674f6){for(var _0xc66f31=0x0,_0x153cdd=events[_0x2a16('0x4')];_0xc66f31<_0x153cdd;_0xc66f31++){var _0x3fb925=events[_0xc66f31];var _0x443e75=createListener(_0x2a16('0x5')+_0x3fb925,_0x2674f6);MailMessageEvents['on'](_0x3fb925,_0x443e75);}}; \ No newline at end of file +var _0xb793=['save','remove','update','emit','removeListener','length','mailMessage:','./mailMessage.events'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xb793,0x19f));var _0x3b79=function(_0x42bddf,_0x425bb0){_0x42bddf=_0x42bddf-0x0;var _0x433d54=_0xb793[_0x42bddf];return _0x433d54;};'use strict';var MailMessageEvents=require(_0x3b79('0x0'));var events=[_0x3b79('0x1'),_0x3b79('0x2'),_0x3b79('0x3')];function createListener(_0x4c1f4e,_0x3cd331){return function(_0x2f3cf6){_0x3cd331[_0x3b79('0x4')](_0x4c1f4e,_0x2f3cf6);};}function removeListener(_0x1b6a9c,_0x3f2578){return function(){MailMessageEvents[_0x3b79('0x5')](_0x1b6a9c,_0x3f2578);};}exports['register']=function(_0x224bce){for(var _0x542c96=0x0,_0x351df4=events[_0x3b79('0x6')];_0x542c96<_0x351df4;_0x542c96++){var _0x59e9fb=events[_0x542c96];var _0x54c8a1=createListener(_0x3b79('0x7')+_0x59e9fb,_0x224bce);MailMessageEvents['on'](_0x59e9fb,_0x54c8a1);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index e901abc..c639323 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 _0xab29=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','addTeams','delete','/:id/teams'];(function(_0x542063,_0x423b71){var _0x36f4d7=function(_0x3b28d7){while(--_0x3b28d7){_0x542063['push'](_0x542063['shift']());}};_0x36f4d7(++_0x423b71);}(_0xab29,0x7e));var _0x9ab2=function(_0x511dff,_0x3694f9){_0x511dff=_0x511dff-0x0;var _0x1a2c36=_0xab29[_0x511dff];return _0x1a2c36;};'use strict';var multer=require('multer');var util=require(_0x9ab2('0x0'));var path=require(_0x9ab2('0x1'));var timeout=require(_0x9ab2('0x2'));var express=require(_0x9ab2('0x3'));var router=express[_0x9ab2('0x4')]();var fs_extra=require(_0x9ab2('0x5'));var auth=require(_0x9ab2('0x6'));var interaction=require(_0x9ab2('0x7'));var config=require(_0x9ab2('0x8'));var controller=require(_0x9ab2('0x9'));router[_0x9ab2('0xa')]('/',auth[_0x9ab2('0xb')](),controller['index']);router[_0x9ab2('0xa')](_0x9ab2('0xc'),auth[_0x9ab2('0xb')](),controller[_0x9ab2('0xd')]);router[_0x9ab2('0xa')](_0x9ab2('0xe'),auth['isAuthenticated'](),controller[_0x9ab2('0xf')]);router['get']('/:id/members',auth[_0x9ab2('0xb')](),controller[_0x9ab2('0x10')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x9ab2('0x11')]);router['get'](_0x9ab2('0x12'),auth[_0x9ab2('0xb')](),controller[_0x9ab2('0x13')]);router['post']('/',auth[_0x9ab2('0xb')](),controller['create']);router[_0x9ab2('0x14')]('/:id/teams',auth[_0x9ab2('0xb')](),controller[_0x9ab2('0x15')]);router[_0x9ab2('0x14')](_0x9ab2('0x12'),auth[_0x9ab2('0xb')](),controller['addAgents']);router['put'](_0x9ab2('0xe'),auth[_0x9ab2('0xb')](),controller['update']);router[_0x9ab2('0x16')](_0x9ab2('0xe'),auth[_0x9ab2('0xb')](),controller['destroy']);router[_0x9ab2('0x16')](_0x9ab2('0x17'),auth[_0x9ab2('0xb')](),controller['removeTeams']);router['delete'](_0x9ab2('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9ab2('0x18')]=router; \ No newline at end of file +var _0x2dd1=['isAuthenticated','describe','show','/:id/teams','getTeams','/:id/users','getAgents','create','post','put','/:id','delete','destroy','removeTeams','exports','multer','util','path','fs-extra','../../components/auth/service','get'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x2dd1,0x189));var _0x12dd=function(_0x37e01d,_0x4ba45e){_0x37e01d=_0x37e01d-0x0;var _0x1f8302=_0x2dd1[_0x37e01d];return _0x1f8302;};'use strict';var multer=require(_0x12dd('0x0'));var util=require(_0x12dd('0x1'));var path=require(_0x12dd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x12dd('0x3'));var auth=require(_0x12dd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x12dd('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x12dd('0x5')]('/describe',auth[_0x12dd('0x6')](),controller[_0x12dd('0x7')]);router[_0x12dd('0x5')]('/:id',auth[_0x12dd('0x6')](),controller[_0x12dd('0x8')]);router[_0x12dd('0x5')]('/:id/members',auth[_0x12dd('0x6')](),controller['getMembers']);router[_0x12dd('0x5')](_0x12dd('0x9'),auth[_0x12dd('0x6')](),controller[_0x12dd('0xa')]);router['get'](_0x12dd('0xb'),auth[_0x12dd('0x6')](),controller[_0x12dd('0xc')]);router['post']('/',auth[_0x12dd('0x6')](),controller[_0x12dd('0xd')]);router[_0x12dd('0xe')]('/:id/teams',auth[_0x12dd('0x6')](),controller['addTeams']);router['post'](_0x12dd('0xb'),auth[_0x12dd('0x6')](),controller['addAgents']);router[_0x12dd('0xf')](_0x12dd('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x12dd('0x11')]('/:id',auth[_0x12dd('0x6')](),controller[_0x12dd('0x12')]);router['delete'](_0x12dd('0x9'),auth['isAuthenticated'](),controller[_0x12dd('0x13')]);router[_0x12dd('0x11')](_0x12dd('0xb'),auth[_0x12dd('0x6')](),controller['removeAgents']);module[_0x12dd('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 0739a09..4530dab 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 _0x0b0d=['ENUM','rrmemory','sequelize','STRING','name','INTEGER'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x0b0d,0x158));var _0xd0b0=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x0b0d[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xd0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0b0('0x1')],'unique':_0xd0b0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd0b0('0x1')]},'timeout':{'type':Sequelize[_0xd0b0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd0b0('0x4')](_0xd0b0('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x6408=['name','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x4789bc,_0x955524){var _0x66fd14=function(_0x5a2dac){while(--_0x5a2dac){_0x4789bc['push'](_0x4789bc['shift']());}};_0x66fd14(++_0x955524);}(_0x6408,0x183));var _0x8640=function(_0x5a3149,_0x565b84){_0x5a3149=_0x5a3149-0x0;var _0x3bb9dd=_0x6408[_0x5a3149];return _0x3bb9dd;};'use strict';var Sequelize=require(_0x8640('0x0'));module[_0x8640('0x1')]={'name':{'type':Sequelize[_0x8640('0x2')],'unique':_0x8640('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8640('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8640('0x4'),'beepall',_0x8640('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 1a2a80c..a28de37 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 _0x9931=['send','index','rawAttributes','type','key','model','map','keys','query','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','MailQueue','includeAll','include','findAll','catch','show','params','intersection','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getMembers','findOne','UserMailQueue','order','pick','MailQueueId','options','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','userMailQueue:save','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','MailQueues','destroy','end','error','name'];(function(_0x3e19d0,_0x4bc898){var _0x50e4c8=function(_0xe47b63){while(--_0xe47b63){_0x3e19d0['push'](_0x3e19d0['shift']());}};_0x50e4c8(++_0x4bc898);}(_0x9931,0x184));var _0x1993=function(_0x3af810,_0x590321){_0x3af810=_0x3af810-0x0;var _0x2fb51e=_0x9931[_0x3af810];return _0x2fb51e;};'use strict';var emlformat=require(_0x1993('0x0'));var rimraf=require(_0x1993('0x1'));var zipdir=require(_0x1993('0x2'));var jsonpatch=require(_0x1993('0x3'));var rp=require('request-promise');var moment=require(_0x1993('0x4'));var BPromise=require(_0x1993('0x5'));var Mustache=require(_0x1993('0x6'));var util=require(_0x1993('0x7'));var path=require(_0x1993('0x8'));var sox=require(_0x1993('0x9'));var csv=require(_0x1993('0xa'));var ejs=require(_0x1993('0xb'));var fs=require('fs');var fs_extra=require(_0x1993('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1993('0xd'));var deskjs=require(_0x1993('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1993('0xf'));var Papa=require(_0x1993('0x10'));var Redis=require(_0x1993('0x11'));var authService=require(_0x1993('0x12'));var qs=require(_0x1993('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1993('0x14'));var logger=require(_0x1993('0x15'))(_0x1993('0x16'));var utils=require(_0x1993('0x17'));var config=require(_0x1993('0x18'));var licenseUtil=require(_0x1993('0x19'));var db=require(_0x1993('0x1a'))['db'];config['redis']=_[_0x1993('0x1b')](config[_0x1993('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x1993('0x1d'))(new Redis(config[_0x1993('0x1c')]));require(_0x1993('0x1e'))[_0x1993('0x1f')](socket);function respondWithStatusCode(_0x3be129,_0x2036d4){_0x2036d4=_0x2036d4||0xcc;return function(_0x434866){if(_0x434866){return _0x3be129[_0x1993('0x20')](_0x2036d4);}return _0x3be129[_0x1993('0x21')](_0x2036d4)['end']();};}function respondWithResult(_0x2de5a9,_0x1eb16c){_0x1eb16c=_0x1eb16c||0xc8;return function(_0x18c8b1){if(_0x18c8b1){return _0x2de5a9[_0x1993('0x21')](_0x1eb16c)[_0x1993('0x22')](_0x18c8b1);}};}function respondWithFilteredResult(_0x89a5f5,_0x37e895){return function(_0x3cf578){if(_0x3cf578){var _0x57486f=typeof _0x37e895['offset']===_0x1993('0x23')&&typeof _0x37e895[_0x1993('0x24')]===_0x1993('0x23');var _0x47a918=_0x3cf578['count'];var _0x162c2a=_0x57486f?0x0:_0x37e895[_0x1993('0x25')];var _0x20c698=_0x57486f?_0x3cf578[_0x1993('0x26')]:_0x37e895['offset']+_0x37e895[_0x1993('0x24')];var _0x13583b;if(_0x20c698>=_0x47a918){_0x20c698=_0x47a918;_0x13583b=0xc8;}else{_0x13583b=0xce;}_0x89a5f5[_0x1993('0x21')](_0x13583b);return _0x89a5f5[_0x1993('0x27')](_0x1993('0x28'),_0x162c2a+'-'+_0x20c698+'/'+_0x47a918)['json'](_0x3cf578);}return null;};}function patchUpdates(_0x3b079a){return function(_0x346d5f){try{jsonpatch['apply'](_0x346d5f,_0x3b079a,!![]);}catch(_0x59a594){return BPromise[_0x1993('0x29')](_0x59a594);}return _0x346d5f[_0x1993('0x2a')]();};}function saveUpdates(_0x3dbf39,_0x4e4ba6){return function(_0x235015){if(_0x235015){return _0x235015[_0x1993('0x2b')](_0x3dbf39)['then'](function(_0x58cc22){return _0x58cc22;});}return null;};}function removeEntity(_0x217251,_0x399bb2){return function(_0x3e7c1f){if(_0x3e7c1f){return _0x3e7c1f['destroy']()[_0x1993('0x2c')](function(){var _0x4fc92f=_0x3e7c1f['get']({'plain':!![]});var _0x297d57=_0x1993('0x2d');return db['UserProfileResource'][_0x1993('0x2e')]({'where':{'type':_0x297d57,'resourceId':_0x4fc92f['id']}})[_0x1993('0x2c')](function(){return _0x3e7c1f;});})[_0x1993('0x2c')](function(){_0x217251[_0x1993('0x21')](0xcc)[_0x1993('0x2f')]();});}};}function handleEntityNotFound(_0x563d93,_0x28f111){return function(_0x18003a){if(!_0x18003a){_0x563d93[_0x1993('0x20')](0x194);}return _0x18003a;};}function handleError(_0x39a364,_0x174513){_0x174513=_0x174513||0x1f4;return function(_0x80d974){logger[_0x1993('0x30')](_0x80d974['stack']);if(_0x80d974[_0x1993('0x31')]){delete _0x80d974[_0x1993('0x31')];}_0x39a364['status'](_0x174513)[_0x1993('0x32')](_0x80d974);};}exports[_0x1993('0x33')]=function(_0x586f05,_0x4cf5e5){var _0x30d802={},_0x322f9e={},_0x3860e3={'count':0x0,'rows':[]};var _0x247220=_['map'](db['MailQueue'][_0x1993('0x34')],function(_0x3cc98e){return{'name':_0x3cc98e['fieldName'],'type':_0x3cc98e[_0x1993('0x35')][_0x1993('0x36')]};});_0x322f9e[_0x1993('0x37')]=_[_0x1993('0x38')](_0x247220,_0x1993('0x31'));_0x322f9e['query']=_[_0x1993('0x39')](_0x586f05[_0x1993('0x3a')]);_0x322f9e['filters']=_['intersection'](_0x322f9e[_0x1993('0x37')],_0x322f9e['query']);_0x30d802[_0x1993('0x3b')]=_['intersection'](_0x322f9e[_0x1993('0x37')],qs['fields'](_0x586f05[_0x1993('0x3a')]['fields']));_0x30d802[_0x1993('0x3b')]=_0x30d802[_0x1993('0x3b')][_0x1993('0x3c')]?_0x30d802[_0x1993('0x3b')]:_0x322f9e[_0x1993('0x37')];if(!_0x586f05['query'][_0x1993('0x3d')](_0x1993('0x3e'))){_0x30d802[_0x1993('0x24')]=qs[_0x1993('0x24')](_0x586f05[_0x1993('0x3a')][_0x1993('0x24')]);_0x30d802[_0x1993('0x25')]=qs[_0x1993('0x25')](_0x586f05['query'][_0x1993('0x25')]);}_0x30d802['order']=qs[_0x1993('0x3f')](_0x586f05[_0x1993('0x3a')][_0x1993('0x3f')]);_0x30d802[_0x1993('0x40')]=qs[_0x1993('0x41')](_['pick'](_0x586f05[_0x1993('0x3a')],_0x322f9e[_0x1993('0x41')]),_0x247220);if(_0x586f05['query'][_0x1993('0x42')]){_0x30d802[_0x1993('0x40')]=_[_0x1993('0x43')](_0x30d802[_0x1993('0x40')],{'$or':_[_0x1993('0x38')](_0x247220,function(_0x3a56e3){if(_0x3a56e3[_0x1993('0x35')]!==_0x1993('0x44')){var _0x5fc510={};_0x5fc510[_0x3a56e3[_0x1993('0x31')]]={'$like':'%'+_0x586f05[_0x1993('0x3a')]['filter']+'%'};return _0x5fc510;}})});}_0x30d802=_[_0x1993('0x43')]({},_0x30d802,_0x586f05['options']);var _0x378bcd={'where':_0x30d802[_0x1993('0x40')]};return db[_0x1993('0x45')][_0x1993('0x26')](_0x378bcd)[_0x1993('0x2c')](function(_0x59ae8e){_0x3860e3['count']=_0x59ae8e;if(_0x586f05[_0x1993('0x3a')][_0x1993('0x46')]){_0x30d802[_0x1993('0x47')]=[{'all':!![]}];}return db[_0x1993('0x45')][_0x1993('0x48')](_0x30d802);})['then'](function(_0x2ab3fa){_0x3860e3['rows']=_0x2ab3fa;return _0x3860e3;})[_0x1993('0x2c')](respondWithFilteredResult(_0x4cf5e5,_0x30d802))[_0x1993('0x49')](handleError(_0x4cf5e5,null));};exports[_0x1993('0x4a')]=function(_0x3998e9,_0x405824){var _0x1b1280={'raw':!![],'where':{'id':_0x3998e9[_0x1993('0x4b')]['id']}},_0x4d1322={};_0x4d1322[_0x1993('0x37')]=_[_0x1993('0x39')](db[_0x1993('0x45')][_0x1993('0x34')]);_0x4d1322[_0x1993('0x3a')]=_[_0x1993('0x39')](_0x3998e9['query']);_0x4d1322[_0x1993('0x41')]=_['intersection'](_0x4d1322[_0x1993('0x37')],_0x4d1322[_0x1993('0x3a')]);_0x1b1280['attributes']=_[_0x1993('0x4c')](_0x4d1322['model'],qs[_0x1993('0x4d')](_0x3998e9[_0x1993('0x3a')][_0x1993('0x4d')]));_0x1b1280[_0x1993('0x3b')]=_0x1b1280[_0x1993('0x3b')][_0x1993('0x3c')]?_0x1b1280[_0x1993('0x3b')]:_0x4d1322[_0x1993('0x37')];if(_0x3998e9[_0x1993('0x3a')][_0x1993('0x46')]){_0x1b1280[_0x1993('0x47')]=[{'all':!![]}];}_0x1b1280=_[_0x1993('0x43')]({},_0x1b1280,_0x3998e9['options']);return db[_0x1993('0x45')][_0x1993('0x4e')](_0x1b1280)[_0x1993('0x2c')](handleEntityNotFound(_0x405824,null))['then'](respondWithResult(_0x405824,null))[_0x1993('0x49')](handleError(_0x405824,null));};exports[_0x1993('0x4f')]=function(_0x12e870,_0x3501fd){return db[_0x1993('0x45')]['create'](_0x12e870[_0x1993('0x50')],{})[_0x1993('0x2c')](function(_0x52f796){var _0x19b13d=_0x12e870['user'][_0x1993('0x51')]({'plain':!![]});if(!_0x19b13d)throw new Error(_0x1993('0x52'));if(_0x19b13d[_0x1993('0x53')]===_0x1993('0x54')){var _0x3e816f=_0x52f796['get']({'plain':!![]});var _0x4bb30a=_0x1993('0x2d');return db[_0x1993('0x55')][_0x1993('0x4e')]({'where':{'name':_0x4bb30a,'userProfileId':_0x19b13d[_0x1993('0x56')]},'raw':!![]})[_0x1993('0x2c')](function(_0x38b33b){if(_0x38b33b&&_0x38b33b[_0x1993('0x57')]===0x0){return db[_0x1993('0x58')][_0x1993('0x4f')]({'name':_0x3e816f[_0x1993('0x31')],'resourceId':_0x3e816f['id'],'type':_0x38b33b['name'],'sectionId':_0x38b33b['id']},{})[_0x1993('0x2c')](function(){return _0x52f796;});}else{return _0x52f796;}})['catch'](function(_0x436fba){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x436fba);throw _0x436fba;});}return _0x52f796;})[_0x1993('0x2c')](respondWithResult(_0x3501fd,0xc9))[_0x1993('0x49')](handleError(_0x3501fd,null));};exports['update']=function(_0x4e287b,_0x142e88){if(_0x4e287b[_0x1993('0x50')]['id']){delete _0x4e287b[_0x1993('0x50')]['id'];}return db['MailQueue'][_0x1993('0x4e')]({'where':{'id':_0x4e287b[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x142e88,null))[_0x1993('0x2c')](saveUpdates(_0x4e287b[_0x1993('0x50')],null))[_0x1993('0x2c')](respondWithResult(_0x142e88,null))[_0x1993('0x49')](handleError(_0x142e88,null));};exports[_0x1993('0x2e')]=function(_0x25ffa2,_0x3b7668){return db[_0x1993('0x45')][_0x1993('0x4e')]({'where':{'id':_0x25ffa2['params']['id']}})['then'](handleEntityNotFound(_0x3b7668,null))['then'](removeEntity(_0x3b7668,null))['catch'](handleError(_0x3b7668,null));};exports['describe']=function(_0x342ac6,_0x5be9ea){return db[_0x1993('0x45')]['describe']()[_0x1993('0x2c')](respondWithResult(_0x5be9ea,null))[_0x1993('0x49')](handleError(_0x5be9ea,null));};exports[_0x1993('0x59')]=function(_0x21e90a,_0x426641,_0x2f72f4){var _0x32f9c7={'raw':!![],'where':{}},_0x36835={},_0x15ce78;return db[_0x1993('0x45')][_0x1993('0x5a')]({'where':{'id':_0x21e90a[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x426641,null))[_0x1993('0x2c')](function(_0x54b1ed){if(_0x54b1ed){_0x15ce78=_0x54b1ed[_0x1993('0x51')]({'plain':!![]});_0x36835[_0x1993('0x37')]=_[_0x1993('0x39')](db[_0x1993('0x5b')][_0x1993('0x34')]);_0x36835[_0x1993('0x3a')]=_[_0x1993('0x39')](_0x21e90a[_0x1993('0x3a')]);_0x36835['filters']=_['intersection'](_0x36835['model'],_0x36835[_0x1993('0x3a')]);_0x32f9c7['attributes']=_[_0x1993('0x4c')](_0x36835[_0x1993('0x37')],qs['fields'](_0x21e90a[_0x1993('0x3a')]['fields']));_0x32f9c7[_0x1993('0x3b')]=_0x32f9c7[_0x1993('0x3b')]['length']?_0x32f9c7[_0x1993('0x3b')]:_0x36835['model'];if(!_0x21e90a[_0x1993('0x3a')][_0x1993('0x3d')](_0x1993('0x3e'))){_0x32f9c7['limit']=qs[_0x1993('0x24')](_0x21e90a[_0x1993('0x3a')]['limit']);_0x32f9c7[_0x1993('0x25')]=qs['offset'](_0x21e90a[_0x1993('0x3a')][_0x1993('0x25')]);}_0x32f9c7[_0x1993('0x5c')]=qs[_0x1993('0x3f')](_0x21e90a[_0x1993('0x3a')][_0x1993('0x3f')]);_0x32f9c7['where']=qs[_0x1993('0x41')](_[_0x1993('0x5d')](_0x21e90a['query'],_0x36835[_0x1993('0x41')]));_0x32f9c7[_0x1993('0x40')][_0x1993('0x5e')]=_0x54b1ed['id'];if(_0x21e90a[_0x1993('0x3a')][_0x1993('0x42')]){_0x32f9c7[_0x1993('0x40')]=_[_0x1993('0x43')](_0x32f9c7[_0x1993('0x40')],{'$or':_['map'](_0x32f9c7['attributes'],function(_0x4b6039){var _0x3cebca={};_0x3cebca[_0x4b6039]={'$like':'%'+_0x21e90a[_0x1993('0x3a')][_0x1993('0x42')]+'%'};return _0x3cebca;})});}_0x32f9c7=_[_0x1993('0x43')]({},_0x32f9c7,_0x21e90a[_0x1993('0x5f')]);return db[_0x1993('0x5b')][_0x1993('0x48')](_0x32f9c7);}})[_0x1993('0x2c')](function(_0x8f1d2b){if(_0x8f1d2b){return db[_0x1993('0x60')][_0x1993('0x61')]({'where':{'id':_[_0x1993('0x38')](_0x8f1d2b,_0x1993('0x62')),'role':_0x1993('0x63')},'attributes':['id',_0x1993('0x31'),_0x1993('0x64'),_0x1993('0x65'),_0x1993('0x66')]});}})[_0x1993('0x2c')](function(_0x5ab27b){if(_0x5ab27b){return{'count':_0x5ab27b[_0x1993('0x26')],'rows':_[_0x1993('0x38')](_0x5ab27b['rows'],function(_0x32966d){return{'membername':_0x32966d[_0x1993('0x31')],'UserId':_0x32966d['id'],'queue_name':_0x15ce78[_0x1993('0x31')],'MailQueueId':_0x15ce78['id'],'interface':util[_0x1993('0x67')](_0x1993('0x68'),'SIP',_0x32966d[_0x1993('0x31')]),'penalty':0x0,'paused':_0x32966d['mailPause'],'createdAt':_0x32966d[_0x1993('0x66')],'updatedAt':_0x32966d[_0x1993('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1993('0x2c')](respondWithFilteredResult(_0x426641,_0x32f9c7))['catch'](handleError(_0x426641,null));};exports[_0x1993('0x69')]=function(_0x4c4e22,_0x266930,_0x40318d){var _0x2ea0e6={};var _0x227443={};var _0x323d36;var _0x381ceb;return db[_0x1993('0x45')]['findOne']({'where':{'id':_0x4c4e22[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x266930,null))['then'](function(_0x1e27b2){if(_0x1e27b2){_0x323d36=_0x1e27b2;_0x227443[_0x1993('0x37')]=_['keys'](db[_0x1993('0x6a')]['rawAttributes']);_0x227443[_0x1993('0x3a')]=_[_0x1993('0x39')](_0x4c4e22['query']);_0x227443[_0x1993('0x41')]=_[_0x1993('0x4c')](_0x227443[_0x1993('0x37')],_0x227443['query']);_0x2ea0e6[_0x1993('0x3b')]=_[_0x1993('0x4c')](_0x227443['model'],qs['fields'](_0x4c4e22['query'][_0x1993('0x4d')]));_0x2ea0e6[_0x1993('0x3b')]=_0x2ea0e6['attributes']['length']?_0x2ea0e6[_0x1993('0x3b')]:_0x227443[_0x1993('0x37')];_0x2ea0e6[_0x1993('0x5c')]=qs[_0x1993('0x3f')](_0x4c4e22[_0x1993('0x3a')]['sort']);_0x2ea0e6[_0x1993('0x40')]=qs[_0x1993('0x41')](_[_0x1993('0x5d')](_0x4c4e22[_0x1993('0x3a')],_0x227443[_0x1993('0x41')]));if(_0x4c4e22[_0x1993('0x3a')][_0x1993('0x42')]){_0x2ea0e6[_0x1993('0x40')]=_[_0x1993('0x43')](_0x2ea0e6[_0x1993('0x40')],{'$or':_[_0x1993('0x38')](_0x2ea0e6[_0x1993('0x3b')],function(_0x413d42){var _0x43ef93={};_0x43ef93[_0x413d42]={'$like':'%'+_0x4c4e22[_0x1993('0x3a')][_0x1993('0x42')]+'%'};return _0x43ef93;})});}_0x2ea0e6=_[_0x1993('0x43')]({},_0x2ea0e6,_0x4c4e22[_0x1993('0x5f')]);return _0x323d36[_0x1993('0x69')](_0x2ea0e6);}})[_0x1993('0x2c')](function(_0xe930d4){if(_0xe930d4){_0x381ceb=_0xe930d4[_0x1993('0x3c')];if(!_0x4c4e22[_0x1993('0x3a')][_0x1993('0x3d')](_0x1993('0x3e'))){_0x2ea0e6[_0x1993('0x24')]=qs[_0x1993('0x24')](_0x4c4e22[_0x1993('0x3a')][_0x1993('0x24')]);_0x2ea0e6[_0x1993('0x25')]=qs[_0x1993('0x25')](_0x4c4e22[_0x1993('0x3a')]['offset']);}return _0x323d36[_0x1993('0x69')](_0x2ea0e6);}})[_0x1993('0x2c')](function(_0x2d1aed){if(_0x2d1aed){return _0x2d1aed?{'count':_0x381ceb,'rows':_0x2d1aed}:null;}})[_0x1993('0x2c')](respondWithResult(_0x266930,null))[_0x1993('0x49')](handleError(_0x266930,null));};exports[_0x1993('0x6b')]=function(_0x21fce2,_0x559757,_0x5cc8b9){var _0x1f60aa=_0x21fce2[_0x1993('0x50')]['ids'];return db[_0x1993('0x6a')][_0x1993('0x48')]({'where':{'id':_0x1f60aa},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1993('0x31'),_0x1993('0x6c'),_0x1993('0x6d'),'interface'],'raw':!![]}]})['then'](function(_0x29427d){if(_0x29427d){var _0x5ca53b=_[_0x1993('0x6e')](_0x29427d,function(_0x483742){var _0x5548ca=_0x483742['get']({'plain':!![]});return _0x5548ca[_0x1993('0x6f')];});return db['MailQueue'][_0x1993('0x4e')]({'where':{'id':_0x21fce2[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](function(_0x2767ab){return db[_0x1993('0x70')][_0x1993('0x71')](function(_0xf9bb0){return _0x2767ab['addTeams'](_0x1f60aa,{'transaction':_0xf9bb0})['then'](function(){return BPromise[_0x1993('0x72')](_0x5ca53b,function(_0x5deb6b){return db[_0x1993('0x5b')][_0x1993('0x73')]({'where':{'UserId':_0x5deb6b['id'],'MailQueueId':_0x21fce2[_0x1993('0x4b')]['id']},'transaction':_0xf9bb0});});})['then'](function(){_0x5ca53b['forEach'](function(_0x32fcc4){socket['emit'](_0x1993('0x74'),{'UserId':_0x32fcc4['id'],'MailQueueId':_0x2767ab['id']});});});});});}})['then'](respondWithStatusCode(_0x559757,null))['catch'](handleError(_0x559757,null));};exports[_0x1993('0x75')]=function(_0x433e76,_0x23d528,_0x53bc3c){return db['Team'][_0x1993('0x48')]({'where':{'id':_0x433e76[_0x1993('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1993('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1993('0x2c')](handleEntityNotFound(_0x23d528,null))['then'](function(_0x5c3377){var _0xffdf3d=_[_0x1993('0x38')](_0x5c3377,'id');var _0x2ed268=[];var _0x3676fd=[];var _0x407c9f=squel['select']();_0x407c9f[_0x1993('0x76')](_0x1993('0x77'))[_0x1993('0x78')](_0x1993('0x79'),'tq')[_0x1993('0x7a')](_0x1993('0x7b'),'ut',_0x1993('0x7c'))[_0x1993('0x40')](_0x1993('0x7d'),_0x433e76['params']['id']);for(var _0xb753ea=0x0;_0xb753ea<_0x5c3377[_0x1993('0x3c')];_0xb753ea+=0x1){let _0x14c9bb=_0x5c3377[_0xb753ea];for(var _0x533a71=0x0;_0x533a71<_0x14c9bb['Agents'][_0x1993('0x3c')];_0x533a71+=0x1){let _0x430d99=_0x14c9bb[_0x1993('0x6f')][_0x533a71];var _0x1388fc=_0x407c9f['clone']();_0x1388fc[_0x1993('0x40')](_0x1993('0x7e'),_0x430d99['id']);_0x3676fd['push'](db['sequelize'][_0x1993('0x3a')](_0x1388fc[_0x1993('0x7f')](),{'type':db['sequelize'][_0x1993('0x80')]['SELECT']})[_0x1993('0x2c')](function(_0x3014cc){if(_0x3014cc[_0x1993('0x3c')]===0x1){return _0x430d99['id'];}else{var _0x77bf53=_[_0x1993('0x81')](_[_0x1993('0x38')](_0x3014cc,_0x1993('0x82')),function(_0x24af9c){return _[_0x1993('0x83')](_0xffdf3d,_0x24af9c);});if(_0x77bf53){return _0x430d99['id'];}}}));}}return BPromise[_0x1993('0x84')](_0x3676fd)[_0x1993('0x2c')](function(_0x26dc78){_0x2ed268=_(_0x2ed268)[_0x1993('0x85')](_0x26dc78)[_0x1993('0x86')]()['value']();return db[_0x1993('0x45')][_0x1993('0x4e')]({'where':{'id':_0x433e76[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](function(_0x3d259e){return db[_0x1993('0x70')][_0x1993('0x71')](function(_0x8a93c3){return _0x3d259e[_0x1993('0x75')](_0x433e76['query'][_0x1993('0x87')],{'transaction':_0x8a93c3})[_0x1993('0x2c')](function(){if(!_[_0x1993('0x88')](_0x2ed268)){return _0x3d259e[_0x1993('0x89')](_0x2ed268,{'transaction':_0x8a93c3});}})[_0x1993('0x2c')](function(){_0x2ed268[_0x1993('0x8a')](function(_0x1528f5){socket[_0x1993('0x8b')](_0x1993('0x8c'),{'UserId':_0x1528f5,'MailQueueId':_0x3d259e['id']});});});});});});})['then'](respondWithStatusCode(_0x23d528,null))[_0x1993('0x49')](handleError(_0x23d528,null));};exports['addAgents']=function(_0x5b4c21,_0xe7a2ab,_0x4a8d96){return db[_0x1993('0x45')][_0x1993('0x4e')]({'where':{'id':_0x5b4c21[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0xe7a2ab,null))[_0x1993('0x2c')](function(_0x315d2e){if(_0x315d2e){return _0x315d2e[_0x1993('0x8d')](_0x5b4c21[_0x1993('0x50')][_0x1993('0x87')],_[_0x1993('0x8e')](_0x5b4c21['body'],[_0x1993('0x87'),'id'])||{})[_0x1993('0x8f')](function(_0x91f07e){for(var _0x4ee1fa=0x0;_0x4ee1fa<_0x5b4c21[_0x1993('0x50')][_0x1993('0x87')][_0x1993('0x3c')];_0x4ee1fa+=0x1){socket[_0x1993('0x8b')](_0x1993('0x74'),{'UserId':_0x5b4c21[_0x1993('0x50')]['ids'][_0x4ee1fa],'MailQueueId':_0x5b4c21[_0x1993('0x4b')]['id']});}return _0x91f07e;});}})[_0x1993('0x2c')](respondWithResult(_0xe7a2ab,null))[_0x1993('0x49')](handleError(_0xe7a2ab,null));};exports[_0x1993('0x89')]=function(_0x747109,_0xe56530,_0x126755){return db[_0x1993('0x45')]['find']({'where':{'id':_0x747109[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0xe56530,null))[_0x1993('0x2c')](function(_0x5e6727){if(_0x5e6727){return _0x5e6727['removeAgents'](_0x747109[_0x1993('0x3a')][_0x1993('0x87')])['then'](function(){if(_[_0x1993('0x90')](_0x747109[_0x1993('0x3a')][_0x1993('0x87')])){for(var _0x14b055=0x0;_0x14b055<_0x747109[_0x1993('0x3a')][_0x1993('0x87')][_0x1993('0x3c')];_0x14b055+=0x1){socket[_0x1993('0x8b')](_0x1993('0x8c'),{'UserId':Number(_0x747109['query'][_0x1993('0x87')][_0x14b055]),'MailQueueId':Number(_0x747109[_0x1993('0x4b')]['id'])});}}else{socket[_0x1993('0x8b')](_0x1993('0x8c'),{'UserId':Number(_0x747109[_0x1993('0x3a')][_0x1993('0x87')]),'MailQueueId':Number(_0x747109[_0x1993('0x4b')]['id'])});}});}})[_0x1993('0x2c')](respondWithStatusCode(_0xe56530,null))[_0x1993('0x49')](handleError(_0xe56530,null));};exports['getAgents']=function(_0x47d299,_0x41397b,_0x4dedea){var _0x5a1a81={};var _0x38a9bb={};var _0x5e526e;var _0x3c0bdf;return db[_0x1993('0x45')][_0x1993('0x5a')]({'where':{'id':_0x47d299[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x41397b,null))[_0x1993('0x2c')](function(_0x5cb24f){if(_0x5cb24f){_0x5e526e=_0x5cb24f;_0x38a9bb[_0x1993('0x37')]=_[_0x1993('0x39')](db[_0x1993('0x60')][_0x1993('0x34')]);_0x38a9bb['query']=_[_0x1993('0x39')](_0x47d299['query']);_0x38a9bb[_0x1993('0x41')]=_['intersection'](_0x38a9bb[_0x1993('0x37')],_0x38a9bb[_0x1993('0x3a')]);_0x5a1a81['attributes']=_['intersection'](_0x38a9bb['model'],qs['fields'](_0x47d299[_0x1993('0x3a')][_0x1993('0x4d')]));_0x5a1a81[_0x1993('0x3b')]=_0x5a1a81['attributes'][_0x1993('0x3c')]?_0x5a1a81[_0x1993('0x3b')]:_0x38a9bb[_0x1993('0x37')];_0x5a1a81[_0x1993('0x5c')]=qs['sort'](_0x47d299['query'][_0x1993('0x3f')]);_0x5a1a81[_0x1993('0x40')]=qs[_0x1993('0x41')](_[_0x1993('0x5d')](_0x47d299['query'],_0x38a9bb[_0x1993('0x41')]));if(_0x47d299[_0x1993('0x3a')][_0x1993('0x42')]){_0x5a1a81[_0x1993('0x40')]=_['merge'](_0x5a1a81[_0x1993('0x40')],{'$or':_['map'](_0x5a1a81[_0x1993('0x3b')],function(_0x50e11d){var _0x156d97={};_0x156d97[_0x50e11d]={'$like':'%'+_0x47d299['query'][_0x1993('0x42')]+'%'};return _0x156d97;})});}_0x5a1a81=_[_0x1993('0x43')]({},_0x5a1a81,_0x47d299['options']);return _0x5e526e[_0x1993('0x91')](_0x5a1a81);}})['then'](function(_0x1b132c){if(_0x1b132c){_0x3c0bdf=_0x1b132c[_0x1993('0x3c')];if(!_0x47d299[_0x1993('0x3a')][_0x1993('0x3d')](_0x1993('0x3e'))){_0x5a1a81[_0x1993('0x24')]=qs[_0x1993('0x24')](_0x47d299[_0x1993('0x3a')][_0x1993('0x24')]);_0x5a1a81['offset']=qs[_0x1993('0x25')](_0x47d299['query']['offset']);}return _0x5e526e['getAgents'](_0x5a1a81);}})[_0x1993('0x2c')](function(_0x490c70){if(_0x490c70){return _0x490c70?{'count':_0x3c0bdf,'rows':_0x490c70}:null;}})[_0x1993('0x2c')](respondWithResult(_0x41397b,null))[_0x1993('0x49')](handleError(_0x41397b,null));}; \ No newline at end of file +var _0x341c=['Team','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','all','union','compact','value','forEach','emit','userMailQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','MailQueue','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','map','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','rows','format','SIP','createdAt','getTeams','addTeams','ids','Agents','online','interface','flatMap','transaction','findOrCreate','userMailQueue:save'];(function(_0x224fd6,_0x58bb26){var _0xa56932=function(_0x39eb55){while(--_0x39eb55){_0x224fd6['push'](_0x224fd6['shift']());}};_0xa56932(++_0x58bb26);}(_0x341c,0x12f));var _0xc341=function(_0x33f5de,_0x5e4f9e){_0x33f5de=_0x33f5de-0x0;var _0x1add2f=_0x341c[_0x33f5de];return _0x1add2f;};'use strict';var emlformat=require(_0xc341('0x0'));var rimraf=require(_0xc341('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc341('0x2'));var rp=require(_0xc341('0x3'));var moment=require(_0xc341('0x4'));var BPromise=require(_0xc341('0x5'));var Mustache=require(_0xc341('0x6'));var util=require('util');var path=require(_0xc341('0x7'));var sox=require(_0xc341('0x8'));var csv=require(_0xc341('0x9'));var ejs=require(_0xc341('0xa'));var fs=require('fs');var fs_extra=require(_0xc341('0xb'));var _=require(_0xc341('0xc'));var squel=require(_0xc341('0xd'));var crypto=require('crypto');var jsforce=require(_0xc341('0xe'));var deskjs=require(_0xc341('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc341('0x10'));var Papa=require(_0xc341('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc341('0x12'));var as=require(_0xc341('0x13'));var hardwareService=require(_0xc341('0x14'));var logger=require(_0xc341('0x15'))(_0xc341('0x16'));var utils=require(_0xc341('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc341('0x18'));var db=require(_0xc341('0x19'))['db'];config[_0xc341('0x1a')]=_[_0xc341('0x1b')](config[_0xc341('0x1a')],{'host':_0xc341('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc341('0x1a')]));require(_0xc341('0x1d'))[_0xc341('0x1e')](socket);function respondWithStatusCode(_0x468bfb,_0x3ea314){_0x3ea314=_0x3ea314||0xcc;return function(_0xe9b68d){if(_0xe9b68d){return _0x468bfb['sendStatus'](_0x3ea314);}return _0x468bfb[_0xc341('0x1f')](_0x3ea314)[_0xc341('0x20')]();};}function respondWithResult(_0x638b98,_0x3689ac){_0x3689ac=_0x3689ac||0xc8;return function(_0x1813fd){if(_0x1813fd){return _0x638b98[_0xc341('0x1f')](_0x3689ac)[_0xc341('0x21')](_0x1813fd);}};}function respondWithFilteredResult(_0x25cf1f,_0x42bc6a){return function(_0x483ee6){if(_0x483ee6){var _0x1bf970=typeof _0x42bc6a[_0xc341('0x22')]===_0xc341('0x23')&&typeof _0x42bc6a[_0xc341('0x24')]===_0xc341('0x23');var _0x81b268=_0x483ee6[_0xc341('0x25')];var _0x2d08c0=_0x1bf970?0x0:_0x42bc6a['offset'];var _0x127cc8=_0x1bf970?_0x483ee6[_0xc341('0x25')]:_0x42bc6a[_0xc341('0x22')]+_0x42bc6a['limit'];var _0x5e67fb;if(_0x127cc8>=_0x81b268){_0x127cc8=_0x81b268;_0x5e67fb=0xc8;}else{_0x5e67fb=0xce;}_0x25cf1f[_0xc341('0x1f')](_0x5e67fb);return _0x25cf1f[_0xc341('0x26')]('Content-Range',_0x2d08c0+'-'+_0x127cc8+'/'+_0x81b268)[_0xc341('0x21')](_0x483ee6);}return null;};}function patchUpdates(_0x258a09){return function(_0x10a0f2){try{jsonpatch[_0xc341('0x27')](_0x10a0f2,_0x258a09,!![]);}catch(_0x416827){return BPromise['reject'](_0x416827);}return _0x10a0f2[_0xc341('0x28')]();};}function saveUpdates(_0x4d6d84,_0x5be1d6){return function(_0x9ac696){if(_0x9ac696){return _0x9ac696[_0xc341('0x29')](_0x4d6d84)[_0xc341('0x2a')](function(_0x386101){return _0x386101;});}return null;};}function removeEntity(_0x403c15,_0x58dc52){return function(_0x84a706){if(_0x84a706){return _0x84a706[_0xc341('0x2b')]()[_0xc341('0x2a')](function(){var _0x5dc56e=_0x84a706[_0xc341('0x2c')]({'plain':!![]});var _0x3b3968=_0xc341('0x2d');return db[_0xc341('0x2e')][_0xc341('0x2b')]({'where':{'type':_0x3b3968,'resourceId':_0x5dc56e['id']}})[_0xc341('0x2a')](function(){return _0x84a706;});})['then'](function(){_0x403c15[_0xc341('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fc6a,_0x5a36dd){return function(_0x11ebfc){if(!_0x11ebfc){_0x30fc6a[_0xc341('0x2f')](0x194);}return _0x11ebfc;};}function handleError(_0x26012,_0x1f90c5){_0x1f90c5=_0x1f90c5||0x1f4;return function(_0x443985){logger[_0xc341('0x30')](_0x443985[_0xc341('0x31')]);if(_0x443985['name']){delete _0x443985['name'];}_0x26012[_0xc341('0x1f')](_0x1f90c5)['send'](_0x443985);};}exports['index']=function(_0x327ca0,_0x18dec1){var _0x56c354={},_0x2367b6={},_0x6d719a={'count':0x0,'rows':[]};var _0x3eda84=_['map'](db[_0xc341('0x32')][_0xc341('0x33')],function(_0x1b3652){return{'name':_0x1b3652[_0xc341('0x34')],'type':_0x1b3652[_0xc341('0x35')][_0xc341('0x36')]};});_0x2367b6[_0xc341('0x37')]=_['map'](_0x3eda84,_0xc341('0x38'));_0x2367b6[_0xc341('0x39')]=_[_0xc341('0x3a')](_0x327ca0[_0xc341('0x39')]);_0x2367b6[_0xc341('0x3b')]=_[_0xc341('0x3c')](_0x2367b6[_0xc341('0x37')],_0x2367b6[_0xc341('0x39')]);_0x56c354[_0xc341('0x3d')]=_[_0xc341('0x3c')](_0x2367b6['model'],qs[_0xc341('0x3e')](_0x327ca0[_0xc341('0x39')][_0xc341('0x3e')]));_0x56c354['attributes']=_0x56c354[_0xc341('0x3d')]['length']?_0x56c354[_0xc341('0x3d')]:_0x2367b6['model'];if(!_0x327ca0['query'][_0xc341('0x3f')](_0xc341('0x40'))){_0x56c354[_0xc341('0x24')]=qs[_0xc341('0x24')](_0x327ca0[_0xc341('0x39')]['limit']);_0x56c354[_0xc341('0x22')]=qs[_0xc341('0x22')](_0x327ca0['query']['offset']);}_0x56c354[_0xc341('0x41')]=qs[_0xc341('0x42')](_0x327ca0['query'][_0xc341('0x42')]);_0x56c354['where']=qs['filters'](_[_0xc341('0x43')](_0x327ca0[_0xc341('0x39')],_0x2367b6[_0xc341('0x3b')]),_0x3eda84);if(_0x327ca0[_0xc341('0x39')]['filter']){_0x56c354['where']=_[_0xc341('0x44')](_0x56c354[_0xc341('0x45')],{'$or':_[_0xc341('0x46')](_0x3eda84,function(_0x3f9611){if(_0x3f9611[_0xc341('0x35')]!==_0xc341('0x47')){var _0x26ec76={};_0x26ec76[_0x3f9611['name']]={'$like':'%'+_0x327ca0['query'][_0xc341('0x48')]+'%'};return _0x26ec76;}})});}_0x56c354=_[_0xc341('0x44')]({},_0x56c354,_0x327ca0['options']);var _0x2d4b49={'where':_0x56c354[_0xc341('0x45')]};return db['MailQueue']['count'](_0x2d4b49)[_0xc341('0x2a')](function(_0x3b26cd){_0x6d719a[_0xc341('0x25')]=_0x3b26cd;if(_0x327ca0[_0xc341('0x39')][_0xc341('0x49')]){_0x56c354[_0xc341('0x4a')]=[{'all':!![]}];}return db[_0xc341('0x32')][_0xc341('0x4b')](_0x56c354);})[_0xc341('0x2a')](function(_0xe60d5e){_0x6d719a['rows']=_0xe60d5e;return _0x6d719a;})[_0xc341('0x2a')](respondWithFilteredResult(_0x18dec1,_0x56c354))[_0xc341('0x4c')](handleError(_0x18dec1,null));};exports[_0xc341('0x4d')]=function(_0x540f8a,_0x3cfbb9){var _0x1085ac={'raw':!![],'where':{'id':_0x540f8a[_0xc341('0x4e')]['id']}},_0x55c024={};_0x55c024[_0xc341('0x37')]=_['keys'](db[_0xc341('0x32')][_0xc341('0x33')]);_0x55c024[_0xc341('0x39')]=_[_0xc341('0x3a')](_0x540f8a[_0xc341('0x39')]);_0x55c024[_0xc341('0x3b')]=_['intersection'](_0x55c024[_0xc341('0x37')],_0x55c024[_0xc341('0x39')]);_0x1085ac['attributes']=_['intersection'](_0x55c024['model'],qs[_0xc341('0x3e')](_0x540f8a[_0xc341('0x39')][_0xc341('0x3e')]));_0x1085ac['attributes']=_0x1085ac[_0xc341('0x3d')]['length']?_0x1085ac[_0xc341('0x3d')]:_0x55c024[_0xc341('0x37')];if(_0x540f8a[_0xc341('0x39')][_0xc341('0x49')]){_0x1085ac[_0xc341('0x4a')]=[{'all':!![]}];}_0x1085ac=_[_0xc341('0x44')]({},_0x1085ac,_0x540f8a[_0xc341('0x4f')]);return db[_0xc341('0x32')][_0xc341('0x50')](_0x1085ac)[_0xc341('0x2a')](handleEntityNotFound(_0x3cfbb9,null))[_0xc341('0x2a')](respondWithResult(_0x3cfbb9,null))[_0xc341('0x4c')](handleError(_0x3cfbb9,null));};exports['create']=function(_0x5d2791,_0x4bf3bc){return db[_0xc341('0x32')][_0xc341('0x51')](_0x5d2791[_0xc341('0x52')],{})['then'](function(_0x2a8aa1){var _0x4986c3=_0x5d2791['user'][_0xc341('0x2c')]({'plain':!![]});if(!_0x4986c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4986c3[_0xc341('0x53')]===_0xc341('0x54')){var _0x2caea7=_0x2a8aa1[_0xc341('0x2c')]({'plain':!![]});var _0x3f3c5e='MailQueues';return db[_0xc341('0x55')][_0xc341('0x50')]({'where':{'name':_0x3f3c5e,'userProfileId':_0x4986c3['userProfileId']},'raw':!![]})['then'](function(_0x3a9e44){if(_0x3a9e44&&_0x3a9e44[_0xc341('0x56')]===0x0){return db[_0xc341('0x2e')]['create']({'name':_0x2caea7[_0xc341('0x38')],'resourceId':_0x2caea7['id'],'type':_0x3a9e44[_0xc341('0x38')],'sectionId':_0x3a9e44['id']},{})[_0xc341('0x2a')](function(){return _0x2a8aa1;});}else{return _0x2a8aa1;}})[_0xc341('0x4c')](function(_0x3c4a61){logger[_0xc341('0x30')](_0xc341('0x57'),_0x3c4a61);throw _0x3c4a61;});}return _0x2a8aa1;})[_0xc341('0x2a')](respondWithResult(_0x4bf3bc,0xc9))['catch'](handleError(_0x4bf3bc,null));};exports['update']=function(_0x2abdec,_0x14f0c9){if(_0x2abdec[_0xc341('0x52')]['id']){delete _0x2abdec[_0xc341('0x52')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x2abdec['params']['id']}})[_0xc341('0x2a')](handleEntityNotFound(_0x14f0c9,null))[_0xc341('0x2a')](saveUpdates(_0x2abdec[_0xc341('0x52')],null))['then'](respondWithResult(_0x14f0c9,null))[_0xc341('0x4c')](handleError(_0x14f0c9,null));};exports[_0xc341('0x2b')]=function(_0xa3d414,_0xb018e0){return db['MailQueue'][_0xc341('0x50')]({'where':{'id':_0xa3d414[_0xc341('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb018e0,null))['then'](removeEntity(_0xb018e0,null))['catch'](handleError(_0xb018e0,null));};exports['describe']=function(_0x103b87,_0x266f5a){return db['MailQueue'][_0xc341('0x58')]()['then'](respondWithResult(_0x266f5a,null))['catch'](handleError(_0x266f5a,null));};exports[_0xc341('0x59')]=function(_0x37c7e1,_0x2c7710,_0x2da6f4){var _0x3c189f={'raw':!![],'where':{}},_0x5b14b4={},_0x547242;return db[_0xc341('0x32')][_0xc341('0x5a')]({'where':{'id':_0x37c7e1[_0xc341('0x4e')]['id']}})[_0xc341('0x2a')](handleEntityNotFound(_0x2c7710,null))[_0xc341('0x2a')](function(_0x1e1e67){if(_0x1e1e67){_0x547242=_0x1e1e67['get']({'plain':!![]});_0x5b14b4[_0xc341('0x37')]=_[_0xc341('0x3a')](db[_0xc341('0x5b')][_0xc341('0x33')]);_0x5b14b4[_0xc341('0x39')]=_[_0xc341('0x3a')](_0x37c7e1[_0xc341('0x39')]);_0x5b14b4[_0xc341('0x3b')]=_['intersection'](_0x5b14b4[_0xc341('0x37')],_0x5b14b4[_0xc341('0x39')]);_0x3c189f[_0xc341('0x3d')]=_['intersection'](_0x5b14b4[_0xc341('0x37')],qs['fields'](_0x37c7e1[_0xc341('0x39')][_0xc341('0x3e')]));_0x3c189f[_0xc341('0x3d')]=_0x3c189f[_0xc341('0x3d')][_0xc341('0x5c')]?_0x3c189f[_0xc341('0x3d')]:_0x5b14b4['model'];if(!_0x37c7e1[_0xc341('0x39')][_0xc341('0x3f')](_0xc341('0x40'))){_0x3c189f['limit']=qs[_0xc341('0x24')](_0x37c7e1[_0xc341('0x39')]['limit']);_0x3c189f[_0xc341('0x22')]=qs[_0xc341('0x22')](_0x37c7e1['query']['offset']);}_0x3c189f[_0xc341('0x41')]=qs['sort'](_0x37c7e1[_0xc341('0x39')][_0xc341('0x42')]);_0x3c189f[_0xc341('0x45')]=qs[_0xc341('0x3b')](_[_0xc341('0x43')](_0x37c7e1[_0xc341('0x39')],_0x5b14b4[_0xc341('0x3b')]));_0x3c189f[_0xc341('0x45')][_0xc341('0x5d')]=_0x1e1e67['id'];if(_0x37c7e1['query'][_0xc341('0x48')]){_0x3c189f[_0xc341('0x45')]=_[_0xc341('0x44')](_0x3c189f['where'],{'$or':_[_0xc341('0x46')](_0x3c189f['attributes'],function(_0x331259){var _0x1ee0da={};_0x1ee0da[_0x331259]={'$like':'%'+_0x37c7e1['query'][_0xc341('0x48')]+'%'};return _0x1ee0da;})});}_0x3c189f=_[_0xc341('0x44')]({},_0x3c189f,_0x37c7e1['options']);return db[_0xc341('0x5b')][_0xc341('0x4b')](_0x3c189f);}})[_0xc341('0x2a')](function(_0x477ebe){if(_0x477ebe){return db[_0xc341('0x5e')][_0xc341('0x5f')]({'where':{'id':_[_0xc341('0x46')](_0x477ebe,_0xc341('0x60')),'role':_0xc341('0x61')},'attributes':['id',_0xc341('0x38'),_0xc341('0x62'),_0xc341('0x63'),'createdAt']});}})[_0xc341('0x2a')](function(_0x154ccd){if(_0x154ccd){return{'count':_0x154ccd['count'],'rows':_[_0xc341('0x46')](_0x154ccd[_0xc341('0x64')],function(_0x3a04d0){return{'membername':_0x3a04d0[_0xc341('0x38')],'UserId':_0x3a04d0['id'],'queue_name':_0x547242[_0xc341('0x38')],'MailQueueId':_0x547242['id'],'interface':util[_0xc341('0x65')]('%s/%s',_0xc341('0x66'),_0x3a04d0['name']),'penalty':0x0,'paused':_0x3a04d0[_0xc341('0x62')],'createdAt':_0x3a04d0[_0xc341('0x67')],'updatedAt':_0x3a04d0[_0xc341('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc341('0x2a')](respondWithFilteredResult(_0x2c7710,_0x3c189f))[_0xc341('0x4c')](handleError(_0x2c7710,null));};exports[_0xc341('0x68')]=function(_0x25f712,_0x4664b0,_0x20e75d){var _0x2d61bc={};var _0x283d2b={};var _0x297b5f;var _0x3ce71b;return db[_0xc341('0x32')][_0xc341('0x5a')]({'where':{'id':_0x25f712[_0xc341('0x4e')]['id']}})[_0xc341('0x2a')](handleEntityNotFound(_0x4664b0,null))[_0xc341('0x2a')](function(_0x12ebdf){if(_0x12ebdf){_0x297b5f=_0x12ebdf;_0x283d2b[_0xc341('0x37')]=_['keys'](db['Team'][_0xc341('0x33')]);_0x283d2b[_0xc341('0x39')]=_[_0xc341('0x3a')](_0x25f712['query']);_0x283d2b[_0xc341('0x3b')]=_['intersection'](_0x283d2b['model'],_0x283d2b[_0xc341('0x39')]);_0x2d61bc[_0xc341('0x3d')]=_['intersection'](_0x283d2b[_0xc341('0x37')],qs[_0xc341('0x3e')](_0x25f712[_0xc341('0x39')]['fields']));_0x2d61bc[_0xc341('0x3d')]=_0x2d61bc[_0xc341('0x3d')]['length']?_0x2d61bc['attributes']:_0x283d2b[_0xc341('0x37')];_0x2d61bc[_0xc341('0x41')]=qs['sort'](_0x25f712[_0xc341('0x39')][_0xc341('0x42')]);_0x2d61bc[_0xc341('0x45')]=qs[_0xc341('0x3b')](_[_0xc341('0x43')](_0x25f712['query'],_0x283d2b[_0xc341('0x3b')]));if(_0x25f712['query'][_0xc341('0x48')]){_0x2d61bc['where']=_[_0xc341('0x44')](_0x2d61bc[_0xc341('0x45')],{'$or':_['map'](_0x2d61bc[_0xc341('0x3d')],function(_0x4a6b20){var _0x3f2c69={};_0x3f2c69[_0x4a6b20]={'$like':'%'+_0x25f712[_0xc341('0x39')]['filter']+'%'};return _0x3f2c69;})});}_0x2d61bc=_[_0xc341('0x44')]({},_0x2d61bc,_0x25f712['options']);return _0x297b5f['getTeams'](_0x2d61bc);}})['then'](function(_0x3a2bd4){if(_0x3a2bd4){_0x3ce71b=_0x3a2bd4[_0xc341('0x5c')];if(!_0x25f712['query'][_0xc341('0x3f')](_0xc341('0x40'))){_0x2d61bc[_0xc341('0x24')]=qs[_0xc341('0x24')](_0x25f712[_0xc341('0x39')][_0xc341('0x24')]);_0x2d61bc['offset']=qs['offset'](_0x25f712['query'][_0xc341('0x22')]);}return _0x297b5f[_0xc341('0x68')](_0x2d61bc);}})[_0xc341('0x2a')](function(_0xb73a8f){if(_0xb73a8f){return _0xb73a8f?{'count':_0x3ce71b,'rows':_0xb73a8f}:null;}})[_0xc341('0x2a')](respondWithResult(_0x4664b0,null))['catch'](handleError(_0x4664b0,null));};exports[_0xc341('0x69')]=function(_0x13ca2b,_0x3512a8,_0x153070){var _0x42a1d4=_0x13ca2b[_0xc341('0x52')][_0xc341('0x6a')];return db['Team'][_0xc341('0x4b')]({'where':{'id':_0x42a1d4},'attributes':['id'],'include':[{'model':db[_0xc341('0x5e')],'as':_0xc341('0x6b'),'attributes':['id',_0xc341('0x38'),_0xc341('0x6c'),'voicePause',_0xc341('0x6d')],'raw':!![]}]})['then'](function(_0x41a5f1){if(_0x41a5f1){var _0xe453c9=_[_0xc341('0x6e')](_0x41a5f1,function(_0x21b4c9){var _0x3cc4ef=_0x21b4c9[_0xc341('0x2c')]({'plain':!![]});return _0x3cc4ef[_0xc341('0x6b')];});return db[_0xc341('0x32')][_0xc341('0x50')]({'where':{'id':_0x13ca2b['params']['id']}})[_0xc341('0x2a')](function(_0xed9986){return db['sequelize'][_0xc341('0x6f')](function(_0x5b488e){return _0xed9986['addTeams'](_0x42a1d4,{'transaction':_0x5b488e})[_0xc341('0x2a')](function(){return BPromise['each'](_0xe453c9,function(_0x519f18){return db[_0xc341('0x5b')][_0xc341('0x70')]({'where':{'UserId':_0x519f18['id'],'MailQueueId':_0x13ca2b['params']['id']},'transaction':_0x5b488e});});})['then'](function(){_0xe453c9['forEach'](function(_0x48aac1){socket['emit'](_0xc341('0x71'),{'UserId':_0x48aac1['id'],'MailQueueId':_0xed9986['id']});});});});});}})[_0xc341('0x2a')](respondWithStatusCode(_0x3512a8,null))['catch'](handleError(_0x3512a8,null));};exports['removeTeams']=function(_0x497c3d,_0x13c93b,_0x65ace){return db[_0xc341('0x72')]['findAll']({'where':{'id':_0x497c3d[_0xc341('0x39')][_0xc341('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xc341('0x5e')],'as':_0xc341('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xc341('0x2a')](handleEntityNotFound(_0x13c93b,null))[_0xc341('0x2a')](function(_0x2fb637){var _0x1b3bd4=_[_0xc341('0x46')](_0x2fb637,'id');var _0x328ba4=[];var _0x4d3cf3=[];var _0x263ebf=squel[_0xc341('0x73')]();_0x263ebf['field'](_0xc341('0x74'))[_0xc341('0x75')]('team_has_mail_queues','tq')[_0xc341('0x76')](_0xc341('0x77'),'ut',_0xc341('0x78'))[_0xc341('0x45')](_0xc341('0x79'),_0x497c3d[_0xc341('0x4e')]['id']);for(var _0x133788=0x0;_0x133788<_0x2fb637[_0xc341('0x5c')];_0x133788+=0x1){let _0x271cc5=_0x2fb637[_0x133788];for(var _0x567248=0x0;_0x567248<_0x271cc5[_0xc341('0x6b')][_0xc341('0x5c')];_0x567248+=0x1){let _0x340703=_0x271cc5[_0xc341('0x6b')][_0x567248];var _0x291626=_0x263ebf[_0xc341('0x7a')]();_0x291626[_0xc341('0x45')](_0xc341('0x7b'),_0x340703['id']);_0x4d3cf3[_0xc341('0x7c')](db[_0xc341('0x7d')][_0xc341('0x39')](_0x291626[_0xc341('0x7e')](),{'type':db['sequelize']['QueryTypes'][_0xc341('0x7f')]})[_0xc341('0x2a')](function(_0x4d6690){if(_0x4d6690[_0xc341('0x5c')]===0x1){return _0x340703['id'];}else{var _0x38e7c6=_['every'](_['map'](_0x4d6690,'TeamId'),function(_0x5d28d0){return _['includes'](_0x1b3bd4,_0x5d28d0);});if(_0x38e7c6){return _0x340703['id'];}}}));}}return BPromise[_0xc341('0x80')](_0x4d3cf3)['then'](function(_0x80128a){_0x328ba4=_(_0x328ba4)[_0xc341('0x81')](_0x80128a)[_0xc341('0x82')]()[_0xc341('0x83')]();return db[_0xc341('0x32')]['find']({'where':{'id':_0x497c3d[_0xc341('0x4e')]['id']}})[_0xc341('0x2a')](function(_0x575039){return db[_0xc341('0x7d')][_0xc341('0x6f')](function(_0x42459f){return _0x575039['removeTeams'](_0x497c3d[_0xc341('0x39')][_0xc341('0x6a')],{'transaction':_0x42459f})[_0xc341('0x2a')](function(){if(!_['isEmpty'](_0x328ba4)){return _0x575039['removeAgents'](_0x328ba4,{'transaction':_0x42459f});}})[_0xc341('0x2a')](function(){_0x328ba4[_0xc341('0x84')](function(_0x56e18c){socket[_0xc341('0x85')](_0xc341('0x86'),{'UserId':_0x56e18c,'MailQueueId':_0x575039['id']});});});});});});})[_0xc341('0x2a')](respondWithStatusCode(_0x13c93b,null))[_0xc341('0x4c')](handleError(_0x13c93b,null));};exports['addAgents']=function(_0x369327,_0x313749,_0x49151e){return db['MailQueue'][_0xc341('0x50')]({'where':{'id':_0x369327[_0xc341('0x4e')]['id']}})[_0xc341('0x2a')](handleEntityNotFound(_0x313749,null))[_0xc341('0x2a')](function(_0xd11b99){if(_0xd11b99){return _0xd11b99[_0xc341('0x87')](_0x369327[_0xc341('0x52')][_0xc341('0x6a')],_['omit'](_0x369327[_0xc341('0x52')],[_0xc341('0x6a'),'id'])||{})['spread'](function(_0x2bf08b){for(var _0x48bd75=0x0;_0x48bd75<_0x369327[_0xc341('0x52')][_0xc341('0x6a')][_0xc341('0x5c')];_0x48bd75+=0x1){socket['emit'](_0xc341('0x71'),{'UserId':_0x369327[_0xc341('0x52')][_0xc341('0x6a')][_0x48bd75],'MailQueueId':_0x369327[_0xc341('0x4e')]['id']});}return _0x2bf08b;});}})[_0xc341('0x2a')](respondWithResult(_0x313749,null))['catch'](handleError(_0x313749,null));};exports[_0xc341('0x88')]=function(_0x366c2a,_0x43a741,_0x3cb933){return db['MailQueue'][_0xc341('0x50')]({'where':{'id':_0x366c2a[_0xc341('0x4e')]['id']}})['then'](handleEntityNotFound(_0x43a741,null))[_0xc341('0x2a')](function(_0x573311){if(_0x573311){return _0x573311[_0xc341('0x88')](_0x366c2a['query'][_0xc341('0x6a')])[_0xc341('0x2a')](function(){if(_[_0xc341('0x89')](_0x366c2a[_0xc341('0x39')][_0xc341('0x6a')])){for(var _0x3ecaa3=0x0;_0x3ecaa3<_0x366c2a['query']['ids'][_0xc341('0x5c')];_0x3ecaa3+=0x1){socket['emit'](_0xc341('0x86'),{'UserId':Number(_0x366c2a[_0xc341('0x39')][_0xc341('0x6a')][_0x3ecaa3]),'MailQueueId':Number(_0x366c2a[_0xc341('0x4e')]['id'])});}}else{socket[_0xc341('0x85')]('userMailQueue:remove',{'UserId':Number(_0x366c2a[_0xc341('0x39')][_0xc341('0x6a')]),'MailQueueId':Number(_0x366c2a[_0xc341('0x4e')]['id'])});}});}})[_0xc341('0x2a')](respondWithStatusCode(_0x43a741,null))['catch'](handleError(_0x43a741,null));};exports[_0xc341('0x8a')]=function(_0x364415,_0x232301,_0xd51195){var _0x5e615f={};var _0x297279={};var _0x1cf07d;var _0x1f48da;return db['MailQueue'][_0xc341('0x5a')]({'where':{'id':_0x364415[_0xc341('0x4e')]['id']}})[_0xc341('0x2a')](handleEntityNotFound(_0x232301,null))[_0xc341('0x2a')](function(_0x1c6b10){if(_0x1c6b10){_0x1cf07d=_0x1c6b10;_0x297279[_0xc341('0x37')]=_['keys'](db[_0xc341('0x5e')]['rawAttributes']);_0x297279[_0xc341('0x39')]=_[_0xc341('0x3a')](_0x364415[_0xc341('0x39')]);_0x297279[_0xc341('0x3b')]=_[_0xc341('0x3c')](_0x297279[_0xc341('0x37')],_0x297279['query']);_0x5e615f[_0xc341('0x3d')]=_[_0xc341('0x3c')](_0x297279[_0xc341('0x37')],qs['fields'](_0x364415[_0xc341('0x39')][_0xc341('0x3e')]));_0x5e615f['attributes']=_0x5e615f['attributes'][_0xc341('0x5c')]?_0x5e615f[_0xc341('0x3d')]:_0x297279[_0xc341('0x37')];_0x5e615f[_0xc341('0x41')]=qs[_0xc341('0x42')](_0x364415[_0xc341('0x39')][_0xc341('0x42')]);_0x5e615f[_0xc341('0x45')]=qs[_0xc341('0x3b')](_[_0xc341('0x43')](_0x364415[_0xc341('0x39')],_0x297279[_0xc341('0x3b')]));if(_0x364415[_0xc341('0x39')][_0xc341('0x48')]){_0x5e615f[_0xc341('0x45')]=_[_0xc341('0x44')](_0x5e615f[_0xc341('0x45')],{'$or':_[_0xc341('0x46')](_0x5e615f[_0xc341('0x3d')],function(_0x340dbc){var _0xf947a2={};_0xf947a2[_0x340dbc]={'$like':'%'+_0x364415[_0xc341('0x39')]['filter']+'%'};return _0xf947a2;})});}_0x5e615f=_[_0xc341('0x44')]({},_0x5e615f,_0x364415[_0xc341('0x4f')]);return _0x1cf07d[_0xc341('0x8a')](_0x5e615f);}})[_0xc341('0x2a')](function(_0x122363){if(_0x122363){_0x1f48da=_0x122363[_0xc341('0x5c')];if(!_0x364415['query']['hasOwnProperty'](_0xc341('0x40'))){_0x5e615f[_0xc341('0x24')]=qs[_0xc341('0x24')](_0x364415[_0xc341('0x39')][_0xc341('0x24')]);_0x5e615f[_0xc341('0x22')]=qs[_0xc341('0x22')](_0x364415['query'][_0xc341('0x22')]);}return _0x1cf07d[_0xc341('0x8a')](_0x5e615f);}})[_0xc341('0x2a')](function(_0x151b01){if(_0x151b01){return _0x151b01?{'count':_0x1f48da,'rows':_0x151b01}:null;}})['then'](respondWithResult(_0x232301,null))['catch'](handleError(_0x232301,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index edbb974..894eaa3 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 _0xd671=['setMaxListeners','update','remove','emit','hook','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd671,0x7e));var _0x1d67=function(_0x340d75,_0x561cb0){_0x340d75=_0x340d75-0x0;var _0x3f1114=_0xd671[_0x340d75];return _0x3f1114;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1d67('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d67('0x1'),'afterDestroy':_0x1d67('0x2')};function emitEvent(_0x3dba34){return function(_0xc1d125,_0x5af6d3,_0x274565){MailQueueEvents[_0x1d67('0x3')](_0x3dba34+':'+_0xc1d125['id'],_0xc1d125);MailQueueEvents[_0x1d67('0x3')](_0x3dba34,_0xc1d125);_0x274565(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x1d67('0x4')](e,emitEvent(event));}}module[_0x1d67('0x5')]=MailQueueEvents; \ No newline at end of file +var _0xeccc=['hook','events','../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x55c5d6,_0x49e581){var _0x4e921f=function(_0x2df4a7){while(--_0x2df4a7){_0x55c5d6['push'](_0x55c5d6['shift']());}};_0x4e921f(++_0x49e581);}(_0xeccc,0x14e));var _0xcecc=function(_0x11cf32,_0x560d24){_0x11cf32=_0x11cf32-0x0;var _0x163a94=_0xeccc[_0x11cf32];return _0x163a94;};'use strict';var EventEmitter=require(_0xcecc('0x0'));var MailQueue=require(_0xcecc('0x1'))['db'][_0xcecc('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xcecc('0x3')](0x0);var events={'afterCreate':_0xcecc('0x4'),'afterUpdate':_0xcecc('0x5'),'afterDestroy':'remove'};function emitEvent(_0x223e01){return function(_0x581279,_0x3fc126,_0x19731a){MailQueueEvents[_0xcecc('0x6')](_0x223e01+':'+_0x581279['id'],_0x581279);MailQueueEvents[_0xcecc('0x6')](_0x223e01,_0x581279);_0x19731a(null);};}for(var e in events){if(events[_0xcecc('0x7')](e)){var event=events[e];MailQueue[_0xcecc('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9881a17..4d624f9 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 _0xf3ef=['api','moment','request-promise','path','rimraf','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger'];(function(_0x27d621,_0x1b4ab0){var _0x1911b7=function(_0x4aee3c){while(--_0x4aee3c){_0x27d621['push'](_0x27d621['shift']());}};_0x1911b7(++_0x1b4ab0);}(_0xf3ef,0x111));var _0xff3e=function(_0x37ad1c,_0x247bd6){_0x37ad1c=_0x37ad1c-0x0;var _0xedeefb=_0xf3ef[_0x37ad1c];return _0xedeefb;};'use strict';var _=require(_0xff3e('0x0'));var util=require(_0xff3e('0x1'));var logger=require(_0xff3e('0x2'))(_0xff3e('0x3'));var moment=require(_0xff3e('0x4'));var BPromise=require('bluebird');var rp=require(_0xff3e('0x5'));var fs=require('fs');var path=require(_0xff3e('0x6'));var rimraf=require(_0xff3e('0x7'));var config=require('../../config/environment');var attributes=require(_0xff3e('0x8'));module['exports']=function(_0x5e19ff,_0x514804){return _0x5e19ff[_0xff3e('0x9')](_0xff3e('0xa'),attributes,{'tableName':_0xff3e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x883e=['rimraf','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','api','moment','bluebird','request-promise','path'];(function(_0x726c6b,_0x25bc96){var _0x9ec837=function(_0x4e9097){while(--_0x4e9097){_0x726c6b['push'](_0x726c6b['shift']());}};_0x9ec837(++_0x25bc96);}(_0x883e,0x102));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe883('0x1'));var moment=require(_0xe883('0x2'));var BPromise=require(_0xe883('0x3'));var rp=require(_0xe883('0x4'));var fs=require('fs');var path=require(_0xe883('0x5'));var rimraf=require(_0xe883('0x6'));var config=require('../../config/environment');var attributes=require(_0xe883('0x7'));module['exports']=function(_0x38881b,_0x5575ce){return _0x38881b[_0xe883('0x8')](_0xe883('0x9'),attributes,{'tableName':_0xe883('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 322278d..0f169b3 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 _0xb50c=['GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','model','map','then','catch','find','ShowMailQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailQueue.socket','request','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2952c6,_0x5d10f7){var _0x4680e8=function(_0x41dae8){while(--_0x41dae8){_0x2952c6['push'](_0x2952c6['shift']());}};_0x4680e8(++_0x5d10f7);}(_0xb50c,0x1bb));var _0xcb50=function(_0x280861,_0x17e5fc){_0x280861=_0x280861-0x0;var _0x22256a=_0xb50c[_0x280861];return _0x22256a;};'use strict';var _=require(_0xcb50('0x0'));var util=require(_0xcb50('0x1'));var moment=require(_0xcb50('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb50('0x3'));var db=require(_0xcb50('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb50('0x5'))(_0xcb50('0x6'));var config=require(_0xcb50('0x7'));var jayson=require(_0xcb50('0x8'));var client=jayson[_0xcb50('0x9')]['http']({'port':0x232a});config['redis']=_[_0xcb50('0xa')](config[_0xcb50('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcb50('0xc'))(new Redis(config[_0xcb50('0xb')]));require(_0xcb50('0xd'))['register'](socket);function respondWithRpcPromise(_0x23fa92,_0x424b04,_0x429f13){return new BPromise(function(_0x247751,_0x40dab0){return client[_0xcb50('0xe')](_0x23fa92,_0x429f13)['then'](function(_0x5b8d82){logger[_0xcb50('0xf')](_0xcb50('0x10'),_0x424b04,'request\x20sent');logger[_0xcb50('0x11')](_0xcb50('0x12'),_0x424b04,_0xcb50('0x13'),JSON[_0xcb50('0x14')](_0x5b8d82));if(_0x5b8d82['error']){if(_0x5b8d82[_0xcb50('0x15')][_0xcb50('0x16')]===0x1f4){logger[_0xcb50('0x15')](_0xcb50('0x10'),_0x424b04,_0x5b8d82[_0xcb50('0x15')][_0xcb50('0x17')]);return _0x40dab0(_0x5b8d82[_0xcb50('0x15')]['message']);}logger[_0xcb50('0x15')](_0xcb50('0x10'),_0x424b04,_0x5b8d82['error'][_0xcb50('0x17')]);return _0x247751(_0x5b8d82[_0xcb50('0x15')][_0xcb50('0x17')]);}else{logger[_0xcb50('0xf')](_0xcb50('0x10'),_0x424b04,_0xcb50('0x13'));_0x247751(_0x5b8d82[_0xcb50('0x18')]['message']);}})['catch'](function(_0x338073){logger['error']('MailQueue,\x20%s,\x20%s',_0x424b04,_0x338073);_0x40dab0(_0x338073);});});}exports[_0xcb50('0x19')]=function(_0x32da1a){var _0x4268d9=this;return new Promise(function(_0xc87508,_0x37cb27){return db[_0xcb50('0x1a')][_0xcb50('0x1b')]({'raw':_0x32da1a['options']?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x1d')]===undefined?!![]:![]:!![],'where':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x1e')]||null:null,'attributes':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x1f')]||null:null,'limit':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a['options']['limit']||null:null,'include':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x20')]?_['map'](_0x32da1a['options'][_0xcb50('0x20')],function(_0x151405){return{'model':db[_0x151405[_0xcb50('0x21')]],'as':_0x151405['as'],'attributes':_0x151405[_0xcb50('0x1f')],'include':_0x151405[_0xcb50('0x20')]?_[_0xcb50('0x22')](_0x151405[_0xcb50('0x20')],function(_0x5ae74c){return{'model':db[_0x5ae74c['model']],'as':_0x5ae74c['as'],'attributes':_0x5ae74c[_0xcb50('0x1f')],'include':_0x5ae74c[_0xcb50('0x20')]?_['map'](_0x5ae74c[_0xcb50('0x20')],function(_0x59a979){return{'model':db[_0x59a979['model']],'as':_0x59a979['as'],'attributes':_0x59a979['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb50('0x23')](function(_0x3274ec){logger[_0xcb50('0xf')]('GetMailQueue',_0x32da1a);logger[_0xcb50('0x11')]('GetMailQueue',_0x32da1a,JSON[_0xcb50('0x14')](_0x3274ec));_0xc87508(_0x3274ec);})[_0xcb50('0x24')](function(_0x254bb7){logger[_0xcb50('0x15')](_0xcb50('0x19'),_0x254bb7['message'],_0x32da1a);_0x37cb27(_0x4268d9['error'](0x1f4,_0x254bb7['message']));});});};exports['ShowMailQueue']=function(_0x571e43){var _0x3c398d=this;return new Promise(function(_0x527a70,_0x467293){return db[_0xcb50('0x1a')][_0xcb50('0x25')]({'raw':_0x571e43['options']?_0x571e43[_0xcb50('0x1c')][_0xcb50('0x1d')]===undefined?!![]:![]:!![],'where':_0x571e43['options']?_0x571e43[_0xcb50('0x1c')][_0xcb50('0x1e')]||null:null,'attributes':_0x571e43[_0xcb50('0x1c')]?_0x571e43['options'][_0xcb50('0x1f')]||null:null,'include':_0x571e43[_0xcb50('0x1c')]?_0x571e43['options'][_0xcb50('0x20')]?_[_0xcb50('0x22')](_0x571e43[_0xcb50('0x1c')]['include'],function(_0x5e963e){return{'model':db[_0x5e963e[_0xcb50('0x21')]],'as':_0x5e963e['as'],'attributes':_0x5e963e['attributes'],'include':_0x5e963e[_0xcb50('0x20')]?_[_0xcb50('0x22')](_0x5e963e[_0xcb50('0x20')],function(_0xfdff22){return{'model':db[_0xfdff22[_0xcb50('0x21')]],'as':_0xfdff22['as'],'attributes':_0xfdff22['attributes'],'include':_0xfdff22[_0xcb50('0x20')]?_[_0xcb50('0x22')](_0xfdff22['include'],function(_0x317bd1){return{'model':db[_0x317bd1['model']],'as':_0x317bd1['as'],'attributes':_0x317bd1[_0xcb50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcb50('0x23')](function(_0x1ea722){logger[_0xcb50('0xf')](_0xcb50('0x26'),_0x571e43);logger[_0xcb50('0x11')](_0xcb50('0x26'),_0x571e43,JSON['stringify'](_0x1ea722));_0x527a70(_0x1ea722);})[_0xcb50('0x24')](function(_0x1ab4c0){logger[_0xcb50('0x15')](_0xcb50('0x26'),_0x1ab4c0[_0xcb50('0x17')],_0x571e43);_0x467293(_0x3c398d[_0xcb50('0x15')](0x1f4,_0x1ab4c0[_0xcb50('0x17')]));});});}; \ No newline at end of file +var _0x0941=['MailQueue,\x20%s,\x20%s,\x20%s','error','code','MailQueue,\x20%s,\x20%s','message','info','result','catch','GetMailQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailQueue','MailQueue','find','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','request\x20sent','debug'];(function(_0x1afeea,_0x4af88a){var _0x3d8791=function(_0x56077f){while(--_0x56077f){_0x1afeea['push'](_0x1afeea['shift']());}};_0x3d8791(++_0x4af88a);}(_0x0941,0xd3));var _0x1094=function(_0x30c361,_0x3f08c7){_0x30c361=_0x30c361-0x0;var _0xf09249=_0x0941[_0x30c361];return _0xf09249;};'use strict';var _=require('lodash');var util=require(_0x1094('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1094('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x1094('0x2'));var logger=require(_0x1094('0x3'))(_0x1094('0x4'));var config=require('../../config/environment');var jayson=require(_0x1094('0x5'));var client=jayson[_0x1094('0x6')][_0x1094('0x7')]({'port':0x232a});config[_0x1094('0x8')]=_[_0x1094('0x9')](config[_0x1094('0x8')],{'host':_0x1094('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1094('0x8')]));require(_0x1094('0xb'))[_0x1094('0xc')](socket);function respondWithRpcPromise(_0xcd47ad,_0x1c2495,_0x5cc29b){return new BPromise(function(_0x574eb4,_0x52d3ce){return client[_0x1094('0xd')](_0xcd47ad,_0x5cc29b)[_0x1094('0xe')](function(_0x3d730c){logger['info']('MailQueue,\x20%s,\x20%s',_0x1c2495,_0x1094('0xf'));logger[_0x1094('0x10')](_0x1094('0x11'),_0x1c2495,'request\x20sent',JSON['stringify'](_0x3d730c));if(_0x3d730c[_0x1094('0x12')]){if(_0x3d730c[_0x1094('0x12')][_0x1094('0x13')]===0x1f4){logger['error'](_0x1094('0x14'),_0x1c2495,_0x3d730c[_0x1094('0x12')][_0x1094('0x15')]);return _0x52d3ce(_0x3d730c['error']['message']);}logger[_0x1094('0x12')](_0x1094('0x14'),_0x1c2495,_0x3d730c[_0x1094('0x12')][_0x1094('0x15')]);return _0x574eb4(_0x3d730c[_0x1094('0x12')][_0x1094('0x15')]);}else{logger[_0x1094('0x16')](_0x1094('0x14'),_0x1c2495,_0x1094('0xf'));_0x574eb4(_0x3d730c[_0x1094('0x17')][_0x1094('0x15')]);}})[_0x1094('0x18')](function(_0x508844){logger['error'](_0x1094('0x14'),_0x1c2495,_0x508844);_0x52d3ce(_0x508844);});});}exports[_0x1094('0x19')]=function(_0x36ecc1){var _0x3f7898=this;return new Promise(function(_0x4073dc,_0x7834d9){return db['MailQueue']['findAll']({'raw':_0x36ecc1['options']?_0x36ecc1[_0x1094('0x1a')][_0x1094('0x1b')]===undefined?!![]:![]:!![],'where':_0x36ecc1[_0x1094('0x1a')]?_0x36ecc1[_0x1094('0x1a')][_0x1094('0x1c')]||null:null,'attributes':_0x36ecc1[_0x1094('0x1a')]?_0x36ecc1[_0x1094('0x1a')][_0x1094('0x1d')]||null:null,'limit':_0x36ecc1[_0x1094('0x1a')]?_0x36ecc1['options'][_0x1094('0x1e')]||null:null,'include':_0x36ecc1[_0x1094('0x1a')]?_0x36ecc1[_0x1094('0x1a')][_0x1094('0x1f')]?_[_0x1094('0x20')](_0x36ecc1[_0x1094('0x1a')][_0x1094('0x1f')],function(_0x4ed880){return{'model':db[_0x4ed880[_0x1094('0x21')]],'as':_0x4ed880['as'],'attributes':_0x4ed880[_0x1094('0x1d')],'include':_0x4ed880['include']?_[_0x1094('0x20')](_0x4ed880[_0x1094('0x1f')],function(_0x547ecc){return{'model':db[_0x547ecc[_0x1094('0x21')]],'as':_0x547ecc['as'],'attributes':_0x547ecc[_0x1094('0x1d')],'include':_0x547ecc['include']?_[_0x1094('0x20')](_0x547ecc['include'],function(_0x49f0dd){return{'model':db[_0x49f0dd[_0x1094('0x21')]],'as':_0x49f0dd['as'],'attributes':_0x49f0dd[_0x1094('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1094('0xe')](function(_0xa4fb56){logger[_0x1094('0x16')]('GetMailQueue',_0x36ecc1);logger[_0x1094('0x10')](_0x1094('0x19'),_0x36ecc1,JSON[_0x1094('0x22')](_0xa4fb56));_0x4073dc(_0xa4fb56);})[_0x1094('0x18')](function(_0x27d8aa){logger[_0x1094('0x12')](_0x1094('0x19'),_0x27d8aa[_0x1094('0x15')],_0x36ecc1);_0x7834d9(_0x3f7898[_0x1094('0x12')](0x1f4,_0x27d8aa[_0x1094('0x15')]));});});};exports[_0x1094('0x23')]=function(_0x510cb4){var _0x47a5e3=this;return new Promise(function(_0x2faea5,_0x1def1d){return db[_0x1094('0x24')][_0x1094('0x25')]({'raw':_0x510cb4['options']?_0x510cb4[_0x1094('0x1a')][_0x1094('0x1b')]===undefined?!![]:![]:!![],'where':_0x510cb4[_0x1094('0x1a')]?_0x510cb4['options'][_0x1094('0x1c')]||null:null,'attributes':_0x510cb4[_0x1094('0x1a')]?_0x510cb4[_0x1094('0x1a')]['attributes']||null:null,'include':_0x510cb4['options']?_0x510cb4[_0x1094('0x1a')][_0x1094('0x1f')]?_[_0x1094('0x20')](_0x510cb4[_0x1094('0x1a')][_0x1094('0x1f')],function(_0x1d040d){return{'model':db[_0x1d040d[_0x1094('0x21')]],'as':_0x1d040d['as'],'attributes':_0x1d040d[_0x1094('0x1d')],'include':_0x1d040d[_0x1094('0x1f')]?_[_0x1094('0x20')](_0x1d040d[_0x1094('0x1f')],function(_0x49f1c8){return{'model':db[_0x49f1c8[_0x1094('0x21')]],'as':_0x49f1c8['as'],'attributes':_0x49f1c8[_0x1094('0x1d')],'include':_0x49f1c8['include']?_[_0x1094('0x20')](_0x49f1c8[_0x1094('0x1f')],function(_0x5894be){return{'model':db[_0x5894be[_0x1094('0x21')]],'as':_0x5894be['as'],'attributes':_0x5894be[_0x1094('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1094('0xe')](function(_0x3a0bc3){logger[_0x1094('0x16')](_0x1094('0x23'),_0x510cb4);logger[_0x1094('0x10')]('ShowMailQueue',_0x510cb4,JSON['stringify'](_0x3a0bc3));_0x2faea5(_0x3a0bc3);})[_0x1094('0x18')](function(_0x2d1b21){logger[_0x1094('0x12')]('ShowMailQueue',_0x2d1b21[_0x1094('0x15')],_0x510cb4);_0x1def1d(_0x47a5e3[_0x1094('0x12')](0x1f4,_0x2d1b21[_0x1094('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9f97a80..dd2637c 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 _0xc965=['update','emit','removeListener','register','length','save'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xc965,0x1df));var _0x5c96=function(_0x483657,_0x4c9172){_0x483657=_0x483657-0x0;var _0xe9877c=_0xc965[_0x483657];return _0xe9877c;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x5c96('0x0'),'remove',_0x5c96('0x1')];function createListener(_0xd1c710,_0x1bd47e){return function(_0x3bd000){_0x1bd47e[_0x5c96('0x2')](_0xd1c710,_0x3bd000);};}function removeListener(_0x5b1753,_0x1ebfcf){return function(){MailQueueEvents[_0x5c96('0x3')](_0x5b1753,_0x1ebfcf);};}exports[_0x5c96('0x4')]=function(_0x29053f){for(var _0x53e0f0=0x0,_0x3d960b=events[_0x5c96('0x5')];_0x53e0f0<_0x3d960b;_0x53e0f0++){var _0x539482=events[_0x53e0f0];var _0x3bb3d5=createListener('mailQueue:'+_0x539482,_0x29053f);MailQueueEvents['on'](_0x539482,_0x3bb3d5);}}; \ No newline at end of file +var _0xe900=['length','./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x297c5a,_0x4f29f0){var _0x29efd8=function(_0x512f6e){while(--_0x512f6e){_0x297c5a['push'](_0x297c5a['shift']());}};_0x29efd8(++_0x4f29f0);}(_0xe900,0xfd));var _0x0e90=function(_0x2ff958,_0x5058e1){_0x2ff958=_0x2ff958-0x0;var _0x119316=_0xe900[_0x2ff958];return _0x119316;};'use strict';var MailQueueEvents=require(_0x0e90('0x0'));var events=[_0x0e90('0x1'),'remove',_0x0e90('0x2')];function createListener(_0x2561d8,_0x3343b1){return function(_0x5a795e){_0x3343b1[_0x0e90('0x3')](_0x2561d8,_0x5a795e);};}function removeListener(_0x19cf6c,_0x2640b3){return function(){MailQueueEvents[_0x0e90('0x4')](_0x19cf6c,_0x2640b3);};}exports[_0x0e90('0x5')]=function(_0x17344a){for(var _0x4f4106=0x0,_0x1673bf=events[_0x0e90('0x6')];_0x4f4106<_0x1673bf;_0x4f4106++){var _0x599702=events[_0x4f4106];var _0x29d410=createListener('mailQueue:'+_0x599702,_0x17344a);MailQueueEvents['on'](_0x599702,_0x29d410);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e4ee5e9..cda275b 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 _0x68e9=['post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x68e9,0x65));var _0x968e=function(_0xbce261,_0x5bf87e){_0xbce261=_0xbce261-0x0;var _0x23848f=_0x68e9[_0xbce261];return _0x23848f;};'use strict';var multer=require(_0x968e('0x0'));var util=require(_0x968e('0x1'));var path=require(_0x968e('0x2'));var timeout=require(_0x968e('0x3'));var express=require(_0x968e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x968e('0x5'));var config=require(_0x968e('0x6'));var controller=require('./mailQueueReport.controller');router[_0x968e('0x7')]('/',auth['isAuthenticated'](),controller[_0x968e('0x8')]);router[_0x968e('0x7')]('/describe',auth[_0x968e('0x9')](),controller['describe']);router[_0x968e('0x7')](_0x968e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x968e('0xb')]('/',auth[_0x968e('0x9')](),controller['create']);router['put'](_0x968e('0xa'),auth[_0x968e('0x9')](),controller[_0x968e('0xc')]);router[_0x968e('0xd')](_0x968e('0xa'),auth[_0x968e('0x9')](),controller[_0x968e('0xe')]);module[_0x968e('0xf')]=router; \ No newline at end of file +var _0x8126=['/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x8126,0x185));var _0x6812=function(_0x2f9d83,_0xfbc7e7){_0x2f9d83=_0x2f9d83-0x0;var _0x112d5f=_0x8126[_0x2f9d83];return _0x112d5f;};'use strict';var multer=require(_0x6812('0x0'));var util=require(_0x6812('0x1'));var path=require(_0x6812('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6812('0x3'));var auth=require(_0x6812('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6812('0x5'));var controller=require(_0x6812('0x6'));router[_0x6812('0x7')]('/',auth[_0x6812('0x8')](),controller[_0x6812('0x9')]);router[_0x6812('0x7')](_0x6812('0xa'),auth[_0x6812('0x8')](),controller[_0x6812('0xb')]);router[_0x6812('0x7')]('/:id',auth[_0x6812('0x8')](),controller[_0x6812('0xc')]);router[_0x6812('0xd')]('/',auth[_0x6812('0x8')](),controller[_0x6812('0xe')]);router[_0x6812('0xf')](_0x6812('0x10'),auth[_0x6812('0x8')](),controller[_0x6812('0x11')]);router[_0x6812('0x12')](_0x6812('0x10'),auth[_0x6812('0x8')](),controller[_0x6812('0x13')]);module[_0x6812('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index cff84a4..3bcb698 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 _0xd9bb=['sequelize','STRING','DATE'];(function(_0x198e31,_0x40a587){var _0x53a680=function(_0x294156){while(--_0x294156){_0x198e31['push'](_0x198e31['shift']());}};_0x53a680(++_0x40a587);}(_0xd9bb,0x11d));var _0xbd9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9bb[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var Sequelize=require(_0xbd9b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbd9b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xbd9b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbd9b('0x2')]},'acceptAt':{'type':Sequelize[_0xbd9b('0x2')]},'exitAt':{'type':Sequelize[_0xbd9b('0x2')]},'reason':{'type':Sequelize[_0xbd9b('0x1')]}}; \ No newline at end of file +var _0x5139=['moment','sequelize','STRING','DATE'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x5139,0x8c));var _0x9513=function(_0xdfa519,_0x303e9b){_0xdfa519=_0xdfa519-0x0;var _0x4d007e=_0x5139[_0xdfa519];return _0x4d007e;};'use strict';var moment=require(_0x9513('0x0'));var Sequelize=require(_0x9513('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9513('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9513('0x2')]},'joinAt':{'type':Sequelize[_0x9513('0x3')]},'leaveAt':{'type':Sequelize[_0x9513('0x3')]},'acceptAt':{'type':Sequelize[_0x9513('0x3')]},'exitAt':{'type':Sequelize[_0x9513('0x3')]},'reason':{'type':Sequelize[_0x9513('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index bdc4e16..6b523a1 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 _0x9f0e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3e9a0e,_0x1eafa2){_0x3e9a0e=_0x3e9a0e-0x0;var _0x174c92=_0x9f0e[_0x3e9a0e];return _0x174c92;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':!![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['MailQueueReport'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['MailQueueReport'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));}; \ No newline at end of file +var _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x376e1b,_0x211a12){var _0x136b56=function(_0x4a06e0){while(--_0x4a06e0){_0x376e1b['push'](_0x376e1b['shift']());}};_0x136b56(++_0x211a12);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['MailQueueReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 325f0fa..abf08ba 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 _0xad30=['../../config/logger','moment','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xad30,0x82));var _0x0ad3=function(_0x271580,_0x4281b0){_0x271580=_0x271580-0x0;var _0x4ef178=_0xad30[_0x271580];return _0x4ef178;};'use strict';var _=require(_0x0ad3('0x0'));var util=require(_0x0ad3('0x1'));var logger=require(_0x0ad3('0x2'))('api');var moment=require(_0x0ad3('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ad3('0x4'));var fs=require('fs');var path=require(_0x0ad3('0x5'));var rimraf=require(_0x0ad3('0x6'));var config=require('../../config/environment');var attributes=require(_0x0ad3('0x7'));module[_0x0ad3('0x8')]=function(_0x22329a,_0x34ba3a){return _0x22329a[_0x0ad3('0x9')](_0x0ad3('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0ad3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa541=['../../config/environment','./mailQueueReport.attributes','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x13d116,_0xcf6856){var _0x6ad8d4=function(_0x3055ae){while(--_0x3055ae){_0x13d116['push'](_0x13d116['shift']());}};_0x6ad8d4(++_0xcf6856);}(_0xa541,0xcb));var _0x1a54=function(_0x1a3f16,_0x3aa362){_0x1a3f16=_0x1a3f16-0x0;var _0x4405b2=_0xa541[_0x1a3f16];return _0x4405b2;};'use strict';var _=require(_0x1a54('0x0'));var util=require(_0x1a54('0x1'));var logger=require(_0x1a54('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1a54('0x3'));var rp=require(_0x1a54('0x4'));var fs=require('fs');var path=require(_0x1a54('0x5'));var rimraf=require(_0x1a54('0x6'));var config=require(_0x1a54('0x7'));var attributes=require(_0x1a54('0x8'));module['exports']=function(_0x4166e8,_0x17a35f){return _0x4166e8['define']('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x1a54('0x9'),'fields':[_0x1a54('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2ef9e75..4c8cc6b 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x154ebd,_0x2cd326){var _0x5e2b19=function(_0x16b8f4){while(--_0x16b8f4){_0x154ebd['push'](_0x154ebd['shift']());}};_0x5e2b19(++_0x2cd326);}(_0xadb5,0xad));var _0x5adb=function(_0x3e19fe,_0x5cd9c5){_0x3e19fe=_0x3e19fe-0x0;var _0x35e40e=_0xadb5[_0x3e19fe];return _0x35e40e;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2182ba,_0x46ffa8){var _0x20a206=function(_0xe3ce4e){while(--_0xe3ce4e){_0x2182ba['push'](_0x2182ba['shift']());}};_0x20a206(++_0x46ffa8);}(_0x326f,0xd1));var _0xf326=function(_0x3232b8,_0x170c0e){_0x3232b8=_0x3232b8-0x0;var _0x269b51=_0x326f[_0x3232b8];return _0x269b51;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 0ddf2a6..59988c9 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2ed08e,_0x31e039){var _0x5d98cb=function(_0x345294){while(--_0x345294){_0x2ed08e['push'](_0x2ed08e['shift']());}};_0x5d98cb(++_0x31e039);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x237fcb,_0x3c99dc){var _0x4b470f=function(_0x5433b5){while(--_0x5433b5){_0x237fcb['push'](_0x237fcb['shift']());}};_0x4b470f(++_0x3c99dc);}(_0x70e0,0x17b));var _0x070e=function(_0x5b5db9,_0x4db24d){_0x5b5db9=_0x5b5db9-0x0;var _0x1f660e=_0x70e0[_0x5b5db9];return _0x1f660e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index e0cc9c1..ef67d61 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 _0x74f0=['STRING','INTEGER','INBOX','exports','BOOLEAN'];(function(_0x435dde,_0x2a2fa3){var _0x4aca2d=function(_0x283a96){while(--_0x283a96){_0x435dde['push'](_0x435dde['shift']());}};_0x4aca2d(++_0x2a2fa3);}(_0x74f0,0xf3));var _0x074f=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x74f0[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require('sequelize');module[_0x074f('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x074f('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x074f('0x2')]},'password':{'type':Sequelize[_0x074f('0x2')]},'port':{'type':Sequelize[_0x074f('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x074f('0x4')},'connTimeout':{'type':Sequelize[_0x074f('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x074f('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x074f('0x2')]}}; \ No newline at end of file +var _0x131e=['STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x724bdb,_0x5d30be){var _0x5ac6cc=function(_0x2d7715){while(--_0x2d7715){_0x724bdb['push'](_0x724bdb['shift']());}};_0x5ac6cc(++_0x5d30be);}(_0x131e,0x1ec));var _0xe131=function(_0x4b61ca,_0x16318e){_0x4b61ca=_0x4b61ca-0x0;var _0x3de704=_0x131e[_0x4b61ca];return _0x3de704;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe131('0x0')]},'authentication':{'type':Sequelize[_0xe131('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xe131('0x0')]},'password':{'type':Sequelize[_0xe131('0x0')]},'port':{'type':Sequelize[_0xe131('0x2')]},'tls':{'type':Sequelize[_0xe131('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xe131('0x3')},'connTimeout':{'type':Sequelize[_0xe131('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe131('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe131('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 154ba0c..300cd25 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 _0xb15b=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash'];(function(_0x53afa6,_0x59e786){var _0x51f86a=function(_0x368385){while(--_0x368385){_0x53afa6['push'](_0x53afa6['shift']());}};_0x51f86a(++_0x59e786);}(_0xb15b,0x8b));var _0xbb15=function(_0x51e453,_0xa3da96){_0x51e453=_0x51e453-0x0;var _0x4addc8=_0xb15b[_0x51e453];return _0x4addc8;};'use strict';var _=require(_0xbb15('0x0'));var util=require(_0xbb15('0x1'));var logger=require(_0xbb15('0x2'))(_0xbb15('0x3'));var moment=require('moment');var BPromise=require(_0xbb15('0x4'));var rp=require(_0xbb15('0x5'));var fs=require('fs');var path=require(_0xbb15('0x6'));var rimraf=require(_0xbb15('0x7'));var config=require(_0xbb15('0x8'));var attributes=require(_0xbb15('0x9'));module[_0xbb15('0xa')]=function(_0xbb3964,_0x133ef9){return _0xbb3964[_0xbb15('0xb')](_0xbb15('0xc'),attributes,{'tableName':_0xbb15('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99d3=['MailServerIn','mail_servers_in','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x143992,_0x3742f7){var _0x479be4=function(_0x504308){while(--_0x504308){_0x143992['push'](_0x143992['shift']());}};_0x479be4(++_0x3742f7);}(_0x99d3,0x1f1));var _0x399d=function(_0x243454,_0x269ab0){_0x243454=_0x243454-0x0;var _0x58abbf=_0x99d3[_0x243454];return _0x58abbf;};'use strict';var _=require(_0x399d('0x0'));var util=require('util');var logger=require(_0x399d('0x1'))(_0x399d('0x2'));var moment=require('moment');var BPromise=require(_0x399d('0x3'));var rp=require(_0x399d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x399d('0x5'));var config=require(_0x399d('0x6'));var attributes=require(_0x399d('0x7'));module[_0x399d('0x8')]=function(_0x1d7979,_0x5f0272){return _0x1d7979['define'](_0x399d('0x9'),attributes,{'tableName':_0x399d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 48f53de..ec08278 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 _0x6cbf=['MailServerIn','options','where','attributes','limit','include','map','model','GetMailServerIn','debug','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5a9596,_0x195cbf){var _0xd020e0=function(_0x109a61){while(--_0x109a61){_0x5a9596['push'](_0x5a9596['shift']());}};_0xd020e0(++_0x195cbf);}(_0x6cbf,0x122));var _0xf6cb=function(_0x116528,_0x42e851){_0x116528=_0x116528-0x0;var _0x23f713=_0x6cbf[_0x116528];return _0x23f713;};'use strict';var _=require(_0xf6cb('0x0'));var util=require('util');var moment=require(_0xf6cb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6cb('0x2'));var db=require(_0xf6cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6cb('0x4'))(_0xf6cb('0x5'));var config=require(_0xf6cb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf6cb('0x7')][_0xf6cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc5bde1,_0x5ab9e2,_0x39ba5e){return new BPromise(function(_0x27cc2d,_0xb73a29){return client['request'](_0xc5bde1,_0x39ba5e)['then'](function(_0x4ab999){logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,_0xf6cb('0xb'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x5ab9e2,_0xf6cb('0xb'),JSON[_0xf6cb('0xc')](_0x4ab999));if(_0x4ab999[_0xf6cb('0xd')]){if(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xe')]===0x1f4){logger['error'](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0xb73a29(_0x4ab999[_0xf6cb('0xd')]['message']);}logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0x27cc2d(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);}else{logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,'request\x20sent');_0x27cc2d(_0x4ab999[_0xf6cb('0x10')]['message']);}})[_0xf6cb('0x11')](function(_0x1f3978){logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x1f3978);_0xb73a29(_0x1f3978);});});}exports['GetMailServerIn']=function(_0x52980d){var _0x5613dd=this;return new Promise(function(_0x145da2,_0x330b51){return db[_0xf6cb('0x12')]['findAll']({'raw':_0x52980d['options']?_0x52980d[_0xf6cb('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x52980d[_0xf6cb('0x13')]?_0x52980d['options'][_0xf6cb('0x14')]||null:null,'attributes':_0x52980d[_0xf6cb('0x13')]?_0x52980d[_0xf6cb('0x13')][_0xf6cb('0x15')]||null:null,'limit':_0x52980d[_0xf6cb('0x13')]?_0x52980d['options'][_0xf6cb('0x16')]||null:null,'include':_0x52980d[_0xf6cb('0x13')]?_0x52980d[_0xf6cb('0x13')]['include']?_['map'](_0x52980d[_0xf6cb('0x13')]['include'],function(_0x5a3a54){return{'model':db[_0x5a3a54['model']],'as':_0x5a3a54['as'],'attributes':_0x5a3a54['attributes'],'include':_0x5a3a54[_0xf6cb('0x17')]?_[_0xf6cb('0x18')](_0x5a3a54[_0xf6cb('0x17')],function(_0x407e28){return{'model':db[_0x407e28[_0xf6cb('0x19')]],'as':_0x407e28['as'],'attributes':_0x407e28[_0xf6cb('0x15')],'include':_0x407e28[_0xf6cb('0x17')]?_[_0xf6cb('0x18')](_0x407e28[_0xf6cb('0x17')],function(_0x2f5be6){return{'model':db[_0x2f5be6[_0xf6cb('0x19')]],'as':_0x2f5be6['as'],'attributes':_0x2f5be6[_0xf6cb('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x490a87){logger[_0xf6cb('0x9')](_0xf6cb('0x1a'),_0x52980d);logger[_0xf6cb('0x1b')](_0xf6cb('0x1a'),_0x52980d,JSON[_0xf6cb('0xc')](_0x490a87));_0x145da2(_0x490a87);})[_0xf6cb('0x11')](function(_0x2ed4a8){logger[_0xf6cb('0xd')](_0xf6cb('0x1a'),_0x2ed4a8['message'],_0x52980d);_0x330b51(_0x5613dd[_0xf6cb('0xd')](0x1f4,_0x2ed4a8[_0xf6cb('0xf')]));});});}; \ No newline at end of file +var _0xa8db=['client','http','request','then','info','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','include','map','model','attributes','debug','stringify','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x350107,_0x7192d2){var _0x123ce6=function(_0x1ee599){while(--_0x1ee599){_0x350107['push'](_0x350107['shift']());}};_0x123ce6(++_0x7192d2);}(_0xa8db,0x16d));var _0xba8d=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xa8db[_0x1ae4a9];return _0x54d0b0;};'use strict';var _=require('lodash');var util=require(_0xba8d('0x0'));var moment=require(_0xba8d('0x1'));var BPromise=require(_0xba8d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba8d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba8d('0x4'));var logger=require(_0xba8d('0x5'))(_0xba8d('0x6'));var config=require(_0xba8d('0x7'));var jayson=require(_0xba8d('0x8'));var client=jayson[_0xba8d('0x9')][_0xba8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5996bc,_0x2e075c,_0x16f68b){return new BPromise(function(_0x489d79,_0x408601){return client[_0xba8d('0xb')](_0x5996bc,_0x16f68b)[_0xba8d('0xc')](function(_0x435bcc){logger[_0xba8d('0xd')]('MailServerIn,\x20%s,\x20%s',_0x2e075c,_0xba8d('0xe'));logger['debug'](_0xba8d('0xf'),_0x2e075c,_0xba8d('0xe'),JSON['stringify'](_0x435bcc));if(_0x435bcc['error']){if(_0x435bcc[_0xba8d('0x10')][_0xba8d('0x11')]===0x1f4){logger[_0xba8d('0x10')](_0xba8d('0x12'),_0x2e075c,_0x435bcc[_0xba8d('0x10')][_0xba8d('0x13')]);return _0x408601(_0x435bcc[_0xba8d('0x10')][_0xba8d('0x13')]);}logger[_0xba8d('0x10')](_0xba8d('0x12'),_0x2e075c,_0x435bcc[_0xba8d('0x10')][_0xba8d('0x13')]);return _0x489d79(_0x435bcc[_0xba8d('0x10')][_0xba8d('0x13')]);}else{logger[_0xba8d('0xd')](_0xba8d('0x12'),_0x2e075c,_0xba8d('0xe'));_0x489d79(_0x435bcc[_0xba8d('0x14')][_0xba8d('0x13')]);}})[_0xba8d('0x15')](function(_0x3b4de2){logger[_0xba8d('0x10')](_0xba8d('0x12'),_0x2e075c,_0x3b4de2);_0x408601(_0x3b4de2);});});}exports[_0xba8d('0x16')]=function(_0x36924d){var _0x1d457=this;return new Promise(function(_0x240c7b,_0x51b5f8){return db[_0xba8d('0x17')][_0xba8d('0x18')]({'raw':_0x36924d['options']?_0x36924d[_0xba8d('0x19')][_0xba8d('0x1a')]===undefined?!![]:![]:!![],'where':_0x36924d[_0xba8d('0x19')]?_0x36924d['options'][_0xba8d('0x1b')]||null:null,'attributes':_0x36924d[_0xba8d('0x19')]?_0x36924d[_0xba8d('0x19')]['attributes']||null:null,'limit':_0x36924d[_0xba8d('0x19')]?_0x36924d[_0xba8d('0x19')]['limit']||null:null,'include':_0x36924d[_0xba8d('0x19')]?_0x36924d[_0xba8d('0x19')][_0xba8d('0x1c')]?_[_0xba8d('0x1d')](_0x36924d[_0xba8d('0x19')]['include'],function(_0x474a15){return{'model':db[_0x474a15[_0xba8d('0x1e')]],'as':_0x474a15['as'],'attributes':_0x474a15[_0xba8d('0x1f')],'include':_0x474a15[_0xba8d('0x1c')]?_[_0xba8d('0x1d')](_0x474a15['include'],function(_0x1bf56e){return{'model':db[_0x1bf56e[_0xba8d('0x1e')]],'as':_0x1bf56e['as'],'attributes':_0x1bf56e[_0xba8d('0x1f')],'include':_0x1bf56e[_0xba8d('0x1c')]?_['map'](_0x1bf56e[_0xba8d('0x1c')],function(_0x393802){return{'model':db[_0x393802[_0xba8d('0x1e')]],'as':_0x393802['as'],'attributes':_0x393802[_0xba8d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xba8d('0xc')](function(_0x180743){logger[_0xba8d('0xd')](_0xba8d('0x16'),_0x36924d);logger[_0xba8d('0x20')](_0xba8d('0x16'),_0x36924d,JSON[_0xba8d('0x21')](_0x180743));_0x240c7b(_0x180743);})[_0xba8d('0x15')](function(_0x280468){logger[_0xba8d('0x10')]('GetMailServerIn',_0x280468[_0xba8d('0x13')],_0x36924d);_0x51b5f8(_0x1d457[_0xba8d('0x10')](0x1f4,_0x280468[_0xba8d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 3be2640..526d813 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a54,0x106));var _0x47a5=function(_0x2a77e4,_0x3ff081){_0x2a77e4=_0x2a77e4-0x0;var _0x1dd344=_0x7a54[_0x2a77e4];return _0x1dd344;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7a54,0x106));var _0x47a5=function(_0x2f9523,_0x346cc2){_0x2f9523=_0x2f9523-0x0;var _0x3056ab=_0x7a54[_0x2f9523];return _0x3056ab;};'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 ef7d87e..a977346 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 _0x32de=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x32de,0x12c));var _0xe32d=function(_0x581481,_0x190792){_0x581481=_0x581481-0x0;var _0x4dfd79=_0x32de[_0x581481];return _0x4dfd79;};'use strict';var Sequelize=require(_0xe32d('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe32d('0x1')]},'pass':{'type':Sequelize[_0xe32d('0x1')]},'port':{'type':Sequelize[_0xe32d('0x2')]},'secure':{'type':Sequelize[_0xe32d('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xe32d('0x1')]},'authentication':{'type':Sequelize[_0xe32d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd236=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x2f4a9c,_0x55b90c){var _0x2db9d8=function(_0xe07986){while(--_0xe07986){_0x2f4a9c['push'](_0x2f4a9c['shift']());}};_0x2db9d8(++_0x55b90c);}(_0xd236,0x1e5));var _0x6d23=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd236[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0x6d23('0x0')]={'description':{'type':Sequelize[_0x6d23('0x1')]},'host':{'type':Sequelize[_0x6d23('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x6d23('0x1')]},'port':{'type':Sequelize[_0x6d23('0x2')]},'secure':{'type':Sequelize[_0x6d23('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x6d23('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 3079c42..71f2b4f 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 _0xadb0=['map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','stack','name','send','index'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xadb0,0x6a));var _0x0adb=function(_0x524724,_0x2a0709){_0x524724=_0x524724-0x0;var _0x2ae276=_0xadb0[_0x524724];return _0x2ae276;};'use strict';var emlformat=require(_0x0adb('0x0'));var rimraf=require(_0x0adb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0adb('0x2'));var rp=require('request-promise');var moment=require(_0x0adb('0x3'));var BPromise=require(_0x0adb('0x4'));var Mustache=require('mustache');var util=require(_0x0adb('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0adb('0x6'));var ejs=require(_0x0adb('0x7'));var fs=require('fs');var fs_extra=require(_0x0adb('0x8'));var _=require(_0x0adb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0adb('0xa'));var deskjs=require(_0x0adb('0xb'));var toCsv=require(_0x0adb('0x6'));var querystring=require(_0x0adb('0xc'));var Papa=require(_0x0adb('0xd'));var Redis=require(_0x0adb('0xe'));var authService=require(_0x0adb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0adb('0x10'));var hardwareService=require(_0x0adb('0x11'));var logger=require(_0x0adb('0x12'))(_0x0adb('0x13'));var utils=require(_0x0adb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0adb('0x15'))['db'];function respondWithStatusCode(_0xc1ba96,_0x45bab4){_0x45bab4=_0x45bab4||0xcc;return function(_0x411645){if(_0x411645){return _0xc1ba96[_0x0adb('0x16')](_0x45bab4);}return _0xc1ba96[_0x0adb('0x17')](_0x45bab4)[_0x0adb('0x18')]();};}function respondWithResult(_0x569549,_0x452a63){_0x452a63=_0x452a63||0xc8;return function(_0x507d77){if(_0x507d77){return _0x569549[_0x0adb('0x17')](_0x452a63)[_0x0adb('0x19')](_0x507d77);}};}function respondWithFilteredResult(_0x17daca,_0x213bb1){return function(_0x98db71){if(_0x98db71){var _0x5db0ff=typeof _0x213bb1[_0x0adb('0x1a')]===_0x0adb('0x1b')&&typeof _0x213bb1['limit']===_0x0adb('0x1b');var _0x289a83=_0x98db71['count'];var _0x308d73=_0x5db0ff?0x0:_0x213bb1[_0x0adb('0x1a')];var _0x3de1c3=_0x5db0ff?_0x98db71[_0x0adb('0x1c')]:_0x213bb1[_0x0adb('0x1a')]+_0x213bb1[_0x0adb('0x1d')];var _0x4f6024;if(_0x3de1c3>=_0x289a83){_0x3de1c3=_0x289a83;_0x4f6024=0xc8;}else{_0x4f6024=0xce;}_0x17daca['status'](_0x4f6024);return _0x17daca[_0x0adb('0x1e')]('Content-Range',_0x308d73+'-'+_0x3de1c3+'/'+_0x289a83)[_0x0adb('0x19')](_0x98db71);}return null;};}function patchUpdates(_0x2cfa26){return function(_0x126a0b){try{jsonpatch[_0x0adb('0x1f')](_0x126a0b,_0x2cfa26,!![]);}catch(_0x13006d){return BPromise[_0x0adb('0x20')](_0x13006d);}return _0x126a0b[_0x0adb('0x21')]();};}function saveUpdates(_0x9d4a1b,_0x1eb785){return function(_0x3b6853){if(_0x3b6853){return _0x3b6853['update'](_0x9d4a1b)['then'](function(_0x353a47){return _0x353a47;});}return null;};}function removeEntity(_0x5c5360,_0x1dd227){return function(_0x448ca5){if(_0x448ca5){return _0x448ca5[_0x0adb('0x22')]()[_0x0adb('0x23')](function(){_0x5c5360['status'](0xcc)[_0x0adb('0x18')]();});}};}function handleEntityNotFound(_0x3f3428,_0x5f26e4){return function(_0x53eb8e){if(!_0x53eb8e){_0x3f3428[_0x0adb('0x16')](0x194);}return _0x53eb8e;};}function handleError(_0x4ebc40,_0x53a8ad){_0x53a8ad=_0x53a8ad||0x1f4;return function(_0x2644cb){logger['error'](_0x2644cb[_0x0adb('0x24')]);if(_0x2644cb[_0x0adb('0x25')]){delete _0x2644cb[_0x0adb('0x25')];}_0x4ebc40['status'](_0x53a8ad)[_0x0adb('0x26')](_0x2644cb);};}exports[_0x0adb('0x27')]=function(_0x4a8b31,_0xa26813){var _0x2ac85b={},_0x53dac8={},_0x4fd44c={'count':0x0,'rows':[]};var _0x1970b7=_[_0x0adb('0x28')](db[_0x0adb('0x29')][_0x0adb('0x2a')],function(_0x521c80){return{'name':_0x521c80[_0x0adb('0x2b')],'type':_0x521c80[_0x0adb('0x2c')][_0x0adb('0x2d')]};});_0x53dac8[_0x0adb('0x2e')]=_[_0x0adb('0x28')](_0x1970b7,'name');_0x53dac8[_0x0adb('0x2f')]=_[_0x0adb('0x30')](_0x4a8b31[_0x0adb('0x2f')]);_0x53dac8[_0x0adb('0x31')]=_[_0x0adb('0x32')](_0x53dac8['model'],_0x53dac8[_0x0adb('0x2f')]);_0x2ac85b[_0x0adb('0x33')]=_[_0x0adb('0x32')](_0x53dac8['model'],qs[_0x0adb('0x34')](_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x34')]));_0x2ac85b[_0x0adb('0x33')]=_0x2ac85b[_0x0adb('0x33')][_0x0adb('0x35')]?_0x2ac85b[_0x0adb('0x33')]:_0x53dac8['model'];if(!_0x4a8b31[_0x0adb('0x2f')]['hasOwnProperty'](_0x0adb('0x36'))){_0x2ac85b[_0x0adb('0x1d')]=qs[_0x0adb('0x1d')](_0x4a8b31['query'][_0x0adb('0x1d')]);_0x2ac85b[_0x0adb('0x1a')]=qs[_0x0adb('0x1a')](_0x4a8b31[_0x0adb('0x2f')]['offset']);}_0x2ac85b[_0x0adb('0x37')]=qs[_0x0adb('0x38')](_0x4a8b31[_0x0adb('0x2f')]['sort']);_0x2ac85b[_0x0adb('0x39')]=qs[_0x0adb('0x31')](_['pick'](_0x4a8b31['query'],_0x53dac8[_0x0adb('0x31')]),_0x1970b7);if(_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x3a')]){_0x2ac85b[_0x0adb('0x39')]=_[_0x0adb('0x3b')](_0x2ac85b['where'],{'$or':_[_0x0adb('0x28')](_0x1970b7,function(_0x1d5f68){if(_0x1d5f68['type']!==_0x0adb('0x3c')){var _0x7d6cff={};_0x7d6cff[_0x1d5f68['name']]={'$like':'%'+_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x3a')]+'%'};return _0x7d6cff;}})});}_0x2ac85b=_[_0x0adb('0x3b')]({},_0x2ac85b,_0x4a8b31[_0x0adb('0x3d')]);var _0x1d4fe3={'where':_0x2ac85b[_0x0adb('0x39')]};return db[_0x0adb('0x29')][_0x0adb('0x1c')](_0x1d4fe3)[_0x0adb('0x23')](function(_0x406c1f){_0x4fd44c[_0x0adb('0x1c')]=_0x406c1f;if(_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x3e')]){_0x2ac85b[_0x0adb('0x3f')]=[{'all':!![]}];}return db[_0x0adb('0x29')][_0x0adb('0x40')](_0x2ac85b);})[_0x0adb('0x23')](function(_0x503614){_0x4fd44c[_0x0adb('0x41')]=_0x503614;return _0x4fd44c;})['then'](respondWithFilteredResult(_0xa26813,_0x2ac85b))[_0x0adb('0x42')](handleError(_0xa26813,null));};exports[_0x0adb('0x43')]=function(_0x1a928b,_0x220491){var _0x212495={'raw':!![],'where':{'id':_0x1a928b[_0x0adb('0x44')]['id']}},_0x51982c={};_0x51982c[_0x0adb('0x2e')]=_[_0x0adb('0x30')](db[_0x0adb('0x29')]['rawAttributes']);_0x51982c[_0x0adb('0x2f')]=_['keys'](_0x1a928b['query']);_0x51982c[_0x0adb('0x31')]=_[_0x0adb('0x32')](_0x51982c[_0x0adb('0x2e')],_0x51982c[_0x0adb('0x2f')]);_0x212495[_0x0adb('0x33')]=_[_0x0adb('0x32')](_0x51982c[_0x0adb('0x2e')],qs[_0x0adb('0x34')](_0x1a928b[_0x0adb('0x2f')][_0x0adb('0x34')]));_0x212495['attributes']=_0x212495[_0x0adb('0x33')][_0x0adb('0x35')]?_0x212495['attributes']:_0x51982c[_0x0adb('0x2e')];if(_0x1a928b['query'][_0x0adb('0x3e')]){_0x212495['include']=[{'all':!![]}];}_0x212495=_[_0x0adb('0x3b')]({},_0x212495,_0x1a928b[_0x0adb('0x3d')]);return db[_0x0adb('0x29')][_0x0adb('0x45')](_0x212495)['then'](handleEntityNotFound(_0x220491,null))['then'](respondWithResult(_0x220491,null))['catch'](handleError(_0x220491,null));};exports[_0x0adb('0x46')]=function(_0x4b4d4f,_0x3aa093){return db[_0x0adb('0x29')]['create'](_0x4b4d4f[_0x0adb('0x47')],{})[_0x0adb('0x23')](respondWithResult(_0x3aa093,0xc9))[_0x0adb('0x42')](handleError(_0x3aa093,null));};exports[_0x0adb('0x48')]=function(_0x2a6d9f,_0x360ba8){if(_0x2a6d9f[_0x0adb('0x47')]['id']){delete _0x2a6d9f[_0x0adb('0x47')]['id'];}return db[_0x0adb('0x29')][_0x0adb('0x45')]({'where':{'id':_0x2a6d9f[_0x0adb('0x44')]['id']}})[_0x0adb('0x23')](handleEntityNotFound(_0x360ba8,null))[_0x0adb('0x23')](saveUpdates(_0x2a6d9f['body'],null))[_0x0adb('0x23')](respondWithResult(_0x360ba8,null))[_0x0adb('0x42')](handleError(_0x360ba8,null));};exports['destroy']=function(_0x1fedb4,_0x47b5c9){return db['MailServerOut'][_0x0adb('0x45')]({'where':{'id':_0x1fedb4['params']['id']}})[_0x0adb('0x23')](handleEntityNotFound(_0x47b5c9,null))[_0x0adb('0x23')](removeEntity(_0x47b5c9,null))[_0x0adb('0x42')](handleError(_0x47b5c9,null));}; \ No newline at end of file +var _0x17b6=['body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x17b6,0x1be));var _0x617b=function(_0x3e1d30,_0x75e7ff){_0x3e1d30=_0x3e1d30-0x0;var _0xb76703=_0x17b6[_0x3e1d30];return _0xb76703;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x617b('0x0'));var jsonpatch=require(_0x617b('0x1'));var rp=require(_0x617b('0x2'));var moment=require(_0x617b('0x3'));var BPromise=require(_0x617b('0x4'));var Mustache=require(_0x617b('0x5'));var util=require('util');var path=require(_0x617b('0x6'));var sox=require(_0x617b('0x7'));var csv=require(_0x617b('0x8'));var ejs=require(_0x617b('0x9'));var fs=require('fs');var fs_extra=require(_0x617b('0xa'));var _=require(_0x617b('0xb'));var squel=require(_0x617b('0xc'));var crypto=require(_0x617b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x617b('0xe'));var toCsv=require(_0x617b('0x8'));var querystring=require(_0x617b('0xf'));var Papa=require(_0x617b('0x10'));var Redis=require(_0x617b('0x11'));var authService=require(_0x617b('0x12'));var qs=require(_0x617b('0x13'));var as=require(_0x617b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x617b('0x15'))('api');var utils=require(_0x617b('0x16'));var config=require(_0x617b('0x17'));var licenseUtil=require(_0x617b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19af28,_0x2d96b0){_0x2d96b0=_0x2d96b0||0xcc;return function(_0x16f409){if(_0x16f409){return _0x19af28[_0x617b('0x19')](_0x2d96b0);}return _0x19af28[_0x617b('0x1a')](_0x2d96b0)[_0x617b('0x1b')]();};}function respondWithResult(_0x47a4c8,_0x1941d8){_0x1941d8=_0x1941d8||0xc8;return function(_0x4481f5){if(_0x4481f5){return _0x47a4c8[_0x617b('0x1a')](_0x1941d8)[_0x617b('0x1c')](_0x4481f5);}};}function respondWithFilteredResult(_0x1dfffc,_0xfa937b){return function(_0x53804f){if(_0x53804f){var _0x1f9984=typeof _0xfa937b['offset']==='undefined'&&typeof _0xfa937b[_0x617b('0x1d')]===_0x617b('0x1e');var _0x2a67e6=_0x53804f['count'];var _0x496028=_0x1f9984?0x0:_0xfa937b[_0x617b('0x1f')];var _0x12eaa0=_0x1f9984?_0x53804f[_0x617b('0x20')]:_0xfa937b['offset']+_0xfa937b['limit'];var _0x158a0c;if(_0x12eaa0>=_0x2a67e6){_0x12eaa0=_0x2a67e6;_0x158a0c=0xc8;}else{_0x158a0c=0xce;}_0x1dfffc['status'](_0x158a0c);return _0x1dfffc[_0x617b('0x21')](_0x617b('0x22'),_0x496028+'-'+_0x12eaa0+'/'+_0x2a67e6)[_0x617b('0x1c')](_0x53804f);}return null;};}function patchUpdates(_0x1c5f9a){return function(_0x11a3c3){try{jsonpatch[_0x617b('0x23')](_0x11a3c3,_0x1c5f9a,!![]);}catch(_0x26efde){return BPromise[_0x617b('0x24')](_0x26efde);}return _0x11a3c3['save']();};}function saveUpdates(_0x2fcc6d,_0x1c331c){return function(_0x294b31){if(_0x294b31){return _0x294b31[_0x617b('0x25')](_0x2fcc6d)[_0x617b('0x26')](function(_0x5a4144){return _0x5a4144;});}return null;};}function removeEntity(_0x260efd,_0xfd342c){return function(_0x517aeb){if(_0x517aeb){return _0x517aeb[_0x617b('0x27')]()[_0x617b('0x26')](function(){_0x260efd[_0x617b('0x1a')](0xcc)[_0x617b('0x1b')]();});}};}function handleEntityNotFound(_0x3337db,_0x302591){return function(_0x330191){if(!_0x330191){_0x3337db[_0x617b('0x19')](0x194);}return _0x330191;};}function handleError(_0x37153c,_0x4e65bf){_0x4e65bf=_0x4e65bf||0x1f4;return function(_0x4b1d61){logger[_0x617b('0x28')](_0x4b1d61[_0x617b('0x29')]);if(_0x4b1d61[_0x617b('0x2a')]){delete _0x4b1d61['name'];}_0x37153c['status'](_0x4e65bf)['send'](_0x4b1d61);};}exports[_0x617b('0x2b')]=function(_0x51c3de,_0x1fc1cc){var _0x2bd296={},_0x233c5d={},_0x522cc7={'count':0x0,'rows':[]};var _0x9af702=_[_0x617b('0x2c')](db[_0x617b('0x2d')][_0x617b('0x2e')],function(_0x562ddf){return{'name':_0x562ddf[_0x617b('0x2f')],'type':_0x562ddf['type'][_0x617b('0x30')]};});_0x233c5d[_0x617b('0x31')]=_['map'](_0x9af702,_0x617b('0x2a'));_0x233c5d[_0x617b('0x32')]=_[_0x617b('0x33')](_0x51c3de[_0x617b('0x32')]);_0x233c5d[_0x617b('0x34')]=_['intersection'](_0x233c5d[_0x617b('0x31')],_0x233c5d[_0x617b('0x32')]);_0x2bd296['attributes']=_[_0x617b('0x35')](_0x233c5d[_0x617b('0x31')],qs[_0x617b('0x36')](_0x51c3de[_0x617b('0x32')][_0x617b('0x36')]));_0x2bd296[_0x617b('0x37')]=_0x2bd296[_0x617b('0x37')][_0x617b('0x38')]?_0x2bd296[_0x617b('0x37')]:_0x233c5d[_0x617b('0x31')];if(!_0x51c3de[_0x617b('0x32')][_0x617b('0x39')](_0x617b('0x3a'))){_0x2bd296[_0x617b('0x1d')]=qs[_0x617b('0x1d')](_0x51c3de[_0x617b('0x32')][_0x617b('0x1d')]);_0x2bd296['offset']=qs[_0x617b('0x1f')](_0x51c3de[_0x617b('0x32')][_0x617b('0x1f')]);}_0x2bd296['order']=qs['sort'](_0x51c3de['query']['sort']);_0x2bd296[_0x617b('0x3b')]=qs[_0x617b('0x34')](_[_0x617b('0x3c')](_0x51c3de[_0x617b('0x32')],_0x233c5d[_0x617b('0x34')]),_0x9af702);if(_0x51c3de[_0x617b('0x32')]['filter']){_0x2bd296[_0x617b('0x3b')]=_['merge'](_0x2bd296['where'],{'$or':_[_0x617b('0x2c')](_0x9af702,function(_0x2bd63c){if(_0x2bd63c[_0x617b('0x3d')]!==_0x617b('0x3e')){var _0x5dcf30={};_0x5dcf30[_0x2bd63c[_0x617b('0x2a')]]={'$like':'%'+_0x51c3de[_0x617b('0x32')]['filter']+'%'};return _0x5dcf30;}})});}_0x2bd296=_[_0x617b('0x3f')]({},_0x2bd296,_0x51c3de[_0x617b('0x40')]);var _0x4b252e={'where':_0x2bd296[_0x617b('0x3b')]};return db[_0x617b('0x2d')]['count'](_0x4b252e)[_0x617b('0x26')](function(_0x5bddf5){_0x522cc7[_0x617b('0x20')]=_0x5bddf5;if(_0x51c3de['query'][_0x617b('0x41')]){_0x2bd296[_0x617b('0x42')]=[{'all':!![]}];}return db[_0x617b('0x2d')][_0x617b('0x43')](_0x2bd296);})['then'](function(_0x168499){_0x522cc7[_0x617b('0x44')]=_0x168499;return _0x522cc7;})['then'](respondWithFilteredResult(_0x1fc1cc,_0x2bd296))[_0x617b('0x45')](handleError(_0x1fc1cc,null));};exports[_0x617b('0x46')]=function(_0x3509c7,_0x573bfa){var _0x2e4c75={'raw':!![],'where':{'id':_0x3509c7['params']['id']}},_0x12ca58={};_0x12ca58[_0x617b('0x31')]=_[_0x617b('0x33')](db[_0x617b('0x2d')]['rawAttributes']);_0x12ca58[_0x617b('0x32')]=_[_0x617b('0x33')](_0x3509c7[_0x617b('0x32')]);_0x12ca58['filters']=_[_0x617b('0x35')](_0x12ca58[_0x617b('0x31')],_0x12ca58[_0x617b('0x32')]);_0x2e4c75['attributes']=_[_0x617b('0x35')](_0x12ca58[_0x617b('0x31')],qs[_0x617b('0x36')](_0x3509c7[_0x617b('0x32')][_0x617b('0x36')]));_0x2e4c75[_0x617b('0x37')]=_0x2e4c75[_0x617b('0x37')]['length']?_0x2e4c75[_0x617b('0x37')]:_0x12ca58[_0x617b('0x31')];if(_0x3509c7[_0x617b('0x32')][_0x617b('0x41')]){_0x2e4c75[_0x617b('0x42')]=[{'all':!![]}];}_0x2e4c75=_['merge']({},_0x2e4c75,_0x3509c7[_0x617b('0x40')]);return db[_0x617b('0x2d')]['find'](_0x2e4c75)[_0x617b('0x26')](handleEntityNotFound(_0x573bfa,null))[_0x617b('0x26')](respondWithResult(_0x573bfa,null))['catch'](handleError(_0x573bfa,null));};exports[_0x617b('0x47')]=function(_0x2b1b8a,_0x28ffc9){return db[_0x617b('0x2d')][_0x617b('0x47')](_0x2b1b8a[_0x617b('0x48')],{})[_0x617b('0x26')](respondWithResult(_0x28ffc9,0xc9))['catch'](handleError(_0x28ffc9,null));};exports[_0x617b('0x25')]=function(_0x1cb091,_0x585dfb){if(_0x1cb091[_0x617b('0x48')]['id']){delete _0x1cb091[_0x617b('0x48')]['id'];}return db[_0x617b('0x2d')][_0x617b('0x49')]({'where':{'id':_0x1cb091['params']['id']}})[_0x617b('0x26')](handleEntityNotFound(_0x585dfb,null))[_0x617b('0x26')](saveUpdates(_0x1cb091[_0x617b('0x48')],null))[_0x617b('0x26')](respondWithResult(_0x585dfb,null))[_0x617b('0x45')](handleError(_0x585dfb,null));};exports[_0x617b('0x27')]=function(_0xe83160,_0x18f189){return db[_0x617b('0x2d')][_0x617b('0x49')]({'where':{'id':_0xe83160['params']['id']}})[_0x617b('0x26')](handleEntityNotFound(_0x18f189,null))['then'](removeEntity(_0x18f189,null))['catch'](handleError(_0x18f189,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 81b2d9f..613a635 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 _0x007b=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','util','../../config/logger','api','moment'];(function(_0x1674cb,_0x2a9465){var _0x19b180=function(_0x353ee9){while(--_0x353ee9){_0x1674cb['push'](_0x1674cb['shift']());}};_0x19b180(++_0x2a9465);}(_0x007b,0x1ac));var _0xb007=function(_0x3f4fc4,_0x1fceee){_0x3f4fc4=_0x3f4fc4-0x0;var _0x9354f1=_0x007b[_0x3f4fc4];return _0x9354f1;};'use strict';var _=require('lodash');var util=require(_0xb007('0x0'));var logger=require(_0xb007('0x1'))(_0xb007('0x2'));var moment=require(_0xb007('0x3'));var BPromise=require('bluebird');var rp=require(_0xb007('0x4'));var fs=require('fs');var path=require(_0xb007('0x5'));var rimraf=require(_0xb007('0x6'));var config=require(_0xb007('0x7'));var attributes=require(_0xb007('0x8'));module['exports']=function(_0x228101,_0x54680c){return _0x228101[_0xb007('0x9')](_0xb007('0xa'),attributes,{'tableName':_0xb007('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf88b=['./mailServerOut.attributes','define','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf88b,0xe3));var _0xbf88=function(_0xc7fc03,_0x3950a8){_0xc7fc03=_0xc7fc03-0x0;var _0x3d962a=_0xf88b[_0xc7fc03];return _0x3d962a;};'use strict';var _=require(_0xbf88('0x0'));var util=require('util');var logger=require(_0xbf88('0x1'))(_0xbf88('0x2'));var moment=require(_0xbf88('0x3'));var BPromise=require(_0xbf88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf88('0x5'));var rimraf=require('rimraf');var config=require(_0xbf88('0x6'));var attributes=require(_0xbf88('0x7'));module['exports']=function(_0x274a55,_0x41b474){return _0x274a55[_0xbf88('0x8')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 5288ae9..8c590fc 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x85155b,_0x31ad43){var _0x477a11=function(_0x59e970){while(--_0x59e970){_0x85155b['push'](_0x85155b['shift']());}};_0x477a11(++_0x31ad43);}(_0xdb28,0x106));var _0x8db2=function(_0x2d6aff,_0x3d96c0){_0x2d6aff=_0x2d6aff-0x0;var _0x2284a1=_0xdb28[_0x2d6aff];return _0x2284a1;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3fcdf5,_0x503ca0){var _0x2d0786=function(_0x1ee5e2){while(--_0x1ee5e2){_0x3fcdf5['push'](_0x3fcdf5['shift']());}};_0x2d0786(++_0x503ca0);}(_0x2ef3,0xba));var _0x32ef=function(_0xbbda4f,_0x5ef042){_0xbbda4f=_0xbbda4f-0x0;var _0x2212be=_0x2ef3[_0xbbda4f];return _0x2212be;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 9e82407..9a89611 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 _0x9be5=['../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x2cc640,_0x5bad67){var _0x337bd9=function(_0x30e574){while(--_0x30e574){_0x2cc640['push'](_0x2cc640['shift']());}};_0x337bd9(++_0x5bad67);}(_0x9be5,0xc3));var _0x59be=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x9be5[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x59be('0x0'));var util=require('util');var path=require(_0x59be('0x1'));var timeout=require(_0x59be('0x2'));var express=require('express');var router=express[_0x59be('0x3')]();var fs_extra=require(_0x59be('0x4'));var auth=require(_0x59be('0x5'));var interaction=require(_0x59be('0x6'));var config=require('../../config/environment');var controller=require(_0x59be('0x7'));router[_0x59be('0x8')]('/',auth[_0x59be('0x9')](),controller[_0x59be('0xa')]);router[_0x59be('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x59be('0xb')]);router[_0x59be('0x8')](_0x59be('0xc'),auth[_0x59be('0x9')](),controller[_0x59be('0xd')]);router[_0x59be('0xe')]('/',auth[_0x59be('0x9')](),controller[_0x59be('0xf')]);router[_0x59be('0x10')](_0x59be('0xc'),auth['isAuthenticated'](),controller[_0x59be('0x11')]);router[_0x59be('0x12')](_0x59be('0xc'),auth['isAuthenticated'](),controller[_0x59be('0x13')]);module['exports']=router; \ No newline at end of file +var _0x274a=['../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','show','create','put','/:id','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x51241f,_0x1c287a){var _0x3f4490=function(_0xf1a0fc){while(--_0xf1a0fc){_0x51241f['push'](_0x51241f['shift']());}};_0x3f4490(++_0x1c287a);}(_0x274a,0xd8));var _0xa274=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0x274a[_0x529abc];return _0x453afa;};'use strict';var multer=require('multer');var util=require(_0xa274('0x0'));var path=require(_0xa274('0x1'));var timeout=require('connect-timeout');var express=require(_0xa274('0x2'));var router=express[_0xa274('0x3')]();var fs_extra=require(_0xa274('0x4'));var auth=require(_0xa274('0x5'));var interaction=require(_0xa274('0x6'));var config=require('../../config/environment');var controller=require(_0xa274('0x7'));router[_0xa274('0x8')]('/',auth[_0xa274('0x9')](),controller[_0xa274('0xa')]);router[_0xa274('0x8')]('/describe',auth[_0xa274('0x9')](),controller['describe']);router[_0xa274('0x8')]('/:id',auth[_0xa274('0x9')](),controller[_0xa274('0xb')]);router['post']('/',auth[_0xa274('0x9')](),controller[_0xa274('0xc')]);router[_0xa274('0xd')](_0xa274('0xe'),auth[_0xa274('0x9')](),controller['update']);router['delete'](_0xa274('0xe'),auth[_0xa274('0x9')](),controller[_0xa274('0xf')]);module[_0xa274('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 587b4f7..fec08db 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 _0x1751=['STRING','name','sequelize','exports'];(function(_0x49b984,_0x387c83){var _0x49d1e0=function(_0x3664c7){while(--_0x3664c7){_0x49b984['push'](_0x49b984['shift']());}};_0x49d1e0(++_0x387c83);}(_0x1751,0x76));var _0x1175=function(_0x5eb838,_0x12bcb4){_0x5eb838=_0x5eb838-0x0;var _0x59c77e=_0x1751[_0x5eb838];return _0x59c77e;};'use strict';var Sequelize=require(_0x1175('0x0'));module[_0x1175('0x1')]={'name':{'type':Sequelize[_0x1175('0x2')],'unique':_0x1175('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x06f4=['name','STRING','sequelize','exports'];(function(_0x458e7d,_0x15c04c){var _0x123c8a=function(_0xdda674){while(--_0xdda674){_0x458e7d['push'](_0x458e7d['shift']());}};_0x123c8a(++_0x15c04c);}(_0x06f4,0x136));var _0x406f=function(_0x116660,_0x42a52f){_0x116660=_0x116660-0x0;var _0x2edcff=_0x06f4[_0x116660];return _0x2edcff;};'use strict';var Sequelize=require(_0x406f('0x0'));module[_0x406f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x406f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x406f('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index e6861f2..8ec1dc9 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 _0x117b=['eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe'];(function(_0x1a8406,_0xeba253){var _0x96dab5=function(_0xf9c2fb){while(--_0xf9c2fb){_0x1a8406['push'](_0x1a8406['shift']());}};_0x96dab5(++_0xeba253);}(_0x117b,0xe4));var _0xb117=function(_0x1318e3,_0x1e249a){_0x1318e3=_0x1318e3-0x0;var _0x3c1875=_0x117b[_0x1318e3];return _0x3c1875;};'use strict';var emlformat=require(_0xb117('0x0'));var rimraf=require(_0xb117('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb117('0x2'));var rp=require('request-promise');var moment=require(_0xb117('0x3'));var BPromise=require(_0xb117('0x4'));var Mustache=require(_0xb117('0x5'));var util=require(_0xb117('0x6'));var path=require('path');var sox=require(_0xb117('0x7'));var csv=require(_0xb117('0x8'));var ejs=require(_0xb117('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb117('0xa'));var squel=require(_0xb117('0xb'));var crypto=require(_0xb117('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb117('0xd'));var toCsv=require(_0xb117('0x8'));var querystring=require(_0xb117('0xe'));var Papa=require(_0xb117('0xf'));var Redis=require('ioredis');var authService=require(_0xb117('0x10'));var qs=require(_0xb117('0x11'));var as=require(_0xb117('0x12'));var hardwareService=require(_0xb117('0x13'));var logger=require(_0xb117('0x14'))(_0xb117('0x15'));var utils=require(_0xb117('0x16'));var config=require(_0xb117('0x17'));var licenseUtil=require(_0xb117('0x18'));var db=require(_0xb117('0x19'))['db'];function respondWithStatusCode(_0x1fdaed,_0x3e772c){_0x3e772c=_0x3e772c||0xcc;return function(_0x5e530b){if(_0x5e530b){return _0x1fdaed[_0xb117('0x1a')](_0x3e772c);}return _0x1fdaed[_0xb117('0x1b')](_0x3e772c)['end']();};}function respondWithResult(_0x53f1b9,_0x1a920c){_0x1a920c=_0x1a920c||0xc8;return function(_0x1ffa63){if(_0x1ffa63){return _0x53f1b9['status'](_0x1a920c)['json'](_0x1ffa63);}};}function respondWithFilteredResult(_0x306dd0,_0x43b214){return function(_0x1270ac){if(_0x1270ac){var _0x10c9dc=typeof _0x43b214[_0xb117('0x1c')]===_0xb117('0x1d')&&typeof _0x43b214[_0xb117('0x1e')]===_0xb117('0x1d');var _0x55cd13=_0x1270ac['count'];var _0x56b5ba=_0x10c9dc?0x0:_0x43b214['offset'];var _0x5d38ee=_0x10c9dc?_0x1270ac[_0xb117('0x1f')]:_0x43b214['offset']+_0x43b214[_0xb117('0x1e')];var _0x212881;if(_0x5d38ee>=_0x55cd13){_0x5d38ee=_0x55cd13;_0x212881=0xc8;}else{_0x212881=0xce;}_0x306dd0[_0xb117('0x1b')](_0x212881);return _0x306dd0['set'](_0xb117('0x20'),_0x56b5ba+'-'+_0x5d38ee+'/'+_0x55cd13)['json'](_0x1270ac);}return null;};}function patchUpdates(_0x3a2008){return function(_0x4e5fdd){try{jsonpatch[_0xb117('0x21')](_0x4e5fdd,_0x3a2008,!![]);}catch(_0x21cab2){return BPromise['reject'](_0x21cab2);}return _0x4e5fdd[_0xb117('0x22')]();};}function saveUpdates(_0x112c91,_0x4f5162){return function(_0x1aec09){if(_0x1aec09){return _0x1aec09[_0xb117('0x23')](_0x112c91)[_0xb117('0x24')](function(_0xc2a84e){return _0xc2a84e;});}return null;};}function removeEntity(_0x218216,_0x3622f5){return function(_0x15d8a3){if(_0x15d8a3){return _0x15d8a3[_0xb117('0x25')]()[_0xb117('0x24')](function(){_0x218216[_0xb117('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bbb75,_0x278303){return function(_0x1bfd78){if(!_0x1bfd78){_0x5bbb75[_0xb117('0x1a')](0x194);}return _0x1bfd78;};}function handleError(_0x2f29e5,_0x89e168){_0x89e168=_0x89e168||0x1f4;return function(_0x228762){logger['error'](_0x228762[_0xb117('0x26')]);if(_0x228762[_0xb117('0x27')]){delete _0x228762[_0xb117('0x27')];}_0x2f29e5[_0xb117('0x1b')](_0x89e168)['send'](_0x228762);};}exports[_0xb117('0x28')]=function(_0x4d079f,_0x228e54){var _0x1096b4={},_0x15a5e5={},_0x30063e={'count':0x0,'rows':[]};var _0x47acdc=_[_0xb117('0x29')](db[_0xb117('0x2a')][_0xb117('0x2b')],function(_0x6ff728){return{'name':_0x6ff728[_0xb117('0x2c')],'type':_0x6ff728[_0xb117('0x2d')][_0xb117('0x2e')]};});_0x15a5e5['model']=_['map'](_0x47acdc,'name');_0x15a5e5[_0xb117('0x2f')]=_[_0xb117('0x30')](_0x4d079f[_0xb117('0x2f')]);_0x15a5e5['filters']=_[_0xb117('0x31')](_0x15a5e5[_0xb117('0x32')],_0x15a5e5[_0xb117('0x2f')]);_0x1096b4['attributes']=_[_0xb117('0x31')](_0x15a5e5[_0xb117('0x32')],qs[_0xb117('0x33')](_0x4d079f[_0xb117('0x2f')][_0xb117('0x33')]));_0x1096b4[_0xb117('0x34')]=_0x1096b4['attributes'][_0xb117('0x35')]?_0x1096b4['attributes']:_0x15a5e5[_0xb117('0x32')];if(!_0x4d079f[_0xb117('0x2f')][_0xb117('0x36')](_0xb117('0x37'))){_0x1096b4[_0xb117('0x1e')]=qs[_0xb117('0x1e')](_0x4d079f['query'][_0xb117('0x1e')]);_0x1096b4[_0xb117('0x1c')]=qs[_0xb117('0x1c')](_0x4d079f['query'][_0xb117('0x1c')]);}_0x1096b4[_0xb117('0x38')]=qs[_0xb117('0x39')](_0x4d079f[_0xb117('0x2f')]['sort']);_0x1096b4[_0xb117('0x3a')]=qs[_0xb117('0x3b')](_[_0xb117('0x3c')](_0x4d079f[_0xb117('0x2f')],_0x15a5e5[_0xb117('0x3b')]),_0x47acdc);if(_0x4d079f[_0xb117('0x2f')][_0xb117('0x3d')]){_0x1096b4[_0xb117('0x3a')]=_[_0xb117('0x3e')](_0x1096b4[_0xb117('0x3a')],{'$or':_[_0xb117('0x29')](_0x47acdc,function(_0x1b1cd2){if(_0x1b1cd2['type']!==_0xb117('0x3f')){var _0x4cbd9a={};_0x4cbd9a[_0x1b1cd2[_0xb117('0x27')]]={'$like':'%'+_0x4d079f['query']['filter']+'%'};return _0x4cbd9a;}})});}_0x1096b4=_[_0xb117('0x3e')]({},_0x1096b4,_0x4d079f[_0xb117('0x40')]);var _0x1b6c66={'where':_0x1096b4[_0xb117('0x3a')]};return db['MailSubstatus'][_0xb117('0x1f')](_0x1b6c66)[_0xb117('0x24')](function(_0x24beee){_0x30063e[_0xb117('0x1f')]=_0x24beee;if(_0x4d079f[_0xb117('0x2f')][_0xb117('0x41')]){_0x1096b4[_0xb117('0x42')]=[{'all':!![]}];}return db[_0xb117('0x2a')][_0xb117('0x43')](_0x1096b4);})['then'](function(_0x4a050c){_0x30063e[_0xb117('0x44')]=_0x4a050c;return _0x30063e;})[_0xb117('0x24')](respondWithFilteredResult(_0x228e54,_0x1096b4))[_0xb117('0x45')](handleError(_0x228e54,null));};exports[_0xb117('0x46')]=function(_0x256352,_0x44a9cc){var _0x5289a5={'raw':!![],'where':{'id':_0x256352[_0xb117('0x47')]['id']}},_0x23807c={};_0x23807c[_0xb117('0x32')]=_['keys'](db['MailSubstatus'][_0xb117('0x2b')]);_0x23807c['query']=_[_0xb117('0x30')](_0x256352[_0xb117('0x2f')]);_0x23807c['filters']=_[_0xb117('0x31')](_0x23807c[_0xb117('0x32')],_0x23807c[_0xb117('0x2f')]);_0x5289a5[_0xb117('0x34')]=_[_0xb117('0x31')](_0x23807c[_0xb117('0x32')],qs[_0xb117('0x33')](_0x256352[_0xb117('0x2f')][_0xb117('0x33')]));_0x5289a5[_0xb117('0x34')]=_0x5289a5[_0xb117('0x34')][_0xb117('0x35')]?_0x5289a5['attributes']:_0x23807c[_0xb117('0x32')];if(_0x256352[_0xb117('0x2f')][_0xb117('0x41')]){_0x5289a5[_0xb117('0x42')]=[{'all':!![]}];}_0x5289a5=_[_0xb117('0x3e')]({},_0x5289a5,_0x256352[_0xb117('0x40')]);return db['MailSubstatus'][_0xb117('0x48')](_0x5289a5)[_0xb117('0x24')](handleEntityNotFound(_0x44a9cc,null))[_0xb117('0x24')](respondWithResult(_0x44a9cc,null))[_0xb117('0x45')](handleError(_0x44a9cc,null));};exports[_0xb117('0x49')]=function(_0x36f1dd,_0x4d1340){return db[_0xb117('0x2a')][_0xb117('0x49')](_0x36f1dd['body'],{})[_0xb117('0x24')](respondWithResult(_0x4d1340,0xc9))[_0xb117('0x45')](handleError(_0x4d1340,null));};exports[_0xb117('0x23')]=function(_0x4418fb,_0x4dcc49){if(_0x4418fb[_0xb117('0x4a')]['id']){delete _0x4418fb[_0xb117('0x4a')]['id'];}return db[_0xb117('0x2a')]['find']({'where':{'id':_0x4418fb['params']['id']}})[_0xb117('0x24')](handleEntityNotFound(_0x4dcc49,null))['then'](saveUpdates(_0x4418fb['body'],null))[_0xb117('0x24')](respondWithResult(_0x4dcc49,null))[_0xb117('0x45')](handleError(_0x4dcc49,null));};exports[_0xb117('0x25')]=function(_0x4168ed,_0x1655a1){return db[_0xb117('0x2a')][_0xb117('0x48')]({'where':{'id':_0x4168ed['params']['id']}})[_0xb117('0x24')](handleEntityNotFound(_0x1655a1,null))[_0xb117('0x24')](removeEntity(_0x1655a1,null))[_0xb117('0x45')](handleError(_0x1655a1,null));};exports[_0xb117('0x4b')]=function(_0x11fca5,_0x527d0b){return db['MailSubstatus'][_0xb117('0x4b')]()['then'](respondWithResult(_0x527d0b,null))[_0xb117('0x45')](handleError(_0x527d0b,null));}; \ No newline at end of file +var _0x2cbc=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','type','map','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','sort','pick','where','filter','merge','includeAll','include','findAll','catch','show','keys','fields','body','update','find','params'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x2cbc,0x8e));var _0xc2cb=function(_0x41935b,_0x34c738){_0x41935b=_0x41935b-0x0;var _0xb4518=_0x2cbc[_0x41935b];return _0xb4518;};'use strict';var emlformat=require(_0xc2cb('0x0'));var rimraf=require(_0xc2cb('0x1'));var zipdir=require(_0xc2cb('0x2'));var jsonpatch=require(_0xc2cb('0x3'));var rp=require('request-promise');var moment=require(_0xc2cb('0x4'));var BPromise=require(_0xc2cb('0x5'));var Mustache=require(_0xc2cb('0x6'));var util=require(_0xc2cb('0x7'));var path=require(_0xc2cb('0x8'));var sox=require(_0xc2cb('0x9'));var csv=require(_0xc2cb('0xa'));var ejs=require(_0xc2cb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2cb('0xc'));var squel=require('squel');var crypto=require(_0xc2cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc2cb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc2cb('0xf'));var Papa=require('papaparse');var Redis=require(_0xc2cb('0x10'));var authService=require(_0xc2cb('0x11'));var qs=require(_0xc2cb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2cb('0x13'));var logger=require(_0xc2cb('0x14'))('api');var utils=require(_0xc2cb('0x15'));var config=require(_0xc2cb('0x16'));var licenseUtil=require(_0xc2cb('0x17'));var db=require(_0xc2cb('0x18'))['db'];function respondWithStatusCode(_0x204f1b,_0x172a0f){_0x172a0f=_0x172a0f||0xcc;return function(_0x4cd7b9){if(_0x4cd7b9){return _0x204f1b[_0xc2cb('0x19')](_0x172a0f);}return _0x204f1b['status'](_0x172a0f)[_0xc2cb('0x1a')]();};}function respondWithResult(_0x2f9cec,_0x10178e){_0x10178e=_0x10178e||0xc8;return function(_0x520a46){if(_0x520a46){return _0x2f9cec[_0xc2cb('0x1b')](_0x10178e)['json'](_0x520a46);}};}function respondWithFilteredResult(_0x447d06,_0x44816f){return function(_0xcab574){if(_0xcab574){var _0x5e47be=typeof _0x44816f[_0xc2cb('0x1c')]===_0xc2cb('0x1d')&&typeof _0x44816f[_0xc2cb('0x1e')]===_0xc2cb('0x1d');var _0x771f9e=_0xcab574['count'];var _0x130119=_0x5e47be?0x0:_0x44816f['offset'];var _0x36a8bf=_0x5e47be?_0xcab574[_0xc2cb('0x1f')]:_0x44816f[_0xc2cb('0x1c')]+_0x44816f[_0xc2cb('0x1e')];var _0x5e6336;if(_0x36a8bf>=_0x771f9e){_0x36a8bf=_0x771f9e;_0x5e6336=0xc8;}else{_0x5e6336=0xce;}_0x447d06['status'](_0x5e6336);return _0x447d06[_0xc2cb('0x20')](_0xc2cb('0x21'),_0x130119+'-'+_0x36a8bf+'/'+_0x771f9e)['json'](_0xcab574);}return null;};}function patchUpdates(_0x5e3793){return function(_0x36c43a){try{jsonpatch[_0xc2cb('0x22')](_0x36c43a,_0x5e3793,!![]);}catch(_0x5c984d){return BPromise['reject'](_0x5c984d);}return _0x36c43a[_0xc2cb('0x23')]();};}function saveUpdates(_0x11b94d,_0xf1203){return function(_0x45ae46){if(_0x45ae46){return _0x45ae46['update'](_0x11b94d)[_0xc2cb('0x24')](function(_0x5ca8db){return _0x5ca8db;});}return null;};}function removeEntity(_0x2c0f9f,_0xa9742a){return function(_0x18e2e5){if(_0x18e2e5){return _0x18e2e5[_0xc2cb('0x25')]()[_0xc2cb('0x24')](function(){_0x2c0f9f[_0xc2cb('0x1b')](0xcc)[_0xc2cb('0x1a')]();});}};}function handleEntityNotFound(_0x18c6ac,_0x351425){return function(_0x40e7e5){if(!_0x40e7e5){_0x18c6ac[_0xc2cb('0x19')](0x194);}return _0x40e7e5;};}function handleError(_0x45ad5d,_0x2d326d){_0x2d326d=_0x2d326d||0x1f4;return function(_0x436fba){logger[_0xc2cb('0x26')](_0x436fba[_0xc2cb('0x27')]);if(_0x436fba[_0xc2cb('0x28')]){delete _0x436fba[_0xc2cb('0x28')];}_0x45ad5d[_0xc2cb('0x1b')](_0x2d326d)[_0xc2cb('0x29')](_0x436fba);};}exports[_0xc2cb('0x2a')]=function(_0x31fb34,_0x1b0de8){var _0x3e2086={},_0x116c7c={},_0x212e47={'count':0x0,'rows':[]};var _0x3958d8=_['map'](db[_0xc2cb('0x2b')][_0xc2cb('0x2c')],function(_0x5de064){return{'name':_0x5de064['fieldName'],'type':_0x5de064[_0xc2cb('0x2d')]['key']};});_0x116c7c['model']=_[_0xc2cb('0x2e')](_0x3958d8,'name');_0x116c7c['query']=_['keys'](_0x31fb34[_0xc2cb('0x2f')]);_0x116c7c[_0xc2cb('0x30')]=_[_0xc2cb('0x31')](_0x116c7c['model'],_0x116c7c['query']);_0x3e2086[_0xc2cb('0x32')]=_['intersection'](_0x116c7c[_0xc2cb('0x33')],qs['fields'](_0x31fb34[_0xc2cb('0x2f')]['fields']));_0x3e2086[_0xc2cb('0x32')]=_0x3e2086[_0xc2cb('0x32')][_0xc2cb('0x34')]?_0x3e2086[_0xc2cb('0x32')]:_0x116c7c['model'];if(!_0x31fb34[_0xc2cb('0x2f')][_0xc2cb('0x35')](_0xc2cb('0x36'))){_0x3e2086['limit']=qs[_0xc2cb('0x1e')](_0x31fb34[_0xc2cb('0x2f')][_0xc2cb('0x1e')]);_0x3e2086[_0xc2cb('0x1c')]=qs['offset'](_0x31fb34[_0xc2cb('0x2f')][_0xc2cb('0x1c')]);}_0x3e2086['order']=qs[_0xc2cb('0x37')](_0x31fb34['query'][_0xc2cb('0x37')]);_0x3e2086['where']=qs['filters'](_[_0xc2cb('0x38')](_0x31fb34[_0xc2cb('0x2f')],_0x116c7c[_0xc2cb('0x30')]),_0x3958d8);if(_0x31fb34[_0xc2cb('0x2f')]['filter']){_0x3e2086['where']=_['merge'](_0x3e2086[_0xc2cb('0x39')],{'$or':_[_0xc2cb('0x2e')](_0x3958d8,function(_0x47a1fd){if(_0x47a1fd[_0xc2cb('0x2d')]!=='VIRTUAL'){var _0x34d173={};_0x34d173[_0x47a1fd[_0xc2cb('0x28')]]={'$like':'%'+_0x31fb34[_0xc2cb('0x2f')][_0xc2cb('0x3a')]+'%'};return _0x34d173;}})});}_0x3e2086=_[_0xc2cb('0x3b')]({},_0x3e2086,_0x31fb34['options']);var _0x47b8b5={'where':_0x3e2086[_0xc2cb('0x39')]};return db['MailSubstatus'][_0xc2cb('0x1f')](_0x47b8b5)[_0xc2cb('0x24')](function(_0x5314f7){_0x212e47[_0xc2cb('0x1f')]=_0x5314f7;if(_0x31fb34[_0xc2cb('0x2f')][_0xc2cb('0x3c')]){_0x3e2086[_0xc2cb('0x3d')]=[{'all':!![]}];}return db[_0xc2cb('0x2b')][_0xc2cb('0x3e')](_0x3e2086);})[_0xc2cb('0x24')](function(_0x1c0497){_0x212e47['rows']=_0x1c0497;return _0x212e47;})[_0xc2cb('0x24')](respondWithFilteredResult(_0x1b0de8,_0x3e2086))[_0xc2cb('0x3f')](handleError(_0x1b0de8,null));};exports[_0xc2cb('0x40')]=function(_0x549bf8,_0x5b8b2e){var _0x46549d={'raw':!![],'where':{'id':_0x549bf8['params']['id']}},_0x4f3486={};_0x4f3486[_0xc2cb('0x33')]=_[_0xc2cb('0x41')](db['MailSubstatus'][_0xc2cb('0x2c')]);_0x4f3486[_0xc2cb('0x2f')]=_[_0xc2cb('0x41')](_0x549bf8[_0xc2cb('0x2f')]);_0x4f3486[_0xc2cb('0x30')]=_[_0xc2cb('0x31')](_0x4f3486[_0xc2cb('0x33')],_0x4f3486[_0xc2cb('0x2f')]);_0x46549d[_0xc2cb('0x32')]=_[_0xc2cb('0x31')](_0x4f3486[_0xc2cb('0x33')],qs[_0xc2cb('0x42')](_0x549bf8[_0xc2cb('0x2f')][_0xc2cb('0x42')]));_0x46549d['attributes']=_0x46549d[_0xc2cb('0x32')]['length']?_0x46549d[_0xc2cb('0x32')]:_0x4f3486[_0xc2cb('0x33')];if(_0x549bf8[_0xc2cb('0x2f')][_0xc2cb('0x3c')]){_0x46549d[_0xc2cb('0x3d')]=[{'all':!![]}];}_0x46549d=_['merge']({},_0x46549d,_0x549bf8['options']);return db[_0xc2cb('0x2b')]['find'](_0x46549d)[_0xc2cb('0x24')](handleEntityNotFound(_0x5b8b2e,null))[_0xc2cb('0x24')](respondWithResult(_0x5b8b2e,null))[_0xc2cb('0x3f')](handleError(_0x5b8b2e,null));};exports['create']=function(_0x2e4f11,_0x53b0cf){return db[_0xc2cb('0x2b')]['create'](_0x2e4f11[_0xc2cb('0x43')],{})[_0xc2cb('0x24')](respondWithResult(_0x53b0cf,0xc9))[_0xc2cb('0x3f')](handleError(_0x53b0cf,null));};exports[_0xc2cb('0x44')]=function(_0x17a655,_0x25d588){if(_0x17a655['body']['id']){delete _0x17a655[_0xc2cb('0x43')]['id'];}return db['MailSubstatus'][_0xc2cb('0x45')]({'where':{'id':_0x17a655[_0xc2cb('0x46')]['id']}})[_0xc2cb('0x24')](handleEntityNotFound(_0x25d588,null))[_0xc2cb('0x24')](saveUpdates(_0x17a655['body'],null))['then'](respondWithResult(_0x25d588,null))[_0xc2cb('0x3f')](handleError(_0x25d588,null));};exports[_0xc2cb('0x25')]=function(_0x38353b,_0x26acbd){return db[_0xc2cb('0x2b')][_0xc2cb('0x45')]({'where':{'id':_0x38353b['params']['id']}})[_0xc2cb('0x24')](handleEntityNotFound(_0x26acbd,null))[_0xc2cb('0x24')](removeEntity(_0x26acbd,null))[_0xc2cb('0x3f')](handleError(_0x26acbd,null));};exports['describe']=function(_0x3e1143,_0x540220){return db[_0xc2cb('0x2b')]['describe']()[_0xc2cb('0x24')](respondWithResult(_0x540220,null))['catch'](handleError(_0x540220,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index e6043e3..864bb47 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 _0x1eb7=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','lodash','api','moment'];(function(_0x177b79,_0x4a820b){var _0x24b2ed=function(_0x249f47){while(--_0x249f47){_0x177b79['push'](_0x177b79['shift']());}};_0x24b2ed(++_0x4a820b);}(_0x1eb7,0x16e));var _0x71eb=function(_0x5c33ae,_0x49b8b7){_0x5c33ae=_0x5c33ae-0x0;var _0x1be750=_0x1eb7[_0x5c33ae];return _0x1be750;};'use strict';var _=require(_0x71eb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x71eb('0x1'));var moment=require(_0x71eb('0x2'));var BPromise=require('bluebird');var rp=require(_0x71eb('0x3'));var fs=require('fs');var path=require(_0x71eb('0x4'));var rimraf=require(_0x71eb('0x5'));var config=require(_0x71eb('0x6'));var attributes=require(_0x71eb('0x7'));module['exports']=function(_0x1b4a35,_0x23c71c){return _0x1b4a35[_0x71eb('0x8')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd783=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','util'];(function(_0x112f7f,_0x3799e7){var _0x4165e0=function(_0x56621d){while(--_0x56621d){_0x112f7f['push'](_0x112f7f['shift']());}};_0x4165e0(++_0x3799e7);}(_0xd783,0x1d3));var _0x3d78=function(_0x51edca,_0x18ad70){_0x51edca=_0x51edca-0x0;var _0x2b77ec=_0xd783[_0x51edca];return _0x2b77ec;};'use strict';var _=require('lodash');var util=require(_0x3d78('0x0'));var logger=require(_0x3d78('0x1'))(_0x3d78('0x2'));var moment=require(_0x3d78('0x3'));var BPromise=require(_0x3d78('0x4'));var rp=require(_0x3d78('0x5'));var fs=require('fs');var path=require(_0x3d78('0x6'));var rimraf=require(_0x3d78('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d78('0x8'));module[_0x3d78('0x9')]=function(_0x1050a2,_0x4de0e5){return _0x1050a2['define'](_0x3d78('0xa'),attributes,{'tableName':_0x3d78('0xb'),'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 0c087cf..c9b7229 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 _0xcde0=['http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x42a366,_0x117d6c){var _0x5154e4=function(_0x111813){while(--_0x111813){_0x42a366['push'](_0x42a366['shift']());}};_0x5154e4(++_0x117d6c);}(_0xcde0,0x19a));var _0x0cde=function(_0x17b201,_0x35ae34){_0x17b201=_0x17b201-0x0;var _0xb6cbc7=_0xcde0[_0x17b201];return _0xb6cbc7;};'use strict';var _=require('lodash');var util=require(_0x0cde('0x0'));var moment=require(_0x0cde('0x1'));var BPromise=require(_0x0cde('0x2'));var rs=require(_0x0cde('0x3'));var fs=require('fs');var Redis=require(_0x0cde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cde('0x5'));var logger=require('../../config/logger')(_0x0cde('0x6'));var config=require(_0x0cde('0x7'));var jayson=require(_0x0cde('0x8'));var client=jayson[_0x0cde('0x9')][_0x0cde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d649,_0x1ff141,_0x2ce024){return new BPromise(function(_0x4e623d,_0x54fb16){return client[_0x0cde('0xb')](_0x30d649,_0x2ce024)[_0x0cde('0xc')](function(_0x1c580e){logger[_0x0cde('0xd')](_0x0cde('0xe'),_0x1ff141,_0x0cde('0xf'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1ff141,_0x0cde('0xf'),JSON[_0x0cde('0x10')](_0x1c580e));if(_0x1c580e[_0x0cde('0x11')]){if(_0x1c580e['error']['code']===0x1f4){logger['error'](_0x0cde('0xe'),_0x1ff141,_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);return _0x54fb16(_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);}logger[_0x0cde('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1ff141,_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);return _0x4e623d(_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);}else{logger[_0x0cde('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x1ff141,_0x0cde('0xf'));_0x4e623d(_0x1c580e[_0x0cde('0x13')][_0x0cde('0x12')]);}})['catch'](function(_0x445892){logger['error'](_0x0cde('0xe'),_0x1ff141,_0x445892);_0x54fb16(_0x445892);});});} \ No newline at end of file +var _0x8ed2=['then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ec27e,_0xd47566){var _0x424620=function(_0x1eec3e){while(--_0x1eec3e){_0x3ec27e['push'](_0x3ec27e['shift']());}};_0x424620(++_0xd47566);}(_0x8ed2,0x1ee));var _0x28ed=function(_0x298798,_0xda57c3){_0x298798=_0x298798-0x0;var _0x59abf1=_0x8ed2[_0x298798];return _0x59abf1;};'use strict';var _=require(_0x28ed('0x0'));var util=require(_0x28ed('0x1'));var moment=require('moment');var BPromise=require(_0x28ed('0x2'));var rs=require(_0x28ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28ed('0x4'))['db'];var utils=require(_0x28ed('0x5'));var logger=require('../../config/logger')(_0x28ed('0x6'));var config=require(_0x28ed('0x7'));var jayson=require(_0x28ed('0x8'));var client=jayson[_0x28ed('0x9')][_0x28ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe828f0,_0x2bdf1f,_0x22f88d){return new BPromise(function(_0x2e4217,_0x4e1c98){return client[_0x28ed('0xb')](_0xe828f0,_0x22f88d)[_0x28ed('0xc')](function(_0x14a2ee){logger['info'](_0x28ed('0xd'),_0x2bdf1f,_0x28ed('0xe'));logger[_0x28ed('0xf')](_0x28ed('0x10'),_0x2bdf1f,_0x28ed('0xe'),JSON[_0x28ed('0x11')](_0x14a2ee));if(_0x14a2ee[_0x28ed('0x12')]){if(_0x14a2ee[_0x28ed('0x12')]['code']===0x1f4){logger['error'](_0x28ed('0xd'),_0x2bdf1f,_0x14a2ee[_0x28ed('0x12')][_0x28ed('0x13')]);return _0x4e1c98(_0x14a2ee['error'][_0x28ed('0x13')]);}logger[_0x28ed('0x12')](_0x28ed('0xd'),_0x2bdf1f,_0x14a2ee['error'][_0x28ed('0x13')]);return _0x2e4217(_0x14a2ee[_0x28ed('0x12')][_0x28ed('0x13')]);}else{logger[_0x28ed('0x14')](_0x28ed('0xd'),_0x2bdf1f,_0x28ed('0xe'));_0x2e4217(_0x14a2ee[_0x28ed('0x15')]['message']);}})[_0x28ed('0x16')](function(_0x49e91f){logger[_0x28ed('0x12')](_0x28ed('0xd'),_0x2bdf1f,_0x49e91f);_0x4e1c98(_0x49e91f);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 1af66b9..edac6fa 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 _0xe21c=['./mailTransferReport.controller','get','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4a5516,_0x5a1374){var _0x1ffe5c=function(_0x1c60d9){while(--_0x1c60d9){_0x4a5516['push'](_0x4a5516['shift']());}};_0x1ffe5c(++_0x5a1374);}(_0xe21c,0x163));var _0xce21=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0xe21c[_0x1876b2];return _0x9fb1e0;};'use strict';var multer=require(_0xce21('0x0'));var util=require(_0xce21('0x1'));var path=require('path');var timeout=require(_0xce21('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xce21('0x3'));var auth=require(_0xce21('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce21('0x5'));var controller=require(_0xce21('0x6'));router[_0xce21('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xce21('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xce21('0x8')]);router[_0xce21('0x7')](_0xce21('0x9'),auth[_0xce21('0xa')](),controller[_0xce21('0xb')]);router[_0xce21('0xc')]('/',auth[_0xce21('0xa')](),controller[_0xce21('0xd')]);router[_0xce21('0xe')]('/:id',auth[_0xce21('0xa')](),controller[_0xce21('0xf')]);router[_0xce21('0x10')](_0xce21('0x9'),auth['isAuthenticated'](),controller[_0xce21('0x11')]);module[_0xce21('0x12')]=router; \ No newline at end of file +var _0x0b70=['connect-timeout','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','isAuthenticated','index','get','describe','/:id','create','update','delete','destroy','multer','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0b70,0x1de));var _0x00b7=function(_0x95b44e,_0x4af5e1){_0x95b44e=_0x95b44e-0x0;var _0x4d33ea=_0x0b70[_0x95b44e];return _0x4d33ea;};'use strict';var multer=require(_0x00b7('0x0'));var util=require(_0x00b7('0x1'));var path=require('path');var timeout=require(_0x00b7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x00b7('0x3'));var interaction=require(_0x00b7('0x4'));var config=require('../../config/environment');var controller=require(_0x00b7('0x5'));router['get']('/',auth[_0x00b7('0x6')](),controller[_0x00b7('0x7')]);router[_0x00b7('0x8')]('/describe',auth[_0x00b7('0x6')](),controller[_0x00b7('0x9')]);router[_0x00b7('0x8')](_0x00b7('0xa'),auth[_0x00b7('0x6')](),controller['show']);router['post']('/',auth[_0x00b7('0x6')](),controller[_0x00b7('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x00b7('0xc')]);router[_0x00b7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x00b7('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 60474e6..44e7046 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26fc52,_0x5bf097){var _0x5239b1=function(_0x24b9c7){while(--_0x24b9c7){_0x26fc52['push'](_0x26fc52['shift']());}};_0x5239b1(++_0x5bf097);}(_0xedd9,0xfc));var _0x9edd=function(_0xffc740,_0x29a441){_0xffc740=_0xffc740-0x0;var _0x536fb2=_0xedd9[_0xffc740];return _0x536fb2;};'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(_0x5c6a89,_0x165d13){var _0x18448c=function(_0x240505){while(--_0x240505){_0x5c6a89['push'](_0x5c6a89['shift']());}};_0x18448c(++_0x165d13);}(_0xedd9,0xfc));var _0x9edd=function(_0x58c7b0,_0x1be0db){_0x58c7b0=_0x58c7b0-0x0;var _0x23baea=_0xedd9[_0x58c7b0];return _0x23baea;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a343b9f..b59cf6c 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 _0xfcad=['reject','save','then','name','send','map','MailTransferReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','end','status','limit','undefined','count','set','apply'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0xfcad,0xba));var _0xdfca=function(_0x3913f5,_0x224ec5){_0x3913f5=_0x3913f5-0x0;var _0x59c75f=_0xfcad[_0x3913f5];return _0x59c75f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfca('0x0'));var zipdir=require(_0xdfca('0x1'));var jsonpatch=require(_0xdfca('0x2'));var rp=require(_0xdfca('0x3'));var moment=require(_0xdfca('0x4'));var BPromise=require(_0xdfca('0x5'));var Mustache=require(_0xdfca('0x6'));var util=require(_0xdfca('0x7'));var path=require(_0xdfca('0x8'));var sox=require(_0xdfca('0x9'));var csv=require(_0xdfca('0xa'));var ejs=require(_0xdfca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfca('0xc'));var squel=require(_0xdfca('0xd'));var crypto=require(_0xdfca('0xe'));var jsforce=require(_0xdfca('0xf'));var deskjs=require(_0xdfca('0x10'));var toCsv=require(_0xdfca('0xa'));var querystring=require(_0xdfca('0x11'));var Papa=require('papaparse');var Redis=require(_0xdfca('0x12'));var authService=require(_0xdfca('0x13'));var qs=require(_0xdfca('0x14'));var as=require(_0xdfca('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfca('0x16'))(_0xdfca('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdfca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b9480,_0x168c65){_0x168c65=_0x168c65||0xcc;return function(_0x587625){if(_0x587625){return _0x4b9480[_0xdfca('0x19')](_0x168c65);}return _0x4b9480['status'](_0x168c65)[_0xdfca('0x1a')]();};}function respondWithResult(_0x3f063c,_0x3ad0bb){_0x3ad0bb=_0x3ad0bb||0xc8;return function(_0x59986c){if(_0x59986c){return _0x3f063c[_0xdfca('0x1b')](_0x3ad0bb)['json'](_0x59986c);}};}function respondWithFilteredResult(_0x23638e,_0x387943){return function(_0x4b9d3a){if(_0x4b9d3a){var _0x3bf8f2=typeof _0x387943['offset']==='undefined'&&typeof _0x387943[_0xdfca('0x1c')]===_0xdfca('0x1d');var _0x158ca8=_0x4b9d3a['count'];var _0x256e9e=_0x3bf8f2?0x0:_0x387943['offset'];var _0x424d62=_0x3bf8f2?_0x4b9d3a[_0xdfca('0x1e')]:_0x387943['offset']+_0x387943[_0xdfca('0x1c')];var _0x59aa5e;if(_0x424d62>=_0x158ca8){_0x424d62=_0x158ca8;_0x59aa5e=0xc8;}else{_0x59aa5e=0xce;}_0x23638e[_0xdfca('0x1b')](_0x59aa5e);return _0x23638e[_0xdfca('0x1f')]('Content-Range',_0x256e9e+'-'+_0x424d62+'/'+_0x158ca8)['json'](_0x4b9d3a);}return null;};}function patchUpdates(_0x6f8494){return function(_0x2e89dd){try{jsonpatch[_0xdfca('0x20')](_0x2e89dd,_0x6f8494,!![]);}catch(_0x26ac6e){return BPromise[_0xdfca('0x21')](_0x26ac6e);}return _0x2e89dd[_0xdfca('0x22')]();};}function saveUpdates(_0x3f1e77,_0x29c893){return function(_0x2659a7){if(_0x2659a7){return _0x2659a7['update'](_0x3f1e77)[_0xdfca('0x23')](function(_0x5e1182){return _0x5e1182;});}return null;};}function removeEntity(_0x1131fd,_0x37d6a1){return function(_0x36bebb){if(_0x36bebb){return _0x36bebb['destroy']()['then'](function(){_0x1131fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f14c0,_0x46e488){return function(_0x353857){if(!_0x353857){_0x3f14c0['sendStatus'](0x194);}return _0x353857;};}function handleError(_0x42a944,_0x547392){_0x547392=_0x547392||0x1f4;return function(_0x5c99e9){logger['error'](_0x5c99e9['stack']);if(_0x5c99e9['name']){delete _0x5c99e9[_0xdfca('0x24')];}_0x42a944[_0xdfca('0x1b')](_0x547392)[_0xdfca('0x25')](_0x5c99e9);};}exports['index']=function(_0x2f53a7,_0x136116){var _0x57d1c0={},_0xaf42ea={},_0x5862ee={'count':0x0,'rows':[]};var _0x87d252=_[_0xdfca('0x26')](db[_0xdfca('0x27')][_0xdfca('0x28')],function(_0x52b2c1){return{'name':_0x52b2c1['fieldName'],'type':_0x52b2c1[_0xdfca('0x29')][_0xdfca('0x2a')]};});_0xaf42ea[_0xdfca('0x2b')]=_['map'](_0x87d252,'name');_0xaf42ea[_0xdfca('0x2c')]=_['keys'](_0x2f53a7[_0xdfca('0x2c')]);_0xaf42ea['filters']=_[_0xdfca('0x2d')](_0xaf42ea[_0xdfca('0x2b')],_0xaf42ea[_0xdfca('0x2c')]);_0x57d1c0[_0xdfca('0x2e')]=_[_0xdfca('0x2d')](_0xaf42ea[_0xdfca('0x2b')],qs[_0xdfca('0x2f')](_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x2f')]));_0x57d1c0[_0xdfca('0x2e')]=_0x57d1c0[_0xdfca('0x2e')][_0xdfca('0x30')]?_0x57d1c0[_0xdfca('0x2e')]:_0xaf42ea['model'];if(!_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x31')](_0xdfca('0x32'))){_0x57d1c0['limit']=qs[_0xdfca('0x1c')](_0x2f53a7[_0xdfca('0x2c')]['limit']);_0x57d1c0[_0xdfca('0x33')]=qs[_0xdfca('0x33')](_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x33')]);}_0x57d1c0[_0xdfca('0x34')]=qs[_0xdfca('0x35')](_0x2f53a7['query'][_0xdfca('0x35')]);_0x57d1c0['where']=qs['filters'](_[_0xdfca('0x36')](_0x2f53a7[_0xdfca('0x2c')],_0xaf42ea[_0xdfca('0x37')]),_0x87d252);if(_0x2f53a7['query'][_0xdfca('0x38')]){_0x57d1c0[_0xdfca('0x39')]=_[_0xdfca('0x3a')](_0x57d1c0['where'],{'$or':_[_0xdfca('0x26')](_0x87d252,function(_0x1eb5bb){if(_0x1eb5bb[_0xdfca('0x29')]!==_0xdfca('0x3b')){var _0x3665b7={};_0x3665b7[_0x1eb5bb[_0xdfca('0x24')]]={'$like':'%'+_0x2f53a7[_0xdfca('0x2c')]['filter']+'%'};return _0x3665b7;}})});}_0x57d1c0=_['merge']({},_0x57d1c0,_0x2f53a7[_0xdfca('0x3c')]);var _0x1e2f81={'where':_0x57d1c0[_0xdfca('0x39')]};return db[_0xdfca('0x27')][_0xdfca('0x1e')](_0x1e2f81)['then'](function(_0x1d9942){_0x5862ee[_0xdfca('0x1e')]=_0x1d9942;if(_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x3d')]){_0x57d1c0[_0xdfca('0x3e')]=[{'all':!![]}];}return db[_0xdfca('0x27')][_0xdfca('0x3f')](_0x57d1c0);})['then'](function(_0x2862b3){_0x5862ee[_0xdfca('0x40')]=_0x2862b3;return _0x5862ee;})['then'](respondWithFilteredResult(_0x136116,_0x57d1c0))[_0xdfca('0x41')](handleError(_0x136116,null));};exports[_0xdfca('0x42')]=function(_0x2abf20,_0x3fbd4c){var _0x209702={'raw':!![],'where':{'id':_0x2abf20[_0xdfca('0x43')]['id']}},_0x4dba22={};_0x4dba22[_0xdfca('0x2b')]=_[_0xdfca('0x44')](db[_0xdfca('0x27')][_0xdfca('0x28')]);_0x4dba22[_0xdfca('0x2c')]=_[_0xdfca('0x44')](_0x2abf20['query']);_0x4dba22[_0xdfca('0x37')]=_['intersection'](_0x4dba22[_0xdfca('0x2b')],_0x4dba22[_0xdfca('0x2c')]);_0x209702[_0xdfca('0x2e')]=_[_0xdfca('0x2d')](_0x4dba22['model'],qs[_0xdfca('0x2f')](_0x2abf20[_0xdfca('0x2c')][_0xdfca('0x2f')]));_0x209702['attributes']=_0x209702[_0xdfca('0x2e')]['length']?_0x209702[_0xdfca('0x2e')]:_0x4dba22[_0xdfca('0x2b')];if(_0x2abf20['query'][_0xdfca('0x3d')]){_0x209702['include']=[{'all':!![]}];}_0x209702=_[_0xdfca('0x3a')]({},_0x209702,_0x2abf20[_0xdfca('0x3c')]);return db['MailTransferReport'][_0xdfca('0x45')](_0x209702)['then'](handleEntityNotFound(_0x3fbd4c,null))[_0xdfca('0x23')](respondWithResult(_0x3fbd4c,null))[_0xdfca('0x41')](handleError(_0x3fbd4c,null));};exports[_0xdfca('0x46')]=function(_0x2c43f0,_0x35856c){return db[_0xdfca('0x27')][_0xdfca('0x46')](_0x2c43f0[_0xdfca('0x47')],{})[_0xdfca('0x23')](respondWithResult(_0x35856c,0xc9))['catch'](handleError(_0x35856c,null));};exports['update']=function(_0x92f853,_0x423d7b){if(_0x92f853[_0xdfca('0x47')]['id']){delete _0x92f853[_0xdfca('0x47')]['id'];}return db[_0xdfca('0x27')][_0xdfca('0x45')]({'where':{'id':_0x92f853['params']['id']}})['then'](handleEntityNotFound(_0x423d7b,null))[_0xdfca('0x23')](saveUpdates(_0x92f853['body'],null))['then'](respondWithResult(_0x423d7b,null))[_0xdfca('0x41')](handleError(_0x423d7b,null));};exports['destroy']=function(_0x262623,_0x10d054){return db[_0xdfca('0x27')]['find']({'where':{'id':_0x262623['params']['id']}})['then'](handleEntityNotFound(_0x10d054,null))[_0xdfca('0x23')](removeEntity(_0x10d054,null))[_0xdfca('0x41')](handleError(_0x10d054,null));};exports['describe']=function(_0x2aed98,_0x15963a){return db['MailTransferReport'][_0xdfca('0x48')]()[_0xdfca('0x23')](respondWithResult(_0x15963a,null))[_0xdfca('0x41')](handleError(_0x15963a,null));}; \ No newline at end of file +var _0x89a1=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','apply','reject','save','update','then','destroy','end','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x51b255,_0x2a91cf){var _0x43bd02=function(_0x456c48){while(--_0x456c48){_0x51b255['push'](_0x51b255['shift']());}};_0x43bd02(++_0x2a91cf);}(_0x89a1,0x1ca));var _0x189a=function(_0x696493,_0x2753b9){_0x696493=_0x696493-0x0;var _0x11d330=_0x89a1[_0x696493];return _0x11d330;};'use strict';var emlformat=require(_0x189a('0x0'));var rimraf=require(_0x189a('0x1'));var zipdir=require(_0x189a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x189a('0x3'));var moment=require(_0x189a('0x4'));var BPromise=require(_0x189a('0x5'));var Mustache=require(_0x189a('0x6'));var util=require(_0x189a('0x7'));var path=require(_0x189a('0x8'));var sox=require(_0x189a('0x9'));var csv=require(_0x189a('0xa'));var ejs=require(_0x189a('0xb'));var fs=require('fs');var fs_extra=require(_0x189a('0xc'));var _=require('lodash');var squel=require(_0x189a('0xd'));var crypto=require(_0x189a('0xe'));var jsforce=require(_0x189a('0xf'));var deskjs=require(_0x189a('0x10'));var toCsv=require(_0x189a('0xa'));var querystring=require(_0x189a('0x11'));var Papa=require(_0x189a('0x12'));var Redis=require(_0x189a('0x13'));var authService=require(_0x189a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x189a('0x15'));var hardwareService=require(_0x189a('0x16'));var logger=require('../../config/logger')(_0x189a('0x17'));var utils=require(_0x189a('0x18'));var config=require(_0x189a('0x19'));var licenseUtil=require(_0x189a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x304504,_0x434dc8){_0x434dc8=_0x434dc8||0xcc;return function(_0x4660b4){if(_0x4660b4){return _0x304504[_0x189a('0x1b')](_0x434dc8);}return _0x304504[_0x189a('0x1c')](_0x434dc8)['end']();};}function respondWithResult(_0x4e7211,_0x517301){_0x517301=_0x517301||0xc8;return function(_0x131fe4){if(_0x131fe4){return _0x4e7211[_0x189a('0x1c')](_0x517301)[_0x189a('0x1d')](_0x131fe4);}};}function respondWithFilteredResult(_0x3b0192,_0x3dad38){return function(_0x587bef){if(_0x587bef){var _0x3472d3=typeof _0x3dad38['offset']===_0x189a('0x1e')&&typeof _0x3dad38['limit']===_0x189a('0x1e');var _0x27de8c=_0x587bef['count'];var _0x234b51=_0x3472d3?0x0:_0x3dad38['offset'];var _0x23fbff=_0x3472d3?_0x587bef['count']:_0x3dad38['offset']+_0x3dad38[_0x189a('0x1f')];var _0x4417cf;if(_0x23fbff>=_0x27de8c){_0x23fbff=_0x27de8c;_0x4417cf=0xc8;}else{_0x4417cf=0xce;}_0x3b0192[_0x189a('0x1c')](_0x4417cf);return _0x3b0192['set']('Content-Range',_0x234b51+'-'+_0x23fbff+'/'+_0x27de8c)[_0x189a('0x1d')](_0x587bef);}return null;};}function patchUpdates(_0x4274fb){return function(_0x3c9ef){try{jsonpatch[_0x189a('0x20')](_0x3c9ef,_0x4274fb,!![]);}catch(_0x53c68b){return BPromise[_0x189a('0x21')](_0x53c68b);}return _0x3c9ef[_0x189a('0x22')]();};}function saveUpdates(_0x1133e5,_0x3892fe){return function(_0x5dd369){if(_0x5dd369){return _0x5dd369[_0x189a('0x23')](_0x1133e5)[_0x189a('0x24')](function(_0x3a0226){return _0x3a0226;});}return null;};}function removeEntity(_0x321bb4,_0x2f991c){return function(_0x4637bd){if(_0x4637bd){return _0x4637bd[_0x189a('0x25')]()[_0x189a('0x24')](function(){_0x321bb4[_0x189a('0x1c')](0xcc)[_0x189a('0x26')]();});}};}function handleEntityNotFound(_0x5f310e,_0x327d73){return function(_0x163cf0){if(!_0x163cf0){_0x5f310e['sendStatus'](0x194);}return _0x163cf0;};}function handleError(_0x41964c,_0x1d5534){_0x1d5534=_0x1d5534||0x1f4;return function(_0xc8502c){logger['error'](_0xc8502c[_0x189a('0x27')]);if(_0xc8502c[_0x189a('0x28')]){delete _0xc8502c[_0x189a('0x28')];}_0x41964c[_0x189a('0x1c')](_0x1d5534)['send'](_0xc8502c);};}exports[_0x189a('0x29')]=function(_0x33a90c,_0x477397){var _0x13fdbd={},_0xc41e3c={},_0x2c96ce={'count':0x0,'rows':[]};var _0x9073b4=_[_0x189a('0x2a')](db[_0x189a('0x2b')][_0x189a('0x2c')],function(_0xc68e73){return{'name':_0xc68e73[_0x189a('0x2d')],'type':_0xc68e73[_0x189a('0x2e')][_0x189a('0x2f')]};});_0xc41e3c[_0x189a('0x30')]=_[_0x189a('0x2a')](_0x9073b4,_0x189a('0x28'));_0xc41e3c['query']=_[_0x189a('0x31')](_0x33a90c[_0x189a('0x32')]);_0xc41e3c[_0x189a('0x33')]=_[_0x189a('0x34')](_0xc41e3c[_0x189a('0x30')],_0xc41e3c[_0x189a('0x32')]);_0x13fdbd[_0x189a('0x35')]=_[_0x189a('0x34')](_0xc41e3c[_0x189a('0x30')],qs[_0x189a('0x36')](_0x33a90c['query'][_0x189a('0x36')]));_0x13fdbd[_0x189a('0x35')]=_0x13fdbd['attributes'][_0x189a('0x37')]?_0x13fdbd[_0x189a('0x35')]:_0xc41e3c[_0x189a('0x30')];if(!_0x33a90c[_0x189a('0x32')][_0x189a('0x38')](_0x189a('0x39'))){_0x13fdbd[_0x189a('0x1f')]=qs[_0x189a('0x1f')](_0x33a90c[_0x189a('0x32')]['limit']);_0x13fdbd['offset']=qs[_0x189a('0x3a')](_0x33a90c['query']['offset']);}_0x13fdbd[_0x189a('0x3b')]=qs[_0x189a('0x3c')](_0x33a90c[_0x189a('0x32')][_0x189a('0x3c')]);_0x13fdbd[_0x189a('0x3d')]=qs[_0x189a('0x33')](_[_0x189a('0x3e')](_0x33a90c[_0x189a('0x32')],_0xc41e3c[_0x189a('0x33')]),_0x9073b4);if(_0x33a90c[_0x189a('0x32')][_0x189a('0x3f')]){_0x13fdbd['where']=_['merge'](_0x13fdbd[_0x189a('0x3d')],{'$or':_[_0x189a('0x2a')](_0x9073b4,function(_0x260afe){if(_0x260afe[_0x189a('0x2e')]!==_0x189a('0x40')){var _0x384f98={};_0x384f98[_0x260afe[_0x189a('0x28')]]={'$like':'%'+_0x33a90c[_0x189a('0x32')][_0x189a('0x3f')]+'%'};return _0x384f98;}})});}_0x13fdbd=_[_0x189a('0x41')]({},_0x13fdbd,_0x33a90c[_0x189a('0x42')]);var _0x3af855={'where':_0x13fdbd[_0x189a('0x3d')]};return db[_0x189a('0x2b')][_0x189a('0x43')](_0x3af855)[_0x189a('0x24')](function(_0x770f32){_0x2c96ce[_0x189a('0x43')]=_0x770f32;if(_0x33a90c[_0x189a('0x32')][_0x189a('0x44')]){_0x13fdbd[_0x189a('0x45')]=[{'all':!![]}];}return db[_0x189a('0x2b')][_0x189a('0x46')](_0x13fdbd);})['then'](function(_0x1d6153){_0x2c96ce[_0x189a('0x47')]=_0x1d6153;return _0x2c96ce;})[_0x189a('0x24')](respondWithFilteredResult(_0x477397,_0x13fdbd))[_0x189a('0x48')](handleError(_0x477397,null));};exports[_0x189a('0x49')]=function(_0x1a1266,_0x1c62f9){var _0x5f5630={'raw':!![],'where':{'id':_0x1a1266[_0x189a('0x4a')]['id']}},_0x58b4f5={};_0x58b4f5[_0x189a('0x30')]=_[_0x189a('0x31')](db[_0x189a('0x2b')][_0x189a('0x2c')]);_0x58b4f5[_0x189a('0x32')]=_[_0x189a('0x31')](_0x1a1266[_0x189a('0x32')]);_0x58b4f5[_0x189a('0x33')]=_[_0x189a('0x34')](_0x58b4f5['model'],_0x58b4f5[_0x189a('0x32')]);_0x5f5630[_0x189a('0x35')]=_[_0x189a('0x34')](_0x58b4f5[_0x189a('0x30')],qs[_0x189a('0x36')](_0x1a1266[_0x189a('0x32')][_0x189a('0x36')]));_0x5f5630[_0x189a('0x35')]=_0x5f5630[_0x189a('0x35')][_0x189a('0x37')]?_0x5f5630['attributes']:_0x58b4f5[_0x189a('0x30')];if(_0x1a1266['query'][_0x189a('0x44')]){_0x5f5630[_0x189a('0x45')]=[{'all':!![]}];}_0x5f5630=_[_0x189a('0x41')]({},_0x5f5630,_0x1a1266[_0x189a('0x42')]);return db[_0x189a('0x2b')][_0x189a('0x4b')](_0x5f5630)[_0x189a('0x24')](handleEntityNotFound(_0x1c62f9,null))[_0x189a('0x24')](respondWithResult(_0x1c62f9,null))['catch'](handleError(_0x1c62f9,null));};exports[_0x189a('0x4c')]=function(_0xfff756,_0x4f0198){return db['MailTransferReport'][_0x189a('0x4c')](_0xfff756[_0x189a('0x4d')],{})[_0x189a('0x24')](respondWithResult(_0x4f0198,0xc9))[_0x189a('0x48')](handleError(_0x4f0198,null));};exports['update']=function(_0x38beb1,_0x150f93){if(_0x38beb1[_0x189a('0x4d')]['id']){delete _0x38beb1[_0x189a('0x4d')]['id'];}return db[_0x189a('0x2b')][_0x189a('0x4b')]({'where':{'id':_0x38beb1[_0x189a('0x4a')]['id']}})[_0x189a('0x24')](handleEntityNotFound(_0x150f93,null))[_0x189a('0x24')](saveUpdates(_0x38beb1[_0x189a('0x4d')],null))['then'](respondWithResult(_0x150f93,null))[_0x189a('0x48')](handleError(_0x150f93,null));};exports[_0x189a('0x25')]=function(_0xbd369d,_0x200fcc){return db['MailTransferReport'][_0x189a('0x4b')]({'where':{'id':_0xbd369d[_0x189a('0x4a')]['id']}})[_0x189a('0x24')](handleEntityNotFound(_0x200fcc,null))[_0x189a('0x24')](removeEntity(_0x200fcc,null))[_0x189a('0x48')](handleError(_0x200fcc,null));};exports[_0x189a('0x4e')]=function(_0x1a46b9,_0x215227){return db[_0x189a('0x2b')][_0x189a('0x4e')]()[_0x189a('0x24')](respondWithResult(_0x215227,null))[_0x189a('0x48')](handleError(_0x215227,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 30c3cee..e88f528 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 _0x3a5e=['moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x23cdce,_0x344a6b){var _0x2076d4=function(_0x41db1e){while(--_0x41db1e){_0x23cdce['push'](_0x23cdce['shift']());}};_0x2076d4(++_0x344a6b);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x183e80,_0x5baa52){_0x183e80=_0x183e80-0x0;var _0x1e8fda=_0x3a5e[_0x183e80];return _0x1e8fda;};'use strict';var _=require(_0xe3a5('0x0'));var util=require(_0xe3a5('0x1'));var logger=require(_0xe3a5('0x2'))(_0xe3a5('0x3'));var moment=require(_0xe3a5('0x4'));var BPromise=require(_0xe3a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3a5('0x6'));var rimraf=require(_0xe3a5('0x7'));var config=require(_0xe3a5('0x8'));var attributes=require(_0xe3a5('0x9'));module[_0xe3a5('0xa')]=function(_0x499f61,_0x5e1507){return _0x499f61[_0xe3a5('0xb')]('MailTransferReport',attributes,{'tableName':_0xe3a5('0xc'),'paranoid':![],'indexes':[{'name':_0xe3a5('0xd'),'fields':[_0xe3a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe6f=['bluebird','request-promise','path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe6f,0x105));var _0xfbe6=function(_0x216d8d,_0x35969c){_0x216d8d=_0x216d8d-0x0;var _0x547a5c=_0xbe6f[_0x216d8d];return _0x547a5c;};'use strict';var _=require(_0xfbe6('0x0'));var util=require(_0xfbe6('0x1'));var logger=require('../../config/logger')(_0xfbe6('0x2'));var moment=require('moment');var BPromise=require(_0xfbe6('0x3'));var rp=require(_0xfbe6('0x4'));var fs=require('fs');var path=require(_0xfbe6('0x5'));var rimraf=require('rimraf');var config=require(_0xfbe6('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0xfbe6('0x7')]=function(_0x22b077,_0x4abcf3){return _0x22b077[_0xfbe6('0x8')](_0xfbe6('0x9'),attributes,{'tableName':_0xfbe6('0xa'),'paranoid':![],'indexes':[{'name':_0xfbe6('0xb'),'fields':[_0xfbe6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 280447f..43aadda 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 _0x3c41=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x4e0a42,_0x90f21f){var _0x370929=function(_0x22679f){while(--_0x22679f){_0x4e0a42['push'](_0x4e0a42['shift']());}};_0x370929(++_0x90f21f);}(_0x3c41,0x8e));var _0x13c4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3c41[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x13c4('0x0'));var util=require(_0x13c4('0x1'));var moment=require(_0x13c4('0x2'));var BPromise=require(_0x13c4('0x3'));var rs=require(_0x13c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13c4('0x5'))['db'];var utils=require(_0x13c4('0x6'));var logger=require(_0x13c4('0x7'))(_0x13c4('0x8'));var config=require(_0x13c4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x13c4('0xa')][_0x13c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4950dc,_0x1850f3,_0x4979bc){return new BPromise(function(_0x1106c1,_0x287674){return client[_0x13c4('0xc')](_0x4950dc,_0x4979bc)[_0x13c4('0xd')](function(_0x30db85){logger['info'](_0x13c4('0xe'),_0x1850f3,'request\x20sent');logger['debug'](_0x13c4('0xf'),_0x1850f3,'request\x20sent',JSON[_0x13c4('0x10')](_0x30db85));if(_0x30db85[_0x13c4('0x11')]){if(_0x30db85[_0x13c4('0x11')][_0x13c4('0x12')]===0x1f4){logger[_0x13c4('0x11')](_0x13c4('0xe'),_0x1850f3,_0x30db85[_0x13c4('0x11')][_0x13c4('0x13')]);return _0x287674(_0x30db85['error'][_0x13c4('0x13')]);}logger['error'](_0x13c4('0xe'),_0x1850f3,_0x30db85[_0x13c4('0x11')][_0x13c4('0x13')]);return _0x1106c1(_0x30db85['error'][_0x13c4('0x13')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1850f3,'request\x20sent');_0x1106c1(_0x30db85[_0x13c4('0x14')][_0x13c4('0x13')]);}})['catch'](function(_0x7e6fdc){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1850f3,_0x7e6fdc);_0x287674(_0x7e6fdc);});});} \ No newline at end of file +var _0xcd83=['client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5f52d7,_0x284467){var _0x3e0186=function(_0x4a1bcb){while(--_0x4a1bcb){_0x5f52d7['push'](_0x5f52d7['shift']());}};_0x3e0186(++_0x284467);}(_0xcd83,0x138));var _0x3cd8=function(_0x538947,_0x357a64){_0x538947=_0x538947-0x0;var _0x8345c4=_0xcd83[_0x538947];return _0x8345c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3cd8('0x0'));var BPromise=require(_0x3cd8('0x1'));var rs=require(_0x3cd8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cd8('0x3'))['db'];var utils=require(_0x3cd8('0x4'));var logger=require('../../config/logger')(_0x3cd8('0x5'));var config=require(_0x3cd8('0x6'));var jayson=require(_0x3cd8('0x7'));var client=jayson[_0x3cd8('0x8')][_0x3cd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bffdc,_0x4c69fb,_0x1d4f9a){return new BPromise(function(_0x4cfb18,_0x2affa8){return client[_0x3cd8('0xa')](_0x5bffdc,_0x1d4f9a)['then'](function(_0x51c2fd){logger[_0x3cd8('0xb')](_0x3cd8('0xc'),_0x4c69fb,_0x3cd8('0xd'));logger[_0x3cd8('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4c69fb,_0x3cd8('0xd'),JSON[_0x3cd8('0xf')](_0x51c2fd));if(_0x51c2fd[_0x3cd8('0x10')]){if(_0x51c2fd[_0x3cd8('0x10')][_0x3cd8('0x11')]===0x1f4){logger[_0x3cd8('0x10')](_0x3cd8('0xc'),_0x4c69fb,_0x51c2fd['error']['message']);return _0x2affa8(_0x51c2fd['error'][_0x3cd8('0x12')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4c69fb,_0x51c2fd[_0x3cd8('0x10')][_0x3cd8('0x12')]);return _0x4cfb18(_0x51c2fd[_0x3cd8('0x10')][_0x3cd8('0x12')]);}else{logger[_0x3cd8('0xb')](_0x3cd8('0xc'),_0x4c69fb,_0x3cd8('0xd'));_0x4cfb18(_0x51c2fd[_0x3cd8('0x13')]['message']);}})['catch'](function(_0x43ea30){logger[_0x3cd8('0x10')](_0x3cd8('0xc'),_0x4c69fb,_0x43ea30);_0x2affa8(_0x43ea30);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 68fd216..79d4016 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 _0x1139=['Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','show','post','create','/:id','update','destroy','exports','multer','util','path','express'];(function(_0x1394a2,_0x533264){var _0x31dcd1=function(_0x58c693){while(--_0x58c693){_0x1394a2['push'](_0x1394a2['shift']());}};_0x31dcd1(++_0x533264);}(_0x1139,0x19a));var _0x9113=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1139[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var path=require(_0x9113('0x2'));var timeout=require('connect-timeout');var express=require(_0x9113('0x3'));var router=express[_0x9113('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9113('0x5'));var interaction=require(_0x9113('0x6'));var config=require('../../config/environment');var controller=require(_0x9113('0x7'));router['get']('/',auth[_0x9113('0x8')](),controller[_0x9113('0x9')]);router[_0x9113('0xa')]('/describe',auth[_0x9113('0x8')](),controller['describe']);router[_0x9113('0xa')]('/:id',auth[_0x9113('0x8')](),controller[_0x9113('0xb')]);router[_0x9113('0xc')]('/',auth[_0x9113('0x8')](),controller[_0x9113('0xd')]);router['put'](_0x9113('0xe'),auth[_0x9113('0x8')](),controller[_0x9113('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9113('0x10')]);module[_0x9113('0x11')]=router; \ No newline at end of file +var _0x3211=['describe','/:id','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x3211,0x192));var _0x1321=function(_0x441fd4,_0x7aa65a){_0x441fd4=_0x441fd4-0x0;var _0x570d91=_0x3211[_0x441fd4];return _0x570d91;};'use strict';var multer=require(_0x1321('0x0'));var util=require(_0x1321('0x1'));var path=require(_0x1321('0x2'));var timeout=require(_0x1321('0x3'));var express=require(_0x1321('0x4'));var router=express[_0x1321('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1321('0x6'));var interaction=require(_0x1321('0x7'));var config=require(_0x1321('0x8'));var controller=require('./memberReport.controller');router[_0x1321('0x9')]('/',auth[_0x1321('0xa')](),controller['index']);router[_0x1321('0x9')](_0x1321('0xb'),auth[_0x1321('0xa')](),controller[_0x1321('0xc')]);router[_0x1321('0x9')](_0x1321('0xd'),auth[_0x1321('0xa')](),controller['show']);router[_0x1321('0xe')]('/',auth[_0x1321('0xa')](),controller[_0x1321('0xf')]);router['put'](_0x1321('0xd'),auth[_0x1321('0xa')](),controller['update']);router[_0x1321('0x10')](_0x1321('0xd'),auth[_0x1321('0xa')](),controller['destroy']);module[_0x1321('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 6e42a1f..63c6c31 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 _0xb7c8=['INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x4abbb7,_0x4cd94e){var _0x190f58=function(_0x468999){while(--_0x468999){_0x4abbb7['push'](_0x4abbb7['shift']());}};_0x190f58(++_0x4cd94e);}(_0xb7c8,0x119));var _0x8b7c=function(_0x430656,_0x51c912){_0x430656=_0x430656-0x0;var _0x448807=_0xb7c8[_0x430656];return _0x448807;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8b7c('0x0'));module[_0x8b7c('0x1')]={'channel':{'type':Sequelize[_0x8b7c('0x2')]},'membername':{'type':Sequelize[_0x8b7c('0x2')]},'interface':{'type':Sequelize[_0x8b7c('0x2')]},'type':{'type':Sequelize[_0x8b7c('0x2')],'defaultValue':_0x8b7c('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x8b7c('0x4')]},'enterAt':{'type':Sequelize[_0x8b7c('0x5')]},'exitAt':{'type':Sequelize[_0x8b7c('0x5')],'set':function(_0x440900){var _0x107428=moment(_0x440900);var _0x12665c=moment(this[_0x8b7c('0x6')](_0x8b7c('0x7')));var _0x6afb55=_0x107428[_0x8b7c('0x8')](_0x12665c,_0x8b7c('0x9'));this[_0x8b7c('0xa')]('exitAt',_0x440900);this[_0x8b7c('0xa')]('duration',_0x6afb55||null);}},'data1':{'type':Sequelize[_0x8b7c('0x2')],'comment':_0x8b7c('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x8b7c('0xc')},'data3':{'type':Sequelize[_0x8b7c('0x2')],'comment':_0x8b7c('0xd')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x8b7c('0x2')],'comment':_0x8b7c('0xe')},'role':{'type':Sequelize[_0x8b7c('0x2')]},'internal':{'type':Sequelize[_0x8b7c('0x4')]},'uniqueid':{'type':Sequelize[_0x8b7c('0x2')]}}; \ No newline at end of file +var _0xb31a=['exitAt','duration','talk:[start]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0xb31a,0xd4));var _0xab31=function(_0x1d651b,_0x4423a9){_0x1d651b=_0x1d651b-0x0;var _0x34998e=_0xb31a[_0x1d651b];return _0x34998e;};'use strict';var Sequelize=require(_0xab31('0x0'));var moment=require(_0xab31('0x1'));module[_0xab31('0x2')]={'channel':{'type':Sequelize[_0xab31('0x3')]},'membername':{'type':Sequelize[_0xab31('0x3')]},'interface':{'type':Sequelize[_0xab31('0x3')]},'type':{'type':Sequelize[_0xab31('0x3')],'defaultValue':_0xab31('0x4'),'comment':_0xab31('0x5')},'duration':{'type':Sequelize[_0xab31('0x6')]},'enterAt':{'type':Sequelize[_0xab31('0x7')]},'exitAt':{'type':Sequelize[_0xab31('0x7')],'set':function(_0x9c6740){var _0x2c336b=moment(_0x9c6740);var _0x2b8f95=moment(this['getDataValue'](_0xab31('0x8')));var _0x1eaa9c=_0x2c336b[_0xab31('0x9')](_0x2b8f95,_0xab31('0xa'));this[_0xab31('0xb')](_0xab31('0xc'),_0x9c6740);this[_0xab31('0xb')](_0xab31('0xd'),_0x1eaa9c||null);}},'data1':{'type':Sequelize[_0xab31('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0xab31('0xe')},'data3':{'type':Sequelize[_0xab31('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xab31('0x3')],'comment':_0xab31('0xf')},'data5':{'type':Sequelize[_0xab31('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xab31('0x6')]},'uniqueid':{'type':Sequelize[_0xab31('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 1a8e799..4f9c784 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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x34e8,0x12c));var _0x834e=function(_0x456586,_0x3aaf02){_0x456586=_0x456586-0x0;var _0x2ef4d6=_0x34e8[_0x456586];return _0x2ef4d6;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0xf0cc12,_0x3ca801){var _0x1c1747=function(_0x6ad7ae){while(--_0x6ad7ae){_0xf0cc12['push'](_0xf0cc12['shift']());}};_0x1c1747(++_0x3ca801);}(_0x3e74,0x175));var _0x43e7=function(_0x287c86,_0x30555b){_0x287c86=_0x287c86-0x0;var _0x328edb=_0x3e74[_0x287c86];return _0x328edb;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 29ec1ce..02c3db1 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 _0xd9a5=['report_member','membername_interface','membername','interface','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define'];(function(_0x49140c,_0x50e83d){var _0x3e2eff=function(_0x5b9e77){while(--_0x5b9e77){_0x49140c['push'](_0x49140c['shift']());}};_0x3e2eff(++_0x50e83d);}(_0xd9a5,0x74));var _0x5d9a=function(_0x34950f,_0x345c88){_0x34950f=_0x34950f-0x0;var _0xaab5f7=_0xd9a5[_0x34950f];return _0xaab5f7;};'use strict';var _=require(_0x5d9a('0x0'));var util=require(_0x5d9a('0x1'));var logger=require(_0x5d9a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d9a('0x3'));var rp=require(_0x5d9a('0x4'));var fs=require('fs');var path=require(_0x5d9a('0x5'));var rimraf=require(_0x5d9a('0x6'));var config=require(_0x5d9a('0x7'));var attributes=require(_0x5d9a('0x8'));module['exports']=function(_0x3180e5,_0x1e7a9c){return _0x3180e5[_0x5d9a('0x9')]('MemberReport',attributes,{'tableName':_0x5d9a('0xa'),'paranoid':![],'indexes':[{'name':_0x5d9a('0xb'),'fields':[_0x5d9a('0xc'),_0x5d9a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x41ec=['interface','util','api','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername'];(function(_0x4218e4,_0x4a7e5c){var _0x23dfb6=function(_0x127732){while(--_0x127732){_0x4218e4['push'](_0x4218e4['shift']());}};_0x23dfb6(++_0x4a7e5c);}(_0x41ec,0x143));var _0xc41e=function(_0x465fb7,_0x4f43bd){_0x465fb7=_0x465fb7-0x0;var _0x4aff16=_0x41ec[_0x465fb7];return _0x4aff16;};'use strict';var _=require('lodash');var util=require(_0xc41e('0x0'));var logger=require('../../config/logger')(_0xc41e('0x1'));var moment=require(_0xc41e('0x2'));var BPromise=require('bluebird');var rp=require(_0xc41e('0x3'));var fs=require('fs');var path=require(_0xc41e('0x4'));var rimraf=require(_0xc41e('0x5'));var config=require(_0xc41e('0x6'));var attributes=require(_0xc41e('0x7'));module[_0xc41e('0x8')]=function(_0x3351e2,_0x92f7c){return _0x3351e2[_0xc41e('0x9')](_0xc41e('0xa'),attributes,{'tableName':_0xc41e('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xc41e('0xc'),_0xc41e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index d957c8f..ce6268c 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 _0x5d95=['MemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','options','raw','where','limit','map','include','model','attributes','then','stringify','CreateMemberReport'];(function(_0x1f775d,_0x5d18fe){var _0x144b68=function(_0x1d49c0){while(--_0x1d49c0){_0x1f775d['push'](_0x1f775d['shift']());}};_0x144b68(++_0x5d18fe);}(_0x5d95,0x77));var _0x55d9=function(_0xfba808,_0x12b2ca){_0xfba808=_0xfba808-0x0;var _0x33ffb9=_0x5d95[_0xfba808];return _0x33ffb9;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var moment=require('moment');var BPromise=require(_0x55d9('0x2'));var rs=require(_0x55d9('0x3'));var fs=require('fs');var Redis=require(_0x55d9('0x4'));var db=require(_0x55d9('0x5'))['db'];var utils=require(_0x55d9('0x6'));var logger=require('../../config/logger')(_0x55d9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55d9('0x8')][_0x55d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b4471,_0x5768e7,_0x5d0b9d){return new BPromise(function(_0x5e52f8,_0x4e27cc){return client[_0x55d9('0xa')](_0x5b4471,_0x5d0b9d)['then'](function(_0x4d52fa){logger[_0x55d9('0xb')](_0x55d9('0xc'),_0x5768e7,_0x55d9('0xd'));logger[_0x55d9('0xe')](_0x55d9('0xf'),_0x5768e7,_0x55d9('0xd'),JSON['stringify'](_0x4d52fa));if(_0x4d52fa['error']){if(_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x11')]===0x1f4){logger[_0x55d9('0x10')](_0x55d9('0xc'),_0x5768e7,_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);return _0x4e27cc(_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);}logger[_0x55d9('0x10')]('MemberReport,\x20%s,\x20%s',_0x5768e7,_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);return _0x5e52f8(_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);}else{logger[_0x55d9('0xb')](_0x55d9('0xc'),_0x5768e7,_0x55d9('0xd'));_0x5e52f8(_0x4d52fa[_0x55d9('0x13')][_0x55d9('0x12')]);}})[_0x55d9('0x14')](function(_0x30621b){logger[_0x55d9('0x10')](_0x55d9('0xc'),_0x5768e7,_0x30621b);_0x4e27cc(_0x30621b);});});}exports[_0x55d9('0x15')]=function(_0x50faa6){var _0xce6a36=this;return new Promise(function(_0x1af997,_0x5b9283){return db['MemberReport']['findAll']({'raw':_0x50faa6[_0x55d9('0x16')]?_0x50faa6[_0x55d9('0x16')][_0x55d9('0x17')]===undefined?!![]:![]:!![],'where':_0x50faa6[_0x55d9('0x16')]?_0x50faa6['options'][_0x55d9('0x18')]||null:null,'attributes':_0x50faa6[_0x55d9('0x16')]?_0x50faa6[_0x55d9('0x16')]['attributes']||null:null,'limit':_0x50faa6[_0x55d9('0x16')]?_0x50faa6[_0x55d9('0x16')][_0x55d9('0x19')]||null:null,'include':_0x50faa6[_0x55d9('0x16')]?_0x50faa6['options']['include']?_[_0x55d9('0x1a')](_0x50faa6[_0x55d9('0x16')][_0x55d9('0x1b')],function(_0x3e1eef){return{'model':db[_0x3e1eef[_0x55d9('0x1c')]],'as':_0x3e1eef['as'],'attributes':_0x3e1eef[_0x55d9('0x1d')],'include':_0x3e1eef[_0x55d9('0x1b')]?_[_0x55d9('0x1a')](_0x3e1eef[_0x55d9('0x1b')],function(_0x4bd725){return{'model':db[_0x4bd725[_0x55d9('0x1c')]],'as':_0x4bd725['as'],'attributes':_0x4bd725[_0x55d9('0x1d')],'include':_0x4bd725['include']?_[_0x55d9('0x1a')](_0x4bd725['include'],function(_0x2c1890){return{'model':db[_0x2c1890[_0x55d9('0x1c')]],'as':_0x2c1890['as'],'attributes':_0x2c1890[_0x55d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x55d9('0x1e')](function(_0x22218f){logger['info'](_0x55d9('0x15'),_0x50faa6);logger['debug']('GetMemberReport',_0x50faa6,JSON[_0x55d9('0x1f')](_0x22218f));_0x1af997(_0x22218f);})[_0x55d9('0x14')](function(_0x1b18bb){logger['error'](_0x55d9('0x15'),_0x1b18bb[_0x55d9('0x12')],_0x50faa6);_0x5b9283(_0xce6a36[_0x55d9('0x10')](0x1f4,_0x1b18bb[_0x55d9('0x12')]));});});};exports[_0x55d9('0x20')]=function(_0x8464a3){var _0x19ca6a=this;return new Promise(function(_0x3933ee,_0x4760e3){return db[_0x55d9('0x21')][_0x55d9('0x22')](_0x8464a3[_0x55d9('0x23')],{'raw':_0x8464a3[_0x55d9('0x16')]?_0x8464a3[_0x55d9('0x16')][_0x55d9('0x17')]===undefined?!![]:![]:!![]})[_0x55d9('0x1e')](function(_0x3306a5){logger[_0x55d9('0xb')](_0x55d9('0x20'),_0x8464a3);logger[_0x55d9('0xe')](_0x55d9('0x20'),_0x8464a3,JSON[_0x55d9('0x1f')](_0x3306a5));_0x3933ee(_0x3306a5);})[_0x55d9('0x14')](function(_0x2f23a1){logger['error']('CreateMemberReport',_0x2f23a1[_0x55d9('0x12')],_0x8464a3);_0x4760e3(_0x19ca6a[_0x55d9('0x10')](0x1f4,_0x2f23a1[_0x55d9('0x12')]));});});};exports[_0x55d9('0x24')]=function(_0x1ce38d){var _0x3ad3bc=this;return new Promise(function(_0x4772b4,_0x240180){return db['MemberReport'][_0x55d9('0x25')](_0x1ce38d[_0x55d9('0x23')],{'raw':_0x1ce38d[_0x55d9('0x16')]?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ce38d['options']?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x18')]||null:null,'attributes':_0x1ce38d[_0x55d9('0x16')]?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x1d')]||null:null,'limit':_0x1ce38d[_0x55d9('0x16')]?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x19')]||null:null})[_0x55d9('0x1e')](function(_0x465d1e){logger[_0x55d9('0xb')](_0x55d9('0x24'),_0x1ce38d);logger[_0x55d9('0xe')](_0x55d9('0x24'),_0x1ce38d,JSON[_0x55d9('0x1f')](_0x465d1e));_0x4772b4(_0x465d1e);})[_0x55d9('0x14')](function(_0x20007d){logger['error'](_0x55d9('0x24'),_0x20007d['message'],_0x1ce38d);_0x240180(_0x3ad3bc[_0x55d9('0x10')](0x1f4,_0x20007d[_0x55d9('0x12')]));});});}; \ No newline at end of file +var _0x7edb=['update','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','CreateMemberReport','body','then','stringify','UpdateMemberReport'];(function(_0x44ef04,_0x1c7577){var _0x1f191e=function(_0xe49caf){while(--_0xe49caf){_0x44ef04['push'](_0x44ef04['shift']());}};_0x1f191e(++_0x1c7577);}(_0x7edb,0x158));var _0xb7ed=function(_0x3e4cba,_0xd2535b){_0x3e4cba=_0x3e4cba-0x0;var _0x13bbd1=_0x7edb[_0x3e4cba];return _0x13bbd1;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var moment=require(_0xb7ed('0x1'));var BPromise=require(_0xb7ed('0x2'));var rs=require(_0xb7ed('0x3'));var fs=require('fs');var Redis=require(_0xb7ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7ed('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb7ed('0x6'));var jayson=require(_0xb7ed('0x7'));var client=jayson[_0xb7ed('0x8')][_0xb7ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x85fdf0,_0x161542,_0xac7ffe){return new BPromise(function(_0x3c991d,_0x3aee5b){return client[_0xb7ed('0xa')](_0x85fdf0,_0xac7ffe)['then'](function(_0x209255){logger[_0xb7ed('0xb')](_0xb7ed('0xc'),_0x161542,_0xb7ed('0xd'));logger[_0xb7ed('0xe')](_0xb7ed('0xf'),_0x161542,_0xb7ed('0xd'),JSON['stringify'](_0x209255));if(_0x209255[_0xb7ed('0x10')]){if(_0x209255[_0xb7ed('0x10')][_0xb7ed('0x11')]===0x1f4){logger[_0xb7ed('0x10')](_0xb7ed('0xc'),_0x161542,_0x209255['error']['message']);return _0x3aee5b(_0x209255[_0xb7ed('0x10')]['message']);}logger[_0xb7ed('0x10')](_0xb7ed('0xc'),_0x161542,_0x209255[_0xb7ed('0x10')][_0xb7ed('0x12')]);return _0x3c991d(_0x209255[_0xb7ed('0x10')][_0xb7ed('0x12')]);}else{logger[_0xb7ed('0xb')](_0xb7ed('0xc'),_0x161542,_0xb7ed('0xd'));_0x3c991d(_0x209255[_0xb7ed('0x13')][_0xb7ed('0x12')]);}})[_0xb7ed('0x14')](function(_0x569fb1){logger[_0xb7ed('0x10')]('MemberReport,\x20%s,\x20%s',_0x161542,_0x569fb1);_0x3aee5b(_0x569fb1);});});}exports[_0xb7ed('0x15')]=function(_0x20fe85){var _0x537d3b=this;return new Promise(function(_0x4f1bb3,_0x11e27f){return db[_0xb7ed('0x16')][_0xb7ed('0x17')]({'raw':_0x20fe85['options']?_0x20fe85[_0xb7ed('0x18')][_0xb7ed('0x19')]===undefined?!![]:![]:!![],'where':_0x20fe85[_0xb7ed('0x18')]?_0x20fe85[_0xb7ed('0x18')]['where']||null:null,'attributes':_0x20fe85[_0xb7ed('0x18')]?_0x20fe85[_0xb7ed('0x18')][_0xb7ed('0x1a')]||null:null,'limit':_0x20fe85[_0xb7ed('0x18')]?_0x20fe85[_0xb7ed('0x18')][_0xb7ed('0x1b')]||null:null,'include':_0x20fe85[_0xb7ed('0x18')]?_0x20fe85[_0xb7ed('0x18')]['include']?_[_0xb7ed('0x1c')](_0x20fe85[_0xb7ed('0x18')]['include'],function(_0x4f68b6){return{'model':db[_0x4f68b6['model']],'as':_0x4f68b6['as'],'attributes':_0x4f68b6[_0xb7ed('0x1a')],'include':_0x4f68b6['include']?_['map'](_0x4f68b6[_0xb7ed('0x1d')],function(_0x5807fd){return{'model':db[_0x5807fd[_0xb7ed('0x1e')]],'as':_0x5807fd['as'],'attributes':_0x5807fd['attributes'],'include':_0x5807fd[_0xb7ed('0x1d')]?_[_0xb7ed('0x1c')](_0x5807fd[_0xb7ed('0x1d')],function(_0x27eb83){return{'model':db[_0x27eb83[_0xb7ed('0x1e')]],'as':_0x27eb83['as'],'attributes':_0x27eb83['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x74eb3c){logger[_0xb7ed('0xb')](_0xb7ed('0x15'),_0x20fe85);logger[_0xb7ed('0xe')](_0xb7ed('0x15'),_0x20fe85,JSON['stringify'](_0x74eb3c));_0x4f1bb3(_0x74eb3c);})[_0xb7ed('0x14')](function(_0x43bb8f){logger['error'](_0xb7ed('0x15'),_0x43bb8f[_0xb7ed('0x12')],_0x20fe85);_0x11e27f(_0x537d3b[_0xb7ed('0x10')](0x1f4,_0x43bb8f['message']));});});};exports[_0xb7ed('0x1f')]=function(_0x28da94){var _0x2c4407=this;return new Promise(function(_0x1cbcd6,_0x48d4e5){return db[_0xb7ed('0x16')]['create'](_0x28da94[_0xb7ed('0x20')],{'raw':_0x28da94[_0xb7ed('0x18')]?_0x28da94[_0xb7ed('0x18')][_0xb7ed('0x19')]===undefined?!![]:![]:!![]})[_0xb7ed('0x21')](function(_0x28904c){logger[_0xb7ed('0xb')]('CreateMemberReport',_0x28da94);logger[_0xb7ed('0xe')]('CreateMemberReport',_0x28da94,JSON[_0xb7ed('0x22')](_0x28904c));_0x1cbcd6(_0x28904c);})['catch'](function(_0x22246d){logger[_0xb7ed('0x10')](_0xb7ed('0x1f'),_0x22246d[_0xb7ed('0x12')],_0x28da94);_0x48d4e5(_0x2c4407['error'](0x1f4,_0x22246d[_0xb7ed('0x12')]));});});};exports[_0xb7ed('0x23')]=function(_0x19215b){var _0x267b0e=this;return new Promise(function(_0x32dba1,_0x5c4a73){return db[_0xb7ed('0x16')][_0xb7ed('0x24')](_0x19215b[_0xb7ed('0x20')],{'raw':_0x19215b[_0xb7ed('0x18')]?_0x19215b[_0xb7ed('0x18')][_0xb7ed('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19215b[_0xb7ed('0x18')]?_0x19215b[_0xb7ed('0x18')][_0xb7ed('0x25')]||null:null,'attributes':_0x19215b['options']?_0x19215b[_0xb7ed('0x18')]['attributes']||null:null,'limit':_0x19215b[_0xb7ed('0x18')]?_0x19215b[_0xb7ed('0x18')][_0xb7ed('0x1b')]||null:null})['then'](function(_0x3bf69e){logger[_0xb7ed('0xb')](_0xb7ed('0x23'),_0x19215b);logger[_0xb7ed('0xe')](_0xb7ed('0x23'),_0x19215b,JSON[_0xb7ed('0x22')](_0x3bf69e));_0x32dba1(_0x3bf69e);})['catch'](function(_0x484b5a){logger[_0xb7ed('0x10')]('UpdateMemberReport',_0x484b5a[_0xb7ed('0x12')],_0x19215b);_0x5c4a73(_0x267b0e[_0xb7ed('0x10')](0x1f4,_0x484b5a['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 108f8ac..d68022d 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 _0x6f1e=['get','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x2c2de0,_0x36b77a){var _0x281471=function(_0x6d2bd7){while(--_0x6d2bd7){_0x2c2de0['push'](_0x2c2de0['shift']());}};_0x281471(++_0x36b77a);}(_0x6f1e,0x84));var _0xe6f1=function(_0x443b45,_0x4085cd){_0x443b45=_0x443b45-0x0;var _0x2a256f=_0x6f1e[_0x443b45];return _0x2a256f;};'use strict';var multer=require(_0xe6f1('0x0'));var util=require(_0xe6f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe6f1('0x2'));var router=express[_0xe6f1('0x3')]();var fs_extra=require(_0xe6f1('0x4'));var auth=require(_0xe6f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe6f1('0x6'));var controller=require(_0xe6f1('0x7'));router[_0xe6f1('0x8')]('/',controller['index']);module[_0xe6f1('0x9')]=router; \ No newline at end of file +var _0x3c06=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x462b3a,_0x52fa71){var _0xbc5daa=function(_0x10dc88){while(--_0x10dc88){_0x462b3a['push'](_0x462b3a['shift']());}};_0xbc5daa(++_0x52fa71);}(_0x3c06,0xf7));var _0x63c0=function(_0x38b090,_0x471976){_0x38b090=_0x38b090-0x0;var _0x1788ad=_0x3c06[_0x38b090];return _0x1788ad;};'use strict';var multer=require(_0x63c0('0x0'));var util=require(_0x63c0('0x1'));var path=require(_0x63c0('0x2'));var timeout=require(_0x63c0('0x3'));var express=require(_0x63c0('0x4'));var router=express[_0x63c0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x63c0('0x6'));var interaction=require(_0x63c0('0x7'));var config=require(_0x63c0('0x8'));var controller=require(_0x63c0('0x9'));router[_0x63c0('0xa')]('/',controller[_0x63c0('0xb')]);module[_0x63c0('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 8dab53f..3d16785 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 _0x94c1=['exports','STRING','version','sequelize'];(function(_0x866374,_0xf73086){var _0x1e2183=function(_0x41e327){while(--_0x41e327){_0x866374['push'](_0x866374['shift']());}};_0x1e2183(++_0xf73086);}(_0x94c1,0x16f));var _0x194c=function(_0x3b7bf4,_0x4827b6){_0x3b7bf4=_0x3b7bf4-0x0;var _0x4a7a2e=_0x94c1[_0x3b7bf4];return _0x4a7a2e;};'use strict';var Sequelize=require(_0x194c('0x0'));module[_0x194c('0x1')]={'version':{'type':Sequelize[_0x194c('0x2')],'unique':_0x194c('0x3')}}; \ No newline at end of file +var _0x5601=['exports','STRING','version'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x5601,0x1ec));var _0x1560=function(_0x46bed1,_0xbdca16){_0x46bed1=_0x46bed1-0x0;var _0x4276f3=_0x5601[_0x46bed1];return _0x4276f3;};'use strict';var Sequelize=require('sequelize');module[_0x1560('0x0')]={'version':{'type':Sequelize[_0x1560('0x1')],'unique':_0x1560('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index e07963b..1afa9c2 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 _0xe9c1=['end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','stack','name','send','index','map','Migration','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x151286,_0x102d6c){var _0x5243c3=function(_0x53d8aa){while(--_0x53d8aa){_0x151286['push'](_0x151286['shift']());}};_0x5243c3(++_0x102d6c);}(_0xe9c1,0x1a7));var _0x1e9c=function(_0x5df259,_0xc5f461){_0x5df259=_0x5df259-0x0;var _0x40e2a3=_0xe9c1[_0x5df259];return _0x40e2a3;};'use strict';var emlformat=require(_0x1e9c('0x0'));var rimraf=require(_0x1e9c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1e9c('0x2'));var moment=require(_0x1e9c('0x3'));var BPromise=require(_0x1e9c('0x4'));var Mustache=require(_0x1e9c('0x5'));var util=require(_0x1e9c('0x6'));var path=require(_0x1e9c('0x7'));var sox=require(_0x1e9c('0x8'));var csv=require(_0x1e9c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e9c('0xa'));var squel=require('squel');var crypto=require(_0x1e9c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1e9c('0xc'));var toCsv=require(_0x1e9c('0x9'));var querystring=require(_0x1e9c('0xd'));var Papa=require(_0x1e9c('0xe'));var Redis=require('ioredis');var authService=require(_0x1e9c('0xf'));var qs=require(_0x1e9c('0x10'));var as=require(_0x1e9c('0x11'));var hardwareService=require(_0x1e9c('0x12'));var logger=require(_0x1e9c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1e9c('0x14'));var licenseUtil=require(_0x1e9c('0x15'));var db=require(_0x1e9c('0x16'))['db'];function respondWithStatusCode(_0x513d73,_0x4f6568){_0x4f6568=_0x4f6568||0xcc;return function(_0x4353af){if(_0x4353af){return _0x513d73[_0x1e9c('0x17')](_0x4f6568);}return _0x513d73[_0x1e9c('0x18')](_0x4f6568)[_0x1e9c('0x19')]();};}function respondWithResult(_0x15b437,_0x1004fd){_0x1004fd=_0x1004fd||0xc8;return function(_0x4dd803){if(_0x4dd803){return _0x15b437[_0x1e9c('0x18')](_0x1004fd)[_0x1e9c('0x1a')](_0x4dd803);}};}function respondWithFilteredResult(_0x3e3569,_0x34e9cd){return function(_0x55c615){if(_0x55c615){var _0x28c55a=typeof _0x34e9cd[_0x1e9c('0x1b')]===_0x1e9c('0x1c')&&typeof _0x34e9cd['limit']===_0x1e9c('0x1c');var _0x39a912=_0x55c615[_0x1e9c('0x1d')];var _0x4215cd=_0x28c55a?0x0:_0x34e9cd['offset'];var _0x16e144=_0x28c55a?_0x55c615[_0x1e9c('0x1d')]:_0x34e9cd[_0x1e9c('0x1b')]+_0x34e9cd[_0x1e9c('0x1e')];var _0x5df39a;if(_0x16e144>=_0x39a912){_0x16e144=_0x39a912;_0x5df39a=0xc8;}else{_0x5df39a=0xce;}_0x3e3569[_0x1e9c('0x18')](_0x5df39a);return _0x3e3569[_0x1e9c('0x1f')]('Content-Range',_0x4215cd+'-'+_0x16e144+'/'+_0x39a912)[_0x1e9c('0x1a')](_0x55c615);}return null;};}function patchUpdates(_0x30ef41){return function(_0x1dd06c){try{jsonpatch[_0x1e9c('0x20')](_0x1dd06c,_0x30ef41,!![]);}catch(_0x44e4c3){return BPromise[_0x1e9c('0x21')](_0x44e4c3);}return _0x1dd06c[_0x1e9c('0x22')]();};}function saveUpdates(_0x116909,_0x414611){return function(_0x1a75ee){if(_0x1a75ee){return _0x1a75ee['update'](_0x116909)[_0x1e9c('0x23')](function(_0x401728){return _0x401728;});}return null;};}function removeEntity(_0x550182,_0x1b02fa){return function(_0xe6a210){if(_0xe6a210){return _0xe6a210[_0x1e9c('0x24')]()[_0x1e9c('0x23')](function(){_0x550182[_0x1e9c('0x18')](0xcc)[_0x1e9c('0x19')]();});}};}function handleEntityNotFound(_0xdd93c1,_0x42922f){return function(_0x1e3c32){if(!_0x1e3c32){_0xdd93c1['sendStatus'](0x194);}return _0x1e3c32;};}function handleError(_0x2fc865,_0x70c452){_0x70c452=_0x70c452||0x1f4;return function(_0x3220b7){logger['error'](_0x3220b7[_0x1e9c('0x25')]);if(_0x3220b7[_0x1e9c('0x26')]){delete _0x3220b7[_0x1e9c('0x26')];}_0x2fc865['status'](_0x70c452)[_0x1e9c('0x27')](_0x3220b7);};}exports[_0x1e9c('0x28')]=function(_0x3a7dd6,_0x348676){var _0x47ca94={},_0x113e44={},_0x153431={'count':0x0,'rows':[]};var _0x36fde6=_[_0x1e9c('0x29')](db[_0x1e9c('0x2a')][_0x1e9c('0x2b')],function(_0x1e6400){return{'name':_0x1e6400['fieldName'],'type':_0x1e6400[_0x1e9c('0x2c')][_0x1e9c('0x2d')]};});_0x113e44['model']=_[_0x1e9c('0x29')](_0x36fde6,_0x1e9c('0x26'));_0x113e44[_0x1e9c('0x2e')]=_['keys'](_0x3a7dd6[_0x1e9c('0x2e')]);_0x113e44[_0x1e9c('0x2f')]=_['intersection'](_0x113e44[_0x1e9c('0x30')],_0x113e44[_0x1e9c('0x2e')]);_0x47ca94['attributes']=_[_0x1e9c('0x31')](_0x113e44[_0x1e9c('0x30')],qs['fields'](_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x32')]));_0x47ca94[_0x1e9c('0x33')]=_0x47ca94['attributes'][_0x1e9c('0x34')]?_0x47ca94[_0x1e9c('0x33')]:_0x113e44[_0x1e9c('0x30')];if(!_0x3a7dd6['query'][_0x1e9c('0x35')]('nolimit')){_0x47ca94[_0x1e9c('0x1e')]=qs['limit'](_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x1e')]);_0x47ca94['offset']=qs[_0x1e9c('0x1b')](_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x1b')]);}_0x47ca94['order']=qs['sort'](_0x3a7dd6[_0x1e9c('0x2e')]['sort']);_0x47ca94[_0x1e9c('0x36')]=qs[_0x1e9c('0x2f')](_['pick'](_0x3a7dd6[_0x1e9c('0x2e')],_0x113e44[_0x1e9c('0x2f')]),_0x36fde6);if(_0x3a7dd6[_0x1e9c('0x2e')]['filter']){_0x47ca94[_0x1e9c('0x36')]=_[_0x1e9c('0x37')](_0x47ca94['where'],{'$or':_[_0x1e9c('0x29')](_0x36fde6,function(_0x552f67){if(_0x552f67['type']!==_0x1e9c('0x38')){var _0x4339ad={};_0x4339ad[_0x552f67['name']]={'$like':'%'+_0x3a7dd6['query'][_0x1e9c('0x39')]+'%'};return _0x4339ad;}})});}_0x47ca94=_[_0x1e9c('0x37')]({},_0x47ca94,_0x3a7dd6[_0x1e9c('0x3a')]);var _0x2ae38c={'where':_0x47ca94[_0x1e9c('0x36')]};return db[_0x1e9c('0x2a')][_0x1e9c('0x1d')](_0x2ae38c)[_0x1e9c('0x23')](function(_0x39fa25){_0x153431[_0x1e9c('0x1d')]=_0x39fa25;if(_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x3b')]){_0x47ca94[_0x1e9c('0x3c')]=[{'all':!![]}];}return db[_0x1e9c('0x2a')][_0x1e9c('0x3d')](_0x47ca94);})[_0x1e9c('0x23')](function(_0x5024b8){_0x153431[_0x1e9c('0x3e')]=_0x5024b8;return _0x153431;})['then'](respondWithFilteredResult(_0x348676,_0x47ca94))[_0x1e9c('0x3f')](handleError(_0x348676,null));}; \ No newline at end of file +var _0xf063=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','Migration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x1377b1,_0x28662d){var _0x15563d=function(_0x4e40e5){while(--_0x4e40e5){_0x1377b1['push'](_0x1377b1['shift']());}};_0x15563d(++_0x28662d);}(_0xf063,0xc0));var _0x3f06=function(_0x52e2e8,_0x225d79){_0x52e2e8=_0x52e2e8-0x0;var _0x16c7c7=_0xf063[_0x52e2e8];return _0x16c7c7;};'use strict';var emlformat=require(_0x3f06('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f06('0x2'));var moment=require(_0x3f06('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3f06('0x4'));var util=require(_0x3f06('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3f06('0x6'));var ejs=require(_0x3f06('0x7'));var fs=require('fs');var fs_extra=require(_0x3f06('0x8'));var _=require(_0x3f06('0x9'));var squel=require(_0x3f06('0xa'));var crypto=require(_0x3f06('0xb'));var jsforce=require(_0x3f06('0xc'));var deskjs=require(_0x3f06('0xd'));var toCsv=require(_0x3f06('0x6'));var querystring=require(_0x3f06('0xe'));var Papa=require(_0x3f06('0xf'));var Redis=require(_0x3f06('0x10'));var authService=require(_0x3f06('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f06('0x12'));var logger=require(_0x3f06('0x13'))(_0x3f06('0x14'));var utils=require(_0x3f06('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3f06('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x416f96,_0x3618f4){_0x3618f4=_0x3618f4||0xcc;return function(_0x1f072d){if(_0x1f072d){return _0x416f96[_0x3f06('0x17')](_0x3618f4);}return _0x416f96[_0x3f06('0x18')](_0x3618f4)[_0x3f06('0x19')]();};}function respondWithResult(_0x4d1bec,_0x54a5a0){_0x54a5a0=_0x54a5a0||0xc8;return function(_0x47c02f){if(_0x47c02f){return _0x4d1bec[_0x3f06('0x18')](_0x54a5a0)['json'](_0x47c02f);}};}function respondWithFilteredResult(_0x5a9e7c,_0x2f59cb){return function(_0x42c46b){if(_0x42c46b){var _0x5a8b55=typeof _0x2f59cb[_0x3f06('0x1a')]===_0x3f06('0x1b')&&typeof _0x2f59cb['limit']===_0x3f06('0x1b');var _0x4e0941=_0x42c46b['count'];var _0x2315c2=_0x5a8b55?0x0:_0x2f59cb['offset'];var _0x16edef=_0x5a8b55?_0x42c46b[_0x3f06('0x1c')]:_0x2f59cb['offset']+_0x2f59cb[_0x3f06('0x1d')];var _0x9d5dec;if(_0x16edef>=_0x4e0941){_0x16edef=_0x4e0941;_0x9d5dec=0xc8;}else{_0x9d5dec=0xce;}_0x5a9e7c[_0x3f06('0x18')](_0x9d5dec);return _0x5a9e7c[_0x3f06('0x1e')](_0x3f06('0x1f'),_0x2315c2+'-'+_0x16edef+'/'+_0x4e0941)[_0x3f06('0x20')](_0x42c46b);}return null;};}function patchUpdates(_0x3d65af){return function(_0x9e188d){try{jsonpatch[_0x3f06('0x21')](_0x9e188d,_0x3d65af,!![]);}catch(_0x51ff68){return BPromise[_0x3f06('0x22')](_0x51ff68);}return _0x9e188d[_0x3f06('0x23')]();};}function saveUpdates(_0x360605,_0x3e7dc4){return function(_0x3dcffb){if(_0x3dcffb){return _0x3dcffb[_0x3f06('0x24')](_0x360605)[_0x3f06('0x25')](function(_0x3fdba3){return _0x3fdba3;});}return null;};}function removeEntity(_0x1494ac,_0xa457ae){return function(_0x55f3af){if(_0x55f3af){return _0x55f3af[_0x3f06('0x26')]()[_0x3f06('0x25')](function(){_0x1494ac['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35182b,_0x854267){return function(_0xae6b01){if(!_0xae6b01){_0x35182b[_0x3f06('0x17')](0x194);}return _0xae6b01;};}function handleError(_0x1d3276,_0x364eb9){_0x364eb9=_0x364eb9||0x1f4;return function(_0x54d558){logger[_0x3f06('0x27')](_0x54d558[_0x3f06('0x28')]);if(_0x54d558[_0x3f06('0x29')]){delete _0x54d558[_0x3f06('0x29')];}_0x1d3276[_0x3f06('0x18')](_0x364eb9)[_0x3f06('0x2a')](_0x54d558);};}exports['index']=function(_0x4f1e17,_0x283dd3){var _0x4736c6={},_0x17977f={},_0xad96e6={'count':0x0,'rows':[]};var _0x1bfa1a=_[_0x3f06('0x2b')](db[_0x3f06('0x2c')][_0x3f06('0x2d')],function(_0x587a60){return{'name':_0x587a60['fieldName'],'type':_0x587a60[_0x3f06('0x2e')][_0x3f06('0x2f')]};});_0x17977f[_0x3f06('0x30')]=_[_0x3f06('0x2b')](_0x1bfa1a,_0x3f06('0x29'));_0x17977f[_0x3f06('0x31')]=_[_0x3f06('0x32')](_0x4f1e17[_0x3f06('0x31')]);_0x17977f[_0x3f06('0x33')]=_[_0x3f06('0x34')](_0x17977f[_0x3f06('0x30')],_0x17977f['query']);_0x4736c6[_0x3f06('0x35')]=_['intersection'](_0x17977f[_0x3f06('0x30')],qs[_0x3f06('0x36')](_0x4f1e17[_0x3f06('0x31')]['fields']));_0x4736c6[_0x3f06('0x35')]=_0x4736c6[_0x3f06('0x35')]['length']?_0x4736c6[_0x3f06('0x35')]:_0x17977f['model'];if(!_0x4f1e17[_0x3f06('0x31')][_0x3f06('0x37')](_0x3f06('0x38'))){_0x4736c6[_0x3f06('0x1d')]=qs['limit'](_0x4f1e17['query'][_0x3f06('0x1d')]);_0x4736c6[_0x3f06('0x1a')]=qs['offset'](_0x4f1e17[_0x3f06('0x31')][_0x3f06('0x1a')]);}_0x4736c6[_0x3f06('0x39')]=qs[_0x3f06('0x3a')](_0x4f1e17[_0x3f06('0x31')][_0x3f06('0x3a')]);_0x4736c6[_0x3f06('0x3b')]=qs[_0x3f06('0x33')](_[_0x3f06('0x3c')](_0x4f1e17[_0x3f06('0x31')],_0x17977f[_0x3f06('0x33')]),_0x1bfa1a);if(_0x4f1e17[_0x3f06('0x31')][_0x3f06('0x3d')]){_0x4736c6[_0x3f06('0x3b')]=_[_0x3f06('0x3e')](_0x4736c6[_0x3f06('0x3b')],{'$or':_['map'](_0x1bfa1a,function(_0x2f5361){if(_0x2f5361['type']!==_0x3f06('0x3f')){var _0x310f08={};_0x310f08[_0x2f5361[_0x3f06('0x29')]]={'$like':'%'+_0x4f1e17[_0x3f06('0x31')]['filter']+'%'};return _0x310f08;}})});}_0x4736c6=_[_0x3f06('0x3e')]({},_0x4736c6,_0x4f1e17[_0x3f06('0x40')]);var _0x3e78c3={'where':_0x4736c6[_0x3f06('0x3b')]};return db['Migration']['count'](_0x3e78c3)[_0x3f06('0x25')](function(_0x5dedff){_0xad96e6[_0x3f06('0x1c')]=_0x5dedff;if(_0x4f1e17[_0x3f06('0x31')][_0x3f06('0x41')]){_0x4736c6[_0x3f06('0x42')]=[{'all':!![]}];}return db[_0x3f06('0x2c')]['findAll'](_0x4736c6);})['then'](function(_0x4857c9){_0xad96e6[_0x3f06('0x43')]=_0x4857c9;return _0xad96e6;})[_0x3f06('0x25')](respondWithFilteredResult(_0x283dd3,_0x4736c6))[_0x3f06('0x44')](handleError(_0x283dd3,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index c215ad8..31f7ea5 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 _0x2c36=['Migration','migrations','lodash','api','request-promise','path','./migration.attributes','exports','define'];(function(_0x370185,_0x970e53){var _0x542f2c=function(_0x591279){while(--_0x591279){_0x370185['push'](_0x370185['shift']());}};_0x542f2c(++_0x970e53);}(_0x2c36,0x110));var _0x62c3=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x2c36[_0x3c2166];return _0x30ccc3;};'use strict';var _=require(_0x62c3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x62c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x62c3('0x2'));var fs=require('fs');var path=require(_0x62c3('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62c3('0x4'));module[_0x62c3('0x5')]=function(_0x32275e,_0xbddd93){return _0x32275e[_0x62c3('0x6')](_0x62c3('0x7'),attributes,{'tableName':_0x62c3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x823f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','lodash','util'];(function(_0x27f32c,_0x2ca782){var _0x1fd90d=function(_0xa4d510){while(--_0xa4d510){_0x27f32c['push'](_0x27f32c['shift']());}};_0x1fd90d(++_0x2ca782);}(_0x823f,0x9a));var _0xf823=function(_0x50ebc0,_0x143df8){_0x50ebc0=_0x50ebc0-0x0;var _0x173b25=_0x823f[_0x50ebc0];return _0x173b25;};'use strict';var _=require(_0xf823('0x0'));var util=require(_0xf823('0x1'));var logger=require(_0xf823('0x2'))(_0xf823('0x3'));var moment=require(_0xf823('0x4'));var BPromise=require(_0xf823('0x5'));var rp=require(_0xf823('0x6'));var fs=require('fs');var path=require(_0xf823('0x7'));var rimraf=require(_0xf823('0x8'));var config=require(_0xf823('0x9'));var attributes=require(_0xf823('0xa'));module['exports']=function(_0x563434,_0x4e4e3a){return _0x563434[_0xf823('0xb')]('Migration',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 4205e98..d6f061a 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 _0x33a1=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Migration,\x20%s,\x20%s','info','lodash','util'];(function(_0xa17f6d,_0x5e5b27){var _0x446655=function(_0x4f7462){while(--_0x4f7462){_0xa17f6d['push'](_0xa17f6d['shift']());}};_0x446655(++_0x5e5b27);}(_0x33a1,0x7c));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133a('0x2'))['db'];var utils=require(_0x133a('0x3'));var logger=require(_0x133a('0x4'))('rpc');var config=require(_0x133a('0x5'));var jayson=require(_0x133a('0x6'));var client=jayson[_0x133a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13fe1d,_0x1a6b64,_0x31409d){return new BPromise(function(_0x5f3a8f,_0x37e7cc){return client[_0x133a('0x8')](_0x13fe1d,_0x31409d)[_0x133a('0x9')](function(_0x43974a){logger['info']('Migration,\x20%s,\x20%s',_0x1a6b64,'request\x20sent');logger[_0x133a('0xa')](_0x133a('0xb'),_0x1a6b64,_0x133a('0xc'),JSON[_0x133a('0xd')](_0x43974a));if(_0x43974a[_0x133a('0xe')]){if(_0x43974a['error']['code']===0x1f4){logger[_0x133a('0xe')]('Migration,\x20%s,\x20%s',_0x1a6b64,_0x43974a['error'][_0x133a('0xf')]);return _0x37e7cc(_0x43974a[_0x133a('0xe')]['message']);}logger[_0x133a('0xe')](_0x133a('0x10'),_0x1a6b64,_0x43974a[_0x133a('0xe')]['message']);return _0x5f3a8f(_0x43974a['error'][_0x133a('0xf')]);}else{logger[_0x133a('0x11')](_0x133a('0x10'),_0x1a6b64,_0x133a('0xc'));_0x5f3a8f(_0x43974a['result']['message']);}})['catch'](function(_0x2f85f1){logger['error'](_0x133a('0x10'),_0x1a6b64,_0x2f85f1);_0x37e7cc(_0x2f85f1);});});} \ No newline at end of file +var _0x9348=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x39bc06,_0x18d7ff){var _0x131143=function(_0x254f7f){while(--_0x254f7f){_0x39bc06['push'](_0x39bc06['shift']());}};_0x131143(++_0x18d7ff);}(_0x9348,0x10d));var _0x8934=function(_0x531e66,_0x714166){_0x531e66=_0x531e66-0x0;var _0xfb5351=_0x9348[_0x531e66];return _0xfb5351;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('Migration,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 6ec1857..7c0c1ab 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 _0x86be=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','post','create','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2226c1,_0x2bed75){var _0x178716=function(_0x54bb7e){while(--_0x54bb7e){_0x2226c1['push'](_0x2226c1['shift']());}};_0x178716(++_0x2bed75);}(_0x86be,0x176));var _0xe86b=function(_0x509c06,_0x1738f8){_0x509c06=_0x509c06-0x0;var _0x428161=_0x86be[_0x509c06];return _0x428161;};'use strict';var multer=require(_0xe86b('0x0'));var util=require('util');var path=require(_0xe86b('0x1'));var timeout=require(_0xe86b('0x2'));var express=require(_0xe86b('0x3'));var router=express[_0xe86b('0x4')]();var fs_extra=require(_0xe86b('0x5'));var auth=require(_0xe86b('0x6'));var interaction=require(_0xe86b('0x7'));var config=require(_0xe86b('0x8'));var controller=require('./network.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe86b('0x9')]);router[_0xe86b('0xa')](_0xe86b('0xb'),auth[_0xe86b('0xc')](),controller['show']);router[_0xe86b('0xd')]('/',auth[_0xe86b('0xc')](),controller[_0xe86b('0xe')]);router['put'](_0xe86b('0xb'),auth[_0xe86b('0xc')](),controller[_0xe86b('0xf')]);router['delete'](_0xe86b('0xb'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x10')]);module[_0xe86b('0x11')]=router; \ No newline at end of file +var _0xcded=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcded,0x64));var _0xdcde=function(_0x3ecf65,_0x3bac13){_0x3ecf65=_0x3ecf65-0x0;var _0x1907df=_0xcded[_0x3ecf65];return _0x1907df;};'use strict';var multer=require('multer');var util=require(_0xdcde('0x0'));var path=require(_0xdcde('0x1'));var timeout=require('connect-timeout');var express=require(_0xdcde('0x2'));var router=express[_0xdcde('0x3')]();var fs_extra=require(_0xdcde('0x4'));var auth=require(_0xdcde('0x5'));var interaction=require(_0xdcde('0x6'));var config=require(_0xdcde('0x7'));var controller=require(_0xdcde('0x8'));router['get']('/',auth[_0xdcde('0x9')](),controller[_0xdcde('0xa')]);router[_0xdcde('0xb')](_0xdcde('0xc'),auth[_0xdcde('0x9')](),controller[_0xdcde('0xd')]);router[_0xdcde('0xe')]('/',auth[_0xdcde('0x9')](),controller[_0xdcde('0xf')]);router[_0xdcde('0x10')]('/:id',auth[_0xdcde('0x9')](),controller[_0xdcde('0x11')]);router[_0xdcde('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdcde('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index c562d20..1ad93c3 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 _0x8b90=['localnet','externip','stun','STRING','sequelize'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x8b90,0x14e));var _0x08b9=function(_0x346645,_0x3e9d9c){_0x346645=_0x346645-0x0;var _0x32f590=_0x8b90[_0x346645];return _0x32f590;};'use strict';var Sequelize=require(_0x08b9('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x08b9('0x1'),_0x08b9('0x2'),_0x08b9('0x3'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x08b9('0x4')]},'password':{'type':Sequelize[_0x08b9('0x4')]}}; \ No newline at end of file +var _0x712d=['stun','turn','STRING','exports','localnet'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x712d,0x111));var _0xd712=function(_0x12f5b6,_0x5318f1){_0x12f5b6=_0x12f5b6-0x0;var _0x4d1e0a=_0x712d[_0x12f5b6];return _0x4d1e0a;};'use strict';var Sequelize=require('sequelize');module[_0xd712('0x0')]={'type':{'type':Sequelize['ENUM'](_0xd712('0x1'),'externip',_0xd712('0x2'),_0xd712('0x3'))},'value':{'type':Sequelize[_0xd712('0x4')]},'username':{'type':Sequelize[_0xd712('0x4')]},'password':{'type':Sequelize[_0xd712('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 19a8999..8fa8a18 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 _0x4496=['crypto','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','../../mysqldb','jayson/promise','client','http','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','sequelize','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','transaction','find','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel'];(function(_0x1d10e1,_0x3ee51e){var _0x466168=function(_0x4dee57){while(--_0x4dee57){_0x1d10e1['push'](_0x1d10e1['shift']());}};_0x466168(++_0x3ee51e);}(_0x4496,0x142));var _0x6449=function(_0x57981c,_0x1f5cf6){_0x57981c=_0x57981c-0x0;var _0x5e2f75=_0x4496[_0x57981c];return _0x5e2f75;};'use strict';var emlformat=require(_0x6449('0x0'));var rimraf=require(_0x6449('0x1'));var zipdir=require(_0x6449('0x2'));var jsonpatch=require(_0x6449('0x3'));var rp=require(_0x6449('0x4'));var moment=require(_0x6449('0x5'));var BPromise=require(_0x6449('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6449('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6449('0x8'));var _=require(_0x6449('0x9'));var squel=require(_0x6449('0xa'));var crypto=require(_0x6449('0xb'));var jsforce=require(_0x6449('0xc'));var deskjs=require(_0x6449('0xd'));var toCsv=require(_0x6449('0xe'));var querystring=require(_0x6449('0xf'));var Papa=require(_0x6449('0x10'));var Redis=require(_0x6449('0x11'));var authService=require(_0x6449('0x12'));var qs=require(_0x6449('0x13'));var as=require(_0x6449('0x14'));var hardwareService=require(_0x6449('0x15'));var logger=require(_0x6449('0x16'))('api');var utils=require(_0x6449('0x17'));var config=require(_0x6449('0x18'));var licenseUtil=require(_0x6449('0x19'));var db=require(_0x6449('0x1a'))['db'];var jayson=require(_0x6449('0x1b'));var client=jayson[_0x6449('0x1c')][_0x6449('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4b2457,_0x5e8336,_0x469de4,_0xb63213){return new BPromise(function(_0x5a888e,_0x4b8694){var _0xaef06=_0xb63213||client;return _0xaef06['request'](_0x4b2457,_0x469de4)[_0x6449('0x1e')](function(_0x1f9091){logger['info'](_0x6449('0x1f'),_0x5e8336,_0x6449('0x20'));logger['debug'](_0x6449('0x21'),_0x5e8336,_0x6449('0x20'),JSON[_0x6449('0x22')](_0x1f9091));if(_0x1f9091['error']){if(_0x1f9091['error']['code']===0x1f4){logger[_0x6449('0x23')](_0x6449('0x1f'),_0x5e8336,_0x1f9091[_0x6449('0x23')][_0x6449('0x24')]);return _0x4b8694(_0x1f9091['error'][_0x6449('0x24')]);}logger[_0x6449('0x23')]('Network,\x20%s,\x20%s',_0x5e8336,_0x1f9091[_0x6449('0x23')]['message']);return _0x5a888e(_0x1f9091[_0x6449('0x23')]['message']);}else{logger[_0x6449('0x25')](_0x6449('0x1f'),_0x5e8336,_0x6449('0x20'));_0x5a888e(_0x1f9091[_0x6449('0x26')]['message']);}})[_0x6449('0x27')](function(_0x365c55){logger[_0x6449('0x23')](_0x6449('0x1f'),_0x5e8336,_0x365c55);_0x4b8694(_0x365c55);});});}function respondWithStatusCode(_0x18fc81,_0x2f16ae){_0x2f16ae=_0x2f16ae||0xcc;return function(_0x1efa1e){if(_0x1efa1e){return _0x18fc81[_0x6449('0x28')](_0x2f16ae);}return _0x18fc81[_0x6449('0x29')](_0x2f16ae)[_0x6449('0x2a')]();};}function respondWithResult(_0x3c50d5,_0x22113a){_0x22113a=_0x22113a||0xc8;return function(_0x5b459d){if(_0x5b459d){return _0x3c50d5[_0x6449('0x29')](_0x22113a)[_0x6449('0x2b')](_0x5b459d);}};}function respondWithFilteredResult(_0x32e636,_0x5c0a81){return function(_0x216641){if(_0x216641){var _0x1b02cc=typeof _0x5c0a81['offset']===_0x6449('0x2c')&&typeof _0x5c0a81[_0x6449('0x2d')]==='undefined';var _0x15ca12=_0x216641[_0x6449('0x2e')];var _0x281802=_0x1b02cc?0x0:_0x5c0a81[_0x6449('0x2f')];var _0x5aca4a=_0x1b02cc?_0x216641['count']:_0x5c0a81[_0x6449('0x2f')]+_0x5c0a81['limit'];var _0x34a4c;if(_0x5aca4a>=_0x15ca12){_0x5aca4a=_0x15ca12;_0x34a4c=0xc8;}else{_0x34a4c=0xce;}_0x32e636['status'](_0x34a4c);return _0x32e636[_0x6449('0x30')](_0x6449('0x31'),_0x281802+'-'+_0x5aca4a+'/'+_0x15ca12)[_0x6449('0x2b')](_0x216641);}return null;};}function patchUpdates(_0x4d2e0a){return function(_0x4c177a){try{jsonpatch[_0x6449('0x32')](_0x4c177a,_0x4d2e0a,!![]);}catch(_0x589861){return BPromise[_0x6449('0x33')](_0x589861);}return _0x4c177a[_0x6449('0x34')]();};}function saveUpdates(_0x1b9c85,_0xb976ff){return function(_0x3ad67f){if(_0x3ad67f){return _0x3ad67f['update'](_0x1b9c85)['then'](function(_0x35497d){return _0x35497d;});}return null;};}function removeEntity(_0xd468f8,_0x5c7ada){return function(_0x344d9b){if(_0x344d9b){return _0x344d9b[_0x6449('0x35')]()['then'](function(){_0xd468f8[_0x6449('0x29')](0xcc)[_0x6449('0x2a')]();});}};}function handleEntityNotFound(_0x4754e6,_0x5f4ff0){return function(_0x1b44f0){if(!_0x1b44f0){_0x4754e6[_0x6449('0x28')](0x194);}return _0x1b44f0;};}function handleError(_0x279f31,_0x3ae3b2){_0x3ae3b2=_0x3ae3b2||0x1f4;return function(_0x11bf9e){logger[_0x6449('0x23')](_0x11bf9e['stack']);if(_0x11bf9e[_0x6449('0x36')]){delete _0x11bf9e[_0x6449('0x36')];}_0x279f31['status'](_0x3ae3b2)[_0x6449('0x37')](_0x11bf9e);};}exports[_0x6449('0x38')]=function(_0x2ad655,_0xd1f4d8){var _0x39fcd1={},_0x44cd17={},_0x14bd91={'count':0x0,'rows':[]};var _0x2828d5=_[_0x6449('0x39')](db[_0x6449('0x3a')][_0x6449('0x3b')],function(_0x3c6f92){return{'name':_0x3c6f92[_0x6449('0x3c')],'type':_0x3c6f92[_0x6449('0x3d')][_0x6449('0x3e')]};});_0x44cd17[_0x6449('0x3f')]=_[_0x6449('0x39')](_0x2828d5,_0x6449('0x36'));_0x44cd17[_0x6449('0x40')]=_[_0x6449('0x41')](_0x2ad655['query']);_0x44cd17[_0x6449('0x42')]=_['intersection'](_0x44cd17[_0x6449('0x3f')],_0x44cd17[_0x6449('0x40')]);_0x39fcd1[_0x6449('0x43')]=_[_0x6449('0x44')](_0x44cd17[_0x6449('0x3f')],qs[_0x6449('0x45')](_0x2ad655[_0x6449('0x40')][_0x6449('0x45')]));_0x39fcd1[_0x6449('0x43')]=_0x39fcd1['attributes'][_0x6449('0x46')]?_0x39fcd1[_0x6449('0x43')]:_0x44cd17[_0x6449('0x3f')];if(!_0x2ad655[_0x6449('0x40')][_0x6449('0x47')]('nolimit')){_0x39fcd1[_0x6449('0x2d')]=qs['limit'](_0x2ad655[_0x6449('0x40')][_0x6449('0x2d')]);_0x39fcd1[_0x6449('0x2f')]=qs[_0x6449('0x2f')](_0x2ad655[_0x6449('0x40')][_0x6449('0x2f')]);}_0x39fcd1[_0x6449('0x48')]=qs[_0x6449('0x49')](_0x2ad655[_0x6449('0x40')][_0x6449('0x49')]);_0x39fcd1[_0x6449('0x4a')]=qs['filters'](_[_0x6449('0x4b')](_0x2ad655['query'],_0x44cd17['filters']),_0x2828d5);if(_0x2ad655[_0x6449('0x40')][_0x6449('0x4c')]){_0x39fcd1[_0x6449('0x4a')]=_[_0x6449('0x4d')](_0x39fcd1[_0x6449('0x4a')],{'$or':_[_0x6449('0x39')](_0x2828d5,function(_0x2b29d3){if(_0x2b29d3[_0x6449('0x3d')]!=='VIRTUAL'){var _0x1412ad={};_0x1412ad[_0x2b29d3[_0x6449('0x36')]]={'$like':'%'+_0x2ad655[_0x6449('0x40')][_0x6449('0x4c')]+'%'};return _0x1412ad;}})});}_0x39fcd1=_['merge']({},_0x39fcd1,_0x2ad655['options']);var _0x227a5c={'where':_0x39fcd1[_0x6449('0x4a')]};return db[_0x6449('0x3a')][_0x6449('0x2e')](_0x227a5c)[_0x6449('0x1e')](function(_0x7ce320){_0x14bd91[_0x6449('0x2e')]=_0x7ce320;if(_0x2ad655[_0x6449('0x40')][_0x6449('0x4e')]){_0x39fcd1[_0x6449('0x4f')]=[{'all':!![]}];}return db[_0x6449('0x3a')][_0x6449('0x50')](_0x39fcd1);})[_0x6449('0x1e')](function(_0x143318){_0x14bd91[_0x6449('0x51')]=_0x143318;return _0x14bd91;})['then'](respondWithFilteredResult(_0xd1f4d8,_0x39fcd1))[_0x6449('0x27')](handleError(_0xd1f4d8,null));};exports[_0x6449('0x52')]=function(_0x1025e8,_0x572176){var _0x1eeaa5={'raw':!![],'where':{'id':_0x1025e8[_0x6449('0x53')]['id']}},_0x5debf4={};_0x5debf4[_0x6449('0x3f')]=_[_0x6449('0x41')](db[_0x6449('0x3a')][_0x6449('0x3b')]);_0x5debf4['query']=_[_0x6449('0x41')](_0x1025e8[_0x6449('0x40')]);_0x5debf4[_0x6449('0x42')]=_[_0x6449('0x44')](_0x5debf4[_0x6449('0x3f')],_0x5debf4[_0x6449('0x40')]);_0x1eeaa5['attributes']=_[_0x6449('0x44')](_0x5debf4[_0x6449('0x3f')],qs[_0x6449('0x45')](_0x1025e8['query'][_0x6449('0x45')]));_0x1eeaa5[_0x6449('0x43')]=_0x1eeaa5[_0x6449('0x43')][_0x6449('0x46')]?_0x1eeaa5[_0x6449('0x43')]:_0x5debf4['model'];if(_0x1025e8[_0x6449('0x40')][_0x6449('0x4e')]){_0x1eeaa5[_0x6449('0x4f')]=[{'all':!![]}];}_0x1eeaa5=_[_0x6449('0x4d')]({},_0x1eeaa5,_0x1025e8[_0x6449('0x54')]);return db[_0x6449('0x3a')]['find'](_0x1eeaa5)[_0x6449('0x1e')](handleEntityNotFound(_0x572176,null))[_0x6449('0x1e')](respondWithResult(_0x572176,null))['catch'](handleError(_0x572176,null));};exports['create']=function(_0x2c5e94,_0x215e09,_0x25082c){var _0x4a12a4;return db[_0x6449('0x55')]['transaction'](function(_0x367e63){return db['Network'][_0x6449('0x56')](_0x2c5e94[_0x6449('0x57')],{'raw':!![]})[_0x6449('0x1e')](function(_0x241f18){_0x4a12a4=_0x241f18;return db[_0x6449('0x3a')][_0x6449('0x50')]({'where':{'type':_0x2c5e94[_0x6449('0x57')][_0x6449('0x3d')]},'raw':!![]});})[_0x6449('0x1e')](function(_0x5a854f){if(_0x4a12a4[_0x6449('0x3d')]['toUpperCase']()==_0x6449('0x58')){var _0x2146e3=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x5c')),_0x6449('0x5d'));var _0x308f19=ejs[_0x6449('0x5e')](_0x2146e3,{'networks':_0x5a854f||[]});fs[_0x6449('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x308f19);return respondWithRpcPromise(_0x6449('0x60'),'create',{'module':_0x6449('0x61')});}else if(_0x4a12a4['type'][_0x6449('0x62')]()==_0x6449('0x63')){var _0x583d80=fs[_0x6449('0x59')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x421536=ejs[_0x6449('0x5e')](_0x583d80,{'networks':_0x5a854f||[]});fs[_0x6449('0x5f')](_0x6449('0x64'),_0x421536);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x56'),{'module':'res_stun_monitor.so'});}else{var _0x505fd=fs['readFileSync'](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x65')),'utf8');var _0xf22eb1=ejs[_0x6449('0x5e')](_0x505fd,{'networks':_0x5a854f||[]});fs[_0x6449('0x5f')](util[_0x6449('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x2c5e94[_0x6449('0x57')][_0x6449('0x3d')][_0x6449('0x67')]()),_0xf22eb1);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x56'),{'module':_0x6449('0x68')});}return null;})[_0x6449('0x1e')](function(){return _0x4a12a4;});})['then'](respondWithResult(_0x215e09,0xc9))[_0x6449('0x27')](handleError(_0x215e09,null));};exports[_0x6449('0x69')]=function(_0x4cd5c6,_0x361810,_0x2f17af){var _0x473c30;return db[_0x6449('0x55')][_0x6449('0x6a')](function(_0x278715){return db[_0x6449('0x3a')][_0x6449('0x6b')]({'where':{'id':_0x4cd5c6[_0x6449('0x53')]['id']}})[_0x6449('0x1e')](handleEntityNotFound(_0x361810,null))[_0x6449('0x1e')](saveUpdates(_0x4cd5c6[_0x6449('0x57')],null))[_0x6449('0x1e')](function(_0x1f46dd){if(_0x1f46dd){_0x473c30=_0x1f46dd;return db[_0x6449('0x3a')][_0x6449('0x50')]({'where':{'type':_0x473c30[_0x6449('0x3d')]},'raw':!![]});}return null;})[_0x6449('0x1e')](function(_0x427717){if(_0x473c30[_0x6449('0x3d')]['toUpperCase']()==_0x6449('0x58')){var _0x26eead=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x5c')),'utf8');var _0x18e923=ejs['render'](_0x26eead,{'networks':_0x427717||[]});fs[_0x6449('0x5f')](_0x6449('0x6c'),_0x18e923);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x69'),{'module':_0x6449('0x61')});}else if(_0x473c30[_0x6449('0x3d')][_0x6449('0x62')]()==_0x6449('0x63')){var _0x300e22=fs[_0x6449('0x59')](path['join'](config[_0x6449('0x5b')],_0x6449('0x6d')),_0x6449('0x5d'));var _0xf8ad54=ejs[_0x6449('0x5e')](_0x300e22,{'networks':_0x427717||[]});fs[_0x6449('0x5f')](_0x6449('0x64'),_0xf8ad54);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x69'),{'module':_0x6449('0x61')});}else{var _0x378912=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x65')),_0x6449('0x5d'));var _0x4d687f=ejs['render'](_0x378912,{'networks':_0x427717||[]});fs[_0x6449('0x5f')](util['format'](_0x6449('0x6e'),_0x4cd5c6['body'][_0x6449('0x3d')][_0x6449('0x67')]()),_0x4d687f);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x69'),{'module':_0x6449('0x68')});}return null;})[_0x6449('0x1e')](function(_0x3c78f1){if(_0x3c78f1){return _0x473c30;}return null;});})[_0x6449('0x1e')](respondWithResult(_0x361810,null))['catch'](handleError(_0x361810,null));};exports['destroy']=function(_0x4eb897,_0x5281c6,_0x513854){var _0x36376f;return db['Network'][_0x6449('0x6b')]({'where':{'id':_0x4eb897[_0x6449('0x53')]['id']}})[_0x6449('0x1e')](function(_0x492569){_0x36376f=_0x492569;return _0x492569;})['then'](handleEntityNotFound(_0x5281c6,null))[_0x6449('0x1e')](removeEntity(_0x5281c6,null))['then'](function(){if(_0x36376f){return db[_0x6449('0x3a')][_0x6449('0x50')]({'where':{'type':_0x36376f[_0x6449('0x3d')]},'raw':!![]});}})[_0x6449('0x1e')](function(_0x3ea3f6){if(_0x36376f[_0x6449('0x3d')][_0x6449('0x62')]()=='STUN'){var _0xfdddfa=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config['root'],_0x6449('0x5c')),'utf8');var _0x1f3113=ejs[_0x6449('0x5e')](_0xfdddfa,{'networks':_0x3ea3f6||[]});fs[_0x6449('0x5f')](_0x6449('0x6c'),_0x1f3113);return respondWithRpcPromise('Reload','destroy',{'module':_0x6449('0x61')});}else if(_0x36376f[_0x6449('0x3d')][_0x6449('0x62')]()==_0x6449('0x63')){var _0x2cf230=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config['root'],_0x6449('0x6d')),_0x6449('0x5d'));var _0x13ff25=ejs['render'](_0x2cf230,{'networks':_0x3ea3f6||[]});fs[_0x6449('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x13ff25);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x35'),{'module':_0x6449('0x61')});}else{var _0x524302=fs['readFileSync'](path[_0x6449('0x5a')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x32e8a6=ejs[_0x6449('0x5e')](_0x524302,{'networks':_0x3ea3f6||[]});fs[_0x6449('0x5f')](util['format'](_0x6449('0x6e'),_0x4eb897['body'][_0x6449('0x3d')]['toLowerCase']()),_0x32e8a6);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x35'),{'module':_0x6449('0x68')});}return null;})['catch'](handleError(_0x5281c6,null));}; \ No newline at end of file +var _0xb83b=['show','params','includeAll','create','sequelize','transaction','body','findAll','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','root','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','include','Network','rows'];(function(_0x42bb4d,_0x469ef4){var _0x47bdaf=function(_0x43064d){while(--_0x43064d){_0x42bb4d['push'](_0x42bb4d['shift']());}};_0x47bdaf(++_0x469ef4);}(_0xb83b,0x8e));var _0xbb83=function(_0x5c3f46,_0x4e1151){_0x5c3f46=_0x5c3f46-0x0;var _0x4ffbbc=_0xb83b[_0x5c3f46];return _0x4ffbbc;};'use strict';var emlformat=require(_0xbb83('0x0'));var rimraf=require(_0xbb83('0x1'));var zipdir=require(_0xbb83('0x2'));var jsonpatch=require(_0xbb83('0x3'));var rp=require(_0xbb83('0x4'));var moment=require(_0xbb83('0x5'));var BPromise=require(_0xbb83('0x6'));var Mustache=require(_0xbb83('0x7'));var util=require(_0xbb83('0x8'));var path=require(_0xbb83('0x9'));var sox=require(_0xbb83('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb83('0xb'));var _=require(_0xbb83('0xc'));var squel=require('squel');var crypto=require(_0xbb83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbb83('0xe'));var toCsv=require(_0xbb83('0xf'));var querystring=require(_0xbb83('0x10'));var Papa=require(_0xbb83('0x11'));var Redis=require(_0xbb83('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbb83('0x13'));var as=require(_0xbb83('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb83('0x15'))(_0xbb83('0x16'));var utils=require(_0xbb83('0x17'));var config=require(_0xbb83('0x18'));var licenseUtil=require(_0xbb83('0x19'));var db=require(_0xbb83('0x1a'))['db'];var jayson=require(_0xbb83('0x1b'));var client=jayson[_0xbb83('0x1c')][_0xbb83('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x157378,_0x403f50,_0x24c79a,_0x5c7f9a){return new BPromise(function(_0x522956,_0x4435ba){var _0x47a0be=_0x5c7f9a||client;return _0x47a0be[_0xbb83('0x1e')](_0x157378,_0x24c79a)['then'](function(_0x5ba358){logger[_0xbb83('0x1f')](_0xbb83('0x20'),_0x403f50,'request\x20sent');logger[_0xbb83('0x21')]('Network,\x20%s,\x20%s,\x20%s',_0x403f50,_0xbb83('0x22'),JSON['stringify'](_0x5ba358));if(_0x5ba358[_0xbb83('0x23')]){if(_0x5ba358[_0xbb83('0x23')][_0xbb83('0x24')]===0x1f4){logger['error'](_0xbb83('0x20'),_0x403f50,_0x5ba358[_0xbb83('0x23')]['message']);return _0x4435ba(_0x5ba358[_0xbb83('0x23')]['message']);}logger['error'](_0xbb83('0x20'),_0x403f50,_0x5ba358[_0xbb83('0x23')][_0xbb83('0x25')]);return _0x522956(_0x5ba358[_0xbb83('0x23')][_0xbb83('0x25')]);}else{logger[_0xbb83('0x1f')]('Network,\x20%s,\x20%s',_0x403f50,_0xbb83('0x22'));_0x522956(_0x5ba358[_0xbb83('0x26')][_0xbb83('0x25')]);}})[_0xbb83('0x27')](function(_0x2cb037){logger['error'](_0xbb83('0x20'),_0x403f50,_0x2cb037);_0x4435ba(_0x2cb037);});});}function respondWithStatusCode(_0x369831,_0x5f14a3){_0x5f14a3=_0x5f14a3||0xcc;return function(_0x450c4d){if(_0x450c4d){return _0x369831['sendStatus'](_0x5f14a3);}return _0x369831[_0xbb83('0x28')](_0x5f14a3)[_0xbb83('0x29')]();};}function respondWithResult(_0xcdeac6,_0x1086bf){_0x1086bf=_0x1086bf||0xc8;return function(_0x43d98e){if(_0x43d98e){return _0xcdeac6['status'](_0x1086bf)[_0xbb83('0x2a')](_0x43d98e);}};}function respondWithFilteredResult(_0x8b3a90,_0x335e61){return function(_0x26f365){if(_0x26f365){var _0x42550f=typeof _0x335e61[_0xbb83('0x2b')]===_0xbb83('0x2c')&&typeof _0x335e61[_0xbb83('0x2d')]==='undefined';var _0x176fae=_0x26f365[_0xbb83('0x2e')];var _0x167a2e=_0x42550f?0x0:_0x335e61[_0xbb83('0x2b')];var _0x5bae24=_0x42550f?_0x26f365[_0xbb83('0x2e')]:_0x335e61['offset']+_0x335e61['limit'];var _0x37ba8e;if(_0x5bae24>=_0x176fae){_0x5bae24=_0x176fae;_0x37ba8e=0xc8;}else{_0x37ba8e=0xce;}_0x8b3a90[_0xbb83('0x28')](_0x37ba8e);return _0x8b3a90[_0xbb83('0x2f')](_0xbb83('0x30'),_0x167a2e+'-'+_0x5bae24+'/'+_0x176fae)[_0xbb83('0x2a')](_0x26f365);}return null;};}function patchUpdates(_0x15964c){return function(_0x1fe300){try{jsonpatch[_0xbb83('0x31')](_0x1fe300,_0x15964c,!![]);}catch(_0x51f365){return BPromise[_0xbb83('0x32')](_0x51f365);}return _0x1fe300[_0xbb83('0x33')]();};}function saveUpdates(_0x30776e,_0x347942){return function(_0x10f8f5){if(_0x10f8f5){return _0x10f8f5[_0xbb83('0x34')](_0x30776e)[_0xbb83('0x35')](function(_0x2f268d){return _0x2f268d;});}return null;};}function removeEntity(_0x394b3a,_0x523f3b){return function(_0x253401){if(_0x253401){return _0x253401[_0xbb83('0x36')]()[_0xbb83('0x35')](function(){_0x394b3a[_0xbb83('0x28')](0xcc)[_0xbb83('0x29')]();});}};}function handleEntityNotFound(_0x1f31bc,_0x574c7e){return function(_0x207950){if(!_0x207950){_0x1f31bc[_0xbb83('0x37')](0x194);}return _0x207950;};}function handleError(_0x381865,_0x22ebc0){_0x22ebc0=_0x22ebc0||0x1f4;return function(_0x398be4){logger[_0xbb83('0x23')](_0x398be4[_0xbb83('0x38')]);if(_0x398be4[_0xbb83('0x39')]){delete _0x398be4[_0xbb83('0x39')];}_0x381865[_0xbb83('0x28')](_0x22ebc0)[_0xbb83('0x3a')](_0x398be4);};}exports[_0xbb83('0x3b')]=function(_0x18d119,_0x58d32b){var _0x1c232b={},_0x52be7d={},_0x16d3e8={'count':0x0,'rows':[]};var _0x26b2bb=_[_0xbb83('0x3c')](db['Network'][_0xbb83('0x3d')],function(_0x116812){return{'name':_0x116812[_0xbb83('0x3e')],'type':_0x116812['type'][_0xbb83('0x3f')]};});_0x52be7d[_0xbb83('0x40')]=_[_0xbb83('0x3c')](_0x26b2bb,_0xbb83('0x39'));_0x52be7d[_0xbb83('0x41')]=_[_0xbb83('0x42')](_0x18d119[_0xbb83('0x41')]);_0x52be7d[_0xbb83('0x43')]=_['intersection'](_0x52be7d[_0xbb83('0x40')],_0x52be7d[_0xbb83('0x41')]);_0x1c232b[_0xbb83('0x44')]=_[_0xbb83('0x45')](_0x52be7d['model'],qs[_0xbb83('0x46')](_0x18d119[_0xbb83('0x41')][_0xbb83('0x46')]));_0x1c232b[_0xbb83('0x44')]=_0x1c232b[_0xbb83('0x44')][_0xbb83('0x47')]?_0x1c232b['attributes']:_0x52be7d[_0xbb83('0x40')];if(!_0x18d119[_0xbb83('0x41')]['hasOwnProperty'](_0xbb83('0x48'))){_0x1c232b[_0xbb83('0x2d')]=qs['limit'](_0x18d119['query'][_0xbb83('0x2d')]);_0x1c232b['offset']=qs[_0xbb83('0x2b')](_0x18d119[_0xbb83('0x41')]['offset']);}_0x1c232b[_0xbb83('0x49')]=qs[_0xbb83('0x4a')](_0x18d119[_0xbb83('0x41')]['sort']);_0x1c232b['where']=qs[_0xbb83('0x43')](_['pick'](_0x18d119[_0xbb83('0x41')],_0x52be7d[_0xbb83('0x43')]),_0x26b2bb);if(_0x18d119[_0xbb83('0x41')][_0xbb83('0x4b')]){_0x1c232b[_0xbb83('0x4c')]=_[_0xbb83('0x4d')](_0x1c232b[_0xbb83('0x4c')],{'$or':_[_0xbb83('0x3c')](_0x26b2bb,function(_0x2e92bf){if(_0x2e92bf[_0xbb83('0x4e')]!==_0xbb83('0x4f')){var _0x3ab663={};_0x3ab663[_0x2e92bf[_0xbb83('0x39')]]={'$like':'%'+_0x18d119['query'][_0xbb83('0x4b')]+'%'};return _0x3ab663;}})});}_0x1c232b=_[_0xbb83('0x4d')]({},_0x1c232b,_0x18d119[_0xbb83('0x50')]);var _0x3b6ecf={'where':_0x1c232b[_0xbb83('0x4c')]};return db['Network']['count'](_0x3b6ecf)['then'](function(_0x574dfb){_0x16d3e8[_0xbb83('0x2e')]=_0x574dfb;if(_0x18d119[_0xbb83('0x41')]['includeAll']){_0x1c232b[_0xbb83('0x51')]=[{'all':!![]}];}return db[_0xbb83('0x52')]['findAll'](_0x1c232b);})[_0xbb83('0x35')](function(_0x44b5ac){_0x16d3e8[_0xbb83('0x53')]=_0x44b5ac;return _0x16d3e8;})[_0xbb83('0x35')](respondWithFilteredResult(_0x58d32b,_0x1c232b))[_0xbb83('0x27')](handleError(_0x58d32b,null));};exports[_0xbb83('0x54')]=function(_0x17c1cd,_0x4b9d66){var _0x4f8852={'raw':!![],'where':{'id':_0x17c1cd[_0xbb83('0x55')]['id']}},_0x4fbbf1={};_0x4fbbf1[_0xbb83('0x40')]=_[_0xbb83('0x42')](db['Network']['rawAttributes']);_0x4fbbf1[_0xbb83('0x41')]=_['keys'](_0x17c1cd['query']);_0x4fbbf1[_0xbb83('0x43')]=_[_0xbb83('0x45')](_0x4fbbf1[_0xbb83('0x40')],_0x4fbbf1[_0xbb83('0x41')]);_0x4f8852[_0xbb83('0x44')]=_[_0xbb83('0x45')](_0x4fbbf1[_0xbb83('0x40')],qs[_0xbb83('0x46')](_0x17c1cd[_0xbb83('0x41')][_0xbb83('0x46')]));_0x4f8852['attributes']=_0x4f8852[_0xbb83('0x44')][_0xbb83('0x47')]?_0x4f8852[_0xbb83('0x44')]:_0x4fbbf1[_0xbb83('0x40')];if(_0x17c1cd[_0xbb83('0x41')][_0xbb83('0x56')]){_0x4f8852[_0xbb83('0x51')]=[{'all':!![]}];}_0x4f8852=_[_0xbb83('0x4d')]({},_0x4f8852,_0x17c1cd[_0xbb83('0x50')]);return db[_0xbb83('0x52')]['find'](_0x4f8852)[_0xbb83('0x35')](handleEntityNotFound(_0x4b9d66,null))[_0xbb83('0x35')](respondWithResult(_0x4b9d66,null))[_0xbb83('0x27')](handleError(_0x4b9d66,null));};exports[_0xbb83('0x57')]=function(_0x196cc5,_0x308dff,_0x31b63e){var _0x55077f;return db[_0xbb83('0x58')][_0xbb83('0x59')](function(_0x31f8e4){return db[_0xbb83('0x52')][_0xbb83('0x57')](_0x196cc5[_0xbb83('0x5a')],{'raw':!![]})[_0xbb83('0x35')](function(_0x752496){_0x55077f=_0x752496;return db[_0xbb83('0x52')][_0xbb83('0x5b')]({'where':{'type':_0x196cc5[_0xbb83('0x5a')][_0xbb83('0x4e')]},'raw':!![]});})[_0xbb83('0x35')](function(_0x3f4608){if(_0x55077f['type']['toUpperCase']()==_0xbb83('0x5c')){var _0x1a9cdf=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config['root'],_0xbb83('0x5f')),_0xbb83('0x60'));var _0x1849b0=ejs['render'](_0x1a9cdf,{'networks':_0x3f4608||[]});fs[_0xbb83('0x61')]('/etc/asterisk/stun_xcally.conf',_0x1849b0);return respondWithRpcPromise(_0xbb83('0x62'),_0xbb83('0x57'),{'module':_0xbb83('0x63')});}else if(_0x55077f[_0xbb83('0x4e')][_0xbb83('0x64')]()==_0xbb83('0x65')){var _0xfc8763=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config[_0xbb83('0x66')],'server/files/templates/turn_multiple.ejs'),_0xbb83('0x60'));var _0x2d86e=ejs[_0xbb83('0x67')](_0xfc8763,{'networks':_0x3f4608||[]});fs[_0xbb83('0x61')](_0xbb83('0x68'),_0x2d86e);return respondWithRpcPromise(_0xbb83('0x62'),'create',{'module':'res_stun_monitor.so'});}else{var _0x5cd670=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config[_0xbb83('0x66')],_0xbb83('0x69')),_0xbb83('0x60'));var _0x1fc89c=ejs[_0xbb83('0x67')](_0x5cd670,{'networks':_0x3f4608||[]});fs[_0xbb83('0x61')](util[_0xbb83('0x6a')](_0xbb83('0x6b'),_0x196cc5[_0xbb83('0x5a')][_0xbb83('0x4e')][_0xbb83('0x6c')]()),_0x1fc89c);return respondWithRpcPromise(_0xbb83('0x62'),'create',{'module':_0xbb83('0x6d')});}return null;})[_0xbb83('0x35')](function(){return _0x55077f;});})[_0xbb83('0x35')](respondWithResult(_0x308dff,0xc9))[_0xbb83('0x27')](handleError(_0x308dff,null));};exports['update']=function(_0x3e976d,_0x463007,_0x346d1e){var _0xd4f313;return db[_0xbb83('0x58')][_0xbb83('0x59')](function(_0x2bf901){return db['Network'][_0xbb83('0x6e')]({'where':{'id':_0x3e976d[_0xbb83('0x55')]['id']}})['then'](handleEntityNotFound(_0x463007,null))[_0xbb83('0x35')](saveUpdates(_0x3e976d['body'],null))[_0xbb83('0x35')](function(_0x1d6c2e){if(_0x1d6c2e){_0xd4f313=_0x1d6c2e;return db[_0xbb83('0x52')]['findAll']({'where':{'type':_0xd4f313[_0xbb83('0x4e')]},'raw':!![]});}return null;})[_0xbb83('0x35')](function(_0x4c4760){if(_0xd4f313[_0xbb83('0x4e')]['toUpperCase']()==_0xbb83('0x5c')){var _0x2e9b68=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config[_0xbb83('0x66')],_0xbb83('0x5f')),_0xbb83('0x60'));var _0x2c7d63=ejs[_0xbb83('0x67')](_0x2e9b68,{'networks':_0x4c4760||[]});fs[_0xbb83('0x61')](_0xbb83('0x6f'),_0x2c7d63);return respondWithRpcPromise('Reload',_0xbb83('0x34'),{'module':'res_stun_monitor.so'});}else if(_0xd4f313['type']['toUpperCase']()=='TURN'){var _0x1e75f0=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config[_0xbb83('0x66')],_0xbb83('0x70')),_0xbb83('0x60'));var _0x249971=ejs['render'](_0x1e75f0,{'networks':_0x4c4760||[]});fs[_0xbb83('0x61')]('/etc/asterisk/turn_xcally.conf',_0x249971);return respondWithRpcPromise('Reload',_0xbb83('0x34'),{'module':_0xbb83('0x63')});}else{var _0x1eeb09=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config['root'],_0xbb83('0x69')),_0xbb83('0x60'));var _0x232633=ejs['render'](_0x1eeb09,{'networks':_0x4c4760||[]});fs[_0xbb83('0x61')](util['format'](_0xbb83('0x6b'),_0x3e976d[_0xbb83('0x5a')][_0xbb83('0x4e')][_0xbb83('0x6c')]()),_0x232633);return respondWithRpcPromise(_0xbb83('0x62'),_0xbb83('0x34'),{'module':_0xbb83('0x6d')});}return null;})[_0xbb83('0x35')](function(_0x4c75dc){if(_0x4c75dc){return _0xd4f313;}return null;});})[_0xbb83('0x35')](respondWithResult(_0x463007,null))[_0xbb83('0x27')](handleError(_0x463007,null));};exports[_0xbb83('0x36')]=function(_0x45aaae,_0x286b37,_0x33d8de){var _0x3b6320;return db['Network']['find']({'where':{'id':_0x45aaae[_0xbb83('0x55')]['id']}})[_0xbb83('0x35')](function(_0x50d987){_0x3b6320=_0x50d987;return _0x50d987;})[_0xbb83('0x35')](handleEntityNotFound(_0x286b37,null))[_0xbb83('0x35')](removeEntity(_0x286b37,null))[_0xbb83('0x35')](function(){if(_0x3b6320){return db[_0xbb83('0x52')][_0xbb83('0x5b')]({'where':{'type':_0x3b6320[_0xbb83('0x4e')]},'raw':!![]});}})[_0xbb83('0x35')](function(_0x39e6db){if(_0x3b6320['type'][_0xbb83('0x64')]()==_0xbb83('0x5c')){var _0x464b64=fs['readFileSync'](path[_0xbb83('0x5e')](config[_0xbb83('0x66')],_0xbb83('0x5f')),_0xbb83('0x60'));var _0x2ce2b7=ejs[_0xbb83('0x67')](_0x464b64,{'networks':_0x39e6db||[]});fs[_0xbb83('0x61')](_0xbb83('0x6f'),_0x2ce2b7);return respondWithRpcPromise(_0xbb83('0x62'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x3b6320[_0xbb83('0x4e')]['toUpperCase']()==_0xbb83('0x65')){var _0x292517=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config[_0xbb83('0x66')],_0xbb83('0x70')),_0xbb83('0x60'));var _0x1129b1=ejs[_0xbb83('0x67')](_0x292517,{'networks':_0x39e6db||[]});fs['writeFileSync'](_0xbb83('0x68'),_0x1129b1);return respondWithRpcPromise(_0xbb83('0x62'),_0xbb83('0x36'),{'module':_0xbb83('0x63')});}else{var _0x25d37d=fs[_0xbb83('0x5d')](path[_0xbb83('0x5e')](config[_0xbb83('0x66')],'server/files/templates/network.ejs'),_0xbb83('0x60'));var _0x16c8d8=ejs[_0xbb83('0x67')](_0x25d37d,{'networks':_0x39e6db||[]});fs[_0xbb83('0x61')](util['format'](_0xbb83('0x6b'),_0x45aaae['body']['type'][_0xbb83('0x6c')]()),_0x16c8d8);return respondWithRpcPromise(_0xbb83('0x62'),_0xbb83('0x36'),{'module':_0xbb83('0x6d')});}return null;})[_0xbb83('0x27')](handleError(_0x286b37,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index fe289e4..f4a13b4 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 _0xc788=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Network','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc788,0xc4));var _0x8c78=function(_0x55e059,_0x2df2c5){_0x55e059=_0x55e059-0x0;var _0x1e6bb7=_0xc788[_0x55e059];return _0x1e6bb7;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c78('0x3'));var rp=require(_0x8c78('0x4'));var fs=require('fs');var path=require(_0x8c78('0x5'));var rimraf=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var attributes=require('./network.attributes');module[_0x8c78('0x8')]=function(_0x4555da,_0x329152){return _0x4555da[_0x8c78('0x9')](_0x8c78('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96cc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network'];(function(_0xafdb3e,_0x1fb4de){var _0x260d03=function(_0x4cbb4d){while(--_0x4cbb4d){_0xafdb3e['push'](_0xafdb3e['shift']());}};_0x260d03(++_0x1fb4de);}(_0x96cc,0x16c));var _0xc96c=function(_0x1e4d7e,_0x45e3ba){_0x1e4d7e=_0x1e4d7e-0x0;var _0x275eb3=_0x96cc[_0x1e4d7e];return _0x275eb3;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('0xc'),'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 b9db2e0..6646445 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xdb05fb,_0x5ba6ba){var _0x4cbf50=function(_0xeac155){while(--_0xeac155){_0xdb05fb['push'](_0xdb05fb['shift']());}};_0x4cbf50(++_0x5ba6ba);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31b0c7,_0x2622ee){var _0x25a705=function(_0x3bdb36){while(--_0x3bdb36){_0x31b0c7['push'](_0x31b0c7['shift']());}};_0x25a705(++_0x2622ee);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index beebe2f..f8a033a 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 _0x6f77=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','create','post','/:id/dispositions','addDisposition','/:id/canned_answers','notify','addApplications','/:id/users','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports'];(function(_0x12c82b,_0x635cde){var _0x5a6cc9=function(_0x156221){while(--_0x156221){_0x12c82b['push'](_0x12c82b['shift']());}};_0x5a6cc9(++_0x635cde);}(_0x6f77,0xb9));var _0x76f7=function(_0x420c44,_0x11af5b){_0x420c44=_0x420c44-0x0;var _0x138afb=_0x6f77[_0x420c44];return _0x138afb;};'use strict';var multer=require('multer');var util=require(_0x76f7('0x0'));var path=require(_0x76f7('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f7('0x2'));var router=express['Router']();var fs_extra=require(_0x76f7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f7('0x4'));var config=require(_0x76f7('0x5'));var controller=require(_0x76f7('0x6'));router[_0x76f7('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f7('0x8')]);router['get'](_0x76f7('0x9'),auth[_0x76f7('0xa')](),controller[_0x76f7('0xb')]);router[_0x76f7('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x76f7('0x7')]('/:id/dispositions',auth[_0x76f7('0xa')](),controller[_0x76f7('0xc')]);router[_0x76f7('0x7')]('/:id/canned_answers',auth[_0x76f7('0xa')](),controller[_0x76f7('0xd')]);router[_0x76f7('0x7')](_0x76f7('0xe'),auth[_0x76f7('0xa')](),controller[_0x76f7('0xf')]);router[_0x76f7('0x7')](_0x76f7('0x10'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x11')]);router[_0x76f7('0x7')]('/:id/users',auth[_0x76f7('0xa')](),controller[_0x76f7('0x12')]);router['post']('/',auth[_0x76f7('0xa')](),controller[_0x76f7('0x13')]);router[_0x76f7('0x14')](_0x76f7('0x15'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x16')]);router['post'](_0x76f7('0x17'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x76f7('0x14')]('/:id/notify',controller[_0x76f7('0x18')]);router[_0x76f7('0x14')](_0x76f7('0xe'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x19')]);router[_0x76f7('0x14')](_0x76f7('0x1a'),auth[_0x76f7('0xa')](),controller['addAgents']);router[_0x76f7('0x14')](_0x76f7('0x1b'),auth['isAuthenticated'](),controller[_0x76f7('0x1c')]);router[_0x76f7('0x1d')](_0x76f7('0x1e'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x1f')]);router[_0x76f7('0x20')](_0x76f7('0x1e'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x21')]);router[_0x76f7('0x20')](_0x76f7('0x15'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x22')]);router[_0x76f7('0x20')](_0x76f7('0x17'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x76f7('0x1a'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x23')]);module[_0x76f7('0x24')]=router; \ No newline at end of file +var _0x9868=['/:id/users','addAgents','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','getInteractions','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications'];(function(_0x2a24b4,_0x2c69d){var _0x3c569c=function(_0x3ff422){while(--_0x3ff422){_0x2a24b4['push'](_0x2a24b4['shift']());}};_0x3c569c(++_0x2c69d);}(_0x9868,0x12c));var _0x8986=function(_0x48de3f,_0x3bd189){_0x48de3f=_0x48de3f-0x0;var _0x49b168=_0x9868[_0x48de3f];return _0x49b168;};'use strict';var multer=require(_0x8986('0x0'));var util=require('util');var path=require(_0x8986('0x1'));var timeout=require(_0x8986('0x2'));var express=require(_0x8986('0x3'));var router=express[_0x8986('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8986('0x5'));var config=require('../../config/environment');var controller=require(_0x8986('0x6'));router[_0x8986('0x7')]('/',auth[_0x8986('0x8')](),controller[_0x8986('0x9')]);router['get']('/describe',auth[_0x8986('0x8')](),controller[_0x8986('0xa')]);router[_0x8986('0x7')]('/:id',auth[_0x8986('0x8')](),controller['show']);router[_0x8986('0x7')](_0x8986('0xb'),auth['isAuthenticated'](),controller[_0x8986('0xc')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8986('0xd')]);router[_0x8986('0x7')](_0x8986('0xe'),auth['isAuthenticated'](),controller[_0x8986('0xf')]);router[_0x8986('0x7')]('/:id/interactions',auth[_0x8986('0x8')](),controller[_0x8986('0x10')]);router['get']('/:id/users',auth[_0x8986('0x8')](),controller['getAgents']);router[_0x8986('0x11')]('/',auth['isAuthenticated'](),controller[_0x8986('0x12')]);router[_0x8986('0x11')](_0x8986('0xb'),auth['isAuthenticated'](),controller[_0x8986('0x13')]);router[_0x8986('0x11')](_0x8986('0x14'),auth[_0x8986('0x8')](),controller[_0x8986('0x15')]);router['post'](_0x8986('0x16'),controller['notify']);router[_0x8986('0x11')](_0x8986('0xe'),auth[_0x8986('0x8')](),controller[_0x8986('0x17')]);router[_0x8986('0x11')](_0x8986('0x18'),auth['isAuthenticated'](),controller[_0x8986('0x19')]);router[_0x8986('0x11')](_0x8986('0x1a'),auth[_0x8986('0x8')](),controller[_0x8986('0x1b')]);router[_0x8986('0x1c')]('/:id',auth[_0x8986('0x8')](),controller[_0x8986('0x1d')]);router['delete']('/:id',auth[_0x8986('0x8')](),controller[_0x8986('0x1e')]);router[_0x8986('0x1f')](_0x8986('0xb'),auth[_0x8986('0x8')](),controller[_0x8986('0x20')]);router[_0x8986('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8986('0x21')]);router['delete'](_0x8986('0x18'),auth[_0x8986('0x8')](),controller[_0x8986('0x22')]);module[_0x8986('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index d0924cd..2370869 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 _0x0fc0=['sequelize','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x5921c7,_0x4b5384){var _0x6405e9=function(_0x2d39e8){while(--_0x2d39e8){_0x5921c7['push'](_0x5921c7['shift']());}};_0x6405e9(++_0x4b5384);}(_0x0fc0,0x145));var _0x00fc=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x0fc0[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x00fc('0x0'));var rs=require('randomstring');module[_0x00fc('0x1')]={'name':{'type':Sequelize[_0x00fc('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x00fc('0x2')],'defaultValue':function(){return rs[_0x00fc('0x3')]();}},'replyUri':{'type':Sequelize[_0x00fc('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x00fc('0x4')],'defaultValue':function(){return _0x00fc('0x5');}},'notificationSound':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x00fc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x00fc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x00fc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x00fc('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![],'comment':_0x00fc('0x9'),'set':function(_0x5ea463){if(!_0x5ea463)this[_0x00fc('0xa')](_0x00fc('0xb'),null);this[_0x00fc('0xa')](_0x00fc('0xc'),_0x5ea463);}}}; \ No newline at end of file +var _0x7c23=['exports','STRING','name','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x54f09b,_0x55b4cd){var _0x3f5ace=function(_0x83ff27){while(--_0x83ff27){_0x54f09b['push'](_0x54f09b['shift']());}};_0x3f5ace(++_0x55b4cd);}(_0x7c23,0x102));var _0x37c2=function(_0x3338fe,_0x43ca83){_0x3338fe=_0x3338fe-0x0;var _0x1bb7f1=_0x7c23[_0x3338fe];return _0x1bb7f1;};'use strict';var Sequelize=require(_0x37c2('0x0'));var rs=require(_0x37c2('0x1'));module[_0x37c2('0x2')]={'name':{'type':Sequelize[_0x37c2('0x3')],'unique':_0x37c2('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x37c2('0x3')]},'token':{'type':Sequelize[_0x37c2('0x3')],'defaultValue':function(){return rs[_0x37c2('0x5')]();}},'replyUri':{'type':Sequelize[_0x37c2('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x37c2('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x37c2('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x37c2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x37c2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x37c2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x37c2('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x37c2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x37c2('0x6')],'defaultValue':![],'comment':_0x37c2('0x9'),'set':function(_0x82f0a6){if(!_0x82f0a6)this['setDataValue'](_0x37c2('0xa'),null);this[_0x37c2('0xb')](_0x37c2('0xc'),_0x82f0a6);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 4b5cc6f..5241def 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 _0x8623=['startRouting','EventManager','addApplications','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','DESC','out','Messages','dataValues','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','status','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','end','name','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','findOne','Disposition','hasOwnProperty','pick','OpenchannelAccountId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Applications','list','applications','orderBy','priority','account','Contacts','defaults','CmContact','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start'];(function(_0x673ff2,_0x2c53b7){var _0x4b66d8=function(_0x2738cc){while(--_0x2738cc){_0x673ff2['push'](_0x673ff2['shift']());}};_0x4b66d8(++_0x2c53b7);}(_0x8623,0x194));var _0x3862=function(_0x5a9886,_0x24a473){_0x5a9886=_0x5a9886-0x0;var _0x2ff376=_0x8623[_0x5a9886];return _0x2ff376;};'use strict';var emlformat=require(_0x3862('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3862('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3862('0x2'));var BPromise=require(_0x3862('0x3'));var Mustache=require(_0x3862('0x4'));var util=require(_0x3862('0x5'));var path=require(_0x3862('0x6'));var sox=require(_0x3862('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3862('0x8'));var _=require(_0x3862('0x9'));var squel=require(_0x3862('0xa'));var crypto=require(_0x3862('0xb'));var jsforce=require(_0x3862('0xc'));var deskjs=require(_0x3862('0xd'));var toCsv=require(_0x3862('0xe'));var querystring=require(_0x3862('0xf'));var Papa=require('papaparse');var Redis=require(_0x3862('0x10'));var authService=require(_0x3862('0x11'));var qs=require(_0x3862('0x12'));var as=require(_0x3862('0x13'));var hardwareService=require(_0x3862('0x14'));var logger=require(_0x3862('0x15'))(_0x3862('0x16'));var utils=require(_0x3862('0x17'));var config=require(_0x3862('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3862('0x19'))['db'];config[_0x3862('0x1a')]=_['defaults'](config['redis'],{'host':_0x3862('0x1b'),'port':0x18eb});var socket=require(_0x3862('0x1c'))(new Redis(config[_0x3862('0x1a')]));require('./openchannelAccount.socket')[_0x3862('0x1d')](socket);var jayson=require(_0x3862('0x1e'));var client=jayson[_0x3862('0x1f')][_0x3862('0x20')]({'port':0x232c});var client9002=jayson[_0x3862('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x297641,_0x2caca5,_0x114dc0,_0x5f12af){return new BPromise(function(_0x26bd60,_0x296af2){var _0x4ad61f=_0x5f12af||client;return _0x4ad61f['request'](_0x297641,_0x114dc0)['then'](function(_0x3b9ea8){logger['info'](_0x3862('0x21'),_0x2caca5,'request\x20sent');logger['debug'](_0x3862('0x22'),_0x2caca5,_0x3862('0x23'),JSON['stringify'](_0x3b9ea8));if(_0x3b9ea8[_0x3862('0x24')]){if(_0x3b9ea8[_0x3862('0x24')][_0x3862('0x25')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2caca5,_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);return _0x296af2(_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);}logger[_0x3862('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x2caca5,_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);return _0x26bd60(_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);}else{logger[_0x3862('0x27')](_0x3862('0x21'),_0x2caca5,_0x3862('0x23'));_0x26bd60(_0x3b9ea8['result'][_0x3862('0x26')]);}})[_0x3862('0x28')](function(_0x5f5950){logger['error'](_0x3862('0x21'),_0x2caca5,_0x5f5950);_0x296af2(_0x5f5950);});});}function respondWithStatusCode(_0x51fd6a,_0x42950e){_0x42950e=_0x42950e||0xcc;return function(_0x289787){if(_0x289787){return _0x51fd6a['sendStatus'](_0x42950e);}return _0x51fd6a[_0x3862('0x29')](_0x42950e)['end']();};}function respondWithResult(_0x3222c6,_0x223e18){_0x223e18=_0x223e18||0xc8;return function(_0x45183b){if(_0x45183b){return _0x3222c6['status'](_0x223e18)['json'](_0x45183b);}};}function respondWithFilteredResult(_0x274ff4,_0x45870e){return function(_0x4d774a){if(_0x4d774a){var _0x32bddd=typeof _0x45870e[_0x3862('0x2a')]==='undefined'&&typeof _0x45870e[_0x3862('0x2b')]===_0x3862('0x2c');var _0x3ecdf6=_0x4d774a[_0x3862('0x2d')];var _0x510969=_0x32bddd?0x0:_0x45870e[_0x3862('0x2a')];var _0x572062=_0x32bddd?_0x4d774a[_0x3862('0x2d')]:_0x45870e[_0x3862('0x2a')]+_0x45870e[_0x3862('0x2b')];var _0x280db6;if(_0x572062>=_0x3ecdf6){_0x572062=_0x3ecdf6;_0x280db6=0xc8;}else{_0x280db6=0xce;}_0x274ff4['status'](_0x280db6);return _0x274ff4[_0x3862('0x2e')]('Content-Range',_0x510969+'-'+_0x572062+'/'+_0x3ecdf6)['json'](_0x4d774a);}return null;};}function patchUpdates(_0x5aeafc){return function(_0x2c5ba0){try{jsonpatch[_0x3862('0x2f')](_0x2c5ba0,_0x5aeafc,!![]);}catch(_0x594900){return BPromise['reject'](_0x594900);}return _0x2c5ba0[_0x3862('0x30')]();};}function saveUpdates(_0x2f4749,_0xd23a43){return function(_0x432bb4){if(_0x432bb4){return _0x432bb4[_0x3862('0x31')](_0x2f4749)[_0x3862('0x32')](function(_0x4618d7){return _0x4618d7;});}return null;};}function removeEntity(_0x5dc521,_0x284178){return function(_0x3a5735){if(_0x3a5735){return _0x3a5735[_0x3862('0x33')]()[_0x3862('0x32')](function(){var _0x126511=_0x3a5735[_0x3862('0x34')]({'plain':!![]});var _0xccccd2=_0x3862('0x35');return db[_0x3862('0x36')][_0x3862('0x33')]({'where':{'type':_0xccccd2,'resourceId':_0x126511['id']}})[_0x3862('0x32')](function(){return _0x3a5735;});})[_0x3862('0x32')](function(){_0x5dc521[_0x3862('0x29')](0xcc)[_0x3862('0x37')]();});}};}function handleEntityNotFound(_0x472f96,_0x50ba0e){return function(_0x406895){if(!_0x406895){_0x472f96['sendStatus'](0x194);}return _0x406895;};}function handleError(_0xd2bf9a,_0x2ae86a){_0x2ae86a=_0x2ae86a||0x1f4;return function(_0x4e3dd2){logger[_0x3862('0x24')](_0x4e3dd2['stack']);if(_0x4e3dd2[_0x3862('0x38')]){delete _0x4e3dd2[_0x3862('0x38')];}_0xd2bf9a[_0x3862('0x29')](_0x2ae86a)['send'](_0x4e3dd2);};}exports['index']=function(_0x1efadc,_0xc7fff4){var _0x5aad05={'include':[{'model':db[_0x3862('0x39')],'as':_0x3862('0x3a')}]},_0x337183={},_0x33145f={'count':0x0,'rows':[]};var _0x8dd13a=_['map'](db[_0x3862('0x3b')][_0x3862('0x3c')],function(_0x474626){return{'name':_0x474626[_0x3862('0x3d')],'type':_0x474626[_0x3862('0x3e')][_0x3862('0x3f')]};});_0x337183['model']=_[_0x3862('0x40')](_0x8dd13a,'name');_0x337183[_0x3862('0x41')]=_[_0x3862('0x42')](_0x1efadc[_0x3862('0x41')]);_0x337183[_0x3862('0x43')]=_[_0x3862('0x44')](_0x337183['model'],_0x337183['query']);_0x5aad05[_0x3862('0x45')]=_[_0x3862('0x44')](_0x337183[_0x3862('0x46')],qs[_0x3862('0x47')](_0x1efadc[_0x3862('0x41')]['fields']));_0x5aad05[_0x3862('0x45')]=_0x5aad05[_0x3862('0x45')][_0x3862('0x48')]?_0x5aad05[_0x3862('0x45')]:_0x337183[_0x3862('0x46')];if(!_0x1efadc[_0x3862('0x41')]['hasOwnProperty'](_0x3862('0x49'))){_0x5aad05['limit']=qs[_0x3862('0x2b')](_0x1efadc[_0x3862('0x41')][_0x3862('0x2b')]);_0x5aad05[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x1efadc[_0x3862('0x41')]['offset']);}_0x5aad05[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x1efadc[_0x3862('0x41')]['sort']);_0x5aad05[_0x3862('0x4c')]=qs[_0x3862('0x43')](_['pick'](_0x1efadc[_0x3862('0x41')],_0x337183[_0x3862('0x43')]),_0x8dd13a);if(_0x1efadc['query'][_0x3862('0x4d')]){_0x5aad05[_0x3862('0x4c')]=_[_0x3862('0x4e')](_0x5aad05[_0x3862('0x4c')],{'$or':_['map'](_0x8dd13a,function(_0x39555d){if(_0x39555d[_0x3862('0x3e')]!==_0x3862('0x4f')){var _0x20bed9={};_0x20bed9[_0x39555d[_0x3862('0x38')]]={'$like':'%'+_0x1efadc[_0x3862('0x41')]['filter']+'%'};return _0x20bed9;}})});}_0x5aad05=_[_0x3862('0x4e')]({},_0x5aad05,_0x1efadc['options']);var _0x2b1218={'where':_0x5aad05['where']};return db[_0x3862('0x3b')][_0x3862('0x2d')](_0x2b1218)[_0x3862('0x32')](function(_0x1f7ac5){_0x33145f[_0x3862('0x2d')]=_0x1f7ac5;if(_0x1efadc[_0x3862('0x41')][_0x3862('0x50')]){_0x5aad05['include']=[{'all':!![]}];}return db[_0x3862('0x3b')][_0x3862('0x51')](_0x5aad05);})['then'](function(_0x51b3bc){_0x33145f[_0x3862('0x52')]=_0x51b3bc;return _0x33145f;})['then'](respondWithFilteredResult(_0xc7fff4,_0x5aad05))['catch'](handleError(_0xc7fff4,null));};exports[_0x3862('0x53')]=function(_0x26acf5,_0x18b373){var _0x4d5412={'raw':![],'where':{'id':_0x26acf5[_0x3862('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x3862('0x3a')}]},_0x1fe155={};_0x1fe155[_0x3862('0x46')]=_[_0x3862('0x42')](db['OpenchannelAccount']['rawAttributes']);_0x1fe155['query']=_[_0x3862('0x42')](_0x26acf5[_0x3862('0x41')]);_0x1fe155[_0x3862('0x43')]=_['intersection'](_0x1fe155[_0x3862('0x46')],_0x1fe155[_0x3862('0x41')]);_0x4d5412[_0x3862('0x45')]=_[_0x3862('0x44')](_0x1fe155[_0x3862('0x46')],qs[_0x3862('0x47')](_0x26acf5[_0x3862('0x41')][_0x3862('0x47')]));_0x4d5412[_0x3862('0x45')]=_0x4d5412['attributes']['length']?_0x4d5412[_0x3862('0x45')]:_0x1fe155[_0x3862('0x46')];if(_0x26acf5[_0x3862('0x41')][_0x3862('0x50')]){_0x4d5412['include']=[{'all':!![]}];}_0x4d5412=_[_0x3862('0x4e')]({},_0x4d5412,_0x26acf5[_0x3862('0x55')]);return db[_0x3862('0x3b')][_0x3862('0x56')](_0x4d5412)[_0x3862('0x32')](handleEntityNotFound(_0x18b373,null))[_0x3862('0x32')](respondWithResult(_0x18b373,null))[_0x3862('0x28')](handleError(_0x18b373,null));};exports[_0x3862('0x57')]=function(_0x30ad7f,_0x1a3ac0){return db['OpenchannelAccount']['create'](_0x30ad7f['body'],{})[_0x3862('0x32')](function(_0x5c8dc6){var _0x2190ba=_0x30ad7f[_0x3862('0x58')]['get']({'plain':!![]});if(!_0x2190ba)throw new Error(_0x3862('0x59'));if(_0x2190ba[_0x3862('0x5a')]===_0x3862('0x58')){var _0x56647d=_0x5c8dc6[_0x3862('0x34')]({'plain':!![]});var _0x5b7cd6=_0x3862('0x35');return db[_0x3862('0x5b')][_0x3862('0x56')]({'where':{'name':_0x5b7cd6,'userProfileId':_0x2190ba[_0x3862('0x5c')]},'raw':!![]})[_0x3862('0x32')](function(_0x493fc5){if(_0x493fc5&&_0x493fc5['autoAssociation']===0x0){return db[_0x3862('0x36')][_0x3862('0x57')]({'name':_0x56647d[_0x3862('0x38')],'resourceId':_0x56647d['id'],'type':_0x493fc5[_0x3862('0x38')],'sectionId':_0x493fc5['id']},{})[_0x3862('0x32')](function(){return _0x5c8dc6;});}else{return _0x5c8dc6;}})['catch'](function(_0x1a7dd3){logger[_0x3862('0x24')](_0x3862('0x5d'),_0x1a7dd3);throw _0x1a7dd3;});}return _0x5c8dc6;})['then'](respondWithResult(_0x1a3ac0,0xc9))[_0x3862('0x28')](handleError(_0x1a3ac0,null));};exports['update']=function(_0x24792c,_0x5f4682){if(_0x24792c[_0x3862('0x5e')]['id']){delete _0x24792c[_0x3862('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x24792c[_0x3862('0x54')]['id']},'include':[{'model':db[_0x3862('0x39')],'as':_0x3862('0x3a')}]})[_0x3862('0x32')](handleEntityNotFound(_0x5f4682,null))['then'](saveUpdates(_0x24792c[_0x3862('0x5e')],null))[_0x3862('0x32')](respondWithResult(_0x5f4682,null))[_0x3862('0x28')](handleError(_0x5f4682,null));};exports[_0x3862('0x33')]=function(_0x20bcf3,_0x27b177){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x20bcf3[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x27b177,null))['then'](removeEntity(_0x27b177,null))['catch'](handleError(_0x27b177,null));};exports[_0x3862('0x5f')]=function(_0x3c3ed1,_0x2f560a){return db['OpenchannelAccount'][_0x3862('0x5f')]()[_0x3862('0x32')](respondWithResult(_0x2f560a,null))[_0x3862('0x28')](handleError(_0x2f560a,null));};exports[_0x3862('0x60')]=function(_0xbcb6a1,_0x39f778,_0x2305ce){if(_0xbcb6a1[_0x3862('0x5e')]['id']){delete _0xbcb6a1[_0x3862('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0xbcb6a1[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x39f778,null))[_0x3862('0x32')](function(_0x339dd1){if(_0x339dd1){_0xbcb6a1[_0x3862('0x5e')]['OpenchannelAccountId']=_0x339dd1['id'];return db['Disposition']['create'](_0xbcb6a1[_0x3862('0x5e')]);}})[_0x3862('0x32')](respondWithResult(_0x39f778,null))[_0x3862('0x28')](handleError(_0x39f778,null));};exports['getDispositions']=function(_0x3e8355,_0x3d63c3,_0x30654f){var _0x3ae3c4={'raw':![],'where':{}};var _0xeb7298={};var _0x517db0={'count':0x0,'rows':[]};return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x3e8355[_0x3862('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d63c3,null))[_0x3862('0x32')](function(_0x128e73){if(_0x128e73){_0xeb7298[_0x3862('0x46')]=_[_0x3862('0x42')](db[_0x3862('0x62')][_0x3862('0x3c')]);_0xeb7298[_0x3862('0x41')]=_[_0x3862('0x42')](_0x3e8355['query']);_0xeb7298['filters']=_['intersection'](_0xeb7298[_0x3862('0x46')],_0xeb7298[_0x3862('0x41')]);_0x3ae3c4['attributes']=_[_0x3862('0x44')](_0xeb7298[_0x3862('0x46')],qs[_0x3862('0x47')](_0x3e8355['query'][_0x3862('0x47')]));_0x3ae3c4[_0x3862('0x45')]=_0x3ae3c4[_0x3862('0x45')][_0x3862('0x48')]?_0x3ae3c4[_0x3862('0x45')]:_0xeb7298['model'];if(!_0x3e8355[_0x3862('0x41')][_0x3862('0x63')]('nolimit')){_0x3ae3c4[_0x3862('0x2b')]=qs[_0x3862('0x2b')](_0x3e8355[_0x3862('0x41')]['limit']);_0x3ae3c4[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x3e8355[_0x3862('0x41')][_0x3862('0x2a')]);}_0x3ae3c4[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x3e8355[_0x3862('0x41')][_0x3862('0x4b')]);_0x3ae3c4[_0x3862('0x4c')]=qs[_0x3862('0x43')](_[_0x3862('0x64')](_0x3e8355[_0x3862('0x41')],_0xeb7298[_0x3862('0x43')]));_0x3ae3c4[_0x3862('0x4c')][_0x3862('0x65')]=_0x128e73['id'];if(_0x3e8355['query'][_0x3862('0x4d')]){_0x3ae3c4['where']=_[_0x3862('0x4e')](_0x3ae3c4[_0x3862('0x4c')],{'$or':_[_0x3862('0x40')](_0x3ae3c4[_0x3862('0x45')],function(_0x55b831){var _0x2cb43e={};_0x2cb43e[_0x55b831]={'$like':'%'+_0x3e8355['query'][_0x3862('0x4d')]+'%'};return _0x2cb43e;})});}_0x3ae3c4=_[_0x3862('0x4e')]({},_0x3ae3c4,_0x3e8355[_0x3862('0x55')]);return db[_0x3862('0x62')][_0x3862('0x2d')]({'where':_0x3ae3c4[_0x3862('0x4c')]})[_0x3862('0x32')](function(_0x232096){_0x517db0['count']=_0x232096;if(_0x3e8355['query'][_0x3862('0x50')]){_0x3ae3c4[_0x3862('0x66')]=[{'all':!![]}];}return db[_0x3862('0x62')]['findAll'](_0x3ae3c4);})[_0x3862('0x32')](function(_0x38af99){_0x517db0[_0x3862('0x52')]=_0x38af99;return _0x517db0;});}})[_0x3862('0x32')](respondWithFilteredResult(_0x3d63c3,_0x3ae3c4))['catch'](handleError(_0x3d63c3,null));};exports[_0x3862('0x67')]=function(_0xceb6da,_0x1944bc,_0x2246ee){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0xceb6da['params']['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x1944bc,null))[_0x3862('0x32')](function(_0x555e39){if(_0x555e39){return _0x555e39[_0x3862('0x67')](_0xceb6da[_0x3862('0x41')][_0x3862('0x68')]);}})[_0x3862('0x32')](respondWithStatusCode(_0x1944bc,null))['catch'](handleError(_0x1944bc,null));};exports[_0x3862('0x69')]=function(_0x3b5dad,_0x3d3167,_0x16db1d){if(_0x3b5dad[_0x3862('0x5e')]['id']){delete _0x3b5dad[_0x3862('0x5e')]['id'];}return db['OpenchannelAccount'][_0x3862('0x56')]({'where':{'id':_0x3b5dad[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x3d3167,null))[_0x3862('0x32')](function(_0x5d06d1){if(_0x5d06d1){_0x3b5dad[_0x3862('0x5e')]['OpenchannelAccountId']=_0x5d06d1['id'];return db[_0x3862('0x6a')][_0x3862('0x57')](_0x3b5dad[_0x3862('0x5e')]);}})[_0x3862('0x32')](respondWithResult(_0x3d3167,null))['catch'](handleError(_0x3d3167,null));};exports[_0x3862('0x6b')]=function(_0x3c0f32,_0x35ed99,_0xbfa3e3){var _0x2f8eef={'raw':![],'where':{}};var _0x573ae6={};var _0x228f0a={'count':0x0,'rows':[]};return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x3c0f32[_0x3862('0x54')]['id']}})['then'](handleEntityNotFound(_0x35ed99,null))[_0x3862('0x32')](function(_0x5a0727){if(_0x5a0727){_0x573ae6['model']=_[_0x3862('0x42')](db[_0x3862('0x6a')]['rawAttributes']);_0x573ae6[_0x3862('0x41')]=_[_0x3862('0x42')](_0x3c0f32[_0x3862('0x41')]);_0x573ae6[_0x3862('0x43')]=_[_0x3862('0x44')](_0x573ae6[_0x3862('0x46')],_0x573ae6[_0x3862('0x41')]);_0x2f8eef['attributes']=_[_0x3862('0x44')](_0x573ae6[_0x3862('0x46')],qs[_0x3862('0x47')](_0x3c0f32[_0x3862('0x41')][_0x3862('0x47')]));_0x2f8eef[_0x3862('0x45')]=_0x2f8eef[_0x3862('0x45')][_0x3862('0x48')]?_0x2f8eef['attributes']:_0x573ae6[_0x3862('0x46')];if(!_0x3c0f32['query'][_0x3862('0x63')](_0x3862('0x49'))){_0x2f8eef[_0x3862('0x2b')]=qs['limit'](_0x3c0f32[_0x3862('0x41')][_0x3862('0x2b')]);_0x2f8eef[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x3c0f32[_0x3862('0x41')][_0x3862('0x2a')]);}_0x2f8eef[_0x3862('0x4a')]=qs['sort'](_0x3c0f32[_0x3862('0x41')][_0x3862('0x4b')]);_0x2f8eef['where']=qs['filters'](_[_0x3862('0x64')](_0x3c0f32[_0x3862('0x41')],_0x573ae6[_0x3862('0x43')]));_0x2f8eef[_0x3862('0x4c')][_0x3862('0x65')]=_0x5a0727['id'];if(_0x3c0f32[_0x3862('0x41')][_0x3862('0x4d')]){_0x2f8eef[_0x3862('0x4c')]=_[_0x3862('0x4e')](_0x2f8eef[_0x3862('0x4c')],{'$or':_[_0x3862('0x40')](_0x2f8eef[_0x3862('0x45')],function(_0x2be25e){var _0x4e1465={};_0x4e1465[_0x2be25e]={'$like':'%'+_0x3c0f32[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0x4e1465;})});}_0x2f8eef=_[_0x3862('0x4e')]({},_0x2f8eef,_0x3c0f32[_0x3862('0x55')]);return db[_0x3862('0x6a')][_0x3862('0x2d')]({'where':_0x2f8eef[_0x3862('0x4c')]})['then'](function(_0x25a603){_0x228f0a['count']=_0x25a603;if(_0x3c0f32[_0x3862('0x41')][_0x3862('0x50')]){_0x2f8eef[_0x3862('0x66')]=[{'all':!![]}];}return db[_0x3862('0x6a')][_0x3862('0x51')](_0x2f8eef);})[_0x3862('0x32')](function(_0x5bbfc5){_0x228f0a[_0x3862('0x52')]=_0x5bbfc5;return _0x228f0a;});}})[_0x3862('0x32')](respondWithFilteredResult(_0x35ed99,_0x2f8eef))[_0x3862('0x28')](handleError(_0x35ed99,null));};exports[_0x3862('0x6c')]=function(_0x3fc05f,_0x44037d,_0xc90a43){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x3fc05f[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x44037d,null))[_0x3862('0x32')](function(_0x34bb55){if(_0x34bb55){return _0x34bb55[_0x3862('0x6c')](_0x3fc05f[_0x3862('0x41')][_0x3862('0x68')]);}})['then'](respondWithStatusCode(_0x44037d,null))[_0x3862('0x28')](handleError(_0x44037d,null));};exports[_0x3862('0x6d')]=function(_0x406e49,_0x405581,_0x11dac8){var _0x3f5791={'body':_0x406e49[_0x3862('0x5e')],'channel':_0x3862('0x6e')};var _0xf9079b=[];var _0x4a1bd9=[];var _0x1ed21e={};var _0x2dca4f=![];return db['CmContact'][_0x3862('0x5f')]()[_0x3862('0x32')](function(_0x4fb8d4){if(!_0x4fb8d4){throw new db[(_0x3862('0x6f'))][(_0x3862('0x70'))](_0x3862('0x71'));}_0xf9079b=_[_0x3862('0x72')](_[_0x3862('0x42')](_0x4fb8d4),[_0x3862('0x73'),_0x3862('0x74')]);_0x4a1bd9=_[_0x3862('0x72')](_[_0x3862('0x42')](_0x4fb8d4),[_0x3862('0x73'),_0x3862('0x74'),_0x3862('0x75'),_0x3862('0x76')]);if(_0x406e49[_0x3862('0x5e')]['id']){delete _0x406e49[_0x3862('0x5e')]['id'];}if(_[_0x3862('0x77')](_0x406e49[_0x3862('0x5e')][_0x3862('0x78')])){throw new db[(_0x3862('0x6f'))][(_0x3862('0x70'))]('from\x20is\x20mandatory');}if(_[_0x3862('0x77')](_0x406e49[_0x3862('0x5e')][_0x3862('0x5e')])||_0x406e49['body']['body']===''){throw new db['Sequelize'][(_0x3862('0x70'))](_0x3862('0x79'));}if(_[_0x3862('0x77')](_0x406e49[_0x3862('0x5e')]['mapKey'])){throw new db[(_0x3862('0x6f'))][(_0x3862('0x70'))](_0x3862('0x7a')+_0x4a1bd9);}if(!_['includes'](_0x4a1bd9,_0x406e49[_0x3862('0x5e')][_0x3862('0x7b')])){throw new db[(_0x3862('0x6f'))]['ValidationError'](_0x3862('0x7c')+_0x4a1bd9);}_0x1ed21e[_0x406e49[_0x3862('0x5e')][_0x3862('0x7b')]]=_0x406e49[_0x3862('0x5e')][_0x3862('0x78')];})[_0x3862('0x32')](function(){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x406e49[_0x3862('0x54')]['id']},'include':[{'model':db[_0x3862('0x7d')],'as':_0x3862('0x7e'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1ed21e,'limit':0x1,'order':[[_0x3862('0x74'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x3862('0x7f')}]});})[_0x3862('0x32')](handleEntityNotFound(_0x405581,null))['then'](function(_0x55f63b){if(_0x55f63b&&_0x55f63b['List']){_0x3f5791['account']=_0x55f63b;_0x3f5791['applications']=_0x55f63b[_0x3862('0x7f')];_0x3f5791[_0x3862('0x80')]=_0x55f63b['List'];_0x3f5791[_0x3862('0x81')]=_[_0x3862('0x82')](_0x3f5791[_0x3862('0x81')],[_0x3862('0x83')],['asc']);if(_0x3f5791[_0x3862('0x84')][_0x3862('0x7f')]){delete _0x3f5791['account'][_0x3862('0x7f')];}if(_0x3f5791[_0x3862('0x84')]['List']&&_0x3f5791[_0x3862('0x84')][_0x3862('0x7e')][_0x3862('0x85')][_0x3862('0x48')]){return _0x3f5791[_0x3862('0x84')][_0x3862('0x7e')][_0x3862('0x85')][0x0];}var _0x4537a7=_[_0x3862('0x86')](_0x406e49['body'],{'firstName':_0x406e49[_0x3862('0x5e')][_0x3862('0x78')],'ListId':_0x55f63b[_0x3862('0x76')]});_0x4537a7[_0x406e49[_0x3862('0x5e')][_0x3862('0x7b')]]=_0x406e49[_0x3862('0x5e')][_0x3862('0x78')];return db[_0x3862('0x87')]['create'](_0x4537a7,{'fields':_0xf9079b,'raw':!![]});}})[_0x3862('0x32')](handleEntityNotFound(_0x405581,null))[_0x3862('0x32')](function(_0x41880c){_0x3f5791[_0x3862('0x88')]=_0x41880c;if(_0x41880c){var _0x3318ac={'ContactId':_0x41880c['id'],'OpenchannelAccountId':_0x406e49[_0x3862('0x54')]['id'],'from':(_0x41880c['firstName']||'')+'\x20'+(_0x41880c[_0x3862('0x89')]||'')};var _0xd8c3cf={'OpenchannelAccountId':_0x406e49[_0x3862('0x54')]['id'],'closed':![]};if(_0x406e49[_0x3862('0x5e')]['threadId']){_0xd8c3cf['threadId']=_0x406e49[_0x3862('0x5e')][_0x3862('0x8a')];return db['OpenchannelInteraction']['find']({'where':_0xd8c3cf})[_0x3862('0x32')](function(_0x18f136){if(_0x18f136){return[_0x18f136,![]];}_0x3318ac[_0x3862('0x8a')]=_0x406e49[_0x3862('0x5e')][_0x3862('0x8a')];_0x3318ac[_0x3862('0x8b')]=_0x406e49['body'][_0x3862('0x8b')];return db[_0x3862('0x8c')][_0x3862('0x57')](_0x3318ac)[_0x3862('0x32')](function(_0x5473ac){return[_0x5473ac,!![]];});});}else{_0xd8c3cf[_0x3862('0x8a')]=null;}_0xd8c3cf[_0x3862('0x8d')]=_0x41880c['id'];return db[_0x3862('0x8c')][_0x3862('0x56')]({'where':_0xd8c3cf})['then'](function(_0x5d2b0f){if(_0x5d2b0f){return[_0x5d2b0f,![]];}return db[_0x3862('0x8c')]['create'](_0x3318ac)[_0x3862('0x32')](function(_0x1555d4){return[_0x1555d4,!![]];});});}})[_0x3862('0x8e')](function(_0xe55e42,_0x24b528){if(_0xe55e42){_0x2dca4f=_0x24b528;if(!_0x24b528){var _0x58bd63={'from':(_0x3f5791['contact'][_0x3862('0x8f')]||'')+'\x20'+(_0x3f5791['contact'][_0x3862('0x89')]||'')};if(_0x406e49[_0x3862('0x5e')][_0x3862('0x8a')]&&_0x406e49[_0x3862('0x5e')]['messageId']&&_0x406e49['body'][_0x3862('0x8a')]!=_0x406e49[_0x3862('0x5e')][_0x3862('0x90')]){_0x58bd63['threadId']=_0x406e49['body'][_0x3862('0x90')];}return _0xe55e42['update'](_0x58bd63);}else{return _0xe55e42;}}})['then'](function(_0x24a7e5){_0x3f5791[_0x3862('0x91')]=_0x24a7e5[_0x3862('0x34')]({'plain':!![]});_0x3f5791['interaction'][_0x3862('0x92')]=_0x2dca4f;if(_0x3f5791['interaction'][_0x3862('0x92')]){if(_0x3f5791[_0x3862('0x84')][_0x3862('0x93')]){_0x3f5791['applications'][_0x3862('0x94')]({'id':0x0,'priority':_0x3f5791[_0x3862('0x81')][_0x3862('0x48')]+0x1,'app':_0x3862('0x95'),'appdata':_0x3862('0x96'),'interval':'*,*,*,*'});}}return db[_0x3862('0x97')]['create']({'body':_0x406e49['body']['body'],'OpenchannelAccountId':_0x406e49['params']['id'],'OpenchannelInteractionId':_0x24a7e5['id'],'direction':'in','ContactId':_0x3f5791[_0x3862('0x88')]['id'],'AttachmentId':_0x406e49[_0x3862('0x5e')]['AttachmentId']});})[_0x3862('0x32')](function(_0x5e0e87){_0x3f5791[_0x3862('0x26')]=_0x5e0e87;if(_0x3f5791[_0x3862('0x91')][_0x3862('0x98')]){return db[_0x3862('0x99')][_0x3862('0x56')]({'attributes':['id',_0x3862('0x38')],'where':{'id':_0x3f5791[_0x3862('0x91')][_0x3862('0x98')]}})[_0x3862('0x32')](function(_0x5f579c){if(_0x5f579c){_0x3f5791['applications'][_0x3862('0x9a')]({'id':0x0,'priority':0x0,'app':_0x3862('0x9b'),'appdata':_0x5f579c[_0x3862('0x38')]+','+(_0x3f5791[_0x3862('0x84')][_0x3862('0x9c')]||0xa),'interval':_0x3862('0x9d')});_0x3f5791[_0x3862('0x9e')]=![];}return respondWithRpcPromise(_0x3862('0x9f'),_0x3862('0xa0'),_0x3f5791);});}return respondWithRpcPromise(_0x3862('0x9f'),_0x3862('0xa0'),_0x3f5791);})[_0x3862('0x32')](function(_0x51ee4d){respondWithRpcPromise(_0x3862('0xa1'),_0x3862('0xa1'),{'event':_0x3862('0x6d'),'message':_0x51ee4d},client9002);return _0x51ee4d;})['then'](respondWithResult(_0x405581,null))['catch'](handleError(_0x405581,null));};exports[_0x3862('0xa2')]=function(_0x4d3428,_0x708c04,_0x36e3b9){return db[_0x3862('0x3b')]['findOne']({'where':{'id':_0x4d3428['params']['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x708c04,null))[_0x3862('0x32')](function(_0x5b4cd2){if(_0x5b4cd2){return db['sequelize'][_0x3862('0xa3')](function(_0x4eb691){return db['OpenchannelApplication'][_0x3862('0x33')]({'where':{'OpenchannelAccountId':_0x4d3428[_0x3862('0x54')]['id']},'transaction':_0x4eb691})[_0x3862('0x32')](function(_0x539b2d){var _0x4ad755=_[_0x3862('0x40')](_0x4d3428[_0x3862('0x5e')],function(_0x322121){_0x322121[_0x3862('0x65')]=_0x4d3428['params']['id'];return _0x322121;});return db[_0x3862('0xa4')][_0x3862('0xa5')](_0x4ad755,{'transaction':_0x4eb691});});})[_0x3862('0x32')](function(){return db['OpenchannelApplication'][_0x3862('0xa6')]({'where':{'OpenchannelAccountId':_0x4d3428[_0x3862('0x54')]['id']},'order':_0x3862('0x83')});});}})[_0x3862('0x32')](respondWithResult(_0x708c04,null))[_0x3862('0x28')](handleError(_0x708c04,null));};exports['getApplications']=function(_0x2521bf,_0x5c4ce2,_0x4a4007){var _0x55b43f={};var _0x352e06={};var _0x12691f;var _0x41e14c;return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x2521bf[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x5c4ce2,null))['then'](function(_0x2d00ad){if(_0x2d00ad){_0x12691f=_0x2d00ad;_0x352e06['model']=_[_0x3862('0x42')](db[_0x3862('0xa4')]['rawAttributes']);_0x352e06[_0x3862('0x41')]=_[_0x3862('0x42')](_0x2521bf[_0x3862('0x41')]);_0x352e06[_0x3862('0x43')]=_[_0x3862('0x44')](_0x352e06[_0x3862('0x46')],_0x352e06[_0x3862('0x41')]);_0x55b43f[_0x3862('0x45')]=_['intersection'](_0x352e06[_0x3862('0x46')],qs[_0x3862('0x47')](_0x2521bf[_0x3862('0x41')][_0x3862('0x47')]));_0x55b43f['attributes']=_0x55b43f[_0x3862('0x45')][_0x3862('0x48')]?_0x55b43f['attributes']:_0x352e06[_0x3862('0x46')];_0x55b43f[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x2521bf[_0x3862('0x41')]['sort']);_0x55b43f[_0x3862('0x4c')]=qs[_0x3862('0x43')](_[_0x3862('0x64')](_0x2521bf[_0x3862('0x41')],_0x352e06['filters']));if(_0x2521bf[_0x3862('0x41')][_0x3862('0x4d')]){_0x55b43f['where']=_['merge'](_0x55b43f['where'],{'$or':_[_0x3862('0x40')](_0x55b43f[_0x3862('0x45')],function(_0x13d8b5){var _0xf0ef9e={};_0xf0ef9e[_0x13d8b5]={'$like':'%'+_0x2521bf[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0xf0ef9e;})});}_0x55b43f=_[_0x3862('0x4e')]({},_0x55b43f,_0x2521bf[_0x3862('0x55')]);return _0x12691f['getApplications'](_0x55b43f);}})[_0x3862('0x32')](function(_0x2b2386){if(_0x2b2386){_0x41e14c=_0x2b2386['length'];if(!_0x2521bf[_0x3862('0x41')][_0x3862('0x63')](_0x3862('0x49'))){_0x55b43f[_0x3862('0x2b')]=qs[_0x3862('0x2b')](_0x2521bf[_0x3862('0x41')][_0x3862('0x2b')]);_0x55b43f[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x2521bf[_0x3862('0x41')]['offset']);}return _0x12691f[_0x3862('0xa7')](_0x55b43f);}})[_0x3862('0x32')](function(_0x525da2){if(_0x525da2){return _0x525da2?{'count':_0x41e14c,'rows':_0x525da2}:null;}})['then'](respondWithResult(_0x5c4ce2,null))[_0x3862('0x28')](handleError(_0x5c4ce2,null));};exports['getInteractions']=function(_0x3bd308,_0x3ed6f4,_0x2d234d){var _0x319c7a={'raw':![],'where':{}};var _0x485d11={};var _0x4ceb41={'count':0x0,'rows':[]};return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x3bd308[_0x3862('0x54')]['id']}})['then'](handleEntityNotFound(_0x3ed6f4,null))[_0x3862('0x32')](function(_0x1b494d){if(_0x1b494d){_0x485d11['model']=_[_0x3862('0x42')](db['OpenchannelInteraction'][_0x3862('0x3c')]);_0x485d11[_0x3862('0x41')]=_['keys'](_0x3bd308[_0x3862('0x41')]);_0x485d11['filters']=_[_0x3862('0x44')](_0x485d11[_0x3862('0x46')],_0x485d11[_0x3862('0x41')]);_0x319c7a[_0x3862('0x45')]=_[_0x3862('0x44')](_0x485d11[_0x3862('0x46')],qs[_0x3862('0x47')](_0x3bd308[_0x3862('0x41')]['fields']));_0x319c7a[_0x3862('0x45')]=_0x319c7a[_0x3862('0x45')][_0x3862('0x48')]?_0x319c7a[_0x3862('0x45')]:_0x485d11[_0x3862('0x46')];if(!_0x3bd308[_0x3862('0x41')][_0x3862('0x63')]('nolimit')){_0x319c7a[_0x3862('0x2b')]=qs[_0x3862('0x2b')](_0x3bd308[_0x3862('0x41')][_0x3862('0x2b')]);_0x319c7a[_0x3862('0x2a')]=qs['offset'](_0x3bd308[_0x3862('0x41')][_0x3862('0x2a')]);}_0x319c7a[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x3bd308['query']['sort']);_0x319c7a[_0x3862('0x4c')]=qs['filters'](_[_0x3862('0x64')](_0x3bd308[_0x3862('0x41')],_0x485d11[_0x3862('0x43')]));_0x319c7a[_0x3862('0x4c')][_0x3862('0x65')]=_0x1b494d['id'];if(_0x3bd308[_0x3862('0x41')]['filter']){_0x319c7a[_0x3862('0x4c')]=_['merge'](_0x319c7a[_0x3862('0x4c')],{'$or':_['map'](_0x319c7a[_0x3862('0x45')],function(_0x66ea26){var _0x15ba04={};_0x15ba04[_0x66ea26]={'$like':'%'+_0x3bd308[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0x15ba04;})});}_0x319c7a=_[_0x3862('0x4e')]({},_0x319c7a,_0x3bd308[_0x3862('0x55')]);return db[_0x3862('0x8c')]['count']({'where':_0x319c7a[_0x3862('0x4c')]})[_0x3862('0x32')](function(_0x2b2260){_0x4ceb41[_0x3862('0x2d')]=_0x2b2260;if(_0x3bd308[_0x3862('0x41')][_0x3862('0x50')]){_0x319c7a[_0x3862('0x66')]=[{'model':db['CmContact'],'as':_0x3862('0xa8'),'required':![]},{'model':db[_0x3862('0x99')],'as':'Owner','attributes':['name',_0x3862('0xa9'),_0x3862('0xaa')],'required':![]},{'model':db[_0x3862('0xab')],'as':_0x3862('0xac'),'attributes':['id',_0x3862('0x38'),_0x3862('0xad')],'where':_0x3bd308[_0x3862('0x41')][_0x3862('0xae')]?{'id':_0x3bd308['query'][_0x3862('0xae')]}:undefined,'required':_0x3bd308[_0x3862('0x41')][_0x3862('0xae')]?!![]:![]}];}return db[_0x3862('0x8c')][_0x3862('0x51')](_0x319c7a);})[_0x3862('0x32')](function(_0xdbd944){_0x4ceb41[_0x3862('0x52')]=_0xdbd944;return _0x4ceb41;});}})['then'](respondWithFilteredResult(_0x3ed6f4,_0x319c7a))[_0x3862('0x28')](handleError(_0x3ed6f4,null));};exports['addAgents']=function(_0x1dfefc,_0x200510,_0x117d8a){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x1dfefc[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x200510,null))[_0x3862('0x32')](function(_0x45471c){if(_0x45471c){return _0x45471c[_0x3862('0xaf')](_0x1dfefc[_0x3862('0x5e')]['ids'],_[_0x3862('0xb0')](_0x1dfefc[_0x3862('0x5e')],[_0x3862('0x68'),'id'])||{})[_0x3862('0x8e')](function(_0x59ca78){for(var _0x449db3=0x0;_0x449db3<_0x1dfefc['body'][_0x3862('0x68')][_0x3862('0x48')];_0x449db3+=0x1){socket[_0x3862('0xb1')](_0x3862('0xb2'),{'UserId':_0x1dfefc[_0x3862('0x5e')]['ids'][_0x449db3],'OpenchannelAccountId':_0x1dfefc[_0x3862('0x54')]['id']});}return _0x59ca78;});}})[_0x3862('0x32')](respondWithResult(_0x200510,null))['catch'](handleError(_0x200510,null));};exports['removeAgents']=function(_0x5e6904,_0xb9c75e,_0x4bd0a5){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x5e6904[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0xb9c75e,null))[_0x3862('0x32')](function(_0x456c26){if(_0x456c26){return _0x456c26[_0x3862('0xb3')](_0x5e6904[_0x3862('0x41')]['ids'])[_0x3862('0x32')](function(){if(_[_0x3862('0xb4')](_0x5e6904[_0x3862('0x41')][_0x3862('0x68')])){for(var _0x2f408a=0x0;_0x2f408a<_0x5e6904['query'][_0x3862('0x68')][_0x3862('0x48')];_0x2f408a+=0x1){socket[_0x3862('0xb1')](_0x3862('0xb5'),{'UserId':Number(_0x5e6904[_0x3862('0x41')][_0x3862('0x68')][_0x2f408a]),'OpenchannelAccountId':Number(_0x5e6904[_0x3862('0x54')]['id'])});}}else{socket[_0x3862('0xb1')](_0x3862('0xb5'),{'UserId':Number(_0x5e6904['query'][_0x3862('0x68')]),'OpenchannelAccountId':Number(_0x5e6904[_0x3862('0x54')]['id'])});}});}})[_0x3862('0x32')](respondWithStatusCode(_0xb9c75e,null))['catch'](handleError(_0xb9c75e,null));};exports[_0x3862('0xb6')]=function(_0x1f6409,_0x362911,_0x17ae07){var _0x1d44a5={};var _0x2f6676={};var _0x4a1325;var _0x1a06b1;return db[_0x3862('0x3b')]['findOne']({'where':{'id':_0x1f6409[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x362911,null))[_0x3862('0x32')](function(_0x18f55e){if(_0x18f55e){_0x4a1325=_0x18f55e;_0x2f6676['model']=_[_0x3862('0x42')](db[_0x3862('0x99')][_0x3862('0x3c')]);_0x2f6676['query']=_['keys'](_0x1f6409[_0x3862('0x41')]);_0x2f6676[_0x3862('0x43')]=_[_0x3862('0x44')](_0x2f6676[_0x3862('0x46')],_0x2f6676[_0x3862('0x41')]);_0x1d44a5[_0x3862('0x45')]=_[_0x3862('0x44')](_0x2f6676[_0x3862('0x46')],qs[_0x3862('0x47')](_0x1f6409[_0x3862('0x41')]['fields']));_0x1d44a5[_0x3862('0x45')]=_0x1d44a5[_0x3862('0x45')]['length']?_0x1d44a5[_0x3862('0x45')]:_0x2f6676['model'];_0x1d44a5[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x1f6409[_0x3862('0x41')][_0x3862('0x4b')]);_0x1d44a5[_0x3862('0x4c')]=qs[_0x3862('0x43')](_[_0x3862('0x64')](_0x1f6409[_0x3862('0x41')],_0x2f6676[_0x3862('0x43')]));if(_0x1f6409[_0x3862('0x41')][_0x3862('0x4d')]){_0x1d44a5[_0x3862('0x4c')]=_['merge'](_0x1d44a5['where'],{'$or':_['map'](_0x1d44a5['attributes'],function(_0x550d82){var _0x4665fd={};_0x4665fd[_0x550d82]={'$like':'%'+_0x1f6409[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0x4665fd;})});}_0x1d44a5=_[_0x3862('0x4e')]({},_0x1d44a5,_0x1f6409[_0x3862('0x55')]);return _0x4a1325[_0x3862('0xb6')](_0x1d44a5);}})[_0x3862('0x32')](function(_0x522800){if(_0x522800){_0x1a06b1=_0x522800[_0x3862('0x48')];if(!_0x1f6409[_0x3862('0x41')]['hasOwnProperty'](_0x3862('0x49'))){_0x1d44a5[_0x3862('0x2b')]=qs['limit'](_0x1f6409['query'][_0x3862('0x2b')]);_0x1d44a5[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x1f6409[_0x3862('0x41')][_0x3862('0x2a')]);}return _0x4a1325[_0x3862('0xb6')](_0x1d44a5);}})[_0x3862('0x32')](function(_0x28d6af){if(_0x28d6af){return _0x28d6af?{'count':_0x1a06b1,'rows':_0x28d6af}:null;}})['then'](respondWithResult(_0x362911,null))[_0x3862('0x28')](handleError(_0x362911,null));};exports[_0x3862('0xb7')]=function(_0x23e4e2,_0x386b45,_0x3fa0bc){var _0x4d9e80,_0xd1e796,_0x1360cf;if(_['isNil'](_0x23e4e2[_0x3862('0x5e')][_0x3862('0x5e')])||_0x23e4e2[_0x3862('0x5e')]['body']===''){throw new db[(_0x3862('0x6f'))]['ValidationError'](_0x3862('0x79'));}if(_['isNil'](_0x23e4e2[_0x3862('0x5e')]['to'])){}_0x4d9e80=_0x23e4e2['body']['to'];return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x23e4e2['params']['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x386b45,null))['then'](function(_0x4ad185){if(_0x4ad185){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x4ad185['id']},'include':[{'model':db[_0x3862('0x7d')],'as':_0x3862('0x7e'),'include':[{'model':db[_0x3862('0x87')],'as':_0x3862('0x85'),'where':{[_0x4ad185[_0x3862('0x7b')]]:_0x4d9e80},'limit':0x1,'order':[['updatedAt',_0x3862('0xb8')]]}]}]})[_0x3862('0x32')](handleEntityNotFound(_0x386b45,null))['then'](function(_0x17a513){if(_0x17a513&&_0x17a513[_0x3862('0x7e')]){_0xd1e796=_0x17a513[_0x3862('0x34')]({'plain':!![]});if(_0xd1e796['List']&&_0xd1e796[_0x3862('0x7e')]['Contacts'][_0x3862('0x48')]){return _0xd1e796['List'][_0x3862('0x85')][0x0];}return db[_0x3862('0x87')][_0x3862('0x57')](_[_0x3862('0x86')](_0x23e4e2['body'],{'firstName':_0x4d9e80,[_0x17a513[_0x3862('0x7b')]]:_0x4d9e80,'phone':_0x4d9e80,'ListId':_0xd1e796[_0x3862('0x76')]}));}})[_0x3862('0x32')](handleEntityNotFound(_0x386b45,null))[_0x3862('0x32')](function(_0x354991){if(_0x354991){_0x1360cf=_0x354991;return db[_0x3862('0x8c')][_0x3862('0x56')]({'where':{'ContactId':_0x1360cf['id'],'closed':![],'OpenchannelAccountId':_0xd1e796['id']}})['then'](function(_0x4e856a){if(_0x4e856a){return[_0x4e856a,![]];}return db['OpenchannelInteraction'][_0x3862('0x57')]({'UserId':_0x23e4e2[_0x3862('0x58')]['id'],'ContactId':_0x1360cf['id'],'OpenchannelAccountId':_0xd1e796['id'],'lastMsgDirection':_0x3862('0xb9'),'Messages':[_[_0x3862('0x4e')](_0x23e4e2[_0x3862('0x5e')],{'read':![],'body':_0x23e4e2[_0x3862('0x5e')]['body'],'OpenchannelAccountId':_0xd1e796['id'],'UserId':_0x23e4e2[_0x3862('0x58')]['id'],'ContactId':_0x1360cf['id']})]},{'include':[{'model':db[_0x3862('0x97')],'as':_0x3862('0xba')}]})[_0x3862('0x32')](function(_0x28cc2c){return[_0x28cc2c,!![]];});});}})[_0x3862('0x8e')](function(_0x5d2cba,_0x38ef82){if(_0x38ef82){return _0x5d2cba;}return db[_0x3862('0x97')][_0x3862('0x57')](_[_0x3862('0x4e')](_0x23e4e2[_0x3862('0x5e')],{'read':![],'body':_0x23e4e2[_0x3862('0x5e')]['body'],'OpenchannelAccountId':_0xd1e796['id'],'OpenchannelInteractionId':_0x5d2cba['id'],'UserId':_0x23e4e2[_0x3862('0x58')]['id'],'ContactId':_0x1360cf['id']}))[_0x3862('0x32')](function(_0xf4d59f){_0x5d2cba[_0x3862('0xbb')]['Messages']=[];_0x5d2cba['dataValues'][_0x3862('0xba')][_0x3862('0x94')](_0xf4d59f[_0x3862('0xbb')]);return _0x5d2cba;});});}})[_0x3862('0x32')](respondWithResult(_0x386b45,null))['catch'](handleError(_0x386b45,null));}; \ No newline at end of file +var _0x108f=['Messages','dataValues','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','request\x20sent','result','catch','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','show','params','rawAttributes','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','Disposition','OpenchannelAccountId','rows','ids','addAnswer','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage'];(function(_0x1e3e2d,_0x290be3){var _0x51dc08=function(_0x340881){while(--_0x340881){_0x1e3e2d['push'](_0x1e3e2d['shift']());}};_0x51dc08(++_0x290be3);}(_0x108f,0xbe));var _0xf108=function(_0x2b5efa,_0xd4953a){_0x2b5efa=_0x2b5efa-0x0;var _0x962ff6=_0x108f[_0x2b5efa];return _0x962ff6;};'use strict';var emlformat=require(_0xf108('0x0'));var rimraf=require(_0xf108('0x1'));var zipdir=require(_0xf108('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf108('0x3'));var BPromise=require(_0xf108('0x4'));var Mustache=require('mustache');var util=require(_0xf108('0x5'));var path=require('path');var sox=require(_0xf108('0x6'));var csv=require(_0xf108('0x7'));var ejs=require(_0xf108('0x8'));var fs=require('fs');var fs_extra=require(_0xf108('0x9'));var _=require('lodash');var squel=require(_0xf108('0xa'));var crypto=require(_0xf108('0xb'));var jsforce=require(_0xf108('0xc'));var deskjs=require(_0xf108('0xd'));var toCsv=require(_0xf108('0x7'));var querystring=require('querystring');var Papa=require(_0xf108('0xe'));var Redis=require(_0xf108('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf108('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf108('0x11'));var utils=require(_0xf108('0x12'));var config=require(_0xf108('0x13'));var licenseUtil=require(_0xf108('0x14'));var db=require(_0xf108('0x15'))['db'];config[_0xf108('0x16')]=_[_0xf108('0x17')](config[_0xf108('0x16')],{'host':_0xf108('0x18'),'port':0x18eb});var socket=require(_0xf108('0x19'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xf108('0x1a'));var client=jayson[_0xf108('0x1b')][_0xf108('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xf108('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4e7827,_0x1d3582,_0x217517,_0x2e30aa){return new BPromise(function(_0x1abaf7,_0x3846d8){var _0x50925b=_0x2e30aa||client;return _0x50925b[_0xf108('0x1d')](_0x4e7827,_0x217517)[_0xf108('0x1e')](function(_0x5ca92a){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1d3582,'request\x20sent');logger[_0xf108('0x1f')](_0xf108('0x20'),_0x1d3582,'request\x20sent',JSON[_0xf108('0x21')](_0x5ca92a));if(_0x5ca92a[_0xf108('0x22')]){if(_0x5ca92a[_0xf108('0x22')][_0xf108('0x23')]===0x1f4){logger[_0xf108('0x22')](_0xf108('0x24'),_0x1d3582,_0x5ca92a[_0xf108('0x22')][_0xf108('0x25')]);return _0x3846d8(_0x5ca92a[_0xf108('0x22')][_0xf108('0x25')]);}logger[_0xf108('0x22')](_0xf108('0x24'),_0x1d3582,_0x5ca92a[_0xf108('0x22')][_0xf108('0x25')]);return _0x1abaf7(_0x5ca92a['error']['message']);}else{logger[_0xf108('0x26')](_0xf108('0x24'),_0x1d3582,_0xf108('0x27'));_0x1abaf7(_0x5ca92a[_0xf108('0x28')][_0xf108('0x25')]);}})[_0xf108('0x29')](function(_0x2f663e){logger[_0xf108('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x1d3582,_0x2f663e);_0x3846d8(_0x2f663e);});});}function respondWithStatusCode(_0x2c73b1,_0x1ed123){_0x1ed123=_0x1ed123||0xcc;return function(_0x344223){if(_0x344223){return _0x2c73b1['sendStatus'](_0x1ed123);}return _0x2c73b1[_0xf108('0x2a')](_0x1ed123)[_0xf108('0x2b')]();};}function respondWithResult(_0x46a2ac,_0x2ccb2d){_0x2ccb2d=_0x2ccb2d||0xc8;return function(_0x1607a0){if(_0x1607a0){return _0x46a2ac[_0xf108('0x2a')](_0x2ccb2d)[_0xf108('0x2c')](_0x1607a0);}};}function respondWithFilteredResult(_0x427a85,_0x1d334d){return function(_0x47d547){if(_0x47d547){var _0xd54ab5=typeof _0x1d334d['offset']===_0xf108('0x2d')&&typeof _0x1d334d[_0xf108('0x2e')]===_0xf108('0x2d');var _0x4a0364=_0x47d547['count'];var _0x202711=_0xd54ab5?0x0:_0x1d334d['offset'];var _0x49d0b3=_0xd54ab5?_0x47d547['count']:_0x1d334d[_0xf108('0x2f')]+_0x1d334d[_0xf108('0x2e')];var _0x42dcaa;if(_0x49d0b3>=_0x4a0364){_0x49d0b3=_0x4a0364;_0x42dcaa=0xc8;}else{_0x42dcaa=0xce;}_0x427a85['status'](_0x42dcaa);return _0x427a85[_0xf108('0x30')](_0xf108('0x31'),_0x202711+'-'+_0x49d0b3+'/'+_0x4a0364)[_0xf108('0x2c')](_0x47d547);}return null;};}function patchUpdates(_0x12ce0b){return function(_0x121cb5){try{jsonpatch[_0xf108('0x32')](_0x121cb5,_0x12ce0b,!![]);}catch(_0x43b314){return BPromise['reject'](_0x43b314);}return _0x121cb5[_0xf108('0x33')]();};}function saveUpdates(_0x595a1d,_0x19386b){return function(_0x42daa6){if(_0x42daa6){return _0x42daa6['update'](_0x595a1d)[_0xf108('0x1e')](function(_0x4e889c){return _0x4e889c;});}return null;};}function removeEntity(_0xa9aefa,_0x3fe908){return function(_0x4565a){if(_0x4565a){return _0x4565a[_0xf108('0x34')]()[_0xf108('0x1e')](function(){var _0x2df525=_0x4565a[_0xf108('0x35')]({'plain':!![]});var _0x4945bb=_0xf108('0x36');return db[_0xf108('0x37')][_0xf108('0x34')]({'where':{'type':_0x4945bb,'resourceId':_0x2df525['id']}})[_0xf108('0x1e')](function(){return _0x4565a;});})['then'](function(){_0xa9aefa[_0xf108('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44265b,_0x1488ce){return function(_0x41140c){if(!_0x41140c){_0x44265b[_0xf108('0x38')](0x194);}return _0x41140c;};}function handleError(_0x52d891,_0x3e9cb3){_0x3e9cb3=_0x3e9cb3||0x1f4;return function(_0x41a54c){logger[_0xf108('0x22')](_0x41a54c['stack']);if(_0x41a54c[_0xf108('0x39')]){delete _0x41a54c[_0xf108('0x39')];}_0x52d891[_0xf108('0x2a')](_0x3e9cb3)['send'](_0x41a54c);};}exports[_0xf108('0x3a')]=function(_0x5951e5,_0x110bee){var _0x4bcfb3={'include':[{'model':db[_0xf108('0x3b')],'as':_0xf108('0x3c')}]},_0x16c61f={},_0x13ab27={'count':0x0,'rows':[]};var _0x31bac6=_[_0xf108('0x3d')](db[_0xf108('0x3e')]['rawAttributes'],function(_0x4b2265){return{'name':_0x4b2265['fieldName'],'type':_0x4b2265[_0xf108('0x3f')][_0xf108('0x40')]};});_0x16c61f[_0xf108('0x41')]=_[_0xf108('0x3d')](_0x31bac6,'name');_0x16c61f[_0xf108('0x42')]=_[_0xf108('0x43')](_0x5951e5[_0xf108('0x42')]);_0x16c61f[_0xf108('0x44')]=_[_0xf108('0x45')](_0x16c61f['model'],_0x16c61f[_0xf108('0x42')]);_0x4bcfb3[_0xf108('0x46')]=_[_0xf108('0x45')](_0x16c61f[_0xf108('0x41')],qs[_0xf108('0x47')](_0x5951e5['query'][_0xf108('0x47')]));_0x4bcfb3[_0xf108('0x46')]=_0x4bcfb3['attributes'][_0xf108('0x48')]?_0x4bcfb3[_0xf108('0x46')]:_0x16c61f[_0xf108('0x41')];if(!_0x5951e5['query'][_0xf108('0x49')](_0xf108('0x4a'))){_0x4bcfb3[_0xf108('0x2e')]=qs[_0xf108('0x2e')](_0x5951e5[_0xf108('0x42')][_0xf108('0x2e')]);_0x4bcfb3['offset']=qs[_0xf108('0x2f')](_0x5951e5[_0xf108('0x42')][_0xf108('0x2f')]);}_0x4bcfb3[_0xf108('0x4b')]=qs[_0xf108('0x4c')](_0x5951e5[_0xf108('0x42')]['sort']);_0x4bcfb3[_0xf108('0x4d')]=qs[_0xf108('0x44')](_[_0xf108('0x4e')](_0x5951e5['query'],_0x16c61f['filters']),_0x31bac6);if(_0x5951e5[_0xf108('0x42')][_0xf108('0x4f')]){_0x4bcfb3['where']=_[_0xf108('0x50')](_0x4bcfb3[_0xf108('0x4d')],{'$or':_[_0xf108('0x3d')](_0x31bac6,function(_0x20266f){if(_0x20266f[_0xf108('0x3f')]!==_0xf108('0x51')){var _0x3d811e={};_0x3d811e[_0x20266f['name']]={'$like':'%'+_0x5951e5[_0xf108('0x42')]['filter']+'%'};return _0x3d811e;}})});}_0x4bcfb3=_[_0xf108('0x50')]({},_0x4bcfb3,_0x5951e5[_0xf108('0x52')]);var _0x392bbb={'where':_0x4bcfb3[_0xf108('0x4d')]};return db[_0xf108('0x3e')]['count'](_0x392bbb)['then'](function(_0x2ef78a){_0x13ab27[_0xf108('0x53')]=_0x2ef78a;if(_0x5951e5['query']['includeAll']){_0x4bcfb3['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0xf108('0x54')](_0x4bcfb3);})[_0xf108('0x1e')](function(_0x1db8ab){_0x13ab27['rows']=_0x1db8ab;return _0x13ab27;})[_0xf108('0x1e')](respondWithFilteredResult(_0x110bee,_0x4bcfb3))['catch'](handleError(_0x110bee,null));};exports[_0xf108('0x55')]=function(_0x5af2a7,_0x24b48a){var _0x5027e0={'raw':![],'where':{'id':_0x5af2a7[_0xf108('0x56')]['id']},'include':[{'model':db[_0xf108('0x3b')],'as':_0xf108('0x3c')}]},_0x2cc56b={};_0x2cc56b[_0xf108('0x41')]=_[_0xf108('0x43')](db[_0xf108('0x3e')][_0xf108('0x57')]);_0x2cc56b[_0xf108('0x42')]=_[_0xf108('0x43')](_0x5af2a7[_0xf108('0x42')]);_0x2cc56b['filters']=_['intersection'](_0x2cc56b['model'],_0x2cc56b[_0xf108('0x42')]);_0x5027e0[_0xf108('0x46')]=_[_0xf108('0x45')](_0x2cc56b[_0xf108('0x41')],qs['fields'](_0x5af2a7[_0xf108('0x42')][_0xf108('0x47')]));_0x5027e0[_0xf108('0x46')]=_0x5027e0[_0xf108('0x46')][_0xf108('0x48')]?_0x5027e0['attributes']:_0x2cc56b['model'];if(_0x5af2a7[_0xf108('0x42')][_0xf108('0x58')]){_0x5027e0[_0xf108('0x59')]=[{'all':!![]}];}_0x5027e0=_[_0xf108('0x50')]({},_0x5027e0,_0x5af2a7[_0xf108('0x52')]);return db[_0xf108('0x3e')][_0xf108('0x5a')](_0x5027e0)['then'](handleEntityNotFound(_0x24b48a,null))['then'](respondWithResult(_0x24b48a,null))[_0xf108('0x29')](handleError(_0x24b48a,null));};exports[_0xf108('0x5b')]=function(_0x365db1,_0x396f33){return db['OpenchannelAccount'][_0xf108('0x5b')](_0x365db1[_0xf108('0x5c')],{})[_0xf108('0x1e')](function(_0x293915){var _0x6a2bd1=_0x365db1['user'][_0xf108('0x35')]({'plain':!![]});if(!_0x6a2bd1)throw new Error(_0xf108('0x5d'));if(_0x6a2bd1[_0xf108('0x5e')]===_0xf108('0x5f')){var _0x100527=_0x293915[_0xf108('0x35')]({'plain':!![]});var _0x1ec145=_0xf108('0x36');return db[_0xf108('0x60')][_0xf108('0x5a')]({'where':{'name':_0x1ec145,'userProfileId':_0x6a2bd1[_0xf108('0x61')]},'raw':!![]})[_0xf108('0x1e')](function(_0x3010ac){if(_0x3010ac&&_0x3010ac[_0xf108('0x62')]===0x0){return db[_0xf108('0x37')][_0xf108('0x5b')]({'name':_0x100527['name'],'resourceId':_0x100527['id'],'type':_0x3010ac[_0xf108('0x39')],'sectionId':_0x3010ac['id']},{})['then'](function(){return _0x293915;});}else{return _0x293915;}})['catch'](function(_0x195486){logger[_0xf108('0x22')](_0xf108('0x63'),_0x195486);throw _0x195486;});}return _0x293915;})['then'](respondWithResult(_0x396f33,0xc9))[_0xf108('0x29')](handleError(_0x396f33,null));};exports[_0xf108('0x64')]=function(_0x5c7f6b,_0x3c079d){if(_0x5c7f6b['body']['id']){delete _0x5c7f6b['body']['id'];}return db['OpenchannelAccount'][_0xf108('0x5a')]({'where':{'id':_0x5c7f6b[_0xf108('0x56')]['id']},'include':[{'model':db[_0xf108('0x3b')],'as':_0xf108('0x3c')}]})['then'](handleEntityNotFound(_0x3c079d,null))[_0xf108('0x1e')](saveUpdates(_0x5c7f6b['body'],null))[_0xf108('0x1e')](respondWithResult(_0x3c079d,null))[_0xf108('0x29')](handleError(_0x3c079d,null));};exports['destroy']=function(_0x54693e,_0x2f6696){return db['OpenchannelAccount'][_0xf108('0x5a')]({'where':{'id':_0x54693e[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x2f6696,null))[_0xf108('0x1e')](removeEntity(_0x2f6696,null))[_0xf108('0x29')](handleError(_0x2f6696,null));};exports[_0xf108('0x65')]=function(_0x5c43b5,_0x59d1b8){return db['OpenchannelAccount']['describe']()[_0xf108('0x1e')](respondWithResult(_0x59d1b8,null))['catch'](handleError(_0x59d1b8,null));};exports['addDisposition']=function(_0x50ab22,_0xe0fe13,_0x5001ba){if(_0x50ab22['body']['id']){delete _0x50ab22[_0xf108('0x5c')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x50ab22[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0xe0fe13,null))[_0xf108('0x1e')](function(_0x467610){if(_0x467610){_0x50ab22[_0xf108('0x5c')]['OpenchannelAccountId']=_0x467610['id'];return db['Disposition'][_0xf108('0x5b')](_0x50ab22['body']);}})[_0xf108('0x1e')](respondWithResult(_0xe0fe13,null))['catch'](handleError(_0xe0fe13,null));};exports['getDispositions']=function(_0x5023ee,_0x39926a,_0x2d5fe8){var _0x5e38d2={'raw':![],'where':{}};var _0x47aaa6={};var _0x29d743={'count':0x0,'rows':[]};return db[_0xf108('0x3e')][_0xf108('0x66')]({'where':{'id':_0x5023ee[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x39926a,null))['then'](function(_0x48e6c2){if(_0x48e6c2){_0x47aaa6[_0xf108('0x41')]=_[_0xf108('0x43')](db[_0xf108('0x67')][_0xf108('0x57')]);_0x47aaa6[_0xf108('0x42')]=_['keys'](_0x5023ee['query']);_0x47aaa6[_0xf108('0x44')]=_[_0xf108('0x45')](_0x47aaa6[_0xf108('0x41')],_0x47aaa6['query']);_0x5e38d2[_0xf108('0x46')]=_[_0xf108('0x45')](_0x47aaa6['model'],qs[_0xf108('0x47')](_0x5023ee[_0xf108('0x42')][_0xf108('0x47')]));_0x5e38d2['attributes']=_0x5e38d2[_0xf108('0x46')]['length']?_0x5e38d2[_0xf108('0x46')]:_0x47aaa6[_0xf108('0x41')];if(!_0x5023ee[_0xf108('0x42')][_0xf108('0x49')](_0xf108('0x4a'))){_0x5e38d2[_0xf108('0x2e')]=qs[_0xf108('0x2e')](_0x5023ee['query']['limit']);_0x5e38d2[_0xf108('0x2f')]=qs['offset'](_0x5023ee[_0xf108('0x42')][_0xf108('0x2f')]);}_0x5e38d2[_0xf108('0x4b')]=qs['sort'](_0x5023ee['query']['sort']);_0x5e38d2[_0xf108('0x4d')]=qs[_0xf108('0x44')](_[_0xf108('0x4e')](_0x5023ee['query'],_0x47aaa6['filters']));_0x5e38d2[_0xf108('0x4d')][_0xf108('0x68')]=_0x48e6c2['id'];if(_0x5023ee[_0xf108('0x42')][_0xf108('0x4f')]){_0x5e38d2[_0xf108('0x4d')]=_[_0xf108('0x50')](_0x5e38d2[_0xf108('0x4d')],{'$or':_[_0xf108('0x3d')](_0x5e38d2[_0xf108('0x46')],function(_0x462f3d){var _0x3bf0d1={};_0x3bf0d1[_0x462f3d]={'$like':'%'+_0x5023ee[_0xf108('0x42')][_0xf108('0x4f')]+'%'};return _0x3bf0d1;})});}_0x5e38d2=_[_0xf108('0x50')]({},_0x5e38d2,_0x5023ee[_0xf108('0x52')]);return db[_0xf108('0x67')][_0xf108('0x53')]({'where':_0x5e38d2[_0xf108('0x4d')]})[_0xf108('0x1e')](function(_0x3edb9b){_0x29d743[_0xf108('0x53')]=_0x3edb9b;if(_0x5023ee[_0xf108('0x42')]['includeAll']){_0x5e38d2[_0xf108('0x59')]=[{'all':!![]}];}return db['Disposition'][_0xf108('0x54')](_0x5e38d2);})['then'](function(_0x565806){_0x29d743[_0xf108('0x69')]=_0x565806;return _0x29d743;});}})[_0xf108('0x1e')](respondWithFilteredResult(_0x39926a,_0x5e38d2))['catch'](handleError(_0x39926a,null));};exports['removeDispositions']=function(_0x213ed3,_0x46f6e3,_0x12ab0b){return db['OpenchannelAccount']['find']({'where':{'id':_0x213ed3['params']['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x46f6e3,null))[_0xf108('0x1e')](function(_0x4a4144){if(_0x4a4144){return _0x4a4144['removeDispositions'](_0x213ed3[_0xf108('0x42')][_0xf108('0x6a')]);}})[_0xf108('0x1e')](respondWithStatusCode(_0x46f6e3,null))[_0xf108('0x29')](handleError(_0x46f6e3,null));};exports[_0xf108('0x6b')]=function(_0x540a1f,_0x5d5f7f,_0x446dea){if(_0x540a1f[_0xf108('0x5c')]['id']){delete _0x540a1f[_0xf108('0x5c')]['id'];}return db[_0xf108('0x3e')]['find']({'where':{'id':_0x540a1f[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x5d5f7f,null))['then'](function(_0x2ff7ee){if(_0x2ff7ee){_0x540a1f['body'][_0xf108('0x68')]=_0x2ff7ee['id'];return db['CannedAnswer'][_0xf108('0x5b')](_0x540a1f[_0xf108('0x5c')]);}})['then'](respondWithResult(_0x5d5f7f,null))['catch'](handleError(_0x5d5f7f,null));};exports['getAnswers']=function(_0x513bb6,_0x342d28,_0x3ab4fc){var _0x59a7b3={'raw':![],'where':{}};var _0x25380a={};var _0x460790={'count':0x0,'rows':[]};return db[_0xf108('0x3e')][_0xf108('0x66')]({'where':{'id':_0x513bb6[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x342d28,null))['then'](function(_0x3dd5f1){if(_0x3dd5f1){_0x25380a[_0xf108('0x41')]=_[_0xf108('0x43')](db[_0xf108('0x6c')][_0xf108('0x57')]);_0x25380a[_0xf108('0x42')]=_[_0xf108('0x43')](_0x513bb6[_0xf108('0x42')]);_0x25380a[_0xf108('0x44')]=_[_0xf108('0x45')](_0x25380a[_0xf108('0x41')],_0x25380a[_0xf108('0x42')]);_0x59a7b3[_0xf108('0x46')]=_[_0xf108('0x45')](_0x25380a['model'],qs['fields'](_0x513bb6[_0xf108('0x42')]['fields']));_0x59a7b3['attributes']=_0x59a7b3[_0xf108('0x46')][_0xf108('0x48')]?_0x59a7b3[_0xf108('0x46')]:_0x25380a['model'];if(!_0x513bb6[_0xf108('0x42')]['hasOwnProperty'](_0xf108('0x4a'))){_0x59a7b3[_0xf108('0x2e')]=qs[_0xf108('0x2e')](_0x513bb6[_0xf108('0x42')][_0xf108('0x2e')]);_0x59a7b3['offset']=qs['offset'](_0x513bb6[_0xf108('0x42')][_0xf108('0x2f')]);}_0x59a7b3[_0xf108('0x4b')]=qs[_0xf108('0x4c')](_0x513bb6[_0xf108('0x42')][_0xf108('0x4c')]);_0x59a7b3[_0xf108('0x4d')]=qs['filters'](_[_0xf108('0x4e')](_0x513bb6[_0xf108('0x42')],_0x25380a[_0xf108('0x44')]));_0x59a7b3[_0xf108('0x4d')][_0xf108('0x68')]=_0x3dd5f1['id'];if(_0x513bb6[_0xf108('0x42')]['filter']){_0x59a7b3[_0xf108('0x4d')]=_[_0xf108('0x50')](_0x59a7b3[_0xf108('0x4d')],{'$or':_[_0xf108('0x3d')](_0x59a7b3['attributes'],function(_0x16b147){var _0x3f1d82={};_0x3f1d82[_0x16b147]={'$like':'%'+_0x513bb6['query'][_0xf108('0x4f')]+'%'};return _0x3f1d82;})});}_0x59a7b3=_[_0xf108('0x50')]({},_0x59a7b3,_0x513bb6[_0xf108('0x52')]);return db[_0xf108('0x6c')][_0xf108('0x53')]({'where':_0x59a7b3[_0xf108('0x4d')]})[_0xf108('0x1e')](function(_0x111774){_0x460790[_0xf108('0x53')]=_0x111774;if(_0x513bb6['query'][_0xf108('0x58')]){_0x59a7b3[_0xf108('0x59')]=[{'all':!![]}];}return db[_0xf108('0x6c')][_0xf108('0x54')](_0x59a7b3);})['then'](function(_0x170a1a){_0x460790[_0xf108('0x69')]=_0x170a1a;return _0x460790;});}})[_0xf108('0x1e')](respondWithFilteredResult(_0x342d28,_0x59a7b3))[_0xf108('0x29')](handleError(_0x342d28,null));};exports['removeAnswers']=function(_0x4cd236,_0x27cde6,_0xb75911){return db[_0xf108('0x3e')][_0xf108('0x5a')]({'where':{'id':_0x4cd236[_0xf108('0x56')]['id']}})['then'](handleEntityNotFound(_0x27cde6,null))['then'](function(_0x473da0){if(_0x473da0){return _0x473da0[_0xf108('0x6d')](_0x4cd236[_0xf108('0x42')][_0xf108('0x6a')]);}})[_0xf108('0x1e')](respondWithStatusCode(_0x27cde6,null))[_0xf108('0x29')](handleError(_0x27cde6,null));};exports[_0xf108('0x6e')]=function(_0x3dd4f2,_0x2c72cc,_0x2bef51){var _0x44226e={'body':_0x3dd4f2[_0xf108('0x5c')],'channel':'openchannel'};var _0x5072ae=[];var _0x4478ae=[];var _0x5b1ea3={};var _0x17257e=![];return db[_0xf108('0x6f')][_0xf108('0x65')]()['then'](function(_0x21ba81){if(!_0x21ba81){throw new db[(_0xf108('0x70'))][(_0xf108('0x71'))]('no\x20available\x20attributes');}_0x5072ae=_[_0xf108('0x72')](_[_0xf108('0x43')](_0x21ba81),['createdAt','updatedAt']);_0x4478ae=_[_0xf108('0x72')](_[_0xf108('0x43')](_0x21ba81),[_0xf108('0x73'),_0xf108('0x74'),_0xf108('0x75'),_0xf108('0x76')]);if(_0x3dd4f2[_0xf108('0x5c')]['id']){delete _0x3dd4f2[_0xf108('0x5c')]['id'];}if(_['isNil'](_0x3dd4f2['body'][_0xf108('0x77')])){throw new db[(_0xf108('0x70'))][(_0xf108('0x71'))](_0xf108('0x78'));}if(_[_0xf108('0x79')](_0x3dd4f2[_0xf108('0x5c')]['body'])||_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x5c')]===''){throw new db['Sequelize'][(_0xf108('0x71'))](_0xf108('0x7a'));}if(_['isNil'](_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x7b')])){throw new db[(_0xf108('0x70'))]['ValidationError'](_0xf108('0x7c')+_0x4478ae);}if(!_[_0xf108('0x7d')](_0x4478ae,_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x7b')])){throw new db['Sequelize'][(_0xf108('0x71'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4478ae);}_0x5b1ea3[_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x7b')]]=_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x77')];})[_0xf108('0x1e')](function(){return db[_0xf108('0x3e')]['find']({'where':{'id':_0x3dd4f2[_0xf108('0x56')]['id']},'include':[{'model':db[_0xf108('0x7e')],'as':'List','include':[{'model':db[_0xf108('0x6f')],'as':_0xf108('0x7f'),'where':_0x5b1ea3,'limit':0x1,'order':[[_0xf108('0x74'),_0xf108('0x80')]]}]},{'model':db[_0xf108('0x81')],'as':_0xf108('0x82')}]});})[_0xf108('0x1e')](handleEntityNotFound(_0x2c72cc,null))[_0xf108('0x1e')](function(_0xa1797c){if(_0xa1797c&&_0xa1797c[_0xf108('0x83')]){_0x44226e[_0xf108('0x84')]=_0xa1797c;_0x44226e[_0xf108('0x85')]=_0xa1797c[_0xf108('0x82')];_0x44226e['list']=_0xa1797c[_0xf108('0x83')];_0x44226e[_0xf108('0x85')]=_['orderBy'](_0x44226e[_0xf108('0x85')],[_0xf108('0x86')],[_0xf108('0x87')]);if(_0x44226e[_0xf108('0x84')][_0xf108('0x82')]){delete _0x44226e[_0xf108('0x84')][_0xf108('0x82')];}if(_0x44226e[_0xf108('0x84')]['List']&&_0x44226e[_0xf108('0x84')][_0xf108('0x83')][_0xf108('0x7f')][_0xf108('0x48')]){return _0x44226e[_0xf108('0x84')][_0xf108('0x83')][_0xf108('0x7f')][0x0];}var _0x5e4eec=_[_0xf108('0x17')](_0x3dd4f2[_0xf108('0x5c')],{'firstName':_0x3dd4f2[_0xf108('0x5c')]['from'],'ListId':_0xa1797c[_0xf108('0x76')]});_0x5e4eec[_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x7b')]]=_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x77')];return db[_0xf108('0x6f')][_0xf108('0x5b')](_0x5e4eec,{'fields':_0x5072ae,'raw':!![]});}})[_0xf108('0x1e')](handleEntityNotFound(_0x2c72cc,null))[_0xf108('0x1e')](function(_0x227863){_0x44226e[_0xf108('0x88')]=_0x227863;if(_0x227863){var _0x461612={'ContactId':_0x227863['id'],'OpenchannelAccountId':_0x3dd4f2[_0xf108('0x56')]['id'],'from':(_0x227863[_0xf108('0x89')]||'')+'\x20'+(_0x227863[_0xf108('0x8a')]||'')};var _0x140573={'OpenchannelAccountId':_0x3dd4f2[_0xf108('0x56')]['id'],'closed':![]};if(_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x8b')]){_0x140573[_0xf108('0x8b')]=_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x8b')];return db[_0xf108('0x8c')]['find']({'where':_0x140573})[_0xf108('0x1e')](function(_0x577a83){if(_0x577a83){return[_0x577a83,![]];}_0x461612[_0xf108('0x8b')]=_0x3dd4f2[_0xf108('0x5c')]['threadId'];_0x461612[_0xf108('0x8d')]=_0x3dd4f2['body'][_0xf108('0x8d')];return db[_0xf108('0x8c')]['create'](_0x461612)[_0xf108('0x1e')](function(_0x85ab69){return[_0x85ab69,!![]];});});}else{_0x140573['threadId']=null;}_0x140573[_0xf108('0x8e')]=_0x227863['id'];return db[_0xf108('0x8c')][_0xf108('0x5a')]({'where':_0x140573})[_0xf108('0x1e')](function(_0x27dfe6){if(_0x27dfe6){return[_0x27dfe6,![]];}return db[_0xf108('0x8c')][_0xf108('0x5b')](_0x461612)[_0xf108('0x1e')](function(_0x1b0f3e){return[_0x1b0f3e,!![]];});});}})[_0xf108('0x8f')](function(_0x79c6d0,_0x37ab79){if(_0x79c6d0){_0x17257e=_0x37ab79;if(!_0x37ab79){var _0x4f198f={'from':(_0x44226e[_0xf108('0x88')][_0xf108('0x89')]||'')+'\x20'+(_0x44226e[_0xf108('0x88')]['lastName']||'')};if(_0x3dd4f2['body'][_0xf108('0x8b')]&&_0x3dd4f2[_0xf108('0x5c')]['messageId']&&_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x8b')]!=_0x3dd4f2[_0xf108('0x5c')][_0xf108('0x90')]){_0x4f198f[_0xf108('0x8b')]=_0x3dd4f2[_0xf108('0x5c')]['messageId'];}return _0x79c6d0[_0xf108('0x64')](_0x4f198f);}else{return _0x79c6d0;}}})[_0xf108('0x1e')](function(_0x23618f){_0x44226e[_0xf108('0x91')]=_0x23618f[_0xf108('0x35')]({'plain':!![]});_0x44226e[_0xf108('0x91')]['created']=_0x17257e;if(_0x44226e[_0xf108('0x91')][_0xf108('0x92')]){if(_0x44226e['account'][_0xf108('0x93')]){_0x44226e[_0xf108('0x85')][_0xf108('0x94')]({'id':0x0,'priority':_0x44226e[_0xf108('0x85')][_0xf108('0x48')]+0x1,'app':_0xf108('0x95'),'appdata':_0xf108('0x96'),'interval':_0xf108('0x97')});}}return db['OpenchannelMessage'][_0xf108('0x5b')]({'body':_0x3dd4f2['body'][_0xf108('0x5c')],'OpenchannelAccountId':_0x3dd4f2['params']['id'],'OpenchannelInteractionId':_0x23618f['id'],'direction':'in','ContactId':_0x44226e[_0xf108('0x88')]['id'],'AttachmentId':_0x3dd4f2['body']['AttachmentId']});})[_0xf108('0x1e')](function(_0x23a396){_0x44226e[_0xf108('0x25')]=_0x23a396;if(_0x44226e[_0xf108('0x91')][_0xf108('0x98')]){return db['User'][_0xf108('0x5a')]({'attributes':['id',_0xf108('0x39')],'where':{'id':_0x44226e['interaction'][_0xf108('0x98')]}})[_0xf108('0x1e')](function(_0x409eed){if(_0x409eed){_0x44226e[_0xf108('0x85')][_0xf108('0x99')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x409eed['name']+','+(_0x44226e[_0xf108('0x84')][_0xf108('0x9a')]||0xa),'interval':'*,*,*,*'});_0x44226e[_0xf108('0x9b')]=![];}return respondWithRpcPromise(_0xf108('0x9c'),_0xf108('0x9d'),_0x44226e);});}return respondWithRpcPromise('Start',_0xf108('0x9d'),_0x44226e);})[_0xf108('0x1e')](function(_0x3f307f){respondWithRpcPromise(_0xf108('0x9e'),_0xf108('0x9e'),{'event':_0xf108('0x6e'),'message':_0x3f307f},client9002);return _0x3f307f;})[_0xf108('0x1e')](respondWithResult(_0x2c72cc,null))[_0xf108('0x29')](handleError(_0x2c72cc,null));};exports[_0xf108('0x9f')]=function(_0x15c8a7,_0x2b5d20,_0x4e89c3){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x15c8a7[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x2b5d20,null))[_0xf108('0x1e')](function(_0x5e8244){if(_0x5e8244){return db[_0xf108('0xa0')][_0xf108('0xa1')](function(_0x53af97){return db['OpenchannelApplication'][_0xf108('0x34')]({'where':{'OpenchannelAccountId':_0x15c8a7['params']['id']},'transaction':_0x53af97})['then'](function(_0x37da7c){var _0xe68adc=_['map'](_0x15c8a7[_0xf108('0x5c')],function(_0x5ea4cd){_0x5ea4cd[_0xf108('0x68')]=_0x15c8a7[_0xf108('0x56')]['id'];return _0x5ea4cd;});return db['OpenchannelApplication'][_0xf108('0xa2')](_0xe68adc,{'transaction':_0x53af97});});})[_0xf108('0x1e')](function(){return db['OpenchannelApplication'][_0xf108('0xa3')]({'where':{'OpenchannelAccountId':_0x15c8a7[_0xf108('0x56')]['id']},'order':'priority'});});}})[_0xf108('0x1e')](respondWithResult(_0x2b5d20,null))[_0xf108('0x29')](handleError(_0x2b5d20,null));};exports['getApplications']=function(_0x238d97,_0x5b6884,_0x3f5d5d){var _0x48b2a5={};var _0x3a4b25={};var _0x58487c;var _0xa89c02;return db['OpenchannelAccount'][_0xf108('0x66')]({'where':{'id':_0x238d97[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x5b6884,null))[_0xf108('0x1e')](function(_0xf7d147){if(_0xf7d147){_0x58487c=_0xf7d147;_0x3a4b25['model']=_[_0xf108('0x43')](db['OpenchannelApplication'][_0xf108('0x57')]);_0x3a4b25[_0xf108('0x42')]=_[_0xf108('0x43')](_0x238d97['query']);_0x3a4b25[_0xf108('0x44')]=_['intersection'](_0x3a4b25[_0xf108('0x41')],_0x3a4b25[_0xf108('0x42')]);_0x48b2a5[_0xf108('0x46')]=_['intersection'](_0x3a4b25[_0xf108('0x41')],qs[_0xf108('0x47')](_0x238d97[_0xf108('0x42')][_0xf108('0x47')]));_0x48b2a5[_0xf108('0x46')]=_0x48b2a5[_0xf108('0x46')][_0xf108('0x48')]?_0x48b2a5[_0xf108('0x46')]:_0x3a4b25['model'];_0x48b2a5[_0xf108('0x4b')]=qs[_0xf108('0x4c')](_0x238d97[_0xf108('0x42')][_0xf108('0x4c')]);_0x48b2a5[_0xf108('0x4d')]=qs['filters'](_[_0xf108('0x4e')](_0x238d97[_0xf108('0x42')],_0x3a4b25[_0xf108('0x44')]));if(_0x238d97[_0xf108('0x42')]['filter']){_0x48b2a5[_0xf108('0x4d')]=_[_0xf108('0x50')](_0x48b2a5[_0xf108('0x4d')],{'$or':_[_0xf108('0x3d')](_0x48b2a5['attributes'],function(_0x311540){var _0x5e0698={};_0x5e0698[_0x311540]={'$like':'%'+_0x238d97[_0xf108('0x42')][_0xf108('0x4f')]+'%'};return _0x5e0698;})});}_0x48b2a5=_[_0xf108('0x50')]({},_0x48b2a5,_0x238d97[_0xf108('0x52')]);return _0x58487c['getApplications'](_0x48b2a5);}})[_0xf108('0x1e')](function(_0x1228e1){if(_0x1228e1){_0xa89c02=_0x1228e1[_0xf108('0x48')];if(!_0x238d97[_0xf108('0x42')][_0xf108('0x49')](_0xf108('0x4a'))){_0x48b2a5[_0xf108('0x2e')]=qs[_0xf108('0x2e')](_0x238d97[_0xf108('0x42')]['limit']);_0x48b2a5[_0xf108('0x2f')]=qs['offset'](_0x238d97[_0xf108('0x42')][_0xf108('0x2f')]);}return _0x58487c[_0xf108('0xa4')](_0x48b2a5);}})['then'](function(_0x494091){if(_0x494091){return _0x494091?{'count':_0xa89c02,'rows':_0x494091}:null;}})['then'](respondWithResult(_0x5b6884,null))[_0xf108('0x29')](handleError(_0x5b6884,null));};exports[_0xf108('0xa5')]=function(_0xd33f7f,_0x2946ce,_0x3abaad){var _0x1e71d6={'raw':![],'where':{}};var _0x3be176={};var _0x1b14aa={'count':0x0,'rows':[]};return db[_0xf108('0x3e')]['findOne']({'where':{'id':_0xd33f7f[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x2946ce,null))[_0xf108('0x1e')](function(_0x1dfa73){if(_0x1dfa73){_0x3be176[_0xf108('0x41')]=_[_0xf108('0x43')](db[_0xf108('0x8c')][_0xf108('0x57')]);_0x3be176[_0xf108('0x42')]=_['keys'](_0xd33f7f['query']);_0x3be176['filters']=_[_0xf108('0x45')](_0x3be176['model'],_0x3be176[_0xf108('0x42')]);_0x1e71d6['attributes']=_[_0xf108('0x45')](_0x3be176[_0xf108('0x41')],qs[_0xf108('0x47')](_0xd33f7f['query'][_0xf108('0x47')]));_0x1e71d6['attributes']=_0x1e71d6[_0xf108('0x46')][_0xf108('0x48')]?_0x1e71d6[_0xf108('0x46')]:_0x3be176[_0xf108('0x41')];if(!_0xd33f7f['query'][_0xf108('0x49')]('nolimit')){_0x1e71d6[_0xf108('0x2e')]=qs[_0xf108('0x2e')](_0xd33f7f['query'][_0xf108('0x2e')]);_0x1e71d6['offset']=qs[_0xf108('0x2f')](_0xd33f7f['query'][_0xf108('0x2f')]);}_0x1e71d6[_0xf108('0x4b')]=qs['sort'](_0xd33f7f[_0xf108('0x42')]['sort']);_0x1e71d6[_0xf108('0x4d')]=qs[_0xf108('0x44')](_[_0xf108('0x4e')](_0xd33f7f[_0xf108('0x42')],_0x3be176['filters']));_0x1e71d6[_0xf108('0x4d')][_0xf108('0x68')]=_0x1dfa73['id'];if(_0xd33f7f[_0xf108('0x42')][_0xf108('0x4f')]){_0x1e71d6['where']=_[_0xf108('0x50')](_0x1e71d6[_0xf108('0x4d')],{'$or':_['map'](_0x1e71d6['attributes'],function(_0x755651){var _0x1a321d={};_0x1a321d[_0x755651]={'$like':'%'+_0xd33f7f[_0xf108('0x42')]['filter']+'%'};return _0x1a321d;})});}_0x1e71d6=_['merge']({},_0x1e71d6,_0xd33f7f[_0xf108('0x52')]);return db['OpenchannelInteraction'][_0xf108('0x53')]({'where':_0x1e71d6['where']})[_0xf108('0x1e')](function(_0x19c55e){_0x1b14aa[_0xf108('0x53')]=_0x19c55e;if(_0xd33f7f[_0xf108('0x42')]['includeAll']){_0x1e71d6['include']=[{'model':db[_0xf108('0x6f')],'as':_0xf108('0xa6'),'required':![]},{'model':db[_0xf108('0xa7')],'as':_0xf108('0xa8'),'attributes':[_0xf108('0x39'),_0xf108('0xa9'),_0xf108('0xaa')],'required':![]},{'model':db[_0xf108('0xab')],'as':_0xf108('0xac'),'attributes':['id','name',_0xf108('0xad')],'where':_0xd33f7f[_0xf108('0x42')][_0xf108('0xae')]?{'id':_0xd33f7f['query']['tag']}:undefined,'required':_0xd33f7f['query'][_0xf108('0xae')]?!![]:![]}];}return db[_0xf108('0x8c')]['findAll'](_0x1e71d6);})[_0xf108('0x1e')](function(_0x205e09){_0x1b14aa[_0xf108('0x69')]=_0x205e09;return _0x1b14aa;});}})[_0xf108('0x1e')](respondWithFilteredResult(_0x2946ce,_0x1e71d6))[_0xf108('0x29')](handleError(_0x2946ce,null));};exports[_0xf108('0xaf')]=function(_0x2294e8,_0x1ab1d3,_0x23543d){return db[_0xf108('0x3e')]['find']({'where':{'id':_0x2294e8[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x1ab1d3,null))[_0xf108('0x1e')](function(_0x7edc87){if(_0x7edc87){return _0x7edc87[_0xf108('0xaf')](_0x2294e8[_0xf108('0x5c')][_0xf108('0x6a')],_[_0xf108('0xb0')](_0x2294e8[_0xf108('0x5c')],[_0xf108('0x6a'),'id'])||{})[_0xf108('0x8f')](function(_0x541bc1){for(var _0x5e67a1=0x0;_0x5e67a1<_0x2294e8['body'][_0xf108('0x6a')][_0xf108('0x48')];_0x5e67a1+=0x1){socket[_0xf108('0xb1')](_0xf108('0xb2'),{'UserId':_0x2294e8[_0xf108('0x5c')][_0xf108('0x6a')][_0x5e67a1],'OpenchannelAccountId':_0x2294e8[_0xf108('0x56')]['id']});}return _0x541bc1;});}})[_0xf108('0x1e')](respondWithResult(_0x1ab1d3,null))['catch'](handleError(_0x1ab1d3,null));};exports[_0xf108('0xb3')]=function(_0x28b05b,_0x50c7e3,_0x2a3979){return db[_0xf108('0x3e')]['find']({'where':{'id':_0x28b05b[_0xf108('0x56')]['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x50c7e3,null))['then'](function(_0x5e4779){if(_0x5e4779){return _0x5e4779[_0xf108('0xb3')](_0x28b05b[_0xf108('0x42')]['ids'])[_0xf108('0x1e')](function(){if(_[_0xf108('0xb4')](_0x28b05b['query'][_0xf108('0x6a')])){for(var _0x29b137=0x0;_0x29b137<_0x28b05b[_0xf108('0x42')][_0xf108('0x6a')]['length'];_0x29b137+=0x1){socket[_0xf108('0xb1')](_0xf108('0xb5'),{'UserId':Number(_0x28b05b[_0xf108('0x42')]['ids'][_0x29b137]),'OpenchannelAccountId':Number(_0x28b05b[_0xf108('0x56')]['id'])});}}else{socket[_0xf108('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x28b05b[_0xf108('0x42')][_0xf108('0x6a')]),'OpenchannelAccountId':Number(_0x28b05b[_0xf108('0x56')]['id'])});}});}})[_0xf108('0x1e')](respondWithStatusCode(_0x50c7e3,null))[_0xf108('0x29')](handleError(_0x50c7e3,null));};exports['getAgents']=function(_0x1bb930,_0x5a744d,_0x32ea36){var _0x46a7da={};var _0x84186={};var _0x51bf38;var _0x144112;return db[_0xf108('0x3e')][_0xf108('0x66')]({'where':{'id':_0x1bb930['params']['id']}})[_0xf108('0x1e')](handleEntityNotFound(_0x5a744d,null))['then'](function(_0x2737a5){if(_0x2737a5){_0x51bf38=_0x2737a5;_0x84186[_0xf108('0x41')]=_[_0xf108('0x43')](db[_0xf108('0xa7')][_0xf108('0x57')]);_0x84186['query']=_[_0xf108('0x43')](_0x1bb930[_0xf108('0x42')]);_0x84186[_0xf108('0x44')]=_[_0xf108('0x45')](_0x84186[_0xf108('0x41')],_0x84186[_0xf108('0x42')]);_0x46a7da[_0xf108('0x46')]=_['intersection'](_0x84186[_0xf108('0x41')],qs[_0xf108('0x47')](_0x1bb930[_0xf108('0x42')][_0xf108('0x47')]));_0x46a7da['attributes']=_0x46a7da[_0xf108('0x46')]['length']?_0x46a7da['attributes']:_0x84186['model'];_0x46a7da['order']=qs['sort'](_0x1bb930[_0xf108('0x42')]['sort']);_0x46a7da[_0xf108('0x4d')]=qs[_0xf108('0x44')](_[_0xf108('0x4e')](_0x1bb930[_0xf108('0x42')],_0x84186['filters']));if(_0x1bb930[_0xf108('0x42')][_0xf108('0x4f')]){_0x46a7da[_0xf108('0x4d')]=_[_0xf108('0x50')](_0x46a7da[_0xf108('0x4d')],{'$or':_['map'](_0x46a7da[_0xf108('0x46')],function(_0x2b27b6){var _0x3c2e9f={};_0x3c2e9f[_0x2b27b6]={'$like':'%'+_0x1bb930[_0xf108('0x42')][_0xf108('0x4f')]+'%'};return _0x3c2e9f;})});}_0x46a7da=_['merge']({},_0x46a7da,_0x1bb930[_0xf108('0x52')]);return _0x51bf38[_0xf108('0xb6')](_0x46a7da);}})[_0xf108('0x1e')](function(_0xf5cdb8){if(_0xf5cdb8){_0x144112=_0xf5cdb8[_0xf108('0x48')];if(!_0x1bb930['query'][_0xf108('0x49')](_0xf108('0x4a'))){_0x46a7da[_0xf108('0x2e')]=qs['limit'](_0x1bb930['query']['limit']);_0x46a7da[_0xf108('0x2f')]=qs[_0xf108('0x2f')](_0x1bb930[_0xf108('0x42')][_0xf108('0x2f')]);}return _0x51bf38[_0xf108('0xb6')](_0x46a7da);}})[_0xf108('0x1e')](function(_0x3c5ec8){if(_0x3c5ec8){return _0x3c5ec8?{'count':_0x144112,'rows':_0x3c5ec8}:null;}})[_0xf108('0x1e')](respondWithResult(_0x5a744d,null))['catch'](handleError(_0x5a744d,null));};exports[_0xf108('0xb7')]=function(_0x4d2dc3,_0x54b66a,_0xa22bbe){var _0x3ea4c0,_0x2e4ae9,_0x15accf;if(_['isNil'](_0x4d2dc3[_0xf108('0x5c')][_0xf108('0x5c')])||_0x4d2dc3[_0xf108('0x5c')][_0xf108('0x5c')]===''){throw new db[(_0xf108('0x70'))][(_0xf108('0x71'))](_0xf108('0x7a'));}if(_[_0xf108('0x79')](_0x4d2dc3[_0xf108('0x5c')]['to'])){}_0x3ea4c0=_0x4d2dc3[_0xf108('0x5c')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4d2dc3[_0xf108('0x56')]['id']}})['then'](handleEntityNotFound(_0x54b66a,null))[_0xf108('0x1e')](function(_0x1183e4){if(_0x1183e4){return db[_0xf108('0x3e')]['find']({'where':{'id':_0x1183e4['id']},'include':[{'model':db['CmList'],'as':_0xf108('0x83'),'include':[{'model':db[_0xf108('0x6f')],'as':_0xf108('0x7f'),'where':{[_0x1183e4[_0xf108('0x7b')]]:_0x3ea4c0},'limit':0x1,'order':[[_0xf108('0x74'),'DESC']]}]}]})[_0xf108('0x1e')](handleEntityNotFound(_0x54b66a,null))[_0xf108('0x1e')](function(_0x17232d){if(_0x17232d&&_0x17232d[_0xf108('0x83')]){_0x2e4ae9=_0x17232d[_0xf108('0x35')]({'plain':!![]});if(_0x2e4ae9[_0xf108('0x83')]&&_0x2e4ae9[_0xf108('0x83')][_0xf108('0x7f')][_0xf108('0x48')]){return _0x2e4ae9[_0xf108('0x83')][_0xf108('0x7f')][0x0];}return db[_0xf108('0x6f')]['create'](_[_0xf108('0x17')](_0x4d2dc3[_0xf108('0x5c')],{'firstName':_0x3ea4c0,[_0x17232d[_0xf108('0x7b')]]:_0x3ea4c0,'phone':_0x3ea4c0,'ListId':_0x2e4ae9[_0xf108('0x76')]}));}})['then'](handleEntityNotFound(_0x54b66a,null))['then'](function(_0x4e7f5f){if(_0x4e7f5f){_0x15accf=_0x4e7f5f;return db[_0xf108('0x8c')][_0xf108('0x5a')]({'where':{'ContactId':_0x15accf['id'],'closed':![],'OpenchannelAccountId':_0x2e4ae9['id']}})[_0xf108('0x1e')](function(_0x4782ee){if(_0x4782ee){return[_0x4782ee,![]];}return db[_0xf108('0x8c')][_0xf108('0x5b')]({'UserId':_0x4d2dc3['user']['id'],'ContactId':_0x15accf['id'],'OpenchannelAccountId':_0x2e4ae9['id'],'lastMsgDirection':_0xf108('0xb8'),'Messages':[_[_0xf108('0x50')](_0x4d2dc3[_0xf108('0x5c')],{'read':![],'body':_0x4d2dc3['body']['body'],'OpenchannelAccountId':_0x2e4ae9['id'],'UserId':_0x4d2dc3[_0xf108('0x5f')]['id'],'ContactId':_0x15accf['id']})]},{'include':[{'model':db[_0xf108('0xb9')],'as':_0xf108('0xba')}]})[_0xf108('0x1e')](function(_0x445766){return[_0x445766,!![]];});});}})['spread'](function(_0x585ec6,_0x26f421){if(_0x26f421){return _0x585ec6;}return db[_0xf108('0xb9')][_0xf108('0x5b')](_[_0xf108('0x50')](_0x4d2dc3['body'],{'read':![],'body':_0x4d2dc3['body'][_0xf108('0x5c')],'OpenchannelAccountId':_0x2e4ae9['id'],'OpenchannelInteractionId':_0x585ec6['id'],'UserId':_0x4d2dc3[_0xf108('0x5f')]['id'],'ContactId':_0x15accf['id']}))[_0xf108('0x1e')](function(_0x452719){_0x585ec6[_0xf108('0xbb')]['Messages']=[];_0x585ec6[_0xf108('0xbb')][_0xf108('0xba')]['push'](_0x452719['dataValues']);return _0x585ec6;});});}})['then'](respondWithResult(_0x54b66a,null))[_0xf108('0x29')](handleError(_0x54b66a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 6ad92f1..e2bb7ec 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 _0xa74f=['remove','hasOwnProperty','hook','exports','OpenchannelAccount','update'];(function(_0x22f1cc,_0x111731){var _0x24b0b4=function(_0x9f1fce){while(--_0x9f1fce){_0x22f1cc['push'](_0x22f1cc['shift']());}};_0x24b0b4(++_0x111731);}(_0xa74f,0x9a));var _0xfa74=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0xa74f[_0x59710f];return _0xaae66a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa74('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){OpenchannelAccountEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);OpenchannelAccountEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];OpenchannelAccount[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0x668b,0x140));var _0xb668=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0x668b[_0x54c10d];return _0x1fa703;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index c8f9113..b1a8575 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(_0x4f86ed,_0x35e8a0){var _0x57d258=function(_0x5db57c){while(--_0x5db57c){_0x4f86ed['push'](_0x4f86ed['shift']());}};_0x57d258(++_0x35e8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x1b6499,_0x1bbdbb){var _0x56a775=function(_0xd13588){while(--_0xd13588){_0x1b6499['push'](_0x1b6499['shift']());}};_0x56a775(++_0x1bbdbb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 0deeac2..c591fce 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 _0x9b87=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x9b87,0x8e));var _0x79b8=function(_0x4dbef6,_0x2cbe40){_0x4dbef6=_0x4dbef6-0x0;var _0xcd4fa0=_0x9b87[_0x4dbef6];return _0xcd4fa0;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var moment=require(_0x79b8('0x2'));var BPromise=require(_0x79b8('0x3'));var rs=require(_0x79b8('0x4'));var fs=require('fs');var Redis=require(_0x79b8('0x5'));var db=require(_0x79b8('0x6'))['db'];var utils=require(_0x79b8('0x7'));var logger=require(_0x79b8('0x8'))(_0x79b8('0x9'));var config=require(_0x79b8('0xa'));var jayson=require(_0x79b8('0xb'));var client=jayson[_0x79b8('0xc')][_0x79b8('0xd')]({'port':0x232a});config[_0x79b8('0xe')]=_[_0x79b8('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79b8('0x10'))[_0x79b8('0x11')](socket);function respondWithRpcPromise(_0x2f3453,_0x4bc41f,_0x28434){return new BPromise(function(_0x2fdb05,_0xdf585a){return client['request'](_0x2f3453,_0x28434)['then'](function(_0x46c0ce){logger[_0x79b8('0x12')](_0x79b8('0x13'),_0x4bc41f,_0x79b8('0x14'));logger[_0x79b8('0x15')](_0x79b8('0x16'),_0x4bc41f,_0x79b8('0x14'),JSON[_0x79b8('0x17')](_0x46c0ce));if(_0x46c0ce[_0x79b8('0x18')]){if(_0x46c0ce[_0x79b8('0x18')][_0x79b8('0x19')]===0x1f4){logger['error'](_0x79b8('0x13'),_0x4bc41f,_0x46c0ce['error']['message']);return _0xdf585a(_0x46c0ce[_0x79b8('0x18')][_0x79b8('0x1a')]);}logger[_0x79b8('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x4bc41f,_0x46c0ce[_0x79b8('0x18')]['message']);return _0x2fdb05(_0x46c0ce['error'][_0x79b8('0x1a')]);}else{logger[_0x79b8('0x12')](_0x79b8('0x13'),_0x4bc41f,_0x79b8('0x14'));_0x2fdb05(_0x46c0ce[_0x79b8('0x1b')][_0x79b8('0x1a')]);}})['catch'](function(_0x6a0de5){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4bc41f,_0x6a0de5);_0xdf585a(_0x6a0de5);});});} \ No newline at end of file +var _0x9434=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9434,0x168));var _0x4943=function(_0x3f9075,_0xa71771){_0x3f9075=_0x3f9075-0x0;var _0x2d7473=_0x9434[_0x3f9075];return _0x2d7473;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var moment=require(_0x4943('0x2'));var BPromise=require(_0x4943('0x3'));var rs=require(_0x4943('0x4'));var fs=require('fs');var Redis=require(_0x4943('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4943('0x6'));var logger=require(_0x4943('0x7'))('rpc');var config=require(_0x4943('0x8'));var jayson=require(_0x4943('0x9'));var client=jayson['client'][_0x4943('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4943('0xb')],{'host':_0x4943('0xc'),'port':0x18eb});var socket=require(_0x4943('0xd'))(new Redis(config[_0x4943('0xb')]));require(_0x4943('0xe'))['register'](socket);function respondWithRpcPromise(_0x51b504,_0x3057c4,_0x1bc269){return new BPromise(function(_0xf6d6c8,_0x519060){return client[_0x4943('0xf')](_0x51b504,_0x1bc269)[_0x4943('0x10')](function(_0x5a64a3){logger[_0x4943('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3057c4,'request\x20sent');logger[_0x4943('0x12')](_0x4943('0x13'),_0x3057c4,_0x4943('0x14'),JSON[_0x4943('0x15')](_0x5a64a3));if(_0x5a64a3[_0x4943('0x16')]){if(_0x5a64a3[_0x4943('0x16')][_0x4943('0x17')]===0x1f4){logger['error'](_0x4943('0x18'),_0x3057c4,_0x5a64a3[_0x4943('0x16')][_0x4943('0x19')]);return _0x519060(_0x5a64a3[_0x4943('0x16')][_0x4943('0x19')]);}logger[_0x4943('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x3057c4,_0x5a64a3[_0x4943('0x16')][_0x4943('0x19')]);return _0xf6d6c8(_0x5a64a3[_0x4943('0x16')]['message']);}else{logger['info'](_0x4943('0x18'),_0x3057c4,'request\x20sent');_0xf6d6c8(_0x5a64a3[_0x4943('0x1a')][_0x4943('0x19')]);}})['catch'](function(_0x156c8c){logger[_0x4943('0x16')](_0x4943('0x18'),_0x3057c4,_0x156c8c);_0x519060(_0x156c8c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 6da0146..e200cf4 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 _0xce25=['openchannelAccount:','remove','emit','removeListener','length'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xce25,0x196));var _0x5ce2=function(_0x638eb6,_0xd902e0){_0x638eb6=_0x638eb6-0x0;var _0x4249ce=_0xce25[_0x638eb6];return _0x4249ce;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x5ce2('0x0'),'update'];function createListener(_0x57ab25,_0x4dc355){return function(_0x5c8966){_0x4dc355[_0x5ce2('0x1')](_0x57ab25,_0x5c8966);};}function removeListener(_0x58f9eb,_0x3f4b36){return function(){OpenchannelAccountEvents[_0x5ce2('0x2')](_0x58f9eb,_0x3f4b36);};}exports['register']=function(_0x57a7a5){for(var _0x41fb85=0x0,_0x417149=events[_0x5ce2('0x3')];_0x41fb85<_0x417149;_0x41fb85++){var _0xcb80ee=events[_0x41fb85];var _0x4a57a6=createListener(_0x5ce2('0x4')+_0xcb80ee,_0x57a7a5);OpenchannelAccountEvents['on'](_0xcb80ee,_0x4a57a6);}}; \ No newline at end of file +var _0x630e=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove','emit'];(function(_0x3aab0e,_0x263e16){var _0x5c31d9=function(_0x423016){while(--_0x423016){_0x3aab0e['push'](_0x3aab0e['shift']());}};_0x5c31d9(++_0x263e16);}(_0x630e,0x1af));var _0xe630=function(_0x3fce90,_0x7f6b1c){_0x3fce90=_0x3fce90-0x0;var _0x52ca92=_0x630e[_0x3fce90];return _0x52ca92;};'use strict';var OpenchannelAccountEvents=require(_0xe630('0x0'));var events=['save',_0xe630('0x1'),'update'];function createListener(_0x559334,_0x36902e){return function(_0x143cb6){_0x36902e[_0xe630('0x2')](_0x559334,_0x143cb6);};}function removeListener(_0x5c5606,_0x2f3a0f){return function(){OpenchannelAccountEvents[_0xe630('0x3')](_0x5c5606,_0x2f3a0f);};}exports[_0xe630('0x4')]=function(_0x3d6f93){for(var _0x3936fd=0x0,_0x481b21=events[_0xe630('0x5')];_0x3936fd<_0x481b21;_0x3936fd++){var _0x34bad4=events[_0x3936fd];var _0x5a73ad=createListener(_0xe630('0x6')+_0x34bad4,_0x3d6f93);OpenchannelAccountEvents['on'](_0x34bad4,_0x5a73ad);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 39284b9..abb32a0 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 _0xb724=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xb724,0x66));var _0x4b72=function(_0x287623,_0x5d506e){_0x287623=_0x287623-0x0;var _0x231289=_0xb724[_0x287623];return _0x231289;};'use strict';var multer=require(_0x4b72('0x0'));var util=require(_0x4b72('0x1'));var path=require(_0x4b72('0x2'));var timeout=require(_0x4b72('0x3'));var express=require(_0x4b72('0x4'));var router=express[_0x4b72('0x5')]();var fs_extra=require(_0x4b72('0x6'));var auth=require(_0x4b72('0x7'));var interaction=require(_0x4b72('0x8'));var config=require(_0x4b72('0x9'));var controller=require(_0x4b72('0xa'));router[_0x4b72('0xb')]('/',auth[_0x4b72('0xc')](),controller[_0x4b72('0xd')]);router[_0x4b72('0xb')](_0x4b72('0xe'),auth[_0x4b72('0xc')](),controller[_0x4b72('0xf')]);router[_0x4b72('0x10')]('/',auth[_0x4b72('0xc')](),controller['create']);router[_0x4b72('0x11')](_0x4b72('0xe'),auth[_0x4b72('0xc')](),controller['update']);router['delete'](_0x4b72('0xe'),auth['isAuthenticated'](),controller[_0x4b72('0x12')]);module[_0x4b72('0x13')]=router; \ No newline at end of file +var _0xdc3d=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x12f85e,_0xe11256){var _0x4915a5=function(_0x3d1e96){while(--_0x3d1e96){_0x12f85e['push'](_0x12f85e['shift']());}};_0x4915a5(++_0xe11256);}(_0xdc3d,0x81));var _0xddc3=function(_0x59031b,_0x2634c6){_0x59031b=_0x59031b-0x0;var _0x4c2275=_0xdc3d[_0x59031b];return _0x4c2275;};'use strict';var multer=require('multer');var util=require(_0xddc3('0x0'));var path=require(_0xddc3('0x1'));var timeout=require(_0xddc3('0x2'));var express=require(_0xddc3('0x3'));var router=express[_0xddc3('0x4')]();var fs_extra=require(_0xddc3('0x5'));var auth=require(_0xddc3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xddc3('0x7'));var controller=require(_0xddc3('0x8'));router[_0xddc3('0x9')]('/',auth[_0xddc3('0xa')](),controller[_0xddc3('0xb')]);router[_0xddc3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xddc3('0xc')]);router[_0xddc3('0xd')]('/',auth['isAuthenticated'](),controller[_0xddc3('0xe')]);router[_0xddc3('0xf')](_0xddc3('0x10'),auth['isAuthenticated'](),controller[_0xddc3('0x11')]);router[_0xddc3('0x12')](_0xddc3('0x10'),auth[_0xddc3('0xa')](),controller[_0xddc3('0x13')]);module[_0xddc3('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index b660af1..ac2970f 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 _0x2c8d=['TEXT','exports','INTEGER','STRING'];(function(_0x58ddc,_0x316332){var _0x395b30=function(_0x4fa2a8){while(--_0x4fa2a8){_0x58ddc['push'](_0x58ddc['shift']());}};_0x395b30(++_0x316332);}(_0x2c8d,0x1d5));var _0xd2c8=function(_0x56d251,_0xf4a6aa){_0x56d251=_0x56d251-0x0;var _0x4a2707=_0x2c8d[_0x56d251];return _0x4a2707;};'use strict';var Sequelize=require('sequelize');module[_0xd2c8('0x0')]={'priority':{'type':Sequelize[_0xd2c8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd2c8('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd2c8('0x3')]()},'description':{'type':Sequelize[_0xd2c8('0x2')]},'interval':{'type':Sequelize[_0xd2c8('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7025=['exports','TEXT','STRING','sequelize'];(function(_0x2eef6b,_0x50c385){var _0x597a49=function(_0x966671){while(--_0x966671){_0x2eef6b['push'](_0x2eef6b['shift']());}};_0x597a49(++_0x50c385);}(_0x7025,0xe3));var _0x5702=function(_0x5dccfd,_0x16550b){_0x5dccfd=_0x5dccfd-0x0;var _0x3ebe91=_0x7025[_0x5dccfd];return _0x3ebe91;};'use strict';var Sequelize=require(_0x5702('0x0'));module[_0x5702('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5702('0x2')]()},'description':{'type':Sequelize[_0x5702('0x3')]},'interval':{'type':Sequelize[_0x5702('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 1c52e30..6696f19 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 _0x10ac=['fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../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','Content-Range','reject','save','update','then','destroy','error','send','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection'];(function(_0xc0322,_0x2dd3c6){var _0xb07dc6=function(_0x4aef6f){while(--_0x4aef6f){_0xc0322['push'](_0xc0322['shift']());}};_0xb07dc6(++_0x2dd3c6);}(_0x10ac,0x135));var _0xc10a=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x10ac[_0x8a969d];return _0x1d8dc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc10a('0x0'));var zipdir=require(_0xc10a('0x1'));var jsonpatch=require(_0xc10a('0x2'));var rp=require(_0xc10a('0x3'));var moment=require(_0xc10a('0x4'));var BPromise=require(_0xc10a('0x5'));var Mustache=require(_0xc10a('0x6'));var util=require(_0xc10a('0x7'));var path=require(_0xc10a('0x8'));var sox=require('sox');var csv=require(_0xc10a('0x9'));var ejs=require(_0xc10a('0xa'));var fs=require('fs');var fs_extra=require(_0xc10a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc10a('0xc'));var deskjs=require(_0xc10a('0xd'));var toCsv=require(_0xc10a('0x9'));var querystring=require(_0xc10a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc10a('0xf'));var qs=require(_0xc10a('0x10'));var as=require(_0xc10a('0x11'));var hardwareService=require(_0xc10a('0x12'));var logger=require(_0xc10a('0x13'))(_0xc10a('0x14'));var utils=require(_0xc10a('0x15'));var config=require(_0xc10a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc10a('0x17'))['db'];function respondWithStatusCode(_0x3f674b,_0x38ce8d){_0x38ce8d=_0x38ce8d||0xcc;return function(_0x321a01){if(_0x321a01){return _0x3f674b[_0xc10a('0x18')](_0x38ce8d);}return _0x3f674b[_0xc10a('0x19')](_0x38ce8d)[_0xc10a('0x1a')]();};}function respondWithResult(_0x10a855,_0x507b22){_0x507b22=_0x507b22||0xc8;return function(_0x420255){if(_0x420255){return _0x10a855[_0xc10a('0x19')](_0x507b22)[_0xc10a('0x1b')](_0x420255);}};}function respondWithFilteredResult(_0x4d853b,_0x37e098){return function(_0x5177f6){if(_0x5177f6){var _0x294e57=typeof _0x37e098[_0xc10a('0x1c')]===_0xc10a('0x1d')&&typeof _0x37e098['limit']===_0xc10a('0x1d');var _0x5b7e55=_0x5177f6[_0xc10a('0x1e')];var _0x4cc98a=_0x294e57?0x0:_0x37e098['offset'];var _0x4e88a6=_0x294e57?_0x5177f6[_0xc10a('0x1e')]:_0x37e098[_0xc10a('0x1c')]+_0x37e098['limit'];var _0x2666ca;if(_0x4e88a6>=_0x5b7e55){_0x4e88a6=_0x5b7e55;_0x2666ca=0xc8;}else{_0x2666ca=0xce;}_0x4d853b[_0xc10a('0x19')](_0x2666ca);return _0x4d853b['set'](_0xc10a('0x1f'),_0x4cc98a+'-'+_0x4e88a6+'/'+_0x5b7e55)[_0xc10a('0x1b')](_0x5177f6);}return null;};}function patchUpdates(_0x5ec569){return function(_0x55fc75){try{jsonpatch['apply'](_0x55fc75,_0x5ec569,!![]);}catch(_0x211fa0){return BPromise[_0xc10a('0x20')](_0x211fa0);}return _0x55fc75[_0xc10a('0x21')]();};}function saveUpdates(_0x4ec059,_0x9836ab){return function(_0x175ded){if(_0x175ded){return _0x175ded[_0xc10a('0x22')](_0x4ec059)[_0xc10a('0x23')](function(_0x28fdc2){return _0x28fdc2;});}return null;};}function removeEntity(_0x1bd26b,_0x110f21){return function(_0x46a6a3){if(_0x46a6a3){return _0x46a6a3[_0xc10a('0x24')]()['then'](function(){_0x1bd26b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c4de,_0x3618bd){return function(_0x52770a){if(!_0x52770a){_0x36c4de['sendStatus'](0x194);}return _0x52770a;};}function handleError(_0x35b2e0,_0x52a104){_0x52a104=_0x52a104||0x1f4;return function(_0x5f181f){logger[_0xc10a('0x25')](_0x5f181f['stack']);if(_0x5f181f['name']){delete _0x5f181f['name'];}_0x35b2e0[_0xc10a('0x19')](_0x52a104)[_0xc10a('0x26')](_0x5f181f);};}exports['index']=function(_0x52e723,_0x554188){var _0x141346={},_0x4bab44={},_0x4ea390={'count':0x0,'rows':[]};var _0x137729=_['map'](db[_0xc10a('0x27')][_0xc10a('0x28')],function(_0x4ebcc5){return{'name':_0x4ebcc5[_0xc10a('0x29')],'type':_0x4ebcc5[_0xc10a('0x2a')][_0xc10a('0x2b')]};});_0x4bab44[_0xc10a('0x2c')]=_[_0xc10a('0x2d')](_0x137729,_0xc10a('0x2e'));_0x4bab44[_0xc10a('0x2f')]=_[_0xc10a('0x30')](_0x52e723['query']);_0x4bab44[_0xc10a('0x31')]=_[_0xc10a('0x32')](_0x4bab44[_0xc10a('0x2c')],_0x4bab44[_0xc10a('0x2f')]);_0x141346['attributes']=_[_0xc10a('0x32')](_0x4bab44[_0xc10a('0x2c')],qs[_0xc10a('0x33')](_0x52e723[_0xc10a('0x2f')]['fields']));_0x141346[_0xc10a('0x34')]=_0x141346[_0xc10a('0x34')]['length']?_0x141346[_0xc10a('0x34')]:_0x4bab44['model'];if(!_0x52e723[_0xc10a('0x2f')][_0xc10a('0x35')](_0xc10a('0x36'))){_0x141346[_0xc10a('0x37')]=qs[_0xc10a('0x37')](_0x52e723['query'][_0xc10a('0x37')]);_0x141346[_0xc10a('0x1c')]=qs[_0xc10a('0x1c')](_0x52e723[_0xc10a('0x2f')][_0xc10a('0x1c')]);}_0x141346[_0xc10a('0x38')]=qs['sort'](_0x52e723['query'][_0xc10a('0x39')]);_0x141346['where']=qs[_0xc10a('0x31')](_['pick'](_0x52e723[_0xc10a('0x2f')],_0x4bab44[_0xc10a('0x31')]),_0x137729);if(_0x52e723[_0xc10a('0x2f')][_0xc10a('0x3a')]){_0x141346['where']=_[_0xc10a('0x3b')](_0x141346[_0xc10a('0x3c')],{'$or':_[_0xc10a('0x2d')](_0x137729,function(_0x3cd305){if(_0x3cd305[_0xc10a('0x2a')]!==_0xc10a('0x3d')){var _0x48cb2b={};_0x48cb2b[_0x3cd305['name']]={'$like':'%'+_0x52e723['query'][_0xc10a('0x3a')]+'%'};return _0x48cb2b;}})});}_0x141346=_[_0xc10a('0x3b')]({},_0x141346,_0x52e723['options']);var _0x232210={'where':_0x141346['where']};return db['OpenchannelApplication']['count'](_0x232210)[_0xc10a('0x23')](function(_0x1fcf12){_0x4ea390[_0xc10a('0x1e')]=_0x1fcf12;if(_0x52e723[_0xc10a('0x2f')][_0xc10a('0x3e')]){_0x141346[_0xc10a('0x3f')]=[{'all':!![]}];}return db[_0xc10a('0x27')][_0xc10a('0x40')](_0x141346);})['then'](function(_0x1f6db8){_0x4ea390['rows']=_0x1f6db8;return _0x4ea390;})[_0xc10a('0x23')](respondWithFilteredResult(_0x554188,_0x141346))[_0xc10a('0x41')](handleError(_0x554188,null));};exports[_0xc10a('0x42')]=function(_0x113869,_0x45b225){var _0xc1215f={'raw':!![],'where':{'id':_0x113869[_0xc10a('0x43')]['id']}},_0x445fdd={};_0x445fdd[_0xc10a('0x2c')]=_['keys'](db[_0xc10a('0x27')][_0xc10a('0x28')]);_0x445fdd[_0xc10a('0x2f')]=_[_0xc10a('0x30')](_0x113869[_0xc10a('0x2f')]);_0x445fdd[_0xc10a('0x31')]=_[_0xc10a('0x32')](_0x445fdd[_0xc10a('0x2c')],_0x445fdd[_0xc10a('0x2f')]);_0xc1215f['attributes']=_['intersection'](_0x445fdd[_0xc10a('0x2c')],qs['fields'](_0x113869[_0xc10a('0x2f')][_0xc10a('0x33')]));_0xc1215f[_0xc10a('0x34')]=_0xc1215f['attributes']['length']?_0xc1215f['attributes']:_0x445fdd[_0xc10a('0x2c')];if(_0x113869[_0xc10a('0x2f')]['includeAll']){_0xc1215f[_0xc10a('0x3f')]=[{'all':!![]}];}_0xc1215f=_[_0xc10a('0x3b')]({},_0xc1215f,_0x113869[_0xc10a('0x44')]);return db['OpenchannelApplication'][_0xc10a('0x45')](_0xc1215f)[_0xc10a('0x23')](handleEntityNotFound(_0x45b225,null))[_0xc10a('0x23')](respondWithResult(_0x45b225,null))['catch'](handleError(_0x45b225,null));};exports[_0xc10a('0x46')]=function(_0xca80e5,_0x22e8cd){return db[_0xc10a('0x27')][_0xc10a('0x46')](_0xca80e5['body'],{})[_0xc10a('0x23')](respondWithResult(_0x22e8cd,0xc9))[_0xc10a('0x41')](handleError(_0x22e8cd,null));};exports[_0xc10a('0x22')]=function(_0x40073b,_0x193b3b){if(_0x40073b[_0xc10a('0x47')]['id']){delete _0x40073b[_0xc10a('0x47')]['id'];}return db[_0xc10a('0x27')]['find']({'where':{'id':_0x40073b[_0xc10a('0x43')]['id']}})[_0xc10a('0x23')](handleEntityNotFound(_0x193b3b,null))[_0xc10a('0x23')](saveUpdates(_0x40073b['body'],null))['then'](respondWithResult(_0x193b3b,null))[_0xc10a('0x41')](handleError(_0x193b3b,null));};exports[_0xc10a('0x24')]=function(_0x5b13e6,_0x3ed22f){return db[_0xc10a('0x27')]['find']({'where':{'id':_0x5b13e6['params']['id']}})[_0xc10a('0x23')](handleEntityNotFound(_0x3ed22f,null))[_0xc10a('0x23')](removeEntity(_0x3ed22f,null))[_0xc10a('0x41')](handleError(_0x3ed22f,null));}; \ No newline at end of file +var _0x5e0d=['request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','name','send','map','OpenchannelApplication','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5e0d,0x118));var _0xd5e0=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x5e0d[_0x460150];return _0x340677;};'use strict';var emlformat=require(_0xd5e0('0x0'));var rimraf=require(_0xd5e0('0x1'));var zipdir=require(_0xd5e0('0x2'));var jsonpatch=require(_0xd5e0('0x3'));var rp=require(_0xd5e0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd5e0('0x5'));var util=require(_0xd5e0('0x6'));var path=require(_0xd5e0('0x7'));var sox=require(_0xd5e0('0x8'));var csv=require(_0xd5e0('0x9'));var ejs=require(_0xd5e0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5e0('0xb'));var squel=require(_0xd5e0('0xc'));var crypto=require(_0xd5e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd5e0('0xe'));var toCsv=require(_0xd5e0('0x9'));var querystring=require(_0xd5e0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd5e0('0x10'));var qs=require(_0xd5e0('0x11'));var as=require(_0xd5e0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5e0('0x13'))('api');var utils=require(_0xd5e0('0x14'));var config=require(_0xd5e0('0x15'));var licenseUtil=require(_0xd5e0('0x16'));var db=require(_0xd5e0('0x17'))['db'];function respondWithStatusCode(_0x2f2e19,_0x3fa083){_0x3fa083=_0x3fa083||0xcc;return function(_0x19fe23){if(_0x19fe23){return _0x2f2e19[_0xd5e0('0x18')](_0x3fa083);}return _0x2f2e19[_0xd5e0('0x19')](_0x3fa083)[_0xd5e0('0x1a')]();};}function respondWithResult(_0x5843a3,_0x236bda){_0x236bda=_0x236bda||0xc8;return function(_0x32a81d){if(_0x32a81d){return _0x5843a3['status'](_0x236bda)[_0xd5e0('0x1b')](_0x32a81d);}};}function respondWithFilteredResult(_0x24a3ff,_0x221a52){return function(_0x11eb2e){if(_0x11eb2e){var _0x3081cc=typeof _0x221a52[_0xd5e0('0x1c')]==='undefined'&&typeof _0x221a52[_0xd5e0('0x1d')]===_0xd5e0('0x1e');var _0x5e8f5b=_0x11eb2e[_0xd5e0('0x1f')];var _0x26246c=_0x3081cc?0x0:_0x221a52[_0xd5e0('0x1c')];var _0xdce041=_0x3081cc?_0x11eb2e[_0xd5e0('0x1f')]:_0x221a52[_0xd5e0('0x1c')]+_0x221a52['limit'];var _0x272f9d;if(_0xdce041>=_0x5e8f5b){_0xdce041=_0x5e8f5b;_0x272f9d=0xc8;}else{_0x272f9d=0xce;}_0x24a3ff['status'](_0x272f9d);return _0x24a3ff[_0xd5e0('0x20')](_0xd5e0('0x21'),_0x26246c+'-'+_0xdce041+'/'+_0x5e8f5b)['json'](_0x11eb2e);}return null;};}function patchUpdates(_0x49bf51){return function(_0x125776){try{jsonpatch['apply'](_0x125776,_0x49bf51,!![]);}catch(_0x36da4a){return BPromise[_0xd5e0('0x22')](_0x36da4a);}return _0x125776['save']();};}function saveUpdates(_0x4c9988,_0x2efcee){return function(_0x12bdb4){if(_0x12bdb4){return _0x12bdb4['update'](_0x4c9988)[_0xd5e0('0x23')](function(_0xf07ce1){return _0xf07ce1;});}return null;};}function removeEntity(_0x31ae1f,_0x11e5d6){return function(_0x14ef8f){if(_0x14ef8f){return _0x14ef8f['destroy']()[_0xd5e0('0x23')](function(){_0x31ae1f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b027,_0x4a3b78){return function(_0x392e6f){if(!_0x392e6f){_0x17b027[_0xd5e0('0x18')](0x194);}return _0x392e6f;};}function handleError(_0x359a20,_0x43d14c){_0x43d14c=_0x43d14c||0x1f4;return function(_0xf94a46){logger['error'](_0xf94a46['stack']);if(_0xf94a46[_0xd5e0('0x24')]){delete _0xf94a46[_0xd5e0('0x24')];}_0x359a20['status'](_0x43d14c)[_0xd5e0('0x25')](_0xf94a46);};}exports['index']=function(_0x1374d7,_0x534df7){var _0x27700d={},_0x4ea488={},_0x453e0f={'count':0x0,'rows':[]};var _0xad5e02=_[_0xd5e0('0x26')](db[_0xd5e0('0x27')]['rawAttributes'],function(_0x4dfa11){return{'name':_0x4dfa11[_0xd5e0('0x28')],'type':_0x4dfa11[_0xd5e0('0x29')][_0xd5e0('0x2a')]};});_0x4ea488[_0xd5e0('0x2b')]=_['map'](_0xad5e02,_0xd5e0('0x24'));_0x4ea488[_0xd5e0('0x2c')]=_['keys'](_0x1374d7['query']);_0x4ea488[_0xd5e0('0x2d')]=_[_0xd5e0('0x2e')](_0x4ea488['model'],_0x4ea488[_0xd5e0('0x2c')]);_0x27700d['attributes']=_[_0xd5e0('0x2e')](_0x4ea488[_0xd5e0('0x2b')],qs[_0xd5e0('0x2f')](_0x1374d7['query']['fields']));_0x27700d[_0xd5e0('0x30')]=_0x27700d[_0xd5e0('0x30')][_0xd5e0('0x31')]?_0x27700d[_0xd5e0('0x30')]:_0x4ea488['model'];if(!_0x1374d7[_0xd5e0('0x2c')][_0xd5e0('0x32')](_0xd5e0('0x33'))){_0x27700d[_0xd5e0('0x1d')]=qs['limit'](_0x1374d7[_0xd5e0('0x2c')]['limit']);_0x27700d['offset']=qs['offset'](_0x1374d7['query'][_0xd5e0('0x1c')]);}_0x27700d['order']=qs[_0xd5e0('0x34')](_0x1374d7[_0xd5e0('0x2c')][_0xd5e0('0x34')]);_0x27700d[_0xd5e0('0x35')]=qs[_0xd5e0('0x2d')](_[_0xd5e0('0x36')](_0x1374d7['query'],_0x4ea488[_0xd5e0('0x2d')]),_0xad5e02);if(_0x1374d7['query']['filter']){_0x27700d['where']=_['merge'](_0x27700d['where'],{'$or':_['map'](_0xad5e02,function(_0x177657){if(_0x177657['type']!==_0xd5e0('0x37')){var _0xc2377c={};_0xc2377c[_0x177657[_0xd5e0('0x24')]]={'$like':'%'+_0x1374d7[_0xd5e0('0x2c')]['filter']+'%'};return _0xc2377c;}})});}_0x27700d=_[_0xd5e0('0x38')]({},_0x27700d,_0x1374d7['options']);var _0x4131ee={'where':_0x27700d[_0xd5e0('0x35')]};return db[_0xd5e0('0x27')][_0xd5e0('0x1f')](_0x4131ee)[_0xd5e0('0x23')](function(_0x528077){_0x453e0f[_0xd5e0('0x1f')]=_0x528077;if(_0x1374d7[_0xd5e0('0x2c')][_0xd5e0('0x39')]){_0x27700d[_0xd5e0('0x3a')]=[{'all':!![]}];}return db[_0xd5e0('0x27')][_0xd5e0('0x3b')](_0x27700d);})['then'](function(_0x5066bb){_0x453e0f[_0xd5e0('0x3c')]=_0x5066bb;return _0x453e0f;})[_0xd5e0('0x23')](respondWithFilteredResult(_0x534df7,_0x27700d))[_0xd5e0('0x3d')](handleError(_0x534df7,null));};exports[_0xd5e0('0x3e')]=function(_0x5a82ef,_0x32faac){var _0x3fdd1c={'raw':!![],'where':{'id':_0x5a82ef[_0xd5e0('0x3f')]['id']}},_0x3ac356={};_0x3ac356[_0xd5e0('0x2b')]=_[_0xd5e0('0x40')](db[_0xd5e0('0x27')]['rawAttributes']);_0x3ac356[_0xd5e0('0x2c')]=_['keys'](_0x5a82ef[_0xd5e0('0x2c')]);_0x3ac356['filters']=_[_0xd5e0('0x2e')](_0x3ac356[_0xd5e0('0x2b')],_0x3ac356[_0xd5e0('0x2c')]);_0x3fdd1c[_0xd5e0('0x30')]=_[_0xd5e0('0x2e')](_0x3ac356['model'],qs[_0xd5e0('0x2f')](_0x5a82ef['query'][_0xd5e0('0x2f')]));_0x3fdd1c[_0xd5e0('0x30')]=_0x3fdd1c[_0xd5e0('0x30')][_0xd5e0('0x31')]?_0x3fdd1c[_0xd5e0('0x30')]:_0x3ac356[_0xd5e0('0x2b')];if(_0x5a82ef[_0xd5e0('0x2c')]['includeAll']){_0x3fdd1c[_0xd5e0('0x3a')]=[{'all':!![]}];}_0x3fdd1c=_[_0xd5e0('0x38')]({},_0x3fdd1c,_0x5a82ef[_0xd5e0('0x41')]);return db[_0xd5e0('0x27')][_0xd5e0('0x42')](_0x3fdd1c)[_0xd5e0('0x23')](handleEntityNotFound(_0x32faac,null))[_0xd5e0('0x23')](respondWithResult(_0x32faac,null))[_0xd5e0('0x3d')](handleError(_0x32faac,null));};exports[_0xd5e0('0x43')]=function(_0x585186,_0x4b42c3){return db[_0xd5e0('0x27')][_0xd5e0('0x43')](_0x585186['body'],{})[_0xd5e0('0x23')](respondWithResult(_0x4b42c3,0xc9))[_0xd5e0('0x3d')](handleError(_0x4b42c3,null));};exports[_0xd5e0('0x44')]=function(_0xac3bc4,_0x2d19b2){if(_0xac3bc4[_0xd5e0('0x45')]['id']){delete _0xac3bc4[_0xd5e0('0x45')]['id'];}return db[_0xd5e0('0x27')][_0xd5e0('0x42')]({'where':{'id':_0xac3bc4[_0xd5e0('0x3f')]['id']}})[_0xd5e0('0x23')](handleEntityNotFound(_0x2d19b2,null))[_0xd5e0('0x23')](saveUpdates(_0xac3bc4['body'],null))[_0xd5e0('0x23')](respondWithResult(_0x2d19b2,null))[_0xd5e0('0x3d')](handleError(_0x2d19b2,null));};exports[_0xd5e0('0x46')]=function(_0x44b60e,_0x4ba136){return db[_0xd5e0('0x27')][_0xd5e0('0x42')]({'where':{'id':_0x44b60e['params']['id']}})[_0xd5e0('0x23')](handleEntityNotFound(_0x4ba136,null))[_0xd5e0('0x23')](removeEntity(_0x4ba136,null))[_0xd5e0('0x3d')](handleError(_0x4ba136,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index f036106..0b587a1 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 _0x2706=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','OpenchannelApplication','utf8mb4'];(function(_0x5c104a,_0x5c7044){var _0x2807d5=function(_0xefef7e){while(--_0xefef7e){_0x5c104a['push'](_0x5c104a['shift']());}};_0x2807d5(++_0x5c7044);}(_0x2706,0x198));var _0x6270=function(_0x2fed7c,_0x34b7ff){_0x2fed7c=_0x2fed7c-0x0;var _0x3a589d=_0x2706[_0x2fed7c];return _0x3a589d;};'use strict';var _=require('lodash');var util=require(_0x6270('0x0'));var logger=require(_0x6270('0x1'))(_0x6270('0x2'));var moment=require('moment');var BPromise=require(_0x6270('0x3'));var rp=require(_0x6270('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6270('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x6270('0x6')]=function(_0x358f91,_0x595ae0){return _0x358f91[_0x6270('0x7')](_0x6270('0x8'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6270('0x9'),'collate':_0x6270('0xa')});}; \ No newline at end of file +var _0x2748=['define','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x45cc73,_0x290e1e){var _0x4cf623=function(_0x2b2c13){while(--_0x2b2c13){_0x45cc73['push'](_0x45cc73['shift']());}};_0x4cf623(++_0x290e1e);}(_0x2748,0x17c));var _0x8274=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2748[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x8274('0x0'));var util=require(_0x8274('0x1'));var logger=require('../../config/logger')(_0x8274('0x2'));var moment=require(_0x8274('0x3'));var BPromise=require(_0x8274('0x4'));var rp=require(_0x8274('0x5'));var fs=require('fs');var path=require(_0x8274('0x6'));var rimraf=require(_0x8274('0x7'));var config=require(_0x8274('0x8'));var attributes=require(_0x8274('0x9'));module['exports']=function(_0x68833a,_0x57c87b){return _0x68833a[_0x8274('0xa')](_0x8274('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8274('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index b54aeb0..af6e7a2 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 _0xe659=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateOpenchannelApplication','options','raw','where','attributes','then','lodash'];(function(_0x4d6ff0,_0x4232ae){var _0x14928d=function(_0x45ed86){while(--_0x45ed86){_0x4d6ff0['push'](_0x4d6ff0['shift']());}};_0x14928d(++_0x4232ae);}(_0xe659,0x19f));var _0x9e65=function(_0x21cf80,_0x1fb0a1){_0x21cf80=_0x21cf80-0x0;var _0x5c6bed=_0xe659[_0x21cf80];return _0x5c6bed;};'use strict';var _=require(_0x9e65('0x0'));var util=require(_0x9e65('0x1'));var moment=require(_0x9e65('0x2'));var BPromise=require(_0x9e65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e65('0x4'))['db'];var utils=require(_0x9e65('0x5'));var logger=require(_0x9e65('0x6'))('rpc');var config=require(_0x9e65('0x7'));var jayson=require(_0x9e65('0x8'));var client=jayson[_0x9e65('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5f72,_0x29bc45,_0x13b65f){return new BPromise(function(_0x317d9d,_0x2405e2){return client['request'](_0x1b5f72,_0x13b65f)['then'](function(_0x307531){logger['info'](_0x9e65('0xa'),_0x29bc45,'request\x20sent');logger['debug'](_0x9e65('0xb'),_0x29bc45,_0x9e65('0xc'),JSON[_0x9e65('0xd')](_0x307531));if(_0x307531[_0x9e65('0xe')]){if(_0x307531['error'][_0x9e65('0xf')]===0x1f4){logger['error'](_0x9e65('0xa'),_0x29bc45,_0x307531['error'][_0x9e65('0x10')]);return _0x2405e2(_0x307531['error'][_0x9e65('0x10')]);}logger['error'](_0x9e65('0xa'),_0x29bc45,_0x307531[_0x9e65('0xe')][_0x9e65('0x10')]);return _0x317d9d(_0x307531[_0x9e65('0xe')][_0x9e65('0x10')]);}else{logger[_0x9e65('0x11')](_0x9e65('0xa'),_0x29bc45,_0x9e65('0xc'));_0x317d9d(_0x307531[_0x9e65('0x12')][_0x9e65('0x10')]);}})[_0x9e65('0x13')](function(_0x25b8c2){logger[_0x9e65('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x29bc45,_0x25b8c2);_0x2405e2(_0x25b8c2);});});}exports[_0x9e65('0x14')]=function(_0x3bdd9a){var _0x17dcf4=this;return new Promise(function(_0x365dd7,_0xf8c1a){return db['OpenchannelApplication']['update'](_0x3bdd9a['body'],{'raw':_0x3bdd9a['options']?_0x3bdd9a[_0x9e65('0x15')][_0x9e65('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bdd9a[_0x9e65('0x15')]?_0x3bdd9a['options'][_0x9e65('0x17')]||null:null,'attributes':_0x3bdd9a['options']?_0x3bdd9a['options'][_0x9e65('0x18')]||null:null,'limit':_0x3bdd9a[_0x9e65('0x15')]?_0x3bdd9a['options']['limit']||null:null})[_0x9e65('0x19')](function(_0x1ecaaf){logger[_0x9e65('0x11')](_0x9e65('0x14'),_0x3bdd9a);logger['debug'](_0x9e65('0x14'),_0x3bdd9a,JSON[_0x9e65('0xd')](_0x1ecaaf));_0x365dd7(_0x1ecaaf);})[_0x9e65('0x13')](function(_0xa9ae06){logger[_0x9e65('0xe')](_0x9e65('0x14'),_0xa9ae06['message'],_0x3bdd9a);_0xf8c1a(_0x17dcf4[_0x9e65('0xe')](0x1f4,_0xa9ae06[_0x9e65('0x10')]));});});}; \ No newline at end of file +var _0xe10f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','util','moment','randomstring'];(function(_0x39299c,_0x4a3fe7){var _0x38553b=function(_0x574661){while(--_0x574661){_0x39299c['push'](_0x39299c['shift']());}};_0x38553b(++_0x4a3fe7);}(_0xe10f,0x126));var _0xfe10=function(_0x23cb1f,_0x3bc2c6){_0x23cb1f=_0x23cb1f-0x0;var _0x233091=_0xe10f[_0x23cb1f];return _0x233091;};'use strict';var _=require('lodash');var util=require(_0xfe10('0x0'));var moment=require(_0xfe10('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe10('0x2'));var fs=require('fs');var Redis=require(_0xfe10('0x3'));var db=require(_0xfe10('0x4'))['db'];var utils=require(_0xfe10('0x5'));var logger=require(_0xfe10('0x6'))(_0xfe10('0x7'));var config=require(_0xfe10('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfe10('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2176c6,_0x189af4,_0x115e25){return new BPromise(function(_0x2e8410,_0x2ec922){return client['request'](_0x2176c6,_0x115e25)['then'](function(_0xa810f6){logger[_0xfe10('0xa')](_0xfe10('0xb'),_0x189af4,'request\x20sent');logger[_0xfe10('0xc')](_0xfe10('0xd'),_0x189af4,_0xfe10('0xe'),JSON[_0xfe10('0xf')](_0xa810f6));if(_0xa810f6['error']){if(_0xa810f6[_0xfe10('0x10')][_0xfe10('0x11')]===0x1f4){logger[_0xfe10('0x10')](_0xfe10('0xb'),_0x189af4,_0xa810f6[_0xfe10('0x10')]['message']);return _0x2ec922(_0xa810f6['error'][_0xfe10('0x12')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x189af4,_0xa810f6[_0xfe10('0x10')]['message']);return _0x2e8410(_0xa810f6[_0xfe10('0x10')][_0xfe10('0x12')]);}else{logger[_0xfe10('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x189af4,_0xfe10('0xe'));_0x2e8410(_0xa810f6['result'][_0xfe10('0x12')]);}})[_0xfe10('0x13')](function(_0x1cf984){logger[_0xfe10('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x189af4,_0x1cf984);_0x2ec922(_0x1cf984);});});}exports[_0xfe10('0x14')]=function(_0x2e34bf){var _0x46fd1e=this;return new Promise(function(_0x154607,_0x2e1723){return db[_0xfe10('0x15')][_0xfe10('0x16')](_0x2e34bf[_0xfe10('0x17')],{'raw':_0x2e34bf['options']?_0x2e34bf[_0xfe10('0x18')][_0xfe10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e34bf['options']?_0x2e34bf[_0xfe10('0x18')]['where']||null:null,'attributes':_0x2e34bf[_0xfe10('0x18')]?_0x2e34bf[_0xfe10('0x18')][_0xfe10('0x1a')]||null:null,'limit':_0x2e34bf[_0xfe10('0x18')]?_0x2e34bf[_0xfe10('0x18')]['limit']||null:null})['then'](function(_0x103609){logger[_0xfe10('0xa')]('UpdateOpenchannelApplication',_0x2e34bf);logger[_0xfe10('0xc')]('UpdateOpenchannelApplication',_0x2e34bf,JSON['stringify'](_0x103609));_0x154607(_0x103609);})['catch'](function(_0x3eb1a4){logger[_0xfe10('0x10')](_0xfe10('0x14'),_0x3eb1a4[_0xfe10('0x12')],_0x2e34bf);_0x2e1723(_0x46fd1e[_0xfe10('0x10')](0x1f4,_0x3eb1a4['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 5355006..a157e34 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 _0x1abb=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout'];(function(_0x236555,_0x22d3d9){var _0x421aa8=function(_0x5f3f1f){while(--_0x5f3f1f){_0x236555['push'](_0x236555['shift']());}};_0x421aa8(++_0x22d3d9);}(_0x1abb,0x174));var _0xb1ab=function(_0x4e2bc3,_0x39fd32){_0x4e2bc3=_0x4e2bc3-0x0;var _0x42c929=_0x1abb[_0x4e2bc3];return _0x42c929;};'use strict';var multer=require(_0xb1ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb1ab('0x1'));var express=require(_0xb1ab('0x2'));var router=express['Router']();var fs_extra=require(_0xb1ab('0x3'));var auth=require(_0xb1ab('0x4'));var interaction=require(_0xb1ab('0x5'));var config=require(_0xb1ab('0x6'));var controller=require(_0xb1ab('0x7'));router['get']('/',auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x9')]);router[_0xb1ab('0xa')](_0xb1ab('0xb'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0xc')]);router[_0xb1ab('0xa')](_0xb1ab('0xd'),auth['isAuthenticated'](),controller[_0xb1ab('0xe')]);router['get'](_0xb1ab('0xf'),auth['isAuthenticated'](),controller[_0xb1ab('0x10')]);router[_0xb1ab('0xa')](_0xb1ab('0x11'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x12')]);router['post']('/',auth[_0xb1ab('0x8')](),controller['create']);router[_0xb1ab('0x13')](_0xb1ab('0xf'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x14')]);router[_0xb1ab('0x13')](_0xb1ab('0x15'),auth[_0xb1ab('0x8')](),interaction[_0xb1ab('0x16')](_0xb1ab('0x17'),_0xb1ab('0x18')),controller[_0xb1ab('0x19')]);router[_0xb1ab('0x1a')](_0xb1ab('0xd'),auth[_0xb1ab('0x8')](),interaction[_0xb1ab('0x16')](_0xb1ab('0x17'),_0xb1ab('0x1b')),controller[_0xb1ab('0x1c')]);router[_0xb1ab('0x1d')]('/:id',auth['isAuthenticated'](),interaction[_0xb1ab('0x16')](_0xb1ab('0x17'),_0xb1ab('0x1e')),controller[_0xb1ab('0x1f')]);router[_0xb1ab('0x1d')](_0xb1ab('0x15'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x20')]);module[_0xb1ab('0x21')]=router; \ No newline at end of file +var _0x2808=['isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','openchannel','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x1807ef,_0x54661a){var _0x39d549=function(_0x111f33){while(--_0x111f33){_0x1807ef['push'](_0x1807ef['shift']());}};_0x39d549(++_0x54661a);}(_0x2808,0xa4));var _0x8280=function(_0xbd3486,_0x3db89a){_0xbd3486=_0xbd3486-0x0;var _0x4916f0=_0x2808[_0xbd3486];return _0x4916f0;};'use strict';var multer=require(_0x8280('0x0'));var util=require('util');var path=require(_0x8280('0x1'));var timeout=require(_0x8280('0x2'));var express=require(_0x8280('0x3'));var router=express[_0x8280('0x4')]();var fs_extra=require(_0x8280('0x5'));var auth=require(_0x8280('0x6'));var interaction=require(_0x8280('0x7'));var config=require(_0x8280('0x8'));var controller=require(_0x8280('0x9'));router[_0x8280('0xa')]('/',auth[_0x8280('0xb')](),controller[_0x8280('0xc')]);router[_0x8280('0xa')](_0x8280('0xd'),auth[_0x8280('0xb')](),controller[_0x8280('0xe')]);router[_0x8280('0xa')](_0x8280('0xf'),auth[_0x8280('0xb')](),controller[_0x8280('0x10')]);router[_0x8280('0xa')]('/:id/messages',auth[_0x8280('0xb')](),controller[_0x8280('0x11')]);router['get'](_0x8280('0x12'),auth['isAuthenticated'](),controller[_0x8280('0x13')]);router[_0x8280('0x14')]('/',auth[_0x8280('0xb')](),controller[_0x8280('0x15')]);router[_0x8280('0x14')](_0x8280('0x16'),auth[_0x8280('0xb')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x8280('0xb')](),interaction['tracked']('openchannel',_0x8280('0x17')),controller[_0x8280('0x18')]);router[_0x8280('0x19')](_0x8280('0xf'),auth[_0x8280('0xb')](),interaction[_0x8280('0x1a')]('openchannel',_0x8280('0x1b')),controller[_0x8280('0x1c')]);router[_0x8280('0x1d')](_0x8280('0xf'),auth[_0x8280('0xb')](),interaction[_0x8280('0x1a')](_0x8280('0x1e'),_0x8280('0x1f')),controller[_0x8280('0x20')]);router['delete']('/:id/tags',auth[_0x8280('0xb')](),controller[_0x8280('0x21')]);module[_0x8280('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 50faf14..cda8c05 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 _0x567c=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x34a264,_0xb769e3){var _0xeb4173=function(_0x474094){while(--_0x474094){_0x34a264['push'](_0x34a264['shift']());}};_0xeb4173(++_0xb769e3);}(_0x567c,0x8d));var _0xc567=function(_0x4b14f2,_0x54a0d2){_0x4b14f2=_0x4b14f2-0x0;var _0x269390=_0x567c[_0x4b14f2];return _0x269390;};'use strict';var Sequelize=require(_0xc567('0x0'));module[_0xc567('0x1')]={'closed':{'type':Sequelize[_0xc567('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc567('0x3')]},'disposition':{'type':Sequelize[_0xc567('0x4')]},'secondDisposition':{'type':Sequelize[_0xc567('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc567('0x4')]},'note':{'type':Sequelize[_0xc567('0x4')]},'read1stAt':{'type':Sequelize[_0xc567('0x3')]},'threadId':{'type':Sequelize[_0xc567('0x4')]},'externalUrl':{'type':Sequelize[_0xc567('0x4')]},'lastMsgAt':{'type':Sequelize[_0xc567('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc567('0x5')]('in',_0xc567('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc567('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xc567('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x28a0=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x28a0,0x8a));var _0x028a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x28a0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x028a('0x0'));module['exports']={'closed':{'type':Sequelize[_0x028a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x028a('0x2')]},'disposition':{'type':Sequelize[_0x028a('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x028a('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x028a('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x028a('0x4')]('in',_0x028a('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x028a('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x028a('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 1bb2b72..7d67e5e 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 _0x6896=['getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','includeAll','merge','create','update','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','rawAttributes','pick','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','join','root','server','files','tmp','format','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Messages','createdAt','secret','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','Attachment','basename','existsSync','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','direction','out','System','transcript-','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','field','color','tools_tags','select','u.id','ui.OpenchannelInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','order','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0x6896,0x142));var _0x6689=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6896[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x6689('0x0'));var rimraf=require(_0x6689('0x1'));var zipdir=require(_0x6689('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6689('0x3'));var moment=require('moment');var BPromise=require(_0x6689('0x4'));var Mustache=require(_0x6689('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6689('0x6'));var csv=require(_0x6689('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6689('0x8'));var _=require(_0x6689('0x9'));var squel=require(_0x6689('0xa'));var crypto=require(_0x6689('0xb'));var jsforce=require(_0x6689('0xc'));var deskjs=require(_0x6689('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6689('0xe'));var Papa=require(_0x6689('0xf'));var Redis=require('ioredis');var authService=require(_0x6689('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6689('0x11'));var pdf=require(_0x6689('0x12'));var hardwareService=require(_0x6689('0x13'));var logger=require(_0x6689('0x14'))(_0x6689('0x15'));var utils=require(_0x6689('0x16'));var config=require(_0x6689('0x17'));var licenseUtil=require(_0x6689('0x18'));var db=require(_0x6689('0x19'))['db'];config[_0x6689('0x1a')]=_['defaults'](config[_0x6689('0x1a')],{'host':_0x6689('0x1b'),'port':0x18eb});var socket=require(_0x6689('0x1c'))(new Redis(config[_0x6689('0x1a')]));require('./openchannelInteraction.socket')[_0x6689('0x1d')](socket);function respondWithStatusCode(_0x2ed5bc,_0x5d0091){_0x5d0091=_0x5d0091||0xcc;return function(_0x411ba2){if(_0x411ba2){return _0x2ed5bc[_0x6689('0x1e')](_0x5d0091);}return _0x2ed5bc['status'](_0x5d0091)[_0x6689('0x1f')]();};}function respondWithResult(_0x126217,_0x3e0f21){_0x3e0f21=_0x3e0f21||0xc8;return function(_0x49cdb0){if(_0x49cdb0){return _0x126217[_0x6689('0x20')](_0x3e0f21)['json'](_0x49cdb0);}};}function respondWithFilteredResult(_0x3c59ec,_0x353856){return function(_0x3deef9){if(_0x3deef9){var _0x8bce1f=typeof _0x353856[_0x6689('0x21')]===_0x6689('0x22')&&typeof _0x353856[_0x6689('0x23')]===_0x6689('0x22');var _0x2ba21a=_0x3deef9[_0x6689('0x24')];var _0x1b52cc=_0x8bce1f?0x0:_0x353856[_0x6689('0x21')];var _0x2521b1=_0x8bce1f?_0x3deef9[_0x6689('0x24')]:_0x353856[_0x6689('0x21')]+_0x353856[_0x6689('0x23')];var _0x3c19a2;if(_0x2521b1>=_0x2ba21a){_0x2521b1=_0x2ba21a;_0x3c19a2=0xc8;}else{_0x3c19a2=0xce;}_0x3c59ec['status'](_0x3c19a2);return _0x3c59ec[_0x6689('0x25')](_0x6689('0x26'),_0x1b52cc+'-'+_0x2521b1+'/'+_0x2ba21a)[_0x6689('0x27')](_0x3deef9);}return null;};}function patchUpdates(_0x209224){return function(_0x2bfd80){try{jsonpatch['apply'](_0x2bfd80,_0x209224,!![]);}catch(_0x10a5b0){return BPromise[_0x6689('0x28')](_0x10a5b0);}return _0x2bfd80[_0x6689('0x29')]();};}function saveUpdates(_0x1b209d,_0x5da91a){return function(_0x1c8639){if(_0x1c8639){return _0x1c8639['update'](_0x1b209d)[_0x6689('0x2a')](function(_0x1e00d8){return _0x1e00d8;});}return null;};}function removeEntity(_0xd2a5e0,_0x4da314){return function(_0x4c2706){if(_0x4c2706){return _0x4c2706[_0x6689('0x2b')]()[_0x6689('0x2a')](function(){_0xd2a5e0[_0x6689('0x20')](0xcc)[_0x6689('0x1f')]();});}};}function handleEntityNotFound(_0xb8dec8,_0x5aec23){return function(_0x427a8f){if(!_0x427a8f){_0xb8dec8[_0x6689('0x1e')](0x194);}return _0x427a8f;};}function handleError(_0x583c26,_0x21e3c1){_0x21e3c1=_0x21e3c1||0x1f4;return function(_0x1e280d){logger[_0x6689('0x2c')](_0x1e280d[_0x6689('0x2d')]);if(_0x1e280d[_0x6689('0x2e')]){delete _0x1e280d[_0x6689('0x2e')];}_0x583c26['status'](_0x21e3c1)[_0x6689('0x2f')](_0x1e280d);};}function getInteractionUsers(_0x1fd771,_0x2088ae){return new BPromise(function(_0x5b3b4f,_0x161e99){try{if(_0x2088ae[_0x1fd771['id']]){_0x1fd771[_0x6689('0x30')]=_['map'](_0x2088ae[_0x1fd771['id']],function(_0x39cfd9){return{'id':_0x39cfd9['id'],'fullname':_0x39cfd9[_0x6689('0x31')]};});}}catch(_0x19e799){_0x161e99(_0x19e799);}_0x5b3b4f(_0x1fd771);});}function getInteractionTags(_0x45696f,_0x3399b6){return new BPromise(function(_0x51dff4,_0x2759ff){try{if(_0x45696f[_0x6689('0x32')]){_0x45696f[_0x6689('0x33')]=[];_0x45696f[_0x6689('0x32')][_0x6689('0x34')](',')[_0x6689('0x35')](function(_0x4518af){_0x45696f['Tags'][_0x6689('0x36')](_0x3399b6[_0x4518af]);});}delete _0x45696f[_0x6689('0x32')];}catch(_0x165375){_0x2759ff(_0x165375);}_0x51dff4(_0x45696f);});}function updateOpenchannelInteraction(_0x19885c,_0x11a0d8,_0x4997e7){return new BPromise(function(_0x5b534a,_0x1f64e0){return getInteractionUsers(_0x19885c,_0x4997e7)['then'](function(_0x31e37c){return getInteractionTags(_0x31e37c,_0x11a0d8);})['then'](function(_0x2ac1f1){_0x5b534a(_0x2ac1f1);})[_0x6689('0x37')](function(_0x573fba){_0x1f64e0(_0x573fba);});});}exports[_0x6689('0x38')]=function(_0x176466,_0x2f69b9){var _0x291537={},_0x5f2e30={},_0x3891f5={'count':0x0,'rows':[]};var _0x3d3fa2=_['map'](db[_0x6689('0x39')]['rawAttributes'],function(_0x28bc9b){return{'name':_0x28bc9b[_0x6689('0x3a')],'type':_0x28bc9b[_0x6689('0x3b')][_0x6689('0x3c')]};});_0x5f2e30[_0x6689('0x3d')]=_[_0x6689('0x3e')](_0x3d3fa2,'name');_0x5f2e30['query']=_[_0x6689('0x3f')](_0x176466['query']);_0x5f2e30[_0x6689('0x40')]=_['intersection'](_0x5f2e30[_0x6689('0x3d')],_0x5f2e30[_0x6689('0x41')]);_0x291537[_0x6689('0x42')]=_[_0x6689('0x43')](_0x5f2e30[_0x6689('0x3d')],qs[_0x6689('0x44')](_0x176466[_0x6689('0x41')][_0x6689('0x44')]));_0x291537[_0x6689('0x42')]=_0x291537[_0x6689('0x42')][_0x6689('0x45')]?_0x291537[_0x6689('0x42')]:_0x5f2e30['model'];if(!_0x176466['query'][_0x6689('0x46')](_0x6689('0x47'))){_0x291537['limit']=qs[_0x6689('0x23')](_0x176466[_0x6689('0x41')][_0x6689('0x23')]);_0x291537[_0x6689('0x21')]=qs[_0x6689('0x21')](_0x176466[_0x6689('0x41')]['offset']);}_0x291537['order']=qs['sort'](_0x176466[_0x6689('0x41')][_0x6689('0x48')]);_0x291537['where']=qs['filters'](_['pick'](_0x176466[_0x6689('0x41')],_0x5f2e30[_0x6689('0x40')]),_0x3d3fa2);var _0x84a310=[];var _0x1076c0=squel['select']()['field']('id')[_0x6689('0x49')]('name')[_0x6689('0x49')](_0x6689('0x4a'))['from'](_0x6689('0x4b'));var _0x18326e=squel[_0x6689('0x4c')]()['field'](_0x6689('0x4d'))[_0x6689('0x49')]('u.fullname')[_0x6689('0x49')](_0x6689('0x4e'))[_0x6689('0x4f')]('user_has_openchannel_interactions','ui')[_0x6689('0x50')](_0x6689('0x51'),'u',_0x6689('0x52'));var _0x167954=squel[_0x6689('0x4c')]()[_0x6689('0x4f')]('openchannel_interactions','i')['left_join'](_0x6689('0x53'),'c',_0x6689('0x54'))[_0x6689('0x50')](_0x6689('0x51'),'o',_0x6689('0x55'))[_0x6689('0x50')](_0x6689('0x56'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x6689('0x50')]('openchannel_messages','me',_0x6689('0x57'))[_0x6689('0x50')](_0x6689('0x58'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x6689('0x50')]('tools_tags','t',_0x6689('0x59'));var _0x1eb7fd=squel[_0x6689('0x5a')]();var _0x282b68=[];var _0xf4eef9=squel[_0x6689('0x5a')]();var _0x32f369;if(_0x176466[_0x6689('0x41')]['search']){_0x32f369=as[_0x6689('0x5b')](_0x176466['query'][_0x6689('0x5c')]);var _0x1c8be7=_0x32f369[_0x6689('0x5d')];for(var _0x5957dd=0x0;_0x5957dd<_0x32f369['conditions']['length'];_0x5957dd++){var _0x245129=_0x32f369['conditions'][_0x5957dd];var _0x2a7469='i';var _0x226521=_['find'](_0x3d3fa2,['name',_0x245129['field']]);if(!_0x226521){switch(_0x245129[_0x6689('0x49')]){case _0x6689('0x5e'):if(_0x245129[_0x6689('0x5f')]==0x1){_0x167954[_0x6689('0x60')]('`'+_0x245129[_0x6689('0x49')]+'`\x20=\x200');}else{_0x167954[_0x6689('0x60')]('`'+_0x245129['field']+'`\x20>\x200');}break;case _0x6689('0x61'):if(_0x245129[_0x6689('0x62')]===_0x6689('0x63')){if(_0x245129[_0x6689('0x5f')][_0x6689('0x34')]('\x20')[_0x6689('0x45')]>0x1){_0x1eb7fd[_0x1c8be7](_0x6689('0x64'),qs[_0x6689('0x65')](_0x245129['value']),null);}else{var _0x549d22='%'+_0x245129['value']+'%';_0x1eb7fd[_0x1c8be7](_0x6689('0x66'),_0x549d22,_0x549d22,_0x549d22);}}else{_0x226521=_[_0x6689('0x67')](_0x3d3fa2,[_0x6689('0x2e'),_0x6689('0x68')]);_0x245129[_0x6689('0x49')]=_0x6689('0x68');_0x5604e9=as[_0x6689('0x69')](_0x2a7469,_0x226521['type'],_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9[_0x6689('0x6a')],_0x5604e9[_0x6689('0x5f')][_0x6689('0x6b')],_0x5604e9[_0x6689('0x5f')]['end']);}break;case _0x6689('0x6c'):var _0x2ceee7=_0x245129[_0x6689('0x5f')]['split'](',')[_0x6689('0x3e')](function(_0x165148){return Number(_0x165148);});_0x2ceee7[_0x6689('0x35')](function(_0x20ce5b){_0xf4eef9['or'](_0x6689('0x6d'),'%,'+_0x20ce5b+',%');});_0x282b68=_[_0x6689('0x6e')](_0x282b68,_0x2ceee7);break;case _0x6689('0x6f'):if(_0x245129['operator']===_0x6689('0x63')){_0x1eb7fd[_0x1c8be7]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x245129[_0x6689('0x5f')]+'%',null);}else{_0x226521=_[_0x6689('0x67')](_0x3d3fa2,[_0x6689('0x2e'),'UserId']);_0x245129[_0x6689('0x49')]=_0x6689('0x70');_0x5604e9=as[_0x6689('0x69')](_0x2a7469,_0x226521[_0x6689('0x3b')],_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9[_0x6689('0x6a')],_0x5604e9[_0x6689('0x5f')]['start'],_0x5604e9[_0x6689('0x5f')][_0x6689('0x1f')]);}break;case _0x6689('0x71'):_0x5604e9=as[_0x6689('0x69')]('me',null,_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9[_0x6689('0x6a')],_0x5604e9[_0x6689('0x5f')][_0x6689('0x6b')],_0x5604e9[_0x6689('0x5f')]['end']);break;}}else{var _0x5604e9=as['buildExpression'](_0x2a7469,_0x226521['type'],_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9['text'],_0x5604e9[_0x6689('0x5f')][_0x6689('0x6b')],_0x5604e9[_0x6689('0x5f')][_0x6689('0x1f')]);}}}else{var _0x4e6d00=_(_0x176466[_0x6689('0x41')])[_0x6689('0x3f')]()[_0x6689('0x3e')](function(_0x46c22b){return _[_0x6689('0x72')](_0x3d3fa2,[_0x6689('0x2e'),_0x46c22b])?_0x46c22b:undefined;})[_0x6689('0x73')]()['value']();if(!_[_0x6689('0x74')](_0x4e6d00)){_0x4e6d00['forEach'](function(_0xc22b2f){if(_0xc22b2f===_0x6689('0x75')){_0x167954[_0x6689('0x76')](_0x6689('0x77'),[][_0x6689('0x78')](_0x176466[_0x6689('0x41')][_0xc22b2f]));}else if(_0xc22b2f==='createdAt'){var _0x5521b7=JSON['parse'](_0x176466[_0x6689('0x41')][_0xc22b2f])[_0x6689('0x79')];var _0x33aea9=JSON[_0x6689('0x7a')](_0x176466['query'][_0xc22b2f])[_0x6689('0x7b')];_0x167954[_0x6689('0x76')](_0x6689('0x7c'),_0x5521b7,_0x33aea9);}else{if(_0x176466[_0x6689('0x41')][_0xc22b2f]===_0x6689('0x7d')){_0x167954['where']('i.'+_0xc22b2f+'\x20IS\x20NULL');}else{_0x167954[_0x6689('0x76')]('i.'+_0xc22b2f+_0x6689('0x7e'),_0x176466['query'][_0xc22b2f]);}}});}if(_0x176466[_0x6689('0x41')][_0x6689('0x7f')]){if(_0x176466[_0x6689('0x41')][_0x6689('0x7f')]==0x1){_0x167954[_0x6689('0x60')](_0x6689('0x80'));}else{_0x167954[_0x6689('0x60')](_0x6689('0x81'));}}if(_0x176466[_0x6689('0x41')][_0x6689('0x82')]){_0x282b68=_[_0x6689('0x83')](_0x176466[_0x6689('0x41')][_0x6689('0x82')])?_0x176466[_0x6689('0x41')][_0x6689('0x82')]:new Array(_0x176466['query'][_0x6689('0x82')]);_0x282b68[_0x6689('0x35')](function(_0x26d867){_0xf4eef9['or'](_0x6689('0x6d'),'%,'+_0x26d867+',%');});}if(_0x176466['query'][_0x6689('0x84')]){var _0x434b77=_0x176466['query'][_0x6689('0x84')][_0x6689('0x85')]('\x5c','\x5c\x5c')[_0x6689('0x85')](/'/g,'\x27\x27');if(qs[_0x6689('0x86')](_0x434b77)){_0x1eb7fd['or'](_0x6689('0x87'),_0x434b77+'%');}else{_0x1eb7fd['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x434b77))['or'](_0x6689('0x88'),_0x434b77+'%')['or'](_0x6689('0x89'),_0x434b77+'%');}}}_0x167954['where'](_0x1eb7fd);_0x167954[_0x6689('0x8a')](_0x6689('0x8b'));var _0x4a5e0d={'type':db[_0x6689('0x8c')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5ebabd=_0x167954[_0x6689('0x8d')]();_0x5ebabd[_0x6689('0x49')](_0x6689('0x8b'));_0x5ebabd[_0x6689('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x291537[_0x6689('0x8e')]){_0x291537[_0x6689('0x8e')][_0x6689('0x35')](function(_0x4287b5){var _0x6f688b=_0x4287b5[0x0]===_0x6689('0x8f')?_0x4287b5[0x0]:'i.'+_0x4287b5[0x0];_0x167954[_0x6689('0x8e')](_0x6f688b,_0x4287b5[0x1]===_0x6689('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x282b68)){_0x167954[_0x6689('0x60')](_0xf4eef9);_0x5ebabd[_0x6689('0x76')]('t.id\x20IN\x20?',_0x282b68);}BPromise[_0x6689('0x91')]()[_0x6689('0x2a')](function(){if(!_0x32f369){if(_0x176466[_0x6689('0x41')][_0x6689('0x75')])return;_0x5ebabd[_0x6689('0x76')](_0x6689('0x92'));_0x167954['where'](_0x6689('0x92'));return;}if(_0x176466['user'][_0x6689('0x93')]!==_0x6689('0x94'))return;return _0x176466[_0x6689('0x95')][_0x6689('0x96')]({'attributes':['id'],'raw':!![]})[_0x6689('0x2a')](function(_0x4ffc14){if(_[_0x6689('0x74')](_0x4ffc14)){_0x5ebabd[_0x6689('0x76')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x167954['where'](_0x6689('0x97'));}else{_0x5ebabd['where'](_0x6689('0x77'),_['map'](_0x4ffc14,'id'));_0x167954[_0x6689('0x76')](_0x6689('0x77'),_[_0x6689('0x3e')](_0x4ffc14,'id'));}});})[_0x6689('0x2a')](function(){if(_0x176466[_0x6689('0x95')][_0x6689('0x93')]===_0x6689('0x94')&&!_0x32f369&&!_0x176466[_0x6689('0x41')]['OpenchannelAccountId'])return[];return db[_0x6689('0x98')]['query'](_0x5ebabd['toString'](),_0x4a5e0d);})[_0x6689('0x2a')](function(_0x81c8bf){_0x3891f5[_0x6689('0x24')]=_0x81c8bf['length'];if(_0x3891f5['count']===0x0)return[];return db[_0x6689('0x98')][_0x6689('0x41')](_0x1076c0[_0x6689('0x99')](),_0x4a5e0d)[_0x6689('0x2a')](function(_0x454701){_0x84a310=_['keyBy'](_0x454701,'id');_0x4a5e0d=_['merge'](_0x4a5e0d,{'model':db[_0x6689('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x176466[_0x6689('0x41')][_0x6689('0x44')]){_0x291537[_0x6689('0x42')][_0x6689('0x35')](function(_0x1466ff){_0x167954[_0x6689('0x49')]('i.'+_0x1466ff);});}else{_0x167954[_0x6689('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x167954[_0x6689('0x49')](_0x6689('0x9a'),_0x6689('0x9b'));_0x167954['field']('a.mandatoryDisposition',_0x6689('0x9c'));_0x167954['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x6689('0x8f'));_0x167954[_0x6689('0x49')](_0x6689('0x9d'));_0x167954[_0x6689('0x49')](_0x6689('0x9e'),_0x6689('0x9f'));_0x167954[_0x6689('0x49')]('c.lastName','Contact.lastName');_0x167954[_0x6689('0x49')](_0x6689('0xa0'),_0x6689('0xa1'));_0x167954['field']('c.phone',_0x6689('0xa2'));_0x167954[_0x6689('0x49')](_0x6689('0xa3'),_0x6689('0xa4'));_0x167954[_0x6689('0x49')](_0x6689('0xa5'),_0x6689('0xa6'));_0x167954[_0x6689('0x49')](_0x6689('0xa7'),_0x6689('0xa8'));_0x167954[_0x6689('0x49')](_0x6689('0xa9'),_0x6689('0xaa'));_0x167954[_0x6689('0x49')](_0x6689('0xab'),_0x6689('0x32'));}if(_0x291537[_0x6689('0x23')])_0x167954[_0x6689('0x23')](_0x291537['limit']);if(_0x291537[_0x6689('0x21')])_0x167954[_0x6689('0x21')](_0x291537[_0x6689('0x21')]);return db[_0x6689('0x98')][_0x6689('0x41')](_0x167954['toString'](),_0x4a5e0d);})['then'](function(_0x4785c4){if(_0x4785c4[_0x6689('0x45')]>0x0)_0x18326e[_0x6689('0x76')](_0x6689('0xac'),_['map'](_0x4785c4,'id'));return db[_0x6689('0x98')][_0x6689('0x41')](_0x18326e[_0x6689('0x99')](),_0x4a5e0d)[_0x6689('0x2a')](function(_0x41e611){var _0x3ff396=_[_0x6689('0xad')](_0x41e611,_0x6689('0xae'));var _0x14b9e8=[];_0x4785c4[_0x6689('0x35')](function(_0x5bbc91){_0x14b9e8[_0x6689('0x36')](updateOpenchannelInteraction(_0x5bbc91,_0x84a310,_0x3ff396));});return BPromise[_0x6689('0xaf')](_0x14b9e8);});});})[_0x6689('0x2a')](function(_0xcbb0d0){_0x3891f5[_0x6689('0xb0')]=_0xcbb0d0;return _0x3891f5;})['then'](respondWithFilteredResult(_0x2f69b9,_0x291537))[_0x6689('0x37')](handleError(_0x2f69b9,null));};exports['show']=function(_0x5915bd,_0xe8838){var _0x412af6={};if(_0x5915bd[_0x6689('0x41')][_0x6689('0x3b')]&&_0x5915bd[_0x6689('0x41')][_0x6689('0x3b')]===_0x6689('0x4f')){_0x412af6[_0x6689('0x4f')]=_0x5915bd[_0x6689('0xb1')]['id'];}else{_0x412af6['id']=_0x5915bd[_0x6689('0xb1')]['id'];}var _0x359b68={'raw':![],'where':_0x412af6},_0x50bc28={};_0x50bc28[_0x6689('0x3d')]=_[_0x6689('0x3f')](db[_0x6689('0x39')]['rawAttributes']);_0x50bc28['query']=_[_0x6689('0x3f')](_0x5915bd['query']);_0x50bc28[_0x6689('0x40')]=_[_0x6689('0x43')](_0x50bc28[_0x6689('0x3d')],_0x50bc28[_0x6689('0x41')]);_0x359b68[_0x6689('0x42')]=_[_0x6689('0x43')](_0x50bc28[_0x6689('0x3d')],qs[_0x6689('0x44')](_0x5915bd[_0x6689('0x41')][_0x6689('0x44')]));_0x359b68[_0x6689('0x42')]=_0x359b68[_0x6689('0x42')][_0x6689('0x45')]?_0x359b68[_0x6689('0x42')]:_0x50bc28['model'];if(_0x5915bd['query'][_0x6689('0xb2')]){_0x359b68['include']=[{'all':!![]}];}_0x359b68=_[_0x6689('0xb3')]({},_0x359b68,_0x5915bd['options']);return db[_0x6689('0x39')][_0x6689('0x67')](_0x359b68)[_0x6689('0x2a')](handleEntityNotFound(_0xe8838,null))[_0x6689('0x2a')](respondWithResult(_0xe8838,null))[_0x6689('0x37')](handleError(_0xe8838,null));};exports[_0x6689('0xb4')]=function(_0x2129a7,_0x584432){return db['OpenchannelInteraction'][_0x6689('0xb4')](_0x2129a7[_0x6689('0x71')],{})[_0x6689('0x2a')](respondWithResult(_0x584432,0xc9))['catch'](handleError(_0x584432,null));};exports[_0x6689('0xb5')]=function(_0x1c17b2,_0x2baf5e){if(_0x1c17b2[_0x6689('0x71')]['id']){delete _0x1c17b2['body']['id'];}return db[_0x6689('0x39')][_0x6689('0x67')]({'where':{'id':_0x1c17b2['params']['id']}})['then'](handleEntityNotFound(_0x2baf5e,null))['then'](saveUpdates(_0x1c17b2['body'],null))[_0x6689('0x2a')](respondWithResult(_0x2baf5e,null))[_0x6689('0x37')](handleError(_0x2baf5e,null));};exports[_0x6689('0x2b')]=function(_0x28570d,_0x56793b){return db[_0x6689('0x39')]['find']({'where':{'id':_0x28570d[_0x6689('0xb1')]['id']}})['then'](handleEntityNotFound(_0x56793b,null))[_0x6689('0x2a')](removeEntity(_0x56793b,null))[_0x6689('0x37')](handleError(_0x56793b,null));};exports['describe']=function(_0xe20595,_0x18b1a4){return db[_0x6689('0x39')][_0x6689('0xb6')]()[_0x6689('0x2a')](respondWithResult(_0x18b1a4,null))[_0x6689('0x37')](handleError(_0x18b1a4,null));};exports[_0x6689('0xb7')]=function(_0x3b6c6e,_0x57e1f6,_0x2abb6e){return db[_0x6689('0xb8')]['find']({'where':{'id':_0x3b6c6e[_0x6689('0xb1')]['id']}})[_0x6689('0x2a')](handleEntityNotFound(_0x57e1f6,null))[_0x6689('0x2a')](function(_0x968395){if(_0x968395){return _0x968395[_0x6689('0xb7')](_0x3b6c6e['body'][_0x6689('0xb9')],_[_0x6689('0xba')](_0x3b6c6e[_0x6689('0x71')],['ids','id'])||{});}})[_0x6689('0x2a')](respondWithResult(_0x57e1f6,null))[_0x6689('0x37')](handleError(_0x57e1f6,null));};exports[_0x6689('0xbb')]=function(_0x27268f,_0x133296,_0x32230a){var _0x13598d={'raw':![],'where':{}};var _0x566703={};var _0x3ef9ca={'count':0x0,'rows':[]};return db[_0x6689('0x39')]['findOne']({'where':{'id':_0x27268f['params']['id']}})[_0x6689('0x2a')](handleEntityNotFound(_0x133296,null))[_0x6689('0x2a')](function(_0x39b190){if(_0x39b190){_0x566703['model']=_[_0x6689('0x3f')](db[_0x6689('0xb8')][_0x6689('0xbc')]);_0x566703[_0x6689('0x41')]=_['keys'](_0x27268f['query']);_0x566703['filters']=_[_0x6689('0x43')](_0x566703[_0x6689('0x3d')],_0x566703[_0x6689('0x41')]);_0x13598d[_0x6689('0x42')]=_[_0x6689('0x43')](_0x566703['model'],qs[_0x6689('0x44')](_0x27268f[_0x6689('0x41')][_0x6689('0x44')]));_0x13598d[_0x6689('0x42')]=_0x13598d[_0x6689('0x42')][_0x6689('0x45')]?_0x13598d[_0x6689('0x42')]:_0x566703[_0x6689('0x3d')];if(!_0x27268f[_0x6689('0x41')][_0x6689('0x46')](_0x6689('0x47'))){_0x13598d['limit']=qs[_0x6689('0x23')](_0x27268f[_0x6689('0x41')][_0x6689('0x23')]);_0x13598d[_0x6689('0x21')]=qs[_0x6689('0x21')](_0x27268f[_0x6689('0x41')][_0x6689('0x21')]);}_0x13598d['order']=qs['sort'](_0x27268f[_0x6689('0x41')][_0x6689('0x48')]);_0x13598d[_0x6689('0x76')]=qs['filters'](_[_0x6689('0xbd')](_0x27268f['query'],_0x566703['filters']));_0x13598d[_0x6689('0x76')][_0x6689('0xae')]=_0x39b190['id'];if(_0x27268f[_0x6689('0x41')][_0x6689('0x84')]){_0x13598d[_0x6689('0x76')]=_['merge'](_0x13598d[_0x6689('0x76')],{'$or':_['map'](_0x13598d['attributes'],function(_0x470305){var _0x2c466a={};_0x2c466a[_0x470305]={'$like':'%'+_0x27268f['query'][_0x6689('0x84')]+'%'};return _0x2c466a;})});}if(_0x27268f[_0x6689('0x41')][_0x6689('0x79')]){var _0x4aba0f=_0x27268f[_0x6689('0x41')][_0x6689('0x79')][_0x6689('0x34')](',');var _0x1f0cf4={};_0x1f0cf4[_0x4aba0f[0x0]]={'$gte':moment(_0x4aba0f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x13598d['where']=_[_0x6689('0xb3')](_0x13598d[_0x6689('0x76')],_0x1f0cf4);}_0x13598d=_['merge']({},_0x13598d,_0x27268f['options']);return db[_0x6689('0xb8')][_0x6689('0x24')]({'where':_0x13598d[_0x6689('0x76')]})[_0x6689('0x2a')](function(_0x1b364e){_0x3ef9ca['count']=_0x1b364e;if(_0x27268f[_0x6689('0x41')][_0x6689('0xb2')]){_0x13598d['include']=[{'all':!![]}];}return db[_0x6689('0xb8')][_0x6689('0xbe')](_0x13598d);})[_0x6689('0x2a')](function(_0x424a3e){_0x3ef9ca[_0x6689('0xb0')]=_0x424a3e;return _0x3ef9ca;});}})['then'](respondWithFilteredResult(_0x133296,_0x13598d))['catch'](handleError(_0x133296,null));};exports[_0x6689('0xbf')]=function(_0x38a3f9,_0x1c033f,_0x2ed9e8){return db[_0x6689('0x39')]['find']({'where':{'id':_0x38a3f9[_0x6689('0xb1')]['id']}})['then'](handleEntityNotFound(_0x1c033f,null))['then'](function(_0x33fe34){if(_0x33fe34){return _0x33fe34['setTags'](_0x38a3f9['body'][_0x6689('0xb9')],_[_0x6689('0xba')](_0x38a3f9['body'],[_0x6689('0xb9'),'id'])||{})[_0x6689('0xc0')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x6689('0x4a')],'where':{'id':_0x38a3f9[_0x6689('0x71')]['ids']}});})[_0x6689('0x2a')](function(_0x1bd373){socket[_0x6689('0xc1')](_0x6689('0xc2'),{'id':Number(_0x38a3f9[_0x6689('0xb1')]['id']),'tags':_0x1bd373||[]});return{'id':Number(_0x38a3f9[_0x6689('0xb1')]['id']),'tags':_0x1bd373||[]};});}})[_0x6689('0x2a')](respondWithResult(_0x1c033f,null))[_0x6689('0x37')](handleError(_0x1c033f,null));};exports[_0x6689('0xc3')]=function(_0x2acfa2,_0x4a2f6a,_0x39925f){return db[_0x6689('0x39')][_0x6689('0x67')]({'where':{'id':_0x2acfa2[_0x6689('0xb1')]['id']}})[_0x6689('0x2a')](handleEntityNotFound(_0x4a2f6a,null))[_0x6689('0x2a')](function(_0x214ead){if(_0x214ead){return _0x214ead[_0x6689('0xc3')](_0x2acfa2[_0x6689('0x41')]['ids']);}})[_0x6689('0x2a')](respondWithStatusCode(_0x4a2f6a,null))['catch'](handleError(_0x4a2f6a,null));};exports[_0x6689('0xc4')]=function(_0x2f57d3,_0x54c46f){var _0x3f6fbd=moment()['unix']()['toString']();var _0xc6d655=path[_0x6689('0xc5')](config[_0x6689('0xc6')],_0x6689('0xc7'),_0x6689('0xc8'),_0x6689('0xc9'));var _0x5887c=path['join'](config[_0x6689('0xc6')],'server',_0x6689('0xc8'),'attachments');var _0x57a57c=path[_0x6689('0xc5')](_0xc6d655,_0x3f6fbd);var _0x4bb7ac=util[_0x6689('0xca')](_0x6689('0xcb'),_0x2f57d3['params']['id'],_0x3f6fbd);var _0x4502e0=path[_0x6689('0xc5')](_0xc6d655,_0x4bb7ac);var _0x1ff496=[];_0x1ff496[_0x6689('0x36')]({'model':db[_0x6689('0x6f')],'as':_0x6689('0x6f'),'attributes':['id',_0x6689('0x31')],'raw':!![]});_0x1ff496[_0x6689('0x36')]({'model':db[_0x6689('0xcc')],'as':_0x6689('0x61'),'attributes':['id',_0x6689('0xcd'),_0x6689('0xce')],'raw':!![]});if(_0x2f57d3[_0x6689('0x41')][_0x6689('0xcf')]){_0x1ff496[_0x6689('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4fff00=[{'model':db[_0x6689('0xb8')],'as':_0x6689('0xd0'),'attributes':['id','body',_0x6689('0xd1'),'direction',_0x6689('0xd2'),_0x6689('0x7f')],'include':_0x1ff496}];_0x4fff00['push']({'model':db[_0x6689('0xd3')],'as':_0x6689('0xd4'),'attributes':['id',_0x6689('0x2e')]});_0x4fff00[_0x6689('0x36')]({'model':db[_0x6689('0x6f')],'as':'Owner','attributes':['id',_0x6689('0x31')]});return db[_0x6689('0x39')][_0x6689('0x67')]({'where':{'id':_0x2f57d3[_0x6689('0xb1')]['id']},'include':_0x4fff00})[_0x6689('0x2a')](handleEntityNotFound(_0x54c46f,null))['then'](function(_0x71741d){if(_0x71741d){var _0x2c46ae=_0x71741d[_0x6689('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x57a57c);var _0x15183b={'channel':_0x6689('0xd6'),'account':_0x2c46ae['Account'][_0x6689('0x2e')],'agent':_0x2c46ae[_0x6689('0xd7')]?_0x2c46ae[_0x6689('0xd7')][_0x6689('0x31')]:_0x6689('0xd8'),'createdAt':moment(_0x2c46ae[_0x6689('0xd1')])[_0x6689('0xca')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2c46ae[_0x6689('0xd9')]?moment(_0x2c46ae[_0x6689('0xda')])[_0x6689('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6689('0x99')]():'','disposition':_0x2c46ae[_0x6689('0xdb')],'visibility':_0x2c46ae[_0x6689('0xdc')]?_0x6689('0xdd'):_0x6689('0xde'),'messages':_(_0x2c46ae[_0x6689('0xd0')])[_0x6689('0x84')]({'secret':![]})[_0x6689('0x3e')](function(_0x599468){if(_0x599468[_0x6689('0xdf')]){var _0x373a5e=path[_0x6689('0xc5')](_0x5887c,_0x599468[_0x6689('0xdf')][_0x6689('0xe0')]);if(fs[_0x6689('0xe1')](_0x373a5e)){fs['createReadStream'](_0x373a5e)[_0x6689('0xe2')](fs[_0x6689('0xe3')](path[_0x6689('0xc5')](_0x57a57c,_0x599468['Attachment'][_0x6689('0xe0')])));}}return{'date':moment(_0x599468[_0x6689('0xd1')])['format'](_0x6689('0xe4'))['toString'](),'sender':_0x599468[_0x6689('0xe5')]===_0x6689('0xe6')?_0x599468[_0x6689('0x6f')]?_0x599468[_0x6689('0x6f')][_0x6689('0x31')]:_0x6689('0xe7'):_0x599468[_0x6689('0x61')]['firstName']+(_0x599468[_0x6689('0x61')][_0x6689('0xce')]?'\x20'+_0x599468[_0x6689('0x61')]['lastName']:''),'body':_0x599468[_0x6689('0xdf')]?_0x599468[_0x6689('0xdf')][_0x6689('0xe0')]:_0x599468[_0x6689('0x71')],'direction':_0x599468['direction']===_0x6689('0xe6')?'A':'C','secret':_0x599468[_0x6689('0xd2')],'read':_0x599468['read'],'attachment':_0x599468[_0x6689('0xdf')]};})[_0x6689('0x5f')]()};return ejs['renderFile'](path['join'](config['root'],_0x6689('0xc7'),'views','downloadInteraction.ejs'),{'interaction':_0x15183b})['then'](function(_0x52f6e2){var _0x2648f1=path[_0x6689('0xc5')](_0x57a57c,_0x6689('0xe8')+_0x2c46ae['id']+'-'+_0x3f6fbd+'.pdf');var _0x502a66={'path':_0x2648f1,'channel':_0x6689('0xd6'),'interactionId':_0x2c46ae['id']};return pdf[_0x6689('0xe9')](_0x52f6e2,_0x502a66);})[_0x6689('0x2a')](function(){return new BPromise(function(_0x1f7732,_0x192d4d){zipdir(_0x57a57c,{'saveTo':_0x4502e0},function(_0x3e5e41,_0x2224ca){if(_0x3e5e41)return _0x192d4d(_0x3e5e41);return _0x1f7732(_0x2224ca);});})[_0x6689('0x2a')](function(){return new BPromise(function(_0x5358fb,_0x55cf86){rimraf(_0x57a57c,function(_0x1410c4){if(_0x1410c4)_0x55cf86(_0x1410c4);return _0x5358fb();});});})[_0x6689('0x2a')](function(){return _0x54c46f[_0x6689('0xc4')](_0x4502e0,_0x4bb7ac,function(_0x4c0871){if(_0x4c0871){console[_0x6689('0xea')]('err',_0x4c0871);}else{fs[_0x6689('0xeb')](_0x4502e0);}});});});}else{return _0x54c46f[_0x6689('0x1e')](0xc8);}})[_0x6689('0x37')](handleError(_0x54c46f,null));}; \ No newline at end of file +var _0x3a49=['params','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','OpenchannelInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','join','server','files','root','attachments','transcript-%d-%s.zip','User','CmContact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','out','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','error','stack','name','send','map','fullname','Tags','split','push','TagIds','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','expr','search','parseSearch','sqlOperator','length','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','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?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','clone','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','user','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','catch','show'];(function(_0x5011c9,_0x25c813){var _0x418ac7=function(_0x294523){while(--_0x294523){_0x5011c9['push'](_0x5011c9['shift']());}};_0x418ac7(++_0x25c813);}(_0x3a49,0x12a));var _0x93a4=function(_0x33d7b8,_0x2e51ff){_0x33d7b8=_0x33d7b8-0x0;var _0x72a050=_0x3a49[_0x33d7b8];return _0x72a050;};'use strict';var emlformat=require(_0x93a4('0x0'));var rimraf=require(_0x93a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93a4('0x2'));var rp=require(_0x93a4('0x3'));var moment=require(_0x93a4('0x4'));var BPromise=require(_0x93a4('0x5'));var Mustache=require('mustache');var util=require(_0x93a4('0x6'));var path=require(_0x93a4('0x7'));var sox=require(_0x93a4('0x8'));var csv=require(_0x93a4('0x9'));var ejs=require(_0x93a4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93a4('0xb'));var squel=require(_0x93a4('0xc'));var crypto=require(_0x93a4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x93a4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x93a4('0xf'));var Papa=require(_0x93a4('0x10'));var Redis=require(_0x93a4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x93a4('0x12'));var pdf=require(_0x93a4('0x13'));var hardwareService=require(_0x93a4('0x14'));var logger=require('../../config/logger')(_0x93a4('0x15'));var utils=require(_0x93a4('0x16'));var config=require(_0x93a4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x93a4('0x18'))['db'];config[_0x93a4('0x19')]=_[_0x93a4('0x1a')](config[_0x93a4('0x19')],{'host':_0x93a4('0x1b'),'port':0x18eb});var socket=require(_0x93a4('0x1c'))(new Redis(config['redis']));require(_0x93a4('0x1d'))['register'](socket);function respondWithStatusCode(_0x30094c,_0x3ef52c){_0x3ef52c=_0x3ef52c||0xcc;return function(_0x30c82d){if(_0x30c82d){return _0x30094c[_0x93a4('0x1e')](_0x3ef52c);}return _0x30094c['status'](_0x3ef52c)[_0x93a4('0x1f')]();};}function respondWithResult(_0x2386a2,_0x46b2b7){_0x46b2b7=_0x46b2b7||0xc8;return function(_0x2a8349){if(_0x2a8349){return _0x2386a2[_0x93a4('0x20')](_0x46b2b7)['json'](_0x2a8349);}};}function respondWithFilteredResult(_0x3720c9,_0x47655b){return function(_0x47b56a){if(_0x47b56a){var _0x2a98b2=typeof _0x47655b[_0x93a4('0x21')]==='undefined'&&typeof _0x47655b[_0x93a4('0x22')]===_0x93a4('0x23');var _0x2902ed=_0x47b56a[_0x93a4('0x24')];var _0x361a10=_0x2a98b2?0x0:_0x47655b[_0x93a4('0x21')];var _0x5a939a=_0x2a98b2?_0x47b56a[_0x93a4('0x24')]:_0x47655b[_0x93a4('0x21')]+_0x47655b[_0x93a4('0x22')];var _0x3b12c6;if(_0x5a939a>=_0x2902ed){_0x5a939a=_0x2902ed;_0x3b12c6=0xc8;}else{_0x3b12c6=0xce;}_0x3720c9['status'](_0x3b12c6);return _0x3720c9[_0x93a4('0x25')]('Content-Range',_0x361a10+'-'+_0x5a939a+'/'+_0x2902ed)[_0x93a4('0x26')](_0x47b56a);}return null;};}function patchUpdates(_0x4a5a1f){return function(_0x22126d){try{jsonpatch[_0x93a4('0x27')](_0x22126d,_0x4a5a1f,!![]);}catch(_0x366f09){return BPromise[_0x93a4('0x28')](_0x366f09);}return _0x22126d['save']();};}function saveUpdates(_0x2100eb,_0x3b8926){return function(_0x48f43d){if(_0x48f43d){return _0x48f43d[_0x93a4('0x29')](_0x2100eb)[_0x93a4('0x2a')](function(_0x8c3f88){return _0x8c3f88;});}return null;};}function removeEntity(_0x3fdf20,_0xa73c6){return function(_0x10f758){if(_0x10f758){return _0x10f758[_0x93a4('0x2b')]()[_0x93a4('0x2a')](function(){_0x3fdf20[_0x93a4('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c8439,_0x210b54){return function(_0x416676){if(!_0x416676){_0x4c8439[_0x93a4('0x1e')](0x194);}return _0x416676;};}function handleError(_0x262119,_0x36ef4d){_0x36ef4d=_0x36ef4d||0x1f4;return function(_0x10f635){logger[_0x93a4('0x2c')](_0x10f635[_0x93a4('0x2d')]);if(_0x10f635[_0x93a4('0x2e')]){delete _0x10f635['name'];}_0x262119[_0x93a4('0x20')](_0x36ef4d)[_0x93a4('0x2f')](_0x10f635);};}function getInteractionUsers(_0x3d9a9f,_0x3e5e85){return new BPromise(function(_0x5177cc,_0x30e102){try{if(_0x3e5e85[_0x3d9a9f['id']]){_0x3d9a9f['Users']=_[_0x93a4('0x30')](_0x3e5e85[_0x3d9a9f['id']],function(_0x4329e9){return{'id':_0x4329e9['id'],'fullname':_0x4329e9[_0x93a4('0x31')]};});}}catch(_0x34eb53){_0x30e102(_0x34eb53);}_0x5177cc(_0x3d9a9f);});}function getInteractionTags(_0x5a25c5,_0x4e675c){return new BPromise(function(_0xb2e46b,_0x1f0a4e){try{if(_0x5a25c5['TagIds']){_0x5a25c5[_0x93a4('0x32')]=[];_0x5a25c5['TagIds'][_0x93a4('0x33')](',')['forEach'](function(_0x1e4d21){_0x5a25c5[_0x93a4('0x32')][_0x93a4('0x34')](_0x4e675c[_0x1e4d21]);});}delete _0x5a25c5[_0x93a4('0x35')];}catch(_0x206c3e){_0x1f0a4e(_0x206c3e);}_0xb2e46b(_0x5a25c5);});}function updateOpenchannelInteraction(_0x4985c0,_0x371132,_0x3bb853){return new BPromise(function(_0x3a3fe1,_0x3c4fac){return getInteractionUsers(_0x4985c0,_0x3bb853)[_0x93a4('0x2a')](function(_0x469322){return getInteractionTags(_0x469322,_0x371132);})[_0x93a4('0x2a')](function(_0x4ed399){_0x3a3fe1(_0x4ed399);})['catch'](function(_0x31cc72){_0x3c4fac(_0x31cc72);});});}exports[_0x93a4('0x36')]=function(_0x19571f,_0x3873f4){var _0x35982e={},_0x1a4b2f={},_0x4ebfd5={'count':0x0,'rows':[]};var _0x3d2edb=_[_0x93a4('0x30')](db[_0x93a4('0x37')][_0x93a4('0x38')],function(_0x22aa16){return{'name':_0x22aa16[_0x93a4('0x39')],'type':_0x22aa16[_0x93a4('0x3a')][_0x93a4('0x3b')]};});_0x1a4b2f['model']=_[_0x93a4('0x30')](_0x3d2edb,'name');_0x1a4b2f[_0x93a4('0x3c')]=_['keys'](_0x19571f[_0x93a4('0x3c')]);_0x1a4b2f[_0x93a4('0x3d')]=_[_0x93a4('0x3e')](_0x1a4b2f[_0x93a4('0x3f')],_0x1a4b2f[_0x93a4('0x3c')]);_0x35982e['attributes']=_[_0x93a4('0x3e')](_0x1a4b2f[_0x93a4('0x3f')],qs[_0x93a4('0x40')](_0x19571f['query'][_0x93a4('0x40')]));_0x35982e[_0x93a4('0x41')]=_0x35982e['attributes']['length']?_0x35982e[_0x93a4('0x41')]:_0x1a4b2f['model'];if(!_0x19571f['query'][_0x93a4('0x42')](_0x93a4('0x43'))){_0x35982e[_0x93a4('0x22')]=qs['limit'](_0x19571f['query'][_0x93a4('0x22')]);_0x35982e['offset']=qs[_0x93a4('0x21')](_0x19571f[_0x93a4('0x3c')][_0x93a4('0x21')]);}_0x35982e[_0x93a4('0x44')]=qs[_0x93a4('0x45')](_0x19571f[_0x93a4('0x3c')][_0x93a4('0x45')]);_0x35982e[_0x93a4('0x46')]=qs[_0x93a4('0x3d')](_[_0x93a4('0x47')](_0x19571f['query'],_0x1a4b2f[_0x93a4('0x3d')]),_0x3d2edb);var _0x15b515=[];var _0x3b7a0d=squel[_0x93a4('0x48')]()[_0x93a4('0x49')]('id')[_0x93a4('0x49')](_0x93a4('0x2e'))[_0x93a4('0x49')](_0x93a4('0x4a'))[_0x93a4('0x4b')](_0x93a4('0x4c'));var _0x176b2c=squel['select']()['field'](_0x93a4('0x4d'))[_0x93a4('0x49')]('u.fullname')[_0x93a4('0x49')](_0x93a4('0x4e'))[_0x93a4('0x4b')](_0x93a4('0x4f'),'ui')[_0x93a4('0x50')](_0x93a4('0x51'),'u',_0x93a4('0x52'));var _0x541b9d=squel[_0x93a4('0x48')]()[_0x93a4('0x4b')](_0x93a4('0x53'),'i')['left_join'](_0x93a4('0x54'),'c',_0x93a4('0x55'))[_0x93a4('0x50')]('users','o',_0x93a4('0x56'))[_0x93a4('0x50')](_0x93a4('0x57'),'a',_0x93a4('0x58'))[_0x93a4('0x50')](_0x93a4('0x59'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x93a4('0x50')](_0x93a4('0x5a'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x93a4('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x3c4458=squel[_0x93a4('0x5b')]();var _0x547ad3=[];var _0x268eb8=squel[_0x93a4('0x5b')]();var _0x466bef;if(_0x19571f[_0x93a4('0x3c')][_0x93a4('0x5c')]){_0x466bef=as[_0x93a4('0x5d')](_0x19571f['query'][_0x93a4('0x5c')]);var _0x528fa9=_0x466bef[_0x93a4('0x5e')];for(var _0x3c270e=0x0;_0x3c270e<_0x466bef['conditions'][_0x93a4('0x5f')];_0x3c270e++){var _0x4fb50c=_0x466bef['conditions'][_0x3c270e];var _0x2bc6ef='i';var _0x206f4d=_[_0x93a4('0x60')](_0x3d2edb,[_0x93a4('0x2e'),_0x4fb50c[_0x93a4('0x49')]]);if(!_0x206f4d){switch(_0x4fb50c[_0x93a4('0x49')]){case _0x93a4('0x61'):if(_0x4fb50c[_0x93a4('0x62')]==0x1){_0x541b9d['having']('`'+_0x4fb50c['field']+_0x93a4('0x63'));}else{_0x541b9d[_0x93a4('0x64')]('`'+_0x4fb50c['field']+_0x93a4('0x65'));}break;case _0x93a4('0x66'):if(_0x4fb50c[_0x93a4('0x67')]==='$substring'){if(_0x4fb50c[_0x93a4('0x62')][_0x93a4('0x33')]('\x20')[_0x93a4('0x5f')]>0x1){_0x3c4458[_0x528fa9](_0x93a4('0x68'),qs[_0x93a4('0x69')](_0x4fb50c['value']),null);}else{var _0x5ca8c4='%'+_0x4fb50c['value']+'%';_0x3c4458[_0x528fa9](_0x93a4('0x6a'),_0x5ca8c4,_0x5ca8c4,_0x5ca8c4);}}else{_0x206f4d=_[_0x93a4('0x60')](_0x3d2edb,[_0x93a4('0x2e'),'ContactId']);_0x4fb50c['field']=_0x93a4('0x6b');_0xa7eb7=as['buildExpression'](_0x2bc6ef,_0x206f4d[_0x93a4('0x3a')],_0x4fb50c);_0x3c4458[_0x528fa9](_0xa7eb7[_0x93a4('0x6c')],_0xa7eb7['value'][_0x93a4('0x6d')],_0xa7eb7[_0x93a4('0x62')][_0x93a4('0x1f')]);}break;case _0x93a4('0x6e'):var _0x53c807=_0x4fb50c['value'][_0x93a4('0x33')](',')[_0x93a4('0x30')](function(_0x591cac){return Number(_0x591cac);});_0x53c807[_0x93a4('0x6f')](function(_0x168bba){_0x268eb8['or'](_0x93a4('0x70'),'%,'+_0x168bba+',%');});_0x547ad3=_[_0x93a4('0x71')](_0x547ad3,_0x53c807);break;case'User':if(_0x4fb50c['operator']===_0x93a4('0x72')){_0x3c4458[_0x528fa9](_0x93a4('0x73'),'%'+_0x4fb50c[_0x93a4('0x62')]+'%',null);}else{_0x206f4d=_[_0x93a4('0x60')](_0x3d2edb,[_0x93a4('0x2e'),_0x93a4('0x74')]);_0x4fb50c[_0x93a4('0x49')]='UserId';_0xa7eb7=as[_0x93a4('0x75')](_0x2bc6ef,_0x206f4d[_0x93a4('0x3a')],_0x4fb50c);_0x3c4458[_0x528fa9](_0xa7eb7[_0x93a4('0x6c')],_0xa7eb7[_0x93a4('0x62')][_0x93a4('0x6d')],_0xa7eb7['value'][_0x93a4('0x1f')]);}break;case'body':_0xa7eb7=as[_0x93a4('0x75')]('me',null,_0x4fb50c);_0x3c4458[_0x528fa9](_0xa7eb7[_0x93a4('0x6c')],_0xa7eb7[_0x93a4('0x62')][_0x93a4('0x6d')],_0xa7eb7[_0x93a4('0x62')]['end']);break;}}else{var _0xa7eb7=as['buildExpression'](_0x2bc6ef,_0x206f4d[_0x93a4('0x3a')],_0x4fb50c);_0x3c4458[_0x528fa9](_0xa7eb7['text'],_0xa7eb7[_0x93a4('0x62')][_0x93a4('0x6d')],_0xa7eb7[_0x93a4('0x62')][_0x93a4('0x1f')]);}}}else{var _0x54d545=_(_0x19571f[_0x93a4('0x3c')])[_0x93a4('0x76')]()['map'](function(_0x32434c){return _[_0x93a4('0x77')](_0x3d2edb,[_0x93a4('0x2e'),_0x32434c])?_0x32434c:undefined;})[_0x93a4('0x78')]()[_0x93a4('0x62')]();if(!_[_0x93a4('0x79')](_0x54d545)){_0x54d545[_0x93a4('0x6f')](function(_0x202b5a){if(_0x202b5a==='OpenchannelAccountId'){_0x541b9d[_0x93a4('0x46')](_0x93a4('0x7a'),[]['concat'](_0x19571f[_0x93a4('0x3c')][_0x202b5a]));}else if(_0x202b5a===_0x93a4('0x7b')){var _0x260751=JSON[_0x93a4('0x7c')](_0x19571f[_0x93a4('0x3c')][_0x202b5a])['$gte'];var _0x37c677=JSON[_0x93a4('0x7c')](_0x19571f[_0x93a4('0x3c')][_0x202b5a])[_0x93a4('0x7d')];_0x541b9d['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x260751,_0x37c677);}else{if(_0x19571f[_0x93a4('0x3c')][_0x202b5a]==='null'){_0x541b9d[_0x93a4('0x46')]('i.'+_0x202b5a+_0x93a4('0x7e'));}else{_0x541b9d[_0x93a4('0x46')]('i.'+_0x202b5a+_0x93a4('0x7f'),_0x19571f[_0x93a4('0x3c')][_0x202b5a]);}}});}if(_0x19571f['query'][_0x93a4('0x80')]){if(_0x19571f[_0x93a4('0x3c')][_0x93a4('0x80')]==0x1){_0x541b9d[_0x93a4('0x64')](_0x93a4('0x81'));}else{_0x541b9d['having'](_0x93a4('0x82'));}}if(_0x19571f[_0x93a4('0x3c')][_0x93a4('0x83')]){_0x547ad3=_[_0x93a4('0x84')](_0x19571f[_0x93a4('0x3c')]['tag'])?_0x19571f['query'][_0x93a4('0x83')]:new Array(_0x19571f['query'][_0x93a4('0x83')]);_0x547ad3[_0x93a4('0x6f')](function(_0x12b6ce){_0x268eb8['or'](_0x93a4('0x70'),'%,'+_0x12b6ce+',%');});}if(_0x19571f[_0x93a4('0x3c')][_0x93a4('0x85')]){var _0xc00d1e=_0x19571f[_0x93a4('0x3c')][_0x93a4('0x85')]['replace']('\x5c','\x5c\x5c')[_0x93a4('0x86')](/'/g,'\x27\x27');if(qs[_0x93a4('0x87')](_0xc00d1e)){_0x3c4458['or'](_0x93a4('0x88'),_0xc00d1e+'%');}else{_0x3c4458['or'](_0x93a4('0x89'),qs[_0x93a4('0x69')](_0xc00d1e))['or'](_0x93a4('0x8a'),_0xc00d1e+'%')['or'](_0x93a4('0x8b'),_0xc00d1e+'%');}}}_0x541b9d['where'](_0x3c4458);_0x541b9d['group'](_0x93a4('0x8c'));var _0x1cb6d8={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0xb1c993=_0x541b9d[_0x93a4('0x8d')]();_0xb1c993[_0x93a4('0x49')](_0x93a4('0x8c'));_0xb1c993['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x35982e[_0x93a4('0x44')]){_0x35982e[_0x93a4('0x44')][_0x93a4('0x6f')](function(_0x10659a){var _0x22585f=_0x10659a[0x0]==='contactName'?_0x10659a[0x0]:'i.'+_0x10659a[0x0];_0x541b9d[_0x93a4('0x44')](_0x22585f,_0x10659a[0x1]===_0x93a4('0x8e')?![]:!![]);});}if(!_[_0x93a4('0x79')](_0x547ad3)){_0x541b9d['having'](_0x268eb8);_0xb1c993['where'](_0x93a4('0x8f'),_0x547ad3);}BPromise[_0x93a4('0x90')]()[_0x93a4('0x2a')](function(){if(!_0x466bef){if(_0x19571f[_0x93a4('0x3c')][_0x93a4('0x91')])return;_0xb1c993[_0x93a4('0x46')](_0x93a4('0x92'));_0x541b9d[_0x93a4('0x46')](_0x93a4('0x92'));return;}if(_0x19571f['user'][_0x93a4('0x93')]!=='agent')return;return _0x19571f['user'][_0x93a4('0x94')]({'attributes':['id'],'raw':!![]})[_0x93a4('0x2a')](function(_0x258314){if(_[_0x93a4('0x79')](_0x258314)){_0xb1c993[_0x93a4('0x46')](_0x93a4('0x95'));_0x541b9d[_0x93a4('0x46')](_0x93a4('0x95'));}else{_0xb1c993[_0x93a4('0x46')](_0x93a4('0x7a'),_[_0x93a4('0x30')](_0x258314,'id'));_0x541b9d[_0x93a4('0x46')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x93a4('0x30')](_0x258314,'id'));}});})[_0x93a4('0x2a')](function(){if(_0x19571f[_0x93a4('0x96')][_0x93a4('0x93')]==='agent'&&!_0x466bef&&!_0x19571f['query']['OpenchannelAccountId'])return[];return db[_0x93a4('0x97')]['query'](_0xb1c993[_0x93a4('0x98')](),_0x1cb6d8);})[_0x93a4('0x2a')](function(_0x3695f1){_0x4ebfd5['count']=_0x3695f1[_0x93a4('0x5f')];if(_0x4ebfd5['count']===0x0)return[];return db[_0x93a4('0x97')][_0x93a4('0x3c')](_0x3b7a0d[_0x93a4('0x98')](),_0x1cb6d8)[_0x93a4('0x2a')](function(_0x3d4e9a){_0x15b515=_['keyBy'](_0x3d4e9a,'id');_0x1cb6d8=_[_0x93a4('0x99')](_0x1cb6d8,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19571f['query']['fields']){_0x35982e[_0x93a4('0x41')]['forEach'](function(_0x2aa743){_0x541b9d[_0x93a4('0x49')]('i.'+_0x2aa743);});}else{_0x541b9d[_0x93a4('0x49')](_0x93a4('0x9a'),_0x93a4('0x61'));_0x541b9d[_0x93a4('0x49')](_0x93a4('0x9b'),'Account.key');_0x541b9d[_0x93a4('0x49')](_0x93a4('0x9c'),_0x93a4('0x9d'));_0x541b9d[_0x93a4('0x49')](_0x93a4('0x9e'),'contactName');_0x541b9d[_0x93a4('0x49')](_0x93a4('0x9f'));_0x541b9d[_0x93a4('0x49')]('c.firstName',_0x93a4('0xa0'));_0x541b9d[_0x93a4('0x49')](_0x93a4('0xa1'),_0x93a4('0xa2'));_0x541b9d['field']('c.email',_0x93a4('0xa3'));_0x541b9d[_0x93a4('0x49')](_0x93a4('0xa4'),'Contact.phone');_0x541b9d['field'](_0x93a4('0xa5'),'Contact.mobile');_0x541b9d[_0x93a4('0x49')]('c.fax',_0x93a4('0xa6'));_0x541b9d[_0x93a4('0x49')](_0x93a4('0xa7'),_0x93a4('0xa8'));_0x541b9d[_0x93a4('0x49')](_0x93a4('0xa9'),_0x93a4('0xaa'));_0x541b9d[_0x93a4('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x93a4('0x35'));}if(_0x35982e['limit'])_0x541b9d['limit'](_0x35982e[_0x93a4('0x22')]);if(_0x35982e[_0x93a4('0x21')])_0x541b9d[_0x93a4('0x21')](_0x35982e[_0x93a4('0x21')]);return db[_0x93a4('0x97')]['query'](_0x541b9d[_0x93a4('0x98')](),_0x1cb6d8);})['then'](function(_0x1be2c2){if(_0x1be2c2[_0x93a4('0x5f')]>0x0)_0x176b2c[_0x93a4('0x46')](_0x93a4('0xab'),_['map'](_0x1be2c2,'id'));return db[_0x93a4('0x97')][_0x93a4('0x3c')](_0x176b2c[_0x93a4('0x98')](),_0x1cb6d8)[_0x93a4('0x2a')](function(_0x27030d){var _0x2b5676=_[_0x93a4('0xac')](_0x27030d,'OpenchannelInteractionId');var _0x51edcc=[];_0x1be2c2[_0x93a4('0x6f')](function(_0x4a92cd){_0x51edcc['push'](updateOpenchannelInteraction(_0x4a92cd,_0x15b515,_0x2b5676));});return BPromise['all'](_0x51edcc);});});})[_0x93a4('0x2a')](function(_0x825a62){_0x4ebfd5[_0x93a4('0xad')]=_0x825a62;return _0x4ebfd5;})['then'](respondWithFilteredResult(_0x3873f4,_0x35982e))[_0x93a4('0xae')](handleError(_0x3873f4,null));};exports[_0x93a4('0xaf')]=function(_0x5a7552,_0x55c91b){var _0x3c9f0b={};if(_0x5a7552[_0x93a4('0x3c')][_0x93a4('0x3a')]&&_0x5a7552[_0x93a4('0x3c')][_0x93a4('0x3a')]===_0x93a4('0x4b')){_0x3c9f0b[_0x93a4('0x4b')]=_0x5a7552[_0x93a4('0xb0')]['id'];}else{_0x3c9f0b['id']=_0x5a7552['params']['id'];}var _0x56f1e4={'raw':![],'where':_0x3c9f0b},_0x22aca2={};_0x22aca2[_0x93a4('0x3f')]=_[_0x93a4('0x76')](db[_0x93a4('0x37')][_0x93a4('0x38')]);_0x22aca2['query']=_[_0x93a4('0x76')](_0x5a7552[_0x93a4('0x3c')]);_0x22aca2[_0x93a4('0x3d')]=_[_0x93a4('0x3e')](_0x22aca2[_0x93a4('0x3f')],_0x22aca2[_0x93a4('0x3c')]);_0x56f1e4[_0x93a4('0x41')]=_['intersection'](_0x22aca2['model'],qs[_0x93a4('0x40')](_0x5a7552[_0x93a4('0x3c')][_0x93a4('0x40')]));_0x56f1e4[_0x93a4('0x41')]=_0x56f1e4[_0x93a4('0x41')]['length']?_0x56f1e4[_0x93a4('0x41')]:_0x22aca2[_0x93a4('0x3f')];if(_0x5a7552['query'][_0x93a4('0xb1')]){_0x56f1e4[_0x93a4('0xb2')]=[{'all':!![]}];}_0x56f1e4=_['merge']({},_0x56f1e4,_0x5a7552[_0x93a4('0xb3')]);return db[_0x93a4('0x37')]['find'](_0x56f1e4)[_0x93a4('0x2a')](handleEntityNotFound(_0x55c91b,null))['then'](respondWithResult(_0x55c91b,null))[_0x93a4('0xae')](handleError(_0x55c91b,null));};exports[_0x93a4('0xb4')]=function(_0x1e37d7,_0x395c6e){return db['OpenchannelInteraction'][_0x93a4('0xb4')](_0x1e37d7[_0x93a4('0xb5')],{})[_0x93a4('0x2a')](respondWithResult(_0x395c6e,0xc9))[_0x93a4('0xae')](handleError(_0x395c6e,null));};exports[_0x93a4('0x29')]=function(_0x3681c5,_0x5d3646){if(_0x3681c5['body']['id']){delete _0x3681c5[_0x93a4('0xb5')]['id'];}return db[_0x93a4('0x37')][_0x93a4('0x60')]({'where':{'id':_0x3681c5['params']['id']}})[_0x93a4('0x2a')](handleEntityNotFound(_0x5d3646,null))['then'](saveUpdates(_0x3681c5[_0x93a4('0xb5')],null))[_0x93a4('0x2a')](respondWithResult(_0x5d3646,null))[_0x93a4('0xae')](handleError(_0x5d3646,null));};exports['destroy']=function(_0x1c252d,_0x32c44f){return db[_0x93a4('0x37')][_0x93a4('0x60')]({'where':{'id':_0x1c252d[_0x93a4('0xb0')]['id']}})[_0x93a4('0x2a')](handleEntityNotFound(_0x32c44f,null))[_0x93a4('0x2a')](removeEntity(_0x32c44f,null))[_0x93a4('0xae')](handleError(_0x32c44f,null));};exports[_0x93a4('0xb6')]=function(_0x427b4d,_0x2cfef9){return db['OpenchannelInteraction'][_0x93a4('0xb6')]()[_0x93a4('0x2a')](respondWithResult(_0x2cfef9,null))['catch'](handleError(_0x2cfef9,null));};exports[_0x93a4('0xb7')]=function(_0x43b98a,_0x4750c1,_0x45fe2a){return db[_0x93a4('0xb8')][_0x93a4('0x60')]({'where':{'id':_0x43b98a[_0x93a4('0xb0')]['id']}})[_0x93a4('0x2a')](handleEntityNotFound(_0x4750c1,null))[_0x93a4('0x2a')](function(_0x8accc9){if(_0x8accc9){return _0x8accc9['addMessage'](_0x43b98a[_0x93a4('0xb5')]['ids'],_[_0x93a4('0xb9')](_0x43b98a[_0x93a4('0xb5')],[_0x93a4('0xba'),'id'])||{});}})[_0x93a4('0x2a')](respondWithResult(_0x4750c1,null))[_0x93a4('0xae')](handleError(_0x4750c1,null));};exports[_0x93a4('0xbb')]=function(_0x51f9f9,_0xdf5fe9,_0x2bfdaf){var _0x466007={'raw':![],'where':{}};var _0x405a5a={};var _0x4f05b2={'count':0x0,'rows':[]};return db[_0x93a4('0x37')]['findOne']({'where':{'id':_0x51f9f9['params']['id']}})[_0x93a4('0x2a')](handleEntityNotFound(_0xdf5fe9,null))[_0x93a4('0x2a')](function(_0xd83915){if(_0xd83915){_0x405a5a['model']=_['keys'](db[_0x93a4('0xb8')][_0x93a4('0x38')]);_0x405a5a[_0x93a4('0x3c')]=_[_0x93a4('0x76')](_0x51f9f9[_0x93a4('0x3c')]);_0x405a5a[_0x93a4('0x3d')]=_[_0x93a4('0x3e')](_0x405a5a[_0x93a4('0x3f')],_0x405a5a[_0x93a4('0x3c')]);_0x466007['attributes']=_['intersection'](_0x405a5a[_0x93a4('0x3f')],qs[_0x93a4('0x40')](_0x51f9f9[_0x93a4('0x3c')][_0x93a4('0x40')]));_0x466007['attributes']=_0x466007['attributes'][_0x93a4('0x5f')]?_0x466007['attributes']:_0x405a5a['model'];if(!_0x51f9f9['query']['hasOwnProperty'](_0x93a4('0x43'))){_0x466007[_0x93a4('0x22')]=qs['limit'](_0x51f9f9[_0x93a4('0x3c')][_0x93a4('0x22')]);_0x466007[_0x93a4('0x21')]=qs['offset'](_0x51f9f9['query'][_0x93a4('0x21')]);}_0x466007[_0x93a4('0x44')]=qs['sort'](_0x51f9f9[_0x93a4('0x3c')][_0x93a4('0x45')]);_0x466007[_0x93a4('0x46')]=qs[_0x93a4('0x3d')](_[_0x93a4('0x47')](_0x51f9f9[_0x93a4('0x3c')],_0x405a5a[_0x93a4('0x3d')]));_0x466007[_0x93a4('0x46')][_0x93a4('0xbc')]=_0xd83915['id'];if(_0x51f9f9[_0x93a4('0x3c')][_0x93a4('0x85')]){_0x466007[_0x93a4('0x46')]=_[_0x93a4('0x99')](_0x466007['where'],{'$or':_[_0x93a4('0x30')](_0x466007[_0x93a4('0x41')],function(_0x4d3764){var _0x425a17={};_0x425a17[_0x4d3764]={'$like':'%'+_0x51f9f9[_0x93a4('0x3c')]['filter']+'%'};return _0x425a17;})});}if(_0x51f9f9[_0x93a4('0x3c')][_0x93a4('0xbd')]){var _0x2cda8e=_0x51f9f9[_0x93a4('0x3c')][_0x93a4('0xbd')][_0x93a4('0x33')](',');var _0x381284={};_0x381284[_0x2cda8e[0x0]]={'$gte':moment(_0x2cda8e[0x1])[_0x93a4('0xbe')](_0x93a4('0xbf'))};_0x466007['where']=_[_0x93a4('0x99')](_0x466007[_0x93a4('0x46')],_0x381284);}_0x466007=_[_0x93a4('0x99')]({},_0x466007,_0x51f9f9['options']);return db[_0x93a4('0xb8')][_0x93a4('0x24')]({'where':_0x466007[_0x93a4('0x46')]})[_0x93a4('0x2a')](function(_0x1a9c05){_0x4f05b2['count']=_0x1a9c05;if(_0x51f9f9['query']['includeAll']){_0x466007[_0x93a4('0xb2')]=[{'all':!![]}];}return db[_0x93a4('0xb8')][_0x93a4('0xc0')](_0x466007);})['then'](function(_0x41a102){_0x4f05b2['rows']=_0x41a102;return _0x4f05b2;});}})[_0x93a4('0x2a')](respondWithFilteredResult(_0xdf5fe9,_0x466007))[_0x93a4('0xae')](handleError(_0xdf5fe9,null));};exports[_0x93a4('0xc1')]=function(_0x1b78b6,_0x18c2b2,_0x49ecb7){return db['OpenchannelInteraction'][_0x93a4('0x60')]({'where':{'id':_0x1b78b6[_0x93a4('0xb0')]['id']}})[_0x93a4('0x2a')](handleEntityNotFound(_0x18c2b2,null))[_0x93a4('0x2a')](function(_0x41952f){if(_0x41952f){return _0x41952f['setTags'](_0x1b78b6['body'][_0x93a4('0xba')],_['omit'](_0x1b78b6['body'],['ids','id'])||{})[_0x93a4('0xc2')](function(){return db[_0x93a4('0x6e')][_0x93a4('0xc0')]({'attributes':['id','name',_0x93a4('0x4a')],'where':{'id':_0x1b78b6[_0x93a4('0xb5')]['ids']}});})[_0x93a4('0x2a')](function(_0x35a940){socket[_0x93a4('0xc3')](_0x93a4('0xc4'),{'id':Number(_0x1b78b6[_0x93a4('0xb0')]['id']),'tags':_0x35a940||[]});return{'id':Number(_0x1b78b6[_0x93a4('0xb0')]['id']),'tags':_0x35a940||[]};});}})[_0x93a4('0x2a')](respondWithResult(_0x18c2b2,null))[_0x93a4('0xae')](handleError(_0x18c2b2,null));};exports[_0x93a4('0xc5')]=function(_0xa63df5,_0x10c06c,_0x455f4b){return db[_0x93a4('0x37')][_0x93a4('0x60')]({'where':{'id':_0xa63df5[_0x93a4('0xb0')]['id']}})[_0x93a4('0x2a')](handleEntityNotFound(_0x10c06c,null))[_0x93a4('0x2a')](function(_0x48b576){if(_0x48b576){return _0x48b576[_0x93a4('0xc5')](_0xa63df5[_0x93a4('0x3c')][_0x93a4('0xba')]);}})[_0x93a4('0x2a')](respondWithStatusCode(_0x10c06c,null))[_0x93a4('0xae')](handleError(_0x10c06c,null));};exports[_0x93a4('0xc6')]=function(_0x3a4149,_0x2745c1){var _0x332823=moment()['unix']()[_0x93a4('0x98')]();var _0x56aeb2=path[_0x93a4('0xc7')](config['root'],_0x93a4('0xc8'),_0x93a4('0xc9'),'tmp');var _0xd3c61d=path[_0x93a4('0xc7')](config[_0x93a4('0xca')],'server',_0x93a4('0xc9'),_0x93a4('0xcb'));var _0x7f101=path[_0x93a4('0xc7')](_0x56aeb2,_0x332823);var _0x1eb585=util[_0x93a4('0xbe')](_0x93a4('0xcc'),_0x3a4149[_0x93a4('0xb0')]['id'],_0x332823);var _0x1a1e71=path['join'](_0x56aeb2,_0x1eb585);var _0x5390cf=[];_0x5390cf['push']({'model':db['User'],'as':_0x93a4('0xcd'),'attributes':['id',_0x93a4('0x31')],'raw':!![]});_0x5390cf[_0x93a4('0x34')]({'model':db[_0x93a4('0xce')],'as':_0x93a4('0x66'),'attributes':['id','firstName',_0x93a4('0xcf')],'raw':!![]});if(_0x3a4149[_0x93a4('0x3c')][_0x93a4('0xcb')]){_0x5390cf[_0x93a4('0x34')]({'model':db[_0x93a4('0xd0')],'as':_0x93a4('0xd0'),'raw':!![]});}var _0x19115e=[{'model':db[_0x93a4('0xb8')],'as':_0x93a4('0xd1'),'attributes':['id',_0x93a4('0xb5'),_0x93a4('0x7b'),_0x93a4('0xd2'),_0x93a4('0xd3'),_0x93a4('0x80')],'include':_0x5390cf}];_0x19115e['push']({'model':db[_0x93a4('0xd4')],'as':_0x93a4('0xd5'),'attributes':['id','name']});_0x19115e[_0x93a4('0x34')]({'model':db[_0x93a4('0xcd')],'as':'Owner','attributes':['id',_0x93a4('0x31')]});return db[_0x93a4('0x37')][_0x93a4('0x60')]({'where':{'id':_0x3a4149['params']['id']},'include':_0x19115e})[_0x93a4('0x2a')](handleEntityNotFound(_0x2745c1,null))[_0x93a4('0x2a')](function(_0x19a377){if(_0x19a377){var _0x726f0d=_0x19a377[_0x93a4('0xd6')]({'plain':!![]});fs[_0x93a4('0xd7')](_0x7f101);var _0x3ed243={'channel':_0x93a4('0xd8'),'account':_0x726f0d[_0x93a4('0xd5')][_0x93a4('0x2e')],'agent':_0x726f0d['Owner']?_0x726f0d[_0x93a4('0xd9')][_0x93a4('0x31')]:_0x93a4('0xda'),'createdAt':moment(_0x726f0d[_0x93a4('0x7b')])[_0x93a4('0xbe')](_0x93a4('0xbf'))[_0x93a4('0x98')](),'closedAt':_0x726f0d[_0x93a4('0xdb')]?moment(_0x726f0d[_0x93a4('0xdc')])[_0x93a4('0xbe')](_0x93a4('0xbf'))[_0x93a4('0x98')]():'','disposition':_0x726f0d[_0x93a4('0xdd')],'visibility':_0x726f0d[_0x93a4('0xde')]?_0x93a4('0xdf'):_0x93a4('0xe0'),'messages':_(_0x726f0d[_0x93a4('0xd1')])[_0x93a4('0x85')]({'secret':![]})[_0x93a4('0x30')](function(_0x3b2ded){if(_0x3b2ded[_0x93a4('0xd0')]){var _0x4023c4=path[_0x93a4('0xc7')](_0xd3c61d,_0x3b2ded[_0x93a4('0xd0')][_0x93a4('0xe1')]);if(fs[_0x93a4('0xe2')](_0x4023c4)){fs[_0x93a4('0xe3')](_0x4023c4)[_0x93a4('0xe4')](fs['createWriteStream'](path['join'](_0x7f101,_0x3b2ded['Attachment'][_0x93a4('0xe1')])));}}return{'date':moment(_0x3b2ded[_0x93a4('0x7b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x93a4('0x98')](),'sender':_0x3b2ded[_0x93a4('0xd2')]===_0x93a4('0xe5')?_0x3b2ded[_0x93a4('0xcd')]?_0x3b2ded[_0x93a4('0xcd')][_0x93a4('0x31')]:'System':_0x3b2ded['Contact']['firstName']+(_0x3b2ded[_0x93a4('0x66')]['lastName']?'\x20'+_0x3b2ded[_0x93a4('0x66')]['lastName']:''),'body':_0x3b2ded['Attachment']?_0x3b2ded['Attachment'][_0x93a4('0xe1')]:_0x3b2ded[_0x93a4('0xb5')],'direction':_0x3b2ded[_0x93a4('0xd2')]==='out'?'A':'C','secret':_0x3b2ded[_0x93a4('0xd3')],'read':_0x3b2ded[_0x93a4('0x80')],'attachment':_0x3b2ded[_0x93a4('0xd0')]};})['value']()};return ejs[_0x93a4('0xe6')](path[_0x93a4('0xc7')](config[_0x93a4('0xca')],_0x93a4('0xc8'),_0x93a4('0xe7'),'downloadInteraction.ejs'),{'interaction':_0x3ed243})[_0x93a4('0x2a')](function(_0x9d09cc){var _0x3bfcb3=path['join'](_0x7f101,_0x93a4('0xe8')+_0x726f0d['id']+'-'+_0x332823+_0x93a4('0xe9'));var _0x24239f={'path':_0x3bfcb3,'channel':'Openchannel','interactionId':_0x726f0d['id']};return pdf[_0x93a4('0xea')](_0x9d09cc,_0x24239f);})[_0x93a4('0x2a')](function(){return new BPromise(function(_0x3ff89a,_0x3398de){zipdir(_0x7f101,{'saveTo':_0x1a1e71},function(_0x529095,_0x221ec2){if(_0x529095)return _0x3398de(_0x529095);return _0x3ff89a(_0x221ec2);});})[_0x93a4('0x2a')](function(){return new BPromise(function(_0x4af49c,_0x3de72b){rimraf(_0x7f101,function(_0x263d8a){if(_0x263d8a)_0x3de72b(_0x263d8a);return _0x4af49c();});});})['then'](function(){return _0x2745c1[_0x93a4('0xc6')](_0x1a1e71,_0x1eb585,function(_0x52cf23){if(_0x52cf23){console[_0x93a4('0xeb')](_0x93a4('0xec'),_0x52cf23);}else{fs['unlinkSync'](_0x1a1e71);}});});});}else{return _0x2745c1[_0x93a4('0x1e')](0xc8);}})[_0x93a4('0xae')](handleError(_0x2745c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 31b0e7b..54637f9 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 _0xbf79=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xbf79,0x7a));var _0x9bf7=function(_0x3d8c2a,_0x3ab79e){_0x3d8c2a=_0x3d8c2a-0x0;var _0x7b82ec=_0xbf79[_0x3d8c2a];return _0x7b82ec;};'use strict';var EventEmitter=require(_0x9bf7('0x0'));var OpenchannelInteraction=require(_0x9bf7('0x1'))['db'][_0x9bf7('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x9bf7('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9bf7('0x4')](0x0);var events={'afterCreate':_0x9bf7('0x5'),'afterUpdate':_0x9bf7('0x6'),'afterDestroy':_0x9bf7('0x7')};function emitEvent(_0x33ae59){return function(_0x14d787,_0x331234,_0x215b3a){_0x14d787[_0x9bf7('0x8')]({'attributes':['id'],'raw':!![]})[_0x9bf7('0x9')](function(_0x5d1cfb){_0x14d787[_0x9bf7('0xa')]('Users',_0x5d1cfb[_0x9bf7('0xb')](function(_0x37a92f){return{'id':_0x37a92f['id']};}));return OpenchannelMessage[_0x9bf7('0xc')]({'where':{'OpenchannelInteractionId':_0x14d787['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9bf7('0x9')](function(_0x181eb2){_0x14d787[_0x9bf7('0xa')](_0x9bf7('0xd'),_0x181eb2[_0x9bf7('0xe')]);OpenchannelInteractionEvents['emit'](_0x33ae59+':'+_0x14d787['id'],_0x14d787);OpenchannelInteractionEvents['emit'](_0x33ae59,_0x14d787);_0x215b3a(null);})[_0x9bf7('0xf')](_0x215b3a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x9bf7('0x10')](e,emitEvent(event));}}module[_0x9bf7('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x79d6=['findAll','setDataValue','length','emit','catch','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','save','update','remove','getUsers','then','Users','map'];(function(_0x847cfe,_0x372912){var _0x43924a=function(_0x197ea5){while(--_0x197ea5){_0x847cfe['push'](_0x847cfe['shift']());}};_0x43924a(++_0x372912);}(_0x79d6,0x139));var _0x679d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79d6[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x679d('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x679d('0x1')];var OpenchannelMessage=require(_0x679d('0x2'))['db'][_0x679d('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x679d('0x4'),'afterUpdate':_0x679d('0x5'),'afterDestroy':_0x679d('0x6')};function emitEvent(_0x37506c){return function(_0x15aa58,_0x1361a7,_0x53d440){_0x15aa58[_0x679d('0x7')]({'attributes':['id'],'raw':!![]})[_0x679d('0x8')](function(_0x29e42e){_0x15aa58['setDataValue'](_0x679d('0x9'),_0x29e42e[_0x679d('0xa')](function(_0x1cd356){return{'id':_0x1cd356['id']};}));return OpenchannelMessage[_0x679d('0xb')]({'where':{'OpenchannelInteractionId':_0x15aa58['id'],'direction':'in','read':![]},'raw':!![]});})[_0x679d('0x8')](function(_0x3d9690){_0x15aa58[_0x679d('0xc')]('unreadMessages',_0x3d9690[_0x679d('0xd')]);OpenchannelInteractionEvents[_0x679d('0xe')](_0x37506c+':'+_0x15aa58['id'],_0x15aa58);OpenchannelInteractionEvents['emit'](_0x37506c,_0x15aa58);_0x53d440(null);})[_0x679d('0xf')](_0x53d440(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x679d('0x10')](e,emitEvent(event));}}module[_0x679d('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index c14f303..b7951f6 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 _0x79df=['define','OpenchannelInteraction','openchannel_interactions','changed','closed','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x35e54a,_0x46953a){var _0x35c2b0=function(_0x3c0ab9){while(--_0x3c0ab9){_0x35e54a['push'](_0x35e54a['shift']());}};_0x35c2b0(++_0x46953a);}(_0x79df,0x1e1));var _0xf79d=function(_0x4980d2,_0xa6c0e4){_0x4980d2=_0x4980d2-0x0;var _0x4690d1=_0x79df[_0x4980d2];return _0x4690d1;};'use strict';var _=require(_0xf79d('0x0'));var util=require(_0xf79d('0x1'));var logger=require(_0xf79d('0x2'))(_0xf79d('0x3'));var moment=require(_0xf79d('0x4'));var BPromise=require(_0xf79d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf79d('0x6'));var rimraf=require('rimraf');var config=require(_0xf79d('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xf79d('0x8')]=function(_0x894c7a,_0xec5657){return _0x894c7a[_0xf79d('0x9')](_0xf79d('0xa'),attributes,{'tableName':_0xf79d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35d55e,_0x32a704,_0x4cdab0){if(_0x35d55e[_0xf79d('0xc')](_0xf79d('0xd'))){_0x35d55e['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4cdab0(null,_0x35d55e);}}});}; \ No newline at end of file +var _0x32f4=['api','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x5be730,_0x326e58){var _0x233877=function(_0xed675d){while(--_0xed675d){_0x5be730['push'](_0x5be730['shift']());}};_0x233877(++_0x326e58);}(_0x32f4,0xc1));var _0x432f=function(_0x106da8,_0x1cd8ee){_0x106da8=_0x106da8-0x0;var _0x1c7f59=_0x32f4[_0x106da8];return _0x1c7f59;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var logger=require('../../config/logger')(_0x432f('0x2'));var moment=require(_0x432f('0x3'));var BPromise=require(_0x432f('0x4'));var rp=require(_0x432f('0x5'));var fs=require('fs');var path=require(_0x432f('0x6'));var rimraf=require('rimraf');var config=require(_0x432f('0x7'));var attributes=require(_0x432f('0x8'));module[_0x432f('0x9')]=function(_0x1cc48d,_0x34f825){return _0x1cc48d['define'](_0x432f('0xa'),attributes,{'tableName':_0x432f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x60f5a5,_0xd563e0,_0x479bbb){if(_0x60f5a5['changed']('closed')){_0x60f5a5[_0x432f('0xc')]=moment()[_0x432f('0xd')](_0x432f('0xe'));}_0x479bbb(null,_0x60f5a5);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index be2919c..7ad50aa 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 _0x5caf=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','limit','debug','OpenchannelInteraction','find','where','addTags','ids','omit','AddTags','util','bluebird','randomstring'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x5caf,0x1c5));var _0xf5ca=function(_0x16bac6,_0x377bca){_0x16bac6=_0x16bac6-0x0;var _0xc08a6d=_0x5caf[_0x16bac6];return _0xc08a6d;};'use strict';var _=require('lodash');var util=require(_0xf5ca('0x0'));var moment=require('moment');var BPromise=require(_0xf5ca('0x1'));var rs=require(_0xf5ca('0x2'));var fs=require('fs');var Redis=require(_0xf5ca('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf5ca('0x4'));var logger=require(_0xf5ca('0x5'))(_0xf5ca('0x6'));var config=require(_0xf5ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf5ca('0x8')][_0xf5ca('0x9')]({'port':0x232a});config[_0xf5ca('0xa')]=_[_0xf5ca('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf5ca('0xc'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xf5ca('0xd')](socket);function respondWithRpcPromise(_0xff80ce,_0x29c2d7,_0x233411){return new BPromise(function(_0x2600af,_0x579bcc){return client['request'](_0xff80ce,_0x233411)[_0xf5ca('0xe')](function(_0x5da295){logger[_0xf5ca('0xf')](_0xf5ca('0x10'),_0x29c2d7,_0xf5ca('0x11'));logger['debug'](_0xf5ca('0x12'),_0x29c2d7,_0xf5ca('0x11'),JSON[_0xf5ca('0x13')](_0x5da295));if(_0x5da295[_0xf5ca('0x14')]){if(_0x5da295[_0xf5ca('0x14')][_0xf5ca('0x15')]===0x1f4){logger['error'](_0xf5ca('0x10'),_0x29c2d7,_0x5da295['error'][_0xf5ca('0x16')]);return _0x579bcc(_0x5da295[_0xf5ca('0x14')][_0xf5ca('0x16')]);}logger[_0xf5ca('0x14')](_0xf5ca('0x10'),_0x29c2d7,_0x5da295[_0xf5ca('0x14')][_0xf5ca('0x16')]);return _0x2600af(_0x5da295['error'][_0xf5ca('0x16')]);}else{logger[_0xf5ca('0xf')](_0xf5ca('0x10'),_0x29c2d7,_0xf5ca('0x11'));_0x2600af(_0x5da295[_0xf5ca('0x17')]['message']);}})[_0xf5ca('0x18')](function(_0x55f4f3){logger[_0xf5ca('0x14')](_0xf5ca('0x10'),_0x29c2d7,_0x55f4f3);_0x579bcc(_0x55f4f3);});});}exports[_0xf5ca('0x19')]=function(_0x184508){var _0x42b4af=this;return new Promise(function(_0x51862b,_0x3cb120){return db['OpenchannelInteraction'][_0xf5ca('0x1a')](_0x184508[_0xf5ca('0x1b')],{'raw':_0x184508['options']?_0x184508['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x184508[_0xf5ca('0x1c')]?_0x184508[_0xf5ca('0x1c')]['where']||null:null,'attributes':_0x184508[_0xf5ca('0x1c')]?_0x184508[_0xf5ca('0x1c')]['attributes']||null:null,'limit':_0x184508['options']?_0x184508[_0xf5ca('0x1c')][_0xf5ca('0x1d')]||null:null})[_0xf5ca('0xe')](function(_0x349a2b){logger[_0xf5ca('0xf')](_0xf5ca('0x19'),_0x184508);logger[_0xf5ca('0x1e')](_0xf5ca('0x19'),_0x184508,JSON['stringify'](_0x349a2b));_0x51862b(_0x349a2b);})[_0xf5ca('0x18')](function(_0x420e6c){logger['error']('UpdateOpenchannelInteraction',_0x420e6c[_0xf5ca('0x16')],_0x184508);_0x3cb120(_0x42b4af['error'](0x1f4,_0x420e6c[_0xf5ca('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x11fb16){return new Promise(function(_0x18d442,_0x90b272){return db[_0xf5ca('0x1f')][_0xf5ca('0x20')]({'where':_0x11fb16[_0xf5ca('0x1c')]?_0x11fb16[_0xf5ca('0x1c')][_0xf5ca('0x21')]||null:null})['then'](function(_0x34609f){if(_0x34609f){return _0x34609f[_0xf5ca('0x22')](_0x11fb16['body'][_0xf5ca('0x23')],_[_0xf5ca('0x24')](_0x11fb16[_0xf5ca('0x1b')],[_0xf5ca('0x23'),'id'])||{});}})['spread'](function(_0x126f5d){logger['info'](_0xf5ca('0x25'),_0x11fb16);logger[_0xf5ca('0x1e')](_0xf5ca('0x25'),_0x11fb16,JSON['stringify'](_0x126f5d));_0x18d442(_0x126f5d);})['catch'](function(_0x25c7ad){logger[_0xf5ca('0x14')](_0xf5ca('0x25'),_0x25c7ad[_0xf5ca('0x16')],_0x11fb16);_0x90b272(_this[_0xf5ca('0x14')](0x1f4,_0x25c7ad[_0xf5ca('0x16')]));});});}; \ No newline at end of file +var _0xf082=['then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','OpenchannelInteraction','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','find','ids','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request'];(function(_0x241ddf,_0x49328b){var _0x5cb61c=function(_0x4db6fd){while(--_0x4db6fd){_0x241ddf['push'](_0x241ddf['shift']());}};_0x5cb61c(++_0x49328b);}(_0xf082,0xb6));var _0x2f08=function(_0x10675c,_0x10fa1f){_0x10675c=_0x10675c-0x0;var _0x29633c=_0xf082[_0x10675c];return _0x29633c;};'use strict';var _=require('lodash');var util=require(_0x2f08('0x0'));var moment=require(_0x2f08('0x1'));var BPromise=require(_0x2f08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f08('0x3'))['db'];var utils=require(_0x2f08('0x4'));var logger=require(_0x2f08('0x5'))(_0x2f08('0x6'));var config=require(_0x2f08('0x7'));var jayson=require(_0x2f08('0x8'));var client=jayson[_0x2f08('0x9')][_0x2f08('0xa')]({'port':0x232a});config[_0x2f08('0xb')]=_[_0x2f08('0xc')](config[_0x2f08('0xb')],{'host':_0x2f08('0xd'),'port':0x18eb});var socket=require(_0x2f08('0xe'))(new Redis(config[_0x2f08('0xb')]));require(_0x2f08('0xf'))[_0x2f08('0x10')](socket);function respondWithRpcPromise(_0x145340,_0x3c02a9,_0xe42930){return new BPromise(function(_0x4b1fa7,_0x284e7f){return client[_0x2f08('0x11')](_0x145340,_0xe42930)[_0x2f08('0x12')](function(_0x49a9f4){logger[_0x2f08('0x13')](_0x2f08('0x14'),_0x3c02a9,'request\x20sent');logger[_0x2f08('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3c02a9,_0x2f08('0x16'),JSON[_0x2f08('0x17')](_0x49a9f4));if(_0x49a9f4[_0x2f08('0x18')]){if(_0x49a9f4[_0x2f08('0x18')][_0x2f08('0x19')]===0x1f4){logger['error'](_0x2f08('0x14'),_0x3c02a9,_0x49a9f4[_0x2f08('0x18')][_0x2f08('0x1a')]);return _0x284e7f(_0x49a9f4[_0x2f08('0x18')][_0x2f08('0x1a')]);}logger[_0x2f08('0x18')](_0x2f08('0x14'),_0x3c02a9,_0x49a9f4['error'][_0x2f08('0x1a')]);return _0x4b1fa7(_0x49a9f4[_0x2f08('0x18')][_0x2f08('0x1a')]);}else{logger[_0x2f08('0x13')](_0x2f08('0x14'),_0x3c02a9,'request\x20sent');_0x4b1fa7(_0x49a9f4[_0x2f08('0x1b')][_0x2f08('0x1a')]);}})['catch'](function(_0x12df4e){logger[_0x2f08('0x18')](_0x2f08('0x14'),_0x3c02a9,_0x12df4e);_0x284e7f(_0x12df4e);});});}exports['UpdateOpenchannelInteraction']=function(_0x7deeff){var _0x4c6032=this;return new Promise(function(_0x1ca434,_0x187d1f){return db[_0x2f08('0x1c')][_0x2f08('0x1d')](_0x7deeff[_0x2f08('0x1e')],{'raw':_0x7deeff['options']?_0x7deeff[_0x2f08('0x1f')][_0x2f08('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7deeff[_0x2f08('0x1f')]?_0x7deeff[_0x2f08('0x1f')][_0x2f08('0x21')]||null:null,'attributes':_0x7deeff[_0x2f08('0x1f')]?_0x7deeff[_0x2f08('0x1f')]['attributes']||null:null,'limit':_0x7deeff[_0x2f08('0x1f')]?_0x7deeff[_0x2f08('0x1f')][_0x2f08('0x22')]||null:null})[_0x2f08('0x12')](function(_0x2728e5){logger['info'](_0x2f08('0x23'),_0x7deeff);logger[_0x2f08('0x15')](_0x2f08('0x23'),_0x7deeff,JSON[_0x2f08('0x17')](_0x2728e5));_0x1ca434(_0x2728e5);})['catch'](function(_0x23185c){logger[_0x2f08('0x18')]('UpdateOpenchannelInteraction',_0x23185c[_0x2f08('0x1a')],_0x7deeff);_0x187d1f(_0x4c6032[_0x2f08('0x18')](0x1f4,_0x23185c[_0x2f08('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x553cbd){return new Promise(function(_0x49abc0,_0x4bb7e4){return db[_0x2f08('0x1c')][_0x2f08('0x24')]({'where':_0x553cbd[_0x2f08('0x1f')]?_0x553cbd[_0x2f08('0x1f')]['where']||null:null})[_0x2f08('0x12')](function(_0x392b7c){if(_0x392b7c){return _0x392b7c['addTags'](_0x553cbd[_0x2f08('0x1e')][_0x2f08('0x25')],_['omit'](_0x553cbd['body'],[_0x2f08('0x25'),'id'])||{});}})[_0x2f08('0x26')](function(_0x5ef9bd){logger[_0x2f08('0x13')]('AddTags',_0x553cbd);logger[_0x2f08('0x15')](_0x2f08('0x27'),_0x553cbd,JSON['stringify'](_0x5ef9bd));_0x49abc0(_0x5ef9bd);})['catch'](function(_0x5976b3){logger[_0x2f08('0x18')](_0x2f08('0x27'),_0x5976b3[_0x2f08('0x1a')],_0x553cbd);_0x4bb7e4(_this['error'](0x1f4,_0x5976b3[_0x2f08('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 3dd7c56..20fbb41 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 _0x9ce5=['length','./openchannelInteraction.events','save','remove','removeListener','register'];(function(_0x22fc88,_0xae9f18){var _0x3b2709=function(_0x22f15b){while(--_0x22f15b){_0x22fc88['push'](_0x22fc88['shift']());}};_0x3b2709(++_0xae9f18);}(_0x9ce5,0xc7));var _0x59ce=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x9ce5[_0x5eb22e];return _0x27fed5;};'use strict';var OpenchannelInteractionEvents=require(_0x59ce('0x0'));var events=[_0x59ce('0x1'),_0x59ce('0x2'),'update'];function createListener(_0x2b3ca9,_0x11e43d){return function(_0x485578){_0x11e43d['emit'](_0x2b3ca9,_0x485578);};}function removeListener(_0x3b261c,_0x31a8ad){return function(){OpenchannelInteractionEvents[_0x59ce('0x3')](_0x3b261c,_0x31a8ad);};}exports[_0x59ce('0x4')]=function(_0x37ed18){for(var _0x1df6fa=0x0,_0xae0137=events[_0x59ce('0x5')];_0x1df6fa<_0xae0137;_0x1df6fa++){var _0x25f558=events[_0x1df6fa];var _0x41f31c=createListener('openchannelInteraction:'+_0x25f558,_0x37ed18);OpenchannelInteractionEvents['on'](_0x25f558,_0x41f31c);}}; \ No newline at end of file +var _0xc035=['save','remove','update','emit','length','./openchannelInteraction.events'];(function(_0x29d849,_0x209ceb){var _0x30b104=function(_0x2a1669){while(--_0x2a1669){_0x29d849['push'](_0x29d849['shift']());}};_0x30b104(++_0x209ceb);}(_0xc035,0x83));var _0x5c03=function(_0x4419f6,_0x344791){_0x4419f6=_0x4419f6-0x0;var _0x38c7d9=_0xc035[_0x4419f6];return _0x38c7d9;};'use strict';var OpenchannelInteractionEvents=require(_0x5c03('0x0'));var events=[_0x5c03('0x1'),_0x5c03('0x2'),_0x5c03('0x3')];function createListener(_0x2063cf,_0x3dbb7a){return function(_0x253bc9){_0x3dbb7a[_0x5c03('0x4')](_0x2063cf,_0x253bc9);};}function removeListener(_0xc324ee,_0x487650){return function(){OpenchannelInteractionEvents['removeListener'](_0xc324ee,_0x487650);};}exports['register']=function(_0x1c3af5){for(var _0x338076=0x0,_0x4a0e34=events[_0x5c03('0x5')];_0x338076<_0x4a0e34;_0x338076++){var _0x28c8d7=events[_0x338076];var _0x326d7f=createListener('openchannelInteraction:'+_0x28c8d7,_0x1c3af5);OpenchannelInteractionEvents['on'](_0x28c8d7,_0x326d7f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 324f628..cd5e658 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x2387c5,_0xfcc74c){var _0x2c414c=function(_0x3d1881){while(--_0x3d1881){_0x2387c5['push'](_0x2387c5['shift']());}};_0x2c414c(++_0xfcc74c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xcb91[_0xc82d1a];return _0x32fad2;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x5c4104,_0x2005b9){var _0x2e977b=function(_0x5d98bc){while(--_0x5d98bc){_0x5c4104['push'](_0x5c4104['shift']());}};_0x2e977b(++_0x2005b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 9eccfe0..e778088 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 _0x26f9=['exports','medium','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x53c389,_0xb8e5d){var _0x37ecf6=function(_0x5b67a5){while(--_0x5b67a5){_0x53c389['push'](_0x53c389['shift']());}};_0x37ecf6(++_0xb8e5d);}(_0x26f9,0x16f));var _0x926f=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x26f9[_0x4ec520];return _0xed49d7;};'use strict';var Sequelize=require(_0x926f('0x0'));module[_0x926f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x926f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x926f('0x3')]('in',_0x926f('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x926f('0x5')]},'providerName':{'type':Sequelize[_0x926f('0x6')]},'providerResponse':{'type':Sequelize[_0x926f('0x7')]}}; \ No newline at end of file +var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x854fa,_0x2b8b94){var _0x6f6162=function(_0x62aa33){while(--_0x62aa33){_0x854fa['push'](_0x854fa['shift']());}};_0x6f6162(++_0x2b8b94);}(_0xe2ab,0xc4));var _0xbe2a=function(_0xcbbc7d,_0x49e121){_0xcbbc7d=_0xcbbc7d-0x0;var _0x2c7d27=_0xe2ab[_0xcbbc7d];return _0x2c7d27;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 6f3b309..f3d65cc 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 _0x91b1=['findAll','rows','keys','create','body','find','params','describe','../../config/logger','openchannel-interactions','openchannel','read','readAt','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','SIP/%s','channel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x22d655,_0x3941dd){var _0x257739=function(_0x98136e){while(--_0x98136e){_0x22d655['push'](_0x22d655['shift']());}};_0x257739(++_0x3941dd);}(_0x91b1,0x1c4));var _0x191b=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x91b1[_0x5a636f];return _0x6a8cfb;};'use strict';var emlformat=require(_0x191b('0x0'));var rimraf=require(_0x191b('0x1'));var zipdir=require(_0x191b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x191b('0x3'));var moment=require('moment');var BPromise=require(_0x191b('0x4'));var Mustache=require(_0x191b('0x5'));var util=require(_0x191b('0x6'));var path=require(_0x191b('0x7'));var sox=require(_0x191b('0x8'));var csv=require('to-csv');var ejs=require(_0x191b('0x9'));var fs=require('fs');var fs_extra=require(_0x191b('0xa'));var _=require(_0x191b('0xb'));var squel=require('squel');var crypto=require(_0x191b('0xc'));var jsforce=require(_0x191b('0xd'));var deskjs=require(_0x191b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x191b('0xf'));var Papa=require(_0x191b('0x10'));var Redis=require(_0x191b('0x11'));var authService=require(_0x191b('0x12'));var qs=require(_0x191b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x191b('0x14'));var logger=require('../../config/logger')(_0x191b('0x15'));var utils=require(_0x191b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x191b('0x17'))['db'];config[_0x191b('0x18')]=_[_0x191b('0x19')](config[_0x191b('0x18')],{'host':_0x191b('0x1a'),'port':0x18eb});var socket=require(_0x191b('0x1b'))(new Redis(config[_0x191b('0x18')]));require(_0x191b('0x1c'))[_0x191b('0x1d')](socket);var jayson=require(_0x191b('0x1e'));var client=jayson[_0x191b('0x1f')][_0x191b('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x191b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2a04b6,_0x54be1e,_0x2a9d1b,_0x52945d){return new BPromise(function(_0x2c825e,_0x1be6ac){var _0xcb17e8=_0x52945d||client;return _0xcb17e8['request'](_0x2a04b6,_0x2a9d1b)[_0x191b('0x21')](function(_0x2d6062){logger[_0x191b('0x22')](_0x191b('0x23'),_0x54be1e,_0x191b('0x24'));logger[_0x191b('0x25')](_0x191b('0x26'),_0x54be1e,_0x191b('0x24'),JSON[_0x191b('0x27')](_0x2d6062));if(_0x2d6062['error']){if(_0x2d6062[_0x191b('0x28')][_0x191b('0x29')]===0x1f4){logger['error'](_0x191b('0x23'),_0x54be1e,_0x2d6062['error']['message']);return _0x1be6ac(_0x2d6062[_0x191b('0x28')][_0x191b('0x2a')]);}logger['error'](_0x191b('0x23'),_0x54be1e,_0x2d6062[_0x191b('0x28')][_0x191b('0x2a')]);return _0x2c825e(_0x2d6062[_0x191b('0x28')][_0x191b('0x2a')]);}else{logger[_0x191b('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x54be1e,_0x191b('0x24'));_0x2c825e(_0x2d6062['result'][_0x191b('0x2a')]);}})[_0x191b('0x2b')](function(_0x3ba1b2){logger[_0x191b('0x28')](_0x191b('0x23'),_0x54be1e,_0x3ba1b2);_0x1be6ac(_0x3ba1b2);});});}function respondWithStatusCode(_0x2b1320,_0x20f1ff){_0x20f1ff=_0x20f1ff||0xcc;return function(_0x18d42f){if(_0x18d42f){return _0x2b1320[_0x191b('0x2c')](_0x20f1ff);}return _0x2b1320[_0x191b('0x2d')](_0x20f1ff)[_0x191b('0x2e')]();};}function respondWithResult(_0x59f85b,_0x1d7ce9){_0x1d7ce9=_0x1d7ce9||0xc8;return function(_0x54206d){if(_0x54206d){return _0x59f85b[_0x191b('0x2d')](_0x1d7ce9)[_0x191b('0x2f')](_0x54206d);}};}function respondWithFilteredResult(_0x43a787,_0x3258a3){return function(_0x361b4f){if(_0x361b4f){var _0x575e9f=typeof _0x3258a3[_0x191b('0x30')]===_0x191b('0x31')&&typeof _0x3258a3['limit']===_0x191b('0x31');var _0x539fef=_0x361b4f[_0x191b('0x32')];var _0x9b28c4=_0x575e9f?0x0:_0x3258a3[_0x191b('0x30')];var _0x1cc55b=_0x575e9f?_0x361b4f[_0x191b('0x32')]:_0x3258a3[_0x191b('0x30')]+_0x3258a3[_0x191b('0x33')];var _0x469045;if(_0x1cc55b>=_0x539fef){_0x1cc55b=_0x539fef;_0x469045=0xc8;}else{_0x469045=0xce;}_0x43a787['status'](_0x469045);return _0x43a787[_0x191b('0x34')]('Content-Range',_0x9b28c4+'-'+_0x1cc55b+'/'+_0x539fef)[_0x191b('0x2f')](_0x361b4f);}return null;};}function patchUpdates(_0x1ace9a){return function(_0x5b2645){try{jsonpatch[_0x191b('0x35')](_0x5b2645,_0x1ace9a,!![]);}catch(_0x353edc){return BPromise[_0x191b('0x36')](_0x353edc);}return _0x5b2645[_0x191b('0x37')]();};}function saveUpdates(_0x5616ae,_0x248f06){return function(_0x7d7b2f){if(_0x7d7b2f){return _0x7d7b2f[_0x191b('0x38')](_0x5616ae)[_0x191b('0x21')](function(_0x10bbdb){return _0x10bbdb;});}return null;};}function removeEntity(_0x535a6e,_0xd97037){return function(_0x4434b9){if(_0x4434b9){return _0x4434b9[_0x191b('0x39')]()[_0x191b('0x21')](function(){_0x535a6e[_0x191b('0x2d')](0xcc)[_0x191b('0x2e')]();});}};}function handleEntityNotFound(_0x482bdf,_0x21ba4a){return function(_0x238317){if(!_0x238317){_0x482bdf['sendStatus'](0x194);}return _0x238317;};}function handleError(_0x1297c9,_0x3a2805){_0x3a2805=_0x3a2805||0x1f4;return function(_0x2bd34c){logger[_0x191b('0x28')](_0x2bd34c[_0x191b('0x3a')]);if(_0x2bd34c[_0x191b('0x3b')]){delete _0x2bd34c[_0x191b('0x3b')];}_0x1297c9[_0x191b('0x2d')](_0x3a2805)[_0x191b('0x3c')](_0x2bd34c);};}exports[_0x191b('0x3d')]=function(_0x599060,_0x5d263c){var _0x57997f={},_0x53d863={},_0x437806={'count':0x0,'rows':[]};var _0x1e6363=_['map'](db[_0x191b('0x3e')][_0x191b('0x3f')],function(_0x3a6d5b){return{'name':_0x3a6d5b[_0x191b('0x40')],'type':_0x3a6d5b[_0x191b('0x41')][_0x191b('0x42')]};});_0x53d863['model']=_[_0x191b('0x43')](_0x1e6363,'name');_0x53d863[_0x191b('0x44')]=_['keys'](_0x599060['query']);_0x53d863[_0x191b('0x45')]=_[_0x191b('0x46')](_0x53d863[_0x191b('0x47')],_0x53d863[_0x191b('0x44')]);_0x57997f['attributes']=_['intersection'](_0x53d863[_0x191b('0x47')],qs['fields'](_0x599060[_0x191b('0x44')][_0x191b('0x48')]));_0x57997f[_0x191b('0x49')]=_0x57997f[_0x191b('0x49')][_0x191b('0x4a')]?_0x57997f[_0x191b('0x49')]:_0x53d863['model'];if(!_0x599060[_0x191b('0x44')]['hasOwnProperty'](_0x191b('0x4b'))){_0x57997f[_0x191b('0x33')]=qs[_0x191b('0x33')](_0x599060[_0x191b('0x44')][_0x191b('0x33')]);_0x57997f[_0x191b('0x30')]=qs[_0x191b('0x30')](_0x599060[_0x191b('0x44')][_0x191b('0x30')]);}_0x57997f['order']=qs[_0x191b('0x4c')](_0x599060[_0x191b('0x44')][_0x191b('0x4c')]);_0x57997f[_0x191b('0x4d')]=qs['filters'](_[_0x191b('0x4e')](_0x599060['query'],_0x53d863['filters']),_0x1e6363);if(_0x599060[_0x191b('0x44')][_0x191b('0x4f')]){_0x57997f[_0x191b('0x4d')]=_[_0x191b('0x50')](_0x57997f['where'],{'$or':_['map'](_0x1e6363,function(_0x1aca35){if(_0x1aca35[_0x191b('0x41')]!=='VIRTUAL'){var _0x5eab9e={};_0x5eab9e[_0x1aca35[_0x191b('0x3b')]]={'$like':'%'+_0x599060[_0x191b('0x44')][_0x191b('0x4f')]+'%'};return _0x5eab9e;}})});}_0x57997f=_[_0x191b('0x50')]({},_0x57997f,_0x599060[_0x191b('0x51')]);var _0x3ada48={'where':_0x57997f['where']};return db[_0x191b('0x3e')][_0x191b('0x32')](_0x3ada48)[_0x191b('0x21')](function(_0xf258f9){_0x437806[_0x191b('0x32')]=_0xf258f9;if(_0x599060[_0x191b('0x44')][_0x191b('0x52')]){_0x57997f[_0x191b('0x53')]=[{'all':!![]}];}return db[_0x191b('0x3e')][_0x191b('0x54')](_0x57997f);})['then'](function(_0x6d8e30){_0x437806[_0x191b('0x55')]=_0x6d8e30;return _0x437806;})[_0x191b('0x21')](respondWithFilteredResult(_0x5d263c,_0x57997f))[_0x191b('0x2b')](handleError(_0x5d263c,null));};exports['show']=function(_0xee3db8,_0x34b17d){var _0x5453de={'raw':!![],'where':{'id':_0xee3db8['params']['id']}},_0x23ba87={};_0x23ba87[_0x191b('0x47')]=_[_0x191b('0x56')](db['OpenchannelMessage'][_0x191b('0x3f')]);_0x23ba87['query']=_['keys'](_0xee3db8['query']);_0x23ba87['filters']=_['intersection'](_0x23ba87[_0x191b('0x47')],_0x23ba87[_0x191b('0x44')]);_0x5453de[_0x191b('0x49')]=_[_0x191b('0x46')](_0x23ba87[_0x191b('0x47')],qs['fields'](_0xee3db8[_0x191b('0x44')][_0x191b('0x48')]));_0x5453de[_0x191b('0x49')]=_0x5453de[_0x191b('0x49')]['length']?_0x5453de[_0x191b('0x49')]:_0x23ba87['model'];if(_0xee3db8[_0x191b('0x44')][_0x191b('0x52')]){_0x5453de[_0x191b('0x53')]=[{'all':!![]}];}_0x5453de=_[_0x191b('0x50')]({},_0x5453de,_0xee3db8[_0x191b('0x51')]);return db[_0x191b('0x3e')]['find'](_0x5453de)[_0x191b('0x21')](handleEntityNotFound(_0x34b17d,null))['then'](respondWithResult(_0x34b17d,null))[_0x191b('0x2b')](handleError(_0x34b17d,null));};exports['create']=function(_0x399265,_0x565298){return db[_0x191b('0x3e')][_0x191b('0x57')](_0x399265[_0x191b('0x58')],{})[_0x191b('0x21')](respondWithResult(_0x565298,0xc9))[_0x191b('0x2b')](handleError(_0x565298,null));};exports[_0x191b('0x38')]=function(_0x45ba54,_0x1ebcb9){if(_0x45ba54['body']['id']){delete _0x45ba54['body']['id'];}return db[_0x191b('0x3e')][_0x191b('0x59')]({'where':{'id':_0x45ba54[_0x191b('0x5a')]['id']}})[_0x191b('0x21')](handleEntityNotFound(_0x1ebcb9,null))[_0x191b('0x21')](saveUpdates(_0x45ba54[_0x191b('0x58')],null))[_0x191b('0x21')](respondWithResult(_0x1ebcb9,null))[_0x191b('0x2b')](handleError(_0x1ebcb9,null));};exports[_0x191b('0x39')]=function(_0x2f8d93,_0xc1a5f1){return db[_0x191b('0x3e')][_0x191b('0x59')]({'where':{'id':_0x2f8d93['params']['id']}})[_0x191b('0x21')](handleEntityNotFound(_0xc1a5f1,null))['then'](removeEntity(_0xc1a5f1,null))[_0x191b('0x2b')](handleError(_0xc1a5f1,null));};exports[_0x191b('0x5b')]=function(_0xeb503a,_0x1927d3){return db['OpenchannelMessage'][_0x191b('0x5b')]()['then'](respondWithResult(_0x1927d3,null))['catch'](handleError(_0x1927d3,null));};var interaction_log=require(_0x191b('0x5c'))(_0x191b('0x5d'));exports['accept']=function(_0x5b7991,_0x26636f,_0x127634){var _0x4fff62={'agent':{},'channel':_0x191b('0x5e')};if(_0x5b7991[_0x191b('0x58')]['id']){delete _0x5b7991[_0x191b('0x58')]['id'];}_0x5b7991[_0x191b('0x58')][_0x191b('0x5f')]=!![];_0x5b7991[_0x191b('0x58')][_0x191b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5b7991[_0x191b('0x58')][_0x191b('0x61')]=_0x5b7991['body'][_0x191b('0x61')]||_0x5b7991[_0x191b('0x62')]['id'];_0x4fff62['agent']['id']=_0x5b7991[_0x191b('0x58')][_0x191b('0x61')];return db[_0x191b('0x3e')][_0x191b('0x59')]({'where':{'id':_0x5b7991[_0x191b('0x5a')]['id'],'UserId':null}})[_0x191b('0x21')](handleEntityNotFound(_0x26636f,null))[_0x191b('0x21')](saveUpdates(_0x5b7991[_0x191b('0x58')],null))['then'](function(_0x323d23){if(_0x323d23){_0x4fff62[_0x191b('0x2a')]=_0x323d23[_0x191b('0x63')]({'plain':!![]});return db[_0x191b('0x64')][_0x191b('0x59')]({'where':{'id':_0x323d23[_0x191b('0x65')]}});}return null;})[_0x191b('0x21')](handleEntityNotFound(_0x26636f,null))[_0x191b('0x21')](function(_0x27cad5){if(_0x27cad5){return _0x27cad5[_0x191b('0x38')]({'UserId':_0x5b7991['body'][_0x191b('0x61')],'read1stAt':_[_0x191b('0x66')](_0x27cad5[_0x191b('0x67')])?moment()[_0x191b('0x68')](_0x191b('0x69')):undefined});}return null;})['then'](function(_0x2dce71){if(_0x2dce71){_0x4fff62[_0x191b('0x6a')]=_0x2dce71[_0x191b('0x63')]({'plain':!![]});interaction_log[_0x191b('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5b7991[_0x191b('0x62')]['id'],_0x5b7991[_0x191b('0x62')][_0x191b('0x3b')],_0x5b7991[_0x191b('0x62')][_0x191b('0x6b')],_0x4fff62[_0x191b('0x6a')]['id'],_0x5b7991['body']?JSON[_0x191b('0x27')](_0x5b7991[_0x191b('0x58')]):_0x191b('0x6c'));return respondWithRpcPromise(_0x191b('0x6d'),_0x191b('0x6e'),_0x4fff62);}return null;})[_0x191b('0x21')](function(_0x5e3719){var _0x429ca8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e3719[_0x191b('0x2a')][_0x191b('0x6f')];return db[_0x191b('0x70')][_0x191b('0x44')](_0x429ca8,{'type':db[_0x191b('0x71')][_0x191b('0x72')][_0x191b('0x73')],'raw':!![]})['then'](function(_0x444893){return _0x444893;});})[_0x191b('0x21')](function(_0x1c039c){if(_0x1c039c){_0x4fff62[_0x191b('0x2a')][_0x191b('0x74')]=_0x1c039c[0x0];if(!_0x5b7991[_0x191b('0x58')][_0x191b('0x61')])return;return db[_0x191b('0x75')][_0x191b('0x59')]({'where':{'id':_0x5b7991[_0x191b('0x58')][_0x191b('0x61')],'role':_0x191b('0x76')},'attributes':['id','name',_0x191b('0x77'),_0x191b('0x78'),_0x191b('0x79')],'raw':!![]});}return null;})[_0x191b('0x21')](function(_0x105dc0){if(!_0x105dc0)return null;_0x4fff62[_0x191b('0x2a')][_0x191b('0x76')]=_0x105dc0;return _0x4fff62;})[_0x191b('0x21')](function(_0x42c864){if(_0x42c864){if(_0x5b7991['body']['manual']){_0x4fff62[_0x191b('0x2a')]['interface']=util[_0x191b('0x68')](_0x191b('0x7a'),_0x5b7991[_0x191b('0x62')][_0x191b('0x3b')]);_0x4fff62[_0x191b('0x2a')][_0x191b('0x7b')]=_0x4fff62['channel'];_0x4fff62[_0x191b('0x2a')][_0x191b('0x7c')]=_0x191b('0x7d');return respondWithRpcPromise(_0x191b('0x7e'),_0x191b('0x7e'),{'event':_0x191b('0x7f'),'message':_0x4fff62['message']},client9002)[_0x191b('0x21')](function(){return _0x4fff62;});}return _0x4fff62;}return null;})[_0x191b('0x21')](respondWithResult(_0x26636f,null))['catch'](handleError(_0x26636f,null));};var interaction_log=require(_0x191b('0x5c'))(_0x191b('0x5d'));exports[_0x191b('0x36')]=function(_0x3c7c75,_0x2dd345,_0x2858a1){var _0x219e04={'agent':{},'channel':_0x191b('0x5e')};if(_0x3c7c75['body']['id']){delete _0x3c7c75[_0x191b('0x58')]['id'];}_0x3c7c75[_0x191b('0x58')][_0x191b('0x61')]=_0x3c7c75[_0x191b('0x58')][_0x191b('0x61')]||_0x3c7c75['user']['id'];_0x219e04[_0x191b('0x76')]['id']=_0x3c7c75['body'][_0x191b('0x61')];return db['OpenchannelMessage'][_0x191b('0x59')]({'where':{'id':_0x3c7c75['params']['id'],'UserId':null}})[_0x191b('0x21')](handleEntityNotFound(_0x2dd345,null))[_0x191b('0x21')](function(_0x2248df){if(_0x2248df){_0x219e04[_0x191b('0x2a')]=_0x2248df['get']({'plain':!![]});return db[_0x191b('0x64')][_0x191b('0x59')]({'where':{'id':_0x2248df[_0x191b('0x65')]}});}return null;})[_0x191b('0x21')](handleEntityNotFound(_0x2dd345,null))['then'](function(_0x5bdbcb){if(_0x5bdbcb){_0x219e04[_0x191b('0x6a')]=_0x5bdbcb[_0x191b('0x63')]({'plain':!![]});interaction_log[_0x191b('0x22')](_0x191b('0x80'),_0x3c7c75[_0x191b('0x62')]['id'],_0x3c7c75[_0x191b('0x62')][_0x191b('0x3b')],_0x3c7c75[_0x191b('0x62')][_0x191b('0x6b')],_0x219e04[_0x191b('0x6a')]['id'],_0x3c7c75[_0x191b('0x58')]?JSON[_0x191b('0x27')](_0x3c7c75[_0x191b('0x58')]):_0x191b('0x6c'));return respondWithRpcPromise(_0x191b('0x81'),_0x191b('0x82'),_0x219e04);}return null;})[_0x191b('0x21')](function(_0x325f21){var _0x22af94=_0x191b('0x83')+_0x325f21[_0x191b('0x2a')][_0x191b('0x6f')];return db[_0x191b('0x70')][_0x191b('0x44')](_0x22af94,{'type':db[_0x191b('0x71')][_0x191b('0x72')]['SELECT'],'raw':!![]})[_0x191b('0x21')](function(_0x423cc5){return _0x423cc5;});})['then'](function(_0x385c6d){if(_0x385c6d){_0x219e04[_0x191b('0x2a')][_0x191b('0x74')]=_0x385c6d[0x0];if(!_0x3c7c75['body'][_0x191b('0x61')])return;return db[_0x191b('0x75')]['find']({'where':{'id':_0x3c7c75['body'][_0x191b('0x61')],'role':'agent'},'attributes':['id',_0x191b('0x3b'),_0x191b('0x77'),_0x191b('0x78'),'internal'],'raw':!![]});}return null;})[_0x191b('0x21')](function(_0x50a2a7){if(!_0x50a2a7)return null;_0x219e04[_0x191b('0x2a')][_0x191b('0x76')]=_0x50a2a7;return _0x219e04;})['then'](function(_0x5cfd2a){if(_0x5cfd2a){_0x5cfd2a['message'][_0x191b('0x84')]=util[_0x191b('0x68')](_0x191b('0x7a'),_0x3c7c75[_0x191b('0x62')][_0x191b('0x3b')]);_0x5cfd2a[_0x191b('0x2a')]['channel']=_0x219e04[_0x191b('0x7b')];_0x5cfd2a[_0x191b('0x2a')][_0x191b('0x7c')]=_0x191b('0x36');respondWithRpcPromise(_0x191b('0x7e'),_0x191b('0x7e'),{'event':_0x191b('0x85'),'message':_0x5cfd2a[_0x191b('0x2a')]},client9002);return _0x219e04;}return null;})[_0x191b('0x21')](respondWithResult(_0x2dd345,null))[_0x191b('0x2b')](handleError(_0x2dd345,null));}; \ No newline at end of file +var _0x6eac=['keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','contact','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelMessage.socket','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query'];(function(_0x14eb49,_0x5701e0){var _0x944907=function(_0x5a473c){while(--_0x5a473c){_0x14eb49['push'](_0x14eb49['shift']());}};_0x944907(++_0x5701e0);}(_0x6eac,0x13d));var _0xc6ea=function(_0x1d5466,_0x299e60){_0x1d5466=_0x1d5466-0x0;var _0x3d3eee=_0x6eac[_0x1d5466];return _0x3d3eee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6ea('0x0'));var zipdir=require(_0xc6ea('0x1'));var jsonpatch=require(_0xc6ea('0x2'));var rp=require('request-promise');var moment=require(_0xc6ea('0x3'));var BPromise=require(_0xc6ea('0x4'));var Mustache=require('mustache');var util=require(_0xc6ea('0x5'));var path=require(_0xc6ea('0x6'));var sox=require(_0xc6ea('0x7'));var csv=require(_0xc6ea('0x8'));var ejs=require(_0xc6ea('0x9'));var fs=require('fs');var fs_extra=require(_0xc6ea('0xa'));var _=require(_0xc6ea('0xb'));var squel=require(_0xc6ea('0xc'));var crypto=require(_0xc6ea('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc6ea('0xe'));var toCsv=require(_0xc6ea('0x8'));var querystring=require(_0xc6ea('0xf'));var Papa=require(_0xc6ea('0x10'));var Redis=require(_0xc6ea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc6ea('0x12'));var as=require(_0xc6ea('0x13'));var hardwareService=require(_0xc6ea('0x14'));var logger=require(_0xc6ea('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc6ea('0x16'));var licenseUtil=require(_0xc6ea('0x17'));var db=require(_0xc6ea('0x18'))['db'];config[_0xc6ea('0x19')]=_['defaults'](config[_0xc6ea('0x19')],{'host':_0xc6ea('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc6ea('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc6ea('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc6ea('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x284900,_0x21d08,_0x3877ac,_0x4c11f5){return new BPromise(function(_0x3e71b7,_0x47ebea){var _0x207f6e=_0x4c11f5||client;return _0x207f6e[_0xc6ea('0x1e')](_0x284900,_0x3877ac)[_0xc6ea('0x1f')](function(_0x588e11){logger[_0xc6ea('0x20')](_0xc6ea('0x21'),_0x21d08,_0xc6ea('0x22'));logger[_0xc6ea('0x23')](_0xc6ea('0x24'),_0x21d08,_0xc6ea('0x22'),JSON[_0xc6ea('0x25')](_0x588e11));if(_0x588e11['error']){if(_0x588e11['error'][_0xc6ea('0x26')]===0x1f4){logger['error'](_0xc6ea('0x21'),_0x21d08,_0x588e11[_0xc6ea('0x27')][_0xc6ea('0x28')]);return _0x47ebea(_0x588e11['error'][_0xc6ea('0x28')]);}logger[_0xc6ea('0x27')](_0xc6ea('0x21'),_0x21d08,_0x588e11[_0xc6ea('0x27')][_0xc6ea('0x28')]);return _0x3e71b7(_0x588e11[_0xc6ea('0x27')][_0xc6ea('0x28')]);}else{logger[_0xc6ea('0x20')](_0xc6ea('0x21'),_0x21d08,_0xc6ea('0x22'));_0x3e71b7(_0x588e11[_0xc6ea('0x29')][_0xc6ea('0x28')]);}})[_0xc6ea('0x2a')](function(_0xe23be2){logger['error'](_0xc6ea('0x21'),_0x21d08,_0xe23be2);_0x47ebea(_0xe23be2);});});}function respondWithStatusCode(_0xa96c5a,_0x1a71d7){_0x1a71d7=_0x1a71d7||0xcc;return function(_0x46cbfb){if(_0x46cbfb){return _0xa96c5a['sendStatus'](_0x1a71d7);}return _0xa96c5a[_0xc6ea('0x2b')](_0x1a71d7)[_0xc6ea('0x2c')]();};}function respondWithResult(_0x57b76d,_0xa99284){_0xa99284=_0xa99284||0xc8;return function(_0x2f3fcc){if(_0x2f3fcc){return _0x57b76d[_0xc6ea('0x2b')](_0xa99284)[_0xc6ea('0x2d')](_0x2f3fcc);}};}function respondWithFilteredResult(_0x46c909,_0x3cb83d){return function(_0x52fafd){if(_0x52fafd){var _0xb5abb7=typeof _0x3cb83d[_0xc6ea('0x2e')]==='undefined'&&typeof _0x3cb83d[_0xc6ea('0x2f')]===_0xc6ea('0x30');var _0x26db00=_0x52fafd[_0xc6ea('0x31')];var _0x35eceb=_0xb5abb7?0x0:_0x3cb83d['offset'];var _0x32f404=_0xb5abb7?_0x52fafd[_0xc6ea('0x31')]:_0x3cb83d[_0xc6ea('0x2e')]+_0x3cb83d['limit'];var _0x3797fa;if(_0x32f404>=_0x26db00){_0x32f404=_0x26db00;_0x3797fa=0xc8;}else{_0x3797fa=0xce;}_0x46c909[_0xc6ea('0x2b')](_0x3797fa);return _0x46c909[_0xc6ea('0x32')](_0xc6ea('0x33'),_0x35eceb+'-'+_0x32f404+'/'+_0x26db00)[_0xc6ea('0x2d')](_0x52fafd);}return null;};}function patchUpdates(_0x45aa54){return function(_0x4226fe){try{jsonpatch['apply'](_0x4226fe,_0x45aa54,!![]);}catch(_0x1fe278){return BPromise[_0xc6ea('0x34')](_0x1fe278);}return _0x4226fe[_0xc6ea('0x35')]();};}function saveUpdates(_0x44e26c,_0x23decf){return function(_0x394ff8){if(_0x394ff8){return _0x394ff8[_0xc6ea('0x36')](_0x44e26c)[_0xc6ea('0x1f')](function(_0x56de46){return _0x56de46;});}return null;};}function removeEntity(_0x42066c,_0xef553d){return function(_0x400b61){if(_0x400b61){return _0x400b61[_0xc6ea('0x37')]()[_0xc6ea('0x1f')](function(){_0x42066c[_0xc6ea('0x2b')](0xcc)[_0xc6ea('0x2c')]();});}};}function handleEntityNotFound(_0x39adb3,_0x4ea9ce){return function(_0xfaf13){if(!_0xfaf13){_0x39adb3['sendStatus'](0x194);}return _0xfaf13;};}function handleError(_0x21c9ef,_0xbe3e88){_0xbe3e88=_0xbe3e88||0x1f4;return function(_0x5e73ee){logger['error'](_0x5e73ee[_0xc6ea('0x38')]);if(_0x5e73ee['name']){delete _0x5e73ee[_0xc6ea('0x39')];}_0x21c9ef[_0xc6ea('0x2b')](_0xbe3e88)[_0xc6ea('0x3a')](_0x5e73ee);};}exports['index']=function(_0x30e149,_0x455fbe){var _0x2de50a={},_0x17918b={},_0x17b6f1={'count':0x0,'rows':[]};var _0x3f93ee=_[_0xc6ea('0x3b')](db[_0xc6ea('0x3c')][_0xc6ea('0x3d')],function(_0x59835a){return{'name':_0x59835a[_0xc6ea('0x3e')],'type':_0x59835a[_0xc6ea('0x3f')][_0xc6ea('0x40')]};});_0x17918b[_0xc6ea('0x41')]=_[_0xc6ea('0x3b')](_0x3f93ee,'name');_0x17918b[_0xc6ea('0x42')]=_[_0xc6ea('0x43')](_0x30e149[_0xc6ea('0x42')]);_0x17918b['filters']=_[_0xc6ea('0x44')](_0x17918b[_0xc6ea('0x41')],_0x17918b[_0xc6ea('0x42')]);_0x2de50a['attributes']=_[_0xc6ea('0x44')](_0x17918b['model'],qs[_0xc6ea('0x45')](_0x30e149[_0xc6ea('0x42')][_0xc6ea('0x45')]));_0x2de50a[_0xc6ea('0x46')]=_0x2de50a['attributes'][_0xc6ea('0x47')]?_0x2de50a[_0xc6ea('0x46')]:_0x17918b['model'];if(!_0x30e149[_0xc6ea('0x42')][_0xc6ea('0x48')](_0xc6ea('0x49'))){_0x2de50a[_0xc6ea('0x2f')]=qs[_0xc6ea('0x2f')](_0x30e149[_0xc6ea('0x42')]['limit']);_0x2de50a[_0xc6ea('0x2e')]=qs[_0xc6ea('0x2e')](_0x30e149[_0xc6ea('0x42')]['offset']);}_0x2de50a[_0xc6ea('0x4a')]=qs[_0xc6ea('0x4b')](_0x30e149[_0xc6ea('0x42')][_0xc6ea('0x4b')]);_0x2de50a[_0xc6ea('0x4c')]=qs[_0xc6ea('0x4d')](_['pick'](_0x30e149['query'],_0x17918b[_0xc6ea('0x4d')]),_0x3f93ee);if(_0x30e149[_0xc6ea('0x42')]['filter']){_0x2de50a[_0xc6ea('0x4c')]=_[_0xc6ea('0x4e')](_0x2de50a[_0xc6ea('0x4c')],{'$or':_[_0xc6ea('0x3b')](_0x3f93ee,function(_0x172b9e){if(_0x172b9e[_0xc6ea('0x3f')]!=='VIRTUAL'){var _0x40a44d={};_0x40a44d[_0x172b9e[_0xc6ea('0x39')]]={'$like':'%'+_0x30e149['query']['filter']+'%'};return _0x40a44d;}})});}_0x2de50a=_[_0xc6ea('0x4e')]({},_0x2de50a,_0x30e149[_0xc6ea('0x4f')]);var _0x3f8a58={'where':_0x2de50a[_0xc6ea('0x4c')]};return db['OpenchannelMessage'][_0xc6ea('0x31')](_0x3f8a58)[_0xc6ea('0x1f')](function(_0x1d3345){_0x17b6f1[_0xc6ea('0x31')]=_0x1d3345;if(_0x30e149[_0xc6ea('0x42')][_0xc6ea('0x50')]){_0x2de50a[_0xc6ea('0x51')]=[{'all':!![]}];}return db[_0xc6ea('0x3c')][_0xc6ea('0x52')](_0x2de50a);})[_0xc6ea('0x1f')](function(_0x4e1db6){_0x17b6f1[_0xc6ea('0x53')]=_0x4e1db6;return _0x17b6f1;})['then'](respondWithFilteredResult(_0x455fbe,_0x2de50a))[_0xc6ea('0x2a')](handleError(_0x455fbe,null));};exports[_0xc6ea('0x54')]=function(_0x46592d,_0x2090f6){var _0x267fda={'raw':!![],'where':{'id':_0x46592d[_0xc6ea('0x55')]['id']}},_0x4dbee0={};_0x4dbee0[_0xc6ea('0x41')]=_[_0xc6ea('0x43')](db[_0xc6ea('0x3c')][_0xc6ea('0x3d')]);_0x4dbee0[_0xc6ea('0x42')]=_[_0xc6ea('0x43')](_0x46592d['query']);_0x4dbee0[_0xc6ea('0x4d')]=_[_0xc6ea('0x44')](_0x4dbee0['model'],_0x4dbee0[_0xc6ea('0x42')]);_0x267fda[_0xc6ea('0x46')]=_['intersection'](_0x4dbee0[_0xc6ea('0x41')],qs[_0xc6ea('0x45')](_0x46592d[_0xc6ea('0x42')][_0xc6ea('0x45')]));_0x267fda[_0xc6ea('0x46')]=_0x267fda[_0xc6ea('0x46')][_0xc6ea('0x47')]?_0x267fda[_0xc6ea('0x46')]:_0x4dbee0[_0xc6ea('0x41')];if(_0x46592d[_0xc6ea('0x42')]['includeAll']){_0x267fda[_0xc6ea('0x51')]=[{'all':!![]}];}_0x267fda=_[_0xc6ea('0x4e')]({},_0x267fda,_0x46592d[_0xc6ea('0x4f')]);return db[_0xc6ea('0x3c')][_0xc6ea('0x56')](_0x267fda)[_0xc6ea('0x1f')](handleEntityNotFound(_0x2090f6,null))[_0xc6ea('0x1f')](respondWithResult(_0x2090f6,null))[_0xc6ea('0x2a')](handleError(_0x2090f6,null));};exports['create']=function(_0x556312,_0x4c3c46){return db[_0xc6ea('0x3c')][_0xc6ea('0x57')](_0x556312[_0xc6ea('0x58')],{})[_0xc6ea('0x1f')](respondWithResult(_0x4c3c46,0xc9))['catch'](handleError(_0x4c3c46,null));};exports[_0xc6ea('0x36')]=function(_0x1dcbec,_0x5824e9){if(_0x1dcbec[_0xc6ea('0x58')]['id']){delete _0x1dcbec[_0xc6ea('0x58')]['id'];}return db['OpenchannelMessage'][_0xc6ea('0x56')]({'where':{'id':_0x1dcbec[_0xc6ea('0x55')]['id']}})[_0xc6ea('0x1f')](handleEntityNotFound(_0x5824e9,null))[_0xc6ea('0x1f')](saveUpdates(_0x1dcbec[_0xc6ea('0x58')],null))['then'](respondWithResult(_0x5824e9,null))[_0xc6ea('0x2a')](handleError(_0x5824e9,null));};exports[_0xc6ea('0x37')]=function(_0x5af7df,_0xeebe3e){return db[_0xc6ea('0x3c')]['find']({'where':{'id':_0x5af7df[_0xc6ea('0x55')]['id']}})[_0xc6ea('0x1f')](handleEntityNotFound(_0xeebe3e,null))[_0xc6ea('0x1f')](removeEntity(_0xeebe3e,null))[_0xc6ea('0x2a')](handleError(_0xeebe3e,null));};exports[_0xc6ea('0x59')]=function(_0x1c1eba,_0x51cdc8){return db[_0xc6ea('0x3c')]['describe']()[_0xc6ea('0x1f')](respondWithResult(_0x51cdc8,null))['catch'](handleError(_0x51cdc8,null));};var interaction_log=require(_0xc6ea('0x15'))(_0xc6ea('0x5a'));exports[_0xc6ea('0x5b')]=function(_0x2fb825,_0x4e2e4e,_0x2dc9dd){var _0x480f81={'agent':{},'channel':_0xc6ea('0x5c')};if(_0x2fb825[_0xc6ea('0x58')]['id']){delete _0x2fb825[_0xc6ea('0x58')]['id'];}_0x2fb825['body']['read']=!![];_0x2fb825[_0xc6ea('0x58')][_0xc6ea('0x5d')]=moment()[_0xc6ea('0x5e')](_0xc6ea('0x5f'));_0x2fb825[_0xc6ea('0x58')][_0xc6ea('0x60')]=_0x2fb825[_0xc6ea('0x58')]['UserId']||_0x2fb825['user']['id'];_0x480f81[_0xc6ea('0x61')]['id']=_0x2fb825['body'][_0xc6ea('0x60')];return db[_0xc6ea('0x3c')][_0xc6ea('0x56')]({'where':{'id':_0x2fb825[_0xc6ea('0x55')]['id'],'UserId':null}})[_0xc6ea('0x1f')](handleEntityNotFound(_0x4e2e4e,null))[_0xc6ea('0x1f')](saveUpdates(_0x2fb825[_0xc6ea('0x58')],null))[_0xc6ea('0x1f')](function(_0x478998){if(_0x478998){_0x480f81[_0xc6ea('0x28')]=_0x478998[_0xc6ea('0x62')]({'plain':!![]});return db[_0xc6ea('0x63')][_0xc6ea('0x56')]({'where':{'id':_0x478998[_0xc6ea('0x64')]}});}return null;})[_0xc6ea('0x1f')](handleEntityNotFound(_0x4e2e4e,null))[_0xc6ea('0x1f')](function(_0x2ae3cd){if(_0x2ae3cd){return _0x2ae3cd['update']({'UserId':_0x2fb825[_0xc6ea('0x58')][_0xc6ea('0x60')],'read1stAt':_[_0xc6ea('0x65')](_0x2ae3cd[_0xc6ea('0x66')])?moment()[_0xc6ea('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc6ea('0x1f')](function(_0x2c3691){if(_0x2c3691){_0x480f81[_0xc6ea('0x67')]=_0x2c3691[_0xc6ea('0x62')]({'plain':!![]});interaction_log[_0xc6ea('0x20')](_0xc6ea('0x68'),_0x2fb825[_0xc6ea('0x69')]['id'],_0x2fb825['user'][_0xc6ea('0x39')],_0x2fb825[_0xc6ea('0x69')]['role'],_0x480f81['interaction']['id'],_0x2fb825[_0xc6ea('0x58')]?JSON[_0xc6ea('0x25')](_0x2fb825[_0xc6ea('0x58')]):_0xc6ea('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xc6ea('0x6b'),_0x480f81);}return null;})['then'](function(_0x2ee2bd){var _0x52ef75=_0xc6ea('0x6c')+_0x2ee2bd[_0xc6ea('0x28')][_0xc6ea('0x6d')];return db[_0xc6ea('0x6e')][_0xc6ea('0x42')](_0x52ef75,{'type':db[_0xc6ea('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0xc6ea('0x1f')](function(_0x530668){return _0x530668;});})['then'](function(_0x3add77){if(_0x3add77){_0x480f81['message']['contact']=_0x3add77[0x0];if(!_0x2fb825[_0xc6ea('0x58')][_0xc6ea('0x60')])return;return db[_0xc6ea('0x70')]['find']({'where':{'id':_0x2fb825['body']['UserId'],'role':_0xc6ea('0x61')},'attributes':['id','name',_0xc6ea('0x71'),_0xc6ea('0x72'),_0xc6ea('0x73')],'raw':!![]});}return null;})[_0xc6ea('0x1f')](function(_0x1c4b5f){if(!_0x1c4b5f)return null;_0x480f81[_0xc6ea('0x28')][_0xc6ea('0x61')]=_0x1c4b5f;return _0x480f81;})[_0xc6ea('0x1f')](function(_0x125762){if(_0x125762){if(_0x2fb825[_0xc6ea('0x58')]['manual']){_0x480f81[_0xc6ea('0x28')][_0xc6ea('0x74')]=util[_0xc6ea('0x5e')](_0xc6ea('0x75'),_0x2fb825[_0xc6ea('0x69')][_0xc6ea('0x39')]);_0x480f81[_0xc6ea('0x28')]['channel']=_0x480f81[_0xc6ea('0x76')];_0x480f81['message'][_0xc6ea('0x77')]=_0xc6ea('0x5b');return respondWithRpcPromise(_0xc6ea('0x78'),_0xc6ea('0x78'),{'event':_0xc6ea('0x79'),'message':_0x480f81[_0xc6ea('0x28')]},client9002)[_0xc6ea('0x1f')](function(){return _0x480f81;});}return _0x480f81;}return null;})[_0xc6ea('0x1f')](respondWithResult(_0x4e2e4e,null))[_0xc6ea('0x2a')](handleError(_0x4e2e4e,null));};var interaction_log=require(_0xc6ea('0x15'))(_0xc6ea('0x5a'));exports['reject']=function(_0xa1996c,_0x5a6887,_0x246563){var _0x520035={'agent':{},'channel':_0xc6ea('0x5c')};if(_0xa1996c['body']['id']){delete _0xa1996c[_0xc6ea('0x58')]['id'];}_0xa1996c[_0xc6ea('0x58')][_0xc6ea('0x60')]=_0xa1996c[_0xc6ea('0x58')][_0xc6ea('0x60')]||_0xa1996c[_0xc6ea('0x69')]['id'];_0x520035[_0xc6ea('0x61')]['id']=_0xa1996c[_0xc6ea('0x58')]['UserId'];return db[_0xc6ea('0x3c')]['find']({'where':{'id':_0xa1996c[_0xc6ea('0x55')]['id'],'UserId':null}})[_0xc6ea('0x1f')](handleEntityNotFound(_0x5a6887,null))['then'](function(_0x2ba2ab){if(_0x2ba2ab){_0x520035[_0xc6ea('0x28')]=_0x2ba2ab[_0xc6ea('0x62')]({'plain':!![]});return db[_0xc6ea('0x63')][_0xc6ea('0x56')]({'where':{'id':_0x2ba2ab['OpenchannelInteractionId']}});}return null;})[_0xc6ea('0x1f')](handleEntityNotFound(_0x5a6887,null))['then'](function(_0xfa1fcb){if(_0xfa1fcb){_0x520035[_0xc6ea('0x67')]=_0xfa1fcb[_0xc6ea('0x62')]({'plain':!![]});interaction_log[_0xc6ea('0x20')](_0xc6ea('0x7a'),_0xa1996c[_0xc6ea('0x69')]['id'],_0xa1996c[_0xc6ea('0x69')][_0xc6ea('0x39')],_0xa1996c[_0xc6ea('0x69')]['role'],_0x520035[_0xc6ea('0x67')]['id'],_0xa1996c[_0xc6ea('0x58')]?JSON[_0xc6ea('0x25')](_0xa1996c[_0xc6ea('0x58')]):'null');return respondWithRpcPromise(_0xc6ea('0x7b'),_0xc6ea('0x7c'),_0x520035);}return null;})[_0xc6ea('0x1f')](function(_0x5e9dc2){var _0x317683=_0xc6ea('0x6c')+_0x5e9dc2['message'][_0xc6ea('0x6d')];return db[_0xc6ea('0x6e')][_0xc6ea('0x42')](_0x317683,{'type':db[_0xc6ea('0x6f')][_0xc6ea('0x7d')][_0xc6ea('0x7e')],'raw':!![]})[_0xc6ea('0x1f')](function(_0x4fddb2){return _0x4fddb2;});})[_0xc6ea('0x1f')](function(_0x4f6d88){if(_0x4f6d88){_0x520035[_0xc6ea('0x28')][_0xc6ea('0x7f')]=_0x4f6d88[0x0];if(!_0xa1996c[_0xc6ea('0x58')][_0xc6ea('0x60')])return;return db['User'][_0xc6ea('0x56')]({'where':{'id':_0xa1996c[_0xc6ea('0x58')][_0xc6ea('0x60')],'role':_0xc6ea('0x61')},'attributes':['id',_0xc6ea('0x39'),'fullname',_0xc6ea('0x72'),_0xc6ea('0x73')],'raw':!![]});}return null;})[_0xc6ea('0x1f')](function(_0x355ebb){if(!_0x355ebb)return null;_0x520035['message'][_0xc6ea('0x61')]=_0x355ebb;return _0x520035;})['then'](function(_0x4c458b){if(_0x4c458b){_0x4c458b[_0xc6ea('0x28')][_0xc6ea('0x74')]=util[_0xc6ea('0x5e')](_0xc6ea('0x75'),_0xa1996c[_0xc6ea('0x69')][_0xc6ea('0x39')]);_0x4c458b[_0xc6ea('0x28')][_0xc6ea('0x76')]=_0x520035[_0xc6ea('0x76')];_0x4c458b[_0xc6ea('0x28')]['event']='reject';respondWithRpcPromise('EventManager',_0xc6ea('0x78'),{'event':'rejectmessage','message':_0x4c458b[_0xc6ea('0x28')]},client9002);return _0x520035;}return null;})[_0xc6ea('0x1f')](respondWithResult(_0x5a6887,null))[_0xc6ea('0x2a')](handleError(_0x5a6887,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 250b938..ec059ef 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 _0x5975=['../../mysqldb','OpenchannelMessage','update','remove','emit','hook','exports','events'];(function(_0x95d1c,_0x351792){var _0x396a3d=function(_0x142c96){while(--_0x142c96){_0x95d1c['push'](_0x95d1c['shift']());}};_0x396a3d(++_0x351792);}(_0x5975,0x187));var _0x5597=function(_0x390a83,_0x14d5bc){_0x390a83=_0x390a83-0x0;var _0x1d8140=_0x5975[_0x390a83];return _0x1d8140;};'use strict';var EventEmitter=require(_0x5597('0x0'));var OpenchannelMessage=require(_0x5597('0x1'))['db'][_0x5597('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5597('0x3'),'afterDestroy':_0x5597('0x4')};function emitEvent(_0x3da974){return function(_0x319562,_0x23dfc4,_0x90b142){OpenchannelMessageEvents[_0x5597('0x5')](_0x3da974+':'+_0x319562['id'],_0x319562);OpenchannelMessageEvents[_0x5597('0x5')](_0x3da974,_0x319562);_0x90b142(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x5597('0x6')](e,emitEvent(event));}}module[_0x5597('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x1cbf=['OpenchannelMessage','setMaxListeners','save','update','emit','exports','events'];(function(_0x40497f,_0x5c1848){var _0x2dff35=function(_0x2d06aa){while(--_0x2d06aa){_0x40497f['push'](_0x40497f['shift']());}};_0x2dff35(++_0x5c1848);}(_0x1cbf,0x1a3));var _0xf1cb=function(_0x207696,_0x1cf674){_0x207696=_0x207696-0x0;var _0x4060f3=_0x1cbf[_0x207696];return _0x4060f3;};'use strict';var EventEmitter=require(_0xf1cb('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xf1cb('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf1cb('0x2')](0x0);var events={'afterCreate':_0xf1cb('0x3'),'afterUpdate':_0xf1cb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3fa7c3){return function(_0x214a60,_0x596dea,_0x5b612d){OpenchannelMessageEvents[_0xf1cb('0x5')](_0x3fa7c3+':'+_0x214a60['id'],_0x214a60);OpenchannelMessageEvents['emit'](_0x3fa7c3,_0x214a60);_0x5b612d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xf1cb('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index b260926..327ac41 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 _0x13f6=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','omit','Contact','POST','method','GET','info','Interaction','threadId','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','body','FULLTEXT','models','direction','toLowerCase','out','secret','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','keys','get','replyUri'];(function(_0x1538a0,_0x12d196){var _0x4b5c71=function(_0x177022){while(--_0x177022){_0x1538a0['push'](_0x1538a0['shift']());}};_0x4b5c71(++_0x12d196);}(_0x13f6,0x124));var _0x613f=function(_0x402f6,_0x145bba){_0x402f6=_0x402f6-0x0;var _0x1c4cb2=_0x13f6[_0x402f6];return _0x1c4cb2;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x613f('0x8')],'type':_0x613f('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x363736,_0x35b672,_0x4e98ce){var _0x1a8dd0=_0x3f3525[_0x613f('0xa')];var _0xcd514c=_0x363736['get']({'plain':!![]});if(_0xcd514c[_0x613f('0xb')][_0x613f('0xc')]()==='in'||_0xcd514c[_0x613f('0xb')]['toLowerCase']()===_0x613f('0xd')&&!_0xcd514c[_0x613f('0xe')]&&!_['isNil'](_0xcd514c['UserId'])){_0x1a8dd0['OpenchannelInteraction'][_0x613f('0xf')]({'where':{'id':_0xcd514c[_0x613f('0x10')]}})[_0x613f('0x11')](function(_0x375db1){if(_0x375db1){_0x375db1[_0x613f('0x12')]({'lastMsgAt':_0xcd514c[_0x613f('0x13')],'lastMsgDirection':_0xcd514c[_0x613f('0xb')][_0x613f('0xc')]()});}})[_0x613f('0x14')](function(_0x1d68fd){console['error'](_0x1d68fd);});}if(_0xcd514c[_0x613f('0xb')]==='out'&&!_0xcd514c['secret']){var _0x1bc605;_0x1a8dd0[_0x613f('0x15')]['describe']()[_0x613f('0x11')](function(_0x4f9dae){return _0x1a8dd0[_0x613f('0x16')][_0x613f('0x17')]({'where':{'id':_0xcd514c[_0x613f('0x18')]},'include':[{'model':_0x1a8dd0[_0x613f('0x19')],'as':_0x613f('0x1a'),'where':{'id':_0xcd514c[_0x613f('0x10')]},'limit':0x1,'include':[{'model':_0x1a8dd0['CmContact'],'as':'Contact','attributes':_[_0x613f('0x1b')](_0x4f9dae)}]}]});})['then'](function(_0x48493c){_0x1bc605=_0x48493c[_0x613f('0x1c')]({'plain':!![]});if(_0x1bc605&&_0x1bc605[_0x613f('0x1d')]){logger['info'](_0x613f('0x1e'),_0x613f('0x1f'),util[_0x613f('0x20')]('Forwarding\x20message\x20%d\x20to\x20%s',_0xcd514c['id'],_0x1bc605['replyUri']));if(_0x1bc605[_0x613f('0x1a')]&&_0x1bc605[_0x613f('0x1a')][_0x613f('0x21')]){_0xcd514c['Interaction']=_[_0x613f('0x22')](_0x1bc605[_0x613f('0x1a')][0x0],_0x613f('0x23'));_0xcd514c[_0x613f('0x23')]=_0x1bc605[_0x613f('0x1a')][0x0]['Contact'];}var _0x35b672={'method':_0x613f('0x24'),'uri':encodeURI(_0x1bc605['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x35b672[_0x613f('0x25')]){case _0x613f('0x26'):_0x35b672['qs']=_0xcd514c;break;case _0x613f('0x24'):_0x35b672['body']=_0xcd514c;break;}return rp(_0x35b672)['then'](function(_0x5a4a8b){logger[_0x613f('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x613f('0x1f'),util[_0x613f('0x20')]('Message\x20%d\x20forwarded\x20to\x20%s',_0xcd514c['id'],_0x1bc605[_0x613f('0x1d')]));if(_0x5a4a8b[_0x613f('0x8')]['threadId']&&_0x5a4a8b['body']['threadId']!=_0xcd514c[_0x613f('0x28')][_0x613f('0x29')]){return _0x1a8dd0[_0x613f('0x19')]['update']({'threadId':_0x5a4a8b[_0x613f('0x8')][_0x613f('0x29')]},{'logging':!![],'where':{'id':_0xcd514c[_0x613f('0x28')]['id']}});}else{return;}})[_0x613f('0x11')](function(){return _0x363736['update']({'read':!![]});})[_0x613f('0x14')](function(_0x5b2a1f){logger[_0x613f('0x2a')](_0x613f('0x1e'),_0x613f('0x1f'),util[_0x613f('0x2b')](_0x5b2a1f,{'showHidden':![],'depth':null}));_0x4e98ce();});}else{_0x4e98ce();}})['finally'](function(){_0x4e98ce();});}else{_0x4e98ce();}}},'charset':_0x613f('0x2c'),'collate':_0x613f('0x2d')});}; \ No newline at end of file +var _0x6e6c=['util','api','moment','path','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','out','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','then','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5487a4,_0x36a4b0){var _0x3d4809=function(_0x30d3d6){while(--_0x30d3d6){_0x5487a4['push'](_0x5487a4['shift']());}};_0x3d4809(++_0x36a4b0);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc6e6('0x9'),'fields':[_0xc6e6('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x324f05,_0x481799,_0x172aa9){var _0x3b2f50=_0x1182c7[_0xc6e6('0xb')];var _0x3ddf6f=_0x324f05[_0xc6e6('0xc')]({'plain':!![]});if(_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='in'||_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()==='out'&&!_0x3ddf6f[_0xc6e6('0xf')]&&!_['isNil'](_0x3ddf6f[_0xc6e6('0x10')])){_0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x12')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]}})['then'](function(_0x149ac6){if(_0x149ac6){_0x149ac6[_0xc6e6('0x14')]({'lastMsgAt':_0x3ddf6f[_0xc6e6('0x15')],'lastMsgDirection':_0x3ddf6f[_0xc6e6('0xd')][_0xc6e6('0xe')]()});}})['catch'](function(_0x413cf8){console[_0xc6e6('0x16')](_0x413cf8);});}if(_0x3ddf6f['direction']===_0xc6e6('0x17')&&!_0x3ddf6f[_0xc6e6('0xf')]){var _0xedf127;_0x3b2f50['CmContact']['describe']()['then'](function(_0x3a1ccc){return _0x3b2f50['OpenchannelAccount'][_0xc6e6('0x18')]({'where':{'id':_0x3ddf6f[_0xc6e6('0x19')]},'include':[{'model':_0x3b2f50[_0xc6e6('0x11')],'as':_0xc6e6('0x1a'),'where':{'id':_0x3ddf6f[_0xc6e6('0x13')]},'limit':0x1,'include':[{'model':_0x3b2f50[_0xc6e6('0x1b')],'as':_0xc6e6('0x1c'),'attributes':_[_0xc6e6('0x1d')](_0x3a1ccc)}]}]});})[_0xc6e6('0x1e')](function(_0x3d734d){_0xedf127=_0x3d734d['get']({'plain':!![]});if(_0xedf127&&_0xedf127[_0xc6e6('0x1f')]){logger['info'](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x22')](_0xc6e6('0x23'),_0x3ddf6f['id'],_0xedf127['replyUri']));if(_0xedf127[_0xc6e6('0x1a')]&&_0xedf127[_0xc6e6('0x1a')][_0xc6e6('0x24')]){_0x3ddf6f[_0xc6e6('0x25')]=_[_0xc6e6('0x26')](_0xedf127['Interactions'][0x0],_0xc6e6('0x1c'));_0x3ddf6f['Contact']=_0xedf127[_0xc6e6('0x1a')][0x0][_0xc6e6('0x1c')];}var _0x481799={'method':_0xc6e6('0x27'),'uri':encodeURI(_0xedf127['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x481799[_0xc6e6('0x28')]){case'GET':_0x481799['qs']=_0x3ddf6f;break;case _0xc6e6('0x27'):_0x481799['body']=_0x3ddf6f;break;}return rp(_0x481799)[_0xc6e6('0x1e')](function(_0x16dcd9){logger[_0xc6e6('0x29')](_0xc6e6('0x20'),_0xc6e6('0x21'),util['format'](_0xc6e6('0x2a'),_0x3ddf6f['id'],_0xedf127[_0xc6e6('0x1f')]));if(_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]&&_0x16dcd9['body'][_0xc6e6('0x2b')]!=_0x3ddf6f['Interaction'][_0xc6e6('0x2b')]){return _0x3b2f50[_0xc6e6('0x11')][_0xc6e6('0x14')]({'threadId':_0x16dcd9[_0xc6e6('0xa')][_0xc6e6('0x2b')]},{'logging':!![],'where':{'id':_0x3ddf6f[_0xc6e6('0x25')]['id']}});}else{return;}})[_0xc6e6('0x1e')](function(){return _0x324f05[_0xc6e6('0x14')]({'read':!![]});})[_0xc6e6('0x2c')](function(_0x1eb477){logger[_0xc6e6('0x16')](_0xc6e6('0x20'),_0xc6e6('0x21'),util[_0xc6e6('0x2d')](_0x1eb477,{'showHidden':![],'depth':null}));_0x172aa9();});}else{_0x172aa9();}})[_0xc6e6('0x2e')](function(){_0x172aa9();});}else{_0x172aa9();}}},'charset':_0xc6e6('0x2f'),'collate':_0xc6e6('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index c3f5d98..740b649 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(_0x29bfbe,_0x37060a){var _0x230663=function(_0x3b2a6f){while(--_0x3b2a6f){_0x29bfbe['push'](_0x29bfbe['shift']());}};_0x230663(++_0x37060a);}(_0xdb28,0x106));var _0x8db2=function(_0x586af9,_0x4c5351){_0x586af9=_0x586af9-0x0;var _0x3b9b60=_0xdb28[_0x586af9];return _0x3b9b60;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3f5636,_0x3271e2){var _0x439a38=function(_0x1843be){while(--_0x1843be){_0x3f5636['push'](_0x3f5636['shift']());}};_0x439a38(++_0x3271e2);}(_0xadb5,0xad));var _0x5adb=function(_0x203080,_0x399b80){_0x203080=_0x203080-0x0;var _0x6f071=_0xadb5[_0x203080];return _0x6f071;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d1d8ced..23f2858 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 _0xb280=['emit','removeListener','length','openchannelMessage:','remove','update'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0xb280,0x148));var _0x0b28=function(_0x418ce8,_0x2d9def){_0x418ce8=_0x418ce8-0x0;var _0x4eabcd=_0xb280[_0x418ce8];return _0x4eabcd;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x0b28('0x0'),_0x0b28('0x1')];function createListener(_0x50b6d5,_0x5d79d0){return function(_0x3e5020){_0x5d79d0[_0x0b28('0x2')](_0x50b6d5,_0x3e5020);};}function removeListener(_0x54181d,_0x4b18b9){return function(){OpenchannelMessageEvents[_0x0b28('0x3')](_0x54181d,_0x4b18b9);};}exports['register']=function(_0x26c868){for(var _0x211b85=0x0,_0x27f471=events[_0x0b28('0x4')];_0x211b85<_0x27f471;_0x211b85++){var _0x23d7f3=events[_0x211b85];var _0x1d245d=createListener(_0x0b28('0x5')+_0x23d7f3,_0x26c868);OpenchannelMessageEvents['on'](_0x23d7f3,_0x1d245d);}}; \ No newline at end of file +var _0x1487=['removeListener','register','length','openchannelMessage:','save','remove','update'];(function(_0x384281,_0x333ce2){var _0x4ee47c=function(_0x446143){while(--_0x446143){_0x384281['push'](_0x384281['shift']());}};_0x4ee47c(++_0x333ce2);}(_0x1487,0xf2));var _0x7148=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0x1487[_0x43f489];return _0x4134b4;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x7148('0x0'),_0x7148('0x1'),_0x7148('0x2')];function createListener(_0x52e7c2,_0x1f7003){return function(_0x474ed6){_0x1f7003['emit'](_0x52e7c2,_0x474ed6);};}function removeListener(_0x440aff,_0x2e82c8){return function(){OpenchannelMessageEvents[_0x7148('0x3')](_0x440aff,_0x2e82c8);};}exports[_0x7148('0x4')]=function(_0x142618){for(var _0x228cc0=0x0,_0x44e3b8=events[_0x7148('0x5')];_0x228cc0<_0x44e3b8;_0x228cc0++){var _0x197411=events[_0x228cc0];var _0x395160=createListener(_0x7148('0x6')+_0x197411,_0x142618);OpenchannelMessageEvents['on'](_0x197411,_0x395160);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 31aed6d..9ef5944 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 _0xefd5=['express','fs-extra','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getTeams','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xefd5,0x158));var _0x5efd=function(_0x4b7b66,_0x3ffce7){_0x4b7b66=_0x4b7b66-0x0;var _0x38581d=_0xefd5[_0x4b7b66];return _0x38581d;};'use strict';var multer=require(_0x5efd('0x0'));var util=require(_0x5efd('0x1'));var path=require(_0x5efd('0x2'));var timeout=require(_0x5efd('0x3'));var express=require(_0x5efd('0x4'));var router=express['Router']();var fs_extra=require(_0x5efd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5efd('0x6'));var config=require('../../config/environment');var controller=require(_0x5efd('0x7'));router[_0x5efd('0x8')]('/',auth['isAuthenticated'](),controller[_0x5efd('0x9')]);router['get'](_0x5efd('0xa'),auth[_0x5efd('0xb')](),controller[_0x5efd('0xc')]);router['get'](_0x5efd('0xd'),auth[_0x5efd('0xb')](),controller[_0x5efd('0xe')]);router[_0x5efd('0x8')](_0x5efd('0xf'),auth[_0x5efd('0xb')](),controller['getMembers']);router[_0x5efd('0x8')]('/:id/teams',auth[_0x5efd('0xb')](),controller[_0x5efd('0x10')]);router[_0x5efd('0x8')]('/:id/users',auth[_0x5efd('0xb')](),controller[_0x5efd('0x11')]);router[_0x5efd('0x12')]('/',auth[_0x5efd('0xb')](),controller['create']);router[_0x5efd('0x12')]('/:id/teams',auth[_0x5efd('0xb')](),controller[_0x5efd('0x13')]);router[_0x5efd('0x12')]('/:id/users',auth[_0x5efd('0xb')](),controller[_0x5efd('0x14')]);router[_0x5efd('0x15')](_0x5efd('0xd'),auth[_0x5efd('0xb')](),controller[_0x5efd('0x16')]);router[_0x5efd('0x17')](_0x5efd('0xd'),auth[_0x5efd('0xb')](),controller[_0x5efd('0x18')]);router[_0x5efd('0x17')]('/:id/teams',auth[_0x5efd('0xb')](),controller[_0x5efd('0x19')]);router['delete'](_0x5efd('0x1a'),auth[_0x5efd('0xb')](),controller[_0x5efd('0x1b')]);module[_0x5efd('0x1c')]=router; \ No newline at end of file +var _0xa13d=['addTeams','/:id/users','addAgents','put','update','delete','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','getAgents','post','create','/:id/teams'];(function(_0x3699b0,_0x485ab1){var _0x454067=function(_0x2c692d){while(--_0x2c692d){_0x3699b0['push'](_0x3699b0['shift']());}};_0x454067(++_0x485ab1);}(_0xa13d,0x19e));var _0xda13=function(_0x4acaad,_0x4de7cb){_0x4acaad=_0x4acaad-0x0;var _0x457122=_0xa13d[_0x4acaad];return _0x457122;};'use strict';var multer=require(_0xda13('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda13('0x1'));var express=require('express');var router=express[_0xda13('0x2')]();var fs_extra=require(_0xda13('0x3'));var auth=require(_0xda13('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xda13('0x5'));var controller=require(_0xda13('0x6'));router[_0xda13('0x7')]('/',auth[_0xda13('0x8')](),controller[_0xda13('0x9')]);router[_0xda13('0x7')](_0xda13('0xa'),auth[_0xda13('0x8')](),controller['describe']);router[_0xda13('0x7')](_0xda13('0xb'),auth[_0xda13('0x8')](),controller[_0xda13('0xc')]);router[_0xda13('0x7')]('/:id/members',auth[_0xda13('0x8')](),controller[_0xda13('0xd')]);router['get']('/:id/teams',auth[_0xda13('0x8')](),controller['getTeams']);router[_0xda13('0x7')]('/:id/users',auth[_0xda13('0x8')](),controller[_0xda13('0xe')]);router[_0xda13('0xf')]('/',auth[_0xda13('0x8')](),controller[_0xda13('0x10')]);router['post'](_0xda13('0x11'),auth[_0xda13('0x8')](),controller[_0xda13('0x12')]);router[_0xda13('0xf')](_0xda13('0x13'),auth[_0xda13('0x8')](),controller[_0xda13('0x14')]);router[_0xda13('0x15')](_0xda13('0xb'),auth[_0xda13('0x8')](),controller[_0xda13('0x16')]);router[_0xda13('0x17')](_0xda13('0xb'),auth[_0xda13('0x8')](),controller['destroy']);router[_0xda13('0x17')](_0xda13('0x11'),auth[_0xda13('0x8')](),controller['removeTeams']);router[_0xda13('0x17')](_0xda13('0x13'),auth[_0xda13('0x8')](),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 f3e7d6d..7880033 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 _0x6ccb=['name','STRING','INTEGER','ENUM','rrmemory','exports'];(function(_0x53146a,_0xf55e73){var _0x1553df=function(_0x1574e5){while(--_0x1574e5){_0x53146a['push'](_0x53146a['shift']());}};_0x1553df(++_0xf55e73);}(_0x6ccb,0xa1));var _0xb6cc=function(_0x2cfa5c,_0x1276c2){_0x2cfa5c=_0x2cfa5c-0x0;var _0x363402=_0x6ccb[_0x2cfa5c];return _0x363402;};'use strict';var Sequelize=require('sequelize');module[_0xb6cc('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb6cc('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb6cc('0x2')]},'timeout':{'type':Sequelize[_0xb6cc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb6cc('0x4')](_0xb6cc('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xde75=['sequelize','exports','STRING','name','INTEGER','roundrobin'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xde75,0xb4));var _0x5de7=function(_0x56f787,_0x1bca5a){_0x56f787=_0x56f787-0x0;var _0x42810b=_0xde75[_0x56f787];return _0x42810b;};'use strict';var Sequelize=require(_0x5de7('0x0'));module[_0x5de7('0x1')]={'name':{'type':Sequelize[_0x5de7('0x2')],'unique':_0x5de7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5de7('0x2')]},'timeout':{'type':Sequelize[_0x5de7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x5de7('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index e69583b..f5ff02f 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 _0x943a=['redis','defaults','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','save','update','then','OpenchannelQueues','UserProfileResource','destroy','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','get','UserOpenchannelQueue','OpenchannelQueueId','options','findAll','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','createdAt','findOne','Team','getTeams','hasOwnProperty','body','ids','User','online','voicePause','interface','Agents','sequelize','transaction','addTeams','forEach','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x391c12,_0x4665f8){var _0x47e889=function(_0x19ff8e){while(--_0x19ff8e){_0x391c12['push'](_0x391c12['shift']());}};_0x47e889(++_0x4665f8);}(_0x943a,0xfd));var _0xa943=function(_0x51d668,_0x2908c3){_0x51d668=_0x51d668-0x0;var _0x38b15c=_0x943a[_0x51d668];return _0x38b15c;};'use strict';var emlformat=require(_0xa943('0x0'));var rimraf=require(_0xa943('0x1'));var zipdir=require(_0xa943('0x2'));var jsonpatch=require(_0xa943('0x3'));var rp=require(_0xa943('0x4'));var moment=require(_0xa943('0x5'));var BPromise=require(_0xa943('0x6'));var Mustache=require(_0xa943('0x7'));var util=require(_0xa943('0x8'));var path=require(_0xa943('0x9'));var sox=require(_0xa943('0xa'));var csv=require(_0xa943('0xb'));var ejs=require(_0xa943('0xc'));var fs=require('fs');var fs_extra=require(_0xa943('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa943('0xe'));var toCsv=require(_0xa943('0xb'));var querystring=require(_0xa943('0xf'));var Papa=require(_0xa943('0x10'));var Redis=require(_0xa943('0x11'));var authService=require(_0xa943('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa943('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa943('0x14'))(_0xa943('0x15'));var utils=require(_0xa943('0x16'));var config=require(_0xa943('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa943('0x18'))['db'];config[_0xa943('0x19')]=_[_0xa943('0x1a')](config[_0xa943('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa943('0x19')]));require(_0xa943('0x1b'))[_0xa943('0x1c')](socket);function respondWithStatusCode(_0x5a83d2,_0x10622e){_0x10622e=_0x10622e||0xcc;return function(_0x56b54a){if(_0x56b54a){return _0x5a83d2[_0xa943('0x1d')](_0x10622e);}return _0x5a83d2[_0xa943('0x1e')](_0x10622e)[_0xa943('0x1f')]();};}function respondWithResult(_0x5edde1,_0x35ee9c){_0x35ee9c=_0x35ee9c||0xc8;return function(_0x58fc0c){if(_0x58fc0c){return _0x5edde1[_0xa943('0x1e')](_0x35ee9c)['json'](_0x58fc0c);}};}function respondWithFilteredResult(_0x387e7a,_0x2ffe75){return function(_0x5e7137){if(_0x5e7137){var _0x27e3d2=typeof _0x2ffe75[_0xa943('0x20')]===_0xa943('0x21')&&typeof _0x2ffe75['limit']==='undefined';var _0xae86e0=_0x5e7137[_0xa943('0x22')];var _0x200b15=_0x27e3d2?0x0:_0x2ffe75[_0xa943('0x20')];var _0x594353=_0x27e3d2?_0x5e7137['count']:_0x2ffe75[_0xa943('0x20')]+_0x2ffe75[_0xa943('0x23')];var _0xcf2bee;if(_0x594353>=_0xae86e0){_0x594353=_0xae86e0;_0xcf2bee=0xc8;}else{_0xcf2bee=0xce;}_0x387e7a[_0xa943('0x1e')](_0xcf2bee);return _0x387e7a[_0xa943('0x24')](_0xa943('0x25'),_0x200b15+'-'+_0x594353+'/'+_0xae86e0)[_0xa943('0x26')](_0x5e7137);}return null;};}function patchUpdates(_0x346de0){return function(_0x5e0f15){try{jsonpatch['apply'](_0x5e0f15,_0x346de0,!![]);}catch(_0x57b902){return BPromise['reject'](_0x57b902);}return _0x5e0f15[_0xa943('0x27')]();};}function saveUpdates(_0x163909,_0x45dada){return function(_0x4525c2){if(_0x4525c2){return _0x4525c2[_0xa943('0x28')](_0x163909)[_0xa943('0x29')](function(_0x2966b5){return _0x2966b5;});}return null;};}function removeEntity(_0x35547d,_0x47248f){return function(_0x207004){if(_0x207004){return _0x207004['destroy']()[_0xa943('0x29')](function(){var _0x2c288e=_0x207004['get']({'plain':!![]});var _0x39d7b6=_0xa943('0x2a');return db[_0xa943('0x2b')][_0xa943('0x2c')]({'where':{'type':_0x39d7b6,'resourceId':_0x2c288e['id']}})[_0xa943('0x29')](function(){return _0x207004;});})['then'](function(){_0x35547d[_0xa943('0x1e')](0xcc)[_0xa943('0x1f')]();});}};}function handleEntityNotFound(_0x4cf90d,_0x18cd4e){return function(_0x3dee89){if(!_0x3dee89){_0x4cf90d[_0xa943('0x1d')](0x194);}return _0x3dee89;};}function handleError(_0x37cb07,_0x2cad23){_0x2cad23=_0x2cad23||0x1f4;return function(_0xd21666){logger['error'](_0xd21666[_0xa943('0x2d')]);if(_0xd21666[_0xa943('0x2e')]){delete _0xd21666[_0xa943('0x2e')];}_0x37cb07['status'](_0x2cad23)[_0xa943('0x2f')](_0xd21666);};}exports[_0xa943('0x30')]=function(_0x464e8a,_0x45f613){var _0x2de383={},_0xcfc9da={},_0x21424f={'count':0x0,'rows':[]};var _0x4e6ba0=_[_0xa943('0x31')](db[_0xa943('0x32')][_0xa943('0x33')],function(_0x4e9ad7){return{'name':_0x4e9ad7[_0xa943('0x34')],'type':_0x4e9ad7[_0xa943('0x35')]['key']};});_0xcfc9da['model']=_[_0xa943('0x31')](_0x4e6ba0,_0xa943('0x2e'));_0xcfc9da[_0xa943('0x36')]=_[_0xa943('0x37')](_0x464e8a['query']);_0xcfc9da[_0xa943('0x38')]=_[_0xa943('0x39')](_0xcfc9da[_0xa943('0x3a')],_0xcfc9da[_0xa943('0x36')]);_0x2de383[_0xa943('0x3b')]=_[_0xa943('0x39')](_0xcfc9da[_0xa943('0x3a')],qs[_0xa943('0x3c')](_0x464e8a[_0xa943('0x36')][_0xa943('0x3c')]));_0x2de383[_0xa943('0x3b')]=_0x2de383[_0xa943('0x3b')][_0xa943('0x3d')]?_0x2de383[_0xa943('0x3b')]:_0xcfc9da['model'];if(!_0x464e8a[_0xa943('0x36')]['hasOwnProperty'](_0xa943('0x3e'))){_0x2de383['limit']=qs[_0xa943('0x23')](_0x464e8a[_0xa943('0x36')][_0xa943('0x23')]);_0x2de383[_0xa943('0x20')]=qs[_0xa943('0x20')](_0x464e8a['query']['offset']);}_0x2de383[_0xa943('0x3f')]=qs[_0xa943('0x40')](_0x464e8a[_0xa943('0x36')][_0xa943('0x40')]);_0x2de383['where']=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x464e8a['query'],_0xcfc9da[_0xa943('0x38')]),_0x4e6ba0);if(_0x464e8a['query']['filter']){_0x2de383[_0xa943('0x42')]=_[_0xa943('0x43')](_0x2de383['where'],{'$or':_[_0xa943('0x31')](_0x4e6ba0,function(_0x188146){if(_0x188146[_0xa943('0x35')]!==_0xa943('0x44')){var _0x3081c4={};_0x3081c4[_0x188146[_0xa943('0x2e')]]={'$like':'%'+_0x464e8a[_0xa943('0x36')][_0xa943('0x45')]+'%'};return _0x3081c4;}})});}_0x2de383=_[_0xa943('0x43')]({},_0x2de383,_0x464e8a['options']);var _0x54211d={'where':_0x2de383[_0xa943('0x42')]};return db[_0xa943('0x32')][_0xa943('0x22')](_0x54211d)[_0xa943('0x29')](function(_0x311762){_0x21424f[_0xa943('0x22')]=_0x311762;if(_0x464e8a[_0xa943('0x36')][_0xa943('0x46')]){_0x2de383['include']=[{'all':!![]}];}return db[_0xa943('0x32')]['findAll'](_0x2de383);})[_0xa943('0x29')](function(_0x1e38da){_0x21424f['rows']=_0x1e38da;return _0x21424f;})[_0xa943('0x29')](respondWithFilteredResult(_0x45f613,_0x2de383))[_0xa943('0x47')](handleError(_0x45f613,null));};exports['show']=function(_0x54e8f9,_0x1fabff){var _0xe85c33={'raw':!![],'where':{'id':_0x54e8f9[_0xa943('0x48')]['id']}},_0x10fe8e={};_0x10fe8e[_0xa943('0x3a')]=_[_0xa943('0x37')](db['OpenchannelQueue'][_0xa943('0x33')]);_0x10fe8e['query']=_['keys'](_0x54e8f9[_0xa943('0x36')]);_0x10fe8e[_0xa943('0x38')]=_[_0xa943('0x39')](_0x10fe8e[_0xa943('0x3a')],_0x10fe8e['query']);_0xe85c33[_0xa943('0x3b')]=_[_0xa943('0x39')](_0x10fe8e[_0xa943('0x3a')],qs[_0xa943('0x3c')](_0x54e8f9[_0xa943('0x36')][_0xa943('0x3c')]));_0xe85c33[_0xa943('0x3b')]=_0xe85c33[_0xa943('0x3b')]['length']?_0xe85c33[_0xa943('0x3b')]:_0x10fe8e[_0xa943('0x3a')];if(_0x54e8f9[_0xa943('0x36')][_0xa943('0x46')]){_0xe85c33[_0xa943('0x49')]=[{'all':!![]}];}_0xe85c33=_['merge']({},_0xe85c33,_0x54e8f9['options']);return db['OpenchannelQueue'][_0xa943('0x4a')](_0xe85c33)[_0xa943('0x29')](handleEntityNotFound(_0x1fabff,null))[_0xa943('0x29')](respondWithResult(_0x1fabff,null))[_0xa943('0x47')](handleError(_0x1fabff,null));};exports[_0xa943('0x4b')]=function(_0x5a9963,_0xdfab69){return db['OpenchannelQueue'][_0xa943('0x4b')](_0x5a9963['body'],{})['then'](function(_0x364aa7){var _0x58b3d=_0x5a9963[_0xa943('0x4c')]['get']({'plain':!![]});if(!_0x58b3d)throw new Error(_0xa943('0x4d'));if(_0x58b3d[_0xa943('0x4e')]===_0xa943('0x4c')){var _0x3bc414=_0x364aa7['get']({'plain':!![]});var _0x2204e3=_0xa943('0x2a');return db[_0xa943('0x4f')]['find']({'where':{'name':_0x2204e3,'userProfileId':_0x58b3d['userProfileId']},'raw':!![]})[_0xa943('0x29')](function(_0x34f9a8){if(_0x34f9a8&&_0x34f9a8[_0xa943('0x50')]===0x0){return db[_0xa943('0x2b')]['create']({'name':_0x3bc414[_0xa943('0x2e')],'resourceId':_0x3bc414['id'],'type':_0x34f9a8[_0xa943('0x2e')],'sectionId':_0x34f9a8['id']},{})[_0xa943('0x29')](function(){return _0x364aa7;});}else{return _0x364aa7;}})[_0xa943('0x47')](function(_0x2ece02){logger[_0xa943('0x51')](_0xa943('0x52'),_0x2ece02);throw _0x2ece02;});}return _0x364aa7;})[_0xa943('0x29')](respondWithResult(_0xdfab69,0xc9))['catch'](handleError(_0xdfab69,null));};exports[_0xa943('0x28')]=function(_0x1ef5f4,_0x56f03d){if(_0x1ef5f4['body']['id']){delete _0x1ef5f4['body']['id'];}return db[_0xa943('0x32')]['find']({'where':{'id':_0x1ef5f4[_0xa943('0x48')]['id']}})[_0xa943('0x29')](handleEntityNotFound(_0x56f03d,null))['then'](saveUpdates(_0x1ef5f4['body'],null))[_0xa943('0x29')](respondWithResult(_0x56f03d,null))[_0xa943('0x47')](handleError(_0x56f03d,null));};exports[_0xa943('0x2c')]=function(_0x352c91,_0x2e6528){return db[_0xa943('0x32')]['find']({'where':{'id':_0x352c91[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e6528,null))[_0xa943('0x29')](removeEntity(_0x2e6528,null))['catch'](handleError(_0x2e6528,null));};exports[_0xa943('0x53')]=function(_0x1fef61,_0x28110d){return db[_0xa943('0x32')][_0xa943('0x53')]()[_0xa943('0x29')](respondWithResult(_0x28110d,null))[_0xa943('0x47')](handleError(_0x28110d,null));};exports[_0xa943('0x54')]=function(_0x351cde,_0x1d326b,_0x1f2626){var _0x5498d9={'raw':!![],'where':{}},_0x1d16b3={},_0xf54421;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x351cde[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d326b,null))['then'](function(_0x48372b){if(_0x48372b){_0xf54421=_0x48372b[_0xa943('0x55')]({'plain':!![]});_0x1d16b3[_0xa943('0x3a')]=_['keys'](db[_0xa943('0x56')][_0xa943('0x33')]);_0x1d16b3['query']=_[_0xa943('0x37')](_0x351cde['query']);_0x1d16b3['filters']=_[_0xa943('0x39')](_0x1d16b3[_0xa943('0x3a')],_0x1d16b3[_0xa943('0x36')]);_0x5498d9[_0xa943('0x3b')]=_['intersection'](_0x1d16b3[_0xa943('0x3a')],qs['fields'](_0x351cde['query']['fields']));_0x5498d9['attributes']=_0x5498d9[_0xa943('0x3b')][_0xa943('0x3d')]?_0x5498d9[_0xa943('0x3b')]:_0x1d16b3[_0xa943('0x3a')];if(!_0x351cde[_0xa943('0x36')]['hasOwnProperty'](_0xa943('0x3e'))){_0x5498d9[_0xa943('0x23')]=qs[_0xa943('0x23')](_0x351cde[_0xa943('0x36')][_0xa943('0x23')]);_0x5498d9[_0xa943('0x20')]=qs[_0xa943('0x20')](_0x351cde[_0xa943('0x36')]['offset']);}_0x5498d9[_0xa943('0x3f')]=qs[_0xa943('0x40')](_0x351cde['query']['sort']);_0x5498d9[_0xa943('0x42')]=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x351cde['query'],_0x1d16b3[_0xa943('0x38')]));_0x5498d9['where'][_0xa943('0x57')]=_0x48372b['id'];if(_0x351cde[_0xa943('0x36')][_0xa943('0x45')]){_0x5498d9[_0xa943('0x42')]=_[_0xa943('0x43')](_0x5498d9[_0xa943('0x42')],{'$or':_[_0xa943('0x31')](_0x5498d9[_0xa943('0x3b')],function(_0x525e70){var _0x1174a6={};_0x1174a6[_0x525e70]={'$like':'%'+_0x351cde['query'][_0xa943('0x45')]+'%'};return _0x1174a6;})});}_0x5498d9=_[_0xa943('0x43')]({},_0x5498d9,_0x351cde[_0xa943('0x58')]);return db['UserOpenchannelQueue'][_0xa943('0x59')](_0x5498d9);}})[_0xa943('0x29')](function(_0xc5943e){if(_0xc5943e){return db['User'][_0xa943('0x5a')]({'where':{'id':_[_0xa943('0x31')](_0xc5943e,_0xa943('0x5b')),'role':_0xa943('0x5c')},'attributes':['id',_0xa943('0x2e'),_0xa943('0x5d'),_0xa943('0x5e'),'createdAt']});}})[_0xa943('0x29')](function(_0x5efe06){if(_0x5efe06){return{'count':_0x5efe06['count'],'rows':_['map'](_0x5efe06[_0xa943('0x5f')],function(_0x43853b){return{'membername':_0x43853b[_0xa943('0x2e')],'UserId':_0x43853b['id'],'queue_name':_0xf54421['name'],'OpenchannelQueueId':_0xf54421['id'],'interface':util[_0xa943('0x60')](_0xa943('0x61'),'SIP',_0x43853b[_0xa943('0x2e')]),'penalty':0x0,'paused':_0x43853b[_0xa943('0x5d')],'createdAt':_0x43853b[_0xa943('0x62')],'updatedAt':_0x43853b[_0xa943('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d326b,_0x5498d9))[_0xa943('0x47')](handleError(_0x1d326b,null));};exports['getTeams']=function(_0x848b0b,_0x2b0623,_0xf93ae6){var _0x5c3fed={};var _0x377fc6={};var _0x5f0704;var _0xec6df7;return db[_0xa943('0x32')][_0xa943('0x63')]({'where':{'id':_0x848b0b[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b0623,null))[_0xa943('0x29')](function(_0x5484b3){if(_0x5484b3){_0x5f0704=_0x5484b3;_0x377fc6[_0xa943('0x3a')]=_[_0xa943('0x37')](db[_0xa943('0x64')][_0xa943('0x33')]);_0x377fc6['query']=_[_0xa943('0x37')](_0x848b0b['query']);_0x377fc6['filters']=_[_0xa943('0x39')](_0x377fc6[_0xa943('0x3a')],_0x377fc6['query']);_0x5c3fed[_0xa943('0x3b')]=_[_0xa943('0x39')](_0x377fc6[_0xa943('0x3a')],qs['fields'](_0x848b0b['query'][_0xa943('0x3c')]));_0x5c3fed[_0xa943('0x3b')]=_0x5c3fed[_0xa943('0x3b')][_0xa943('0x3d')]?_0x5c3fed[_0xa943('0x3b')]:_0x377fc6['model'];_0x5c3fed['order']=qs[_0xa943('0x40')](_0x848b0b[_0xa943('0x36')][_0xa943('0x40')]);_0x5c3fed['where']=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x848b0b[_0xa943('0x36')],_0x377fc6[_0xa943('0x38')]));if(_0x848b0b[_0xa943('0x36')]['filter']){_0x5c3fed[_0xa943('0x42')]=_[_0xa943('0x43')](_0x5c3fed[_0xa943('0x42')],{'$or':_[_0xa943('0x31')](_0x5c3fed[_0xa943('0x3b')],function(_0x36c0de){var _0x3ba4ac={};_0x3ba4ac[_0x36c0de]={'$like':'%'+_0x848b0b[_0xa943('0x36')][_0xa943('0x45')]+'%'};return _0x3ba4ac;})});}_0x5c3fed=_[_0xa943('0x43')]({},_0x5c3fed,_0x848b0b[_0xa943('0x58')]);return _0x5f0704[_0xa943('0x65')](_0x5c3fed);}})[_0xa943('0x29')](function(_0x4f1356){if(_0x4f1356){_0xec6df7=_0x4f1356[_0xa943('0x3d')];if(!_0x848b0b['query'][_0xa943('0x66')](_0xa943('0x3e'))){_0x5c3fed[_0xa943('0x23')]=qs[_0xa943('0x23')](_0x848b0b[_0xa943('0x36')][_0xa943('0x23')]);_0x5c3fed[_0xa943('0x20')]=qs['offset'](_0x848b0b[_0xa943('0x36')][_0xa943('0x20')]);}return _0x5f0704[_0xa943('0x65')](_0x5c3fed);}})[_0xa943('0x29')](function(_0x1ccaea){if(_0x1ccaea){return _0x1ccaea?{'count':_0xec6df7,'rows':_0x1ccaea}:null;}})[_0xa943('0x29')](respondWithResult(_0x2b0623,null))['catch'](handleError(_0x2b0623,null));};exports['addTeams']=function(_0x371b8b,_0x1a5617,_0x4fc566){var _0x59028a=_0x371b8b[_0xa943('0x67')][_0xa943('0x68')];return db['Team'][_0xa943('0x59')]({'where':{'id':_0x59028a},'attributes':['id'],'include':[{'model':db[_0xa943('0x69')],'as':'Agents','attributes':['id',_0xa943('0x2e'),_0xa943('0x6a'),_0xa943('0x6b'),_0xa943('0x6c')],'raw':!![]}]})[_0xa943('0x29')](function(_0x33578a){if(_0x33578a){var _0x3348e4=_['flatMap'](_0x33578a,function(_0xbd3fea){var _0x3a019b=_0xbd3fea['get']({'plain':!![]});return _0x3a019b[_0xa943('0x6d')];});return db[_0xa943('0x32')]['find']({'where':{'id':_0x371b8b[_0xa943('0x48')]['id']}})[_0xa943('0x29')](function(_0x23e7ae){return db[_0xa943('0x6e')][_0xa943('0x6f')](function(_0x294b4a){return _0x23e7ae[_0xa943('0x70')](_0x59028a,{'transaction':_0x294b4a})[_0xa943('0x29')](function(){return BPromise['each'](_0x3348e4,function(_0x55d634){return db[_0xa943('0x56')]['findOrCreate']({'where':{'UserId':_0x55d634['id'],'OpenchannelQueueId':_0x371b8b[_0xa943('0x48')]['id']},'transaction':_0x294b4a});});})[_0xa943('0x29')](function(){_0x3348e4[_0xa943('0x71')](function(_0x43199e){socket['emit'](_0xa943('0x72'),{'UserId':_0x43199e['id'],'OpenchannelQueueId':_0x23e7ae['id']});});});});});}})[_0xa943('0x29')](respondWithStatusCode(_0x1a5617,null))[_0xa943('0x47')](handleError(_0x1a5617,null));};exports[_0xa943('0x73')]=function(_0x1f4f26,_0x1c0d0a,_0x227ad8){return db[_0xa943('0x64')][_0xa943('0x59')]({'where':{'id':_0x1f4f26[_0xa943('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa943('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xa943('0x29')](handleEntityNotFound(_0x1c0d0a,null))[_0xa943('0x29')](function(_0x1456fb){var _0x2ca88a=_['map'](_0x1456fb,'id');var _0x47f0b7=[];var _0x323b49=[];var _0xbe9147=squel[_0xa943('0x74')]();_0xbe9147[_0xa943('0x75')]('tq.TeamId')[_0xa943('0x76')](_0xa943('0x77'),'tq')[_0xa943('0x78')]('user_has_teams','ut',_0xa943('0x79'))[_0xa943('0x42')]('OpenchannelQueueId\x20=\x20?',_0x1f4f26[_0xa943('0x48')]['id']);for(var _0x549016=0x0;_0x549016<_0x1456fb[_0xa943('0x3d')];_0x549016+=0x1){let _0xa9c382=_0x1456fb[_0x549016];for(var _0x3e039e=0x0;_0x3e039e<_0xa9c382[_0xa943('0x6d')][_0xa943('0x3d')];_0x3e039e+=0x1){let _0x233716=_0xa9c382['Agents'][_0x3e039e];var _0x4b23e5=_0xbe9147['clone']();_0x4b23e5[_0xa943('0x42')](_0xa943('0x7a'),_0x233716['id']);_0x323b49[_0xa943('0x7b')](db[_0xa943('0x6e')][_0xa943('0x36')](_0x4b23e5[_0xa943('0x7c')](),{'type':db[_0xa943('0x6e')][_0xa943('0x7d')][_0xa943('0x7e')]})['then'](function(_0x5215da){if(_0x5215da[_0xa943('0x3d')]===0x1){return _0x233716['id'];}else{var _0x5c6a2a=_[_0xa943('0x7f')](_[_0xa943('0x31')](_0x5215da,'TeamId'),function(_0x5cf010){return _[_0xa943('0x80')](_0x2ca88a,_0x5cf010);});if(_0x5c6a2a){return _0x233716['id'];}}}));}}return BPromise[_0xa943('0x81')](_0x323b49)['then'](function(_0x5a8691){_0x47f0b7=_(_0x47f0b7)[_0xa943('0x82')](_0x5a8691)[_0xa943('0x83')]()[_0xa943('0x84')]();return db['OpenchannelQueue'][_0xa943('0x4a')]({'where':{'id':_0x1f4f26[_0xa943('0x48')]['id']}})[_0xa943('0x29')](function(_0x5f566c){return db[_0xa943('0x6e')]['transaction'](function(_0x211a71){return _0x5f566c[_0xa943('0x73')](_0x1f4f26[_0xa943('0x36')]['ids'],{'transaction':_0x211a71})['then'](function(){if(!_[_0xa943('0x85')](_0x47f0b7)){return _0x5f566c[_0xa943('0x86')](_0x47f0b7,{'transaction':_0x211a71});}})['then'](function(){_0x47f0b7['forEach'](function(_0x439ae9){socket[_0xa943('0x87')](_0xa943('0x88'),{'UserId':_0x439ae9,'OpenchannelQueueId':_0x5f566c['id']});});});});});});})[_0xa943('0x29')](respondWithStatusCode(_0x1c0d0a,null))[_0xa943('0x47')](handleError(_0x1c0d0a,null));};exports['addAgents']=function(_0x2d55f9,_0x41e4a0,_0x3f2120){return db[_0xa943('0x32')]['find']({'where':{'id':_0x2d55f9[_0xa943('0x48')]['id']}})[_0xa943('0x29')](handleEntityNotFound(_0x41e4a0,null))[_0xa943('0x29')](function(_0x303867){if(_0x303867){return _0x303867['addAgents'](_0x2d55f9[_0xa943('0x67')][_0xa943('0x68')],_[_0xa943('0x89')](_0x2d55f9[_0xa943('0x67')],[_0xa943('0x68'),'id'])||{})['spread'](function(_0x1ca66b){for(var _0x5cf05c=0x0;_0x5cf05c<_0x2d55f9['body']['ids']['length'];_0x5cf05c+=0x1){socket[_0xa943('0x87')](_0xa943('0x72'),{'UserId':_0x2d55f9[_0xa943('0x67')][_0xa943('0x68')][_0x5cf05c],'OpenchannelQueueId':_0x2d55f9[_0xa943('0x48')]['id']});}return _0x1ca66b;});}})[_0xa943('0x29')](respondWithResult(_0x41e4a0,null))['catch'](handleError(_0x41e4a0,null));};exports[_0xa943('0x86')]=function(_0xe1e771,_0x4bd94b,_0x1c59e6){return db['OpenchannelQueue'][_0xa943('0x4a')]({'where':{'id':_0xe1e771[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x4bd94b,null))[_0xa943('0x29')](function(_0x7c6caf){if(_0x7c6caf){return _0x7c6caf[_0xa943('0x86')](_0xe1e771[_0xa943('0x36')]['ids'])[_0xa943('0x29')](function(){if(_['isArray'](_0xe1e771['query'][_0xa943('0x68')])){for(var _0x45abcc=0x0;_0x45abcc<_0xe1e771[_0xa943('0x36')][_0xa943('0x68')][_0xa943('0x3d')];_0x45abcc+=0x1){socket[_0xa943('0x87')]('userOpenchannelQueue:remove',{'UserId':Number(_0xe1e771[_0xa943('0x36')][_0xa943('0x68')][_0x45abcc]),'OpenchannelQueueId':Number(_0xe1e771[_0xa943('0x48')]['id'])});}}else{socket[_0xa943('0x87')](_0xa943('0x88'),{'UserId':Number(_0xe1e771[_0xa943('0x36')]['ids']),'OpenchannelQueueId':Number(_0xe1e771[_0xa943('0x48')]['id'])});}});}})[_0xa943('0x29')](respondWithStatusCode(_0x4bd94b,null))[_0xa943('0x47')](handleError(_0x4bd94b,null));};exports[_0xa943('0x8a')]=function(_0x4bfc9a,_0x239957,_0x528b10){var _0x511f45={};var _0x1704db={};var _0x37a877;var _0x4dcb78;return db[_0xa943('0x32')][_0xa943('0x63')]({'where':{'id':_0x4bfc9a['params']['id']}})[_0xa943('0x29')](handleEntityNotFound(_0x239957,null))[_0xa943('0x29')](function(_0x346716){if(_0x346716){_0x37a877=_0x346716;_0x1704db['model']=_['keys'](db['User'][_0xa943('0x33')]);_0x1704db[_0xa943('0x36')]=_[_0xa943('0x37')](_0x4bfc9a[_0xa943('0x36')]);_0x1704db[_0xa943('0x38')]=_[_0xa943('0x39')](_0x1704db[_0xa943('0x3a')],_0x1704db[_0xa943('0x36')]);_0x511f45[_0xa943('0x3b')]=_[_0xa943('0x39')](_0x1704db[_0xa943('0x3a')],qs[_0xa943('0x3c')](_0x4bfc9a['query'][_0xa943('0x3c')]));_0x511f45[_0xa943('0x3b')]=_0x511f45[_0xa943('0x3b')]['length']?_0x511f45[_0xa943('0x3b')]:_0x1704db[_0xa943('0x3a')];_0x511f45['order']=qs[_0xa943('0x40')](_0x4bfc9a[_0xa943('0x36')][_0xa943('0x40')]);_0x511f45[_0xa943('0x42')]=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x4bfc9a['query'],_0x1704db[_0xa943('0x38')]));if(_0x4bfc9a['query'][_0xa943('0x45')]){_0x511f45['where']=_['merge'](_0x511f45[_0xa943('0x42')],{'$or':_[_0xa943('0x31')](_0x511f45['attributes'],function(_0xdc6ff7){var _0x386822={};_0x386822[_0xdc6ff7]={'$like':'%'+_0x4bfc9a['query'][_0xa943('0x45')]+'%'};return _0x386822;})});}_0x511f45=_[_0xa943('0x43')]({},_0x511f45,_0x4bfc9a[_0xa943('0x58')]);return _0x37a877[_0xa943('0x8a')](_0x511f45);}})['then'](function(_0x4c9c00){if(_0x4c9c00){_0x4dcb78=_0x4c9c00[_0xa943('0x3d')];if(!_0x4bfc9a[_0xa943('0x36')][_0xa943('0x66')](_0xa943('0x3e'))){_0x511f45[_0xa943('0x23')]=qs[_0xa943('0x23')](_0x4bfc9a[_0xa943('0x36')]['limit']);_0x511f45[_0xa943('0x20')]=qs['offset'](_0x4bfc9a['query'][_0xa943('0x20')]);}return _0x37a877[_0xa943('0x8a')](_0x511f45);}})[_0xa943('0x29')](function(_0xadfb94){if(_0xadfb94){return _0xadfb94?{'count':_0x4dcb78,'rows':_0xadfb94}:null;}})[_0xa943('0x29')](respondWithResult(_0x239957,null))[_0xa943('0x47')](handleError(_0x239957,null));}; \ No newline at end of file +var _0x599e=['emit','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','OpenchannelQueue','include','findAll','rows','catch','show','create','body','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','getMembers','findOne','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','forEach'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x599e,0xa4));var _0xe599=function(_0xd76573,_0x1a0f36){_0xd76573=_0xd76573-0x0;var _0x171c44=_0x599e[_0xd76573];return _0x171c44;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe599('0x0'));var jsonpatch=require(_0xe599('0x1'));var rp=require(_0xe599('0x2'));var moment=require(_0xe599('0x3'));var BPromise=require(_0xe599('0x4'));var Mustache=require('mustache');var util=require(_0xe599('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe599('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe599('0x7'));var squel=require(_0xe599('0x8'));var crypto=require(_0xe599('0x9'));var jsforce=require(_0xe599('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe599('0x6'));var querystring=require(_0xe599('0xb'));var Papa=require(_0xe599('0xc'));var Redis=require('ioredis');var authService=require(_0xe599('0xd'));var qs=require(_0xe599('0xe'));var as=require(_0xe599('0xf'));var hardwareService=require(_0xe599('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xe599('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe599('0x12'));var db=require(_0xe599('0x13'))['db'];config['redis']=_[_0xe599('0x14')](config[_0xe599('0x15')],{'host':_0xe599('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe599('0x15')]));require(_0xe599('0x17'))['register'](socket);function respondWithStatusCode(_0x51b029,_0x15d9b7){_0x15d9b7=_0x15d9b7||0xcc;return function(_0x101d48){if(_0x101d48){return _0x51b029[_0xe599('0x18')](_0x15d9b7);}return _0x51b029[_0xe599('0x19')](_0x15d9b7)[_0xe599('0x1a')]();};}function respondWithResult(_0x3377ea,_0x3c7bcc){_0x3c7bcc=_0x3c7bcc||0xc8;return function(_0x1c806e){if(_0x1c806e){return _0x3377ea[_0xe599('0x19')](_0x3c7bcc)[_0xe599('0x1b')](_0x1c806e);}};}function respondWithFilteredResult(_0x7e59f6,_0x455e40){return function(_0x564cee){if(_0x564cee){var _0x47b039=typeof _0x455e40[_0xe599('0x1c')]===_0xe599('0x1d')&&typeof _0x455e40[_0xe599('0x1e')]===_0xe599('0x1d');var _0x24a316=_0x564cee['count'];var _0x56d708=_0x47b039?0x0:_0x455e40[_0xe599('0x1c')];var _0x1acb25=_0x47b039?_0x564cee[_0xe599('0x1f')]:_0x455e40['offset']+_0x455e40[_0xe599('0x1e')];var _0x49e051;if(_0x1acb25>=_0x24a316){_0x1acb25=_0x24a316;_0x49e051=0xc8;}else{_0x49e051=0xce;}_0x7e59f6[_0xe599('0x19')](_0x49e051);return _0x7e59f6[_0xe599('0x20')](_0xe599('0x21'),_0x56d708+'-'+_0x1acb25+'/'+_0x24a316)[_0xe599('0x1b')](_0x564cee);}return null;};}function patchUpdates(_0x20f48c){return function(_0x5811b8){try{jsonpatch[_0xe599('0x22')](_0x5811b8,_0x20f48c,!![]);}catch(_0x32df7a){return BPromise[_0xe599('0x23')](_0x32df7a);}return _0x5811b8[_0xe599('0x24')]();};}function saveUpdates(_0x5d6110,_0x4c6e4e){return function(_0x4e696d){if(_0x4e696d){return _0x4e696d[_0xe599('0x25')](_0x5d6110)['then'](function(_0x47de0e){return _0x47de0e;});}return null;};}function removeEntity(_0x31cb3b,_0x10328f){return function(_0x209ada){if(_0x209ada){return _0x209ada[_0xe599('0x26')]()[_0xe599('0x27')](function(){var _0x5dce91=_0x209ada['get']({'plain':!![]});var _0x24a961='OpenchannelQueues';return db[_0xe599('0x28')][_0xe599('0x26')]({'where':{'type':_0x24a961,'resourceId':_0x5dce91['id']}})[_0xe599('0x27')](function(){return _0x209ada;});})[_0xe599('0x27')](function(){_0x31cb3b[_0xe599('0x19')](0xcc)[_0xe599('0x1a')]();});}};}function handleEntityNotFound(_0x30ee5e,_0x8d1780){return function(_0x18eece){if(!_0x18eece){_0x30ee5e[_0xe599('0x18')](0x194);}return _0x18eece;};}function handleError(_0x111d11,_0x34db5f){_0x34db5f=_0x34db5f||0x1f4;return function(_0x180118){logger[_0xe599('0x29')](_0x180118[_0xe599('0x2a')]);if(_0x180118[_0xe599('0x2b')]){delete _0x180118[_0xe599('0x2b')];}_0x111d11[_0xe599('0x19')](_0x34db5f)[_0xe599('0x2c')](_0x180118);};}exports[_0xe599('0x2d')]=function(_0x4aca9b,_0x4e2128){var _0x88384b={},_0x4ca4f9={},_0x4eda38={'count':0x0,'rows':[]};var _0x32b8bf=_[_0xe599('0x2e')](db['OpenchannelQueue'][_0xe599('0x2f')],function(_0x4fa857){return{'name':_0x4fa857[_0xe599('0x30')],'type':_0x4fa857['type'][_0xe599('0x31')]};});_0x4ca4f9['model']=_[_0xe599('0x2e')](_0x32b8bf,_0xe599('0x2b'));_0x4ca4f9[_0xe599('0x32')]=_[_0xe599('0x33')](_0x4aca9b[_0xe599('0x32')]);_0x4ca4f9['filters']=_[_0xe599('0x34')](_0x4ca4f9[_0xe599('0x35')],_0x4ca4f9[_0xe599('0x32')]);_0x88384b[_0xe599('0x36')]=_[_0xe599('0x34')](_0x4ca4f9[_0xe599('0x35')],qs['fields'](_0x4aca9b['query'][_0xe599('0x37')]));_0x88384b[_0xe599('0x36')]=_0x88384b[_0xe599('0x36')][_0xe599('0x38')]?_0x88384b[_0xe599('0x36')]:_0x4ca4f9[_0xe599('0x35')];if(!_0x4aca9b[_0xe599('0x32')][_0xe599('0x39')]('nolimit')){_0x88384b[_0xe599('0x1e')]=qs[_0xe599('0x1e')](_0x4aca9b[_0xe599('0x32')][_0xe599('0x1e')]);_0x88384b[_0xe599('0x1c')]=qs['offset'](_0x4aca9b['query'][_0xe599('0x1c')]);}_0x88384b[_0xe599('0x3a')]=qs['sort'](_0x4aca9b[_0xe599('0x32')][_0xe599('0x3b')]);_0x88384b[_0xe599('0x3c')]=qs[_0xe599('0x3d')](_[_0xe599('0x3e')](_0x4aca9b[_0xe599('0x32')],_0x4ca4f9['filters']),_0x32b8bf);if(_0x4aca9b[_0xe599('0x32')][_0xe599('0x3f')]){_0x88384b[_0xe599('0x3c')]=_['merge'](_0x88384b[_0xe599('0x3c')],{'$or':_[_0xe599('0x2e')](_0x32b8bf,function(_0x37ef3a){if(_0x37ef3a['type']!=='VIRTUAL'){var _0x3b4ce3={};_0x3b4ce3[_0x37ef3a[_0xe599('0x2b')]]={'$like':'%'+_0x4aca9b[_0xe599('0x32')][_0xe599('0x3f')]+'%'};return _0x3b4ce3;}})});}_0x88384b=_[_0xe599('0x40')]({},_0x88384b,_0x4aca9b[_0xe599('0x41')]);var _0x429c87={'where':_0x88384b[_0xe599('0x3c')]};return db[_0xe599('0x42')][_0xe599('0x1f')](_0x429c87)[_0xe599('0x27')](function(_0x45c0f5){_0x4eda38['count']=_0x45c0f5;if(_0x4aca9b[_0xe599('0x32')]['includeAll']){_0x88384b[_0xe599('0x43')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xe599('0x44')](_0x88384b);})[_0xe599('0x27')](function(_0x14ed30){_0x4eda38[_0xe599('0x45')]=_0x14ed30;return _0x4eda38;})[_0xe599('0x27')](respondWithFilteredResult(_0x4e2128,_0x88384b))[_0xe599('0x46')](handleError(_0x4e2128,null));};exports[_0xe599('0x47')]=function(_0x28a6a6,_0x4d1b23){var _0x2c2c73={'raw':!![],'where':{'id':_0x28a6a6['params']['id']}},_0x46db77={};_0x46db77['model']=_['keys'](db[_0xe599('0x42')]['rawAttributes']);_0x46db77[_0xe599('0x32')]=_[_0xe599('0x33')](_0x28a6a6[_0xe599('0x32')]);_0x46db77[_0xe599('0x3d')]=_['intersection'](_0x46db77[_0xe599('0x35')],_0x46db77[_0xe599('0x32')]);_0x2c2c73[_0xe599('0x36')]=_[_0xe599('0x34')](_0x46db77['model'],qs[_0xe599('0x37')](_0x28a6a6[_0xe599('0x32')][_0xe599('0x37')]));_0x2c2c73[_0xe599('0x36')]=_0x2c2c73[_0xe599('0x36')][_0xe599('0x38')]?_0x2c2c73[_0xe599('0x36')]:_0x46db77[_0xe599('0x35')];if(_0x28a6a6[_0xe599('0x32')]['includeAll']){_0x2c2c73[_0xe599('0x43')]=[{'all':!![]}];}_0x2c2c73=_[_0xe599('0x40')]({},_0x2c2c73,_0x28a6a6[_0xe599('0x41')]);return db[_0xe599('0x42')]['find'](_0x2c2c73)[_0xe599('0x27')](handleEntityNotFound(_0x4d1b23,null))[_0xe599('0x27')](respondWithResult(_0x4d1b23,null))[_0xe599('0x46')](handleError(_0x4d1b23,null));};exports[_0xe599('0x48')]=function(_0x4ebfc0,_0x5add8a){return db['OpenchannelQueue'][_0xe599('0x48')](_0x4ebfc0[_0xe599('0x49')],{})[_0xe599('0x27')](function(_0x39084b){var _0xdb3aa1=_0x4ebfc0[_0xe599('0x4a')][_0xe599('0x4b')]({'plain':!![]});if(!_0xdb3aa1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdb3aa1['role']===_0xe599('0x4a')){var _0x29083a=_0x39084b[_0xe599('0x4b')]({'plain':!![]});var _0x56bc66='OpenchannelQueues';return db[_0xe599('0x4c')]['find']({'where':{'name':_0x56bc66,'userProfileId':_0xdb3aa1[_0xe599('0x4d')]},'raw':!![]})[_0xe599('0x27')](function(_0x15b6bc){if(_0x15b6bc&&_0x15b6bc['autoAssociation']===0x0){return db[_0xe599('0x28')][_0xe599('0x48')]({'name':_0x29083a[_0xe599('0x2b')],'resourceId':_0x29083a['id'],'type':_0x15b6bc[_0xe599('0x2b')],'sectionId':_0x15b6bc['id']},{})[_0xe599('0x27')](function(){return _0x39084b;});}else{return _0x39084b;}})[_0xe599('0x46')](function(_0x2f1c0d){logger[_0xe599('0x29')](_0xe599('0x4e'),_0x2f1c0d);throw _0x2f1c0d;});}return _0x39084b;})[_0xe599('0x27')](respondWithResult(_0x5add8a,0xc9))[_0xe599('0x46')](handleError(_0x5add8a,null));};exports[_0xe599('0x25')]=function(_0x1c80e7,_0x1af940){if(_0x1c80e7[_0xe599('0x49')]['id']){delete _0x1c80e7[_0xe599('0x49')]['id'];}return db[_0xe599('0x42')][_0xe599('0x4f')]({'where':{'id':_0x1c80e7['params']['id']}})['then'](handleEntityNotFound(_0x1af940,null))[_0xe599('0x27')](saveUpdates(_0x1c80e7[_0xe599('0x49')],null))[_0xe599('0x27')](respondWithResult(_0x1af940,null))['catch'](handleError(_0x1af940,null));};exports[_0xe599('0x26')]=function(_0x2bfa6f,_0x3175df){return db[_0xe599('0x42')][_0xe599('0x4f')]({'where':{'id':_0x2bfa6f[_0xe599('0x50')]['id']}})[_0xe599('0x27')](handleEntityNotFound(_0x3175df,null))[_0xe599('0x27')](removeEntity(_0x3175df,null))['catch'](handleError(_0x3175df,null));};exports['describe']=function(_0x1a3c6b,_0x296d35){return db['OpenchannelQueue'][_0xe599('0x51')]()[_0xe599('0x27')](respondWithResult(_0x296d35,null))[_0xe599('0x46')](handleError(_0x296d35,null));};exports[_0xe599('0x52')]=function(_0x1488b4,_0xbe6c44,_0x4b79eb){var _0x36925b={'raw':!![],'where':{}},_0x1e9ae4={},_0x24f34b;return db['OpenchannelQueue'][_0xe599('0x53')]({'where':{'id':_0x1488b4['params']['id']}})[_0xe599('0x27')](handleEntityNotFound(_0xbe6c44,null))[_0xe599('0x27')](function(_0x4a7f1f){if(_0x4a7f1f){_0x24f34b=_0x4a7f1f[_0xe599('0x4b')]({'plain':!![]});_0x1e9ae4[_0xe599('0x35')]=_['keys'](db['UserOpenchannelQueue'][_0xe599('0x2f')]);_0x1e9ae4[_0xe599('0x32')]=_[_0xe599('0x33')](_0x1488b4[_0xe599('0x32')]);_0x1e9ae4['filters']=_['intersection'](_0x1e9ae4[_0xe599('0x35')],_0x1e9ae4['query']);_0x36925b[_0xe599('0x36')]=_['intersection'](_0x1e9ae4[_0xe599('0x35')],qs[_0xe599('0x37')](_0x1488b4[_0xe599('0x32')]['fields']));_0x36925b[_0xe599('0x36')]=_0x36925b[_0xe599('0x36')][_0xe599('0x38')]?_0x36925b[_0xe599('0x36')]:_0x1e9ae4['model'];if(!_0x1488b4['query'][_0xe599('0x39')]('nolimit')){_0x36925b[_0xe599('0x1e')]=qs[_0xe599('0x1e')](_0x1488b4[_0xe599('0x32')][_0xe599('0x1e')]);_0x36925b['offset']=qs[_0xe599('0x1c')](_0x1488b4[_0xe599('0x32')][_0xe599('0x1c')]);}_0x36925b[_0xe599('0x3a')]=qs['sort'](_0x1488b4[_0xe599('0x32')][_0xe599('0x3b')]);_0x36925b[_0xe599('0x3c')]=qs[_0xe599('0x3d')](_[_0xe599('0x3e')](_0x1488b4[_0xe599('0x32')],_0x1e9ae4[_0xe599('0x3d')]));_0x36925b[_0xe599('0x3c')][_0xe599('0x54')]=_0x4a7f1f['id'];if(_0x1488b4[_0xe599('0x32')]['filter']){_0x36925b['where']=_[_0xe599('0x40')](_0x36925b[_0xe599('0x3c')],{'$or':_[_0xe599('0x2e')](_0x36925b[_0xe599('0x36')],function(_0x3e703d){var _0x325451={};_0x325451[_0x3e703d]={'$like':'%'+_0x1488b4['query']['filter']+'%'};return _0x325451;})});}_0x36925b=_[_0xe599('0x40')]({},_0x36925b,_0x1488b4[_0xe599('0x41')]);return db[_0xe599('0x55')][_0xe599('0x44')](_0x36925b);}})[_0xe599('0x27')](function(_0x4d7f26){if(_0x4d7f26){return db[_0xe599('0x56')][_0xe599('0x57')]({'where':{'id':_['map'](_0x4d7f26,_0xe599('0x58')),'role':_0xe599('0x59')},'attributes':['id','name',_0xe599('0x5a'),_0xe599('0x5b'),'createdAt']});}})[_0xe599('0x27')](function(_0x522e88){if(_0x522e88){return{'count':_0x522e88[_0xe599('0x1f')],'rows':_[_0xe599('0x2e')](_0x522e88[_0xe599('0x45')],function(_0x200abf){return{'membername':_0x200abf['name'],'UserId':_0x200abf['id'],'queue_name':_0x24f34b[_0xe599('0x2b')],'OpenchannelQueueId':_0x24f34b['id'],'interface':util[_0xe599('0x5c')](_0xe599('0x5d'),_0xe599('0x5e'),_0x200abf['name']),'penalty':0x0,'paused':_0x200abf[_0xe599('0x5a')],'createdAt':_0x200abf[_0xe599('0x5f')],'updatedAt':_0x200abf[_0xe599('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xbe6c44,_0x36925b))[_0xe599('0x46')](handleError(_0xbe6c44,null));};exports[_0xe599('0x60')]=function(_0x40e586,_0x391094,_0x45255c){var _0x4a07c7={};var _0x5bf1ae={};var _0x512c18;var _0x368ebc;return db[_0xe599('0x42')][_0xe599('0x53')]({'where':{'id':_0x40e586['params']['id']}})[_0xe599('0x27')](handleEntityNotFound(_0x391094,null))[_0xe599('0x27')](function(_0x22eaff){if(_0x22eaff){_0x512c18=_0x22eaff;_0x5bf1ae[_0xe599('0x35')]=_[_0xe599('0x33')](db[_0xe599('0x61')][_0xe599('0x2f')]);_0x5bf1ae[_0xe599('0x32')]=_['keys'](_0x40e586[_0xe599('0x32')]);_0x5bf1ae[_0xe599('0x3d')]=_[_0xe599('0x34')](_0x5bf1ae[_0xe599('0x35')],_0x5bf1ae[_0xe599('0x32')]);_0x4a07c7[_0xe599('0x36')]=_['intersection'](_0x5bf1ae[_0xe599('0x35')],qs[_0xe599('0x37')](_0x40e586['query'][_0xe599('0x37')]));_0x4a07c7[_0xe599('0x36')]=_0x4a07c7[_0xe599('0x36')][_0xe599('0x38')]?_0x4a07c7[_0xe599('0x36')]:_0x5bf1ae[_0xe599('0x35')];_0x4a07c7[_0xe599('0x3a')]=qs[_0xe599('0x3b')](_0x40e586['query'][_0xe599('0x3b')]);_0x4a07c7['where']=qs[_0xe599('0x3d')](_[_0xe599('0x3e')](_0x40e586[_0xe599('0x32')],_0x5bf1ae[_0xe599('0x3d')]));if(_0x40e586[_0xe599('0x32')]['filter']){_0x4a07c7[_0xe599('0x3c')]=_[_0xe599('0x40')](_0x4a07c7[_0xe599('0x3c')],{'$or':_[_0xe599('0x2e')](_0x4a07c7[_0xe599('0x36')],function(_0x520854){var _0xf0f1cb={};_0xf0f1cb[_0x520854]={'$like':'%'+_0x40e586[_0xe599('0x32')]['filter']+'%'};return _0xf0f1cb;})});}_0x4a07c7=_[_0xe599('0x40')]({},_0x4a07c7,_0x40e586[_0xe599('0x41')]);return _0x512c18[_0xe599('0x60')](_0x4a07c7);}})['then'](function(_0x18d520){if(_0x18d520){_0x368ebc=_0x18d520['length'];if(!_0x40e586[_0xe599('0x32')][_0xe599('0x39')](_0xe599('0x62'))){_0x4a07c7[_0xe599('0x1e')]=qs[_0xe599('0x1e')](_0x40e586[_0xe599('0x32')][_0xe599('0x1e')]);_0x4a07c7['offset']=qs[_0xe599('0x1c')](_0x40e586[_0xe599('0x32')]['offset']);}return _0x512c18[_0xe599('0x60')](_0x4a07c7);}})['then'](function(_0x5c5f56){if(_0x5c5f56){return _0x5c5f56?{'count':_0x368ebc,'rows':_0x5c5f56}:null;}})[_0xe599('0x27')](respondWithResult(_0x391094,null))[_0xe599('0x46')](handleError(_0x391094,null));};exports[_0xe599('0x63')]=function(_0x1dac62,_0x2ef458,_0x5d9286){var _0xad1d08=_0x1dac62[_0xe599('0x49')][_0xe599('0x64')];return db[_0xe599('0x61')][_0xe599('0x44')]({'where':{'id':_0xad1d08},'attributes':['id'],'include':[{'model':db[_0xe599('0x56')],'as':_0xe599('0x65'),'attributes':['id',_0xe599('0x2b'),'online',_0xe599('0x66'),_0xe599('0x67')],'raw':!![]}]})[_0xe599('0x27')](function(_0x1f773d){if(_0x1f773d){var _0x569b8b=_[_0xe599('0x68')](_0x1f773d,function(_0x3deaa3){var _0x456a58=_0x3deaa3['get']({'plain':!![]});return _0x456a58[_0xe599('0x65')];});return db[_0xe599('0x42')][_0xe599('0x4f')]({'where':{'id':_0x1dac62[_0xe599('0x50')]['id']}})[_0xe599('0x27')](function(_0x1f7865){return db[_0xe599('0x69')]['transaction'](function(_0x24734f){return _0x1f7865[_0xe599('0x63')](_0xad1d08,{'transaction':_0x24734f})[_0xe599('0x27')](function(){return BPromise[_0xe599('0x6a')](_0x569b8b,function(_0xb04e85){return db[_0xe599('0x55')]['findOrCreate']({'where':{'UserId':_0xb04e85['id'],'OpenchannelQueueId':_0x1dac62[_0xe599('0x50')]['id']},'transaction':_0x24734f});});})[_0xe599('0x27')](function(){_0x569b8b[_0xe599('0x6b')](function(_0x101cd8){socket[_0xe599('0x6c')](_0xe599('0x6d'),{'UserId':_0x101cd8['id'],'OpenchannelQueueId':_0x1f7865['id']});});});});});}})[_0xe599('0x27')](respondWithStatusCode(_0x2ef458,null))[_0xe599('0x46')](handleError(_0x2ef458,null));};exports[_0xe599('0x6e')]=function(_0x23983e,_0x3965af,_0x2a324e){return db['Team'][_0xe599('0x44')]({'where':{'id':_0x23983e[_0xe599('0x32')][_0xe599('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe599('0x65'),'attributes':['id'],'raw':!![]}]})[_0xe599('0x27')](handleEntityNotFound(_0x3965af,null))['then'](function(_0x3c08db){var _0x17efec=_[_0xe599('0x2e')](_0x3c08db,'id');var _0x3d1560=[];var _0x2c042e=[];var _0x501d16=squel[_0xe599('0x6f')]();_0x501d16[_0xe599('0x70')]('tq.TeamId')[_0xe599('0x71')](_0xe599('0x72'),'tq')[_0xe599('0x73')](_0xe599('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe599('0x3c')](_0xe599('0x75'),_0x23983e['params']['id']);for(var _0x30af6f=0x0;_0x30af6f<_0x3c08db[_0xe599('0x38')];_0x30af6f+=0x1){let _0x1784a3=_0x3c08db[_0x30af6f];for(var _0x578f7e=0x0;_0x578f7e<_0x1784a3[_0xe599('0x65')][_0xe599('0x38')];_0x578f7e+=0x1){let _0x4a78fe=_0x1784a3[_0xe599('0x65')][_0x578f7e];var _0xf12862=_0x501d16['clone']();_0xf12862[_0xe599('0x3c')](_0xe599('0x76'),_0x4a78fe['id']);_0x2c042e[_0xe599('0x77')](db[_0xe599('0x69')][_0xe599('0x32')](_0xf12862[_0xe599('0x78')](),{'type':db[_0xe599('0x69')][_0xe599('0x79')][_0xe599('0x7a')]})['then'](function(_0x525cac){if(_0x525cac['length']===0x1){return _0x4a78fe['id'];}else{var _0x531d47=_[_0xe599('0x7b')](_[_0xe599('0x2e')](_0x525cac,_0xe599('0x7c')),function(_0x13dbe5){return _['includes'](_0x17efec,_0x13dbe5);});if(_0x531d47){return _0x4a78fe['id'];}}}));}}return BPromise[_0xe599('0x7d')](_0x2c042e)[_0xe599('0x27')](function(_0x560302){_0x3d1560=_(_0x3d1560)['union'](_0x560302)['compact']()[_0xe599('0x7e')]();return db[_0xe599('0x42')][_0xe599('0x4f')]({'where':{'id':_0x23983e['params']['id']}})['then'](function(_0x5476ea){return db[_0xe599('0x69')][_0xe599('0x7f')](function(_0x2e6435){return _0x5476ea[_0xe599('0x6e')](_0x23983e[_0xe599('0x32')][_0xe599('0x64')],{'transaction':_0x2e6435})[_0xe599('0x27')](function(){if(!_[_0xe599('0x80')](_0x3d1560)){return _0x5476ea[_0xe599('0x81')](_0x3d1560,{'transaction':_0x2e6435});}})[_0xe599('0x27')](function(){_0x3d1560['forEach'](function(_0x60213f){socket[_0xe599('0x6c')]('userOpenchannelQueue:remove',{'UserId':_0x60213f,'OpenchannelQueueId':_0x5476ea['id']});});});});});});})[_0xe599('0x27')](respondWithStatusCode(_0x3965af,null))['catch'](handleError(_0x3965af,null));};exports[_0xe599('0x82')]=function(_0x435da0,_0x5e08d5,_0x2e02a1){return db[_0xe599('0x42')][_0xe599('0x4f')]({'where':{'id':_0x435da0['params']['id']}})[_0xe599('0x27')](handleEntityNotFound(_0x5e08d5,null))[_0xe599('0x27')](function(_0x494b87){if(_0x494b87){return _0x494b87['addAgents'](_0x435da0[_0xe599('0x49')][_0xe599('0x64')],_[_0xe599('0x83')](_0x435da0[_0xe599('0x49')],[_0xe599('0x64'),'id'])||{})[_0xe599('0x84')](function(_0x7c94a0){for(var _0x3808ee=0x0;_0x3808ee<_0x435da0[_0xe599('0x49')][_0xe599('0x64')][_0xe599('0x38')];_0x3808ee+=0x1){socket[_0xe599('0x6c')](_0xe599('0x6d'),{'UserId':_0x435da0['body'][_0xe599('0x64')][_0x3808ee],'OpenchannelQueueId':_0x435da0[_0xe599('0x50')]['id']});}return _0x7c94a0;});}})[_0xe599('0x27')](respondWithResult(_0x5e08d5,null))[_0xe599('0x46')](handleError(_0x5e08d5,null));};exports[_0xe599('0x81')]=function(_0x48bd3a,_0x3c6aef,_0x2ee161){return db[_0xe599('0x42')][_0xe599('0x4f')]({'where':{'id':_0x48bd3a[_0xe599('0x50')]['id']}})['then'](handleEntityNotFound(_0x3c6aef,null))['then'](function(_0x48fdc8){if(_0x48fdc8){return _0x48fdc8[_0xe599('0x81')](_0x48bd3a['query'][_0xe599('0x64')])[_0xe599('0x27')](function(){if(_[_0xe599('0x85')](_0x48bd3a[_0xe599('0x32')][_0xe599('0x64')])){for(var _0x123422=0x0;_0x123422<_0x48bd3a[_0xe599('0x32')][_0xe599('0x64')][_0xe599('0x38')];_0x123422+=0x1){socket['emit'](_0xe599('0x86'),{'UserId':Number(_0x48bd3a[_0xe599('0x32')][_0xe599('0x64')][_0x123422]),'OpenchannelQueueId':Number(_0x48bd3a['params']['id'])});}}else{socket[_0xe599('0x6c')](_0xe599('0x86'),{'UserId':Number(_0x48bd3a[_0xe599('0x32')][_0xe599('0x64')]),'OpenchannelQueueId':Number(_0x48bd3a[_0xe599('0x50')]['id'])});}});}})[_0xe599('0x27')](respondWithStatusCode(_0x3c6aef,null))['catch'](handleError(_0x3c6aef,null));};exports[_0xe599('0x87')]=function(_0x3ba1e3,_0x21af35,_0x2c0a52){var _0x16693a={};var _0xb33533={};var _0x57c556;var _0x2b4690;return db[_0xe599('0x42')][_0xe599('0x53')]({'where':{'id':_0x3ba1e3['params']['id']}})[_0xe599('0x27')](handleEntityNotFound(_0x21af35,null))[_0xe599('0x27')](function(_0x32d504){if(_0x32d504){_0x57c556=_0x32d504;_0xb33533['model']=_['keys'](db[_0xe599('0x56')][_0xe599('0x2f')]);_0xb33533['query']=_[_0xe599('0x33')](_0x3ba1e3['query']);_0xb33533[_0xe599('0x3d')]=_['intersection'](_0xb33533['model'],_0xb33533[_0xe599('0x32')]);_0x16693a[_0xe599('0x36')]=_[_0xe599('0x34')](_0xb33533[_0xe599('0x35')],qs[_0xe599('0x37')](_0x3ba1e3[_0xe599('0x32')]['fields']));_0x16693a[_0xe599('0x36')]=_0x16693a[_0xe599('0x36')]['length']?_0x16693a[_0xe599('0x36')]:_0xb33533[_0xe599('0x35')];_0x16693a[_0xe599('0x3a')]=qs['sort'](_0x3ba1e3[_0xe599('0x32')]['sort']);_0x16693a[_0xe599('0x3c')]=qs['filters'](_['pick'](_0x3ba1e3['query'],_0xb33533[_0xe599('0x3d')]));if(_0x3ba1e3[_0xe599('0x32')][_0xe599('0x3f')]){_0x16693a[_0xe599('0x3c')]=_['merge'](_0x16693a['where'],{'$or':_[_0xe599('0x2e')](_0x16693a[_0xe599('0x36')],function(_0x5cbfa9){var _0x29f695={};_0x29f695[_0x5cbfa9]={'$like':'%'+_0x3ba1e3[_0xe599('0x32')][_0xe599('0x3f')]+'%'};return _0x29f695;})});}_0x16693a=_['merge']({},_0x16693a,_0x3ba1e3['options']);return _0x57c556[_0xe599('0x87')](_0x16693a);}})['then'](function(_0x264483){if(_0x264483){_0x2b4690=_0x264483['length'];if(!_0x3ba1e3[_0xe599('0x32')][_0xe599('0x39')](_0xe599('0x62'))){_0x16693a[_0xe599('0x1e')]=qs[_0xe599('0x1e')](_0x3ba1e3['query'][_0xe599('0x1e')]);_0x16693a[_0xe599('0x1c')]=qs[_0xe599('0x1c')](_0x3ba1e3[_0xe599('0x32')][_0xe599('0x1c')]);}return _0x57c556[_0xe599('0x87')](_0x16693a);}})[_0xe599('0x27')](function(_0x2e4d52){if(_0x2e4d52){return _0x2e4d52?{'count':_0x2b4690,'rows':_0x2e4d52}:null;}})[_0xe599('0x27')](respondWithResult(_0x21af35,null))[_0xe599('0x46')](handleError(_0x21af35,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e227319..77728fb 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 _0x3d26=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x2385fc,_0x4c17b4){var _0x5e7e2e=function(_0x2063e8){while(--_0x2063e8){_0x2385fc['push'](_0x2385fc['shift']());}};_0x5e7e2e(++_0x4c17b4);}(_0x3d26,0x110));var _0x63d2=function(_0x30084b,_0x26b6c8){_0x30084b=_0x30084b-0x0;var _0x52fec7=_0x3d26[_0x30084b];return _0x52fec7;};'use strict';var EventEmitter=require(_0x63d2('0x0'));var OpenchannelQueue=require(_0x63d2('0x1'))['db'][_0x63d2('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x63d2('0x3')](0x0);var events={'afterCreate':_0x63d2('0x4'),'afterUpdate':_0x63d2('0x5'),'afterDestroy':_0x63d2('0x6')};function emitEvent(_0x18681b){return function(_0x1c412c,_0x390756,_0x12d1be){OpenchannelQueueEvents[_0x63d2('0x7')](_0x18681b+':'+_0x1c412c['id'],_0x1c412c);OpenchannelQueueEvents[_0x63d2('0x7')](_0x18681b,_0x1c412c);_0x12d1be(null);};}for(var e in events){if(events[_0x63d2('0x8')](e)){var event=events[e];OpenchannelQueue[_0x63d2('0x9')](e,emitEvent(event));}}module[_0x63d2('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xdf38=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1c5e1c,_0x4d9617){var _0x465a4b=function(_0xb95269){while(--_0xb95269){_0x1c5e1c['push'](_0x1c5e1c['shift']());}};_0x465a4b(++_0x4d9617);}(_0xdf38,0xa2));var _0x8df3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xdf38[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x8df3('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8df3('0x1')](0x0);var events={'afterCreate':_0x8df3('0x2'),'afterUpdate':_0x8df3('0x3'),'afterDestroy':_0x8df3('0x4')};function emitEvent(_0x4aea99){return function(_0x50e0a6,_0x345ff1,_0x475928){OpenchannelQueueEvents[_0x8df3('0x5')](_0x4aea99+':'+_0x50e0a6['id'],_0x50e0a6);OpenchannelQueueEvents[_0x8df3('0x5')](_0x4aea99,_0x50e0a6);_0x475928(null);};}for(var e in events){if(events[_0x8df3('0x6')](e)){var event=events[e];OpenchannelQueue[_0x8df3('0x7')](e,emitEvent(event));}}module[_0x8df3('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 fc8bfaa..b3cf3b4 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 _0x5503=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b3235,_0x14afcd){var _0x4ea3d0=function(_0x30417a){while(--_0x30417a){_0x1b3235['push'](_0x1b3235['shift']());}};_0x4ea3d0(++_0x14afcd);}(_0x5503,0xa2));var _0x3550=function(_0x2da2fa,_0x1f5cc7){_0x2da2fa=_0x2da2fa-0x0;var _0x5e2726=_0x5503[_0x2da2fa];return _0x5e2726;};'use strict';var _=require('lodash');var util=require(_0x3550('0x0'));var logger=require(_0x3550('0x1'))(_0x3550('0x2'));var moment=require(_0x3550('0x3'));var BPromise=require(_0x3550('0x4'));var rp=require(_0x3550('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3550('0x6'));var config=require(_0x3550('0x7'));var attributes=require(_0x3550('0x8'));module[_0x3550('0x9')]=function(_0x1d225e,_0x103198){return _0x1d225e[_0x3550('0xa')]('OpenchannelQueue',attributes,{'tableName':_0x3550('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40dc=['./openchannelQueue.attributes','exports','OpenchannelQueue','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x66a29,_0x117998){var _0x6d7d77=function(_0x364173){while(--_0x364173){_0x66a29['push'](_0x66a29['shift']());}};_0x6d7d77(++_0x117998);}(_0x40dc,0x147));var _0xc40d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc40d('0x0'));var logger=require('../../config/logger')(_0xc40d('0x1'));var moment=require(_0xc40d('0x2'));var BPromise=require(_0xc40d('0x3'));var rp=require(_0xc40d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc40d('0x5'));var attributes=require(_0xc40d('0x6'));module[_0xc40d('0x7')]=function(_0x3136e3,_0x10fdbf){return _0x3136e3['define'](_0xc40d('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 4d3978a..64dbbbb 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 _0xe687=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowOpenchannelQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2302e5,_0x580382){var _0x254fa0=function(_0x3614cc){while(--_0x3614cc){_0x2302e5['push'](_0x2302e5['shift']());}};_0x254fa0(++_0x580382);}(_0xe687,0x193));var _0x7e68=function(_0x4aeb19,_0x203ac9){_0x4aeb19=_0x4aeb19-0x0;var _0x513693=_0xe687[_0x4aeb19];return _0x513693;};'use strict';var _=require(_0x7e68('0x0'));var util=require(_0x7e68('0x1'));var moment=require(_0x7e68('0x2'));var BPromise=require(_0x7e68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e68('0x4'));var db=require(_0x7e68('0x5'))['db'];var utils=require(_0x7e68('0x6'));var logger=require(_0x7e68('0x7'))(_0x7e68('0x8'));var config=require(_0x7e68('0x9'));var jayson=require(_0x7e68('0xa'));var client=jayson[_0x7e68('0xb')][_0x7e68('0xc')]({'port':0x232a});config[_0x7e68('0xd')]=_[_0x7e68('0xe')](config[_0x7e68('0xd')],{'host':_0x7e68('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e68('0xd')]));require('./openchannelQueue.socket')[_0x7e68('0x10')](socket);function respondWithRpcPromise(_0xec2684,_0x485ccb,_0x5acabd){return new BPromise(function(_0x331429,_0x11841d){return client[_0x7e68('0x11')](_0xec2684,_0x5acabd)[_0x7e68('0x12')](function(_0x31cf30){logger[_0x7e68('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x485ccb,_0x7e68('0x14'));logger['debug'](_0x7e68('0x15'),_0x485ccb,_0x7e68('0x14'),JSON[_0x7e68('0x16')](_0x31cf30));if(_0x31cf30[_0x7e68('0x17')]){if(_0x31cf30[_0x7e68('0x17')][_0x7e68('0x18')]===0x1f4){logger[_0x7e68('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x485ccb,_0x31cf30[_0x7e68('0x17')][_0x7e68('0x19')]);return _0x11841d(_0x31cf30[_0x7e68('0x17')][_0x7e68('0x19')]);}logger[_0x7e68('0x17')](_0x7e68('0x1a'),_0x485ccb,_0x31cf30[_0x7e68('0x17')][_0x7e68('0x19')]);return _0x331429(_0x31cf30['error'][_0x7e68('0x19')]);}else{logger['info'](_0x7e68('0x1a'),_0x485ccb,_0x7e68('0x14'));_0x331429(_0x31cf30[_0x7e68('0x1b')]['message']);}})['catch'](function(_0x3135ee){logger['error'](_0x7e68('0x1a'),_0x485ccb,_0x3135ee);_0x11841d(_0x3135ee);});});}exports[_0x7e68('0x1c')]=function(_0x27a208){var _0x52e9e4=this;return new Promise(function(_0x11b564,_0x4f1168){return db[_0x7e68('0x1d')]['findAll']({'raw':_0x27a208[_0x7e68('0x1e')]?_0x27a208[_0x7e68('0x1e')][_0x7e68('0x1f')]===undefined?!![]:![]:!![],'where':_0x27a208[_0x7e68('0x1e')]?_0x27a208[_0x7e68('0x1e')][_0x7e68('0x20')]||null:null,'attributes':_0x27a208[_0x7e68('0x1e')]?_0x27a208['options'][_0x7e68('0x21')]||null:null,'limit':_0x27a208[_0x7e68('0x1e')]?_0x27a208[_0x7e68('0x1e')][_0x7e68('0x22')]||null:null,'include':_0x27a208[_0x7e68('0x1e')]?_0x27a208['options'][_0x7e68('0x23')]?_[_0x7e68('0x24')](_0x27a208[_0x7e68('0x1e')]['include'],function(_0x168e2f){return{'model':db[_0x168e2f[_0x7e68('0x25')]],'as':_0x168e2f['as'],'attributes':_0x168e2f[_0x7e68('0x21')],'include':_0x168e2f[_0x7e68('0x23')]?_[_0x7e68('0x24')](_0x168e2f[_0x7e68('0x23')],function(_0x2f3691){return{'model':db[_0x2f3691['model']],'as':_0x2f3691['as'],'attributes':_0x2f3691[_0x7e68('0x21')],'include':_0x2f3691['include']?_[_0x7e68('0x24')](_0x2f3691[_0x7e68('0x23')],function(_0x518d5d){return{'model':db[_0x518d5d[_0x7e68('0x25')]],'as':_0x518d5d['as'],'attributes':_0x518d5d[_0x7e68('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e68('0x12')](function(_0x939488){logger[_0x7e68('0x13')]('GetOpenchannelQueue',_0x27a208);logger[_0x7e68('0x26')]('GetOpenchannelQueue',_0x27a208,JSON['stringify'](_0x939488));_0x11b564(_0x939488);})[_0x7e68('0x27')](function(_0x4d1716){logger['error'](_0x7e68('0x1c'),_0x4d1716[_0x7e68('0x19')],_0x27a208);_0x4f1168(_0x52e9e4['error'](0x1f4,_0x4d1716[_0x7e68('0x19')]));});});};exports[_0x7e68('0x28')]=function(_0x8cd359){var _0x29bc9e=this;return new Promise(function(_0xa67037,_0x5bf3c6){return db[_0x7e68('0x1d')]['find']({'raw':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359[_0x7e68('0x1e')][_0x7e68('0x1f')]===undefined?!![]:![]:!![],'where':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359['options'][_0x7e68('0x20')]||null:null,'attributes':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359[_0x7e68('0x1e')]['attributes']||null:null,'include':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359[_0x7e68('0x1e')][_0x7e68('0x23')]?_[_0x7e68('0x24')](_0x8cd359[_0x7e68('0x1e')]['include'],function(_0x25b17c){return{'model':db[_0x25b17c['model']],'as':_0x25b17c['as'],'attributes':_0x25b17c[_0x7e68('0x21')],'include':_0x25b17c['include']?_[_0x7e68('0x24')](_0x25b17c['include'],function(_0x26bfbd){return{'model':db[_0x26bfbd[_0x7e68('0x25')]],'as':_0x26bfbd['as'],'attributes':_0x26bfbd[_0x7e68('0x21')],'include':_0x26bfbd[_0x7e68('0x23')]?_['map'](_0x26bfbd[_0x7e68('0x23')],function(_0x59e807){return{'model':db[_0x59e807[_0x7e68('0x25')]],'as':_0x59e807['as'],'attributes':_0x59e807[_0x7e68('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e68('0x12')](function(_0x106d9f){logger[_0x7e68('0x13')](_0x7e68('0x28'),_0x8cd359);logger[_0x7e68('0x26')](_0x7e68('0x28'),_0x8cd359,JSON[_0x7e68('0x16')](_0x106d9f));_0xa67037(_0x106d9f);})[_0x7e68('0x27')](function(_0x2d8085){logger[_0x7e68('0x17')]('ShowOpenchannelQueue',_0x2d8085[_0x7e68('0x19')],_0x8cd359);_0x5bf3c6(_0x29bc9e['error'](0x1f4,_0x2d8085[_0x7e68('0x19')]));});});}; \ No newline at end of file +var _0xacc5=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','ShowOpenchannelQueue'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xacc5,0x1e0));var _0x5acc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xacc5[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x5acc('0x0'));var moment=require(_0x5acc('0x1'));var BPromise=require(_0x5acc('0x2'));var rs=require(_0x5acc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5acc('0x4'))['db'];var utils=require(_0x5acc('0x5'));var logger=require(_0x5acc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5acc('0x7'));var client=jayson[_0x5acc('0x8')][_0x5acc('0x9')]({'port':0x232a});config[_0x5acc('0xa')]=_[_0x5acc('0xb')](config[_0x5acc('0xa')],{'host':_0x5acc('0xc'),'port':0x18eb});var socket=require(_0x5acc('0xd'))(new Redis(config['redis']));require(_0x5acc('0xe'))[_0x5acc('0xf')](socket);function respondWithRpcPromise(_0x31ebfa,_0x34269a,_0x3ada64){return new BPromise(function(_0x1bc3f7,_0x576a4d){return client[_0x5acc('0x10')](_0x31ebfa,_0x3ada64)[_0x5acc('0x11')](function(_0x54c280){logger[_0x5acc('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x34269a,_0x5acc('0x13'));logger[_0x5acc('0x14')](_0x5acc('0x15'),_0x34269a,'request\x20sent',JSON[_0x5acc('0x16')](_0x54c280));if(_0x54c280[_0x5acc('0x17')]){if(_0x54c280[_0x5acc('0x17')][_0x5acc('0x18')]===0x1f4){logger[_0x5acc('0x17')](_0x5acc('0x19'),_0x34269a,_0x54c280['error']['message']);return _0x576a4d(_0x54c280[_0x5acc('0x17')][_0x5acc('0x1a')]);}logger[_0x5acc('0x17')](_0x5acc('0x19'),_0x34269a,_0x54c280[_0x5acc('0x17')][_0x5acc('0x1a')]);return _0x1bc3f7(_0x54c280[_0x5acc('0x17')]['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x34269a,_0x5acc('0x13'));_0x1bc3f7(_0x54c280[_0x5acc('0x1b')][_0x5acc('0x1a')]);}})[_0x5acc('0x1c')](function(_0x36a146){logger[_0x5acc('0x17')](_0x5acc('0x19'),_0x34269a,_0x36a146);_0x576a4d(_0x36a146);});});}exports[_0x5acc('0x1d')]=function(_0x77843b){var _0x4af29c=this;return new Promise(function(_0x29e54b,_0x731412){return db[_0x5acc('0x1e')][_0x5acc('0x1f')]({'raw':_0x77843b[_0x5acc('0x20')]?_0x77843b[_0x5acc('0x20')][_0x5acc('0x21')]===undefined?!![]:![]:!![],'where':_0x77843b[_0x5acc('0x20')]?_0x77843b[_0x5acc('0x20')][_0x5acc('0x22')]||null:null,'attributes':_0x77843b[_0x5acc('0x20')]?_0x77843b['options'][_0x5acc('0x23')]||null:null,'limit':_0x77843b[_0x5acc('0x20')]?_0x77843b[_0x5acc('0x20')]['limit']||null:null,'include':_0x77843b[_0x5acc('0x20')]?_0x77843b[_0x5acc('0x20')][_0x5acc('0x24')]?_[_0x5acc('0x25')](_0x77843b['options'][_0x5acc('0x24')],function(_0x22d87e){return{'model':db[_0x22d87e['model']],'as':_0x22d87e['as'],'attributes':_0x22d87e[_0x5acc('0x23')],'include':_0x22d87e[_0x5acc('0x24')]?_['map'](_0x22d87e['include'],function(_0x3746e6){return{'model':db[_0x3746e6[_0x5acc('0x26')]],'as':_0x3746e6['as'],'attributes':_0x3746e6[_0x5acc('0x23')],'include':_0x3746e6[_0x5acc('0x24')]?_[_0x5acc('0x25')](_0x3746e6[_0x5acc('0x24')],function(_0x2b769a){return{'model':db[_0x2b769a[_0x5acc('0x26')]],'as':_0x2b769a['as'],'attributes':_0x2b769a[_0x5acc('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5acc('0x11')](function(_0x41c7aa){logger[_0x5acc('0x12')]('GetOpenchannelQueue',_0x77843b);logger[_0x5acc('0x14')](_0x5acc('0x1d'),_0x77843b,JSON[_0x5acc('0x16')](_0x41c7aa));_0x29e54b(_0x41c7aa);})['catch'](function(_0x112d11){logger[_0x5acc('0x17')](_0x5acc('0x1d'),_0x112d11[_0x5acc('0x1a')],_0x77843b);_0x731412(_0x4af29c['error'](0x1f4,_0x112d11[_0x5acc('0x1a')]));});});};exports[_0x5acc('0x27')]=function(_0x33ecc8){var _0x41c3bd=this;return new Promise(function(_0x3f29a0,_0x35ab92){return db[_0x5acc('0x1e')]['find']({'raw':_0x33ecc8[_0x5acc('0x20')]?_0x33ecc8[_0x5acc('0x20')][_0x5acc('0x21')]===undefined?!![]:![]:!![],'where':_0x33ecc8['options']?_0x33ecc8[_0x5acc('0x20')]['where']||null:null,'attributes':_0x33ecc8[_0x5acc('0x20')]?_0x33ecc8['options'][_0x5acc('0x23')]||null:null,'include':_0x33ecc8[_0x5acc('0x20')]?_0x33ecc8[_0x5acc('0x20')]['include']?_['map'](_0x33ecc8[_0x5acc('0x20')][_0x5acc('0x24')],function(_0x57ed7d){return{'model':db[_0x57ed7d[_0x5acc('0x26')]],'as':_0x57ed7d['as'],'attributes':_0x57ed7d['attributes'],'include':_0x57ed7d[_0x5acc('0x24')]?_[_0x5acc('0x25')](_0x57ed7d[_0x5acc('0x24')],function(_0x527472){return{'model':db[_0x527472[_0x5acc('0x26')]],'as':_0x527472['as'],'attributes':_0x527472[_0x5acc('0x23')],'include':_0x527472[_0x5acc('0x24')]?_['map'](_0x527472[_0x5acc('0x24')],function(_0x12d784){return{'model':db[_0x12d784[_0x5acc('0x26')]],'as':_0x12d784['as'],'attributes':_0x12d784['attributes']};}):[]};}):[]};}):[]:[]})[_0x5acc('0x11')](function(_0x199389){logger[_0x5acc('0x12')]('ShowOpenchannelQueue',_0x33ecc8);logger['debug'](_0x5acc('0x27'),_0x33ecc8,JSON[_0x5acc('0x16')](_0x199389));_0x3f29a0(_0x199389);})[_0x5acc('0x1c')](function(_0x5abc37){logger[_0x5acc('0x17')](_0x5acc('0x27'),_0x5abc37[_0x5acc('0x1a')],_0x33ecc8);_0x35ab92(_0x41c3bd[_0x5acc('0x17')](0x1f4,_0x5abc37[_0x5acc('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 8dba64f..a48de1e 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 _0xdd34=['length','./openchannelQueue.events','update','emit','removeListener','register'];(function(_0x204265,_0x313c59){var _0x48940c=function(_0x1ebe10){while(--_0x1ebe10){_0x204265['push'](_0x204265['shift']());}};_0x48940c(++_0x313c59);}(_0xdd34,0x1db));var _0x4dd3=function(_0x1c6c9f,_0x568f61){_0x1c6c9f=_0x1c6c9f-0x0;var _0x18d454=_0xdd34[_0x1c6c9f];return _0x18d454;};'use strict';var OpenchannelQueueEvents=require(_0x4dd3('0x0'));var events=['save','remove',_0x4dd3('0x1')];function createListener(_0x5e6453,_0x1587f0){return function(_0xc97d1f){_0x1587f0[_0x4dd3('0x2')](_0x5e6453,_0xc97d1f);};}function removeListener(_0x5cf725,_0x116bed){return function(){OpenchannelQueueEvents[_0x4dd3('0x3')](_0x5cf725,_0x116bed);};}exports[_0x4dd3('0x4')]=function(_0x21cef0){for(var _0x113885=0x0,_0x30fbab=events[_0x4dd3('0x5')];_0x113885<_0x30fbab;_0x113885++){var _0x27644d=events[_0x113885];var _0x49bd45=createListener('openchannelQueue:'+_0x27644d,_0x21cef0);OpenchannelQueueEvents['on'](_0x27644d,_0x49bd45);}}; \ No newline at end of file +var _0x89e6=['update','emit','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x13248d,_0x35184a){var _0x564f27=function(_0x32ce2c){while(--_0x32ce2c){_0x13248d['push'](_0x13248d['shift']());}};_0x564f27(++_0x35184a);}(_0x89e6,0x1a9));var _0x689e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89e6[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require(_0x689e('0x0'));var events=['save','remove',_0x689e('0x1')];function createListener(_0x497dcc,_0x3da0a7){return function(_0x56b183){_0x3da0a7[_0x689e('0x2')](_0x497dcc,_0x56b183);};}function removeListener(_0x5c64d4,_0x1ec148){return function(){OpenchannelQueueEvents['removeListener'](_0x5c64d4,_0x1ec148);};}exports[_0x689e('0x3')]=function(_0x1da535){for(var _0x2bf741=0x0,_0x1145e6=events[_0x689e('0x4')];_0x2bf741<_0x1145e6;_0x2bf741++){var _0x1e7e71=events[_0x2bf741];var _0x1bc1c9=createListener(_0x689e('0x5')+_0x1e7e71,_0x1da535);OpenchannelQueueEvents['on'](_0x1e7e71,_0x1bc1c9);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 28bba8e..78e2664 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 _0xd64d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index','get','describe','/:id','isAuthenticated','show','post','create','put','update','delete','multer','path'];(function(_0x2b303c,_0x109cb8){var _0x4d0403=function(_0x47b8bd){while(--_0x47b8bd){_0x2b303c['push'](_0x2b303c['shift']());}};_0x4d0403(++_0x109cb8);}(_0xd64d,0x12a));var _0xdd64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd64d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdd64('0x0'));var util=require('util');var path=require(_0xdd64('0x1'));var timeout=require(_0xdd64('0x2'));var express=require('express');var router=express[_0xdd64('0x3')]();var fs_extra=require(_0xdd64('0x4'));var auth=require(_0xdd64('0x5'));var interaction=require(_0xdd64('0x6'));var config=require(_0xdd64('0x7'));var controller=require(_0xdd64('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdd64('0x9')]);router[_0xdd64('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xdd64('0xb')]);router['get'](_0xdd64('0xc'),auth[_0xdd64('0xd')](),controller[_0xdd64('0xe')]);router[_0xdd64('0xf')]('/',auth[_0xdd64('0xd')](),controller[_0xdd64('0x10')]);router[_0xdd64('0x11')](_0xdd64('0xc'),auth['isAuthenticated'](),controller[_0xdd64('0x12')]);router[_0xdd64('0x13')]('/:id',auth[_0xdd64('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xff94=['get','index','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a0a10,_0x8d7fe5){var _0x4662a4=function(_0x6dfc36){while(--_0x6dfc36){_0x1a0a10['push'](_0x1a0a10['shift']());}};_0x4662a4(++_0x8d7fe5);}(_0xff94,0x7b));var _0x4ff9=function(_0x306981,_0x383a49){_0x306981=_0x306981-0x0;var _0x5c0afe=_0xff94[_0x306981];return _0x5c0afe;};'use strict';var multer=require(_0x4ff9('0x0'));var util=require(_0x4ff9('0x1'));var path=require(_0x4ff9('0x2'));var timeout=require(_0x4ff9('0x3'));var express=require('express');var router=express[_0x4ff9('0x4')]();var fs_extra=require(_0x4ff9('0x5'));var auth=require(_0x4ff9('0x6'));var interaction=require(_0x4ff9('0x7'));var config=require(_0x4ff9('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0x4ff9('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ff9('0xa')]);router[_0x4ff9('0x9')](_0x4ff9('0xb'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0xd')]);router['get']('/:id',auth[_0x4ff9('0xc')](),controller['show']);router[_0x4ff9('0xe')]('/',auth[_0x4ff9('0xc')](),controller[_0x4ff9('0xf')]);router[_0x4ff9('0x10')](_0x4ff9('0x11'),auth['isAuthenticated'](),controller[_0x4ff9('0x12')]);router[_0x4ff9('0x13')](_0x4ff9('0x11'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x14')]);module[_0x4ff9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index dad7b75..b6901c8 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 _0xfd8a=['STRING','DATE','moment','sequelize','exports'];(function(_0x52ee93,_0x31a5cb){var _0x311c36=function(_0x5b7073){while(--_0x5b7073){_0x52ee93['push'](_0x52ee93['shift']());}};_0x311c36(++_0x31a5cb);}(_0xfd8a,0xac));var _0xafd8=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xfd8a[_0xd22d95];return _0x15d7a3;};'use strict';var moment=require(_0xafd8('0x0'));var Sequelize=require(_0xafd8('0x1'));module[_0xafd8('0x2')]={'uniqueid':{'type':Sequelize[_0xafd8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xafd8('0x3')]},'joinAt':{'type':Sequelize[_0xafd8('0x4')]},'leaveAt':{'type':Sequelize[_0xafd8('0x4')]},'acceptAt':{'type':Sequelize[_0xafd8('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xafd8('0x3')]}}; \ No newline at end of file +var _0x5770=['sequelize','STRING','DATE','moment'];(function(_0x535128,_0x24e02b){var _0x1de4a8=function(_0x384d63){while(--_0x384d63){_0x535128['push'](_0x535128['shift']());}};_0x1de4a8(++_0x24e02b);}(_0x5770,0x15f));var _0x0577=function(_0x26260c,_0x3a9df0){_0x26260c=_0x26260c-0x0;var _0x21f487=_0x5770[_0x26260c];return _0x21f487;};'use strict';var moment=require(_0x0577('0x0'));var Sequelize=require(_0x0577('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0577('0x2')]},'joinAt':{'type':Sequelize[_0x0577('0x3')]},'leaveAt':{'type':Sequelize[_0x0577('0x3')]},'acceptAt':{'type':Sequelize[_0x0577('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 7ee0593..c7e882a 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 _0xd17e=['type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','update','body','destroy','describe','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where'];(function(_0x61f919,_0x1472d8){var _0x23d9e7=function(_0x39a9c6){while(--_0x39a9c6){_0x61f919['push'](_0x61f919['shift']());}};_0x23d9e7(++_0x1472d8);}(_0xd17e,0x1c7));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xed17('0x0'));var rimraf=require(_0xed17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xed17('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xed17('0x3'));var util=require(_0xed17('0x4'));var path=require(_0xed17('0x5'));var sox=require(_0xed17('0x6'));var csv=require(_0xed17('0x7'));var ejs=require(_0xed17('0x8'));var fs=require('fs');var fs_extra=require(_0xed17('0x9'));var _=require(_0xed17('0xa'));var squel=require(_0xed17('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed17('0xc'));var toCsv=require(_0xed17('0x7'));var querystring=require('querystring');var Papa=require(_0xed17('0xd'));var Redis=require(_0xed17('0xe'));var authService=require(_0xed17('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed17('0x10'));var logger=require(_0xed17('0x11'))('api');var utils=require(_0xed17('0x12'));var config=require(_0xed17('0x13'));var licenseUtil=require(_0xed17('0x14'));var db=require(_0xed17('0x15'))['db'];function respondWithStatusCode(_0x503f1d,_0x2b8aee){_0x2b8aee=_0x2b8aee||0xcc;return function(_0x4b1436){if(_0x4b1436){return _0x503f1d['sendStatus'](_0x2b8aee);}return _0x503f1d[_0xed17('0x16')](_0x2b8aee)[_0xed17('0x17')]();};}function respondWithResult(_0x558042,_0x265019){_0x265019=_0x265019||0xc8;return function(_0x3b9e3a){if(_0x3b9e3a){return _0x558042[_0xed17('0x16')](_0x265019)['json'](_0x3b9e3a);}};}function respondWithFilteredResult(_0x53720b,_0x2a505a){return function(_0x541e43){if(_0x541e43){var _0x12adaa=typeof _0x2a505a['offset']==='undefined'&&typeof _0x2a505a[_0xed17('0x18')]===_0xed17('0x19');var _0x25e08a=_0x541e43[_0xed17('0x1a')];var _0x3cf373=_0x12adaa?0x0:_0x2a505a[_0xed17('0x1b')];var _0x5af6a4=_0x12adaa?_0x541e43['count']:_0x2a505a[_0xed17('0x1b')]+_0x2a505a[_0xed17('0x18')];var _0x591778;if(_0x5af6a4>=_0x25e08a){_0x5af6a4=_0x25e08a;_0x591778=0xc8;}else{_0x591778=0xce;}_0x53720b[_0xed17('0x16')](_0x591778);return _0x53720b['set'](_0xed17('0x1c'),_0x3cf373+'-'+_0x5af6a4+'/'+_0x25e08a)[_0xed17('0x1d')](_0x541e43);}return null;};}function patchUpdates(_0xe287f1){return function(_0x51aad3){try{jsonpatch[_0xed17('0x1e')](_0x51aad3,_0xe287f1,!![]);}catch(_0x23765b){return BPromise[_0xed17('0x1f')](_0x23765b);}return _0x51aad3[_0xed17('0x20')]();};}function saveUpdates(_0x14256b,_0x50e9c2){return function(_0x5bd634){if(_0x5bd634){return _0x5bd634['update'](_0x14256b)[_0xed17('0x21')](function(_0x26ba4a){return _0x26ba4a;});}return null;};}function removeEntity(_0x2d10ad,_0x522fee){return function(_0x56199c){if(_0x56199c){return _0x56199c['destroy']()[_0xed17('0x21')](function(){_0x2d10ad[_0xed17('0x16')](0xcc)[_0xed17('0x17')]();});}};}function handleEntityNotFound(_0x102669,_0x4e8ac6){return function(_0x55832d){if(!_0x55832d){_0x102669['sendStatus'](0x194);}return _0x55832d;};}function handleError(_0x308c74,_0x2147c4){_0x2147c4=_0x2147c4||0x1f4;return function(_0xef4c6a){logger[_0xed17('0x22')](_0xef4c6a[_0xed17('0x23')]);if(_0xef4c6a[_0xed17('0x24')]){delete _0xef4c6a['name'];}_0x308c74[_0xed17('0x16')](_0x2147c4)[_0xed17('0x25')](_0xef4c6a);};}exports[_0xed17('0x26')]=function(_0x3ac08d,_0x155602){var _0x328887={},_0x5a3ca5={},_0x32ad25={'count':0x0,'rows':[]};var _0x151dea=_[_0xed17('0x27')](db[_0xed17('0x28')][_0xed17('0x29')],function(_0x18a4ec){return{'name':_0x18a4ec[_0xed17('0x2a')],'type':_0x18a4ec['type'][_0xed17('0x2b')]};});_0x5a3ca5[_0xed17('0x2c')]=_[_0xed17('0x27')](_0x151dea,'name');_0x5a3ca5[_0xed17('0x2d')]=_[_0xed17('0x2e')](_0x3ac08d[_0xed17('0x2d')]);_0x5a3ca5[_0xed17('0x2f')]=_[_0xed17('0x30')](_0x5a3ca5[_0xed17('0x2c')],_0x5a3ca5[_0xed17('0x2d')]);_0x328887[_0xed17('0x31')]=_[_0xed17('0x30')](_0x5a3ca5['model'],qs['fields'](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x32')]));_0x328887[_0xed17('0x31')]=_0x328887[_0xed17('0x31')]['length']?_0x328887[_0xed17('0x31')]:_0x5a3ca5[_0xed17('0x2c')];if(!_0x3ac08d[_0xed17('0x2d')][_0xed17('0x33')]('nolimit')){_0x328887[_0xed17('0x18')]=qs[_0xed17('0x18')](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x18')]);_0x328887['offset']=qs[_0xed17('0x1b')](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x1b')]);}_0x328887['order']=qs['sort'](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x34')]);_0x328887['where']=qs[_0xed17('0x2f')](_[_0xed17('0x35')](_0x3ac08d[_0xed17('0x2d')],_0x5a3ca5[_0xed17('0x2f')]),_0x151dea);if(_0x3ac08d[_0xed17('0x2d')][_0xed17('0x36')]){_0x328887[_0xed17('0x37')]=_['merge'](_0x328887['where'],{'$or':_[_0xed17('0x27')](_0x151dea,function(_0x284db8){if(_0x284db8[_0xed17('0x38')]!==_0xed17('0x39')){var _0x1085fa={};_0x1085fa[_0x284db8['name']]={'$like':'%'+_0x3ac08d[_0xed17('0x2d')][_0xed17('0x36')]+'%'};return _0x1085fa;}})});}_0x328887=_['merge']({},_0x328887,_0x3ac08d[_0xed17('0x3a')]);var _0x50c09c={'where':_0x328887[_0xed17('0x37')]};return db[_0xed17('0x28')]['count'](_0x50c09c)['then'](function(_0x38a40d){_0x32ad25[_0xed17('0x1a')]=_0x38a40d;if(_0x3ac08d[_0xed17('0x2d')][_0xed17('0x3b')]){_0x328887[_0xed17('0x3c')]=[{'all':!![]}];}return db[_0xed17('0x28')][_0xed17('0x3d')](_0x328887);})[_0xed17('0x21')](function(_0x5bd202){_0x32ad25[_0xed17('0x3e')]=_0x5bd202;return _0x32ad25;})[_0xed17('0x21')](respondWithFilteredResult(_0x155602,_0x328887))[_0xed17('0x3f')](handleError(_0x155602,null));};exports[_0xed17('0x40')]=function(_0x2d6f68,_0x4a1a01){var _0x26880f={'raw':!![],'where':{'id':_0x2d6f68[_0xed17('0x41')]['id']}},_0x51a8c7={};_0x51a8c7['model']=_['keys'](db[_0xed17('0x28')][_0xed17('0x29')]);_0x51a8c7[_0xed17('0x2d')]=_[_0xed17('0x2e')](_0x2d6f68[_0xed17('0x2d')]);_0x51a8c7[_0xed17('0x2f')]=_[_0xed17('0x30')](_0x51a8c7[_0xed17('0x2c')],_0x51a8c7[_0xed17('0x2d')]);_0x26880f[_0xed17('0x31')]=_[_0xed17('0x30')](_0x51a8c7[_0xed17('0x2c')],qs[_0xed17('0x32')](_0x2d6f68[_0xed17('0x2d')][_0xed17('0x32')]));_0x26880f['attributes']=_0x26880f[_0xed17('0x31')][_0xed17('0x42')]?_0x26880f['attributes']:_0x51a8c7[_0xed17('0x2c')];if(_0x2d6f68[_0xed17('0x2d')]['includeAll']){_0x26880f[_0xed17('0x3c')]=[{'all':!![]}];}_0x26880f=_['merge']({},_0x26880f,_0x2d6f68[_0xed17('0x3a')]);return db[_0xed17('0x28')][_0xed17('0x43')](_0x26880f)[_0xed17('0x21')](handleEntityNotFound(_0x4a1a01,null))[_0xed17('0x21')](respondWithResult(_0x4a1a01,null))[_0xed17('0x3f')](handleError(_0x4a1a01,null));};exports['create']=function(_0x4fba31,_0x1988c7){return db[_0xed17('0x28')][_0xed17('0x44')](_0x4fba31['body'],{})[_0xed17('0x21')](respondWithResult(_0x1988c7,0xc9))['catch'](handleError(_0x1988c7,null));};exports[_0xed17('0x45')]=function(_0x337c0b,_0x457cb2){if(_0x337c0b[_0xed17('0x46')]['id']){delete _0x337c0b['body']['id'];}return db[_0xed17('0x28')][_0xed17('0x43')]({'where':{'id':_0x337c0b['params']['id']}})['then'](handleEntityNotFound(_0x457cb2,null))[_0xed17('0x21')](saveUpdates(_0x337c0b[_0xed17('0x46')],null))[_0xed17('0x21')](respondWithResult(_0x457cb2,null))[_0xed17('0x3f')](handleError(_0x457cb2,null));};exports[_0xed17('0x47')]=function(_0x462f77,_0x41c2d5){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x462f77[_0xed17('0x41')]['id']}})[_0xed17('0x21')](handleEntityNotFound(_0x41c2d5,null))[_0xed17('0x21')](removeEntity(_0x41c2d5,null))['catch'](handleError(_0x41c2d5,null));};exports['describe']=function(_0x375803,_0x445150){return db[_0xed17('0x28')][_0xed17('0x48')]()['then'](respondWithResult(_0x445150,null))[_0xed17('0x3f')](handleError(_0x445150,null));}; \ No newline at end of file +var _0xa90f=['undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2e612a,_0x106dd7){var _0x3cb97c=function(_0x367d2f){while(--_0x367d2f){_0x2e612a['push'](_0x2e612a['shift']());}};_0x3cb97c(++_0x106dd7);}(_0xa90f,0x1ef));var _0xfa90=function(_0x530804,_0x44e860){_0x530804=_0x530804-0x0;var _0x3c0f69=_0xa90f[_0x530804];return _0x3c0f69;};'use strict';var emlformat=require(_0xfa90('0x0'));var rimraf=require(_0xfa90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa90('0x2'));var moment=require(_0xfa90('0x3'));var BPromise=require(_0xfa90('0x4'));var Mustache=require(_0xfa90('0x5'));var util=require(_0xfa90('0x6'));var path=require(_0xfa90('0x7'));var sox=require(_0xfa90('0x8'));var csv=require('to-csv');var ejs=require(_0xfa90('0x9'));var fs=require('fs');var fs_extra=require(_0xfa90('0xa'));var _=require(_0xfa90('0xb'));var squel=require(_0xfa90('0xc'));var crypto=require(_0xfa90('0xd'));var jsforce=require(_0xfa90('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfa90('0xf'));var Papa=require(_0xfa90('0x10'));var Redis=require(_0xfa90('0x11'));var authService=require(_0xfa90('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfa90('0x13'));var hardwareService=require(_0xfa90('0x14'));var logger=require(_0xfa90('0x15'))(_0xfa90('0x16'));var utils=require(_0xfa90('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfa90('0x18'))['db'];function respondWithStatusCode(_0x3ec160,_0x3a863a){_0x3a863a=_0x3a863a||0xcc;return function(_0x3d8f0b){if(_0x3d8f0b){return _0x3ec160[_0xfa90('0x19')](_0x3a863a);}return _0x3ec160[_0xfa90('0x1a')](_0x3a863a)[_0xfa90('0x1b')]();};}function respondWithResult(_0x30be2b,_0x19cb85){_0x19cb85=_0x19cb85||0xc8;return function(_0x112a8a){if(_0x112a8a){return _0x30be2b[_0xfa90('0x1a')](_0x19cb85)[_0xfa90('0x1c')](_0x112a8a);}};}function respondWithFilteredResult(_0x33f6fe,_0x1eea3e){return function(_0xd48866){if(_0xd48866){var _0x139202=typeof _0x1eea3e[_0xfa90('0x1d')]===_0xfa90('0x1e')&&typeof _0x1eea3e[_0xfa90('0x1f')]===_0xfa90('0x1e');var _0x2d55bb=_0xd48866[_0xfa90('0x20')];var _0x63a088=_0x139202?0x0:_0x1eea3e['offset'];var _0x39bdf9=_0x139202?_0xd48866[_0xfa90('0x20')]:_0x1eea3e[_0xfa90('0x1d')]+_0x1eea3e[_0xfa90('0x1f')];var _0x4a02f2;if(_0x39bdf9>=_0x2d55bb){_0x39bdf9=_0x2d55bb;_0x4a02f2=0xc8;}else{_0x4a02f2=0xce;}_0x33f6fe[_0xfa90('0x1a')](_0x4a02f2);return _0x33f6fe[_0xfa90('0x21')](_0xfa90('0x22'),_0x63a088+'-'+_0x39bdf9+'/'+_0x2d55bb)[_0xfa90('0x1c')](_0xd48866);}return null;};}function patchUpdates(_0x2be6bf){return function(_0xc07f0c){try{jsonpatch[_0xfa90('0x23')](_0xc07f0c,_0x2be6bf,!![]);}catch(_0x2fcba){return BPromise[_0xfa90('0x24')](_0x2fcba);}return _0xc07f0c['save']();};}function saveUpdates(_0x5c0552,_0x37997b){return function(_0x55e3c4){if(_0x55e3c4){return _0x55e3c4[_0xfa90('0x25')](_0x5c0552)[_0xfa90('0x26')](function(_0x9c4642){return _0x9c4642;});}return null;};}function removeEntity(_0x32ebac,_0x188fad){return function(_0x5a96ac){if(_0x5a96ac){return _0x5a96ac[_0xfa90('0x27')]()[_0xfa90('0x26')](function(){_0x32ebac[_0xfa90('0x1a')](0xcc)[_0xfa90('0x1b')]();});}};}function handleEntityNotFound(_0x413d34,_0x554414){return function(_0x5c73e3){if(!_0x5c73e3){_0x413d34['sendStatus'](0x194);}return _0x5c73e3;};}function handleError(_0xc7c290,_0x5232d5){_0x5232d5=_0x5232d5||0x1f4;return function(_0x32a957){logger[_0xfa90('0x28')](_0x32a957['stack']);if(_0x32a957[_0xfa90('0x29')]){delete _0x32a957['name'];}_0xc7c290[_0xfa90('0x1a')](_0x5232d5)[_0xfa90('0x2a')](_0x32a957);};}exports['index']=function(_0x4b6654,_0x2ed94b){var _0x25e634={},_0x1edc2c={},_0x2b020d={'count':0x0,'rows':[]};var _0x47484a=_[_0xfa90('0x2b')](db[_0xfa90('0x2c')][_0xfa90('0x2d')],function(_0x3a687f){return{'name':_0x3a687f[_0xfa90('0x2e')],'type':_0x3a687f[_0xfa90('0x2f')][_0xfa90('0x30')]};});_0x1edc2c[_0xfa90('0x31')]=_[_0xfa90('0x2b')](_0x47484a,_0xfa90('0x29'));_0x1edc2c[_0xfa90('0x32')]=_[_0xfa90('0x33')](_0x4b6654[_0xfa90('0x32')]);_0x1edc2c[_0xfa90('0x34')]=_[_0xfa90('0x35')](_0x1edc2c[_0xfa90('0x31')],_0x1edc2c['query']);_0x25e634[_0xfa90('0x36')]=_[_0xfa90('0x35')](_0x1edc2c['model'],qs['fields'](_0x4b6654['query'][_0xfa90('0x37')]));_0x25e634[_0xfa90('0x36')]=_0x25e634[_0xfa90('0x36')][_0xfa90('0x38')]?_0x25e634[_0xfa90('0x36')]:_0x1edc2c[_0xfa90('0x31')];if(!_0x4b6654[_0xfa90('0x32')][_0xfa90('0x39')](_0xfa90('0x3a'))){_0x25e634[_0xfa90('0x1f')]=qs[_0xfa90('0x1f')](_0x4b6654[_0xfa90('0x32')]['limit']);_0x25e634[_0xfa90('0x1d')]=qs['offset'](_0x4b6654[_0xfa90('0x32')][_0xfa90('0x1d')]);}_0x25e634['order']=qs[_0xfa90('0x3b')](_0x4b6654[_0xfa90('0x32')][_0xfa90('0x3b')]);_0x25e634[_0xfa90('0x3c')]=qs['filters'](_[_0xfa90('0x3d')](_0x4b6654['query'],_0x1edc2c[_0xfa90('0x34')]),_0x47484a);if(_0x4b6654['query'][_0xfa90('0x3e')]){_0x25e634[_0xfa90('0x3c')]=_['merge'](_0x25e634[_0xfa90('0x3c')],{'$or':_[_0xfa90('0x2b')](_0x47484a,function(_0x3b098c){if(_0x3b098c[_0xfa90('0x2f')]!=='VIRTUAL'){var _0x3c362d={};_0x3c362d[_0x3b098c[_0xfa90('0x29')]]={'$like':'%'+_0x4b6654[_0xfa90('0x32')][_0xfa90('0x3e')]+'%'};return _0x3c362d;}})});}_0x25e634=_[_0xfa90('0x3f')]({},_0x25e634,_0x4b6654[_0xfa90('0x40')]);var _0x24e1ca={'where':_0x25e634['where']};return db[_0xfa90('0x2c')][_0xfa90('0x20')](_0x24e1ca)['then'](function(_0x1aa3fc){_0x2b020d[_0xfa90('0x20')]=_0x1aa3fc;if(_0x4b6654[_0xfa90('0x32')][_0xfa90('0x41')]){_0x25e634[_0xfa90('0x42')]=[{'all':!![]}];}return db[_0xfa90('0x2c')]['findAll'](_0x25e634);})['then'](function(_0x38d9fc){_0x2b020d[_0xfa90('0x43')]=_0x38d9fc;return _0x2b020d;})[_0xfa90('0x26')](respondWithFilteredResult(_0x2ed94b,_0x25e634))[_0xfa90('0x44')](handleError(_0x2ed94b,null));};exports[_0xfa90('0x45')]=function(_0x5053b5,_0x22a994){var _0x2ffdef={'raw':!![],'where':{'id':_0x5053b5[_0xfa90('0x46')]['id']}},_0x37462f={};_0x37462f[_0xfa90('0x31')]=_[_0xfa90('0x33')](db[_0xfa90('0x2c')]['rawAttributes']);_0x37462f['query']=_[_0xfa90('0x33')](_0x5053b5[_0xfa90('0x32')]);_0x37462f[_0xfa90('0x34')]=_[_0xfa90('0x35')](_0x37462f['model'],_0x37462f[_0xfa90('0x32')]);_0x2ffdef['attributes']=_[_0xfa90('0x35')](_0x37462f[_0xfa90('0x31')],qs[_0xfa90('0x37')](_0x5053b5[_0xfa90('0x32')][_0xfa90('0x37')]));_0x2ffdef[_0xfa90('0x36')]=_0x2ffdef[_0xfa90('0x36')]['length']?_0x2ffdef[_0xfa90('0x36')]:_0x37462f[_0xfa90('0x31')];if(_0x5053b5[_0xfa90('0x32')][_0xfa90('0x41')]){_0x2ffdef['include']=[{'all':!![]}];}_0x2ffdef=_[_0xfa90('0x3f')]({},_0x2ffdef,_0x5053b5[_0xfa90('0x40')]);return db[_0xfa90('0x2c')][_0xfa90('0x47')](_0x2ffdef)[_0xfa90('0x26')](handleEntityNotFound(_0x22a994,null))[_0xfa90('0x26')](respondWithResult(_0x22a994,null))['catch'](handleError(_0x22a994,null));};exports[_0xfa90('0x48')]=function(_0x213716,_0x9a2932){return db[_0xfa90('0x2c')][_0xfa90('0x48')](_0x213716['body'],{})[_0xfa90('0x26')](respondWithResult(_0x9a2932,0xc9))[_0xfa90('0x44')](handleError(_0x9a2932,null));};exports[_0xfa90('0x25')]=function(_0x1410cf,_0x3d2688){if(_0x1410cf['body']['id']){delete _0x1410cf[_0xfa90('0x49')]['id'];}return db[_0xfa90('0x2c')][_0xfa90('0x47')]({'where':{'id':_0x1410cf[_0xfa90('0x46')]['id']}})[_0xfa90('0x26')](handleEntityNotFound(_0x3d2688,null))[_0xfa90('0x26')](saveUpdates(_0x1410cf[_0xfa90('0x49')],null))[_0xfa90('0x26')](respondWithResult(_0x3d2688,null))['catch'](handleError(_0x3d2688,null));};exports[_0xfa90('0x27')]=function(_0x3f4a79,_0xece91b){return db[_0xfa90('0x2c')][_0xfa90('0x47')]({'where':{'id':_0x3f4a79[_0xfa90('0x46')]['id']}})['then'](handleEntityNotFound(_0xece91b,null))['then'](removeEntity(_0xece91b,null))[_0xfa90('0x44')](handleError(_0xece91b,null));};exports[_0xfa90('0x4a')]=function(_0x14f97c,_0x1e21a3){return db[_0xfa90('0x2c')][_0xfa90('0x4a')]()[_0xfa90('0x26')](respondWithResult(_0x1e21a3,null))['catch'](handleError(_0x1e21a3,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index b2bf85a..1e5fa2b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0xf93440,_0x3a0444){var _0x462df0=function(_0x496471){while(--_0x496471){_0xf93440['push'](_0xf93440['shift']());}};_0x462df0(++_0x3a0444);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x5beff2,_0x255b93){var _0xa8bd83=function(_0x3281f0){while(--_0x3281f0){_0x5beff2['push'](_0x5beff2['shift']());}};_0xa8bd83(++_0x255b93);}(_0x2ef3,0xba));var _0x32ef=function(_0x206fc3,_0x45d9fa){_0x206fc3=_0x206fc3-0x0;var _0x376f1d=_0x2ef3[_0x206fc3];return _0x376f1d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index ae2de43..3ec8b18 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 _0x777d=['CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','UpdateOpenchannelQueueReport','body','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x489197,_0x32e8ab){var _0x50df6e=function(_0x536ac9){while(--_0x536ac9){_0x489197['push'](_0x489197['shift']());}};_0x50df6e(++_0x32e8ab);}(_0x777d,0xe9));var _0xd777=function(_0x28d7b5,_0x1305a4){_0x28d7b5=_0x28d7b5-0x0;var _0x1ed035=_0x777d[_0x28d7b5];return _0x1ed035;};'use strict';var _=require('lodash');var util=require(_0xd777('0x0'));var moment=require(_0xd777('0x1'));var BPromise=require(_0xd777('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd777('0x3'));var db=require(_0xd777('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd777('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd777('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7c954,_0x5d1a5f,_0x57d67f){return new BPromise(function(_0x49d55d,_0x197296){return client[_0xd777('0x7')](_0xc7c954,_0x57d67f)[_0xd777('0x8')](function(_0x25450d){logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));logger[_0xd777('0xc')](_0xd777('0xd'),_0x5d1a5f,_0xd777('0xb'),JSON[_0xd777('0xe')](_0x25450d));if(_0x25450d[_0xd777('0xf')]){if(_0x25450d[_0xd777('0xf')]['code']===0x1f4){logger['error'](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x197296(_0x25450d[_0xd777('0xf')][_0xd777('0x10')]);}logger[_0xd777('0xf')](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x49d55d(_0x25450d['error'][_0xd777('0x10')]);}else{logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));_0x49d55d(_0x25450d[_0xd777('0x11')]['message']);}})[_0xd777('0x12')](function(_0x4b3d52){logger[_0xd777('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5d1a5f,_0x4b3d52);_0x197296(_0x4b3d52);});});}exports[_0xd777('0x13')]=function(_0x386f1a){var _0x2dd8ec=this;return new Promise(function(_0x13b63b,_0x2c6114){return db[_0xd777('0x14')]['create'](_0x386f1a['body'],{'raw':_0x386f1a[_0xd777('0x15')]?_0x386f1a['options'][_0xd777('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x58a079){logger['info'](_0xd777('0x13'),_0x386f1a);logger['debug']('CreateOpenchannelQueueReport',_0x386f1a,JSON['stringify'](_0x58a079));_0x13b63b(_0x58a079);})['catch'](function(_0x55b975){logger[_0xd777('0xf')](_0xd777('0x13'),_0x55b975[_0xd777('0x10')],_0x386f1a);_0x2c6114(_0x2dd8ec[_0xd777('0xf')](0x1f4,_0x55b975[_0xd777('0x10')]));});});};exports[_0xd777('0x17')]=function(_0x2ff8d3){var _0x87b828=this;return new Promise(function(_0x188a3a,_0x3e637a){return db[_0xd777('0x14')]['update'](_0x2ff8d3[_0xd777('0x18')],{'raw':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3[_0xd777('0x15')][_0xd777('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3['options'][_0xd777('0x19')]||null:null,'attributes':_0x2ff8d3['options']?_0x2ff8d3['options'][_0xd777('0x1a')]||null:null,'limit':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3[_0xd777('0x15')][_0xd777('0x1b')]||null:null})['then'](function(_0x453b45){logger[_0xd777('0x9')](_0xd777('0x17'),_0x2ff8d3);logger[_0xd777('0xc')](_0xd777('0x17'),_0x2ff8d3,JSON[_0xd777('0xe')](_0x453b45));_0x188a3a(_0x453b45);})[_0xd777('0x12')](function(_0x3ebb94){logger['error'](_0xd777('0x17'),_0x3ebb94['message'],_0x2ff8d3);_0x3e637a(_0x87b828['error'](0x1f4,_0x3ebb94[_0xd777('0x10')]));});});}; \ No newline at end of file +var _0xaa5e=['UpdateOpenchannelQueueReport','update','body','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','OpenchannelQueueReport','create','options','raw','CreateOpenchannelQueueReport','debug','catch'];(function(_0x230805,_0x48503e){var _0x3180c3=function(_0x4fba87){while(--_0x4fba87){_0x230805['push'](_0x230805['shift']());}};_0x3180c3(++_0x48503e);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x1a19ce,_0x3206c2){_0x1a19ce=_0x1a19ce-0x0;var _0xf5be60=_0xaa5e[_0x1a19ce];return _0xf5be60;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d405e,_0x2f9041,_0x2c9696){return new BPromise(function(_0x50cb62,_0x2e35c3){return client[_0xeaa5('0xb')](_0x4d405e,_0x2c9696)['then'](function(_0x2e9ca6){logger['info'](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));logger['debug'](_0xeaa5('0xe'),_0x2f9041,_0xeaa5('0xd'),JSON[_0xeaa5('0xf')](_0x2e9ca6));if(_0x2e9ca6[_0xeaa5('0x10')]){if(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x11')]===0x1f4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x2e35c3(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x12')]);}logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x50cb62(_0x2e9ca6[_0xeaa5('0x10')]['message']);}else{logger[_0xeaa5('0x13')](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));_0x50cb62(_0x2e9ca6['result'][_0xeaa5('0x12')]);}})['catch'](function(_0x44e4b4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x44e4b4);_0x2e35c3(_0x44e4b4);});});}exports['CreateOpenchannelQueueReport']=function(_0x1877a6){var _0x50256a=this;return new Promise(function(_0x222da7,_0x85fb44){return db[_0xeaa5('0x14')][_0xeaa5('0x15')](_0x1877a6['body'],{'raw':_0x1877a6[_0xeaa5('0x16')]?_0x1877a6[_0xeaa5('0x16')][_0xeaa5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x11ace2){logger[_0xeaa5('0x13')](_0xeaa5('0x18'),_0x1877a6);logger[_0xeaa5('0x19')](_0xeaa5('0x18'),_0x1877a6,JSON['stringify'](_0x11ace2));_0x222da7(_0x11ace2);})[_0xeaa5('0x1a')](function(_0x5f2d83){logger[_0xeaa5('0x10')](_0xeaa5('0x18'),_0x5f2d83[_0xeaa5('0x12')],_0x1877a6);_0x85fb44(_0x50256a[_0xeaa5('0x10')](0x1f4,_0x5f2d83[_0xeaa5('0x12')]));});});};exports[_0xeaa5('0x1b')]=function(_0x355dbd){var _0xee844c=this;return new Promise(function(_0xebce8c,_0x2c4003){return db[_0xeaa5('0x14')][_0xeaa5('0x1c')](_0x355dbd[_0xeaa5('0x1d')],{'raw':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['where']||null:null,'attributes':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')][_0xeaa5('0x1e')]||null:null,'limit':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['limit']||null:null})[_0xeaa5('0x1f')](function(_0x592fe1){logger[_0xeaa5('0x13')](_0xeaa5('0x1b'),_0x355dbd);logger[_0xeaa5('0x19')](_0xeaa5('0x1b'),_0x355dbd,JSON[_0xeaa5('0xf')](_0x592fe1));_0xebce8c(_0x592fe1);})[_0xeaa5('0x1a')](function(_0x5121b6){logger[_0xeaa5('0x10')](_0xeaa5('0x1b'),_0x5121b6['message'],_0x355dbd);_0x2c4003(_0xee844c[_0xeaa5('0x10')](0x1f4,_0x5121b6['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index fc29301..bec802a 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 _0x9d7a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x9d7a,0xbd));var _0xa9d7=function(_0x1c2891,_0x25970c){_0x1c2891=_0x1c2891-0x0;var _0x462583=_0x9d7a[_0x1c2891];return _0x462583;};'use strict';var multer=require(_0xa9d7('0x0'));var util=require(_0xa9d7('0x1'));var path=require(_0xa9d7('0x2'));var timeout=require(_0xa9d7('0x3'));var express=require(_0xa9d7('0x4'));var router=express[_0xa9d7('0x5')]();var fs_extra=require(_0xa9d7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa9d7('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0xa9d7('0x8')]('/',auth[_0xa9d7('0x9')](),controller[_0xa9d7('0xa')]);router[_0xa9d7('0x8')](_0xa9d7('0xb'),auth[_0xa9d7('0x9')](),controller[_0xa9d7('0xc')]);router[_0xa9d7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa9d7('0xd')]);router[_0xa9d7('0xe')]('/',auth[_0xa9d7('0x9')](),controller[_0xa9d7('0xf')]);router[_0xa9d7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa9d7('0x11')]);router[_0xa9d7('0x12')](_0xa9d7('0x13'),auth[_0xa9d7('0x9')](),controller[_0xa9d7('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3d4d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports'];(function(_0x1041a3,_0x4a2260){var _0xd8651c=function(_0x556e82){while(--_0x556e82){_0x1041a3['push'](_0x1041a3['shift']());}};_0xd8651c(++_0x4a2260);}(_0x3d4d,0xbd));var _0xd3d4=function(_0x52023e,_0x3d2d03){_0x52023e=_0x52023e-0x0;var _0x4ab315=_0x3d4d[_0x52023e];return _0x4ab315;};'use strict';var multer=require(_0xd3d4('0x0'));var util=require(_0xd3d4('0x1'));var path=require(_0xd3d4('0x2'));var timeout=require(_0xd3d4('0x3'));var express=require(_0xd3d4('0x4'));var router=express[_0xd3d4('0x5')]();var fs_extra=require(_0xd3d4('0x6'));var auth=require(_0xd3d4('0x7'));var interaction=require(_0xd3d4('0x8'));var config=require(_0xd3d4('0x9'));var controller=require(_0xd3d4('0xa'));router[_0xd3d4('0xb')]('/',auth[_0xd3d4('0xc')](),controller[_0xd3d4('0xd')]);router[_0xd3d4('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd3d4('0xb')](_0xd3d4('0xe'),auth[_0xd3d4('0xc')](),controller[_0xd3d4('0xf')]);router[_0xd3d4('0x10')]('/',auth['isAuthenticated'](),controller[_0xd3d4('0x11')]);router[_0xd3d4('0x12')]('/:id',auth[_0xd3d4('0xc')](),controller['update']);router['delete'](_0xd3d4('0xe'),auth[_0xd3d4('0xc')](),controller[_0xd3d4('0x13')]);module[_0xd3d4('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 2e52041..1a8737b 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3da144,_0x578cbd){var _0x13fdc7=function(_0x2d2919){while(--_0x2d2919){_0x3da144['push'](_0x3da144['shift']());}};_0x13fdc7(++_0x578cbd);}(_0x34e8,0x12c));var _0x834e=function(_0x323fef,_0x334954){_0x323fef=_0x323fef-0x0;var _0x533f09=_0x34e8[_0x323fef];return _0x533f09;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x2f8ffd,_0x5555fe){var _0xdf9842=function(_0x266345){while(--_0x266345){_0x2f8ffd['push'](_0x2f8ffd['shift']());}};_0xdf9842(++_0x5555fe);}(_0x70e0,0x17b));var _0x070e=function(_0x376d71,_0x42acc2){_0x376d71=_0x376d71-0x0;var _0x19a48a=_0x70e0[_0x376d71];return _0x19a48a;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 54cdf2e..37740f5 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 _0x71b3=['find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body'];(function(_0x47e448,_0x13fc0c){var _0x2b94da=function(_0x321185){while(--_0x321185){_0x47e448['push'](_0x47e448['shift']());}};_0x2b94da(++_0x13fc0c);}(_0x71b3,0x165));var _0x371b=function(_0x587799,_0x23b2e7){_0x587799=_0x587799-0x0;var _0x5c72b2=_0x71b3[_0x587799];return _0x5c72b2;};'use strict';var emlformat=require(_0x371b('0x0'));var rimraf=require(_0x371b('0x1'));var zipdir=require(_0x371b('0x2'));var jsonpatch=require(_0x371b('0x3'));var rp=require(_0x371b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x371b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x371b('0x6'));var ejs=require(_0x371b('0x7'));var fs=require('fs');var fs_extra=require(_0x371b('0x8'));var _=require(_0x371b('0x9'));var squel=require('squel');var crypto=require(_0x371b('0xa'));var jsforce=require(_0x371b('0xb'));var deskjs=require(_0x371b('0xc'));var toCsv=require(_0x371b('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x371b('0xd'));var authService=require(_0x371b('0xe'));var qs=require(_0x371b('0xf'));var as=require(_0x371b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x371b('0x11'));var utils=require(_0x371b('0x12'));var config=require(_0x371b('0x13'));var licenseUtil=require(_0x371b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25f706,_0x4aa502){_0x4aa502=_0x4aa502||0xcc;return function(_0xc19626){if(_0xc19626){return _0x25f706['sendStatus'](_0x4aa502);}return _0x25f706['status'](_0x4aa502)['end']();};}function respondWithResult(_0x13834f,_0x28d55a){_0x28d55a=_0x28d55a||0xc8;return function(_0x48be7f){if(_0x48be7f){return _0x13834f['status'](_0x28d55a)['json'](_0x48be7f);}};}function respondWithFilteredResult(_0x4e0033,_0x184d13){return function(_0x409553){if(_0x409553){var _0x2eb018=typeof _0x184d13[_0x371b('0x15')]===_0x371b('0x16')&&typeof _0x184d13[_0x371b('0x17')]===_0x371b('0x16');var _0x4a3097=_0x409553[_0x371b('0x18')];var _0x58840c=_0x2eb018?0x0:_0x184d13['offset'];var _0xcd3187=_0x2eb018?_0x409553[_0x371b('0x18')]:_0x184d13['offset']+_0x184d13[_0x371b('0x17')];var _0x1a0867;if(_0xcd3187>=_0x4a3097){_0xcd3187=_0x4a3097;_0x1a0867=0xc8;}else{_0x1a0867=0xce;}_0x4e0033[_0x371b('0x19')](_0x1a0867);return _0x4e0033[_0x371b('0x1a')]('Content-Range',_0x58840c+'-'+_0xcd3187+'/'+_0x4a3097)[_0x371b('0x1b')](_0x409553);}return null;};}function patchUpdates(_0x47cdf0){return function(_0x506aa2){try{jsonpatch[_0x371b('0x1c')](_0x506aa2,_0x47cdf0,!![]);}catch(_0x49a697){return BPromise[_0x371b('0x1d')](_0x49a697);}return _0x506aa2[_0x371b('0x1e')]();};}function saveUpdates(_0x599c1a,_0x20b47d){return function(_0x40b58a){if(_0x40b58a){return _0x40b58a[_0x371b('0x1f')](_0x599c1a)[_0x371b('0x20')](function(_0x3ef709){return _0x3ef709;});}return null;};}function removeEntity(_0x6c92d0,_0x4a3dc4){return function(_0x29207a){if(_0x29207a){return _0x29207a[_0x371b('0x21')]()['then'](function(){_0x6c92d0[_0x371b('0x19')](0xcc)[_0x371b('0x22')]();});}};}function handleEntityNotFound(_0x1c503b,_0x4790b1){return function(_0x51ce52){if(!_0x51ce52){_0x1c503b[_0x371b('0x23')](0x194);}return _0x51ce52;};}function handleError(_0x5b9e2f,_0x2af061){_0x2af061=_0x2af061||0x1f4;return function(_0x5ca19b){logger[_0x371b('0x24')](_0x5ca19b['stack']);if(_0x5ca19b[_0x371b('0x25')]){delete _0x5ca19b[_0x371b('0x25')];}_0x5b9e2f['status'](_0x2af061)['send'](_0x5ca19b);};}exports['index']=function(_0x289957,_0x2b729c){var _0x1a2534={},_0x1f1318={},_0x5b50f3={'count':0x0,'rows':[]};var _0xb9adfa=_[_0x371b('0x26')](db[_0x371b('0x27')][_0x371b('0x28')],function(_0x45e5b2){return{'name':_0x45e5b2['fieldName'],'type':_0x45e5b2[_0x371b('0x29')][_0x371b('0x2a')]};});_0x1f1318[_0x371b('0x2b')]=_[_0x371b('0x26')](_0xb9adfa,'name');_0x1f1318[_0x371b('0x2c')]=_[_0x371b('0x2d')](_0x289957[_0x371b('0x2c')]);_0x1f1318[_0x371b('0x2e')]=_[_0x371b('0x2f')](_0x1f1318[_0x371b('0x2b')],_0x1f1318[_0x371b('0x2c')]);_0x1a2534[_0x371b('0x30')]=_[_0x371b('0x2f')](_0x1f1318[_0x371b('0x2b')],qs['fields'](_0x289957[_0x371b('0x2c')][_0x371b('0x31')]));_0x1a2534[_0x371b('0x30')]=_0x1a2534[_0x371b('0x30')][_0x371b('0x32')]?_0x1a2534['attributes']:_0x1f1318[_0x371b('0x2b')];if(!_0x289957['query'][_0x371b('0x33')](_0x371b('0x34'))){_0x1a2534[_0x371b('0x17')]=qs[_0x371b('0x17')](_0x289957['query'][_0x371b('0x17')]);_0x1a2534[_0x371b('0x15')]=qs[_0x371b('0x15')](_0x289957[_0x371b('0x2c')][_0x371b('0x15')]);}_0x1a2534[_0x371b('0x35')]=qs[_0x371b('0x36')](_0x289957['query']['sort']);_0x1a2534[_0x371b('0x37')]=qs['filters'](_[_0x371b('0x38')](_0x289957['query'],_0x1f1318[_0x371b('0x2e')]),_0xb9adfa);if(_0x289957['query'][_0x371b('0x39')]){_0x1a2534['where']=_[_0x371b('0x3a')](_0x1a2534[_0x371b('0x37')],{'$or':_[_0x371b('0x26')](_0xb9adfa,function(_0x24e8ef){if(_0x24e8ef[_0x371b('0x29')]!==_0x371b('0x3b')){var _0x15c1c9={};_0x15c1c9[_0x24e8ef[_0x371b('0x25')]]={'$like':'%'+_0x289957[_0x371b('0x2c')][_0x371b('0x39')]+'%'};return _0x15c1c9;}})});}_0x1a2534=_[_0x371b('0x3a')]({},_0x1a2534,_0x289957[_0x371b('0x3c')]);var _0x5a16b2={'where':_0x1a2534[_0x371b('0x37')]};return db['OpenchannelTransferReport']['count'](_0x5a16b2)[_0x371b('0x20')](function(_0x1c91b4){_0x5b50f3[_0x371b('0x18')]=_0x1c91b4;if(_0x289957[_0x371b('0x2c')][_0x371b('0x3d')]){_0x1a2534[_0x371b('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x371b('0x3f')](_0x1a2534);})[_0x371b('0x20')](function(_0x47c972){_0x5b50f3[_0x371b('0x40')]=_0x47c972;return _0x5b50f3;})[_0x371b('0x20')](respondWithFilteredResult(_0x2b729c,_0x1a2534))[_0x371b('0x41')](handleError(_0x2b729c,null));};exports[_0x371b('0x42')]=function(_0x4fd1ef,_0x969e9c){var _0x3dbf72={'raw':!![],'where':{'id':_0x4fd1ef['params']['id']}},_0x4dd2e6={};_0x4dd2e6[_0x371b('0x2b')]=_[_0x371b('0x2d')](db[_0x371b('0x27')][_0x371b('0x28')]);_0x4dd2e6[_0x371b('0x2c')]=_['keys'](_0x4fd1ef[_0x371b('0x2c')]);_0x4dd2e6[_0x371b('0x2e')]=_[_0x371b('0x2f')](_0x4dd2e6[_0x371b('0x2b')],_0x4dd2e6[_0x371b('0x2c')]);_0x3dbf72[_0x371b('0x30')]=_[_0x371b('0x2f')](_0x4dd2e6[_0x371b('0x2b')],qs[_0x371b('0x31')](_0x4fd1ef[_0x371b('0x2c')]['fields']));_0x3dbf72['attributes']=_0x3dbf72[_0x371b('0x30')][_0x371b('0x32')]?_0x3dbf72[_0x371b('0x30')]:_0x4dd2e6[_0x371b('0x2b')];if(_0x4fd1ef[_0x371b('0x2c')]['includeAll']){_0x3dbf72['include']=[{'all':!![]}];}_0x3dbf72=_[_0x371b('0x3a')]({},_0x3dbf72,_0x4fd1ef['options']);return db[_0x371b('0x27')]['find'](_0x3dbf72)[_0x371b('0x20')](handleEntityNotFound(_0x969e9c,null))[_0x371b('0x20')](respondWithResult(_0x969e9c,null))[_0x371b('0x41')](handleError(_0x969e9c,null));};exports[_0x371b('0x43')]=function(_0x43f550,_0x2fe50d){return db['OpenchannelTransferReport']['create'](_0x43f550['body'],{})[_0x371b('0x20')](respondWithResult(_0x2fe50d,0xc9))['catch'](handleError(_0x2fe50d,null));};exports[_0x371b('0x1f')]=function(_0x394ddb,_0x4dc257){if(_0x394ddb[_0x371b('0x44')]['id']){delete _0x394ddb[_0x371b('0x44')]['id'];}return db[_0x371b('0x27')][_0x371b('0x45')]({'where':{'id':_0x394ddb[_0x371b('0x46')]['id']}})[_0x371b('0x20')](handleEntityNotFound(_0x4dc257,null))[_0x371b('0x20')](saveUpdates(_0x394ddb[_0x371b('0x44')],null))[_0x371b('0x20')](respondWithResult(_0x4dc257,null))['catch'](handleError(_0x4dc257,null));};exports[_0x371b('0x21')]=function(_0x55138b,_0x4b64dd){return db[_0x371b('0x27')][_0x371b('0x45')]({'where':{'id':_0x55138b['params']['id']}})[_0x371b('0x20')](handleEntityNotFound(_0x4b64dd,null))['then'](removeEntity(_0x4b64dd,null))[_0x371b('0x41')](handleError(_0x4b64dd,null));};exports['describe']=function(_0x194c62,_0x2af05f){return db['OpenchannelTransferReport']['describe']()[_0x371b('0x20')](respondWithResult(_0x2af05f,null))[_0x371b('0x41')](handleError(_0x2af05f,null));}; \ No newline at end of file +var _0x379e=['key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','OpenchannelTransferReport','rows','show','find','create','body','update','catch','params','describe','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x379e,0x104));var _0xe379=function(_0x11f5f3,_0x3824e2){_0x11f5f3=_0x11f5f3-0x0;var _0x566b47=_0x379e[_0x11f5f3];return _0x566b47;};'use strict';var emlformat=require(_0xe379('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe379('0x1'));var moment=require(_0xe379('0x2'));var BPromise=require(_0xe379('0x3'));var Mustache=require(_0xe379('0x4'));var util=require(_0xe379('0x5'));var path=require(_0xe379('0x6'));var sox=require(_0xe379('0x7'));var csv=require('to-csv');var ejs=require(_0xe379('0x8'));var fs=require('fs');var fs_extra=require(_0xe379('0x9'));var _=require(_0xe379('0xa'));var squel=require(_0xe379('0xb'));var crypto=require(_0xe379('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe379('0xd'));var toCsv=require(_0xe379('0xe'));var querystring=require(_0xe379('0xf'));var Papa=require(_0xe379('0x10'));var Redis=require(_0xe379('0x11'));var authService=require(_0xe379('0x12'));var qs=require(_0xe379('0x13'));var as=require(_0xe379('0x14'));var hardwareService=require(_0xe379('0x15'));var logger=require('../../config/logger')(_0xe379('0x16'));var utils=require(_0xe379('0x17'));var config=require(_0xe379('0x18'));var licenseUtil=require(_0xe379('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6562,_0x2642a8){_0x2642a8=_0x2642a8||0xcc;return function(_0x45cf1a){if(_0x45cf1a){return _0x4c6562[_0xe379('0x1a')](_0x2642a8);}return _0x4c6562[_0xe379('0x1b')](_0x2642a8)[_0xe379('0x1c')]();};}function respondWithResult(_0x1ee8e0,_0x2a5b60){_0x2a5b60=_0x2a5b60||0xc8;return function(_0x70d82){if(_0x70d82){return _0x1ee8e0['status'](_0x2a5b60)[_0xe379('0x1d')](_0x70d82);}};}function respondWithFilteredResult(_0xab59c7,_0x20eaaf){return function(_0x105d7f){if(_0x105d7f){var _0x3d9351=typeof _0x20eaaf[_0xe379('0x1e')]==='undefined'&&typeof _0x20eaaf[_0xe379('0x1f')]==='undefined';var _0x2c2bd9=_0x105d7f['count'];var _0x150d92=_0x3d9351?0x0:_0x20eaaf[_0xe379('0x1e')];var _0xe4f3d1=_0x3d9351?_0x105d7f[_0xe379('0x20')]:_0x20eaaf['offset']+_0x20eaaf[_0xe379('0x1f')];var _0x260b2e;if(_0xe4f3d1>=_0x2c2bd9){_0xe4f3d1=_0x2c2bd9;_0x260b2e=0xc8;}else{_0x260b2e=0xce;}_0xab59c7[_0xe379('0x1b')](_0x260b2e);return _0xab59c7[_0xe379('0x21')](_0xe379('0x22'),_0x150d92+'-'+_0xe4f3d1+'/'+_0x2c2bd9)['json'](_0x105d7f);}return null;};}function patchUpdates(_0x2c749e){return function(_0x3a8d17){try{jsonpatch['apply'](_0x3a8d17,_0x2c749e,!![]);}catch(_0x39ec4d){return BPromise[_0xe379('0x23')](_0x39ec4d);}return _0x3a8d17[_0xe379('0x24')]();};}function saveUpdates(_0x2e946f,_0x32f43e){return function(_0x10b3c3){if(_0x10b3c3){return _0x10b3c3['update'](_0x2e946f)[_0xe379('0x25')](function(_0x32e16e){return _0x32e16e;});}return null;};}function removeEntity(_0x21e31b,_0x48b543){return function(_0x38236b){if(_0x38236b){return _0x38236b[_0xe379('0x26')]()['then'](function(){_0x21e31b[_0xe379('0x1b')](0xcc)[_0xe379('0x1c')]();});}};}function handleEntityNotFound(_0x4da256,_0x544bf3){return function(_0x22f596){if(!_0x22f596){_0x4da256[_0xe379('0x1a')](0x194);}return _0x22f596;};}function handleError(_0x26ba82,_0x4aa041){_0x4aa041=_0x4aa041||0x1f4;return function(_0x17ba51){logger[_0xe379('0x27')](_0x17ba51[_0xe379('0x28')]);if(_0x17ba51[_0xe379('0x29')]){delete _0x17ba51['name'];}_0x26ba82[_0xe379('0x1b')](_0x4aa041)[_0xe379('0x2a')](_0x17ba51);};}exports[_0xe379('0x2b')]=function(_0x50b0aa,_0x33037d){var _0x120239={},_0x5d9ca1={},_0x24c85d={'count':0x0,'rows':[]};var _0x528a44=_[_0xe379('0x2c')](db['OpenchannelTransferReport'][_0xe379('0x2d')],function(_0x214a0c){return{'name':_0x214a0c[_0xe379('0x2e')],'type':_0x214a0c[_0xe379('0x2f')][_0xe379('0x30')]};});_0x5d9ca1[_0xe379('0x31')]=_[_0xe379('0x2c')](_0x528a44,'name');_0x5d9ca1[_0xe379('0x32')]=_[_0xe379('0x33')](_0x50b0aa[_0xe379('0x32')]);_0x5d9ca1['filters']=_[_0xe379('0x34')](_0x5d9ca1['model'],_0x5d9ca1['query']);_0x120239[_0xe379('0x35')]=_[_0xe379('0x34')](_0x5d9ca1[_0xe379('0x31')],qs[_0xe379('0x36')](_0x50b0aa['query'][_0xe379('0x36')]));_0x120239[_0xe379('0x35')]=_0x120239['attributes'][_0xe379('0x37')]?_0x120239[_0xe379('0x35')]:_0x5d9ca1[_0xe379('0x31')];if(!_0x50b0aa[_0xe379('0x32')]['hasOwnProperty'](_0xe379('0x38'))){_0x120239['limit']=qs[_0xe379('0x1f')](_0x50b0aa[_0xe379('0x32')][_0xe379('0x1f')]);_0x120239[_0xe379('0x1e')]=qs[_0xe379('0x1e')](_0x50b0aa['query'][_0xe379('0x1e')]);}_0x120239['order']=qs[_0xe379('0x39')](_0x50b0aa[_0xe379('0x32')][_0xe379('0x39')]);_0x120239['where']=qs[_0xe379('0x3a')](_[_0xe379('0x3b')](_0x50b0aa[_0xe379('0x32')],_0x5d9ca1[_0xe379('0x3a')]),_0x528a44);if(_0x50b0aa['query'][_0xe379('0x3c')]){_0x120239['where']=_[_0xe379('0x3d')](_0x120239[_0xe379('0x3e')],{'$or':_[_0xe379('0x2c')](_0x528a44,function(_0x12e67e){if(_0x12e67e[_0xe379('0x2f')]!==_0xe379('0x3f')){var _0x56ebb7={};_0x56ebb7[_0x12e67e[_0xe379('0x29')]]={'$like':'%'+_0x50b0aa['query'][_0xe379('0x3c')]+'%'};return _0x56ebb7;}})});}_0x120239=_[_0xe379('0x3d')]({},_0x120239,_0x50b0aa[_0xe379('0x40')]);var _0x2e3eef={'where':_0x120239[_0xe379('0x3e')]};return db['OpenchannelTransferReport'][_0xe379('0x20')](_0x2e3eef)[_0xe379('0x25')](function(_0x59ba54){_0x24c85d['count']=_0x59ba54;if(_0x50b0aa['query'][_0xe379('0x41')]){_0x120239[_0xe379('0x42')]=[{'all':!![]}];}return db[_0xe379('0x43')]['findAll'](_0x120239);})[_0xe379('0x25')](function(_0x3089df){_0x24c85d[_0xe379('0x44')]=_0x3089df;return _0x24c85d;})[_0xe379('0x25')](respondWithFilteredResult(_0x33037d,_0x120239))['catch'](handleError(_0x33037d,null));};exports[_0xe379('0x45')]=function(_0x36ce8e,_0x3c6f5d){var _0x32ecbe={'raw':!![],'where':{'id':_0x36ce8e['params']['id']}},_0x48f0cc={};_0x48f0cc[_0xe379('0x31')]=_[_0xe379('0x33')](db[_0xe379('0x43')][_0xe379('0x2d')]);_0x48f0cc[_0xe379('0x32')]=_[_0xe379('0x33')](_0x36ce8e['query']);_0x48f0cc[_0xe379('0x3a')]=_['intersection'](_0x48f0cc[_0xe379('0x31')],_0x48f0cc[_0xe379('0x32')]);_0x32ecbe[_0xe379('0x35')]=_[_0xe379('0x34')](_0x48f0cc[_0xe379('0x31')],qs[_0xe379('0x36')](_0x36ce8e[_0xe379('0x32')][_0xe379('0x36')]));_0x32ecbe[_0xe379('0x35')]=_0x32ecbe[_0xe379('0x35')][_0xe379('0x37')]?_0x32ecbe[_0xe379('0x35')]:_0x48f0cc[_0xe379('0x31')];if(_0x36ce8e[_0xe379('0x32')][_0xe379('0x41')]){_0x32ecbe[_0xe379('0x42')]=[{'all':!![]}];}_0x32ecbe=_[_0xe379('0x3d')]({},_0x32ecbe,_0x36ce8e[_0xe379('0x40')]);return db[_0xe379('0x43')][_0xe379('0x46')](_0x32ecbe)[_0xe379('0x25')](handleEntityNotFound(_0x3c6f5d,null))[_0xe379('0x25')](respondWithResult(_0x3c6f5d,null))['catch'](handleError(_0x3c6f5d,null));};exports[_0xe379('0x47')]=function(_0x266bfe,_0x42a378){return db[_0xe379('0x43')][_0xe379('0x47')](_0x266bfe[_0xe379('0x48')],{})['then'](respondWithResult(_0x42a378,0xc9))['catch'](handleError(_0x42a378,null));};exports[_0xe379('0x49')]=function(_0x5db39f,_0x55b27b){if(_0x5db39f[_0xe379('0x48')]['id']){delete _0x5db39f[_0xe379('0x48')]['id'];}return db[_0xe379('0x43')][_0xe379('0x46')]({'where':{'id':_0x5db39f['params']['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x55b27b,null))[_0xe379('0x25')](saveUpdates(_0x5db39f['body'],null))[_0xe379('0x25')](respondWithResult(_0x55b27b,null))[_0xe379('0x4a')](handleError(_0x55b27b,null));};exports['destroy']=function(_0x4ac3eb,_0x3af1be){return db[_0xe379('0x43')]['find']({'where':{'id':_0x4ac3eb[_0xe379('0x4b')]['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x3af1be,null))[_0xe379('0x25')](removeEntity(_0x3af1be,null))[_0xe379('0x4a')](handleError(_0x3af1be,null));};exports[_0xe379('0x4c')]=function(_0x4a9c86,_0x337775){return db['OpenchannelTransferReport']['describe']()[_0xe379('0x25')](respondWithResult(_0x337775,null))[_0xe379('0x4a')](handleError(_0x337775,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e9c823f..5938b88 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 _0x25c2=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x25c3bc,_0x34c529){var _0x569223=function(_0x150c08){while(--_0x150c08){_0x25c3bc['push'](_0x25c3bc['shift']());}};_0x569223(++_0x34c529);}(_0x25c2,0xaa));var _0x225c=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x25c2[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x225c('0x0'));var util=require(_0x225c('0x1'));var logger=require(_0x225c('0x2'))(_0x225c('0x3'));var moment=require(_0x225c('0x4'));var BPromise=require(_0x225c('0x5'));var rp=require(_0x225c('0x6'));var fs=require('fs');var path=require(_0x225c('0x7'));var rimraf=require(_0x225c('0x8'));var config=require(_0x225c('0x9'));var attributes=require(_0x225c('0xa'));module[_0x225c('0xb')]=function(_0x18c78a,_0x2b1820){return _0x18c78a[_0x225c('0xc')](_0x225c('0xd'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x225c('0xe'),'fields':[_0x225c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa96f=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xf1c15e,_0x1f3af3){var _0x2db635=function(_0x3b7c5e){while(--_0x3b7c5e){_0xf1c15e['push'](_0xf1c15e['shift']());}};_0x2db635(++_0x1f3af3);}(_0xa96f,0x87));var _0xfa96=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0xa96f[_0x42c6f1];return _0x3c7398;};'use strict';var _=require('lodash');var util=require(_0xfa96('0x0'));var logger=require(_0xfa96('0x1'))('api');var moment=require(_0xfa96('0x2'));var BPromise=require(_0xfa96('0x3'));var rp=require(_0xfa96('0x4'));var fs=require('fs');var path=require(_0xfa96('0x5'));var rimraf=require(_0xfa96('0x6'));var config=require(_0xfa96('0x7'));var attributes=require(_0xfa96('0x8'));module[_0xfa96('0x9')]=function(_0x3ea0e1,_0x48b9c3){return _0x3ea0e1[_0xfa96('0xa')](_0xfa96('0xb'),attributes,{'tableName':_0xfa96('0xc'),'paranoid':![],'indexes':[{'name':_0xfa96('0xd'),'fields':[_0xfa96('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4084f7c..05d5ee8 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 _0x72a2=['info','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0xaa8588,_0x1d32f7){var _0x46a6c1=function(_0x818dae){while(--_0x818dae){_0xaa8588['push'](_0xaa8588['shift']());}};_0x46a6c1(++_0x1d32f7);}(_0x72a2,0x161));var _0x272a=function(_0xbf2ff6,_0xe695a7){_0xbf2ff6=_0xbf2ff6-0x0;var _0xf9fca9=_0x72a2[_0xbf2ff6];return _0xf9fca9;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var moment=require(_0x272a('0x1'));var BPromise=require(_0x272a('0x2'));var rs=require(_0x272a('0x3'));var fs=require('fs');var Redis=require(_0x272a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x272a('0x5'));var logger=require('../../config/logger')(_0x272a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x272a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43d188,_0x220b90,_0x283070){return new BPromise(function(_0x54dbfb,_0x484f88){return client[_0x272a('0x8')](_0x43d188,_0x283070)['then'](function(_0x830fb6){logger['info'](_0x272a('0x9'),_0x220b90,_0x272a('0xa'));logger[_0x272a('0xb')](_0x272a('0xc'),_0x220b90,'request\x20sent',JSON['stringify'](_0x830fb6));if(_0x830fb6[_0x272a('0xd')]){if(_0x830fb6[_0x272a('0xd')]['code']===0x1f4){logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x484f88(_0x830fb6[_0x272a('0xd')]['message']);}logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x54dbfb(_0x830fb6['error'][_0x272a('0xe')]);}else{logger[_0x272a('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x220b90,'request\x20sent');_0x54dbfb(_0x830fb6['result']['message']);}})['catch'](function(_0x567955){logger[_0x272a('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x220b90,_0x567955);_0x484f88(_0x567955);});});} \ No newline at end of file +var _0x10af=['error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent'];(function(_0x4917c2,_0x5801f7){var _0x59683b=function(_0x4f4896){while(--_0x4f4896){_0x4917c2['push'](_0x4917c2['shift']());}};_0x59683b(++_0x5801f7);}(_0x10af,0xfc));var _0xf10a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x10af[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xf10a('0x0'));var util=require('util');var moment=require(_0xf10a('0x1'));var BPromise=require(_0xf10a('0x2'));var rs=require(_0xf10a('0x3'));var fs=require('fs');var Redis=require(_0xf10a('0x4'));var db=require(_0xf10a('0x5'))['db'];var utils=require(_0xf10a('0x6'));var logger=require(_0xf10a('0x7'))(_0xf10a('0x8'));var config=require('../../config/environment');var jayson=require(_0xf10a('0x9'));var client=jayson[_0xf10a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cd7e4,_0x8c9add,_0x1563fb){return new BPromise(function(_0x2ade36,_0x110583){return client['request'](_0x4cd7e4,_0x1563fb)[_0xf10a('0xb')](function(_0x52502e){logger[_0xf10a('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8c9add,_0xf10a('0xd'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x8c9add,_0xf10a('0xd'),JSON['stringify'](_0x52502e));if(_0x52502e[_0xf10a('0xe')]){if(_0x52502e[_0xf10a('0xe')]['code']===0x1f4){logger[_0xf10a('0xe')](_0xf10a('0xf'),_0x8c9add,_0x52502e[_0xf10a('0xe')][_0xf10a('0x10')]);return _0x110583(_0x52502e[_0xf10a('0xe')][_0xf10a('0x10')]);}logger[_0xf10a('0xe')](_0xf10a('0xf'),_0x8c9add,_0x52502e[_0xf10a('0xe')]['message']);return _0x2ade36(_0x52502e[_0xf10a('0xe')]['message']);}else{logger['info'](_0xf10a('0xf'),_0x8c9add,_0xf10a('0xd'));_0x2ade36(_0x52502e[_0xf10a('0x11')][_0xf10a('0x10')]);}})[_0xf10a('0x12')](function(_0x549d50){logger[_0xf10a('0xe')](_0xf10a('0xf'),_0x8c9add,_0x549d50);_0x110583(_0x549d50);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 97d504b..c1aa92d 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 _0x5d4d=['put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','create'];(function(_0x2de522,_0x30337f){var _0xe24362=function(_0x94cc4){while(--_0x94cc4){_0x2de522['push'](_0x2de522['shift']());}};_0xe24362(++_0x30337f);}(_0x5d4d,0x1cf));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5d4('0x0'));var util=require(_0xd5d4('0x1'));var path=require(_0xd5d4('0x2'));var timeout=require(_0xd5d4('0x3'));var express=require(_0xd5d4('0x4'));var router=express[_0xd5d4('0x5')]();var fs_extra=require(_0xd5d4('0x6'));var auth=require(_0xd5d4('0x7'));var interaction=require(_0xd5d4('0x8'));var config=require(_0xd5d4('0x9'));var controller=require(_0xd5d4('0xa'));router[_0xd5d4('0xb')]('/',auth['isAuthenticated'](),controller[_0xd5d4('0xc')]);router[_0xd5d4('0xb')](_0xd5d4('0xd'),auth[_0xd5d4('0xe')](),controller[_0xd5d4('0xf')]);router['post']('/',auth[_0xd5d4('0xe')](),controller[_0xd5d4('0x10')]);router[_0xd5d4('0x11')](_0xd5d4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd5d4('0x12')](_0xd5d4('0xd'),auth[_0xd5d4('0xe')](),controller['destroy']);module[_0xd5d4('0x13')]=router; \ No newline at end of file +var _0x983c=['./pause.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x983c,0xf3));var _0xc983=function(_0x42ad6b,_0x39a94){_0x42ad6b=_0x42ad6b-0x0;var _0x442838=_0x983c[_0x42ad6b];return _0x442838;};'use strict';var multer=require(_0xc983('0x0'));var util=require(_0xc983('0x1'));var path=require(_0xc983('0x2'));var timeout=require(_0xc983('0x3'));var express=require(_0xc983('0x4'));var router=express['Router']();var fs_extra=require(_0xc983('0x5'));var auth=require(_0xc983('0x6'));var interaction=require(_0xc983('0x7'));var config=require(_0xc983('0x8'));var controller=require(_0xc983('0x9'));router[_0xc983('0xa')]('/',auth[_0xc983('0xb')](),controller['index']);router[_0xc983('0xa')](_0xc983('0xc'),auth[_0xc983('0xb')](),controller[_0xc983('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc983('0xc'),auth[_0xc983('0xb')](),controller[_0xc983('0xe')]);router[_0xc983('0xf')](_0xc983('0xc'),auth[_0xc983('0xb')](),controller[_0xc983('0x10')]);module[_0xc983('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index e7731cd..c938e65 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 _0xea84=['sequelize','name'];(function(_0x2bb747,_0x186a3e){var _0x32c072=function(_0x300b38){while(--_0x300b38){_0x2bb747['push'](_0x2bb747['shift']());}};_0x32c072(++_0x186a3e);}(_0xea84,0x1c4));var _0x4ea8=function(_0x46af42,_0x47dc8c){_0x46af42=_0x46af42-0x0;var _0x3f4ef8=_0xea84[_0x46af42];return _0x3f4ef8;};'use strict';var Sequelize=require(_0x4ea8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4ea8('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x414e=['STRING','name','sequelize'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x414e,0x128));var _0xe414=function(_0x1b39cc,_0x44ff1a){_0x1b39cc=_0x1b39cc-0x0;var _0x59e836=_0x414e[_0x1b39cc];return _0x59e836;};'use strict';var Sequelize=require(_0xe414('0x0'));module['exports']={'name':{'type':Sequelize[_0xe414('0x1')],'unique':_0xe414('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 d19b105..a2fa5c5 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 _0xa514=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','Pause','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0xa514,0xac));var _0x4a51=function(_0x537b07,_0x3be951){_0x537b07=_0x537b07-0x0;var _0x4ed47c=_0xa514[_0x537b07];return _0x4ed47c;};'use strict';var emlformat=require(_0x4a51('0x0'));var rimraf=require(_0x4a51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a51('0x2'));var moment=require(_0x4a51('0x3'));var BPromise=require(_0x4a51('0x4'));var Mustache=require(_0x4a51('0x5'));var util=require(_0x4a51('0x6'));var path=require(_0x4a51('0x7'));var sox=require(_0x4a51('0x8'));var csv=require(_0x4a51('0x9'));var ejs=require(_0x4a51('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a51('0xb'));var squel=require(_0x4a51('0xc'));var crypto=require(_0x4a51('0xd'));var jsforce=require(_0x4a51('0xe'));var deskjs=require(_0x4a51('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a51('0x10'));var Papa=require(_0x4a51('0x11'));var Redis=require(_0x4a51('0x12'));var authService=require(_0x4a51('0x13'));var qs=require(_0x4a51('0x14'));var as=require(_0x4a51('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a51('0x16'));var utils=require(_0x4a51('0x17'));var config=require(_0x4a51('0x18'));var licenseUtil=require(_0x4a51('0x19'));var db=require(_0x4a51('0x1a'))['db'];function respondWithStatusCode(_0x530f56,_0x2b2c4a){_0x2b2c4a=_0x2b2c4a||0xcc;return function(_0x24bbe5){if(_0x24bbe5){return _0x530f56[_0x4a51('0x1b')](_0x2b2c4a);}return _0x530f56[_0x4a51('0x1c')](_0x2b2c4a)[_0x4a51('0x1d')]();};}function respondWithResult(_0x198cd9,_0x514fe5){_0x514fe5=_0x514fe5||0xc8;return function(_0x5a30ba){if(_0x5a30ba){return _0x198cd9[_0x4a51('0x1c')](_0x514fe5)[_0x4a51('0x1e')](_0x5a30ba);}};}function respondWithFilteredResult(_0x4a8666,_0x55eca3){return function(_0x157e33){if(_0x157e33){var _0x27e5d5=typeof _0x55eca3['offset']===_0x4a51('0x1f')&&typeof _0x55eca3[_0x4a51('0x20')]==='undefined';var _0x517375=_0x157e33[_0x4a51('0x21')];var _0x37efdf=_0x27e5d5?0x0:_0x55eca3[_0x4a51('0x22')];var _0x12f2b4=_0x27e5d5?_0x157e33[_0x4a51('0x21')]:_0x55eca3[_0x4a51('0x22')]+_0x55eca3[_0x4a51('0x20')];var _0x4af7a7;if(_0x12f2b4>=_0x517375){_0x12f2b4=_0x517375;_0x4af7a7=0xc8;}else{_0x4af7a7=0xce;}_0x4a8666[_0x4a51('0x1c')](_0x4af7a7);return _0x4a8666[_0x4a51('0x23')]('Content-Range',_0x37efdf+'-'+_0x12f2b4+'/'+_0x517375)[_0x4a51('0x1e')](_0x157e33);}return null;};}function patchUpdates(_0x1095ff){return function(_0x41228f){try{jsonpatch[_0x4a51('0x24')](_0x41228f,_0x1095ff,!![]);}catch(_0x8d6a99){return BPromise[_0x4a51('0x25')](_0x8d6a99);}return _0x41228f[_0x4a51('0x26')]();};}function saveUpdates(_0x327005,_0x2acc49){return function(_0x353c24){if(_0x353c24){return _0x353c24[_0x4a51('0x27')](_0x327005)[_0x4a51('0x28')](function(_0x31bbc6){return _0x31bbc6;});}return null;};}function removeEntity(_0x5474d2,_0x24c939){return function(_0x5057ef){if(_0x5057ef){return _0x5057ef[_0x4a51('0x29')]()[_0x4a51('0x28')](function(){var _0xd153c6=_0x5057ef['get']({'plain':!![]});var _0xe0d391=_0x4a51('0x2a');return db[_0x4a51('0x2b')][_0x4a51('0x29')]({'where':{'type':_0xe0d391,'resourceId':_0xd153c6['id']}})['then'](function(){return _0x5057ef;});})[_0x4a51('0x28')](function(){_0x5474d2[_0x4a51('0x1c')](0xcc)[_0x4a51('0x1d')]();});}};}function handleEntityNotFound(_0x3cd5dd,_0x20506f){return function(_0x495213){if(!_0x495213){_0x3cd5dd[_0x4a51('0x1b')](0x194);}return _0x495213;};}function handleError(_0x3b5405,_0x50da1e){_0x50da1e=_0x50da1e||0x1f4;return function(_0x3c661d){logger[_0x4a51('0x2c')](_0x3c661d['stack']);if(_0x3c661d[_0x4a51('0x2d')]){delete _0x3c661d[_0x4a51('0x2d')];}_0x3b5405[_0x4a51('0x1c')](_0x50da1e)[_0x4a51('0x2e')](_0x3c661d);};}exports[_0x4a51('0x2f')]=function(_0xbf02e7,_0x221ac1){var _0x1ed0fc={},_0x3cd4aa={},_0x1ee658={'count':0x0,'rows':[]};var _0x5cd56e=_[_0x4a51('0x30')](db['Pause'][_0x4a51('0x31')],function(_0x589b52){return{'name':_0x589b52['fieldName'],'type':_0x589b52['type']['key']};});_0x3cd4aa[_0x4a51('0x32')]=_[_0x4a51('0x30')](_0x5cd56e,_0x4a51('0x2d'));_0x3cd4aa[_0x4a51('0x33')]=_[_0x4a51('0x34')](_0xbf02e7[_0x4a51('0x33')]);_0x3cd4aa[_0x4a51('0x35')]=_[_0x4a51('0x36')](_0x3cd4aa[_0x4a51('0x32')],_0x3cd4aa['query']);_0x1ed0fc['attributes']=_[_0x4a51('0x36')](_0x3cd4aa[_0x4a51('0x32')],qs[_0x4a51('0x37')](_0xbf02e7['query'][_0x4a51('0x37')]));_0x1ed0fc['attributes']=_0x1ed0fc[_0x4a51('0x38')][_0x4a51('0x39')]?_0x1ed0fc['attributes']:_0x3cd4aa[_0x4a51('0x32')];if(!_0xbf02e7[_0x4a51('0x33')]['hasOwnProperty'](_0x4a51('0x3a'))){_0x1ed0fc[_0x4a51('0x20')]=qs[_0x4a51('0x20')](_0xbf02e7[_0x4a51('0x33')]['limit']);_0x1ed0fc[_0x4a51('0x22')]=qs[_0x4a51('0x22')](_0xbf02e7[_0x4a51('0x33')][_0x4a51('0x22')]);}_0x1ed0fc['order']=qs[_0x4a51('0x3b')](_0xbf02e7[_0x4a51('0x33')]['sort']);_0x1ed0fc['where']=qs[_0x4a51('0x35')](_[_0x4a51('0x3c')](_0xbf02e7['query'],_0x3cd4aa[_0x4a51('0x35')]),_0x5cd56e);if(_0xbf02e7[_0x4a51('0x33')][_0x4a51('0x3d')]){_0x1ed0fc[_0x4a51('0x3e')]=_[_0x4a51('0x3f')](_0x1ed0fc['where'],{'$or':_[_0x4a51('0x30')](_0x5cd56e,function(_0x4e2c2b){if(_0x4e2c2b[_0x4a51('0x40')]!==_0x4a51('0x41')){var _0x44914b={};_0x44914b[_0x4e2c2b[_0x4a51('0x2d')]]={'$like':'%'+_0xbf02e7[_0x4a51('0x33')][_0x4a51('0x3d')]+'%'};return _0x44914b;}})});}_0x1ed0fc=_[_0x4a51('0x3f')]({},_0x1ed0fc,_0xbf02e7[_0x4a51('0x42')]);var _0x16ce17={'where':_0x1ed0fc[_0x4a51('0x3e')]};return db['Pause'][_0x4a51('0x21')](_0x16ce17)[_0x4a51('0x28')](function(_0x218fdf){_0x1ee658[_0x4a51('0x21')]=_0x218fdf;if(_0xbf02e7[_0x4a51('0x33')]['includeAll']){_0x1ed0fc[_0x4a51('0x43')]=[{'all':!![]}];}return db['Pause'][_0x4a51('0x44')](_0x1ed0fc);})['then'](function(_0x178a43){_0x1ee658[_0x4a51('0x45')]=_0x178a43;return _0x1ee658;})[_0x4a51('0x28')](respondWithFilteredResult(_0x221ac1,_0x1ed0fc))[_0x4a51('0x46')](handleError(_0x221ac1,null));};exports[_0x4a51('0x47')]=function(_0x102c3e,_0xa91fdf){var _0xe840ba={'raw':!![],'where':{'id':_0x102c3e[_0x4a51('0x48')]['id']}},_0x4fd662={};_0x4fd662[_0x4a51('0x32')]=_[_0x4a51('0x34')](db['Pause'][_0x4a51('0x31')]);_0x4fd662[_0x4a51('0x33')]=_[_0x4a51('0x34')](_0x102c3e['query']);_0x4fd662[_0x4a51('0x35')]=_[_0x4a51('0x36')](_0x4fd662['model'],_0x4fd662[_0x4a51('0x33')]);_0xe840ba['attributes']=_[_0x4a51('0x36')](_0x4fd662['model'],qs[_0x4a51('0x37')](_0x102c3e[_0x4a51('0x33')][_0x4a51('0x37')]));_0xe840ba[_0x4a51('0x38')]=_0xe840ba['attributes'][_0x4a51('0x39')]?_0xe840ba['attributes']:_0x4fd662[_0x4a51('0x32')];if(_0x102c3e['query'][_0x4a51('0x49')]){_0xe840ba['include']=[{'all':!![]}];}_0xe840ba=_[_0x4a51('0x3f')]({},_0xe840ba,_0x102c3e[_0x4a51('0x42')]);return db['Pause']['find'](_0xe840ba)[_0x4a51('0x28')](handleEntityNotFound(_0xa91fdf,null))[_0x4a51('0x28')](respondWithResult(_0xa91fdf,null))['catch'](handleError(_0xa91fdf,null));};exports[_0x4a51('0x4a')]=function(_0x129cd9,_0x2a02fd){return db[_0x4a51('0x4b')][_0x4a51('0x4a')](_0x129cd9['body'],{})['then'](function(_0x355d2b){var _0x145f23=_0x129cd9['user'][_0x4a51('0x4c')]({'plain':!![]});if(!_0x145f23)throw new Error(_0x4a51('0x4d'));if(_0x145f23[_0x4a51('0x4e')]===_0x4a51('0x4f')){var _0x36ef41=_0x355d2b['get']({'plain':!![]});var _0x201703='Pauses';return db[_0x4a51('0x50')][_0x4a51('0x51')]({'where':{'name':_0x201703,'userProfileId':_0x145f23[_0x4a51('0x52')]},'raw':!![]})['then'](function(_0x302699){if(_0x302699&&_0x302699['autoAssociation']===0x0){return db[_0x4a51('0x2b')][_0x4a51('0x4a')]({'name':_0x36ef41[_0x4a51('0x2d')],'resourceId':_0x36ef41['id'],'type':_0x302699['name'],'sectionId':_0x302699['id']},{})['then'](function(){return _0x355d2b;});}else{return _0x355d2b;}})[_0x4a51('0x46')](function(_0x586bb3){logger[_0x4a51('0x2c')](_0x4a51('0x53'),_0x586bb3);throw _0x586bb3;});}return _0x355d2b;})[_0x4a51('0x28')](respondWithResult(_0x2a02fd,0xc9))['catch'](handleError(_0x2a02fd,null));};exports['update']=function(_0xf4fc2f,_0x49be1b){if(_0xf4fc2f[_0x4a51('0x54')]['id']){delete _0xf4fc2f['body']['id'];}return db[_0x4a51('0x4b')][_0x4a51('0x51')]({'where':{'id':_0xf4fc2f[_0x4a51('0x48')]['id']}})['then'](handleEntityNotFound(_0x49be1b,null))[_0x4a51('0x28')](saveUpdates(_0xf4fc2f[_0x4a51('0x54')],null))[_0x4a51('0x28')](respondWithResult(_0x49be1b,null))[_0x4a51('0x46')](handleError(_0x49be1b,null));};exports[_0x4a51('0x29')]=function(_0x3119c1,_0x36af9a){return db[_0x4a51('0x4b')][_0x4a51('0x51')]({'where':{'id':_0x3119c1[_0x4a51('0x48')]['id']}})[_0x4a51('0x28')](handleEntityNotFound(_0x36af9a,null))[_0x4a51('0x28')](removeEntity(_0x36af9a,null))[_0x4a51('0x46')](handleError(_0x36af9a,null));}; \ No newline at end of file +var _0x9853=['keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','Pauses','UserProfileResource','sendStatus','name','index','map','Pause','fieldName','type','key','model','query'];(function(_0x12ba3d,_0x5eae0d){var _0x178544=function(_0x9f0d46){while(--_0x9f0d46){_0x12ba3d['push'](_0x12ba3d['shift']());}};_0x178544(++_0x5eae0d);}(_0x9853,0xbc));var _0x3985=function(_0x4794b5,_0x34efd1){_0x4794b5=_0x4794b5-0x0;var _0x1ff218=_0x9853[_0x4794b5];return _0x1ff218;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3985('0x0'));var zipdir=require(_0x3985('0x1'));var jsonpatch=require(_0x3985('0x2'));var rp=require(_0x3985('0x3'));var moment=require(_0x3985('0x4'));var BPromise=require(_0x3985('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3985('0x6'));var sox=require(_0x3985('0x7'));var csv=require(_0x3985('0x8'));var ejs=require(_0x3985('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3985('0xa'));var squel=require(_0x3985('0xb'));var crypto=require(_0x3985('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3985('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3985('0xe'));var qs=require(_0x3985('0xf'));var as=require(_0x3985('0x10'));var hardwareService=require(_0x3985('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3985('0x12'))['db'];function respondWithStatusCode(_0x4fbfe2,_0xee19ea){_0xee19ea=_0xee19ea||0xcc;return function(_0x20f6a0){if(_0x20f6a0){return _0x4fbfe2['sendStatus'](_0xee19ea);}return _0x4fbfe2[_0x3985('0x13')](_0xee19ea)[_0x3985('0x14')]();};}function respondWithResult(_0x461de8,_0x555ce8){_0x555ce8=_0x555ce8||0xc8;return function(_0x335aef){if(_0x335aef){return _0x461de8[_0x3985('0x13')](_0x555ce8)['json'](_0x335aef);}};}function respondWithFilteredResult(_0x48a44a,_0x456f4b){return function(_0x253529){if(_0x253529){var _0x1a226f=typeof _0x456f4b[_0x3985('0x15')]===_0x3985('0x16')&&typeof _0x456f4b['limit']===_0x3985('0x16');var _0x29cada=_0x253529[_0x3985('0x17')];var _0x3164f4=_0x1a226f?0x0:_0x456f4b[_0x3985('0x15')];var _0x3ad336=_0x1a226f?_0x253529[_0x3985('0x17')]:_0x456f4b[_0x3985('0x15')]+_0x456f4b[_0x3985('0x18')];var _0x7cd983;if(_0x3ad336>=_0x29cada){_0x3ad336=_0x29cada;_0x7cd983=0xc8;}else{_0x7cd983=0xce;}_0x48a44a[_0x3985('0x13')](_0x7cd983);return _0x48a44a[_0x3985('0x19')](_0x3985('0x1a'),_0x3164f4+'-'+_0x3ad336+'/'+_0x29cada)[_0x3985('0x1b')](_0x253529);}return null;};}function patchUpdates(_0x30777f){return function(_0x364c18){try{jsonpatch[_0x3985('0x1c')](_0x364c18,_0x30777f,!![]);}catch(_0x117f0c){return BPromise[_0x3985('0x1d')](_0x117f0c);}return _0x364c18[_0x3985('0x1e')]();};}function saveUpdates(_0x1db0d7,_0x411dc5){return function(_0x4b3b33){if(_0x4b3b33){return _0x4b3b33[_0x3985('0x1f')](_0x1db0d7)[_0x3985('0x20')](function(_0x4268b0){return _0x4268b0;});}return null;};}function removeEntity(_0x43035f,_0x8c316d){return function(_0x26f88d){if(_0x26f88d){return _0x26f88d['destroy']()['then'](function(){var _0x2ea983=_0x26f88d[_0x3985('0x21')]({'plain':!![]});var _0x140d76=_0x3985('0x22');return db[_0x3985('0x23')]['destroy']({'where':{'type':_0x140d76,'resourceId':_0x2ea983['id']}})[_0x3985('0x20')](function(){return _0x26f88d;});})[_0x3985('0x20')](function(){_0x43035f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eff08,_0x380227){return function(_0x4e3b54){if(!_0x4e3b54){_0x4eff08[_0x3985('0x24')](0x194);}return _0x4e3b54;};}function handleError(_0x43d17b,_0x45b40f){_0x45b40f=_0x45b40f||0x1f4;return function(_0x23dd6e){logger['error'](_0x23dd6e['stack']);if(_0x23dd6e[_0x3985('0x25')]){delete _0x23dd6e['name'];}_0x43d17b['status'](_0x45b40f)['send'](_0x23dd6e);};}exports[_0x3985('0x26')]=function(_0x1ae1a8,_0x41541e){var _0x190633={},_0xceb8f4={},_0x405899={'count':0x0,'rows':[]};var _0x145a46=_[_0x3985('0x27')](db[_0x3985('0x28')]['rawAttributes'],function(_0x1d91ed){return{'name':_0x1d91ed[_0x3985('0x29')],'type':_0x1d91ed[_0x3985('0x2a')][_0x3985('0x2b')]};});_0xceb8f4[_0x3985('0x2c')]=_[_0x3985('0x27')](_0x145a46,'name');_0xceb8f4[_0x3985('0x2d')]=_[_0x3985('0x2e')](_0x1ae1a8['query']);_0xceb8f4['filters']=_[_0x3985('0x2f')](_0xceb8f4[_0x3985('0x2c')],_0xceb8f4[_0x3985('0x2d')]);_0x190633['attributes']=_['intersection'](_0xceb8f4[_0x3985('0x2c')],qs[_0x3985('0x30')](_0x1ae1a8['query'][_0x3985('0x30')]));_0x190633[_0x3985('0x31')]=_0x190633[_0x3985('0x31')]['length']?_0x190633['attributes']:_0xceb8f4[_0x3985('0x2c')];if(!_0x1ae1a8[_0x3985('0x2d')]['hasOwnProperty'](_0x3985('0x32'))){_0x190633[_0x3985('0x18')]=qs[_0x3985('0x18')](_0x1ae1a8[_0x3985('0x2d')][_0x3985('0x18')]);_0x190633[_0x3985('0x15')]=qs[_0x3985('0x15')](_0x1ae1a8[_0x3985('0x2d')][_0x3985('0x15')]);}_0x190633[_0x3985('0x33')]=qs['sort'](_0x1ae1a8[_0x3985('0x2d')][_0x3985('0x34')]);_0x190633[_0x3985('0x35')]=qs[_0x3985('0x36')](_[_0x3985('0x37')](_0x1ae1a8[_0x3985('0x2d')],_0xceb8f4[_0x3985('0x36')]),_0x145a46);if(_0x1ae1a8['query'][_0x3985('0x38')]){_0x190633[_0x3985('0x35')]=_[_0x3985('0x39')](_0x190633['where'],{'$or':_[_0x3985('0x27')](_0x145a46,function(_0x27709d){if(_0x27709d[_0x3985('0x2a')]!==_0x3985('0x3a')){var _0x1e7696={};_0x1e7696[_0x27709d[_0x3985('0x25')]]={'$like':'%'+_0x1ae1a8[_0x3985('0x2d')][_0x3985('0x38')]+'%'};return _0x1e7696;}})});}_0x190633=_[_0x3985('0x39')]({},_0x190633,_0x1ae1a8[_0x3985('0x3b')]);var _0x2be099={'where':_0x190633[_0x3985('0x35')]};return db['Pause']['count'](_0x2be099)[_0x3985('0x20')](function(_0x1eb04d){_0x405899[_0x3985('0x17')]=_0x1eb04d;if(_0x1ae1a8[_0x3985('0x2d')]['includeAll']){_0x190633[_0x3985('0x3c')]=[{'all':!![]}];}return db[_0x3985('0x28')][_0x3985('0x3d')](_0x190633);})[_0x3985('0x20')](function(_0x328b99){_0x405899[_0x3985('0x3e')]=_0x328b99;return _0x405899;})[_0x3985('0x20')](respondWithFilteredResult(_0x41541e,_0x190633))[_0x3985('0x3f')](handleError(_0x41541e,null));};exports[_0x3985('0x40')]=function(_0x3d2407,_0xd33b95){var _0x42cd39={'raw':!![],'where':{'id':_0x3d2407[_0x3985('0x41')]['id']}},_0x1c3d8e={};_0x1c3d8e[_0x3985('0x2c')]=_[_0x3985('0x2e')](db[_0x3985('0x28')]['rawAttributes']);_0x1c3d8e[_0x3985('0x2d')]=_[_0x3985('0x2e')](_0x3d2407[_0x3985('0x2d')]);_0x1c3d8e['filters']=_[_0x3985('0x2f')](_0x1c3d8e[_0x3985('0x2c')],_0x1c3d8e['query']);_0x42cd39['attributes']=_['intersection'](_0x1c3d8e[_0x3985('0x2c')],qs[_0x3985('0x30')](_0x3d2407[_0x3985('0x2d')][_0x3985('0x30')]));_0x42cd39[_0x3985('0x31')]=_0x42cd39[_0x3985('0x31')][_0x3985('0x42')]?_0x42cd39[_0x3985('0x31')]:_0x1c3d8e[_0x3985('0x2c')];if(_0x3d2407['query'][_0x3985('0x43')]){_0x42cd39[_0x3985('0x3c')]=[{'all':!![]}];}_0x42cd39=_[_0x3985('0x39')]({},_0x42cd39,_0x3d2407[_0x3985('0x3b')]);return db[_0x3985('0x28')]['find'](_0x42cd39)[_0x3985('0x20')](handleEntityNotFound(_0xd33b95,null))[_0x3985('0x20')](respondWithResult(_0xd33b95,null))[_0x3985('0x3f')](handleError(_0xd33b95,null));};exports[_0x3985('0x44')]=function(_0x33461e,_0x4215c8){return db[_0x3985('0x28')][_0x3985('0x44')](_0x33461e[_0x3985('0x45')],{})[_0x3985('0x20')](function(_0x4cc802){var _0x3269ee=_0x33461e['user'][_0x3985('0x21')]({'plain':!![]});if(!_0x3269ee)throw new Error(_0x3985('0x46'));if(_0x3269ee[_0x3985('0x47')]===_0x3985('0x48')){var _0x493358=_0x4cc802[_0x3985('0x21')]({'plain':!![]});var _0x3aff46=_0x3985('0x22');return db[_0x3985('0x49')][_0x3985('0x4a')]({'where':{'name':_0x3aff46,'userProfileId':_0x3269ee[_0x3985('0x4b')]},'raw':!![]})[_0x3985('0x20')](function(_0x5029aa){if(_0x5029aa&&_0x5029aa[_0x3985('0x4c')]===0x0){return db[_0x3985('0x23')][_0x3985('0x44')]({'name':_0x493358[_0x3985('0x25')],'resourceId':_0x493358['id'],'type':_0x5029aa[_0x3985('0x25')],'sectionId':_0x5029aa['id']},{})[_0x3985('0x20')](function(){return _0x4cc802;});}else{return _0x4cc802;}})[_0x3985('0x3f')](function(_0x5254b8){logger[_0x3985('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5254b8);throw _0x5254b8;});}return _0x4cc802;})[_0x3985('0x20')](respondWithResult(_0x4215c8,0xc9))['catch'](handleError(_0x4215c8,null));};exports[_0x3985('0x1f')]=function(_0x1d5574,_0x5bda6e){if(_0x1d5574[_0x3985('0x45')]['id']){delete _0x1d5574[_0x3985('0x45')]['id'];}return db[_0x3985('0x28')][_0x3985('0x4a')]({'where':{'id':_0x1d5574[_0x3985('0x41')]['id']}})[_0x3985('0x20')](handleEntityNotFound(_0x5bda6e,null))['then'](saveUpdates(_0x1d5574[_0x3985('0x45')],null))['then'](respondWithResult(_0x5bda6e,null))[_0x3985('0x3f')](handleError(_0x5bda6e,null));};exports['destroy']=function(_0x3ebe32,_0x249033){return db[_0x3985('0x28')][_0x3985('0x4a')]({'where':{'id':_0x3ebe32[_0x3985('0x41')]['id']}})[_0x3985('0x20')](handleEntityNotFound(_0x249033,null))[_0x3985('0x20')](removeEntity(_0x249033,null))[_0x3985('0x3f')](handleError(_0x249033,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 3d56aca..2664a00 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(_0x22e627,_0xc8ed07){var _0x810052=function(_0x7d2d98){while(--_0x7d2d98){_0x22e627['push'](_0x22e627['shift']());}};_0x810052(++_0xc8ed07);}(_0x326f,0xd1));var _0xf326=function(_0x4ea627,_0xe8b00e){_0x4ea627=_0x4ea627-0x0;var _0x597da1=_0x326f[_0x4ea627];return _0x597da1;};'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 _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x5e5e32,_0x29bd39){var _0x11c13d=function(_0x9087d3){while(--_0x9087d3){_0x5e5e32['push'](_0x5e5e32['shift']());}};_0x11c13d(++_0x29bd39);}(_0x53ec,0x192));var _0xc53e=function(_0x203a88,_0x32521b){_0x203a88=_0x203a88-0x0;var _0x46e6ce=_0x53ec[_0x203a88];return _0x46e6ce;};'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':'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 8319789..1703b1b 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x57a6d2,_0x135cec){var _0x9bb458=function(_0x9a34){while(--_0x9a34){_0x57a6d2['push'](_0x57a6d2['shift']());}};_0x9bb458(++_0x135cec);}(_0xb10b,0x12a));var _0xbb10=function(_0x25a233,_0x1402dd){_0x25a233=_0x25a233-0x0;var _0x48ed17=_0xb10b[_0x25a233];return _0x48ed17;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x254bf5,_0x44c8c4){var _0x5387a8=function(_0x4fc791){while(--_0x4fc791){_0x254bf5['push'](_0x254bf5['shift']());}};_0x5387a8(++_0x44c8c4);}(_0xb10b,0x12a));var _0xbb10=function(_0x378487,_0x1fdc2c){_0x378487=_0x378487-0x0;var _0x3bb63b=_0xb10b[_0x378487];return _0x3bb63b;};'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 72b4cf5..9e5e89d 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 _0x6737=['diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','upload','webhookPost','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','index','/:id','show','get','download'];(function(_0x2f6414,_0x234c03){var _0x14d158=function(_0x419a02){while(--_0x419a02){_0x2f6414['push'](_0x2f6414['shift']());}};_0x14d158(++_0x234c03);}(_0x6737,0xe2));var _0x7673=function(_0x39595f,_0x55bd3a){_0x39595f=_0x39595f-0x0;var _0x5b190a=_0x6737[_0x39595f];return _0x5b190a;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/webhook',controller['webhookGet']);router['get'](_0x7673('0xa'),auth['isAuthenticated'](),controller[_0x7673('0xb')]);router[_0x7673('0xc')]('/:id/download',auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);var upload=multer({'storage':multer[_0x7673('0xe')]({'destination':function(_0x4d40ce,_0x49fcb2,_0x3ca258){_0x3ca258(null,path['join'](config[_0x7673('0xf')],_0x7673('0x10')));},'filename':function(_0x38090f,_0x451c87,_0x41d6bd){_0x451c87[_0x7673('0x11')]=_0x451c87[_0x7673('0x11')][_0x7673('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41d6bd(null,util[_0x7673('0x13')](_0x7673('0x14'),path['basename'](_0x451c87[_0x7673('0x11')],path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])),Date[_0x7673('0x16')](),path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])));}})});router[_0x7673('0x17')]('/',upload['single']('file'),controller[_0x7673('0x18')]);router[_0x7673('0x17')]('/webhook',controller[_0x7673('0x19')]);router[_0x7673('0x1a')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0x1b')]);router[_0x7673('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0x1c')]);module[_0x7673('0x1d')]=router; \ No newline at end of file +var _0x0c02=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/:id','show','/:id/download','join','root','server/files/plugins','replace','format','%s-%s%s','basename','originalname','extname','now','post','single','file','upload','/webhook','update','delete','exports'];(function(_0x3ae3dd,_0x2260cc){var _0x45d6ba=function(_0x5ccd16){while(--_0x5ccd16){_0x3ae3dd['push'](_0x3ae3dd['shift']());}};_0x45d6ba(++_0x2260cc);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var fs_extra=require(_0x20c0('0x4'));var auth=require(_0x20c0('0x5'));var interaction=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var controller=require(_0x20c0('0x8'));router[_0x20c0('0x9')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xb')]);router['get']('/webhook',controller['webhookGet']);router['get'](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0x9')](_0x20c0('0xe'),auth[_0x20c0('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52eb0d,_0x578592,_0x56770a){_0x56770a(null,path[_0x20c0('0xf')](config[_0x20c0('0x10')],_0x20c0('0x11')));},'filename':function(_0x207b1e,_0x4ed79e,_0x56fa09){_0x4ed79e['originalname']=_0x4ed79e['originalname'][_0x20c0('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56fa09(null,util[_0x20c0('0x13')](_0x20c0('0x14'),path[_0x20c0('0x15')](_0x4ed79e[_0x20c0('0x16')],path[_0x20c0('0x17')](_0x4ed79e[_0x20c0('0x16')])),Date[_0x20c0('0x18')](),path[_0x20c0('0x17')](_0x4ed79e['originalname'])));}})});router[_0x20c0('0x19')]('/',upload[_0x20c0('0x1a')](_0x20c0('0x1b')),controller[_0x20c0('0x1c')]);router[_0x20c0('0x19')](_0x20c0('0x1d'),controller['webhookPost']);router['put']('/:id',auth[_0x20c0('0xa')](),controller[_0x20c0('0x1e')]);router[_0x20c0('0x1f')](_0x20c0('0xc'),auth['isAuthenticated'](),controller[_0x20c0('0x1f')]);module[_0x20c0('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e19e415..7d0f762 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 _0x12bd=['html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','sequelize','exports','ENUM'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x12bd,0xcf));var _0xd12b=function(_0x189d12,_0x17aafc){_0x189d12=_0x189d12-0x0;var _0x39b0ad=_0x12bd[_0x189d12];return _0x39b0ad;};'use strict';var Sequelize=require(_0xd12b('0x0'));module[_0xd12b('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd12b('0x2')](_0xd12b('0x3'),_0xd12b('0x4'))},'description':{'type':Sequelize[_0xd12b('0x5')]},'version':{'type':Sequelize[_0xd12b('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xd12b('0x6')},'active':{'type':Sequelize[_0xd12b('0x7')],'defaultValue':0x0,'comment':_0xd12b('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0xd12b('0x9'),_0xd12b('0xa'),_0xd12b('0xb'),_0xd12b('0xc')),'defaultValue':_0xd12b('0xb'),'comment':_0xd12b('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xd12b('0xe')]},'scriptName':{'type':Sequelize[_0xd12b('0xe')]},'scriptPath':{'type':Sequelize[_0xd12b('0xe')]}}; \ No newline at end of file +var _0x722e=['adminOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','ENUM','html','script','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0xb42dcc,_0x3df873){var _0x1b0c37=function(_0x5597e0){while(--_0x5597e0){_0xb42dcc['push'](_0xb42dcc['shift']());}};_0x1b0c37(++_0x3df873);}(_0x722e,0x1c6));var _0xe722=function(_0x37c4ea,_0x1338b1){_0x37c4ea=_0x37c4ea-0x0;var _0x53c271=_0x722e[_0x37c4ea];return _0x53c271;};'use strict';var Sequelize=require('sequelize');module[_0xe722('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe722('0x1')](_0xe722('0x2'),_0xe722('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xe722('0x4')],'comment':_0xe722('0x5')},'active':{'type':Sequelize[_0xe722('0x6')],'defaultValue':0x0,'comment':_0xe722('0x7')},'sidebar':{'type':Sequelize[_0xe722('0x1')](_0xe722('0x8'),'agentOnly','always',_0xe722('0x9')),'defaultValue':'always','comment':_0xe722('0xa')},'icon':{'type':Sequelize[_0xe722('0x4')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xe722('0x4')]},'scriptPath':{'type':Sequelize[_0xe722('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 4294f27..6207441 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 _0x7a9a=['catch','download','join','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','port','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Plugin','findAll','rows','show','params','includeAll','options','find'];(function(_0x1bdfa6,_0x1f39a6){var _0x254110=function(_0x36915e){while(--_0x36915e){_0x1bdfa6['push'](_0x1bdfa6['shift']());}};_0x254110(++_0x1f39a6);}(_0x7a9a,0x1b3));var _0xa7a9=function(_0x4a8009,_0x447787){_0x4a8009=_0x4a8009-0x0;var _0x1c29d7=_0x7a9a[_0x4a8009];return _0x1c29d7;};'use strict';var emlformat=require(_0xa7a9('0x0'));var rimraf=require(_0xa7a9('0x1'));var zipdir=require(_0xa7a9('0x2'));var jsonpatch=require(_0xa7a9('0x3'));var rp=require('request-promise');var moment=require(_0xa7a9('0x4'));var BPromise=require(_0xa7a9('0x5'));var Mustache=require(_0xa7a9('0x6'));var util=require(_0xa7a9('0x7'));var path=require(_0xa7a9('0x8'));var sox=require('sox');var csv=require(_0xa7a9('0x9'));var ejs=require(_0xa7a9('0xa'));var fs=require('fs');var fs_extra=require(_0xa7a9('0xb'));var _=require(_0xa7a9('0xc'));var squel=require(_0xa7a9('0xd'));var crypto=require(_0xa7a9('0xe'));var jsforce=require(_0xa7a9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa7a9('0x9'));var querystring=require(_0xa7a9('0x10'));var Papa=require(_0xa7a9('0x11'));var extract=require(_0xa7a9('0x12'));var rimraf=require(_0xa7a9('0x1'));var archiver=require(_0xa7a9('0x13'));var Redis=require(_0xa7a9('0x14'));var authService=require(_0xa7a9('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xa7a9('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a9('0x17'))('api');var utils=require(_0xa7a9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa7a9('0x19'));var db=require(_0xa7a9('0x1a'))['db'];config[_0xa7a9('0x1b')]=_[_0xa7a9('0x1c')](config[_0xa7a9('0x1b')],{'host':_0xa7a9('0x1d'),'port':0x18eb});var socket=require(_0xa7a9('0x1e'))(new Redis(config['redis']));require('./plugin.socket')[_0xa7a9('0x1f')](socket);function respondWithStatusCode(_0x379d78,_0x34c70f){_0x34c70f=_0x34c70f||0xcc;return function(_0x101c02){if(_0x101c02){return _0x379d78[_0xa7a9('0x20')](_0x34c70f);}return _0x379d78[_0xa7a9('0x21')](_0x34c70f)[_0xa7a9('0x22')]();};}function respondWithResult(_0x26910d,_0x3fb09c){_0x3fb09c=_0x3fb09c||0xc8;return function(_0x2e5300){if(_0x2e5300){return _0x26910d[_0xa7a9('0x21')](_0x3fb09c)[_0xa7a9('0x23')](_0x2e5300);}};}function respondWithFilteredResult(_0x56c819,_0x22d90a){return function(_0x3b9d94){if(_0x3b9d94){var _0x4f02e2=typeof _0x22d90a[_0xa7a9('0x24')]===_0xa7a9('0x25')&&typeof _0x22d90a[_0xa7a9('0x26')]===_0xa7a9('0x25');var _0x575c9a=_0x3b9d94['count'];var _0x4cfa7d=_0x4f02e2?0x0:_0x22d90a[_0xa7a9('0x24')];var _0x1e47cf=_0x4f02e2?_0x3b9d94[_0xa7a9('0x27')]:_0x22d90a[_0xa7a9('0x24')]+_0x22d90a[_0xa7a9('0x26')];var _0x3cc4d1;if(_0x1e47cf>=_0x575c9a){_0x1e47cf=_0x575c9a;_0x3cc4d1=0xc8;}else{_0x3cc4d1=0xce;}_0x56c819[_0xa7a9('0x21')](_0x3cc4d1);return _0x56c819[_0xa7a9('0x28')](_0xa7a9('0x29'),_0x4cfa7d+'-'+_0x1e47cf+'/'+_0x575c9a)['json'](_0x3b9d94);}return null;};}function patchUpdates(_0x472e25){return function(_0x33ac7c){try{jsonpatch[_0xa7a9('0x2a')](_0x33ac7c,_0x472e25,!![]);}catch(_0x204c3f){return BPromise[_0xa7a9('0x2b')](_0x204c3f);}return _0x33ac7c[_0xa7a9('0x2c')]();};}function saveUpdates(_0x3c851f,_0x26b88a){return function(_0x1c90b8){if(_0x1c90b8){return _0x1c90b8[_0xa7a9('0x2d')](_0x3c851f)['then'](function(_0x197822){return _0x197822;});}return null;};}function removeEntity(_0x25b425,_0x4c6513){return function(_0x360436){if(_0x360436){return _0x360436[_0xa7a9('0x2e')]()[_0xa7a9('0x2f')](function(){var _0x2027d3=_0x360436[_0xa7a9('0x30')]({'plain':!![]});var _0x286397=_0xa7a9('0x31');return db[_0xa7a9('0x32')][_0xa7a9('0x2e')]({'where':{'type':_0x286397,'resourceId':_0x2027d3['id']}})[_0xa7a9('0x2f')](function(){return _0x360436;});})['then'](function(){_0x25b425[_0xa7a9('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x254743,_0x389ab4){return function(_0x42a766){if(!_0x42a766){_0x254743['sendStatus'](0x194);}return _0x42a766;};}function handleError(_0x39a9d4,_0x431683){_0x431683=_0x431683||0x1f4;return function(_0x2e8fe0){logger[_0xa7a9('0x33')](_0x2e8fe0[_0xa7a9('0x34')]);if(_0x2e8fe0['name']){delete _0x2e8fe0[_0xa7a9('0x35')];}_0x39a9d4[_0xa7a9('0x21')](_0x431683)['send'](_0x2e8fe0);};}exports[_0xa7a9('0x36')]=function(_0x4d48c9,_0x497979){var _0x56cb28={},_0x3643a1={},_0x5f28e9={'count':0x0,'rows':[]};var _0x21c4cf=_[_0xa7a9('0x37')](db['Plugin'][_0xa7a9('0x38')],function(_0x342aed){return{'name':_0x342aed[_0xa7a9('0x39')],'type':_0x342aed[_0xa7a9('0x3a')][_0xa7a9('0x3b')]};});_0x3643a1['model']=_[_0xa7a9('0x37')](_0x21c4cf,_0xa7a9('0x35'));_0x3643a1[_0xa7a9('0x3c')]=_[_0xa7a9('0x3d')](_0x4d48c9['query']);_0x3643a1[_0xa7a9('0x3e')]=_['intersection'](_0x3643a1[_0xa7a9('0x3f')],_0x3643a1[_0xa7a9('0x3c')]);_0x56cb28[_0xa7a9('0x40')]=_['intersection'](_0x3643a1[_0xa7a9('0x3f')],qs[_0xa7a9('0x41')](_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x41')]));_0x56cb28['attributes']=_0x56cb28[_0xa7a9('0x40')][_0xa7a9('0x42')]?_0x56cb28[_0xa7a9('0x40')]:_0x3643a1['model'];if(!_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x43')](_0xa7a9('0x44'))){_0x56cb28[_0xa7a9('0x26')]=qs[_0xa7a9('0x26')](_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x26')]);_0x56cb28[_0xa7a9('0x24')]=qs['offset'](_0x4d48c9[_0xa7a9('0x3c')]['offset']);}_0x56cb28[_0xa7a9('0x45')]=qs[_0xa7a9('0x46')](_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x46')]);_0x56cb28['where']=qs[_0xa7a9('0x3e')](_[_0xa7a9('0x47')](_0x4d48c9[_0xa7a9('0x3c')],_0x3643a1[_0xa7a9('0x3e')]),_0x21c4cf);if(_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x48')]){_0x56cb28[_0xa7a9('0x49')]=_[_0xa7a9('0x4a')](_0x56cb28[_0xa7a9('0x49')],{'$or':_[_0xa7a9('0x37')](_0x21c4cf,function(_0x5860f4){if(_0x5860f4['type']!==_0xa7a9('0x4b')){var _0x5e28e1={};_0x5e28e1[_0x5860f4[_0xa7a9('0x35')]]={'$like':'%'+_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x48')]+'%'};return _0x5e28e1;}})});}_0x56cb28=_['merge']({},_0x56cb28,_0x4d48c9['options']);var _0x24de45={'where':_0x56cb28[_0xa7a9('0x49')]};return db['Plugin']['count'](_0x24de45)['then'](function(_0x4a3fae){_0x5f28e9[_0xa7a9('0x27')]=_0x4a3fae;if(_0x4d48c9[_0xa7a9('0x3c')]['includeAll']){_0x56cb28['include']=[{'all':!![]}];}return db[_0xa7a9('0x4c')][_0xa7a9('0x4d')](_0x56cb28);})[_0xa7a9('0x2f')](function(_0x5e34eb){_0x5f28e9[_0xa7a9('0x4e')]=_0x5e34eb;return _0x5f28e9;})[_0xa7a9('0x2f')](respondWithFilteredResult(_0x497979,_0x56cb28))['catch'](handleError(_0x497979,null));};exports[_0xa7a9('0x4f')]=function(_0x5ae7a2,_0x5ca49c){var _0x9aef71={'raw':!![],'where':{'id':_0x5ae7a2[_0xa7a9('0x50')]['id']}},_0x54bf8f={};_0x54bf8f[_0xa7a9('0x3f')]=_[_0xa7a9('0x3d')](db['Plugin'][_0xa7a9('0x38')]);_0x54bf8f[_0xa7a9('0x3c')]=_[_0xa7a9('0x3d')](_0x5ae7a2['query']);_0x54bf8f['filters']=_['intersection'](_0x54bf8f['model'],_0x54bf8f['query']);_0x9aef71[_0xa7a9('0x40')]=_['intersection'](_0x54bf8f['model'],qs['fields'](_0x5ae7a2[_0xa7a9('0x3c')][_0xa7a9('0x41')]));_0x9aef71[_0xa7a9('0x40')]=_0x9aef71[_0xa7a9('0x40')][_0xa7a9('0x42')]?_0x9aef71['attributes']:_0x54bf8f[_0xa7a9('0x3f')];if(_0x5ae7a2[_0xa7a9('0x3c')][_0xa7a9('0x51')]){_0x9aef71['include']=[{'all':!![]}];}_0x9aef71=_[_0xa7a9('0x4a')]({},_0x9aef71,_0x5ae7a2[_0xa7a9('0x52')]);return db['Plugin'][_0xa7a9('0x53')](_0x9aef71)[_0xa7a9('0x2f')](handleEntityNotFound(_0x5ca49c,null))[_0xa7a9('0x2f')](respondWithResult(_0x5ca49c,null))[_0xa7a9('0x54')](handleError(_0x5ca49c,null));};exports[_0xa7a9('0x55')]=function(_0x2ab3d3,_0x170c80,_0x4684ac){return db[_0xa7a9('0x4c')][_0xa7a9('0x53')]({'where':{'id':_0x2ab3d3[_0xa7a9('0x50')]['id']},'attributes':[_0xa7a9('0x35'),_0xa7a9('0x8')],'raw':!![]})[_0xa7a9('0x2f')](handleEntityNotFound(_0x170c80,null))[_0xa7a9('0x2f')](function(_0x42d77f){if(_0x42d77f){var _0x153a31=path[_0xa7a9('0x56')](config['root'],'server/files/plugins',util[_0xa7a9('0x57')](_0xa7a9('0x58'),path[_0xa7a9('0x59')](_0x42d77f[_0xa7a9('0x8')])));var _0x22b815=fs[_0xa7a9('0x5a')](_0x153a31);var _0x2cbccc=archiver(_0xa7a9('0x5b'),{'zlib':{'level':0x9}});_0x2cbccc['on'](_0xa7a9('0x5c'),function(_0x3dcc99){if(_0x3dcc99[_0xa7a9('0x5d')]===_0xa7a9('0x5e')){logger[_0xa7a9('0x33')](_0x3dcc99);}else{throw new db['Sequelize'][(_0xa7a9('0x5f'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2cbccc['on'](_0xa7a9('0x33'),function(_0x317099){throw new db[(_0xa7a9('0x60'))]['Error'](_0xa7a9('0x61'));});_0x2cbccc[_0xa7a9('0x62')](_0x22b815);_0x2cbccc[_0xa7a9('0x63')](_0xa7a9('0x64'),{'cwd':path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],_0xa7a9('0x66'),path[_0xa7a9('0x67')](_0x42d77f[_0xa7a9('0x8')])),'ignore':[path[_0xa7a9('0x56')](path['basename'](_0x42d77f[_0xa7a9('0x8')]),_0xa7a9('0x68')),path[_0xa7a9('0x56')](path[_0xa7a9('0x59')](_0x42d77f[_0xa7a9('0x8')]),_0xa7a9('0x69'))],'nodir':!![]})[_0xa7a9('0x6a')]();_0x22b815['on'](_0xa7a9('0x6b'),function(){if(!fs[_0xa7a9('0x6c')](_0x153a31)){throw new db[(_0xa7a9('0x60'))][(_0xa7a9('0x5f'))](_0xa7a9('0x6d'));}return _0x170c80[_0xa7a9('0x55')](_0x153a31,util[_0xa7a9('0x57')]('%s.zip',path[_0xa7a9('0x59')](_0x42d77f[_0xa7a9('0x8')])),function(_0x4d15d8){if(_0x4d15d8){throw new db['Sequelize'][(_0xa7a9('0x5f'))](_0xa7a9('0x6e'));}fs['unlinkSync'](_0x153a31);logger[_0xa7a9('0x6f')](_0xa7a9('0x70'));logger[_0xa7a9('0x6f')]('Temporary\x20file\x20removed');});});}return null;})[_0xa7a9('0x54')](handleError(_0x170c80,null));};exports[_0xa7a9('0x71')]=function(_0x57eb9a,_0x2da7eb,_0x150726){var _0x4e6b22=path[_0xa7a9('0x59')](_0x57eb9a[_0xa7a9('0x72')]['filename'],path['extname'](_0x57eb9a[_0xa7a9('0x72')][_0xa7a9('0x73')]));var _0x13ff0b=path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],'server/files/plugins',_0x57eb9a[_0xa7a9('0x72')][_0xa7a9('0x73')]);var _0x38c76d=path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],_0xa7a9('0x66'),_0x4e6b22);logger[_0xa7a9('0x6f')]('Plugin\x20upload\x20filepath:\x20%s',_0x13ff0b);logger[_0xa7a9('0x6f')](_0xa7a9('0x74'),_0x38c76d);try{fs[_0xa7a9('0x75')](_0x13ff0b,parseInt(_0xa7a9('0x76'),0x8));extract(_0x13ff0b,{'dir':_0x38c76d},function(_0x1b046c){if(_0x1b046c){logger[_0xa7a9('0x33')](_0x1b046c);handleError(_0x1b046c,!![]);};var _0x1b57fb=fs['readdirSync'](_0x38c76d);if(_0x1b57fb[_0xa7a9('0x42')]>0x1){removeReferences(_0x13ff0b,_0x38c76d);logger[_0xa7a9('0x33')](_0xa7a9('0x77'));return _0x150726(new Error(_0xa7a9('0x77')));}var _0x1e1d95=fs[_0xa7a9('0x78')](path['join'](_0x38c76d,_0x1b57fb[0x0]));if(_0x1e1d95[_0xa7a9('0x79')]()){removeReferences(_0x13ff0b,_0x38c76d);logger[_0xa7a9('0x33')](_0xa7a9('0x77'));return _0x150726(new Error('Invalid\x20plugin\x20structure'));}if(_0x1e1d95[_0xa7a9('0x7a')]()){var _0x4a08e3=fs[_0xa7a9('0x7b')](path[_0xa7a9('0x56')](_0x38c76d,_0x1b57fb[0x0]));if(_0x4a08e3[_0xa7a9('0x42')]===0x0){removeReferences(_0x13ff0b,_0x38c76d);logger['error'](_0xa7a9('0x77'));return _0x150726(new Error('Invalid\x20plugin\x20structure'));}var _0x499f96=_0x4a08e3['some'](function(_0x263f32){return _0x263f32===_0xa7a9('0x7c');});if(!_0x499f96){return _0x150726(new Error('Plugin\x20manifest\x20missing'));}var _0x4bc145=fs['readFileSync'](path['join'](_0x38c76d,_0x1b57fb[0x0],_0xa7a9('0x7c')));var _0x34eb35=JSON['parse'](_0x4bc145);if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x35')]){return _0x150726(new Error(_0xa7a9('0x7d')));}if(_0xa7a9('0x25')==typeof _0x34eb35['type']){return _0x150726(new Error(_0xa7a9('0x7e')));}if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x7f')]){return _0x150726(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x80')]){return _0x150726(new Error(_0xa7a9('0x81')));}if(_0x34eb35[_0xa7a9('0x3a')]==='html'){if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')]){return _0x150726(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xa7a9('0x25')==typeof _0x34eb35['parameters'][_0xa7a9('0x82')][_0xa7a9('0x83')]&&_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')]){return _0x150726(new Error(_0xa7a9('0x85')));}}else if(_0x34eb35['type']===_0xa7a9('0x86')){if('undefined'==typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x87')]){return _0x150726(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xa7a9('0x25')==typeof _0x34eb35['parameters'][_0xa7a9('0x88')]){return _0x150726(new Error(_0xa7a9('0x89')));}}else{return _0x150726(new Error(_0xa7a9('0x8a')));}var _0x1bea7e=_0x34eb35[_0xa7a9('0x35')];var _0x318e99=_0x34eb35[_0xa7a9('0x8b')];var _0x90532d=_0x34eb35['type'];var _0x38a216=_0x34eb35[_0xa7a9('0x8c')]?_0x34eb35[_0xa7a9('0x8c')]:'always';var _0x42a7ee=_0x34eb35[_0xa7a9('0x8d')]?_0x34eb35[_0xa7a9('0x8d')]:_0xa7a9('0x8e');var _0x34da84='';var _0x1d9555='';var _0x343988='';var _0xb6fcde='';var _0x4f392e=_0x34eb35[_0xa7a9('0x7f')];if(_0x90532d===_0xa7a9('0x8f')){if(_0xa7a9('0x25')!=typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x83')]){var _0x461a3b=_0x34eb35['parameters'][_0xa7a9('0x82')][_0xa7a9('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x461a3b)){_0x34da84=path['join'](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x461a3b);}else{_0x34da84=_0x461a3b;}}else{logger['info'](_0xa7a9('0x92'));}if(_0xa7a9('0x25')!=typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')]){var _0x5ef82d=_0x34eb35[_0xa7a9('0x80')]['views'][_0xa7a9('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x5ef82d)){_0x1d9555=path[_0xa7a9('0x56')](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x5ef82d);}else{_0x1d9555=_0x5ef82d;}}else{logger[_0xa7a9('0x6f')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x90532d===_0xa7a9('0x86')){_0x343988=_0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x87')];_0xb6fcde=_0x34eb35[_0xa7a9('0x80')]['scriptPath'];if(_0xa7a9('0x25')!=typeof _0x34eb35['parameters'][_0xa7a9('0x82')]){if(_0xa7a9('0x25')!=typeof _0x34eb35['parameters'][_0xa7a9('0x82')][_0xa7a9('0x83')]){var _0x461a3b=_0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x461a3b)){_0x34da84=path['join'](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x461a3b);}else{_0x34da84=_0x461a3b;}}if(_0xa7a9('0x25')!=typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')]){var _0x5ef82d=_0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x5ef82d)){_0x1d9555=path[_0xa7a9('0x56')](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x5ef82d);}else{_0x1d9555=_0x5ef82d;}}}}var _0x347ce4={'name':_0x1bea7e,'description':_0x318e99,'path':path[_0xa7a9('0x56')](_0x4e6b22,_0x1b57fb[0x0]),'type':_0x90532d,'sidebar':_0x38a216,'icon':_0x42a7ee,'adminUrl':_0x34da84,'agentUrl':_0x1d9555,'scriptName':_0x343988,'scriptPath':_0xb6fcde,'version':_0x4f392e};removeReferences(_0x13ff0b,null);return db[_0xa7a9('0x4c')][_0xa7a9('0x93')](_0x347ce4)[_0xa7a9('0x2f')](function(_0x428a3f){var _0x515488={'role':_0x57eb9a[_0xa7a9('0x94')][_0xa7a9('0x95')],'userProfileId':_0x57eb9a[_0xa7a9('0x94')][_0xa7a9('0x96')]};if(!_0x515488)throw new Error(_0xa7a9('0x97'));if(_0x515488[_0xa7a9('0x95')]==='user'){var _0x4d4861=_0x428a3f[_0xa7a9('0x30')]({'plain':!![]});return db[_0xa7a9('0x98')][_0xa7a9('0x53')]({'where':{'name':_0xa7a9('0x31'),'userProfileId':_0x515488[_0xa7a9('0x96')]},'raw':!![]})[_0xa7a9('0x2f')](function(_0x33033c){if(_0x33033c&&_0x33033c[_0xa7a9('0x99')]===0x0){return db[_0xa7a9('0x32')][_0xa7a9('0x93')]({'name':_0x4d4861[_0xa7a9('0x35')],'resourceId':_0x4d4861['id'],'type':_0x33033c[_0xa7a9('0x35')],'sectionId':_0x33033c['id']},{})[_0xa7a9('0x2f')](function(){return _0x428a3f;});}else{return _0x428a3f;}})[_0xa7a9('0x54')](function(_0x70a01){logger[_0xa7a9('0x33')](_0xa7a9('0x9a'),_0x70a01);throw _0x70a01;});}return _0x428a3f;})['then'](respondWithResult(_0x2da7eb,null))[_0xa7a9('0x54')](handleError(_0x2da7eb,null));}});}catch(_0x33d17a){_0x2da7eb[_0xa7a9('0x21')](0x1f4)[_0xa7a9('0x9b')](_0x33d17a);}};function removeReferences(_0x1224af,_0x19cce0){try{if(_0x1224af){fs[_0xa7a9('0x9c')](_0x1224af);logger['info'](_0xa7a9('0x9d'));}if(_0x19cce0){rimraf(_0x19cce0,function(){});logger[_0xa7a9('0x6f')](_0xa7a9('0x9e'));}}catch(_0x2a42c9){logger['error'](_0x2a42c9);}}exports['update']=function(_0x15bcb9,_0x5edb8c,_0x3aefc0){return db[_0xa7a9('0x4c')][_0xa7a9('0x53')]({'where':{'id':_0x15bcb9[_0xa7a9('0x50')]['id']}})['then'](handleEntityNotFound(_0x5edb8c,null))[_0xa7a9('0x2f')](saveUpdates(_0x15bcb9[_0xa7a9('0x94')],null))[_0xa7a9('0x2f')](respondWithResult(_0x5edb8c,null))[_0xa7a9('0x54')](handleError(_0x5edb8c,null));};exports['delete']=function(_0x1e88a4,_0x334306,_0x1003c5){return db[_0xa7a9('0x4c')][_0xa7a9('0x53')]({'where':{'id':_0x1e88a4['params']['id']}})[_0xa7a9('0x2f')](function(_0x542ef8){if(_0x542ef8){return _0x542ef8['destroy']();}})[_0xa7a9('0x2f')](function(_0x1e5b4a){rimraf(path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],_0xa7a9('0x66'),path[_0xa7a9('0x67')](_0x1e5b4a[_0xa7a9('0x8')])),function(){});return _0x1e5b4a;})[_0xa7a9('0x2f')](handleEntityNotFound(_0x334306,null))['then'](respondWithStatusCode(_0x334306,null))[_0xa7a9('0x54')](handleError(_0x334306,null));};exports[_0xa7a9('0x9f')]=function(_0x509aea,_0x51fbb6,_0xe01440){return BPromise[_0xa7a9('0xa0')]()[_0xa7a9('0x2f')](function(){if(!_0x509aea[_0xa7a9('0x3c')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x509aea[_0xa7a9('0x3c')]['port']){throw new Error(_0xa7a9('0xa1'));}var _0x26c266=_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0xa2')]?_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0xa2')]+':'+_0x509aea[_0xa7a9('0x3c')]['port']:'http://localhost:'+_0x509aea[_0xa7a9('0x3c')]['port'];var _0x5e15ce=_0x509aea[_0xa7a9('0x3c')]['json']?_0x509aea['query']['json']:!![];var _0x11aefa=_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0xa3')]?_0x509aea[_0xa7a9('0x3c')]['encoding']:null;var _0x53b562={'method':_0x509aea[_0xa7a9('0xa4')],'uri':util[_0xa7a9('0x57')]('%s%s',_0x26c266,_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0x8')]),'json':_0x5e15ce,'resolveWithFullResponse':!![],'encoding':_0x11aefa,'qs':_0x509aea['query']};if(_0x509aea[_0xa7a9('0xa5')]){_0x53b562[_0xa7a9('0xa5')]=_0x509aea['headers'];if(_0x53b562[_0xa7a9('0xa5')][_0xa7a9('0xa6')]){delete _0x53b562[_0xa7a9('0xa5')]['content-length'];}}if(_0x53b562[_0xa7a9('0xa5')]['content-type']){delete _0x53b562['headers'][_0xa7a9('0xa7')];}return rp(_0x53b562);})['then'](function(_0xfce715){if(_0xfce715){_0x51fbb6[_0xa7a9('0x28')](_0xfce715[_0xa7a9('0xa5')]);logger[_0xa7a9('0x6f')](_0xfce715['body']);if(_['endsWith'](_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0x8')],'download')&&_0xfce715[_0xa7a9('0xa8')]==0x1f4){return _0x51fbb6[_0xa7a9('0x20')](_0xfce715['statusCode']);}else{return _0x51fbb6[_0xa7a9('0x21')](_0xfce715['statusCode'])[_0xa7a9('0x9b')](_0xfce715['body']);}}else{return _0x51fbb6['sendStatus'](0xc8);}})[_0xa7a9('0x54')](handleError(_0x51fbb6,null));};exports[_0xa7a9('0xa9')]=function(_0x4b50c1,_0x3d96aa,_0x470d96){return BPromise[_0xa7a9('0xa0')]()['then'](function(){if(!_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0x8')]){throw new Error(_0xa7a9('0xaa'));}if(!_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xab')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x426ca5=_0x4b50c1[_0xa7a9('0x3c')]['hostname']?_0x4b50c1[_0xa7a9('0x3c')]['hostname']+':'+_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xab')]:'http://localhost:'+_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xab')];var _0x5ca2e0=_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0x23')]?_0x4b50c1[_0xa7a9('0x3c')]['json']:!![];var _0x5ee8e4=_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xa3')]?_0x4b50c1['query'][_0xa7a9('0xa3')]:null;var _0x5277be={'method':_0x4b50c1[_0xa7a9('0xa4')],'uri':util[_0xa7a9('0x57')](_0xa7a9('0xac'),_0x426ca5,_0x4b50c1[_0xa7a9('0x3c')]['path']),'json':_0x5ca2e0,'resolveWithFullResponse':!![],'encoding':_0x5ee8e4,'body':_0x4b50c1[_0xa7a9('0x94')]};if(_0x4b50c1[_0xa7a9('0xa5')]){_0x5277be['headers']=_0x4b50c1['headers'];if(_0x5277be[_0xa7a9('0xa5')][_0xa7a9('0xa6')]){delete _0x5277be[_0xa7a9('0xa5')][_0xa7a9('0xa6')];}}if(_0x5277be['headers'][_0xa7a9('0xa7')]){delete _0x5277be[_0xa7a9('0xa5')][_0xa7a9('0xa7')];}return rp(_0x5277be);})[_0xa7a9('0x2f')](function(_0x5ba90e){if(_0x5ba90e){_0x3d96aa[_0xa7a9('0x28')](_0x5ba90e[_0xa7a9('0xa5')]);logger['info'](_0x5ba90e[_0xa7a9('0x94')]);return _0x3d96aa[_0xa7a9('0x21')](_0x5ba90e[_0xa7a9('0xa8')])[_0xa7a9('0x9b')](_0x5ba90e[_0xa7a9('0x94')]);}else{return _0x3d96aa[_0xa7a9('0x20')](0xc8);}})['catch'](handleError(_0x3d96aa,null));}; \ No newline at end of file +var _0x4f6b=['info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','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','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','version','html','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','params','body','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','set','endsWith','statusCode','webhookPost','resolve','content-type','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','Plugin','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','join','root','format','%s.zip','basename','createWriteStream','zip','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download'];(function(_0x35bcff,_0x4a083c){var _0x41281c=function(_0x5debc4){while(--_0x5debc4){_0x35bcff['push'](_0x35bcff['shift']());}};_0x41281c(++_0x4a083c);}(_0x4f6b,0x1a6));var _0xb4f6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4f6b[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0xb4f6('0x0'));var rimraf=require(_0xb4f6('0x1'));var zipdir=require(_0xb4f6('0x2'));var jsonpatch=require(_0xb4f6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb4f6('0x4'));var Mustache=require(_0xb4f6('0x5'));var util=require(_0xb4f6('0x6'));var path=require(_0xb4f6('0x7'));var sox=require('sox');var csv=require(_0xb4f6('0x8'));var ejs=require(_0xb4f6('0x9'));var fs=require('fs');var fs_extra=require(_0xb4f6('0xa'));var _=require(_0xb4f6('0xb'));var squel=require(_0xb4f6('0xc'));var crypto=require(_0xb4f6('0xd'));var jsforce=require(_0xb4f6('0xe'));var deskjs=require(_0xb4f6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb4f6('0x10'));var Papa=require(_0xb4f6('0x11'));var extract=require(_0xb4f6('0x12'));var rimraf=require(_0xb4f6('0x1'));var archiver=require('archiver');var Redis=require(_0xb4f6('0x13'));var authService=require(_0xb4f6('0x14'));var qs=require(_0xb4f6('0x15'));var as=require(_0xb4f6('0x16'));var hardwareService=require(_0xb4f6('0x17'));var logger=require(_0xb4f6('0x18'))('api');var utils=require(_0xb4f6('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb4f6('0x1a'));var db=require(_0xb4f6('0x1b'))['db'];config[_0xb4f6('0x1c')]=_['defaults'](config[_0xb4f6('0x1c')],{'host':_0xb4f6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4f6('0x1c')]));require(_0xb4f6('0x1e'))[_0xb4f6('0x1f')](socket);function respondWithStatusCode(_0xd13286,_0x45cefe){_0x45cefe=_0x45cefe||0xcc;return function(_0x125bc0){if(_0x125bc0){return _0xd13286[_0xb4f6('0x20')](_0x45cefe);}return _0xd13286[_0xb4f6('0x21')](_0x45cefe)['end']();};}function respondWithResult(_0x4202da,_0x1d4e30){_0x1d4e30=_0x1d4e30||0xc8;return function(_0x2fb4a7){if(_0x2fb4a7){return _0x4202da[_0xb4f6('0x21')](_0x1d4e30)[_0xb4f6('0x22')](_0x2fb4a7);}};}function respondWithFilteredResult(_0x421e49,_0x754a63){return function(_0x3cb21a){if(_0x3cb21a){var _0x42ed3d=typeof _0x754a63[_0xb4f6('0x23')]===_0xb4f6('0x24')&&typeof _0x754a63['limit']===_0xb4f6('0x24');var _0x304711=_0x3cb21a[_0xb4f6('0x25')];var _0x373d86=_0x42ed3d?0x0:_0x754a63[_0xb4f6('0x23')];var _0x1b0219=_0x42ed3d?_0x3cb21a[_0xb4f6('0x25')]:_0x754a63['offset']+_0x754a63[_0xb4f6('0x26')];var _0x13e0ae;if(_0x1b0219>=_0x304711){_0x1b0219=_0x304711;_0x13e0ae=0xc8;}else{_0x13e0ae=0xce;}_0x421e49[_0xb4f6('0x21')](_0x13e0ae);return _0x421e49['set'](_0xb4f6('0x27'),_0x373d86+'-'+_0x1b0219+'/'+_0x304711)['json'](_0x3cb21a);}return null;};}function patchUpdates(_0xfa89f6){return function(_0x2e1964){try{jsonpatch[_0xb4f6('0x28')](_0x2e1964,_0xfa89f6,!![]);}catch(_0x368628){return BPromise[_0xb4f6('0x29')](_0x368628);}return _0x2e1964[_0xb4f6('0x2a')]();};}function saveUpdates(_0x421c21,_0x573757){return function(_0x15645d){if(_0x15645d){return _0x15645d[_0xb4f6('0x2b')](_0x421c21)[_0xb4f6('0x2c')](function(_0x19888a){return _0x19888a;});}return null;};}function removeEntity(_0x429687,_0xfc7d01){return function(_0x3f2000){if(_0x3f2000){return _0x3f2000[_0xb4f6('0x2d')]()[_0xb4f6('0x2c')](function(){var _0x18fae4=_0x3f2000[_0xb4f6('0x2e')]({'plain':!![]});var _0x23a2c4='Plugins';return db[_0xb4f6('0x2f')][_0xb4f6('0x2d')]({'where':{'type':_0x23a2c4,'resourceId':_0x18fae4['id']}})[_0xb4f6('0x2c')](function(){return _0x3f2000;});})[_0xb4f6('0x2c')](function(){_0x429687[_0xb4f6('0x21')](0xcc)[_0xb4f6('0x30')]();});}};}function handleEntityNotFound(_0x15f77d,_0x28887e){return function(_0x2c48a6){if(!_0x2c48a6){_0x15f77d[_0xb4f6('0x20')](0x194);}return _0x2c48a6;};}function handleError(_0x4a88eb,_0x1c9ce6){_0x1c9ce6=_0x1c9ce6||0x1f4;return function(_0x11bbc6){logger[_0xb4f6('0x31')](_0x11bbc6[_0xb4f6('0x32')]);if(_0x11bbc6[_0xb4f6('0x33')]){delete _0x11bbc6[_0xb4f6('0x33')];}_0x4a88eb[_0xb4f6('0x21')](_0x1c9ce6)[_0xb4f6('0x34')](_0x11bbc6);};}exports['index']=function(_0x560557,_0x1bef33){var _0x44a9ab={},_0x1cb5af={},_0x135332={'count':0x0,'rows':[]};var _0x130c4e=_[_0xb4f6('0x35')](db[_0xb4f6('0x36')][_0xb4f6('0x37')],function(_0xedb997){return{'name':_0xedb997['fieldName'],'type':_0xedb997[_0xb4f6('0x38')][_0xb4f6('0x39')]};});_0x1cb5af['model']=_[_0xb4f6('0x35')](_0x130c4e,_0xb4f6('0x33'));_0x1cb5af[_0xb4f6('0x3a')]=_[_0xb4f6('0x3b')](_0x560557[_0xb4f6('0x3a')]);_0x1cb5af[_0xb4f6('0x3c')]=_[_0xb4f6('0x3d')](_0x1cb5af['model'],_0x1cb5af[_0xb4f6('0x3a')]);_0x44a9ab['attributes']=_['intersection'](_0x1cb5af[_0xb4f6('0x3e')],qs[_0xb4f6('0x3f')](_0x560557[_0xb4f6('0x3a')][_0xb4f6('0x3f')]));_0x44a9ab[_0xb4f6('0x40')]=_0x44a9ab['attributes'][_0xb4f6('0x41')]?_0x44a9ab[_0xb4f6('0x40')]:_0x1cb5af[_0xb4f6('0x3e')];if(!_0x560557[_0xb4f6('0x3a')][_0xb4f6('0x42')](_0xb4f6('0x43'))){_0x44a9ab['limit']=qs[_0xb4f6('0x26')](_0x560557[_0xb4f6('0x3a')][_0xb4f6('0x26')]);_0x44a9ab[_0xb4f6('0x23')]=qs[_0xb4f6('0x23')](_0x560557[_0xb4f6('0x3a')][_0xb4f6('0x23')]);}_0x44a9ab['order']=qs[_0xb4f6('0x44')](_0x560557['query'][_0xb4f6('0x44')]);_0x44a9ab[_0xb4f6('0x45')]=qs['filters'](_['pick'](_0x560557[_0xb4f6('0x3a')],_0x1cb5af[_0xb4f6('0x3c')]),_0x130c4e);if(_0x560557[_0xb4f6('0x3a')]['filter']){_0x44a9ab[_0xb4f6('0x45')]=_['merge'](_0x44a9ab['where'],{'$or':_[_0xb4f6('0x35')](_0x130c4e,function(_0x145d2e){if(_0x145d2e[_0xb4f6('0x38')]!==_0xb4f6('0x46')){var _0xa9bdad={};_0xa9bdad[_0x145d2e['name']]={'$like':'%'+_0x560557[_0xb4f6('0x3a')][_0xb4f6('0x47')]+'%'};return _0xa9bdad;}})});}_0x44a9ab=_['merge']({},_0x44a9ab,_0x560557[_0xb4f6('0x48')]);var _0x1c0ad2={'where':_0x44a9ab['where']};return db[_0xb4f6('0x36')][_0xb4f6('0x25')](_0x1c0ad2)['then'](function(_0x3960b1){_0x135332[_0xb4f6('0x25')]=_0x3960b1;if(_0x560557[_0xb4f6('0x3a')][_0xb4f6('0x49')]){_0x44a9ab[_0xb4f6('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0xb4f6('0x4b')](_0x44a9ab);})[_0xb4f6('0x2c')](function(_0x24c090){_0x135332[_0xb4f6('0x4c')]=_0x24c090;return _0x135332;})[_0xb4f6('0x2c')](respondWithFilteredResult(_0x1bef33,_0x44a9ab))[_0xb4f6('0x4d')](handleError(_0x1bef33,null));};exports[_0xb4f6('0x4e')]=function(_0x2e0947,_0x3a2977){var _0x1f6bf7={'raw':!![],'where':{'id':_0x2e0947['params']['id']}},_0x3041e8={};_0x3041e8[_0xb4f6('0x3e')]=_[_0xb4f6('0x3b')](db[_0xb4f6('0x36')][_0xb4f6('0x37')]);_0x3041e8['query']=_[_0xb4f6('0x3b')](_0x2e0947[_0xb4f6('0x3a')]);_0x3041e8['filters']=_[_0xb4f6('0x3d')](_0x3041e8[_0xb4f6('0x3e')],_0x3041e8[_0xb4f6('0x3a')]);_0x1f6bf7[_0xb4f6('0x40')]=_[_0xb4f6('0x3d')](_0x3041e8[_0xb4f6('0x3e')],qs[_0xb4f6('0x3f')](_0x2e0947[_0xb4f6('0x3a')][_0xb4f6('0x3f')]));_0x1f6bf7[_0xb4f6('0x40')]=_0x1f6bf7['attributes'][_0xb4f6('0x41')]?_0x1f6bf7[_0xb4f6('0x40')]:_0x3041e8[_0xb4f6('0x3e')];if(_0x2e0947['query'][_0xb4f6('0x49')]){_0x1f6bf7[_0xb4f6('0x4a')]=[{'all':!![]}];}_0x1f6bf7=_['merge']({},_0x1f6bf7,_0x2e0947[_0xb4f6('0x48')]);return db[_0xb4f6('0x36')][_0xb4f6('0x4f')](_0x1f6bf7)[_0xb4f6('0x2c')](handleEntityNotFound(_0x3a2977,null))[_0xb4f6('0x2c')](respondWithResult(_0x3a2977,null))[_0xb4f6('0x4d')](handleError(_0x3a2977,null));};exports['download']=function(_0x2ced8a,_0x5a0c14,_0xfcc33f){return db['Plugin'][_0xb4f6('0x4f')]({'where':{'id':_0x2ced8a['params']['id']},'attributes':[_0xb4f6('0x33'),_0xb4f6('0x7')],'raw':!![]})[_0xb4f6('0x2c')](handleEntityNotFound(_0x5a0c14,null))[_0xb4f6('0x2c')](function(_0x32262c){if(_0x32262c){var _0x5109e7=path[_0xb4f6('0x50')](config[_0xb4f6('0x51')],'server/files/plugins',util[_0xb4f6('0x52')](_0xb4f6('0x53'),path[_0xb4f6('0x54')](_0x32262c[_0xb4f6('0x7')])));var _0x556648=fs[_0xb4f6('0x55')](_0x5109e7);var _0x3015c3=archiver(_0xb4f6('0x56'),{'zlib':{'level':0x9}});_0x3015c3['on'](_0xb4f6('0x57'),function(_0x29f40c){if(_0x29f40c['code']==='ENOENT'){logger[_0xb4f6('0x31')](_0x29f40c);}else{throw new db[(_0xb4f6('0x58'))][(_0xb4f6('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3015c3['on']('error',function(_0x41bd1c){throw new db[(_0xb4f6('0x58'))]['Error'](_0xb4f6('0x5a'));});_0x3015c3[_0xb4f6('0x5b')](_0x556648);_0x3015c3[_0xb4f6('0x5c')](_0xb4f6('0x5d'),{'cwd':path[_0xb4f6('0x50')](config['root'],_0xb4f6('0x5e'),path[_0xb4f6('0x5f')](_0x32262c[_0xb4f6('0x7')])),'ignore':[path[_0xb4f6('0x50')](path[_0xb4f6('0x54')](_0x32262c[_0xb4f6('0x7')]),_0xb4f6('0x60')),path[_0xb4f6('0x50')](path[_0xb4f6('0x54')](_0x32262c[_0xb4f6('0x7')]),_0xb4f6('0x61'))],'nodir':!![]})[_0xb4f6('0x62')]();_0x556648['on'](_0xb4f6('0x63'),function(){if(!fs[_0xb4f6('0x64')](_0x5109e7)){throw new db['Sequelize'][(_0xb4f6('0x59'))](_0xb4f6('0x65'));}return _0x5a0c14[_0xb4f6('0x66')](_0x5109e7,util['format'](_0xb4f6('0x53'),path[_0xb4f6('0x54')](_0x32262c[_0xb4f6('0x7')])),function(_0x55fcb5){if(_0x55fcb5){throw new db[(_0xb4f6('0x58'))][(_0xb4f6('0x59'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x5109e7);logger[_0xb4f6('0x67')](_0xb4f6('0x68'));logger[_0xb4f6('0x67')](_0xb4f6('0x69'));});});}return null;})['catch'](handleError(_0x5a0c14,null));};exports[_0xb4f6('0x6a')]=function(_0xad5d5d,_0x3305da,_0x4c92fe){var _0x4be3e5=path[_0xb4f6('0x54')](_0xad5d5d[_0xb4f6('0x6b')][_0xb4f6('0x6c')],path['extname'](_0xad5d5d['file'][_0xb4f6('0x6c')]));var _0x573b04=path[_0xb4f6('0x50')](config[_0xb4f6('0x51')],'server/files/plugins',_0xad5d5d['file'][_0xb4f6('0x6c')]);var _0x43892c=path[_0xb4f6('0x50')](config[_0xb4f6('0x51')],_0xb4f6('0x5e'),_0x4be3e5);logger[_0xb4f6('0x67')](_0xb4f6('0x6d'),_0x573b04);logger[_0xb4f6('0x67')](_0xb4f6('0x6e'),_0x43892c);try{fs[_0xb4f6('0x6f')](_0x573b04,parseInt('0777',0x8));extract(_0x573b04,{'dir':_0x43892c},function(_0x184b80){if(_0x184b80){logger[_0xb4f6('0x31')](_0x184b80);handleError(_0x184b80,!![]);};var _0x3aacb8=fs[_0xb4f6('0x70')](_0x43892c);if(_0x3aacb8[_0xb4f6('0x41')]>0x1){removeReferences(_0x573b04,_0x43892c);logger[_0xb4f6('0x31')](_0xb4f6('0x71'));return _0x4c92fe(new Error(_0xb4f6('0x71')));}var _0x5e8156=fs[_0xb4f6('0x72')](path[_0xb4f6('0x50')](_0x43892c,_0x3aacb8[0x0]));if(_0x5e8156[_0xb4f6('0x73')]()){removeReferences(_0x573b04,_0x43892c);logger['error'](_0xb4f6('0x71'));return _0x4c92fe(new Error(_0xb4f6('0x71')));}if(_0x5e8156[_0xb4f6('0x74')]()){var _0x474818=fs['readdirSync'](path[_0xb4f6('0x50')](_0x43892c,_0x3aacb8[0x0]));if(_0x474818['length']===0x0){removeReferences(_0x573b04,_0x43892c);logger[_0xb4f6('0x31')](_0xb4f6('0x71'));return _0x4c92fe(new Error('Invalid\x20plugin\x20structure'));}var _0x5264a4=_0x474818['some'](function(_0x2b21fe){return _0x2b21fe===_0xb4f6('0x75');});if(!_0x5264a4){return _0x4c92fe(new Error(_0xb4f6('0x76')));}var _0x346cbf=fs[_0xb4f6('0x77')](path[_0xb4f6('0x50')](_0x43892c,_0x3aacb8[0x0],'manifest.json'));var _0x46348d=JSON[_0xb4f6('0x78')](_0x346cbf);if(_0xb4f6('0x24')==typeof _0x46348d[_0xb4f6('0x33')]){return _0x4c92fe(new Error(_0xb4f6('0x79')));}if('undefined'==typeof _0x46348d[_0xb4f6('0x38')]){return _0x4c92fe(new Error(_0xb4f6('0x7a')));}if(_0xb4f6('0x24')==typeof _0x46348d['version']){return _0x4c92fe(new Error(_0xb4f6('0x7b')));}if(_0xb4f6('0x24')==typeof _0x46348d[_0xb4f6('0x7c')]){return _0x4c92fe(new Error(_0xb4f6('0x7d')));}if(_0x46348d['type']==='html'){if(_0xb4f6('0x24')==typeof _0x46348d['parameters']['views']){return _0x4c92fe(new Error(_0xb4f6('0x7e')));}if(_0xb4f6('0x24')==typeof _0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x7f')]['admin']&&_0xb4f6('0x24')==typeof _0x46348d[_0xb4f6('0x7c')]['views'][_0xb4f6('0x80')]){return _0x4c92fe(new Error(_0xb4f6('0x81')));}}else if(_0x46348d['type']===_0xb4f6('0x82')){if(_0xb4f6('0x24')==typeof _0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x83')]){return _0x4c92fe(new Error(_0xb4f6('0x84')));}if(_0xb4f6('0x24')==typeof _0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x85')]){return _0x4c92fe(new Error(_0xb4f6('0x86')));}}else{return _0x4c92fe(new Error(_0xb4f6('0x87')));}var _0x3a3059=_0x46348d[_0xb4f6('0x33')];var _0x582c93=_0x46348d[_0xb4f6('0x88')];var _0x519107=_0x46348d['type'];var _0x1f0229=_0x46348d[_0xb4f6('0x89')]?_0x46348d['sidebar']:'always';var _0x3fcdb9=_0x46348d[_0xb4f6('0x8a')]?_0x46348d[_0xb4f6('0x8a')]:'icon-apps';var _0x4b57c5='';var _0x32790e='';var _0x508268='';var _0x25fb2b='';var _0x46c1b8=_0x46348d[_0xb4f6('0x8b')];if(_0x519107===_0xb4f6('0x8c')){if(_0xb4f6('0x24')!=typeof _0x46348d[_0xb4f6('0x7c')]['views'][_0xb4f6('0x8d')]){var _0xe8d856=_0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x7f')][_0xb4f6('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xb4f6('0x8e')](_0xe8d856)){_0x4b57c5=path[_0xb4f6('0x50')](_0xb4f6('0x8f'),_0x4be3e5,_0x3aacb8[0x0],_0xe8d856);}else{_0x4b57c5=_0xe8d856;}}else{logger[_0xb4f6('0x67')](_0xb4f6('0x90'));}if('undefined'!=typeof _0x46348d['parameters'][_0xb4f6('0x7f')]['agent']){var _0x3cef9c=_0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x7f')][_0xb4f6('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xb4f6('0x8e')](_0x3cef9c)){_0x32790e=path[_0xb4f6('0x50')]('plugins',_0x4be3e5,_0x3aacb8[0x0],_0x3cef9c);}else{_0x32790e=_0x3cef9c;}}else{logger[_0xb4f6('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x519107===_0xb4f6('0x82')){_0x508268=_0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x83')];_0x25fb2b=_0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x85')];if(_0xb4f6('0x24')!=typeof _0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x7f')]){if(_0xb4f6('0x24')!=typeof _0x46348d['parameters'][_0xb4f6('0x7f')][_0xb4f6('0x8d')]){var _0xe8d856=_0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x7f')][_0xb4f6('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xb4f6('0x8e')](_0xe8d856)){_0x4b57c5=path['join'](_0xb4f6('0x8f'),_0x4be3e5,_0x3aacb8[0x0],_0xe8d856);}else{_0x4b57c5=_0xe8d856;}}if('undefined'!=typeof _0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x7f')][_0xb4f6('0x80')]){var _0x3cef9c=_0x46348d[_0xb4f6('0x7c')][_0xb4f6('0x7f')][_0xb4f6('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3cef9c)){_0x32790e=path['join']('plugins',_0x4be3e5,_0x3aacb8[0x0],_0x3cef9c);}else{_0x32790e=_0x3cef9c;}}}}var _0x16ffcd={'name':_0x3a3059,'description':_0x582c93,'path':path[_0xb4f6('0x50')](_0x4be3e5,_0x3aacb8[0x0]),'type':_0x519107,'sidebar':_0x1f0229,'icon':_0x3fcdb9,'adminUrl':_0x4b57c5,'agentUrl':_0x32790e,'scriptName':_0x508268,'scriptPath':_0x25fb2b,'version':_0x46c1b8};removeReferences(_0x573b04,null);return db[_0xb4f6('0x36')][_0xb4f6('0x91')](_0x16ffcd)[_0xb4f6('0x2c')](function(_0x3139a6){var _0x12d507={'role':_0xad5d5d['body'][_0xb4f6('0x92')],'userProfileId':_0xad5d5d['body'][_0xb4f6('0x93')]};if(!_0x12d507)throw new Error(_0xb4f6('0x94'));if(_0x12d507['role']===_0xb4f6('0x95')){var _0x260cb4=_0x3139a6[_0xb4f6('0x2e')]({'plain':!![]});return db[_0xb4f6('0x96')][_0xb4f6('0x4f')]({'where':{'name':_0xb4f6('0x97'),'userProfileId':_0x12d507['userProfileId']},'raw':!![]})['then'](function(_0x36d27e){if(_0x36d27e&&_0x36d27e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x260cb4['name'],'resourceId':_0x260cb4['id'],'type':_0x36d27e[_0xb4f6('0x33')],'sectionId':_0x36d27e['id']},{})[_0xb4f6('0x2c')](function(){return _0x3139a6;});}else{return _0x3139a6;}})[_0xb4f6('0x4d')](function(_0x461d71){logger[_0xb4f6('0x31')](_0xb4f6('0x98'),_0x461d71);throw _0x461d71;});}return _0x3139a6;})[_0xb4f6('0x2c')](respondWithResult(_0x3305da,null))[_0xb4f6('0x4d')](handleError(_0x3305da,null));}});}catch(_0x293bb8){_0x3305da[_0xb4f6('0x21')](0x1f4)[_0xb4f6('0x34')](_0x293bb8);}};function removeReferences(_0x1724a8,_0xa6daae){try{if(_0x1724a8){fs['unlinkSync'](_0x1724a8);logger['info'](_0xb4f6('0x99'));}if(_0xa6daae){rimraf(_0xa6daae,function(){});logger[_0xb4f6('0x67')](_0xb4f6('0x9a'));}}catch(_0x52492f){logger[_0xb4f6('0x31')](_0x52492f);}}exports['update']=function(_0x250dce,_0xdd08db,_0x68bebd){return db['Plugin'][_0xb4f6('0x4f')]({'where':{'id':_0x250dce[_0xb4f6('0x9b')]['id']}})[_0xb4f6('0x2c')](handleEntityNotFound(_0xdd08db,null))[_0xb4f6('0x2c')](saveUpdates(_0x250dce[_0xb4f6('0x9c')],null))['then'](respondWithResult(_0xdd08db,null))[_0xb4f6('0x4d')](handleError(_0xdd08db,null));};exports[_0xb4f6('0x9d')]=function(_0x540386,_0x2f69bc,_0x4fe935){return db[_0xb4f6('0x36')][_0xb4f6('0x4f')]({'where':{'id':_0x540386[_0xb4f6('0x9b')]['id']}})[_0xb4f6('0x2c')](function(_0x487738){if(_0x487738){return _0x487738['destroy']();}})['then'](function(_0x399a04){rimraf(path[_0xb4f6('0x50')](config[_0xb4f6('0x51')],_0xb4f6('0x5e'),path[_0xb4f6('0x5f')](_0x399a04[_0xb4f6('0x7')])),function(){});return _0x399a04;})[_0xb4f6('0x2c')](handleEntityNotFound(_0x2f69bc,null))['then'](respondWithStatusCode(_0x2f69bc,null))['catch'](handleError(_0x2f69bc,null));};exports[_0xb4f6('0x9e')]=function(_0x537285,_0x221d45,_0x4bf6bd){return BPromise['resolve']()['then'](function(){if(!_0x537285['query'][_0xb4f6('0x7')]){throw new Error(_0xb4f6('0x9f'));}if(!_0x537285[_0xb4f6('0x3a')][_0xb4f6('0xa0')]){throw new Error(_0xb4f6('0xa1'));}var _0x2d6b3a=_0x537285[_0xb4f6('0x3a')][_0xb4f6('0xa2')]?_0x537285['query']['hostname']+':'+_0x537285['query'][_0xb4f6('0xa0')]:_0xb4f6('0xa3')+_0x537285[_0xb4f6('0x3a')][_0xb4f6('0xa0')];var _0x3f580f=_0x537285['query']['json']?_0x537285[_0xb4f6('0x3a')][_0xb4f6('0x22')]:!![];var _0x38fb3b=_0x537285[_0xb4f6('0x3a')][_0xb4f6('0xa4')]?_0x537285[_0xb4f6('0x3a')]['encoding']:null;var _0x5f5dd9={'method':_0x537285[_0xb4f6('0xa5')],'uri':util[_0xb4f6('0x52')](_0xb4f6('0xa6'),_0x2d6b3a,_0x537285[_0xb4f6('0x3a')][_0xb4f6('0x7')]),'json':_0x3f580f,'resolveWithFullResponse':!![],'encoding':_0x38fb3b,'qs':_0x537285['query']};if(_0x537285[_0xb4f6('0xa7')]){_0x5f5dd9[_0xb4f6('0xa7')]=_0x537285['headers'];if(_0x5f5dd9[_0xb4f6('0xa7')]['content-length']){delete _0x5f5dd9[_0xb4f6('0xa7')][_0xb4f6('0xa8')];}}if(_0x5f5dd9[_0xb4f6('0xa7')]['content-type']){delete _0x5f5dd9['headers']['content-type'];}return rp(_0x5f5dd9);})['then'](function(_0x555e30){if(_0x555e30){_0x221d45[_0xb4f6('0xa9')](_0x555e30[_0xb4f6('0xa7')]);logger['info'](_0x555e30[_0xb4f6('0x9c')]);if(_[_0xb4f6('0xaa')](_0x537285[_0xb4f6('0x3a')][_0xb4f6('0x7')],_0xb4f6('0x66'))&&_0x555e30[_0xb4f6('0xab')]==0x1f4){return _0x221d45['sendStatus'](_0x555e30[_0xb4f6('0xab')]);}else{return _0x221d45[_0xb4f6('0x21')](_0x555e30[_0xb4f6('0xab')])[_0xb4f6('0x34')](_0x555e30[_0xb4f6('0x9c')]);}}else{return _0x221d45[_0xb4f6('0x20')](0xc8);}})[_0xb4f6('0x4d')](handleError(_0x221d45,null));};exports[_0xb4f6('0xac')]=function(_0x216cef,_0x22e367,_0x4b8e3d){return BPromise[_0xb4f6('0xad')]()[_0xb4f6('0x2c')](function(){if(!_0x216cef[_0xb4f6('0x3a')][_0xb4f6('0x7')]){throw new Error(_0xb4f6('0x9f'));}if(!_0x216cef['query'][_0xb4f6('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x33e4fe=_0x216cef[_0xb4f6('0x3a')][_0xb4f6('0xa2')]?_0x216cef['query'][_0xb4f6('0xa2')]+':'+_0x216cef[_0xb4f6('0x3a')]['port']:_0xb4f6('0xa3')+_0x216cef[_0xb4f6('0x3a')][_0xb4f6('0xa0')];var _0x378834=_0x216cef['query'][_0xb4f6('0x22')]?_0x216cef[_0xb4f6('0x3a')]['json']:!![];var _0x4c53ad=_0x216cef[_0xb4f6('0x3a')][_0xb4f6('0xa4')]?_0x216cef[_0xb4f6('0x3a')][_0xb4f6('0xa4')]:null;var _0x3f85cf={'method':_0x216cef[_0xb4f6('0xa5')],'uri':util['format'](_0xb4f6('0xa6'),_0x33e4fe,_0x216cef['query'][_0xb4f6('0x7')]),'json':_0x378834,'resolveWithFullResponse':!![],'encoding':_0x4c53ad,'body':_0x216cef[_0xb4f6('0x9c')]};if(_0x216cef['headers']){_0x3f85cf[_0xb4f6('0xa7')]=_0x216cef[_0xb4f6('0xa7')];if(_0x3f85cf[_0xb4f6('0xa7')][_0xb4f6('0xa8')]){delete _0x3f85cf[_0xb4f6('0xa7')][_0xb4f6('0xa8')];}}if(_0x3f85cf[_0xb4f6('0xa7')][_0xb4f6('0xae')]){delete _0x3f85cf[_0xb4f6('0xa7')]['content-type'];}return rp(_0x3f85cf);})['then'](function(_0x496edf){if(_0x496edf){_0x22e367[_0xb4f6('0xa9')](_0x496edf[_0xb4f6('0xa7')]);logger[_0xb4f6('0x67')](_0x496edf['body']);return _0x22e367[_0xb4f6('0x21')](_0x496edf[_0xb4f6('0xab')])[_0xb4f6('0x34')](_0x496edf['body']);}else{return _0x22e367[_0xb4f6('0x20')](0xc8);}})[_0xb4f6('0x4d')](handleError(_0x22e367,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c1a4adc..42390f6 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 _0x0adf=['Plugin','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x3b1f58,_0x2aafa9){var _0x43a091=function(_0xb9c5ff){while(--_0xb9c5ff){_0x3b1f58['push'](_0x3b1f58['shift']());}};_0x43a091(++_0x2aafa9);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x290a8d,_0x3a654e){_0x290a8d=_0x290a8d-0x0;var _0x3c0df2=_0x0adf[_0x290a8d];return _0x3c0df2;};'use strict';var EventEmitter=require(_0xf0ad('0x0'));var Plugin=require(_0xf0ad('0x1'))['db'][_0xf0ad('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0ad('0x3'),'afterUpdate':_0xf0ad('0x4'),'afterDestroy':_0xf0ad('0x5')};function emitEvent(_0x187aa4){return function(_0x27d666,_0x459e70,_0x719547){PluginEvents['emit'](_0x187aa4+':'+_0x27d666['id'],_0x27d666);PluginEvents[_0xf0ad('0x6')](_0x187aa4,_0x27d666);_0x719547(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xf0ad('0x7')](e,emitEvent(event));}}module[_0xf0ad('0x8')]=PluginEvents; \ No newline at end of file +var _0xf446=['setMaxListeners','update','hook','events','Plugin'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf446,0x1c0));var _0x6f44=function(_0x64d881,_0x1e95b0){_0x64d881=_0x64d881-0x0;var _0x53eb8f=_0xf446[_0x64d881];return _0x53eb8f;};'use strict';var EventEmitter=require(_0x6f44('0x0'));var Plugin=require('../../mysqldb')['db'][_0x6f44('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x6f44('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f44('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13b43d){return function(_0x477db7,_0x5b59aa,_0x41bcac){PluginEvents['emit'](_0x13b43d+':'+_0x477db7['id'],_0x477db7);PluginEvents['emit'](_0x13b43d,_0x477db7);_0x41bcac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x6f44('0x4')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 356246d..4a50c10 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 _0x6bbb=['./plugin.attributes','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x294c08,_0x2f22e6){var _0x3560e4=function(_0x224833){while(--_0x224833){_0x294c08['push'](_0x294c08['shift']());}};_0x3560e4(++_0x2f22e6);}(_0x6bbb,0x18f));var _0xb6bb=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x6bbb[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0xb6bb('0x0'));var util=require(_0xb6bb('0x1'));var logger=require(_0xb6bb('0x2'))(_0xb6bb('0x3'));var moment=require(_0xb6bb('0x4'));var BPromise=require(_0xb6bb('0x5'));var rp=require(_0xb6bb('0x6'));var fs=require('fs');var path=require(_0xb6bb('0x7'));var rimraf=require('rimraf');var config=require(_0xb6bb('0x8'));var attributes=require(_0xb6bb('0x9'));module['exports']=function(_0x364f08,_0x3d51f6){return _0x364f08['define'](_0xb6bb('0xa'),attributes,{'tableName':_0xb6bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6467=['moment','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger','api'];(function(_0x32b82a,_0x45d55b){var _0x349bd8=function(_0xa74f8a){while(--_0xa74f8a){_0x32b82a['push'](_0x32b82a['shift']());}};_0x349bd8(++_0x45d55b);}(_0x6467,0x110));var _0x7646=function(_0x1e8618,_0x9b3e6a){_0x1e8618=_0x1e8618-0x0;var _0x32894f=_0x6467[_0x1e8618];return _0x32894f;};'use strict';var _=require(_0x7646('0x0'));var util=require(_0x7646('0x1'));var logger=require(_0x7646('0x2'))(_0x7646('0x3'));var moment=require(_0x7646('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7646('0x5'));var rimraf=require(_0x7646('0x6'));var config=require(_0x7646('0x7'));var attributes=require(_0x7646('0x8'));module[_0x7646('0x9')]=function(_0x2bfbc5,_0x35f7d8){return _0x2bfbc5[_0x7646('0xa')](_0x7646('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index f965cf9..be71227 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 _0x6412=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','Plugin','create','body','options','CreatePlugin','lodash','util'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x6412,0xad));var _0x2641=function(_0x2577e4,_0xfbab11){_0x2577e4=_0x2577e4-0x0;var _0x286db9=_0x6412[_0x2577e4];return _0x286db9;};'use strict';var _=require(_0x2641('0x0'));var util=require(_0x2641('0x1'));var moment=require(_0x2641('0x2'));var BPromise=require(_0x2641('0x3'));var rs=require(_0x2641('0x4'));var fs=require('fs');var Redis=require(_0x2641('0x5'));var db=require(_0x2641('0x6'))['db'];var utils=require(_0x2641('0x7'));var logger=require('../../config/logger')(_0x2641('0x8'));var config=require(_0x2641('0x9'));var jayson=require(_0x2641('0xa'));var client=jayson[_0x2641('0xb')][_0x2641('0xc')]({'port':0x232a});config[_0x2641('0xd')]=_[_0x2641('0xe')](config[_0x2641('0xd')],{'host':_0x2641('0xf'),'port':0x18eb});var socket=require(_0x2641('0x10'))(new Redis(config[_0x2641('0xd')]));require(_0x2641('0x11'))[_0x2641('0x12')](socket);function respondWithRpcPromise(_0x82f8ca,_0x5e1740,_0x3ac646){return new BPromise(function(_0x8b499a,_0x27b1d4){return client[_0x2641('0x13')](_0x82f8ca,_0x3ac646)[_0x2641('0x14')](function(_0x41c267){logger[_0x2641('0x15')](_0x2641('0x16'),_0x5e1740,_0x2641('0x17'));logger[_0x2641('0x18')]('Plugin,\x20%s,\x20%s,\x20%s',_0x5e1740,_0x2641('0x17'),JSON[_0x2641('0x19')](_0x41c267));if(_0x41c267['error']){if(_0x41c267[_0x2641('0x1a')][_0x2641('0x1b')]===0x1f4){logger[_0x2641('0x1a')](_0x2641('0x16'),_0x5e1740,_0x41c267['error'][_0x2641('0x1c')]);return _0x27b1d4(_0x41c267['error'][_0x2641('0x1c')]);}logger['error'](_0x2641('0x16'),_0x5e1740,_0x41c267[_0x2641('0x1a')][_0x2641('0x1c')]);return _0x8b499a(_0x41c267[_0x2641('0x1a')][_0x2641('0x1c')]);}else{logger[_0x2641('0x15')](_0x2641('0x16'),_0x5e1740,_0x2641('0x17'));_0x8b499a(_0x41c267['result'][_0x2641('0x1c')]);}})[_0x2641('0x1d')](function(_0x4c72ee){logger[_0x2641('0x1a')]('Plugin,\x20%s,\x20%s',_0x5e1740,_0x4c72ee);_0x27b1d4(_0x4c72ee);});});}exports['CreatePlugin']=function(_0x50a7e6){var _0x17a02b=this;return new Promise(function(_0x2be4a8,_0x5731d0){return db[_0x2641('0x1e')][_0x2641('0x1f')](_0x50a7e6[_0x2641('0x20')],{'raw':_0x50a7e6[_0x2641('0x21')]?_0x50a7e6[_0x2641('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x2641('0x14')](function(_0x277bd7){logger[_0x2641('0x15')](_0x2641('0x22'),_0x50a7e6);logger[_0x2641('0x18')](_0x2641('0x22'),_0x50a7e6,JSON[_0x2641('0x19')](_0x277bd7));_0x2be4a8(_0x277bd7);})['catch'](function(_0x2c3b8a){logger[_0x2641('0x1a')](_0x2641('0x22'),_0x2c3b8a[_0x2641('0x1c')],_0x50a7e6);_0x5731d0(_0x17a02b['error'](0x1f4,_0x2c3b8a[_0x2641('0x1c')]));});});}; \ No newline at end of file +var _0x1a9e=['defaults','redis','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','CreatePlugin','create','body','options','raw','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3a8b5a,_0x3b9b8f){var _0x5c7096=function(_0x62b101){while(--_0x62b101){_0x3a8b5a['push'](_0x3a8b5a['shift']());}};_0x5c7096(++_0x3b9b8f);}(_0x1a9e,0x188));var _0xe1a9=function(_0x41a68f,_0x33276f){_0x41a68f=_0x41a68f-0x0;var _0x3b2f56=_0x1a9e[_0x41a68f];return _0x3b2f56;};'use strict';var _=require(_0xe1a9('0x0'));var util=require(_0xe1a9('0x1'));var moment=require('moment');var BPromise=require(_0xe1a9('0x2'));var rs=require(_0xe1a9('0x3'));var fs=require('fs');var Redis=require(_0xe1a9('0x4'));var db=require(_0xe1a9('0x5'))['db'];var utils=require(_0xe1a9('0x6'));var logger=require(_0xe1a9('0x7'))(_0xe1a9('0x8'));var config=require('../../config/environment');var jayson=require(_0xe1a9('0x9'));var client=jayson[_0xe1a9('0xa')]['http']({'port':0x232a});config['redis']=_[_0xe1a9('0xb')](config[_0xe1a9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1a9('0xd'))(new Redis(config[_0xe1a9('0xc')]));require(_0xe1a9('0xe'))[_0xe1a9('0xf')](socket);function respondWithRpcPromise(_0x20565c,_0x5abb84,_0x1d95c6){return new BPromise(function(_0x566560,_0x2cc896){return client['request'](_0x20565c,_0x1d95c6)[_0xe1a9('0x10')](function(_0x177909){logger[_0xe1a9('0x11')](_0xe1a9('0x12'),_0x5abb84,_0xe1a9('0x13'));logger[_0xe1a9('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x5abb84,_0xe1a9('0x13'),JSON['stringify'](_0x177909));if(_0x177909['error']){if(_0x177909[_0xe1a9('0x15')][_0xe1a9('0x16')]===0x1f4){logger['error'](_0xe1a9('0x12'),_0x5abb84,_0x177909[_0xe1a9('0x15')][_0xe1a9('0x17')]);return _0x2cc896(_0x177909[_0xe1a9('0x15')]['message']);}logger[_0xe1a9('0x15')]('Plugin,\x20%s,\x20%s',_0x5abb84,_0x177909[_0xe1a9('0x15')][_0xe1a9('0x17')]);return _0x566560(_0x177909[_0xe1a9('0x15')][_0xe1a9('0x17')]);}else{logger[_0xe1a9('0x11')](_0xe1a9('0x12'),_0x5abb84,_0xe1a9('0x13'));_0x566560(_0x177909['result'][_0xe1a9('0x17')]);}})['catch'](function(_0x5235ee){logger[_0xe1a9('0x15')](_0xe1a9('0x12'),_0x5abb84,_0x5235ee);_0x2cc896(_0x5235ee);});});}exports[_0xe1a9('0x18')]=function(_0x48a3de){var _0x4e217e=this;return new Promise(function(_0x3dc1ee,_0x3cb20f){return db['Plugin'][_0xe1a9('0x19')](_0x48a3de[_0xe1a9('0x1a')],{'raw':_0x48a3de[_0xe1a9('0x1b')]?_0x48a3de[_0xe1a9('0x1b')][_0xe1a9('0x1c')]===undefined?!![]:![]:!![]})[_0xe1a9('0x10')](function(_0x44218d){logger[_0xe1a9('0x11')](_0xe1a9('0x18'),_0x48a3de);logger[_0xe1a9('0x14')](_0xe1a9('0x18'),_0x48a3de,JSON[_0xe1a9('0x1d')](_0x44218d));_0x3dc1ee(_0x44218d);})[_0xe1a9('0x1e')](function(_0x3c5504){logger[_0xe1a9('0x15')](_0xe1a9('0x18'),_0x3c5504[_0xe1a9('0x17')],_0x48a3de);_0x3cb20f(_0x4e217e['error'](0x1f4,_0x3c5504[_0xe1a9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index b16902c..308d1e4 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 _0x65b4=['register','length','plugin:','./plugin.events','update','emit','removeListener'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x65b4,0x96));var _0x465b=function(_0x3f0b2a,_0x486c5f){_0x3f0b2a=_0x3f0b2a-0x0;var _0x2f1d7a=_0x65b4[_0x3f0b2a];return _0x2f1d7a;};'use strict';var PluginEvents=require(_0x465b('0x0'));var events=['save','remove',_0x465b('0x1')];function createListener(_0x4f8fea,_0x1af6cc){return function(_0x2db3ea){_0x1af6cc[_0x465b('0x2')](_0x4f8fea,_0x2db3ea);};}function removeListener(_0x172a3d,_0x50df49){return function(){PluginEvents[_0x465b('0x3')](_0x172a3d,_0x50df49);};}exports[_0x465b('0x4')]=function(_0x1c1f34){for(var _0x64b44=0x0,_0x5d3796=events[_0x465b('0x5')];_0x64b44<_0x5d3796;_0x64b44++){var _0x4f258c=events[_0x64b44];var _0x351ee3=createListener(_0x465b('0x6')+_0x4f258c,_0x1c1f34);PluginEvents['on'](_0x4f258c,_0x351ee3);}}; \ No newline at end of file +var _0xcba7=['register','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcba7,0x103));var _0x7cba=function(_0x4f51e2,_0x4508cd){_0x4f51e2=_0x4f51e2-0x0;var _0x3d1fd6=_0xcba7[_0x4f51e2];return _0x3d1fd6;};'use strict';var PluginEvents=require(_0x7cba('0x0'));var events=[_0x7cba('0x1'),_0x7cba('0x2'),_0x7cba('0x3')];function createListener(_0x20f7c2,_0x148825){return function(_0x32536b){_0x148825[_0x7cba('0x4')](_0x20f7c2,_0x32536b);};}function removeListener(_0x3eae40,_0x4020e2){return function(){PluginEvents['removeListener'](_0x3eae40,_0x4020e2);};}exports[_0x7cba('0x5')]=function(_0x63f3c0){for(var _0x4190cf=0x0,_0x3f6372=events[_0x7cba('0x6')];_0x4190cf<_0x3f6372;_0x4190cf++){var _0x2a4527=events[_0x4190cf];var _0x1a6bb2=createListener(_0x7cba('0x7')+_0x2a4527,_0x63f3c0);PluginEvents['on'](_0x2a4527,_0x1a6bb2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 682c9b2..f5fd916 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(_0x341b96,_0x5e22b4){var _0x54f890=function(_0x174855){while(--_0x174855){_0x341b96['push'](_0x341b96['shift']());}};_0x54f890(++_0x5e22b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x3e9ed4,_0x3f7ab9){var _0x2f131a=function(_0xea72f9){while(--_0xea72f9){_0x3e9ed4['push'](_0x3e9ed4['shift']());}};_0x2f131a(++_0x3f7ab9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 662d364..56f7c88 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 _0x6f0d=['../../files/plugins','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','send','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','bluebird','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script'];(function(_0x5c0722,_0x45c3e4){var _0x150eea=function(_0x1e5cb2){while(--_0x1e5cb2){_0x5c0722['push'](_0x5c0722['shift']());}};_0x150eea(++_0x45c3e4);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2ad81a,_0x23cdee){_0x2ad81a=_0x2ad81a-0x0;var _0x458665=_0x6f0d[_0x2ad81a];return _0x458665;};'use strict';var _=require('lodash');var pm2=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var path=require(_0xd6f0('0x3'));var exec=require('child_process')[_0xd6f0('0x4')];var BPromise=require(_0xd6f0('0x5'));function handleEntityNotFound(_0x2f78fb,_0x25344b){return function(_0x3a757f){if(!_0x3a757f){_0x2f78fb['sendStatus'](0x194);;}return _0x3a757f;};}function respondWithResult(_0x2d2ce6,_0x4a8b0c){_0x4a8b0c=_0x4a8b0c||0xc8;return function(_0xe21ac4){if(_0xe21ac4){return _0x2d2ce6[_0xd6f0('0x6')](_0x4a8b0c)[_0xd6f0('0x7')](_0xe21ac4);}return null;};}function handleError(_0x1a48a0,_0x4c4916){_0x4c4916=_0x4c4916||0x1f4;return function(_0x507048){logger[_0xd6f0('0x8')](_0x507048[_0xd6f0('0x9')]);if(_0x507048[_0xd6f0('0xa')]){delete _0x507048[_0xd6f0('0xa')];}_0x1a48a0[_0xd6f0('0x6')](_0x4c4916)['send'](_0x507048);};}function execChildProcess(){return new BPromise(function(_0x136eee,_0xee144c){exec(_0xd6f0('0xb'),function(_0x44bba6,_0x4d10a1,_0x1ce8d5){logger[_0xd6f0('0xc')](_0x4d10a1);logger[_0xd6f0('0xc')](_0x1ce8d5);if(_0x44bba6){logger[_0xd6f0('0x8')](_0x44bba6);return _0xee144c(_0x44bba6);}return _0x136eee(_0x4d10a1);});});}exports[_0xd6f0('0xd')]=function(_0x409549,_0x2bf5b8){return pm2[_0xd6f0('0xe')]()[_0xd6f0('0xf')](function(_0x4ab979){if(_0x4ab979){var _0x2b3f32=_[_0xd6f0('0x10')](_0x4ab979,function(_0x4c1559){return _0x4c1559[_0xd6f0('0xa')]==='express'||_0x4c1559[_0xd6f0('0xa')]===_0xd6f0('0x11');});return{'rows':_0x2b3f32,'count':_0x2b3f32[_0xd6f0('0x12')]};}return null;})[_0xd6f0('0xf')](respondWithResult(_0x2bf5b8,null))[_0xd6f0('0x13')](handleError(_0x2bf5b8,null));};exports[_0xd6f0('0x14')]=function(_0x25da0c,_0x29fbb9){return pm2[_0xd6f0('0x15')](_0x25da0c[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x29fbb9,null))[_0xd6f0('0xf')](handleEntityNotFound(_0x29fbb9,null))[_0xd6f0('0x13')](handleError(_0x29fbb9,null));};exports[_0xd6f0('0x17')]=function(_0x1f43d7,_0xde87d4){if(_0x1f43d7['body']['name']&&_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0x19')]){var _0x1158dc=path['join'](__dirname,_0xd6f0('0x1a'),_0x1f43d7[_0xd6f0('0x18')]['script']);var _0x86dde0=process['cwd']();process[_0xd6f0('0x1b')](path[_0xd6f0('0x1c')](_0x1158dc));return execChildProcess()['then'](function(_0xb9e820){process[_0xd6f0('0x1b')](_0x86dde0);return pm2['start']({'name':_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0xa')],'script':_0x1158dc});})[_0xd6f0('0xf')](function(_0x5b1a62){pm2[_0xd6f0('0x1d')]();return _0x5b1a62[0x0];})[_0xd6f0('0xf')](respondWithResult(_0xde87d4,0xc9))['catch'](handleError(_0xde87d4,null));}else{return _0xde87d4[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x1e')});}};exports[_0xd6f0('0x1f')]=function(_0x1630dc,_0x3c1bff){if(_0x1630dc[_0xd6f0('0x18')]['id']){delete _0x1630dc[_0xd6f0('0x18')]['id'];}var _0x12d6ec={'online':_0xd6f0('0x20'),'stopped':'stop'};if(_0x12d6ec[_0xd6f0('0x21')](_0x1630dc[_0xd6f0('0x18')]['status'])){return pm2[_0x12d6ec[_0x1630dc[_0xd6f0('0x18')][_0xd6f0('0x6')]]](_0x1630dc[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x3c1bff,0xc8))[_0xd6f0('0x13')](handleError(_0x3c1bff,null));}else{return _0x3c1bff[_0xd6f0('0x6')](0x1f4)[_0xd6f0('0x22')]({'message':_0xd6f0('0x23')});}};exports[_0xd6f0('0x24')]=function(_0x43f72f,_0x1dff9b){if(_0x43f72f[_0xd6f0('0x18')]['id']){delete _0x43f72f[_0xd6f0('0x18')]['id'];}if(_0x43f72f[_0xd6f0('0x16')]['id']){return pm2[_0xd6f0('0x25')](_0x43f72f[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](function(_0x376890){pm2[_0xd6f0('0x1d')]();return _0x376890[0x0];})[_0xd6f0('0xf')](respondWithResult(_0x1dff9b,null))[_0xd6f0('0x13')](handleError(_0x1dff9b,null));}else{return _0x1dff9b[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x26')});}}; \ No newline at end of file +var _0xbf6e=['start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname'];(function(_0x5da1d7,_0x37b4a0){var _0x5211bb=function(_0xf84411){while(--_0xf84411){_0x5da1d7['push'](_0x5da1d7['shift']());}};_0x5211bb(++_0x37b4a0);}(_0xbf6e,0x149));var _0xebf6=function(_0x44abd2,_0x2d34c8){_0x44abd2=_0x44abd2-0x0;var _0x4938dc=_0xbf6e[_0x44abd2];return _0x4938dc;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0xebf6('0x0'))(_0xebf6('0x1'));var path=require(_0xebf6('0x2'));var exec=require(_0xebf6('0x3'))[_0xebf6('0x4')];var BPromise=require(_0xebf6('0x5'));function handleEntityNotFound(_0x5c2323,_0x49de28){return function(_0x2b0c61){if(!_0x2b0c61){_0x5c2323[_0xebf6('0x6')](0x194);;}return _0x2b0c61;};}function respondWithResult(_0x3b2bb6,_0x1e15cf){_0x1e15cf=_0x1e15cf||0xc8;return function(_0x143344){if(_0x143344){return _0x3b2bb6[_0xebf6('0x7')](_0x1e15cf)[_0xebf6('0x8')](_0x143344);}return null;};}function handleError(_0x548e9e,_0x1d8035){_0x1d8035=_0x1d8035||0x1f4;return function(_0x40b28a){logger[_0xebf6('0x9')](_0x40b28a['stack']);if(_0x40b28a[_0xebf6('0xa')]){delete _0x40b28a[_0xebf6('0xa')];}_0x548e9e['status'](_0x1d8035)[_0xebf6('0xb')](_0x40b28a);};}function execChildProcess(){return new BPromise(function(_0x231d6b,_0x474dbe){exec(_0xebf6('0xc'),function(_0x1bd481,_0x36f588,_0x47ee12){logger[_0xebf6('0xd')](_0x36f588);logger[_0xebf6('0xd')](_0x47ee12);if(_0x1bd481){logger['error'](_0x1bd481);return _0x474dbe(_0x1bd481);}return _0x231d6b(_0x36f588);});});}exports[_0xebf6('0xe')]=function(_0x101a6c,_0x20c9ce){return pm2[_0xebf6('0xf')]()[_0xebf6('0x10')](function(_0x4dbf51){if(_0x4dbf51){var _0x4c01f4=_['reject'](_0x4dbf51,function(_0x4cecbc){return _0x4cecbc[_0xebf6('0xa')]==='express'||_0x4cecbc[_0xebf6('0xa')]===_0xebf6('0x11');});return{'rows':_0x4c01f4,'count':_0x4c01f4[_0xebf6('0x12')]};}return null;})[_0xebf6('0x10')](respondWithResult(_0x20c9ce,null))[_0xebf6('0x13')](handleError(_0x20c9ce,null));};exports[_0xebf6('0x14')]=function(_0x219621,_0x2dc96f){return pm2[_0xebf6('0x15')](_0x219621[_0xebf6('0x16')]['id'])['then'](respondWithResult(_0x2dc96f,null))['then'](handleEntityNotFound(_0x2dc96f,null))[_0xebf6('0x13')](handleError(_0x2dc96f,null));};exports[_0xebf6('0x17')]=function(_0x10051e,_0x410f06){if(_0x10051e[_0xebf6('0x18')][_0xebf6('0xa')]&&_0x10051e[_0xebf6('0x18')][_0xebf6('0x19')]){var _0x4fb497=path[_0xebf6('0x1a')](__dirname,_0xebf6('0x1b'),_0x10051e[_0xebf6('0x18')][_0xebf6('0x19')]);var _0x6303ac=process[_0xebf6('0x1c')]();process[_0xebf6('0x1d')](path[_0xebf6('0x1e')](_0x4fb497));return execChildProcess()[_0xebf6('0x10')](function(_0x2e32c6){process[_0xebf6('0x1d')](_0x6303ac);return pm2[_0xebf6('0x1f')]({'name':_0x10051e[_0xebf6('0x18')][_0xebf6('0xa')],'script':_0x4fb497});})[_0xebf6('0x10')](function(_0x1d0078){pm2[_0xebf6('0x20')]();return _0x1d0078[0x0];})[_0xebf6('0x10')](respondWithResult(_0x410f06,0xc9))[_0xebf6('0x13')](handleError(_0x410f06,null));}else{return _0x410f06['status'](0x1f4)['send']({'message':_0xebf6('0x21')});}};exports['update']=function(_0x230d84,_0x430eb7){if(_0x230d84['body']['id']){delete _0x230d84['body']['id'];}var _0x37950c={'online':_0xebf6('0x22'),'stopped':_0xebf6('0x23')};if(_0x37950c[_0xebf6('0x24')](_0x230d84[_0xebf6('0x18')][_0xebf6('0x7')])){return pm2[_0x37950c[_0x230d84[_0xebf6('0x18')][_0xebf6('0x7')]]](_0x230d84['params']['id'])[_0xebf6('0x10')](respondWithResult(_0x430eb7,0xc8))[_0xebf6('0x13')](handleError(_0x430eb7,null));}else{return _0x430eb7['status'](0x1f4)[_0xebf6('0xb')]({'message':_0xebf6('0x25')});}};exports['destroy']=function(_0x2901fc,_0x1fa407){if(_0x2901fc[_0xebf6('0x18')]['id']){delete _0x2901fc[_0xebf6('0x18')]['id'];}if(_0x2901fc[_0xebf6('0x16')]['id']){return pm2[_0xebf6('0x26')](_0x2901fc['params']['id'])[_0xebf6('0x10')](function(_0x34cc38){pm2['dump']();return _0x34cc38[0x0];})['then'](respondWithResult(_0x1fa407,null))[_0xebf6('0x13')](handleError(_0x1fa407,null));}else{return _0x1fa407[_0xebf6('0x7')](0x1f4)['send']({'message':_0xebf6('0x27')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8bed9da..d04eb47 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1dea34,_0xf92974){var _0x3ac4cc=function(_0x1c8ff1){while(--_0x1c8ff1){_0x1dea34['push'](_0x1dea34['shift']());}};_0x3ac4cc(++_0xf92974);}(_0xe706,0xa3));var _0x6e70=function(_0x5281ce,_0x210279){_0x5281ce=_0x5281ce-0x0;var _0x138d09=_0xe706[_0x5281ce];return _0x138d09;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3220ec,_0x322c2b){var _0x2d3392=function(_0x297fdc){while(--_0x297fdc){_0x3220ec['push'](_0x3220ec['shift']());}};_0x2d3392(++_0x322c2b);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 9c1003c..3d375f1 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 _0x326f=['INTEGER','sequelize','STRING','DATE'];(function(_0xc150f2,_0x4e7d1e){var _0x1aae52=function(_0x15647e){while(--_0x15647e){_0xc150f2['push'](_0xc150f2['shift']());}};_0x1aae52(++_0x4e7d1e);}(_0x326f,0xd1));var _0xf326=function(_0x5a1639,_0x2d75f4){_0x5a1639=_0x5a1639-0x0;var _0x3b03fa=_0x326f[_0x5a1639];return _0x3b03fa;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf326('0x1')]},'scheduledat':{'type':Sequelize[_0xf326('0x2')]},'uniqueid':{'type':Sequelize[_0xf326('0x1')]},'starttime':{'type':Sequelize[_0xf326('0x2')]},'responsetime':{'type':Sequelize[_0xf326('0x2')]},'ringtime':{'type':Sequelize[_0xf326('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf326('0x1')]},'campaigntype':{'type':Sequelize[_0xf326('0x1')]},'membername':{'type':Sequelize[_0xf326('0x1')]}}; \ No newline at end of file +var _0xe314=['exports','INTEGER','STRING','DATE'];(function(_0x8ed2fe,_0x19ca78){var _0x23a751=function(_0x412f75){while(--_0x412f75){_0x8ed2fe['push'](_0x8ed2fe['shift']());}};_0x23a751(++_0x19ca78);}(_0xe314,0x7c));var _0x4e31=function(_0x35e9e3,_0x2fc4dd){_0x35e9e3=_0x35e9e3-0x0;var _0x5f0e97=_0xe314[_0x35e9e3];return _0x5f0e97;};'use strict';var Sequelize=require('sequelize');module[_0x4e31('0x0')]={'state':{'type':Sequelize[_0x4e31('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x4e31('0x2')]},'scheduledat':{'type':Sequelize[_0x4e31('0x3')]},'uniqueid':{'type':Sequelize[_0x4e31('0x2')]},'starttime':{'type':Sequelize[_0x4e31('0x3')]},'responsetime':{'type':Sequelize[_0x4e31('0x3')]},'ringtime':{'type':Sequelize[_0x4e31('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4e31('0x2')]},'campaigntype':{'type':Sequelize[_0x4e31('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index f3b125e..0941171 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 _0x3782=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x140b99,_0x7e2f1d){var _0x30a5ea=function(_0x22057c){while(--_0x22057c){_0x140b99['push'](_0x140b99['shift']());}};_0x30a5ea(++_0x7e2f1d);}(_0x3782,0x124));var _0x2378=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3782[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2378('0x0'));var util=require(_0x2378('0x1'));var logger=require(_0x2378('0x2'))(_0x2378('0x3'));var moment=require(_0x2378('0x4'));var BPromise=require(_0x2378('0x5'));var rp=require(_0x2378('0x6'));var fs=require('fs');var path=require(_0x2378('0x7'));var rimraf=require(_0x2378('0x8'));var config=require(_0x2378('0x9'));var attributes=require(_0x2378('0xa'));module[_0x2378('0xb')]=function(_0x3e3e5d,_0x2ece6e){return _0x3e3e5d['define'](_0x2378('0xc'),attributes,{'tableName':_0x2378('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bc5=['request-promise','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','moment','bluebird'];(function(_0x387312,_0xec5111){var _0x3b7b86=function(_0x3e3d3f){while(--_0x3e3d3f){_0x387312['push'](_0x387312['shift']());}};_0x3b7b86(++_0xec5111);}(_0x4bc5,0x14b));var _0x54bc=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4bc5[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x54bc('0x0'));var util=require('util');var logger=require(_0x54bc('0x1'))(_0x54bc('0x2'));var moment=require(_0x54bc('0x3'));var BPromise=require(_0x54bc('0x4'));var rp=require(_0x54bc('0x5'));var fs=require('fs');var path=require(_0x54bc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x54bc('0x7'));module[_0x54bc('0x8')]=function(_0x1c3a87,_0x467894){return _0x1c3a87[_0x54bc('0x9')](_0x54bc('0xa'),attributes,{'tableName':_0x54bc('0xb'),'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 80cc98a..c485381 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 _0x9dbd=['raw','then','debug','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','options'];(function(_0x44aec0,_0x4a862c){var _0x8e5ec5=function(_0x4da990){while(--_0x4da990){_0x44aec0['push'](_0x44aec0['shift']());}};_0x8e5ec5(++_0x4a862c);}(_0x9dbd,0xa6));var _0xd9db=function(_0x1a974d,_0x381699){_0x1a974d=_0x1a974d-0x0;var _0x405801=_0x9dbd[_0x1a974d];return _0x405801;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd9db('0x0'));var BPromise=require(_0xd9db('0x1'));var rs=require(_0xd9db('0x2'));var fs=require('fs');var Redis=require(_0xd9db('0x3'));var db=require(_0xd9db('0x4'))['db'];var utils=require(_0xd9db('0x5'));var logger=require('../../config/logger')(_0xd9db('0x6'));var config=require(_0xd9db('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd9db('0x8')][_0xd9db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed51d,_0x1e3d86,_0xdad978){return new BPromise(function(_0x5e3f3a,_0x4ab794){return client[_0xd9db('0xa')](_0x2ed51d,_0xdad978)['then'](function(_0x3e44e4){logger['info'](_0xd9db('0xb'),_0x1e3d86,'request\x20sent');logger['debug'](_0xd9db('0xc'),_0x1e3d86,_0xd9db('0xd'),JSON['stringify'](_0x3e44e4));if(_0x3e44e4[_0xd9db('0xe')]){if(_0x3e44e4[_0xd9db('0xe')][_0xd9db('0xf')]===0x1f4){logger[_0xd9db('0xe')](_0xd9db('0xb'),_0x1e3d86,_0x3e44e4[_0xd9db('0xe')][_0xd9db('0x10')]);return _0x4ab794(_0x3e44e4['error'][_0xd9db('0x10')]);}logger[_0xd9db('0xe')](_0xd9db('0xb'),_0x1e3d86,_0x3e44e4[_0xd9db('0xe')][_0xd9db('0x10')]);return _0x5e3f3a(_0x3e44e4[_0xd9db('0xe')][_0xd9db('0x10')]);}else{logger[_0xd9db('0x11')](_0xd9db('0xb'),_0x1e3d86,_0xd9db('0xd'));_0x5e3f3a(_0x3e44e4[_0xd9db('0x12')]['message']);}})[_0xd9db('0x13')](function(_0x71f62b){logger['error'](_0xd9db('0xb'),_0x1e3d86,_0x71f62b);_0x4ab794(_0x71f62b);});});}exports[_0xd9db('0x14')]=function(_0x405aaa){var _0x47610c=this;return new Promise(function(_0x43fd87,_0x38bc06){return db[_0xd9db('0x15')]['create'](_0x405aaa['body'],{'raw':_0x405aaa[_0xd9db('0x16')]?_0x405aaa[_0xd9db('0x16')][_0xd9db('0x17')]===undefined?!![]:![]:!![]})[_0xd9db('0x18')](function(_0xde8695){logger['info']('CreateReportAgentPreview',_0x405aaa);logger[_0xd9db('0x19')](_0xd9db('0x14'),_0x405aaa,JSON[_0xd9db('0x1a')](_0xde8695));_0x43fd87(_0xde8695);})[_0xd9db('0x13')](function(_0x10eb18){logger[_0xd9db('0xe')](_0xd9db('0x14'),_0x10eb18[_0xd9db('0x10')],_0x405aaa);_0x38bc06(_0x47610c[_0xd9db('0xe')](0x1f4,_0x10eb18['message']));});});}; \ No newline at end of file +var _0xd5e1=['http','request','then','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','catch','lodash','util','moment','ioredis','../../config/environment','client'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0xd5e1,0x14c));var _0x1d5e=function(_0x3d5897,_0x3b2ad5){_0x3d5897=_0x3d5897-0x0;var _0x3578fe=_0xd5e1[_0x3d5897];return _0x3578fe;};'use strict';var _=require(_0x1d5e('0x0'));var util=require(_0x1d5e('0x1'));var moment=require(_0x1d5e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d5e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1d5e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x1d5e('0x5')][_0x1d5e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x192205,_0x269c34,_0x2d2355){return new BPromise(function(_0x2590a0,_0x1a85bb){return client[_0x1d5e('0x7')](_0x192205,_0x2d2355)[_0x1d5e('0x8')](function(_0x424b46){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x269c34,'request\x20sent');logger[_0x1d5e('0x9')](_0x1d5e('0xa'),_0x269c34,_0x1d5e('0xb'),JSON[_0x1d5e('0xc')](_0x424b46));if(_0x424b46[_0x1d5e('0xd')]){if(_0x424b46[_0x1d5e('0xd')][_0x1d5e('0xe')]===0x1f4){logger['error'](_0x1d5e('0xf'),_0x269c34,_0x424b46[_0x1d5e('0xd')][_0x1d5e('0x10')]);return _0x1a85bb(_0x424b46['error'][_0x1d5e('0x10')]);}logger[_0x1d5e('0xd')](_0x1d5e('0xf'),_0x269c34,_0x424b46[_0x1d5e('0xd')]['message']);return _0x2590a0(_0x424b46[_0x1d5e('0xd')][_0x1d5e('0x10')]);}else{logger[_0x1d5e('0x11')](_0x1d5e('0xf'),_0x269c34,_0x1d5e('0xb'));_0x2590a0(_0x424b46[_0x1d5e('0x12')][_0x1d5e('0x10')]);}})['catch'](function(_0x160624){logger[_0x1d5e('0xd')](_0x1d5e('0xf'),_0x269c34,_0x160624);_0x1a85bb(_0x160624);});});}exports[_0x1d5e('0x13')]=function(_0x4d1f55){var _0x48d279=this;return new Promise(function(_0x36168a,_0x2987bf){return db[_0x1d5e('0x14')][_0x1d5e('0x15')](_0x4d1f55[_0x1d5e('0x16')],{'raw':_0x4d1f55[_0x1d5e('0x17')]?_0x4d1f55[_0x1d5e('0x17')][_0x1d5e('0x18')]===undefined?!![]:![]:!![]})[_0x1d5e('0x8')](function(_0x7932c6){logger[_0x1d5e('0x11')](_0x1d5e('0x13'),_0x4d1f55);logger[_0x1d5e('0x9')](_0x1d5e('0x13'),_0x4d1f55,JSON[_0x1d5e('0xc')](_0x7932c6));_0x36168a(_0x7932c6);})[_0x1d5e('0x19')](function(_0x2a8d5d){logger['error'](_0x1d5e('0x13'),_0x2a8d5d[_0x1d5e('0x10')],_0x4d1f55);_0x2987bf(_0x48d279[_0x1d5e('0xd')](0x1f4,_0x2a8d5d[_0x1d5e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index f85bef3..b978924 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 _0xb5a8=['put','/agents/:id/capacity','agentCapacity','telephones','/trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','post','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents'];(function(_0x4e3bf8,_0x1829b1){var _0x37a8be=function(_0x3eecdc){while(--_0x3eecdc){_0x4e3bf8['push'](_0x4e3bf8['shift']());}};_0x37a8be(++_0x1829b1);}(_0xb5a8,0x81));var _0x8b5a=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xb5a8[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x8b5a('0x0'));var util=require(_0x8b5a('0x1'));var path=require(_0x8b5a('0x2'));var express=require(_0x8b5a('0x3'));var router=express[_0x8b5a('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x8b5a('0x5'));router[_0x8b5a('0x6')](_0x8b5a('0x7'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x9')]);router[_0x8b5a('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xa')]);router['get'](_0x8b5a('0xb'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xc')]);router[_0x8b5a('0x6')]('/voice/queues',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xd')]);router[_0x8b5a('0x6')](_0x8b5a('0xe'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xf')]);router[_0x8b5a('0x6')]('/mail/queues',auth[_0x8b5a('0x8')](),controller['mailQueues']);router[_0x8b5a('0x6')](_0x8b5a('0x10'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x11')]);router['get']('/openchannel/queues',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x12')]);router[_0x8b5a('0x6')](_0x8b5a('0x13'),auth['isAuthenticated'](),controller[_0x8b5a('0x14')]);router[_0x8b5a('0x6')](_0x8b5a('0x15'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x16')]);router[_0x8b5a('0x6')](_0x8b5a('0x17'),auth['isAuthenticated'](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x18')]);router[_0x8b5a('0x6')](_0x8b5a('0x19'),auth[_0x8b5a('0x8')](),controller['voiceQueuesChannels']);router[_0x8b5a('0x6')](_0x8b5a('0x1a'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x1b')]);router[_0x8b5a('0x6')](_0x8b5a('0x1c'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x1d')]);router['get'](_0x8b5a('0x1e'),auth['isAuthenticated'](),controller[_0x8b5a('0x1f')]);router[_0x8b5a('0x6')](_0x8b5a('0x20'),auth[_0x8b5a('0x8')](),controller['showVoiceQueues']);router['put'](_0x8b5a('0x20'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x21')]);router[_0x8b5a('0x6')]('/outbound',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x22')]);router['get'](_0x8b5a('0x23'),auth['isAuthenticated'](),controller[_0x8b5a('0x24')]);router[_0x8b5a('0x6')](_0x8b5a('0x25'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x26')]);router[_0x8b5a('0x27')](_0x8b5a('0x28'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x29')]);router[_0x8b5a('0x6')]('/telephones',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x2a')]);router[_0x8b5a('0x6')](_0x8b5a('0x2b'),auth[_0x8b5a('0x8')](),controller['trunks']);router[_0x8b5a('0x6')](_0x8b5a('0x2c'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x2d')]);router[_0x8b5a('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x8b5a('0x2e')]);router[_0x8b5a('0x6')](_0x8b5a('0x2f'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x30')]);router[_0x8b5a('0x6')](_0x8b5a('0x31'),auth['isAuthenticated'](),controller[_0x8b5a('0x32')]);router['get'](_0x8b5a('0x33'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x34')]);router[_0x8b5a('0x6')](_0x8b5a('0x35'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x36')]);router[_0x8b5a('0x6')](_0x8b5a('0x37'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x38')]);router[_0x8b5a('0x6')](_0x8b5a('0x39'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3a')]);router['get'](_0x8b5a('0x3b'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3c')]);router['post'](_0x8b5a('0x3d'),auth['isAuthenticated'](),controller[_0x8b5a('0x3e')](_0x8b5a('0x3f')));router[_0x8b5a('0x6')](_0x8b5a('0x40'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x41')]);router['post'](_0x8b5a('0x42'),auth['isAuthenticated'](),controller[_0x8b5a('0x3e')](_0x8b5a('0x43')));router[_0x8b5a('0x6')](_0x8b5a('0x44'),auth[_0x8b5a('0x8')](),controller['showChatQueues']);router[_0x8b5a('0x45')](_0x8b5a('0x46'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3e')]('fax'));router[_0x8b5a('0x6')](_0x8b5a('0x47'),auth['isAuthenticated'](),controller[_0x8b5a('0x48')]);router[_0x8b5a('0x45')](_0x8b5a('0x49'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3e')]('openchannel'));router[_0x8b5a('0x6')](_0x8b5a('0x4a'),auth[_0x8b5a('0x8')](),controller['showOpenchannelQueues']);router[_0x8b5a('0x45')](_0x8b5a('0x4b'),auth['isAuthenticated'](),controller['queueNotify'](_0x8b5a('0x4c')));router[_0x8b5a('0x45')](_0x8b5a('0x4d'),auth['isAuthenticated'](),controller[_0x8b5a('0x3e')](_0x8b5a('0x4e')));router['get'](_0x8b5a('0x4f'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x50')]);router[_0x8b5a('0x6')](_0x8b5a('0x51'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x52')]);router[_0x8b5a('0x45')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x8b5a('0x53')]);module['exports']=router; \ No newline at end of file +var _0x042f=['voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','openchannelQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x042f,0xe0));var _0xf042=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x042f[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0xf042('0x0'));var util=require('util');var path=require(_0xf042('0x1'));var express=require(_0xf042('0x2'));var router=express[_0xf042('0x3')]();var auth=require(_0xf042('0x4'));var controller=require(_0xf042('0x5'));router[_0xf042('0x6')](_0xf042('0x7'),auth['isAuthenticated'](),controller[_0xf042('0x8')]);router[_0xf042('0x6')](_0xf042('0x9'),auth['isAuthenticated'](),controller[_0xf042('0xa')]);router[_0xf042('0x6')](_0xf042('0xb'),auth[_0xf042('0xc')](),controller['voiceChannelStopMixMonitor']);router[_0xf042('0x6')](_0xf042('0xd'),auth[_0xf042('0xc')](),controller[_0xf042('0xe')]);router[_0xf042('0x6')](_0xf042('0xf'),auth[_0xf042('0xc')](),controller[_0xf042('0x10')]);router['get'](_0xf042('0x11'),auth[_0xf042('0xc')](),controller[_0xf042('0x12')]);router[_0xf042('0x6')]('/mail/accounts',auth['isAuthenticated'](),controller['mailAccounts']);router[_0xf042('0x6')]('/openchannel/queues',auth[_0xf042('0xc')](),controller[_0xf042('0x13')]);router[_0xf042('0x6')]('/sms/queues',auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0xf042('0x14'),auth['isAuthenticated'](),controller[_0xf042('0x15')]);router[_0xf042('0x6')](_0xf042('0x16'),auth[_0xf042('0xc')](),controller[_0xf042('0x17')]);router['get']('/voice/queues/preview/:id',auth[_0xf042('0xc')](),controller['voiceQueuesPreview']);router['get'](_0xf042('0x18'),auth[_0xf042('0xc')](),controller[_0xf042('0x19')]);router['get'](_0xf042('0x1a'),auth[_0xf042('0xc')](),controller[_0xf042('0x1b')]);router[_0xf042('0x6')](_0xf042('0x1c'),auth[_0xf042('0xc')](),controller[_0xf042('0x1d')]);router['get'](_0xf042('0x1e'),auth[_0xf042('0xc')](),controller[_0xf042('0x1f')]);router['get'](_0xf042('0x20'),auth[_0xf042('0xc')](),controller[_0xf042('0x21')]);router[_0xf042('0x22')](_0xf042('0x20'),auth[_0xf042('0xc')](),controller[_0xf042('0x23')]);router[_0xf042('0x6')]('/outbound',auth[_0xf042('0xc')](),controller[_0xf042('0x24')]);router['get'](_0xf042('0x25'),auth[_0xf042('0xc')](),controller[_0xf042('0x26')]);router[_0xf042('0x6')](_0xf042('0x27'),auth[_0xf042('0xc')](),controller[_0xf042('0x28')]);router[_0xf042('0x22')](_0xf042('0x29'),auth['isAuthenticated'](),controller[_0xf042('0x2a')]);router[_0xf042('0x6')](_0xf042('0x2b'),auth['isAuthenticated'](),controller[_0xf042('0x2c')]);router[_0xf042('0x6')]('/trunks',auth[_0xf042('0xc')](),controller[_0xf042('0x2d')]);router[_0xf042('0x6')](_0xf042('0x2e'),auth['isAuthenticated'](),controller[_0xf042('0x2f')]);router[_0xf042('0x6')](_0xf042('0x30'),auth[_0xf042('0xc')](),controller['faxAccounts']);router['get'](_0xf042('0x31'),auth[_0xf042('0xc')](),controller[_0xf042('0x32')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0xf042('0x6')]('/openchannel/queues/waitinginteractions',auth[_0xf042('0xc')](),controller['openchannelQueuesWaitingInteractions']);router[_0xf042('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0xf042('0xc')](),controller[_0xf042('0x33')]);router[_0xf042('0x6')](_0xf042('0x34'),auth[_0xf042('0xc')](),controller[_0xf042('0x35')]);router['get'](_0xf042('0x36'),auth[_0xf042('0xc')](),controller['whatsappQueuesWaitingInteractions']);router[_0xf042('0x6')](_0xf042('0x37'),auth[_0xf042('0xc')](),controller[_0xf042('0x38')]);router[_0xf042('0x39')](_0xf042('0x3a'),auth[_0xf042('0xc')](),controller[_0xf042('0x3b')](_0xf042('0x3c')));router[_0xf042('0x6')](_0xf042('0x3d'),auth[_0xf042('0xc')](),controller['showMailQueues']);router[_0xf042('0x39')]('/chat/queues/:id/notify',auth[_0xf042('0xc')](),controller[_0xf042('0x3b')](_0xf042('0x3e')));router[_0xf042('0x6')](_0xf042('0x3f'),auth[_0xf042('0xc')](),controller[_0xf042('0x40')]);router['post'](_0xf042('0x41'),auth[_0xf042('0xc')](),controller[_0xf042('0x3b')](_0xf042('0x42')));router[_0xf042('0x6')]('/fax/queues/:id',auth[_0xf042('0xc')](),controller[_0xf042('0x43')]);router['post']('/openchannel/queues/:id/notify',auth[_0xf042('0xc')](),controller[_0xf042('0x3b')](_0xf042('0x44')));router[_0xf042('0x6')](_0xf042('0x45'),auth[_0xf042('0xc')](),controller[_0xf042('0x46')]);router[_0xf042('0x39')](_0xf042('0x47'),auth[_0xf042('0xc')](),controller[_0xf042('0x3b')]('sms'));router[_0xf042('0x39')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0xf042('0x3b')]('whatsapp'));router['get'](_0xf042('0x48'),auth[_0xf042('0xc')](),controller[_0xf042('0x49')]);router[_0xf042('0x6')](_0xf042('0x4a'),auth[_0xf042('0xc')](),controller[_0xf042('0x4b')]);router[_0xf042('0x39')](_0xf042('0x4c'),auth[_0xf042('0xc')](),controller['agentNotify']);module[_0xf042('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 fa940b9..5a625fe 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 _0x814b=['whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','create','Start','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues'];(function(_0x2fbd6a,_0x1caade){var _0x320995=function(_0x3be6d3){while(--_0x3be6d3){_0x2fbd6a['push'](_0x2fbd6a['shift']());}};_0x320995(++_0x1caade);}(_0x814b,0x1a2));var _0xb814=function(_0x5aa4cc,_0x49d641){_0x5aa4cc=_0x5aa4cc-0x0;var _0x52b505=_0x814b[_0x5aa4cc];return _0x52b505;};'use strict';var BPromise=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var db=require(_0xb814('0x4'))['db'];var logger=require(_0xb814('0x5'))('api');var jayson=require(_0xb814('0x6'));var amiClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232a});var mailClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232b});var routingClient=jayson[_0xb814('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){var _0x186d5a=_0x5c8539?_0x5c8539:amiClient;return _0x186d5a[_0xb814('0x9')](_0x3b0829,_0x2e6272)[_0xb814('0xa')](function(_0x21d4a5){if(_0x21d4a5[_0xb814('0xb')]){if(_0x21d4a5[_0xb814('0xb')][_0xb814('0xc')]===0x1f4){return _0x2913a6(_0x21d4a5[_0xb814('0xb')][_0xb814('0xd')]);}return _0x271af9(_0x21d4a5['error'][_0xb814('0xd')]);}else{_0x271af9(_0x21d4a5['result']);}})[_0xb814('0xe')](function(_0x15d6ef){_0x2913a6(_0x15d6ef);});});}function respondWithResult(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xc8;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0xf')](_0x2cc46b)[_0xb814('0x10')](_0x2ce718);}return _0x35b10d[_0xb814('0x11')](0x194);};}function handleError(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0x1f4;return function(_0x3f4881){logger[_0xb814('0xb')](_0x3f4881[_0xb814('0x12')]);if(_0x3f4881[_0xb814('0x13')]){delete _0x3f4881[_0xb814('0x13')];}_0xa0a2e5[_0xb814('0xf')](_0x2ab627)[_0xb814('0x14')](_0x3f4881);};}function findById(_0x265a83){return function(_0x125ce2){if(!_[_0xb814('0x15')](_0x265a83)&&!_[_0xb814('0x15')](_0x125ce2)&&!_['isNil'](_0x125ce2[_0xb814('0x16')])){return _['find'](_0x125ce2[_0xb814('0x16')],function(_0xfac75b){return _0xfac75b['id']==_0x265a83;});}return null;};}exports['voiceChannels']=function(_0x4b55a7,_0x55d63c){return respondWithRpcPromise(_0xb814('0x17'),_0x4b55a7['query'])['then'](respondWithResult(_0x55d63c,null))[_0xb814('0xe')](handleError(_0x55d63c,null));};exports[_0xb814('0x18')]=function(_0x25b6b6,_0x4e139e){return respondWithRpcPromise(_0xb814('0x19'),_['merge'](_0x25b6b6[_0xb814('0x1a')],_0x25b6b6[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4e139e,null))[_0xb814('0xe')](handleError(_0x4e139e,null));};exports[_0xb814('0x1c')]=function(_0x2bd039,_0x1f5d40){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xb814('0x1d')](_0x2bd039['query'],_0x2bd039[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1f5d40,null))[_0xb814('0xe')](handleError(_0x1f5d40,null));};exports[_0xb814('0x1e')]=function(_0x1c8a2e,_0xb9e57d){return respondWithRpcPromise(_0xb814('0x1f'),_0x1c8a2e['query'])[_0xb814('0xa')](respondWithResult(_0xb9e57d,null))[_0xb814('0xe')](handleError(_0xb9e57d,null));};exports[_0xb814('0x20')]=function(_0x349394,_0x32ed56){return respondWithRpcPromise(_0xb814('0x1f'),_0x349394[_0xb814('0x1a')])[_0xb814('0xa')](findById(_0x349394['params']['id']))[_0xb814('0xa')](respondWithResult(_0x32ed56,null))[_0xb814('0xe')](handleError(_0x32ed56,null));};exports['updateVoiceQueue']=function(_0x9008b2,_0x37d24d){return respondWithRpcPromise(_0xb814('0x21'),_['merge'](_0x9008b2[_0xb814('0x22')],_0x9008b2[_0xb814('0x1b')]))['then'](respondWithResult(_0x37d24d,null))[_0xb814('0xe')](handleError(_0x37d24d,null));};exports['voiceQueuesPreview']=function(_0x6efe9a,_0x5f3e9b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xb814('0x1d')](_0x6efe9a['query'],_0x6efe9a[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x5f3e9b,null))[_0xb814('0xe')](handleError(_0x5f3e9b,null));};exports['voiceQueuesChannels']=function(_0x51d5ae,_0x26d3a9){return respondWithRpcPromise(_0xb814('0x23'),_0x51d5ae['query'])[_0xb814('0xa')](respondWithResult(_0x26d3a9,null))[_0xb814('0xe')](handleError(_0x26d3a9,null));};exports[_0xb814('0x24')]=function(_0x217b7e,_0x1b78de){return respondWithRpcPromise(_0xb814('0x25'),_[_0xb814('0x1d')](_0x217b7e['query'],_0x217b7e[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1b78de,null))[_0xb814('0xe')](handleError(_0x1b78de,null));};exports[_0xb814('0x26')]=function(_0x14100d,_0x4ff31a){return respondWithRpcPromise(_0xb814('0x27'),_['merge'](_0x14100d[_0xb814('0x1a')],_0x14100d[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ff31a,null))['catch'](handleError(_0x4ff31a,null));};exports[_0xb814('0x28')]=function(_0xbdb3e9,_0x4ea6f8){return respondWithRpcPromise(_0xb814('0x29'),_[_0xb814('0x1d')](_0xbdb3e9[_0xb814('0x1a')],_0xbdb3e9[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ea6f8,null))[_0xb814('0xe')](handleError(_0x4ea6f8,null));};exports['outbound']=function(_0xa6ce87,_0x4e4684){return respondWithRpcPromise(_0xb814('0x2a'),_0xa6ce87['query'])[_0xb814('0xa')](respondWithResult(_0x4e4684,null))['catch'](handleError(_0x4e4684,null));};exports[_0xb814('0x2b')]=function(_0x26675a,_0x54a7fb){return respondWithRpcPromise('OutboundChannels',_0x26675a['query'])['then'](respondWithResult(_0x54a7fb,null))[_0xb814('0xe')](handleError(_0x54a7fb,null));};exports[_0xb814('0x2c')]=function(_0x38cdc2,_0x42c2ed){var _0x51cdba;return respondWithRpcPromise('Agents',_0x38cdc2[_0xb814('0x1a')])['then'](function(_0x2a93da){_0x51cdba=_0x2a93da;return respondWithRpcPromise(_0xb814('0x2d'),_0x38cdc2[_0xb814('0x1a')],routingClient);})[_0xb814('0xa')](function(_0x42653f){return _[_0xb814('0x1d')]({},_0x42653f,_0x51cdba);})[_0xb814('0xa')](respondWithResult(_0x42c2ed,null))[_0xb814('0xe')](handleError(_0x42c2ed,null));};exports[_0xb814('0x2e')]=function(_0x4b6ff8,_0x544d36){if(_0x4b6ff8['body']&&_0x4b6ff8[_0xb814('0x22')]['interaction']&&_0x4b6ff8[_0xb814('0x2f')]&&_0x4b6ff8['user'][_0xb814('0x13')]){for(var _0x44ff56 in _0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')]){if(_0x4b6ff8['body'][_0xb814('0x30')][_0xb814('0x31')](_0x44ff56)){db[_0xb814('0x32')][_0xb814('0x33')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]&&_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')]?{'$notIn':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]}:{'$ne':null}}})['then'](function(_0x4a5e84){var _0xe751c3=moment()[_0xb814('0x35')](_0xb814('0x36'));for(var _0x2bf906=0x0,_0x43f1b=_0x4a5e84[_0xb814('0x34')];_0x2bf906<_0x43f1b;_0x2bf906+=0x1){_0x4a5e84[_0x2bf906][_0xb814('0x37')]({'exitAt':_0xe751c3});}});for(var _0x40af85=0x0;_0x40af85<_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')];_0x40af85+=0x1){db['MemberReport'][_0xb814('0x38')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')]['name'],'type':_0xb814('0x39'),'uniqueid':_0x4b6ff8['body'][_0xb814('0x30')][_0x44ff56][_0x40af85],'exitAt':null},'defaults':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'interface':_[_0xb814('0x15')](_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3a')])?util[_0xb814('0x35')](_0xb814('0x3b'),_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')]):_0x4b6ff8['user']['interface'],'type':_0xb814('0x39'),'enterAt':moment()[_0xb814('0x35')](_0xb814('0x36')),'role':_0xb814('0x3c'),'internal':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3d')],'uniqueid':_0x4b6ff8[_0xb814('0x22')]['interaction'][_0x44ff56][_0x40af85]}});}}}}return respondWithRpcPromise(_0xb814('0x3e'),{'id':_0x4b6ff8[_0xb814('0x1b')]['id'],'capacity':_0x4b6ff8[_0xb814('0x22')]['capacity']},routingClient)[_0xb814('0xa')](respondWithResult(_0x544d36,null))['catch'](handleError(_0x544d36,null));};exports[_0xb814('0x3f')]=function(_0x5dc28e,_0x403872){return respondWithRpcPromise(_0xb814('0x40'),_0x5dc28e['query'])[_0xb814('0xa')](respondWithResult(_0x403872,null))[_0xb814('0xe')](handleError(_0x403872,null));};exports[_0xb814('0x41')]=function(_0x5209d1,_0x3da050){return respondWithRpcPromise('Trunks',_0x5209d1[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x3da050,null))['catch'](handleError(_0x3da050,null));};exports[_0xb814('0x42')]=function(_0x4a3f84,_0x539be7){return respondWithRpcPromise(_0xb814('0x43'),_0x4a3f84[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x539be7,null))['catch'](handleError(_0x539be7,null));};exports[_0xb814('0x44')]=function(_0x538b0f,_0xf88d23){return respondWithRpcPromise(_0xb814('0x45'),_0x538b0f['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0xf88d23,null))['catch'](handleError(_0xf88d23,null));};exports[_0xb814('0x46')]=function(_0x1656ed,_0xb2bd82){return respondWithRpcPromise(_0xb814('0x45'),_0x1656ed[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x1656ed[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0xb2bd82,null))['catch'](handleError(_0xb2bd82,null));};exports[_0xb814('0x47')]=function(_0x5441c5,_0x5d71d5){return respondWithRpcPromise(_0xb814('0x48'),_0x5441c5[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x5d71d5,null))[_0xb814('0xe')](handleError(_0x5d71d5,null));};exports['showMailQueues']=function(_0x48362c,_0x2114ca){return respondWithRpcPromise('MailQueues',_0x48362c[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x48362c[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x2114ca,null))[_0xb814('0xe')](handleError(_0x2114ca,null));};exports['mailAccounts']=function(_0x2ef77d,_0x1e9196){return respondWithRpcPromise(_0xb814('0x49'),_0x2ef77d[_0xb814('0x1a')],mailClient)[_0xb814('0xa')](respondWithResult(_0x1e9196,null))[_0xb814('0xe')](handleError(_0x1e9196,null));};exports[_0xb814('0x4a')]=function(_0x113350,_0x46014f){return respondWithRpcPromise('OpenchannelQueues',_0x113350[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x46014f,null))[_0xb814('0xe')](handleError(_0x46014f,null));};exports[_0xb814('0x4b')]=function(_0x3b35a8,_0x3d4843){return respondWithRpcPromise('OpenchannelQueues',_0x3b35a8[_0xb814('0x1a')],routingClient)['then'](findById(_0x3b35a8[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x3d4843,null))[_0xb814('0xe')](handleError(_0x3d4843,null));};exports['smsQueues']=function(_0x150e73,_0x579351){return respondWithRpcPromise(_0xb814('0x4c'),_0x150e73['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x579351,null))[_0xb814('0xe')](handleError(_0x579351,null));};exports[_0xb814('0x4d')]=function(_0x1b024f,_0x3377d4){return respondWithRpcPromise(_0xb814('0x4c'),_0x1b024f[_0xb814('0x1a')],routingClient)['then'](findById(_0x1b024f[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3377d4,null))[_0xb814('0xe')](handleError(_0x3377d4,null));};exports[_0xb814('0x4e')]=function(_0x1b989d,_0x3dcaeb){return respondWithRpcPromise(_0xb814('0x4f'),_0x1b989d[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x3dcaeb,null))[_0xb814('0xe')](handleError(_0x3dcaeb,null));};exports[_0xb814('0x50')]=function(_0x4a49ba,_0x3bb2b4){return respondWithRpcPromise(_0xb814('0x4f'),_0x4a49ba[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x4a49ba[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3bb2b4,null))[_0xb814('0xe')](handleError(_0x3bb2b4,null));};exports['faxQueues']=function(_0x24594a,_0x16f8f2){return respondWithRpcPromise(_0xb814('0x51'),_0x24594a[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x16f8f2,null))[_0xb814('0xe')](handleError(_0x16f8f2,null));};exports['showFaxQueues']=function(_0x506bf2,_0x5d064b){return respondWithRpcPromise(_0xb814('0x51'),_0x506bf2['query'],routingClient)[_0xb814('0xa')](findById(_0x506bf2[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x5d064b,null))['catch'](handleError(_0x5d064b,null));};exports[_0xb814('0x52')]=function(_0x3e5ce8,_0xee204){return respondWithRpcPromise('FaxAccounts',_0x3e5ce8[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0xee204,null))[_0xb814('0xe')](handleError(_0xee204,null));};exports[_0xb814('0x53')]=function(_0x555be0,_0x5dedd7){return respondWithRpcPromise(_0xb814('0x54'),_0x555be0[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5dedd7,null))[_0xb814('0xe')](handleError(_0x5dedd7,null));};exports[_0xb814('0x55')]=function(_0xe5fc12,_0x34a0b3){return respondWithRpcPromise(_0xb814('0x56'),_0xe5fc12[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x34a0b3,null))[_0xb814('0xe')](handleError(_0x34a0b3,null));};exports[_0xb814('0x57')]=function(_0x3ef474,_0x21fc41){return respondWithRpcPromise(_0xb814('0x58'),_0x3ef474['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x21fc41,null))[_0xb814('0xe')](handleError(_0x21fc41,null));};exports[_0xb814('0x59')]=function(_0x357b90,_0xec821a){return respondWithRpcPromise(_0xb814('0x58'),_0x357b90['query'],routingClient)[_0xb814('0xa')](function(_0x52e1fc){if(_0x357b90[_0xb814('0x1a')][_0xb814('0x5a')]!==undefined){var _0x3c5a58=_(_0x52e1fc[_0xb814('0x16')])[_0xb814('0x5b')]([_0x357b90['query']['type'],_0x357b90[_0xb814('0x1b')]['id']])[_0xb814('0x5c')](_0xb814('0x5d'))[_0xb814('0x5e')]()['value']();return _0x52e1fc[_0xb814('0x16')]['filter'](function(_0x39073c){return _0x3c5a58[_0xb814('0x5f')](_0x39073c['queue_id'])>-0x1;});}else{return _0x52e1fc['rows'][_0xb814('0x5b')](function(_0x52e17a){return _0x52e17a[_0xb814('0x5d')]===parseInt(_0x357b90[_0xb814('0x1b')]['id']);});}})[_0xb814('0xa')](respondWithResult(_0xec821a,null))[_0xb814('0xe')](handleError(_0xec821a,null));};exports[_0xb814('0x60')]=function(_0x420bde,_0x40fe4a){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x420bde[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x40fe4a,null))[_0xb814('0xe')](handleError(_0x40fe4a,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2838cb,_0x43ee60){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2838cb[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x43ee60,null))[_0xb814('0xe')](handleError(_0x43ee60,null));};exports[_0xb814('0x61')]=function(_0x4e15c2,_0x5a0c4a){return respondWithRpcPromise(_0xb814('0x62'),_0x4e15c2[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5a0c4a,null))[_0xb814('0xe')](handleError(_0x5a0c4a,null));};exports[_0xb814('0x63')]=function(_0x4394da){return function(_0x2b12a9,_0x314600){var _0x8cb107,_0x34f49c;var _0x53e705=_['capitalize'](_0x4394da);var _0x5bee4d=_0x4394da==='chat'?'Website':_0xb814('0x64');return db[_0x53e705+_0xb814('0x65')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x2b12a9['params']['id']}})[_0xb814('0xa')](function(_0x1fb1ea){if(_[_0xb814('0x15')](_0x1fb1ea)){throw new Error(_0x53e705+_0xb814('0x67'));}_0x8cb107=_0x1fb1ea;return db[_0x53e705+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x2b12a9[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x53e705+'Interaction'],'as':_0xb814('0x6a')},{'model':db[_0x53e705+_0x5bee4d],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x30faa0){if(_['isNil'](_0x30faa0)){throw new Error(_0x53e705+_0xb814('0x6b'));}_0x34f49c=_0x30faa0;return _0x30faa0[_0xb814('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3037f2={'uniqueid':_0x4394da+'.'+_0x34f49c['id']+'.'+_0x34f49c[_0xb814('0x6a')]['id'],'FromUserId':_0x2b12a9['user']['id'],'type':'queue'};_0x3037f2[_0x53e705+_0xb814('0x6d')]=_0x34f49c['id'];_0x3037f2[_0x53e705+'InteractionId']=_0x34f49c[_0xb814('0x6a')]['id'];_0x3037f2[_0xb814('0x6e')+_0x53e705+_0x5bee4d+'Id']=_0x34f49c['Account']['id'];_0x3037f2['To'+_0x53e705+_0xb814('0x6f')]=_0x8cb107['id'];return db[_0x53e705+'TransferReport'][_0xb814('0x70')](_0x3037f2);})['then'](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x4394da,'interaction':_0x34f49c[_0xb814('0x6a')],'message':_0x34f49c,'account':_0x34f49c[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x72'),'appdata':_0x8cb107[_0xb814('0x13')]+','+(_0x34f49c[_0xb814('0x64')][_0xb814('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x314600,null))[_0xb814('0xe')](handleError(_0x314600,null));};};exports['agentNotify']=function(_0x511e03,_0x2d0061){var _0x8fbda1,_0x25d42d;if(_['isNil'](_0x511e03[_0xb814('0x22')]['channel'])){throw new Error(_0xb814('0x74'));}var _0x19d508=_0x511e03[_0xb814('0x22')][_0xb814('0x75')];var _0x4c8a00=_[_0xb814('0x76')](_0x19d508);var _0xc0ff3c=_0x19d508===_0xb814('0x77')?'Website':_0xb814('0x64');return db[_0xb814('0x78')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x511e03['params']['id'],'role':_0xb814('0x3c')}})[_0xb814('0xa')](function(_0x9dc06b){if(_[_0xb814('0x15')](_0x9dc06b)){throw new Error(_0xb814('0x79'));}_0x8fbda1=_0x9dc06b;return db[_0x4c8a00+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x511e03[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x4c8a00+_0xb814('0x6a')],'as':_0xb814('0x6a')},{'model':db[_0x4c8a00+_0xc0ff3c],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x5b8d2e){if(_['isNil'](_0x5b8d2e)){throw new Error(_0x4c8a00+_0xb814('0x6b'));}_0x25d42d=_0x5b8d2e;return _0x5b8d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3949fd={'uniqueid':_0x19d508+'.'+_0x25d42d['id']+'.'+_0x25d42d[_0xb814('0x6a')]['id'],'FromUserId':_0x511e03[_0xb814('0x2f')]['id'],'type':_0xb814('0x72'),'ToUserId':_0x8fbda1['id']};_0x3949fd[_0x4c8a00+_0xb814('0x6d')]=_0x25d42d['id'];_0x3949fd[_0x4c8a00+_0xb814('0x7a')]=_0x25d42d['Interaction']['id'];_0x3949fd['From'+_0x4c8a00+_0xc0ff3c+'Id']=_0x25d42d[_0xb814('0x64')]['id'];return db[_0x4c8a00+'TransferReport'][_0xb814('0x70')](_0x3949fd);})[_0xb814('0xa')](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x19d508,'interaction':_0x25d42d['Interaction'],'message':_0x25d42d,'account':_0x25d42d[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x3c'),'appdata':_0x8fbda1[_0xb814('0x13')]+','+(_0x25d42d[_0xb814('0x64')][_0xb814('0x7b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb814('0xa')](respondWithResult(_0x2d0061,null))[_0xb814('0xe')](handleError(_0x2d0061,null));}; \ No newline at end of file +var _0x5075=['api','client','http','then','error','message','result','status','json','name','send','isNil','rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','queue','InteractionId','From','QueueId','TransferReport','create','Start','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Agent\x20not\x20found','MessageId','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger'];(function(_0x5613de,_0x479c93){var _0x5b40cb=function(_0x5479ae){while(--_0x5479ae){_0x5613de['push'](_0x5613de['shift']());}};_0x5b40cb(++_0x479c93);}(_0x5075,0x73));var _0x5507=function(_0x3a223a,_0x303433){_0x3a223a=_0x3a223a-0x0;var _0xb6ac7d=_0x5075[_0x3a223a];return _0xb6ac7d;};'use strict';var BPromise=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));var _=require(_0x5507('0x2'));var util=require(_0x5507('0x3'));var db=require(_0x5507('0x4'))['db'];var logger=require(_0x5507('0x5'))(_0x5507('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x5507('0x7')][_0x5507('0x8')]({'port':0x232a});var mailClient=jayson[_0x5507('0x7')]['http']({'port':0x232b});var routingClient=jayson['client'][_0x5507('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x773559,_0x4c2d6d,_0x42c232){return new BPromise(function(_0x7cc84c,_0xbf4b50){var _0x504e05=_0x42c232?_0x42c232:amiClient;return _0x504e05['request'](_0x773559,_0x4c2d6d)[_0x5507('0x9')](function(_0x441bdc){if(_0x441bdc[_0x5507('0xa')]){if(_0x441bdc[_0x5507('0xa')]['code']===0x1f4){return _0xbf4b50(_0x441bdc[_0x5507('0xa')][_0x5507('0xb')]);}return _0x7cc84c(_0x441bdc['error'][_0x5507('0xb')]);}else{_0x7cc84c(_0x441bdc[_0x5507('0xc')]);}})['catch'](function(_0x37a1de){_0xbf4b50(_0x37a1de);});});}function respondWithResult(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xc8;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0xd')](_0x32c872)[_0x5507('0xe')](_0x267f27);}return _0x2a2ea0['sendStatus'](0x194);};}function handleError(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0x1f4;return function(_0xc828e5){logger[_0x5507('0xa')](_0xc828e5['stack']);if(_0xc828e5[_0x5507('0xf')]){delete _0xc828e5[_0x5507('0xf')];}_0x9cc3f9[_0x5507('0xd')](_0x2b7c43)[_0x5507('0x10')](_0xc828e5);};}function findById(_0xa6e4b3){return function(_0x2ede34){if(!_[_0x5507('0x11')](_0xa6e4b3)&&!_[_0x5507('0x11')](_0x2ede34)&&!_[_0x5507('0x11')](_0x2ede34[_0x5507('0x12')])){return _[_0x5507('0x13')](_0x2ede34[_0x5507('0x12')],function(_0x3822dd){return _0x3822dd['id']==_0xa6e4b3;});}return null;};}exports['voiceChannels']=function(_0x14dab0,_0x276a81){return respondWithRpcPromise(_0x5507('0x14'),_0x14dab0[_0x5507('0x15')])['then'](respondWithResult(_0x276a81,null))[_0x5507('0x16')](handleError(_0x276a81,null));};exports[_0x5507('0x17')]=function(_0x1a54b0,_0x3ca1f7){return respondWithRpcPromise(_0x5507('0x18'),_[_0x5507('0x19')](_0x1a54b0['query'],_0x1a54b0[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x3ca1f7,null))[_0x5507('0x16')](handleError(_0x3ca1f7,null));};exports[_0x5507('0x1b')]=function(_0x141d22,_0x2de482){return respondWithRpcPromise(_0x5507('0x1c'),_[_0x5507('0x19')](_0x141d22[_0x5507('0x15')],_0x141d22[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x2de482,null))[_0x5507('0x16')](handleError(_0x2de482,null));};exports[_0x5507('0x1d')]=function(_0x2ee6ed,_0x1a2203){return respondWithRpcPromise('VoiceQueues',_0x2ee6ed[_0x5507('0x15')])['then'](respondWithResult(_0x1a2203,null))[_0x5507('0x16')](handleError(_0x1a2203,null));};exports['showVoiceQueues']=function(_0xa66a01,_0x24668b){return respondWithRpcPromise('VoiceQueues',_0xa66a01['query'])[_0x5507('0x9')](findById(_0xa66a01[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x24668b,null))[_0x5507('0x16')](handleError(_0x24668b,null));};exports[_0x5507('0x1e')]=function(_0x85d383,_0x38f4d9){return respondWithRpcPromise(_0x5507('0x1f'),_[_0x5507('0x19')](_0x85d383['body'],_0x85d383[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x38f4d9,null))[_0x5507('0x16')](handleError(_0x38f4d9,null));};exports[_0x5507('0x20')]=function(_0x29dd58,_0x495bbe){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x5507('0x19')](_0x29dd58[_0x5507('0x15')],_0x29dd58[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x495bbe,null))['catch'](handleError(_0x495bbe,null));};exports[_0x5507('0x21')]=function(_0x13b6e5,_0xab91bc){return respondWithRpcPromise(_0x5507('0x22'),_0x13b6e5[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xab91bc,null))[_0x5507('0x16')](handleError(_0xab91bc,null));};exports[_0x5507('0x23')]=function(_0x5ede36,_0xf61ba7){return respondWithRpcPromise(_0x5507('0x24'),_[_0x5507('0x19')](_0x5ede36['query'],_0x5ede36['params']))[_0x5507('0x9')](respondWithResult(_0xf61ba7,null))[_0x5507('0x16')](handleError(_0xf61ba7,null));};exports[_0x5507('0x25')]=function(_0x17d01c,_0x143d97){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x17d01c[_0x5507('0x15')],_0x17d01c[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x143d97,null))[_0x5507('0x16')](handleError(_0x143d97,null));};exports['voiceQueuesChannelRedirect']=function(_0x54e4bd,_0x23ea7c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x5507('0x19')](_0x54e4bd[_0x5507('0x15')],_0x54e4bd[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x23ea7c,null))[_0x5507('0x16')](handleError(_0x23ea7c,null));};exports[_0x5507('0x26')]=function(_0x1c8506,_0x2b962d){return respondWithRpcPromise(_0x5507('0x27'),_0x1c8506[_0x5507('0x15')])['then'](respondWithResult(_0x2b962d,null))['catch'](handleError(_0x2b962d,null));};exports['outboundChannels']=function(_0x570eee,_0x526022){return respondWithRpcPromise(_0x5507('0x28'),_0x570eee[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x526022,null))[_0x5507('0x16')](handleError(_0x526022,null));};exports[_0x5507('0x29')]=function(_0xbef058,_0x101de3){var _0xbc9f93;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058[_0x5507('0x15')])[_0x5507('0x9')](function(_0x2db0b2){_0xbc9f93=_0x2db0b2;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058['query'],routingClient);})['then'](function(_0x50eb32){return _[_0x5507('0x19')]({},_0x50eb32,_0xbc9f93);})[_0x5507('0x9')](respondWithResult(_0x101de3,null))[_0x5507('0x16')](handleError(_0x101de3,null));};exports[_0x5507('0x2b')]=function(_0xcd4df5,_0x17d7db){if(_0xcd4df5[_0x5507('0x2c')]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]&&_0xcd4df5[_0x5507('0x2e')]&&_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')]){for(var _0x24d7b5 in _0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]){if(_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x5507('0x2f')](_0x24d7b5)){db[_0x5507('0x30')]['findAll']({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xcd4df5['body'][_0x5507('0x2d')][_0x24d7b5]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x5507('0x31')]?{'$notIn':_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5]}:{'$ne':null}}})[_0x5507('0x9')](function(_0x39ac17){var _0x1dfc9c=moment()['format'](_0x5507('0x32'));for(var _0x33022e=0x0,_0xadea4c=_0x39ac17[_0x5507('0x31')];_0x33022e<_0xadea4c;_0x33022e+=0x1){_0x39ac17[_0x33022e][_0x5507('0x33')]({'exitAt':_0x1dfc9c});}});for(var _0x48d72b=0x0;_0x48d72b<_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5][_0x5507('0x31')];_0x48d72b+=0x1){db[_0x5507('0x30')][_0x5507('0x34')]({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':_0x5507('0x35'),'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b],'exitAt':null},'defaults':{'channel':_0x24d7b5,'membername':_0xcd4df5['user'][_0x5507('0xf')],'interface':_[_0x5507('0x11')](_0xcd4df5['user']['interface'])?util['format'](_0x5507('0x36'),_0xcd4df5['user'][_0x5507('0xf')]):_0xcd4df5['user'][_0x5507('0x37')],'type':'INTERACTION','enterAt':moment()['format'](_0x5507('0x32')),'role':_0x5507('0x38'),'internal':_0xcd4df5[_0x5507('0x2e')][_0x5507('0x39')],'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xcd4df5[_0x5507('0x1a')]['id'],'capacity':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x3a')]},routingClient)['then'](respondWithResult(_0x17d7db,null))[_0x5507('0x16')](handleError(_0x17d7db,null));};exports[_0x5507('0x3b')]=function(_0x505e71,_0x2e0cfc){return respondWithRpcPromise(_0x5507('0x3c'),_0x505e71[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x2e0cfc,null))[_0x5507('0x16')](handleError(_0x2e0cfc,null));};exports[_0x5507('0x3d')]=function(_0x245456,_0x1bb575){return respondWithRpcPromise('Trunks',_0x245456['query'])[_0x5507('0x9')](respondWithResult(_0x1bb575,null))[_0x5507('0x16')](handleError(_0x1bb575,null));};exports[_0x5507('0x3e')]=function(_0x1b34c8,_0xce851d){return respondWithRpcPromise(_0x5507('0x3f'),_0x1b34c8[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xce851d,null))[_0x5507('0x16')](handleError(_0xce851d,null));};exports[_0x5507('0x40')]=function(_0x40cda2,_0x13dc8b){return respondWithRpcPromise(_0x5507('0x41'),_0x40cda2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x13dc8b,null))[_0x5507('0x16')](handleError(_0x13dc8b,null));};exports['showChatQueues']=function(_0x3f47af,_0x56e0cd){return respondWithRpcPromise('ChatQueues',_0x3f47af[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x3f47af[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x56e0cd,null))['catch'](handleError(_0x56e0cd,null));};exports[_0x5507('0x42')]=function(_0x2f41a9,_0x314d4e){return respondWithRpcPromise(_0x5507('0x43'),_0x2f41a9[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x314d4e,null))['catch'](handleError(_0x314d4e,null));};exports[_0x5507('0x44')]=function(_0x46e589,_0x3a2f9f){return respondWithRpcPromise('MailQueues',_0x46e589['query'],routingClient)[_0x5507('0x9')](findById(_0x46e589['params']['id']))[_0x5507('0x9')](respondWithResult(_0x3a2f9f,null))[_0x5507('0x16')](handleError(_0x3a2f9f,null));};exports['mailAccounts']=function(_0x3e796d,_0x1b622f){return respondWithRpcPromise(_0x5507('0x45'),_0x3e796d[_0x5507('0x15')],mailClient)[_0x5507('0x9')](respondWithResult(_0x1b622f,null))[_0x5507('0x16')](handleError(_0x1b622f,null));};exports[_0x5507('0x46')]=function(_0x2928f2,_0x737d39){return respondWithRpcPromise(_0x5507('0x47'),_0x2928f2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x737d39,null))['catch'](handleError(_0x737d39,null));};exports[_0x5507('0x48')]=function(_0x2e904b,_0x219e34){return respondWithRpcPromise(_0x5507('0x47'),_0x2e904b[_0x5507('0x15')],routingClient)['then'](findById(_0x2e904b[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x219e34,null))[_0x5507('0x16')](handleError(_0x219e34,null));};exports[_0x5507('0x49')]=function(_0x241733,_0x54c009){return respondWithRpcPromise(_0x5507('0x4a'),_0x241733[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x54c009,null))['catch'](handleError(_0x54c009,null));};exports[_0x5507('0x4b')]=function(_0x5cfdb0,_0x3dca7d){return respondWithRpcPromise('SmsQueues',_0x5cfdb0['query'],routingClient)[_0x5507('0x9')](findById(_0x5cfdb0[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x3dca7d,null))[_0x5507('0x16')](handleError(_0x3dca7d,null));};exports[_0x5507('0x4c')]=function(_0x31cc0d,_0x4bf567){return respondWithRpcPromise('WhatsappQueues',_0x31cc0d[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4bf567,null))[_0x5507('0x16')](handleError(_0x4bf567,null));};exports[_0x5507('0x4d')]=function(_0x5e3e73,_0x388faa){return respondWithRpcPromise(_0x5507('0x4e'),_0x5e3e73[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x5e3e73[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x388faa,null))[_0x5507('0x16')](handleError(_0x388faa,null));};exports['faxQueues']=function(_0x3802dd,_0xfdbbe5){return respondWithRpcPromise(_0x5507('0x4f'),_0x3802dd['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xfdbbe5,null))['catch'](handleError(_0xfdbbe5,null));};exports['showFaxQueues']=function(_0x55c257,_0x1fef49){return respondWithRpcPromise(_0x5507('0x4f'),_0x55c257[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x55c257[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x1fef49,null))[_0x5507('0x16')](handleError(_0x1fef49,null));};exports['faxAccounts']=function(_0x1812d7,_0x48ed80){return respondWithRpcPromise(_0x5507('0x50'),_0x1812d7[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x48ed80,null))[_0x5507('0x16')](handleError(_0x48ed80,null));};exports[_0x5507('0x51')]=function(_0x120108,_0x4423a8){return respondWithRpcPromise(_0x5507('0x52'),_0x120108[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4423a8,null))[_0x5507('0x16')](handleError(_0x4423a8,null));};exports['mailQueuesWaitingInteractions']=function(_0x94b11c,_0xbb0a62){return respondWithRpcPromise(_0x5507('0x53'),_0x94b11c['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xbb0a62,null))[_0x5507('0x16')](handleError(_0xbb0a62,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x26e777,_0x5815fb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x26e777[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x5815fb,null))[_0x5507('0x16')](handleError(_0x5815fb,null));};exports[_0x5507('0x54')]=function(_0xfb59be,_0xda51d5){return respondWithRpcPromise(_0x5507('0x55'),_0xfb59be[_0x5507('0x15')],routingClient)['then'](function(_0x43fccf){if(_0xfb59be[_0x5507('0x15')][_0x5507('0x56')]!==undefined){var _0x75aa3c=_(_0x43fccf[_0x5507('0x12')])[_0x5507('0x57')]([_0xfb59be[_0x5507('0x15')][_0x5507('0x56')],_0xfb59be[_0x5507('0x1a')]['id']])[_0x5507('0x58')](_0x5507('0x59'))[_0x5507('0x5a')]()['value']();return _0x43fccf[_0x5507('0x12')][_0x5507('0x57')](function(_0x10f066){return _0x75aa3c[_0x5507('0x5b')](_0x10f066[_0x5507('0x59')])>-0x1;});}else{return _0x43fccf[_0x5507('0x12')]['filter'](function(_0x1dad83){return _0x1dad83['queue_id']===parseInt(_0xfb59be[_0x5507('0x1a')]['id']);});}})['then'](respondWithResult(_0xda51d5,null))['catch'](handleError(_0xda51d5,null));};exports[_0x5507('0x5c')]=function(_0x20274e,_0x2979b1){return respondWithRpcPromise(_0x5507('0x5d'),_0x20274e[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x2979b1,null))[_0x5507('0x16')](handleError(_0x2979b1,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x410c16,_0x471142){return respondWithRpcPromise(_0x5507('0x5e'),_0x410c16[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x471142,null))[_0x5507('0x16')](handleError(_0x471142,null));};exports[_0x5507('0x5f')]=function(_0x42bef4,_0x5a8a1b){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x42bef4[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x5a8a1b,null))[_0x5507('0x16')](handleError(_0x5a8a1b,null));};exports[_0x5507('0x60')]=function(_0x77a772){return function(_0x26f796,_0x3d7e21){var _0x10b62e,_0x18bed6;var _0x27265e=_[_0x5507('0x61')](_0x77a772);var _0x160e54=_0x77a772==='chat'?_0x5507('0x62'):_0x5507('0x63');return db[_0x27265e+_0x5507('0x64')][_0x5507('0x65')]({'raw':!![],'where':{'id':_0x26f796[_0x5507('0x1a')]['id']}})[_0x5507('0x9')](function(_0x33717e){if(_['isNil'](_0x33717e)){throw new Error(_0x27265e+_0x5507('0x66'));}_0x10b62e=_0x33717e;return db[_0x27265e+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x26f796[_0x5507('0x2c')]['messageId']},'include':[{'model':db[_0x27265e+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x27265e+_0x160e54],'as':_0x5507('0x63')}]});})[_0x5507('0x9')](function(_0x1a5d2e){if(_[_0x5507('0x11')](_0x1a5d2e)){throw new Error(_0x27265e+_0x5507('0x69'));}_0x18bed6=_0x1a5d2e;return _0x1a5d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x38144b={'uniqueid':_0x77a772+'.'+_0x18bed6['id']+'.'+_0x18bed6[_0x5507('0x68')]['id'],'FromUserId':_0x26f796[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a')};_0x38144b[_0x27265e+'MessageId']=_0x18bed6['id'];_0x38144b[_0x27265e+_0x5507('0x6b')]=_0x18bed6[_0x5507('0x68')]['id'];_0x38144b[_0x5507('0x6c')+_0x27265e+_0x160e54+'Id']=_0x18bed6[_0x5507('0x63')]['id'];_0x38144b['To'+_0x27265e+_0x5507('0x6d')]=_0x10b62e['id'];return db[_0x27265e+_0x5507('0x6e')][_0x5507('0x6f')](_0x38144b);})[_0x5507('0x9')](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x77a772,'interaction':_0x18bed6[_0x5507('0x68')],'message':_0x18bed6,'account':_0x18bed6[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5507('0x6a'),'appdata':_0x10b62e[_0x5507('0xf')]+','+(_0x18bed6['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x3d7e21,null))[_0x5507('0x16')](handleError(_0x3d7e21,null));};};exports[_0x5507('0x71')]=function(_0x3b04a7,_0x1e913a){var _0x4e1578,_0x2339c7;if(_[_0x5507('0x11')](_0x3b04a7[_0x5507('0x2c')]['channel'])){throw new Error(_0x5507('0x72'));}var _0x5808d9=_0x3b04a7['body'][_0x5507('0x73')];var _0x58b56c=_[_0x5507('0x61')](_0x5808d9);var _0x5c6043=_0x5808d9===_0x5507('0x74')?_0x5507('0x62'):_0x5507('0x63');return db['User']['findOne']({'raw':!![],'where':{'id':_0x3b04a7[_0x5507('0x1a')]['id'],'role':_0x5507('0x38')}})[_0x5507('0x9')](function(_0x51bec0){if(_[_0x5507('0x11')](_0x51bec0)){throw new Error(_0x5507('0x75'));}_0x4e1578=_0x51bec0;return db[_0x58b56c+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x3b04a7['body']['messageId']},'include':[{'model':db[_0x58b56c+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x58b56c+_0x5c6043],'as':'Account'}]});})[_0x5507('0x9')](function(_0x13c0f5){if(_[_0x5507('0x11')](_0x13c0f5)){throw new Error(_0x58b56c+_0x5507('0x69'));}_0x2339c7=_0x13c0f5;return _0x13c0f5['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x3a2b0f={'uniqueid':_0x5808d9+'.'+_0x2339c7['id']+'.'+_0x2339c7['Interaction']['id'],'FromUserId':_0x3b04a7[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a'),'ToUserId':_0x4e1578['id']};_0x3a2b0f[_0x58b56c+_0x5507('0x76')]=_0x2339c7['id'];_0x3a2b0f[_0x58b56c+'InteractionId']=_0x2339c7[_0x5507('0x68')]['id'];_0x3a2b0f[_0x5507('0x6c')+_0x58b56c+_0x5c6043+'Id']=_0x2339c7['Account']['id'];return db[_0x58b56c+_0x5507('0x6e')][_0x5507('0x6f')](_0x3a2b0f);})['then'](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x5808d9,'interaction':_0x2339c7[_0x5507('0x68')],'message':_0x2339c7,'account':_0x2339c7[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4e1578[_0x5507('0xf')]+','+(_0x2339c7[_0x5507('0x63')][_0x5507('0x77')]||0x12c),'interval':_0x5507('0x78')}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x1e913a,null))[_0x5507('0x16')](handleError(_0x1e913a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 11ed7cb..afab421 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 _0x4289=['./schedule.controller','isAuthenticated','index','/:id','show','get','run','post','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x18a1a6,_0x49d08f){var _0x2bf094=function(_0x1d4f58){while(--_0x1d4f58){_0x18a1a6['push'](_0x18a1a6['shift']());}};_0x2bf094(++_0x49d08f);}(_0x4289,0x1c2));var _0x9428=function(_0x3eaf26,_0x3956bd){_0x3eaf26=_0x3eaf26-0x0;var _0x427c0c=_0x4289[_0x3eaf26];return _0x427c0c;};'use strict';var multer=require(_0x9428('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9428('0x1')]();var fs_extra=require(_0x9428('0x2'));var auth=require(_0x9428('0x3'));var interaction=require(_0x9428('0x4'));var config=require(_0x9428('0x5'));var controller=require(_0x9428('0x6'));router['get']('/',auth[_0x9428('0x7')](),controller[_0x9428('0x8')]);router['get'](_0x9428('0x9'),auth[_0x9428('0x7')](),controller[_0x9428('0xa')]);router[_0x9428('0xb')]('/:id/run',auth['isAuthenticated'](),controller[_0x9428('0xc')]);router[_0x9428('0xd')]('/',auth[_0x9428('0x7')](),controller['create']);router[_0x9428('0xe')](_0x9428('0x9'),auth[_0x9428('0x7')](),controller[_0x9428('0xf')]);router[_0x9428('0x10')]('/:id',auth[_0x9428('0x7')](),controller[_0x9428('0x11')]);module[_0x9428('0x12')]=router; \ No newline at end of file +var _0xaa6c=['put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post'];(function(_0x272a88,_0x57e586){var _0x5c71c4=function(_0x8151b3){while(--_0x8151b3){_0x272a88['push'](_0x272a88['shift']());}};_0x5c71c4(++_0x57e586);}(_0xaa6c,0xea));var _0xcaa6=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0xaa6c[_0x18cac4];return _0x2227c6;};'use strict';var multer=require(_0xcaa6('0x0'));var util=require(_0xcaa6('0x1'));var path=require(_0xcaa6('0x2'));var timeout=require(_0xcaa6('0x3'));var express=require(_0xcaa6('0x4'));var router=express[_0xcaa6('0x5')]();var fs_extra=require(_0xcaa6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcaa6('0x7'));var config=require(_0xcaa6('0x8'));var controller=require(_0xcaa6('0x9'));router['get']('/',auth[_0xcaa6('0xa')](),controller[_0xcaa6('0xb')]);router[_0xcaa6('0xc')](_0xcaa6('0xd'),auth['isAuthenticated'](),controller[_0xcaa6('0xe')]);router[_0xcaa6('0xc')](_0xcaa6('0xf'),auth['isAuthenticated'](),controller[_0xcaa6('0x10')]);router[_0xcaa6('0x11')]('/',auth[_0xcaa6('0xa')](),controller['create']);router[_0xcaa6('0x12')](_0xcaa6('0xd'),auth[_0xcaa6('0xa')](),controller['update']);router['delete'](_0xcaa6('0xd'),auth[_0xcaa6('0xa')](),controller[_0xcaa6('0x13')]);module[_0xcaa6('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index d2a9300..bd82842 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 _0x2058=['pdf','xlsx','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','months','weeks','days','hours','minutes','ENUM','csv'];(function(_0x5a594d,_0x5cd018){var _0x45a07e=function(_0x3a63de){while(--_0x3a63de){_0x5a594d['push'](_0x5a594d['shift']());}};_0x45a07e(++_0x5cd018);}(_0x2058,0xb4));var _0x8205=function(_0x3f042c,_0x3d2cfe){_0x3f042c=_0x3f042c-0x0;var _0x280d2e=_0x2058[_0x3f042c];return _0x280d2e;};'use strict';var Sequelize=require('sequelize');module[_0x8205('0x0')]={'name':{'type':Sequelize[_0x8205('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8205('0x1')]},'active':{'type':Sequelize[_0x8205('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8205('0x1')],'allowNull':![],'defaultValue':_0x8205('0x3')},'startAt':{'type':Sequelize[_0x8205('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8205('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters',_0x8205('0x5'),_0x8205('0x6'),_0x8205('0x7'),_0x8205('0x8'),_0x8205('0x9')),'allowNull':![],'defaultValue':_0x8205('0x7')},'output':{'type':Sequelize[_0x8205('0xa')](_0x8205('0xb'),_0x8205('0xc'),_0x8205('0xd')),'allowNull':![],'defaultValue':_0x8205('0xb')},'type':{'type':Sequelize[_0x8205('0xa')](_0x8205('0xe'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x8205('0x1')]},'cc':{'type':Sequelize[_0x8205('0xf')]},'bcc':{'type':Sequelize[_0x8205('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x8205('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1f7e=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','quarters','weeks','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize'];(function(_0x53b8cc,_0x405198){var _0x2cee95=function(_0x5cd015){while(--_0x5cd015){_0x53b8cc['push'](_0x53b8cc['shift']());}};_0x2cee95(++_0x405198);}(_0x1f7e,0x98));var _0xe1f7=function(_0x292941,_0x58ca24){_0x292941=_0x292941-0x0;var _0x32fe89=_0x1f7e[_0x292941];return _0x32fe89;};'use strict';var Sequelize=require(_0xe1f7('0x0'));module['exports']={'name':{'type':Sequelize[_0xe1f7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe1f7('0x1')]},'active':{'type':Sequelize[_0xe1f7('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe1f7('0x1')],'allowNull':![],'defaultValue':_0xe1f7('0x3')},'startAt':{'type':Sequelize[_0xe1f7('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe1f7('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xe1f7('0x5'),'months',_0xe1f7('0x6'),_0xe1f7('0x7'),_0xe1f7('0x8'),_0xe1f7('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xe1f7('0xa')](_0xe1f7('0xb'),_0xe1f7('0xc'),_0xe1f7('0xd')),'allowNull':![],'defaultValue':_0xe1f7('0xb')},'type':{'type':Sequelize['ENUM'](_0xe1f7('0xe'),_0xe1f7('0xf')),'allowNull':![],'defaultValue':_0xe1f7('0xe')},'sendMail':{'type':Sequelize[_0xe1f7('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe1f7('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xe1f7('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 5950eff..1842149 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 _0xaa7e=['model','query','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','keys','length','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','Scheduler','UserProfileResource','end','sendStatus','error','stack','name','index','map','Schedule','rawAttributes','type','key'];(function(_0x2ce709,_0x41ab1e){var _0x908e80=function(_0x1a6675){while(--_0x1a6675){_0x2ce709['push'](_0x2ce709['shift']());}};_0x908e80(++_0x41ab1e);}(_0xaa7e,0x113));var _0xeaa7=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0xaa7e[_0x4314d7];return _0x5c599b;};'use strict';var emlformat=require(_0xeaa7('0x0'));var rimraf=require(_0xeaa7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeaa7('0x2'));var rp=require(_0xeaa7('0x3'));var moment=require(_0xeaa7('0x4'));var BPromise=require(_0xeaa7('0x5'));var Mustache=require(_0xeaa7('0x6'));var util=require(_0xeaa7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeaa7('0x8'));var ejs=require(_0xeaa7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeaa7('0xa'));var squel=require('squel');var crypto=require(_0xeaa7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xeaa7('0xc'));var toCsv=require(_0xeaa7('0x8'));var querystring=require(_0xeaa7('0xd'));var Papa=require(_0xeaa7('0xe'));var Redis=require(_0xeaa7('0xf'));var authService=require(_0xeaa7('0x10'));var qs=require(_0xeaa7('0x11'));var as=require(_0xeaa7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaa7('0x13'))(_0xeaa7('0x14'));var utils=require(_0xeaa7('0x15'));var config=require(_0xeaa7('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c3dc,_0x2051d8){_0x2051d8=_0x2051d8||0xcc;return function(_0x4790e6){if(_0x4790e6){return _0x51c3dc['sendStatus'](_0x2051d8);}return _0x51c3dc[_0xeaa7('0x17')](_0x2051d8)['end']();};}function respondWithResult(_0x6b5cfe,_0x265c0a){_0x265c0a=_0x265c0a||0xc8;return function(_0xd64a26){if(_0xd64a26){return _0x6b5cfe[_0xeaa7('0x17')](_0x265c0a)[_0xeaa7('0x18')](_0xd64a26);}};}function respondWithFilteredResult(_0x4d0f23,_0x16f6ac){return function(_0x30edc5){if(_0x30edc5){var _0x38eafb=typeof _0x16f6ac[_0xeaa7('0x19')]===_0xeaa7('0x1a')&&typeof _0x16f6ac[_0xeaa7('0x1b')]===_0xeaa7('0x1a');var _0x4f8e60=_0x30edc5['count'];var _0x1a37ba=_0x38eafb?0x0:_0x16f6ac[_0xeaa7('0x19')];var _0x323e08=_0x38eafb?_0x30edc5['count']:_0x16f6ac['offset']+_0x16f6ac[_0xeaa7('0x1b')];var _0x4a8ea3;if(_0x323e08>=_0x4f8e60){_0x323e08=_0x4f8e60;_0x4a8ea3=0xc8;}else{_0x4a8ea3=0xce;}_0x4d0f23[_0xeaa7('0x17')](_0x4a8ea3);return _0x4d0f23[_0xeaa7('0x1c')](_0xeaa7('0x1d'),_0x1a37ba+'-'+_0x323e08+'/'+_0x4f8e60)[_0xeaa7('0x18')](_0x30edc5);}return null;};}function patchUpdates(_0x3a9c1f){return function(_0x292b90){try{jsonpatch[_0xeaa7('0x1e')](_0x292b90,_0x3a9c1f,!![]);}catch(_0x431d91){return BPromise[_0xeaa7('0x1f')](_0x431d91);}return _0x292b90[_0xeaa7('0x20')]();};}function saveUpdates(_0x27388f,_0x5062db){return function(_0x26c452){if(_0x26c452){return _0x26c452[_0xeaa7('0x21')](_0x27388f)['then'](function(_0x290e16){return _0x290e16;});}return null;};}function removeEntity(_0x517d7c,_0x52f590){return function(_0x4fa59f){if(_0x4fa59f){return _0x4fa59f[_0xeaa7('0x22')]()[_0xeaa7('0x23')](function(){var _0x6eb8b8=_0x4fa59f['get']({'plain':!![]});var _0x408843=_0xeaa7('0x24');return db[_0xeaa7('0x25')][_0xeaa7('0x22')]({'where':{'type':_0x408843,'resourceId':_0x6eb8b8['id']}})['then'](function(){return _0x4fa59f;});})[_0xeaa7('0x23')](function(){_0x517d7c[_0xeaa7('0x17')](0xcc)[_0xeaa7('0x26')]();});}};}function handleEntityNotFound(_0x20394b,_0x2b1abc){return function(_0x9f00c6){if(!_0x9f00c6){_0x20394b[_0xeaa7('0x27')](0x194);}return _0x9f00c6;};}function handleError(_0x1f051f,_0x246bae){_0x246bae=_0x246bae||0x1f4;return function(_0xddcbac){logger[_0xeaa7('0x28')](_0xddcbac[_0xeaa7('0x29')]);if(_0xddcbac[_0xeaa7('0x2a')]){delete _0xddcbac['name'];}_0x1f051f[_0xeaa7('0x17')](_0x246bae)['send'](_0xddcbac);};}exports[_0xeaa7('0x2b')]=function(_0x4a339d,_0x16c733){var _0x455090={},_0x24b9d2={},_0xc24d3d={'count':0x0,'rows':[]};var _0x4b180d=_[_0xeaa7('0x2c')](db[_0xeaa7('0x2d')][_0xeaa7('0x2e')],function(_0x72e863){return{'name':_0x72e863['fieldName'],'type':_0x72e863[_0xeaa7('0x2f')][_0xeaa7('0x30')]};});_0x24b9d2[_0xeaa7('0x31')]=_[_0xeaa7('0x2c')](_0x4b180d,_0xeaa7('0x2a'));_0x24b9d2[_0xeaa7('0x32')]=_['keys'](_0x4a339d[_0xeaa7('0x32')]);_0x24b9d2[_0xeaa7('0x33')]=_['intersection'](_0x24b9d2[_0xeaa7('0x31')],_0x24b9d2[_0xeaa7('0x32')]);_0x455090[_0xeaa7('0x34')]=_[_0xeaa7('0x35')](_0x24b9d2[_0xeaa7('0x31')],qs[_0xeaa7('0x36')](_0x4a339d['query'][_0xeaa7('0x36')]));_0x455090[_0xeaa7('0x34')]=_0x455090['attributes']['length']?_0x455090['attributes']:_0x24b9d2[_0xeaa7('0x31')];if(!_0x4a339d[_0xeaa7('0x32')]['hasOwnProperty'](_0xeaa7('0x37'))){_0x455090['limit']=qs[_0xeaa7('0x1b')](_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x1b')]);_0x455090[_0xeaa7('0x19')]=qs[_0xeaa7('0x19')](_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x19')]);}_0x455090['order']=qs[_0xeaa7('0x38')](_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x38')]);_0x455090[_0xeaa7('0x39')]=qs[_0xeaa7('0x33')](_[_0xeaa7('0x3a')](_0x4a339d['query'],_0x24b9d2[_0xeaa7('0x33')]),_0x4b180d);if(_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x3b')]){_0x455090['where']=_[_0xeaa7('0x3c')](_0x455090[_0xeaa7('0x39')],{'$or':_[_0xeaa7('0x2c')](_0x4b180d,function(_0x571b11){if(_0x571b11[_0xeaa7('0x2f')]!==_0xeaa7('0x3d')){var _0x41504c={};_0x41504c[_0x571b11[_0xeaa7('0x2a')]]={'$like':'%'+_0x4a339d[_0xeaa7('0x32')]['filter']+'%'};return _0x41504c;}})});}_0x455090=_[_0xeaa7('0x3c')]({},_0x455090,_0x4a339d['options']);var _0x1f7e6c={'where':_0x455090[_0xeaa7('0x39')]};return db['Schedule']['count'](_0x1f7e6c)[_0xeaa7('0x23')](function(_0x7bc269){_0xc24d3d['count']=_0x7bc269;if(_0x4a339d['query'][_0xeaa7('0x3e')]){_0x455090['include']=[{'all':!![]}];}return db[_0xeaa7('0x2d')][_0xeaa7('0x3f')](_0x455090);})[_0xeaa7('0x23')](function(_0x1c1fac){_0xc24d3d['rows']=_0x1c1fac;return _0xc24d3d;})[_0xeaa7('0x23')](respondWithFilteredResult(_0x16c733,_0x455090))[_0xeaa7('0x40')](handleError(_0x16c733,null));};exports['show']=function(_0x5625b4,_0x5d9c6a){var _0x317fd9={'raw':![],'where':{'id':_0x5625b4['params']['id']}},_0x44a1ff={};_0x44a1ff[_0xeaa7('0x31')]=_[_0xeaa7('0x41')](db['Schedule'][_0xeaa7('0x2e')]);_0x44a1ff[_0xeaa7('0x32')]=_[_0xeaa7('0x41')](_0x5625b4['query']);_0x44a1ff[_0xeaa7('0x33')]=_[_0xeaa7('0x35')](_0x44a1ff[_0xeaa7('0x31')],_0x44a1ff[_0xeaa7('0x32')]);_0x317fd9['attributes']=_[_0xeaa7('0x35')](_0x44a1ff[_0xeaa7('0x31')],qs[_0xeaa7('0x36')](_0x5625b4[_0xeaa7('0x32')]['fields']));_0x317fd9[_0xeaa7('0x34')]=_0x317fd9[_0xeaa7('0x34')][_0xeaa7('0x42')]?_0x317fd9[_0xeaa7('0x34')]:_0x44a1ff[_0xeaa7('0x31')];if(_0x5625b4['query'][_0xeaa7('0x3e')]){_0x317fd9[_0xeaa7('0x43')]=[{'all':!![]}];}_0x317fd9=_[_0xeaa7('0x3c')]({},_0x317fd9,_0x5625b4['options']);return db[_0xeaa7('0x2d')]['find'](_0x317fd9)[_0xeaa7('0x23')](handleEntityNotFound(_0x5d9c6a,null))[_0xeaa7('0x23')](respondWithResult(_0x5d9c6a,null))[_0xeaa7('0x40')](handleError(_0x5d9c6a,null));};exports[_0xeaa7('0x44')]=function(_0x3362c3,_0x42883e){return db['Schedule'][_0xeaa7('0x44')](_0x3362c3[_0xeaa7('0x45')],{})[_0xeaa7('0x23')](function(_0x327f13){var _0x1eb8ac=_0x3362c3['user']['get']({'plain':!![]});if(!_0x1eb8ac)throw new Error(_0xeaa7('0x46'));if(_0x1eb8ac[_0xeaa7('0x47')]===_0xeaa7('0x48')){var _0xc6c9a2=_0x327f13[_0xeaa7('0x49')]({'plain':!![]});var _0x1affe6=_0xeaa7('0x24');return db['UserProfileSection'][_0xeaa7('0x4a')]({'where':{'name':_0x1affe6,'userProfileId':_0x1eb8ac[_0xeaa7('0x4b')]},'raw':!![]})[_0xeaa7('0x23')](function(_0x51344b){if(_0x51344b&&_0x51344b[_0xeaa7('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0xc6c9a2[_0xeaa7('0x2a')],'resourceId':_0xc6c9a2['id'],'type':_0x51344b[_0xeaa7('0x2a')],'sectionId':_0x51344b['id']},{})[_0xeaa7('0x23')](function(){return _0x327f13;});}else{return _0x327f13;}})[_0xeaa7('0x40')](function(_0x51abf2){logger[_0xeaa7('0x28')](_0xeaa7('0x4d'),_0x51abf2);throw _0x51abf2;});}return _0x327f13;})[_0xeaa7('0x23')](respondWithResult(_0x42883e,0xc9))[_0xeaa7('0x40')](handleError(_0x42883e,null));};exports[_0xeaa7('0x21')]=function(_0xcd6af6,_0x457c8e){if(_0xcd6af6[_0xeaa7('0x45')]['id']){delete _0xcd6af6['body']['id'];}return db[_0xeaa7('0x2d')][_0xeaa7('0x4a')]({'where':{'id':_0xcd6af6[_0xeaa7('0x4e')]['id']}})[_0xeaa7('0x23')](handleEntityNotFound(_0x457c8e,null))[_0xeaa7('0x23')](saveUpdates(_0xcd6af6[_0xeaa7('0x45')],null))[_0xeaa7('0x23')](respondWithResult(_0x457c8e,null))[_0xeaa7('0x40')](handleError(_0x457c8e,null));};exports[_0xeaa7('0x22')]=function(_0x1d04ee,_0x3de828){return db[_0xeaa7('0x2d')][_0xeaa7('0x4a')]({'where':{'id':_0x1d04ee[_0xeaa7('0x4e')]['id']}})[_0xeaa7('0x23')](handleEntityNotFound(_0x3de828,null))['then'](removeEntity(_0x3de828,null))[_0xeaa7('0x40')](handleError(_0x3de828,null));};exports[_0xeaa7('0x4f')]=function(_0x719e9c,_0x147865,_0xe3ca32){var _0x46ce68=require(_0xeaa7('0x50'));return db['Schedule'][_0xeaa7('0x4a')]({'where':{'id':_0x719e9c[_0xeaa7('0x4e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x147865,null))[_0xeaa7('0x23')](function(){_0x46ce68[_0xeaa7('0x4f')](_0x719e9c['params']['id']);})[_0xeaa7('0x23')](respondWithStatusCode(_0x147865,null))[_0xeaa7('0x40')](handleError(_0x147865,null));}; \ No newline at end of file +var _0x0646=['where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','status','sendStatus','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort'];(function(_0x7c0646,_0x45d16b){var _0x32416d=function(_0x22abdd){while(--_0x22abdd){_0x7c0646['push'](_0x7c0646['shift']());}};_0x32416d(++_0x45d16b);}(_0x0646,0xc5));var _0x6064=function(_0x251fa8,_0x3f21d1){_0x251fa8=_0x251fa8-0x0;var _0x4f8563=_0x0646[_0x251fa8];return _0x4f8563;};'use strict';var emlformat=require(_0x6064('0x0'));var rimraf=require(_0x6064('0x1'));var zipdir=require(_0x6064('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6064('0x3'));var moment=require(_0x6064('0x4'));var BPromise=require(_0x6064('0x5'));var Mustache=require(_0x6064('0x6'));var util=require('util');var path=require(_0x6064('0x7'));var sox=require(_0x6064('0x8'));var csv=require(_0x6064('0x9'));var ejs=require(_0x6064('0xa'));var fs=require('fs');var fs_extra=require(_0x6064('0xb'));var _=require(_0x6064('0xc'));var squel=require(_0x6064('0xd'));var crypto=require(_0x6064('0xe'));var jsforce=require(_0x6064('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6064('0x10'));var Papa=require(_0x6064('0x11'));var Redis=require(_0x6064('0x12'));var authService=require(_0x6064('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6064('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6064('0x15'))(_0x6064('0x16'));var utils=require('../../config/utils');var config=require(_0x6064('0x17'));var licenseUtil=require(_0x6064('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124b03,_0xc305d6){_0xc305d6=_0xc305d6||0xcc;return function(_0x3204e6){if(_0x3204e6){return _0x124b03['sendStatus'](_0xc305d6);}return _0x124b03['status'](_0xc305d6)[_0x6064('0x19')]();};}function respondWithResult(_0x576557,_0x2a0afa){_0x2a0afa=_0x2a0afa||0xc8;return function(_0x4e4225){if(_0x4e4225){return _0x576557['status'](_0x2a0afa)['json'](_0x4e4225);}};}function respondWithFilteredResult(_0x5c8023,_0x3a70ef){return function(_0x1a2f6e){if(_0x1a2f6e){var _0x35dbbc=typeof _0x3a70ef[_0x6064('0x1a')]===_0x6064('0x1b')&&typeof _0x3a70ef[_0x6064('0x1c')]===_0x6064('0x1b');var _0x5079f8=_0x1a2f6e['count'];var _0xd4d813=_0x35dbbc?0x0:_0x3a70ef[_0x6064('0x1a')];var _0x12a2f6=_0x35dbbc?_0x1a2f6e[_0x6064('0x1d')]:_0x3a70ef[_0x6064('0x1a')]+_0x3a70ef[_0x6064('0x1c')];var _0x12269a;if(_0x12a2f6>=_0x5079f8){_0x12a2f6=_0x5079f8;_0x12269a=0xc8;}else{_0x12269a=0xce;}_0x5c8023['status'](_0x12269a);return _0x5c8023['set'](_0x6064('0x1e'),_0xd4d813+'-'+_0x12a2f6+'/'+_0x5079f8)['json'](_0x1a2f6e);}return null;};}function patchUpdates(_0x208c7e){return function(_0xf1adb3){try{jsonpatch[_0x6064('0x1f')](_0xf1adb3,_0x208c7e,!![]);}catch(_0x38e207){return BPromise['reject'](_0x38e207);}return _0xf1adb3[_0x6064('0x20')]();};}function saveUpdates(_0x1df9dd,_0x4eb05c){return function(_0x1f33c6){if(_0x1f33c6){return _0x1f33c6[_0x6064('0x21')](_0x1df9dd)[_0x6064('0x22')](function(_0x12e2a0){return _0x12e2a0;});}return null;};}function removeEntity(_0x193ae5,_0x59d2cc){return function(_0x5b10ec){if(_0x5b10ec){return _0x5b10ec[_0x6064('0x23')]()[_0x6064('0x22')](function(){var _0x2147df=_0x5b10ec[_0x6064('0x24')]({'plain':!![]});var _0x2a1008=_0x6064('0x25');return db[_0x6064('0x26')]['destroy']({'where':{'type':_0x2a1008,'resourceId':_0x2147df['id']}})['then'](function(){return _0x5b10ec;});})[_0x6064('0x22')](function(){_0x193ae5[_0x6064('0x27')](0xcc)[_0x6064('0x19')]();});}};}function handleEntityNotFound(_0x311c42,_0x5a2be4){return function(_0x41559e){if(!_0x41559e){_0x311c42[_0x6064('0x28')](0x194);}return _0x41559e;};}function handleError(_0x30bbf5,_0x39b601){_0x39b601=_0x39b601||0x1f4;return function(_0x53d401){logger['error'](_0x53d401[_0x6064('0x29')]);if(_0x53d401[_0x6064('0x2a')]){delete _0x53d401[_0x6064('0x2a')];}_0x30bbf5[_0x6064('0x27')](_0x39b601)[_0x6064('0x2b')](_0x53d401);};}exports[_0x6064('0x2c')]=function(_0x19469c,_0x4aee72){var _0x50b510={},_0x4bb170={},_0x34865a={'count':0x0,'rows':[]};var _0x31a73a=_[_0x6064('0x2d')](db[_0x6064('0x2e')][_0x6064('0x2f')],function(_0x2ac45f){return{'name':_0x2ac45f[_0x6064('0x30')],'type':_0x2ac45f['type'][_0x6064('0x31')]};});_0x4bb170['model']=_[_0x6064('0x2d')](_0x31a73a,_0x6064('0x2a'));_0x4bb170[_0x6064('0x32')]=_[_0x6064('0x33')](_0x19469c[_0x6064('0x32')]);_0x4bb170['filters']=_[_0x6064('0x34')](_0x4bb170['model'],_0x4bb170[_0x6064('0x32')]);_0x50b510[_0x6064('0x35')]=_[_0x6064('0x34')](_0x4bb170['model'],qs[_0x6064('0x36')](_0x19469c[_0x6064('0x32')][_0x6064('0x36')]));_0x50b510[_0x6064('0x35')]=_0x50b510[_0x6064('0x35')][_0x6064('0x37')]?_0x50b510[_0x6064('0x35')]:_0x4bb170[_0x6064('0x38')];if(!_0x19469c[_0x6064('0x32')][_0x6064('0x39')](_0x6064('0x3a'))){_0x50b510[_0x6064('0x1c')]=qs[_0x6064('0x1c')](_0x19469c[_0x6064('0x32')][_0x6064('0x1c')]);_0x50b510[_0x6064('0x1a')]=qs[_0x6064('0x1a')](_0x19469c[_0x6064('0x32')]['offset']);}_0x50b510[_0x6064('0x3b')]=qs['sort'](_0x19469c[_0x6064('0x32')][_0x6064('0x3c')]);_0x50b510[_0x6064('0x3d')]=qs[_0x6064('0x3e')](_[_0x6064('0x3f')](_0x19469c[_0x6064('0x32')],_0x4bb170[_0x6064('0x3e')]),_0x31a73a);if(_0x19469c[_0x6064('0x32')][_0x6064('0x40')]){_0x50b510[_0x6064('0x3d')]=_[_0x6064('0x41')](_0x50b510['where'],{'$or':_[_0x6064('0x2d')](_0x31a73a,function(_0x55dc83){if(_0x55dc83[_0x6064('0x42')]!==_0x6064('0x43')){var _0x27cafe={};_0x27cafe[_0x55dc83['name']]={'$like':'%'+_0x19469c[_0x6064('0x32')][_0x6064('0x40')]+'%'};return _0x27cafe;}})});}_0x50b510=_['merge']({},_0x50b510,_0x19469c[_0x6064('0x44')]);var _0x4eefe7={'where':_0x50b510[_0x6064('0x3d')]};return db['Schedule'][_0x6064('0x1d')](_0x4eefe7)['then'](function(_0x100283){_0x34865a[_0x6064('0x1d')]=_0x100283;if(_0x19469c[_0x6064('0x32')][_0x6064('0x45')]){_0x50b510[_0x6064('0x46')]=[{'all':!![]}];}return db['Schedule'][_0x6064('0x47')](_0x50b510);})['then'](function(_0x3729e7){_0x34865a['rows']=_0x3729e7;return _0x34865a;})[_0x6064('0x22')](respondWithFilteredResult(_0x4aee72,_0x50b510))['catch'](handleError(_0x4aee72,null));};exports[_0x6064('0x48')]=function(_0x3f93fa,_0x5570af){var _0x46d937={'raw':![],'where':{'id':_0x3f93fa['params']['id']}},_0x29ce5e={};_0x29ce5e[_0x6064('0x38')]=_[_0x6064('0x33')](db[_0x6064('0x2e')][_0x6064('0x2f')]);_0x29ce5e[_0x6064('0x32')]=_[_0x6064('0x33')](_0x3f93fa[_0x6064('0x32')]);_0x29ce5e[_0x6064('0x3e')]=_[_0x6064('0x34')](_0x29ce5e[_0x6064('0x38')],_0x29ce5e[_0x6064('0x32')]);_0x46d937[_0x6064('0x35')]=_[_0x6064('0x34')](_0x29ce5e[_0x6064('0x38')],qs[_0x6064('0x36')](_0x3f93fa[_0x6064('0x32')]['fields']));_0x46d937[_0x6064('0x35')]=_0x46d937[_0x6064('0x35')]['length']?_0x46d937[_0x6064('0x35')]:_0x29ce5e[_0x6064('0x38')];if(_0x3f93fa[_0x6064('0x32')][_0x6064('0x45')]){_0x46d937['include']=[{'all':!![]}];}_0x46d937=_[_0x6064('0x41')]({},_0x46d937,_0x3f93fa[_0x6064('0x44')]);return db[_0x6064('0x2e')][_0x6064('0x49')](_0x46d937)[_0x6064('0x22')](handleEntityNotFound(_0x5570af,null))[_0x6064('0x22')](respondWithResult(_0x5570af,null))['catch'](handleError(_0x5570af,null));};exports[_0x6064('0x4a')]=function(_0x39b847,_0x382092){return db[_0x6064('0x2e')][_0x6064('0x4a')](_0x39b847[_0x6064('0x4b')],{})['then'](function(_0x3763f7){var _0x33edf1=_0x39b847[_0x6064('0x4c')][_0x6064('0x24')]({'plain':!![]});if(!_0x33edf1)throw new Error(_0x6064('0x4d'));if(_0x33edf1['role']===_0x6064('0x4c')){var _0x376b82=_0x3763f7[_0x6064('0x24')]({'plain':!![]});var _0x466d66='Scheduler';return db['UserProfileSection'][_0x6064('0x49')]({'where':{'name':_0x466d66,'userProfileId':_0x33edf1[_0x6064('0x4e')]},'raw':!![]})[_0x6064('0x22')](function(_0x4a011b){if(_0x4a011b&&_0x4a011b[_0x6064('0x4f')]===0x0){return db[_0x6064('0x26')]['create']({'name':_0x376b82[_0x6064('0x2a')],'resourceId':_0x376b82['id'],'type':_0x4a011b[_0x6064('0x2a')],'sectionId':_0x4a011b['id']},{})[_0x6064('0x22')](function(){return _0x3763f7;});}else{return _0x3763f7;}})[_0x6064('0x50')](function(_0x286adb){logger[_0x6064('0x51')](_0x6064('0x52'),_0x286adb);throw _0x286adb;});}return _0x3763f7;})[_0x6064('0x22')](respondWithResult(_0x382092,0xc9))[_0x6064('0x50')](handleError(_0x382092,null));};exports[_0x6064('0x21')]=function(_0x55f7df,_0x240206){if(_0x55f7df[_0x6064('0x4b')]['id']){delete _0x55f7df[_0x6064('0x4b')]['id'];}return db[_0x6064('0x2e')][_0x6064('0x49')]({'where':{'id':_0x55f7df[_0x6064('0x53')]['id']}})[_0x6064('0x22')](handleEntityNotFound(_0x240206,null))[_0x6064('0x22')](saveUpdates(_0x55f7df[_0x6064('0x4b')],null))[_0x6064('0x22')](respondWithResult(_0x240206,null))[_0x6064('0x50')](handleError(_0x240206,null));};exports[_0x6064('0x23')]=function(_0x8ee62c,_0x100fe0){return db['Schedule'][_0x6064('0x49')]({'where':{'id':_0x8ee62c['params']['id']}})['then'](handleEntityNotFound(_0x100fe0,null))[_0x6064('0x22')](removeEntity(_0x100fe0,null))[_0x6064('0x50')](handleError(_0x100fe0,null));};exports[_0x6064('0x54')]=function(_0x487610,_0x2ef7e2,_0x104deb){var _0x31a1bf=require(_0x6064('0x55'));return db[_0x6064('0x2e')]['find']({'where':{'id':_0x487610[_0x6064('0x53')]['id']},'raw':!![]})[_0x6064('0x22')](handleEntityNotFound(_0x2ef7e2,null))[_0x6064('0x22')](function(){_0x31a1bf[_0x6064('0x54')](_0x487610[_0x6064('0x53')]['id']);})['then'](respondWithStatusCode(_0x2ef7e2,null))[_0x6064('0x50')](handleError(_0x2ef7e2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 38cfb49..0aec3b3 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 _0x1101=['exports','define','tools_schedules','lodash','util','api','moment','bluebird','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1101,0x1e0));var _0x1110=function(_0xfa3da6,_0x2cbdb2){_0xfa3da6=_0xfa3da6-0x0;var _0x259910=_0x1101[_0xfa3da6];return _0x259910;};'use strict';var _=require(_0x1110('0x0'));var util=require(_0x1110('0x1'));var logger=require('../../config/logger')(_0x1110('0x2'));var moment=require(_0x1110('0x3'));var BPromise=require(_0x1110('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1110('0x5'));var attributes=require('./schedule.attributes');module[_0x1110('0x6')]=function(_0x3aee13,_0x191a20){return _0x3aee13[_0x1110('0x7')]('Schedule',attributes,{'tableName':_0x1110('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc81=['./schedule.attributes','exports','define','Schedule','lodash','api','bluebird','request-promise','rimraf'];(function(_0x5193a8,_0x3050ae){var _0x143059=function(_0x455694){while(--_0x455694){_0x5193a8['push'](_0x5193a8['shift']());}};_0x143059(++_0x3050ae);}(_0xfc81,0x13f));var _0x1fc8=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0xfc81[_0x34e752];return _0x7c6347;};'use strict';var _=require(_0x1fc8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1fc8('0x1'));var moment=require('moment');var BPromise=require(_0x1fc8('0x2'));var rp=require(_0x1fc8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fc8('0x4'));var config=require('../../config/environment');var attributes=require(_0x1fc8('0x5'));module[_0x1fc8('0x6')]=function(_0x103396,_0x240f69){return _0x103396[_0x1fc8('0x7')](_0x1fc8('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 4efcf0e..c3f5c39 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 _0x6b18=['../../config/environment','client','request','then','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3f5b04,_0xd3c4cb){var _0xb357b7=function(_0x244988){while(--_0x244988){_0x3f5b04['push'](_0x3f5b04['shift']());}};_0xb357b7(++_0xd3c4cb);}(_0x6b18,0x1cf));var _0x86b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b18[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x86b1('0x0'));var BPromise=require(_0x86b1('0x1'));var rs=require(_0x86b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86b1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86b1('0x4'))('rpc');var config=require(_0x86b1('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x86b1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x74cf52,_0x139222,_0x3303c0){return new BPromise(function(_0xcb1808,_0x1890be){return client[_0x86b1('0x7')](_0x74cf52,_0x3303c0)[_0x86b1('0x8')](function(_0x5effe7){logger['info'](_0x86b1('0x9'),_0x139222,_0x86b1('0xa'));logger['debug'](_0x86b1('0xb'),_0x139222,_0x86b1('0xa'),JSON['stringify'](_0x5effe7));if(_0x5effe7[_0x86b1('0xc')]){if(_0x5effe7[_0x86b1('0xc')][_0x86b1('0xd')]===0x1f4){logger[_0x86b1('0xc')](_0x86b1('0x9'),_0x139222,_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);return _0x1890be(_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);}logger[_0x86b1('0xc')]('Schedule,\x20%s,\x20%s',_0x139222,_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);return _0xcb1808(_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);}else{logger[_0x86b1('0xf')](_0x86b1('0x9'),_0x139222,_0x86b1('0xa'));_0xcb1808(_0x5effe7[_0x86b1('0x10')]['message']);}})[_0x86b1('0x11')](function(_0x360fee){logger['error'](_0x86b1('0x9'),_0x139222,_0x360fee);_0x1890be(_0x360fee);});});} \ No newline at end of file +var _0xcdca=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x404acd,_0x2c3d96){var _0x31676c=function(_0x305d17){while(--_0x305d17){_0x404acd['push'](_0x404acd['shift']());}};_0x31676c(++_0x2c3d96);}(_0xcdca,0x1b2));var _0xacdc=function(_0x508517,_0xe08b33){_0x508517=_0x508517-0x0;var _0xecac9a=_0xcdca[_0x508517];return _0xecac9a;};'use strict';var _=require('lodash');var util=require(_0xacdc('0x0'));var moment=require(_0xacdc('0x1'));var BPromise=require(_0xacdc('0x2'));var rs=require(_0xacdc('0x3'));var fs=require('fs');var Redis=require(_0xacdc('0x4'));var db=require(_0xacdc('0x5'))['db'];var utils=require(_0xacdc('0x6'));var logger=require('../../config/logger')(_0xacdc('0x7'));var config=require('../../config/environment');var jayson=require(_0xacdc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51054a,_0x5c0c65,_0x1033d4){return new BPromise(function(_0x38d46c,_0x4adb0d){return client['request'](_0x51054a,_0x1033d4)[_0xacdc('0x9')](function(_0x5093ed){logger['info'](_0xacdc('0xa'),_0x5c0c65,_0xacdc('0xb'));logger[_0xacdc('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x5c0c65,'request\x20sent',JSON[_0xacdc('0xd')](_0x5093ed));if(_0x5093ed[_0xacdc('0xe')]){if(_0x5093ed[_0xacdc('0xe')]['code']===0x1f4){logger[_0xacdc('0xe')](_0xacdc('0xa'),_0x5c0c65,_0x5093ed[_0xacdc('0xe')][_0xacdc('0xf')]);return _0x4adb0d(_0x5093ed['error'][_0xacdc('0xf')]);}logger[_0xacdc('0xe')]('Schedule,\x20%s,\x20%s',_0x5c0c65,_0x5093ed[_0xacdc('0xe')][_0xacdc('0xf')]);return _0x38d46c(_0x5093ed['error'][_0xacdc('0xf')]);}else{logger[_0xacdc('0x10')](_0xacdc('0xa'),_0x5c0c65,'request\x20sent');_0x38d46c(_0x5093ed[_0xacdc('0x11')][_0xacdc('0xf')]);}})[_0xacdc('0x12')](function(_0x26d6e7){logger['error']('Schedule,\x20%s,\x20%s',_0x5c0c65,_0x26d6e7);_0x4adb0d(_0x26d6e7);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 42decc3..266fa47 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 _0xd813=['../../config/environment','./screenRecording.controller','isAuthenticated','get','/describe','show','post','create','put','/:id','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x26d64e,_0x37dcf5){var _0x4b08ce=function(_0x246d19){while(--_0x246d19){_0x26d64e['push'](_0x26d64e['shift']());}};_0x4b08ce(++_0x37dcf5);}(_0xd813,0xdd));var _0x3d81=function(_0x20c3c2,_0x1b45e1){_0x20c3c2=_0x20c3c2-0x0;var _0x527149=_0xd813[_0x20c3c2];return _0x527149;};'use strict';var multer=require(_0x3d81('0x0'));var util=require('util');var path=require(_0x3d81('0x1'));var timeout=require(_0x3d81('0x2'));var express=require(_0x3d81('0x3'));var router=express[_0x3d81('0x4')]();var fs_extra=require(_0x3d81('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3d81('0x6'));var config=require(_0x3d81('0x7'));var controller=require(_0x3d81('0x8'));router['get']('/',auth[_0x3d81('0x9')](),controller['index']);router[_0x3d81('0xa')](_0x3d81('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3d81('0xa')]('/:id',auth[_0x3d81('0x9')](),controller[_0x3d81('0xc')]);router[_0x3d81('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x3d81('0xd')]('/',auth[_0x3d81('0x9')](),controller[_0x3d81('0xe')]);router[_0x3d81('0xf')](_0x3d81('0x10'),auth[_0x3d81('0x9')](),controller['update']);router[_0x3d81('0x11')](_0x3d81('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3d81('0x12')]=router; \ No newline at end of file +var _0x95f9=['get','/describe','describe','show','post','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95f9,0x1c3));var _0x995f=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x95f9[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x995f('0x0'));var util=require(_0x995f('0x1'));var path=require(_0x995f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x995f('0x3')]();var fs_extra=require(_0x995f('0x4'));var auth=require(_0x995f('0x5'));var interaction=require(_0x995f('0x6'));var config=require(_0x995f('0x7'));var controller=require(_0x995f('0x8'));router['get']('/',auth[_0x995f('0x9')](),controller[_0x995f('0xa')]);router[_0x995f('0xb')](_0x995f('0xc'),auth[_0x995f('0x9')](),controller[_0x995f('0xd')]);router[_0x995f('0xb')]('/:id',auth[_0x995f('0x9')](),controller[_0x995f('0xe')]);router['get']('/:id/download',auth[_0x995f('0x9')](),controller['download']);router[_0x995f('0xf')]('/',auth[_0x995f('0x9')](),controller['create']);router[_0x995f('0x10')](_0x995f('0x11'),auth[_0x995f('0x9')](),controller[_0x995f('0x12')]);router[_0x995f('0x13')](_0x995f('0x11'),auth[_0x995f('0x9')](),controller['destroy']);module[_0x995f('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b4d2b84..415ab09 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 _0x3cd0=['STRING','setDataValue','INTEGER','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','../../config/environment','VIRTUAL','getDataValue','value','extname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cd0,0x8a));var _0x03cd=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x3cd0[_0x2b9b7f];return _0x4ed19a;};'use strict';var Sequelize=require(_0x03cd('0x0'));var moment=require('moment');var path=require('path');var config=require(_0x03cd('0x1'));module['exports']={'format':{'type':Sequelize[_0x03cd('0x2')],'get':function(){return this[_0x03cd('0x3')](_0x03cd('0x4'))?path[_0x03cd('0x5')](this[_0x03cd('0x3')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x03cd('0x6')]},'channel':{'type':Sequelize[_0x03cd('0x6')]},'value':{'type':Sequelize[_0x03cd('0x6')],'set':function(_0x1ff934){var _0x606150=_0x1ff934['replace'](/\\/g,'/');this[_0x03cd('0x7')]('value',_0x606150);}},'rating':{'type':Sequelize[_0x03cd('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x03cd('0x8')],'set':function(_0x152209){this[_0x03cd('0x7')]('startedAt',moment()[_0x03cd('0x9')](_0x152209,'ms'));this[_0x03cd('0x7')](_0x03cd('0xa'),moment());this[_0x03cd('0x7')](_0x03cd('0xb'),_0x152209);}},'startedAt':{'type':Sequelize[_0x03cd('0xc')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x03cd('0xd')](_0x03cd('0xe'))[_0x03cd('0xf')]();}},'closedAt':{'type':Sequelize[_0x03cd('0xc')],'get':function(){return moment(this['getDataValue'](_0x03cd('0xa')))[_0x03cd('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x03cd('0x3')](_0x03cd('0x10')))[_0x03cd('0xd')](_0x03cd('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x03cd('0xc')],'get':function(){return moment(this[_0x03cd('0x3')](_0x03cd('0x11')))[_0x03cd('0xd')](_0x03cd('0xe'))['toString']();}}}; \ No newline at end of file +var _0xe77c=['value','extname','STRING','replace','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue'];(function(_0x373aaa,_0x400db6){var _0x2e8de6=function(_0x4eb210){while(--_0x4eb210){_0x373aaa['push'](_0x373aaa['shift']());}};_0x2e8de6(++_0x400db6);}(_0xe77c,0x176));var _0xce77=function(_0x4c3ba1,_0x5d942d){_0x4c3ba1=_0x4c3ba1-0x0;var _0x326fa2=_0xe77c[_0x4c3ba1];return _0x326fa2;};'use strict';var Sequelize=require(_0xce77('0x0'));var moment=require(_0xce77('0x1'));var path=require(_0xce77('0x2'));var config=require('../../config/environment');module[_0xce77('0x3')]={'format':{'type':Sequelize[_0xce77('0x4')],'get':function(){return this[_0xce77('0x5')](_0xce77('0x6'))?path[_0xce77('0x7')](this[_0xce77('0x5')](_0xce77('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xce77('0x8')],'set':function(_0x51fe6b){var _0x3a9d5d=_0x51fe6b[_0xce77('0x9')](/\\/g,'/');this[_0xce77('0xa')]('value',_0x3a9d5d);}},'rating':{'type':Sequelize[_0xce77('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xce77('0xb')],'set':function(_0x82cc7e){this[_0xce77('0xa')](_0xce77('0xc'),moment()['subtract'](_0x82cc7e,'ms'));this[_0xce77('0xa')]('closedAt',moment());this[_0xce77('0xa')](_0xce77('0xd'),_0x82cc7e);}},'startedAt':{'type':Sequelize[_0xce77('0xe')],'get':function(){return moment(this['getDataValue'](_0xce77('0xc')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xce77('0x5')]('closedAt'))[_0xce77('0xf')](_0xce77('0x10'))[_0xce77('0x11')]();}},'createdAt':{'type':Sequelize[_0xce77('0xe')],'get':function(){return moment(this[_0xce77('0x5')](_0xce77('0x12')))['format'](_0xce77('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xce77('0xe')],'get':function(){return moment(this[_0xce77('0x5')](_0xce77('0x13')))['format'](_0xce77('0x10'))[_0xce77('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 8fda03c..5ef25e9 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 _0x81bd=['Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','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','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','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','duration','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','root','%s.cypher','existsSync','secrets','recording','join','server/files/screen_recordings'];(function(_0x38015d,_0xf7624b){var _0xa39405=function(_0x33e4fa){while(--_0x33e4fa){_0x38015d['push'](_0x38015d['shift']());}};_0xa39405(++_0xf7624b);}(_0x81bd,0x7c));var _0xd81b=function(_0x5c9967,_0x59304e){_0x5c9967=_0x5c9967-0x0;var _0x319e8c=_0x81bd[_0x5c9967];return _0x319e8c;};'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'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2ccedf,_0x1bf351){return function(_0x596389){if(!_0x596389){_0x2ccedf[_0xd81b('0x1b')](0x194);}return _0x596389;};}function handleError(_0x99dbc9,_0xe3637a){_0xe3637a=_0xe3637a||0x1f4;return function(_0x31b9fd){logger[_0xd81b('0x2a')](_0x31b9fd[_0xd81b('0x2b')]);if(_0x31b9fd[_0xd81b('0x2c')]){delete _0x31b9fd[_0xd81b('0x2c')];}_0x99dbc9[_0xd81b('0x1d')](_0xe3637a)['send'](_0x31b9fd);};}exports[_0xd81b('0x2d')]=function(_0x4e2eff,_0x5c8aee){var _0xb9ff9f={},_0x260310={},_0x5141e6={'count':0x0,'rows':[]};var _0x481454=_[_0xd81b('0x2e')](db[_0xd81b('0x2f')][_0xd81b('0x30')],function(_0x289f54){return{'name':_0x289f54[_0xd81b('0x31')],'type':_0x289f54[_0xd81b('0x32')]['key']};});_0x260310[_0xd81b('0x33')]=_[_0xd81b('0x34')](_['map'](_0x481454,'name'),[_0xd81b('0x35')]);_0x260310[_0xd81b('0x36')]=_['keys'](_0x4e2eff['query']);_0x260310['filters']=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],_0x260310[_0xd81b('0x36')]);_0xb9ff9f[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x4e2eff['query'][_0xd81b('0x39')]));_0xb9ff9f['attributes']=_0xb9ff9f[_0xd81b('0x38')][_0xd81b('0x3a')]?_0xb9ff9f[_0xd81b('0x38')]:_0x260310[_0xd81b('0x33')];if(!_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x3b')](_0xd81b('0x3c'))){_0xb9ff9f[_0xd81b('0x20')]=qs[_0xd81b('0x20')](_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x20')]);_0xb9ff9f[_0xd81b('0x22')]=qs[_0xd81b('0x22')](_0x4e2eff['query']['offset']);}_0xb9ff9f[_0xd81b('0x3d')]=qs[_0xd81b('0x3e')](_0x4e2eff[_0xd81b('0x36')]['sort']);_0xb9ff9f[_0xd81b('0x3f')]=qs[_0xd81b('0x40')](_['pick'](_0x4e2eff[_0xd81b('0x36')],_0x260310[_0xd81b('0x40')]),_0x481454);if(_0x4e2eff['query'][_0xd81b('0x41')]){_0xb9ff9f['where']=_[_0xd81b('0x42')](_0xb9ff9f[_0xd81b('0x3f')],{'$or':_[_0xd81b('0x2e')](_0x481454,function(_0x3f6deb){if(_0x3f6deb['type']!==_0xd81b('0x43')){var _0x3444d4={};_0x3444d4[_0x3f6deb[_0xd81b('0x2c')]]={'$like':'%'+_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x41')]+'%'};return _0x3444d4;}})});}_0xb9ff9f=_[_0xd81b('0x42')]({},_0xb9ff9f,_0x4e2eff[_0xd81b('0x44')]);var _0x532ada={'where':_0xb9ff9f[_0xd81b('0x3f')]};return db[_0xd81b('0x2f')][_0xd81b('0x21')](_0x532ada)['then'](function(_0x3bea7d){_0x5141e6[_0xd81b('0x21')]=_0x3bea7d;if(_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x45')]){_0xb9ff9f[_0xd81b('0x46')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd81b('0x47')](_0xb9ff9f);})[_0xd81b('0x28')](function(_0x448e24){_0x5141e6[_0xd81b('0x48')]=_0x448e24;return _0x5141e6;})[_0xd81b('0x28')](respondWithFilteredResult(_0x5c8aee,_0xb9ff9f))[_0xd81b('0x49')](handleError(_0x5c8aee,null));};exports[_0xd81b('0x4a')]=function(_0x486f0d,_0x4405a8){var _0x3ba339={'raw':![],'where':{'id':_0x486f0d['params']['id']}},_0x1e3690={};_0x1e3690[_0xd81b('0x33')]=_[_0xd81b('0x4b')](db[_0xd81b('0x2f')][_0xd81b('0x30')]);_0x1e3690[_0xd81b('0x36')]=_[_0xd81b('0x4b')](_0x486f0d[_0xd81b('0x36')]);_0x1e3690[_0xd81b('0x40')]=_['intersection'](_0x1e3690['model'],_0x1e3690[_0xd81b('0x36')]);_0x3ba339[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x1e3690[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x486f0d[_0xd81b('0x36')][_0xd81b('0x39')]));_0x3ba339[_0xd81b('0x38')]=_0x3ba339[_0xd81b('0x38')][_0xd81b('0x3a')]?_0x3ba339[_0xd81b('0x38')]:_0x1e3690[_0xd81b('0x33')];if(_0x486f0d['query'][_0xd81b('0x45')]){_0x3ba339[_0xd81b('0x46')]=[{'all':!![]}];}_0x3ba339=_[_0xd81b('0x42')]({},_0x3ba339,_0x486f0d[_0xd81b('0x44')]);return db[_0xd81b('0x2f')][_0xd81b('0x4c')](_0x3ba339)[_0xd81b('0x28')](handleEntityNotFound(_0x4405a8,null))[_0xd81b('0x28')](respondWithResult(_0x4405a8,null))[_0xd81b('0x49')](handleError(_0x4405a8,null));};exports['create']=function(_0xf401e0,_0x2368dd){return db[_0xd81b('0x2f')][_0xd81b('0x4d')](_0xf401e0['body'],{})[_0xd81b('0x28')](respondWithResult(_0x2368dd,0xc9))[_0xd81b('0x49')](handleError(_0x2368dd,null));};exports[_0xd81b('0x27')]=function(_0xe874b6,_0x2699e6){if(_0xe874b6[_0xd81b('0x4e')]['id']){delete _0xe874b6[_0xd81b('0x4e')]['id'];}delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x4f')];delete _0xe874b6['body']['createdAt'];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x50')];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x51')];return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0xe874b6[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2699e6,null))['then'](saveUpdates(_0xe874b6[_0xd81b('0x4e')],null))[_0xd81b('0x28')](respondWithResult(_0x2699e6,null))[_0xd81b('0x49')](handleError(_0x2699e6,null));};exports[_0xd81b('0x53')]=function(_0x4651d3,_0x59b13b){return db[_0xd81b('0x2f')][_0xd81b('0x53')]()['then'](respondWithResult(_0x59b13b,null))[_0xd81b('0x49')](handleError(_0x59b13b,null));};exports[_0xd81b('0x54')]=function(_0x100319,_0x3b7ed7,_0x21cd71){var _0xa366c8=require(_0xd81b('0x55'));var _0x22f588=![];var _0x3ed626={};if(_0x100319[_0xd81b('0x36')][_0xd81b('0x32')]&&_0x100319['query'][_0xd81b('0x32')]==='uniqueid'){_0x3ed626[_0xd81b('0x56')]=_0x100319[_0xd81b('0x52')]['id'];}else{_0x3ed626['id']=_0x100319[_0xd81b('0x52')]['id'];}return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':_0x3ed626,'attributes':['id',_0xd81b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x3b7ed7,null))[_0xd81b('0x28')](function(_0xe0c9c6){if(_0xe0c9c6){var _0x51f5a1=path['join'](config[_0xd81b('0x57')],'server/files/screen_recordings',_0xe0c9c6[_0xd81b('0x51')]);var _0x51f066=util[_0xd81b('0x35')](_0xd81b('0x58'),_0x51f5a1);if(fs[_0xd81b('0x59')](_0x51f066)){_0x22f588=!![];return _0xa366c8['decryptFile'](_0x51f066,_0x51f5a1,config[_0xd81b('0x5a')][_0xd81b('0x5b')])['then'](function(){return _0xe0c9c6;});}return _0xe0c9c6;}})[_0xd81b('0x28')](function(_0x108aaf){if(_0x108aaf){var _0x5951ec=path[_0xd81b('0x5c')](config['root'],_0xd81b('0x5d'),_0x108aaf[_0xd81b('0x51')]);if(!fs[_0xd81b('0x59')](_0x5951ec)){throw new db[(_0xd81b('0x5e'))][(_0xd81b('0x5f'))](_0xd81b('0x60'));}if(_0x108aaf[_0xd81b('0x61')]){return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,_0x108aaf[_0xd81b('0x61')]+path[_0xd81b('0x62')](_0x5951ec),function(){if(_0x22f588){fs['unlink'](_0x5951ec);}});}else{return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,function(_0x434434){if(_0x22f588){fs[_0xd81b('0x63')](_0x5951ec);}});}}})[_0xd81b('0x49')](function(_0x1bdf37){if(_0x1bdf37[_0xd81b('0x64')]===_0xd81b('0x60')){_0x3b7ed7['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x3b7ed7,null);}});};exports[_0xd81b('0x29')]=function(_0x12b0bf,_0x37507e){return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0x12b0bf[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](function(_0x5afecf){if(_[_0xd81b('0x65')](_0x5afecf)){throw new ReferenceError(_0xd81b('0x66'));}return _0x5afecf;})[_0xd81b('0x28')](function(_0x2090e9){var _0x41719b=path[_0xd81b('0x5c')](config[_0xd81b('0x57')],'server/files/screen_recordings',_0x2090e9[_0xd81b('0x51')]);logger[_0xd81b('0x67')](_0xd81b('0x68'),_0x41719b);if(!_[_0xd81b('0x65')](_0x2090e9[_0xd81b('0x51')])&&fs[_0xd81b('0x59')](_0x41719b)){logger[_0xd81b('0x67')](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}_0x41719b=_0x41719b+_0xd81b('0x6c');if(!_[_0xd81b('0x65')](_0x2090e9['value'])&&fs[_0xd81b('0x59')](_0x41719b)){logger['info'](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}return _0x2090e9;})[_0xd81b('0x28')](function(_0xb94a69){if(!_0xb94a69)throw new InternalError();return _0xb94a69[_0xd81b('0x29')]();})[_0xd81b('0x28')](function(){_0x37507e[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();})[_0xd81b('0x49')](handleError(_0x37507e,null));}; \ No newline at end of file +var _0xac31=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','then','includeAll','findAll','rows','catch','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher'];(function(_0x2b57fc,_0x4b3658){var _0x5bf238=function(_0x21661a){while(--_0x21661a){_0x2b57fc['push'](_0x2b57fc['shift']());}};_0x5bf238(++_0x4b3658);}(_0xac31,0xca));var _0x1ac3=function(_0x37f484,_0x57ebc7){_0x37f484=_0x37f484-0x0;var _0xfd7c23=_0xac31[_0x37f484];return _0xfd7c23;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];function respondWithStatusCode(_0x2eeabf,_0x2338b9){_0x2338b9=_0x2338b9||0xcc;return function(_0x50d3b6){if(_0x50d3b6){return _0x2eeabf[_0x1ac3('0x1a')](_0x2338b9);}return _0x2eeabf[_0x1ac3('0x1b')](_0x2338b9)[_0x1ac3('0x1c')]();};}function respondWithResult(_0x2def9f,_0x53cc35){_0x53cc35=_0x53cc35||0xc8;return function(_0x24bb5e){if(_0x24bb5e){return _0x2def9f[_0x1ac3('0x1b')](_0x53cc35)['json'](_0x24bb5e);}};}function respondWithFilteredResult(_0x29a7b3,_0x1f9641){return function(_0x38b52a){if(_0x38b52a){var _0x51f1e4=typeof _0x1f9641[_0x1ac3('0x1d')]===_0x1ac3('0x1e')&&typeof _0x1f9641[_0x1ac3('0x1f')]==='undefined';var _0x195683=_0x38b52a['count'];var _0x291616=_0x51f1e4?0x0:_0x1f9641[_0x1ac3('0x1d')];var _0x20091d=_0x51f1e4?_0x38b52a[_0x1ac3('0x20')]:_0x1f9641[_0x1ac3('0x1d')]+_0x1f9641['limit'];var _0x136e73;if(_0x20091d>=_0x195683){_0x20091d=_0x195683;_0x136e73=0xc8;}else{_0x136e73=0xce;}_0x29a7b3[_0x1ac3('0x1b')](_0x136e73);return _0x29a7b3[_0x1ac3('0x21')](_0x1ac3('0x22'),_0x291616+'-'+_0x20091d+'/'+_0x195683)['json'](_0x38b52a);}return null;};}function patchUpdates(_0x48d18a){return function(_0x2879d8){try{jsonpatch[_0x1ac3('0x23')](_0x2879d8,_0x48d18a,!![]);}catch(_0x14070b){return BPromise[_0x1ac3('0x24')](_0x14070b);}return _0x2879d8[_0x1ac3('0x25')]();};}function saveUpdates(_0x319988,_0x23b767){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x1ac3('0x26')](_0x319988)['then'](function(_0x1e277f){return _0x1e277f;});}return null;};}function removeEntity(_0x231b7f,_0x4b19f2){return function(_0x2b5182){if(_0x2b5182){return _0x2b5182[_0x1ac3('0x27')]()['then'](function(){_0x231b7f[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();});}};}function handleEntityNotFound(_0x145486,_0x2dfdb7){return function(_0x10db3d){if(!_0x10db3d){_0x145486['sendStatus'](0x194);}return _0x10db3d;};}function handleError(_0x5a2ab2,_0x503a64){_0x503a64=_0x503a64||0x1f4;return function(_0x528807){logger['error'](_0x528807[_0x1ac3('0x28')]);if(_0x528807['name']){delete _0x528807[_0x1ac3('0x29')];}_0x5a2ab2[_0x1ac3('0x1b')](_0x503a64)[_0x1ac3('0x2a')](_0x528807);};}exports[_0x1ac3('0x2b')]=function(_0x4b3d3c,_0x61441d){var _0x541da0={},_0x2ddd73={},_0x4000b0={'count':0x0,'rows':[]};var _0x440aed=_[_0x1ac3('0x2c')](db[_0x1ac3('0x2d')][_0x1ac3('0x2e')],function(_0x9c17c2){return{'name':_0x9c17c2['fieldName'],'type':_0x9c17c2[_0x1ac3('0x2f')][_0x1ac3('0x30')]};});_0x2ddd73[_0x1ac3('0x31')]=_[_0x1ac3('0x32')](_['map'](_0x440aed,_0x1ac3('0x29')),[_0x1ac3('0x33')]);_0x2ddd73[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4b3d3c[_0x1ac3('0x34')]);_0x2ddd73['filters']=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],_0x2ddd73[_0x1ac3('0x34')]);_0x541da0[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x2ddd73[_0x1ac3('0x31')],qs['fields'](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x541da0[_0x1ac3('0x37')]=_0x541da0[_0x1ac3('0x37')]['length']?_0x541da0[_0x1ac3('0x37')]:_0x2ddd73[_0x1ac3('0x31')];if(!_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x39')](_0x1ac3('0x3a'))){_0x541da0[_0x1ac3('0x1f')]=qs[_0x1ac3('0x1f')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x1f')]);_0x541da0['offset']=qs[_0x1ac3('0x1d')](_0x4b3d3c[_0x1ac3('0x34')]['offset']);}_0x541da0[_0x1ac3('0x3b')]=qs[_0x1ac3('0x3c')](_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x3c')]);_0x541da0[_0x1ac3('0x3d')]=qs[_0x1ac3('0x3e')](_[_0x1ac3('0x3f')](_0x4b3d3c[_0x1ac3('0x34')],_0x2ddd73['filters']),_0x440aed);if(_0x4b3d3c[_0x1ac3('0x34')]['filter']){_0x541da0[_0x1ac3('0x3d')]=_[_0x1ac3('0x40')](_0x541da0[_0x1ac3('0x3d')],{'$or':_[_0x1ac3('0x2c')](_0x440aed,function(_0x3141ae){if(_0x3141ae[_0x1ac3('0x2f')]!=='VIRTUAL'){var _0x3b5c1c={};_0x3b5c1c[_0x3141ae[_0x1ac3('0x29')]]={'$like':'%'+_0x4b3d3c[_0x1ac3('0x34')]['filter']+'%'};return _0x3b5c1c;}})});}_0x541da0=_[_0x1ac3('0x40')]({},_0x541da0,_0x4b3d3c[_0x1ac3('0x41')]);var _0x5cec6b={'where':_0x541da0[_0x1ac3('0x3d')]};return db[_0x1ac3('0x2d')][_0x1ac3('0x20')](_0x5cec6b)[_0x1ac3('0x42')](function(_0x466a45){_0x4000b0[_0x1ac3('0x20')]=_0x466a45;if(_0x4b3d3c[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x541da0['include']=[{'all':!![]}];}return db[_0x1ac3('0x2d')][_0x1ac3('0x44')](_0x541da0);})[_0x1ac3('0x42')](function(_0x254a77){_0x4000b0[_0x1ac3('0x45')]=_0x254a77;return _0x4000b0;})[_0x1ac3('0x42')](respondWithFilteredResult(_0x61441d,_0x541da0))[_0x1ac3('0x46')](handleError(_0x61441d,null));};exports['show']=function(_0x4edc4d,_0x2c2099){var _0x3f60ca={'raw':![],'where':{'id':_0x4edc4d[_0x1ac3('0x47')]['id']}},_0x4972d1={};_0x4972d1[_0x1ac3('0x31')]=_['keys'](db[_0x1ac3('0x2d')]['rawAttributes']);_0x4972d1[_0x1ac3('0x34')]=_[_0x1ac3('0x35')](_0x4edc4d[_0x1ac3('0x34')]);_0x4972d1[_0x1ac3('0x3e')]=_['intersection'](_0x4972d1[_0x1ac3('0x31')],_0x4972d1[_0x1ac3('0x34')]);_0x3f60ca[_0x1ac3('0x37')]=_[_0x1ac3('0x36')](_0x4972d1[_0x1ac3('0x31')],qs['fields'](_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x38')]));_0x3f60ca[_0x1ac3('0x37')]=_0x3f60ca[_0x1ac3('0x37')]['length']?_0x3f60ca[_0x1ac3('0x37')]:_0x4972d1[_0x1ac3('0x31')];if(_0x4edc4d[_0x1ac3('0x34')][_0x1ac3('0x43')]){_0x3f60ca['include']=[{'all':!![]}];}_0x3f60ca=_[_0x1ac3('0x40')]({},_0x3f60ca,_0x4edc4d[_0x1ac3('0x41')]);return db[_0x1ac3('0x2d')][_0x1ac3('0x48')](_0x3f60ca)['then'](handleEntityNotFound(_0x2c2099,null))[_0x1ac3('0x42')](respondWithResult(_0x2c2099,null))['catch'](handleError(_0x2c2099,null));};exports[_0x1ac3('0x49')]=function(_0x10bcaf,_0x2e3347){return db[_0x1ac3('0x2d')][_0x1ac3('0x49')](_0x10bcaf[_0x1ac3('0x4a')],{})[_0x1ac3('0x42')](respondWithResult(_0x2e3347,0xc9))['catch'](handleError(_0x2e3347,null));};exports['update']=function(_0xe8f33c,_0x249c2d){if(_0xe8f33c[_0x1ac3('0x4a')]['id']){delete _0xe8f33c['body']['id'];}delete _0xe8f33c['body']['duration'];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4b')];delete _0xe8f33c['body'][_0x1ac3('0x4c')];delete _0xe8f33c[_0x1ac3('0x4a')][_0x1ac3('0x4d')];return db[_0x1ac3('0x2d')]['find']({'where':{'id':_0xe8f33c['params']['id']}})[_0x1ac3('0x42')](handleEntityNotFound(_0x249c2d,null))[_0x1ac3('0x42')](saveUpdates(_0xe8f33c['body'],null))[_0x1ac3('0x42')](respondWithResult(_0x249c2d,null))['catch'](handleError(_0x249c2d,null));};exports['describe']=function(_0x2d628d,_0x220dd0){return db['ScreenRecording'][_0x1ac3('0x4e')]()['then'](respondWithResult(_0x220dd0,null))[_0x1ac3('0x46')](handleError(_0x220dd0,null));};exports[_0x1ac3('0x4f')]=function(_0x3586b9,_0x3a0320,_0x34ad43){var _0x40e9c7=require(_0x1ac3('0x50'));var _0x331374=![];var _0xeb7e49={};if(_0x3586b9[_0x1ac3('0x34')][_0x1ac3('0x2f')]&&_0x3586b9['query']['type']===_0x1ac3('0x51')){_0xeb7e49[_0x1ac3('0x51')]=_0x3586b9[_0x1ac3('0x47')]['id'];}else{_0xeb7e49['id']=_0x3586b9[_0x1ac3('0x47')]['id'];}return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':_0xeb7e49,'attributes':['id',_0x1ac3('0x4d')],'raw':!![]})[_0x1ac3('0x42')](handleEntityNotFound(_0x3a0320,null))[_0x1ac3('0x42')](function(_0x3149f6){if(_0x3149f6){var _0x541bba=path[_0x1ac3('0x52')](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x3149f6[_0x1ac3('0x4d')]);var _0x20c195=util['format'](_0x1ac3('0x55'),_0x541bba);if(fs[_0x1ac3('0x56')](_0x20c195)){_0x331374=!![];return _0x40e9c7['decryptFile'](_0x20c195,_0x541bba,config['secrets']['recording'])[_0x1ac3('0x42')](function(){return _0x3149f6;});}return _0x3149f6;}})[_0x1ac3('0x42')](function(_0x2a1f66){if(_0x2a1f66){var _0x5ad546=path[_0x1ac3('0x52')](config['root'],'server/files/screen_recordings',_0x2a1f66['value']);if(!fs['existsSync'](_0x5ad546)){throw new db[(_0x1ac3('0x57'))][(_0x1ac3('0x58'))](_0x1ac3('0x59'));}if(_0x2a1f66[_0x1ac3('0x5a')]){return _0x3a0320[_0x1ac3('0x4f')](_0x5ad546,_0x2a1f66['filename']+path[_0x1ac3('0x5b')](_0x5ad546),function(){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}else{return _0x3a0320['download'](_0x5ad546,function(_0x2bcb4b){if(_0x331374){fs[_0x1ac3('0x5c')](_0x5ad546);}});}}})[_0x1ac3('0x46')](function(_0x2e79b2){if(_0x2e79b2[_0x1ac3('0x5d')]==='ScreenRecording\x20not\x20found'){_0x3a0320[_0x1ac3('0x1b')](0x194)[_0x1ac3('0x2a')](_0x1ac3('0x5e'));}else{return handleError(_0x3a0320,null);}});};exports[_0x1ac3('0x27')]=function(_0x4cfa04,_0x19407a){return db[_0x1ac3('0x2d')][_0x1ac3('0x48')]({'where':{'id':_0x4cfa04[_0x1ac3('0x47')]['id']}})[_0x1ac3('0x42')](function(_0x1ac283){if(_['isNil'](_0x1ac283)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1ac283;})['then'](function(_0x582fe2){var _0x3b930b=path['join'](config[_0x1ac3('0x53')],_0x1ac3('0x54'),_0x582fe2[_0x1ac3('0x4d')]);logger[_0x1ac3('0x5f')](_0x1ac3('0x60'),_0x3b930b);if(!_[_0x1ac3('0x61')](_0x582fe2['value'])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')](_0x1ac3('0x62')+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}_0x3b930b=_0x3b930b+_0x1ac3('0x64');if(!_[_0x1ac3('0x61')](_0x582fe2[_0x1ac3('0x4d')])&&fs[_0x1ac3('0x56')](_0x3b930b)){logger[_0x1ac3('0x5f')]('File:\x20\x22'+_0x3b930b+_0x1ac3('0x63'));fs['unlinkSync'](_0x3b930b);}return _0x582fe2;})['then'](function(_0x402507){if(!_0x402507)throw new InternalError();return _0x402507[_0x1ac3('0x27')]();})[_0x1ac3('0x42')](function(){_0x19407a[_0x1ac3('0x1b')](0xcc)[_0x1ac3('0x1c')]();})[_0x1ac3('0x46')](handleError(_0x19407a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 92c695c..5cf6c7e 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 _0x760a=['bluebird','request-promise','path','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api'];(function(_0x45550b,_0x34c169){var _0x2a8274=function(_0x165e74){while(--_0x165e74){_0x45550b['push'](_0x45550b['shift']());}};_0x2a8274(++_0x34c169);}(_0x760a,0xf3));var _0xa760=function(_0x1429db,_0x1e3797){_0x1429db=_0x1429db-0x0;var _0x33a164=_0x760a[_0x1429db];return _0x33a164;};'use strict';var _=require(_0xa760('0x0'));var util=require(_0xa760('0x1'));var logger=require(_0xa760('0x2'))(_0xa760('0x3'));var moment=require('moment');var BPromise=require(_0xa760('0x4'));var rp=require(_0xa760('0x5'));var fs=require('fs');var path=require(_0xa760('0x6'));var rimraf=require('rimraf');var config=require(_0xa760('0x7'));var attributes=require('./screenRecording.attributes');module[_0xa760('0x8')]=function(_0x550ef6,_0x300dab){return _0x550ef6[_0xa760('0x9')](_0xa760('0xa'),attributes,{'tableName':_0xa760('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xa760('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5013=['../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x394f17,_0xc15434){var _0x40c55f=function(_0x1b6558){while(--_0x1b6558){_0x394f17['push'](_0x394f17['shift']());}};_0x40c55f(++_0xc15434);}(_0x5013,0x1ce));var _0x3501=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x5013[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0x3501('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3501('0x1'));var BPromise=require(_0x3501('0x2'));var rp=require(_0x3501('0x3'));var fs=require('fs');var path=require(_0x3501('0x4'));var rimraf=require(_0x3501('0x5'));var config=require(_0x3501('0x6'));var attributes=require('./screenRecording.attributes');module[_0x3501('0x7')]=function(_0x402431,_0x366253){return _0x402431[_0x3501('0x8')](_0x3501('0x9'),attributes,{'tableName':_0x3501('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x3501('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 311d1ca..1da6338 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 _0x493f=['rpc','../../config/environment','jayson/promise','client','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2f0c5d,_0x4b67c4){var _0x2bd6db=function(_0x15bc72){while(--_0x15bc72){_0x2f0c5d['push'](_0x2f0c5d['shift']());}};_0x2bd6db(++_0x4b67c4);}(_0x493f,0xa1));var _0xf493=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x493f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf493('0x0'));var util=require('util');var moment=require(_0xf493('0x1'));var BPromise=require(_0xf493('0x2'));var rs=require(_0xf493('0x3'));var fs=require('fs');var Redis=require(_0xf493('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf493('0x5'));var logger=require(_0xf493('0x6'))(_0xf493('0x7'));var config=require(_0xf493('0x8'));var jayson=require(_0xf493('0x9'));var client=jayson[_0xf493('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x139601,_0x599153,_0x724d5d){return new BPromise(function(_0xf26dc0,_0x1947c1){return client['request'](_0x139601,_0x724d5d)[_0xf493('0xb')](function(_0x4ee957){logger[_0xf493('0xc')](_0xf493('0xd'),_0x599153,_0xf493('0xe'));logger[_0xf493('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x599153,_0xf493('0xe'),JSON[_0xf493('0x10')](_0x4ee957));if(_0x4ee957[_0xf493('0x11')]){if(_0x4ee957[_0xf493('0x11')]['code']===0x1f4){logger['error'](_0xf493('0xd'),_0x599153,_0x4ee957['error'][_0xf493('0x12')]);return _0x1947c1(_0x4ee957['error'][_0xf493('0x12')]);}logger['error'](_0xf493('0xd'),_0x599153,_0x4ee957['error'][_0xf493('0x12')]);return _0xf26dc0(_0x4ee957[_0xf493('0x11')]['message']);}else{logger['info'](_0xf493('0xd'),_0x599153,'request\x20sent');_0xf26dc0(_0x4ee957[_0xf493('0x13')][_0xf493('0x12')]);}})[_0xf493('0x14')](function(_0x1526e7){logger[_0xf493('0x11')](_0xf493('0xd'),_0x599153,_0x1526e7);_0x1947c1(_0x1526e7);});});} \ No newline at end of file +var _0xd576=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x48275a,_0x9d27b7){var _0x31be16=function(_0x3391cf){while(--_0x3391cf){_0x48275a['push'](_0x48275a['shift']());}};_0x31be16(++_0x9d27b7);}(_0xd576,0xd8));var _0x6d57=function(_0x6b02c5,_0x5a9734){_0x6b02c5=_0x6b02c5-0x0;var _0x10f527=_0xd576[_0x6b02c5];return _0x10f527;};'use strict';var _=require(_0x6d57('0x0'));var util=require(_0x6d57('0x1'));var moment=require(_0x6d57('0x2'));var BPromise=require(_0x6d57('0x3'));var rs=require(_0x6d57('0x4'));var fs=require('fs');var Redis=require(_0x6d57('0x5'));var db=require(_0x6d57('0x6'))['db'];var utils=require(_0x6d57('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d57('0x8'));var jayson=require(_0x6d57('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b26f9,_0x44e778,_0x489215){return new BPromise(function(_0x4f3ed0,_0x1b8e6d){return client[_0x6d57('0xa')](_0x4b26f9,_0x489215)[_0x6d57('0xb')](function(_0x1ce513){logger[_0x6d57('0xc')](_0x6d57('0xd'),_0x44e778,_0x6d57('0xe'));logger[_0x6d57('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x44e778,_0x6d57('0xe'),JSON[_0x6d57('0x10')](_0x1ce513));if(_0x1ce513['error']){if(_0x1ce513[_0x6d57('0x11')]['code']===0x1f4){logger[_0x6d57('0x11')](_0x6d57('0xd'),_0x44e778,_0x1ce513[_0x6d57('0x11')][_0x6d57('0x12')]);return _0x1b8e6d(_0x1ce513[_0x6d57('0x11')][_0x6d57('0x12')]);}logger[_0x6d57('0x11')](_0x6d57('0xd'),_0x44e778,_0x1ce513['error'][_0x6d57('0x12')]);return _0x4f3ed0(_0x1ce513[_0x6d57('0x11')][_0x6d57('0x12')]);}else{logger[_0x6d57('0xc')](_0x6d57('0xd'),_0x44e778,_0x6d57('0xe'));_0x4f3ed0(_0x1ce513[_0x6d57('0x13')][_0x6d57('0x12')]);}})[_0x6d57('0x14')](function(_0x57901b){logger['error'](_0x6d57('0xd'),_0x44e778,_0x57901b);_0x1b8e6d(_0x57901b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index e519724..2a01881 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 _0x6bfe=['/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','addLogo','logologin','extname','/:id/logo_login','file','addLogoLogin','preferred','favicon','single','addFavicon','put','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/now','/:id','/:id/logo','getLogo','getLogoLogin','/:id/preferred','getPreferred'];(function(_0x344d85,_0x5e08b5){var _0x31179f=function(_0xe59577){while(--_0xe59577){_0x344d85['push'](_0x344d85['shift']());}};_0x31179f(++_0x5e08b5);}(_0x6bfe,0x13f));var _0xe6bf=function(_0x3e23db,_0x4277a0){_0x3e23db=_0x3e23db-0x0;var _0x4287dd=_0x6bfe[_0x3e23db];return _0x4287dd;};'use strict';var multer=require(_0xe6bf('0x0'));var util=require('util');var path=require(_0xe6bf('0x1'));var timeout=require(_0xe6bf('0x2'));var express=require(_0xe6bf('0x3'));var router=express[_0xe6bf('0x4')]();var fs_extra=require(_0xe6bf('0x5'));var auth=require(_0xe6bf('0x6'));var interaction=require(_0xe6bf('0x7'));var config=require(_0xe6bf('0x8'));var controller=require('./setting.controller');router[_0xe6bf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe6bf('0x9')](_0xe6bf('0xa'),controller['getDate']);router['get'](_0xe6bf('0xb'),controller['show']);router[_0xe6bf('0x9')](_0xe6bf('0xc'),controller[_0xe6bf('0xd')]);router['get']('/:id/logo_login',controller[_0xe6bf('0xe')]);router[_0xe6bf('0x9')]('/:id/gdpr',controller['gdpr']);router['get'](_0xe6bf('0xf'),controller[_0xe6bf('0x10')]);router['get'](_0xe6bf('0x11'),controller[_0xe6bf('0x12')]);var upload=multer({'storage':multer[_0xe6bf('0x13')]({'destination':function(_0x42c389,_0x5f0a41,_0x2702d2){_0x2702d2(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x3390ab,_0x8c1700,_0x4cb395){_0x4cb395(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x19'),path['extname'](_0x8c1700[_0xe6bf('0x1a')])));}})});router[_0xe6bf('0x1b')](_0xe6bf('0xc'),upload['single']('file'),controller[_0xe6bf('0x1c')]);var upload=multer({'storage':multer[_0xe6bf('0x13')]({'destination':function(_0x32dcdd,_0x2d77cb,_0x1e0e47){_0x1e0e47(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x23befa,_0x2e51f0,_0x15fb09){_0x15fb09(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x1d'),path[_0xe6bf('0x1e')](_0x2e51f0[_0xe6bf('0x1a')])));}})});router['post'](_0xe6bf('0x1f'),upload['single'](_0xe6bf('0x20')),controller[_0xe6bf('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e1718,_0x2a9ef2,_0x11a2ef){_0x11a2ef(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x369efd,_0x1adcd3,_0x4b3429){_0x4b3429(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x22'),path[_0xe6bf('0x1e')](_0x1adcd3[_0xe6bf('0x1a')])));}})});router['post']('/:id/preferred',upload['single'](_0xe6bf('0x20')),controller['addPreferred']);var upload=multer({'storage':multer[_0xe6bf('0x13')]({'destination':function(_0x5d60d6,_0x18be34,_0x1bbadf){_0x1bbadf(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x2e8d47,_0x192e30,_0x107cc8){_0x107cc8(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x23'),path[_0xe6bf('0x1e')](_0x192e30['originalname'])));}})});router[_0xe6bf('0x1b')](_0xe6bf('0x11'),upload[_0xe6bf('0x24')]('file'),controller[_0xe6bf('0x25')]);router[_0xe6bf('0x26')](_0xe6bf('0xb'),auth[_0xe6bf('0x27')](),controller[_0xe6bf('0x28')]);module[_0xe6bf('0x29')]=router; \ No newline at end of file +var _0x67dc=['getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon','getFavicon','join','root','format','logo','extname','originalname','post','file','addLogo','diskStorage','server/files/images/logos/','%s%s','single','addLogoLogin','/:id/preferred','addPreferred','favicon','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','get','/now','getDate','show','/:id/logo'];(function(_0x3d8304,_0x3e0d97){var _0xb9ea24=function(_0x3146c5){while(--_0x3146c5){_0x3d8304['push'](_0x3d8304['shift']());}};_0xb9ea24(++_0x3e0d97);}(_0x67dc,0x13a));var _0xc67d=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0x67dc[_0x5e3701];return _0x345dcf;};'use strict';var multer=require(_0xc67d('0x0'));var util=require(_0xc67d('0x1'));var path=require(_0xc67d('0x2'));var timeout=require(_0xc67d('0x3'));var express=require(_0xc67d('0x4'));var router=express[_0xc67d('0x5')]();var fs_extra=require(_0xc67d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./setting.controller');router['get']('/',auth[_0xc67d('0x7')](),controller[_0xc67d('0x8')]);router[_0xc67d('0x9')](_0xc67d('0xa'),controller[_0xc67d('0xb')]);router['get']('/:id',controller[_0xc67d('0xc')]);router[_0xc67d('0x9')](_0xc67d('0xd'),controller[_0xc67d('0xe')]);router[_0xc67d('0x9')](_0xc67d('0xf'),controller[_0xc67d('0x10')]);router['get']('/:id/gdpr',controller[_0xc67d('0x11')]);router[_0xc67d('0x9')]('/:id/preferred',controller['getPreferred']);router['get'](_0xc67d('0x12'),controller[_0xc67d('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2630cc,_0x1eed4e,_0x59a198){_0x59a198(null,path[_0xc67d('0x14')](config[_0xc67d('0x15')],'server/files/images/logos/'));},'filename':function(_0xe5baa3,_0xdfb29b,_0x3176a6){_0x3176a6(null,util[_0xc67d('0x16')]('%s%s',_0xc67d('0x17'),path[_0xc67d('0x18')](_0xdfb29b[_0xc67d('0x19')])));}})});router[_0xc67d('0x1a')](_0xc67d('0xd'),upload['single'](_0xc67d('0x1b')),controller[_0xc67d('0x1c')]);var upload=multer({'storage':multer[_0xc67d('0x1d')]({'destination':function(_0x2bb159,_0x4db40c,_0x378f92){_0x378f92(null,path[_0xc67d('0x14')](config['root'],_0xc67d('0x1e')));},'filename':function(_0x59908d,_0x1e8ef8,_0xb51019){_0xb51019(null,util[_0xc67d('0x16')](_0xc67d('0x1f'),'logologin',path[_0xc67d('0x18')](_0x1e8ef8[_0xc67d('0x19')])));}})});router['post'](_0xc67d('0xf'),upload[_0xc67d('0x20')](_0xc67d('0x1b')),controller[_0xc67d('0x21')]);var upload=multer({'storage':multer[_0xc67d('0x1d')]({'destination':function(_0x49751c,_0x213be4,_0x433b08){_0x433b08(null,path[_0xc67d('0x14')](config[_0xc67d('0x15')],'server/files/images/logos/'));},'filename':function(_0x19cd54,_0x12aede,_0x3d7582){_0x3d7582(null,util[_0xc67d('0x16')]('%s%s','preferred',path[_0xc67d('0x18')](_0x12aede[_0xc67d('0x19')])));}})});router[_0xc67d('0x1a')](_0xc67d('0x22'),upload[_0xc67d('0x20')](_0xc67d('0x1b')),controller[_0xc67d('0x23')]);var upload=multer({'storage':multer[_0xc67d('0x1d')]({'destination':function(_0x4a3a24,_0x4ed5f5,_0xd47783){_0xd47783(null,path[_0xc67d('0x14')](config[_0xc67d('0x15')],_0xc67d('0x1e')));},'filename':function(_0xab3378,_0x506978,_0x3912a1){_0x3912a1(null,util['format'](_0xc67d('0x1f'),_0xc67d('0x24'),path['extname'](_0x506978[_0xc67d('0x19')])));}})});router[_0xc67d('0x1a')](_0xc67d('0x12'),upload[_0xc67d('0x20')]('file'),controller['addFavicon']);router[_0xc67d('0x25')](_0xc67d('0x26'),auth[_0xc67d('0x7')](),controller[_0xc67d('0x27')]);module[_0xc67d('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 3587d90..e3ffa8a 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 _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0xfa0568,_0x1de7ce){var _0x5ec3ca=function(_0x3ae0d4){while(--_0x3ae0d4){_0xfa0568['push'](_0xfa0568['shift']());}};_0x5ec3ca(++_0x1de7ce);}(_0x1261,0x144));var _0x1126=function(_0x3eaea7,_0x9968ff){_0x3eaea7=_0x3eaea7-0x0;var _0xd7cd35=_0x1261[_0x3eaea7];return _0xd7cd35;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0x14915d,_0x46bdd6){var _0x4852d8=function(_0x5c46fc){while(--_0x5c46fc){_0x14915d['push'](_0x14915d['shift']());}};_0x4852d8(++_0x46bdd6);}(_0x1261,0x144));var _0x1126=function(_0x2f23c6,_0x8eacbc){_0x2f23c6=_0x2f23c6-0x0;var _0x12e26a=_0x1261[_0x2f23c6];return _0x12e26a;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c0a5fa6..236e206 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 _0xa6b3=['fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','end','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','body','find','params','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','defaultLogo','defaultLoginLogo','defaultPreferred','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','download','getLogoLogin','preferred','favicon','defaultFavicon','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x3d341c,_0x13679){var _0x3ea876=function(_0x1e0b2a){while(--_0x1e0b2a){_0x3d341c['push'](_0x3d341c['shift']());}};_0x3ea876(++_0x13679);}(_0xa6b3,0x72));var _0x3a6b=function(_0x3e093e,_0xbc2ce3){_0x3e093e=_0x3e093e-0x0;var _0x51b5b1=_0xa6b3[_0x3e093e];return _0x51b5b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a6b('0x1'));var rp=require('request-promise');var moment=require(_0x3a6b('0x2'));var BPromise=require(_0x3a6b('0x3'));var Mustache=require('mustache');var util=require(_0x3a6b('0x4'));var path=require(_0x3a6b('0x5'));var sox=require(_0x3a6b('0x6'));var csv=require(_0x3a6b('0x7'));var ejs=require(_0x3a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x3a6b('0x9'));var _=require('lodash');var squel=require(_0x3a6b('0xa'));var crypto=require(_0x3a6b('0xb'));var jsforce=require(_0x3a6b('0xc'));var deskjs=require(_0x3a6b('0xd'));var toCsv=require(_0x3a6b('0x7'));var querystring=require('querystring');var Papa=require(_0x3a6b('0xe'));var Redis=require(_0x3a6b('0xf'));var authService=require(_0x3a6b('0x10'));var qs=require(_0x3a6b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a6b('0x12'));var logger=require('../../config/logger')(_0x3a6b('0x13'));var utils=require(_0x3a6b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3a6b('0x15'));var db=require(_0x3a6b('0x16'))['db'];var jayson=require(_0x3a6b('0x17'));var client=jayson[_0x3a6b('0x18')][_0x3a6b('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x13b2f1,_0x307c07,_0xb784e5,_0x155bb0){return new BPromise(function(_0xa46c39,_0x58e63c){var _0x4edcb3=_0x155bb0||client;return _0x4edcb3[_0x3a6b('0x1a')](_0x13b2f1,_0xb784e5)[_0x3a6b('0x1b')](function(_0x4f8b0c){logger[_0x3a6b('0x1c')](_0x3a6b('0x1d'),_0x307c07,_0x3a6b('0x1e'));logger['debug'](_0x3a6b('0x1f'),_0x307c07,_0x3a6b('0x1e'),JSON['stringify'](_0x4f8b0c));if(_0x4f8b0c[_0x3a6b('0x20')]){if(_0x4f8b0c[_0x3a6b('0x20')][_0x3a6b('0x21')]===0x1f4){logger[_0x3a6b('0x20')]('Setting,\x20%s,\x20%s',_0x307c07,_0x4f8b0c[_0x3a6b('0x20')]['message']);return _0x58e63c(_0x4f8b0c[_0x3a6b('0x20')][_0x3a6b('0x22')]);}logger[_0x3a6b('0x20')](_0x3a6b('0x1d'),_0x307c07,_0x4f8b0c[_0x3a6b('0x20')]['message']);return _0xa46c39(_0x4f8b0c[_0x3a6b('0x20')][_0x3a6b('0x22')]);}else{logger[_0x3a6b('0x1c')](_0x3a6b('0x1d'),_0x307c07,'request\x20sent');_0xa46c39(_0x4f8b0c[_0x3a6b('0x23')][_0x3a6b('0x22')]);}})[_0x3a6b('0x24')](function(_0x4c7066){logger[_0x3a6b('0x20')]('Setting,\x20%s,\x20%s',_0x307c07,_0x4c7066);_0x58e63c(_0x4c7066);});});}function respondWithStatusCode(_0x1e218b,_0x24201d){_0x24201d=_0x24201d||0xcc;return function(_0xcd532e){if(_0xcd532e){return _0x1e218b[_0x3a6b('0x25')](_0x24201d);}return _0x1e218b['status'](_0x24201d)['end']();};}function respondWithResult(_0x1a4aae,_0x175165){_0x175165=_0x175165||0xc8;return function(_0x4d8bd3){if(_0x4d8bd3){return _0x1a4aae[_0x3a6b('0x26')](_0x175165)[_0x3a6b('0x27')](_0x4d8bd3);}};}function respondWithFilteredResult(_0x229cd1,_0x49f0a8){return function(_0x4e100c){if(_0x4e100c){var _0x1ecf6f=typeof _0x49f0a8[_0x3a6b('0x28')]===_0x3a6b('0x29')&&typeof _0x49f0a8['limit']===_0x3a6b('0x29');var _0x549f65=_0x4e100c[_0x3a6b('0x2a')];var _0x38a937=_0x1ecf6f?0x0:_0x49f0a8['offset'];var _0x19537d=_0x1ecf6f?_0x4e100c['count']:_0x49f0a8[_0x3a6b('0x28')]+_0x49f0a8['limit'];var _0x50baf4;if(_0x19537d>=_0x549f65){_0x19537d=_0x549f65;_0x50baf4=0xc8;}else{_0x50baf4=0xce;}_0x229cd1[_0x3a6b('0x26')](_0x50baf4);return _0x229cd1[_0x3a6b('0x2b')](_0x3a6b('0x2c'),_0x38a937+'-'+_0x19537d+'/'+_0x549f65)[_0x3a6b('0x27')](_0x4e100c);}return null;};}function patchUpdates(_0x23e4dd){return function(_0x10aa02){try{jsonpatch[_0x3a6b('0x2d')](_0x10aa02,_0x23e4dd,!![]);}catch(_0x408b1f){return BPromise[_0x3a6b('0x2e')](_0x408b1f);}return _0x10aa02[_0x3a6b('0x2f')]();};}function saveUpdates(_0x3f5cc5,_0x4b9782){return function(_0x2d5a17){if(_0x2d5a17){return _0x2d5a17[_0x3a6b('0x30')](_0x3f5cc5)[_0x3a6b('0x1b')](function(_0xa6b0c0){return _0xa6b0c0;});}return null;};}function removeEntity(_0x1d2ae8,_0x285614){return function(_0xb18cb8){if(_0xb18cb8){return _0xb18cb8['destroy']()[_0x3a6b('0x1b')](function(){_0x1d2ae8['status'](0xcc)[_0x3a6b('0x31')]();});}};}function handleEntityNotFound(_0x4ca004,_0x207a42){return function(_0x478d24){if(!_0x478d24){_0x4ca004[_0x3a6b('0x25')](0x194);}return _0x478d24;};}function handleError(_0x1e6d71,_0x5c8015){_0x5c8015=_0x5c8015||0x1f4;return function(_0x3b1d4c){logger[_0x3a6b('0x20')](_0x3b1d4c[_0x3a6b('0x32')]);if(_0x3b1d4c[_0x3a6b('0x33')]){delete _0x3b1d4c[_0x3a6b('0x33')];}_0x1e6d71[_0x3a6b('0x26')](_0x5c8015)['send'](_0x3b1d4c);};}exports['index']=function(_0xa02ab8,_0x4f3afe){var _0x1cb3ff={},_0x182d7c={},_0xef72e2={'count':0x0,'rows':[]};var _0x129b5e=_[_0x3a6b('0x34')](db[_0x3a6b('0x35')][_0x3a6b('0x36')],function(_0x944759){return{'name':_0x944759[_0x3a6b('0x37')],'type':_0x944759[_0x3a6b('0x38')][_0x3a6b('0x39')]};});_0x182d7c[_0x3a6b('0x3a')]=_[_0x3a6b('0x34')](_0x129b5e,_0x3a6b('0x33'));_0x182d7c[_0x3a6b('0x3b')]=_[_0x3a6b('0x3c')](_0xa02ab8[_0x3a6b('0x3b')]);_0x182d7c[_0x3a6b('0x3d')]=_[_0x3a6b('0x3e')](_0x182d7c[_0x3a6b('0x3a')],_0x182d7c[_0x3a6b('0x3b')]);_0x1cb3ff[_0x3a6b('0x3f')]=_[_0x3a6b('0x3e')](_0x182d7c[_0x3a6b('0x3a')],qs[_0x3a6b('0x40')](_0xa02ab8[_0x3a6b('0x3b')]['fields']));_0x1cb3ff[_0x3a6b('0x3f')]=_0x1cb3ff[_0x3a6b('0x3f')][_0x3a6b('0x41')]?_0x1cb3ff[_0x3a6b('0x3f')]:_0x182d7c['model'];if(!_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x42')](_0x3a6b('0x43'))){_0x1cb3ff[_0x3a6b('0x44')]=qs[_0x3a6b('0x44')](_0xa02ab8[_0x3a6b('0x3b')]['limit']);_0x1cb3ff[_0x3a6b('0x28')]=qs['offset'](_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x28')]);}_0x1cb3ff['order']=qs[_0x3a6b('0x45')](_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x45')]);_0x1cb3ff['where']=qs[_0x3a6b('0x3d')](_[_0x3a6b('0x46')](_0xa02ab8[_0x3a6b('0x3b')],_0x182d7c[_0x3a6b('0x3d')]),_0x129b5e);if(_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x47')]){_0x1cb3ff[_0x3a6b('0x48')]=_[_0x3a6b('0x49')](_0x1cb3ff[_0x3a6b('0x48')],{'$or':_[_0x3a6b('0x34')](_0x129b5e,function(_0x43d6dd){if(_0x43d6dd[_0x3a6b('0x38')]!==_0x3a6b('0x4a')){var _0x4eac0e={};_0x4eac0e[_0x43d6dd['name']]={'$like':'%'+_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x47')]+'%'};return _0x4eac0e;}})});}_0x1cb3ff=_[_0x3a6b('0x49')]({},_0x1cb3ff,_0xa02ab8['options']);var _0x22ae37={'where':_0x1cb3ff['where']};return db[_0x3a6b('0x35')]['count'](_0x22ae37)[_0x3a6b('0x1b')](function(_0x13f94e){_0xef72e2[_0x3a6b('0x2a')]=_0x13f94e;if(_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x4b')]){_0x1cb3ff[_0x3a6b('0x4c')]=[{'all':!![]}];}return db[_0x3a6b('0x35')][_0x3a6b('0x4d')](_0x1cb3ff);})['then'](function(_0x1c3290){_0xef72e2[_0x3a6b('0x4e')]=_0x1c3290;return _0xef72e2;})[_0x3a6b('0x1b')](respondWithFilteredResult(_0x4f3afe,_0x1cb3ff))['catch'](handleError(_0x4f3afe,null));};exports[_0x3a6b('0x4f')]=function(_0x274fa3,_0x2e0994){var _0x15925a={'raw':![],'where':{'id':_0x274fa3['params']['id']}},_0x16a1b2={};_0x16a1b2[_0x3a6b('0x3a')]=_[_0x3a6b('0x3c')](db[_0x3a6b('0x35')][_0x3a6b('0x36')]);_0x16a1b2[_0x3a6b('0x3b')]=_[_0x3a6b('0x3c')](_0x274fa3['query']);_0x16a1b2[_0x3a6b('0x3d')]=_[_0x3a6b('0x3e')](_0x16a1b2[_0x3a6b('0x3a')],_0x16a1b2[_0x3a6b('0x3b')]);_0x15925a[_0x3a6b('0x3f')]=_['intersection'](_0x16a1b2[_0x3a6b('0x3a')],qs[_0x3a6b('0x40')](_0x274fa3['query'][_0x3a6b('0x40')]));_0x15925a[_0x3a6b('0x3f')]=_0x15925a[_0x3a6b('0x3f')][_0x3a6b('0x41')]?_0x15925a['attributes']:_0x16a1b2[_0x3a6b('0x3a')];if(_0x274fa3[_0x3a6b('0x3b')][_0x3a6b('0x4b')]){_0x15925a[_0x3a6b('0x4c')]=[{'all':!![]}];}_0x15925a=_[_0x3a6b('0x49')]({},_0x15925a,_0x274fa3[_0x3a6b('0x50')]);return db[_0x3a6b('0x35')]['find'](_0x15925a)[_0x3a6b('0x1b')](handleEntityNotFound(_0x2e0994,null))[_0x3a6b('0x1b')](respondWithResult(_0x2e0994,null))[_0x3a6b('0x24')](handleError(_0x2e0994,null));};exports[_0x3a6b('0x30')]=function(_0x426ed2,_0x3d5807){if(_0x426ed2[_0x3a6b('0x51')]['id']){delete _0x426ed2[_0x3a6b('0x51')]['id'];}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x426ed2[_0x3a6b('0x53')]['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x3d5807,null))[_0x3a6b('0x1b')](saveUpdates(_0x426ed2['body'],null))[_0x3a6b('0x1b')](respondWithResult(_0x3d5807,null))[_0x3a6b('0x24')](handleError(_0x3d5807,null));};exports[_0x3a6b('0x54')]=function(_0x59f44f,_0x6ab3db,_0x5af627){if(_0x59f44f['file']&&_0x59f44f[_0x3a6b('0x55')][_0x3a6b('0x56')]){_0x59f44f['body'][_0x3a6b('0x57')]=_0x59f44f[_0x3a6b('0x55')]['filename'];}return db['Setting'][_0x3a6b('0x52')]({'where':{'id':_0x59f44f['params']['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x6ab3db,null))[_0x3a6b('0x1b')](saveUpdates(_0x59f44f[_0x3a6b('0x51')],null))['then'](respondWithResult(_0x6ab3db,null))[_0x3a6b('0x24')](handleError(_0x6ab3db,null));};exports[_0x3a6b('0x58')]=function(_0x47c5e2,_0x1ce60f,_0x75b9df){if(_0x47c5e2[_0x3a6b('0x55')]&&_0x47c5e2['file'][_0x3a6b('0x56')]){_0x47c5e2[_0x3a6b('0x51')]['loginLogo']=_0x47c5e2[_0x3a6b('0x55')]['filename'];}return db['Setting']['find']({'where':{'id':_0x47c5e2[_0x3a6b('0x53')]['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x1ce60f,null))[_0x3a6b('0x1b')](saveUpdates(_0x47c5e2[_0x3a6b('0x51')],null))[_0x3a6b('0x1b')](respondWithResult(_0x1ce60f,null))[_0x3a6b('0x24')](handleError(_0x1ce60f,null));};var utilLicense=require(_0x3a6b('0x15'));exports[_0x3a6b('0x59')]=function(_0x342966,_0x15cae3,_0x4e8183){var _0x40b7f1=_0x3a6b('0x5a');var _0x33ca93={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()['then'](function(_0x394228){if(_0x394228){_0x33ca93=_0x394228;}return db['Setting']['find']({'where':{'id':_0x342966['params']['id']},'attributes':[_0x3a6b('0x57'),_0x3a6b('0x5c'),'preferred','favicon',_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x3a6b('0x1b')](handleEntityNotFound(_0x15cae3,null))[_0x3a6b('0x1b')](function(_0x415fea){if(_0x415fea){var _0x31a57f=_0x415fea[_0x3a6b('0x57')]&&fs['existsSync'](path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x40b7f1,_[_0x3a6b('0x62')](_0x415fea[_0x3a6b('0x57')])))?path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x40b7f1,_['toLower'](_0x415fea['logo'])):path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x40b7f1,_['toLower'](_0x3a6b('0x63')));var _0x4ee5de=_0x3a6b('0x64')+_[_0x3a6b('0x65')](_0x3a6b('0x57'));if(_0x415fea[_0x4ee5de]||!_0x33ca93[_0x3a6b('0x66')]){_0x31a57f=path[_0x3a6b('0x60')](config['root'],_0x40b7f1,_[_0x3a6b('0x62')](_0x3a6b('0x63')));}if(!fs[_0x3a6b('0x67')](_0x31a57f)){throw new db[(_0x3a6b('0x68'))]['ValidationError'](_[_0x3a6b('0x65')](_0x3a6b('0x57'))+'\x20not\x20found');}return _0x15cae3[_0x3a6b('0x69')](_0x31a57f);}})[_0x3a6b('0x24')](handleError(_0x15cae3,null));};var utilLicense=require(_0x3a6b('0x15'));exports[_0x3a6b('0x6a')]=function(_0x4033cf,_0x3d8506,_0x1c6dd2){var _0x2989ec=_0x3a6b('0x5a');var _0x48480d={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()[_0x3a6b('0x1b')](function(_0x73e887){if(_0x73e887){_0x48480d=_0x73e887;}return db[_0x3a6b('0x35')]['find']({'where':{'id':_0x4033cf[_0x3a6b('0x53')]['id']},'attributes':['logo',_0x3a6b('0x5c'),_0x3a6b('0x6b'),_0x3a6b('0x6c'),_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),_0x3a6b('0x6d')],'raw':!![]});})[_0x3a6b('0x1b')](handleEntityNotFound(_0x3d8506,null))[_0x3a6b('0x1b')](function(_0xd95577){if(_0xd95577){var _0xda82b9=_0xd95577[_0x3a6b('0x5c')]&&fs[_0x3a6b('0x67')](path['join'](config['root'],_0x2989ec,_[_0x3a6b('0x62')](_0xd95577[_0x3a6b('0x5c')])))?path['join'](config[_0x3a6b('0x61')],_0x2989ec,_[_0x3a6b('0x62')](_0xd95577[_0x3a6b('0x5c')])):path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x2989ec,_['toLower'](_0x3a6b('0x6e')));var _0xa56ab5=_0x3a6b('0x64')+_['upperFirst'](_0x3a6b('0x5c'));if(_0xd95577[_0xa56ab5]||!_0x48480d[_0x3a6b('0x66')]){_0xda82b9=path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x2989ec,_[_0x3a6b('0x62')](_0x3a6b('0x6e')));}if(!fs[_0x3a6b('0x67')](_0xda82b9)){throw new db[(_0x3a6b('0x68'))][(_0x3a6b('0x6f'))](_[_0x3a6b('0x65')]('loginLogo')+_0x3a6b('0x70'));}return _0x3d8506[_0x3a6b('0x69')](_0xda82b9);}})[_0x3a6b('0x24')](handleError(_0x3d8506,null));};exports[_0x3a6b('0x71')]=function(_0x22e16c,_0x1f9334){return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x22e16c['params']['id']},'attributes':[_0x3a6b('0x72')]})[_0x3a6b('0x1b')](respondWithResult(_0x1f9334,null))[_0x3a6b('0x24')](handleError(_0x1f9334,null));};exports[_0x3a6b('0x73')]=function(_0x481297,_0x4dc98f,_0x40d36a){if(_0x481297[_0x3a6b('0x55')]&&_0x481297[_0x3a6b('0x55')][_0x3a6b('0x56')]){_0x481297[_0x3a6b('0x51')]['preferred']=_0x481297[_0x3a6b('0x55')][_0x3a6b('0x56')];}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x481297[_0x3a6b('0x53')]['id']}})['then'](handleEntityNotFound(_0x4dc98f,null))[_0x3a6b('0x1b')](saveUpdates(_0x481297['body'],null))[_0x3a6b('0x1b')](respondWithResult(_0x4dc98f,null))['catch'](handleError(_0x4dc98f,null));};var utilLicense=require(_0x3a6b('0x15'));exports['getPreferred']=function(_0x71d36d,_0x2c94df,_0x7ae210){var _0x2a029a=_0x3a6b('0x5a');var _0x3801a6={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()[_0x3a6b('0x1b')](function(_0x59025f){if(_0x59025f){_0x3801a6=_0x59025f;}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x71d36d[_0x3a6b('0x53')]['id']},'attributes':[_0x3a6b('0x57'),_0x3a6b('0x5c'),'preferred',_0x3a6b('0x6c'),_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x3a6b('0x1b')](handleEntityNotFound(_0x2c94df,null))[_0x3a6b('0x1b')](function(_0x5059a9){if(_0x5059a9){var _0x24e413=_0x5059a9[_0x3a6b('0x6b')]&&fs[_0x3a6b('0x67')](path['join'](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x5059a9[_0x3a6b('0x6b')])))?path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x5059a9[_0x3a6b('0x6b')])):path['join'](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x3a6b('0x74')));var _0x4007de=_0x3a6b('0x64')+_['upperFirst'](_0x3a6b('0x6b'));if(_0x5059a9[_0x4007de]||!_0x3801a6[_0x3a6b('0x66')]||!_0x3801a6[_0x3a6b('0x6b')]){_0x24e413=path['join'](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x3a6b('0x74')));}if(!fs['existsSync'](_0x24e413)){throw new db[(_0x3a6b('0x68'))][(_0x3a6b('0x6f'))](_[_0x3a6b('0x65')](_0x3a6b('0x6b'))+_0x3a6b('0x70'));}return _0x2c94df[_0x3a6b('0x69')](_0x24e413);}})[_0x3a6b('0x24')](handleError(_0x2c94df,null));};exports[_0x3a6b('0x75')]=function(_0x12748b,_0x306c12,_0x3d174e){if(_0x12748b['file']&&_0x12748b[_0x3a6b('0x55')]['filename']){_0x12748b[_0x3a6b('0x51')]['favicon']=_0x12748b['file'][_0x3a6b('0x56')];}return db['Setting'][_0x3a6b('0x52')]({'where':{'id':_0x12748b[_0x3a6b('0x53')]['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x306c12,null))[_0x3a6b('0x1b')](saveUpdates(_0x12748b[_0x3a6b('0x51')],null))[_0x3a6b('0x1b')](respondWithResult(_0x306c12,null))['catch'](handleError(_0x306c12,null));};var utilLicense=require(_0x3a6b('0x15'));exports[_0x3a6b('0x76')]=function(_0x1d6f97,_0x413e7d,_0x5269e8){var _0x5e0f3d=_0x3a6b('0x5a');var _0x37ba63={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()[_0x3a6b('0x1b')](function(_0x77b8e4){if(_0x77b8e4){_0x37ba63=_0x77b8e4;}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x1d6f97[_0x3a6b('0x53')]['id']},'attributes':[_0x3a6b('0x57'),'loginLogo','preferred','favicon',_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x413e7d,null))['then'](function(_0xf4e06a){if(_0xf4e06a){var _0x3bb246=_0xf4e06a[_0x3a6b('0x6c')]&&fs[_0x3a6b('0x67')](path[_0x3a6b('0x60')](config['root'],_0x5e0f3d,_[_0x3a6b('0x62')](_0xf4e06a[_0x3a6b('0x6c')])))?path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x5e0f3d,_[_0x3a6b('0x62')](_0xf4e06a[_0x3a6b('0x6c')])):path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x5e0f3d,_[_0x3a6b('0x62')]('default_favicon.ico'));var _0x1a287c='default'+_[_0x3a6b('0x65')](_0x3a6b('0x6c'));if(_0xf4e06a[_0x1a287c]||!_0x37ba63[_0x3a6b('0x66')]){_0x3bb246=path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x5e0f3d,_[_0x3a6b('0x62')]('default_favicon.ico'));}if(!fs['existsSync'](_0x3bb246)){throw new db[(_0x3a6b('0x68'))][(_0x3a6b('0x6f'))](_[_0x3a6b('0x65')](_0x3a6b('0x6c'))+'\x20not\x20found');}return _0x413e7d['download'](_0x3bb246);}})[_0x3a6b('0x24')](handleError(_0x413e7d,null));};exports['getDate']=function(_0x10c9f7,_0x1fbb2e){var _0x52f056={'offset':moment()[_0x3a6b('0x77')]()};_0x52f056[_0x3a6b('0x78')]=moment()[_0x3a6b('0x77')](_0x52f056[_0x3a6b('0x28')])[_0x3a6b('0x79')](_0x3a6b('0x7a'));return _0x1fbb2e['status'](0xc8)['send'](_0x52f056);}; \ No newline at end of file +var _0xca4b=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','body','file','filename','getLogo','server/files/images/logos','getLicense','logo','loginLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','existsSync','default_loginLogo.svg','gdpr','securePassword','addPreferred','../../config/license/util','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','end','stack','name','index','map','Setting','key'];(function(_0x3ad140,_0x184cc9){var _0xe2718f=function(_0x28266d){while(--_0x28266d){_0x3ad140['push'](_0x3ad140['shift']());}};_0xe2718f(++_0x184cc9);}(_0xca4b,0x132));var _0xbca4=function(_0x1d2049,_0x29376f){_0x1d2049=_0x1d2049-0x0;var _0x13c790=_0xca4b[_0x1d2049];return _0x13c790;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbca4('0x0'));var zipdir=require(_0xbca4('0x1'));var jsonpatch=require(_0xbca4('0x2'));var rp=require(_0xbca4('0x3'));var moment=require(_0xbca4('0x4'));var BPromise=require(_0xbca4('0x5'));var Mustache=require('mustache');var util=require(_0xbca4('0x6'));var path=require(_0xbca4('0x7'));var sox=require(_0xbca4('0x8'));var csv=require(_0xbca4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbca4('0xa'));var _=require(_0xbca4('0xb'));var squel=require('squel');var crypto=require(_0xbca4('0xc'));var jsforce=require(_0xbca4('0xd'));var deskjs=require(_0xbca4('0xe'));var toCsv=require(_0xbca4('0x9'));var querystring=require('querystring');var Papa=require(_0xbca4('0xf'));var Redis=require(_0xbca4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbca4('0x11'));var as=require(_0xbca4('0x12'));var hardwareService=require(_0xbca4('0x13'));var logger=require(_0xbca4('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbca4('0x15'))['db'];var jayson=require(_0xbca4('0x16'));var client=jayson[_0xbca4('0x17')][_0xbca4('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x28979d,_0x5d2ff0,_0x20119c,_0x9a4f49){return new BPromise(function(_0x37e020,_0x21b7c6){var _0x9d5011=_0x9a4f49||client;return _0x9d5011['request'](_0x28979d,_0x20119c)[_0xbca4('0x19')](function(_0x27a29a){logger[_0xbca4('0x1a')]('Setting,\x20%s,\x20%s',_0x5d2ff0,_0xbca4('0x1b'));logger[_0xbca4('0x1c')](_0xbca4('0x1d'),_0x5d2ff0,_0xbca4('0x1b'),JSON[_0xbca4('0x1e')](_0x27a29a));if(_0x27a29a[_0xbca4('0x1f')]){if(_0x27a29a[_0xbca4('0x1f')]['code']===0x1f4){logger['error'](_0xbca4('0x20'),_0x5d2ff0,_0x27a29a[_0xbca4('0x1f')][_0xbca4('0x21')]);return _0x21b7c6(_0x27a29a['error']['message']);}logger[_0xbca4('0x1f')](_0xbca4('0x20'),_0x5d2ff0,_0x27a29a[_0xbca4('0x1f')][_0xbca4('0x21')]);return _0x37e020(_0x27a29a[_0xbca4('0x1f')][_0xbca4('0x21')]);}else{logger[_0xbca4('0x1a')](_0xbca4('0x20'),_0x5d2ff0,_0xbca4('0x1b'));_0x37e020(_0x27a29a[_0xbca4('0x22')][_0xbca4('0x21')]);}})['catch'](function(_0x24a84c){logger[_0xbca4('0x1f')]('Setting,\x20%s,\x20%s',_0x5d2ff0,_0x24a84c);_0x21b7c6(_0x24a84c);});});}function respondWithStatusCode(_0x5358e2,_0x1209a1){_0x1209a1=_0x1209a1||0xcc;return function(_0x193d04){if(_0x193d04){return _0x5358e2[_0xbca4('0x23')](_0x1209a1);}return _0x5358e2[_0xbca4('0x24')](_0x1209a1)['end']();};}function respondWithResult(_0x6605b8,_0x48f117){_0x48f117=_0x48f117||0xc8;return function(_0x4b8004){if(_0x4b8004){return _0x6605b8[_0xbca4('0x24')](_0x48f117)[_0xbca4('0x25')](_0x4b8004);}};}function respondWithFilteredResult(_0x3b1f40,_0x1a335c){return function(_0x506d1b){if(_0x506d1b){var _0x267120=typeof _0x1a335c[_0xbca4('0x26')]===_0xbca4('0x27')&&typeof _0x1a335c['limit']==='undefined';var _0x39ce47=_0x506d1b[_0xbca4('0x28')];var _0x342a1d=_0x267120?0x0:_0x1a335c['offset'];var _0x23955e=_0x267120?_0x506d1b[_0xbca4('0x28')]:_0x1a335c[_0xbca4('0x26')]+_0x1a335c['limit'];var _0x28e41e;if(_0x23955e>=_0x39ce47){_0x23955e=_0x39ce47;_0x28e41e=0xc8;}else{_0x28e41e=0xce;}_0x3b1f40[_0xbca4('0x24')](_0x28e41e);return _0x3b1f40[_0xbca4('0x29')](_0xbca4('0x2a'),_0x342a1d+'-'+_0x23955e+'/'+_0x39ce47)[_0xbca4('0x25')](_0x506d1b);}return null;};}function patchUpdates(_0x4e8114){return function(_0x424a6b){try{jsonpatch[_0xbca4('0x2b')](_0x424a6b,_0x4e8114,!![]);}catch(_0x47f742){return BPromise['reject'](_0x47f742);}return _0x424a6b[_0xbca4('0x2c')]();};}function saveUpdates(_0x5d8b2a,_0x1d2470){return function(_0x47d224){if(_0x47d224){return _0x47d224[_0xbca4('0x2d')](_0x5d8b2a)[_0xbca4('0x19')](function(_0x1de25d){return _0x1de25d;});}return null;};}function removeEntity(_0x1d3bd6,_0x565073){return function(_0x2b3013){if(_0x2b3013){return _0x2b3013[_0xbca4('0x2e')]()[_0xbca4('0x19')](function(){_0x1d3bd6[_0xbca4('0x24')](0xcc)[_0xbca4('0x2f')]();});}};}function handleEntityNotFound(_0x441046,_0x39d43b){return function(_0x1485ea){if(!_0x1485ea){_0x441046['sendStatus'](0x194);}return _0x1485ea;};}function handleError(_0x5b90b8,_0x4db6b9){_0x4db6b9=_0x4db6b9||0x1f4;return function(_0x231942){logger[_0xbca4('0x1f')](_0x231942[_0xbca4('0x30')]);if(_0x231942['name']){delete _0x231942[_0xbca4('0x31')];}_0x5b90b8[_0xbca4('0x24')](_0x4db6b9)['send'](_0x231942);};}exports[_0xbca4('0x32')]=function(_0x3c3a2d,_0x4b9ab6){var _0x19ca4b={},_0x2df98a={},_0x569b5d={'count':0x0,'rows':[]};var _0xb07032=_[_0xbca4('0x33')](db[_0xbca4('0x34')]['rawAttributes'],function(_0x2391b4){return{'name':_0x2391b4['fieldName'],'type':_0x2391b4['type'][_0xbca4('0x35')]};});_0x2df98a[_0xbca4('0x36')]=_[_0xbca4('0x33')](_0xb07032,_0xbca4('0x31'));_0x2df98a[_0xbca4('0x37')]=_[_0xbca4('0x38')](_0x3c3a2d[_0xbca4('0x37')]);_0x2df98a[_0xbca4('0x39')]=_[_0xbca4('0x3a')](_0x2df98a[_0xbca4('0x36')],_0x2df98a[_0xbca4('0x37')]);_0x19ca4b['attributes']=_[_0xbca4('0x3a')](_0x2df98a[_0xbca4('0x36')],qs[_0xbca4('0x3b')](_0x3c3a2d[_0xbca4('0x37')][_0xbca4('0x3b')]));_0x19ca4b[_0xbca4('0x3c')]=_0x19ca4b['attributes'][_0xbca4('0x3d')]?_0x19ca4b[_0xbca4('0x3c')]:_0x2df98a[_0xbca4('0x36')];if(!_0x3c3a2d[_0xbca4('0x37')][_0xbca4('0x3e')](_0xbca4('0x3f'))){_0x19ca4b[_0xbca4('0x40')]=qs[_0xbca4('0x40')](_0x3c3a2d[_0xbca4('0x37')][_0xbca4('0x40')]);_0x19ca4b[_0xbca4('0x26')]=qs[_0xbca4('0x26')](_0x3c3a2d['query'][_0xbca4('0x26')]);}_0x19ca4b['order']=qs['sort'](_0x3c3a2d['query'][_0xbca4('0x41')]);_0x19ca4b[_0xbca4('0x42')]=qs[_0xbca4('0x39')](_['pick'](_0x3c3a2d[_0xbca4('0x37')],_0x2df98a['filters']),_0xb07032);if(_0x3c3a2d[_0xbca4('0x37')][_0xbca4('0x43')]){_0x19ca4b[_0xbca4('0x42')]=_[_0xbca4('0x44')](_0x19ca4b[_0xbca4('0x42')],{'$or':_[_0xbca4('0x33')](_0xb07032,function(_0x2a55b0){if(_0x2a55b0[_0xbca4('0x45')]!==_0xbca4('0x46')){var _0x42ba68={};_0x42ba68[_0x2a55b0[_0xbca4('0x31')]]={'$like':'%'+_0x3c3a2d[_0xbca4('0x37')][_0xbca4('0x43')]+'%'};return _0x42ba68;}})});}_0x19ca4b=_[_0xbca4('0x44')]({},_0x19ca4b,_0x3c3a2d[_0xbca4('0x47')]);var _0x5ecb3b={'where':_0x19ca4b[_0xbca4('0x42')]};return db[_0xbca4('0x34')]['count'](_0x5ecb3b)[_0xbca4('0x19')](function(_0x329432){_0x569b5d[_0xbca4('0x28')]=_0x329432;if(_0x3c3a2d[_0xbca4('0x37')]['includeAll']){_0x19ca4b[_0xbca4('0x48')]=[{'all':!![]}];}return db[_0xbca4('0x34')][_0xbca4('0x49')](_0x19ca4b);})['then'](function(_0x3a3e9d){_0x569b5d['rows']=_0x3a3e9d;return _0x569b5d;})[_0xbca4('0x19')](respondWithFilteredResult(_0x4b9ab6,_0x19ca4b))[_0xbca4('0x4a')](handleError(_0x4b9ab6,null));};exports[_0xbca4('0x4b')]=function(_0x593a62,_0x2d3467){var _0x1b120c={'raw':![],'where':{'id':_0x593a62[_0xbca4('0x4c')]['id']}},_0x5ebbec={};_0x5ebbec[_0xbca4('0x36')]=_['keys'](db['Setting']['rawAttributes']);_0x5ebbec[_0xbca4('0x37')]=_['keys'](_0x593a62[_0xbca4('0x37')]);_0x5ebbec[_0xbca4('0x39')]=_['intersection'](_0x5ebbec[_0xbca4('0x36')],_0x5ebbec[_0xbca4('0x37')]);_0x1b120c[_0xbca4('0x3c')]=_[_0xbca4('0x3a')](_0x5ebbec[_0xbca4('0x36')],qs['fields'](_0x593a62[_0xbca4('0x37')][_0xbca4('0x3b')]));_0x1b120c[_0xbca4('0x3c')]=_0x1b120c[_0xbca4('0x3c')][_0xbca4('0x3d')]?_0x1b120c[_0xbca4('0x3c')]:_0x5ebbec[_0xbca4('0x36')];if(_0x593a62[_0xbca4('0x37')][_0xbca4('0x4d')]){_0x1b120c[_0xbca4('0x48')]=[{'all':!![]}];}_0x1b120c=_[_0xbca4('0x44')]({},_0x1b120c,_0x593a62[_0xbca4('0x47')]);return db['Setting'][_0xbca4('0x4e')](_0x1b120c)[_0xbca4('0x19')](handleEntityNotFound(_0x2d3467,null))['then'](respondWithResult(_0x2d3467,null))[_0xbca4('0x4a')](handleError(_0x2d3467,null));};exports[_0xbca4('0x2d')]=function(_0x361649,_0x128600){if(_0x361649[_0xbca4('0x4f')]['id']){delete _0x361649[_0xbca4('0x4f')]['id'];}return db[_0xbca4('0x34')]['find']({'where':{'id':_0x361649[_0xbca4('0x4c')]['id']}})[_0xbca4('0x19')](handleEntityNotFound(_0x128600,null))[_0xbca4('0x19')](saveUpdates(_0x361649[_0xbca4('0x4f')],null))[_0xbca4('0x19')](respondWithResult(_0x128600,null))[_0xbca4('0x4a')](handleError(_0x128600,null));};exports['addLogo']=function(_0xc62042,_0x41df3e,_0x11fe3f){if(_0xc62042[_0xbca4('0x50')]&&_0xc62042['file'][_0xbca4('0x51')]){_0xc62042[_0xbca4('0x4f')]['logo']=_0xc62042[_0xbca4('0x50')][_0xbca4('0x51')];}return db['Setting']['find']({'where':{'id':_0xc62042[_0xbca4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x41df3e,null))[_0xbca4('0x19')](saveUpdates(_0xc62042['body'],null))['then'](respondWithResult(_0x41df3e,null))[_0xbca4('0x4a')](handleError(_0x41df3e,null));};exports['addLogoLogin']=function(_0xa9b4f2,_0x5d4dba,_0x5412e5){if(_0xa9b4f2['file']&&_0xa9b4f2[_0xbca4('0x50')][_0xbca4('0x51')]){_0xa9b4f2[_0xbca4('0x4f')]['loginLogo']=_0xa9b4f2[_0xbca4('0x50')][_0xbca4('0x51')];}return db['Setting'][_0xbca4('0x4e')]({'where':{'id':_0xa9b4f2[_0xbca4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5d4dba,null))[_0xbca4('0x19')](saveUpdates(_0xa9b4f2[_0xbca4('0x4f')],null))['then'](respondWithResult(_0x5d4dba,null))['catch'](handleError(_0x5d4dba,null));};var utilLicense=require('../../config/license/util');exports[_0xbca4('0x52')]=function(_0x35d062,_0x29bc45,_0x485f95){var _0xba1279=_0xbca4('0x53');var _0x2e606c={'custom':![]};return utilLicense[_0xbca4('0x54')]()['then'](function(_0xd8d251){if(_0xd8d251){_0x2e606c=_0xd8d251;}return db[_0xbca4('0x34')][_0xbca4('0x4e')]({'where':{'id':_0x35d062[_0xbca4('0x4c')]['id']},'attributes':[_0xbca4('0x55'),_0xbca4('0x56'),_0xbca4('0x57'),_0xbca4('0x58'),_0xbca4('0x59'),'defaultLoginLogo',_0xbca4('0x5a'),_0xbca4('0x5b')],'raw':!![]});})[_0xbca4('0x19')](handleEntityNotFound(_0x29bc45,null))[_0xbca4('0x19')](function(_0x3b9afd){if(_0x3b9afd){var _0x29e9f7=_0x3b9afd[_0xbca4('0x55')]&&fs['existsSync'](path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0xba1279,_['toLower'](_0x3b9afd[_0xbca4('0x55')])))?path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0xba1279,_[_0xbca4('0x5e')](_0x3b9afd['logo'])):path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0xba1279,_[_0xbca4('0x5e')](_0xbca4('0x5f')));var _0x567a2a=_0xbca4('0x60')+_[_0xbca4('0x61')](_0xbca4('0x55'));if(_0x3b9afd[_0x567a2a]||!_0x2e606c[_0xbca4('0x62')]){_0x29e9f7=path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0xba1279,_[_0xbca4('0x5e')](_0xbca4('0x5f')));}if(!fs['existsSync'](_0x29e9f7)){throw new db[(_0xbca4('0x63'))][(_0xbca4('0x64'))](_[_0xbca4('0x61')](_0xbca4('0x55'))+_0xbca4('0x65'));}return _0x29bc45[_0xbca4('0x66')](_0x29e9f7);}})[_0xbca4('0x4a')](handleError(_0x29bc45,null));};var utilLicense=require('../../config/license/util');exports[_0xbca4('0x67')]=function(_0x3dd93b,_0x20b46a,_0x5bbe6f){var _0x4febb1='server/files/images/logos';var _0x43e313={'custom':![]};return utilLicense[_0xbca4('0x54')]()[_0xbca4('0x19')](function(_0x1c0a7d){if(_0x1c0a7d){_0x43e313=_0x1c0a7d;}return db[_0xbca4('0x34')][_0xbca4('0x4e')]({'where':{'id':_0x3dd93b[_0xbca4('0x4c')]['id']},'attributes':[_0xbca4('0x55'),_0xbca4('0x56'),_0xbca4('0x57'),_0xbca4('0x58'),'defaultLogo','defaultLoginLogo',_0xbca4('0x5a'),_0xbca4('0x5b')],'raw':!![]});})[_0xbca4('0x19')](handleEntityNotFound(_0x20b46a,null))[_0xbca4('0x19')](function(_0x344a84){if(_0x344a84){var _0x2754c8=_0x344a84['loginLogo']&&fs[_0xbca4('0x68')](path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0x4febb1,_[_0xbca4('0x5e')](_0x344a84[_0xbca4('0x56')])))?path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0x4febb1,_[_0xbca4('0x5e')](_0x344a84[_0xbca4('0x56')])):path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0x4febb1,_[_0xbca4('0x5e')](_0xbca4('0x69')));var _0x23c0e9='default'+_[_0xbca4('0x61')](_0xbca4('0x56'));if(_0x344a84[_0x23c0e9]||!_0x43e313[_0xbca4('0x62')]){_0x2754c8=path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0x4febb1,_['toLower'](_0xbca4('0x69')));}if(!fs[_0xbca4('0x68')](_0x2754c8)){throw new db[(_0xbca4('0x63'))]['ValidationError'](_[_0xbca4('0x61')](_0xbca4('0x56'))+_0xbca4('0x65'));}return _0x20b46a[_0xbca4('0x66')](_0x2754c8);}})[_0xbca4('0x4a')](handleError(_0x20b46a,null));};exports[_0xbca4('0x6a')]=function(_0x5d055b,_0x1fb47e){return db[_0xbca4('0x34')][_0xbca4('0x4e')]({'where':{'id':_0x5d055b[_0xbca4('0x4c')]['id']},'attributes':[_0xbca4('0x6b')]})['then'](respondWithResult(_0x1fb47e,null))[_0xbca4('0x4a')](handleError(_0x1fb47e,null));};exports[_0xbca4('0x6c')]=function(_0x8cfc2b,_0x505f12,_0x5e94a5){if(_0x8cfc2b['file']&&_0x8cfc2b['file']['filename']){_0x8cfc2b['body']['preferred']=_0x8cfc2b[_0xbca4('0x50')]['filename'];}return db[_0xbca4('0x34')][_0xbca4('0x4e')]({'where':{'id':_0x8cfc2b['params']['id']}})[_0xbca4('0x19')](handleEntityNotFound(_0x505f12,null))['then'](saveUpdates(_0x8cfc2b[_0xbca4('0x4f')],null))[_0xbca4('0x19')](respondWithResult(_0x505f12,null))[_0xbca4('0x4a')](handleError(_0x505f12,null));};var utilLicense=require(_0xbca4('0x6d'));exports[_0xbca4('0x6e')]=function(_0x1ba012,_0x4cecfa,_0x20b580){var _0xa5fdf7='server/files/images/logos';var _0x3ccb79={'custom':![]};return utilLicense['getLicense']()[_0xbca4('0x19')](function(_0x445d34){if(_0x445d34){_0x3ccb79=_0x445d34;}return db[_0xbca4('0x34')][_0xbca4('0x4e')]({'where':{'id':_0x1ba012[_0xbca4('0x4c')]['id']},'attributes':[_0xbca4('0x55'),_0xbca4('0x56'),_0xbca4('0x57'),_0xbca4('0x58'),_0xbca4('0x59'),_0xbca4('0x6f'),_0xbca4('0x5a'),_0xbca4('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x4cecfa,null))[_0xbca4('0x19')](function(_0x25cfb9){if(_0x25cfb9){var _0x1ae7b6=_0x25cfb9[_0xbca4('0x57')]&&fs[_0xbca4('0x68')](path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0xa5fdf7,_[_0xbca4('0x5e')](_0x25cfb9[_0xbca4('0x57')])))?path['join'](config[_0xbca4('0x5d')],_0xa5fdf7,_[_0xbca4('0x5e')](_0x25cfb9[_0xbca4('0x57')])):path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0xa5fdf7,_[_0xbca4('0x5e')](_0xbca4('0x70')));var _0x18efd6=_0xbca4('0x60')+_[_0xbca4('0x61')](_0xbca4('0x57'));if(_0x25cfb9[_0x18efd6]||!_0x3ccb79['custom']||!_0x3ccb79[_0xbca4('0x57')]){_0x1ae7b6=path[_0xbca4('0x5c')](config['root'],_0xa5fdf7,_[_0xbca4('0x5e')](_0xbca4('0x70')));}if(!fs[_0xbca4('0x68')](_0x1ae7b6)){throw new db['Sequelize']['ValidationError'](_[_0xbca4('0x61')](_0xbca4('0x57'))+_0xbca4('0x65'));}return _0x4cecfa[_0xbca4('0x66')](_0x1ae7b6);}})['catch'](handleError(_0x4cecfa,null));};exports[_0xbca4('0x71')]=function(_0xa47661,_0x49d3fa,_0x336bfe){if(_0xa47661[_0xbca4('0x50')]&&_0xa47661[_0xbca4('0x50')][_0xbca4('0x51')]){_0xa47661[_0xbca4('0x4f')]['favicon']=_0xa47661['file']['filename'];}return db[_0xbca4('0x34')][_0xbca4('0x4e')]({'where':{'id':_0xa47661['params']['id']}})[_0xbca4('0x19')](handleEntityNotFound(_0x49d3fa,null))[_0xbca4('0x19')](saveUpdates(_0xa47661[_0xbca4('0x4f')],null))[_0xbca4('0x19')](respondWithResult(_0x49d3fa,null))[_0xbca4('0x4a')](handleError(_0x49d3fa,null));};var utilLicense=require('../../config/license/util');exports[_0xbca4('0x72')]=function(_0x18feaa,_0x3bb36b,_0x3422af){var _0x22033c=_0xbca4('0x53');var _0x223eb6={'custom':![]};return utilLicense['getLicense']()[_0xbca4('0x19')](function(_0x24d6be){if(_0x24d6be){_0x223eb6=_0x24d6be;}return db['Setting'][_0xbca4('0x4e')]({'where':{'id':_0x18feaa[_0xbca4('0x4c')]['id']},'attributes':[_0xbca4('0x55'),_0xbca4('0x56'),'preferred',_0xbca4('0x58'),_0xbca4('0x59'),'defaultLoginLogo','defaultPreferred',_0xbca4('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x3bb36b,null))[_0xbca4('0x19')](function(_0x3229ce){if(_0x3229ce){var _0x26702b=_0x3229ce['favicon']&&fs['existsSync'](path[_0xbca4('0x5c')](config['root'],_0x22033c,_[_0xbca4('0x5e')](_0x3229ce[_0xbca4('0x58')])))?path[_0xbca4('0x5c')](config['root'],_0x22033c,_['toLower'](_0x3229ce[_0xbca4('0x58')])):path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0x22033c,_[_0xbca4('0x5e')](_0xbca4('0x73')));var _0x127e9a='default'+_[_0xbca4('0x61')](_0xbca4('0x58'));if(_0x3229ce[_0x127e9a]||!_0x223eb6['custom']){_0x26702b=path[_0xbca4('0x5c')](config[_0xbca4('0x5d')],_0x22033c,_[_0xbca4('0x5e')]('default_favicon.ico'));}if(!fs[_0xbca4('0x68')](_0x26702b)){throw new db[(_0xbca4('0x63'))][(_0xbca4('0x64'))](_[_0xbca4('0x61')](_0xbca4('0x58'))+_0xbca4('0x65'));}return _0x3bb36b[_0xbca4('0x66')](_0x26702b);}})[_0xbca4('0x4a')](handleError(_0x3bb36b,null));};exports[_0xbca4('0x74')]=function(_0x1308c5,_0x417e50){var _0xeeeb2b={'offset':moment()[_0xbca4('0x75')]()};_0xeeeb2b[_0xbca4('0x76')]=moment()[_0xbca4('0x75')](_0xeeeb2b['offset'])['format'](_0xbca4('0x77'));return _0x417e50[_0xbca4('0x24')](0xc8)['send'](_0xeeeb2b);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index bbc18c8..3472536 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x406115,_0x19f7a1){var _0xbbabdb=function(_0x28554d){while(--_0x28554d){_0x406115['push'](_0x406115['shift']());}};_0xbbabdb(++_0x19f7a1);}(_0x55ca,0x126));var _0xa55c=function(_0x460358,_0x45d45e){_0x460358=_0x460358-0x0;var _0x2e6a60=_0x55ca[_0x460358];return _0x2e6a60;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x192088,_0x2e43a8){var _0x4fd3e0=function(_0x43778b){while(--_0x43778b){_0x192088['push'](_0x192088['shift']());}};_0x4fd3e0(++_0x2e43a8);}(_0x008c,0x188));var _0xc008=function(_0x3eed3f,_0x5253b5){_0x3eed3f=_0x3eed3f-0x0;var _0xd68fd8=_0x008c[_0x3eed3f];return _0xd68fd8;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 6105990..d84f427 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 _0x3c38=['Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Setting','find','options','where','include','map','model','attributes','ShowSetting','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info'];(function(_0x3e52d7,_0xdc621b){var _0x1b126f=function(_0x57a094){while(--_0x57a094){_0x3e52d7['push'](_0x3e52d7['shift']());}};_0x1b126f(++_0xdc621b);}(_0x3c38,0x15d));var _0x83c3=function(_0x57866f,_0x22cff3){_0x57866f=_0x57866f-0x0;var _0x3de227=_0x3c38[_0x57866f];return _0x3de227;};'use strict';var _=require(_0x83c3('0x0'));var util=require(_0x83c3('0x1'));var moment=require(_0x83c3('0x2'));var BPromise=require(_0x83c3('0x3'));var rs=require(_0x83c3('0x4'));var fs=require('fs');var Redis=require(_0x83c3('0x5'));var db=require(_0x83c3('0x6'))['db'];var utils=require(_0x83c3('0x7'));var logger=require(_0x83c3('0x8'))(_0x83c3('0x9'));var config=require('../../config/environment');var jayson=require(_0x83c3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36572d,_0x279faa,_0x5bdd25){return new BPromise(function(_0x3632d5,_0x325d19){return client[_0x83c3('0xb')](_0x36572d,_0x5bdd25)[_0x83c3('0xc')](function(_0x23f3a2){logger[_0x83c3('0xd')](_0x83c3('0xe'),_0x279faa,_0x83c3('0xf'));logger['debug'](_0x83c3('0x10'),_0x279faa,_0x83c3('0xf'),JSON[_0x83c3('0x11')](_0x23f3a2));if(_0x23f3a2[_0x83c3('0x12')]){if(_0x23f3a2['error'][_0x83c3('0x13')]===0x1f4){logger['error'](_0x83c3('0xe'),_0x279faa,_0x23f3a2[_0x83c3('0x12')][_0x83c3('0x14')]);return _0x325d19(_0x23f3a2[_0x83c3('0x12')]['message']);}logger[_0x83c3('0x12')]('Setting,\x20%s,\x20%s',_0x279faa,_0x23f3a2[_0x83c3('0x12')][_0x83c3('0x14')]);return _0x3632d5(_0x23f3a2[_0x83c3('0x12')][_0x83c3('0x14')]);}else{logger[_0x83c3('0xd')](_0x83c3('0xe'),_0x279faa,_0x83c3('0xf'));_0x3632d5(_0x23f3a2[_0x83c3('0x15')][_0x83c3('0x14')]);}})[_0x83c3('0x16')](function(_0x5d7b54){logger[_0x83c3('0x12')](_0x83c3('0xe'),_0x279faa,_0x5d7b54);_0x325d19(_0x5d7b54);});});}exports['ShowSetting']=function(_0x1b5d4){var _0x2c7ce7=this;return new Promise(function(_0x4036aa,_0x2fba20){return db[_0x83c3('0x17')][_0x83c3('0x18')]({'raw':_0x1b5d4[_0x83c3('0x19')]?_0x1b5d4['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b5d4[_0x83c3('0x19')]?_0x1b5d4['options'][_0x83c3('0x1a')]||null:null,'attributes':_0x1b5d4['options']?_0x1b5d4[_0x83c3('0x19')]['attributes']||null:null,'include':_0x1b5d4[_0x83c3('0x19')]?_0x1b5d4[_0x83c3('0x19')][_0x83c3('0x1b')]?_[_0x83c3('0x1c')](_0x1b5d4[_0x83c3('0x19')]['include'],function(_0x474c4c){return{'model':db[_0x474c4c[_0x83c3('0x1d')]],'as':_0x474c4c['as'],'attributes':_0x474c4c[_0x83c3('0x1e')],'include':_0x474c4c[_0x83c3('0x1b')]?_[_0x83c3('0x1c')](_0x474c4c[_0x83c3('0x1b')],function(_0x38c4ac){return{'model':db[_0x38c4ac[_0x83c3('0x1d')]],'as':_0x38c4ac['as'],'attributes':_0x38c4ac[_0x83c3('0x1e')],'include':_0x38c4ac[_0x83c3('0x1b')]?_[_0x83c3('0x1c')](_0x38c4ac['include'],function(_0x20926c){return{'model':db[_0x20926c[_0x83c3('0x1d')]],'as':_0x20926c['as'],'attributes':_0x20926c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31905f){logger[_0x83c3('0xd')](_0x83c3('0x1f'),_0x1b5d4);logger[_0x83c3('0x20')](_0x83c3('0x1f'),_0x1b5d4,JSON[_0x83c3('0x11')](_0x31905f));_0x4036aa(_0x31905f);})[_0x83c3('0x16')](function(_0xe7fd4a){logger[_0x83c3('0x12')](_0x83c3('0x1f'),_0xe7fd4a[_0x83c3('0x14')],_0x1b5d4);_0x2fba20(_0x2c7ce7[_0x83c3('0x12')](0x1f4,_0xe7fd4a[_0x83c3('0x14')]));});});}; \ No newline at end of file +var _0xe81b=['request','then','info','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','Setting','find','options','attributes','include','map','model','ShowSetting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4ae469,_0x83dae5){var _0x107d88=function(_0x576b56){while(--_0x576b56){_0x4ae469['push'](_0x4ae469['shift']());}};_0x107d88(++_0x83dae5);}(_0xe81b,0x1a7));var _0xbe81=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe81b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xbe81('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbe81('0x1'));var rs=require(_0xbe81('0x2'));var fs=require('fs');var Redis=require(_0xbe81('0x3'));var db=require(_0xbe81('0x4'))['db'];var utils=require(_0xbe81('0x5'));var logger=require(_0xbe81('0x6'))('rpc');var config=require(_0xbe81('0x7'));var jayson=require(_0xbe81('0x8'));var client=jayson[_0xbe81('0x9')][_0xbe81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x94529f,_0x263ae5,_0x997fd3){return new BPromise(function(_0x1d59f6,_0x419e80){return client[_0xbe81('0xb')](_0x94529f,_0x997fd3)[_0xbe81('0xc')](function(_0x485bb8){logger[_0xbe81('0xd')]('Setting,\x20%s,\x20%s',_0x263ae5,'request\x20sent');logger['debug'](_0xbe81('0xe'),_0x263ae5,_0xbe81('0xf'),JSON[_0xbe81('0x10')](_0x485bb8));if(_0x485bb8['error']){if(_0x485bb8[_0xbe81('0x11')][_0xbe81('0x12')]===0x1f4){logger[_0xbe81('0x11')]('Setting,\x20%s,\x20%s',_0x263ae5,_0x485bb8[_0xbe81('0x11')][_0xbe81('0x13')]);return _0x419e80(_0x485bb8[_0xbe81('0x11')]['message']);}logger[_0xbe81('0x11')]('Setting,\x20%s,\x20%s',_0x263ae5,_0x485bb8[_0xbe81('0x11')]['message']);return _0x1d59f6(_0x485bb8[_0xbe81('0x11')][_0xbe81('0x13')]);}else{logger[_0xbe81('0xd')](_0xbe81('0x14'),_0x263ae5,'request\x20sent');_0x1d59f6(_0x485bb8[_0xbe81('0x15')]['message']);}})[_0xbe81('0x16')](function(_0x41c8f7){logger['error'](_0xbe81('0x14'),_0x263ae5,_0x41c8f7);_0x419e80(_0x41c8f7);});});}exports['ShowSetting']=function(_0x46e9d8){var _0x58d8df=this;return new Promise(function(_0x23fc50,_0x32d534){return db[_0xbe81('0x17')][_0xbe81('0x18')]({'raw':_0x46e9d8[_0xbe81('0x19')]?_0x46e9d8['options']['raw']===undefined?!![]:![]:!![],'where':_0x46e9d8[_0xbe81('0x19')]?_0x46e9d8[_0xbe81('0x19')]['where']||null:null,'attributes':_0x46e9d8['options']?_0x46e9d8['options'][_0xbe81('0x1a')]||null:null,'include':_0x46e9d8[_0xbe81('0x19')]?_0x46e9d8[_0xbe81('0x19')][_0xbe81('0x1b')]?_[_0xbe81('0x1c')](_0x46e9d8[_0xbe81('0x19')][_0xbe81('0x1b')],function(_0x3eb636){return{'model':db[_0x3eb636[_0xbe81('0x1d')]],'as':_0x3eb636['as'],'attributes':_0x3eb636['attributes'],'include':_0x3eb636['include']?_[_0xbe81('0x1c')](_0x3eb636['include'],function(_0x517258){return{'model':db[_0x517258['model']],'as':_0x517258['as'],'attributes':_0x517258[_0xbe81('0x1a')],'include':_0x517258[_0xbe81('0x1b')]?_[_0xbe81('0x1c')](_0x517258['include'],function(_0x384e67){return{'model':db[_0x384e67[_0xbe81('0x1d')]],'as':_0x384e67['as'],'attributes':_0x384e67[_0xbe81('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe81('0xc')](function(_0xd4e103){logger['info'](_0xbe81('0x1e'),_0x46e9d8);logger['debug'](_0xbe81('0x1e'),_0x46e9d8,JSON[_0xbe81('0x10')](_0xd4e103));_0x23fc50(_0xd4e103);})[_0xbe81('0x16')](function(_0x4aa8b2){logger[_0xbe81('0x11')](_0xbe81('0x1e'),_0x4aa8b2[_0xbe81('0x13')],_0x46e9d8);_0x32d534(_0x58d8df[_0xbe81('0x11')](0x1f4,_0x4aa8b2[_0xbe81('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index ab6046b..e3789a7 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 _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7217,0x19e));var _0x7721=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7217[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x45d647,_0x58474c){var _0x192fe2=function(_0xd1b1a4){while(--_0xd1b1a4){_0x45d647['push'](_0x45d647['shift']());}};_0x192fe2(++_0x58474c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5fc3[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ed0afd1..d37abc3 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 _0x5e55=['intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','STRING','name','ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','infobip'];(function(_0x4d7125,_0x131e4f){var _0x3542f5=function(_0x250281){while(--_0x250281){_0x4d7125['push'](_0x4d7125['shift']());}};_0x3542f5(++_0x131e4f);}(_0x5e55,0xa8));var _0x55e5=function(_0xba0c2,_0x54cc50){_0xba0c2=_0xba0c2-0x0;var _0x5a9fa0=_0x5e55[_0xba0c2];return _0x5a9fa0;};'use strict';var Sequelize=require(_0x55e5('0x0'));var rs=require(_0x55e5('0x1'));module['exports']={'name':{'type':Sequelize[_0x55e5('0x2')],'unique':_0x55e5('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x55e5('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x55e5('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x55e5('0x2')]},'type':{'type':Sequelize[_0x55e5('0x4')](_0x55e5('0x5'),_0x55e5('0x6'),_0x55e5('0x7'),_0x55e5('0x8'),'plivo',_0x55e5('0x9'),_0x55e5('0xa'),'csc',_0x55e5('0xb'),_0x55e5('0xc'))},'accountSid':{'type':Sequelize[_0x55e5('0x2')]},'authId':{'type':Sequelize[_0x55e5('0x2')]},'authToken':{'type':Sequelize[_0x55e5('0x2')]},'smsMethod':{'type':Sequelize[_0x55e5('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x55e5('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x55e5('0x2')]},'applicationId':{'type':Sequelize[_0x55e5('0x2')]},'accountId':{'type':Sequelize[_0x55e5('0x2')]},'senderString':{'type':Sequelize[_0x55e5('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x55e5('0x2')]},'notificationTemplate':{'type':Sequelize[_0x55e5('0xd')],'defaultValue':function(){return _0x55e5('0xe');}},'notificationSound':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x55e5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x55e5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x55e5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x55e5('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':![],'comment':_0x55e5('0x11'),'set':function(_0x23c981){if(!_0x23c981)this['setDataValue'](_0x55e5('0x12'),null);this[_0x55e5('0x13')]('mandatoryDisposition',_0x23c981);}}}; \ No newline at end of file +var _0x0f6d=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','skebby','plivo','clickatell','csc','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2f06e5,_0x2ff03e){var _0x239610=function(_0x3fdddb){while(--_0x3fdddb){_0x2f06e5['push'](_0x2f06e5['shift']());}};_0x239610(++_0x2ff03e);}(_0x0f6d,0x145));var _0xd0f6=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0x0f6d[_0x209bbf];return _0x592d4b;};'use strict';var Sequelize=require(_0xd0f6('0x0'));var rs=require(_0xd0f6('0x1'));module[_0xd0f6('0x2')]={'name':{'type':Sequelize[_0xd0f6('0x3')],'unique':_0xd0f6('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xd0f6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd0f6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xd0f6('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd0f6('0x3')]},'type':{'type':Sequelize[_0xd0f6('0x5')]('twilio',_0xd0f6('0x6'),'connectel','clicksend',_0xd0f6('0x7'),_0xd0f6('0x8'),'bandwidth',_0xd0f6('0x9'),'infobip',_0xd0f6('0xa'))},'accountSid':{'type':Sequelize[_0xd0f6('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xd0f6('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd0f6('0x3')]},'password':{'type':Sequelize[_0xd0f6('0x3')]},'apiKey':{'type':Sequelize[_0xd0f6('0x3')]},'applicationId':{'type':Sequelize[_0xd0f6('0x3')]},'accountId':{'type':Sequelize[_0xd0f6('0x3')]},'senderString':{'type':Sequelize[_0xd0f6('0x3')]},'deliveryReport':{'type':Sequelize[_0xd0f6('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xd0f6('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd0f6('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd0f6('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0f6('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0f6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd0f6('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd0f6('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd0f6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd0f6('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd0f6('0xd')],'comment':_0xd0f6('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xd0f6('0xb')],'defaultValue':![],'comment':_0xd0f6('0xf'),'set':function(_0x1b4034){if(!_0x1b4034)this[_0xd0f6('0x10')](_0xd0f6('0x11'),null);this['setDataValue'](_0xd0f6('0x12'),_0x1b4034);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index e70bd07..176d46b 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 _0xd75c=['ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','autoclose','applications','close','unmanaged','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','send','addApplications','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','SmsMessage','dataValues','push','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','redif','inspect','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','SmsAccounts','UserProfileResource','stack','name','Pause','map','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','show','params','intersection','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','find','describe','Disposition','getDispositions','findOne','rawAttributes','length','hasOwnProperty','SmsAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','refid','isNil','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x5a1c0a,_0x3b9c69){var _0x85ba9d=function(_0x24ecc2){while(--_0x24ecc2){_0x5a1c0a['push'](_0x5a1c0a['shift']());}};_0x85ba9d(++_0x3b9c69);}(_0xd75c,0x133));var _0xcd75=function(_0x1e134d,_0x5080cb){_0x1e134d=_0x1e134d-0x0;var _0xfdbf45=_0xd75c[_0x1e134d];return _0xfdbf45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd75('0x0'));var zipdir=require(_0xcd75('0x1'));var jsonpatch=require(_0xcd75('0x2'));var rp=require(_0xcd75('0x3'));var moment=require(_0xcd75('0x4'));var BPromise=require(_0xcd75('0x5'));var Mustache=require(_0xcd75('0x6'));var util=require('util');var path=require(_0xcd75('0x7'));var sox=require(_0xcd75('0x8'));var csv=require(_0xcd75('0x9'));var ejs=require(_0xcd75('0xa'));var fs=require('fs');var fs_extra=require(_0xcd75('0xb'));var _=require('lodash');var squel=require(_0xcd75('0xc'));var crypto=require('crypto');var jsforce=require(_0xcd75('0xd'));var deskjs=require(_0xcd75('0xe'));var toCsv=require(_0xcd75('0x9'));var querystring=require(_0xcd75('0xf'));var Papa=require(_0xcd75('0x10'));var Redis=require(_0xcd75('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcd75('0x12'));var as=require(_0xcd75('0x13'));var hardwareService=require(_0xcd75('0x14'));var logger=require(_0xcd75('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcd75('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd75('0x17'))['db'];config['redis']=_[_0xcd75('0x18')](config[_0xcd75('0x19')],{'host':_0xcd75('0x1a'),'port':0x18eb});var socket=require(_0xcd75('0x1b'))(new Redis(config[_0xcd75('0x19')]));require(_0xcd75('0x1c'))[_0xcd75('0x1d')](socket);var jayson=require(_0xcd75('0x1e'));var client=jayson[_0xcd75('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x49e7dc,_0x50b96d,_0x21ff06,_0x453027){return new BPromise(function(_0x5bbcd3,_0x3b0473){var _0x471aa2=_0x453027||client;return _0x471aa2['request'](_0x49e7dc,_0x21ff06)['then'](function(_0x466ae3){logger[_0xcd75('0x20')](_0xcd75('0x21'),_0x50b96d,_0xcd75('0x22'));logger['debug'](_0xcd75('0x23'),_0x50b96d,'request\x20sent',JSON['stringify'](_0x466ae3));if(_0x466ae3[_0xcd75('0x24')]){if(_0x466ae3[_0xcd75('0x24')][_0xcd75('0x25')]===0x1f4){logger['error'](_0xcd75('0x21'),_0x50b96d,_0x466ae3[_0xcd75('0x24')]['message']);return _0x3b0473(_0x466ae3['error'][_0xcd75('0x26')]);}logger[_0xcd75('0x24')](_0xcd75('0x21'),_0x50b96d,_0x466ae3[_0xcd75('0x24')][_0xcd75('0x26')]);return _0x5bbcd3(_0x466ae3[_0xcd75('0x24')][_0xcd75('0x26')]);}else{logger[_0xcd75('0x20')]('SmsAccount,\x20%s,\x20%s',_0x50b96d,_0xcd75('0x22'));_0x5bbcd3(_0x466ae3['result']['message']);}})[_0xcd75('0x27')](function(_0x1e666a){logger[_0xcd75('0x24')](_0xcd75('0x21'),_0x50b96d,_0x1e666a);_0x3b0473(_0x1e666a);});});}function respondWithStatusCode(_0x572262,_0x478d05){_0x478d05=_0x478d05||0xcc;return function(_0x333dcf){if(_0x333dcf){return _0x572262[_0xcd75('0x28')](_0x478d05);}return _0x572262[_0xcd75('0x29')](_0x478d05)[_0xcd75('0x2a')]();};}function respondWithResult(_0x1666bb,_0x3e4449){_0x3e4449=_0x3e4449||0xc8;return function(_0x12c570){if(_0x12c570){return _0x1666bb[_0xcd75('0x29')](_0x3e4449)[_0xcd75('0x2b')](_0x12c570);}};}function respondWithFilteredResult(_0x46e598,_0x2ff4b8){return function(_0x5e9392){if(_0x5e9392){var _0x3e3f86=typeof _0x2ff4b8['offset']==='undefined'&&typeof _0x2ff4b8['limit']===_0xcd75('0x2c');var _0x4c6f37=_0x5e9392[_0xcd75('0x2d')];var _0x524a23=_0x3e3f86?0x0:_0x2ff4b8['offset'];var _0x541ddc=_0x3e3f86?_0x5e9392[_0xcd75('0x2d')]:_0x2ff4b8[_0xcd75('0x2e')]+_0x2ff4b8[_0xcd75('0x2f')];var _0x1171ac;if(_0x541ddc>=_0x4c6f37){_0x541ddc=_0x4c6f37;_0x1171ac=0xc8;}else{_0x1171ac=0xce;}_0x46e598[_0xcd75('0x29')](_0x1171ac);return _0x46e598[_0xcd75('0x30')](_0xcd75('0x31'),_0x524a23+'-'+_0x541ddc+'/'+_0x4c6f37)[_0xcd75('0x2b')](_0x5e9392);}return null;};}function patchUpdates(_0x2b1b5b){return function(_0x254ab4){try{jsonpatch[_0xcd75('0x32')](_0x254ab4,_0x2b1b5b,!![]);}catch(_0x4d2417){return BPromise[_0xcd75('0x33')](_0x4d2417);}return _0x254ab4[_0xcd75('0x34')]();};}function saveUpdates(_0x295e29,_0x5f1179){return function(_0x5f4d66){if(_0x5f4d66){return _0x5f4d66['update'](_0x295e29)['then'](function(_0x35e733){return _0x35e733;});}return null;};}function removeEntity(_0x12748a,_0x57b486){return function(_0x3fd862){if(_0x3fd862){return _0x3fd862[_0xcd75('0x35')]()[_0xcd75('0x36')](function(){var _0x35b2a5=_0x3fd862['get']({'plain':!![]});var _0x3a01f2=_0xcd75('0x37');return db[_0xcd75('0x38')][_0xcd75('0x35')]({'where':{'type':_0x3a01f2,'resourceId':_0x35b2a5['id']}})['then'](function(){return _0x3fd862;});})[_0xcd75('0x36')](function(){_0x12748a[_0xcd75('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x322738,_0x154c17){return function(_0x2da5a5){if(!_0x2da5a5){_0x322738[_0xcd75('0x28')](0x194);}return _0x2da5a5;};}function handleError(_0x276f4a,_0x1b8566){_0x1b8566=_0x1b8566||0x1f4;return function(_0x4e2049){logger['error'](_0x4e2049[_0xcd75('0x39')]);if(_0x4e2049[_0xcd75('0x3a')]){delete _0x4e2049[_0xcd75('0x3a')];}_0x276f4a[_0xcd75('0x29')](_0x1b8566)['send'](_0x4e2049);};}exports['index']=function(_0x339b45,_0x605aa5){var _0x3cdc0d={'include':[{'model':db[_0xcd75('0x3b')],'as':'mandatoryDispositionPause'}]},_0x53dae9={},_0x40fa02={'count':0x0,'rows':[]};var _0x5b7a48=_[_0xcd75('0x3c')](db['SmsAccount']['rawAttributes'],function(_0x14c4c6){return{'name':_0x14c4c6[_0xcd75('0x3d')],'type':_0x14c4c6[_0xcd75('0x3e')][_0xcd75('0x3f')]};});_0x53dae9[_0xcd75('0x40')]=_[_0xcd75('0x3c')](_0x5b7a48,_0xcd75('0x3a'));_0x53dae9[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x339b45[_0xcd75('0x41')]);_0x53dae9[_0xcd75('0x43')]=_['intersection'](_0x53dae9[_0xcd75('0x40')],_0x53dae9[_0xcd75('0x41')]);_0x3cdc0d[_0xcd75('0x44')]=_['intersection'](_0x53dae9[_0xcd75('0x40')],qs['fields'](_0x339b45[_0xcd75('0x41')][_0xcd75('0x45')]));_0x3cdc0d[_0xcd75('0x44')]=_0x3cdc0d[_0xcd75('0x44')]['length']?_0x3cdc0d[_0xcd75('0x44')]:_0x53dae9['model'];if(!_0x339b45[_0xcd75('0x41')]['hasOwnProperty'](_0xcd75('0x46'))){_0x3cdc0d['limit']=qs[_0xcd75('0x2f')](_0x339b45[_0xcd75('0x41')][_0xcd75('0x2f')]);_0x3cdc0d['offset']=qs[_0xcd75('0x2e')](_0x339b45[_0xcd75('0x41')][_0xcd75('0x2e')]);}_0x3cdc0d[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x339b45[_0xcd75('0x41')][_0xcd75('0x48')]);_0x3cdc0d[_0xcd75('0x49')]=qs[_0xcd75('0x43')](_[_0xcd75('0x4a')](_0x339b45[_0xcd75('0x41')],_0x53dae9[_0xcd75('0x43')]),_0x5b7a48);if(_0x339b45[_0xcd75('0x41')][_0xcd75('0x4b')]){_0x3cdc0d[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x3cdc0d[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x5b7a48,function(_0x3d9130){if(_0x3d9130['type']!==_0xcd75('0x4d')){var _0x34734c={};_0x34734c[_0x3d9130['name']]={'$like':'%'+_0x339b45[_0xcd75('0x41')][_0xcd75('0x4b')]+'%'};return _0x34734c;}})});}_0x3cdc0d=_[_0xcd75('0x4c')]({},_0x3cdc0d,_0x339b45[_0xcd75('0x4e')]);var _0x277c5d={'where':_0x3cdc0d[_0xcd75('0x49')]};return db[_0xcd75('0x4f')][_0xcd75('0x2d')](_0x277c5d)[_0xcd75('0x36')](function(_0x4d919e){_0x40fa02[_0xcd75('0x2d')]=_0x4d919e;if(_0x339b45[_0xcd75('0x41')][_0xcd75('0x50')]){_0x3cdc0d[_0xcd75('0x51')]=[{'all':!![]}];}return db[_0xcd75('0x4f')][_0xcd75('0x52')](_0x3cdc0d);})['then'](function(_0x47de02){_0x40fa02[_0xcd75('0x53')]=_0x47de02;return _0x40fa02;})[_0xcd75('0x36')](respondWithFilteredResult(_0x605aa5,_0x3cdc0d))[_0xcd75('0x27')](handleError(_0x605aa5,null));};exports[_0xcd75('0x54')]=function(_0x3995a3,_0x32fb8e){var _0x307734={'raw':![],'where':{'id':_0x3995a3[_0xcd75('0x55')]['id']},'include':[{'model':db[_0xcd75('0x3b')],'as':'mandatoryDispositionPause'}]},_0x245017={};_0x245017[_0xcd75('0x40')]=_['keys'](db['SmsAccount']['rawAttributes']);_0x245017[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x3995a3[_0xcd75('0x41')]);_0x245017[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x245017['model'],_0x245017[_0xcd75('0x41')]);_0x307734[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x245017[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x3995a3[_0xcd75('0x41')]['fields']));_0x307734[_0xcd75('0x44')]=_0x307734[_0xcd75('0x44')]['length']?_0x307734[_0xcd75('0x44')]:_0x245017['model'];if(_0x3995a3['query']['includeAll']){_0x307734[_0xcd75('0x51')]=[{'all':!![]}];}_0x307734=_['merge']({},_0x307734,_0x3995a3[_0xcd75('0x4e')]);return db[_0xcd75('0x4f')]['find'](_0x307734)[_0xcd75('0x36')](handleEntityNotFound(_0x32fb8e,null))[_0xcd75('0x36')](respondWithResult(_0x32fb8e,null))['catch'](handleError(_0x32fb8e,null));};exports[_0xcd75('0x57')]=function(_0x2db738,_0x178beb){return db[_0xcd75('0x4f')]['create'](_0x2db738[_0xcd75('0x58')],{})[_0xcd75('0x36')](function(_0x3c3b05){var _0x577df7=_0x2db738[_0xcd75('0x59')][_0xcd75('0x5a')]({'plain':!![]});if(!_0x577df7)throw new Error(_0xcd75('0x5b'));if(_0x577df7[_0xcd75('0x5c')]===_0xcd75('0x59')){var _0x1297e9=_0x3c3b05[_0xcd75('0x5a')]({'plain':!![]});var _0x1c98f3=_0xcd75('0x37');return db[_0xcd75('0x5d')]['find']({'where':{'name':_0x1c98f3,'userProfileId':_0x577df7[_0xcd75('0x5e')]},'raw':!![]})[_0xcd75('0x36')](function(_0x2b02e3){if(_0x2b02e3&&_0x2b02e3['autoAssociation']===0x0){return db[_0xcd75('0x38')][_0xcd75('0x57')]({'name':_0x1297e9['name'],'resourceId':_0x1297e9['id'],'type':_0x2b02e3[_0xcd75('0x3a')],'sectionId':_0x2b02e3['id']},{})[_0xcd75('0x36')](function(){return _0x3c3b05;});}else{return _0x3c3b05;}})[_0xcd75('0x27')](function(_0x46c76e){logger[_0xcd75('0x24')](_0xcd75('0x5f'),_0x46c76e);throw _0x46c76e;});}return _0x3c3b05;})['then'](respondWithResult(_0x178beb,0xc9))['catch'](handleError(_0x178beb,null));};exports[_0xcd75('0x60')]=function(_0x44d998,_0x97a2a9){if(_0x44d998[_0xcd75('0x58')]['id']){delete _0x44d998[_0xcd75('0x58')]['id'];}return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x44d998[_0xcd75('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xcd75('0x61')}]})[_0xcd75('0x36')](handleEntityNotFound(_0x97a2a9,null))[_0xcd75('0x36')](saveUpdates(_0x44d998[_0xcd75('0x58')],null))[_0xcd75('0x36')](respondWithResult(_0x97a2a9,null))['catch'](handleError(_0x97a2a9,null));};exports[_0xcd75('0x35')]=function(_0x520f5e,_0x35dde6){return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x520f5e[_0xcd75('0x55')]['id']}})['then'](handleEntityNotFound(_0x35dde6,null))['then'](removeEntity(_0x35dde6,null))[_0xcd75('0x27')](handleError(_0x35dde6,null));};exports[_0xcd75('0x63')]=function(_0xae3567,_0x29b38f){return db[_0xcd75('0x4f')][_0xcd75('0x63')]()[_0xcd75('0x36')](respondWithResult(_0x29b38f,null))['catch'](handleError(_0x29b38f,null));};exports['addDisposition']=function(_0x339417,_0x25c3b4,_0x1f58f4){if(_0x339417['body']['id']){delete _0x339417[_0xcd75('0x58')]['id'];}return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x339417[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x25c3b4,null))[_0xcd75('0x36')](function(_0x1496ce){if(_0x1496ce){_0x339417[_0xcd75('0x58')]['SmsAccountId']=_0x1496ce['id'];return db[_0xcd75('0x64')]['create'](_0x339417[_0xcd75('0x58')]);}})[_0xcd75('0x36')](respondWithResult(_0x25c3b4,null))[_0xcd75('0x27')](handleError(_0x25c3b4,null));};exports[_0xcd75('0x65')]=function(_0x38b30b,_0x2ce609,_0x5c95b1){var _0x158919={'raw':![],'where':{}};var _0x43487c={};var _0x4f509a={'count':0x0,'rows':[]};return db[_0xcd75('0x4f')][_0xcd75('0x66')]({'where':{'id':_0x38b30b[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x2ce609,null))[_0xcd75('0x36')](function(_0x39bfac){if(_0x39bfac){_0x43487c[_0xcd75('0x40')]=_[_0xcd75('0x42')](db[_0xcd75('0x64')][_0xcd75('0x67')]);_0x43487c['query']=_[_0xcd75('0x42')](_0x38b30b[_0xcd75('0x41')]);_0x43487c[_0xcd75('0x43')]=_['intersection'](_0x43487c[_0xcd75('0x40')],_0x43487c[_0xcd75('0x41')]);_0x158919[_0xcd75('0x44')]=_['intersection'](_0x43487c['model'],qs[_0xcd75('0x45')](_0x38b30b[_0xcd75('0x41')]['fields']));_0x158919[_0xcd75('0x44')]=_0x158919['attributes'][_0xcd75('0x68')]?_0x158919[_0xcd75('0x44')]:_0x43487c[_0xcd75('0x40')];if(!_0x38b30b[_0xcd75('0x41')][_0xcd75('0x69')](_0xcd75('0x46'))){_0x158919['limit']=qs[_0xcd75('0x2f')](_0x38b30b[_0xcd75('0x41')][_0xcd75('0x2f')]);_0x158919[_0xcd75('0x2e')]=qs[_0xcd75('0x2e')](_0x38b30b[_0xcd75('0x41')]['offset']);}_0x158919[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x38b30b['query'][_0xcd75('0x48')]);_0x158919[_0xcd75('0x49')]=qs['filters'](_[_0xcd75('0x4a')](_0x38b30b['query'],_0x43487c[_0xcd75('0x43')]));_0x158919[_0xcd75('0x49')][_0xcd75('0x6a')]=_0x39bfac['id'];if(_0x38b30b[_0xcd75('0x41')]['filter']){_0x158919[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x158919[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x158919['attributes'],function(_0x56b3a7){var _0x428cb9={};_0x428cb9[_0x56b3a7]={'$like':'%'+_0x38b30b['query'][_0xcd75('0x4b')]+'%'};return _0x428cb9;})});}_0x158919=_['merge']({},_0x158919,_0x38b30b['options']);return db[_0xcd75('0x64')]['count']({'where':_0x158919[_0xcd75('0x49')]})[_0xcd75('0x36')](function(_0x139360){_0x4f509a[_0xcd75('0x2d')]=_0x139360;if(_0x38b30b['query'][_0xcd75('0x50')]){_0x158919['include']=[{'all':!![]}];}return db[_0xcd75('0x64')]['findAll'](_0x158919);})['then'](function(_0x3f20ab){_0x4f509a[_0xcd75('0x53')]=_0x3f20ab;return _0x4f509a;});}})['then'](respondWithFilteredResult(_0x2ce609,_0x158919))[_0xcd75('0x27')](handleError(_0x2ce609,null));};exports[_0xcd75('0x6b')]=function(_0x177299,_0x3d456d,_0x17f478){return db['SmsAccount'][_0xcd75('0x62')]({'where':{'id':_0x177299[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x3d456d,null))[_0xcd75('0x36')](function(_0x4e2638){if(_0x4e2638){return _0x4e2638[_0xcd75('0x6b')](_0x177299[_0xcd75('0x41')][_0xcd75('0x6c')]);}})['then'](respondWithStatusCode(_0x3d456d,null))[_0xcd75('0x27')](handleError(_0x3d456d,null));};exports['addAnswer']=function(_0xe18943,_0x37396c,_0x85a266){if(_0xe18943[_0xcd75('0x58')]['id']){delete _0xe18943[_0xcd75('0x58')]['id'];}return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0xe18943[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x37396c,null))[_0xcd75('0x36')](function(_0x38de02){if(_0x38de02){_0xe18943[_0xcd75('0x58')][_0xcd75('0x6a')]=_0x38de02['id'];return db[_0xcd75('0x6d')][_0xcd75('0x57')](_0xe18943['body']);}})['then'](respondWithResult(_0x37396c,null))[_0xcd75('0x27')](handleError(_0x37396c,null));};exports[_0xcd75('0x6e')]=function(_0x5b7b34,_0x200da2,_0x315e6c){var _0x20285d={'raw':![],'where':{}};var _0x46a7d5={};var _0xaff6ce={'count':0x0,'rows':[]};return db['SmsAccount'][_0xcd75('0x66')]({'where':{'id':_0x5b7b34['params']['id']}})['then'](handleEntityNotFound(_0x200da2,null))['then'](function(_0x33d282){if(_0x33d282){_0x46a7d5[_0xcd75('0x40')]=_[_0xcd75('0x42')](db['CannedAnswer'][_0xcd75('0x67')]);_0x46a7d5[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x5b7b34[_0xcd75('0x41')]);_0x46a7d5[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x46a7d5['model'],_0x46a7d5[_0xcd75('0x41')]);_0x20285d[_0xcd75('0x44')]=_['intersection'](_0x46a7d5['model'],qs['fields'](_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x45')]));_0x20285d[_0xcd75('0x44')]=_0x20285d[_0xcd75('0x44')][_0xcd75('0x68')]?_0x20285d[_0xcd75('0x44')]:_0x46a7d5[_0xcd75('0x40')];if(!_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x69')](_0xcd75('0x46'))){_0x20285d['limit']=qs[_0xcd75('0x2f')](_0x5b7b34['query'][_0xcd75('0x2f')]);_0x20285d[_0xcd75('0x2e')]=qs['offset'](_0x5b7b34[_0xcd75('0x41')]['offset']);}_0x20285d['order']=qs['sort'](_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x48')]);_0x20285d[_0xcd75('0x49')]=qs[_0xcd75('0x43')](_['pick'](_0x5b7b34['query'],_0x46a7d5[_0xcd75('0x43')]));_0x20285d['where'][_0xcd75('0x6a')]=_0x33d282['id'];if(_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x4b')]){_0x20285d['where']=_[_0xcd75('0x4c')](_0x20285d[_0xcd75('0x49')],{'$or':_['map'](_0x20285d[_0xcd75('0x44')],function(_0xf2f452){var _0xb7c34f={};_0xb7c34f[_0xf2f452]={'$like':'%'+_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x4b')]+'%'};return _0xb7c34f;})});}_0x20285d=_[_0xcd75('0x4c')]({},_0x20285d,_0x5b7b34[_0xcd75('0x4e')]);return db[_0xcd75('0x6d')]['count']({'where':_0x20285d[_0xcd75('0x49')]})[_0xcd75('0x36')](function(_0x539886){_0xaff6ce[_0xcd75('0x2d')]=_0x539886;if(_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x50')]){_0x20285d['include']=[{'all':!![]}];}return db[_0xcd75('0x6d')][_0xcd75('0x52')](_0x20285d);})[_0xcd75('0x36')](function(_0x31f011){_0xaff6ce[_0xcd75('0x53')]=_0x31f011;return _0xaff6ce;});}})['then'](respondWithFilteredResult(_0x200da2,_0x20285d))[_0xcd75('0x27')](handleError(_0x200da2,null));};exports[_0xcd75('0x6f')]=function(_0x4e27c1,_0x4435b3,_0x4d2316){return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x4e27c1['params']['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x4435b3,null))[_0xcd75('0x36')](function(_0x4b1659){if(_0x4b1659){return _0x4b1659[_0xcd75('0x6f')](_0x4e27c1['query']['ids']);}})[_0xcd75('0x36')](respondWithStatusCode(_0x4435b3,null))[_0xcd75('0x27')](handleError(_0x4435b3,null));};exports[_0xcd75('0x70')]=function(_0x49a7b5,_0x1317ff,_0x3b774a){var _0x3cef17={'channel':_0xcd75('0x71')};var _0x3a43cd=[];var _0x1dabff=[];var _0x434904={};return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x49a7b5['params']['id']},'include':[{'model':db[_0xcd75('0x72')],'as':_0xcd75('0x73')}]})['then'](handleEntityNotFound(_0x1317ff,null))[_0xcd75('0x36')](function(_0x3e4de7){_0x3cef17[_0xcd75('0x74')]=_0x3e4de7;_0x3cef17['applications']=_[_0xcd75('0x75')](_0x3e4de7[_0xcd75('0x73')],['priority'],[_0xcd75('0x76')]);if(_0x3cef17[_0xcd75('0x74')][_0xcd75('0x73')]){delete _0x3cef17[_0xcd75('0x74')]['Applications'];}return db[_0xcd75('0x77')][_0xcd75('0x63')]();})[_0xcd75('0x36')](function(_0x56a93f){if(!_0x56a93f){throw new db[(_0xcd75('0x78'))]['ValidationError'](_0xcd75('0x79'));}_0x3a43cd=_[_0xcd75('0x7a')](_[_0xcd75('0x42')](_0x56a93f),[_0xcd75('0x7b'),_0xcd75('0x7c')]);_0x1dabff=_[_0xcd75('0x7a')](_['keys'](_0x56a93f),[_0xcd75('0x7b'),_0xcd75('0x7c'),_0xcd75('0x7d'),'ListId']);_0x3cef17[_0xcd75('0x58')]={'mapKey':_0xcd75('0x7e')};if(_0x3cef17[_0xcd75('0x74')][_0xcd75('0x3e')]){switch(_0x3cef17[_0xcd75('0x74')]['type']){case _0xcd75('0x7f'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x81')];_0x3cef17['body']['body']=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x82')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x84')];break;case _0xcd75('0x85'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]='+'+_0x49a7b5['body'][_0xcd75('0x86')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x87')];break;case'connectel':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x80')];_0x3cef17['body'][_0xcd75('0x58')]=_0x49a7b5['body'][_0xcd75('0x26')];break;case _0xcd75('0x88'):_0x3cef17[_0xcd75('0x58')]['from']=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x80')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')]['body'];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x89')];break;case _0xcd75('0x8a'):_0x3cef17['body'][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x81')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8b')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8c')];break;case _0xcd75('0x8d'):_0x3cef17[_0xcd75('0x58')]['from']='+'+_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8e')][0x0][_0xcd75('0x80')];_0x3cef17['body']['body']=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8e')][0x0][_0xcd75('0x87')];_0x3cef17['body']['messageId']=_0x49a7b5['body'][_0xcd75('0x8e')][0x0][_0xcd75('0x83')];break;case _0xcd75('0x8f'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x90')];_0x3cef17['body'][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x91')][_0xcd75('0x26')];break;case _0xcd75('0x92'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x93')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x87')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')]['replyMessageId'];break;case _0xcd75('0x94'):_0x3cef17['body'][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][0x0][_0xcd75('0x26')]['id'];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][0x0][_0xcd75('0x26')][_0xcd75('0x80')];_0x3cef17['body']['body']=_0x49a7b5[_0xcd75('0x58')][0x0][_0xcd75('0x26')][_0xcd75('0x87')];break;case'intelepeer':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5['body'][_0xcd75('0x80')];_0x3cef17['body'][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')]['message'];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x95')];break;}}if(_0x3cef17[_0xcd75('0x58')]['id']){delete _0x3cef17['body']['id'];}if(_[_0xcd75('0x96')](_0x3cef17[_0xcd75('0x58')]['from'])){throw new db[(_0xcd75('0x78'))]['ValidationError'](_0xcd75('0x97'));}if(_[_0xcd75('0x96')](_0x3cef17[_0xcd75('0x58')]['body'])||_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]===''){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3cef17['body'][_0xcd75('0x99')])){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0x9a')+_0x1dabff);}if(!_[_0xcd75('0x9b')](_0x1dabff,_0x3cef17[_0xcd75('0x58')][_0xcd75('0x99')])){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0x9c')+_0x1dabff);}_0x434904[_0x3cef17['body'][_0xcd75('0x99')]]=_0x3cef17[_0xcd75('0x58')]['from'];return db['CmList'][_0xcd75('0x62')]({'where':{'id':_0x3cef17[_0xcd75('0x74')][_0xcd75('0x9d')]},'include':[{'model':db['CmContact'],'as':_0xcd75('0x9e'),'where':_0x434904,'limit':0x1,'order':[[_0xcd75('0x7c'),_0xcd75('0x9f')]]}]});})[_0xcd75('0x36')](handleEntityNotFound(_0x1317ff,null))[_0xcd75('0x36')](function(_0x59fcff){if(_0x59fcff){_0x3cef17[_0xcd75('0xa0')]=_[_0xcd75('0xa1')](_0x59fcff,[_0xcd75('0x9e')]);if(_0x59fcff[_0xcd75('0x9e')][_0xcd75('0x68')]){return _0x59fcff[_0xcd75('0x9e')][0x0];}var _0x5b1243=_['defaults'](_0x3cef17[_0xcd75('0x58')],{'firstName':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')],'ListId':_0x59fcff['id']});_0x5b1243[_0x3cef17[_0xcd75('0x58')]['mapKey']]=_0x3cef17[_0xcd75('0x58')]['from'];return db[_0xcd75('0x77')]['create'](_0x5b1243,{'fields':_0x3a43cd,'raw':!![]});}})[_0xcd75('0x36')](handleEntityNotFound(_0x1317ff,null))[_0xcd75('0x36')](function(_0x234159){if(_0x234159){_0x3cef17[_0xcd75('0xa2')]=_0x234159;var _0x2c31f3={'ContactId':_0x234159['id'],'phone':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')],'SmsAccountId':_0x49a7b5[_0xcd75('0x55')]['id']};var _0x884b15={'ContactId':_0x234159['id'],'SmsAccountId':_0x49a7b5[_0xcd75('0x55')]['id'],'closed':![]};return db[_0xcd75('0xa3')][_0xcd75('0x62')]({'where':_0x884b15})[_0xcd75('0x36')](function(_0x22af53){if(_0x22af53){return[_0x22af53,![]];}return db[_0xcd75('0xa3')]['create'](_0x2c31f3)[_0xcd75('0x36')](function(_0x35ad45){return[_0x35ad45,!![]];});});}})[_0xcd75('0xa4')](function(_0x4f9d08,_0xd3394c){_0x3cef17['interaction']=_0x4f9d08[_0xcd75('0x5a')]({'plain':!![]});_0x3cef17[_0xcd75('0xa5')]['created']=![];if(_0xd3394c){if(_0x3cef17[_0xcd75('0x74')][_0xcd75('0xa6')]){_0x3cef17[_0xcd75('0xa7')]['push']({'id':0x0,'priority':_0x3cef17[_0xcd75('0xa7')][_0xcd75('0x68')]+0x1,'app':_0xcd75('0xa8'),'appdata':_0xcd75('0xa9'),'interval':_0xcd75('0xaa')});}_0x3cef17['interaction']['created']=!![];}return db['SmsMessage'][_0xcd75('0x57')]({'phone':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')],'messageId':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')],'body':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')],'SmsAccountId':_0x49a7b5[_0xcd75('0x55')]['id'],'SmsInteractionId':_0x4f9d08['id'],'direction':'in','ContactId':_0x4f9d08[_0xcd75('0xab')],'AttachmentId':_0x3cef17[_0xcd75('0x58')]['AttachmentId']});})[_0xcd75('0x36')](function(_0x3dd982){_0x3cef17[_0xcd75('0x26')]=_0x3dd982;if(_0x3cef17['interaction'][_0xcd75('0xac')]){return db[_0xcd75('0xad')][_0xcd75('0x62')]({'attributes':['id',_0xcd75('0x3a')],'where':{'id':_0x3cef17['interaction']['UserId']}})[_0xcd75('0x36')](function(_0x293a08){if(_0x293a08){_0x3cef17[_0xcd75('0xa7')][_0xcd75('0xae')]({'id':0x0,'priority':0x0,'app':_0xcd75('0xaf'),'appdata':_0x293a08[_0xcd75('0x3a')]+','+(_0x3cef17[_0xcd75('0x74')][_0xcd75('0xb0')]||0xa),'interval':_0xcd75('0xaa')});}return respondWithRpcPromise(_0xcd75('0xb1'),_0xcd75('0xb2'),_0x3cef17);});}return respondWithRpcPromise('Start',_0xcd75('0xb2'),_0x3cef17);})[_0xcd75('0x36')](function(_0x4860a7){if(_0x4860a7){var _0x2a9a37=0xc8;var _0xd57b0e=_0xcd75('0xb3');logger['info'](_0xcd75('0x23'),_0xd57b0e,_0x2a9a37,_0xcd75('0xb4'));logger[_0xcd75('0xb5')](_0xcd75('0xb6'),_0xd57b0e,_0x2a9a37,_0xcd75('0xb4'),JSON[_0xcd75('0xb7')](_0x4860a7));if(_0x3cef17['account']['type']===_0xcd75('0x7f')){return _0x1317ff[_0xcd75('0x29')](_0x2a9a37)[_0xcd75('0x30')](_0xcd75('0xb8'),'text/xml')[_0xcd75('0xb9')]('\x0a');}else{return _0x1317ff['status'](_0x2a9a37)[_0xcd75('0x2b')](_0x4860a7);}}})[_0xcd75('0x27')](handleError(_0x1317ff,null));};exports[_0xcd75('0xba')]=function(_0x32a234,_0x2e6734,_0x3c6a10){return db[_0xcd75('0x4f')][_0xcd75('0x66')]({'where':{'id':_0x32a234[_0xcd75('0x55')]['id']}})['then'](handleEntityNotFound(_0x2e6734,null))[_0xcd75('0x36')](function(_0x5acaeb){if(_0x5acaeb){return db['sequelize']['transaction'](function(_0x58145e){return db['SmsApplication'][_0xcd75('0x35')]({'where':{'SmsAccountId':_0x32a234[_0xcd75('0x55')]['id']},'transaction':_0x58145e})[_0xcd75('0x36')](function(_0x46e543){var _0x30aef0=_['map'](_0x32a234[_0xcd75('0x58')],function(_0x192396){_0x192396['SmsAccountId']=_0x32a234['params']['id'];return _0x192396;});return db[_0xcd75('0x72')][_0xcd75('0xbb')](_0x30aef0,{'transaction':_0x58145e});});})[_0xcd75('0x36')](function(){return db[_0xcd75('0x72')][_0xcd75('0xbc')]({'where':{'SmsAccountId':_0x32a234[_0xcd75('0x55')]['id']},'order':_0xcd75('0xbd')});});}})[_0xcd75('0x36')](respondWithResult(_0x2e6734,null))['catch'](handleError(_0x2e6734,null));};exports['getApplications']=function(_0x4cd744,_0x2b102c,_0x2c6745){var _0xfd6900={};var _0x4dad71={};var _0x19abd4;var _0x4f24ff;return db[_0xcd75('0x4f')]['findOne']({'where':{'id':_0x4cd744[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x2b102c,null))['then'](function(_0x3ca75f){if(_0x3ca75f){_0x19abd4=_0x3ca75f;_0x4dad71[_0xcd75('0x40')]=_['keys'](db[_0xcd75('0x72')]['rawAttributes']);_0x4dad71[_0xcd75('0x41')]=_['keys'](_0x4cd744['query']);_0x4dad71[_0xcd75('0x43')]=_['intersection'](_0x4dad71[_0xcd75('0x40')],_0x4dad71[_0xcd75('0x41')]);_0xfd6900[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x4dad71[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x4cd744[_0xcd75('0x41')]['fields']));_0xfd6900['attributes']=_0xfd6900[_0xcd75('0x44')]['length']?_0xfd6900['attributes']:_0x4dad71[_0xcd75('0x40')];_0xfd6900[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x4cd744[_0xcd75('0x41')][_0xcd75('0x48')]);_0xfd6900['where']=qs[_0xcd75('0x43')](_[_0xcd75('0x4a')](_0x4cd744[_0xcd75('0x41')],_0x4dad71[_0xcd75('0x43')]));if(_0x4cd744[_0xcd75('0x41')][_0xcd75('0x4b')]){_0xfd6900[_0xcd75('0x49')]=_['merge'](_0xfd6900['where'],{'$or':_[_0xcd75('0x3c')](_0xfd6900[_0xcd75('0x44')],function(_0x51dbfc){var _0x58197c={};_0x58197c[_0x51dbfc]={'$like':'%'+_0x4cd744['query']['filter']+'%'};return _0x58197c;})});}_0xfd6900=_[_0xcd75('0x4c')]({},_0xfd6900,_0x4cd744[_0xcd75('0x4e')]);return _0x19abd4[_0xcd75('0xbe')](_0xfd6900);}})[_0xcd75('0x36')](function(_0x50457b){if(_0x50457b){_0x4f24ff=_0x50457b[_0xcd75('0x68')];if(!_0x4cd744[_0xcd75('0x41')][_0xcd75('0x69')]('nolimit')){_0xfd6900[_0xcd75('0x2f')]=qs[_0xcd75('0x2f')](_0x4cd744['query'][_0xcd75('0x2f')]);_0xfd6900[_0xcd75('0x2e')]=qs[_0xcd75('0x2e')](_0x4cd744['query'][_0xcd75('0x2e')]);}return _0x19abd4['getApplications'](_0xfd6900);}})[_0xcd75('0x36')](function(_0x1865a4){if(_0x1865a4){return _0x1865a4?{'count':_0x4f24ff,'rows':_0x1865a4}:null;}})[_0xcd75('0x36')](respondWithResult(_0x2b102c,null))['catch'](handleError(_0x2b102c,null));};exports[_0xcd75('0xbf')]=function(_0x4999f9,_0x1200b5,_0x5a39ca){var _0x3440bf={'raw':![],'where':{}};var _0x54bd97={};var _0x219918={'count':0x0,'rows':[]};return db['SmsAccount'][_0xcd75('0x66')]({'where':{'id':_0x4999f9['params']['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x1200b5,null))['then'](function(_0x1a7ff6){if(_0x1a7ff6){_0x54bd97[_0xcd75('0x40')]=_[_0xcd75('0x42')](db[_0xcd75('0xa3')][_0xcd75('0x67')]);_0x54bd97['query']=_[_0xcd75('0x42')](_0x4999f9[_0xcd75('0x41')]);_0x54bd97[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x54bd97['model'],_0x54bd97[_0xcd75('0x41')]);_0x3440bf[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x54bd97[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x4999f9['query'][_0xcd75('0x45')]));_0x3440bf['attributes']=_0x3440bf['attributes'][_0xcd75('0x68')]?_0x3440bf['attributes']:_0x54bd97[_0xcd75('0x40')];if(!_0x4999f9[_0xcd75('0x41')]['hasOwnProperty']('nolimit')){_0x3440bf['limit']=qs[_0xcd75('0x2f')](_0x4999f9[_0xcd75('0x41')]['limit']);_0x3440bf[_0xcd75('0x2e')]=qs[_0xcd75('0x2e')](_0x4999f9[_0xcd75('0x41')][_0xcd75('0x2e')]);}_0x3440bf[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x4999f9[_0xcd75('0x41')][_0xcd75('0x48')]);_0x3440bf[_0xcd75('0x49')]=qs[_0xcd75('0x43')](_[_0xcd75('0x4a')](_0x4999f9['query'],_0x54bd97['filters']));_0x3440bf[_0xcd75('0x49')][_0xcd75('0x6a')]=_0x1a7ff6['id'];if(_0x4999f9[_0xcd75('0x41')][_0xcd75('0x4b')]){_0x3440bf[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x3440bf[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x3440bf[_0xcd75('0x44')],function(_0x45b73e){var _0x47f7c2={};_0x47f7c2[_0x45b73e]={'$like':'%'+_0x4999f9['query']['filter']+'%'};return _0x47f7c2;})});}_0x3440bf=_[_0xcd75('0x4c')]({},_0x3440bf,_0x4999f9['options']);return db[_0xcd75('0xa3')][_0xcd75('0x2d')]({'where':_0x3440bf[_0xcd75('0x49')]})[_0xcd75('0x36')](function(_0x50d6e8){_0x219918['count']=_0x50d6e8;if(_0x4999f9[_0xcd75('0x41')][_0xcd75('0x50')]){_0x3440bf[_0xcd75('0x51')]=[{'model':db[_0xcd75('0x77')],'as':'Contact','required':![]},{'model':db[_0xcd75('0xad')],'as':_0xcd75('0xc0'),'attributes':[_0xcd75('0x3a'),_0xcd75('0xc1'),_0xcd75('0xc2')],'required':![]},{'model':db[_0xcd75('0xc3')],'as':'Tags','attributes':['id',_0xcd75('0x3a'),_0xcd75('0xc4')],'where':_0x4999f9[_0xcd75('0x41')]['tag']?{'id':_0x4999f9[_0xcd75('0x41')][_0xcd75('0xc5')]}:undefined,'required':_0x4999f9[_0xcd75('0x41')][_0xcd75('0xc5')]?!![]:![]}];}return db['SmsInteraction'][_0xcd75('0x52')](_0x3440bf);})[_0xcd75('0x36')](function(_0x351edf){_0x219918['rows']=_0x351edf;return _0x219918;});}})['then'](respondWithFilteredResult(_0x1200b5,_0x3440bf))['catch'](handleError(_0x1200b5,null));};exports[_0xcd75('0xb9')]=function(_0x2addb1,_0x280af7,_0x429141){var _0x131495,_0x5e6683,_0x95e29a;if(_['isNil'](_0x2addb1[_0xcd75('0x58')][_0xcd75('0x58')])||_0x2addb1['body'][_0xcd75('0x58')]===''){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0xc6'));}if(_[_0xcd75('0x96')](_0x2addb1[_0xcd75('0x58')]['to'])){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0xc7'));}_0x131495=_0x2addb1['body']['to'];return db['SmsAccount'][_0xcd75('0x62')]({'where':{'id':_0x2addb1[_0xcd75('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xcd75('0xc8'),'include':[{'model':db[_0xcd75('0x77')],'as':'Contacts','where':{'mobile':_0x131495},'limit':0x1,'order':[[_0xcd75('0x7c'),_0xcd75('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x280af7,null))[_0xcd75('0x36')](function(_0x510d22){if(_0x510d22&&_0x510d22[_0xcd75('0xc8')]){_0x5e6683=_0x510d22['get']({'plain':!![]});if(_0x5e6683[_0xcd75('0xc8')]&&_0x5e6683[_0xcd75('0xc8')][_0xcd75('0x9e')][_0xcd75('0x68')]){return _0x5e6683['List']['Contacts'][0x0];}return db[_0xcd75('0x77')][_0xcd75('0x57')](_[_0xcd75('0x18')](_0x2addb1[_0xcd75('0x58')],{'firstName':_0x131495,'mobile':_0x131495,'phone':_0x131495,'ListId':_0x5e6683[_0xcd75('0x9d')]}));}})[_0xcd75('0x36')](handleEntityNotFound(_0x280af7,null))[_0xcd75('0x36')](function(_0xef24){if(_0xef24){_0x95e29a=_0xef24;return db[_0xcd75('0xa3')]['find']({'where':{'ContactId':_0x95e29a['id'],'closed':![],'SmsAccountId':_0x5e6683['id']}})[_0xcd75('0x36')](function(_0x12ef20){if(_0x12ef20){return[_0x12ef20,![]];}return db[_0xcd75('0xa3')]['create']({'UserId':_0x2addb1[_0xcd75('0x59')]['id'],'ContactId':_0x95e29a['id'],'SmsAccountId':_0x5e6683['id'],'phone':_0x131495,'firstMsgDirection':_0xcd75('0xc9'),'Messages':[_['merge'](_0x2addb1[_0xcd75('0x58')],{'read':![],'body':_0x2addb1[_0xcd75('0x58')][_0xcd75('0x58')],'phone':_0x131495,'SmsAccountId':_0x5e6683['id'],'UserId':_0x2addb1[_0xcd75('0x59')]['id'],'ContactId':_0x95e29a['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xcd75('0xca')}]})['then'](function(_0x5dccaa){return[_0x5dccaa,!![]];});});}})[_0xcd75('0xa4')](function(_0x32101d,_0x664d01){if(_0x664d01){return _0x32101d;}return db[_0xcd75('0xcb')][_0xcd75('0x57')](_[_0xcd75('0x4c')](_0x2addb1['body'],{'read':![],'body':_0x2addb1[_0xcd75('0x58')][_0xcd75('0x58')],'phone':_0x131495,'SmsAccountId':_0x5e6683['id'],'SmsInteractionId':_0x32101d['id'],'UserId':_0x2addb1['user']['id'],'ContactId':_0x95e29a['id']}))[_0xcd75('0x36')](function(_0x4635c9){_0x32101d[_0xcd75('0xcc')][_0xcd75('0xca')]=[];_0x32101d['dataValues'][_0xcd75('0xca')][_0xcd75('0xcd')](_0x4635c9[_0xcd75('0xcc')]);return _0x32101d;});})[_0xcd75('0x36')](respondWithResult(_0x280af7,null))['catch'](handleError(_0x280af7,null));};exports['status']=function(_0x26ce24,_0x456cb8,_0x20b5bf){if(_0x26ce24[_0xcd75('0x58')]['id']){delete _0x26ce24[_0xcd75('0x58')]['id'];}var _0x8c6baf,_0x4c8ad2,_0x59681b;return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x26ce24['params']['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x456cb8,null))['then'](function(_0x27d723){if(_0x27d723){_0x59681b=_0x27d723;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcd75('0xce'),_0x27d723[_0xcd75('0x3e')],util['inspect'](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));switch(_0x27d723[_0xcd75('0x3e')]){case'skebby':if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0xcf')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')];return db[_0xcd75('0xcb')]['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')]['skebby_dispatch_id']}});}break;case _0xcd75('0xd0'):if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd1')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd2')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd2')];return db[_0xcd75('0xcb')]['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')]['requestid']}});}break;case _0xcd75('0x88'):if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0x89')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd3')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd3')];return db[_0xcd75('0xcb')]['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')]['message_id']}});}break;case _0xcd75('0x8d'):var _0x488893=_0x26ce24['body'][_0xcd75('0x8e')][0x0];if(_0x488893[_0xcd75('0x83')]&&_0x488893[_0xcd75('0x29')][_0xcd75('0xd4')]==='DELIVERED'){_0x4c8ad2=_0x488893[_0xcd75('0x29')]['groupName'];return db[_0xcd75('0xcb')][_0xcd75('0x62')]({'where':{'messageId':_0x488893[_0xcd75('0x83')]}});}break;case _0xcd75('0x92'):if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0x83')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')];return db[_0xcd75('0xcb')][_0xcd75('0x62')]({'where':{'messageId':_0x26ce24[_0xcd75('0x58')][_0xcd75('0x83')]}});}break;case _0xcd75('0x94'):if(_0x26ce24['body'][0x0]['message']['id']){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][0x0][_0xcd75('0x3e')];return db['SmsMessage'][_0xcd75('0x62')]({'where':{'messageId':_0x26ce24[_0xcd75('0x58')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd5')]&&_0x26ce24['body'][_0xcd75('0x29')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd5')]}});}break;}}})[_0xcd75('0x36')](handleEntityNotFound(_0x456cb8,null))[_0xcd75('0x36')](function(_0x5c2a03){if(_0x5c2a03){_0x8c6baf=_0x5c2a03;switch(_0x59681b[_0xcd75('0x3e')]){case'skebby':if(_0x4c8ad2==='DELIVERED'){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger['error'](_0xcd75('0x23'),_0xcd75('0x29'),_0xcd75('0x85'),util['inspect'](_0x26ce24['body'],{'showHidden':![],'depth':null}));}break;case _0xcd75('0xd0'):if(_0x4c8ad2==='1'){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),_0xcd75('0x29'),_0xcd75('0x85'),util['inspect'](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x26ce24[_0xcd75('0x58')]['error_code']&&_0x4c8ad2>=0xc8&&_0x4c8ad2<=0xce){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),'status',_0xcd75('0x88'),util[_0xcd75('0xd6')](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case _0xcd75('0x8d'):var _0x458b5f=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x8e')][0x0];if(_0x458b5f['status'][_0xcd75('0xd4')]===_0xcd75('0xd7')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcd75('0x29'),_0xcd75('0x8d'),util['inspect'](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c8ad2==_0xcd75('0xd8')||_0x4c8ad2==_0xcd75('0xd9')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),'status',_0xcd75('0x92'),util['inspect'](_0x26ce24['body'],{'showHidden':![],'depth':null}));}break;case _0xcd75('0x94'):if(_0x4c8ad2==_0xcd75('0xda')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),_0xcd75('0x29'),'bandwidth',util[_0xcd75('0xd6')](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case _0xcd75('0xdb'):if(_0x4c8ad2===_0xcd75('0xdc')||_0x4c8ad2===_0xcd75('0xdd')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),_0xcd75('0x29'),_0xcd75('0xdb'),util[_0xcd75('0xd6')](_0x26ce24['body'],{'showHidden':![],'depth':null}));}break;}return _0x8c6baf;}})['then'](respondWithResult(_0x456cb8,null))[_0xcd75('0x27')](handleError(_0x456cb8,null));};exports[_0xcd75('0xde')]=function(_0x449d6c,_0x3326c6,_0x420737){var _0x1d6aa0,_0x4a5497,_0x7dccec;return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x449d6c[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x3326c6,null))['then'](function(_0x4a0a11){if(_0x4a0a11){_0x7dccec=_0x4a0a11;logger[_0xcd75('0xb5')](_0xcd75('0x23'),'status',_0xcd75('0xce'),_0x4a0a11[_0xcd75('0x3e')],util[_0xcd75('0xd6')](_0x449d6c[_0xcd75('0x41')],{'showHidden':![],'depth':null}));switch(_0x4a0a11[_0xcd75('0x3e')]){case _0xcd75('0x8f'):if(_0x449d6c['query'][_0xcd75('0xdf')]&&_0x449d6c[_0xcd75('0x41')][_0xcd75('0xe0')]){_0x4a5497=_0x449d6c['query'][_0xcd75('0xe0')];return db[_0xcd75('0xcb')][_0xcd75('0x62')]({'where':{'messageId':_0x449d6c['query'][_0xcd75('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x3326c6,null))[_0xcd75('0x36')](function(_0x4c8516){if(_0x4c8516){_0x1d6aa0=_0x4c8516;switch(_0x7dccec[_0xcd75('0x3e')]){case _0xcd75('0x8f'):if(_0x4a5497==='2'||_0x4a5497==='6'){return _0x1d6aa0[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),'status',_0xcd75('0x8f'),util[_0xcd75('0xd6')](_0x449d6c[_0xcd75('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x1d6aa0;}})['then'](respondWithResult(_0x3326c6,null))[_0xcd75('0x27')](handleError(_0x3326c6,null));};exports[_0xcd75('0xe1')]=function(_0x584b98,_0x1fbf30,_0x5c11ea){return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x584b98[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x1fbf30,null))[_0xcd75('0x36')](function(_0x274439){if(_0x274439){return _0x274439[_0xcd75('0xe1')](_0x584b98['body']['ids'],_[_0xcd75('0xa1')](_0x584b98['body'],['ids','id'])||{})[_0xcd75('0xa4')](function(_0x28944f){for(var _0xe5db40=0x0;_0xe5db40<_0x584b98[_0xcd75('0x58')][_0xcd75('0x6c')][_0xcd75('0x68')];_0xe5db40+=0x1){socket[_0xcd75('0xe2')](_0xcd75('0xe3'),{'UserId':_0x584b98[_0xcd75('0x58')][_0xcd75('0x6c')][_0xe5db40],'SmsAccountId':_0x584b98[_0xcd75('0x55')]['id']});}return _0x28944f;});}})[_0xcd75('0x36')](respondWithResult(_0x1fbf30,null))[_0xcd75('0x27')](handleError(_0x1fbf30,null));};exports[_0xcd75('0xe4')]=function(_0x156cef,_0x55226a,_0x3ca078){return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x156cef[_0xcd75('0x55')]['id']}})['then'](handleEntityNotFound(_0x55226a,null))[_0xcd75('0x36')](function(_0xae23b){if(_0xae23b){return _0xae23b['removeAgents'](_0x156cef[_0xcd75('0x41')]['ids'])[_0xcd75('0x36')](function(){if(_[_0xcd75('0xe5')](_0x156cef[_0xcd75('0x41')][_0xcd75('0x6c')])){for(var _0x1c3421=0x0;_0x1c3421<_0x156cef['query'][_0xcd75('0x6c')][_0xcd75('0x68')];_0x1c3421+=0x1){socket[_0xcd75('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0x156cef['query'][_0xcd75('0x6c')][_0x1c3421]),'SmsAccountId':Number(_0x156cef[_0xcd75('0x55')]['id'])});}}else{socket['emit'](_0xcd75('0xe6'),{'UserId':Number(_0x156cef['query'][_0xcd75('0x6c')]),'SmsAccountId':Number(_0x156cef[_0xcd75('0x55')]['id'])});}});}})[_0xcd75('0x36')](respondWithStatusCode(_0x55226a,null))[_0xcd75('0x27')](handleError(_0x55226a,null));};exports[_0xcd75('0xe7')]=function(_0x127757,_0x15d352,_0x524314){var _0x3f3ef7={};var _0x4b371f={};var _0xe2de36;var _0x2fe9a3;return db[_0xcd75('0x4f')][_0xcd75('0x66')]({'where':{'id':_0x127757[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x15d352,null))[_0xcd75('0x36')](function(_0x311a6c){if(_0x311a6c){_0xe2de36=_0x311a6c;_0x4b371f[_0xcd75('0x40')]=_[_0xcd75('0x42')](db['User'][_0xcd75('0x67')]);_0x4b371f[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x127757[_0xcd75('0x41')]);_0x4b371f[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x4b371f[_0xcd75('0x40')],_0x4b371f[_0xcd75('0x41')]);_0x3f3ef7[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x4b371f[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x127757[_0xcd75('0x41')][_0xcd75('0x45')]));_0x3f3ef7[_0xcd75('0x44')]=_0x3f3ef7[_0xcd75('0x44')][_0xcd75('0x68')]?_0x3f3ef7[_0xcd75('0x44')]:_0x4b371f[_0xcd75('0x40')];_0x3f3ef7[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x127757[_0xcd75('0x41')]['sort']);_0x3f3ef7[_0xcd75('0x49')]=qs['filters'](_[_0xcd75('0x4a')](_0x127757[_0xcd75('0x41')],_0x4b371f['filters']));if(_0x127757['query']['filter']){_0x3f3ef7[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x3f3ef7[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x3f3ef7['attributes'],function(_0x4ef438){var _0x12218f={};_0x12218f[_0x4ef438]={'$like':'%'+_0x127757['query'][_0xcd75('0x4b')]+'%'};return _0x12218f;})});}_0x3f3ef7=_[_0xcd75('0x4c')]({},_0x3f3ef7,_0x127757[_0xcd75('0x4e')]);return _0xe2de36[_0xcd75('0xe7')](_0x3f3ef7);}})[_0xcd75('0x36')](function(_0x21491d){if(_0x21491d){_0x2fe9a3=_0x21491d[_0xcd75('0x68')];if(!_0x127757[_0xcd75('0x41')][_0xcd75('0x69')]('nolimit')){_0x3f3ef7[_0xcd75('0x2f')]=qs[_0xcd75('0x2f')](_0x127757[_0xcd75('0x41')][_0xcd75('0x2f')]);_0x3f3ef7['offset']=qs[_0xcd75('0x2e')](_0x127757[_0xcd75('0x41')][_0xcd75('0x2e')]);}return _0xe2de36['getAgents'](_0x3f3ef7);}})['then'](function(_0x10937e){if(_0x10937e){return _0x10937e?{'count':_0x2fe9a3,'rows':_0x10937e}:null;}})[_0xcd75('0x36')](respondWithResult(_0x15d352,null))[_0xcd75('0x27')](handleError(_0x15d352,null));}; \ No newline at end of file +var _0xa5c8=['findAndCountAll','getApplications','nolimit','Contact','User','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','skebby_dispatch_id','requestid','statusInt','clicksend','groupName','clickatell','bandwidth','intelepeer','redif','inspect','error_code','infobip','DELIVERED','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','apply','reject','save','get','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','show','params','fields','create','user','role','SmsAccounts','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','SmsAccountId','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','Body','messageId','MessageSid','skebby','text','connectel','message_id','plivo','From','Text','results','csc','originatingAddress','segmentedMessage','fromNumber','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','created','SmsMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','addApplications','sequelize','transaction','bulkCreate'];(function(_0x28dab0,_0xee3577){var _0x1f338d=function(_0x5ba179){while(--_0x5ba179){_0x28dab0['push'](_0x28dab0['shift']());}};_0x1f338d(++_0xee3577);}(_0xa5c8,0x112));var _0x8a5c=function(_0x4e42f3,_0x4613b4){_0x4e42f3=_0x4e42f3-0x0;var _0x2399ae=_0xa5c8[_0x4e42f3];return _0x2399ae;};'use strict';var emlformat=require(_0x8a5c('0x0'));var rimraf=require(_0x8a5c('0x1'));var zipdir=require(_0x8a5c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a5c('0x3'));var moment=require(_0x8a5c('0x4'));var BPromise=require(_0x8a5c('0x5'));var Mustache=require(_0x8a5c('0x6'));var util=require(_0x8a5c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8a5c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a5c('0x9'));var _=require(_0x8a5c('0xa'));var squel=require(_0x8a5c('0xb'));var crypto=require(_0x8a5c('0xc'));var jsforce=require(_0x8a5c('0xd'));var deskjs=require(_0x8a5c('0xe'));var toCsv=require(_0x8a5c('0x8'));var querystring=require(_0x8a5c('0xf'));var Papa=require(_0x8a5c('0x10'));var Redis=require(_0x8a5c('0x11'));var authService=require(_0x8a5c('0x12'));var qs=require(_0x8a5c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a5c('0x14'));var logger=require(_0x8a5c('0x15'))(_0x8a5c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8a5c('0x17'));var db=require(_0x8a5c('0x18'))['db'];config['redis']=_[_0x8a5c('0x19')](config['redis'],{'host':_0x8a5c('0x1a'),'port':0x18eb});var socket=require(_0x8a5c('0x1b'))(new Redis(config['redis']));require(_0x8a5c('0x1c'))[_0x8a5c('0x1d')](socket);var jayson=require(_0x8a5c('0x1e'));var client=jayson[_0x8a5c('0x1f')][_0x8a5c('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x56ea11,_0x95433e,_0x49471e,_0x6886b9){return new BPromise(function(_0x1d44e2,_0x243917){var _0x456acd=_0x6886b9||client;return _0x456acd['request'](_0x56ea11,_0x49471e)[_0x8a5c('0x21')](function(_0x15b03){logger[_0x8a5c('0x22')](_0x8a5c('0x23'),_0x95433e,_0x8a5c('0x24'));logger[_0x8a5c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x95433e,_0x8a5c('0x24'),JSON[_0x8a5c('0x26')](_0x15b03));if(_0x15b03[_0x8a5c('0x27')]){if(_0x15b03['error'][_0x8a5c('0x28')]===0x1f4){logger[_0x8a5c('0x27')](_0x8a5c('0x23'),_0x95433e,_0x15b03[_0x8a5c('0x27')]['message']);return _0x243917(_0x15b03[_0x8a5c('0x27')][_0x8a5c('0x29')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x95433e,_0x15b03[_0x8a5c('0x27')][_0x8a5c('0x29')]);return _0x1d44e2(_0x15b03[_0x8a5c('0x27')]['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x95433e,_0x8a5c('0x24'));_0x1d44e2(_0x15b03[_0x8a5c('0x2a')][_0x8a5c('0x29')]);}})[_0x8a5c('0x2b')](function(_0x3b391c){logger[_0x8a5c('0x27')]('SmsAccount,\x20%s,\x20%s',_0x95433e,_0x3b391c);_0x243917(_0x3b391c);});});}function respondWithStatusCode(_0x47d721,_0x2fa8de){_0x2fa8de=_0x2fa8de||0xcc;return function(_0x3acd21){if(_0x3acd21){return _0x47d721[_0x8a5c('0x2c')](_0x2fa8de);}return _0x47d721[_0x8a5c('0x2d')](_0x2fa8de)[_0x8a5c('0x2e')]();};}function respondWithResult(_0x4a05ae,_0x21d393){_0x21d393=_0x21d393||0xc8;return function(_0x5bf4ba){if(_0x5bf4ba){return _0x4a05ae['status'](_0x21d393)[_0x8a5c('0x2f')](_0x5bf4ba);}};}function respondWithFilteredResult(_0x1e0238,_0x21a88d){return function(_0x25df58){if(_0x25df58){var _0x5d90ac=typeof _0x21a88d[_0x8a5c('0x30')]==='undefined'&&typeof _0x21a88d[_0x8a5c('0x31')]==='undefined';var _0x3e9fa8=_0x25df58[_0x8a5c('0x32')];var _0x5b8867=_0x5d90ac?0x0:_0x21a88d['offset'];var _0x178807=_0x5d90ac?_0x25df58[_0x8a5c('0x32')]:_0x21a88d[_0x8a5c('0x30')]+_0x21a88d[_0x8a5c('0x31')];var _0x150cb2;if(_0x178807>=_0x3e9fa8){_0x178807=_0x3e9fa8;_0x150cb2=0xc8;}else{_0x150cb2=0xce;}_0x1e0238[_0x8a5c('0x2d')](_0x150cb2);return _0x1e0238['set']('Content-Range',_0x5b8867+'-'+_0x178807+'/'+_0x3e9fa8)[_0x8a5c('0x2f')](_0x25df58);}return null;};}function patchUpdates(_0x48ff90){return function(_0x40273e){try{jsonpatch[_0x8a5c('0x33')](_0x40273e,_0x48ff90,!![]);}catch(_0x255859){return BPromise[_0x8a5c('0x34')](_0x255859);}return _0x40273e[_0x8a5c('0x35')]();};}function saveUpdates(_0x4a19c6,_0x3454b2){return function(_0x836450){if(_0x836450){return _0x836450['update'](_0x4a19c6)[_0x8a5c('0x21')](function(_0x3ca3ac){return _0x3ca3ac;});}return null;};}function removeEntity(_0x3a7edb,_0x47332e){return function(_0x1deaa4){if(_0x1deaa4){return _0x1deaa4['destroy']()[_0x8a5c('0x21')](function(){var _0x47ecaa=_0x1deaa4[_0x8a5c('0x36')]({'plain':!![]});var _0x3fcf79='SmsAccounts';return db[_0x8a5c('0x37')][_0x8a5c('0x38')]({'where':{'type':_0x3fcf79,'resourceId':_0x47ecaa['id']}})['then'](function(){return _0x1deaa4;});})[_0x8a5c('0x21')](function(){_0x3a7edb['status'](0xcc)[_0x8a5c('0x2e')]();});}};}function handleEntityNotFound(_0x55f490,_0x23452b){return function(_0x2b4fa3){if(!_0x2b4fa3){_0x55f490[_0x8a5c('0x2c')](0x194);}return _0x2b4fa3;};}function handleError(_0x156f7b,_0x149efe){_0x149efe=_0x149efe||0x1f4;return function(_0x2d0355){logger['error'](_0x2d0355['stack']);if(_0x2d0355[_0x8a5c('0x39')]){delete _0x2d0355[_0x8a5c('0x39')];}_0x156f7b[_0x8a5c('0x2d')](_0x149efe)[_0x8a5c('0x3a')](_0x2d0355);};}exports[_0x8a5c('0x3b')]=function(_0x44ab3d,_0x5023f4){var _0x4ccfc5={'include':[{'model':db[_0x8a5c('0x3c')],'as':_0x8a5c('0x3d')}]},_0x362b5a={},_0x137f06={'count':0x0,'rows':[]};var _0xdfc963=_['map'](db['SmsAccount'][_0x8a5c('0x3e')],function(_0x2f173e){return{'name':_0x2f173e[_0x8a5c('0x3f')],'type':_0x2f173e['type'][_0x8a5c('0x40')]};});_0x362b5a[_0x8a5c('0x41')]=_['map'](_0xdfc963,'name');_0x362b5a[_0x8a5c('0x42')]=_[_0x8a5c('0x43')](_0x44ab3d[_0x8a5c('0x42')]);_0x362b5a[_0x8a5c('0x44')]=_[_0x8a5c('0x45')](_0x362b5a[_0x8a5c('0x41')],_0x362b5a['query']);_0x4ccfc5[_0x8a5c('0x46')]=_[_0x8a5c('0x45')](_0x362b5a['model'],qs['fields'](_0x44ab3d[_0x8a5c('0x42')]['fields']));_0x4ccfc5[_0x8a5c('0x46')]=_0x4ccfc5['attributes'][_0x8a5c('0x47')]?_0x4ccfc5[_0x8a5c('0x46')]:_0x362b5a[_0x8a5c('0x41')];if(!_0x44ab3d['query'][_0x8a5c('0x48')]('nolimit')){_0x4ccfc5[_0x8a5c('0x31')]=qs[_0x8a5c('0x31')](_0x44ab3d[_0x8a5c('0x42')]['limit']);_0x4ccfc5[_0x8a5c('0x30')]=qs['offset'](_0x44ab3d[_0x8a5c('0x42')]['offset']);}_0x4ccfc5['order']=qs[_0x8a5c('0x49')](_0x44ab3d[_0x8a5c('0x42')]['sort']);_0x4ccfc5[_0x8a5c('0x4a')]=qs[_0x8a5c('0x44')](_[_0x8a5c('0x4b')](_0x44ab3d[_0x8a5c('0x42')],_0x362b5a[_0x8a5c('0x44')]),_0xdfc963);if(_0x44ab3d[_0x8a5c('0x42')][_0x8a5c('0x4c')]){_0x4ccfc5[_0x8a5c('0x4a')]=_[_0x8a5c('0x4d')](_0x4ccfc5[_0x8a5c('0x4a')],{'$or':_[_0x8a5c('0x4e')](_0xdfc963,function(_0x75151e){if(_0x75151e[_0x8a5c('0x4f')]!==_0x8a5c('0x50')){var _0x5e5847={};_0x5e5847[_0x75151e[_0x8a5c('0x39')]]={'$like':'%'+_0x44ab3d[_0x8a5c('0x42')][_0x8a5c('0x4c')]+'%'};return _0x5e5847;}})});}_0x4ccfc5=_['merge']({},_0x4ccfc5,_0x44ab3d[_0x8a5c('0x51')]);var _0x3fa21c={'where':_0x4ccfc5['where']};return db[_0x8a5c('0x52')][_0x8a5c('0x32')](_0x3fa21c)[_0x8a5c('0x21')](function(_0x371c62){_0x137f06[_0x8a5c('0x32')]=_0x371c62;if(_0x44ab3d[_0x8a5c('0x42')][_0x8a5c('0x53')]){_0x4ccfc5[_0x8a5c('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x8a5c('0x55')](_0x4ccfc5);})[_0x8a5c('0x21')](function(_0x4f663c){_0x137f06[_0x8a5c('0x56')]=_0x4f663c;return _0x137f06;})[_0x8a5c('0x21')](respondWithFilteredResult(_0x5023f4,_0x4ccfc5))[_0x8a5c('0x2b')](handleError(_0x5023f4,null));};exports[_0x8a5c('0x57')]=function(_0x2d69ac,_0x15eb80){var _0x5b41da={'raw':![],'where':{'id':_0x2d69ac[_0x8a5c('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8a5c('0x3d')}]},_0x51eb77={};_0x51eb77[_0x8a5c('0x41')]=_['keys'](db[_0x8a5c('0x52')][_0x8a5c('0x3e')]);_0x51eb77['query']=_[_0x8a5c('0x43')](_0x2d69ac[_0x8a5c('0x42')]);_0x51eb77[_0x8a5c('0x44')]=_[_0x8a5c('0x45')](_0x51eb77[_0x8a5c('0x41')],_0x51eb77[_0x8a5c('0x42')]);_0x5b41da['attributes']=_[_0x8a5c('0x45')](_0x51eb77[_0x8a5c('0x41')],qs[_0x8a5c('0x59')](_0x2d69ac['query']['fields']));_0x5b41da[_0x8a5c('0x46')]=_0x5b41da[_0x8a5c('0x46')]['length']?_0x5b41da[_0x8a5c('0x46')]:_0x51eb77[_0x8a5c('0x41')];if(_0x2d69ac[_0x8a5c('0x42')]['includeAll']){_0x5b41da['include']=[{'all':!![]}];}_0x5b41da=_[_0x8a5c('0x4d')]({},_0x5b41da,_0x2d69ac['options']);return db['SmsAccount']['find'](_0x5b41da)[_0x8a5c('0x21')](handleEntityNotFound(_0x15eb80,null))[_0x8a5c('0x21')](respondWithResult(_0x15eb80,null))[_0x8a5c('0x2b')](handleError(_0x15eb80,null));};exports['create']=function(_0x5094db,_0xe05294){return db[_0x8a5c('0x52')][_0x8a5c('0x5a')](_0x5094db['body'],{})[_0x8a5c('0x21')](function(_0x138ca3){var _0x22fa97=_0x5094db[_0x8a5c('0x5b')][_0x8a5c('0x36')]({'plain':!![]});if(!_0x22fa97)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22fa97[_0x8a5c('0x5c')]===_0x8a5c('0x5b')){var _0x547a8d=_0x138ca3[_0x8a5c('0x36')]({'plain':!![]});var _0x3b6ad8=_0x8a5c('0x5d');return db['UserProfileSection'][_0x8a5c('0x5e')]({'where':{'name':_0x3b6ad8,'userProfileId':_0x22fa97['userProfileId']},'raw':!![]})['then'](function(_0x47adbf){if(_0x47adbf&&_0x47adbf[_0x8a5c('0x5f')]===0x0){return db['UserProfileResource'][_0x8a5c('0x5a')]({'name':_0x547a8d[_0x8a5c('0x39')],'resourceId':_0x547a8d['id'],'type':_0x47adbf[_0x8a5c('0x39')],'sectionId':_0x47adbf['id']},{})['then'](function(){return _0x138ca3;});}else{return _0x138ca3;}})[_0x8a5c('0x2b')](function(_0x190170){logger['error'](_0x8a5c('0x60'),_0x190170);throw _0x190170;});}return _0x138ca3;})[_0x8a5c('0x21')](respondWithResult(_0xe05294,0xc9))[_0x8a5c('0x2b')](handleError(_0xe05294,null));};exports[_0x8a5c('0x61')]=function(_0x3ee863,_0x50ce8d){if(_0x3ee863[_0x8a5c('0x62')]['id']){delete _0x3ee863[_0x8a5c('0x62')]['id'];}return db['SmsAccount'][_0x8a5c('0x5e')]({'where':{'id':_0x3ee863[_0x8a5c('0x58')]['id']},'include':[{'model':db[_0x8a5c('0x3c')],'as':_0x8a5c('0x3d')}]})[_0x8a5c('0x21')](handleEntityNotFound(_0x50ce8d,null))[_0x8a5c('0x21')](saveUpdates(_0x3ee863[_0x8a5c('0x62')],null))['then'](respondWithResult(_0x50ce8d,null))[_0x8a5c('0x2b')](handleError(_0x50ce8d,null));};exports[_0x8a5c('0x38')]=function(_0x5d7712,_0x359c25){return db['SmsAccount'][_0x8a5c('0x5e')]({'where':{'id':_0x5d7712[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x359c25,null))['then'](removeEntity(_0x359c25,null))[_0x8a5c('0x2b')](handleError(_0x359c25,null));};exports[_0x8a5c('0x63')]=function(_0x5e13b9,_0x5f4efa){return db[_0x8a5c('0x52')]['describe']()['then'](respondWithResult(_0x5f4efa,null))[_0x8a5c('0x2b')](handleError(_0x5f4efa,null));};exports['addDisposition']=function(_0x1453fb,_0x417044,_0xaa4cb6){if(_0x1453fb[_0x8a5c('0x62')]['id']){delete _0x1453fb[_0x8a5c('0x62')]['id'];}return db[_0x8a5c('0x52')][_0x8a5c('0x5e')]({'where':{'id':_0x1453fb['params']['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x417044,null))[_0x8a5c('0x21')](function(_0x4ec34a){if(_0x4ec34a){_0x1453fb[_0x8a5c('0x62')][_0x8a5c('0x64')]=_0x4ec34a['id'];return db['Disposition'][_0x8a5c('0x5a')](_0x1453fb[_0x8a5c('0x62')]);}})[_0x8a5c('0x21')](respondWithResult(_0x417044,null))[_0x8a5c('0x2b')](handleError(_0x417044,null));};exports['getDispositions']=function(_0xb5b963,_0x327d6b,_0x2d02d9){var _0x1a8aed={'raw':![],'where':{}};var _0x234d32={};var _0x38f761={'count':0x0,'rows':[]};return db[_0x8a5c('0x52')]['findOne']({'where':{'id':_0xb5b963[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x327d6b,null))[_0x8a5c('0x21')](function(_0x33b290){if(_0x33b290){_0x234d32[_0x8a5c('0x41')]=_['keys'](db[_0x8a5c('0x65')]['rawAttributes']);_0x234d32[_0x8a5c('0x42')]=_[_0x8a5c('0x43')](_0xb5b963[_0x8a5c('0x42')]);_0x234d32[_0x8a5c('0x44')]=_[_0x8a5c('0x45')](_0x234d32[_0x8a5c('0x41')],_0x234d32[_0x8a5c('0x42')]);_0x1a8aed[_0x8a5c('0x46')]=_[_0x8a5c('0x45')](_0x234d32[_0x8a5c('0x41')],qs['fields'](_0xb5b963[_0x8a5c('0x42')]['fields']));_0x1a8aed[_0x8a5c('0x46')]=_0x1a8aed[_0x8a5c('0x46')][_0x8a5c('0x47')]?_0x1a8aed[_0x8a5c('0x46')]:_0x234d32[_0x8a5c('0x41')];if(!_0xb5b963['query'][_0x8a5c('0x48')]('nolimit')){_0x1a8aed[_0x8a5c('0x31')]=qs[_0x8a5c('0x31')](_0xb5b963[_0x8a5c('0x42')]['limit']);_0x1a8aed[_0x8a5c('0x30')]=qs[_0x8a5c('0x30')](_0xb5b963['query'][_0x8a5c('0x30')]);}_0x1a8aed[_0x8a5c('0x66')]=qs[_0x8a5c('0x49')](_0xb5b963[_0x8a5c('0x42')]['sort']);_0x1a8aed[_0x8a5c('0x4a')]=qs[_0x8a5c('0x44')](_[_0x8a5c('0x4b')](_0xb5b963[_0x8a5c('0x42')],_0x234d32[_0x8a5c('0x44')]));_0x1a8aed[_0x8a5c('0x4a')][_0x8a5c('0x64')]=_0x33b290['id'];if(_0xb5b963[_0x8a5c('0x42')][_0x8a5c('0x4c')]){_0x1a8aed[_0x8a5c('0x4a')]=_[_0x8a5c('0x4d')](_0x1a8aed['where'],{'$or':_[_0x8a5c('0x4e')](_0x1a8aed[_0x8a5c('0x46')],function(_0x139391){var _0x39b5c0={};_0x39b5c0[_0x139391]={'$like':'%'+_0xb5b963[_0x8a5c('0x42')][_0x8a5c('0x4c')]+'%'};return _0x39b5c0;})});}_0x1a8aed=_[_0x8a5c('0x4d')]({},_0x1a8aed,_0xb5b963[_0x8a5c('0x51')]);return db[_0x8a5c('0x65')][_0x8a5c('0x32')]({'where':_0x1a8aed[_0x8a5c('0x4a')]})['then'](function(_0x5e04cd){_0x38f761[_0x8a5c('0x32')]=_0x5e04cd;if(_0xb5b963['query'][_0x8a5c('0x53')]){_0x1a8aed[_0x8a5c('0x54')]=[{'all':!![]}];}return db[_0x8a5c('0x65')][_0x8a5c('0x55')](_0x1a8aed);})[_0x8a5c('0x21')](function(_0x312e0b){_0x38f761['rows']=_0x312e0b;return _0x38f761;});}})[_0x8a5c('0x21')](respondWithFilteredResult(_0x327d6b,_0x1a8aed))[_0x8a5c('0x2b')](handleError(_0x327d6b,null));};exports[_0x8a5c('0x67')]=function(_0x839e9d,_0x36ef75,_0x4c7c36){return db[_0x8a5c('0x52')][_0x8a5c('0x5e')]({'where':{'id':_0x839e9d[_0x8a5c('0x58')]['id']}})['then'](handleEntityNotFound(_0x36ef75,null))[_0x8a5c('0x21')](function(_0x14cfb7){if(_0x14cfb7){return _0x14cfb7[_0x8a5c('0x67')](_0x839e9d[_0x8a5c('0x42')][_0x8a5c('0x68')]);}})[_0x8a5c('0x21')](respondWithStatusCode(_0x36ef75,null))[_0x8a5c('0x2b')](handleError(_0x36ef75,null));};exports[_0x8a5c('0x69')]=function(_0x30b3f7,_0x29e695,_0x5c97d2){if(_0x30b3f7[_0x8a5c('0x62')]['id']){delete _0x30b3f7['body']['id'];}return db[_0x8a5c('0x52')]['find']({'where':{'id':_0x30b3f7['params']['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x29e695,null))[_0x8a5c('0x21')](function(_0x4ef149){if(_0x4ef149){_0x30b3f7[_0x8a5c('0x62')][_0x8a5c('0x64')]=_0x4ef149['id'];return db[_0x8a5c('0x6a')][_0x8a5c('0x5a')](_0x30b3f7['body']);}})[_0x8a5c('0x21')](respondWithResult(_0x29e695,null))[_0x8a5c('0x2b')](handleError(_0x29e695,null));};exports[_0x8a5c('0x6b')]=function(_0x5d5f14,_0x57db14,_0x301f13){var _0xb441ea={'raw':![],'where':{}};var _0x5a12fb={};var _0xea3aa6={'count':0x0,'rows':[]};return db[_0x8a5c('0x52')][_0x8a5c('0x6c')]({'where':{'id':_0x5d5f14[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x57db14,null))[_0x8a5c('0x21')](function(_0x2d7b6f){if(_0x2d7b6f){_0x5a12fb[_0x8a5c('0x41')]=_[_0x8a5c('0x43')](db['CannedAnswer'][_0x8a5c('0x3e')]);_0x5a12fb[_0x8a5c('0x42')]=_[_0x8a5c('0x43')](_0x5d5f14[_0x8a5c('0x42')]);_0x5a12fb['filters']=_['intersection'](_0x5a12fb[_0x8a5c('0x41')],_0x5a12fb['query']);_0xb441ea['attributes']=_[_0x8a5c('0x45')](_0x5a12fb[_0x8a5c('0x41')],qs[_0x8a5c('0x59')](_0x5d5f14[_0x8a5c('0x42')]['fields']));_0xb441ea['attributes']=_0xb441ea['attributes'][_0x8a5c('0x47')]?_0xb441ea[_0x8a5c('0x46')]:_0x5a12fb[_0x8a5c('0x41')];if(!_0x5d5f14['query']['hasOwnProperty']('nolimit')){_0xb441ea[_0x8a5c('0x31')]=qs[_0x8a5c('0x31')](_0x5d5f14[_0x8a5c('0x42')][_0x8a5c('0x31')]);_0xb441ea[_0x8a5c('0x30')]=qs[_0x8a5c('0x30')](_0x5d5f14[_0x8a5c('0x42')][_0x8a5c('0x30')]);}_0xb441ea[_0x8a5c('0x66')]=qs[_0x8a5c('0x49')](_0x5d5f14[_0x8a5c('0x42')][_0x8a5c('0x49')]);_0xb441ea['where']=qs[_0x8a5c('0x44')](_[_0x8a5c('0x4b')](_0x5d5f14['query'],_0x5a12fb['filters']));_0xb441ea[_0x8a5c('0x4a')][_0x8a5c('0x64')]=_0x2d7b6f['id'];if(_0x5d5f14['query']['filter']){_0xb441ea[_0x8a5c('0x4a')]=_[_0x8a5c('0x4d')](_0xb441ea['where'],{'$or':_['map'](_0xb441ea['attributes'],function(_0x3750a5){var _0x578010={};_0x578010[_0x3750a5]={'$like':'%'+_0x5d5f14[_0x8a5c('0x42')][_0x8a5c('0x4c')]+'%'};return _0x578010;})});}_0xb441ea=_[_0x8a5c('0x4d')]({},_0xb441ea,_0x5d5f14[_0x8a5c('0x51')]);return db[_0x8a5c('0x6a')][_0x8a5c('0x32')]({'where':_0xb441ea[_0x8a5c('0x4a')]})[_0x8a5c('0x21')](function(_0x52cac1){_0xea3aa6[_0x8a5c('0x32')]=_0x52cac1;if(_0x5d5f14[_0x8a5c('0x42')][_0x8a5c('0x53')]){_0xb441ea['include']=[{'all':!![]}];}return db[_0x8a5c('0x6a')][_0x8a5c('0x55')](_0xb441ea);})[_0x8a5c('0x21')](function(_0x1e4775){_0xea3aa6['rows']=_0x1e4775;return _0xea3aa6;});}})[_0x8a5c('0x21')](respondWithFilteredResult(_0x57db14,_0xb441ea))[_0x8a5c('0x2b')](handleError(_0x57db14,null));};exports[_0x8a5c('0x6d')]=function(_0x1a6509,_0x17ca75,_0x1a2089){return db[_0x8a5c('0x52')][_0x8a5c('0x5e')]({'where':{'id':_0x1a6509[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x17ca75,null))[_0x8a5c('0x21')](function(_0x38394c){if(_0x38394c){return _0x38394c[_0x8a5c('0x6d')](_0x1a6509[_0x8a5c('0x42')][_0x8a5c('0x68')]);}})['then'](respondWithStatusCode(_0x17ca75,null))[_0x8a5c('0x2b')](handleError(_0x17ca75,null));};exports[_0x8a5c('0x6e')]=function(_0x4d77ff,_0x13f86b,_0x527199){var _0x9200db={'channel':_0x8a5c('0x6f')};var _0x18e9fb=[];var _0x351247=[];var _0x321cd6={};return db[_0x8a5c('0x52')][_0x8a5c('0x5e')]({'where':{'id':_0x4d77ff[_0x8a5c('0x58')]['id']},'include':[{'model':db[_0x8a5c('0x70')],'as':_0x8a5c('0x71')}]})[_0x8a5c('0x21')](handleEntityNotFound(_0x13f86b,null))[_0x8a5c('0x21')](function(_0x3f2324){_0x9200db[_0x8a5c('0x72')]=_0x3f2324;_0x9200db[_0x8a5c('0x73')]=_[_0x8a5c('0x74')](_0x3f2324['Applications'],[_0x8a5c('0x75')],[_0x8a5c('0x76')]);if(_0x9200db[_0x8a5c('0x72')]['Applications']){delete _0x9200db[_0x8a5c('0x72')][_0x8a5c('0x71')];}return db[_0x8a5c('0x77')][_0x8a5c('0x63')]();})[_0x8a5c('0x21')](function(_0x106355){if(!_0x106355){throw new db[(_0x8a5c('0x78'))][(_0x8a5c('0x79'))](_0x8a5c('0x7a'));}_0x18e9fb=_[_0x8a5c('0x7b')](_[_0x8a5c('0x43')](_0x106355),[_0x8a5c('0x7c'),_0x8a5c('0x7d')]);_0x351247=_[_0x8a5c('0x7b')](_[_0x8a5c('0x43')](_0x106355),['createdAt',_0x8a5c('0x7d'),_0x8a5c('0x7e'),_0x8a5c('0x7f')]);_0x9200db[_0x8a5c('0x62')]={'mapKey':'mobile'};if(_0x9200db[_0x8a5c('0x72')][_0x8a5c('0x4f')]){switch(_0x9200db['account']['type']){case _0x8a5c('0x80'):_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x81')]=_0x4d77ff[_0x8a5c('0x62')]['From'];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x82')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x83')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x84')];break;case _0x8a5c('0x85'):_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x81')]='+'+_0x4d77ff[_0x8a5c('0x62')]['sender'];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x86')];break;case _0x8a5c('0x87'):_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x81')]=_0x4d77ff[_0x8a5c('0x62')]['from'];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')]['message'];break;case'clicksend':_0x9200db[_0x8a5c('0x62')]['from']=_0x4d77ff['body'][_0x8a5c('0x81')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x62')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x83')]=_0x4d77ff['body'][_0x8a5c('0x88')];break;case _0x8a5c('0x89'):_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x81')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x8a')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x8b')];_0x9200db['body']['messageId']=_0x4d77ff[_0x8a5c('0x62')]['MessageUUID'];break;case'infobip':_0x9200db[_0x8a5c('0x62')]['from']='+'+_0x4d77ff[_0x8a5c('0x62')]['results'][0x0][_0x8a5c('0x81')];_0x9200db[_0x8a5c('0x62')]['body']=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x8c')][0x0][_0x8a5c('0x86')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x83')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x8c')][0x0]['messageId'];break;case _0x8a5c('0x8d'):_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x81')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x8e')];_0x9200db['body'][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x8f')][_0x8a5c('0x29')];break;case'clickatell':_0x9200db['body'][_0x8a5c('0x81')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x90')];_0x9200db['body'][_0x8a5c('0x62')]=_0x4d77ff['body'][_0x8a5c('0x86')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x83')]=_0x4d77ff[_0x8a5c('0x62')]['replyMessageId'];break;case'bandwidth':_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x83')]=_0x4d77ff[_0x8a5c('0x62')][0x0][_0x8a5c('0x29')]['id'];_0x9200db[_0x8a5c('0x62')]['from']=_0x4d77ff[_0x8a5c('0x62')][0x0][_0x8a5c('0x29')][_0x8a5c('0x81')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')][0x0][_0x8a5c('0x29')][_0x8a5c('0x86')];break;case'intelepeer':_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x81')]=_0x4d77ff['body']['from'];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x29')];_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x83')]=_0x4d77ff[_0x8a5c('0x62')][_0x8a5c('0x91')];break;}}if(_0x9200db[_0x8a5c('0x62')]['id']){delete _0x9200db[_0x8a5c('0x62')]['id'];}if(_[_0x8a5c('0x92')](_0x9200db[_0x8a5c('0x62')]['from'])){throw new db[(_0x8a5c('0x78'))][(_0x8a5c('0x79'))](_0x8a5c('0x93'));}if(_['isNil'](_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')])||_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')]===''){throw new db[(_0x8a5c('0x78'))]['ValidationError'](_0x8a5c('0x94'));}if(_[_0x8a5c('0x92')](_0x9200db['body'][_0x8a5c('0x95')])){throw new db[(_0x8a5c('0x78'))][(_0x8a5c('0x79'))](_0x8a5c('0x96')+_0x351247);}if(!_[_0x8a5c('0x97')](_0x351247,_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x95')])){throw new db[(_0x8a5c('0x78'))][(_0x8a5c('0x79'))](_0x8a5c('0x98')+_0x351247);}_0x321cd6[_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x95')]]=_0x9200db['body'][_0x8a5c('0x81')];return db[_0x8a5c('0x99')][_0x8a5c('0x5e')]({'where':{'id':_0x9200db[_0x8a5c('0x72')][_0x8a5c('0x7f')]},'include':[{'model':db['CmContact'],'as':_0x8a5c('0x9a'),'where':_0x321cd6,'limit':0x1,'order':[[_0x8a5c('0x7d'),'DESC']]}]});})[_0x8a5c('0x21')](handleEntityNotFound(_0x13f86b,null))[_0x8a5c('0x21')](function(_0x5656ed){if(_0x5656ed){_0x9200db[_0x8a5c('0x9b')]=_[_0x8a5c('0x9c')](_0x5656ed,['Contacts']);if(_0x5656ed[_0x8a5c('0x9a')][_0x8a5c('0x47')]){return _0x5656ed[_0x8a5c('0x9a')][0x0];}var _0x4f5f91=_[_0x8a5c('0x19')](_0x9200db[_0x8a5c('0x62')],{'firstName':_0x9200db[_0x8a5c('0x62')]['from'],'ListId':_0x5656ed['id']});_0x4f5f91[_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x95')]]=_0x9200db['body'][_0x8a5c('0x81')];return db[_0x8a5c('0x77')][_0x8a5c('0x5a')](_0x4f5f91,{'fields':_0x18e9fb,'raw':!![]});}})[_0x8a5c('0x21')](handleEntityNotFound(_0x13f86b,null))['then'](function(_0x688b81){if(_0x688b81){_0x9200db[_0x8a5c('0x9d')]=_0x688b81;var _0x3a3b97={'ContactId':_0x688b81['id'],'phone':_0x9200db[_0x8a5c('0x62')]['from'],'SmsAccountId':_0x4d77ff['params']['id']};var _0x3b67b2={'ContactId':_0x688b81['id'],'SmsAccountId':_0x4d77ff[_0x8a5c('0x58')]['id'],'closed':![]};return db[_0x8a5c('0x9e')][_0x8a5c('0x5e')]({'where':_0x3b67b2})[_0x8a5c('0x21')](function(_0x2c1e57){if(_0x2c1e57){return[_0x2c1e57,![]];}return db[_0x8a5c('0x9e')][_0x8a5c('0x5a')](_0x3a3b97)[_0x8a5c('0x21')](function(_0x4ea304){return[_0x4ea304,!![]];});});}})[_0x8a5c('0x9f')](function(_0x374f73,_0x33df35){_0x9200db[_0x8a5c('0xa0')]=_0x374f73['get']({'plain':!![]});_0x9200db[_0x8a5c('0xa0')]['created']=![];if(_0x33df35){if(_0x9200db['account'][_0x8a5c('0xa1')]){_0x9200db[_0x8a5c('0x73')][_0x8a5c('0xa2')]({'id':0x0,'priority':_0x9200db[_0x8a5c('0x73')]['length']+0x1,'app':_0x8a5c('0xa3'),'appdata':_0x8a5c('0xa4'),'interval':'*,*,*,*'});}_0x9200db['interaction'][_0x8a5c('0xa5')]=!![];}return db[_0x8a5c('0xa6')][_0x8a5c('0x5a')]({'phone':_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x81')],'messageId':_0x9200db['body']['messageId'],'body':_0x9200db[_0x8a5c('0x62')][_0x8a5c('0x62')],'SmsAccountId':_0x4d77ff['params']['id'],'SmsInteractionId':_0x374f73['id'],'direction':'in','ContactId':_0x374f73[_0x8a5c('0xa7')],'AttachmentId':_0x9200db[_0x8a5c('0x62')][_0x8a5c('0xa8')]});})['then'](function(_0x46c927){_0x9200db[_0x8a5c('0x29')]=_0x46c927;if(_0x9200db[_0x8a5c('0xa0')][_0x8a5c('0xa9')]){return db['User']['find']({'attributes':['id',_0x8a5c('0x39')],'where':{'id':_0x9200db[_0x8a5c('0xa0')][_0x8a5c('0xa9')]}})['then'](function(_0x2c4744){if(_0x2c4744){_0x9200db[_0x8a5c('0x73')][_0x8a5c('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2c4744[_0x8a5c('0x39')]+','+(_0x9200db[_0x8a5c('0x72')][_0x8a5c('0xab')]||0xa),'interval':_0x8a5c('0xac')});}return respondWithRpcPromise(_0x8a5c('0xad'),'startRouting',_0x9200db);});}return respondWithRpcPromise(_0x8a5c('0xad'),_0x8a5c('0xae'),_0x9200db);})['then'](function(_0x56b90e){if(_0x56b90e){var _0x17b277=0xc8;var _0x296ecc=_0x8a5c('0xaf');logger['info'](_0x8a5c('0xb0'),_0x296ecc,_0x17b277,_0x8a5c('0xb1'));logger[_0x8a5c('0x25')](_0x8a5c('0xb2'),_0x296ecc,_0x17b277,'entity\x20found',JSON[_0x8a5c('0x26')](_0x56b90e));if(_0x9200db[_0x8a5c('0x72')]['type']===_0x8a5c('0x80')){return _0x13f86b[_0x8a5c('0x2d')](_0x17b277)['set'](_0x8a5c('0xb3'),'text/xml')['send']('\x0a');}else{return _0x13f86b[_0x8a5c('0x2d')](_0x17b277)[_0x8a5c('0x2f')](_0x56b90e);}}})['catch'](handleError(_0x13f86b,null));};exports[_0x8a5c('0xb4')]=function(_0x1781db,_0x42baea,_0x325bb1){return db[_0x8a5c('0x52')]['findOne']({'where':{'id':_0x1781db[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x42baea,null))['then'](function(_0x1add99){if(_0x1add99){return db[_0x8a5c('0xb5')][_0x8a5c('0xb6')](function(_0x35d2de){return db[_0x8a5c('0x70')][_0x8a5c('0x38')]({'where':{'SmsAccountId':_0x1781db[_0x8a5c('0x58')]['id']},'transaction':_0x35d2de})['then'](function(_0x2436f5){var _0xd71928=_['map'](_0x1781db[_0x8a5c('0x62')],function(_0x4affa6){_0x4affa6[_0x8a5c('0x64')]=_0x1781db[_0x8a5c('0x58')]['id'];return _0x4affa6;});return db[_0x8a5c('0x70')][_0x8a5c('0xb7')](_0xd71928,{'transaction':_0x35d2de});});})[_0x8a5c('0x21')](function(){return db[_0x8a5c('0x70')][_0x8a5c('0xb8')]({'where':{'SmsAccountId':_0x1781db[_0x8a5c('0x58')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x42baea,null))[_0x8a5c('0x2b')](handleError(_0x42baea,null));};exports[_0x8a5c('0xb9')]=function(_0x2ba9b7,_0x59d807,_0x24fc0a){var _0x11d775={};var _0x474ca3={};var _0x267032;var _0x328fe3;return db[_0x8a5c('0x52')][_0x8a5c('0x6c')]({'where':{'id':_0x2ba9b7['params']['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x59d807,null))[_0x8a5c('0x21')](function(_0x461737){if(_0x461737){_0x267032=_0x461737;_0x474ca3[_0x8a5c('0x41')]=_[_0x8a5c('0x43')](db[_0x8a5c('0x70')][_0x8a5c('0x3e')]);_0x474ca3[_0x8a5c('0x42')]=_[_0x8a5c('0x43')](_0x2ba9b7[_0x8a5c('0x42')]);_0x474ca3[_0x8a5c('0x44')]=_[_0x8a5c('0x45')](_0x474ca3['model'],_0x474ca3['query']);_0x11d775[_0x8a5c('0x46')]=_[_0x8a5c('0x45')](_0x474ca3[_0x8a5c('0x41')],qs[_0x8a5c('0x59')](_0x2ba9b7[_0x8a5c('0x42')][_0x8a5c('0x59')]));_0x11d775['attributes']=_0x11d775['attributes'][_0x8a5c('0x47')]?_0x11d775['attributes']:_0x474ca3[_0x8a5c('0x41')];_0x11d775[_0x8a5c('0x66')]=qs[_0x8a5c('0x49')](_0x2ba9b7[_0x8a5c('0x42')][_0x8a5c('0x49')]);_0x11d775[_0x8a5c('0x4a')]=qs[_0x8a5c('0x44')](_[_0x8a5c('0x4b')](_0x2ba9b7[_0x8a5c('0x42')],_0x474ca3['filters']));if(_0x2ba9b7[_0x8a5c('0x42')][_0x8a5c('0x4c')]){_0x11d775[_0x8a5c('0x4a')]=_[_0x8a5c('0x4d')](_0x11d775['where'],{'$or':_[_0x8a5c('0x4e')](_0x11d775['attributes'],function(_0x5c9b17){var _0x5691e1={};_0x5691e1[_0x5c9b17]={'$like':'%'+_0x2ba9b7[_0x8a5c('0x42')][_0x8a5c('0x4c')]+'%'};return _0x5691e1;})});}_0x11d775=_['merge']({},_0x11d775,_0x2ba9b7['options']);return _0x267032[_0x8a5c('0xb9')](_0x11d775);}})[_0x8a5c('0x21')](function(_0x37bb1b){if(_0x37bb1b){_0x328fe3=_0x37bb1b[_0x8a5c('0x47')];if(!_0x2ba9b7['query']['hasOwnProperty'](_0x8a5c('0xba'))){_0x11d775[_0x8a5c('0x31')]=qs[_0x8a5c('0x31')](_0x2ba9b7[_0x8a5c('0x42')]['limit']);_0x11d775[_0x8a5c('0x30')]=qs[_0x8a5c('0x30')](_0x2ba9b7[_0x8a5c('0x42')][_0x8a5c('0x30')]);}return _0x267032[_0x8a5c('0xb9')](_0x11d775);}})['then'](function(_0x3914e6){if(_0x3914e6){return _0x3914e6?{'count':_0x328fe3,'rows':_0x3914e6}:null;}})['then'](respondWithResult(_0x59d807,null))[_0x8a5c('0x2b')](handleError(_0x59d807,null));};exports['getInteractions']=function(_0x1f558a,_0x2e21f5,_0x5194e1){var _0x358efd={'raw':![],'where':{}};var _0x4a4f50={};var _0x5ace9a={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8a5c('0x6c')]({'where':{'id':_0x1f558a[_0x8a5c('0x58')]['id']}})['then'](handleEntityNotFound(_0x2e21f5,null))[_0x8a5c('0x21')](function(_0x9ff68d){if(_0x9ff68d){_0x4a4f50['model']=_['keys'](db[_0x8a5c('0x9e')][_0x8a5c('0x3e')]);_0x4a4f50['query']=_[_0x8a5c('0x43')](_0x1f558a[_0x8a5c('0x42')]);_0x4a4f50[_0x8a5c('0x44')]=_[_0x8a5c('0x45')](_0x4a4f50[_0x8a5c('0x41')],_0x4a4f50['query']);_0x358efd['attributes']=_['intersection'](_0x4a4f50['model'],qs[_0x8a5c('0x59')](_0x1f558a[_0x8a5c('0x42')][_0x8a5c('0x59')]));_0x358efd['attributes']=_0x358efd[_0x8a5c('0x46')][_0x8a5c('0x47')]?_0x358efd[_0x8a5c('0x46')]:_0x4a4f50['model'];if(!_0x1f558a['query'][_0x8a5c('0x48')]('nolimit')){_0x358efd[_0x8a5c('0x31')]=qs[_0x8a5c('0x31')](_0x1f558a[_0x8a5c('0x42')][_0x8a5c('0x31')]);_0x358efd[_0x8a5c('0x30')]=qs[_0x8a5c('0x30')](_0x1f558a['query'][_0x8a5c('0x30')]);}_0x358efd[_0x8a5c('0x66')]=qs[_0x8a5c('0x49')](_0x1f558a['query'][_0x8a5c('0x49')]);_0x358efd['where']=qs[_0x8a5c('0x44')](_[_0x8a5c('0x4b')](_0x1f558a[_0x8a5c('0x42')],_0x4a4f50[_0x8a5c('0x44')]));_0x358efd[_0x8a5c('0x4a')][_0x8a5c('0x64')]=_0x9ff68d['id'];if(_0x1f558a[_0x8a5c('0x42')][_0x8a5c('0x4c')]){_0x358efd['where']=_[_0x8a5c('0x4d')](_0x358efd[_0x8a5c('0x4a')],{'$or':_['map'](_0x358efd['attributes'],function(_0x366d93){var _0x55719e={};_0x55719e[_0x366d93]={'$like':'%'+_0x1f558a['query'][_0x8a5c('0x4c')]+'%'};return _0x55719e;})});}_0x358efd=_[_0x8a5c('0x4d')]({},_0x358efd,_0x1f558a['options']);return db[_0x8a5c('0x9e')][_0x8a5c('0x32')]({'where':_0x358efd[_0x8a5c('0x4a')]})[_0x8a5c('0x21')](function(_0x35947e){_0x5ace9a[_0x8a5c('0x32')]=_0x35947e;if(_0x1f558a[_0x8a5c('0x42')][_0x8a5c('0x53')]){_0x358efd[_0x8a5c('0x54')]=[{'model':db['CmContact'],'as':_0x8a5c('0xbb'),'required':![]},{'model':db[_0x8a5c('0xbc')],'as':_0x8a5c('0xbd'),'attributes':[_0x8a5c('0x39'),_0x8a5c('0xbe'),'internal'],'required':![]},{'model':db[_0x8a5c('0xbf')],'as':_0x8a5c('0xc0'),'attributes':['id',_0x8a5c('0x39'),_0x8a5c('0xc1')],'where':_0x1f558a['query'][_0x8a5c('0xc2')]?{'id':_0x1f558a['query']['tag']}:undefined,'required':_0x1f558a[_0x8a5c('0x42')][_0x8a5c('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x8a5c('0x55')](_0x358efd);})[_0x8a5c('0x21')](function(_0x49010d){_0x5ace9a[_0x8a5c('0x56')]=_0x49010d;return _0x5ace9a;});}})['then'](respondWithFilteredResult(_0x2e21f5,_0x358efd))[_0x8a5c('0x2b')](handleError(_0x2e21f5,null));};exports['send']=function(_0x4b9a06,_0xde3e9f,_0x51fdd1){var _0x2f523c,_0x237e77,_0x59777e;if(_[_0x8a5c('0x92')](_0x4b9a06['body']['body'])||_0x4b9a06[_0x8a5c('0x62')][_0x8a5c('0x62')]===''){throw new db[(_0x8a5c('0x78'))][(_0x8a5c('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8a5c('0x92')](_0x4b9a06[_0x8a5c('0x62')]['to'])){throw new db['Sequelize'][(_0x8a5c('0x79'))](_0x8a5c('0xc3'));}_0x2f523c=_0x4b9a06[_0x8a5c('0x62')]['to'];return db['SmsAccount'][_0x8a5c('0x5e')]({'where':{'id':_0x4b9a06[_0x8a5c('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x8a5c('0xc4'),'include':[{'model':db['CmContact'],'as':_0x8a5c('0x9a'),'where':{'mobile':_0x2f523c},'limit':0x1,'order':[['updatedAt',_0x8a5c('0xc5')]]}]}]})[_0x8a5c('0x21')](handleEntityNotFound(_0xde3e9f,null))[_0x8a5c('0x21')](function(_0x48a070){if(_0x48a070&&_0x48a070[_0x8a5c('0xc4')]){_0x237e77=_0x48a070[_0x8a5c('0x36')]({'plain':!![]});if(_0x237e77['List']&&_0x237e77[_0x8a5c('0xc4')][_0x8a5c('0x9a')][_0x8a5c('0x47')]){return _0x237e77[_0x8a5c('0xc4')]['Contacts'][0x0];}return db[_0x8a5c('0x77')][_0x8a5c('0x5a')](_[_0x8a5c('0x19')](_0x4b9a06[_0x8a5c('0x62')],{'firstName':_0x2f523c,'mobile':_0x2f523c,'phone':_0x2f523c,'ListId':_0x237e77[_0x8a5c('0x7f')]}));}})[_0x8a5c('0x21')](handleEntityNotFound(_0xde3e9f,null))[_0x8a5c('0x21')](function(_0x3f0892){if(_0x3f0892){_0x59777e=_0x3f0892;return db[_0x8a5c('0x9e')]['find']({'where':{'ContactId':_0x59777e['id'],'closed':![],'SmsAccountId':_0x237e77['id']}})['then'](function(_0xd7ce80){if(_0xd7ce80){return[_0xd7ce80,![]];}return db[_0x8a5c('0x9e')][_0x8a5c('0x5a')]({'UserId':_0x4b9a06['user']['id'],'ContactId':_0x59777e['id'],'SmsAccountId':_0x237e77['id'],'phone':_0x2f523c,'firstMsgDirection':_0x8a5c('0xc6'),'Messages':[_[_0x8a5c('0x4d')](_0x4b9a06[_0x8a5c('0x62')],{'read':![],'body':_0x4b9a06[_0x8a5c('0x62')][_0x8a5c('0x62')],'phone':_0x2f523c,'SmsAccountId':_0x237e77['id'],'UserId':_0x4b9a06[_0x8a5c('0x5b')]['id'],'ContactId':_0x59777e['id']})]},{'include':[{'model':db[_0x8a5c('0xa6')],'as':_0x8a5c('0xc7')}]})['then'](function(_0x52edcf){return[_0x52edcf,!![]];});});}})[_0x8a5c('0x9f')](function(_0x100763,_0x2af99f){if(_0x2af99f){return _0x100763;}return db[_0x8a5c('0xa6')][_0x8a5c('0x5a')](_['merge'](_0x4b9a06[_0x8a5c('0x62')],{'read':![],'body':_0x4b9a06[_0x8a5c('0x62')][_0x8a5c('0x62')],'phone':_0x2f523c,'SmsAccountId':_0x237e77['id'],'SmsInteractionId':_0x100763['id'],'UserId':_0x4b9a06[_0x8a5c('0x5b')]['id'],'ContactId':_0x59777e['id']}))['then'](function(_0x469529){_0x100763[_0x8a5c('0xc8')]['Messages']=[];_0x100763['dataValues']['Messages'][_0x8a5c('0xa2')](_0x469529[_0x8a5c('0xc8')]);return _0x100763;});})[_0x8a5c('0x21')](respondWithResult(_0xde3e9f,null))[_0x8a5c('0x2b')](handleError(_0xde3e9f,null));};exports[_0x8a5c('0x2d')]=function(_0x47b327,_0x4c71bb,_0x5863d3){if(_0x47b327[_0x8a5c('0x62')]['id']){delete _0x47b327[_0x8a5c('0x62')]['id'];}var _0x3114b5,_0x3c5656,_0x4585a6;return db['SmsAccount'][_0x8a5c('0x5e')]({'where':{'id':_0x47b327[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x4c71bb,null))[_0x8a5c('0x21')](function(_0x28fe8b){if(_0x28fe8b){_0x4585a6=_0x28fe8b;logger[_0x8a5c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x28fe8b[_0x8a5c('0x4f')],util['inspect'](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));switch(_0x28fe8b[_0x8a5c('0x4f')]){case'skebby':if(_0x47b327[_0x8a5c('0x62')][_0x8a5c('0xc9')]&&_0x47b327[_0x8a5c('0x62')][_0x8a5c('0x2d')]){_0x3c5656=_0x47b327[_0x8a5c('0x62')][_0x8a5c('0x2d')];return db['SmsMessage'][_0x8a5c('0x5e')]({'where':{'messageId':_0x47b327[_0x8a5c('0x62')][_0x8a5c('0xc9')]}});}break;case _0x8a5c('0x87'):if(_0x47b327['body'][_0x8a5c('0xca')]&&_0x47b327['body'][_0x8a5c('0xcb')]){_0x3c5656=_0x47b327[_0x8a5c('0x62')]['statusInt'];return db[_0x8a5c('0xa6')][_0x8a5c('0x5e')]({'where':{'messageId':_0x47b327[_0x8a5c('0x62')][_0x8a5c('0xca')]}});}break;case _0x8a5c('0xcc'):if(_0x47b327[_0x8a5c('0x62')]['message_id']&&_0x47b327[_0x8a5c('0x62')]['status_code']){_0x3c5656=_0x47b327[_0x8a5c('0x62')]['status_code'];return db['SmsMessage'][_0x8a5c('0x5e')]({'where':{'messageId':_0x47b327['body'][_0x8a5c('0x88')]}});}break;case'infobip':var _0x3ab31a=_0x47b327[_0x8a5c('0x62')][_0x8a5c('0x8c')][0x0];if(_0x3ab31a['messageId']&&_0x3ab31a[_0x8a5c('0x2d')][_0x8a5c('0xcd')]==='DELIVERED'){_0x3c5656=_0x3ab31a[_0x8a5c('0x2d')][_0x8a5c('0xcd')];return db[_0x8a5c('0xa6')]['find']({'where':{'messageId':_0x3ab31a['messageId']}});}break;case _0x8a5c('0xce'):if(_0x47b327['body'][_0x8a5c('0x83')]&&_0x47b327['body'][_0x8a5c('0x2d')]){_0x3c5656=_0x47b327['body']['status'];return db[_0x8a5c('0xa6')][_0x8a5c('0x5e')]({'where':{'messageId':_0x47b327[_0x8a5c('0x62')][_0x8a5c('0x83')]}});}break;case _0x8a5c('0xcf'):if(_0x47b327[_0x8a5c('0x62')][0x0][_0x8a5c('0x29')]['id']){_0x3c5656=_0x47b327['body'][0x0][_0x8a5c('0x4f')];return db[_0x8a5c('0xa6')][_0x8a5c('0x5e')]({'where':{'messageId':_0x47b327['body'][0x0][_0x8a5c('0x29')]['id']}});}break;case _0x8a5c('0xd0'):if(_0x47b327['body'][_0x8a5c('0xd1')]&&_0x47b327[_0x8a5c('0x62')]['status']){_0x3c5656=_0x47b327[_0x8a5c('0x62')][_0x8a5c('0x2d')];return db[_0x8a5c('0xa6')][_0x8a5c('0x5e')]({'where':{'messageId':_0x47b327[_0x8a5c('0x62')][_0x8a5c('0xd1')]}});}break;}}})[_0x8a5c('0x21')](handleEntityNotFound(_0x4c71bb,null))[_0x8a5c('0x21')](function(_0x6e9e00){if(_0x6e9e00){_0x3114b5=_0x6e9e00;switch(_0x4585a6['type']){case _0x8a5c('0x85'):if(_0x3c5656==='DELIVERED'){return _0x3114b5[_0x8a5c('0x61')]({'read':!![]});}else{logger[_0x8a5c('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x8a5c('0x85'),util[_0x8a5c('0xd2')](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x8a5c('0x87'):if(_0x3c5656==='1'){return _0x3114b5[_0x8a5c('0x61')]({'read':!![]});}else{logger['error'](_0x8a5c('0xb0'),'status',_0x8a5c('0x85'),util[_0x8a5c('0xd2')](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x8a5c('0xcc'):if(!_0x47b327[_0x8a5c('0x62')][_0x8a5c('0xd3')]&&_0x3c5656>=0xc8&&_0x3c5656<=0xce){return _0x3114b5[_0x8a5c('0x61')]({'read':!![]});}else{logger[_0x8a5c('0x27')](_0x8a5c('0xb0'),_0x8a5c('0x2d'),_0x8a5c('0xcc'),util[_0x8a5c('0xd2')](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x8a5c('0xd4'):var _0x4f3e45=_0x47b327['body'][_0x8a5c('0x8c')][0x0];if(_0x4f3e45[_0x8a5c('0x2d')]['groupName']===_0x8a5c('0xd5')){return _0x3114b5[_0x8a5c('0x61')]({'read':!![]});}else{logger[_0x8a5c('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8a5c('0x2d'),_0x8a5c('0xd4'),util[_0x8a5c('0xd2')](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3c5656==_0x8a5c('0xd6')||_0x3c5656=='RECEIVED_BY_RECIPIENT'){return _0x3114b5[_0x8a5c('0x61')]({'read':!![]});}else{logger['error'](_0x8a5c('0xb0'),'status',_0x8a5c('0xce'),util[_0x8a5c('0xd2')](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3c5656==_0x8a5c('0xd7')){return _0x3114b5['update']({'read':!![]});}else{logger['error'](_0x8a5c('0xb0'),_0x8a5c('0x2d'),_0x8a5c('0xcf'),util[_0x8a5c('0xd2')](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));}break;case _0x8a5c('0xd0'):if(_0x3c5656===_0x8a5c('0xd8')||_0x3c5656===_0x8a5c('0xd9')){return _0x3114b5[_0x8a5c('0x61')]({'read':!![]});}else{logger['error'](_0x8a5c('0xb0'),'status','intelepeer',util[_0x8a5c('0xd2')](_0x47b327[_0x8a5c('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x3114b5;}})[_0x8a5c('0x21')](respondWithResult(_0x4c71bb,null))['catch'](handleError(_0x4c71bb,null));};exports[_0x8a5c('0xda')]=function(_0x4137e2,_0x44ceb,_0x328136){var _0x48d242,_0x4502d8,_0x518e8a;return db[_0x8a5c('0x52')][_0x8a5c('0x5e')]({'where':{'id':_0x4137e2[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x44ceb,null))[_0x8a5c('0x21')](function(_0x2ac52c){if(_0x2ac52c){_0x518e8a=_0x2ac52c;logger[_0x8a5c('0x25')](_0x8a5c('0xb0'),_0x8a5c('0x2d'),_0x8a5c('0xdb'),_0x2ac52c[_0x8a5c('0x4f')],util[_0x8a5c('0xd2')](_0x4137e2[_0x8a5c('0x42')],{'showHidden':![],'depth':null}));switch(_0x2ac52c[_0x8a5c('0x4f')]){case _0x8a5c('0x8d'):if(_0x4137e2[_0x8a5c('0x42')]['message-id']&&_0x4137e2[_0x8a5c('0x42')][_0x8a5c('0xdc')]){_0x4502d8=_0x4137e2[_0x8a5c('0x42')][_0x8a5c('0xdc')];return db[_0x8a5c('0xa6')][_0x8a5c('0x5e')]({'where':{'messageId':_0x4137e2[_0x8a5c('0x42')][_0x8a5c('0xdd')]}});}break;}}})[_0x8a5c('0x21')](handleEntityNotFound(_0x44ceb,null))[_0x8a5c('0x21')](function(_0x48ee0e){if(_0x48ee0e){_0x48d242=_0x48ee0e;switch(_0x518e8a[_0x8a5c('0x4f')]){case'csc':if(_0x4502d8==='2'||_0x4502d8==='6'){return _0x48d242[_0x8a5c('0x61')]({'read':!![]});}else{logger[_0x8a5c('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8a5c('0x2d'),_0x8a5c('0x8d'),util[_0x8a5c('0xd2')](_0x4137e2[_0x8a5c('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x48d242;}})['then'](respondWithResult(_0x44ceb,null))['catch'](handleError(_0x44ceb,null));};exports[_0x8a5c('0xde')]=function(_0x51f847,_0x2bdd82,_0x3df665){return db[_0x8a5c('0x52')][_0x8a5c('0x5e')]({'where':{'id':_0x51f847[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x2bdd82,null))[_0x8a5c('0x21')](function(_0x5c29ae){if(_0x5c29ae){return _0x5c29ae[_0x8a5c('0xde')](_0x51f847[_0x8a5c('0x62')][_0x8a5c('0x68')],_[_0x8a5c('0x9c')](_0x51f847[_0x8a5c('0x62')],[_0x8a5c('0x68'),'id'])||{})[_0x8a5c('0x9f')](function(_0x2ca87c){for(var _0x37b5e1=0x0;_0x37b5e1<_0x51f847[_0x8a5c('0x62')]['ids'][_0x8a5c('0x47')];_0x37b5e1+=0x1){socket[_0x8a5c('0xdf')](_0x8a5c('0xe0'),{'UserId':_0x51f847[_0x8a5c('0x62')][_0x8a5c('0x68')][_0x37b5e1],'SmsAccountId':_0x51f847[_0x8a5c('0x58')]['id']});}return _0x2ca87c;});}})[_0x8a5c('0x21')](respondWithResult(_0x2bdd82,null))[_0x8a5c('0x2b')](handleError(_0x2bdd82,null));};exports[_0x8a5c('0xe1')]=function(_0x5ec728,_0x47edc4,_0x4c0023){return db[_0x8a5c('0x52')][_0x8a5c('0x5e')]({'where':{'id':_0x5ec728[_0x8a5c('0x58')]['id']}})['then'](handleEntityNotFound(_0x47edc4,null))[_0x8a5c('0x21')](function(_0x3ea1ae){if(_0x3ea1ae){return _0x3ea1ae[_0x8a5c('0xe1')](_0x5ec728[_0x8a5c('0x42')][_0x8a5c('0x68')])[_0x8a5c('0x21')](function(){if(_[_0x8a5c('0xe2')](_0x5ec728[_0x8a5c('0x42')][_0x8a5c('0x68')])){for(var _0xb47e3=0x0;_0xb47e3<_0x5ec728[_0x8a5c('0x42')][_0x8a5c('0x68')][_0x8a5c('0x47')];_0xb47e3+=0x1){socket[_0x8a5c('0xdf')](_0x8a5c('0xe3'),{'UserId':Number(_0x5ec728['query']['ids'][_0xb47e3]),'SmsAccountId':Number(_0x5ec728['params']['id'])});}}else{socket[_0x8a5c('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x5ec728[_0x8a5c('0x42')][_0x8a5c('0x68')]),'SmsAccountId':Number(_0x5ec728[_0x8a5c('0x58')]['id'])});}});}})[_0x8a5c('0x21')](respondWithStatusCode(_0x47edc4,null))['catch'](handleError(_0x47edc4,null));};exports[_0x8a5c('0xe4')]=function(_0x3f3c07,_0x29daa6,_0x1820bd){var _0x737775={};var _0x41a2e9={};var _0x206a13;var _0x19ecd1;return db[_0x8a5c('0x52')]['findOne']({'where':{'id':_0x3f3c07[_0x8a5c('0x58')]['id']}})[_0x8a5c('0x21')](handleEntityNotFound(_0x29daa6,null))[_0x8a5c('0x21')](function(_0x1b534d){if(_0x1b534d){_0x206a13=_0x1b534d;_0x41a2e9[_0x8a5c('0x41')]=_['keys'](db[_0x8a5c('0xbc')][_0x8a5c('0x3e')]);_0x41a2e9['query']=_[_0x8a5c('0x43')](_0x3f3c07['query']);_0x41a2e9[_0x8a5c('0x44')]=_['intersection'](_0x41a2e9[_0x8a5c('0x41')],_0x41a2e9[_0x8a5c('0x42')]);_0x737775[_0x8a5c('0x46')]=_[_0x8a5c('0x45')](_0x41a2e9['model'],qs[_0x8a5c('0x59')](_0x3f3c07['query'][_0x8a5c('0x59')]));_0x737775[_0x8a5c('0x46')]=_0x737775['attributes']['length']?_0x737775[_0x8a5c('0x46')]:_0x41a2e9[_0x8a5c('0x41')];_0x737775[_0x8a5c('0x66')]=qs['sort'](_0x3f3c07[_0x8a5c('0x42')][_0x8a5c('0x49')]);_0x737775[_0x8a5c('0x4a')]=qs[_0x8a5c('0x44')](_[_0x8a5c('0x4b')](_0x3f3c07['query'],_0x41a2e9[_0x8a5c('0x44')]));if(_0x3f3c07['query'][_0x8a5c('0x4c')]){_0x737775[_0x8a5c('0x4a')]=_[_0x8a5c('0x4d')](_0x737775['where'],{'$or':_[_0x8a5c('0x4e')](_0x737775['attributes'],function(_0x5dc852){var _0x1092c3={};_0x1092c3[_0x5dc852]={'$like':'%'+_0x3f3c07[_0x8a5c('0x42')]['filter']+'%'};return _0x1092c3;})});}_0x737775=_[_0x8a5c('0x4d')]({},_0x737775,_0x3f3c07[_0x8a5c('0x51')]);return _0x206a13['getAgents'](_0x737775);}})[_0x8a5c('0x21')](function(_0x225b94){if(_0x225b94){_0x19ecd1=_0x225b94['length'];if(!_0x3f3c07[_0x8a5c('0x42')][_0x8a5c('0x48')](_0x8a5c('0xba'))){_0x737775[_0x8a5c('0x31')]=qs[_0x8a5c('0x31')](_0x3f3c07['query'][_0x8a5c('0x31')]);_0x737775['offset']=qs['offset'](_0x3f3c07[_0x8a5c('0x42')][_0x8a5c('0x30')]);}return _0x206a13[_0x8a5c('0xe4')](_0x737775);}})['then'](function(_0x5ef961){if(_0x5ef961){return _0x5ef961?{'count':_0x19ecd1,'rows':_0x5ef961}:null;}})['then'](respondWithResult(_0x29daa6,null))[_0x8a5c('0x2b')](handleError(_0x29daa6,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 50bbd81..c0083bc 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 _0x2e32=['hasOwnProperty','exports','events','../../mysqldb','SmsAccount','save','update','emit'];(function(_0x2215a4,_0x5bd79e){var _0x11ff69=function(_0x3e2edc){while(--_0x3e2edc){_0x2215a4['push'](_0x2215a4['shift']());}};_0x11ff69(++_0x5bd79e);}(_0x2e32,0x8a));var _0x22e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2e32[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x22e3('0x0'));var SmsAccount=require(_0x22e3('0x1'))['db'][_0x22e3('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x22e3('0x3'),'afterUpdate':_0x22e3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f5cb7){return function(_0x262647,_0x22a87d,_0x1c89aa){SmsAccountEvents[_0x22e3('0x5')](_0x2f5cb7+':'+_0x262647['id'],_0x262647);SmsAccountEvents[_0x22e3('0x5')](_0x2f5cb7,_0x262647);_0x1c89aa(null);};}for(var e in events){if(events[_0x22e3('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x22e3('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xed1d=['save','remove','emit','hasOwnProperty','exports','events','SmsAccount','setMaxListeners'];(function(_0x459094,_0x5e04d5){var _0x18bc8d=function(_0x31a401){while(--_0x31a401){_0x459094['push'](_0x459094['shift']());}};_0x18bc8d(++_0x5e04d5);}(_0xed1d,0x10d));var _0xded1=function(_0x37331e,_0x5da7f8){_0x37331e=_0x37331e-0x0;var _0x50dcc5=_0xed1d[_0x37331e];return _0x50dcc5;};'use strict';var EventEmitter=require(_0xded1('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xded1('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xded1('0x2')](0x0);var events={'afterCreate':_0xded1('0x3'),'afterUpdate':'update','afterDestroy':_0xded1('0x4')};function emitEvent(_0x1452b7){return function(_0x39b09d,_0x510579,_0x2213a4){SmsAccountEvents['emit'](_0x1452b7+':'+_0x39b09d['id'],_0x39b09d);SmsAccountEvents[_0xded1('0x5')](_0x1452b7,_0x39b09d);_0x2213a4(null);};}for(var e in events){if(events[_0xded1('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xded1('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 82e9f5c..82d7f8b 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 _0xf097=['exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ead4e,_0x43a557){var _0x49cc4a=function(_0x13dc5e){while(--_0x13dc5e){_0x3ead4e['push'](_0x3ead4e['shift']());}};_0x49cc4a(++_0x43a557);}(_0xf097,0x66));var _0x7f09=function(_0x44b32b,_0x888499){_0x44b32b=_0x44b32b-0x0;var _0x2a29d7=_0xf097[_0x44b32b];return _0x2a29d7;};'use strict';var _=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var logger=require(_0x7f09('0x2'))(_0x7f09('0x3'));var moment=require(_0x7f09('0x4'));var BPromise=require(_0x7f09('0x5'));var rp=require(_0x7f09('0x6'));var fs=require('fs');var path=require(_0x7f09('0x7'));var rimraf=require(_0x7f09('0x8'));var config=require(_0x7f09('0x9'));var attributes=require('./smsAccount.attributes');module[_0x7f09('0xa')]=function(_0x43a856,_0x4e686a){return _0x43a856[_0x7f09('0xb')](_0x7f09('0xc'),attributes,{'tableName':_0x7f09('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59fa=['moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define','lodash','util','api'];(function(_0x3abe2f,_0x1bdf2b){var _0x3f81e6=function(_0x51ede5){while(--_0x51ede5){_0x3abe2f['push'](_0x3abe2f['shift']());}};_0x3f81e6(++_0x1bdf2b);}(_0x59fa,0x105));var _0xa59f=function(_0xc7ff12,_0x3f1684){_0xc7ff12=_0xc7ff12-0x0;var _0x166a42=_0x59fa[_0xc7ff12];return _0x166a42;};'use strict';var _=require(_0xa59f('0x0'));var util=require(_0xa59f('0x1'));var logger=require('../../config/logger')(_0xa59f('0x2'));var moment=require(_0xa59f('0x3'));var BPromise=require(_0xa59f('0x4'));var rp=require(_0xa59f('0x5'));var fs=require('fs');var path=require(_0xa59f('0x6'));var rimraf=require('rimraf');var config=require(_0xa59f('0x7'));var attributes=require(_0xa59f('0x8'));module[_0xa59f('0x9')]=function(_0x26b3f5,_0xd96166){return _0x26b3f5[_0xa59f('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 091f1fb..0396b5e 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 _0xa944=['error','code','message','result','catch','ShowSmsAccount','find','options','raw','attributes','include','model','map','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xa944,0x103));var _0x4a94=function(_0x210677,_0x4876b7){_0x210677=_0x210677-0x0;var _0x48d4a5=_0xa944[_0x210677];return _0x48d4a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a94('0x0'));var BPromise=require(_0x4a94('0x1'));var rs=require(_0x4a94('0x2'));var fs=require('fs');var Redis=require(_0x4a94('0x3'));var db=require(_0x4a94('0x4'))['db'];var utils=require(_0x4a94('0x5'));var logger=require('../../config/logger')(_0x4a94('0x6'));var config=require(_0x4a94('0x7'));var jayson=require(_0x4a94('0x8'));var client=jayson[_0x4a94('0x9')][_0x4a94('0xa')]({'port':0x232a});config['redis']=_[_0x4a94('0xb')](config[_0x4a94('0xc')],{'host':_0x4a94('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a94('0xc')]));require(_0x4a94('0xe'))['register'](socket);function respondWithRpcPromise(_0x7d9381,_0x467c2f,_0x3e782e){return new BPromise(function(_0x31f8b0,_0x50f89c){return client['request'](_0x7d9381,_0x3e782e)[_0x4a94('0xf')](function(_0x1649ff){logger[_0x4a94('0x10')](_0x4a94('0x11'),_0x467c2f,_0x4a94('0x12'));logger[_0x4a94('0x13')](_0x4a94('0x14'),_0x467c2f,'request\x20sent',JSON['stringify'](_0x1649ff));if(_0x1649ff['error']){if(_0x1649ff[_0x4a94('0x15')][_0x4a94('0x16')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x467c2f,_0x1649ff[_0x4a94('0x15')]['message']);return _0x50f89c(_0x1649ff[_0x4a94('0x15')][_0x4a94('0x17')]);}logger[_0x4a94('0x15')](_0x4a94('0x11'),_0x467c2f,_0x1649ff[_0x4a94('0x15')][_0x4a94('0x17')]);return _0x31f8b0(_0x1649ff[_0x4a94('0x15')]['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x467c2f,_0x4a94('0x12'));_0x31f8b0(_0x1649ff[_0x4a94('0x18')][_0x4a94('0x17')]);}})[_0x4a94('0x19')](function(_0x432232){logger[_0x4a94('0x15')]('SmsAccount,\x20%s,\x20%s',_0x467c2f,_0x432232);_0x50f89c(_0x432232);});});}exports[_0x4a94('0x1a')]=function(_0x45c1e7){var _0xa92739=this;return new Promise(function(_0x29e63a,_0x567fae){return db['SmsAccount'][_0x4a94('0x1b')]({'raw':_0x45c1e7[_0x4a94('0x1c')]?_0x45c1e7[_0x4a94('0x1c')][_0x4a94('0x1d')]===undefined?!![]:![]:!![],'where':_0x45c1e7[_0x4a94('0x1c')]?_0x45c1e7['options']['where']||null:null,'attributes':_0x45c1e7['options']?_0x45c1e7[_0x4a94('0x1c')][_0x4a94('0x1e')]||null:null,'include':_0x45c1e7[_0x4a94('0x1c')]?_0x45c1e7[_0x4a94('0x1c')][_0x4a94('0x1f')]?_['map'](_0x45c1e7[_0x4a94('0x1c')]['include'],function(_0x2f01c9){return{'model':db[_0x2f01c9[_0x4a94('0x20')]],'as':_0x2f01c9['as'],'attributes':_0x2f01c9[_0x4a94('0x1e')],'include':_0x2f01c9[_0x4a94('0x1f')]?_['map'](_0x2f01c9[_0x4a94('0x1f')],function(_0x4a2197){return{'model':db[_0x4a2197[_0x4a94('0x20')]],'as':_0x4a2197['as'],'attributes':_0x4a2197['attributes'],'include':_0x4a2197[_0x4a94('0x1f')]?_[_0x4a94('0x21')](_0x4a2197['include'],function(_0x4133ae){return{'model':db[_0x4133ae[_0x4a94('0x20')]],'as':_0x4133ae['as'],'attributes':_0x4133ae['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a94('0xf')](function(_0x3e7f83){logger[_0x4a94('0x10')](_0x4a94('0x1a'),_0x45c1e7);logger['debug'](_0x4a94('0x1a'),_0x45c1e7,JSON[_0x4a94('0x22')](_0x3e7f83));_0x29e63a(_0x3e7f83);})[_0x4a94('0x19')](function(_0x4f15d1){logger[_0x4a94('0x15')]('ShowSmsAccount',_0x4f15d1['message'],_0x45c1e7);_0x567fae(_0xa92739[_0x4a94('0x15')](0x1f4,_0x4f15d1[_0x4a94('0x17')]));});});}; \ No newline at end of file +var _0x52c5=['error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x5647b5,_0x841db3){var _0x5f0c89=function(_0x1da702){while(--_0x1da702){_0x5647b5['push'](_0x5647b5['shift']());}};_0x5f0c89(++_0x841db3);}(_0x52c5,0x142));var _0x552c=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x52c5[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x552c('0x0'));var util=require(_0x552c('0x1'));var moment=require(_0x552c('0x2'));var BPromise=require(_0x552c('0x3'));var rs=require(_0x552c('0x4'));var fs=require('fs');var Redis=require(_0x552c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x552c('0x6'))(_0x552c('0x7'));var config=require('../../config/environment');var jayson=require(_0x552c('0x8'));var client=jayson[_0x552c('0x9')][_0x552c('0xa')]({'port':0x232a});config['redis']=_[_0x552c('0xb')](config[_0x552c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x552c('0xd'))(new Redis(config[_0x552c('0xc')]));require('./smsAccount.socket')[_0x552c('0xe')](socket);function respondWithRpcPromise(_0x3c8df8,_0x554e55,_0xabcc1f){return new BPromise(function(_0x45ae8e,_0x1a124a){return client[_0x552c('0xf')](_0x3c8df8,_0xabcc1f)['then'](function(_0x2fa4c6){logger['info'](_0x552c('0x10'),_0x554e55,_0x552c('0x11'));logger[_0x552c('0x12')](_0x552c('0x13'),_0x554e55,_0x552c('0x11'),JSON['stringify'](_0x2fa4c6));if(_0x2fa4c6[_0x552c('0x14')]){if(_0x2fa4c6[_0x552c('0x14')][_0x552c('0x15')]===0x1f4){logger[_0x552c('0x14')](_0x552c('0x10'),_0x554e55,_0x2fa4c6[_0x552c('0x14')][_0x552c('0x16')]);return _0x1a124a(_0x2fa4c6['error'][_0x552c('0x16')]);}logger[_0x552c('0x14')](_0x552c('0x10'),_0x554e55,_0x2fa4c6[_0x552c('0x14')][_0x552c('0x16')]);return _0x45ae8e(_0x2fa4c6[_0x552c('0x14')][_0x552c('0x16')]);}else{logger[_0x552c('0x17')](_0x552c('0x10'),_0x554e55,_0x552c('0x11'));_0x45ae8e(_0x2fa4c6[_0x552c('0x18')][_0x552c('0x16')]);}})[_0x552c('0x19')](function(_0x189071){logger[_0x552c('0x14')](_0x552c('0x10'),_0x554e55,_0x189071);_0x1a124a(_0x189071);});});}exports[_0x552c('0x1a')]=function(_0xbc2a93){var _0x4c68a4=this;return new Promise(function(_0x2db402,_0x4d5e6e){return db[_0x552c('0x1b')][_0x552c('0x1c')]({'raw':_0xbc2a93[_0x552c('0x1d')]?_0xbc2a93[_0x552c('0x1d')][_0x552c('0x1e')]===undefined?!![]:![]:!![],'where':_0xbc2a93[_0x552c('0x1d')]?_0xbc2a93[_0x552c('0x1d')][_0x552c('0x1f')]||null:null,'attributes':_0xbc2a93[_0x552c('0x1d')]?_0xbc2a93[_0x552c('0x1d')][_0x552c('0x20')]||null:null,'include':_0xbc2a93[_0x552c('0x1d')]?_0xbc2a93[_0x552c('0x1d')][_0x552c('0x21')]?_[_0x552c('0x22')](_0xbc2a93[_0x552c('0x1d')]['include'],function(_0x27cd1b){return{'model':db[_0x27cd1b['model']],'as':_0x27cd1b['as'],'attributes':_0x27cd1b[_0x552c('0x20')],'include':_0x27cd1b[_0x552c('0x21')]?_[_0x552c('0x22')](_0x27cd1b['include'],function(_0x3fe330){return{'model':db[_0x3fe330[_0x552c('0x23')]],'as':_0x3fe330['as'],'attributes':_0x3fe330[_0x552c('0x20')],'include':_0x3fe330[_0x552c('0x21')]?_[_0x552c('0x22')](_0x3fe330[_0x552c('0x21')],function(_0x16cc61){return{'model':db[_0x16cc61[_0x552c('0x23')]],'as':_0x16cc61['as'],'attributes':_0x16cc61[_0x552c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x552c('0x24')](function(_0x47e80b){logger['info'](_0x552c('0x1a'),_0xbc2a93);logger['debug']('ShowSmsAccount',_0xbc2a93,JSON[_0x552c('0x25')](_0x47e80b));_0x2db402(_0x47e80b);})[_0x552c('0x19')](function(_0xfb38){logger[_0x552c('0x14')](_0x552c('0x1a'),_0xfb38['message'],_0xbc2a93);_0x4d5e6e(_0x4c68a4[_0x552c('0x14')](0x1f4,_0xfb38[_0x552c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 09d97f2..10bea4c 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 705f2d4..6dacba5 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x5da2c5,_0x6306e){var _0x2c0749=function(_0x5cf155){while(--_0x5cf155){_0x5da2c5['push'](_0x5da2c5['shift']());}};_0x2c0749(++_0x6306e);}(_0x3e74,0x175));var _0x43e7=function(_0xdf5667,_0x46590e){_0xdf5667=_0xdf5667-0x0;var _0x289d4e=_0x3e74[_0xdf5667];return _0x289d4e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index dd7a90a..95f884d 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 _0x415b=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x53c2fb,_0x37d8b0){var _0x321bf9=function(_0xdf356){while(--_0xdf356){_0x53c2fb['push'](_0x53c2fb['shift']());}};_0x321bf9(++_0x37d8b0);}(_0x415b,0xfb));var _0xb415=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x415b[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xb415('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb415('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb415('0x2')],'allowNull':![],'defaultValue':_0xb415('0x3')},'appdata':{'type':Sequelize[_0xb415('0x4')]()},'description':{'type':Sequelize[_0xb415('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb415('0x5')}}; \ No newline at end of file +var _0x5a00=['sequelize','exports','noop','STRING','*,*,*,*'];(function(_0x2fe995,_0x33cca4){var _0x33253d=function(_0x38898c){while(--_0x38898c){_0x2fe995['push'](_0x2fe995['shift']());}};_0x33253d(++_0x33cca4);}(_0x5a00,0x127));var _0x05a0=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5a00[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x05a0('0x0'));module[_0x05a0('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x05a0('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x05a0('0x3')]},'interval':{'type':Sequelize[_0x05a0('0x3')],'defaultValue':_0x05a0('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 2457f7c..ddf6980 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 _0x0260=['reject','save','update','then','destroy','sendStatus','error','name','send','index','map','SmsApplication','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','keys','include','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x0260,0x18a));var _0x0026=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x0260[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0x0026('0x0'));var rimraf=require(_0x0026('0x1'));var zipdir=require(_0x0026('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0026('0x3'));var moment=require(_0x0026('0x4'));var BPromise=require(_0x0026('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0026('0x6'));var sox=require('sox');var csv=require(_0x0026('0x7'));var ejs=require(_0x0026('0x8'));var fs=require('fs');var fs_extra=require(_0x0026('0x9'));var _=require(_0x0026('0xa'));var squel=require(_0x0026('0xb'));var crypto=require(_0x0026('0xc'));var jsforce=require(_0x0026('0xd'));var deskjs=require(_0x0026('0xe'));var toCsv=require(_0x0026('0x7'));var querystring=require('querystring');var Papa=require(_0x0026('0xf'));var Redis=require('ioredis');var authService=require(_0x0026('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0026('0x11'));var hardwareService=require(_0x0026('0x12'));var logger=require('../../config/logger')(_0x0026('0x13'));var utils=require('../../config/utils');var config=require(_0x0026('0x14'));var licenseUtil=require(_0x0026('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2d88,_0x2174e3){_0x2174e3=_0x2174e3||0xcc;return function(_0x47ea4e){if(_0x47ea4e){return _0x2e2d88['sendStatus'](_0x2174e3);}return _0x2e2d88[_0x0026('0x16')](_0x2174e3)[_0x0026('0x17')]();};}function respondWithResult(_0x389a85,_0xb9a50a){_0xb9a50a=_0xb9a50a||0xc8;return function(_0x3150f9){if(_0x3150f9){return _0x389a85[_0x0026('0x16')](_0xb9a50a)[_0x0026('0x18')](_0x3150f9);}};}function respondWithFilteredResult(_0x2a7a05,_0x31bd50){return function(_0x594e34){if(_0x594e34){var _0x2edd86=typeof _0x31bd50[_0x0026('0x19')]===_0x0026('0x1a')&&typeof _0x31bd50[_0x0026('0x1b')]===_0x0026('0x1a');var _0x3aa97a=_0x594e34[_0x0026('0x1c')];var _0x8a452b=_0x2edd86?0x0:_0x31bd50[_0x0026('0x19')];var _0x1a35cf=_0x2edd86?_0x594e34['count']:_0x31bd50[_0x0026('0x19')]+_0x31bd50[_0x0026('0x1b')];var _0x53ea66;if(_0x1a35cf>=_0x3aa97a){_0x1a35cf=_0x3aa97a;_0x53ea66=0xc8;}else{_0x53ea66=0xce;}_0x2a7a05[_0x0026('0x16')](_0x53ea66);return _0x2a7a05[_0x0026('0x1d')](_0x0026('0x1e'),_0x8a452b+'-'+_0x1a35cf+'/'+_0x3aa97a)['json'](_0x594e34);}return null;};}function patchUpdates(_0x15077b){return function(_0x279af0){try{jsonpatch[_0x0026('0x1f')](_0x279af0,_0x15077b,!![]);}catch(_0x8bee5e){return BPromise[_0x0026('0x20')](_0x8bee5e);}return _0x279af0[_0x0026('0x21')]();};}function saveUpdates(_0x4550e9,_0x228e49){return function(_0x124f7e){if(_0x124f7e){return _0x124f7e[_0x0026('0x22')](_0x4550e9)[_0x0026('0x23')](function(_0x1a3971){return _0x1a3971;});}return null;};}function removeEntity(_0x5545c,_0x5425f1){return function(_0x835b94){if(_0x835b94){return _0x835b94[_0x0026('0x24')]()[_0x0026('0x23')](function(){_0x5545c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea7a3,_0x579032){return function(_0x463ad2){if(!_0x463ad2){_0x1ea7a3[_0x0026('0x25')](0x194);}return _0x463ad2;};}function handleError(_0x7ef299,_0x33871a){_0x33871a=_0x33871a||0x1f4;return function(_0x1e84cd){logger[_0x0026('0x26')](_0x1e84cd['stack']);if(_0x1e84cd[_0x0026('0x27')]){delete _0x1e84cd[_0x0026('0x27')];}_0x7ef299[_0x0026('0x16')](_0x33871a)[_0x0026('0x28')](_0x1e84cd);};}exports[_0x0026('0x29')]=function(_0x96033c,_0x4c37d2){var _0x260385={},_0x1924cd={},_0x166d4c={'count':0x0,'rows':[]};var _0x21d4a1=_[_0x0026('0x2a')](db[_0x0026('0x2b')][_0x0026('0x2c')],function(_0x2dbd51){return{'name':_0x2dbd51['fieldName'],'type':_0x2dbd51[_0x0026('0x2d')]['key']};});_0x1924cd[_0x0026('0x2e')]=_[_0x0026('0x2a')](_0x21d4a1,'name');_0x1924cd[_0x0026('0x2f')]=_['keys'](_0x96033c[_0x0026('0x2f')]);_0x1924cd[_0x0026('0x30')]=_[_0x0026('0x31')](_0x1924cd[_0x0026('0x2e')],_0x1924cd['query']);_0x260385['attributes']=_[_0x0026('0x31')](_0x1924cd['model'],qs[_0x0026('0x32')](_0x96033c[_0x0026('0x2f')][_0x0026('0x32')]));_0x260385['attributes']=_0x260385[_0x0026('0x33')][_0x0026('0x34')]?_0x260385[_0x0026('0x33')]:_0x1924cd['model'];if(!_0x96033c[_0x0026('0x2f')][_0x0026('0x35')](_0x0026('0x36'))){_0x260385[_0x0026('0x1b')]=qs[_0x0026('0x1b')](_0x96033c[_0x0026('0x2f')][_0x0026('0x1b')]);_0x260385[_0x0026('0x19')]=qs[_0x0026('0x19')](_0x96033c[_0x0026('0x2f')][_0x0026('0x19')]);}_0x260385[_0x0026('0x37')]=qs[_0x0026('0x38')](_0x96033c[_0x0026('0x2f')]['sort']);_0x260385[_0x0026('0x39')]=qs['filters'](_[_0x0026('0x3a')](_0x96033c['query'],_0x1924cd['filters']),_0x21d4a1);if(_0x96033c['query'][_0x0026('0x3b')]){_0x260385[_0x0026('0x39')]=_[_0x0026('0x3c')](_0x260385[_0x0026('0x39')],{'$or':_[_0x0026('0x2a')](_0x21d4a1,function(_0x5ada6c){if(_0x5ada6c[_0x0026('0x2d')]!==_0x0026('0x3d')){var _0x25a480={};_0x25a480[_0x5ada6c[_0x0026('0x27')]]={'$like':'%'+_0x96033c[_0x0026('0x2f')][_0x0026('0x3b')]+'%'};return _0x25a480;}})});}_0x260385=_[_0x0026('0x3c')]({},_0x260385,_0x96033c[_0x0026('0x3e')]);var _0x250385={'where':_0x260385[_0x0026('0x39')]};return db[_0x0026('0x2b')]['count'](_0x250385)['then'](function(_0x969d2){_0x166d4c[_0x0026('0x1c')]=_0x969d2;if(_0x96033c[_0x0026('0x2f')]['includeAll']){_0x260385['include']=[{'all':!![]}];}return db[_0x0026('0x2b')][_0x0026('0x3f')](_0x260385);})[_0x0026('0x23')](function(_0x175deb){_0x166d4c[_0x0026('0x40')]=_0x175deb;return _0x166d4c;})[_0x0026('0x23')](respondWithFilteredResult(_0x4c37d2,_0x260385))[_0x0026('0x41')](handleError(_0x4c37d2,null));};exports['show']=function(_0x364df2,_0x33b519){var _0x1969c8={'raw':!![],'where':{'id':_0x364df2[_0x0026('0x42')]['id']}},_0x26e1e4={};_0x26e1e4[_0x0026('0x2e')]=_[_0x0026('0x43')](db[_0x0026('0x2b')][_0x0026('0x2c')]);_0x26e1e4['query']=_[_0x0026('0x43')](_0x364df2[_0x0026('0x2f')]);_0x26e1e4['filters']=_[_0x0026('0x31')](_0x26e1e4[_0x0026('0x2e')],_0x26e1e4['query']);_0x1969c8[_0x0026('0x33')]=_[_0x0026('0x31')](_0x26e1e4['model'],qs['fields'](_0x364df2[_0x0026('0x2f')]['fields']));_0x1969c8[_0x0026('0x33')]=_0x1969c8[_0x0026('0x33')][_0x0026('0x34')]?_0x1969c8[_0x0026('0x33')]:_0x26e1e4[_0x0026('0x2e')];if(_0x364df2['query']['includeAll']){_0x1969c8[_0x0026('0x44')]=[{'all':!![]}];}_0x1969c8=_[_0x0026('0x3c')]({},_0x1969c8,_0x364df2['options']);return db['SmsApplication'][_0x0026('0x45')](_0x1969c8)[_0x0026('0x23')](handleEntityNotFound(_0x33b519,null))[_0x0026('0x23')](respondWithResult(_0x33b519,null))['catch'](handleError(_0x33b519,null));};exports['create']=function(_0x3bd586,_0x70d8d5){return db[_0x0026('0x2b')]['create'](_0x3bd586[_0x0026('0x46')],{})[_0x0026('0x23')](respondWithResult(_0x70d8d5,0xc9))[_0x0026('0x41')](handleError(_0x70d8d5,null));};exports[_0x0026('0x22')]=function(_0x267c76,_0x12c162){if(_0x267c76[_0x0026('0x46')]['id']){delete _0x267c76[_0x0026('0x46')]['id'];}return db['SmsApplication'][_0x0026('0x45')]({'where':{'id':_0x267c76[_0x0026('0x42')]['id']}})[_0x0026('0x23')](handleEntityNotFound(_0x12c162,null))[_0x0026('0x23')](saveUpdates(_0x267c76[_0x0026('0x46')],null))[_0x0026('0x23')](respondWithResult(_0x12c162,null))[_0x0026('0x41')](handleError(_0x12c162,null));};exports[_0x0026('0x24')]=function(_0x1a02b0,_0x3728af){return db['SmsApplication'][_0x0026('0x45')]({'where':{'id':_0x1a02b0[_0x0026('0x42')]['id']}})[_0x0026('0x23')](handleEntityNotFound(_0x3728af,null))[_0x0026('0x23')](removeEntity(_0x3728af,null))['catch'](handleError(_0x3728af,null));}; \ No newline at end of file +var _0xe61c=['merge','VIRTUAL','options','SmsApplication','includeAll','include','findAll','rows','catch','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x13a680,_0x3065f7){var _0x4ad52a=function(_0x31426b){while(--_0x31426b){_0x13a680['push'](_0x13a680['shift']());}};_0x4ad52a(++_0x3065f7);}(_0xe61c,0xf6));var _0xce61=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0xe61c[_0x4f431d];return _0x4f31e1;};'use strict';var emlformat=require(_0xce61('0x0'));var rimraf=require(_0xce61('0x1'));var zipdir=require(_0xce61('0x2'));var jsonpatch=require(_0xce61('0x3'));var rp=require(_0xce61('0x4'));var moment=require(_0xce61('0x5'));var BPromise=require(_0xce61('0x6'));var Mustache=require('mustache');var util=require(_0xce61('0x7'));var path=require(_0xce61('0x8'));var sox=require(_0xce61('0x9'));var csv=require(_0xce61('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce61('0xb'));var _=require(_0xce61('0xc'));var squel=require(_0xce61('0xd'));var crypto=require(_0xce61('0xe'));var jsforce=require(_0xce61('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xce61('0xa'));var querystring=require(_0xce61('0x10'));var Papa=require(_0xce61('0x11'));var Redis=require('ioredis');var authService=require(_0xce61('0x12'));var qs=require(_0xce61('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce61('0x14'));var logger=require(_0xce61('0x15'))(_0xce61('0x16'));var utils=require(_0xce61('0x17'));var config=require(_0xce61('0x18'));var licenseUtil=require(_0xce61('0x19'));var db=require(_0xce61('0x1a'))['db'];function respondWithStatusCode(_0x42562f,_0x5e170a){_0x5e170a=_0x5e170a||0xcc;return function(_0x666b00){if(_0x666b00){return _0x42562f[_0xce61('0x1b')](_0x5e170a);}return _0x42562f[_0xce61('0x1c')](_0x5e170a)[_0xce61('0x1d')]();};}function respondWithResult(_0x4ad31e,_0x4a84a4){_0x4a84a4=_0x4a84a4||0xc8;return function(_0x39ab08){if(_0x39ab08){return _0x4ad31e[_0xce61('0x1c')](_0x4a84a4)[_0xce61('0x1e')](_0x39ab08);}};}function respondWithFilteredResult(_0x30b3f6,_0x3de25b){return function(_0x20871e){if(_0x20871e){var _0x4482e2=typeof _0x3de25b[_0xce61('0x1f')]==='undefined'&&typeof _0x3de25b[_0xce61('0x20')]===_0xce61('0x21');var _0x2b3907=_0x20871e[_0xce61('0x22')];var _0x2b254c=_0x4482e2?0x0:_0x3de25b[_0xce61('0x1f')];var _0x4301cf=_0x4482e2?_0x20871e[_0xce61('0x22')]:_0x3de25b[_0xce61('0x1f')]+_0x3de25b[_0xce61('0x20')];var _0x5274d7;if(_0x4301cf>=_0x2b3907){_0x4301cf=_0x2b3907;_0x5274d7=0xc8;}else{_0x5274d7=0xce;}_0x30b3f6[_0xce61('0x1c')](_0x5274d7);return _0x30b3f6[_0xce61('0x23')](_0xce61('0x24'),_0x2b254c+'-'+_0x4301cf+'/'+_0x2b3907)[_0xce61('0x1e')](_0x20871e);}return null;};}function patchUpdates(_0x481756){return function(_0x59f2de){try{jsonpatch[_0xce61('0x25')](_0x59f2de,_0x481756,!![]);}catch(_0x181751){return BPromise['reject'](_0x181751);}return _0x59f2de[_0xce61('0x26')]();};}function saveUpdates(_0x5e25a1,_0x2aea97){return function(_0x2806ac){if(_0x2806ac){return _0x2806ac[_0xce61('0x27')](_0x5e25a1)[_0xce61('0x28')](function(_0x35c028){return _0x35c028;});}return null;};}function removeEntity(_0x22289a,_0x11a2e7){return function(_0x4be40f){if(_0x4be40f){return _0x4be40f['destroy']()[_0xce61('0x28')](function(){_0x22289a[_0xce61('0x1c')](0xcc)[_0xce61('0x1d')]();});}};}function handleEntityNotFound(_0x9855b0,_0x4c7083){return function(_0x206e98){if(!_0x206e98){_0x9855b0['sendStatus'](0x194);}return _0x206e98;};}function handleError(_0x470fc8,_0x4ea4e1){_0x4ea4e1=_0x4ea4e1||0x1f4;return function(_0x28bb5d){logger[_0xce61('0x29')](_0x28bb5d[_0xce61('0x2a')]);if(_0x28bb5d['name']){delete _0x28bb5d[_0xce61('0x2b')];}_0x470fc8[_0xce61('0x1c')](_0x4ea4e1)[_0xce61('0x2c')](_0x28bb5d);};}exports['index']=function(_0x2a77e0,_0x141916){var _0x1a28fb={},_0x5b3148={},_0x6f8b74={'count':0x0,'rows':[]};var _0x46e798=_[_0xce61('0x2d')](db['SmsApplication'][_0xce61('0x2e')],function(_0x3d8ffd){return{'name':_0x3d8ffd[_0xce61('0x2f')],'type':_0x3d8ffd['type'][_0xce61('0x30')]};});_0x5b3148[_0xce61('0x31')]=_['map'](_0x46e798,'name');_0x5b3148[_0xce61('0x32')]=_['keys'](_0x2a77e0[_0xce61('0x32')]);_0x5b3148[_0xce61('0x33')]=_['intersection'](_0x5b3148['model'],_0x5b3148[_0xce61('0x32')]);_0x1a28fb[_0xce61('0x34')]=_[_0xce61('0x35')](_0x5b3148[_0xce61('0x31')],qs[_0xce61('0x36')](_0x2a77e0[_0xce61('0x32')]['fields']));_0x1a28fb[_0xce61('0x34')]=_0x1a28fb[_0xce61('0x34')][_0xce61('0x37')]?_0x1a28fb['attributes']:_0x5b3148[_0xce61('0x31')];if(!_0x2a77e0[_0xce61('0x32')][_0xce61('0x38')](_0xce61('0x39'))){_0x1a28fb['limit']=qs[_0xce61('0x20')](_0x2a77e0['query']['limit']);_0x1a28fb[_0xce61('0x1f')]=qs[_0xce61('0x1f')](_0x2a77e0[_0xce61('0x32')][_0xce61('0x1f')]);}_0x1a28fb[_0xce61('0x3a')]=qs['sort'](_0x2a77e0['query'][_0xce61('0x3b')]);_0x1a28fb[_0xce61('0x3c')]=qs[_0xce61('0x33')](_['pick'](_0x2a77e0[_0xce61('0x32')],_0x5b3148['filters']),_0x46e798);if(_0x2a77e0[_0xce61('0x32')][_0xce61('0x3d')]){_0x1a28fb['where']=_[_0xce61('0x3e')](_0x1a28fb['where'],{'$or':_[_0xce61('0x2d')](_0x46e798,function(_0xf032aa){if(_0xf032aa['type']!==_0xce61('0x3f')){var _0x2a9032={};_0x2a9032[_0xf032aa[_0xce61('0x2b')]]={'$like':'%'+_0x2a77e0[_0xce61('0x32')][_0xce61('0x3d')]+'%'};return _0x2a9032;}})});}_0x1a28fb=_[_0xce61('0x3e')]({},_0x1a28fb,_0x2a77e0[_0xce61('0x40')]);var _0x893d2={'where':_0x1a28fb[_0xce61('0x3c')]};return db[_0xce61('0x41')][_0xce61('0x22')](_0x893d2)[_0xce61('0x28')](function(_0x125cb0){_0x6f8b74[_0xce61('0x22')]=_0x125cb0;if(_0x2a77e0[_0xce61('0x32')][_0xce61('0x42')]){_0x1a28fb[_0xce61('0x43')]=[{'all':!![]}];}return db[_0xce61('0x41')][_0xce61('0x44')](_0x1a28fb);})['then'](function(_0x68f515){_0x6f8b74[_0xce61('0x45')]=_0x68f515;return _0x6f8b74;})[_0xce61('0x28')](respondWithFilteredResult(_0x141916,_0x1a28fb))[_0xce61('0x46')](handleError(_0x141916,null));};exports['show']=function(_0x3f01b8,_0x2dfa0e){var _0x37ac0d={'raw':!![],'where':{'id':_0x3f01b8[_0xce61('0x47')]['id']}},_0xece06c={};_0xece06c[_0xce61('0x31')]=_[_0xce61('0x48')](db[_0xce61('0x41')][_0xce61('0x2e')]);_0xece06c[_0xce61('0x32')]=_[_0xce61('0x48')](_0x3f01b8[_0xce61('0x32')]);_0xece06c[_0xce61('0x33')]=_[_0xce61('0x35')](_0xece06c['model'],_0xece06c['query']);_0x37ac0d[_0xce61('0x34')]=_[_0xce61('0x35')](_0xece06c[_0xce61('0x31')],qs['fields'](_0x3f01b8[_0xce61('0x32')][_0xce61('0x36')]));_0x37ac0d[_0xce61('0x34')]=_0x37ac0d[_0xce61('0x34')][_0xce61('0x37')]?_0x37ac0d[_0xce61('0x34')]:_0xece06c['model'];if(_0x3f01b8['query'][_0xce61('0x42')]){_0x37ac0d['include']=[{'all':!![]}];}_0x37ac0d=_[_0xce61('0x3e')]({},_0x37ac0d,_0x3f01b8[_0xce61('0x40')]);return db['SmsApplication'][_0xce61('0x49')](_0x37ac0d)[_0xce61('0x28')](handleEntityNotFound(_0x2dfa0e,null))[_0xce61('0x28')](respondWithResult(_0x2dfa0e,null))[_0xce61('0x46')](handleError(_0x2dfa0e,null));};exports['create']=function(_0xb25c06,_0x2f5e32){return db[_0xce61('0x41')][_0xce61('0x4a')](_0xb25c06[_0xce61('0x4b')],{})[_0xce61('0x28')](respondWithResult(_0x2f5e32,0xc9))[_0xce61('0x46')](handleError(_0x2f5e32,null));};exports[_0xce61('0x27')]=function(_0x3413eb,_0x11d200){if(_0x3413eb[_0xce61('0x4b')]['id']){delete _0x3413eb[_0xce61('0x4b')]['id'];}return db[_0xce61('0x41')][_0xce61('0x49')]({'where':{'id':_0x3413eb[_0xce61('0x47')]['id']}})[_0xce61('0x28')](handleEntityNotFound(_0x11d200,null))[_0xce61('0x28')](saveUpdates(_0x3413eb[_0xce61('0x4b')],null))[_0xce61('0x28')](respondWithResult(_0x11d200,null))['catch'](handleError(_0x11d200,null));};exports[_0xce61('0x4c')]=function(_0x4fcf49,_0x3b035d){return db[_0xce61('0x41')][_0xce61('0x49')]({'where':{'id':_0x4fcf49['params']['id']}})[_0xce61('0x28')](handleEntityNotFound(_0x3b035d,null))[_0xce61('0x28')](removeEntity(_0x3b035d,null))[_0xce61('0x46')](handleError(_0x3b035d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2122cd8..5b61f70 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 _0x5732=['define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x1663f7,_0x17ef75){var _0x283506=function(_0x59b381){while(--_0x59b381){_0x1663f7['push'](_0x1663f7['shift']());}};_0x283506(++_0x17ef75);}(_0x5732,0xfb));var _0x2573=function(_0x4615f9,_0x507e3c){_0x4615f9=_0x4615f9-0x0;var _0x4b4781=_0x5732[_0x4615f9];return _0x4b4781;};'use strict';var _=require(_0x2573('0x0'));var util=require(_0x2573('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2573('0x2'));var BPromise=require(_0x2573('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2573('0x4'));var rimraf=require(_0x2573('0x5'));var config=require(_0x2573('0x6'));var attributes=require(_0x2573('0x7'));module[_0x2573('0x8')]=function(_0x2064cc,_0xcafe30){return _0x2064cc[_0x2573('0x9')](_0x2573('0xa'),attributes,{'tableName':_0x2573('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2573('0xc')});}; \ No newline at end of file +var _0xc2b0=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','sms_applications','utf8mb4','lodash','api','moment'];(function(_0xb751f9,_0x1b0669){var _0x4090dc=function(_0x46976d){while(--_0x46976d){_0xb751f9['push'](_0xb751f9['shift']());}};_0x4090dc(++_0x1b0669);}(_0xc2b0,0x13c));var _0x0c2b=function(_0x451d04,_0x999e7d){_0x451d04=_0x451d04-0x0;var _0x32c6fe=_0xc2b0[_0x451d04];return _0x32c6fe;};'use strict';var _=require(_0x0c2b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c2b('0x1'));var moment=require(_0x0c2b('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c2b('0x3'));var fs=require('fs');var path=require(_0x0c2b('0x4'));var rimraf=require(_0x0c2b('0x5'));var config=require(_0x0c2b('0x6'));var attributes=require(_0x0c2b('0x7'));module['exports']=function(_0xcda589,_0x4c95e4){return _0xcda589[_0x0c2b('0x8')]('SmsApplication',attributes,{'tableName':_0x0c2b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0c2b('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2a563f5..2fd811b 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 _0xa3db=['client','http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xa3db,0x10c));var _0xba3d=function(_0x442ccd,_0x415d61){_0x442ccd=_0x442ccd-0x0;var _0x1a2c10=_0xa3db[_0x442ccd];return _0x1a2c10;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var moment=require(_0xba3d('0x2'));var BPromise=require(_0xba3d('0x3'));var rs=require(_0xba3d('0x4'));var fs=require('fs');var Redis=require(_0xba3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3d('0x6'))('rpc');var config=require(_0xba3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3d('0x8')][_0xba3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477583,_0x1bacd7,_0x1bd181){return new BPromise(function(_0x426868,_0x3b69e9){return client[_0xba3d('0xa')](_0x477583,_0x1bd181)[_0xba3d('0xb')](function(_0x102fe6){logger[_0xba3d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x1bacd7,_0xba3d('0xd'));logger[_0xba3d('0xe')](_0xba3d('0xf'),_0x1bacd7,_0xba3d('0xd'),JSON[_0xba3d('0x10')](_0x102fe6));if(_0x102fe6['error']){if(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x12')]===0x1f4){logger[_0xba3d('0x11')]('SmsApplication,\x20%s,\x20%s',_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x3b69e9(_0x102fe6[_0xba3d('0x11')]['message']);}logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x426868(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x13')]);}else{logger[_0xba3d('0xc')](_0xba3d('0x14'),_0x1bacd7,_0xba3d('0xd'));_0x426868(_0x102fe6[_0xba3d('0x15')][_0xba3d('0x13')]);}})[_0xba3d('0x16')](function(_0x2ce092){logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x2ce092);_0x3b69e9(_0x2ce092);});});} \ No newline at end of file +var _0x0eeb=['client','http','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x564d8d,_0x3acc50){var _0x124917=function(_0x53c2e3){while(--_0x53c2e3){_0x564d8d['push'](_0x564d8d['shift']());}};_0x124917(++_0x3acc50);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0eeb[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var moment=require(_0xb0ee('0x2'));var BPromise=require(_0xb0ee('0x3'));var rs=require(_0xb0ee('0x4'));var fs=require('fs');var Redis=require(_0xb0ee('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb0ee('0x6'))(_0xb0ee('0x7'));var config=require(_0xb0ee('0x8'));var jayson=require(_0xb0ee('0x9'));var client=jayson[_0xb0ee('0xa')][_0xb0ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17f445,_0x5377b4,_0x207a85){return new BPromise(function(_0x586bc9,_0x13c198){return client[_0xb0ee('0xc')](_0x17f445,_0x207a85)[_0xb0ee('0xd')](function(_0x308603){logger[_0xb0ee('0xe')](_0xb0ee('0xf'),_0x5377b4,'request\x20sent');logger['debug'](_0xb0ee('0x10'),_0x5377b4,_0xb0ee('0x11'),JSON['stringify'](_0x308603));if(_0x308603['error']){if(_0x308603[_0xb0ee('0x12')][_0xb0ee('0x13')]===0x1f4){logger[_0xb0ee('0x12')](_0xb0ee('0xf'),_0x5377b4,_0x308603['error'][_0xb0ee('0x14')]);return _0x13c198(_0x308603['error']['message']);}logger['error'](_0xb0ee('0xf'),_0x5377b4,_0x308603[_0xb0ee('0x12')]['message']);return _0x586bc9(_0x308603[_0xb0ee('0x12')][_0xb0ee('0x14')]);}else{logger[_0xb0ee('0xe')](_0xb0ee('0xf'),_0x5377b4,_0xb0ee('0x11'));_0x586bc9(_0x308603[_0xb0ee('0x15')][_0xb0ee('0x14')]);}})[_0xb0ee('0x16')](function(_0x549e64){logger['error'](_0xb0ee('0xf'),_0x5377b4,_0x549e64);_0x13c198(_0x549e64);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f04ef7f..84419dc 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 _0x4fc2=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy'];(function(_0x378d05,_0x327da4){var _0x4052be=function(_0x1dbad4){while(--_0x1dbad4){_0x378d05['push'](_0x378d05['shift']());}};_0x4052be(++_0x327da4);}(_0x4fc2,0x111));var _0x24fc=function(_0x14f5c3,_0x1e3047){_0x14f5c3=_0x14f5c3-0x0;var _0x2ea070=_0x4fc2[_0x14f5c3];return _0x2ea070;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['post']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['post'](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x18')),controller[_0x24fc('0x19')]);router[_0x24fc('0x1a')]('/:id',auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x1b')),controller[_0x24fc('0x1c')]);router[_0x24fc('0x1d')](_0x24fc('0xe'),auth['isAuthenticated'](),interaction[_0x24fc('0x1e')](_0x24fc('0x17'),_0x24fc('0x1f')),controller[_0x24fc('0x20')]);router['delete'](_0x24fc('0x16'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x21')]);module['exports']=router; \ No newline at end of file +var _0x36ee=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf07227,_0x20b9f8){var _0x598759=function(_0x5c0f15){while(--_0x5c0f15){_0xf07227['push'](_0xf07227['shift']());}};_0x598759(++_0x20b9f8);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'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('0x13')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router['post'](_0xe36e('0xf'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x13')]('/:id/tags',auth[_0xe36e('0x9')](),interaction['tracked']('sms',_0xe36e('0x16')),controller[_0xe36e('0x17')]);router[_0xe36e('0x18')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')](_0xe36e('0x1a'),_0xe36e('0x1b')),controller[_0xe36e('0x1c')]);router[_0xe36e('0x1d')]('/:id',auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')]('sms',_0xe36e('0x1e')),controller['destroy']);router[_0xe36e('0x1d')](_0xe36e('0x1f'),auth['isAuthenticated'](),controller[_0xe36e('0x20')]);module[_0xe36e('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 1b11410..a5a136f 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 _0xfc17=['STRING','DATE','out','ENUM','sequelize','moment','exports','BOOLEAN'];(function(_0x59a850,_0x5ea9f5){var _0x1a6a58=function(_0x4496a2){while(--_0x4496a2){_0x59a850['push'](_0x59a850['shift']());}};_0x1a6a58(++_0x5ea9f5);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x2c6b5a,_0x1dc6bc){_0x2c6b5a=_0x2c6b5a-0x0;var _0x23ca9a=_0xfc17[_0x2c6b5a];return _0x23ca9a;};'use strict';var Sequelize=require(_0x7fc1('0x0'));var moment=require(_0x7fc1('0x1'));module[_0x7fc1('0x2')]={'closed':{'type':Sequelize[_0x7fc1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7fc1('0x4')]},'secondDisposition':{'type':Sequelize[_0x7fc1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7fc1('0x4')]},'note':{'type':Sequelize[_0x7fc1('0x4')]},'phone':{'type':Sequelize[_0x7fc1('0x4')]},'read1stAt':{'type':Sequelize[_0x7fc1('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7fc1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7fc1('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x7fc1('0x7')]('in',_0x7fc1('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7fc1('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xf105=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x312cd8,_0x426245){var _0x137254=function(_0x3affd3){while(--_0x3affd3){_0x312cd8['push'](_0x312cd8['shift']());}};_0x137254(++_0x426245);}(_0xf105,0x1b0));var _0x5f10=function(_0x4694a9,_0x3a8f35){_0x4694a9=_0x4694a9-0x0;var _0xc681db=_0xf105[_0x4694a9];return _0xc681db;};'use strict';var Sequelize=require(_0x5f10('0x0'));var moment=require(_0x5f10('0x1'));module[_0x5f10('0x2')]={'closed':{'type':Sequelize[_0x5f10('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5f10('0x4')]},'disposition':{'type':Sequelize[_0x5f10('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5f10('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x5f10('0x5')]},'read1stAt':{'type':Sequelize[_0x5f10('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5f10('0x6')]('in',_0x5f10('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5f10('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5f10('0x6')]('in',_0x5f10('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5f10('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index dd701ca..14e52af 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 _0xdc9d=['all','show','params','options','create','describe','SmsMessage','addMessage','omit','ids','findOne','filter','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','setTags','spread','findAll','color','emit','smsInteractionTags:save','removeTags','unix','join','root','server','files','tmp','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','System','out','renderFile','views','.pdf','download','log','rimraf','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','catch','index','SmsInteraction','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','from','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','sms_messages','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','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?','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','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','Contact.email','Contact.phone','c.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push'];(function(_0x20ce7b,_0x33a58d){var _0x244e55=function(_0x54cc57){while(--_0x54cc57){_0x20ce7b['push'](_0x20ce7b['shift']());}};_0x244e55(++_0x33a58d);}(_0xdc9d,0x1eb));var _0xddc9=function(_0x3b337d,_0x135d24){_0x3b337d=_0x3b337d-0x0;var _0x58d76b=_0xdc9d[_0x3b337d];return _0x58d76b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddc9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xddc9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xddc9('0x2'));var util=require(_0xddc9('0x3'));var path=require('path');var sox=require(_0xddc9('0x4'));var csv=require(_0xddc9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddc9('0x6'));var _=require(_0xddc9('0x7'));var squel=require(_0xddc9('0x8'));var crypto=require(_0xddc9('0x9'));var jsforce=require(_0xddc9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xddc9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddc9('0xc'));var qs=require(_0xddc9('0xd'));var as=require(_0xddc9('0xe'));var pdf=require(_0xddc9('0xf'));var hardwareService=require(_0xddc9('0x10'));var logger=require(_0xddc9('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xddc9('0x12'));var db=require(_0xddc9('0x13'))['db'];config['redis']=_[_0xddc9('0x14')](config['redis'],{'host':_0xddc9('0x15'),'port':0x18eb});var socket=require(_0xddc9('0x16'))(new Redis(config[_0xddc9('0x17')]));require(_0xddc9('0x18'))['register'](socket);function respondWithStatusCode(_0x4b13b4,_0x4d0247){_0x4d0247=_0x4d0247||0xcc;return function(_0x2c9026){if(_0x2c9026){return _0x4b13b4['sendStatus'](_0x4d0247);}return _0x4b13b4[_0xddc9('0x19')](_0x4d0247)['end']();};}function respondWithResult(_0x333328,_0x2afae1){_0x2afae1=_0x2afae1||0xc8;return function(_0x16c70f){if(_0x16c70f){return _0x333328[_0xddc9('0x19')](_0x2afae1)['json'](_0x16c70f);}};}function respondWithFilteredResult(_0x35a8c8,_0x24b96e){return function(_0x3d39f9){if(_0x3d39f9){var _0x1608fc=typeof _0x24b96e[_0xddc9('0x1a')]===_0xddc9('0x1b')&&typeof _0x24b96e[_0xddc9('0x1c')]===_0xddc9('0x1b');var _0x19bbe9=_0x3d39f9[_0xddc9('0x1d')];var _0xacc56d=_0x1608fc?0x0:_0x24b96e[_0xddc9('0x1a')];var _0x266e65=_0x1608fc?_0x3d39f9['count']:_0x24b96e[_0xddc9('0x1a')]+_0x24b96e[_0xddc9('0x1c')];var _0x143e01;if(_0x266e65>=_0x19bbe9){_0x266e65=_0x19bbe9;_0x143e01=0xc8;}else{_0x143e01=0xce;}_0x35a8c8['status'](_0x143e01);return _0x35a8c8['set'](_0xddc9('0x1e'),_0xacc56d+'-'+_0x266e65+'/'+_0x19bbe9)[_0xddc9('0x1f')](_0x3d39f9);}return null;};}function patchUpdates(_0x84fda){return function(_0x393310){try{jsonpatch[_0xddc9('0x20')](_0x393310,_0x84fda,!![]);}catch(_0x561b3b){return BPromise[_0xddc9('0x21')](_0x561b3b);}return _0x393310[_0xddc9('0x22')]();};}function saveUpdates(_0x4ee46a,_0x335530){return function(_0x5ebbb0){if(_0x5ebbb0){return _0x5ebbb0[_0xddc9('0x23')](_0x4ee46a)[_0xddc9('0x24')](function(_0x535cfa){return _0x535cfa;});}return null;};}function removeEntity(_0x4a646b,_0x2ead33){return function(_0xde6dd){if(_0xde6dd){return _0xde6dd[_0xddc9('0x25')]()[_0xddc9('0x24')](function(){_0x4a646b[_0xddc9('0x19')](0xcc)[_0xddc9('0x26')]();});}};}function handleEntityNotFound(_0x1ac8c9,_0xba3a0a){return function(_0x1fcdfd){if(!_0x1fcdfd){_0x1ac8c9[_0xddc9('0x27')](0x194);}return _0x1fcdfd;};}function handleError(_0xe49fbf,_0x35e574){_0x35e574=_0x35e574||0x1f4;return function(_0x2a5396){logger[_0xddc9('0x28')](_0x2a5396[_0xddc9('0x29')]);if(_0x2a5396['name']){delete _0x2a5396[_0xddc9('0x2a')];}_0xe49fbf[_0xddc9('0x19')](_0x35e574)[_0xddc9('0x2b')](_0x2a5396);};}function getInteractionUsers(_0x220cf0,_0x1d615d){return new BPromise(function(_0x12586b,_0x4038f1){try{if(_0x1d615d[_0x220cf0['id']]){_0x220cf0[_0xddc9('0x2c')]=_[_0xddc9('0x2d')](_0x1d615d[_0x220cf0['id']],function(_0x3d3565){return{'id':_0x3d3565['id'],'fullname':_0x3d3565[_0xddc9('0x2e')]};});}}catch(_0x847b66){_0x4038f1(_0x847b66);}_0x12586b(_0x220cf0);});}function getInteractionTags(_0x45df9c,_0x5bef3e){return new BPromise(function(_0x1cfaa7,_0x2f0fc3){try{if(_0x45df9c[_0xddc9('0x2f')]){_0x45df9c['Tags']=[];_0x45df9c[_0xddc9('0x2f')][_0xddc9('0x30')](',')[_0xddc9('0x31')](function(_0x5b9a47){_0x45df9c[_0xddc9('0x32')]['push'](_0x5bef3e[_0x5b9a47]);});}delete _0x45df9c[_0xddc9('0x2f')];}catch(_0x125923){_0x2f0fc3(_0x125923);}_0x1cfaa7(_0x45df9c);});}function updateSmsInteraction(_0x142b4e,_0xd7059a,_0x339863){return new BPromise(function(_0x29c093,_0x5348c3){return getInteractionUsers(_0x142b4e,_0x339863)['then'](function(_0x3821ab){return getInteractionTags(_0x3821ab,_0xd7059a);})[_0xddc9('0x24')](function(_0x240d3e){_0x29c093(_0x240d3e);})[_0xddc9('0x33')](function(_0x48d746){_0x5348c3(_0x48d746);});});}exports[_0xddc9('0x34')]=function(_0x3e73ed,_0x118066){var _0x4f82de={},_0x31e1b8={},_0x5ffcaf={'count':0x0,'rows':[]};var _0x568424=_['map'](db[_0xddc9('0x35')][_0xddc9('0x36')],function(_0x33776e){return{'name':_0x33776e[_0xddc9('0x37')],'type':_0x33776e['type']['key']};});_0x31e1b8[_0xddc9('0x38')]=_[_0xddc9('0x2d')](_0x568424,_0xddc9('0x2a'));_0x31e1b8[_0xddc9('0x39')]=_[_0xddc9('0x3a')](_0x3e73ed['query']);_0x31e1b8[_0xddc9('0x3b')]=_['intersection'](_0x31e1b8[_0xddc9('0x38')],_0x31e1b8[_0xddc9('0x39')]);_0x4f82de[_0xddc9('0x3c')]=_[_0xddc9('0x3d')](_0x31e1b8['model'],qs[_0xddc9('0x3e')](_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x3e')]));_0x4f82de['attributes']=_0x4f82de['attributes'][_0xddc9('0x3f')]?_0x4f82de[_0xddc9('0x3c')]:_0x31e1b8[_0xddc9('0x38')];if(!_0x3e73ed['query'][_0xddc9('0x40')](_0xddc9('0x41'))){_0x4f82de['limit']=qs['limit'](_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x1c')]);_0x4f82de[_0xddc9('0x1a')]=qs[_0xddc9('0x1a')](_0x3e73ed['query']['offset']);}_0x4f82de[_0xddc9('0x42')]=qs[_0xddc9('0x43')](_0x3e73ed[_0xddc9('0x39')]['sort']);_0x4f82de['where']=qs[_0xddc9('0x3b')](_[_0xddc9('0x44')](_0x3e73ed['query'],_0x31e1b8['filters']),_0x568424);var _0x5566ab=[];var _0x3f214a=squel['select']()['field']('id')[_0xddc9('0x45')](_0xddc9('0x2a'))[_0xddc9('0x45')]('color')[_0xddc9('0x46')]('tools_tags');var _0x3e7e24=squel[_0xddc9('0x47')]()[_0xddc9('0x45')](_0xddc9('0x48'))['field'](_0xddc9('0x49'))[_0xddc9('0x45')](_0xddc9('0x4a'))[_0xddc9('0x46')](_0xddc9('0x4b'),'ui')[_0xddc9('0x4c')](_0xddc9('0x4d'),'u',_0xddc9('0x4e'));var _0x290514=squel[_0xddc9('0x47')]()[_0xddc9('0x46')]('sms_interactions','i')['left_join'](_0xddc9('0x4f'),'c',_0xddc9('0x50'))[_0xddc9('0x4c')](_0xddc9('0x4d'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xddc9('0x51'),'a','a.id\x20=\x20i.SmsAccountId')[_0xddc9('0x4c')](_0xddc9('0x52'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xddc9('0x4c')]('sms_interaction_has_tags','it',_0xddc9('0x53'))[_0xddc9('0x4c')](_0xddc9('0x54'),'t',_0xddc9('0x55'));var _0x1a9f4f=squel[_0xddc9('0x56')]();var _0x328505=[];var _0x5c4cef=squel[_0xddc9('0x56')]();var _0x50e8c6;if(_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x57')]){_0x50e8c6=as[_0xddc9('0x58')](_0x3e73ed['query']['search']);var _0x20a82a=_0x50e8c6[_0xddc9('0x59')];for(var _0x13035f=0x0;_0x13035f<_0x50e8c6[_0xddc9('0x5a')][_0xddc9('0x3f')];_0x13035f++){var _0x488859=_0x50e8c6[_0xddc9('0x5a')][_0x13035f];var _0x492f53='i';var _0x1a91bd=_[_0xddc9('0x5b')](_0x568424,[_0xddc9('0x2a'),_0x488859[_0xddc9('0x45')]]);if(!_0x1a91bd){switch(_0x488859[_0xddc9('0x45')]){case _0xddc9('0x5c'):if(_0x488859['value']==0x1){_0x290514[_0xddc9('0x5d')]('`'+_0x488859[_0xddc9('0x45')]+_0xddc9('0x5e'));}else{_0x290514[_0xddc9('0x5d')]('`'+_0x488859[_0xddc9('0x45')]+_0xddc9('0x5f'));}break;case _0xddc9('0x60'):if(_0x488859[_0xddc9('0x61')]===_0xddc9('0x62')){if(_0x488859[_0xddc9('0x63')]['split']('\x20')[_0xddc9('0x3f')]>0x1){_0x1a9f4f[_0x20a82a](_0xddc9('0x64'),qs[_0xddc9('0x65')](_0x488859['value']),null);}else{var _0xe66e11='%'+_0x488859[_0xddc9('0x63')]+'%';_0x1a9f4f[_0x20a82a](_0xddc9('0x66'),_0xe66e11,_0xe66e11,_0xe66e11);}}else{_0x1a91bd=_[_0xddc9('0x5b')](_0x568424,[_0xddc9('0x2a'),_0xddc9('0x67')]);_0x488859[_0xddc9('0x45')]=_0xddc9('0x67');_0x4ce5f9=as[_0xddc9('0x68')](_0x492f53,_0x1a91bd[_0xddc9('0x69')],_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9['value'][_0xddc9('0x6b')],_0x4ce5f9[_0xddc9('0x63')]['end']);}break;case _0xddc9('0x6c'):var _0x2b9c67=_0x488859[_0xddc9('0x63')][_0xddc9('0x30')](',')[_0xddc9('0x2d')](function(_0x56f334){return Number(_0x56f334);});_0x2b9c67[_0xddc9('0x31')](function(_0x2ffd4f){_0x5c4cef['or'](_0xddc9('0x6d'),'%,'+_0x2ffd4f+',%');});_0x328505=_[_0xddc9('0x6e')](_0x328505,_0x2b9c67);break;case _0xddc9('0x6f'):if(_0x488859[_0xddc9('0x61')]===_0xddc9('0x62')){_0x1a9f4f[_0x20a82a](_0xddc9('0x70'),'%'+_0x488859[_0xddc9('0x63')]+'%',null);}else{_0x1a91bd=_[_0xddc9('0x5b')](_0x568424,[_0xddc9('0x2a'),_0xddc9('0x71')]);_0x488859[_0xddc9('0x45')]=_0xddc9('0x71');_0x4ce5f9=as[_0xddc9('0x68')](_0x492f53,_0x1a91bd[_0xddc9('0x69')],_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9[_0xddc9('0x63')]['start'],_0x4ce5f9[_0xddc9('0x63')]['end']);}break;case _0xddc9('0x72'):_0x4ce5f9=as['buildExpression']('me',null,_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9[_0xddc9('0x63')][_0xddc9('0x6b')],_0x4ce5f9[_0xddc9('0x63')]['end']);break;}}else{var _0x4ce5f9=as[_0xddc9('0x68')](_0x492f53,_0x1a91bd[_0xddc9('0x69')],_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9[_0xddc9('0x63')][_0xddc9('0x6b')],_0x4ce5f9[_0xddc9('0x63')][_0xddc9('0x26')]);}}}else{var _0xabcad3=_(_0x3e73ed[_0xddc9('0x39')])['keys']()[_0xddc9('0x2d')](function(_0x26408b){return _[_0xddc9('0x73')](_0x568424,[_0xddc9('0x2a'),_0x26408b])?_0x26408b:undefined;})[_0xddc9('0x74')]()['value']();if(!_[_0xddc9('0x75')](_0xabcad3)){_0xabcad3[_0xddc9('0x31')](function(_0x5a7100){if(_0x5a7100===_0xddc9('0x76')){_0x290514[_0xddc9('0x77')](_0xddc9('0x78'),[][_0xddc9('0x79')](_0x3e73ed[_0xddc9('0x39')][_0x5a7100]));}else if(_0x5a7100===_0xddc9('0x7a')){var _0x5e4452=JSON[_0xddc9('0x7b')](_0x3e73ed[_0xddc9('0x39')][_0x5a7100])[_0xddc9('0x7c')];var _0x8318e7=JSON[_0xddc9('0x7b')](_0x3e73ed[_0xddc9('0x39')][_0x5a7100])['$lte'];_0x290514[_0xddc9('0x77')](_0xddc9('0x7d'),_0x5e4452,_0x8318e7);}else{if(_0x3e73ed[_0xddc9('0x39')][_0x5a7100]===_0xddc9('0x7e')){_0x290514[_0xddc9('0x77')]('i.'+_0x5a7100+'\x20IS\x20NULL');}else{_0x290514[_0xddc9('0x77')]('i.'+_0x5a7100+_0xddc9('0x7f'),_0x3e73ed[_0xddc9('0x39')][_0x5a7100]);}}});}if(_0x3e73ed[_0xddc9('0x39')]['read']){if(_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x80')]==0x1){_0x290514[_0xddc9('0x5d')](_0xddc9('0x81'));}else{_0x290514[_0xddc9('0x5d')](_0xddc9('0x82'));}}if(_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x83')]){_0x328505=_[_0xddc9('0x84')](_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x83')])?_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x83')]:new Array(_0x3e73ed['query'][_0xddc9('0x83')]);_0x328505[_0xddc9('0x31')](function(_0x931c8c){_0x5c4cef['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x931c8c+',%');});}if(_0x3e73ed['query']['filter']){var _0x3fc2d2=_0x3e73ed[_0xddc9('0x39')]['filter']['replace']('\x5c','\x5c\x5c')[_0xddc9('0x85')](/'/g,'\x27\x27');if(qs[_0xddc9('0x86')](_0x3fc2d2)){_0x1a9f4f['or'](_0xddc9('0x87'),_0x3fc2d2+'%')['or'](_0xddc9('0x88'),_0x3fc2d2+'%');}else{_0x1a9f4f['or'](_0xddc9('0x89'),qs[_0xddc9('0x65')](_0x3fc2d2))['or'](_0xddc9('0x8a'),_0x3fc2d2+'%');}}}_0x290514[_0xddc9('0x77')](_0x1a9f4f);_0x290514['group'](_0xddc9('0x8b'));var _0x2d9730={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x493837=_0x290514[_0xddc9('0x8c')]();_0x493837['field'](_0xddc9('0x8b'));_0x493837[_0xddc9('0x45')](_0xddc9('0x8d'),_0xddc9('0x5c'));if(_0x4f82de[_0xddc9('0x42')]){_0x4f82de[_0xddc9('0x42')][_0xddc9('0x31')](function(_0x1fddfe){var _0x4c6a3a=_0x1fddfe[0x0]===_0xddc9('0x8e')?_0x1fddfe[0x0]:'i.'+_0x1fddfe[0x0];_0x290514['order'](_0x4c6a3a,_0x1fddfe[0x1]===_0xddc9('0x8f')?![]:!![]);});}if(!_[_0xddc9('0x75')](_0x328505)){_0x290514[_0xddc9('0x5d')](_0x5c4cef);_0x493837[_0xddc9('0x77')](_0xddc9('0x90'),_0x328505);}BPromise['resolve']()[_0xddc9('0x24')](function(){if(!_0x50e8c6){if(_0x3e73ed[_0xddc9('0x39')]['SmsAccountId'])return;_0x493837[_0xddc9('0x77')](_0xddc9('0x91'));_0x290514[_0xddc9('0x77')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3e73ed[_0xddc9('0x92')][_0xddc9('0x93')]!==_0xddc9('0x94'))return;return _0x3e73ed[_0xddc9('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xddc9('0x24')](function(_0x5c57a7){if(_[_0xddc9('0x75')](_0x5c57a7)){_0x493837['where'](_0xddc9('0x95'));_0x290514[_0xddc9('0x77')](_0xddc9('0x95'));}else{_0x493837[_0xddc9('0x77')](_0xddc9('0x78'),_[_0xddc9('0x2d')](_0x5c57a7,'id'));_0x290514[_0xddc9('0x77')]('i.SmsAccountId\x20IN\x20?',_[_0xddc9('0x2d')](_0x5c57a7,'id'));}});})[_0xddc9('0x24')](function(){if(_0x3e73ed['user'][_0xddc9('0x93')]===_0xddc9('0x94')&&!_0x50e8c6&&!_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x76')])return[];return db[_0xddc9('0x96')][_0xddc9('0x39')](_0x493837[_0xddc9('0x97')](),_0x2d9730);})[_0xddc9('0x24')](function(_0x57e7e2){_0x5ffcaf['count']=_0x57e7e2[_0xddc9('0x3f')];if(_0x5ffcaf[_0xddc9('0x1d')]===0x0)return[];return db[_0xddc9('0x96')][_0xddc9('0x39')](_0x3f214a[_0xddc9('0x97')](),_0x2d9730)[_0xddc9('0x24')](function(_0x363ca3){_0x5566ab=_[_0xddc9('0x98')](_0x363ca3,'id');_0x2d9730=_[_0xddc9('0x99')](_0x2d9730,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e73ed[_0xddc9('0x39')]['fields']){_0x4f82de[_0xddc9('0x3c')]['forEach'](function(_0x25b091){_0x290514[_0xddc9('0x45')]('i.'+_0x25b091);});}else{_0x290514[_0xddc9('0x45')](_0xddc9('0x8d'),_0xddc9('0x5c'));_0x290514['field'](_0xddc9('0x9a'),'Account.key');_0x290514[_0xddc9('0x45')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x290514[_0xddc9('0x45')](_0xddc9('0x9b'),'contactName');_0x290514['field'](_0xddc9('0x9c'));_0x290514[_0xddc9('0x45')]('c.firstName',_0xddc9('0x9d'));_0x290514[_0xddc9('0x45')](_0xddc9('0x9e'),_0xddc9('0x9f'));_0x290514[_0xddc9('0x45')]('c.email',_0xddc9('0xa0'));_0x290514[_0xddc9('0x45')]('c.phone',_0xddc9('0xa1'));_0x290514[_0xddc9('0x45')](_0xddc9('0xa2'),'Contact.mobile');_0x290514[_0xddc9('0x45')]('c.fax',_0xddc9('0xa3'));_0x290514[_0xddc9('0x45')](_0xddc9('0xa4'),'Owner.fullname');_0x290514[_0xddc9('0x45')](_0xddc9('0xa5'),_0xddc9('0xa6'));_0x290514[_0xddc9('0x45')](_0xddc9('0xa7'),_0xddc9('0x2f'));}if(_0x4f82de[_0xddc9('0x1c')])_0x290514[_0xddc9('0x1c')](_0x4f82de[_0xddc9('0x1c')]);if(_0x4f82de[_0xddc9('0x1a')])_0x290514['offset'](_0x4f82de[_0xddc9('0x1a')]);return db[_0xddc9('0x96')][_0xddc9('0x39')](_0x290514[_0xddc9('0x97')](),_0x2d9730);})[_0xddc9('0x24')](function(_0x3c4c9a){if(_0x3c4c9a['length']>0x0)_0x3e7e24[_0xddc9('0x77')](_0xddc9('0xa8'),_[_0xddc9('0x2d')](_0x3c4c9a,'id'));return db['sequelize']['query'](_0x3e7e24['toString'](),_0x2d9730)['then'](function(_0x136d75){var _0x566f88=_[_0xddc9('0xa9')](_0x136d75,_0xddc9('0xaa'));var _0x177c5e=[];_0x3c4c9a[_0xddc9('0x31')](function(_0x186824){_0x177c5e[_0xddc9('0xab')](updateSmsInteraction(_0x186824,_0x5566ab,_0x566f88));});return BPromise[_0xddc9('0xac')](_0x177c5e);});});})[_0xddc9('0x24')](function(_0x215fd3){_0x5ffcaf['rows']=_0x215fd3;return _0x5ffcaf;})[_0xddc9('0x24')](respondWithFilteredResult(_0x118066,_0x4f82de))[_0xddc9('0x33')](handleError(_0x118066,null));};exports[_0xddc9('0xad')]=function(_0x4484ac,_0x5129c6){var _0x3ef836={'raw':![],'where':{'id':_0x4484ac[_0xddc9('0xae')]['id']}},_0x5b7a55={};_0x5b7a55['model']=_['keys'](db['SmsInteraction'][_0xddc9('0x36')]);_0x5b7a55[_0xddc9('0x39')]=_['keys'](_0x4484ac['query']);_0x5b7a55[_0xddc9('0x3b')]=_['intersection'](_0x5b7a55[_0xddc9('0x38')],_0x5b7a55['query']);_0x3ef836[_0xddc9('0x3c')]=_[_0xddc9('0x3d')](_0x5b7a55[_0xddc9('0x38')],qs[_0xddc9('0x3e')](_0x4484ac[_0xddc9('0x39')][_0xddc9('0x3e')]));_0x3ef836[_0xddc9('0x3c')]=_0x3ef836[_0xddc9('0x3c')][_0xddc9('0x3f')]?_0x3ef836[_0xddc9('0x3c')]:_0x5b7a55[_0xddc9('0x38')];if(_0x4484ac[_0xddc9('0x39')]['includeAll']){_0x3ef836['include']=[{'all':!![]}];}_0x3ef836=_[_0xddc9('0x99')]({},_0x3ef836,_0x4484ac[_0xddc9('0xaf')]);return db['SmsInteraction'][_0xddc9('0x5b')](_0x3ef836)[_0xddc9('0x24')](handleEntityNotFound(_0x5129c6,null))[_0xddc9('0x24')](respondWithResult(_0x5129c6,null))[_0xddc9('0x33')](handleError(_0x5129c6,null));};exports[_0xddc9('0xb0')]=function(_0x52ecbe,_0xf22281){return db[_0xddc9('0x35')][_0xddc9('0xb0')](_0x52ecbe[_0xddc9('0x72')],{})[_0xddc9('0x24')](respondWithResult(_0xf22281,0xc9))[_0xddc9('0x33')](handleError(_0xf22281,null));};exports[_0xddc9('0x23')]=function(_0x32ade1,_0x4458ab){if(_0x32ade1[_0xddc9('0x72')]['id']){delete _0x32ade1['body']['id'];}return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x32ade1[_0xddc9('0xae')]['id']}})['then'](handleEntityNotFound(_0x4458ab,null))[_0xddc9('0x24')](saveUpdates(_0x32ade1['body'],null))[_0xddc9('0x24')](respondWithResult(_0x4458ab,null))[_0xddc9('0x33')](handleError(_0x4458ab,null));};exports[_0xddc9('0x25')]=function(_0x518639,_0x54b990){return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x518639[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x54b990,null))[_0xddc9('0x24')](removeEntity(_0x54b990,null))[_0xddc9('0x33')](handleError(_0x54b990,null));};exports[_0xddc9('0xb1')]=function(_0x3f6d88,_0x2d7a45){return db[_0xddc9('0x35')][_0xddc9('0xb1')]()['then'](respondWithResult(_0x2d7a45,null))['catch'](handleError(_0x2d7a45,null));};exports['addMessage']=function(_0x580f4f,_0x3dca50,_0x23abb6){return db[_0xddc9('0xb2')][_0xddc9('0x5b')]({'where':{'id':_0x580f4f[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x3dca50,null))[_0xddc9('0x24')](function(_0x4df8a8){if(_0x4df8a8){return _0x4df8a8[_0xddc9('0xb3')](_0x580f4f['body']['ids'],_[_0xddc9('0xb4')](_0x580f4f['body'],[_0xddc9('0xb5'),'id'])||{});}})[_0xddc9('0x24')](respondWithResult(_0x3dca50,null))[_0xddc9('0x33')](handleError(_0x3dca50,null));};exports['getMessages']=function(_0x8aede1,_0x2117d9,_0x533eb5){var _0x27f537={'raw':![],'where':{}};var _0x5d4421={};var _0x34558d={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xddc9('0xb6')]({'where':{'id':_0x8aede1[_0xddc9('0xae')]['id']}})['then'](handleEntityNotFound(_0x2117d9,null))[_0xddc9('0x24')](function(_0x4545b4){if(_0x4545b4){_0x5d4421[_0xddc9('0x38')]=_[_0xddc9('0x3a')](db['SmsMessage'][_0xddc9('0x36')]);_0x5d4421['query']=_[_0xddc9('0x3a')](_0x8aede1[_0xddc9('0x39')]);_0x5d4421[_0xddc9('0x3b')]=_[_0xddc9('0x3d')](_0x5d4421[_0xddc9('0x38')],_0x5d4421[_0xddc9('0x39')]);_0x27f537['attributes']=_[_0xddc9('0x3d')](_0x5d4421[_0xddc9('0x38')],qs[_0xddc9('0x3e')](_0x8aede1['query'][_0xddc9('0x3e')]));_0x27f537['attributes']=_0x27f537[_0xddc9('0x3c')]['length']?_0x27f537[_0xddc9('0x3c')]:_0x5d4421[_0xddc9('0x38')];if(!_0x8aede1['query'][_0xddc9('0x40')](_0xddc9('0x41'))){_0x27f537['limit']=qs[_0xddc9('0x1c')](_0x8aede1[_0xddc9('0x39')][_0xddc9('0x1c')]);_0x27f537[_0xddc9('0x1a')]=qs[_0xddc9('0x1a')](_0x8aede1[_0xddc9('0x39')]['offset']);}_0x27f537[_0xddc9('0x42')]=qs[_0xddc9('0x43')](_0x8aede1[_0xddc9('0x39')][_0xddc9('0x43')]);_0x27f537[_0xddc9('0x77')]=qs[_0xddc9('0x3b')](_[_0xddc9('0x44')](_0x8aede1['query'],_0x5d4421[_0xddc9('0x3b')]));_0x27f537[_0xddc9('0x77')]['SmsInteractionId']=_0x4545b4['id'];if(_0x8aede1['query']['filter']){_0x27f537[_0xddc9('0x77')]=_[_0xddc9('0x99')](_0x27f537['where'],{'$or':_[_0xddc9('0x2d')](_0x27f537['attributes'],function(_0x48644f){var _0x2e4a5c={};_0x2e4a5c[_0x48644f]={'$like':'%'+_0x8aede1['query'][_0xddc9('0xb7')]+'%'};return _0x2e4a5c;})});}if(_0x8aede1[_0xddc9('0x39')][_0xddc9('0x7c')]){var _0x1b6b9f=_0x8aede1[_0xddc9('0x39')][_0xddc9('0x7c')][_0xddc9('0x30')](',');var _0x13a689={};_0x13a689[_0x1b6b9f[0x0]]={'$gte':moment(_0x1b6b9f[0x1])[_0xddc9('0xb8')](_0xddc9('0xb9'))};_0x27f537[_0xddc9('0x77')]=_[_0xddc9('0x99')](_0x27f537[_0xddc9('0x77')],_0x13a689);}_0x27f537=_['merge']({},_0x27f537,_0x8aede1[_0xddc9('0xaf')]);return db[_0xddc9('0xb2')][_0xddc9('0x1d')]({'where':_0x27f537[_0xddc9('0x77')]})[_0xddc9('0x24')](function(_0x2b2612){_0x34558d['count']=_0x2b2612;if(_0x8aede1['query'][_0xddc9('0xba')]){_0x27f537['include']=[{'all':!![]}];}return db[_0xddc9('0xb2')]['findAll'](_0x27f537);})[_0xddc9('0x24')](function(_0x200bba){_0x34558d['rows']=_0x200bba;return _0x34558d;});}})[_0xddc9('0x24')](respondWithFilteredResult(_0x2117d9,_0x27f537))[_0xddc9('0x33')](handleError(_0x2117d9,null));};exports['addTags']=function(_0x3f1e15,_0x11241e,_0x1371fb){return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x3f1e15[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x11241e,null))[_0xddc9('0x24')](function(_0x3cdebf){if(_0x3cdebf){return _0x3cdebf[_0xddc9('0xbb')](_0x3f1e15[_0xddc9('0x72')][_0xddc9('0xb5')],_[_0xddc9('0xb4')](_0x3f1e15[_0xddc9('0x72')],[_0xddc9('0xb5'),'id'])||{})[_0xddc9('0xbc')](function(){return db[_0xddc9('0x6c')][_0xddc9('0xbd')]({'attributes':['id','name',_0xddc9('0xbe')],'where':{'id':_0x3f1e15[_0xddc9('0x72')][_0xddc9('0xb5')]}});})['then'](function(_0x1e28d0){socket[_0xddc9('0xbf')](_0xddc9('0xc0'),{'id':Number(_0x3f1e15['params']['id']),'tags':_0x1e28d0||[]});return{'id':Number(_0x3f1e15[_0xddc9('0xae')]['id']),'tags':_0x1e28d0||[]};});}})['then'](respondWithResult(_0x11241e,null))[_0xddc9('0x33')](handleError(_0x11241e,null));};exports[_0xddc9('0xc1')]=function(_0x29b1e4,_0x51d628,_0x1802c6){return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x29b1e4[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x51d628,null))[_0xddc9('0x24')](function(_0x5bf33a){if(_0x5bf33a){return _0x5bf33a[_0xddc9('0xc1')](_0x29b1e4[_0xddc9('0x39')][_0xddc9('0xb5')]);}})[_0xddc9('0x24')](respondWithStatusCode(_0x51d628,null))[_0xddc9('0x33')](handleError(_0x51d628,null));};exports['download']=function(_0xf03c7c,_0x5995bb){var _0x3e7505=moment()[_0xddc9('0xc2')]()['toString']();var _0x2d8196=path[_0xddc9('0xc3')](config[_0xddc9('0xc4')],_0xddc9('0xc5'),_0xddc9('0xc6'),_0xddc9('0xc7'));var _0x52d8b4=path[_0xddc9('0xc3')](config[_0xddc9('0xc4')],'server',_0xddc9('0xc6'),'attachments');var _0x2c3494=path[_0xddc9('0xc3')](_0x2d8196,_0x3e7505);var _0x5dbfa7=util[_0xddc9('0xb8')]('transcript-%d-%s.zip',_0xf03c7c[_0xddc9('0xae')]['id'],_0x3e7505);var _0x12a867=path[_0xddc9('0xc3')](_0x2d8196,_0x5dbfa7);var _0x2ca08e=[];_0x2ca08e[_0xddc9('0xab')]({'model':db[_0xddc9('0x6f')],'as':'User','attributes':['id',_0xddc9('0x2e')],'raw':!![]});_0x2ca08e['push']({'model':db[_0xddc9('0xc8')],'as':'Contact','attributes':['id',_0xddc9('0xc9'),_0xddc9('0xca')],'raw':!![]});var _0x2bac27=[{'model':db[_0xddc9('0xb2')],'as':_0xddc9('0xcb'),'attributes':['id',_0xddc9('0x72'),_0xddc9('0x7a'),_0xddc9('0xcc'),_0xddc9('0xcd'),_0xddc9('0x80')],'include':_0x2ca08e}];_0x2bac27[_0xddc9('0xab')]({'model':db[_0xddc9('0xce')],'as':_0xddc9('0xcf'),'attributes':['id',_0xddc9('0x2a')]});_0x2bac27[_0xddc9('0xab')]({'model':db[_0xddc9('0x6f')],'as':_0xddc9('0xd0'),'attributes':['id',_0xddc9('0x2e')]});return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0xf03c7c['params']['id']},'include':_0x2bac27})[_0xddc9('0x24')](handleEntityNotFound(_0x5995bb,null))[_0xddc9('0x24')](function(_0xef1456){if(_0xef1456){var _0x5e8abb=_0xef1456[_0xddc9('0xd1')]({'plain':!![]});fs['mkdirSync'](_0x2c3494);var _0x74c951={'channel':_0xddc9('0xd2'),'account':_0x5e8abb[_0xddc9('0xcf')][_0xddc9('0x2a')],'agent':_0x5e8abb[_0xddc9('0xd0')]?_0x5e8abb['Owner'][_0xddc9('0x2e')]:_0xddc9('0xd3'),'createdAt':moment(_0x5e8abb[_0xddc9('0x7a')])[_0xddc9('0xb8')](_0xddc9('0xb9'))[_0xddc9('0x97')](),'closedAt':_0x5e8abb[_0xddc9('0xd4')]?moment(_0x5e8abb[_0xddc9('0xd5')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xddc9('0x97')]():'','disposition':_0x5e8abb['disposition'],'messages':_(_0x5e8abb['Messages'])[_0xddc9('0xb7')]({'secret':![]})[_0xddc9('0x2d')](function(_0xfd502d){return{'date':moment(_0xfd502d[_0xddc9('0x7a')])['format'](_0xddc9('0xb9'))[_0xddc9('0x97')](),'sender':_0xfd502d['direction']==='out'?_0xfd502d[_0xddc9('0x6f')]?_0xfd502d['User'][_0xddc9('0x2e')]:_0xddc9('0xd6'):_0xfd502d[_0xddc9('0x60')][_0xddc9('0xc9')]+(_0xfd502d[_0xddc9('0x60')][_0xddc9('0xca')]?'\x20'+_0xfd502d['Contact'][_0xddc9('0xca')]:''),'body':_0xfd502d[_0xddc9('0x72')],'direction':_0xfd502d[_0xddc9('0xcc')]===_0xddc9('0xd7')?'A':'C','secret':_0xfd502d['secret'],'read':_0xfd502d[_0xddc9('0x80')]};})['value']()};return ejs[_0xddc9('0xd8')](path[_0xddc9('0xc3')](config['root'],_0xddc9('0xc5'),_0xddc9('0xd9'),'downloadInteraction.ejs'),{'interaction':_0x74c951})['then'](function(_0x104b7e){var _0x8a3203=path[_0xddc9('0xc3')](_0x2c3494,'transcript-'+_0x5e8abb['id']+'-'+_0x3e7505+_0xddc9('0xda'));var _0x67ce6b={'path':_0x8a3203,'channel':'Sms','interactionId':_0x5e8abb['id']};return pdf['createPdfFromHTML'](_0x104b7e,_0x67ce6b);})[_0xddc9('0x24')](function(){return new BPromise(function(_0x1d6225,_0x460f2a){zipdir(_0x2c3494,{'saveTo':_0x12a867},function(_0x398656,_0x261b88){if(_0x398656)return _0x460f2a(_0x398656);return _0x1d6225(_0x261b88);});})[_0xddc9('0x24')](function(){return new BPromise(function(_0x378cf8,_0x5acf12){rimraf(_0x2c3494,function(_0x222774){if(_0x222774)_0x5acf12(_0x222774);return _0x378cf8();});});})['then'](function(){return _0x5995bb[_0xddc9('0xdb')](_0x12a867,_0x5dbfa7,function(_0x528e95){if(_0x528e95){console[_0xddc9('0xdc')]('err',_0x528e95);}else{fs['unlinkSync'](_0x12a867);}});});});}else{return _0x5995bb[_0xddc9('0x27')](0xc8);}})['catch'](handleError(_0x5995bb,null));}; \ No newline at end of file +var _0x20a9=['$substring','UserId','body','keys','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','agent','sequelize','toString','keyBy','merge','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','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','create','update','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','SmsAccount','Owner','get','mkdirSync','Sms','N.A.','closed','closedAt','Messages','direction','out','secret','server','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','eml-format','rimraf','zip-dir','bluebird','mustache','path','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','name','map','fullname','TagIds','Tags','split','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User'];(function(_0x985128,_0x291e5c){var _0x3eea66=function(_0xa9a27c){while(--_0xa9a27c){_0x985128['push'](_0x985128['shift']());}};_0x3eea66(++_0x291e5c);}(_0x20a9,0x14f));var _0x920a=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0x20a9[_0x83af7f];return _0x32d85c;};'use strict';var emlformat=require(_0x920a('0x0'));var rimraf=require(_0x920a('0x1'));var zipdir=require(_0x920a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x920a('0x3'));var Mustache=require(_0x920a('0x4'));var util=require('util');var path=require(_0x920a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x920a('0x6'));var squel=require(_0x920a('0x7'));var crypto=require(_0x920a('0x8'));var jsforce=require(_0x920a('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x920a('0xa'));var Papa=require(_0x920a('0xb'));var Redis=require(_0x920a('0xc'));var authService=require(_0x920a('0xd'));var qs=require(_0x920a('0xe'));var as=require(_0x920a('0xf'));var pdf=require(_0x920a('0x10'));var hardwareService=require(_0x920a('0x11'));var logger=require(_0x920a('0x12'))(_0x920a('0x13'));var utils=require('../../config/utils');var config=require(_0x920a('0x14'));var licenseUtil=require(_0x920a('0x15'));var db=require(_0x920a('0x16'))['db'];config['redis']=_[_0x920a('0x17')](config[_0x920a('0x18')],{'host':_0x920a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x920a('0x18')]));require(_0x920a('0x1a'))['register'](socket);function respondWithStatusCode(_0x2c41dc,_0xe80977){_0xe80977=_0xe80977||0xcc;return function(_0xdea551){if(_0xdea551){return _0x2c41dc[_0x920a('0x1b')](_0xe80977);}return _0x2c41dc['status'](_0xe80977)[_0x920a('0x1c')]();};}function respondWithResult(_0x164144,_0x20fa18){_0x20fa18=_0x20fa18||0xc8;return function(_0x322486){if(_0x322486){return _0x164144[_0x920a('0x1d')](_0x20fa18)[_0x920a('0x1e')](_0x322486);}};}function respondWithFilteredResult(_0x3af673,_0x1bfff8){return function(_0x27eccc){if(_0x27eccc){var _0x1fbd56=typeof _0x1bfff8[_0x920a('0x1f')]===_0x920a('0x20')&&typeof _0x1bfff8[_0x920a('0x21')]===_0x920a('0x20');var _0x3776c7=_0x27eccc[_0x920a('0x22')];var _0x480f18=_0x1fbd56?0x0:_0x1bfff8['offset'];var _0x2d0785=_0x1fbd56?_0x27eccc[_0x920a('0x22')]:_0x1bfff8['offset']+_0x1bfff8[_0x920a('0x21')];var _0x44cfdd;if(_0x2d0785>=_0x3776c7){_0x2d0785=_0x3776c7;_0x44cfdd=0xc8;}else{_0x44cfdd=0xce;}_0x3af673['status'](_0x44cfdd);return _0x3af673['set'](_0x920a('0x23'),_0x480f18+'-'+_0x2d0785+'/'+_0x3776c7)[_0x920a('0x1e')](_0x27eccc);}return null;};}function patchUpdates(_0xa9e24e){return function(_0x2d0c4d){try{jsonpatch['apply'](_0x2d0c4d,_0xa9e24e,!![]);}catch(_0x5e17fd){return BPromise['reject'](_0x5e17fd);}return _0x2d0c4d[_0x920a('0x24')]();};}function saveUpdates(_0x3aab33,_0x31c234){return function(_0x2a652e){if(_0x2a652e){return _0x2a652e['update'](_0x3aab33)[_0x920a('0x25')](function(_0x385993){return _0x385993;});}return null;};}function removeEntity(_0x5aed35,_0x2c33ac){return function(_0x17d562){if(_0x17d562){return _0x17d562[_0x920a('0x26')]()['then'](function(){_0x5aed35[_0x920a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50eb92,_0x464c25){return function(_0x37c08f){if(!_0x37c08f){_0x50eb92[_0x920a('0x1b')](0x194);}return _0x37c08f;};}function handleError(_0x3269e3,_0x17f979){_0x17f979=_0x17f979||0x1f4;return function(_0x401a0c){logger['error'](_0x401a0c['stack']);if(_0x401a0c[_0x920a('0x27')]){delete _0x401a0c[_0x920a('0x27')];}_0x3269e3['status'](_0x17f979)['send'](_0x401a0c);};}function getInteractionUsers(_0x27ace9,_0x9dfa8c){return new BPromise(function(_0x4af035,_0x28295f){try{if(_0x9dfa8c[_0x27ace9['id']]){_0x27ace9['Users']=_[_0x920a('0x28')](_0x9dfa8c[_0x27ace9['id']],function(_0x3cc992){return{'id':_0x3cc992['id'],'fullname':_0x3cc992[_0x920a('0x29')]};});}}catch(_0x13e227){_0x28295f(_0x13e227);}_0x4af035(_0x27ace9);});}function getInteractionTags(_0x96790e,_0x3b89a6){return new BPromise(function(_0x3bc653,_0x18af6c){try{if(_0x96790e[_0x920a('0x2a')]){_0x96790e[_0x920a('0x2b')]=[];_0x96790e[_0x920a('0x2a')][_0x920a('0x2c')](',')['forEach'](function(_0x1a890b){_0x96790e['Tags'][_0x920a('0x2d')](_0x3b89a6[_0x1a890b]);});}delete _0x96790e['TagIds'];}catch(_0x5975e1){_0x18af6c(_0x5975e1);}_0x3bc653(_0x96790e);});}function updateSmsInteraction(_0x5bfcae,_0x2b10c0,_0x392e16){return new BPromise(function(_0x2da920,_0x4f0057){return getInteractionUsers(_0x5bfcae,_0x392e16)[_0x920a('0x25')](function(_0x3d1eaa){return getInteractionTags(_0x3d1eaa,_0x2b10c0);})[_0x920a('0x25')](function(_0x3dbf04){_0x2da920(_0x3dbf04);})[_0x920a('0x2e')](function(_0x3d140e){_0x4f0057(_0x3d140e);});});}exports[_0x920a('0x2f')]=function(_0xc80e8d,_0x197cb7){var _0x18775c={},_0x10a955={},_0x405044={'count':0x0,'rows':[]};var _0x4183a=_['map'](db[_0x920a('0x30')][_0x920a('0x31')],function(_0xb7ffdb){return{'name':_0xb7ffdb[_0x920a('0x32')],'type':_0xb7ffdb[_0x920a('0x33')][_0x920a('0x34')]};});_0x10a955['model']=_[_0x920a('0x28')](_0x4183a,_0x920a('0x27'));_0x10a955[_0x920a('0x35')]=_['keys'](_0xc80e8d[_0x920a('0x35')]);_0x10a955[_0x920a('0x36')]=_[_0x920a('0x37')](_0x10a955[_0x920a('0x38')],_0x10a955[_0x920a('0x35')]);_0x18775c['attributes']=_[_0x920a('0x37')](_0x10a955[_0x920a('0x38')],qs['fields'](_0xc80e8d[_0x920a('0x35')][_0x920a('0x39')]));_0x18775c[_0x920a('0x3a')]=_0x18775c[_0x920a('0x3a')][_0x920a('0x3b')]?_0x18775c[_0x920a('0x3a')]:_0x10a955['model'];if(!_0xc80e8d[_0x920a('0x35')][_0x920a('0x3c')]('nolimit')){_0x18775c['limit']=qs[_0x920a('0x21')](_0xc80e8d[_0x920a('0x35')][_0x920a('0x21')]);_0x18775c[_0x920a('0x1f')]=qs[_0x920a('0x1f')](_0xc80e8d[_0x920a('0x35')][_0x920a('0x1f')]);}_0x18775c[_0x920a('0x3d')]=qs[_0x920a('0x3e')](_0xc80e8d[_0x920a('0x35')][_0x920a('0x3e')]);_0x18775c[_0x920a('0x3f')]=qs[_0x920a('0x36')](_[_0x920a('0x40')](_0xc80e8d['query'],_0x10a955[_0x920a('0x36')]),_0x4183a);var _0x280ef4=[];var _0x4dce77=squel[_0x920a('0x41')]()[_0x920a('0x42')]('id')[_0x920a('0x42')]('name')[_0x920a('0x42')](_0x920a('0x43'))[_0x920a('0x44')](_0x920a('0x45'));var _0x47411d=squel[_0x920a('0x41')]()[_0x920a('0x42')]('u.id')[_0x920a('0x42')](_0x920a('0x46'))['field']('ui.SmsInteractionId')['from'](_0x920a('0x47'),'ui')[_0x920a('0x48')](_0x920a('0x49'),'u',_0x920a('0x4a'));var _0x4cc9a2=squel[_0x920a('0x41')]()['from']('sms_interactions','i')['left_join']('cm_contacts','c',_0x920a('0x4b'))[_0x920a('0x48')](_0x920a('0x49'),'o',_0x920a('0x4c'))[_0x920a('0x48')]('sms_accounts','a',_0x920a('0x4d'))[_0x920a('0x48')]('sms_messages','me',_0x920a('0x4e'))['left_join'](_0x920a('0x4f'),'it',_0x920a('0x50'))[_0x920a('0x48')](_0x920a('0x45'),'t',_0x920a('0x51'));var _0x479e64=squel[_0x920a('0x52')]();var _0x45974c=[];var _0x1c0344=squel[_0x920a('0x52')]();var _0x4c5a5f;if(_0xc80e8d[_0x920a('0x35')][_0x920a('0x53')]){_0x4c5a5f=as[_0x920a('0x54')](_0xc80e8d[_0x920a('0x35')]['search']);var _0x2db9c0=_0x4c5a5f['sqlOperator'];for(var _0x45ba99=0x0;_0x45ba99<_0x4c5a5f[_0x920a('0x55')][_0x920a('0x3b')];_0x45ba99++){var _0x50dd38=_0x4c5a5f[_0x920a('0x55')][_0x45ba99];var _0x197022='i';var _0x266d17=_['find'](_0x4183a,[_0x920a('0x27'),_0x50dd38[_0x920a('0x42')]]);if(!_0x266d17){switch(_0x50dd38['field']){case'unreadMessages':if(_0x50dd38[_0x920a('0x56')]==0x1){_0x4cc9a2[_0x920a('0x57')]('`'+_0x50dd38[_0x920a('0x42')]+_0x920a('0x58'));}else{_0x4cc9a2[_0x920a('0x57')]('`'+_0x50dd38[_0x920a('0x42')]+'`\x20>\x200');}break;case _0x920a('0x59'):if(_0x50dd38[_0x920a('0x5a')]==='$substring'){if(_0x50dd38[_0x920a('0x56')][_0x920a('0x2c')]('\x20')[_0x920a('0x3b')]>0x1){_0x479e64[_0x2db9c0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x920a('0x5b')](_0x50dd38['value']),null);}else{var _0x270951='%'+_0x50dd38[_0x920a('0x56')]+'%';_0x479e64[_0x2db9c0](_0x920a('0x5c'),_0x270951,_0x270951,_0x270951);}}else{_0x266d17=_[_0x920a('0x5d')](_0x4183a,['name',_0x920a('0x5e')]);_0x50dd38[_0x920a('0x42')]=_0x920a('0x5e');_0x43ce9c=as[_0x920a('0x5f')](_0x197022,_0x266d17['type'],_0x50dd38);_0x479e64[_0x2db9c0](_0x43ce9c[_0x920a('0x60')],_0x43ce9c[_0x920a('0x56')][_0x920a('0x61')],_0x43ce9c[_0x920a('0x56')][_0x920a('0x1c')]);}break;case _0x920a('0x62'):var _0x48cb3b=_0x50dd38[_0x920a('0x56')][_0x920a('0x2c')](',')[_0x920a('0x28')](function(_0x391de3){return Number(_0x391de3);});_0x48cb3b[_0x920a('0x63')](function(_0x57190e){_0x1c0344['or'](_0x920a('0x64'),'%,'+_0x57190e+',%');});_0x45974c=_[_0x920a('0x65')](_0x45974c,_0x48cb3b);break;case _0x920a('0x66'):if(_0x50dd38['operator']===_0x920a('0x67')){_0x479e64[_0x2db9c0]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x50dd38[_0x920a('0x56')]+'%',null);}else{_0x266d17=_[_0x920a('0x5d')](_0x4183a,[_0x920a('0x27'),_0x920a('0x68')]);_0x50dd38['field']=_0x920a('0x68');_0x43ce9c=as['buildExpression'](_0x197022,_0x266d17[_0x920a('0x33')],_0x50dd38);_0x479e64[_0x2db9c0](_0x43ce9c[_0x920a('0x60')],_0x43ce9c[_0x920a('0x56')][_0x920a('0x61')],_0x43ce9c[_0x920a('0x56')][_0x920a('0x1c')]);}break;case _0x920a('0x69'):_0x43ce9c=as[_0x920a('0x5f')]('me',null,_0x50dd38);_0x479e64[_0x2db9c0](_0x43ce9c[_0x920a('0x60')],_0x43ce9c[_0x920a('0x56')][_0x920a('0x61')],_0x43ce9c[_0x920a('0x56')][_0x920a('0x1c')]);break;}}else{var _0x43ce9c=as[_0x920a('0x5f')](_0x197022,_0x266d17[_0x920a('0x33')],_0x50dd38);_0x479e64[_0x2db9c0](_0x43ce9c[_0x920a('0x60')],_0x43ce9c[_0x920a('0x56')]['start'],_0x43ce9c[_0x920a('0x56')][_0x920a('0x1c')]);}}}else{var _0x25d14c=_(_0xc80e8d[_0x920a('0x35')])[_0x920a('0x6a')]()['map'](function(_0xb697a5){return _['some'](_0x4183a,[_0x920a('0x27'),_0xb697a5])?_0xb697a5:undefined;})['compact']()['value']();if(!_[_0x920a('0x6b')](_0x25d14c)){_0x25d14c['forEach'](function(_0x2f7030){if(_0x2f7030===_0x920a('0x6c')){_0x4cc9a2[_0x920a('0x3f')](_0x920a('0x6d'),[][_0x920a('0x6e')](_0xc80e8d[_0x920a('0x35')][_0x2f7030]));}else if(_0x2f7030===_0x920a('0x6f')){var _0x387958=JSON[_0x920a('0x70')](_0xc80e8d[_0x920a('0x35')][_0x2f7030])['$gte'];var _0x480486=JSON['parse'](_0xc80e8d[_0x920a('0x35')][_0x2f7030])[_0x920a('0x71')];_0x4cc9a2[_0x920a('0x3f')](_0x920a('0x72'),_0x387958,_0x480486);}else{if(_0xc80e8d[_0x920a('0x35')][_0x2f7030]==='null'){_0x4cc9a2[_0x920a('0x3f')]('i.'+_0x2f7030+_0x920a('0x73'));}else{_0x4cc9a2[_0x920a('0x3f')]('i.'+_0x2f7030+_0x920a('0x74'),_0xc80e8d['query'][_0x2f7030]);}}});}if(_0xc80e8d[_0x920a('0x35')][_0x920a('0x75')]){if(_0xc80e8d[_0x920a('0x35')][_0x920a('0x75')]==0x1){_0x4cc9a2[_0x920a('0x57')](_0x920a('0x76'));}else{_0x4cc9a2['having'](_0x920a('0x77'));}}if(_0xc80e8d['query']['tag']){_0x45974c=_['isArray'](_0xc80e8d['query'][_0x920a('0x78')])?_0xc80e8d[_0x920a('0x35')][_0x920a('0x78')]:new Array(_0xc80e8d[_0x920a('0x35')]['tag']);_0x45974c[_0x920a('0x63')](function(_0x26d5f2){_0x1c0344['or'](_0x920a('0x64'),'%,'+_0x26d5f2+',%');});}if(_0xc80e8d[_0x920a('0x35')][_0x920a('0x79')]){var _0x262ee8=_0xc80e8d[_0x920a('0x35')][_0x920a('0x79')][_0x920a('0x7a')]('\x5c','\x5c\x5c')[_0x920a('0x7a')](/'/g,'\x27\x27');if(qs[_0x920a('0x7b')](_0x262ee8)){_0x479e64['or']('i.id\x20LIKE\x20?',_0x262ee8+'%')['or'](_0x920a('0x7c'),_0x262ee8+'%');}else{_0x479e64['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x262ee8))['or'](_0x920a('0x7d'),_0x262ee8+'%');}}}_0x4cc9a2[_0x920a('0x3f')](_0x479e64);_0x4cc9a2[_0x920a('0x7e')](_0x920a('0x7f'));var _0x346692={'type':db['Sequelize'][_0x920a('0x80')]['SELECT'],'raw':!![]};var _0x246e10=_0x4cc9a2['clone']();_0x246e10[_0x920a('0x42')](_0x920a('0x7f'));_0x246e10['field'](_0x920a('0x81'),_0x920a('0x82'));if(_0x18775c['order']){_0x18775c['order'][_0x920a('0x63')](function(_0x109f63){var _0x1c3ad8=_0x109f63[0x0]===_0x920a('0x83')?_0x109f63[0x0]:'i.'+_0x109f63[0x0];_0x4cc9a2[_0x920a('0x3d')](_0x1c3ad8,_0x109f63[0x1]===_0x920a('0x84')?![]:!![]);});}if(!_['isEmpty'](_0x45974c)){_0x4cc9a2[_0x920a('0x57')](_0x1c0344);_0x246e10['where'](_0x920a('0x85'),_0x45974c);}BPromise['resolve']()['then'](function(){if(!_0x4c5a5f){if(_0xc80e8d[_0x920a('0x35')][_0x920a('0x6c')])return;_0x246e10['where'](_0x920a('0x86'));_0x4cc9a2[_0x920a('0x3f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xc80e8d[_0x920a('0x87')][_0x920a('0x88')]!=='agent')return;return _0xc80e8d[_0x920a('0x87')][_0x920a('0x89')]({'attributes':['id'],'raw':!![]})[_0x920a('0x25')](function(_0x433c3e){if(_[_0x920a('0x6b')](_0x433c3e)){_0x246e10[_0x920a('0x3f')]('i.SmsAccountId\x20IS\x20NULL');_0x4cc9a2[_0x920a('0x3f')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x246e10[_0x920a('0x3f')]('i.SmsAccountId\x20IN\x20?',_[_0x920a('0x28')](_0x433c3e,'id'));_0x4cc9a2['where'](_0x920a('0x6d'),_[_0x920a('0x28')](_0x433c3e,'id'));}});})[_0x920a('0x25')](function(){if(_0xc80e8d[_0x920a('0x87')][_0x920a('0x88')]===_0x920a('0x8a')&&!_0x4c5a5f&&!_0xc80e8d[_0x920a('0x35')][_0x920a('0x6c')])return[];return db[_0x920a('0x8b')][_0x920a('0x35')](_0x246e10[_0x920a('0x8c')](),_0x346692);})[_0x920a('0x25')](function(_0x378ac1){_0x405044[_0x920a('0x22')]=_0x378ac1[_0x920a('0x3b')];if(_0x405044[_0x920a('0x22')]===0x0)return[];return db['sequelize']['query'](_0x4dce77[_0x920a('0x8c')](),_0x346692)[_0x920a('0x25')](function(_0x1d609e){_0x280ef4=_[_0x920a('0x8d')](_0x1d609e,'id');_0x346692=_[_0x920a('0x8e')](_0x346692,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc80e8d['query'][_0x920a('0x39')]){_0x18775c[_0x920a('0x3a')][_0x920a('0x63')](function(_0x31202f){_0x4cc9a2[_0x920a('0x42')]('i.'+_0x31202f);});}else{_0x4cc9a2[_0x920a('0x42')](_0x920a('0x81'),'unreadMessages');_0x4cc9a2['field'](_0x920a('0x8f'),_0x920a('0x90'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x91'),_0x920a('0x92'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x93'),_0x920a('0x83'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x94'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x95'),'Contact.firstName');_0x4cc9a2[_0x920a('0x42')](_0x920a('0x96'),_0x920a('0x97'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x98'),'Contact.email');_0x4cc9a2[_0x920a('0x42')](_0x920a('0x99'),_0x920a('0x9a'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x9b'),_0x920a('0x9c'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x9d'),'Contact.fax');_0x4cc9a2[_0x920a('0x42')]('o.fullname',_0x920a('0x9e'));_0x4cc9a2[_0x920a('0x42')](_0x920a('0x9f'),_0x920a('0xa0'));_0x4cc9a2['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x920a('0x2a'));}if(_0x18775c[_0x920a('0x21')])_0x4cc9a2['limit'](_0x18775c[_0x920a('0x21')]);if(_0x18775c['offset'])_0x4cc9a2[_0x920a('0x1f')](_0x18775c[_0x920a('0x1f')]);return db['sequelize'][_0x920a('0x35')](_0x4cc9a2[_0x920a('0x8c')](),_0x346692);})['then'](function(_0x2628b3){if(_0x2628b3[_0x920a('0x3b')]>0x0)_0x47411d[_0x920a('0x3f')](_0x920a('0xa1'),_[_0x920a('0x28')](_0x2628b3,'id'));return db[_0x920a('0x8b')][_0x920a('0x35')](_0x47411d['toString'](),_0x346692)[_0x920a('0x25')](function(_0x43b403){var _0x25ed93=_[_0x920a('0xa2')](_0x43b403,_0x920a('0xa3'));var _0x41a24a=[];_0x2628b3[_0x920a('0x63')](function(_0x6f0cf8){_0x41a24a[_0x920a('0x2d')](updateSmsInteraction(_0x6f0cf8,_0x280ef4,_0x25ed93));});return BPromise[_0x920a('0xa4')](_0x41a24a);});});})['then'](function(_0x4a3320){_0x405044['rows']=_0x4a3320;return _0x405044;})[_0x920a('0x25')](respondWithFilteredResult(_0x197cb7,_0x18775c))['catch'](handleError(_0x197cb7,null));};exports[_0x920a('0xa5')]=function(_0x46fe70,_0x1ee8b7){var _0x5dca8a={'raw':![],'where':{'id':_0x46fe70[_0x920a('0xa6')]['id']}},_0x3cc12d={};_0x3cc12d[_0x920a('0x38')]=_[_0x920a('0x6a')](db[_0x920a('0x30')][_0x920a('0x31')]);_0x3cc12d[_0x920a('0x35')]=_[_0x920a('0x6a')](_0x46fe70[_0x920a('0x35')]);_0x3cc12d['filters']=_[_0x920a('0x37')](_0x3cc12d[_0x920a('0x38')],_0x3cc12d[_0x920a('0x35')]);_0x5dca8a['attributes']=_['intersection'](_0x3cc12d[_0x920a('0x38')],qs[_0x920a('0x39')](_0x46fe70[_0x920a('0x35')]['fields']));_0x5dca8a[_0x920a('0x3a')]=_0x5dca8a[_0x920a('0x3a')][_0x920a('0x3b')]?_0x5dca8a[_0x920a('0x3a')]:_0x3cc12d[_0x920a('0x38')];if(_0x46fe70[_0x920a('0x35')]['includeAll']){_0x5dca8a['include']=[{'all':!![]}];}_0x5dca8a=_[_0x920a('0x8e')]({},_0x5dca8a,_0x46fe70['options']);return db[_0x920a('0x30')][_0x920a('0x5d')](_0x5dca8a)[_0x920a('0x25')](handleEntityNotFound(_0x1ee8b7,null))[_0x920a('0x25')](respondWithResult(_0x1ee8b7,null))[_0x920a('0x2e')](handleError(_0x1ee8b7,null));};exports[_0x920a('0xa7')]=function(_0x370514,_0x744244){return db[_0x920a('0x30')]['create'](_0x370514[_0x920a('0x69')],{})[_0x920a('0x25')](respondWithResult(_0x744244,0xc9))[_0x920a('0x2e')](handleError(_0x744244,null));};exports[_0x920a('0xa8')]=function(_0x37907b,_0x555d99){if(_0x37907b[_0x920a('0x69')]['id']){delete _0x37907b[_0x920a('0x69')]['id'];}return db[_0x920a('0x30')][_0x920a('0x5d')]({'where':{'id':_0x37907b['params']['id']}})[_0x920a('0x25')](handleEntityNotFound(_0x555d99,null))[_0x920a('0x25')](saveUpdates(_0x37907b[_0x920a('0x69')],null))[_0x920a('0x25')](respondWithResult(_0x555d99,null))[_0x920a('0x2e')](handleError(_0x555d99,null));};exports['destroy']=function(_0x274427,_0xe4f280){return db[_0x920a('0x30')]['find']({'where':{'id':_0x274427['params']['id']}})[_0x920a('0x25')](handleEntityNotFound(_0xe4f280,null))[_0x920a('0x25')](removeEntity(_0xe4f280,null))['catch'](handleError(_0xe4f280,null));};exports[_0x920a('0xa9')]=function(_0x23baa0,_0x7105b9){return db[_0x920a('0x30')][_0x920a('0xa9')]()[_0x920a('0x25')](respondWithResult(_0x7105b9,null))[_0x920a('0x2e')](handleError(_0x7105b9,null));};exports['addMessage']=function(_0x3f668f,_0x252fcf,_0xa097ed){return db[_0x920a('0xaa')][_0x920a('0x5d')]({'where':{'id':_0x3f668f['params']['id']}})[_0x920a('0x25')](handleEntityNotFound(_0x252fcf,null))[_0x920a('0x25')](function(_0x4b7da1){if(_0x4b7da1){return _0x4b7da1[_0x920a('0xab')](_0x3f668f[_0x920a('0x69')][_0x920a('0xac')],_[_0x920a('0xad')](_0x3f668f[_0x920a('0x69')],[_0x920a('0xac'),'id'])||{});}})[_0x920a('0x25')](respondWithResult(_0x252fcf,null))[_0x920a('0x2e')](handleError(_0x252fcf,null));};exports[_0x920a('0xae')]=function(_0x3c91ff,_0x298764,_0x2f6e04){var _0x433b63={'raw':![],'where':{}};var _0x44f32e={};var _0x2ca47a={'count':0x0,'rows':[]};return db[_0x920a('0x30')][_0x920a('0xaf')]({'where':{'id':_0x3c91ff[_0x920a('0xa6')]['id']}})['then'](handleEntityNotFound(_0x298764,null))[_0x920a('0x25')](function(_0x583d12){if(_0x583d12){_0x44f32e['model']=_[_0x920a('0x6a')](db[_0x920a('0xaa')][_0x920a('0x31')]);_0x44f32e['query']=_[_0x920a('0x6a')](_0x3c91ff[_0x920a('0x35')]);_0x44f32e[_0x920a('0x36')]=_[_0x920a('0x37')](_0x44f32e[_0x920a('0x38')],_0x44f32e[_0x920a('0x35')]);_0x433b63[_0x920a('0x3a')]=_[_0x920a('0x37')](_0x44f32e[_0x920a('0x38')],qs[_0x920a('0x39')](_0x3c91ff[_0x920a('0x35')][_0x920a('0x39')]));_0x433b63['attributes']=_0x433b63[_0x920a('0x3a')]['length']?_0x433b63[_0x920a('0x3a')]:_0x44f32e[_0x920a('0x38')];if(!_0x3c91ff[_0x920a('0x35')][_0x920a('0x3c')](_0x920a('0xb0'))){_0x433b63[_0x920a('0x21')]=qs[_0x920a('0x21')](_0x3c91ff['query'][_0x920a('0x21')]);_0x433b63['offset']=qs[_0x920a('0x1f')](_0x3c91ff[_0x920a('0x35')][_0x920a('0x1f')]);}_0x433b63[_0x920a('0x3d')]=qs[_0x920a('0x3e')](_0x3c91ff[_0x920a('0x35')][_0x920a('0x3e')]);_0x433b63['where']=qs[_0x920a('0x36')](_[_0x920a('0x40')](_0x3c91ff[_0x920a('0x35')],_0x44f32e[_0x920a('0x36')]));_0x433b63[_0x920a('0x3f')][_0x920a('0xa3')]=_0x583d12['id'];if(_0x3c91ff['query'][_0x920a('0x79')]){_0x433b63['where']=_[_0x920a('0x8e')](_0x433b63[_0x920a('0x3f')],{'$or':_[_0x920a('0x28')](_0x433b63['attributes'],function(_0x47f6ae){var _0x559e1e={};_0x559e1e[_0x47f6ae]={'$like':'%'+_0x3c91ff[_0x920a('0x35')][_0x920a('0x79')]+'%'};return _0x559e1e;})});}if(_0x3c91ff[_0x920a('0x35')][_0x920a('0xb1')]){var _0x4d73bb=_0x3c91ff[_0x920a('0x35')][_0x920a('0xb1')]['split'](',');var _0x4e7952={};_0x4e7952[_0x4d73bb[0x0]]={'$gte':moment(_0x4d73bb[0x1])[_0x920a('0xb2')](_0x920a('0xb3'))};_0x433b63[_0x920a('0x3f')]=_['merge'](_0x433b63[_0x920a('0x3f')],_0x4e7952);}_0x433b63=_[_0x920a('0x8e')]({},_0x433b63,_0x3c91ff[_0x920a('0xb4')]);return db[_0x920a('0xaa')][_0x920a('0x22')]({'where':_0x433b63[_0x920a('0x3f')]})[_0x920a('0x25')](function(_0x513c50){_0x2ca47a['count']=_0x513c50;if(_0x3c91ff[_0x920a('0x35')]['includeAll']){_0x433b63[_0x920a('0xb5')]=[{'all':!![]}];}return db[_0x920a('0xaa')][_0x920a('0xb6')](_0x433b63);})[_0x920a('0x25')](function(_0x172c3a){_0x2ca47a[_0x920a('0xb7')]=_0x172c3a;return _0x2ca47a;});}})[_0x920a('0x25')](respondWithFilteredResult(_0x298764,_0x433b63))[_0x920a('0x2e')](handleError(_0x298764,null));};exports[_0x920a('0xb8')]=function(_0x5a0863,_0x5781c3,_0x21dae4){return db[_0x920a('0x30')][_0x920a('0x5d')]({'where':{'id':_0x5a0863['params']['id']}})[_0x920a('0x25')](handleEntityNotFound(_0x5781c3,null))['then'](function(_0x1ee78e){if(_0x1ee78e){return _0x1ee78e[_0x920a('0xb9')](_0x5a0863['body']['ids'],_['omit'](_0x5a0863[_0x920a('0x69')],['ids','id'])||{})[_0x920a('0xba')](function(){return db[_0x920a('0x62')][_0x920a('0xb6')]({'attributes':['id',_0x920a('0x27'),_0x920a('0x43')],'where':{'id':_0x5a0863[_0x920a('0x69')][_0x920a('0xac')]}});})[_0x920a('0x25')](function(_0x166db8){socket[_0x920a('0xbb')](_0x920a('0xbc'),{'id':Number(_0x5a0863[_0x920a('0xa6')]['id']),'tags':_0x166db8||[]});return{'id':Number(_0x5a0863[_0x920a('0xa6')]['id']),'tags':_0x166db8||[]};});}})[_0x920a('0x25')](respondWithResult(_0x5781c3,null))['catch'](handleError(_0x5781c3,null));};exports[_0x920a('0xbd')]=function(_0x8e7ee,_0x1144eb,_0x37e2d9){return db[_0x920a('0x30')][_0x920a('0x5d')]({'where':{'id':_0x8e7ee[_0x920a('0xa6')]['id']}})[_0x920a('0x25')](handleEntityNotFound(_0x1144eb,null))[_0x920a('0x25')](function(_0x48dde2){if(_0x48dde2){return _0x48dde2[_0x920a('0xbd')](_0x8e7ee[_0x920a('0x35')]['ids']);}})[_0x920a('0x25')](respondWithStatusCode(_0x1144eb,null))[_0x920a('0x2e')](handleError(_0x1144eb,null));};exports[_0x920a('0xbe')]=function(_0x504813,_0x5de0bb){var _0x1de843=moment()[_0x920a('0xbf')]()[_0x920a('0x8c')]();var _0x4a423e=path[_0x920a('0xc0')](config[_0x920a('0xc1')],'server',_0x920a('0xc2'),_0x920a('0xc3'));var _0x1cd88f=path[_0x920a('0xc0')](config[_0x920a('0xc1')],'server',_0x920a('0xc2'),_0x920a('0xc4'));var _0x4c804d=path['join'](_0x4a423e,_0x1de843);var _0x54176f=util[_0x920a('0xb2')](_0x920a('0xc5'),_0x504813[_0x920a('0xa6')]['id'],_0x1de843);var _0x17f386=path['join'](_0x4a423e,_0x54176f);var _0x1a6414=[];_0x1a6414['push']({'model':db['User'],'as':_0x920a('0x66'),'attributes':['id','fullname'],'raw':!![]});_0x1a6414['push']({'model':db['CmContact'],'as':_0x920a('0x59'),'attributes':['id',_0x920a('0xc6'),_0x920a('0xc7')],'raw':!![]});var _0xa50fa0=[{'model':db[_0x920a('0xaa')],'as':'Messages','attributes':['id','body',_0x920a('0x6f'),'direction','secret','read'],'include':_0x1a6414}];_0xa50fa0['push']({'model':db[_0x920a('0xc8')],'as':'Account','attributes':['id','name']});_0xa50fa0[_0x920a('0x2d')]({'model':db['User'],'as':_0x920a('0xc9'),'attributes':['id',_0x920a('0x29')]});return db[_0x920a('0x30')][_0x920a('0x5d')]({'where':{'id':_0x504813[_0x920a('0xa6')]['id']},'include':_0xa50fa0})[_0x920a('0x25')](handleEntityNotFound(_0x5de0bb,null))[_0x920a('0x25')](function(_0x57f57b){if(_0x57f57b){var _0x4e245c=_0x57f57b[_0x920a('0xca')]({'plain':!![]});fs[_0x920a('0xcb')](_0x4c804d);var _0x432dc7={'channel':_0x920a('0xcc'),'account':_0x4e245c['Account'][_0x920a('0x27')],'agent':_0x4e245c[_0x920a('0xc9')]?_0x4e245c[_0x920a('0xc9')][_0x920a('0x29')]:_0x920a('0xcd'),'createdAt':moment(_0x4e245c[_0x920a('0x6f')])[_0x920a('0xb2')](_0x920a('0xb3'))['toString'](),'closedAt':_0x4e245c[_0x920a('0xce')]?moment(_0x4e245c[_0x920a('0xcf')])['format'](_0x920a('0xb3'))[_0x920a('0x8c')]():'','disposition':_0x4e245c['disposition'],'messages':_(_0x4e245c[_0x920a('0xd0')])[_0x920a('0x79')]({'secret':![]})[_0x920a('0x28')](function(_0x4b52d4){return{'date':moment(_0x4b52d4[_0x920a('0x6f')])[_0x920a('0xb2')](_0x920a('0xb3'))[_0x920a('0x8c')](),'sender':_0x4b52d4[_0x920a('0xd1')]===_0x920a('0xd2')?_0x4b52d4[_0x920a('0x66')]?_0x4b52d4[_0x920a('0x66')][_0x920a('0x29')]:'System':_0x4b52d4[_0x920a('0x59')][_0x920a('0xc6')]+(_0x4b52d4[_0x920a('0x59')]['lastName']?'\x20'+_0x4b52d4[_0x920a('0x59')][_0x920a('0xc7')]:''),'body':_0x4b52d4['body'],'direction':_0x4b52d4['direction']===_0x920a('0xd2')?'A':'C','secret':_0x4b52d4[_0x920a('0xd3')],'read':_0x4b52d4['read']};})[_0x920a('0x56')]()};return ejs['renderFile'](path[_0x920a('0xc0')](config[_0x920a('0xc1')],_0x920a('0xd4'),_0x920a('0xd5'),_0x920a('0xd6')),{'interaction':_0x432dc7})[_0x920a('0x25')](function(_0x429579){var _0x162e87=path[_0x920a('0xc0')](_0x4c804d,_0x920a('0xd7')+_0x4e245c['id']+'-'+_0x1de843+_0x920a('0xd8'));var _0x57e909={'path':_0x162e87,'channel':_0x920a('0xcc'),'interactionId':_0x4e245c['id']};return pdf['createPdfFromHTML'](_0x429579,_0x57e909);})[_0x920a('0x25')](function(){return new BPromise(function(_0x26b408,_0x2e2718){zipdir(_0x4c804d,{'saveTo':_0x17f386},function(_0x317ef7,_0x1897cf){if(_0x317ef7)return _0x2e2718(_0x317ef7);return _0x26b408(_0x1897cf);});})[_0x920a('0x25')](function(){return new BPromise(function(_0x31046e,_0x5026a3){rimraf(_0x4c804d,function(_0x2f1f96){if(_0x2f1f96)_0x5026a3(_0x2f1f96);return _0x31046e();});});})[_0x920a('0x25')](function(){return _0x5de0bb[_0x920a('0xbe')](_0x17f386,_0x54176f,function(_0x5722e1){if(_0x5722e1){console['log'](_0x920a('0xd9'),_0x5722e1);}else{fs[_0x920a('0xda')](_0x17f386);}});});});}else{return _0x5de0bb[_0x920a('0x1b')](0xc8);}})[_0x920a('0x2e')](handleError(_0x5de0bb,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index bb8f413..3fd20e1 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 _0x1a85=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','../../mysqldb','SmsMessage','update','remove','getUsers','setDataValue','map'];(function(_0x59d337,_0x52ada3){var _0x13788c=function(_0x3741f8){while(--_0x3741f8){_0x59d337['push'](_0x59d337['shift']());}};_0x13788c(++_0x52ada3);}(_0x1a85,0x178));var _0x51a8=function(_0x5eb442,_0xe2ae2e){_0x5eb442=_0x5eb442-0x0;var _0x53aad0=_0x1a85[_0x5eb442];return _0x53aad0;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x51a8('0x0')];var SmsMessage=require(_0x51a8('0x1'))['db'][_0x51a8('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x51a8('0x3'),'afterDestroy':_0x51a8('0x4')};function emitEvent(_0x99e371){return function(_0x48a21b,_0xaac0bf,_0x4b76a8){_0x48a21b[_0x51a8('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x331117){_0x48a21b[_0x51a8('0x6')]('Users',_0x331117[_0x51a8('0x7')](function(_0x513685){return{'id':_0x513685['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x48a21b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x51a8('0x8')](function(_0x2f276b){_0x48a21b[_0x51a8('0x6')](_0x51a8('0x9'),_0x2f276b[_0x51a8('0xa')]);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371+':'+_0x48a21b['id'],_0x48a21b);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371,_0x48a21b);_0x4b76a8(null);})[_0x51a8('0xc')](_0x4b76a8(null));};}for(var e in events){if(events[_0x51a8('0xd')](e)){var event=events[e];SmsInteraction[_0x51a8('0xe')](e,emitEvent(event));}}module[_0x51a8('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x5fdc=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','map'];(function(_0x721de6,_0x44f160){var _0x3a45bb=function(_0x33c5b7){while(--_0x33c5b7){_0x721de6['push'](_0x721de6['shift']());}};_0x3a45bb(++_0x44f160);}(_0x5fdc,0x127));var _0xc5fd=function(_0x1ff589,_0x103ebd){_0x1ff589=_0x1ff589-0x0;var _0x4a13b5=_0x5fdc[_0x1ff589];return _0x4a13b5;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var SmsInteraction=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var SmsMessage=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc5fd('0x4')](0x0);var events={'afterCreate':_0xc5fd('0x5'),'afterUpdate':_0xc5fd('0x6'),'afterDestroy':_0xc5fd('0x7')};function emitEvent(_0x1b6205){return function(_0xca27a0,_0xea5748,_0x44722b){_0xca27a0[_0xc5fd('0x8')]({'attributes':['id'],'raw':!![]})[_0xc5fd('0x9')](function(_0x5a2eb4){_0xca27a0['setDataValue']('Users',_0x5a2eb4[_0xc5fd('0xa')](function(_0x46bce3){return{'id':_0x46bce3['id']};}));return SmsMessage[_0xc5fd('0xb')]({'where':{'SmsInteractionId':_0xca27a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5fd('0x9')](function(_0x4e6d35){_0xca27a0['setDataValue'](_0xc5fd('0xc'),_0x4e6d35[_0xc5fd('0xd')]);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205+':'+_0xca27a0['id'],_0xca27a0);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205,_0xca27a0);_0x44722b(null);})[_0xc5fd('0xf')](_0x44722b(null));};}for(var e in events){if(events[_0xc5fd('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc5fd('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 79ebbee..6ab40fd 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 _0x468e=['exports','SmsInteraction','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x3c96bd,_0x2186eb){var _0x2a2031=function(_0x44d993){while(--_0x44d993){_0x3c96bd['push'](_0x3c96bd['shift']());}};_0x2a2031(++_0x2186eb);}(_0x468e,0x192));var _0xe468=function(_0x388968,_0x109483){_0x388968=_0x388968-0x0;var _0x80c874=_0x468e[_0x388968];return _0x80c874;};'use strict';var _=require('lodash');var util=require(_0xe468('0x0'));var logger=require(_0xe468('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe468('0x2'));var fs=require('fs');var path=require(_0xe468('0x3'));var rimraf=require(_0xe468('0x4'));var config=require(_0xe468('0x5'));var attributes=require('./smsInteraction.attributes');module[_0xe468('0x6')]=function(_0xf15b62,_0x347139){return _0xf15b62['define'](_0xe468('0x7'),attributes,{'tableName':_0xe468('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x349493,_0x3cdfcd,_0x53df38){if(_0x349493['changed'](_0xe468('0x9'))){_0x349493['closedAt']=moment()[_0xe468('0xa')](_0xe468('0xb'));}_0x53df38(null,_0x349493);}}});}; \ No newline at end of file +var _0x7a56=['rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4372d5,_0x95d19a){var _0x4d787c=function(_0x123529){while(--_0x123529){_0x4372d5['push'](_0x4372d5['shift']());}};_0x4d787c(++_0x95d19a);}(_0x7a56,0x119));var _0x67a5=function(_0x5e298f,_0x38def9){_0x5e298f=_0x5e298f-0x0;var _0x2f1119=_0x7a56[_0x5e298f];return _0x2f1119;};'use strict';var _=require(_0x67a5('0x0'));var util=require(_0x67a5('0x1'));var logger=require(_0x67a5('0x2'))(_0x67a5('0x3'));var moment=require(_0x67a5('0x4'));var BPromise=require('bluebird');var rp=require(_0x67a5('0x5'));var fs=require('fs');var path=require(_0x67a5('0x6'));var rimraf=require(_0x67a5('0x7'));var config=require(_0x67a5('0x8'));var attributes=require(_0x67a5('0x9'));module[_0x67a5('0xa')]=function(_0x38425d,_0x19bff8){return _0x38425d[_0x67a5('0xb')](_0x67a5('0xc'),attributes,{'tableName':_0x67a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bf2f2,_0x3524a1,_0x349343){if(_0x2bf2f2[_0x67a5('0xe')]('closed')){_0x2bf2f2[_0x67a5('0xf')]=moment()[_0x67a5('0x10')](_0x67a5('0x11'));}_0x349343(null,_0x2bf2f2);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 8399ba1..f33ceb9 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 _0x46e3=['UpdateSmsInteraction','SmsInteraction','update','body','options','raw','limit','then','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','defaults','redis','localhost','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x4f1355,_0x5ac744){var _0x268b56=function(_0x22df19){while(--_0x22df19){_0x4f1355['push'](_0x4f1355['shift']());}};_0x268b56(++_0x5ac744);}(_0x46e3,0xab));var _0x346e=function(_0x3b4ac1,_0x4dd126){_0x3b4ac1=_0x3b4ac1-0x0;var _0x58401d=_0x46e3[_0x3b4ac1];return _0x58401d;};'use strict';var _=require(_0x346e('0x0'));var util=require(_0x346e('0x1'));var moment=require(_0x346e('0x2'));var BPromise=require(_0x346e('0x3'));var rs=require(_0x346e('0x4'));var fs=require('fs');var Redis=require(_0x346e('0x5'));var db=require(_0x346e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x346e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x346e('0x8')]['http']({'port':0x232a});config['redis']=_[_0x346e('0x9')](config[_0x346e('0xa')],{'host':_0x346e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x346e('0xa')]));require(_0x346e('0xc'))[_0x346e('0xd')](socket);function respondWithRpcPromise(_0x55b410,_0x38b633,_0x49d521){return new BPromise(function(_0x4feb0e,_0x704b85){return client[_0x346e('0xe')](_0x55b410,_0x49d521)['then'](function(_0x4faacb){logger[_0x346e('0xf')](_0x346e('0x10'),_0x38b633,_0x346e('0x11'));logger[_0x346e('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x38b633,_0x346e('0x11'),JSON[_0x346e('0x13')](_0x4faacb));if(_0x4faacb[_0x346e('0x14')]){if(_0x4faacb[_0x346e('0x14')][_0x346e('0x15')]===0x1f4){logger[_0x346e('0x14')](_0x346e('0x10'),_0x38b633,_0x4faacb[_0x346e('0x14')][_0x346e('0x16')]);return _0x704b85(_0x4faacb[_0x346e('0x14')][_0x346e('0x16')]);}logger[_0x346e('0x14')](_0x346e('0x10'),_0x38b633,_0x4faacb['error'][_0x346e('0x16')]);return _0x4feb0e(_0x4faacb[_0x346e('0x14')][_0x346e('0x16')]);}else{logger[_0x346e('0xf')](_0x346e('0x10'),_0x38b633,'request\x20sent');_0x4feb0e(_0x4faacb['result'][_0x346e('0x16')]);}})[_0x346e('0x17')](function(_0x591f06){logger[_0x346e('0x14')](_0x346e('0x10'),_0x38b633,_0x591f06);_0x704b85(_0x591f06);});});}exports[_0x346e('0x18')]=function(_0x40189b){var _0x53b0e7=this;return new Promise(function(_0x330dc6,_0x233863){return db[_0x346e('0x19')][_0x346e('0x1a')](_0x40189b[_0x346e('0x1b')],{'raw':_0x40189b[_0x346e('0x1c')]?_0x40189b[_0x346e('0x1c')][_0x346e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40189b[_0x346e('0x1c')]?_0x40189b[_0x346e('0x1c')]['where']||null:null,'attributes':_0x40189b[_0x346e('0x1c')]?_0x40189b['options']['attributes']||null:null,'limit':_0x40189b[_0x346e('0x1c')]?_0x40189b[_0x346e('0x1c')][_0x346e('0x1e')]||null:null})[_0x346e('0x1f')](function(_0x432aa1){logger['info'](_0x346e('0x18'),_0x40189b);logger[_0x346e('0x12')](_0x346e('0x18'),_0x40189b,JSON[_0x346e('0x13')](_0x432aa1));_0x330dc6(_0x432aa1);})[_0x346e('0x17')](function(_0x319295){logger[_0x346e('0x14')]('UpdateSmsInteraction',_0x319295[_0x346e('0x16')],_0x40189b);_0x233863(_0x53b0e7[_0x346e('0x14')](0x1f4,_0x319295['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x256895){return new Promise(function(_0x516dfc,_0xd693c2){return db['SmsInteraction'][_0x346e('0x20')]({'where':_0x256895['options']?_0x256895[_0x346e('0x1c')][_0x346e('0x21')]||null:null})[_0x346e('0x1f')](function(_0x42bbe5){if(_0x42bbe5){return _0x42bbe5[_0x346e('0x22')](_0x256895[_0x346e('0x1b')][_0x346e('0x23')],_[_0x346e('0x24')](_0x256895[_0x346e('0x1b')],['ids','id'])||{});}})[_0x346e('0x25')](function(_0x4e9e03){logger['info']('AddTags',_0x256895);logger[_0x346e('0x12')](_0x346e('0x26'),_0x256895,JSON[_0x346e('0x13')](_0x4e9e03));_0x516dfc(_0x4e9e03);})[_0x346e('0x17')](function(_0x439526){logger[_0x346e('0x14')](_0x346e('0x26'),_0x439526[_0x346e('0x16')],_0x256895);_0xd693c2(_this['error'](0x1f4,_0x439526[_0x346e('0x16')]));});});}; \ No newline at end of file +var _0xa21d=['raw','where','attributes','limit','UpdateSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','SmsInteraction','options'];(function(_0x8ad4cc,_0x3f06f8){var _0x2121fb=function(_0x48c44e){while(--_0x48c44e){_0x8ad4cc['push'](_0x8ad4cc['shift']());}};_0x2121fb(++_0x3f06f8);}(_0xa21d,0xda));var _0xda21=function(_0x629a81,_0x23aae1){_0x629a81=_0x629a81-0x0;var _0x100371=_0xa21d[_0x629a81];return _0x100371;};'use strict';var _=require(_0xda21('0x0'));var util=require(_0xda21('0x1'));var moment=require(_0xda21('0x2'));var BPromise=require(_0xda21('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda21('0x4'));var db=require(_0xda21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda21('0x6'))(_0xda21('0x7'));var config=require(_0xda21('0x8'));var jayson=require(_0xda21('0x9'));var client=jayson[_0xda21('0xa')]['http']({'port':0x232a});config[_0xda21('0xb')]=_[_0xda21('0xc')](config[_0xda21('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xda21('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xda21('0xe')](socket);function respondWithRpcPromise(_0xf8ba6d,_0x1090bb,_0x102b8d){return new BPromise(function(_0x586948,_0x55aa8c){return client['request'](_0xf8ba6d,_0x102b8d)[_0xda21('0xf')](function(_0x2dad28){logger['info'](_0xda21('0x10'),_0x1090bb,_0xda21('0x11'));logger[_0xda21('0x12')](_0xda21('0x13'),_0x1090bb,_0xda21('0x11'),JSON['stringify'](_0x2dad28));if(_0x2dad28[_0xda21('0x14')]){if(_0x2dad28[_0xda21('0x14')][_0xda21('0x15')]===0x1f4){logger[_0xda21('0x14')](_0xda21('0x10'),_0x1090bb,_0x2dad28[_0xda21('0x14')][_0xda21('0x16')]);return _0x55aa8c(_0x2dad28[_0xda21('0x14')][_0xda21('0x16')]);}logger[_0xda21('0x14')](_0xda21('0x10'),_0x1090bb,_0x2dad28[_0xda21('0x14')][_0xda21('0x16')]);return _0x586948(_0x2dad28[_0xda21('0x14')][_0xda21('0x16')]);}else{logger[_0xda21('0x17')](_0xda21('0x10'),_0x1090bb,_0xda21('0x11'));_0x586948(_0x2dad28[_0xda21('0x18')][_0xda21('0x16')]);}})[_0xda21('0x19')](function(_0x12ffbb){logger[_0xda21('0x14')](_0xda21('0x10'),_0x1090bb,_0x12ffbb);_0x55aa8c(_0x12ffbb);});});}exports['UpdateSmsInteraction']=function(_0x1541ac){var _0xc94b56=this;return new Promise(function(_0x4ba6c9,_0xd5775f){return db[_0xda21('0x1a')]['update'](_0x1541ac['body'],{'raw':_0x1541ac[_0xda21('0x1b')]?_0x1541ac[_0xda21('0x1b')][_0xda21('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1541ac[_0xda21('0x1b')]?_0x1541ac['options'][_0xda21('0x1d')]||null:null,'attributes':_0x1541ac['options']?_0x1541ac[_0xda21('0x1b')][_0xda21('0x1e')]||null:null,'limit':_0x1541ac['options']?_0x1541ac[_0xda21('0x1b')][_0xda21('0x1f')]||null:null})[_0xda21('0xf')](function(_0x2b60d3){logger[_0xda21('0x17')]('UpdateSmsInteraction',_0x1541ac);logger['debug'](_0xda21('0x20'),_0x1541ac,JSON['stringify'](_0x2b60d3));_0x4ba6c9(_0x2b60d3);})[_0xda21('0x19')](function(_0x517049){logger['error'](_0xda21('0x20'),_0x517049[_0xda21('0x16')],_0x1541ac);_0xd5775f(_0xc94b56[_0xda21('0x14')](0x1f4,_0x517049[_0xda21('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x581c30){return new Promise(function(_0x13e747,_0x575dcb){return db['SmsInteraction'][_0xda21('0x21')]({'where':_0x581c30['options']?_0x581c30['options'][_0xda21('0x1d')]||null:null})['then'](function(_0x124d73){if(_0x124d73){return _0x124d73[_0xda21('0x22')](_0x581c30[_0xda21('0x23')][_0xda21('0x24')],_[_0xda21('0x25')](_0x581c30[_0xda21('0x23')],[_0xda21('0x24'),'id'])||{});}})[_0xda21('0x26')](function(_0x397b80){logger[_0xda21('0x17')](_0xda21('0x27'),_0x581c30);logger['debug'](_0xda21('0x27'),_0x581c30,JSON[_0xda21('0x28')](_0x397b80));_0x13e747(_0x397b80);})['catch'](function(_0x14b889){logger[_0xda21('0x14')](_0xda21('0x27'),_0x14b889[_0xda21('0x16')],_0x581c30);_0x575dcb(_this[_0xda21('0x14')](0x1f4,_0x14b889[_0xda21('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ba3d0c6..c653f3c 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 _0xf3e2=['smsInteraction:','./smsInteraction.events','save','remove','update','removeListener','register'];(function(_0x110a17,_0x26d8e9){var _0x58c4bf=function(_0x36a3ce){while(--_0x36a3ce){_0x110a17['push'](_0x110a17['shift']());}};_0x58c4bf(++_0x26d8e9);}(_0xf3e2,0x16d));var _0x2f3e=function(_0x186861,_0x2311c7){_0x186861=_0x186861-0x0;var _0x5be31f=_0xf3e2[_0x186861];return _0x5be31f;};'use strict';var SmsInteractionEvents=require(_0x2f3e('0x0'));var events=[_0x2f3e('0x1'),_0x2f3e('0x2'),_0x2f3e('0x3')];function createListener(_0x53006d,_0x31f715){return function(_0x2dd6ed){_0x31f715['emit'](_0x53006d,_0x2dd6ed);};}function removeListener(_0x39a9f7,_0x5e23cf){return function(){SmsInteractionEvents[_0x2f3e('0x4')](_0x39a9f7,_0x5e23cf);};}exports[_0x2f3e('0x5')]=function(_0x10640c){for(var _0x21db26=0x0,_0x512895=events['length'];_0x21db26<_0x512895;_0x21db26++){var _0x385248=events[_0x21db26];var _0x9fc7a1=createListener(_0x2f3e('0x6')+_0x385248,_0x10640c);SmsInteractionEvents['on'](_0x385248,_0x9fc7a1);}}; \ No newline at end of file +var _0xef50=['smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0xfd3d3e,_0x5776da){var _0x47618c=function(_0x1edb29){while(--_0x1edb29){_0xfd3d3e['push'](_0xfd3d3e['shift']());}};_0x47618c(++_0x5776da);}(_0xef50,0x119));var _0x0ef5=function(_0x1c0c9d,_0xd03f9f){_0x1c0c9d=_0x1c0c9d-0x0;var _0x278b98=_0xef50[_0x1c0c9d];return _0x278b98;};'use strict';var SmsInteractionEvents=require(_0x0ef5('0x0'));var events=[_0x0ef5('0x1'),_0x0ef5('0x2'),_0x0ef5('0x3')];function createListener(_0x3b8add,_0x8cfa96){return function(_0x2f021e){_0x8cfa96[_0x0ef5('0x4')](_0x3b8add,_0x2f021e);};}function removeListener(_0x2ccb1c,_0x42e5cb){return function(){SmsInteractionEvents[_0x0ef5('0x5')](_0x2ccb1c,_0x42e5cb);};}exports['register']=function(_0x22e04d){for(var _0x5f0c95=0x0,_0x4b11c1=events[_0x0ef5('0x6')];_0x5f0c95<_0x4b11c1;_0x5f0c95++){var _0x5a6985=events[_0x5f0c95];var _0x46326c=createListener(_0x0ef5('0x7')+_0x5a6985,_0x22e04d);SmsInteractionEvents['on'](_0x5a6985,_0x46326c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 1800e1c..099b695 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 _0x5205=['post','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2c6d2c,_0x3b8054){var _0x1a69a8=function(_0x308088){while(--_0x308088){_0x2c6d2c['push'](_0x2c6d2c['shift']());}};_0x1a69a8(++_0x3b8054);}(_0x5205,0x1e1));var _0x5520=function(_0xc93377,_0x1252e9){_0xc93377=_0xc93377-0x0;var _0x552e70=_0x5205[_0xc93377];return _0x552e70;};'use strict';var multer=require(_0x5520('0x0'));var util=require(_0x5520('0x1'));var path=require('path');var timeout=require(_0x5520('0x2'));var express=require(_0x5520('0x3'));var router=express['Router']();var fs_extra=require(_0x5520('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5520('0x5'));var config=require(_0x5520('0x6'));var controller=require('./smsMessage.controller');router[_0x5520('0x7')]('/',auth[_0x5520('0x8')](),controller[_0x5520('0x9')]);router[_0x5520('0x7')](_0x5520('0xa'),auth['isAuthenticated'](),controller[_0x5520('0xb')]);router[_0x5520('0x7')](_0x5520('0xc'),auth[_0x5520('0x8')](),controller['show']);router[_0x5520('0xd')]('/',auth[_0x5520('0x8')](),interaction[_0x5520('0xe')](_0x5520('0xf'),_0x5520('0x10')),controller[_0x5520('0x11')]);router[_0x5520('0xd')](_0x5520('0x12'),controller['status']);router[_0x5520('0x13')](_0x5520('0xc'),auth['isAuthenticated'](),controller[_0x5520('0x14')]);router['put'](_0x5520('0x15'),auth[_0x5520('0x8')](),controller[_0x5520('0x16')]);router['put']('/:id/reject',auth[_0x5520('0x8')](),controller[_0x5520('0x17')]);router[_0x5520('0x18')](_0x5520('0xc'),auth[_0x5520('0x8')](),controller[_0x5520('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5f25=['sms','smsmessage:create','create','/:id/status','status','put','update','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked'];(function(_0x139cd5,_0x4c4808){var _0x19ebb9=function(_0x28fb63){while(--_0x28fb63){_0x139cd5['push'](_0x139cd5['shift']());}};_0x19ebb9(++_0x4c4808);}(_0x5f25,0x1cb));var _0x55f2=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0x5f25[_0x3dc538];return _0x72c2fd;};'use strict';var multer=require(_0x55f2('0x0'));var util=require(_0x55f2('0x1'));var path=require(_0x55f2('0x2'));var timeout=require(_0x55f2('0x3'));var express=require(_0x55f2('0x4'));var router=express[_0x55f2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x55f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x55f2('0x7'));var controller=require(_0x55f2('0x8'));router[_0x55f2('0x9')]('/',auth[_0x55f2('0xa')](),controller[_0x55f2('0xb')]);router['get'](_0x55f2('0xc'),auth[_0x55f2('0xa')](),controller['describe']);router[_0x55f2('0x9')](_0x55f2('0xd'),auth['isAuthenticated'](),controller[_0x55f2('0xe')]);router[_0x55f2('0xf')]('/',auth[_0x55f2('0xa')](),interaction[_0x55f2('0x10')](_0x55f2('0x11'),_0x55f2('0x12')),controller[_0x55f2('0x13')]);router['post'](_0x55f2('0x14'),controller[_0x55f2('0x15')]);router[_0x55f2('0x16')](_0x55f2('0xd'),auth[_0x55f2('0xa')](),controller[_0x55f2('0x17')]);router[_0x55f2('0x16')]('/:id/accept',auth[_0x55f2('0xa')](),controller['accept']);router[_0x55f2('0x16')](_0x55f2('0x18'),auth[_0x55f2('0xa')](),controller[_0x55f2('0x19')]);router['delete'](_0x55f2('0xd'),auth['isAuthenticated'](),controller[_0x55f2('0x1a')]);module[_0x55f2('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 e828098..1395bf3 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 _0xcd3a=['out','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd3a,0x8e));var _0xacd3=function(_0x20b0e4,_0x892547){_0x20b0e4=_0x20b0e4-0x0;var _0x286eee=_0xcd3a[_0x20b0e4];return _0x286eee;};'use strict';var Sequelize=require('sequelize');module[_0xacd3('0x0')]={'body':{'type':Sequelize[_0xacd3('0x1')](_0xacd3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xacd3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xacd3('0x4')]('in',_0xacd3('0x5')),'defaultValue':_0xacd3('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xacd3('0x6')](0xbe)},'phone':{'type':Sequelize[_0xacd3('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xacd3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xacd3('0x6')]},'providerResponse':{'type':Sequelize[_0xacd3('0x1')]}}; \ No newline at end of file +var _0x12be=['TEXT','sequelize','exports','medium','ENUM','out','STRING','DATE'];(function(_0x5d714e,_0xba1752){var _0x349059=function(_0x2b0463){while(--_0x2b0463){_0x5d714e['push'](_0x5d714e['shift']());}};_0x349059(++_0xba1752);}(_0x12be,0x169));var _0xe12b=function(_0x5b36bd,_0x4dfb36){_0x5b36bd=_0x5b36bd-0x0;var _0x1614fe=_0x12be[_0x5b36bd];return _0x1614fe;};'use strict';var Sequelize=require(_0xe12b('0x0'));module[_0xe12b('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe12b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe12b('0x3')]('in','out'),'defaultValue':_0xe12b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe12b('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe12b('0x5')]},'readAt':{'type':Sequelize[_0xe12b('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe12b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b880822..0dde4cb 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 _0x2032=['name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','includeAll','findAll','rows','params','rawAttributes','length','include','find','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','RejectMessage','rejectMessage','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','twilio','inspect','plivo','MessageUUID','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','jayson/promise','client','http','request','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','index','map','SmsMessage','type','key','model'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0x2032,0xd9));var _0x2203=function(_0x53b024,_0x13c6a7){_0x53b024=_0x53b024-0x0;var _0x12b82e=_0x2032[_0x53b024];return _0x12b82e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2203('0x18')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x2203('0x19'));var client=jayson[_0x2203('0x1a')][_0x2203('0x1b')]({'port':0x232c});var client9002=jayson[_0x2203('0x1a')][_0x2203('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3fe0a8,_0x2c36e6,_0x2c085c,_0xdf9d0b){return new BPromise(function(_0x3053f3,_0x5129fb){var _0x280eda=_0xdf9d0b||client;return _0x280eda[_0x2203('0x1c')](_0x3fe0a8,_0x2c085c)['then'](function(_0x3f9ef6){logger[_0x2203('0x1d')]('SmsMessage,\x20%s,\x20%s',_0x2c36e6,_0x2203('0x1e'));logger['debug'](_0x2203('0x1f'),_0x2c36e6,_0x2203('0x1e'),JSON[_0x2203('0x20')](_0x3f9ef6));if(_0x3f9ef6[_0x2203('0x21')]){if(_0x3f9ef6[_0x2203('0x21')][_0x2203('0x22')]===0x1f4){logger['error'](_0x2203('0x23'),_0x2c36e6,_0x3f9ef6['error']['message']);return _0x5129fb(_0x3f9ef6[_0x2203('0x21')]['message']);}logger[_0x2203('0x21')](_0x2203('0x23'),_0x2c36e6,_0x3f9ef6['error'][_0x2203('0x24')]);return _0x3053f3(_0x3f9ef6['error']['message']);}else{logger[_0x2203('0x1d')](_0x2203('0x23'),_0x2c36e6,_0x2203('0x1e'));_0x3053f3(_0x3f9ef6[_0x2203('0x25')][_0x2203('0x24')]);}})[_0x2203('0x26')](function(_0x49c12){logger[_0x2203('0x21')]('SmsMessage,\x20%s,\x20%s',_0x2c36e6,_0x49c12);_0x5129fb(_0x49c12);});});}function respondWithStatusCode(_0x143f41,_0x36b958){_0x36b958=_0x36b958||0xcc;return function(_0x39a11a){if(_0x39a11a){return _0x143f41['sendStatus'](_0x36b958);}return _0x143f41[_0x2203('0x27')](_0x36b958)[_0x2203('0x28')]();};}function respondWithResult(_0x5c5fd3,_0xd6e109){_0xd6e109=_0xd6e109||0xc8;return function(_0xd91f5d){if(_0xd91f5d){return _0x5c5fd3[_0x2203('0x27')](_0xd6e109)[_0x2203('0x29')](_0xd91f5d);}};}function respondWithFilteredResult(_0x28ae02,_0x1df508){return function(_0x9c53f){if(_0x9c53f){var _0x5a95c1=typeof _0x1df508[_0x2203('0x2a')]===_0x2203('0x2b')&&typeof _0x1df508[_0x2203('0x2c')]===_0x2203('0x2b');var _0x52a426=_0x9c53f[_0x2203('0x2d')];var _0x21ff0d=_0x5a95c1?0x0:_0x1df508[_0x2203('0x2a')];var _0xf59954=_0x5a95c1?_0x9c53f['count']:_0x1df508[_0x2203('0x2a')]+_0x1df508[_0x2203('0x2c')];var _0x5e6560;if(_0xf59954>=_0x52a426){_0xf59954=_0x52a426;_0x5e6560=0xc8;}else{_0x5e6560=0xce;}_0x28ae02['status'](_0x5e6560);return _0x28ae02[_0x2203('0x2e')]('Content-Range',_0x21ff0d+'-'+_0xf59954+'/'+_0x52a426)['json'](_0x9c53f);}return null;};}function patchUpdates(_0x125dfc){return function(_0x464c88){try{jsonpatch[_0x2203('0x2f')](_0x464c88,_0x125dfc,!![]);}catch(_0x1e0aa9){return BPromise[_0x2203('0x30')](_0x1e0aa9);}return _0x464c88['save']();};}function saveUpdates(_0xb22e28,_0x2324c0){return function(_0x49caec){if(_0x49caec){return _0x49caec[_0x2203('0x31')](_0xb22e28)[_0x2203('0x32')](function(_0x9a335d){return _0x9a335d;});}return null;};}function removeEntity(_0x4187b4,_0x43fee1){return function(_0x24d138){if(_0x24d138){return _0x24d138[_0x2203('0x33')]()[_0x2203('0x32')](function(){_0x4187b4[_0x2203('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15c0ad,_0x347d3e){return function(_0x56f9b2){if(!_0x56f9b2){_0x15c0ad['sendStatus'](0x194);}return _0x56f9b2;};}function handleError(_0x2c58b1,_0x5e9841){_0x5e9841=_0x5e9841||0x1f4;return function(_0x25cc97){logger[_0x2203('0x21')](_0x25cc97[_0x2203('0x34')]);if(_0x25cc97['name']){delete _0x25cc97['name'];}_0x2c58b1[_0x2203('0x27')](_0x5e9841)['send'](_0x25cc97);};}exports[_0x2203('0x35')]=function(_0x5cfe5e,_0x11451e){var _0x4b6fc5={},_0x86097c={},_0x13ed9e={'count':0x0,'rows':[]};var _0x4311d1=_[_0x2203('0x36')](db[_0x2203('0x37')]['rawAttributes'],function(_0x5f1561){return{'name':_0x5f1561['fieldName'],'type':_0x5f1561[_0x2203('0x38')][_0x2203('0x39')]};});_0x86097c[_0x2203('0x3a')]=_[_0x2203('0x36')](_0x4311d1,_0x2203('0x3b'));_0x86097c[_0x2203('0x3c')]=_[_0x2203('0x3d')](_0x5cfe5e['query']);_0x86097c[_0x2203('0x3e')]=_[_0x2203('0x3f')](_0x86097c[_0x2203('0x3a')],_0x86097c[_0x2203('0x3c')]);_0x4b6fc5['attributes']=_['intersection'](_0x86097c[_0x2203('0x3a')],qs['fields'](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x40')]));_0x4b6fc5[_0x2203('0x41')]=_0x4b6fc5['attributes']['length']?_0x4b6fc5[_0x2203('0x41')]:_0x86097c[_0x2203('0x3a')];if(!_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x42')](_0x2203('0x43'))){_0x4b6fc5[_0x2203('0x2c')]=qs['limit'](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x2c')]);_0x4b6fc5[_0x2203('0x2a')]=qs[_0x2203('0x2a')](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x2a')]);}_0x4b6fc5[_0x2203('0x44')]=qs[_0x2203('0x45')](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x45')]);_0x4b6fc5['where']=qs[_0x2203('0x3e')](_[_0x2203('0x46')](_0x5cfe5e[_0x2203('0x3c')],_0x86097c[_0x2203('0x3e')]),_0x4311d1);if(_0x5cfe5e['query']['filter']){_0x4b6fc5[_0x2203('0x47')]=_['merge'](_0x4b6fc5[_0x2203('0x47')],{'$or':_[_0x2203('0x36')](_0x4311d1,function(_0xc2944f){if(_0xc2944f[_0x2203('0x38')]!=='VIRTUAL'){var _0x289146={};_0x289146[_0xc2944f[_0x2203('0x3b')]]={'$like':'%'+_0x5cfe5e['query'][_0x2203('0x48')]+'%'};return _0x289146;}})});}_0x4b6fc5=_[_0x2203('0x49')]({},_0x4b6fc5,_0x5cfe5e[_0x2203('0x4a')]);var _0x2600a9={'where':_0x4b6fc5['where']};return db['SmsMessage'][_0x2203('0x2d')](_0x2600a9)['then'](function(_0x543fde){_0x13ed9e[_0x2203('0x2d')]=_0x543fde;if(_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x4b')]){_0x4b6fc5['include']=[{'all':!![]}];}return db['SmsMessage'][_0x2203('0x4c')](_0x4b6fc5);})[_0x2203('0x32')](function(_0x12d7fa){_0x13ed9e[_0x2203('0x4d')]=_0x12d7fa;return _0x13ed9e;})[_0x2203('0x32')](respondWithFilteredResult(_0x11451e,_0x4b6fc5))[_0x2203('0x26')](handleError(_0x11451e,null));};exports['show']=function(_0x747dce,_0x557659){var _0x3f7685={'raw':!![],'where':{'id':_0x747dce[_0x2203('0x4e')]['id']}},_0x39ff6f={};_0x39ff6f[_0x2203('0x3a')]=_['keys'](db['SmsMessage'][_0x2203('0x4f')]);_0x39ff6f[_0x2203('0x3c')]=_[_0x2203('0x3d')](_0x747dce[_0x2203('0x3c')]);_0x39ff6f['filters']=_['intersection'](_0x39ff6f['model'],_0x39ff6f[_0x2203('0x3c')]);_0x3f7685[_0x2203('0x41')]=_['intersection'](_0x39ff6f[_0x2203('0x3a')],qs[_0x2203('0x40')](_0x747dce['query'][_0x2203('0x40')]));_0x3f7685[_0x2203('0x41')]=_0x3f7685[_0x2203('0x41')][_0x2203('0x50')]?_0x3f7685['attributes']:_0x39ff6f[_0x2203('0x3a')];if(_0x747dce['query'][_0x2203('0x4b')]){_0x3f7685[_0x2203('0x51')]=[{'all':!![]}];}_0x3f7685=_['merge']({},_0x3f7685,_0x747dce[_0x2203('0x4a')]);return db[_0x2203('0x37')][_0x2203('0x52')](_0x3f7685)[_0x2203('0x32')](handleEntityNotFound(_0x557659,null))[_0x2203('0x32')](respondWithResult(_0x557659,null))[_0x2203('0x26')](handleError(_0x557659,null));};exports['create']=function(_0x562a3d,_0x2f2537){return db['SmsMessage']['create'](_0x562a3d[_0x2203('0x53')],{})[_0x2203('0x32')](respondWithResult(_0x2f2537,0xc9))[_0x2203('0x26')](handleError(_0x2f2537,null));};exports['update']=function(_0x213c24,_0x4b2788){if(_0x213c24['body']['id']){delete _0x213c24[_0x2203('0x53')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x213c24['params']['id']}})[_0x2203('0x32')](handleEntityNotFound(_0x4b2788,null))[_0x2203('0x32')](saveUpdates(_0x213c24[_0x2203('0x53')],null))[_0x2203('0x32')](respondWithResult(_0x4b2788,null))[_0x2203('0x26')](handleError(_0x4b2788,null));};exports[_0x2203('0x33')]=function(_0x2baea2,_0x91f70c){return db[_0x2203('0x37')][_0x2203('0x52')]({'where':{'id':_0x2baea2[_0x2203('0x4e')]['id']}})[_0x2203('0x32')](handleEntityNotFound(_0x91f70c,null))['then'](removeEntity(_0x91f70c,null))['catch'](handleError(_0x91f70c,null));};exports[_0x2203('0x54')]=function(_0x43d8c0,_0x2511bd){return db[_0x2203('0x37')][_0x2203('0x54')]()[_0x2203('0x32')](respondWithResult(_0x2511bd,null))['catch'](handleError(_0x2511bd,null));};var interaction_log=require('../../config/logger')(_0x2203('0x55'));exports[_0x2203('0x56')]=function(_0x21ee59,_0x1e6d21,_0xcab922){var _0x7b0b9c={'agent':{},'channel':_0x2203('0x57')};if(_0x21ee59[_0x2203('0x53')]['id']){delete _0x21ee59[_0x2203('0x53')]['id'];}_0x21ee59[_0x2203('0x53')][_0x2203('0x58')]=!![];_0x21ee59['body'][_0x2203('0x59')]=moment()[_0x2203('0x5a')](_0x2203('0x5b'));_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')]=_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')]||_0x21ee59[_0x2203('0x5d')]['id'];_0x7b0b9c[_0x2203('0x5e')]['id']=_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')];return db[_0x2203('0x37')][_0x2203('0x52')]({'where':{'id':_0x21ee59[_0x2203('0x4e')]['id'],'UserId':null}})[_0x2203('0x32')](handleEntityNotFound(_0x1e6d21,null))[_0x2203('0x32')](saveUpdates(_0x21ee59[_0x2203('0x53')],null))[_0x2203('0x32')](function(_0x8a9282){if(_0x8a9282){_0x7b0b9c[_0x2203('0x24')]=_0x8a9282['get']({'plain':!![]});return db[_0x2203('0x5f')][_0x2203('0x52')]({'where':{'id':_0x8a9282[_0x2203('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x1e6d21,null))[_0x2203('0x32')](function(_0x3f73e1){if(_0x3f73e1){return _0x3f73e1[_0x2203('0x31')]({'UserId':_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')],'read1stAt':_['isNil'](_0x3f73e1[_0x2203('0x61')])?moment()[_0x2203('0x5a')](_0x2203('0x5b')):undefined});}return null;})['then'](function(_0x5507b6){if(_0x5507b6){_0x7b0b9c['interaction']=_0x5507b6['get']({'plain':!![]});interaction_log['info'](_0x2203('0x62'),_0x21ee59[_0x2203('0x5d')]['id'],_0x21ee59[_0x2203('0x5d')][_0x2203('0x3b')],_0x21ee59[_0x2203('0x5d')][_0x2203('0x63')],_0x7b0b9c[_0x2203('0x64')]['id'],_0x21ee59[_0x2203('0x53')]?JSON['stringify'](_0x21ee59['body']):_0x2203('0x65'));return respondWithRpcPromise(_0x2203('0x66'),_0x2203('0x67'),_0x7b0b9c);}return null;})[_0x2203('0x32')](function(_0x1bbd2d){var _0x32a348=_0x2203('0x68')+_0x1bbd2d[_0x2203('0x24')][_0x2203('0x69')];return db[_0x2203('0x6a')][_0x2203('0x3c')](_0x32a348,{'type':db[_0x2203('0x6b')][_0x2203('0x6c')][_0x2203('0x6d')],'raw':!![]})[_0x2203('0x32')](function(_0x10a611){return _0x10a611;});})[_0x2203('0x32')](function(_0x173ac1){if(_0x173ac1){_0x7b0b9c[_0x2203('0x24')]['contact']=_0x173ac1[0x0];if(!_0x21ee59[_0x2203('0x53')]['UserId'])return;return db[_0x2203('0x6e')]['find']({'where':{'id':_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')],'role':_0x2203('0x5e')},'attributes':['id',_0x2203('0x3b'),_0x2203('0x6f'),_0x2203('0x70'),_0x2203('0x71')],'raw':!![]});}return null;})[_0x2203('0x32')](function(_0x4e9a01){if(!_0x4e9a01)return null;_0x7b0b9c['message'][_0x2203('0x5e')]=_0x4e9a01;return _0x7b0b9c;})[_0x2203('0x32')](function(_0x18d583){if(_0x18d583){if(_0x21ee59['body']['manual']){_0x7b0b9c['message'][_0x2203('0x72')]=util[_0x2203('0x5a')](_0x2203('0x73'),_0x21ee59[_0x2203('0x5d')]['name']);_0x7b0b9c[_0x2203('0x24')]['channel']=_0x7b0b9c[_0x2203('0x74')];_0x7b0b9c[_0x2203('0x24')][_0x2203('0x75')]=_0x2203('0x56');return respondWithRpcPromise(_0x2203('0x76'),'EventManager',{'event':_0x2203('0x77'),'message':_0x7b0b9c[_0x2203('0x24')]},client9002)[_0x2203('0x32')](function(){return _0x7b0b9c;});}return _0x7b0b9c;}return null;})['then'](respondWithResult(_0x1e6d21,null))[_0x2203('0x26')](handleError(_0x1e6d21,null));};var interaction_log=require(_0x2203('0x14'))(_0x2203('0x55'));exports[_0x2203('0x30')]=function(_0x1c65f9,_0x4356fe,_0x1a2b7c){var _0x503d7b={'agent':{},'channel':_0x2203('0x57')};if(_0x1c65f9[_0x2203('0x53')]['id']){delete _0x1c65f9[_0x2203('0x53')]['id'];}_0x1c65f9['body'][_0x2203('0x5c')]=_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')]||_0x1c65f9[_0x2203('0x5d')]['id'];_0x503d7b[_0x2203('0x5e')]['id']=_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')];return db[_0x2203('0x37')][_0x2203('0x52')]({'where':{'id':_0x1c65f9[_0x2203('0x4e')]['id'],'UserId':null}})[_0x2203('0x32')](handleEntityNotFound(_0x4356fe,null))[_0x2203('0x32')](function(_0x4c332f){if(_0x4c332f){_0x503d7b['message']=_0x4c332f[_0x2203('0x78')]({'plain':!![]});return db[_0x2203('0x5f')][_0x2203('0x52')]({'where':{'id':_0x4c332f[_0x2203('0x60')]}});}return null;})[_0x2203('0x32')](handleEntityNotFound(_0x4356fe,null))['then'](function(_0x16e518){if(_0x16e518){_0x503d7b[_0x2203('0x64')]=_0x16e518['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c65f9['user']['id'],_0x1c65f9['user'][_0x2203('0x3b')],_0x1c65f9[_0x2203('0x5d')][_0x2203('0x63')],_0x503d7b['interaction']['id'],_0x1c65f9['body']?JSON['stringify'](_0x1c65f9[_0x2203('0x53')]):_0x2203('0x65'));return respondWithRpcPromise(_0x2203('0x79'),_0x2203('0x7a'),_0x503d7b);}return null;})[_0x2203('0x32')](function(_0x32ac75){var _0x3d1797='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32ac75[_0x2203('0x24')][_0x2203('0x69')];return db[_0x2203('0x6a')][_0x2203('0x3c')](_0x3d1797,{'type':db[_0x2203('0x6b')][_0x2203('0x6c')][_0x2203('0x6d')],'raw':!![]})['then'](function(_0x188722){return _0x188722;});})['then'](function(_0x5d0176){if(_0x5d0176){_0x503d7b[_0x2203('0x24')]['contact']=_0x5d0176[0x0];if(!_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')])return;return db['User'][_0x2203('0x52')]({'where':{'id':_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')],'role':_0x2203('0x5e')},'attributes':['id',_0x2203('0x3b'),_0x2203('0x6f'),'email',_0x2203('0x71')],'raw':!![]});}return null;})[_0x2203('0x32')](function(_0x524b43){if(!_0x524b43)return null;_0x503d7b['message'][_0x2203('0x5e')]=_0x524b43;return _0x503d7b;})[_0x2203('0x32')](function(_0x383d3e){if(_0x383d3e){_0x383d3e[_0x2203('0x24')][_0x2203('0x72')]=util[_0x2203('0x5a')](_0x2203('0x73'),_0x1c65f9[_0x2203('0x5d')][_0x2203('0x3b')]);_0x383d3e[_0x2203('0x24')][_0x2203('0x74')]=_0x503d7b[_0x2203('0x74')];_0x383d3e[_0x2203('0x24')][_0x2203('0x75')]=_0x2203('0x30');respondWithRpcPromise(_0x2203('0x76'),'EventManager',{'event':'rejectmessage','message':_0x383d3e[_0x2203('0x24')]},client9002);return _0x503d7b;}return null;})[_0x2203('0x32')](respondWithResult(_0x4356fe,null))['catch'](handleError(_0x4356fe,null));};exports[_0x2203('0x27')]=function(_0x447a95,_0x5b5e95,_0x54014d){if(_0x447a95[_0x2203('0x53')]['id']){delete _0x447a95['body']['id'];}var _0x21f357;return db[_0x2203('0x37')]['find']({'where':{'id':_0x447a95[_0x2203('0x4e')]['id']}})[_0x2203('0x32')](handleEntityNotFound(_0x5b5e95,null))[_0x2203('0x32')](function(_0x1596f7){if(_0x1596f7){_0x21f357=_0x1596f7;return db['SmsAccount']['find']({'where':{'id':_0x1596f7[_0x2203('0x7b')]}});}})[_0x2203('0x32')](handleEntityNotFound(_0x5b5e95,null))[_0x2203('0x32')](function(_0x4ff77f){if(_0x4ff77f){logger['debug'](_0x2203('0x1f'),_0x2203('0x27'),_0x2203('0x7c'),_0x4ff77f['type'],util['inspect'](_0x447a95[_0x2203('0x53')],{'showHidden':![],'depth':null}));switch(_0x4ff77f[_0x2203('0x38')]){case'twilio':if(_0x447a95[_0x2203('0x53')][_0x2203('0x7d')]&&_0x447a95['body'][_0x2203('0x7d')]===_0x21f357['messageId']){return _0x21f357[_0x2203('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2203('0x7e'),util[_0x2203('0x7f')](_0x447a95['body'],{'showHidden':![],'depth':null}));}break;case _0x2203('0x80'):if(_0x447a95[_0x2203('0x53')][_0x2203('0x81')]&&_0x447a95['body'][_0x2203('0x81')]===_0x21f357['messageId']&&_[_0x2203('0x82')]([_0x2203('0x83'),'delivered'],_0x447a95[_0x2203('0x53')][_0x2203('0x84')])>=0x0){return _0x21f357['update']({'read':!![]});}else{logger[_0x2203('0x21')](_0x2203('0x85'),_0x2203('0x27'),_0x2203('0x86'),util[_0x2203('0x7f')](_0x447a95['body'],{'showHidden':![],'depth':null}));}break;case _0x2203('0x87'):var _0x1b5185=_0x447a95[_0x2203('0x53')][_0x2203('0x88')][0x0];if(_0x1b5185[_0x2203('0x27')][_0x2203('0x89')]==='DELIVERED'){return _0x21f357[_0x2203('0x31')]({'read':!![]});}else{logger[_0x2203('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2203('0x27'),'infobip',util[_0x2203('0x7f')](_0x447a95[_0x2203('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x21f357;}})[_0x2203('0x32')](respondWithResult(_0x5b5e95,null))['catch'](handleError(_0x5b5e95,null));}; \ No newline at end of file +var _0xb10b=['MessageUUID','indexOf','sent','plivio','infobip','results','DELIVERED','inspect','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','filter','where','merge','type','options','SmsMessage','includeAll','findAll','rows','show','length','include','find','create','body','params','describe','sms-interactions','accept','sms','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','User','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','role','RejectMessage','rejectMessage','sequelize','contact','email','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo'];(function(_0x4bb10b,_0x3bd107){var _0x43e25e=function(_0x3b7971){while(--_0x3b7971){_0x4bb10b['push'](_0x4bb10b['shift']());}};_0x43e25e(++_0x3bd107);}(_0xb10b,0x12a));var _0xbb10=function(_0x33ddea,_0x222f65){_0x33ddea=_0x33ddea-0x0;var _0x5e2f59=_0xb10b[_0x33ddea];return _0x5e2f59;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config['redis']));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);var jayson=require(_0xbb10('0x1e'));var client=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x36b5e8,_0x3e26f4,_0x2b184e,_0x4a2bfc){return new BPromise(function(_0x2eca0f,_0x1145f1){var _0x133ac2=_0x4a2bfc||client;return _0x133ac2[_0xbb10('0x21')](_0x36b5e8,_0x2b184e)[_0xbb10('0x22')](function(_0x1682a4){logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x3e26f4,_0xbb10('0x25'));logger[_0xbb10('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e26f4,_0xbb10('0x25'),JSON[_0xbb10('0x27')](_0x1682a4));if(_0x1682a4[_0xbb10('0x28')]){if(_0x1682a4[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x28')]('SmsMessage,\x20%s,\x20%s',_0x3e26f4,_0x1682a4[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1145f1(_0x1682a4['error']['message']);}logger[_0xbb10('0x28')](_0xbb10('0x24'),_0x3e26f4,_0x1682a4[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x2eca0f(_0x1682a4[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x3e26f4,_0xbb10('0x25'));_0x2eca0f(_0x1682a4[_0xbb10('0x2b')][_0xbb10('0x2a')]);}})[_0xbb10('0x2c')](function(_0x537898){logger['error']('SmsMessage,\x20%s,\x20%s',_0x3e26f4,_0x537898);_0x1145f1(_0x537898);});});}function respondWithStatusCode(_0xc93a04,_0x3c5ae7){_0x3c5ae7=_0x3c5ae7||0xcc;return function(_0x2c89b9){if(_0x2c89b9){return _0xc93a04['sendStatus'](_0x3c5ae7);}return _0xc93a04[_0xbb10('0x2d')](_0x3c5ae7)[_0xbb10('0x2e')]();};}function respondWithResult(_0x6ed43b,_0x1d5e95){_0x1d5e95=_0x1d5e95||0xc8;return function(_0x1acce9){if(_0x1acce9){return _0x6ed43b[_0xbb10('0x2d')](_0x1d5e95)[_0xbb10('0x2f')](_0x1acce9);}};}function respondWithFilteredResult(_0x4aabb9,_0x3796c7){return function(_0x21ac54){if(_0x21ac54){var _0xfc3595=typeof _0x3796c7[_0xbb10('0x30')]===_0xbb10('0x31')&&typeof _0x3796c7[_0xbb10('0x32')]==='undefined';var _0x221624=_0x21ac54['count'];var _0x448d5c=_0xfc3595?0x0:_0x3796c7['offset'];var _0x16ad2a=_0xfc3595?_0x21ac54[_0xbb10('0x33')]:_0x3796c7[_0xbb10('0x30')]+_0x3796c7['limit'];var _0x518d47;if(_0x16ad2a>=_0x221624){_0x16ad2a=_0x221624;_0x518d47=0xc8;}else{_0x518d47=0xce;}_0x4aabb9[_0xbb10('0x2d')](_0x518d47);return _0x4aabb9[_0xbb10('0x34')]('Content-Range',_0x448d5c+'-'+_0x16ad2a+'/'+_0x221624)[_0xbb10('0x2f')](_0x21ac54);}return null;};}function patchUpdates(_0x37dde7){return function(_0x2f653f){try{jsonpatch[_0xbb10('0x35')](_0x2f653f,_0x37dde7,!![]);}catch(_0x37a83f){return BPromise[_0xbb10('0x36')](_0x37a83f);}return _0x2f653f[_0xbb10('0x37')]();};}function saveUpdates(_0x4975f5,_0x25acb3){return function(_0x1da9c9){if(_0x1da9c9){return _0x1da9c9[_0xbb10('0x38')](_0x4975f5)[_0xbb10('0x22')](function(_0xfb2c5e){return _0xfb2c5e;});}return null;};}function removeEntity(_0x9de708,_0x188cbd){return function(_0x10202c){if(_0x10202c){return _0x10202c[_0xbb10('0x39')]()['then'](function(){_0x9de708[_0xbb10('0x2d')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x1ddd9e,_0x3c3c45){return function(_0x570f5a){if(!_0x570f5a){_0x1ddd9e[_0xbb10('0x3a')](0x194);}return _0x570f5a;};}function handleError(_0x5de37b,_0x4e2754){_0x4e2754=_0x4e2754||0x1f4;return function(_0x3eb3cc){logger[_0xbb10('0x28')](_0x3eb3cc[_0xbb10('0x3b')]);if(_0x3eb3cc[_0xbb10('0x3c')]){delete _0x3eb3cc[_0xbb10('0x3c')];}_0x5de37b[_0xbb10('0x2d')](_0x4e2754)['send'](_0x3eb3cc);};}exports[_0xbb10('0x3d')]=function(_0x25d72f,_0x52de31){var _0x5e3fbd={},_0x5cd55f={},_0x31bee3={'count':0x0,'rows':[]};var _0x2b0b45=_[_0xbb10('0x3e')](db['SmsMessage'][_0xbb10('0x3f')],function(_0x3e8538){return{'name':_0x3e8538[_0xbb10('0x40')],'type':_0x3e8538['type'][_0xbb10('0x41')]};});_0x5cd55f[_0xbb10('0x42')]=_[_0xbb10('0x3e')](_0x2b0b45,_0xbb10('0x3c'));_0x5cd55f['query']=_[_0xbb10('0x43')](_0x25d72f[_0xbb10('0x44')]);_0x5cd55f['filters']=_[_0xbb10('0x45')](_0x5cd55f[_0xbb10('0x42')],_0x5cd55f[_0xbb10('0x44')]);_0x5e3fbd[_0xbb10('0x46')]=_[_0xbb10('0x45')](_0x5cd55f[_0xbb10('0x42')],qs['fields'](_0x25d72f[_0xbb10('0x44')][_0xbb10('0x47')]));_0x5e3fbd[_0xbb10('0x46')]=_0x5e3fbd[_0xbb10('0x46')]['length']?_0x5e3fbd[_0xbb10('0x46')]:_0x5cd55f[_0xbb10('0x42')];if(!_0x25d72f[_0xbb10('0x44')][_0xbb10('0x48')]('nolimit')){_0x5e3fbd[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x25d72f['query']['limit']);_0x5e3fbd[_0xbb10('0x30')]=qs['offset'](_0x25d72f[_0xbb10('0x44')][_0xbb10('0x30')]);}_0x5e3fbd['order']=qs[_0xbb10('0x49')](_0x25d72f[_0xbb10('0x44')][_0xbb10('0x49')]);_0x5e3fbd['where']=qs[_0xbb10('0x4a')](_[_0xbb10('0x4b')](_0x25d72f[_0xbb10('0x44')],_0x5cd55f[_0xbb10('0x4a')]),_0x2b0b45);if(_0x25d72f[_0xbb10('0x44')][_0xbb10('0x4c')]){_0x5e3fbd[_0xbb10('0x4d')]=_[_0xbb10('0x4e')](_0x5e3fbd[_0xbb10('0x4d')],{'$or':_[_0xbb10('0x3e')](_0x2b0b45,function(_0x197871){if(_0x197871[_0xbb10('0x4f')]!=='VIRTUAL'){var _0x426b95={};_0x426b95[_0x197871[_0xbb10('0x3c')]]={'$like':'%'+_0x25d72f['query'][_0xbb10('0x4c')]+'%'};return _0x426b95;}})});}_0x5e3fbd=_[_0xbb10('0x4e')]({},_0x5e3fbd,_0x25d72f[_0xbb10('0x50')]);var _0x5a5226={'where':_0x5e3fbd[_0xbb10('0x4d')]};return db[_0xbb10('0x51')][_0xbb10('0x33')](_0x5a5226)['then'](function(_0x4a9793){_0x31bee3[_0xbb10('0x33')]=_0x4a9793;if(_0x25d72f[_0xbb10('0x44')][_0xbb10('0x52')]){_0x5e3fbd['include']=[{'all':!![]}];}return db['SmsMessage'][_0xbb10('0x53')](_0x5e3fbd);})[_0xbb10('0x22')](function(_0x1bd054){_0x31bee3[_0xbb10('0x54')]=_0x1bd054;return _0x31bee3;})[_0xbb10('0x22')](respondWithFilteredResult(_0x52de31,_0x5e3fbd))[_0xbb10('0x2c')](handleError(_0x52de31,null));};exports[_0xbb10('0x55')]=function(_0x460788,_0x2626d8){var _0x3d7e7e={'raw':!![],'where':{'id':_0x460788['params']['id']}},_0x550111={};_0x550111[_0xbb10('0x42')]=_[_0xbb10('0x43')](db[_0xbb10('0x51')][_0xbb10('0x3f')]);_0x550111[_0xbb10('0x44')]=_[_0xbb10('0x43')](_0x460788[_0xbb10('0x44')]);_0x550111[_0xbb10('0x4a')]=_[_0xbb10('0x45')](_0x550111[_0xbb10('0x42')],_0x550111[_0xbb10('0x44')]);_0x3d7e7e[_0xbb10('0x46')]=_[_0xbb10('0x45')](_0x550111[_0xbb10('0x42')],qs[_0xbb10('0x47')](_0x460788['query'][_0xbb10('0x47')]));_0x3d7e7e['attributes']=_0x3d7e7e[_0xbb10('0x46')][_0xbb10('0x56')]?_0x3d7e7e[_0xbb10('0x46')]:_0x550111[_0xbb10('0x42')];if(_0x460788[_0xbb10('0x44')][_0xbb10('0x52')]){_0x3d7e7e[_0xbb10('0x57')]=[{'all':!![]}];}_0x3d7e7e=_[_0xbb10('0x4e')]({},_0x3d7e7e,_0x460788[_0xbb10('0x50')]);return db[_0xbb10('0x51')][_0xbb10('0x58')](_0x3d7e7e)[_0xbb10('0x22')](handleEntityNotFound(_0x2626d8,null))[_0xbb10('0x22')](respondWithResult(_0x2626d8,null))[_0xbb10('0x2c')](handleError(_0x2626d8,null));};exports[_0xbb10('0x59')]=function(_0x5de0cc,_0x4571b6){return db[_0xbb10('0x51')][_0xbb10('0x59')](_0x5de0cc[_0xbb10('0x5a')],{})[_0xbb10('0x22')](respondWithResult(_0x4571b6,0xc9))[_0xbb10('0x2c')](handleError(_0x4571b6,null));};exports['update']=function(_0x120bda,_0x4731ce){if(_0x120bda[_0xbb10('0x5a')]['id']){delete _0x120bda[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x51')][_0xbb10('0x58')]({'where':{'id':_0x120bda[_0xbb10('0x5b')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4731ce,null))[_0xbb10('0x22')](saveUpdates(_0x120bda[_0xbb10('0x5a')],null))[_0xbb10('0x22')](respondWithResult(_0x4731ce,null))[_0xbb10('0x2c')](handleError(_0x4731ce,null));};exports[_0xbb10('0x39')]=function(_0x4e7fac,_0x4ea1a6){return db[_0xbb10('0x51')][_0xbb10('0x58')]({'where':{'id':_0x4e7fac[_0xbb10('0x5b')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4ea1a6,null))['then'](removeEntity(_0x4ea1a6,null))['catch'](handleError(_0x4ea1a6,null));};exports[_0xbb10('0x5c')]=function(_0xaf2cc3,_0x410bef){return db[_0xbb10('0x51')][_0xbb10('0x5c')]()[_0xbb10('0x22')](respondWithResult(_0x410bef,null))[_0xbb10('0x2c')](handleError(_0x410bef,null));};var interaction_log=require('../../config/logger')(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x4917a5,_0x5e03cb,_0x5a231f){var _0x32c1e8={'agent':{},'channel':_0xbb10('0x5f')};if(_0x4917a5[_0xbb10('0x5a')]['id']){delete _0x4917a5['body']['id'];}_0x4917a5['body']['read']=!![];_0x4917a5[_0xbb10('0x5a')][_0xbb10('0x60')]=moment()[_0xbb10('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x4917a5[_0xbb10('0x5a')][_0xbb10('0x62')]=_0x4917a5['body']['UserId']||_0x4917a5[_0xbb10('0x63')]['id'];_0x32c1e8[_0xbb10('0x64')]['id']=_0x4917a5[_0xbb10('0x5a')][_0xbb10('0x62')];return db['SmsMessage'][_0xbb10('0x58')]({'where':{'id':_0x4917a5[_0xbb10('0x5b')]['id'],'UserId':null}})[_0xbb10('0x22')](handleEntityNotFound(_0x5e03cb,null))['then'](saveUpdates(_0x4917a5[_0xbb10('0x5a')],null))[_0xbb10('0x22')](function(_0x3e3617){if(_0x3e3617){_0x32c1e8['message']=_0x3e3617[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x58')]({'where':{'id':_0x3e3617[_0xbb10('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x5e03cb,null))[_0xbb10('0x22')](function(_0x258e55){if(_0x258e55){return _0x258e55[_0xbb10('0x38')]({'UserId':_0x4917a5[_0xbb10('0x5a')]['UserId'],'read1stAt':_[_0xbb10('0x68')](_0x258e55[_0xbb10('0x69')])?moment()[_0xbb10('0x61')](_0xbb10('0x6a')):undefined});}return null;})[_0xbb10('0x22')](function(_0x17807e){if(_0x17807e){_0x32c1e8[_0xbb10('0x6b')]=_0x17807e['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4917a5[_0xbb10('0x63')]['id'],_0x4917a5[_0xbb10('0x63')][_0xbb10('0x3c')],_0x4917a5['user']['role'],_0x32c1e8[_0xbb10('0x6b')]['id'],_0x4917a5[_0xbb10('0x5a')]?JSON[_0xbb10('0x27')](_0x4917a5[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x32c1e8);}return null;})[_0xbb10('0x22')](function(_0x15fae2){var _0x270fdb=_0xbb10('0x6e')+_0x15fae2[_0xbb10('0x2a')]['ContactId'];return db['sequelize']['query'](_0x270fdb,{'type':db[_0xbb10('0x6f')][_0xbb10('0x70')][_0xbb10('0x71')],'raw':!![]})[_0xbb10('0x22')](function(_0x2f7d2a){return _0x2f7d2a;});})[_0xbb10('0x22')](function(_0x5d942d){if(_0x5d942d){_0x32c1e8[_0xbb10('0x2a')]['contact']=_0x5d942d[0x0];if(!_0x4917a5['body']['UserId'])return;return db[_0xbb10('0x72')][_0xbb10('0x58')]({'where':{'id':_0x4917a5[_0xbb10('0x5a')][_0xbb10('0x62')],'role':'agent'},'attributes':['id',_0xbb10('0x3c'),'fullname','email',_0xbb10('0x73')],'raw':!![]});}return null;})[_0xbb10('0x22')](function(_0x29529c){if(!_0x29529c)return null;_0x32c1e8[_0xbb10('0x2a')][_0xbb10('0x64')]=_0x29529c;return _0x32c1e8;})['then'](function(_0x2d52ea){if(_0x2d52ea){if(_0x4917a5[_0xbb10('0x5a')][_0xbb10('0x74')]){_0x32c1e8[_0xbb10('0x2a')][_0xbb10('0x75')]=util[_0xbb10('0x61')](_0xbb10('0x76'),_0x4917a5['user'][_0xbb10('0x3c')]);_0x32c1e8[_0xbb10('0x2a')][_0xbb10('0x77')]=_0x32c1e8[_0xbb10('0x77')];_0x32c1e8[_0xbb10('0x2a')][_0xbb10('0x78')]=_0xbb10('0x5e');return respondWithRpcPromise(_0xbb10('0x79'),'EventManager',{'event':_0xbb10('0x7a'),'message':_0x32c1e8[_0xbb10('0x2a')]},client9002)[_0xbb10('0x22')](function(){return _0x32c1e8;});}return _0x32c1e8;}return null;})['then'](respondWithResult(_0x5e03cb,null))['catch'](handleError(_0x5e03cb,null));};var interaction_log=require('../../config/logger')(_0xbb10('0x5d'));exports['reject']=function(_0x4e3d6a,_0x1701c5,_0x3ee56b){var _0x33ff06={'agent':{},'channel':_0xbb10('0x5f')};if(_0x4e3d6a[_0xbb10('0x5a')]['id']){delete _0x4e3d6a[_0xbb10('0x5a')]['id'];}_0x4e3d6a[_0xbb10('0x5a')][_0xbb10('0x62')]=_0x4e3d6a[_0xbb10('0x5a')]['UserId']||_0x4e3d6a[_0xbb10('0x63')]['id'];_0x33ff06[_0xbb10('0x64')]['id']=_0x4e3d6a[_0xbb10('0x5a')][_0xbb10('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x4e3d6a[_0xbb10('0x5b')]['id'],'UserId':null}})[_0xbb10('0x22')](handleEntityNotFound(_0x1701c5,null))[_0xbb10('0x22')](function(_0x32bb25){if(_0x32bb25){_0x33ff06['message']=_0x32bb25[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x58')]({'where':{'id':_0x32bb25[_0xbb10('0x67')]}});}return null;})[_0xbb10('0x22')](handleEntityNotFound(_0x1701c5,null))['then'](function(_0x5f0691){if(_0x5f0691){_0x33ff06[_0xbb10('0x6b')]=_0x5f0691[_0xbb10('0x65')]({'plain':!![]});interaction_log[_0xbb10('0x23')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e3d6a[_0xbb10('0x63')]['id'],_0x4e3d6a[_0xbb10('0x63')]['name'],_0x4e3d6a['user'][_0xbb10('0x7b')],_0x33ff06[_0xbb10('0x6b')]['id'],_0x4e3d6a[_0xbb10('0x5a')]?JSON['stringify'](_0x4e3d6a[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x7c'),_0xbb10('0x7d'),_0x33ff06);}return null;})[_0xbb10('0x22')](function(_0x5de006){var _0x45bd4e=_0xbb10('0x6e')+_0x5de006[_0xbb10('0x2a')]['ContactId'];return db[_0xbb10('0x7e')][_0xbb10('0x44')](_0x45bd4e,{'type':db[_0xbb10('0x6f')][_0xbb10('0x70')][_0xbb10('0x71')],'raw':!![]})[_0xbb10('0x22')](function(_0x33a6fc){return _0x33a6fc;});})[_0xbb10('0x22')](function(_0x17ed20){if(_0x17ed20){_0x33ff06[_0xbb10('0x2a')][_0xbb10('0x7f')]=_0x17ed20[0x0];if(!_0x4e3d6a[_0xbb10('0x5a')]['UserId'])return;return db['User'][_0xbb10('0x58')]({'where':{'id':_0x4e3d6a[_0xbb10('0x5a')][_0xbb10('0x62')],'role':_0xbb10('0x64')},'attributes':['id',_0xbb10('0x3c'),'fullname',_0xbb10('0x80'),_0xbb10('0x73')],'raw':!![]});}return null;})[_0xbb10('0x22')](function(_0x1a51d3){if(!_0x1a51d3)return null;_0x33ff06[_0xbb10('0x2a')][_0xbb10('0x64')]=_0x1a51d3;return _0x33ff06;})['then'](function(_0xb25e71){if(_0xb25e71){_0xb25e71[_0xbb10('0x2a')]['interface']=util[_0xbb10('0x61')]('SIP/%s',_0x4e3d6a[_0xbb10('0x63')][_0xbb10('0x3c')]);_0xb25e71[_0xbb10('0x2a')][_0xbb10('0x77')]=_0x33ff06[_0xbb10('0x77')];_0xb25e71['message'][_0xbb10('0x78')]='reject';respondWithRpcPromise(_0xbb10('0x79'),_0xbb10('0x79'),{'event':'rejectmessage','message':_0xb25e71['message']},client9002);return _0x33ff06;}return null;})[_0xbb10('0x22')](respondWithResult(_0x1701c5,null))[_0xbb10('0x2c')](handleError(_0x1701c5,null));};exports[_0xbb10('0x2d')]=function(_0x283bab,_0x18d18d,_0x1cb22f){if(_0x283bab[_0xbb10('0x5a')]['id']){delete _0x283bab[_0xbb10('0x5a')]['id'];}var _0x252ab8;return db[_0xbb10('0x51')][_0xbb10('0x58')]({'where':{'id':_0x283bab['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x18d18d,null))[_0xbb10('0x22')](function(_0x1b0a6c){if(_0x1b0a6c){_0x252ab8=_0x1b0a6c;return db[_0xbb10('0x81')][_0xbb10('0x58')]({'where':{'id':_0x1b0a6c[_0xbb10('0x82')]}});}})[_0xbb10('0x22')](handleEntityNotFound(_0x18d18d,null))[_0xbb10('0x22')](function(_0x3e6fe2){if(_0x3e6fe2){logger[_0xbb10('0x26')](_0xbb10('0x83'),_0xbb10('0x2d'),'received\x20delivery\x20report\x20from',_0x3e6fe2[_0xbb10('0x4f')],util['inspect'](_0x283bab[_0xbb10('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3e6fe2[_0xbb10('0x4f')]){case _0xbb10('0x84'):if(_0x283bab[_0xbb10('0x5a')][_0xbb10('0x85')]&&_0x283bab['body'][_0xbb10('0x85')]===_0x252ab8[_0xbb10('0x86')]){return _0x252ab8[_0xbb10('0x38')]({'read':!![]});}else{logger[_0xbb10('0x28')](_0xbb10('0x87'),_0xbb10('0x2d'),'twilio',util['inspect'](_0x283bab[_0xbb10('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xbb10('0x88'):if(_0x283bab[_0xbb10('0x5a')]['MessageUUID']&&_0x283bab[_0xbb10('0x5a')][_0xbb10('0x89')]===_0x252ab8['messageId']&&_[_0xbb10('0x8a')]([_0xbb10('0x8b'),'delivered'],_0x283bab[_0xbb10('0x5a')]['Status'])>=0x0){return _0x252ab8[_0xbb10('0x38')]({'read':!![]});}else{logger[_0xbb10('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbb10('0x2d'),_0xbb10('0x8c'),util['inspect'](_0x283bab['body'],{'showHidden':![],'depth':null}));}break;case _0xbb10('0x8d'):var _0x13ae83=_0x283bab[_0xbb10('0x5a')][_0xbb10('0x8e')][0x0];if(_0x13ae83[_0xbb10('0x2d')]['groupName']===_0xbb10('0x8f')){return _0x252ab8[_0xbb10('0x38')]({'read':!![]});}else{logger[_0xbb10('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbb10('0x2d'),_0xbb10('0x8d'),util[_0xbb10('0x90')](_0x283bab[_0xbb10('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x252ab8;}})[_0xbb10('0x22')](respondWithResult(_0x18d18d,null))[_0xbb10('0x2c')](handleError(_0x18d18d,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d12e78c..95859ef 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 _0xcc9e=['exports','events','../../mysqldb','SmsMessage','save','update','emit','hook'];(function(_0x262a91,_0x52295c){var _0x33f13c=function(_0x207184){while(--_0x207184){_0x262a91['push'](_0x262a91['shift']());}};_0x33f13c(++_0x52295c);}(_0xcc9e,0xe1));var _0xecc9=function(_0x2ebb49,_0x51243c){_0x2ebb49=_0x2ebb49-0x0;var _0x1795a4=_0xcc9e[_0x2ebb49];return _0x1795a4;};'use strict';var EventEmitter=require(_0xecc9('0x0'));var SmsMessage=require(_0xecc9('0x1'))['db'][_0xecc9('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xecc9('0x3'),'afterUpdate':_0xecc9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b3fc6){return function(_0x1dc958,_0x1b8da3,_0x269a4d){SmsMessageEvents[_0xecc9('0x5')](_0x1b3fc6+':'+_0x1dc958['id'],_0x1dc958);SmsMessageEvents[_0xecc9('0x5')](_0x1b3fc6,_0x1dc958);_0x269a4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xecc9('0x6')](e,emitEvent(event));}}module[_0xecc9('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x1cdc=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x1cdc,0x1d6));var _0xc1cd=function(_0x5cd227,_0x3583d5){_0x5cd227=_0x5cd227-0x0;var _0x3dcdfb=_0x1cdc[_0x5cd227];return _0x3dcdfb;};'use strict';var EventEmitter=require(_0xc1cd('0x0'));var SmsMessage=require(_0xc1cd('0x1'))['db'][_0xc1cd('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc1cd('0x3')](0x0);var events={'afterCreate':_0xc1cd('0x4'),'afterUpdate':_0xc1cd('0x5'),'afterDestroy':_0xc1cd('0x6')};function emitEvent(_0x56ed1e){return function(_0x1a3c15,_0x325100,_0x11ddf1){SmsMessageEvents[_0xc1cd('0x7')](_0x56ed1e+':'+_0x1a3c15['id'],_0x1a3c15);SmsMessageEvents[_0xc1cd('0x7')](_0x56ed1e,_0x1a3c15);_0x11ddf1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xc1cd('0x8')](e,emitEvent(event));}}module[_0xc1cd('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 8eb7d10..ca5f577 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 _0xfc73=['https://platform.clickatell.com/messages','uuid','UTF-8','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','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','models','get','direction','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','toLowerCase','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','remote','/api/sms/messages/','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','phone','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','%s:%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','format','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/status?token=','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','length','createHash','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell'];(function(_0x266dab,_0x211142){var _0x2acc69=function(_0x33c40e){while(--_0x33c40e){_0x266dab['push'](_0x266dab['shift']());}};_0x2acc69(++_0x211142);}(_0xfc73,0x8d));var _0x3fc7=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xfc73[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var logger=require('../../config/logger')(_0x3fc7('0x2'));var moment=require(_0x3fc7('0x3'));var BPromise=require(_0x3fc7('0x4'));var rp=require(_0x3fc7('0x5'));var fs=require('fs');var path=require(_0x3fc7('0x6'));var rimraf=require(_0x3fc7('0x7'));var config=require(_0x3fc7('0x8'));var attributes=require(_0x3fc7('0x9'));module[_0x3fc7('0xa')]=function(_0x1039e0,_0x262417){return _0x1039e0[_0x3fc7('0xb')]('SmsMessage',attributes,{'tableName':_0x3fc7('0xc'),'paranoid':![],'indexes':[{'name':_0x3fc7('0xd'),'fields':[_0x3fc7('0xd')]},{'name':_0x3fc7('0xe'),'fields':[_0x3fc7('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a0444,_0x434c84,_0x1dc32b){var _0x1f9da3=_0x1039e0[_0x3fc7('0x10')];var _0x1af753=_0x5a0444[_0x3fc7('0x11')]({'plain':!![]});if(_0x1af753['direction']['toLowerCase']()==='in'||_0x1af753[_0x3fc7('0x12')]['toLowerCase']()===_0x3fc7('0x13')&&!_0x1af753[_0x3fc7('0x14')]&&!_[_0x3fc7('0x15')](_0x1af753[_0x3fc7('0x16')])){_0x1f9da3['SmsInteraction'][_0x3fc7('0x17')]({'where':{'id':_0x1af753[_0x3fc7('0x18')]}})[_0x3fc7('0x19')](function(_0x34db32){if(_0x34db32){_0x34db32[_0x3fc7('0x1a')]({'lastMsgAt':_0x1af753[_0x3fc7('0x1b')],'lastMsgDirection':_0x1af753[_0x3fc7('0x12')][_0x3fc7('0x1c')]()});}})[_0x3fc7('0x1d')](function(_0x1c1f91){console[_0x3fc7('0x1e')](_0x1c1f91);});}if(_0x1af753[_0x3fc7('0x12')]===_0x3fc7('0x13')&&!_0x1af753[_0x3fc7('0x14')]){var _0x1bafae;_0x1f9da3[_0x3fc7('0x1f')][_0x3fc7('0x20')]({'where':{'id':_0x1af753[_0x3fc7('0x21')]},'raw':!![]})[_0x3fc7('0x19')](function(_0x502490){_0x1bafae=_0x502490;if(_0x1bafae&&_0x1bafae['type']){switch(_0x1bafae[_0x3fc7('0x22')]){case'twilio':var _0x4e4997=require(_0x3fc7('0x23'));if(_0x1bafae[_0x3fc7('0x24')]&&_0x1bafae[_0x3fc7('0x25')]&&_0x1bafae['phone']){var _0x4fa736=new _0x4e4997(_0x1bafae[_0x3fc7('0x24')],_0x1bafae[_0x3fc7('0x25')]);_0x4fa736[_0x3fc7('0x26')][_0x3fc7('0x27')]({'body':_0x1af753[_0x3fc7('0xf')],'to':_0x1af753['phone'],'from':_0x1bafae['phone'],'statusCallback':_0x1bafae[_0x3fc7('0x28')]+_0x3fc7('0x29')+_0x1af753['id']+'/status?token='+_0x1bafae['token']})['then'](function(_0x456ddc){if(_0x456ddc[_0x3fc7('0x2a')]){return _0x5a0444['update']({'messageId':_0x456ddc['sid']});}})[_0x3fc7('0x1d')](function(_0x89343e){logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x23'),util[_0x3fc7('0x2d')](_0x89343e,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x23'),_0x3fc7('0x2e'));}break;case _0x3fc7('0x2f'):var _0x32d567='https://api.skebby.it/API/v1.0/REST/';if(_0x1bafae[_0x3fc7('0x30')]&&_0x1bafae[_0x3fc7('0x31')]){var _0x4dcfef={'recipient':[_0x1af753[_0x3fc7('0x32')]],'message':_0x1af753[_0x3fc7('0xf')],'message_type':_0x1bafae[_0x3fc7('0x33')]};if(_0x1bafae[_0x3fc7('0x33')]&&_0x1bafae['smsMethod']!=='SI'){_0x4dcfef[_0x3fc7('0x34')]=_0x1bafae[_0x3fc7('0x32')];}var _0x327a0e={'url':_0x32d567+_0x3fc7('0x35')+_0x1bafae[_0x3fc7('0x30')]+_0x3fc7('0x36')+_0x1bafae[_0x3fc7('0x31')],'method':_0x3fc7('0x37')};rp(_0x327a0e)['then'](function(_0x28efc1){var _0x162bdd=_0x28efc1[_0x3fc7('0x38')](';');var _0x513ca8={'user_key':_0x162bdd[0x0],'session_key':_0x162bdd[0x1]};_0x327a0e={'url':_0x32d567+_0x3fc7('0x39'),'method':_0x3fc7('0x3a'),'headers':{'user_key':_0x513ca8[_0x3fc7('0x3b')],'Session_key':_0x513ca8[_0x3fc7('0x3c')]},'json':!![],'body':_0x4dcfef};return rp(_0x327a0e);})[_0x3fc7('0x19')](function(_0x421a5f){if(_0x421a5f['total_sent']>=0x1){var _0x5d205c={'messageId':_0x421a5f[_0x3fc7('0x3d')]};if(_0x1bafae[_0x3fc7('0x33')]!=='GP'||!_0x1bafae[_0x3fc7('0x3e')]){_0x5d205c[_0x3fc7('0x3f')]=!![];}return _0x5a0444['update'](_0x5d205c);}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'skebby',util[_0x3fc7('0x2d')](_0x421a5f,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x3948af){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),'skebby',util[_0x3fc7('0x2d')](_0x3948af,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x2f'),_0x3fc7('0x40'));}break;case _0x3fc7('0x41'):if(_0x1bafae[_0x3fc7('0x25')]){var _0x1e97eb={'recipient':_0x1af753['phone'],'message':_0x1af753['body'],'sender':_0x1bafae['senderString']||_0x1bafae['phone'],'authorization':_0x1bafae['authToken']};var _0x434c84={'method':_0x3fc7('0x3a'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1e97eb,'json':!![]};rp(_0x434c84)[_0x3fc7('0x19')](function(_0x178fbc){var _0x2c6942={'messageId':_0x178fbc['requestid']};if(!_0x1bafae['deliveryReport']){_0x2c6942[_0x3fc7('0x3f')]=!![];}return _0x5a0444['update'](_0x2c6942);})[_0x3fc7('0x1d')](function(_0x29c65a){logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x41'),util[_0x3fc7('0x2d')](_0x29c65a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x41'),_0x3fc7('0x42'));}break;case _0x3fc7('0x43'):if(_0x1bafae['username']&&_0x1bafae[_0x3fc7('0x31')]){var _0x1e97eb={'messages':[{'source':_0x3fc7('0x44'),'to':_0x1af753[_0x3fc7('0x32')],'body':_0x1af753[_0x3fc7('0xf')],'from':_0x1bafae[_0x3fc7('0x45')]||_0x1bafae['phone']}]};var _0x2aebd2=util['format'](_0x3fc7('0x46'),_0x1bafae[_0x3fc7('0x30')],_0x1bafae['password']);var _0x434c84={'method':_0x3fc7('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1e97eb,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2aebd2)[_0x3fc7('0x47')](_0x3fc7('0x48')))},'json':!![]};rp(_0x434c84)[_0x3fc7('0x19')](function(_0x46042b){if(_0x46042b[_0x3fc7('0x49')]>=0xc8&&_0x46042b[_0x3fc7('0x49')]<=0xce){if(_0x46042b[_0x3fc7('0x4a')]&&_0x46042b[_0x3fc7('0x4a')][_0x3fc7('0x4b')]>0x0){var _0x7e22a3=_[_0x3fc7('0x4c')](_0x46042b[_0x3fc7('0x4a')]['messages']);var _0x1c2307={'messageId':_0x7e22a3[_0x3fc7('0x4d')]};if(!_0x1bafae[_0x3fc7('0x3e')]){_0x1c2307[_0x3fc7('0x3f')]=!![];}return _0x5a0444[_0x3fc7('0x1a')](_0x1c2307);}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x4e'),util['inspect'](_0x46042b,{'showHidden':![],'depth':null}));}}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x4e'),util[_0x3fc7('0x2d')](_0x46042b,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x36689d){logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),_0x3fc7('0x4e'),util[_0x3fc7('0x2d')](_0x36689d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x4e'),_0x3fc7('0x40'));}break;case _0x3fc7('0x4f'):if(_0x1bafae[_0x3fc7('0x50')]&&_0x1bafae['authToken']){var _0x1e97eb={'dst':_0x1af753[_0x3fc7('0x32')],'text':_0x1af753['body'],'src':_0x1bafae[_0x3fc7('0x45')]||_0x1bafae[_0x3fc7('0x32')],'url':_0x1bafae['remote']+'/api/sms/messages/'+_0x1af753['id']+'/status?token='+_0x1bafae['token']};var _0x2aebd2=util[_0x3fc7('0x51')](_0x3fc7('0x46'),_0x1bafae[_0x3fc7('0x50')],_0x1bafae['authToken']);var _0x434c84={'method':_0x3fc7('0x3a'),'uri':util[_0x3fc7('0x51')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1bafae[_0x3fc7('0x50')]),'body':_0x1e97eb,'headers':{'Authorization':util[_0x3fc7('0x51')](_0x3fc7('0x52'),new Buffer(_0x2aebd2)[_0x3fc7('0x47')](_0x3fc7('0x48')))},'json':!![]};rp(_0x434c84)[_0x3fc7('0x19')](function(_0x4ce49e){var _0x4fe18a={'messageId':_0x4ce49e[_0x3fc7('0x53')][0x0]};return _0x5a0444[_0x3fc7('0x1a')](_0x4fe18a);})['catch'](function(_0x3edea6){logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fc7('0x4f'),util[_0x3fc7('0x2d')](_0x3edea6,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),_0x3fc7('0x4f'),_0x3fc7('0x54'));}break;case _0x3fc7('0x55'):if(_0x1bafae[_0x3fc7('0x30')]&&_0x1bafae[_0x3fc7('0x31')]){if(_0x1bafae[_0x3fc7('0x56')]){var _0x30777b={'method':_0x3fc7('0x3a'),'uri':_0x1bafae['baseUrl']+'/auth/1/session','body':{'username':_0x1bafae[_0x3fc7('0x30')],'password':_0x1bafae[_0x3fc7('0x31')]},'json':!![]};return rp(_0x30777b)[_0x3fc7('0x19')](function(_0x3e037a){var _0xf48f0e={'method':_0x3fc7('0x3a'),'uri':_0x1bafae['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1bafae['phone'],'destinations':[{'to':_0x1af753['phone']}],'text':_0x1af753[_0x3fc7('0xf')],'notifyUrl':_0x1bafae[_0x3fc7('0x28')]+_0x3fc7('0x29')+_0x1af753['id']+_0x3fc7('0x57')+_0x1bafae[_0x3fc7('0x58')],'notifyContentType':_0x3fc7('0x59'),'callbackData':_0x1bafae['phone']+';'+_0x1af753['body']}]},'headers':{'Authorization':_0x3fc7('0x5a')+_0x3e037a[_0x3fc7('0x58')]},'json':!![]};return rp(_0xf48f0e)['then'](function(_0x157dbf){if(_0x157dbf[_0x3fc7('0x26')]){var _0xaeee32={'messageId':_0x157dbf['messages'][0x0][_0x3fc7('0xd')]};if(!_0x1bafae[_0x3fc7('0x3e')]){_0xaeee32[_0x3fc7('0x3f')]=!![];}return _0x5a0444[_0x3fc7('0x1a')](_0xaeee32);}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'infobip',util[_0x3fc7('0x2d')](_0x157dbf,{'showHidden':![],'depth':null}));}});})[_0x3fc7('0x1d')](function(_0x2bdbc8){return logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fc7('0x55'),util[_0x3fc7('0x2d')](_0x2bdbc8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fc7('0x55'),_0x3fc7('0x5b'));}}else{logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),'infobip',_0x3fc7('0x40'));}break;case _0x3fc7('0x5c'):var _0x2b6e35=require(_0x3fc7('0x5d'));if(_0x1bafae[_0x3fc7('0x5e')]){var _0x356e0f={};_0x356e0f['login']=_0x1bafae[_0x3fc7('0x30')];_0x356e0f[_0x3fc7('0x32')]=_0x1af753[_0x3fc7('0x32')];_0x356e0f[_0x3fc7('0x34')]=_0x1bafae[_0x3fc7('0x32')];_0x356e0f[_0x3fc7('0x5f')]=_0x1af753['body'];_0x356e0f[_0x3fc7('0x60')]=+new Date();var _0x5b9b84='';var _0x8da743='';var _0x3e80c5=Object[_0x3fc7('0x61')](_0x356e0f);_0x3e80c5['sort']();for(var _0x3125fe=0x0;_0x3125fe<_0x3e80c5[_0x3fc7('0x62')];_0x3125fe++){if(_0x5b9b84!=''){_0x5b9b84+='&';}_0x5b9b84+=_0x3e80c5[_0x3125fe]+'='+encodeURIComponent(_0x356e0f[_0x3e80c5[_0x3125fe]]);_0x8da743+=_0x356e0f[_0x3e80c5[_0x3125fe]];}_0x8da743+=_0x1bafae[_0x3fc7('0x5e')];_0x8da743=_0x2b6e35[_0x3fc7('0x63')]('md5')[_0x3fc7('0x1a')](_0x8da743)['digest'](_0x3fc7('0x64'));if(_0x5b9b84!==''){_0x5b9b84+='&';}_0x5b9b84+='signature='+_0x8da743;var _0x327a0e={'method':_0x3fc7('0x37'),'uri':_0x1bafae[_0x3fc7('0x56')]+_0x3fc7('0x65')+_0x5b9b84,'json':!![]};return rp(_0x327a0e)['then'](function(_0x7316c7){var _0x449931=Object[_0x3fc7('0x61')](_0x7316c7);if(_0x7316c7[_0x449931[0x0]][_0x3fc7('0x1e')]&&parseInt(_0x7316c7[_0x449931[0x0]][_0x3fc7('0x1e')])===0x0){var _0x15e129={'messageId':_0x7316c7[_0x449931[0x0]][_0x3fc7('0x66')]};if(!_0x1bafae[_0x3fc7('0x3e')]){_0x15e129[_0x3fc7('0x3f')]=!![];}return _0x5a0444['update'](_0x15e129);}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'csc',util[_0x3fc7('0x2d')](_0x7316c7[_0x3fc7('0x1e')],{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x3c2883){return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x5c'),util['inspect'](_0x3c2883,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),_0x3fc7('0x5c'),_0x3fc7('0x67'));}break;case _0x3fc7('0x68'):if(_0x1bafae['apiKey']){var _0x3e0cde={'method':_0x3fc7('0x3a'),'uri':_0x3fc7('0x69'),'headers':{'Authorization':_0x1bafae[_0x3fc7('0x5e')]},'body':{'content':_0x1af753[_0x3fc7('0xf')],'to':[_0x1af753[_0x3fc7('0x32')]],'from':_0x1bafae[_0x3fc7('0x32')],'binary':![],'clientMessageId':_0x3fc7('0x6a'),'charset':_0x3fc7('0x6b')},'json':!![]};rp(_0x3e0cde)[_0x3fc7('0x19')](function(_0x36c6a9){if(!_0x36c6a9[_0x3fc7('0x1e')]){var _0x546138={'messageId':_0x36c6a9[_0x3fc7('0x26')][0x0]['apiMessageId']};if(!_0x1bafae['deliveryReport']){_0x546138[_0x3fc7('0x3f')]=!![];}return _0x5a0444[_0x3fc7('0x1a')](_0x546138);}else{return logger['error'](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x68'),util[_0x3fc7('0x2d')](_0x36c6a9[_0x3fc7('0x1e')],{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x365a3b){return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'clickatell',util[_0x3fc7('0x2d')](_0x365a3b,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x68'),_0x3fc7('0x67'));}break;case _0x3fc7('0x6c'):if(_0x1bafae[_0x3fc7('0x30')]&&_0x1bafae[_0x3fc7('0x31')]){var _0x2aebd2=util[_0x3fc7('0x51')](_0x3fc7('0x46'),_0x1bafae[_0x3fc7('0x30')],_0x1bafae[_0x3fc7('0x31')]);var _0x434c84={'method':_0x3fc7('0x3a'),'uri':_0x3fc7('0x6d')+_0x1bafae[_0x3fc7('0x6e')]+'/messages','body':{'to':[_0x1af753[_0x3fc7('0x32')]],'text':_0x1af753[_0x3fc7('0xf')],'from':_0x1bafae[_0x3fc7('0x32')],'applicationId':_0x1bafae[_0x3fc7('0x6f')]},'headers':{'Authorization':util['format'](_0x3fc7('0x52'),new Buffer(_0x2aebd2)[_0x3fc7('0x47')](_0x3fc7('0x48')))},'json':!![]};rp(_0x434c84)['then'](function(_0x12e004){if(_0x12e004['id']){var _0x4c6505={'messageId':_0x12e004['id']};return _0x5a0444[_0x3fc7('0x1a')](_0x4c6505);}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),'afterCreate','bandwidth',util[_0x3fc7('0x2d')](_0x12e004,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x4ab93f){logger['error'](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x6c'),util[_0x3fc7('0x2d')](_0x4ab93f,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x6c'),_0x3fc7('0x40'));}break;case _0x3fc7('0x70'):if(_0x1bafae[_0x3fc7('0x5e')]){var _0xca1fa={};var _0x327a0e={'method':_0x3fc7('0x3a'),'uri':_0x3fc7('0x71'),'headers':{'Authorization':_0x3fc7('0x72')+_0x1bafae[_0x3fc7('0x5e')],'Content-Type':_0x3fc7('0x59')},'body':{'from':_0x1bafae['phone'],'to':_0x1af753[_0x3fc7('0x32')],'text':_0x1af753[_0x3fc7('0xf')]},'json':!![]};return rp(_0x327a0e)[_0x3fc7('0x19')](function(_0x5a05a3){if(_0x5a05a3[_0x3fc7('0x73')]==0xca){_0xca1fa[_0x3fc7('0x74')]=_0x5a05a3;var _0x400c79={'method':'POST','uri':_0x3fc7('0x75'),'headers':{'Authorization':_0x3fc7('0x72')+_0x1bafae['apiKey'],'Content-Type':_0x3fc7('0x59')},'body':{'refid':_0xca1fa[_0x3fc7('0x74')]['refid']},'json':!![]};return rp(_0x400c79)[_0x3fc7('0x19')](function(_0x280363){_0xca1fa[_0x3fc7('0x76')]=_0x280363;var _0x4d6d1e={'messageId':_0xca1fa[_0x3fc7('0x74')]['refid'],'read':!![]};return _0x5a0444['update'](_0x4d6d1e);});}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x70'),util[_0x3fc7('0x2d')](_0x5a05a3,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x59ef01){return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x70'),util['inspect'](_0x59ef01,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x70'),_0x3fc7('0x77'));}break;}}})[_0x3fc7('0x78')](function(){_0x1dc32b();});}else{_0x1dc32b();}}},'charset':_0x3fc7('0x79'),'collate':_0x3fc7('0x7a')});}; \ No newline at end of file +var _0x946e=['code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','update','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','&password=','GET','split','sms','user_key','session_key','total_sent','internal_order_id','read','connectel','POST','https://smsapi.connectel.se/api/v2/send/','deliveryReport','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','%s:%s','toString','base64','http_code','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','sender','text','sort','createHash','digest','hex','/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','accountId','applicationId','Basic\x20%s','https://api.intelepeer.com/_rest/v4/app/sms/send'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0x946e,0x1d0));var _0xe946=function(_0x53dcb8,_0x550e86){_0x53dcb8=_0x53dcb8-0x0;var _0x3751cd=_0x946e[_0x53dcb8];return _0x3751cd;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var logger=require(_0xe946('0x1'))('api');var moment=require(_0xe946('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe946('0x3'));var rimraf=require(_0xe946('0x4'));var config=require(_0xe946('0x5'));var attributes=require(_0xe946('0x6'));module[_0xe946('0x7')]=function(_0x49224a,_0x123d0c){return _0x49224a[_0xe946('0x8')](_0xe946('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xe946('0xa'),'fields':['messageId']},{'name':_0xe946('0xb'),'fields':[_0xe946('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47e7a1,_0x49e9fc,_0x286140){var _0x49b412=_0x49224a['models'];var _0x35a35a=_0x47e7a1[_0xe946('0xd')]({'plain':!![]});if(_0x35a35a['direction']['toLowerCase']()==='in'||_0x35a35a[_0xe946('0xe')][_0xe946('0xf')]()==='out'&&!_0x35a35a[_0xe946('0x10')]&&!_[_0xe946('0x11')](_0x35a35a[_0xe946('0x12')])){_0x49b412[_0xe946('0x13')][_0xe946('0x14')]({'where':{'id':_0x35a35a[_0xe946('0x15')]}})[_0xe946('0x16')](function(_0x5d0038){if(_0x5d0038){_0x5d0038['update']({'lastMsgAt':_0x35a35a[_0xe946('0x17')],'lastMsgDirection':_0x35a35a[_0xe946('0xe')][_0xe946('0xf')]()});}})['catch'](function(_0x96f4f){console[_0xe946('0x18')](_0x96f4f);});}if(_0x35a35a[_0xe946('0xe')]==='out'&&!_0x35a35a[_0xe946('0x10')]){var _0x1fbe13;_0x49b412[_0xe946('0x19')]['find']({'where':{'id':_0x35a35a[_0xe946('0x1a')]},'raw':!![]})[_0xe946('0x16')](function(_0x47bde2){_0x1fbe13=_0x47bde2;if(_0x1fbe13&&_0x1fbe13[_0xe946('0x1b')]){switch(_0x1fbe13['type']){case _0xe946('0x1c'):var _0x236693=require('twilio');if(_0x1fbe13[_0xe946('0x1d')]&&_0x1fbe13[_0xe946('0x1e')]&&_0x1fbe13[_0xe946('0x1f')]){var _0x957a6c=new _0x236693(_0x1fbe13[_0xe946('0x1d')],_0x1fbe13[_0xe946('0x1e')]);_0x957a6c[_0xe946('0x20')][_0xe946('0x21')]({'body':_0x35a35a[_0xe946('0xc')],'to':_0x35a35a[_0xe946('0x1f')],'from':_0x1fbe13['phone'],'statusCallback':_0x1fbe13[_0xe946('0x22')]+_0xe946('0x23')+_0x35a35a['id']+_0xe946('0x24')+_0x1fbe13[_0xe946('0x25')]})[_0xe946('0x16')](function(_0xc4d186){if(_0xc4d186['sid']){return _0x47e7a1[_0xe946('0x26')]({'messageId':_0xc4d186[_0xe946('0x27')]});}})[_0xe946('0x28')](function(_0xd3d3b7){logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x1c'),util[_0xe946('0x2b')](_0xd3d3b7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x1c'),_0xe946('0x2c'));}break;case _0xe946('0x2d'):var _0x475056='https://api.skebby.it/API/v1.0/REST/';if(_0x1fbe13[_0xe946('0x2e')]&&_0x1fbe13[_0xe946('0x2f')]){var _0x422beb={'recipient':[_0x35a35a[_0xe946('0x1f')]],'message':_0x35a35a[_0xe946('0xc')],'message_type':_0x1fbe13[_0xe946('0x30')]};if(_0x1fbe13[_0xe946('0x30')]&&_0x1fbe13[_0xe946('0x30')]!=='SI'){_0x422beb['sender']=_0x1fbe13[_0xe946('0x1f')];}var _0x3693d5={'url':_0x475056+'login?username='+_0x1fbe13[_0xe946('0x2e')]+_0xe946('0x31')+_0x1fbe13[_0xe946('0x2f')],'method':_0xe946('0x32')};rp(_0x3693d5)['then'](function(_0x39258e){var _0xbd026d=_0x39258e[_0xe946('0x33')](';');var _0x2aaac1={'user_key':_0xbd026d[0x0],'session_key':_0xbd026d[0x1]};_0x3693d5={'url':_0x475056+_0xe946('0x34'),'method':'POST','headers':{'user_key':_0x2aaac1[_0xe946('0x35')],'Session_key':_0x2aaac1[_0xe946('0x36')]},'json':!![],'body':_0x422beb};return rp(_0x3693d5);})[_0xe946('0x16')](function(_0x3d836a){if(_0x3d836a[_0xe946('0x37')]>=0x1){var _0x5093aa={'messageId':_0x3d836a[_0xe946('0x38')]};if(_0x1fbe13['smsMethod']!=='GP'||!_0x1fbe13['deliveryReport']){_0x5093aa[_0xe946('0x39')]=!![];}return _0x47e7a1['update'](_0x5093aa);}else{return logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),'skebby',util['inspect'](_0x3d836a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5d371c){return logger[_0xe946('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe946('0x2a'),_0xe946('0x2d'),util['inspect'](_0x5d371c,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe946('0x3a'):if(_0x1fbe13[_0xe946('0x1e')]){var _0x4e1acc={'recipient':_0x35a35a[_0xe946('0x1f')],'message':_0x35a35a[_0xe946('0xc')],'sender':_0x1fbe13['senderString']||_0x1fbe13[_0xe946('0x1f')],'authorization':_0x1fbe13[_0xe946('0x1e')]};var _0x49e9fc={'method':_0xe946('0x3b'),'uri':_0xe946('0x3c'),'body':_0x4e1acc,'json':!![]};rp(_0x49e9fc)[_0xe946('0x16')](function(_0x37d650){var _0x31a3dc={'messageId':_0x37d650['requestid']};if(!_0x1fbe13[_0xe946('0x3d')]){_0x31a3dc[_0xe946('0x39')]=!![];}return _0x47e7a1[_0xe946('0x26')](_0x31a3dc);})[_0xe946('0x28')](function(_0x3c1011){logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x3a'),util['inspect'](_0x3c1011,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),'connectel',_0xe946('0x3e'));}break;case'clicksend':if(_0x1fbe13['username']&&_0x1fbe13[_0xe946('0x2f')]){var _0x4e1acc={'messages':[{'source':_0xe946('0x3f'),'to':_0x35a35a['phone'],'body':_0x35a35a[_0xe946('0xc')],'from':_0x1fbe13[_0xe946('0x40')]||_0x1fbe13[_0xe946('0x1f')]}]};var _0x52c47d=util[_0xe946('0x41')](_0xe946('0x42'),_0x1fbe13[_0xe946('0x2e')],_0x1fbe13[_0xe946('0x2f')]);var _0x49e9fc={'method':_0xe946('0x3b'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4e1acc,'headers':{'Authorization':util[_0xe946('0x41')]('Basic\x20%s',new Buffer(_0x52c47d)[_0xe946('0x43')](_0xe946('0x44')))},'json':!![]};rp(_0x49e9fc)[_0xe946('0x16')](function(_0x323d44){if(_0x323d44['http_code']>=0xc8&&_0x323d44[_0xe946('0x45')]<=0xce){if(_0x323d44[_0xe946('0x46')]&&_0x323d44['data'][_0xe946('0x47')]>0x0){var _0x122e3d=_[_0xe946('0x48')](_0x323d44[_0xe946('0x46')][_0xe946('0x20')]);var _0x446f2a={'messageId':_0x122e3d['message_id']};if(!_0x1fbe13['deliveryReport']){_0x446f2a[_0xe946('0x39')]=!![];}return _0x47e7a1[_0xe946('0x26')](_0x446f2a);}else{logger[_0xe946('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe946('0x2a'),_0xe946('0x49'),util[_0xe946('0x2b')](_0x323d44,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xe946('0x29'),_0xe946('0x2a'),'clickSend',util[_0xe946('0x2b')](_0x323d44,{'showHidden':![],'depth':null}));}})[_0xe946('0x28')](function(_0x180dd2){logger[_0xe946('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe946('0x49'),util[_0xe946('0x2b')](_0x180dd2,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')](_0xe946('0x29'),'afterCreate',_0xe946('0x49'),_0xe946('0x4a'));}break;case'plivo':if(_0x1fbe13[_0xe946('0x4b')]&&_0x1fbe13[_0xe946('0x1e')]){var _0x4e1acc={'dst':_0x35a35a[_0xe946('0x1f')],'text':_0x35a35a[_0xe946('0xc')],'src':_0x1fbe13[_0xe946('0x40')]||_0x1fbe13[_0xe946('0x1f')],'url':_0x1fbe13[_0xe946('0x22')]+_0xe946('0x23')+_0x35a35a['id']+_0xe946('0x24')+_0x1fbe13[_0xe946('0x25')]};var _0x52c47d=util[_0xe946('0x41')](_0xe946('0x42'),_0x1fbe13[_0xe946('0x4b')],_0x1fbe13['authToken']);var _0x49e9fc={'method':'POST','uri':util[_0xe946('0x41')](_0xe946('0x4c'),_0x1fbe13[_0xe946('0x4b')]),'body':_0x4e1acc,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x52c47d)[_0xe946('0x43')](_0xe946('0x44')))},'json':!![]};rp(_0x49e9fc)['then'](function(_0x30f68f){var _0x2cc478={'messageId':_0x30f68f[_0xe946('0x4d')][0x0]};return _0x47e7a1[_0xe946('0x26')](_0x2cc478);})[_0xe946('0x28')](function(_0x41b15e){logger[_0xe946('0x18')](_0xe946('0x29'),'afterCreate','plivo',util[_0xe946('0x2b')](_0x41b15e,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x4e'),_0xe946('0x4f'));}break;case _0xe946('0x50'):if(_0x1fbe13[_0xe946('0x2e')]&&_0x1fbe13[_0xe946('0x2f')]){if(_0x1fbe13[_0xe946('0x51')]){var _0x5f258a={'method':'POST','uri':_0x1fbe13['baseUrl']+_0xe946('0x52'),'body':{'username':_0x1fbe13[_0xe946('0x2e')],'password':_0x1fbe13[_0xe946('0x2f')]},'json':!![]};return rp(_0x5f258a)['then'](function(_0x15e7ed){var _0x84f2f1={'method':_0xe946('0x3b'),'uri':_0x1fbe13[_0xe946('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1fbe13[_0xe946('0x1f')],'destinations':[{'to':_0x35a35a['phone']}],'text':_0x35a35a[_0xe946('0xc')],'notifyUrl':_0x1fbe13[_0xe946('0x22')]+_0xe946('0x23')+_0x35a35a['id']+_0xe946('0x24')+_0x1fbe13['token'],'notifyContentType':_0xe946('0x53'),'callbackData':_0x1fbe13['phone']+';'+_0x35a35a[_0xe946('0xc')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x15e7ed[_0xe946('0x25')]},'json':!![]};return rp(_0x84f2f1)[_0xe946('0x16')](function(_0x23ca85){if(_0x23ca85[_0xe946('0x20')]){var _0x3a8194={'messageId':_0x23ca85[_0xe946('0x20')][0x0][_0xe946('0xa')]};if(!_0x1fbe13['deliveryReport']){_0x3a8194[_0xe946('0x39')]=!![];}return _0x47e7a1['update'](_0x3a8194);}else{return logger[_0xe946('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe946('0x2a'),_0xe946('0x50'),util[_0xe946('0x2b')](_0x23ca85,{'showHidden':![],'depth':null}));}});})[_0xe946('0x28')](function(_0x39c3a7){return logger[_0xe946('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe946('0x2a'),_0xe946('0x50'),util['inspect'](_0x39c3a7,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe946('0x2a'),_0xe946('0x50'),_0xe946('0x54'));}}else{logger[_0xe946('0x18')](_0xe946('0x29'),'afterCreate','infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0xe946('0x55'):var _0x55eb1d=require(_0xe946('0x56'));if(_0x1fbe13[_0xe946('0x57')]){var _0x3d9ace={};_0x3d9ace['login']=_0x1fbe13['username'];_0x3d9ace[_0xe946('0x1f')]=_0x35a35a[_0xe946('0x1f')];_0x3d9ace[_0xe946('0x58')]=_0x1fbe13['phone'];_0x3d9ace[_0xe946('0x59')]=_0x35a35a[_0xe946('0xc')];_0x3d9ace['timestamp']=+new Date();var _0x4ee4b4='';var _0x5d4acb='';var _0x5dac28=Object['keys'](_0x3d9ace);_0x5dac28[_0xe946('0x5a')]();for(var _0xdbc6b9=0x0;_0xdbc6b9<_0x5dac28['length'];_0xdbc6b9++){if(_0x4ee4b4!=''){_0x4ee4b4+='&';}_0x4ee4b4+=_0x5dac28[_0xdbc6b9]+'='+encodeURIComponent(_0x3d9ace[_0x5dac28[_0xdbc6b9]]);_0x5d4acb+=_0x3d9ace[_0x5dac28[_0xdbc6b9]];}_0x5d4acb+=_0x1fbe13[_0xe946('0x57')];_0x5d4acb=_0x55eb1d[_0xe946('0x5b')]('md5')[_0xe946('0x26')](_0x5d4acb)[_0xe946('0x5c')](_0xe946('0x5d'));if(_0x4ee4b4!==''){_0x4ee4b4+='&';}_0x4ee4b4+='signature='+_0x5d4acb;var _0x3693d5={'method':_0xe946('0x32'),'uri':_0x1fbe13['baseUrl']+_0xe946('0x5e')+_0x4ee4b4,'json':!![]};return rp(_0x3693d5)['then'](function(_0x167e71){var _0x2e1686=Object[_0xe946('0x5f')](_0x167e71);if(_0x167e71[_0x2e1686[0x0]][_0xe946('0x18')]&&parseInt(_0x167e71[_0x2e1686[0x0]][_0xe946('0x18')])===0x0){var _0x1f59d7={'messageId':_0x167e71[_0x2e1686[0x0]]['id_sms']};if(!_0x1fbe13[_0xe946('0x3d')]){_0x1f59d7['read']=!![];}return _0x47e7a1[_0xe946('0x26')](_0x1f59d7);}else{return logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x55'),util['inspect'](_0x167e71[_0xe946('0x18')],{'showHidden':![],'depth':null}));}})[_0xe946('0x28')](function(_0x103eee){return logger['error'](_0xe946('0x29'),'afterCreate',_0xe946('0x55'),util[_0xe946('0x2b')](_0x103eee,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x55'),_0xe946('0x60'));}break;case _0xe946('0x61'):if(_0x1fbe13[_0xe946('0x57')]){var _0x5976d5={'method':_0xe946('0x3b'),'uri':_0xe946('0x62'),'headers':{'Authorization':_0x1fbe13[_0xe946('0x57')]},'body':{'content':_0x35a35a[_0xe946('0xc')],'to':[_0x35a35a[_0xe946('0x1f')]],'from':_0x1fbe13[_0xe946('0x1f')],'binary':![],'clientMessageId':_0xe946('0x63'),'charset':_0xe946('0x64')},'json':!![]};rp(_0x5976d5)[_0xe946('0x16')](function(_0x478d56){if(!_0x478d56[_0xe946('0x18')]){var _0x7e6b25={'messageId':_0x478d56[_0xe946('0x20')][0x0]['apiMessageId']};if(!_0x1fbe13[_0xe946('0x3d')]){_0x7e6b25[_0xe946('0x39')]=!![];}return _0x47e7a1['update'](_0x7e6b25);}else{return logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),'clickatell',util['inspect'](_0x478d56[_0xe946('0x18')],{'showHidden':![],'depth':null}));}})[_0xe946('0x28')](function(_0x26f9c1){return logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x61'),util[_0xe946('0x2b')](_0x26f9c1,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x61'),_0xe946('0x60'));}break;case _0xe946('0x65'):if(_0x1fbe13['username']&&_0x1fbe13[_0xe946('0x2f')]){var _0x52c47d=util[_0xe946('0x41')](_0xe946('0x42'),_0x1fbe13[_0xe946('0x2e')],_0x1fbe13[_0xe946('0x2f')]);var _0x49e9fc={'method':_0xe946('0x3b'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1fbe13[_0xe946('0x66')]+'/messages','body':{'to':[_0x35a35a[_0xe946('0x1f')]],'text':_0x35a35a[_0xe946('0xc')],'from':_0x1fbe13[_0xe946('0x1f')],'applicationId':_0x1fbe13[_0xe946('0x67')]},'headers':{'Authorization':util[_0xe946('0x41')](_0xe946('0x68'),new Buffer(_0x52c47d)[_0xe946('0x43')]('base64'))},'json':!![]};rp(_0x49e9fc)['then'](function(_0x4360b5){if(_0x4360b5['id']){var _0x454654={'messageId':_0x4360b5['id']};return _0x47e7a1[_0xe946('0x26')](_0x454654);}else{logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),'bandwidth',util[_0xe946('0x2b')](_0x4360b5,{'showHidden':![],'depth':null}));}})[_0xe946('0x28')](function(_0x44196f){logger[_0xe946('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe946('0x2a'),_0xe946('0x65'),util[_0xe946('0x2b')](_0x44196f,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x65'),_0xe946('0x4a'));}break;case'intelepeer':if(_0x1fbe13[_0xe946('0x57')]){var _0x2f7f96={};var _0x3693d5={'method':'POST','uri':_0xe946('0x69'),'headers':{'Authorization':'Bearer\x20'+_0x1fbe13['apiKey'],'Content-Type':_0xe946('0x53')},'body':{'from':_0x1fbe13[_0xe946('0x1f')],'to':_0x35a35a[_0xe946('0x1f')],'text':_0x35a35a[_0xe946('0xc')]},'json':!![]};return rp(_0x3693d5)[_0xe946('0x16')](function(_0x367fbc){if(_0x367fbc[_0xe946('0x6a')]==0xca){_0x2f7f96[_0xe946('0x6b')]=_0x367fbc;var _0x389baf={'method':'POST','uri':_0xe946('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x1fbe13[_0xe946('0x57')],'Content-Type':_0xe946('0x53')},'body':{'refid':_0x2f7f96[_0xe946('0x6b')][_0xe946('0x6d')]},'json':!![]};return rp(_0x389baf)[_0xe946('0x16')](function(_0x46f0a3){_0x2f7f96[_0xe946('0x6e')]=_0x46f0a3;var _0x2b25b8={'messageId':_0x2f7f96[_0xe946('0x6b')][_0xe946('0x6d')],'read':!![]};return _0x47e7a1[_0xe946('0x26')](_0x2b25b8);});}else{return logger[_0xe946('0x18')](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x6f'),util['inspect'](_0x367fbc,{'showHidden':![],'depth':null}));}})[_0xe946('0x28')](function(_0x58fa29){return logger['error'](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x6f'),util['inspect'](_0x58fa29,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xe946('0x29'),_0xe946('0x2a'),_0xe946('0x6f'),_0xe946('0x70'));}break;}}})['finally'](function(){_0x286140();});}else{_0x286140();}}},'charset':'utf8mb4','collate':_0xe946('0x71')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index cb3a9ec..3be2975 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 _0x699b=['create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','CreateSmsMessage'];(function(_0x2a7d71,_0x53d1c5){var _0x52a991=function(_0x550881){while(--_0x550881){_0x2a7d71['push'](_0x2a7d71['shift']());}};_0x52a991(++_0x53d1c5);}(_0x699b,0xec));var _0xb699=function(_0x5b1beb,_0x56b8a0){_0x5b1beb=_0x5b1beb-0x0;var _0x27625e=_0x699b[_0x5b1beb];return _0x27625e;};'use strict';var _=require(_0xb699('0x0'));var util=require(_0xb699('0x1'));var moment=require('moment');var BPromise=require(_0xb699('0x2'));var rs=require(_0xb699('0x3'));var fs=require('fs');var Redis=require(_0xb699('0x4'));var db=require(_0xb699('0x5'))['db'];var utils=require(_0xb699('0x6'));var logger=require(_0xb699('0x7'))(_0xb699('0x8'));var config=require('../../config/environment');var jayson=require(_0xb699('0x9'));var client=jayson[_0xb699('0xa')][_0xb699('0xb')]({'port':0x232a});config[_0xb699('0xc')]=_[_0xb699('0xd')](config[_0xb699('0xc')],{'host':_0xb699('0xe'),'port':0x18eb});var socket=require(_0xb699('0xf'))(new Redis(config[_0xb699('0xc')]));require(_0xb699('0x10'))['register'](socket);function respondWithRpcPromise(_0x2ade71,_0x7f0d84,_0x41f47e){return new BPromise(function(_0xbc0b11,_0x576b58){return client[_0xb699('0x11')](_0x2ade71,_0x41f47e)[_0xb699('0x12')](function(_0x46ee0a){logger['info'](_0xb699('0x13'),_0x7f0d84,'request\x20sent');logger['debug'](_0xb699('0x14'),_0x7f0d84,_0xb699('0x15'),JSON[_0xb699('0x16')](_0x46ee0a));if(_0x46ee0a[_0xb699('0x17')]){if(_0x46ee0a[_0xb699('0x17')][_0xb699('0x18')]===0x1f4){logger[_0xb699('0x17')](_0xb699('0x13'),_0x7f0d84,_0x46ee0a['error'][_0xb699('0x19')]);return _0x576b58(_0x46ee0a['error'][_0xb699('0x19')]);}logger['error'](_0xb699('0x13'),_0x7f0d84,_0x46ee0a[_0xb699('0x17')][_0xb699('0x19')]);return _0xbc0b11(_0x46ee0a[_0xb699('0x17')][_0xb699('0x19')]);}else{logger[_0xb699('0x1a')]('SmsMessage,\x20%s,\x20%s',_0x7f0d84,_0xb699('0x15'));_0xbc0b11(_0x46ee0a['result'][_0xb699('0x19')]);}})['catch'](function(_0x546678){logger['error']('SmsMessage,\x20%s,\x20%s',_0x7f0d84,_0x546678);_0x576b58(_0x546678);});});}exports[_0xb699('0x1b')]=function(_0xeb5034){var _0x56651e=this;return new Promise(function(_0xfce68e,_0xb97d04){return db['SmsMessage'][_0xb699('0x1c')](_0xeb5034[_0xb699('0x1d')],{'raw':_0xeb5034[_0xb699('0x1e')]?_0xeb5034[_0xb699('0x1e')][_0xb699('0x1f')]===undefined?!![]:![]:!![]})[_0xb699('0x12')](function(_0x7550f5){logger[_0xb699('0x1a')](_0xb699('0x1b'),_0xeb5034);logger[_0xb699('0x20')](_0xb699('0x1b'),_0xeb5034,JSON[_0xb699('0x16')](_0x7550f5));_0xfce68e(_0x7550f5);})['catch'](function(_0xdbbf6b){logger[_0xb699('0x17')](_0xb699('0x1b'),_0xdbbf6b[_0xb699('0x19')],_0xeb5034);_0xb97d04(_0x56651e['error'](0x1f4,_0xdbbf6b[_0xb699('0x19')]));});});}; \ No newline at end of file +var _0xec23=['redis','defaults','localhost','socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x225d3c,_0x5ba559){var _0x569a9e=function(_0x14de98){while(--_0x14de98){_0x225d3c['push'](_0x225d3c['shift']());}};_0x569a9e(++_0x5ba559);}(_0xec23,0x7c));var _0x3ec2=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0xec23[_0x188a93];return _0x23b40d;};'use strict';var _=require('lodash');var util=require(_0x3ec2('0x0'));var moment=require('moment');var BPromise=require(_0x3ec2('0x1'));var rs=require(_0x3ec2('0x2'));var fs=require('fs');var Redis=require(_0x3ec2('0x3'));var db=require(_0x3ec2('0x4'))['db'];var utils=require(_0x3ec2('0x5'));var logger=require(_0x3ec2('0x6'))(_0x3ec2('0x7'));var config=require(_0x3ec2('0x8'));var jayson=require(_0x3ec2('0x9'));var client=jayson[_0x3ec2('0xa')][_0x3ec2('0xb')]({'port':0x232a});config[_0x3ec2('0xc')]=_[_0x3ec2('0xd')](config[_0x3ec2('0xc')],{'host':_0x3ec2('0xe'),'port':0x18eb});var socket=require(_0x3ec2('0xf'))(new Redis(config[_0x3ec2('0xc')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4d3913,_0x97d667,_0x3d0f64){return new BPromise(function(_0x27b628,_0x42bc98){return client[_0x3ec2('0x10')](_0x4d3913,_0x3d0f64)[_0x3ec2('0x11')](function(_0x3132c1){logger[_0x3ec2('0x12')](_0x3ec2('0x13'),_0x97d667,'request\x20sent');logger[_0x3ec2('0x14')](_0x3ec2('0x15'),_0x97d667,_0x3ec2('0x16'),JSON[_0x3ec2('0x17')](_0x3132c1));if(_0x3132c1[_0x3ec2('0x18')]){if(_0x3132c1['error'][_0x3ec2('0x19')]===0x1f4){logger[_0x3ec2('0x18')](_0x3ec2('0x13'),_0x97d667,_0x3132c1['error'][_0x3ec2('0x1a')]);return _0x42bc98(_0x3132c1[_0x3ec2('0x18')][_0x3ec2('0x1a')]);}logger[_0x3ec2('0x18')](_0x3ec2('0x13'),_0x97d667,_0x3132c1[_0x3ec2('0x18')][_0x3ec2('0x1a')]);return _0x27b628(_0x3132c1['error'][_0x3ec2('0x1a')]);}else{logger[_0x3ec2('0x12')](_0x3ec2('0x13'),_0x97d667,_0x3ec2('0x16'));_0x27b628(_0x3132c1['result'][_0x3ec2('0x1a')]);}})[_0x3ec2('0x1b')](function(_0xc57273){logger['error']('SmsMessage,\x20%s,\x20%s',_0x97d667,_0xc57273);_0x42bc98(_0xc57273);});});}exports['CreateSmsMessage']=function(_0x1a4648){var _0x47d190=this;return new Promise(function(_0x557b33,_0x409204){return db[_0x3ec2('0x1c')][_0x3ec2('0x1d')](_0x1a4648[_0x3ec2('0x1e')],{'raw':_0x1a4648[_0x3ec2('0x1f')]?_0x1a4648[_0x3ec2('0x1f')][_0x3ec2('0x20')]===undefined?!![]:![]:!![]})[_0x3ec2('0x11')](function(_0x42448a){logger[_0x3ec2('0x12')](_0x3ec2('0x21'),_0x1a4648);logger[_0x3ec2('0x14')]('CreateSmsMessage',_0x1a4648,JSON[_0x3ec2('0x17')](_0x42448a));_0x557b33(_0x42448a);})[_0x3ec2('0x1b')](function(_0x3a1f3a){logger['error'](_0x3ec2('0x21'),_0x3a1f3a[_0x3ec2('0x1a')],_0x1a4648);_0x409204(_0x47d190[_0x3ec2('0x18')](0x1f4,_0x3a1f3a[_0x3ec2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 2d39662..d54a979 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 _0x1b5e=['removeListener','register','length','smsMessage:','save','remove'];(function(_0x107e87,_0x20293b){var _0x267b1a=function(_0x34139e){while(--_0x34139e){_0x107e87['push'](_0x107e87['shift']());}};_0x267b1a(++_0x20293b);}(_0x1b5e,0x82));var _0xe1b5=function(_0x8d5683,_0x408708){_0x8d5683=_0x8d5683-0x0;var _0x3bfc8f=_0x1b5e[_0x8d5683];return _0x3bfc8f;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xe1b5('0x0'),_0xe1b5('0x1'),'update'];function createListener(_0x285d18,_0x3f9475){return function(_0x881b00){_0x3f9475['emit'](_0x285d18,_0x881b00);};}function removeListener(_0x187920,_0x5f5237){return function(){SmsMessageEvents[_0xe1b5('0x2')](_0x187920,_0x5f5237);};}exports[_0xe1b5('0x3')]=function(_0x394a4b){for(var _0x2804c3=0x0,_0x365604=events[_0xe1b5('0x4')];_0x2804c3<_0x365604;_0x2804c3++){var _0x470602=events[_0x2804c3];var _0x209df8=createListener(_0xe1b5('0x5')+_0x470602,_0x394a4b);SmsMessageEvents['on'](_0x470602,_0x209df8);}}; \ No newline at end of file +var _0x9147=['smsMessage:','save','emit','removeListener','register'];(function(_0x2560ee,_0x546d61){var _0x27920d=function(_0x4de990){while(--_0x4de990){_0x2560ee['push'](_0x2560ee['shift']());}};_0x27920d(++_0x546d61);}(_0x9147,0x1d2));var _0x7914=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x9147[_0x56482c];return _0x5aae7a;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x7914('0x0'),'remove','update'];function createListener(_0x22d254,_0x5060cb){return function(_0x236b93){_0x5060cb[_0x7914('0x1')](_0x22d254,_0x236b93);};}function removeListener(_0x5297ae,_0x3d8e86){return function(){SmsMessageEvents[_0x7914('0x2')](_0x5297ae,_0x3d8e86);};}exports[_0x7914('0x3')]=function(_0x43c098){for(var _0x240818=0x0,_0x570583=events['length'];_0x240818<_0x570583;_0x240818++){var _0x54fa0e=events[_0x240818];var _0xeafaef=createListener(_0x7914('0x4')+_0x54fa0e,_0x43c098);SmsMessageEvents['on'](_0x54fa0e,_0xeafaef);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9403bb9..8873030 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 _0x1259=['put','/:id','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0x1259,0x11e));var _0x9125=function(_0x1d27b1,_0x582136){_0x1d27b1=_0x1d27b1-0x0;var _0x45198b=_0x1259[_0x1d27b1];return _0x45198b;};'use strict';var multer=require(_0x9125('0x0'));var util=require(_0x9125('0x1'));var path=require(_0x9125('0x2'));var timeout=require(_0x9125('0x3'));var express=require('express');var router=express[_0x9125('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9125('0x5'));var interaction=require(_0x9125('0x6'));var config=require(_0x9125('0x7'));var controller=require(_0x9125('0x8'));router[_0x9125('0x9')]('/',auth[_0x9125('0xa')](),controller[_0x9125('0xb')]);router[_0x9125('0x9')](_0x9125('0xc'),auth['isAuthenticated'](),controller[_0x9125('0xd')]);router[_0x9125('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9125('0x9')](_0x9125('0xe'),auth[_0x9125('0xa')](),controller[_0x9125('0xf')]);router[_0x9125('0x9')](_0x9125('0x10'),auth[_0x9125('0xa')](),controller['getTeams']);router[_0x9125('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x9125('0x11')]('/',auth[_0x9125('0xa')](),controller[_0x9125('0x12')]);router['post'](_0x9125('0x10'),auth['isAuthenticated'](),controller[_0x9125('0x13')]);router[_0x9125('0x11')](_0x9125('0x14'),auth['isAuthenticated'](),controller[_0x9125('0x15')]);router[_0x9125('0x16')](_0x9125('0x17'),auth[_0x9125('0xa')](),controller['update']);router[_0x9125('0x18')](_0x9125('0x17'),auth['isAuthenticated'](),controller[_0x9125('0x19')]);router[_0x9125('0x18')]('/:id/teams',auth[_0x9125('0xa')](),controller['removeTeams']);router[_0x9125('0x18')](_0x9125('0x14'),auth['isAuthenticated'](),controller[_0x9125('0x1a')]);module[_0x9125('0x1b')]=router; \ No newline at end of file +var _0xbf7a=['removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','destroy','removeTeams'];(function(_0x26fcb3,_0x284fb5){var _0x555a5d=function(_0x3c4ed0){while(--_0x3c4ed0){_0x26fcb3['push'](_0x26fcb3['shift']());}};_0x555a5d(++_0x284fb5);}(_0xbf7a,0xb0));var _0xabf7=function(_0xb741db,_0x521339){_0xb741db=_0xb741db-0x0;var _0xab69c6=_0xbf7a[_0xb741db];return _0xab69c6;};'use strict';var multer=require(_0xabf7('0x0'));var util=require(_0xabf7('0x1'));var path=require('path');var timeout=require(_0xabf7('0x2'));var express=require(_0xabf7('0x3'));var router=express[_0xabf7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xabf7('0x5'));var interaction=require(_0xabf7('0x6'));var config=require(_0xabf7('0x7'));var controller=require(_0xabf7('0x8'));router[_0xabf7('0x9')]('/',auth[_0xabf7('0xa')](),controller['index']);router[_0xabf7('0x9')](_0xabf7('0xb'),auth[_0xabf7('0xa')](),controller[_0xabf7('0xc')]);router[_0xabf7('0x9')](_0xabf7('0xd'),auth[_0xabf7('0xa')](),controller[_0xabf7('0xe')]);router[_0xabf7('0x9')](_0xabf7('0xf'),auth[_0xabf7('0xa')](),controller['getMembers']);router[_0xabf7('0x9')](_0xabf7('0x10'),auth[_0xabf7('0xa')](),controller[_0xabf7('0x11')]);router[_0xabf7('0x9')](_0xabf7('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0xabf7('0x13')]('/',auth[_0xabf7('0xa')](),controller[_0xabf7('0x14')]);router[_0xabf7('0x13')](_0xabf7('0x10'),auth[_0xabf7('0xa')](),controller['addTeams']);router['post'](_0xabf7('0x12'),auth[_0xabf7('0xa')](),controller[_0xabf7('0x15')]);router[_0xabf7('0x16')](_0xabf7('0xd'),auth['isAuthenticated'](),controller[_0xabf7('0x17')]);router[_0xabf7('0x18')](_0xabf7('0xd'),auth['isAuthenticated'](),controller[_0xabf7('0x19')]);router[_0xabf7('0x18')]('/:id/teams',auth[_0xabf7('0xa')](),controller[_0xabf7('0x1a')]);router[_0xabf7('0x18')]('/:id/users',auth[_0xabf7('0xa')](),controller[_0xabf7('0x1b')]);module[_0xabf7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index f4cef28..1f8a2cf 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 _0x2240=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5e9240,_0x1e1041){var _0x204057=function(_0x2aeca0){while(--_0x2aeca0){_0x5e9240['push'](_0x5e9240['shift']());}};_0x204057(++_0x1e1041);}(_0x2240,0x16d));var _0x0224=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x2240[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x0224('0x0'));module[_0x0224('0x1')]={'name':{'type':Sequelize[_0x0224('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0224('0x2')]},'timeout':{'type':Sequelize[_0x0224('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0224('0x4')](_0x0224('0x5'),'beepall',_0x0224('0x6'))}}; \ No newline at end of file +var _0xeada=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4f7f50,_0x42e787){var _0x2cbcd8=function(_0x575ce3){while(--_0x575ce3){_0x4f7f50['push'](_0x4f7f50['shift']());}};_0x2cbcd8(++_0x42e787);}(_0xeada,0xf3));var _0xaead=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xeada[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xaead('0x0'));module[_0xaead('0x1')]={'name':{'type':Sequelize[_0xaead('0x2')],'unique':_0xaead('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaead('0x2')]},'timeout':{'type':Sequelize[_0xaead('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaead('0x5')](_0xaead('0x6'),_0xaead('0x7'),_0xaead('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d237bf5..33331ff 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 _0x7466=['updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userSmsQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','request-promise','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','User','agent','smsPause'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x7466,0xb5));var _0x6746=function(_0xf2085d,_0x4cf1a9){_0xf2085d=_0xf2085d-0x0;var _0x397500=_0x7466[_0xf2085d];return _0x397500;};'use strict';var emlformat=require(_0x6746('0x0'));var rimraf=require(_0x6746('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6746('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6746('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x6746('0x4'));var ejs=require(_0x6746('0x5'));var fs=require('fs');var fs_extra=require(_0x6746('0x6'));var _=require(_0x6746('0x7'));var squel=require(_0x6746('0x8'));var crypto=require(_0x6746('0x9'));var jsforce=require(_0x6746('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6746('0x4'));var querystring=require(_0x6746('0xb'));var Papa=require(_0x6746('0xc'));var Redis=require(_0x6746('0xd'));var authService=require(_0x6746('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6746('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6746('0x10'))(_0x6746('0x11'));var utils=require('../../config/utils');var config=require(_0x6746('0x12'));var licenseUtil=require(_0x6746('0x13'));var db=require('../../mysqldb')['db'];config[_0x6746('0x14')]=_[_0x6746('0x15')](config[_0x6746('0x14')],{'host':_0x6746('0x16'),'port':0x18eb});var socket=require(_0x6746('0x17'))(new Redis(config[_0x6746('0x14')]));require(_0x6746('0x18'))[_0x6746('0x19')](socket);function respondWithStatusCode(_0x2bf576,_0x112927){_0x112927=_0x112927||0xcc;return function(_0x225ca7){if(_0x225ca7){return _0x2bf576['sendStatus'](_0x112927);}return _0x2bf576[_0x6746('0x1a')](_0x112927)[_0x6746('0x1b')]();};}function respondWithResult(_0x45b9a9,_0x383d02){_0x383d02=_0x383d02||0xc8;return function(_0x253add){if(_0x253add){return _0x45b9a9[_0x6746('0x1a')](_0x383d02)[_0x6746('0x1c')](_0x253add);}};}function respondWithFilteredResult(_0x5d8b5d,_0x58d3b4){return function(_0x1059e1){if(_0x1059e1){var _0x49cb86=typeof _0x58d3b4['offset']===_0x6746('0x1d')&&typeof _0x58d3b4['limit']===_0x6746('0x1d');var _0x478a1f=_0x1059e1[_0x6746('0x1e')];var _0x54e4e3=_0x49cb86?0x0:_0x58d3b4[_0x6746('0x1f')];var _0x18f90b=_0x49cb86?_0x1059e1['count']:_0x58d3b4['offset']+_0x58d3b4[_0x6746('0x20')];var _0x2b34ee;if(_0x18f90b>=_0x478a1f){_0x18f90b=_0x478a1f;_0x2b34ee=0xc8;}else{_0x2b34ee=0xce;}_0x5d8b5d[_0x6746('0x1a')](_0x2b34ee);return _0x5d8b5d[_0x6746('0x21')](_0x6746('0x22'),_0x54e4e3+'-'+_0x18f90b+'/'+_0x478a1f)[_0x6746('0x1c')](_0x1059e1);}return null;};}function patchUpdates(_0x2d3673){return function(_0x48882b){try{jsonpatch[_0x6746('0x23')](_0x48882b,_0x2d3673,!![]);}catch(_0x28b9bd){return BPromise[_0x6746('0x24')](_0x28b9bd);}return _0x48882b[_0x6746('0x25')]();};}function saveUpdates(_0x2eee70,_0x23ffc3){return function(_0x5c6141){if(_0x5c6141){return _0x5c6141[_0x6746('0x26')](_0x2eee70)[_0x6746('0x27')](function(_0x484d49){return _0x484d49;});}return null;};}function removeEntity(_0xc40682,_0x29036f){return function(_0x1b8c27){if(_0x1b8c27){return _0x1b8c27[_0x6746('0x28')]()['then'](function(){var _0x4b81ed=_0x1b8c27[_0x6746('0x29')]({'plain':!![]});var _0x10c5d8=_0x6746('0x2a');return db[_0x6746('0x2b')][_0x6746('0x28')]({'where':{'type':_0x10c5d8,'resourceId':_0x4b81ed['id']}})['then'](function(){return _0x1b8c27;});})[_0x6746('0x27')](function(){_0xc40682[_0x6746('0x1a')](0xcc)[_0x6746('0x1b')]();});}};}function handleEntityNotFound(_0x6d5831,_0x3d1845){return function(_0x2b2dcf){if(!_0x2b2dcf){_0x6d5831[_0x6746('0x2c')](0x194);}return _0x2b2dcf;};}function handleError(_0x4c21bc,_0x520868){_0x520868=_0x520868||0x1f4;return function(_0x31e900){logger[_0x6746('0x2d')](_0x31e900[_0x6746('0x2e')]);if(_0x31e900[_0x6746('0x2f')]){delete _0x31e900[_0x6746('0x2f')];}_0x4c21bc[_0x6746('0x1a')](_0x520868)['send'](_0x31e900);};}exports[_0x6746('0x30')]=function(_0x31a95c,_0x7467c1){var _0x768aa6={},_0x1696eb={},_0x12cb01={'count':0x0,'rows':[]};var _0x1ca828=_[_0x6746('0x31')](db[_0x6746('0x32')][_0x6746('0x33')],function(_0x255f13){return{'name':_0x255f13[_0x6746('0x34')],'type':_0x255f13[_0x6746('0x35')]['key']};});_0x1696eb[_0x6746('0x36')]=_[_0x6746('0x31')](_0x1ca828,'name');_0x1696eb[_0x6746('0x37')]=_[_0x6746('0x38')](_0x31a95c[_0x6746('0x37')]);_0x1696eb[_0x6746('0x39')]=_[_0x6746('0x3a')](_0x1696eb[_0x6746('0x36')],_0x1696eb['query']);_0x768aa6['attributes']=_[_0x6746('0x3a')](_0x1696eb[_0x6746('0x36')],qs[_0x6746('0x3b')](_0x31a95c[_0x6746('0x37')][_0x6746('0x3b')]));_0x768aa6[_0x6746('0x3c')]=_0x768aa6['attributes'][_0x6746('0x3d')]?_0x768aa6[_0x6746('0x3c')]:_0x1696eb[_0x6746('0x36')];if(!_0x31a95c[_0x6746('0x37')][_0x6746('0x3e')]('nolimit')){_0x768aa6[_0x6746('0x20')]=qs['limit'](_0x31a95c[_0x6746('0x37')][_0x6746('0x20')]);_0x768aa6[_0x6746('0x1f')]=qs[_0x6746('0x1f')](_0x31a95c[_0x6746('0x37')][_0x6746('0x1f')]);}_0x768aa6[_0x6746('0x3f')]=qs[_0x6746('0x40')](_0x31a95c['query'][_0x6746('0x40')]);_0x768aa6['where']=qs[_0x6746('0x39')](_[_0x6746('0x41')](_0x31a95c[_0x6746('0x37')],_0x1696eb[_0x6746('0x39')]),_0x1ca828);if(_0x31a95c[_0x6746('0x37')][_0x6746('0x42')]){_0x768aa6[_0x6746('0x43')]=_[_0x6746('0x44')](_0x768aa6['where'],{'$or':_[_0x6746('0x31')](_0x1ca828,function(_0x2e3e22){if(_0x2e3e22[_0x6746('0x35')]!==_0x6746('0x45')){var _0x1c592a={};_0x1c592a[_0x2e3e22['name']]={'$like':'%'+_0x31a95c[_0x6746('0x37')]['filter']+'%'};return _0x1c592a;}})});}_0x768aa6=_[_0x6746('0x44')]({},_0x768aa6,_0x31a95c['options']);var _0x297354={'where':_0x768aa6[_0x6746('0x43')]};return db[_0x6746('0x32')]['count'](_0x297354)[_0x6746('0x27')](function(_0x26a3dd){_0x12cb01['count']=_0x26a3dd;if(_0x31a95c[_0x6746('0x37')][_0x6746('0x46')]){_0x768aa6[_0x6746('0x47')]=[{'all':!![]}];}return db['SmsQueue'][_0x6746('0x48')](_0x768aa6);})[_0x6746('0x27')](function(_0x1fb33d){_0x12cb01['rows']=_0x1fb33d;return _0x12cb01;})[_0x6746('0x27')](respondWithFilteredResult(_0x7467c1,_0x768aa6))[_0x6746('0x49')](handleError(_0x7467c1,null));};exports[_0x6746('0x4a')]=function(_0x198d3a,_0x3034fe){var _0x15631d={'raw':!![],'where':{'id':_0x198d3a[_0x6746('0x4b')]['id']}},_0xc521f1={};_0xc521f1['model']=_[_0x6746('0x38')](db[_0x6746('0x32')][_0x6746('0x33')]);_0xc521f1[_0x6746('0x37')]=_[_0x6746('0x38')](_0x198d3a[_0x6746('0x37')]);_0xc521f1['filters']=_[_0x6746('0x3a')](_0xc521f1[_0x6746('0x36')],_0xc521f1[_0x6746('0x37')]);_0x15631d[_0x6746('0x3c')]=_['intersection'](_0xc521f1[_0x6746('0x36')],qs[_0x6746('0x3b')](_0x198d3a[_0x6746('0x37')][_0x6746('0x3b')]));_0x15631d[_0x6746('0x3c')]=_0x15631d[_0x6746('0x3c')][_0x6746('0x3d')]?_0x15631d['attributes']:_0xc521f1[_0x6746('0x36')];if(_0x198d3a[_0x6746('0x37')][_0x6746('0x46')]){_0x15631d[_0x6746('0x47')]=[{'all':!![]}];}_0x15631d=_['merge']({},_0x15631d,_0x198d3a[_0x6746('0x4c')]);return db[_0x6746('0x32')][_0x6746('0x4d')](_0x15631d)[_0x6746('0x27')](handleEntityNotFound(_0x3034fe,null))['then'](respondWithResult(_0x3034fe,null))[_0x6746('0x49')](handleError(_0x3034fe,null));};exports['create']=function(_0xd6bba,_0x3db43f){return db[_0x6746('0x32')][_0x6746('0x4e')](_0xd6bba[_0x6746('0x4f')],{})['then'](function(_0x2d3a5c){var _0x1fb038=_0xd6bba['user'][_0x6746('0x29')]({'plain':!![]});if(!_0x1fb038)throw new Error(_0x6746('0x50'));if(_0x1fb038[_0x6746('0x51')]===_0x6746('0x52')){var _0x4e05b6=_0x2d3a5c[_0x6746('0x29')]({'plain':!![]});var _0xea27fe=_0x6746('0x2a');return db['UserProfileSection'][_0x6746('0x4d')]({'where':{'name':_0xea27fe,'userProfileId':_0x1fb038[_0x6746('0x53')]},'raw':!![]})[_0x6746('0x27')](function(_0x2d5b59){if(_0x2d5b59&&_0x2d5b59[_0x6746('0x54')]===0x0){return db[_0x6746('0x2b')][_0x6746('0x4e')]({'name':_0x4e05b6[_0x6746('0x2f')],'resourceId':_0x4e05b6['id'],'type':_0x2d5b59[_0x6746('0x2f')],'sectionId':_0x2d5b59['id']},{})[_0x6746('0x27')](function(){return _0x2d3a5c;});}else{return _0x2d3a5c;}})[_0x6746('0x49')](function(_0x2f95e0){logger[_0x6746('0x2d')](_0x6746('0x55'),_0x2f95e0);throw _0x2f95e0;});}return _0x2d3a5c;})[_0x6746('0x27')](respondWithResult(_0x3db43f,0xc9))[_0x6746('0x49')](handleError(_0x3db43f,null));};exports[_0x6746('0x26')]=function(_0x18fe14,_0x1fa734){if(_0x18fe14['body']['id']){delete _0x18fe14['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x18fe14[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x1fa734,null))[_0x6746('0x27')](saveUpdates(_0x18fe14[_0x6746('0x4f')],null))[_0x6746('0x27')](respondWithResult(_0x1fa734,null))[_0x6746('0x49')](handleError(_0x1fa734,null));};exports[_0x6746('0x28')]=function(_0x45159f,_0x1d16f0){return db[_0x6746('0x32')]['find']({'where':{'id':_0x45159f[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x1d16f0,null))[_0x6746('0x27')](removeEntity(_0x1d16f0,null))['catch'](handleError(_0x1d16f0,null));};exports[_0x6746('0x56')]=function(_0x3d5318,_0x1c4320){return db[_0x6746('0x32')]['describe']()[_0x6746('0x27')](respondWithResult(_0x1c4320,null))[_0x6746('0x49')](handleError(_0x1c4320,null));};exports[_0x6746('0x57')]=function(_0x39b68a,_0x1e11ad,_0x5ca899){var _0x48976f={'raw':!![],'where':{}},_0x3065c8={},_0x2694ad;return db[_0x6746('0x32')][_0x6746('0x58')]({'where':{'id':_0x39b68a[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x1e11ad,null))[_0x6746('0x27')](function(_0x425a0c){if(_0x425a0c){_0x2694ad=_0x425a0c[_0x6746('0x29')]({'plain':!![]});_0x3065c8[_0x6746('0x36')]=_[_0x6746('0x38')](db[_0x6746('0x59')][_0x6746('0x33')]);_0x3065c8[_0x6746('0x37')]=_[_0x6746('0x38')](_0x39b68a['query']);_0x3065c8['filters']=_[_0x6746('0x3a')](_0x3065c8['model'],_0x3065c8[_0x6746('0x37')]);_0x48976f[_0x6746('0x3c')]=_['intersection'](_0x3065c8[_0x6746('0x36')],qs[_0x6746('0x3b')](_0x39b68a[_0x6746('0x37')][_0x6746('0x3b')]));_0x48976f[_0x6746('0x3c')]=_0x48976f['attributes'][_0x6746('0x3d')]?_0x48976f['attributes']:_0x3065c8['model'];if(!_0x39b68a[_0x6746('0x37')][_0x6746('0x3e')](_0x6746('0x5a'))){_0x48976f[_0x6746('0x20')]=qs[_0x6746('0x20')](_0x39b68a['query'][_0x6746('0x20')]);_0x48976f['offset']=qs[_0x6746('0x1f')](_0x39b68a[_0x6746('0x37')][_0x6746('0x1f')]);}_0x48976f[_0x6746('0x3f')]=qs[_0x6746('0x40')](_0x39b68a['query'][_0x6746('0x40')]);_0x48976f['where']=qs['filters'](_[_0x6746('0x41')](_0x39b68a[_0x6746('0x37')],_0x3065c8[_0x6746('0x39')]));_0x48976f[_0x6746('0x43')][_0x6746('0x5b')]=_0x425a0c['id'];if(_0x39b68a[_0x6746('0x37')][_0x6746('0x42')]){_0x48976f['where']=_[_0x6746('0x44')](_0x48976f[_0x6746('0x43')],{'$or':_[_0x6746('0x31')](_0x48976f[_0x6746('0x3c')],function(_0x4332ed){var _0x306f72={};_0x306f72[_0x4332ed]={'$like':'%'+_0x39b68a[_0x6746('0x37')][_0x6746('0x42')]+'%'};return _0x306f72;})});}_0x48976f=_[_0x6746('0x44')]({},_0x48976f,_0x39b68a['options']);return db[_0x6746('0x59')][_0x6746('0x48')](_0x48976f);}})[_0x6746('0x27')](function(_0x42e6c4){if(_0x42e6c4){return db[_0x6746('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0x42e6c4,'UserId'),'role':_0x6746('0x5d')},'attributes':['id',_0x6746('0x2f'),_0x6746('0x5e'),_0x6746('0x5f'),_0x6746('0x60')]});}})[_0x6746('0x27')](function(_0x5ee6b1){if(_0x5ee6b1){return{'count':_0x5ee6b1[_0x6746('0x1e')],'rows':_[_0x6746('0x31')](_0x5ee6b1['rows'],function(_0x11d473){return{'membername':_0x11d473[_0x6746('0x2f')],'UserId':_0x11d473['id'],'queue_name':_0x2694ad[_0x6746('0x2f')],'SmsQueueId':_0x2694ad['id'],'interface':util[_0x6746('0x61')]('%s/%s',_0x6746('0x62'),_0x11d473[_0x6746('0x2f')]),'penalty':0x0,'paused':_0x11d473['smsPause'],'createdAt':_0x11d473[_0x6746('0x60')],'updatedAt':_0x11d473['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6746('0x27')](respondWithFilteredResult(_0x1e11ad,_0x48976f))[_0x6746('0x49')](handleError(_0x1e11ad,null));};exports['getTeams']=function(_0xa2082c,_0x586538,_0x15d6ea){var _0x15ae02={};var _0x4d57b2={};var _0x320323;var _0x19239d;return db['SmsQueue']['findOne']({'where':{'id':_0xa2082c['params']['id']}})['then'](handleEntityNotFound(_0x586538,null))[_0x6746('0x27')](function(_0x499681){if(_0x499681){_0x320323=_0x499681;_0x4d57b2[_0x6746('0x36')]=_[_0x6746('0x38')](db[_0x6746('0x63')]['rawAttributes']);_0x4d57b2[_0x6746('0x37')]=_[_0x6746('0x38')](_0xa2082c[_0x6746('0x37')]);_0x4d57b2[_0x6746('0x39')]=_[_0x6746('0x3a')](_0x4d57b2[_0x6746('0x36')],_0x4d57b2[_0x6746('0x37')]);_0x15ae02[_0x6746('0x3c')]=_[_0x6746('0x3a')](_0x4d57b2[_0x6746('0x36')],qs[_0x6746('0x3b')](_0xa2082c[_0x6746('0x37')][_0x6746('0x3b')]));_0x15ae02[_0x6746('0x3c')]=_0x15ae02[_0x6746('0x3c')]['length']?_0x15ae02[_0x6746('0x3c')]:_0x4d57b2[_0x6746('0x36')];_0x15ae02['order']=qs[_0x6746('0x40')](_0xa2082c[_0x6746('0x37')][_0x6746('0x40')]);_0x15ae02[_0x6746('0x43')]=qs[_0x6746('0x39')](_[_0x6746('0x41')](_0xa2082c[_0x6746('0x37')],_0x4d57b2[_0x6746('0x39')]));if(_0xa2082c['query']['filter']){_0x15ae02['where']=_[_0x6746('0x44')](_0x15ae02[_0x6746('0x43')],{'$or':_['map'](_0x15ae02['attributes'],function(_0x2df2b0){var _0x12615c={};_0x12615c[_0x2df2b0]={'$like':'%'+_0xa2082c[_0x6746('0x37')][_0x6746('0x42')]+'%'};return _0x12615c;})});}_0x15ae02=_[_0x6746('0x44')]({},_0x15ae02,_0xa2082c['options']);return _0x320323[_0x6746('0x64')](_0x15ae02);}})[_0x6746('0x27')](function(_0x2272ed){if(_0x2272ed){_0x19239d=_0x2272ed['length'];if(!_0xa2082c[_0x6746('0x37')][_0x6746('0x3e')](_0x6746('0x5a'))){_0x15ae02['limit']=qs[_0x6746('0x20')](_0xa2082c[_0x6746('0x37')][_0x6746('0x20')]);_0x15ae02['offset']=qs[_0x6746('0x1f')](_0xa2082c[_0x6746('0x37')][_0x6746('0x1f')]);}return _0x320323[_0x6746('0x64')](_0x15ae02);}})['then'](function(_0x327541){if(_0x327541){return _0x327541?{'count':_0x19239d,'rows':_0x327541}:null;}})[_0x6746('0x27')](respondWithResult(_0x586538,null))[_0x6746('0x49')](handleError(_0x586538,null));};exports[_0x6746('0x65')]=function(_0x512492,_0x333404,_0x308d4c){var _0x4d5430=_0x512492[_0x6746('0x4f')][_0x6746('0x66')];return db['Team'][_0x6746('0x48')]({'where':{'id':_0x4d5430},'attributes':['id'],'include':[{'model':db[_0x6746('0x5c')],'as':_0x6746('0x67'),'attributes':['id',_0x6746('0x2f'),_0x6746('0x68'),_0x6746('0x69'),_0x6746('0x6a')],'raw':!![]}]})[_0x6746('0x27')](function(_0x2cffe2){if(_0x2cffe2){var _0x1cc9cc=_[_0x6746('0x6b')](_0x2cffe2,function(_0x2eef69){var _0x588d56=_0x2eef69[_0x6746('0x29')]({'plain':!![]});return _0x588d56[_0x6746('0x67')];});return db[_0x6746('0x32')][_0x6746('0x4d')]({'where':{'id':_0x512492['params']['id']}})['then'](function(_0x2e22a8){return db[_0x6746('0x6c')][_0x6746('0x6d')](function(_0x3749db){return _0x2e22a8[_0x6746('0x65')](_0x4d5430,{'transaction':_0x3749db})[_0x6746('0x27')](function(){return BPromise['each'](_0x1cc9cc,function(_0x3789db){return db[_0x6746('0x59')][_0x6746('0x6e')]({'where':{'UserId':_0x3789db['id'],'SmsQueueId':_0x512492[_0x6746('0x4b')]['id']},'transaction':_0x3749db});});})['then'](function(){_0x1cc9cc[_0x6746('0x6f')](function(_0x16e373){socket[_0x6746('0x70')](_0x6746('0x71'),{'UserId':_0x16e373['id'],'SmsQueueId':_0x2e22a8['id']});});});});});}})['then'](respondWithStatusCode(_0x333404,null))[_0x6746('0x49')](handleError(_0x333404,null));};exports['removeTeams']=function(_0x8ee18a,_0x2154ed,_0x35ea53){return db['Team']['findAll']({'where':{'id':_0x8ee18a[_0x6746('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6746('0x5c')],'as':_0x6746('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6746('0x27')](handleEntityNotFound(_0x2154ed,null))[_0x6746('0x27')](function(_0x267c35){var _0x22e410=_[_0x6746('0x31')](_0x267c35,'id');var _0x225627=[];var _0x41cc93=[];var _0x4dac04=squel[_0x6746('0x72')]();_0x4dac04[_0x6746('0x73')](_0x6746('0x74'))[_0x6746('0x75')]('team_has_sms_queues','tq')[_0x6746('0x76')]('user_has_teams','ut',_0x6746('0x77'))[_0x6746('0x43')](_0x6746('0x78'),_0x8ee18a[_0x6746('0x4b')]['id']);for(var _0xaead1c=0x0;_0xaead1c<_0x267c35['length'];_0xaead1c+=0x1){let _0x3dccb6=_0x267c35[_0xaead1c];for(var _0x41ce0b=0x0;_0x41ce0b<_0x3dccb6[_0x6746('0x67')][_0x6746('0x3d')];_0x41ce0b+=0x1){let _0xdc6879=_0x3dccb6[_0x6746('0x67')][_0x41ce0b];var _0x417926=_0x4dac04[_0x6746('0x79')]();_0x417926['where'](_0x6746('0x7a'),_0xdc6879['id']);_0x41cc93[_0x6746('0x7b')](db[_0x6746('0x6c')]['query'](_0x417926[_0x6746('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0x6746('0x7d')]})[_0x6746('0x27')](function(_0x48745b){if(_0x48745b[_0x6746('0x3d')]===0x1){return _0xdc6879['id'];}else{var _0x3d88f7=_[_0x6746('0x7e')](_[_0x6746('0x31')](_0x48745b,_0x6746('0x7f')),function(_0x515763){return _[_0x6746('0x80')](_0x22e410,_0x515763);});if(_0x3d88f7){return _0xdc6879['id'];}}}));}}return BPromise[_0x6746('0x81')](_0x41cc93)[_0x6746('0x27')](function(_0x300e53){_0x225627=_(_0x225627)[_0x6746('0x82')](_0x300e53)[_0x6746('0x83')]()[_0x6746('0x84')]();return db['SmsQueue']['find']({'where':{'id':_0x8ee18a[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](function(_0x23c9b2){return db[_0x6746('0x6c')][_0x6746('0x6d')](function(_0x52eb04){return _0x23c9b2['removeTeams'](_0x8ee18a[_0x6746('0x37')][_0x6746('0x66')],{'transaction':_0x52eb04})[_0x6746('0x27')](function(){if(!_['isEmpty'](_0x225627)){return _0x23c9b2[_0x6746('0x85')](_0x225627,{'transaction':_0x52eb04});}})[_0x6746('0x27')](function(){_0x225627['forEach'](function(_0x216615){socket['emit'](_0x6746('0x86'),{'UserId':_0x216615,'SmsQueueId':_0x23c9b2['id']});});});});});});})[_0x6746('0x27')](respondWithStatusCode(_0x2154ed,null))['catch'](handleError(_0x2154ed,null));};exports[_0x6746('0x87')]=function(_0x3c09ca,_0x441fb9,_0xdd4d33){return db[_0x6746('0x32')][_0x6746('0x4d')]({'where':{'id':_0x3c09ca[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x441fb9,null))[_0x6746('0x27')](function(_0x226016){if(_0x226016){return _0x226016[_0x6746('0x87')](_0x3c09ca['body'][_0x6746('0x66')],_['omit'](_0x3c09ca[_0x6746('0x4f')],['ids','id'])||{})['spread'](function(_0x1a2ac7){for(var _0x229f9d=0x0;_0x229f9d<_0x3c09ca['body']['ids'][_0x6746('0x3d')];_0x229f9d+=0x1){socket[_0x6746('0x70')](_0x6746('0x71'),{'UserId':_0x3c09ca['body']['ids'][_0x229f9d],'SmsQueueId':_0x3c09ca['params']['id']});}return _0x1a2ac7;});}})[_0x6746('0x27')](respondWithResult(_0x441fb9,null))[_0x6746('0x49')](handleError(_0x441fb9,null));};exports['removeAgents']=function(_0x1139ed,_0x2f751c,_0x2e0bef){return db[_0x6746('0x32')][_0x6746('0x4d')]({'where':{'id':_0x1139ed[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x2f751c,null))[_0x6746('0x27')](function(_0x2d47a6){if(_0x2d47a6){return _0x2d47a6[_0x6746('0x85')](_0x1139ed[_0x6746('0x37')][_0x6746('0x66')])[_0x6746('0x27')](function(){if(_[_0x6746('0x88')](_0x1139ed[_0x6746('0x37')][_0x6746('0x66')])){for(var _0x549103=0x0;_0x549103<_0x1139ed[_0x6746('0x37')][_0x6746('0x66')][_0x6746('0x3d')];_0x549103+=0x1){socket[_0x6746('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x1139ed['query'][_0x6746('0x66')][_0x549103]),'SmsQueueId':Number(_0x1139ed[_0x6746('0x4b')]['id'])});}}else{socket['emit'](_0x6746('0x86'),{'UserId':Number(_0x1139ed[_0x6746('0x37')][_0x6746('0x66')]),'SmsQueueId':Number(_0x1139ed[_0x6746('0x4b')]['id'])});}});}})[_0x6746('0x27')](respondWithStatusCode(_0x2f751c,null))['catch'](handleError(_0x2f751c,null));};exports[_0x6746('0x89')]=function(_0xbdd53a,_0x179165,_0x308e0b){var _0x486cb8={};var _0x4ee422={};var _0x348399;var _0x4c13d5;return db['SmsQueue']['findOne']({'where':{'id':_0xbdd53a[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x179165,null))[_0x6746('0x27')](function(_0x356ed9){if(_0x356ed9){_0x348399=_0x356ed9;_0x4ee422[_0x6746('0x36')]=_['keys'](db[_0x6746('0x5c')][_0x6746('0x33')]);_0x4ee422[_0x6746('0x37')]=_[_0x6746('0x38')](_0xbdd53a[_0x6746('0x37')]);_0x4ee422['filters']=_[_0x6746('0x3a')](_0x4ee422['model'],_0x4ee422[_0x6746('0x37')]);_0x486cb8['attributes']=_[_0x6746('0x3a')](_0x4ee422[_0x6746('0x36')],qs[_0x6746('0x3b')](_0xbdd53a[_0x6746('0x37')]['fields']));_0x486cb8[_0x6746('0x3c')]=_0x486cb8[_0x6746('0x3c')][_0x6746('0x3d')]?_0x486cb8['attributes']:_0x4ee422[_0x6746('0x36')];_0x486cb8[_0x6746('0x3f')]=qs[_0x6746('0x40')](_0xbdd53a[_0x6746('0x37')][_0x6746('0x40')]);_0x486cb8[_0x6746('0x43')]=qs[_0x6746('0x39')](_[_0x6746('0x41')](_0xbdd53a['query'],_0x4ee422[_0x6746('0x39')]));if(_0xbdd53a[_0x6746('0x37')][_0x6746('0x42')]){_0x486cb8[_0x6746('0x43')]=_[_0x6746('0x44')](_0x486cb8[_0x6746('0x43')],{'$or':_[_0x6746('0x31')](_0x486cb8['attributes'],function(_0x153e38){var _0x4239b8={};_0x4239b8[_0x153e38]={'$like':'%'+_0xbdd53a[_0x6746('0x37')]['filter']+'%'};return _0x4239b8;})});}_0x486cb8=_[_0x6746('0x44')]({},_0x486cb8,_0xbdd53a[_0x6746('0x4c')]);return _0x348399['getAgents'](_0x486cb8);}})['then'](function(_0x30dcca){if(_0x30dcca){_0x4c13d5=_0x30dcca[_0x6746('0x3d')];if(!_0xbdd53a[_0x6746('0x37')][_0x6746('0x3e')](_0x6746('0x5a'))){_0x486cb8[_0x6746('0x20')]=qs[_0x6746('0x20')](_0xbdd53a[_0x6746('0x37')][_0x6746('0x20')]);_0x486cb8['offset']=qs[_0x6746('0x1f')](_0xbdd53a[_0x6746('0x37')][_0x6746('0x1f')]);}return _0x348399[_0x6746('0x89')](_0x486cb8);}})[_0x6746('0x27')](function(_0x517e88){if(_0x517e88){return _0x517e88?{'count':_0x4c13d5,'rows':_0x517e88}:null;}})[_0x6746('0x27')](respondWithResult(_0x179165,null))[_0x6746('0x49')](handleError(_0x179165,null));}; \ No newline at end of file +var _0x1bcc=['transaction','forEach','emit','userSmsQueue:save','ids','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','order','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x1bcc,0x139));var _0xc1bc=function(_0x11a1a6,_0x3bb701){_0x11a1a6=_0x11a1a6-0x0;var _0x38f91e=_0x1bcc[_0x11a1a6];return _0x38f91e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1bc('0x0'));var zipdir=require(_0xc1bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1bc('0x2'));var moment=require(_0xc1bc('0x3'));var BPromise=require(_0xc1bc('0x4'));var Mustache=require(_0xc1bc('0x5'));var util=require(_0xc1bc('0x6'));var path=require(_0xc1bc('0x7'));var sox=require('sox');var csv=require(_0xc1bc('0x8'));var ejs=require(_0xc1bc('0x9'));var fs=require('fs');var fs_extra=require(_0xc1bc('0xa'));var _=require(_0xc1bc('0xb'));var squel=require(_0xc1bc('0xc'));var crypto=require(_0xc1bc('0xd'));var jsforce=require(_0xc1bc('0xe'));var deskjs=require(_0xc1bc('0xf'));var toCsv=require(_0xc1bc('0x8'));var querystring=require(_0xc1bc('0x10'));var Papa=require('papaparse');var Redis=require(_0xc1bc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc1bc('0x12'));var hardwareService=require(_0xc1bc('0x13'));var logger=require(_0xc1bc('0x14'))('api');var utils=require(_0xc1bc('0x15'));var config=require(_0xc1bc('0x16'));var licenseUtil=require(_0xc1bc('0x17'));var db=require(_0xc1bc('0x18'))['db'];config[_0xc1bc('0x19')]=_[_0xc1bc('0x1a')](config[_0xc1bc('0x19')],{'host':_0xc1bc('0x1b'),'port':0x18eb});var socket=require(_0xc1bc('0x1c'))(new Redis(config[_0xc1bc('0x19')]));require('./smsQueue.socket')[_0xc1bc('0x1d')](socket);function respondWithStatusCode(_0x5237c2,_0x2f4168){_0x2f4168=_0x2f4168||0xcc;return function(_0xa9d743){if(_0xa9d743){return _0x5237c2[_0xc1bc('0x1e')](_0x2f4168);}return _0x5237c2[_0xc1bc('0x1f')](_0x2f4168)[_0xc1bc('0x20')]();};}function respondWithResult(_0x2b3be2,_0x12631b){_0x12631b=_0x12631b||0xc8;return function(_0x4a22ce){if(_0x4a22ce){return _0x2b3be2[_0xc1bc('0x1f')](_0x12631b)[_0xc1bc('0x21')](_0x4a22ce);}};}function respondWithFilteredResult(_0x50ab57,_0x337e88){return function(_0x580b43){if(_0x580b43){var _0x105dd4=typeof _0x337e88['offset']==='undefined'&&typeof _0x337e88['limit']===_0xc1bc('0x22');var _0x207a72=_0x580b43[_0xc1bc('0x23')];var _0x202b27=_0x105dd4?0x0:_0x337e88[_0xc1bc('0x24')];var _0x359226=_0x105dd4?_0x580b43[_0xc1bc('0x23')]:_0x337e88['offset']+_0x337e88[_0xc1bc('0x25')];var _0x42c08a;if(_0x359226>=_0x207a72){_0x359226=_0x207a72;_0x42c08a=0xc8;}else{_0x42c08a=0xce;}_0x50ab57['status'](_0x42c08a);return _0x50ab57[_0xc1bc('0x26')](_0xc1bc('0x27'),_0x202b27+'-'+_0x359226+'/'+_0x207a72)[_0xc1bc('0x21')](_0x580b43);}return null;};}function patchUpdates(_0x598f81){return function(_0x5a7421){try{jsonpatch['apply'](_0x5a7421,_0x598f81,!![]);}catch(_0x54912b){return BPromise[_0xc1bc('0x28')](_0x54912b);}return _0x5a7421[_0xc1bc('0x29')]();};}function saveUpdates(_0x29ec89,_0x31c023){return function(_0x76e3e9){if(_0x76e3e9){return _0x76e3e9[_0xc1bc('0x2a')](_0x29ec89)[_0xc1bc('0x2b')](function(_0x5949b8){return _0x5949b8;});}return null;};}function removeEntity(_0x449071,_0x3c5637){return function(_0x3fb05c){if(_0x3fb05c){return _0x3fb05c['destroy']()['then'](function(){var _0xa011d2=_0x3fb05c[_0xc1bc('0x2c')]({'plain':!![]});var _0x4224c0='SmsQueues';return db['UserProfileResource'][_0xc1bc('0x2d')]({'where':{'type':_0x4224c0,'resourceId':_0xa011d2['id']}})[_0xc1bc('0x2b')](function(){return _0x3fb05c;});})['then'](function(){_0x449071[_0xc1bc('0x1f')](0xcc)[_0xc1bc('0x20')]();});}};}function handleEntityNotFound(_0x292df5,_0x3a0304){return function(_0x2e6b29){if(!_0x2e6b29){_0x292df5[_0xc1bc('0x1e')](0x194);}return _0x2e6b29;};}function handleError(_0x97c3fa,_0x23e9ed){_0x23e9ed=_0x23e9ed||0x1f4;return function(_0x10ff21){logger[_0xc1bc('0x2e')](_0x10ff21[_0xc1bc('0x2f')]);if(_0x10ff21[_0xc1bc('0x30')]){delete _0x10ff21[_0xc1bc('0x30')];}_0x97c3fa['status'](_0x23e9ed)[_0xc1bc('0x31')](_0x10ff21);};}exports[_0xc1bc('0x32')]=function(_0x17d39b,_0x57326c){var _0x433913={},_0x4faa5f={},_0x551999={'count':0x0,'rows':[]};var _0x43c760=_[_0xc1bc('0x33')](db[_0xc1bc('0x34')][_0xc1bc('0x35')],function(_0x42b290){return{'name':_0x42b290['fieldName'],'type':_0x42b290[_0xc1bc('0x36')]['key']};});_0x4faa5f[_0xc1bc('0x37')]=_['map'](_0x43c760,'name');_0x4faa5f[_0xc1bc('0x38')]=_[_0xc1bc('0x39')](_0x17d39b['query']);_0x4faa5f[_0xc1bc('0x3a')]=_[_0xc1bc('0x3b')](_0x4faa5f[_0xc1bc('0x37')],_0x4faa5f[_0xc1bc('0x38')]);_0x433913[_0xc1bc('0x3c')]=_['intersection'](_0x4faa5f[_0xc1bc('0x37')],qs['fields'](_0x17d39b[_0xc1bc('0x38')][_0xc1bc('0x3d')]));_0x433913[_0xc1bc('0x3c')]=_0x433913[_0xc1bc('0x3c')][_0xc1bc('0x3e')]?_0x433913['attributes']:_0x4faa5f['model'];if(!_0x17d39b[_0xc1bc('0x38')][_0xc1bc('0x3f')](_0xc1bc('0x40'))){_0x433913[_0xc1bc('0x25')]=qs[_0xc1bc('0x25')](_0x17d39b[_0xc1bc('0x38')][_0xc1bc('0x25')]);_0x433913['offset']=qs['offset'](_0x17d39b['query'][_0xc1bc('0x24')]);}_0x433913['order']=qs[_0xc1bc('0x41')](_0x17d39b[_0xc1bc('0x38')][_0xc1bc('0x41')]);_0x433913[_0xc1bc('0x42')]=qs[_0xc1bc('0x3a')](_[_0xc1bc('0x43')](_0x17d39b[_0xc1bc('0x38')],_0x4faa5f[_0xc1bc('0x3a')]),_0x43c760);if(_0x17d39b[_0xc1bc('0x38')][_0xc1bc('0x44')]){_0x433913[_0xc1bc('0x42')]=_['merge'](_0x433913[_0xc1bc('0x42')],{'$or':_[_0xc1bc('0x33')](_0x43c760,function(_0x2af5b1){if(_0x2af5b1[_0xc1bc('0x36')]!==_0xc1bc('0x45')){var _0xe2f77={};_0xe2f77[_0x2af5b1[_0xc1bc('0x30')]]={'$like':'%'+_0x17d39b[_0xc1bc('0x38')][_0xc1bc('0x44')]+'%'};return _0xe2f77;}})});}_0x433913=_['merge']({},_0x433913,_0x17d39b[_0xc1bc('0x46')]);var _0x2f4bd1={'where':_0x433913[_0xc1bc('0x42')]};return db['SmsQueue'][_0xc1bc('0x23')](_0x2f4bd1)[_0xc1bc('0x2b')](function(_0x32fa3b){_0x551999['count']=_0x32fa3b;if(_0x17d39b[_0xc1bc('0x38')]['includeAll']){_0x433913[_0xc1bc('0x47')]=[{'all':!![]}];}return db['SmsQueue'][_0xc1bc('0x48')](_0x433913);})[_0xc1bc('0x2b')](function(_0x4b4ce1){_0x551999[_0xc1bc('0x49')]=_0x4b4ce1;return _0x551999;})[_0xc1bc('0x2b')](respondWithFilteredResult(_0x57326c,_0x433913))[_0xc1bc('0x4a')](handleError(_0x57326c,null));};exports[_0xc1bc('0x4b')]=function(_0xd770,_0x22f56f){var _0x297f91={'raw':!![],'where':{'id':_0xd770[_0xc1bc('0x4c')]['id']}},_0x8e3208={};_0x8e3208[_0xc1bc('0x37')]=_[_0xc1bc('0x39')](db[_0xc1bc('0x34')][_0xc1bc('0x35')]);_0x8e3208[_0xc1bc('0x38')]=_[_0xc1bc('0x39')](_0xd770[_0xc1bc('0x38')]);_0x8e3208[_0xc1bc('0x3a')]=_[_0xc1bc('0x3b')](_0x8e3208[_0xc1bc('0x37')],_0x8e3208[_0xc1bc('0x38')]);_0x297f91[_0xc1bc('0x3c')]=_['intersection'](_0x8e3208['model'],qs[_0xc1bc('0x3d')](_0xd770['query']['fields']));_0x297f91['attributes']=_0x297f91['attributes'][_0xc1bc('0x3e')]?_0x297f91['attributes']:_0x8e3208['model'];if(_0xd770[_0xc1bc('0x38')][_0xc1bc('0x4d')]){_0x297f91['include']=[{'all':!![]}];}_0x297f91=_['merge']({},_0x297f91,_0xd770[_0xc1bc('0x46')]);return db[_0xc1bc('0x34')]['find'](_0x297f91)['then'](handleEntityNotFound(_0x22f56f,null))['then'](respondWithResult(_0x22f56f,null))[_0xc1bc('0x4a')](handleError(_0x22f56f,null));};exports[_0xc1bc('0x4e')]=function(_0x136b2e,_0x369bb6){return db['SmsQueue'][_0xc1bc('0x4e')](_0x136b2e[_0xc1bc('0x4f')],{})[_0xc1bc('0x2b')](function(_0x5380e9){var _0x304699=_0x136b2e[_0xc1bc('0x50')][_0xc1bc('0x2c')]({'plain':!![]});if(!_0x304699)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x304699[_0xc1bc('0x51')]===_0xc1bc('0x50')){var _0x3ea179=_0x5380e9[_0xc1bc('0x2c')]({'plain':!![]});var _0x51cd3b=_0xc1bc('0x52');return db[_0xc1bc('0x53')]['find']({'where':{'name':_0x51cd3b,'userProfileId':_0x304699[_0xc1bc('0x54')]},'raw':!![]})[_0xc1bc('0x2b')](function(_0x8700fb){if(_0x8700fb&&_0x8700fb[_0xc1bc('0x55')]===0x0){return db[_0xc1bc('0x56')][_0xc1bc('0x4e')]({'name':_0x3ea179['name'],'resourceId':_0x3ea179['id'],'type':_0x8700fb[_0xc1bc('0x30')],'sectionId':_0x8700fb['id']},{})[_0xc1bc('0x2b')](function(){return _0x5380e9;});}else{return _0x5380e9;}})['catch'](function(_0x4c6433){logger['error'](_0xc1bc('0x57'),_0x4c6433);throw _0x4c6433;});}return _0x5380e9;})['then'](respondWithResult(_0x369bb6,0xc9))[_0xc1bc('0x4a')](handleError(_0x369bb6,null));};exports['update']=function(_0x1358e4,_0x4b21f5){if(_0x1358e4[_0xc1bc('0x4f')]['id']){delete _0x1358e4['body']['id'];}return db['SmsQueue'][_0xc1bc('0x58')]({'where':{'id':_0x1358e4['params']['id']}})[_0xc1bc('0x2b')](handleEntityNotFound(_0x4b21f5,null))['then'](saveUpdates(_0x1358e4['body'],null))[_0xc1bc('0x2b')](respondWithResult(_0x4b21f5,null))['catch'](handleError(_0x4b21f5,null));};exports[_0xc1bc('0x2d')]=function(_0x4f9469,_0x1a89db){return db[_0xc1bc('0x34')][_0xc1bc('0x58')]({'where':{'id':_0x4f9469['params']['id']}})['then'](handleEntityNotFound(_0x1a89db,null))[_0xc1bc('0x2b')](removeEntity(_0x1a89db,null))[_0xc1bc('0x4a')](handleError(_0x1a89db,null));};exports['describe']=function(_0x97ebb5,_0x24a027){return db['SmsQueue'][_0xc1bc('0x59')]()[_0xc1bc('0x2b')](respondWithResult(_0x24a027,null))[_0xc1bc('0x4a')](handleError(_0x24a027,null));};exports[_0xc1bc('0x5a')]=function(_0x434764,_0x175e80,_0x42dcbc){var _0x2ec297={'raw':!![],'where':{}},_0x444608={},_0x2946dd;return db[_0xc1bc('0x34')][_0xc1bc('0x5b')]({'where':{'id':_0x434764[_0xc1bc('0x4c')]['id']}})[_0xc1bc('0x2b')](handleEntityNotFound(_0x175e80,null))[_0xc1bc('0x2b')](function(_0x405a8c){if(_0x405a8c){_0x2946dd=_0x405a8c[_0xc1bc('0x2c')]({'plain':!![]});_0x444608[_0xc1bc('0x37')]=_[_0xc1bc('0x39')](db['UserSmsQueue'][_0xc1bc('0x35')]);_0x444608[_0xc1bc('0x38')]=_[_0xc1bc('0x39')](_0x434764['query']);_0x444608[_0xc1bc('0x3a')]=_[_0xc1bc('0x3b')](_0x444608['model'],_0x444608[_0xc1bc('0x38')]);_0x2ec297[_0xc1bc('0x3c')]=_[_0xc1bc('0x3b')](_0x444608[_0xc1bc('0x37')],qs[_0xc1bc('0x3d')](_0x434764[_0xc1bc('0x38')][_0xc1bc('0x3d')]));_0x2ec297[_0xc1bc('0x3c')]=_0x2ec297['attributes'][_0xc1bc('0x3e')]?_0x2ec297[_0xc1bc('0x3c')]:_0x444608[_0xc1bc('0x37')];if(!_0x434764['query']['hasOwnProperty'](_0xc1bc('0x40'))){_0x2ec297[_0xc1bc('0x25')]=qs['limit'](_0x434764[_0xc1bc('0x38')][_0xc1bc('0x25')]);_0x2ec297[_0xc1bc('0x24')]=qs[_0xc1bc('0x24')](_0x434764[_0xc1bc('0x38')][_0xc1bc('0x24')]);}_0x2ec297[_0xc1bc('0x5c')]=qs[_0xc1bc('0x41')](_0x434764[_0xc1bc('0x38')][_0xc1bc('0x41')]);_0x2ec297[_0xc1bc('0x42')]=qs[_0xc1bc('0x3a')](_['pick'](_0x434764[_0xc1bc('0x38')],_0x444608[_0xc1bc('0x3a')]));_0x2ec297['where'][_0xc1bc('0x5d')]=_0x405a8c['id'];if(_0x434764[_0xc1bc('0x38')][_0xc1bc('0x44')]){_0x2ec297[_0xc1bc('0x42')]=_[_0xc1bc('0x5e')](_0x2ec297[_0xc1bc('0x42')],{'$or':_[_0xc1bc('0x33')](_0x2ec297[_0xc1bc('0x3c')],function(_0x3a5b94){var _0x35b4b8={};_0x35b4b8[_0x3a5b94]={'$like':'%'+_0x434764['query']['filter']+'%'};return _0x35b4b8;})});}_0x2ec297=_['merge']({},_0x2ec297,_0x434764[_0xc1bc('0x46')]);return db[_0xc1bc('0x5f')][_0xc1bc('0x48')](_0x2ec297);}})[_0xc1bc('0x2b')](function(_0xb024d5){if(_0xb024d5){return db[_0xc1bc('0x60')][_0xc1bc('0x61')]({'where':{'id':_[_0xc1bc('0x33')](_0xb024d5,_0xc1bc('0x62')),'role':_0xc1bc('0x63')},'attributes':['id','name','smsPause',_0xc1bc('0x64'),_0xc1bc('0x65')]});}})[_0xc1bc('0x2b')](function(_0x2442d4){if(_0x2442d4){return{'count':_0x2442d4[_0xc1bc('0x23')],'rows':_[_0xc1bc('0x33')](_0x2442d4[_0xc1bc('0x49')],function(_0x486eb6){return{'membername':_0x486eb6[_0xc1bc('0x30')],'UserId':_0x486eb6['id'],'queue_name':_0x2946dd[_0xc1bc('0x30')],'SmsQueueId':_0x2946dd['id'],'interface':util[_0xc1bc('0x66')](_0xc1bc('0x67'),_0xc1bc('0x68'),_0x486eb6[_0xc1bc('0x30')]),'penalty':0x0,'paused':_0x486eb6['smsPause'],'createdAt':_0x486eb6[_0xc1bc('0x65')],'updatedAt':_0x486eb6[_0xc1bc('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x175e80,_0x2ec297))[_0xc1bc('0x4a')](handleError(_0x175e80,null));};exports[_0xc1bc('0x69')]=function(_0x2e8bb2,_0x2e02c7,_0x22f7c0){var _0x3fac4f={};var _0x2a1718={};var _0x434b8d;var _0xb3e55a;return db['SmsQueue']['findOne']({'where':{'id':_0x2e8bb2[_0xc1bc('0x4c')]['id']}})[_0xc1bc('0x2b')](handleEntityNotFound(_0x2e02c7,null))[_0xc1bc('0x2b')](function(_0x32dfb4){if(_0x32dfb4){_0x434b8d=_0x32dfb4;_0x2a1718[_0xc1bc('0x37')]=_[_0xc1bc('0x39')](db[_0xc1bc('0x6a')][_0xc1bc('0x35')]);_0x2a1718[_0xc1bc('0x38')]=_[_0xc1bc('0x39')](_0x2e8bb2[_0xc1bc('0x38')]);_0x2a1718['filters']=_[_0xc1bc('0x3b')](_0x2a1718[_0xc1bc('0x37')],_0x2a1718['query']);_0x3fac4f['attributes']=_[_0xc1bc('0x3b')](_0x2a1718[_0xc1bc('0x37')],qs[_0xc1bc('0x3d')](_0x2e8bb2[_0xc1bc('0x38')]['fields']));_0x3fac4f[_0xc1bc('0x3c')]=_0x3fac4f[_0xc1bc('0x3c')][_0xc1bc('0x3e')]?_0x3fac4f[_0xc1bc('0x3c')]:_0x2a1718[_0xc1bc('0x37')];_0x3fac4f['order']=qs[_0xc1bc('0x41')](_0x2e8bb2[_0xc1bc('0x38')][_0xc1bc('0x41')]);_0x3fac4f['where']=qs['filters'](_[_0xc1bc('0x43')](_0x2e8bb2[_0xc1bc('0x38')],_0x2a1718[_0xc1bc('0x3a')]));if(_0x2e8bb2[_0xc1bc('0x38')]['filter']){_0x3fac4f[_0xc1bc('0x42')]=_[_0xc1bc('0x5e')](_0x3fac4f[_0xc1bc('0x42')],{'$or':_['map'](_0x3fac4f[_0xc1bc('0x3c')],function(_0x3cdf57){var _0x2623b2={};_0x2623b2[_0x3cdf57]={'$like':'%'+_0x2e8bb2['query']['filter']+'%'};return _0x2623b2;})});}_0x3fac4f=_[_0xc1bc('0x5e')]({},_0x3fac4f,_0x2e8bb2[_0xc1bc('0x46')]);return _0x434b8d[_0xc1bc('0x69')](_0x3fac4f);}})[_0xc1bc('0x2b')](function(_0x4b3353){if(_0x4b3353){_0xb3e55a=_0x4b3353[_0xc1bc('0x3e')];if(!_0x2e8bb2[_0xc1bc('0x38')]['hasOwnProperty'](_0xc1bc('0x40'))){_0x3fac4f[_0xc1bc('0x25')]=qs['limit'](_0x2e8bb2['query'][_0xc1bc('0x25')]);_0x3fac4f[_0xc1bc('0x24')]=qs['offset'](_0x2e8bb2[_0xc1bc('0x38')]['offset']);}return _0x434b8d[_0xc1bc('0x69')](_0x3fac4f);}})['then'](function(_0x5a1ef7){if(_0x5a1ef7){return _0x5a1ef7?{'count':_0xb3e55a,'rows':_0x5a1ef7}:null;}})[_0xc1bc('0x2b')](respondWithResult(_0x2e02c7,null))[_0xc1bc('0x4a')](handleError(_0x2e02c7,null));};exports[_0xc1bc('0x6b')]=function(_0x3e1229,_0x28f206,_0x28ba73){var _0x1da743=_0x3e1229[_0xc1bc('0x4f')]['ids'];return db[_0xc1bc('0x6a')][_0xc1bc('0x48')]({'where':{'id':_0x1da743},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc1bc('0x6c'),'attributes':['id',_0xc1bc('0x30'),_0xc1bc('0x6d'),_0xc1bc('0x6e'),_0xc1bc('0x6f')],'raw':!![]}]})['then'](function(_0x355e20){if(_0x355e20){var _0x3542c5=_[_0xc1bc('0x70')](_0x355e20,function(_0x6368ce){var _0x9bc0bc=_0x6368ce['get']({'plain':!![]});return _0x9bc0bc[_0xc1bc('0x6c')];});return db[_0xc1bc('0x34')][_0xc1bc('0x58')]({'where':{'id':_0x3e1229['params']['id']}})[_0xc1bc('0x2b')](function(_0x51fbdb){return db['sequelize'][_0xc1bc('0x71')](function(_0x4fac75){return _0x51fbdb['addTeams'](_0x1da743,{'transaction':_0x4fac75})[_0xc1bc('0x2b')](function(){return BPromise['each'](_0x3542c5,function(_0x534354){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x534354['id'],'SmsQueueId':_0x3e1229[_0xc1bc('0x4c')]['id']},'transaction':_0x4fac75});});})[_0xc1bc('0x2b')](function(){_0x3542c5[_0xc1bc('0x72')](function(_0x10519d){socket[_0xc1bc('0x73')](_0xc1bc('0x74'),{'UserId':_0x10519d['id'],'SmsQueueId':_0x51fbdb['id']});});});});});}})[_0xc1bc('0x2b')](respondWithStatusCode(_0x28f206,null))[_0xc1bc('0x4a')](handleError(_0x28f206,null));};exports['removeTeams']=function(_0x306c87,_0x5df6e0,_0x326dd8){return db[_0xc1bc('0x6a')][_0xc1bc('0x48')]({'where':{'id':_0x306c87[_0xc1bc('0x38')][_0xc1bc('0x75')]},'attributes':['id'],'include':[{'model':db[_0xc1bc('0x60')],'as':_0xc1bc('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xc1bc('0x2b')](handleEntityNotFound(_0x5df6e0,null))['then'](function(_0xe94c35){var _0x38a16e=_[_0xc1bc('0x33')](_0xe94c35,'id');var _0x166e79=[];var _0x2b61b5=[];var _0x58bebe=squel[_0xc1bc('0x76')]();_0x58bebe['field'](_0xc1bc('0x77'))[_0xc1bc('0x78')](_0xc1bc('0x79'),'tq')[_0xc1bc('0x7a')](_0xc1bc('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc1bc('0x42')](_0xc1bc('0x7c'),_0x306c87[_0xc1bc('0x4c')]['id']);for(var _0x2381cb=0x0;_0x2381cb<_0xe94c35[_0xc1bc('0x3e')];_0x2381cb+=0x1){let _0x29e554=_0xe94c35[_0x2381cb];for(var _0x31b145=0x0;_0x31b145<_0x29e554['Agents'][_0xc1bc('0x3e')];_0x31b145+=0x1){let _0x6a3d9d=_0x29e554[_0xc1bc('0x6c')][_0x31b145];var _0x52fd60=_0x58bebe[_0xc1bc('0x7d')]();_0x52fd60[_0xc1bc('0x42')](_0xc1bc('0x7e'),_0x6a3d9d['id']);_0x2b61b5[_0xc1bc('0x7f')](db['sequelize']['query'](_0x52fd60['toString'](),{'type':db[_0xc1bc('0x80')][_0xc1bc('0x81')][_0xc1bc('0x82')]})[_0xc1bc('0x2b')](function(_0x7d5da5){if(_0x7d5da5['length']===0x1){return _0x6a3d9d['id'];}else{var _0x56e9e8=_[_0xc1bc('0x83')](_[_0xc1bc('0x33')](_0x7d5da5,_0xc1bc('0x84')),function(_0x108fbb){return _['includes'](_0x38a16e,_0x108fbb);});if(_0x56e9e8){return _0x6a3d9d['id'];}}}));}}return BPromise[_0xc1bc('0x85')](_0x2b61b5)[_0xc1bc('0x2b')](function(_0x552cf3){_0x166e79=_(_0x166e79)[_0xc1bc('0x86')](_0x552cf3)[_0xc1bc('0x87')]()[_0xc1bc('0x88')]();return db[_0xc1bc('0x34')]['find']({'where':{'id':_0x306c87['params']['id']}})[_0xc1bc('0x2b')](function(_0x2ada4b){return db[_0xc1bc('0x80')][_0xc1bc('0x71')](function(_0x5ebd53){return _0x2ada4b[_0xc1bc('0x89')](_0x306c87['query'][_0xc1bc('0x75')],{'transaction':_0x5ebd53})[_0xc1bc('0x2b')](function(){if(!_[_0xc1bc('0x8a')](_0x166e79)){return _0x2ada4b[_0xc1bc('0x8b')](_0x166e79,{'transaction':_0x5ebd53});}})[_0xc1bc('0x2b')](function(){_0x166e79['forEach'](function(_0x125a36){socket[_0xc1bc('0x73')](_0xc1bc('0x8c'),{'UserId':_0x125a36,'SmsQueueId':_0x2ada4b['id']});});});});});});})[_0xc1bc('0x2b')](respondWithStatusCode(_0x5df6e0,null))['catch'](handleError(_0x5df6e0,null));};exports['addAgents']=function(_0x5bd967,_0x2e45b2,_0x46a300){return db['SmsQueue']['find']({'where':{'id':_0x5bd967[_0xc1bc('0x4c')]['id']}})[_0xc1bc('0x2b')](handleEntityNotFound(_0x2e45b2,null))['then'](function(_0x3d966c){if(_0x3d966c){return _0x3d966c['addAgents'](_0x5bd967[_0xc1bc('0x4f')]['ids'],_['omit'](_0x5bd967[_0xc1bc('0x4f')],[_0xc1bc('0x75'),'id'])||{})['spread'](function(_0x213a85){for(var _0x4b54b6=0x0;_0x4b54b6<_0x5bd967[_0xc1bc('0x4f')][_0xc1bc('0x75')][_0xc1bc('0x3e')];_0x4b54b6+=0x1){socket[_0xc1bc('0x73')]('userSmsQueue:save',{'UserId':_0x5bd967['body'][_0xc1bc('0x75')][_0x4b54b6],'SmsQueueId':_0x5bd967['params']['id']});}return _0x213a85;});}})['then'](respondWithResult(_0x2e45b2,null))[_0xc1bc('0x4a')](handleError(_0x2e45b2,null));};exports['removeAgents']=function(_0xdf9ca4,_0x386952,_0x5e432f){return db[_0xc1bc('0x34')]['find']({'where':{'id':_0xdf9ca4['params']['id']}})[_0xc1bc('0x2b')](handleEntityNotFound(_0x386952,null))[_0xc1bc('0x2b')](function(_0x4a2dab){if(_0x4a2dab){return _0x4a2dab[_0xc1bc('0x8b')](_0xdf9ca4[_0xc1bc('0x38')][_0xc1bc('0x75')])[_0xc1bc('0x2b')](function(){if(_['isArray'](_0xdf9ca4[_0xc1bc('0x38')][_0xc1bc('0x75')])){for(var _0x514c23=0x0;_0x514c23<_0xdf9ca4['query'][_0xc1bc('0x75')][_0xc1bc('0x3e')];_0x514c23+=0x1){socket['emit'](_0xc1bc('0x8c'),{'UserId':Number(_0xdf9ca4['query'][_0xc1bc('0x75')][_0x514c23]),'SmsQueueId':Number(_0xdf9ca4['params']['id'])});}}else{socket[_0xc1bc('0x73')]('userSmsQueue:remove',{'UserId':Number(_0xdf9ca4[_0xc1bc('0x38')]['ids']),'SmsQueueId':Number(_0xdf9ca4['params']['id'])});}});}})[_0xc1bc('0x2b')](respondWithStatusCode(_0x386952,null))[_0xc1bc('0x4a')](handleError(_0x386952,null));};exports[_0xc1bc('0x8d')]=function(_0x58f915,_0x22c8ec,_0x14d1ae){var _0x48e145={};var _0x3d375f={};var _0x4eb394;var _0x281fe1;return db['SmsQueue'][_0xc1bc('0x5b')]({'where':{'id':_0x58f915['params']['id']}})[_0xc1bc('0x2b')](handleEntityNotFound(_0x22c8ec,null))['then'](function(_0x493f96){if(_0x493f96){_0x4eb394=_0x493f96;_0x3d375f[_0xc1bc('0x37')]=_[_0xc1bc('0x39')](db[_0xc1bc('0x60')][_0xc1bc('0x35')]);_0x3d375f['query']=_['keys'](_0x58f915[_0xc1bc('0x38')]);_0x3d375f[_0xc1bc('0x3a')]=_['intersection'](_0x3d375f[_0xc1bc('0x37')],_0x3d375f[_0xc1bc('0x38')]);_0x48e145[_0xc1bc('0x3c')]=_['intersection'](_0x3d375f['model'],qs[_0xc1bc('0x3d')](_0x58f915[_0xc1bc('0x38')][_0xc1bc('0x3d')]));_0x48e145[_0xc1bc('0x3c')]=_0x48e145[_0xc1bc('0x3c')][_0xc1bc('0x3e')]?_0x48e145['attributes']:_0x3d375f[_0xc1bc('0x37')];_0x48e145['order']=qs['sort'](_0x58f915['query'][_0xc1bc('0x41')]);_0x48e145[_0xc1bc('0x42')]=qs[_0xc1bc('0x3a')](_[_0xc1bc('0x43')](_0x58f915[_0xc1bc('0x38')],_0x3d375f[_0xc1bc('0x3a')]));if(_0x58f915[_0xc1bc('0x38')][_0xc1bc('0x44')]){_0x48e145[_0xc1bc('0x42')]=_[_0xc1bc('0x5e')](_0x48e145['where'],{'$or':_[_0xc1bc('0x33')](_0x48e145[_0xc1bc('0x3c')],function(_0x4dc0f6){var _0x1b0fc7={};_0x1b0fc7[_0x4dc0f6]={'$like':'%'+_0x58f915[_0xc1bc('0x38')][_0xc1bc('0x44')]+'%'};return _0x1b0fc7;})});}_0x48e145=_[_0xc1bc('0x5e')]({},_0x48e145,_0x58f915[_0xc1bc('0x46')]);return _0x4eb394[_0xc1bc('0x8d')](_0x48e145);}})[_0xc1bc('0x2b')](function(_0x5e80da){if(_0x5e80da){_0x281fe1=_0x5e80da[_0xc1bc('0x3e')];if(!_0x58f915[_0xc1bc('0x38')]['hasOwnProperty'](_0xc1bc('0x40'))){_0x48e145[_0xc1bc('0x25')]=qs[_0xc1bc('0x25')](_0x58f915[_0xc1bc('0x38')]['limit']);_0x48e145['offset']=qs[_0xc1bc('0x24')](_0x58f915['query'][_0xc1bc('0x24')]);}return _0x4eb394['getAgents'](_0x48e145);}})[_0xc1bc('0x2b')](function(_0x1aa39f){if(_0x1aa39f){return _0x1aa39f?{'count':_0x281fe1,'rows':_0x1aa39f}:null;}})[_0xc1bc('0x2b')](respondWithResult(_0x22c8ec,null))['catch'](handleError(_0x22c8ec,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ef77f70..e83c843 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 _0x66c4=['update','remove','emit','hook','events','../../mysqldb','SmsQueue'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x66c4,0x1bd));var _0x466c=function(_0x17af40,_0x2a55d2){_0x17af40=_0x17af40-0x0;var _0xf35dc3=_0x66c4[_0x17af40];return _0xf35dc3;};'use strict';var EventEmitter=require(_0x466c('0x0'));var SmsQueue=require(_0x466c('0x1'))['db'][_0x466c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x466c('0x3'),'afterDestroy':_0x466c('0x4')};function emitEvent(_0x258654){return function(_0x5f2f58,_0x3f7e91,_0x1812bf){SmsQueueEvents[_0x466c('0x5')](_0x258654+':'+_0x5f2f58['id'],_0x5f2f58);SmsQueueEvents[_0x466c('0x5')](_0x258654,_0x5f2f58);_0x1812bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x466c('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xcda3=['save','remove','emit','hook','exports','../../mysqldb','SmsQueue'];(function(_0x14bb3b,_0x5459d3){var _0x17828b=function(_0xb48823){while(--_0xb48823){_0x14bb3b['push'](_0x14bb3b['shift']());}};_0x17828b(++_0x5459d3);}(_0xcda3,0xde));var _0x3cda=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xcda3[_0x3c8e9a];return _0x2d4c57;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x3cda('0x0'))['db'][_0x3cda('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3cda('0x2'),'afterUpdate':'update','afterDestroy':_0x3cda('0x3')};function emitEvent(_0x5aa6f4){return function(_0x3837c2,_0x3ce8b9,_0x132346){SmsQueueEvents[_0x3cda('0x4')](_0x5aa6f4+':'+_0x3837c2['id'],_0x3837c2);SmsQueueEvents['emit'](_0x5aa6f4,_0x3837c2);_0x132346(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x3cda('0x5')](e,emitEvent(event));}}module[_0x3cda('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 2a43f64..d97cb3d 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 _0xb5b7=['define','SmsQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb5b7,0x1f0));var _0x7b5b=function(_0x3d2763,_0x2ec071){_0x3d2763=_0x3d2763-0x0;var _0x40ad02=_0xb5b7[_0x3d2763];return _0x40ad02;};'use strict';var _=require(_0x7b5b('0x0'));var util=require(_0x7b5b('0x1'));var logger=require(_0x7b5b('0x2'))(_0x7b5b('0x3'));var moment=require(_0x7b5b('0x4'));var BPromise=require(_0x7b5b('0x5'));var rp=require(_0x7b5b('0x6'));var fs=require('fs');var path=require(_0x7b5b('0x7'));var rimraf=require(_0x7b5b('0x8'));var config=require(_0x7b5b('0x9'));var attributes=require(_0x7b5b('0xa'));module['exports']=function(_0x42a5f9,_0x2f899a){return _0x42a5f9[_0x7b5b('0xb')](_0x7b5b('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x745a=['bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','util','../../config/logger','api','moment'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x745a,0x140));var _0xa745=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x745a[_0x1b6186];return _0x186121;};'use strict';var _=require('lodash');var util=require(_0xa745('0x0'));var logger=require(_0xa745('0x1'))(_0xa745('0x2'));var moment=require(_0xa745('0x3'));var BPromise=require(_0xa745('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa745('0x5'));var rimraf=require(_0xa745('0x6'));var config=require(_0xa745('0x7'));var attributes=require(_0xa745('0x8'));module[_0xa745('0x9')]=function(_0x2f71f4,_0x411ad2){return _0x2f71f4[_0xa745('0xa')]('SmsQueue',attributes,{'tableName':_0xa745('0xb'),'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 03e1e78..c8d6fc6 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 _0x145e=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','where','limit','include','map','model','attributes','then','debug','stringify','ShowSmsQueue','raw','util'];(function(_0x49ba49,_0x3861d9){var _0x14921e=function(_0xb49336){while(--_0xb49336){_0x49ba49['push'](_0x49ba49['shift']());}};_0x14921e(++_0x3861d9);}(_0x145e,0x1ac));var _0xe145=function(_0x36de4f,_0x350d30){_0x36de4f=_0x36de4f-0x0;var _0x1a91c2=_0x145e[_0x36de4f];return _0x1a91c2;};'use strict';var _=require('lodash');var util=require(_0xe145('0x0'));var moment=require(_0xe145('0x1'));var BPromise=require(_0xe145('0x2'));var rs=require(_0xe145('0x3'));var fs=require('fs');var Redis=require(_0xe145('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe145('0x5'));var logger=require(_0xe145('0x6'))(_0xe145('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe145('0x8')]['http']({'port':0x232a});config[_0xe145('0x9')]=_[_0xe145('0xa')](config[_0xe145('0x9')],{'host':_0xe145('0xb'),'port':0x18eb});var socket=require(_0xe145('0xc'))(new Redis(config['redis']));require(_0xe145('0xd'))[_0xe145('0xe')](socket);function respondWithRpcPromise(_0x4cbcee,_0x17b176,_0x18173a){return new BPromise(function(_0x2ec946,_0x53572d){return client[_0xe145('0xf')](_0x4cbcee,_0x18173a)['then'](function(_0x172f45){logger[_0xe145('0x10')](_0xe145('0x11'),_0x17b176,_0xe145('0x12'));logger['debug'](_0xe145('0x13'),_0x17b176,_0xe145('0x12'),JSON['stringify'](_0x172f45));if(_0x172f45['error']){if(_0x172f45[_0xe145('0x14')][_0xe145('0x15')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x17b176,_0x172f45[_0xe145('0x14')]['message']);return _0x53572d(_0x172f45[_0xe145('0x14')][_0xe145('0x16')]);}logger['error'](_0xe145('0x11'),_0x17b176,_0x172f45['error'][_0xe145('0x16')]);return _0x2ec946(_0x172f45[_0xe145('0x14')][_0xe145('0x16')]);}else{logger[_0xe145('0x10')](_0xe145('0x11'),_0x17b176,'request\x20sent');_0x2ec946(_0x172f45['result'][_0xe145('0x16')]);}})[_0xe145('0x17')](function(_0x1f54ab){logger[_0xe145('0x14')](_0xe145('0x11'),_0x17b176,_0x1f54ab);_0x53572d(_0x1f54ab);});});}exports[_0xe145('0x18')]=function(_0x63bb2f){var _0x336eb0=this;return new Promise(function(_0x5585fe,_0x2e8f62){return db[_0xe145('0x19')][_0xe145('0x1a')]({'raw':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1c')]||null:null,'attributes':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')]['attributes']||null:null,'limit':_0x63bb2f['options']?_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1d')]||null:null,'include':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1e')],function(_0x10b718){return{'model':db[_0x10b718[_0xe145('0x20')]],'as':_0x10b718['as'],'attributes':_0x10b718[_0xe145('0x21')],'include':_0x10b718['include']?_[_0xe145('0x1f')](_0x10b718['include'],function(_0x123d40){return{'model':db[_0x123d40[_0xe145('0x20')]],'as':_0x123d40['as'],'attributes':_0x123d40[_0xe145('0x21')],'include':_0x123d40[_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x123d40[_0xe145('0x1e')],function(_0x5325f6){return{'model':db[_0x5325f6[_0xe145('0x20')]],'as':_0x5325f6['as'],'attributes':_0x5325f6[_0xe145('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe145('0x22')](function(_0xb78c30){logger[_0xe145('0x10')](_0xe145('0x18'),_0x63bb2f);logger[_0xe145('0x23')](_0xe145('0x18'),_0x63bb2f,JSON[_0xe145('0x24')](_0xb78c30));_0x5585fe(_0xb78c30);})[_0xe145('0x17')](function(_0x5df922){logger[_0xe145('0x14')](_0xe145('0x18'),_0x5df922['message'],_0x63bb2f);_0x2e8f62(_0x336eb0['error'](0x1f4,_0x5df922[_0xe145('0x16')]));});});};exports[_0xe145('0x25')]=function(_0x25adf3){var _0x8ae506=this;return new Promise(function(_0x4158a1,_0x2d35fd){return db[_0xe145('0x19')]['find']({'raw':_0x25adf3[_0xe145('0x1b')]?_0x25adf3['options'][_0xe145('0x26')]===undefined?!![]:![]:!![],'where':_0x25adf3[_0xe145('0x1b')]?_0x25adf3[_0xe145('0x1b')][_0xe145('0x1c')]||null:null,'attributes':_0x25adf3[_0xe145('0x1b')]?_0x25adf3['options']['attributes']||null:null,'include':_0x25adf3['options']?_0x25adf3[_0xe145('0x1b')][_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x25adf3[_0xe145('0x1b')]['include'],function(_0x22985){return{'model':db[_0x22985[_0xe145('0x20')]],'as':_0x22985['as'],'attributes':_0x22985[_0xe145('0x21')],'include':_0x22985['include']?_[_0xe145('0x1f')](_0x22985[_0xe145('0x1e')],function(_0x4f2444){return{'model':db[_0x4f2444[_0xe145('0x20')]],'as':_0x4f2444['as'],'attributes':_0x4f2444['attributes'],'include':_0x4f2444[_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x4f2444[_0xe145('0x1e')],function(_0x2bf272){return{'model':db[_0x2bf272[_0xe145('0x20')]],'as':_0x2bf272['as'],'attributes':_0x2bf272[_0xe145('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe145('0x22')](function(_0x335414){logger['info'](_0xe145('0x25'),_0x25adf3);logger['debug'](_0xe145('0x25'),_0x25adf3,JSON[_0xe145('0x24')](_0x335414));_0x4158a1(_0x335414);})[_0xe145('0x17')](function(_0x398f6c){logger[_0xe145('0x14')]('ShowSmsQueue',_0x398f6c[_0xe145('0x16')],_0x25adf3);_0x2d35fd(_0x8ae506['error'](0x1f4,_0x398f6c[_0xe145('0x16')]));});});}; \ No newline at end of file +var _0x94e2=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsQueue','findAll','options','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x94e2,0x11a));var _0x294e=function(_0x561049,_0x330926){_0x561049=_0x561049-0x0;var _0x52f109=_0x94e2[_0x561049];return _0x52f109;};'use strict';var _=require(_0x294e('0x0'));var util=require(_0x294e('0x1'));var moment=require('moment');var BPromise=require(_0x294e('0x2'));var rs=require(_0x294e('0x3'));var fs=require('fs');var Redis=require(_0x294e('0x4'));var db=require(_0x294e('0x5'))['db'];var utils=require(_0x294e('0x6'));var logger=require('../../config/logger')(_0x294e('0x7'));var config=require(_0x294e('0x8'));var jayson=require(_0x294e('0x9'));var client=jayson[_0x294e('0xa')][_0x294e('0xb')]({'port':0x232a});config[_0x294e('0xc')]=_['defaults'](config['redis'],{'host':_0x294e('0xd'),'port':0x18eb});var socket=require(_0x294e('0xe'))(new Redis(config[_0x294e('0xc')]));require(_0x294e('0xf'))[_0x294e('0x10')](socket);function respondWithRpcPromise(_0x159200,_0x1fd4c8,_0x5087d4){return new BPromise(function(_0x33848f,_0x139eb2){return client['request'](_0x159200,_0x5087d4)[_0x294e('0x11')](function(_0x5281ee){logger['info'](_0x294e('0x12'),_0x1fd4c8,_0x294e('0x13'));logger[_0x294e('0x14')](_0x294e('0x15'),_0x1fd4c8,_0x294e('0x13'),JSON[_0x294e('0x16')](_0x5281ee));if(_0x5281ee[_0x294e('0x17')]){if(_0x5281ee['error'][_0x294e('0x18')]===0x1f4){logger[_0x294e('0x17')](_0x294e('0x12'),_0x1fd4c8,_0x5281ee[_0x294e('0x17')][_0x294e('0x19')]);return _0x139eb2(_0x5281ee['error']['message']);}logger[_0x294e('0x17')](_0x294e('0x12'),_0x1fd4c8,_0x5281ee[_0x294e('0x17')][_0x294e('0x19')]);return _0x33848f(_0x5281ee[_0x294e('0x17')]['message']);}else{logger[_0x294e('0x1a')]('SmsQueue,\x20%s,\x20%s',_0x1fd4c8,_0x294e('0x13'));_0x33848f(_0x5281ee[_0x294e('0x1b')][_0x294e('0x19')]);}})[_0x294e('0x1c')](function(_0x189cc9){logger[_0x294e('0x17')]('SmsQueue,\x20%s,\x20%s',_0x1fd4c8,_0x189cc9);_0x139eb2(_0x189cc9);});});}exports['GetSmsQueue']=function(_0x3d4072){var _0x282b80=this;return new Promise(function(_0x14870a,_0x2d088d){return db[_0x294e('0x1d')][_0x294e('0x1e')]({'raw':_0x3d4072[_0x294e('0x1f')]?_0x3d4072[_0x294e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3d4072[_0x294e('0x1f')]?_0x3d4072[_0x294e('0x1f')][_0x294e('0x20')]||null:null,'attributes':_0x3d4072[_0x294e('0x1f')]?_0x3d4072[_0x294e('0x1f')][_0x294e('0x21')]||null:null,'limit':_0x3d4072[_0x294e('0x1f')]?_0x3d4072[_0x294e('0x1f')][_0x294e('0x22')]||null:null,'include':_0x3d4072[_0x294e('0x1f')]?_0x3d4072['options'][_0x294e('0x23')]?_[_0x294e('0x24')](_0x3d4072[_0x294e('0x1f')][_0x294e('0x23')],function(_0x480b74){return{'model':db[_0x480b74['model']],'as':_0x480b74['as'],'attributes':_0x480b74[_0x294e('0x21')],'include':_0x480b74[_0x294e('0x23')]?_[_0x294e('0x24')](_0x480b74[_0x294e('0x23')],function(_0x13dc30){return{'model':db[_0x13dc30[_0x294e('0x25')]],'as':_0x13dc30['as'],'attributes':_0x13dc30['attributes'],'include':_0x13dc30['include']?_[_0x294e('0x24')](_0x13dc30['include'],function(_0x3ce074){return{'model':db[_0x3ce074[_0x294e('0x25')]],'as':_0x3ce074['as'],'attributes':_0x3ce074[_0x294e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x294e('0x11')](function(_0x3bc9c6){logger[_0x294e('0x1a')](_0x294e('0x26'),_0x3d4072);logger[_0x294e('0x14')](_0x294e('0x26'),_0x3d4072,JSON[_0x294e('0x16')](_0x3bc9c6));_0x14870a(_0x3bc9c6);})[_0x294e('0x1c')](function(_0x5be7bc){logger[_0x294e('0x17')](_0x294e('0x26'),_0x5be7bc[_0x294e('0x19')],_0x3d4072);_0x2d088d(_0x282b80[_0x294e('0x17')](0x1f4,_0x5be7bc['message']));});});};exports[_0x294e('0x27')]=function(_0x3d0da5){var _0x2b5787=this;return new Promise(function(_0x1a1d16,_0x21479d){return db[_0x294e('0x1d')][_0x294e('0x28')]({'raw':_0x3d0da5[_0x294e('0x1f')]?_0x3d0da5[_0x294e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3d0da5['options']?_0x3d0da5['options'][_0x294e('0x20')]||null:null,'attributes':_0x3d0da5[_0x294e('0x1f')]?_0x3d0da5[_0x294e('0x1f')][_0x294e('0x21')]||null:null,'include':_0x3d0da5[_0x294e('0x1f')]?_0x3d0da5[_0x294e('0x1f')][_0x294e('0x23')]?_[_0x294e('0x24')](_0x3d0da5['options'][_0x294e('0x23')],function(_0x42a131){return{'model':db[_0x42a131[_0x294e('0x25')]],'as':_0x42a131['as'],'attributes':_0x42a131[_0x294e('0x21')],'include':_0x42a131[_0x294e('0x23')]?_[_0x294e('0x24')](_0x42a131[_0x294e('0x23')],function(_0x587f3f){return{'model':db[_0x587f3f[_0x294e('0x25')]],'as':_0x587f3f['as'],'attributes':_0x587f3f[_0x294e('0x21')],'include':_0x587f3f['include']?_['map'](_0x587f3f['include'],function(_0x209547){return{'model':db[_0x209547[_0x294e('0x25')]],'as':_0x209547['as'],'attributes':_0x209547[_0x294e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x294e('0x11')](function(_0x3e47fa){logger['info']('ShowSmsQueue',_0x3d0da5);logger['debug'](_0x294e('0x27'),_0x3d0da5,JSON[_0x294e('0x16')](_0x3e47fa));_0x1a1d16(_0x3e47fa);})['catch'](function(_0x5cda1c){logger[_0x294e('0x17')](_0x294e('0x27'),_0x5cda1c[_0x294e('0x19')],_0x3d0da5);_0x21479d(_0x2b5787[_0x294e('0x17')](0x1f4,_0x5cda1c[_0x294e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 62d82b1..6eac6e4 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 _0xc9f8=['smsQueue:','./smsQueue.events','save','remove','update','length'];(function(_0x3c546f,_0x277f67){var _0x505714=function(_0x162ee6){while(--_0x162ee6){_0x3c546f['push'](_0x3c546f['shift']());}};_0x505714(++_0x277f67);}(_0xc9f8,0x1db));var _0x8c9f=function(_0x4e79f8,_0x466259){_0x4e79f8=_0x4e79f8-0x0;var _0xa96f27=_0xc9f8[_0x4e79f8];return _0xa96f27;};'use strict';var SmsQueueEvents=require(_0x8c9f('0x0'));var events=[_0x8c9f('0x1'),_0x8c9f('0x2'),_0x8c9f('0x3')];function createListener(_0x22be8a,_0x1652e0){return function(_0x21c21a){_0x1652e0['emit'](_0x22be8a,_0x21c21a);};}function removeListener(_0x5d7f01,_0x4d4731){return function(){SmsQueueEvents['removeListener'](_0x5d7f01,_0x4d4731);};}exports['register']=function(_0x1c1812){for(var _0x23a6f3=0x0,_0x145b2d=events[_0x8c9f('0x4')];_0x23a6f3<_0x145b2d;_0x23a6f3++){var _0x211caf=events[_0x23a6f3];var _0x2e1bbb=createListener(_0x8c9f('0x5')+_0x211caf,_0x1c1812);SmsQueueEvents['on'](_0x211caf,_0x2e1bbb);}}; \ No newline at end of file +var _0x88fb=['remove','update','emit','removeListener','smsQueue:','save'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x88fb,0xcb));var _0xb88f=function(_0x3077dc,_0xf990d9){_0x3077dc=_0x3077dc-0x0;var _0x323a21=_0x88fb[_0x3077dc];return _0x323a21;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xb88f('0x0'),_0xb88f('0x1'),_0xb88f('0x2')];function createListener(_0xd2890e,_0x4eaae1){return function(_0x269ff9){_0x4eaae1[_0xb88f('0x3')](_0xd2890e,_0x269ff9);};}function removeListener(_0x3c0db7,_0x20890e){return function(){SmsQueueEvents[_0xb88f('0x4')](_0x3c0db7,_0x20890e);};}exports['register']=function(_0x5305ba){for(var _0x5534e9=0x0,_0x329a71=events['length'];_0x5534e9<_0x329a71;_0x5534e9++){var _0x53c631=events[_0x5534e9];var _0x16e92a=createListener(_0xb88f('0x5')+_0x53c631,_0x5305ba);SmsQueueEvents['on'](_0x53c631,_0x16e92a);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 9a54c02..fb8a207 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 _0x5fde=['delete','/:id','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','show','post','update'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x5fde,0x80));var _0xe5fd=function(_0xadb3a0,_0x18afc8){_0xadb3a0=_0xadb3a0-0x0;var _0x6dd86c=_0x5fde[_0xadb3a0];return _0x6dd86c;};'use strict';var multer=require(_0xe5fd('0x0'));var util=require(_0xe5fd('0x1'));var path=require('path');var timeout=require(_0xe5fd('0x2'));var express=require(_0xe5fd('0x3'));var router=express[_0xe5fd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe5fd('0x5'));var interaction=require(_0xe5fd('0x6'));var config=require(_0xe5fd('0x7'));var controller=require(_0xe5fd('0x8'));router['get']('/',auth[_0xe5fd('0x9')](),controller['index']);router[_0xe5fd('0xa')](_0xe5fd('0xb'),auth[_0xe5fd('0x9')](),controller[_0xe5fd('0xc')]);router[_0xe5fd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe5fd('0xd')]);router[_0xe5fd('0xe')]('/',auth[_0xe5fd('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe5fd('0xf')]);router[_0xe5fd('0x10')](_0xe5fd('0x11'),auth[_0xe5fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe4d9=['path','express','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','index','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4da309,_0xe1a36e){var _0xeb3228=function(_0x68bf87){while(--_0x68bf87){_0x4da309['push'](_0x4da309['shift']());}};_0xeb3228(++_0xe1a36e);}(_0xe4d9,0x141));var _0x9e4d=function(_0x4b05be,_0x33d001){_0x4b05be=_0x4b05be-0x0;var _0x474ae9=_0xe4d9[_0x4b05be];return _0x474ae9;};'use strict';var multer=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var path=require(_0x9e4d('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e4d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e4d('0x4'));var interaction=require(_0x9e4d('0x5'));var config=require('../../config/environment');var controller=require(_0x9e4d('0x6'));router[_0x9e4d('0x7')]('/',auth['isAuthenticated'](),controller[_0x9e4d('0x8')]);router[_0x9e4d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x9e4d('0x9')]);router['get'](_0x9e4d('0xa'),auth[_0x9e4d('0xb')](),controller['show']);router[_0x9e4d('0xc')]('/',auth[_0x9e4d('0xb')](),controller[_0x9e4d('0xd')]);router[_0x9e4d('0xe')](_0x9e4d('0xa'),auth[_0x9e4d('0xb')](),controller[_0x9e4d('0xf')]);router[_0x9e4d('0x10')](_0x9e4d('0xa'),auth[_0x9e4d('0xb')](),controller[_0x9e4d('0x11')]);module[_0x9e4d('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0c8c7d2..c7cef06 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 _0x685f=['sequelize','exports','STRING','DATE'];(function(_0x378b44,_0x5f2fe6){var _0x34d2da=function(_0x34fad3){while(--_0x34fad3){_0x378b44['push'](_0x378b44['shift']());}};_0x34d2da(++_0x5f2fe6);}(_0x685f,0x180));var _0xf685=function(_0x31acd2,_0x3c0a9f){_0x31acd2=_0x31acd2-0x0;var _0xc8118=_0x685f[_0x31acd2];return _0xc8118;};'use strict';var moment=require('moment');var Sequelize=require(_0xf685('0x0'));module[_0xf685('0x1')]={'uniqueid':{'type':Sequelize[_0xf685('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf685('0x3')]},'leaveAt':{'type':Sequelize[_0xf685('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf685('0x3')]},'reason':{'type':Sequelize[_0xf685('0x2')]}}; \ No newline at end of file +var _0x0795=['sequelize','exports','STRING','DATE','moment'];(function(_0x45a546,_0x11b6a6){var _0x3e5eac=function(_0x2c106b){while(--_0x2c106b){_0x45a546['push'](_0x45a546['shift']());}};_0x3e5eac(++_0x11b6a6);}(_0x0795,0x14e));var _0x5079=function(_0x2410eb,_0x13cbf8){_0x2410eb=_0x2410eb-0x0;var _0xdfe973=_0x0795[_0x2410eb];return _0xdfe973;};'use strict';var moment=require(_0x5079('0x0'));var Sequelize=require(_0x5079('0x1'));module[_0x5079('0x2')]={'uniqueid':{'type':Sequelize[_0x5079('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5079('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5079('0x4')]},'exitAt':{'type':Sequelize[_0x5079('0x4')]},'reason':{'type':Sequelize[_0x5079('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index c16c791..1f59dbf 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 _0xc0f4=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','params','rawAttributes','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/utils'];(function(_0x1be6fd,_0x352ce2){var _0x4fce15=function(_0x3b514f){while(--_0x3b514f){_0x1be6fd['push'](_0x1be6fd['shift']());}};_0x4fce15(++_0x352ce2);}(_0xc0f4,0x1c0));var _0x4c0f=function(_0x11582b,_0x363a7){_0x11582b=_0x11582b-0x0;var _0x44a232=_0xc0f4[_0x11582b];return _0x44a232;};'use strict';var emlformat=require(_0x4c0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c0f('0x1'));var jsonpatch=require(_0x4c0f('0x2'));var rp=require(_0x4c0f('0x3'));var moment=require(_0x4c0f('0x4'));var BPromise=require(_0x4c0f('0x5'));var Mustache=require(_0x4c0f('0x6'));var util=require(_0x4c0f('0x7'));var path=require('path');var sox=require(_0x4c0f('0x8'));var csv=require(_0x4c0f('0x9'));var ejs=require(_0x4c0f('0xa'));var fs=require('fs');var fs_extra=require(_0x4c0f('0xb'));var _=require(_0x4c0f('0xc'));var squel=require(_0x4c0f('0xd'));var crypto=require(_0x4c0f('0xe'));var jsforce=require(_0x4c0f('0xf'));var deskjs=require(_0x4c0f('0x10'));var toCsv=require(_0x4c0f('0x9'));var querystring=require(_0x4c0f('0x11'));var Papa=require(_0x4c0f('0x12'));var Redis=require('ioredis');var authService=require(_0x4c0f('0x13'));var qs=require(_0x4c0f('0x14'));var as=require(_0x4c0f('0x15'));var hardwareService=require(_0x4c0f('0x16'));var logger=require(_0x4c0f('0x17'))(_0x4c0f('0x18'));var utils=require(_0x4c0f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4c0f('0x1a'))['db'];function respondWithStatusCode(_0x1f9c85,_0xae51ff){_0xae51ff=_0xae51ff||0xcc;return function(_0x395a28){if(_0x395a28){return _0x1f9c85[_0x4c0f('0x1b')](_0xae51ff);}return _0x1f9c85[_0x4c0f('0x1c')](_0xae51ff)[_0x4c0f('0x1d')]();};}function respondWithResult(_0x17625c,_0x57587d){_0x57587d=_0x57587d||0xc8;return function(_0x5f1711){if(_0x5f1711){return _0x17625c[_0x4c0f('0x1c')](_0x57587d)[_0x4c0f('0x1e')](_0x5f1711);}};}function respondWithFilteredResult(_0x2fd6ae,_0x2a18a9){return function(_0x1a335e){if(_0x1a335e){var _0x5a8961=typeof _0x2a18a9[_0x4c0f('0x1f')]===_0x4c0f('0x20')&&typeof _0x2a18a9[_0x4c0f('0x21')]==='undefined';var _0x5c3480=_0x1a335e['count'];var _0x4459b7=_0x5a8961?0x0:_0x2a18a9[_0x4c0f('0x1f')];var _0x559d14=_0x5a8961?_0x1a335e[_0x4c0f('0x22')]:_0x2a18a9[_0x4c0f('0x1f')]+_0x2a18a9[_0x4c0f('0x21')];var _0x1d82a4;if(_0x559d14>=_0x5c3480){_0x559d14=_0x5c3480;_0x1d82a4=0xc8;}else{_0x1d82a4=0xce;}_0x2fd6ae[_0x4c0f('0x1c')](_0x1d82a4);return _0x2fd6ae['set']('Content-Range',_0x4459b7+'-'+_0x559d14+'/'+_0x5c3480)[_0x4c0f('0x1e')](_0x1a335e);}return null;};}function patchUpdates(_0x4ca0aa){return function(_0x1b4cdd){try{jsonpatch[_0x4c0f('0x23')](_0x1b4cdd,_0x4ca0aa,!![]);}catch(_0x331aa3){return BPromise[_0x4c0f('0x24')](_0x331aa3);}return _0x1b4cdd[_0x4c0f('0x25')]();};}function saveUpdates(_0x43b6c3,_0x32c140){return function(_0x150099){if(_0x150099){return _0x150099[_0x4c0f('0x26')](_0x43b6c3)[_0x4c0f('0x27')](function(_0x531066){return _0x531066;});}return null;};}function removeEntity(_0x23c022,_0x404678){return function(_0x1d3cfe){if(_0x1d3cfe){return _0x1d3cfe[_0x4c0f('0x28')]()[_0x4c0f('0x27')](function(){_0x23c022[_0x4c0f('0x1c')](0xcc)[_0x4c0f('0x1d')]();});}};}function handleEntityNotFound(_0x299501,_0x2bbf51){return function(_0x3c7a45){if(!_0x3c7a45){_0x299501[_0x4c0f('0x1b')](0x194);}return _0x3c7a45;};}function handleError(_0x4879dc,_0x404283){_0x404283=_0x404283||0x1f4;return function(_0xa39eee){logger[_0x4c0f('0x29')](_0xa39eee[_0x4c0f('0x2a')]);if(_0xa39eee[_0x4c0f('0x2b')]){delete _0xa39eee[_0x4c0f('0x2b')];}_0x4879dc[_0x4c0f('0x1c')](_0x404283)[_0x4c0f('0x2c')](_0xa39eee);};}exports[_0x4c0f('0x2d')]=function(_0x143635,_0x2c9617){var _0x328a36={},_0x57f5bc={},_0x3dd9fb={'count':0x0,'rows':[]};var _0x182189=_[_0x4c0f('0x2e')](db[_0x4c0f('0x2f')]['rawAttributes'],function(_0x5da8d8){return{'name':_0x5da8d8[_0x4c0f('0x30')],'type':_0x5da8d8[_0x4c0f('0x31')][_0x4c0f('0x32')]};});_0x57f5bc[_0x4c0f('0x33')]=_['map'](_0x182189,_0x4c0f('0x2b'));_0x57f5bc['query']=_[_0x4c0f('0x34')](_0x143635[_0x4c0f('0x35')]);_0x57f5bc['filters']=_[_0x4c0f('0x36')](_0x57f5bc[_0x4c0f('0x33')],_0x57f5bc[_0x4c0f('0x35')]);_0x328a36[_0x4c0f('0x37')]=_['intersection'](_0x57f5bc[_0x4c0f('0x33')],qs[_0x4c0f('0x38')](_0x143635[_0x4c0f('0x35')][_0x4c0f('0x38')]));_0x328a36[_0x4c0f('0x37')]=_0x328a36[_0x4c0f('0x37')][_0x4c0f('0x39')]?_0x328a36[_0x4c0f('0x37')]:_0x57f5bc[_0x4c0f('0x33')];if(!_0x143635['query'][_0x4c0f('0x3a')](_0x4c0f('0x3b'))){_0x328a36[_0x4c0f('0x21')]=qs['limit'](_0x143635[_0x4c0f('0x35')]['limit']);_0x328a36['offset']=qs[_0x4c0f('0x1f')](_0x143635[_0x4c0f('0x35')]['offset']);}_0x328a36[_0x4c0f('0x3c')]=qs[_0x4c0f('0x3d')](_0x143635[_0x4c0f('0x35')][_0x4c0f('0x3d')]);_0x328a36[_0x4c0f('0x3e')]=qs[_0x4c0f('0x3f')](_[_0x4c0f('0x40')](_0x143635[_0x4c0f('0x35')],_0x57f5bc[_0x4c0f('0x3f')]),_0x182189);if(_0x143635[_0x4c0f('0x35')][_0x4c0f('0x41')]){_0x328a36[_0x4c0f('0x3e')]=_['merge'](_0x328a36[_0x4c0f('0x3e')],{'$or':_[_0x4c0f('0x2e')](_0x182189,function(_0x4b8de1){if(_0x4b8de1['type']!==_0x4c0f('0x42')){var _0x2cc7ea={};_0x2cc7ea[_0x4b8de1[_0x4c0f('0x2b')]]={'$like':'%'+_0x143635['query']['filter']+'%'};return _0x2cc7ea;}})});}_0x328a36=_[_0x4c0f('0x43')]({},_0x328a36,_0x143635[_0x4c0f('0x44')]);var _0x580670={'where':_0x328a36[_0x4c0f('0x3e')]};return db[_0x4c0f('0x2f')][_0x4c0f('0x22')](_0x580670)[_0x4c0f('0x27')](function(_0x5d8286){_0x3dd9fb[_0x4c0f('0x22')]=_0x5d8286;if(_0x143635[_0x4c0f('0x35')][_0x4c0f('0x45')]){_0x328a36['include']=[{'all':!![]}];}return db[_0x4c0f('0x2f')]['findAll'](_0x328a36);})['then'](function(_0x450b6c){_0x3dd9fb[_0x4c0f('0x46')]=_0x450b6c;return _0x3dd9fb;})['then'](respondWithFilteredResult(_0x2c9617,_0x328a36))[_0x4c0f('0x47')](handleError(_0x2c9617,null));};exports['show']=function(_0x5cbca0,_0x5aabb8){var _0x9104e5={'raw':!![],'where':{'id':_0x5cbca0[_0x4c0f('0x48')]['id']}},_0x458b44={};_0x458b44[_0x4c0f('0x33')]=_[_0x4c0f('0x34')](db[_0x4c0f('0x2f')][_0x4c0f('0x49')]);_0x458b44['query']=_['keys'](_0x5cbca0[_0x4c0f('0x35')]);_0x458b44[_0x4c0f('0x3f')]=_[_0x4c0f('0x36')](_0x458b44[_0x4c0f('0x33')],_0x458b44[_0x4c0f('0x35')]);_0x9104e5['attributes']=_['intersection'](_0x458b44[_0x4c0f('0x33')],qs[_0x4c0f('0x38')](_0x5cbca0['query']['fields']));_0x9104e5['attributes']=_0x9104e5['attributes'][_0x4c0f('0x39')]?_0x9104e5[_0x4c0f('0x37')]:_0x458b44[_0x4c0f('0x33')];if(_0x5cbca0[_0x4c0f('0x35')][_0x4c0f('0x45')]){_0x9104e5[_0x4c0f('0x4a')]=[{'all':!![]}];}_0x9104e5=_[_0x4c0f('0x43')]({},_0x9104e5,_0x5cbca0[_0x4c0f('0x44')]);return db[_0x4c0f('0x2f')][_0x4c0f('0x4b')](_0x9104e5)[_0x4c0f('0x27')](handleEntityNotFound(_0x5aabb8,null))[_0x4c0f('0x27')](respondWithResult(_0x5aabb8,null))[_0x4c0f('0x47')](handleError(_0x5aabb8,null));};exports[_0x4c0f('0x4c')]=function(_0x10b479,_0x3fb9b3){return db[_0x4c0f('0x2f')]['create'](_0x10b479[_0x4c0f('0x4d')],{})[_0x4c0f('0x27')](respondWithResult(_0x3fb9b3,0xc9))[_0x4c0f('0x47')](handleError(_0x3fb9b3,null));};exports['update']=function(_0x33ccb9,_0x126680){if(_0x33ccb9['body']['id']){delete _0x33ccb9[_0x4c0f('0x4d')]['id'];}return db[_0x4c0f('0x2f')][_0x4c0f('0x4b')]({'where':{'id':_0x33ccb9['params']['id']}})['then'](handleEntityNotFound(_0x126680,null))['then'](saveUpdates(_0x33ccb9[_0x4c0f('0x4d')],null))[_0x4c0f('0x27')](respondWithResult(_0x126680,null))[_0x4c0f('0x47')](handleError(_0x126680,null));};exports['destroy']=function(_0x5a243c,_0x416961){return db[_0x4c0f('0x2f')][_0x4c0f('0x4b')]({'where':{'id':_0x5a243c[_0x4c0f('0x48')]['id']}})['then'](handleEntityNotFound(_0x416961,null))[_0x4c0f('0x27')](removeEntity(_0x416961,null))[_0x4c0f('0x47')](handleError(_0x416961,null));};exports['describe']=function(_0x1154d1,_0x16ece8){return db[_0x4c0f('0x2f')][_0x4c0f('0x4e')]()[_0x4c0f('0x27')](respondWithResult(_0x16ece8,null))['catch'](handleError(_0x16ece8,null));}; \ No newline at end of file +var _0xf5c9=['key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type'];(function(_0x297fe8,_0x2c9c7e){var _0x337023=function(_0x17eda0){while(--_0x17eda0){_0x297fe8['push'](_0x297fe8['shift']());}};_0x337023(++_0x2c9c7e);}(_0xf5c9,0x101));var _0x9f5c=function(_0xf60702,_0x3bb11b){_0xf60702=_0xf60702-0x0;var _0x16a7a4=_0xf5c9[_0xf60702];return _0x16a7a4;};'use strict';var emlformat=require(_0x9f5c('0x0'));var rimraf=require(_0x9f5c('0x1'));var zipdir=require(_0x9f5c('0x2'));var jsonpatch=require(_0x9f5c('0x3'));var rp=require(_0x9f5c('0x4'));var moment=require('moment');var BPromise=require(_0x9f5c('0x5'));var Mustache=require(_0x9f5c('0x6'));var util=require(_0x9f5c('0x7'));var path=require(_0x9f5c('0x8'));var sox=require(_0x9f5c('0x9'));var csv=require(_0x9f5c('0xa'));var ejs=require(_0x9f5c('0xb'));var fs=require('fs');var fs_extra=require(_0x9f5c('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9f5c('0xd'));var deskjs=require(_0x9f5c('0xe'));var toCsv=require(_0x9f5c('0xa'));var querystring=require(_0x9f5c('0xf'));var Papa=require(_0x9f5c('0x10'));var Redis=require('ioredis');var authService=require(_0x9f5c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f5c('0x12'));var hardwareService=require(_0x9f5c('0x13'));var logger=require(_0x9f5c('0x14'))('api');var utils=require(_0x9f5c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f5c('0x16'))['db'];function respondWithStatusCode(_0x579794,_0x28f6d2){_0x28f6d2=_0x28f6d2||0xcc;return function(_0x103e77){if(_0x103e77){return _0x579794[_0x9f5c('0x17')](_0x28f6d2);}return _0x579794[_0x9f5c('0x18')](_0x28f6d2)[_0x9f5c('0x19')]();};}function respondWithResult(_0x4dfcc7,_0x251876){_0x251876=_0x251876||0xc8;return function(_0x5b2935){if(_0x5b2935){return _0x4dfcc7[_0x9f5c('0x18')](_0x251876)[_0x9f5c('0x1a')](_0x5b2935);}};}function respondWithFilteredResult(_0x4329ab,_0x24abf7){return function(_0x1b63e1){if(_0x1b63e1){var _0x220cbe=typeof _0x24abf7['offset']===_0x9f5c('0x1b')&&typeof _0x24abf7[_0x9f5c('0x1c')]==='undefined';var _0xbf90b4=_0x1b63e1['count'];var _0x3ba514=_0x220cbe?0x0:_0x24abf7[_0x9f5c('0x1d')];var _0x207074=_0x220cbe?_0x1b63e1['count']:_0x24abf7[_0x9f5c('0x1d')]+_0x24abf7[_0x9f5c('0x1c')];var _0x41c2bb;if(_0x207074>=_0xbf90b4){_0x207074=_0xbf90b4;_0x41c2bb=0xc8;}else{_0x41c2bb=0xce;}_0x4329ab[_0x9f5c('0x18')](_0x41c2bb);return _0x4329ab[_0x9f5c('0x1e')](_0x9f5c('0x1f'),_0x3ba514+'-'+_0x207074+'/'+_0xbf90b4)[_0x9f5c('0x1a')](_0x1b63e1);}return null;};}function patchUpdates(_0x276787){return function(_0x2d6c10){try{jsonpatch[_0x9f5c('0x20')](_0x2d6c10,_0x276787,!![]);}catch(_0x19f6ca){return BPromise[_0x9f5c('0x21')](_0x19f6ca);}return _0x2d6c10[_0x9f5c('0x22')]();};}function saveUpdates(_0x1164c9,_0x2bafaa){return function(_0x4be8a2){if(_0x4be8a2){return _0x4be8a2[_0x9f5c('0x23')](_0x1164c9)[_0x9f5c('0x24')](function(_0x41769f){return _0x41769f;});}return null;};}function removeEntity(_0x1ac48b,_0x34622e){return function(_0x58cab5){if(_0x58cab5){return _0x58cab5[_0x9f5c('0x25')]()['then'](function(){_0x1ac48b[_0x9f5c('0x18')](0xcc)[_0x9f5c('0x19')]();});}};}function handleEntityNotFound(_0x2991bb,_0x53ed1f){return function(_0x431010){if(!_0x431010){_0x2991bb[_0x9f5c('0x17')](0x194);}return _0x431010;};}function handleError(_0x5daf2d,_0x1feabb){_0x1feabb=_0x1feabb||0x1f4;return function(_0x4dc64a){logger['error'](_0x4dc64a[_0x9f5c('0x26')]);if(_0x4dc64a[_0x9f5c('0x27')]){delete _0x4dc64a[_0x9f5c('0x27')];}_0x5daf2d['status'](_0x1feabb)[_0x9f5c('0x28')](_0x4dc64a);};}exports[_0x9f5c('0x29')]=function(_0x178d55,_0xc6cbd6){var _0x5925fb={},_0x44ee82={},_0x44c08f={'count':0x0,'rows':[]};var _0xf4e5ab=_[_0x9f5c('0x2a')](db[_0x9f5c('0x2b')][_0x9f5c('0x2c')],function(_0x351b2f){return{'name':_0x351b2f[_0x9f5c('0x2d')],'type':_0x351b2f[_0x9f5c('0x2e')][_0x9f5c('0x2f')]};});_0x44ee82[_0x9f5c('0x30')]=_[_0x9f5c('0x2a')](_0xf4e5ab,'name');_0x44ee82[_0x9f5c('0x31')]=_[_0x9f5c('0x32')](_0x178d55['query']);_0x44ee82['filters']=_[_0x9f5c('0x33')](_0x44ee82[_0x9f5c('0x30')],_0x44ee82['query']);_0x5925fb[_0x9f5c('0x34')]=_['intersection'](_0x44ee82[_0x9f5c('0x30')],qs['fields'](_0x178d55[_0x9f5c('0x31')][_0x9f5c('0x35')]));_0x5925fb[_0x9f5c('0x34')]=_0x5925fb[_0x9f5c('0x34')]['length']?_0x5925fb[_0x9f5c('0x34')]:_0x44ee82['model'];if(!_0x178d55[_0x9f5c('0x31')][_0x9f5c('0x36')](_0x9f5c('0x37'))){_0x5925fb[_0x9f5c('0x1c')]=qs[_0x9f5c('0x1c')](_0x178d55[_0x9f5c('0x31')][_0x9f5c('0x1c')]);_0x5925fb[_0x9f5c('0x1d')]=qs['offset'](_0x178d55[_0x9f5c('0x31')][_0x9f5c('0x1d')]);}_0x5925fb[_0x9f5c('0x38')]=qs[_0x9f5c('0x39')](_0x178d55[_0x9f5c('0x31')][_0x9f5c('0x39')]);_0x5925fb[_0x9f5c('0x3a')]=qs[_0x9f5c('0x3b')](_[_0x9f5c('0x3c')](_0x178d55[_0x9f5c('0x31')],_0x44ee82[_0x9f5c('0x3b')]),_0xf4e5ab);if(_0x178d55[_0x9f5c('0x31')][_0x9f5c('0x3d')]){_0x5925fb[_0x9f5c('0x3a')]=_[_0x9f5c('0x3e')](_0x5925fb[_0x9f5c('0x3a')],{'$or':_[_0x9f5c('0x2a')](_0xf4e5ab,function(_0x1e4923){if(_0x1e4923['type']!==_0x9f5c('0x3f')){var _0x146ba0={};_0x146ba0[_0x1e4923[_0x9f5c('0x27')]]={'$like':'%'+_0x178d55['query'][_0x9f5c('0x3d')]+'%'};return _0x146ba0;}})});}_0x5925fb=_[_0x9f5c('0x3e')]({},_0x5925fb,_0x178d55[_0x9f5c('0x40')]);var _0x25a901={'where':_0x5925fb[_0x9f5c('0x3a')]};return db['SmsQueueReport']['count'](_0x25a901)[_0x9f5c('0x24')](function(_0x1e7446){_0x44c08f[_0x9f5c('0x41')]=_0x1e7446;if(_0x178d55[_0x9f5c('0x31')][_0x9f5c('0x42')]){_0x5925fb[_0x9f5c('0x43')]=[{'all':!![]}];}return db[_0x9f5c('0x2b')]['findAll'](_0x5925fb);})[_0x9f5c('0x24')](function(_0x13c09c){_0x44c08f['rows']=_0x13c09c;return _0x44c08f;})[_0x9f5c('0x24')](respondWithFilteredResult(_0xc6cbd6,_0x5925fb))[_0x9f5c('0x44')](handleError(_0xc6cbd6,null));};exports[_0x9f5c('0x45')]=function(_0x5716da,_0x4d9bfc){var _0x5b92d8={'raw':!![],'where':{'id':_0x5716da[_0x9f5c('0x46')]['id']}},_0x1ed891={};_0x1ed891[_0x9f5c('0x30')]=_['keys'](db['SmsQueueReport'][_0x9f5c('0x2c')]);_0x1ed891['query']=_[_0x9f5c('0x32')](_0x5716da[_0x9f5c('0x31')]);_0x1ed891[_0x9f5c('0x3b')]=_[_0x9f5c('0x33')](_0x1ed891[_0x9f5c('0x30')],_0x1ed891[_0x9f5c('0x31')]);_0x5b92d8[_0x9f5c('0x34')]=_[_0x9f5c('0x33')](_0x1ed891['model'],qs['fields'](_0x5716da[_0x9f5c('0x31')][_0x9f5c('0x35')]));_0x5b92d8['attributes']=_0x5b92d8[_0x9f5c('0x34')][_0x9f5c('0x47')]?_0x5b92d8['attributes']:_0x1ed891[_0x9f5c('0x30')];if(_0x5716da['query'][_0x9f5c('0x42')]){_0x5b92d8['include']=[{'all':!![]}];}_0x5b92d8=_['merge']({},_0x5b92d8,_0x5716da[_0x9f5c('0x40')]);return db[_0x9f5c('0x2b')][_0x9f5c('0x48')](_0x5b92d8)['then'](handleEntityNotFound(_0x4d9bfc,null))[_0x9f5c('0x24')](respondWithResult(_0x4d9bfc,null))[_0x9f5c('0x44')](handleError(_0x4d9bfc,null));};exports[_0x9f5c('0x49')]=function(_0x1b6ed0,_0x2212a2){return db['SmsQueueReport'][_0x9f5c('0x49')](_0x1b6ed0[_0x9f5c('0x4a')],{})['then'](respondWithResult(_0x2212a2,0xc9))['catch'](handleError(_0x2212a2,null));};exports[_0x9f5c('0x23')]=function(_0x2b535f,_0x150370){if(_0x2b535f[_0x9f5c('0x4a')]['id']){delete _0x2b535f['body']['id'];}return db['SmsQueueReport'][_0x9f5c('0x48')]({'where':{'id':_0x2b535f[_0x9f5c('0x46')]['id']}})[_0x9f5c('0x24')](handleEntityNotFound(_0x150370,null))[_0x9f5c('0x24')](saveUpdates(_0x2b535f['body'],null))[_0x9f5c('0x24')](respondWithResult(_0x150370,null))[_0x9f5c('0x44')](handleError(_0x150370,null));};exports[_0x9f5c('0x25')]=function(_0x1ae2d2,_0x2625ed){return db[_0x9f5c('0x2b')][_0x9f5c('0x48')]({'where':{'id':_0x1ae2d2[_0x9f5c('0x46')]['id']}})[_0x9f5c('0x24')](handleEntityNotFound(_0x2625ed,null))[_0x9f5c('0x24')](removeEntity(_0x2625ed,null))[_0x9f5c('0x44')](handleError(_0x2625ed,null));};exports['describe']=function(_0x5501d1,_0x19088c){return db[_0x9f5c('0x2b')][_0x9f5c('0x4b')]()['then'](respondWithResult(_0x19088c,null))[_0x9f5c('0x44')](handleError(_0x19088c,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index af86a65..953d468 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x145176,_0xc838b5){var _0x425129=function(_0x47f6c8){while(--_0x47f6c8){_0x145176['push'](_0x145176['shift']());}};_0x425129(++_0xc838b5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0xcb91[_0x3725ee];return _0x399c71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x262ef5,_0x2f3c3d){var _0x4b5e53=function(_0x151515){while(--_0x151515){_0x262ef5['push'](_0x262ef5['shift']());}};_0x4b5e53(++_0x2f3c3d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 40fc2e7..350e409 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 _0x8e46=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','SmsQueueReport','create','body','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','options','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8e46,0x8e));var _0x68e4=function(_0x23a8ba,_0xab5848){_0x23a8ba=_0x23a8ba-0x0;var _0x468389=_0x8e46[_0x23a8ba];return _0x468389;};'use strict';var _=require(_0x68e4('0x0'));var util=require(_0x68e4('0x1'));var moment=require(_0x68e4('0x2'));var BPromise=require(_0x68e4('0x3'));var rs=require(_0x68e4('0x4'));var fs=require('fs');var Redis=require(_0x68e4('0x5'));var db=require(_0x68e4('0x6'))['db'];var utils=require(_0x68e4('0x7'));var logger=require(_0x68e4('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x68e4('0x9'));var client=jayson[_0x68e4('0xa')][_0x68e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1746ac,_0x41fa3d,_0x2fadfc){return new BPromise(function(_0x10db8d,_0xcdac83){return client[_0x68e4('0xc')](_0x1746ac,_0x2fadfc)[_0x68e4('0xd')](function(_0x171ff0){logger[_0x68e4('0xe')](_0x68e4('0xf'),_0x41fa3d,_0x68e4('0x10'));logger[_0x68e4('0x11')](_0x68e4('0x12'),_0x41fa3d,_0x68e4('0x10'),JSON['stringify'](_0x171ff0));if(_0x171ff0[_0x68e4('0x13')]){if(_0x171ff0['error']['code']===0x1f4){logger['error'](_0x68e4('0xf'),_0x41fa3d,_0x171ff0[_0x68e4('0x13')][_0x68e4('0x14')]);return _0xcdac83(_0x171ff0[_0x68e4('0x13')][_0x68e4('0x14')]);}logger[_0x68e4('0x13')](_0x68e4('0xf'),_0x41fa3d,_0x171ff0['error'][_0x68e4('0x14')]);return _0x10db8d(_0x171ff0[_0x68e4('0x13')]['message']);}else{logger[_0x68e4('0xe')](_0x68e4('0xf'),_0x41fa3d,_0x68e4('0x10'));_0x10db8d(_0x171ff0[_0x68e4('0x15')]['message']);}})[_0x68e4('0x16')](function(_0x50d6c8){logger['error'](_0x68e4('0xf'),_0x41fa3d,_0x50d6c8);_0xcdac83(_0x50d6c8);});});}exports['CreateSmsQueueReport']=function(_0x494a99){var _0x544ba2=this;return new Promise(function(_0x5e9a4a,_0xc46b44){return db[_0x68e4('0x17')][_0x68e4('0x18')](_0x494a99[_0x68e4('0x19')],{'raw':_0x494a99['options']?_0x494a99['options'][_0x68e4('0x1a')]===undefined?!![]:![]:!![]})[_0x68e4('0xd')](function(_0x4d6a19){logger['info'](_0x68e4('0x1b'),_0x494a99);logger[_0x68e4('0x11')]('CreateSmsQueueReport',_0x494a99,JSON[_0x68e4('0x1c')](_0x4d6a19));_0x5e9a4a(_0x4d6a19);})['catch'](function(_0x5362a4){logger[_0x68e4('0x13')](_0x68e4('0x1b'),_0x5362a4['message'],_0x494a99);_0xc46b44(_0x544ba2[_0x68e4('0x13')](0x1f4,_0x5362a4[_0x68e4('0x14')]));});});};exports[_0x68e4('0x1d')]=function(_0x1afc71){var _0x3f3a5f=this;return new Promise(function(_0x5e461b,_0x2d4e8c){return db[_0x68e4('0x17')][_0x68e4('0x1e')](_0x1afc71[_0x68e4('0x19')],{'raw':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x20')]||null:null,'attributes':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x21')]||null:null,'limit':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x22')]||null:null})[_0x68e4('0xd')](function(_0x505a21){logger[_0x68e4('0xe')](_0x68e4('0x1d'),_0x1afc71);logger[_0x68e4('0x11')](_0x68e4('0x1d'),_0x1afc71,JSON[_0x68e4('0x1c')](_0x505a21));_0x5e461b(_0x505a21);})[_0x68e4('0x16')](function(_0x23e071){logger['error'](_0x68e4('0x1d'),_0x23e071[_0x68e4('0x14')],_0x1afc71);_0x2d4e8c(_0x3f3a5f[_0x68e4('0x13')](0x1f4,_0x23e071['message']));});});}; \ No newline at end of file +var _0xd542=['attributes','limit','UpdateSmsQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','body','options','raw','SmsQueueReport','update','where'];(function(_0x584d3f,_0x187597){var _0x43e2a7=function(_0x1e9715){while(--_0x1e9715){_0x584d3f['push'](_0x584d3f['shift']());}};_0x43e2a7(++_0x187597);}(_0xd542,0x135));var _0x2d54=function(_0x2985a1,_0x531ae9){_0x2985a1=_0x2985a1-0x0;var _0x402663=_0xd542[_0x2985a1];return _0x402663;};'use strict';var _=require('lodash');var util=require(_0x2d54('0x0'));var moment=require(_0x2d54('0x1'));var BPromise=require(_0x2d54('0x2'));var rs=require(_0x2d54('0x3'));var fs=require('fs');var Redis=require(_0x2d54('0x4'));var db=require(_0x2d54('0x5'))['db'];var utils=require(_0x2d54('0x6'));var logger=require(_0x2d54('0x7'))(_0x2d54('0x8'));var config=require(_0x2d54('0x9'));var jayson=require(_0x2d54('0xa'));var client=jayson[_0x2d54('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x575bc1,_0x440865,_0x324e8c){return new BPromise(function(_0x86b7dd,_0x8ade98){return client['request'](_0x575bc1,_0x324e8c)[_0x2d54('0xc')](function(_0x388569){logger[_0x2d54('0xd')](_0x2d54('0xe'),_0x440865,_0x2d54('0xf'));logger[_0x2d54('0x10')](_0x2d54('0x11'),_0x440865,_0x2d54('0xf'),JSON[_0x2d54('0x12')](_0x388569));if(_0x388569[_0x2d54('0x13')]){if(_0x388569[_0x2d54('0x13')][_0x2d54('0x14')]===0x1f4){logger[_0x2d54('0x13')](_0x2d54('0xe'),_0x440865,_0x388569[_0x2d54('0x13')][_0x2d54('0x15')]);return _0x8ade98(_0x388569[_0x2d54('0x13')][_0x2d54('0x15')]);}logger['error'](_0x2d54('0xe'),_0x440865,_0x388569['error'][_0x2d54('0x15')]);return _0x86b7dd(_0x388569[_0x2d54('0x13')][_0x2d54('0x15')]);}else{logger[_0x2d54('0xd')](_0x2d54('0xe'),_0x440865,_0x2d54('0xf'));_0x86b7dd(_0x388569[_0x2d54('0x16')]['message']);}})[_0x2d54('0x17')](function(_0x1cabfd){logger[_0x2d54('0x13')](_0x2d54('0xe'),_0x440865,_0x1cabfd);_0x8ade98(_0x1cabfd);});});}exports[_0x2d54('0x18')]=function(_0x580f72){var _0x447066=this;return new Promise(function(_0x4cf6a7,_0x2e243e){return db['SmsQueueReport']['create'](_0x580f72[_0x2d54('0x19')],{'raw':_0x580f72[_0x2d54('0x1a')]?_0x580f72[_0x2d54('0x1a')][_0x2d54('0x1b')]===undefined?!![]:![]:!![]})[_0x2d54('0xc')](function(_0x77906a){logger[_0x2d54('0xd')](_0x2d54('0x18'),_0x580f72);logger[_0x2d54('0x10')]('CreateSmsQueueReport',_0x580f72,JSON[_0x2d54('0x12')](_0x77906a));_0x4cf6a7(_0x77906a);})[_0x2d54('0x17')](function(_0x6bb004){logger[_0x2d54('0x13')](_0x2d54('0x18'),_0x6bb004[_0x2d54('0x15')],_0x580f72);_0x2e243e(_0x447066['error'](0x1f4,_0x6bb004[_0x2d54('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x51a23a){var _0xccab82=this;return new Promise(function(_0x229ac6,_0xeecd1c){return db[_0x2d54('0x1c')][_0x2d54('0x1d')](_0x51a23a[_0x2d54('0x19')],{'raw':_0x51a23a[_0x2d54('0x1a')]?_0x51a23a[_0x2d54('0x1a')][_0x2d54('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51a23a[_0x2d54('0x1a')]?_0x51a23a[_0x2d54('0x1a')][_0x2d54('0x1e')]||null:null,'attributes':_0x51a23a[_0x2d54('0x1a')]?_0x51a23a['options'][_0x2d54('0x1f')]||null:null,'limit':_0x51a23a['options']?_0x51a23a['options'][_0x2d54('0x20')]||null:null})[_0x2d54('0xc')](function(_0x544ba0){logger[_0x2d54('0xd')](_0x2d54('0x21'),_0x51a23a);logger[_0x2d54('0x10')]('UpdateSmsQueueReport',_0x51a23a,JSON[_0x2d54('0x12')](_0x544ba0));_0x229ac6(_0x544ba0);})[_0x2d54('0x17')](function(_0x50df6c){logger[_0x2d54('0x13')]('UpdateSmsQueueReport',_0x50df6c[_0x2d54('0x15')],_0x51a23a);_0xeecd1c(_0xccab82[_0x2d54('0x13')](0x1f4,_0x50df6c[_0x2d54('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 70d5f27..280689f 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x1f25b3,_0x4e17a5){var _0x527093=function(_0x1ba28b){while(--_0x1ba28b){_0x1f25b3['push'](_0x1f25b3['shift']());}};_0x527093(++_0x4e17a5);}(_0x1cb9,0x14e));var _0x91cb=function(_0x56dcb9,_0x4a01cb){_0x56dcb9=_0x56dcb9-0x0;var _0x4d105e=_0x1cb9[_0x56dcb9];return _0x4d105e;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0xb4c7=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x497bd0,_0x217af3){var _0x105d24=function(_0x5d3f11){while(--_0x5d3f11){_0x497bd0['push'](_0x497bd0['shift']());}};_0x105d24(++_0x217af3);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x21105d,_0x61ddde){_0x21105d=_0x21105d-0x0;var _0x4b4688=_0xb4c7[_0x21105d];return _0x4b4688;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0x10')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router['delete']('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x14')]);module[_0x7b4c('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 889090b..2274a61 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x47c758,_0x10a261){var _0xe0b1e0=function(_0x33bef5){while(--_0x33bef5){_0x47c758['push'](_0x47c758['shift']());}};_0xe0b1e0(++_0x10a261);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x39d89b,_0x413243){var _0x477b21=function(_0x5ea8bf){while(--_0x5ea8bf){_0x39d89b['push'](_0x39d89b['shift']());}};_0x477b21(++_0x413243);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index b5ecb9a..ca266d3 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 _0x0c20=['../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsTransferReport','includeAll','include','findAll','rows','catch','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x10b6ae,_0x56a559){var _0x1321e9=function(_0x9b0eb2){while(--_0x9b0eb2){_0x10b6ae['push'](_0x10b6ae['shift']());}};_0x1321e9(++_0x56a559);}(_0x0c20,0x173));var _0x00c2=function(_0x1804d2,_0x5f596b){_0x1804d2=_0x1804d2-0x0;var _0xa96140=_0x0c20[_0x1804d2];return _0xa96140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00c2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00c2('0x1'));var rp=require(_0x00c2('0x2'));var moment=require(_0x00c2('0x3'));var BPromise=require(_0x00c2('0x4'));var Mustache=require(_0x00c2('0x5'));var util=require(_0x00c2('0x6'));var path=require(_0x00c2('0x7'));var sox=require(_0x00c2('0x8'));var csv=require(_0x00c2('0x9'));var ejs=require(_0x00c2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00c2('0xb'));var squel=require(_0x00c2('0xc'));var crypto=require(_0x00c2('0xd'));var jsforce=require(_0x00c2('0xe'));var deskjs=require(_0x00c2('0xf'));var toCsv=require(_0x00c2('0x9'));var querystring=require(_0x00c2('0x10'));var Papa=require(_0x00c2('0x11'));var Redis=require('ioredis');var authService=require(_0x00c2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x00c2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00c2('0x14'))(_0x00c2('0x15'));var utils=require(_0x00c2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x00c2('0x17'));var db=require(_0x00c2('0x18'))['db'];function respondWithStatusCode(_0x42d01b,_0x57468d){_0x57468d=_0x57468d||0xcc;return function(_0x3cb7fa){if(_0x3cb7fa){return _0x42d01b[_0x00c2('0x19')](_0x57468d);}return _0x42d01b[_0x00c2('0x1a')](_0x57468d)[_0x00c2('0x1b')]();};}function respondWithResult(_0x51cce9,_0x199bb3){_0x199bb3=_0x199bb3||0xc8;return function(_0x361710){if(_0x361710){return _0x51cce9[_0x00c2('0x1a')](_0x199bb3)['json'](_0x361710);}};}function respondWithFilteredResult(_0x37cfa1,_0x23965e){return function(_0x346013){if(_0x346013){var _0x82d40d=typeof _0x23965e['offset']===_0x00c2('0x1c')&&typeof _0x23965e[_0x00c2('0x1d')]===_0x00c2('0x1c');var _0x516b16=_0x346013[_0x00c2('0x1e')];var _0x4ef3af=_0x82d40d?0x0:_0x23965e[_0x00c2('0x1f')];var _0x165961=_0x82d40d?_0x346013[_0x00c2('0x1e')]:_0x23965e['offset']+_0x23965e[_0x00c2('0x1d')];var _0x1dcec6;if(_0x165961>=_0x516b16){_0x165961=_0x516b16;_0x1dcec6=0xc8;}else{_0x1dcec6=0xce;}_0x37cfa1[_0x00c2('0x1a')](_0x1dcec6);return _0x37cfa1['set'](_0x00c2('0x20'),_0x4ef3af+'-'+_0x165961+'/'+_0x516b16)[_0x00c2('0x21')](_0x346013);}return null;};}function patchUpdates(_0x53f84c){return function(_0xeb4ceb){try{jsonpatch[_0x00c2('0x22')](_0xeb4ceb,_0x53f84c,!![]);}catch(_0x26801a){return BPromise[_0x00c2('0x23')](_0x26801a);}return _0xeb4ceb[_0x00c2('0x24')]();};}function saveUpdates(_0x27c37a,_0x17b6a0){return function(_0x5489ca){if(_0x5489ca){return _0x5489ca[_0x00c2('0x25')](_0x27c37a)[_0x00c2('0x26')](function(_0x4ae99a){return _0x4ae99a;});}return null;};}function removeEntity(_0x2a3110,_0x2c5e9c){return function(_0x979a72){if(_0x979a72){return _0x979a72[_0x00c2('0x27')]()[_0x00c2('0x26')](function(){_0x2a3110['status'](0xcc)[_0x00c2('0x1b')]();});}};}function handleEntityNotFound(_0x4bac4a,_0x17cb3c){return function(_0x4dd990){if(!_0x4dd990){_0x4bac4a[_0x00c2('0x19')](0x194);}return _0x4dd990;};}function handleError(_0x5f9391,_0x544ba3){_0x544ba3=_0x544ba3||0x1f4;return function(_0x594684){logger[_0x00c2('0x28')](_0x594684[_0x00c2('0x29')]);if(_0x594684[_0x00c2('0x2a')]){delete _0x594684[_0x00c2('0x2a')];}_0x5f9391[_0x00c2('0x1a')](_0x544ba3)[_0x00c2('0x2b')](_0x594684);};}exports[_0x00c2('0x2c')]=function(_0x52d9c1,_0x339309){var _0x3e61fb={},_0x49ef7a={},_0x464e1c={'count':0x0,'rows':[]};var _0x3bb938=_['map'](db['SmsTransferReport'][_0x00c2('0x2d')],function(_0x6ce1ef){return{'name':_0x6ce1ef[_0x00c2('0x2e')],'type':_0x6ce1ef[_0x00c2('0x2f')][_0x00c2('0x30')]};});_0x49ef7a['model']=_[_0x00c2('0x31')](_0x3bb938,_0x00c2('0x2a'));_0x49ef7a[_0x00c2('0x32')]=_[_0x00c2('0x33')](_0x52d9c1[_0x00c2('0x32')]);_0x49ef7a[_0x00c2('0x34')]=_[_0x00c2('0x35')](_0x49ef7a[_0x00c2('0x36')],_0x49ef7a[_0x00c2('0x32')]);_0x3e61fb[_0x00c2('0x37')]=_[_0x00c2('0x35')](_0x49ef7a[_0x00c2('0x36')],qs[_0x00c2('0x38')](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x38')]));_0x3e61fb[_0x00c2('0x37')]=_0x3e61fb[_0x00c2('0x37')][_0x00c2('0x39')]?_0x3e61fb[_0x00c2('0x37')]:_0x49ef7a[_0x00c2('0x36')];if(!_0x52d9c1['query'][_0x00c2('0x3a')](_0x00c2('0x3b'))){_0x3e61fb[_0x00c2('0x1d')]=qs[_0x00c2('0x1d')](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x1d')]);_0x3e61fb[_0x00c2('0x1f')]=qs[_0x00c2('0x1f')](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x1f')]);}_0x3e61fb[_0x00c2('0x3c')]=qs['sort'](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x3d')]);_0x3e61fb[_0x00c2('0x3e')]=qs[_0x00c2('0x34')](_[_0x00c2('0x3f')](_0x52d9c1[_0x00c2('0x32')],_0x49ef7a[_0x00c2('0x34')]),_0x3bb938);if(_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x40')]){_0x3e61fb[_0x00c2('0x3e')]=_['merge'](_0x3e61fb[_0x00c2('0x3e')],{'$or':_['map'](_0x3bb938,function(_0x1e09a0){if(_0x1e09a0[_0x00c2('0x2f')]!==_0x00c2('0x41')){var _0x584e00={};_0x584e00[_0x1e09a0[_0x00c2('0x2a')]]={'$like':'%'+_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x40')]+'%'};return _0x584e00;}})});}_0x3e61fb=_[_0x00c2('0x42')]({},_0x3e61fb,_0x52d9c1[_0x00c2('0x43')]);var _0x10e366={'where':_0x3e61fb[_0x00c2('0x3e')]};return db[_0x00c2('0x44')][_0x00c2('0x1e')](_0x10e366)[_0x00c2('0x26')](function(_0x418833){_0x464e1c[_0x00c2('0x1e')]=_0x418833;if(_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x45')]){_0x3e61fb[_0x00c2('0x46')]=[{'all':!![]}];}return db[_0x00c2('0x44')][_0x00c2('0x47')](_0x3e61fb);})[_0x00c2('0x26')](function(_0x14f776){_0x464e1c[_0x00c2('0x48')]=_0x14f776;return _0x464e1c;})['then'](respondWithFilteredResult(_0x339309,_0x3e61fb))[_0x00c2('0x49')](handleError(_0x339309,null));};exports['show']=function(_0x1e0e7b,_0x49233a){var _0x2666e9={'raw':!![],'where':{'id':_0x1e0e7b['params']['id']}},_0x29de0b={};_0x29de0b['model']=_['keys'](db['SmsTransferReport'][_0x00c2('0x2d')]);_0x29de0b[_0x00c2('0x32')]=_[_0x00c2('0x33')](_0x1e0e7b[_0x00c2('0x32')]);_0x29de0b['filters']=_[_0x00c2('0x35')](_0x29de0b[_0x00c2('0x36')],_0x29de0b['query']);_0x2666e9['attributes']=_['intersection'](_0x29de0b['model'],qs[_0x00c2('0x38')](_0x1e0e7b[_0x00c2('0x32')][_0x00c2('0x38')]));_0x2666e9[_0x00c2('0x37')]=_0x2666e9[_0x00c2('0x37')][_0x00c2('0x39')]?_0x2666e9['attributes']:_0x29de0b[_0x00c2('0x36')];if(_0x1e0e7b[_0x00c2('0x32')][_0x00c2('0x45')]){_0x2666e9[_0x00c2('0x46')]=[{'all':!![]}];}_0x2666e9=_[_0x00c2('0x42')]({},_0x2666e9,_0x1e0e7b[_0x00c2('0x43')]);return db[_0x00c2('0x44')][_0x00c2('0x4a')](_0x2666e9)[_0x00c2('0x26')](handleEntityNotFound(_0x49233a,null))[_0x00c2('0x26')](respondWithResult(_0x49233a,null))[_0x00c2('0x49')](handleError(_0x49233a,null));};exports[_0x00c2('0x4b')]=function(_0xa60ff5,_0xbd0d3f){return db[_0x00c2('0x44')][_0x00c2('0x4b')](_0xa60ff5['body'],{})[_0x00c2('0x26')](respondWithResult(_0xbd0d3f,0xc9))['catch'](handleError(_0xbd0d3f,null));};exports['update']=function(_0x36fea6,_0x4e6216){if(_0x36fea6[_0x00c2('0x4c')]['id']){delete _0x36fea6['body']['id'];}return db[_0x00c2('0x44')][_0x00c2('0x4a')]({'where':{'id':_0x36fea6['params']['id']}})[_0x00c2('0x26')](handleEntityNotFound(_0x4e6216,null))[_0x00c2('0x26')](saveUpdates(_0x36fea6[_0x00c2('0x4c')],null))[_0x00c2('0x26')](respondWithResult(_0x4e6216,null))[_0x00c2('0x49')](handleError(_0x4e6216,null));};exports[_0x00c2('0x27')]=function(_0x5d38cb,_0x2cc393){return db[_0x00c2('0x44')]['find']({'where':{'id':_0x5d38cb[_0x00c2('0x4d')]['id']}})[_0x00c2('0x26')](handleEntityNotFound(_0x2cc393,null))[_0x00c2('0x26')](removeEntity(_0x2cc393,null))['catch'](handleError(_0x2cc393,null));};exports['describe']=function(_0xaf9708,_0x37cd06){return db[_0x00c2('0x44')][_0x00c2('0x4e')]()['then'](respondWithResult(_0x37cd06,null))[_0x00c2('0x49')](handleError(_0x37cd06,null));}; \ No newline at end of file +var _0x3165=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','error','stack','name','index','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','SmsTransferReport','includeAll','rows','show','params','rawAttributes','include','find','catch','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','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','api','../../config/utils','../../config/environment'];(function(_0x3f453b,_0x327c67){var _0x4ea39d=function(_0x3c08b9){while(--_0x3c08b9){_0x3f453b['push'](_0x3f453b['shift']());}};_0x4ea39d(++_0x327c67);}(_0x3165,0xcc));var _0x5316=function(_0x1183a1,_0x55a07f){_0x1183a1=_0x1183a1-0x0;var _0x1b5f1e=_0x3165[_0x1183a1];return _0x1b5f1e;};'use strict';var emlformat=require(_0x5316('0x0'));var rimraf=require(_0x5316('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5316('0x2'));var rp=require(_0x5316('0x3'));var moment=require('moment');var BPromise=require(_0x5316('0x4'));var Mustache=require(_0x5316('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5316('0x6'));var csv=require(_0x5316('0x7'));var ejs=require(_0x5316('0x8'));var fs=require('fs');var fs_extra=require(_0x5316('0x9'));var _=require(_0x5316('0xa'));var squel=require(_0x5316('0xb'));var crypto=require(_0x5316('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5316('0xd'));var toCsv=require(_0x5316('0x7'));var querystring=require(_0x5316('0xe'));var Papa=require(_0x5316('0xf'));var Redis=require('ioredis');var authService=require(_0x5316('0x10'));var qs=require(_0x5316('0x11'));var as=require(_0x5316('0x12'));var hardwareService=require(_0x5316('0x13'));var logger=require(_0x5316('0x14'))(_0x5316('0x15'));var utils=require(_0x5316('0x16'));var config=require(_0x5316('0x17'));var licenseUtil=require(_0x5316('0x18'));var db=require(_0x5316('0x19'))['db'];function respondWithStatusCode(_0x449860,_0x52a23d){_0x52a23d=_0x52a23d||0xcc;return function(_0x1cfb53){if(_0x1cfb53){return _0x449860[_0x5316('0x1a')](_0x52a23d);}return _0x449860[_0x5316('0x1b')](_0x52a23d)[_0x5316('0x1c')]();};}function respondWithResult(_0x327dea,_0x12cbcd){_0x12cbcd=_0x12cbcd||0xc8;return function(_0x3037a4){if(_0x3037a4){return _0x327dea['status'](_0x12cbcd)[_0x5316('0x1d')](_0x3037a4);}};}function respondWithFilteredResult(_0x491814,_0xa6b2d6){return function(_0x1f50d7){if(_0x1f50d7){var _0x3f7fb5=typeof _0xa6b2d6[_0x5316('0x1e')]===_0x5316('0x1f')&&typeof _0xa6b2d6[_0x5316('0x20')]===_0x5316('0x1f');var _0x4c752a=_0x1f50d7[_0x5316('0x21')];var _0x352ae6=_0x3f7fb5?0x0:_0xa6b2d6[_0x5316('0x1e')];var _0x47ff80=_0x3f7fb5?_0x1f50d7[_0x5316('0x21')]:_0xa6b2d6[_0x5316('0x1e')]+_0xa6b2d6[_0x5316('0x20')];var _0x3ed7ae;if(_0x47ff80>=_0x4c752a){_0x47ff80=_0x4c752a;_0x3ed7ae=0xc8;}else{_0x3ed7ae=0xce;}_0x491814[_0x5316('0x1b')](_0x3ed7ae);return _0x491814['set'](_0x5316('0x22'),_0x352ae6+'-'+_0x47ff80+'/'+_0x4c752a)[_0x5316('0x1d')](_0x1f50d7);}return null;};}function patchUpdates(_0x4195c1){return function(_0x2473b6){try{jsonpatch['apply'](_0x2473b6,_0x4195c1,!![]);}catch(_0x2b5343){return BPromise[_0x5316('0x23')](_0x2b5343);}return _0x2473b6[_0x5316('0x24')]();};}function saveUpdates(_0xbbae13,_0x78f0cb){return function(_0x346aa5){if(_0x346aa5){return _0x346aa5['update'](_0xbbae13)[_0x5316('0x25')](function(_0x402468){return _0x402468;});}return null;};}function removeEntity(_0x4ba265,_0x555179){return function(_0x30bdee){if(_0x30bdee){return _0x30bdee[_0x5316('0x26')]()[_0x5316('0x25')](function(){_0x4ba265[_0x5316('0x1b')](0xcc)[_0x5316('0x1c')]();});}};}function handleEntityNotFound(_0x36a6ae,_0x18fcbc){return function(_0x32bfab){if(!_0x32bfab){_0x36a6ae[_0x5316('0x1a')](0x194);}return _0x32bfab;};}function handleError(_0x59220d,_0x426da5){_0x426da5=_0x426da5||0x1f4;return function(_0x452d55){logger[_0x5316('0x27')](_0x452d55[_0x5316('0x28')]);if(_0x452d55['name']){delete _0x452d55[_0x5316('0x29')];}_0x59220d[_0x5316('0x1b')](_0x426da5)['send'](_0x452d55);};}exports[_0x5316('0x2a')]=function(_0x3a7813,_0x1f109d){var _0x315d2c={},_0x2b467e={},_0x1d8acb={'count':0x0,'rows':[]};var _0x267513=_[_0x5316('0x2b')](db['SmsTransferReport']['rawAttributes'],function(_0x2ef63e){return{'name':_0x2ef63e['fieldName'],'type':_0x2ef63e[_0x5316('0x2c')][_0x5316('0x2d')]};});_0x2b467e[_0x5316('0x2e')]=_[_0x5316('0x2b')](_0x267513,_0x5316('0x29'));_0x2b467e[_0x5316('0x2f')]=_[_0x5316('0x30')](_0x3a7813[_0x5316('0x2f')]);_0x2b467e['filters']=_[_0x5316('0x31')](_0x2b467e['model'],_0x2b467e[_0x5316('0x2f')]);_0x315d2c[_0x5316('0x32')]=_[_0x5316('0x31')](_0x2b467e[_0x5316('0x2e')],qs[_0x5316('0x33')](_0x3a7813[_0x5316('0x2f')]['fields']));_0x315d2c[_0x5316('0x32')]=_0x315d2c[_0x5316('0x32')][_0x5316('0x34')]?_0x315d2c['attributes']:_0x2b467e[_0x5316('0x2e')];if(!_0x3a7813[_0x5316('0x2f')][_0x5316('0x35')](_0x5316('0x36'))){_0x315d2c[_0x5316('0x20')]=qs['limit'](_0x3a7813[_0x5316('0x2f')][_0x5316('0x20')]);_0x315d2c[_0x5316('0x1e')]=qs[_0x5316('0x1e')](_0x3a7813['query'][_0x5316('0x1e')]);}_0x315d2c[_0x5316('0x37')]=qs['sort'](_0x3a7813[_0x5316('0x2f')]['sort']);_0x315d2c[_0x5316('0x38')]=qs['filters'](_[_0x5316('0x39')](_0x3a7813[_0x5316('0x2f')],_0x2b467e[_0x5316('0x3a')]),_0x267513);if(_0x3a7813[_0x5316('0x2f')][_0x5316('0x3b')]){_0x315d2c[_0x5316('0x38')]=_[_0x5316('0x3c')](_0x315d2c[_0x5316('0x38')],{'$or':_['map'](_0x267513,function(_0x19f1fb){if(_0x19f1fb[_0x5316('0x2c')]!==_0x5316('0x3d')){var _0x38737a={};_0x38737a[_0x19f1fb[_0x5316('0x29')]]={'$like':'%'+_0x3a7813[_0x5316('0x2f')]['filter']+'%'};return _0x38737a;}})});}_0x315d2c=_[_0x5316('0x3c')]({},_0x315d2c,_0x3a7813[_0x5316('0x3e')]);var _0x5a3817={'where':_0x315d2c['where']};return db[_0x5316('0x3f')][_0x5316('0x21')](_0x5a3817)[_0x5316('0x25')](function(_0x2ef81b){_0x1d8acb[_0x5316('0x21')]=_0x2ef81b;if(_0x3a7813[_0x5316('0x2f')][_0x5316('0x40')]){_0x315d2c['include']=[{'all':!![]}];}return db[_0x5316('0x3f')]['findAll'](_0x315d2c);})['then'](function(_0x489639){_0x1d8acb[_0x5316('0x41')]=_0x489639;return _0x1d8acb;})[_0x5316('0x25')](respondWithFilteredResult(_0x1f109d,_0x315d2c))['catch'](handleError(_0x1f109d,null));};exports[_0x5316('0x42')]=function(_0x589476,_0x229510){var _0x4c7fdc={'raw':!![],'where':{'id':_0x589476[_0x5316('0x43')]['id']}},_0x5b9805={};_0x5b9805[_0x5316('0x2e')]=_['keys'](db[_0x5316('0x3f')][_0x5316('0x44')]);_0x5b9805[_0x5316('0x2f')]=_[_0x5316('0x30')](_0x589476[_0x5316('0x2f')]);_0x5b9805[_0x5316('0x3a')]=_['intersection'](_0x5b9805[_0x5316('0x2e')],_0x5b9805[_0x5316('0x2f')]);_0x4c7fdc[_0x5316('0x32')]=_[_0x5316('0x31')](_0x5b9805[_0x5316('0x2e')],qs[_0x5316('0x33')](_0x589476[_0x5316('0x2f')][_0x5316('0x33')]));_0x4c7fdc['attributes']=_0x4c7fdc[_0x5316('0x32')][_0x5316('0x34')]?_0x4c7fdc[_0x5316('0x32')]:_0x5b9805[_0x5316('0x2e')];if(_0x589476[_0x5316('0x2f')][_0x5316('0x40')]){_0x4c7fdc[_0x5316('0x45')]=[{'all':!![]}];}_0x4c7fdc=_[_0x5316('0x3c')]({},_0x4c7fdc,_0x589476[_0x5316('0x3e')]);return db['SmsTransferReport'][_0x5316('0x46')](_0x4c7fdc)[_0x5316('0x25')](handleEntityNotFound(_0x229510,null))['then'](respondWithResult(_0x229510,null))[_0x5316('0x47')](handleError(_0x229510,null));};exports[_0x5316('0x48')]=function(_0x2fafa4,_0xc9710){return db[_0x5316('0x3f')][_0x5316('0x48')](_0x2fafa4['body'],{})[_0x5316('0x25')](respondWithResult(_0xc9710,0xc9))['catch'](handleError(_0xc9710,null));};exports[_0x5316('0x49')]=function(_0x2cefaa,_0x45c668){if(_0x2cefaa[_0x5316('0x4a')]['id']){delete _0x2cefaa[_0x5316('0x4a')]['id'];}return db[_0x5316('0x3f')][_0x5316('0x46')]({'where':{'id':_0x2cefaa['params']['id']}})[_0x5316('0x25')](handleEntityNotFound(_0x45c668,null))[_0x5316('0x25')](saveUpdates(_0x2cefaa[_0x5316('0x4a')],null))['then'](respondWithResult(_0x45c668,null))[_0x5316('0x47')](handleError(_0x45c668,null));};exports[_0x5316('0x26')]=function(_0x570cf8,_0x4fd56d){return db[_0x5316('0x3f')][_0x5316('0x46')]({'where':{'id':_0x570cf8[_0x5316('0x43')]['id']}})['then'](handleEntityNotFound(_0x4fd56d,null))[_0x5316('0x25')](removeEntity(_0x4fd56d,null))[_0x5316('0x47')](handleError(_0x4fd56d,null));};exports[_0x5316('0x4b')]=function(_0x4198e9,_0x3a2d41){return db[_0x5316('0x3f')][_0x5316('0x4b')]()[_0x5316('0x25')](respondWithResult(_0x3a2d41,null))[_0x5316('0x47')](handleError(_0x3a2d41,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index d4c9665..5c4d649 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 _0xbf03=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer'];(function(_0x58d9e8,_0x1994bf){var _0x5a0ed2=function(_0x11a58e){while(--_0x11a58e){_0x58d9e8['push'](_0x58d9e8['shift']());}};_0x5a0ed2(++_0x1994bf);}(_0xbf03,0x1e1));var _0x3bf0=function(_0x5ad50a,_0x5cef5c){_0x5ad50a=_0x5ad50a-0x0;var _0x236cd6=_0xbf03[_0x5ad50a];return _0x236cd6;};'use strict';var _=require(_0x3bf0('0x0'));var util=require('util');var logger=require(_0x3bf0('0x1'))(_0x3bf0('0x2'));var moment=require(_0x3bf0('0x3'));var BPromise=require(_0x3bf0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bf0('0x5'));var rimraf=require(_0x3bf0('0x6'));var config=require('../../config/environment');var attributes=require(_0x3bf0('0x7'));module['exports']=function(_0x375bdd,_0x1ae97d){return _0x375bdd[_0x3bf0('0x8')](_0x3bf0('0x9'),attributes,{'tableName':_0x3bf0('0xa'),'paranoid':![],'indexes':[{'name':_0x3bf0('0xb'),'fields':[_0x3bf0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c55=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0x1c55,0x1e3));var _0x51c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c55[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x51c5('0x0'));var util=require(_0x51c5('0x1'));var logger=require(_0x51c5('0x2'))(_0x51c5('0x3'));var moment=require(_0x51c5('0x4'));var BPromise=require(_0x51c5('0x5'));var rp=require(_0x51c5('0x6'));var fs=require('fs');var path=require(_0x51c5('0x7'));var rimraf=require(_0x51c5('0x8'));var config=require(_0x51c5('0x9'));var attributes=require('./smsTransferReport.attributes');module[_0x51c5('0xa')]=function(_0x3e15a9,_0x1e75d7){return _0x3e15a9[_0x51c5('0xb')](_0x51c5('0xc'),attributes,{'tableName':_0x51c5('0xd'),'paranoid':![],'indexes':[{'name':_0x51c5('0xe'),'fields':[_0x51c5('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 b33d419..fab1e2a 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 _0x455d=['request\x20sent','debug','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x50809a,_0x13735f){var _0x2a3e33=function(_0x4b8d23){while(--_0x4b8d23){_0x50809a['push'](_0x50809a['shift']());}};_0x2a3e33(++_0x13735f);}(_0x455d,0x190));var _0xd455=function(_0x5621ab,_0x20c9e0){_0x5621ab=_0x5621ab-0x0;var _0x57dd45=_0x455d[_0x5621ab];return _0x57dd45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd455('0x0'));var BPromise=require(_0xd455('0x1'));var rs=require(_0xd455('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd455('0x3'))['db'];var utils=require(_0xd455('0x4'));var logger=require(_0xd455('0x5'))(_0xd455('0x6'));var config=require(_0xd455('0x7'));var jayson=require(_0xd455('0x8'));var client=jayson[_0xd455('0x9')][_0xd455('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b373c,_0x5a5ed7,_0x2bbebf){return new BPromise(function(_0x2e530a,_0x4ef696){return client[_0xd455('0xb')](_0x3b373c,_0x2bbebf)[_0xd455('0xc')](function(_0xed6c5f){logger[_0xd455('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x5a5ed7,_0xd455('0xe'));logger[_0xd455('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5a5ed7,_0xd455('0xe'),JSON[_0xd455('0x10')](_0xed6c5f));if(_0xed6c5f[_0xd455('0x11')]){if(_0xed6c5f[_0xd455('0x11')][_0xd455('0x12')]===0x1f4){logger[_0xd455('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x5a5ed7,_0xed6c5f['error'][_0xd455('0x13')]);return _0x4ef696(_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);}logger['error'](_0xd455('0x14'),_0x5a5ed7,_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);return _0x2e530a(_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);}else{logger[_0xd455('0xd')](_0xd455('0x14'),_0x5a5ed7,_0xd455('0xe'));_0x2e530a(_0xed6c5f[_0xd455('0x15')]['message']);}})[_0xd455('0x16')](function(_0x35a9fc){logger[_0xd455('0x11')](_0xd455('0x14'),_0x5a5ed7,_0x35a9fc);_0x4ef696(_0x35a9fc);});});} \ No newline at end of file +var _0x0845=['SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','SmsTransferReport,\x20%s,\x20%s','debug'];(function(_0xb8e44,_0x2a6a20){var _0x3dbb16=function(_0x15fca8){while(--_0x15fca8){_0xb8e44['push'](_0xb8e44['shift']());}};_0x3dbb16(++_0x2a6a20);}(_0x0845,0x125));var _0x5084=function(_0x5698fa,_0x5200ac){_0x5698fa=_0x5698fa-0x0;var _0x105e81=_0x0845[_0x5698fa];return _0x105e81;};'use strict';var _=require(_0x5084('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5084('0x1'));var rs=require(_0x5084('0x2'));var fs=require('fs');var Redis=require(_0x5084('0x3'));var db=require(_0x5084('0x4'))['db'];var utils=require(_0x5084('0x5'));var logger=require(_0x5084('0x6'))('rpc');var config=require(_0x5084('0x7'));var jayson=require(_0x5084('0x8'));var client=jayson[_0x5084('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3d8f,_0x5a999b,_0x212120){return new BPromise(function(_0x439176,_0x14e571){return client['request'](_0x5f3d8f,_0x212120)['then'](function(_0xbbddf0){logger[_0x5084('0xa')](_0x5084('0xb'),_0x5a999b,'request\x20sent');logger[_0x5084('0xc')](_0x5084('0xd'),_0x5a999b,_0x5084('0xe'),JSON['stringify'](_0xbbddf0));if(_0xbbddf0['error']){if(_0xbbddf0[_0x5084('0xf')][_0x5084('0x10')]===0x1f4){logger[_0x5084('0xf')](_0x5084('0xb'),_0x5a999b,_0xbbddf0[_0x5084('0xf')][_0x5084('0x11')]);return _0x14e571(_0xbbddf0[_0x5084('0xf')][_0x5084('0x11')]);}logger['error'](_0x5084('0xb'),_0x5a999b,_0xbbddf0[_0x5084('0xf')][_0x5084('0x11')]);return _0x439176(_0xbbddf0['error'][_0x5084('0x11')]);}else{logger[_0x5084('0xa')](_0x5084('0xb'),_0x5a999b,_0x5084('0xe'));_0x439176(_0xbbddf0['result'][_0x5084('0x11')]);}})['catch'](function(_0x326ca0){logger[_0x5084('0xf')](_0x5084('0xb'),_0x5a999b,_0x326ca0);_0x14e571(_0x326ca0);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1c2f4a8..d969bda 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 _0x6c64=['/:id','show','get','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','single','file','create','put','update','delete','multer','util','connect-timeout','../../config/environment','./sound.controller','isAuthenticated','index'];(function(_0x31229e,_0x1138dd){var _0x56f14f=function(_0x401bfb){while(--_0x401bfb){_0x31229e['push'](_0x31229e['shift']());}};_0x56f14f(++_0x1138dd);}(_0x6c64,0x8f));var _0x46c6=function(_0x21cdde,_0x371b44){_0x21cdde=_0x21cdde-0x0;var _0x21302b=_0x6c64[_0x21cdde];return _0x21302b;};'use strict';var multer=require(_0x46c6('0x0'));var util=require(_0x46c6('0x1'));var path=require('path');var timeout=require(_0x46c6('0x2'));var express=require('express');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(_0x46c6('0x3'));var controller=require(_0x46c6('0x4'));router['get']('/',auth[_0x46c6('0x5')](),controller[_0x46c6('0x6')]);router['get'](_0x46c6('0x7'),auth[_0x46c6('0x5')](),controller[_0x46c6('0x8')]);router[_0x46c6('0x9')]('/:id/download',auth[_0x46c6('0x5')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44c74e,_0x2d4ce6,_0x60e1c8){_0x60e1c8(null,path[_0x46c6('0xa')](config[_0x46c6('0xb')],_0x46c6('0xc')));},'filename':function(_0x3b72f7,_0x56f4aa,_0xccf8ad){_0x56f4aa[_0x46c6('0xd')]=_0x56f4aa[_0x46c6('0xd')][_0x46c6('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xccf8ad(null,util['format'](_0x46c6('0xf'),path[_0x46c6('0x10')](_0x56f4aa[_0x46c6('0xd')],path[_0x46c6('0x11')](_0x56f4aa['originalname'])),Date[_0x46c6('0x12')](),path['extname'](_0x56f4aa[_0x46c6('0xd')])));}})});router['post']('/',upload[_0x46c6('0x13')](_0x46c6('0x14')),controller[_0x46c6('0x15')]);router[_0x46c6('0x16')](_0x46c6('0x7'),auth[_0x46c6('0x5')](),controller[_0x46c6('0x17')]);router[_0x46c6('0x18')](_0x46c6('0x7'),auth[_0x46c6('0x5')](),controller[_0x46c6('0x18')]);module['exports']=router; \ No newline at end of file +var _0x73cc=['get','isAuthenticated','/:id','show','/:id/download','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','extname','now','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller'];(function(_0x2bd285,_0x26a268){var _0x4631df=function(_0x1f04f5){while(--_0x1f04f5){_0x2bd285['push'](_0x2bd285['shift']());}};_0x4631df(++_0x26a268);}(_0x73cc,0x7e));var _0xc73c=function(_0x4686f1,_0x341719){_0x4686f1=_0x4686f1-0x0;var _0x262106=_0x73cc[_0x4686f1];return _0x262106;};'use strict';var multer=require(_0xc73c('0x0'));var util=require(_0xc73c('0x1'));var path=require('path');var timeout=require(_0xc73c('0x2'));var express=require(_0xc73c('0x3'));var router=express[_0xc73c('0x4')]();var fs_extra=require(_0xc73c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc73c('0x6'));var config=require(_0xc73c('0x7'));var controller=require(_0xc73c('0x8'));router[_0xc73c('0x9')]('/',auth[_0xc73c('0xa')](),controller['index']);router['get'](_0xc73c('0xb'),auth[_0xc73c('0xa')](),controller[_0xc73c('0xc')]);router[_0xc73c('0x9')](_0xc73c('0xd'),auth[_0xc73c('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5147a0,_0x1f80cf,_0x3f03e8){_0x3f03e8(null,path[_0xc73c('0xe')](config[_0xc73c('0xf')],_0xc73c('0x10')));},'filename':function(_0x4abd12,_0x3f273e,_0x6f202b){_0x3f273e[_0xc73c('0x11')]=_0x3f273e[_0xc73c('0x11')][_0xc73c('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6f202b(null,util['format'](_0xc73c('0x13'),path['basename'](_0x3f273e[_0xc73c('0x11')],path[_0xc73c('0x14')](_0x3f273e['originalname'])),Date[_0xc73c('0x15')](),path[_0xc73c('0x14')](_0x3f273e[_0xc73c('0x11')])));}})});router[_0xc73c('0x16')]('/',upload['single']('file'),controller[_0xc73c('0x17')]);router[_0xc73c('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc73c('0x19')](_0xc73c('0xb'),auth[_0xc73c('0xa')](),controller[_0xc73c('0x19')]);module[_0xc73c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 2c7bb47..24f2070 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 _0x9682=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x2557bc,_0x28a23b){var _0x404363=function(_0x41af20){while(--_0x41af20){_0x2557bc['push'](_0x2557bc['shift']());}};_0x404363(++_0x28a23b);}(_0x9682,0x13d));var _0x2968=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9682[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x2968('0x0'));module['exports']={'name':{'type':Sequelize[_0x2968('0x1')],'unique':_0x2968('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x2968('0x1')]},'original_format':{'type':Sequelize[_0x2968('0x1')]},'original_duration':{'type':Sequelize[_0x2968('0x3')]},'original_sampleCount':{'type':Sequelize[_0x2968('0x4')]},'original_channelCount':{'type':Sequelize[_0x2968('0x5')]},'original_bitRate':{'type':Sequelize[_0x2968('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x2968('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x2968('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6286=['INTEGER','sequelize','STRING','name','FLOAT','BIGINT'];(function(_0x4c3e66,_0x48046f){var _0x5bd8cc=function(_0x1cec00){while(--_0x1cec00){_0x4c3e66['push'](_0x4c3e66['shift']());}};_0x5bd8cc(++_0x48046f);}(_0x6286,0x133));var _0x6628=function(_0x310a54,_0x212d9a){_0x310a54=_0x310a54-0x0;var _0x4e4caa=_0x6286[_0x310a54];return _0x4e4caa;};'use strict';var Sequelize=require(_0x6628('0x0'));module['exports']={'name':{'type':Sequelize[_0x6628('0x1')],'unique':_0x6628('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6628('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x6628('0x1')]},'original_format':{'type':Sequelize[_0x6628('0x1')]},'original_duration':{'type':Sequelize[_0x6628('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6628('0x4')]},'original_channelCount':{'type':Sequelize[_0x6628('0x5')]},'original_bitRate':{'type':Sequelize[_0x6628('0x4')]},'original_sampleRate':{'type':Sequelize[_0x6628('0x5')]},'converted_format':{'type':Sequelize[_0x6628('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x6628('0x4')]},'converted_channelCount':{'type':Sequelize[_0x6628('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6628('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6628('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 00ee4ab..ab2336f 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 _0xac7b=['query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Sound','includeAll','include','findAll','rows','show','params','intersection','find','catch','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sound\x20not\x20found','download','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','user','UserProfileSection','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','original_format','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','map','rawAttributes','type','keys'];(function(_0x531947,_0x3bea44){var _0x4caf2f=function(_0x4cb996){while(--_0x4cb996){_0x531947['push'](_0x531947['shift']());}};_0x4caf2f(++_0x3bea44);}(_0xac7b,0x1cc));var _0xbac7=function(_0x2f5dd6,_0x1711ea){_0x2f5dd6=_0x2f5dd6-0x0;var _0x23d90c=_0xac7b[_0x2f5dd6];return _0x23d90c;};'use strict';var emlformat=require(_0xbac7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbac7('0x1'));var rp=require('request-promise');var moment=require(_0xbac7('0x2'));var BPromise=require(_0xbac7('0x3'));var Mustache=require(_0xbac7('0x4'));var util=require(_0xbac7('0x5'));var path=require(_0xbac7('0x6'));var sox=require(_0xbac7('0x7'));var csv=require(_0xbac7('0x8'));var ejs=require(_0xbac7('0x9'));var fs=require('fs');var fs_extra=require(_0xbac7('0xa'));var _=require(_0xbac7('0xb'));var squel=require(_0xbac7('0xc'));var crypto=require(_0xbac7('0xd'));var jsforce=require(_0xbac7('0xe'));var deskjs=require(_0xbac7('0xf'));var toCsv=require(_0xbac7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbac7('0x10'));var authService=require(_0xbac7('0x11'));var qs=require(_0xbac7('0x12'));var as=require(_0xbac7('0x13'));var hardwareService=require(_0xbac7('0x14'));var logger=require(_0xbac7('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbac7('0x16'));var licenseUtil=require(_0xbac7('0x17'));var db=require(_0xbac7('0x18'))['db'];function respondWithStatusCode(_0x5d7c93,_0x13b5df){_0x13b5df=_0x13b5df||0xcc;return function(_0x429c47){if(_0x429c47){return _0x5d7c93[_0xbac7('0x19')](_0x13b5df);}return _0x5d7c93['status'](_0x13b5df)[_0xbac7('0x1a')]();};}function respondWithResult(_0x71eac0,_0x5a7b0c){_0x5a7b0c=_0x5a7b0c||0xc8;return function(_0x5aff2e){if(_0x5aff2e){return _0x71eac0[_0xbac7('0x1b')](_0x5a7b0c)[_0xbac7('0x1c')](_0x5aff2e);}};}function respondWithFilteredResult(_0x157b65,_0x23bcac){return function(_0x2ad06c){if(_0x2ad06c){var _0x5dc10a=typeof _0x23bcac[_0xbac7('0x1d')]===_0xbac7('0x1e')&&typeof _0x23bcac['limit']===_0xbac7('0x1e');var _0x2b2bfb=_0x2ad06c[_0xbac7('0x1f')];var _0x6cb66=_0x5dc10a?0x0:_0x23bcac[_0xbac7('0x1d')];var _0x5d8fd8=_0x5dc10a?_0x2ad06c[_0xbac7('0x1f')]:_0x23bcac[_0xbac7('0x1d')]+_0x23bcac[_0xbac7('0x20')];var _0x23b8e5;if(_0x5d8fd8>=_0x2b2bfb){_0x5d8fd8=_0x2b2bfb;_0x23b8e5=0xc8;}else{_0x23b8e5=0xce;}_0x157b65['status'](_0x23b8e5);return _0x157b65[_0xbac7('0x21')](_0xbac7('0x22'),_0x6cb66+'-'+_0x5d8fd8+'/'+_0x2b2bfb)['json'](_0x2ad06c);}return null;};}function patchUpdates(_0x12af58){return function(_0x281895){try{jsonpatch[_0xbac7('0x23')](_0x281895,_0x12af58,!![]);}catch(_0x5b55cd){return BPromise[_0xbac7('0x24')](_0x5b55cd);}return _0x281895[_0xbac7('0x25')]();};}function saveUpdates(_0x3967c0,_0x555fdc){return function(_0x44fa93){if(_0x44fa93){return _0x44fa93['update'](_0x3967c0)[_0xbac7('0x26')](function(_0xb09d4c){return _0xb09d4c;});}return null;};}function removeEntity(_0x202524,_0x326528){return function(_0x513fb3){if(_0x513fb3){return _0x513fb3[_0xbac7('0x27')]()[_0xbac7('0x26')](function(){var _0x16d3c8=_0x513fb3[_0xbac7('0x28')]({'plain':!![]});var _0x5bd7b8='Sounds';return db[_0xbac7('0x29')]['destroy']({'where':{'type':_0x5bd7b8,'resourceId':_0x16d3c8['id']}})[_0xbac7('0x26')](function(){return _0x513fb3;});})[_0xbac7('0x26')](function(){_0x202524[_0xbac7('0x1b')](0xcc)[_0xbac7('0x1a')]();});}};}function handleEntityNotFound(_0x168e19,_0x41a666){return function(_0x4d2867){if(!_0x4d2867){_0x168e19[_0xbac7('0x19')](0x194);}return _0x4d2867;};}function handleError(_0xd7f519,_0x1a0db6){_0x1a0db6=_0x1a0db6||0x1f4;return function(_0x4a1d8a){logger['error'](_0x4a1d8a[_0xbac7('0x2a')]);if(_0x4a1d8a[_0xbac7('0x2b')]){delete _0x4a1d8a[_0xbac7('0x2b')];}_0xd7f519[_0xbac7('0x1b')](_0x1a0db6)['send'](_0x4a1d8a);};}exports['index']=function(_0x41a25d,_0x3928a1){var _0x48448f={},_0x33870a={},_0x170f04={'count':0x0,'rows':[]};var _0x1187f2=_[_0xbac7('0x2c')](db['Sound'][_0xbac7('0x2d')],function(_0x447b1a){return{'name':_0x447b1a['fieldName'],'type':_0x447b1a[_0xbac7('0x2e')]['key']};});_0x33870a['model']=_[_0xbac7('0x2c')](_0x1187f2,_0xbac7('0x2b'));_0x33870a['query']=_[_0xbac7('0x2f')](_0x41a25d[_0xbac7('0x30')]);_0x33870a[_0xbac7('0x31')]=_['intersection'](_0x33870a['model'],_0x33870a[_0xbac7('0x30')]);_0x48448f['attributes']=_['intersection'](_0x33870a[_0xbac7('0x32')],qs['fields'](_0x41a25d[_0xbac7('0x30')][_0xbac7('0x33')]));_0x48448f[_0xbac7('0x34')]=_0x48448f[_0xbac7('0x34')][_0xbac7('0x35')]?_0x48448f[_0xbac7('0x34')]:_0x33870a[_0xbac7('0x32')];if(!_0x41a25d['query'][_0xbac7('0x36')](_0xbac7('0x37'))){_0x48448f[_0xbac7('0x20')]=qs['limit'](_0x41a25d[_0xbac7('0x30')][_0xbac7('0x20')]);_0x48448f[_0xbac7('0x1d')]=qs['offset'](_0x41a25d[_0xbac7('0x30')]['offset']);}_0x48448f[_0xbac7('0x38')]=qs[_0xbac7('0x39')](_0x41a25d[_0xbac7('0x30')][_0xbac7('0x39')]);_0x48448f['where']=qs['filters'](_[_0xbac7('0x3a')](_0x41a25d['query'],_0x33870a['filters']),_0x1187f2);if(_0x41a25d['query']['filter']){_0x48448f[_0xbac7('0x3b')]=_[_0xbac7('0x3c')](_0x48448f['where'],{'$or':_[_0xbac7('0x2c')](_0x1187f2,function(_0x1de148){if(_0x1de148[_0xbac7('0x2e')]!==_0xbac7('0x3d')){var _0x1825b5={};_0x1825b5[_0x1de148[_0xbac7('0x2b')]]={'$like':'%'+_0x41a25d[_0xbac7('0x30')][_0xbac7('0x3e')]+'%'};return _0x1825b5;}})});}_0x48448f=_[_0xbac7('0x3c')]({},_0x48448f,_0x41a25d[_0xbac7('0x3f')]);var _0x155bc6={'where':_0x48448f[_0xbac7('0x3b')]};return db[_0xbac7('0x40')][_0xbac7('0x1f')](_0x155bc6)['then'](function(_0x2f0ad2){_0x170f04[_0xbac7('0x1f')]=_0x2f0ad2;if(_0x41a25d[_0xbac7('0x30')][_0xbac7('0x41')]){_0x48448f[_0xbac7('0x42')]=[{'all':!![]}];}return db[_0xbac7('0x40')][_0xbac7('0x43')](_0x48448f);})['then'](function(_0x74696b){_0x170f04[_0xbac7('0x44')]=_0x74696b;return _0x170f04;})[_0xbac7('0x26')](respondWithFilteredResult(_0x3928a1,_0x48448f))['catch'](handleError(_0x3928a1,null));};exports[_0xbac7('0x45')]=function(_0x275cfb,_0x28e660){var _0x3fbc92={'raw':!![],'where':{'id':_0x275cfb[_0xbac7('0x46')]['id']}},_0x117781={};_0x117781[_0xbac7('0x32')]=_['keys'](db[_0xbac7('0x40')][_0xbac7('0x2d')]);_0x117781[_0xbac7('0x30')]=_[_0xbac7('0x2f')](_0x275cfb[_0xbac7('0x30')]);_0x117781['filters']=_[_0xbac7('0x47')](_0x117781['model'],_0x117781['query']);_0x3fbc92[_0xbac7('0x34')]=_[_0xbac7('0x47')](_0x117781[_0xbac7('0x32')],qs['fields'](_0x275cfb[_0xbac7('0x30')][_0xbac7('0x33')]));_0x3fbc92['attributes']=_0x3fbc92[_0xbac7('0x34')][_0xbac7('0x35')]?_0x3fbc92[_0xbac7('0x34')]:_0x117781['model'];if(_0x275cfb[_0xbac7('0x30')][_0xbac7('0x41')]){_0x3fbc92[_0xbac7('0x42')]=[{'all':!![]}];}_0x3fbc92=_[_0xbac7('0x3c')]({},_0x3fbc92,_0x275cfb[_0xbac7('0x3f')]);return db['Sound'][_0xbac7('0x48')](_0x3fbc92)[_0xbac7('0x26')](handleEntityNotFound(_0x28e660,null))[_0xbac7('0x26')](respondWithResult(_0x28e660,null))[_0xbac7('0x49')](handleError(_0x28e660,null));};exports['download']=function(_0x1f4bca,_0x218243,_0x538e32){return db[_0xbac7('0x40')]['find']({'where':{'id':_0x1f4bca['params']['id']},'attributes':[_0xbac7('0x2b'),_0xbac7('0x4a'),_0xbac7('0x4b')],'raw':!![]})[_0xbac7('0x26')](handleEntityNotFound(_0x218243,null))[_0xbac7('0x26')](function(_0x329800){if(_0x329800){if(!fs[_0xbac7('0x4c')](path['join'](config[_0xbac7('0x4d')],_0xbac7('0x4e'),_0x329800[_0xbac7('0x4a')]+'.'+_0x329800[_0xbac7('0x4b')]))){throw new db['Sequelize']['ValidationError'](_0xbac7('0x4f'));}return _0x218243[_0xbac7('0x50')](path[_0xbac7('0x51')](config['root'],'server/files/sounds/converted',util[_0xbac7('0x52')]('%s.%s',_0x329800[_0xbac7('0x4a')],_0x329800[_0xbac7('0x4b')])),util[_0xbac7('0x52')](_0xbac7('0x53'),_0x329800[_0xbac7('0x2b')],_0x329800[_0xbac7('0x4b')]));}return null;})[_0xbac7('0x49')](handleError(_0x218243,null));};exports[_0xbac7('0x54')]=function(_0x281bf6,_0x33bcfb,_0x49d122){var _0x87ce7e={'name':path[_0xbac7('0x55')](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x57')],path[_0xbac7('0x58')](_0x281bf6[_0xbac7('0x56')]['originalname'])),'save_name':path[_0xbac7('0x55')](_0x281bf6['file']['filename'],path[_0xbac7('0x58')](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')])),'original_format':path[_0xbac7('0x58')](_0x281bf6[_0xbac7('0x56')]['originalname'])[_0xbac7('0x5a')](0x1),'converted_format':_0xbac7('0x5b')};var _0x17f77c=path[_0xbac7('0x51')](config[_0xbac7('0x4d')],_0xbac7('0x5c'),_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')]);var _0x2ab044=path[_0xbac7('0x51')](config[_0xbac7('0x4d')],_0xbac7('0x4e'),util[_0xbac7('0x52')]('%s.%s',path[_0xbac7('0x55')](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')],path['extname'](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')])),_0x87ce7e[_0xbac7('0x4b')]));logger[_0xbac7('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0x17f77c);logger[_0xbac7('0x5d')](_0xbac7('0x5e'),_0x2ab044);try{fs[_0xbac7('0x5f')](_0x17f77c,parseInt(_0xbac7('0x60'),0x8));var _0xb81c7f=sox[_0xbac7('0x61')](_0x17f77c,_0x2ab044,{'sampleRate':0x1f40,'format':_0xbac7('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb81c7f['on'](_0xbac7('0x62'),function(_0x4a4d9e){fs[_0xbac7('0x63')](_0x17f77c);_0x33bcfb[_0xbac7('0x1b')](0x1f4)[_0xbac7('0x64')](_0x4a4d9e);});_0xb81c7f['on'](_0xbac7('0x65'),function(_0x2ee7cc){_0x87ce7e[_0xbac7('0x66')]=isNaN(_0x2ee7cc['duration'])?null:_0x2ee7cc[_0xbac7('0x67')]*0x3e8;_0x87ce7e['original_sampleCount']=isNaN(_0x2ee7cc[_0xbac7('0x68')])?null:_0x2ee7cc[_0xbac7('0x68')];_0x87ce7e[_0xbac7('0x69')]=isNaN(_0x2ee7cc[_0xbac7('0x6a')])?null:_0x2ee7cc['channelCount'];_0x87ce7e[_0xbac7('0x6b')]=isNaN(_0x2ee7cc[_0xbac7('0x6c')])?null:_0x2ee7cc['bitRate'];_0x87ce7e['original_sampleRate']=isNaN(_0x2ee7cc[_0xbac7('0x6d')])?null:_0x2ee7cc[_0xbac7('0x6d')];});_0xb81c7f['on']('dest',function(_0x596777){_0x87ce7e[_0xbac7('0x6e')]=isNaN(_0x596777['duration'])?null:_0x596777[_0xbac7('0x67')]*0x3e8;_0x87ce7e[_0xbac7('0x6f')]=isNaN(_0x596777[_0xbac7('0x68')])?null:_0x596777['sampleCount'];_0x87ce7e[_0xbac7('0x70')]=isNaN(_0x596777['channelCount'])?null:_0x596777[_0xbac7('0x6a')];_0x87ce7e[_0xbac7('0x71')]=isNaN(_0x596777['bitRate'])?null:_0x596777[_0xbac7('0x6c')];_0x87ce7e[_0xbac7('0x72')]=isNaN(_0x596777[_0xbac7('0x6d')])?null:_0x596777[_0xbac7('0x6d')];});_0xb81c7f['on']('end',function(){fs[_0xbac7('0x5f')](_0x2ab044,parseInt(_0xbac7('0x60'),0x8));return db[_0xbac7('0x40')][_0xbac7('0x54')](_0x87ce7e)['then'](function(_0x36f6c6){var _0x5aa9c5={'role':_0x281bf6[_0xbac7('0x73')][_0xbac7('0x74')],'userProfileId':_0x281bf6['body'][_0xbac7('0x75')]};if(!_0x5aa9c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aa9c5['role']===_0xbac7('0x76')){var _0x3c6085=_0x36f6c6[_0xbac7('0x28')]({'plain':!![]});return db[_0xbac7('0x77')][_0xbac7('0x48')]({'where':{'name':_0xbac7('0x78'),'userProfileId':_0x5aa9c5['userProfileId']},'raw':!![]})[_0xbac7('0x26')](function(_0x3f3bd8){if(_0x3f3bd8&&_0x3f3bd8['autoAssociation']===0x0){return db[_0xbac7('0x29')][_0xbac7('0x54')]({'name':_0x3c6085[_0xbac7('0x2b')],'resourceId':_0x3c6085['id'],'type':_0x3f3bd8['name'],'sectionId':_0x3f3bd8['id']},{})[_0xbac7('0x26')](function(){return _0x36f6c6;});}else{return _0x36f6c6;}})[_0xbac7('0x49')](function(_0x5c75ef){logger['error'](_0xbac7('0x79'),_0x5c75ef);throw _0x5c75ef;});}return _0x36f6c6;})[_0xbac7('0x26')](respondWithResult(_0x33bcfb,null))[_0xbac7('0x49')](handleError(_0x33bcfb,null));});_0xb81c7f[_0xbac7('0x7a')]();}catch(_0x25f739){_0x33bcfb[_0xbac7('0x1b')](0x1f4)[_0xbac7('0x64')](_0x25f739);}};exports[_0xbac7('0x7b')]=function(_0x512779,_0x226f57,_0x3f5bcb){return db['Sound'][_0xbac7('0x48')]({'where':{'id':_0x512779[_0xbac7('0x46')]['id']}})[_0xbac7('0x26')](handleEntityNotFound(_0x226f57,null))[_0xbac7('0x26')](saveUpdates(_[_0xbac7('0x3a')](_0x512779[_0xbac7('0x73')],['name',_0xbac7('0x7c')]),null))['then'](respondWithResult(_0x226f57,null))[_0xbac7('0x49')](handleError(_0x226f57,null));};exports[_0xbac7('0x7d')]=function(_0x57ebff,_0xaa5cb6,_0x221b10){return db['Sound'][_0xbac7('0x48')]({'where':{'id':_0x57ebff[_0xbac7('0x46')]['id']}})['then'](function(_0x3a0cba){if(_0x3a0cba){return _0x3a0cba[_0xbac7('0x27')]();}})[_0xbac7('0x26')](function(_0x53ea43){var _0x3c954f=path[_0xbac7('0x51')](config['root'],'server/files/sounds/original',util[_0xbac7('0x52')](_0xbac7('0x53'),_0x53ea43[_0xbac7('0x4a')],_0x53ea43[_0xbac7('0x7e')]));var _0x3ae5b8=path[_0xbac7('0x51')](config['root'],'server/files/sounds/converted',util['format'](_0xbac7('0x53'),_0x53ea43[_0xbac7('0x4a')],_0x53ea43[_0xbac7('0x4b')]));fs['unlinkSync'](_0x3c954f);fs['unlinkSync'](_0x3ae5b8);return _0x53ea43;})[_0xbac7('0x26')](function(_0x84fbab){if(_0x84fbab){return _0xaa5cb6['status'](0xcc)[_0xbac7('0x1a')]();}})[_0xbac7('0x26')](handleEntityNotFound(_0xaa5cb6,null))['catch'](handleError(_0xaa5cb6,null));}; \ No newline at end of file +var _0x9ec2=['unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Sounds','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','destroy','get','then','error','stack','name','send','index','map','Sound','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','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','file','extname','originalname','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9ec2,0x118));var _0x29ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ec2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x29ec('0x0'));var rimraf=require(_0x29ec('0x1'));var zipdir=require(_0x29ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29ec('0x3'));var moment=require(_0x29ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x29ec('0x5'));var util=require(_0x29ec('0x6'));var path=require(_0x29ec('0x7'));var sox=require(_0x29ec('0x8'));var csv=require(_0x29ec('0x9'));var ejs=require(_0x29ec('0xa'));var fs=require('fs');var fs_extra=require(_0x29ec('0xb'));var _=require(_0x29ec('0xc'));var squel=require(_0x29ec('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x29ec('0x9'));var querystring=require(_0x29ec('0xe'));var Papa=require(_0x29ec('0xf'));var Redis=require(_0x29ec('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x29ec('0x11'));var as=require(_0x29ec('0x12'));var hardwareService=require(_0x29ec('0x13'));var logger=require(_0x29ec('0x14'))('api');var utils=require(_0x29ec('0x15'));var config=require(_0x29ec('0x16'));var licenseUtil=require(_0x29ec('0x17'));var db=require(_0x29ec('0x18'))['db'];function respondWithStatusCode(_0x4caf6b,_0x3910da){_0x3910da=_0x3910da||0xcc;return function(_0x55bb89){if(_0x55bb89){return _0x4caf6b[_0x29ec('0x19')](_0x3910da);}return _0x4caf6b[_0x29ec('0x1a')](_0x3910da)[_0x29ec('0x1b')]();};}function respondWithResult(_0x55c752,_0x2ac0ed){_0x2ac0ed=_0x2ac0ed||0xc8;return function(_0x362811){if(_0x362811){return _0x55c752[_0x29ec('0x1a')](_0x2ac0ed)[_0x29ec('0x1c')](_0x362811);}};}function respondWithFilteredResult(_0x9b33e7,_0x616f52){return function(_0x3621b6){if(_0x3621b6){var _0x27e67b=typeof _0x616f52['offset']===_0x29ec('0x1d')&&typeof _0x616f52['limit']===_0x29ec('0x1d');var _0x1dc8fb=_0x3621b6[_0x29ec('0x1e')];var _0x12ab71=_0x27e67b?0x0:_0x616f52[_0x29ec('0x1f')];var _0x166752=_0x27e67b?_0x3621b6[_0x29ec('0x1e')]:_0x616f52['offset']+_0x616f52[_0x29ec('0x20')];var _0x47c9b0;if(_0x166752>=_0x1dc8fb){_0x166752=_0x1dc8fb;_0x47c9b0=0xc8;}else{_0x47c9b0=0xce;}_0x9b33e7[_0x29ec('0x1a')](_0x47c9b0);return _0x9b33e7[_0x29ec('0x21')](_0x29ec('0x22'),_0x12ab71+'-'+_0x166752+'/'+_0x1dc8fb)['json'](_0x3621b6);}return null;};}function patchUpdates(_0xa12534){return function(_0x525431){try{jsonpatch['apply'](_0x525431,_0xa12534,!![]);}catch(_0x210380){return BPromise['reject'](_0x210380);}return _0x525431[_0x29ec('0x23')]();};}function saveUpdates(_0x114703,_0x3982f4){return function(_0x560485){if(_0x560485){return _0x560485[_0x29ec('0x24')](_0x114703)['then'](function(_0x3b24f9){return _0x3b24f9;});}return null;};}function removeEntity(_0x4572ed,_0x3c4e4a){return function(_0x3c6129){if(_0x3c6129){return _0x3c6129[_0x29ec('0x25')]()['then'](function(){var _0x4faa4b=_0x3c6129[_0x29ec('0x26')]({'plain':!![]});var _0x2c9455='Sounds';return db['UserProfileResource'][_0x29ec('0x25')]({'where':{'type':_0x2c9455,'resourceId':_0x4faa4b['id']}})[_0x29ec('0x27')](function(){return _0x3c6129;});})[_0x29ec('0x27')](function(){_0x4572ed[_0x29ec('0x1a')](0xcc)[_0x29ec('0x1b')]();});}};}function handleEntityNotFound(_0x15bf00,_0x2678f2){return function(_0xcaf43f){if(!_0xcaf43f){_0x15bf00[_0x29ec('0x19')](0x194);}return _0xcaf43f;};}function handleError(_0xda62c3,_0x3aed59){_0x3aed59=_0x3aed59||0x1f4;return function(_0x2c3387){logger[_0x29ec('0x28')](_0x2c3387[_0x29ec('0x29')]);if(_0x2c3387[_0x29ec('0x2a')]){delete _0x2c3387[_0x29ec('0x2a')];}_0xda62c3[_0x29ec('0x1a')](_0x3aed59)[_0x29ec('0x2b')](_0x2c3387);};}exports[_0x29ec('0x2c')]=function(_0x330a3f,_0x50a391){var _0x1c9f4f={},_0x1e2acb={},_0x3ab6b9={'count':0x0,'rows':[]};var _0x5d9357=_[_0x29ec('0x2d')](db[_0x29ec('0x2e')]['rawAttributes'],function(_0x53ac9f){return{'name':_0x53ac9f[_0x29ec('0x2f')],'type':_0x53ac9f[_0x29ec('0x30')][_0x29ec('0x31')]};});_0x1e2acb[_0x29ec('0x32')]=_['map'](_0x5d9357,_0x29ec('0x2a'));_0x1e2acb[_0x29ec('0x33')]=_[_0x29ec('0x34')](_0x330a3f[_0x29ec('0x33')]);_0x1e2acb[_0x29ec('0x35')]=_[_0x29ec('0x36')](_0x1e2acb[_0x29ec('0x32')],_0x1e2acb[_0x29ec('0x33')]);_0x1c9f4f[_0x29ec('0x37')]=_[_0x29ec('0x36')](_0x1e2acb[_0x29ec('0x32')],qs['fields'](_0x330a3f[_0x29ec('0x33')][_0x29ec('0x38')]));_0x1c9f4f[_0x29ec('0x37')]=_0x1c9f4f[_0x29ec('0x37')][_0x29ec('0x39')]?_0x1c9f4f[_0x29ec('0x37')]:_0x1e2acb['model'];if(!_0x330a3f['query'][_0x29ec('0x3a')]('nolimit')){_0x1c9f4f[_0x29ec('0x20')]=qs[_0x29ec('0x20')](_0x330a3f[_0x29ec('0x33')][_0x29ec('0x20')]);_0x1c9f4f[_0x29ec('0x1f')]=qs[_0x29ec('0x1f')](_0x330a3f['query'][_0x29ec('0x1f')]);}_0x1c9f4f[_0x29ec('0x3b')]=qs[_0x29ec('0x3c')](_0x330a3f['query']['sort']);_0x1c9f4f['where']=qs['filters'](_[_0x29ec('0x3d')](_0x330a3f[_0x29ec('0x33')],_0x1e2acb[_0x29ec('0x35')]),_0x5d9357);if(_0x330a3f[_0x29ec('0x33')][_0x29ec('0x3e')]){_0x1c9f4f[_0x29ec('0x3f')]=_['merge'](_0x1c9f4f[_0x29ec('0x3f')],{'$or':_[_0x29ec('0x2d')](_0x5d9357,function(_0x5f3ccf){if(_0x5f3ccf[_0x29ec('0x30')]!==_0x29ec('0x40')){var _0x514756={};_0x514756[_0x5f3ccf[_0x29ec('0x2a')]]={'$like':'%'+_0x330a3f['query'][_0x29ec('0x3e')]+'%'};return _0x514756;}})});}_0x1c9f4f=_[_0x29ec('0x41')]({},_0x1c9f4f,_0x330a3f[_0x29ec('0x42')]);var _0x4f971d={'where':_0x1c9f4f[_0x29ec('0x3f')]};return db[_0x29ec('0x2e')]['count'](_0x4f971d)[_0x29ec('0x27')](function(_0x2d1958){_0x3ab6b9[_0x29ec('0x1e')]=_0x2d1958;if(_0x330a3f[_0x29ec('0x33')]['includeAll']){_0x1c9f4f[_0x29ec('0x43')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x1c9f4f);})[_0x29ec('0x27')](function(_0x5aff2f){_0x3ab6b9[_0x29ec('0x44')]=_0x5aff2f;return _0x3ab6b9;})[_0x29ec('0x27')](respondWithFilteredResult(_0x50a391,_0x1c9f4f))[_0x29ec('0x45')](handleError(_0x50a391,null));};exports['show']=function(_0x21e7bf,_0x189f5c){var _0x47d3e9={'raw':!![],'where':{'id':_0x21e7bf[_0x29ec('0x46')]['id']}},_0x16c05e={};_0x16c05e[_0x29ec('0x32')]=_[_0x29ec('0x34')](db[_0x29ec('0x2e')]['rawAttributes']);_0x16c05e[_0x29ec('0x33')]=_[_0x29ec('0x34')](_0x21e7bf[_0x29ec('0x33')]);_0x16c05e[_0x29ec('0x35')]=_[_0x29ec('0x36')](_0x16c05e[_0x29ec('0x32')],_0x16c05e[_0x29ec('0x33')]);_0x47d3e9[_0x29ec('0x37')]=_[_0x29ec('0x36')](_0x16c05e[_0x29ec('0x32')],qs[_0x29ec('0x38')](_0x21e7bf[_0x29ec('0x33')]['fields']));_0x47d3e9[_0x29ec('0x37')]=_0x47d3e9[_0x29ec('0x37')][_0x29ec('0x39')]?_0x47d3e9[_0x29ec('0x37')]:_0x16c05e[_0x29ec('0x32')];if(_0x21e7bf[_0x29ec('0x33')][_0x29ec('0x47')]){_0x47d3e9['include']=[{'all':!![]}];}_0x47d3e9=_['merge']({},_0x47d3e9,_0x21e7bf[_0x29ec('0x42')]);return db[_0x29ec('0x2e')][_0x29ec('0x48')](_0x47d3e9)[_0x29ec('0x27')](handleEntityNotFound(_0x189f5c,null))[_0x29ec('0x27')](respondWithResult(_0x189f5c,null))[_0x29ec('0x45')](handleError(_0x189f5c,null));};exports[_0x29ec('0x49')]=function(_0x59e887,_0x528499,_0x5784f0){return db['Sound'][_0x29ec('0x48')]({'where':{'id':_0x59e887[_0x29ec('0x46')]['id']},'attributes':['name',_0x29ec('0x4a'),_0x29ec('0x4b')],'raw':!![]})[_0x29ec('0x27')](handleEntityNotFound(_0x528499,null))[_0x29ec('0x27')](function(_0x45ef67){if(_0x45ef67){if(!fs[_0x29ec('0x4c')](path[_0x29ec('0x4d')](config[_0x29ec('0x4e')],_0x29ec('0x4f'),_0x45ef67[_0x29ec('0x4a')]+'.'+_0x45ef67[_0x29ec('0x4b')]))){throw new db[(_0x29ec('0x50'))][(_0x29ec('0x51'))](_0x29ec('0x52'));}return _0x528499[_0x29ec('0x49')](path[_0x29ec('0x4d')](config[_0x29ec('0x4e')],'server/files/sounds/converted',util[_0x29ec('0x53')]('%s.%s',_0x45ef67[_0x29ec('0x4a')],_0x45ef67['converted_format'])),util[_0x29ec('0x53')](_0x29ec('0x54'),_0x45ef67[_0x29ec('0x2a')],_0x45ef67[_0x29ec('0x4b')]));}return null;})[_0x29ec('0x45')](handleError(_0x528499,null));};exports[_0x29ec('0x55')]=function(_0x5b3ec4,_0xf12365,_0x2d8468){var _0x3e4def={'name':path[_0x29ec('0x56')](_0x5b3ec4[_0x29ec('0x57')]['originalname'],path[_0x29ec('0x58')](_0x5b3ec4[_0x29ec('0x57')][_0x29ec('0x59')])),'save_name':path[_0x29ec('0x56')](_0x5b3ec4[_0x29ec('0x57')][_0x29ec('0x5a')],path[_0x29ec('0x58')](_0x5b3ec4[_0x29ec('0x57')][_0x29ec('0x5a')])),'original_format':path[_0x29ec('0x58')](_0x5b3ec4[_0x29ec('0x57')][_0x29ec('0x59')])['substring'](0x1),'converted_format':'wav'};var _0xf52353=path[_0x29ec('0x4d')](config[_0x29ec('0x4e')],_0x29ec('0x5b'),_0x5b3ec4[_0x29ec('0x57')][_0x29ec('0x5a')]);var _0x578368=path['join'](config[_0x29ec('0x4e')],_0x29ec('0x4f'),util[_0x29ec('0x53')](_0x29ec('0x54'),path[_0x29ec('0x56')](_0x5b3ec4[_0x29ec('0x57')]['filename'],path[_0x29ec('0x58')](_0x5b3ec4[_0x29ec('0x57')]['filename'])),_0x3e4def[_0x29ec('0x4b')]));logger[_0x29ec('0x5c')](_0x29ec('0x5d'),_0xf52353);logger[_0x29ec('0x5c')](_0x29ec('0x5e'),_0x578368);try{fs['chmodSync'](_0xf52353,parseInt(_0x29ec('0x5f'),0x8));var _0x5d2d09=sox[_0x29ec('0x60')](_0xf52353,_0x578368,{'sampleRate':0x1f40,'format':_0x29ec('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5d2d09['on']('error',function(_0x4d9f30){fs[_0x29ec('0x62')](_0xf52353);_0xf12365[_0x29ec('0x1a')](0x1f4)[_0x29ec('0x2b')](_0x4d9f30);});_0x5d2d09['on'](_0x29ec('0x63'),function(_0x4af05d){_0x3e4def['original_duration']=isNaN(_0x4af05d['duration'])?null:_0x4af05d[_0x29ec('0x64')]*0x3e8;_0x3e4def[_0x29ec('0x65')]=isNaN(_0x4af05d[_0x29ec('0x66')])?null:_0x4af05d[_0x29ec('0x66')];_0x3e4def[_0x29ec('0x67')]=isNaN(_0x4af05d[_0x29ec('0x68')])?null:_0x4af05d[_0x29ec('0x68')];_0x3e4def[_0x29ec('0x69')]=isNaN(_0x4af05d[_0x29ec('0x6a')])?null:_0x4af05d[_0x29ec('0x6a')];_0x3e4def['original_sampleRate']=isNaN(_0x4af05d['sampleRate'])?null:_0x4af05d[_0x29ec('0x6b')];});_0x5d2d09['on'](_0x29ec('0x6c'),function(_0x3f2f60){_0x3e4def[_0x29ec('0x6d')]=isNaN(_0x3f2f60[_0x29ec('0x64')])?null:_0x3f2f60[_0x29ec('0x64')]*0x3e8;_0x3e4def['converted_sampleCount']=isNaN(_0x3f2f60[_0x29ec('0x66')])?null:_0x3f2f60[_0x29ec('0x66')];_0x3e4def[_0x29ec('0x6e')]=isNaN(_0x3f2f60[_0x29ec('0x68')])?null:_0x3f2f60[_0x29ec('0x68')];_0x3e4def[_0x29ec('0x6f')]=isNaN(_0x3f2f60[_0x29ec('0x6a')])?null:_0x3f2f60[_0x29ec('0x6a')];_0x3e4def[_0x29ec('0x70')]=isNaN(_0x3f2f60[_0x29ec('0x6b')])?null:_0x3f2f60[_0x29ec('0x6b')];});_0x5d2d09['on'](_0x29ec('0x1b'),function(){fs['chmodSync'](_0x578368,parseInt('0777',0x8));return db[_0x29ec('0x2e')][_0x29ec('0x55')](_0x3e4def)[_0x29ec('0x27')](function(_0x4fcb2a){var _0x5e2d15={'role':_0x5b3ec4[_0x29ec('0x71')]['role'],'userProfileId':_0x5b3ec4[_0x29ec('0x71')][_0x29ec('0x72')]};if(!_0x5e2d15)throw new Error(_0x29ec('0x73'));if(_0x5e2d15[_0x29ec('0x74')]===_0x29ec('0x75')){var _0x3345e2=_0x4fcb2a[_0x29ec('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x29ec('0x48')]({'where':{'name':_0x29ec('0x76'),'userProfileId':_0x5e2d15['userProfileId']},'raw':!![]})[_0x29ec('0x27')](function(_0x4372c4){if(_0x4372c4&&_0x4372c4[_0x29ec('0x77')]===0x0){return db[_0x29ec('0x78')]['create']({'name':_0x3345e2['name'],'resourceId':_0x3345e2['id'],'type':_0x4372c4[_0x29ec('0x2a')],'sectionId':_0x4372c4['id']},{})[_0x29ec('0x27')](function(){return _0x4fcb2a;});}else{return _0x4fcb2a;}})[_0x29ec('0x45')](function(_0x20cdf0){logger[_0x29ec('0x28')](_0x29ec('0x79'),_0x20cdf0);throw _0x20cdf0;});}return _0x4fcb2a;})[_0x29ec('0x27')](respondWithResult(_0xf12365,null))[_0x29ec('0x45')](handleError(_0xf12365,null));});_0x5d2d09[_0x29ec('0x7a')]();}catch(_0x3146b7){_0xf12365[_0x29ec('0x1a')](0x1f4)['send'](_0x3146b7);}};exports[_0x29ec('0x24')]=function(_0x22d5a8,_0x3c2620,_0x3c3f91){return db[_0x29ec('0x2e')]['find']({'where':{'id':_0x22d5a8['params']['id']}})[_0x29ec('0x27')](handleEntityNotFound(_0x3c2620,null))[_0x29ec('0x27')](saveUpdates(_[_0x29ec('0x3d')](_0x22d5a8[_0x29ec('0x71')],[_0x29ec('0x2a'),_0x29ec('0x7b')]),null))[_0x29ec('0x27')](respondWithResult(_0x3c2620,null))[_0x29ec('0x45')](handleError(_0x3c2620,null));};exports[_0x29ec('0x7c')]=function(_0x5f49ef,_0x4e57b9,_0x250904){return db[_0x29ec('0x2e')][_0x29ec('0x48')]({'where':{'id':_0x5f49ef[_0x29ec('0x46')]['id']}})[_0x29ec('0x27')](function(_0x47462f){if(_0x47462f){return _0x47462f['destroy']();}})[_0x29ec('0x27')](function(_0x29c162){var _0x5dba3e=path[_0x29ec('0x4d')](config[_0x29ec('0x4e')],_0x29ec('0x5b'),util['format']('%s.%s',_0x29c162[_0x29ec('0x4a')],_0x29c162[_0x29ec('0x7d')]));var _0x129320=path['join'](config[_0x29ec('0x4e')],'server/files/sounds/converted',util[_0x29ec('0x53')]('%s.%s',_0x29c162[_0x29ec('0x4a')],_0x29c162[_0x29ec('0x4b')]));fs[_0x29ec('0x62')](_0x5dba3e);fs['unlinkSync'](_0x129320);return _0x29c162;})['then'](function(_0x2a7cd4){if(_0x2a7cd4){return _0x4e57b9[_0x29ec('0x1a')](0xcc)[_0x29ec('0x1b')]();}})[_0x29ec('0x27')](handleEntityNotFound(_0x4e57b9,null))[_0x29ec('0x45')](handleError(_0x4e57b9,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index db50efd..a9c33d6 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 _0x1b9b=['exports','Sound','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x35f2d6,_0x1eacc1){var _0x33a492=function(_0x3dccc5){while(--_0x3dccc5){_0x35f2d6['push'](_0x35f2d6['shift']());}};_0x33a492(++_0x1eacc1);}(_0x1b9b,0x1ee));var _0xb1b9=function(_0x589fde,_0x392dd4){_0x589fde=_0x589fde-0x0;var _0x3ebe58=_0x1b9b[_0x589fde];return _0x3ebe58;};'use strict';var _=require(_0xb1b9('0x0'));var util=require('util');var logger=require(_0xb1b9('0x1'))(_0xb1b9('0x2'));var moment=require(_0xb1b9('0x3'));var BPromise=require(_0xb1b9('0x4'));var rp=require(_0xb1b9('0x5'));var fs=require('fs');var path=require(_0xb1b9('0x6'));var rimraf=require(_0xb1b9('0x7'));var config=require(_0xb1b9('0x8'));var attributes=require(_0xb1b9('0x9'));module[_0xb1b9('0xa')]=function(_0x4c724b,_0x3cffd4){return _0x4c724b['define'](_0xb1b9('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd75b=['tools_sounds','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Sound'];(function(_0x579cce,_0x31b8d4){var _0x2ea60a=function(_0x1561a9){while(--_0x1561a9){_0x579cce['push'](_0x579cce['shift']());}};_0x2ea60a(++_0x31b8d4);}(_0xd75b,0xdd));var _0xbd75=function(_0xf51545,_0x48492d){_0xf51545=_0xf51545-0x0;var _0x28873e=_0xd75b[_0xf51545];return _0x28873e;};'use strict';var _=require(_0xbd75('0x0'));var util=require('util');var logger=require(_0xbd75('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbd75('0x2'));var rp=require(_0xbd75('0x3'));var fs=require('fs');var path=require(_0xbd75('0x4'));var rimraf=require(_0xbd75('0x5'));var config=require(_0xbd75('0x6'));var attributes=require('./sound.attributes');module[_0xbd75('0x7')]=function(_0x528a8c,_0x25a3d4){return _0x528a8c[_0xbd75('0x8')](_0xbd75('0x9'),attributes,{'tableName':_0xbd75('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 dba0b2b..65935b5 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 _0x3d17=['raw','where','attributes','include','map','model','then','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','Sound,\x20%s,\x20%s','error','message','result','ShowSound','Sound','options'];(function(_0x1d99c7,_0x3db474){var _0x3244d6=function(_0xc62ce7){while(--_0xc62ce7){_0x1d99c7['push'](_0x1d99c7['shift']());}};_0x3244d6(++_0x3db474);}(_0x3d17,0x100));var _0x73d1=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x3d17[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x73d1('0x0'));var util=require(_0x73d1('0x1'));var moment=require(_0x73d1('0x2'));var BPromise=require(_0x73d1('0x3'));var rs=require(_0x73d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73d1('0x5'))['db'];var utils=require(_0x73d1('0x6'));var logger=require(_0x73d1('0x7'))('rpc');var config=require(_0x73d1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x73d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaf17fa,_0x40f4ba,_0x5129c7){return new BPromise(function(_0x2c8be9,_0x68fce0){return client[_0x73d1('0xa')](_0xaf17fa,_0x5129c7)['then'](function(_0x1a76cf){logger[_0x73d1('0xb')]('Sound,\x20%s,\x20%s',_0x40f4ba,_0x73d1('0xc'));logger[_0x73d1('0xd')](_0x73d1('0xe'),_0x40f4ba,_0x73d1('0xc'),JSON[_0x73d1('0xf')](_0x1a76cf));if(_0x1a76cf['error']){if(_0x1a76cf['error']['code']===0x1f4){logger['error'](_0x73d1('0x10'),_0x40f4ba,_0x1a76cf[_0x73d1('0x11')][_0x73d1('0x12')]);return _0x68fce0(_0x1a76cf['error']['message']);}logger['error'](_0x73d1('0x10'),_0x40f4ba,_0x1a76cf[_0x73d1('0x11')][_0x73d1('0x12')]);return _0x2c8be9(_0x1a76cf[_0x73d1('0x11')][_0x73d1('0x12')]);}else{logger['info'](_0x73d1('0x10'),_0x40f4ba,_0x73d1('0xc'));_0x2c8be9(_0x1a76cf[_0x73d1('0x13')][_0x73d1('0x12')]);}})['catch'](function(_0x184c6f){logger['error'](_0x73d1('0x10'),_0x40f4ba,_0x184c6f);_0x68fce0(_0x184c6f);});});}exports[_0x73d1('0x14')]=function(_0x28dc50){var _0x368a6b=this;return new Promise(function(_0x402b4e,_0x3bcd9a){return db[_0x73d1('0x15')]['find']({'raw':_0x28dc50[_0x73d1('0x16')]?_0x28dc50[_0x73d1('0x16')][_0x73d1('0x17')]===undefined?!![]:![]:!![],'where':_0x28dc50['options']?_0x28dc50['options'][_0x73d1('0x18')]||null:null,'attributes':_0x28dc50['options']?_0x28dc50['options'][_0x73d1('0x19')]||null:null,'include':_0x28dc50[_0x73d1('0x16')]?_0x28dc50[_0x73d1('0x16')][_0x73d1('0x1a')]?_[_0x73d1('0x1b')](_0x28dc50['options'][_0x73d1('0x1a')],function(_0x1dd27e){return{'model':db[_0x1dd27e[_0x73d1('0x1c')]],'as':_0x1dd27e['as'],'attributes':_0x1dd27e[_0x73d1('0x19')],'include':_0x1dd27e[_0x73d1('0x1a')]?_[_0x73d1('0x1b')](_0x1dd27e[_0x73d1('0x1a')],function(_0x87090f){return{'model':db[_0x87090f[_0x73d1('0x1c')]],'as':_0x87090f['as'],'attributes':_0x87090f[_0x73d1('0x19')],'include':_0x87090f[_0x73d1('0x1a')]?_['map'](_0x87090f[_0x73d1('0x1a')],function(_0x4e107e){return{'model':db[_0x4e107e['model']],'as':_0x4e107e['as'],'attributes':_0x4e107e[_0x73d1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x73d1('0x1d')](function(_0x46bbfb){logger['info'](_0x73d1('0x14'),_0x28dc50);logger['debug'](_0x73d1('0x14'),_0x28dc50,JSON[_0x73d1('0xf')](_0x46bbfb));_0x402b4e(_0x46bbfb);})[_0x73d1('0x1e')](function(_0xd91b69){logger[_0x73d1('0x11')](_0x73d1('0x14'),_0xd91b69[_0x73d1('0x12')],_0x28dc50);_0x3bcd9a(_0x368a6b['error'](0x1f4,_0xd91b69[_0x73d1('0x12')]));});});}; \ No newline at end of file +var _0xb547=['stringify','error','code','message','result','catch','Sound','find','options','where','attributes','include','map','model','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0xb547,0x1d6));var _0x7b54=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0xb547[_0x574ce3];return _0x3447a0;};'use strict';var _=require(_0x7b54('0x0'));var util=require(_0x7b54('0x1'));var moment=require(_0x7b54('0x2'));var BPromise=require(_0x7b54('0x3'));var rs=require(_0x7b54('0x4'));var fs=require('fs');var Redis=require(_0x7b54('0x5'));var db=require(_0x7b54('0x6'))['db'];var utils=require(_0x7b54('0x7'));var logger=require(_0x7b54('0x8'))(_0x7b54('0x9'));var config=require('../../config/environment');var jayson=require(_0x7b54('0xa'));var client=jayson[_0x7b54('0xb')][_0x7b54('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cc07,_0x2c9d44,_0x45d833){return new BPromise(function(_0x1ea97d,_0x157e76){return client[_0x7b54('0xd')](_0x14cc07,_0x45d833)[_0x7b54('0xe')](function(_0x130c05){logger[_0x7b54('0xf')](_0x7b54('0x10'),_0x2c9d44,_0x7b54('0x11'));logger[_0x7b54('0x12')](_0x7b54('0x13'),_0x2c9d44,_0x7b54('0x11'),JSON[_0x7b54('0x14')](_0x130c05));if(_0x130c05[_0x7b54('0x15')]){if(_0x130c05['error'][_0x7b54('0x16')]===0x1f4){logger[_0x7b54('0x15')](_0x7b54('0x10'),_0x2c9d44,_0x130c05[_0x7b54('0x15')][_0x7b54('0x17')]);return _0x157e76(_0x130c05['error'][_0x7b54('0x17')]);}logger[_0x7b54('0x15')](_0x7b54('0x10'),_0x2c9d44,_0x130c05['error'][_0x7b54('0x17')]);return _0x1ea97d(_0x130c05[_0x7b54('0x15')][_0x7b54('0x17')]);}else{logger[_0x7b54('0xf')](_0x7b54('0x10'),_0x2c9d44,_0x7b54('0x11'));_0x1ea97d(_0x130c05[_0x7b54('0x18')][_0x7b54('0x17')]);}})[_0x7b54('0x19')](function(_0x4f6fe7){logger['error'](_0x7b54('0x10'),_0x2c9d44,_0x4f6fe7);_0x157e76(_0x4f6fe7);});});}exports['ShowSound']=function(_0x1b9a0e){var _0x441796=this;return new Promise(function(_0x499ba0,_0x36a3ef){return db[_0x7b54('0x1a')][_0x7b54('0x1b')]({'raw':_0x1b9a0e[_0x7b54('0x1c')]?_0x1b9a0e[_0x7b54('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1b9a0e[_0x7b54('0x1c')]?_0x1b9a0e['options'][_0x7b54('0x1d')]||null:null,'attributes':_0x1b9a0e[_0x7b54('0x1c')]?_0x1b9a0e[_0x7b54('0x1c')][_0x7b54('0x1e')]||null:null,'include':_0x1b9a0e[_0x7b54('0x1c')]?_0x1b9a0e[_0x7b54('0x1c')][_0x7b54('0x1f')]?_[_0x7b54('0x20')](_0x1b9a0e[_0x7b54('0x1c')][_0x7b54('0x1f')],function(_0x4ea8be){return{'model':db[_0x4ea8be['model']],'as':_0x4ea8be['as'],'attributes':_0x4ea8be[_0x7b54('0x1e')],'include':_0x4ea8be[_0x7b54('0x1f')]?_['map'](_0x4ea8be['include'],function(_0x2f28a3){return{'model':db[_0x2f28a3['model']],'as':_0x2f28a3['as'],'attributes':_0x2f28a3['attributes'],'include':_0x2f28a3[_0x7b54('0x1f')]?_[_0x7b54('0x20')](_0x2f28a3[_0x7b54('0x1f')],function(_0x59020b){return{'model':db[_0x59020b[_0x7b54('0x21')]],'as':_0x59020b['as'],'attributes':_0x59020b[_0x7b54('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7b54('0xe')](function(_0x3f9041){logger['info'](_0x7b54('0x22'),_0x1b9a0e);logger['debug'](_0x7b54('0x22'),_0x1b9a0e,JSON['stringify'](_0x3f9041));_0x499ba0(_0x3f9041);})[_0x7b54('0x19')](function(_0x1cc95e){logger[_0x7b54('0x15')](_0x7b54('0x22'),_0x1cc95e[_0x7b54('0x17')],_0x1b9a0e);_0x36a3ef(_0x441796[_0x7b54('0x15')](0x1f4,_0x1cc95e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 85b0b5d..8a139c7 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xcb837a,_0x2fc04d){_0xcb837a=_0xcb837a-0x0;var _0xc30584=_0x9ffd[_0xcb837a];return _0xc30584;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x2a8da5,_0x274ea2){var _0x1c428d=function(_0x3b43b2){while(--_0x3b43b2){_0x2a8da5['push'](_0x2a8da5['shift']());}};_0x1c428d(++_0x274ea2);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 0e645ca..90e084d 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 _0xf989=['ENUM','out','sequelize','exports','STRING','medium'];(function(_0x10a283,_0x4ba943){var _0x188d40=function(_0x3e6d30){while(--_0x3e6d30){_0x10a283['push'](_0x10a283['shift']());}};_0x188d40(++_0x4ba943);}(_0xf989,0x10a));var _0x9f98=function(_0x375126,_0x514a8e){_0x375126=_0x375126-0x0;var _0x1f76bb=_0xf989[_0x375126];return _0x1f76bb;};'use strict';var Sequelize=require(_0x9f98('0x0'));module[_0x9f98('0x1')]={'uniqueid':{'type':Sequelize[_0x9f98('0x2')]},'body':{'type':Sequelize['TEXT'](_0x9f98('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9f98('0x4')]('in',_0x9f98('0x5')),'defaultValue':_0x9f98('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9f98('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4eb1=['ENUM','sequelize','TEXT'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x4eb1,0x1db));var _0x14eb=function(_0x5e2789,_0x3a77f0){_0x5e2789=_0x5e2789-0x0;var _0x1ae280=_0x4eb1[_0x5e2789];return _0x1ae280;};'use strict';var Sequelize=require(_0x14eb('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x14eb('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x14eb('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x14eb('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 2628f5d..6bd9295 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 _0xeda7=['name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','SquareMessage','includeAll','findAll','rows','catch','params','find','create','body','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','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xeda7,0x196));var _0x7eda=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xeda7[_0x53abe5];return _0xc1c37e;};'use strict';var emlformat=require(_0x7eda('0x0'));var rimraf=require(_0x7eda('0x1'));var zipdir=require(_0x7eda('0x2'));var jsonpatch=require(_0x7eda('0x3'));var rp=require(_0x7eda('0x4'));var moment=require(_0x7eda('0x5'));var BPromise=require(_0x7eda('0x6'));var Mustache=require(_0x7eda('0x7'));var util=require(_0x7eda('0x8'));var path=require(_0x7eda('0x9'));var sox=require(_0x7eda('0xa'));var csv=require(_0x7eda('0xb'));var ejs=require(_0x7eda('0xc'));var fs=require('fs');var fs_extra=require(_0x7eda('0xd'));var _=require(_0x7eda('0xe'));var squel=require(_0x7eda('0xf'));var crypto=require(_0x7eda('0x10'));var jsforce=require(_0x7eda('0x11'));var deskjs=require(_0x7eda('0x12'));var toCsv=require(_0x7eda('0xb'));var querystring=require('querystring');var Papa=require(_0x7eda('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7eda('0x14'));var as=require(_0x7eda('0x15'));var hardwareService=require(_0x7eda('0x16'));var logger=require(_0x7eda('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x7eda('0x18'));var licenseUtil=require(_0x7eda('0x19'));var db=require(_0x7eda('0x1a'))['db'];function respondWithStatusCode(_0x165fce,_0x5cd373){_0x5cd373=_0x5cd373||0xcc;return function(_0x1e7404){if(_0x1e7404){return _0x165fce['sendStatus'](_0x5cd373);}return _0x165fce[_0x7eda('0x1b')](_0x5cd373)[_0x7eda('0x1c')]();};}function respondWithResult(_0x1353e7,_0x145c81){_0x145c81=_0x145c81||0xc8;return function(_0x3de1be){if(_0x3de1be){return _0x1353e7[_0x7eda('0x1b')](_0x145c81)[_0x7eda('0x1d')](_0x3de1be);}};}function respondWithFilteredResult(_0x237d47,_0x6eaeeb){return function(_0x4a8fa2){if(_0x4a8fa2){var _0x4d13db=typeof _0x6eaeeb[_0x7eda('0x1e')]==='undefined'&&typeof _0x6eaeeb['limit']===_0x7eda('0x1f');var _0x44c83e=_0x4a8fa2[_0x7eda('0x20')];var _0x8a1a07=_0x4d13db?0x0:_0x6eaeeb[_0x7eda('0x1e')];var _0x4c8420=_0x4d13db?_0x4a8fa2['count']:_0x6eaeeb['offset']+_0x6eaeeb[_0x7eda('0x21')];var _0x558ecb;if(_0x4c8420>=_0x44c83e){_0x4c8420=_0x44c83e;_0x558ecb=0xc8;}else{_0x558ecb=0xce;}_0x237d47[_0x7eda('0x1b')](_0x558ecb);return _0x237d47[_0x7eda('0x22')](_0x7eda('0x23'),_0x8a1a07+'-'+_0x4c8420+'/'+_0x44c83e)[_0x7eda('0x1d')](_0x4a8fa2);}return null;};}function patchUpdates(_0x51443d){return function(_0x11158){try{jsonpatch[_0x7eda('0x24')](_0x11158,_0x51443d,!![]);}catch(_0x3d73ce){return BPromise[_0x7eda('0x25')](_0x3d73ce);}return _0x11158['save']();};}function saveUpdates(_0x5f0965,_0x1dddc1){return function(_0x58c409){if(_0x58c409){return _0x58c409[_0x7eda('0x26')](_0x5f0965)[_0x7eda('0x27')](function(_0x557fec){return _0x557fec;});}return null;};}function removeEntity(_0x2a62e7,_0x1519ee){return function(_0x1c064d){if(_0x1c064d){return _0x1c064d[_0x7eda('0x28')]()[_0x7eda('0x27')](function(){_0x2a62e7['status'](0xcc)[_0x7eda('0x1c')]();});}};}function handleEntityNotFound(_0x2ca61d,_0x1a4950){return function(_0x5ae8ff){if(!_0x5ae8ff){_0x2ca61d[_0x7eda('0x29')](0x194);}return _0x5ae8ff;};}function handleError(_0xd23184,_0xefbea1){_0xefbea1=_0xefbea1||0x1f4;return function(_0x76f1b2){logger[_0x7eda('0x2a')](_0x76f1b2[_0x7eda('0x2b')]);if(_0x76f1b2[_0x7eda('0x2c')]){delete _0x76f1b2[_0x7eda('0x2c')];}_0xd23184[_0x7eda('0x1b')](_0xefbea1)[_0x7eda('0x2d')](_0x76f1b2);};}exports['index']=function(_0x3a77f6,_0x3e1a08){var _0x300e20={},_0x2c5af0={},_0x5661fe={'count':0x0,'rows':[]};var _0x28aa9f=_[_0x7eda('0x2e')](db['SquareMessage'][_0x7eda('0x2f')],function(_0x4655a9){return{'name':_0x4655a9['fieldName'],'type':_0x4655a9[_0x7eda('0x30')][_0x7eda('0x31')]};});_0x2c5af0[_0x7eda('0x32')]=_[_0x7eda('0x2e')](_0x28aa9f,_0x7eda('0x2c'));_0x2c5af0[_0x7eda('0x33')]=_[_0x7eda('0x34')](_0x3a77f6[_0x7eda('0x33')]);_0x2c5af0[_0x7eda('0x35')]=_[_0x7eda('0x36')](_0x2c5af0['model'],_0x2c5af0[_0x7eda('0x33')]);_0x300e20['attributes']=_[_0x7eda('0x36')](_0x2c5af0[_0x7eda('0x32')],qs[_0x7eda('0x37')](_0x3a77f6[_0x7eda('0x33')]['fields']));_0x300e20[_0x7eda('0x38')]=_0x300e20[_0x7eda('0x38')][_0x7eda('0x39')]?_0x300e20['attributes']:_0x2c5af0[_0x7eda('0x32')];if(!_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3a')]('nolimit')){_0x300e20[_0x7eda('0x21')]=qs[_0x7eda('0x21')](_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x21')]);_0x300e20['offset']=qs[_0x7eda('0x1e')](_0x3a77f6[_0x7eda('0x33')]['offset']);}_0x300e20[_0x7eda('0x3b')]=qs[_0x7eda('0x3c')](_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3c')]);_0x300e20['where']=qs[_0x7eda('0x35')](_[_0x7eda('0x3d')](_0x3a77f6['query'],_0x2c5af0['filters']),_0x28aa9f);if(_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3e')]){_0x300e20['where']=_[_0x7eda('0x3f')](_0x300e20[_0x7eda('0x40')],{'$or':_[_0x7eda('0x2e')](_0x28aa9f,function(_0x1f879c){if(_0x1f879c['type']!=='VIRTUAL'){var _0x3b78d7={};_0x3b78d7[_0x1f879c[_0x7eda('0x2c')]]={'$like':'%'+_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3e')]+'%'};return _0x3b78d7;}})});}_0x300e20=_['merge']({},_0x300e20,_0x3a77f6[_0x7eda('0x41')]);var _0xcf604d={'where':_0x300e20[_0x7eda('0x40')]};return db[_0x7eda('0x42')][_0x7eda('0x20')](_0xcf604d)[_0x7eda('0x27')](function(_0x478a92){_0x5661fe[_0x7eda('0x20')]=_0x478a92;if(_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x43')]){_0x300e20['include']=[{'all':!![]}];}return db[_0x7eda('0x42')][_0x7eda('0x44')](_0x300e20);})[_0x7eda('0x27')](function(_0x317d94){_0x5661fe[_0x7eda('0x45')]=_0x317d94;return _0x5661fe;})[_0x7eda('0x27')](respondWithFilteredResult(_0x3e1a08,_0x300e20))[_0x7eda('0x46')](handleError(_0x3e1a08,null));};exports['show']=function(_0x4b4d37,_0x85f223){var _0xa45a33={'raw':!![],'where':{'id':_0x4b4d37[_0x7eda('0x47')]['id']}},_0x425a16={};_0x425a16[_0x7eda('0x32')]=_[_0x7eda('0x34')](db[_0x7eda('0x42')][_0x7eda('0x2f')]);_0x425a16[_0x7eda('0x33')]=_[_0x7eda('0x34')](_0x4b4d37[_0x7eda('0x33')]);_0x425a16[_0x7eda('0x35')]=_[_0x7eda('0x36')](_0x425a16[_0x7eda('0x32')],_0x425a16['query']);_0xa45a33[_0x7eda('0x38')]=_[_0x7eda('0x36')](_0x425a16[_0x7eda('0x32')],qs['fields'](_0x4b4d37[_0x7eda('0x33')]['fields']));_0xa45a33[_0x7eda('0x38')]=_0xa45a33[_0x7eda('0x38')][_0x7eda('0x39')]?_0xa45a33[_0x7eda('0x38')]:_0x425a16['model'];if(_0x4b4d37[_0x7eda('0x33')][_0x7eda('0x43')]){_0xa45a33['include']=[{'all':!![]}];}_0xa45a33=_[_0x7eda('0x3f')]({},_0xa45a33,_0x4b4d37['options']);return db[_0x7eda('0x42')][_0x7eda('0x48')](_0xa45a33)[_0x7eda('0x27')](handleEntityNotFound(_0x85f223,null))[_0x7eda('0x27')](respondWithResult(_0x85f223,null))['catch'](handleError(_0x85f223,null));};exports['create']=function(_0x306fc5,_0x250287){return db[_0x7eda('0x42')][_0x7eda('0x49')](_0x306fc5[_0x7eda('0x4a')],{})[_0x7eda('0x27')](respondWithResult(_0x250287,0xc9))[_0x7eda('0x46')](handleError(_0x250287,null));};exports[_0x7eda('0x26')]=function(_0x18d08d,_0x1d2145){if(_0x18d08d[_0x7eda('0x4a')]['id']){delete _0x18d08d['body']['id'];}return db[_0x7eda('0x42')][_0x7eda('0x48')]({'where':{'id':_0x18d08d[_0x7eda('0x47')]['id']}})[_0x7eda('0x27')](handleEntityNotFound(_0x1d2145,null))[_0x7eda('0x27')](saveUpdates(_0x18d08d[_0x7eda('0x4a')],null))['then'](respondWithResult(_0x1d2145,null))[_0x7eda('0x46')](handleError(_0x1d2145,null));};exports[_0x7eda('0x28')]=function(_0x5bdab6,_0x47530d){return db[_0x7eda('0x42')][_0x7eda('0x48')]({'where':{'id':_0x5bdab6['params']['id']}})[_0x7eda('0x27')](handleEntityNotFound(_0x47530d,null))['then'](removeEntity(_0x47530d,null))[_0x7eda('0x46')](handleError(_0x47530d,null));}; \ No newline at end of file +var _0x62fc=['params','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','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','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0x62fc,0x9d));var _0xc62f=function(_0x2e7c1e,_0x50db97){_0x2e7c1e=_0x2e7c1e-0x0;var _0x17c692=_0x62fc[_0x2e7c1e];return _0x17c692;};'use strict';var emlformat=require(_0xc62f('0x0'));var rimraf=require(_0xc62f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc62f('0x2'));var rp=require(_0xc62f('0x3'));var moment=require(_0xc62f('0x4'));var BPromise=require(_0xc62f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc62f('0x6'));var csv=require(_0xc62f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc62f('0x8'));var squel=require(_0xc62f('0x9'));var crypto=require(_0xc62f('0xa'));var jsforce=require(_0xc62f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc62f('0xc'));var Papa=require(_0xc62f('0xd'));var Redis=require(_0xc62f('0xe'));var authService=require(_0xc62f('0xf'));var qs=require(_0xc62f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc62f('0x11'));var logger=require(_0xc62f('0x12'))(_0xc62f('0x13'));var utils=require(_0xc62f('0x14'));var config=require(_0xc62f('0x15'));var licenseUtil=require(_0xc62f('0x16'));var db=require(_0xc62f('0x17'))['db'];function respondWithStatusCode(_0x28c9b3,_0x28a71e){_0x28a71e=_0x28a71e||0xcc;return function(_0x11c651){if(_0x11c651){return _0x28c9b3['sendStatus'](_0x28a71e);}return _0x28c9b3['status'](_0x28a71e)['end']();};}function respondWithResult(_0x4a7021,_0x4b84f2){_0x4b84f2=_0x4b84f2||0xc8;return function(_0x499ba6){if(_0x499ba6){return _0x4a7021['status'](_0x4b84f2)[_0xc62f('0x18')](_0x499ba6);}};}function respondWithFilteredResult(_0x1edbfa,_0x1e2cb6){return function(_0x3c89dc){if(_0x3c89dc){var _0x4072e8=typeof _0x1e2cb6[_0xc62f('0x19')]===_0xc62f('0x1a')&&typeof _0x1e2cb6[_0xc62f('0x1b')]===_0xc62f('0x1a');var _0x1ea643=_0x3c89dc[_0xc62f('0x1c')];var _0x4733fd=_0x4072e8?0x0:_0x1e2cb6[_0xc62f('0x19')];var _0x2849ed=_0x4072e8?_0x3c89dc[_0xc62f('0x1c')]:_0x1e2cb6[_0xc62f('0x19')]+_0x1e2cb6[_0xc62f('0x1b')];var _0x776000;if(_0x2849ed>=_0x1ea643){_0x2849ed=_0x1ea643;_0x776000=0xc8;}else{_0x776000=0xce;}_0x1edbfa[_0xc62f('0x1d')](_0x776000);return _0x1edbfa[_0xc62f('0x1e')](_0xc62f('0x1f'),_0x4733fd+'-'+_0x2849ed+'/'+_0x1ea643)[_0xc62f('0x18')](_0x3c89dc);}return null;};}function patchUpdates(_0x11e70b){return function(_0x4cb283){try{jsonpatch[_0xc62f('0x20')](_0x4cb283,_0x11e70b,!![]);}catch(_0xd9f3df){return BPromise[_0xc62f('0x21')](_0xd9f3df);}return _0x4cb283[_0xc62f('0x22')]();};}function saveUpdates(_0x1ab4d1,_0x4f9ec8){return function(_0x5d92a0){if(_0x5d92a0){return _0x5d92a0['update'](_0x1ab4d1)[_0xc62f('0x23')](function(_0x2c80fc){return _0x2c80fc;});}return null;};}function removeEntity(_0x3adf9e,_0x52545b){return function(_0x386cca){if(_0x386cca){return _0x386cca[_0xc62f('0x24')]()['then'](function(){_0x3adf9e[_0xc62f('0x1d')](0xcc)[_0xc62f('0x25')]();});}};}function handleEntityNotFound(_0x1a3d89,_0x16aa62){return function(_0x100a17){if(!_0x100a17){_0x1a3d89[_0xc62f('0x26')](0x194);}return _0x100a17;};}function handleError(_0x521bea,_0x4cbf91){_0x4cbf91=_0x4cbf91||0x1f4;return function(_0x4a95a3){logger[_0xc62f('0x27')](_0x4a95a3[_0xc62f('0x28')]);if(_0x4a95a3[_0xc62f('0x29')]){delete _0x4a95a3[_0xc62f('0x29')];}_0x521bea['status'](_0x4cbf91)['send'](_0x4a95a3);};}exports[_0xc62f('0x2a')]=function(_0x5a9c9c,_0x424514){var _0x417343={},_0x271402={},_0x3b5be6={'count':0x0,'rows':[]};var _0x23df4b=_['map'](db[_0xc62f('0x2b')][_0xc62f('0x2c')],function(_0x41dea2){return{'name':_0x41dea2[_0xc62f('0x2d')],'type':_0x41dea2[_0xc62f('0x2e')][_0xc62f('0x2f')]};});_0x271402[_0xc62f('0x30')]=_[_0xc62f('0x31')](_0x23df4b,_0xc62f('0x29'));_0x271402[_0xc62f('0x32')]=_[_0xc62f('0x33')](_0x5a9c9c[_0xc62f('0x32')]);_0x271402['filters']=_[_0xc62f('0x34')](_0x271402['model'],_0x271402[_0xc62f('0x32')]);_0x417343[_0xc62f('0x35')]=_['intersection'](_0x271402[_0xc62f('0x30')],qs[_0xc62f('0x36')](_0x5a9c9c[_0xc62f('0x32')][_0xc62f('0x36')]));_0x417343[_0xc62f('0x35')]=_0x417343['attributes'][_0xc62f('0x37')]?_0x417343['attributes']:_0x271402[_0xc62f('0x30')];if(!_0x5a9c9c[_0xc62f('0x32')][_0xc62f('0x38')](_0xc62f('0x39'))){_0x417343[_0xc62f('0x1b')]=qs[_0xc62f('0x1b')](_0x5a9c9c[_0xc62f('0x32')][_0xc62f('0x1b')]);_0x417343[_0xc62f('0x19')]=qs['offset'](_0x5a9c9c[_0xc62f('0x32')][_0xc62f('0x19')]);}_0x417343[_0xc62f('0x3a')]=qs[_0xc62f('0x3b')](_0x5a9c9c[_0xc62f('0x32')][_0xc62f('0x3b')]);_0x417343['where']=qs[_0xc62f('0x3c')](_[_0xc62f('0x3d')](_0x5a9c9c[_0xc62f('0x32')],_0x271402['filters']),_0x23df4b);if(_0x5a9c9c['query'][_0xc62f('0x3e')]){_0x417343[_0xc62f('0x3f')]=_[_0xc62f('0x40')](_0x417343['where'],{'$or':_[_0xc62f('0x31')](_0x23df4b,function(_0x49f00c){if(_0x49f00c['type']!==_0xc62f('0x41')){var _0xaf811e={};_0xaf811e[_0x49f00c[_0xc62f('0x29')]]={'$like':'%'+_0x5a9c9c['query'][_0xc62f('0x3e')]+'%'};return _0xaf811e;}})});}_0x417343=_[_0xc62f('0x40')]({},_0x417343,_0x5a9c9c[_0xc62f('0x42')]);var _0x2dea84={'where':_0x417343[_0xc62f('0x3f')]};return db[_0xc62f('0x2b')][_0xc62f('0x1c')](_0x2dea84)['then'](function(_0x5d09e7){_0x3b5be6[_0xc62f('0x1c')]=_0x5d09e7;if(_0x5a9c9c[_0xc62f('0x32')][_0xc62f('0x43')]){_0x417343[_0xc62f('0x44')]=[{'all':!![]}];}return db[_0xc62f('0x2b')]['findAll'](_0x417343);})[_0xc62f('0x23')](function(_0x52440e){_0x3b5be6['rows']=_0x52440e;return _0x3b5be6;})[_0xc62f('0x23')](respondWithFilteredResult(_0x424514,_0x417343))[_0xc62f('0x45')](handleError(_0x424514,null));};exports[_0xc62f('0x46')]=function(_0x4c82df,_0x3a6aab){var _0x3fd551={'raw':!![],'where':{'id':_0x4c82df[_0xc62f('0x47')]['id']}},_0x3b418a={};_0x3b418a['model']=_[_0xc62f('0x33')](db[_0xc62f('0x2b')][_0xc62f('0x2c')]);_0x3b418a[_0xc62f('0x32')]=_['keys'](_0x4c82df[_0xc62f('0x32')]);_0x3b418a[_0xc62f('0x3c')]=_[_0xc62f('0x34')](_0x3b418a['model'],_0x3b418a['query']);_0x3fd551[_0xc62f('0x35')]=_[_0xc62f('0x34')](_0x3b418a['model'],qs['fields'](_0x4c82df[_0xc62f('0x32')][_0xc62f('0x36')]));_0x3fd551['attributes']=_0x3fd551[_0xc62f('0x35')][_0xc62f('0x37')]?_0x3fd551[_0xc62f('0x35')]:_0x3b418a[_0xc62f('0x30')];if(_0x4c82df['query'][_0xc62f('0x43')]){_0x3fd551[_0xc62f('0x44')]=[{'all':!![]}];}_0x3fd551=_[_0xc62f('0x40')]({},_0x3fd551,_0x4c82df[_0xc62f('0x42')]);return db[_0xc62f('0x2b')][_0xc62f('0x48')](_0x3fd551)['then'](handleEntityNotFound(_0x3a6aab,null))['then'](respondWithResult(_0x3a6aab,null))['catch'](handleError(_0x3a6aab,null));};exports[_0xc62f('0x49')]=function(_0x5daa4c,_0x3d7d3e){return db['SquareMessage'][_0xc62f('0x49')](_0x5daa4c[_0xc62f('0x4a')],{})[_0xc62f('0x23')](respondWithResult(_0x3d7d3e,0xc9))[_0xc62f('0x45')](handleError(_0x3d7d3e,null));};exports[_0xc62f('0x4b')]=function(_0x1df199,_0x1aa2d0){if(_0x1df199[_0xc62f('0x4a')]['id']){delete _0x1df199[_0xc62f('0x4a')]['id'];}return db[_0xc62f('0x2b')][_0xc62f('0x48')]({'where':{'id':_0x1df199[_0xc62f('0x47')]['id']}})[_0xc62f('0x23')](handleEntityNotFound(_0x1aa2d0,null))[_0xc62f('0x23')](saveUpdates(_0x1df199[_0xc62f('0x4a')],null))[_0xc62f('0x23')](respondWithResult(_0x1aa2d0,null))[_0xc62f('0x45')](handleError(_0x1aa2d0,null));};exports[_0xc62f('0x24')]=function(_0x361b94,_0x102bd3){return db[_0xc62f('0x2b')][_0xc62f('0x48')]({'where':{'id':_0x361b94[_0xc62f('0x47')]['id']}})[_0xc62f('0x23')](handleEntityNotFound(_0x102bd3,null))['then'](removeEntity(_0x102bd3,null))[_0xc62f('0x45')](handleError(_0x102bd3,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 7a28c1c..cde115c 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 _0xa992=['exports','define','SquareMessage','square_messages','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x52677a,_0x49afea){var _0x578e13=function(_0x5074b0){while(--_0x5074b0){_0x52677a['push'](_0x52677a['shift']());}};_0x578e13(++_0x49afea);}(_0xa992,0x12d));var _0x2a99=function(_0x53cdb5,_0x2997f3){_0x53cdb5=_0x53cdb5-0x0;var _0x5b83ea=_0xa992[_0x53cdb5];return _0x5b83ea;};'use strict';var _=require('lodash');var util=require(_0x2a99('0x0'));var logger=require(_0x2a99('0x1'))(_0x2a99('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2a99('0x3'));var fs=require('fs');var path=require(_0x2a99('0x4'));var rimraf=require(_0x2a99('0x5'));var config=require(_0x2a99('0x6'));var attributes=require('./squareMessage.attributes');module[_0x2a99('0x7')]=function(_0x296550,_0x5d689a){return _0x296550[_0x2a99('0x8')](_0x2a99('0x9'),attributes,{'tableName':_0x2a99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21cc=['request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','api','moment','bluebird'];(function(_0x196775,_0x4bdad6){var _0xe4cb4a=function(_0x25b68e){while(--_0x25b68e){_0x196775['push'](_0x196775['shift']());}};_0xe4cb4a(++_0x4bdad6);}(_0x21cc,0x97));var _0xc21c=function(_0x2f9feb,_0xdf0240){_0x2f9feb=_0x2f9feb-0x0;var _0x58f2eb=_0x21cc[_0x2f9feb];return _0x58f2eb;};'use strict';var _=require(_0xc21c('0x0'));var util=require(_0xc21c('0x1'));var logger=require('../../config/logger')(_0xc21c('0x2'));var moment=require(_0xc21c('0x3'));var BPromise=require(_0xc21c('0x4'));var rp=require(_0xc21c('0x5'));var fs=require('fs');var path=require(_0xc21c('0x6'));var rimraf=require(_0xc21c('0x7'));var config=require(_0xc21c('0x8'));var attributes=require(_0xc21c('0x9'));module['exports']=function(_0xbdd824,_0x4dbac0){return _0xbdd824[_0xc21c('0xa')](_0xc21c('0xb'),attributes,{'tableName':_0xc21c('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 91c18c6..d6cfb8f 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 _0xba40=['result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','ioredis','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1cb594,_0x261ecf){var _0x51e013=function(_0x6d95d2){while(--_0x6d95d2){_0x1cb594['push'](_0x1cb594['shift']());}};_0x51e013(++_0x261ecf);}(_0xba40,0xc0));var _0x0ba4=function(_0x1d5411,_0x30966f){_0x1d5411=_0x1d5411-0x0;var _0x452932=_0xba40[_0x1d5411];return _0x452932;};'use strict';var _=require(_0x0ba4('0x0'));var util=require(_0x0ba4('0x1'));var moment=require(_0x0ba4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ba4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0ba4('0x4'));var client=jayson[_0x0ba4('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x451290,_0x19045d,_0x2cef37){return new BPromise(function(_0x5bd8bc,_0x4d225d){return client['request'](_0x451290,_0x2cef37)[_0x0ba4('0x6')](function(_0x378cb8){logger[_0x0ba4('0x7')](_0x0ba4('0x8'),_0x19045d,_0x0ba4('0x9'));logger[_0x0ba4('0xa')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x19045d,_0x0ba4('0x9'),JSON[_0x0ba4('0xb')](_0x378cb8));if(_0x378cb8['error']){if(_0x378cb8[_0x0ba4('0xc')][_0x0ba4('0xd')]===0x1f4){logger[_0x0ba4('0xc')](_0x0ba4('0x8'),_0x19045d,_0x378cb8[_0x0ba4('0xc')][_0x0ba4('0xe')]);return _0x4d225d(_0x378cb8['error'][_0x0ba4('0xe')]);}logger[_0x0ba4('0xc')](_0x0ba4('0x8'),_0x19045d,_0x378cb8[_0x0ba4('0xc')][_0x0ba4('0xe')]);return _0x5bd8bc(_0x378cb8[_0x0ba4('0xc')]['message']);}else{logger[_0x0ba4('0x7')]('SquareMessage,\x20%s,\x20%s',_0x19045d,_0x0ba4('0x9'));_0x5bd8bc(_0x378cb8[_0x0ba4('0xf')][_0x0ba4('0xe')]);}})[_0x0ba4('0x10')](function(_0x1de70a){logger[_0x0ba4('0xc')](_0x0ba4('0x8'),_0x19045d,_0x1de70a);_0x4d225d(_0x1de70a);});});}exports[_0x0ba4('0x11')]=function(_0x46730d){var _0x383609=this;return new Promise(function(_0x2b9d2c,_0x494abd){return db[_0x0ba4('0x12')][_0x0ba4('0x13')](_0x46730d[_0x0ba4('0x14')],{'raw':_0x46730d[_0x0ba4('0x15')]?_0x46730d[_0x0ba4('0x15')][_0x0ba4('0x16')]===undefined?!![]:![]:!![]})[_0x0ba4('0x6')](function(_0x5aa600){logger[_0x0ba4('0x7')]('CreateSquareMessage',_0x46730d);logger[_0x0ba4('0xa')](_0x0ba4('0x11'),_0x46730d,JSON['stringify'](_0x5aa600));_0x2b9d2c(_0x5aa600);})[_0x0ba4('0x10')](function(_0x5c8ca7){logger[_0x0ba4('0xc')](_0x0ba4('0x11'),_0x5c8ca7['message'],_0x46730d);_0x494abd(_0x383609[_0x0ba4('0xc')](0x1f4,_0x5c8ca7['message']));});});}; \ No newline at end of file +var _0xadd8=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x45d51f,_0x1b60e5){var _0x9afa32=function(_0x284dda){while(--_0x284dda){_0x45d51f['push'](_0x45d51f['shift']());}};_0x9afa32(++_0x1b60e5);}(_0xadd8,0x108));var _0x8add=function(_0x452561,_0x139b8c){_0x452561=_0x452561-0x0;var _0x527a9d=_0xadd8[_0x452561];return _0x527a9d;};'use strict';var _=require(_0x8add('0x0'));var util=require(_0x8add('0x1'));var moment=require(_0x8add('0x2'));var BPromise=require(_0x8add('0x3'));var rs=require(_0x8add('0x4'));var fs=require('fs');var Redis=require(_0x8add('0x5'));var db=require(_0x8add('0x6'))['db'];var utils=require(_0x8add('0x7'));var logger=require('../../config/logger')(_0x8add('0x8'));var config=require(_0x8add('0x9'));var jayson=require(_0x8add('0xa'));var client=jayson[_0x8add('0xb')][_0x8add('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34bb85,_0x1c1086,_0x4b83e9){return new BPromise(function(_0xebce39,_0x331759){return client['request'](_0x34bb85,_0x4b83e9)[_0x8add('0xd')](function(_0x10bc84){logger[_0x8add('0xe')](_0x8add('0xf'),_0x1c1086,_0x8add('0x10'));logger[_0x8add('0x11')](_0x8add('0x12'),_0x1c1086,_0x8add('0x10'),JSON['stringify'](_0x10bc84));if(_0x10bc84[_0x8add('0x13')]){if(_0x10bc84['error'][_0x8add('0x14')]===0x1f4){logger['error'](_0x8add('0xf'),_0x1c1086,_0x10bc84['error'][_0x8add('0x15')]);return _0x331759(_0x10bc84[_0x8add('0x13')]['message']);}logger['error'](_0x8add('0xf'),_0x1c1086,_0x10bc84[_0x8add('0x13')]['message']);return _0xebce39(_0x10bc84[_0x8add('0x13')][_0x8add('0x15')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x1c1086,_0x8add('0x10'));_0xebce39(_0x10bc84['result'][_0x8add('0x15')]);}})[_0x8add('0x16')](function(_0x261056){logger[_0x8add('0x13')](_0x8add('0xf'),_0x1c1086,_0x261056);_0x331759(_0x261056);});});}exports['CreateSquareMessage']=function(_0x532244){var _0x21dd76=this;return new Promise(function(_0x11dbf1,_0x57ebeb){return db[_0x8add('0x17')][_0x8add('0x18')](_0x532244[_0x8add('0x19')],{'raw':_0x532244[_0x8add('0x1a')]?_0x532244[_0x8add('0x1a')][_0x8add('0x1b')]===undefined?!![]:![]:!![]})[_0x8add('0xd')](function(_0x3c790c){logger[_0x8add('0xe')](_0x8add('0x1c'),_0x532244);logger[_0x8add('0x11')]('CreateSquareMessage',_0x532244,JSON[_0x8add('0x1d')](_0x3c790c));_0x11dbf1(_0x3c790c);})['catch'](function(_0x3eb53d){logger[_0x8add('0x13')]('CreateSquareMessage',_0x3eb53d[_0x8add('0x15')],_0x532244);_0x57ebeb(_0x21dd76[_0x8add('0x13')](0x1f4,_0x3eb53d[_0x8add('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 86fc13e..787d9c3 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 _0xe222=['/:id','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xe222,0xd1));var _0x2e22=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0xe222[_0x22ccc0];return _0xe2af6a;};'use strict';var multer=require(_0x2e22('0x0'));var util=require(_0x2e22('0x1'));var path=require(_0x2e22('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e22('0x3'));var router=express['Router']();var fs_extra=require(_0x2e22('0x4'));var auth=require(_0x2e22('0x5'));var interaction=require(_0x2e22('0x6'));var config=require(_0x2e22('0x7'));var controller=require('./squareOdbc.controller');router[_0x2e22('0x8')]('/',auth[_0x2e22('0x9')](),controller[_0x2e22('0xa')]);router[_0x2e22('0x8')](_0x2e22('0xb'),auth[_0x2e22('0x9')](),controller['show']);router[_0x2e22('0x8')](_0x2e22('0xc'),auth[_0x2e22('0x9')](),timeout(_0x2e22('0xd')),controller[_0x2e22('0xe')]);router[_0x2e22('0xf')]('/',auth['isAuthenticated'](),controller[_0x2e22('0x10')]);router[_0x2e22('0x11')]('/:id',auth[_0x2e22('0x9')](),controller[_0x2e22('0x12')]);router[_0x2e22('0x13')](_0x2e22('0xb'),auth[_0x2e22('0x9')](),controller[_0x2e22('0x14')]);module[_0x2e22('0x15')]=router; \ No newline at end of file +var _0x93b4=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/test','15s','test','post','create'];(function(_0x12c954,_0x100cff){var _0x270c4b=function(_0x376909){while(--_0x376909){_0x12c954['push'](_0x12c954['shift']());}};_0x270c4b(++_0x100cff);}(_0x93b4,0x194));var _0x493b=function(_0x2fed5b,_0x1a9633){_0x2fed5b=_0x2fed5b-0x0;var _0x39efef=_0x93b4[_0x2fed5b];return _0x39efef;};'use strict';var multer=require('multer');var util=require(_0x493b('0x0'));var path=require(_0x493b('0x1'));var timeout=require(_0x493b('0x2'));var express=require('express');var router=express[_0x493b('0x3')]();var fs_extra=require(_0x493b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x493b('0x5'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x493b('0x6')]('/',auth['isAuthenticated'](),controller[_0x493b('0x7')]);router['get'](_0x493b('0x8'),auth[_0x493b('0x9')](),controller[_0x493b('0xa')]);router['get'](_0x493b('0xb'),auth[_0x493b('0x9')](),timeout(_0x493b('0xc')),controller[_0x493b('0xd')]);router[_0x493b('0xe')]('/',auth[_0x493b('0x9')](),controller[_0x493b('0xf')]);router[_0x493b('0x10')](_0x493b('0x8'),auth['isAuthenticated'](),controller[_0x493b('0x11')]);router[_0x493b('0x12')]('/:id',auth[_0x493b('0x9')](),controller[_0x493b('0x13')]);module[_0x493b('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index f0a1b7f..953f92b 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 _0x79e8=['name','sequelize','exports','STRING'];(function(_0x3b762c,_0x35e9f3){var _0x248699=function(_0x146e76){while(--_0x146e76){_0x3b762c['push'](_0x3b762c['shift']());}};_0x248699(++_0x35e9f3);}(_0x79e8,0x145));var _0x879e=function(_0x5df6a1,_0x119f5b){_0x5df6a1=_0x5df6a1-0x0;var _0x4088d4=_0x79e8[_0x5df6a1];return _0x4088d4;};'use strict';var Sequelize=require(_0x879e('0x0'));module[_0x879e('0x1')]={'name':{'type':Sequelize[_0x879e('0x2')],'unique':_0x879e('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x879e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe9f6=['STRING','sequelize','exports'];(function(_0x573b31,_0x3a4974){var _0x3a53c5=function(_0x167f9a){while(--_0x167f9a){_0x573b31['push'](_0x573b31['shift']());}};_0x3a53c5(++_0x3a4974);}(_0xe9f6,0xd9));var _0x6e9f=function(_0x2d5f95,_0x152469){_0x2d5f95=_0x2d5f95-0x0;var _0x28b7fa=_0xe9f6[_0x2d5f95];return _0x28b7fa;};'use strict';var Sequelize=require(_0x6e9f('0x0'));module[_0x6e9f('0x1')]={'name':{'type':Sequelize[_0x6e9f('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e9f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 54ae49a..767ae86 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 _0x9a01=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','end','error','stack','name','send','index','SquareOdbc','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','role','user','ODBC','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','openSync','eml-format','rimraf','zip-dir','moment','util','path','sox'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x9a01,0x14d));var _0x19a0=function(_0x129db6,_0xb7341c){_0x129db6=_0x129db6-0x0;var _0x1bb919=_0x9a01[_0x129db6];return _0x1bb919;};'use strict';var emlformat=require(_0x19a0('0x0'));var rimraf=require(_0x19a0('0x1'));var zipdir=require(_0x19a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x19a0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x19a0('0x4'));var path=require(_0x19a0('0x5'));var sox=require(_0x19a0('0x6'));var csv=require('to-csv');var ejs=require(_0x19a0('0x7'));var fs=require('fs');var fs_extra=require(_0x19a0('0x8'));var _=require(_0x19a0('0x9'));var squel=require(_0x19a0('0xa'));var crypto=require(_0x19a0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x19a0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x19a0('0xd'));var Papa=require(_0x19a0('0xe'));var Redis=require(_0x19a0('0xf'));var authService=require(_0x19a0('0x10'));var qs=require(_0x19a0('0x11'));var as=require(_0x19a0('0x12'));var hardwareService=require(_0x19a0('0x13'));var logger=require(_0x19a0('0x14'))(_0x19a0('0x15'));var utils=require('../../config/utils');var config=require(_0x19a0('0x16'));var licenseUtil=require(_0x19a0('0x17'));var db=require(_0x19a0('0x18'))['db'];function respondWithStatusCode(_0x1794b5,_0x49e07c){_0x49e07c=_0x49e07c||0xcc;return function(_0x4e7c14){if(_0x4e7c14){return _0x1794b5[_0x19a0('0x19')](_0x49e07c);}return _0x1794b5[_0x19a0('0x1a')](_0x49e07c)['end']();};}function respondWithResult(_0x47f470,_0x302c65){_0x302c65=_0x302c65||0xc8;return function(_0x4b85fb){if(_0x4b85fb){return _0x47f470[_0x19a0('0x1a')](_0x302c65)[_0x19a0('0x1b')](_0x4b85fb);}};}function respondWithFilteredResult(_0x30282b,_0x55823a){return function(_0x180cb8){if(_0x180cb8){var _0x14752f=typeof _0x55823a[_0x19a0('0x1c')]===_0x19a0('0x1d')&&typeof _0x55823a[_0x19a0('0x1e')]===_0x19a0('0x1d');var _0x503337=_0x180cb8[_0x19a0('0x1f')];var _0x29ae84=_0x14752f?0x0:_0x55823a[_0x19a0('0x1c')];var _0x595d51=_0x14752f?_0x180cb8['count']:_0x55823a['offset']+_0x55823a['limit'];var _0x5243b4;if(_0x595d51>=_0x503337){_0x595d51=_0x503337;_0x5243b4=0xc8;}else{_0x5243b4=0xce;}_0x30282b[_0x19a0('0x1a')](_0x5243b4);return _0x30282b[_0x19a0('0x20')](_0x19a0('0x21'),_0x29ae84+'-'+_0x595d51+'/'+_0x503337)[_0x19a0('0x1b')](_0x180cb8);}return null;};}function patchUpdates(_0x3307e9){return function(_0x517c1f){try{jsonpatch['apply'](_0x517c1f,_0x3307e9,!![]);}catch(_0x28d9fc){return BPromise['reject'](_0x28d9fc);}return _0x517c1f[_0x19a0('0x22')]();};}function saveUpdates(_0xff8d1d,_0x1489c7){return function(_0x51600f){if(_0x51600f){return _0x51600f[_0x19a0('0x23')](_0xff8d1d)['then'](function(_0x2c0960){return _0x2c0960;});}return null;};}function removeEntity(_0x3e2db7,_0x36383d){return function(_0x467fa8){if(_0x467fa8){return _0x467fa8[_0x19a0('0x24')]()[_0x19a0('0x25')](function(){var _0x258a3f=_0x467fa8['get']({'plain':!![]});var _0x4e4cb='ODBC';return db['UserProfileResource']['destroy']({'where':{'type':_0x4e4cb,'resourceId':_0x258a3f['id']}})[_0x19a0('0x25')](function(){return _0x467fa8;});})[_0x19a0('0x25')](function(){_0x3e2db7[_0x19a0('0x1a')](0xcc)[_0x19a0('0x26')]();});}};}function handleEntityNotFound(_0x3047ad,_0x89343){return function(_0x81f65c){if(!_0x81f65c){_0x3047ad[_0x19a0('0x19')](0x194);}return _0x81f65c;};}function handleError(_0x2832ca,_0x1d1dc5){_0x1d1dc5=_0x1d1dc5||0x1f4;return function(_0x8fa035){logger[_0x19a0('0x27')](_0x8fa035[_0x19a0('0x28')]);if(_0x8fa035['name']){delete _0x8fa035[_0x19a0('0x29')];}_0x2832ca['status'](_0x1d1dc5)[_0x19a0('0x2a')](_0x8fa035);};}exports[_0x19a0('0x2b')]=function(_0x84447b,_0x36fbb1){var _0x31bde2={},_0x5a6ac1={},_0x51dfbc={'count':0x0,'rows':[]};var _0x4c70ec=_['map'](db[_0x19a0('0x2c')]['rawAttributes'],function(_0x3879bb){return{'name':_0x3879bb[_0x19a0('0x2d')],'type':_0x3879bb[_0x19a0('0x2e')][_0x19a0('0x2f')]};});_0x5a6ac1[_0x19a0('0x30')]=_[_0x19a0('0x31')](_0x4c70ec,'name');_0x5a6ac1[_0x19a0('0x32')]=_[_0x19a0('0x33')](_0x84447b[_0x19a0('0x32')]);_0x5a6ac1[_0x19a0('0x34')]=_[_0x19a0('0x35')](_0x5a6ac1[_0x19a0('0x30')],_0x5a6ac1[_0x19a0('0x32')]);_0x31bde2['attributes']=_[_0x19a0('0x35')](_0x5a6ac1[_0x19a0('0x30')],qs['fields'](_0x84447b[_0x19a0('0x32')][_0x19a0('0x36')]));_0x31bde2[_0x19a0('0x37')]=_0x31bde2['attributes'][_0x19a0('0x38')]?_0x31bde2[_0x19a0('0x37')]:_0x5a6ac1[_0x19a0('0x30')];if(!_0x84447b[_0x19a0('0x32')][_0x19a0('0x39')](_0x19a0('0x3a'))){_0x31bde2[_0x19a0('0x1e')]=qs[_0x19a0('0x1e')](_0x84447b[_0x19a0('0x32')]['limit']);_0x31bde2[_0x19a0('0x1c')]=qs[_0x19a0('0x1c')](_0x84447b[_0x19a0('0x32')]['offset']);}_0x31bde2[_0x19a0('0x3b')]=qs['sort'](_0x84447b[_0x19a0('0x32')]['sort']);_0x31bde2[_0x19a0('0x3c')]=qs['filters'](_[_0x19a0('0x3d')](_0x84447b[_0x19a0('0x32')],_0x5a6ac1[_0x19a0('0x34')]),_0x4c70ec);if(_0x84447b[_0x19a0('0x32')][_0x19a0('0x3e')]){_0x31bde2['where']=_[_0x19a0('0x3f')](_0x31bde2[_0x19a0('0x3c')],{'$or':_[_0x19a0('0x31')](_0x4c70ec,function(_0x24c535){if(_0x24c535[_0x19a0('0x2e')]!==_0x19a0('0x40')){var _0x20731f={};_0x20731f[_0x24c535['name']]={'$like':'%'+_0x84447b['query'][_0x19a0('0x3e')]+'%'};return _0x20731f;}})});}_0x31bde2=_[_0x19a0('0x3f')]({},_0x31bde2,_0x84447b[_0x19a0('0x41')]);var _0x3c1a69={'where':_0x31bde2[_0x19a0('0x3c')]};return db[_0x19a0('0x2c')][_0x19a0('0x1f')](_0x3c1a69)[_0x19a0('0x25')](function(_0x280135){_0x51dfbc[_0x19a0('0x1f')]=_0x280135;if(_0x84447b['query'][_0x19a0('0x42')]){_0x31bde2[_0x19a0('0x43')]=[{'all':!![]}];}return db[_0x19a0('0x2c')]['findAll'](_0x31bde2);})[_0x19a0('0x25')](function(_0x56eadc){_0x51dfbc[_0x19a0('0x44')]=_0x56eadc;return _0x51dfbc;})[_0x19a0('0x25')](respondWithFilteredResult(_0x36fbb1,_0x31bde2))[_0x19a0('0x45')](handleError(_0x36fbb1,null));};exports[_0x19a0('0x46')]=function(_0x31bd38,_0x347fad){var _0x1cb7de={'raw':!![],'where':{'id':_0x31bd38[_0x19a0('0x47')]['id']}},_0x34cb69={};_0x34cb69[_0x19a0('0x30')]=_['keys'](db['SquareOdbc'][_0x19a0('0x48')]);_0x34cb69[_0x19a0('0x32')]=_[_0x19a0('0x33')](_0x31bd38[_0x19a0('0x32')]);_0x34cb69[_0x19a0('0x34')]=_['intersection'](_0x34cb69[_0x19a0('0x30')],_0x34cb69[_0x19a0('0x32')]);_0x1cb7de[_0x19a0('0x37')]=_[_0x19a0('0x35')](_0x34cb69['model'],qs['fields'](_0x31bd38[_0x19a0('0x32')]['fields']));_0x1cb7de['attributes']=_0x1cb7de[_0x19a0('0x37')][_0x19a0('0x38')]?_0x1cb7de[_0x19a0('0x37')]:_0x34cb69['model'];if(_0x31bd38['query'][_0x19a0('0x42')]){_0x1cb7de[_0x19a0('0x43')]=[{'all':!![]}];}_0x1cb7de=_[_0x19a0('0x3f')]({},_0x1cb7de,_0x31bd38[_0x19a0('0x41')]);return db[_0x19a0('0x2c')]['find'](_0x1cb7de)[_0x19a0('0x25')](handleEntityNotFound(_0x347fad,null))[_0x19a0('0x25')](respondWithResult(_0x347fad,null))[_0x19a0('0x45')](handleError(_0x347fad,null));};exports[_0x19a0('0x49')]=function(_0x5635b,_0x131f7c){return db[_0x19a0('0x2c')][_0x19a0('0x49')](_0x5635b[_0x19a0('0x4a')],{})[_0x19a0('0x25')](function(_0x54411e){var _0x6abcab=_0x5635b['user']['get']({'plain':!![]});if(!_0x6abcab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6abcab[_0x19a0('0x4b')]===_0x19a0('0x4c')){var _0x5e0395=_0x54411e['get']({'plain':!![]});var _0x21cb35=_0x19a0('0x4d');return db[_0x19a0('0x4e')][_0x19a0('0x4f')]({'where':{'name':_0x21cb35,'userProfileId':_0x6abcab['userProfileId']},'raw':!![]})[_0x19a0('0x25')](function(_0x4d8fb4){if(_0x4d8fb4&&_0x4d8fb4['autoAssociation']===0x0){return db[_0x19a0('0x50')][_0x19a0('0x49')]({'name':_0x5e0395[_0x19a0('0x29')],'resourceId':_0x5e0395['id'],'type':_0x4d8fb4['name'],'sectionId':_0x4d8fb4['id']},{})[_0x19a0('0x25')](function(){return _0x54411e;});}else{return _0x54411e;}})[_0x19a0('0x45')](function(_0x389826){logger['error'](_0x19a0('0x51'),_0x389826);throw _0x389826;});}return _0x54411e;})['then'](respondWithResult(_0x131f7c,0xc9))[_0x19a0('0x45')](handleError(_0x131f7c,null));};exports[_0x19a0('0x23')]=function(_0x73024f,_0x49c36e){if(_0x73024f[_0x19a0('0x4a')]['id']){delete _0x73024f[_0x19a0('0x4a')]['id'];}return db[_0x19a0('0x2c')][_0x19a0('0x4f')]({'where':{'id':_0x73024f[_0x19a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x49c36e,null))['then'](saveUpdates(_0x73024f['body'],null))[_0x19a0('0x25')](respondWithResult(_0x49c36e,null))['catch'](handleError(_0x49c36e,null));};exports[_0x19a0('0x24')]=function(_0x5d56e1,_0x1b477f){return db[_0x19a0('0x2c')]['find']({'where':{'id':_0x5d56e1[_0x19a0('0x47')]['id']}})[_0x19a0('0x25')](handleEntityNotFound(_0x1b477f,null))['then'](removeEntity(_0x1b477f,null))[_0x19a0('0x45')](handleError(_0x1b477f,null));};exports['test']=function(_0x3bf105,_0x396070,_0x92d38c){var _0x260ee7;return db[_0x19a0('0x2c')][_0x19a0('0x4f')]({'where':{'id':_0x3bf105[_0x19a0('0x47')]['id']},'attributes':['id',_0x19a0('0x52')]})[_0x19a0('0x25')](handleEntityNotFound(_0x396070,null))[_0x19a0('0x25')](function(_0x2eb1bd){if(_0x2eb1bd){var _0x2a44a6=require(_0x19a0('0x53'))();_0x2a44a6[_0x19a0('0x54')](_0x2eb1bd['dsn']);_0x2a44a6['closeSync']();return _0x2eb1bd;}})[_0x19a0('0x25')](respondWithResult(_0x396070,null))[_0x19a0('0x45')](handleError(_0x396070,null));}; \ No newline at end of file +var _0xf7ed=['type','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','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','test','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','name','map','SquareOdbc','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x9560c8,_0x2569a3){var _0x3624a0=function(_0xa8b465){while(--_0xa8b465){_0x9560c8['push'](_0x9560c8['shift']());}};_0x3624a0(++_0x2569a3);}(_0xf7ed,0x179));var _0xdf7e=function(_0x1ddb21,_0x2c3404){_0x1ddb21=_0x1ddb21-0x0;var _0x547a7a=_0xf7ed[_0x1ddb21];return _0x547a7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf7e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf7e('0x1'));var rp=require(_0xdf7e('0x2'));var moment=require(_0xdf7e('0x3'));var BPromise=require(_0xdf7e('0x4'));var Mustache=require('mustache');var util=require(_0xdf7e('0x5'));var path=require('path');var sox=require(_0xdf7e('0x6'));var csv=require(_0xdf7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf7e('0x8'));var _=require(_0xdf7e('0x9'));var squel=require('squel');var crypto=require(_0xdf7e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdf7e('0xb'));var toCsv=require(_0xdf7e('0x7'));var querystring=require(_0xdf7e('0xc'));var Papa=require(_0xdf7e('0xd'));var Redis=require(_0xdf7e('0xe'));var authService=require(_0xdf7e('0xf'));var qs=require(_0xdf7e('0x10'));var as=require(_0xdf7e('0x11'));var hardwareService=require(_0xdf7e('0x12'));var logger=require(_0xdf7e('0x13'))(_0xdf7e('0x14'));var utils=require(_0xdf7e('0x15'));var config=require(_0xdf7e('0x16'));var licenseUtil=require(_0xdf7e('0x17'));var db=require(_0xdf7e('0x18'))['db'];function respondWithStatusCode(_0x2e3c61,_0x1a00ff){_0x1a00ff=_0x1a00ff||0xcc;return function(_0x4cd284){if(_0x4cd284){return _0x2e3c61['sendStatus'](_0x1a00ff);}return _0x2e3c61['status'](_0x1a00ff)[_0xdf7e('0x19')]();};}function respondWithResult(_0x370deb,_0x2fea45){_0x2fea45=_0x2fea45||0xc8;return function(_0x30e409){if(_0x30e409){return _0x370deb[_0xdf7e('0x1a')](_0x2fea45)[_0xdf7e('0x1b')](_0x30e409);}};}function respondWithFilteredResult(_0x3a9c8d,_0x148d46){return function(_0x5607bf){if(_0x5607bf){var _0x5a406c=typeof _0x148d46[_0xdf7e('0x1c')]==='undefined'&&typeof _0x148d46[_0xdf7e('0x1d')]==='undefined';var _0x110c9b=_0x5607bf[_0xdf7e('0x1e')];var _0x3a2560=_0x5a406c?0x0:_0x148d46[_0xdf7e('0x1c')];var _0xd868df=_0x5a406c?_0x5607bf[_0xdf7e('0x1e')]:_0x148d46[_0xdf7e('0x1c')]+_0x148d46[_0xdf7e('0x1d')];var _0x57d666;if(_0xd868df>=_0x110c9b){_0xd868df=_0x110c9b;_0x57d666=0xc8;}else{_0x57d666=0xce;}_0x3a9c8d[_0xdf7e('0x1a')](_0x57d666);return _0x3a9c8d[_0xdf7e('0x1f')](_0xdf7e('0x20'),_0x3a2560+'-'+_0xd868df+'/'+_0x110c9b)['json'](_0x5607bf);}return null;};}function patchUpdates(_0x398dc5){return function(_0x1d61ad){try{jsonpatch[_0xdf7e('0x21')](_0x1d61ad,_0x398dc5,!![]);}catch(_0x519957){return BPromise[_0xdf7e('0x22')](_0x519957);}return _0x1d61ad[_0xdf7e('0x23')]();};}function saveUpdates(_0x3c584c,_0x593c5b){return function(_0x1f19c1){if(_0x1f19c1){return _0x1f19c1[_0xdf7e('0x24')](_0x3c584c)[_0xdf7e('0x25')](function(_0x350a4b){return _0x350a4b;});}return null;};}function removeEntity(_0x2db668,_0x181396){return function(_0x5aba98){if(_0x5aba98){return _0x5aba98[_0xdf7e('0x26')]()[_0xdf7e('0x25')](function(){var _0x5bdc52=_0x5aba98[_0xdf7e('0x27')]({'plain':!![]});var _0x49efe8=_0xdf7e('0x28');return db[_0xdf7e('0x29')][_0xdf7e('0x26')]({'where':{'type':_0x49efe8,'resourceId':_0x5bdc52['id']}})[_0xdf7e('0x25')](function(){return _0x5aba98;});})['then'](function(){_0x2db668[_0xdf7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d358d,_0x545e5b){return function(_0x37c14e){if(!_0x37c14e){_0x1d358d[_0xdf7e('0x2a')](0x194);}return _0x37c14e;};}function handleError(_0xdb1cf7,_0x505354){_0x505354=_0x505354||0x1f4;return function(_0x2442ee){logger[_0xdf7e('0x2b')](_0x2442ee['stack']);if(_0x2442ee['name']){delete _0x2442ee[_0xdf7e('0x2c')];}_0xdb1cf7[_0xdf7e('0x1a')](_0x505354)['send'](_0x2442ee);};}exports['index']=function(_0x1745bd,_0x1cc0ad){var _0x279afd={},_0x5954be={},_0x66cb92={'count':0x0,'rows':[]};var _0x283e1d=_[_0xdf7e('0x2d')](db[_0xdf7e('0x2e')][_0xdf7e('0x2f')],function(_0x39060a){return{'name':_0x39060a[_0xdf7e('0x30')],'type':_0x39060a['type']['key']};});_0x5954be[_0xdf7e('0x31')]=_['map'](_0x283e1d,_0xdf7e('0x2c'));_0x5954be[_0xdf7e('0x32')]=_[_0xdf7e('0x33')](_0x1745bd[_0xdf7e('0x32')]);_0x5954be[_0xdf7e('0x34')]=_[_0xdf7e('0x35')](_0x5954be[_0xdf7e('0x31')],_0x5954be[_0xdf7e('0x32')]);_0x279afd[_0xdf7e('0x36')]=_['intersection'](_0x5954be[_0xdf7e('0x31')],qs[_0xdf7e('0x37')](_0x1745bd[_0xdf7e('0x32')]['fields']));_0x279afd[_0xdf7e('0x36')]=_0x279afd[_0xdf7e('0x36')]['length']?_0x279afd[_0xdf7e('0x36')]:_0x5954be['model'];if(!_0x1745bd['query'][_0xdf7e('0x38')](_0xdf7e('0x39'))){_0x279afd[_0xdf7e('0x1d')]=qs[_0xdf7e('0x1d')](_0x1745bd[_0xdf7e('0x32')][_0xdf7e('0x1d')]);_0x279afd[_0xdf7e('0x1c')]=qs['offset'](_0x1745bd['query'][_0xdf7e('0x1c')]);}_0x279afd[_0xdf7e('0x3a')]=qs[_0xdf7e('0x3b')](_0x1745bd[_0xdf7e('0x32')][_0xdf7e('0x3b')]);_0x279afd[_0xdf7e('0x3c')]=qs[_0xdf7e('0x34')](_['pick'](_0x1745bd[_0xdf7e('0x32')],_0x5954be[_0xdf7e('0x34')]),_0x283e1d);if(_0x1745bd[_0xdf7e('0x32')][_0xdf7e('0x3d')]){_0x279afd[_0xdf7e('0x3c')]=_[_0xdf7e('0x3e')](_0x279afd[_0xdf7e('0x3c')],{'$or':_['map'](_0x283e1d,function(_0x20ca6b){if(_0x20ca6b[_0xdf7e('0x3f')]!==_0xdf7e('0x40')){var _0x13cd33={};_0x13cd33[_0x20ca6b['name']]={'$like':'%'+_0x1745bd['query'][_0xdf7e('0x3d')]+'%'};return _0x13cd33;}})});}_0x279afd=_['merge']({},_0x279afd,_0x1745bd[_0xdf7e('0x41')]);var _0x719b2b={'where':_0x279afd[_0xdf7e('0x3c')]};return db[_0xdf7e('0x2e')][_0xdf7e('0x1e')](_0x719b2b)[_0xdf7e('0x25')](function(_0x136686){_0x66cb92[_0xdf7e('0x1e')]=_0x136686;if(_0x1745bd[_0xdf7e('0x32')][_0xdf7e('0x42')]){_0x279afd['include']=[{'all':!![]}];}return db[_0xdf7e('0x2e')][_0xdf7e('0x43')](_0x279afd);})[_0xdf7e('0x25')](function(_0x46df18){_0x66cb92[_0xdf7e('0x44')]=_0x46df18;return _0x66cb92;})['then'](respondWithFilteredResult(_0x1cc0ad,_0x279afd))[_0xdf7e('0x45')](handleError(_0x1cc0ad,null));};exports['show']=function(_0x5b19b5,_0x4cd65f){var _0x13d315={'raw':!![],'where':{'id':_0x5b19b5[_0xdf7e('0x46')]['id']}},_0x2fb256={};_0x2fb256[_0xdf7e('0x31')]=_[_0xdf7e('0x33')](db[_0xdf7e('0x2e')]['rawAttributes']);_0x2fb256[_0xdf7e('0x32')]=_['keys'](_0x5b19b5[_0xdf7e('0x32')]);_0x2fb256['filters']=_[_0xdf7e('0x35')](_0x2fb256['model'],_0x2fb256[_0xdf7e('0x32')]);_0x13d315[_0xdf7e('0x36')]=_[_0xdf7e('0x35')](_0x2fb256[_0xdf7e('0x31')],qs[_0xdf7e('0x37')](_0x5b19b5[_0xdf7e('0x32')]['fields']));_0x13d315[_0xdf7e('0x36')]=_0x13d315[_0xdf7e('0x36')][_0xdf7e('0x47')]?_0x13d315[_0xdf7e('0x36')]:_0x2fb256[_0xdf7e('0x31')];if(_0x5b19b5[_0xdf7e('0x32')][_0xdf7e('0x42')]){_0x13d315[_0xdf7e('0x48')]=[{'all':!![]}];}_0x13d315=_[_0xdf7e('0x3e')]({},_0x13d315,_0x5b19b5[_0xdf7e('0x41')]);return db['SquareOdbc'][_0xdf7e('0x49')](_0x13d315)[_0xdf7e('0x25')](handleEntityNotFound(_0x4cd65f,null))[_0xdf7e('0x25')](respondWithResult(_0x4cd65f,null))[_0xdf7e('0x45')](handleError(_0x4cd65f,null));};exports[_0xdf7e('0x4a')]=function(_0x551014,_0x46c5ac){return db['SquareOdbc'][_0xdf7e('0x4a')](_0x551014[_0xdf7e('0x4b')],{})[_0xdf7e('0x25')](function(_0x2b9d17){var _0x1b14d4=_0x551014[_0xdf7e('0x4c')]['get']({'plain':!![]});if(!_0x1b14d4)throw new Error(_0xdf7e('0x4d'));if(_0x1b14d4[_0xdf7e('0x4e')]===_0xdf7e('0x4c')){var _0x230da7=_0x2b9d17[_0xdf7e('0x27')]({'plain':!![]});var _0x318a3a=_0xdf7e('0x28');return db[_0xdf7e('0x4f')][_0xdf7e('0x49')]({'where':{'name':_0x318a3a,'userProfileId':_0x1b14d4[_0xdf7e('0x50')]},'raw':!![]})['then'](function(_0x5c3754){if(_0x5c3754&&_0x5c3754[_0xdf7e('0x51')]===0x0){return db[_0xdf7e('0x29')]['create']({'name':_0x230da7[_0xdf7e('0x2c')],'resourceId':_0x230da7['id'],'type':_0x5c3754[_0xdf7e('0x2c')],'sectionId':_0x5c3754['id']},{})[_0xdf7e('0x25')](function(){return _0x2b9d17;});}else{return _0x2b9d17;}})[_0xdf7e('0x45')](function(_0x2c769b){logger['error'](_0xdf7e('0x52'),_0x2c769b);throw _0x2c769b;});}return _0x2b9d17;})[_0xdf7e('0x25')](respondWithResult(_0x46c5ac,0xc9))[_0xdf7e('0x45')](handleError(_0x46c5ac,null));};exports[_0xdf7e('0x24')]=function(_0x27f976,_0x592b51){if(_0x27f976[_0xdf7e('0x4b')]['id']){delete _0x27f976[_0xdf7e('0x4b')]['id'];}return db[_0xdf7e('0x2e')]['find']({'where':{'id':_0x27f976['params']['id']}})[_0xdf7e('0x25')](handleEntityNotFound(_0x592b51,null))[_0xdf7e('0x25')](saveUpdates(_0x27f976[_0xdf7e('0x4b')],null))[_0xdf7e('0x25')](respondWithResult(_0x592b51,null))[_0xdf7e('0x45')](handleError(_0x592b51,null));};exports[_0xdf7e('0x26')]=function(_0x23b9fc,_0x2b5e69){return db[_0xdf7e('0x2e')][_0xdf7e('0x49')]({'where':{'id':_0x23b9fc[_0xdf7e('0x46')]['id']}})[_0xdf7e('0x25')](handleEntityNotFound(_0x2b5e69,null))['then'](removeEntity(_0x2b5e69,null))[_0xdf7e('0x45')](handleError(_0x2b5e69,null));};exports[_0xdf7e('0x53')]=function(_0x4a5acf,_0x48114f,_0x2cbb53){var _0x4469eb;return db['SquareOdbc'][_0xdf7e('0x49')]({'where':{'id':_0x4a5acf[_0xdf7e('0x46')]['id']},'attributes':['id',_0xdf7e('0x54')]})[_0xdf7e('0x25')](handleEntityNotFound(_0x48114f,null))[_0xdf7e('0x25')](function(_0x57179f){if(_0x57179f){var _0x32467c=require(_0xdf7e('0x55'))();_0x32467c[_0xdf7e('0x56')](_0x57179f[_0xdf7e('0x54')]);_0x32467c[_0xdf7e('0x57')]();return _0x57179f;}})[_0xdf7e('0x25')](respondWithResult(_0x48114f,null))[_0xdf7e('0x45')](handleError(_0x48114f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index bdd4875..649a3bb 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 _0x1822=['exports','define','util','../../config/logger','path','rimraf','./squareOdbc.attributes'];(function(_0xa46cc9,_0x327f7d){var _0x5683ed=function(_0x3432d4){while(--_0x3432d4){_0xa46cc9['push'](_0xa46cc9['shift']());}};_0x5683ed(++_0x327f7d);}(_0x1822,0x144));var _0x2182=function(_0x4aceac,_0x2c1c6c){_0x4aceac=_0x4aceac-0x0;var _0x4fc661=_0x1822[_0x4aceac];return _0x4fc661;};'use strict';var _=require('lodash');var util=require(_0x2182('0x0'));var logger=require(_0x2182('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2182('0x2'));var rimraf=require(_0x2182('0x3'));var config=require('../../config/environment');var attributes=require(_0x2182('0x4'));module[_0x2182('0x5')]=function(_0x578828,_0x7d763c){return _0x578828[_0x2182('0x6')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9141=['exports','lodash','util','../../config/logger','path','../../config/environment','./squareOdbc.attributes'];(function(_0x512c83,_0x42a67a){var _0x1f7f25=function(_0x1e656c){while(--_0x1e656c){_0x512c83['push'](_0x512c83['shift']());}};_0x1f7f25(++_0x42a67a);}(_0x9141,0x1c1));var _0x1914=function(_0x50b889,_0x1cead9){_0x50b889=_0x50b889-0x0;var _0x28097b=_0x9141[_0x50b889];return _0x28097b;};'use strict';var _=require(_0x1914('0x0'));var util=require(_0x1914('0x1'));var logger=require(_0x1914('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1914('0x3'));var rimraf=require('rimraf');var config=require(_0x1914('0x4'));var attributes=require(_0x1914('0x5'));module[_0x1914('0x6')]=function(_0x5c04f7,_0x4e1eb2){return _0x5c04f7['define']('SquareOdbc',attributes,{'tableName':'square_odbc','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 9bdbbf8..40f2d5d 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 _0xf2ff=['stringify','error','code','message','result','SquareOdbc','find','options','raw','where','include','model','map','attributes','ShowSquareOdbc','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x440df0,_0x235152){var _0x3d60df=function(_0xc18a91){while(--_0xc18a91){_0x440df0['push'](_0x440df0['shift']());}};_0x3d60df(++_0x235152);}(_0xf2ff,0xb5));var _0xff2f=function(_0x1cd252,_0x128f04){_0x1cd252=_0x1cd252-0x0;var _0x1f33ac=_0xf2ff[_0x1cd252];return _0x1f33ac;};'use strict';var _=require(_0xff2f('0x0'));var util=require('util');var moment=require(_0xff2f('0x1'));var BPromise=require(_0xff2f('0x2'));var rs=require(_0xff2f('0x3'));var fs=require('fs');var Redis=require(_0xff2f('0x4'));var db=require(_0xff2f('0x5'))['db'];var utils=require(_0xff2f('0x6'));var logger=require(_0xff2f('0x7'))('rpc');var config=require(_0xff2f('0x8'));var jayson=require(_0xff2f('0x9'));var client=jayson[_0xff2f('0xa')][_0xff2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd17d9,_0x36be1a,_0x4d1e50){return new BPromise(function(_0x1b133e,_0x294f39){return client['request'](_0xd17d9,_0x4d1e50)[_0xff2f('0xc')](function(_0x58d177){logger[_0xff2f('0xd')](_0xff2f('0xe'),_0x36be1a,'request\x20sent');logger['debug'](_0xff2f('0xf'),_0x36be1a,_0xff2f('0x10'),JSON[_0xff2f('0x11')](_0x58d177));if(_0x58d177[_0xff2f('0x12')]){if(_0x58d177[_0xff2f('0x12')][_0xff2f('0x13')]===0x1f4){logger[_0xff2f('0x12')](_0xff2f('0xe'),_0x36be1a,_0x58d177[_0xff2f('0x12')]['message']);return _0x294f39(_0x58d177[_0xff2f('0x12')][_0xff2f('0x14')]);}logger[_0xff2f('0x12')](_0xff2f('0xe'),_0x36be1a,_0x58d177['error'][_0xff2f('0x14')]);return _0x1b133e(_0x58d177[_0xff2f('0x12')][_0xff2f('0x14')]);}else{logger[_0xff2f('0xd')](_0xff2f('0xe'),_0x36be1a,_0xff2f('0x10'));_0x1b133e(_0x58d177[_0xff2f('0x15')][_0xff2f('0x14')]);}})['catch'](function(_0x17e4c7){logger[_0xff2f('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x36be1a,_0x17e4c7);_0x294f39(_0x17e4c7);});});}exports['ShowSquareOdbc']=function(_0x228dff){var _0x12f545=this;return new Promise(function(_0x37e58c,_0x209d0a){return db[_0xff2f('0x16')][_0xff2f('0x17')]({'raw':_0x228dff['options']?_0x228dff[_0xff2f('0x18')][_0xff2f('0x19')]===undefined?!![]:![]:!![],'where':_0x228dff[_0xff2f('0x18')]?_0x228dff['options'][_0xff2f('0x1a')]||null:null,'attributes':_0x228dff[_0xff2f('0x18')]?_0x228dff[_0xff2f('0x18')]['attributes']||null:null,'include':_0x228dff[_0xff2f('0x18')]?_0x228dff[_0xff2f('0x18')][_0xff2f('0x1b')]?_['map'](_0x228dff['options']['include'],function(_0x52edf6){return{'model':db[_0x52edf6[_0xff2f('0x1c')]],'as':_0x52edf6['as'],'attributes':_0x52edf6['attributes'],'include':_0x52edf6[_0xff2f('0x1b')]?_[_0xff2f('0x1d')](_0x52edf6[_0xff2f('0x1b')],function(_0x98ee10){return{'model':db[_0x98ee10[_0xff2f('0x1c')]],'as':_0x98ee10['as'],'attributes':_0x98ee10[_0xff2f('0x1e')],'include':_0x98ee10[_0xff2f('0x1b')]?_['map'](_0x98ee10[_0xff2f('0x1b')],function(_0x2df828){return{'model':db[_0x2df828[_0xff2f('0x1c')]],'as':_0x2df828['as'],'attributes':_0x2df828[_0xff2f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xff2f('0xc')](function(_0x9af61){logger['info'](_0xff2f('0x1f'),_0x228dff);logger['debug'](_0xff2f('0x1f'),_0x228dff,JSON[_0xff2f('0x11')](_0x9af61));_0x37e58c(_0x9af61);})[_0xff2f('0x20')](function(_0x344368){logger[_0xff2f('0x12')]('ShowSquareOdbc',_0x344368[_0xff2f('0x14')],_0x228dff);_0x209d0a(_0x12f545['error'](0x1f4,_0x344368[_0xff2f('0x14')]));});});}; \ No newline at end of file +var _0x5c48=['include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes'];(function(_0xd49b8d,_0x15619d){var _0x39e334=function(_0x54b8b4){while(--_0x54b8b4){_0xd49b8d['push'](_0xd49b8d['shift']());}};_0x39e334(++_0x15619d);}(_0x5c48,0xc3));var _0x85c4=function(_0x3eb831,_0x212772){_0x3eb831=_0x3eb831-0x0;var _0xac0b9e=_0x5c48[_0x3eb831];return _0xac0b9e;};'use strict';var _=require(_0x85c4('0x0'));var util=require(_0x85c4('0x1'));var moment=require(_0x85c4('0x2'));var BPromise=require(_0x85c4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85c4('0x4'));var db=require(_0x85c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85c4('0x6'));var config=require(_0x85c4('0x7'));var jayson=require(_0x85c4('0x8'));var client=jayson[_0x85c4('0x9')][_0x85c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbc6d9a,_0x138dfb,_0x46521f){return new BPromise(function(_0x1532c3,_0x582614){return client[_0x85c4('0xb')](_0xbc6d9a,_0x46521f)[_0x85c4('0xc')](function(_0x1b07a6){logger[_0x85c4('0xd')](_0x85c4('0xe'),_0x138dfb,_0x85c4('0xf'));logger[_0x85c4('0x10')](_0x85c4('0x11'),_0x138dfb,_0x85c4('0xf'),JSON[_0x85c4('0x12')](_0x1b07a6));if(_0x1b07a6[_0x85c4('0x13')]){if(_0x1b07a6[_0x85c4('0x13')]['code']===0x1f4){logger['error'](_0x85c4('0xe'),_0x138dfb,_0x1b07a6['error'][_0x85c4('0x14')]);return _0x582614(_0x1b07a6['error']['message']);}logger['error'](_0x85c4('0xe'),_0x138dfb,_0x1b07a6[_0x85c4('0x13')]['message']);return _0x1532c3(_0x1b07a6[_0x85c4('0x13')][_0x85c4('0x14')]);}else{logger[_0x85c4('0xd')](_0x85c4('0xe'),_0x138dfb,_0x85c4('0xf'));_0x1532c3(_0x1b07a6['result'][_0x85c4('0x14')]);}})[_0x85c4('0x15')](function(_0x17d9ed){logger['error'](_0x85c4('0xe'),_0x138dfb,_0x17d9ed);_0x582614(_0x17d9ed);});});}exports[_0x85c4('0x16')]=function(_0x1508b4){var _0x3d115c=this;return new Promise(function(_0x2dfdad,_0x492431){return db[_0x85c4('0x17')][_0x85c4('0x18')]({'raw':_0x1508b4[_0x85c4('0x19')]?_0x1508b4[_0x85c4('0x19')][_0x85c4('0x1a')]===undefined?!![]:![]:!![],'where':_0x1508b4[_0x85c4('0x19')]?_0x1508b4[_0x85c4('0x19')][_0x85c4('0x1b')]||null:null,'attributes':_0x1508b4[_0x85c4('0x19')]?_0x1508b4[_0x85c4('0x19')][_0x85c4('0x1c')]||null:null,'include':_0x1508b4[_0x85c4('0x19')]?_0x1508b4[_0x85c4('0x19')][_0x85c4('0x1d')]?_[_0x85c4('0x1e')](_0x1508b4[_0x85c4('0x19')][_0x85c4('0x1d')],function(_0x3318c4){return{'model':db[_0x3318c4[_0x85c4('0x1f')]],'as':_0x3318c4['as'],'attributes':_0x3318c4[_0x85c4('0x1c')],'include':_0x3318c4[_0x85c4('0x1d')]?_[_0x85c4('0x1e')](_0x3318c4[_0x85c4('0x1d')],function(_0x5948ed){return{'model':db[_0x5948ed['model']],'as':_0x5948ed['as'],'attributes':_0x5948ed[_0x85c4('0x1c')],'include':_0x5948ed[_0x85c4('0x1d')]?_[_0x85c4('0x1e')](_0x5948ed[_0x85c4('0x1d')],function(_0x567605){return{'model':db[_0x567605[_0x85c4('0x1f')]],'as':_0x567605['as'],'attributes':_0x567605[_0x85c4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x76a5bb){logger[_0x85c4('0xd')](_0x85c4('0x16'),_0x1508b4);logger['debug'](_0x85c4('0x16'),_0x1508b4,JSON[_0x85c4('0x12')](_0x76a5bb));_0x2dfdad(_0x76a5bb);})[_0x85c4('0x15')](function(_0x279c7b){logger[_0x85c4('0x13')]('ShowSquareOdbc',_0x279c7b[_0x85c4('0x14')],_0x1508b4);_0x492431(_0x3d115c[_0x85c4('0x13')](0x1f4,_0x279c7b[_0x85c4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index babd86f..58f7ba9 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 _0x605a=['destroy','removeUsers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','post','create','addUsers','put','/:id','update','delete'];(function(_0x3b9b6f,_0x182921){var _0xe7346c=function(_0x38c54e){while(--_0x38c54e){_0x3b9b6f['push'](_0x3b9b6f['shift']());}};_0xe7346c(++_0x182921);}(_0x605a,0x1d7));var _0xa605=function(_0x4dceb7,_0x58315a){_0x4dceb7=_0x4dceb7-0x0;var _0x3423ae=_0x605a[_0x4dceb7];return _0x3423ae;};'use strict';var multer=require(_0xa605('0x0'));var util=require('util');var path=require(_0xa605('0x1'));var timeout=require(_0xa605('0x2'));var express=require(_0xa605('0x3'));var router=express[_0xa605('0x4')]();var fs_extra=require(_0xa605('0x5'));var auth=require(_0xa605('0x6'));var interaction=require(_0xa605('0x7'));var config=require(_0xa605('0x8'));var controller=require(_0xa605('0x9'));router[_0xa605('0xa')]('/',auth[_0xa605('0xb')](),controller[_0xa605('0xc')]);router['get']('/:id',auth[_0xa605('0xb')](),controller[_0xa605('0xd')]);router[_0xa605('0xa')](_0xa605('0xe'),auth[_0xa605('0xb')](),controller[_0xa605('0xf')]);router[_0xa605('0x10')]('/',auth[_0xa605('0xb')](),controller[_0xa605('0x11')]);router[_0xa605('0x10')](_0xa605('0xe'),auth[_0xa605('0xb')](),controller[_0xa605('0x12')]);router[_0xa605('0x13')](_0xa605('0x14'),auth[_0xa605('0xb')](),controller[_0xa605('0x15')]);router[_0xa605('0x16')](_0xa605('0x14'),auth['isAuthenticated'](),controller[_0xa605('0x17')]);router[_0xa605('0x16')]('/:id/users',auth[_0xa605('0xb')](),controller[_0xa605('0x18')]);module[_0xa605('0x19')]=router; \ No newline at end of file +var _0x87d5=['get','index','/:id','show','/:id/users','isAuthenticated','getUsers','post','create','addUsers','update','delete','destroy','removeUsers','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0x87d5,0x6b));var _0x587d=function(_0x11b639,_0xbeca94){_0x11b639=_0x11b639-0x0;var _0x11c068=_0x87d5[_0x11b639];return _0x11c068;};'use strict';var multer=require(_0x587d('0x0'));var util=require('util');var path=require(_0x587d('0x1'));var timeout=require('connect-timeout');var express=require(_0x587d('0x2'));var router=express[_0x587d('0x3')]();var fs_extra=require(_0x587d('0x4'));var auth=require(_0x587d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x587d('0x6'));var controller=require(_0x587d('0x7'));router[_0x587d('0x8')]('/',auth['isAuthenticated'](),controller[_0x587d('0x9')]);router[_0x587d('0x8')](_0x587d('0xa'),auth['isAuthenticated'](),controller[_0x587d('0xb')]);router[_0x587d('0x8')](_0x587d('0xc'),auth[_0x587d('0xd')](),controller[_0x587d('0xe')]);router[_0x587d('0xf')]('/',auth['isAuthenticated'](),controller[_0x587d('0x10')]);router[_0x587d('0xf')]('/:id/users',auth[_0x587d('0xd')](),controller[_0x587d('0x11')]);router['put']('/:id',auth[_0x587d('0xd')](),controller[_0x587d('0x12')]);router[_0x587d('0x13')]('/:id',auth[_0x587d('0xd')](),controller[_0x587d('0x14')]);router[_0x587d('0x13')](_0x587d('0xc'),auth[_0x587d('0xd')](),controller[_0x587d('0x15')]);module[_0x587d('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index e3d1578..ff1b1e0 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 _0xf122=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long'];(function(_0x287415,_0x56477c){var _0x32d1a0=function(_0x24af33){while(--_0x24af33){_0x287415['push'](_0x287415['shift']());}};_0x32d1a0(++_0x56477c);}(_0xf122,0x17f));var _0x2f12=function(_0x502116,_0x242439){_0x502116=_0x502116-0x0;var _0x414095=_0xf122[_0x502116];return _0x414095;};'use strict';var Sequelize=require(_0x2f12('0x0'));module[_0x2f12('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f12('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x2f12('0x3')]},'notes':{'type':Sequelize[_0x2f12('0x4')]},'preproduction':{'type':Sequelize[_0x2f12('0x5')](_0x2f12('0x6')),'get':function(){if(this[_0x2f12('0x7')](_0x2f12('0x8'))){return this[_0x2f12('0x7')]('preproduction')[_0x2f12('0x9')](_0x2f12('0xa'));}}},'production':{'type':Sequelize[_0x2f12('0x5')](_0x2f12('0x6')),'get':function(){if(this[_0x2f12('0x7')](_0x2f12('0xb'))){return this[_0x2f12('0x7')]('production')[_0x2f12('0x9')](_0x2f12('0xa'));}}},'savedAt':{'type':Sequelize[_0x2f12('0xc')]},'publishedAt':{'type':Sequelize[_0x2f12('0xc')]}}; \ No newline at end of file +var _0x589d=['toString','utf8','getDataValue','production','DATE','sequelize','exports','STRING','BLOB','long','preproduction'];(function(_0x40ec7d,_0x2a590a){var _0x4d69c8=function(_0x456c91){while(--_0x456c91){_0x40ec7d['push'](_0x40ec7d['shift']());}};_0x4d69c8(++_0x2a590a);}(_0x589d,0x19c));var _0xd589=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x589d[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xd589('0x0'));module[_0xd589('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd589('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xd589('0x3')](_0xd589('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this['getDataValue'](_0xd589('0x5'))[_0xd589('0x6')](_0xd589('0x7'));}}},'production':{'type':Sequelize[_0xd589('0x3')](_0xd589('0x4')),'get':function(){if(this['getDataValue']('production')){return this[_0xd589('0x8')](_0xd589('0x9'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xd589('0xa')]},'publishedAt':{'type':Sequelize[_0xd589('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 2eef41c..1f4040e 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 _0x3c44=['params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','getUsers','findOne','User','pick','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','SquareProjects','UserProfileResource','end','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3c44,0x1e2));var _0x43c4=function(_0x3b7ba3,_0x4b6a83){_0x3b7ba3=_0x3b7ba3-0x0;var _0x2d126c=_0x3c44[_0x3b7ba3];return _0x2d126c;};'use strict';var emlformat=require(_0x43c4('0x0'));var rimraf=require(_0x43c4('0x1'));var zipdir=require(_0x43c4('0x2'));var jsonpatch=require(_0x43c4('0x3'));var rp=require(_0x43c4('0x4'));var moment=require(_0x43c4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x43c4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x43c4('0x7'));var csv=require(_0x43c4('0x8'));var ejs=require(_0x43c4('0x9'));var fs=require('fs');var fs_extra=require(_0x43c4('0xa'));var _=require(_0x43c4('0xb'));var squel=require(_0x43c4('0xc'));var crypto=require(_0x43c4('0xd'));var jsforce=require(_0x43c4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x43c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x43c4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x43c4('0x10'));var as=require(_0x43c4('0x11'));var hardwareService=require(_0x43c4('0x12'));var logger=require('../../config/logger')(_0x43c4('0x13'));var utils=require('../../config/utils');var config=require(_0x43c4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43c4('0x15'))['db'];config[_0x43c4('0x16')]=_[_0x43c4('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x43c4('0x18'))(new Redis(config[_0x43c4('0x16')]));require(_0x43c4('0x19'))['register'](socket);function respondWithStatusCode(_0x18fc8e,_0x400b1c){_0x400b1c=_0x400b1c||0xcc;return function(_0x2350f8){if(_0x2350f8){return _0x18fc8e[_0x43c4('0x1a')](_0x400b1c);}return _0x18fc8e['status'](_0x400b1c)['end']();};}function respondWithResult(_0x17cbe2,_0x1888d4){_0x1888d4=_0x1888d4||0xc8;return function(_0x37fa23){if(_0x37fa23){return _0x17cbe2[_0x43c4('0x1b')](_0x1888d4)[_0x43c4('0x1c')](_0x37fa23);}};}function respondWithFilteredResult(_0x32e9b2,_0x20aede){return function(_0x2845f8){if(_0x2845f8){var _0x51d5b5=typeof _0x20aede[_0x43c4('0x1d')]===_0x43c4('0x1e')&&typeof _0x20aede[_0x43c4('0x1f')]===_0x43c4('0x1e');var _0x4491e8=_0x2845f8[_0x43c4('0x20')];var _0x182e75=_0x51d5b5?0x0:_0x20aede['offset'];var _0x3fff76=_0x51d5b5?_0x2845f8['count']:_0x20aede[_0x43c4('0x1d')]+_0x20aede['limit'];var _0x599975;if(_0x3fff76>=_0x4491e8){_0x3fff76=_0x4491e8;_0x599975=0xc8;}else{_0x599975=0xce;}_0x32e9b2['status'](_0x599975);return _0x32e9b2['set'](_0x43c4('0x21'),_0x182e75+'-'+_0x3fff76+'/'+_0x4491e8)[_0x43c4('0x1c')](_0x2845f8);}return null;};}function patchUpdates(_0x4f9b26){return function(_0x1af9e6){try{jsonpatch[_0x43c4('0x22')](_0x1af9e6,_0x4f9b26,!![]);}catch(_0x2e1084){return BPromise['reject'](_0x2e1084);}return _0x1af9e6[_0x43c4('0x23')]();};}function saveUpdates(_0x3dcb59,_0x43fd0e){return function(_0x1158b3){if(_0x1158b3){return _0x1158b3[_0x43c4('0x24')](_0x3dcb59)[_0x43c4('0x25')](function(_0x324d11){return _0x324d11;});}return null;};}function removeEntity(_0x2f0f9f,_0x38f110){return function(_0x594580){if(_0x594580){return _0x594580[_0x43c4('0x26')]()[_0x43c4('0x25')](function(){var _0x153664=_0x594580['get']({'plain':!![]});var _0x296900=_0x43c4('0x27');return db[_0x43c4('0x28')]['destroy']({'where':{'type':_0x296900,'resourceId':_0x153664['id']}})['then'](function(){return _0x594580;});})[_0x43c4('0x25')](function(){_0x2f0f9f[_0x43c4('0x1b')](0xcc)[_0x43c4('0x29')]();});}};}function handleEntityNotFound(_0x3a4577,_0x34a500){return function(_0xc4283a){if(!_0xc4283a){_0x3a4577[_0x43c4('0x1a')](0x194);}return _0xc4283a;};}function handleError(_0x30e1ce,_0x33dca9){_0x33dca9=_0x33dca9||0x1f4;return function(_0x38ad2e){logger['error'](_0x38ad2e['stack']);if(_0x38ad2e[_0x43c4('0x2a')]){delete _0x38ad2e[_0x43c4('0x2a')];}_0x30e1ce['status'](_0x33dca9)[_0x43c4('0x2b')](_0x38ad2e);};}exports['index']=function(_0x570e30,_0x2924ae){var _0x3a7f04={},_0x5bbffc={},_0x4a40aa={'count':0x0,'rows':[]};var _0x3a20a2=_[_0x43c4('0x2c')](db[_0x43c4('0x2d')][_0x43c4('0x2e')],function(_0x3ad8b7){return{'name':_0x3ad8b7[_0x43c4('0x2f')],'type':_0x3ad8b7[_0x43c4('0x30')][_0x43c4('0x31')]};});_0x5bbffc[_0x43c4('0x32')]=_[_0x43c4('0x2c')](_0x3a20a2,_0x43c4('0x2a'));_0x5bbffc[_0x43c4('0x33')]=_[_0x43c4('0x34')](_0x570e30[_0x43c4('0x33')]);_0x5bbffc[_0x43c4('0x35')]=_[_0x43c4('0x36')](_0x5bbffc[_0x43c4('0x32')],_0x5bbffc['query']);_0x3a7f04[_0x43c4('0x37')]=_[_0x43c4('0x36')](_0x5bbffc[_0x43c4('0x32')],qs[_0x43c4('0x38')](_0x570e30[_0x43c4('0x33')]['fields']));_0x3a7f04[_0x43c4('0x37')]=_0x3a7f04['attributes'][_0x43c4('0x39')]?_0x3a7f04[_0x43c4('0x37')]:_0x5bbffc[_0x43c4('0x32')];if(!_0x570e30[_0x43c4('0x33')]['hasOwnProperty'](_0x43c4('0x3a'))){_0x3a7f04[_0x43c4('0x1f')]=qs['limit'](_0x570e30[_0x43c4('0x33')]['limit']);_0x3a7f04['offset']=qs[_0x43c4('0x1d')](_0x570e30['query'][_0x43c4('0x1d')]);}_0x3a7f04['order']=qs[_0x43c4('0x3b')](_0x570e30['query'][_0x43c4('0x3b')]);_0x3a7f04['where']=qs[_0x43c4('0x35')](_['pick'](_0x570e30[_0x43c4('0x33')],_0x5bbffc[_0x43c4('0x35')]),_0x3a20a2);if(_0x570e30[_0x43c4('0x33')][_0x43c4('0x3c')]){_0x3a7f04[_0x43c4('0x3d')]=_[_0x43c4('0x3e')](_0x3a7f04[_0x43c4('0x3d')],{'$or':_[_0x43c4('0x2c')](_0x3a20a2,function(_0x17355a){if(_0x17355a[_0x43c4('0x30')]!==_0x43c4('0x3f')){var _0x2d0c07={};_0x2d0c07[_0x17355a[_0x43c4('0x2a')]]={'$like':'%'+_0x570e30['query'][_0x43c4('0x3c')]+'%'};return _0x2d0c07;}})});}_0x3a7f04=_[_0x43c4('0x3e')]({},_0x3a7f04,_0x570e30[_0x43c4('0x40')]);var _0x5a24dd={'where':_0x3a7f04[_0x43c4('0x3d')]};return db[_0x43c4('0x2d')][_0x43c4('0x20')](_0x5a24dd)[_0x43c4('0x25')](function(_0x5f4549){_0x4a40aa['count']=_0x5f4549;if(_0x570e30[_0x43c4('0x33')][_0x43c4('0x41')]){_0x3a7f04[_0x43c4('0x42')]=[{'all':!![]}];}return db['SquareProject'][_0x43c4('0x43')](_0x3a7f04);})[_0x43c4('0x25')](function(_0x3d9b12){_0x4a40aa[_0x43c4('0x44')]=_0x3d9b12;return _0x4a40aa;})[_0x43c4('0x25')](respondWithFilteredResult(_0x2924ae,_0x3a7f04))[_0x43c4('0x45')](handleError(_0x2924ae,null));};exports['show']=function(_0x150bda,_0x23f30c){var _0xa23b70={'raw':![],'where':{'id':_0x150bda[_0x43c4('0x46')]['id']}},_0xfd9c06={};_0xfd9c06[_0x43c4('0x32')]=_[_0x43c4('0x34')](db[_0x43c4('0x2d')][_0x43c4('0x2e')]);_0xfd9c06['query']=_[_0x43c4('0x34')](_0x150bda[_0x43c4('0x33')]);_0xfd9c06[_0x43c4('0x35')]=_[_0x43c4('0x36')](_0xfd9c06[_0x43c4('0x32')],_0xfd9c06[_0x43c4('0x33')]);_0xa23b70['attributes']=_[_0x43c4('0x36')](_0xfd9c06[_0x43c4('0x32')],qs['fields'](_0x150bda[_0x43c4('0x33')]['fields']));_0xa23b70['attributes']=_0xa23b70[_0x43c4('0x37')]['length']?_0xa23b70['attributes']:_0xfd9c06[_0x43c4('0x32')];if(_0x150bda[_0x43c4('0x33')]['includeAll']){_0xa23b70[_0x43c4('0x42')]=[{'all':!![]}];}_0xa23b70=_[_0x43c4('0x3e')]({},_0xa23b70,_0x150bda[_0x43c4('0x40')]);return db[_0x43c4('0x2d')][_0x43c4('0x47')](_0xa23b70)['then'](handleEntityNotFound(_0x23f30c,null))[_0x43c4('0x25')](respondWithResult(_0x23f30c,null))['catch'](handleError(_0x23f30c,null));};exports[_0x43c4('0x48')]=function(_0x44b25e,_0x286597){return db['SquareProject'][_0x43c4('0x48')](_0x44b25e[_0x43c4('0x49')],{})['then'](function(_0x1016b4){var _0x465ae5=_0x44b25e[_0x43c4('0x4a')][_0x43c4('0x4b')]({'plain':!![]});if(!_0x465ae5)throw new Error(_0x43c4('0x4c'));if(_0x465ae5[_0x43c4('0x4d')]===_0x43c4('0x4a')){var _0xac2d62=_0x1016b4[_0x43c4('0x4b')]({'plain':!![]});var _0x5d31e5=_0x43c4('0x27');return db[_0x43c4('0x4e')][_0x43c4('0x47')]({'where':{'name':_0x5d31e5,'userProfileId':_0x465ae5['userProfileId']},'raw':!![]})['then'](function(_0x1c9e39){if(_0x1c9e39&&_0x1c9e39['autoAssociation']===0x0){return db[_0x43c4('0x28')][_0x43c4('0x48')]({'name':_0xac2d62[_0x43c4('0x2a')],'resourceId':_0xac2d62['id'],'type':_0x1c9e39['name'],'sectionId':_0x1c9e39['id']},{})[_0x43c4('0x25')](function(){return _0x1016b4;});}else{return _0x1016b4;}})[_0x43c4('0x45')](function(_0x4818d3){logger[_0x43c4('0x4f')](_0x43c4('0x50'),_0x4818d3);throw _0x4818d3;});}return _0x1016b4;})['then'](respondWithResult(_0x286597,0xc9))[_0x43c4('0x45')](handleError(_0x286597,null));};exports['update']=function(_0x2a5ef2,_0x556b1d){if(_0x2a5ef2[_0x43c4('0x49')]['id']){delete _0x2a5ef2[_0x43c4('0x49')]['id'];}return db[_0x43c4('0x2d')][_0x43c4('0x47')]({'where':{'id':_0x2a5ef2['params']['id']}})['then'](handleEntityNotFound(_0x556b1d,null))[_0x43c4('0x25')](saveUpdates(_0x2a5ef2[_0x43c4('0x49')],null))[_0x43c4('0x25')](respondWithResult(_0x556b1d,null))[_0x43c4('0x45')](handleError(_0x556b1d,null));};exports[_0x43c4('0x26')]=function(_0x22d882,_0x1fd154){return db[_0x43c4('0x2d')]['find']({'where':{'id':_0x22d882['params']['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0x1fd154,null))[_0x43c4('0x25')](removeEntity(_0x1fd154,null))[_0x43c4('0x45')](handleError(_0x1fd154,null));};exports[_0x43c4('0x51')]=function(_0x4e4794,_0x2e9e0e,_0x3a2d52){return db[_0x43c4('0x2d')][_0x43c4('0x47')]({'where':{'id':_0x4e4794[_0x43c4('0x46')]['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0x2e9e0e,null))[_0x43c4('0x25')](function(_0x596168){if(_0x596168){return _0x596168[_0x43c4('0x51')](_0x4e4794[_0x43c4('0x49')][_0x43c4('0x52')],_[_0x43c4('0x53')](_0x4e4794[_0x43c4('0x49')],[_0x43c4('0x52'),'id'])||{});}})[_0x43c4('0x25')](respondWithResult(_0x2e9e0e,null))['catch'](handleError(_0x2e9e0e,null));};exports['removeUsers']=function(_0x22fd52,_0xc876a0,_0x3bc435){return db[_0x43c4('0x2d')][_0x43c4('0x47')]({'where':{'id':_0x22fd52[_0x43c4('0x46')]['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0xc876a0,null))[_0x43c4('0x25')](function(_0x29399d){if(_0x29399d){return _0x29399d[_0x43c4('0x54')](_0x22fd52[_0x43c4('0x33')]['ids'])['then'](function(){if(_[_0x43c4('0x55')](_0x22fd52[_0x43c4('0x33')]['ids'])){for(var _0x2479df=0x0;_0x2479df<_0x22fd52[_0x43c4('0x33')][_0x43c4('0x52')][_0x43c4('0x39')];_0x2479df+=0x1){socket['emit'](_0x43c4('0x56'),{'UserId':Number(_0x22fd52[_0x43c4('0x33')][_0x43c4('0x52')][_0x2479df]),'SquareProjectId':Number(_0x22fd52['params']['id'])});}}else{socket['emit'](_0x43c4('0x56'),{'UserId':Number(_0x22fd52[_0x43c4('0x33')][_0x43c4('0x52')]),'SquareProjectId':Number(_0x22fd52[_0x43c4('0x46')]['id'])});}});}})[_0x43c4('0x25')](respondWithStatusCode(_0xc876a0,null))[_0x43c4('0x45')](handleError(_0xc876a0,null));};exports[_0x43c4('0x57')]=function(_0x2f5ad3,_0x355ffa,_0x283f1f){var _0x2edf97={};var _0x83570f={};var _0x3f7cf6;var _0x2b9901;return db[_0x43c4('0x2d')][_0x43c4('0x58')]({'where':{'id':_0x2f5ad3['params']['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0x355ffa,null))[_0x43c4('0x25')](function(_0x3b570c){if(_0x3b570c){_0x3f7cf6=_0x3b570c;_0x83570f[_0x43c4('0x32')]=_[_0x43c4('0x34')](db[_0x43c4('0x59')][_0x43c4('0x2e')]);_0x83570f[_0x43c4('0x33')]=_[_0x43c4('0x34')](_0x2f5ad3[_0x43c4('0x33')]);_0x83570f[_0x43c4('0x35')]=_[_0x43c4('0x36')](_0x83570f[_0x43c4('0x32')],_0x83570f[_0x43c4('0x33')]);_0x2edf97[_0x43c4('0x37')]=_['intersection'](_0x83570f[_0x43c4('0x32')],qs[_0x43c4('0x38')](_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x38')]));_0x2edf97[_0x43c4('0x37')]=_0x2edf97[_0x43c4('0x37')][_0x43c4('0x39')]?_0x2edf97[_0x43c4('0x37')]:_0x83570f[_0x43c4('0x32')];_0x2edf97['order']=qs[_0x43c4('0x3b')](_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x3b')]);_0x2edf97['where']=qs[_0x43c4('0x35')](_[_0x43c4('0x5a')](_0x2f5ad3[_0x43c4('0x33')],_0x83570f[_0x43c4('0x35')]));if(_0x2f5ad3[_0x43c4('0x33')]['filter']){_0x2edf97[_0x43c4('0x3d')]=_[_0x43c4('0x3e')](_0x2edf97[_0x43c4('0x3d')],{'$or':_[_0x43c4('0x2c')](_0x2edf97[_0x43c4('0x37')],function(_0x20454a){var _0x5ed800={};_0x5ed800[_0x20454a]={'$like':'%'+_0x2f5ad3['query'][_0x43c4('0x3c')]+'%'};return _0x5ed800;})});}_0x2edf97=_[_0x43c4('0x3e')]({},_0x2edf97,_0x2f5ad3['options']);return _0x3f7cf6[_0x43c4('0x57')](_0x2edf97);}})['then'](function(_0x3c256c){if(_0x3c256c){_0x2b9901=_0x3c256c[_0x43c4('0x39')];if(!_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x5b')](_0x43c4('0x3a'))){_0x2edf97[_0x43c4('0x1f')]=qs['limit'](_0x2f5ad3['query']['limit']);_0x2edf97[_0x43c4('0x1d')]=qs['offset'](_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x1d')]);}return _0x3f7cf6[_0x43c4('0x57')](_0x2edf97);}})[_0x43c4('0x25')](function(_0x49f320){if(_0x49f320){return _0x49f320?{'count':_0x2b9901,'rows':_0x49f320}:null;}})[_0x43c4('0x25')](respondWithResult(_0x355ffa,null))[_0x43c4('0x45')](handleError(_0x355ffa,null));}; \ No newline at end of file +var _0x93cf=['catch','show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','find','ids','omit','removeUsers','emit','userSquareProject:remove','findOne','pick','getUsers','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','SquareProjects','UserProfileResource','name','SquareProject','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x93cf,0x193));var _0xf93c=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x93cf[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf93c('0x0'));var zipdir=require(_0xf93c('0x1'));var jsonpatch=require(_0xf93c('0x2'));var rp=require(_0xf93c('0x3'));var moment=require(_0xf93c('0x4'));var BPromise=require(_0xf93c('0x5'));var Mustache=require(_0xf93c('0x6'));var util=require(_0xf93c('0x7'));var path=require(_0xf93c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf93c('0x9'));var fs=require('fs');var fs_extra=require(_0xf93c('0xa'));var _=require(_0xf93c('0xb'));var squel=require(_0xf93c('0xc'));var crypto=require(_0xf93c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf93c('0xe'));var toCsv=require(_0xf93c('0xf'));var querystring=require('querystring');var Papa=require(_0xf93c('0x10'));var Redis=require(_0xf93c('0x11'));var authService=require(_0xf93c('0x12'));var qs=require(_0xf93c('0x13'));var as=require(_0xf93c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf93c('0x15'));var config=require(_0xf93c('0x16'));var licenseUtil=require(_0xf93c('0x17'));var db=require(_0xf93c('0x18'))['db'];config['redis']=_[_0xf93c('0x19')](config[_0xf93c('0x1a')],{'host':_0xf93c('0x1b'),'port':0x18eb});var socket=require(_0xf93c('0x1c'))(new Redis(config[_0xf93c('0x1a')]));require(_0xf93c('0x1d'))[_0xf93c('0x1e')](socket);function respondWithStatusCode(_0x4e0f12,_0x4523c5){_0x4523c5=_0x4523c5||0xcc;return function(_0x384a46){if(_0x384a46){return _0x4e0f12[_0xf93c('0x1f')](_0x4523c5);}return _0x4e0f12[_0xf93c('0x20')](_0x4523c5)[_0xf93c('0x21')]();};}function respondWithResult(_0x4a70e1,_0x5ab053){_0x5ab053=_0x5ab053||0xc8;return function(_0xc9adee){if(_0xc9adee){return _0x4a70e1[_0xf93c('0x20')](_0x5ab053)[_0xf93c('0x22')](_0xc9adee);}};}function respondWithFilteredResult(_0x3a6f73,_0x3d2d8d){return function(_0x5b31df){if(_0x5b31df){var _0xf41e5f=typeof _0x3d2d8d[_0xf93c('0x23')]===_0xf93c('0x24')&&typeof _0x3d2d8d[_0xf93c('0x25')]===_0xf93c('0x24');var _0x28c0ac=_0x5b31df[_0xf93c('0x26')];var _0x5bb3c4=_0xf41e5f?0x0:_0x3d2d8d[_0xf93c('0x23')];var _0x19c340=_0xf41e5f?_0x5b31df[_0xf93c('0x26')]:_0x3d2d8d['offset']+_0x3d2d8d[_0xf93c('0x25')];var _0x5812fc;if(_0x19c340>=_0x28c0ac){_0x19c340=_0x28c0ac;_0x5812fc=0xc8;}else{_0x5812fc=0xce;}_0x3a6f73['status'](_0x5812fc);return _0x3a6f73[_0xf93c('0x27')](_0xf93c('0x28'),_0x5bb3c4+'-'+_0x19c340+'/'+_0x28c0ac)['json'](_0x5b31df);}return null;};}function patchUpdates(_0x384314){return function(_0xa518da){try{jsonpatch['apply'](_0xa518da,_0x384314,!![]);}catch(_0x33dac9){return BPromise['reject'](_0x33dac9);}return _0xa518da[_0xf93c('0x29')]();};}function saveUpdates(_0x1646b1,_0x413149){return function(_0x256afe){if(_0x256afe){return _0x256afe['update'](_0x1646b1)['then'](function(_0x3eb055){return _0x3eb055;});}return null;};}function removeEntity(_0x6ac024,_0x498d0d){return function(_0x1b71d5){if(_0x1b71d5){return _0x1b71d5[_0xf93c('0x2a')]()[_0xf93c('0x2b')](function(){var _0x3b6849=_0x1b71d5['get']({'plain':!![]});var _0x5097f6=_0xf93c('0x2c');return db[_0xf93c('0x2d')]['destroy']({'where':{'type':_0x5097f6,'resourceId':_0x3b6849['id']}})[_0xf93c('0x2b')](function(){return _0x1b71d5;});})[_0xf93c('0x2b')](function(){_0x6ac024['status'](0xcc)[_0xf93c('0x21')]();});}};}function handleEntityNotFound(_0x51d27a,_0x20e768){return function(_0x2eec7d){if(!_0x2eec7d){_0x51d27a[_0xf93c('0x1f')](0x194);}return _0x2eec7d;};}function handleError(_0x323256,_0x878dc6){_0x878dc6=_0x878dc6||0x1f4;return function(_0x13e27f){logger['error'](_0x13e27f['stack']);if(_0x13e27f[_0xf93c('0x2e')]){delete _0x13e27f['name'];}_0x323256[_0xf93c('0x20')](_0x878dc6)['send'](_0x13e27f);};}exports['index']=function(_0x2edef9,_0x80dfa6){var _0x3507e7={},_0x2b5149={},_0x4cd6c4={'count':0x0,'rows':[]};var _0x51565f=_['map'](db[_0xf93c('0x2f')][_0xf93c('0x30')],function(_0x3f8379){return{'name':_0x3f8379[_0xf93c('0x31')],'type':_0x3f8379['type'][_0xf93c('0x32')]};});_0x2b5149[_0xf93c('0x33')]=_[_0xf93c('0x34')](_0x51565f,_0xf93c('0x2e'));_0x2b5149['query']=_[_0xf93c('0x35')](_0x2edef9[_0xf93c('0x36')]);_0x2b5149[_0xf93c('0x37')]=_[_0xf93c('0x38')](_0x2b5149['model'],_0x2b5149[_0xf93c('0x36')]);_0x3507e7[_0xf93c('0x39')]=_['intersection'](_0x2b5149[_0xf93c('0x33')],qs['fields'](_0x2edef9[_0xf93c('0x36')][_0xf93c('0x3a')]));_0x3507e7['attributes']=_0x3507e7[_0xf93c('0x39')][_0xf93c('0x3b')]?_0x3507e7['attributes']:_0x2b5149[_0xf93c('0x33')];if(!_0x2edef9[_0xf93c('0x36')][_0xf93c('0x3c')](_0xf93c('0x3d'))){_0x3507e7[_0xf93c('0x25')]=qs[_0xf93c('0x25')](_0x2edef9[_0xf93c('0x36')]['limit']);_0x3507e7[_0xf93c('0x23')]=qs[_0xf93c('0x23')](_0x2edef9[_0xf93c('0x36')][_0xf93c('0x23')]);}_0x3507e7['order']=qs[_0xf93c('0x3e')](_0x2edef9[_0xf93c('0x36')][_0xf93c('0x3e')]);_0x3507e7['where']=qs[_0xf93c('0x37')](_['pick'](_0x2edef9[_0xf93c('0x36')],_0x2b5149[_0xf93c('0x37')]),_0x51565f);if(_0x2edef9[_0xf93c('0x36')]['filter']){_0x3507e7[_0xf93c('0x3f')]=_[_0xf93c('0x40')](_0x3507e7[_0xf93c('0x3f')],{'$or':_['map'](_0x51565f,function(_0x586680){if(_0x586680[_0xf93c('0x41')]!==_0xf93c('0x42')){var _0x5edb73={};_0x5edb73[_0x586680['name']]={'$like':'%'+_0x2edef9[_0xf93c('0x36')][_0xf93c('0x43')]+'%'};return _0x5edb73;}})});}_0x3507e7=_[_0xf93c('0x40')]({},_0x3507e7,_0x2edef9['options']);var _0x42cf68={'where':_0x3507e7[_0xf93c('0x3f')]};return db[_0xf93c('0x2f')][_0xf93c('0x26')](_0x42cf68)[_0xf93c('0x2b')](function(_0x477f54){_0x4cd6c4[_0xf93c('0x26')]=_0x477f54;if(_0x2edef9[_0xf93c('0x36')][_0xf93c('0x44')]){_0x3507e7[_0xf93c('0x45')]=[{'all':!![]}];}return db[_0xf93c('0x2f')][_0xf93c('0x46')](_0x3507e7);})[_0xf93c('0x2b')](function(_0x17af3f){_0x4cd6c4[_0xf93c('0x47')]=_0x17af3f;return _0x4cd6c4;})[_0xf93c('0x2b')](respondWithFilteredResult(_0x80dfa6,_0x3507e7))[_0xf93c('0x48')](handleError(_0x80dfa6,null));};exports[_0xf93c('0x49')]=function(_0x46551d,_0x18acb7){var _0x42176f={'raw':![],'where':{'id':_0x46551d[_0xf93c('0x4a')]['id']}},_0x1cd78c={};_0x1cd78c[_0xf93c('0x33')]=_['keys'](db[_0xf93c('0x2f')][_0xf93c('0x30')]);_0x1cd78c[_0xf93c('0x36')]=_[_0xf93c('0x35')](_0x46551d[_0xf93c('0x36')]);_0x1cd78c[_0xf93c('0x37')]=_[_0xf93c('0x38')](_0x1cd78c[_0xf93c('0x33')],_0x1cd78c[_0xf93c('0x36')]);_0x42176f[_0xf93c('0x39')]=_[_0xf93c('0x38')](_0x1cd78c[_0xf93c('0x33')],qs[_0xf93c('0x3a')](_0x46551d[_0xf93c('0x36')][_0xf93c('0x3a')]));_0x42176f[_0xf93c('0x39')]=_0x42176f['attributes'][_0xf93c('0x3b')]?_0x42176f['attributes']:_0x1cd78c[_0xf93c('0x33')];if(_0x46551d[_0xf93c('0x36')][_0xf93c('0x44')]){_0x42176f['include']=[{'all':!![]}];}_0x42176f=_[_0xf93c('0x40')]({},_0x42176f,_0x46551d[_0xf93c('0x4b')]);return db[_0xf93c('0x2f')]['find'](_0x42176f)[_0xf93c('0x2b')](handleEntityNotFound(_0x18acb7,null))['then'](respondWithResult(_0x18acb7,null))[_0xf93c('0x48')](handleError(_0x18acb7,null));};exports[_0xf93c('0x4c')]=function(_0x5673ac,_0x1546da){return db[_0xf93c('0x2f')][_0xf93c('0x4c')](_0x5673ac['body'],{})['then'](function(_0x9fefe9){var _0x3d32b0=_0x5673ac[_0xf93c('0x4d')][_0xf93c('0x4e')]({'plain':!![]});if(!_0x3d32b0)throw new Error(_0xf93c('0x4f'));if(_0x3d32b0['role']===_0xf93c('0x4d')){var _0x3e56e0=_0x9fefe9[_0xf93c('0x4e')]({'plain':!![]});var _0x2765d6='SquareProjects';return db[_0xf93c('0x50')]['find']({'where':{'name':_0x2765d6,'userProfileId':_0x3d32b0['userProfileId']},'raw':!![]})[_0xf93c('0x2b')](function(_0x345f6d){if(_0x345f6d&&_0x345f6d[_0xf93c('0x51')]===0x0){return db[_0xf93c('0x2d')]['create']({'name':_0x3e56e0[_0xf93c('0x2e')],'resourceId':_0x3e56e0['id'],'type':_0x345f6d[_0xf93c('0x2e')],'sectionId':_0x345f6d['id']},{})[_0xf93c('0x2b')](function(){return _0x9fefe9;});}else{return _0x9fefe9;}})[_0xf93c('0x48')](function(_0x4e71a8){logger['error'](_0xf93c('0x52'),_0x4e71a8);throw _0x4e71a8;});}return _0x9fefe9;})[_0xf93c('0x2b')](respondWithResult(_0x1546da,0xc9))[_0xf93c('0x48')](handleError(_0x1546da,null));};exports[_0xf93c('0x53')]=function(_0x271879,_0x463511){if(_0x271879[_0xf93c('0x54')]['id']){delete _0x271879[_0xf93c('0x54')]['id'];}return db[_0xf93c('0x2f')]['find']({'where':{'id':_0x271879[_0xf93c('0x4a')]['id']}})[_0xf93c('0x2b')](handleEntityNotFound(_0x463511,null))[_0xf93c('0x2b')](saveUpdates(_0x271879[_0xf93c('0x54')],null))[_0xf93c('0x2b')](respondWithResult(_0x463511,null))[_0xf93c('0x48')](handleError(_0x463511,null));};exports[_0xf93c('0x2a')]=function(_0x1ad9ee,_0x5c531f){return db[_0xf93c('0x2f')]['find']({'where':{'id':_0x1ad9ee[_0xf93c('0x4a')]['id']}})[_0xf93c('0x2b')](handleEntityNotFound(_0x5c531f,null))[_0xf93c('0x2b')](removeEntity(_0x5c531f,null))[_0xf93c('0x48')](handleError(_0x5c531f,null));};exports[_0xf93c('0x55')]=function(_0x38bbbf,_0x3089c8,_0x33b6f7){return db[_0xf93c('0x2f')][_0xf93c('0x56')]({'where':{'id':_0x38bbbf['params']['id']}})[_0xf93c('0x2b')](handleEntityNotFound(_0x3089c8,null))['then'](function(_0x307168){if(_0x307168){return _0x307168['addUsers'](_0x38bbbf[_0xf93c('0x54')][_0xf93c('0x57')],_[_0xf93c('0x58')](_0x38bbbf[_0xf93c('0x54')],[_0xf93c('0x57'),'id'])||{});}})['then'](respondWithResult(_0x3089c8,null))[_0xf93c('0x48')](handleError(_0x3089c8,null));};exports[_0xf93c('0x59')]=function(_0x1956cf,_0x425348,_0x42cea7){return db[_0xf93c('0x2f')][_0xf93c('0x56')]({'where':{'id':_0x1956cf[_0xf93c('0x4a')]['id']}})[_0xf93c('0x2b')](handleEntityNotFound(_0x425348,null))[_0xf93c('0x2b')](function(_0x21c827){if(_0x21c827){return _0x21c827[_0xf93c('0x59')](_0x1956cf[_0xf93c('0x36')][_0xf93c('0x57')])['then'](function(){if(_['isArray'](_0x1956cf[_0xf93c('0x36')]['ids'])){for(var _0x4e4cf5=0x0;_0x4e4cf5<_0x1956cf[_0xf93c('0x36')]['ids']['length'];_0x4e4cf5+=0x1){socket[_0xf93c('0x5a')](_0xf93c('0x5b'),{'UserId':Number(_0x1956cf[_0xf93c('0x36')]['ids'][_0x4e4cf5]),'SquareProjectId':Number(_0x1956cf[_0xf93c('0x4a')]['id'])});}}else{socket[_0xf93c('0x5a')](_0xf93c('0x5b'),{'UserId':Number(_0x1956cf['query'][_0xf93c('0x57')]),'SquareProjectId':Number(_0x1956cf[_0xf93c('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x425348,null))[_0xf93c('0x48')](handleError(_0x425348,null));};exports['getUsers']=function(_0xee1ee,_0xd9eb2a,_0x323694){var _0x5f3f7b={};var _0x220b57={};var _0x5078c7;var _0x554f52;return db[_0xf93c('0x2f')][_0xf93c('0x5c')]({'where':{'id':_0xee1ee[_0xf93c('0x4a')]['id']}})[_0xf93c('0x2b')](handleEntityNotFound(_0xd9eb2a,null))['then'](function(_0x4c861){if(_0x4c861){_0x5078c7=_0x4c861;_0x220b57[_0xf93c('0x33')]=_[_0xf93c('0x35')](db['User']['rawAttributes']);_0x220b57[_0xf93c('0x36')]=_[_0xf93c('0x35')](_0xee1ee['query']);_0x220b57[_0xf93c('0x37')]=_[_0xf93c('0x38')](_0x220b57[_0xf93c('0x33')],_0x220b57['query']);_0x5f3f7b['attributes']=_['intersection'](_0x220b57['model'],qs['fields'](_0xee1ee[_0xf93c('0x36')]['fields']));_0x5f3f7b[_0xf93c('0x39')]=_0x5f3f7b[_0xf93c('0x39')][_0xf93c('0x3b')]?_0x5f3f7b[_0xf93c('0x39')]:_0x220b57['model'];_0x5f3f7b['order']=qs[_0xf93c('0x3e')](_0xee1ee[_0xf93c('0x36')]['sort']);_0x5f3f7b[_0xf93c('0x3f')]=qs[_0xf93c('0x37')](_[_0xf93c('0x5d')](_0xee1ee['query'],_0x220b57[_0xf93c('0x37')]));if(_0xee1ee[_0xf93c('0x36')]['filter']){_0x5f3f7b[_0xf93c('0x3f')]=_['merge'](_0x5f3f7b[_0xf93c('0x3f')],{'$or':_[_0xf93c('0x34')](_0x5f3f7b['attributes'],function(_0x1fbe64){var _0x4f8000={};_0x4f8000[_0x1fbe64]={'$like':'%'+_0xee1ee[_0xf93c('0x36')]['filter']+'%'};return _0x4f8000;})});}_0x5f3f7b=_['merge']({},_0x5f3f7b,_0xee1ee[_0xf93c('0x4b')]);return _0x5078c7[_0xf93c('0x5e')](_0x5f3f7b);}})['then'](function(_0x2c7777){if(_0x2c7777){_0x554f52=_0x2c7777[_0xf93c('0x3b')];if(!_0xee1ee['query'][_0xf93c('0x3c')](_0xf93c('0x3d'))){_0x5f3f7b['limit']=qs[_0xf93c('0x25')](_0xee1ee[_0xf93c('0x36')]['limit']);_0x5f3f7b[_0xf93c('0x23')]=qs[_0xf93c('0x23')](_0xee1ee[_0xf93c('0x36')][_0xf93c('0x23')]);}return _0x5078c7['getUsers'](_0x5f3f7b);}})[_0xf93c('0x2b')](function(_0x5319b4){if(_0x5319b4){return _0x5319b4?{'count':_0x554f52,'rows':_0x5319b4}:null;}})['then'](respondWithResult(_0xd9eb2a,null))[_0xf93c('0x48')](handleError(_0xd9eb2a,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 2c79e7e..8ddf264 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 _0x9921=['SquareProject','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x9921,0xd6));var _0x1992=function(_0x5138e2,_0x53f9cf){_0x5138e2=_0x5138e2-0x0;var _0x3d0c0a=_0x9921[_0x5138e2];return _0x3d0c0a;};'use strict';var EventEmitter=require(_0x1992('0x0'));var SquareProject=require(_0x1992('0x1'))['db'][_0x1992('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1992('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1992('0x4'),'afterDestroy':_0x1992('0x5')};function emitEvent(_0x2c4111){return function(_0x1d6a02,_0x42d7de,_0x31c0f3){SquareProjectEvents[_0x1992('0x6')](_0x2c4111+':'+_0x1d6a02['id'],_0x1d6a02);SquareProjectEvents['emit'](_0x2c4111,_0x1d6a02);_0x31c0f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x1992('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x1fca=['remove','emit','hook','events','../../mysqldb','SquareProject','setMaxListeners','update'];(function(_0x2f15d5,_0x56e71d){var _0x33886a=function(_0x5717d6){while(--_0x5717d6){_0x2f15d5['push'](_0x2f15d5['shift']());}};_0x33886a(++_0x56e71d);}(_0x1fca,0x12b));var _0xa1fc=function(_0x307831,_0x508287){_0x307831=_0x307831-0x0;var _0x12ed17=_0x1fca[_0x307831];return _0x12ed17;};'use strict';var EventEmitter=require(_0xa1fc('0x0'));var SquareProject=require(_0xa1fc('0x1'))['db'][_0xa1fc('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa1fc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa1fc('0x4'),'afterDestroy':_0xa1fc('0x5')};function emitEvent(_0x3bf1d6){return function(_0x946aae,_0x4a86b4,_0x5b1c96){SquareProjectEvents[_0xa1fc('0x6')](_0x3bf1d6+':'+_0x946aae['id'],_0x946aae);SquareProjectEvents[_0xa1fc('0x6')](_0x3bf1d6,_0x946aae);_0x5b1c96(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xa1fc('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 6312abf..c71afef 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 _0xe7f0=['format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','preproduction','savedAt'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe7f0,0x183));var _0x0e7f=function(_0x885eff,_0x555809){_0x885eff=_0x885eff-0x0;var _0x17819f=_0xe7f0[_0x885eff];return _0x17819f;};'use strict';var _=require(_0x0e7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0e7f('0x1'));var moment=require(_0x0e7f('0x2'));var BPromise=require(_0x0e7f('0x3'));var rp=require(_0x0e7f('0x4'));var fs=require('fs');var path=require(_0x0e7f('0x5'));var rimraf=require(_0x0e7f('0x6'));var config=require(_0x0e7f('0x7'));var attributes=require(_0x0e7f('0x8'));module['exports']=function(_0x56e3f1,_0x47200b){return _0x56e3f1[_0x0e7f('0x9')](_0x0e7f('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23424a,_0x2a1d3b,_0x2b9a5c){if(_0x23424a['changed'](_0x0e7f('0xb'))){_0x23424a[_0x0e7f('0xc')]=moment()[_0x0e7f('0xd')](_0x0e7f('0xe'));}if(_0x23424a['changed']('production')){_0x23424a[_0x0e7f('0xf')]=moment()[_0x0e7f('0xd')](_0x0e7f('0xe'));}_0x2b9a5c(null,_0x23424a);}}});}; \ No newline at end of file +var _0x87f5=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0xb111ee,_0x2122b5){var _0x7e68a0=function(_0x27a220){while(--_0x27a220){_0xb111ee['push'](_0xb111ee['shift']());}};_0x7e68a0(++_0x2122b5);}(_0x87f5,0x1a2));var _0x587f=function(_0x338531,_0x182f11){_0x338531=_0x338531-0x0;var _0x1589c6=_0x87f5[_0x338531];return _0x1589c6;};'use strict';var _=require(_0x587f('0x0'));var util=require(_0x587f('0x1'));var logger=require(_0x587f('0x2'))(_0x587f('0x3'));var moment=require('moment');var BPromise=require(_0x587f('0x4'));var rp=require(_0x587f('0x5'));var fs=require('fs');var path=require(_0x587f('0x6'));var rimraf=require(_0x587f('0x7'));var config=require(_0x587f('0x8'));var attributes=require(_0x587f('0x9'));module[_0x587f('0xa')]=function(_0x1ee7b1,_0x48ee3c){return _0x1ee7b1[_0x587f('0xb')](_0x587f('0xc'),attributes,{'tableName':_0x587f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb4695c,_0x1b5093,_0x353af6){if(_0xb4695c[_0x587f('0xe')](_0x587f('0xf'))){_0xb4695c[_0x587f('0x10')]=moment()[_0x587f('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xb4695c[_0x587f('0xe')](_0x587f('0x12'))){_0xb4695c[_0x587f('0x13')]=moment()[_0x587f('0x11')](_0x587f('0x14'));}_0x353af6(null,_0xb4695c);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 2b9e66d..8ec3f85 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 _0x2e41=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','SquareProject,\x20%s,\x20%s','message','catch','ShowSquareProject','SquareProject','options','raw','attributes','include','model','map','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5109a6,_0x305507){var _0x4b9cd5=function(_0x47d104){while(--_0x47d104){_0x5109a6['push'](_0x5109a6['shift']());}};_0x4b9cd5(++_0x305507);}(_0x2e41,0xa4));var _0x12e4=function(_0x21ba22,_0x38908f){_0x21ba22=_0x21ba22-0x0;var _0x997b34=_0x2e41[_0x21ba22];return _0x997b34;};'use strict';var _=require(_0x12e4('0x0'));var util=require(_0x12e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12e4('0x2'));var fs=require('fs');var Redis=require(_0x12e4('0x3'));var db=require(_0x12e4('0x4'))['db'];var utils=require(_0x12e4('0x5'));var logger=require(_0x12e4('0x6'))(_0x12e4('0x7'));var config=require(_0x12e4('0x8'));var jayson=require(_0x12e4('0x9'));var client=jayson[_0x12e4('0xa')][_0x12e4('0xb')]({'port':0x232a});config['redis']=_[_0x12e4('0xc')](config[_0x12e4('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12e4('0xd')]));require('./squareProject.socket')[_0x12e4('0xe')](socket);function respondWithRpcPromise(_0x39f724,_0x3114e1,_0x36ceee){return new BPromise(function(_0x24773c,_0x32d913){return client[_0x12e4('0xf')](_0x39f724,_0x36ceee)[_0x12e4('0x10')](function(_0xdb9707){logger[_0x12e4('0x11')]('SquareProject,\x20%s,\x20%s',_0x3114e1,_0x12e4('0x12'));logger[_0x12e4('0x13')](_0x12e4('0x14'),_0x3114e1,_0x12e4('0x12'),JSON[_0x12e4('0x15')](_0xdb9707));if(_0xdb9707['error']){if(_0xdb9707[_0x12e4('0x16')]['code']===0x1f4){logger[_0x12e4('0x16')](_0x12e4('0x17'),_0x3114e1,_0xdb9707[_0x12e4('0x16')]['message']);return _0x32d913(_0xdb9707[_0x12e4('0x16')]['message']);}logger[_0x12e4('0x16')](_0x12e4('0x17'),_0x3114e1,_0xdb9707['error'][_0x12e4('0x18')]);return _0x24773c(_0xdb9707[_0x12e4('0x16')][_0x12e4('0x18')]);}else{logger['info'](_0x12e4('0x17'),_0x3114e1,_0x12e4('0x12'));_0x24773c(_0xdb9707['result'][_0x12e4('0x18')]);}})[_0x12e4('0x19')](function(_0x5e1221){logger[_0x12e4('0x16')]('SquareProject,\x20%s,\x20%s',_0x3114e1,_0x5e1221);_0x32d913(_0x5e1221);});});}exports[_0x12e4('0x1a')]=function(_0x3529be){var _0x1df21e=this;return new Promise(function(_0x3d092a,_0x2e05e8){return db[_0x12e4('0x1b')]['find']({'raw':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1d')]===undefined?!![]:![]:!![],'where':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')]['where']||null:null,'attributes':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1e')]||null:null,'include':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1f')]?_['map'](_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1f')],function(_0xca6409){return{'model':db[_0xca6409[_0x12e4('0x20')]],'as':_0xca6409['as'],'attributes':_0xca6409['attributes'],'include':_0xca6409['include']?_[_0x12e4('0x21')](_0xca6409[_0x12e4('0x1f')],function(_0x10daa7){return{'model':db[_0x10daa7['model']],'as':_0x10daa7['as'],'attributes':_0x10daa7[_0x12e4('0x1e')],'include':_0x10daa7['include']?_[_0x12e4('0x21')](_0x10daa7['include'],function(_0x7c48be){return{'model':db[_0x7c48be[_0x12e4('0x20')]],'as':_0x7c48be['as'],'attributes':_0x7c48be[_0x12e4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x12e4('0x10')](function(_0x2ab7d4){logger[_0x12e4('0x11')]('ShowSquareProject',_0x3529be);logger[_0x12e4('0x13')](_0x12e4('0x1a'),_0x3529be,JSON[_0x12e4('0x15')](_0x2ab7d4));_0x3d092a(_0x2ab7d4);})[_0x12e4('0x19')](function(_0x49e647){logger[_0x12e4('0x16')](_0x12e4('0x1a'),_0x49e647[_0x12e4('0x18')],_0x3529be);_0x2e05e8(_0x1df21e[_0x12e4('0x16')](0x1f4,_0x49e647[_0x12e4('0x18')]));});});}; \ No newline at end of file +var _0xed68=['ShowSquareProject','SquareProject','find','options','raw','where','include','attributes','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','debug','request\x20sent','error','code','SquareProject,\x20%s,\x20%s','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed68,0x1ae));var _0x8ed6=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xed68[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require('lodash');var util=require(_0x8ed6('0x0'));var moment=require(_0x8ed6('0x1'));var BPromise=require(_0x8ed6('0x2'));var rs=require(_0x8ed6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ed6('0x4'))['db'];var utils=require(_0x8ed6('0x5'));var logger=require(_0x8ed6('0x6'))('rpc');var config=require(_0x8ed6('0x7'));var jayson=require(_0x8ed6('0x8'));var client=jayson[_0x8ed6('0x9')][_0x8ed6('0xa')]({'port':0x232a});config[_0x8ed6('0xb')]=_[_0x8ed6('0xc')](config[_0x8ed6('0xb')],{'host':_0x8ed6('0xd'),'port':0x18eb});var socket=require(_0x8ed6('0xe'))(new Redis(config[_0x8ed6('0xb')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x36353b,_0x2ac738,_0x94dbc){return new BPromise(function(_0x5d7701,_0x32a1da){return client['request'](_0x36353b,_0x94dbc)[_0x8ed6('0xf')](function(_0x3316f3){logger[_0x8ed6('0x10')]('SquareProject,\x20%s,\x20%s',_0x2ac738,'request\x20sent');logger[_0x8ed6('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x2ac738,_0x8ed6('0x12'),JSON['stringify'](_0x3316f3));if(_0x3316f3[_0x8ed6('0x13')]){if(_0x3316f3['error'][_0x8ed6('0x14')]===0x1f4){logger[_0x8ed6('0x13')](_0x8ed6('0x15'),_0x2ac738,_0x3316f3[_0x8ed6('0x13')]['message']);return _0x32a1da(_0x3316f3[_0x8ed6('0x13')][_0x8ed6('0x16')]);}logger['error']('SquareProject,\x20%s,\x20%s',_0x2ac738,_0x3316f3[_0x8ed6('0x13')]['message']);return _0x5d7701(_0x3316f3[_0x8ed6('0x13')][_0x8ed6('0x16')]);}else{logger[_0x8ed6('0x10')]('SquareProject,\x20%s,\x20%s',_0x2ac738,_0x8ed6('0x12'));_0x5d7701(_0x3316f3[_0x8ed6('0x17')][_0x8ed6('0x16')]);}})[_0x8ed6('0x18')](function(_0x55fd35){logger[_0x8ed6('0x13')](_0x8ed6('0x15'),_0x2ac738,_0x55fd35);_0x32a1da(_0x55fd35);});});}exports[_0x8ed6('0x19')]=function(_0x85832){var _0x3bdde1=this;return new Promise(function(_0x2a15e6,_0x272813){return db[_0x8ed6('0x1a')][_0x8ed6('0x1b')]({'raw':_0x85832[_0x8ed6('0x1c')]?_0x85832['options'][_0x8ed6('0x1d')]===undefined?!![]:![]:!![],'where':_0x85832['options']?_0x85832['options'][_0x8ed6('0x1e')]||null:null,'attributes':_0x85832[_0x8ed6('0x1c')]?_0x85832[_0x8ed6('0x1c')]['attributes']||null:null,'include':_0x85832[_0x8ed6('0x1c')]?_0x85832['options'][_0x8ed6('0x1f')]?_['map'](_0x85832[_0x8ed6('0x1c')]['include'],function(_0x1de963){return{'model':db[_0x1de963['model']],'as':_0x1de963['as'],'attributes':_0x1de963[_0x8ed6('0x20')],'include':_0x1de963['include']?_[_0x8ed6('0x21')](_0x1de963['include'],function(_0x1288a1){return{'model':db[_0x1288a1[_0x8ed6('0x22')]],'as':_0x1288a1['as'],'attributes':_0x1288a1[_0x8ed6('0x20')],'include':_0x1288a1[_0x8ed6('0x1f')]?_[_0x8ed6('0x21')](_0x1288a1['include'],function(_0x410210){return{'model':db[_0x410210[_0x8ed6('0x22')]],'as':_0x410210['as'],'attributes':_0x410210['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ed6('0xf')](function(_0x192ebc){logger['info'](_0x8ed6('0x19'),_0x85832);logger[_0x8ed6('0x11')]('ShowSquareProject',_0x85832,JSON['stringify'](_0x192ebc));_0x2a15e6(_0x192ebc);})[_0x8ed6('0x18')](function(_0x3ec603){logger[_0x8ed6('0x13')]('ShowSquareProject',_0x3ec603[_0x8ed6('0x16')],_0x85832);_0x272813(_0x3bdde1[_0x8ed6('0x13')](0x1f4,_0x3ec603['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 20eaa2a..42c8f00 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 _0x92d2=['register','squareProject:','./squareProject.events','save','remove','update','emit','removeListener'];(function(_0xce4767,_0x1207af){var _0x10f033=function(_0x1c0071){while(--_0x1c0071){_0xce4767['push'](_0xce4767['shift']());}};_0x10f033(++_0x1207af);}(_0x92d2,0xb2));var _0x292d=function(_0x4b8daa,_0x5e911f){_0x4b8daa=_0x4b8daa-0x0;var _0x333ada=_0x92d2[_0x4b8daa];return _0x333ada;};'use strict';var SquareProjectEvents=require(_0x292d('0x0'));var events=[_0x292d('0x1'),_0x292d('0x2'),_0x292d('0x3')];function createListener(_0x319c87,_0x1479d6){return function(_0x4da890){_0x1479d6[_0x292d('0x4')](_0x319c87,_0x4da890);};}function removeListener(_0x467888,_0x3502ca){return function(){SquareProjectEvents[_0x292d('0x5')](_0x467888,_0x3502ca);};}exports[_0x292d('0x6')]=function(_0x565cc0){for(var _0x882574=0x0,_0xbaf91e=events['length'];_0x882574<_0xbaf91e;_0x882574++){var _0x212ab1=events[_0x882574];var _0xd724fe=createListener(_0x292d('0x7')+_0x212ab1,_0x565cc0);SquareProjectEvents['on'](_0x212ab1,_0xd724fe);}}; \ No newline at end of file +var _0xad44=['save','remove','emit','removeListener','register','length','./squareProject.events'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xad44,0xf4));var _0x4ad4=function(_0x4a5635,_0x443b90){_0x4a5635=_0x4a5635-0x0;var _0x18d602=_0xad44[_0x4a5635];return _0x18d602;};'use strict';var SquareProjectEvents=require(_0x4ad4('0x0'));var events=[_0x4ad4('0x1'),_0x4ad4('0x2'),'update'];function createListener(_0x28d53f,_0x2aa704){return function(_0x132dfa){_0x2aa704[_0x4ad4('0x3')](_0x28d53f,_0x132dfa);};}function removeListener(_0x6a76c9,_0x40b60e){return function(){SquareProjectEvents[_0x4ad4('0x4')](_0x6a76c9,_0x40b60e);};}exports[_0x4ad4('0x5')]=function(_0x42d276){for(var _0x4a7aaf=0x0,_0x58050b=events[_0x4ad4('0x6')];_0x4a7aaf<_0x58050b;_0x4a7aaf++){var _0x520f4e=events[_0x4a7aaf];var _0x306646=createListener('squareProject:'+_0x520f4e,_0x42d276);SquareProjectEvents['on'](_0x520f4e,_0x306646);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e28ed7a..2a2f22a 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 _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x48b3db,_0x365325){var _0x386f4c=function(_0x10044b){while(--_0x10044b){_0x48b3db['push'](_0x48b3db['shift']());}};_0x386f4c(++_0x365325);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0xf72ec6,_0x3252b9){var _0x138500=function(_0x14b199){while(--_0x14b199){_0xf72ec6['push'](_0xf72ec6['shift']());}};_0x138500(++_0x3252b9);}(_0x5fab,0x177));var _0xb5fa=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x5fab[_0x4d8789];return _0x404e41;};'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['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index b17f82d..c26eac6 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 _0x2675=['getDataValue','savePath','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x392890,_0xb8d3dd){var _0x2b2e30=function(_0x4b355f){while(--_0x4b355f){_0x392890['push'](_0x392890['shift']());}};_0x2b2e30(++_0xb8d3dd);}(_0x2675,0x75));var _0x5267=function(_0x24a55a,_0x2772f2){_0x24a55a=_0x24a55a-0x0;var _0x53c78b=_0x2675[_0x24a55a];return _0x53c78b;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5267('0x1')]},'context':{'type':Sequelize[_0x5267('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5267('0x1')]},'accountcode':{'type':Sequelize[_0x5267('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5267('0x1')]},'saveName':{'type':Sequelize[_0x5267('0x1')]},'filename':{'type':Sequelize[_0x5267('0x1')]},'savePath':{'type':Sequelize[_0x5267('0x1')]},'format':{'type':Sequelize[_0x5267('0x2')],'get':function(){var _0xc56cd5='';var _0x527c16=this[_0x5267('0x3')](_0x5267('0x4'));if(_0x527c16){_0xc56cd5=_0x527c16['substring'](_0x527c16[_0x5267('0x5')]('.'));}return _0xc56cd5;}}}; \ No newline at end of file +var _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d17,0x17e));var _0x72d1=function(_0x5e3edf,_0x38daaf){_0x5e3edf=_0x5e3edf-0x0;var _0x569f76=_0x2d17[_0x5e3edf];return _0x569f76;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index d5c4215..919da44 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 _0x1b25=['stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','create','body','download','../../components/encryptor','uniqueid','find','savePath','%s.cypher','decryptFile','recording','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error'];(function(_0x27f323,_0x2d6212){var _0x557b7b=function(_0x51f28c){while(--_0x51f28c){_0x27f323['push'](_0x27f323['shift']());}};_0x557b7b(++_0x2d6212);}(_0x1b25,0x142));var _0x51b2=function(_0x353f52,_0xe40124){_0x353f52=_0x353f52-0x0;var _0x44e3ec=_0x1b25[_0x353f52];return _0x44e3ec;};'use strict';var emlformat=require(_0x51b2('0x0'));var rimraf=require(_0x51b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51b2('0x2'));var rp=require(_0x51b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51b2('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x51b2('0x5'));var ejs=require(_0x51b2('0x6'));var fs=require('fs');var fs_extra=require(_0x51b2('0x7'));var _=require(_0x51b2('0x8'));var squel=require(_0x51b2('0x9'));var crypto=require(_0x51b2('0xa'));var jsforce=require(_0x51b2('0xb'));var deskjs=require(_0x51b2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x51b2('0xd'));var Papa=require(_0x51b2('0xe'));var Redis=require(_0x51b2('0xf'));var authService=require(_0x51b2('0x10'));var qs=require(_0x51b2('0x11'));var as=require(_0x51b2('0x12'));var hardwareService=require(_0x51b2('0x13'));var logger=require(_0x51b2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x51b2('0x15'));var licenseUtil=require(_0x51b2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13cbb3,_0x1a32ae){_0x1a32ae=_0x1a32ae||0xcc;return function(_0x3d5ed1){if(_0x3d5ed1){return _0x13cbb3[_0x51b2('0x17')](_0x1a32ae);}return _0x13cbb3[_0x51b2('0x18')](_0x1a32ae)[_0x51b2('0x19')]();};}function respondWithResult(_0x4ff00e,_0x4fa509){_0x4fa509=_0x4fa509||0xc8;return function(_0x4a0d2f){if(_0x4a0d2f){return _0x4ff00e[_0x51b2('0x18')](_0x4fa509)[_0x51b2('0x1a')](_0x4a0d2f);}};}function respondWithFilteredResult(_0x25ff5c,_0x3cefc5){return function(_0x5b3aeb){if(_0x5b3aeb){var _0x59cc8a=typeof _0x3cefc5[_0x51b2('0x1b')]===_0x51b2('0x1c')&&typeof _0x3cefc5[_0x51b2('0x1d')]===_0x51b2('0x1c');var _0x11912c=_0x5b3aeb[_0x51b2('0x1e')];var _0x60a3a6=_0x59cc8a?0x0:_0x3cefc5[_0x51b2('0x1b')];var _0x1ebffa=_0x59cc8a?_0x5b3aeb[_0x51b2('0x1e')]:_0x3cefc5[_0x51b2('0x1b')]+_0x3cefc5[_0x51b2('0x1d')];var _0x3a43ac;if(_0x1ebffa>=_0x11912c){_0x1ebffa=_0x11912c;_0x3a43ac=0xc8;}else{_0x3a43ac=0xce;}_0x25ff5c[_0x51b2('0x18')](_0x3a43ac);return _0x25ff5c[_0x51b2('0x1f')](_0x51b2('0x20'),_0x60a3a6+'-'+_0x1ebffa+'/'+_0x11912c)[_0x51b2('0x1a')](_0x5b3aeb);}return null;};}function patchUpdates(_0x52d126){return function(_0x284764){try{jsonpatch['apply'](_0x284764,_0x52d126,!![]);}catch(_0xdb54da){return BPromise['reject'](_0xdb54da);}return _0x284764[_0x51b2('0x21')]();};}function saveUpdates(_0x54b03b,_0x5b9268){return function(_0x4dd0a8){if(_0x4dd0a8){return _0x4dd0a8[_0x51b2('0x22')](_0x54b03b)[_0x51b2('0x23')](function(_0x52bc7e){return _0x52bc7e;});}return null;};}function removeEntity(_0x1e50d6,_0x57ee98){return function(_0x29778e){if(_0x29778e){return _0x29778e[_0x51b2('0x24')]()['then'](function(){_0x1e50d6[_0x51b2('0x18')](0xcc)[_0x51b2('0x19')]();});}};}function handleEntityNotFound(_0x1dcd9d,_0x165bdd){return function(_0x4d0276){if(!_0x4d0276){_0x1dcd9d[_0x51b2('0x17')](0x194);}return _0x4d0276;};}function handleError(_0xf18587,_0x629c32){_0x629c32=_0x629c32||0x1f4;return function(_0x5833db){logger[_0x51b2('0x25')](_0x5833db[_0x51b2('0x26')]);if(_0x5833db[_0x51b2('0x27')]){delete _0x5833db[_0x51b2('0x27')];}_0xf18587[_0x51b2('0x18')](_0x629c32)[_0x51b2('0x28')](_0x5833db);};}exports['index']=function(_0x2305cd,_0x2afae4){var _0xa75a8={},_0x1a6c48={},_0x139393={'count':0x0,'rows':[]};var _0xd68fc7=_[_0x51b2('0x29')](db[_0x51b2('0x2a')][_0x51b2('0x2b')],function(_0x2a533a){return{'name':_0x2a533a[_0x51b2('0x2c')],'type':_0x2a533a[_0x51b2('0x2d')]['key']};});_0x1a6c48[_0x51b2('0x2e')]=_[_0x51b2('0x29')](_0xd68fc7,'name');_0x1a6c48[_0x51b2('0x2f')]=_[_0x51b2('0x30')](_0x2305cd[_0x51b2('0x2f')]);_0x1a6c48[_0x51b2('0x31')]=_[_0x51b2('0x32')](_0x1a6c48[_0x51b2('0x2e')],_0x1a6c48['query']);_0xa75a8[_0x51b2('0x33')]=_['intersection'](_0x1a6c48[_0x51b2('0x2e')],qs[_0x51b2('0x34')](_0x2305cd[_0x51b2('0x2f')]['fields']));_0xa75a8[_0x51b2('0x33')]=_0xa75a8['attributes'][_0x51b2('0x35')]?_0xa75a8[_0x51b2('0x33')]:_0x1a6c48[_0x51b2('0x2e')];if(!_0x2305cd[_0x51b2('0x2f')][_0x51b2('0x36')]('nolimit')){_0xa75a8[_0x51b2('0x1d')]=qs['limit'](_0x2305cd[_0x51b2('0x2f')][_0x51b2('0x1d')]);_0xa75a8[_0x51b2('0x1b')]=qs[_0x51b2('0x1b')](_0x2305cd['query'][_0x51b2('0x1b')]);}_0xa75a8['order']=qs[_0x51b2('0x37')](_0x2305cd[_0x51b2('0x2f')]['sort']);_0xa75a8[_0x51b2('0x38')]=qs['filters'](_['pick'](_0x2305cd[_0x51b2('0x2f')],_0x1a6c48['filters']),_0xd68fc7);if(_0x2305cd[_0x51b2('0x2f')]['filter']){_0xa75a8[_0x51b2('0x38')]=_[_0x51b2('0x39')](_0xa75a8[_0x51b2('0x38')],{'$or':_[_0x51b2('0x29')](_0xd68fc7,function(_0x4d25fa){if(_0x4d25fa[_0x51b2('0x2d')]!==_0x51b2('0x3a')){var _0x835c12={};_0x835c12[_0x4d25fa[_0x51b2('0x27')]]={'$like':'%'+_0x2305cd['query'][_0x51b2('0x3b')]+'%'};return _0x835c12;}})});}_0xa75a8=_[_0x51b2('0x39')]({},_0xa75a8,_0x2305cd['options']);var _0x50eb32={'where':_0xa75a8[_0x51b2('0x38')]};return db[_0x51b2('0x2a')]['count'](_0x50eb32)[_0x51b2('0x23')](function(_0x4df5d3){_0x139393[_0x51b2('0x1e')]=_0x4df5d3;if(_0x2305cd[_0x51b2('0x2f')][_0x51b2('0x3c')]){_0xa75a8[_0x51b2('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0x51b2('0x3e')](_0xa75a8);})[_0x51b2('0x23')](function(_0xad3907){_0x139393[_0x51b2('0x3f')]=_0xad3907;return _0x139393;})[_0x51b2('0x23')](respondWithFilteredResult(_0x2afae4,_0xa75a8))[_0x51b2('0x40')](handleError(_0x2afae4,null));};exports[_0x51b2('0x41')]=function(_0x4dedf0,_0x35d71b){var _0x461b9e={'raw':!![],'where':{'id':_0x4dedf0[_0x51b2('0x42')]['id']}},_0x315fc3={};_0x315fc3[_0x51b2('0x2e')]=_[_0x51b2('0x30')](db[_0x51b2('0x2a')]['rawAttributes']);_0x315fc3[_0x51b2('0x2f')]=_[_0x51b2('0x30')](_0x4dedf0[_0x51b2('0x2f')]);_0x315fc3[_0x51b2('0x31')]=_[_0x51b2('0x32')](_0x315fc3[_0x51b2('0x2e')],_0x315fc3[_0x51b2('0x2f')]);_0x461b9e[_0x51b2('0x33')]=_[_0x51b2('0x32')](_0x315fc3[_0x51b2('0x2e')],qs[_0x51b2('0x34')](_0x4dedf0['query'][_0x51b2('0x34')]));_0x461b9e[_0x51b2('0x33')]=_0x461b9e[_0x51b2('0x33')][_0x51b2('0x35')]?_0x461b9e[_0x51b2('0x33')]:_0x315fc3[_0x51b2('0x2e')];if(_0x4dedf0[_0x51b2('0x2f')]['includeAll']){_0x461b9e[_0x51b2('0x3d')]=[{'all':!![]}];}_0x461b9e=_['merge']({},_0x461b9e,_0x4dedf0['options']);return db[_0x51b2('0x2a')]['find'](_0x461b9e)[_0x51b2('0x23')](handleEntityNotFound(_0x35d71b,null))[_0x51b2('0x23')](respondWithResult(_0x35d71b,null))[_0x51b2('0x40')](handleError(_0x35d71b,null));};exports[_0x51b2('0x43')]=function(_0x24a662,_0xb64234){return db['SquareRecording']['create'](_0x24a662[_0x51b2('0x44')],{})[_0x51b2('0x23')](respondWithResult(_0xb64234,0xc9))[_0x51b2('0x40')](handleError(_0xb64234,null));};exports[_0x51b2('0x22')]=function(_0xc3abf,_0x25d23d){if(_0xc3abf[_0x51b2('0x44')]['id']){delete _0xc3abf[_0x51b2('0x44')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0xc3abf['params']['id']}})['then'](handleEntityNotFound(_0x25d23d,null))['then'](saveUpdates(_0xc3abf['body'],null))[_0x51b2('0x23')](respondWithResult(_0x25d23d,null))[_0x51b2('0x40')](handleError(_0x25d23d,null));};exports[_0x51b2('0x45')]=function(_0x5dcecb,_0x1ea6b5,_0xf6a43b){var _0x10bff2=require(_0x51b2('0x46'));var _0x29e821=![];var _0x558d13={};if(_0x5dcecb[_0x51b2('0x2f')][_0x51b2('0x2d')]&&_0x5dcecb[_0x51b2('0x2f')]['type']===_0x51b2('0x47')){_0x558d13['uniqueid']=_0x5dcecb[_0x51b2('0x42')]['id'];}else{_0x558d13['id']=_0x5dcecb[_0x51b2('0x42')]['id'];}return db['SquareRecording'][_0x51b2('0x48')]({'where':_0x558d13,'attributes':['id',_0x51b2('0x49'),'filename'],'raw':!![]})[_0x51b2('0x23')](handleEntityNotFound(_0x1ea6b5,null))['then'](function(_0x460b73){if(_0x460b73){var _0x4bae44=_0x460b73['savePath'];var _0x1b9092=util['format'](_0x51b2('0x4a'),_0x4bae44);if(fs['existsSync'](_0x1b9092)){_0x29e821=!![];return _0x10bff2[_0x51b2('0x4b')](_0x1b9092,_0x4bae44,config['secrets'][_0x51b2('0x4c')])[_0x51b2('0x23')](function(){return _0x460b73;});}return _0x460b73;}})[_0x51b2('0x23')](function(_0x99ceb8){if(_0x99ceb8){var _0x92de07=_0x99ceb8[_0x51b2('0x49')];if(!fs['existsSync'](_0x92de07)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x99ceb8[_0x51b2('0x4d')]){return _0x1ea6b5['download'](_0x92de07,_0x99ceb8[_0x51b2('0x4d')]+path[_0x51b2('0x4e')](_0x92de07),function(){if(_0x29e821){fs[_0x51b2('0x4f')](_0x92de07);}});}else{return _0x1ea6b5[_0x51b2('0x45')](_0x92de07,function(_0x12700b){if(_0x29e821){fs['unlink'](_0x92de07);}});}}})[_0x51b2('0x40')](function(_0x313443){if(_0x313443[_0x51b2('0x50')]==='SquareRecording\x20not\x20found'){_0x1ea6b5['status'](0x194)[_0x51b2('0x28')](_0x51b2('0x51'));}else{return handleError(_0x1ea6b5,null);}});};exports['destroy']=function(_0x229663,_0x305a6c){return db['SquareRecording'][_0x51b2('0x48')]({'where':{'id':_0x229663[_0x51b2('0x42')]['id']}})['then'](function(_0x3764bd){if(_[_0x51b2('0x52')](_0x3764bd)){throw new ReferenceError(_0x51b2('0x53'));}return _0x3764bd;})[_0x51b2('0x23')](function(_0x7e0310){var _0x2c0b93=_0x7e0310[_0x51b2('0x49')];logger[_0x51b2('0x54')](_0x51b2('0x55'),_0x2c0b93);if(!_['isNil'](_0x7e0310[_0x51b2('0x49')])&&fs[_0x51b2('0x56')](_0x2c0b93)){logger[_0x51b2('0x54')]('File:\x20\x22'+_0x2c0b93+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x51b2('0x57')](_0x2c0b93);}_0x2c0b93=_0x2c0b93+_0x51b2('0x58');if(!_[_0x51b2('0x52')](_0x7e0310[_0x51b2('0x49')])&&fs[_0x51b2('0x56')](_0x2c0b93)){logger[_0x51b2('0x54')]('File:\x20\x22'+_0x2c0b93+_0x51b2('0x59'));fs[_0x51b2('0x57')](_0x2c0b93);}return _0x7e0310;})[_0x51b2('0x23')](function(_0x306c42){if(!_0x306c42)throw new InternalError();return _0x306c42['destroy']();})[_0x51b2('0x23')](function(){_0x305a6c['status'](0xcc)[_0x51b2('0x19')]();})[_0x51b2('0x40')](handleError(_0x305a6c,null));}; \ No newline at end of file +var _0x4a02=['keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','download','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','ValidationError','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type'];(function(_0x54098b,_0xad584a){var _0x19dd1c=function(_0x3e306d){while(--_0x3e306d){_0x54098b['push'](_0x54098b['shift']());}};_0x19dd1c(++_0xad584a);}(_0x4a02,0x146));var _0x24a0=function(_0x43760a,_0x4b0e9a){_0x43760a=_0x43760a-0x0;var _0x51c511=_0x4a02[_0x43760a];return _0x51c511;};'use strict';var emlformat=require(_0x24a0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x24a0('0x1'));var rp=require(_0x24a0('0x2'));var moment=require(_0x24a0('0x3'));var BPromise=require(_0x24a0('0x4'));var Mustache=require(_0x24a0('0x5'));var util=require(_0x24a0('0x6'));var path=require('path');var sox=require(_0x24a0('0x7'));var csv=require(_0x24a0('0x8'));var ejs=require(_0x24a0('0x9'));var fs=require('fs');var fs_extra=require(_0x24a0('0xa'));var _=require(_0x24a0('0xb'));var squel=require(_0x24a0('0xc'));var crypto=require('crypto');var jsforce=require(_0x24a0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x24a0('0xe'));var Papa=require(_0x24a0('0xf'));var Redis=require(_0x24a0('0x10'));var authService=require(_0x24a0('0x11'));var qs=require(_0x24a0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x24a0('0x13'))(_0x24a0('0x14'));var utils=require(_0x24a0('0x15'));var config=require(_0x24a0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x24a0('0x17'))['db'];function respondWithStatusCode(_0x47a2e1,_0x10cf85){_0x10cf85=_0x10cf85||0xcc;return function(_0x37992f){if(_0x37992f){return _0x47a2e1['sendStatus'](_0x10cf85);}return _0x47a2e1[_0x24a0('0x18')](_0x10cf85)[_0x24a0('0x19')]();};}function respondWithResult(_0x2669fe,_0x770773){_0x770773=_0x770773||0xc8;return function(_0x22d7c7){if(_0x22d7c7){return _0x2669fe[_0x24a0('0x18')](_0x770773)[_0x24a0('0x1a')](_0x22d7c7);}};}function respondWithFilteredResult(_0x153fcd,_0x318450){return function(_0x596ee7){if(_0x596ee7){var _0x224d88=typeof _0x318450[_0x24a0('0x1b')]===_0x24a0('0x1c')&&typeof _0x318450[_0x24a0('0x1d')]===_0x24a0('0x1c');var _0x414c80=_0x596ee7[_0x24a0('0x1e')];var _0x53901b=_0x224d88?0x0:_0x318450['offset'];var _0x2b36d2=_0x224d88?_0x596ee7[_0x24a0('0x1e')]:_0x318450[_0x24a0('0x1b')]+_0x318450[_0x24a0('0x1d')];var _0x5a5b4;if(_0x2b36d2>=_0x414c80){_0x2b36d2=_0x414c80;_0x5a5b4=0xc8;}else{_0x5a5b4=0xce;}_0x153fcd[_0x24a0('0x18')](_0x5a5b4);return _0x153fcd['set'](_0x24a0('0x1f'),_0x53901b+'-'+_0x2b36d2+'/'+_0x414c80)[_0x24a0('0x1a')](_0x596ee7);}return null;};}function patchUpdates(_0x3cec42){return function(_0x436919){try{jsonpatch['apply'](_0x436919,_0x3cec42,!![]);}catch(_0x107228){return BPromise[_0x24a0('0x20')](_0x107228);}return _0x436919[_0x24a0('0x21')]();};}function saveUpdates(_0x59f1e3,_0x39b08a){return function(_0x4a7e39){if(_0x4a7e39){return _0x4a7e39[_0x24a0('0x22')](_0x59f1e3)[_0x24a0('0x23')](function(_0x2ee732){return _0x2ee732;});}return null;};}function removeEntity(_0x2111c1,_0x2a9fae){return function(_0x4e16d0){if(_0x4e16d0){return _0x4e16d0['destroy']()[_0x24a0('0x23')](function(){_0x2111c1[_0x24a0('0x18')](0xcc)[_0x24a0('0x19')]();});}};}function handleEntityNotFound(_0x1ebd34,_0x49b238){return function(_0x1c5f67){if(!_0x1c5f67){_0x1ebd34['sendStatus'](0x194);}return _0x1c5f67;};}function handleError(_0x349b47,_0x349575){_0x349575=_0x349575||0x1f4;return function(_0x1010b1){logger[_0x24a0('0x24')](_0x1010b1[_0x24a0('0x25')]);if(_0x1010b1[_0x24a0('0x26')]){delete _0x1010b1[_0x24a0('0x26')];}_0x349b47['status'](_0x349575)[_0x24a0('0x27')](_0x1010b1);};}exports[_0x24a0('0x28')]=function(_0x6b3e4c,_0x5f513a){var _0x4be83f={},_0x355284={},_0x38b9b5={'count':0x0,'rows':[]};var _0x502c15=_[_0x24a0('0x29')](db[_0x24a0('0x2a')][_0x24a0('0x2b')],function(_0x56c742){return{'name':_0x56c742[_0x24a0('0x2c')],'type':_0x56c742[_0x24a0('0x2d')]['key']};});_0x355284['model']=_[_0x24a0('0x29')](_0x502c15,'name');_0x355284['query']=_[_0x24a0('0x2e')](_0x6b3e4c[_0x24a0('0x2f')]);_0x355284[_0x24a0('0x30')]=_[_0x24a0('0x31')](_0x355284[_0x24a0('0x32')],_0x355284['query']);_0x4be83f[_0x24a0('0x33')]=_[_0x24a0('0x31')](_0x355284['model'],qs[_0x24a0('0x34')](_0x6b3e4c['query']['fields']));_0x4be83f[_0x24a0('0x33')]=_0x4be83f[_0x24a0('0x33')][_0x24a0('0x35')]?_0x4be83f[_0x24a0('0x33')]:_0x355284[_0x24a0('0x32')];if(!_0x6b3e4c['query']['hasOwnProperty'](_0x24a0('0x36'))){_0x4be83f[_0x24a0('0x1d')]=qs['limit'](_0x6b3e4c['query'][_0x24a0('0x1d')]);_0x4be83f[_0x24a0('0x1b')]=qs['offset'](_0x6b3e4c[_0x24a0('0x2f')][_0x24a0('0x1b')]);}_0x4be83f['order']=qs['sort'](_0x6b3e4c[_0x24a0('0x2f')][_0x24a0('0x37')]);_0x4be83f[_0x24a0('0x38')]=qs[_0x24a0('0x30')](_[_0x24a0('0x39')](_0x6b3e4c[_0x24a0('0x2f')],_0x355284['filters']),_0x502c15);if(_0x6b3e4c[_0x24a0('0x2f')][_0x24a0('0x3a')]){_0x4be83f[_0x24a0('0x38')]=_[_0x24a0('0x3b')](_0x4be83f[_0x24a0('0x38')],{'$or':_[_0x24a0('0x29')](_0x502c15,function(_0x4b7154){if(_0x4b7154[_0x24a0('0x2d')]!==_0x24a0('0x3c')){var _0x21641e={};_0x21641e[_0x4b7154[_0x24a0('0x26')]]={'$like':'%'+_0x6b3e4c[_0x24a0('0x2f')][_0x24a0('0x3a')]+'%'};return _0x21641e;}})});}_0x4be83f=_[_0x24a0('0x3b')]({},_0x4be83f,_0x6b3e4c[_0x24a0('0x3d')]);var _0x50aac6={'where':_0x4be83f[_0x24a0('0x38')]};return db[_0x24a0('0x2a')][_0x24a0('0x1e')](_0x50aac6)[_0x24a0('0x23')](function(_0x2e80f2){_0x38b9b5['count']=_0x2e80f2;if(_0x6b3e4c['query'][_0x24a0('0x3e')]){_0x4be83f[_0x24a0('0x3f')]=[{'all':!![]}];}return db[_0x24a0('0x2a')][_0x24a0('0x40')](_0x4be83f);})['then'](function(_0x556836){_0x38b9b5[_0x24a0('0x41')]=_0x556836;return _0x38b9b5;})[_0x24a0('0x23')](respondWithFilteredResult(_0x5f513a,_0x4be83f))[_0x24a0('0x42')](handleError(_0x5f513a,null));};exports[_0x24a0('0x43')]=function(_0x215dd1,_0x197cc7){var _0x36ebaf={'raw':!![],'where':{'id':_0x215dd1[_0x24a0('0x44')]['id']}},_0xb06a3b={};_0xb06a3b[_0x24a0('0x32')]=_[_0x24a0('0x2e')](db[_0x24a0('0x2a')]['rawAttributes']);_0xb06a3b[_0x24a0('0x2f')]=_[_0x24a0('0x2e')](_0x215dd1[_0x24a0('0x2f')]);_0xb06a3b['filters']=_[_0x24a0('0x31')](_0xb06a3b[_0x24a0('0x32')],_0xb06a3b[_0x24a0('0x2f')]);_0x36ebaf[_0x24a0('0x33')]=_[_0x24a0('0x31')](_0xb06a3b['model'],qs[_0x24a0('0x34')](_0x215dd1['query'][_0x24a0('0x34')]));_0x36ebaf[_0x24a0('0x33')]=_0x36ebaf[_0x24a0('0x33')][_0x24a0('0x35')]?_0x36ebaf[_0x24a0('0x33')]:_0xb06a3b[_0x24a0('0x32')];if(_0x215dd1[_0x24a0('0x2f')][_0x24a0('0x3e')]){_0x36ebaf[_0x24a0('0x3f')]=[{'all':!![]}];}_0x36ebaf=_[_0x24a0('0x3b')]({},_0x36ebaf,_0x215dd1[_0x24a0('0x3d')]);return db['SquareRecording']['find'](_0x36ebaf)['then'](handleEntityNotFound(_0x197cc7,null))[_0x24a0('0x23')](respondWithResult(_0x197cc7,null))[_0x24a0('0x42')](handleError(_0x197cc7,null));};exports[_0x24a0('0x45')]=function(_0x1c4935,_0x3c17dc){return db['SquareRecording']['create'](_0x1c4935['body'],{})[_0x24a0('0x23')](respondWithResult(_0x3c17dc,0xc9))[_0x24a0('0x42')](handleError(_0x3c17dc,null));};exports[_0x24a0('0x22')]=function(_0x97a04b,_0x1a4e52){if(_0x97a04b[_0x24a0('0x46')]['id']){delete _0x97a04b[_0x24a0('0x46')]['id'];}return db['SquareRecording'][_0x24a0('0x47')]({'where':{'id':_0x97a04b[_0x24a0('0x44')]['id']}})[_0x24a0('0x23')](handleEntityNotFound(_0x1a4e52,null))['then'](saveUpdates(_0x97a04b['body'],null))[_0x24a0('0x23')](respondWithResult(_0x1a4e52,null))[_0x24a0('0x42')](handleError(_0x1a4e52,null));};exports[_0x24a0('0x48')]=function(_0x37f769,_0x290d5f,_0x4ea7cb){var _0x44c3bb=require('../../components/encryptor');var _0x49cbe8=![];var _0x282c9c={};if(_0x37f769[_0x24a0('0x2f')][_0x24a0('0x2d')]&&_0x37f769[_0x24a0('0x2f')]['type']===_0x24a0('0x49')){_0x282c9c[_0x24a0('0x49')]=_0x37f769[_0x24a0('0x44')]['id'];}else{_0x282c9c['id']=_0x37f769[_0x24a0('0x44')]['id'];}return db['SquareRecording'][_0x24a0('0x47')]({'where':_0x282c9c,'attributes':['id',_0x24a0('0x4a'),_0x24a0('0x4b')],'raw':!![]})[_0x24a0('0x23')](handleEntityNotFound(_0x290d5f,null))[_0x24a0('0x23')](function(_0x5efaf4){if(_0x5efaf4){var _0x3d1cbb=_0x5efaf4[_0x24a0('0x4a')];var _0x1b549f=util[_0x24a0('0x4c')]('%s.cypher',_0x3d1cbb);if(fs[_0x24a0('0x4d')](_0x1b549f)){_0x49cbe8=!![];return _0x44c3bb[_0x24a0('0x4e')](_0x1b549f,_0x3d1cbb,config[_0x24a0('0x4f')]['recording'])[_0x24a0('0x23')](function(){return _0x5efaf4;});}return _0x5efaf4;}})['then'](function(_0x50c489){if(_0x50c489){var _0x5da7f7=_0x50c489[_0x24a0('0x4a')];if(!fs[_0x24a0('0x4d')](_0x5da7f7)){throw new db['Sequelize'][(_0x24a0('0x50'))]('SquareRecording\x20not\x20found');}if(_0x50c489[_0x24a0('0x4b')]){return _0x290d5f[_0x24a0('0x48')](_0x5da7f7,_0x50c489[_0x24a0('0x4b')]+path[_0x24a0('0x51')](_0x5da7f7),function(){if(_0x49cbe8){fs[_0x24a0('0x52')](_0x5da7f7);}});}else{return _0x290d5f[_0x24a0('0x48')](_0x5da7f7,function(_0x57d626){if(_0x49cbe8){fs[_0x24a0('0x52')](_0x5da7f7);}});}}})[_0x24a0('0x42')](function(_0x12dfd4){if(_0x12dfd4['message']===_0x24a0('0x53')){_0x290d5f['status'](0x194)[_0x24a0('0x27')](_0x24a0('0x54'));}else{return handleError(_0x290d5f,null);}});};exports['destroy']=function(_0x483440,_0x35524a){return db['SquareRecording'][_0x24a0('0x47')]({'where':{'id':_0x483440[_0x24a0('0x44')]['id']}})[_0x24a0('0x23')](function(_0x3ad746){if(_[_0x24a0('0x55')](_0x3ad746)){throw new ReferenceError(_0x24a0('0x56'));}return _0x3ad746;})[_0x24a0('0x23')](function(_0x30701b){var _0x1f8ab0=_0x30701b[_0x24a0('0x4a')];logger[_0x24a0('0x57')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f8ab0);if(!_['isNil'](_0x30701b[_0x24a0('0x4a')])&&fs[_0x24a0('0x4d')](_0x1f8ab0)){logger[_0x24a0('0x57')]('File:\x20\x22'+_0x1f8ab0+_0x24a0('0x58'));fs['unlinkSync'](_0x1f8ab0);}_0x1f8ab0=_0x1f8ab0+_0x24a0('0x59');if(!_[_0x24a0('0x55')](_0x30701b[_0x24a0('0x4a')])&&fs['existsSync'](_0x1f8ab0)){logger['info'](_0x24a0('0x5a')+_0x1f8ab0+_0x24a0('0x58'));fs[_0x24a0('0x5b')](_0x1f8ab0);}return _0x30701b;})[_0x24a0('0x23')](function(_0x5acc14){if(!_0x5acc14)throw new InternalError();return _0x5acc14[_0x24a0('0x5c')]();})[_0x24a0('0x23')](function(){_0x35524a[_0x24a0('0x18')](0xcc)['end']();})[_0x24a0('0x42')](handleError(_0x35524a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index d5d5078..a1606d5 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 _0x29eb=['define','SquareRecording','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./squareRecording.attributes','exports'];(function(_0x2e79b4,_0x76a87a){var _0x54db59=function(_0x357864){while(--_0x357864){_0x2e79b4['push'](_0x2e79b4['shift']());}};_0x54db59(++_0x76a87a);}(_0x29eb,0x1c5));var _0xb29e=function(_0x1db653,_0x3a9940){_0x1db653=_0x1db653-0x0;var _0x156348=_0x29eb[_0x1db653];return _0x156348;};'use strict';var _=require(_0xb29e('0x0'));var util=require(_0xb29e('0x1'));var logger=require(_0xb29e('0x2'))('api');var moment=require(_0xb29e('0x3'));var BPromise=require(_0xb29e('0x4'));var rp=require(_0xb29e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb29e('0x6'));var config=require('../../config/environment');var attributes=require(_0xb29e('0x7'));module[_0xb29e('0x8')]=function(_0x3426f3,_0x2e216f){return _0x3426f3[_0xb29e('0x9')](_0xb29e('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66fa=['define','SquareRecording','square_recordings','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x66fa,0x117));var _0xa66f=function(_0x576904,_0xb7f223){_0x576904=_0x576904-0x0;var _0x328d4e=_0x66fa[_0x576904];return _0x328d4e;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 0e14189..9079e58 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 _0x734c=['stringify','error','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','body','options','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0x734c,0xc9));var _0xc734=function(_0x26eea5,_0x38ef17){_0x26eea5=_0x26eea5-0x0;var _0x533bde=_0x734c[_0x26eea5];return _0x533bde;};'use strict';var _=require(_0xc734('0x0'));var util=require('util');var moment=require(_0xc734('0x1'));var BPromise=require('bluebird');var rs=require(_0xc734('0x2'));var fs=require('fs');var Redis=require(_0xc734('0x3'));var db=require(_0xc734('0x4'))['db'];var utils=require(_0xc734('0x5'));var logger=require(_0xc734('0x6'))('rpc');var config=require(_0xc734('0x7'));var jayson=require(_0xc734('0x8'));var client=jayson[_0xc734('0x9')][_0xc734('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x65fba6,_0x51ecaf,_0x42bcda){return new BPromise(function(_0x3f659c,_0x22ba62){return client['request'](_0x65fba6,_0x42bcda)[_0xc734('0xb')](function(_0x14bd4d){logger[_0xc734('0xc')]('SquareRecording,\x20%s,\x20%s',_0x51ecaf,'request\x20sent');logger[_0xc734('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x51ecaf,_0xc734('0xe'),JSON[_0xc734('0xf')](_0x14bd4d));if(_0x14bd4d[_0xc734('0x10')]){if(_0x14bd4d[_0xc734('0x10')]['code']===0x1f4){logger[_0xc734('0x10')](_0xc734('0x11'),_0x51ecaf,_0x14bd4d[_0xc734('0x10')][_0xc734('0x12')]);return _0x22ba62(_0x14bd4d[_0xc734('0x10')][_0xc734('0x12')]);}logger[_0xc734('0x10')](_0xc734('0x11'),_0x51ecaf,_0x14bd4d[_0xc734('0x10')][_0xc734('0x12')]);return _0x3f659c(_0x14bd4d[_0xc734('0x10')]['message']);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x51ecaf,_0xc734('0xe'));_0x3f659c(_0x14bd4d[_0xc734('0x13')][_0xc734('0x12')]);}})['catch'](function(_0x27235e){logger[_0xc734('0x10')](_0xc734('0x11'),_0x51ecaf,_0x27235e);_0x22ba62(_0x27235e);});});}exports[_0xc734('0x14')]=function(_0x5c8f86){var _0x41576c=this;return new Promise(function(_0x3ac955,_0x16c876){return db[_0xc734('0x15')]['create'](_0x5c8f86[_0xc734('0x16')],{'raw':_0x5c8f86[_0xc734('0x17')]?_0x5c8f86['options']['raw']===undefined?!![]:![]:!![]})[_0xc734('0xb')](function(_0xcaaacb){logger[_0xc734('0xc')](_0xc734('0x14'),_0x5c8f86);logger[_0xc734('0xd')](_0xc734('0x14'),_0x5c8f86,JSON['stringify'](_0xcaaacb));_0x3ac955(_0xcaaacb);})['catch'](function(_0x2ab2b5){logger['error'](_0xc734('0x14'),_0x2ab2b5[_0xc734('0x12')],_0x5c8f86);_0x16c876(_0x41576c['error'](0x1f4,_0x2ab2b5[_0xc734('0x12')]));});});}; \ No newline at end of file +var _0x6014=['request\x20sent','result','CreateSquareRecording','SquareRecording','body','options','raw','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareRecording,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x24f14a,_0xbbe74b){var _0x1c555f=function(_0x4119cc){while(--_0x4119cc){_0x24f14a['push'](_0x24f14a['shift']());}};_0x1c555f(++_0xbbe74b);}(_0x6014,0x9e));var _0x4601=function(_0x65a0db,_0x55c5a0){_0x65a0db=_0x65a0db-0x0;var _0x987620=_0x6014[_0x65a0db];return _0x987620;};'use strict';var _=require('lodash');var util=require(_0x4601('0x0'));var moment=require('moment');var BPromise=require(_0x4601('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4601('0x2'));var db=require(_0x4601('0x3'))['db'];var utils=require(_0x4601('0x4'));var logger=require(_0x4601('0x5'))(_0x4601('0x6'));var config=require(_0x4601('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4601('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55ea2e,_0x2b9535,_0x7da7bb){return new BPromise(function(_0x97dc98,_0x32c508){return client[_0x4601('0x9')](_0x55ea2e,_0x7da7bb)[_0x4601('0xa')](function(_0x567c35){logger[_0x4601('0xb')](_0x4601('0xc'),_0x2b9535,'request\x20sent');logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2b9535,'request\x20sent',JSON[_0x4601('0xd')](_0x567c35));if(_0x567c35[_0x4601('0xe')]){if(_0x567c35[_0x4601('0xe')][_0x4601('0xf')]===0x1f4){logger[_0x4601('0xe')](_0x4601('0xc'),_0x2b9535,_0x567c35[_0x4601('0xe')][_0x4601('0x10')]);return _0x32c508(_0x567c35[_0x4601('0xe')][_0x4601('0x10')]);}logger[_0x4601('0xe')](_0x4601('0xc'),_0x2b9535,_0x567c35[_0x4601('0xe')]['message']);return _0x97dc98(_0x567c35[_0x4601('0xe')][_0x4601('0x10')]);}else{logger[_0x4601('0xb')](_0x4601('0xc'),_0x2b9535,_0x4601('0x11'));_0x97dc98(_0x567c35[_0x4601('0x12')][_0x4601('0x10')]);}})['catch'](function(_0x518eae){logger['error'](_0x4601('0xc'),_0x2b9535,_0x518eae);_0x32c508(_0x518eae);});});}exports[_0x4601('0x13')]=function(_0x48c64e){var _0xb675d6=this;return new Promise(function(_0x40ef9b,_0x3e3253){return db[_0x4601('0x14')]['create'](_0x48c64e[_0x4601('0x15')],{'raw':_0x48c64e[_0x4601('0x16')]?_0x48c64e['options'][_0x4601('0x17')]===undefined?!![]:![]:!![]})[_0x4601('0xa')](function(_0x258a1b){logger[_0x4601('0xb')](_0x4601('0x13'),_0x48c64e);logger['debug'](_0x4601('0x13'),_0x48c64e,JSON['stringify'](_0x258a1b));_0x40ef9b(_0x258a1b);})[_0x4601('0x18')](function(_0x1c4b37){logger[_0x4601('0xe')](_0x4601('0x13'),_0x1c4b37[_0x4601('0x10')],_0x48c64e);_0x3e3253(_0xb675d6[_0x4601('0xe')](0x1f4,_0x1c4b37['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b27d341..e1312fb 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x473764,_0x103f7a){var _0x249461=function(_0x1f19a8){while(--_0x1f19a8){_0x473764['push'](_0x473764['shift']());}};_0x249461(++_0x103f7a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x369c2e,_0x1749f1){var _0x2cf3b7=function(_0x58e54b){while(--_0x58e54b){_0x369c2e['push'](_0x369c2e['shift']());}};_0x2cf3b7(++_0x1749f1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index b7a2484..618f6ee 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 _0x098b=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x098b,0x6c));var _0xb098=function(_0x56659e,_0x54cb86){_0x56659e=_0x56659e-0x0;var _0x59c59e=_0x098b[_0x56659e];return _0x59c59e;};'use strict';var Sequelize=require(_0xb098('0x0'));module[_0xb098('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xb098('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb098('0x2')]},'uniqueid':{'type':Sequelize[_0xb098('0x2')]},'version':{'type':Sequelize[_0xb098('0x2')]},'callerid':{'type':Sequelize[_0xb098('0x2')]},'calleridname':{'type':Sequelize[_0xb098('0x2')]},'callingpres':{'type':Sequelize[_0xb098('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xb098('0x2')]},'callingtns':{'type':Sequelize[_0xb098('0x2')]},'dnid':{'type':Sequelize[_0xb098('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb098('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb098('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb098('0x2')]},'project_name':{'type':Sequelize[_0xb098('0x2')]},'joinAt':{'type':Sequelize[_0xb098('0x3')]},'leaveAt':{'type':Sequelize[_0xb098('0x3')]},'bot':{'type':Sequelize[_0xb098('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x223f=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x223f,0xd6));var _0xf223=function(_0x3aa891,_0x215f20){_0x3aa891=_0x3aa891-0x0;var _0x4e629b=_0x223f[_0x3aa891];return _0x4e629b;};'use strict';var Sequelize=require(_0xf223('0x0'));module[_0xf223('0x1')]={'network':{'type':Sequelize[_0xf223('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xf223('0x2')]},'channel':{'type':Sequelize[_0xf223('0x2')]},'language':{'type':Sequelize[_0xf223('0x2')]},'type':{'type':Sequelize[_0xf223('0x2')]},'uniqueid':{'type':Sequelize[_0xf223('0x2')]},'version':{'type':Sequelize[_0xf223('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf223('0x2')]},'callingpres':{'type':Sequelize[_0xf223('0x2')]},'callingani2':{'type':Sequelize[_0xf223('0x2')]},'callington':{'type':Sequelize[_0xf223('0x2')]},'callingtns':{'type':Sequelize[_0xf223('0x2')]},'dnid':{'type':Sequelize[_0xf223('0x2')]},'rdnis':{'type':Sequelize[_0xf223('0x2')]},'context':{'type':Sequelize[_0xf223('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf223('0x2')]},'enhanced':{'type':Sequelize[_0xf223('0x2')]},'accountcode':{'type':Sequelize[_0xf223('0x2')]},'threadid':{'type':Sequelize[_0xf223('0x2')]},'project_name':{'type':Sequelize[_0xf223('0x2')]},'joinAt':{'type':Sequelize[_0xf223('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xf223('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index a7fb57f..6fa83d6 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 _0x4c31=['rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','show','params','merge','catch','create','body','find','describe','eml-format'];(function(_0x54330b,_0x2d4af9){var _0x53625d=function(_0x43d761){while(--_0x43d761){_0x54330b['push'](_0x54330b['shift']());}};_0x53625d(++_0x2d4af9);}(_0x4c31,0x9d));var _0x14c3=function(_0x4dbf64,_0x46f981){_0x4dbf64=_0x4dbf64-0x0;var _0x5257e0=_0x4c31[_0x4dbf64];return _0x5257e0;};'use strict';var emlformat=require(_0x14c3('0x0'));var rimraf=require(_0x14c3('0x1'));var zipdir=require(_0x14c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14c3('0x3'));var moment=require('moment');var BPromise=require(_0x14c3('0x4'));var Mustache=require(_0x14c3('0x5'));var util=require('util');var path=require(_0x14c3('0x6'));var sox=require(_0x14c3('0x7'));var csv=require(_0x14c3('0x8'));var ejs=require(_0x14c3('0x9'));var fs=require('fs');var fs_extra=require(_0x14c3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x14c3('0xb'));var jsforce=require(_0x14c3('0xc'));var deskjs=require(_0x14c3('0xd'));var toCsv=require(_0x14c3('0x8'));var querystring=require(_0x14c3('0xe'));var Papa=require(_0x14c3('0xf'));var Redis=require(_0x14c3('0x10'));var authService=require(_0x14c3('0x11'));var qs=require(_0x14c3('0x12'));var as=require(_0x14c3('0x13'));var hardwareService=require(_0x14c3('0x14'));var logger=require(_0x14c3('0x15'))(_0x14c3('0x16'));var utils=require(_0x14c3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x14c3('0x18'));var db=require(_0x14c3('0x19'))['db'];function respondWithStatusCode(_0x2f68ce,_0x285d21){_0x285d21=_0x285d21||0xcc;return function(_0x475efc){if(_0x475efc){return _0x2f68ce['sendStatus'](_0x285d21);}return _0x2f68ce[_0x14c3('0x1a')](_0x285d21)[_0x14c3('0x1b')]();};}function respondWithResult(_0x426224,_0xc37d9d){_0xc37d9d=_0xc37d9d||0xc8;return function(_0x51e745){if(_0x51e745){return _0x426224[_0x14c3('0x1a')](_0xc37d9d)[_0x14c3('0x1c')](_0x51e745);}};}function respondWithFilteredResult(_0x237607,_0x534384){return function(_0x4c0769){if(_0x4c0769){var _0x4686bf=typeof _0x534384[_0x14c3('0x1d')]===_0x14c3('0x1e')&&typeof _0x534384['limit']===_0x14c3('0x1e');var _0x16c474=_0x4c0769[_0x14c3('0x1f')];var _0x24115e=_0x4686bf?0x0:_0x534384[_0x14c3('0x1d')];var _0x2c282e=_0x4686bf?_0x4c0769[_0x14c3('0x1f')]:_0x534384[_0x14c3('0x1d')]+_0x534384[_0x14c3('0x20')];var _0x2498ee;if(_0x2c282e>=_0x16c474){_0x2c282e=_0x16c474;_0x2498ee=0xc8;}else{_0x2498ee=0xce;}_0x237607['status'](_0x2498ee);return _0x237607[_0x14c3('0x21')](_0x14c3('0x22'),_0x24115e+'-'+_0x2c282e+'/'+_0x16c474)[_0x14c3('0x1c')](_0x4c0769);}return null;};}function patchUpdates(_0x3579ad){return function(_0x49f738){try{jsonpatch[_0x14c3('0x23')](_0x49f738,_0x3579ad,!![]);}catch(_0x4e37b8){return BPromise[_0x14c3('0x24')](_0x4e37b8);}return _0x49f738[_0x14c3('0x25')]();};}function saveUpdates(_0x99ef1e,_0x2a1178){return function(_0x4c1bef){if(_0x4c1bef){return _0x4c1bef[_0x14c3('0x26')](_0x99ef1e)[_0x14c3('0x27')](function(_0x438e8d){return _0x438e8d;});}return null;};}function removeEntity(_0x4a31a0,_0x56d2c6){return function(_0x347f99){if(_0x347f99){return _0x347f99[_0x14c3('0x28')]()[_0x14c3('0x27')](function(){_0x4a31a0['status'](0xcc)[_0x14c3('0x1b')]();});}};}function handleEntityNotFound(_0x51b271,_0x558b44){return function(_0x57127a){if(!_0x57127a){_0x51b271[_0x14c3('0x29')](0x194);}return _0x57127a;};}function handleError(_0x48cb9a,_0x10c19f){_0x10c19f=_0x10c19f||0x1f4;return function(_0xc48d37){logger[_0x14c3('0x2a')](_0xc48d37['stack']);if(_0xc48d37[_0x14c3('0x2b')]){delete _0xc48d37[_0x14c3('0x2b')];}_0x48cb9a['status'](_0x10c19f)[_0x14c3('0x2c')](_0xc48d37);};}exports[_0x14c3('0x2d')]=function(_0x8766b8,_0x457590){var _0x457768={},_0x2e401d={},_0x263486={'count':0x0,'rows':[]};var _0x1ae607=_[_0x14c3('0x2e')](db[_0x14c3('0x2f')][_0x14c3('0x30')],function(_0x496897){return{'name':_0x496897[_0x14c3('0x31')],'type':_0x496897[_0x14c3('0x32')][_0x14c3('0x33')]};});_0x2e401d[_0x14c3('0x34')]=_[_0x14c3('0x2e')](_0x1ae607,_0x14c3('0x2b'));_0x2e401d[_0x14c3('0x35')]=_[_0x14c3('0x36')](_0x8766b8[_0x14c3('0x35')]);_0x2e401d[_0x14c3('0x37')]=_[_0x14c3('0x38')](_0x2e401d[_0x14c3('0x34')],_0x2e401d[_0x14c3('0x35')]);_0x457768[_0x14c3('0x39')]=_[_0x14c3('0x38')](_0x2e401d[_0x14c3('0x34')],qs[_0x14c3('0x3a')](_0x8766b8[_0x14c3('0x35')][_0x14c3('0x3a')]));_0x457768[_0x14c3('0x39')]=_0x457768[_0x14c3('0x39')][_0x14c3('0x3b')]?_0x457768[_0x14c3('0x39')]:_0x2e401d[_0x14c3('0x34')];if(!_0x8766b8[_0x14c3('0x35')]['hasOwnProperty'](_0x14c3('0x3c'))){_0x457768[_0x14c3('0x20')]=qs[_0x14c3('0x20')](_0x8766b8[_0x14c3('0x35')][_0x14c3('0x20')]);_0x457768[_0x14c3('0x1d')]=qs[_0x14c3('0x1d')](_0x8766b8['query']['offset']);}_0x457768[_0x14c3('0x3d')]=qs[_0x14c3('0x3e')](_0x8766b8[_0x14c3('0x35')]['sort']);_0x457768[_0x14c3('0x3f')]=qs[_0x14c3('0x37')](_[_0x14c3('0x40')](_0x8766b8[_0x14c3('0x35')],_0x2e401d['filters']),_0x1ae607);if(_0x8766b8[_0x14c3('0x35')]['filter']){_0x457768['where']=_['merge'](_0x457768[_0x14c3('0x3f')],{'$or':_['map'](_0x1ae607,function(_0x39c3cb){if(_0x39c3cb[_0x14c3('0x32')]!==_0x14c3('0x41')){var _0x35e923={};_0x35e923[_0x39c3cb[_0x14c3('0x2b')]]={'$like':'%'+_0x8766b8[_0x14c3('0x35')][_0x14c3('0x42')]+'%'};return _0x35e923;}})});}_0x457768=_['merge']({},_0x457768,_0x8766b8[_0x14c3('0x43')]);var _0x120713={'where':_0x457768[_0x14c3('0x3f')]};return db['SquareReport'][_0x14c3('0x1f')](_0x120713)[_0x14c3('0x27')](function(_0x1a9ef7){_0x263486[_0x14c3('0x1f')]=_0x1a9ef7;if(_0x8766b8[_0x14c3('0x35')][_0x14c3('0x44')]){_0x457768[_0x14c3('0x45')]=[{'all':!![]}];}return db[_0x14c3('0x2f')][_0x14c3('0x46')](_0x457768);})[_0x14c3('0x27')](function(_0x1a5920){_0x263486['rows']=_0x1a5920;return _0x263486;})['then'](respondWithFilteredResult(_0x457590,_0x457768))['catch'](handleError(_0x457590,null));};exports[_0x14c3('0x47')]=function(_0x1e2a3c,_0x381dab){var _0x57672d={'raw':!![],'where':{'id':_0x1e2a3c[_0x14c3('0x48')]['id']}},_0x1c1b69={};_0x1c1b69[_0x14c3('0x34')]=_[_0x14c3('0x36')](db['SquareReport'][_0x14c3('0x30')]);_0x1c1b69[_0x14c3('0x35')]=_['keys'](_0x1e2a3c[_0x14c3('0x35')]);_0x1c1b69[_0x14c3('0x37')]=_[_0x14c3('0x38')](_0x1c1b69['model'],_0x1c1b69[_0x14c3('0x35')]);_0x57672d[_0x14c3('0x39')]=_[_0x14c3('0x38')](_0x1c1b69[_0x14c3('0x34')],qs[_0x14c3('0x3a')](_0x1e2a3c[_0x14c3('0x35')][_0x14c3('0x3a')]));_0x57672d[_0x14c3('0x39')]=_0x57672d['attributes']['length']?_0x57672d['attributes']:_0x1c1b69[_0x14c3('0x34')];if(_0x1e2a3c[_0x14c3('0x35')][_0x14c3('0x44')]){_0x57672d[_0x14c3('0x45')]=[{'all':!![]}];}_0x57672d=_[_0x14c3('0x49')]({},_0x57672d,_0x1e2a3c[_0x14c3('0x43')]);return db[_0x14c3('0x2f')]['find'](_0x57672d)['then'](handleEntityNotFound(_0x381dab,null))['then'](respondWithResult(_0x381dab,null))[_0x14c3('0x4a')](handleError(_0x381dab,null));};exports['create']=function(_0x12255f,_0x6d7f6b){return db['SquareReport'][_0x14c3('0x4b')](_0x12255f[_0x14c3('0x4c')],{})[_0x14c3('0x27')](respondWithResult(_0x6d7f6b,0xc9))[_0x14c3('0x4a')](handleError(_0x6d7f6b,null));};exports[_0x14c3('0x26')]=function(_0x15800a,_0x4bc2e6){if(_0x15800a[_0x14c3('0x4c')]['id']){delete _0x15800a[_0x14c3('0x4c')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x15800a['params']['id']}})[_0x14c3('0x27')](handleEntityNotFound(_0x4bc2e6,null))['then'](saveUpdates(_0x15800a[_0x14c3('0x4c')],null))['then'](respondWithResult(_0x4bc2e6,null))['catch'](handleError(_0x4bc2e6,null));};exports[_0x14c3('0x28')]=function(_0x2ed6b0,_0xdf1032){return db[_0x14c3('0x2f')][_0x14c3('0x4d')]({'where':{'id':_0x2ed6b0[_0x14c3('0x48')]['id']}})['then'](handleEntityNotFound(_0xdf1032,null))[_0x14c3('0x27')](removeEntity(_0xdf1032,null))[_0x14c3('0x4a')](handleError(_0xdf1032,null));};exports['describe']=function(_0x410318,_0x2807e3){return db[_0x14c3('0x2f')][_0x14c3('0x4e')]()[_0x14c3('0x27')](respondWithResult(_0x2807e3,null))[_0x14c3('0x4a')](handleError(_0x2807e3,null));}; \ No newline at end of file +var _0x4d80=['merge','filter','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','map','SquareReport','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1ddc2d,_0x46ccd5){var _0x1023ee=function(_0x299a73){while(--_0x299a73){_0x1ddc2d['push'](_0x1ddc2d['shift']());}};_0x1023ee(++_0x46ccd5);}(_0x4d80,0xa0));var _0x04d8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4d80[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x04d8('0x0'));var rimraf=require(_0x04d8('0x1'));var zipdir=require(_0x04d8('0x2'));var jsonpatch=require(_0x04d8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x04d8('0x4'));var util=require(_0x04d8('0x5'));var path=require(_0x04d8('0x6'));var sox=require(_0x04d8('0x7'));var csv=require('to-csv');var ejs=require(_0x04d8('0x8'));var fs=require('fs');var fs_extra=require(_0x04d8('0x9'));var _=require(_0x04d8('0xa'));var squel=require(_0x04d8('0xb'));var crypto=require(_0x04d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x04d8('0xd'));var toCsv=require(_0x04d8('0xe'));var querystring=require(_0x04d8('0xf'));var Papa=require('papaparse');var Redis=require(_0x04d8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x04d8('0x11'));var as=require(_0x04d8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x04d8('0x13'));var utils=require(_0x04d8('0x14'));var config=require(_0x04d8('0x15'));var licenseUtil=require(_0x04d8('0x16'));var db=require(_0x04d8('0x17'))['db'];function respondWithStatusCode(_0x20b43b,_0x5d483c){_0x5d483c=_0x5d483c||0xcc;return function(_0x469d8b){if(_0x469d8b){return _0x20b43b[_0x04d8('0x18')](_0x5d483c);}return _0x20b43b[_0x04d8('0x19')](_0x5d483c)[_0x04d8('0x1a')]();};}function respondWithResult(_0x3d0b66,_0x55387a){_0x55387a=_0x55387a||0xc8;return function(_0x11f6d1){if(_0x11f6d1){return _0x3d0b66[_0x04d8('0x19')](_0x55387a)[_0x04d8('0x1b')](_0x11f6d1);}};}function respondWithFilteredResult(_0x5dc20e,_0x74f8ac){return function(_0x40cee7){if(_0x40cee7){var _0x5b472c=typeof _0x74f8ac[_0x04d8('0x1c')]==='undefined'&&typeof _0x74f8ac[_0x04d8('0x1d')]==='undefined';var _0x1ae192=_0x40cee7[_0x04d8('0x1e')];var _0x41634d=_0x5b472c?0x0:_0x74f8ac[_0x04d8('0x1c')];var _0x1a5e08=_0x5b472c?_0x40cee7['count']:_0x74f8ac[_0x04d8('0x1c')]+_0x74f8ac[_0x04d8('0x1d')];var _0x2b30d5;if(_0x1a5e08>=_0x1ae192){_0x1a5e08=_0x1ae192;_0x2b30d5=0xc8;}else{_0x2b30d5=0xce;}_0x5dc20e[_0x04d8('0x19')](_0x2b30d5);return _0x5dc20e[_0x04d8('0x1f')](_0x04d8('0x20'),_0x41634d+'-'+_0x1a5e08+'/'+_0x1ae192)[_0x04d8('0x1b')](_0x40cee7);}return null;};}function patchUpdates(_0xb2361b){return function(_0x2918d1){try{jsonpatch[_0x04d8('0x21')](_0x2918d1,_0xb2361b,!![]);}catch(_0x3fd5a4){return BPromise[_0x04d8('0x22')](_0x3fd5a4);}return _0x2918d1['save']();};}function saveUpdates(_0x13ba43,_0x264d18){return function(_0x354328){if(_0x354328){return _0x354328[_0x04d8('0x23')](_0x13ba43)[_0x04d8('0x24')](function(_0x28b600){return _0x28b600;});}return null;};}function removeEntity(_0x482f91,_0x18b704){return function(_0x37fd55){if(_0x37fd55){return _0x37fd55['destroy']()[_0x04d8('0x24')](function(){_0x482f91[_0x04d8('0x19')](0xcc)[_0x04d8('0x1a')]();});}};}function handleEntityNotFound(_0x1eb3b9,_0x491abf){return function(_0x416589){if(!_0x416589){_0x1eb3b9[_0x04d8('0x18')](0x194);}return _0x416589;};}function handleError(_0x163c35,_0x280a8d){_0x280a8d=_0x280a8d||0x1f4;return function(_0x355313){logger[_0x04d8('0x25')](_0x355313[_0x04d8('0x26')]);if(_0x355313[_0x04d8('0x27')]){delete _0x355313[_0x04d8('0x27')];}_0x163c35[_0x04d8('0x19')](_0x280a8d)['send'](_0x355313);};}exports['index']=function(_0x33a34c,_0x1dc633){var _0x1b070d={},_0x17dbd0={},_0x447cbf={'count':0x0,'rows':[]};var _0x5d7923=_[_0x04d8('0x28')](db[_0x04d8('0x29')]['rawAttributes'],function(_0x20625e){return{'name':_0x20625e[_0x04d8('0x2a')],'type':_0x20625e['type'][_0x04d8('0x2b')]};});_0x17dbd0[_0x04d8('0x2c')]=_[_0x04d8('0x28')](_0x5d7923,_0x04d8('0x27'));_0x17dbd0[_0x04d8('0x2d')]=_[_0x04d8('0x2e')](_0x33a34c[_0x04d8('0x2d')]);_0x17dbd0[_0x04d8('0x2f')]=_['intersection'](_0x17dbd0[_0x04d8('0x2c')],_0x17dbd0[_0x04d8('0x2d')]);_0x1b070d[_0x04d8('0x30')]=_['intersection'](_0x17dbd0[_0x04d8('0x2c')],qs[_0x04d8('0x31')](_0x33a34c['query'][_0x04d8('0x31')]));_0x1b070d[_0x04d8('0x30')]=_0x1b070d[_0x04d8('0x30')][_0x04d8('0x32')]?_0x1b070d[_0x04d8('0x30')]:_0x17dbd0['model'];if(!_0x33a34c[_0x04d8('0x2d')][_0x04d8('0x33')](_0x04d8('0x34'))){_0x1b070d[_0x04d8('0x1d')]=qs[_0x04d8('0x1d')](_0x33a34c[_0x04d8('0x2d')]['limit']);_0x1b070d[_0x04d8('0x1c')]=qs[_0x04d8('0x1c')](_0x33a34c['query']['offset']);}_0x1b070d[_0x04d8('0x35')]=qs[_0x04d8('0x36')](_0x33a34c[_0x04d8('0x2d')][_0x04d8('0x36')]);_0x1b070d['where']=qs['filters'](_['pick'](_0x33a34c[_0x04d8('0x2d')],_0x17dbd0['filters']),_0x5d7923);if(_0x33a34c['query']['filter']){_0x1b070d[_0x04d8('0x37')]=_[_0x04d8('0x38')](_0x1b070d[_0x04d8('0x37')],{'$or':_[_0x04d8('0x28')](_0x5d7923,function(_0x5598da){if(_0x5598da['type']!=='VIRTUAL'){var _0x36bf58={};_0x36bf58[_0x5598da['name']]={'$like':'%'+_0x33a34c[_0x04d8('0x2d')][_0x04d8('0x39')]+'%'};return _0x36bf58;}})});}_0x1b070d=_['merge']({},_0x1b070d,_0x33a34c['options']);var _0x5c8473={'where':_0x1b070d[_0x04d8('0x37')]};return db[_0x04d8('0x29')][_0x04d8('0x1e')](_0x5c8473)[_0x04d8('0x24')](function(_0x2604e4){_0x447cbf[_0x04d8('0x1e')]=_0x2604e4;if(_0x33a34c['query'][_0x04d8('0x3a')]){_0x1b070d[_0x04d8('0x3b')]=[{'all':!![]}];}return db['SquareReport'][_0x04d8('0x3c')](_0x1b070d);})[_0x04d8('0x24')](function(_0xc93bc0){_0x447cbf[_0x04d8('0x3d')]=_0xc93bc0;return _0x447cbf;})['then'](respondWithFilteredResult(_0x1dc633,_0x1b070d))['catch'](handleError(_0x1dc633,null));};exports[_0x04d8('0x3e')]=function(_0x32bda1,_0xcb2dd7){var _0x48e4cd={'raw':!![],'where':{'id':_0x32bda1[_0x04d8('0x3f')]['id']}},_0x29c8a5={};_0x29c8a5[_0x04d8('0x2c')]=_[_0x04d8('0x2e')](db[_0x04d8('0x29')][_0x04d8('0x40')]);_0x29c8a5[_0x04d8('0x2d')]=_['keys'](_0x32bda1[_0x04d8('0x2d')]);_0x29c8a5[_0x04d8('0x2f')]=_[_0x04d8('0x41')](_0x29c8a5['model'],_0x29c8a5[_0x04d8('0x2d')]);_0x48e4cd[_0x04d8('0x30')]=_['intersection'](_0x29c8a5['model'],qs['fields'](_0x32bda1[_0x04d8('0x2d')]['fields']));_0x48e4cd[_0x04d8('0x30')]=_0x48e4cd[_0x04d8('0x30')]['length']?_0x48e4cd['attributes']:_0x29c8a5['model'];if(_0x32bda1[_0x04d8('0x2d')][_0x04d8('0x3a')]){_0x48e4cd[_0x04d8('0x3b')]=[{'all':!![]}];}_0x48e4cd=_[_0x04d8('0x38')]({},_0x48e4cd,_0x32bda1[_0x04d8('0x42')]);return db[_0x04d8('0x29')][_0x04d8('0x43')](_0x48e4cd)[_0x04d8('0x24')](handleEntityNotFound(_0xcb2dd7,null))[_0x04d8('0x24')](respondWithResult(_0xcb2dd7,null))[_0x04d8('0x44')](handleError(_0xcb2dd7,null));};exports[_0x04d8('0x45')]=function(_0x18e6ce,_0x494820){return db[_0x04d8('0x29')]['create'](_0x18e6ce['body'],{})[_0x04d8('0x24')](respondWithResult(_0x494820,0xc9))[_0x04d8('0x44')](handleError(_0x494820,null));};exports[_0x04d8('0x23')]=function(_0xbbc893,_0x7866c7){if(_0xbbc893['body']['id']){delete _0xbbc893[_0x04d8('0x46')]['id'];}return db[_0x04d8('0x29')][_0x04d8('0x43')]({'where':{'id':_0xbbc893[_0x04d8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x7866c7,null))[_0x04d8('0x24')](saveUpdates(_0xbbc893[_0x04d8('0x46')],null))[_0x04d8('0x24')](respondWithResult(_0x7866c7,null))[_0x04d8('0x44')](handleError(_0x7866c7,null));};exports['destroy']=function(_0x3b5b42,_0x184e58){return db['SquareReport'][_0x04d8('0x43')]({'where':{'id':_0x3b5b42[_0x04d8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x184e58,null))[_0x04d8('0x24')](removeEntity(_0x184e58,null))[_0x04d8('0x44')](handleError(_0x184e58,null));};exports[_0x04d8('0x47')]=function(_0x59ff3d,_0x350850){return db[_0x04d8('0x29')][_0x04d8('0x47')]()[_0x04d8('0x24')](respondWithResult(_0x350850,null))['catch'](handleError(_0x350850,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 05b162b..8f5afac 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 _0x279a=['bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0x3a33e7,_0x41609d){var _0x1b5e7f=function(_0x47a8cd){while(--_0x47a8cd){_0x3a33e7['push'](_0x3a33e7['shift']());}};_0x1b5e7f(++_0x41609d);}(_0x279a,0x84));var _0xa279=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x279a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa279('0x0'));var util=require(_0xa279('0x1'));var logger=require(_0xa279('0x2'))(_0xa279('0x3'));var moment=require('moment');var BPromise=require(_0xa279('0x4'));var rp=require(_0xa279('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa279('0x6'));var config=require(_0xa279('0x7'));var attributes=require(_0xa279('0x8'));module[_0xa279('0x9')]=function(_0x13f7c5,_0x31edd3){return _0x13f7c5[_0xa279('0xa')](_0xa279('0xb'),attributes,{'tableName':_0xa279('0xc'),'paranoid':![],'indexes':[{'name':_0xa279('0xd'),'fields':[_0xa279('0xe'),_0xa279('0xf')]},{'name':_0xa279('0x10'),'fields':[_0xa279('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4f6=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','util','api','bluebird'];(function(_0x363150,_0x1d1aac){var _0x546cef=function(_0x43cdbf){while(--_0x43cdbf){_0x363150['push'](_0x363150['shift']());}};_0x546cef(++_0x1d1aac);}(_0xd4f6,0xcf));var _0x6d4f=function(_0x19eb43,_0x10c355){_0x19eb43=_0x19eb43-0x0;var _0x57598c=_0xd4f6[_0x19eb43];return _0x57598c;};'use strict';var _=require('lodash');var util=require(_0x6d4f('0x0'));var logger=require('../../config/logger')(_0x6d4f('0x1'));var moment=require('moment');var BPromise=require(_0x6d4f('0x2'));var rp=require(_0x6d4f('0x3'));var fs=require('fs');var path=require(_0x6d4f('0x4'));var rimraf=require(_0x6d4f('0x5'));var config=require(_0x6d4f('0x6'));var attributes=require(_0x6d4f('0x7'));module['exports']=function(_0x52d8e5,_0x2a2e1b){return _0x52d8e5[_0x6d4f('0x8')](_0x6d4f('0x9'),attributes,{'tableName':_0x6d4f('0xa'),'paranoid':![],'indexes':[{'name':_0x6d4f('0xb'),'fields':[_0x6d4f('0xc'),_0x6d4f('0xd')]},{'name':_0x6d4f('0xe'),'fields':[_0x6d4f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d9e9b73..7c45edf 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 _0x3b0f=['request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SquareReport','create','options','raw','CreateSquareReport','UpdateSquareReport','update','where','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x26d559,_0x3ac894){var _0x183920=function(_0x43cd4c){while(--_0x43cd4c){_0x26d559['push'](_0x26d559['shift']());}};_0x183920(++_0x3ac894);}(_0x3b0f,0x1c8));var _0xf3b0=function(_0x21f2c0,_0x10f8d7){_0x21f2c0=_0x21f2c0-0x0;var _0x1cc9d8=_0x3b0f[_0x21f2c0];return _0x1cc9d8;};'use strict';var _=require('lodash');var util=require(_0xf3b0('0x0'));var moment=require(_0xf3b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xf3b0('0x2'));var fs=require('fs');var Redis=require(_0xf3b0('0x3'));var db=require(_0xf3b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf3b0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf3b0('0x6'));var client=jayson[_0xf3b0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556e1d,_0x5307e4,_0x48f7b6){return new BPromise(function(_0x3cf90f,_0x284017){return client[_0xf3b0('0x8')](_0x556e1d,_0x48f7b6)[_0xf3b0('0x9')](function(_0x40a7e6){logger['info'](_0xf3b0('0xa'),_0x5307e4,_0xf3b0('0xb'));logger[_0xf3b0('0xc')](_0xf3b0('0xd'),_0x5307e4,_0xf3b0('0xb'),JSON[_0xf3b0('0xe')](_0x40a7e6));if(_0x40a7e6['error']){if(_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x10')]===0x1f4){logger[_0xf3b0('0xf')](_0xf3b0('0xa'),_0x5307e4,_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x11')]);return _0x284017(_0x40a7e6[_0xf3b0('0xf')]['message']);}logger[_0xf3b0('0xf')](_0xf3b0('0xa'),_0x5307e4,_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x11')]);return _0x3cf90f(_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x11')]);}else{logger[_0xf3b0('0x12')](_0xf3b0('0xa'),_0x5307e4,_0xf3b0('0xb'));_0x3cf90f(_0x40a7e6[_0xf3b0('0x13')][_0xf3b0('0x11')]);}})['catch'](function(_0x36539a){logger[_0xf3b0('0xf')](_0xf3b0('0xa'),_0x5307e4,_0x36539a);_0x284017(_0x36539a);});});}exports['CreateSquareReport']=function(_0x49528b){var _0x5597a5=this;return new Promise(function(_0x2c41be,_0x3a9933){return db[_0xf3b0('0x14')][_0xf3b0('0x15')](_0x49528b['body'],{'raw':_0x49528b['options']?_0x49528b[_0xf3b0('0x16')][_0xf3b0('0x17')]===undefined?!![]:![]:!![]})[_0xf3b0('0x9')](function(_0x26be5c){logger[_0xf3b0('0x12')](_0xf3b0('0x18'),_0x49528b);logger[_0xf3b0('0xc')]('CreateSquareReport',_0x49528b,JSON[_0xf3b0('0xe')](_0x26be5c));_0x2c41be(_0x26be5c);})['catch'](function(_0x419dda){logger[_0xf3b0('0xf')](_0xf3b0('0x18'),_0x419dda[_0xf3b0('0x11')],_0x49528b);_0x3a9933(_0x5597a5['error'](0x1f4,_0x419dda[_0xf3b0('0x11')]));});});};exports[_0xf3b0('0x19')]=function(_0x42a072){var _0x518302=this;return new Promise(function(_0x5825f1,_0x4ec248){return db[_0xf3b0('0x14')][_0xf3b0('0x1a')](_0x42a072['body'],{'raw':_0x42a072[_0xf3b0('0x16')]?_0x42a072[_0xf3b0('0x16')][_0xf3b0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a072[_0xf3b0('0x16')]?_0x42a072['options'][_0xf3b0('0x1b')]||null:null,'attributes':_0x42a072['options']?_0x42a072['options']['attributes']||null:null,'limit':_0x42a072[_0xf3b0('0x16')]?_0x42a072['options'][_0xf3b0('0x1c')]||null:null})[_0xf3b0('0x9')](function(_0x3ab293){logger[_0xf3b0('0x12')](_0xf3b0('0x19'),_0x42a072);logger[_0xf3b0('0xc')]('UpdateSquareReport',_0x42a072,JSON[_0xf3b0('0xe')](_0x3ab293));_0x5825f1(_0x3ab293);})['catch'](function(_0xaeb223){logger[_0xf3b0('0xf')](_0xf3b0('0x19'),_0xaeb223[_0xf3b0('0x11')],_0x42a072);_0x4ec248(_0x518302[_0xf3b0('0xf')](0x1f4,_0xaeb223[_0xf3b0('0x11')]));});});}; \ No newline at end of file +var _0xcd53=['update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','then','UpdateSquareReport'];(function(_0x18ad5c,_0x2db53a){var _0x234a50=function(_0x5f0de1){while(--_0x5f0de1){_0x18ad5c['push'](_0x18ad5c['shift']());}};_0x234a50(++_0x2db53a);}(_0xcd53,0x1c3));var _0x3cd5=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0xcd53[_0x46a3ff];return _0x404bc2;};'use strict';var _=require(_0x3cd5('0x0'));var util=require('util');var moment=require(_0x3cd5('0x1'));var BPromise=require(_0x3cd5('0x2'));var rs=require(_0x3cd5('0x3'));var fs=require('fs');var Redis=require(_0x3cd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cd5('0x5'));var logger=require(_0x3cd5('0x6'))(_0x3cd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x3cd5('0x8'));var client=jayson[_0x3cd5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x536683,_0x538288,_0x13be92){return new BPromise(function(_0x1c67d1,_0x2c876c){return client[_0x3cd5('0xa')](_0x536683,_0x13be92)['then'](function(_0x373c47){logger['info'](_0x3cd5('0xb'),_0x538288,_0x3cd5('0xc'));logger[_0x3cd5('0xd')](_0x3cd5('0xe'),_0x538288,'request\x20sent',JSON[_0x3cd5('0xf')](_0x373c47));if(_0x373c47['error']){if(_0x373c47[_0x3cd5('0x10')][_0x3cd5('0x11')]===0x1f4){logger['error'](_0x3cd5('0xb'),_0x538288,_0x373c47['error'][_0x3cd5('0x12')]);return _0x2c876c(_0x373c47[_0x3cd5('0x10')]['message']);}logger[_0x3cd5('0x10')](_0x3cd5('0xb'),_0x538288,_0x373c47[_0x3cd5('0x10')][_0x3cd5('0x12')]);return _0x1c67d1(_0x373c47[_0x3cd5('0x10')][_0x3cd5('0x12')]);}else{logger[_0x3cd5('0x13')](_0x3cd5('0xb'),_0x538288,_0x3cd5('0xc'));_0x1c67d1(_0x373c47[_0x3cd5('0x14')]['message']);}})[_0x3cd5('0x15')](function(_0x231534){logger[_0x3cd5('0x10')]('SquareReport,\x20%s,\x20%s',_0x538288,_0x231534);_0x2c876c(_0x231534);});});}exports[_0x3cd5('0x16')]=function(_0x2f58a1){var _0x1b14ab=this;return new Promise(function(_0x246082,_0x51648f){return db[_0x3cd5('0x17')][_0x3cd5('0x18')](_0x2f58a1[_0x3cd5('0x19')],{'raw':_0x2f58a1[_0x3cd5('0x1a')]?_0x2f58a1[_0x3cd5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x3cd5('0x1b')](function(_0x4b8e94){logger[_0x3cd5('0x13')](_0x3cd5('0x16'),_0x2f58a1);logger['debug'](_0x3cd5('0x16'),_0x2f58a1,JSON[_0x3cd5('0xf')](_0x4b8e94));_0x246082(_0x4b8e94);})[_0x3cd5('0x15')](function(_0x4e55b5){logger['error']('CreateSquareReport',_0x4e55b5[_0x3cd5('0x12')],_0x2f58a1);_0x51648f(_0x1b14ab[_0x3cd5('0x10')](0x1f4,_0x4e55b5['message']));});});};exports[_0x3cd5('0x1c')]=function(_0x52eb2b){var _0x19419f=this;return new Promise(function(_0x4a69bd,_0x2c8b72){return db['SquareReport'][_0x3cd5('0x1d')](_0x52eb2b[_0x3cd5('0x19')],{'raw':_0x52eb2b['options']?_0x52eb2b[_0x3cd5('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52eb2b['options']?_0x52eb2b[_0x3cd5('0x1a')]['where']||null:null,'attributes':_0x52eb2b[_0x3cd5('0x1a')]?_0x52eb2b[_0x3cd5('0x1a')][_0x3cd5('0x1e')]||null:null,'limit':_0x52eb2b[_0x3cd5('0x1a')]?_0x52eb2b[_0x3cd5('0x1a')][_0x3cd5('0x1f')]||null:null})[_0x3cd5('0x1b')](function(_0xabe709){logger[_0x3cd5('0x13')](_0x3cd5('0x1c'),_0x52eb2b);logger[_0x3cd5('0xd')](_0x3cd5('0x1c'),_0x52eb2b,JSON['stringify'](_0xabe709));_0x4a69bd(_0xabe709);})['catch'](function(_0x282dab){logger[_0x3cd5('0x10')](_0x3cd5('0x1c'),_0x282dab[_0x3cd5('0x12')],_0x52eb2b);_0x2c8b72(_0x19419f[_0x3cd5('0x10')](0x1f4,_0x282dab[_0x3cd5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4fa2985..190f504 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 _0xec8b=['/:id','show','post','put','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x19fa00,_0x2218c3){var _0x5639fe=function(_0x2ca3b4){while(--_0x2ca3b4){_0x19fa00['push'](_0x19fa00['shift']());}};_0x5639fe(++_0x2218c3);}(_0xec8b,0x7f));var _0xbec8=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xec8b[_0x2b7764];return _0x848dcb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbec8('0x0'));var timeout=require(_0xbec8('0x1'));var express=require('express');var router=express[_0xbec8('0x2')]();var fs_extra=require(_0xbec8('0x3'));var auth=require(_0xbec8('0x4'));var interaction=require(_0xbec8('0x5'));var config=require(_0xbec8('0x6'));var controller=require(_0xbec8('0x7'));router['get']('/',auth[_0xbec8('0x8')](),controller[_0xbec8('0x9')]);router[_0xbec8('0xa')](_0xbec8('0xb'),auth[_0xbec8('0x8')](),controller[_0xbec8('0xc')]);router[_0xbec8('0xa')](_0xbec8('0xd'),auth[_0xbec8('0x8')](),controller[_0xbec8('0xe')]);router[_0xbec8('0xf')]('/',auth[_0xbec8('0x8')](),controller['create']);router[_0xbec8('0x10')]('/:id',auth[_0xbec8('0x8')](),controller[_0xbec8('0x11')]);router['delete'](_0xbec8('0xd'),auth[_0xbec8('0x8')](),controller[_0xbec8('0x12')]);module[_0xbec8('0x13')]=router; \ No newline at end of file +var _0x1fce=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','put'];(function(_0x52dbcb,_0x344f7e){var _0x10bfe4=function(_0x4685c5){while(--_0x4685c5){_0x52dbcb['push'](_0x52dbcb['shift']());}};_0x10bfe4(++_0x344f7e);}(_0x1fce,0x144));var _0xe1fc=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x1fce[_0x1ed116];return _0x574066;};'use strict';var multer=require(_0xe1fc('0x0'));var util=require(_0xe1fc('0x1'));var path=require(_0xe1fc('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1fc('0x3'));var router=express[_0xe1fc('0x4')]();var fs_extra=require(_0xe1fc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe1fc('0x6'));var config=require(_0xe1fc('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0xe1fc('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xe1fc('0x9'),auth[_0xe1fc('0x8')](),controller[_0xe1fc('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe1fc('0xb')]('/:id',auth[_0xe1fc('0x8')](),controller[_0xe1fc('0xc')]);router[_0xe1fc('0xd')](_0xe1fc('0x9'),auth[_0xe1fc('0x8')](),controller[_0xe1fc('0xe')]);module[_0xe1fc('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 3acba85..126625d 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 _0x4343=['STRING','sequelize','exports'];(function(_0x37c548,_0x2d9a05){var _0x10f4fd=function(_0x4382d1){while(--_0x4382d1){_0x37c548['push'](_0x37c548['shift']());}};_0x10f4fd(++_0x2d9a05);}(_0x4343,0xa6));var _0x3434=function(_0x59d3c3,_0x50bef2){_0x59d3c3=_0x59d3c3-0x0;var _0x33cc65=_0x4343[_0x59d3c3];return _0x33cc65;};'use strict';var Sequelize=require(_0x3434('0x0'));module[_0x3434('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x3434('0x2')]},'application':{'type':Sequelize[_0x3434('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x3434('0x2')]},'callerid':{'type':Sequelize[_0x3434('0x2')]}}; \ No newline at end of file +var _0x633a=['sequelize','STRING'];(function(_0x574a42,_0xf8f93e){var _0x34d289=function(_0x9eea0a){while(--_0x9eea0a){_0x574a42['push'](_0x574a42['shift']());}};_0x34d289(++_0xf8f93e);}(_0x633a,0xca));var _0xa633=function(_0x372bae,_0xd5357c){_0x372bae=_0x372bae-0x0;var _0xfce3f4=_0x633a[_0x372bae];return _0xfce3f4;};'use strict';var Sequelize=require(_0xa633('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa633('0x1')]},'node':{'type':Sequelize[_0xa633('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xa633('0x1')]},'callerid':{'type':Sequelize[_0xa633('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8b7b3fe..be57828 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 _0xe2d3=['body','describe','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','params','rawAttributes','length','find','catch','create'];(function(_0x29b6d1,_0x30af94){var _0x12a33f=function(_0x394717){while(--_0x394717){_0x29b6d1['push'](_0x29b6d1['shift']());}};_0x12a33f(++_0x30af94);}(_0xe2d3,0x1e5));var _0x3e2d=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xe2d3[_0x4687df];return _0x32eaef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e2d('0x0'));var jsonpatch=require(_0x3e2d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e2d('0x2'));var util=require(_0x3e2d('0x3'));var path=require(_0x3e2d('0x4'));var sox=require(_0x3e2d('0x5'));var csv=require(_0x3e2d('0x6'));var ejs=require(_0x3e2d('0x7'));var fs=require('fs');var fs_extra=require(_0x3e2d('0x8'));var _=require(_0x3e2d('0x9'));var squel=require(_0x3e2d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3e2d('0xb'));var toCsv=require(_0x3e2d('0x6'));var querystring=require(_0x3e2d('0xc'));var Papa=require(_0x3e2d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e2d('0xe'));var as=require(_0x3e2d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e2d('0x10'))('api');var utils=require(_0x3e2d('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3e2d('0x12'))['db'];function respondWithStatusCode(_0x7a7902,_0x10a17b){_0x10a17b=_0x10a17b||0xcc;return function(_0xa50d73){if(_0xa50d73){return _0x7a7902['sendStatus'](_0x10a17b);}return _0x7a7902[_0x3e2d('0x13')](_0x10a17b)[_0x3e2d('0x14')]();};}function respondWithResult(_0x56b63d,_0x384f5f){_0x384f5f=_0x384f5f||0xc8;return function(_0x463667){if(_0x463667){return _0x56b63d[_0x3e2d('0x13')](_0x384f5f)['json'](_0x463667);}};}function respondWithFilteredResult(_0x405d62,_0x439d49){return function(_0x168f66){if(_0x168f66){var _0x4bb74a=typeof _0x439d49['offset']===_0x3e2d('0x15')&&typeof _0x439d49[_0x3e2d('0x16')]===_0x3e2d('0x15');var _0x548e73=_0x168f66[_0x3e2d('0x17')];var _0x1b4165=_0x4bb74a?0x0:_0x439d49[_0x3e2d('0x18')];var _0x21d6bf=_0x4bb74a?_0x168f66[_0x3e2d('0x17')]:_0x439d49['offset']+_0x439d49[_0x3e2d('0x16')];var _0x56eb67;if(_0x21d6bf>=_0x548e73){_0x21d6bf=_0x548e73;_0x56eb67=0xc8;}else{_0x56eb67=0xce;}_0x405d62['status'](_0x56eb67);return _0x405d62[_0x3e2d('0x19')](_0x3e2d('0x1a'),_0x1b4165+'-'+_0x21d6bf+'/'+_0x548e73)[_0x3e2d('0x1b')](_0x168f66);}return null;};}function patchUpdates(_0x5de70f){return function(_0x35b7b9){try{jsonpatch[_0x3e2d('0x1c')](_0x35b7b9,_0x5de70f,!![]);}catch(_0x1a2ad3){return BPromise['reject'](_0x1a2ad3);}return _0x35b7b9[_0x3e2d('0x1d')]();};}function saveUpdates(_0x464d24,_0x249ee8){return function(_0x2baa22){if(_0x2baa22){return _0x2baa22[_0x3e2d('0x1e')](_0x464d24)['then'](function(_0x23136f){return _0x23136f;});}return null;};}function removeEntity(_0x48515c,_0x3f32b8){return function(_0x57cc72){if(_0x57cc72){return _0x57cc72[_0x3e2d('0x1f')]()[_0x3e2d('0x20')](function(){_0x48515c['status'](0xcc)[_0x3e2d('0x14')]();});}};}function handleEntityNotFound(_0x5ef988,_0x491616){return function(_0x3b257b){if(!_0x3b257b){_0x5ef988[_0x3e2d('0x21')](0x194);}return _0x3b257b;};}function handleError(_0xeb738d,_0x44fd27){_0x44fd27=_0x44fd27||0x1f4;return function(_0x5edd2c){logger[_0x3e2d('0x22')](_0x5edd2c[_0x3e2d('0x23')]);if(_0x5edd2c[_0x3e2d('0x24')]){delete _0x5edd2c[_0x3e2d('0x24')];}_0xeb738d['status'](_0x44fd27)[_0x3e2d('0x25')](_0x5edd2c);};}exports[_0x3e2d('0x26')]=function(_0x4a2879,_0x5cda96){var _0xc8e169={},_0x501b76={},_0xd48503={'count':0x0,'rows':[]};var _0x5bca32=_[_0x3e2d('0x27')](db[_0x3e2d('0x28')]['rawAttributes'],function(_0xbd8d35){return{'name':_0xbd8d35[_0x3e2d('0x29')],'type':_0xbd8d35[_0x3e2d('0x2a')][_0x3e2d('0x2b')]};});_0x501b76['model']=_['map'](_0x5bca32,'name');_0x501b76['query']=_[_0x3e2d('0x2c')](_0x4a2879[_0x3e2d('0x2d')]);_0x501b76[_0x3e2d('0x2e')]=_[_0x3e2d('0x2f')](_0x501b76[_0x3e2d('0x30')],_0x501b76['query']);_0xc8e169[_0x3e2d('0x31')]=_['intersection'](_0x501b76[_0x3e2d('0x30')],qs[_0x3e2d('0x32')](_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x32')]));_0xc8e169[_0x3e2d('0x31')]=_0xc8e169[_0x3e2d('0x31')]['length']?_0xc8e169['attributes']:_0x501b76['model'];if(!_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x33')](_0x3e2d('0x34'))){_0xc8e169[_0x3e2d('0x16')]=qs[_0x3e2d('0x16')](_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x16')]);_0xc8e169['offset']=qs[_0x3e2d('0x18')](_0x4a2879[_0x3e2d('0x2d')]['offset']);}_0xc8e169['order']=qs['sort'](_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x35')]);_0xc8e169['where']=qs[_0x3e2d('0x2e')](_[_0x3e2d('0x36')](_0x4a2879[_0x3e2d('0x2d')],_0x501b76['filters']),_0x5bca32);if(_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x37')]){_0xc8e169[_0x3e2d('0x38')]=_[_0x3e2d('0x39')](_0xc8e169[_0x3e2d('0x38')],{'$or':_[_0x3e2d('0x27')](_0x5bca32,function(_0x5f5b43){if(_0x5f5b43[_0x3e2d('0x2a')]!=='VIRTUAL'){var _0x1f5c89={};_0x1f5c89[_0x5f5b43[_0x3e2d('0x24')]]={'$like':'%'+_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x37')]+'%'};return _0x1f5c89;}})});}_0xc8e169=_[_0x3e2d('0x39')]({},_0xc8e169,_0x4a2879[_0x3e2d('0x3a')]);var _0x430101={'where':_0xc8e169['where']};return db[_0x3e2d('0x28')][_0x3e2d('0x17')](_0x430101)[_0x3e2d('0x20')](function(_0x4964e9){_0xd48503[_0x3e2d('0x17')]=_0x4964e9;if(_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x3b')]){_0xc8e169['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x3e2d('0x3c')](_0xc8e169);})[_0x3e2d('0x20')](function(_0x45ac4d){_0xd48503['rows']=_0x45ac4d;return _0xd48503;})[_0x3e2d('0x20')](respondWithFilteredResult(_0x5cda96,_0xc8e169))['catch'](handleError(_0x5cda96,null));};exports['show']=function(_0x4ba91d,_0x8dab9d){var _0x39ee75={'raw':!![],'where':{'id':_0x4ba91d[_0x3e2d('0x3d')]['id']}},_0x59a1c0={};_0x59a1c0['model']=_[_0x3e2d('0x2c')](db['SquareDetailsReport'][_0x3e2d('0x3e')]);_0x59a1c0[_0x3e2d('0x2d')]=_[_0x3e2d('0x2c')](_0x4ba91d[_0x3e2d('0x2d')]);_0x59a1c0[_0x3e2d('0x2e')]=_[_0x3e2d('0x2f')](_0x59a1c0[_0x3e2d('0x30')],_0x59a1c0[_0x3e2d('0x2d')]);_0x39ee75['attributes']=_[_0x3e2d('0x2f')](_0x59a1c0[_0x3e2d('0x30')],qs[_0x3e2d('0x32')](_0x4ba91d[_0x3e2d('0x2d')][_0x3e2d('0x32')]));_0x39ee75[_0x3e2d('0x31')]=_0x39ee75[_0x3e2d('0x31')][_0x3e2d('0x3f')]?_0x39ee75[_0x3e2d('0x31')]:_0x59a1c0[_0x3e2d('0x30')];if(_0x4ba91d[_0x3e2d('0x2d')][_0x3e2d('0x3b')]){_0x39ee75['include']=[{'all':!![]}];}_0x39ee75=_[_0x3e2d('0x39')]({},_0x39ee75,_0x4ba91d[_0x3e2d('0x3a')]);return db[_0x3e2d('0x28')][_0x3e2d('0x40')](_0x39ee75)[_0x3e2d('0x20')](handleEntityNotFound(_0x8dab9d,null))[_0x3e2d('0x20')](respondWithResult(_0x8dab9d,null))[_0x3e2d('0x41')](handleError(_0x8dab9d,null));};exports[_0x3e2d('0x42')]=function(_0x3765f7,_0x339dea){return db[_0x3e2d('0x28')]['create'](_0x3765f7[_0x3e2d('0x43')],{})[_0x3e2d('0x20')](respondWithResult(_0x339dea,0xc9))[_0x3e2d('0x41')](handleError(_0x339dea,null));};exports[_0x3e2d('0x1e')]=function(_0x3d8b4d,_0xf5b6bd){if(_0x3d8b4d[_0x3e2d('0x43')]['id']){delete _0x3d8b4d[_0x3e2d('0x43')]['id'];}return db[_0x3e2d('0x28')][_0x3e2d('0x40')]({'where':{'id':_0x3d8b4d['params']['id']}})['then'](handleEntityNotFound(_0xf5b6bd,null))[_0x3e2d('0x20')](saveUpdates(_0x3d8b4d['body'],null))[_0x3e2d('0x20')](respondWithResult(_0xf5b6bd,null))[_0x3e2d('0x41')](handleError(_0xf5b6bd,null));};exports[_0x3e2d('0x1f')]=function(_0x30d8b4,_0xb0003b){return db['SquareDetailsReport'][_0x3e2d('0x40')]({'where':{'id':_0x30d8b4['params']['id']}})['then'](handleEntityNotFound(_0xb0003b,null))[_0x3e2d('0x20')](removeEntity(_0xb0003b,null))[_0x3e2d('0x41')](handleError(_0xb0003b,null));};exports[_0x3e2d('0x44')]=function(_0x5a1cf8,_0x143db2){return db['SquareDetailsReport'][_0x3e2d('0x44')]()['then'](respondWithResult(_0x143db2,null))['catch'](handleError(_0x143db2,null));}; \ No newline at end of file +var _0xb5b6=['fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','VIRTUAL','include','findAll','show','params','keys','length','includeAll','options','find','catch','create','update','body','describe','rimraf','zip-dir'];(function(_0x17b51a,_0x6eb3fe){var _0x2845ce=function(_0x3b716f){while(--_0x3b716f){_0x17b51a['push'](_0x17b51a['shift']());}};_0x2845ce(++_0x6eb3fe);}(_0xb5b6,0x1c0));var _0x6b5b=function(_0x460c57,_0x1ee6f9){_0x460c57=_0x460c57-0x0;var _0x186899=_0xb5b6[_0x460c57];return _0x186899;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b5b('0x0'));var zipdir=require(_0x6b5b('0x1'));var jsonpatch=require(_0x6b5b('0x2'));var rp=require(_0x6b5b('0x3'));var moment=require(_0x6b5b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b5b('0x5'));var path=require(_0x6b5b('0x6'));var sox=require(_0x6b5b('0x7'));var csv=require(_0x6b5b('0x8'));var ejs=require(_0x6b5b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b5b('0xa'));var squel=require(_0x6b5b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6b5b('0xc'));var toCsv=require(_0x6b5b('0x8'));var querystring=require('querystring');var Papa=require(_0x6b5b('0xd'));var Redis=require(_0x6b5b('0xe'));var authService=require(_0x6b5b('0xf'));var qs=require(_0x6b5b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b5b('0x11'));var logger=require(_0x6b5b('0x12'))(_0x6b5b('0x13'));var utils=require(_0x6b5b('0x14'));var config=require(_0x6b5b('0x15'));var licenseUtil=require(_0x6b5b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2613c5,_0x36dbdd){_0x36dbdd=_0x36dbdd||0xcc;return function(_0x54f47c){if(_0x54f47c){return _0x2613c5[_0x6b5b('0x17')](_0x36dbdd);}return _0x2613c5[_0x6b5b('0x18')](_0x36dbdd)[_0x6b5b('0x19')]();};}function respondWithResult(_0x4db899,_0xa27c30){_0xa27c30=_0xa27c30||0xc8;return function(_0x20ab5a){if(_0x20ab5a){return _0x4db899[_0x6b5b('0x18')](_0xa27c30)['json'](_0x20ab5a);}};}function respondWithFilteredResult(_0x54b739,_0x207176){return function(_0x3c62af){if(_0x3c62af){var _0x2c3c70=typeof _0x207176[_0x6b5b('0x1a')]===_0x6b5b('0x1b')&&typeof _0x207176['limit']===_0x6b5b('0x1b');var _0x51cf7b=_0x3c62af[_0x6b5b('0x1c')];var _0x2d71ef=_0x2c3c70?0x0:_0x207176[_0x6b5b('0x1a')];var _0x33802a=_0x2c3c70?_0x3c62af[_0x6b5b('0x1c')]:_0x207176[_0x6b5b('0x1a')]+_0x207176['limit'];var _0x2e6e71;if(_0x33802a>=_0x51cf7b){_0x33802a=_0x51cf7b;_0x2e6e71=0xc8;}else{_0x2e6e71=0xce;}_0x54b739['status'](_0x2e6e71);return _0x54b739[_0x6b5b('0x1d')](_0x6b5b('0x1e'),_0x2d71ef+'-'+_0x33802a+'/'+_0x51cf7b)['json'](_0x3c62af);}return null;};}function patchUpdates(_0x231755){return function(_0x40a0a3){try{jsonpatch[_0x6b5b('0x1f')](_0x40a0a3,_0x231755,!![]);}catch(_0x43ac23){return BPromise[_0x6b5b('0x20')](_0x43ac23);}return _0x40a0a3[_0x6b5b('0x21')]();};}function saveUpdates(_0x52bc27,_0x366d2e){return function(_0x3a8417){if(_0x3a8417){return _0x3a8417['update'](_0x52bc27)[_0x6b5b('0x22')](function(_0x5f577c){return _0x5f577c;});}return null;};}function removeEntity(_0x1aae4d,_0x74936f){return function(_0x45253d){if(_0x45253d){return _0x45253d[_0x6b5b('0x23')]()[_0x6b5b('0x22')](function(){_0x1aae4d['status'](0xcc)[_0x6b5b('0x19')]();});}};}function handleEntityNotFound(_0x40facb,_0x301e94){return function(_0x80d2b9){if(!_0x80d2b9){_0x40facb[_0x6b5b('0x17')](0x194);}return _0x80d2b9;};}function handleError(_0x23a42b,_0x2e654b){_0x2e654b=_0x2e654b||0x1f4;return function(_0x212480){logger[_0x6b5b('0x24')](_0x212480['stack']);if(_0x212480[_0x6b5b('0x25')]){delete _0x212480[_0x6b5b('0x25')];}_0x23a42b[_0x6b5b('0x18')](_0x2e654b)[_0x6b5b('0x26')](_0x212480);};}exports[_0x6b5b('0x27')]=function(_0x3af069,_0x3fea44){var _0x332091={},_0x8306e2={},_0xbbd57={'count':0x0,'rows':[]};var _0x5eae17=_[_0x6b5b('0x28')](db[_0x6b5b('0x29')][_0x6b5b('0x2a')],function(_0x1596e8){return{'name':_0x1596e8[_0x6b5b('0x2b')],'type':_0x1596e8['type'][_0x6b5b('0x2c')]};});_0x8306e2['model']=_[_0x6b5b('0x28')](_0x5eae17,_0x6b5b('0x25'));_0x8306e2[_0x6b5b('0x2d')]=_['keys'](_0x3af069['query']);_0x8306e2[_0x6b5b('0x2e')]=_[_0x6b5b('0x2f')](_0x8306e2[_0x6b5b('0x30')],_0x8306e2[_0x6b5b('0x2d')]);_0x332091[_0x6b5b('0x31')]=_[_0x6b5b('0x2f')](_0x8306e2[_0x6b5b('0x30')],qs[_0x6b5b('0x32')](_0x3af069[_0x6b5b('0x2d')][_0x6b5b('0x32')]));_0x332091['attributes']=_0x332091[_0x6b5b('0x31')]['length']?_0x332091[_0x6b5b('0x31')]:_0x8306e2[_0x6b5b('0x30')];if(!_0x3af069[_0x6b5b('0x2d')][_0x6b5b('0x33')](_0x6b5b('0x34'))){_0x332091[_0x6b5b('0x35')]=qs[_0x6b5b('0x35')](_0x3af069[_0x6b5b('0x2d')][_0x6b5b('0x35')]);_0x332091[_0x6b5b('0x1a')]=qs[_0x6b5b('0x1a')](_0x3af069[_0x6b5b('0x2d')]['offset']);}_0x332091['order']=qs[_0x6b5b('0x36')](_0x3af069[_0x6b5b('0x2d')][_0x6b5b('0x36')]);_0x332091['where']=qs[_0x6b5b('0x2e')](_[_0x6b5b('0x37')](_0x3af069['query'],_0x8306e2[_0x6b5b('0x2e')]),_0x5eae17);if(_0x3af069[_0x6b5b('0x2d')][_0x6b5b('0x38')]){_0x332091[_0x6b5b('0x39')]=_[_0x6b5b('0x3a')](_0x332091[_0x6b5b('0x39')],{'$or':_[_0x6b5b('0x28')](_0x5eae17,function(_0x5d5664){if(_0x5d5664[_0x6b5b('0x3b')]!==_0x6b5b('0x3c')){var _0x385ff1={};_0x385ff1[_0x5d5664[_0x6b5b('0x25')]]={'$like':'%'+_0x3af069[_0x6b5b('0x2d')][_0x6b5b('0x38')]+'%'};return _0x385ff1;}})});}_0x332091=_[_0x6b5b('0x3a')]({},_0x332091,_0x3af069['options']);var _0x18d550={'where':_0x332091['where']};return db[_0x6b5b('0x29')][_0x6b5b('0x1c')](_0x18d550)[_0x6b5b('0x22')](function(_0x59379f){_0xbbd57[_0x6b5b('0x1c')]=_0x59379f;if(_0x3af069[_0x6b5b('0x2d')]['includeAll']){_0x332091[_0x6b5b('0x3d')]=[{'all':!![]}];}return db[_0x6b5b('0x29')][_0x6b5b('0x3e')](_0x332091);})[_0x6b5b('0x22')](function(_0x5cc43c){_0xbbd57['rows']=_0x5cc43c;return _0xbbd57;})[_0x6b5b('0x22')](respondWithFilteredResult(_0x3fea44,_0x332091))['catch'](handleError(_0x3fea44,null));};exports[_0x6b5b('0x3f')]=function(_0x1f9fd8,_0xeee0a8){var _0x17c526={'raw':!![],'where':{'id':_0x1f9fd8[_0x6b5b('0x40')]['id']}},_0x4b48be={};_0x4b48be[_0x6b5b('0x30')]=_[_0x6b5b('0x41')](db[_0x6b5b('0x29')]['rawAttributes']);_0x4b48be[_0x6b5b('0x2d')]=_[_0x6b5b('0x41')](_0x1f9fd8[_0x6b5b('0x2d')]);_0x4b48be[_0x6b5b('0x2e')]=_[_0x6b5b('0x2f')](_0x4b48be['model'],_0x4b48be[_0x6b5b('0x2d')]);_0x17c526[_0x6b5b('0x31')]=_['intersection'](_0x4b48be[_0x6b5b('0x30')],qs[_0x6b5b('0x32')](_0x1f9fd8[_0x6b5b('0x2d')][_0x6b5b('0x32')]));_0x17c526[_0x6b5b('0x31')]=_0x17c526['attributes'][_0x6b5b('0x42')]?_0x17c526['attributes']:_0x4b48be[_0x6b5b('0x30')];if(_0x1f9fd8['query'][_0x6b5b('0x43')]){_0x17c526[_0x6b5b('0x3d')]=[{'all':!![]}];}_0x17c526=_[_0x6b5b('0x3a')]({},_0x17c526,_0x1f9fd8[_0x6b5b('0x44')]);return db[_0x6b5b('0x29')][_0x6b5b('0x45')](_0x17c526)['then'](handleEntityNotFound(_0xeee0a8,null))[_0x6b5b('0x22')](respondWithResult(_0xeee0a8,null))[_0x6b5b('0x46')](handleError(_0xeee0a8,null));};exports[_0x6b5b('0x47')]=function(_0x3819b9,_0x51aa7f){return db[_0x6b5b('0x29')][_0x6b5b('0x47')](_0x3819b9['body'],{})[_0x6b5b('0x22')](respondWithResult(_0x51aa7f,0xc9))['catch'](handleError(_0x51aa7f,null));};exports[_0x6b5b('0x48')]=function(_0x4be9cd,_0x508651){if(_0x4be9cd[_0x6b5b('0x49')]['id']){delete _0x4be9cd[_0x6b5b('0x49')]['id'];}return db[_0x6b5b('0x29')][_0x6b5b('0x45')]({'where':{'id':_0x4be9cd[_0x6b5b('0x40')]['id']}})[_0x6b5b('0x22')](handleEntityNotFound(_0x508651,null))[_0x6b5b('0x22')](saveUpdates(_0x4be9cd[_0x6b5b('0x49')],null))[_0x6b5b('0x22')](respondWithResult(_0x508651,null))[_0x6b5b('0x46')](handleError(_0x508651,null));};exports[_0x6b5b('0x23')]=function(_0x332eb3,_0x5b6124){return db[_0x6b5b('0x29')][_0x6b5b('0x45')]({'where':{'id':_0x332eb3['params']['id']}})[_0x6b5b('0x22')](handleEntityNotFound(_0x5b6124,null))[_0x6b5b('0x22')](removeEntity(_0x5b6124,null))[_0x6b5b('0x46')](handleError(_0x5b6124,null));};exports[_0x6b5b('0x4a')]=function(_0x3a3fe2,_0x5c5378){return db[_0x6b5b('0x29')][_0x6b5b('0x4a')]()['then'](respondWithResult(_0x5c5378,null))[_0x6b5b('0x46')](handleError(_0x5c5378,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index a65e1fc..79b0630 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 _0xdd92=['bluebird','request-promise','path','../../config/environment','define','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xdd92,0x1be));var _0x2dd9=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xdd92[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x2dd9('0x0'));var util=require(_0x2dd9('0x1'));var logger=require(_0x2dd9('0x2'))(_0x2dd9('0x3'));var moment=require(_0x2dd9('0x4'));var BPromise=require(_0x2dd9('0x5'));var rp=require(_0x2dd9('0x6'));var fs=require('fs');var path=require(_0x2dd9('0x7'));var rimraf=require('rimraf');var config=require(_0x2dd9('0x8'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x3639a9,_0x2c0357){return _0x3639a9[_0x2dd9('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x2dd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf01f=['bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','util','../../config/logger','api'];(function(_0x12d013,_0x286e4c){var _0x54220c=function(_0x31d518){while(--_0x31d518){_0x12d013['push'](_0x12d013['shift']());}};_0x54220c(++_0x286e4c);}(_0xf01f,0x110));var _0xff01=function(_0x43ee58,_0x45f451){_0x43ee58=_0x43ee58-0x0;var _0x43497d=_0xf01f[_0x43ee58];return _0x43497d;};'use strict';var _=require('lodash');var util=require(_0xff01('0x0'));var logger=require(_0xff01('0x1'))(_0xff01('0x2'));var moment=require('moment');var BPromise=require(_0xff01('0x3'));var rp=require(_0xff01('0x4'));var fs=require('fs');var path=require(_0xff01('0x5'));var rimraf=require('rimraf');var config=require(_0xff01('0x6'));var attributes=require(_0xff01('0x7'));module[_0xff01('0x8')]=function(_0x1e140d,_0x19e2b9){return _0x1e140d[_0xff01('0x9')]('SquareDetailsReport',attributes,{'tableName':_0xff01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 980f6b5..c34f2e0 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 _0x3423=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','catch'];(function(_0x31e67b,_0xadf177){var _0x13e802=function(_0x2b5888){while(--_0x2b5888){_0x31e67b['push'](_0x31e67b['shift']());}};_0x13e802(++_0xadf177);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}exports[_0x3342('0x15')]=function(_0x2075cb){var _0x12947a=this;return new Promise(function(_0x156c24,_0x45a3ca){return db[_0x3342('0x16')][_0x3342('0x17')](_0x2075cb['body'],{'raw':_0x2075cb[_0x3342('0x18')]?_0x2075cb[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cb86f){logger[_0x3342('0x13')]('CreateSquareDetailsReport',_0x2075cb);logger[_0x3342('0x1a')](_0x3342('0x15'),_0x2075cb,JSON['stringify'](_0x3cb86f));_0x156c24(_0x3cb86f);})[_0x3342('0x1b')](function(_0x5a0658){logger[_0x3342('0x10')](_0x3342('0x15'),_0x5a0658[_0x3342('0x12')],_0x2075cb);_0x45a3ca(_0x12947a[_0x3342('0x10')](0x1f4,_0x5a0658[_0x3342('0x12')]));});});}; \ No newline at end of file +var _0x4e2e=['options','raw','CreateSquareDetailsReport','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SquareDetailsReport','create','body'];(function(_0x526f9d,_0x4add1d){var _0x1c03e0=function(_0x38074d){while(--_0x38074d){_0x526f9d['push'](_0x526f9d['shift']());}};_0x1c03e0(++_0x4add1d);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3e58b9,_0x537130){_0x3e58b9=_0x3e58b9-0x0;var _0x24e740=_0x4e2e[_0x3e58b9];return _0x24e740;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}exports['CreateSquareDetailsReport']=function(_0x196f16){var _0x54c80b=this;return new Promise(function(_0x1d5e9d,_0x3f313b){return db[_0xe4e2('0x15')][_0xe4e2('0x16')](_0x196f16[_0xe4e2('0x17')],{'raw':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x19')]===undefined?!![]:![]:!![]})[_0xe4e2('0xc')](function(_0x362741){logger['info'](_0xe4e2('0x1a'),_0x196f16);logger[_0xe4e2('0x1b')](_0xe4e2('0x1a'),_0x196f16,JSON[_0xe4e2('0x11')](_0x362741));_0x1d5e9d(_0x362741);})[_0xe4e2('0x1c')](function(_0x23b466){logger[_0xe4e2('0x12')]('CreateSquareDetailsReport',_0x23b466[_0xe4e2('0x13')],_0x196f16);_0x3f313b(_0x54c80b[_0xe4e2('0x12')](0x1f4,_0x23b466[_0xe4e2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 5d8cc50..f8c5e57 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 _0x02fe=['index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','./system.controller','get'];(function(_0x55c066,_0x580eca){var _0x453857=function(_0x57478d){while(--_0x57478d){_0x55c066['push'](_0x55c066['shift']());}};_0x453857(++_0x580eca);}(_0x02fe,0x115));var _0xe02f=function(_0x61f1d,_0x24581b){_0x61f1d=_0x61f1d-0x0;var _0x2006a6=_0x02fe[_0x61f1d];return _0x2006a6;};'use strict';var express=require(_0xe02f('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe02f('0x1'));router[_0xe02f('0x2')]('/',auth['isAuthenticated'](),controller[_0xe02f('0x3')]);router['get'](_0xe02f('0x4'),auth[_0xe02f('0x5')](),controller[_0xe02f('0x6')]);module[_0xe02f('0x7')]=router; \ No newline at end of file +var _0x3b0c=['isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x4610b1,_0x1d49c2){var _0x2ac81b=function(_0x2da6c3){while(--_0x2da6c3){_0x4610b1['push'](_0x4610b1['shift']());}};_0x2ac81b(++_0x1d49c2);}(_0x3b0c,0x8b));var _0xc3b0=function(_0x4310dd,_0x245c35){_0x4310dd=_0x4310dd-0x0;var _0x116183=_0x3b0c[_0x4310dd];return _0x116183;};'use strict';var express=require(_0xc3b0('0x0'));var router=express[_0xc3b0('0x1')]();var auth=require(_0xc3b0('0x2'));var controller=require(_0xc3b0('0x3'));router[_0xc3b0('0x4')]('/',auth[_0xc3b0('0x5')](),controller['index']);router[_0xc3b0('0x4')](_0xc3b0('0x6'),auth[_0xc3b0('0x5')](),controller[_0xc3b0('0x7')]);module[_0xc3b0('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 419f48d..cf10c81 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 _0xeca2=['params','pid','split','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','index','then','json','catch','killProcess','components/import/cm'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0xeca2,0x1a5));var _0x2eca=function(_0x35774f,_0x9338be){_0x35774f=_0x35774f-0x0;var _0x39c0cf=_0xeca2[_0x35774f];return _0x39c0cf;};'use strict';var info=require(_0x2eca('0x0'));var exec=require(_0x2eca('0x1'))[_0x2eca('0x2')];var logger=require(_0x2eca('0x3'))(_0x2eca('0x4'));var util=require('util');var BPromise=require(_0x2eca('0x5'));var _=require(_0x2eca('0x6'));function handleError(_0x4a581f,_0x5de45d,_0x69c823){_0x5de45d=_0x5de45d||0x1f4;return function(_0x1f159e){logger['error'](_0x2eca('0x7'),_0x69c823,_0x5de45d,util[_0x2eca('0x8')](_0x1f159e,{'showHidden':![],'depth':null}));delete _0x1f159e['name'];_0x4a581f[_0x2eca('0x9')](_0x5de45d)['send'](_0x1f159e);};}exports[_0x2eca('0xa')]=function(_0x2477fd,_0x3bb90a){return info['getAllData']()[_0x2eca('0xb')](function(_0x1c4f10){return _0x3bb90a[_0x2eca('0x9')](0xc8)[_0x2eca('0xc')](_0x1c4f10);})[_0x2eca('0xd')](function(_0x570ced){return _0x3bb90a[_0x2eca('0x9')](0x1f4)['json'](_0x570ced);});};exports[_0x2eca('0xe')]=function(_0x2dd975,_0x224d45){var _0x39352e=[_0x2eca('0xf')];return new BPromise(function(_0x18f1d9,_0x579fc8){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x2dd975[_0x2eca('0x10')][_0x2eca('0x11')]),function(_0x2a5def,_0x5adb71,_0xaa79f4){if(_0x2a5def){return _0x579fc8(_0x2a5def);}return _0x18f1d9(_0x5adb71);});})[_0x2eca('0xb')](function(_0xa72ba1){var _0x39fccd=![];var _0xa27339=_0xa72ba1[_0x2eca('0x12')](/\n/);for(var _0x48d0c8=0x0,_0x16ca76=_0x39352e['length'];_0x48d0c8<_0x16ca76,_0x39fccd===![];_0x48d0c8+=0x1){if(_0xa72ba1['indexOf'](_0x39352e[_0x48d0c8])>=0x0){_0x39fccd=!![];}}if(!_0x39fccd){throw new Error(util[_0x2eca('0x13')](_0x2eca('0x14'),_0x2dd975[_0x2eca('0x10')][_0x2eca('0x11')]));}process[_0x2eca('0x15')](_0x2dd975[_0x2eca('0x10')][_0x2eca('0x11')],'SIGINT');return _0x224d45[_0x2eca('0x9')](0xc8)[_0x2eca('0xc')]({'message':util['format'](_0x2eca('0x16'),_0x2dd975['params']['pid'])});})[_0x2eca('0xd')](handleError(_0x224d45,null,_0x2eca('0xe')));}; \ No newline at end of file +var _0xafb6=['indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split'];(function(_0x30f87a,_0x2cce5a){var _0x3a8efc=function(_0x225d6b){while(--_0x225d6b){_0x30f87a['push'](_0x30f87a['shift']());}};_0x3a8efc(++_0x2cce5a);}(_0xafb6,0x8d));var _0x6afb=function(_0x162ee0,_0x291661){_0x162ee0=_0x162ee0-0x0;var _0x48fc5e=_0xafb6[_0x162ee0];return _0x48fc5e;};'use strict';var info=require(_0x6afb('0x0'));var exec=require(_0x6afb('0x1'))[_0x6afb('0x2')];var logger=require(_0x6afb('0x3'))('api');var util=require(_0x6afb('0x4'));var BPromise=require(_0x6afb('0x5'));var _=require(_0x6afb('0x6'));function handleError(_0x286c1b,_0x344e04,_0x14789d){_0x344e04=_0x344e04||0x1f4;return function(_0x24c5ee){logger['error'](_0x6afb('0x7'),_0x14789d,_0x344e04,util[_0x6afb('0x8')](_0x24c5ee,{'showHidden':![],'depth':null}));delete _0x24c5ee['name'];_0x286c1b[_0x6afb('0x9')](_0x344e04)[_0x6afb('0xa')](_0x24c5ee);};}exports[_0x6afb('0xb')]=function(_0x806a4a,_0x5dcc70){return info[_0x6afb('0xc')]()[_0x6afb('0xd')](function(_0x4bcd65){return _0x5dcc70[_0x6afb('0x9')](0xc8)[_0x6afb('0xe')](_0x4bcd65);})[_0x6afb('0xf')](function(_0x15638b){return _0x5dcc70['status'](0x1f4)[_0x6afb('0xe')](_0x15638b);});};exports['killProcess']=function(_0x30d51a,_0x140d85){var _0x1cecec=[_0x6afb('0x10')];return new BPromise(function(_0x2790b8,_0x47bbbd){return exec(util[_0x6afb('0x11')](_0x6afb('0x12'),_0x30d51a[_0x6afb('0x13')]['pid']),function(_0x36834e,_0x3e43e4,_0x5f49dc){if(_0x36834e){return _0x47bbbd(_0x36834e);}return _0x2790b8(_0x3e43e4);});})['then'](function(_0x1885f6){var _0x1fc7a2=![];var _0x427599=_0x1885f6[_0x6afb('0x14')](/\n/);for(var _0x2ca040=0x0,_0xc9f2c9=_0x1cecec['length'];_0x2ca040<_0xc9f2c9,_0x1fc7a2===![];_0x2ca040+=0x1){if(_0x1885f6[_0x6afb('0x15')](_0x1cecec[_0x2ca040])>=0x0){_0x1fc7a2=!![];}}if(!_0x1fc7a2){throw new Error(util[_0x6afb('0x11')](_0x6afb('0x16'),_0x30d51a[_0x6afb('0x13')][_0x6afb('0x17')]));}process['kill'](_0x30d51a['params'][_0x6afb('0x17')],_0x6afb('0x18'));return _0x140d85[_0x6afb('0x9')](0xc8)['json']({'message':util[_0x6afb('0x11')](_0x6afb('0x19'),_0x30d51a[_0x6afb('0x13')][_0x6afb('0x17')])});})[_0x6afb('0xf')](handleError(_0x140d85,null,_0x6afb('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index f756b84..ab90d4e 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 _0xfd0c=['../../config/environment','./tag.controller','get','isAuthenticated','/:id','post','create','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20b8bc,_0xb0d38f){var _0x24a130=function(_0x7f41c0){while(--_0x7f41c0){_0x20b8bc['push'](_0x20b8bc['shift']());}};_0x24a130(++_0xb0d38f);}(_0xfd0c,0x139));var _0xcfd0=function(_0x4459b8,_0x3271b8){_0x4459b8=_0x4459b8-0x0;var _0x4a4b07=_0xfd0c[_0x4459b8];return _0x4a4b07;};'use strict';var multer=require(_0xcfd0('0x0'));var util=require('util');var path=require(_0xcfd0('0x1'));var timeout=require(_0xcfd0('0x2'));var express=require(_0xcfd0('0x3'));var router=express[_0xcfd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcfd0('0x5'));var interaction=require(_0xcfd0('0x6'));var config=require(_0xcfd0('0x7'));var controller=require(_0xcfd0('0x8'));router[_0xcfd0('0x9')]('/',auth[_0xcfd0('0xa')](),controller['index']);router[_0xcfd0('0x9')](_0xcfd0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcfd0('0xc')]('/',auth[_0xcfd0('0xa')](),controller[_0xcfd0('0xd')]);router['put']('/:id',auth[_0xcfd0('0xa')](),controller['update']);router['delete'](_0xcfd0('0xb'),auth[_0xcfd0('0xa')](),controller[_0xcfd0('0xe')]);module[_0xcfd0('0xf')]=router; \ No newline at end of file +var _0xa531=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0xa531,0x12e));var _0x1a53=function(_0x460791,_0x29dbd6){_0x460791=_0x460791-0x0;var _0x5a40c5=_0xa531[_0x460791];return _0x5a40c5;};'use strict';var multer=require(_0x1a53('0x0'));var util=require(_0x1a53('0x1'));var path=require(_0x1a53('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a53('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1a53('0x4'));var interaction=require(_0x1a53('0x5'));var config=require(_0x1a53('0x6'));var controller=require(_0x1a53('0x7'));router['get']('/',auth[_0x1a53('0x8')](),controller[_0x1a53('0x9')]);router[_0x1a53('0xa')](_0x1a53('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1a53('0xc')]('/',auth[_0x1a53('0x8')](),controller[_0x1a53('0xd')]);router[_0x1a53('0xe')](_0x1a53('0xb'),auth['isAuthenticated'](),controller[_0x1a53('0xf')]);router[_0x1a53('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1a53('0x11')]);module[_0x1a53('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index d5c3107..306e4b7 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 _0x5a1c=['exports','STRING','sequelize'];(function(_0x57b0af,_0x45a8ae){var _0x1487e2=function(_0x8dd353){while(--_0x8dd353){_0x57b0af['push'](_0x57b0af['shift']());}};_0x1487e2(++_0x45a8ae);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0xce8484,_0x3c7af1){_0xce8484=_0xce8484-0x0;var _0x2d027c=_0x5a1c[_0xce8484];return _0x2d027c;};'use strict';var Sequelize=require(_0xc5a1('0x0'));module[_0xc5a1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc5a1('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xc5a1('0x2')]}}; \ No newline at end of file +var _0xa1b9=['#0091EA','sequelize','STRING','name'];(function(_0x4f8d80,_0x554ccd){var _0x3cc653=function(_0x2f83e1){while(--_0x2f83e1){_0x4f8d80['push'](_0x4f8d80['shift']());}};_0x3cc653(++_0x554ccd);}(_0xa1b9,0x71));var _0x9a1b=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa1b9[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0x9a1b('0x0'));module['exports']={'name':{'type':Sequelize[_0x9a1b('0x1')],'unique':_0x9a1b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9a1b('0x1')],'defaultValue':_0x9a1b('0x3')},'description':{'type':Sequelize[_0x9a1b('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 50296dd..541643a 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 _0xc788=['where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Tags','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter'];(function(_0xca931c,_0x4e722e){var _0x48fca5=function(_0x47c1fe){while(--_0x47c1fe){_0xca931c['push'](_0xca931c['shift']());}};_0x48fca5(++_0x4e722e);}(_0xc788,0xc4));var _0x8c78=function(_0x38b3cb,_0x4ad7b3){_0x38b3cb=_0x38b3cb-0x0;var _0x5a9a84=_0xc788[_0x38b3cb];return _0x5a9a84;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];function respondWithStatusCode(_0x4b2eca,_0x56a802){_0x56a802=_0x56a802||0xcc;return function(_0x349dfa){if(_0x349dfa){return _0x4b2eca[_0x8c78('0x18')](_0x56a802);}return _0x4b2eca[_0x8c78('0x19')](_0x56a802)[_0x8c78('0x1a')]();};}function respondWithResult(_0x2eedff,_0x3d1306){_0x3d1306=_0x3d1306||0xc8;return function(_0xe5f8ae){if(_0xe5f8ae){return _0x2eedff[_0x8c78('0x19')](_0x3d1306)[_0x8c78('0x1b')](_0xe5f8ae);}};}function respondWithFilteredResult(_0x1157d0,_0x4ff4b0){return function(_0x1fa78e){if(_0x1fa78e){var _0x293cfe=typeof _0x4ff4b0['offset']===_0x8c78('0x1c')&&typeof _0x4ff4b0[_0x8c78('0x1d')]===_0x8c78('0x1c');var _0x23824e=_0x1fa78e[_0x8c78('0x1e')];var _0x461eff=_0x293cfe?0x0:_0x4ff4b0['offset'];var _0x4f7bf9=_0x293cfe?_0x1fa78e[_0x8c78('0x1e')]:_0x4ff4b0['offset']+_0x4ff4b0['limit'];var _0xece4f0;if(_0x4f7bf9>=_0x23824e){_0x4f7bf9=_0x23824e;_0xece4f0=0xc8;}else{_0xece4f0=0xce;}_0x1157d0['status'](_0xece4f0);return _0x1157d0[_0x8c78('0x1f')](_0x8c78('0x20'),_0x461eff+'-'+_0x4f7bf9+'/'+_0x23824e)['json'](_0x1fa78e);}return null;};}function patchUpdates(_0x6c9a12){return function(_0x5b111b){try{jsonpatch[_0x8c78('0x21')](_0x5b111b,_0x6c9a12,!![]);}catch(_0x3af73c){return BPromise['reject'](_0x3af73c);}return _0x5b111b[_0x8c78('0x22')]();};}function saveUpdates(_0x188cc3,_0x499603){return function(_0x2bc595){if(_0x2bc595){return _0x2bc595[_0x8c78('0x23')](_0x188cc3)[_0x8c78('0x24')](function(_0x9581c6){return _0x9581c6;});}return null;};}function removeEntity(_0x215940,_0x20f483){return function(_0xbfdf6f){if(_0xbfdf6f){return _0xbfdf6f[_0x8c78('0x25')]()[_0x8c78('0x24')](function(){var _0x4a7d20=_0xbfdf6f[_0x8c78('0x26')]({'plain':!![]});var _0x458763=_0x8c78('0x27');return db['UserProfileResource'][_0x8c78('0x25')]({'where':{'type':_0x458763,'resourceId':_0x4a7d20['id']}})['then'](function(){return _0xbfdf6f;});})[_0x8c78('0x24')](function(){_0x215940[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x496c51,_0x583a74){return function(_0x2568d5){if(!_0x2568d5){_0x496c51['sendStatus'](0x194);}return _0x2568d5;};}function handleError(_0x20b128,_0x4376da){_0x4376da=_0x4376da||0x1f4;return function(_0x394c1d){logger[_0x8c78('0x28')](_0x394c1d[_0x8c78('0x29')]);if(_0x394c1d[_0x8c78('0x2a')]){delete _0x394c1d['name'];}_0x20b128[_0x8c78('0x19')](_0x4376da)['send'](_0x394c1d);};}exports[_0x8c78('0x2b')]=function(_0x17f4c8,_0xb69c52){var _0x4e764f={},_0x1f1a0c={},_0x3816d2={'count':0x0,'rows':[]};var _0x4f0005=_[_0x8c78('0x2c')](db[_0x8c78('0x2d')][_0x8c78('0x2e')],function(_0x487a4c){return{'name':_0x487a4c[_0x8c78('0x2f')],'type':_0x487a4c[_0x8c78('0x30')][_0x8c78('0x31')]};});_0x1f1a0c['model']=_[_0x8c78('0x2c')](_0x4f0005,_0x8c78('0x2a'));_0x1f1a0c['query']=_[_0x8c78('0x32')](_0x17f4c8[_0x8c78('0x33')]);_0x1f1a0c[_0x8c78('0x34')]=_[_0x8c78('0x35')](_0x1f1a0c[_0x8c78('0x36')],_0x1f1a0c[_0x8c78('0x33')]);_0x4e764f[_0x8c78('0x37')]=_[_0x8c78('0x35')](_0x1f1a0c[_0x8c78('0x36')],qs[_0x8c78('0x38')](_0x17f4c8['query'][_0x8c78('0x38')]));_0x4e764f[_0x8c78('0x37')]=_0x4e764f[_0x8c78('0x37')][_0x8c78('0x39')]?_0x4e764f[_0x8c78('0x37')]:_0x1f1a0c['model'];if(!_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x3a')](_0x8c78('0x3b'))){_0x4e764f['limit']=qs[_0x8c78('0x1d')](_0x17f4c8[_0x8c78('0x33')]['limit']);_0x4e764f[_0x8c78('0x3c')]=qs['offset'](_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x3c')]);}_0x4e764f[_0x8c78('0x3d')]=qs[_0x8c78('0x3e')](_0x17f4c8['query'][_0x8c78('0x3e')]);_0x4e764f['where']=qs[_0x8c78('0x34')](_[_0x8c78('0x3f')](_0x17f4c8[_0x8c78('0x33')],_0x1f1a0c['filters']),_0x4f0005);if(_0x17f4c8['query'][_0x8c78('0x40')]){_0x4e764f[_0x8c78('0x41')]=_[_0x8c78('0x42')](_0x4e764f[_0x8c78('0x41')],{'$or':_[_0x8c78('0x2c')](_0x4f0005,function(_0x484931){if(_0x484931[_0x8c78('0x30')]!==_0x8c78('0x43')){var _0x1f0a2b={};_0x1f0a2b[_0x484931[_0x8c78('0x2a')]]={'$like':'%'+_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x40')]+'%'};return _0x1f0a2b;}})});}_0x4e764f=_[_0x8c78('0x42')]({},_0x4e764f,_0x17f4c8['options']);var _0x3995f4={'where':_0x4e764f[_0x8c78('0x41')]};return db['Tag']['count'](_0x3995f4)[_0x8c78('0x24')](function(_0x1612d5){_0x3816d2['count']=_0x1612d5;if(_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x44')]){_0x4e764f['include']=[{'all':!![]}];}return db[_0x8c78('0x2d')][_0x8c78('0x45')](_0x4e764f);})['then'](function(_0x10d521){_0x3816d2[_0x8c78('0x46')]=_0x10d521;return _0x3816d2;})[_0x8c78('0x24')](respondWithFilteredResult(_0xb69c52,_0x4e764f))[_0x8c78('0x47')](handleError(_0xb69c52,null));};exports[_0x8c78('0x48')]=function(_0x4e4880,_0x545d90){var _0x2841c2={'raw':!![],'where':{'id':_0x4e4880[_0x8c78('0x49')]['id']}},_0x2f6a6b={};_0x2f6a6b[_0x8c78('0x36')]=_[_0x8c78('0x32')](db[_0x8c78('0x2d')][_0x8c78('0x2e')]);_0x2f6a6b[_0x8c78('0x33')]=_[_0x8c78('0x32')](_0x4e4880[_0x8c78('0x33')]);_0x2f6a6b[_0x8c78('0x34')]=_['intersection'](_0x2f6a6b[_0x8c78('0x36')],_0x2f6a6b[_0x8c78('0x33')]);_0x2841c2[_0x8c78('0x37')]=_[_0x8c78('0x35')](_0x2f6a6b[_0x8c78('0x36')],qs['fields'](_0x4e4880[_0x8c78('0x33')][_0x8c78('0x38')]));_0x2841c2[_0x8c78('0x37')]=_0x2841c2[_0x8c78('0x37')][_0x8c78('0x39')]?_0x2841c2['attributes']:_0x2f6a6b[_0x8c78('0x36')];if(_0x4e4880['query']['includeAll']){_0x2841c2[_0x8c78('0x4a')]=[{'all':!![]}];}_0x2841c2=_[_0x8c78('0x42')]({},_0x2841c2,_0x4e4880[_0x8c78('0x4b')]);return db['Tag'][_0x8c78('0x4c')](_0x2841c2)[_0x8c78('0x24')](handleEntityNotFound(_0x545d90,null))[_0x8c78('0x24')](respondWithResult(_0x545d90,null))[_0x8c78('0x47')](handleError(_0x545d90,null));};exports[_0x8c78('0x4d')]=function(_0x38083e,_0x26103c){return db[_0x8c78('0x2d')][_0x8c78('0x4d')](_0x38083e['body'],{})[_0x8c78('0x24')](function(_0x1fcf97){var _0xba0de6=_0x38083e[_0x8c78('0x4e')]['get']({'plain':!![]});if(!_0xba0de6)throw new Error(_0x8c78('0x4f'));if(_0xba0de6[_0x8c78('0x50')]===_0x8c78('0x4e')){var _0x431125=_0x1fcf97['get']({'plain':!![]});var _0x336b95=_0x8c78('0x27');return db[_0x8c78('0x51')]['find']({'where':{'name':_0x336b95,'userProfileId':_0xba0de6[_0x8c78('0x52')]},'raw':!![]})['then'](function(_0xae80d){if(_0xae80d&&_0xae80d[_0x8c78('0x53')]===0x0){return db[_0x8c78('0x54')][_0x8c78('0x4d')]({'name':_0x431125[_0x8c78('0x2a')],'resourceId':_0x431125['id'],'type':_0xae80d[_0x8c78('0x2a')],'sectionId':_0xae80d['id']},{})[_0x8c78('0x24')](function(){return _0x1fcf97;});}else{return _0x1fcf97;}})[_0x8c78('0x47')](function(_0x19d807){logger[_0x8c78('0x28')](_0x8c78('0x55'),_0x19d807);throw _0x19d807;});}return _0x1fcf97;})[_0x8c78('0x24')](respondWithResult(_0x26103c,0xc9))[_0x8c78('0x47')](handleError(_0x26103c,null));};exports[_0x8c78('0x23')]=function(_0x54b40d,_0x22fe6c){if(_0x54b40d[_0x8c78('0x56')]['id']){delete _0x54b40d[_0x8c78('0x56')]['id'];}return db[_0x8c78('0x2d')]['find']({'where':{'id':_0x54b40d[_0x8c78('0x49')]['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x22fe6c,null))[_0x8c78('0x24')](saveUpdates(_0x54b40d[_0x8c78('0x56')],null))[_0x8c78('0x24')](respondWithResult(_0x22fe6c,null))[_0x8c78('0x47')](handleError(_0x22fe6c,null));};exports['destroy']=function(_0x1e616c,_0x42a34e){return db['Tag'][_0x8c78('0x4c')]({'where':{'id':_0x1e616c['params']['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x42a34e,null))[_0x8c78('0x24')](removeEntity(_0x42a34e,null))[_0x8c78('0x47')](handleError(_0x42a34e,null));}; \ No newline at end of file +var _0xd691=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Tag','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','includeAll','include','rows','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Tags','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x55f02,_0x4abf61){var _0x1b7244=function(_0x31aead){while(--_0x31aead){_0x55f02['push'](_0x55f02['shift']());}};_0x1b7244(++_0x4abf61);}(_0xd691,0xe6));var _0x1d69=function(_0x1e53ca,_0x2692ed){_0x1e53ca=_0x1e53ca-0x0;var _0x55e658=_0xd691[_0x1e53ca];return _0x55e658;};'use strict';var emlformat=require(_0x1d69('0x0'));var rimraf=require(_0x1d69('0x1'));var zipdir=require(_0x1d69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d69('0x3'));var moment=require(_0x1d69('0x4'));var BPromise=require(_0x1d69('0x5'));var Mustache=require(_0x1d69('0x6'));var util=require(_0x1d69('0x7'));var path=require(_0x1d69('0x8'));var sox=require(_0x1d69('0x9'));var csv=require(_0x1d69('0xa'));var ejs=require(_0x1d69('0xb'));var fs=require('fs');var fs_extra=require(_0x1d69('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d69('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d69('0xe'));var toCsv=require(_0x1d69('0xa'));var querystring=require(_0x1d69('0xf'));var Papa=require(_0x1d69('0x10'));var Redis=require('ioredis');var authService=require(_0x1d69('0x11'));var qs=require(_0x1d69('0x12'));var as=require(_0x1d69('0x13'));var hardwareService=require(_0x1d69('0x14'));var logger=require(_0x1d69('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1d69('0x16'));var licenseUtil=require(_0x1d69('0x17'));var db=require(_0x1d69('0x18'))['db'];function respondWithStatusCode(_0x36ca70,_0x3f703a){_0x3f703a=_0x3f703a||0xcc;return function(_0x78b25d){if(_0x78b25d){return _0x36ca70[_0x1d69('0x19')](_0x3f703a);}return _0x36ca70[_0x1d69('0x1a')](_0x3f703a)[_0x1d69('0x1b')]();};}function respondWithResult(_0x7121cb,_0x292721){_0x292721=_0x292721||0xc8;return function(_0x1f4271){if(_0x1f4271){return _0x7121cb[_0x1d69('0x1a')](_0x292721)['json'](_0x1f4271);}};}function respondWithFilteredResult(_0x52f53d,_0x12e7cd){return function(_0x3fb5d2){if(_0x3fb5d2){var _0x29dd32=typeof _0x12e7cd[_0x1d69('0x1c')]===_0x1d69('0x1d')&&typeof _0x12e7cd[_0x1d69('0x1e')]==='undefined';var _0xb7f031=_0x3fb5d2[_0x1d69('0x1f')];var _0x34f6d4=_0x29dd32?0x0:_0x12e7cd['offset'];var _0x4cebea=_0x29dd32?_0x3fb5d2[_0x1d69('0x1f')]:_0x12e7cd[_0x1d69('0x1c')]+_0x12e7cd[_0x1d69('0x1e')];var _0x57bb5d;if(_0x4cebea>=_0xb7f031){_0x4cebea=_0xb7f031;_0x57bb5d=0xc8;}else{_0x57bb5d=0xce;}_0x52f53d[_0x1d69('0x1a')](_0x57bb5d);return _0x52f53d[_0x1d69('0x20')](_0x1d69('0x21'),_0x34f6d4+'-'+_0x4cebea+'/'+_0xb7f031)[_0x1d69('0x22')](_0x3fb5d2);}return null;};}function patchUpdates(_0x3ef4dc){return function(_0x24feaa){try{jsonpatch[_0x1d69('0x23')](_0x24feaa,_0x3ef4dc,!![]);}catch(_0x62968f){return BPromise['reject'](_0x62968f);}return _0x24feaa[_0x1d69('0x24')]();};}function saveUpdates(_0x122238,_0x1786e1){return function(_0x228d18){if(_0x228d18){return _0x228d18['update'](_0x122238)[_0x1d69('0x25')](function(_0x411ca0){return _0x411ca0;});}return null;};}function removeEntity(_0x2b9a7a,_0x54783d){return function(_0x5352d3){if(_0x5352d3){return _0x5352d3['destroy']()[_0x1d69('0x25')](function(){var _0x1d9b42=_0x5352d3[_0x1d69('0x26')]({'plain':!![]});var _0x1c91bf='Tags';return db[_0x1d69('0x27')][_0x1d69('0x28')]({'where':{'type':_0x1c91bf,'resourceId':_0x1d9b42['id']}})['then'](function(){return _0x5352d3;});})[_0x1d69('0x25')](function(){_0x2b9a7a[_0x1d69('0x1a')](0xcc)[_0x1d69('0x1b')]();});}};}function handleEntityNotFound(_0x30aefe,_0x2d3f2e){return function(_0x247130){if(!_0x247130){_0x30aefe['sendStatus'](0x194);}return _0x247130;};}function handleError(_0x23043c,_0x2c837e){_0x2c837e=_0x2c837e||0x1f4;return function(_0x3c6b2b){logger[_0x1d69('0x29')](_0x3c6b2b[_0x1d69('0x2a')]);if(_0x3c6b2b[_0x1d69('0x2b')]){delete _0x3c6b2b[_0x1d69('0x2b')];}_0x23043c[_0x1d69('0x1a')](_0x2c837e)[_0x1d69('0x2c')](_0x3c6b2b);};}exports[_0x1d69('0x2d')]=function(_0x2e3a8b,_0x5e8e8e){var _0x3affc9={},_0x5bbbe3={},_0xed55d9={'count':0x0,'rows':[]};var _0x13fa02=_[_0x1d69('0x2e')](db[_0x1d69('0x2f')]['rawAttributes'],function(_0x59b677){return{'name':_0x59b677[_0x1d69('0x30')],'type':_0x59b677['type'][_0x1d69('0x31')]};});_0x5bbbe3[_0x1d69('0x32')]=_[_0x1d69('0x2e')](_0x13fa02,_0x1d69('0x2b'));_0x5bbbe3[_0x1d69('0x33')]=_[_0x1d69('0x34')](_0x2e3a8b[_0x1d69('0x33')]);_0x5bbbe3[_0x1d69('0x35')]=_[_0x1d69('0x36')](_0x5bbbe3[_0x1d69('0x32')],_0x5bbbe3[_0x1d69('0x33')]);_0x3affc9[_0x1d69('0x37')]=_[_0x1d69('0x36')](_0x5bbbe3[_0x1d69('0x32')],qs['fields'](_0x2e3a8b[_0x1d69('0x33')][_0x1d69('0x38')]));_0x3affc9[_0x1d69('0x37')]=_0x3affc9[_0x1d69('0x37')][_0x1d69('0x39')]?_0x3affc9['attributes']:_0x5bbbe3[_0x1d69('0x32')];if(!_0x2e3a8b[_0x1d69('0x33')][_0x1d69('0x3a')](_0x1d69('0x3b'))){_0x3affc9['limit']=qs[_0x1d69('0x1e')](_0x2e3a8b[_0x1d69('0x33')][_0x1d69('0x1e')]);_0x3affc9[_0x1d69('0x1c')]=qs[_0x1d69('0x1c')](_0x2e3a8b['query']['offset']);}_0x3affc9['order']=qs[_0x1d69('0x3c')](_0x2e3a8b[_0x1d69('0x33')]['sort']);_0x3affc9[_0x1d69('0x3d')]=qs[_0x1d69('0x35')](_[_0x1d69('0x3e')](_0x2e3a8b['query'],_0x5bbbe3[_0x1d69('0x35')]),_0x13fa02);if(_0x2e3a8b[_0x1d69('0x33')][_0x1d69('0x3f')]){_0x3affc9[_0x1d69('0x3d')]=_['merge'](_0x3affc9[_0x1d69('0x3d')],{'$or':_[_0x1d69('0x2e')](_0x13fa02,function(_0xe27a75){if(_0xe27a75[_0x1d69('0x40')]!=='VIRTUAL'){var _0x1a46ae={};_0x1a46ae[_0xe27a75[_0x1d69('0x2b')]]={'$like':'%'+_0x2e3a8b[_0x1d69('0x33')][_0x1d69('0x3f')]+'%'};return _0x1a46ae;}})});}_0x3affc9=_[_0x1d69('0x41')]({},_0x3affc9,_0x2e3a8b[_0x1d69('0x42')]);var _0x3885e6={'where':_0x3affc9['where']};return db[_0x1d69('0x2f')][_0x1d69('0x1f')](_0x3885e6)['then'](function(_0x3d68c3){_0xed55d9['count']=_0x3d68c3;if(_0x2e3a8b[_0x1d69('0x33')][_0x1d69('0x43')]){_0x3affc9[_0x1d69('0x44')]=[{'all':!![]}];}return db[_0x1d69('0x2f')]['findAll'](_0x3affc9);})[_0x1d69('0x25')](function(_0x21dfc2){_0xed55d9[_0x1d69('0x45')]=_0x21dfc2;return _0xed55d9;})['then'](respondWithFilteredResult(_0x5e8e8e,_0x3affc9))[_0x1d69('0x46')](handleError(_0x5e8e8e,null));};exports['show']=function(_0x531387,_0x3cee45){var _0x3862c1={'raw':!![],'where':{'id':_0x531387[_0x1d69('0x47')]['id']}},_0x5451b6={};_0x5451b6['model']=_[_0x1d69('0x34')](db[_0x1d69('0x2f')]['rawAttributes']);_0x5451b6[_0x1d69('0x33')]=_[_0x1d69('0x34')](_0x531387[_0x1d69('0x33')]);_0x5451b6['filters']=_[_0x1d69('0x36')](_0x5451b6[_0x1d69('0x32')],_0x5451b6[_0x1d69('0x33')]);_0x3862c1[_0x1d69('0x37')]=_[_0x1d69('0x36')](_0x5451b6[_0x1d69('0x32')],qs[_0x1d69('0x38')](_0x531387[_0x1d69('0x33')][_0x1d69('0x38')]));_0x3862c1[_0x1d69('0x37')]=_0x3862c1[_0x1d69('0x37')][_0x1d69('0x39')]?_0x3862c1[_0x1d69('0x37')]:_0x5451b6[_0x1d69('0x32')];if(_0x531387[_0x1d69('0x33')][_0x1d69('0x43')]){_0x3862c1['include']=[{'all':!![]}];}_0x3862c1=_[_0x1d69('0x41')]({},_0x3862c1,_0x531387[_0x1d69('0x42')]);return db[_0x1d69('0x2f')]['find'](_0x3862c1)['then'](handleEntityNotFound(_0x3cee45,null))[_0x1d69('0x25')](respondWithResult(_0x3cee45,null))['catch'](handleError(_0x3cee45,null));};exports[_0x1d69('0x48')]=function(_0x370645,_0x131304){return db['Tag']['create'](_0x370645[_0x1d69('0x49')],{})['then'](function(_0x14f405){var _0x5b77a5=_0x370645['user'][_0x1d69('0x26')]({'plain':!![]});if(!_0x5b77a5)throw new Error(_0x1d69('0x4a'));if(_0x5b77a5[_0x1d69('0x4b')]===_0x1d69('0x4c')){var _0x442041=_0x14f405[_0x1d69('0x26')]({'plain':!![]});var _0x3f0092=_0x1d69('0x4d');return db['UserProfileSection'][_0x1d69('0x4e')]({'where':{'name':_0x3f0092,'userProfileId':_0x5b77a5[_0x1d69('0x4f')]},'raw':!![]})[_0x1d69('0x25')](function(_0x1ab373){if(_0x1ab373&&_0x1ab373['autoAssociation']===0x0){return db[_0x1d69('0x27')]['create']({'name':_0x442041[_0x1d69('0x2b')],'resourceId':_0x442041['id'],'type':_0x1ab373[_0x1d69('0x2b')],'sectionId':_0x1ab373['id']},{})[_0x1d69('0x25')](function(){return _0x14f405;});}else{return _0x14f405;}})['catch'](function(_0x29d058){logger['error'](_0x1d69('0x50'),_0x29d058);throw _0x29d058;});}return _0x14f405;})[_0x1d69('0x25')](respondWithResult(_0x131304,0xc9))[_0x1d69('0x46')](handleError(_0x131304,null));};exports['update']=function(_0x16db3f,_0x5503f7){if(_0x16db3f[_0x1d69('0x49')]['id']){delete _0x16db3f[_0x1d69('0x49')]['id'];}return db[_0x1d69('0x2f')][_0x1d69('0x4e')]({'where':{'id':_0x16db3f[_0x1d69('0x47')]['id']}})[_0x1d69('0x25')](handleEntityNotFound(_0x5503f7,null))[_0x1d69('0x25')](saveUpdates(_0x16db3f[_0x1d69('0x49')],null))[_0x1d69('0x25')](respondWithResult(_0x5503f7,null))[_0x1d69('0x46')](handleError(_0x5503f7,null));};exports[_0x1d69('0x28')]=function(_0xfc58ef,_0x25f7e5){return db[_0x1d69('0x2f')][_0x1d69('0x4e')]({'where':{'id':_0xfc58ef[_0x1d69('0x47')]['id']}})[_0x1d69('0x25')](handleEntityNotFound(_0x25f7e5,null))['then'](removeEntity(_0x25f7e5,null))[_0x1d69('0x46')](handleError(_0x25f7e5,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index baf7fcc..e5687ae 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 _0xc006=['api','moment','bluebird','path','../../config/environment','./tag.attributes','Tag','tools_tags','lodash'];(function(_0x23cf05,_0x452a9c){var _0x5f6985=function(_0x371eb0){while(--_0x371eb0){_0x23cf05['push'](_0x23cf05['shift']());}};_0x5f6985(++_0x452a9c);}(_0xc006,0x1e5));var _0x6c00=function(_0x16438a,_0x3544be){_0x16438a=_0x16438a-0x0;var _0x9d2e74=_0xc006[_0x16438a];return _0x9d2e74;};'use strict';var _=require(_0x6c00('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6c00('0x1'));var moment=require(_0x6c00('0x2'));var BPromise=require(_0x6c00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c00('0x4'));var rimraf=require('rimraf');var config=require(_0x6c00('0x5'));var attributes=require(_0x6c00('0x6'));module['exports']=function(_0x3c0e2c,_0x581c8f){return _0x3c0e2c['define'](_0x6c00('0x7'),attributes,{'tableName':_0x6c00('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7119=['rimraf','./tag.attributes','exports','define','tools_tags','util','api','bluebird','request-promise','path'];(function(_0x4d0eba,_0x80b6d8){var _0x4aa97d=function(_0x5dd462){while(--_0x5dd462){_0x4d0eba['push'](_0x4d0eba['shift']());}};_0x4aa97d(++_0x80b6d8);}(_0x7119,0x1c7));var _0x9711=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x7119[_0x4d8789];return _0x404e41;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var logger=require('../../config/logger')(_0x9711('0x1'));var moment=require('moment');var BPromise=require(_0x9711('0x2'));var rp=require(_0x9711('0x3'));var fs=require('fs');var path=require(_0x9711('0x4'));var rimraf=require(_0x9711('0x5'));var config=require('../../config/environment');var attributes=require(_0x9711('0x6'));module[_0x9711('0x7')]=function(_0x2ffe6c,_0x101827){return _0x2ffe6c[_0x9711('0x8')]('Tag',attributes,{'tableName':_0x9711('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7420f44..c7df6cc 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 _0x9b67=['code','message','Tag,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error'];(function(_0x18ae72,_0x1d05d9){var _0x34f4ef=function(_0x4fce13){while(--_0x4fce13){_0x18ae72['push'](_0x18ae72['shift']());}};_0x34f4ef(++_0x1d05d9);}(_0x9b67,0xf6));var _0x79b6=function(_0x5bf448,_0x393118){_0x5bf448=_0x5bf448-0x0;var _0x1889d5=_0x9b67[_0x5bf448];return _0x1889d5;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var moment=require(_0x79b6('0x2'));var BPromise=require(_0x79b6('0x3'));var rs=require(_0x79b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79b6('0x5'))['db'];var utils=require(_0x79b6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x79b6('0x7'));var jayson=require(_0x79b6('0x8'));var client=jayson[_0x79b6('0x9')][_0x79b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa6a05,_0x128543,_0x34adbe){return new BPromise(function(_0x58ae2d,_0x1270a7){return client[_0x79b6('0xb')](_0xfa6a05,_0x34adbe)[_0x79b6('0xc')](function(_0x3d28cd){logger[_0x79b6('0xd')]('Tag,\x20%s,\x20%s',_0x128543,_0x79b6('0xe'));logger[_0x79b6('0xf')](_0x79b6('0x10'),_0x128543,_0x79b6('0xe'),JSON['stringify'](_0x3d28cd));if(_0x3d28cd['error']){if(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x12')]===0x1f4){logger[_0x79b6('0x11')]('Tag,\x20%s,\x20%s',_0x128543,_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);return _0x1270a7(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);}logger[_0x79b6('0x11')](_0x79b6('0x14'),_0x128543,_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);return _0x58ae2d(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);}else{logger[_0x79b6('0xd')](_0x79b6('0x14'),_0x128543,_0x79b6('0xe'));_0x58ae2d(_0x3d28cd['result'][_0x79b6('0x13')]);}})[_0x79b6('0x15')](function(_0xc36fd3){logger[_0x79b6('0x11')](_0x79b6('0x14'),_0x128543,_0xc36fd3);_0x1270a7(_0xc36fd3);});});} \ No newline at end of file +var _0x402f=['http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','message','error','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x47cd33,_0x3145f9){var _0x2a98f1=function(_0x28ffcb){while(--_0x28ffcb){_0x47cd33['push'](_0x47cd33['shift']());}};_0x2a98f1(++_0x3145f9);}(_0x402f,0x6f));var _0xf402=function(_0x4098b1,_0x2e7521){_0x4098b1=_0x4098b1-0x0;var _0x50ba90=_0x402f[_0x4098b1];return _0x50ba90;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var moment=require(_0xf402('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf402('0x2'));var db=require(_0xf402('0x3'))['db'];var utils=require(_0xf402('0x4'));var logger=require('../../config/logger')(_0xf402('0x5'));var config=require('../../config/environment');var jayson=require(_0xf402('0x6'));var client=jayson[_0xf402('0x7')][_0xf402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8774,_0xa1b27d,_0x55c515){return new BPromise(function(_0x4d1771,_0x2f0ffe){return client[_0xf402('0x9')](_0x2a8774,_0x55c515)[_0xf402('0xa')](function(_0xdc18e0){logger[_0xf402('0xb')](_0xf402('0xc'),_0xa1b27d,_0xf402('0xd'));logger[_0xf402('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'),JSON['stringify'](_0xdc18e0));if(_0xdc18e0['error']){if(_0xdc18e0['error']['code']===0x1f4){logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0['error']['message']);return _0x2f0ffe(_0xdc18e0['error'][_0xf402('0xf')]);}logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0[_0xf402('0x10')][_0xf402('0xf')]);return _0x4d1771(_0xdc18e0[_0xf402('0x10')]['message']);}else{logger[_0xf402('0xb')]('Tag,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'));_0x4d1771(_0xdc18e0['result']['message']);}})['catch'](function(_0xb45d00){logger[_0xf402('0x10')](_0xf402('0xc'),_0xa1b27d,_0xb45d00);_0x2f0ffe(_0xb45d00);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index d9f9e45..3e05de9 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 d50ffd8..711f363 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 _0xd8b0=['exports','sequelize'];(function(_0x16dded,_0x48a20f){var _0x5837e4=function(_0x2e1897){while(--_0x2e1897){_0x16dded['push'](_0x16dded['shift']());}};_0x5837e4(++_0x48a20f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xb7e7[_0x3c2a69];return _0x596bc8;};'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/team/team.controller.js b/server/api/team/team.controller.js index 1c33fbe..0717631 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 _0x2a19=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','Teams','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','sort','Queues','addQueues','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','penalty','QueueId','Queue','findOrCreate','emit','Queue:save','User','online','voicePause','UserVoiceQueueRt','upsert','interface','format','SIP/%s','TeamVoiceQueue','all','spread','removeAgents','parse','Queue:remove','getAgents','eml-format','rimraf'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0x2a19,0x199));var _0x92a1=function(_0x224b8c,_0x2b93e1){_0x224b8c=_0x224b8c-0x0;var _0x551d30=_0x2a19[_0x224b8c];return _0x551d30;};'use strict';var emlformat=require(_0x92a1('0x0'));var rimraf=require(_0x92a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x92a1('0x2'));var moment=require(_0x92a1('0x3'));var BPromise=require(_0x92a1('0x4'));var Mustache=require(_0x92a1('0x5'));var util=require(_0x92a1('0x6'));var path=require(_0x92a1('0x7'));var sox=require('sox');var csv=require(_0x92a1('0x8'));var ejs=require(_0x92a1('0x9'));var fs=require('fs');var fs_extra=require(_0x92a1('0xa'));var _=require(_0x92a1('0xb'));var squel=require(_0x92a1('0xc'));var crypto=require(_0x92a1('0xd'));var jsforce=require(_0x92a1('0xe'));var deskjs=require(_0x92a1('0xf'));var toCsv=require(_0x92a1('0x8'));var querystring=require(_0x92a1('0x10'));var Papa=require(_0x92a1('0x11'));var Redis=require(_0x92a1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x92a1('0x13'));var as=require(_0x92a1('0x14'));var hardwareService=require(_0x92a1('0x15'));var logger=require(_0x92a1('0x16'))('api');var utils=require(_0x92a1('0x17'));var config=require(_0x92a1('0x18'));var licenseUtil=require(_0x92a1('0x19'));var db=require(_0x92a1('0x1a'))['db'];config[_0x92a1('0x1b')]=_[_0x92a1('0x1c')](config['redis'],{'host':_0x92a1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x92a1('0x1e'))[_0x92a1('0x1f')](socket);function respondWithStatusCode(_0x38ed36,_0x5ed067){_0x5ed067=_0x5ed067||0xcc;return function(_0x30d835){if(_0x30d835){return _0x38ed36['sendStatus'](_0x5ed067);}return _0x38ed36['status'](_0x5ed067)['end']();};}function respondWithResult(_0xf0957e,_0x341618){_0x341618=_0x341618||0xc8;return function(_0x472d6f){if(_0x472d6f){return _0xf0957e[_0x92a1('0x20')](_0x341618)[_0x92a1('0x21')](_0x472d6f);}};}function respondWithFilteredResult(_0x5b1b6a,_0x278de2){return function(_0x3eca19){if(_0x3eca19){var _0x1837d8=typeof _0x278de2['offset']===_0x92a1('0x22')&&typeof _0x278de2[_0x92a1('0x23')]===_0x92a1('0x22');var _0x1e2025=_0x3eca19[_0x92a1('0x24')];var _0x5af519=_0x1837d8?0x0:_0x278de2[_0x92a1('0x25')];var _0x3c680b=_0x1837d8?_0x3eca19[_0x92a1('0x24')]:_0x278de2[_0x92a1('0x25')]+_0x278de2[_0x92a1('0x23')];var _0x11531b;if(_0x3c680b>=_0x1e2025){_0x3c680b=_0x1e2025;_0x11531b=0xc8;}else{_0x11531b=0xce;}_0x5b1b6a[_0x92a1('0x20')](_0x11531b);return _0x5b1b6a[_0x92a1('0x26')](_0x92a1('0x27'),_0x5af519+'-'+_0x3c680b+'/'+_0x1e2025)[_0x92a1('0x21')](_0x3eca19);}return null;};}function patchUpdates(_0x13790f){return function(_0x55f448){try{jsonpatch[_0x92a1('0x28')](_0x55f448,_0x13790f,!![]);}catch(_0x4f5b4e){return BPromise['reject'](_0x4f5b4e);}return _0x55f448['save']();};}function saveUpdates(_0x5392fc,_0x5c6a01){return function(_0x5d092e){if(_0x5d092e){return _0x5d092e[_0x92a1('0x29')](_0x5392fc)[_0x92a1('0x2a')](function(_0x55f4d1){return _0x55f4d1;});}return null;};}function removeEntity(_0x18bf20,_0x1e818a){return function(_0x3130a4){if(_0x3130a4){return _0x3130a4[_0x92a1('0x2b')]()[_0x92a1('0x2a')](function(){var _0x35fcf5=_0x3130a4[_0x92a1('0x2c')]({'plain':!![]});var _0x1244a7=_0x92a1('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x1244a7,'resourceId':_0x35fcf5['id']}})[_0x92a1('0x2a')](function(){return _0x3130a4;});})[_0x92a1('0x2a')](function(){_0x18bf20[_0x92a1('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x871d93,_0xa54a22){return function(_0x4b6d45){if(!_0x4b6d45){_0x871d93[_0x92a1('0x2e')](0x194);}return _0x4b6d45;};}function handleError(_0x5b8326,_0x5bf40b){_0x5bf40b=_0x5bf40b||0x1f4;return function(_0x404772){logger[_0x92a1('0x2f')](_0x404772[_0x92a1('0x30')]);if(_0x404772[_0x92a1('0x31')]){delete _0x404772[_0x92a1('0x31')];}_0x5b8326[_0x92a1('0x20')](_0x5bf40b)[_0x92a1('0x32')](_0x404772);};}exports[_0x92a1('0x33')]=function(_0x5cec1e,_0x323abe){var _0x84955e={},_0xc2d462={},_0x376577={'count':0x0,'rows':[]};var _0xd11440=_[_0x92a1('0x34')](db[_0x92a1('0x35')][_0x92a1('0x36')],function(_0x49c9cc){return{'name':_0x49c9cc[_0x92a1('0x37')],'type':_0x49c9cc[_0x92a1('0x38')][_0x92a1('0x39')]};});_0xc2d462[_0x92a1('0x3a')]=_['map'](_0xd11440,_0x92a1('0x31'));_0xc2d462[_0x92a1('0x3b')]=_[_0x92a1('0x3c')](_0x5cec1e['query']);_0xc2d462[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0xc2d462[_0x92a1('0x3a')],_0xc2d462[_0x92a1('0x3b')]);_0x84955e['attributes']=_[_0x92a1('0x3e')](_0xc2d462['model'],qs[_0x92a1('0x3f')](_0x5cec1e[_0x92a1('0x3b')]['fields']));_0x84955e[_0x92a1('0x40')]=_0x84955e[_0x92a1('0x40')][_0x92a1('0x41')]?_0x84955e[_0x92a1('0x40')]:_0xc2d462[_0x92a1('0x3a')];if(!_0x5cec1e['query'][_0x92a1('0x42')](_0x92a1('0x43'))){_0x84955e['limit']=qs[_0x92a1('0x23')](_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x23')]);_0x84955e[_0x92a1('0x25')]=qs[_0x92a1('0x25')](_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x25')]);}_0x84955e[_0x92a1('0x44')]=qs['sort'](_0x5cec1e[_0x92a1('0x3b')]['sort']);_0x84955e[_0x92a1('0x45')]=qs[_0x92a1('0x3d')](_[_0x92a1('0x46')](_0x5cec1e['query'],_0xc2d462[_0x92a1('0x3d')]),_0xd11440);if(_0x5cec1e[_0x92a1('0x3b')]['filter']){_0x84955e[_0x92a1('0x45')]=_[_0x92a1('0x47')](_0x84955e[_0x92a1('0x45')],{'$or':_['map'](_0xd11440,function(_0x4cd81e){if(_0x4cd81e[_0x92a1('0x38')]!==_0x92a1('0x48')){var _0x334d46={};_0x334d46[_0x4cd81e['name']]={'$like':'%'+_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x49')]+'%'};return _0x334d46;}})});}_0x84955e=_[_0x92a1('0x47')]({},_0x84955e,_0x5cec1e[_0x92a1('0x4a')]);var _0x325e31={'where':_0x84955e[_0x92a1('0x45')]};return db[_0x92a1('0x35')][_0x92a1('0x24')](_0x325e31)[_0x92a1('0x2a')](function(_0x3f1e48){_0x376577['count']=_0x3f1e48;if(_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x4b')]){_0x84955e[_0x92a1('0x4c')]=[{'all':!![]}];}return db['Team'][_0x92a1('0x4d')](_0x84955e);})['then'](function(_0xf456cb){_0x376577[_0x92a1('0x4e')]=_0xf456cb;return _0x376577;})[_0x92a1('0x2a')](respondWithFilteredResult(_0x323abe,_0x84955e))[_0x92a1('0x4f')](handleError(_0x323abe,null));};exports[_0x92a1('0x50')]=function(_0x5c93c6,_0x4959f3){var _0x49e52f={'raw':![],'where':{'id':_0x5c93c6[_0x92a1('0x51')]['id']}},_0x23e472={};_0x23e472[_0x92a1('0x3a')]=_['keys'](db['Team'][_0x92a1('0x36')]);_0x23e472[_0x92a1('0x3b')]=_[_0x92a1('0x3c')](_0x5c93c6[_0x92a1('0x3b')]);_0x23e472[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0x23e472[_0x92a1('0x3a')],_0x23e472[_0x92a1('0x3b')]);_0x49e52f[_0x92a1('0x40')]=_[_0x92a1('0x3e')](_0x23e472[_0x92a1('0x3a')],qs['fields'](_0x5c93c6['query'][_0x92a1('0x3f')]));_0x49e52f[_0x92a1('0x40')]=_0x49e52f[_0x92a1('0x40')][_0x92a1('0x41')]?_0x49e52f['attributes']:_0x23e472[_0x92a1('0x3a')];if(_0x5c93c6[_0x92a1('0x3b')][_0x92a1('0x4b')]){_0x49e52f[_0x92a1('0x4c')]=[{'all':!![]}];}_0x49e52f=_[_0x92a1('0x47')]({},_0x49e52f,_0x5c93c6[_0x92a1('0x4a')]);return db[_0x92a1('0x35')][_0x92a1('0x52')](_0x49e52f)[_0x92a1('0x2a')](handleEntityNotFound(_0x4959f3,null))[_0x92a1('0x2a')](respondWithResult(_0x4959f3,null))[_0x92a1('0x4f')](handleError(_0x4959f3,null));};exports[_0x92a1('0x53')]=function(_0x27dac7,_0x6e52b6){return db[_0x92a1('0x35')][_0x92a1('0x53')](_0x27dac7[_0x92a1('0x54')],{})[_0x92a1('0x2a')](function(_0x63bba6){var _0x5e2735=_0x27dac7[_0x92a1('0x55')][_0x92a1('0x2c')]({'plain':!![]});if(!_0x5e2735)throw new Error(_0x92a1('0x56'));if(_0x5e2735[_0x92a1('0x57')]===_0x92a1('0x55')){var _0x723a5e=_0x63bba6[_0x92a1('0x2c')]({'plain':!![]});var _0x15ae04=_0x92a1('0x2d');return db[_0x92a1('0x58')]['find']({'where':{'name':_0x15ae04,'userProfileId':_0x5e2735['userProfileId']},'raw':!![]})['then'](function(_0x52686d){if(_0x52686d&&_0x52686d[_0x92a1('0x59')]===0x0){return db[_0x92a1('0x5a')][_0x92a1('0x53')]({'name':_0x723a5e[_0x92a1('0x31')],'resourceId':_0x723a5e['id'],'type':_0x52686d[_0x92a1('0x31')],'sectionId':_0x52686d['id']},{})[_0x92a1('0x2a')](function(){return _0x63bba6;});}else{return _0x63bba6;}})['catch'](function(_0x3bb045){logger[_0x92a1('0x2f')](_0x92a1('0x5b'),_0x3bb045);throw _0x3bb045;});}return _0x63bba6;})['then'](respondWithResult(_0x6e52b6,0xc9))['catch'](handleError(_0x6e52b6,null));};exports[_0x92a1('0x29')]=function(_0x4cd1f4,_0x4baf50){if(_0x4cd1f4[_0x92a1('0x54')]['id']){delete _0x4cd1f4[_0x92a1('0x54')]['id'];}return db[_0x92a1('0x35')]['find']({'where':{'id':_0x4cd1f4[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x4baf50,null))['then'](saveUpdates(_0x4cd1f4['body'],null))[_0x92a1('0x2a')](respondWithResult(_0x4baf50,null))[_0x92a1('0x4f')](handleError(_0x4baf50,null));};exports[_0x92a1('0x2b')]=function(_0x35487c,_0x234d34){return db[_0x92a1('0x35')][_0x92a1('0x52')]({'where':{'id':_0x35487c[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x234d34,null))['then'](removeEntity(_0x234d34,null))[_0x92a1('0x4f')](handleError(_0x234d34,null));};exports[_0x92a1('0x5c')]=function(_0xbf6c6c,_0x31f2ad,_0x50ba87){return db['Team'][_0x92a1('0x5d')]({'where':{'id':_0xbf6c6c['params']['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x31f2ad,null))[_0x92a1('0x2a')](function(_0x2d3aed){if(!_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')]||!utils[_0x92a1('0x5f')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')])){throw new db[(_0x92a1('0x60'))][(_0x92a1('0x61'))](_0x92a1('0x62'));}var _0x5c450c={};var _0x4c1d03={};_0x4c1d03[_0x92a1('0x3a')]=_['keys'](db[_[_0x92a1('0x63')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')][_0x92a1('0x64')]())+'Queue'][_0x92a1('0x36')]);_0x4c1d03[_0x92a1('0x3b')]=_['keys'](_0xbf6c6c[_0x92a1('0x3b')]);_0x4c1d03[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0x4c1d03[_0x92a1('0x3a')],_0x4c1d03['query']);_0x5c450c[_0x92a1('0x40')]=_[_0x92a1('0x3e')](_0x4c1d03[_0x92a1('0x3a')],qs['fields'](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x3f')]));_0x5c450c['attributes']=_0x5c450c[_0x92a1('0x40')][_0x92a1('0x41')]?_0x5c450c[_0x92a1('0x40')]:_0x4c1d03['model'];_0x5c450c[_0x92a1('0x23')]=qs[_0x92a1('0x23')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x23')]);_0x5c450c[_0x92a1('0x25')]=qs[_0x92a1('0x25')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x25')]);_0x5c450c[_0x92a1('0x44')]=qs[_0x92a1('0x65')](_0xbf6c6c[_0x92a1('0x3b')]['sort']);_0x5c450c[_0x92a1('0x45')]=qs[_0x92a1('0x3d')](_[_0x92a1('0x46')](_0xbf6c6c[_0x92a1('0x3b')],_0x4c1d03['filters']));_0x5c450c=_[_0x92a1('0x47')]({},_0x5c450c,_0xbf6c6c[_0x92a1('0x4a')]);return _0x2d3aed[_0x92a1('0x2c')+_[_0x92a1('0x63')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')][_0x92a1('0x64')]())+_0x92a1('0x66')](_0x5c450c);})[_0x92a1('0x2a')](respondWithResult(_0x31f2ad,null))[_0x92a1('0x4f')](handleError(_0x31f2ad,null));};exports[_0x92a1('0x67')]=function(_0xf41866,_0x3380ff,_0x5bb17a){return db[_0x92a1('0x35')][_0x92a1('0x5d')]({'where':{'id':_0xf41866[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](function(_0x3bfa6a){if(_0x3bfa6a){if(!_0xf41866[_0x92a1('0x54')][_0x92a1('0x5e')]||!utils[_0x92a1('0x5f')](_0xf41866[_0x92a1('0x54')][_0x92a1('0x5e')])){throw new db['Sequelize'][(_0x92a1('0x61'))](_0x92a1('0x62'));}return _0x3bfa6a['add'+_[_0x92a1('0x63')](_0xf41866[_0x92a1('0x54')][_0x92a1('0x5e')]['toLowerCase']())+_0x92a1('0x66')](_0xf41866['body'][_0x92a1('0x68')]);}return null;})['then'](handleEntityNotFound(_0x3380ff,null))[_0x92a1('0x2a')](respondWithStatusCode(_0x3380ff,null))['catch'](handleError(_0x3380ff,null));};exports[_0x92a1('0x69')]=function(_0x41f6eb,_0x4f074b,_0x1e7da0){return db['Team'][_0x92a1('0x5d')]({'where':{'id':_0x41f6eb[_0x92a1('0x51')]['id']}})['then'](function(_0x41e60d){if(_0x41e60d){if(!_0x41f6eb[_0x92a1('0x3b')][_0x92a1('0x5e')]||!utils[_0x92a1('0x5f')](_0x41f6eb['query'][_0x92a1('0x5e')])){throw new db['Sequelize'][(_0x92a1('0x61'))](_0x92a1('0x62'));}return _0x41e60d['remove'+_[_0x92a1('0x63')](_0x41f6eb[_0x92a1('0x3b')][_0x92a1('0x5e')][_0x92a1('0x64')]())+_0x92a1('0x66')](_0x41f6eb['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x4f074b,null))['then'](respondWithStatusCode(_0x4f074b,null))[_0x92a1('0x4f')](handleError(_0x4f074b,null));};exports[_0x92a1('0x6a')]=function(_0x3cd7f8,_0x59601e){return db['Team'][_0x92a1('0x52')]({'where':{'id':_0x3cd7f8[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x59601e,null))['then'](function(_0xa2f097){if(_0xa2f097){var _0x55ba5f=[_0x92a1('0x6b'),_0x92a1('0x6c'),_0x92a1('0x6d'),_0x92a1('0x6e'),_0x92a1('0x6f'),_0x92a1('0x70'),_0x92a1('0x71')];return db[_0x92a1('0x72')][_0x92a1('0x73')](function(_0x18fff4){var _0x5807a0=_[_0x92a1('0x34')](_0x55ba5f,function(_0x41b11b){var _0x454860={'attributes':['id',_0x92a1('0x31')]};if(_0x41b11b==='Voice'){_0x454860['through']={'attributes':[_0x92a1('0x74')]};}return _0xa2f097['get'+_0x41b11b+'Queues'](_0x454860)[_0x92a1('0x2a')](function(_0x2bd5fc){var _0x25ff62=_['map'](_0x2bd5fc,function(_0x416fee){var _0x459fad=_[_0x92a1('0x34')](_0x3cd7f8['body'][_0x92a1('0x68')],function(_0x529725){var _0x26a4d6={'where':{'UserId':_0x529725,[_0x41b11b+_0x92a1('0x75')]:_0x416fee['id']},'transaction':_0x18fff4};if(_0x41b11b===_0x92a1('0x6b')){_0x26a4d6[_0x92a1('0x1c')]={'penalty':_0x416fee['TeamVoiceQueue'][_0x92a1('0x74')]};}return db['User'+_0x41b11b+_0x92a1('0x76')][_0x92a1('0x77')](_0x26a4d6)[_0x92a1('0x2a')](function(){socket[_0x92a1('0x78')](_0x92a1('0x55')+_0x41b11b+_0x92a1('0x79'),{'UserId':_0x529725,[_0x41b11b+'QueueId']:_0x416fee['id']});if(_0x41b11b!==_0x92a1('0x6b'))return;return db[_0x92a1('0x7a')][_0x92a1('0x4d')]({'where':{'id':_0x3cd7f8[_0x92a1('0x54')][_0x92a1('0x68')],'online':0x1},'attributes':['id',_0x92a1('0x31'),_0x92a1('0x7b'),_0x92a1('0x7c'),'interface'],'raw':!![]})[_0x92a1('0x2a')](function(_0x54a6e9){var _0x22e9e3=_[_0x92a1('0x34')](_0x54a6e9,function(_0x32f0b5){return db[_0x92a1('0x7d')][_0x92a1('0x7e')]({'membername':_0x32f0b5['name'],'UserId':_0x32f0b5['id'],'queue_name':_0x416fee[_0x92a1('0x31')],'VoiceQueueId':_0x416fee['id'],'interface':_['isNil'](_0x32f0b5[_0x92a1('0x7f')])?util[_0x92a1('0x80')](_0x92a1('0x81'),_0x32f0b5[_0x92a1('0x31')]):_0x32f0b5[_0x92a1('0x7f')],'paused':_0x32f0b5[_0x92a1('0x7c')]||![],'penalty':_0x416fee[_0x92a1('0x82')][_0x92a1('0x74')]},{'transaction':_0x18fff4});});return Promise[_0x92a1('0x83')](_0x22e9e3);});});});return Promise['all'](_0x459fad);});return Promise[_0x92a1('0x83')](_0x25ff62);});});return Promise['all'](_0x5807a0)[_0x92a1('0x2a')](function(){return _0xa2f097[_0x92a1('0x6a')](_0x3cd7f8[_0x92a1('0x54')][_0x92a1('0x68')],{'transaction':_0x18fff4})[_0x92a1('0x84')](function(_0x23d292){return _0x23d292;});});});}})[_0x92a1('0x2a')](respondWithResult(_0x59601e,null))[_0x92a1('0x4f')](handleError(_0x59601e,null));};exports[_0x92a1('0x85')]=function(_0x1833c0,_0x109bd8){return db[_0x92a1('0x35')][_0x92a1('0x52')]({'where':{'id':_0x1833c0[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x109bd8,null))[_0x92a1('0x2a')](function(_0x29e689){if(_0x29e689){var _0x48d1b0=[_0x92a1('0x6b'),_0x92a1('0x6c'),_0x92a1('0x6d'),'Sms','Fax',_0x92a1('0x70'),_0x92a1('0x71')];return db[_0x92a1('0x72')]['transaction'](function(_0x25859e){var _0x41197b=_[_0x92a1('0x34')](_0x48d1b0,function(_0x2f2c2b){var _0x25bd3a={'attributes':['id','name']};return _0x29e689[_0x92a1('0x2c')+_0x2f2c2b+_0x92a1('0x66')](_0x25bd3a)['then'](function(_0x3ab526){var _0x43f03b=_[_0x92a1('0x34')](_0x3ab526,function(_0x3d1874){return _0x3d1874[_0x92a1('0x85')](_0x1833c0[_0x92a1('0x3b')][_0x92a1('0x68')],{'transaction':_0x25859e})[_0x92a1('0x2a')](function(){var _0x43837c=JSON[_0x92a1('0x86')]('['+_0x1833c0[_0x92a1('0x3b')]['ids']+']');var _0x63a39e=_[_0x92a1('0x34')](_0x43837c,function(_0x37fbf9){socket[_0x92a1('0x78')](_0x92a1('0x55')+_0x2f2c2b+_0x92a1('0x87'),{'UserId':Number(_0x37fbf9),[_0x2f2c2b+_0x92a1('0x75')]:_0x3d1874['id']});if(_0x2f2c2b!==_0x92a1('0x6b'))return;return db[_0x92a1('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x3d1874['id'],'UserId':_0x37fbf9},'transaction':_0x25859e});});return Promise[_0x92a1('0x83')](_0x63a39e);});});return Promise[_0x92a1('0x83')](_0x43f03b);});});return Promise[_0x92a1('0x83')](_0x41197b)[_0x92a1('0x2a')](function(){return _0x29e689[_0x92a1('0x85')](_0x1833c0[_0x92a1('0x3b')][_0x92a1('0x68')],{'transaction':_0x25859e});});});}})[_0x92a1('0x2a')](respondWithStatusCode(_0x109bd8,null))['catch'](handleError(_0x109bd8,null));};exports[_0x92a1('0x88')]=function(_0x5b56ae,_0x36914e,_0x537031){var _0x2bea75={};var _0x2125c1={};var _0x41b8eb;var _0x243eff;return db[_0x92a1('0x35')][_0x92a1('0x5d')]({'where':{'id':_0x5b56ae['params']['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x36914e,null))['then'](function(_0x3408c2){if(_0x3408c2){_0x41b8eb=_0x3408c2;_0x2125c1[_0x92a1('0x3a')]=_['keys'](db[_0x92a1('0x7a')][_0x92a1('0x36')]);_0x2125c1[_0x92a1('0x3b')]=_['keys'](_0x5b56ae[_0x92a1('0x3b')]);_0x2125c1[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0x2125c1[_0x92a1('0x3a')],_0x2125c1[_0x92a1('0x3b')]);_0x2bea75[_0x92a1('0x40')]=_[_0x92a1('0x3e')](_0x2125c1[_0x92a1('0x3a')],qs[_0x92a1('0x3f')](_0x5b56ae['query'][_0x92a1('0x3f')]));_0x2bea75[_0x92a1('0x40')]=_0x2bea75[_0x92a1('0x40')][_0x92a1('0x41')]?_0x2bea75['attributes']:_0x2125c1[_0x92a1('0x3a')];_0x2bea75[_0x92a1('0x44')]=qs['sort'](_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x65')]);_0x2bea75[_0x92a1('0x45')]=qs[_0x92a1('0x3d')](_['pick'](_0x5b56ae[_0x92a1('0x3b')],_0x2125c1[_0x92a1('0x3d')]));if(_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x49')]){_0x2bea75[_0x92a1('0x45')]=_[_0x92a1('0x47')](_0x2bea75[_0x92a1('0x45')],{'$or':_[_0x92a1('0x34')](_0x2bea75['attributes'],function(_0x5170a8){var _0x34a7f1={};_0x34a7f1[_0x5170a8]={'$like':'%'+_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x49')]+'%'};return _0x34a7f1;})});}_0x2bea75=_[_0x92a1('0x47')]({},_0x2bea75,_0x5b56ae[_0x92a1('0x4a')]);return _0x41b8eb[_0x92a1('0x88')](_0x2bea75);}})['then'](function(_0x2f9ca){if(_0x2f9ca){_0x243eff=_0x2f9ca[_0x92a1('0x41')];if(!_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x42')](_0x92a1('0x43'))){_0x2bea75[_0x92a1('0x23')]=qs[_0x92a1('0x23')](_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x23')]);_0x2bea75[_0x92a1('0x25')]=qs['offset'](_0x5b56ae['query'][_0x92a1('0x25')]);}return _0x41b8eb['getAgents'](_0x2bea75);}})[_0x92a1('0x2a')](function(_0x237054){if(_0x237054){return _0x237054?{'count':_0x243eff,'rows':_0x237054}:null;}})[_0x92a1('0x2a')](respondWithResult(_0x36914e,null))[_0x92a1('0x4f')](handleError(_0x36914e,null));}; \ No newline at end of file +var _0xbb63=['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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','findOne','add','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','QueueId','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','parse','Queue:remove','getAgents','pick','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0xbb63,0x186));var _0x3bb6=function(_0x15c7ab,_0x317c91){_0x15c7ab=_0x15c7ab-0x0;var _0x2ba2cc=_0xbb63[_0x15c7ab];return _0x2ba2cc;};'use strict';var emlformat=require(_0x3bb6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bb6('0x1'));var jsonpatch=require(_0x3bb6('0x2'));var rp=require(_0x3bb6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3bb6('0x4'));var path=require(_0x3bb6('0x5'));var sox=require(_0x3bb6('0x6'));var csv=require(_0x3bb6('0x7'));var ejs=require(_0x3bb6('0x8'));var fs=require('fs');var fs_extra=require(_0x3bb6('0x9'));var _=require(_0x3bb6('0xa'));var squel=require(_0x3bb6('0xb'));var crypto=require(_0x3bb6('0xc'));var jsforce=require(_0x3bb6('0xd'));var deskjs=require(_0x3bb6('0xe'));var toCsv=require(_0x3bb6('0x7'));var querystring=require(_0x3bb6('0xf'));var Papa=require(_0x3bb6('0x10'));var Redis=require('ioredis');var authService=require(_0x3bb6('0x11'));var qs=require(_0x3bb6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bb6('0x13'));var logger=require(_0x3bb6('0x14'))(_0x3bb6('0x15'));var utils=require(_0x3bb6('0x16'));var config=require(_0x3bb6('0x17'));var licenseUtil=require(_0x3bb6('0x18'));var db=require(_0x3bb6('0x19'))['db'];config[_0x3bb6('0x1a')]=_[_0x3bb6('0x1b')](config[_0x3bb6('0x1a')],{'host':_0x3bb6('0x1c'),'port':0x18eb});var socket=require(_0x3bb6('0x1d'))(new Redis(config[_0x3bb6('0x1a')]));require(_0x3bb6('0x1e'))['register'](socket);function respondWithStatusCode(_0x527ce0,_0xe5c79e){_0xe5c79e=_0xe5c79e||0xcc;return function(_0x4ecc89){if(_0x4ecc89){return _0x527ce0[_0x3bb6('0x1f')](_0xe5c79e);}return _0x527ce0[_0x3bb6('0x20')](_0xe5c79e)[_0x3bb6('0x21')]();};}function respondWithResult(_0x19a47c,_0x3dcfd7){_0x3dcfd7=_0x3dcfd7||0xc8;return function(_0x24ccee){if(_0x24ccee){return _0x19a47c[_0x3bb6('0x20')](_0x3dcfd7)[_0x3bb6('0x22')](_0x24ccee);}};}function respondWithFilteredResult(_0x2a745e,_0x122d8b){return function(_0x2cf9f8){if(_0x2cf9f8){var _0x5ad898=typeof _0x122d8b[_0x3bb6('0x23')]===_0x3bb6('0x24')&&typeof _0x122d8b['limit']===_0x3bb6('0x24');var _0x2e95c4=_0x2cf9f8[_0x3bb6('0x25')];var _0x1219d9=_0x5ad898?0x0:_0x122d8b['offset'];var _0x2fbac6=_0x5ad898?_0x2cf9f8[_0x3bb6('0x25')]:_0x122d8b[_0x3bb6('0x23')]+_0x122d8b[_0x3bb6('0x26')];var _0x136ad7;if(_0x2fbac6>=_0x2e95c4){_0x2fbac6=_0x2e95c4;_0x136ad7=0xc8;}else{_0x136ad7=0xce;}_0x2a745e[_0x3bb6('0x20')](_0x136ad7);return _0x2a745e[_0x3bb6('0x27')](_0x3bb6('0x28'),_0x1219d9+'-'+_0x2fbac6+'/'+_0x2e95c4)[_0x3bb6('0x22')](_0x2cf9f8);}return null;};}function patchUpdates(_0x3eaa8e){return function(_0x15023d){try{jsonpatch['apply'](_0x15023d,_0x3eaa8e,!![]);}catch(_0x50f242){return BPromise[_0x3bb6('0x29')](_0x50f242);}return _0x15023d[_0x3bb6('0x2a')]();};}function saveUpdates(_0x152bea,_0xaf5381){return function(_0x27bb2c){if(_0x27bb2c){return _0x27bb2c[_0x3bb6('0x2b')](_0x152bea)[_0x3bb6('0x2c')](function(_0x27b7e9){return _0x27b7e9;});}return null;};}function removeEntity(_0x1aedfa,_0x2eb1e3){return function(_0x2f1eac){if(_0x2f1eac){return _0x2f1eac[_0x3bb6('0x2d')]()['then'](function(){var _0xdd5182=_0x2f1eac[_0x3bb6('0x2e')]({'plain':!![]});var _0x1be102=_0x3bb6('0x2f');return db[_0x3bb6('0x30')]['destroy']({'where':{'type':_0x1be102,'resourceId':_0xdd5182['id']}})['then'](function(){return _0x2f1eac;});})[_0x3bb6('0x2c')](function(){_0x1aedfa[_0x3bb6('0x20')](0xcc)[_0x3bb6('0x21')]();});}};}function handleEntityNotFound(_0x1de2aa,_0x580f2d){return function(_0x4fb154){if(!_0x4fb154){_0x1de2aa[_0x3bb6('0x1f')](0x194);}return _0x4fb154;};}function handleError(_0x17d6bf,_0x20747e){_0x20747e=_0x20747e||0x1f4;return function(_0x38696c){logger[_0x3bb6('0x31')](_0x38696c[_0x3bb6('0x32')]);if(_0x38696c[_0x3bb6('0x33')]){delete _0x38696c[_0x3bb6('0x33')];}_0x17d6bf['status'](_0x20747e)[_0x3bb6('0x34')](_0x38696c);};}exports[_0x3bb6('0x35')]=function(_0x216296,_0x36eef3){var _0x314e4c={},_0x360e98={},_0x4297ce={'count':0x0,'rows':[]};var _0x5a89f4=_[_0x3bb6('0x36')](db[_0x3bb6('0x37')][_0x3bb6('0x38')],function(_0x3da270){return{'name':_0x3da270[_0x3bb6('0x39')],'type':_0x3da270[_0x3bb6('0x3a')]['key']};});_0x360e98['model']=_[_0x3bb6('0x36')](_0x5a89f4,_0x3bb6('0x33'));_0x360e98[_0x3bb6('0x3b')]=_[_0x3bb6('0x3c')](_0x216296['query']);_0x360e98[_0x3bb6('0x3d')]=_[_0x3bb6('0x3e')](_0x360e98[_0x3bb6('0x3f')],_0x360e98[_0x3bb6('0x3b')]);_0x314e4c[_0x3bb6('0x40')]=_['intersection'](_0x360e98[_0x3bb6('0x3f')],qs[_0x3bb6('0x41')](_0x216296['query']['fields']));_0x314e4c['attributes']=_0x314e4c[_0x3bb6('0x40')][_0x3bb6('0x42')]?_0x314e4c[_0x3bb6('0x40')]:_0x360e98[_0x3bb6('0x3f')];if(!_0x216296[_0x3bb6('0x3b')]['hasOwnProperty'](_0x3bb6('0x43'))){_0x314e4c[_0x3bb6('0x26')]=qs[_0x3bb6('0x26')](_0x216296['query'][_0x3bb6('0x26')]);_0x314e4c[_0x3bb6('0x23')]=qs[_0x3bb6('0x23')](_0x216296[_0x3bb6('0x3b')]['offset']);}_0x314e4c['order']=qs[_0x3bb6('0x44')](_0x216296[_0x3bb6('0x3b')][_0x3bb6('0x44')]);_0x314e4c[_0x3bb6('0x45')]=qs[_0x3bb6('0x3d')](_['pick'](_0x216296['query'],_0x360e98[_0x3bb6('0x3d')]),_0x5a89f4);if(_0x216296[_0x3bb6('0x3b')][_0x3bb6('0x46')]){_0x314e4c['where']=_[_0x3bb6('0x47')](_0x314e4c[_0x3bb6('0x45')],{'$or':_[_0x3bb6('0x36')](_0x5a89f4,function(_0x3dd9a8){if(_0x3dd9a8[_0x3bb6('0x3a')]!=='VIRTUAL'){var _0x3dcb38={};_0x3dcb38[_0x3dd9a8[_0x3bb6('0x33')]]={'$like':'%'+_0x216296['query']['filter']+'%'};return _0x3dcb38;}})});}_0x314e4c=_[_0x3bb6('0x47')]({},_0x314e4c,_0x216296[_0x3bb6('0x48')]);var _0x3fcc6e={'where':_0x314e4c[_0x3bb6('0x45')]};return db[_0x3bb6('0x37')][_0x3bb6('0x25')](_0x3fcc6e)[_0x3bb6('0x2c')](function(_0x3f9a1c){_0x4297ce[_0x3bb6('0x25')]=_0x3f9a1c;if(_0x216296[_0x3bb6('0x3b')][_0x3bb6('0x49')]){_0x314e4c[_0x3bb6('0x4a')]=[{'all':!![]}];}return db[_0x3bb6('0x37')][_0x3bb6('0x4b')](_0x314e4c);})[_0x3bb6('0x2c')](function(_0x4fc7a0){_0x4297ce[_0x3bb6('0x4c')]=_0x4fc7a0;return _0x4297ce;})['then'](respondWithFilteredResult(_0x36eef3,_0x314e4c))['catch'](handleError(_0x36eef3,null));};exports[_0x3bb6('0x4d')]=function(_0x334560,_0x56d65e){var _0x153d38={'raw':![],'where':{'id':_0x334560[_0x3bb6('0x4e')]['id']}},_0x23dc5e={};_0x23dc5e['model']=_[_0x3bb6('0x3c')](db[_0x3bb6('0x37')][_0x3bb6('0x38')]);_0x23dc5e[_0x3bb6('0x3b')]=_[_0x3bb6('0x3c')](_0x334560[_0x3bb6('0x3b')]);_0x23dc5e['filters']=_[_0x3bb6('0x3e')](_0x23dc5e['model'],_0x23dc5e['query']);_0x153d38[_0x3bb6('0x40')]=_['intersection'](_0x23dc5e[_0x3bb6('0x3f')],qs[_0x3bb6('0x41')](_0x334560[_0x3bb6('0x3b')][_0x3bb6('0x41')]));_0x153d38[_0x3bb6('0x40')]=_0x153d38[_0x3bb6('0x40')][_0x3bb6('0x42')]?_0x153d38['attributes']:_0x23dc5e[_0x3bb6('0x3f')];if(_0x334560[_0x3bb6('0x3b')]['includeAll']){_0x153d38[_0x3bb6('0x4a')]=[{'all':!![]}];}_0x153d38=_[_0x3bb6('0x47')]({},_0x153d38,_0x334560['options']);return db[_0x3bb6('0x37')][_0x3bb6('0x4f')](_0x153d38)[_0x3bb6('0x2c')](handleEntityNotFound(_0x56d65e,null))[_0x3bb6('0x2c')](respondWithResult(_0x56d65e,null))['catch'](handleError(_0x56d65e,null));};exports[_0x3bb6('0x50')]=function(_0xfc81d6,_0x5b5cb7){return db['Team'][_0x3bb6('0x50')](_0xfc81d6[_0x3bb6('0x51')],{})[_0x3bb6('0x2c')](function(_0x26f7bb){var _0x5c56aa=_0xfc81d6[_0x3bb6('0x52')][_0x3bb6('0x2e')]({'plain':!![]});if(!_0x5c56aa)throw new Error(_0x3bb6('0x53'));if(_0x5c56aa['role']==='user'){var _0x2cc5e1=_0x26f7bb['get']({'plain':!![]});var _0x1e9c45='Teams';return db[_0x3bb6('0x54')]['find']({'where':{'name':_0x1e9c45,'userProfileId':_0x5c56aa['userProfileId']},'raw':!![]})['then'](function(_0x2e30b8){if(_0x2e30b8&&_0x2e30b8[_0x3bb6('0x55')]===0x0){return db[_0x3bb6('0x30')][_0x3bb6('0x50')]({'name':_0x2cc5e1[_0x3bb6('0x33')],'resourceId':_0x2cc5e1['id'],'type':_0x2e30b8[_0x3bb6('0x33')],'sectionId':_0x2e30b8['id']},{})[_0x3bb6('0x2c')](function(){return _0x26f7bb;});}else{return _0x26f7bb;}})[_0x3bb6('0x56')](function(_0x5d46cf){logger['error'](_0x3bb6('0x57'),_0x5d46cf);throw _0x5d46cf;});}return _0x26f7bb;})[_0x3bb6('0x2c')](respondWithResult(_0x5b5cb7,0xc9))[_0x3bb6('0x56')](handleError(_0x5b5cb7,null));};exports['update']=function(_0x235dab,_0x836b72){if(_0x235dab[_0x3bb6('0x51')]['id']){delete _0x235dab[_0x3bb6('0x51')]['id'];}return db['Team'][_0x3bb6('0x4f')]({'where':{'id':_0x235dab['params']['id']}})[_0x3bb6('0x2c')](handleEntityNotFound(_0x836b72,null))[_0x3bb6('0x2c')](saveUpdates(_0x235dab['body'],null))[_0x3bb6('0x2c')](respondWithResult(_0x836b72,null))['catch'](handleError(_0x836b72,null));};exports[_0x3bb6('0x2d')]=function(_0x251c4d,_0x3ecca3){return db[_0x3bb6('0x37')][_0x3bb6('0x4f')]({'where':{'id':_0x251c4d[_0x3bb6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ecca3,null))['then'](removeEntity(_0x3ecca3,null))[_0x3bb6('0x56')](handleError(_0x3ecca3,null));};exports['getQueues']=function(_0x5801b3,_0x55f8fd,_0x4b4769){return db[_0x3bb6('0x37')]['findOne']({'where':{'id':_0x5801b3['params']['id']}})[_0x3bb6('0x2c')](handleEntityNotFound(_0x55f8fd,null))[_0x3bb6('0x2c')](function(_0x46f45d){if(!_0x5801b3[_0x3bb6('0x3b')]['channel']||!utils[_0x3bb6('0x58')](_0x5801b3[_0x3bb6('0x3b')][_0x3bb6('0x59')])){throw new db[(_0x3bb6('0x5a'))][(_0x3bb6('0x5b'))](_0x3bb6('0x5c'));}var _0x5ca237={};var _0x13d5dd={};_0x13d5dd[_0x3bb6('0x3f')]=_[_0x3bb6('0x3c')](db[_[_0x3bb6('0x5d')](_0x5801b3[_0x3bb6('0x3b')][_0x3bb6('0x59')][_0x3bb6('0x5e')]())+_0x3bb6('0x5f')][_0x3bb6('0x38')]);_0x13d5dd[_0x3bb6('0x3b')]=_[_0x3bb6('0x3c')](_0x5801b3[_0x3bb6('0x3b')]);_0x13d5dd['filters']=_[_0x3bb6('0x3e')](_0x13d5dd[_0x3bb6('0x3f')],_0x13d5dd[_0x3bb6('0x3b')]);_0x5ca237['attributes']=_['intersection'](_0x13d5dd[_0x3bb6('0x3f')],qs['fields'](_0x5801b3[_0x3bb6('0x3b')]['fields']));_0x5ca237[_0x3bb6('0x40')]=_0x5ca237[_0x3bb6('0x40')][_0x3bb6('0x42')]?_0x5ca237[_0x3bb6('0x40')]:_0x13d5dd['model'];_0x5ca237[_0x3bb6('0x26')]=qs[_0x3bb6('0x26')](_0x5801b3['query'][_0x3bb6('0x26')]);_0x5ca237[_0x3bb6('0x23')]=qs[_0x3bb6('0x23')](_0x5801b3['query'][_0x3bb6('0x23')]);_0x5ca237[_0x3bb6('0x60')]=qs['sort'](_0x5801b3[_0x3bb6('0x3b')]['sort']);_0x5ca237[_0x3bb6('0x45')]=qs[_0x3bb6('0x3d')](_['pick'](_0x5801b3[_0x3bb6('0x3b')],_0x13d5dd[_0x3bb6('0x3d')]));_0x5ca237=_[_0x3bb6('0x47')]({},_0x5ca237,_0x5801b3['options']);return _0x46f45d[_0x3bb6('0x2e')+_['capitalize'](_0x5801b3[_0x3bb6('0x3b')][_0x3bb6('0x59')][_0x3bb6('0x5e')]())+_0x3bb6('0x61')](_0x5ca237);})[_0x3bb6('0x2c')](respondWithResult(_0x55f8fd,null))[_0x3bb6('0x56')](handleError(_0x55f8fd,null));};exports['addQueues']=function(_0x289710,_0x4a8791,_0x338bed){return db[_0x3bb6('0x37')][_0x3bb6('0x62')]({'where':{'id':_0x289710[_0x3bb6('0x4e')]['id']}})[_0x3bb6('0x2c')](function(_0x1d8c48){if(_0x1d8c48){if(!_0x289710[_0x3bb6('0x51')]['channel']||!utils[_0x3bb6('0x58')](_0x289710[_0x3bb6('0x51')][_0x3bb6('0x59')])){throw new db[(_0x3bb6('0x5a'))][(_0x3bb6('0x5b'))](_0x3bb6('0x5c'));}return _0x1d8c48[_0x3bb6('0x63')+_[_0x3bb6('0x5d')](_0x289710['body'][_0x3bb6('0x59')][_0x3bb6('0x5e')]())+_0x3bb6('0x61')](_0x289710[_0x3bb6('0x51')][_0x3bb6('0x64')]);}return null;})['then'](handleEntityNotFound(_0x4a8791,null))[_0x3bb6('0x2c')](respondWithStatusCode(_0x4a8791,null))['catch'](handleError(_0x4a8791,null));};exports[_0x3bb6('0x65')]=function(_0x36e760,_0x1e1367,_0x240259){return db[_0x3bb6('0x37')][_0x3bb6('0x62')]({'where':{'id':_0x36e760['params']['id']}})[_0x3bb6('0x2c')](function(_0x15c335){if(_0x15c335){if(!_0x36e760['query'][_0x3bb6('0x59')]||!utils[_0x3bb6('0x58')](_0x36e760[_0x3bb6('0x3b')][_0x3bb6('0x59')])){throw new db[(_0x3bb6('0x5a'))][(_0x3bb6('0x5b'))](_0x3bb6('0x5c'));}return _0x15c335['remove'+_[_0x3bb6('0x5d')](_0x36e760['query'][_0x3bb6('0x59')][_0x3bb6('0x5e')]())+'Queues'](_0x36e760[_0x3bb6('0x3b')][_0x3bb6('0x64')]);}return null;})['then'](handleEntityNotFound(_0x1e1367,null))['then'](respondWithStatusCode(_0x1e1367,null))[_0x3bb6('0x56')](handleError(_0x1e1367,null));};exports[_0x3bb6('0x66')]=function(_0x2039bb,_0x29e51a){return db[_0x3bb6('0x37')][_0x3bb6('0x4f')]({'where':{'id':_0x2039bb[_0x3bb6('0x4e')]['id']}})[_0x3bb6('0x2c')](handleEntityNotFound(_0x29e51a,null))[_0x3bb6('0x2c')](function(_0x273262){if(_0x273262){var _0x4adf4c=[_0x3bb6('0x67'),_0x3bb6('0x68'),_0x3bb6('0x69'),_0x3bb6('0x6a'),_0x3bb6('0x6b'),_0x3bb6('0x6c'),_0x3bb6('0x6d')];return db[_0x3bb6('0x6e')][_0x3bb6('0x6f')](function(_0x3dd28d){var _0xf07ffa=_['map'](_0x4adf4c,function(_0x4b2448){var _0x307e8d={'attributes':['id',_0x3bb6('0x33')]};if(_0x4b2448===_0x3bb6('0x67')){_0x307e8d[_0x3bb6('0x70')]={'attributes':[_0x3bb6('0x71')]};}return _0x273262[_0x3bb6('0x2e')+_0x4b2448+_0x3bb6('0x61')](_0x307e8d)[_0x3bb6('0x2c')](function(_0x16a6d6){var _0x16765a=_[_0x3bb6('0x36')](_0x16a6d6,function(_0xbe0326){var _0x55cea1=_[_0x3bb6('0x36')](_0x2039bb['body'][_0x3bb6('0x64')],function(_0x208fd3){var _0x2abb05={'where':{'UserId':_0x208fd3,[_0x4b2448+'QueueId']:_0xbe0326['id']},'transaction':_0x3dd28d};if(_0x4b2448===_0x3bb6('0x67')){_0x2abb05[_0x3bb6('0x1b')]={'penalty':_0xbe0326[_0x3bb6('0x72')][_0x3bb6('0x71')]};}return db[_0x3bb6('0x73')+_0x4b2448+_0x3bb6('0x5f')][_0x3bb6('0x74')](_0x2abb05)[_0x3bb6('0x2c')](function(){socket[_0x3bb6('0x75')](_0x3bb6('0x52')+_0x4b2448+'Queue:save',{'UserId':_0x208fd3,[_0x4b2448+_0x3bb6('0x76')]:_0xbe0326['id']});if(_0x4b2448!==_0x3bb6('0x67'))return;return db[_0x3bb6('0x73')][_0x3bb6('0x4b')]({'where':{'id':_0x2039bb[_0x3bb6('0x51')][_0x3bb6('0x64')],'online':0x1},'attributes':['id','name',_0x3bb6('0x77'),_0x3bb6('0x78'),_0x3bb6('0x79')],'raw':!![]})['then'](function(_0x257fe9){var _0x5a33e8=_[_0x3bb6('0x36')](_0x257fe9,function(_0x3bc6d3){return db[_0x3bb6('0x7a')][_0x3bb6('0x7b')]({'membername':_0x3bc6d3[_0x3bb6('0x33')],'UserId':_0x3bc6d3['id'],'queue_name':_0xbe0326[_0x3bb6('0x33')],'VoiceQueueId':_0xbe0326['id'],'interface':_[_0x3bb6('0x7c')](_0x3bc6d3[_0x3bb6('0x79')])?util[_0x3bb6('0x7d')](_0x3bb6('0x7e'),_0x3bc6d3[_0x3bb6('0x33')]):_0x3bc6d3[_0x3bb6('0x79')],'paused':_0x3bc6d3[_0x3bb6('0x78')]||![],'penalty':_0xbe0326[_0x3bb6('0x72')][_0x3bb6('0x71')]},{'transaction':_0x3dd28d});});return Promise[_0x3bb6('0x7f')](_0x5a33e8);});});});return Promise[_0x3bb6('0x7f')](_0x55cea1);});return Promise[_0x3bb6('0x7f')](_0x16765a);});});return Promise[_0x3bb6('0x7f')](_0xf07ffa)[_0x3bb6('0x2c')](function(){return _0x273262[_0x3bb6('0x66')](_0x2039bb[_0x3bb6('0x51')][_0x3bb6('0x64')],{'transaction':_0x3dd28d})['spread'](function(_0x29c193){return _0x29c193;});});});}})[_0x3bb6('0x2c')](respondWithResult(_0x29e51a,null))['catch'](handleError(_0x29e51a,null));};exports[_0x3bb6('0x80')]=function(_0x411ef2,_0x207094){return db[_0x3bb6('0x37')]['find']({'where':{'id':_0x411ef2[_0x3bb6('0x4e')]['id']}})[_0x3bb6('0x2c')](handleEntityNotFound(_0x207094,null))[_0x3bb6('0x2c')](function(_0x562326){if(_0x562326){var _0x524c3b=[_0x3bb6('0x67'),_0x3bb6('0x68'),'Mail',_0x3bb6('0x6a'),'Fax',_0x3bb6('0x6c'),_0x3bb6('0x6d')];return db[_0x3bb6('0x6e')][_0x3bb6('0x6f')](function(_0x28c16a){var _0x212911=_[_0x3bb6('0x36')](_0x524c3b,function(_0x2a3e58){var _0x59e460={'attributes':['id',_0x3bb6('0x33')]};return _0x562326[_0x3bb6('0x2e')+_0x2a3e58+_0x3bb6('0x61')](_0x59e460)[_0x3bb6('0x2c')](function(_0x24ae46){var _0x446153=_[_0x3bb6('0x36')](_0x24ae46,function(_0x4eddb2){return _0x4eddb2[_0x3bb6('0x80')](_0x411ef2['query'][_0x3bb6('0x64')],{'transaction':_0x28c16a})['then'](function(){var _0x41cfc8=JSON[_0x3bb6('0x81')]('['+_0x411ef2['query'][_0x3bb6('0x64')]+']');var _0x4ba07b=_['map'](_0x41cfc8,function(_0x28358e){socket[_0x3bb6('0x75')](_0x3bb6('0x52')+_0x2a3e58+_0x3bb6('0x82'),{'UserId':Number(_0x28358e),[_0x2a3e58+_0x3bb6('0x76')]:_0x4eddb2['id']});if(_0x2a3e58!=='Voice')return;return db[_0x3bb6('0x7a')]['destroy']({'where':{'VoiceQueueId':_0x4eddb2['id'],'UserId':_0x28358e},'transaction':_0x28c16a});});return Promise[_0x3bb6('0x7f')](_0x4ba07b);});});return Promise[_0x3bb6('0x7f')](_0x446153);});});return Promise['all'](_0x212911)['then'](function(){return _0x562326[_0x3bb6('0x80')](_0x411ef2[_0x3bb6('0x3b')][_0x3bb6('0x64')],{'transaction':_0x28c16a});});});}})[_0x3bb6('0x2c')](respondWithStatusCode(_0x207094,null))['catch'](handleError(_0x207094,null));};exports[_0x3bb6('0x83')]=function(_0x217d1f,_0x1a6404,_0xbe12e0){var _0x58aacc={};var _0x25c273={};var _0x4ded0d;var _0x233cda;return db[_0x3bb6('0x37')]['findOne']({'where':{'id':_0x217d1f['params']['id']}})['then'](handleEntityNotFound(_0x1a6404,null))[_0x3bb6('0x2c')](function(_0x54e3e3){if(_0x54e3e3){_0x4ded0d=_0x54e3e3;_0x25c273[_0x3bb6('0x3f')]=_['keys'](db[_0x3bb6('0x73')][_0x3bb6('0x38')]);_0x25c273[_0x3bb6('0x3b')]=_[_0x3bb6('0x3c')](_0x217d1f[_0x3bb6('0x3b')]);_0x25c273[_0x3bb6('0x3d')]=_[_0x3bb6('0x3e')](_0x25c273[_0x3bb6('0x3f')],_0x25c273['query']);_0x58aacc[_0x3bb6('0x40')]=_[_0x3bb6('0x3e')](_0x25c273[_0x3bb6('0x3f')],qs[_0x3bb6('0x41')](_0x217d1f[_0x3bb6('0x3b')][_0x3bb6('0x41')]));_0x58aacc['attributes']=_0x58aacc['attributes'][_0x3bb6('0x42')]?_0x58aacc['attributes']:_0x25c273[_0x3bb6('0x3f')];_0x58aacc[_0x3bb6('0x60')]=qs[_0x3bb6('0x44')](_0x217d1f[_0x3bb6('0x3b')][_0x3bb6('0x44')]);_0x58aacc[_0x3bb6('0x45')]=qs[_0x3bb6('0x3d')](_[_0x3bb6('0x84')](_0x217d1f['query'],_0x25c273[_0x3bb6('0x3d')]));if(_0x217d1f['query'][_0x3bb6('0x46')]){_0x58aacc['where']=_[_0x3bb6('0x47')](_0x58aacc['where'],{'$or':_[_0x3bb6('0x36')](_0x58aacc[_0x3bb6('0x40')],function(_0x4b0e00){var _0x1471f8={};_0x1471f8[_0x4b0e00]={'$like':'%'+_0x217d1f[_0x3bb6('0x3b')][_0x3bb6('0x46')]+'%'};return _0x1471f8;})});}_0x58aacc=_[_0x3bb6('0x47')]({},_0x58aacc,_0x217d1f[_0x3bb6('0x48')]);return _0x4ded0d[_0x3bb6('0x83')](_0x58aacc);}})[_0x3bb6('0x2c')](function(_0x41a306){if(_0x41a306){_0x233cda=_0x41a306[_0x3bb6('0x42')];if(!_0x217d1f[_0x3bb6('0x3b')]['hasOwnProperty'](_0x3bb6('0x43'))){_0x58aacc[_0x3bb6('0x26')]=qs[_0x3bb6('0x26')](_0x217d1f[_0x3bb6('0x3b')][_0x3bb6('0x26')]);_0x58aacc[_0x3bb6('0x23')]=qs[_0x3bb6('0x23')](_0x217d1f[_0x3bb6('0x3b')][_0x3bb6('0x23')]);}return _0x4ded0d[_0x3bb6('0x83')](_0x58aacc);}})['then'](function(_0x135486){if(_0x135486){return _0x135486?{'count':_0x233cda,'rows':_0x135486}:null;}})[_0x3bb6('0x2c')](respondWithResult(_0x1a6404,null))[_0x3bb6('0x56')](handleError(_0x1a6404,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index c2e2e5c..9109353 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 _0x2483=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x440b3b,_0x2de495){var _0x3018cb=function(_0x8772d5){while(--_0x8772d5){_0x440b3b['push'](_0x440b3b['shift']());}};_0x3018cb(++_0x2de495);}(_0x2483,0xac));var _0x3248=function(_0x1e8c5b,_0x37ea41){_0x1e8c5b=_0x1e8c5b-0x0;var _0x372092=_0x2483[_0x1e8c5b];return _0x372092;};'use strict';var EventEmitter=require(_0x3248('0x0'));var Team=require(_0x3248('0x1'))['db'][_0x3248('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x3248('0x3')](0x0);var events={'afterCreate':_0x3248('0x4'),'afterUpdate':_0x3248('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5daf94){return function(_0xab5ccc,_0x26c6ae,_0x434b7f){TeamEvents[_0x3248('0x6')](_0x5daf94+':'+_0xab5ccc['id'],_0xab5ccc);TeamEvents[_0x3248('0x6')](_0x5daf94,_0xab5ccc);_0x434b7f(null);};}for(var e in events){if(events[_0x3248('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x3248('0x8')]=TeamEvents; \ No newline at end of file +var _0x2521=['exports','events','Team','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4b25bc,_0x35d7e9){var _0x4559dc=function(_0x70d489){while(--_0x70d489){_0x4b25bc['push'](_0x4b25bc['shift']());}};_0x4559dc(++_0x35d7e9);}(_0x2521,0x1de));var _0x1252=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x2521[_0x5c4f6b];return _0x104c4e;};'use strict';var EventEmitter=require(_0x1252('0x0'));var Team=require('../../mysqldb')['db'][_0x1252('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x1252('0x2')](0x0);var events={'afterCreate':_0x1252('0x3'),'afterUpdate':_0x1252('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3994f8){return function(_0x3cdfc5,_0x232c5e,_0x11c13b){TeamEvents['emit'](_0x3994f8+':'+_0x3cdfc5['id'],_0x3cdfc5);TeamEvents[_0x1252('0x5')](_0x3994f8,_0x3cdfc5);_0x11c13b(null);};}for(var e in events){if(events[_0x1252('0x6')](e)){var event=events[e];Team[_0x1252('0x7')](e,emitEvent(event));}}module[_0x1252('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 5f284a9..93b87ca 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 _0xeefe=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Team','teams','lodash','util'];(function(_0x4ec3e9,_0x5b4535){var _0x242e0e=function(_0x339dd1){while(--_0x339dd1){_0x4ec3e9['push'](_0x4ec3e9['shift']());}};_0x242e0e(++_0x5b4535);}(_0xeefe,0x73));var _0xeeef=function(_0x3600f3,_0x3d36ea){_0x3600f3=_0x3600f3-0x0;var _0x37cdea=_0xeefe[_0x3600f3];return _0x37cdea;};'use strict';var _=require(_0xeeef('0x0'));var util=require(_0xeeef('0x1'));var logger=require(_0xeeef('0x2'))(_0xeeef('0x3'));var moment=require(_0xeeef('0x4'));var BPromise=require(_0xeeef('0x5'));var rp=require(_0xeeef('0x6'));var fs=require('fs');var path=require(_0xeeef('0x7'));var rimraf=require('rimraf');var config=require(_0xeeef('0x8'));var attributes=require('./team.attributes');module[_0xeeef('0x9')]=function(_0x57f750,_0x2cac76){return _0x57f750[_0xeeef('0xa')](_0xeeef('0xb'),attributes,{'tableName':_0xeeef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca82=['bluebird','request-promise','path','rimraf','../../config/environment','exports','teams','util','api','moment'];(function(_0x1760c5,_0x40354b){var _0x5df97a=function(_0x53d668){while(--_0x53d668){_0x1760c5['push'](_0x1760c5['shift']());}};_0x5df97a(++_0x40354b);}(_0xca82,0x197));var _0x2ca8=function(_0x2c6047,_0x485481){_0x2c6047=_0x2c6047-0x0;var _0x5a9f17=_0xca82[_0x2c6047];return _0x5a9f17;};'use strict';var _=require('lodash');var util=require(_0x2ca8('0x0'));var logger=require('../../config/logger')(_0x2ca8('0x1'));var moment=require(_0x2ca8('0x2'));var BPromise=require(_0x2ca8('0x3'));var rp=require(_0x2ca8('0x4'));var fs=require('fs');var path=require(_0x2ca8('0x5'));var rimraf=require(_0x2ca8('0x6'));var config=require(_0x2ca8('0x7'));var attributes=require('./team.attributes');module[_0x2ca8('0x8')]=function(_0x4a7506,_0x517502){return _0x4a7506['define']('Team',attributes,{'tableName':_0x2ca8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 5777c9b..dd3edf7 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 _0x1c9f=['then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','result','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x28877c,_0x5dfdfb){var _0x5852fe=function(_0xe14aed){while(--_0xe14aed){_0x28877c['push'](_0x28877c['shift']());}};_0x5852fe(++_0x5dfdfb);}(_0x1c9f,0x14f));var _0xf1c9=function(_0x245993,_0x44cf21){_0x245993=_0x245993-0x0;var _0x4d2d33=_0x1c9f[_0x245993];return _0x4d2d33;};'use strict';var _=require(_0xf1c9('0x0'));var util=require(_0xf1c9('0x1'));var moment=require(_0xf1c9('0x2'));var BPromise=require(_0xf1c9('0x3'));var rs=require(_0xf1c9('0x4'));var fs=require('fs');var Redis=require(_0xf1c9('0x5'));var db=require(_0xf1c9('0x6'))['db'];var utils=require(_0xf1c9('0x7'));var logger=require(_0xf1c9('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf1c9('0x9'));var client=jayson['client'][_0xf1c9('0xa')]({'port':0x232a});config[_0xf1c9('0xb')]=_['defaults'](config['redis'],{'host':_0xf1c9('0xc'),'port':0x18eb});var socket=require(_0xf1c9('0xd'))(new Redis(config[_0xf1c9('0xb')]));require('./team.socket')[_0xf1c9('0xe')](socket);function respondWithRpcPromise(_0x57e26f,_0x16ac70,_0xc8a30d){return new BPromise(function(_0x5d9e7f,_0x4a497a){return client[_0xf1c9('0xf')](_0x57e26f,_0xc8a30d)[_0xf1c9('0x10')](function(_0x1eeb3a){logger[_0xf1c9('0x11')](_0xf1c9('0x12'),_0x16ac70,_0xf1c9('0x13'));logger[_0xf1c9('0x14')](_0xf1c9('0x15'),_0x16ac70,'request\x20sent',JSON['stringify'](_0x1eeb3a));if(_0x1eeb3a[_0xf1c9('0x16')]){if(_0x1eeb3a[_0xf1c9('0x16')][_0xf1c9('0x17')]===0x1f4){logger[_0xf1c9('0x16')](_0xf1c9('0x12'),_0x16ac70,_0x1eeb3a['error']['message']);return _0x4a497a(_0x1eeb3a['error']['message']);}logger[_0xf1c9('0x16')](_0xf1c9('0x12'),_0x16ac70,_0x1eeb3a['error']['message']);return _0x5d9e7f(_0x1eeb3a[_0xf1c9('0x16')]['message']);}else{logger[_0xf1c9('0x11')]('Team,\x20%s,\x20%s',_0x16ac70,'request\x20sent');_0x5d9e7f(_0x1eeb3a[_0xf1c9('0x18')][_0xf1c9('0x19')]);}})[_0xf1c9('0x1a')](function(_0xad180c){logger[_0xf1c9('0x16')]('Team,\x20%s,\x20%s',_0x16ac70,_0xad180c);_0x4a497a(_0xad180c);});});} \ No newline at end of file +var _0x6a14=['then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./team.socket','register','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6a14,0x9d));var _0x46a1=function(_0x14019e,_0x4adb08){_0x14019e=_0x14019e-0x0;var _0x159b21=_0x6a14[_0x14019e];return _0x159b21;};'use strict';var _=require('lodash');var util=require(_0x46a1('0x0'));var moment=require(_0x46a1('0x1'));var BPromise=require(_0x46a1('0x2'));var rs=require(_0x46a1('0x3'));var fs=require('fs');var Redis=require(_0x46a1('0x4'));var db=require(_0x46a1('0x5'))['db'];var utils=require(_0x46a1('0x6'));var logger=require(_0x46a1('0x7'))(_0x46a1('0x8'));var config=require(_0x46a1('0x9'));var jayson=require(_0x46a1('0xa'));var client=jayson[_0x46a1('0xb')]['http']({'port':0x232a});config[_0x46a1('0xc')]=_[_0x46a1('0xd')](config[_0x46a1('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46a1('0xc')]));require(_0x46a1('0xe'))[_0x46a1('0xf')](socket);function respondWithRpcPromise(_0x913ba8,_0x4b3b1f,_0x3603e0){return new BPromise(function(_0x526a48,_0x3ac9d1){return client[_0x46a1('0x10')](_0x913ba8,_0x3603e0)[_0x46a1('0x11')](function(_0x3053c3){logger[_0x46a1('0x12')]('Team,\x20%s,\x20%s',_0x4b3b1f,_0x46a1('0x13'));logger[_0x46a1('0x14')](_0x46a1('0x15'),_0x4b3b1f,_0x46a1('0x13'),JSON[_0x46a1('0x16')](_0x3053c3));if(_0x3053c3[_0x46a1('0x17')]){if(_0x3053c3[_0x46a1('0x17')][_0x46a1('0x18')]===0x1f4){logger['error'](_0x46a1('0x19'),_0x4b3b1f,_0x3053c3[_0x46a1('0x17')][_0x46a1('0x1a')]);return _0x3ac9d1(_0x3053c3[_0x46a1('0x17')]['message']);}logger[_0x46a1('0x17')]('Team,\x20%s,\x20%s',_0x4b3b1f,_0x3053c3[_0x46a1('0x17')][_0x46a1('0x1a')]);return _0x526a48(_0x3053c3['error'][_0x46a1('0x1a')]);}else{logger[_0x46a1('0x12')]('Team,\x20%s,\x20%s',_0x4b3b1f,'request\x20sent');_0x526a48(_0x3053c3[_0x46a1('0x1b')][_0x46a1('0x1a')]);}})[_0x46a1('0x1c')](function(_0x1fbf35){logger[_0x46a1('0x17')](_0x46a1('0x19'),_0x4b3b1f,_0x1fbf35);_0x3ac9d1(_0x1fbf35);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4a213a1..50db264 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 _0xe9e8=['length','team:','./team.events','save','remove','update','removeListener'];(function(_0x43e4a3,_0x520302){var _0x40df67=function(_0x26048b){while(--_0x26048b){_0x43e4a3['push'](_0x43e4a3['shift']());}};_0x40df67(++_0x520302);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x32f351,_0x307ecc){_0x32f351=_0x32f351-0x0;var _0x5160fd=_0xe9e8[_0x32f351];return _0x5160fd;};'use strict';var TeamEvents=require(_0x8e9e('0x0'));var events=[_0x8e9e('0x1'),_0x8e9e('0x2'),_0x8e9e('0x3')];function createListener(_0x40b66d,_0x2358cc){return function(_0x10ee84){_0x2358cc['emit'](_0x40b66d,_0x10ee84);};}function removeListener(_0x103d8b,_0x2a1d41){return function(){TeamEvents[_0x8e9e('0x4')](_0x103d8b,_0x2a1d41);};}exports['register']=function(_0x5c10ad){for(var _0x39983a=0x0,_0x204f5c=events[_0x8e9e('0x5')];_0x39983a<_0x204f5c;_0x39983a++){var _0x58f822=events[_0x39983a];var _0x3b5d21=createListener(_0x8e9e('0x6')+_0x58f822,_0x5c10ad);TeamEvents['on'](_0x58f822,_0x3b5d21);}}; \ No newline at end of file +var _0x928c=['emit','register','team:','remove','update'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x928c,0x17f));var _0xc928=function(_0x8d2083,_0x2183d1){_0x8d2083=_0x8d2083-0x0;var _0x289ad8=_0x928c[_0x8d2083];return _0x289ad8;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0xc928('0x0'),_0xc928('0x1')];function createListener(_0x597d43,_0x24354b){return function(_0x29bd30){_0x24354b[_0xc928('0x2')](_0x597d43,_0x29bd30);};}function removeListener(_0x3e4e60,_0x1dd54b){return function(){TeamEvents['removeListener'](_0x3e4e60,_0x1dd54b);};}exports[_0xc928('0x3')]=function(_0x4704bc){for(var _0x8c0fa5=0x0,_0x4ff9e6=events['length'];_0x8c0fa5<_0x4ff9e6;_0x8c0fa5++){var _0x5e433b=events[_0x8c0fa5];var _0x445248=createListener(_0xc928('0x4')+_0x5e433b,_0x4704bc);TeamEvents['on'](_0x5e433b,_0x445248);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index e68fe63..b50582a 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c9b2f,_0x35c101){var _0x445c52=function(_0xe148e5){while(--_0xe148e5){_0x2c9b2f['push'](_0x2c9b2f['shift']());}};_0x445c52(++_0x35c101);}(_0xe706,0xa3));var _0x6e70=function(_0x40c120,_0x945e7a){_0x40c120=_0x40c120-0x0;var _0xe9f0d=_0xe706[_0x40c120];return _0xe9f0d;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x33f776,_0x123f92){var _0x3b3fa3=function(_0x3f4c01){while(--_0x3f4c01){_0x33f776['push'](_0x33f776['shift']());}};_0x3b3fa3(++_0x123f92);}(_0xedd9,0xfc));var _0x9edd=function(_0x57dc3d,_0x4ebcae){_0x57dc3d=_0x57dc3d-0x0;var _0x5d76b3=_0xedd9[_0x57dc3d];return _0x5d76b3;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a913539..e74ddab 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 _0x7f79=['sequelize','exports','INTEGER'];(function(_0x235ea9,_0x579aa6){var _0x30ff96=function(_0x525bb4){while(--_0x525bb4){_0x235ea9['push'](_0x235ea9['shift']());}};_0x30ff96(++_0x579aa6);}(_0x7f79,0x8a));var _0x97f7=function(_0x2ac972,_0x4e94d5){_0x2ac972=_0x2ac972-0x0;var _0x2cd16d=_0x7f79[_0x2ac972];return _0x2cd16d;};'use strict';var Sequelize=require(_0x97f7('0x0'));module[_0x97f7('0x1')]={'penalty':{'type':Sequelize[_0x97f7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb9b6=['INTEGER'];(function(_0x265773,_0x5d1b6e){var _0x4ed75d=function(_0x3b7ce7){while(--_0x3b7ce7){_0x265773['push'](_0x265773['shift']());}};_0x4ed75d(++_0x5d1b6e);}(_0xb9b6,0x114));var _0x6b9b=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0xb9b6[_0x4653f7];return _0x5454da;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x6b9b('0x0')],'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 2859f07..6e924c3 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 _0xb6f1=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb6f1,0x118));var _0x1b6f=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xb6f1[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var logger=require(_0x1b6f('0x1'))('api');var moment=require(_0x1b6f('0x2'));var BPromise=require(_0x1b6f('0x3'));var rp=require(_0x1b6f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b6f('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b6f('0x6'));module[_0x1b6f('0x7')]=function(_0xd4703b,_0x493c91){return _0xd4703b['define'](_0x1b6f('0x8'),attributes,{'tableName':_0x1b6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb13=['request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb13,0x10c));var _0x3db1=function(_0x390ff7,_0x2d06da){_0x390ff7=_0x390ff7-0x0;var _0x9651e8=_0xdb13[_0x390ff7];return _0x9651e8;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var logger=require(_0x3db1('0x1'))(_0x3db1('0x2'));var moment=require(_0x3db1('0x3'));var BPromise=require(_0x3db1('0x4'));var rp=require(_0x3db1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3db1('0x6'));var config=require(_0x3db1('0x7'));var attributes=require(_0x3db1('0x8'));module[_0x3db1('0x9')]=function(_0x342b84,_0x5a2345){return _0x342b84[_0x3db1('0xa')](_0x3db1('0xb'),attributes,{'tableName':_0x3db1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 0fefa0e..69bb8e2 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 _0xbfca=['info','request\x20sent','debug','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x3b1ecd,_0x38f712){var _0x2c6890=function(_0xad6b70){while(--_0xad6b70){_0x3b1ecd['push'](_0x3b1ecd['shift']());}};_0x2c6890(++_0x38f712);}(_0xbfca,0x112));var _0xabfc=function(_0x27118f,_0xad384f){_0x27118f=_0x27118f-0x0;var _0x5b9bf8=_0xbfca[_0x27118f];return _0x5b9bf8;};'use strict';var _=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var moment=require(_0xabfc('0x2'));var BPromise=require(_0xabfc('0x3'));var rs=require(_0xabfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabfc('0x5'))['db'];var utils=require(_0xabfc('0x6'));var logger=require(_0xabfc('0x7'))('rpc');var config=require(_0xabfc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabfc('0x9')][_0xabfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16abc7,_0x1df101,_0x531e51){return new BPromise(function(_0x254b5e,_0x43d753){return client['request'](_0x16abc7,_0x531e51)[_0xabfc('0xb')](function(_0x372ab5){logger[_0xabfc('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1df101,_0xabfc('0xd'));logger[_0xabfc('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1df101,_0xabfc('0xd'),JSON[_0xabfc('0xf')](_0x372ab5));if(_0x372ab5[_0xabfc('0x10')]){if(_0x372ab5[_0xabfc('0x10')][_0xabfc('0x11')]===0x1f4){logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x1df101,_0x372ab5[_0xabfc('0x10')]['message']);return _0x43d753(_0x372ab5[_0xabfc('0x10')][_0xabfc('0x13')]);}logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x1df101,_0x372ab5[_0xabfc('0x10')][_0xabfc('0x13')]);return _0x254b5e(_0x372ab5[_0xabfc('0x10')][_0xabfc('0x13')]);}else{logger[_0xabfc('0xc')](_0xabfc('0x12'),_0x1df101,_0xabfc('0xd'));_0x254b5e(_0x372ab5[_0xabfc('0x14')][_0xabfc('0x13')]);}})[_0xabfc('0x15')](function(_0x1047aa){logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x1df101,_0x1047aa);_0x43d753(_0x1047aa);});});} \ No newline at end of file +var _0x5d95=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x1501e2,_0x271210){var _0xfce8c5=function(_0x343f12){while(--_0x343f12){_0x1501e2['push'](_0x1501e2['shift']());}};_0xfce8c5(++_0x271210);}(_0x5d95,0x161));var _0x55d9=function(_0x1b4950,_0x56f1f9){_0x1b4950=_0x1b4950-0x0;var _0x9edf1=_0x5d95[_0x1b4950];return _0x9edf1;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var moment=require('moment');var BPromise=require(_0x55d9('0x2'));var rs=require(_0x55d9('0x3'));var fs=require('fs');var Redis=require(_0x55d9('0x4'));var db=require(_0x55d9('0x5'))['db'];var utils=require(_0x55d9('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x55d9('0x7'));var client=jayson[_0x55d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50d0db,_0x162921,_0x22af9a){return new BPromise(function(_0x5cd22d,_0x1f4fcf){return client[_0x55d9('0x9')](_0x50d0db,_0x22af9a)[_0x55d9('0xa')](function(_0x53719b){logger[_0x55d9('0xb')](_0x55d9('0xc'),_0x162921,_0x55d9('0xd'));logger[_0x55d9('0xe')](_0x55d9('0xf'),_0x162921,_0x55d9('0xd'),JSON[_0x55d9('0x10')](_0x53719b));if(_0x53719b[_0x55d9('0x11')]){if(_0x53719b[_0x55d9('0x11')][_0x55d9('0x12')]===0x1f4){logger['error'](_0x55d9('0xc'),_0x162921,_0x53719b['error'][_0x55d9('0x13')]);return _0x1f4fcf(_0x53719b[_0x55d9('0x11')][_0x55d9('0x13')]);}logger[_0x55d9('0x11')](_0x55d9('0xc'),_0x162921,_0x53719b['error']['message']);return _0x5cd22d(_0x53719b[_0x55d9('0x11')][_0x55d9('0x13')]);}else{logger[_0x55d9('0xb')](_0x55d9('0xc'),_0x162921,_0x55d9('0xd'));_0x5cd22d(_0x53719b[_0x55d9('0x14')]['message']);}})['catch'](function(_0x373947){logger[_0x55d9('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x162921,_0x373947);_0x1f4fcf(_0x373947);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 6aa334a..d303b0a 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 _0x5324=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','multer','util'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x5324,0x154));var _0x4532=function(_0xaddabb,_0x88995a){_0xaddabb=_0xaddabb-0x0;var _0x3b7ad3=_0x5324[_0xaddabb];return _0x3b7ad3;};'use strict';var multer=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var path=require(_0x4532('0x2'));var timeout=require(_0x4532('0x3'));var express=require('express');var router=express[_0x4532('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4532('0x5'));var interaction=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var controller=require(_0x4532('0x8'));router[_0x4532('0x9')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xb')]);router[_0x4532('0x9')]('/:id',auth[_0x4532('0xa')](),controller[_0x4532('0xc')]);router[_0x4532('0xd')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xe')]);router[_0x4532('0xf')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller[_0x4532('0x11')]);router[_0x4532('0x12')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe61c=['put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xe61c,0xee));var _0xce61=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0xe61c[_0x5c8827];return _0x50ffd5;};'use strict';var multer=require(_0xce61('0x0'));var util=require('util');var path=require(_0xce61('0x1'));var timeout=require(_0xce61('0x2'));var express=require(_0xce61('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xce61('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce61('0x5'));var controller=require(_0xce61('0x6'));router[_0xce61('0x7')]('/',auth[_0xce61('0x8')](),controller[_0xce61('0x9')]);router[_0xce61('0x7')](_0xce61('0xa'),auth['isAuthenticated'](),controller[_0xce61('0xb')]);router[_0xce61('0xc')]('/',auth[_0xce61('0x8')](),controller[_0xce61('0xd')]);router[_0xce61('0xe')](_0xce61('0xa'),auth[_0xce61('0x8')](),controller['update']);router[_0xce61('0xf')](_0xce61('0xa'),auth['isAuthenticated'](),controller[_0xce61('0x10')]);module[_0xce61('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 79a1e71..ae5806d 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 _0x05ab=['STRING','sequelize'];(function(_0x26fae4,_0x54095e){var _0x2c876d=function(_0x30027f){while(--_0x30027f){_0x26fae4['push'](_0x26fae4['shift']());}};_0x2c876d(++_0x54095e);}(_0x05ab,0x77));var _0xb05a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x05ab[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0xb05a('0x0'));module['exports']={'name':{'type':Sequelize[_0xb05a('0x1')]},'description':{'type':Sequelize[_0xb05a('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4209=['sequelize','STRING'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x4209,0xd4));var _0x9420=function(_0x3407ee,_0xb2e716){_0x3407ee=_0x3407ee-0x0;var _0x1b0b35=_0x4209[_0x3407ee];return _0x1b0b35;};'use strict';var Sequelize=require(_0x9420('0x0'));module['exports']={'name':{'type':Sequelize[_0x9420('0x1')]},'description':{'type':Sequelize[_0x9420('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 6a12dd9..fbcb15e 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 _0x2cdb=['intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','Template','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes'];(function(_0x4aa624,_0x29da27){var _0x531842=function(_0xed0ff2){while(--_0xed0ff2){_0x4aa624['push'](_0x4aa624['shift']());}};_0x531842(++_0x29da27);}(_0x2cdb,0x110));var _0xb2cd=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2cdb[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xb2cd('0x0'));var rimraf=require(_0xb2cd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2cd('0x2'));var rp=require(_0xb2cd('0x3'));var moment=require(_0xb2cd('0x4'));var BPromise=require(_0xb2cd('0x5'));var Mustache=require(_0xb2cd('0x6'));var util=require(_0xb2cd('0x7'));var path=require(_0xb2cd('0x8'));var sox=require('sox');var csv=require(_0xb2cd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb2cd('0xa'));var crypto=require('crypto');var jsforce=require(_0xb2cd('0xb'));var deskjs=require(_0xb2cd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb2cd('0xd'));var Papa=require(_0xb2cd('0xe'));var Redis=require(_0xb2cd('0xf'));var authService=require(_0xb2cd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2cd('0x11'))(_0xb2cd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb2cd('0x13'));var db=require(_0xb2cd('0x14'))['db'];function respondWithStatusCode(_0x2d26d7,_0x2e0154){_0x2e0154=_0x2e0154||0xcc;return function(_0x445c95){if(_0x445c95){return _0x2d26d7['sendStatus'](_0x2e0154);}return _0x2d26d7[_0xb2cd('0x15')](_0x2e0154)[_0xb2cd('0x16')]();};}function respondWithResult(_0x1fef2a,_0x2908a6){_0x2908a6=_0x2908a6||0xc8;return function(_0x4bf006){if(_0x4bf006){return _0x1fef2a[_0xb2cd('0x15')](_0x2908a6)[_0xb2cd('0x17')](_0x4bf006);}};}function respondWithFilteredResult(_0x13ec35,_0x416f4f){return function(_0xed988a){if(_0xed988a){var _0x2ca25d=typeof _0x416f4f[_0xb2cd('0x18')]===_0xb2cd('0x19')&&typeof _0x416f4f['limit']===_0xb2cd('0x19');var _0x4cf195=_0xed988a['count'];var _0x41da8b=_0x2ca25d?0x0:_0x416f4f['offset'];var _0x3a93e5=_0x2ca25d?_0xed988a[_0xb2cd('0x1a')]:_0x416f4f['offset']+_0x416f4f['limit'];var _0x42788d;if(_0x3a93e5>=_0x4cf195){_0x3a93e5=_0x4cf195;_0x42788d=0xc8;}else{_0x42788d=0xce;}_0x13ec35[_0xb2cd('0x15')](_0x42788d);return _0x13ec35[_0xb2cd('0x1b')](_0xb2cd('0x1c'),_0x41da8b+'-'+_0x3a93e5+'/'+_0x4cf195)[_0xb2cd('0x17')](_0xed988a);}return null;};}function patchUpdates(_0x9d03d2){return function(_0x1d7084){try{jsonpatch[_0xb2cd('0x1d')](_0x1d7084,_0x9d03d2,!![]);}catch(_0x4b3ee0){return BPromise[_0xb2cd('0x1e')](_0x4b3ee0);}return _0x1d7084[_0xb2cd('0x1f')]();};}function saveUpdates(_0x146a57,_0x2f2917){return function(_0x1cc754){if(_0x1cc754){return _0x1cc754[_0xb2cd('0x20')](_0x146a57)[_0xb2cd('0x21')](function(_0x209343){return _0x209343;});}return null;};}function removeEntity(_0x1bb249,_0x3917dc){return function(_0x5c3821){if(_0x5c3821){return _0x5c3821[_0xb2cd('0x22')]()[_0xb2cd('0x21')](function(){var _0x20b470=_0x5c3821[_0xb2cd('0x23')]({'plain':!![]});var _0x188777=_0xb2cd('0x24');return db[_0xb2cd('0x25')]['destroy']({'where':{'type':_0x188777,'resourceId':_0x20b470['id']}})['then'](function(){return _0x5c3821;});})[_0xb2cd('0x21')](function(){_0x1bb249[_0xb2cd('0x15')](0xcc)[_0xb2cd('0x16')]();});}};}function handleEntityNotFound(_0x5ab930,_0x461f06){return function(_0xf07ea){if(!_0xf07ea){_0x5ab930['sendStatus'](0x194);}return _0xf07ea;};}function handleError(_0x159b04,_0x403fd6){_0x403fd6=_0x403fd6||0x1f4;return function(_0x12fbdc){logger[_0xb2cd('0x26')](_0x12fbdc[_0xb2cd('0x27')]);if(_0x12fbdc[_0xb2cd('0x28')]){delete _0x12fbdc['name'];}_0x159b04[_0xb2cd('0x15')](_0x403fd6)['send'](_0x12fbdc);};}exports['index']=function(_0x431a77,_0x428553){var _0x5848e8={},_0x5e2a10={},_0x1f7817={'count':0x0,'rows':[]};var _0x52218d=_['map'](db[_0xb2cd('0x29')][_0xb2cd('0x2a')],function(_0x19b48c){return{'name':_0x19b48c[_0xb2cd('0x2b')],'type':_0x19b48c[_0xb2cd('0x2c')][_0xb2cd('0x2d')]};});_0x5e2a10['model']=_[_0xb2cd('0x2e')](_0x52218d,_0xb2cd('0x28'));_0x5e2a10[_0xb2cd('0x2f')]=_[_0xb2cd('0x30')](_0x431a77['query']);_0x5e2a10[_0xb2cd('0x31')]=_['intersection'](_0x5e2a10[_0xb2cd('0x32')],_0x5e2a10[_0xb2cd('0x2f')]);_0x5848e8[_0xb2cd('0x33')]=_[_0xb2cd('0x34')](_0x5e2a10[_0xb2cd('0x32')],qs[_0xb2cd('0x35')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x35')]));_0x5848e8[_0xb2cd('0x33')]=_0x5848e8[_0xb2cd('0x33')][_0xb2cd('0x36')]?_0x5848e8['attributes']:_0x5e2a10['model'];if(!_0x431a77['query'][_0xb2cd('0x37')](_0xb2cd('0x38'))){_0x5848e8[_0xb2cd('0x39')]=qs[_0xb2cd('0x39')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x39')]);_0x5848e8[_0xb2cd('0x18')]=qs[_0xb2cd('0x18')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x18')]);}_0x5848e8[_0xb2cd('0x3a')]=qs[_0xb2cd('0x3b')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x3b')]);_0x5848e8[_0xb2cd('0x3c')]=qs['filters'](_[_0xb2cd('0x3d')](_0x431a77[_0xb2cd('0x2f')],_0x5e2a10[_0xb2cd('0x31')]),_0x52218d);if(_0x431a77[_0xb2cd('0x2f')]['filter']){_0x5848e8[_0xb2cd('0x3c')]=_[_0xb2cd('0x3e')](_0x5848e8['where'],{'$or':_['map'](_0x52218d,function(_0x5a7603){if(_0x5a7603[_0xb2cd('0x2c')]!==_0xb2cd('0x3f')){var _0x2d43aa={};_0x2d43aa[_0x5a7603[_0xb2cd('0x28')]]={'$like':'%'+_0x431a77[_0xb2cd('0x2f')]['filter']+'%'};return _0x2d43aa;}})});}_0x5848e8=_['merge']({},_0x5848e8,_0x431a77[_0xb2cd('0x40')]);var _0x34c7a9={'where':_0x5848e8[_0xb2cd('0x3c')]};return db[_0xb2cd('0x29')][_0xb2cd('0x1a')](_0x34c7a9)[_0xb2cd('0x21')](function(_0x4f5ae0){_0x1f7817[_0xb2cd('0x1a')]=_0x4f5ae0;if(_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x41')]){_0x5848e8[_0xb2cd('0x42')]=[{'all':!![]}];}return db[_0xb2cd('0x29')][_0xb2cd('0x43')](_0x5848e8);})[_0xb2cd('0x21')](function(_0x4fa4cd){_0x1f7817[_0xb2cd('0x44')]=_0x4fa4cd;return _0x1f7817;})['then'](respondWithFilteredResult(_0x428553,_0x5848e8))[_0xb2cd('0x45')](handleError(_0x428553,null));};exports[_0xb2cd('0x46')]=function(_0x1c519b,_0x23d9bb){var _0x193437={'raw':!![],'where':{'id':_0x1c519b[_0xb2cd('0x47')]['id']}},_0x5530d6={};_0x5530d6[_0xb2cd('0x32')]=_['keys'](db[_0xb2cd('0x29')]['rawAttributes']);_0x5530d6['query']=_[_0xb2cd('0x30')](_0x1c519b[_0xb2cd('0x2f')]);_0x5530d6['filters']=_[_0xb2cd('0x34')](_0x5530d6['model'],_0x5530d6[_0xb2cd('0x2f')]);_0x193437[_0xb2cd('0x33')]=_[_0xb2cd('0x34')](_0x5530d6['model'],qs[_0xb2cd('0x35')](_0x1c519b[_0xb2cd('0x2f')][_0xb2cd('0x35')]));_0x193437[_0xb2cd('0x33')]=_0x193437[_0xb2cd('0x33')][_0xb2cd('0x36')]?_0x193437[_0xb2cd('0x33')]:_0x5530d6[_0xb2cd('0x32')];if(_0x1c519b[_0xb2cd('0x2f')][_0xb2cd('0x41')]){_0x193437[_0xb2cd('0x42')]=[{'all':!![]}];}_0x193437=_['merge']({},_0x193437,_0x1c519b['options']);return db[_0xb2cd('0x29')][_0xb2cd('0x48')](_0x193437)[_0xb2cd('0x21')](handleEntityNotFound(_0x23d9bb,null))[_0xb2cd('0x21')](respondWithResult(_0x23d9bb,null))[_0xb2cd('0x45')](handleError(_0x23d9bb,null));};exports[_0xb2cd('0x49')]=function(_0x16a705,_0x2fa90b){return db['Template'][_0xb2cd('0x49')](_0x16a705[_0xb2cd('0x4a')],{})['then'](function(_0x45d0c4){var _0x227c98=_0x16a705[_0xb2cd('0x4b')]['get']({'plain':!![]});if(!_0x227c98)throw new Error(_0xb2cd('0x4c'));if(_0x227c98[_0xb2cd('0x4d')]===_0xb2cd('0x4b')){var _0x120ab2=_0x45d0c4[_0xb2cd('0x23')]({'plain':!![]});var _0xf2ee66=_0xb2cd('0x24');return db[_0xb2cd('0x4e')][_0xb2cd('0x48')]({'where':{'name':_0xf2ee66,'userProfileId':_0x227c98[_0xb2cd('0x4f')]},'raw':!![]})['then'](function(_0x16a3ec){if(_0x16a3ec&&_0x16a3ec[_0xb2cd('0x50')]===0x0){return db[_0xb2cd('0x25')]['create']({'name':_0x120ab2['name'],'resourceId':_0x120ab2['id'],'type':_0x16a3ec['name'],'sectionId':_0x16a3ec['id']},{})['then'](function(){return _0x45d0c4;});}else{return _0x45d0c4;}})[_0xb2cd('0x45')](function(_0x1f6e56){logger[_0xb2cd('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f6e56);throw _0x1f6e56;});}return _0x45d0c4;})[_0xb2cd('0x21')](respondWithResult(_0x2fa90b,0xc9))[_0xb2cd('0x45')](handleError(_0x2fa90b,null));};exports['update']=function(_0x2a1dfe,_0x4a639a){if(_0x2a1dfe[_0xb2cd('0x4a')]['id']){delete _0x2a1dfe[_0xb2cd('0x4a')]['id'];}return db[_0xb2cd('0x29')]['find']({'where':{'id':_0x2a1dfe['params']['id']}})['then'](handleEntityNotFound(_0x4a639a,null))[_0xb2cd('0x21')](saveUpdates(_0x2a1dfe['body'],null))[_0xb2cd('0x21')](respondWithResult(_0x4a639a,null))[_0xb2cd('0x45')](handleError(_0x4a639a,null));};exports[_0xb2cd('0x22')]=function(_0x110036,_0x549912){return db[_0xb2cd('0x29')]['find']({'where':{'id':_0x110036['params']['id']}})[_0xb2cd('0x21')](handleEntityNotFound(_0x549912,null))[_0xb2cd('0x21')](removeEntity(_0x549912,null))[_0xb2cd('0x45')](handleError(_0x549912,null));}; \ No newline at end of file +var _0x010c=['request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','Template','rawAttributes','fieldName','type','key','map','keys','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir'];(function(_0x60e2a8,_0x296d25){var _0x59d0c1=function(_0x1f3dec){while(--_0x1f3dec){_0x60e2a8['push'](_0x60e2a8['shift']());}};_0x59d0c1(++_0x296d25);}(_0x010c,0xac));var _0xc010=function(_0x4d13a8,_0x10465e){_0x4d13a8=_0x4d13a8-0x0;var _0x13fb46=_0x010c[_0x4d13a8];return _0x13fb46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc010('0x0'));var zipdir=require(_0xc010('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc010('0x2'));var moment=require(_0xc010('0x3'));var BPromise=require(_0xc010('0x4'));var Mustache=require('mustache');var util=require(_0xc010('0x5'));var path=require(_0xc010('0x6'));var sox=require('sox');var csv=require(_0xc010('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc010('0x8'));var _=require(_0xc010('0x9'));var squel=require(_0xc010('0xa'));var crypto=require(_0xc010('0xb'));var jsforce=require(_0xc010('0xc'));var deskjs=require(_0xc010('0xd'));var toCsv=require(_0xc010('0x7'));var querystring=require(_0xc010('0xe'));var Papa=require(_0xc010('0xf'));var Redis=require(_0xc010('0x10'));var authService=require(_0xc010('0x11'));var qs=require(_0xc010('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc010('0x13'));var logger=require(_0xc010('0x14'))(_0xc010('0x15'));var utils=require(_0xc010('0x16'));var config=require(_0xc010('0x17'));var licenseUtil=require(_0xc010('0x18'));var db=require(_0xc010('0x19'))['db'];function respondWithStatusCode(_0x35d71b,_0x373edb){_0x373edb=_0x373edb||0xcc;return function(_0x470007){if(_0x470007){return _0x35d71b['sendStatus'](_0x373edb);}return _0x35d71b[_0xc010('0x1a')](_0x373edb)[_0xc010('0x1b')]();};}function respondWithResult(_0x512333,_0x2e1195){_0x2e1195=_0x2e1195||0xc8;return function(_0x207a1e){if(_0x207a1e){return _0x512333['status'](_0x2e1195)['json'](_0x207a1e);}};}function respondWithFilteredResult(_0x5e4bab,_0xb0a4cd){return function(_0x2903ca){if(_0x2903ca){var _0x8b53d7=typeof _0xb0a4cd['offset']===_0xc010('0x1c')&&typeof _0xb0a4cd[_0xc010('0x1d')]===_0xc010('0x1c');var _0x484193=_0x2903ca[_0xc010('0x1e')];var _0x4d28e7=_0x8b53d7?0x0:_0xb0a4cd[_0xc010('0x1f')];var _0x350e3c=_0x8b53d7?_0x2903ca[_0xc010('0x1e')]:_0xb0a4cd['offset']+_0xb0a4cd[_0xc010('0x1d')];var _0x2f6e6e;if(_0x350e3c>=_0x484193){_0x350e3c=_0x484193;_0x2f6e6e=0xc8;}else{_0x2f6e6e=0xce;}_0x5e4bab['status'](_0x2f6e6e);return _0x5e4bab[_0xc010('0x20')]('Content-Range',_0x4d28e7+'-'+_0x350e3c+'/'+_0x484193)[_0xc010('0x21')](_0x2903ca);}return null;};}function patchUpdates(_0x20f868){return function(_0x382721){try{jsonpatch['apply'](_0x382721,_0x20f868,!![]);}catch(_0x3e5c3f){return BPromise[_0xc010('0x22')](_0x3e5c3f);}return _0x382721[_0xc010('0x23')]();};}function saveUpdates(_0x1a4f71,_0x5a6527){return function(_0x5ee3f5){if(_0x5ee3f5){return _0x5ee3f5[_0xc010('0x24')](_0x1a4f71)[_0xc010('0x25')](function(_0x49d0f9){return _0x49d0f9;});}return null;};}function removeEntity(_0x139e32,_0x599784){return function(_0x2fcd0e){if(_0x2fcd0e){return _0x2fcd0e[_0xc010('0x26')]()[_0xc010('0x25')](function(){var _0x256fe1=_0x2fcd0e['get']({'plain':!![]});var _0x4b6ca3='Templates';return db['UserProfileResource'][_0xc010('0x26')]({'where':{'type':_0x4b6ca3,'resourceId':_0x256fe1['id']}})[_0xc010('0x25')](function(){return _0x2fcd0e;});})['then'](function(){_0x139e32['status'](0xcc)[_0xc010('0x1b')]();});}};}function handleEntityNotFound(_0x10e913,_0x45890e){return function(_0x4e0093){if(!_0x4e0093){_0x10e913[_0xc010('0x27')](0x194);}return _0x4e0093;};}function handleError(_0x39ce96,_0x31033b){_0x31033b=_0x31033b||0x1f4;return function(_0x36ecea){logger[_0xc010('0x28')](_0x36ecea[_0xc010('0x29')]);if(_0x36ecea[_0xc010('0x2a')]){delete _0x36ecea[_0xc010('0x2a')];}_0x39ce96[_0xc010('0x1a')](_0x31033b)[_0xc010('0x2b')](_0x36ecea);};}exports[_0xc010('0x2c')]=function(_0x3018d8,_0x43e9a9){var _0x35342a={},_0x18eabb={},_0x229d23={'count':0x0,'rows':[]};var _0x4fa772=_['map'](db[_0xc010('0x2d')][_0xc010('0x2e')],function(_0x46b740){return{'name':_0x46b740[_0xc010('0x2f')],'type':_0x46b740[_0xc010('0x30')][_0xc010('0x31')]};});_0x18eabb['model']=_[_0xc010('0x32')](_0x4fa772,_0xc010('0x2a'));_0x18eabb['query']=_[_0xc010('0x33')](_0x3018d8['query']);_0x18eabb['filters']=_['intersection'](_0x18eabb[_0xc010('0x34')],_0x18eabb[_0xc010('0x35')]);_0x35342a['attributes']=_['intersection'](_0x18eabb[_0xc010('0x34')],qs[_0xc010('0x36')](_0x3018d8['query'][_0xc010('0x36')]));_0x35342a['attributes']=_0x35342a[_0xc010('0x37')][_0xc010('0x38')]?_0x35342a[_0xc010('0x37')]:_0x18eabb['model'];if(!_0x3018d8['query'][_0xc010('0x39')](_0xc010('0x3a'))){_0x35342a[_0xc010('0x1d')]=qs[_0xc010('0x1d')](_0x3018d8[_0xc010('0x35')][_0xc010('0x1d')]);_0x35342a[_0xc010('0x1f')]=qs[_0xc010('0x1f')](_0x3018d8[_0xc010('0x35')][_0xc010('0x1f')]);}_0x35342a['order']=qs[_0xc010('0x3b')](_0x3018d8[_0xc010('0x35')]['sort']);_0x35342a['where']=qs[_0xc010('0x3c')](_[_0xc010('0x3d')](_0x3018d8[_0xc010('0x35')],_0x18eabb[_0xc010('0x3c')]),_0x4fa772);if(_0x3018d8[_0xc010('0x35')][_0xc010('0x3e')]){_0x35342a[_0xc010('0x3f')]=_[_0xc010('0x40')](_0x35342a[_0xc010('0x3f')],{'$or':_[_0xc010('0x32')](_0x4fa772,function(_0xa43564){if(_0xa43564[_0xc010('0x30')]!==_0xc010('0x41')){var _0x136664={};_0x136664[_0xa43564['name']]={'$like':'%'+_0x3018d8[_0xc010('0x35')][_0xc010('0x3e')]+'%'};return _0x136664;}})});}_0x35342a=_[_0xc010('0x40')]({},_0x35342a,_0x3018d8[_0xc010('0x42')]);var _0x49cb5a={'where':_0x35342a[_0xc010('0x3f')]};return db[_0xc010('0x2d')][_0xc010('0x1e')](_0x49cb5a)[_0xc010('0x25')](function(_0x11e775){_0x229d23['count']=_0x11e775;if(_0x3018d8[_0xc010('0x35')][_0xc010('0x43')]){_0x35342a[_0xc010('0x44')]=[{'all':!![]}];}return db['Template'][_0xc010('0x45')](_0x35342a);})[_0xc010('0x25')](function(_0x854fd4){_0x229d23[_0xc010('0x46')]=_0x854fd4;return _0x229d23;})[_0xc010('0x25')](respondWithFilteredResult(_0x43e9a9,_0x35342a))[_0xc010('0x47')](handleError(_0x43e9a9,null));};exports[_0xc010('0x48')]=function(_0xd88a3c,_0x85131a){var _0x6726a0={'raw':!![],'where':{'id':_0xd88a3c[_0xc010('0x49')]['id']}},_0xba48b4={};_0xba48b4[_0xc010('0x34')]=_[_0xc010('0x33')](db[_0xc010('0x2d')]['rawAttributes']);_0xba48b4[_0xc010('0x35')]=_[_0xc010('0x33')](_0xd88a3c['query']);_0xba48b4[_0xc010('0x3c')]=_['intersection'](_0xba48b4[_0xc010('0x34')],_0xba48b4['query']);_0x6726a0[_0xc010('0x37')]=_[_0xc010('0x4a')](_0xba48b4[_0xc010('0x34')],qs[_0xc010('0x36')](_0xd88a3c[_0xc010('0x35')][_0xc010('0x36')]));_0x6726a0[_0xc010('0x37')]=_0x6726a0[_0xc010('0x37')][_0xc010('0x38')]?_0x6726a0[_0xc010('0x37')]:_0xba48b4[_0xc010('0x34')];if(_0xd88a3c['query'][_0xc010('0x43')]){_0x6726a0['include']=[{'all':!![]}];}_0x6726a0=_[_0xc010('0x40')]({},_0x6726a0,_0xd88a3c[_0xc010('0x42')]);return db[_0xc010('0x2d')][_0xc010('0x4b')](_0x6726a0)['then'](handleEntityNotFound(_0x85131a,null))[_0xc010('0x25')](respondWithResult(_0x85131a,null))[_0xc010('0x47')](handleError(_0x85131a,null));};exports[_0xc010('0x4c')]=function(_0x2ae1dd,_0x1c7be3){return db[_0xc010('0x2d')][_0xc010('0x4c')](_0x2ae1dd[_0xc010('0x4d')],{})['then'](function(_0x4df3c5){var _0x5446c7=_0x2ae1dd[_0xc010('0x4e')][_0xc010('0x4f')]({'plain':!![]});if(!_0x5446c7)throw new Error(_0xc010('0x50'));if(_0x5446c7[_0xc010('0x51')]===_0xc010('0x4e')){var _0x4de0d9=_0x4df3c5['get']({'plain':!![]});var _0x430aff=_0xc010('0x52');return db[_0xc010('0x53')][_0xc010('0x4b')]({'where':{'name':_0x430aff,'userProfileId':_0x5446c7['userProfileId']},'raw':!![]})['then'](function(_0x12ad6e){if(_0x12ad6e&&_0x12ad6e[_0xc010('0x54')]===0x0){return db[_0xc010('0x55')]['create']({'name':_0x4de0d9['name'],'resourceId':_0x4de0d9['id'],'type':_0x12ad6e['name'],'sectionId':_0x12ad6e['id']},{})[_0xc010('0x25')](function(){return _0x4df3c5;});}else{return _0x4df3c5;}})[_0xc010('0x47')](function(_0x38d64f){logger[_0xc010('0x28')](_0xc010('0x56'),_0x38d64f);throw _0x38d64f;});}return _0x4df3c5;})[_0xc010('0x25')](respondWithResult(_0x1c7be3,0xc9))[_0xc010('0x47')](handleError(_0x1c7be3,null));};exports[_0xc010('0x24')]=function(_0xbaca9b,_0x44ebfb){if(_0xbaca9b[_0xc010('0x4d')]['id']){delete _0xbaca9b[_0xc010('0x4d')]['id'];}return db['Template'][_0xc010('0x4b')]({'where':{'id':_0xbaca9b[_0xc010('0x49')]['id']}})[_0xc010('0x25')](handleEntityNotFound(_0x44ebfb,null))[_0xc010('0x25')](saveUpdates(_0xbaca9b[_0xc010('0x4d')],null))['then'](respondWithResult(_0x44ebfb,null))[_0xc010('0x47')](handleError(_0x44ebfb,null));};exports[_0xc010('0x26')]=function(_0x5595c3,_0x1ed8b1){return db[_0xc010('0x2d')][_0xc010('0x4b')]({'where':{'id':_0x5595c3['params']['id']}})[_0xc010('0x25')](handleEntityNotFound(_0x1ed8b1,null))['then'](removeEntity(_0x1ed8b1,null))[_0xc010('0x47')](handleError(_0x1ed8b1,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 3dbd6cf..bb136c4 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 _0xc944=['bluebird','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','moment'];(function(_0x530086,_0x382014){var _0x4e29c2=function(_0x2bc473){while(--_0x2bc473){_0x530086['push'](_0x530086['shift']());}};_0x4e29c2(++_0x382014);}(_0xc944,0xec));var _0x4c94=function(_0x1c3cfd,_0x46b2f7){_0x1c3cfd=_0x1c3cfd-0x0;var _0x12fa72=_0xc944[_0x1c3cfd];return _0x12fa72;};'use strict';var _=require('lodash');var util=require(_0x4c94('0x0'));var logger=require(_0x4c94('0x1'))(_0x4c94('0x2'));var moment=require(_0x4c94('0x3'));var BPromise=require(_0x4c94('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(_0x4c94('0x5'));module[_0x4c94('0x6')]=function(_0x415398,_0x96d623){return _0x415398[_0x4c94('0x7')](_0x4c94('0x8'),attributes,{'tableName':_0x4c94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c1e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','tools_templates','lodash','util'];(function(_0x5384ae,_0x32e603){var _0x4bcf2d=function(_0x5c8e1b){while(--_0x5c8e1b){_0x5384ae['push'](_0x5384ae['shift']());}};_0x4bcf2d(++_0x32e603);}(_0x8c1e,0x1ac));var _0xe8c1=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x8c1e[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0xe8c1('0x0'));var util=require(_0xe8c1('0x1'));var logger=require('../../config/logger')(_0xe8c1('0x2'));var moment=require(_0xe8c1('0x3'));var BPromise=require(_0xe8c1('0x4'));var rp=require(_0xe8c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8c1('0x6'));var config=require(_0xe8c1('0x7'));var attributes=require(_0xe8c1('0x8'));module['exports']=function(_0x5b2106,_0x1cad96){return _0x5b2106['define']('Template',attributes,{'tableName':_0xe8c1('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 5cb2f14..2326bd8 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 _0xfe1b=['map','GetTemplate','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Template','options','raw','where','attributes','limit','include','model'];(function(_0xaf25ae,_0x2001c1){var _0x49732d=function(_0x5b764d){while(--_0x5b764d){_0xaf25ae['push'](_0xaf25ae['shift']());}};_0x49732d(++_0x2001c1);}(_0xfe1b,0x1e2));var _0xbfe1=function(_0x35102f,_0xe58b54){_0x35102f=_0x35102f-0x0;var _0x526ec1=_0xfe1b[_0x35102f];return _0x526ec1;};'use strict';var _=require(_0xbfe1('0x0'));var util=require(_0xbfe1('0x1'));var moment=require(_0xbfe1('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfe1('0x3'));var fs=require('fs');var Redis=require(_0xbfe1('0x4'));var db=require(_0xbfe1('0x5'))['db'];var utils=require(_0xbfe1('0x6'));var logger=require(_0xbfe1('0x7'))(_0xbfe1('0x8'));var config=require('../../config/environment');var jayson=require(_0xbfe1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7be560,_0x50f1fe,_0x39f131){return new BPromise(function(_0x2bffd9,_0x53f5db){return client[_0xbfe1('0xa')](_0x7be560,_0x39f131)[_0xbfe1('0xb')](function(_0x3abfb4){logger[_0xbfe1('0xc')](_0xbfe1('0xd'),_0x50f1fe,_0xbfe1('0xe'));logger[_0xbfe1('0xf')](_0xbfe1('0x10'),_0x50f1fe,_0xbfe1('0xe'),JSON[_0xbfe1('0x11')](_0x3abfb4));if(_0x3abfb4[_0xbfe1('0x12')]){if(_0x3abfb4['error']['code']===0x1f4){logger[_0xbfe1('0x12')](_0xbfe1('0xd'),_0x50f1fe,_0x3abfb4['error'][_0xbfe1('0x13')]);return _0x53f5db(_0x3abfb4[_0xbfe1('0x12')]['message']);}logger[_0xbfe1('0x12')](_0xbfe1('0xd'),_0x50f1fe,_0x3abfb4[_0xbfe1('0x12')][_0xbfe1('0x13')]);return _0x2bffd9(_0x3abfb4[_0xbfe1('0x12')][_0xbfe1('0x13')]);}else{logger['info'](_0xbfe1('0xd'),_0x50f1fe,_0xbfe1('0xe'));_0x2bffd9(_0x3abfb4[_0xbfe1('0x14')]['message']);}})[_0xbfe1('0x15')](function(_0x3e6770){logger[_0xbfe1('0x12')](_0xbfe1('0xd'),_0x50f1fe,_0x3e6770);_0x53f5db(_0x3e6770);});});}exports['GetTemplate']=function(_0x443b80){var _0x4f2792=this;return new Promise(function(_0x4f3431,_0x54f632){return db[_0xbfe1('0x16')]['findAll']({'raw':_0x443b80[_0xbfe1('0x17')]?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x18')]===undefined?!![]:![]:!![],'where':_0x443b80[_0xbfe1('0x17')]?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x19')]||null:null,'attributes':_0x443b80[_0xbfe1('0x17')]?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x1a')]||null:null,'limit':_0x443b80[_0xbfe1('0x17')]?_0x443b80['options'][_0xbfe1('0x1b')]||null:null,'include':_0x443b80['options']?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x1c')]?_['map'](_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x1c')],function(_0x30b3a3){return{'model':db[_0x30b3a3[_0xbfe1('0x1d')]],'as':_0x30b3a3['as'],'attributes':_0x30b3a3[_0xbfe1('0x1a')],'include':_0x30b3a3[_0xbfe1('0x1c')]?_[_0xbfe1('0x1e')](_0x30b3a3[_0xbfe1('0x1c')],function(_0xd15e8d){return{'model':db[_0xd15e8d[_0xbfe1('0x1d')]],'as':_0xd15e8d['as'],'attributes':_0xd15e8d['attributes'],'include':_0xd15e8d[_0xbfe1('0x1c')]?_[_0xbfe1('0x1e')](_0xd15e8d['include'],function(_0x5c65a1){return{'model':db[_0x5c65a1[_0xbfe1('0x1d')]],'as':_0x5c65a1['as'],'attributes':_0x5c65a1[_0xbfe1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59eb99){logger[_0xbfe1('0xc')](_0xbfe1('0x1f'),_0x443b80);logger['debug'](_0xbfe1('0x1f'),_0x443b80,JSON[_0xbfe1('0x11')](_0x59eb99));_0x4f3431(_0x59eb99);})[_0xbfe1('0x15')](function(_0x4900f0){logger[_0xbfe1('0x12')]('GetTemplate',_0x4900f0['message'],_0x443b80);_0x54f632(_0x4f2792[_0xbfe1('0x12')](0x1f4,_0x4900f0[_0xbfe1('0x13')]));});});}; \ No newline at end of file +var _0x4325=['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','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTemplate','Template','options','raw','attributes','limit','include','map','model','stringify','lodash','util','moment'];(function(_0x9f7f3,_0x386cc6){var _0x55ea87=function(_0x24dd04){while(--_0x24dd04){_0x9f7f3['push'](_0x9f7f3['shift']());}};_0x55ea87(++_0x386cc6);}(_0x4325,0x138));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require(_0x5432('0x2'));var BPromise=require(_0x5432('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require(_0x5432('0x5'))['db'];var utils=require(_0x5432('0x6'));var logger=require(_0x5432('0x7'))(_0x5432('0x8'));var config=require(_0x5432('0x9'));var jayson=require(_0x5432('0xa'));var client=jayson[_0x5432('0xb')][_0x5432('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d31d1,_0x5cfc8d,_0x25f317){return new BPromise(function(_0x5a8677,_0x2ce3ef){return client[_0x5432('0xd')](_0x2d31d1,_0x25f317)[_0x5432('0xe')](function(_0x58115b){logger[_0x5432('0xf')](_0x5432('0x10'),_0x5cfc8d,_0x5432('0x11'));logger[_0x5432('0x12')](_0x5432('0x13'),_0x5cfc8d,'request\x20sent',JSON['stringify'](_0x58115b));if(_0x58115b['error']){if(_0x58115b[_0x5432('0x14')][_0x5432('0x15')]===0x1f4){logger[_0x5432('0x14')](_0x5432('0x10'),_0x5cfc8d,_0x58115b[_0x5432('0x14')][_0x5432('0x16')]);return _0x2ce3ef(_0x58115b[_0x5432('0x14')][_0x5432('0x16')]);}logger['error'](_0x5432('0x10'),_0x5cfc8d,_0x58115b[_0x5432('0x14')][_0x5432('0x16')]);return _0x5a8677(_0x58115b[_0x5432('0x14')][_0x5432('0x16')]);}else{logger[_0x5432('0xf')](_0x5432('0x10'),_0x5cfc8d,'request\x20sent');_0x5a8677(_0x58115b[_0x5432('0x17')][_0x5432('0x16')]);}})[_0x5432('0x18')](function(_0x42229c){logger[_0x5432('0x14')]('Template,\x20%s,\x20%s',_0x5cfc8d,_0x42229c);_0x2ce3ef(_0x42229c);});});}exports[_0x5432('0x19')]=function(_0x3524be){var _0x163227=this;return new Promise(function(_0x4219df,_0x38878a){return db[_0x5432('0x1a')]['findAll']({'raw':_0x3524be[_0x5432('0x1b')]?_0x3524be['options'][_0x5432('0x1c')]===undefined?!![]:![]:!![],'where':_0x3524be[_0x5432('0x1b')]?_0x3524be['options']['where']||null:null,'attributes':_0x3524be[_0x5432('0x1b')]?_0x3524be[_0x5432('0x1b')][_0x5432('0x1d')]||null:null,'limit':_0x3524be[_0x5432('0x1b')]?_0x3524be['options'][_0x5432('0x1e')]||null:null,'include':_0x3524be['options']?_0x3524be['options'][_0x5432('0x1f')]?_['map'](_0x3524be[_0x5432('0x1b')][_0x5432('0x1f')],function(_0x4d7301){return{'model':db[_0x4d7301['model']],'as':_0x4d7301['as'],'attributes':_0x4d7301['attributes'],'include':_0x4d7301['include']?_[_0x5432('0x20')](_0x4d7301[_0x5432('0x1f')],function(_0x4a161a){return{'model':db[_0x4a161a['model']],'as':_0x4a161a['as'],'attributes':_0x4a161a['attributes'],'include':_0x4a161a['include']?_[_0x5432('0x20')](_0x4a161a[_0x5432('0x1f')],function(_0x2e2734){return{'model':db[_0x2e2734[_0x5432('0x21')]],'as':_0x2e2734['as'],'attributes':_0x2e2734[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x428c41){logger[_0x5432('0xf')]('GetTemplate',_0x3524be);logger[_0x5432('0x12')](_0x5432('0x19'),_0x3524be,JSON[_0x5432('0x22')](_0x428c41));_0x4219df(_0x428c41);})[_0x5432('0x18')](function(_0x24a2b9){logger['error'](_0x5432('0x19'),_0x24a2b9[_0x5432('0x16')],_0x3524be);_0x38878a(_0x163227[_0x5432('0x14')](0x1f4,_0x24a2b9[_0x5432('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index ec62d79..22581e2 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 _0x3308=['addAllCondition','/:id/actions','addAction','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','post'];(function(_0x579155,_0x26d4e5){var _0x1bab6d=function(_0x51def4){while(--_0x51def4){_0x579155['push'](_0x579155['shift']());}};_0x1bab6d(++_0x26d4e5);}(_0x3308,0x160));var _0x8330=function(_0x71a356,_0x421707){_0x71a356=_0x71a356-0x0;var _0x5f58c5=_0x3308[_0x71a356];return _0x5f58c5;};'use strict';var multer=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var path=require(_0x8330('0x2'));var timeout=require(_0x8330('0x3'));var express=require(_0x8330('0x4'));var router=express[_0x8330('0x5')]();var fs_extra=require(_0x8330('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8330('0x7'));var controller=require('./trigger.controller');router[_0x8330('0x8')]('/',auth[_0x8330('0x9')](),controller[_0x8330('0xa')]);router['get'](_0x8330('0xb'),auth[_0x8330('0x9')](),controller[_0x8330('0xc')]);router[_0x8330('0x8')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller['getAllConditions']);router[_0x8330('0x8')](_0x8330('0xe'),auth[_0x8330('0x9')](),controller['getAnyConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0x8330('0x9')](),controller['create']);router[_0x8330('0xf')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller[_0x8330('0x10')]);router[_0x8330('0xf')]('/:id/any_conditions',auth[_0x8330('0x9')](),controller['addAnyCondition']);router[_0x8330('0xf')](_0x8330('0x11'),auth[_0x8330('0x9')](),controller[_0x8330('0x12')]);router[_0x8330('0x13')](_0x8330('0xb'),auth[_0x8330('0x9')](),controller[_0x8330('0x14')]);router[_0x8330('0x15')]('/:id',auth[_0x8330('0x9')](),controller[_0x8330('0x16')]);module['exports']=router; \ No newline at end of file +var _0x9563=['get','isAuthenticated','index','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x2c4f8b,_0x4de350){var _0x5b29eb=function(_0x5163e5){while(--_0x5163e5){_0x2c4f8b['push'](_0x2c4f8b['shift']());}};_0x5b29eb(++_0x4de350);}(_0x9563,0x1e7));var _0x3956=function(_0xcc18e0,_0x1dee74){_0xcc18e0=_0xcc18e0-0x0;var _0x15ac5b=_0x9563[_0xcc18e0];return _0x15ac5b;};'use strict';var multer=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var path=require('path');var timeout=require(_0x3956('0x2'));var express=require(_0x3956('0x3'));var router=express[_0x3956('0x4')]();var fs_extra=require(_0x3956('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3956('0x6'));var controller=require('./trigger.controller');router[_0x3956('0x7')]('/',auth[_0x3956('0x8')](),controller[_0x3956('0x9')]);router[_0x3956('0x7')]('/:id',auth[_0x3956('0x8')](),controller[_0x3956('0xa')]);router[_0x3956('0x7')](_0x3956('0xb'),auth[_0x3956('0x8')](),controller['getAllConditions']);router['get'](_0x3956('0xc'),auth[_0x3956('0x8')](),controller[_0x3956('0xd')]);router[_0x3956('0x7')]('/:id/actions',auth[_0x3956('0x8')](),controller[_0x3956('0xe')]);router[_0x3956('0xf')]('/',auth[_0x3956('0x8')](),controller[_0x3956('0x10')]);router[_0x3956('0xf')](_0x3956('0xb'),auth[_0x3956('0x8')](),controller[_0x3956('0x11')]);router['post']('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x3956('0x12')]);router[_0x3956('0xf')]('/:id/actions',auth[_0x3956('0x8')](),controller[_0x3956('0x13')]);router[_0x3956('0x14')](_0x3956('0x15'),auth[_0x3956('0x8')](),controller[_0x3956('0x16')]);router[_0x3956('0x17')](_0x3956('0x15'),auth[_0x3956('0x8')](),controller[_0x3956('0x18')]);module[_0x3956('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 97f08f2..a590232 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 _0xfcec=['sequelize','exports','STRING','BOOLEAN'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0xfcec,0xa0));var _0xcfce=function(_0x203b5c,_0x2384f1){_0x203b5c=_0x203b5c-0x0;var _0x20a057=_0xfcec[_0x203b5c];return _0x20a057;};'use strict';var Sequelize=require(_0xcfce('0x0'));module[_0xcfce('0x1')]={'name':{'type':Sequelize[_0xcfce('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcfce('0x2')]},'status':{'type':Sequelize[_0xcfce('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb2b4=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3d2495,_0x4fd067){var _0x4af491=function(_0x40eaf0){while(--_0x40eaf0){_0x3d2495['push'](_0x3d2495['shift']());}};_0x4af491(++_0x4fd067);}(_0xb2b4,0x103));var _0x4b2b=function(_0x308c00,_0x3cbd67){_0x308c00=_0x308c00-0x0;var _0x2b21b2=_0xb2b4[_0x308c00];return _0x2b21b2;};'use strict';var Sequelize=require(_0x4b2b('0x0'));module[_0x4b2b('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4b2b('0x2')]},'description':{'type':Sequelize[_0x4b2b('0x2')]},'status':{'type':Sequelize[_0x4b2b('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 26a97a5..d9dd173 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 _0x7bdb=['intersection','model','attributes','fields','length','nolimit','sort','where','type','VIRTUAL','merge','options','include','Trigger','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','filter','order','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','get','Triggers','UserProfileResource','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters'];(function(_0x3b9f6a,_0x133730){var _0xfe40b1=function(_0x4513eb){while(--_0x4513eb){_0x3b9f6a['push'](_0x3b9f6a['shift']());}};_0xfe40b1(++_0x133730);}(_0x7bdb,0x8f));var _0xb7bd=function(_0x51ef40,_0x48a870){_0x51ef40=_0x51ef40-0x0;var _0x3ff060=_0x7bdb[_0x51ef40];return _0x3ff060;};'use strict';var emlformat=require(_0xb7bd('0x0'));var rimraf=require(_0xb7bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7bd('0x2'));var moment=require(_0xb7bd('0x3'));var BPromise=require(_0xb7bd('0x4'));var Mustache=require(_0xb7bd('0x5'));var util=require(_0xb7bd('0x6'));var path=require(_0xb7bd('0x7'));var sox=require(_0xb7bd('0x8'));var csv=require(_0xb7bd('0x9'));var ejs=require(_0xb7bd('0xa'));var fs=require('fs');var fs_extra=require(_0xb7bd('0xb'));var _=require(_0xb7bd('0xc'));var squel=require(_0xb7bd('0xd'));var crypto=require(_0xb7bd('0xe'));var jsforce=require(_0xb7bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb7bd('0x9'));var querystring=require(_0xb7bd('0x10'));var Papa=require(_0xb7bd('0x11'));var Redis=require(_0xb7bd('0x12'));var authService=require(_0xb7bd('0x13'));var qs=require(_0xb7bd('0x14'));var as=require(_0xb7bd('0x15'));var hardwareService=require(_0xb7bd('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xb7bd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb7bd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c838d,_0x391ae5){_0x391ae5=_0x391ae5||0xcc;return function(_0x14210a){if(_0x14210a){return _0x2c838d[_0xb7bd('0x19')](_0x391ae5);}return _0x2c838d[_0xb7bd('0x1a')](_0x391ae5)['end']();};}function respondWithResult(_0x4704c5,_0x4ec8fd){_0x4ec8fd=_0x4ec8fd||0xc8;return function(_0x1c6cfa){if(_0x1c6cfa){return _0x4704c5['status'](_0x4ec8fd)[_0xb7bd('0x1b')](_0x1c6cfa);}};}function respondWithFilteredResult(_0x4190ed,_0x1e0adf){return function(_0x18a556){if(_0x18a556){var _0x3e8372=typeof _0x1e0adf[_0xb7bd('0x1c')]===_0xb7bd('0x1d')&&typeof _0x1e0adf[_0xb7bd('0x1e')]==='undefined';var _0x342d0e=_0x18a556[_0xb7bd('0x1f')];var _0x39763a=_0x3e8372?0x0:_0x1e0adf[_0xb7bd('0x1c')];var _0x5118e5=_0x3e8372?_0x18a556[_0xb7bd('0x1f')]:_0x1e0adf[_0xb7bd('0x1c')]+_0x1e0adf[_0xb7bd('0x1e')];var _0x795942;if(_0x5118e5>=_0x342d0e){_0x5118e5=_0x342d0e;_0x795942=0xc8;}else{_0x795942=0xce;}_0x4190ed[_0xb7bd('0x1a')](_0x795942);return _0x4190ed['set'](_0xb7bd('0x20'),_0x39763a+'-'+_0x5118e5+'/'+_0x342d0e)[_0xb7bd('0x1b')](_0x18a556);}return null;};}function patchUpdates(_0x4a0ebf){return function(_0x18f203){try{jsonpatch['apply'](_0x18f203,_0x4a0ebf,!![]);}catch(_0x12e5bf){return BPromise['reject'](_0x12e5bf);}return _0x18f203[_0xb7bd('0x21')]();};}function saveUpdates(_0x5751ee,_0x116c99){return function(_0x5a51aa){if(_0x5a51aa){return _0x5a51aa[_0xb7bd('0x22')](_0x5751ee)['then'](function(_0x299f3c){return _0x299f3c;});}return null;};}function removeEntity(_0x5aad1e,_0x33be6b){return function(_0x2f255b){if(_0x2f255b){return _0x2f255b[_0xb7bd('0x23')]()['then'](function(){var _0x1935ba=_0x2f255b[_0xb7bd('0x24')]({'plain':!![]});var _0x3af6dc=_0xb7bd('0x25');return db[_0xb7bd('0x26')][_0xb7bd('0x23')]({'where':{'type':_0x3af6dc,'resourceId':_0x1935ba['id']}})[_0xb7bd('0x27')](function(){return _0x2f255b;});})[_0xb7bd('0x27')](function(){_0x5aad1e[_0xb7bd('0x1a')](0xcc)[_0xb7bd('0x28')]();});}};}function handleEntityNotFound(_0x51bafb,_0x3e2a15){return function(_0x1fd64d){if(!_0x1fd64d){_0x51bafb[_0xb7bd('0x19')](0x194);}return _0x1fd64d;};}function handleError(_0x4ebc73,_0x58469f){_0x58469f=_0x58469f||0x1f4;return function(_0x296bfa){logger[_0xb7bd('0x29')](_0x296bfa[_0xb7bd('0x2a')]);if(_0x296bfa[_0xb7bd('0x2b')]){delete _0x296bfa[_0xb7bd('0x2b')];}_0x4ebc73[_0xb7bd('0x1a')](_0x58469f)[_0xb7bd('0x2c')](_0x296bfa);};}exports[_0xb7bd('0x2d')]=function(_0x40567e,_0x3087f7){var _0x4c2def={},_0xaaf2cf={},_0x3c2773={'count':0x0,'rows':[]};var _0x26c81e=_[_0xb7bd('0x2e')](db['Trigger'][_0xb7bd('0x2f')],function(_0x5ec617){return{'name':_0x5ec617[_0xb7bd('0x30')],'type':_0x5ec617['type'][_0xb7bd('0x31')]};});_0xaaf2cf['model']=_[_0xb7bd('0x2e')](_0x26c81e,_0xb7bd('0x2b'));_0xaaf2cf[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x40567e[_0xb7bd('0x32')]);_0xaaf2cf[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0xaaf2cf[_0xb7bd('0x36')],_0xaaf2cf[_0xb7bd('0x32')]);_0x4c2def[_0xb7bd('0x37')]=_['intersection'](_0xaaf2cf[_0xb7bd('0x36')],qs['fields'](_0x40567e['query'][_0xb7bd('0x38')]));_0x4c2def[_0xb7bd('0x37')]=_0x4c2def[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0x4c2def[_0xb7bd('0x37')]:_0xaaf2cf[_0xb7bd('0x36')];if(!_0x40567e[_0xb7bd('0x32')]['hasOwnProperty'](_0xb7bd('0x3a'))){_0x4c2def[_0xb7bd('0x1e')]=qs['limit'](_0x40567e[_0xb7bd('0x32')][_0xb7bd('0x1e')]);_0x4c2def[_0xb7bd('0x1c')]=qs[_0xb7bd('0x1c')](_0x40567e[_0xb7bd('0x32')]['offset']);}_0x4c2def['order']=qs['sort'](_0x40567e[_0xb7bd('0x32')][_0xb7bd('0x3b')]);_0x4c2def[_0xb7bd('0x3c')]=qs['filters'](_['pick'](_0x40567e['query'],_0xaaf2cf[_0xb7bd('0x34')]),_0x26c81e);if(_0x40567e[_0xb7bd('0x32')]['filter']){_0x4c2def[_0xb7bd('0x3c')]=_['merge'](_0x4c2def['where'],{'$or':_[_0xb7bd('0x2e')](_0x26c81e,function(_0xfd0109){if(_0xfd0109[_0xb7bd('0x3d')]!==_0xb7bd('0x3e')){var _0xbb4ed0={};_0xbb4ed0[_0xfd0109['name']]={'$like':'%'+_0x40567e[_0xb7bd('0x32')]['filter']+'%'};return _0xbb4ed0;}})});}_0x4c2def=_[_0xb7bd('0x3f')]({},_0x4c2def,_0x40567e[_0xb7bd('0x40')]);var _0x2b47fb={'where':_0x4c2def['where']};return db['Trigger'][_0xb7bd('0x1f')](_0x2b47fb)[_0xb7bd('0x27')](function(_0x2d70b2){_0x3c2773[_0xb7bd('0x1f')]=_0x2d70b2;if(_0x40567e['query']['includeAll']){_0x4c2def[_0xb7bd('0x41')]=[{'all':!![]}];}return db[_0xb7bd('0x42')][_0xb7bd('0x43')](_0x4c2def);})[_0xb7bd('0x27')](function(_0xa5730c){_0x3c2773['rows']=_0xa5730c;return _0x3c2773;})[_0xb7bd('0x27')](respondWithFilteredResult(_0x3087f7,_0x4c2def))[_0xb7bd('0x44')](handleError(_0x3087f7,null));};exports[_0xb7bd('0x45')]=function(_0x23b82b,_0x386272){var _0x448ea1={'raw':![],'where':{'id':_0x23b82b[_0xb7bd('0x46')]['id']}},_0x51ed7f={};_0x51ed7f['model']=_[_0xb7bd('0x33')](db[_0xb7bd('0x42')]['rawAttributes']);_0x51ed7f[_0xb7bd('0x32')]=_['keys'](_0x23b82b[_0xb7bd('0x32')]);_0x51ed7f[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x51ed7f[_0xb7bd('0x36')],_0x51ed7f[_0xb7bd('0x32')]);_0x448ea1['attributes']=_[_0xb7bd('0x35')](_0x51ed7f[_0xb7bd('0x36')],qs[_0xb7bd('0x38')](_0x23b82b['query'][_0xb7bd('0x38')]));_0x448ea1[_0xb7bd('0x37')]=_0x448ea1['attributes']['length']?_0x448ea1['attributes']:_0x51ed7f[_0xb7bd('0x36')];if(_0x23b82b[_0xb7bd('0x32')][_0xb7bd('0x47')]){_0x448ea1[_0xb7bd('0x41')]=[{'all':!![]}];}_0x448ea1=_[_0xb7bd('0x3f')]({},_0x448ea1,_0x23b82b[_0xb7bd('0x40')]);return db[_0xb7bd('0x42')][_0xb7bd('0x48')](_0x448ea1)['then'](handleEntityNotFound(_0x386272,null))['then'](respondWithResult(_0x386272,null))['catch'](handleError(_0x386272,null));};exports[_0xb7bd('0x49')]=function(_0x355131,_0x86ac21){return db[_0xb7bd('0x42')][_0xb7bd('0x49')](_0x355131[_0xb7bd('0x4a')],{})['then'](function(_0x37c952){var _0x236ef2=_0x355131[_0xb7bd('0x4b')]['get']({'plain':!![]});if(!_0x236ef2)throw new Error(_0xb7bd('0x4c'));if(_0x236ef2[_0xb7bd('0x4d')]===_0xb7bd('0x4b')){var _0x40d0dd=_0x37c952[_0xb7bd('0x24')]({'plain':!![]});var _0x1de45f='Triggers';return db[_0xb7bd('0x4e')][_0xb7bd('0x48')]({'where':{'name':_0x1de45f,'userProfileId':_0x236ef2[_0xb7bd('0x4f')]},'raw':!![]})[_0xb7bd('0x27')](function(_0x43b961){if(_0x43b961&&_0x43b961[_0xb7bd('0x50')]===0x0){return db[_0xb7bd('0x26')]['create']({'name':_0x40d0dd[_0xb7bd('0x2b')],'resourceId':_0x40d0dd['id'],'type':_0x43b961[_0xb7bd('0x2b')],'sectionId':_0x43b961['id']},{})[_0xb7bd('0x27')](function(){return _0x37c952;});}else{return _0x37c952;}})[_0xb7bd('0x44')](function(_0x45725d){logger[_0xb7bd('0x29')](_0xb7bd('0x51'),_0x45725d);throw _0x45725d;});}return _0x37c952;})[_0xb7bd('0x27')](respondWithResult(_0x86ac21,0xc9))[_0xb7bd('0x44')](handleError(_0x86ac21,null));};exports[_0xb7bd('0x22')]=function(_0x4d7fe0,_0x24d81b){if(_0x4d7fe0[_0xb7bd('0x4a')]['id']){delete _0x4d7fe0['body']['id'];}return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x4d7fe0[_0xb7bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x24d81b,null))[_0xb7bd('0x27')](saveUpdates(_0x4d7fe0[_0xb7bd('0x4a')],null))[_0xb7bd('0x27')](respondWithResult(_0x24d81b,null))[_0xb7bd('0x44')](handleError(_0x24d81b,null));};exports[_0xb7bd('0x23')]=function(_0x128e8d,_0x59c5d4){return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x128e8d[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x59c5d4,null))[_0xb7bd('0x27')](removeEntity(_0x59c5d4,null))[_0xb7bd('0x44')](handleError(_0x59c5d4,null));};exports[_0xb7bd('0x52')]=function(_0x581e96,_0x2f2b51,_0x3ea3e1){if(_0x581e96['body']['id']){delete _0x581e96[_0xb7bd('0x4a')]['id'];}return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x581e96[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x2f2b51,null))[_0xb7bd('0x27')](function(_0x3593c5){if(_0x3593c5){_0x581e96[_0xb7bd('0x4a')][_0xb7bd('0x53')]=_0x3593c5['id'];return db[_0xb7bd('0x54')]['create'](_0x581e96[_0xb7bd('0x4a')]);}})[_0xb7bd('0x27')](respondWithResult(_0x2f2b51,null))['catch'](handleError(_0x2f2b51,null));};exports[_0xb7bd('0x55')]=function(_0x201d4a,_0x416b9d,_0x46d06f){if(_0x201d4a[_0xb7bd('0x4a')]['id']){delete _0x201d4a[_0xb7bd('0x4a')]['id'];}return db['Trigger']['find']({'where':{'id':_0x201d4a[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x416b9d,null))[_0xb7bd('0x27')](function(_0x59ab61){if(_0x59ab61){_0x201d4a[_0xb7bd('0x4a')][_0xb7bd('0x56')]=_0x59ab61['id'];return db[_0xb7bd('0x54')][_0xb7bd('0x49')](_0x201d4a['body']);}})[_0xb7bd('0x27')](respondWithResult(_0x416b9d,null))[_0xb7bd('0x44')](handleError(_0x416b9d,null));};exports[_0xb7bd('0x57')]=function(_0x31f801,_0x4d1359,_0x104acc){var _0x259f41={};var _0x316fd0={};var _0x45799b;var _0x5dc16a;return db['Trigger'][_0xb7bd('0x58')]({'where':{'id':_0x31f801['params']['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x4d1359,null))['then'](function(_0x2c0050){if(_0x2c0050){_0x45799b=_0x2c0050;_0x316fd0[_0xb7bd('0x36')]=_[_0xb7bd('0x33')](db[_0xb7bd('0x54')][_0xb7bd('0x2f')]);_0x316fd0[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x31f801['query']);_0x316fd0[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x316fd0[_0xb7bd('0x36')],_0x316fd0['query']);_0x259f41['attributes']=_[_0xb7bd('0x35')](_0x316fd0[_0xb7bd('0x36')],qs[_0xb7bd('0x38')](_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x38')]));_0x259f41[_0xb7bd('0x37')]=_0x259f41[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0x259f41[_0xb7bd('0x37')]:_0x316fd0[_0xb7bd('0x36')];_0x259f41['order']=qs[_0xb7bd('0x3b')](_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x3b')]);_0x259f41[_0xb7bd('0x3c')]=qs['filters'](_[_0xb7bd('0x59')](_0x31f801[_0xb7bd('0x32')],_0x316fd0[_0xb7bd('0x34')]));if(_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x5a')]){_0x259f41[_0xb7bd('0x3c')]=_['merge'](_0x259f41['where'],{'$or':_['map'](_0x259f41['attributes'],function(_0x1cefb1){var _0x39725c={};_0x39725c[_0x1cefb1]={'$like':'%'+_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x5a')]+'%'};return _0x39725c;})});}_0x259f41=_[_0xb7bd('0x3f')]({},_0x259f41,_0x31f801[_0xb7bd('0x40')]);return _0x45799b['getAllConditions'](_0x259f41);}})[_0xb7bd('0x27')](function(_0x9305d9){if(_0x9305d9){_0x5dc16a=_0x9305d9[_0xb7bd('0x39')];if(!_0x31f801[_0xb7bd('0x32')]['hasOwnProperty'](_0xb7bd('0x3a'))){_0x259f41[_0xb7bd('0x1e')]=qs[_0xb7bd('0x1e')](_0x31f801[_0xb7bd('0x32')]['limit']);_0x259f41['offset']=qs[_0xb7bd('0x1c')](_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x1c')]);}return _0x45799b[_0xb7bd('0x57')](_0x259f41);}})[_0xb7bd('0x27')](function(_0x50b6fa){if(_0x50b6fa){return _0x50b6fa?{'count':_0x5dc16a,'rows':_0x50b6fa}:null;}})[_0xb7bd('0x27')](respondWithResult(_0x4d1359,null))['catch'](handleError(_0x4d1359,null));};exports['getAnyConditions']=function(_0x51daff,_0x36ddce,_0x2229ce){var _0xfe0919={};var _0x211853={};var _0x2dd560;var _0x3e8de5;return db[_0xb7bd('0x42')][_0xb7bd('0x58')]({'where':{'id':_0x51daff[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x36ddce,null))[_0xb7bd('0x27')](function(_0x2c37bd){if(_0x2c37bd){_0x2dd560=_0x2c37bd;_0x211853[_0xb7bd('0x36')]=_['keys'](db[_0xb7bd('0x54')]['rawAttributes']);_0x211853[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x51daff[_0xb7bd('0x32')]);_0x211853[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x211853[_0xb7bd('0x36')],_0x211853['query']);_0xfe0919[_0xb7bd('0x37')]=_[_0xb7bd('0x35')](_0x211853[_0xb7bd('0x36')],qs[_0xb7bd('0x38')](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x38')]));_0xfe0919[_0xb7bd('0x37')]=_0xfe0919[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0xfe0919['attributes']:_0x211853[_0xb7bd('0x36')];_0xfe0919[_0xb7bd('0x5b')]=qs['sort'](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x3b')]);_0xfe0919[_0xb7bd('0x3c')]=qs[_0xb7bd('0x34')](_[_0xb7bd('0x59')](_0x51daff[_0xb7bd('0x32')],_0x211853[_0xb7bd('0x34')]));if(_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x5a')]){_0xfe0919[_0xb7bd('0x3c')]=_[_0xb7bd('0x3f')](_0xfe0919[_0xb7bd('0x3c')],{'$or':_[_0xb7bd('0x2e')](_0xfe0919['attributes'],function(_0x45248b){var _0x4c29d3={};_0x4c29d3[_0x45248b]={'$like':'%'+_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x5a')]+'%'};return _0x4c29d3;})});}_0xfe0919=_[_0xb7bd('0x3f')]({},_0xfe0919,_0x51daff[_0xb7bd('0x40')]);return _0x2dd560['getAnyConditions'](_0xfe0919);}})[_0xb7bd('0x27')](function(_0x2b9ebc){if(_0x2b9ebc){_0x3e8de5=_0x2b9ebc[_0xb7bd('0x39')];if(!_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x5c')]('nolimit')){_0xfe0919['limit']=qs[_0xb7bd('0x1e')](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x1e')]);_0xfe0919[_0xb7bd('0x1c')]=qs[_0xb7bd('0x1c')](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x1c')]);}return _0x2dd560[_0xb7bd('0x5d')](_0xfe0919);}})[_0xb7bd('0x27')](function(_0x2f9bb0){if(_0x2f9bb0){return _0x2f9bb0?{'count':_0x3e8de5,'rows':_0x2f9bb0}:null;}})['then'](respondWithResult(_0x36ddce,null))[_0xb7bd('0x44')](handleError(_0x36ddce,null));};exports[_0xb7bd('0x5e')]=function(_0x4d777c,_0x493c27,_0x127afb){if(_0x4d777c[_0xb7bd('0x4a')]['id']){delete _0x4d777c[_0xb7bd('0x4a')]['id'];}return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x4d777c[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x493c27,null))[_0xb7bd('0x27')](function(_0xcef060){if(_0xcef060){_0x4d777c[_0xb7bd('0x4a')][_0xb7bd('0x5f')]=_0xcef060['id'];return db[_0xb7bd('0x60')][_0xb7bd('0x49')](_0x4d777c[_0xb7bd('0x4a')]);}})[_0xb7bd('0x27')](respondWithResult(_0x493c27,null))[_0xb7bd('0x44')](handleError(_0x493c27,null));};exports['getActions']=function(_0x1b43d8,_0xc5a0fc,_0x105d8a){var _0x580dee={};var _0x3aa137={};var _0x2891a4;var _0xd4bc73;return db['Trigger'][_0xb7bd('0x58')]({'where':{'id':_0x1b43d8['params']['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0xc5a0fc,null))[_0xb7bd('0x27')](function(_0x22cbec){if(_0x22cbec){_0x2891a4=_0x22cbec;_0x3aa137['model']=_[_0xb7bd('0x33')](db[_0xb7bd('0x60')][_0xb7bd('0x2f')]);_0x3aa137[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x1b43d8[_0xb7bd('0x32')]);_0x3aa137[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x3aa137['model'],_0x3aa137[_0xb7bd('0x32')]);_0x580dee[_0xb7bd('0x37')]=_[_0xb7bd('0x35')](_0x3aa137[_0xb7bd('0x36')],qs['fields'](_0x1b43d8[_0xb7bd('0x32')]['fields']));_0x580dee[_0xb7bd('0x37')]=_0x580dee[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0x580dee[_0xb7bd('0x37')]:_0x3aa137[_0xb7bd('0x36')];_0x580dee[_0xb7bd('0x5b')]=qs[_0xb7bd('0x3b')](_0x1b43d8[_0xb7bd('0x32')]['sort']);_0x580dee[_0xb7bd('0x3c')]=qs[_0xb7bd('0x34')](_['pick'](_0x1b43d8[_0xb7bd('0x32')],_0x3aa137[_0xb7bd('0x34')]));if(_0x1b43d8[_0xb7bd('0x32')][_0xb7bd('0x5a')]){_0x580dee['where']=_[_0xb7bd('0x3f')](_0x580dee['where'],{'$or':_[_0xb7bd('0x2e')](_0x580dee[_0xb7bd('0x37')],function(_0x5c5227){var _0x2a5b1e={};_0x2a5b1e[_0x5c5227]={'$like':'%'+_0x1b43d8[_0xb7bd('0x32')][_0xb7bd('0x5a')]+'%'};return _0x2a5b1e;})});}_0x580dee=_[_0xb7bd('0x3f')]({},_0x580dee,_0x1b43d8['options']);return _0x2891a4[_0xb7bd('0x61')](_0x580dee);}})['then'](function(_0x9b22fb){if(_0x9b22fb){_0xd4bc73=_0x9b22fb['length'];if(!_0x1b43d8[_0xb7bd('0x32')][_0xb7bd('0x5c')](_0xb7bd('0x3a'))){_0x580dee[_0xb7bd('0x1e')]=qs[_0xb7bd('0x1e')](_0x1b43d8[_0xb7bd('0x32')]['limit']);_0x580dee[_0xb7bd('0x1c')]=qs[_0xb7bd('0x1c')](_0x1b43d8['query']['offset']);}return _0x2891a4[_0xb7bd('0x61')](_0x580dee);}})[_0xb7bd('0x27')](function(_0x295604){if(_0x295604){return _0x295604?{'count':_0xd4bc73,'rows':_0x295604}:null;}})['then'](respondWithResult(_0xc5a0fc,null))[_0xb7bd('0x44')](handleError(_0xc5a0fc,null));}; \ No newline at end of file +var _0x72fc=['getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','get','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Trigger','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','userProfileId','autoAssociation','destroy','addAllCondition','Condition','addAnyCondition','TriggerAnyId'];(function(_0x2f7475,_0x5b83ab){var _0x412abe=function(_0x3d86af){while(--_0x3d86af){_0x2f7475['push'](_0x2f7475['shift']());}};_0x412abe(++_0x5b83ab);}(_0x72fc,0xb9));var _0xc72f=function(_0x5992de,_0x354995){_0x5992de=_0x5992de-0x0;var _0x21f9e8=_0x72fc[_0x5992de];return _0x21f9e8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc72f('0x0'));var rp=require(_0xc72f('0x1'));var moment=require(_0xc72f('0x2'));var BPromise=require(_0xc72f('0x3'));var Mustache=require(_0xc72f('0x4'));var util=require(_0xc72f('0x5'));var path=require(_0xc72f('0x6'));var sox=require('sox');var csv=require(_0xc72f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc72f('0x8'));var _=require(_0xc72f('0x9'));var squel=require(_0xc72f('0xa'));var crypto=require(_0xc72f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc72f('0xc'));var toCsv=require(_0xc72f('0x7'));var querystring=require(_0xc72f('0xd'));var Papa=require('papaparse');var Redis=require(_0xc72f('0xe'));var authService=require(_0xc72f('0xf'));var qs=require(_0xc72f('0x10'));var as=require(_0xc72f('0x11'));var hardwareService=require(_0xc72f('0x12'));var logger=require(_0xc72f('0x13'))(_0xc72f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a97a8,_0x38d984){_0x38d984=_0x38d984||0xcc;return function(_0x42b31a){if(_0x42b31a){return _0x2a97a8[_0xc72f('0x15')](_0x38d984);}return _0x2a97a8[_0xc72f('0x16')](_0x38d984)[_0xc72f('0x17')]();};}function respondWithResult(_0x585f74,_0x56d6e3){_0x56d6e3=_0x56d6e3||0xc8;return function(_0x5204e1){if(_0x5204e1){return _0x585f74[_0xc72f('0x16')](_0x56d6e3)['json'](_0x5204e1);}};}function respondWithFilteredResult(_0x5b313d,_0x3baf7f){return function(_0x296107){if(_0x296107){var _0x143a6d=typeof _0x3baf7f[_0xc72f('0x18')]===_0xc72f('0x19')&&typeof _0x3baf7f[_0xc72f('0x1a')]===_0xc72f('0x19');var _0x3255eb=_0x296107[_0xc72f('0x1b')];var _0x308224=_0x143a6d?0x0:_0x3baf7f[_0xc72f('0x18')];var _0x3469e1=_0x143a6d?_0x296107['count']:_0x3baf7f[_0xc72f('0x18')]+_0x3baf7f[_0xc72f('0x1a')];var _0x23e9b1;if(_0x3469e1>=_0x3255eb){_0x3469e1=_0x3255eb;_0x23e9b1=0xc8;}else{_0x23e9b1=0xce;}_0x5b313d['status'](_0x23e9b1);return _0x5b313d['set'](_0xc72f('0x1c'),_0x308224+'-'+_0x3469e1+'/'+_0x3255eb)[_0xc72f('0x1d')](_0x296107);}return null;};}function patchUpdates(_0x5f35c3){return function(_0x15d861){try{jsonpatch['apply'](_0x15d861,_0x5f35c3,!![]);}catch(_0x33d174){return BPromise[_0xc72f('0x1e')](_0x33d174);}return _0x15d861[_0xc72f('0x1f')]();};}function saveUpdates(_0x17903e,_0x20efdd){return function(_0x56c3c9){if(_0x56c3c9){return _0x56c3c9[_0xc72f('0x20')](_0x17903e)[_0xc72f('0x21')](function(_0x4673f9){return _0x4673f9;});}return null;};}function removeEntity(_0x3ca7f9,_0x50646b){return function(_0x29bea6){if(_0x29bea6){return _0x29bea6['destroy']()[_0xc72f('0x21')](function(){var _0x18845c=_0x29bea6[_0xc72f('0x22')]({'plain':!![]});var _0x3715b3='Triggers';return db[_0xc72f('0x23')]['destroy']({'where':{'type':_0x3715b3,'resourceId':_0x18845c['id']}})[_0xc72f('0x21')](function(){return _0x29bea6;});})['then'](function(){_0x3ca7f9['status'](0xcc)[_0xc72f('0x17')]();});}};}function handleEntityNotFound(_0x56a73e,_0x1a891e){return function(_0x24cf17){if(!_0x24cf17){_0x56a73e[_0xc72f('0x15')](0x194);}return _0x24cf17;};}function handleError(_0x7afe2e,_0x37581f){_0x37581f=_0x37581f||0x1f4;return function(_0x9ba6da){logger[_0xc72f('0x24')](_0x9ba6da[_0xc72f('0x25')]);if(_0x9ba6da['name']){delete _0x9ba6da[_0xc72f('0x26')];}_0x7afe2e[_0xc72f('0x16')](_0x37581f)['send'](_0x9ba6da);};}exports['index']=function(_0x2a01b1,_0x2b4370){var _0x189a41={},_0x4b608e={},_0x44f79c={'count':0x0,'rows':[]};var _0x4354e7=_[_0xc72f('0x27')](db['Trigger'][_0xc72f('0x28')],function(_0x3caad0){return{'name':_0x3caad0[_0xc72f('0x29')],'type':_0x3caad0['type'][_0xc72f('0x2a')]};});_0x4b608e[_0xc72f('0x2b')]=_[_0xc72f('0x27')](_0x4354e7,_0xc72f('0x26'));_0x4b608e[_0xc72f('0x2c')]=_[_0xc72f('0x2d')](_0x2a01b1['query']);_0x4b608e[_0xc72f('0x2e')]=_[_0xc72f('0x2f')](_0x4b608e[_0xc72f('0x2b')],_0x4b608e[_0xc72f('0x2c')]);_0x189a41[_0xc72f('0x30')]=_[_0xc72f('0x2f')](_0x4b608e[_0xc72f('0x2b')],qs['fields'](_0x2a01b1[_0xc72f('0x2c')][_0xc72f('0x31')]));_0x189a41[_0xc72f('0x30')]=_0x189a41[_0xc72f('0x30')][_0xc72f('0x32')]?_0x189a41[_0xc72f('0x30')]:_0x4b608e[_0xc72f('0x2b')];if(!_0x2a01b1[_0xc72f('0x2c')][_0xc72f('0x33')](_0xc72f('0x34'))){_0x189a41[_0xc72f('0x1a')]=qs[_0xc72f('0x1a')](_0x2a01b1[_0xc72f('0x2c')][_0xc72f('0x1a')]);_0x189a41['offset']=qs[_0xc72f('0x18')](_0x2a01b1[_0xc72f('0x2c')]['offset']);}_0x189a41[_0xc72f('0x35')]=qs['sort'](_0x2a01b1[_0xc72f('0x2c')][_0xc72f('0x36')]);_0x189a41['where']=qs['filters'](_[_0xc72f('0x37')](_0x2a01b1['query'],_0x4b608e['filters']),_0x4354e7);if(_0x2a01b1['query'][_0xc72f('0x38')]){_0x189a41[_0xc72f('0x39')]=_[_0xc72f('0x3a')](_0x189a41['where'],{'$or':_['map'](_0x4354e7,function(_0x42182c){if(_0x42182c['type']!==_0xc72f('0x3b')){var _0x3d714e={};_0x3d714e[_0x42182c[_0xc72f('0x26')]]={'$like':'%'+_0x2a01b1[_0xc72f('0x2c')][_0xc72f('0x38')]+'%'};return _0x3d714e;}})});}_0x189a41=_[_0xc72f('0x3a')]({},_0x189a41,_0x2a01b1[_0xc72f('0x3c')]);var _0x499721={'where':_0x189a41['where']};return db[_0xc72f('0x3d')][_0xc72f('0x1b')](_0x499721)[_0xc72f('0x21')](function(_0x3ce934){_0x44f79c[_0xc72f('0x1b')]=_0x3ce934;if(_0x2a01b1[_0xc72f('0x2c')][_0xc72f('0x3e')]){_0x189a41[_0xc72f('0x3f')]=[{'all':!![]}];}return db[_0xc72f('0x3d')][_0xc72f('0x40')](_0x189a41);})[_0xc72f('0x21')](function(_0x5e9af2){_0x44f79c[_0xc72f('0x41')]=_0x5e9af2;return _0x44f79c;})[_0xc72f('0x21')](respondWithFilteredResult(_0x2b4370,_0x189a41))[_0xc72f('0x42')](handleError(_0x2b4370,null));};exports[_0xc72f('0x43')]=function(_0x4ec04a,_0x4c2685){var _0x195781={'raw':![],'where':{'id':_0x4ec04a[_0xc72f('0x44')]['id']}},_0xf3dcda={};_0xf3dcda['model']=_[_0xc72f('0x2d')](db['Trigger'][_0xc72f('0x28')]);_0xf3dcda[_0xc72f('0x2c')]=_[_0xc72f('0x2d')](_0x4ec04a[_0xc72f('0x2c')]);_0xf3dcda[_0xc72f('0x2e')]=_[_0xc72f('0x2f')](_0xf3dcda[_0xc72f('0x2b')],_0xf3dcda[_0xc72f('0x2c')]);_0x195781[_0xc72f('0x30')]=_[_0xc72f('0x2f')](_0xf3dcda['model'],qs[_0xc72f('0x31')](_0x4ec04a['query']['fields']));_0x195781[_0xc72f('0x30')]=_0x195781['attributes'][_0xc72f('0x32')]?_0x195781['attributes']:_0xf3dcda[_0xc72f('0x2b')];if(_0x4ec04a['query'][_0xc72f('0x3e')]){_0x195781[_0xc72f('0x3f')]=[{'all':!![]}];}_0x195781=_['merge']({},_0x195781,_0x4ec04a[_0xc72f('0x3c')]);return db[_0xc72f('0x3d')][_0xc72f('0x45')](_0x195781)[_0xc72f('0x21')](handleEntityNotFound(_0x4c2685,null))[_0xc72f('0x21')](respondWithResult(_0x4c2685,null))[_0xc72f('0x42')](handleError(_0x4c2685,null));};exports['create']=function(_0x76ab8,_0x233b87){return db['Trigger'][_0xc72f('0x46')](_0x76ab8[_0xc72f('0x47')],{})['then'](function(_0x1713c8){var _0x15f97e=_0x76ab8[_0xc72f('0x48')]['get']({'plain':!![]});if(!_0x15f97e)throw new Error(_0xc72f('0x49'));if(_0x15f97e['role']===_0xc72f('0x48')){var _0x32f53a=_0x1713c8[_0xc72f('0x22')]({'plain':!![]});var _0x74a7f0=_0xc72f('0x4a');return db['UserProfileSection'][_0xc72f('0x45')]({'where':{'name':_0x74a7f0,'userProfileId':_0x15f97e[_0xc72f('0x4b')]},'raw':!![]})[_0xc72f('0x21')](function(_0x3b4374){if(_0x3b4374&&_0x3b4374[_0xc72f('0x4c')]===0x0){return db['UserProfileResource'][_0xc72f('0x46')]({'name':_0x32f53a[_0xc72f('0x26')],'resourceId':_0x32f53a['id'],'type':_0x3b4374[_0xc72f('0x26')],'sectionId':_0x3b4374['id']},{})[_0xc72f('0x21')](function(){return _0x1713c8;});}else{return _0x1713c8;}})['catch'](function(_0x117652){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x117652);throw _0x117652;});}return _0x1713c8;})[_0xc72f('0x21')](respondWithResult(_0x233b87,0xc9))[_0xc72f('0x42')](handleError(_0x233b87,null));};exports['update']=function(_0x278220,_0x3a561e){if(_0x278220[_0xc72f('0x47')]['id']){delete _0x278220[_0xc72f('0x47')]['id'];}return db['Trigger'][_0xc72f('0x45')]({'where':{'id':_0x278220[_0xc72f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a561e,null))[_0xc72f('0x21')](saveUpdates(_0x278220[_0xc72f('0x47')],null))[_0xc72f('0x21')](respondWithResult(_0x3a561e,null))[_0xc72f('0x42')](handleError(_0x3a561e,null));};exports[_0xc72f('0x4d')]=function(_0xd2f522,_0x50bd3a){return db[_0xc72f('0x3d')][_0xc72f('0x45')]({'where':{'id':_0xd2f522[_0xc72f('0x44')]['id']}})[_0xc72f('0x21')](handleEntityNotFound(_0x50bd3a,null))[_0xc72f('0x21')](removeEntity(_0x50bd3a,null))[_0xc72f('0x42')](handleError(_0x50bd3a,null));};exports[_0xc72f('0x4e')]=function(_0x432779,_0x59d25a,_0x137cd9){if(_0x432779['body']['id']){delete _0x432779[_0xc72f('0x47')]['id'];}return db[_0xc72f('0x3d')]['find']({'where':{'id':_0x432779[_0xc72f('0x44')]['id']}})['then'](handleEntityNotFound(_0x59d25a,null))[_0xc72f('0x21')](function(_0xd563a5){if(_0xd563a5){_0x432779[_0xc72f('0x47')]['TriggerAllId']=_0xd563a5['id'];return db[_0xc72f('0x4f')][_0xc72f('0x46')](_0x432779[_0xc72f('0x47')]);}})['then'](respondWithResult(_0x59d25a,null))[_0xc72f('0x42')](handleError(_0x59d25a,null));};exports[_0xc72f('0x50')]=function(_0x3c81a2,_0x8a97e8,_0x194493){if(_0x3c81a2[_0xc72f('0x47')]['id']){delete _0x3c81a2[_0xc72f('0x47')]['id'];}return db[_0xc72f('0x3d')][_0xc72f('0x45')]({'where':{'id':_0x3c81a2[_0xc72f('0x44')]['id']}})[_0xc72f('0x21')](handleEntityNotFound(_0x8a97e8,null))[_0xc72f('0x21')](function(_0x544ba3){if(_0x544ba3){_0x3c81a2['body'][_0xc72f('0x51')]=_0x544ba3['id'];return db['Condition'][_0xc72f('0x46')](_0x3c81a2['body']);}})[_0xc72f('0x21')](respondWithResult(_0x8a97e8,null))['catch'](handleError(_0x8a97e8,null));};exports[_0xc72f('0x52')]=function(_0x51a473,_0x46c9fb,_0x42284d){var _0xd20db6={};var _0x34bf3e={};var _0x5a29c9;var _0x2ca7f1;return db[_0xc72f('0x3d')][_0xc72f('0x53')]({'where':{'id':_0x51a473[_0xc72f('0x44')]['id']}})[_0xc72f('0x21')](handleEntityNotFound(_0x46c9fb,null))[_0xc72f('0x21')](function(_0xa347c7){if(_0xa347c7){_0x5a29c9=_0xa347c7;_0x34bf3e['model']=_['keys'](db[_0xc72f('0x4f')][_0xc72f('0x28')]);_0x34bf3e[_0xc72f('0x2c')]=_[_0xc72f('0x2d')](_0x51a473['query']);_0x34bf3e[_0xc72f('0x2e')]=_['intersection'](_0x34bf3e['model'],_0x34bf3e[_0xc72f('0x2c')]);_0xd20db6[_0xc72f('0x30')]=_['intersection'](_0x34bf3e[_0xc72f('0x2b')],qs[_0xc72f('0x31')](_0x51a473[_0xc72f('0x2c')][_0xc72f('0x31')]));_0xd20db6[_0xc72f('0x30')]=_0xd20db6[_0xc72f('0x30')][_0xc72f('0x32')]?_0xd20db6[_0xc72f('0x30')]:_0x34bf3e[_0xc72f('0x2b')];_0xd20db6[_0xc72f('0x35')]=qs[_0xc72f('0x36')](_0x51a473[_0xc72f('0x2c')]['sort']);_0xd20db6[_0xc72f('0x39')]=qs['filters'](_[_0xc72f('0x37')](_0x51a473[_0xc72f('0x2c')],_0x34bf3e[_0xc72f('0x2e')]));if(_0x51a473[_0xc72f('0x2c')][_0xc72f('0x38')]){_0xd20db6[_0xc72f('0x39')]=_[_0xc72f('0x3a')](_0xd20db6[_0xc72f('0x39')],{'$or':_[_0xc72f('0x27')](_0xd20db6[_0xc72f('0x30')],function(_0x129790){var _0x14bfa0={};_0x14bfa0[_0x129790]={'$like':'%'+_0x51a473[_0xc72f('0x2c')][_0xc72f('0x38')]+'%'};return _0x14bfa0;})});}_0xd20db6=_[_0xc72f('0x3a')]({},_0xd20db6,_0x51a473[_0xc72f('0x3c')]);return _0x5a29c9[_0xc72f('0x52')](_0xd20db6);}})[_0xc72f('0x21')](function(_0xc4ef1d){if(_0xc4ef1d){_0x2ca7f1=_0xc4ef1d[_0xc72f('0x32')];if(!_0x51a473[_0xc72f('0x2c')][_0xc72f('0x33')](_0xc72f('0x34'))){_0xd20db6['limit']=qs[_0xc72f('0x1a')](_0x51a473[_0xc72f('0x2c')][_0xc72f('0x1a')]);_0xd20db6[_0xc72f('0x18')]=qs[_0xc72f('0x18')](_0x51a473[_0xc72f('0x2c')][_0xc72f('0x18')]);}return _0x5a29c9['getAllConditions'](_0xd20db6);}})[_0xc72f('0x21')](function(_0x3794f4){if(_0x3794f4){return _0x3794f4?{'count':_0x2ca7f1,'rows':_0x3794f4}:null;}})[_0xc72f('0x21')](respondWithResult(_0x46c9fb,null))['catch'](handleError(_0x46c9fb,null));};exports[_0xc72f('0x54')]=function(_0x280ad0,_0x40f689,_0x4b0fce){var _0x4c9e04={};var _0x21d544={};var _0xe68bf3;var _0xbbfdf6;return db['Trigger'][_0xc72f('0x53')]({'where':{'id':_0x280ad0[_0xc72f('0x44')]['id']}})[_0xc72f('0x21')](handleEntityNotFound(_0x40f689,null))[_0xc72f('0x21')](function(_0x2427a3){if(_0x2427a3){_0xe68bf3=_0x2427a3;_0x21d544['model']=_['keys'](db[_0xc72f('0x4f')]['rawAttributes']);_0x21d544[_0xc72f('0x2c')]=_[_0xc72f('0x2d')](_0x280ad0['query']);_0x21d544[_0xc72f('0x2e')]=_[_0xc72f('0x2f')](_0x21d544[_0xc72f('0x2b')],_0x21d544[_0xc72f('0x2c')]);_0x4c9e04[_0xc72f('0x30')]=_['intersection'](_0x21d544['model'],qs[_0xc72f('0x31')](_0x280ad0['query'][_0xc72f('0x31')]));_0x4c9e04[_0xc72f('0x30')]=_0x4c9e04[_0xc72f('0x30')]['length']?_0x4c9e04['attributes']:_0x21d544['model'];_0x4c9e04['order']=qs[_0xc72f('0x36')](_0x280ad0['query'][_0xc72f('0x36')]);_0x4c9e04[_0xc72f('0x39')]=qs[_0xc72f('0x2e')](_[_0xc72f('0x37')](_0x280ad0[_0xc72f('0x2c')],_0x21d544[_0xc72f('0x2e')]));if(_0x280ad0[_0xc72f('0x2c')][_0xc72f('0x38')]){_0x4c9e04['where']=_['merge'](_0x4c9e04[_0xc72f('0x39')],{'$or':_[_0xc72f('0x27')](_0x4c9e04[_0xc72f('0x30')],function(_0x31fe93){var _0x42f68e={};_0x42f68e[_0x31fe93]={'$like':'%'+_0x280ad0[_0xc72f('0x2c')][_0xc72f('0x38')]+'%'};return _0x42f68e;})});}_0x4c9e04=_[_0xc72f('0x3a')]({},_0x4c9e04,_0x280ad0[_0xc72f('0x3c')]);return _0xe68bf3[_0xc72f('0x54')](_0x4c9e04);}})[_0xc72f('0x21')](function(_0x511bd1){if(_0x511bd1){_0xbbfdf6=_0x511bd1[_0xc72f('0x32')];if(!_0x280ad0['query']['hasOwnProperty']('nolimit')){_0x4c9e04[_0xc72f('0x1a')]=qs['limit'](_0x280ad0[_0xc72f('0x2c')]['limit']);_0x4c9e04[_0xc72f('0x18')]=qs[_0xc72f('0x18')](_0x280ad0['query'][_0xc72f('0x18')]);}return _0xe68bf3['getAnyConditions'](_0x4c9e04);}})[_0xc72f('0x21')](function(_0x5188dd){if(_0x5188dd){return _0x5188dd?{'count':_0xbbfdf6,'rows':_0x5188dd}:null;}})[_0xc72f('0x21')](respondWithResult(_0x40f689,null))['catch'](handleError(_0x40f689,null));};exports[_0xc72f('0x55')]=function(_0x46f71e,_0x36d839,_0x1459a1){if(_0x46f71e[_0xc72f('0x47')]['id']){delete _0x46f71e[_0xc72f('0x47')]['id'];}return db[_0xc72f('0x3d')]['find']({'where':{'id':_0x46f71e[_0xc72f('0x44')]['id']}})[_0xc72f('0x21')](handleEntityNotFound(_0x36d839,null))[_0xc72f('0x21')](function(_0x121b07){if(_0x121b07){_0x46f71e['body'][_0xc72f('0x56')]=_0x121b07['id'];return db[_0xc72f('0x57')][_0xc72f('0x46')](_0x46f71e[_0xc72f('0x47')]);}})[_0xc72f('0x21')](respondWithResult(_0x36d839,null))['catch'](handleError(_0x36d839,null));};exports[_0xc72f('0x58')]=function(_0x37bdce,_0x192731,_0x2c257e){var _0x84a528={};var _0x20a1d8={};var _0x429fb6;var _0x539cce;return db['Trigger'][_0xc72f('0x53')]({'where':{'id':_0x37bdce['params']['id']}})[_0xc72f('0x21')](handleEntityNotFound(_0x192731,null))['then'](function(_0x327171){if(_0x327171){_0x429fb6=_0x327171;_0x20a1d8[_0xc72f('0x2b')]=_[_0xc72f('0x2d')](db[_0xc72f('0x57')]['rawAttributes']);_0x20a1d8['query']=_[_0xc72f('0x2d')](_0x37bdce[_0xc72f('0x2c')]);_0x20a1d8[_0xc72f('0x2e')]=_[_0xc72f('0x2f')](_0x20a1d8[_0xc72f('0x2b')],_0x20a1d8['query']);_0x84a528[_0xc72f('0x30')]=_['intersection'](_0x20a1d8[_0xc72f('0x2b')],qs[_0xc72f('0x31')](_0x37bdce['query'][_0xc72f('0x31')]));_0x84a528[_0xc72f('0x30')]=_0x84a528[_0xc72f('0x30')][_0xc72f('0x32')]?_0x84a528['attributes']:_0x20a1d8[_0xc72f('0x2b')];_0x84a528[_0xc72f('0x35')]=qs[_0xc72f('0x36')](_0x37bdce['query'][_0xc72f('0x36')]);_0x84a528[_0xc72f('0x39')]=qs[_0xc72f('0x2e')](_['pick'](_0x37bdce[_0xc72f('0x2c')],_0x20a1d8[_0xc72f('0x2e')]));if(_0x37bdce[_0xc72f('0x2c')][_0xc72f('0x38')]){_0x84a528[_0xc72f('0x39')]=_[_0xc72f('0x3a')](_0x84a528[_0xc72f('0x39')],{'$or':_[_0xc72f('0x27')](_0x84a528['attributes'],function(_0x1485a7){var _0xcc5bfc={};_0xcc5bfc[_0x1485a7]={'$like':'%'+_0x37bdce[_0xc72f('0x2c')][_0xc72f('0x38')]+'%'};return _0xcc5bfc;})});}_0x84a528=_[_0xc72f('0x3a')]({},_0x84a528,_0x37bdce[_0xc72f('0x3c')]);return _0x429fb6[_0xc72f('0x58')](_0x84a528);}})[_0xc72f('0x21')](function(_0xe82caf){if(_0xe82caf){_0x539cce=_0xe82caf[_0xc72f('0x32')];if(!_0x37bdce[_0xc72f('0x2c')][_0xc72f('0x33')](_0xc72f('0x34'))){_0x84a528[_0xc72f('0x1a')]=qs[_0xc72f('0x1a')](_0x37bdce[_0xc72f('0x2c')][_0xc72f('0x1a')]);_0x84a528['offset']=qs[_0xc72f('0x18')](_0x37bdce['query']['offset']);}return _0x429fb6[_0xc72f('0x58')](_0x84a528);}})[_0xc72f('0x21')](function(_0x1ae635){if(_0x1ae635){return _0x1ae635?{'count':_0x539cce,'rows':_0x1ae635}:null;}})[_0xc72f('0x21')](respondWithResult(_0x192731,null))['catch'](handleError(_0x192731,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 6644acd..a10a2fc 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 _0xb18e=['request-promise','path','../../config/environment','./trigger.attributes','exports','define','tools_triggers','../../config/logger','moment'];(function(_0x548ae0,_0x1a3722){var _0x582fad=function(_0x495eae){while(--_0x495eae){_0x548ae0['push'](_0x548ae0['shift']());}};_0x582fad(++_0x1a3722);}(_0xb18e,0x181));var _0xeb18=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0xb18e[_0x56b138];return _0x3df878;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb18('0x0'))('api');var moment=require(_0xeb18('0x1'));var BPromise=require('bluebird');var rp=require(_0xeb18('0x2'));var fs=require('fs');var path=require(_0xeb18('0x3'));var rimraf=require('rimraf');var config=require(_0xeb18('0x4'));var attributes=require(_0xeb18('0x5'));module[_0xeb18('0x6')]=function(_0x409efb,_0x46d281){return _0x409efb[_0xeb18('0x7')]('Trigger',attributes,{'tableName':_0xeb18('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe700=['define','Trigger','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x32c15d,_0x1af73c){var _0x58be6f=function(_0x44ae2c){while(--_0x44ae2c){_0x32c15d['push'](_0x32c15d['shift']());}};_0x58be6f(++_0x1af73c);}(_0xe700,0x16a));var _0x0e70=function(_0x28c857,_0xec6d8a){_0x28c857=_0x28c857-0x0;var _0x164bcb=_0xe700[_0x28c857];return _0x164bcb;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var logger=require(_0x0e70('0x2'))(_0x0e70('0x3'));var moment=require(_0x0e70('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e70('0x6'));var config=require(_0x0e70('0x7'));var attributes=require('./trigger.attributes');module['exports']=function(_0xf3ba11,_0xc96045){return _0xf3ba11[_0x0e70('0x8')](_0x0e70('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 6c78e84..416872a 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 _0x709a=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','Trigger','find','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x709a,0x83));var _0xa709=function(_0x231a5c,_0x2e0ef0){_0x231a5c=_0x231a5c-0x0;var _0xa476c6=_0x709a[_0x231a5c];return _0xa476c6;};'use strict';var _=require(_0xa709('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa709('0x1'));var rs=require(_0xa709('0x2'));var fs=require('fs');var Redis=require(_0xa709('0x3'));var db=require(_0xa709('0x4'))['db'];var utils=require(_0xa709('0x5'));var logger=require(_0xa709('0x6'))(_0xa709('0x7'));var config=require(_0xa709('0x8'));var jayson=require(_0xa709('0x9'));var client=jayson[_0xa709('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cd5c9,_0x3f7526,_0xb2eccc){return new BPromise(function(_0x6e35b0,_0x38dea3){return client[_0xa709('0xb')](_0x5cd5c9,_0xb2eccc)['then'](function(_0xce705e){logger[_0xa709('0xc')]('Trigger,\x20%s,\x20%s',_0x3f7526,_0xa709('0xd'));logger[_0xa709('0xe')](_0xa709('0xf'),_0x3f7526,_0xa709('0xd'),JSON[_0xa709('0x10')](_0xce705e));if(_0xce705e[_0xa709('0x11')]){if(_0xce705e[_0xa709('0x11')][_0xa709('0x12')]===0x1f4){logger[_0xa709('0x11')](_0xa709('0x13'),_0x3f7526,_0xce705e[_0xa709('0x11')]['message']);return _0x38dea3(_0xce705e[_0xa709('0x11')][_0xa709('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x3f7526,_0xce705e['error'][_0xa709('0x14')]);return _0x6e35b0(_0xce705e['error'][_0xa709('0x14')]);}else{logger[_0xa709('0xc')]('Trigger,\x20%s,\x20%s',_0x3f7526,_0xa709('0xd'));_0x6e35b0(_0xce705e['result']['message']);}})[_0xa709('0x15')](function(_0x2b7cd3){logger[_0xa709('0x11')](_0xa709('0x13'),_0x3f7526,_0x2b7cd3);_0x38dea3(_0x2b7cd3);});});}exports['GetTrigger']=function(_0xfa50a7){var _0x21df1d=this;return new Promise(function(_0x12c8cc,_0x276111){return db['Trigger'][_0xa709('0x16')]({'raw':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7['options'][_0xa709('0x18')]===undefined?!![]:![]:!![],'where':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7[_0xa709('0x17')][_0xa709('0x19')]||null:null,'attributes':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7[_0xa709('0x17')][_0xa709('0x1a')]||null:null,'limit':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7['options'][_0xa709('0x1b')]||null:null,'include':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7[_0xa709('0x17')][_0xa709('0x1c')]?_[_0xa709('0x1d')](_0xfa50a7['options'][_0xa709('0x1c')],function(_0x50902e){return{'model':db[_0x50902e[_0xa709('0x1e')]],'as':_0x50902e['as'],'attributes':_0x50902e[_0xa709('0x1a')],'include':_0x50902e[_0xa709('0x1c')]?_['map'](_0x50902e[_0xa709('0x1c')],function(_0x527a45){return{'model':db[_0x527a45[_0xa709('0x1e')]],'as':_0x527a45['as'],'attributes':_0x527a45[_0xa709('0x1a')],'include':_0x527a45[_0xa709('0x1c')]?_[_0xa709('0x1d')](_0x527a45['include'],function(_0xe6067f){return{'model':db[_0xe6067f['model']],'as':_0xe6067f['as'],'attributes':_0xe6067f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33ed97){logger[_0xa709('0xc')](_0xa709('0x1f'),_0xfa50a7);logger[_0xa709('0xe')]('GetTrigger',_0xfa50a7,JSON[_0xa709('0x10')](_0x33ed97));_0x12c8cc(_0x33ed97);})[_0xa709('0x15')](function(_0x4b0519){logger[_0xa709('0x11')](_0xa709('0x1f'),_0x4b0519[_0xa709('0x14')],_0xfa50a7);_0x276111(_0x21df1d[_0xa709('0x11')](0x1f4,_0x4b0519[_0xa709('0x14')]));});});};exports[_0xa709('0x20')]=function(_0x558eb8){var _0x469088=this;return new Promise(function(_0x2d4fc6,_0x28e7f1){return db[_0xa709('0x21')][_0xa709('0x22')]({'raw':_0x558eb8[_0xa709('0x17')]?_0x558eb8[_0xa709('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x558eb8[_0xa709('0x17')]?_0x558eb8[_0xa709('0x17')][_0xa709('0x19')]||null:null,'attributes':_0x558eb8[_0xa709('0x17')]?_0x558eb8[_0xa709('0x17')]['attributes']||null:null,'include':_0x558eb8['options']?_0x558eb8['options'][_0xa709('0x1c')]?_[_0xa709('0x1d')](_0x558eb8['options']['include'],function(_0x27210a){return{'model':db[_0x27210a[_0xa709('0x1e')]],'as':_0x27210a['as'],'attributes':_0x27210a[_0xa709('0x1a')],'include':_0x27210a[_0xa709('0x1c')]?_[_0xa709('0x1d')](_0x27210a[_0xa709('0x1c')],function(_0xf9c75b){return{'model':db[_0xf9c75b['model']],'as':_0xf9c75b['as'],'attributes':_0xf9c75b[_0xa709('0x1a')],'include':_0xf9c75b[_0xa709('0x1c')]?_[_0xa709('0x1d')](_0xf9c75b[_0xa709('0x1c')],function(_0x157bf8){return{'model':db[_0x157bf8['model']],'as':_0x157bf8['as'],'attributes':_0x157bf8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa709('0x23')](function(_0x4c3d5c){logger['info']('ShowTrigger',_0x558eb8);logger[_0xa709('0xe')](_0xa709('0x20'),_0x558eb8,JSON['stringify'](_0x4c3d5c));_0x2d4fc6(_0x4c3d5c);})['catch'](function(_0x316f55){logger[_0xa709('0x11')](_0xa709('0x20'),_0x316f55[_0xa709('0x14')],_0x558eb8);_0x28e7f1(_0x469088[_0xa709('0x11')](0x1f4,_0x316f55[_0xa709('0x14')]));});});}; \ No newline at end of file +var _0xe277=['client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','options','raw','attributes','limit','include','map','model','debug','ShowTrigger','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x20c8e9,_0x539373){var _0x4ad406=function(_0x2639b6){while(--_0x2639b6){_0x20c8e9['push'](_0x20c8e9['shift']());}};_0x4ad406(++_0x539373);}(_0xe277,0x15e));var _0x7e27=function(_0x70124d,_0x45cdff){_0x70124d=_0x70124d-0x0;var _0x3638ff=_0xe277[_0x70124d];return _0x3638ff;};'use strict';var _=require(_0x7e27('0x0'));var util=require(_0x7e27('0x1'));var moment=require('moment');var BPromise=require(_0x7e27('0x2'));var rs=require(_0x7e27('0x3'));var fs=require('fs');var Redis=require(_0x7e27('0x4'));var db=require(_0x7e27('0x5'))['db'];var utils=require(_0x7e27('0x6'));var logger=require('../../config/logger')(_0x7e27('0x7'));var config=require(_0x7e27('0x8'));var jayson=require(_0x7e27('0x9'));var client=jayson[_0x7e27('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x109e6d,_0x226d4f,_0x118112){return new BPromise(function(_0x47d7b2,_0x44d253){return client[_0x7e27('0xb')](_0x109e6d,_0x118112)[_0x7e27('0xc')](function(_0x410095){logger[_0x7e27('0xd')](_0x7e27('0xe'),_0x226d4f,_0x7e27('0xf'));logger['debug'](_0x7e27('0x10'),_0x226d4f,_0x7e27('0xf'),JSON[_0x7e27('0x11')](_0x410095));if(_0x410095[_0x7e27('0x12')]){if(_0x410095['error'][_0x7e27('0x13')]===0x1f4){logger[_0x7e27('0x12')]('Trigger,\x20%s,\x20%s',_0x226d4f,_0x410095[_0x7e27('0x12')][_0x7e27('0x14')]);return _0x44d253(_0x410095[_0x7e27('0x12')][_0x7e27('0x14')]);}logger[_0x7e27('0x12')]('Trigger,\x20%s,\x20%s',_0x226d4f,_0x410095[_0x7e27('0x12')][_0x7e27('0x14')]);return _0x47d7b2(_0x410095[_0x7e27('0x12')][_0x7e27('0x14')]);}else{logger[_0x7e27('0xd')](_0x7e27('0xe'),_0x226d4f,_0x7e27('0xf'));_0x47d7b2(_0x410095[_0x7e27('0x15')]['message']);}})[_0x7e27('0x16')](function(_0x3d9aa9){logger[_0x7e27('0x12')](_0x7e27('0xe'),_0x226d4f,_0x3d9aa9);_0x44d253(_0x3d9aa9);});});}exports[_0x7e27('0x17')]=function(_0x2d8af1){var _0x269ad3=this;return new Promise(function(_0x589732,_0x1c6d17){return db[_0x7e27('0x18')]['findAll']({'raw':_0x2d8af1[_0x7e27('0x19')]?_0x2d8af1[_0x7e27('0x19')][_0x7e27('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d8af1['options']?_0x2d8af1[_0x7e27('0x19')]['where']||null:null,'attributes':_0x2d8af1[_0x7e27('0x19')]?_0x2d8af1[_0x7e27('0x19')][_0x7e27('0x1b')]||null:null,'limit':_0x2d8af1[_0x7e27('0x19')]?_0x2d8af1[_0x7e27('0x19')][_0x7e27('0x1c')]||null:null,'include':_0x2d8af1[_0x7e27('0x19')]?_0x2d8af1[_0x7e27('0x19')][_0x7e27('0x1d')]?_[_0x7e27('0x1e')](_0x2d8af1['options'][_0x7e27('0x1d')],function(_0x10f2f5){return{'model':db[_0x10f2f5['model']],'as':_0x10f2f5['as'],'attributes':_0x10f2f5[_0x7e27('0x1b')],'include':_0x10f2f5[_0x7e27('0x1d')]?_[_0x7e27('0x1e')](_0x10f2f5[_0x7e27('0x1d')],function(_0x4b85f2){return{'model':db[_0x4b85f2['model']],'as':_0x4b85f2['as'],'attributes':_0x4b85f2[_0x7e27('0x1b')],'include':_0x4b85f2[_0x7e27('0x1d')]?_[_0x7e27('0x1e')](_0x4b85f2[_0x7e27('0x1d')],function(_0x53dfe8){return{'model':db[_0x53dfe8[_0x7e27('0x1f')]],'as':_0x53dfe8['as'],'attributes':_0x53dfe8[_0x7e27('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7e27('0xc')](function(_0x4211bf){logger[_0x7e27('0xd')](_0x7e27('0x17'),_0x2d8af1);logger[_0x7e27('0x20')](_0x7e27('0x17'),_0x2d8af1,JSON[_0x7e27('0x11')](_0x4211bf));_0x589732(_0x4211bf);})['catch'](function(_0x312854){logger['error'](_0x7e27('0x17'),_0x312854[_0x7e27('0x14')],_0x2d8af1);_0x1c6d17(_0x269ad3['error'](0x1f4,_0x312854[_0x7e27('0x14')]));});});};exports[_0x7e27('0x21')]=function(_0x4f6cfd){var _0x520162=this;return new Promise(function(_0x51d49f,_0x5c0871){return db[_0x7e27('0x18')][_0x7e27('0x22')]({'raw':_0x4f6cfd[_0x7e27('0x19')]?_0x4f6cfd[_0x7e27('0x19')][_0x7e27('0x1a')]===undefined?!![]:![]:!![],'where':_0x4f6cfd[_0x7e27('0x19')]?_0x4f6cfd[_0x7e27('0x19')][_0x7e27('0x23')]||null:null,'attributes':_0x4f6cfd[_0x7e27('0x19')]?_0x4f6cfd[_0x7e27('0x19')][_0x7e27('0x1b')]||null:null,'include':_0x4f6cfd[_0x7e27('0x19')]?_0x4f6cfd['options']['include']?_[_0x7e27('0x1e')](_0x4f6cfd['options'][_0x7e27('0x1d')],function(_0x153016){return{'model':db[_0x153016[_0x7e27('0x1f')]],'as':_0x153016['as'],'attributes':_0x153016[_0x7e27('0x1b')],'include':_0x153016[_0x7e27('0x1d')]?_[_0x7e27('0x1e')](_0x153016[_0x7e27('0x1d')],function(_0x44f3de){return{'model':db[_0x44f3de[_0x7e27('0x1f')]],'as':_0x44f3de['as'],'attributes':_0x44f3de[_0x7e27('0x1b')],'include':_0x44f3de[_0x7e27('0x1d')]?_[_0x7e27('0x1e')](_0x44f3de[_0x7e27('0x1d')],function(_0x23478a){return{'model':db[_0x23478a['model']],'as':_0x23478a['as'],'attributes':_0x23478a[_0x7e27('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xddd527){logger[_0x7e27('0xd')](_0x7e27('0x21'),_0x4f6cfd);logger[_0x7e27('0x20')](_0x7e27('0x21'),_0x4f6cfd,JSON['stringify'](_0xddd527));_0x51d49f(_0xddd527);})[_0x7e27('0x16')](function(_0x4e3aca){logger['error'](_0x7e27('0x21'),_0x4e3aca[_0x7e27('0x14')],_0x4f6cfd);_0x5c0871(_0x520162[_0x7e27('0x12')](0x1f4,_0x4e3aca[_0x7e27('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 4388ec9..c13d1cb 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 _0xecd0=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','create'];(function(_0x5eaa17,_0x363a94){var _0x54fd9a=function(_0x34f9a2){while(--_0x34f9a2){_0x5eaa17['push'](_0x5eaa17['shift']());}};_0x54fd9a(++_0x363a94);}(_0xecd0,0x67));var _0x0ecd=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0xecd0[_0x3f8759];return _0x2d33ca;};'use strict';var multer=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var path=require(_0x0ecd('0x2'));var timeout=require(_0x0ecd('0x3'));var express=require(_0x0ecd('0x4'));var router=express[_0x0ecd('0x5')]();var fs_extra=require(_0x0ecd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0ecd('0x7'));var config=require(_0x0ecd('0x8'));var controller=require(_0x0ecd('0x9'));router[_0x0ecd('0xa')]('/',auth[_0x0ecd('0xb')](),controller[_0x0ecd('0xc')]);router[_0x0ecd('0xa')](_0x0ecd('0xd'),auth[_0x0ecd('0xb')](),controller['show']);router[_0x0ecd('0xe')](_0x0ecd('0xf'),auth[_0x0ecd('0xb')](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller[_0x0ecd('0x10')]);router['put'](_0x0ecd('0xd'),auth[_0x0ecd('0xb')](),controller[_0x0ecd('0x11')]);router[_0x0ecd('0x12')](_0x0ecd('0xd'),auth[_0x0ecd('0xb')](),controller[_0x0ecd('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd914=['put','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','clone','create'];(function(_0x3064e2,_0x4bb1df){var _0x55e8d2=function(_0x319e48){while(--_0x319e48){_0x3064e2['push'](_0x3064e2['shift']());}};_0x55e8d2(++_0x4bb1df);}(_0xd914,0x1b6));var _0x4d91=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd914[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x4d91('0x0'));var util=require('util');var path=require(_0x4d91('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d91('0x2')]();var fs_extra=require(_0x4d91('0x3'));var auth=require(_0x4d91('0x4'));var interaction=require(_0x4d91('0x5'));var config=require(_0x4d91('0x6'));var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4d91('0x7'),auth[_0x4d91('0x8')](),controller[_0x4d91('0x9')]);router['post']('/:id/clone',auth[_0x4d91('0x8')](),controller[_0x4d91('0xa')]);router['post']('/',auth[_0x4d91('0x8')](),controller[_0x4d91('0xb')]);router[_0x4d91('0xc')](_0x4d91('0x7'),auth[_0x4d91('0x8')](),controller['update']);router['delete'](_0x4d91('0x7'),auth['isAuthenticated'](),controller[_0x4d91('0xd')]);module[_0x4d91('0xe')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index b4d0c75..756ebb2 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 _0xa36c=['never','INTEGER','always','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','user','peer','friend','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','getDataValue','info','shortinfo','inband','auto','rfc2833','update','outgoing','yes','force_rport,comedia','setDataValue','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0x41b60a,_0x35f35b){var _0x18968f=function(_0x40f721){while(--_0x40f721){_0x41b60a['push'](_0x41b60a['shift']());}};_0x18968f(++_0x35f35b);}(_0xa36c,0x74));var _0xca36=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa36c[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xca36('0x0'));module[_0xca36('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xca36('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xca36('0x3')]('friend',_0xca36('0x4'),_0xca36('0x5')),'allowNull':![],'defaultValue':_0xca36('0x6')},'context':{'type':Sequelize[_0xca36('0x7')],'allowNull':![],'defaultValue':_0xca36('0x8')},'callingpres':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x9'),_0xca36('0xa'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0xca36('0xb'),_0xca36('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0xca36('0x7')]},'permit':{'type':Sequelize[_0xca36('0x7')]},'secret':{'type':Sequelize[_0xca36('0x7')]},'md5secret':{'type':Sequelize[_0xca36('0x7')]},'remotesecret':{'type':Sequelize[_0xca36('0x7')]},'transport':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'udp','set':function(_0x573fdd){this['setDataValue'](_0xca36('0xd'),_0x573fdd?_0x573fdd['join'](','):null);},'get':function(){return this[_0xca36('0xe')](_0xca36('0xd'))?this[_0xca36('0xe')](_0xca36('0xd'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xca36('0xf'),_0xca36('0x10'),_0xca36('0x11'),_0xca36('0x12')),'defaultValue':_0xca36('0x13')},'directmedia':{'type':Sequelize[_0xca36('0x3')]('yes','no','nonat',_0xca36('0x14'),_0xca36('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xca36('0x7')],'defaultValue':_0xca36('0x17'),'set':function(_0x1301db){this[_0xca36('0x18')]('nat',_0x1301db?_0x1301db[_0xca36('0x19')](','):null);},'get':function(){return this['getDataValue'](_0xca36('0x1a'))?this[_0xca36('0xe')]('nat')['split'](','):null;},'comment':_0xca36('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xca36('0x7')]},'pickupgroup':{'type':Sequelize[_0xca36('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xca36('0x7')]},'language':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xca36('0x7')],'defaultValue':_0xca36('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xd2accb){this[_0xca36('0x18')](_0xca36('0x1d'),_0xd2accb?_0xd2accb[_0xca36('0x19')](';'):_0xca36('0x1e'));},'get':function(){return this[_0xca36('0xe')](_0xca36('0x1d'))?this[_0xca36('0xe')]('allow')[_0xca36('0x1f')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'insecure':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'port,invite','set':function(_0x2be4d0){this[_0xca36('0x18')](_0xca36('0x20'),_0x2be4d0?_0x2be4d0['join'](','):null);},'get':function(){return this['getDataValue'](_0xca36('0x20'))?this[_0xca36('0xe')](_0xca36('0x20'))['split'](','):null;},'comment':_0xca36('0x21')},'trustrpid':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no',_0xca36('0x22'))},'promiscredir':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'accountcode':{'type':Sequelize[_0xca36('0x23')](0xb)},'setvar':{'type':Sequelize[_0xca36('0x7')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xca36('0x7')]},'callcounter':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no'),'defaultValue':_0xca36('0x16')},'busylevel':{'type':Sequelize[_0xca36('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xca36('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xca36('0x7')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xca36('0x3')]('yes','no',_0xca36('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no')},'mailbox':{'type':Sequelize[_0xca36('0x7')]},'session_timers':{'type':Sequelize[_0xca36('0x3')]('accept',_0xca36('0x25'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xca36('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xca36('0x26'),_0xca36('0x27')),'defaultValue':_0xca36('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xca36('0x7')]},'regexten':{'type':Sequelize[_0xca36('0x7')]},'fromdomain':{'type':Sequelize[_0xca36('0x7')]},'fromuser':{'type':Sequelize[_0xca36('0x7')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xca36('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xca36('0x7')]},'defaultuser':{'type':Sequelize[_0xca36('0x7')]},'rtptimeout':{'type':Sequelize[_0xca36('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xca36('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no',_0xca36('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xca36('0x7')]},'callbackextension':{'type':Sequelize[_0xca36('0x7')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xca36('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xca36('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xca36('0x7')]},'contactdeny':{'type':Sequelize[_0xca36('0x7')]},'contactacl':{'type':Sequelize[_0xca36('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0xca36('0x7')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xca36('0x23')](0xb)},'encryption':{'type':Sequelize[_0xca36('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no')},'force_avp':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'icesupport':{'type':Sequelize[_0xca36('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xca36('0x3')]('yes','no',_0xca36('0x29'),_0xca36('0x2a'))},'dtlsrekey':{'type':Sequelize[_0xca36('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xca36('0x7')]},'dtlscipher':{'type':Sequelize[_0xca36('0x7')]},'dtlscafile':{'type':Sequelize[_0xca36('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x2b'),_0xca36('0x2c'),_0xca36('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xca36('0x7')]},'usereqphone':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xca36('0x7')]},'call_limit':{'type':Sequelize[_0xca36('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0xca36('0x7')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xca36('0x7')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xca36('0x2e')},'canreinvite':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no',_0xca36('0x2f'),_0xca36('0x14'),_0xca36('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xca36('0x7')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xca36('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'no'}}; \ No newline at end of file +var _0x2901=['transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','accept','refuse','uac','pai','fingerprint','certificate','active','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x2901,0x1ed));var _0x1290=function(_0x23131f,_0x19bfd4){_0x23131f=_0x23131f-0x0;var _0x3e5850=_0x2901[_0x23131f];return _0x3e5850;};'use strict';var Sequelize=require(_0x1290('0x0'));module[_0x1290('0x1')]={'name':{'type':Sequelize[_0x1290('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x4'),_0x1290('0x5'),_0x1290('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x1290('0x2')],'allowNull':![],'defaultValue':_0x1290('0x7')},'callingpres':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0x1290('0x9'),_0x1290('0xa'),'PROHIB_FAILED_SCREEN',_0x1290('0xb'))},'deny':{'type':Sequelize[_0x1290('0x2')]},'permit':{'type':Sequelize[_0x1290('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x1290('0x2')]},'transport':{'type':Sequelize[_0x1290('0x2')],'defaultValue':'udp','set':function(_0x4bece2){this[_0x1290('0xc')](_0x1290('0xd'),_0x4bece2?_0x4bece2[_0x1290('0xe')](','):null);},'get':function(){return this[_0x1290('0xf')](_0x1290('0xd'))?this['getDataValue'](_0x1290('0xd'))[_0x1290('0x10')](','):null;},'comment':_0x1290('0x11')},'dtmfmode':{'type':Sequelize[_0x1290('0x3')]('rfc2833',_0x1290('0x12'),_0x1290('0x13'),_0x1290('0x14'),'auto'),'defaultValue':_0x1290('0x15')},'directmedia':{'type':Sequelize[_0x1290('0x3')]('yes','no',_0x1290('0x16'),_0x1290('0x17'),_0x1290('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1290('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1290('0x2')]},'directmediadeny':{'type':Sequelize[_0x1290('0x2')]},'nat':{'type':Sequelize[_0x1290('0x2')],'defaultValue':_0x1290('0x19'),'set':function(_0x3236c3){this[_0x1290('0xc')](_0x1290('0x1a'),_0x3236c3?_0x3236c3[_0x1290('0xe')](','):null);},'get':function(){return this[_0x1290('0xf')](_0x1290('0x1a'))?this[_0x1290('0xf')](_0x1290('0x1a'))['split'](','):null;},'comment':_0x1290('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1290('0x2')]},'pickupgroup':{'type':Sequelize[_0x1290('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x1290('0x2')]},'language':{'type':Sequelize[_0x1290('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1290('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x1290('0x1c')},'allow':{'type':Sequelize[_0x1290('0x2')],'allowNull':![],'defaultValue':_0x1290('0x1d'),'set':function(_0x3c2422){this[_0x1290('0xc')](_0x1290('0x1e'),_0x3c2422?_0x3c2422[_0x1290('0xe')](';'):_0x1290('0x1d'));},'get':function(){return this[_0x1290('0xf')](_0x1290('0x1e'))?this[_0x1290('0xf')](_0x1290('0x1e'))[_0x1290('0x10')](';'):null;},'comment':_0x1290('0x1f')},'autoframing':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no')},'insecure':{'type':Sequelize[_0x1290('0x2')],'defaultValue':'port,invite','set':function(_0x48d89d){this[_0x1290('0xc')](_0x1290('0x21'),_0x48d89d?_0x48d89d['join'](','):null);},'get':function(){return this[_0x1290('0xf')]('insecure')?this['getDataValue'](_0x1290('0x21'))[_0x1290('0x10')](','):null;},'comment':_0x1290('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x1290('0x20'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x1290('0x20'),'no')},'useclientcode':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x1290('0x2')]},'callerid':{'type':Sequelize[_0x1290('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no'),'defaultValue':_0x1290('0x20')},'busylevel':{'type':Sequelize[_0x1290('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x1290('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x1290('0x20'),'no')},'allowtransfer':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no')},'ignoresdpversion':{'type':Sequelize[_0x1290('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x1290('0x20'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x1290('0x20'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x1290('0x24'),_0x1290('0x25'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x1290('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x26'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1290('0x2')]},'regexten':{'type':Sequelize[_0x1290('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x1290('0x2')]},'port':{'type':Sequelize[_0x1290('0x23')](0x5)},'qualify':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1290('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x1290('0x2')]},'defaultuser':{'type':Sequelize[_0x1290('0x2')]},'rtptimeout':{'type':Sequelize[_0x1290('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1290('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x1290('0x20'),'no',_0x1290('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1290('0x2')]},'callbackextension':{'type':Sequelize[_0x1290('0x2')]},'timert1':{'type':Sequelize[_0x1290('0x23')](0xb)},'timerb':{'type':Sequelize[_0x1290('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1290('0x23')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x1290('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x1290('0x2')]},'use_q850_reason':{'type':Sequelize[_0x1290('0x2')]},'maxforwards':{'type':Sequelize[_0x1290('0x23')](0xb)},'encryption':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1290('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no')},'icesupport':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no')},'dtlsenable':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x20'),'no')},'dtlsverify':{'type':Sequelize[_0x1290('0x3')]('yes','no',_0x1290('0x28'),_0x1290('0x29'))},'dtlsrekey':{'type':Sequelize[_0x1290('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1290('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x1290('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x1290('0x2')]},'dtlscapath':{'type':Sequelize[_0x1290('0x2')]},'dtlssetup':{'type':Sequelize[_0x1290('0x3')](_0x1290('0x2a'),'passive',_0x1290('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1290('0x2')]},'usereqphone':{'type':Sequelize[_0x1290('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1290('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x1290('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x1290('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x1290('0x20'),'no')},'vmexten':{'type':Sequelize[_0x1290('0x2')]},'mohinterpret':{'type':Sequelize[_0x1290('0x2')]},'mohsuggest':{'type':Sequelize[_0x1290('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1290('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x1290('0x2c')},'canreinvite':{'type':Sequelize[_0x1290('0x3')]('yes','no',_0x1290('0x16'),_0x1290('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x1290('0x2')]},'active':{'type':Sequelize[_0x1290('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1290('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 ee593e5..1ace0aa 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 _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(_0x4529b3,_0x390ebb){var _0x21e907=function(_0x1c19dc){while(--_0x1c19dc){_0x4529b3['push'](_0x4529b3['shift']());}};_0x21e907(++_0x390ebb);}(_0x9f62,0x154));var _0x29f6=function(_0x440be0,_0x473cce){_0x440be0=_0x440be0-0x0;var _0xf36e2d=_0x9f62[_0x440be0];return _0xf36e2d;};'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 +var _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x3e2b43,_0x2d489f){var _0x35723c=function(_0xcdcc9f){while(--_0xcdcc9f){_0x3e2b43['push'](_0x3e2b43['shift']());}};_0x35723c(++_0x2d489f);}(_0xedd9,0xfc));var _0x9edd=function(_0x3910c6,_0x1168ba){_0x3910c6=_0x3910c6-0x0;var _0x569d91=_0xedd9[_0x3910c6];return _0x569d91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index ce74032..3eb7658 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 _0xde35=['Trunk','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define'];(function(_0x393b27,_0xa99d03){var _0x549454=function(_0x1d5449){while(--_0x1d5449){_0x393b27['push'](_0x393b27['shift']());}};_0x549454(++_0xa99d03);}(_0xde35,0xfd));var _0x5de3=function(_0x572480,_0x30876e){_0x572480=_0x572480-0x0;var _0xc2b581=_0xde35[_0x572480];return _0xc2b581;};'use strict';var _=require('lodash');var util=require(_0x5de3('0x0'));var logger=require('../../config/logger')(_0x5de3('0x1'));var moment=require(_0x5de3('0x2'));var BPromise=require(_0x5de3('0x3'));var rp=require(_0x5de3('0x4'));var fs=require('fs');var path=require(_0x5de3('0x5'));var rimraf=require(_0x5de3('0x6'));var config=require(_0x5de3('0x7'));var attributes=require(_0x5de3('0x8'));module[_0x5de3('0x9')]=function(_0x1241e0,_0x1c223f){return _0x1241e0[_0x5de3('0xa')](_0x5de3('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecc6=['./trunk.attributes','exports','define','Trunk','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x28399b,_0x877ea8){var _0x21f206=function(_0x12e6bf){while(--_0x12e6bf){_0x28399b['push'](_0x28399b['shift']());}};_0x21f206(++_0x877ea8);}(_0xecc6,0x1c0));var _0x6ecc=function(_0x10394d,_0x371355){_0x10394d=_0x10394d-0x0;var _0x58b31a=_0xecc6[_0x10394d];return _0x58b31a;};'use strict';var _=require(_0x6ecc('0x0'));var util=require('util');var logger=require(_0x6ecc('0x1'))(_0x6ecc('0x2'));var moment=require(_0x6ecc('0x3'));var BPromise=require(_0x6ecc('0x4'));var rp=require(_0x6ecc('0x5'));var fs=require('fs');var path=require(_0x6ecc('0x6'));var rimraf=require(_0x6ecc('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ecc('0x8'));module[_0x6ecc('0x9')]=function(_0x5d00a5,_0x4dc140){return _0x5d00a5[_0x6ecc('0xa')](_0x6ecc('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index d3b36ff..59d0e5f 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 _0xc7ee=['options','where','attributes','include','model','map','GetTrunk','ShowTrunk','raw','lodash','moment','ioredis','../../config/environment','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','Trunk','findAll'];(function(_0x2d3882,_0x3a4f85){var _0x3b51ad=function(_0x49409f){while(--_0x49409f){_0x2d3882['push'](_0x2d3882['shift']());}};_0x3b51ad(++_0x3a4f85);}(_0xc7ee,0xd4));var _0xec7e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc7ee[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xec7e('0x0'));var util=require('util');var moment=require(_0xec7e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec7e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xec7e('0x3'));var jayson=require(_0xec7e('0x4'));var client=jayson[_0xec7e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x438438,_0x1600f8,_0x26bd6b){return new BPromise(function(_0x25b41c,_0x4875b1){return client[_0xec7e('0x6')](_0x438438,_0x26bd6b)[_0xec7e('0x7')](function(_0x476208){logger['info'](_0xec7e('0x8'),_0x1600f8,_0xec7e('0x9'));logger[_0xec7e('0xa')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1600f8,_0xec7e('0x9'),JSON[_0xec7e('0xb')](_0x476208));if(_0x476208[_0xec7e('0xc')]){if(_0x476208[_0xec7e('0xc')][_0xec7e('0xd')]===0x1f4){logger[_0xec7e('0xc')](_0xec7e('0x8'),_0x1600f8,_0x476208[_0xec7e('0xc')][_0xec7e('0xe')]);return _0x4875b1(_0x476208[_0xec7e('0xc')][_0xec7e('0xe')]);}logger[_0xec7e('0xc')](_0xec7e('0x8'),_0x1600f8,_0x476208[_0xec7e('0xc')][_0xec7e('0xe')]);return _0x25b41c(_0x476208['error'][_0xec7e('0xe')]);}else{logger[_0xec7e('0xf')]('Trunk,\x20%s,\x20%s',_0x1600f8,_0xec7e('0x9'));_0x25b41c(_0x476208[_0xec7e('0x10')]['message']);}})[_0xec7e('0x11')](function(_0x203c5d){logger['error'](_0xec7e('0x8'),_0x1600f8,_0x203c5d);_0x4875b1(_0x203c5d);});});}exports['GetTrunk']=function(_0x2ea28e){var _0x2b6d5d=this;return new Promise(function(_0xf9921e,_0x4c3b8c){return db[_0xec7e('0x12')][_0xec7e('0x13')]({'raw':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')][_0xec7e('0x15')]||null:null,'attributes':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')][_0xec7e('0x16')]||null:null,'limit':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')]['limit']||null:null,'include':_0x2ea28e['options']?_0x2ea28e[_0xec7e('0x14')][_0xec7e('0x17')]?_['map'](_0x2ea28e['options'][_0xec7e('0x17')],function(_0x152626){return{'model':db[_0x152626[_0xec7e('0x18')]],'as':_0x152626['as'],'attributes':_0x152626['attributes'],'include':_0x152626[_0xec7e('0x17')]?_['map'](_0x152626['include'],function(_0x4678f5){return{'model':db[_0x4678f5['model']],'as':_0x4678f5['as'],'attributes':_0x4678f5[_0xec7e('0x16')],'include':_0x4678f5[_0xec7e('0x17')]?_[_0xec7e('0x19')](_0x4678f5['include'],function(_0x594375){return{'model':db[_0x594375[_0xec7e('0x18')]],'as':_0x594375['as'],'attributes':_0x594375[_0xec7e('0x16')]};}):[]};}):[]};}):[]:[]})[_0xec7e('0x7')](function(_0x4fa912){logger[_0xec7e('0xf')](_0xec7e('0x1a'),_0x2ea28e);logger[_0xec7e('0xa')]('GetTrunk',_0x2ea28e,JSON[_0xec7e('0xb')](_0x4fa912));_0xf9921e(_0x4fa912);})[_0xec7e('0x11')](function(_0x35e966){logger[_0xec7e('0xc')](_0xec7e('0x1a'),_0x35e966[_0xec7e('0xe')],_0x2ea28e);_0x4c3b8c(_0x2b6d5d[_0xec7e('0xc')](0x1f4,_0x35e966[_0xec7e('0xe')]));});});};exports[_0xec7e('0x1b')]=function(_0x4382f9){var _0x1e9aa2=this;return new Promise(function(_0x44feec,_0x9a995d){return db[_0xec7e('0x12')]['find']({'raw':_0x4382f9[_0xec7e('0x14')]?_0x4382f9[_0xec7e('0x14')][_0xec7e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4382f9[_0xec7e('0x14')]?_0x4382f9['options'][_0xec7e('0x15')]||null:null,'attributes':_0x4382f9[_0xec7e('0x14')]?_0x4382f9[_0xec7e('0x14')]['attributes']||null:null,'include':_0x4382f9[_0xec7e('0x14')]?_0x4382f9[_0xec7e('0x14')][_0xec7e('0x17')]?_[_0xec7e('0x19')](_0x4382f9[_0xec7e('0x14')][_0xec7e('0x17')],function(_0x606eee){return{'model':db[_0x606eee[_0xec7e('0x18')]],'as':_0x606eee['as'],'attributes':_0x606eee[_0xec7e('0x16')],'include':_0x606eee[_0xec7e('0x17')]?_[_0xec7e('0x19')](_0x606eee['include'],function(_0x1966b0){return{'model':db[_0x1966b0[_0xec7e('0x18')]],'as':_0x1966b0['as'],'attributes':_0x1966b0[_0xec7e('0x16')],'include':_0x1966b0['include']?_[_0xec7e('0x19')](_0x1966b0[_0xec7e('0x17')],function(_0x4a9b34){return{'model':db[_0x4a9b34[_0xec7e('0x18')]],'as':_0x4a9b34['as'],'attributes':_0x4a9b34[_0xec7e('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa0745e){logger[_0xec7e('0xf')]('ShowTrunk',_0x4382f9);logger['debug']('ShowTrunk',_0x4382f9,JSON[_0xec7e('0xb')](_0xa0745e));_0x44feec(_0xa0745e);})['catch'](function(_0x152266){logger[_0xec7e('0xc')](_0xec7e('0x1b'),_0x152266[_0xec7e('0xe')],_0x4382f9);_0x9a995d(_0x1e9aa2[_0xec7e('0xc')](0x1f4,_0x152266[_0xec7e('0xe')]));});});}; \ No newline at end of file +var _0xc20f=['then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','lodash','util','moment','bluebird','rpc','../../config/environment','client','http','request'];(function(_0x9b3140,_0x44a65c){var _0x16e2dc=function(_0x3fcda0){while(--_0x3fcda0){_0x9b3140['push'](_0x9b3140['shift']());}};_0x16e2dc(++_0x44a65c);}(_0xc20f,0x141));var _0xfc20=function(_0x34a664,_0x42176a){_0x34a664=_0x34a664-0x0;var _0xc7b85=_0xc20f[_0x34a664];return _0xc7b85;};'use strict';var _=require(_0xfc20('0x0'));var util=require(_0xfc20('0x1'));var moment=require(_0xfc20('0x2'));var BPromise=require(_0xfc20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfc20('0x4'));var config=require(_0xfc20('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xfc20('0x6')][_0xfc20('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1badba,_0x5a7fba,_0x4ae722){return new BPromise(function(_0x52bee1,_0x362d20){return client[_0xfc20('0x8')](_0x1badba,_0x4ae722)[_0xfc20('0x9')](function(_0x414e7d){logger['info'](_0xfc20('0xa'),_0x5a7fba,_0xfc20('0xb'));logger[_0xfc20('0xc')](_0xfc20('0xd'),_0x5a7fba,'request\x20sent',JSON[_0xfc20('0xe')](_0x414e7d));if(_0x414e7d[_0xfc20('0xf')]){if(_0x414e7d[_0xfc20('0xf')][_0xfc20('0x10')]===0x1f4){logger[_0xfc20('0xf')](_0xfc20('0xa'),_0x5a7fba,_0x414e7d[_0xfc20('0xf')][_0xfc20('0x11')]);return _0x362d20(_0x414e7d[_0xfc20('0xf')][_0xfc20('0x11')]);}logger[_0xfc20('0xf')](_0xfc20('0xa'),_0x5a7fba,_0x414e7d[_0xfc20('0xf')][_0xfc20('0x11')]);return _0x52bee1(_0x414e7d[_0xfc20('0xf')][_0xfc20('0x11')]);}else{logger[_0xfc20('0x12')](_0xfc20('0xa'),_0x5a7fba,_0xfc20('0xb'));_0x52bee1(_0x414e7d[_0xfc20('0x13')][_0xfc20('0x11')]);}})[_0xfc20('0x14')](function(_0x92ee7c){logger['error']('Trunk,\x20%s,\x20%s',_0x5a7fba,_0x92ee7c);_0x362d20(_0x92ee7c);});});}exports[_0xfc20('0x15')]=function(_0x39b766){var _0x275a00=this;return new Promise(function(_0x3d0d24,_0x1cac62){return db[_0xfc20('0x16')][_0xfc20('0x17')]({'raw':_0x39b766[_0xfc20('0x18')]?_0x39b766[_0xfc20('0x18')][_0xfc20('0x19')]===undefined?!![]:![]:!![],'where':_0x39b766[_0xfc20('0x18')]?_0x39b766[_0xfc20('0x18')][_0xfc20('0x1a')]||null:null,'attributes':_0x39b766['options']?_0x39b766[_0xfc20('0x18')][_0xfc20('0x1b')]||null:null,'limit':_0x39b766[_0xfc20('0x18')]?_0x39b766[_0xfc20('0x18')][_0xfc20('0x1c')]||null:null,'include':_0x39b766['options']?_0x39b766[_0xfc20('0x18')][_0xfc20('0x1d')]?_[_0xfc20('0x1e')](_0x39b766[_0xfc20('0x18')][_0xfc20('0x1d')],function(_0x5bb6a4){return{'model':db[_0x5bb6a4[_0xfc20('0x1f')]],'as':_0x5bb6a4['as'],'attributes':_0x5bb6a4[_0xfc20('0x1b')],'include':_0x5bb6a4[_0xfc20('0x1d')]?_[_0xfc20('0x1e')](_0x5bb6a4[_0xfc20('0x1d')],function(_0x4c2991){return{'model':db[_0x4c2991['model']],'as':_0x4c2991['as'],'attributes':_0x4c2991[_0xfc20('0x1b')],'include':_0x4c2991['include']?_[_0xfc20('0x1e')](_0x4c2991[_0xfc20('0x1d')],function(_0x328f6a){return{'model':db[_0x328f6a['model']],'as':_0x328f6a['as'],'attributes':_0x328f6a['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc20('0x9')](function(_0x3c228b){logger['info'](_0xfc20('0x15'),_0x39b766);logger[_0xfc20('0xc')](_0xfc20('0x15'),_0x39b766,JSON[_0xfc20('0xe')](_0x3c228b));_0x3d0d24(_0x3c228b);})[_0xfc20('0x14')](function(_0x54c95a){logger[_0xfc20('0xf')](_0xfc20('0x15'),_0x54c95a[_0xfc20('0x11')],_0x39b766);_0x1cac62(_0x275a00[_0xfc20('0xf')](0x1f4,_0x54c95a[_0xfc20('0x11')]));});});};exports[_0xfc20('0x20')]=function(_0x5a2dc6){var _0x138cbf=this;return new Promise(function(_0x5d8d91,_0x192d44){return db[_0xfc20('0x16')]['find']({'raw':_0x5a2dc6[_0xfc20('0x18')]?_0x5a2dc6[_0xfc20('0x18')][_0xfc20('0x19')]===undefined?!![]:![]:!![],'where':_0x5a2dc6[_0xfc20('0x18')]?_0x5a2dc6[_0xfc20('0x18')][_0xfc20('0x1a')]||null:null,'attributes':_0x5a2dc6[_0xfc20('0x18')]?_0x5a2dc6[_0xfc20('0x18')]['attributes']||null:null,'include':_0x5a2dc6[_0xfc20('0x18')]?_0x5a2dc6[_0xfc20('0x18')]['include']?_[_0xfc20('0x1e')](_0x5a2dc6[_0xfc20('0x18')]['include'],function(_0x25d49a){return{'model':db[_0x25d49a[_0xfc20('0x1f')]],'as':_0x25d49a['as'],'attributes':_0x25d49a['attributes'],'include':_0x25d49a[_0xfc20('0x1d')]?_['map'](_0x25d49a['include'],function(_0x20ddef){return{'model':db[_0x20ddef['model']],'as':_0x20ddef['as'],'attributes':_0x20ddef[_0xfc20('0x1b')],'include':_0x20ddef['include']?_[_0xfc20('0x1e')](_0x20ddef[_0xfc20('0x1d')],function(_0xe7998d){return{'model':db[_0xe7998d[_0xfc20('0x1f')]],'as':_0xe7998d['as'],'attributes':_0xe7998d[_0xfc20('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfc20('0x9')](function(_0x4650d3){logger[_0xfc20('0x12')](_0xfc20('0x20'),_0x5a2dc6);logger['debug'](_0xfc20('0x20'),_0x5a2dc6,JSON[_0xfc20('0xe')](_0x4650d3));_0x5d8d91(_0x4650d3);})['catch'](function(_0x97a8e){logger['error'](_0xfc20('0x20'),_0x97a8e[_0xfc20('0x11')],_0x5a2dc6);_0x192d44(_0x138cbf[_0xfc20('0xf')](0x1f4,_0x97a8e[_0xfc20('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 8db7722..477b355 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 _0x4fb7=['/:id/api_key','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','bulkCreate','join','root','%s-%s','originalname','single','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0x4fb7,0x1d7));var _0x74fb=function(_0x180b34,_0x3042a1){_0x180b34=_0x180b34-0x0;var _0x887de5=_0x4fb7[_0x180b34];return _0x887de5;};'use strict';var multer=require('multer');var util=require(_0x74fb('0x0'));var path=require(_0x74fb('0x1'));var timeout=require(_0x74fb('0x2'));var express=require(_0x74fb('0x3'));var router=express[_0x74fb('0x4')]();var fs_extra=require(_0x74fb('0x5'));var auth=require(_0x74fb('0x6'));var interaction=require(_0x74fb('0x7'));var config=require('../../config/environment');var controller=require(_0x74fb('0x8'));router[_0x74fb('0x9')]('/',auth[_0x74fb('0xa')](),controller[_0x74fb('0xb')]);router[_0x74fb('0x9')](_0x74fb('0xc'),auth[_0x74fb('0xa')](),controller[_0x74fb('0xd')]);router['get'](_0x74fb('0xe'),auth[_0x74fb('0xa')](),controller['whoami']);router['get']('/presence',auth[_0x74fb('0xa')](),controller[_0x74fb('0xf')]);router[_0x74fb('0x9')](_0x74fb('0x10'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x11')]);router[_0x74fb('0x9')](_0x74fb('0x12'),controller[_0x74fb('0x13')]);router['get'](_0x74fb('0x14'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x15')]);router[_0x74fb('0x9')](_0x74fb('0x16'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x17')]);router['get'](_0x74fb('0x18'),auth['isAuthenticated'](),controller[_0x74fb('0x19')]);router[_0x74fb('0x9')](_0x74fb('0x1a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x1b')]);router[_0x74fb('0x9')](_0x74fb('0x1c'),auth['isAuthenticated'](),controller[_0x74fb('0x1d')]);router[_0x74fb('0x9')](_0x74fb('0x1e'),auth['isAuthenticated'](),controller[_0x74fb('0x1f')]);router[_0x74fb('0x9')]('/:id/screen_recordings',auth[_0x74fb('0xa')](),controller['getScreenRecordings']);router['get'](_0x74fb('0x20'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x21')]);router['get'](_0x74fb('0x22'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x23')]);router['get'](_0x74fb('0x24'),auth['isAuthenticated'](),controller[_0x74fb('0x25')]);router['get'](_0x74fb('0x26'),auth['isAuthenticated'](),controller[_0x74fb('0x27')]);router[_0x74fb('0x9')]('/:id/fax/interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x28')]);router[_0x74fb('0x9')](_0x74fb('0x29'),auth[_0x74fb('0xa')](),controller['getWhatsappInteractions']);router['get'](_0x74fb('0x2a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x2b')]);router[_0x74fb('0x9')]('/:id/lists',auth[_0x74fb('0xa')](),controller['getLists']);router[_0x74fb('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0x74fb('0x2c')]);router['get'](_0x74fb('0x2d'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x2e')]);router[_0x74fb('0x9')](_0x74fb('0x2f'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x30')]);router[_0x74fb('0x9')](_0x74fb('0x31'),auth['isAuthenticated'](),controller[_0x74fb('0x32')]);router[_0x74fb('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x74fb('0x33')]);router['get'](_0x74fb('0x34'),auth['isAuthenticated'](),controller[_0x74fb('0x35')]);router[_0x74fb('0x9')](_0x74fb('0x36'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x37')]);router[_0x74fb('0x9')](_0x74fb('0x38'),auth[_0x74fb('0xa')](),controller['getWhatsappAccounts']);router[_0x74fb('0x9')](_0x74fb('0x39'),auth['isAuthenticated'](),controller[_0x74fb('0x3a')]);router[_0x74fb('0x9')](_0x74fb('0x3b'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x3c')]);router[_0x74fb('0x9')]('/:id/api_key',auth[_0x74fb('0xa')](),controller[_0x74fb('0x3d')]);router[_0x74fb('0x3e')](_0x74fb('0x16'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x3f')]);router['post']('/',auth['isAuthenticated'](),controller[_0x74fb('0x40')]);router[_0x74fb('0x3e')](_0x74fb('0x41'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x42')]);router[_0x74fb('0x3e')]('/:id/queues',auth[_0x74fb('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c5bb6,_0x5d7b62,_0x38811b){_0x38811b(null,path[_0x74fb('0x43')](config[_0x74fb('0x44')],'server/files/images/'));},'filename':function(_0x32f59a,_0x230f8e,_0x3e3169){_0x3e3169(null,util['format'](_0x74fb('0x45'),Date['now'](),_0x230f8e[_0x74fb('0x46')]));}})});router[_0x74fb('0x3e')](_0x74fb('0x12'),upload[_0x74fb('0x47')]('file'),controller[_0x74fb('0x48')]);router[_0x74fb('0x3e')](_0x74fb('0x49'),auth[_0x74fb('0xa')](),controller['login']);router['post'](_0x74fb('0x4a'),auth['isAuthenticated'](),controller['logout']);router[_0x74fb('0x3e')](_0x74fb('0x4b'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x4c')]);router['post'](_0x74fb('0x4d'),auth['isAuthenticated'](),controller[_0x74fb('0x4e')]);router[_0x74fb('0x3e')](_0x74fb('0x2a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x4f')]);router[_0x74fb('0x3e')](_0x74fb('0x50'),auth['isAuthenticated'](),controller[_0x74fb('0x51')]);router['post']('/:id/mail_interactions',auth[_0x74fb('0xa')](),controller['addMailInteractions']);router[_0x74fb('0x3e')](_0x74fb('0x52'),auth['isAuthenticated'](),controller[_0x74fb('0x53')]);router[_0x74fb('0x3e')](_0x74fb('0x54'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x55')]);router[_0x74fb('0x3e')](_0x74fb('0x56'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x57')]);router[_0x74fb('0x3e')](_0x74fb('0x58'),auth['isAuthenticated'](),controller[_0x74fb('0x59')]);router['post'](_0x74fb('0x2f'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5a')]);router[_0x74fb('0x3e')](_0x74fb('0x31'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5b')]);router[_0x74fb('0x3e')](_0x74fb('0x5c'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5d')]);router[_0x74fb('0x3e')](_0x74fb('0x34'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5e')]);router[_0x74fb('0x3e')](_0x74fb('0x36'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x74fb('0x3e')](_0x74fb('0x38'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5f')]);router[_0x74fb('0x3e')](_0x74fb('0x39'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x60')]);router['post']('/:id/api_key',auth[_0x74fb('0xa')](),controller['createApiKey']);router[_0x74fb('0x61')](_0x74fb('0x10'),auth['isAuthenticated'](),controller[_0x74fb('0x62')]);router[_0x74fb('0x61')](_0x74fb('0x63'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x64')]);router[_0x74fb('0x65')](_0x74fb('0x18'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x66')]);router[_0x74fb('0x65')](_0x74fb('0x2a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x67')]);router[_0x74fb('0x65')](_0x74fb('0x10'),auth[_0x74fb('0xa')](),controller['destroy']);router[_0x74fb('0x65')](_0x74fb('0x50'),auth[_0x74fb('0xa')](),controller['removeChatInteractions']);router[_0x74fb('0x65')]('/:id/mail_interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x68')]);router[_0x74fb('0x65')](_0x74fb('0x52'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x69')]);router[_0x74fb('0x65')]('/:id/sms_interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x6a')]);router[_0x74fb('0x65')]('/:id/openchannel_interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x6b')]);router[_0x74fb('0x65')](_0x74fb('0x58'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x6c')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x74fb('0x65')](_0x74fb('0x31'),auth['isAuthenticated'](),controller[_0x74fb('0x6d')]);router[_0x74fb('0x65')](_0x74fb('0x5c'),auth[_0x74fb('0xa')](),controller['removeOpenchannelAccounts']);router[_0x74fb('0x65')](_0x74fb('0x34'),auth['isAuthenticated'](),controller[_0x74fb('0x6e')]);router[_0x74fb('0x65')](_0x74fb('0x36'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x6f')]);router[_0x74fb('0x65')]('/:id/whatsapp_accounts',auth[_0x74fb('0xa')](),controller[_0x74fb('0x70')]);router[_0x74fb('0x65')](_0x74fb('0x39'),auth['isAuthenticated'](),controller[_0x74fb('0x71')]);router[_0x74fb('0x65')](_0x74fb('0x72'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x73')]);module[_0x74fb('0x74')]=router; \ No newline at end of file +var _0x555b=['../../config/environment','./user.controller','get','index','/describe','isAuthenticated','/whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues_rt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','/:id/queues','addQueues','diskStorage','join','root','format','now','originalname','single','file','/:id/login','login','/:id/logout','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a3475,_0x42f664){var _0x1b7842=function(_0x26a4f6){while(--_0x26a4f6){_0x5a3475['push'](_0x5a3475['shift']());}};_0x1b7842(++_0x42f664);}(_0x555b,0x1cc));var _0xb555=function(_0x45c326,_0x570633){_0x45c326=_0x45c326-0x0;var _0x1da38c=_0x555b[_0x45c326];return _0x1da38c;};'use strict';var multer=require('multer');var util=require(_0xb555('0x0'));var path=require(_0xb555('0x1'));var timeout=require(_0xb555('0x2'));var express=require(_0xb555('0x3'));var router=express[_0xb555('0x4')]();var fs_extra=require(_0xb555('0x5'));var auth=require(_0xb555('0x6'));var interaction=require(_0xb555('0x7'));var config=require(_0xb555('0x8'));var controller=require(_0xb555('0x9'));router[_0xb555('0xa')]('/',auth['isAuthenticated'](),controller[_0xb555('0xb')]);router['get'](_0xb555('0xc'),auth[_0xb555('0xd')](),controller['describe']);router[_0xb555('0xa')](_0xb555('0xe'),auth[_0xb555('0xd')](),controller['whoami']);router[_0xb555('0xa')](_0xb555('0xf'),auth[_0xb555('0xd')](),controller[_0xb555('0x10')]);router[_0xb555('0xa')](_0xb555('0x11'),auth[_0xb555('0xd')](),controller['show']);router[_0xb555('0xa')](_0xb555('0x12'),controller[_0xb555('0x13')]);router['get']('/:id/open_tabs',auth['isAuthenticated'](),controller['getOpenTabs']);router['get'](_0xb555('0x14'),auth[_0xb555('0xd')](),controller[_0xb555('0x15')]);router['get']('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router[_0xb555('0xa')](_0xb555('0x16'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0xb555('0xa')](_0xb555('0x17'),auth[_0xb555('0xd')](),controller[_0xb555('0x18')]);router[_0xb555('0xa')]('/:id/recordings',auth[_0xb555('0xd')](),controller[_0xb555('0x19')]);router[_0xb555('0xa')](_0xb555('0x1a'),auth[_0xb555('0xd')](),controller['getScreenRecordings']);router[_0xb555('0xa')](_0xb555('0x1b'),auth[_0xb555('0xd')](),controller[_0xb555('0x1c')]);router[_0xb555('0xa')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0xb555('0x1d')]);router['get'](_0xb555('0x1e'),auth[_0xb555('0xd')](),controller[_0xb555('0x1f')]);router[_0xb555('0xa')](_0xb555('0x20'),auth['isAuthenticated'](),controller[_0xb555('0x21')]);router[_0xb555('0xa')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0xb555('0x22')]);router[_0xb555('0xa')](_0xb555('0x23'),auth[_0xb555('0xd')](),controller[_0xb555('0x24')]);router[_0xb555('0xa')](_0xb555('0x25'),auth[_0xb555('0xd')](),controller[_0xb555('0x26')]);router[_0xb555('0xa')](_0xb555('0x27'),auth[_0xb555('0xd')](),controller[_0xb555('0x28')]);router[_0xb555('0xa')]('/:id/agents',auth[_0xb555('0xd')](),controller[_0xb555('0x29')]);router[_0xb555('0xa')]('/:id/prefixes',auth[_0xb555('0xd')](),controller[_0xb555('0x2a')]);router[_0xb555('0xa')](_0xb555('0x2b'),auth['isAuthenticated'](),controller['getFaxAccounts']);router['get'](_0xb555('0x2c'),auth['isAuthenticated'](),controller[_0xb555('0x2d')]);router[_0xb555('0xa')](_0xb555('0x2e'),auth[_0xb555('0xd')](),controller['getOpenchannelAccounts']);router['get'](_0xb555('0x2f'),auth[_0xb555('0xd')](),controller[_0xb555('0x30')]);router['get'](_0xb555('0x31'),auth[_0xb555('0xd')](),controller['getChatWebsites']);router[_0xb555('0xa')](_0xb555('0x32'),auth[_0xb555('0xd')](),controller['getWhatsappAccounts']);router[_0xb555('0xa')]('/:id/square_projects',auth[_0xb555('0xd')](),controller[_0xb555('0x33')]);router[_0xb555('0xa')](_0xb555('0x34'),auth[_0xb555('0xd')](),controller[_0xb555('0x35')]);router['get'](_0xb555('0x36'),auth[_0xb555('0xd')](),controller[_0xb555('0x37')]);router['post'](_0xb555('0x14'),auth[_0xb555('0xd')](),controller['addContacts']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb555('0x38')](_0xb555('0x39'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xb555('0x38')](_0xb555('0x3a'),auth['isAuthenticated'](),controller[_0xb555('0x3b')]);var upload=multer({'storage':multer[_0xb555('0x3c')]({'destination':function(_0x1ee6ed,_0x28e4fd,_0x862e6a){_0x862e6a(null,path[_0xb555('0x3d')](config[_0xb555('0x3e')],'server/files/images/'));},'filename':function(_0x136c11,_0x224cf0,_0x4a6358){_0x4a6358(null,util[_0xb555('0x3f')]('%s-%s',Date[_0xb555('0x40')](),_0x224cf0[_0xb555('0x41')]));}})});router['post']('/:id/avatar',upload[_0xb555('0x42')](_0xb555('0x43')),controller['addAvatar']);router['post'](_0xb555('0x44'),auth[_0xb555('0xd')](),controller[_0xb555('0x45')]);router[_0xb555('0x38')](_0xb555('0x46'),auth[_0xb555('0xd')](),controller['logout']);router[_0xb555('0x38')](_0xb555('0x47'),auth['isAuthenticated'](),controller[_0xb555('0x48')]);router[_0xb555('0x38')]('/:id/unpause',auth[_0xb555('0xd')](),controller[_0xb555('0x49')]);router[_0xb555('0x38')](_0xb555('0x25'),auth[_0xb555('0xd')](),controller[_0xb555('0x4a')]);router[_0xb555('0x38')](_0xb555('0x4b'),auth['isAuthenticated'](),controller[_0xb555('0x4c')]);router[_0xb555('0x38')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xb555('0x4d')]);router['post'](_0xb555('0x4e'),auth[_0xb555('0xd')](),controller[_0xb555('0x4f')]);router['post']('/:id/sms_interactions',auth[_0xb555('0xd')](),controller[_0xb555('0x50')]);router[_0xb555('0x38')](_0xb555('0x51'),auth[_0xb555('0xd')](),controller[_0xb555('0x52')]);router[_0xb555('0x38')](_0xb555('0x53'),auth[_0xb555('0xd')](),controller[_0xb555('0x54')]);router[_0xb555('0x38')](_0xb555('0x2b'),auth[_0xb555('0xd')](),controller[_0xb555('0x55')]);router[_0xb555('0x38')](_0xb555('0x2c'),auth[_0xb555('0xd')](),controller[_0xb555('0x56')]);router[_0xb555('0x38')](_0xb555('0x2e'),auth[_0xb555('0xd')](),controller[_0xb555('0x57')]);router[_0xb555('0x38')](_0xb555('0x2f'),auth[_0xb555('0xd')](),controller[_0xb555('0x58')]);router[_0xb555('0x38')](_0xb555('0x31'),auth[_0xb555('0xd')](),controller['addChatWebsites']);router[_0xb555('0x38')](_0xb555('0x32'),auth[_0xb555('0xd')](),controller['addWhatsappAccounts']);router[_0xb555('0x38')](_0xb555('0x59'),auth[_0xb555('0xd')](),controller[_0xb555('0x5a')]);router[_0xb555('0x38')](_0xb555('0x36'),auth[_0xb555('0xd')](),controller[_0xb555('0x5b')]);router[_0xb555('0x5c')](_0xb555('0x11'),auth[_0xb555('0xd')](),controller[_0xb555('0x5d')]);router[_0xb555('0x5c')](_0xb555('0x5e'),auth[_0xb555('0xd')](),controller[_0xb555('0x5f')]);router['delete']('/:id/queues',auth[_0xb555('0xd')](),controller[_0xb555('0x60')]);router[_0xb555('0x61')](_0xb555('0x25'),auth['isAuthenticated'](),controller[_0xb555('0x62')]);router[_0xb555('0x61')]('/:id',auth[_0xb555('0xd')](),controller[_0xb555('0x63')]);router['delete'](_0xb555('0x4b'),auth[_0xb555('0xd')](),controller[_0xb555('0x64')]);router['delete'](_0xb555('0x65'),auth['isAuthenticated'](),controller[_0xb555('0x66')]);router[_0xb555('0x61')](_0xb555('0x4e'),auth[_0xb555('0xd')](),controller[_0xb555('0x67')]);router[_0xb555('0x61')](_0xb555('0x68'),auth[_0xb555('0xd')](),controller[_0xb555('0x69')]);router[_0xb555('0x61')](_0xb555('0x51'),auth[_0xb555('0xd')](),controller[_0xb555('0x6a')]);router['delete']('/:id/whatsapp_interactions',auth[_0xb555('0xd')](),controller[_0xb555('0x6b')]);router[_0xb555('0x61')](_0xb555('0x2b'),auth[_0xb555('0xd')](),controller[_0xb555('0x6c')]);router[_0xb555('0x61')](_0xb555('0x2c'),auth[_0xb555('0xd')](),controller[_0xb555('0x6d')]);router[_0xb555('0x61')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xb555('0x6e')]);router['delete'](_0xb555('0x2f'),auth[_0xb555('0xd')](),controller[_0xb555('0x6f')]);router[_0xb555('0x61')](_0xb555('0x31'),auth[_0xb555('0xd')](),controller[_0xb555('0x70')]);router['delete'](_0xb555('0x32'),auth[_0xb555('0xd')](),controller[_0xb555('0x71')]);router['delete'](_0xb555('0x59'),auth[_0xb555('0xd')](),controller[_0xb555('0x72')]);router[_0xb555('0x61')](_0xb555('0x36'),auth[_0xb555('0xd')](),controller[_0xb555('0x73')]);module[_0xb555('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index f5b4352..87395ec 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 _0xaf1b=['force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','permissions','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','agent','local','INTEGER','internal','accountcode','callerid','fullname','DATE','BOOLEAN','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','split','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','actpass','update,nonat','TEXT','showWebBar','get','udp','encryption','avpf'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x132a22,_0x5afe84){_0x132a22=_0x132a22-0x0;var _0xe9bbb=_0xaf1b[_0x132a22];return _0xe9bbb;};'use strict';var Sequelize=require(_0xbaf1('0x0'));var moment=require(_0xbaf1('0x1'));var util=require(_0xbaf1('0x2'));var _=require(_0xbaf1('0x3'));module[_0xbaf1('0x4')]={'name':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'unique':_0xbaf1('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xdf4a1b){this[_0xbaf1('0x7')](_0xbaf1('0x6'),_0xdf4a1b);this[_0xbaf1('0x7')](_0xbaf1('0x8'),_0xdf4a1b);},'comment':_0xbaf1('0x9')},'fullname':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'set':function(_0x548a29){this[_0xbaf1('0x7')]('fullname',_0x548a29);this[_0xbaf1('0x7')]('callerid',util[_0xbaf1('0xa')](_0xbaf1('0xb'),_0x548a29,this[_0xbaf1('0xc')]('internal')));}},'alias':{'type':Sequelize[_0xbaf1('0x5')]},'email':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x6e9e3){if(_0x6e9e3){this['setDataValue'](_0xbaf1('0xd'),_0x6e9e3[_0xbaf1('0xe')]());}}},'role':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x10'),_0xbaf1('0x11'),_0xbaf1('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':_0xbaf1('0x13')},'internal':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':![],'unique':_0xbaf1('0x15'),'set':function(_0x1d94da){this[_0xbaf1('0x7')](_0xbaf1('0x15'),_0x1d94da);this['setDataValue'](_0xbaf1('0x16'),_0x1d94da);this[_0xbaf1('0x7')](_0xbaf1('0x17'),util[_0xbaf1('0xa')](_0xbaf1('0xb'),this[_0xbaf1('0xc')](_0xbaf1('0x18')),_0x1d94da));}},'salt':{'type':Sequelize[_0xbaf1('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xbaf1('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xbaf1('0x5')]},'userpic':{'type':Sequelize[_0xbaf1('0x5')]},'city':{'type':Sequelize[_0xbaf1('0x5')]},'country':{'type':Sequelize[_0xbaf1('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xbaf1('0x19')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':_0xbaf1('0x1b')},'lastPauseAt':{'type':Sequelize[_0xbaf1('0x19')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xbaf1('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'description':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xbaf1('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xbaf1('0x1c'),_0xbaf1('0x11'),_0xbaf1('0x1d')),'allowNull':!![],'defaultValue':_0xbaf1('0x1c')},'context':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'defaultValue':_0xbaf1('0x1e')},'callingpres':{'type':Sequelize[_0xbaf1('0xf')]('ALLOWED_NOT_SCREENED',_0xbaf1('0x1f'),_0xbaf1('0x20'),_0xbaf1('0x21'),_0xbaf1('0x22'),_0xbaf1('0x23'),_0xbaf1('0x24'),_0xbaf1('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x19976c){this['setDataValue'](_0xbaf1('0x26'),_0x19976c?_0x19976c['join'](','):null);},'get':function(){return this[_0xbaf1('0xc')](_0xbaf1('0x26'))?this[_0xbaf1('0xc')](_0xbaf1('0x26'))['split'](','):null;},'comment':_0xbaf1('0x27')},'dtmfmode':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x28'),_0xbaf1('0x29'),_0xbaf1('0x2a'),_0xbaf1('0x2b'),_0xbaf1('0x2c')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no',_0xbaf1('0x2e'),_0xbaf1('0x2f'),_0xbaf1('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbaf1('0x31'),'set':function(_0xcd28ce){this[_0xbaf1('0x7')](_0xbaf1('0x32'),_0xcd28ce?_0xcd28ce[_0xbaf1('0x33')](','):null);},'get':function(){return this[_0xbaf1('0xc')](_0xbaf1('0x32'))?this[_0xbaf1('0xc')](_0xbaf1('0x32'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xbaf1('0x5')]},'pickupgroup':{'type':Sequelize[_0xbaf1('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbaf1('0x5')]},'disallow':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'defaultValue':_0xbaf1('0x34'),'set':function(_0x3d2302){this['setDataValue'](_0xbaf1('0x35'),_0x3d2302?_0x3d2302[_0xbaf1('0x33')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xbaf1('0x35'))?this['getDataValue']('allow')['split'](';'):null;},'comment':_0xbaf1('0x36')},'autoframing':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'set':function(_0x9d38ba){this[_0xbaf1('0x7')](_0xbaf1('0x37'),_0x9d38ba?_0x9d38ba[_0xbaf1('0x33')](','):null);},'get':function(){return this['getDataValue'](_0xbaf1('0x37'))?this[_0xbaf1('0xc')](_0xbaf1('0x37'))[_0xbaf1('0x38')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbaf1('0xf')]('yes','no',_0xbaf1('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbaf1('0x3a')},'amaflags':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xbaf1('0x2d')},'busylevel':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no',_0xbaf1('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xbaf1('0xf')]('accept',_0xbaf1('0x3c'),_0xbaf1('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x3e'),_0xbaf1('0x3f')),'allowNull':!![],'defaultValue':_0xbaf1('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xbaf1('0x2d')},'keepalive':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no',_0xbaf1('0x40'),_0xbaf1('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xbaf1('0xf')]('active','passive',_0xbaf1('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no','nonat',_0xbaf1('0x2f'),_0xbaf1('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xbaf1('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xbaf1('0x19')]},'passwordResetAt':{'type':Sequelize[_0xbaf1('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xbaf1('0x44')]},'showWebBar':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0,'set':function(_0x1f1449){this[_0xbaf1('0x7')](_0xbaf1('0x45'),_0x1f1449);var _0x58ba4e=this[_0xbaf1('0x46')]({'plain':!![]});switch(_0x1f1449){case 0x0:case 0x1:var _0x4e42b0=_0x58ba4e[_0xbaf1('0x26')]?_['isArray'](_0x58ba4e[_0xbaf1('0x26')])?_0x58ba4e[_0xbaf1('0x26')][_0xbaf1('0x33')]():_0x58ba4e[_0xbaf1('0x26')]:_0xbaf1('0x47');if(_0x4e42b0==='wss'){_0x4e42b0=_0xbaf1('0x47');}this[_0xbaf1('0x7')](_0xbaf1('0x26'),_0x4e42b0);this['setDataValue'](_0xbaf1('0x48'),'no');this[_0xbaf1('0x7')](_0xbaf1('0x49'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4a'),null);this[_0xbaf1('0x7')]('icesupport',null);this[_0xbaf1('0x7')](_0xbaf1('0x4b'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4c'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4d'),null);this['setDataValue'](_0xbaf1('0x4e'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4f'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xbaf1('0x7')](_0xbaf1('0x26'),_0xbaf1('0x50'));this['setDataValue'](_0xbaf1('0x48'),_0xbaf1('0x2d'));this[_0xbaf1('0x7')](_0xbaf1('0x49'),_0xbaf1('0x2d'));this['setDataValue'](_0xbaf1('0x4a'),_0xbaf1('0x2d'));this[_0xbaf1('0x7')]('icesupport','yes');this[_0xbaf1('0x7')](_0xbaf1('0x4b'),_0xbaf1('0x2d'));this['setDataValue'](_0xbaf1('0x4c'),'no');this[_0xbaf1('0x7')](_0xbaf1('0x4d'),'actpass');this[_0xbaf1('0x7')](_0xbaf1('0x4e'),_0x58ba4e['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0xbaf1('0x7')](_0xbaf1('0x4f'),_0x58ba4e['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0xbaf1('0x7')]('rtcp_mux',_0xbaf1('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0xbaf1('0x44')],'set':function(_0x1d12da){this[_0xbaf1('0x7')](_0xbaf1('0x51'),_0x1d12da?_0x1d12da[_0xbaf1('0x33')](','):[]);},'get':function(){return this[_0xbaf1('0xc')]('permissions')?_['map'](this['getDataValue'](_0xbaf1('0x51'))[_0xbaf1('0x38')](','),function(_0x1e8486){return parseInt(_0x1e8486,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xbaf1('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0xbaf1('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xbaf1('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbaf1('0xc')]('phoneBarEnableScreenRecordingByAgent')?this[_0xbaf1('0xc')](_0xbaf1('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'interface':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![],'set':function(_0x292ec0){if(typeof _0x292ec0==='string'){var _0x369e80=_0x292ec0==='1'?!![]:_0x292ec0==='0'?![]:_0x292ec0===_0xbaf1('0x53')?!![]:_0x292ec0==='false'?![]:![];this[_0xbaf1('0x7')](_0xbaf1('0x54'),_0x369e80);}else{this[_0xbaf1('0x7')](_0xbaf1('0x54'),_0x292ec0);}}},'blocked':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![],'set':function(_0xf389f){this[_0xbaf1('0x7')](_0xbaf1('0x55'),_0xf389f);if(_0xf389f===!![]){this[_0xbaf1('0x7')](_0xbaf1('0x56'),moment());this[_0xbaf1('0x7')](_0xbaf1('0x57'),0x0);}else{this['setDataValue'](_0xbaf1('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xbaf1('0x14')](0x5)[_0xbaf1('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0ec6=['rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','accept','refuse','originate','uas','certificate','passive','TEXT','showWebBar','get','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','avpf','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','agent','telephone','local','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','user','peer','from-sip','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x3540a9,_0x2e0f03){_0x3540a9=_0x3540a9-0x0;var _0x3eb975=_0x0ec6[_0x3540a9];return _0x3eb975;};'use strict';var Sequelize=require(_0x60ec('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x60ec('0x1'));module[_0x60ec('0x2')]={'name':{'type':Sequelize[_0x60ec('0x3')],'allowNull':![],'unique':_0x60ec('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3918dc){this[_0x60ec('0x5')](_0x60ec('0x4'),_0x3918dc);this['setDataValue'](_0x60ec('0x6'),_0x3918dc);},'comment':_0x60ec('0x7')},'fullname':{'type':Sequelize[_0x60ec('0x3')],'allowNull':![],'set':function(_0x74adc4){this['setDataValue'](_0x60ec('0x8'),_0x74adc4);this['setDataValue'](_0x60ec('0x9'),util[_0x60ec('0xa')](_0x60ec('0xb'),_0x74adc4,this[_0x60ec('0xc')](_0x60ec('0xd'))));}},'alias':{'type':Sequelize[_0x60ec('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x309e0d){if(_0x309e0d){this[_0x60ec('0x5')](_0x60ec('0xe'),_0x309e0d[_0x60ec('0xf')]());}}},'role':{'type':Sequelize[_0x60ec('0x10')]('admin','user',_0x60ec('0x11'),_0x60ec('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x60ec('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x60ec('0x3')],'defaultValue':_0x60ec('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x60ec('0xd'),'set':function(_0x456fb5){this[_0x60ec('0x5')](_0x60ec('0xd'),_0x456fb5);this[_0x60ec('0x5')](_0x60ec('0x14'),_0x456fb5);this[_0x60ec('0x5')](_0x60ec('0x9'),util[_0x60ec('0xa')]('\x22%s\x22\x20<%s>',this[_0x60ec('0xc')](_0x60ec('0x8')),_0x456fb5));}},'salt':{'type':Sequelize[_0x60ec('0x3')]},'phone':{'type':Sequelize[_0x60ec('0x3')]},'mobile':{'type':Sequelize[_0x60ec('0x3')]},'address':{'type':Sequelize[_0x60ec('0x3')]},'zipcode':{'type':Sequelize[_0x60ec('0x3')]},'userpic':{'type':Sequelize[_0x60ec('0x3')]},'city':{'type':Sequelize[_0x60ec('0x3')]},'country':{'type':Sequelize[_0x60ec('0x3')]},'online':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x60ec('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x60ec('0x3')],'defaultValue':_0x60ec('0x17')},'lastPauseAt':{'type':Sequelize[_0x60ec('0x16')]},'chatCapacity':{'type':Sequelize[_0x60ec('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x60ec('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x60ec('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x60ec('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![],'defaultValue':_0x60ec('0x19')},'ipaddr':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x60ec('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x1a'),_0x60ec('0x1b'),_0x60ec('0x1c')),'allowNull':!![],'defaultValue':_0x60ec('0x1a')},'context':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![],'defaultValue':_0x60ec('0x1d')},'callingpres':{'type':Sequelize[_0x60ec('0x10')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x60ec('0x1e'),_0x60ec('0x1f'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x60ec('0x20'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x60ec('0x21'),'set':function(_0x3dcbfa){this[_0x60ec('0x5')](_0x60ec('0x22'),_0x3dcbfa?_0x3dcbfa[_0x60ec('0x23')](','):null);},'get':function(){return this[_0x60ec('0xc')]('transport')?this[_0x60ec('0xc')](_0x60ec('0x22'))['split'](','):null;},'comment':_0x60ec('0x24')},'dtmfmode':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x25'),_0x60ec('0x26'),'shortinfo',_0x60ec('0x27'),_0x60ec('0x28')),'allowNull':!![],'defaultValue':_0x60ec('0x25')},'directmedia':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no',_0x60ec('0x2a'),_0x60ec('0x2b'),_0x60ec('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![],'defaultValue':_0x60ec('0x2d'),'set':function(_0x342c09){this[_0x60ec('0x5')](_0x60ec('0x2e'),_0x342c09?_0x342c09['join'](','):null);},'get':function(){return this[_0x60ec('0xc')](_0x60ec('0x2e'))?this['getDataValue'](_0x60ec('0x2e'))['split'](','):null;},'comment':_0x60ec('0x2f')},'callgroup':{'type':Sequelize[_0x60ec('0x3')]},'namedcallgroup':{'type':Sequelize[_0x60ec('0x3')]},'pickupgroup':{'type':Sequelize[_0x60ec('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x60ec('0x3')]},'language':{'type':Sequelize[_0x60ec('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x60ec('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x60ec('0x30'),'set':function(_0x569b81){this[_0x60ec('0x5')](_0x60ec('0x31'),_0x569b81?_0x569b81['join'](';'):_0x60ec('0x30'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0x60ec('0x31'))[_0x60ec('0x32')](';'):null;},'comment':_0x60ec('0x33')},'autoframing':{'type':Sequelize[_0x60ec('0x10')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![],'set':function(_0x1bee8d){this[_0x60ec('0x5')](_0x60ec('0x34'),_0x1bee8d?_0x1bee8d[_0x60ec('0x23')](','):null);},'get':function(){return this[_0x60ec('0xc')](_0x60ec('0x34'))?this[_0x60ec('0xc')](_0x60ec('0x34'))[_0x60ec('0x32')](','):null;},'comment':_0x60ec('0x35')},'trustrpid':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x60ec('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x60ec('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x60ec('0x29'),'no'),'allowNull':!![],'defaultValue':_0x60ec('0x29')},'busylevel':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x60ec('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x60ec('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x60ec('0x10')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no',_0x60ec('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x37'),_0x60ec('0x38'),_0x60ec('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x60ec('0x10')]('uac',_0x60ec('0x3a')),'allowNull':!![],'defaultValue':_0x60ec('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x60ec('0x10')]('yes','no'),'allowNull':!![],'defaultValue':_0x60ec('0x29')},'keepalive':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x60ec('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x60ec('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no','fingerprint',_0x60ec('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x60ec('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x60ec('0x10')]('active',_0x60ec('0x3c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x60ec('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x60ec('0x29'),'no',_0x60ec('0x2a'),_0x60ec('0x2b'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x60ec('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x60ec('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x60ec('0x3d')]},'showWebBar':{'type':Sequelize[_0x60ec('0x18')],'defaultValue':0x0,'set':function(_0x3edeef){this[_0x60ec('0x5')](_0x60ec('0x3e'),_0x3edeef);var _0x4c947e=this[_0x60ec('0x3f')]({'plain':!![]});switch(_0x3edeef){case 0x0:case 0x1:var _0x3c3a0d=_0x4c947e['transport']?_['isArray'](_0x4c947e[_0x60ec('0x22')])?_0x4c947e[_0x60ec('0x22')][_0x60ec('0x23')]():_0x4c947e[_0x60ec('0x22')]:_0x60ec('0x21');if(_0x3c3a0d===_0x60ec('0x40')){_0x3c3a0d=_0x60ec('0x21');}this['setDataValue'](_0x60ec('0x22'),_0x3c3a0d);this[_0x60ec('0x5')](_0x60ec('0x41'),'no');this[_0x60ec('0x5')]('avpf',null);this[_0x60ec('0x5')](_0x60ec('0x42'),null);this[_0x60ec('0x5')](_0x60ec('0x43'),null);this[_0x60ec('0x5')](_0x60ec('0x44'),null);this[_0x60ec('0x5')](_0x60ec('0x45'),null);this['setDataValue'](_0x60ec('0x46'),null);this[_0x60ec('0x5')]('dtlscertfile',null);this[_0x60ec('0x5')](_0x60ec('0x47'),null);this[_0x60ec('0x5')](_0x60ec('0x48'),'no');break;case 0x2:this[_0x60ec('0x5')](_0x60ec('0x22'),_0x60ec('0x40'));this[_0x60ec('0x5')](_0x60ec('0x41'),_0x60ec('0x29'));this[_0x60ec('0x5')](_0x60ec('0x49'),'yes');this[_0x60ec('0x5')](_0x60ec('0x42'),_0x60ec('0x29'));this[_0x60ec('0x5')]('icesupport',_0x60ec('0x29'));this[_0x60ec('0x5')](_0x60ec('0x44'),'yes');this['setDataValue'](_0x60ec('0x45'),'no');this[_0x60ec('0x5')]('dtlssetup',_0x60ec('0x4a'));this[_0x60ec('0x5')](_0x60ec('0x4b'),_0x4c947e['dtlscertfile']||_0x60ec('0x4c'));this[_0x60ec('0x5')](_0x60ec('0x47'),_0x4c947e[_0x60ec('0x47')]||_0x60ec('0x4d'));this[_0x60ec('0x5')](_0x60ec('0x48'),_0x60ec('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x38a033){this[_0x60ec('0x5')](_0x60ec('0x4e'),_0x38a033?_0x38a033[_0x60ec('0x23')](','):[]);},'get':function(){return this[_0x60ec('0xc')](_0x60ec('0x4e'))?_[_0x60ec('0x4f')](this['getDataValue']('permissions')[_0x60ec('0x32')](','),function(_0xe01c9b){return parseInt(_0xe01c9b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x60ec('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x60ec('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x60ec('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x60ec('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x60ec('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x60ec('0x10')](_0x60ec('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x60ec('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x60ec('0x50')],'get':function(){return this[_0x60ec('0xc')](_0x60ec('0x51'))?this[_0x60ec('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x60ec('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![],'set':function(_0x436735){if(typeof _0x436735===_0x60ec('0x52')){var _0x23982d=_0x436735==='1'?!![]:_0x436735==='0'?![]:_0x436735==='true'?!![]:_0x436735===_0x60ec('0x53')?![]:![];this[_0x60ec('0x5')](_0x60ec('0x54'),_0x23982d);}else{this['setDataValue'](_0x60ec('0x54'),_0x436735);}}},'blocked':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![],'set':function(_0x566d4b){this[_0x60ec('0x5')](_0x60ec('0x55'),_0x566d4b);if(_0x566d4b===!![]){this[_0x60ec('0x5')](_0x60ec('0x56'),moment());this['setDataValue'](_0x60ec('0x57'),0x0);}else{this[_0x60ec('0x5')](_0x60ec('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x60ec('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x60ec('0x15')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 26664a3..4f5cb51 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 _0x54ef=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','telephone','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','interface','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','upsert','removeQueues','Unknown\x20channel','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmList','Tag','color','tag','getQueues','isValidChannel','Queue','get','Unknown\x20role','getVoiceQueuesRt','UserVoiceQueueRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','device','LOGININPAUSE','MemberReport','bulkCreate','concat','isMiddleware','resolve','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','whatsapp','%s%s','Pause','Team','getTeams','addTeams','setDataValue','Voice','Chat','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','addAgent','getDataValue','removeTeams','getChatQueues','getMailQueues','Openchannel','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','isArray','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','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$gte','$lt','$eq','$not','$between','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','col','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','slice','charAt','select','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','admin','Agents','agent','Telephones','filter','map','value','includes','role','name','UserProfileResource','stack','User','rawAttributes','fieldName','type','key','model','differenceBy','password','salt','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','sequelize','lower','options','includeAll','include','findAll','rows','openTabs','true','push','chat','dataValues','openchannel','show','params','intersection','sms','fax','mail','all','update','body','describe','addContacts','find','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','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','mailbox','fullname','email','101','102','103','113','110','104','105','106','107','108','100','111','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation'];(function(_0x54e4ec,_0x183144){var _0x44ef91=function(_0x34fe75){while(--_0x34fe75){_0x54e4ec['push'](_0x54e4ec['shift']());}};_0x44ef91(++_0x183144);}(_0x54ef,0x112));var _0xf54e=function(_0x3717d8,_0x12d72c){_0x3717d8=_0x3717d8-0x0;var _0x334377=_0x54ef[_0x3717d8];return _0x334377;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var values;var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];config['redis']=_['defaults'](config[_0xf54e('0x19')],{'host':_0xf54e('0x1a'),'port':0x18eb});var socket=require(_0xf54e('0x1b'))(new Redis(config[_0xf54e('0x19')]));require('./user.socket')[_0xf54e('0x1c')](socket);var jayson=require(_0xf54e('0x1d'));var client=jayson[_0xf54e('0x1e')][_0xf54e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x56828e,_0x2366ee,_0x389abc,_0x3eb415){return new BPromise(function(_0x5c5d00,_0x4af633){var _0xd87020=_0x3eb415||client;return _0xd87020[_0xf54e('0x20')](_0x56828e,_0x389abc)[_0xf54e('0x21')](function(_0x9647f){logger[_0xf54e('0x22')](_0xf54e('0x23'),_0x2366ee,_0xf54e('0x24'));logger[_0xf54e('0x25')](_0xf54e('0x26'),_0x2366ee,_0xf54e('0x24'),JSON[_0xf54e('0x27')](_0x9647f));if(_0x9647f['error']){if(_0x9647f['error'][_0xf54e('0x28')]===0x1f4){logger['error'](_0xf54e('0x23'),_0x2366ee,_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);return _0x4af633(_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);}logger[_0xf54e('0x29')](_0xf54e('0x23'),_0x2366ee,_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);return _0x5c5d00(_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);}else{logger['info'](_0xf54e('0x23'),_0x2366ee,'request\x20sent');_0x5c5d00(_0x9647f[_0xf54e('0x2b')][_0xf54e('0x2a')]);}})[_0xf54e('0x2c')](function(_0x474b61){logger[_0xf54e('0x29')](_0xf54e('0x23'),_0x2366ee,_0x474b61);_0x4af633(_0x474b61);});});}function respondWithStatusCode(_0x1e08d1,_0x43488d){_0x43488d=_0x43488d||0xcc;return function(_0x2342a9){if(_0x2342a9){return _0x1e08d1[_0xf54e('0x2d')](_0x43488d);}return _0x1e08d1[_0xf54e('0x2e')](_0x43488d)[_0xf54e('0x2f')]();};}function respondWithResult(_0x2ea001,_0x5390b8){_0x5390b8=_0x5390b8||0xc8;return function(_0xb3706e){if(_0xb3706e){return _0x2ea001['status'](_0x5390b8)[_0xf54e('0x30')](_0xb3706e);}};}function respondWithFilteredResult(_0x5e63f4,_0x15b888){return function(_0x269f47){if(_0x269f47){var _0x21ba00=typeof _0x15b888[_0xf54e('0x31')]===_0xf54e('0x32')&&typeof _0x15b888[_0xf54e('0x33')]===_0xf54e('0x32');var _0x54bd8f=_0x269f47['count'];var _0x2f96b1=_0x21ba00?0x0:_0x15b888[_0xf54e('0x31')];var _0x2ec92e=_0x21ba00?_0x269f47[_0xf54e('0x34')]:_0x15b888[_0xf54e('0x31')]+_0x15b888[_0xf54e('0x33')];var _0x2b5408;if(_0x2ec92e>=_0x54bd8f){_0x2ec92e=_0x54bd8f;_0x2b5408=0xc8;}else{_0x2b5408=0xce;}_0x5e63f4[_0xf54e('0x2e')](_0x2b5408);return _0x5e63f4[_0xf54e('0x35')](_0xf54e('0x36'),_0x2f96b1+'-'+_0x2ec92e+'/'+_0x54bd8f)['json'](_0x269f47);}return null;};}function patchUpdates(_0x5f29d3){return function(_0x324976){try{jsonpatch[_0xf54e('0x37')](_0x324976,_0x5f29d3,!![]);}catch(_0x4d8fdd){return BPromise[_0xf54e('0x38')](_0x4d8fdd);}return _0x324976[_0xf54e('0x39')]();};}function saveUpdates(_0x379110,_0x52ab49){return function(_0x576b46){if(_0x576b46){return _0x576b46['update'](_0x379110)['then'](function(_0x3c0cca){return _0x3c0cca;});}return null;};}function removeEntity(_0xe7e042,_0x210d6d){return function(_0x399e68){if(_0x399e68){return _0x399e68[_0xf54e('0x3a')]()[_0xf54e('0x21')](function(){var _0x49ba1c=_0x399e68['get']({'plain':!![]});if(_0x49ba1c['role']===_0xf54e('0x3b'))return;var _0x734187=[{'name':'Users','value':'user','ignore':!![]},{'name':_0xf54e('0x3c'),'value':_0xf54e('0x3d'),'ignore':![]},{'name':_0xf54e('0x3e'),'value':'telephone','ignore':![]}];var _0x14ecc8=_(_0x734187)[_0xf54e('0x3f')]('ignore')[_0xf54e('0x40')](_0xf54e('0x41'))[_0xf54e('0x41')]();if(_[_0xf54e('0x42')](_0x14ecc8,_0x49ba1c[_0xf54e('0x43')])){return;}var _0x199056=_['find'](_0x734187,['value',_0x49ba1c[_0xf54e('0x43')]])[_0xf54e('0x44')];return db[_0xf54e('0x45')]['destroy']({'where':{'type':_0x199056,'resourceId':_0x49ba1c['id']}})[_0xf54e('0x21')](function(){return _0x399e68;});})[_0xf54e('0x21')](function(){_0xe7e042[_0xf54e('0x2e')](0xcc)[_0xf54e('0x2f')]();});}};}function handleEntityNotFound(_0x361e4c,_0x23f297){return function(_0x17c7ec){if(!_0x17c7ec){_0x361e4c[_0xf54e('0x2d')](0x194);}return _0x17c7ec;};}function handleError(_0x8b4c,_0x2087b3){_0x2087b3=_0x2087b3||0x1f4;return function(_0x1c1f0d){logger[_0xf54e('0x29')](_0x1c1f0d[_0xf54e('0x46')]);if(_0x1c1f0d[_0xf54e('0x44')]){delete _0x1c1f0d[_0xf54e('0x44')];}_0x8b4c['status'](_0x2087b3)['send'](_0x1c1f0d);};}exports['index']=function(_0x29cbad,_0x644c6e){var _0x5398b2={},_0x3dae9b={},_0x311ce1={'count':0x0,'rows':[]};var _0x381c03=_['map'](db[_0xf54e('0x47')][_0xf54e('0x48')],function(_0x1e016e){return{'name':_0x1e016e[_0xf54e('0x49')],'type':_0x1e016e[_0xf54e('0x4a')][_0xf54e('0x4b')]};});_0x3dae9b[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_[_0xf54e('0x40')](_0x381c03,'name'),[_0xf54e('0x4e'),_0xf54e('0x4f')]);_0x3dae9b[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x29cbad[_0xf54e('0x50')]);_0x3dae9b[_0xf54e('0x52')]=_['intersection'](_0x3dae9b[_0xf54e('0x4c')],_0x3dae9b['query']);_0x5398b2[_0xf54e('0x53')]=_['intersection'](_0x3dae9b[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x29cbad[_0xf54e('0x50')]['fields']));_0x5398b2[_0xf54e('0x53')]=_0x5398b2[_0xf54e('0x53')][_0xf54e('0x55')]?_0x5398b2[_0xf54e('0x53')]:_0x3dae9b[_0xf54e('0x4c')];if(!_0x29cbad['query'][_0xf54e('0x56')](_0xf54e('0x57'))){_0x5398b2[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x29cbad['query'][_0xf54e('0x33')]);_0x5398b2[_0xf54e('0x31')]=qs['offset'](_0x29cbad[_0xf54e('0x50')][_0xf54e('0x31')]);}_0x5398b2[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x29cbad['query'][_0xf54e('0x59')]);_0x5398b2[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x29cbad[_0xf54e('0x50')],_0x3dae9b[_0xf54e('0x52')]),_0x381c03);if(_0x29cbad[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x5398b2[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x5398b2[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x381c03,function(_0x2deb0c){if(_0x2deb0c[_0xf54e('0x4a')]!==_0xf54e('0x5d')){return db[_0xf54e('0x5e')][_0xf54e('0x5a')](db[_0xf54e('0x5e')]['fn'](_0xf54e('0x5f'),db[_0xf54e('0x5e')]['col'](_0x2deb0c['name'])),{'$like':db[_0xf54e('0x5e')]['fn'](_0xf54e('0x5f'),'%'+_0x29cbad[_0xf54e('0x50')][_0xf54e('0x3f')]+'%')});}})});}_0x5398b2=_[_0xf54e('0x5c')]({},_0x5398b2,_0x29cbad[_0xf54e('0x60')]);var _0x22763f={'where':_0x5398b2[_0xf54e('0x5a')]};return db[_0xf54e('0x47')][_0xf54e('0x34')](_0x22763f)[_0xf54e('0x21')](function(_0x59c313){_0x311ce1[_0xf54e('0x34')]=_0x59c313;if(_0x29cbad[_0xf54e('0x50')][_0xf54e('0x61')]){_0x5398b2[_0xf54e('0x62')]=[{'all':!![]}];}if(!_[_0xf54e('0x42')](_0x5398b2[_0xf54e('0x53')],'id')){_0x5398b2[_0xf54e('0x53')]['push']('id');}return db[_0xf54e('0x47')][_0xf54e('0x63')](_0x5398b2);})[_0xf54e('0x21')](function(_0x48a5c8){_0x311ce1[_0xf54e('0x64')]=_0x48a5c8;if(_0x29cbad['query'][_0xf54e('0x65')]===_0xf54e('0x66')){var _0x3e2fd1=[];for(var _0x5b882f=0x0;_0x5b882f<_0x311ce1[_0xf54e('0x64')][_0xf54e('0x55')];_0x5b882f++){_0x3e2fd1[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x68'),_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs('sms',_0x311ce1['rows'][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs('fax',_0x311ce1[_0xf54e('0x64')][_0x5b882f]['dataValues']));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs('mail',_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x6a'),_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1['push'](get_open_tabs('whatsapp',_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));}return BPromise['all'](_0x3e2fd1)['then'](function(_0x2a5e54){return _0x311ce1;});}else{return _0x311ce1;}})['then'](respondWithFilteredResult(_0x644c6e,_0x5398b2))[_0xf54e('0x2c')](handleError(_0x644c6e,null));};exports[_0xf54e('0x6b')]=function(_0x47596c,_0x2b11f8){var _0x1d7c52={'raw':![],'where':{'id':_0x47596c[_0xf54e('0x6c')]['id']}},_0x20c90d={};_0x20c90d[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_[_0xf54e('0x51')](db[_0xf54e('0x47')][_0xf54e('0x48')]),[_0xf54e('0x4e'),_0xf54e('0x4f')]);_0x20c90d['query']=_[_0xf54e('0x51')](_0x47596c[_0xf54e('0x50')]);_0x20c90d[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x20c90d[_0xf54e('0x4c')],_0x20c90d['query']);_0x1d7c52[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x20c90d['model'],qs['fields'](_0x47596c[_0xf54e('0x50')]['fields']));_0x1d7c52[_0xf54e('0x53')]=_0x1d7c52[_0xf54e('0x53')][_0xf54e('0x55')]?_0x1d7c52[_0xf54e('0x53')]:_0x20c90d['model'];if(_0x47596c[_0xf54e('0x50')]['includeAll']){_0x1d7c52[_0xf54e('0x62')]=[{'all':!![]}];}_0x1d7c52=_[_0xf54e('0x5c')]({},_0x1d7c52,_0x47596c[_0xf54e('0x60')]);if(!_['includes'](_0x1d7c52[_0xf54e('0x53')],'id')){_0x1d7c52['attributes'][_0xf54e('0x67')]('id');}return db[_0xf54e('0x47')]['find'](_0x1d7c52)[_0xf54e('0x21')](handleEntityNotFound(_0x2b11f8,null))['then'](function(_0x3aa7e5){var _0x2df028=[];values=_0x3aa7e5;if(_0x47596c[_0xf54e('0x50')][_0xf54e('0x65')]===_0xf54e('0x66')){_0x2df028['push'](get_open_tabs(_0xf54e('0x68'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x6e'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x6a'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028[_0xf54e('0x67')](get_open_tabs('whatsapp',_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x6f'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x70'),_0x3aa7e5[_0xf54e('0x69')]));return BPromise[_0xf54e('0x71')](_0x2df028);}else{return values;}})[_0xf54e('0x21')](function(_0x38bf71){return values;})[_0xf54e('0x21')](respondWithResult(_0x2b11f8,null))[_0xf54e('0x2c')](handleError(_0x2b11f8,null));};exports[_0xf54e('0x72')]=function(_0x451a1c,_0x10f6bb){if(_0x451a1c[_0xf54e('0x73')]['id']){delete _0x451a1c['body']['id'];}delete _0x451a1c[_0xf54e('0x73')][_0xf54e('0x43')];return db[_0xf54e('0x47')]['find']({'where':{'id':_0x451a1c[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x10f6bb,null))[_0xf54e('0x21')](saveUpdates(_0x451a1c[_0xf54e('0x73')],null))[_0xf54e('0x21')](respondWithResult(_0x10f6bb,null))[_0xf54e('0x2c')](handleError(_0x10f6bb,null));};exports[_0xf54e('0x74')]=function(_0x487895,_0x1eb3c1){return db[_0xf54e('0x47')][_0xf54e('0x74')]()['then'](respondWithResult(_0x1eb3c1,null))[_0xf54e('0x2c')](handleError(_0x1eb3c1,null));};exports[_0xf54e('0x75')]=function(_0x57601f,_0x247e50,_0x4f584a){return db['User'][_0xf54e('0x76')]({'where':{'id':_0x57601f[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x247e50,null))[_0xf54e('0x21')](function(_0x1c49cb){if(_0x1c49cb){return _0x1c49cb[_0xf54e('0x75')](_0x57601f[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x57601f[_0xf54e('0x73')],['ids','id'])||{});}})[_0xf54e('0x21')](respondWithResult(_0x247e50,null))[_0xf54e('0x2c')](handleError(_0x247e50,null));};function validateUser(_0x2b026a){return new BPromise(function(_0x42af1c,_0x56223a){if(_0x2b026a[_0xf54e('0x79')])return _0x42af1c(_0x2b026a);return db[_0xf54e('0x7a')][_0xf54e('0x7b')](0x1)[_0xf54e('0x21')](function(_0x5dd28e){if(_0x5dd28e[_0xf54e('0x7c')])authService[_0xf54e('0x7d')](_0x2b026a[_0xf54e('0x4e')]);db['User']['max'](_0xf54e('0x79'))[_0xf54e('0x21')](function(_0x1e2834){if(_[_0xf54e('0x7e')](_0x1e2834)){_0x2b026a[_0xf54e('0x79')]=_0x5dd28e[_0xf54e('0x7f')]||0x1;return;}if(_[_0xf54e('0x7e')](_0x5dd28e[_0xf54e('0x7f')])||_0x5dd28e[_0xf54e('0x7f')]===_0x1e2834){_0x2b026a['internal']=_0x1e2834+0x1;return;}if(_0x5dd28e[_0xf54e('0x7f')]>_0x1e2834){_0x2b026a[_0xf54e('0x79')]=_0x5dd28e[_0xf54e('0x7f')];return;}return db[_0xf54e('0x5e')][_0xf54e('0x50')](_0xf54e('0x80'),{'type':db[_0xf54e('0x5e')][_0xf54e('0x81')][_0xf54e('0x82')]})[_0xf54e('0x21')](function(_0x11dec2){if(_0x11dec2&&_0x11dec2[_0xf54e('0x55')]){for(var _0x5b9ff2=0x0,_0x151f58=_0x11dec2[_0xf54e('0x55')];_0x5b9ff2<_0x151f58&&_['isNil'](_0x2b026a['internal']);_0x5b9ff2++){if(_0x5dd28e[_0xf54e('0x7f')]<=_0x11dec2[_0x5b9ff2][_0xf54e('0x83')]){_0x2b026a[_0xf54e('0x79')]=_0x11dec2[_0x5b9ff2][_0xf54e('0x83')];}else if(_0x5dd28e[_0xf54e('0x7f')]>_0x11dec2[_0x5b9ff2][_0xf54e('0x83')]&&_0x5dd28e[_0xf54e('0x7f')]<=_0x11dec2[_0x5b9ff2]['to']){_0x2b026a[_0xf54e('0x79')]=_0x5dd28e[_0xf54e('0x7f')];}}}if(_['isNil'](_0x2b026a[_0xf54e('0x79')])){_0x2b026a[_0xf54e('0x79')]=_0x1e2834+0x1;}return _0x42af1c(_0x2b026a);});});})[_0xf54e('0x2c')](function(_0x5c8b6c){_0x56223a(_0x5c8b6c);});});}function updateUser(_0x40f135){return new BPromise(function(_0x4c5072,_0x3830e7){try{if(_0x40f135['voicemail']){_0x40f135[_0xf54e('0x84')]=_0x40f135[_0xf54e('0x79')];_0x40f135['VoiceMail']={'mailbox':_0x40f135['internal'],'password':_0x40f135[_0xf54e('0x4e')],'fullname':_0x40f135[_0xf54e('0x85')],'email':_0x40f135[_0xf54e('0x86')]};}if(_0x40f135[_0xf54e('0x43')]===_0xf54e('0x3d')){if(!_0x40f135['permissions'])_0x40f135['permissions']=[_0xf54e('0x87'),_0xf54e('0x88'),_0xf54e('0x89'),_0xf54e('0x8a'),_0xf54e('0x8b'),_0xf54e('0x8c'),_0xf54e('0x8d'),_0xf54e('0x8e'),_0xf54e('0x8f'),_0xf54e('0x90'),'109',_0xf54e('0x91'),_0xf54e('0x92'),'114','115'];}_0x4c5072(_0x40f135);}catch(_0x20345b){_0x3830e7(_0x20345b);}});}exports[_0xf54e('0x93')]=function(_0xdc25ce,_0x183867){if(_0xdc25ce[_0xf54e('0x94')]['role']===_0xf54e('0x3d'))throw new Error(_0xf54e('0x95'));if(_0xdc25ce[_0xf54e('0x73')][_0xf54e('0x43')]==='user'&&_0xdc25ce[_0xf54e('0x94')][_0xf54e('0x43')]!==_0xf54e('0x3b')){throw new Error(_0xf54e('0x96'));}if(_0xdc25ce['body'][_0xf54e('0x43')]===_0xf54e('0x3b')&&_0xdc25ce[_0xf54e('0x94')][_0xf54e('0x43')]!==_0xf54e('0x3b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xf54e('0x97')]([_0xdc25ce['body']])['then'](function(){return validateUser(_0xdc25ce[_0xf54e('0x73')]);})[_0xf54e('0x21')](function(_0x242f5c){return updateUser(_0x242f5c)[_0xf54e('0x21')](function(_0x300cbe){if(_0x300cbe[_0xf54e('0x43')]===_0xf54e('0x3b')){_0x300cbe[_0xf54e('0x98')]=_0xdc25ce[_0xf54e('0x94')]['settingsEnabled'];delete _0x300cbe[_0xf54e('0x99')];}return _0x300cbe;});})[_0xf54e('0x21')](function(_0x259a3e){return db[_0xf54e('0x47')][_0xf54e('0x93')](_0x259a3e,{'include':[{'model':db[_0xf54e('0x9a')],'as':'VoiceMail'}]});})[_0xf54e('0x21')](function(_0x978fe2){if(_0xdc25ce[_0xf54e('0x73')][_0xf54e('0x43')]===_0xf54e('0x94'))return _0x978fe2;if(_0xdc25ce[_0xf54e('0x94')]['role']!==_0xf54e('0x94'))return _0x978fe2;return db[_0xf54e('0x9b')][_0xf54e('0x76')]({'where':{'name':_0x978fe2[_0xf54e('0x43')]==='agent'?'Agents':_0xf54e('0x3e'),'userProfileId':_0xdc25ce[_0xf54e('0x94')][_0xf54e('0x99')]},'raw':!![]})[_0xf54e('0x21')](function(_0x3005f0){if(!_0x3005f0||_0x3005f0[_0xf54e('0x9c')]!=0x0)return _0x978fe2;return db['UserProfileResource'][_0xf54e('0x93')]({'name':_0x978fe2[_0xf54e('0x44')],'resourceId':_0x978fe2['id'],'type':_0x3005f0[_0xf54e('0x44')],'sectionId':_0x3005f0['id']},{})[_0xf54e('0x21')](function(){return _0x978fe2;});})[_0xf54e('0x2c')](function(_0xa386cc){logger['error'](_0xf54e('0x9d'),_0xa386cc);throw _0xa386cc;});})['then'](respondWithResult(_0x183867,0xc9))[_0xf54e('0x2c')](handleError(_0x183867,null));};exports['bulkCreate']=function(_0x21d974,_0x27c584){var _0x1ffad1=_0x21d974[_0xf54e('0x73')];var _0x19796f=[];if(_0x21d974['user'][_0xf54e('0x43')]===_0xf54e('0x3d'))throw new Error('Unauthorized');if(_[_0xf54e('0x9e')](_0x1ffad1,[_0xf54e('0x43'),_0xf54e('0x94')])&&_0x21d974[_0xf54e('0x94')]['role']!==_0xf54e('0x3b')){throw new Error(_0xf54e('0x96'));}if(_['some'](_0x1ffad1,[_0xf54e('0x43'),'admin'])&&_0x21d974['user'][_0xf54e('0x43')]!=='admin'){throw new Error(_0xf54e('0x9f'));}return licenseUtil[_0xf54e('0x97')](_0x1ffad1)[_0xf54e('0x21')](function(){return validateUser(_0x1ffad1[0x0]);})[_0xf54e('0x21')](function(){for(var _0x235124=0x1;_0x235124<_0x1ffad1['length'];_0x235124++){var _0x824d0b=_0x1ffad1[_0x235124-0x1][_0xf54e('0x79')];if(!_0x1ffad1[_0x235124][_0xf54e('0x79')])_0x1ffad1[_0x235124][_0xf54e('0x79')]=_0x824d0b+0x1;_0x19796f['push'](validateUser(_0x1ffad1[_0x235124]));}return BPromise[_0xf54e('0x71')](_0x19796f);})['then'](function(){_0x19796f=[];for(var _0x1da57f=0x0;_0x1da57f<_0x1ffad1[_0xf54e('0x55')];_0x1da57f++){_0x19796f['push'](updateUser(_0x1ffad1[_0x1da57f]));}return BPromise[_0xf54e('0x71')](_0x19796f);})[_0xf54e('0x21')](function(){return BPromise[_0xf54e('0xa0')](_0x1ffad1,function(_0x23a151){return db['User'][_0xf54e('0x93')](_0x23a151,{'include':[{'model':db[_0xf54e('0x9a')],'as':_0xf54e('0x9a')}]})['then'](function(_0x4a133a){_0x23a151['id']=_0x4a133a['id'];return _0x23a151;});});})[_0xf54e('0x21')](function(_0x5e33bc){if(_0x21d974['body']['role']===_0xf54e('0x94'))return _0x5e33bc;if(_0x21d974[_0xf54e('0x94')][_0xf54e('0x43')]!==_0xf54e('0x94'))return _0x5e33bc;var _0x34dc81=_[_0xf54e('0x9e')](_0x5e33bc,function(_0x427124){return _0x427124[_0xf54e('0x43')]===_0xf54e('0x3d')||_0x427124['role']===_0xf54e('0xa1');});if(!_0x34dc81)return _0x5e33bc;return db['UserProfileSection'][_0xf54e('0x63')]({'where':{'name':{'$or':[_0xf54e('0x3c'),'Telephones']},'userProfileId':_0x21d974[_0xf54e('0x94')]['userProfileId']},'raw':!![]})[_0xf54e('0x21')](function(_0x406e28){if(_[_0xf54e('0xa2')](_0x406e28)||!_[_0xf54e('0x9e')](_0x406e28,[_0xf54e('0x9c'),0x0]))return _0x5e33bc;_0x19796f=[];var _0x3c499e=_(_0x406e28)['map'](function(_0x4d0131){if(_0x4d0131['autoAssociation']===0x1)return;return _0x4d0131[_0xf54e('0x44')]==='Agents'?_0xf54e('0x3d'):_0xf54e('0xa1');})[_0xf54e('0xa3')]()[_0xf54e('0x41')]();for(var _0xf92db2=0x0;_0xf92db2<_0x5e33bc['length'];_0xf92db2++){if(!_[_0xf54e('0x42')](_0x3c499e,_0x5e33bc[_0xf92db2][_0xf54e('0x43')]))return;var _0x134074=_0x5e33bc[_0xf92db2][_0xf54e('0x43')]===_0xf54e('0x3d')?_0xf54e('0x3c'):'Telephones';_0x19796f[_0xf54e('0x67')](db[_0xf54e('0x45')][_0xf54e('0x93')]({'name':_0x5e33bc[_0xf92db2][_0xf54e('0x44')],'resourceId':_0x5e33bc[_0xf92db2]['id'],'type':_0x134074,'sectionId':_[_0xf54e('0x76')](_0x406e28,['name',_0x134074])['id']},{}));}return BPromise[_0xf54e('0x71')](_0x19796f);});})[_0xf54e('0x21')](respondWithResult(_0x27c584,0xc9))[_0xf54e('0x2c')](handleError(_0x27c584,null));};exports[_0xf54e('0xa4')]=function(_0x2c1984,_0xea4112,_0x285405){if(_0x2c1984[_0xf54e('0x73')]['id']){delete _0x2c1984[_0xf54e('0x73')]['id'];}return db['User'][_0xf54e('0x76')]({'where':{'id':_0x2c1984[_0xf54e('0x6c')]['id']}})['then'](function(_0x47a1d2){if(!_0x47a1d2)return null;if(_0x47a1d2['id']===_0x2c1984[_0xf54e('0x94')]['id']){if(!_0x2c1984['body'][_0xf54e('0xa5')]||!_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]){throw new db[(_0xf54e('0xa7'))]['ValidationError'](_0xf54e('0xa8'));}if(!_0x47a1d2[_0xf54e('0xa9')](_0x2c1984['body'][_0xf54e('0xa5')])){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xab'));}if(_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa5')]===_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xac'));}}else if(_0x2c1984['user']['role']===_0xf54e('0x3b')){if(!_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x2c1984[_0xf54e('0x94')][_0xf54e('0x43')]===_0xf54e('0x94')){if(!_0x2c1984[_0xf54e('0x73')]['newPassword']){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xad'));}if(_0x47a1d2[_0xf54e('0x43')]!==_0xf54e('0x3d')){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0x95'));}}else{throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0x95'));}return _0x47a1d2;})[_0xf54e('0x21')](handleEntityNotFound(_0xea4112,null))[_0xf54e('0x21')](function(_0x11d536){return db['Setting'][_0xf54e('0xae')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xf54e('0xaf')]})[_0xf54e('0x21')](function(_0x304cd1){if(_0x304cd1[_0xf54e('0x7c')])authService[_0xf54e('0x7d')](_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]);if(!_0x304cd1[_0xf54e('0xb0')]||!_0x11d536[_0xf54e('0xb1')])return _0x11d536;authService[_0xf54e('0xb2')](_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')],_0x11d536[_0xf54e('0xb1')],_0x304cd1['passwordHistoryLimit']);return _0x11d536;})[_0xf54e('0x21')](saveUpdates({'password':_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')],'passwordResetAt':_0x2c1984[_0xf54e('0x94')]['id']==_0x2c1984[_0xf54e('0x6c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2c1984['body'][_0xf54e('0xa6')],_0x11d536[_0xf54e('0xb1')])},null));})['then'](respondWithResult(_0xea4112,null))['catch'](handleError(_0xea4112,null));};exports[_0xf54e('0xb3')]=function(_0x5d5347,_0x391401,_0x275863){var _0x6e09bf=_0x5d5347[_0xf54e('0x73')][_0xf54e('0xb4')];return db[_0xf54e('0x47')]['find']({'where':{'id':_0x5d5347[_0xf54e('0x6c')]['id']},'attributes':['id',_0xf54e('0x44'),'role',_0xf54e('0xb5'),_0xf54e('0xb6'),'voicePause',_0xf54e('0xb7')]})[_0xf54e('0x21')](handleEntityNotFound(_0x391401,null))[_0xf54e('0x21')](function(_0x54efa9){if(_0x54efa9){if(!utils['isValidChannel'](_0x6e09bf)){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))]('Unknown\x20channel');}return _0x54efa9['add'+_['capitalize'](_0x6e09bf[_0xf54e('0xb8')]())+_0xf54e('0xb9')](_0x5d5347[_0xf54e('0x73')]['ids'],{'penalty':_0x5d5347[_0xf54e('0x73')][_0xf54e('0xba')]||0x0})[_0xf54e('0xbb')](function(_0x3da354){for(var _0x34b978=0x0;_0x34b978<_0x5d5347['body']['ids']['length'];_0x34b978+=0x1){var _0x484acd={'UserId':_0x5d5347['params']['id']};_0x484acd[_[_0xf54e('0xbc')](_0x6e09bf['toLowerCase']())+_0xf54e('0xbd')]=_0x5d5347[_0xf54e('0x73')]['ids'][_0x34b978];socket[_0xf54e('0xbe')]('user'+_[_0xf54e('0xbc')](_0x6e09bf[_0xf54e('0xb8')]())+_0xf54e('0xbf'),_0x484acd);}return _0x3da354;})[_0xf54e('0x21')](function(){if(_0x6e09bf===_0xf54e('0xc0')){return db[_0xf54e('0xc1')][_0xf54e('0x63')]({'where':{'id':_0x5d5347['body'][_0xf54e('0x77')]||[]},'raw':!![],'attributes':['id',_0xf54e('0x44')]});}})[_0xf54e('0x21')](function(_0x6d7a6b){var _0x3733f5=_0x54efa9['get']({'plain':!![]});var _0x41bb0e=[];if(_0x6e09bf===_0xf54e('0xc0')&&_0x3733f5[_0xf54e('0x43')]===_0xf54e('0x3d')&&_0x3733f5[_0xf54e('0xb5')]){for(var _0x2753fb=0x0;_0x2753fb<_0x6d7a6b['length'];_0x2753fb+=0x1){_0x41bb0e['push']({'membername':_0x3733f5['name'],'UserId':_0x3733f5['id'],'queue_name':_0x6d7a6b[_0x2753fb][_0xf54e('0x44')],'VoiceQueueId':_0x6d7a6b[_0x2753fb]['id'],'interface':_[_0xf54e('0x7e')](_0x3733f5[_0xf54e('0xb7')])?util[_0xf54e('0xc2')](_0xf54e('0xc3'),_0x3733f5['name']):_0x3733f5[_0xf54e('0xb7')],'paused':_0x3733f5[_0xf54e('0xc4')]||![],'penalty':_0x5d5347['body'][_0xf54e('0xba')]||0x0});}return BPromise[_0xf54e('0xa0')](_0x41bb0e,function(_0x3476cf){return db['UserVoiceQueueRt'][_0xf54e('0xc5')](_0x3476cf);});}return _0x54efa9;});}})[_0xf54e('0x21')](respondWithStatusCode(_0x391401,null))[_0xf54e('0x2c')](handleError(_0x391401,null));};exports[_0xf54e('0xc6')]=function(_0x711b1,_0xb217f2,_0x9936ea){var _0x370e59;return db['User'][_0xf54e('0x76')]({'where':{'id':_0x711b1['params']['id']},'attributes':['id',_0xf54e('0x44'),_0xf54e('0x43')]})[_0xf54e('0x21')](handleEntityNotFound(_0xb217f2,null))[_0xf54e('0x21')](function(_0x10086b){if(_0x10086b){_0x370e59=_0x10086b;if(!_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')]||!utils['isValidChannel'](_0x711b1['query']['channel'])){throw new db[(_0xf54e('0xa7'))]['ValidationError'](_0xf54e('0xc7'));}return _0x10086b['remove'+_[_0xf54e('0xbc')](_0x711b1[_0xf54e('0x50')]['channel'][_0xf54e('0xb8')]())+_0xf54e('0xb9')](_0x711b1[_0xf54e('0x50')][_0xf54e('0x77')]);}})[_0xf54e('0x21')](function(_0xfa9739){for(var _0x18ea44=0x0;_0x18ea44<_0x711b1[_0xf54e('0x50')][_0xf54e('0x77')][_0xf54e('0x55')];_0x18ea44+=0x1){var _0x3351a3={'UserId':_0x711b1['params']['id']};_0x3351a3[_[_0xf54e('0xbc')](_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')]['toLowerCase']())+_0xf54e('0xbd')]=_0x711b1['query'][_0xf54e('0x77')][_0x18ea44];socket[_0xf54e('0xbe')](_0xf54e('0x94')+_[_0xf54e('0xbc')](_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')][_0xf54e('0xb8')]())+_0xf54e('0xc8'),_0x3351a3);}return _0xfa9739;})[_0xf54e('0x21')](function(){if(_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')]==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x711b1[_0xf54e('0x6c')]['id'],'VoiceQueueId':_0x711b1[_0xf54e('0x50')][_0xf54e('0x77')]},'individualHooks':!![]})['then'](function(){return _0x370e59;});}return _0x370e59;})[_0xf54e('0x21')](respondWithStatusCode(_0xb217f2,null))[_0xf54e('0x2c')](handleError(_0xb217f2,null));};exports['addAvatar']=function(_0x405254,_0xc74621,_0x37aeab){_0x405254[_0xf54e('0x73')][_0xf54e('0xc9')]=_0x405254[_0xf54e('0xca')][_0xf54e('0xcb')];return db['User']['find']({'where':{'id':_0x405254[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xc74621,null))[_0xf54e('0x21')](saveUpdates(_0x405254[_0xf54e('0x73')],null))['then'](respondWithResult(_0xc74621,null))[_0xf54e('0x2c')](handleError(_0xc74621,null));};exports[_0xf54e('0xcc')]=function(_0x55d029,_0x2cf6c0,_0x5b02f5){var _0x38f94e=path[_0xf54e('0xcd')](config[_0xf54e('0xce')],_0xf54e('0xcf'));return db['User'][_0xf54e('0x76')]({'where':{'id':_0x55d029['params']['id']},'attributes':['id',_0xf54e('0xc9')],'raw':!![]})[_0xf54e('0x21')](handleEntityNotFound(_0x2cf6c0,null))[_0xf54e('0x21')](function(_0xd6cf23){if(_0xd6cf23){if(_['isNil'](_0xd6cf23['userpic'])){return _0x2cf6c0[_0xf54e('0xd0')](_0x38f94e);}else{if(!fs[_0xf54e('0xd1')](path[_0xf54e('0xcd')](config['root'],_0xf54e('0xd2'),_0xd6cf23[_0xf54e('0xc9')]))){return _0x2cf6c0['download'](_0x38f94e);}return _0x2cf6c0[_0xf54e('0xd0')](path[_0xf54e('0xcd')](config[_0xf54e('0xce')],_0xf54e('0xd2'),_0xd6cf23[_0xf54e('0xc9')]));}}})[_0xf54e('0x2c')](handleError(_0x2cf6c0,null));};exports['getOpenTabs']=function(_0x1bf4d5,_0x4479b8,_0x1674a4){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x1bf4d5[_0xf54e('0x6c')]['id']},'attributes':['id']})[_0xf54e('0x21')](handleEntityNotFound(_0x4479b8,null))[_0xf54e('0x21')](function(_0x22b526){var _0x37746a=[];values=_0x22b526[_0xf54e('0x69')];_0x37746a[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x68'),_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x6e'),_0x22b526[_0xf54e('0x69')]));_0x37746a['push'](get_open_tabs(_0xf54e('0x6a'),_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs('whatsapp',_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x6f'),_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs('mail',_0x22b526[_0xf54e('0x69')]));return BPromise['all'](_0x37746a);})[_0xf54e('0x21')](function(_0xa70512){var _0x505c0f=[];if(_0xa70512){for(var _0x560e97=0x0;_0x560e97=_0x576799){_0x3fd125=_0x576799;_0x21c144=0xc8;}else{_0x21c144=0xce;}_0x3ca593[_0x6aba('0x27')](_0x21c144);return _0x3ca593[_0x6aba('0x2d')](_0x6aba('0x2e'),_0x5d89aa+'-'+_0x3fd125+'/'+_0x576799)[_0x6aba('0x28')](_0x5eef59);}return null;};}function patchUpdates(_0x39c449){return function(_0x5cdf62){try{jsonpatch[_0x6aba('0x2f')](_0x5cdf62,_0x39c449,!![]);}catch(_0x205360){return BPromise[_0x6aba('0x30')](_0x205360);}return _0x5cdf62['save']();};}function saveUpdates(_0x1bfb80,_0x6e0941){return function(_0x31458f){if(_0x31458f){return _0x31458f['update'](_0x1bfb80)[_0x6aba('0x1c')](function(_0x2462ed){return _0x2462ed;});}return null;};}function removeEntity(_0x5a2594,_0x14a119){return function(_0x56ed97){if(_0x56ed97){return _0x56ed97[_0x6aba('0x31')]()['then'](function(){var _0x342a17=_0x56ed97[_0x6aba('0x32')]({'plain':!![]});if(_0x342a17['role']==='admin')return;var _0x2b2fc8=[{'name':'Users','value':_0x6aba('0x33'),'ignore':!![]},{'name':_0x6aba('0x34'),'value':'agent','ignore':![]},{'name':_0x6aba('0x35'),'value':_0x6aba('0x36'),'ignore':![]}];var _0x23d34a=_(_0x2b2fc8)[_0x6aba('0x37')](_0x6aba('0x38'))[_0x6aba('0x39')](_0x6aba('0x3a'))['value']();if(_['includes'](_0x23d34a,_0x342a17[_0x6aba('0x3b')])){return;}var _0x4880a3=_[_0x6aba('0x3c')](_0x2b2fc8,[_0x6aba('0x3a'),_0x342a17[_0x6aba('0x3b')]])['name'];return db[_0x6aba('0x3d')][_0x6aba('0x31')]({'where':{'type':_0x4880a3,'resourceId':_0x342a17['id']}})[_0x6aba('0x1c')](function(){return _0x56ed97;});})[_0x6aba('0x1c')](function(){_0x5a2594[_0x6aba('0x27')](0xcc)[_0x6aba('0x3e')]();});}};}function handleEntityNotFound(_0x7cc00c,_0x3c4a41){return function(_0x463713){if(!_0x463713){_0x7cc00c['sendStatus'](0x194);}return _0x463713;};}function handleError(_0x1d041e,_0x978dcc){_0x978dcc=_0x978dcc||0x1f4;return function(_0x3f4d29){logger[_0x6aba('0x21')](_0x3f4d29['stack']);if(_0x3f4d29[_0x6aba('0x3f')]){delete _0x3f4d29['name'];}_0x1d041e[_0x6aba('0x27')](_0x978dcc)['send'](_0x3f4d29);};}exports['index']=function(_0x4fc264,_0x339385){var _0x5a8b22={},_0x197f0f={},_0x3263a9={'count':0x0,'rows':[]};var _0x291983=_[_0x6aba('0x39')](db[_0x6aba('0x40')][_0x6aba('0x41')],function(_0x29aaa7){return{'name':_0x29aaa7['fieldName'],'type':_0x29aaa7[_0x6aba('0x42')][_0x6aba('0x43')]};});_0x197f0f[_0x6aba('0x44')]=_['differenceBy'](_['map'](_0x291983,_0x6aba('0x3f')),[_0x6aba('0x45'),_0x6aba('0x46')]);_0x197f0f[_0x6aba('0x47')]=_[_0x6aba('0x48')](_0x4fc264['query']);_0x197f0f[_0x6aba('0x49')]=_[_0x6aba('0x4a')](_0x197f0f[_0x6aba('0x44')],_0x197f0f[_0x6aba('0x47')]);_0x5a8b22[_0x6aba('0x4b')]=_[_0x6aba('0x4a')](_0x197f0f[_0x6aba('0x44')],qs['fields'](_0x4fc264[_0x6aba('0x47')][_0x6aba('0x4c')]));_0x5a8b22[_0x6aba('0x4b')]=_0x5a8b22[_0x6aba('0x4b')][_0x6aba('0x4d')]?_0x5a8b22[_0x6aba('0x4b')]:_0x197f0f['model'];if(!_0x4fc264[_0x6aba('0x47')]['hasOwnProperty']('nolimit')){_0x5a8b22[_0x6aba('0x2b')]=qs[_0x6aba('0x2b')](_0x4fc264[_0x6aba('0x47')][_0x6aba('0x2b')]);_0x5a8b22[_0x6aba('0x29')]=qs[_0x6aba('0x29')](_0x4fc264[_0x6aba('0x47')][_0x6aba('0x29')]);}_0x5a8b22[_0x6aba('0x4e')]=qs[_0x6aba('0x4f')](_0x4fc264['query'][_0x6aba('0x4f')]);_0x5a8b22[_0x6aba('0x50')]=qs[_0x6aba('0x49')](_[_0x6aba('0x51')](_0x4fc264[_0x6aba('0x47')],_0x197f0f[_0x6aba('0x49')]),_0x291983);if(_0x4fc264[_0x6aba('0x47')][_0x6aba('0x37')]){_0x5a8b22[_0x6aba('0x50')]=_[_0x6aba('0x52')](_0x5a8b22[_0x6aba('0x50')],{'$or':_[_0x6aba('0x39')](_0x291983,function(_0x3f7003){if(_0x3f7003['type']!==_0x6aba('0x53')){return db[_0x6aba('0x54')][_0x6aba('0x50')](db['sequelize']['fn'](_0x6aba('0x55'),db['sequelize']['col'](_0x3f7003[_0x6aba('0x3f')])),{'$like':db[_0x6aba('0x54')]['fn'](_0x6aba('0x55'),'%'+_0x4fc264['query'][_0x6aba('0x37')]+'%')});}})});}_0x5a8b22=_[_0x6aba('0x52')]({},_0x5a8b22,_0x4fc264[_0x6aba('0x56')]);var _0x39038f={'where':_0x5a8b22[_0x6aba('0x50')]};return db[_0x6aba('0x40')]['count'](_0x39038f)[_0x6aba('0x1c')](function(_0x1e2460){_0x3263a9['count']=_0x1e2460;if(_0x4fc264[_0x6aba('0x47')][_0x6aba('0x57')]){_0x5a8b22[_0x6aba('0x58')]=[{'all':!![]}];}if(!_[_0x6aba('0x59')](_0x5a8b22[_0x6aba('0x4b')],'id')){_0x5a8b22[_0x6aba('0x4b')]['push']('id');}return db['User'][_0x6aba('0x5a')](_0x5a8b22);})[_0x6aba('0x1c')](function(_0x4b67ca){_0x3263a9[_0x6aba('0x5b')]=_0x4b67ca;if(_0x4fc264[_0x6aba('0x47')]['openTabs']===_0x6aba('0x5c')){var _0x592cc5=[];for(var _0x59890c=0x0;_0x59890c<_0x3263a9[_0x6aba('0x5b')][_0x6aba('0x4d')];_0x59890c++){_0x592cc5['push'](get_open_tabs(_0x6aba('0x5d'),_0x3263a9[_0x6aba('0x5b')][_0x59890c][_0x6aba('0x5e')]));_0x592cc5[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x60'),_0x3263a9['rows'][_0x59890c]['dataValues']));_0x592cc5[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x61'),_0x3263a9['rows'][_0x59890c][_0x6aba('0x5e')]));_0x592cc5[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x62'),_0x3263a9[_0x6aba('0x5b')][_0x59890c][_0x6aba('0x5e')]));_0x592cc5[_0x6aba('0x5f')](get_open_tabs('openchannel',_0x3263a9[_0x6aba('0x5b')][_0x59890c][_0x6aba('0x5e')]));_0x592cc5[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x63'),_0x3263a9[_0x6aba('0x5b')][_0x59890c][_0x6aba('0x5e')]));}return BPromise[_0x6aba('0x64')](_0x592cc5)[_0x6aba('0x1c')](function(_0x385de8){return _0x3263a9;});}else{return _0x3263a9;}})[_0x6aba('0x1c')](respondWithFilteredResult(_0x339385,_0x5a8b22))[_0x6aba('0x25')](handleError(_0x339385,null));};exports[_0x6aba('0x65')]=function(_0x21a576,_0x2684bb){var _0x128027={'raw':![],'where':{'id':_0x21a576[_0x6aba('0x66')]['id']}},_0x4736c9={};_0x4736c9[_0x6aba('0x44')]=_['differenceBy'](_['keys'](db[_0x6aba('0x40')]['rawAttributes']),[_0x6aba('0x45'),_0x6aba('0x46')]);_0x4736c9[_0x6aba('0x47')]=_[_0x6aba('0x48')](_0x21a576[_0x6aba('0x47')]);_0x4736c9[_0x6aba('0x49')]=_[_0x6aba('0x4a')](_0x4736c9[_0x6aba('0x44')],_0x4736c9[_0x6aba('0x47')]);_0x128027['attributes']=_[_0x6aba('0x4a')](_0x4736c9[_0x6aba('0x44')],qs[_0x6aba('0x4c')](_0x21a576['query'][_0x6aba('0x4c')]));_0x128027[_0x6aba('0x4b')]=_0x128027['attributes'][_0x6aba('0x4d')]?_0x128027[_0x6aba('0x4b')]:_0x4736c9[_0x6aba('0x44')];if(_0x21a576[_0x6aba('0x47')][_0x6aba('0x57')]){_0x128027[_0x6aba('0x58')]=[{'all':!![]}];}_0x128027=_['merge']({},_0x128027,_0x21a576[_0x6aba('0x56')]);if(!_[_0x6aba('0x59')](_0x128027['attributes'],'id')){_0x128027[_0x6aba('0x4b')][_0x6aba('0x5f')]('id');}return db['User'][_0x6aba('0x3c')](_0x128027)[_0x6aba('0x1c')](handleEntityNotFound(_0x2684bb,null))['then'](function(_0xf6de1f){var _0x3e37df=[];values=_0xf6de1f;if(_0x21a576['query'][_0x6aba('0x67')]===_0x6aba('0x5c')){_0x3e37df[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x5d'),_0xf6de1f[_0x6aba('0x5e')]));_0x3e37df[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x60'),_0xf6de1f[_0x6aba('0x5e')]));_0x3e37df['push'](get_open_tabs('openchannel',_0xf6de1f[_0x6aba('0x5e')]));_0x3e37df[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x63'),_0xf6de1f[_0x6aba('0x5e')]));_0x3e37df[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x61'),_0xf6de1f[_0x6aba('0x5e')]));_0x3e37df[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x62'),_0xf6de1f[_0x6aba('0x5e')]));return BPromise[_0x6aba('0x64')](_0x3e37df);}else{return values;}})['then'](function(_0x1faedb){return values;})[_0x6aba('0x1c')](respondWithResult(_0x2684bb,null))[_0x6aba('0x25')](handleError(_0x2684bb,null));};exports[_0x6aba('0x68')]=function(_0x469cb1,_0x1205d7){if(_0x469cb1[_0x6aba('0x69')]['id']){delete _0x469cb1[_0x6aba('0x69')]['id'];}delete _0x469cb1[_0x6aba('0x69')]['role'];return db['User'][_0x6aba('0x3c')]({'where':{'id':_0x469cb1['params']['id']}})['then'](handleEntityNotFound(_0x1205d7,null))[_0x6aba('0x1c')](saveUpdates(_0x469cb1[_0x6aba('0x69')],null))[_0x6aba('0x1c')](respondWithResult(_0x1205d7,null))[_0x6aba('0x25')](handleError(_0x1205d7,null));};exports[_0x6aba('0x6a')]=function(_0x1c9860,_0x421699){return db[_0x6aba('0x40')][_0x6aba('0x6a')]()[_0x6aba('0x1c')](respondWithResult(_0x421699,null))[_0x6aba('0x25')](handleError(_0x421699,null));};exports[_0x6aba('0x6b')]=function(_0x48ed73,_0x2db15d,_0x278587){return db['User'][_0x6aba('0x3c')]({'where':{'id':_0x48ed73[_0x6aba('0x66')]['id']}})[_0x6aba('0x1c')](handleEntityNotFound(_0x2db15d,null))['then'](function(_0x34e70c){if(_0x34e70c){return _0x34e70c['addContacts'](_0x48ed73['body']['ids'],_[_0x6aba('0x6c')](_0x48ed73[_0x6aba('0x69')],[_0x6aba('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x2db15d,null))[_0x6aba('0x25')](handleError(_0x2db15d,null));};function validateUser(_0x3b6a30){return new BPromise(function(_0x475a7a,_0xccdaee){if(_0x3b6a30[_0x6aba('0x6e')])return _0x475a7a(_0x3b6a30);return db['Setting']['findById'](0x1)[_0x6aba('0x1c')](function(_0x4d0a92){if(_0x4d0a92[_0x6aba('0x6f')])authService[_0x6aba('0x70')](_0x3b6a30[_0x6aba('0x45')]);db[_0x6aba('0x40')][_0x6aba('0x71')](_0x6aba('0x6e'))[_0x6aba('0x1c')](function(_0x3327a6){if(_[_0x6aba('0x72')](_0x3327a6)){_0x3b6a30['internal']=_0x4d0a92[_0x6aba('0x73')]||0x1;return;}if(_[_0x6aba('0x72')](_0x4d0a92[_0x6aba('0x73')])||_0x4d0a92['min_internal']===_0x3327a6){_0x3b6a30[_0x6aba('0x6e')]=_0x3327a6+0x1;return;}if(_0x4d0a92['min_internal']>_0x3327a6){_0x3b6a30[_0x6aba('0x6e')]=_0x4d0a92[_0x6aba('0x73')];return;}return db['sequelize'][_0x6aba('0x47')](_0x6aba('0x74'),{'type':db[_0x6aba('0x54')][_0x6aba('0x75')][_0x6aba('0x76')]})['then'](function(_0x216dda){if(_0x216dda&&_0x216dda[_0x6aba('0x4d')]){for(var _0x23c567=0x0,_0x6d1543=_0x216dda['length'];_0x23c567<_0x6d1543&&_[_0x6aba('0x72')](_0x3b6a30[_0x6aba('0x6e')]);_0x23c567++){if(_0x4d0a92['min_internal']<=_0x216dda[_0x23c567][_0x6aba('0x77')]){_0x3b6a30[_0x6aba('0x6e')]=_0x216dda[_0x23c567][_0x6aba('0x77')];}else if(_0x4d0a92[_0x6aba('0x73')]>_0x216dda[_0x23c567][_0x6aba('0x77')]&&_0x4d0a92[_0x6aba('0x73')]<=_0x216dda[_0x23c567]['to']){_0x3b6a30['internal']=_0x4d0a92[_0x6aba('0x73')];}}}if(_[_0x6aba('0x72')](_0x3b6a30[_0x6aba('0x6e')])){_0x3b6a30[_0x6aba('0x6e')]=_0x3327a6+0x1;}return _0x475a7a(_0x3b6a30);});});})[_0x6aba('0x25')](function(_0x4d8897){_0xccdaee(_0x4d8897);});});}function updateUser(_0x2052f4){return new BPromise(function(_0x40fa05,_0x3b4924){try{if(_0x2052f4[_0x6aba('0x78')]){_0x2052f4[_0x6aba('0x79')]=_0x2052f4[_0x6aba('0x6e')];_0x2052f4[_0x6aba('0x7a')]={'mailbox':_0x2052f4[_0x6aba('0x6e')],'password':_0x2052f4[_0x6aba('0x45')],'fullname':_0x2052f4['fullname'],'email':_0x2052f4[_0x6aba('0x7b')]};}if(_0x2052f4[_0x6aba('0x3b')]===_0x6aba('0x7c')){if(!_0x2052f4[_0x6aba('0x7d')])_0x2052f4[_0x6aba('0x7d')]=[_0x6aba('0x7e'),_0x6aba('0x7f'),'103','113',_0x6aba('0x80'),_0x6aba('0x81'),_0x6aba('0x82'),_0x6aba('0x83'),_0x6aba('0x84'),_0x6aba('0x85'),_0x6aba('0x86'),_0x6aba('0x87'),_0x6aba('0x88'),_0x6aba('0x89'),_0x6aba('0x8a')];}_0x40fa05(_0x2052f4);}catch(_0x23636e){_0x3b4924(_0x23636e);}});}exports[_0x6aba('0x8b')]=function(_0x328a8b,_0xabce7b){if(_0x328a8b[_0x6aba('0x33')][_0x6aba('0x3b')]===_0x6aba('0x7c'))throw new Error('Unauthorized');if(_0x328a8b[_0x6aba('0x69')][_0x6aba('0x3b')]===_0x6aba('0x33')&&_0x328a8b[_0x6aba('0x33')]['role']!==_0x6aba('0x8c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x328a8b[_0x6aba('0x69')][_0x6aba('0x3b')]===_0x6aba('0x8c')&&_0x328a8b['user'][_0x6aba('0x3b')]!==_0x6aba('0x8c')){throw new Error(_0x6aba('0x8d'));}return licenseUtil['checkUserLimits']([_0x328a8b[_0x6aba('0x69')]])[_0x6aba('0x1c')](function(){return validateUser(_0x328a8b['body']);})[_0x6aba('0x1c')](function(_0x202adf){return updateUser(_0x202adf)[_0x6aba('0x1c')](function(_0x276a2f){if(_0x276a2f['role']===_0x6aba('0x8c')){_0x276a2f['settingsEnabled']=_0x328a8b['user'][_0x6aba('0x8e')];delete _0x276a2f[_0x6aba('0x8f')];}return _0x276a2f;});})['then'](function(_0x30affe){return db['User']['create'](_0x30affe,{'include':[{'model':db[_0x6aba('0x7a')],'as':'VoiceMail'}]});})[_0x6aba('0x1c')](function(_0x1fc80c){if(_0x328a8b[_0x6aba('0x69')][_0x6aba('0x3b')]==='user')return _0x1fc80c;if(_0x328a8b['user'][_0x6aba('0x3b')]!==_0x6aba('0x33'))return _0x1fc80c;return db[_0x6aba('0x90')]['find']({'where':{'name':_0x1fc80c[_0x6aba('0x3b')]===_0x6aba('0x7c')?_0x6aba('0x34'):_0x6aba('0x35'),'userProfileId':_0x328a8b['user']['userProfileId']},'raw':!![]})[_0x6aba('0x1c')](function(_0x2cb549){if(!_0x2cb549||_0x2cb549[_0x6aba('0x91')]!=0x0)return _0x1fc80c;return db[_0x6aba('0x3d')][_0x6aba('0x8b')]({'name':_0x1fc80c[_0x6aba('0x3f')],'resourceId':_0x1fc80c['id'],'type':_0x2cb549[_0x6aba('0x3f')],'sectionId':_0x2cb549['id']},{})['then'](function(){return _0x1fc80c;});})[_0x6aba('0x25')](function(_0x1f98ac){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f98ac);throw _0x1f98ac;});})['then'](respondWithResult(_0xabce7b,0xc9))[_0x6aba('0x25')](handleError(_0xabce7b,null));};exports[_0x6aba('0x92')]=function(_0xc73ce5,_0x37d04a){var _0x5754ed=_0xc73ce5['body'];var _0xf92c11=[];if(_0xc73ce5[_0x6aba('0x33')][_0x6aba('0x3b')]===_0x6aba('0x7c'))throw new Error(_0x6aba('0x93'));if(_[_0x6aba('0x94')](_0x5754ed,[_0x6aba('0x3b'),_0x6aba('0x33')])&&_0xc73ce5[_0x6aba('0x33')][_0x6aba('0x3b')]!==_0x6aba('0x8c')){throw new Error(_0x6aba('0x95'));}if(_['some'](_0x5754ed,[_0x6aba('0x3b'),'admin'])&&_0xc73ce5[_0x6aba('0x33')][_0x6aba('0x3b')]!==_0x6aba('0x8c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x6aba('0x96')](_0x5754ed)[_0x6aba('0x1c')](function(){return validateUser(_0x5754ed[0x0]);})[_0x6aba('0x1c')](function(){for(var _0x51806c=0x1;_0x51806c<_0x5754ed[_0x6aba('0x4d')];_0x51806c++){var _0x3e639c=_0x5754ed[_0x51806c-0x1][_0x6aba('0x6e')];if(!_0x5754ed[_0x51806c]['internal'])_0x5754ed[_0x51806c][_0x6aba('0x6e')]=_0x3e639c+0x1;_0xf92c11[_0x6aba('0x5f')](validateUser(_0x5754ed[_0x51806c]));}return BPromise[_0x6aba('0x64')](_0xf92c11);})[_0x6aba('0x1c')](function(){_0xf92c11=[];for(var _0x27d3e4=0x0;_0x27d3e4<_0x5754ed[_0x6aba('0x4d')];_0x27d3e4++){_0xf92c11[_0x6aba('0x5f')](updateUser(_0x5754ed[_0x27d3e4]));}return BPromise[_0x6aba('0x64')](_0xf92c11);})['then'](function(){return BPromise[_0x6aba('0x97')](_0x5754ed,function(_0x55e0d8){return db[_0x6aba('0x40')][_0x6aba('0x8b')](_0x55e0d8,{'include':[{'model':db[_0x6aba('0x7a')],'as':_0x6aba('0x7a')}]})[_0x6aba('0x1c')](function(_0x4078b6){_0x55e0d8['id']=_0x4078b6['id'];return _0x55e0d8;});});})[_0x6aba('0x1c')](function(_0x44c837){if(_0xc73ce5[_0x6aba('0x69')][_0x6aba('0x3b')]===_0x6aba('0x33'))return _0x44c837;if(_0xc73ce5['user'][_0x6aba('0x3b')]!==_0x6aba('0x33'))return _0x44c837;var _0xf0771e=_[_0x6aba('0x94')](_0x44c837,function(_0x123788){return _0x123788[_0x6aba('0x3b')]===_0x6aba('0x7c')||_0x123788[_0x6aba('0x3b')]===_0x6aba('0x36');});if(!_0xf0771e)return _0x44c837;return db[_0x6aba('0x90')][_0x6aba('0x5a')]({'where':{'name':{'$or':[_0x6aba('0x34'),_0x6aba('0x35')]},'userProfileId':_0xc73ce5[_0x6aba('0x33')][_0x6aba('0x8f')]},'raw':!![]})[_0x6aba('0x1c')](function(_0x8ccaa5){if(_[_0x6aba('0x98')](_0x8ccaa5)||!_['some'](_0x8ccaa5,[_0x6aba('0x91'),0x0]))return _0x44c837;_0xf92c11=[];var _0x3c5a45=_(_0x8ccaa5)[_0x6aba('0x39')](function(_0x5019c9){if(_0x5019c9[_0x6aba('0x91')]===0x1)return;return _0x5019c9['name']===_0x6aba('0x34')?'agent':_0x6aba('0x36');})['compact']()['value']();for(var _0x560529=0x0;_0x560529<_0x44c837[_0x6aba('0x4d')];_0x560529++){if(!_['includes'](_0x3c5a45,_0x44c837[_0x560529]['role']))return;var _0x2731c0=_0x44c837[_0x560529]['role']===_0x6aba('0x7c')?_0x6aba('0x34'):'Telephones';_0xf92c11[_0x6aba('0x5f')](db[_0x6aba('0x3d')]['create']({'name':_0x44c837[_0x560529][_0x6aba('0x3f')],'resourceId':_0x44c837[_0x560529]['id'],'type':_0x2731c0,'sectionId':_['find'](_0x8ccaa5,[_0x6aba('0x3f'),_0x2731c0])['id']},{}));}return BPromise['all'](_0xf92c11);});})['then'](respondWithResult(_0x37d04a,0xc9))[_0x6aba('0x25')](handleError(_0x37d04a,null));};exports[_0x6aba('0x99')]=function(_0x516a18,_0x21b17b,_0x3063d0){if(_0x516a18[_0x6aba('0x69')]['id']){delete _0x516a18['body']['id'];}return db[_0x6aba('0x40')][_0x6aba('0x3c')]({'where':{'id':_0x516a18[_0x6aba('0x66')]['id']}})[_0x6aba('0x1c')](function(_0xc4dc85){if(!_0xc4dc85)return null;if(_0xc4dc85['id']===_0x516a18[_0x6aba('0x33')]['id']){if(!_0x516a18[_0x6aba('0x69')][_0x6aba('0x9a')]||!_0x516a18[_0x6aba('0x69')][_0x6aba('0x9b')]){throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xc4dc85[_0x6aba('0x9e')](_0x516a18[_0x6aba('0x69')]['oldPassword'])){throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))](_0x6aba('0x9f'));}if(_0x516a18['body']['oldPassword']===_0x516a18[_0x6aba('0x69')][_0x6aba('0x9b')]){throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))](_0x6aba('0xa0'));}}else if(_0x516a18[_0x6aba('0x33')][_0x6aba('0x3b')]===_0x6aba('0x8c')){if(!_0x516a18[_0x6aba('0x69')][_0x6aba('0x9b')]){throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))](_0x6aba('0xa1'));}}else if(_0x516a18['user'][_0x6aba('0x3b')]===_0x6aba('0x33')){if(!_0x516a18[_0x6aba('0x69')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x6aba('0xa1'));}if(_0xc4dc85[_0x6aba('0x3b')]!==_0x6aba('0x7c')){throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))]('Unauthorized');}}else{throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))]('Unauthorized');}return _0xc4dc85;})[_0x6aba('0x1c')](handleEntityNotFound(_0x21b17b,null))['then'](function(_0x42ab5f){return db[_0x6aba('0xa2')]['findOne']({'attributes':['id','securePassword',_0x6aba('0xa3'),_0x6aba('0xa4')]})[_0x6aba('0x1c')](function(_0x3895a6){if(_0x3895a6['securePassword'])authService[_0x6aba('0x70')](_0x516a18[_0x6aba('0x69')]['newPassword']);if(!_0x3895a6[_0x6aba('0xa3')]||!_0x42ab5f[_0x6aba('0xa5')])return _0x42ab5f;authService[_0x6aba('0xa6')](_0x516a18[_0x6aba('0x69')][_0x6aba('0x9b')],_0x42ab5f[_0x6aba('0xa5')],_0x3895a6[_0x6aba('0xa4')]);return _0x42ab5f;})[_0x6aba('0x1c')](saveUpdates({'password':_0x516a18['body'][_0x6aba('0x9b')],'passwordResetAt':_0x516a18[_0x6aba('0x33')]['id']==_0x516a18[_0x6aba('0x66')]['id']?moment():null,'previousPasswords':authService[_0x6aba('0xa7')](_0x516a18['body'][_0x6aba('0x9b')],_0x42ab5f[_0x6aba('0xa5')])},null));})['then'](respondWithResult(_0x21b17b,null))['catch'](handleError(_0x21b17b,null));};exports[_0x6aba('0xa8')]=function(_0x3c6711,_0x259ef9,_0x2b989a){var _0x4209d1=_0x3c6711[_0x6aba('0x69')][_0x6aba('0xa9')];return db[_0x6aba('0x40')]['find']({'where':{'id':_0x3c6711['params']['id']},'attributes':['id',_0x6aba('0x3f'),_0x6aba('0x3b'),_0x6aba('0xaa'),'loginInPause',_0x6aba('0xab'),_0x6aba('0xac')]})[_0x6aba('0x1c')](handleEntityNotFound(_0x259ef9,null))[_0x6aba('0x1c')](function(_0x4d7b61){if(_0x4d7b61){if(!utils[_0x6aba('0xad')](_0x4209d1)){throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))](_0x6aba('0xae'));}return _0x4d7b61[_0x6aba('0xaf')+_[_0x6aba('0xb0')](_0x4209d1['toLowerCase']())+_0x6aba('0xb1')](_0x3c6711['body'][_0x6aba('0x6d')],{'penalty':_0x3c6711['body'][_0x6aba('0xb2')]||0x0})[_0x6aba('0xb3')](function(_0x46cfd8){for(var _0x6bcdd4=0x0;_0x6bcdd4<_0x3c6711[_0x6aba('0x69')][_0x6aba('0x6d')][_0x6aba('0x4d')];_0x6bcdd4+=0x1){var _0x2969d9={'UserId':_0x3c6711[_0x6aba('0x66')]['id']};_0x2969d9[_[_0x6aba('0xb0')](_0x4209d1[_0x6aba('0xb4')]())+'QueueId']=_0x3c6711[_0x6aba('0x69')][_0x6aba('0x6d')][_0x6bcdd4];socket[_0x6aba('0xb5')](_0x6aba('0x33')+_[_0x6aba('0xb0')](_0x4209d1['toLowerCase']())+'Queue:save',_0x2969d9);}return _0x46cfd8;})[_0x6aba('0x1c')](function(){if(_0x4209d1===_0x6aba('0xb6')){return db[_0x6aba('0xb7')][_0x6aba('0x5a')]({'where':{'id':_0x3c6711[_0x6aba('0x69')][_0x6aba('0x6d')]||[]},'raw':!![],'attributes':['id',_0x6aba('0x3f')]});}})['then'](function(_0x63aff){var _0x45d923=_0x4d7b61[_0x6aba('0x32')]({'plain':!![]});var _0xc788f=[];if(_0x4209d1===_0x6aba('0xb6')&&_0x45d923[_0x6aba('0x3b')]===_0x6aba('0x7c')&&_0x45d923[_0x6aba('0xaa')]){for(var _0x1740f4=0x0;_0x1740f4<_0x63aff[_0x6aba('0x4d')];_0x1740f4+=0x1){_0xc788f[_0x6aba('0x5f')]({'membername':_0x45d923[_0x6aba('0x3f')],'UserId':_0x45d923['id'],'queue_name':_0x63aff[_0x1740f4][_0x6aba('0x3f')],'VoiceQueueId':_0x63aff[_0x1740f4]['id'],'interface':_[_0x6aba('0x72')](_0x45d923[_0x6aba('0xac')])?util[_0x6aba('0xb8')](_0x6aba('0xb9'),_0x45d923[_0x6aba('0x3f')]):_0x45d923[_0x6aba('0xac')],'paused':_0x45d923[_0x6aba('0xab')]||![],'penalty':_0x3c6711[_0x6aba('0x69')]['penalty']||0x0});}return BPromise['each'](_0xc788f,function(_0x4cc914){return db[_0x6aba('0xba')][_0x6aba('0xbb')](_0x4cc914);});}return _0x4d7b61;});}})[_0x6aba('0x1c')](respondWithStatusCode(_0x259ef9,null))['catch'](handleError(_0x259ef9,null));};exports['removeQueues']=function(_0x57565a,_0x406a77,_0x3a3200){var _0x178b10;return db[_0x6aba('0x40')][_0x6aba('0x3c')]({'where':{'id':_0x57565a[_0x6aba('0x66')]['id']},'attributes':['id',_0x6aba('0x3f'),'role']})['then'](handleEntityNotFound(_0x406a77,null))[_0x6aba('0x1c')](function(_0x257d1a){if(_0x257d1a){_0x178b10=_0x257d1a;if(!_0x57565a[_0x6aba('0x47')][_0x6aba('0xa9')]||!utils[_0x6aba('0xad')](_0x57565a['query'][_0x6aba('0xa9')])){throw new db[(_0x6aba('0x9c'))][(_0x6aba('0x9d'))](_0x6aba('0xae'));}return _0x257d1a[_0x6aba('0xbc')+_[_0x6aba('0xb0')](_0x57565a['query']['channel'][_0x6aba('0xb4')]())+_0x6aba('0xb1')](_0x57565a['query'][_0x6aba('0x6d')]);}})['then'](function(_0x36d121){for(var _0xec5485=0x0;_0xec5485<_0x57565a[_0x6aba('0x47')][_0x6aba('0x6d')]['length'];_0xec5485+=0x1){var _0x4e3308={'UserId':_0x57565a[_0x6aba('0x66')]['id']};_0x4e3308[_[_0x6aba('0xb0')](_0x57565a[_0x6aba('0x47')]['channel'][_0x6aba('0xb4')]())+_0x6aba('0xbd')]=_0x57565a[_0x6aba('0x47')][_0x6aba('0x6d')][_0xec5485];socket[_0x6aba('0xb5')](_0x6aba('0x33')+_['capitalize'](_0x57565a['query']['channel']['toLowerCase']())+'Queue:remove',_0x4e3308);}return _0x36d121;})[_0x6aba('0x1c')](function(){if(_0x57565a[_0x6aba('0x47')][_0x6aba('0xa9')]===_0x6aba('0xb6')){return db[_0x6aba('0xba')]['destroy']({'where':{'UserId':_0x57565a['params']['id'],'VoiceQueueId':_0x57565a[_0x6aba('0x47')][_0x6aba('0x6d')]},'individualHooks':!![]})[_0x6aba('0x1c')](function(){return _0x178b10;});}return _0x178b10;})['then'](respondWithStatusCode(_0x406a77,null))[_0x6aba('0x25')](handleError(_0x406a77,null));};exports[_0x6aba('0xbe')]=function(_0x4ea40f,_0x429791,_0x114531){_0x4ea40f[_0x6aba('0x69')][_0x6aba('0xbf')]=_0x4ea40f[_0x6aba('0xc0')]['filename'];return db['User']['find']({'where':{'id':_0x4ea40f[_0x6aba('0x66')]['id']}})[_0x6aba('0x1c')](handleEntityNotFound(_0x429791,null))[_0x6aba('0x1c')](saveUpdates(_0x4ea40f[_0x6aba('0x69')],null))[_0x6aba('0x1c')](respondWithResult(_0x429791,null))[_0x6aba('0x25')](handleError(_0x429791,null));};exports[_0x6aba('0xc1')]=function(_0x74fc95,_0x1d8842,_0x508dd9){var _0x13ef19=path[_0x6aba('0xc2')](config['root'],_0x6aba('0xc3'));return db[_0x6aba('0x40')][_0x6aba('0x3c')]({'where':{'id':_0x74fc95[_0x6aba('0x66')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x1d8842,null))[_0x6aba('0x1c')](function(_0x341fde){if(_0x341fde){if(_['isNil'](_0x341fde[_0x6aba('0xbf')])){return _0x1d8842['download'](_0x13ef19);}else{if(!fs[_0x6aba('0xc4')](path[_0x6aba('0xc2')](config[_0x6aba('0xc5')],_0x6aba('0xc6'),_0x341fde['userpic']))){return _0x1d8842[_0x6aba('0xc7')](_0x13ef19);}return _0x1d8842[_0x6aba('0xc7')](path[_0x6aba('0xc2')](config[_0x6aba('0xc5')],_0x6aba('0xc6'),_0x341fde['userpic']));}}})[_0x6aba('0x25')](handleError(_0x1d8842,null));};exports['getOpenTabs']=function(_0xf85bb8,_0x1a22eb,_0x54261d){return db['User']['find']({'where':{'id':_0xf85bb8[_0x6aba('0x66')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x1a22eb,null))[_0x6aba('0x1c')](function(_0x2eb6f7){var _0x392124=[];values=_0x2eb6f7['dataValues'];_0x392124[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x5d'),_0x2eb6f7[_0x6aba('0x5e')]));_0x392124[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x60'),_0x2eb6f7['dataValues']));_0x392124['push'](get_open_tabs('openchannel',_0x2eb6f7['dataValues']));_0x392124[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x63'),_0x2eb6f7['dataValues']));_0x392124['push'](get_open_tabs(_0x6aba('0x61'),_0x2eb6f7[_0x6aba('0x5e')]));_0x392124[_0x6aba('0x5f')](get_open_tabs(_0x6aba('0x62'),_0x2eb6f7[_0x6aba('0x5e')]));return BPromise[_0x6aba('0x64')](_0x392124);})[_0x6aba('0x1c')](function(_0xd47c90){var _0x262a96=[];if(_0xd47c90){for(var _0x436d62=0x0;_0x436d62=_0x48c784[_0x9dcf('0x53')]){throw new Error(_0x9dcf('0x54'));}})[_0x9dcf('0x13')](function(){if(_0x103355){return db[_0x9dcf('0x42')][_0x9dcf('0x4b')]({'where':{'membername':_0x103355['name']},'individualHooks':!![]});}})[_0x9dcf('0x13')](function(){if(_0x103355){return _0x103355['getVoiceQueues']({'raw':!![]});}})[_0x9dcf('0x13')](function(_0x439f4d){if(_0x103355){if(_0x439f4d){var _0x81a118=[];_0x5cfaef=_0x439f4d;if(_0x5cfaef[_0x9dcf('0x31')]){for(var _0xd5152e=0x0;_0xd5152e<_0x5cfaef[_0x9dcf('0x31')];_0xd5152e++){_0x81a118[_0x9dcf('0x36')](db[_0x9dcf('0x42')]['upsert']({'membername':_0x103355[_0x9dcf('0x2f')],'UserId':_0x103355['id'],'queue_name':_0x5cfaef[_0xd5152e][_0x9dcf('0x2f')],'VoiceQueueId':_0x5cfaef[_0xd5152e]['id'],'interface':_0xdce94f,'paused':_0x103355['loginInPause']||![],'penalty':_0x5cfaef[_0xd5152e][_0x9dcf('0x55')]||0x0}));}return BPromise[_0x9dcf('0x49')](_0x81a118);}}}})[_0x9dcf('0x13')](function(){if(_0x103355){return db[_0x9dcf('0x2e')]['findAll']({'where':{'membername':_0x103355[_0x9dcf('0x2f')],'exitAt':null}});}})[_0x9dcf('0x13')](function(_0xbd07d1){if(_0x103355){if(_0xbd07d1&&_0xbd07d1[_0x9dcf('0x31')]){var _0x333f8d=[];_0xbd07d1['forEach'](function(_0xdcfba9){_0x333f8d['push'](_0xdcfba9['update']({'exitAt':moment()['format'](_0x9dcf('0x33'))}));});return BPromise[_0x9dcf('0x49')](_0x333f8d);}}})[_0x9dcf('0x13')](function(_0x3921a7){if(_0x103355){var _0x3bb99c=[];var _0x32efe3=[];var _0x145e0d=utils[_0x9dcf('0x34')]();var _0x323f0a={'membername':_0x103355[_0x9dcf('0x2f')],'interface':_0xdce94f,'enterAt':moment()[_0x9dcf('0x32')](_0x9dcf('0x33')),'role':_0x103355[_0x9dcf('0x2b')],'internal':_0x103355['internal']};_0x145e0d[_0x9dcf('0x35')](function(_0x3518e8){_0x3bb99c[_0x9dcf('0x36')](_[_0x9dcf('0x56')]({'channel':_0x3518e8,'type':_0x9dcf('0x57'),'data1':_0x9dcf('0x58'),'data2':_0xdce94f},_0x323f0a));if(_0x103355[_0x9dcf('0x4f')]){_0x32efe3['push'](_[_0x9dcf('0x56')]({'channel':_0x3518e8,'type':'PAUSE','data1':'LOGININPAUSE'},_0x323f0a));}});return db[_0x9dcf('0x2e')][_0x9dcf('0x3b')](_0x3bb99c[_0x9dcf('0x59')](_0x32efe3),{'individualHooks':!![]});}})['then'](function(){if(_0x103355){return _0x103355[_0x9dcf('0x43')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x103355[_0x9dcf('0x4f')]||![],'mailPause':_0x103355[_0x9dcf('0x4f')]||![],'chatPause':_0x103355[_0x9dcf('0x4f')]||![],'faxPause':_0x103355[_0x9dcf('0x4f')]||![],'smsPause':_0x103355[_0x9dcf('0x4f')]||![],'openchannelPause':_0x103355['loginInPause']||![],'pauseType':_0x103355[_0x9dcf('0x4f')]?_0x9dcf('0x5a'):null,'lastPauseAt':moment()[_0x9dcf('0x32')](_0x9dcf('0x33')),'interface':_0xdce94f});}})[_0x9dcf('0x13')](function(_0x56bc41){_0x56ff38(_0x56bc41);})[_0x9dcf('0x1c')](function(_0x30dacb){_0x34f4b5(_0x170a73[_0x9dcf('0x17')](0x1f4,_0x30dacb[_0x9dcf('0x19')]));});});}; \ No newline at end of file +var _0x61e9=['YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','type','DEFAULT\x20PAUSE','body','uniqueid','MemberReport','bulkCreate','UnpauseUser','findOne','isValidChannel','channel','Unknown\x20channel','UserVoiceQueueRt','system','fax','sms','openchannel','%s%s','LogoutUser','destroy','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','LOGIN','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetUser','User','findAll','raw','options','where','attributes','limit','include','map','model','find','ShowUser','PauseUser','role','internal','interface','update','name','PAUSE','length','format'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x61e9,0x81));var _0x961e=function(_0x25aa69,_0x176997){_0x25aa69=_0x25aa69-0x0;var _0x13da37=_0x61e9[_0x25aa69];return _0x13da37;};'use strict';var _=require(_0x961e('0x0'));var util=require(_0x961e('0x1'));var moment=require(_0x961e('0x2'));var BPromise=require(_0x961e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x961e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x961e('0x5'));var logger=require('../../config/logger')(_0x961e('0x6'));var config=require(_0x961e('0x7'));var jayson=require(_0x961e('0x8'));var client=jayson[_0x961e('0x9')][_0x961e('0xa')]({'port':0x232a});config[_0x961e('0xb')]=_[_0x961e('0xc')](config[_0x961e('0xb')],{'host':_0x961e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x961e('0xe'))[_0x961e('0xf')](socket);function respondWithRpcPromise(_0x6d3b44,_0x2c95fa,_0x4f4af8){return new BPromise(function(_0x2f7a71,_0x9de97d){return client[_0x961e('0x10')](_0x6d3b44,_0x4f4af8)[_0x961e('0x11')](function(_0x127314){logger[_0x961e('0x12')](_0x961e('0x13'),_0x2c95fa,_0x961e('0x14'));logger[_0x961e('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x2c95fa,_0x961e('0x14'),JSON[_0x961e('0x16')](_0x127314));if(_0x127314[_0x961e('0x17')]){if(_0x127314['error']['code']===0x1f4){logger[_0x961e('0x17')](_0x961e('0x13'),_0x2c95fa,_0x127314[_0x961e('0x17')][_0x961e('0x18')]);return _0x9de97d(_0x127314[_0x961e('0x17')][_0x961e('0x18')]);}logger[_0x961e('0x17')]('User,\x20%s,\x20%s',_0x2c95fa,_0x127314[_0x961e('0x17')]['message']);return _0x2f7a71(_0x127314[_0x961e('0x17')]['message']);}else{logger[_0x961e('0x12')](_0x961e('0x13'),_0x2c95fa,_0x961e('0x14'));_0x2f7a71(_0x127314[_0x961e('0x19')]['message']);}})[_0x961e('0x1a')](function(_0x1a74e0){logger[_0x961e('0x17')]('User,\x20%s,\x20%s',_0x2c95fa,_0x1a74e0);_0x9de97d(_0x1a74e0);});});}exports[_0x961e('0x1b')]=function(_0x176c84){var _0x27e4e5=this;return new Promise(function(_0x566157,_0x56f6d2){return db[_0x961e('0x1c')][_0x961e('0x1d')]({'raw':_0x176c84['options']?_0x176c84['options'][_0x961e('0x1e')]===undefined?!![]:![]:!![],'where':_0x176c84[_0x961e('0x1f')]?_0x176c84['options'][_0x961e('0x20')]||null:null,'attributes':_0x176c84['options']?_0x176c84[_0x961e('0x1f')][_0x961e('0x21')]||null:null,'limit':_0x176c84[_0x961e('0x1f')]?_0x176c84[_0x961e('0x1f')][_0x961e('0x22')]||null:null,'include':_0x176c84[_0x961e('0x1f')]?_0x176c84['options'][_0x961e('0x23')]?_[_0x961e('0x24')](_0x176c84[_0x961e('0x1f')][_0x961e('0x23')],function(_0x189c00){return{'model':db[_0x189c00[_0x961e('0x25')]],'as':_0x189c00['as'],'attributes':_0x189c00['attributes'],'include':_0x189c00[_0x961e('0x23')]?_['map'](_0x189c00['include'],function(_0x46d844){return{'model':db[_0x46d844[_0x961e('0x25')]],'as':_0x46d844['as'],'attributes':_0x46d844[_0x961e('0x21')],'include':_0x46d844['include']?_['map'](_0x46d844['include'],function(_0x3ca02c){return{'model':db[_0x3ca02c[_0x961e('0x25')]],'as':_0x3ca02c['as'],'attributes':_0x3ca02c['attributes']};}):[]};}):[]};}):[]:[]})[_0x961e('0x11')](function(_0x43aade){logger[_0x961e('0x12')](_0x961e('0x1b'),_0x176c84);logger[_0x961e('0x15')](_0x961e('0x1b'),_0x176c84,JSON[_0x961e('0x16')](_0x43aade));_0x566157(_0x43aade);})['catch'](function(_0x2eea85){logger[_0x961e('0x17')]('GetUser',_0x2eea85[_0x961e('0x18')],_0x176c84);_0x56f6d2(_0x27e4e5[_0x961e('0x17')](0x1f4,_0x2eea85['message']));});});};exports['ShowUser']=function(_0x1514b9){var _0x393929=this;return new Promise(function(_0x4cea59,_0x3ee3fa){return db['User'][_0x961e('0x26')]({'raw':_0x1514b9[_0x961e('0x1f')]?_0x1514b9['options'][_0x961e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1514b9['options']?_0x1514b9[_0x961e('0x1f')]['where']||null:null,'attributes':_0x1514b9[_0x961e('0x1f')]?_0x1514b9[_0x961e('0x1f')][_0x961e('0x21')]||null:null,'include':_0x1514b9['options']?_0x1514b9[_0x961e('0x1f')][_0x961e('0x23')]?_[_0x961e('0x24')](_0x1514b9['options']['include'],function(_0x2cd4b8){return{'model':db[_0x2cd4b8[_0x961e('0x25')]],'as':_0x2cd4b8['as'],'attributes':_0x2cd4b8[_0x961e('0x21')],'include':_0x2cd4b8[_0x961e('0x23')]?_[_0x961e('0x24')](_0x2cd4b8[_0x961e('0x23')],function(_0x581499){return{'model':db[_0x581499[_0x961e('0x25')]],'as':_0x581499['as'],'attributes':_0x581499[_0x961e('0x21')],'include':_0x581499[_0x961e('0x23')]?_['map'](_0x581499[_0x961e('0x23')],function(_0x4ee4c4){return{'model':db[_0x4ee4c4[_0x961e('0x25')]],'as':_0x4ee4c4['as'],'attributes':_0x4ee4c4[_0x961e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x961e('0x11')](function(_0x4c5d83){logger[_0x961e('0x12')](_0x961e('0x27'),_0x1514b9);logger[_0x961e('0x15')](_0x961e('0x27'),_0x1514b9,JSON[_0x961e('0x16')](_0x4c5d83));_0x4cea59(_0x4c5d83);})['catch'](function(_0x3f0b30){logger['error']('ShowUser',_0x3f0b30['message'],_0x1514b9);_0x3ee3fa(_0x393929[_0x961e('0x17')](0x1f4,_0x3f0b30['message']));});});};exports[_0x961e('0x28')]=function(_0x40b828){var _0xa3a84=this;return new Promise(function(_0x4a17b0,_0x260171){var _0x3ed5f1;return db[_0x961e('0x1c')][_0x961e('0x26')]({'where':_0x40b828[_0x961e('0x1f')][_0x961e('0x20')]||{},'attributes':['id','name',_0x961e('0x29'),_0x961e('0x2a'),_0x961e('0x2b')]})[_0x961e('0x11')](function(_0x2924c7){if(_0x2924c7){_0x3ed5f1=_0x2924c7;return db['UserVoiceQueueRt'][_0x961e('0x2c')]({'paused':0x1},{'where':{'UserId':_0x3ed5f1['id']},'individualHooks':!![]});}})['then'](function(){if(_0x3ed5f1){return db['MemberReport'][_0x961e('0x1d')]({'where':{'membername':_0x3ed5f1[_0x961e('0x2d')],'type':_0x961e('0x2e'),'exitAt':null}});}})[_0x961e('0x11')](function(_0x4a2cbd){if(_0x3ed5f1){if(_0x4a2cbd&&_0x4a2cbd[_0x961e('0x2f')]){var _0xf625df=moment()[_0x961e('0x30')](_0x961e('0x31'));for(var _0x23ef3c=0x0,_0x41d0c7=_0x4a2cbd[_0x961e('0x2f')];_0x23ef3c<_0x41d0c7;_0x23ef3c++){_0x4a2cbd[_0x23ef3c][_0x961e('0x32')]({'exitAt':_0xf625df});}}}})[_0x961e('0x11')](function(){if(_0x3ed5f1){var _0x4c8002=[];var _0x41c778=utils[_0x961e('0x33')]();_0x41c778[_0x961e('0x34')](function(_0x310309){_0x4c8002[_0x961e('0x35')]({'channel':_0x310309,'membername':_0x3ed5f1['name'],'interface':_[_0x961e('0x36')](_0x3ed5f1['interface'])?util[_0x961e('0x30')]('SIP/%s',_0x3ed5f1[_0x961e('0x2d')]):_0x3ed5f1[_0x961e('0x2b')],'type':_0x961e('0x2e'),'enterAt':moment()[_0x961e('0x30')](_0x961e('0x31')),'data1':_0x40b828['body'][_0x961e('0x37')]||_0x961e('0x38'),'role':_0x3ed5f1[_0x961e('0x29')],'internal':_0x3ed5f1['internal'],'uniqueid':_0x40b828[_0x961e('0x39')][_0x961e('0x3a')]||null});});return db[_0x961e('0x3b')][_0x961e('0x3c')](_0x4c8002,{'individualHooks':!![]});}})[_0x961e('0x11')](function(){if(_0x3ed5f1){return _0x3ed5f1[_0x961e('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x40b828[_0x961e('0x39')][_0x961e('0x37')]||_0x961e('0x38'),'lastPauseAt':moment()[_0x961e('0x30')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x961e('0x11')](function(_0x3374f9){_0x4a17b0(_0x3374f9);})[_0x961e('0x1a')](function(_0x4dba4d){_0x260171(_0xa3a84['error'](0x1f4,_0x4dba4d[_0x961e('0x18')]));});});};exports[_0x961e('0x3d')]=function(_0x36e78d){var _0x158c7b=this;return new Promise(function(_0x5718f7,_0x30650c){var _0x348fb9;return db[_0x961e('0x1c')][_0x961e('0x3e')]({'where':_0x36e78d['options'][_0x961e('0x20')]||{},'attributes':['id',_0x961e('0x2d')]})[_0x961e('0x11')](function(_0x373515){if(_0x373515){_0x348fb9=_0x373515;if(_0x36e78d['body']['channel']&&!utils[_0x961e('0x3f')](_0x36e78d[_0x961e('0x39')][_0x961e('0x40')])){throw new Error(_0x961e('0x41'));}switch(_0x36e78d[_0x961e('0x39')][_0x961e('0x40')]){case'voice':return db[_0x961e('0x42')][_0x961e('0x2c')]({'paused':0x0},{'where':{'UserId':_0x348fb9['id']}})['then'](function(){return db[_0x961e('0x3b')][_0x961e('0x26')]({'where':{'channel':_0x36e78d[_0x961e('0x39')][_0x961e('0x40')],'membername':_0x348fb9[_0x961e('0x2d')],'type':_0x961e('0x2e'),'exitAt':null}});})[_0x961e('0x11')](function(_0x3d8b1f){if(_0x3d8b1f){return _0x3d8b1f[_0x961e('0x2c')]({'exitAt':moment()[_0x961e('0x30')](_0x961e('0x31')),'data2':_0x961e('0x43')},{'individualHooks':!![]});}return null;})[_0x961e('0x11')](function(){return _0x348fb9['update']({'voicePause':![]});});case'mail':case'chat':case _0x961e('0x44'):case _0x961e('0x45'):case _0x961e('0x46'):case'whatsapp':return db[_0x961e('0x3b')][_0x961e('0x26')]({'where':{'channel':_0x36e78d[_0x961e('0x39')][_0x961e('0x40')],'membername':_0x348fb9['name'],'type':'PAUSE','exitAt':null}})[_0x961e('0x11')](function(_0x1de9f8){return _0x1de9f8[_0x961e('0x2c')]({'exitAt':moment()[_0x961e('0x30')](_0x961e('0x31')),'data2':_0x961e('0x43')},{'individualHooks':!![]});})[_0x961e('0x11')](function(){var _0x1ad202={};_['set'](_0x1ad202,util['format'](_0x961e('0x47'),_0x36e78d[_0x961e('0x39')]['channel'],'Pause'),![]);return _0x348fb9[_0x961e('0x2c')](_0x1ad202);});default:return db[_0x961e('0x42')][_0x961e('0x2c')]({'paused':0x0},{'where':{'UserId':_0x348fb9['id']}})['then'](function(){return db['MemberReport'][_0x961e('0x1d')]({'where':{'membername':_0x348fb9[_0x961e('0x2d')],'type':_0x961e('0x2e'),'exitAt':null}});})['then'](function(_0x9ac075){var _0x378095=[];_0x9ac075['forEach'](function(_0x382776){_0x378095['push'](_0x382776[_0x961e('0x2c')]({'exitAt':moment()[_0x961e('0x30')](_0x961e('0x31')),'data2':_0x961e('0x43')}));});return BPromise['all'](_0x378095);})[_0x961e('0x11')](function(){return _0x348fb9['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x961e('0x11')](function(_0x1cebde){_0x5718f7(_0x1cebde);})['catch'](function(_0x4b8034){_0x30650c(_0x158c7b[_0x961e('0x17')](0x1f4,_0x4b8034['message']));});});};exports[_0x961e('0x48')]=function(_0x49b98d){var _0x3a5136=this;return new Promise(function(_0x441cc3,_0x44fc2a){var _0x5bbb16;return db[_0x961e('0x1c')][_0x961e('0x3e')]({'where':_0x49b98d[_0x961e('0x1f')][_0x961e('0x20')]||{},'attributes':['id',_0x961e('0x2d')]})[_0x961e('0x11')](function(_0x2677ef){if(_0x2677ef){_0x5bbb16=_0x2677ef;return db[_0x961e('0x42')][_0x961e('0x49')]({'where':{'membername':_0x5bbb16['name']},'individualHooks':!![]});}})[_0x961e('0x11')](function(){if(_0x5bbb16){return db[_0x961e('0x3b')][_0x961e('0x1d')]({'where':{'membername':_0x5bbb16[_0x961e('0x2d')],'exitAt':null}});}})[_0x961e('0x11')](function(_0x7a6620){if(_0x5bbb16){if(_0x7a6620&&_0x7a6620[_0x961e('0x2f')]){var _0x1c7fb7=[];_0x7a6620[_0x961e('0x34')](function(_0x41fea5){_0x1c7fb7[_0x961e('0x35')](_0x41fea5['update']({'exitAt':moment()[_0x961e('0x30')](_0x961e('0x31'))}));});return BPromise[_0x961e('0x4a')](_0x1c7fb7);}}})[_0x961e('0x11')](function(){if(_0x5bbb16){return _0x5bbb16[_0x961e('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x961e('0x11')](function(_0x43c3df){_0x441cc3(_0x43c3df);})[_0x961e('0x1a')](function(_0x23b3af){_0x44fc2a(_0x3a5136[_0x961e('0x17')](0x1f4,_0x23b3af[_0x961e('0x18')]));});});};exports[_0x961e('0x4b')]=function(_0x38148f){var _0x35fb81=this;return new Promise(function(_0x5717c6,_0x2dbda3){var _0x4c0310;var _0x36fb86;var _0x4c172d;var _0x11bceb;return db[_0x961e('0x1c')]['findOne']({'where':_0x38148f[_0x961e('0x1f')]['where']||{},'attributes':['id',_0x961e('0x2d'),_0x961e('0x29'),_0x961e('0x4c'),_0x961e('0x4d'),_0x961e('0x2a'),_0x961e('0x4e'),_0x961e('0x2b')]})[_0x961e('0x11')](function(_0x9315ec){if(_0x9315ec){_0x4c0310=_0x9315ec;_0x11bceb=_0x38148f[_0x961e('0x39')][_0x961e('0x2b')]?_0x38148f[_0x961e('0x39')][_0x961e('0x2b')]:util[_0x961e('0x30')](_0x961e('0x4f'),_0x4c0310[_0x961e('0x2d')]);return db['User'][_0x961e('0x50')]({'where':{'role':_0x961e('0x51'),'online':!![],'id':{'$ne':_0x4c0310['id']}}});}})[_0x961e('0x11')](function(_0x354f8d){if(_0x354f8d){_0x4c172d=_0x354f8d;return require(_0x961e('0x52'))['getLicense']();}})[_0x961e('0x11')](function(_0x5979e8){if(_0x5979e8&&_0x5979e8[_0x961e('0x53')]&&_0x4c172d>=_0x5979e8[_0x961e('0x53')]){throw new Error(_0x961e('0x54'));}})[_0x961e('0x11')](function(){if(_0x4c0310){return db[_0x961e('0x42')]['destroy']({'where':{'membername':_0x4c0310['name']},'individualHooks':!![]});}})[_0x961e('0x11')](function(){if(_0x4c0310){return _0x4c0310[_0x961e('0x55')]({'raw':!![]});}})[_0x961e('0x11')](function(_0x3fe824){if(_0x4c0310){if(_0x3fe824){var _0x210f29=[];_0x36fb86=_0x3fe824;if(_0x36fb86[_0x961e('0x2f')]){for(var _0x1c8d11=0x0;_0x1c8d11<_0x36fb86[_0x961e('0x2f')];_0x1c8d11++){_0x210f29['push'](db[_0x961e('0x42')]['upsert']({'membername':_0x4c0310[_0x961e('0x2d')],'UserId':_0x4c0310['id'],'queue_name':_0x36fb86[_0x1c8d11][_0x961e('0x2d')],'VoiceQueueId':_0x36fb86[_0x1c8d11]['id'],'interface':_0x11bceb,'paused':_0x4c0310['loginInPause']||![],'penalty':_0x36fb86[_0x1c8d11]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x961e('0x4a')](_0x210f29);}}}})[_0x961e('0x11')](function(){if(_0x4c0310){return db[_0x961e('0x3b')][_0x961e('0x1d')]({'where':{'membername':_0x4c0310['name'],'exitAt':null}});}})[_0x961e('0x11')](function(_0x341050){if(_0x4c0310){if(_0x341050&&_0x341050[_0x961e('0x2f')]){var _0x765163=[];_0x341050[_0x961e('0x34')](function(_0xa977c8){_0x765163['push'](_0xa977c8[_0x961e('0x2c')]({'exitAt':moment()[_0x961e('0x30')](_0x961e('0x31'))}));});return BPromise[_0x961e('0x4a')](_0x765163);}}})[_0x961e('0x11')](function(_0x31b14b){if(_0x4c0310){var _0x91fa6e=[];var _0x2913f4=[];var _0x5e30bb=utils[_0x961e('0x33')]();var _0x4c296b={'membername':_0x4c0310[_0x961e('0x2d')],'interface':_0x11bceb,'enterAt':moment()[_0x961e('0x30')](_0x961e('0x31')),'role':_0x4c0310['role'],'internal':_0x4c0310[_0x961e('0x2a')]};_0x5e30bb[_0x961e('0x34')](function(_0x22e0bf){_0x91fa6e[_0x961e('0x35')](_['merge']({'channel':_0x22e0bf,'type':_0x961e('0x56'),'data1':'callysquare','data2':_0x11bceb},_0x4c296b));if(_0x4c0310[_0x961e('0x4e')]){_0x2913f4[_0x961e('0x35')](_['merge']({'channel':_0x22e0bf,'type':_0x961e('0x2e'),'data1':_0x961e('0x57')},_0x4c296b));}});return db[_0x961e('0x3b')][_0x961e('0x3c')](_0x91fa6e[_0x961e('0x58')](_0x2913f4),{'individualHooks':!![]});}})[_0x961e('0x11')](function(){if(_0x4c0310){return _0x4c0310[_0x961e('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x961e('0x30')](_0x961e('0x31')),'voicePause':_0x4c0310[_0x961e('0x4e')]||![],'mailPause':_0x4c0310[_0x961e('0x4e')]||![],'chatPause':_0x4c0310[_0x961e('0x4e')]||![],'faxPause':_0x4c0310[_0x961e('0x4e')]||![],'smsPause':_0x4c0310[_0x961e('0x4e')]||![],'openchannelPause':_0x4c0310['loginInPause']||![],'pauseType':_0x4c0310['loginInPause']?_0x961e('0x57'):null,'lastPauseAt':moment()[_0x961e('0x30')](_0x961e('0x31')),'interface':_0x11bceb});}})[_0x961e('0x11')](function(_0x731cce){_0x5717c6(_0x731cce);})[_0x961e('0x1a')](function(_0x43c344){_0x2dbda3(_0x35fb81['error'](0x1f4,_0x43c344[_0x961e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 2bb4a6b..600e808 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 _0x3467=['update','removeListener','register','length','./user.events'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x3467,0x1d0));var _0x7346=function(_0x50b37b,_0x206585){_0x50b37b=_0x50b37b-0x0;var _0x2421ab=_0x3467[_0x50b37b];return _0x2421ab;};'use strict';var UserEvents=require(_0x7346('0x0'));var events=['save','remove',_0x7346('0x1')];function createListener(_0xc041b,_0x236616){return function(_0x36bbf8){_0x236616['emit'](_0xc041b,_0x36bbf8);};}function removeListener(_0x34b923,_0x41cb3a){return function(){UserEvents[_0x7346('0x2')](_0x34b923,_0x41cb3a);};}exports[_0x7346('0x3')]=function(_0x80240f){for(var _0x4ac369=0x0,_0x3f3c74=events[_0x7346('0x4')];_0x4ac369<_0x3f3c74;_0x4ac369++){var _0x8c4f68=events[_0x4ac369];var _0xd3b27b=createListener('user:'+_0x8c4f68,_0x80240f);UserEvents['on'](_0x8c4f68,_0xd3b27b);}}; \ No newline at end of file +var _0x6669=['register','length','user:','./user.events','remove','removeListener'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6669,0x14d));var _0x9666=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x6669[_0x2aa0e7];return _0x1472c0;};'use strict';var UserEvents=require(_0x9666('0x0'));var events=['save',_0x9666('0x1'),'update'];function createListener(_0x50f640,_0x116540){return function(_0xf62018){_0x116540['emit'](_0x50f640,_0xf62018);};}function removeListener(_0x25dc1d,_0x53fd02){return function(){UserEvents[_0x9666('0x2')](_0x25dc1d,_0x53fd02);};}exports[_0x9666('0x3')]=function(_0xc18479){for(var _0x559a25=0x0,_0xe0d52a=events[_0x9666('0x4')];_0x559a25<_0xe0d52a;_0x559a25++){var _0x54ca50=events[_0x559a25];var _0x1bf4fc=createListener(_0x9666('0x5')+_0x54ca50,_0xc18479);UserEvents['on'](_0x54ca50,_0x1bf4fc);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 954693e..0da015a 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b613e,_0x22efee){var _0x166d9d=function(_0x1b2dbb){while(--_0x1b2dbb){_0x5b613e['push'](_0x5b613e['shift']());}};_0x166d9d(++_0x22efee);}(_0xe706,0xa3));var _0x6e70=function(_0xbd4254,_0x31c08b){_0xbd4254=_0xbd4254-0x0;var _0x46c0f3=_0xe706[_0xbd4254];return _0x46c0f3;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5dd537,_0x45b0f4){var _0x3974f3=function(_0x35ecaf){while(--_0x35ecaf){_0x5dd537['push'](_0x5dd537['shift']());}};_0x3974f3(++_0x45b0f4);}(_0x70e0,0x17b));var _0x070e=function(_0x5e7aab,_0x4158d5){_0x5e7aab=_0x5e7aab-0x0;var _0x42d54c=_0x70e0[_0x5e7aab];return _0x42d54c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 7c3c334..24dd5cd 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 _0xe84a=['INTEGER','sequelize','exports'];(function(_0x13c208,_0x364230){var _0x14137e=function(_0x115400){while(--_0x115400){_0x13c208['push'](_0x13c208['shift']());}};_0x14137e(++_0x364230);}(_0xe84a,0x97));var _0xae84=function(_0x10b7e4,_0x584183){_0x10b7e4=_0x10b7e4-0x0;var _0x54e873=_0xe84a[_0x10b7e4];return _0x54e873;};'use strict';var Sequelize=require(_0xae84('0x0'));module[_0xae84('0x1')]={'penalty':{'type':Sequelize[_0xae84('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8dd9=['exports','INTEGER','sequelize'];(function(_0x5545f6,_0x5a8a1f){var _0x187573=function(_0x29dc0c){while(--_0x29dc0c){_0x5545f6['push'](_0x5545f6['shift']());}};_0x187573(++_0x5a8a1f);}(_0x8dd9,0x134));var _0x98dd=function(_0x4c06ab,_0x20be04){_0x4c06ab=_0x4c06ab-0x0;var _0x33b78f=_0x8dd9[_0x4c06ab];return _0x33b78f;};'use strict';var Sequelize=require(_0x98dd('0x0'));module[_0x98dd('0x1')]={'penalty':{'type':Sequelize[_0x98dd('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 02e5903..2eff42d 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 _0x7c9f=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x7c9f,0x9e));var _0xf7c9=function(_0x390039,_0x4415c6){_0x390039=_0x390039-0x0;var _0x2e7850=_0x7c9f[_0x390039];return _0x2e7850;};'use strict';var _=require(_0xf7c9('0x0'));var util=require(_0xf7c9('0x1'));var logger=require(_0xf7c9('0x2'))(_0xf7c9('0x3'));var moment=require(_0xf7c9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7c9('0x5'));var fs=require('fs');var path=require(_0xf7c9('0x6'));var rimraf=require(_0xf7c9('0x7'));var config=require(_0xf7c9('0x8'));var attributes=require(_0xf7c9('0x9'));module[_0xf7c9('0xa')]=function(_0xadd214,_0x4f82b5){return _0xadd214[_0xf7c9('0xb')](_0xf7c9('0xc'),attributes,{'tableName':_0xf7c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf77=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x59cacb,_0x50dc39){var _0x2eed35=function(_0x22e153){while(--_0x22e153){_0x59cacb['push'](_0x59cacb['shift']());}};_0x2eed35(++_0x50dc39);}(_0xdf77,0x86));var _0x7df7=function(_0x5f4f9c,_0x99d32f){_0x5f4f9c=_0x5f4f9c-0x0;var _0x426d5b=_0xdf77[_0x5f4f9c];return _0x426d5b;};'use strict';var _=require(_0x7df7('0x0'));var util=require(_0x7df7('0x1'));var logger=require(_0x7df7('0x2'))(_0x7df7('0x3'));var moment=require('moment');var BPromise=require(_0x7df7('0x4'));var rp=require(_0x7df7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7df7('0x6'));var config=require(_0x7df7('0x7'));var attributes=require(_0x7df7('0x8'));module[_0x7df7('0x9')]=function(_0x435d5a,_0x952255){return _0x435d5a[_0x7df7('0xa')](_0x7df7('0xb'),attributes,{'tableName':_0x7df7('0xc'),'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 a545bce..a048dfa 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 _0x472b=['../../config/utils','../../config/logger','rpc','../../config/environment','client','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x472b,0xe9));var _0xb472=function(_0x14a509,_0x5e9857){_0x14a509=_0x14a509-0x0;var _0x227776=_0x472b[_0x14a509];return _0x227776;};'use strict';var _=require(_0xb472('0x0'));var util=require(_0xb472('0x1'));var moment=require(_0xb472('0x2'));var BPromise=require(_0xb472('0x3'));var rs=require(_0xb472('0x4'));var fs=require('fs');var Redis=require(_0xb472('0x5'));var db=require(_0xb472('0x6'))['db'];var utils=require(_0xb472('0x7'));var logger=require(_0xb472('0x8'))(_0xb472('0x9'));var config=require(_0xb472('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb472('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4e1d,_0x904f9e,_0xdb0c06){return new BPromise(function(_0x374613,_0x2606dd){return client['request'](_0x4f4e1d,_0xdb0c06)[_0xb472('0xc')](function(_0xf6747f){logger['info'](_0xb472('0xd'),_0x904f9e,_0xb472('0xe'));logger[_0xb472('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x904f9e,_0xb472('0xe'),JSON['stringify'](_0xf6747f));if(_0xf6747f[_0xb472('0x10')]){if(_0xf6747f['error'][_0xb472('0x11')]===0x1f4){logger[_0xb472('0x10')](_0xb472('0xd'),_0x904f9e,_0xf6747f[_0xb472('0x10')][_0xb472('0x12')]);return _0x2606dd(_0xf6747f[_0xb472('0x10')][_0xb472('0x12')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x904f9e,_0xf6747f['error'][_0xb472('0x12')]);return _0x374613(_0xf6747f['error']['message']);}else{logger[_0xb472('0x13')](_0xb472('0xd'),_0x904f9e,_0xb472('0xe'));_0x374613(_0xf6747f['result']['message']);}})['catch'](function(_0x1b4cd0){logger['error'](_0xb472('0xd'),_0x904f9e,_0x1b4cd0);_0x2606dd(_0x1b4cd0);});});} \ No newline at end of file +var _0xa505=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash'];(function(_0x16c490,_0xc0fe83){var _0x26073c=function(_0x25ba45){while(--_0x25ba45){_0x16c490['push'](_0x16c490['shift']());}};_0x26073c(++_0xc0fe83);}(_0xa505,0x143));var _0x5a50=function(_0x43f053,_0x57386f){_0x43f053=_0x43f053-0x0;var _0x4b1d77=_0xa505[_0x43f053];return _0x4b1d77;};'use strict';var _=require(_0x5a50('0x0'));var util=require(_0x5a50('0x1'));var moment=require(_0x5a50('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a50('0x3'));var fs=require('fs');var Redis=require(_0x5a50('0x4'));var db=require(_0x5a50('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a50('0x6'));var config=require(_0x5a50('0x7'));var jayson=require(_0x5a50('0x8'));var client=jayson['client'][_0x5a50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56191a,_0x579f0c,_0x25b53d){return new BPromise(function(_0x249499,_0x35351e){return client[_0x5a50('0xa')](_0x56191a,_0x25b53d)['then'](function(_0x1cf8eb){logger[_0x5a50('0xb')](_0x5a50('0xc'),_0x579f0c,_0x5a50('0xd'));logger[_0x5a50('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x579f0c,'request\x20sent',JSON['stringify'](_0x1cf8eb));if(_0x1cf8eb['error']){if(_0x1cf8eb['error']['code']===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x579f0c,_0x1cf8eb[_0x5a50('0xf')][_0x5a50('0x10')]);return _0x35351e(_0x1cf8eb[_0x5a50('0xf')]['message']);}logger[_0x5a50('0xf')](_0x5a50('0xc'),_0x579f0c,_0x1cf8eb[_0x5a50('0xf')][_0x5a50('0x10')]);return _0x249499(_0x1cf8eb[_0x5a50('0xf')][_0x5a50('0x10')]);}else{logger[_0x5a50('0xb')](_0x5a50('0xc'),_0x579f0c,_0x5a50('0xd'));_0x249499(_0x1cf8eb[_0x5a50('0x11')][_0x5a50('0x10')]);}})['catch'](function(_0x55ddbb){logger['error'](_0x5a50('0xc'),_0x579f0c,_0x55ddbb);_0x35351e(_0x55ddbb);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3d61b44..cacff7d 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9388c8,_0x2cdf84){var _0x6f1d3a=function(_0x6a3073){while(--_0x6a3073){_0x9388c8['push'](_0x9388c8['shift']());}};_0x6f1d3a(++_0x2cdf84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1349ce,_0x228a0f){var _0x476cbf=function(_0x587397){while(--_0x587397){_0x1349ce['push'](_0x1349ce['shift']());}};_0x476cbf(++_0x228a0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 8c623ab..438ccb9 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 _0x1cd5=['STRING','sequelize','INTEGER'];(function(_0x3aa09a,_0x378b2f){var _0x30350c=function(_0xffe2ac){while(--_0xffe2ac){_0x3aa09a['push'](_0x3aa09a['shift']());}};_0x30350c(++_0x378b2f);}(_0x1cd5,0xa9));var _0x51cd=function(_0x426df1,_0xa8b2e3){_0x426df1=_0x426df1-0x0;var _0x5cc55c=_0x1cd5[_0x426df1];return _0x5cc55c;};'use strict';var Sequelize=require(_0x51cd('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x51cd('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x51cd('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x51cd('0x2')]}}; \ No newline at end of file +var _0x8f1e=['INTEGER','STRING'];(function(_0x346533,_0x4dd693){var _0x1af988=function(_0x7818f3){while(--_0x7818f3){_0x346533['push'](_0x346533['shift']());}};_0x1af988(++_0x4dd693);}(_0x8f1e,0x92));var _0xe8f1=function(_0x55452a,_0x49582f){_0x55452a=_0x55452a-0x0;var _0x26d5e6=_0x8f1e[_0x55452a];return _0x26d5e6;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe8f1('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe8f1('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 6ff9828..54995ed 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 _0x185d=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash'];(function(_0x1df2da,_0x1d0401){var _0x4ad330=function(_0x2d4f15){while(--_0x2d4f15){_0x1df2da['push'](_0x1df2da['shift']());}};_0x4ad330(++_0x1d0401);}(_0x185d,0x197));var _0xd185=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x185d[_0x408e38];return _0x426b0e;};'use strict';var _=require(_0xd185('0x0'));var util=require(_0xd185('0x1'));var logger=require(_0xd185('0x2'))('api');var moment=require(_0xd185('0x3'));var BPromise=require(_0xd185('0x4'));var rp=require(_0xd185('0x5'));var fs=require('fs');var path=require(_0xd185('0x6'));var rimraf=require('rimraf');var config=require(_0xd185('0x7'));var attributes=require(_0xd185('0x8'));module[_0xd185('0x9')]=function(_0x5bad7c,_0x1456a8){return _0x5bad7c[_0xd185('0xa')]('UserFaxQueue',attributes,{'tableName':_0xd185('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6587=['../../config/environment','./userFaxQueue.attributes','exports','user_has_fax_queues','lodash','util','api','request-promise','path','rimraf'];(function(_0x5b859a,_0x41499c){var _0x5379c7=function(_0x5a5ff6){while(--_0x5a5ff6){_0x5b859a['push'](_0x5b859a['shift']());}};_0x5379c7(++_0x41499c);}(_0x6587,0x14e));var _0x7658=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x6587[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0x7658('0x0'));var util=require(_0x7658('0x1'));var logger=require('../../config/logger')(_0x7658('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7658('0x3'));var fs=require('fs');var path=require(_0x7658('0x4'));var rimraf=require(_0x7658('0x5'));var config=require(_0x7658('0x6'));var attributes=require(_0x7658('0x7'));module[_0x7658('0x8')]=function(_0x4c1591,_0x4863a8){return _0x4c1591['define']('UserFaxQueue',attributes,{'tableName':_0x7658('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 d00ebd9..850b91c 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 _0x39c4=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e202e,_0x20da26){var _0x337771=function(_0x22d462){while(--_0x22d462){_0x2e202e['push'](_0x2e202e['shift']());}};_0x337771(++_0x20da26);}(_0x39c4,0xbe));var _0x439c=function(_0xfed662,_0x212740){_0xfed662=_0xfed662-0x0;var _0x2ea545=_0x39c4[_0xfed662];return _0x2ea545;};'use strict';var _=require(_0x439c('0x0'));var util=require(_0x439c('0x1'));var moment=require(_0x439c('0x2'));var BPromise=require(_0x439c('0x3'));var rs=require(_0x439c('0x4'));var fs=require('fs');var Redis=require(_0x439c('0x5'));var db=require(_0x439c('0x6'))['db'];var utils=require(_0x439c('0x7'));var logger=require(_0x439c('0x8'))(_0x439c('0x9'));var config=require(_0x439c('0xa'));var jayson=require(_0x439c('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56d5c9,_0x43cae5,_0x43d9a0){return new BPromise(function(_0x3a309d,_0x3271cc){return client[_0x439c('0xc')](_0x56d5c9,_0x43d9a0)[_0x439c('0xd')](function(_0x345487){logger['info'](_0x439c('0xe'),_0x43cae5,_0x439c('0xf'));logger[_0x439c('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x43cae5,_0x439c('0xf'),JSON[_0x439c('0x11')](_0x345487));if(_0x345487['error']){if(_0x345487[_0x439c('0x12')][_0x439c('0x13')]===0x1f4){logger[_0x439c('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x43cae5,_0x345487['error']['message']);return _0x3271cc(_0x345487['error'][_0x439c('0x14')]);}logger[_0x439c('0x12')](_0x439c('0xe'),_0x43cae5,_0x345487[_0x439c('0x12')][_0x439c('0x14')]);return _0x3a309d(_0x345487['error'][_0x439c('0x14')]);}else{logger['info'](_0x439c('0xe'),_0x43cae5,_0x439c('0xf'));_0x3a309d(_0x345487[_0x439c('0x15')][_0x439c('0x14')]);}})[_0x439c('0x16')](function(_0x19e6c0){logger[_0x439c('0x12')](_0x439c('0xe'),_0x43cae5,_0x19e6c0);_0x3271cc(_0x19e6c0);});});} \ No newline at end of file +var _0x4c28=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x48c84d,_0x32bd32){var _0x354d9a=function(_0x2dde38){while(--_0x2dde38){_0x48c84d['push'](_0x48c84d['shift']());}};_0x354d9a(++_0x32bd32);}(_0x4c28,0x105));var _0x84c2=function(_0x2daae8,_0x5c684e){_0x2daae8=_0x2daae8-0x0;var _0x53111a=_0x4c28[_0x2daae8];return _0x53111a;};'use strict';var _=require(_0x84c2('0x0'));var util=require(_0x84c2('0x1'));var moment=require('moment');var BPromise=require(_0x84c2('0x2'));var rs=require(_0x84c2('0x3'));var fs=require('fs');var Redis=require(_0x84c2('0x4'));var db=require(_0x84c2('0x5'))['db'];var utils=require(_0x84c2('0x6'));var logger=require(_0x84c2('0x7'))(_0x84c2('0x8'));var config=require(_0x84c2('0x9'));var jayson=require(_0x84c2('0xa'));var client=jayson[_0x84c2('0xb')][_0x84c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45ccdf,_0x3c93e0,_0x45a16d){return new BPromise(function(_0x505c50,_0x5ba8ba){return client['request'](_0x45ccdf,_0x45a16d)[_0x84c2('0xd')](function(_0x5dc31d){logger[_0x84c2('0xe')](_0x84c2('0xf'),_0x3c93e0,_0x84c2('0x10'));logger[_0x84c2('0x11')](_0x84c2('0x12'),_0x3c93e0,_0x84c2('0x10'),JSON[_0x84c2('0x13')](_0x5dc31d));if(_0x5dc31d[_0x84c2('0x14')]){if(_0x5dc31d[_0x84c2('0x14')][_0x84c2('0x15')]===0x1f4){logger[_0x84c2('0x14')](_0x84c2('0xf'),_0x3c93e0,_0x5dc31d['error'][_0x84c2('0x16')]);return _0x5ba8ba(_0x5dc31d[_0x84c2('0x14')][_0x84c2('0x16')]);}logger[_0x84c2('0x14')](_0x84c2('0xf'),_0x3c93e0,_0x5dc31d[_0x84c2('0x14')][_0x84c2('0x16')]);return _0x505c50(_0x5dc31d[_0x84c2('0x14')]['message']);}else{logger[_0x84c2('0xe')](_0x84c2('0xf'),_0x3c93e0,_0x84c2('0x10'));_0x505c50(_0x5dc31d['result'][_0x84c2('0x16')]);}})[_0x84c2('0x17')](function(_0x166bb3){logger[_0x84c2('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x3c93e0,_0x166bb3);_0x5ba8ba(_0x166bb3);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 283f39e..ff30794 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2f8725,_0x199104){var _0x1800af=function(_0x28f28b){while(--_0x28f28b){_0x2f8725['push'](_0x2f8725['shift']());}};_0x1800af(++_0x199104);}(_0xedd9,0xfc));var _0x9edd=function(_0x2422ab,_0x10726d){_0x2422ab=_0x2422ab-0x0;var _0x346d71=_0xedd9[_0x2422ab];return _0x346d71;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xa385ba,_0x4c258a){var _0x7803e4=function(_0x595203){while(--_0x595203){_0xa385ba['push'](_0xa385ba['shift']());}};_0x7803e4(++_0x4c258a);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 50b10b8..5b044f9 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 _0xfcf0=['sequelize','exports','INTEGER'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xfcf0,0xe4));var _0x0fcf=function(_0x34933a,_0x327378){_0x34933a=_0x34933a-0x0;var _0x36abb4=_0xfcf0[_0x34933a];return _0x36abb4;};'use strict';var Sequelize=require(_0x0fcf('0x0'));module[_0x0fcf('0x1')]={'penalty':{'type':Sequelize[_0x0fcf('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x714b=['INTEGER','exports'];(function(_0x3ecc19,_0x3427ba){var _0x4f93d1=function(_0x429bab){while(--_0x429bab){_0x3ecc19['push'](_0x3ecc19['shift']());}};_0x4f93d1(++_0x3427ba);}(_0x714b,0xed));var _0xb714=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x714b[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0xb714('0x0')]={'penalty':{'type':Sequelize[_0xb714('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index c45ecee..d1c8908 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 _0x6fa3=['moment','path','../../config/environment','exports','UserMailQueue','lodash'];(function(_0x3ddde9,_0x1a6a2b){var _0xdfb693=function(_0x1c1c20){while(--_0x1c1c20){_0x3ddde9['push'](_0x3ddde9['shift']());}};_0xdfb693(++_0x1a6a2b);}(_0x6fa3,0x197));var _0x36fa=function(_0xfff265,_0x41f693){_0xfff265=_0xfff265-0x0;var _0x55442d=_0x6fa3[_0xfff265];return _0x55442d;};'use strict';var _=require(_0x36fa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x36fa('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36fa('0x2'));var rimraf=require('rimraf');var config=require(_0x36fa('0x3'));var attributes=require('./userMailQueue.attributes');module[_0x36fa('0x4')]=function(_0x12c737,_0x464dab){return _0x12c737['define'](_0x36fa('0x5'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95c4=['UserMailQueue','user_has_mail_queues','util','api','moment','bluebird','request-promise','./userMailQueue.attributes','define'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x95c4,0x1a0));var _0x495c=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x95c4[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x495c('0x0'));var logger=require('../../config/logger')(_0x495c('0x1'));var moment=require(_0x495c('0x2'));var BPromise=require(_0x495c('0x3'));var rp=require(_0x495c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x495c('0x5'));module['exports']=function(_0x355181,_0x429ef9){return _0x355181[_0x495c('0x6')](_0x495c('0x7'),attributes,{'tableName':_0x495c('0x8'),'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 0a0452a..6a502e4 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(_0x9ab669,_0x47e7d3){var _0x44f075=function(_0x3c753a){while(--_0x3c753a){_0x9ab669['push'](_0x9ab669['shift']());}};_0x44f075(++_0x47e7d3);}(_0x6aa7,0x178));var _0x76aa=function(_0x535702,_0x4b8b7c){_0x535702=_0x535702-0x0;var _0x59d2f0=_0x6aa7[_0x535702];return _0x59d2f0;};'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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x21d1cd,_0x4c151f){var _0x2ddd9d=function(_0x3df260){while(--_0x3df260){_0x21d1cd['push'](_0x21d1cd['shift']());}};_0x2ddd9d(++_0x4c151f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x4b84[_0x5f3905];return _0x2923b1;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 74263e8..17d9d3d 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 _0xd5f5=['../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3c7a97,_0x280f06){var _0x737bcc=function(_0x1c06e4){while(--_0x1c06e4){_0x3c7a97['push'](_0x3c7a97['shift']());}};_0x737bcc(++_0x280f06);}(_0xd5f5,0x7c));var _0x5d5f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd5f5[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x5d5f('0x0'));var util=require(_0x5d5f('0x1'));var path=require('path');var timeout=require(_0x5d5f('0x2'));var express=require(_0x5d5f('0x3'));var router=express[_0x5d5f('0x4')]();var fs_extra=require(_0x5d5f('0x5'));var auth=require(_0x5d5f('0x6'));var interaction=require(_0x5d5f('0x7'));var config=require(_0x5d5f('0x8'));var controller=require('./userNotification.controller');router[_0x5d5f('0x9')]('/',auth[_0x5d5f('0xa')](),controller[_0x5d5f('0xb')]);module[_0x5d5f('0xc')]=router; \ No newline at end of file +var _0xc058=['../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc058,0x13d));var _0x8c05=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xc058[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0x8c05('0x0'));var util=require('util');var path=require(_0x8c05('0x1'));var timeout=require(_0x8c05('0x2'));var express=require(_0x8c05('0x3'));var router=express[_0x8c05('0x4')]();var fs_extra=require(_0x8c05('0x5'));var auth=require(_0x8c05('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c05('0x7'));var controller=require(_0x8c05('0x8'));router[_0x8c05('0x9')]('/',auth['isAuthenticated'](),controller[_0x8c05('0xa')]);module[_0x8c05('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 762457e..a61e849 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 _0x484c=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x484c,0x1e2));var _0xc484=function(_0x13d44c,_0x5cb531){_0x13d44c=_0x13d44c-0x0;var _0x4a710a=_0x484c[_0x13d44c];return _0x4a710a;};'use strict';var Sequelize=require(_0xc484('0x0'));module[_0xc484('0x1')]={'body':{'type':Sequelize[_0xc484('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xc484('0x3')]},'beep':{'type':Sequelize[_0xc484('0x4')]}}; \ No newline at end of file +var _0x34ff=['STRING','BOOLEAN','exports','TEXT'];(function(_0x32cb76,_0x394a99){var _0x4d56ee=function(_0x23096c){while(--_0x23096c){_0x32cb76['push'](_0x32cb76['shift']());}};_0x4d56ee(++_0x394a99);}(_0x34ff,0x18a));var _0xf34f=function(_0x214d27,_0x293fa1){_0x214d27=_0x214d27-0x0;var _0x2f2bce=_0x34ff[_0x214d27];return _0x2f2bce;};'use strict';var Sequelize=require('sequelize');module[_0xf34f('0x0')]={'body':{'type':Sequelize[_0xf34f('0x1')]},'senderName':{'type':Sequelize[_0xf34f('0x2')]},'recipientsId':{'type':Sequelize[_0xf34f('0x1')]},'recipientsDescription':{'type':Sequelize[_0xf34f('0x2')]},'beep':{'type':Sequelize[_0xf34f('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 5407c09..2b1dc25 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 _0xadc9=['findOne','render','User','queue','replace','Queue','ids','forEach','push','all','union','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','UserNotification','create','recipient','emit','catch','text','Template'];(function(_0x3221cd,_0x4a4a4a){var _0x21a689=function(_0x375599){while(--_0x375599){_0x3221cd['push'](_0x3221cd['shift']());}};_0x21a689(++_0x4a4a4a);}(_0xadc9,0x72));var _0x9adc=function(_0x1c0a08,_0x3057a0){_0x1c0a08=_0x1c0a08-0x0;var _0x1e1882=_0xadc9[_0x1c0a08];return _0x1e1882;};'use strict';var emlformat=require(_0x9adc('0x0'));var rimraf=require(_0x9adc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9adc('0x2'));var rp=require(_0x9adc('0x3'));var moment=require(_0x9adc('0x4'));var BPromise=require(_0x9adc('0x5'));var Mustache=require(_0x9adc('0x6'));var util=require(_0x9adc('0x7'));var path=require(_0x9adc('0x8'));var sox=require(_0x9adc('0x9'));var csv=require(_0x9adc('0xa'));var ejs=require(_0x9adc('0xb'));var fs=require('fs');var fs_extra=require(_0x9adc('0xc'));var _=require(_0x9adc('0xd'));var squel=require(_0x9adc('0xe'));var crypto=require(_0x9adc('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9adc('0xa'));var querystring=require(_0x9adc('0x10'));var Papa=require(_0x9adc('0x11'));var Redis=require('ioredis');var authService=require(_0x9adc('0x12'));var qs=require(_0x9adc('0x13'));var as=require(_0x9adc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9adc('0x15'));var utils=require(_0x9adc('0x16'));var config=require(_0x9adc('0x17'));var licenseUtil=require(_0x9adc('0x18'));var db=require(_0x9adc('0x19'))['db'];config[_0x9adc('0x1a')]=_[_0x9adc('0x1b')](config[_0x9adc('0x1a')],{'host':_0x9adc('0x1c'),'port':0x18eb});var socket=require(_0x9adc('0x1d'))(new Redis(config[_0x9adc('0x1a')]));require(_0x9adc('0x1e'))['register'](socket);function respondWithStatusCode(_0x71cbf5,_0x2239fc){_0x2239fc=_0x2239fc||0xcc;return function(_0x30db1f){if(_0x30db1f){return _0x71cbf5[_0x9adc('0x1f')](_0x2239fc);}return _0x71cbf5[_0x9adc('0x20')](_0x2239fc)[_0x9adc('0x21')]();};}function respondWithResult(_0x20dfae,_0x3b188f){_0x3b188f=_0x3b188f||0xc8;return function(_0x252e0d){if(_0x252e0d){return _0x20dfae['status'](_0x3b188f)[_0x9adc('0x22')](_0x252e0d);}};}function respondWithFilteredResult(_0x1a62ca,_0x1edfb7){return function(_0x364e1e){if(_0x364e1e){var _0xdf9ca=typeof _0x1edfb7[_0x9adc('0x23')]===_0x9adc('0x24')&&typeof _0x1edfb7[_0x9adc('0x25')]===_0x9adc('0x24');var _0x6cbaf2=_0x364e1e[_0x9adc('0x26')];var _0x31564b=_0xdf9ca?0x0:_0x1edfb7[_0x9adc('0x23')];var _0x1be2f2=_0xdf9ca?_0x364e1e[_0x9adc('0x26')]:_0x1edfb7['offset']+_0x1edfb7[_0x9adc('0x25')];var _0x2b6af4;if(_0x1be2f2>=_0x6cbaf2){_0x1be2f2=_0x6cbaf2;_0x2b6af4=0xc8;}else{_0x2b6af4=0xce;}_0x1a62ca[_0x9adc('0x20')](_0x2b6af4);return _0x1a62ca['set']('Content-Range',_0x31564b+'-'+_0x1be2f2+'/'+_0x6cbaf2)['json'](_0x364e1e);}return null;};}function patchUpdates(_0x3fa61d){return function(_0x26c474){try{jsonpatch[_0x9adc('0x27')](_0x26c474,_0x3fa61d,!![]);}catch(_0x2a3468){return BPromise[_0x9adc('0x28')](_0x2a3468);}return _0x26c474[_0x9adc('0x29')]();};}function saveUpdates(_0x59b672,_0x2dfc68){return function(_0x23864a){if(_0x23864a){return _0x23864a[_0x9adc('0x2a')](_0x59b672)[_0x9adc('0x2b')](function(_0x164787){return _0x164787;});}return null;};}function removeEntity(_0x2f2d6a,_0x30bf2c){return function(_0x4703fb){if(_0x4703fb){return _0x4703fb[_0x9adc('0x2c')]()[_0x9adc('0x2b')](function(){_0x2f2d6a[_0x9adc('0x20')](0xcc)[_0x9adc('0x21')]();});}};}function handleEntityNotFound(_0x5d6eb2,_0x4921f5){return function(_0x210ca5){if(!_0x210ca5){_0x5d6eb2[_0x9adc('0x1f')](0x194);}return _0x210ca5;};}function handleError(_0x375ab3,_0x44b916){_0x44b916=_0x44b916||0x1f4;return function(_0x559a3c){logger[_0x9adc('0x2d')](_0x559a3c[_0x9adc('0x2e')]);if(_0x559a3c[_0x9adc('0x2f')]){delete _0x559a3c['name'];}_0x375ab3[_0x9adc('0x20')](_0x44b916)['send'](_0x559a3c);};}exports['sendUserNotification']=function(_0x368997,_0x1c14b2,_0x5570b2){if(!_0x368997[_0x9adc('0x30')]['hasOwnProperty']('text')&&!_0x368997['body'][_0x9adc('0x31')](_0x9adc('0x32'))){throw new db[(_0x9adc('0x33'))][(_0x9adc('0x34'))](_0x9adc('0x35'));}else{if(_0x368997[_0x9adc('0x30')][_0x9adc('0x31')](_0x9adc('0x32'))&&!_0x368997[_0x9adc('0x30')]['hasOwnProperty'](_0x9adc('0x36'))){throw new db['Sequelize'][(_0x9adc('0x34'))](_0x9adc('0x37'));}if(!_0x368997['body'][_0x9adc('0x31')](_0x9adc('0x38'))){throw new db[(_0x9adc('0x33'))]['ValidationError'](_0x9adc('0x39'));}else{try{var _0x4b4aba=JSON['parse'](_0x368997['body'][_0x9adc('0x38')]);}catch(_0x449ffc){logger[_0x9adc('0x2d')](_0x449ffc);throw new db[(_0x9adc('0x33'))][(_0x9adc('0x34'))](_0x9adc('0x3a'));}var _0x27ff15=[_0x9adc('0x3b'),'faxqueue',_0x9adc('0x3c'),'openchannelqueue',_0x9adc('0x3d'),_0x9adc('0x3e'),_0x9adc('0x3f'),'team',_0x9adc('0x40')];if(_[_0x9adc('0x41')](_0x4b4aba,function(_0xa1a8aa){return!_[_0x9adc('0x42')](_0x27ff15,_0xa1a8aa[_0x9adc('0x43')][_0x9adc('0x44')]());})){throw new db['Sequelize'][(_0x9adc('0x34'))](_0x9adc('0x45'));}}}var _0xc6c119={};_0xc6c119[_0x9adc('0x46')]=_0x368997[_0x9adc('0x30')][_0x9adc('0x31')]('senderName')?_0x368997[_0x9adc('0x30')][_0x9adc('0x46')]:_0x368997['user'][_0x9adc('0x47')];_0xc6c119['recipientsDescription']=_[_0x9adc('0x48')](_0x368997[_0x9adc('0x30')][_0x9adc('0x49')])?null:_0x368997[_0x9adc('0x30')][_0x9adc('0x49')];_0xc6c119[_0x9adc('0x4a')]=_0x368997[_0x9adc('0x30')][_0x9adc('0x4a')]||![];_0xc6c119[_0x9adc('0x4b')]=_0x368997['user']['id'];return getContent(_0x368997[_0x9adc('0x30')])[_0x9adc('0x2b')](function(_0x59346b){_0xc6c119[_0x9adc('0x30')]=_0x59346b;return getRecipients(_0x4b4aba);})[_0x9adc('0x2b')](function(_0x2631fa){_0xc6c119['recipientsId']=_[_0x9adc('0x4c')](_0x2631fa)[_0x9adc('0x4d')](',');return db[_0x9adc('0x4e')]['transaction'](function(_0x3bfdf8){return db[_0x9adc('0x4f')][_0x9adc('0x50')](_0xc6c119,{'raw':!![],'transaction':_0x3bfdf8})['then'](function(_0x17d97d){var _0x47da59={'sender':_0xc6c119['senderName'],'description':_0xc6c119[_0x9adc('0x49')],'content':_0xc6c119['body'],'beep':_0xc6c119[_0x9adc('0x4a')]};_0x2631fa['forEach'](function(_0x31e374){_0x47da59[_0x9adc('0x51')]=_0x31e374;socket[_0x9adc('0x52')]('userNotification:send',_0x47da59);});return _0x17d97d;});});})[_0x9adc('0x2b')](respondWithResult(_0x1c14b2,0xc9))[_0x9adc('0x53')](handleError(_0x1c14b2,null));};function getContent(_0x404749){return new BPromise(function(_0x475c8c,_0x2a57cb){if(_0x404749[_0x9adc('0x54')]){_0x475c8c(_0x404749['text']);return;}return db[_0x9adc('0x55')][_0x9adc('0x56')]({'attributes':['html'],'where':{'id':_0x404749[_0x9adc('0x32')]},'raw':!![]})[_0x9adc('0x2b')](function(_0x1f9448){if(!_0x1f9448)throw new db[(_0x9adc('0x33'))][(_0x9adc('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x5e257b=Mustache[_0x9adc('0x57')](_0x1f9448['html'],_0x404749[_0x9adc('0x36')]);_0x475c8c(_0x5e257b);})[_0x9adc('0x53')](function(_0x417830){_0x2a57cb(_0x417830);});});}function getRecipients(_0x2e81c9){return new BPromise(function(_0x108816,_0x420f08){var _0x11d3c9=[];var _0x4d7d55=[];_0x2e81c9['forEach'](function(_0x3103db){var _0x575046=_['startCase'](_0x3103db[_0x9adc('0x43')][_0x9adc('0x44')]());if(_0x575046===_0x9adc('0x58')){_0x11d3c9=_['union'](_0x11d3c9,_0x3103db['ids']);}else{if(_['includes'](_0x575046,_0x9adc('0x59')))_0x575046=_0x575046[_0x9adc('0x5a')](_0x9adc('0x59'),_0x9adc('0x5b'));_0x3103db[_0x9adc('0x5c')][_0x9adc('0x5d')](function(_0x10c099){_0x4d7d55[_0x9adc('0x5e')](getAgents(_0x575046,_0x10c099));});}});return BPromise[_0x9adc('0x5f')](_0x4d7d55)[_0x9adc('0x2b')](function(_0x22e7d4){_0x11d3c9=_[_0x9adc('0x60')](_0x11d3c9,_[_0x9adc('0x61')](_0x22e7d4));_0x108816(_0x11d3c9);})[_0x9adc('0x53')](function(_0x59f9e5){_0x420f08(_0x59f9e5);});});}function getAgents(_0x49ba79,_0x734565){return new BPromise(function(_0x5459b0,_0x489524){return db[_0x49ba79][_0x9adc('0x56')]({'where':{'id':_0x734565}})[_0x9adc('0x2b')](function(_0x5a2b97){return _0x5a2b97[_0x9adc('0x62')]({'attributes':['id'],'raw':!![]})[_0x9adc('0x2b')](function(_0x54f238){var _0x1918b9=_[_0x9adc('0x63')](_0x54f238,'id');_0x5459b0(_0x1918b9);});})['catch'](function(_0x18ace3){_0x489524(_0x18ace3);});});} \ No newline at end of file +var _0x6af0=['redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','Sequelize','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','html','render','startCase','User','union','ids','queue','Queue','push','flatten','findOne','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x98e9e4,_0x484d2f){var _0x151fc8=function(_0x59d5eb){while(--_0x59d5eb){_0x98e9e4['push'](_0x98e9e4['shift']());}};_0x151fc8(++_0x484d2f);}(_0x6af0,0x112));var _0x06af=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x6af0[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0x06af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06af('0x1'));var jsonpatch=require(_0x06af('0x2'));var rp=require(_0x06af('0x3'));var moment=require(_0x06af('0x4'));var BPromise=require(_0x06af('0x5'));var Mustache=require(_0x06af('0x6'));var util=require('util');var path=require('path');var sox=require(_0x06af('0x7'));var csv=require(_0x06af('0x8'));var ejs=require(_0x06af('0x9'));var fs=require('fs');var fs_extra=require(_0x06af('0xa'));var _=require(_0x06af('0xb'));var squel=require('squel');var crypto=require(_0x06af('0xc'));var jsforce=require(_0x06af('0xd'));var deskjs=require(_0x06af('0xe'));var toCsv=require(_0x06af('0x8'));var querystring=require(_0x06af('0xf'));var Papa=require('papaparse');var Redis=require(_0x06af('0x10'));var authService=require(_0x06af('0x11'));var qs=require(_0x06af('0x12'));var as=require(_0x06af('0x13'));var hardwareService=require(_0x06af('0x14'));var logger=require(_0x06af('0x15'))(_0x06af('0x16'));var utils=require(_0x06af('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x06af('0x18'));var db=require(_0x06af('0x19'))['db'];config[_0x06af('0x1a')]=_[_0x06af('0x1b')](config[_0x06af('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x06af('0x1c'))(new Redis(config['redis']));require(_0x06af('0x1d'))[_0x06af('0x1e')](socket);function respondWithStatusCode(_0x5737ee,_0x2ad362){_0x2ad362=_0x2ad362||0xcc;return function(_0x315537){if(_0x315537){return _0x5737ee[_0x06af('0x1f')](_0x2ad362);}return _0x5737ee[_0x06af('0x20')](_0x2ad362)[_0x06af('0x21')]();};}function respondWithResult(_0x13d42c,_0x2a59bc){_0x2a59bc=_0x2a59bc||0xc8;return function(_0x16b575){if(_0x16b575){return _0x13d42c[_0x06af('0x20')](_0x2a59bc)[_0x06af('0x22')](_0x16b575);}};}function respondWithFilteredResult(_0x141ba0,_0x3d8cb9){return function(_0x55b69b){if(_0x55b69b){var _0x288f49=typeof _0x3d8cb9[_0x06af('0x23')]==='undefined'&&typeof _0x3d8cb9[_0x06af('0x24')]==='undefined';var _0x2ea6dc=_0x55b69b[_0x06af('0x25')];var _0x46457d=_0x288f49?0x0:_0x3d8cb9[_0x06af('0x23')];var _0x3007de=_0x288f49?_0x55b69b[_0x06af('0x25')]:_0x3d8cb9[_0x06af('0x23')]+_0x3d8cb9['limit'];var _0x302894;if(_0x3007de>=_0x2ea6dc){_0x3007de=_0x2ea6dc;_0x302894=0xc8;}else{_0x302894=0xce;}_0x141ba0[_0x06af('0x20')](_0x302894);return _0x141ba0['set'](_0x06af('0x26'),_0x46457d+'-'+_0x3007de+'/'+_0x2ea6dc)['json'](_0x55b69b);}return null;};}function patchUpdates(_0x42614e){return function(_0x4759bb){try{jsonpatch[_0x06af('0x27')](_0x4759bb,_0x42614e,!![]);}catch(_0x19ce79){return BPromise[_0x06af('0x28')](_0x19ce79);}return _0x4759bb[_0x06af('0x29')]();};}function saveUpdates(_0x446f7b,_0x29b2f1){return function(_0x2bc3b3){if(_0x2bc3b3){return _0x2bc3b3[_0x06af('0x2a')](_0x446f7b)[_0x06af('0x2b')](function(_0x3cbf8e){return _0x3cbf8e;});}return null;};}function removeEntity(_0x38af51,_0x549360){return function(_0x77a070){if(_0x77a070){return _0x77a070[_0x06af('0x2c')]()[_0x06af('0x2b')](function(){_0x38af51[_0x06af('0x20')](0xcc)[_0x06af('0x21')]();});}};}function handleEntityNotFound(_0xacd320,_0x209b98){return function(_0x435345){if(!_0x435345){_0xacd320[_0x06af('0x1f')](0x194);}return _0x435345;};}function handleError(_0x277894,_0xec881a){_0xec881a=_0xec881a||0x1f4;return function(_0x55433e){logger[_0x06af('0x2d')](_0x55433e['stack']);if(_0x55433e[_0x06af('0x2e')]){delete _0x55433e[_0x06af('0x2e')];}_0x277894[_0x06af('0x20')](_0xec881a)[_0x06af('0x2f')](_0x55433e);};}exports[_0x06af('0x30')]=function(_0x49a606,_0x45a311,_0x537e28){if(!_0x49a606[_0x06af('0x31')][_0x06af('0x32')](_0x06af('0x33'))&&!_0x49a606[_0x06af('0x31')]['hasOwnProperty'](_0x06af('0x34'))){throw new db['Sequelize']['ValidationError'](_0x06af('0x35'));}else{if(_0x49a606[_0x06af('0x31')][_0x06af('0x32')]('TemplateId')&&!_0x49a606[_0x06af('0x31')][_0x06af('0x32')](_0x06af('0x36'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x49a606[_0x06af('0x31')][_0x06af('0x32')](_0x06af('0x37'))){throw new db['Sequelize'][(_0x06af('0x38'))](_0x06af('0x39'));}else{try{var _0xe32941=JSON['parse'](_0x49a606['body'][_0x06af('0x37')]);}catch(_0x5f3ad8){logger['error'](_0x5f3ad8);throw new db[(_0x06af('0x3a'))][(_0x06af('0x38'))](_0x06af('0x3b'));}var _0x4190d7=[_0x06af('0x3c'),_0x06af('0x3d'),'mailqueue',_0x06af('0x3e'),_0x06af('0x3f'),_0x06af('0x40'),_0x06af('0x41'),'team',_0x06af('0x42')];if(_[_0x06af('0x43')](_0xe32941,function(_0x59f347){return!_[_0x06af('0x44')](_0x4190d7,_0x59f347[_0x06af('0x45')][_0x06af('0x46')]());})){throw new db[(_0x06af('0x3a'))]['ValidationError'](_0x06af('0x47'));}}}var _0x1bc1e3={};_0x1bc1e3[_0x06af('0x48')]=_0x49a606[_0x06af('0x31')]['hasOwnProperty'](_0x06af('0x48'))?_0x49a606[_0x06af('0x31')]['senderName']:_0x49a606['user']['fullname'];_0x1bc1e3[_0x06af('0x49')]=_['isEmpty'](_0x49a606[_0x06af('0x31')][_0x06af('0x49')])?null:_0x49a606[_0x06af('0x31')]['recipientsDescription'];_0x1bc1e3[_0x06af('0x4a')]=_0x49a606[_0x06af('0x31')][_0x06af('0x4a')]||![];_0x1bc1e3[_0x06af('0x4b')]=_0x49a606[_0x06af('0x42')]['id'];return getContent(_0x49a606['body'])[_0x06af('0x2b')](function(_0x396706){_0x1bc1e3[_0x06af('0x31')]=_0x396706;return getRecipients(_0xe32941);})[_0x06af('0x2b')](function(_0x2ea53c){_0x1bc1e3[_0x06af('0x4c')]=_[_0x06af('0x4d')](_0x2ea53c)[_0x06af('0x4e')](',');return db[_0x06af('0x4f')]['transaction'](function(_0xb28d38){return db[_0x06af('0x50')][_0x06af('0x51')](_0x1bc1e3,{'raw':!![],'transaction':_0xb28d38})[_0x06af('0x2b')](function(_0x4541a8){var _0x1ee31a={'sender':_0x1bc1e3[_0x06af('0x48')],'description':_0x1bc1e3[_0x06af('0x49')],'content':_0x1bc1e3[_0x06af('0x31')],'beep':_0x1bc1e3[_0x06af('0x4a')]};_0x2ea53c[_0x06af('0x52')](function(_0x434ab2){_0x1ee31a[_0x06af('0x53')]=_0x434ab2;socket[_0x06af('0x54')](_0x06af('0x55'),_0x1ee31a);});return _0x4541a8;});});})[_0x06af('0x2b')](respondWithResult(_0x45a311,0xc9))[_0x06af('0x56')](handleError(_0x45a311,null));};function getContent(_0x751dfb){return new BPromise(function(_0x22e5d5,_0x1d34e6){if(_0x751dfb['text']){_0x22e5d5(_0x751dfb['text']);return;}return db[_0x06af('0x57')]['findOne']({'attributes':[_0x06af('0x58')],'where':{'id':_0x751dfb[_0x06af('0x34')]},'raw':!![]})[_0x06af('0x2b')](function(_0xcab99){if(!_0xcab99)throw new db[(_0x06af('0x3a'))][(_0x06af('0x38'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x177714=Mustache[_0x06af('0x59')](_0xcab99[_0x06af('0x58')],_0x751dfb[_0x06af('0x36')]);_0x22e5d5(_0x177714);})['catch'](function(_0x2687c3){_0x1d34e6(_0x2687c3);});});}function getRecipients(_0x23bb1f){return new BPromise(function(_0x19acc0,_0x16e141){var _0x16d66d=[];var _0xf8c48e=[];_0x23bb1f[_0x06af('0x52')](function(_0x200dcc){var _0xd3daa5=_[_0x06af('0x5a')](_0x200dcc['model'][_0x06af('0x46')]());if(_0xd3daa5===_0x06af('0x5b')){_0x16d66d=_[_0x06af('0x5c')](_0x16d66d,_0x200dcc[_0x06af('0x5d')]);}else{if(_[_0x06af('0x44')](_0xd3daa5,_0x06af('0x5e')))_0xd3daa5=_0xd3daa5['replace']('queue',_0x06af('0x5f'));_0x200dcc[_0x06af('0x5d')]['forEach'](function(_0x5b8527){_0xf8c48e[_0x06af('0x60')](getAgents(_0xd3daa5,_0x5b8527));});}});return BPromise['all'](_0xf8c48e)[_0x06af('0x2b')](function(_0x33cf28){_0x16d66d=_[_0x06af('0x5c')](_0x16d66d,_[_0x06af('0x61')](_0x33cf28));_0x19acc0(_0x16d66d);})[_0x06af('0x56')](function(_0x7d5e43){_0x16e141(_0x7d5e43);});});}function getAgents(_0x46fe4e,_0x532b0f){return new BPromise(function(_0x172aca,_0x5f9b19){return db[_0x46fe4e][_0x06af('0x62')]({'where':{'id':_0x532b0f}})[_0x06af('0x2b')](function(_0x12d839){return _0x12d839['getAgents']({'attributes':['id'],'raw':!![]})[_0x06af('0x2b')](function(_0x48831b){var _0x5c5748=_[_0x06af('0x63')](_0x48831b,'id');_0x172aca(_0x5c5748);});})[_0x06af('0x56')](function(_0x31f5e7){_0x5f9b19(_0x31f5e7);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index f6658b6..037308e 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 _0x6b2c=['events','../../mysqldb','UserNotification','setMaxListeners','remove','emit','hook','exports'];(function(_0x5707d2,_0x280c70){var _0x4e358d=function(_0x4a741e){while(--_0x4a741e){_0x5707d2['push'](_0x5707d2['shift']());}};_0x4e358d(++_0x280c70);}(_0x6b2c,0x180));var _0xc6b2=function(_0x487057,_0x14304c){_0x487057=_0x487057-0x0;var _0x104558=_0x6b2c[_0x487057];return _0x104558;};'use strict';var EventEmitter=require(_0xc6b2('0x0'));var UserNotification=require(_0xc6b2('0x1'))['db'][_0xc6b2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc6b2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc6b2('0x4')};function emitEvent(_0x5749f5){return function(_0x10f75f,_0x46c798,_0x5693f3){UserNotificationEvents[_0xc6b2('0x5')](_0x5749f5+':'+_0x10f75f['id'],_0x10f75f);UserNotificationEvents['emit'](_0x5749f5,_0x10f75f);_0x5693f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xc6b2('0x6')](e,emitEvent(event));}}module[_0xc6b2('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x13a9=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x7a42e7,_0x1c17e3){var _0x166901=function(_0x23c745){while(--_0x23c745){_0x7a42e7['push'](_0x7a42e7['shift']());}};_0x166901(++_0x1c17e3);}(_0x13a9,0x113));var _0x913a=function(_0x36b349,_0x27bd8d){_0x36b349=_0x36b349-0x0;var _0x19b37d=_0x13a9[_0x36b349];return _0x19b37d;};'use strict';var EventEmitter=require(_0x913a('0x0'));var UserNotification=require(_0x913a('0x1'))['db'][_0x913a('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x913a('0x3')](0x0);var events={'afterCreate':_0x913a('0x4'),'afterUpdate':_0x913a('0x5'),'afterDestroy':_0x913a('0x6')};function emitEvent(_0x38a6c5){return function(_0x1cc470,_0x626add,_0x56ee41){UserNotificationEvents[_0x913a('0x7')](_0x38a6c5+':'+_0x1cc470['id'],_0x1cc470);UserNotificationEvents['emit'](_0x38a6c5,_0x1cc470);_0x56ee41(null);};}for(var e in events){if(events[_0x913a('0x8')](e)){var event=events[e];UserNotification[_0x913a('0x9')](e,emitEvent(event));}}module[_0x913a('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 31e9b03..9e119ee 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 _0x52e8=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util'];(function(_0x2a6ab4,_0x361cb5){var _0x41ebd9=function(_0x5af136){while(--_0x5af136){_0x2a6ab4['push'](_0x2a6ab4['shift']());}};_0x41ebd9(++_0x361cb5);}(_0x52e8,0x16a));var _0x852e=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x52e8[_0x29a29f];return _0x443ea3;};'use strict';var _=require(_0x852e('0x0'));var util=require(_0x852e('0x1'));var logger=require(_0x852e('0x2'))('api');var moment=require(_0x852e('0x3'));var BPromise=require('bluebird');var rp=require(_0x852e('0x4'));var fs=require('fs');var path=require(_0x852e('0x5'));var rimraf=require(_0x852e('0x6'));var config=require(_0x852e('0x7'));var attributes=require(_0x852e('0x8'));module[_0x852e('0x9')]=function(_0x422593,_0x253b45){return _0x422593['define'](_0x852e('0xa'),attributes,{'tableName':_0x852e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x852e('0xc')});}; \ No newline at end of file +var _0x41e8=['request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x41e8,0x1be));var _0x841e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x41e8[_0x49ca18];return _0x145d54;};'use strict';var _=require('lodash');var util=require(_0x841e('0x0'));var logger=require(_0x841e('0x1'))(_0x841e('0x2'));var moment=require('moment');var BPromise=require(_0x841e('0x3'));var rp=require(_0x841e('0x4'));var fs=require('fs');var path=require(_0x841e('0x5'));var rimraf=require(_0x841e('0x6'));var config=require(_0x841e('0x7'));var attributes=require(_0x841e('0x8'));module[_0x841e('0x9')]=function(_0x58fe5b,_0x17a49b){return _0x58fe5b[_0x841e('0xa')](_0x841e('0xb'),attributes,{'tableName':_0x841e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x841e('0xd'),'collate':_0x841e('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1a9b696..2c7e3bc 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 _0x0f17=['jayson/promise','client','http','redis','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5959eb,_0x5865b7){var _0x365e19=function(_0x358e95){while(--_0x358e95){_0x5959eb['push'](_0x5959eb['shift']());}};_0x365e19(++_0x5865b7);}(_0x0f17,0x1b3));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var util=require(_0x70f1('0x1'));var moment=require(_0x70f1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70f1('0x3'))['db'];var utils=require(_0x70f1('0x4'));var logger=require(_0x70f1('0x5'))(_0x70f1('0x6'));var config=require('../../config/environment');var jayson=require(_0x70f1('0x7'));var client=jayson[_0x70f1('0x8')][_0x70f1('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x70f1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x70f1('0xb'))(new Redis(config['redis']));require(_0x70f1('0xc'))[_0x70f1('0xd')](socket);function respondWithRpcPromise(_0x5c8b78,_0x56aa2c,_0x1e8661){return new BPromise(function(_0xb5368,_0x5854ac){return client[_0x70f1('0xe')](_0x5c8b78,_0x1e8661)[_0x70f1('0xf')](function(_0x1c6dc2){logger[_0x70f1('0x10')](_0x70f1('0x11'),_0x56aa2c,_0x70f1('0x12'));logger[_0x70f1('0x13')](_0x70f1('0x14'),_0x56aa2c,_0x70f1('0x12'),JSON[_0x70f1('0x15')](_0x1c6dc2));if(_0x1c6dc2['error']){if(_0x1c6dc2[_0x70f1('0x16')]['code']===0x1f4){logger['error'](_0x70f1('0x11'),_0x56aa2c,_0x1c6dc2[_0x70f1('0x16')]['message']);return _0x5854ac(_0x1c6dc2['error'][_0x70f1('0x17')]);}logger[_0x70f1('0x16')]('UserNotification,\x20%s,\x20%s',_0x56aa2c,_0x1c6dc2[_0x70f1('0x16')][_0x70f1('0x17')]);return _0xb5368(_0x1c6dc2[_0x70f1('0x16')][_0x70f1('0x17')]);}else{logger[_0x70f1('0x10')](_0x70f1('0x11'),_0x56aa2c,'request\x20sent');_0xb5368(_0x1c6dc2[_0x70f1('0x18')][_0x70f1('0x17')]);}})[_0x70f1('0x19')](function(_0x3c8499){logger[_0x70f1('0x16')](_0x70f1('0x11'),_0x56aa2c,_0x3c8499);_0x5854ac(_0x3c8499);});});} \ No newline at end of file +var _0x8ccf=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b6e08,_0x2fdfa0){var _0x228175=function(_0x538f55){while(--_0x538f55){_0x2b6e08['push'](_0x2b6e08['shift']());}};_0x228175(++_0x2fdfa0);}(_0x8ccf,0x1a4));var _0xf8cc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8ccf[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xf8cc('0x0'));var util=require(_0xf8cc('0x1'));var moment=require(_0xf8cc('0x2'));var BPromise=require(_0xf8cc('0x3'));var rs=require(_0xf8cc('0x4'));var fs=require('fs');var Redis=require(_0xf8cc('0x5'));var db=require(_0xf8cc('0x6'))['db'];var utils=require(_0xf8cc('0x7'));var logger=require(_0xf8cc('0x8'))(_0xf8cc('0x9'));var config=require(_0xf8cc('0xa'));var jayson=require(_0xf8cc('0xb'));var client=jayson[_0xf8cc('0xc')]['http']({'port':0x232a});config[_0xf8cc('0xd')]=_[_0xf8cc('0xe')](config['redis'],{'host':_0xf8cc('0xf'),'port':0x18eb});var socket=require(_0xf8cc('0x10'))(new Redis(config[_0xf8cc('0xd')]));require(_0xf8cc('0x11'))[_0xf8cc('0x12')](socket);function respondWithRpcPromise(_0x3a29db,_0x26227e,_0x2f1df0){return new BPromise(function(_0xe2981,_0xa0df1f){return client[_0xf8cc('0x13')](_0x3a29db,_0x2f1df0)[_0xf8cc('0x14')](function(_0x4e6688){logger[_0xf8cc('0x15')](_0xf8cc('0x16'),_0x26227e,_0xf8cc('0x17'));logger[_0xf8cc('0x18')](_0xf8cc('0x19'),_0x26227e,'request\x20sent',JSON[_0xf8cc('0x1a')](_0x4e6688));if(_0x4e6688[_0xf8cc('0x1b')]){if(_0x4e6688[_0xf8cc('0x1b')][_0xf8cc('0x1c')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x26227e,_0x4e6688[_0xf8cc('0x1b')][_0xf8cc('0x1d')]);return _0xa0df1f(_0x4e6688[_0xf8cc('0x1b')]['message']);}logger['error']('UserNotification,\x20%s,\x20%s',_0x26227e,_0x4e6688[_0xf8cc('0x1b')][_0xf8cc('0x1d')]);return _0xe2981(_0x4e6688[_0xf8cc('0x1b')][_0xf8cc('0x1d')]);}else{logger[_0xf8cc('0x15')](_0xf8cc('0x16'),_0x26227e,_0xf8cc('0x17'));_0xe2981(_0x4e6688[_0xf8cc('0x1e')][_0xf8cc('0x1d')]);}})[_0xf8cc('0x1f')](function(_0x33ff46){logger[_0xf8cc('0x1b')](_0xf8cc('0x16'),_0x26227e,_0x33ff46);_0xa0df1f(_0x33ff46);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 3aa656f..998404d 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 _0xdbf1=['removeListener','save','remove','update','emit'];(function(_0x35938e,_0xb6b9de){var _0x39f8c7=function(_0x1ed918){while(--_0x1ed918){_0x35938e['push'](_0x35938e['shift']());}};_0x39f8c7(++_0xb6b9de);}(_0xdbf1,0xa1));var _0x1dbf=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xdbf1[_0x432fca];return _0x3adba4;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x1dbf('0x0'),_0x1dbf('0x1'),_0x1dbf('0x2')];function createListener(_0x42454d,_0x9cb563){return function(_0x2315ef){_0x9cb563[_0x1dbf('0x3')](_0x42454d,_0x2315ef);};}function removeListener(_0x3d09d1,_0x17e45a){return function(){UserNotificationEvents[_0x1dbf('0x4')](_0x3d09d1,_0x17e45a);};}exports['register']=function(_0x153dbb){for(var _0x33ba3b=0x0,_0x5c0430=events['length'];_0x33ba3b<_0x5c0430;_0x33ba3b++){var _0x44980e=events[_0x33ba3b];var _0x5c5292=createListener('userNotification:'+_0x44980e,_0x153dbb);UserNotificationEvents['on'](_0x44980e,_0x5c5292);}}; \ No newline at end of file +var _0xa5b3=['length','userNotification:','./userNotification.events','remove','emit','removeListener','register'];(function(_0xb26e4e,_0x52cd72){var _0x153b18=function(_0x51caab){while(--_0x51caab){_0xb26e4e['push'](_0xb26e4e['shift']());}};_0x153b18(++_0x52cd72);}(_0xa5b3,0xd4));var _0x3a5b=function(_0xf1180a,_0x56509c){_0xf1180a=_0xf1180a-0x0;var _0x3c48d0=_0xa5b3[_0xf1180a];return _0x3c48d0;};'use strict';var UserNotificationEvents=require(_0x3a5b('0x0'));var events=['save',_0x3a5b('0x1'),'update'];function createListener(_0x32d500,_0x17f694){return function(_0x4269d6){_0x17f694[_0x3a5b('0x2')](_0x32d500,_0x4269d6);};}function removeListener(_0x31911a,_0x292b36){return function(){UserNotificationEvents[_0x3a5b('0x3')](_0x31911a,_0x292b36);};}exports[_0x3a5b('0x4')]=function(_0x20518f){for(var _0x565f4f=0x0,_0xd2e86a=events[_0x3a5b('0x5')];_0x565f4f<_0xd2e86a;_0x565f4f++){var _0x1b23f6=events[_0x565f4f];var _0x243b8f=createListener(_0x3a5b('0x6')+_0x1b23f6,_0x20518f);UserNotificationEvents['on'](_0x1b23f6,_0x243b8f);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 92b544b..f86e9b3 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5c4924,_0x1b50d0){var _0x4ad0ad=function(_0x5372d0){while(--_0x5372d0){_0x5c4924['push'](_0x5c4924['shift']());}};_0x4ad0ad(++_0x1b50d0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcb91[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1f8e61,_0x335c2c){var _0xbbd9ba=function(_0x526020){while(--_0x526020){_0x1f8e61['push'](_0x1f8e61['shift']());}};_0xbbd9ba(++_0x335c2c);}(_0x70e0,0x17b));var _0x070e=function(_0x595478,_0x59836f){_0x595478=_0x595478-0x0;var _0x2fa21e=_0x70e0[_0x595478];return _0x2fa21e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e951feb..4c6ad68 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 _0x799b=['exports','INTEGER','sequelize'];(function(_0x3521a4,_0x130479){var _0x544301=function(_0x7c8606){while(--_0x7c8606){_0x3521a4['push'](_0x3521a4['shift']());}};_0x544301(++_0x130479);}(_0x799b,0xcb));var _0xb799=function(_0xbaf00f,_0x29358c){_0xbaf00f=_0xbaf00f-0x0;var _0x3b4415=_0x799b[_0xbaf00f];return _0x3b4415;};'use strict';var Sequelize=require(_0xb799('0x0'));module[_0xb799('0x1')]={'penalty':{'type':Sequelize[_0xb799('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe79c=['INTEGER','sequelize'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xe79c,0x9f));var _0xce79=function(_0x4ac862,_0x84f93b){_0x4ac862=_0x4ac862-0x0;var _0xa13766=_0xe79c[_0x4ac862];return _0xa13766;};'use strict';var Sequelize=require(_0xce79('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xce79('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 3248463..7da7c64 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 _0x1637=['exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x1afb84,_0x50a83b){var _0x32bfe8=function(_0x138afe){while(--_0x138afe){_0x1afb84['push'](_0x1afb84['shift']());}};_0x32bfe8(++_0x50a83b);}(_0x1637,0x1dc));var _0x7163=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x1637[_0x1e3671];return _0x48d5f5;};'use strict';var _=require(_0x7163('0x0'));var util=require('util');var logger=require(_0x7163('0x1'))('api');var moment=require(_0x7163('0x2'));var BPromise=require(_0x7163('0x3'));var rp=require(_0x7163('0x4'));var fs=require('fs');var path=require(_0x7163('0x5'));var rimraf=require('rimraf');var config=require(_0x7163('0x6'));var attributes=require(_0x7163('0x7'));module[_0x7163('0x8')]=function(_0x5922d3,_0x43bb74){return _0x5922d3['define'](_0x7163('0x9'),attributes,{'tableName':_0x7163('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64dc=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x64dc,0x95));var _0xc64d=function(_0x169fa4,_0x235d76){_0x169fa4=_0x169fa4-0x0;var _0x57fd13=_0x64dc[_0x169fa4];return _0x57fd13;};'use strict';var _=require('lodash');var util=require(_0xc64d('0x0'));var logger=require('../../config/logger')(_0xc64d('0x1'));var moment=require(_0xc64d('0x2'));var BPromise=require(_0xc64d('0x3'));var rp=require(_0xc64d('0x4'));var fs=require('fs');var path=require(_0xc64d('0x5'));var rimraf=require(_0xc64d('0x6'));var config=require(_0xc64d('0x7'));var attributes=require(_0xc64d('0x8'));module[_0xc64d('0x9')]=function(_0x359d3a,_0x4ed1a1){return _0x359d3a[_0xc64d('0xa')](_0xc64d('0xb'),attributes,{'tableName':_0xc64d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index a8663c9..de061bb 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 _0x57e9=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x57e9,0xb8));var _0x957e=function(_0x429031,_0x21b146){_0x429031=_0x429031-0x0;var _0x2c8da5=_0x57e9[_0x429031];return _0x2c8da5;};'use strict';var _=require(_0x957e('0x0'));var util=require(_0x957e('0x1'));var moment=require('moment');var BPromise=require(_0x957e('0x2'));var rs=require(_0x957e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x957e('0x4'))['db'];var utils=require(_0x957e('0x5'));var logger=require(_0x957e('0x6'))(_0x957e('0x7'));var config=require('../../config/environment');var jayson=require(_0x957e('0x8'));var client=jayson[_0x957e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x88db2c,_0x14dfd6,_0x8071fe){return new BPromise(function(_0x594ee4,_0x30e79a){return client[_0x957e('0xa')](_0x88db2c,_0x8071fe)[_0x957e('0xb')](function(_0x428f43){logger[_0x957e('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14dfd6,_0x957e('0xd'));logger[_0x957e('0xe')](_0x957e('0xf'),_0x14dfd6,_0x957e('0xd'),JSON[_0x957e('0x10')](_0x428f43));if(_0x428f43['error']){if(_0x428f43[_0x957e('0x11')][_0x957e('0x12')]===0x1f4){logger['error'](_0x957e('0x13'),_0x14dfd6,_0x428f43[_0x957e('0x11')][_0x957e('0x14')]);return _0x30e79a(_0x428f43[_0x957e('0x11')][_0x957e('0x14')]);}logger[_0x957e('0x11')](_0x957e('0x13'),_0x14dfd6,_0x428f43[_0x957e('0x11')]['message']);return _0x594ee4(_0x428f43[_0x957e('0x11')][_0x957e('0x14')]);}else{logger[_0x957e('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14dfd6,_0x957e('0xd'));_0x594ee4(_0x428f43[_0x957e('0x15')]['message']);}})[_0x957e('0x16')](function(_0x165a7a){logger[_0x957e('0x11')](_0x957e('0x13'),_0x14dfd6,_0x165a7a);_0x30e79a(_0x165a7a);});});} \ No newline at end of file +var _0x80ff=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0xd90dd7,_0x3d1aa2){var _0x55fc74=function(_0x85fc24){while(--_0x85fc24){_0xd90dd7['push'](_0xd90dd7['shift']());}};_0x55fc74(++_0x3d1aa2);}(_0x80ff,0x1e4));var _0xf80f=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x80ff[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0xf80f('0x0'));var util=require(_0xf80f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf80f('0x2'));var fs=require('fs');var Redis=require(_0xf80f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf80f('0x4'));var logger=require(_0xf80f('0x5'))(_0xf80f('0x6'));var config=require('../../config/environment');var jayson=require(_0xf80f('0x7'));var client=jayson[_0xf80f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b05c,_0x2f2c07,_0x1f4536){return new BPromise(function(_0x121cfb,_0x78d657){return client['request'](_0x12b05c,_0x1f4536)[_0xf80f('0x9')](function(_0x4c1b8b){logger[_0xf80f('0xa')](_0xf80f('0xb'),_0x2f2c07,_0xf80f('0xc'));logger[_0xf80f('0xd')](_0xf80f('0xe'),_0x2f2c07,_0xf80f('0xc'),JSON[_0xf80f('0xf')](_0x4c1b8b));if(_0x4c1b8b[_0xf80f('0x10')]){if(_0x4c1b8b['error']['code']===0x1f4){logger['error'](_0xf80f('0xb'),_0x2f2c07,_0x4c1b8b[_0xf80f('0x10')][_0xf80f('0x11')]);return _0x78d657(_0x4c1b8b[_0xf80f('0x10')][_0xf80f('0x11')]);}logger[_0xf80f('0x10')](_0xf80f('0xb'),_0x2f2c07,_0x4c1b8b[_0xf80f('0x10')][_0xf80f('0x11')]);return _0x121cfb(_0x4c1b8b[_0xf80f('0x10')][_0xf80f('0x11')]);}else{logger[_0xf80f('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2f2c07,_0xf80f('0xc'));_0x121cfb(_0x4c1b8b[_0xf80f('0x12')][_0xf80f('0x11')]);}})['catch'](function(_0x15af12){logger[_0xf80f('0x10')](_0xf80f('0xb'),_0x2f2c07,_0x15af12);_0x78d657(_0x15af12);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index a95fd8e..7b50856 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 _0x1dbc=['post','create','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources'];(function(_0x5714b2,_0x3939ec){var _0x4f2b65=function(_0x348d67){while(--_0x348d67){_0x5714b2['push'](_0x5714b2['shift']());}};_0x4f2b65(++_0x3939ec);}(_0x1dbc,0x1ab));var _0xc1db=function(_0x3ad2e5,_0x94d414){_0x3ad2e5=_0x3ad2e5-0x0;var _0xc4e565=_0x1dbc[_0x3ad2e5];return _0xc4e565;};'use strict';var multer=require(_0xc1db('0x0'));var util=require(_0xc1db('0x1'));var path=require(_0xc1db('0x2'));var timeout=require(_0xc1db('0x3'));var express=require(_0xc1db('0x4'));var router=express[_0xc1db('0x5')]();var fs_extra=require(_0xc1db('0x6'));var auth=require(_0xc1db('0x7'));var interaction=require(_0xc1db('0x8'));var config=require(_0xc1db('0x9'));var controller=require(_0xc1db('0xa'));router[_0xc1db('0xb')]('/',auth[_0xc1db('0xc')](),controller[_0xc1db('0xd')]);router['get'](_0xc1db('0xe'),auth[_0xc1db('0xc')](),controller[_0xc1db('0xf')]);router[_0xc1db('0xb')](_0xc1db('0x10'),auth[_0xc1db('0xc')](),controller['show']);router[_0xc1db('0xb')](_0xc1db('0x11'),auth['isAuthenticated'](),controller[_0xc1db('0x12')]);router[_0xc1db('0xb')](_0xc1db('0x13'),auth[_0xc1db('0xc')](),controller[_0xc1db('0x14')]);router[_0xc1db('0x15')]('/',auth['isAuthenticated'](),controller[_0xc1db('0x16')]);router[_0xc1db('0x15')]('/:id/clone',auth[_0xc1db('0xc')](),controller['clone']);router[_0xc1db('0x15')](_0xc1db('0x11'),auth[_0xc1db('0xc')](),controller[_0xc1db('0x17')]);router[_0xc1db('0x15')]('/:id/resources',auth[_0xc1db('0xc')](),controller[_0xc1db('0x18')]);router[_0xc1db('0x19')](_0xc1db('0x10'),auth['isAuthenticated'](),controller[_0xc1db('0x1a')]);router[_0xc1db('0x1b')](_0xc1db('0x10'),auth[_0xc1db('0xc')](),controller[_0xc1db('0x1c')]);router[_0xc1db('0x1b')]('/:id/sections',auth[_0xc1db('0xc')](),controller[_0xc1db('0x1d')]);router[_0xc1db('0x1b')]('/:id/resources',auth['isAuthenticated'](),controller[_0xc1db('0x1e')]);module[_0xc1db('0x1f')]=router; \ No newline at end of file +var _0x1d37=['getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','put','update','delete','destroy','/:id/sections','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x31300c,_0x2823e1){var _0x462408=function(_0x1a7388){while(--_0x1a7388){_0x31300c['push'](_0x31300c['shift']());}};_0x462408(++_0x2823e1);}(_0x1d37,0x8b));var _0x71d3=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x1d37[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x71d3('0x0'));var util=require(_0x71d3('0x1'));var path=require(_0x71d3('0x2'));var timeout=require(_0x71d3('0x3'));var express=require('express');var router=express[_0x71d3('0x4')]();var fs_extra=require(_0x71d3('0x5'));var auth=require(_0x71d3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x71d3('0x7'));var controller=require(_0x71d3('0x8'));router[_0x71d3('0x9')]('/',auth[_0x71d3('0xa')](),controller[_0x71d3('0xb')]);router['get'](_0x71d3('0xc'),auth[_0x71d3('0xa')](),controller[_0x71d3('0xd')]);router[_0x71d3('0x9')](_0x71d3('0xe'),auth[_0x71d3('0xa')](),controller[_0x71d3('0xf')]);router[_0x71d3('0x9')]('/:id/sections',auth[_0x71d3('0xa')](),controller[_0x71d3('0x10')]);router['get'](_0x71d3('0x11'),auth[_0x71d3('0xa')](),controller[_0x71d3('0x12')]);router[_0x71d3('0x13')]('/',auth['isAuthenticated'](),controller[_0x71d3('0x14')]);router[_0x71d3('0x13')](_0x71d3('0x15'),auth[_0x71d3('0xa')](),controller['clone']);router[_0x71d3('0x13')]('/:id/sections',auth[_0x71d3('0xa')](),controller[_0x71d3('0x16')]);router[_0x71d3('0x13')](_0x71d3('0x11'),auth[_0x71d3('0xa')](),controller['addResources']);router[_0x71d3('0x17')](_0x71d3('0xe'),auth[_0x71d3('0xa')](),controller[_0x71d3('0x18')]);router[_0x71d3('0x19')]('/:id',auth[_0x71d3('0xa')](),controller[_0x71d3('0x1a')]);router[_0x71d3('0x19')](_0x71d3('0x1b'),auth['isAuthenticated'](),controller[_0x71d3('0x1c')]);router[_0x71d3('0x19')]('/:id/resources',auth[_0x71d3('0xa')](),controller[_0x71d3('0x1d')]);module[_0x71d3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index c63286c..110add0 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 _0x1a16=['split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions','join','getDataValue'];(function(_0x46914a,_0x16fe5f){var _0x520c41=function(_0x3c6142){while(--_0x3c6142){_0x46914a['push'](_0x46914a['shift']());}};_0x520c41(++_0x16fe5f);}(_0x1a16,0x1bb));var _0x61a1=function(_0x4179fc,_0x26e737){_0x4179fc=_0x4179fc-0x0;var _0x39959b=_0x1a16[_0x4179fc];return _0x39959b;};'use strict';var Sequelize=require(_0x61a1('0x0'));module[_0x61a1('0x1')]={'name':{'type':Sequelize[_0x61a1('0x2')],'allowNull':![],'unique':_0x61a1('0x3')},'crudPermissions':{'type':Sequelize[_0x61a1('0x2')],'set':function(_0x314929){this['setDataValue'](_0x61a1('0x4'),_0x314929?_0x314929[_0x61a1('0x5')](''):[]);},'get':function(){return this[_0x61a1('0x6')](_0x61a1('0x4'))?this[_0x61a1('0x6')](_0x61a1('0x4'))[_0x61a1('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x61a1('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x50a2=['split','BOOLEAN','sequelize','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x6f22b2,_0xc4f5e9){var _0xcb2a49=function(_0x1d85f6){while(--_0x1d85f6){_0x6f22b2['push'](_0x6f22b2['shift']());}};_0xcb2a49(++_0xc4f5e9);}(_0x50a2,0x9b));var _0x250a=function(_0x4b4bc1,_0x26a537){_0x4b4bc1=_0x4b4bc1-0x0;var _0x3cffb9=_0x50a2[_0x4b4bc1];return _0x3cffb9;};'use strict';var Sequelize=require(_0x250a('0x0'));module['exports']={'name':{'type':Sequelize[_0x250a('0x1')],'allowNull':![],'unique':_0x250a('0x2')},'crudPermissions':{'type':Sequelize[_0x250a('0x1')],'set':function(_0xa210a){this[_0x250a('0x3')](_0x250a('0x4'),_0xa210a?_0xa210a[_0x250a('0x5')](''):[]);},'get':function(){return this[_0x250a('0x6')](_0x250a('0x4'))?this['getDataValue'](_0x250a('0x4'))[_0x250a('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x250a('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x250a('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x250a('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x250a('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x250a('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x250a('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d95d18d..eb5d3d6 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 _0x29b3=['all','ignore','nolimit','order','field','foreignKey','associatedResources','AnalyticExtractedReport','reportType','default','reportId','custom','CmContact','Tag','color','ThroughTags','tag','Agents','openTabs','true','dataValues','sms','openchannel','whatsapp','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','value','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','parentSections','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','Telephones','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','WhatsappQueue','teams','Team','voicequeues','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','SugarcrmAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Interval','pauses','scheduler','Schedule','Sound','tags','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','WhatsappAccount','screenrecordings','ScreenRecording','UserId','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./userProfile.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','sendStatus','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','merge','where','VIRTUAL','filter','include','findAll','rows','catch','params','length','options','find','create','body','clone','includeAll','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','destroy','describe','addSections','removeSections','ids','getSections','includes','isEmpty','subsections','push','enabled','findOne','Dashboard','forEach','UserProfileResource','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27'];(function(_0x392279,_0x306deb){var _0x14ce48=function(_0x4c8f1e){while(--_0x4c8f1e){_0x392279['push'](_0x392279['shift']());}};_0x14ce48(++_0x306deb);}(_0x29b3,0x18a));var _0x329b=function(_0x12863d,_0x2d6969){_0x12863d=_0x12863d-0x0;var _0x53f74e=_0x29b3[_0x12863d];return _0x53f74e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x329b('0x0'));var zipdir=require(_0x329b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x329b('0x2'));var moment=require(_0x329b('0x3'));var BPromise=require(_0x329b('0x4'));var Mustache=require('mustache');var util=require(_0x329b('0x5'));var path=require(_0x329b('0x6'));var sox=require(_0x329b('0x7'));var csv=require(_0x329b('0x8'));var ejs=require(_0x329b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x329b('0xa'));var squel=require(_0x329b('0xb'));var crypto=require('crypto');var jsforce=require(_0x329b('0xc'));var deskjs=require(_0x329b('0xd'));var toCsv=require(_0x329b('0x8'));var querystring=require(_0x329b('0xe'));var Papa=require(_0x329b('0xf'));var Redis=require(_0x329b('0x10'));var authService=require(_0x329b('0x11'));var qs=require(_0x329b('0x12'));var as=require(_0x329b('0x13'));var hardwareService=require(_0x329b('0x14'));var logger=require(_0x329b('0x15'))('api');var utils=require(_0x329b('0x16'));var config=require(_0x329b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x329b('0x18')]=_[_0x329b('0x19')](config[_0x329b('0x18')],{'host':_0x329b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x329b('0x18')]));require(_0x329b('0x1b'))[_0x329b('0x1c')](socket);function respondWithStatusCode(_0x4ca67c,_0x4c6ed5){_0x4c6ed5=_0x4c6ed5||0xcc;return function(_0x3ae65d){if(_0x3ae65d){return _0x4ca67c['sendStatus'](_0x4c6ed5);}return _0x4ca67c[_0x329b('0x1d')](_0x4c6ed5)['end']();};}function respondWithResult(_0x5daef4,_0x32ed22){_0x32ed22=_0x32ed22||0xc8;return function(_0x2f3b67){if(_0x2f3b67){return _0x5daef4[_0x329b('0x1d')](_0x32ed22)[_0x329b('0x1e')](_0x2f3b67);}};}function respondWithFilteredResult(_0x78707c,_0x32fede){return function(_0x27cb5e){if(_0x27cb5e){var _0x58db48=typeof _0x32fede[_0x329b('0x1f')]===_0x329b('0x20')&&typeof _0x32fede[_0x329b('0x21')]===_0x329b('0x20');var _0x4a7c3a=_0x27cb5e['count'];var _0x21fbb9=_0x58db48?0x0:_0x32fede[_0x329b('0x1f')];var _0x45d2c2=_0x58db48?_0x27cb5e[_0x329b('0x22')]:_0x32fede[_0x329b('0x1f')]+_0x32fede[_0x329b('0x21')];var _0xadce8b;if(_0x45d2c2>=_0x4a7c3a){_0x45d2c2=_0x4a7c3a;_0xadce8b=0xc8;}else{_0xadce8b=0xce;}_0x78707c['status'](_0xadce8b);return _0x78707c[_0x329b('0x23')](_0x329b('0x24'),_0x21fbb9+'-'+_0x45d2c2+'/'+_0x4a7c3a)[_0x329b('0x1e')](_0x27cb5e);}return null;};}function patchUpdates(_0x16624f){return function(_0x5393bc){try{jsonpatch[_0x329b('0x25')](_0x5393bc,_0x16624f,!![]);}catch(_0xcb2995){return BPromise['reject'](_0xcb2995);}return _0x5393bc[_0x329b('0x26')]();};}function saveUpdates(_0x153c76,_0x6f8c49){return function(_0x4e890a){if(_0x4e890a){return _0x4e890a[_0x329b('0x27')](_0x153c76)[_0x329b('0x28')](function(_0x36ee48){return _0x36ee48;});}return null;};}function removeEntity(_0x2d93e2,_0x8a422a){return function(_0x2f1d89){if(_0x2f1d89){return _0x2f1d89['destroy']()['then'](function(){_0x2d93e2[_0x329b('0x1d')](0xcc)[_0x329b('0x29')]();});}};}function handleEntityNotFound(_0x5f22a4,_0x4de671){return function(_0x170a99){if(!_0x170a99){_0x5f22a4[_0x329b('0x2a')](0x194);}return _0x170a99;};}function handleError(_0x208389,_0x4f1b5b){_0x4f1b5b=_0x4f1b5b||0x1f4;return function(_0x4a4704){logger[_0x329b('0x2b')](_0x4a4704[_0x329b('0x2c')]);if(_0x4a4704[_0x329b('0x2d')]){delete _0x4a4704['name'];}_0x208389[_0x329b('0x1d')](_0x4f1b5b)[_0x329b('0x2e')](_0x4a4704);};}exports['index']=function(_0x55346c,_0x346498){var _0x3b4364={},_0x5016a7={},_0x1667f7={'count':0x0,'rows':[]};var _0x2afd01=_[_0x329b('0x2f')](db[_0x329b('0x30')][_0x329b('0x31')],function(_0x3261c4){return{'name':_0x3261c4[_0x329b('0x32')],'type':_0x3261c4[_0x329b('0x33')][_0x329b('0x34')]};});_0x5016a7[_0x329b('0x35')]=_[_0x329b('0x2f')](_0x2afd01,'name');_0x5016a7[_0x329b('0x36')]=_[_0x329b('0x37')](_0x55346c[_0x329b('0x36')]);_0x5016a7[_0x329b('0x38')]=_['intersection'](_0x5016a7[_0x329b('0x35')],_0x5016a7[_0x329b('0x36')]);_0x3b4364[_0x329b('0x39')]=_[_0x329b('0x3a')](_0x5016a7[_0x329b('0x35')],qs[_0x329b('0x3b')](_0x55346c['query'][_0x329b('0x3b')]));_0x3b4364[_0x329b('0x39')]=_0x3b4364['attributes']['length']?_0x3b4364[_0x329b('0x39')]:_0x5016a7['model'];if(!_0x55346c[_0x329b('0x36')][_0x329b('0x3c')]('nolimit')){_0x3b4364[_0x329b('0x21')]=qs[_0x329b('0x21')](_0x55346c['query']['limit']);_0x3b4364[_0x329b('0x1f')]=qs[_0x329b('0x1f')](_0x55346c[_0x329b('0x36')][_0x329b('0x1f')]);}_0x3b4364['order']=qs['sort'](_0x55346c[_0x329b('0x36')][_0x329b('0x3d')]);_0x3b4364['where']=qs[_0x329b('0x38')](_[_0x329b('0x3e')](_0x55346c[_0x329b('0x36')],_0x5016a7[_0x329b('0x38')]),_0x2afd01);if(_0x55346c[_0x329b('0x36')]['filter']){_0x3b4364['where']=_[_0x329b('0x3f')](_0x3b4364[_0x329b('0x40')],{'$or':_[_0x329b('0x2f')](_0x2afd01,function(_0x3b09d4){if(_0x3b09d4[_0x329b('0x33')]!==_0x329b('0x41')){var _0x3e8706={};_0x3e8706[_0x3b09d4[_0x329b('0x2d')]]={'$like':'%'+_0x55346c[_0x329b('0x36')][_0x329b('0x42')]+'%'};return _0x3e8706;}})});}_0x3b4364=_[_0x329b('0x3f')]({},_0x3b4364,_0x55346c['options']);var _0x55de9d={'where':_0x3b4364[_0x329b('0x40')]};return db[_0x329b('0x30')][_0x329b('0x22')](_0x55de9d)[_0x329b('0x28')](function(_0x5137a7){_0x1667f7[_0x329b('0x22')]=_0x5137a7;if(_0x55346c[_0x329b('0x36')]['includeAll']){_0x3b4364[_0x329b('0x43')]=[{'all':!![]}];}return db[_0x329b('0x30')][_0x329b('0x44')](_0x3b4364);})[_0x329b('0x28')](function(_0x40729d){_0x1667f7[_0x329b('0x45')]=_0x40729d;return _0x1667f7;})[_0x329b('0x28')](respondWithFilteredResult(_0x346498,_0x3b4364))[_0x329b('0x46')](handleError(_0x346498,null));};exports['show']=function(_0x3e3507,_0x193f69){var _0x54df29={'raw':![],'where':{'id':_0x3e3507[_0x329b('0x47')]['id']}},_0x34e65a={};_0x34e65a[_0x329b('0x35')]=_[_0x329b('0x37')](db[_0x329b('0x30')]['rawAttributes']);_0x34e65a[_0x329b('0x36')]=_['keys'](_0x3e3507['query']);_0x34e65a['filters']=_['intersection'](_0x34e65a[_0x329b('0x35')],_0x34e65a[_0x329b('0x36')]);_0x54df29['attributes']=_[_0x329b('0x3a')](_0x34e65a[_0x329b('0x35')],qs['fields'](_0x3e3507['query'][_0x329b('0x3b')]));_0x54df29[_0x329b('0x39')]=_0x54df29[_0x329b('0x39')][_0x329b('0x48')]?_0x54df29[_0x329b('0x39')]:_0x34e65a[_0x329b('0x35')];if(_0x3e3507['query']['includeAll']){_0x54df29[_0x329b('0x43')]=[{'all':!![]}];}_0x54df29=_['merge']({},_0x54df29,_0x3e3507[_0x329b('0x49')]);return db[_0x329b('0x30')][_0x329b('0x4a')](_0x54df29)[_0x329b('0x28')](handleEntityNotFound(_0x193f69,null))[_0x329b('0x28')](respondWithResult(_0x193f69,null))['catch'](handleError(_0x193f69,null));};exports['create']=function(_0x40f72d,_0x3f0168){return db['UserProfile'][_0x329b('0x4b')](_0x40f72d[_0x329b('0x4c')],{})[_0x329b('0x28')](respondWithResult(_0x3f0168,0xc9))[_0x329b('0x46')](handleError(_0x3f0168,null));};exports[_0x329b('0x4d')]=function(_0x164c82,_0x1d9ed5){var _0x5491b1={'where':{'id':_0x164c82['params']['id']}},_0x172899={};_0x172899[_0x329b('0x35')]=_[_0x329b('0x37')](db[_0x329b('0x30')][_0x329b('0x31')]);_0x5491b1[_0x329b('0x39')]=_[_0x329b('0x3a')](_0x172899[_0x329b('0x35')],qs['fields'](_0x164c82[_0x329b('0x36')][_0x329b('0x3b')]));_0x5491b1[_0x329b('0x39')]=_0x5491b1[_0x329b('0x39')]['length']?_0x5491b1[_0x329b('0x39')]:_0x172899['model'];if(_0x164c82[_0x329b('0x36')][_0x329b('0x4e')]){_0x5491b1[_0x329b('0x43')]=[{'all':!![]}];}_0x5491b1=_[_0x329b('0x3f')]({},_0x5491b1,_0x164c82[_0x329b('0x49')]);return db[_0x329b('0x30')][_0x329b('0x4a')](_0x5491b1)['then'](handleEntityNotFound(_0x1d9ed5,null))[_0x329b('0x28')](function(_0x33bd0c){if(_0x33bd0c){var _0x5de8a2=_0x33bd0c[_0x329b('0x4f')]({'plain':!![]});_0x5de8a2=qs[_0x329b('0x50')](_0x5de8a2,['id',_0x329b('0x51'),'updatedAt',_0x329b('0x52')]);_0x164c82[_0x329b('0x4c')]=_[_0x329b('0x50')](_0x164c82[_0x329b('0x4c')],['id',_0x329b('0x51'),_0x329b('0x53')]);return db[_0x329b('0x54')][_0x329b('0x55')](function(_0x149947){return db[_0x329b('0x30')][_0x329b('0x4b')](_[_0x329b('0x3f')](_0x5de8a2,_0x164c82[_0x329b('0x4c')]),{'include':_0x164c82[_0x329b('0x36')][_0x329b('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x149947})['then'](function(_0x4f6425){var _0x34ccaf=_0x4f6425['get']({'plain':!![]});return db[_0x329b('0x56')][_0x329b('0x44')]({'where':{'userProfileId':_0x164c82[_0x329b('0x47')]['id']},'raw':!![]})[_0x329b('0x28')](function(_0x486cfc){if(_0x486cfc){return BPromise[_0x329b('0x57')](_0x486cfc,function(_0x18d238){return new BPromise(function(_0x8259d6,_0x5a41a3){if(_0x18d238[_0x329b('0x58')]===null||_0x18d238[_0x329b('0x58')]===0x1)_0x8259d6(null);return db['UserProfileResource'][_0x329b('0x44')]({'where':{'sectionId':_0x18d238['id']},'raw':!![]})['then'](function(_0x5c24cf){var _0x4c1de6=_['map'](_0x5c24cf,function(_0x30fbe9){return qs[_0x329b('0x50')](_0x30fbe9,['id',_0x329b('0x51'),_0x329b('0x53'),_0x329b('0x59')]);});_0x8259d6(_0x4c1de6);})[_0x329b('0x46')](function(_0x41bac1){_0x5a41a3(_0x41bac1);});})[_0x329b('0x28')](function(_0x2bc582){var _0x25e5d0=qs['omit'](_0x18d238,['id',_0x329b('0x51'),'updatedAt']);_0x25e5d0[_0x329b('0x5a')]=_0x34ccaf['id'];if(_0x2bc582)_0x25e5d0[_0x329b('0x5b')]=_0x2bc582;return _0x25e5d0;})[_0x329b('0x28')](function(_0x5ec027){return db[_0x329b('0x56')][_0x329b('0x4b')](_0x5ec027,{'include':[{'model':db['UserProfileResource'],'as':_0x329b('0x5b')}],'raw':!![],'transaction':_0x149947});});})['then'](function(){return _0x34ccaf;});}});});});}})['then'](respondWithResult(_0x1d9ed5,0xc9))[_0x329b('0x46')](handleError(_0x1d9ed5,null));};exports[_0x329b('0x27')]=function(_0x2d7d6d,_0x5b524c){if(_0x2d7d6d['body']['id']){delete _0x2d7d6d[_0x329b('0x4c')]['id'];}return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x2d7d6d['params']['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x5b524c,null))[_0x329b('0x28')](saveUpdates(_0x2d7d6d[_0x329b('0x4c')],null))[_0x329b('0x28')](respondWithResult(_0x5b524c,null))['catch'](handleError(_0x5b524c,null));};exports[_0x329b('0x5c')]=function(_0x3f25f0,_0x1c915a){return db['UserProfile'][_0x329b('0x4a')]({'where':{'id':_0x3f25f0[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x1c915a,null))['then'](removeEntity(_0x1c915a,null))['catch'](handleError(_0x1c915a,null));};exports['describe']=function(_0x49cd26,_0x235938){return db[_0x329b('0x30')][_0x329b('0x5d')]()[_0x329b('0x28')](respondWithResult(_0x235938,null))[_0x329b('0x46')](handleError(_0x235938,null));};exports[_0x329b('0x5e')]=function(_0x5bf714,_0x192e2a){var _0x3a3eae=_0x5bf714['body'];return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x5bf714[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x192e2a,null))['then'](function(_0x467769){if(_0x467769){return db[_0x329b('0x54')][_0x329b('0x55')](function(_0xafeb16){return db[_0x329b('0x56')]['destroy']({'where':{'userProfileId':_0x5bf714[_0x329b('0x47')]['id'],'sectionId':_[_0x329b('0x2f')](_0x3a3eae,function(_0x5187e5){return _0x5187e5[_0x329b('0x59')];})},'transaction':_0xafeb16})[_0x329b('0x28')](function(){var _0x2061f4=_[_0x329b('0x2f')](_0x3a3eae,function(_0x50a697){_0x50a697[_0x329b('0x5a')]=_0x5bf714['params']['id'];return _0x50a697;});var _0x5b686a=[];return BPromise[_0x329b('0x57')](_0x2061f4,function(_0x3f904e){return db[_0x329b('0x56')]['create'](_0x3f904e,{'include':[{'model':db['UserProfileResource'],'as':_0x329b('0x5b')}],'raw':!![],'transaction':_0xafeb16})[_0x329b('0x28')](function(_0x7d692c){_0x5b686a['push'](_0x7d692c[_0x329b('0x4f')]({'plain':!![]}));});})[_0x329b('0x28')](function(){return _0x5b686a;});});});}})[_0x329b('0x28')](function(_0x43d433){return _0x43d433;})['then'](respondWithResult(_0x192e2a,null))['catch'](handleError(_0x192e2a,null));};exports[_0x329b('0x5f')]=function(_0xfc7649,_0x30e8c6){var _0x536598;return db['UserProfile']['find']({'where':{'id':_0xfc7649['params']['id']},'attributes':['id',_0x329b('0x2d')]})[_0x329b('0x28')](handleEntityNotFound(_0x30e8c6,null))[_0x329b('0x28')](function(_0x32ab0b){if(_0x32ab0b){_0x536598=_0x32ab0b;return db[_0x329b('0x56')][_0x329b('0x5c')]({'where':{'userProfileId':_0xfc7649[_0x329b('0x47')]['id'],'sectionId':_0xfc7649[_0x329b('0x36')][_0x329b('0x60')]}});}})[_0x329b('0x28')](function(){return _0x536598;})[_0x329b('0x28')](respondWithStatusCode(_0x30e8c6,null))['catch'](handleError(_0x30e8c6,null));};exports[_0x329b('0x61')]=function(_0x3bd494,_0x39e0ea){var _0x2d4f56=[];var _0x230b11=[];return db[_0x329b('0x56')][_0x329b('0x44')]({'where':{'userProfileId':_0x3bd494[_0x329b('0x47')]['id']},'raw':!![]})[_0x329b('0x28')](function(_0x56bdb5){_0x2d4f56=_[_0x329b('0x42')](_0x56bdb5,function(_0x8501f7){return _0x8501f7['enabled']===0x1||_[_0x329b('0x62')]([0x3eb,0x709],_0x8501f7[_0x329b('0x59')]);});if(!_[_0x329b('0x63')](_0x2d4f56)){return _[_0x329b('0x2f')](_0x2d4f56,function(_0x39b31c){return _0x39b31c['sectionId'];});}else{return;}})[_0x329b('0x28')](function(_0x4e32a3){if(_0x4e32a3)_0x230b11=_0x4e32a3;if(_[_0x329b('0x62')](_0x230b11,0x64)){var _0x304f79=_['find'](_0x2d4f56,{'sectionId':0x64});return hasDefaultDashboard(_0x304f79)[_0x329b('0x28')](function(_0x28ba97){return _[_0x329b('0x2f')](_0x2d4f56,function(_0x43ce47){if(_0x43ce47['sectionId']===0x64){_0x43ce47[_0x329b('0x64')]=_0x28ba97;}return _0x43ce47;});});}else{return;}})[_0x329b('0x28')](function(_0x3efd72){if(_0x3efd72)_0x2d4f56=_0x3efd72;if(_[_0x329b('0x62')](_0x230b11,0x3eb)){var _0x476e5f=_['find'](_0x2d4f56,{'sectionId':0x3eb});return getCustomDashboards(_0x476e5f)[_0x329b('0x28')](function(_0x5bf0f9){return _['map'](_0x2d4f56,function(_0x1b12b2){if(_0x476e5f['enabled']){if(_0x1b12b2[_0x329b('0x59')]===0x3eb){_0x1b12b2[_0x329b('0x64')]=_0x5bf0f9;}}else{if(_0x1b12b2[_0x329b('0x59')]===0x64){_0x1b12b2[_0x329b('0x64')]=_0x5bf0f9;}}return _0x1b12b2;});});}else{return;}})[_0x329b('0x28')](function(_0x28f1a6){if(_0x28f1a6)_0x2d4f56=_0x28f1a6;if(_[_0x329b('0x62')](_0x230b11,0x709)){var _0x2a90ca=_['find'](_0x2d4f56,{'sectionId':0x709});return getPlugins(_0x2a90ca)[_0x329b('0x28')](function(_0x304fe0){if(_0x2a90ca['enabled']){return _['map'](_0x2d4f56,function(_0x31593c){if(_0x31593c[_0x329b('0x59')]===0x709){_0x31593c[_0x329b('0x64')]=_0x304fe0;}return _0x31593c;});}else{var _0x274f9f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x304fe0};var _0xa5b6b7=_[_0x329b('0x2f')](_0x2d4f56);_0xa5b6b7[_0x329b('0x65')](_0x274f9f);return _0xa5b6b7;}});}else{return;}})[_0x329b('0x28')](function(_0x71a507){if(_0x71a507)_0x2d4f56=_0x71a507;return _[_0x329b('0x42')](_0x2d4f56,[_0x329b('0x66'),0x1]);})[_0x329b('0x28')](respondWithResult(_0x39e0ea,null))[_0x329b('0x46')](handleError(_0x39e0ea,null));};function hasDefaultDashboard(_0x5bf668){var _0x5ac09c=[0x65];return new BPromise(function(_0x34fd66,_0x1b9bb5){try{if(_0x5bf668[_0x329b('0x58')]){_0x34fd66(_0x5ac09c);}else{return db['UserProfileResource'][_0x329b('0x67')]({'where':{'sectionId':_0x5bf668['id']},'raw':!![]})[_0x329b('0x28')](function(_0x97bce7){_0x97bce7?_0x34fd66(_0x5ac09c):_0x34fd66();});}}catch(_0x2dfbca){_0x1b9bb5(_0x2dfbca);}});}function getCustomDashboards(_0xad1e50){var _0x520f76=[];return new BPromise(function(_0x45b977,_0xf7bbe8){try{if(_0xad1e50[_0x329b('0x58')]){return db[_0x329b('0x68')][_0x329b('0x44')]({'raw':!![]})[_0x329b('0x28')](function(_0x36d4ba){_0x36d4ba[_0x329b('0x69')](function(_0x43a3e7){_0x520f76['push'](_0x43a3e7['id']+0x1869f);});_0x45b977(_0x520f76);});}else{return db[_0x329b('0x6a')][_0x329b('0x44')]({'where':{'sectionId':_0xad1e50['id']},'raw':!![]})[_0x329b('0x28')](function(_0x18577e){_0x18577e[_0x329b('0x69')](function(_0x3d4740){_0x520f76[_0x329b('0x65')](_0x3d4740[_0x329b('0x6b')]+0x1869f);});_0x45b977(_0x520f76);});}}catch(_0x794037){_0xf7bbe8(_0x794037);}});}function getPlugins(_0x4ad765){var _0x2415f7=[];return new BPromise(function(_0xa41445,_0x102e03){try{if(_0x4ad765[_0x329b('0x58')]){return db[_0x329b('0x6c')]['findAll']({'raw':!![]})['then'](function(_0x3062d0){_0x3062d0[_0x329b('0x69')](function(_0x239890){_0x2415f7[_0x329b('0x65')](_0x239890['id']+0x15b38);});_0xa41445(_0x2415f7);});}else{return db['UserProfileResource'][_0x329b('0x44')]({'where':{'sectionId':_0x4ad765['id']},'raw':!![]})[_0x329b('0x28')](function(_0x161c2d){_0x161c2d[_0x329b('0x69')](function(_0x217907){_0x2415f7['push'](_0x217907[_0x329b('0x6b')]+0x15b38);});_0xa41445(_0x2415f7);});}}catch(_0x2bc7d7){_0x102e03(_0x2bc7d7);}});}exports[_0x329b('0x6d')]=function(_0x5d1472,_0x508337){return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x5d1472['params']['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x508337,null))['then'](function(_0x44c39c){if(_0x44c39c){return db[_0x329b('0x54')][_0x329b('0x55')](function(_0x352e0e){return db[_0x329b('0x56')][_0x329b('0x44')]({'where':{'userProfileId':_0x5d1472[_0x329b('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x329b('0x28')](function(_0x17ad92){if(_0x17ad92){return db[_0x329b('0x56')][_0x329b('0x5c')]({'where':{'userProfileId':_0x5d1472[_0x329b('0x47')]['id'],'id':_['map'](_0x17ad92,function(_0x3dd483){return _0x3dd483['id'];})},'transaction':_0x352e0e});}})[_0x329b('0x28')](function(_0x40d2e2){var _0x200577=_[_0x329b('0x2f')](_0x5d1472['body'],function(_0xc6cfe1){_0xc6cfe1['userProfileId']=_0x5d1472[_0x329b('0x47')]['id'];return _0xc6cfe1;});return db['UserProfileSection']['bulkCreate'](_0x200577,{'raw':!![],'transaction':_0x352e0e});})[_0x329b('0x28')](function(_0x4cc0e5){var _0x4b0df8=_[_0x329b('0x42')](_[_0x329b('0x2f')](_0x4cc0e5,function(_0x29249d){return _0x29249d['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4b0df8){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5d1472[_0x329b('0x47')]['id'],'sectionId':_[_0x329b('0x2f')](_0x4b0df8,function(_0x2620ba){return _0x2620ba[_0x329b('0x59')];})},'attributes':['id',_0x329b('0x59')],'raw':!![]})[_0x329b('0x28')](function(_0x2f1fd9){var _0x3cb01e=_['map'](_0x5d1472[_0x329b('0x4c')],function(_0x2cc08a){_0x2cc08a[_0x329b('0x5a')]=_0x5d1472[_0x329b('0x47')]['id'];return _0x2cc08a;});return db[_0x329b('0x6a')][_0x329b('0x6e')](_0x3cb01e,{'raw':!![],'transaction':_0x352e0e});});}})[_0x329b('0x46')](handleError(_0x508337,null));});}})[_0x329b('0x28')](function(_0x5437d6){var _0x361e3e=_[_0x329b('0x2f')](_0x5437d6,function(_0x56109e){return _0x56109e[_0x329b('0x4f')]({'plain':!![]});});})[_0x329b('0x28')](respondWithResult(_0x508337,null))[_0x329b('0x46')](handleError(_0x508337,null));};exports['removeResources']=function(_0x274d70,_0x561fac,_0x23982a){return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x274d70[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x561fac,null))[_0x329b('0x28')](function(_0x498bcb){if(_0x498bcb){return _0x498bcb[_0x329b('0x6f')](_0x274d70[_0x329b('0x36')][_0x329b('0x60')]);}})[_0x329b('0x28')](respondWithStatusCode(_0x561fac,null))[_0x329b('0x46')](handleError(_0x561fac,null));};exports[_0x329b('0x70')]=function(_0x4f707d,_0x44f9c2){var _0x49efbb={'raw':![],'where':{}};var _0x5aa8f4={};var _0x1bc416={'count':0x0,'rows':[]};var _0x52bcda=_0x4f707d[_0x329b('0x36')]['section'];if(typeof _0x52bcda===_0x329b('0x20')){throw new db['Sequelize'][(_0x329b('0x71'))](_0x329b('0x72'));}var _0x5658dc=_0x4f707d[_0x329b('0x36')][_0x329b('0x73')]||![];var _0x44cc7b=getQueryModels(_0x52bcda,_0x5658dc);if(typeof _0x44cc7b[_0x329b('0x74')]==='undefined'){throw new db['Sequelize']['ValidationError'](_0x329b('0x75')+_0x52bcda+'\x27');}var _0x439d31=[];if(!_[_0x329b('0x63')](_0x44cc7b['parentSections'])){_0x439d31=_0x44cc7b['parentSections'];}else{_0x439d31=[{'name':_0x52bcda}];}return db[_0x329b('0x30')][_0x329b('0x67')]({'where':{'id':_0x4f707d[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x44f9c2,null))[_0x329b('0x28')](function(_0x157e4b){if(_0x157e4b){var _0x46e7b9=[];for(var _0xa393a7=0x0;_0xa393a7<_0x439d31['length'];_0xa393a7++){_0x46e7b9['push'](db[_0x329b('0x56')][_0x329b('0x67')]({'where':{'userProfileId':_0x157e4b['id'],'name':_0x439d31[_0xa393a7][_0x329b('0x2d')]},'raw':!![]}));}return BPromise[_0x329b('0x76')](_0x46e7b9);}})[_0x329b('0x28')](function(_0x460759){var _0x545b7f=_['filter'](_0x460759,function(_0x5a4df3){return _0x5a4df3?_0x5a4df3:undefined;});var _0x455768=_[_0x329b('0x42')](_0x439d31,[_0x329b('0x77'),!![]]);var _0x576e81=_[_0x329b('0x63')](_0x545b7f)&&_[_0x329b('0x63')](_0x455768)?null:_['union'](_0x455768,_0x545b7f);if(_0x576e81){var _0x4ab8a4=[];for(var _0x13ba32=0x0;_0x13ba32<_0x576e81[_0x329b('0x48')];_0x13ba32++){var _0x2b2433=_[_0x329b('0x4a')](_0x439d31,function(_0x4ae60b){return _0x576e81[_0x13ba32]?_0x4ae60b[_0x329b('0x2d')]===_0x576e81[_0x13ba32][_0x329b('0x2d')]:null;});if(_0x2b2433){if(_0x576e81[_0x13ba32][_0x329b('0x77')]){_0x4ab8a4[_0x329b('0x65')](getAllResources(_0x44cc7b[_0x329b('0x74')],_0x576e81[_0x13ba32]));}else{if(!_0x576e81[_0x13ba32][_0x329b('0x58')]){_0x4ab8a4[_0x329b('0x65')](getAllowedResources(_0x2b2433,_0x576e81[_0x13ba32],_0x44cc7b[_0x329b('0x74')]));}else{if(_0x2b2433[_0x329b('0x35')]){_0x4ab8a4['push'](getAllFilteredResources(_0x2b2433,_0x576e81[_0x13ba32]));}}}}}return BPromise[_0x329b('0x76')](_0x4ab8a4);}else{return null;}})[_0x329b('0x28')](function(_0x4fae2e){var _0xb16de3=_0x4fae2e;var _0x482806=null;if(_0xb16de3){_0x482806=_0xb16de3[_0x329b('0x48')]===0x1?_0xb16de3[0x0]:null;}if(_0x482806||_0xb16de3){var _0x5e7d16=db[_0x44cc7b['childModel']]['rawAttributes'];_0x5aa8f4['model']=_[_0x329b('0x37')](_0x5e7d16);_0x5aa8f4[_0x329b('0x36')]=_['keys'](_0x4f707d[_0x329b('0x36')]);_0x5aa8f4[_0x329b('0x38')]=_[_0x329b('0x3a')](_0x5aa8f4[_0x329b('0x35')],_0x5aa8f4[_0x329b('0x36')]);_0x49efbb[_0x329b('0x39')]=_[_0x329b('0x3a')](_0x5aa8f4[_0x329b('0x35')],qs[_0x329b('0x3b')](_0x4f707d[_0x329b('0x36')][_0x329b('0x3b')]));_0x49efbb[_0x329b('0x39')]=_0x49efbb[_0x329b('0x39')][_0x329b('0x48')]?_0x49efbb[_0x329b('0x39')]:_0x5aa8f4[_0x329b('0x35')];if(!_0x4f707d[_0x329b('0x36')][_0x329b('0x3c')](_0x329b('0x78'))){_0x49efbb[_0x329b('0x21')]=qs[_0x329b('0x21')](_0x4f707d[_0x329b('0x36')][_0x329b('0x21')]);_0x49efbb[_0x329b('0x1f')]=qs[_0x329b('0x1f')](_0x4f707d['query'][_0x329b('0x1f')]);}_0x49efbb[_0x329b('0x79')]=qs[_0x329b('0x3d')](_0x4f707d[_0x329b('0x36')][_0x329b('0x3d')]);_0x49efbb['where']=qs[_0x329b('0x38')](_['pick'](_0x4f707d[_0x329b('0x36')],_0x5aa8f4[_0x329b('0x38')]));if(_0x4f707d[_0x329b('0x36')][_0x329b('0x42')]){_0x49efbb[_0x329b('0x40')]=_['merge'](_0x49efbb[_0x329b('0x40')],{'$or':_['map'](_0x5e7d16,function(_0xa3177c){if(_0xa3177c[_0x329b('0x33')]['key']!==_0x329b('0x41')){var _0x904a14={};_0x904a14[_0xa3177c[_0x329b('0x7a')]]={'$like':'%'+_0x4f707d['query'][_0x329b('0x42')]+'%'};return _0x904a14;}})});}var _0x3ba693=[];if(_0x482806){var _0x3328ae=_[_0x329b('0x4a')](_0x439d31,[_0x329b('0x2d'),_0x482806[_0x329b('0x2d')]]);if(_0x3328ae[_0x329b('0x7a')]){var _0x58cace={};if(_0x44cc7b[_0x329b('0x74')]==='AnalyticExtractedReport'){_0x58cace[_0x3328ae[_0x329b('0x7b')]]=_[_0x329b('0x2f')](_0x482806[_0x329b('0x7c')],'id');}else{_0x58cace[_0x3328ae[_0x329b('0x7b')]]=_0x482806[_0x329b('0x7c')];}_0x3ba693[_0x329b('0x65')](_0x58cace);}else{_0x49efbb[_0x329b('0x40')]['id']=_0x482806['associatedResources'];}}else{for(var _0x3a7d10=0x0;_0x3a7d10<_0xb16de3[_0x329b('0x48')];_0x3a7d10++){var _0x3328ae=_[_0x329b('0x4a')](_0x439d31,[_0x329b('0x2d'),_0xb16de3[_0x3a7d10][_0x329b('0x2d')]]);if(_0x3328ae[_0x329b('0x7a')]){var _0x58cace={};_0x58cace[_0x3328ae[_0x329b('0x7b')]]=_0xb16de3[_0x3a7d10][_0x329b('0x7c')];_0x3ba693['push'](_0x58cace);}else{if(!_0x49efbb[_0x329b('0x40')]['id'])_0x49efbb[_0x329b('0x40')]['id']=[];_0xb16de3[_0x3a7d10][_0x329b('0x7c')][_0x329b('0x69')](function(_0x453c5a){_0x49efbb[_0x329b('0x40')]['id'][_0x329b('0x65')](_0x453c5a);});}}}if(!_[_0x329b('0x63')](_0x3ba693)){_0x49efbb[_0x329b('0x40')]=_[_0x329b('0x3f')](_0x49efbb['where'],{'$and':{'$or':_0x3ba693}});}_0x49efbb=_[_0x329b('0x3f')]({},_0x49efbb,_0x4f707d['options']);if(_0x482806&&!_0x482806['autoAssociation']&&_0x44cc7b[_0x329b('0x74')]===_0x329b('0x7d')){if(_0x4f707d['query']['includeAll']){_0x49efbb[_0x329b('0x43')]=[{'all':!![]}];}return db[_0x44cc7b[_0x329b('0x74')]]['findAll'](_0x49efbb)['then'](function(_0x1088bc){var _0x18f99e=[];_0x1088bc[_0x329b('0x69')](function(_0x55a377){var _0x97eee9;switch(_0x55a377[_0x329b('0x7e')]){case _0x329b('0x7f'):_0x97eee9=_[_0x329b('0x4a')](_0x482806['associatedResources'],function(_0x1aacbb){return _0x1aacbb['id']===_0x55a377[_0x329b('0x80')]&&_0x1aacbb['type']==='DefaultReports';});break;case _0x329b('0x81'):_0x97eee9=_['find'](_0x482806['associatedResources'],function(_0x466599){return _0x466599['id']===_0x55a377[_0x329b('0x80')]&&_0x466599[_0x329b('0x33')]==='CustomReports';});break;}if(_0x97eee9)_0x18f99e[_0x329b('0x65')](_0x55a377);});_0x1bc416[_0x329b('0x22')]=_0x18f99e[_0x329b('0x48')];_0x1bc416['rows']=_0x18f99e;return _0x1bc416;});}else{return db[_0x44cc7b[_0x329b('0x74')]][_0x329b('0x22')]({'where':_0x49efbb[_0x329b('0x40')]})[_0x329b('0x28')](function(_0x2bb131){_0x1bc416[_0x329b('0x22')]=_0x2bb131;if(_0x4f707d[_0x329b('0x36')]['includeAll']){if(_0x44cc7b[_0x329b('0x74')]===_0x329b('0x82')){_0x49efbb[_0x329b('0x43')]=[{'model':db[_0x329b('0x83')],'as':'Tags','attributes':['id',_0x329b('0x2d'),_0x329b('0x84')],'required':_0x4f707d['query']['tag']?!![]:![]},{'model':db[_0x329b('0x83')],'as':_0x329b('0x85'),'attributes':['id',_0x329b('0x2d'),_0x329b('0x84')],'through':_0x4f707d[_0x329b('0x36')][_0x329b('0x86')]?{'attributes':[],'where':{'TagId':_0x4f707d['query']['tag']||undefined}}:{},'required':_0x4f707d['query'][_0x329b('0x86')]?!![]:![]}];}else{_0x49efbb[_0x329b('0x43')]=[{'all':!![]}];}}return db[_0x44cc7b['childModel']][_0x329b('0x44')](_0x49efbb);})[_0x329b('0x28')](function(_0x4de1fc){_0x1bc416['rows']=_0x4de1fc;if(_0x52bcda===_0x329b('0x87')&&_0x4f707d[_0x329b('0x36')][_0x329b('0x88')]===_0x329b('0x89')){var _0x8ea6e6=[];for(var _0x28b449=0x0;_0x28b449<_0x1bc416[_0x329b('0x45')]['length'];_0x28b449++){_0x8ea6e6['push'](getOpenTabs('chat',_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs(_0x329b('0x8b'),_0x1bc416[_0x329b('0x45')][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs('fax',_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs('mail',_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs(_0x329b('0x8c'),_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs(_0x329b('0x8d'),_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));}return Promise[_0x329b('0x76')](_0x8ea6e6)[_0x329b('0x28')](function(){return _0x1bc416;});}return _0x1bc416;});}}else{return _0x1bc416;}})[_0x329b('0x28')](respondWithFilteredResult(_0x44f9c2,_0x49efbb))[_0x329b('0x46')](handleError(_0x44f9c2,null));};function getOpenTabs(_0x3075a7,_0x49f70e){var _0x134289=_0x3075a7[_0x329b('0x8e')](0x0)[_0x329b('0x8f')]()+_0x3075a7[_0x329b('0x90')](0x1);var _0xc48158={'type':db[_0x329b('0x91')][_0x329b('0x92')][_0x329b('0x93')],'raw':!![]};return new BPromise(function(_0x25388f,_0x3aca4d){var _0x26fde9=squel[_0x329b('0x94')]()[_0x329b('0x7a')](_0x329b('0x95')+_0x134289+_0x329b('0x96'),'id')['field'](_0x329b('0x97'))[_0x329b('0x98')]('user_has_'+_0x3075a7+_0x329b('0x99'),'ui')[_0x329b('0x40')](_0x329b('0x9a'),_0x49f70e['id']);return db[_0x329b('0x54')]['query'](_0x26fde9[_0x329b('0x9b')](),_0xc48158)['then'](function(_0x10789b){_0x49f70e[_0x134289+_0x329b('0x9c')]=_0x10789b;_0x25388f(_0x10789b);})[_0x329b('0x46')](function(_0x58d006){_0x3aca4d(_0x58d006);});});}function getAllResources(_0x23c488,_0x107e07){return new BPromise(function(_0x44b830,_0x3bc7b4){if(_0x107e07){var _0x53ca02=_0x107e07['filter']?{[_0x107e07[_0x329b('0x42')][_0x329b('0x7a')]]:_0x107e07['filter']['value']}:undefined;return db[_0x23c488][_0x329b('0x44')]({'where':_0x53ca02,'raw':!![]})[_0x329b('0x28')](function(_0x5737d0){_0x107e07['associatedResources']=_[_0x329b('0x2f')](_0x5737d0,'id');_0x44b830(_0x107e07);})['catch'](function(_0x4b62f0){_0x3bc7b4(_0x4b62f0);});}else{_0x44b830(null);}});}function getAllFilteredResources(_0x440dc5,_0xdac82a){return new BPromise(function(_0x47f553,_0x16db25){var _0x4d97da=_0x440dc5[_0x329b('0x42')]?{[_0x440dc5[_0x329b('0x42')][_0x329b('0x7a')]]:_0x440dc5[_0x329b('0x42')][_0x329b('0x9d')]}:undefined;return db[_0x440dc5['model']]['findAll']({'where':_0x4d97da,'raw':!![]})[_0x329b('0x28')](function(_0x55f87c){_0xdac82a['associatedResources']=_[_0x329b('0x2f')](_0x55f87c,function(_0x185cb5){return _0x440dc5[_0x329b('0x7a')]?_0x185cb5[_0x440dc5[_0x329b('0x7a')]]:_0x185cb5[_0x329b('0x2d')];});_0x47f553(_0xdac82a);})[_0x329b('0x46')](function(_0xdc1f06){_0x16db25(_0xdc1f06);});});}function getAllowedResources(_0x523c18,_0x531f96,_0x288901){return new BPromise(function(_0x1dbec6,_0x1afcd4){if(_0x531f96){return db[_0x329b('0x6a')]['findAll']({'where':{'sectionId':_0x531f96['id']},'raw':!![]})[_0x329b('0x28')](function(_0x4988f7){if(_0x523c18[_0x329b('0x7a')]&&_0x523c18[_0x329b('0x7a')]!=='id'){_0x531f96[_0x329b('0x7c')]=_[_0x329b('0x2f')](_0x4988f7,function(_0x24208e){return _0x24208e[_0x523c18['field']];});}else{if(_0x288901===_0x329b('0x7d')){_0x531f96[_0x329b('0x7c')]=_[_0x329b('0x2f')](_0x4988f7,function(_0x1a635d){return{'id':_0x1a635d[_0x329b('0x6b')],'type':_0x1a635d['type']};});}else{_0x531f96[_0x329b('0x7c')]=_[_0x329b('0x2f')](_0x4988f7,function(_0x108ddb){return _0x108ddb[_0x329b('0x6b')];});}}_0x1dbec6(_0x531f96);})[_0x329b('0x46')](function(_0x5f02bf){_0x1afcd4(_0x5f02bf);});}else{_0x1dbec6(null);}});}function getQueryModels(_0x55ed19,_0x361e6d){var _0x425c03=_0x55ed19[_0x329b('0x9e')]();var _0xd3157={'childModel':undefined,'parentSections':[]};switch(_0x425c03){case'squareprojects':_0xd3157['childModel']=_0x329b('0x9f');break;case _0x329b('0xa0'):_0xd3157[_0x329b('0x74')]=_0x329b('0xa1');break;case _0x329b('0xa2'):_0xd3157[_0x329b('0x74')]=_0x329b('0xa3');_0xd3157['parentSections']=[{'name':_0x329b('0xa4'),'field':_0x329b('0x2d'),'foreignKey':_0x329b('0xa5')}];break;case _0x329b('0xa6'):_0xd3157[_0x329b('0x74')]=_0x329b('0xa7');break;case'contacts':_0xd3157[_0x329b('0x74')]=_0x329b('0x82');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0xa9'),'field':'id','foreignKey':'ListId'}];break;case _0x329b('0xaa'):_0xd3157[_0x329b('0x74')]=_0x329b('0xab');break;case _0x329b('0xac'):_0xd3157[_0x329b('0x74')]=_0x329b('0xad');break;case _0x329b('0xae'):_0xd3157[_0x329b('0x74')]=_0x329b('0xaf');break;case _0x329b('0xb0'):_0xd3157['childModel']=_0x329b('0xb1');break;case _0x329b('0xb2'):_0xd3157[_0x329b('0x74')]=_0x329b('0xb3');break;case'faxqueues':_0xd3157['childModel']=_0x329b('0xb4');break;case _0x329b('0xb5'):_0xd3157[_0x329b('0x74')]='FaxAccount';break;case'inboundroutes':case _0x329b('0xb6'):case _0x329b('0xb7'):_0xd3157[_0x329b('0x74')]=_0x329b('0xb8');break;case'contexts':_0xd3157['childModel']=_0x329b('0xb9');break;case _0x329b('0xba'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbb');break;case _0x329b('0xbc'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbd');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0x87'),'field':'name','foreignKey':_0x329b('0xbe'),'model':_0x329b('0xbf'),'filter':{'field':_0x329b('0xc0'),'value':['agent']}},{'name':_0x329b('0xc1'),'field':_0x329b('0x2d'),'foreignKey':_0x329b('0xbe'),'model':_0x329b('0xbf'),'filter':{'field':_0x329b('0xc0'),'value':[_0x329b('0xc2')]}},{'name':_0x329b('0xc3'),'field':'name','foreignKey':_0x329b('0xc4'),'model':'VoiceQueue','filter':{'field':_0x329b('0x33'),'value':[_0x329b('0xc5')]}},{'name':_0x329b('0xc6'),'field':_0x329b('0x2d'),'foreignKey':_0x329b('0xc4'),'model':_0x329b('0xc7'),'filter':{'field':'type','value':[_0x329b('0xc8')]}}];break;case _0x329b('0xc9'):_0xd3157[_0x329b('0x74')]='VoiceMusicOnHold';break;case'chanspies':_0xd3157[_0x329b('0x74')]=_0x329b('0xca');break;case'voiceprefixes':_0xd3157[_0x329b('0x74')]=_0x329b('0xcb');break;case _0x329b('0xcc'):_0xd3157[_0x329b('0x74')]=_0x329b('0xcd');break;case _0x329b('0xce'):_0xd3157[_0x329b('0x74')]=_0x329b('0xcf');break;case _0x329b('0xd0'):_0xd3157['childModel']=_0x329b('0xd1');break;case _0x329b('0xd2'):_0xd3157[_0x329b('0x74')]='MailSubstatus';break;case'openchannelqueues':_0xd3157[_0x329b('0x74')]=_0x329b('0xd3');break;case _0x329b('0xd4'):_0xd3157[_0x329b('0x74')]=_0x329b('0xd5');break;case'smsqueues':_0xd3157[_0x329b('0x74')]=_0x329b('0xd6');break;case'smsaccounts':_0xd3157[_0x329b('0x74')]='SmsAccount';break;case'whatsappqueues':_0xd3157[_0x329b('0x74')]=_0x329b('0xd7');break;case _0x329b('0xd8'):_0xd3157['childModel']=_0x329b('0xd9');break;case _0x329b('0xda'):case'queuecampaigns':_0xd3157['childModel']=_0x329b('0xc7');if(_0x361e6d){_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0xc3')},{'name':_0x329b('0xc6')}];}break;case _0x329b('0xdb'):case'agents':case _0x329b('0xdc'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbf');if(_0x361e6d){_0xd3157['parentSections']=[{'name':_0x329b('0xdd'),'filter':{'field':_0x329b('0xc0'),'value':[_0x329b('0xde'),_0x329b('0xdf')]},'ignore':!![]},{'name':_0x329b('0x87')},{'name':'Telephones'}];}break;case _0x329b('0xe0'):_0xd3157['childModel']=_0x329b('0xe1');break;case _0x329b('0xe2'):_0xd3157['childModel']=_0x329b('0xe3');break;case'freshdeskaccounts':_0xd3157['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0xd3157[_0x329b('0x74')]=_0x329b('0xe4');break;case'deskaccounts':_0xd3157['childModel']='DeskAccount';break;case'zohoaccounts':_0xd3157[_0x329b('0x74')]=_0x329b('0xe5');break;case _0x329b('0xe6'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbf');break;case _0x329b('0xe7'):_0xd3157[_0x329b('0x74')]=_0x329b('0xe8');break;case'dispositions':_0xd3157[_0x329b('0x74')]=_0x329b('0xe9');break;case _0x329b('0xea'):_0xd3157[_0x329b('0x74')]=_0x329b('0x68');break;case'intervals':_0xd3157['childModel']=_0x329b('0xeb');break;case _0x329b('0xec'):_0xd3157[_0x329b('0x74')]='Pause';break;case _0x329b('0xed'):_0xd3157[_0x329b('0x74')]=_0x329b('0xee');break;case'sounds':_0xd3157[_0x329b('0x74')]=_0x329b('0xef');break;case _0x329b('0xf0'):_0xd3157[_0x329b('0x74')]=_0x329b('0x83');break;case'templates':_0xd3157['childModel']=_0x329b('0xf1');break;case _0x329b('0xf2'):_0xd3157[_0x329b('0x74')]=_0x329b('0xf3');break;case'trunks':_0xd3157[_0x329b('0x74')]=_0x329b('0xf4');break;case _0x329b('0xf5'):_0xd3157[_0x329b('0x74')]=_0x329b('0xf6');break;case _0x329b('0xf7'):_0xd3157['childModel']=_0x329b('0x6c');break;case _0x329b('0xf8'):_0xd3157[_0x329b('0x74')]=_0x329b('0x7d');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0xf9'),'field':'id','foreignKey':_0x329b('0x80')}];break;case _0x329b('0xfa'):_0xd3157[_0x329b('0x74')]=_0x329b('0xfb');break;case'whatsappaccounts':_0xd3157['childModel']=_0x329b('0xfc');break;case _0x329b('0xfd'):_0xd3157[_0x329b('0x74')]=_0x329b('0xfe');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0x87'),'field':'id','foreignKey':_0x329b('0xff'),'model':_0x329b('0xbf'),'filter':{'field':'role','value':['agent']}},{'name':_0x329b('0xc1'),'field':'id','foreignKey':'UserId','model':_0x329b('0xbf'),'filter':{'field':_0x329b('0xc0'),'value':[_0x329b('0xc2')]}}];break;default:return _0xd3157;}return _0xd3157;} \ No newline at end of file +var _0xcf28=['metrics','AnalyticMetric','whatsappaccounts','screenrecordings','ScreenRecording','UserId','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','find','catch','create','body','clone','get','omit','createdAt','updatedAt','sequelize','transaction','each','autoAssociation','UserProfileResource','userProfileId','Resources','UserProfileSection','destroy','describe','addSections','sectionId','push','removeSections','ids','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','union','field','AnalyticExtractedReport','associatedResources','foreignKey','reportType','default','reportId','DefaultReports','custom','CustomReports','Tag','Tags','color','tag','openTabs','true','rows','chat','dataValues','sms','fax','mail','openchannel','toUpperCase','slice','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','value','toLowerCase','squareprojects','squarerecordings','SquareProjects','projectName','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','teams','Team','voicequeues','users','agents','telephones','Users','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','Trunk','plugins','extractedreports'];(function(_0x5e796c,_0x5cc3fc){var _0x37fcc6=function(_0x2934d6){while(--_0x2934d6){_0x5e796c['push'](_0x5e796c['shift']());}};_0x37fcc6(++_0x5cc3fc);}(_0xcf28,0x109));var _0x8cf2=function(_0x1b48ec,_0x25972a){_0x1b48ec=_0x1b48ec-0x0;var _0x1ec913=_0xcf28[_0x1b48ec];return _0x1ec913;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8cf2('0x0'));var jsonpatch=require(_0x8cf2('0x1'));var rp=require(_0x8cf2('0x2'));var moment=require(_0x8cf2('0x3'));var BPromise=require(_0x8cf2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8cf2('0x5'));var csv=require(_0x8cf2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8cf2('0x7'));var _=require(_0x8cf2('0x8'));var squel=require(_0x8cf2('0x9'));var crypto=require(_0x8cf2('0xa'));var jsforce=require(_0x8cf2('0xb'));var deskjs=require(_0x8cf2('0xc'));var toCsv=require(_0x8cf2('0x6'));var querystring=require(_0x8cf2('0xd'));var Papa=require(_0x8cf2('0xe'));var Redis=require(_0x8cf2('0xf'));var authService=require(_0x8cf2('0x10'));var qs=require(_0x8cf2('0x11'));var as=require(_0x8cf2('0x12'));var hardwareService=require(_0x8cf2('0x13'));var logger=require(_0x8cf2('0x14'))(_0x8cf2('0x15'));var utils=require(_0x8cf2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8cf2('0x17'));var db=require(_0x8cf2('0x18'))['db'];config[_0x8cf2('0x19')]=_[_0x8cf2('0x1a')](config[_0x8cf2('0x19')],{'host':_0x8cf2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8cf2('0x19')]));require('./userProfile.socket')[_0x8cf2('0x1c')](socket);function respondWithStatusCode(_0x1a4985,_0x3be5e9){_0x3be5e9=_0x3be5e9||0xcc;return function(_0x49ce7e){if(_0x49ce7e){return _0x1a4985[_0x8cf2('0x1d')](_0x3be5e9);}return _0x1a4985[_0x8cf2('0x1e')](_0x3be5e9)[_0x8cf2('0x1f')]();};}function respondWithResult(_0xee55e,_0x4bf4c9){_0x4bf4c9=_0x4bf4c9||0xc8;return function(_0x40dfef){if(_0x40dfef){return _0xee55e[_0x8cf2('0x1e')](_0x4bf4c9)[_0x8cf2('0x20')](_0x40dfef);}};}function respondWithFilteredResult(_0x84b419,_0x535aff){return function(_0x4a2cfb){if(_0x4a2cfb){var _0x28f7d7=typeof _0x535aff[_0x8cf2('0x21')]===_0x8cf2('0x22')&&typeof _0x535aff[_0x8cf2('0x23')]===_0x8cf2('0x22');var _0x30c44a=_0x4a2cfb[_0x8cf2('0x24')];var _0x216cff=_0x28f7d7?0x0:_0x535aff[_0x8cf2('0x21')];var _0x4e982c=_0x28f7d7?_0x4a2cfb['count']:_0x535aff[_0x8cf2('0x21')]+_0x535aff[_0x8cf2('0x23')];var _0x2f1de5;if(_0x4e982c>=_0x30c44a){_0x4e982c=_0x30c44a;_0x2f1de5=0xc8;}else{_0x2f1de5=0xce;}_0x84b419[_0x8cf2('0x1e')](_0x2f1de5);return _0x84b419[_0x8cf2('0x25')](_0x8cf2('0x26'),_0x216cff+'-'+_0x4e982c+'/'+_0x30c44a)[_0x8cf2('0x20')](_0x4a2cfb);}return null;};}function patchUpdates(_0x46468f){return function(_0x277ea1){try{jsonpatch[_0x8cf2('0x27')](_0x277ea1,_0x46468f,!![]);}catch(_0x3bad59){return BPromise[_0x8cf2('0x28')](_0x3bad59);}return _0x277ea1[_0x8cf2('0x29')]();};}function saveUpdates(_0x57229f,_0x2ae44){return function(_0x1813c0){if(_0x1813c0){return _0x1813c0['update'](_0x57229f)[_0x8cf2('0x2a')](function(_0x4fc796){return _0x4fc796;});}return null;};}function removeEntity(_0x445618,_0x5d7560){return function(_0x2eca8b){if(_0x2eca8b){return _0x2eca8b['destroy']()[_0x8cf2('0x2a')](function(){_0x445618[_0x8cf2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3908fd,_0x1eac49){return function(_0x3e16e4){if(!_0x3e16e4){_0x3908fd['sendStatus'](0x194);}return _0x3e16e4;};}function handleError(_0x585d78,_0xdfe66b){_0xdfe66b=_0xdfe66b||0x1f4;return function(_0x5ee6e2){logger[_0x8cf2('0x2b')](_0x5ee6e2[_0x8cf2('0x2c')]);if(_0x5ee6e2['name']){delete _0x5ee6e2['name'];}_0x585d78[_0x8cf2('0x1e')](_0xdfe66b)[_0x8cf2('0x2d')](_0x5ee6e2);};}exports[_0x8cf2('0x2e')]=function(_0x256be7,_0x54d70d){var _0x2cd23a={},_0x689ba2={},_0x57fe7a={'count':0x0,'rows':[]};var _0x54aeea=_[_0x8cf2('0x2f')](db[_0x8cf2('0x30')][_0x8cf2('0x31')],function(_0x5651aa){return{'name':_0x5651aa[_0x8cf2('0x32')],'type':_0x5651aa[_0x8cf2('0x33')][_0x8cf2('0x34')]};});_0x689ba2[_0x8cf2('0x35')]=_[_0x8cf2('0x2f')](_0x54aeea,_0x8cf2('0x36'));_0x689ba2['query']=_[_0x8cf2('0x37')](_0x256be7[_0x8cf2('0x38')]);_0x689ba2[_0x8cf2('0x39')]=_[_0x8cf2('0x3a')](_0x689ba2[_0x8cf2('0x35')],_0x689ba2[_0x8cf2('0x38')]);_0x2cd23a[_0x8cf2('0x3b')]=_[_0x8cf2('0x3a')](_0x689ba2[_0x8cf2('0x35')],qs[_0x8cf2('0x3c')](_0x256be7[_0x8cf2('0x38')][_0x8cf2('0x3c')]));_0x2cd23a['attributes']=_0x2cd23a[_0x8cf2('0x3b')][_0x8cf2('0x3d')]?_0x2cd23a[_0x8cf2('0x3b')]:_0x689ba2[_0x8cf2('0x35')];if(!_0x256be7[_0x8cf2('0x38')]['hasOwnProperty'](_0x8cf2('0x3e'))){_0x2cd23a[_0x8cf2('0x23')]=qs['limit'](_0x256be7[_0x8cf2('0x38')][_0x8cf2('0x23')]);_0x2cd23a[_0x8cf2('0x21')]=qs[_0x8cf2('0x21')](_0x256be7[_0x8cf2('0x38')][_0x8cf2('0x21')]);}_0x2cd23a[_0x8cf2('0x3f')]=qs[_0x8cf2('0x40')](_0x256be7['query'][_0x8cf2('0x40')]);_0x2cd23a[_0x8cf2('0x41')]=qs[_0x8cf2('0x39')](_[_0x8cf2('0x42')](_0x256be7['query'],_0x689ba2['filters']),_0x54aeea);if(_0x256be7[_0x8cf2('0x38')][_0x8cf2('0x43')]){_0x2cd23a['where']=_['merge'](_0x2cd23a['where'],{'$or':_['map'](_0x54aeea,function(_0x316e61){if(_0x316e61[_0x8cf2('0x33')]!==_0x8cf2('0x44')){var _0x462e36={};_0x462e36[_0x316e61['name']]={'$like':'%'+_0x256be7[_0x8cf2('0x38')][_0x8cf2('0x43')]+'%'};return _0x462e36;}})});}_0x2cd23a=_[_0x8cf2('0x45')]({},_0x2cd23a,_0x256be7[_0x8cf2('0x46')]);var _0x7d05c0={'where':_0x2cd23a['where']};return db[_0x8cf2('0x30')]['count'](_0x7d05c0)[_0x8cf2('0x2a')](function(_0x50cf32){_0x57fe7a[_0x8cf2('0x24')]=_0x50cf32;if(_0x256be7[_0x8cf2('0x38')][_0x8cf2('0x47')]){_0x2cd23a[_0x8cf2('0x48')]=[{'all':!![]}];}return db[_0x8cf2('0x30')][_0x8cf2('0x49')](_0x2cd23a);})[_0x8cf2('0x2a')](function(_0x4369ad){_0x57fe7a['rows']=_0x4369ad;return _0x57fe7a;})[_0x8cf2('0x2a')](respondWithFilteredResult(_0x54d70d,_0x2cd23a))['catch'](handleError(_0x54d70d,null));};exports['show']=function(_0x145293,_0x417269){var _0x2458e6={'raw':![],'where':{'id':_0x145293[_0x8cf2('0x4a')]['id']}},_0x4a6904={};_0x4a6904[_0x8cf2('0x35')]=_[_0x8cf2('0x37')](db[_0x8cf2('0x30')][_0x8cf2('0x31')]);_0x4a6904[_0x8cf2('0x38')]=_[_0x8cf2('0x37')](_0x145293[_0x8cf2('0x38')]);_0x4a6904[_0x8cf2('0x39')]=_[_0x8cf2('0x3a')](_0x4a6904[_0x8cf2('0x35')],_0x4a6904[_0x8cf2('0x38')]);_0x2458e6[_0x8cf2('0x3b')]=_[_0x8cf2('0x3a')](_0x4a6904['model'],qs[_0x8cf2('0x3c')](_0x145293[_0x8cf2('0x38')][_0x8cf2('0x3c')]));_0x2458e6[_0x8cf2('0x3b')]=_0x2458e6[_0x8cf2('0x3b')][_0x8cf2('0x3d')]?_0x2458e6[_0x8cf2('0x3b')]:_0x4a6904[_0x8cf2('0x35')];if(_0x145293[_0x8cf2('0x38')][_0x8cf2('0x47')]){_0x2458e6[_0x8cf2('0x48')]=[{'all':!![]}];}_0x2458e6=_['merge']({},_0x2458e6,_0x145293[_0x8cf2('0x46')]);return db['UserProfile'][_0x8cf2('0x4b')](_0x2458e6)['then'](handleEntityNotFound(_0x417269,null))[_0x8cf2('0x2a')](respondWithResult(_0x417269,null))[_0x8cf2('0x4c')](handleError(_0x417269,null));};exports['create']=function(_0x32da7c,_0x42cb66){return db[_0x8cf2('0x30')][_0x8cf2('0x4d')](_0x32da7c[_0x8cf2('0x4e')],{})['then'](respondWithResult(_0x42cb66,0xc9))[_0x8cf2('0x4c')](handleError(_0x42cb66,null));};exports[_0x8cf2('0x4f')]=function(_0x23feb6,_0x3d7c92){var _0x327002={'where':{'id':_0x23feb6[_0x8cf2('0x4a')]['id']}},_0x277712={};_0x277712[_0x8cf2('0x35')]=_[_0x8cf2('0x37')](db[_0x8cf2('0x30')][_0x8cf2('0x31')]);_0x327002[_0x8cf2('0x3b')]=_[_0x8cf2('0x3a')](_0x277712[_0x8cf2('0x35')],qs[_0x8cf2('0x3c')](_0x23feb6['query'][_0x8cf2('0x3c')]));_0x327002[_0x8cf2('0x3b')]=_0x327002[_0x8cf2('0x3b')][_0x8cf2('0x3d')]?_0x327002[_0x8cf2('0x3b')]:_0x277712[_0x8cf2('0x35')];if(_0x23feb6[_0x8cf2('0x38')][_0x8cf2('0x47')]){_0x327002['include']=[{'all':!![]}];}_0x327002=_['merge']({},_0x327002,_0x23feb6[_0x8cf2('0x46')]);return db[_0x8cf2('0x30')]['find'](_0x327002)['then'](handleEntityNotFound(_0x3d7c92,null))[_0x8cf2('0x2a')](function(_0x398643){if(_0x398643){var _0x48711b=_0x398643[_0x8cf2('0x50')]({'plain':!![]});_0x48711b=qs[_0x8cf2('0x51')](_0x48711b,['id',_0x8cf2('0x52'),'updatedAt','crudPermissions']);_0x23feb6[_0x8cf2('0x4e')]=_[_0x8cf2('0x51')](_0x23feb6[_0x8cf2('0x4e')],['id',_0x8cf2('0x52'),_0x8cf2('0x53')]);return db[_0x8cf2('0x54')][_0x8cf2('0x55')](function(_0x2e53cb){return db[_0x8cf2('0x30')][_0x8cf2('0x4d')](_['merge'](_0x48711b,_0x23feb6[_0x8cf2('0x4e')]),{'include':_0x23feb6[_0x8cf2('0x38')][_0x8cf2('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x2e53cb})['then'](function(_0x62d213){var _0x50d3af=_0x62d213[_0x8cf2('0x50')]({'plain':!![]});return db['UserProfileSection'][_0x8cf2('0x49')]({'where':{'userProfileId':_0x23feb6[_0x8cf2('0x4a')]['id']},'raw':!![]})[_0x8cf2('0x2a')](function(_0x4a7f9d){if(_0x4a7f9d){return BPromise[_0x8cf2('0x56')](_0x4a7f9d,function(_0x111844){return new BPromise(function(_0x15f564,_0xcaae10){if(_0x111844[_0x8cf2('0x57')]===null||_0x111844[_0x8cf2('0x57')]===0x1)_0x15f564(null);return db[_0x8cf2('0x58')][_0x8cf2('0x49')]({'where':{'sectionId':_0x111844['id']},'raw':!![]})[_0x8cf2('0x2a')](function(_0x437113){var _0x158f1f=_[_0x8cf2('0x2f')](_0x437113,function(_0x162e4d){return qs[_0x8cf2('0x51')](_0x162e4d,['id','createdAt',_0x8cf2('0x53'),'sectionId']);});_0x15f564(_0x158f1f);})[_0x8cf2('0x4c')](function(_0x49dcb7){_0xcaae10(_0x49dcb7);});})[_0x8cf2('0x2a')](function(_0x4b138c){var _0x5be06e=qs[_0x8cf2('0x51')](_0x111844,['id','createdAt',_0x8cf2('0x53')]);_0x5be06e[_0x8cf2('0x59')]=_0x50d3af['id'];if(_0x4b138c)_0x5be06e[_0x8cf2('0x5a')]=_0x4b138c;return _0x5be06e;})['then'](function(_0x2c32dd){return db[_0x8cf2('0x5b')][_0x8cf2('0x4d')](_0x2c32dd,{'include':[{'model':db['UserProfileResource'],'as':_0x8cf2('0x5a')}],'raw':!![],'transaction':_0x2e53cb});});})['then'](function(){return _0x50d3af;});}});});});}})[_0x8cf2('0x2a')](respondWithResult(_0x3d7c92,0xc9))[_0x8cf2('0x4c')](handleError(_0x3d7c92,null));};exports['update']=function(_0xcabb7b,_0x36f1e0){if(_0xcabb7b['body']['id']){delete _0xcabb7b['body']['id'];}return db[_0x8cf2('0x30')][_0x8cf2('0x4b')]({'where':{'id':_0xcabb7b[_0x8cf2('0x4a')]['id']}})[_0x8cf2('0x2a')](handleEntityNotFound(_0x36f1e0,null))['then'](saveUpdates(_0xcabb7b[_0x8cf2('0x4e')],null))[_0x8cf2('0x2a')](respondWithResult(_0x36f1e0,null))['catch'](handleError(_0x36f1e0,null));};exports[_0x8cf2('0x5c')]=function(_0x5a0f5d,_0x5d701a){return db[_0x8cf2('0x30')]['find']({'where':{'id':_0x5a0f5d[_0x8cf2('0x4a')]['id']}})[_0x8cf2('0x2a')](handleEntityNotFound(_0x5d701a,null))[_0x8cf2('0x2a')](removeEntity(_0x5d701a,null))['catch'](handleError(_0x5d701a,null));};exports['describe']=function(_0x5e69ba,_0x564075){return db['UserProfile'][_0x8cf2('0x5d')]()['then'](respondWithResult(_0x564075,null))[_0x8cf2('0x4c')](handleError(_0x564075,null));};exports[_0x8cf2('0x5e')]=function(_0x27273f,_0x258b3a){var _0x439507=_0x27273f['body'];return db[_0x8cf2('0x30')][_0x8cf2('0x4b')]({'where':{'id':_0x27273f['params']['id']}})['then'](handleEntityNotFound(_0x258b3a,null))[_0x8cf2('0x2a')](function(_0x3e5cb3){if(_0x3e5cb3){return db['sequelize'][_0x8cf2('0x55')](function(_0x58de96){return db[_0x8cf2('0x5b')][_0x8cf2('0x5c')]({'where':{'userProfileId':_0x27273f[_0x8cf2('0x4a')]['id'],'sectionId':_[_0x8cf2('0x2f')](_0x439507,function(_0x783673){return _0x783673[_0x8cf2('0x5f')];})},'transaction':_0x58de96})['then'](function(){var _0x13828f=_['map'](_0x439507,function(_0x154ee3){_0x154ee3['userProfileId']=_0x27273f[_0x8cf2('0x4a')]['id'];return _0x154ee3;});var _0x2f1deb=[];return BPromise[_0x8cf2('0x56')](_0x13828f,function(_0x53c27){return db['UserProfileSection'][_0x8cf2('0x4d')](_0x53c27,{'include':[{'model':db[_0x8cf2('0x58')],'as':_0x8cf2('0x5a')}],'raw':!![],'transaction':_0x58de96})[_0x8cf2('0x2a')](function(_0x17514c){_0x2f1deb[_0x8cf2('0x60')](_0x17514c[_0x8cf2('0x50')]({'plain':!![]}));});})[_0x8cf2('0x2a')](function(){return _0x2f1deb;});});});}})[_0x8cf2('0x2a')](function(_0x442ff6){return _0x442ff6;})[_0x8cf2('0x2a')](respondWithResult(_0x258b3a,null))[_0x8cf2('0x4c')](handleError(_0x258b3a,null));};exports[_0x8cf2('0x61')]=function(_0x575495,_0x3ea106){var _0x48b01f;return db['UserProfile'][_0x8cf2('0x4b')]({'where':{'id':_0x575495[_0x8cf2('0x4a')]['id']},'attributes':['id',_0x8cf2('0x36')]})[_0x8cf2('0x2a')](handleEntityNotFound(_0x3ea106,null))[_0x8cf2('0x2a')](function(_0x4fcf1a){if(_0x4fcf1a){_0x48b01f=_0x4fcf1a;return db['UserProfileSection'][_0x8cf2('0x5c')]({'where':{'userProfileId':_0x575495[_0x8cf2('0x4a')]['id'],'sectionId':_0x575495[_0x8cf2('0x38')][_0x8cf2('0x62')]}});}})['then'](function(){return _0x48b01f;})[_0x8cf2('0x2a')](respondWithStatusCode(_0x3ea106,null))[_0x8cf2('0x4c')](handleError(_0x3ea106,null));};exports['getSections']=function(_0x451b71,_0x45d20f){var _0x530126=[];var _0x4c7358=[];return db[_0x8cf2('0x5b')][_0x8cf2('0x49')]({'where':{'userProfileId':_0x451b71[_0x8cf2('0x4a')]['id']},'raw':!![]})[_0x8cf2('0x2a')](function(_0xa3ca3a){_0x530126=_[_0x8cf2('0x43')](_0xa3ca3a,function(_0x353676){return _0x353676[_0x8cf2('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x353676[_0x8cf2('0x5f')]);});if(!_[_0x8cf2('0x64')](_0x530126)){return _[_0x8cf2('0x2f')](_0x530126,function(_0x1a5bfb){return _0x1a5bfb[_0x8cf2('0x5f')];});}else{return;}})['then'](function(_0xd6ad35){if(_0xd6ad35)_0x4c7358=_0xd6ad35;if(_['includes'](_0x4c7358,0x64)){var _0x26dad7=_[_0x8cf2('0x4b')](_0x530126,{'sectionId':0x64});return hasDefaultDashboard(_0x26dad7)[_0x8cf2('0x2a')](function(_0x2e7a4a){return _[_0x8cf2('0x2f')](_0x530126,function(_0x29195d){if(_0x29195d[_0x8cf2('0x5f')]===0x64){_0x29195d['subsections']=_0x2e7a4a;}return _0x29195d;});});}else{return;}})[_0x8cf2('0x2a')](function(_0xd30fec){if(_0xd30fec)_0x530126=_0xd30fec;if(_[_0x8cf2('0x65')](_0x4c7358,0x3eb)){var _0x13e8a4=_[_0x8cf2('0x4b')](_0x530126,{'sectionId':0x3eb});return getCustomDashboards(_0x13e8a4)[_0x8cf2('0x2a')](function(_0x32caa1){return _['map'](_0x530126,function(_0x5dbdf9){if(_0x13e8a4[_0x8cf2('0x63')]){if(_0x5dbdf9[_0x8cf2('0x5f')]===0x3eb){_0x5dbdf9[_0x8cf2('0x66')]=_0x32caa1;}}else{if(_0x5dbdf9[_0x8cf2('0x5f')]===0x64){_0x5dbdf9['subsections']=_0x32caa1;}}return _0x5dbdf9;});});}else{return;}})['then'](function(_0x555fd0){if(_0x555fd0)_0x530126=_0x555fd0;if(_['includes'](_0x4c7358,0x709)){var _0x18fca3=_[_0x8cf2('0x4b')](_0x530126,{'sectionId':0x709});return getPlugins(_0x18fca3)[_0x8cf2('0x2a')](function(_0x28b635){if(_0x18fca3[_0x8cf2('0x63')]){return _[_0x8cf2('0x2f')](_0x530126,function(_0x1a2cae){if(_0x1a2cae[_0x8cf2('0x5f')]===0x709){_0x1a2cae['subsections']=_0x28b635;}return _0x1a2cae;});}else{var _0x1e55d1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x28b635};var _0x490896=_['map'](_0x530126);_0x490896['push'](_0x1e55d1);return _0x490896;}});}else{return;}})[_0x8cf2('0x2a')](function(_0x23d748){if(_0x23d748)_0x530126=_0x23d748;return _[_0x8cf2('0x43')](_0x530126,[_0x8cf2('0x63'),0x1]);})['then'](respondWithResult(_0x45d20f,null))[_0x8cf2('0x4c')](handleError(_0x45d20f,null));};function hasDefaultDashboard(_0x1698d3){var _0x3a40c7=[0x65];return new BPromise(function(_0x112b62,_0x101c95){try{if(_0x1698d3[_0x8cf2('0x57')]){_0x112b62(_0x3a40c7);}else{return db['UserProfileResource'][_0x8cf2('0x67')]({'where':{'sectionId':_0x1698d3['id']},'raw':!![]})[_0x8cf2('0x2a')](function(_0x5cf206){_0x5cf206?_0x112b62(_0x3a40c7):_0x112b62();});}}catch(_0x96f24c){_0x101c95(_0x96f24c);}});}function getCustomDashboards(_0x16d730){var _0x4459e8=[];return new BPromise(function(_0x1c8d67,_0x21c941){try{if(_0x16d730['autoAssociation']){return db[_0x8cf2('0x68')][_0x8cf2('0x49')]({'raw':!![]})[_0x8cf2('0x2a')](function(_0x304272){_0x304272[_0x8cf2('0x69')](function(_0x329637){_0x4459e8[_0x8cf2('0x60')](_0x329637['id']+0x1869f);});_0x1c8d67(_0x4459e8);});}else{return db[_0x8cf2('0x58')]['findAll']({'where':{'sectionId':_0x16d730['id']},'raw':!![]})[_0x8cf2('0x2a')](function(_0x1826e2){_0x1826e2[_0x8cf2('0x69')](function(_0x262357){_0x4459e8[_0x8cf2('0x60')](_0x262357[_0x8cf2('0x6a')]+0x1869f);});_0x1c8d67(_0x4459e8);});}}catch(_0x505558){_0x21c941(_0x505558);}});}function getPlugins(_0x540277){var _0x5822f3=[];return new BPromise(function(_0x2eca01,_0x2ba2d4){try{if(_0x540277[_0x8cf2('0x57')]){return db[_0x8cf2('0x6b')][_0x8cf2('0x49')]({'raw':!![]})[_0x8cf2('0x2a')](function(_0x30038c){_0x30038c['forEach'](function(_0x3de8d4){_0x5822f3[_0x8cf2('0x60')](_0x3de8d4['id']+0x15b38);});_0x2eca01(_0x5822f3);});}else{return db[_0x8cf2('0x58')][_0x8cf2('0x49')]({'where':{'sectionId':_0x540277['id']},'raw':!![]})[_0x8cf2('0x2a')](function(_0x201cc5){_0x201cc5['forEach'](function(_0x4353e7){_0x5822f3[_0x8cf2('0x60')](_0x4353e7[_0x8cf2('0x6a')]+0x15b38);});_0x2eca01(_0x5822f3);});}}catch(_0x1baf86){_0x2ba2d4(_0x1baf86);}});}exports['addResources']=function(_0x273c52,_0x5e5649){return db[_0x8cf2('0x30')][_0x8cf2('0x4b')]({'where':{'id':_0x273c52[_0x8cf2('0x4a')]['id']}})[_0x8cf2('0x2a')](handleEntityNotFound(_0x5e5649,null))[_0x8cf2('0x2a')](function(_0x352de4){if(_0x352de4){return db[_0x8cf2('0x54')][_0x8cf2('0x55')](function(_0x3bbb22){return db[_0x8cf2('0x5b')][_0x8cf2('0x49')]({'where':{'userProfileId':_0x273c52[_0x8cf2('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x8cf2('0x2a')](function(_0x574ece){if(_0x574ece){return db[_0x8cf2('0x5b')]['destroy']({'where':{'userProfileId':_0x273c52['params']['id'],'id':_[_0x8cf2('0x2f')](_0x574ece,function(_0x559bcb){return _0x559bcb['id'];})},'transaction':_0x3bbb22});}})['then'](function(_0xefcd17){var _0x43587e=_[_0x8cf2('0x2f')](_0x273c52['body'],function(_0x27d0bf){_0x27d0bf[_0x8cf2('0x59')]=_0x273c52[_0x8cf2('0x4a')]['id'];return _0x27d0bf;});return db['UserProfileSection'][_0x8cf2('0x6c')](_0x43587e,{'raw':!![],'transaction':_0x3bbb22});})[_0x8cf2('0x2a')](function(_0x3c5b28){var _0x3e413e=_['filter'](_[_0x8cf2('0x2f')](_0x3c5b28,function(_0x53f4f5){return _0x53f4f5[_0x8cf2('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x3e413e){return db['UserProfileSection'][_0x8cf2('0x49')]({'where':{'userProfileId':_0x273c52['params']['id'],'sectionId':_[_0x8cf2('0x2f')](_0x3e413e,function(_0x1fcc5e){return _0x1fcc5e['sectionId'];})},'attributes':['id',_0x8cf2('0x5f')],'raw':!![]})[_0x8cf2('0x2a')](function(_0x29d48f){var _0x3942b5=_['map'](_0x273c52[_0x8cf2('0x4e')],function(_0x5dfd51){_0x5dfd51[_0x8cf2('0x59')]=_0x273c52[_0x8cf2('0x4a')]['id'];return _0x5dfd51;});return db['UserProfileResource'][_0x8cf2('0x6c')](_0x3942b5,{'raw':!![],'transaction':_0x3bbb22});});}})[_0x8cf2('0x4c')](handleError(_0x5e5649,null));});}})[_0x8cf2('0x2a')](function(_0x5d4d61){var _0x39a8d0=_['map'](_0x5d4d61,function(_0x2119ce){return _0x2119ce[_0x8cf2('0x50')]({'plain':!![]});});})[_0x8cf2('0x2a')](respondWithResult(_0x5e5649,null))[_0x8cf2('0x4c')](handleError(_0x5e5649,null));};exports['removeResources']=function(_0x4fd244,_0x16e282,_0x13c74e){return db['UserProfile']['find']({'where':{'id':_0x4fd244['params']['id']}})['then'](handleEntityNotFound(_0x16e282,null))['then'](function(_0x5d4ce3){if(_0x5d4ce3){return _0x5d4ce3[_0x8cf2('0x6d')](_0x4fd244['query'][_0x8cf2('0x62')]);}})[_0x8cf2('0x2a')](respondWithStatusCode(_0x16e282,null))[_0x8cf2('0x4c')](handleError(_0x16e282,null));};exports[_0x8cf2('0x6e')]=function(_0xc2fb7c,_0x1c6ec9){var _0x4cfdf4={'raw':![],'where':{}};var _0x375784={};var _0xf9684b={'count':0x0,'rows':[]};var _0x5d5d32=_0xc2fb7c[_0x8cf2('0x38')]['section'];if(typeof _0x5d5d32===_0x8cf2('0x22')){throw new db[(_0x8cf2('0x6f'))][(_0x8cf2('0x70'))](_0x8cf2('0x71'));}var _0x438a1f=_0xc2fb7c[_0x8cf2('0x38')][_0x8cf2('0x72')]||![];var _0x28d698=getQueryModels(_0x5d5d32,_0x438a1f);if(typeof _0x28d698[_0x8cf2('0x73')]==='undefined'){throw new db[(_0x8cf2('0x6f'))]['ValidationError'](_0x8cf2('0x74')+_0x5d5d32+'\x27');}var _0x3e9f54=[];if(!_[_0x8cf2('0x64')](_0x28d698[_0x8cf2('0x75')])){_0x3e9f54=_0x28d698['parentSections'];}else{_0x3e9f54=[{'name':_0x5d5d32}];}return db[_0x8cf2('0x30')][_0x8cf2('0x67')]({'where':{'id':_0xc2fb7c['params']['id']}})[_0x8cf2('0x2a')](handleEntityNotFound(_0x1c6ec9,null))[_0x8cf2('0x2a')](function(_0x439f67){if(_0x439f67){var _0x286c41=[];for(var _0x317620=0x0;_0x317620<_0x3e9f54['length'];_0x317620++){_0x286c41[_0x8cf2('0x60')](db[_0x8cf2('0x5b')]['findOne']({'where':{'userProfileId':_0x439f67['id'],'name':_0x3e9f54[_0x317620][_0x8cf2('0x36')]},'raw':!![]}));}return BPromise[_0x8cf2('0x76')](_0x286c41);}})[_0x8cf2('0x2a')](function(_0x211bfa){var _0xa03796=_['filter'](_0x211bfa,function(_0x3ffdca){return _0x3ffdca?_0x3ffdca:undefined;});var _0x21b707=_[_0x8cf2('0x43')](_0x3e9f54,[_0x8cf2('0x77'),!![]]);var _0x33ad9c=_[_0x8cf2('0x64')](_0xa03796)&&_[_0x8cf2('0x64')](_0x21b707)?null:_[_0x8cf2('0x78')](_0x21b707,_0xa03796);if(_0x33ad9c){var _0x119ed6=[];for(var _0x1c239c=0x0;_0x1c239c<_0x33ad9c['length'];_0x1c239c++){var _0x561d37=_['find'](_0x3e9f54,function(_0x10084a){return _0x33ad9c[_0x1c239c]?_0x10084a[_0x8cf2('0x36')]===_0x33ad9c[_0x1c239c][_0x8cf2('0x36')]:null;});if(_0x561d37){if(_0x33ad9c[_0x1c239c]['ignore']){_0x119ed6[_0x8cf2('0x60')](getAllResources(_0x28d698[_0x8cf2('0x73')],_0x33ad9c[_0x1c239c]));}else{if(!_0x33ad9c[_0x1c239c][_0x8cf2('0x57')]){_0x119ed6['push'](getAllowedResources(_0x561d37,_0x33ad9c[_0x1c239c],_0x28d698[_0x8cf2('0x73')]));}else{if(_0x561d37[_0x8cf2('0x35')]){_0x119ed6[_0x8cf2('0x60')](getAllFilteredResources(_0x561d37,_0x33ad9c[_0x1c239c]));}}}}}return BPromise['all'](_0x119ed6);}else{return null;}})[_0x8cf2('0x2a')](function(_0x304906){var _0x2bf970=_0x304906;var _0x1adf8d=null;if(_0x2bf970){_0x1adf8d=_0x2bf970['length']===0x1?_0x2bf970[0x0]:null;}if(_0x1adf8d||_0x2bf970){var _0x143624=db[_0x28d698['childModel']][_0x8cf2('0x31')];_0x375784['model']=_[_0x8cf2('0x37')](_0x143624);_0x375784['query']=_[_0x8cf2('0x37')](_0xc2fb7c['query']);_0x375784['filters']=_[_0x8cf2('0x3a')](_0x375784[_0x8cf2('0x35')],_0x375784['query']);_0x4cfdf4[_0x8cf2('0x3b')]=_[_0x8cf2('0x3a')](_0x375784[_0x8cf2('0x35')],qs[_0x8cf2('0x3c')](_0xc2fb7c[_0x8cf2('0x38')][_0x8cf2('0x3c')]));_0x4cfdf4[_0x8cf2('0x3b')]=_0x4cfdf4[_0x8cf2('0x3b')]['length']?_0x4cfdf4[_0x8cf2('0x3b')]:_0x375784[_0x8cf2('0x35')];if(!_0xc2fb7c[_0x8cf2('0x38')]['hasOwnProperty'](_0x8cf2('0x3e'))){_0x4cfdf4[_0x8cf2('0x23')]=qs['limit'](_0xc2fb7c['query'][_0x8cf2('0x23')]);_0x4cfdf4[_0x8cf2('0x21')]=qs[_0x8cf2('0x21')](_0xc2fb7c[_0x8cf2('0x38')][_0x8cf2('0x21')]);}_0x4cfdf4[_0x8cf2('0x3f')]=qs['sort'](_0xc2fb7c[_0x8cf2('0x38')]['sort']);_0x4cfdf4[_0x8cf2('0x41')]=qs[_0x8cf2('0x39')](_[_0x8cf2('0x42')](_0xc2fb7c[_0x8cf2('0x38')],_0x375784[_0x8cf2('0x39')]));if(_0xc2fb7c['query'][_0x8cf2('0x43')]){_0x4cfdf4[_0x8cf2('0x41')]=_[_0x8cf2('0x45')](_0x4cfdf4['where'],{'$or':_[_0x8cf2('0x2f')](_0x143624,function(_0xc72333){if(_0xc72333[_0x8cf2('0x33')]['key']!==_0x8cf2('0x44')){var _0x8a51d4={};_0x8a51d4[_0xc72333[_0x8cf2('0x79')]]={'$like':'%'+_0xc2fb7c['query'][_0x8cf2('0x43')]+'%'};return _0x8a51d4;}})});}var _0x440ec2=[];if(_0x1adf8d){var _0x209229=_['find'](_0x3e9f54,[_0x8cf2('0x36'),_0x1adf8d[_0x8cf2('0x36')]]);if(_0x209229[_0x8cf2('0x79')]){var _0x18aa78={};if(_0x28d698[_0x8cf2('0x73')]===_0x8cf2('0x7a')){_0x18aa78[_0x209229['foreignKey']]=_[_0x8cf2('0x2f')](_0x1adf8d[_0x8cf2('0x7b')],'id');}else{_0x18aa78[_0x209229[_0x8cf2('0x7c')]]=_0x1adf8d['associatedResources'];}_0x440ec2[_0x8cf2('0x60')](_0x18aa78);}else{_0x4cfdf4['where']['id']=_0x1adf8d['associatedResources'];}}else{for(var _0x44b9f9=0x0;_0x44b9f9<_0x2bf970['length'];_0x44b9f9++){var _0x209229=_[_0x8cf2('0x4b')](_0x3e9f54,[_0x8cf2('0x36'),_0x2bf970[_0x44b9f9][_0x8cf2('0x36')]]);if(_0x209229['field']){var _0x18aa78={};_0x18aa78[_0x209229[_0x8cf2('0x7c')]]=_0x2bf970[_0x44b9f9][_0x8cf2('0x7b')];_0x440ec2[_0x8cf2('0x60')](_0x18aa78);}else{if(!_0x4cfdf4[_0x8cf2('0x41')]['id'])_0x4cfdf4[_0x8cf2('0x41')]['id']=[];_0x2bf970[_0x44b9f9][_0x8cf2('0x7b')][_0x8cf2('0x69')](function(_0x18e882){_0x4cfdf4[_0x8cf2('0x41')]['id'][_0x8cf2('0x60')](_0x18e882);});}}}if(!_['isEmpty'](_0x440ec2)){_0x4cfdf4[_0x8cf2('0x41')]=_[_0x8cf2('0x45')](_0x4cfdf4['where'],{'$and':{'$or':_0x440ec2}});}_0x4cfdf4=_[_0x8cf2('0x45')]({},_0x4cfdf4,_0xc2fb7c['options']);if(_0x1adf8d&&!_0x1adf8d[_0x8cf2('0x57')]&&_0x28d698[_0x8cf2('0x73')]===_0x8cf2('0x7a')){if(_0xc2fb7c[_0x8cf2('0x38')][_0x8cf2('0x47')]){_0x4cfdf4['include']=[{'all':!![]}];}return db[_0x28d698[_0x8cf2('0x73')]][_0x8cf2('0x49')](_0x4cfdf4)[_0x8cf2('0x2a')](function(_0x88911a){var _0x5740c7=[];_0x88911a[_0x8cf2('0x69')](function(_0xf5f2f9){var _0x12ed5c;switch(_0xf5f2f9[_0x8cf2('0x7d')]){case _0x8cf2('0x7e'):_0x12ed5c=_[_0x8cf2('0x4b')](_0x1adf8d[_0x8cf2('0x7b')],function(_0xff7116){return _0xff7116['id']===_0xf5f2f9[_0x8cf2('0x7f')]&&_0xff7116[_0x8cf2('0x33')]===_0x8cf2('0x80');});break;case _0x8cf2('0x81'):_0x12ed5c=_[_0x8cf2('0x4b')](_0x1adf8d[_0x8cf2('0x7b')],function(_0xc91b9e){return _0xc91b9e['id']===_0xf5f2f9[_0x8cf2('0x7f')]&&_0xc91b9e[_0x8cf2('0x33')]===_0x8cf2('0x82');});break;}if(_0x12ed5c)_0x5740c7[_0x8cf2('0x60')](_0xf5f2f9);});_0xf9684b['count']=_0x5740c7[_0x8cf2('0x3d')];_0xf9684b['rows']=_0x5740c7;return _0xf9684b;});}else{return db[_0x28d698['childModel']]['count']({'where':_0x4cfdf4[_0x8cf2('0x41')]})[_0x8cf2('0x2a')](function(_0x8597d5){_0xf9684b['count']=_0x8597d5;if(_0xc2fb7c[_0x8cf2('0x38')][_0x8cf2('0x47')]){if(_0x28d698[_0x8cf2('0x73')]==='CmContact'){_0x4cfdf4[_0x8cf2('0x48')]=[{'model':db[_0x8cf2('0x83')],'as':_0x8cf2('0x84'),'attributes':['id',_0x8cf2('0x36'),_0x8cf2('0x85')],'required':_0xc2fb7c[_0x8cf2('0x38')]['tag']?!![]:![]},{'model':db[_0x8cf2('0x83')],'as':'ThroughTags','attributes':['id',_0x8cf2('0x36'),_0x8cf2('0x85')],'through':_0xc2fb7c[_0x8cf2('0x38')][_0x8cf2('0x86')]?{'attributes':[],'where':{'TagId':_0xc2fb7c['query'][_0x8cf2('0x86')]||undefined}}:{},'required':_0xc2fb7c[_0x8cf2('0x38')][_0x8cf2('0x86')]?!![]:![]}];}else{_0x4cfdf4[_0x8cf2('0x48')]=[{'all':!![]}];}}return db[_0x28d698[_0x8cf2('0x73')]][_0x8cf2('0x49')](_0x4cfdf4);})[_0x8cf2('0x2a')](function(_0x2a7467){_0xf9684b['rows']=_0x2a7467;if(_0x5d5d32==='Agents'&&_0xc2fb7c['query'][_0x8cf2('0x87')]===_0x8cf2('0x88')){var _0x4554f2=[];for(var _0x57acd5=0x0;_0x57acd5<_0xf9684b[_0x8cf2('0x89')]['length'];_0x57acd5++){_0x4554f2[_0x8cf2('0x60')](getOpenTabs(_0x8cf2('0x8a'),_0xf9684b[_0x8cf2('0x89')][_0x57acd5][_0x8cf2('0x8b')]));_0x4554f2['push'](getOpenTabs(_0x8cf2('0x8c'),_0xf9684b[_0x8cf2('0x89')][_0x57acd5][_0x8cf2('0x8b')]));_0x4554f2['push'](getOpenTabs(_0x8cf2('0x8d'),_0xf9684b[_0x8cf2('0x89')][_0x57acd5][_0x8cf2('0x8b')]));_0x4554f2[_0x8cf2('0x60')](getOpenTabs(_0x8cf2('0x8e'),_0xf9684b['rows'][_0x57acd5][_0x8cf2('0x8b')]));_0x4554f2[_0x8cf2('0x60')](getOpenTabs(_0x8cf2('0x8f'),_0xf9684b[_0x8cf2('0x89')][_0x57acd5][_0x8cf2('0x8b')]));_0x4554f2[_0x8cf2('0x60')](getOpenTabs('whatsapp',_0xf9684b[_0x8cf2('0x89')][_0x57acd5][_0x8cf2('0x8b')]));}return Promise[_0x8cf2('0x76')](_0x4554f2)[_0x8cf2('0x2a')](function(){return _0xf9684b;});}return _0xf9684b;});}}else{return _0xf9684b;}})[_0x8cf2('0x2a')](respondWithFilteredResult(_0x1c6ec9,_0x4cfdf4))[_0x8cf2('0x4c')](handleError(_0x1c6ec9,null));};function getOpenTabs(_0x2f60a2,_0x19bcb9){var _0x2dcf03=_0x2f60a2['charAt'](0x0)[_0x8cf2('0x90')]()+_0x2f60a2[_0x8cf2('0x91')](0x1);var _0x42731c={'type':db['Sequelize']['QueryTypes'][_0x8cf2('0x92')],'raw':!![]};return new BPromise(function(_0x3aa3b8,_0x36d35d){var _0x4012ab=squel[_0x8cf2('0x93')]()[_0x8cf2('0x79')]('ui.'+_0x2dcf03+_0x8cf2('0x94'),'id')[_0x8cf2('0x79')](_0x8cf2('0x95'))[_0x8cf2('0x96')](_0x8cf2('0x97')+_0x2f60a2+_0x8cf2('0x98'),'ui')[_0x8cf2('0x41')](_0x8cf2('0x99'),_0x19bcb9['id']);return db[_0x8cf2('0x54')][_0x8cf2('0x38')](_0x4012ab[_0x8cf2('0x9a')](),_0x42731c)['then'](function(_0x40dcf3){_0x19bcb9[_0x2dcf03+_0x8cf2('0x9b')]=_0x40dcf3;_0x3aa3b8(_0x40dcf3);})[_0x8cf2('0x4c')](function(_0x24efa0){_0x36d35d(_0x24efa0);});});}function getAllResources(_0x566b4f,_0x2ac997){return new BPromise(function(_0x2a75d7,_0x421aa1){if(_0x2ac997){var _0x4803ad=_0x2ac997['filter']?{[_0x2ac997['filter'][_0x8cf2('0x79')]]:_0x2ac997[_0x8cf2('0x43')][_0x8cf2('0x9c')]}:undefined;return db[_0x566b4f][_0x8cf2('0x49')]({'where':_0x4803ad,'raw':!![]})[_0x8cf2('0x2a')](function(_0x1d9b0c){_0x2ac997[_0x8cf2('0x7b')]=_[_0x8cf2('0x2f')](_0x1d9b0c,'id');_0x2a75d7(_0x2ac997);})[_0x8cf2('0x4c')](function(_0x54042b){_0x421aa1(_0x54042b);});}else{_0x2a75d7(null);}});}function getAllFilteredResources(_0x2409ff,_0x2494bf){return new BPromise(function(_0x3f6046,_0xe0d077){var _0x59db32=_0x2409ff[_0x8cf2('0x43')]?{[_0x2409ff[_0x8cf2('0x43')][_0x8cf2('0x79')]]:_0x2409ff[_0x8cf2('0x43')]['value']}:undefined;return db[_0x2409ff[_0x8cf2('0x35')]][_0x8cf2('0x49')]({'where':_0x59db32,'raw':!![]})[_0x8cf2('0x2a')](function(_0x4a6642){_0x2494bf[_0x8cf2('0x7b')]=_['map'](_0x4a6642,function(_0x5a34a0){return _0x2409ff['field']?_0x5a34a0[_0x2409ff[_0x8cf2('0x79')]]:_0x5a34a0[_0x8cf2('0x36')];});_0x3f6046(_0x2494bf);})[_0x8cf2('0x4c')](function(_0x29ff54){_0xe0d077(_0x29ff54);});});}function getAllowedResources(_0x353888,_0x5df629,_0x1d38a4){return new BPromise(function(_0x25dc58,_0x4aecc7){if(_0x5df629){return db[_0x8cf2('0x58')][_0x8cf2('0x49')]({'where':{'sectionId':_0x5df629['id']},'raw':!![]})['then'](function(_0x238901){if(_0x353888[_0x8cf2('0x79')]&&_0x353888[_0x8cf2('0x79')]!=='id'){_0x5df629['associatedResources']=_[_0x8cf2('0x2f')](_0x238901,function(_0x47b704){return _0x47b704[_0x353888[_0x8cf2('0x79')]];});}else{if(_0x1d38a4===_0x8cf2('0x7a')){_0x5df629[_0x8cf2('0x7b')]=_['map'](_0x238901,function(_0x471295){return{'id':_0x471295[_0x8cf2('0x6a')],'type':_0x471295[_0x8cf2('0x33')]};});}else{_0x5df629['associatedResources']=_[_0x8cf2('0x2f')](_0x238901,function(_0x3cbab7){return _0x3cbab7['resourceId'];});}}_0x25dc58(_0x5df629);})[_0x8cf2('0x4c')](function(_0x4687b6){_0x4aecc7(_0x4687b6);});}else{_0x25dc58(null);}});}function getQueryModels(_0x307599,_0x219991){var _0x386da4=_0x307599[_0x8cf2('0x9d')]();var _0x8c9b09={'childModel':undefined,'parentSections':[]};switch(_0x386da4){case _0x8cf2('0x9e'):_0x8c9b09[_0x8cf2('0x73')]='SquareProject';break;case'odbc':_0x8c9b09[_0x8cf2('0x73')]='SquareOdbc';break;case _0x8cf2('0x9f'):_0x8c9b09[_0x8cf2('0x73')]='SquareRecording';_0x8c9b09[_0x8cf2('0x75')]=[{'name':_0x8cf2('0xa0'),'field':_0x8cf2('0x36'),'foreignKey':_0x8cf2('0xa1')}];break;case _0x8cf2('0xa2'):_0x8c9b09[_0x8cf2('0x73')]='JscriptyProject';break;case _0x8cf2('0xa3'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xa4');_0x8c9b09[_0x8cf2('0x75')]=[{'name':_0x8cf2('0xa5'),'field':'id','foreignKey':_0x8cf2('0xa6')}];break;case _0x8cf2('0xa7'):_0x8c9b09['childModel']=_0x8cf2('0xa8');break;case _0x8cf2('0xa9'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xaa');break;case _0x8cf2('0xab'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xac');break;case _0x8cf2('0xad'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xae');break;case _0x8cf2('0xaf'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xb0');break;case _0x8cf2('0xb1'):_0x8c9b09[_0x8cf2('0x73')]='FaxQueue';break;case _0x8cf2('0xb2'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xb3');break;case _0x8cf2('0xb4'):case _0x8cf2('0xb5'):case _0x8cf2('0xb6'):_0x8c9b09['childModel']=_0x8cf2('0xb7');break;case _0x8cf2('0xb8'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xb9');break;case _0x8cf2('0xba'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xbb');break;case _0x8cf2('0xbc'):_0x8c9b09[_0x8cf2('0x73')]='VoiceRecording';_0x8c9b09[_0x8cf2('0x75')]=[{'name':_0x8cf2('0xbd'),'field':_0x8cf2('0x36'),'foreignKey':_0x8cf2('0xbe'),'model':_0x8cf2('0xbf'),'filter':{'field':'role','value':[_0x8cf2('0xc0')]}},{'name':_0x8cf2('0xc1'),'field':'name','foreignKey':_0x8cf2('0xbe'),'model':_0x8cf2('0xbf'),'filter':{'field':_0x8cf2('0xc2'),'value':[_0x8cf2('0xc3')]}},{'name':_0x8cf2('0xc4'),'field':_0x8cf2('0x36'),'foreignKey':_0x8cf2('0xc5'),'model':_0x8cf2('0xc6'),'filter':{'field':_0x8cf2('0x33'),'value':[_0x8cf2('0xc7')]}},{'name':_0x8cf2('0xc8'),'field':_0x8cf2('0x36'),'foreignKey':_0x8cf2('0xc5'),'model':_0x8cf2('0xc6'),'filter':{'field':_0x8cf2('0x33'),'value':[_0x8cf2('0xc9')]}}];break;case'musiconholds':_0x8c9b09['childModel']=_0x8cf2('0xca');break;case _0x8cf2('0xcb'):_0x8c9b09[_0x8cf2('0x73')]='VoiceChanSpy';break;case _0x8cf2('0xcc'):_0x8c9b09['childModel']=_0x8cf2('0xcd');break;case _0x8cf2('0xce'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xcf');break;case _0x8cf2('0xd0'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xd1');break;case _0x8cf2('0xd2'):_0x8c9b09['childModel']='MailAccount';break;case'mailsubstatuses':_0x8c9b09['childModel']=_0x8cf2('0xd3');break;case _0x8cf2('0xd4'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xd5');break;case _0x8cf2('0xd6'):_0x8c9b09[_0x8cf2('0x73')]='OpenchannelAccount';break;case _0x8cf2('0xd7'):_0x8c9b09['childModel']='SmsQueue';break;case _0x8cf2('0xd8'):_0x8c9b09['childModel']=_0x8cf2('0xd9');break;case _0x8cf2('0xda'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xdb');break;case _0x8cf2('0xdc'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xdd');break;case _0x8cf2('0xde'):case'queuecampaigns':_0x8c9b09['childModel']=_0x8cf2('0xc6');if(_0x219991){_0x8c9b09['parentSections']=[{'name':'VoiceQueues'},{'name':_0x8cf2('0xc8')}];}break;case _0x8cf2('0xdf'):case _0x8cf2('0xe0'):case _0x8cf2('0xe1'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xbf');if(_0x219991){_0x8c9b09[_0x8cf2('0x75')]=[{'name':_0x8cf2('0xe2'),'filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':_0x8cf2('0xbd')},{'name':'Telephones'}];}break;case _0x8cf2('0xe3'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xe4');break;case _0x8cf2('0xe5'):_0x8c9b09['childModel']=_0x8cf2('0xe6');break;case'freshdeskaccounts':_0x8c9b09['childModel']=_0x8cf2('0xe7');break;case'sugarcrmaccounts':_0x8c9b09[_0x8cf2('0x73')]='SugarcrmAccount';break;case'deskaccounts':_0x8c9b09[_0x8cf2('0x73')]='DeskAccount';break;case _0x8cf2('0xe8'):_0x8c9b09['childModel']=_0x8cf2('0xe9');break;case'vtigeraccounts':_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xbf');break;case'cannedanswers':_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xea');break;case _0x8cf2('0xeb'):_0x8c9b09['childModel']=_0x8cf2('0xec');break;case'customdashboards':_0x8c9b09['childModel']='Dashboard';break;case _0x8cf2('0xed'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xee');break;case _0x8cf2('0xef'):_0x8c9b09['childModel']=_0x8cf2('0xf0');break;case _0x8cf2('0xf1'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xf2');break;case _0x8cf2('0xf3'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xf4');break;case _0x8cf2('0xf5'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0x83');break;case _0x8cf2('0xf6'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xf7');break;case _0x8cf2('0xf8'):_0x8c9b09[_0x8cf2('0x73')]='Trigger';break;case _0x8cf2('0xf9'):_0x8c9b09['childModel']=_0x8cf2('0xfa');break;case'variables':_0x8c9b09[_0x8cf2('0x73')]='Variable';break;case _0x8cf2('0xfb'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0x6b');break;case _0x8cf2('0xfc'):_0x8c9b09['childModel']='AnalyticExtractedReport';_0x8c9b09['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x8cf2('0x7f')}];break;case _0x8cf2('0xfd'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0xfe');break;case _0x8cf2('0xff'):_0x8c9b09[_0x8cf2('0x73')]='WhatsappAccount';break;case _0x8cf2('0x100'):_0x8c9b09[_0x8cf2('0x73')]=_0x8cf2('0x101');_0x8c9b09[_0x8cf2('0x75')]=[{'name':'Agents','field':'id','foreignKey':_0x8cf2('0x102'),'model':_0x8cf2('0xbf'),'filter':{'field':_0x8cf2('0xc2'),'value':[_0x8cf2('0xc0')]}},{'name':'Telephones','field':'id','foreignKey':_0x8cf2('0x102'),'model':'User','filter':{'field':_0x8cf2('0xc2'),'value':[_0x8cf2('0xc3')]}}];break;default:return _0x8c9b09;}return _0x8c9b09;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 34ce6a0..2028bf9 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 _0x6691=['hook','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x13caf0,_0x20968f){var _0xec2b52=function(_0x894df5){while(--_0x894df5){_0x13caf0['push'](_0x13caf0['shift']());}};_0xec2b52(++_0x20968f);}(_0x6691,0x12d));var _0x1669=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6691[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x1669('0x0'));var UserProfile=require(_0x1669('0x1'))['db'][_0x1669('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1669('0x3')](0x0);var events={'afterCreate':_0x1669('0x4'),'afterUpdate':_0x1669('0x5'),'afterDestroy':_0x1669('0x6')};function emitEvent(_0x455cbd){return function(_0x19a3f5,_0x2ad807,_0x4b41a5){UserProfileEvents[_0x1669('0x7')](_0x455cbd+':'+_0x19a3f5['id'],_0x19a3f5);UserProfileEvents[_0x1669('0x7')](_0x455cbd,_0x19a3f5);_0x4b41a5(null);};}for(var e in events){if(events[_0x1669('0x8')](e)){var event=events[e];UserProfile[_0x1669('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xba6f=['update','remove','emit','hasOwnProperty','hook','events','UserProfile','setMaxListeners','save'];(function(_0x29d2f2,_0x5c8ca5){var _0x4e864b=function(_0x3ab957){while(--_0x3ab957){_0x29d2f2['push'](_0x29d2f2['shift']());}};_0x4e864b(++_0x5c8ca5);}(_0xba6f,0x1d0));var _0xfba6=function(_0xb17208,_0x16f568){_0xb17208=_0xb17208-0x0;var _0x160444=_0xba6f[_0xb17208];return _0x160444;};'use strict';var EventEmitter=require(_0xfba6('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xfba6('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xfba6('0x2')](0x0);var events={'afterCreate':_0xfba6('0x3'),'afterUpdate':_0xfba6('0x4'),'afterDestroy':_0xfba6('0x5')};function emitEvent(_0x2c6e98){return function(_0x3b4dda,_0x3d2803,_0x1bbeb5){UserProfileEvents[_0xfba6('0x6')](_0x2c6e98+':'+_0x3b4dda['id'],_0x3b4dda);UserProfileEvents[_0xfba6('0x6')](_0x2c6e98,_0x3b4dda);_0x1bbeb5(null);};}for(var e in events){if(events[_0xfba6('0x7')](e)){var event=events[e];UserProfile[_0xfba6('0x8')](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 7e68a59..7a822de 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 _0x34e8=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','UserProfile','user_profiles','models','User','update','privacyEnabled','then','catch','lodash','util','../../config/logger','api'];(function(_0x32277d,_0x33f58b){var _0x318418=function(_0x5a4dff){while(--_0x5a4dff){_0x32277d['push'](_0x32277d['shift']());}};_0x318418(++_0x33f58b);}(_0x34e8,0x12c));var _0x834e=function(_0x3f65b2,_0x1b2e39){_0x3f65b2=_0x3f65b2-0x0;var _0x2a6ef7=_0x34e8[_0x3f65b2];return _0x2a6ef7;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3a3ef6,_0x2e69e2,_0x33ea05){var _0x23501c=_0x4a2018[_0x834e('0xd')];_0x23501c[_0x834e('0xe')][_0x834e('0xf')]({'privacyEnabled':_0x3a3ef6[_0x834e('0x10')]},{'where':{'UserProfileId':_0x3a3ef6['id']}})[_0x834e('0x11')](function(){_0x33ea05();})[_0x834e('0x12')](function(_0x14038b){_0x33ea05(_0x14038b);});}}});}; \ No newline at end of file +var _0x008c=['../../config/environment','./userProfile.attributes','exports','define','user_profiles','models','User','catch','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x008c,0x188));var _0xc008=function(_0x26ddfe,_0xacae3f){_0x26ddfe=_0x26ddfe-0x0;var _0xa8f46f=_0x008c[_0x26ddfe];return _0xa8f46f;};'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')]('UserProfile',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5aa09b,_0x30be38,_0x5b64f8){var _0x52041f=_0x13aa7[_0xc008('0xd')];_0x52041f[_0xc008('0xe')]['update']({'privacyEnabled':_0x5aa09b['privacyEnabled']},{'where':{'UserProfileId':_0x5aa09b['id']}})['then'](function(){_0x5b64f8();})[_0xc008('0xf')](function(_0xc881aa){_0x5b64f8(_0xc881aa);});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 623c839..16dc930 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 _0xa329=['request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then'];(function(_0x2c6ac4,_0x306af6){var _0x425a34=function(_0x1f3640){while(--_0x1f3640){_0x2c6ac4['push'](_0x2c6ac4['shift']());}};_0x425a34(++_0x306af6);}(_0xa329,0x162));var _0x9a32=function(_0x43fa75,_0x419220){_0x43fa75=_0x43fa75-0x0;var _0x40e9b2=_0xa329[_0x43fa75];return _0x40e9b2;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a32('0x3'));var db=require(_0x9a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a32('0x5'));var config=require(_0x9a32('0x6'));var jayson=require(_0x9a32('0x7'));var client=jayson[_0x9a32('0x8')][_0x9a32('0x9')]({'port':0x232a});config[_0x9a32('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9a32('0xb'))(new Redis(config[_0x9a32('0xa')]));require('./userProfile.socket')[_0x9a32('0xc')](socket);function respondWithRpcPromise(_0x184a41,_0x231d97,_0x452146){return new BPromise(function(_0x3e5cda,_0x16d821){return client['request'](_0x184a41,_0x452146)[_0x9a32('0xd')](function(_0x25c5b8){logger['info']('UserProfile,\x20%s,\x20%s',_0x231d97,_0x9a32('0xe'));logger[_0x9a32('0xf')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x231d97,'request\x20sent',JSON[_0x9a32('0x10')](_0x25c5b8));if(_0x25c5b8[_0x9a32('0x11')]){if(_0x25c5b8[_0x9a32('0x11')][_0x9a32('0x12')]===0x1f4){logger['error'](_0x9a32('0x13'),_0x231d97,_0x25c5b8[_0x9a32('0x11')]['message']);return _0x16d821(_0x25c5b8[_0x9a32('0x11')][_0x9a32('0x14')]);}logger[_0x9a32('0x11')](_0x9a32('0x13'),_0x231d97,_0x25c5b8[_0x9a32('0x11')][_0x9a32('0x14')]);return _0x3e5cda(_0x25c5b8['error'][_0x9a32('0x14')]);}else{logger[_0x9a32('0x15')](_0x9a32('0x13'),_0x231d97,'request\x20sent');_0x3e5cda(_0x25c5b8[_0x9a32('0x16')][_0x9a32('0x14')]);}})['catch'](function(_0x598592){logger[_0x9a32('0x11')](_0x9a32('0x13'),_0x231d97,_0x598592);_0x16d821(_0x598592);});});} \ No newline at end of file +var _0xfc65=['redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x11a6f9,_0x34c7c4){_0x11a6f9=_0x11a6f9-0x0;var _0x5e2a76=_0xfc65[_0x11a6f9];return _0x5e2a76;};'use strict';var _=require(_0x5fc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5fc6('0x1'));var rs=require(_0x5fc6('0x2'));var fs=require('fs');var Redis=require(_0x5fc6('0x3'));var db=require(_0x5fc6('0x4'))['db'];var utils=require(_0x5fc6('0x5'));var logger=require(_0x5fc6('0x6'))(_0x5fc6('0x7'));var config=require(_0x5fc6('0x8'));var jayson=require(_0x5fc6('0x9'));var client=jayson[_0x5fc6('0xa')][_0x5fc6('0xb')]({'port':0x232a});config[_0x5fc6('0xc')]=_[_0x5fc6('0xd')](config['redis'],{'host':_0x5fc6('0xe'),'port':0x18eb});var socket=require(_0x5fc6('0xf'))(new Redis(config[_0x5fc6('0xc')]));require(_0x5fc6('0x10'))[_0x5fc6('0x11')](socket);function respondWithRpcPromise(_0xbc3db9,_0x23c4e2,_0x27cad8){return new BPromise(function(_0x3d8781,_0x29781f){return client['request'](_0xbc3db9,_0x27cad8)[_0x5fc6('0x12')](function(_0x51ad7e){logger[_0x5fc6('0x13')](_0x5fc6('0x14'),_0x23c4e2,_0x5fc6('0x15'));logger[_0x5fc6('0x16')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x23c4e2,_0x5fc6('0x15'),JSON[_0x5fc6('0x17')](_0x51ad7e));if(_0x51ad7e[_0x5fc6('0x18')]){if(_0x51ad7e[_0x5fc6('0x18')][_0x5fc6('0x19')]===0x1f4){logger[_0x5fc6('0x18')](_0x5fc6('0x14'),_0x23c4e2,_0x51ad7e[_0x5fc6('0x18')][_0x5fc6('0x1a')]);return _0x29781f(_0x51ad7e[_0x5fc6('0x18')]['message']);}logger['error'](_0x5fc6('0x14'),_0x23c4e2,_0x51ad7e[_0x5fc6('0x18')]['message']);return _0x3d8781(_0x51ad7e[_0x5fc6('0x18')][_0x5fc6('0x1a')]);}else{logger[_0x5fc6('0x13')](_0x5fc6('0x14'),_0x23c4e2,_0x5fc6('0x15'));_0x3d8781(_0x51ad7e[_0x5fc6('0x1b')]['message']);}})[_0x5fc6('0x1c')](function(_0x4363c1){logger[_0x5fc6('0x18')](_0x5fc6('0x14'),_0x23c4e2,_0x4363c1);_0x29781f(_0x4363c1);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 71da430..c632ac7 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 _0xcab0=['remove','update','emit','register','userProfile:','./userProfile.events','save'];(function(_0x4dba7a,_0x3bb6e2){var _0x5c1b51=function(_0x4c5e00){while(--_0x4c5e00){_0x4dba7a['push'](_0x4dba7a['shift']());}};_0x5c1b51(++_0x3bb6e2);}(_0xcab0,0xec));var _0x0cab=function(_0x1ce382,_0x5b5e65){_0x1ce382=_0x1ce382-0x0;var _0x527ac6=_0xcab0[_0x1ce382];return _0x527ac6;};'use strict';var UserProfileEvents=require(_0x0cab('0x0'));var events=[_0x0cab('0x1'),_0x0cab('0x2'),_0x0cab('0x3')];function createListener(_0x3b91cb,_0x54e2f5){return function(_0x343744){_0x54e2f5[_0x0cab('0x4')](_0x3b91cb,_0x343744);};}function removeListener(_0x17555c,_0x4bf44e){return function(){UserProfileEvents['removeListener'](_0x17555c,_0x4bf44e);};}exports[_0x0cab('0x5')]=function(_0x2bf769){for(var _0x350a62=0x0,_0x580857=events['length'];_0x350a62<_0x580857;_0x350a62++){var _0x19753b=events[_0x350a62];var _0x4f17e5=createListener(_0x0cab('0x6')+_0x19753b,_0x2bf769);UserProfileEvents['on'](_0x19753b,_0x4f17e5);}}; \ No newline at end of file +var _0xd388=['remove','update','removeListener','length','./userProfile.events','save'];(function(_0x48b030,_0x1d18c8){var _0x2ce24f=function(_0x178030){while(--_0x178030){_0x48b030['push'](_0x48b030['shift']());}};_0x2ce24f(++_0x1d18c8);}(_0xd388,0xb8));var _0x8d38=function(_0x212db2,_0x3ff4b1){_0x212db2=_0x212db2-0x0;var _0x55ab31=_0xd388[_0x212db2];return _0x55ab31;};'use strict';var UserProfileEvents=require(_0x8d38('0x0'));var events=[_0x8d38('0x1'),_0x8d38('0x2'),_0x8d38('0x3')];function createListener(_0x5bf65f,_0x4388d0){return function(_0x4a2cd0){_0x4388d0['emit'](_0x5bf65f,_0x4a2cd0);};}function removeListener(_0x5416ef,_0x57427a){return function(){UserProfileEvents[_0x8d38('0x4')](_0x5416ef,_0x57427a);};}exports['register']=function(_0x1c0158){for(var _0x3dda0d=0x0,_0x41b173=events[_0x8d38('0x5')];_0x3dda0d<_0x41b173;_0x3dda0d++){var _0x485f0c=events[_0x3dda0d];var _0x34e022=createListener('userProfile:'+_0x485f0c,_0x1c0158);UserProfileEvents['on'](_0x485f0c,_0x34e022);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index d743f2b..6cb1c8d 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 _0x4c1b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x418c43,_0x404dc4){var _0x2efb1c=function(_0x94ba5b){while(--_0x94ba5b){_0x418c43['push'](_0x418c43['shift']());}};_0x2efb1c(++_0x404dc4);}(_0x4c1b,0x1c8));var _0xb4c1=function(_0x13446a,_0x28a1a6){_0x13446a=_0x13446a-0x0;var _0x202947=_0x4c1b[_0x13446a];return _0x202947;};'use strict';var multer=require(_0xb4c1('0x0'));var util=require(_0xb4c1('0x1'));var path=require(_0xb4c1('0x2'));var timeout=require(_0xb4c1('0x3'));var express=require(_0xb4c1('0x4'));var router=express[_0xb4c1('0x5')]();var fs_extra=require(_0xb4c1('0x6'));var auth=require(_0xb4c1('0x7'));var interaction=require(_0xb4c1('0x8'));var config=require(_0xb4c1('0x9'));var controller=require(_0xb4c1('0xa'));router['get']('/',auth[_0xb4c1('0xb')](),controller[_0xb4c1('0xc')]);router['get'](_0xb4c1('0xd'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0xe')]);router[_0xb4c1('0xf')](_0xb4c1('0x10'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x11')]);router['post']('/',auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x12')]);router['put'](_0xb4c1('0x10'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x13')]);router['delete'](_0xb4c1('0x10'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x14')]);module[_0xb4c1('0x15')]=router; \ No newline at end of file +var _0xf8c1=['put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','post'];(function(_0x26903d,_0x23935d){var _0x97cfc4=function(_0x103492){while(--_0x103492){_0x26903d['push'](_0x26903d['shift']());}};_0x97cfc4(++_0x23935d);}(_0xf8c1,0x94));var _0x1f8c=function(_0x476425,_0x4cb2c3){_0x476425=_0x476425-0x0;var _0x50f104=_0xf8c1[_0x476425];return _0x50f104;};'use strict';var multer=require('multer');var util=require(_0x1f8c('0x0'));var path=require(_0x1f8c('0x1'));var timeout=require(_0x1f8c('0x2'));var express=require(_0x1f8c('0x3'));var router=express['Router']();var fs_extra=require(_0x1f8c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1f8c('0x5'));var config=require(_0x1f8c('0x6'));var controller=require('./userProfileResource.controller');router[_0x1f8c('0x7')]('/',auth[_0x1f8c('0x8')](),controller['index']);router['get'](_0x1f8c('0x9'),auth[_0x1f8c('0x8')](),controller['describe']);router['get'](_0x1f8c('0xa'),auth[_0x1f8c('0x8')](),controller['show']);router[_0x1f8c('0xb')]('/',auth[_0x1f8c('0x8')](),controller['create']);router[_0x1f8c('0xc')](_0x1f8c('0xa'),auth[_0x1f8c('0x8')](),controller[_0x1f8c('0xd')]);router[_0x1f8c('0xe')](_0x1f8c('0xa'),auth[_0x1f8c('0x8')](),controller[_0x1f8c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5d269e0..681ba4d 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 _0x47ce=['INTEGER','STRING','sequelize','exports'];(function(_0x273b1a,_0x2d12d7){var _0x3d3e9a=function(_0x3808a9){while(--_0x3808a9){_0x273b1a['push'](_0x273b1a['shift']());}};_0x3d3e9a(++_0x2d12d7);}(_0x47ce,0xe6));var _0xe47c=function(_0x562525,_0x5a5e52){_0x562525=_0x562525-0x0;var _0x4ec0bd=_0x47ce[_0x562525];return _0x4ec0bd;};'use strict';var Sequelize=require(_0xe47c('0x0'));module[_0xe47c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe47c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe47c('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x4228=['STRING','sequelize','exports'];(function(_0x4eb63d,_0x2b77ac){var _0x23a451=function(_0x5ed125){while(--_0x5ed125){_0x4eb63d['push'](_0x4eb63d['shift']());}};_0x23a451(++_0x2b77ac);}(_0x4228,0xb2));var _0x8422=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4228[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8422('0x0'));module[_0x8422('0x1')]={'name':{'type':Sequelize[_0x8422('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x8422('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 09ccfef..db30d4c 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 _0x33af=['findAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','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','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll'];(function(_0x15b76f,_0x1f686f){var _0x572d0c=function(_0x7a17cd){while(--_0x7a17cd){_0x15b76f['push'](_0x15b76f['shift']());}};_0x572d0c(++_0x1f686f);}(_0x33af,0xec));var _0xf33a=function(_0x4a3554,_0x14f2fd){_0x4a3554=_0x4a3554-0x0;var _0x12e4cb=_0x33af[_0x4a3554];return _0x12e4cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['UserProfileResource'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};exports[_0xf33a('0x4a')]=function(_0xd40707,_0x36cba8){return db['UserProfileResource'][_0xf33a('0x4a')]()[_0xf33a('0x26')](respondWithResult(_0x36cba8,null))[_0xf33a('0x42')](handleError(_0x36cba8,null));}; \ No newline at end of file +var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x19ef2b,_0x354f66){var _0x4df537=function(_0x576738){while(--_0x576738){_0x19ef2b['push'](_0x19ef2b['shift']());}};_0x4df537(++_0x354f66);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['UserProfileResource'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['UserProfileResource'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index a0d0f40..50d5169 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 _0x47b1=['define','UserProfileResource','user_profile_has_resources','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5a9716,_0x1c6a6b){var _0x3f5e33=function(_0x4ac761){while(--_0x4ac761){_0x5a9716['push'](_0x5a9716['shift']());}};_0x3f5e33(++_0x1c6a6b);}(_0x47b1,0xab));var _0x147b=function(_0x342c39,_0x17c253){_0x342c39=_0x342c39-0x0;var _0x229347=_0x47b1[_0x342c39];return _0x229347;};'use strict';var _=require('lodash');var util=require(_0x147b('0x0'));var logger=require('../../config/logger')(_0x147b('0x1'));var moment=require(_0x147b('0x2'));var BPromise=require(_0x147b('0x3'));var rp=require(_0x147b('0x4'));var fs=require('fs');var path=require(_0x147b('0x5'));var rimraf=require(_0x147b('0x6'));var config=require(_0x147b('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x147b('0x8')]=function(_0x574abd,_0x3e6bcc){return _0x574abd[_0x147b('0x9')](_0x147b('0xa'),attributes,{'tableName':_0x147b('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7712=['define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x5be5c4,_0x4e61b6){var _0x15c673=function(_0x4cea55){while(--_0x4cea55){_0x5be5c4['push'](_0x5be5c4['shift']());}};_0x15c673(++_0x4e61b6);}(_0x7712,0xa1));var _0x2771=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7712[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2771('0x0'));var moment=require(_0x2771('0x1'));var BPromise=require('bluebird');var rp=require(_0x2771('0x2'));var fs=require('fs');var path=require(_0x2771('0x3'));var rimraf=require(_0x2771('0x4'));var config=require(_0x2771('0x5'));var attributes=require(_0x2771('0x6'));module[_0x2771('0x7')]=function(_0x1b9268,_0x391def){return _0x1b9268[_0x2771('0x8')](_0x2771('0x9'),attributes,{'tableName':_0x2771('0xa'),'paranoid':![],'indexes':[{'name':_0x2771('0xb'),'fields':['resourceId',_0x2771('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0e1beb8..c6eadca 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 _0x9d37=['client','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x9d37,0xf3));var _0x79d3=function(_0x478397,_0x55e0a1){_0x478397=_0x478397-0x0;var _0x260167=_0x9d37[_0x478397];return _0x260167;};'use strict';var _=require(_0x79d3('0x0'));var util=require(_0x79d3('0x1'));var moment=require('moment');var BPromise=require(_0x79d3('0x2'));var rs=require(_0x79d3('0x3'));var fs=require('fs');var Redis=require(_0x79d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79d3('0x5'));var logger=require(_0x79d3('0x6'))(_0x79d3('0x7'));var config=require(_0x79d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x79d3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x214166,_0x4741b4,_0x5a0a6f){return new BPromise(function(_0x5a7894,_0x518973){return client[_0x79d3('0xa')](_0x214166,_0x5a0a6f)['then'](function(_0x2a6a9b){logger[_0x79d3('0xb')](_0x79d3('0xc'),_0x4741b4,_0x79d3('0xd'));logger[_0x79d3('0xe')](_0x79d3('0xf'),_0x4741b4,_0x79d3('0xd'),JSON[_0x79d3('0x10')](_0x2a6a9b));if(_0x2a6a9b['error']){if(_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x12')]===0x1f4){logger[_0x79d3('0x11')](_0x79d3('0xc'),_0x4741b4,_0x2a6a9b[_0x79d3('0x11')]['message']);return _0x518973(_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x13')]);}logger[_0x79d3('0x11')](_0x79d3('0xc'),_0x4741b4,_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x13')]);return _0x5a7894(_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x13')]);}else{logger[_0x79d3('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x4741b4,_0x79d3('0xd'));_0x5a7894(_0x2a6a9b['result'][_0x79d3('0x13')]);}})[_0x79d3('0x14')](function(_0x13c482){logger[_0x79d3('0x11')](_0x79d3('0xc'),_0x4741b4,_0x13c482);_0x518973(_0x13c482);});});} \ No newline at end of file +var _0x4c76=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x529351,_0x3ac704){var _0x41cd56=function(_0x540861){while(--_0x540861){_0x529351['push'](_0x529351['shift']());}};_0x41cd56(++_0x3ac704);}(_0x4c76,0x84));var _0x64c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x64c7('0x0'));var moment=require('moment');var BPromise=require(_0x64c7('0x1'));var rs=require(_0x64c7('0x2'));var fs=require('fs');var Redis=require(_0x64c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x64c7('0x4'));var logger=require(_0x64c7('0x5'))(_0x64c7('0x6'));var config=require(_0x64c7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x64c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x377eab,_0x2104f3,_0x5b12dc){return new BPromise(function(_0x4a3f45,_0x5964b9){return client['request'](_0x377eab,_0x5b12dc)[_0x64c7('0x9')](function(_0x21ef38){logger[_0x64c7('0xa')](_0x64c7('0xb'),_0x2104f3,_0x64c7('0xc'));logger[_0x64c7('0xd')](_0x64c7('0xe'),_0x2104f3,_0x64c7('0xc'),JSON[_0x64c7('0xf')](_0x21ef38));if(_0x21ef38[_0x64c7('0x10')]){if(_0x21ef38['error'][_0x64c7('0x11')]===0x1f4){logger[_0x64c7('0x10')](_0x64c7('0xb'),_0x2104f3,_0x21ef38[_0x64c7('0x10')][_0x64c7('0x12')]);return _0x5964b9(_0x21ef38['error'][_0x64c7('0x12')]);}logger[_0x64c7('0x10')](_0x64c7('0xb'),_0x2104f3,_0x21ef38[_0x64c7('0x10')][_0x64c7('0x12')]);return _0x4a3f45(_0x21ef38[_0x64c7('0x10')]['message']);}else{logger[_0x64c7('0xa')](_0x64c7('0xb'),_0x2104f3,_0x64c7('0xc'));_0x4a3f45(_0x21ef38[_0x64c7('0x13')][_0x64c7('0x12')]);}})[_0x64c7('0x14')](function(_0x55720b){logger[_0x64c7('0x10')](_0x64c7('0xb'),_0x2104f3,_0x55720b);_0x5964b9(_0x55720b);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d80b678..e862317 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 _0x0ee1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','/:id','show','post','put','delete','destroy','exports'];(function(_0x51d6a0,_0x136f65){var _0x1194ce=function(_0x27a3b8){while(--_0x27a3b8){_0x51d6a0['push'](_0x51d6a0['shift']());}};_0x1194ce(++_0x136f65);}(_0x0ee1,0x10a));var _0x10ee=function(_0x451f88,_0x5c061a){_0x451f88=_0x451f88-0x0;var _0x2cc2b7=_0x0ee1[_0x451f88];return _0x2cc2b7;};'use strict';var multer=require(_0x10ee('0x0'));var util=require(_0x10ee('0x1'));var path=require(_0x10ee('0x2'));var timeout=require(_0x10ee('0x3'));var express=require(_0x10ee('0x4'));var router=express[_0x10ee('0x5')]();var fs_extra=require(_0x10ee('0x6'));var auth=require(_0x10ee('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x10ee('0x8')]('/',auth['isAuthenticated'](),controller[_0x10ee('0x9')]);router['get'](_0x10ee('0xa'),auth[_0x10ee('0xb')](),controller['describe']);router[_0x10ee('0x8')](_0x10ee('0xc'),auth[_0x10ee('0xb')](),controller[_0x10ee('0xd')]);router[_0x10ee('0xe')]('/',auth[_0x10ee('0xb')](),controller['create']);router[_0x10ee('0xf')](_0x10ee('0xc'),auth[_0x10ee('0xb')](),controller['update']);router[_0x10ee('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x10ee('0x11')]);module[_0x10ee('0x12')]=router; \ No newline at end of file +var _0x5a31=['../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x39cf08,_0x1c5b40){var _0x409408=function(_0x3595a0){while(--_0x3595a0){_0x39cf08['push'](_0x39cf08['shift']());}};_0x409408(++_0x1c5b40);}(_0x5a31,0x1db));var _0x15a3=function(_0x4eb032,_0x2e6115){_0x4eb032=_0x4eb032-0x0;var _0x19ab9c=_0x5a31[_0x4eb032];return _0x19ab9c;};'use strict';var multer=require(_0x15a3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x15a3('0x1'));var express=require(_0x15a3('0x2'));var router=express[_0x15a3('0x3')]();var fs_extra=require(_0x15a3('0x4'));var auth=require(_0x15a3('0x5'));var interaction=require(_0x15a3('0x6'));var config=require('../../config/environment');var controller=require(_0x15a3('0x7'));router[_0x15a3('0x8')]('/',auth[_0x15a3('0x9')](),controller[_0x15a3('0xa')]);router[_0x15a3('0x8')](_0x15a3('0xb'),auth[_0x15a3('0x9')](),controller['describe']);router['get'](_0x15a3('0xc'),auth[_0x15a3('0x9')](),controller[_0x15a3('0xd')]);router['post']('/',auth[_0x15a3('0x9')](),controller[_0x15a3('0xe')]);router[_0x15a3('0xf')](_0x15a3('0xc'),auth[_0x15a3('0x9')](),controller[_0x15a3('0x10')]);router[_0x15a3('0x11')](_0x15a3('0xc'),auth[_0x15a3('0x9')](),controller[_0x15a3('0x12')]);module[_0x15a3('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 742fa3a..2640b63 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 _0xe511=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x3e5fce,_0x15b2ef){var _0x3c7786=function(_0x2b18aa){while(--_0x2b18aa){_0x3e5fce['push'](_0x3e5fce['shift']());}};_0x3c7786(++_0x15b2ef);}(_0xe511,0x16f));var _0x1e51=function(_0x10fe9e,_0x5514b4){_0x10fe9e=_0x10fe9e-0x0;var _0x29ef86=_0xe511[_0x10fe9e];return _0x29ef86;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x1e51('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x42e242){this[_0x1e51('0x4')](_0x1e51('0x5'),_0x42e242?_0x42e242[_0x1e51('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x1e51('0x5'))?this[_0x1e51('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x0fd9=['join','getDataValue','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x409c7e,_0x4718c0){var _0x101aa4=function(_0x219cdd){while(--_0x219cdd){_0x409c7e['push'](_0x409c7e['shift']());}};_0x101aa4(++_0x4718c0);}(_0x0fd9,0xa3));var _0x90fd=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0x0fd9[_0x441f7a];return _0x4821da;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'name':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x90fd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x90fd('0x1')],'set':function(_0x2a5f76){this[_0x90fd('0x3')](_0x90fd('0x4'),_0x2a5f76?_0x2a5f76[_0x90fd('0x5')](''):[]);},'get':function(){return this[_0x90fd('0x6')]('crudPermissions')?this['getDataValue'](_0x90fd('0x4'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d132cf7..096749f 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 _0x2480=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','send','index','UserProfileSection','fieldName','type','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0x2480,0x138));var _0x0248=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2480[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x0248('0x0'));var rimraf=require(_0x0248('0x1'));var zipdir=require(_0x0248('0x2'));var jsonpatch=require(_0x0248('0x3'));var rp=require(_0x0248('0x4'));var moment=require(_0x0248('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0248('0x6'));var util=require(_0x0248('0x7'));var path=require('path');var sox=require(_0x0248('0x8'));var csv=require('to-csv');var ejs=require(_0x0248('0x9'));var fs=require('fs');var fs_extra=require(_0x0248('0xa'));var _=require('lodash');var squel=require(_0x0248('0xb'));var crypto=require(_0x0248('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0248('0xd'));var toCsv=require(_0x0248('0xe'));var querystring=require(_0x0248('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0248('0x10'));var as=require(_0x0248('0x11'));var hardwareService=require(_0x0248('0x12'));var logger=require(_0x0248('0x13'))(_0x0248('0x14'));var utils=require(_0x0248('0x15'));var config=require(_0x0248('0x16'));var licenseUtil=require(_0x0248('0x17'));var db=require(_0x0248('0x18'))['db'];function respondWithStatusCode(_0x108a73,_0x3da1ce){_0x3da1ce=_0x3da1ce||0xcc;return function(_0x4993e5){if(_0x4993e5){return _0x108a73[_0x0248('0x19')](_0x3da1ce);}return _0x108a73[_0x0248('0x1a')](_0x3da1ce)[_0x0248('0x1b')]();};}function respondWithResult(_0x4431c3,_0x4af04e){_0x4af04e=_0x4af04e||0xc8;return function(_0x786878){if(_0x786878){return _0x4431c3[_0x0248('0x1a')](_0x4af04e)['json'](_0x786878);}};}function respondWithFilteredResult(_0x122a57,_0x3424c2){return function(_0x17ce7e){if(_0x17ce7e){var _0x250d21=typeof _0x3424c2[_0x0248('0x1c')]===_0x0248('0x1d')&&typeof _0x3424c2[_0x0248('0x1e')]===_0x0248('0x1d');var _0x1829b1=_0x17ce7e[_0x0248('0x1f')];var _0x322dfe=_0x250d21?0x0:_0x3424c2[_0x0248('0x1c')];var _0x4bd6ea=_0x250d21?_0x17ce7e['count']:_0x3424c2[_0x0248('0x1c')]+_0x3424c2[_0x0248('0x1e')];var _0x15710a;if(_0x4bd6ea>=_0x1829b1){_0x4bd6ea=_0x1829b1;_0x15710a=0xc8;}else{_0x15710a=0xce;}_0x122a57[_0x0248('0x1a')](_0x15710a);return _0x122a57['set'](_0x0248('0x20'),_0x322dfe+'-'+_0x4bd6ea+'/'+_0x1829b1)['json'](_0x17ce7e);}return null;};}function patchUpdates(_0x1bfd55){return function(_0x5bd1d9){try{jsonpatch[_0x0248('0x21')](_0x5bd1d9,_0x1bfd55,!![]);}catch(_0x81bc6a){return BPromise[_0x0248('0x22')](_0x81bc6a);}return _0x5bd1d9['save']();};}function saveUpdates(_0x20463d,_0x1d3ede){return function(_0x15c47c){if(_0x15c47c){return _0x15c47c['update'](_0x20463d)[_0x0248('0x23')](function(_0x13d01f){return _0x13d01f;});}return null;};}function removeEntity(_0xcbd4b3,_0x511067){return function(_0x49bd34){if(_0x49bd34){return _0x49bd34[_0x0248('0x24')]()['then'](function(){_0xcbd4b3[_0x0248('0x1a')](0xcc)[_0x0248('0x1b')]();});}};}function handleEntityNotFound(_0x16fa95,_0x16dc12){return function(_0x21238b){if(!_0x21238b){_0x16fa95[_0x0248('0x19')](0x194);}return _0x21238b;};}function handleError(_0x3707bd,_0x510b74){_0x510b74=_0x510b74||0x1f4;return function(_0x36c411){logger['error'](_0x36c411['stack']);if(_0x36c411['name']){delete _0x36c411['name'];}_0x3707bd['status'](_0x510b74)[_0x0248('0x25')](_0x36c411);};}exports[_0x0248('0x26')]=function(_0x2de55e,_0x388a77){var _0x26ccd8={},_0x1b8749={},_0x362fbb={'count':0x0,'rows':[]};var _0x3cdb61=_['map'](db[_0x0248('0x27')]['rawAttributes'],function(_0x3c93ee){return{'name':_0x3c93ee[_0x0248('0x28')],'type':_0x3c93ee[_0x0248('0x29')]['key']};});_0x1b8749['model']=_[_0x0248('0x2a')](_0x3cdb61,_0x0248('0x2b'));_0x1b8749[_0x0248('0x2c')]=_[_0x0248('0x2d')](_0x2de55e[_0x0248('0x2c')]);_0x1b8749[_0x0248('0x2e')]=_[_0x0248('0x2f')](_0x1b8749[_0x0248('0x30')],_0x1b8749[_0x0248('0x2c')]);_0x26ccd8[_0x0248('0x31')]=_[_0x0248('0x2f')](_0x1b8749[_0x0248('0x30')],qs[_0x0248('0x32')](_0x2de55e[_0x0248('0x2c')][_0x0248('0x32')]));_0x26ccd8['attributes']=_0x26ccd8[_0x0248('0x31')][_0x0248('0x33')]?_0x26ccd8[_0x0248('0x31')]:_0x1b8749[_0x0248('0x30')];if(!_0x2de55e[_0x0248('0x2c')][_0x0248('0x34')](_0x0248('0x35'))){_0x26ccd8[_0x0248('0x1e')]=qs['limit'](_0x2de55e[_0x0248('0x2c')][_0x0248('0x1e')]);_0x26ccd8[_0x0248('0x1c')]=qs['offset'](_0x2de55e[_0x0248('0x2c')][_0x0248('0x1c')]);}_0x26ccd8[_0x0248('0x36')]=qs[_0x0248('0x37')](_0x2de55e[_0x0248('0x2c')]['sort']);_0x26ccd8['where']=qs['filters'](_['pick'](_0x2de55e[_0x0248('0x2c')],_0x1b8749[_0x0248('0x2e')]),_0x3cdb61);if(_0x2de55e['query'][_0x0248('0x38')]){_0x26ccd8[_0x0248('0x39')]=_['merge'](_0x26ccd8['where'],{'$or':_[_0x0248('0x2a')](_0x3cdb61,function(_0x598fd3){if(_0x598fd3[_0x0248('0x29')]!==_0x0248('0x3a')){var _0x5a565e={};_0x5a565e[_0x598fd3['name']]={'$like':'%'+_0x2de55e[_0x0248('0x2c')][_0x0248('0x38')]+'%'};return _0x5a565e;}})});}_0x26ccd8=_[_0x0248('0x3b')]({},_0x26ccd8,_0x2de55e[_0x0248('0x3c')]);var _0x531bc2={'where':_0x26ccd8[_0x0248('0x39')]};return db[_0x0248('0x27')]['count'](_0x531bc2)[_0x0248('0x23')](function(_0x1922bc){_0x362fbb[_0x0248('0x1f')]=_0x1922bc;if(_0x2de55e[_0x0248('0x2c')][_0x0248('0x3d')]){_0x26ccd8[_0x0248('0x3e')]=[{'all':!![]}];}return db[_0x0248('0x27')][_0x0248('0x3f')](_0x26ccd8);})[_0x0248('0x23')](function(_0x47a7ca){_0x362fbb[_0x0248('0x40')]=_0x47a7ca;return _0x362fbb;})[_0x0248('0x23')](respondWithFilteredResult(_0x388a77,_0x26ccd8))[_0x0248('0x41')](handleError(_0x388a77,null));};exports[_0x0248('0x42')]=function(_0xd9c14f,_0x254149){var _0x1e38b2={'raw':![],'where':{'id':_0xd9c14f[_0x0248('0x43')]['id']}},_0x145d6b={};_0x145d6b[_0x0248('0x30')]=_[_0x0248('0x2d')](db[_0x0248('0x27')][_0x0248('0x44')]);_0x145d6b[_0x0248('0x2c')]=_[_0x0248('0x2d')](_0xd9c14f['query']);_0x145d6b[_0x0248('0x2e')]=_['intersection'](_0x145d6b['model'],_0x145d6b['query']);_0x1e38b2[_0x0248('0x31')]=_[_0x0248('0x2f')](_0x145d6b['model'],qs[_0x0248('0x32')](_0xd9c14f[_0x0248('0x2c')][_0x0248('0x32')]));_0x1e38b2[_0x0248('0x31')]=_0x1e38b2[_0x0248('0x31')][_0x0248('0x33')]?_0x1e38b2[_0x0248('0x31')]:_0x145d6b['model'];if(_0xd9c14f[_0x0248('0x2c')][_0x0248('0x3d')]){_0x1e38b2[_0x0248('0x3e')]=[{'all':!![]}];}_0x1e38b2=_[_0x0248('0x3b')]({},_0x1e38b2,_0xd9c14f[_0x0248('0x3c')]);return db[_0x0248('0x27')][_0x0248('0x45')](_0x1e38b2)[_0x0248('0x23')](handleEntityNotFound(_0x254149,null))['then'](respondWithResult(_0x254149,null))[_0x0248('0x41')](handleError(_0x254149,null));};exports['create']=function(_0x17631d,_0x1d84cf){return db[_0x0248('0x27')][_0x0248('0x46')](_0x17631d[_0x0248('0x47')],{})[_0x0248('0x23')](respondWithResult(_0x1d84cf,0xc9))['catch'](handleError(_0x1d84cf,null));};exports[_0x0248('0x48')]=function(_0x2cdbdb,_0x2d19d7){if(_0x2cdbdb[_0x0248('0x47')]['id']){delete _0x2cdbdb[_0x0248('0x47')]['id'];}return db[_0x0248('0x27')][_0x0248('0x45')]({'where':{'id':_0x2cdbdb['params']['id']}})['then'](handleEntityNotFound(_0x2d19d7,null))[_0x0248('0x23')](saveUpdates(_0x2cdbdb['body'],null))[_0x0248('0x23')](respondWithResult(_0x2d19d7,null))[_0x0248('0x41')](handleError(_0x2d19d7,null));};exports['destroy']=function(_0x3f7cd1,_0x1843b1){return db[_0x0248('0x27')][_0x0248('0x45')]({'where':{'id':_0x3f7cd1[_0x0248('0x43')]['id']}})['then'](handleEntityNotFound(_0x1843b1,null))[_0x0248('0x23')](removeEntity(_0x1843b1,null))[_0x0248('0x41')](handleError(_0x1843b1,null));};exports['describe']=function(_0x4ebddb,_0x4bfcb0){return db['UserProfileSection'][_0x0248('0x49')]()['then'](respondWithResult(_0x4bfcb0,null))[_0x0248('0x41')](handleError(_0x4bfcb0,null));}; \ No newline at end of file +var _0x8339=['fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs'];(function(_0x18f822,_0x5373e3){var _0x13264b=function(_0x38f724){while(--_0x38f724){_0x18f822['push'](_0x18f822['shift']());}};_0x13264b(++_0x5373e3);}(_0x8339,0x126));var _0x9833=function(_0x52b408,_0x22fe7e){_0x52b408=_0x52b408-0x0;var _0x403deb=_0x8339[_0x52b408];return _0x403deb;};'use strict';var emlformat=require(_0x9833('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9833('0x1'));var jsonpatch=require(_0x9833('0x2'));var rp=require(_0x9833('0x3'));var moment=require(_0x9833('0x4'));var BPromise=require(_0x9833('0x5'));var Mustache=require(_0x9833('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9833('0x7'));var csv=require(_0x9833('0x8'));var ejs=require(_0x9833('0x9'));var fs=require('fs');var fs_extra=require(_0x9833('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9833('0xb'));var jsforce=require(_0x9833('0xc'));var deskjs=require(_0x9833('0xd'));var toCsv=require(_0x9833('0x8'));var querystring=require(_0x9833('0xe'));var Papa=require(_0x9833('0xf'));var Redis=require('ioredis');var authService=require(_0x9833('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9833('0x11'));var hardwareService=require(_0x9833('0x12'));var logger=require('../../config/logger')(_0x9833('0x13'));var utils=require(_0x9833('0x14'));var config=require(_0x9833('0x15'));var licenseUtil=require(_0x9833('0x16'));var db=require(_0x9833('0x17'))['db'];function respondWithStatusCode(_0x3e1744,_0x9afd5){_0x9afd5=_0x9afd5||0xcc;return function(_0x2785f3){if(_0x2785f3){return _0x3e1744[_0x9833('0x18')](_0x9afd5);}return _0x3e1744[_0x9833('0x19')](_0x9afd5)[_0x9833('0x1a')]();};}function respondWithResult(_0x234d7f,_0x44b59e){_0x44b59e=_0x44b59e||0xc8;return function(_0x512e65){if(_0x512e65){return _0x234d7f[_0x9833('0x19')](_0x44b59e)[_0x9833('0x1b')](_0x512e65);}};}function respondWithFilteredResult(_0x3dd451,_0x449163){return function(_0x36e2bf){if(_0x36e2bf){var _0xbe1da7=typeof _0x449163['offset']===_0x9833('0x1c')&&typeof _0x449163[_0x9833('0x1d')]===_0x9833('0x1c');var _0x4427fa=_0x36e2bf[_0x9833('0x1e')];var _0x47521e=_0xbe1da7?0x0:_0x449163['offset'];var _0x4b0793=_0xbe1da7?_0x36e2bf['count']:_0x449163[_0x9833('0x1f')]+_0x449163['limit'];var _0x26653a;if(_0x4b0793>=_0x4427fa){_0x4b0793=_0x4427fa;_0x26653a=0xc8;}else{_0x26653a=0xce;}_0x3dd451['status'](_0x26653a);return _0x3dd451[_0x9833('0x20')](_0x9833('0x21'),_0x47521e+'-'+_0x4b0793+'/'+_0x4427fa)[_0x9833('0x1b')](_0x36e2bf);}return null;};}function patchUpdates(_0x43e72a){return function(_0x545d79){try{jsonpatch[_0x9833('0x22')](_0x545d79,_0x43e72a,!![]);}catch(_0x3805e6){return BPromise[_0x9833('0x23')](_0x3805e6);}return _0x545d79['save']();};}function saveUpdates(_0xb2deff,_0x2661b3){return function(_0x201441){if(_0x201441){return _0x201441[_0x9833('0x24')](_0xb2deff)['then'](function(_0x397278){return _0x397278;});}return null;};}function removeEntity(_0x1915b6,_0xf6f34a){return function(_0x32ed7){if(_0x32ed7){return _0x32ed7[_0x9833('0x25')]()[_0x9833('0x26')](function(){_0x1915b6['status'](0xcc)[_0x9833('0x1a')]();});}};}function handleEntityNotFound(_0x1380ed,_0x1119f6){return function(_0x377a17){if(!_0x377a17){_0x1380ed['sendStatus'](0x194);}return _0x377a17;};}function handleError(_0x304767,_0x37f22f){_0x37f22f=_0x37f22f||0x1f4;return function(_0x2f22f8){logger[_0x9833('0x27')](_0x2f22f8['stack']);if(_0x2f22f8[_0x9833('0x28')]){delete _0x2f22f8[_0x9833('0x28')];}_0x304767[_0x9833('0x19')](_0x37f22f)[_0x9833('0x29')](_0x2f22f8);};}exports[_0x9833('0x2a')]=function(_0x3a7450,_0xdd07d8){var _0x43c1c1={},_0x1017c2={},_0x25d40e={'count':0x0,'rows':[]};var _0x3f6526=_[_0x9833('0x2b')](db[_0x9833('0x2c')][_0x9833('0x2d')],function(_0x477ad4){return{'name':_0x477ad4[_0x9833('0x2e')],'type':_0x477ad4[_0x9833('0x2f')][_0x9833('0x30')]};});_0x1017c2['model']=_[_0x9833('0x2b')](_0x3f6526,_0x9833('0x28'));_0x1017c2['query']=_[_0x9833('0x31')](_0x3a7450[_0x9833('0x32')]);_0x1017c2[_0x9833('0x33')]=_[_0x9833('0x34')](_0x1017c2[_0x9833('0x35')],_0x1017c2[_0x9833('0x32')]);_0x43c1c1['attributes']=_[_0x9833('0x34')](_0x1017c2[_0x9833('0x35')],qs[_0x9833('0x36')](_0x3a7450['query'][_0x9833('0x36')]));_0x43c1c1[_0x9833('0x37')]=_0x43c1c1[_0x9833('0x37')][_0x9833('0x38')]?_0x43c1c1[_0x9833('0x37')]:_0x1017c2[_0x9833('0x35')];if(!_0x3a7450[_0x9833('0x32')][_0x9833('0x39')]('nolimit')){_0x43c1c1[_0x9833('0x1d')]=qs[_0x9833('0x1d')](_0x3a7450['query'][_0x9833('0x1d')]);_0x43c1c1['offset']=qs[_0x9833('0x1f')](_0x3a7450['query'][_0x9833('0x1f')]);}_0x43c1c1[_0x9833('0x3a')]=qs[_0x9833('0x3b')](_0x3a7450['query'][_0x9833('0x3b')]);_0x43c1c1['where']=qs[_0x9833('0x33')](_[_0x9833('0x3c')](_0x3a7450['query'],_0x1017c2[_0x9833('0x33')]),_0x3f6526);if(_0x3a7450[_0x9833('0x32')][_0x9833('0x3d')]){_0x43c1c1['where']=_[_0x9833('0x3e')](_0x43c1c1[_0x9833('0x3f')],{'$or':_[_0x9833('0x2b')](_0x3f6526,function(_0x97f364){if(_0x97f364['type']!==_0x9833('0x40')){var _0x35bfd7={};_0x35bfd7[_0x97f364[_0x9833('0x28')]]={'$like':'%'+_0x3a7450[_0x9833('0x32')][_0x9833('0x3d')]+'%'};return _0x35bfd7;}})});}_0x43c1c1=_[_0x9833('0x3e')]({},_0x43c1c1,_0x3a7450[_0x9833('0x41')]);var _0x5b0742={'where':_0x43c1c1[_0x9833('0x3f')]};return db[_0x9833('0x2c')][_0x9833('0x1e')](_0x5b0742)[_0x9833('0x26')](function(_0x37b293){_0x25d40e[_0x9833('0x1e')]=_0x37b293;if(_0x3a7450[_0x9833('0x32')][_0x9833('0x42')]){_0x43c1c1[_0x9833('0x43')]=[{'all':!![]}];}return db[_0x9833('0x2c')]['findAll'](_0x43c1c1);})['then'](function(_0x2ec169){_0x25d40e[_0x9833('0x44')]=_0x2ec169;return _0x25d40e;})[_0x9833('0x26')](respondWithFilteredResult(_0xdd07d8,_0x43c1c1))[_0x9833('0x45')](handleError(_0xdd07d8,null));};exports[_0x9833('0x46')]=function(_0x3943c6,_0x208818){var _0x498ecb={'raw':![],'where':{'id':_0x3943c6[_0x9833('0x47')]['id']}},_0x23c7bf={};_0x23c7bf[_0x9833('0x35')]=_['keys'](db[_0x9833('0x2c')][_0x9833('0x2d')]);_0x23c7bf[_0x9833('0x32')]=_[_0x9833('0x31')](_0x3943c6[_0x9833('0x32')]);_0x23c7bf['filters']=_[_0x9833('0x34')](_0x23c7bf['model'],_0x23c7bf[_0x9833('0x32')]);_0x498ecb[_0x9833('0x37')]=_[_0x9833('0x34')](_0x23c7bf[_0x9833('0x35')],qs[_0x9833('0x36')](_0x3943c6[_0x9833('0x32')][_0x9833('0x36')]));_0x498ecb[_0x9833('0x37')]=_0x498ecb[_0x9833('0x37')][_0x9833('0x38')]?_0x498ecb[_0x9833('0x37')]:_0x23c7bf['model'];if(_0x3943c6[_0x9833('0x32')]['includeAll']){_0x498ecb['include']=[{'all':!![]}];}_0x498ecb=_[_0x9833('0x3e')]({},_0x498ecb,_0x3943c6['options']);return db[_0x9833('0x2c')][_0x9833('0x48')](_0x498ecb)[_0x9833('0x26')](handleEntityNotFound(_0x208818,null))[_0x9833('0x26')](respondWithResult(_0x208818,null))[_0x9833('0x45')](handleError(_0x208818,null));};exports[_0x9833('0x49')]=function(_0x551ca6,_0x25aa22){return db[_0x9833('0x2c')][_0x9833('0x49')](_0x551ca6[_0x9833('0x4a')],{})[_0x9833('0x26')](respondWithResult(_0x25aa22,0xc9))[_0x9833('0x45')](handleError(_0x25aa22,null));};exports['update']=function(_0x1c6b42,_0x233d57){if(_0x1c6b42[_0x9833('0x4a')]['id']){delete _0x1c6b42[_0x9833('0x4a')]['id'];}return db[_0x9833('0x2c')][_0x9833('0x48')]({'where':{'id':_0x1c6b42[_0x9833('0x47')]['id']}})[_0x9833('0x26')](handleEntityNotFound(_0x233d57,null))[_0x9833('0x26')](saveUpdates(_0x1c6b42[_0x9833('0x4a')],null))[_0x9833('0x26')](respondWithResult(_0x233d57,null))[_0x9833('0x45')](handleError(_0x233d57,null));};exports[_0x9833('0x25')]=function(_0x40ef4e,_0xb81a8d){return db[_0x9833('0x2c')]['find']({'where':{'id':_0x40ef4e['params']['id']}})[_0x9833('0x26')](handleEntityNotFound(_0xb81a8d,null))[_0x9833('0x26')](removeEntity(_0xb81a8d,null))[_0x9833('0x45')](handleError(_0xb81a8d,null));};exports['describe']=function(_0x2cbacb,_0x196055){return db[_0x9833('0x2c')][_0x9833('0x4b')]()[_0x9833('0x26')](respondWithResult(_0x196055,null))['catch'](handleError(_0x196055,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 5b4206f..85298ac 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 _0x59a6=['./userProfileSection.attributes','UserProfileSection','user_profile_has_sections','compositeIndex','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x59a6,0xac));var _0x659a=function(_0x29ddde,_0xd7b680){_0x29ddde=_0x29ddde-0x0;var _0x5132d0=_0x59a6[_0x29ddde];return _0x5132d0;};'use strict';var _=require(_0x659a('0x0'));var util=require(_0x659a('0x1'));var logger=require('../../config/logger')(_0x659a('0x2'));var moment=require(_0x659a('0x3'));var BPromise=require(_0x659a('0x4'));var rp=require(_0x659a('0x5'));var fs=require('fs');var path=require(_0x659a('0x6'));var rimraf=require(_0x659a('0x7'));var config=require('../../config/environment');var attributes=require(_0x659a('0x8'));module['exports']=function(_0x1e8d96,_0x19356e){return _0x1e8d96['define'](_0x659a('0x9'),attributes,{'tableName':_0x659a('0xa'),'paranoid':![],'indexes':[{'name':_0x659a('0xb'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ef9=['rimraf','../../config/environment','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x14d60b,_0x5adb76){var _0x1da483=function(_0x4c12c1){while(--_0x4c12c1){_0x14d60b['push'](_0x14d60b['shift']());}};_0x1da483(++_0x5adb76);}(_0x0ef9,0x1ce));var _0x90ef=function(_0x3c498f,_0x1a9eef){_0x3c498f=_0x3c498f-0x0;var _0x2104b8=_0x0ef9[_0x3c498f];return _0x2104b8;};'use strict';var _=require(_0x90ef('0x0'));var util=require(_0x90ef('0x1'));var logger=require(_0x90ef('0x2'))('api');var moment=require(_0x90ef('0x3'));var BPromise=require(_0x90ef('0x4'));var rp=require(_0x90ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90ef('0x6'));var config=require(_0x90ef('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x207b7e,_0x4e834e){return _0x207b7e[_0x90ef('0x8')]('UserProfileSection',attributes,{'tableName':_0x90ef('0x9'),'paranoid':![],'indexes':[{'name':_0x90ef('0xa'),'fields':[_0x90ef('0xb'),_0x90ef('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 17ba5a4..502a43c 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 _0x01ef=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x01ef,0x1dd));var _0xf01e=function(_0x585357,_0xc9b935){_0x585357=_0x585357-0x0;var _0x2feb8f=_0x01ef[_0x585357];return _0x2feb8f;};'use strict';var _=require(_0xf01e('0x0'));var util=require('util');var moment=require(_0xf01e('0x1'));var BPromise=require(_0xf01e('0x2'));var rs=require(_0xf01e('0x3'));var fs=require('fs');var Redis=require(_0xf01e('0x4'));var db=require(_0xf01e('0x5'))['db'];var utils=require(_0xf01e('0x6'));var logger=require('../../config/logger')(_0xf01e('0x7'));var config=require(_0xf01e('0x8'));var jayson=require(_0xf01e('0x9'));var client=jayson[_0xf01e('0xa')][_0xf01e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d4ee7,_0x3fc8ec,_0x7bfea8){return new BPromise(function(_0x23290c,_0x2a7b61){return client[_0xf01e('0xc')](_0x5d4ee7,_0x7bfea8)[_0xf01e('0xd')](function(_0x340051){logger[_0xf01e('0xe')](_0xf01e('0xf'),_0x3fc8ec,'request\x20sent');logger[_0xf01e('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3fc8ec,'request\x20sent',JSON['stringify'](_0x340051));if(_0x340051[_0xf01e('0x11')]){if(_0x340051[_0xf01e('0x11')][_0xf01e('0x12')]===0x1f4){logger[_0xf01e('0x11')](_0xf01e('0xf'),_0x3fc8ec,_0x340051[_0xf01e('0x11')][_0xf01e('0x13')]);return _0x2a7b61(_0x340051[_0xf01e('0x11')][_0xf01e('0x13')]);}logger[_0xf01e('0x11')](_0xf01e('0xf'),_0x3fc8ec,_0x340051[_0xf01e('0x11')]['message']);return _0x23290c(_0x340051[_0xf01e('0x11')][_0xf01e('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x3fc8ec,'request\x20sent');_0x23290c(_0x340051[_0xf01e('0x14')][_0xf01e('0x13')]);}})[_0xf01e('0x15')](function(_0x3d4e33){logger[_0xf01e('0x11')](_0xf01e('0xf'),_0x3fc8ec,_0x3d4e33);_0x2a7b61(_0x3d4e33);});});} \ No newline at end of file +var _0xb4fd=['moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4830f8,_0x2e3f92){var _0xd6eff4=function(_0x504cab){while(--_0x504cab){_0x4830f8['push'](_0x4830f8['shift']());}};_0xd6eff4(++_0x2e3f92);}(_0xb4fd,0x130));var _0xdb4f=function(_0x439c80,_0x2fea7c){_0x439c80=_0x439c80-0x0;var _0x406184=_0xb4fd[_0x439c80];return _0x406184;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb4f('0x0'));var BPromise=require('bluebird');var rs=require(_0xdb4f('0x1'));var fs=require('fs');var Redis=require(_0xdb4f('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdb4f('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdb4f('0x4'));var client=jayson[_0xdb4f('0x5')][_0xdb4f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x182d6d,_0xed158c,_0x370cc9){return new BPromise(function(_0x138db1,_0x20d3c0){return client['request'](_0x182d6d,_0x370cc9)['then'](function(_0x166bf3){logger[_0xdb4f('0x7')](_0xdb4f('0x8'),_0xed158c,_0xdb4f('0x9'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0xed158c,_0xdb4f('0x9'),JSON[_0xdb4f('0xa')](_0x166bf3));if(_0x166bf3[_0xdb4f('0xb')]){if(_0x166bf3[_0xdb4f('0xb')][_0xdb4f('0xc')]===0x1f4){logger[_0xdb4f('0xb')](_0xdb4f('0x8'),_0xed158c,_0x166bf3[_0xdb4f('0xb')]['message']);return _0x20d3c0(_0x166bf3[_0xdb4f('0xb')]['message']);}logger[_0xdb4f('0xb')]('UserProfileSection,\x20%s,\x20%s',_0xed158c,_0x166bf3[_0xdb4f('0xb')][_0xdb4f('0xd')]);return _0x138db1(_0x166bf3[_0xdb4f('0xb')][_0xdb4f('0xd')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0xed158c,_0xdb4f('0x9'));_0x138db1(_0x166bf3[_0xdb4f('0xe')][_0xdb4f('0xd')]);}})[_0xdb4f('0xf')](function(_0x326ed5){logger[_0xdb4f('0xb')](_0xdb4f('0x8'),_0xed158c,_0x326ed5);_0x20d3c0(_0x326ed5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index dcb4cac..d7175f7 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x269ca8,_0x282e11){var _0x5788e8=function(_0x2b6b2c){while(--_0x2b6b2c){_0x269ca8['push'](_0x269ca8['shift']());}};_0x5788e8(++_0x282e11);}(_0x70e0,0x17b));var _0x070e=function(_0x2a79cc,_0x13dbbd){_0x2a79cc=_0x2a79cc-0x0;var _0x4fb645=_0x70e0[_0x2a79cc];return _0x4fb645;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1a1729,_0x59f11b){var _0x248ba1=function(_0x2924c1){while(--_0x2924c1){_0x1a1729['push'](_0x1a1729['shift']());}};_0x248ba1(++_0x59f11b);}(_0x70e0,0x17b));var _0x070e=function(_0x3aeb04,_0x46d66e){_0x3aeb04=_0x3aeb04-0x0;var _0x24f05f=_0x70e0[_0x3aeb04];return _0x24f05f;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 8f0e334..486ec70 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 _0xf938=['INTEGER','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf938,0x106));var _0x8f93=function(_0x5b734b,_0x486a7f){_0x5b734b=_0x5b734b-0x0;var _0x2a15a3=_0xf938[_0x5b734b];return _0x2a15a3;};'use strict';var Sequelize=require(_0x8f93('0x0'));module[_0x8f93('0x1')]={'penalty':{'type':Sequelize[_0x8f93('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2bce=['sequelize','exports'];(function(_0x385260,_0x5e3364){var _0x144fb3=function(_0x4ab2ba){while(--_0x4ab2ba){_0x385260['push'](_0x385260['shift']());}};_0x144fb3(++_0x5e3364);}(_0x2bce,0xd6));var _0xe2bc=function(_0x5ff11a,_0x3e74f6){_0x5ff11a=_0x5ff11a-0x0;var _0x43e45e=_0x2bce[_0x5ff11a];return _0x43e45e;};'use strict';var Sequelize=require(_0xe2bc('0x0'));module[_0xe2bc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 50be816..e348b34 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 _0x0e4b=['./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','../../config/environment'];(function(_0x2110c2,_0x2db269){var _0x51f751=function(_0x395d32){while(--_0x395d32){_0x2110c2['push'](_0x2110c2['shift']());}};_0x51f751(++_0x2db269);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x270835,_0x5f0b18){_0x270835=_0x270835-0x0;var _0x268d4f=_0x0e4b[_0x270835];return _0x268d4f;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var logger=require(_0xb0e4('0x2'))('api');var moment=require(_0xb0e4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb0e4('0x4'));var attributes=require(_0xb0e4('0x5'));module['exports']=function(_0x45bdf2,_0x3b56c3){return _0x45bdf2[_0xb0e4('0x6')](_0xb0e4('0x7'),attributes,{'tableName':_0xb0e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9fb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','user_has_sms_queues','lodash','util','../../config/logger'];(function(_0x3fa479,_0x222259){var _0x23feb5=function(_0x115e68){while(--_0x115e68){_0x3fa479['push'](_0x3fa479['shift']());}};_0x23feb5(++_0x222259);}(_0xd9fb,0x189));var _0xbd9f=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xd9fb[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var logger=require(_0xbd9f('0x2'))(_0xbd9f('0x3'));var moment=require(_0xbd9f('0x4'));var BPromise=require(_0xbd9f('0x5'));var rp=require(_0xbd9f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0xbd9f('0x9')]=function(_0x5b6052,_0x2e7eea){return _0x5b6052[_0xbd9f('0xa')]('UserSmsQueue',attributes,{'tableName':_0xbd9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 0c8d2e5..45a0d00 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 _0x28ec=['code','UserSmsQueue,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x215fdd,_0x25b009){var _0x4efe47=function(_0x39c829){while(--_0x39c829){_0x215fdd['push'](_0x215fdd['shift']());}};_0x4efe47(++_0x25b009);}(_0x28ec,0x195));var _0xc28e=function(_0xda0b05,_0x166e3c){_0xda0b05=_0xda0b05-0x0;var _0x5a2701=_0x28ec[_0xda0b05];return _0x5a2701;};'use strict';var _=require('lodash');var util=require(_0xc28e('0x0'));var moment=require(_0xc28e('0x1'));var BPromise=require('bluebird');var rs=require(_0xc28e('0x2'));var fs=require('fs');var Redis=require(_0xc28e('0x3'));var db=require(_0xc28e('0x4'))['db'];var utils=require(_0xc28e('0x5'));var logger=require(_0xc28e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc28e('0x7'));var client=jayson[_0xc28e('0x8')][_0xc28e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bc197,_0xf254f,_0x5e7f9e){return new BPromise(function(_0x57107a,_0x90d76d){return client['request'](_0x2bc197,_0x5e7f9e)[_0xc28e('0xa')](function(_0xf5384a){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0xf254f,_0xc28e('0xb'));logger[_0xc28e('0xc')](_0xc28e('0xd'),_0xf254f,'request\x20sent',JSON['stringify'](_0xf5384a));if(_0xf5384a['error']){if(_0xf5384a[_0xc28e('0xe')][_0xc28e('0xf')]===0x1f4){logger[_0xc28e('0xe')](_0xc28e('0x10'),_0xf254f,_0xf5384a[_0xc28e('0xe')][_0xc28e('0x11')]);return _0x90d76d(_0xf5384a[_0xc28e('0xe')][_0xc28e('0x11')]);}logger[_0xc28e('0xe')](_0xc28e('0x10'),_0xf254f,_0xf5384a[_0xc28e('0xe')][_0xc28e('0x11')]);return _0x57107a(_0xf5384a[_0xc28e('0xe')]['message']);}else{logger[_0xc28e('0x12')](_0xc28e('0x10'),_0xf254f,_0xc28e('0xb'));_0x57107a(_0xf5384a[_0xc28e('0x13')][_0xc28e('0x11')]);}})[_0xc28e('0x14')](function(_0x25c8b1){logger[_0xc28e('0xe')](_0xc28e('0x10'),_0xf254f,_0x25c8b1);_0x90d76d(_0x25c8b1);});});} \ No newline at end of file +var _0x0021=['message','UserSmsQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x50d792,_0x4ffb16){var _0x2cebe2=function(_0x98f46f){while(--_0x98f46f){_0x50d792['push'](_0x50d792['shift']());}};_0x2cebe2(++_0x4ffb16);}(_0x0021,0x12a));var _0x1002=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x0021[_0x114b7c];return _0x47185f;};'use strict';var _=require(_0x1002('0x0'));var util=require(_0x1002('0x1'));var moment=require(_0x1002('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1002('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1002('0x4'));var logger=require(_0x1002('0x5'))(_0x1002('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1002('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x420abe,_0x386274,_0x3ee828){return new BPromise(function(_0x47b576,_0x408937){return client[_0x1002('0x8')](_0x420abe,_0x3ee828)[_0x1002('0x9')](function(_0x448dbd){logger[_0x1002('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x386274,_0x1002('0xb'));logger[_0x1002('0xc')](_0x1002('0xd'),_0x386274,_0x1002('0xb'),JSON[_0x1002('0xe')](_0x448dbd));if(_0x448dbd[_0x1002('0xf')]){if(_0x448dbd['error'][_0x1002('0x10')]===0x1f4){logger[_0x1002('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x386274,_0x448dbd['error'][_0x1002('0x11')]);return _0x408937(_0x448dbd[_0x1002('0xf')]['message']);}logger[_0x1002('0xf')](_0x1002('0x12'),_0x386274,_0x448dbd['error']['message']);return _0x47b576(_0x448dbd[_0x1002('0xf')][_0x1002('0x11')]);}else{logger[_0x1002('0xa')](_0x1002('0x12'),_0x386274,_0x1002('0xb'));_0x47b576(_0x448dbd[_0x1002('0x13')][_0x1002('0x11')]);}})[_0x1002('0x14')](function(_0x2b295c){logger[_0x1002('0xf')](_0x1002('0x12'),_0x386274,_0x2b295c);_0x408937(_0x2b295c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 9f70e8a..33bc923 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2a94c3,_0x1b9eb5){var _0x4c9f4b=function(_0x59b66a){while(--_0x59b66a){_0x2a94c3['push'](_0x2a94c3['shift']());}};_0x4c9f4b(++_0x1b9eb5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3cdaa6,_0x3b4222){var _0x8d6e42=function(_0x1b9403){while(--_0x1b9403){_0x3cdaa6['push'](_0x3cdaa6['shift']());}};_0x8d6e42(++_0x3b4222);}(_0x70e0,0x17b));var _0x070e=function(_0x395237,_0x1657fc){_0x395237=_0x395237-0x0;var _0x22949e=_0x70e0[_0x395237];return _0x22949e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ed6a2fa..9e62d16 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 _0x345e=['exports','INTEGER','sequelize'];(function(_0xa0be31,_0x45b568){var _0x3f5341=function(_0x497d41){while(--_0x497d41){_0xa0be31['push'](_0xa0be31['shift']());}};_0x3f5341(++_0x45b568);}(_0x345e,0x12e));var _0xe345=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x345e[_0x83420c];return _0x1057d7;};'use strict';var Sequelize=require(_0xe345('0x0'));module[_0xe345('0x1')]={'penalty':{'type':Sequelize[_0xe345('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3cdb=['INTEGER','sequelize'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x3cdb,0x17b));var _0xb3cd=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x3cdb[_0x246f0c];return _0x30fe50;};'use strict';var Sequelize=require(_0xb3cd('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb3cd('0x1')],'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 7c84acc..0322ef7 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 _0xd757=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api'];(function(_0x5bb920,_0x3a7a91){var _0xbc26f8=function(_0x577432){while(--_0x577432){_0x5bb920['push'](_0x5bb920['shift']());}};_0xbc26f8(++_0x3a7a91);}(_0xd757,0x1dd));var _0x7d75=function(_0x4192f3,_0x1cbdf2){_0x4192f3=_0x4192f3-0x0;var _0x34b879=_0xd757[_0x4192f3];return _0x34b879;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require('../../config/logger')(_0x7d75('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x3'));var fs=require('fs');var path=require(_0x7d75('0x4'));var rimraf=require(_0x7d75('0x5'));var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x13747e,_0x489922){return _0x13747e[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8de0=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','api','bluebird','request-promise'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x8de0,0x1e7));var _0x08de=function(_0x45baff,_0x25a99c){_0x45baff=_0x45baff-0x0;var _0x4086e1=_0x8de0[_0x45baff];return _0x4086e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x08de('0x0'));var moment=require('moment');var BPromise=require(_0x08de('0x1'));var rp=require(_0x08de('0x2'));var fs=require('fs');var path=require(_0x08de('0x3'));var rimraf=require(_0x08de('0x4'));var config=require(_0x08de('0x5'));var attributes=require(_0x08de('0x6'));module[_0x08de('0x7')]=function(_0x45640c,_0xe236a7){return _0x45640c[_0x08de('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x08de('0x9'),'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 6431f56..468fb14 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 _0x9aa6=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x6890ac,_0x1471fe){var _0xb737a5=function(_0x2ba9c6){while(--_0x2ba9c6){_0x6890ac['push'](_0x6890ac['shift']());}};_0xb737a5(++_0x1471fe);}(_0x9aa6,0xea));var _0x69aa=function(_0x41427e,_0x17c55a){_0x41427e=_0x41427e-0x0;var _0x107309=_0x9aa6[_0x41427e];return _0x107309;};'use strict';var _=require(_0x69aa('0x0'));var util=require(_0x69aa('0x1'));var moment=require(_0x69aa('0x2'));var BPromise=require(_0x69aa('0x3'));var rs=require(_0x69aa('0x4'));var fs=require('fs');var Redis=require(_0x69aa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69aa('0x6'));var logger=require('../../config/logger')(_0x69aa('0x7'));var config=require(_0x69aa('0x8'));var jayson=require(_0x69aa('0x9'));var client=jayson['client'][_0x69aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41b41,_0x23cfa4,_0x14a564){return new BPromise(function(_0x2ce490,_0x41ea5f){return client[_0x69aa('0xb')](_0x41b41,_0x14a564)[_0x69aa('0xc')](function(_0x275b82){logger[_0x69aa('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x23cfa4,_0x69aa('0xe'));logger[_0x69aa('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x23cfa4,_0x69aa('0xe'),JSON['stringify'](_0x275b82));if(_0x275b82[_0x69aa('0x10')]){if(_0x275b82[_0x69aa('0x10')][_0x69aa('0x11')]===0x1f4){logger[_0x69aa('0x10')](_0x69aa('0x12'),_0x23cfa4,_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);return _0x41ea5f(_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);}logger[_0x69aa('0x10')](_0x69aa('0x12'),_0x23cfa4,_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);return _0x2ce490(_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);}else{logger[_0x69aa('0xd')](_0x69aa('0x12'),_0x23cfa4,'request\x20sent');_0x2ce490(_0x275b82[_0x69aa('0x14')][_0x69aa('0x13')]);}})[_0x69aa('0x15')](function(_0x134d89){logger[_0x69aa('0x10')](_0x69aa('0x12'),_0x23cfa4,_0x134d89);_0x41ea5f(_0x134d89);});});} \ No newline at end of file +var _0x0c56=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x557b85,_0x343614){var _0x309831=function(_0x1e0144){while(--_0x1e0144){_0x557b85['push'](_0x557b85['shift']());}};_0x309831(++_0x343614);}(_0x0c56,0x116));var _0x60c5=function(_0x4ce14c,_0x12e04d){_0x4ce14c=_0x4ce14c-0x0;var _0x207844=_0x0c56[_0x4ce14c];return _0x207844;};'use strict';var _=require(_0x60c5('0x0'));var util=require(_0x60c5('0x1'));var moment=require(_0x60c5('0x2'));var BPromise=require(_0x60c5('0x3'));var rs=require(_0x60c5('0x4'));var fs=require('fs');var Redis=require(_0x60c5('0x5'));var db=require(_0x60c5('0x6'))['db'];var utils=require(_0x60c5('0x7'));var logger=require(_0x60c5('0x8'))(_0x60c5('0x9'));var config=require(_0x60c5('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x60c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e889d,_0xd5d21,_0x439fcd){return new BPromise(function(_0x4f4829,_0x563a79){return client[_0x60c5('0xc')](_0x3e889d,_0x439fcd)[_0x60c5('0xd')](function(_0x113728){logger['info'](_0x60c5('0xe'),_0xd5d21,'request\x20sent');logger['debug'](_0x60c5('0xf'),_0xd5d21,_0x60c5('0x10'),JSON[_0x60c5('0x11')](_0x113728));if(_0x113728[_0x60c5('0x12')]){if(_0x113728[_0x60c5('0x12')][_0x60c5('0x13')]===0x1f4){logger[_0x60c5('0x12')](_0x60c5('0xe'),_0xd5d21,_0x113728[_0x60c5('0x12')]['message']);return _0x563a79(_0x113728[_0x60c5('0x12')][_0x60c5('0x14')]);}logger[_0x60c5('0x12')](_0x60c5('0xe'),_0xd5d21,_0x113728[_0x60c5('0x12')]['message']);return _0x4f4829(_0x113728[_0x60c5('0x12')]['message']);}else{logger[_0x60c5('0x15')](_0x60c5('0xe'),_0xd5d21,_0x60c5('0x10'));_0x4f4829(_0x113728[_0x60c5('0x16')][_0x60c5('0x14')]);}})['catch'](function(_0x578e9f){logger[_0x60c5('0x12')](_0x60c5('0xe'),_0xd5d21,_0x578e9f);_0x563a79(_0x578e9f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 274e17e..afb9f64 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4495b6,_0x1660d5){var _0x2ff893=function(_0x381027){while(--_0x381027){_0x4495b6['push'](_0x4495b6['shift']());}};_0x2ff893(++_0x1660d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f4ee0,_0x2c0e48){var _0x1a246e=function(_0x41375c){while(--_0x41375c){_0x4f4ee0['push'](_0x4f4ee0['shift']());}};_0x1a246e(++_0x2c0e48);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 220e9ac..6463dd5 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 _0x3bdb=['INTEGER','STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x2e0c7f,_0x594ed8){var _0x49d09c=function(_0x5e840a){while(--_0x5e840a){_0x2e0c7f['push'](_0x2e0c7f['shift']());}};_0x49d09c(++_0x594ed8);}(_0x3bdb,0xf9));var _0xb3bd=function(_0x557517,_0x5cf701){_0x557517=_0x557517-0x0;var _0xbd8752=_0x3bdb[_0x557517];return _0xbd8752;};'use strict';var Sequelize=require(_0xb3bd('0x0'));module[_0xb3bd('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb3bd('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xb3bd('0x2')},'UserId':{'type':Sequelize[_0xb3bd('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb3bd('0x4')],'allowNull':![],'unique':_0xb3bd('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xb3bd('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xb3bd('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xb3bd('0x3')](0xb),'defaultValue':0x0,'comment':_0xb3bd('0x2')},'paused':{'type':Sequelize[_0xb3bd('0x3')](0xb),'defaultValue':0x0,'comment':_0xb3bd('0x2')}}; \ No newline at end of file +var _0xb4e9=['queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER','STRING'];(function(_0x46a5c0,_0x5cf02b){var _0x13cbcd=function(_0x28fe1a){while(--_0x28fe1a){_0x46a5c0['push'](_0x46a5c0['shift']());}};_0x13cbcd(++_0x5cf02b);}(_0xb4e9,0xda));var _0x9b4e=function(_0x34e4a0,_0x1fd446){_0x34e4a0=_0x34e4a0-0x0;var _0x3ead3e=_0xb4e9[_0x34e4a0];return _0x3ead3e;};'use strict';var Sequelize=require(_0x9b4e('0x0'));module[_0x9b4e('0x1')]={'uniqueid':{'type':Sequelize[_0x9b4e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x9b4e('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x9b4e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9b4e('0x3')],'allowNull':![],'unique':_0x9b4e('0x4'),'comment':_0x9b4e('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x9b4e('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x9b4e('0x5')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9b4e('0x5')},'paused':{'type':Sequelize[_0x9b4e('0x2')](0xb),'defaultValue':0x0,'comment':_0x9b4e('0x5')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 88aab30..1cc56c2 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 _0x5722=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x3b5c31,_0x2892a7){var _0x20a04b=function(_0x1dc22f){while(--_0x1dc22f){_0x3b5c31['push'](_0x3b5c31['shift']());}};_0x20a04b(++_0x2892a7);}(_0x5722,0x164));var _0x2572=function(_0x246925,_0x1c7496){_0x246925=_0x246925-0x0;var _0x2aea39=_0x5722[_0x246925];return _0x2aea39;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x2572('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2572('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2572('0x2'),'afterDestroy':_0x2572('0x3')};function emitEvent(_0x2a1580){return function(_0x233973,_0x530365,_0x5bc622){UserVoiceQueueRtEvents[_0x2572('0x4')](_0x2a1580+':'+_0x233973['id'],_0x233973);UserVoiceQueueRtEvents[_0x2572('0x4')](_0x2a1580,_0x233973);_0x5bc622(null);};}for(var e in events){if(events[_0x2572('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x2572('0x6')](e,emitEvent(event));}}module[_0x2572('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1985=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x1985,0x173));var _0x5198=function(_0x2d547f,_0x1bba9a){_0x2d547f=_0x2d547f-0x0;var _0xe08508=_0x1985[_0x2d547f];return _0xe08508;};'use strict';var EventEmitter=require(_0x5198('0x0'));var UserVoiceQueueRt=require(_0x5198('0x1'))['db'][_0x5198('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5198('0x3')](0x0);var events={'afterCreate':_0x5198('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x171fe1){return function(_0x2dbff4,_0x878c26,_0x46ecb4){UserVoiceQueueRtEvents['emit'](_0x171fe1+':'+_0x2dbff4['id'],_0x2dbff4);UserVoiceQueueRtEvents[_0x5198('0x5')](_0x171fe1,_0x2dbff4);_0x46ecb4(null);};}for(var e in events){if(events[_0x5198('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x5198('0x7')](e,emitEvent(event));}}module[_0x5198('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 d1ff639..08b090c 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 _0xc91c=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x52b8ad,_0x425b4b){var _0x4deb5a=function(_0x53f2bf){while(--_0x53f2bf){_0x52b8ad['push'](_0x52b8ad['shift']());}};_0x4deb5a(++_0x425b4b);}(_0xc91c,0x146));var _0xcc91=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xc91c[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xcc91('0x0'));var util=require(_0xcc91('0x1'));var logger=require('../../config/logger')(_0xcc91('0x2'));var moment=require(_0xcc91('0x3'));var BPromise=require(_0xcc91('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc91('0x5'));var rimraf=require(_0xcc91('0x6'));var config=require(_0xcc91('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xcc91('0x8')]=function(_0x3c7722,_0x28fa67){return _0x3c7722[_0xcc91('0x9')](_0xcc91('0xa'),attributes,{'tableName':_0xcc91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf001=['moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x3bce02,_0x210119){var _0x1e71d8=function(_0x15d3d7){while(--_0x15d3d7){_0x3bce02['push'](_0x3bce02['shift']());}};_0x1e71d8(++_0x210119);}(_0xf001,0x1e2));var _0x1f00=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0xf001[_0x572165];return _0x8c8709;};'use strict';var _=require(_0x1f00('0x0'));var util=require(_0x1f00('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1f00('0x2'));var BPromise=require(_0x1f00('0x3'));var rp=require(_0x1f00('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f00('0x5'));var config=require(_0x1f00('0x6'));var attributes=require(_0x1f00('0x7'));module[_0x1f00('0x8')]=function(_0x4a96d5,_0x4b8b0b){return _0x4a96d5['define'](_0x1f00('0x9'),attributes,{'tableName':_0x1f00('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 8da70e9..8577870 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 _0xa927=['literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0xa927,0x1d7));var _0x7a92=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa927[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7a92('0x0'));var util=require('util');var moment=require(_0x7a92('0x1'));var BPromise=require(_0x7a92('0x2'));var rs=require(_0x7a92('0x3'));var fs=require('fs');var Redis=require(_0x7a92('0x4'));var db=require(_0x7a92('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7a92('0x6'));var client=jayson[_0x7a92('0x7')]['http']({'port':0x232a});config['redis']=_[_0x7a92('0x8')](config[_0x7a92('0x9')],{'host':_0x7a92('0xa'),'port':0x18eb});var socket=require(_0x7a92('0xb'))(new Redis(config[_0x7a92('0x9')]));require(_0x7a92('0xc'))[_0x7a92('0xd')](socket);function respondWithRpcPromise(_0xa1d209,_0x21a37d,_0x4c03bb){return new BPromise(function(_0x449813,_0x3b8531){return client[_0x7a92('0xe')](_0xa1d209,_0x4c03bb)[_0x7a92('0xf')](function(_0x4caee3){logger['info'](_0x7a92('0x10'),_0x21a37d,'request\x20sent');logger[_0x7a92('0x11')](_0x7a92('0x12'),_0x21a37d,_0x7a92('0x13'),JSON[_0x7a92('0x14')](_0x4caee3));if(_0x4caee3[_0x7a92('0x15')]){if(_0x4caee3[_0x7a92('0x15')][_0x7a92('0x16')]===0x1f4){logger[_0x7a92('0x15')](_0x7a92('0x10'),_0x21a37d,_0x4caee3['error']['message']);return _0x3b8531(_0x4caee3[_0x7a92('0x15')][_0x7a92('0x17')]);}logger[_0x7a92('0x15')](_0x7a92('0x10'),_0x21a37d,_0x4caee3[_0x7a92('0x15')][_0x7a92('0x17')]);return _0x449813(_0x4caee3[_0x7a92('0x15')][_0x7a92('0x17')]);}else{logger[_0x7a92('0x18')](_0x7a92('0x10'),_0x21a37d,_0x7a92('0x13'));_0x449813(_0x4caee3[_0x7a92('0x19')][_0x7a92('0x17')]);}})[_0x7a92('0x1a')](function(_0x40ba0d){logger[_0x7a92('0x15')](_0x7a92('0x10'),_0x21a37d,_0x40ba0d);_0x3b8531(_0x40ba0d);});});}exports[_0x7a92('0x1b')]=function(_0x726b37){var _0x7901d7=this;return new Promise(function(_0x5c6469,_0x4ede86){return db['UserVoiceQueueRt'][_0x7a92('0x1c')]({'raw':_0x726b37['options']?_0x726b37[_0x7a92('0x1d')][_0x7a92('0x1e')]===undefined?!![]:![]:!![],'where':_0x726b37[_0x7a92('0x1d')]?_0x726b37[_0x7a92('0x1d')][_0x7a92('0x1f')]||null:null,'attributes':[[db[_0x7a92('0x20')]['fn']('COUNT',db[_0x7a92('0x20')]['fn']('IF',db['sequelize'][_0x7a92('0x21')](_0x7a92('0x22')))),_0x7a92('0x23')]]})['then'](function(_0x5bb34e){logger['info'](_0x7a92('0x1b'),_0x726b37);logger[_0x7a92('0x11')](_0x7a92('0x1b'),_0x726b37,JSON[_0x7a92('0x14')](_0x5bb34e));_0x5c6469(_0x5bb34e);})[_0x7a92('0x1a')](function(_0x388dc1){logger[_0x7a92('0x15')](_0x7a92('0x1b'),_0x388dc1[_0x7a92('0x17')],_0x726b37);_0x4ede86(_0x7901d7[_0x7a92('0x15')](0x1f4,_0x388dc1[_0x7a92('0x17')]));});});}; \ No newline at end of file +var _0xecc1=['GetVoiceQueueRtPauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xecc1,0x1c8));var _0x1ecc=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0xecc1[_0x7791d5];return _0x5ce288;};'use strict';var _=require(_0x1ecc('0x0'));var util=require(_0x1ecc('0x1'));var moment=require(_0x1ecc('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ecc('0x3'));var fs=require('fs');var Redis=require(_0x1ecc('0x4'));var db=require(_0x1ecc('0x5'))['db'];var utils=require(_0x1ecc('0x6'));var logger=require(_0x1ecc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ecc('0x8')][_0x1ecc('0x9')]({'port':0x232a});config[_0x1ecc('0xa')]=_['defaults'](config[_0x1ecc('0xa')],{'host':_0x1ecc('0xb'),'port':0x18eb});var socket=require(_0x1ecc('0xc'))(new Redis(config[_0x1ecc('0xa')]));require('./userVoiceQueueRt.socket')[_0x1ecc('0xd')](socket);function respondWithRpcPromise(_0x966c91,_0x2d8137,_0x530ab2){return new BPromise(function(_0x57c43e,_0x4da64c){return client[_0x1ecc('0xe')](_0x966c91,_0x530ab2)[_0x1ecc('0xf')](function(_0x3dc6ce){logger[_0x1ecc('0x10')](_0x1ecc('0x11'),_0x2d8137,'request\x20sent');logger[_0x1ecc('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2d8137,_0x1ecc('0x13'),JSON[_0x1ecc('0x14')](_0x3dc6ce));if(_0x3dc6ce[_0x1ecc('0x15')]){if(_0x3dc6ce[_0x1ecc('0x15')]['code']===0x1f4){logger['error'](_0x1ecc('0x11'),_0x2d8137,_0x3dc6ce[_0x1ecc('0x15')]['message']);return _0x4da64c(_0x3dc6ce[_0x1ecc('0x15')][_0x1ecc('0x16')]);}logger[_0x1ecc('0x15')](_0x1ecc('0x11'),_0x2d8137,_0x3dc6ce[_0x1ecc('0x15')][_0x1ecc('0x16')]);return _0x57c43e(_0x3dc6ce[_0x1ecc('0x15')][_0x1ecc('0x16')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d8137,'request\x20sent');_0x57c43e(_0x3dc6ce[_0x1ecc('0x17')][_0x1ecc('0x16')]);}})[_0x1ecc('0x18')](function(_0x5963e1){logger[_0x1ecc('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d8137,_0x5963e1);_0x4da64c(_0x5963e1);});});}exports['GetVoiceQueueRtPauses']=function(_0x1a184b){var _0x5500dc=this;return new Promise(function(_0x53dce7,_0x500a39){return db[_0x1ecc('0x19')][_0x1ecc('0x1a')]({'raw':_0x1a184b[_0x1ecc('0x1b')]?_0x1a184b['options'][_0x1ecc('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a184b[_0x1ecc('0x1b')]?_0x1a184b[_0x1ecc('0x1b')][_0x1ecc('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1ecc('0x1e')][_0x1ecc('0x1f')](_0x1ecc('0x20')))),_0x1ecc('0x21')]]})[_0x1ecc('0xf')](function(_0x460513){logger[_0x1ecc('0x10')](_0x1ecc('0x22'),_0x1a184b);logger['debug'](_0x1ecc('0x22'),_0x1a184b,JSON['stringify'](_0x460513));_0x53dce7(_0x460513);})[_0x1ecc('0x18')](function(_0x1a5531){logger[_0x1ecc('0x15')](_0x1ecc('0x22'),_0x1a5531[_0x1ecc('0x16')],_0x1a184b);_0x500a39(_0x5500dc[_0x1ecc('0x15')](0x1f4,_0x1a5531[_0x1ecc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 36bf885..60e3d3c 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 _0x5294=['./userVoiceQueueRt.events','save','remove','update','emit','register','userVoiceQueueRt:'];(function(_0x2d1784,_0x3a2c48){var _0x1b044a=function(_0x4b5f0a){while(--_0x4b5f0a){_0x2d1784['push'](_0x2d1784['shift']());}};_0x1b044a(++_0x3a2c48);}(_0x5294,0x111));var _0x4529=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5294[_0x5ddb1c];return _0x354adc;};'use strict';var UserVoiceQueueRtEvents=require(_0x4529('0x0'));var events=[_0x4529('0x1'),_0x4529('0x2'),_0x4529('0x3')];function createListener(_0x3966bb,_0xae7bd5){return function(_0x545d4a){_0xae7bd5[_0x4529('0x4')](_0x3966bb,_0x545d4a);};}function removeListener(_0x12d02e,_0xb3fbab){return function(){UserVoiceQueueRtEvents['removeListener'](_0x12d02e,_0xb3fbab);};}exports[_0x4529('0x5')]=function(_0x2c78e9){for(var _0x10192d=0x0,_0x38a095=events['length'];_0x10192d<_0x38a095;_0x10192d++){var _0xd3adaa=events[_0x10192d];var _0x3737de=createListener(_0x4529('0x6')+_0xd3adaa,_0x2c78e9);UserVoiceQueueRtEvents['on'](_0xd3adaa,_0x3737de);}}; \ No newline at end of file +var _0x5e17=['./userVoiceQueueRt.events','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x10d2cd,_0x48316f){var _0x59594f=function(_0xa9764){while(--_0xa9764){_0x10d2cd['push'](_0x10d2cd['shift']());}};_0x59594f(++_0x48316f);}(_0x5e17,0x17a));var _0x75e1=function(_0x3879fc,_0xdfdf87){_0x3879fc=_0x3879fc-0x0;var _0x278778=_0x5e17[_0x3879fc];return _0x278778;};'use strict';var UserVoiceQueueRtEvents=require(_0x75e1('0x0'));var events=['save','remove','update'];function createListener(_0x55bd67,_0x4c9724){return function(_0x43afe6){_0x4c9724[_0x75e1('0x1')](_0x55bd67,_0x43afe6);};}function removeListener(_0x23ec49,_0x1e8819){return function(){UserVoiceQueueRtEvents[_0x75e1('0x2')](_0x23ec49,_0x1e8819);};}exports[_0x75e1('0x3')]=function(_0x13f1ee){for(var _0x337459=0x0,_0xb1af59=events[_0x75e1('0x4')];_0x337459<_0xb1af59;_0x337459++){var _0x689ac3=events[_0x337459];var _0x1eecde=createListener(_0x75e1('0x5')+_0x689ac3,_0x13f1ee);UserVoiceQueueRtEvents['on'](_0x689ac3,_0x1eecde);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3acf7ea..4046b18 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3b0e74,_0x295ca1){var _0x2ebdc1=function(_0x4cd489){while(--_0x4cd489){_0x3b0e74['push'](_0x3b0e74['shift']());}};_0x2ebdc1(++_0x295ca1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 6712e0a..aa8e5a7 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 _0x2649=['exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2649,0x16a));var _0x9264=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x2649[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require('sequelize');module[_0x9264('0x0')]={'penalty':{'type':Sequelize[_0x9264('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5859=['INTEGER','sequelize','exports'];(function(_0x226e72,_0x339945){var _0x3e57d5=function(_0x39a2c4){while(--_0x39a2c4){_0x226e72['push'](_0x226e72['shift']());}};_0x3e57d5(++_0x339945);}(_0x5859,0xc4));var _0x9585=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x5859[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0x9585('0x0'));module[_0x9585('0x1')]={'penalty':{'type':Sequelize[_0x9585('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 831e2db..3758294 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 _0x7e6c=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x7e6c,0x116));var _0xc7e6=function(_0x1876c7,_0x379202){_0x1876c7=_0x1876c7-0x0;var _0x2b9572=_0x7e6c[_0x1876c7];return _0x2b9572;};'use strict';var _=require('lodash');var util=require(_0xc7e6('0x0'));var logger=require('../../config/logger')(_0xc7e6('0x1'));var moment=require(_0xc7e6('0x2'));var BPromise=require(_0xc7e6('0x3'));var rp=require(_0xc7e6('0x4'));var fs=require('fs');var path=require(_0xc7e6('0x5'));var rimraf=require(_0xc7e6('0x6'));var config=require(_0xc7e6('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xc7e6('0x8')]=function(_0x154a14,_0x4f8032){return _0x154a14[_0xc7e6('0x9')](_0xc7e6('0xa'),attributes,{'tableName':_0xc7e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0ed=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','lodash'];(function(_0x54802d,_0x5e0119){var _0xe9a00a=function(_0x5209c3){while(--_0x5209c3){_0x54802d['push'](_0x54802d['shift']());}};_0xe9a00a(++_0x5e0119);}(_0xf0ed,0x12b));var _0xdf0e=function(_0x1ca5a3,_0x40b024){_0x1ca5a3=_0x1ca5a3-0x0;var _0xc8acbf=_0xf0ed[_0x1ca5a3];return _0xc8acbf;};'use strict';var _=require(_0xdf0e('0x0'));var util=require('util');var logger=require(_0xdf0e('0x1'))(_0xdf0e('0x2'));var moment=require(_0xdf0e('0x3'));var BPromise=require(_0xdf0e('0x4'));var rp=require(_0xdf0e('0x5'));var fs=require('fs');var path=require(_0xdf0e('0x6'));var rimraf=require(_0xdf0e('0x7'));var config=require(_0xdf0e('0x8'));var attributes=require('./userWhatsappQueue.attributes');module[_0xdf0e('0x9')]=function(_0x32dabe,_0x4ee346){return _0x32dabe[_0xdf0e('0xa')](_0xdf0e('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','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 db12dc9..2cb98f7 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 _0x739d=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1db341,_0x4b939f){var _0x586b89=function(_0x271fba){while(--_0x271fba){_0x1db341['push'](_0x1db341['shift']());}};_0x586b89(++_0x4b939f);}(_0x739d,0x120));var _0xd739=function(_0x3c7f43,_0x538110){_0x3c7f43=_0x3c7f43-0x0;var _0x4e2e94=_0x739d[_0x3c7f43];return _0x4e2e94;};'use strict';var _=require(_0xd739('0x0'));var util=require(_0xd739('0x1'));var moment=require(_0xd739('0x2'));var BPromise=require(_0xd739('0x3'));var rs=require(_0xd739('0x4'));var fs=require('fs');var Redis=require(_0xd739('0x5'));var db=require(_0xd739('0x6'))['db'];var utils=require(_0xd739('0x7'));var logger=require(_0xd739('0x8'))(_0xd739('0x9'));var config=require(_0xd739('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33ae0d,_0xcb7049,_0x3cf59f){return new BPromise(function(_0x14a9d9,_0x3d2b08){return client[_0xd739('0xb')](_0x33ae0d,_0x3cf59f)[_0xd739('0xc')](function(_0x5c15eb){logger['info'](_0xd739('0xd'),_0xcb7049,_0xd739('0xe'));logger[_0xd739('0xf')](_0xd739('0x10'),_0xcb7049,_0xd739('0xe'),JSON['stringify'](_0x5c15eb));if(_0x5c15eb[_0xd739('0x11')]){if(_0x5c15eb['error']['code']===0x1f4){logger[_0xd739('0x11')](_0xd739('0xd'),_0xcb7049,_0x5c15eb[_0xd739('0x11')][_0xd739('0x12')]);return _0x3d2b08(_0x5c15eb['error'][_0xd739('0x12')]);}logger[_0xd739('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0xcb7049,_0x5c15eb[_0xd739('0x11')][_0xd739('0x12')]);return _0x14a9d9(_0x5c15eb[_0xd739('0x11')][_0xd739('0x12')]);}else{logger['info'](_0xd739('0xd'),_0xcb7049,_0xd739('0xe'));_0x14a9d9(_0x5c15eb['result'][_0xd739('0x12')]);}})['catch'](function(_0x199e7f){logger['error'](_0xd739('0xd'),_0xcb7049,_0x199e7f);_0x3d2b08(_0x199e7f);});});} \ No newline at end of file +var _0x424f=['client','http','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b866a,_0x5bbbe1){var _0x6cde9=function(_0x15fe86){while(--_0x15fe86){_0x2b866a['push'](_0x2b866a['shift']());}};_0x6cde9(++_0x5bbbe1);}(_0x424f,0x1d4));var _0xf424=function(_0x541882,_0x1c3153){_0x541882=_0x541882-0x0;var _0x5596ba=_0x424f[_0x541882];return _0x5596ba;};'use strict';var _=require(_0xf424('0x0'));var util=require(_0xf424('0x1'));var moment=require(_0xf424('0x2'));var BPromise=require(_0xf424('0x3'));var rs=require(_0xf424('0x4'));var fs=require('fs');var Redis=require(_0xf424('0x5'));var db=require(_0xf424('0x6'))['db'];var utils=require(_0xf424('0x7'));var logger=require(_0xf424('0x8'))(_0xf424('0x9'));var config=require(_0xf424('0xa'));var jayson=require(_0xf424('0xb'));var client=jayson[_0xf424('0xc')][_0xf424('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x84a962,_0x163eae,_0x466ca1){return new BPromise(function(_0x109c7e,_0x4ce6b1){return client[_0xf424('0xe')](_0x84a962,_0x466ca1)['then'](function(_0x18d906){logger['info'](_0xf424('0xf'),_0x163eae,_0xf424('0x10'));logger['debug'](_0xf424('0x11'),_0x163eae,'request\x20sent',JSON['stringify'](_0x18d906));if(_0x18d906[_0xf424('0x12')]){if(_0x18d906['error'][_0xf424('0x13')]===0x1f4){logger[_0xf424('0x12')](_0xf424('0xf'),_0x163eae,_0x18d906[_0xf424('0x12')][_0xf424('0x14')]);return _0x4ce6b1(_0x18d906[_0xf424('0x12')][_0xf424('0x14')]);}logger[_0xf424('0x12')](_0xf424('0xf'),_0x163eae,_0x18d906[_0xf424('0x12')][_0xf424('0x14')]);return _0x109c7e(_0x18d906[_0xf424('0x12')]['message']);}else{logger[_0xf424('0x15')](_0xf424('0xf'),_0x163eae,_0xf424('0x10'));_0x109c7e(_0x18d906[_0xf424('0x16')][_0xf424('0x14')]);}})[_0xf424('0x17')](function(_0x4f4cb6){logger[_0xf424('0x12')](_0xf424('0xf'),_0x163eae,_0x4f4cb6);_0x4ce6b1(_0x4f4cb6);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 8ca05b1..8e2d4b5 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 _0x48d0=['../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x22a4b5,_0xea5c2e){var _0x11f6e6=function(_0x4d30aa){while(--_0x4d30aa){_0x22a4b5['push'](_0x22a4b5['shift']());}};_0x11f6e6(++_0xea5c2e);}(_0x48d0,0xd3));var _0x048d=function(_0x136f96,_0x2d8f6a){_0x136f96=_0x136f96-0x0;var _0x5a30d5=_0x48d0[_0x136f96];return _0x5a30d5;};'use strict';var multer=require(_0x048d('0x0'));var util=require(_0x048d('0x1'));var path=require('path');var timeout=require(_0x048d('0x2'));var express=require(_0x048d('0x3'));var router=express[_0x048d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x048d('0x5'));var interaction=require(_0x048d('0x6'));var config=require('../../config/environment');var controller=require(_0x048d('0x7'));router[_0x048d('0x8')]('/',auth[_0x048d('0x9')](),controller['index']);router[_0x048d('0x8')](_0x048d('0xa'),auth['isAuthenticated'](),controller[_0x048d('0xb')]);router[_0x048d('0xc')]('/',auth[_0x048d('0x9')](),controller[_0x048d('0xd')]);router[_0x048d('0xe')](_0x048d('0xa'),auth[_0x048d('0x9')](),controller[_0x048d('0xf')]);router[_0x048d('0x10')](_0x048d('0xa'),auth[_0x048d('0x9')](),controller[_0x048d('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfd28=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','show','post','put','delete','exports','util','path'];(function(_0x18b68a,_0x3ba249){var _0x59f1e4=function(_0x35c3f5){while(--_0x35c3f5){_0x18b68a['push'](_0x18b68a['shift']());}};_0x59f1e4(++_0x3ba249);}(_0xfd28,0x148));var _0x8fd2=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0xfd28[_0x487496];return _0x539dc8;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0xb')]('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xc')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['destroy']);module[_0x8fd2('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index c1c6466..a918edc 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 _0x4d85=['sequelize','STRING','name'];(function(_0x322e45,_0x5c01c4){var _0x39ffd7=function(_0x53df5c){while(--_0x53df5c){_0x322e45['push'](_0x322e45['shift']());}};_0x39ffd7(++_0x5c01c4);}(_0x4d85,0x99));var _0x54d8=function(_0x49deb7,_0x1c43f4){_0x49deb7=_0x49deb7-0x0;var _0x2c2aa6=_0x4d85[_0x49deb7];return _0x2c2aa6;};'use strict';var Sequelize=require(_0x54d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x54d8('0x1')],'unique':_0x54d8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x54d8('0x1')]}}; \ No newline at end of file +var _0x3ed8=['exports','name','STRING','sequelize'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x3ed8,0x1e3));var _0x83ed=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x3ed8[_0x510b98];return _0x45e775;};'use strict';var Sequelize=require(_0x83ed('0x0'));module[_0x83ed('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x83ed('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x83ed('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index e4f0393..f274ec6 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 _0xcd17=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','get','Variables','UserProfileResource','name','Variable','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x1deefa,_0x862114){var _0x4fbdb6=function(_0x1f6ef5){while(--_0x1f6ef5){_0x1deefa['push'](_0x1deefa['shift']());}};_0x4fbdb6(++_0x862114);}(_0xcd17,0x96));var _0x7cd1=function(_0x2bf36e,_0x137e92){_0x2bf36e=_0x2bf36e-0x0;var _0x12352d=_0xcd17[_0x2bf36e];return _0x12352d;};'use strict';var emlformat=require(_0x7cd1('0x0'));var rimraf=require(_0x7cd1('0x1'));var zipdir=require(_0x7cd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cd1('0x3'));var moment=require('moment');var BPromise=require(_0x7cd1('0x4'));var Mustache=require(_0x7cd1('0x5'));var util=require(_0x7cd1('0x6'));var path=require(_0x7cd1('0x7'));var sox=require('sox');var csv=require(_0x7cd1('0x8'));var ejs=require(_0x7cd1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cd1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7cd1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7cd1('0xc'));var Papa=require(_0x7cd1('0xd'));var Redis=require(_0x7cd1('0xe'));var authService=require(_0x7cd1('0xf'));var qs=require(_0x7cd1('0x10'));var as=require(_0x7cd1('0x11'));var hardwareService=require(_0x7cd1('0x12'));var logger=require(_0x7cd1('0x13'))(_0x7cd1('0x14'));var utils=require(_0x7cd1('0x15'));var config=require(_0x7cd1('0x16'));var licenseUtil=require(_0x7cd1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554fdf,_0x22c074){_0x22c074=_0x22c074||0xcc;return function(_0x3e84fd){if(_0x3e84fd){return _0x554fdf[_0x7cd1('0x18')](_0x22c074);}return _0x554fdf[_0x7cd1('0x19')](_0x22c074)[_0x7cd1('0x1a')]();};}function respondWithResult(_0x131bf9,_0x513c9d){_0x513c9d=_0x513c9d||0xc8;return function(_0x3af87f){if(_0x3af87f){return _0x131bf9[_0x7cd1('0x19')](_0x513c9d)[_0x7cd1('0x1b')](_0x3af87f);}};}function respondWithFilteredResult(_0x2cddb4,_0x3cc4a5){return function(_0x41ce50){if(_0x41ce50){var _0x48c542=typeof _0x3cc4a5[_0x7cd1('0x1c')]===_0x7cd1('0x1d')&&typeof _0x3cc4a5[_0x7cd1('0x1e')]===_0x7cd1('0x1d');var _0x4329b8=_0x41ce50[_0x7cd1('0x1f')];var _0x5477ac=_0x48c542?0x0:_0x3cc4a5['offset'];var _0x252b17=_0x48c542?_0x41ce50[_0x7cd1('0x1f')]:_0x3cc4a5[_0x7cd1('0x1c')]+_0x3cc4a5[_0x7cd1('0x1e')];var _0x2e00eb;if(_0x252b17>=_0x4329b8){_0x252b17=_0x4329b8;_0x2e00eb=0xc8;}else{_0x2e00eb=0xce;}_0x2cddb4['status'](_0x2e00eb);return _0x2cddb4[_0x7cd1('0x20')](_0x7cd1('0x21'),_0x5477ac+'-'+_0x252b17+'/'+_0x4329b8)[_0x7cd1('0x1b')](_0x41ce50);}return null;};}function patchUpdates(_0x38c093){return function(_0x24568b){try{jsonpatch[_0x7cd1('0x22')](_0x24568b,_0x38c093,!![]);}catch(_0x60bb54){return BPromise['reject'](_0x60bb54);}return _0x24568b[_0x7cd1('0x23')]();};}function saveUpdates(_0x1811b6,_0x29132c){return function(_0x535129){if(_0x535129){return _0x535129['update'](_0x1811b6)['then'](function(_0x52efed){return _0x52efed;});}return null;};}function removeEntity(_0x1c3c66,_0x13f3cf){return function(_0x316d68){if(_0x316d68){return _0x316d68[_0x7cd1('0x24')]()[_0x7cd1('0x25')](function(){var _0x5e28d6=_0x316d68[_0x7cd1('0x26')]({'plain':!![]});var _0x3f2596=_0x7cd1('0x27');return db[_0x7cd1('0x28')][_0x7cd1('0x24')]({'where':{'type':_0x3f2596,'resourceId':_0x5e28d6['id']}})[_0x7cd1('0x25')](function(){return _0x316d68;});})[_0x7cd1('0x25')](function(){_0x1c3c66['status'](0xcc)[_0x7cd1('0x1a')]();});}};}function handleEntityNotFound(_0x5e7a43,_0x5f3cd5){return function(_0x5c0acf){if(!_0x5c0acf){_0x5e7a43['sendStatus'](0x194);}return _0x5c0acf;};}function handleError(_0x1c7dbe,_0x3648b8){_0x3648b8=_0x3648b8||0x1f4;return function(_0x4b2735){logger['error'](_0x4b2735['stack']);if(_0x4b2735['name']){delete _0x4b2735[_0x7cd1('0x29')];}_0x1c7dbe[_0x7cd1('0x19')](_0x3648b8)['send'](_0x4b2735);};}exports['index']=function(_0x35986b,_0x5388a9){var _0x46e19a={},_0x94a4ff={},_0x32aab0={'count':0x0,'rows':[]};var _0x4d5e91=_['map'](db[_0x7cd1('0x2a')][_0x7cd1('0x2b')],function(_0x59e254){return{'name':_0x59e254['fieldName'],'type':_0x59e254[_0x7cd1('0x2c')][_0x7cd1('0x2d')]};});_0x94a4ff[_0x7cd1('0x2e')]=_[_0x7cd1('0x2f')](_0x4d5e91,_0x7cd1('0x29'));_0x94a4ff['query']=_[_0x7cd1('0x30')](_0x35986b[_0x7cd1('0x31')]);_0x94a4ff[_0x7cd1('0x32')]=_[_0x7cd1('0x33')](_0x94a4ff['model'],_0x94a4ff['query']);_0x46e19a[_0x7cd1('0x34')]=_[_0x7cd1('0x33')](_0x94a4ff[_0x7cd1('0x2e')],qs[_0x7cd1('0x35')](_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x35')]));_0x46e19a[_0x7cd1('0x34')]=_0x46e19a[_0x7cd1('0x34')][_0x7cd1('0x36')]?_0x46e19a[_0x7cd1('0x34')]:_0x94a4ff['model'];if(!_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x37')](_0x7cd1('0x38'))){_0x46e19a['limit']=qs['limit'](_0x35986b['query'][_0x7cd1('0x1e')]);_0x46e19a[_0x7cd1('0x1c')]=qs[_0x7cd1('0x1c')](_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x1c')]);}_0x46e19a[_0x7cd1('0x39')]=qs[_0x7cd1('0x3a')](_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x3a')]);_0x46e19a[_0x7cd1('0x3b')]=qs['filters'](_['pick'](_0x35986b['query'],_0x94a4ff['filters']),_0x4d5e91);if(_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x3c')]){_0x46e19a[_0x7cd1('0x3b')]=_[_0x7cd1('0x3d')](_0x46e19a['where'],{'$or':_[_0x7cd1('0x2f')](_0x4d5e91,function(_0x5b0874){if(_0x5b0874[_0x7cd1('0x2c')]!==_0x7cd1('0x3e')){var _0xbc2320={};_0xbc2320[_0x5b0874['name']]={'$like':'%'+_0x35986b[_0x7cd1('0x31')]['filter']+'%'};return _0xbc2320;}})});}_0x46e19a=_[_0x7cd1('0x3d')]({},_0x46e19a,_0x35986b[_0x7cd1('0x3f')]);var _0xa5df2c={'where':_0x46e19a[_0x7cd1('0x3b')]};return db[_0x7cd1('0x2a')][_0x7cd1('0x1f')](_0xa5df2c)[_0x7cd1('0x25')](function(_0x48c4ae){_0x32aab0['count']=_0x48c4ae;if(_0x35986b['query'][_0x7cd1('0x40')]){_0x46e19a[_0x7cd1('0x41')]=[{'all':!![]}];}return db[_0x7cd1('0x2a')][_0x7cd1('0x42')](_0x46e19a);})[_0x7cd1('0x25')](function(_0x5e60f9){_0x32aab0[_0x7cd1('0x43')]=_0x5e60f9;return _0x32aab0;})[_0x7cd1('0x25')](respondWithFilteredResult(_0x5388a9,_0x46e19a))['catch'](handleError(_0x5388a9,null));};exports[_0x7cd1('0x44')]=function(_0x51c966,_0x6076c3){var _0x4b8a70={'raw':!![],'where':{'id':_0x51c966[_0x7cd1('0x45')]['id']}},_0x44eee4={};_0x44eee4[_0x7cd1('0x2e')]=_[_0x7cd1('0x30')](db[_0x7cd1('0x2a')][_0x7cd1('0x2b')]);_0x44eee4['query']=_[_0x7cd1('0x30')](_0x51c966['query']);_0x44eee4[_0x7cd1('0x32')]=_[_0x7cd1('0x33')](_0x44eee4['model'],_0x44eee4[_0x7cd1('0x31')]);_0x4b8a70[_0x7cd1('0x34')]=_[_0x7cd1('0x33')](_0x44eee4[_0x7cd1('0x2e')],qs['fields'](_0x51c966[_0x7cd1('0x31')][_0x7cd1('0x35')]));_0x4b8a70[_0x7cd1('0x34')]=_0x4b8a70[_0x7cd1('0x34')][_0x7cd1('0x36')]?_0x4b8a70[_0x7cd1('0x34')]:_0x44eee4[_0x7cd1('0x2e')];if(_0x51c966[_0x7cd1('0x31')][_0x7cd1('0x40')]){_0x4b8a70[_0x7cd1('0x41')]=[{'all':!![]}];}_0x4b8a70=_[_0x7cd1('0x3d')]({},_0x4b8a70,_0x51c966[_0x7cd1('0x3f')]);return db[_0x7cd1('0x2a')]['find'](_0x4b8a70)[_0x7cd1('0x25')](handleEntityNotFound(_0x6076c3,null))[_0x7cd1('0x25')](respondWithResult(_0x6076c3,null))[_0x7cd1('0x46')](handleError(_0x6076c3,null));};exports[_0x7cd1('0x47')]=function(_0x1798c8,_0x4f05cb){return db[_0x7cd1('0x2a')][_0x7cd1('0x47')](_0x1798c8[_0x7cd1('0x48')],{})['then'](function(_0x5986d4){var _0x445ed5=_0x1798c8[_0x7cd1('0x49')]['get']({'plain':!![]});if(!_0x445ed5)throw new Error(_0x7cd1('0x4a'));if(_0x445ed5[_0x7cd1('0x4b')]===_0x7cd1('0x49')){var _0x18aeef=_0x5986d4['get']({'plain':!![]});var _0x271903=_0x7cd1('0x27');return db[_0x7cd1('0x4c')]['find']({'where':{'name':_0x271903,'userProfileId':_0x445ed5['userProfileId']},'raw':!![]})[_0x7cd1('0x25')](function(_0x1c8b4c){if(_0x1c8b4c&&_0x1c8b4c['autoAssociation']===0x0){return db[_0x7cd1('0x28')]['create']({'name':_0x18aeef[_0x7cd1('0x29')],'resourceId':_0x18aeef['id'],'type':_0x1c8b4c['name'],'sectionId':_0x1c8b4c['id']},{})[_0x7cd1('0x25')](function(){return _0x5986d4;});}else{return _0x5986d4;}})[_0x7cd1('0x46')](function(_0x2f340e){logger['error'](_0x7cd1('0x4d'),_0x2f340e);throw _0x2f340e;});}return _0x5986d4;})['then'](respondWithResult(_0x4f05cb,0xc9))[_0x7cd1('0x46')](handleError(_0x4f05cb,null));};exports[_0x7cd1('0x4e')]=function(_0x45327b,_0x52b7eb){if(_0x45327b[_0x7cd1('0x48')]['id']){delete _0x45327b[_0x7cd1('0x48')]['id'];}return db[_0x7cd1('0x2a')][_0x7cd1('0x4f')]({'where':{'id':_0x45327b['params']['id']}})[_0x7cd1('0x25')](handleEntityNotFound(_0x52b7eb,null))[_0x7cd1('0x25')](saveUpdates(_0x45327b[_0x7cd1('0x48')],null))[_0x7cd1('0x25')](respondWithResult(_0x52b7eb,null))[_0x7cd1('0x46')](handleError(_0x52b7eb,null));};exports[_0x7cd1('0x24')]=function(_0x2023a8,_0x39360b){return db['Variable']['find']({'where':{'id':_0x2023a8[_0x7cd1('0x45')]['id']}})['then'](handleEntityNotFound(_0x39360b,null))[_0x7cd1('0x25')](removeEntity(_0x39360b,null))[_0x7cd1('0x46')](handleError(_0x39360b,null));}; \ No newline at end of file +var _0x9872=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','Variable','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','params','length','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x443bc8,_0x5d5853){var _0x3db156=function(_0x58beac){while(--_0x58beac){_0x443bc8['push'](_0x443bc8['shift']());}};_0x3db156(++_0x5d5853);}(_0x9872,0x18c));var _0x2987=function(_0x379658,_0x4c5ec5){_0x379658=_0x379658-0x0;var _0x5c7372=_0x9872[_0x379658];return _0x5c7372;};'use strict';var emlformat=require(_0x2987('0x0'));var rimraf=require(_0x2987('0x1'));var zipdir=require(_0x2987('0x2'));var jsonpatch=require(_0x2987('0x3'));var rp=require(_0x2987('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2987('0x5'));var util=require(_0x2987('0x6'));var path=require(_0x2987('0x7'));var sox=require(_0x2987('0x8'));var csv=require(_0x2987('0x9'));var ejs=require(_0x2987('0xa'));var fs=require('fs');var fs_extra=require(_0x2987('0xb'));var _=require(_0x2987('0xc'));var squel=require(_0x2987('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2987('0xe'));var toCsv=require(_0x2987('0x9'));var querystring=require(_0x2987('0xf'));var Papa=require(_0x2987('0x10'));var Redis=require('ioredis');var authService=require(_0x2987('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2987('0x12'));var hardwareService=require(_0x2987('0x13'));var logger=require(_0x2987('0x14'))('api');var utils=require(_0x2987('0x15'));var config=require(_0x2987('0x16'));var licenseUtil=require(_0x2987('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f5c00,_0x26b635){_0x26b635=_0x26b635||0xcc;return function(_0x5e5757){if(_0x5e5757){return _0x1f5c00['sendStatus'](_0x26b635);}return _0x1f5c00[_0x2987('0x18')](_0x26b635)[_0x2987('0x19')]();};}function respondWithResult(_0x873993,_0x15249f){_0x15249f=_0x15249f||0xc8;return function(_0x557525){if(_0x557525){return _0x873993['status'](_0x15249f)['json'](_0x557525);}};}function respondWithFilteredResult(_0x55cc30,_0x52a2c8){return function(_0x198e89){if(_0x198e89){var _0x59d949=typeof _0x52a2c8[_0x2987('0x1a')]===_0x2987('0x1b')&&typeof _0x52a2c8[_0x2987('0x1c')]===_0x2987('0x1b');var _0x2d6454=_0x198e89[_0x2987('0x1d')];var _0x498e24=_0x59d949?0x0:_0x52a2c8[_0x2987('0x1a')];var _0x79104d=_0x59d949?_0x198e89[_0x2987('0x1d')]:_0x52a2c8[_0x2987('0x1a')]+_0x52a2c8['limit'];var _0x56bf43;if(_0x79104d>=_0x2d6454){_0x79104d=_0x2d6454;_0x56bf43=0xc8;}else{_0x56bf43=0xce;}_0x55cc30[_0x2987('0x18')](_0x56bf43);return _0x55cc30[_0x2987('0x1e')](_0x2987('0x1f'),_0x498e24+'-'+_0x79104d+'/'+_0x2d6454)[_0x2987('0x20')](_0x198e89);}return null;};}function patchUpdates(_0x15877d){return function(_0x208ba5){try{jsonpatch[_0x2987('0x21')](_0x208ba5,_0x15877d,!![]);}catch(_0x2310f5){return BPromise[_0x2987('0x22')](_0x2310f5);}return _0x208ba5[_0x2987('0x23')]();};}function saveUpdates(_0x614ebf,_0x3fca67){return function(_0x23d022){if(_0x23d022){return _0x23d022[_0x2987('0x24')](_0x614ebf)['then'](function(_0x1d84e6){return _0x1d84e6;});}return null;};}function removeEntity(_0x4207f4,_0x4b63ba){return function(_0x4e2133){if(_0x4e2133){return _0x4e2133[_0x2987('0x25')]()[_0x2987('0x26')](function(){var _0x4134fe=_0x4e2133[_0x2987('0x27')]({'plain':!![]});var _0xb57a1='Variables';return db[_0x2987('0x28')][_0x2987('0x25')]({'where':{'type':_0xb57a1,'resourceId':_0x4134fe['id']}})['then'](function(){return _0x4e2133;});})[_0x2987('0x26')](function(){_0x4207f4[_0x2987('0x18')](0xcc)[_0x2987('0x19')]();});}};}function handleEntityNotFound(_0x27bcfc,_0x1dc617){return function(_0x3d4fe0){if(!_0x3d4fe0){_0x27bcfc['sendStatus'](0x194);}return _0x3d4fe0;};}function handleError(_0x5bc094,_0x46950f){_0x46950f=_0x46950f||0x1f4;return function(_0x3f7e97){logger[_0x2987('0x29')](_0x3f7e97['stack']);if(_0x3f7e97[_0x2987('0x2a')]){delete _0x3f7e97[_0x2987('0x2a')];}_0x5bc094[_0x2987('0x18')](_0x46950f)[_0x2987('0x2b')](_0x3f7e97);};}exports['index']=function(_0x2d4e46,_0x5cf13d){var _0x23af6f={},_0x2a9f82={},_0x30b749={'count':0x0,'rows':[]};var _0x34402c=_['map'](db[_0x2987('0x2c')][_0x2987('0x2d')],function(_0x5affec){return{'name':_0x5affec[_0x2987('0x2e')],'type':_0x5affec['type'][_0x2987('0x2f')]};});_0x2a9f82['model']=_[_0x2987('0x30')](_0x34402c,_0x2987('0x2a'));_0x2a9f82[_0x2987('0x31')]=_[_0x2987('0x32')](_0x2d4e46[_0x2987('0x31')]);_0x2a9f82[_0x2987('0x33')]=_[_0x2987('0x34')](_0x2a9f82[_0x2987('0x35')],_0x2a9f82[_0x2987('0x31')]);_0x23af6f[_0x2987('0x36')]=_[_0x2987('0x34')](_0x2a9f82['model'],qs[_0x2987('0x37')](_0x2d4e46[_0x2987('0x31')]['fields']));_0x23af6f[_0x2987('0x36')]=_0x23af6f[_0x2987('0x36')]['length']?_0x23af6f['attributes']:_0x2a9f82[_0x2987('0x35')];if(!_0x2d4e46[_0x2987('0x31')]['hasOwnProperty'](_0x2987('0x38'))){_0x23af6f[_0x2987('0x1c')]=qs[_0x2987('0x1c')](_0x2d4e46[_0x2987('0x31')][_0x2987('0x1c')]);_0x23af6f['offset']=qs['offset'](_0x2d4e46[_0x2987('0x31')]['offset']);}_0x23af6f['order']=qs['sort'](_0x2d4e46[_0x2987('0x31')]['sort']);_0x23af6f[_0x2987('0x39')]=qs[_0x2987('0x33')](_[_0x2987('0x3a')](_0x2d4e46[_0x2987('0x31')],_0x2a9f82[_0x2987('0x33')]),_0x34402c);if(_0x2d4e46[_0x2987('0x31')][_0x2987('0x3b')]){_0x23af6f[_0x2987('0x39')]=_[_0x2987('0x3c')](_0x23af6f[_0x2987('0x39')],{'$or':_[_0x2987('0x30')](_0x34402c,function(_0x27aee3){if(_0x27aee3[_0x2987('0x3d')]!==_0x2987('0x3e')){var _0x1b0beb={};_0x1b0beb[_0x27aee3[_0x2987('0x2a')]]={'$like':'%'+_0x2d4e46['query']['filter']+'%'};return _0x1b0beb;}})});}_0x23af6f=_[_0x2987('0x3c')]({},_0x23af6f,_0x2d4e46[_0x2987('0x3f')]);var _0x18dfa2={'where':_0x23af6f[_0x2987('0x39')]};return db['Variable'][_0x2987('0x1d')](_0x18dfa2)['then'](function(_0x27fd80){_0x30b749[_0x2987('0x1d')]=_0x27fd80;if(_0x2d4e46[_0x2987('0x31')]['includeAll']){_0x23af6f['include']=[{'all':!![]}];}return db[_0x2987('0x2c')][_0x2987('0x40')](_0x23af6f);})[_0x2987('0x26')](function(_0x2567fa){_0x30b749[_0x2987('0x41')]=_0x2567fa;return _0x30b749;})[_0x2987('0x26')](respondWithFilteredResult(_0x5cf13d,_0x23af6f))['catch'](handleError(_0x5cf13d,null));};exports['show']=function(_0x4bc511,_0x977f82){var _0x15bfd7={'raw':!![],'where':{'id':_0x4bc511[_0x2987('0x42')]['id']}},_0x3f48c8={};_0x3f48c8[_0x2987('0x35')]=_[_0x2987('0x32')](db[_0x2987('0x2c')][_0x2987('0x2d')]);_0x3f48c8[_0x2987('0x31')]=_[_0x2987('0x32')](_0x4bc511[_0x2987('0x31')]);_0x3f48c8[_0x2987('0x33')]=_['intersection'](_0x3f48c8[_0x2987('0x35')],_0x3f48c8[_0x2987('0x31')]);_0x15bfd7[_0x2987('0x36')]=_[_0x2987('0x34')](_0x3f48c8[_0x2987('0x35')],qs[_0x2987('0x37')](_0x4bc511[_0x2987('0x31')][_0x2987('0x37')]));_0x15bfd7[_0x2987('0x36')]=_0x15bfd7[_0x2987('0x36')][_0x2987('0x43')]?_0x15bfd7[_0x2987('0x36')]:_0x3f48c8[_0x2987('0x35')];if(_0x4bc511[_0x2987('0x31')][_0x2987('0x44')]){_0x15bfd7[_0x2987('0x45')]=[{'all':!![]}];}_0x15bfd7=_[_0x2987('0x3c')]({},_0x15bfd7,_0x4bc511[_0x2987('0x3f')]);return db[_0x2987('0x2c')][_0x2987('0x46')](_0x15bfd7)[_0x2987('0x26')](handleEntityNotFound(_0x977f82,null))[_0x2987('0x26')](respondWithResult(_0x977f82,null))[_0x2987('0x47')](handleError(_0x977f82,null));};exports[_0x2987('0x48')]=function(_0x4d48aa,_0xf4b693){return db[_0x2987('0x2c')][_0x2987('0x48')](_0x4d48aa[_0x2987('0x49')],{})[_0x2987('0x26')](function(_0x3fdee6){var _0x191e60=_0x4d48aa[_0x2987('0x4a')][_0x2987('0x27')]({'plain':!![]});if(!_0x191e60)throw new Error(_0x2987('0x4b'));if(_0x191e60[_0x2987('0x4c')]==='user'){var _0x63a065=_0x3fdee6[_0x2987('0x27')]({'plain':!![]});var _0x4cd72c=_0x2987('0x4d');return db[_0x2987('0x4e')][_0x2987('0x46')]({'where':{'name':_0x4cd72c,'userProfileId':_0x191e60[_0x2987('0x4f')]},'raw':!![]})['then'](function(_0x4f8345){if(_0x4f8345&&_0x4f8345[_0x2987('0x50')]===0x0){return db[_0x2987('0x28')]['create']({'name':_0x63a065[_0x2987('0x2a')],'resourceId':_0x63a065['id'],'type':_0x4f8345[_0x2987('0x2a')],'sectionId':_0x4f8345['id']},{})[_0x2987('0x26')](function(){return _0x3fdee6;});}else{return _0x3fdee6;}})[_0x2987('0x47')](function(_0x5e4295){logger[_0x2987('0x29')](_0x2987('0x51'),_0x5e4295);throw _0x5e4295;});}return _0x3fdee6;})[_0x2987('0x26')](respondWithResult(_0xf4b693,0xc9))[_0x2987('0x47')](handleError(_0xf4b693,null));};exports[_0x2987('0x24')]=function(_0x528013,_0x2e0aeb){if(_0x528013['body']['id']){delete _0x528013[_0x2987('0x49')]['id'];}return db['Variable']['find']({'where':{'id':_0x528013[_0x2987('0x42')]['id']}})[_0x2987('0x26')](handleEntityNotFound(_0x2e0aeb,null))['then'](saveUpdates(_0x528013[_0x2987('0x49')],null))[_0x2987('0x26')](respondWithResult(_0x2e0aeb,null))[_0x2987('0x47')](handleError(_0x2e0aeb,null));};exports[_0x2987('0x25')]=function(_0x570f9b,_0x4ac06c){return db[_0x2987('0x2c')][_0x2987('0x46')]({'where':{'id':_0x570f9b[_0x2987('0x42')]['id']}})[_0x2987('0x26')](handleEntityNotFound(_0x4ac06c,null))['then'](removeEntity(_0x4ac06c,null))['catch'](handleError(_0x4ac06c,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 8d71b21..53e08d9 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 _0x41d3=['rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1eea05,_0x5cd9f0){var _0x22fe7f=function(_0x109b5c){while(--_0x109b5c){_0x1eea05['push'](_0x1eea05['shift']());}};_0x22fe7f(++_0x5cd9f0);}(_0x41d3,0x165));var _0x341d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x41d3[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x341d('0x0'));var util=require(_0x341d('0x1'));var logger=require(_0x341d('0x2'))('api');var moment=require(_0x341d('0x3'));var BPromise=require(_0x341d('0x4'));var rp=require(_0x341d('0x5'));var fs=require('fs');var path=require(_0x341d('0x6'));var rimraf=require(_0x341d('0x7'));var config=require(_0x341d('0x8'));var attributes=require(_0x341d('0x9'));module[_0x341d('0xa')]=function(_0x58fec7,_0x1bced4){return _0x58fec7[_0x341d('0xb')](_0x341d('0xc'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa766=['tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x446bcf,_0x2220fe){var _0x2f7d88=function(_0x21273c){while(--_0x21273c){_0x446bcf['push'](_0x446bcf['shift']());}};_0x2f7d88(++_0x2220fe);}(_0xa766,0x1dd));var _0x6a76=function(_0x283a9c,_0x27d9a5){_0x283a9c=_0x283a9c-0x0;var _0x3226ec=_0xa766[_0x283a9c];return _0x3226ec;};'use strict';var _=require(_0x6a76('0x0'));var util=require(_0x6a76('0x1'));var logger=require(_0x6a76('0x2'))(_0x6a76('0x3'));var moment=require(_0x6a76('0x4'));var BPromise=require(_0x6a76('0x5'));var rp=require(_0x6a76('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a76('0x7'));var config=require(_0x6a76('0x8'));var attributes=require(_0x6a76('0x9'));module[_0x6a76('0xa')]=function(_0x55f431,_0x59ad70){return _0x55f431[_0x6a76('0xb')](_0x6a76('0xc'),attributes,{'tableName':_0x6a76('0xd'),'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 5f3bd12..14f3f0f 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x44c742,_0x5d69a4){var _0x40fcf0=function(_0x453d3c){while(--_0x453d3c){_0x44c742['push'](_0x44c742['shift']());}};_0x40fcf0(++_0x5d69a4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4da062,_0x422420){_0x4da062=_0x4da062-0x0;var _0x3f6ebb=_0x8ef6[_0x4da062];return _0x3f6ebb;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file +var _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(_0x3366f1,_0xdb6405){var _0x2e1a07=function(_0x977be7){while(--_0x977be7){_0x3366f1['push'](_0x3366f1['shift']());}};_0x2e1a07(++_0xdb6405);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2fab67,_0x510e24){_0x2fab67=_0x2fab67-0x0;var _0x3b0237=_0x7fbe[_0x2fab67];return _0x3b0237;};'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 ea2679c..f8e1bdc 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 _0x4d41=['./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','reset','pull','restart','/migrations','migrations','exports','Router','../../components/auth/service'];(function(_0x413f3a,_0xe869e7){var _0x1ae166=function(_0xb4f46c){while(--_0xb4f46c){_0x413f3a['push'](_0x413f3a['shift']());}};_0x1ae166(++_0xe869e7);}(_0x4d41,0x1be));var _0x14d4=function(_0x37222f,_0x25a5ab){_0x37222f=_0x37222f-0x0;var _0x5c5a6d=_0x4d41[_0x37222f];return _0x5c5a6d;};'use strict';var express=require('express');var router=express[_0x14d4('0x0')]();var auth=require(_0x14d4('0x1'));var controller=require(_0x14d4('0x2'));router[_0x14d4('0x3')]('/',controller['index']);router[_0x14d4('0x3')](_0x14d4('0x4'),auth[_0x14d4('0x5')](),auth[_0x14d4('0x6')](),controller[_0x14d4('0x7')]);router[_0x14d4('0x3')]('/reset',auth[_0x14d4('0x5')](),auth[_0x14d4('0x6')](),controller[_0x14d4('0x8')]);router[_0x14d4('0x3')]('/pull',auth['isAuthenticated'](),auth[_0x14d4('0x6')](),controller[_0x14d4('0x9')]);router[_0x14d4('0x3')]('/restart',auth[_0x14d4('0x5')](),controller[_0x14d4('0xa')]);router[_0x14d4('0x3')](_0x14d4('0xb'),controller[_0x14d4('0xc')]);module[_0x14d4('0xd')]=router; \ No newline at end of file +var _0xd5fb=['fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','canUpdate'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xd5fb,0xa2));var _0xbd5f=function(_0x41f96e,_0x333851){_0x41f96e=_0x41f96e-0x0;var _0x48a4ac=_0xd5fb[_0x41f96e];return _0x48a4ac;};'use strict';var express=require(_0xbd5f('0x0'));var router=express[_0xbd5f('0x1')]();var auth=require(_0xbd5f('0x2'));var controller=require(_0xbd5f('0x3'));router['get']('/',controller[_0xbd5f('0x4')]);router[_0xbd5f('0x5')](_0xbd5f('0x6'),auth[_0xbd5f('0x7')](),auth[_0xbd5f('0x8')](),controller[_0xbd5f('0x9')]);router[_0xbd5f('0x5')](_0xbd5f('0xa'),auth[_0xbd5f('0x7')](),auth[_0xbd5f('0x8')](),controller[_0xbd5f('0xb')]);router[_0xbd5f('0x5')](_0xbd5f('0xc'),auth[_0xbd5f('0x7')](),auth[_0xbd5f('0x8')](),controller[_0xbd5f('0xd')]);router['get'](_0xbd5f('0xe'),auth['isAuthenticated'](),controller[_0xbd5f('0xf')]);router[_0xbd5f('0x5')](_0xbd5f('0x10'),controller[_0xbd5f('0x11')]);module[_0xbd5f('0x12')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 72513fa..bd0d825 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 _0x6ad5=['migrations','then','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports','version','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','length','.js','push','sort','Migration','sequelize','getQueryInterface'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x6ad5,0x16b));var _0x56ad=function(_0x3839a7,_0x5af8b0){_0x3839a7=_0x3839a7-0x0;var _0x3309cd=_0x6ad5[_0x3839a7];return _0x3309cd;};'use strict';var Umzug=require(_0x56ad('0x0'));var path=require(_0x56ad('0x1'));var fs=require('fs');var _=require(_0x56ad('0x2'));var pkginfo=require(_0x56ad('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x56ad('0x4'))[_0x56ad('0x5')];var db=require(_0x56ad('0x6'))['db'];var config=require(_0x56ad('0x7'));var pm2=require(_0x56ad('0x8'));var logger=require(_0x56ad('0x9'))(_0x56ad('0xa'));var git=require('simple-git')(config[_0x56ad('0xb')]);exports[_0x56ad('0xc')]=function(_0x1cedd2,_0x49aa30){var _0x52cd7b={'current':module[_0x56ad('0xd')][_0x56ad('0xe')],'phonebar':0x2};if(_0x1cedd2[_0x56ad('0xf')]&&_0x1cedd2[_0x56ad('0xf')][_0x56ad('0x10')]){return git[_0x56ad('0x11')]()[_0x56ad('0x12')](function(_0x5c57f9,_0x2ce7a1){_0x52cd7b[_0x56ad('0x10')]=(_0x5c57f9?module['exports'][_0x56ad('0xe')]:_0x2ce7a1['latest'])||_0x56ad('0x13');return _0x49aa30[_0x56ad('0x14')](0xc8)['json'](_0x52cd7b);});}else{return _0x49aa30[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')](_0x52cd7b);}};exports['fetch']=function(_0x4c7c21,_0x43e182){return git['fetch']([_0x56ad('0x16'),_0x56ad('0x17')],function(_0x5c8175){if(_0x5c8175){logger[_0x56ad('0x18')](_0x5c8175);return _0x43e182[_0x56ad('0x14')](0x1f4)[_0x56ad('0x15')](_0x5c8175);}logger['info']('git\x20fetch');return _0x43e182[_0x56ad('0x14')](0xc8)['json']({'output':_0x56ad('0x19')});});};exports[_0x56ad('0x1a')]=function(_0x4d1b6c,_0x55fbc1){return git[_0x56ad('0x1a')]([_0x56ad('0x1b'),'FETCH_HEAD'],function(_0x59b1ba){if(_0x59b1ba){logger['error'](_0x59b1ba);return _0x55fbc1['status'](0x1f4)[_0x56ad('0x15')](_0x59b1ba);}logger['info'](_0x56ad('0x1c'));return _0x55fbc1[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')]({'output':_0x56ad('0x1d')});});};exports['pull']=function(_0x2a8956,_0x36f488){exec('npm\x20install\x20--production',function(_0x2c7f33,_0x4bbe6d,_0x4223a2){logger['info'](_0x4bbe6d);logger['info'](_0x4223a2);if(_0x2c7f33){logger[_0x56ad('0x18')](_0x2c7f33);return _0x36f488[_0x56ad('0x14')](0x1f4)[_0x56ad('0x15')](_0x2c7f33);}return _0x36f488[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')]({'output':_0x4bbe6d});});};exports[_0x56ad('0x1e')]=function(_0xaa969e,_0x1b63a3){return pm2[_0x56ad('0x1e')](_0x56ad('0x1f'))['then'](function(_0x245092){logger['info'](_0x56ad('0x20'),_0x245092);return _0x1b63a3['status'](0xc8)[_0x56ad('0x15')]({'output':_0x56ad('0x21')});})[_0x56ad('0x22')](function(_0x476c71){logger[_0x56ad('0x18')](_0x476c71);return _0x1b63a3['status'](0x1f4)[_0x56ad('0x15')](_0x476c71);});};exports['migrations']=function(_0x4b438c,_0x12ed2c){var _0xa0398d=fs[_0x56ad('0x23')](path[_0x56ad('0x24')](config[_0x56ad('0xb')],_0x56ad('0x25'),'migrations'));var _0x4a2cd4=[];for(var _0x128824=0x0;_0x128824<_0xa0398d[_0x56ad('0x26')];_0x128824++){var _0x33046b=_0xa0398d[_0x128824]['replace'](_0x56ad('0x27'),'');if(compareVersions(module[_0x56ad('0xd')][_0x56ad('0xe')],_0x33046b)===-0x1){_0x4a2cd4[_0x56ad('0x28')](_0x33046b);}}if(_0x4a2cd4[_0x56ad('0x26')]){var _0x41552c=_0x4a2cd4[_0x56ad('0x29')](compareVersions);var _0x2448ad=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x56ad('0x2a')],'modelName':_0x56ad('0x2a'),'columnName':_0x56ad('0xe')},'migrations':{'params':[db[_0x56ad('0x2b')][_0x56ad('0x2c')](),db['sequelize']['constructor'],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[_0x56ad('0x24')](config[_0x56ad('0xb')],_0x56ad('0x25'),_0x56ad('0x2d')),'pattern':/\.js$/}});_0x2448ad['up']({'migrations':_['map'](_0x41552c,function(_0x33a1fa){return _0x33a1fa+_0x56ad('0x27');})})[_0x56ad('0x2e')](function(){return _0x12ed2c['status'](0xc8)[_0x56ad('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x56ad('0xd')][_0x56ad('0xe')]+_0x56ad('0x2f')+_[_0x56ad('0x30')](_0x41552c),'migrations':_['join'](_0x41552c)});})['catch'](function(_0x51bcd4){if(_0x51bcd4 instanceof db['sequelize'][_0x56ad('0x31')]){return _0x12ed2c[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x12ed2c[_0x56ad('0x14')](0x1f4)['json'](_0x51bcd4);}});}else{return _0x12ed2c['status'](0xc8)[_0x56ad('0x15')]({'output':_0x56ad('0x32')});}}; \ No newline at end of file +var _0xfae3=['master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','fetch','tags','2.0.0','status','json'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfae3,0xf9));var _0x3fae=function(_0x5ed32c,_0x956025){_0x5ed32c=_0x5ed32c-0x0;var _0x271ea3=_0xfae3[_0x5ed32c];return _0x271ea3;};'use strict';var Umzug=require(_0x3fae('0x0'));var path=require(_0x3fae('0x1'));var fs=require('fs');var _=require(_0x3fae('0x2'));var pkginfo=require(_0x3fae('0x3'))(module,_0x3fae('0x4'));var compareVersions=require(_0x3fae('0x5'));var exec=require(_0x3fae('0x6'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x3fae('0x7'));var pm2=require(_0x3fae('0x8'));var logger=require(_0x3fae('0x9'))(_0x3fae('0xa'));var git=require(_0x3fae('0xb'))(config[_0x3fae('0xc')]);exports[_0x3fae('0xd')]=function(_0x35f399,_0x41277f){var _0x36a2a7={'current':module[_0x3fae('0xe')][_0x3fae('0x4')],'phonebar':0x2};if(_0x35f399[_0x3fae('0xf')]&&_0x35f399['query']['latest']){return git[_0x3fae('0x10')]()[_0x3fae('0x11')](function(_0x5caa83,_0x488229){_0x36a2a7['latest']=(_0x5caa83?module[_0x3fae('0xe')]['version']:_0x488229['latest'])||_0x3fae('0x12');return _0x41277f[_0x3fae('0x13')](0xc8)[_0x3fae('0x14')](_0x36a2a7);});}else{return _0x41277f['status'](0xc8)[_0x3fae('0x14')](_0x36a2a7);}};exports[_0x3fae('0x10')]=function(_0x6f79b0,_0x165be9){return git[_0x3fae('0x10')](['origin',_0x3fae('0x15')],function(_0x64eef6){if(_0x64eef6){logger[_0x3fae('0x16')](_0x64eef6);return _0x165be9[_0x3fae('0x13')](0x1f4)[_0x3fae('0x14')](_0x64eef6);}logger[_0x3fae('0x17')]('git\x20fetch');return _0x165be9[_0x3fae('0x13')](0xc8)[_0x3fae('0x14')]({'output':_0x3fae('0x18')});});};exports[_0x3fae('0x19')]=function(_0x4a4079,_0x3c990f){return git[_0x3fae('0x19')]([_0x3fae('0x1a'),'FETCH_HEAD'],function(_0x1f3d28){if(_0x1f3d28){logger['error'](_0x1f3d28);return _0x3c990f[_0x3fae('0x13')](0x1f4)[_0x3fae('0x14')](_0x1f3d28);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x3c990f[_0x3fae('0x13')](0xc8)[_0x3fae('0x14')]({'output':_0x3fae('0x1b')});});};exports['pull']=function(_0x34e8e9,_0x2525c3){exec(_0x3fae('0x1c'),function(_0x7b8f2c,_0x69e3ee,_0xbb5213){logger[_0x3fae('0x17')](_0x69e3ee);logger[_0x3fae('0x17')](_0xbb5213);if(_0x7b8f2c){logger[_0x3fae('0x16')](_0x7b8f2c);return _0x2525c3['status'](0x1f4)[_0x3fae('0x14')](_0x7b8f2c);}return _0x2525c3[_0x3fae('0x13')](0xc8)[_0x3fae('0x14')]({'output':_0x69e3ee});});};exports[_0x3fae('0x1d')]=function(_0x2f4e70,_0x2bc70c){return pm2[_0x3fae('0x1d')](_0x3fae('0x1e'))[_0x3fae('0x1f')](function(_0x529d37){logger[_0x3fae('0x17')](_0x3fae('0x20'),_0x529d37);return _0x2bc70c[_0x3fae('0x13')](0xc8)[_0x3fae('0x14')]({'output':_0x3fae('0x21')});})['catch'](function(_0x346612){logger[_0x3fae('0x16')](_0x346612);return _0x2bc70c[_0x3fae('0x13')](0x1f4)[_0x3fae('0x14')](_0x346612);});};exports[_0x3fae('0x22')]=function(_0x5ea8bb,_0xf68dc7){var _0x2636b0=fs[_0x3fae('0x23')](path[_0x3fae('0x24')](config[_0x3fae('0xc')],_0x3fae('0x25'),_0x3fae('0x22')));var _0x3859a5=[];for(var _0x562268=0x0;_0x562268<_0x2636b0[_0x3fae('0x26')];_0x562268++){var _0x41e6c2=_0x2636b0[_0x562268][_0x3fae('0x27')]('.js','');if(compareVersions(module[_0x3fae('0xe')][_0x3fae('0x4')],_0x41e6c2)===-0x1){_0x3859a5[_0x3fae('0x28')](_0x41e6c2);}}if(_0x3859a5['length']){var _0x48dd8b=_0x3859a5[_0x3fae('0x29')](compareVersions);var _0x2302c6=new Umzug({'storage':_0x3fae('0x2a'),'storageOptions':{'model':db[_0x3fae('0x2b')],'modelName':_0x3fae('0x2b'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0x3fae('0x2c')](),db['sequelize'][_0x3fae('0x2d')],function(){throw new Error(_0x3fae('0x2e'));}],'path':path[_0x3fae('0x24')](config['root'],_0x3fae('0x25'),'migrations'),'pattern':/\.js$/}});_0x2302c6['up']({'migrations':_[_0x3fae('0x2f')](_0x48dd8b,function(_0x48757b){return _0x48757b+_0x3fae('0x30');})})['then'](function(){return _0xf68dc7[_0x3fae('0x13')](0xc8)['json']({'output':_0x3fae('0x31')+module[_0x3fae('0xe')][_0x3fae('0x4')]+_0x3fae('0x32')+_['last'](_0x48dd8b),'migrations':_['join'](_0x48dd8b)});})[_0x3fae('0x33')](function(_0x41ee69){if(_0x41ee69 instanceof db[_0x3fae('0x2a')][_0x3fae('0x34')]){return _0xf68dc7[_0x3fae('0x13')](0xc8)[_0x3fae('0x14')]({'output':_0x3fae('0x35')});}else{return _0xf68dc7[_0x3fae('0x13')](0x1f4)[_0x3fae('0x14')](_0x41ee69);}});}else{return _0xf68dc7[_0x3fae('0x13')](0xc8)[_0x3fae('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7eb1607..65e7895 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 _0xe108=['create','put','/:id','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xe108,0xd9));var _0x8e10=function(_0x44c026,_0x31d7ab){_0x44c026=_0x44c026-0x0;var _0x53e051=_0xe108[_0x44c026];return _0x53e051;};'use strict';var multer=require(_0x8e10('0x0'));var util=require(_0x8e10('0x1'));var path=require(_0x8e10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8e10('0x3'));var auth=require(_0x8e10('0x4'));var interaction=require(_0x8e10('0x5'));var config=require(_0x8e10('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x8e10('0x7')]('/',auth[_0x8e10('0x8')](),controller[_0x8e10('0x9')]);router[_0x8e10('0x7')](_0x8e10('0xa'),auth[_0x8e10('0x8')](),controller[_0x8e10('0xb')]);router[_0x8e10('0x7')]('/:id',auth[_0x8e10('0x8')](),controller[_0x8e10('0xc')]);router[_0x8e10('0xd')]('/',auth['isAuthenticated'](),controller[_0x8e10('0xe')]);router[_0x8e10('0xf')](_0x8e10('0x10'),auth[_0x8e10('0x8')](),controller[_0x8e10('0x11')]);router[_0x8e10('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8e10('0x13')]);module[_0x8e10('0x14')]=router; \ No newline at end of file +var _0x702c=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','create'];(function(_0x459a95,_0x1910f3){var _0x539370=function(_0x18ec76){while(--_0x18ec76){_0x459a95['push'](_0x459a95['shift']());}};_0x539370(++_0x1910f3);}(_0x702c,0x1a6));var _0xc702=function(_0x335b22,_0x38d953){_0x335b22=_0x335b22-0x0;var _0x42df83=_0x702c[_0x335b22];return _0x42df83;};'use strict';var multer=require(_0xc702('0x0'));var util=require(_0xc702('0x1'));var path=require('path');var timeout=require(_0xc702('0x2'));var express=require(_0xc702('0x3'));var router=express[_0xc702('0x4')]();var fs_extra=require(_0xc702('0x5'));var auth=require(_0xc702('0x6'));var interaction=require(_0xc702('0x7'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xc702('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc702('0x9'),auth[_0xc702('0xa')](),controller[_0xc702('0xb')]);router[_0xc702('0x8')](_0xc702('0xc'),auth[_0xc702('0xa')](),controller[_0xc702('0xd')]);router['post']('/',auth[_0xc702('0xa')](),controller[_0xc702('0xe')]);router['put'](_0xc702('0xc'),auth['isAuthenticated'](),controller[_0xc702('0xf')]);router[_0xc702('0x10')](_0xc702('0xc'),auth[_0xc702('0xa')](),controller[_0xc702('0x11')]);module[_0xc702('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8da87d7..b186364 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 _0x253d=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x37ad47,_0x59b943){var _0x20dd41=function(_0x58afc4){while(--_0x58afc4){_0x37ad47['push'](_0x37ad47['shift']());}};_0x20dd41(++_0x59b943);}(_0x253d,0x1b3));var _0xd253=function(_0x1192c7,_0x403d79){_0x1192c7=_0x1192c7-0x0;var _0x50ae76=_0x253d[_0x1192c7];return _0x50ae76;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd253('0x1')]},'queue':{'type':Sequelize[_0xd253('0x1')]},'interface':{'type':Sequelize[_0xd253('0x1')]},'membername':{'type':Sequelize[_0xd253('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd253('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xd253('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd253('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd253('0x2')]},'holdtime':{'type':Sequelize[_0xd253('0x3')]},'agentcomplete':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd253('0x3')]},'agentacw':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd253('0x3')]},'reason':{'type':Sequelize[_0xd253('0x1')]},'lastevent':{'type':Sequelize[_0xd253('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd253('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd253('0x1')]},'language':{'type':Sequelize[_0xd253('0x1')]},'accountcode':{'type':Sequelize[_0xd253('0x1')]},'context':{'type':Sequelize[_0xd253('0x1')]},'exten':{'type':Sequelize[_0xd253('0x1')]},'priority':{'type':Sequelize[_0xd253('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd253('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd253('0x1')]},'destcalleridname':{'type':Sequelize[_0xd253('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd253('0x1')]},'destaccountcode':{'type':Sequelize[_0xd253('0x1')]},'destcontext':{'type':Sequelize[_0xd253('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xd253('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd253('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd253('0x1')]},'transfer':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xd253('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xd253('0x1')]},'agententerreason':{'type':Sequelize[_0xd253('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9a2d=['DATE','INTEGER','BOOLEAN','STRING'];(function(_0x4c6050,_0x40663a){var _0x2d6701=function(_0x5ad3d0){while(--_0x5ad3d0){_0x4c6050['push'](_0x4c6050['shift']());}};_0x2d6701(++_0x40663a);}(_0x9a2d,0x123));var _0xd9a2=function(_0x192bb5,_0x4956b5){_0x192bb5=_0x192bb5-0x0;var _0x4e6f49=_0x9a2d[_0x192bb5];return _0x4e6f49;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xd9a2('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd9a2('0x0')]},'calleridname':{'type':Sequelize[_0xd9a2('0x0')]},'queue':{'type':Sequelize[_0xd9a2('0x0')]},'interface':{'type':Sequelize[_0xd9a2('0x0')]},'membername':{'type':Sequelize[_0xd9a2('0x0')]},'agentcalledAt':{'type':Sequelize[_0xd9a2('0x1')]},'agentconnectAt':{'type':Sequelize[_0xd9a2('0x1')]},'agentcompleteAt':{'type':Sequelize[_0xd9a2('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0xd9a2('0x1')]},'agentdumpAt':{'type':Sequelize[_0xd9a2('0x1')]},'holdtime':{'type':Sequelize[_0xd9a2('0x2')]},'agentcomplete':{'type':Sequelize[_0xd9a2('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd9a2('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd9a2('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd9a2('0x2')]},'agentacw':{'type':Sequelize[_0xd9a2('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd9a2('0x2')]},'reason':{'type':Sequelize[_0xd9a2('0x0')]},'lastevent':{'type':Sequelize[_0xd9a2('0x0')]},'channel':{'type':Sequelize[_0xd9a2('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd9a2('0x0')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd9a2('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd9a2('0x0')]},'exten':{'type':Sequelize[_0xd9a2('0x0')]},'priority':{'type':Sequelize[_0xd9a2('0x0')]},'destchannel':{'type':Sequelize[_0xd9a2('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd9a2('0x0')]},'destcalleridnum':{'type':Sequelize[_0xd9a2('0x0')]},'destcalleridname':{'type':Sequelize[_0xd9a2('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xd9a2('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xd9a2('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd9a2('0x0')]},'destpriority':{'type':Sequelize[_0xd9a2('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd9a2('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0xd9a2('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd9a2('0x0')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd9a2('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xd9a2('0x2')],'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 5aa7f51..1f23714 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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 8d4136c..6e7e7d3 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 _0x7c8e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger'];(function(_0x4ca907,_0x1429c0){var _0x5a8f62=function(_0x792e8d){while(--_0x792e8d){_0x4ca907['push'](_0x4ca907['shift']());}};_0x5a8f62(++_0x1429c0);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x950c48,_0x3acdaf){_0x950c48=_0x950c48-0x0;var _0x20398c=_0x7c8e[_0x950c48];return _0x20398c;};'use strict';var _=require('lodash');var util=require(_0xe7c8('0x0'));var logger=require(_0xe7c8('0x1'))(_0xe7c8('0x2'));var moment=require(_0xe7c8('0x3'));var BPromise=require(_0xe7c8('0x4'));var rp=require(_0xe7c8('0x5'));var fs=require('fs');var path=require(_0xe7c8('0x6'));var rimraf=require(_0xe7c8('0x7'));var config=require(_0xe7c8('0x8'));var attributes=require(_0xe7c8('0x9'));module[_0xe7c8('0xa')]=function(_0x1f0a65,_0x293383){return _0x1f0a65[_0xe7c8('0xb')](_0xe7c8('0xc'),attributes,{'tableName':_0xe7c8('0xd'),'paranoid':![],'indexes':[{'fields':[_0xe7c8('0xe'),_0xe7c8('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a28=['destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','uniqueid'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8a28,0xfd));var _0x88a2=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x8a28[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var logger=require(_0x88a2('0x2'))(_0x88a2('0x3'));var moment=require(_0x88a2('0x4'));var BPromise=require(_0x88a2('0x5'));var rp=require(_0x88a2('0x6'));var fs=require('fs');var path=require(_0x88a2('0x7'));var rimraf=require('rimraf');var config=require(_0x88a2('0x8'));var attributes=require(_0x88a2('0x9'));module[_0x88a2('0xa')]=function(_0x438e32,_0x29ce92){return _0x438e32['define'](_0x88a2('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x88a2('0xc'),_0x88a2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index aab9962..fc6b23f 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 _0x76bd=['http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x76bd,0xbc));var _0xd76b=function(_0x4fd76d,_0x179501){_0x4fd76d=_0x4fd76d-0x0;var _0x5f1d6f=_0x76bd[_0x4fd76d];return _0x5f1d6f;};'use strict';var _=require(_0xd76b('0x0'));var util=require('util');var moment=require(_0xd76b('0x1'));var BPromise=require('bluebird');var rs=require(_0xd76b('0x2'));var fs=require('fs');var Redis=require(_0xd76b('0x3'));var db=require(_0xd76b('0x4'))['db'];var utils=require(_0xd76b('0x5'));var logger=require(_0xd76b('0x6'))(_0xd76b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd76b('0x8'));var client=jayson[_0xd76b('0x9')][_0xd76b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe0aff7,_0x414e98,_0x73c02f){return new BPromise(function(_0x2332cb,_0x32623b){return client[_0xd76b('0xb')](_0xe0aff7,_0x73c02f)[_0xd76b('0xc')](function(_0x3002fe){logger['info'](_0xd76b('0xd'),_0x414e98,_0xd76b('0xe'));logger['debug'](_0xd76b('0xf'),_0x414e98,'request\x20sent',JSON[_0xd76b('0x10')](_0x3002fe));if(_0x3002fe[_0xd76b('0x11')]){if(_0x3002fe['error'][_0xd76b('0x12')]===0x1f4){logger[_0xd76b('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x414e98,_0x3002fe[_0xd76b('0x11')]['message']);return _0x32623b(_0x3002fe[_0xd76b('0x11')][_0xd76b('0x13')]);}logger[_0xd76b('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x414e98,_0x3002fe['error'][_0xd76b('0x13')]);return _0x2332cb(_0x3002fe[_0xd76b('0x11')][_0xd76b('0x13')]);}else{logger[_0xd76b('0x14')](_0xd76b('0xd'),_0x414e98,_0xd76b('0xe'));_0x2332cb(_0x3002fe[_0xd76b('0x15')]['message']);}})[_0xd76b('0x16')](function(_0x24c7c2){logger[_0xd76b('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x414e98,_0x24c7c2);_0x32623b(_0x24c7c2);});});}exports[_0xd76b('0x17')]=function(_0xbe963e){var _0x811924=this;return new Promise(function(_0x29785f,_0x4d8bfb){return db[_0xd76b('0x18')][_0xd76b('0x19')](_0xbe963e[_0xd76b('0x1a')],{'raw':_0xbe963e['options']?_0xbe963e[_0xd76b('0x1b')][_0xd76b('0x1c')]===undefined?!![]:![]:!![]})[_0xd76b('0xc')](function(_0x51ebbb){logger[_0xd76b('0x14')]('CreateVoiceAgentReport',_0xbe963e);logger['debug'](_0xd76b('0x17'),_0xbe963e,JSON[_0xd76b('0x10')](_0x51ebbb));_0x29785f(_0x51ebbb);})[_0xd76b('0x16')](function(_0x43eaa2){logger[_0xd76b('0x11')](_0xd76b('0x17'),_0x43eaa2[_0xd76b('0x13')],_0xbe963e);_0x4d8bfb(_0x811924[_0xd76b('0x11')](0x1f4,_0x43eaa2[_0xd76b('0x13')]));});});};exports[_0xd76b('0x1d')]=function(_0x579be6){var _0x22d398=this;return new Promise(function(_0x16fa14,_0x54cf12){return db[_0xd76b('0x18')]['update'](_0x579be6[_0xd76b('0x1a')],{'raw':_0x579be6[_0xd76b('0x1b')]?_0x579be6[_0xd76b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579be6[_0xd76b('0x1b')]?_0x579be6[_0xd76b('0x1b')][_0xd76b('0x1e')]||null:null,'attributes':_0x579be6[_0xd76b('0x1b')]?_0x579be6['options'][_0xd76b('0x1f')]||null:null,'limit':_0x579be6[_0xd76b('0x1b')]?_0x579be6[_0xd76b('0x1b')][_0xd76b('0x20')]||null:null})[_0xd76b('0xc')](function(_0x2744a6){logger[_0xd76b('0x14')](_0xd76b('0x1d'),_0x579be6);logger['debug'](_0xd76b('0x1d'),_0x579be6,JSON[_0xd76b('0x10')](_0x2744a6));_0x16fa14(_0x2744a6);})[_0xd76b('0x16')](function(_0x59e38d){logger[_0xd76b('0x11')]('UpdateVoiceAgentReport',_0x59e38d[_0xd76b('0x13')],_0x579be6);_0x54cf12(_0x22d398[_0xd76b('0x11')](0x1f4,_0x59e38d[_0xd76b('0x13')]));});});}; \ No newline at end of file +var _0xfba1=['moment','bluebird','ioredis','../../config/logger','rpc','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','body','options','raw','CreateVoiceAgentReport','debug','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','limit','lodash'];(function(_0x230228,_0x271757){var _0xfbc62c=function(_0x4d6b1a){while(--_0x4d6b1a){_0x230228['push'](_0x230228['shift']());}};_0xfbc62c(++_0x271757);}(_0xfba1,0x1df));var _0x1fba=function(_0x367d93,_0x8a1f1b){_0x367d93=_0x367d93-0x0;var _0x1c54f4=_0xfba1[_0x367d93];return _0x1c54f4;};'use strict';var _=require(_0x1fba('0x0'));var util=require('util');var moment=require(_0x1fba('0x1'));var BPromise=require(_0x1fba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fba('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1fba('0x4'))(_0x1fba('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1fba('0x6')][_0x1fba('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2cd904,_0x4aea4b,_0x1b6c5f){return new BPromise(function(_0x44a87d,_0xc16bde){return client['request'](_0x2cd904,_0x1b6c5f)[_0x1fba('0x8')](function(_0x56b656){logger[_0x1fba('0x9')](_0x1fba('0xa'),_0x4aea4b,'request\x20sent');logger['debug'](_0x1fba('0xb'),_0x4aea4b,_0x1fba('0xc'),JSON[_0x1fba('0xd')](_0x56b656));if(_0x56b656[_0x1fba('0xe')]){if(_0x56b656[_0x1fba('0xe')][_0x1fba('0xf')]===0x1f4){logger[_0x1fba('0xe')](_0x1fba('0xa'),_0x4aea4b,_0x56b656['error'][_0x1fba('0x10')]);return _0xc16bde(_0x56b656[_0x1fba('0xe')][_0x1fba('0x10')]);}logger[_0x1fba('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x4aea4b,_0x56b656[_0x1fba('0xe')]['message']);return _0x44a87d(_0x56b656[_0x1fba('0xe')][_0x1fba('0x10')]);}else{logger[_0x1fba('0x9')](_0x1fba('0xa'),_0x4aea4b,_0x1fba('0xc'));_0x44a87d(_0x56b656[_0x1fba('0x11')][_0x1fba('0x10')]);}})[_0x1fba('0x12')](function(_0x1da583){logger['error'](_0x1fba('0xa'),_0x4aea4b,_0x1da583);_0xc16bde(_0x1da583);});});}exports['CreateVoiceAgentReport']=function(_0x260f8a){var _0x4914be=this;return new Promise(function(_0x25a405,_0x4f8eb7){return db['VoiceAgentReport']['create'](_0x260f8a[_0x1fba('0x13')],{'raw':_0x260f8a[_0x1fba('0x14')]?_0x260f8a[_0x1fba('0x14')][_0x1fba('0x15')]===undefined?!![]:![]:!![]})[_0x1fba('0x8')](function(_0x7cdcf4){logger[_0x1fba('0x9')](_0x1fba('0x16'),_0x260f8a);logger[_0x1fba('0x17')]('CreateVoiceAgentReport',_0x260f8a,JSON[_0x1fba('0xd')](_0x7cdcf4));_0x25a405(_0x7cdcf4);})['catch'](function(_0x1f592e){logger[_0x1fba('0xe')]('CreateVoiceAgentReport',_0x1f592e[_0x1fba('0x10')],_0x260f8a);_0x4f8eb7(_0x4914be[_0x1fba('0xe')](0x1f4,_0x1f592e[_0x1fba('0x10')]));});});};exports[_0x1fba('0x18')]=function(_0x228d2d){var _0x51d748=this;return new Promise(function(_0x2f151a,_0x4aa618){return db[_0x1fba('0x19')][_0x1fba('0x1a')](_0x228d2d[_0x1fba('0x13')],{'raw':_0x228d2d[_0x1fba('0x14')]?_0x228d2d[_0x1fba('0x14')][_0x1fba('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228d2d[_0x1fba('0x14')]?_0x228d2d['options'][_0x1fba('0x1b')]||null:null,'attributes':_0x228d2d[_0x1fba('0x14')]?_0x228d2d['options'][_0x1fba('0x1c')]||null:null,'limit':_0x228d2d['options']?_0x228d2d[_0x1fba('0x14')][_0x1fba('0x1d')]||null:null})['then'](function(_0x2e7296){logger[_0x1fba('0x9')](_0x1fba('0x18'),_0x228d2d);logger['debug'](_0x1fba('0x18'),_0x228d2d,JSON[_0x1fba('0xd')](_0x2e7296));_0x2f151a(_0x2e7296);})[_0x1fba('0x12')](function(_0x304900){logger[_0x1fba('0xe')]('UpdateVoiceAgentReport',_0x304900[_0x1fba('0x10')],_0x228d2d);_0x4aa618(_0x51d748[_0x1fba('0xe')](0x1f4,_0x304900[_0x1fba('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c2368d0..f44b487 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 _0x6aa7=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','exports','multer','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6aa7,0x178));var _0x76aa=function(_0x3de6ff,_0x47c6fd){_0x3de6ff=_0x3de6ff-0x0;var _0x588efd=_0x6aa7[_0x3de6ff];return _0x588efd;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xc')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x10')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['destroy']);module[_0x76aa('0x11')]=router; \ No newline at end of file +var _0x25fa=['isAuthenticated','index','get','/describe','describe','/:id','post','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceCallReport.controller'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x25fa,0x109));var _0xa25f=function(_0x72e098,_0x5bdc88){_0x72e098=_0x72e098-0x0;var _0x14cf27=_0x25fa[_0x72e098];return _0x14cf27;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25f('0x6'));router['get']('/',auth[_0xa25f('0x7')](),controller[_0xa25f('0x8')]);router[_0xa25f('0x9')](_0xa25f('0xa'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xb')]);router[_0xa25f('0x9')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['show']);router[_0xa25f('0xd')]('/',auth[_0xa25f('0x7')](),controller['create']);router[_0xa25f('0xe')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xf')]);router['delete'](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['destroy']);module[_0xa25f('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index ad17426..780b43a 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 _0x91bc=['sequelize','exports','inbound','internal','outbound','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x4fefea,_0x13d2ec){var _0x106105=function(_0x536863){while(--_0x536863){_0x4fefea['push'](_0x4fefea['shift']());}};_0x106105(++_0x13d2ec);}(_0x91bc,0x181));var _0xc91b=function(_0x15025f,_0x375738){_0x15025f=_0x15025f-0x0;var _0x1aa205=_0x91bc[_0x15025f];return _0x1aa205;};'use strict';var Sequelize=require(_0xc91b('0x0'));module[_0xc91b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xc91b('0x2'),_0xc91b('0x3'),_0xc91b('0x4'),'inbound-fax',_0xc91b('0x5'),_0xc91b('0x6'))},'tag':{'type':Sequelize[_0xc91b('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xc91b('0x7')]},'destination':{'type':Sequelize[_0xc91b('0x7')]},'destinationcontext':{'type':Sequelize[_0xc91b('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc91b('0x7')]},'destinationchannel':{'type':Sequelize[_0xc91b('0x7')]},'lastapplication':{'type':Sequelize[_0xc91b('0x7')]},'lastdata':{'type':Sequelize[_0xc91b('0x8')]},'starttime':{'type':Sequelize[_0xc91b('0x9')]},'systemanswertime':{'type':Sequelize[_0xc91b('0x9')]},'answertime':{'type':Sequelize[_0xc91b('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xc91b('0xa')]},'billableseconds':{'type':Sequelize[_0xc91b('0xa')]},'mohtime':{'type':Sequelize[_0xc91b('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc91b('0x7')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc91b('0x7')]},'userSecondDisposition':{'type':Sequelize[_0xc91b('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc91b('0x7')]},'prefix':{'type':Sequelize[_0xc91b('0x7')]},'routeid':{'type':Sequelize[_0xc91b('0xa')]},'sipcallid':{'type':Sequelize[_0xc91b('0x7')]}}; \ No newline at end of file +var _0x0776=['inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x580107,_0x221b10){var _0x40a36e=function(_0x1857cd){while(--_0x1857cd){_0x580107['push'](_0x580107['shift']());}};_0x40a36e(++_0x221b10);}(_0x0776,0x128));var _0x6077=function(_0x1e816f,_0x792868){_0x1e816f=_0x1e816f-0x0;var _0x4cfa48=_0x0776[_0x1e816f];return _0x4cfa48;};'use strict';var Sequelize=require(_0x6077('0x0'));module[_0x6077('0x1')]={'uniqueid':{'type':Sequelize[_0x6077('0x2')]},'type':{'type':Sequelize[_0x6077('0x3')](_0x6077('0x4'),_0x6077('0x5'),'outbound',_0x6077('0x6'),_0x6077('0x7'),_0x6077('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6077('0x2')]},'source':{'type':Sequelize[_0x6077('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x6077('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6077('0x2')]},'destinationchannel':{'type':Sequelize[_0x6077('0x2')]},'lastapplication':{'type':Sequelize[_0x6077('0x2')]},'lastdata':{'type':Sequelize[_0x6077('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x6077('0xa')]},'answertime':{'type':Sequelize[_0x6077('0xa')]},'endtime':{'type':Sequelize[_0x6077('0xa')]},'duration':{'type':Sequelize[_0x6077('0xb')]},'billableseconds':{'type':Sequelize[_0x6077('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x6077('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x6077('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x6077('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index c4bbcb6..51b14ad 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x225eee,_0x362879){_0x225eee=_0x225eee-0x0;var _0x2659d6=_0x2032[_0x225eee];return _0x2659d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x5f2f,0x73));var _0xf5f2=function(_0x20a070,_0x2f0ff9){_0x20a070=_0x20a070-0x0;var _0x433d80=_0x5f2f[_0x20a070];return _0x433d80;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 58464be..e1c8281 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 _0x4410=['define','report_call','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4410,0x136));var _0x0441=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x4410[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0x0441('0x0'));var util=require(_0x0441('0x1'));var logger=require(_0x0441('0x2'))(_0x0441('0x3'));var moment=require(_0x0441('0x4'));var BPromise=require(_0x0441('0x5'));var rp=require(_0x0441('0x6'));var fs=require('fs');var path=require(_0x0441('0x7'));var rimraf=require(_0x0441('0x8'));var config=require(_0x0441('0x9'));var attributes=require(_0x0441('0xa'));module[_0x0441('0xb')]=function(_0x3cab34,_0x240a1f){return _0x3cab34[_0x0441('0xc')]('VoiceCallReport',attributes,{'tableName':_0x0441('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x65c2=['define','VoiceCallReport','lodash','util','../../config/logger','api','rimraf','exports'];(function(_0x49a1b3,_0xccf3d){var _0x38070a=function(_0x2d02e6){while(--_0x2d02e6){_0x49a1b3['push'](_0x49a1b3['shift']());}};_0x38070a(++_0xccf3d);}(_0x65c2,0x92));var _0x265c=function(_0x399276,_0x1f2567){_0x399276=_0x399276-0x0;var _0x2b49d4=_0x65c2[_0x399276];return _0x2b49d4;};'use strict';var _=require(_0x265c('0x0'));var util=require(_0x265c('0x1'));var logger=require(_0x265c('0x2'))(_0x265c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x265c('0x4'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x265c('0x5')]=function(_0x5f29d5,_0x3eaebd){return _0x5f29d5[_0x265c('0x6')](_0x265c('0x7'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d627a56..5724c66 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 _0x26e7=['model','then','CreateVoiceCallReport','create','body','update','raw','limit','UpdateVoiceCallReport','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map'];(function(_0x89d532,_0x355031){var _0x4870f3=function(_0x5b5f06){while(--_0x5b5f06){_0x89d532['push'](_0x89d532['shift']());}};_0x4870f3(++_0x355031);}(_0x26e7,0xe1));var _0x726e=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x26e7[_0x585d81];return _0x1aca0d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x726e('0x0'));var rs=require(_0x726e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x726e('0x2'))['db'];var utils=require(_0x726e('0x3'));var logger=require(_0x726e('0x4'))(_0x726e('0x5'));var config=require(_0x726e('0x6'));var jayson=require(_0x726e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c380c,_0x2c8a4f,_0x164f93){return new BPromise(function(_0x2bf7de,_0x26d878){return client[_0x726e('0x8')](_0x2c380c,_0x164f93)['then'](function(_0x103f62){logger['info'](_0x726e('0x9'),_0x2c8a4f,_0x726e('0xa'));logger[_0x726e('0xb')](_0x726e('0xc'),_0x2c8a4f,_0x726e('0xa'),JSON[_0x726e('0xd')](_0x103f62));if(_0x103f62[_0x726e('0xe')]){if(_0x103f62[_0x726e('0xe')]['code']===0x1f4){logger[_0x726e('0xe')](_0x726e('0x9'),_0x2c8a4f,_0x103f62[_0x726e('0xe')][_0x726e('0xf')]);return _0x26d878(_0x103f62[_0x726e('0xe')][_0x726e('0xf')]);}logger[_0x726e('0xe')](_0x726e('0x9'),_0x2c8a4f,_0x103f62[_0x726e('0xe')][_0x726e('0xf')]);return _0x2bf7de(_0x103f62['error'][_0x726e('0xf')]);}else{logger[_0x726e('0x10')](_0x726e('0x9'),_0x2c8a4f,'request\x20sent');_0x2bf7de(_0x103f62[_0x726e('0x11')][_0x726e('0xf')]);}})[_0x726e('0x12')](function(_0x460e08){logger[_0x726e('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x2c8a4f,_0x460e08);_0x26d878(_0x460e08);});});}exports[_0x726e('0x13')]=function(_0x46309d){var _0x1e944c=this;return new Promise(function(_0x4f082c,_0x1cb849){return db[_0x726e('0x14')][_0x726e('0x15')]({'raw':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x46309d['options']?_0x46309d[_0x726e('0x16')][_0x726e('0x17')]||null:null,'attributes':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')][_0x726e('0x18')]||null:null,'limit':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')]['limit']||null:null,'include':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')][_0x726e('0x19')]?_[_0x726e('0x1a')](_0x46309d['options'][_0x726e('0x19')],function(_0x42acb4){return{'model':db[_0x42acb4['model']],'as':_0x42acb4['as'],'attributes':_0x42acb4[_0x726e('0x18')],'include':_0x42acb4['include']?_[_0x726e('0x1a')](_0x42acb4[_0x726e('0x19')],function(_0x3ca378){return{'model':db[_0x3ca378[_0x726e('0x1b')]],'as':_0x3ca378['as'],'attributes':_0x3ca378[_0x726e('0x18')],'include':_0x3ca378[_0x726e('0x19')]?_[_0x726e('0x1a')](_0x3ca378[_0x726e('0x19')],function(_0x1aded0){return{'model':db[_0x1aded0['model']],'as':_0x1aded0['as'],'attributes':_0x1aded0['attributes']};}):[]};}):[]};}):[]:[]})[_0x726e('0x1c')](function(_0x58919b){logger['info'](_0x726e('0x13'),_0x46309d);logger[_0x726e('0xb')](_0x726e('0x13'),_0x46309d,JSON[_0x726e('0xd')](_0x58919b));_0x4f082c(_0x58919b);})[_0x726e('0x12')](function(_0x36b9b1){logger[_0x726e('0xe')](_0x726e('0x13'),_0x36b9b1['message'],_0x46309d);_0x1cb849(_0x1e944c[_0x726e('0xe')](0x1f4,_0x36b9b1['message']));});});};exports[_0x726e('0x1d')]=function(_0x738ba8){var _0x561b21=this;return new Promise(function(_0x313428,_0x5a6e86){return db['VoiceCallReport'][_0x726e('0x1e')](_0x738ba8[_0x726e('0x1f')],{'raw':_0x738ba8[_0x726e('0x16')]?_0x738ba8[_0x726e('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x726e('0x1c')](function(_0x52787e){logger[_0x726e('0x10')](_0x726e('0x1d'),_0x738ba8);logger[_0x726e('0xb')](_0x726e('0x1d'),_0x738ba8,JSON[_0x726e('0xd')](_0x52787e));_0x313428(_0x52787e);})['catch'](function(_0x3977dc){logger[_0x726e('0xe')](_0x726e('0x1d'),_0x3977dc[_0x726e('0xf')],_0x738ba8);_0x5a6e86(_0x561b21[_0x726e('0xe')](0x1f4,_0x3977dc[_0x726e('0xf')]));});});};exports['UpdateVoiceCallReport']=function(_0x49160e){var _0x581e17=this;return new Promise(function(_0x41a7ec,_0x48550d){return db[_0x726e('0x14')][_0x726e('0x20')](_0x49160e['body'],{'raw':_0x49160e[_0x726e('0x16')]?_0x49160e[_0x726e('0x16')][_0x726e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49160e[_0x726e('0x16')]?_0x49160e['options'][_0x726e('0x17')]||null:null,'attributes':_0x49160e[_0x726e('0x16')]?_0x49160e[_0x726e('0x16')]['attributes']||null:null,'limit':_0x49160e['options']?_0x49160e[_0x726e('0x16')][_0x726e('0x22')]||null:null})[_0x726e('0x1c')](function(_0x58507b){logger[_0x726e('0x10')]('UpdateVoiceCallReport',_0x49160e);logger['debug']('UpdateVoiceCallReport',_0x49160e,JSON[_0x726e('0xd')](_0x58507b));_0x41a7ec(_0x58507b);})[_0x726e('0x12')](function(_0x358b0){logger[_0x726e('0xe')](_0x726e('0x23'),_0x358b0[_0x726e('0xf')],_0x49160e);_0x48550d(_0x581e17[_0x726e('0xe')](0x1f4,_0x358b0[_0x726e('0xf')]));});});}; \ No newline at end of file +var _0x31e6=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x168da0,_0x31b732){var _0xce6135=function(_0x43fb74){while(--_0x43fb74){_0x168da0['push'](_0x168da0['shift']());}};_0xce6135(++_0x31b732);}(_0x31e6,0x142));var _0x631e=function(_0x3d6aa5,_0x185d7b){_0x3d6aa5=_0x3d6aa5-0x0;var _0x46d62c=_0x31e6[_0x3d6aa5];return _0x46d62c;};'use strict';var _=require(_0x631e('0x0'));var util=require(_0x631e('0x1'));var moment=require(_0x631e('0x2'));var BPromise=require(_0x631e('0x3'));var rs=require(_0x631e('0x4'));var fs=require('fs');var Redis=require(_0x631e('0x5'));var db=require(_0x631e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x631e('0x7'))(_0x631e('0x8'));var config=require(_0x631e('0x9'));var jayson=require(_0x631e('0xa'));var client=jayson[_0x631e('0xb')][_0x631e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5035a0,_0x19c3bb,_0xf768a2){return new BPromise(function(_0x4e7922,_0x17b90b){return client[_0x631e('0xd')](_0x5035a0,_0xf768a2)[_0x631e('0xe')](function(_0x134947){logger[_0x631e('0xf')](_0x631e('0x10'),_0x19c3bb,_0x631e('0x11'));logger[_0x631e('0x12')](_0x631e('0x13'),_0x19c3bb,'request\x20sent',JSON[_0x631e('0x14')](_0x134947));if(_0x134947[_0x631e('0x15')]){if(_0x134947[_0x631e('0x15')][_0x631e('0x16')]===0x1f4){logger['error'](_0x631e('0x10'),_0x19c3bb,_0x134947['error'][_0x631e('0x17')]);return _0x17b90b(_0x134947['error']['message']);}logger['error'](_0x631e('0x10'),_0x19c3bb,_0x134947[_0x631e('0x15')][_0x631e('0x17')]);return _0x4e7922(_0x134947['error'][_0x631e('0x17')]);}else{logger[_0x631e('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x19c3bb,'request\x20sent');_0x4e7922(_0x134947['result'][_0x631e('0x17')]);}})[_0x631e('0x18')](function(_0x539282){logger[_0x631e('0x15')](_0x631e('0x10'),_0x19c3bb,_0x539282);_0x17b90b(_0x539282);});});}exports[_0x631e('0x19')]=function(_0x2ac06e){var _0x530471=this;return new Promise(function(_0x406006,_0x63df50){return db[_0x631e('0x1a')][_0x631e('0x1b')]({'raw':_0x2ac06e[_0x631e('0x1c')]?_0x2ac06e[_0x631e('0x1c')][_0x631e('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ac06e[_0x631e('0x1c')]?_0x2ac06e[_0x631e('0x1c')][_0x631e('0x1e')]||null:null,'attributes':_0x2ac06e['options']?_0x2ac06e[_0x631e('0x1c')][_0x631e('0x1f')]||null:null,'limit':_0x2ac06e['options']?_0x2ac06e['options'][_0x631e('0x20')]||null:null,'include':_0x2ac06e['options']?_0x2ac06e['options'][_0x631e('0x21')]?_[_0x631e('0x22')](_0x2ac06e[_0x631e('0x1c')]['include'],function(_0x2941e7){return{'model':db[_0x2941e7[_0x631e('0x23')]],'as':_0x2941e7['as'],'attributes':_0x2941e7[_0x631e('0x1f')],'include':_0x2941e7[_0x631e('0x21')]?_[_0x631e('0x22')](_0x2941e7[_0x631e('0x21')],function(_0x4c66a0){return{'model':db[_0x4c66a0[_0x631e('0x23')]],'as':_0x4c66a0['as'],'attributes':_0x4c66a0[_0x631e('0x1f')],'include':_0x4c66a0[_0x631e('0x21')]?_[_0x631e('0x22')](_0x4c66a0[_0x631e('0x21')],function(_0x5ce5f7){return{'model':db[_0x5ce5f7[_0x631e('0x23')]],'as':_0x5ce5f7['as'],'attributes':_0x5ce5f7[_0x631e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b0823){logger[_0x631e('0xf')](_0x631e('0x19'),_0x2ac06e);logger['debug'](_0x631e('0x19'),_0x2ac06e,JSON[_0x631e('0x14')](_0x1b0823));_0x406006(_0x1b0823);})[_0x631e('0x18')](function(_0xb37720){logger['error'](_0x631e('0x19'),_0xb37720[_0x631e('0x17')],_0x2ac06e);_0x63df50(_0x530471['error'](0x1f4,_0xb37720[_0x631e('0x17')]));});});};exports[_0x631e('0x24')]=function(_0x127757){var _0x403f7f=this;return new Promise(function(_0x43f617,_0x5f2248){return db['VoiceCallReport'][_0x631e('0x25')](_0x127757[_0x631e('0x26')],{'raw':_0x127757[_0x631e('0x1c')]?_0x127757[_0x631e('0x1c')][_0x631e('0x1d')]===undefined?!![]:![]:!![]})[_0x631e('0xe')](function(_0x4a6561){logger['info'](_0x631e('0x24'),_0x127757);logger[_0x631e('0x12')]('CreateVoiceCallReport',_0x127757,JSON['stringify'](_0x4a6561));_0x43f617(_0x4a6561);})['catch'](function(_0x21b89b){logger['error'](_0x631e('0x24'),_0x21b89b[_0x631e('0x17')],_0x127757);_0x5f2248(_0x403f7f[_0x631e('0x15')](0x1f4,_0x21b89b[_0x631e('0x17')]));});});};exports['UpdateVoiceCallReport']=function(_0x495bca){var _0x38e7ad=this;return new Promise(function(_0x58b336,_0x908472){return db[_0x631e('0x1a')][_0x631e('0x27')](_0x495bca[_0x631e('0x26')],{'raw':_0x495bca['options']?_0x495bca['options'][_0x631e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495bca['options']?_0x495bca[_0x631e('0x1c')][_0x631e('0x1e')]||null:null,'attributes':_0x495bca[_0x631e('0x1c')]?_0x495bca['options'][_0x631e('0x1f')]||null:null,'limit':_0x495bca[_0x631e('0x1c')]?_0x495bca[_0x631e('0x1c')][_0x631e('0x20')]||null:null})[_0x631e('0xe')](function(_0xa3dd9d){logger[_0x631e('0xf')](_0x631e('0x28'),_0x495bca);logger[_0x631e('0x12')](_0x631e('0x28'),_0x495bca,JSON[_0x631e('0x14')](_0xa3dd9d));_0x58b336(_0xa3dd9d);})[_0x631e('0x18')](function(_0x200ede){logger[_0x631e('0x15')](_0x631e('0x28'),_0x200ede[_0x631e('0x17')],_0x495bca);_0x908472(_0x38e7ad['error'](0x1f4,_0x200ede[_0x631e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 49523ce..d0d832b 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 _0x926f=['/:id','post','isAuthenticated','create','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','index'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x926f,0xcd));var _0xf926=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x926f[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0xf926('0x0'));var path=require(_0xf926('0x1'));var timeout=require(_0xf926('0x2'));var express=require(_0xf926('0x3'));var router=express[_0xf926('0x4')]();var fs_extra=require(_0xf926('0x5'));var auth=require(_0xf926('0x6'));var interaction=require(_0xf926('0x7'));var config=require('../../config/environment');var controller=require(_0xf926('0x8'));router[_0xf926('0x9')]('/',auth['isAuthenticated'](),controller[_0xf926('0xa')]);router[_0xf926('0x9')](_0xf926('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf926('0xc')]('/',auth[_0xf926('0xd')](),controller[_0xf926('0xe')]);router[_0xf926('0xf')](_0xf926('0xb'),auth[_0xf926('0xd')](),controller[_0xf926('0x10')]);router['delete'](_0xf926('0xb'),auth[_0xf926('0xd')](),controller[_0xf926('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3239=['post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','/:id'];(function(_0x1404c9,_0x41f8b0){var _0x24f6b2=function(_0x4dadac){while(--_0x4dadac){_0x1404c9['push'](_0x1404c9['shift']());}};_0x24f6b2(++_0x41f8b0);}(_0x3239,0xcc));var _0x9323=function(_0x2d6edc,_0x2f48d7){_0x2d6edc=_0x2d6edc-0x0;var _0x545d4e=_0x3239[_0x2d6edc];return _0x545d4e;};'use strict';var multer=require(_0x9323('0x0'));var util=require(_0x9323('0x1'));var path=require('path');var timeout=require(_0x9323('0x2'));var express=require(_0x9323('0x3'));var router=express['Router']();var fs_extra=require(_0x9323('0x4'));var auth=require(_0x9323('0x5'));var interaction=require(_0x9323('0x6'));var config=require(_0x9323('0x7'));var controller=require(_0x9323('0x8'));router['get']('/',auth[_0x9323('0x9')](),controller['index']);router[_0x9323('0xa')](_0x9323('0xb'),auth[_0x9323('0x9')](),controller['show']);router[_0x9323('0xc')]('/',auth['isAuthenticated'](),controller[_0x9323('0xd')]);router[_0x9323('0xe')](_0x9323('0xb'),auth['isAuthenticated'](),controller[_0x9323('0xf')]);router[_0x9323('0x10')](_0x9323('0xb'),auth[_0x9323('0x9')](),controller[_0x9323('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 76bcfb5..f5d4584 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 _0x5f27=['split','BOOLEAN','sequelize','exports','STRING','name','options','getDataValue'];(function(_0x282218,_0x505300){var _0x172a45=function(_0x2b7c6d){while(--_0x2b7c6d){_0x282218['push'](_0x282218['shift']());}};_0x172a45(++_0x505300);}(_0x5f27,0xea));var _0x75f2=function(_0x4462cb,_0x1675fd){_0x4462cb=_0x4462cb-0x0;var _0x3e2617=_0x5f27[_0x4462cb];return _0x3e2617;};'use strict';var Sequelize=require(_0x75f2('0x0'));module[_0x75f2('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x75f2('0x2')],'unique':_0x75f2('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x75f2('0x2')],'set':function(_0x117f1c){this['setDataValue'](_0x75f2('0x4'),_0x117f1c?_0x117f1c['join'](''):[]);},'get':function(){return this[_0x75f2('0x5')](_0x75f2('0x4'))?this['getDataValue'](_0x75f2('0x4'))[_0x75f2('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x75f2('0x2')]},'record':{'type':Sequelize[_0x75f2('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x75f2('0x2')]},'description':{'type':Sequelize[_0x75f2('0x2')]}}; \ No newline at end of file +var _0x95ed=['sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN'];(function(_0x5a5b56,_0x52ddfa){var _0x1217c7=function(_0x5a483e){while(--_0x5a483e){_0x5a5b56['push'](_0x5a5b56['shift']());}};_0x1217c7(++_0x52ddfa);}(_0x95ed,0x78));var _0xd95e=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x95ed[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0xd95e('0x0'));module[_0xd95e('0x1')]={'name':{'type':Sequelize[_0xd95e('0x2')]},'prefix':{'type':Sequelize[_0xd95e('0x2')],'unique':_0xd95e('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xd95e('0x2')],'set':function(_0x48285f){this[_0xd95e('0x4')](_0xd95e('0x5'),_0x48285f?_0x48285f[_0xd95e('0x6')](''):[]);},'get':function(){return this[_0xd95e('0x7')](_0xd95e('0x5'))?this[_0xd95e('0x7')](_0xd95e('0x5'))[_0xd95e('0x8')](''):[];}},'auth':{'type':Sequelize[_0xd95e('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xd95e('0x2')]},'record':{'type':Sequelize[_0xd95e('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd95e('0x2')]},'description':{'type':Sequelize[_0xd95e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 943723e..ca5cb55 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 _0x37f8=['end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','map','VoiceChanSpy','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xfbc3bf,_0x1a0a0b){var _0x500a4c=function(_0x579023){while(--_0x579023){_0xfbc3bf['push'](_0xfbc3bf['shift']());}};_0x500a4c(++_0x1a0a0b);}(_0x37f8,0xd2));var _0x837f=function(_0x5ef21b,_0x35992d){_0x5ef21b=_0x5ef21b-0x0;var _0x1e90a6=_0x37f8[_0x5ef21b];return _0x1e90a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837f('0x0'));var zipdir=require(_0x837f('0x1'));var jsonpatch=require(_0x837f('0x2'));var rp=require(_0x837f('0x3'));var moment=require('moment');var BPromise=require(_0x837f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x837f('0x5'));var fs=require('fs');var fs_extra=require(_0x837f('0x6'));var _=require(_0x837f('0x7'));var squel=require(_0x837f('0x8'));var crypto=require(_0x837f('0x9'));var jsforce=require(_0x837f('0xa'));var deskjs=require(_0x837f('0xb'));var toCsv=require(_0x837f('0xc'));var querystring=require(_0x837f('0xd'));var Papa=require(_0x837f('0xe'));var Redis=require(_0x837f('0xf'));var authService=require(_0x837f('0x10'));var qs=require(_0x837f('0x11'));var as=require(_0x837f('0x12'));var hardwareService=require(_0x837f('0x13'));var logger=require('../../config/logger')(_0x837f('0x14'));var utils=require(_0x837f('0x15'));var config=require(_0x837f('0x16'));var licenseUtil=require(_0x837f('0x17'));var db=require(_0x837f('0x18'))['db'];function respondWithStatusCode(_0x4a8c00,_0x53045e){_0x53045e=_0x53045e||0xcc;return function(_0x14ff6d){if(_0x14ff6d){return _0x4a8c00[_0x837f('0x19')](_0x53045e);}return _0x4a8c00[_0x837f('0x1a')](_0x53045e)[_0x837f('0x1b')]();};}function respondWithResult(_0x2b3cd6,_0x483267){_0x483267=_0x483267||0xc8;return function(_0x18d8aa){if(_0x18d8aa){return _0x2b3cd6[_0x837f('0x1a')](_0x483267)[_0x837f('0x1c')](_0x18d8aa);}};}function respondWithFilteredResult(_0x1664e7,_0x2e4257){return function(_0x29369d){if(_0x29369d){var _0x546352=typeof _0x2e4257[_0x837f('0x1d')]===_0x837f('0x1e')&&typeof _0x2e4257['limit']===_0x837f('0x1e');var _0x2745f6=_0x29369d[_0x837f('0x1f')];var _0x1d17b3=_0x546352?0x0:_0x2e4257['offset'];var _0x1d974f=_0x546352?_0x29369d[_0x837f('0x1f')]:_0x2e4257[_0x837f('0x1d')]+_0x2e4257[_0x837f('0x20')];var _0x14b3da;if(_0x1d974f>=_0x2745f6){_0x1d974f=_0x2745f6;_0x14b3da=0xc8;}else{_0x14b3da=0xce;}_0x1664e7['status'](_0x14b3da);return _0x1664e7[_0x837f('0x21')](_0x837f('0x22'),_0x1d17b3+'-'+_0x1d974f+'/'+_0x2745f6)[_0x837f('0x1c')](_0x29369d);}return null;};}function patchUpdates(_0x33c7cb){return function(_0x3540f3){try{jsonpatch['apply'](_0x3540f3,_0x33c7cb,!![]);}catch(_0x2e9603){return BPromise[_0x837f('0x23')](_0x2e9603);}return _0x3540f3[_0x837f('0x24')]();};}function saveUpdates(_0xe68eb1,_0xa0af78){return function(_0x237656){if(_0x237656){return _0x237656[_0x837f('0x25')](_0xe68eb1)[_0x837f('0x26')](function(_0x11a9b3){return _0x11a9b3;});}return null;};}function removeEntity(_0x168455,_0x3fa18e){return function(_0xfb4df0){if(_0xfb4df0){return _0xfb4df0[_0x837f('0x27')]()[_0x837f('0x26')](function(){var _0x68af0d=_0xfb4df0[_0x837f('0x28')]({'plain':!![]});var _0x43ca7d=_0x837f('0x29');return db[_0x837f('0x2a')][_0x837f('0x27')]({'where':{'type':_0x43ca7d,'resourceId':_0x68af0d['id']}})[_0x837f('0x26')](function(){return _0xfb4df0;});})[_0x837f('0x26')](function(){_0x168455[_0x837f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f467d,_0x2df32d){return function(_0x4290e6){if(!_0x4290e6){_0x3f467d['sendStatus'](0x194);}return _0x4290e6;};}function handleError(_0x530f6d,_0x2aa4c0){_0x2aa4c0=_0x2aa4c0||0x1f4;return function(_0x1ab2e4){logger[_0x837f('0x2b')](_0x1ab2e4[_0x837f('0x2c')]);if(_0x1ab2e4[_0x837f('0x2d')]){delete _0x1ab2e4[_0x837f('0x2d')];}_0x530f6d[_0x837f('0x1a')](_0x2aa4c0)['send'](_0x1ab2e4);};}exports[_0x837f('0x2e')]=function(_0x13a2e1,_0x266871){var _0x2dd495={},_0x5d53c6={},_0x4e4528={'count':0x0,'rows':[]};var _0x501a80=_[_0x837f('0x2f')](db[_0x837f('0x30')][_0x837f('0x31')],function(_0x422498){return{'name':_0x422498['fieldName'],'type':_0x422498[_0x837f('0x32')]['key']};});_0x5d53c6[_0x837f('0x33')]=_['map'](_0x501a80,'name');_0x5d53c6[_0x837f('0x34')]=_[_0x837f('0x35')](_0x13a2e1[_0x837f('0x34')]);_0x5d53c6[_0x837f('0x36')]=_[_0x837f('0x37')](_0x5d53c6['model'],_0x5d53c6['query']);_0x2dd495[_0x837f('0x38')]=_['intersection'](_0x5d53c6[_0x837f('0x33')],qs[_0x837f('0x39')](_0x13a2e1['query'][_0x837f('0x39')]));_0x2dd495[_0x837f('0x38')]=_0x2dd495[_0x837f('0x38')][_0x837f('0x3a')]?_0x2dd495[_0x837f('0x38')]:_0x5d53c6['model'];if(!_0x13a2e1[_0x837f('0x34')][_0x837f('0x3b')](_0x837f('0x3c'))){_0x2dd495[_0x837f('0x20')]=qs[_0x837f('0x20')](_0x13a2e1['query']['limit']);_0x2dd495[_0x837f('0x1d')]=qs['offset'](_0x13a2e1['query'][_0x837f('0x1d')]);}_0x2dd495[_0x837f('0x3d')]=qs['sort'](_0x13a2e1['query'][_0x837f('0x3e')]);_0x2dd495[_0x837f('0x3f')]=qs[_0x837f('0x36')](_['pick'](_0x13a2e1[_0x837f('0x34')],_0x5d53c6[_0x837f('0x36')]),_0x501a80);if(_0x13a2e1[_0x837f('0x34')][_0x837f('0x40')]){_0x2dd495[_0x837f('0x3f')]=_['merge'](_0x2dd495['where'],{'$or':_[_0x837f('0x2f')](_0x501a80,function(_0x211af0){if(_0x211af0[_0x837f('0x32')]!=='VIRTUAL'){var _0x5e001c={};_0x5e001c[_0x211af0[_0x837f('0x2d')]]={'$like':'%'+_0x13a2e1[_0x837f('0x34')][_0x837f('0x40')]+'%'};return _0x5e001c;}})});}_0x2dd495=_['merge']({},_0x2dd495,_0x13a2e1[_0x837f('0x41')]);var _0x29fb2b={'where':_0x2dd495['where']};return db['VoiceChanSpy']['count'](_0x29fb2b)[_0x837f('0x26')](function(_0x3509b6){_0x4e4528[_0x837f('0x1f')]=_0x3509b6;if(_0x13a2e1[_0x837f('0x34')][_0x837f('0x42')]){_0x2dd495[_0x837f('0x43')]=[{'all':!![]}];}return db[_0x837f('0x30')][_0x837f('0x44')](_0x2dd495);})[_0x837f('0x26')](function(_0xb06317){_0x4e4528['rows']=_0xb06317;return _0x4e4528;})[_0x837f('0x26')](respondWithFilteredResult(_0x266871,_0x2dd495))[_0x837f('0x45')](handleError(_0x266871,null));};exports['show']=function(_0xc2e307,_0x252886){var _0x303223={'raw':![],'where':{'id':_0xc2e307[_0x837f('0x46')]['id']}},_0x443e7c={};_0x443e7c[_0x837f('0x33')]=_['keys'](db[_0x837f('0x30')][_0x837f('0x31')]);_0x443e7c[_0x837f('0x34')]=_[_0x837f('0x35')](_0xc2e307[_0x837f('0x34')]);_0x443e7c[_0x837f('0x36')]=_[_0x837f('0x37')](_0x443e7c[_0x837f('0x33')],_0x443e7c['query']);_0x303223[_0x837f('0x38')]=_[_0x837f('0x37')](_0x443e7c['model'],qs[_0x837f('0x39')](_0xc2e307[_0x837f('0x34')]['fields']));_0x303223[_0x837f('0x38')]=_0x303223[_0x837f('0x38')][_0x837f('0x3a')]?_0x303223[_0x837f('0x38')]:_0x443e7c[_0x837f('0x33')];if(_0xc2e307[_0x837f('0x34')]['includeAll']){_0x303223[_0x837f('0x43')]=[{'all':!![]}];}_0x303223=_['merge']({},_0x303223,_0xc2e307[_0x837f('0x41')]);return db[_0x837f('0x30')][_0x837f('0x47')](_0x303223)[_0x837f('0x26')](handleEntityNotFound(_0x252886,null))[_0x837f('0x26')](respondWithResult(_0x252886,null))[_0x837f('0x45')](handleError(_0x252886,null));};exports['create']=function(_0x554f74,_0x5edfcc){return db[_0x837f('0x30')][_0x837f('0x48')](_0x554f74['body'],{})[_0x837f('0x26')](function(_0x58184b){var _0x288995=_0x554f74[_0x837f('0x49')][_0x837f('0x28')]({'plain':!![]});if(!_0x288995)throw new Error(_0x837f('0x4a'));if(_0x288995[_0x837f('0x4b')]===_0x837f('0x49')){var _0x4d9156=_0x58184b[_0x837f('0x28')]({'plain':!![]});var _0x49ce77=_0x837f('0x29');return db[_0x837f('0x4c')][_0x837f('0x47')]({'where':{'name':_0x49ce77,'userProfileId':_0x288995['userProfileId']},'raw':!![]})[_0x837f('0x26')](function(_0x3f27ca){if(_0x3f27ca&&_0x3f27ca[_0x837f('0x4d')]===0x0){return db[_0x837f('0x2a')][_0x837f('0x48')]({'name':_0x4d9156[_0x837f('0x2d')],'resourceId':_0x4d9156['id'],'type':_0x3f27ca['name'],'sectionId':_0x3f27ca['id']},{})[_0x837f('0x26')](function(){return _0x58184b;});}else{return _0x58184b;}})[_0x837f('0x45')](function(_0x3a65b5){logger[_0x837f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a65b5);throw _0x3a65b5;});}return _0x58184b;})[_0x837f('0x26')](respondWithResult(_0x5edfcc,0xc9))['catch'](handleError(_0x5edfcc,null));};exports[_0x837f('0x25')]=function(_0x576365,_0x23d555){if(_0x576365[_0x837f('0x4e')]['id']){delete _0x576365[_0x837f('0x4e')]['id'];}return db[_0x837f('0x30')][_0x837f('0x47')]({'where':{'id':_0x576365[_0x837f('0x46')]['id']}})[_0x837f('0x26')](handleEntityNotFound(_0x23d555,null))[_0x837f('0x26')](saveUpdates(_0x576365[_0x837f('0x4e')],null))[_0x837f('0x26')](respondWithResult(_0x23d555,null))[_0x837f('0x45')](handleError(_0x23d555,null));};exports[_0x837f('0x27')]=function(_0x4f2730,_0x4ade1b){return db[_0x837f('0x30')]['find']({'where':{'id':_0x4f2730[_0x837f('0x46')]['id']}})[_0x837f('0x26')](handleEntityNotFound(_0x4ade1b,null))[_0x837f('0x26')](removeEntity(_0x4ade1b,null))[_0x837f('0x45')](handleError(_0x4ade1b,null));}; \ No newline at end of file +var _0x151b=['catch','show','params','find','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','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','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x410b81,_0x871c4b){var _0x17e81e=function(_0x1106ac){while(--_0x1106ac){_0x410b81['push'](_0x410b81['shift']());}};_0x17e81e(++_0x871c4b);}(_0x151b,0x153));var _0xb151=function(_0x395b8c,_0x2d1268){_0x395b8c=_0x395b8c-0x0;var _0x30b664=_0x151b[_0x395b8c];return _0x30b664;};'use strict';var emlformat=require(_0xb151('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb151('0x1'));var rp=require('request-promise');var moment=require(_0xb151('0x2'));var BPromise=require(_0xb151('0x3'));var Mustache=require(_0xb151('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb151('0x5'));var csv=require(_0xb151('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb151('0x7'));var _=require('lodash');var squel=require(_0xb151('0x8'));var crypto=require(_0xb151('0x9'));var jsforce=require(_0xb151('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb151('0xb'));var Papa=require(_0xb151('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb151('0xd'));var as=require(_0xb151('0xe'));var hardwareService=require(_0xb151('0xf'));var logger=require(_0xb151('0x10'))(_0xb151('0x11'));var utils=require(_0xb151('0x12'));var config=require(_0xb151('0x13'));var licenseUtil=require(_0xb151('0x14'));var db=require(_0xb151('0x15'))['db'];function respondWithStatusCode(_0x143fbd,_0x4e54ca){_0x4e54ca=_0x4e54ca||0xcc;return function(_0x1ae9b4){if(_0x1ae9b4){return _0x143fbd['sendStatus'](_0x4e54ca);}return _0x143fbd[_0xb151('0x16')](_0x4e54ca)[_0xb151('0x17')]();};}function respondWithResult(_0x27f878,_0xfd071d){_0xfd071d=_0xfd071d||0xc8;return function(_0x4af767){if(_0x4af767){return _0x27f878[_0xb151('0x16')](_0xfd071d)[_0xb151('0x18')](_0x4af767);}};}function respondWithFilteredResult(_0x3df79d,_0x5b12e5){return function(_0x56ea81){if(_0x56ea81){var _0x5b2faa=typeof _0x5b12e5['offset']===_0xb151('0x19')&&typeof _0x5b12e5['limit']===_0xb151('0x19');var _0x4b21c0=_0x56ea81['count'];var _0x35aa2f=_0x5b2faa?0x0:_0x5b12e5[_0xb151('0x1a')];var _0x2ca10b=_0x5b2faa?_0x56ea81[_0xb151('0x1b')]:_0x5b12e5[_0xb151('0x1a')]+_0x5b12e5[_0xb151('0x1c')];var _0x1e2b38;if(_0x2ca10b>=_0x4b21c0){_0x2ca10b=_0x4b21c0;_0x1e2b38=0xc8;}else{_0x1e2b38=0xce;}_0x3df79d['status'](_0x1e2b38);return _0x3df79d[_0xb151('0x1d')](_0xb151('0x1e'),_0x35aa2f+'-'+_0x2ca10b+'/'+_0x4b21c0)['json'](_0x56ea81);}return null;};}function patchUpdates(_0x1fe113){return function(_0x22b1cd){try{jsonpatch[_0xb151('0x1f')](_0x22b1cd,_0x1fe113,!![]);}catch(_0x3a211a){return BPromise[_0xb151('0x20')](_0x3a211a);}return _0x22b1cd[_0xb151('0x21')]();};}function saveUpdates(_0x3f375d,_0x8ab45){return function(_0x49c2e){if(_0x49c2e){return _0x49c2e[_0xb151('0x22')](_0x3f375d)['then'](function(_0x432dce){return _0x432dce;});}return null;};}function removeEntity(_0x23cb48,_0x37768a){return function(_0x41c508){if(_0x41c508){return _0x41c508[_0xb151('0x23')]()[_0xb151('0x24')](function(){var _0xd22ee1=_0x41c508[_0xb151('0x25')]({'plain':!![]});var _0x31f1a7='ChanSpies';return db[_0xb151('0x26')][_0xb151('0x23')]({'where':{'type':_0x31f1a7,'resourceId':_0xd22ee1['id']}})[_0xb151('0x24')](function(){return _0x41c508;});})[_0xb151('0x24')](function(){_0x23cb48[_0xb151('0x16')](0xcc)[_0xb151('0x17')]();});}};}function handleEntityNotFound(_0x46f28c,_0x2dc1b4){return function(_0x5b6f83){if(!_0x5b6f83){_0x46f28c[_0xb151('0x27')](0x194);}return _0x5b6f83;};}function handleError(_0x51e156,_0x20ff34){_0x20ff34=_0x20ff34||0x1f4;return function(_0x32c933){logger['error'](_0x32c933[_0xb151('0x28')]);if(_0x32c933['name']){delete _0x32c933[_0xb151('0x29')];}_0x51e156[_0xb151('0x16')](_0x20ff34)[_0xb151('0x2a')](_0x32c933);};}exports[_0xb151('0x2b')]=function(_0x3ed573,_0x444af1){var _0x3d070b={},_0x3a9389={},_0x51acd7={'count':0x0,'rows':[]};var _0x37722e=_[_0xb151('0x2c')](db[_0xb151('0x2d')][_0xb151('0x2e')],function(_0x940cdf){return{'name':_0x940cdf[_0xb151('0x2f')],'type':_0x940cdf[_0xb151('0x30')]['key']};});_0x3a9389[_0xb151('0x31')]=_[_0xb151('0x2c')](_0x37722e,_0xb151('0x29'));_0x3a9389[_0xb151('0x32')]=_[_0xb151('0x33')](_0x3ed573['query']);_0x3a9389['filters']=_[_0xb151('0x34')](_0x3a9389[_0xb151('0x31')],_0x3a9389[_0xb151('0x32')]);_0x3d070b[_0xb151('0x35')]=_['intersection'](_0x3a9389[_0xb151('0x31')],qs['fields'](_0x3ed573[_0xb151('0x32')][_0xb151('0x36')]));_0x3d070b[_0xb151('0x35')]=_0x3d070b[_0xb151('0x35')][_0xb151('0x37')]?_0x3d070b[_0xb151('0x35')]:_0x3a9389[_0xb151('0x31')];if(!_0x3ed573[_0xb151('0x32')][_0xb151('0x38')](_0xb151('0x39'))){_0x3d070b[_0xb151('0x1c')]=qs['limit'](_0x3ed573[_0xb151('0x32')][_0xb151('0x1c')]);_0x3d070b[_0xb151('0x1a')]=qs['offset'](_0x3ed573[_0xb151('0x32')][_0xb151('0x1a')]);}_0x3d070b[_0xb151('0x3a')]=qs[_0xb151('0x3b')](_0x3ed573[_0xb151('0x32')][_0xb151('0x3b')]);_0x3d070b[_0xb151('0x3c')]=qs[_0xb151('0x3d')](_[_0xb151('0x3e')](_0x3ed573[_0xb151('0x32')],_0x3a9389[_0xb151('0x3d')]),_0x37722e);if(_0x3ed573['query'][_0xb151('0x3f')]){_0x3d070b['where']=_[_0xb151('0x40')](_0x3d070b[_0xb151('0x3c')],{'$or':_[_0xb151('0x2c')](_0x37722e,function(_0x38558c){if(_0x38558c[_0xb151('0x30')]!==_0xb151('0x41')){var _0x88a7={};_0x88a7[_0x38558c['name']]={'$like':'%'+_0x3ed573[_0xb151('0x32')][_0xb151('0x3f')]+'%'};return _0x88a7;}})});}_0x3d070b=_[_0xb151('0x40')]({},_0x3d070b,_0x3ed573[_0xb151('0x42')]);var _0x802eba={'where':_0x3d070b[_0xb151('0x3c')]};return db[_0xb151('0x2d')][_0xb151('0x1b')](_0x802eba)[_0xb151('0x24')](function(_0x3c8533){_0x51acd7[_0xb151('0x1b')]=_0x3c8533;if(_0x3ed573[_0xb151('0x32')][_0xb151('0x43')]){_0x3d070b[_0xb151('0x44')]=[{'all':!![]}];}return db[_0xb151('0x2d')][_0xb151('0x45')](_0x3d070b);})[_0xb151('0x24')](function(_0x4075bf){_0x51acd7[_0xb151('0x46')]=_0x4075bf;return _0x51acd7;})[_0xb151('0x24')](respondWithFilteredResult(_0x444af1,_0x3d070b))[_0xb151('0x47')](handleError(_0x444af1,null));};exports[_0xb151('0x48')]=function(_0x272eb5,_0x214df7){var _0x4ae517={'raw':![],'where':{'id':_0x272eb5[_0xb151('0x49')]['id']}},_0x434693={};_0x434693[_0xb151('0x31')]=_[_0xb151('0x33')](db[_0xb151('0x2d')][_0xb151('0x2e')]);_0x434693['query']=_[_0xb151('0x33')](_0x272eb5[_0xb151('0x32')]);_0x434693[_0xb151('0x3d')]=_[_0xb151('0x34')](_0x434693[_0xb151('0x31')],_0x434693[_0xb151('0x32')]);_0x4ae517[_0xb151('0x35')]=_[_0xb151('0x34')](_0x434693[_0xb151('0x31')],qs[_0xb151('0x36')](_0x272eb5['query'][_0xb151('0x36')]));_0x4ae517['attributes']=_0x4ae517[_0xb151('0x35')][_0xb151('0x37')]?_0x4ae517[_0xb151('0x35')]:_0x434693['model'];if(_0x272eb5[_0xb151('0x32')]['includeAll']){_0x4ae517[_0xb151('0x44')]=[{'all':!![]}];}_0x4ae517=_[_0xb151('0x40')]({},_0x4ae517,_0x272eb5[_0xb151('0x42')]);return db[_0xb151('0x2d')][_0xb151('0x4a')](_0x4ae517)['then'](handleEntityNotFound(_0x214df7,null))[_0xb151('0x24')](respondWithResult(_0x214df7,null))['catch'](handleError(_0x214df7,null));};exports[_0xb151('0x4b')]=function(_0x3c9ce1,_0x964b2b){return db[_0xb151('0x2d')]['create'](_0x3c9ce1[_0xb151('0x4c')],{})[_0xb151('0x24')](function(_0x438597){var _0x2cb92c=_0x3c9ce1['user'][_0xb151('0x25')]({'plain':!![]});if(!_0x2cb92c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cb92c[_0xb151('0x4d')]===_0xb151('0x4e')){var _0x433df2=_0x438597[_0xb151('0x25')]({'plain':!![]});var _0x211e0c='ChanSpies';return db['UserProfileSection'][_0xb151('0x4a')]({'where':{'name':_0x211e0c,'userProfileId':_0x2cb92c[_0xb151('0x4f')]},'raw':!![]})[_0xb151('0x24')](function(_0x26a13d){if(_0x26a13d&&_0x26a13d[_0xb151('0x50')]===0x0){return db['UserProfileResource'][_0xb151('0x4b')]({'name':_0x433df2['name'],'resourceId':_0x433df2['id'],'type':_0x26a13d[_0xb151('0x29')],'sectionId':_0x26a13d['id']},{})['then'](function(){return _0x438597;});}else{return _0x438597;}})[_0xb151('0x47')](function(_0x21c382){logger['error'](_0xb151('0x51'),_0x21c382);throw _0x21c382;});}return _0x438597;})[_0xb151('0x24')](respondWithResult(_0x964b2b,0xc9))[_0xb151('0x47')](handleError(_0x964b2b,null));};exports[_0xb151('0x22')]=function(_0x2e4389,_0x68746e){if(_0x2e4389['body']['id']){delete _0x2e4389['body']['id'];}return db['VoiceChanSpy'][_0xb151('0x4a')]({'where':{'id':_0x2e4389[_0xb151('0x49')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x68746e,null))[_0xb151('0x24')](saveUpdates(_0x2e4389[_0xb151('0x4c')],null))['then'](respondWithResult(_0x68746e,null))[_0xb151('0x47')](handleError(_0x68746e,null));};exports['destroy']=function(_0x4d5644,_0x43a2bf){return db[_0xb151('0x2d')]['find']({'where':{'id':_0x4d5644['params']['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x43a2bf,null))[_0xb151('0x24')](removeEntity(_0x43a2bf,null))[_0xb151('0x47')](handleError(_0x43a2bf,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 0b15bcc..4a8a9c8 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 _0x879c=['${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','StopMixMonitor','concat','internal','User','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','length','bulkCreate','VoiceExtension','destroy','util','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor'];(function(_0x31c17b,_0x3a9f5a){var _0x3159cc=function(_0xd4fffb){while(--_0xd4fffb){_0x31c17b['push'](_0x31c17b['shift']());}};_0x3159cc(++_0x3a9f5a);}(_0x879c,0x148));var _0xc879=function(_0x372a92,_0x5f50be){_0x372a92=_0x372a92-0x0;var _0x27ea6d=_0x879c[_0x372a92];return _0x27ea6d;};'use strict';var _=require('lodash');var util=require(_0xc879('0x0'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2461c3,_0x2df74e,_0x59af72){var _0x407e66=0x1;var _0x32559b=[];var _0x4d9b89={'context':_0x2df74e[_0xc879('0x1')]||_0xc879('0x2'),'exten':util[_0xc879('0x3')](_0xc879('0x4'),_0x2461c3[_0xc879('0x5')],_0x59af72),'type':_0xc879('0x6'),'isApp':![],'ChanSpyId':_0x2461c3['id'],'UserId':_0x2df74e['id']};_0x32559b[_0xc879('0x7')](_[_0xc879('0x8')]({'app':_0xc879('0x9'),'appdata':util[_0xc879('0x3')](_0xc879('0xa'),_0xc879('0xb')),'priority':_0x407e66++},_0x4d9b89));if(_0x2461c3[_0xc879('0xc')]){_0x32559b[_0xc879('0x7')](_['merge']({'app':_0xc879('0xd'),'appdata':util[_0xc879('0x3')](_0xc879('0xe'),_0x2461c3[_0xc879('0xf')]),'priority':_0x407e66++},_0x4d9b89));}if(_0x2461c3[_0xc879('0x10')]){_0x32559b[_0xc879('0x7')](_['merge']({'app':_0xc879('0x11'),'appdata':_0x2461c3[_0xc879('0x12')],'priority':_0x407e66++},_0x4d9b89));}_0x32559b[_0xc879('0x7')](_[_0xc879('0x8')]({'app':_0xc879('0x13'),'appdata':util[_0xc879('0x3')]('SIP/%s,%s',_0x2df74e[_0xc879('0x14')],_0x2461c3[_0xc879('0x15')]?_0x2461c3['options']['join'](''):''),'priority':_0x407e66++},_0x4d9b89));if(_0x2461c3[_0xc879('0xc')]){_0x32559b['push'](_[_0xc879('0x8')]({'app':_0xc879('0x16'),'priority':_0x407e66++},_0x4d9b89));}return _0x32559b;};var getChanSpyApplications=function(_0x2f628e,_0x477286){var _0x46ccee=[];for(var _0x7da1d0=0x0,_0x518c65=0x1;_0x7da1d0<_0x477286['length'];_0x7da1d0++,_0x518c65=0x1){_0x46ccee=_0x46ccee[_0xc879('0x17')](getUserApplications(_0x2f628e,_0x477286[_0x7da1d0],_0x477286[_0x7da1d0][_0xc879('0x18')]));if(_0x477286[_0x7da1d0]['internal']!=_0x477286[_0x7da1d0][_0xc879('0x14')]){_0x46ccee=_0x46ccee[_0xc879('0x17')](getUserApplications(_0x2f628e,_0x477286[_0x7da1d0],_0x477286[_0x7da1d0][_0xc879('0x14')]));}}return _0x46ccee;};var getChanSpyPromise=function(_0x414747,_0x307338){return new BPromise(function(_0xe3f69d,_0x544bae){return _0x414747[_0xc879('0x19')]['findAll']({'attributes':['id','name',_0xc879('0x18')],'where':{'role':_0xc879('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x400dc7){if(_0x400dc7){return _0xe3f69d(getChanSpyApplications(_0x307338,_0x400dc7));}return _0xe3f69d([]);})[_0xc879('0x1b')](function(_0x3606f3){_0x544bae(_0x3606f3);});});};module[_0xc879('0x1c')]=function(_0x3e904c,_0x762cba){var _0x492e2f=_0x3e904c[_0xc879('0x1d')];return _0x3e904c[_0xc879('0x1e')](_0xc879('0x1f'),attributes,{'tableName':_0xc879('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48c5b0,_0x489e8e,_0x32ba55){return getChanSpyPromise(_0x492e2f,_0x48c5b0)[_0xc879('0x21')](function(_0x570334){if(_0x570334&&_0x570334[_0xc879('0x22')]){return _0x492e2f['VoiceExtension'][_0xc879('0x23')](_0x570334);}})['then'](function(){_0x32ba55();})[_0xc879('0x1b')](function(_0x560a0c){_0x32ba55(_0x560a0c);});},'afterUpdate':function(_0x256b6b,_0x1312bc,_0x1501d9){return _0x492e2f[_0xc879('0x24')][_0xc879('0x25')]({'where':{'ChanSpyId':_0x256b6b['id']}})[_0xc879('0x21')](function(){return getChanSpyPromise(_0x492e2f,_0x256b6b);})[_0xc879('0x21')](function(_0x55b355){if(_0x55b355&&_0x55b355[_0xc879('0x22')]){return _0x492e2f[_0xc879('0x24')][_0xc879('0x23')](_0x55b355);}})[_0xc879('0x21')](function(){_0x1501d9();})[_0xc879('0x1b')](function(_0xaf1e99){_0x1501d9(_0xaf1e99);});},'afterDestroy':function(_0x3b4bb9,_0x50adcc,_0x11cd7f){return _0x492e2f[_0xc879('0x24')][_0xc879('0x25')]({'where':{'ChanSpyId':_0x3b4bb9['id']}})[_0xc879('0x21')](function(){_0x11cd7f();})['catch'](function(_0x9fdb89){_0x11cd7f(_0x9fdb89);});}}});}; \ No newline at end of file +var _0xd57d=['concat','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','util','bluebird','./voiceChanSpy.attributes','context','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','SIP/%s,%s','options','join','StopMixMonitor','length','internal','name'];(function(_0x578376,_0x34ba03){var _0x1e25b5=function(_0x254579){while(--_0x254579){_0x578376['push'](_0x578376['shift']());}};_0x1e25b5(++_0x34ba03);}(_0xd57d,0x17d));var _0xdd57=function(_0x480c9b,_0x1d717a){_0x480c9b=_0x480c9b-0x0;var _0x4f219d=_0xd57d[_0x480c9b];return _0x4f219d;};'use strict';var _=require('lodash');var util=require(_0xdd57('0x0'));var BPromise=require(_0xdd57('0x1'));var attributes=require(_0xdd57('0x2'));var getUserApplications=function(_0x21dc57,_0x2185f0,_0x366e89){var _0x276307=0x1;var _0x22a9ca=[];var _0x191def={'context':_0x2185f0[_0xdd57('0x3')]||'from-sip','exten':util['format'](_0xdd57('0x4'),_0x21dc57[_0xdd57('0x5')],_0x366e89),'type':_0xdd57('0x6'),'isApp':![],'ChanSpyId':_0x21dc57['id'],'UserId':_0x2185f0['id']};_0x22a9ca[_0xdd57('0x7')](_[_0xdd57('0x8')]({'app':_0xdd57('0x9'),'appdata':util[_0xdd57('0xa')](_0xdd57('0xb'),_0xdd57('0xc')),'priority':_0x276307++},_0x191def));if(_0x21dc57[_0xdd57('0xd')]){_0x22a9ca['push'](_[_0xdd57('0x8')]({'app':_0xdd57('0xe'),'appdata':util[_0xdd57('0xa')](_0xdd57('0xf'),_0x21dc57[_0xdd57('0x10')]),'priority':_0x276307++},_0x191def));}if(_0x21dc57['auth']){_0x22a9ca[_0xdd57('0x7')](_[_0xdd57('0x8')]({'app':_0xdd57('0x11'),'appdata':_0x21dc57[_0xdd57('0x12')],'priority':_0x276307++},_0x191def));}_0x22a9ca[_0xdd57('0x7')](_[_0xdd57('0x8')]({'app':'ChanSpy','appdata':util[_0xdd57('0xa')](_0xdd57('0x13'),_0x2185f0['name'],_0x21dc57['options']?_0x21dc57[_0xdd57('0x14')][_0xdd57('0x15')](''):''),'priority':_0x276307++},_0x191def));if(_0x21dc57[_0xdd57('0xd')]){_0x22a9ca['push'](_[_0xdd57('0x8')]({'app':_0xdd57('0x16'),'priority':_0x276307++},_0x191def));}return _0x22a9ca;};var getChanSpyApplications=function(_0x49dc7a,_0x5d8048){var _0x473fbd=[];for(var _0x4aa1a0=0x0,_0x446a50=0x1;_0x4aa1a0<_0x5d8048[_0xdd57('0x17')];_0x4aa1a0++,_0x446a50=0x1){_0x473fbd=_0x473fbd['concat'](getUserApplications(_0x49dc7a,_0x5d8048[_0x4aa1a0],_0x5d8048[_0x4aa1a0][_0xdd57('0x18')]));if(_0x5d8048[_0x4aa1a0][_0xdd57('0x18')]!=_0x5d8048[_0x4aa1a0][_0xdd57('0x19')]){_0x473fbd=_0x473fbd[_0xdd57('0x1a')](getUserApplications(_0x49dc7a,_0x5d8048[_0x4aa1a0],_0x5d8048[_0x4aa1a0][_0xdd57('0x19')]));}}return _0x473fbd;};var getChanSpyPromise=function(_0x1dab29,_0x342c84){return new BPromise(function(_0x1ca8ff,_0xe093c5){return _0x1dab29['User']['findAll']({'attributes':['id',_0xdd57('0x19'),'internal'],'where':{'role':_0xdd57('0x1b'),'chanspy':!![]},'raw':!![]})[_0xdd57('0x1c')](function(_0x253404){if(_0x253404){return _0x1ca8ff(getChanSpyApplications(_0x342c84,_0x253404));}return _0x1ca8ff([]);})[_0xdd57('0x1d')](function(_0x235a6d){_0xe093c5(_0x235a6d);});});};module[_0xdd57('0x1e')]=function(_0x394e8c,_0x2fb16c){var _0x39d870=_0x394e8c[_0xdd57('0x1f')];return _0x394e8c['define'](_0xdd57('0x20'),attributes,{'tableName':_0xdd57('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fff60,_0x5c59f2,_0x4b6557){return getChanSpyPromise(_0x39d870,_0x4fff60)[_0xdd57('0x1c')](function(_0x2602c9){if(_0x2602c9&&_0x2602c9[_0xdd57('0x17')]){return _0x39d870['VoiceExtension'][_0xdd57('0x22')](_0x2602c9);}})[_0xdd57('0x1c')](function(){_0x4b6557();})[_0xdd57('0x1d')](function(_0xedeb35){_0x4b6557(_0xedeb35);});},'afterUpdate':function(_0x33ac41,_0x440365,_0x298041){return _0x39d870[_0xdd57('0x23')][_0xdd57('0x24')]({'where':{'ChanSpyId':_0x33ac41['id']}})[_0xdd57('0x1c')](function(){return getChanSpyPromise(_0x39d870,_0x33ac41);})[_0xdd57('0x1c')](function(_0x177203){if(_0x177203&&_0x177203[_0xdd57('0x17')]){return _0x39d870[_0xdd57('0x23')]['bulkCreate'](_0x177203);}})['then'](function(){_0x298041();})[_0xdd57('0x1d')](function(_0x394aab){_0x298041(_0x394aab);});},'afterDestroy':function(_0x659d77,_0x5cd931,_0x4ee62f){return _0x39d870['VoiceExtension'][_0xdd57('0x24')]({'where':{'ChanSpyId':_0x659d77['id']}})[_0xdd57('0x1c')](function(){_0x4ee62f();})[_0xdd57('0x1d')](function(_0x5569c1){_0x4ee62f(_0x5569c1);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a90bd71..7e22786 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 _0xee5b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','ioredis'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2431ac,_0x551ea6){_0x2431ac=_0x2431ac-0x0;var _0x336591=_0xee5b[_0x2431ac];return _0x336591;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});} \ No newline at end of file +var _0xa74f=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0xa74f,0x9a));var _0xfa74=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0xa74f[_0x2b1551];return _0x2fc2a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 184afa7..42f0ced 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 _0xcd92=['../../config/environment','get','isAuthenticated','/:id','create','put','update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0xcd92,0x108));var _0x2cd9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xcd92[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x2cd9('0x0'));var path=require('path');var timeout=require(_0x2cd9('0x1'));var express=require(_0x2cd9('0x2'));var router=express[_0x2cd9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2cd9('0x4'));var interaction=require(_0x2cd9('0x5'));var config=require(_0x2cd9('0x6'));var controller=require('./voiceContext.controller');router[_0x2cd9('0x7')]('/',auth[_0x2cd9('0x8')](),controller['index']);router[_0x2cd9('0x7')](_0x2cd9('0x9'),auth[_0x2cd9('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2cd9('0xa')]);router[_0x2cd9('0xb')](_0x2cd9('0x9'),auth[_0x2cd9('0x8')](),controller[_0x2cd9('0xc')]);router['delete'](_0x2cd9('0x9'),auth[_0x2cd9('0x8')](),controller[_0x2cd9('0xd')]);module[_0x2cd9('0xe')]=router; \ No newline at end of file +var _0x7054=['index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get'];(function(_0x4b0f25,_0x45dd0c){var _0x4676b8=function(_0x27dbf5){while(--_0x27dbf5){_0x4b0f25['push'](_0x4b0f25['shift']());}};_0x4676b8(++_0x45dd0c);}(_0x7054,0x184));var _0x4705=function(_0x27ab8c,_0x42376a){_0x27ab8c=_0x27ab8c-0x0;var _0x1e65dc=_0x7054[_0x27ab8c];return _0x1e65dc;};'use strict';var multer=require(_0x4705('0x0'));var util=require(_0x4705('0x1'));var path=require(_0x4705('0x2'));var timeout=require(_0x4705('0x3'));var express=require('express');var router=express[_0x4705('0x4')]();var fs_extra=require(_0x4705('0x5'));var auth=require(_0x4705('0x6'));var interaction=require(_0x4705('0x7'));var config=require(_0x4705('0x8'));var controller=require(_0x4705('0x9'));router[_0x4705('0xa')]('/',auth['isAuthenticated'](),controller[_0x4705('0xb')]);router['get'](_0x4705('0xc'),auth[_0x4705('0xd')](),controller[_0x4705('0xe')]);router['post']('/',auth[_0x4705('0xd')](),controller[_0x4705('0xf')]);router[_0x4705('0x10')](_0x4705('0xc'),auth[_0x4705('0xd')](),controller[_0x4705('0x11')]);router[_0x4705('0x12')](_0x4705('0xc'),auth[_0x4705('0xd')](),controller[_0x4705('0x13')]);module[_0x4705('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 75a4bd7..14064d5 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 _0x934a=['STRING','BOOLEAN','exports'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x934a,0x110));var _0xa934=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0x934a[_0x5c14f6];return _0x4949b3;};'use strict';var Sequelize=require('sequelize');module[_0xa934('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xa934('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa934('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x14fa=['STRING','name','exports'];(function(_0x665870,_0x42ab57){var _0x317721=function(_0x1f3792){while(--_0x1f3792){_0x665870['push'](_0x665870['shift']());}};_0x317721(++_0x42ab57);}(_0x14fa,0x1e2));var _0xa14f=function(_0x4d0481,_0x33b81e){_0x4d0481=_0x4d0481-0x0;var _0x1956d4=_0x14fa[_0x4d0481];return _0x1956d4;};'use strict';var Sequelize=require('sequelize');module[_0xa14f('0x0')]={'name':{'type':Sequelize[_0xa14f('0x1')],'unique':_0xa14f('0x2')},'description':{'type':Sequelize[_0xa14f('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index fea8da9..0a6f12e 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 _0x8ce7=['error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','get','Contexts','UserProfileResource','destroy','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceContext','count','includeAll','include','findAll','rows','show','params','keys','length','options','find','create','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','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','body','utf8','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x273305,_0x57815f){var _0x12cf22=function(_0x308154){while(--_0x308154){_0x273305['push'](_0x273305['shift']());}};_0x12cf22(++_0x57815f);}(_0x8ce7,0xbb));var _0x78ce=function(_0x39323c,_0x9ac777){_0x39323c=_0x39323c-0x0;var _0x2b8bf0=_0x8ce7[_0x39323c];return _0x2b8bf0;};'use strict';var emlformat=require(_0x78ce('0x0'));var rimraf=require(_0x78ce('0x1'));var zipdir=require(_0x78ce('0x2'));var jsonpatch=require(_0x78ce('0x3'));var rp=require(_0x78ce('0x4'));var moment=require(_0x78ce('0x5'));var BPromise=require(_0x78ce('0x6'));var Mustache=require(_0x78ce('0x7'));var util=require(_0x78ce('0x8'));var path=require('path');var sox=require(_0x78ce('0x9'));var csv=require(_0x78ce('0xa'));var ejs=require(_0x78ce('0xb'));var fs=require('fs');var fs_extra=require(_0x78ce('0xc'));var _=require(_0x78ce('0xd'));var squel=require(_0x78ce('0xe'));var crypto=require(_0x78ce('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x78ce('0x10'));var toCsv=require(_0x78ce('0xa'));var querystring=require('querystring');var Papa=require(_0x78ce('0x11'));var Redis=require('ioredis');var authService=require(_0x78ce('0x12'));var qs=require(_0x78ce('0x13'));var as=require(_0x78ce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78ce('0x15'))(_0x78ce('0x16'));var utils=require(_0x78ce('0x17'));var config=require(_0x78ce('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x78ce('0x19'))['db'];var jayson=require(_0x78ce('0x1a'));var client=jayson[_0x78ce('0x1b')][_0x78ce('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4fb897,_0x4b1371,_0x5c99b2,_0x57f4af){return new BPromise(function(_0x3a6a64,_0x1c7b60){var _0x3eb7d5=_0x57f4af||client;return _0x3eb7d5[_0x78ce('0x1d')](_0x4fb897,_0x5c99b2)['then'](function(_0x5e3e74){logger[_0x78ce('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x4b1371,_0x78ce('0x1f'));logger[_0x78ce('0x20')](_0x78ce('0x21'),_0x4b1371,'request\x20sent',JSON[_0x78ce('0x22')](_0x5e3e74));if(_0x5e3e74[_0x78ce('0x23')]){if(_0x5e3e74['error'][_0x78ce('0x24')]===0x1f4){logger[_0x78ce('0x23')](_0x78ce('0x25'),_0x4b1371,_0x5e3e74['error'][_0x78ce('0x26')]);return _0x1c7b60(_0x5e3e74[_0x78ce('0x23')][_0x78ce('0x26')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x4b1371,_0x5e3e74[_0x78ce('0x23')][_0x78ce('0x26')]);return _0x3a6a64(_0x5e3e74[_0x78ce('0x23')][_0x78ce('0x26')]);}else{logger[_0x78ce('0x1e')](_0x78ce('0x25'),_0x4b1371,'request\x20sent');_0x3a6a64(_0x5e3e74[_0x78ce('0x27')]['message']);}})[_0x78ce('0x28')](function(_0x284c1f){logger[_0x78ce('0x23')]('VoiceContext,\x20%s,\x20%s',_0x4b1371,_0x284c1f);_0x1c7b60(_0x284c1f);});});}function respondWithStatusCode(_0x172df5,_0x5904b5){_0x5904b5=_0x5904b5||0xcc;return function(_0x4e21fb){if(_0x4e21fb){return _0x172df5[_0x78ce('0x29')](_0x5904b5);}return _0x172df5[_0x78ce('0x2a')](_0x5904b5)[_0x78ce('0x2b')]();};}function respondWithResult(_0x1b0a7e,_0x506729){_0x506729=_0x506729||0xc8;return function(_0x2cdcb0){if(_0x2cdcb0){return _0x1b0a7e[_0x78ce('0x2a')](_0x506729)['json'](_0x2cdcb0);}};}function respondWithFilteredResult(_0x4d4d5e,_0x3f8e61){return function(_0x50b75b){if(_0x50b75b){var _0x2bbe4f=typeof _0x3f8e61[_0x78ce('0x2c')]===_0x78ce('0x2d')&&typeof _0x3f8e61[_0x78ce('0x2e')]===_0x78ce('0x2d');var _0x1ec2c5=_0x50b75b['count'];var _0x21101d=_0x2bbe4f?0x0:_0x3f8e61[_0x78ce('0x2c')];var _0x1e694a=_0x2bbe4f?_0x50b75b['count']:_0x3f8e61[_0x78ce('0x2c')]+_0x3f8e61[_0x78ce('0x2e')];var _0x841889;if(_0x1e694a>=_0x1ec2c5){_0x1e694a=_0x1ec2c5;_0x841889=0xc8;}else{_0x841889=0xce;}_0x4d4d5e[_0x78ce('0x2a')](_0x841889);return _0x4d4d5e[_0x78ce('0x2f')](_0x78ce('0x30'),_0x21101d+'-'+_0x1e694a+'/'+_0x1ec2c5)[_0x78ce('0x31')](_0x50b75b);}return null;};}function patchUpdates(_0x273321){return function(_0x43e447){try{jsonpatch[_0x78ce('0x32')](_0x43e447,_0x273321,!![]);}catch(_0x129824){return BPromise[_0x78ce('0x33')](_0x129824);}return _0x43e447[_0x78ce('0x34')]();};}function saveUpdates(_0xac17cb,_0x38c512){return function(_0x27bf2d){if(_0x27bf2d){return _0x27bf2d[_0x78ce('0x35')](_0xac17cb)[_0x78ce('0x36')](function(_0x331522){return _0x331522;});}return null;};}function removeEntity(_0x33999e,_0x2078f8){return function(_0x4605e0){if(_0x4605e0){return _0x4605e0['destroy']()[_0x78ce('0x36')](function(){var _0x5247ba=_0x4605e0[_0x78ce('0x37')]({'plain':!![]});var _0x196e08=_0x78ce('0x38');return db[_0x78ce('0x39')][_0x78ce('0x3a')]({'where':{'type':_0x196e08,'resourceId':_0x5247ba['id']}})[_0x78ce('0x36')](function(){return _0x4605e0;});})[_0x78ce('0x36')](function(){_0x33999e['status'](0xcc)[_0x78ce('0x2b')]();});}};}function handleEntityNotFound(_0x1be188,_0x2c4cac){return function(_0x8bd8d4){if(!_0x8bd8d4){_0x1be188[_0x78ce('0x29')](0x194);}return _0x8bd8d4;};}function handleError(_0xa8e787,_0x329e8e){_0x329e8e=_0x329e8e||0x1f4;return function(_0x476356){logger[_0x78ce('0x23')](_0x476356[_0x78ce('0x3b')]);if(_0x476356['name']){delete _0x476356['name'];}_0xa8e787[_0x78ce('0x2a')](_0x329e8e)['send'](_0x476356);};}exports[_0x78ce('0x3c')]=function(_0x5d996a,_0x535c45){var _0x5324d8={},_0x147bb6={},_0x11805d={'count':0x0,'rows':[]};var _0x50cf2c=_[_0x78ce('0x3d')](db['VoiceContext'][_0x78ce('0x3e')],function(_0x2ac2d7){return{'name':_0x2ac2d7[_0x78ce('0x3f')],'type':_0x2ac2d7[_0x78ce('0x40')][_0x78ce('0x41')]};});_0x147bb6[_0x78ce('0x42')]=_[_0x78ce('0x3d')](_0x50cf2c,_0x78ce('0x43'));_0x147bb6[_0x78ce('0x44')]=_['keys'](_0x5d996a[_0x78ce('0x44')]);_0x147bb6[_0x78ce('0x45')]=_[_0x78ce('0x46')](_0x147bb6[_0x78ce('0x42')],_0x147bb6[_0x78ce('0x44')]);_0x5324d8['attributes']=_[_0x78ce('0x46')](_0x147bb6[_0x78ce('0x42')],qs[_0x78ce('0x47')](_0x5d996a[_0x78ce('0x44')][_0x78ce('0x47')]));_0x5324d8[_0x78ce('0x48')]=_0x5324d8[_0x78ce('0x48')]['length']?_0x5324d8[_0x78ce('0x48')]:_0x147bb6[_0x78ce('0x42')];if(!_0x5d996a[_0x78ce('0x44')][_0x78ce('0x49')](_0x78ce('0x4a'))){_0x5324d8['limit']=qs[_0x78ce('0x2e')](_0x5d996a[_0x78ce('0x44')][_0x78ce('0x2e')]);_0x5324d8[_0x78ce('0x2c')]=qs[_0x78ce('0x2c')](_0x5d996a[_0x78ce('0x44')][_0x78ce('0x2c')]);}_0x5324d8[_0x78ce('0x4b')]=qs[_0x78ce('0x4c')](_0x5d996a[_0x78ce('0x44')]['sort']);_0x5324d8[_0x78ce('0x4d')]=qs['filters'](_['pick'](_0x5d996a['query'],_0x147bb6[_0x78ce('0x45')]),_0x50cf2c);if(_0x5d996a[_0x78ce('0x44')][_0x78ce('0x4e')]){_0x5324d8[_0x78ce('0x4d')]=_[_0x78ce('0x4f')](_0x5324d8['where'],{'$or':_[_0x78ce('0x3d')](_0x50cf2c,function(_0x1787ce){if(_0x1787ce['type']!==_0x78ce('0x50')){var _0x3f05cd={};_0x3f05cd[_0x1787ce[_0x78ce('0x43')]]={'$like':'%'+_0x5d996a['query'][_0x78ce('0x4e')]+'%'};return _0x3f05cd;}})});}_0x5324d8=_['merge']({},_0x5324d8,_0x5d996a['options']);var _0x28cf3d={'where':_0x5324d8[_0x78ce('0x4d')]};return db[_0x78ce('0x51')][_0x78ce('0x52')](_0x28cf3d)['then'](function(_0x2718f7){_0x11805d[_0x78ce('0x52')]=_0x2718f7;if(_0x5d996a[_0x78ce('0x44')][_0x78ce('0x53')]){_0x5324d8[_0x78ce('0x54')]=[{'all':!![]}];}return db[_0x78ce('0x51')][_0x78ce('0x55')](_0x5324d8);})[_0x78ce('0x36')](function(_0x1535d7){_0x11805d[_0x78ce('0x56')]=_0x1535d7;return _0x11805d;})[_0x78ce('0x36')](respondWithFilteredResult(_0x535c45,_0x5324d8))[_0x78ce('0x28')](handleError(_0x535c45,null));};exports[_0x78ce('0x57')]=function(_0x2721cd,_0x11f7e8){var _0x332b93={'raw':![],'where':{'id':_0x2721cd[_0x78ce('0x58')]['id']}},_0xf5dda8={};_0xf5dda8['model']=_[_0x78ce('0x59')](db[_0x78ce('0x51')][_0x78ce('0x3e')]);_0xf5dda8[_0x78ce('0x44')]=_[_0x78ce('0x59')](_0x2721cd['query']);_0xf5dda8[_0x78ce('0x45')]=_[_0x78ce('0x46')](_0xf5dda8[_0x78ce('0x42')],_0xf5dda8[_0x78ce('0x44')]);_0x332b93[_0x78ce('0x48')]=_['intersection'](_0xf5dda8[_0x78ce('0x42')],qs[_0x78ce('0x47')](_0x2721cd[_0x78ce('0x44')]['fields']));_0x332b93[_0x78ce('0x48')]=_0x332b93[_0x78ce('0x48')][_0x78ce('0x5a')]?_0x332b93['attributes']:_0xf5dda8['model'];if(_0x2721cd[_0x78ce('0x44')][_0x78ce('0x53')]){_0x332b93[_0x78ce('0x54')]=[{'all':!![]}];}_0x332b93=_[_0x78ce('0x4f')]({},_0x332b93,_0x2721cd[_0x78ce('0x5b')]);return db[_0x78ce('0x51')][_0x78ce('0x5c')](_0x332b93)[_0x78ce('0x36')](handleEntityNotFound(_0x11f7e8,null))[_0x78ce('0x36')](respondWithResult(_0x11f7e8,null))[_0x78ce('0x28')](handleError(_0x11f7e8,null));};exports['create']=function(_0x235bc9,_0x569f5d,_0x11db76){var _0x131043;return db[_0x78ce('0x51')][_0x78ce('0x5d')](_0x235bc9['body'],{'raw':!![]})[_0x78ce('0x36')](function(_0x101621){_0x131043=_0x101621;return db[_0x78ce('0x51')][_0x78ce('0x55')]({'raw':!![]});})[_0x78ce('0x36')](function(_0x2fd904){var _0x38da99=fs[_0x78ce('0x5e')](path[_0x78ce('0x5f')](config[_0x78ce('0x60')],'server/files/templates/context.ejs'),'utf8');var _0x235e37=ejs[_0x78ce('0x61')](_0x38da99,{'contexts':_0x2fd904||[]});fs[_0x78ce('0x62')](_0x78ce('0x63'),_0x235e37);})[_0x78ce('0x36')](function(){return respondWithRpcPromise('Reload',_0x78ce('0x5d'),{'module':_0x78ce('0x64')});})[_0x78ce('0x36')](function(){var _0x1ea03e=_0x235bc9[_0x78ce('0x65')][_0x78ce('0x37')]({'plain':!![]});if(!_0x1ea03e)throw new Error(_0x78ce('0x66'));if(_0x1ea03e[_0x78ce('0x67')]==='user'){var _0x31159b=_0x131043['get']({'plain':!![]});return db[_0x78ce('0x68')][_0x78ce('0x5c')]({'where':{'name':_0x78ce('0x38'),'userProfileId':_0x1ea03e[_0x78ce('0x69')]},'raw':!![]})[_0x78ce('0x36')](function(_0x2cc827){if(_0x2cc827&&_0x2cc827[_0x78ce('0x6a')]===0x0){return db[_0x78ce('0x39')][_0x78ce('0x5d')]({'name':_0x31159b[_0x78ce('0x43')],'resourceId':_0x31159b['id'],'type':_0x2cc827[_0x78ce('0x43')],'sectionId':_0x2cc827['id']},{})[_0x78ce('0x36')](function(){return _0x131043;});}else{return _0x131043;}})['catch'](function(_0x1a8b6c){logger['error'](_0x78ce('0x6b'),_0x1a8b6c);throw _0x1a8b6c;});}return _0x131043;})['then'](respondWithResult(_0x569f5d,0xc9))[_0x78ce('0x28')](handleError(_0x569f5d,null));};exports[_0x78ce('0x35')]=function(_0x43c281,_0x1eac5b,_0x31f829){var _0x1826a6;return db[_0x78ce('0x51')][_0x78ce('0x5c')]({'where':{'id':_0x43c281['params']['id']}})['then'](handleEntityNotFound(_0x1eac5b,null))[_0x78ce('0x36')](saveUpdates(_0x43c281[_0x78ce('0x6c')],null))[_0x78ce('0x36')](function(_0x3bac92){if(_0x3bac92){_0x1826a6=_0x3bac92;return db[_0x78ce('0x51')][_0x78ce('0x55')]({'raw':!![]});}})[_0x78ce('0x36')](function(_0x569a57){var _0x344c05=fs[_0x78ce('0x5e')](path[_0x78ce('0x5f')](config['root'],'server/files/templates/context.ejs'),_0x78ce('0x6d'));var _0x3bdca9=ejs[_0x78ce('0x61')](_0x344c05,{'contexts':_0x569a57||[]});fs[_0x78ce('0x62')](_0x78ce('0x63'),_0x3bdca9);})[_0x78ce('0x36')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x78ce('0x64')});})[_0x78ce('0x36')](function(){return _0x1826a6;})['then'](respondWithResult(_0x1eac5b,null))[_0x78ce('0x28')](handleError(_0x1eac5b,null));};exports[_0x78ce('0x3a')]=function(_0xae5096,_0x527196,_0x1df263){var _0x44015d;return db[_0x78ce('0x51')][_0x78ce('0x5c')]({'where':{'id':_0xae5096[_0x78ce('0x58')]['id']}})[_0x78ce('0x36')](handleEntityNotFound(_0x527196,null))[_0x78ce('0x36')](removeEntity(_0x527196,null))[_0x78ce('0x36')](function(){return db[_0x78ce('0x51')][_0x78ce('0x55')]({'raw':!![]});})[_0x78ce('0x36')](function(_0x489191){var _0xde6e1d=fs[_0x78ce('0x5e')](path[_0x78ce('0x5f')](config['root'],_0x78ce('0x6e')),_0x78ce('0x6d'));var _0x230c29=ejs[_0x78ce('0x61')](_0xde6e1d,{'contexts':_0x489191});fs[_0x78ce('0x62')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x230c29);return respondWithRpcPromise('Reload','destroy',{'module':_0x78ce('0x64')});})['catch'](handleError(_0x527196,null));}; \ No newline at end of file +var _0xba90=['then','get','Contexts','UserProfileResource','sendStatus','stack','send','index','rawAttributes','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','type','VIRTUAL','options','includeAll','include','VoiceContext','findAll','rows','params','find','create','body','readFileSync','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','writeFileSync','Reload','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','offset','undefined','limit','count','set','json','apply','reject','update','destroy'];(function(_0x1ecb07,_0xa0a664){var _0x27d8bf=function(_0x80d388){while(--_0x80d388){_0x1ecb07['push'](_0x1ecb07['shift']());}};_0x27d8bf(++_0xa0a664);}(_0xba90,0x9a));var _0x0ba9=function(_0x4c2d1f,_0x10871e){_0x4c2d1f=_0x4c2d1f-0x0;var _0x11364f=_0xba90[_0x4c2d1f];return _0x11364f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ba9('0x0'));var zipdir=require(_0x0ba9('0x1'));var jsonpatch=require(_0x0ba9('0x2'));var rp=require(_0x0ba9('0x3'));var moment=require(_0x0ba9('0x4'));var BPromise=require(_0x0ba9('0x5'));var Mustache=require(_0x0ba9('0x6'));var util=require(_0x0ba9('0x7'));var path=require('path');var sox=require(_0x0ba9('0x8'));var csv=require(_0x0ba9('0x9'));var ejs=require(_0x0ba9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ba9('0xb'));var squel=require(_0x0ba9('0xc'));var crypto=require(_0x0ba9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0ba9('0xe'));var toCsv=require(_0x0ba9('0x9'));var querystring=require('querystring');var Papa=require(_0x0ba9('0xf'));var Redis=require('ioredis');var authService=require(_0x0ba9('0x10'));var qs=require(_0x0ba9('0x11'));var as=require(_0x0ba9('0x12'));var hardwareService=require(_0x0ba9('0x13'));var logger=require(_0x0ba9('0x14'))('api');var utils=require(_0x0ba9('0x15'));var config=require(_0x0ba9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ba9('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x0ba9('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1d9004,_0x2284aa,_0x2476c0,_0x256149){return new BPromise(function(_0xa152fb,_0x5098c7){var _0x243288=_0x256149||client;return _0x243288[_0x0ba9('0x19')](_0x1d9004,_0x2476c0)['then'](function(_0x25fb3e){logger[_0x0ba9('0x1a')](_0x0ba9('0x1b'),_0x2284aa,_0x0ba9('0x1c'));logger[_0x0ba9('0x1d')](_0x0ba9('0x1e'),_0x2284aa,'request\x20sent',JSON[_0x0ba9('0x1f')](_0x25fb3e));if(_0x25fb3e[_0x0ba9('0x20')]){if(_0x25fb3e[_0x0ba9('0x20')][_0x0ba9('0x21')]===0x1f4){logger[_0x0ba9('0x20')](_0x0ba9('0x1b'),_0x2284aa,_0x25fb3e[_0x0ba9('0x20')][_0x0ba9('0x22')]);return _0x5098c7(_0x25fb3e['error']['message']);}logger[_0x0ba9('0x20')](_0x0ba9('0x1b'),_0x2284aa,_0x25fb3e[_0x0ba9('0x20')]['message']);return _0xa152fb(_0x25fb3e[_0x0ba9('0x20')][_0x0ba9('0x22')]);}else{logger['info'](_0x0ba9('0x1b'),_0x2284aa,_0x0ba9('0x1c'));_0xa152fb(_0x25fb3e['result'][_0x0ba9('0x22')]);}})[_0x0ba9('0x23')](function(_0x26cc05){logger[_0x0ba9('0x20')]('VoiceContext,\x20%s,\x20%s',_0x2284aa,_0x26cc05);_0x5098c7(_0x26cc05);});});}function respondWithStatusCode(_0x3bc96d,_0x1392ac){_0x1392ac=_0x1392ac||0xcc;return function(_0x270049){if(_0x270049){return _0x3bc96d['sendStatus'](_0x1392ac);}return _0x3bc96d[_0x0ba9('0x24')](_0x1392ac)[_0x0ba9('0x25')]();};}function respondWithResult(_0x9a5dcd,_0x440197){_0x440197=_0x440197||0xc8;return function(_0x3afa99){if(_0x3afa99){return _0x9a5dcd[_0x0ba9('0x24')](_0x440197)['json'](_0x3afa99);}};}function respondWithFilteredResult(_0x29e0a0,_0x3f6edb){return function(_0x1b4556){if(_0x1b4556){var _0x245481=typeof _0x3f6edb[_0x0ba9('0x26')]===_0x0ba9('0x27')&&typeof _0x3f6edb[_0x0ba9('0x28')]===_0x0ba9('0x27');var _0xb4f107=_0x1b4556[_0x0ba9('0x29')];var _0x2bb71b=_0x245481?0x0:_0x3f6edb['offset'];var _0x2ce888=_0x245481?_0x1b4556[_0x0ba9('0x29')]:_0x3f6edb[_0x0ba9('0x26')]+_0x3f6edb[_0x0ba9('0x28')];var _0x1a8701;if(_0x2ce888>=_0xb4f107){_0x2ce888=_0xb4f107;_0x1a8701=0xc8;}else{_0x1a8701=0xce;}_0x29e0a0[_0x0ba9('0x24')](_0x1a8701);return _0x29e0a0[_0x0ba9('0x2a')]('Content-Range',_0x2bb71b+'-'+_0x2ce888+'/'+_0xb4f107)[_0x0ba9('0x2b')](_0x1b4556);}return null;};}function patchUpdates(_0x3b0bd4){return function(_0x2d8194){try{jsonpatch[_0x0ba9('0x2c')](_0x2d8194,_0x3b0bd4,!![]);}catch(_0x14a383){return BPromise[_0x0ba9('0x2d')](_0x14a383);}return _0x2d8194['save']();};}function saveUpdates(_0x1b8de8,_0x3b79d2){return function(_0x148965){if(_0x148965){return _0x148965[_0x0ba9('0x2e')](_0x1b8de8)['then'](function(_0x2f85dc){return _0x2f85dc;});}return null;};}function removeEntity(_0x27484a,_0x4bfacc){return function(_0x362ea4){if(_0x362ea4){return _0x362ea4[_0x0ba9('0x2f')]()[_0x0ba9('0x30')](function(){var _0x31dd64=_0x362ea4[_0x0ba9('0x31')]({'plain':!![]});var _0xebd051=_0x0ba9('0x32');return db[_0x0ba9('0x33')][_0x0ba9('0x2f')]({'where':{'type':_0xebd051,'resourceId':_0x31dd64['id']}})[_0x0ba9('0x30')](function(){return _0x362ea4;});})['then'](function(){_0x27484a['status'](0xcc)[_0x0ba9('0x25')]();});}};}function handleEntityNotFound(_0x492643,_0x17e4c3){return function(_0x3ad48e){if(!_0x3ad48e){_0x492643[_0x0ba9('0x34')](0x194);}return _0x3ad48e;};}function handleError(_0x106ac8,_0x1c553c){_0x1c553c=_0x1c553c||0x1f4;return function(_0x142452){logger[_0x0ba9('0x20')](_0x142452[_0x0ba9('0x35')]);if(_0x142452['name']){delete _0x142452['name'];}_0x106ac8[_0x0ba9('0x24')](_0x1c553c)[_0x0ba9('0x36')](_0x142452);};}exports[_0x0ba9('0x37')]=function(_0x2577fd,_0x44f378){var _0xa1c549={},_0x43bbb3={},_0x32a6fc={'count':0x0,'rows':[]};var _0x5e7710=_['map'](db['VoiceContext'][_0x0ba9('0x38')],function(_0x592ae0){return{'name':_0x592ae0['fieldName'],'type':_0x592ae0['type']['key']};});_0x43bbb3[_0x0ba9('0x39')]=_[_0x0ba9('0x3a')](_0x5e7710,_0x0ba9('0x3b'));_0x43bbb3[_0x0ba9('0x3c')]=_[_0x0ba9('0x3d')](_0x2577fd[_0x0ba9('0x3c')]);_0x43bbb3['filters']=_[_0x0ba9('0x3e')](_0x43bbb3[_0x0ba9('0x39')],_0x43bbb3[_0x0ba9('0x3c')]);_0xa1c549[_0x0ba9('0x3f')]=_[_0x0ba9('0x3e')](_0x43bbb3[_0x0ba9('0x39')],qs['fields'](_0x2577fd['query'][_0x0ba9('0x40')]));_0xa1c549[_0x0ba9('0x3f')]=_0xa1c549['attributes'][_0x0ba9('0x41')]?_0xa1c549[_0x0ba9('0x3f')]:_0x43bbb3[_0x0ba9('0x39')];if(!_0x2577fd['query'][_0x0ba9('0x42')]('nolimit')){_0xa1c549[_0x0ba9('0x28')]=qs['limit'](_0x2577fd[_0x0ba9('0x3c')][_0x0ba9('0x28')]);_0xa1c549[_0x0ba9('0x26')]=qs[_0x0ba9('0x26')](_0x2577fd[_0x0ba9('0x3c')][_0x0ba9('0x26')]);}_0xa1c549[_0x0ba9('0x43')]=qs['sort'](_0x2577fd['query'][_0x0ba9('0x44')]);_0xa1c549[_0x0ba9('0x45')]=qs['filters'](_[_0x0ba9('0x46')](_0x2577fd[_0x0ba9('0x3c')],_0x43bbb3[_0x0ba9('0x47')]),_0x5e7710);if(_0x2577fd[_0x0ba9('0x3c')]['filter']){_0xa1c549[_0x0ba9('0x45')]=_[_0x0ba9('0x48')](_0xa1c549[_0x0ba9('0x45')],{'$or':_[_0x0ba9('0x3a')](_0x5e7710,function(_0x1260e9){if(_0x1260e9[_0x0ba9('0x49')]!==_0x0ba9('0x4a')){var _0x480302={};_0x480302[_0x1260e9[_0x0ba9('0x3b')]]={'$like':'%'+_0x2577fd[_0x0ba9('0x3c')]['filter']+'%'};return _0x480302;}})});}_0xa1c549=_['merge']({},_0xa1c549,_0x2577fd[_0x0ba9('0x4b')]);var _0x324df3={'where':_0xa1c549[_0x0ba9('0x45')]};return db['VoiceContext'][_0x0ba9('0x29')](_0x324df3)[_0x0ba9('0x30')](function(_0x4ba532){_0x32a6fc[_0x0ba9('0x29')]=_0x4ba532;if(_0x2577fd[_0x0ba9('0x3c')][_0x0ba9('0x4c')]){_0xa1c549[_0x0ba9('0x4d')]=[{'all':!![]}];}return db[_0x0ba9('0x4e')][_0x0ba9('0x4f')](_0xa1c549);})['then'](function(_0x2d78c0){_0x32a6fc[_0x0ba9('0x50')]=_0x2d78c0;return _0x32a6fc;})[_0x0ba9('0x30')](respondWithFilteredResult(_0x44f378,_0xa1c549))[_0x0ba9('0x23')](handleError(_0x44f378,null));};exports['show']=function(_0x4d72ab,_0x2440ff){var _0x2abd9b={'raw':![],'where':{'id':_0x4d72ab[_0x0ba9('0x51')]['id']}},_0x280f42={};_0x280f42[_0x0ba9('0x39')]=_['keys'](db['VoiceContext'][_0x0ba9('0x38')]);_0x280f42[_0x0ba9('0x3c')]=_['keys'](_0x4d72ab[_0x0ba9('0x3c')]);_0x280f42[_0x0ba9('0x47')]=_['intersection'](_0x280f42[_0x0ba9('0x39')],_0x280f42[_0x0ba9('0x3c')]);_0x2abd9b[_0x0ba9('0x3f')]=_[_0x0ba9('0x3e')](_0x280f42[_0x0ba9('0x39')],qs['fields'](_0x4d72ab['query']['fields']));_0x2abd9b[_0x0ba9('0x3f')]=_0x2abd9b[_0x0ba9('0x3f')][_0x0ba9('0x41')]?_0x2abd9b['attributes']:_0x280f42[_0x0ba9('0x39')];if(_0x4d72ab[_0x0ba9('0x3c')][_0x0ba9('0x4c')]){_0x2abd9b[_0x0ba9('0x4d')]=[{'all':!![]}];}_0x2abd9b=_[_0x0ba9('0x48')]({},_0x2abd9b,_0x4d72ab[_0x0ba9('0x4b')]);return db[_0x0ba9('0x4e')][_0x0ba9('0x52')](_0x2abd9b)['then'](handleEntityNotFound(_0x2440ff,null))['then'](respondWithResult(_0x2440ff,null))[_0x0ba9('0x23')](handleError(_0x2440ff,null));};exports[_0x0ba9('0x53')]=function(_0x303bc8,_0x1808a4,_0x13bf5f){var _0x1b2a6b;return db[_0x0ba9('0x4e')]['create'](_0x303bc8[_0x0ba9('0x54')],{'raw':!![]})['then'](function(_0x19eb95){_0x1b2a6b=_0x19eb95;return db[_0x0ba9('0x4e')][_0x0ba9('0x4f')]({'raw':!![]});})[_0x0ba9('0x30')](function(_0x50f0fd){var _0x27ae87=fs[_0x0ba9('0x55')](path['join'](config['root'],_0x0ba9('0x56')),_0x0ba9('0x57'));var _0x225a46=ejs[_0x0ba9('0x58')](_0x27ae87,{'contexts':_0x50f0fd||[]});fs['writeFileSync'](_0x0ba9('0x59'),_0x225a46);})[_0x0ba9('0x30')](function(){return respondWithRpcPromise('Reload',_0x0ba9('0x53'),{'module':_0x0ba9('0x5a')});})[_0x0ba9('0x30')](function(){var _0xa9fc1f=_0x303bc8[_0x0ba9('0x5b')]['get']({'plain':!![]});if(!_0xa9fc1f)throw new Error(_0x0ba9('0x5c'));if(_0xa9fc1f[_0x0ba9('0x5d')]===_0x0ba9('0x5b')){var _0x4cf8ae=_0x1b2a6b['get']({'plain':!![]});return db['UserProfileSection'][_0x0ba9('0x52')]({'where':{'name':'Contexts','userProfileId':_0xa9fc1f[_0x0ba9('0x5e')]},'raw':!![]})[_0x0ba9('0x30')](function(_0x329dc0){if(_0x329dc0&&_0x329dc0[_0x0ba9('0x5f')]===0x0){return db[_0x0ba9('0x33')]['create']({'name':_0x4cf8ae[_0x0ba9('0x3b')],'resourceId':_0x4cf8ae['id'],'type':_0x329dc0[_0x0ba9('0x3b')],'sectionId':_0x329dc0['id']},{})['then'](function(){return _0x1b2a6b;});}else{return _0x1b2a6b;}})[_0x0ba9('0x23')](function(_0x599ca5){logger['error'](_0x0ba9('0x60'),_0x599ca5);throw _0x599ca5;});}return _0x1b2a6b;})[_0x0ba9('0x30')](respondWithResult(_0x1808a4,0xc9))[_0x0ba9('0x23')](handleError(_0x1808a4,null));};exports['update']=function(_0x27caaa,_0x8124f7,_0x25a160){var _0x2a477d;return db[_0x0ba9('0x4e')][_0x0ba9('0x52')]({'where':{'id':_0x27caaa[_0x0ba9('0x51')]['id']}})['then'](handleEntityNotFound(_0x8124f7,null))['then'](saveUpdates(_0x27caaa[_0x0ba9('0x54')],null))[_0x0ba9('0x30')](function(_0x820ca){if(_0x820ca){_0x2a477d=_0x820ca;return db[_0x0ba9('0x4e')][_0x0ba9('0x4f')]({'raw':!![]});}})[_0x0ba9('0x30')](function(_0x4c2ee5){var _0x36e95c=fs[_0x0ba9('0x55')](path['join'](config[_0x0ba9('0x61')],_0x0ba9('0x56')),'utf8');var _0x13e1b8=ejs[_0x0ba9('0x58')](_0x36e95c,{'contexts':_0x4c2ee5||[]});fs[_0x0ba9('0x62')](_0x0ba9('0x59'),_0x13e1b8);})[_0x0ba9('0x30')](function(){return respondWithRpcPromise(_0x0ba9('0x63'),_0x0ba9('0x2e'),{'module':'chan_sip.so'});})[_0x0ba9('0x30')](function(){return _0x2a477d;})[_0x0ba9('0x30')](respondWithResult(_0x8124f7,null))[_0x0ba9('0x23')](handleError(_0x8124f7,null));};exports[_0x0ba9('0x2f')]=function(_0x378695,_0x107f01,_0x59586d){var _0x2ad7fe;return db[_0x0ba9('0x4e')][_0x0ba9('0x52')]({'where':{'id':_0x378695['params']['id']}})[_0x0ba9('0x30')](handleEntityNotFound(_0x107f01,null))[_0x0ba9('0x30')](removeEntity(_0x107f01,null))[_0x0ba9('0x30')](function(){return db[_0x0ba9('0x4e')][_0x0ba9('0x4f')]({'raw':!![]});})['then'](function(_0x2ff85a){var _0x580f35=fs['readFileSync'](path[_0x0ba9('0x64')](config[_0x0ba9('0x61')],_0x0ba9('0x56')),_0x0ba9('0x57'));var _0x28e90a=ejs[_0x0ba9('0x58')](_0x580f35,{'contexts':_0x2ff85a});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x28e90a);return respondWithRpcPromise('Reload',_0x0ba9('0x2f'),{'module':'chan_sip.so'});})[_0x0ba9('0x23')](handleError(_0x107f01,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1d8997a..f83cbb9 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 _0x261b=['exports','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x3c90cb,_0x173140){var _0x536654=function(_0x3eabb9){while(--_0x3eabb9){_0x3c90cb['push'](_0x3c90cb['shift']());}};_0x536654(++_0x173140);}(_0x261b,0x93));var _0xb261=function(_0x4855c6,_0x5bbdbb){_0x4855c6=_0x4855c6-0x0;var _0x188e81=_0x261b[_0x4855c6];return _0x188e81;};'use strict';var _=require(_0xb261('0x0'));var util=require(_0xb261('0x1'));var logger=require(_0xb261('0x2'))(_0xb261('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb261('0x4'));var fs=require('fs');var path=require(_0xb261('0x5'));var rimraf=require(_0xb261('0x6'));var config=require(_0xb261('0x7'));var attributes=require(_0xb261('0x8'));module[_0xb261('0x9')]=function(_0x1716dd,_0x3728aa){return _0x1716dd['define'](_0xb261('0xa'),attributes,{'tableName':_0xb261('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8651=['define','VoiceContext','voice_contexts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a4492,_0x54456f){var _0x698257=function(_0x5dfccd){while(--_0x5dfccd){_0x2a4492['push'](_0x2a4492['shift']());}};_0x698257(++_0x54456f);}(_0x8651,0x142));var _0x1865=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x8651[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0x1865('0x0'));var logger=require(_0x1865('0x1'))('api');var moment=require(_0x1865('0x2'));var BPromise=require(_0x1865('0x3'));var rp=require(_0x1865('0x4'));var fs=require('fs');var path=require(_0x1865('0x5'));var rimraf=require(_0x1865('0x6'));var config=require(_0x1865('0x7'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x5b7418,_0x1da723){return _0x5b7418[_0x1865('0x8')](_0x1865('0x9'),attributes,{'tableName':_0x1865('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 336d25d..fe0b9ff 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 _0x62c0=['request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x2a2dc5,_0x41d63c){var _0x3d8e98=function(_0x30f08c){while(--_0x30f08c){_0x2a2dc5['push'](_0x2a2dc5['shift']());}};_0x3d8e98(++_0x41d63c);}(_0x62c0,0xdb));var _0x062c=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x62c0[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x062c('0x0'));var util=require(_0x062c('0x1'));var moment=require(_0x062c('0x2'));var BPromise=require(_0x062c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x062c('0x4'));var logger=require('../../config/logger')(_0x062c('0x5'));var config=require(_0x062c('0x6'));var jayson=require(_0x062c('0x7'));var client=jayson['client'][_0x062c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16ef08,_0x5885a6,_0x398f50){return new BPromise(function(_0x47c929,_0x15312a){return client[_0x062c('0x9')](_0x16ef08,_0x398f50)[_0x062c('0xa')](function(_0x3dfecd){logger[_0x062c('0xb')](_0x062c('0xc'),_0x5885a6,_0x062c('0xd'));logger['debug'](_0x062c('0xe'),_0x5885a6,_0x062c('0xd'),JSON[_0x062c('0xf')](_0x3dfecd));if(_0x3dfecd[_0x062c('0x10')]){if(_0x3dfecd['error']['code']===0x1f4){logger[_0x062c('0x10')](_0x062c('0xc'),_0x5885a6,_0x3dfecd[_0x062c('0x10')]['message']);return _0x15312a(_0x3dfecd[_0x062c('0x10')]['message']);}logger[_0x062c('0x10')](_0x062c('0xc'),_0x5885a6,_0x3dfecd[_0x062c('0x10')][_0x062c('0x11')]);return _0x47c929(_0x3dfecd[_0x062c('0x10')][_0x062c('0x11')]);}else{logger['info'](_0x062c('0xc'),_0x5885a6,_0x062c('0xd'));_0x47c929(_0x3dfecd['result']['message']);}})[_0x062c('0x12')](function(_0x778fb3){logger[_0x062c('0x10')](_0x062c('0xc'),_0x5885a6,_0x778fb3);_0x15312a(_0x778fb3);});});} \ No newline at end of file +var _0xdfaa=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','rpc','jayson/promise','client','http','request','then'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0xdfaa,0xa5));var _0xadfa=function(_0x12cd5d,_0x4234cc){_0x12cd5d=_0x12cd5d-0x0;var _0x29d38b=_0xdfaa[_0x12cd5d];return _0x29d38b;};'use strict';var _=require(_0xadfa('0x0'));var util=require(_0xadfa('0x1'));var moment=require(_0xadfa('0x2'));var BPromise=require(_0xadfa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadfa('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xadfa('0x5'));var config=require('../../config/environment');var jayson=require(_0xadfa('0x6'));var client=jayson[_0xadfa('0x7')][_0xadfa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x512702,_0x168806,_0x2da7eb){return new BPromise(function(_0x47904b,_0x396c91){return client[_0xadfa('0x9')](_0x512702,_0x2da7eb)[_0xadfa('0xa')](function(_0x3d4b6f){logger[_0xadfa('0xb')](_0xadfa('0xc'),_0x168806,_0xadfa('0xd'));logger[_0xadfa('0xe')](_0xadfa('0xf'),_0x168806,_0xadfa('0xd'),JSON[_0xadfa('0x10')](_0x3d4b6f));if(_0x3d4b6f['error']){if(_0x3d4b6f[_0xadfa('0x11')][_0xadfa('0x12')]===0x1f4){logger[_0xadfa('0x11')](_0xadfa('0xc'),_0x168806,_0x3d4b6f['error']['message']);return _0x396c91(_0x3d4b6f[_0xadfa('0x11')][_0xadfa('0x13')]);}logger[_0xadfa('0x11')](_0xadfa('0xc'),_0x168806,_0x3d4b6f['error'][_0xadfa('0x13')]);return _0x47904b(_0x3d4b6f[_0xadfa('0x11')][_0xadfa('0x13')]);}else{logger[_0xadfa('0xb')](_0xadfa('0xc'),_0x168806,'request\x20sent');_0x47904b(_0x3d4b6f[_0xadfa('0x14')][_0xadfa('0x13')]);}})[_0xadfa('0x15')](function(_0x4188c9){logger[_0xadfa('0x11')]('VoiceContext,\x20%s,\x20%s',_0x168806,_0x4188c9);_0x396c91(_0x4188c9);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 420e0c1..1507bae 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 _0xae11=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','put','delete','exports','multer'];(function(_0x221049,_0x3a07ea){var _0x33711d=function(_0x57f11e){while(--_0x57f11e){_0x221049['push'](_0x221049['shift']());}};_0x33711d(++_0x3a07ea);}(_0xae11,0x1c1));var _0x1ae1=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0xae11[_0x229128];return _0x1875b9;};'use strict';var multer=require(_0x1ae1('0x0'));var util=require(_0x1ae1('0x1'));var path=require(_0x1ae1('0x2'));var timeout=require(_0x1ae1('0x3'));var express=require(_0x1ae1('0x4'));var router=express[_0x1ae1('0x5')]();var fs_extra=require(_0x1ae1('0x6'));var auth=require(_0x1ae1('0x7'));var interaction=require(_0x1ae1('0x8'));var config=require(_0x1ae1('0x9'));var controller=require('./voiceDialReport.controller');router[_0x1ae1('0xa')]('/',auth[_0x1ae1('0xb')](),controller[_0x1ae1('0xc')]);router[_0x1ae1('0xa')]('/describe',auth[_0x1ae1('0xb')](),controller[_0x1ae1('0xd')]);router[_0x1ae1('0xa')](_0x1ae1('0xe'),auth[_0x1ae1('0xb')](),controller['show']);router['post']('/',auth[_0x1ae1('0xb')](),controller['create']);router[_0x1ae1('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1ae1('0x10')](_0x1ae1('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1ae1('0x11')]=router; \ No newline at end of file +var _0xa35d=['../../components/interaction/service','../../config/environment','./voiceDialReport.controller','index','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x595151,_0x1f1f72){var _0x5776df=function(_0x4930fa){while(--_0x4930fa){_0x595151['push'](_0x595151['shift']());}};_0x5776df(++_0x1f1f72);}(_0xa35d,0x11f));var _0xda35=function(_0x497b5c,_0x2a4c69){_0x497b5c=_0x497b5c-0x0;var _0x510283=_0xa35d[_0x497b5c];return _0x510283;};'use strict';var multer=require(_0xda35('0x0'));var util=require('util');var path=require(_0xda35('0x1'));var timeout=require(_0xda35('0x2'));var express=require(_0xda35('0x3'));var router=express[_0xda35('0x4')]();var fs_extra=require(_0xda35('0x5'));var auth=require(_0xda35('0x6'));var interaction=require(_0xda35('0x7'));var config=require(_0xda35('0x8'));var controller=require(_0xda35('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xda35('0xa')]);router[_0xda35('0xb')](_0xda35('0xc'),auth[_0xda35('0xd')](),controller['describe']);router[_0xda35('0xb')](_0xda35('0xe'),auth[_0xda35('0xd')](),controller[_0xda35('0xf')]);router[_0xda35('0x10')]('/',auth[_0xda35('0xd')](),controller[_0xda35('0x11')]);router['put']('/:id',auth[_0xda35('0xd')](),controller[_0xda35('0x12')]);router[_0xda35('0x13')](_0xda35('0xe'),auth[_0xda35('0xd')](),controller['destroy']);module[_0xda35('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0f26e64..a7a68d1 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 _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x2ed474,_0x685826){var _0x4be574=function(_0x51d21f){while(--_0x51d21f){_0x2ed474['push'](_0x2ed474['shift']());}};_0x4be574(++_0x685826);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xe66357,_0x585a1e){_0xe66357=_0xe66357-0x0;var _0x2dbf8f=_0x8d0e[_0xe66357];return _0x2dbf8f;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2c2aab,_0x234ba9){var _0x1e7e2c=function(_0x3658e4){while(--_0x3658e4){_0x2c2aab['push'](_0x2c2aab['shift']());}};_0x1e7e2c(++_0x234ba9);}(_0x34e8,0x12c));var _0x834e=function(_0x272e6b,_0x14d0f8){_0x272e6b=_0x272e6b-0x0;var _0x54c6e7=_0x34e8[_0x272e6b];return _0x54c6e7;};'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 diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 24c8689..5546eeb 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 _0xdf16=['type','key','keys','filters','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','count','include','findAll','rows','catch','show','rawAttributes','intersection','length','includeAll','options','create','body','find','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','VoiceDialReport','fieldName'];(function(_0x4d453c,_0x311b8c){var _0x4c80ac=function(_0x5548c0){while(--_0x5548c0){_0x4d453c['push'](_0x4d453c['shift']());}};_0x4c80ac(++_0x311b8c);}(_0xdf16,0x69));var _0x6df1=function(_0x42336d,_0x52728f){_0x42336d=_0x42336d-0x0;var _0x414428=_0xdf16[_0x42336d];return _0x414428;};'use strict';var emlformat=require(_0x6df1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6df1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6df1('0x2'));var moment=require(_0x6df1('0x3'));var BPromise=require(_0x6df1('0x4'));var Mustache=require(_0x6df1('0x5'));var util=require(_0x6df1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6df1('0x7'));var ejs=require(_0x6df1('0x8'));var fs=require('fs');var fs_extra=require(_0x6df1('0x9'));var _=require('lodash');var squel=require(_0x6df1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6df1('0xb'));var toCsv=require(_0x6df1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6df1('0xc'));var authService=require(_0x6df1('0xd'));var qs=require(_0x6df1('0xe'));var as=require(_0x6df1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6df1('0x10'));var utils=require(_0x6df1('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6df1('0x12'));var db=require(_0x6df1('0x13'))['db'];function respondWithStatusCode(_0x23bd17,_0x452147){_0x452147=_0x452147||0xcc;return function(_0x2527a7){if(_0x2527a7){return _0x23bd17['sendStatus'](_0x452147);}return _0x23bd17[_0x6df1('0x14')](_0x452147)[_0x6df1('0x15')]();};}function respondWithResult(_0x33513b,_0x230dc5){_0x230dc5=_0x230dc5||0xc8;return function(_0x32ed2d){if(_0x32ed2d){return _0x33513b[_0x6df1('0x14')](_0x230dc5)[_0x6df1('0x16')](_0x32ed2d);}};}function respondWithFilteredResult(_0xb7610f,_0x51c36e){return function(_0x48cb87){if(_0x48cb87){var _0x2d631f=typeof _0x51c36e[_0x6df1('0x17')]===_0x6df1('0x18')&&typeof _0x51c36e[_0x6df1('0x19')]===_0x6df1('0x18');var _0x86a77c=_0x48cb87['count'];var _0x43fb49=_0x2d631f?0x0:_0x51c36e[_0x6df1('0x17')];var _0x3027c8=_0x2d631f?_0x48cb87['count']:_0x51c36e['offset']+_0x51c36e['limit'];var _0x2771d2;if(_0x3027c8>=_0x86a77c){_0x3027c8=_0x86a77c;_0x2771d2=0xc8;}else{_0x2771d2=0xce;}_0xb7610f[_0x6df1('0x14')](_0x2771d2);return _0xb7610f['set'](_0x6df1('0x1a'),_0x43fb49+'-'+_0x3027c8+'/'+_0x86a77c)[_0x6df1('0x16')](_0x48cb87);}return null;};}function patchUpdates(_0x518ed0){return function(_0x124c38){try{jsonpatch[_0x6df1('0x1b')](_0x124c38,_0x518ed0,!![]);}catch(_0x2c8d83){return BPromise[_0x6df1('0x1c')](_0x2c8d83);}return _0x124c38['save']();};}function saveUpdates(_0x482788,_0x2e47cc){return function(_0x13f120){if(_0x13f120){return _0x13f120[_0x6df1('0x1d')](_0x482788)['then'](function(_0x77154e){return _0x77154e;});}return null;};}function removeEntity(_0x302bd5,_0x9bcced){return function(_0x1824f1){if(_0x1824f1){return _0x1824f1[_0x6df1('0x1e')]()[_0x6df1('0x1f')](function(){_0x302bd5[_0x6df1('0x14')](0xcc)[_0x6df1('0x15')]();});}};}function handleEntityNotFound(_0x5a246f,_0x4d5c81){return function(_0x125dcd){if(!_0x125dcd){_0x5a246f[_0x6df1('0x20')](0x194);}return _0x125dcd;};}function handleError(_0x4549b6,_0x3fcdb5){_0x3fcdb5=_0x3fcdb5||0x1f4;return function(_0x313482){logger['error'](_0x313482[_0x6df1('0x21')]);if(_0x313482[_0x6df1('0x22')]){delete _0x313482['name'];}_0x4549b6[_0x6df1('0x14')](_0x3fcdb5)[_0x6df1('0x23')](_0x313482);};}exports[_0x6df1('0x24')]=function(_0x113b61,_0x38c76e){var _0x3a9bf9={},_0x2e52ac={},_0x39ac0f={'count':0x0,'rows':[]};var _0x2f67db=_['map'](db[_0x6df1('0x25')]['rawAttributes'],function(_0x1c4122){return{'name':_0x1c4122[_0x6df1('0x26')],'type':_0x1c4122[_0x6df1('0x27')][_0x6df1('0x28')]};});_0x2e52ac['model']=_['map'](_0x2f67db,_0x6df1('0x22'));_0x2e52ac['query']=_[_0x6df1('0x29')](_0x113b61['query']);_0x2e52ac[_0x6df1('0x2a')]=_['intersection'](_0x2e52ac[_0x6df1('0x2b')],_0x2e52ac['query']);_0x3a9bf9['attributes']=_['intersection'](_0x2e52ac[_0x6df1('0x2b')],qs['fields'](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x2d')]));_0x3a9bf9[_0x6df1('0x2e')]=_0x3a9bf9[_0x6df1('0x2e')]['length']?_0x3a9bf9[_0x6df1('0x2e')]:_0x2e52ac[_0x6df1('0x2b')];if(!_0x113b61[_0x6df1('0x2c')][_0x6df1('0x2f')](_0x6df1('0x30'))){_0x3a9bf9[_0x6df1('0x19')]=qs[_0x6df1('0x19')](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x19')]);_0x3a9bf9[_0x6df1('0x17')]=qs['offset'](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x17')]);}_0x3a9bf9[_0x6df1('0x31')]=qs[_0x6df1('0x32')](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x32')]);_0x3a9bf9[_0x6df1('0x33')]=qs[_0x6df1('0x2a')](_[_0x6df1('0x34')](_0x113b61[_0x6df1('0x2c')],_0x2e52ac[_0x6df1('0x2a')]),_0x2f67db);if(_0x113b61['query']['filter']){_0x3a9bf9[_0x6df1('0x33')]=_[_0x6df1('0x35')](_0x3a9bf9[_0x6df1('0x33')],{'$or':_[_0x6df1('0x36')](_0x2f67db,function(_0x3a9365){if(_0x3a9365[_0x6df1('0x27')]!==_0x6df1('0x37')){var _0x366a62={};_0x366a62[_0x3a9365['name']]={'$like':'%'+_0x113b61[_0x6df1('0x2c')][_0x6df1('0x38')]+'%'};return _0x366a62;}})});}_0x3a9bf9=_[_0x6df1('0x35')]({},_0x3a9bf9,_0x113b61['options']);var _0x4dbc43={'where':_0x3a9bf9[_0x6df1('0x33')]};return db[_0x6df1('0x25')][_0x6df1('0x39')](_0x4dbc43)['then'](function(_0x2dfb43){_0x39ac0f[_0x6df1('0x39')]=_0x2dfb43;if(_0x113b61[_0x6df1('0x2c')]['includeAll']){_0x3a9bf9[_0x6df1('0x3a')]=[{'all':!![]}];}return db[_0x6df1('0x25')][_0x6df1('0x3b')](_0x3a9bf9);})[_0x6df1('0x1f')](function(_0xd91e5a){_0x39ac0f[_0x6df1('0x3c')]=_0xd91e5a;return _0x39ac0f;})[_0x6df1('0x1f')](respondWithFilteredResult(_0x38c76e,_0x3a9bf9))[_0x6df1('0x3d')](handleError(_0x38c76e,null));};exports[_0x6df1('0x3e')]=function(_0x587389,_0x3e5655){var _0x3afd08={'raw':!![],'where':{'id':_0x587389['params']['id']}},_0x1a3a4f={};_0x1a3a4f[_0x6df1('0x2b')]=_['keys'](db[_0x6df1('0x25')][_0x6df1('0x3f')]);_0x1a3a4f[_0x6df1('0x2c')]=_[_0x6df1('0x29')](_0x587389['query']);_0x1a3a4f['filters']=_[_0x6df1('0x40')](_0x1a3a4f[_0x6df1('0x2b')],_0x1a3a4f[_0x6df1('0x2c')]);_0x3afd08[_0x6df1('0x2e')]=_[_0x6df1('0x40')](_0x1a3a4f[_0x6df1('0x2b')],qs['fields'](_0x587389[_0x6df1('0x2c')][_0x6df1('0x2d')]));_0x3afd08[_0x6df1('0x2e')]=_0x3afd08[_0x6df1('0x2e')][_0x6df1('0x41')]?_0x3afd08['attributes']:_0x1a3a4f['model'];if(_0x587389[_0x6df1('0x2c')][_0x6df1('0x42')]){_0x3afd08['include']=[{'all':!![]}];}_0x3afd08=_[_0x6df1('0x35')]({},_0x3afd08,_0x587389[_0x6df1('0x43')]);return db[_0x6df1('0x25')]['find'](_0x3afd08)[_0x6df1('0x1f')](handleEntityNotFound(_0x3e5655,null))['then'](respondWithResult(_0x3e5655,null))['catch'](handleError(_0x3e5655,null));};exports['create']=function(_0x252621,_0x48b681){return db[_0x6df1('0x25')][_0x6df1('0x44')](_0x252621[_0x6df1('0x45')],{})['then'](respondWithResult(_0x48b681,0xc9))[_0x6df1('0x3d')](handleError(_0x48b681,null));};exports['update']=function(_0x271874,_0x10dc51){if(_0x271874[_0x6df1('0x45')]['id']){delete _0x271874['body']['id'];}return db[_0x6df1('0x25')][_0x6df1('0x46')]({'where':{'id':_0x271874[_0x6df1('0x47')]['id']}})['then'](handleEntityNotFound(_0x10dc51,null))[_0x6df1('0x1f')](saveUpdates(_0x271874[_0x6df1('0x45')],null))[_0x6df1('0x1f')](respondWithResult(_0x10dc51,null))[_0x6df1('0x3d')](handleError(_0x10dc51,null));};exports['destroy']=function(_0x409cf2,_0x208e29){return db[_0x6df1('0x25')]['find']({'where':{'id':_0x409cf2[_0x6df1('0x47')]['id']}})[_0x6df1('0x1f')](handleEntityNotFound(_0x208e29,null))[_0x6df1('0x1f')](removeEntity(_0x208e29,null))[_0x6df1('0x3d')](handleError(_0x208e29,null));};exports['describe']=function(_0x53b89f,_0x662b5b){return db[_0x6df1('0x25')]['describe']()['then'](respondWithResult(_0x662b5b,null))['catch'](handleError(_0x662b5b,null));}; \ No newline at end of file +var _0x249a=['body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','create'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x249a,0x1cb));var _0xa249=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x249a[_0xfa634c];return _0x73e478;};'use strict';var emlformat=require(_0xa249('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa249('0x1'));var jsonpatch=require(_0xa249('0x2'));var rp=require(_0xa249('0x3'));var moment=require(_0xa249('0x4'));var BPromise=require(_0xa249('0x5'));var Mustache=require(_0xa249('0x6'));var util=require('util');var path=require(_0xa249('0x7'));var sox=require('sox');var csv=require(_0xa249('0x8'));var ejs=require(_0xa249('0x9'));var fs=require('fs');var fs_extra=require(_0xa249('0xa'));var _=require(_0xa249('0xb'));var squel=require(_0xa249('0xc'));var crypto=require(_0xa249('0xd'));var jsforce=require(_0xa249('0xe'));var deskjs=require(_0xa249('0xf'));var toCsv=require(_0xa249('0x8'));var querystring=require(_0xa249('0x10'));var Papa=require(_0xa249('0x11'));var Redis=require(_0xa249('0x12'));var authService=require(_0xa249('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa249('0x14'));var hardwareService=require(_0xa249('0x15'));var logger=require(_0xa249('0x16'))(_0xa249('0x17'));var utils=require(_0xa249('0x18'));var config=require(_0xa249('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa249('0x1a'))['db'];function respondWithStatusCode(_0x51bec9,_0x49ae90){_0x49ae90=_0x49ae90||0xcc;return function(_0x2efcb0){if(_0x2efcb0){return _0x51bec9[_0xa249('0x1b')](_0x49ae90);}return _0x51bec9['status'](_0x49ae90)[_0xa249('0x1c')]();};}function respondWithResult(_0x15a244,_0x444d54){_0x444d54=_0x444d54||0xc8;return function(_0x46d4fe){if(_0x46d4fe){return _0x15a244[_0xa249('0x1d')](_0x444d54)[_0xa249('0x1e')](_0x46d4fe);}};}function respondWithFilteredResult(_0x87d2dd,_0x14727d){return function(_0x403cc2){if(_0x403cc2){var _0x394558=typeof _0x14727d[_0xa249('0x1f')]==='undefined'&&typeof _0x14727d[_0xa249('0x20')]===_0xa249('0x21');var _0x557f3f=_0x403cc2[_0xa249('0x22')];var _0xd06217=_0x394558?0x0:_0x14727d[_0xa249('0x1f')];var _0x309328=_0x394558?_0x403cc2['count']:_0x14727d[_0xa249('0x1f')]+_0x14727d['limit'];var _0x4c06dc;if(_0x309328>=_0x557f3f){_0x309328=_0x557f3f;_0x4c06dc=0xc8;}else{_0x4c06dc=0xce;}_0x87d2dd[_0xa249('0x1d')](_0x4c06dc);return _0x87d2dd[_0xa249('0x23')](_0xa249('0x24'),_0xd06217+'-'+_0x309328+'/'+_0x557f3f)[_0xa249('0x1e')](_0x403cc2);}return null;};}function patchUpdates(_0x38b368){return function(_0x106a12){try{jsonpatch[_0xa249('0x25')](_0x106a12,_0x38b368,!![]);}catch(_0x265825){return BPromise[_0xa249('0x26')](_0x265825);}return _0x106a12[_0xa249('0x27')]();};}function saveUpdates(_0x4aae56,_0x255fd1){return function(_0x1d4c6d){if(_0x1d4c6d){return _0x1d4c6d[_0xa249('0x28')](_0x4aae56)[_0xa249('0x29')](function(_0x1dc580){return _0x1dc580;});}return null;};}function removeEntity(_0x1d4bf4,_0x31bcf7){return function(_0x2215b3){if(_0x2215b3){return _0x2215b3[_0xa249('0x2a')]()[_0xa249('0x29')](function(){_0x1d4bf4[_0xa249('0x1d')](0xcc)[_0xa249('0x1c')]();});}};}function handleEntityNotFound(_0x464c5a,_0x9ea6){return function(_0x3a5c63){if(!_0x3a5c63){_0x464c5a['sendStatus'](0x194);}return _0x3a5c63;};}function handleError(_0x19c865,_0x2d92fc){_0x2d92fc=_0x2d92fc||0x1f4;return function(_0x6d4a5a){logger[_0xa249('0x2b')](_0x6d4a5a['stack']);if(_0x6d4a5a['name']){delete _0x6d4a5a[_0xa249('0x2c')];}_0x19c865[_0xa249('0x1d')](_0x2d92fc)[_0xa249('0x2d')](_0x6d4a5a);};}exports[_0xa249('0x2e')]=function(_0x40e432,_0x38d182){var _0x1d6cbe={},_0x5c704c={},_0x483008={'count':0x0,'rows':[]};var _0x464855=_[_0xa249('0x2f')](db[_0xa249('0x30')][_0xa249('0x31')],function(_0x2f1cee){return{'name':_0x2f1cee[_0xa249('0x32')],'type':_0x2f1cee[_0xa249('0x33')]['key']};});_0x5c704c[_0xa249('0x34')]=_[_0xa249('0x2f')](_0x464855,_0xa249('0x2c'));_0x5c704c[_0xa249('0x35')]=_[_0xa249('0x36')](_0x40e432[_0xa249('0x35')]);_0x5c704c['filters']=_['intersection'](_0x5c704c[_0xa249('0x34')],_0x5c704c[_0xa249('0x35')]);_0x1d6cbe[_0xa249('0x37')]=_[_0xa249('0x38')](_0x5c704c[_0xa249('0x34')],qs[_0xa249('0x39')](_0x40e432[_0xa249('0x35')][_0xa249('0x39')]));_0x1d6cbe[_0xa249('0x37')]=_0x1d6cbe['attributes'][_0xa249('0x3a')]?_0x1d6cbe[_0xa249('0x37')]:_0x5c704c[_0xa249('0x34')];if(!_0x40e432[_0xa249('0x35')]['hasOwnProperty'](_0xa249('0x3b'))){_0x1d6cbe[_0xa249('0x20')]=qs[_0xa249('0x20')](_0x40e432[_0xa249('0x35')][_0xa249('0x20')]);_0x1d6cbe[_0xa249('0x1f')]=qs[_0xa249('0x1f')](_0x40e432[_0xa249('0x35')][_0xa249('0x1f')]);}_0x1d6cbe['order']=qs['sort'](_0x40e432[_0xa249('0x35')]['sort']);_0x1d6cbe[_0xa249('0x3c')]=qs[_0xa249('0x3d')](_[_0xa249('0x3e')](_0x40e432[_0xa249('0x35')],_0x5c704c['filters']),_0x464855);if(_0x40e432[_0xa249('0x35')][_0xa249('0x3f')]){_0x1d6cbe[_0xa249('0x3c')]=_[_0xa249('0x40')](_0x1d6cbe[_0xa249('0x3c')],{'$or':_[_0xa249('0x2f')](_0x464855,function(_0x1c5fd3){if(_0x1c5fd3['type']!==_0xa249('0x41')){var _0x46a26b={};_0x46a26b[_0x1c5fd3['name']]={'$like':'%'+_0x40e432[_0xa249('0x35')][_0xa249('0x3f')]+'%'};return _0x46a26b;}})});}_0x1d6cbe=_[_0xa249('0x40')]({},_0x1d6cbe,_0x40e432[_0xa249('0x42')]);var _0x5869bc={'where':_0x1d6cbe['where']};return db[_0xa249('0x30')][_0xa249('0x22')](_0x5869bc)[_0xa249('0x29')](function(_0x140846){_0x483008[_0xa249('0x22')]=_0x140846;if(_0x40e432['query'][_0xa249('0x43')]){_0x1d6cbe[_0xa249('0x44')]=[{'all':!![]}];}return db[_0xa249('0x30')]['findAll'](_0x1d6cbe);})['then'](function(_0x52b965){_0x483008['rows']=_0x52b965;return _0x483008;})[_0xa249('0x29')](respondWithFilteredResult(_0x38d182,_0x1d6cbe))[_0xa249('0x45')](handleError(_0x38d182,null));};exports[_0xa249('0x46')]=function(_0x16e587,_0x350eca){var _0x351f8b={'raw':!![],'where':{'id':_0x16e587[_0xa249('0x47')]['id']}},_0x588708={};_0x588708[_0xa249('0x34')]=_['keys'](db[_0xa249('0x30')][_0xa249('0x31')]);_0x588708[_0xa249('0x35')]=_[_0xa249('0x36')](_0x16e587['query']);_0x588708[_0xa249('0x3d')]=_[_0xa249('0x38')](_0x588708['model'],_0x588708[_0xa249('0x35')]);_0x351f8b['attributes']=_[_0xa249('0x38')](_0x588708['model'],qs[_0xa249('0x39')](_0x16e587[_0xa249('0x35')][_0xa249('0x39')]));_0x351f8b[_0xa249('0x37')]=_0x351f8b['attributes'][_0xa249('0x3a')]?_0x351f8b[_0xa249('0x37')]:_0x588708[_0xa249('0x34')];if(_0x16e587[_0xa249('0x35')][_0xa249('0x43')]){_0x351f8b['include']=[{'all':!![]}];}_0x351f8b=_[_0xa249('0x40')]({},_0x351f8b,_0x16e587[_0xa249('0x42')]);return db[_0xa249('0x30')]['find'](_0x351f8b)[_0xa249('0x29')](handleEntityNotFound(_0x350eca,null))['then'](respondWithResult(_0x350eca,null))['catch'](handleError(_0x350eca,null));};exports[_0xa249('0x48')]=function(_0x5f34e1,_0x29fc4d){return db[_0xa249('0x30')][_0xa249('0x48')](_0x5f34e1[_0xa249('0x49')],{})[_0xa249('0x29')](respondWithResult(_0x29fc4d,0xc9))['catch'](handleError(_0x29fc4d,null));};exports[_0xa249('0x28')]=function(_0x211833,_0xdde847){if(_0x211833[_0xa249('0x49')]['id']){delete _0x211833['body']['id'];}return db[_0xa249('0x30')][_0xa249('0x4a')]({'where':{'id':_0x211833[_0xa249('0x47')]['id']}})[_0xa249('0x29')](handleEntityNotFound(_0xdde847,null))[_0xa249('0x29')](saveUpdates(_0x211833[_0xa249('0x49')],null))[_0xa249('0x29')](respondWithResult(_0xdde847,null))['catch'](handleError(_0xdde847,null));};exports['destroy']=function(_0x59eeb6,_0x1825ad){return db['VoiceDialReport'][_0xa249('0x4a')]({'where':{'id':_0x59eeb6['params']['id']}})[_0xa249('0x29')](handleEntityNotFound(_0x1825ad,null))[_0xa249('0x29')](removeEntity(_0x1825ad,null))[_0xa249('0x45')](handleError(_0x1825ad,null));};exports[_0xa249('0x4b')]=function(_0x11e78a,_0x12eecb){return db[_0xa249('0x30')]['describe']()[_0xa249('0x29')](respondWithResult(_0x12eecb,null))[_0xa249('0x45')](handleError(_0x12eecb,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 306c578..694459f 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 _0xea04=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x59f46a,_0x3e44de){var _0x3608fb=function(_0x5d0b24){while(--_0x5d0b24){_0x59f46a['push'](_0x59f46a['shift']());}};_0x3608fb(++_0x3e44de);}(_0xea04,0x1d1));var _0x4ea0=function(_0x330740,_0x58c0c0){_0x330740=_0x330740-0x0;var _0x1cb5f2=_0xea04[_0x330740];return _0x1cb5f2;};'use strict';var _=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var logger=require(_0x4ea0('0x2'))(_0x4ea0('0x3'));var moment=require('moment');var BPromise=require(_0x4ea0('0x4'));var rp=require(_0x4ea0('0x5'));var fs=require('fs');var path=require(_0x4ea0('0x6'));var rimraf=require(_0x4ea0('0x7'));var config=require(_0x4ea0('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x4ea0('0x9')]=function(_0x34752d,_0x565e45){return _0x34752d[_0x4ea0('0xa')]('VoiceDialReport',attributes,{'tableName':_0x4ea0('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4ea0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95d9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x95d9,0x138));var _0x995d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x95d9[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var logger=require(_0x995d('0x2'))(_0x995d('0x3'));var moment=require(_0x995d('0x4'));var BPromise=require(_0x995d('0x5'));var rp=require(_0x995d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x995d('0x7'));var config=require('../../config/environment');var attributes=require(_0x995d('0x8'));module[_0x995d('0x9')]=function(_0xadc3df,_0x593305){return _0xadc3df[_0x995d('0xa')](_0x995d('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 68f3b18..93feca2 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 _0x121f=['debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','body','options','raw','then','CreateVoiceDialReport','VoiceDialReport','update','attributes','UpdateVoiceDialReport','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent'];(function(_0x306af3,_0x2f9bc2){var _0x5b676c=function(_0x1abbc0){while(--_0x1abbc0){_0x306af3['push'](_0x306af3['shift']());}};_0x5b676c(++_0x2f9bc2);}(_0x121f,0x167));var _0xf121=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x121f[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0xf121('0x0'));var util=require(_0xf121('0x1'));var moment=require(_0xf121('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf121('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf121('0x4'));var logger=require(_0xf121('0x5'))('rpc');var config=require(_0xf121('0x6'));var jayson=require(_0xf121('0x7'));var client=jayson['client'][_0xf121('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e684a,_0x1d6475,_0x1c4cb6){return new BPromise(function(_0x62b36f,_0x32cd26){return client[_0xf121('0x9')](_0x2e684a,_0x1c4cb6)['then'](function(_0x572792){logger[_0xf121('0xa')](_0xf121('0xb'),_0x1d6475,_0xf121('0xc'));logger[_0xf121('0xd')](_0xf121('0xe'),_0x1d6475,_0xf121('0xc'),JSON[_0xf121('0xf')](_0x572792));if(_0x572792[_0xf121('0x10')]){if(_0x572792[_0xf121('0x10')][_0xf121('0x11')]===0x1f4){logger[_0xf121('0x10')](_0xf121('0xb'),_0x1d6475,_0x572792[_0xf121('0x10')][_0xf121('0x12')]);return _0x32cd26(_0x572792[_0xf121('0x10')][_0xf121('0x12')]);}logger[_0xf121('0x10')](_0xf121('0xb'),_0x1d6475,_0x572792[_0xf121('0x10')][_0xf121('0x12')]);return _0x62b36f(_0x572792['error'][_0xf121('0x12')]);}else{logger['info'](_0xf121('0xb'),_0x1d6475,_0xf121('0xc'));_0x62b36f(_0x572792[_0xf121('0x13')][_0xf121('0x12')]);}})['catch'](function(_0x138c56){logger[_0xf121('0x10')](_0xf121('0xb'),_0x1d6475,_0x138c56);_0x32cd26(_0x138c56);});});}exports['CreateVoiceDialReport']=function(_0x5c3f47){var _0xeaaf9=this;return new Promise(function(_0x46d4ad,_0x54172d){return db['VoiceDialReport'][_0xf121('0x14')](_0x5c3f47[_0xf121('0x15')],{'raw':_0x5c3f47[_0xf121('0x16')]?_0x5c3f47[_0xf121('0x16')][_0xf121('0x17')]===undefined?!![]:![]:!![]})[_0xf121('0x18')](function(_0x46a480){logger['info'](_0xf121('0x19'),_0x5c3f47);logger[_0xf121('0xd')](_0xf121('0x19'),_0x5c3f47,JSON[_0xf121('0xf')](_0x46a480));_0x46d4ad(_0x46a480);})['catch'](function(_0x3425dc){logger[_0xf121('0x10')]('CreateVoiceDialReport',_0x3425dc['message'],_0x5c3f47);_0x54172d(_0xeaaf9[_0xf121('0x10')](0x1f4,_0x3425dc[_0xf121('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0xb2cced){var _0x344dd7=this;return new Promise(function(_0x757a2e,_0x382ad2){return db[_0xf121('0x1a')][_0xf121('0x1b')](_0xb2cced[_0xf121('0x15')],{'raw':_0xb2cced['options']?_0xb2cced['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb2cced[_0xf121('0x16')]?_0xb2cced['options']['where']||null:null,'attributes':_0xb2cced[_0xf121('0x16')]?_0xb2cced[_0xf121('0x16')][_0xf121('0x1c')]||null:null,'limit':_0xb2cced[_0xf121('0x16')]?_0xb2cced[_0xf121('0x16')]['limit']||null:null})['then'](function(_0x3e70c7){logger[_0xf121('0xa')](_0xf121('0x1d'),_0xb2cced);logger[_0xf121('0xd')]('UpdateVoiceDialReport',_0xb2cced,JSON[_0xf121('0xf')](_0x3e70c7));_0x757a2e(_0x3e70c7);})[_0xf121('0x1e')](function(_0x4a6589){logger['error'](_0xf121('0x1d'),_0x4a6589[_0xf121('0x12')],_0xb2cced);_0x382ad2(_0x344dd7['error'](0x1f4,_0x4a6589[_0xf121('0x12')]));});});}; \ No newline at end of file +var _0x409a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','update','where','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x35edb9,_0x12ce9f){var _0x37379f=function(_0x5bd2f0){while(--_0x5bd2f0){_0x35edb9['push'](_0x35edb9['shift']());}};_0x37379f(++_0x12ce9f);}(_0x409a,0x17b));var _0xa409=function(_0x130e64,_0x2ec528){_0x130e64=_0x130e64-0x0;var _0x4aa033=_0x409a[_0x130e64];return _0x4aa033;};'use strict';var _=require(_0xa409('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa409('0x1'));var rs=require(_0xa409('0x2'));var fs=require('fs');var Redis=require(_0xa409('0x3'));var db=require(_0xa409('0x4'))['db'];var utils=require(_0xa409('0x5'));var logger=require(_0xa409('0x6'))(_0xa409('0x7'));var config=require(_0xa409('0x8'));var jayson=require(_0xa409('0x9'));var client=jayson['client'][_0xa409('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23f959,_0x22379d,_0x4fd0de){return new BPromise(function(_0x17cf80,_0x588b02){return client['request'](_0x23f959,_0x4fd0de)['then'](function(_0x493b17){logger[_0xa409('0xb')](_0xa409('0xc'),_0x22379d,'request\x20sent');logger[_0xa409('0xd')](_0xa409('0xe'),_0x22379d,_0xa409('0xf'),JSON['stringify'](_0x493b17));if(_0x493b17[_0xa409('0x10')]){if(_0x493b17['error'][_0xa409('0x11')]===0x1f4){logger[_0xa409('0x10')](_0xa409('0xc'),_0x22379d,_0x493b17[_0xa409('0x10')][_0xa409('0x12')]);return _0x588b02(_0x493b17[_0xa409('0x10')][_0xa409('0x12')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x22379d,_0x493b17[_0xa409('0x10')]['message']);return _0x17cf80(_0x493b17[_0xa409('0x10')][_0xa409('0x12')]);}else{logger[_0xa409('0xb')](_0xa409('0xc'),_0x22379d,_0xa409('0xf'));_0x17cf80(_0x493b17[_0xa409('0x13')]['message']);}})[_0xa409('0x14')](function(_0x3e3036){logger['error'](_0xa409('0xc'),_0x22379d,_0x3e3036);_0x588b02(_0x3e3036);});});}exports[_0xa409('0x15')]=function(_0x47b36b){var _0x2424f0=this;return new Promise(function(_0x41b2f0,_0x1ca4fb){return db[_0xa409('0x16')][_0xa409('0x17')](_0x47b36b[_0xa409('0x18')],{'raw':_0x47b36b[_0xa409('0x19')]?_0x47b36b['options'][_0xa409('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5ce96b){logger[_0xa409('0xb')](_0xa409('0x15'),_0x47b36b);logger[_0xa409('0xd')]('CreateVoiceDialReport',_0x47b36b,JSON[_0xa409('0x1b')](_0x5ce96b));_0x41b2f0(_0x5ce96b);})[_0xa409('0x14')](function(_0x4927d3){logger[_0xa409('0x10')]('CreateVoiceDialReport',_0x4927d3[_0xa409('0x12')],_0x47b36b);_0x1ca4fb(_0x2424f0['error'](0x1f4,_0x4927d3[_0xa409('0x12')]));});});};exports[_0xa409('0x1c')]=function(_0x5c0316){var _0x73753=this;return new Promise(function(_0x5562ac,_0x2b45a0){return db[_0xa409('0x16')][_0xa409('0x1d')](_0x5c0316['body'],{'raw':_0x5c0316[_0xa409('0x19')]?_0x5c0316['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0316[_0xa409('0x19')]?_0x5c0316[_0xa409('0x19')][_0xa409('0x1e')]||null:null,'attributes':_0x5c0316[_0xa409('0x19')]?_0x5c0316[_0xa409('0x19')][_0xa409('0x1f')]||null:null,'limit':_0x5c0316[_0xa409('0x19')]?_0x5c0316[_0xa409('0x19')]['limit']||null:null})['then'](function(_0x2db70b){logger[_0xa409('0xb')]('UpdateVoiceDialReport',_0x5c0316);logger['debug'](_0xa409('0x1c'),_0x5c0316,JSON[_0xa409('0x1b')](_0x2db70b));_0x5562ac(_0x2db70b);})[_0xa409('0x14')](function(_0x50ab6d){logger['error'](_0xa409('0x1c'),_0x50ab6d[_0xa409('0x12')],_0x5c0316);_0x2b45a0(_0x73753['error'](0x1f4,_0x50ab6d[_0xa409('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 897bfa5..9a6f4db 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 _0x1608=['util','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer'];(function(_0x470605,_0x5e2056){var _0x1b1b51=function(_0x29273c){while(--_0x29273c){_0x470605['push'](_0x470605['shift']());}};_0x1b1b51(++_0x5e2056);}(_0x1608,0x1d0));var _0x8160=function(_0x3636d7,_0x3cc498){_0x3636d7=_0x3636d7-0x0;var _0x5f20fb=_0x1608[_0x3636d7];return _0x5f20fb;};'use strict';var multer=require(_0x8160('0x0'));var util=require(_0x8160('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8160('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8160('0x3'));var config=require(_0x8160('0x4'));var controller=require(_0x8160('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8160('0x6')](_0x8160('0x7'),auth[_0x8160('0x8')](),controller[_0x8160('0x9')]);router[_0x8160('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/applications',auth[_0x8160('0x8')](),controller['addApplications']);router[_0x8160('0xb')](_0x8160('0x7'),auth[_0x8160('0x8')](),controller['update']);router[_0x8160('0xc')]('/:id',auth[_0x8160('0x8')](),controller[_0x8160('0xd')]);module[_0x8160('0xe')]=router; \ No newline at end of file +var _0x4eec=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','/:id/applications','addApplications','put','update','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0x59ecd1,_0x4dc7dd){var _0x266580=function(_0x3b9ff9){while(--_0x3b9ff9){_0x59ecd1['push'](_0x59ecd1['shift']());}};_0x266580(++_0x4dc7dd);}(_0x4eec,0x164));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc4ee('0x0'));var path=require('path');var timeout=require(_0xc4ee('0x1'));var express=require(_0xc4ee('0x2'));var router=express[_0xc4ee('0x3')]();var fs_extra=require(_0xc4ee('0x4'));var auth=require(_0xc4ee('0x5'));var interaction=require(_0xc4ee('0x6'));var config=require(_0xc4ee('0x7'));var controller=require(_0xc4ee('0x8'));router[_0xc4ee('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc4ee('0xa'),auth[_0xc4ee('0xb')](),controller[_0xc4ee('0xc')]);router[_0xc4ee('0xd')]('/',auth[_0xc4ee('0xb')](),controller['create']);router[_0xc4ee('0xd')](_0xc4ee('0xe'),auth['isAuthenticated'](),controller[_0xc4ee('0xf')]);router[_0xc4ee('0x10')](_0xc4ee('0xa'),auth[_0xc4ee('0xb')](),controller[_0xc4ee('0x11')]);router['delete'](_0xc4ee('0xa'),auth[_0xc4ee('0xb')](),controller[_0xc4ee('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index a811ac7..2e481aa 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 _0xd8b0=['VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x31be53,_0x4a9a3f){var _0x38432d=function(_0x4aa725){while(--_0x4aa725){_0x31be53['push'](_0x31be53['shift']());}};_0x38432d(++_0x4a9a3f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d8b('0x2')},'priority':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x0d8b('0x2')},'tag':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0d8b('0x4')](_0x0d8b('0x5'),_0x0d8b('0x6'),'internal',_0x0d8b('0x7'),_0x0d8b('0x8'),'system',_0x0d8b('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x0d8b('0x3')]},'interval':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':_0x0d8b('0xa')},'IntervalId':{'type':Sequelize[_0x0d8b('0xb')]},'isApp':{'type':Sequelize[_0x0d8b('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0d8b('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0xd')},'answer':{'type':Sequelize[_0x0d8b('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0d8b('0xe')],'get':function(_0x92cdd8){return this[_0x0d8b('0xf')](_0x0d8b('0x10'));}}}; \ No newline at end of file +var _0xbaf0=['outbound','internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x8953f9,_0x5dadae){var _0x3ab6b3=function(_0x73302a){while(--_0x73302a){_0x8953f9['push'](_0x8953f9['shift']());}};_0x3ab6b3(++_0x5dadae);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'context':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'priority':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'defaultValue':_0x0baf('0x3')},'appdata':{'type':Sequelize[_0x0baf('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0baf('0x4')](_0x0baf('0x5'),_0x0baf('0x6'),_0x0baf('0x7'),_0x0baf('0x8'),'outbound-fax',_0x0baf('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x0baf('0x1')]},'interval':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'defaultValue':_0x0baf('0xa')},'IntervalId':{'type':Sequelize[_0x0baf('0xb')]},'isApp':{'type':Sequelize[_0x0baf('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0baf('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x0baf('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0baf('0xb')]},'recordingFormat':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x465dd7){return this[_0x0baf('0xe')](_0x0baf('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 1259c68..42d65f4 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 _0xaced=['redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','undefined','count','offset','limit','apply','then','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','concat','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x3e3d3c,_0x18a556){var _0x580889=function(_0xa53e17){while(--_0xa53e17){_0x3e3d3c['push'](_0x3e3d3c['shift']());}};_0x580889(++_0x18a556);}(_0xaced,0x18c));var _0xdace=function(_0x20c99b,_0x48ab6e){_0x20c99b=_0x20c99b-0x0;var _0x50a46d=_0xaced[_0x20c99b];return _0x50a46d;};'use strict';var emlformat=require(_0xdace('0x0'));var rimraf=require(_0xdace('0x1'));var zipdir=require(_0xdace('0x2'));var jsonpatch=require(_0xdace('0x3'));var rp=require(_0xdace('0x4'));var moment=require('moment');var BPromise=require(_0xdace('0x5'));var Mustache=require(_0xdace('0x6'));var util=require(_0xdace('0x7'));var path=require(_0xdace('0x8'));var sox=require('sox');var csv=require(_0xdace('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdace('0xa'));var squel=require(_0xdace('0xb'));var crypto=require(_0xdace('0xc'));var jsforce=require(_0xdace('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdace('0xe'));var Papa=require(_0xdace('0xf'));var Redis=require(_0xdace('0x10'));var authService=require(_0xdace('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdace('0x12'));var hardwareService=require(_0xdace('0x13'));var logger=require(_0xdace('0x14'))(_0xdace('0x15'));var utils=require('../../config/utils');var config=require(_0xdace('0x16'));var licenseUtil=require(_0xdace('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdace('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdace('0x19'))(new Redis(config[_0xdace('0x18')]));require(_0xdace('0x1a'))[_0xdace('0x1b')](socket);function respondWithStatusCode(_0x2b09c2,_0x30d290){_0x30d290=_0x30d290||0xcc;return function(_0x4d0622){if(_0x4d0622){return _0x2b09c2[_0xdace('0x1c')](_0x30d290);}return _0x2b09c2['status'](_0x30d290)[_0xdace('0x1d')]();};}function respondWithResult(_0x2d9a02,_0xebb470){_0xebb470=_0xebb470||0xc8;return function(_0x30ea26){if(_0x30ea26){return _0x2d9a02[_0xdace('0x1e')](_0xebb470)[_0xdace('0x1f')](_0x30ea26);}};}function respondWithFilteredResult(_0xa3594e,_0xf7ca18){return function(_0x4d00c1){if(_0x4d00c1){var _0x4fb9e3=typeof _0xf7ca18['offset']===_0xdace('0x20')&&typeof _0xf7ca18['limit']===_0xdace('0x20');var _0x17b6ab=_0x4d00c1[_0xdace('0x21')];var _0xa7e4d3=_0x4fb9e3?0x0:_0xf7ca18[_0xdace('0x22')];var _0x56dbc9=_0x4fb9e3?_0x4d00c1['count']:_0xf7ca18[_0xdace('0x22')]+_0xf7ca18[_0xdace('0x23')];var _0x54f13e;if(_0x56dbc9>=_0x17b6ab){_0x56dbc9=_0x17b6ab;_0x54f13e=0xc8;}else{_0x54f13e=0xce;}_0xa3594e[_0xdace('0x1e')](_0x54f13e);return _0xa3594e['set']('Content-Range',_0xa7e4d3+'-'+_0x56dbc9+'/'+_0x17b6ab)[_0xdace('0x1f')](_0x4d00c1);}return null;};}function patchUpdates(_0x423941){return function(_0x3209f0){try{jsonpatch[_0xdace('0x24')](_0x3209f0,_0x423941,!![]);}catch(_0x14a47e){return BPromise['reject'](_0x14a47e);}return _0x3209f0['save']();};}function saveUpdates(_0x314256,_0x4a2974){return function(_0x12dc7f){if(_0x12dc7f){return _0x12dc7f['update'](_0x314256)[_0xdace('0x25')](function(_0x1a7e2b){return _0x1a7e2b;});}return null;};}function removeEntity(_0x3dc23a,_0x5737d3){return function(_0x46dee){if(_0x46dee){return _0x46dee[_0xdace('0x26')]()[_0xdace('0x25')](function(){var _0x2747e4=_0x46dee[_0xdace('0x27')]({'plain':!![]});var _0x439579=[{'name':_0xdace('0x28'),'value':'inbound','ignore':![]},{'name':_0xdace('0x29'),'value':_0xdace('0x2a'),'ignore':![]},{'name':_0xdace('0x2b'),'value':_0xdace('0x2c'),'ignore':![]}];var _0x3269ad=_(_0x439579)[_0xdace('0x2d')](_0xdace('0x2e'))[_0xdace('0x2f')]('value')[_0xdace('0x30')]();if(_[_0xdace('0x31')](_0x3269ad,_0x2747e4['type'])){return;}var _0x5ab405=_[_0xdace('0x32')](_0x439579,[_0xdace('0x30'),_0x2747e4['type']])['name'];return db[_0xdace('0x33')][_0xdace('0x26')]({'where':{'type':_0x5ab405,'resourceId':_0x2747e4['id']}})['then'](function(){return _0x46dee;});})[_0xdace('0x25')](function(){_0x3dc23a[_0xdace('0x1e')](0xcc)[_0xdace('0x1d')]();});}};}function handleEntityNotFound(_0xc4b414,_0x3ac83c){return function(_0x41be24){if(!_0x41be24){_0xc4b414[_0xdace('0x1c')](0x194);}return _0x41be24;};}function handleError(_0x59eef7,_0x4cf63c){_0x4cf63c=_0x4cf63c||0x1f4;return function(_0x1ede5e){logger[_0xdace('0x34')](_0x1ede5e[_0xdace('0x35')]);if(_0x1ede5e['name']){delete _0x1ede5e[_0xdace('0x36')];}_0x59eef7['status'](_0x4cf63c)[_0xdace('0x37')](_0x1ede5e);};}exports[_0xdace('0x38')]=function(_0x36670b,_0x264296){var _0x760c9d={},_0x4ef630={},_0x34522d={'count':0x0,'rows':[]};var _0x20d14c=_[_0xdace('0x2f')](db['VoiceExtension'][_0xdace('0x39')],function(_0x5d6543){return{'name':_0x5d6543[_0xdace('0x3a')],'type':_0x5d6543[_0xdace('0x3b')]['key']};});_0x4ef630[_0xdace('0x3c')]=_[_0xdace('0x2f')](_0x20d14c,_0xdace('0x36'));_0x4ef630[_0xdace('0x3d')]=_[_0xdace('0x3e')](_0x36670b[_0xdace('0x3d')]);_0x4ef630[_0xdace('0x3f')]=_[_0xdace('0x40')](_0x4ef630[_0xdace('0x3c')],_0x4ef630[_0xdace('0x3d')]);_0x760c9d[_0xdace('0x41')]=_[_0xdace('0x40')](_0x4ef630[_0xdace('0x3c')],qs[_0xdace('0x42')](_0x36670b[_0xdace('0x3d')][_0xdace('0x42')]));_0x760c9d[_0xdace('0x41')]=_0x760c9d[_0xdace('0x41')][_0xdace('0x43')]?_0x760c9d['attributes']:_0x4ef630[_0xdace('0x3c')];if(!_0x36670b[_0xdace('0x3d')]['hasOwnProperty'](_0xdace('0x44'))){_0x760c9d['limit']=qs[_0xdace('0x23')](_0x36670b['query'][_0xdace('0x23')]);_0x760c9d[_0xdace('0x22')]=qs[_0xdace('0x22')](_0x36670b[_0xdace('0x3d')]['offset']);}_0x760c9d[_0xdace('0x45')]=qs['sort'](_0x36670b[_0xdace('0x3d')]['sort']);_0x760c9d[_0xdace('0x46')]=qs[_0xdace('0x3f')](_['pick'](_0x36670b[_0xdace('0x3d')],_0x4ef630['filters']),_0x20d14c);if(_0x36670b[_0xdace('0x3d')][_0xdace('0x2d')]){_0x760c9d[_0xdace('0x46')]=_[_0xdace('0x47')](_0x760c9d['where'],{'$or':_[_0xdace('0x2f')](_0x20d14c,function(_0x5d0055){if(_0x5d0055[_0xdace('0x3b')]!==_0xdace('0x48')){var _0xd3db40={};_0xd3db40[_0x5d0055[_0xdace('0x36')]]={'$like':'%'+_0x36670b[_0xdace('0x3d')][_0xdace('0x2d')]+'%'};return _0xd3db40;}})});}_0x760c9d=_[_0xdace('0x47')]({},_0x760c9d,_0x36670b[_0xdace('0x49')]);var _0x448723={'where':_0x760c9d['where']};return db[_0xdace('0x4a')]['count'](_0x448723)[_0xdace('0x25')](function(_0x493394){_0x34522d['count']=_0x493394;if(_0x36670b[_0xdace('0x3d')][_0xdace('0x4b')]){_0x760c9d[_0xdace('0x4c')]=[{'all':!![]}];}return db[_0xdace('0x4a')][_0xdace('0x4d')](_0x760c9d);})[_0xdace('0x25')](function(_0x11a1fe){_0x34522d[_0xdace('0x4e')]=_0x11a1fe;return _0x34522d;})[_0xdace('0x25')](respondWithFilteredResult(_0x264296,_0x760c9d))[_0xdace('0x4f')](handleError(_0x264296,null));};exports[_0xdace('0x50')]=function(_0x845dd1,_0x2a358c){var _0x490566={'raw':![],'where':{'id':_0x845dd1[_0xdace('0x51')]['id']}},_0x36966e={};_0x36966e[_0xdace('0x3c')]=_[_0xdace('0x3e')](db[_0xdace('0x4a')][_0xdace('0x39')]);_0x36966e[_0xdace('0x3d')]=_[_0xdace('0x3e')](_0x845dd1[_0xdace('0x3d')]);_0x36966e[_0xdace('0x3f')]=_[_0xdace('0x40')](_0x36966e[_0xdace('0x3c')],_0x36966e['query']);_0x490566[_0xdace('0x41')]=_['intersection'](_0x36966e[_0xdace('0x3c')],qs[_0xdace('0x42')](_0x845dd1['query']['fields']));_0x490566[_0xdace('0x41')]=_0x490566[_0xdace('0x41')][_0xdace('0x43')]?_0x490566[_0xdace('0x41')]:_0x36966e[_0xdace('0x3c')];if(_0x845dd1[_0xdace('0x3d')][_0xdace('0x4b')]){_0x490566[_0xdace('0x4c')]=[{'all':!![]}];}_0x490566=_['merge']({},_0x490566,_0x845dd1[_0xdace('0x49')]);return db[_0xdace('0x4a')][_0xdace('0x32')](_0x490566)[_0xdace('0x25')](handleEntityNotFound(_0x2a358c,null))[_0xdace('0x25')](respondWithResult(_0x2a358c,null))['catch'](handleError(_0x2a358c,null));};exports['destroy']=function(_0x2567f2,_0x4c4ec8){return db[_0xdace('0x4a')]['find']({'where':{'id':_0x2567f2[_0xdace('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c4ec8,null))[_0xdace('0x25')](removeEntity(_0x4c4ec8,null))[_0xdace('0x4f')](handleError(_0x4c4ec8,null));};exports[_0xdace('0x52')]=function(_0x19e4a9,_0x1a08c3){if(_0x19e4a9[_0xdace('0x53')][_0xdace('0x3b')]===_0xdace('0x2a')&&!_[_0xdace('0x54')](_0x19e4a9[_0xdace('0x53')][_0xdace('0x55')],'_')){_0x19e4a9[_0xdace('0x53')][_0xdace('0x55')]='_'[_0xdace('0x56')](_0x19e4a9[_0xdace('0x53')][_0xdace('0x55')]);}return db['VoiceExtension']['create'](_0x19e4a9['body'],{'raw':![]})[_0xdace('0x25')](function(_0x1bc65d){var _0x4aca0e=_0x19e4a9[_0xdace('0x57')]['get']({'plain':!![]});if(!_0x4aca0e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aca0e[_0xdace('0x58')]===_0xdace('0x57')){var _0x93a7b4=_0x1bc65d['get']({'plain':!![]});var _0x1aa047=[{'name':_0xdace('0x28'),'value':'inbound'},{'name':_0xdace('0x29'),'value':_0xdace('0x2a')},{'name':_0xdace('0x2b'),'value':'internal'}];var _0x51c380=_[_0xdace('0x32')](_0x1aa047,[_0xdace('0x30'),_0x93a7b4[_0xdace('0x3b')]])[_0xdace('0x36')];return db[_0xdace('0x59')]['find']({'where':{'name':_0x51c380,'userProfileId':_0x4aca0e[_0xdace('0x5a')]},'raw':!![]})['then'](function(_0x489274){if(_0x489274&&_0x489274[_0xdace('0x5b')]===0x0){return db['UserProfileResource'][_0xdace('0x52')]({'name':_0x93a7b4[_0xdace('0x36')],'resourceId':_0x93a7b4['id'],'type':_0x489274['name'],'sectionId':_0x489274['id']},{})[_0xdace('0x25')](function(){return _0x1bc65d;});}else{return _0x1bc65d;}})[_0xdace('0x4f')](function(_0x4921ed){logger[_0xdace('0x34')](_0xdace('0x5c'),_0x4921ed);throw _0x4921ed;});}return _0x1bc65d;})[_0xdace('0x25')](respondWithResult(_0x1a08c3,0xc9))[_0xdace('0x4f')](handleError(_0x1a08c3,null));};exports[_0xdace('0x5d')]=function(_0x220012,_0x2af931){if(_0x220012['body']['id']){delete _0x220012[_0xdace('0x53')]['id'];}return db[_0xdace('0x4a')][_0xdace('0x32')]({'where':{'id':_0x220012[_0xdace('0x51')]['id']}})['then'](handleEntityNotFound(_0x2af931,null))['then'](function(_0x19890f){if(_0x19890f){return db[_0xdace('0x4a')][_0xdace('0x5d')](_[_0xdace('0x5e')](_0x220012[_0xdace('0x53')],[_0xdace('0x55'),_0xdace('0x5f'),_0xdace('0x60'),_0xdace('0x61'),_0xdace('0x62'),_0xdace('0x63')]),{'where':{'context':_0x19890f[_0xdace('0x5f')],'exten':_0x19890f[_0xdace('0x55')]},'individualHooks':!![]})[_0xdace('0x25')](function(_0xdb672d){return _0xdb672d;});}return null;})[_0xdace('0x25')](respondWithStatusCode(_0x2af931,null))[_0xdace('0x4f')](handleError(_0x2af931,null));};exports['addApplications']=function(_0x371986,_0x5db6e5,_0x168d64){return db[_0xdace('0x4a')][_0xdace('0x64')]({'where':{'id':_0x371986[_0xdace('0x51')]['id']}})['then'](handleEntityNotFound(_0x5db6e5,null))[_0xdace('0x25')](function(_0x769533){if(_0x769533){return db['sequelize']['transaction'](function(_0x4f4da1){return db[_0xdace('0x4a')][_0xdace('0x26')]({'where':{'VoiceExtensionId':_0x371986[_0xdace('0x51')]['id']},'transaction':_0x4f4da1})[_0xdace('0x25')](function(_0x153544){var _0x40b200=_[_0xdace('0x2f')](_0x371986['body'],function(_0x23753a){_0x23753a[_0xdace('0x65')]=_0x371986[_0xdace('0x51')]['id'];return _0x23753a;});return db[_0xdace('0x4a')][_0xdace('0x66')](_0x40b200,{'transaction':_0x4f4da1});});})[_0xdace('0x25')](function(){return db[_0xdace('0x4a')][_0xdace('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x371986[_0xdace('0x51')]['id']},'order':_0xdace('0x68')});});}})[_0xdace('0x25')](respondWithResult(_0x5db6e5,null))[_0xdace('0x4f')](handleError(_0x5db6e5,null));}; \ No newline at end of file +var _0x01d3=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','inbound','InternalRoutes','filter','ignore','map','value','includes','type','find','end','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','params','create','outbound','startsWith','body','exten','user','role','InboundRoutes','OutboundRoutes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','zip-dir','fast-json-patch','request-promise'];(function(_0x4220c9,_0x645f37){var _0x5cce00=function(_0xef08b3){while(--_0xef08b3){_0x4220c9['push'](_0x4220c9['shift']());}};_0x5cce00(++_0x645f37);}(_0x01d3,0xdb));var _0x301d=function(_0x4cc529,_0x45e2d5){_0x4cc529=_0x4cc529-0x0;var _0x3371b1=_0x01d3[_0x4cc529];return _0x3371b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x301d('0x0'));var jsonpatch=require(_0x301d('0x1'));var rp=require(_0x301d('0x2'));var moment=require('moment');var BPromise=require(_0x301d('0x3'));var Mustache=require(_0x301d('0x4'));var util=require(_0x301d('0x5'));var path=require(_0x301d('0x6'));var sox=require(_0x301d('0x7'));var csv=require('to-csv');var ejs=require(_0x301d('0x8'));var fs=require('fs');var fs_extra=require(_0x301d('0x9'));var _=require(_0x301d('0xa'));var squel=require(_0x301d('0xb'));var crypto=require(_0x301d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x301d('0xd'));var toCsv=require(_0x301d('0xe'));var querystring=require(_0x301d('0xf'));var Papa=require(_0x301d('0x10'));var Redis=require(_0x301d('0x11'));var authService=require(_0x301d('0x12'));var qs=require(_0x301d('0x13'));var as=require(_0x301d('0x14'));var hardwareService=require(_0x301d('0x15'));var logger=require('../../config/logger')(_0x301d('0x16'));var utils=require(_0x301d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x301d('0x18'));var db=require(_0x301d('0x19'))['db'];config[_0x301d('0x1a')]=_[_0x301d('0x1b')](config['redis'],{'host':_0x301d('0x1c'),'port':0x18eb});var socket=require(_0x301d('0x1d'))(new Redis(config[_0x301d('0x1a')]));require(_0x301d('0x1e'))[_0x301d('0x1f')](socket);function respondWithStatusCode(_0x5bdd8a,_0x3698bc){_0x3698bc=_0x3698bc||0xcc;return function(_0x5a4cb5){if(_0x5a4cb5){return _0x5bdd8a[_0x301d('0x20')](_0x3698bc);}return _0x5bdd8a[_0x301d('0x21')](_0x3698bc)['end']();};}function respondWithResult(_0x10d277,_0x223c48){_0x223c48=_0x223c48||0xc8;return function(_0x195642){if(_0x195642){return _0x10d277[_0x301d('0x21')](_0x223c48)[_0x301d('0x22')](_0x195642);}};}function respondWithFilteredResult(_0x1c409b,_0x370936){return function(_0x2c7afb){if(_0x2c7afb){var _0x151149=typeof _0x370936[_0x301d('0x23')]===_0x301d('0x24')&&typeof _0x370936[_0x301d('0x25')]===_0x301d('0x24');var _0x3d75e5=_0x2c7afb[_0x301d('0x26')];var _0x4c9317=_0x151149?0x0:_0x370936['offset'];var _0x54dbe6=_0x151149?_0x2c7afb[_0x301d('0x26')]:_0x370936[_0x301d('0x23')]+_0x370936[_0x301d('0x25')];var _0x4d8006;if(_0x54dbe6>=_0x3d75e5){_0x54dbe6=_0x3d75e5;_0x4d8006=0xc8;}else{_0x4d8006=0xce;}_0x1c409b[_0x301d('0x21')](_0x4d8006);return _0x1c409b[_0x301d('0x27')]('Content-Range',_0x4c9317+'-'+_0x54dbe6+'/'+_0x3d75e5)['json'](_0x2c7afb);}return null;};}function patchUpdates(_0x292c89){return function(_0x30569e){try{jsonpatch[_0x301d('0x28')](_0x30569e,_0x292c89,!![]);}catch(_0x3fa47d){return BPromise['reject'](_0x3fa47d);}return _0x30569e[_0x301d('0x29')]();};}function saveUpdates(_0x2491b8,_0x10dd5a){return function(_0x3a7484){if(_0x3a7484){return _0x3a7484[_0x301d('0x2a')](_0x2491b8)[_0x301d('0x2b')](function(_0x4fae3d){return _0x4fae3d;});}return null;};}function removeEntity(_0x470b7a,_0xb315b6){return function(_0x2ea83c){if(_0x2ea83c){return _0x2ea83c[_0x301d('0x2c')]()[_0x301d('0x2b')](function(){var _0x23c934=_0x2ea83c[_0x301d('0x2d')]({'plain':!![]});var _0x2dd5b8=[{'name':'InboundRoutes','value':_0x301d('0x2e'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x301d('0x2f'),'value':'internal','ignore':![]}];var _0x326722=_(_0x2dd5b8)[_0x301d('0x30')](_0x301d('0x31'))[_0x301d('0x32')](_0x301d('0x33'))['value']();if(_[_0x301d('0x34')](_0x326722,_0x23c934[_0x301d('0x35')])){return;}var _0x2385ef=_[_0x301d('0x36')](_0x2dd5b8,['value',_0x23c934['type']])['name'];return db['UserProfileResource'][_0x301d('0x2c')]({'where':{'type':_0x2385ef,'resourceId':_0x23c934['id']}})[_0x301d('0x2b')](function(){return _0x2ea83c;});})[_0x301d('0x2b')](function(){_0x470b7a[_0x301d('0x21')](0xcc)[_0x301d('0x37')]();});}};}function handleEntityNotFound(_0x1a9d31,_0xaeb8aa){return function(_0x38d41c){if(!_0x38d41c){_0x1a9d31[_0x301d('0x20')](0x194);}return _0x38d41c;};}function handleError(_0x3e76c0,_0x4fa080){_0x4fa080=_0x4fa080||0x1f4;return function(_0x3032d1){logger[_0x301d('0x38')](_0x3032d1[_0x301d('0x39')]);if(_0x3032d1[_0x301d('0x3a')]){delete _0x3032d1[_0x301d('0x3a')];}_0x3e76c0[_0x301d('0x21')](_0x4fa080)[_0x301d('0x3b')](_0x3032d1);};}exports[_0x301d('0x3c')]=function(_0x26afc2,_0x18f501){var _0x54805e={},_0x593193={},_0x42d663={'count':0x0,'rows':[]};var _0x197402=_[_0x301d('0x32')](db[_0x301d('0x3d')][_0x301d('0x3e')],function(_0x5de9c5){return{'name':_0x5de9c5[_0x301d('0x3f')],'type':_0x5de9c5[_0x301d('0x35')][_0x301d('0x40')]};});_0x593193['model']=_[_0x301d('0x32')](_0x197402,'name');_0x593193[_0x301d('0x41')]=_[_0x301d('0x42')](_0x26afc2[_0x301d('0x41')]);_0x593193[_0x301d('0x43')]=_[_0x301d('0x44')](_0x593193[_0x301d('0x45')],_0x593193[_0x301d('0x41')]);_0x54805e[_0x301d('0x46')]=_['intersection'](_0x593193[_0x301d('0x45')],qs[_0x301d('0x47')](_0x26afc2[_0x301d('0x41')][_0x301d('0x47')]));_0x54805e[_0x301d('0x46')]=_0x54805e['attributes']['length']?_0x54805e['attributes']:_0x593193[_0x301d('0x45')];if(!_0x26afc2['query'][_0x301d('0x48')](_0x301d('0x49'))){_0x54805e[_0x301d('0x25')]=qs[_0x301d('0x25')](_0x26afc2[_0x301d('0x41')]['limit']);_0x54805e[_0x301d('0x23')]=qs['offset'](_0x26afc2['query'][_0x301d('0x23')]);}_0x54805e['order']=qs['sort'](_0x26afc2[_0x301d('0x41')][_0x301d('0x4a')]);_0x54805e[_0x301d('0x4b')]=qs[_0x301d('0x43')](_[_0x301d('0x4c')](_0x26afc2[_0x301d('0x41')],_0x593193['filters']),_0x197402);if(_0x26afc2[_0x301d('0x41')][_0x301d('0x30')]){_0x54805e[_0x301d('0x4b')]=_[_0x301d('0x4d')](_0x54805e[_0x301d('0x4b')],{'$or':_[_0x301d('0x32')](_0x197402,function(_0x235586){if(_0x235586['type']!==_0x301d('0x4e')){var _0x53d704={};_0x53d704[_0x235586['name']]={'$like':'%'+_0x26afc2[_0x301d('0x41')][_0x301d('0x30')]+'%'};return _0x53d704;}})});}_0x54805e=_['merge']({},_0x54805e,_0x26afc2[_0x301d('0x4f')]);var _0x54436f={'where':_0x54805e['where']};return db['VoiceExtension'][_0x301d('0x26')](_0x54436f)[_0x301d('0x2b')](function(_0x1ab211){_0x42d663['count']=_0x1ab211;if(_0x26afc2['query'][_0x301d('0x50')]){_0x54805e[_0x301d('0x51')]=[{'all':!![]}];}return db[_0x301d('0x3d')][_0x301d('0x52')](_0x54805e);})[_0x301d('0x2b')](function(_0x5dcd35){_0x42d663[_0x301d('0x53')]=_0x5dcd35;return _0x42d663;})[_0x301d('0x2b')](respondWithFilteredResult(_0x18f501,_0x54805e))[_0x301d('0x54')](handleError(_0x18f501,null));};exports['show']=function(_0x5b2b17,_0x331c4b){var _0x1f5d27={'raw':![],'where':{'id':_0x5b2b17['params']['id']}},_0x389786={};_0x389786[_0x301d('0x45')]=_['keys'](db[_0x301d('0x3d')]['rawAttributes']);_0x389786[_0x301d('0x41')]=_[_0x301d('0x42')](_0x5b2b17[_0x301d('0x41')]);_0x389786[_0x301d('0x43')]=_[_0x301d('0x44')](_0x389786[_0x301d('0x45')],_0x389786[_0x301d('0x41')]);_0x1f5d27[_0x301d('0x46')]=_[_0x301d('0x44')](_0x389786['model'],qs[_0x301d('0x47')](_0x5b2b17[_0x301d('0x41')][_0x301d('0x47')]));_0x1f5d27[_0x301d('0x46')]=_0x1f5d27['attributes'][_0x301d('0x55')]?_0x1f5d27['attributes']:_0x389786['model'];if(_0x5b2b17['query'][_0x301d('0x50')]){_0x1f5d27['include']=[{'all':!![]}];}_0x1f5d27=_['merge']({},_0x1f5d27,_0x5b2b17[_0x301d('0x4f')]);return db[_0x301d('0x3d')][_0x301d('0x36')](_0x1f5d27)[_0x301d('0x2b')](handleEntityNotFound(_0x331c4b,null))[_0x301d('0x2b')](respondWithResult(_0x331c4b,null))[_0x301d('0x54')](handleError(_0x331c4b,null));};exports[_0x301d('0x2c')]=function(_0x1a6813,_0x46c232){return db[_0x301d('0x3d')][_0x301d('0x36')]({'where':{'id':_0x1a6813[_0x301d('0x56')]['id']}})[_0x301d('0x2b')](handleEntityNotFound(_0x46c232,null))[_0x301d('0x2b')](removeEntity(_0x46c232,null))[_0x301d('0x54')](handleError(_0x46c232,null));};exports[_0x301d('0x57')]=function(_0xd17e9b,_0x15da05){if(_0xd17e9b['body'][_0x301d('0x35')]===_0x301d('0x58')&&!_[_0x301d('0x59')](_0xd17e9b[_0x301d('0x5a')][_0x301d('0x5b')],'_')){_0xd17e9b[_0x301d('0x5a')][_0x301d('0x5b')]='_'['concat'](_0xd17e9b[_0x301d('0x5a')][_0x301d('0x5b')]);}return db['VoiceExtension'][_0x301d('0x57')](_0xd17e9b['body'],{'raw':![]})['then'](function(_0x5a0918){var _0x2cef89=_0xd17e9b[_0x301d('0x5c')][_0x301d('0x2d')]({'plain':!![]});if(!_0x2cef89)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cef89[_0x301d('0x5d')]==='user'){var _0x3f072c=_0x5a0918[_0x301d('0x2d')]({'plain':!![]});var _0x13d2c6=[{'name':_0x301d('0x5e'),'value':_0x301d('0x2e')},{'name':_0x301d('0x5f'),'value':'outbound'},{'name':_0x301d('0x2f'),'value':'internal'}];var _0x6a0a18=_[_0x301d('0x36')](_0x13d2c6,[_0x301d('0x33'),_0x3f072c['type']])['name'];return db['UserProfileSection'][_0x301d('0x36')]({'where':{'name':_0x6a0a18,'userProfileId':_0x2cef89[_0x301d('0x60')]},'raw':!![]})[_0x301d('0x2b')](function(_0x4dff60){if(_0x4dff60&&_0x4dff60[_0x301d('0x61')]===0x0){return db[_0x301d('0x62')][_0x301d('0x57')]({'name':_0x3f072c[_0x301d('0x3a')],'resourceId':_0x3f072c['id'],'type':_0x4dff60['name'],'sectionId':_0x4dff60['id']},{})[_0x301d('0x2b')](function(){return _0x5a0918;});}else{return _0x5a0918;}})['catch'](function(_0x2e19e5){logger[_0x301d('0x38')](_0x301d('0x63'),_0x2e19e5);throw _0x2e19e5;});}return _0x5a0918;})['then'](respondWithResult(_0x15da05,0xc9))[_0x301d('0x54')](handleError(_0x15da05,null));};exports[_0x301d('0x2a')]=function(_0x32cd09,_0x469281){if(_0x32cd09['body']['id']){delete _0x32cd09[_0x301d('0x5a')]['id'];}return db[_0x301d('0x3d')][_0x301d('0x36')]({'where':{'id':_0x32cd09[_0x301d('0x56')]['id']}})[_0x301d('0x2b')](handleEntityNotFound(_0x469281,null))[_0x301d('0x2b')](function(_0x4ca952){if(_0x4ca952){return db[_0x301d('0x3d')][_0x301d('0x2a')](_[_0x301d('0x4c')](_0x32cd09['body'],['exten','context',_0x301d('0x64'),_0x301d('0x65'),_0x301d('0x66'),_0x301d('0x67')]),{'where':{'context':_0x4ca952[_0x301d('0x68')],'exten':_0x4ca952[_0x301d('0x5b')]},'individualHooks':!![]})['then'](function(_0x53b968){return _0x53b968;});}return null;})[_0x301d('0x2b')](respondWithStatusCode(_0x469281,null))[_0x301d('0x54')](handleError(_0x469281,null));};exports[_0x301d('0x69')]=function(_0x39e9cc,_0x1da4ca,_0x53ff42){return db[_0x301d('0x3d')]['findOne']({'where':{'id':_0x39e9cc[_0x301d('0x56')]['id']}})['then'](handleEntityNotFound(_0x1da4ca,null))[_0x301d('0x2b')](function(_0x4852ce){if(_0x4852ce){return db[_0x301d('0x6a')]['transaction'](function(_0x485023){return db[_0x301d('0x3d')]['destroy']({'where':{'VoiceExtensionId':_0x39e9cc[_0x301d('0x56')]['id']},'transaction':_0x485023})[_0x301d('0x2b')](function(_0x17d69f){var _0x440eaa=_[_0x301d('0x32')](_0x39e9cc[_0x301d('0x5a')],function(_0x59d26a){_0x59d26a[_0x301d('0x6b')]=_0x39e9cc[_0x301d('0x56')]['id'];return _0x59d26a;});return db[_0x301d('0x3d')][_0x301d('0x6c')](_0x440eaa,{'transaction':_0x485023});});})[_0x301d('0x2b')](function(){return db[_0x301d('0x3d')][_0x301d('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x39e9cc['params']['id']},'order':_0x301d('0x6e')});});}})[_0x301d('0x2b')](respondWithResult(_0x1da4ca,null))[_0x301d('0x54')](handleError(_0x1da4ca,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4810386..275df1c 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 _0xc353=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','save'];(function(_0x2342f5,_0x12f646){var _0x27dbcb=function(_0x3e1fb2){while(--_0x3e1fb2){_0x2342f5['push'](_0x2342f5['shift']());}};_0x27dbcb(++_0x12f646);}(_0xc353,0xec));var _0x3c35=function(_0x5c37d2,_0x301a1e){_0x5c37d2=_0x5c37d2-0x0;var _0xfa4211=_0xc353[_0x5c37d2];return _0xfa4211;};'use strict';var EventEmitter=require(_0x3c35('0x0'));var VoiceExtension=require(_0x3c35('0x1'))['db'][_0x3c35('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c35('0x3'),'afterUpdate':'update','afterDestroy':_0x3c35('0x4')};function emitEvent(_0x2c158e){return function(_0x29ac62,_0x4b3812,_0x33653f){VoiceExtensionEvents['emit'](_0x2c158e+':'+_0x29ac62['id'],_0x29ac62);VoiceExtensionEvents[_0x3c35('0x5')](_0x2c158e,_0x29ac62);_0x33653f(null);};}for(var e in events){if(events[_0x3c35('0x6')](e)){var event=events[e];VoiceExtension[_0x3c35('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xa18a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','update'];(function(_0x3a8a3b,_0x202e20){var _0x473369=function(_0x4b6c97){while(--_0x4b6c97){_0x3a8a3b['push'](_0x3a8a3b['shift']());}};_0x473369(++_0x202e20);}(_0xa18a,0x125));var _0xaa18=function(_0x219317,_0x6200a5){_0x219317=_0x219317-0x0;var _0x5241c8=_0xa18a[_0x219317];return _0x5241c8;};'use strict';var EventEmitter=require(_0xaa18('0x0'));var VoiceExtension=require(_0xaa18('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa18('0x2'),'afterDestroy':_0xaa18('0x3')};function emitEvent(_0x41f172){return function(_0x335e28,_0x117613,_0x453f5c){VoiceExtensionEvents[_0xaa18('0x4')](_0x41f172+':'+_0x335e28['id'],_0x335e28);VoiceExtensionEvents[_0xaa18('0x4')](_0x41f172,_0x335e28);_0x453f5c(null);};}for(var e in events){if(events[_0xaa18('0x5')](e)){var event=events[e];VoiceExtension[_0xaa18('0x6')](e,emitEvent(event));}}module[_0xaa18('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index a6d15fd..cc4889a 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 _0x772c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','lodash'];(function(_0x58b119,_0x527956){var _0x1c4e9b=function(_0x4acef5){while(--_0x4acef5){_0x58b119['push'](_0x58b119['shift']());}};_0x1c4e9b(++_0x527956);}(_0x772c,0xcf));var _0xc772=function(_0x5b3bf0,_0xe5e437){_0x5b3bf0=_0x5b3bf0-0x0;var _0x512cf1=_0x772c[_0x5b3bf0];return _0x512cf1;};'use strict';var _=require(_0xc772('0x0'));var util=require(_0xc772('0x1'));var logger=require(_0xc772('0x2'))(_0xc772('0x3'));var moment=require(_0xc772('0x4'));var BPromise=require(_0xc772('0x5'));var rp=require(_0xc772('0x6'));var fs=require('fs');var path=require(_0xc772('0x7'));var rimraf=require('rimraf');var config=require(_0xc772('0x8'));var attributes=require(_0xc772('0x9'));module[_0xc772('0xa')]=function(_0x3f7be9,_0x2fe25b){return _0x3f7be9[_0xc772('0xb')](_0xc772('0xc'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ffd=['util','../../config/logger','api','moment','path','./voiceExtension.attributes','exports','define','VoiceExtension','lodash'];(function(_0x396b44,_0x53777a){var _0x170b96=function(_0x17e8eb){while(--_0x17e8eb){_0x396b44['push'](_0x396b44['shift']());}};_0x170b96(++_0x53777a);}(_0x6ffd,0x9f));var _0xd6ff=function(_0x194a38,_0x5b3c36){_0x194a38=_0x194a38-0x0;var _0x280cd6=_0x6ffd[_0x194a38];return _0x280cd6;};'use strict';var _=require(_0xd6ff('0x0'));var util=require(_0xd6ff('0x1'));var logger=require(_0xd6ff('0x2'))(_0xd6ff('0x3'));var moment=require(_0xd6ff('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6ff('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd6ff('0x6'));module[_0xd6ff('0x7')]=function(_0x36dd80,_0x18dff5){return _0x36dd80[_0xd6ff('0x8')](_0xd6ff('0x9'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index c8bb84e..2b127d4 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 _0x5f6f=['stringify','error','message','result','catch','VoiceExtension','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3b9bf5,_0x28c84a){var _0x9da1e=function(_0x33f79a){while(--_0x33f79a){_0x3b9bf5['push'](_0x3b9bf5['shift']());}};_0x9da1e(++_0x28c84a);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x2023e1,_0xeca985){_0x2023e1=_0x2023e1-0x0;var _0x1fe133=_0x5f6f[_0x2023e1];return _0x1fe133;};'use strict';var _=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var moment=require(_0xf5f6('0x2'));var BPromise=require(_0xf5f6('0x3'));var rs=require(_0xf5f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5f6('0x5'))['db'];var utils=require(_0xf5f6('0x6'));var logger=require(_0xf5f6('0x7'))('rpc');var config=require(_0xf5f6('0x8'));var jayson=require(_0xf5f6('0x9'));var client=jayson[_0xf5f6('0xa')][_0xf5f6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf5f6('0xc')],{'host':_0xf5f6('0xd'),'port':0x18eb});var socket=require(_0xf5f6('0xe'))(new Redis(config[_0xf5f6('0xc')]));require(_0xf5f6('0xf'))[_0xf5f6('0x10')](socket);function respondWithRpcPromise(_0x57fc19,_0x5ba0f5,_0x988c4a){return new BPromise(function(_0x369b18,_0x491c14){return client[_0xf5f6('0x11')](_0x57fc19,_0x988c4a)[_0xf5f6('0x12')](function(_0xeb94fb){logger[_0xf5f6('0x13')](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');logger[_0xf5f6('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x5ba0f5,_0xf5f6('0x16'),JSON[_0xf5f6('0x17')](_0xeb94fb));if(_0xeb94fb[_0xf5f6('0x18')]){if(_0xeb94fb[_0xf5f6('0x18')]['code']===0x1f4){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')][_0xf5f6('0x19')]);return _0x491c14(_0xeb94fb['error'][_0xf5f6('0x19')]);}logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')]['message']);return _0x369b18(_0xeb94fb['error'][_0xf5f6('0x19')]);}else{logger['info'](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');_0x369b18(_0xeb94fb[_0xf5f6('0x1a')][_0xf5f6('0x19')]);}})[_0xf5f6('0x1b')](function(_0x301e2a){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0x301e2a);_0x491c14(_0x301e2a);});});}exports['GetVoiceExtension']=function(_0x594162){var _0x3ada74=this;return new Promise(function(_0x332761,_0x261015){return db[_0xf5f6('0x1c')]['findAll']({'raw':_0x594162[_0xf5f6('0x1d')]?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x1e')]===undefined?!![]:![]:!![],'where':_0x594162['options']?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x1f')]||null:null,'attributes':_0x594162[_0xf5f6('0x1d')]?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x20')]||null:null,'limit':_0x594162['options']?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x21')]||null:null,'include':_0x594162[_0xf5f6('0x1d')]?_0x594162['options'][_0xf5f6('0x22')]?_[_0xf5f6('0x23')](_0x594162[_0xf5f6('0x1d')]['include'],function(_0x537a81){return{'model':db[_0x537a81[_0xf5f6('0x24')]],'as':_0x537a81['as'],'attributes':_0x537a81[_0xf5f6('0x20')],'include':_0x537a81[_0xf5f6('0x22')]?_[_0xf5f6('0x23')](_0x537a81['include'],function(_0xb2fab7){return{'model':db[_0xb2fab7[_0xf5f6('0x24')]],'as':_0xb2fab7['as'],'attributes':_0xb2fab7['attributes'],'include':_0xb2fab7[_0xf5f6('0x22')]?_['map'](_0xb2fab7[_0xf5f6('0x22')],function(_0x8867ac){return{'model':db[_0x8867ac['model']],'as':_0x8867ac['as'],'attributes':_0x8867ac[_0xf5f6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f6('0x12')](function(_0x19d7f0){logger[_0xf5f6('0x13')]('GetVoiceExtension',_0x594162);logger[_0xf5f6('0x15')]('GetVoiceExtension',_0x594162,JSON[_0xf5f6('0x17')](_0x19d7f0));_0x332761(_0x19d7f0);})[_0xf5f6('0x1b')](function(_0x202565){logger[_0xf5f6('0x18')]('GetVoiceExtension',_0x202565[_0xf5f6('0x19')],_0x594162);_0x261015(_0x3ada74['error'](0x1f4,_0x202565[_0xf5f6('0x19')]));});});}; \ No newline at end of file +var _0x9fd4=['message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x427cf2,_0xecd195){var _0x3cb982=function(_0x48fc33){while(--_0x48fc33){_0x427cf2['push'](_0x427cf2['shift']());}};_0x3cb982(++_0xecd195);}(_0x9fd4,0x16c));var _0x49fd=function(_0x494f4d,_0x2807fa){_0x494f4d=_0x494f4d-0x0;var _0x3e7dfc=_0x9fd4[_0x494f4d];return _0x3e7dfc;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var moment=require(_0x49fd('0x2'));var BPromise=require(_0x49fd('0x3'));var rs=require(_0x49fd('0x4'));var fs=require('fs');var Redis=require(_0x49fd('0x5'));var db=require(_0x49fd('0x6'))['db'];var utils=require(_0x49fd('0x7'));var logger=require(_0x49fd('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x49fd('0x9'));var client=jayson[_0x49fd('0xa')][_0x49fd('0xb')]({'port':0x232a});config[_0x49fd('0xc')]=_['defaults'](config[_0x49fd('0xc')],{'host':_0x49fd('0xd'),'port':0x18eb});var socket=require(_0x49fd('0xe'))(new Redis(config[_0x49fd('0xc')]));require(_0x49fd('0xf'))['register'](socket);function respondWithRpcPromise(_0x35034c,_0x130c9b,_0x3e1c71){return new BPromise(function(_0x4969d3,_0x426ec2){return client[_0x49fd('0x10')](_0x35034c,_0x3e1c71)[_0x49fd('0x11')](function(_0x53a44e){logger[_0x49fd('0x12')](_0x49fd('0x13'),_0x130c9b,_0x49fd('0x14'));logger[_0x49fd('0x15')](_0x49fd('0x16'),_0x130c9b,_0x49fd('0x14'),JSON[_0x49fd('0x17')](_0x53a44e));if(_0x53a44e[_0x49fd('0x18')]){if(_0x53a44e[_0x49fd('0x18')][_0x49fd('0x19')]===0x1f4){logger[_0x49fd('0x18')](_0x49fd('0x13'),_0x130c9b,_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);return _0x426ec2(_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);}logger[_0x49fd('0x18')](_0x49fd('0x13'),_0x130c9b,_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);return _0x4969d3(_0x53a44e[_0x49fd('0x18')][_0x49fd('0x1a')]);}else{logger[_0x49fd('0x12')](_0x49fd('0x13'),_0x130c9b,_0x49fd('0x14'));_0x4969d3(_0x53a44e[_0x49fd('0x1b')]['message']);}})[_0x49fd('0x1c')](function(_0x3fd46b){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x130c9b,_0x3fd46b);_0x426ec2(_0x3fd46b);});});}exports[_0x49fd('0x1d')]=function(_0x53cbd1){var _0x316e7c=this;return new Promise(function(_0xbb113b,_0x599315){return db[_0x49fd('0x1e')][_0x49fd('0x1f')]({'raw':_0x53cbd1['options']?_0x53cbd1[_0x49fd('0x20')][_0x49fd('0x21')]===undefined?!![]:![]:!![],'where':_0x53cbd1[_0x49fd('0x20')]?_0x53cbd1[_0x49fd('0x20')][_0x49fd('0x22')]||null:null,'attributes':_0x53cbd1[_0x49fd('0x20')]?_0x53cbd1['options'][_0x49fd('0x23')]||null:null,'limit':_0x53cbd1[_0x49fd('0x20')]?_0x53cbd1[_0x49fd('0x20')]['limit']||null:null,'include':_0x53cbd1[_0x49fd('0x20')]?_0x53cbd1[_0x49fd('0x20')][_0x49fd('0x24')]?_['map'](_0x53cbd1['options']['include'],function(_0x13c5a8){return{'model':db[_0x13c5a8[_0x49fd('0x25')]],'as':_0x13c5a8['as'],'attributes':_0x13c5a8[_0x49fd('0x23')],'include':_0x13c5a8[_0x49fd('0x24')]?_[_0x49fd('0x26')](_0x13c5a8[_0x49fd('0x24')],function(_0x20873e){return{'model':db[_0x20873e[_0x49fd('0x25')]],'as':_0x20873e['as'],'attributes':_0x20873e['attributes'],'include':_0x20873e[_0x49fd('0x24')]?_['map'](_0x20873e[_0x49fd('0x24')],function(_0x89badc){return{'model':db[_0x89badc['model']],'as':_0x89badc['as'],'attributes':_0x89badc[_0x49fd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x49fd('0x11')](function(_0x23374c){logger[_0x49fd('0x12')](_0x49fd('0x1d'),_0x53cbd1);logger[_0x49fd('0x15')](_0x49fd('0x1d'),_0x53cbd1,JSON[_0x49fd('0x17')](_0x23374c));_0xbb113b(_0x23374c);})['catch'](function(_0x42181b){logger['error'](_0x49fd('0x1d'),_0x42181b['message'],_0x53cbd1);_0x599315(_0x316e7c[_0x49fd('0x18')](0x1f4,_0x42181b[_0x49fd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 9299a8f..b804634 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x2d34f7,_0xca8267){var _0x4269c7=function(_0x55a019){while(--_0x55a019){_0x2d34f7['push'](_0x2d34f7['shift']());}};_0x4269c7(++_0xca8267);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x542a5d,_0x27e6c8){var _0x251378=function(_0x295247){while(--_0x295247){_0x542a5d['push'](_0x542a5d['shift']());}};_0x251378(++_0x27e6c8);}(_0x2ef3,0xba));var _0x32ef=function(_0x25f818,_0x4cdd64){_0x25f818=_0x25f818-0x0;var _0x4c054d=_0x2ef3[_0x25f818];return _0x4c054d;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 82bcbb9..bcd3f6a 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 _0xf61e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','show','getMessages','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c4a11,_0x9bf23b){var _0x18d605=function(_0x307176){while(--_0x307176){_0x4c4a11['push'](_0x4c4a11['shift']());}};_0x18d605(++_0x9bf23b);}(_0xf61e,0x191));var _0xef61=function(_0xf8dcde,_0x3d9e32){_0xf8dcde=_0xf8dcde-0x0;var _0x4508c5=_0xf61e[_0xf8dcde];return _0x4508c5;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/:id',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0x10')]('/',auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0x12')](_0xef61('0x13'),auth[_0xef61('0xd')](),controller[_0xef61('0x14')]);router[_0xef61('0x15')](_0xef61('0x13'),auth[_0xef61('0xd')](),controller[_0xef61('0x16')]);module[_0xef61('0x17')]=router; \ No newline at end of file +var _0xe2fe=['show','/:id/messages','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x361422,_0xa27d1e){var _0x2daa43=function(_0x1ad8f6){while(--_0x1ad8f6){_0x361422['push'](_0x361422['shift']());}};_0x2daa43(++_0xa27d1e);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./voiceMail.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['getMessages']);router[_0xee2f('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 5525550..0eea4a0 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 _0xd660=['trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xd660,0xdb));var _0x0d66=function(_0x22a866,_0xfe7c94){_0x22a866=_0x22a866-0x0;var _0xd1545a=_0xd660[_0x22a866];return _0xd1545a;};'use strict';var Sequelize=require(_0x0d66('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x0d66('0x1')]},'context':{'type':Sequelize[_0x0d66('0x1')],'defaultValue':'from-voicemail','unique':_0x0d66('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x0d66('0x2')},'password':{'type':Sequelize[_0x0d66('0x1')]},'fullname':{'type':Sequelize[_0x0d66('0x1')]},'email':{'type':Sequelize[_0x0d66('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2e452b){this[_0x0d66('0x3')](_0x0d66('0x4'),typeof _0x2e452b==='string'&&_0x2e452b[_0x0d66('0x5')]()?_0x2e452b[_0x0d66('0x5')]():null);}},'pager':{'type':Sequelize[_0x0d66('0x1')]},'tz':{'type':Sequelize[_0x0d66('0x1')],'defaultValue':_0x0d66('0x6')},'attach':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0d66('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0d66('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0d66('0x7')]('yes','no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x0d66('0x1')]},'emailbody':{'type':Sequelize[_0x0d66('0x1')]},'maxsecs':{'type':Sequelize[_0x0d66('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0d66('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0d66('0xb')],'get':function(){return this['getDataValue']('fullname')+'\x20-\x20'+this[_0x0d66('0xc')](_0x0d66('0xd'));}}}; \ No newline at end of file +var _0x70c0=['trim','ENUM','yes','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email'];(function(_0x1b60df,_0x568c49){var _0x4ce97d=function(_0x5f38eb){while(--_0x5f38eb){_0x1b60df['push'](_0x1b60df['shift']());}};_0x4ce97d(++_0x568c49);}(_0x70c0,0x1e4));var _0x070c=function(_0x5e7bd6,_0x26fb5a){_0x5e7bd6=_0x5e7bd6-0x0;var _0x3335b3=_0x70c0[_0x5e7bd6];return _0x3335b3;};'use strict';var Sequelize=require(_0x070c('0x0'));module[_0x070c('0x1')]={'customer_id':{'type':Sequelize[_0x070c('0x2')]},'context':{'type':Sequelize[_0x070c('0x2')],'defaultValue':'from-voicemail','unique':_0x070c('0x3')},'mailbox':{'type':Sequelize[_0x070c('0x2')],'defaultValue':'','allowNull':![],'unique':_0x070c('0x3')},'password':{'type':Sequelize[_0x070c('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x070c('0x2')],'validate':{'isEmail':!![]},'set':function(_0x320640){this[_0x070c('0x4')](_0x070c('0x5'),typeof _0x320640==='string'&&_0x320640[_0x070c('0x6')]()?_0x320640['trim']():null);}},'pager':{'type':Sequelize[_0x070c('0x2')]},'tz':{'type':Sequelize[_0x070c('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x070c('0x7')](_0x070c('0x8'),'no'),'defaultValue':_0x070c('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x070c('0x8'),'no'),'defaultValue':_0x070c('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x070c('0x2')]},'callback':{'type':Sequelize[_0x070c('0x2')]},'review':{'type':Sequelize[_0x070c('0x7')](_0x070c('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x070c('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x070c('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x070c('0x7')](_0x070c('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x070c('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x070c('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x070c('0x8'),'no'),'defaultValue':_0x070c('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x070c('0x7')](_0x070c('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x070c('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x070c('0x7')]('yes','no'),'defaultValue':_0x070c('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x070c('0x2')]},'emailbody':{'type':Sequelize[_0x070c('0x2')]},'maxsecs':{'type':Sequelize[_0x070c('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x070c('0xa')],'get':function(){return this['getDataValue'](_0x070c('0xb'))+'\x20-\x20'+this[_0x070c('0xc')](_0x070c('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index bcaa358..ae8eb64 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 _0x4cf8=['UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceMail','include','findAll','catch','find','create','body','user','UserProfileSection','userProfileId','params','getMessages','findOne','VoiceMailMessage','mailbox','options','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x4cf8,0x1e1));var _0x84cf=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x4cf8[_0xc87d08];return _0x30a714;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){var _0x1c7747=_0x4c9d1c[_0x84cf('0x27')]({'plain':!![]});var _0x1d220a=_0x84cf('0x28');return db[_0x84cf('0x29')][_0x84cf('0x26')]({'where':{'type':_0x1d220a,'resourceId':_0x1c7747['id']}})[_0x84cf('0x25')](function(){return _0x4c9d1c;});})[_0x84cf('0x25')](function(){_0x29e9e1['status'](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x17bc92,_0x2a4973){return function(_0x41a5db){if(!_0x41a5db){_0x17bc92['sendStatus'](0x194);}return _0x41a5db;};}function handleError(_0x1595dd,_0x5a428c){_0x5a428c=_0x5a428c||0x1f4;return function(_0x29455e){logger[_0x84cf('0x2a')](_0x29455e[_0x84cf('0x2b')]);if(_0x29455e[_0x84cf('0x2c')]){delete _0x29455e[_0x84cf('0x2c')];}_0x1595dd[_0x84cf('0x19')](_0x5a428c)[_0x84cf('0x2d')](_0x29455e);};}exports[_0x84cf('0x2e')]=function(_0x1bfa56,_0xb4fc5a){var _0x31dbf5={},_0x308f8f={},_0x18243d={'count':0x0,'rows':[]};var _0x44f16e=_['map'](db['VoiceMail'][_0x84cf('0x2f')],function(_0x25de3a){return{'name':_0x25de3a[_0x84cf('0x30')],'type':_0x25de3a[_0x84cf('0x31')][_0x84cf('0x32')]};});_0x308f8f[_0x84cf('0x33')]=_[_0x84cf('0x34')](_0x44f16e,_0x84cf('0x2c'));_0x308f8f['query']=_[_0x84cf('0x35')](_0x1bfa56[_0x84cf('0x36')]);_0x308f8f['filters']=_[_0x84cf('0x37')](_0x308f8f['model'],_0x308f8f[_0x84cf('0x36')]);_0x31dbf5[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x308f8f[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x1bfa56['query'][_0x84cf('0x39')]));_0x31dbf5['attributes']=_0x31dbf5['attributes'][_0x84cf('0x3a')]?_0x31dbf5[_0x84cf('0x38')]:_0x308f8f['model'];if(!_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x3b')](_0x84cf('0x3c'))){_0x31dbf5[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x1bfa56[_0x84cf('0x36')]['limit']);_0x31dbf5[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x1c')]);}_0x31dbf5[_0x84cf('0x3e')]=qs[_0x84cf('0x3f')](_0x1bfa56['query'][_0x84cf('0x3f')]);_0x31dbf5['where']=qs[_0x84cf('0x40')](_[_0x84cf('0x41')](_0x1bfa56[_0x84cf('0x36')],_0x308f8f[_0x84cf('0x40')]),_0x44f16e);if(_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x42')]){_0x31dbf5[_0x84cf('0x43')]=_[_0x84cf('0x44')](_0x31dbf5[_0x84cf('0x43')],{'$or':_['map'](_0x44f16e,function(_0x44e6f0){if(_0x44e6f0['type']!==_0x84cf('0x45')){var _0xc75386={};_0xc75386[_0x44e6f0['name']]={'$like':'%'+_0x1bfa56[_0x84cf('0x36')]['filter']+'%'};return _0xc75386;}})});}_0x31dbf5=_[_0x84cf('0x44')]({},_0x31dbf5,_0x1bfa56['options']);var _0x3fc160={'where':_0x31dbf5['where']};return db[_0x84cf('0x46')][_0x84cf('0x1e')](_0x3fc160)['then'](function(_0x847ce9){_0x18243d[_0x84cf('0x1e')]=_0x847ce9;if(_0x1bfa56[_0x84cf('0x36')]['includeAll']){_0x31dbf5[_0x84cf('0x47')]=[{'all':!![]}];}return db['VoiceMail'][_0x84cf('0x48')](_0x31dbf5);})['then'](function(_0x56b0e5){_0x18243d['rows']=_0x56b0e5;return _0x18243d;})[_0x84cf('0x25')](respondWithFilteredResult(_0xb4fc5a,_0x31dbf5))[_0x84cf('0x49')](handleError(_0xb4fc5a,null));};exports['show']=function(_0x2b737e,_0x56b623){var _0x191ad8={'raw':!![],'where':{'id':_0x2b737e['params']['id']}},_0x3fe8c1={};_0x3fe8c1[_0x84cf('0x33')]=_['keys'](db[_0x84cf('0x46')]['rawAttributes']);_0x3fe8c1['query']=_['keys'](_0x2b737e['query']);_0x3fe8c1['filters']=_['intersection'](_0x3fe8c1['model'],_0x3fe8c1[_0x84cf('0x36')]);_0x191ad8[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x3fe8c1[_0x84cf('0x33')],qs['fields'](_0x2b737e[_0x84cf('0x36')]['fields']));_0x191ad8[_0x84cf('0x38')]=_0x191ad8[_0x84cf('0x38')][_0x84cf('0x3a')]?_0x191ad8[_0x84cf('0x38')]:_0x3fe8c1[_0x84cf('0x33')];if(_0x2b737e[_0x84cf('0x36')]['includeAll']){_0x191ad8[_0x84cf('0x47')]=[{'all':!![]}];}_0x191ad8=_[_0x84cf('0x44')]({},_0x191ad8,_0x2b737e['options']);return db[_0x84cf('0x46')][_0x84cf('0x4a')](_0x191ad8)[_0x84cf('0x25')](handleEntityNotFound(_0x56b623,null))['then'](respondWithResult(_0x56b623,null))['catch'](handleError(_0x56b623,null));};exports['create']=function(_0x1cf3f6,_0x104421){return db[_0x84cf('0x46')][_0x84cf('0x4b')](_0x1cf3f6[_0x84cf('0x4c')],{})[_0x84cf('0x25')](function(_0x51d725){var _0x350985=_0x1cf3f6['user'][_0x84cf('0x27')]({'plain':!![]});if(!_0x350985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x350985['role']===_0x84cf('0x4d')){var _0xb1c3a8=_0x51d725[_0x84cf('0x27')]({'plain':!![]});var _0x55e24e='Voicemails';return db[_0x84cf('0x4e')][_0x84cf('0x4a')]({'where':{'name':_0x55e24e,'userProfileId':_0x350985[_0x84cf('0x4f')]},'raw':!![]})[_0x84cf('0x25')](function(_0x401ced){if(_0x401ced&&_0x401ced['autoAssociation']===0x0){return db[_0x84cf('0x29')][_0x84cf('0x4b')]({'name':_0xb1c3a8['name'],'resourceId':_0xb1c3a8['id'],'type':_0x401ced[_0x84cf('0x2c')],'sectionId':_0x401ced['id']},{})['then'](function(){return _0x51d725;});}else{return _0x51d725;}})['catch'](function(_0x147194){logger[_0x84cf('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x147194);throw _0x147194;});}return _0x51d725;})['then'](respondWithResult(_0x104421,0xc9))[_0x84cf('0x49')](handleError(_0x104421,null));};exports[_0x84cf('0x24')]=function(_0x2f739a,_0x1e2676){if(_0x2f739a[_0x84cf('0x4c')]['id']){delete _0x2f739a[_0x84cf('0x4c')]['id'];}return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x2f739a['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x1e2676,null))[_0x84cf('0x25')](saveUpdates(_0x2f739a['body'],null))['then'](respondWithResult(_0x1e2676,null))[_0x84cf('0x49')](handleError(_0x1e2676,null));};exports[_0x84cf('0x26')]=function(_0x3912cb,_0x2a4f20){return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x3912cb[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a4f20,null))[_0x84cf('0x25')](removeEntity(_0x2a4f20,null))['catch'](handleError(_0x2a4f20,null));};exports[_0x84cf('0x51')]=function(_0x5c0122,_0x2a60bc,_0x1c2f1b){return db['VoiceMail'][_0x84cf('0x52')]({'where':{'id':_0x5c0122[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a60bc,null))[_0x84cf('0x25')](function(_0x53bfb8){var _0x577d55;var _0x5cc371={},_0x50cde2={};_0x50cde2[_0x84cf('0x33')]=_[_0x84cf('0x35')](db[_0x84cf('0x53')][_0x84cf('0x2f')]);_0x50cde2['query']=_[_0x84cf('0x35')](_0x5c0122[_0x84cf('0x36')]);_0x50cde2['filters']=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],_0x50cde2[_0x84cf('0x36')]);_0x5cc371[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x5c0122[_0x84cf('0x36')]['fields']));_0x5cc371[_0x84cf('0x38')]=_0x5cc371['attributes'][_0x84cf('0x3a')]?_0x5cc371[_0x84cf('0x38')]:_0x50cde2[_0x84cf('0x33')];if(!_0x5c0122[_0x84cf('0x36')][_0x84cf('0x3b')]('nolimit')){_0x5cc371[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x5c0122[_0x84cf('0x36')]['limit']);_0x5cc371[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x5c0122['query'][_0x84cf('0x1c')]);}_0x5cc371['order']=qs[_0x84cf('0x3f')](_0x5c0122[_0x84cf('0x36')]['sort']);_0x5cc371[_0x84cf('0x43')]=qs[_0x84cf('0x40')](_['pick'](_0x5c0122[_0x84cf('0x36')],_0x50cde2[_0x84cf('0x40')]));if(_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]){_0x5cc371['where']=_[_0x84cf('0x44')](_0x5cc371[_0x84cf('0x43')],{'$or':_['map'](_0x5cc371['attributes'],function(_0x4d40e2){var _0x1b000c={};_0x1b000c[_0x4d40e2]={'$like':'%'+_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]+'%'};return _0x1b000c;})});}_0x5cc371['where']=_['merge'](_0x5cc371[_0x84cf('0x43')],{'mailboxuser':_0x53bfb8[_0x84cf('0x54')]});_0x5cc371=_[_0x84cf('0x44')]({},_0x5cc371,_0x5c0122[_0x84cf('0x55')]);return db[_0x84cf('0x53')][_0x84cf('0x56')](_0x5cc371)[_0x84cf('0x25')](respondWithFilteredResult(_0x2a60bc,_0x5cc371));})[_0x84cf('0x49')](handleError(_0x2a60bc,null));}; \ No newline at end of file +var _0x91a7=['status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','includeAll','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','getMessages','findOne','VoiceMailMessage','order','mailbox','options','findAndCountAll','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x91a7,0xe7));var _0x791a=function(_0x291a62,_0x1ca31d){_0x291a62=_0x291a62-0x0;var _0x305ce9=_0x91a7[_0x291a62];return _0x305ce9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){var _0x1102c9=_0xe8e452[_0x791a('0x24')]({'plain':!![]});var _0x380329=_0x791a('0x25');return db['UserProfileResource'][_0x791a('0x23')]({'where':{'type':_0x380329,'resourceId':_0x1102c9['id']}})[_0x791a('0x22')](function(){return _0xe8e452;});})['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x16dbaf,_0x4c1626){return function(_0x29194d){if(!_0x29194d){_0x16dbaf[_0x791a('0x16')](0x194);}return _0x29194d;};}function handleError(_0x2b0784,_0x395376){_0x395376=_0x395376||0x1f4;return function(_0x4f423){logger[_0x791a('0x26')](_0x4f423[_0x791a('0x27')]);if(_0x4f423[_0x791a('0x28')]){delete _0x4f423['name'];}_0x2b0784[_0x791a('0x18')](_0x395376)[_0x791a('0x29')](_0x4f423);};}exports[_0x791a('0x2a')]=function(_0x59d2c0,_0x1cdda9){var _0x5df656={},_0xc59f5e={},_0x2e4ec8={'count':0x0,'rows':[]};var _0xcde862=_[_0x791a('0x2b')](db[_0x791a('0x2c')][_0x791a('0x2d')],function(_0x15ff6e){return{'name':_0x15ff6e['fieldName'],'type':_0x15ff6e[_0x791a('0x2e')][_0x791a('0x2f')]};});_0xc59f5e[_0x791a('0x30')]=_[_0x791a('0x2b')](_0xcde862,_0x791a('0x28'));_0xc59f5e['query']=_[_0x791a('0x31')](_0x59d2c0[_0x791a('0x32')]);_0xc59f5e[_0x791a('0x33')]=_[_0x791a('0x34')](_0xc59f5e[_0x791a('0x30')],_0xc59f5e['query']);_0x5df656[_0x791a('0x35')]=_[_0x791a('0x34')](_0xc59f5e[_0x791a('0x30')],qs[_0x791a('0x36')](_0x59d2c0[_0x791a('0x32')]['fields']));_0x5df656[_0x791a('0x35')]=_0x5df656['attributes'][_0x791a('0x37')]?_0x5df656['attributes']:_0xc59f5e['model'];if(!_0x59d2c0[_0x791a('0x32')][_0x791a('0x38')](_0x791a('0x39'))){_0x5df656[_0x791a('0x3a')]=qs[_0x791a('0x3a')](_0x59d2c0[_0x791a('0x32')][_0x791a('0x3a')]);_0x5df656['offset']=qs[_0x791a('0x1a')](_0x59d2c0['query'][_0x791a('0x1a')]);}_0x5df656['order']=qs[_0x791a('0x3b')](_0x59d2c0[_0x791a('0x32')]['sort']);_0x5df656[_0x791a('0x3c')]=qs[_0x791a('0x33')](_['pick'](_0x59d2c0[_0x791a('0x32')],_0xc59f5e[_0x791a('0x33')]),_0xcde862);if(_0x59d2c0[_0x791a('0x32')][_0x791a('0x3d')]){_0x5df656[_0x791a('0x3c')]=_[_0x791a('0x3e')](_0x5df656[_0x791a('0x3c')],{'$or':_[_0x791a('0x2b')](_0xcde862,function(_0xc0fb63){if(_0xc0fb63[_0x791a('0x2e')]!=='VIRTUAL'){var _0x15f066={};_0x15f066[_0xc0fb63[_0x791a('0x28')]]={'$like':'%'+_0x59d2c0[_0x791a('0x32')]['filter']+'%'};return _0x15f066;}})});}_0x5df656=_[_0x791a('0x3e')]({},_0x5df656,_0x59d2c0['options']);var _0x5bad7d={'where':_0x5df656['where']};return db[_0x791a('0x2c')][_0x791a('0x1c')](_0x5bad7d)['then'](function(_0x415c44){_0x2e4ec8[_0x791a('0x1c')]=_0x415c44;if(_0x59d2c0[_0x791a('0x32')][_0x791a('0x3f')]){_0x5df656['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x5df656);})[_0x791a('0x22')](function(_0x216dd3){_0x2e4ec8['rows']=_0x216dd3;return _0x2e4ec8;})[_0x791a('0x22')](respondWithFilteredResult(_0x1cdda9,_0x5df656))[_0x791a('0x40')](handleError(_0x1cdda9,null));};exports[_0x791a('0x41')]=function(_0x954164,_0x508727){var _0x11263d={'raw':!![],'where':{'id':_0x954164[_0x791a('0x42')]['id']}},_0x5911db={};_0x5911db[_0x791a('0x30')]=_[_0x791a('0x31')](db[_0x791a('0x2c')][_0x791a('0x2d')]);_0x5911db['query']=_[_0x791a('0x31')](_0x954164[_0x791a('0x32')]);_0x5911db[_0x791a('0x33')]=_[_0x791a('0x34')](_0x5911db[_0x791a('0x30')],_0x5911db['query']);_0x11263d[_0x791a('0x35')]=_[_0x791a('0x34')](_0x5911db['model'],qs['fields'](_0x954164[_0x791a('0x32')][_0x791a('0x36')]));_0x11263d[_0x791a('0x35')]=_0x11263d['attributes']['length']?_0x11263d[_0x791a('0x35')]:_0x5911db[_0x791a('0x30')];if(_0x954164['query'][_0x791a('0x3f')]){_0x11263d[_0x791a('0x43')]=[{'all':!![]}];}_0x11263d=_[_0x791a('0x3e')]({},_0x11263d,_0x954164['options']);return db['VoiceMail'][_0x791a('0x44')](_0x11263d)[_0x791a('0x22')](handleEntityNotFound(_0x508727,null))[_0x791a('0x22')](respondWithResult(_0x508727,null))[_0x791a('0x40')](handleError(_0x508727,null));};exports['create']=function(_0x2d7c7d,_0x9f768a){return db[_0x791a('0x2c')][_0x791a('0x45')](_0x2d7c7d['body'],{})[_0x791a('0x22')](function(_0x19654d){var _0xe0696b=_0x2d7c7d[_0x791a('0x46')][_0x791a('0x24')]({'plain':!![]});if(!_0xe0696b)throw new Error(_0x791a('0x47'));if(_0xe0696b[_0x791a('0x48')]==='user'){var _0xdcb1b=_0x19654d[_0x791a('0x24')]({'plain':!![]});var _0x4bffa6=_0x791a('0x25');return db[_0x791a('0x49')]['find']({'where':{'name':_0x4bffa6,'userProfileId':_0xe0696b[_0x791a('0x4a')]},'raw':!![]})[_0x791a('0x22')](function(_0x12178e){if(_0x12178e&&_0x12178e[_0x791a('0x4b')]===0x0){return db[_0x791a('0x4c')]['create']({'name':_0xdcb1b['name'],'resourceId':_0xdcb1b['id'],'type':_0x12178e['name'],'sectionId':_0x12178e['id']},{})[_0x791a('0x22')](function(){return _0x19654d;});}else{return _0x19654d;}})['catch'](function(_0x4c7555){logger[_0x791a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7555);throw _0x4c7555;});}return _0x19654d;})[_0x791a('0x22')](respondWithResult(_0x9f768a,0xc9))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['update']=function(_0x5166b5,_0x3599f6){if(_0x5166b5['body']['id']){delete _0x5166b5[_0x791a('0x4d')]['id'];}return db[_0x791a('0x2c')][_0x791a('0x44')]({'where':{'id':_0x5166b5['params']['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x3599f6,null))[_0x791a('0x22')](saveUpdates(_0x5166b5['body'],null))[_0x791a('0x22')](respondWithResult(_0x3599f6,null))[_0x791a('0x40')](handleError(_0x3599f6,null));};exports[_0x791a('0x23')]=function(_0x34d53c,_0x450ad8){return db[_0x791a('0x2c')]['find']({'where':{'id':_0x34d53c['params']['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x450ad8,null))['then'](removeEntity(_0x450ad8,null))[_0x791a('0x40')](handleError(_0x450ad8,null));};exports[_0x791a('0x4e')]=function(_0x18ad89,_0xf11dea,_0x3b760c){return db[_0x791a('0x2c')][_0x791a('0x4f')]({'where':{'id':_0x18ad89['params']['id']}})[_0x791a('0x22')](handleEntityNotFound(_0xf11dea,null))[_0x791a('0x22')](function(_0xc34c5b){var _0x1a4376;var _0x2d671f={},_0xe062f1={};_0xe062f1[_0x791a('0x30')]=_['keys'](db[_0x791a('0x50')]['rawAttributes']);_0xe062f1['query']=_[_0x791a('0x31')](_0x18ad89[_0x791a('0x32')]);_0xe062f1[_0x791a('0x33')]=_[_0x791a('0x34')](_0xe062f1[_0x791a('0x30')],_0xe062f1[_0x791a('0x32')]);_0x2d671f[_0x791a('0x35')]=_[_0x791a('0x34')](_0xe062f1[_0x791a('0x30')],qs[_0x791a('0x36')](_0x18ad89[_0x791a('0x32')][_0x791a('0x36')]));_0x2d671f[_0x791a('0x35')]=_0x2d671f[_0x791a('0x35')][_0x791a('0x37')]?_0x2d671f[_0x791a('0x35')]:_0xe062f1[_0x791a('0x30')];if(!_0x18ad89[_0x791a('0x32')][_0x791a('0x38')](_0x791a('0x39'))){_0x2d671f['limit']=qs[_0x791a('0x3a')](_0x18ad89[_0x791a('0x32')][_0x791a('0x3a')]);_0x2d671f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0x18ad89['query'][_0x791a('0x1a')]);}_0x2d671f[_0x791a('0x51')]=qs[_0x791a('0x3b')](_0x18ad89[_0x791a('0x32')]['sort']);_0x2d671f[_0x791a('0x3c')]=qs['filters'](_['pick'](_0x18ad89['query'],_0xe062f1['filters']));if(_0x18ad89[_0x791a('0x32')][_0x791a('0x3d')]){_0x2d671f[_0x791a('0x3c')]=_[_0x791a('0x3e')](_0x2d671f[_0x791a('0x3c')],{'$or':_[_0x791a('0x2b')](_0x2d671f[_0x791a('0x35')],function(_0x5dca78){var _0x522cb8={};_0x522cb8[_0x5dca78]={'$like':'%'+_0x18ad89[_0x791a('0x32')][_0x791a('0x3d')]+'%'};return _0x522cb8;})});}_0x2d671f['where']=_['merge'](_0x2d671f[_0x791a('0x3c')],{'mailboxuser':_0xc34c5b[_0x791a('0x52')]});_0x2d671f=_['merge']({},_0x2d671f,_0x18ad89[_0x791a('0x53')]);return db[_0x791a('0x50')][_0x791a('0x54')](_0x2d671f)[_0x791a('0x22')](respondWithFilteredResult(_0xf11dea,_0x2d671f));})['catch'](handleError(_0xf11dea,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 097e83d..c9fdf48 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 _0xaf8a=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','moment','bluebird','path'];(function(_0x312f97,_0x1abd76){var _0x3e134e=function(_0xd9f87d){while(--_0xd9f87d){_0x312f97['push'](_0x312f97['shift']());}};_0x3e134e(++_0x1abd76);}(_0xaf8a,0xcd));var _0xaaf8=function(_0x378fbb,_0x59d4d5){_0x378fbb=_0x378fbb-0x0;var _0x2d91d3=_0xaf8a[_0x378fbb];return _0x2d91d3;};'use strict';var _=require(_0xaaf8('0x0'));var util=require('util');var logger=require(_0xaaf8('0x1'))('api');var moment=require(_0xaaf8('0x2'));var BPromise=require(_0xaaf8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaf8('0x4'));var rimraf=require(_0xaaf8('0x5'));var config=require(_0xaaf8('0x6'));var attributes=require(_0xaaf8('0x7'));module[_0xaaf8('0x8')]=function(_0x148df1,_0x21ee6f){return _0x148df1[_0xaaf8('0x9')]('VoiceMail',attributes,{'tableName':_0xaaf8('0xa'),'paranoid':![],'indexes':[{'name':_0xaaf8('0xb'),'fields':[_0xaaf8('0xc'),_0xaaf8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb601=['exports','define','VoiceMail','mailbox_context','mailbox','context','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0xb601,0xc9));var _0x1b60=function(_0x3b477d,_0x4495f9){_0x3b477d=_0x3b477d-0x0;var _0x45d4eb=_0xb601[_0x3b477d];return _0x45d4eb;};'use strict';var _=require('lodash');var util=require(_0x1b60('0x0'));var logger=require(_0x1b60('0x1'))(_0x1b60('0x2'));var moment=require(_0x1b60('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b60('0x4'));var fs=require('fs');var path=require(_0x1b60('0x5'));var rimraf=require('rimraf');var config=require(_0x1b60('0x6'));var attributes=require('./voiceMail.attributes');module[_0x1b60('0x7')]=function(_0x34197f,_0x36b887){return _0x34197f[_0x1b60('0x8')](_0x1b60('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x1b60('0xa'),'fields':[_0x1b60('0xb'),_0x1b60('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 1d23ba9..d25cadf 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 _0x1770=['code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa4f54b,_0x219d67){var _0x29f24c=function(_0x1b7ca7){while(--_0x1b7ca7){_0xa4f54b['push'](_0xa4f54b['shift']());}};_0x29f24c(++_0x219d67);}(_0x1770,0x194));var _0x0177=function(_0xb04224,_0x3877f7){_0xb04224=_0xb04224-0x0;var _0xe09de9=_0x1770[_0xb04224];return _0xe09de9;};'use strict';var _=require(_0x0177('0x0'));var util=require('util');var moment=require(_0x0177('0x1'));var BPromise=require('bluebird');var rs=require(_0x0177('0x2'));var fs=require('fs');var Redis=require(_0x0177('0x3'));var db=require(_0x0177('0x4'))['db'];var utils=require(_0x0177('0x5'));var logger=require('../../config/logger')(_0x0177('0x6'));var config=require('../../config/environment');var jayson=require(_0x0177('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c76de,_0x37cf16,_0x208227){return new BPromise(function(_0x3dfb59,_0x4111f2){return client['request'](_0x1c76de,_0x208227)[_0x0177('0x8')](function(_0x3342b1){logger[_0x0177('0x9')](_0x0177('0xa'),_0x37cf16,_0x0177('0xb'));logger[_0x0177('0xc')](_0x0177('0xd'),_0x37cf16,_0x0177('0xb'),JSON[_0x0177('0xe')](_0x3342b1));if(_0x3342b1[_0x0177('0xf')]){if(_0x3342b1[_0x0177('0xf')][_0x0177('0x10')]===0x1f4){logger['error'](_0x0177('0xa'),_0x37cf16,_0x3342b1[_0x0177('0xf')][_0x0177('0x11')]);return _0x4111f2(_0x3342b1[_0x0177('0xf')]['message']);}logger[_0x0177('0xf')](_0x0177('0xa'),_0x37cf16,_0x3342b1[_0x0177('0xf')][_0x0177('0x11')]);return _0x3dfb59(_0x3342b1[_0x0177('0xf')][_0x0177('0x11')]);}else{logger[_0x0177('0x9')](_0x0177('0xa'),_0x37cf16,_0x0177('0xb'));_0x3dfb59(_0x3342b1[_0x0177('0x12')][_0x0177('0x11')]);}})[_0x0177('0x13')](function(_0x4fe525){logger[_0x0177('0xf')](_0x0177('0xa'),_0x37cf16,_0x4fe525);_0x4111f2(_0x4fe525);});});} \ No newline at end of file +var _0x5c3b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0xb8df25,_0x2b87e7){var _0x554c3d=function(_0x1576a3){while(--_0x1576a3){_0xb8df25['push'](_0xb8df25['shift']());}};_0x554c3d(++_0x2b87e7);}(_0x5c3b,0xc2));var _0xb5c3=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x5c3b[_0x13187a];return _0x65b85f;};'use strict';var _=require('lodash');var util=require(_0xb5c3('0x0'));var moment=require('moment');var BPromise=require(_0xb5c3('0x1'));var rs=require(_0xb5c3('0x2'));var fs=require('fs');var Redis=require(_0xb5c3('0x3'));var db=require(_0xb5c3('0x4'))['db'];var utils=require(_0xb5c3('0x5'));var logger=require(_0xb5c3('0x6'))(_0xb5c3('0x7'));var config=require(_0xb5c3('0x8'));var jayson=require(_0xb5c3('0x9'));var client=jayson[_0xb5c3('0xa')][_0xb5c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257edd,_0x29f114,_0x310616){return new BPromise(function(_0x3e3e3c,_0x3f0330){return client[_0xb5c3('0xc')](_0x257edd,_0x310616)['then'](function(_0x2761da){logger['info'](_0xb5c3('0xd'),_0x29f114,_0xb5c3('0xe'));logger[_0xb5c3('0xf')](_0xb5c3('0x10'),_0x29f114,_0xb5c3('0xe'),JSON['stringify'](_0x2761da));if(_0x2761da[_0xb5c3('0x11')]){if(_0x2761da[_0xb5c3('0x11')][_0xb5c3('0x12')]===0x1f4){logger['error'](_0xb5c3('0xd'),_0x29f114,_0x2761da['error']['message']);return _0x3f0330(_0x2761da[_0xb5c3('0x11')]['message']);}logger[_0xb5c3('0x11')](_0xb5c3('0xd'),_0x29f114,_0x2761da['error'][_0xb5c3('0x13')]);return _0x3e3e3c(_0x2761da[_0xb5c3('0x11')]['message']);}else{logger['info'](_0xb5c3('0xd'),_0x29f114,'request\x20sent');_0x3e3e3c(_0x2761da[_0xb5c3('0x14')][_0xb5c3('0x13')]);}})[_0xb5c3('0x15')](function(_0x201f80){logger['error'](_0xb5c3('0xd'),_0x29f114,_0x201f80);_0x3f0330(_0x201f80);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 81d67a3..41d9571 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 _0xbfc6=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../config/environment','./voiceMailMessage.controller'];(function(_0x5c1eeb,_0x17058d){var _0x20d161=function(_0x5653a4){while(--_0x5653a4){_0x5c1eeb['push'](_0x5c1eeb['shift']());}};_0x20d161(++_0x17058d);}(_0xbfc6,0x161));var _0x6bfc=function(_0x200ba0,_0x2e8299){_0x200ba0=_0x200ba0-0x0;var _0xa997d8=_0xbfc6[_0x200ba0];return _0xa997d8;};'use strict';var multer=require('multer');var util=require(_0x6bfc('0x0'));var path=require(_0x6bfc('0x1'));var timeout=require('connect-timeout');var express=require(_0x6bfc('0x2'));var router=express[_0x6bfc('0x3')]();var fs_extra=require(_0x6bfc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6bfc('0x5'));var controller=require(_0x6bfc('0x6'));router[_0x6bfc('0x7')]('/',auth[_0x6bfc('0x8')](),controller[_0x6bfc('0x9')]);router[_0x6bfc('0x7')](_0x6bfc('0xa'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0xb')]);router[_0x6bfc('0x7')](_0x6bfc('0xc'),auth['isAuthenticated'](),controller[_0x6bfc('0xd')]);router[_0x6bfc('0xe')]('/',auth[_0x6bfc('0x8')](),controller[_0x6bfc('0xf')]);router[_0x6bfc('0x10')](_0x6bfc('0xa'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0x11')]);router[_0x6bfc('0x12')](_0x6bfc('0xa'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfcf2=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfcf2,0x119));var _0x2fcf=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfcf2[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x2fcf('0x0'));var util=require('util');var path=require(_0x2fcf('0x1'));var timeout=require(_0x2fcf('0x2'));var express=require(_0x2fcf('0x3'));var router=express[_0x2fcf('0x4')]();var fs_extra=require(_0x2fcf('0x5'));var auth=require(_0x2fcf('0x6'));var interaction=require(_0x2fcf('0x7'));var config=require(_0x2fcf('0x8'));var controller=require(_0x2fcf('0x9'));router[_0x2fcf('0xa')]('/',auth[_0x2fcf('0xb')](),controller[_0x2fcf('0xc')]);router[_0x2fcf('0xa')](_0x2fcf('0xd'),auth['isAuthenticated'](),controller[_0x2fcf('0xe')]);router[_0x2fcf('0xa')](_0x2fcf('0xf'),auth[_0x2fcf('0xb')](),controller[_0x2fcf('0x10')]);router['post']('/',auth[_0x2fcf('0xb')](),controller[_0x2fcf('0x11')]);router[_0x2fcf('0x12')](_0x2fcf('0xd'),auth[_0x2fcf('0xb')](),controller[_0x2fcf('0x13')]);router[_0x2fcf('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x2fcf('0x15')]);module[_0x2fcf('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ff2dcc4..38c27f3 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 _0xcf34=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xcf34,0x13f));var _0x4cf3=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xcf34[_0x15cbce];return _0x257f29;};'use strict';var Sequelize=require(_0x4cf3('0x0'));module[_0x4cf3('0x1')]={'name':{'type':Sequelize[_0x4cf3('0x2')],'get':function(_0x425fbc){return this[_0x4cf3('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x4cf3('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x4cf3('0x6')](_0x4cf3('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x4cf3('0x8'),'defaultValue':Sequelize[_0x4cf3('0x9')](_0x4cf3('0xa'))}}; \ No newline at end of file +var _0xf7c5=['getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x4eae44,_0x6965bc){var _0x37f41a=function(_0x420169){while(--_0x420169){_0x4eae44['push'](_0x4eae44['shift']());}};_0x37f41a(++_0x6965bc);}(_0xf7c5,0xa0));var _0x5f7c=function(_0x3d71d3,_0x11caf1){_0x3d71d3=_0x3d71d3-0x0;var _0x30ec87=_0xf7c5[_0x3d71d3];return _0x30ec87;};'use strict';var Sequelize=require(_0x5f7c('0x0'));module[_0x5f7c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xb4109e){return this[_0x5f7c('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x5f7c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5f7c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x5f7c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x5f7c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5f7c('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5f7c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5f7c('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5f7c('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x5f7c('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x5f7c('0x6'),'defaultValue':Sequelize[_0x5f7c('0x7')](_0x5f7c('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index fd53ca5..ea7ddfe 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 _0xf3b9=['Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','update','body','download','recording','msg_id','Sequelize','ValidationError','attachment'];(function(_0x4e9ca1,_0x743d97){var _0x7bbccf=function(_0x2b40e1){while(--_0x2b40e1){_0x4e9ca1['push'](_0x4e9ca1['shift']());}};_0x7bbccf(++_0x743d97);}(_0xf3b9,0xfc));var _0x9f3b=function(_0x24062c,_0x4f2170){_0x24062c=_0x24062c-0x0;var _0x358274=_0xf3b9[_0x24062c];return _0x358274;};'use strict';var emlformat=require(_0x9f3b('0x0'));var rimraf=require(_0x9f3b('0x1'));var zipdir=require(_0x9f3b('0x2'));var jsonpatch=require(_0x9f3b('0x3'));var rp=require(_0x9f3b('0x4'));var moment=require('moment');var BPromise=require(_0x9f3b('0x5'));var Mustache=require(_0x9f3b('0x6'));var util=require(_0x9f3b('0x7'));var path=require(_0x9f3b('0x8'));var sox=require(_0x9f3b('0x9'));var csv=require(_0x9f3b('0xa'));var ejs=require(_0x9f3b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f3b('0xc'));var squel=require(_0x9f3b('0xd'));var crypto=require(_0x9f3b('0xe'));var jsforce=require(_0x9f3b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9f3b('0xa'));var querystring=require('querystring');var Papa=require(_0x9f3b('0x10'));var Redis=require(_0x9f3b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f3b('0x12'));var as=require(_0x9f3b('0x13'));var hardwareService=require(_0x9f3b('0x14'));var logger=require(_0x9f3b('0x15'))(_0x9f3b('0x16'));var utils=require(_0x9f3b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f3b('0x18'))['db'];function respondWithStatusCode(_0x91361c,_0x4d03eb){_0x4d03eb=_0x4d03eb||0xcc;return function(_0x2bbeae){if(_0x2bbeae){return _0x91361c[_0x9f3b('0x19')](_0x4d03eb);}return _0x91361c['status'](_0x4d03eb)[_0x9f3b('0x1a')]();};}function respondWithResult(_0x283fa9,_0x470b15){_0x470b15=_0x470b15||0xc8;return function(_0x28439b){if(_0x28439b){return _0x283fa9[_0x9f3b('0x1b')](_0x470b15)[_0x9f3b('0x1c')](_0x28439b);}};}function respondWithFilteredResult(_0x4043f6,_0x5189f3){return function(_0x2f653e){if(_0x2f653e){var _0x4fe5ae=typeof _0x5189f3[_0x9f3b('0x1d')]===_0x9f3b('0x1e')&&typeof _0x5189f3[_0x9f3b('0x1f')]===_0x9f3b('0x1e');var _0x5cb341=_0x2f653e[_0x9f3b('0x20')];var _0x128d8b=_0x4fe5ae?0x0:_0x5189f3['offset'];var _0x186a89=_0x4fe5ae?_0x2f653e['count']:_0x5189f3[_0x9f3b('0x1d')]+_0x5189f3[_0x9f3b('0x1f')];var _0x20d6f5;if(_0x186a89>=_0x5cb341){_0x186a89=_0x5cb341;_0x20d6f5=0xc8;}else{_0x20d6f5=0xce;}_0x4043f6[_0x9f3b('0x1b')](_0x20d6f5);return _0x4043f6[_0x9f3b('0x21')]('Content-Range',_0x128d8b+'-'+_0x186a89+'/'+_0x5cb341)[_0x9f3b('0x1c')](_0x2f653e);}return null;};}function patchUpdates(_0x117c54){return function(_0x1e48a9){try{jsonpatch['apply'](_0x1e48a9,_0x117c54,!![]);}catch(_0x22d012){return BPromise[_0x9f3b('0x22')](_0x22d012);}return _0x1e48a9[_0x9f3b('0x23')]();};}function saveUpdates(_0xf7a8cb,_0x1bc766){return function(_0x131044){if(_0x131044){return _0x131044['update'](_0xf7a8cb)[_0x9f3b('0x24')](function(_0x392ccc){return _0x392ccc;});}return null;};}function removeEntity(_0x38c1bf,_0x47c95f){return function(_0x495f0c){if(_0x495f0c){return _0x495f0c[_0x9f3b('0x25')]()[_0x9f3b('0x24')](function(){_0x38c1bf[_0x9f3b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b736f,_0x5a0a79){return function(_0x42877a){if(!_0x42877a){_0x4b736f[_0x9f3b('0x19')](0x194);}return _0x42877a;};}function handleError(_0x522a56,_0x38d5ce){_0x38d5ce=_0x38d5ce||0x1f4;return function(_0x335d2a){logger[_0x9f3b('0x26')](_0x335d2a[_0x9f3b('0x27')]);if(_0x335d2a[_0x9f3b('0x28')]){delete _0x335d2a[_0x9f3b('0x28')];}_0x522a56[_0x9f3b('0x1b')](_0x38d5ce)[_0x9f3b('0x29')](_0x335d2a);};}exports[_0x9f3b('0x2a')]=function(_0x35f95a,_0x3e6f3c){var _0x294f37={},_0x1d101b={},_0x600c5b={'count':0x0,'rows':[]};var _0x4a0c04=_[_0x9f3b('0x2b')](db[_0x9f3b('0x2c')][_0x9f3b('0x2d')],function(_0x4faf5e){return{'name':_0x4faf5e[_0x9f3b('0x2e')],'type':_0x4faf5e['type']['key']};});_0x1d101b['model']=_['differenceBy'](_[_0x9f3b('0x2b')](_0x4a0c04,'name'),[_0x9f3b('0x28')]);_0x1d101b[_0x9f3b('0x2f')]=_[_0x9f3b('0x30')](_0x35f95a['query']);_0x1d101b['filters']=_['intersection'](_0x1d101b[_0x9f3b('0x31')],_0x1d101b[_0x9f3b('0x2f')]);_0x294f37[_0x9f3b('0x32')]=_[_0x9f3b('0x33')](_0x1d101b[_0x9f3b('0x31')],qs[_0x9f3b('0x34')](_0x35f95a['query'][_0x9f3b('0x34')]));_0x294f37[_0x9f3b('0x32')]=_0x294f37[_0x9f3b('0x32')]['length']?_0x294f37['attributes']:_0x1d101b['model'];if(!_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x35')](_0x9f3b('0x36'))){_0x294f37['limit']=qs[_0x9f3b('0x1f')](_0x35f95a['query']['limit']);_0x294f37[_0x9f3b('0x1d')]=qs['offset'](_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x1d')]);}_0x294f37[_0x9f3b('0x37')]=qs['sort'](_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x38')]);_0x294f37[_0x9f3b('0x39')]=qs['filters'](_['pick'](_0x35f95a[_0x9f3b('0x2f')],_0x1d101b['filters']),_0x4a0c04);if(_0x35f95a[_0x9f3b('0x2f')]['filter']){_0x294f37[_0x9f3b('0x39')]=_[_0x9f3b('0x3a')](_0x294f37[_0x9f3b('0x39')],{'$or':_['map'](_0x4a0c04,function(_0x21d297){if(_0x21d297['type']!==_0x9f3b('0x3b')){var _0x4e3c20={};_0x4e3c20[_0x21d297[_0x9f3b('0x28')]]={'$like':'%'+_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x3c')]+'%'};return _0x4e3c20;}})});}_0x294f37=_['merge']({},_0x294f37,_0x35f95a[_0x9f3b('0x3d')]);var _0x3d057f={'where':_0x294f37[_0x9f3b('0x39')]};return db[_0x9f3b('0x2c')]['count'](_0x3d057f)[_0x9f3b('0x24')](function(_0x2cb06b){_0x600c5b[_0x9f3b('0x20')]=_0x2cb06b;if(_0x35f95a[_0x9f3b('0x2f')]['includeAll']){_0x294f37[_0x9f3b('0x3e')]=[{'all':!![]}];}return db[_0x9f3b('0x2c')][_0x9f3b('0x3f')](_0x294f37);})['then'](function(_0x506c66){_0x600c5b[_0x9f3b('0x40')]=_0x506c66;return _0x600c5b;})[_0x9f3b('0x24')](respondWithFilteredResult(_0x3e6f3c,_0x294f37))[_0x9f3b('0x41')](handleError(_0x3e6f3c,null));};exports[_0x9f3b('0x42')]=function(_0x1789a8,_0x27f56b){var _0x15120c={'raw':!![],'where':{'id':_0x1789a8[_0x9f3b('0x43')]['id']}},_0x566a30={};_0x566a30[_0x9f3b('0x31')]=_['keys'](db[_0x9f3b('0x2c')][_0x9f3b('0x2d')]);_0x566a30['query']=_['keys'](_0x1789a8['query']);_0x566a30['filters']=_[_0x9f3b('0x33')](_0x566a30[_0x9f3b('0x31')],_0x566a30[_0x9f3b('0x2f')]);_0x15120c[_0x9f3b('0x32')]=_['intersection'](_0x566a30[_0x9f3b('0x31')],qs[_0x9f3b('0x34')](_0x1789a8[_0x9f3b('0x2f')][_0x9f3b('0x34')]));_0x15120c[_0x9f3b('0x32')]=_0x15120c[_0x9f3b('0x32')][_0x9f3b('0x44')]?_0x15120c['attributes']:_0x566a30[_0x9f3b('0x31')];if(_0x1789a8[_0x9f3b('0x2f')][_0x9f3b('0x45')]){_0x15120c['include']=[{'all':!![]}];}_0x15120c=_[_0x9f3b('0x3a')]({},_0x15120c,_0x1789a8[_0x9f3b('0x3d')]);return db[_0x9f3b('0x2c')][_0x9f3b('0x46')](_0x15120c)[_0x9f3b('0x24')](handleEntityNotFound(_0x27f56b,null))['then'](respondWithResult(_0x27f56b,null))[_0x9f3b('0x41')](handleError(_0x27f56b,null));};exports[_0x9f3b('0x47')]=function(_0xbdcc80,_0x3613c7){return db[_0x9f3b('0x2c')][_0x9f3b('0x47')](_0xbdcc80['body'],{})[_0x9f3b('0x24')](respondWithResult(_0x3613c7,0xc9))['catch'](handleError(_0x3613c7,null));};exports[_0x9f3b('0x48')]=function(_0x5685c3,_0x2f80b3){if(_0x5685c3['body']['id']){delete _0x5685c3[_0x9f3b('0x49')]['id'];}return db[_0x9f3b('0x2c')][_0x9f3b('0x46')]({'where':{'id':_0x5685c3[_0x9f3b('0x43')]['id']}})[_0x9f3b('0x24')](handleEntityNotFound(_0x2f80b3,null))['then'](saveUpdates(_0x5685c3[_0x9f3b('0x49')],null))[_0x9f3b('0x24')](respondWithResult(_0x2f80b3,null))[_0x9f3b('0x41')](handleError(_0x2f80b3,null));};exports['destroy']=function(_0x32f51f,_0x3eab80){return db[_0x9f3b('0x2c')][_0x9f3b('0x46')]({'where':{'id':_0x32f51f[_0x9f3b('0x43')]['id']}})[_0x9f3b('0x24')](handleEntityNotFound(_0x3eab80,null))[_0x9f3b('0x24')](removeEntity(_0x3eab80,null))[_0x9f3b('0x41')](handleError(_0x3eab80,null));};exports[_0x9f3b('0x4a')]=function(_0x3d0612,_0xaab74c,_0x59a4c2){return db[_0x9f3b('0x2c')]['find']({'where':{'id':_0x3d0612[_0x9f3b('0x43')]['id']},'attributes':['id',_0x9f3b('0x4b'),_0x9f3b('0x4c')]})[_0x9f3b('0x24')](handleEntityNotFound(_0xaab74c,null))[_0x9f3b('0x24')](function(_0x3b94c4){if(_0x3b94c4){if(!_0x3b94c4[_0x9f3b('0x4b')]){throw new db[(_0x9f3b('0x4d'))][(_0x9f3b('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0x405b76={'Content-Type':'audio/wav','Content-Disposition':_0x9f3b('0x4f')};if(_0x3b94c4[_0x9f3b('0x4c')]){_0x405b76[_0x9f3b('0x50')]=_0x9f3b('0x51')+_0x3b94c4['msg_id']+_0x9f3b('0x52');}_0xaab74c[_0x9f3b('0x21')](_0x405b76);return _0xaab74c[_0x9f3b('0x29')](new Buffer(_0x3b94c4['recording']));}})[_0x9f3b('0x41')](handleError(_0xaab74c,null));}; \ No newline at end of file +var _0xb19f=['hasOwnProperty','nolimit','order','where','pick','filter','merge','VoiceMailMessage','count','include','findAll','then','rows','catch','show','params','includeAll','options','find','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','limit','set','Content-Range','update','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0x26a815,_0xcde2b9){var _0x539ed1=function(_0x66f759){while(--_0x66f759){_0x26a815['push'](_0x26a815['shift']());}};_0x539ed1(++_0xcde2b9);}(_0xb19f,0xc1));var _0xfb19=function(_0x3c5fec,_0x4fecdf){_0x3c5fec=_0x3c5fec-0x0;var _0x47eafa=_0xb19f[_0x3c5fec];return _0x47eafa;};'use strict';var emlformat=require(_0xfb19('0x0'));var rimraf=require(_0xfb19('0x1'));var zipdir=require(_0xfb19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb19('0x3'));var moment=require('moment');var BPromise=require(_0xfb19('0x4'));var Mustache=require('mustache');var util=require(_0xfb19('0x5'));var path=require(_0xfb19('0x6'));var sox=require(_0xfb19('0x7'));var csv=require(_0xfb19('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb19('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfb19('0xa'));var jsforce=require(_0xfb19('0xb'));var deskjs=require(_0xfb19('0xc'));var toCsv=require(_0xfb19('0x8'));var querystring=require(_0xfb19('0xd'));var Papa=require(_0xfb19('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfb19('0xf'));var hardwareService=require(_0xfb19('0x10'));var logger=require('../../config/logger')(_0xfb19('0x11'));var utils=require('../../config/utils');var config=require(_0xfb19('0x12'));var licenseUtil=require(_0xfb19('0x13'));var db=require(_0xfb19('0x14'))['db'];function respondWithStatusCode(_0x573d74,_0x2e5917){_0x2e5917=_0x2e5917||0xcc;return function(_0xa48b02){if(_0xa48b02){return _0x573d74['sendStatus'](_0x2e5917);}return _0x573d74[_0xfb19('0x15')](_0x2e5917)[_0xfb19('0x16')]();};}function respondWithResult(_0x21e5c0,_0x4330e0){_0x4330e0=_0x4330e0||0xc8;return function(_0x2fcd5f){if(_0x2fcd5f){return _0x21e5c0['status'](_0x4330e0)[_0xfb19('0x17')](_0x2fcd5f);}};}function respondWithFilteredResult(_0x158c9d,_0x15362d){return function(_0x2b4dd6){if(_0x2b4dd6){var _0x4a8d0a=typeof _0x15362d['offset']===_0xfb19('0x18')&&typeof _0x15362d['limit']===_0xfb19('0x18');var _0x243f1f=_0x2b4dd6['count'];var _0x234c17=_0x4a8d0a?0x0:_0x15362d[_0xfb19('0x19')];var _0x2ba2c3=_0x4a8d0a?_0x2b4dd6['count']:_0x15362d[_0xfb19('0x19')]+_0x15362d[_0xfb19('0x1a')];var _0x10288a;if(_0x2ba2c3>=_0x243f1f){_0x2ba2c3=_0x243f1f;_0x10288a=0xc8;}else{_0x10288a=0xce;}_0x158c9d[_0xfb19('0x15')](_0x10288a);return _0x158c9d[_0xfb19('0x1b')](_0xfb19('0x1c'),_0x234c17+'-'+_0x2ba2c3+'/'+_0x243f1f)['json'](_0x2b4dd6);}return null;};}function patchUpdates(_0x2c7c24){return function(_0x44ac56){try{jsonpatch['apply'](_0x44ac56,_0x2c7c24,!![]);}catch(_0x4101ab){return BPromise['reject'](_0x4101ab);}return _0x44ac56['save']();};}function saveUpdates(_0x1a3870,_0x5ac93c){return function(_0x4542eb){if(_0x4542eb){return _0x4542eb[_0xfb19('0x1d')](_0x1a3870)['then'](function(_0x544a50){return _0x544a50;});}return null;};}function removeEntity(_0x435dd6,_0x5f4481){return function(_0x341be1){if(_0x341be1){return _0x341be1[_0xfb19('0x1e')]()['then'](function(){_0x435dd6[_0xfb19('0x15')](0xcc)[_0xfb19('0x16')]();});}};}function handleEntityNotFound(_0x794680,_0x53c7bc){return function(_0x3e35a6){if(!_0x3e35a6){_0x794680[_0xfb19('0x1f')](0x194);}return _0x3e35a6;};}function handleError(_0x4da414,_0x39d610){_0x39d610=_0x39d610||0x1f4;return function(_0x15dde2){logger[_0xfb19('0x20')](_0x15dde2['stack']);if(_0x15dde2['name']){delete _0x15dde2[_0xfb19('0x21')];}_0x4da414[_0xfb19('0x15')](_0x39d610)[_0xfb19('0x22')](_0x15dde2);};}exports[_0xfb19('0x23')]=function(_0x22101d,_0x37100d){var _0x2795a9={},_0x212a43={},_0xfffa52={'count':0x0,'rows':[]};var _0x3551c5=_['map'](db['VoiceMailMessage'][_0xfb19('0x24')],function(_0x432b45){return{'name':_0x432b45[_0xfb19('0x25')],'type':_0x432b45[_0xfb19('0x26')][_0xfb19('0x27')]};});_0x212a43[_0xfb19('0x28')]=_[_0xfb19('0x29')](_[_0xfb19('0x2a')](_0x3551c5,_0xfb19('0x21')),['name']);_0x212a43[_0xfb19('0x2b')]=_[_0xfb19('0x2c')](_0x22101d[_0xfb19('0x2b')]);_0x212a43[_0xfb19('0x2d')]=_[_0xfb19('0x2e')](_0x212a43[_0xfb19('0x28')],_0x212a43['query']);_0x2795a9[_0xfb19('0x2f')]=_[_0xfb19('0x2e')](_0x212a43[_0xfb19('0x28')],qs['fields'](_0x22101d['query'][_0xfb19('0x30')]));_0x2795a9['attributes']=_0x2795a9[_0xfb19('0x2f')][_0xfb19('0x31')]?_0x2795a9[_0xfb19('0x2f')]:_0x212a43['model'];if(!_0x22101d[_0xfb19('0x2b')][_0xfb19('0x32')](_0xfb19('0x33'))){_0x2795a9[_0xfb19('0x1a')]=qs[_0xfb19('0x1a')](_0x22101d['query'][_0xfb19('0x1a')]);_0x2795a9[_0xfb19('0x19')]=qs[_0xfb19('0x19')](_0x22101d[_0xfb19('0x2b')]['offset']);}_0x2795a9[_0xfb19('0x34')]=qs['sort'](_0x22101d['query']['sort']);_0x2795a9[_0xfb19('0x35')]=qs['filters'](_[_0xfb19('0x36')](_0x22101d[_0xfb19('0x2b')],_0x212a43[_0xfb19('0x2d')]),_0x3551c5);if(_0x22101d[_0xfb19('0x2b')][_0xfb19('0x37')]){_0x2795a9[_0xfb19('0x35')]=_[_0xfb19('0x38')](_0x2795a9[_0xfb19('0x35')],{'$or':_[_0xfb19('0x2a')](_0x3551c5,function(_0x48de0d){if(_0x48de0d['type']!=='VIRTUAL'){var _0x2376f1={};_0x2376f1[_0x48de0d[_0xfb19('0x21')]]={'$like':'%'+_0x22101d['query'][_0xfb19('0x37')]+'%'};return _0x2376f1;}})});}_0x2795a9=_[_0xfb19('0x38')]({},_0x2795a9,_0x22101d['options']);var _0x56b46e={'where':_0x2795a9[_0xfb19('0x35')]};return db[_0xfb19('0x39')][_0xfb19('0x3a')](_0x56b46e)['then'](function(_0x356cb2){_0xfffa52[_0xfb19('0x3a')]=_0x356cb2;if(_0x22101d[_0xfb19('0x2b')]['includeAll']){_0x2795a9[_0xfb19('0x3b')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xfb19('0x3c')](_0x2795a9);})[_0xfb19('0x3d')](function(_0x25f245){_0xfffa52[_0xfb19('0x3e')]=_0x25f245;return _0xfffa52;})[_0xfb19('0x3d')](respondWithFilteredResult(_0x37100d,_0x2795a9))[_0xfb19('0x3f')](handleError(_0x37100d,null));};exports[_0xfb19('0x40')]=function(_0x385044,_0x4ef9b8){var _0x5d52e5={'raw':!![],'where':{'id':_0x385044[_0xfb19('0x41')]['id']}},_0xe06f88={};_0xe06f88[_0xfb19('0x28')]=_[_0xfb19('0x2c')](db[_0xfb19('0x39')]['rawAttributes']);_0xe06f88[_0xfb19('0x2b')]=_[_0xfb19('0x2c')](_0x385044[_0xfb19('0x2b')]);_0xe06f88[_0xfb19('0x2d')]=_[_0xfb19('0x2e')](_0xe06f88[_0xfb19('0x28')],_0xe06f88[_0xfb19('0x2b')]);_0x5d52e5[_0xfb19('0x2f')]=_[_0xfb19('0x2e')](_0xe06f88[_0xfb19('0x28')],qs['fields'](_0x385044['query']['fields']));_0x5d52e5[_0xfb19('0x2f')]=_0x5d52e5[_0xfb19('0x2f')][_0xfb19('0x31')]?_0x5d52e5['attributes']:_0xe06f88[_0xfb19('0x28')];if(_0x385044[_0xfb19('0x2b')][_0xfb19('0x42')]){_0x5d52e5['include']=[{'all':!![]}];}_0x5d52e5=_[_0xfb19('0x38')]({},_0x5d52e5,_0x385044[_0xfb19('0x43')]);return db[_0xfb19('0x39')][_0xfb19('0x44')](_0x5d52e5)['then'](handleEntityNotFound(_0x4ef9b8,null))[_0xfb19('0x3d')](respondWithResult(_0x4ef9b8,null))[_0xfb19('0x3f')](handleError(_0x4ef9b8,null));};exports['create']=function(_0xfedcdb,_0x232e0c){return db[_0xfb19('0x39')]['create'](_0xfedcdb[_0xfb19('0x45')],{})[_0xfb19('0x3d')](respondWithResult(_0x232e0c,0xc9))[_0xfb19('0x3f')](handleError(_0x232e0c,null));};exports[_0xfb19('0x1d')]=function(_0xbe79b3,_0x469177){if(_0xbe79b3[_0xfb19('0x45')]['id']){delete _0xbe79b3[_0xfb19('0x45')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0xbe79b3[_0xfb19('0x41')]['id']}})['then'](handleEntityNotFound(_0x469177,null))[_0xfb19('0x3d')](saveUpdates(_0xbe79b3[_0xfb19('0x45')],null))[_0xfb19('0x3d')](respondWithResult(_0x469177,null))[_0xfb19('0x3f')](handleError(_0x469177,null));};exports[_0xfb19('0x1e')]=function(_0x5b549d,_0x932e32){return db[_0xfb19('0x39')]['find']({'where':{'id':_0x5b549d['params']['id']}})[_0xfb19('0x3d')](handleEntityNotFound(_0x932e32,null))[_0xfb19('0x3d')](removeEntity(_0x932e32,null))[_0xfb19('0x3f')](handleError(_0x932e32,null));};exports[_0xfb19('0x46')]=function(_0x1443fd,_0x2148dc,_0x58af29){return db[_0xfb19('0x39')][_0xfb19('0x44')]({'where':{'id':_0x1443fd[_0xfb19('0x41')]['id']},'attributes':['id',_0xfb19('0x47'),_0xfb19('0x48')]})[_0xfb19('0x3d')](handleEntityNotFound(_0x2148dc,null))[_0xfb19('0x3d')](function(_0x4ce8fe){if(_0x4ce8fe){if(!_0x4ce8fe['recording']){throw new db[(_0xfb19('0x49'))][(_0xfb19('0x4a'))](_0xfb19('0x4b'));}var _0x24af85={'Content-Type':_0xfb19('0x4c'),'Content-Disposition':_0xfb19('0x4d')};if(_0x4ce8fe[_0xfb19('0x48')]){_0x24af85[_0xfb19('0x4e')]=_0xfb19('0x4f')+_0x4ce8fe[_0xfb19('0x48')]+_0xfb19('0x50');}_0x2148dc[_0xfb19('0x1b')](_0x24af85);return _0x2148dc['send'](new Buffer(_0x4ce8fe[_0xfb19('0x47')]));}})[_0xfb19('0x3f')](handleError(_0x2148dc,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4c8f28f..62c5e8f 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 _0x21e2=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x21e2,0x1e6));var _0x221e=function(_0x3fc8c2,_0x1f3bb1){_0x3fc8c2=_0x3fc8c2-0x0;var _0x23da6f=_0x21e2[_0x3fc8c2];return _0x23da6f;};'use strict';var _=require('lodash');var util=require(_0x221e('0x0'));var logger=require(_0x221e('0x1'))(_0x221e('0x2'));var moment=require('moment');var BPromise=require(_0x221e('0x3'));var rp=require(_0x221e('0x4'));var fs=require('fs');var path=require(_0x221e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x221e('0x6'));module[_0x221e('0x7')]=function(_0xbe0d1a,_0x48fb9d){return _0xbe0d1a[_0x221e('0x8')](_0x221e('0x9'),attributes,{'tableName':_0x221e('0xa'),'paranoid':![],'indexes':[{'name':_0x221e('0xb'),'fields':[_0x221e('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3aef=['../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5435a3,_0xa09171){var _0xb6de24=function(_0x3037eb){while(--_0x3037eb){_0x5435a3['push'](_0x5435a3['shift']());}};_0xb6de24(++_0xa09171);}(_0x3aef,0x157));var _0xf3ae=function(_0x410c88,_0x46e49e){_0x410c88=_0x410c88-0x0;var _0x8446a9=_0x3aef[_0x410c88];return _0x8446a9;};'use strict';var _=require(_0xf3ae('0x0'));var util=require(_0xf3ae('0x1'));var logger=require(_0xf3ae('0x2'))(_0xf3ae('0x3'));var moment=require(_0xf3ae('0x4'));var BPromise=require(_0xf3ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3ae('0x6'));var rimraf=require(_0xf3ae('0x7'));var config=require(_0xf3ae('0x8'));var attributes=require(_0xf3ae('0x9'));module['exports']=function(_0x1214a9,_0x591bfd){return _0x1214a9[_0xf3ae('0xa')](_0xf3ae('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0xf3ae('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index fca5831..7c0f8bd 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 _0xc02f=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x22ed26,_0x3e6127){var _0x3e9dbe=function(_0x37a2ec){while(--_0x37a2ec){_0x22ed26['push'](_0x22ed26['shift']());}};_0x3e9dbe(++_0x3e6127);}(_0xc02f,0x177));var _0xfc02=function(_0x63cb4a,_0x4b7c1a){_0x63cb4a=_0x63cb4a-0x0;var _0x38ac49=_0xc02f[_0x63cb4a];return _0x38ac49;};'use strict';var _=require(_0xfc02('0x0'));var util=require('util');var moment=require(_0xfc02('0x1'));var BPromise=require(_0xfc02('0x2'));var rs=require(_0xfc02('0x3'));var fs=require('fs');var Redis=require(_0xfc02('0x4'));var db=require(_0xfc02('0x5'))['db'];var utils=require(_0xfc02('0x6'));var logger=require(_0xfc02('0x7'))(_0xfc02('0x8'));var config=require(_0xfc02('0x9'));var jayson=require(_0xfc02('0xa'));var client=jayson[_0xfc02('0xb')][_0xfc02('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x543c92,_0x8a10d1,_0x2ff68f){return new BPromise(function(_0x37196d,_0x515310){return client[_0xfc02('0xd')](_0x543c92,_0x2ff68f)[_0xfc02('0xe')](function(_0x3c4780){logger[_0xfc02('0xf')](_0xfc02('0x10'),_0x8a10d1,_0xfc02('0x11'));logger[_0xfc02('0x12')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x8a10d1,_0xfc02('0x11'),JSON[_0xfc02('0x13')](_0x3c4780));if(_0x3c4780[_0xfc02('0x14')]){if(_0x3c4780[_0xfc02('0x14')][_0xfc02('0x15')]===0x1f4){logger[_0xfc02('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x8a10d1,_0x3c4780[_0xfc02('0x14')][_0xfc02('0x16')]);return _0x515310(_0x3c4780[_0xfc02('0x14')][_0xfc02('0x16')]);}logger[_0xfc02('0x14')](_0xfc02('0x10'),_0x8a10d1,_0x3c4780[_0xfc02('0x14')][_0xfc02('0x16')]);return _0x37196d(_0x3c4780[_0xfc02('0x14')]['message']);}else{logger[_0xfc02('0xf')](_0xfc02('0x10'),_0x8a10d1,_0xfc02('0x11'));_0x37196d(_0x3c4780['result'][_0xfc02('0x16')]);}})['catch'](function(_0x22b742){logger['error'](_0xfc02('0x10'),_0x8a10d1,_0x22b742);_0x515310(_0x22b742);});});} \ No newline at end of file +var _0x18a3=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x23884b,_0x50c307){var _0x28113b=function(_0xce3fea){while(--_0xce3fea){_0x23884b['push'](_0x23884b['shift']());}};_0x28113b(++_0x50c307);}(_0x18a3,0x1c0));var _0x318a=function(_0x4b2fa3,_0x10b499){_0x4b2fa3=_0x4b2fa3-0x0;var _0x3983eb=_0x18a3[_0x4b2fa3];return _0x3983eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x318a('0x0'));var BPromise=require(_0x318a('0x1'));var rs=require(_0x318a('0x2'));var fs=require('fs');var Redis=require(_0x318a('0x3'));var db=require(_0x318a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x318a('0x5'))(_0x318a('0x6'));var config=require(_0x318a('0x7'));var jayson=require(_0x318a('0x8'));var client=jayson[_0x318a('0x9')][_0x318a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xacef7,_0x5e4e8d,_0x5c8212){return new BPromise(function(_0x2599f8,_0x23cc37){return client[_0x318a('0xb')](_0xacef7,_0x5c8212)[_0x318a('0xc')](function(_0x18de32){logger['info'](_0x318a('0xd'),_0x5e4e8d,_0x318a('0xe'));logger['debug'](_0x318a('0xf'),_0x5e4e8d,'request\x20sent',JSON[_0x318a('0x10')](_0x18de32));if(_0x18de32[_0x318a('0x11')]){if(_0x18de32[_0x318a('0x11')]['code']===0x1f4){logger[_0x318a('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x5e4e8d,_0x18de32['error'][_0x318a('0x12')]);return _0x23cc37(_0x18de32[_0x318a('0x11')][_0x318a('0x12')]);}logger[_0x318a('0x11')](_0x318a('0xd'),_0x5e4e8d,_0x18de32[_0x318a('0x11')][_0x318a('0x12')]);return _0x2599f8(_0x18de32[_0x318a('0x11')][_0x318a('0x12')]);}else{logger[_0x318a('0x13')](_0x318a('0xd'),_0x5e4e8d,_0x318a('0xe'));_0x2599f8(_0x18de32[_0x318a('0x14')]['message']);}})['catch'](function(_0x31ecf1){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5e4e8d,_0x31ecf1);_0x23cc37(_0x31ecf1);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 9f7f462..5aeefd0 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 _0x2c1a=['Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','show','/:id/sounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','path','express'];(function(_0x495919,_0xae6861){var _0x3bcfad=function(_0x4387c1){while(--_0x4387c1){_0x495919['push'](_0x495919['shift']());}};_0x3bcfad(++_0xae6861);}(_0x2c1a,0x12d));var _0xa2c1=function(_0x344f62,_0x4bd138){_0x344f62=_0x344f62-0x0;var _0x191372=_0x2c1a[_0x344f62];return _0x191372;};'use strict';var multer=require(_0xa2c1('0x0'));var util=require('util');var path=require(_0xa2c1('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2c1('0x2'));var router=express[_0xa2c1('0x3')]();var fs_extra=require(_0xa2c1('0x4'));var auth=require(_0xa2c1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0xa2c1('0x6')](),controller['index']);router[_0xa2c1('0x7')](_0xa2c1('0x8'),auth[_0xa2c1('0x6')](),controller[_0xa2c1('0x9')]);router[_0xa2c1('0x7')](_0xa2c1('0xa'),auth[_0xa2c1('0x6')](),controller['getSounds']);router[_0xa2c1('0xb')]('/',auth[_0xa2c1('0x6')](),controller['create']);router['post'](_0xa2c1('0xa'),auth[_0xa2c1('0x6')](),controller[_0xa2c1('0xc')]);router[_0xa2c1('0xd')](_0xa2c1('0x8'),auth['isAuthenticated'](),controller[_0xa2c1('0xe')]);router[_0xa2c1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa2c1('0x10')]);router['delete'](_0xa2c1('0x11'),auth[_0xa2c1('0x6')](),controller['removeSound']);module[_0xa2c1('0x12')]=router; \ No newline at end of file +var _0x63ca=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','create','addSound','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','Router','fs-extra'];(function(_0x169612,_0x4a445c){var _0x12801c=function(_0x3802aa){while(--_0x3802aa){_0x169612['push'](_0x169612['shift']());}};_0x12801c(++_0x4a445c);}(_0x63ca,0x1de));var _0xa63c=function(_0x263fe6,_0x88d747){_0x263fe6=_0x263fe6-0x0;var _0x319577=_0x63ca[_0x263fe6];return _0x319577;};'use strict';var multer=require(_0xa63c('0x0'));var util=require(_0xa63c('0x1'));var path=require(_0xa63c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa63c('0x3')]();var fs_extra=require(_0xa63c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa63c('0x5'));var config=require(_0xa63c('0x6'));var controller=require(_0xa63c('0x7'));router[_0xa63c('0x8')]('/',auth[_0xa63c('0x9')](),controller['index']);router[_0xa63c('0x8')](_0xa63c('0xa'),auth[_0xa63c('0x9')](),controller[_0xa63c('0xb')]);router['get'](_0xa63c('0xc'),auth[_0xa63c('0x9')](),controller[_0xa63c('0xd')]);router[_0xa63c('0xe')]('/',auth['isAuthenticated'](),controller[_0xa63c('0xf')]);router[_0xa63c('0xe')]('/:id/sounds',auth[_0xa63c('0x9')](),controller[_0xa63c('0x10')]);router['put'](_0xa63c('0xa'),auth[_0xa63c('0x9')](),controller[_0xa63c('0x11')]);router['delete'](_0xa63c('0xa'),auth[_0xa63c('0x9')](),controller[_0xa63c('0x12')]);router[_0xa63c('0x13')](_0xa63c('0x14'),auth[_0xa63c('0x9')](),controller[_0xa63c('0x15')]);module[_0xa63c('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 4ebf1de..ff92e68 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 _0xe08a=['exports','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','STRING','TIMESTAMP','sequelize'];(function(_0x52af16,_0x59cb6f){var _0x7e642c=function(_0x2c0ccc){while(--_0x2c0ccc){_0x52af16['push'](_0x52af16['shift']());}};_0x7e642c(++_0x59cb6f);}(_0xe08a,0xba));var _0xae08=function(_0x3eb421,_0x424022){_0x3eb421=_0x3eb421-0x0;var _0x3cb848=_0xe08a[_0x3eb421];return _0x3cb848;};'use strict';var Sequelize=require(_0xae08('0x0'));module[_0xae08('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xae08('0x2')},'mode':{'type':Sequelize[_0xae08('0x3')](_0xae08('0x4'),_0xae08('0x5'),'mp3nb',_0xae08('0x6'),_0xae08('0x7'),_0xae08('0x8')),'allowNull':!![],'defaultValue':_0xae08('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xae08('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0xae08('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xae08('0x9')],'allowNull':!![]},'stamp':{'type':_0xae08('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3dee=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','custom','mp3nb','quietmp3nb','quietmp3','mp3','files'];(function(_0x4fb79a,_0x4a8145){var _0x5d5e43=function(_0x47406f){while(--_0x47406f){_0x4fb79a['push'](_0x4fb79a['shift']());}};_0x5d5e43(++_0x4a8145);}(_0x3dee,0x16f));var _0xe3de=function(_0x33a3d6,_0x1bf472){_0x33a3d6=_0x33a3d6-0x0;var _0x3cfe40=_0x3dee[_0x33a3d6];return _0x3cfe40;};'use strict';var Sequelize=require(_0xe3de('0x0'));module[_0xe3de('0x1')]={'name':{'type':Sequelize[_0xe3de('0x2')],'allowNull':![],'unique':_0xe3de('0x3')},'mode':{'type':Sequelize['ENUM'](_0xe3de('0x4'),'files',_0xe3de('0x5'),_0xe3de('0x6'),_0xe3de('0x7'),_0xe3de('0x8')),'allowNull':!![],'defaultValue':_0xe3de('0x9')},'directory':{'type':Sequelize[_0xe3de('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xe3de('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe3de('0xa')},'format':{'type':Sequelize[_0xe3de('0x2')],'allowNull':!![]},'stamp':{'type':_0xe3de('0xb')},'defaultEntry':{'type':Sequelize[_0xe3de('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 2cb0251..3ac3b09 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 _0x3db4=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','getSounds','pick','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','set','Content-Range','apply','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','keys','model','attributes','query','fields','length','nolimit','offset','order','sort','filters','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','params','intersection','find','update','body','create','sequelize','transaction','files','root','server/files/moh','mode','mkdirSync','0777','user'];(function(_0x1ea13d,_0x413305){var _0x3a21ba=function(_0x2f521c){while(--_0x2f521c){_0x1ea13d['push'](_0x1ea13d['shift']());}};_0x3a21ba(++_0x413305);}(_0x3db4,0x175));var _0x43db=function(_0x7690c4,_0x3e959b){_0x7690c4=_0x7690c4-0x0;var _0x236fd4=_0x3db4[_0x7690c4];return _0x236fd4;};'use strict';var emlformat=require(_0x43db('0x0'));var rimraf=require(_0x43db('0x1'));var zipdir=require(_0x43db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43db('0x3'));var moment=require(_0x43db('0x4'));var BPromise=require(_0x43db('0x5'));var Mustache=require(_0x43db('0x6'));var util=require(_0x43db('0x7'));var path=require('path');var sox=require(_0x43db('0x8'));var csv=require(_0x43db('0x9'));var ejs=require(_0x43db('0xa'));var fs=require('fs');var fs_extra=require(_0x43db('0xb'));var _=require(_0x43db('0xc'));var squel=require('squel');var crypto=require(_0x43db('0xd'));var jsforce=require(_0x43db('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x43db('0x9'));var querystring=require(_0x43db('0xf'));var Papa=require(_0x43db('0x10'));var Redis=require(_0x43db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x43db('0x12'));var as=require(_0x43db('0x13'));var hardwareService=require(_0x43db('0x14'));var logger=require(_0x43db('0x15'))(_0x43db('0x16'));var utils=require(_0x43db('0x17'));var config=require(_0x43db('0x18'));var licenseUtil=require(_0x43db('0x19'));var db=require(_0x43db('0x1a'))['db'];function respondWithStatusCode(_0xb7d48e,_0x389b13){_0x389b13=_0x389b13||0xcc;return function(_0x14b769){if(_0x14b769){return _0xb7d48e[_0x43db('0x1b')](_0x389b13);}return _0xb7d48e['status'](_0x389b13)['end']();};}function respondWithResult(_0x2b7afe,_0x4fb3dc){_0x4fb3dc=_0x4fb3dc||0xc8;return function(_0xe74deb){if(_0xe74deb){return _0x2b7afe[_0x43db('0x1c')](_0x4fb3dc)[_0x43db('0x1d')](_0xe74deb);}};}function respondWithFilteredResult(_0x4cd12b,_0x163476){return function(_0xb1d53c){if(_0xb1d53c){var _0x5c7f15=typeof _0x163476['offset']==='undefined'&&typeof _0x163476[_0x43db('0x1e')]===_0x43db('0x1f');var _0x576d60=_0xb1d53c['count'];var _0x564bb8=_0x5c7f15?0x0:_0x163476['offset'];var _0x9d53f3=_0x5c7f15?_0xb1d53c[_0x43db('0x20')]:_0x163476['offset']+_0x163476[_0x43db('0x1e')];var _0x37754b;if(_0x9d53f3>=_0x576d60){_0x9d53f3=_0x576d60;_0x37754b=0xc8;}else{_0x37754b=0xce;}_0x4cd12b[_0x43db('0x1c')](_0x37754b);return _0x4cd12b[_0x43db('0x21')](_0x43db('0x22'),_0x564bb8+'-'+_0x9d53f3+'/'+_0x576d60)[_0x43db('0x1d')](_0xb1d53c);}return null;};}function patchUpdates(_0x533706){return function(_0x1ea991){try{jsonpatch[_0x43db('0x23')](_0x1ea991,_0x533706,!![]);}catch(_0x466b03){return BPromise['reject'](_0x466b03);}return _0x1ea991['save']();};}function saveUpdates(_0x337a1d,_0x5b9803){return function(_0x4d1262){if(_0x4d1262){return _0x4d1262['update'](_0x337a1d)[_0x43db('0x24')](function(_0x43fbb1){return _0x43fbb1;});}return null;};}function removeEntity(_0x5a83e4,_0x5ca68d){return function(_0x11e63a){if(_0x11e63a){return _0x11e63a['destroy']()[_0x43db('0x24')](function(){var _0x14c518=_0x11e63a[_0x43db('0x25')]({'plain':!![]});var _0xe49a69='MusicOnHolds';return db[_0x43db('0x26')][_0x43db('0x27')]({'where':{'type':_0xe49a69,'resourceId':_0x14c518['id']}})['then'](function(){return _0x11e63a;});})[_0x43db('0x24')](function(){_0x5a83e4[_0x43db('0x1c')](0xcc)[_0x43db('0x28')]();});}};}function handleEntityNotFound(_0x30b9cb,_0x56218b){return function(_0x5d78c3){if(!_0x5d78c3){_0x30b9cb[_0x43db('0x1b')](0x194);}return _0x5d78c3;};}function handleError(_0x5b6cea,_0x3fc3c4){_0x3fc3c4=_0x3fc3c4||0x1f4;return function(_0x1370ef){logger[_0x43db('0x29')](_0x1370ef[_0x43db('0x2a')]);if(_0x1370ef[_0x43db('0x2b')]){delete _0x1370ef['name'];}_0x5b6cea[_0x43db('0x1c')](_0x3fc3c4)[_0x43db('0x2c')](_0x1370ef);};}exports[_0x43db('0x2d')]=function(_0x2771e9,_0x388780){var _0x30ade5={},_0x234984={},_0xa21803={'count':0x0,'rows':[]};var _0x44550c=_[_0x43db('0x2e')](db[_0x43db('0x2f')][_0x43db('0x30')],function(_0x8b1c28){return{'name':_0x8b1c28[_0x43db('0x31')],'type':_0x8b1c28['type'][_0x43db('0x32')]};});_0x234984['model']=_[_0x43db('0x2e')](_0x44550c,_0x43db('0x2b'));_0x234984['query']=_[_0x43db('0x33')](_0x2771e9['query']);_0x234984['filters']=_['intersection'](_0x234984[_0x43db('0x34')],_0x234984['query']);_0x30ade5[_0x43db('0x35')]=_['intersection'](_0x234984['model'],qs['fields'](_0x2771e9[_0x43db('0x36')][_0x43db('0x37')]));_0x30ade5[_0x43db('0x35')]=_0x30ade5['attributes'][_0x43db('0x38')]?_0x30ade5[_0x43db('0x35')]:_0x234984[_0x43db('0x34')];if(!_0x2771e9[_0x43db('0x36')]['hasOwnProperty'](_0x43db('0x39'))){_0x30ade5[_0x43db('0x1e')]=qs[_0x43db('0x1e')](_0x2771e9[_0x43db('0x36')]['limit']);_0x30ade5['offset']=qs[_0x43db('0x3a')](_0x2771e9['query']['offset']);}_0x30ade5[_0x43db('0x3b')]=qs[_0x43db('0x3c')](_0x2771e9[_0x43db('0x36')][_0x43db('0x3c')]);delete _0x2771e9[_0x43db('0x36')]['sort'];_0x30ade5['where']=qs['filters'](_['pick'](_0x2771e9[_0x43db('0x36')],_0x234984[_0x43db('0x3d')]),_0x44550c);if(_0x2771e9[_0x43db('0x36')][_0x43db('0x3e')]){_0x30ade5['where']=_['merge'](_0x30ade5['where'],{'$or':_[_0x43db('0x2e')](_0x44550c,function(_0x192fad){if(_0x192fad['type']!==_0x43db('0x3f')){var _0x410ddb={};_0x410ddb[_0x192fad['name']]={'$like':'%'+_0x2771e9[_0x43db('0x36')][_0x43db('0x3e')]+'%'};return _0x410ddb;}})});}_0x30ade5=_[_0x43db('0x40')]({},_0x30ade5,_0x2771e9[_0x43db('0x41')]);var _0x1efd4f={'where':_0x30ade5[_0x43db('0x42')]};return db[_0x43db('0x2f')][_0x43db('0x20')](_0x1efd4f)[_0x43db('0x24')](function(_0x369940){_0xa21803[_0x43db('0x20')]=_0x369940;if(_0x2771e9['query'][_0x43db('0x43')]){_0x30ade5[_0x43db('0x44')]=[{'all':!![]}];}return db[_0x43db('0x2f')][_0x43db('0x45')](_0x30ade5);})[_0x43db('0x24')](function(_0x27a31d){_0xa21803[_0x43db('0x46')]=_0x27a31d;return _0xa21803;})[_0x43db('0x24')](respondWithFilteredResult(_0x388780,_0x30ade5))[_0x43db('0x47')](handleError(_0x388780,null));};exports['show']=function(_0x3ce6a7,_0x58805a){var _0x236776={'raw':![],'where':{'id':_0x3ce6a7[_0x43db('0x48')]['id']}},_0x28722d={};_0x28722d[_0x43db('0x34')]=_[_0x43db('0x33')](db[_0x43db('0x2f')]['rawAttributes']);_0x28722d[_0x43db('0x36')]=_[_0x43db('0x33')](_0x3ce6a7[_0x43db('0x36')]);_0x28722d[_0x43db('0x3d')]=_[_0x43db('0x49')](_0x28722d[_0x43db('0x34')],_0x28722d[_0x43db('0x36')]);_0x236776[_0x43db('0x35')]=_[_0x43db('0x49')](_0x28722d[_0x43db('0x34')],qs[_0x43db('0x37')](_0x3ce6a7[_0x43db('0x36')][_0x43db('0x37')]));_0x236776['attributes']=_0x236776['attributes'][_0x43db('0x38')]?_0x236776[_0x43db('0x35')]:_0x28722d[_0x43db('0x34')];if(_0x3ce6a7[_0x43db('0x36')][_0x43db('0x43')]){_0x236776['include']=[{'all':!![]}];}_0x236776=_[_0x43db('0x40')]({},_0x236776,_0x3ce6a7[_0x43db('0x41')]);return db[_0x43db('0x2f')][_0x43db('0x4a')](_0x236776)[_0x43db('0x24')](handleEntityNotFound(_0x58805a,null))['then'](respondWithResult(_0x58805a,null))[_0x43db('0x47')](handleError(_0x58805a,null));};exports[_0x43db('0x4b')]=function(_0x22012e,_0x332cc2){if(_0x22012e['body']['id']){delete _0x22012e[_0x43db('0x4c')]['id'];}return db[_0x43db('0x2f')][_0x43db('0x4a')]({'where':{'id':_0x22012e['params']['id']}})[_0x43db('0x24')](handleEntityNotFound(_0x332cc2,null))['then'](saveUpdates(_0x22012e[_0x43db('0x4c')],null))['then'](respondWithResult(_0x332cc2,null))[_0x43db('0x47')](handleError(_0x332cc2,null));};exports[_0x43db('0x4d')]=function(_0x3d0116,_0x2e4ac4,_0x26530a){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x139804){if(_0x3d0116[_0x43db('0x4c')]['mode']===_0x43db('0x50')){_0x3d0116[_0x43db('0x4c')]['directory']=path['join'](config[_0x43db('0x51')],_0x43db('0x52'),_0x3d0116[_0x43db('0x4c')][_0x43db('0x2b')]);}return db[_0x43db('0x2f')][_0x43db('0x4d')](_0x3d0116[_0x43db('0x4c')],{'transaction':_0x139804})[_0x43db('0x24')](function(_0x1641fa){if(_0x3d0116[_0x43db('0x4c')][_0x43db('0x53')]===_0x43db('0x50')){fs[_0x43db('0x54')](_0x1641fa['directory'],parseInt(_0x43db('0x55'),0x8));}var _0x2f791c=_0x3d0116[_0x43db('0x56')][_0x43db('0x25')]({'plain':!![]});if(!_0x2f791c)throw new Error(_0x43db('0x57'));if(_0x2f791c['role']==='user'){var _0x4253e9=_0x1641fa['get']({'plain':!![]});return db[_0x43db('0x58')]['find']({'where':{'name':_0x43db('0x59'),'userProfileId':_0x2f791c['userProfileId']},'raw':!![]})['then'](function(_0x4fae65){if(_0x4fae65&&_0x4fae65[_0x43db('0x5a')]===0x0){return db[_0x43db('0x26')][_0x43db('0x4d')]({'name':_0x4253e9[_0x43db('0x2b')],'resourceId':_0x4253e9['id'],'type':_0x4fae65['name'],'sectionId':_0x4fae65['id']},{})[_0x43db('0x24')](function(){return _0x1641fa;});}else{return _0x1641fa;}})[_0x43db('0x47')](function(_0x168562){logger[_0x43db('0x29')](_0x43db('0x5b'),_0x168562);});}return _0x1641fa;});})['then'](respondWithResult(_0x2e4ac4,0xc9))['catch'](handleError(_0x2e4ac4,null));};exports[_0x43db('0x27')]=function(_0xc12452,_0x585c4a,_0x2011fe){var _0xd83a6a;return db['VoiceMusicOnHold'][_0x43db('0x4a')]({'where':{'id':_0xc12452[_0x43db('0x48')]['id']}})[_0x43db('0x24')](function(_0x27c378){if(_0x27c378){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x352ec4){return _0x27c378['destroy']({'transaction':_0x352ec4,'raw':!![]})['then'](function(_0x278e61){if(_0x278e61[_0x43db('0x5c')]){fs['readdirSync'](_0x278e61['directory'])['forEach'](function(_0x41356b){fs[_0x43db('0x5d')](path[_0x43db('0x5e')](_0x278e61[_0x43db('0x5c')],_0x41356b));});fs[_0x43db('0x5f')](_0x278e61['directory']);}return _0x278e61;});})['catch'](function(_0x46d426){throw new db[(_0x43db('0x60'))][(_0x43db('0x61'))](_0x46d426[_0x43db('0x62')]);});}})['then'](handleEntityNotFound(_0x585c4a,null))[_0x43db('0x24')](removeEntity(_0x585c4a,null))[_0x43db('0x47')](handleError(_0x585c4a,null));};exports[_0x43db('0x63')]=function(_0x3ab57a,_0x3b66e3,_0x2daae8){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x189fd6){var _0x5acdfc;return db[_0x43db('0x2f')]['find']({'where':{'id':_0x3ab57a[_0x43db('0x48')]['id']}})[_0x43db('0x24')](function(_0x5d3376){if(_0x5d3376){_0x5acdfc=_0x5d3376;return _0x5d3376[_0x43db('0x63')](_0x3ab57a['body']['id'],{'transaction':_0x189fd6});}})['then'](function(_0x799fa2){if(_0x799fa2){return db[_0x43db('0x64')][_0x43db('0x65')]({'where':{'id':_0x3ab57a[_0x43db('0x4c')]['id']},'attributes':['id','name',_0x43db('0x66'),_0x43db('0x67'),_0x43db('0x68')],'raw':!![]});}})[_0x43db('0x24')](function(_0x28ef1a){if(_0x28ef1a){var _0x2ad082=path[_0x43db('0x5e')](config['root'],_0x43db('0x69'),util[_0x43db('0x6a')](_0x43db('0x6b'),path[_0x43db('0x6c')](_0x28ef1a[_0x43db('0x66')],path[_0x43db('0x6d')](_0x28ef1a['save_name'])),_0x28ef1a[_0x43db('0x67')]));var _0x24bae6=path[_0x43db('0x5e')](config['root'],'server/files/moh',_0x5acdfc['name'],util[_0x43db('0x6a')](_0x43db('0x6b'),_0x28ef1a[_0x43db('0x2b')],_0x28ef1a[_0x43db('0x67')]));fs[_0x43db('0x6e')](_0x2ad082,_0x24bae6);return _0x28ef1a;}})[_0x43db('0x47')](function(_0xd105ec){throw new db['Sequelize'][(_0x43db('0x61'))](_0xd105ec[_0x43db('0x62')]);});})[_0x43db('0x24')](handleEntityNotFound(_0x3b66e3,null))['then'](respondWithResult(_0x3b66e3,0xc9))[_0x43db('0x47')](handleError(_0x3b66e3,null));};exports[_0x43db('0x6f')]=function(_0x5a62f1,_0x532a70,_0x7da8b3){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x50c874){var _0x201cc7;return db[_0x43db('0x2f')][_0x43db('0x65')]({'where':{'id':_0x5a62f1[_0x43db('0x48')]['id']}})[_0x43db('0x24')](handleEntityNotFound(_0x532a70,null))[_0x43db('0x24')](function(_0x532b4d){if(_0x532b4d){_0x201cc7=_0x532b4d;return _0x532b4d[_0x43db('0x6f')](_0x5a62f1['params']['id2']);}})[_0x43db('0x24')](function(_0x31b44b){if(_0x31b44b){return db[_0x43db('0x64')][_0x43db('0x65')]({'where':{'id':_0x5a62f1[_0x43db('0x48')]['id2']},'attributes':['id',_0x43db('0x2b'),'save_name',_0x43db('0x67'),_0x43db('0x68')],'raw':!![]});}})[_0x43db('0x24')](function(_0x235ba1){if(_0x235ba1){fs[_0x43db('0x5d')](path[_0x43db('0x5e')](_0x201cc7[_0x43db('0x5c')],util[_0x43db('0x6a')]('%s.%s',_0x235ba1['name'],_0x235ba1['converted_format'])));return _0x235ba1;}})[_0x43db('0x47')](function(_0x337efd){throw new db['Sequelize'][(_0x43db('0x61'))](_0x337efd[_0x43db('0x62')]);});})[_0x43db('0x24')](handleEntityNotFound(_0x532a70,null))[_0x43db('0x24')](respondWithStatusCode(_0x532a70,0xcc))['catch'](handleError(_0x532a70,null));};exports[_0x43db('0x70')]=function(_0xb6feef,_0x5e4a36,_0x52c98b){var _0x60a261={};var _0x1eae8b={};var _0x73cfa9;var _0x5ee556;return db[_0x43db('0x2f')][_0x43db('0x65')]({'where':{'id':_0xb6feef[_0x43db('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e4a36,null))[_0x43db('0x24')](function(_0x5eb8ea){if(_0x5eb8ea){_0x73cfa9=_0x5eb8ea;_0x1eae8b[_0x43db('0x34')]=_[_0x43db('0x33')](db['Sound'][_0x43db('0x30')]);_0x1eae8b['query']=_[_0x43db('0x33')](_0xb6feef[_0x43db('0x36')]);_0x1eae8b[_0x43db('0x3d')]=_['intersection'](_0x1eae8b['model'],_0x1eae8b[_0x43db('0x36')]);_0x60a261[_0x43db('0x35')]=_[_0x43db('0x49')](_0x1eae8b[_0x43db('0x34')],qs[_0x43db('0x37')](_0xb6feef[_0x43db('0x36')][_0x43db('0x37')]));_0x60a261['attributes']=_0x60a261['attributes']['length']?_0x60a261[_0x43db('0x35')]:_0x1eae8b[_0x43db('0x34')];_0x60a261[_0x43db('0x3b')]=qs[_0x43db('0x3c')](_0xb6feef['query'][_0x43db('0x3c')]);_0x60a261[_0x43db('0x42')]=qs[_0x43db('0x3d')](_[_0x43db('0x71')](_0xb6feef[_0x43db('0x36')],_0x1eae8b['filters']));if(_0xb6feef[_0x43db('0x36')][_0x43db('0x3e')]){_0x60a261['where']=_[_0x43db('0x40')](_0x60a261['where'],{'$or':_[_0x43db('0x2e')](_0x60a261['attributes'],function(_0x28db8a){var _0x16357f={};_0x16357f[_0x28db8a]={'$like':'%'+_0xb6feef[_0x43db('0x36')][_0x43db('0x3e')]+'%'};return _0x16357f;})});}_0x60a261=_[_0x43db('0x40')]({},_0x60a261,_0xb6feef[_0x43db('0x41')]);return _0x73cfa9[_0x43db('0x70')](_0x60a261);}})['then'](function(_0x2badfa){if(_0x2badfa){_0x5ee556=_0x2badfa['length'];if(!_0xb6feef[_0x43db('0x36')][_0x43db('0x72')](_0x43db('0x39'))){_0x60a261[_0x43db('0x1e')]=qs[_0x43db('0x1e')](_0xb6feef[_0x43db('0x36')][_0x43db('0x1e')]);_0x60a261[_0x43db('0x3a')]=qs['offset'](_0xb6feef[_0x43db('0x36')]['offset']);}return _0x73cfa9[_0x43db('0x70')](_0x60a261);}})['then'](function(_0x27d8e3){if(_0x27d8e3){return _0x27d8e3?{'count':_0x5ee556,'rows':_0x27d8e3}:null;}})[_0x43db('0x24')](respondWithResult(_0x5e4a36,null))[_0x43db('0x47')](handleError(_0x5e4a36,null));}; \ No newline at end of file +var _0x098d=['save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','server/files/moh','symlinkSync','removeSound','id2','getSounds','eml-format','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','get','MusicOnHolds','destroy','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','params','includeAll','catch','update','body','find','create','sequelize','transaction','files','join','root','mkdirSync','directory','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0x098d,0x153));var _0xd098=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x098d[_0x2cc569];return _0x1bfc2e;};'use strict';var emlformat=require(_0xd098('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd098('0x1'));var moment=require('moment');var BPromise=require(_0xd098('0x2'));var Mustache=require(_0xd098('0x3'));var util=require(_0xd098('0x4'));var path=require(_0xd098('0x5'));var sox=require(_0xd098('0x6'));var csv=require('to-csv');var ejs=require(_0xd098('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd098('0x8'));var squel=require(_0xd098('0x9'));var crypto=require(_0xd098('0xa'));var jsforce=require(_0xd098('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd098('0xc'));var querystring=require(_0xd098('0xd'));var Papa=require('papaparse');var Redis=require(_0xd098('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd098('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd098('0x10'));var logger=require(_0xd098('0x11'))('api');var utils=require(_0xd098('0x12'));var config=require(_0xd098('0x13'));var licenseUtil=require(_0xd098('0x14'));var db=require(_0xd098('0x15'))['db'];function respondWithStatusCode(_0x467204,_0x50a601){_0x50a601=_0x50a601||0xcc;return function(_0x3508c6){if(_0x3508c6){return _0x467204[_0xd098('0x16')](_0x50a601);}return _0x467204[_0xd098('0x17')](_0x50a601)[_0xd098('0x18')]();};}function respondWithResult(_0x2ccc94,_0x4ec3e7){_0x4ec3e7=_0x4ec3e7||0xc8;return function(_0x5bf7ba){if(_0x5bf7ba){return _0x2ccc94[_0xd098('0x17')](_0x4ec3e7)[_0xd098('0x19')](_0x5bf7ba);}};}function respondWithFilteredResult(_0x5e4cef,_0x263a81){return function(_0x348538){if(_0x348538){var _0x51386d=typeof _0x263a81[_0xd098('0x1a')]===_0xd098('0x1b')&&typeof _0x263a81[_0xd098('0x1c')]===_0xd098('0x1b');var _0x57fa03=_0x348538['count'];var _0x43d710=_0x51386d?0x0:_0x263a81[_0xd098('0x1a')];var _0x1ba333=_0x51386d?_0x348538[_0xd098('0x1d')]:_0x263a81[_0xd098('0x1a')]+_0x263a81[_0xd098('0x1c')];var _0x278405;if(_0x1ba333>=_0x57fa03){_0x1ba333=_0x57fa03;_0x278405=0xc8;}else{_0x278405=0xce;}_0x5e4cef['status'](_0x278405);return _0x5e4cef[_0xd098('0x1e')](_0xd098('0x1f'),_0x43d710+'-'+_0x1ba333+'/'+_0x57fa03)['json'](_0x348538);}return null;};}function patchUpdates(_0xd77f85){return function(_0x155343){try{jsonpatch['apply'](_0x155343,_0xd77f85,!![]);}catch(_0x585bfa){return BPromise['reject'](_0x585bfa);}return _0x155343[_0xd098('0x20')]();};}function saveUpdates(_0x3cab52,_0x37a438){return function(_0x1c7750){if(_0x1c7750){return _0x1c7750['update'](_0x3cab52)[_0xd098('0x21')](function(_0x598dda){return _0x598dda;});}return null;};}function removeEntity(_0x73a639,_0x19abfc){return function(_0x3a0f31){if(_0x3a0f31){return _0x3a0f31['destroy']()[_0xd098('0x21')](function(){var _0x489543=_0x3a0f31[_0xd098('0x22')]({'plain':!![]});var _0x44b7e8=_0xd098('0x23');return db['UserProfileResource'][_0xd098('0x24')]({'where':{'type':_0x44b7e8,'resourceId':_0x489543['id']}})[_0xd098('0x21')](function(){return _0x3a0f31;});})['then'](function(){_0x73a639['status'](0xcc)[_0xd098('0x18')]();});}};}function handleEntityNotFound(_0xf63ca9,_0x4302f2){return function(_0x47722f){if(!_0x47722f){_0xf63ca9[_0xd098('0x16')](0x194);}return _0x47722f;};}function handleError(_0x28fc4f,_0x16db47){_0x16db47=_0x16db47||0x1f4;return function(_0x595392){logger[_0xd098('0x25')](_0x595392[_0xd098('0x26')]);if(_0x595392['name']){delete _0x595392[_0xd098('0x27')];}_0x28fc4f[_0xd098('0x17')](_0x16db47)[_0xd098('0x28')](_0x595392);};}exports['index']=function(_0x1f534a,_0x54b6cc){var _0x1cff12={},_0x26e8af={},_0xdf51ce={'count':0x0,'rows':[]};var _0x5f47f5=_[_0xd098('0x29')](db[_0xd098('0x2a')][_0xd098('0x2b')],function(_0x3a0511){return{'name':_0x3a0511['fieldName'],'type':_0x3a0511['type'][_0xd098('0x2c')]};});_0x26e8af[_0xd098('0x2d')]=_[_0xd098('0x29')](_0x5f47f5,_0xd098('0x27'));_0x26e8af[_0xd098('0x2e')]=_[_0xd098('0x2f')](_0x1f534a[_0xd098('0x2e')]);_0x26e8af['filters']=_[_0xd098('0x30')](_0x26e8af['model'],_0x26e8af[_0xd098('0x2e')]);_0x1cff12[_0xd098('0x31')]=_[_0xd098('0x30')](_0x26e8af[_0xd098('0x2d')],qs[_0xd098('0x32')](_0x1f534a[_0xd098('0x2e')][_0xd098('0x32')]));_0x1cff12[_0xd098('0x31')]=_0x1cff12[_0xd098('0x31')][_0xd098('0x33')]?_0x1cff12[_0xd098('0x31')]:_0x26e8af['model'];if(!_0x1f534a[_0xd098('0x2e')][_0xd098('0x34')](_0xd098('0x35'))){_0x1cff12[_0xd098('0x1c')]=qs[_0xd098('0x1c')](_0x1f534a[_0xd098('0x2e')]['limit']);_0x1cff12[_0xd098('0x1a')]=qs[_0xd098('0x1a')](_0x1f534a[_0xd098('0x2e')][_0xd098('0x1a')]);}_0x1cff12[_0xd098('0x36')]=qs[_0xd098('0x37')](_0x1f534a[_0xd098('0x2e')]['sort']);delete _0x1f534a[_0xd098('0x2e')][_0xd098('0x37')];_0x1cff12[_0xd098('0x38')]=qs[_0xd098('0x39')](_[_0xd098('0x3a')](_0x1f534a[_0xd098('0x2e')],_0x26e8af[_0xd098('0x39')]),_0x5f47f5);if(_0x1f534a[_0xd098('0x2e')][_0xd098('0x3b')]){_0x1cff12[_0xd098('0x38')]=_[_0xd098('0x3c')](_0x1cff12[_0xd098('0x38')],{'$or':_['map'](_0x5f47f5,function(_0x198a88){if(_0x198a88[_0xd098('0x3d')]!==_0xd098('0x3e')){var _0x4a2b77={};_0x4a2b77[_0x198a88['name']]={'$like':'%'+_0x1f534a[_0xd098('0x2e')][_0xd098('0x3b')]+'%'};return _0x4a2b77;}})});}_0x1cff12=_[_0xd098('0x3c')]({},_0x1cff12,_0x1f534a[_0xd098('0x3f')]);var _0x43ca98={'where':_0x1cff12[_0xd098('0x38')]};return db[_0xd098('0x2a')][_0xd098('0x1d')](_0x43ca98)[_0xd098('0x21')](function(_0x2a44dc){_0xdf51ce[_0xd098('0x1d')]=_0x2a44dc;if(_0x1f534a[_0xd098('0x2e')]['includeAll']){_0x1cff12[_0xd098('0x40')]=[{'all':!![]}];}return db[_0xd098('0x2a')][_0xd098('0x41')](_0x1cff12);})['then'](function(_0x3c2912){_0xdf51ce[_0xd098('0x42')]=_0x3c2912;return _0xdf51ce;})[_0xd098('0x21')](respondWithFilteredResult(_0x54b6cc,_0x1cff12))['catch'](handleError(_0x54b6cc,null));};exports['show']=function(_0x78546,_0x1870f0){var _0x3bf00c={'raw':![],'where':{'id':_0x78546[_0xd098('0x43')]['id']}},_0x4348b1={};_0x4348b1[_0xd098('0x2d')]=_[_0xd098('0x2f')](db['VoiceMusicOnHold']['rawAttributes']);_0x4348b1['query']=_['keys'](_0x78546['query']);_0x4348b1[_0xd098('0x39')]=_[_0xd098('0x30')](_0x4348b1[_0xd098('0x2d')],_0x4348b1[_0xd098('0x2e')]);_0x3bf00c['attributes']=_[_0xd098('0x30')](_0x4348b1['model'],qs[_0xd098('0x32')](_0x78546[_0xd098('0x2e')]['fields']));_0x3bf00c[_0xd098('0x31')]=_0x3bf00c[_0xd098('0x31')][_0xd098('0x33')]?_0x3bf00c[_0xd098('0x31')]:_0x4348b1[_0xd098('0x2d')];if(_0x78546[_0xd098('0x2e')][_0xd098('0x44')]){_0x3bf00c[_0xd098('0x40')]=[{'all':!![]}];}_0x3bf00c=_[_0xd098('0x3c')]({},_0x3bf00c,_0x78546['options']);return db[_0xd098('0x2a')]['find'](_0x3bf00c)[_0xd098('0x21')](handleEntityNotFound(_0x1870f0,null))[_0xd098('0x21')](respondWithResult(_0x1870f0,null))[_0xd098('0x45')](handleError(_0x1870f0,null));};exports[_0xd098('0x46')]=function(_0x350a59,_0x1a7239){if(_0x350a59[_0xd098('0x47')]['id']){delete _0x350a59[_0xd098('0x47')]['id'];}return db[_0xd098('0x2a')][_0xd098('0x48')]({'where':{'id':_0x350a59[_0xd098('0x43')]['id']}})[_0xd098('0x21')](handleEntityNotFound(_0x1a7239,null))[_0xd098('0x21')](saveUpdates(_0x350a59[_0xd098('0x47')],null))['then'](respondWithResult(_0x1a7239,null))['catch'](handleError(_0x1a7239,null));};exports[_0xd098('0x49')]=function(_0x4a229c,_0x1c7a3e,_0x4ba2c2){return db[_0xd098('0x4a')][_0xd098('0x4b')](function(_0x5093c0){if(_0x4a229c['body']['mode']===_0xd098('0x4c')){_0x4a229c['body']['directory']=path[_0xd098('0x4d')](config[_0xd098('0x4e')],'server/files/moh',_0x4a229c[_0xd098('0x47')][_0xd098('0x27')]);}return db[_0xd098('0x2a')]['create'](_0x4a229c[_0xd098('0x47')],{'transaction':_0x5093c0})['then'](function(_0x345828){if(_0x4a229c[_0xd098('0x47')]['mode']===_0xd098('0x4c')){fs[_0xd098('0x4f')](_0x345828[_0xd098('0x50')],parseInt(_0xd098('0x51'),0x8));}var _0x57043b=_0x4a229c['user'][_0xd098('0x22')]({'plain':!![]});if(!_0x57043b)throw new Error(_0xd098('0x52'));if(_0x57043b['role']==='user'){var _0x298943=_0x345828['get']({'plain':!![]});return db[_0xd098('0x53')]['find']({'where':{'name':_0xd098('0x23'),'userProfileId':_0x57043b['userProfileId']},'raw':!![]})['then'](function(_0x1806f1){if(_0x1806f1&&_0x1806f1[_0xd098('0x54')]===0x0){return db[_0xd098('0x55')][_0xd098('0x49')]({'name':_0x298943[_0xd098('0x27')],'resourceId':_0x298943['id'],'type':_0x1806f1['name'],'sectionId':_0x1806f1['id']},{})[_0xd098('0x21')](function(){return _0x345828;});}else{return _0x345828;}})[_0xd098('0x45')](function(_0x31ef33){logger[_0xd098('0x25')](_0xd098('0x56'),_0x31ef33);});}return _0x345828;});})[_0xd098('0x21')](respondWithResult(_0x1c7a3e,0xc9))[_0xd098('0x45')](handleError(_0x1c7a3e,null));};exports[_0xd098('0x24')]=function(_0xce0e52,_0x3fcdce,_0xcc1d9f){var _0x3ecfc0;return db['VoiceMusicOnHold']['find']({'where':{'id':_0xce0e52[_0xd098('0x43')]['id']}})['then'](function(_0x4b6c03){if(_0x4b6c03){return db['sequelize']['transaction'](function(_0x1a0ddd){return _0x4b6c03[_0xd098('0x24')]({'transaction':_0x1a0ddd,'raw':!![]})[_0xd098('0x21')](function(_0x2be1fa){if(_0x2be1fa[_0xd098('0x50')]){fs[_0xd098('0x57')](_0x2be1fa[_0xd098('0x50')])[_0xd098('0x58')](function(_0x2f59a8){fs[_0xd098('0x59')](path[_0xd098('0x4d')](_0x2be1fa[_0xd098('0x50')],_0x2f59a8));});fs[_0xd098('0x5a')](_0x2be1fa[_0xd098('0x50')]);}return _0x2be1fa;});})[_0xd098('0x45')](function(_0x5d1cd5){throw new db[(_0xd098('0x5b'))][(_0xd098('0x5c'))](_0x5d1cd5[_0xd098('0x5d')]);});}})[_0xd098('0x21')](handleEntityNotFound(_0x3fcdce,null))['then'](removeEntity(_0x3fcdce,null))[_0xd098('0x45')](handleError(_0x3fcdce,null));};exports[_0xd098('0x5e')]=function(_0x3ed4d8,_0x2767b1,_0x1a7f85){return db[_0xd098('0x4a')]['transaction'](function(_0x2c8bbd){var _0x34c6cc;return db[_0xd098('0x2a')][_0xd098('0x48')]({'where':{'id':_0x3ed4d8[_0xd098('0x43')]['id']}})[_0xd098('0x21')](function(_0x113746){if(_0x113746){_0x34c6cc=_0x113746;return _0x113746[_0xd098('0x5e')](_0x3ed4d8[_0xd098('0x47')]['id'],{'transaction':_0x2c8bbd});}})[_0xd098('0x21')](function(_0xcbde91){if(_0xcbde91){return db[_0xd098('0x5f')][_0xd098('0x60')]({'where':{'id':_0x3ed4d8[_0xd098('0x47')]['id']},'attributes':['id',_0xd098('0x27'),_0xd098('0x61'),_0xd098('0x62'),_0xd098('0x63')],'raw':!![]});}})[_0xd098('0x21')](function(_0x67c20e){if(_0x67c20e){var _0x41c680=path['join'](config[_0xd098('0x4e')],_0xd098('0x64'),util[_0xd098('0x65')](_0xd098('0x66'),path['basename'](_0x67c20e[_0xd098('0x61')],path[_0xd098('0x67')](_0x67c20e[_0xd098('0x61')])),_0x67c20e[_0xd098('0x62')]));var _0x263e16=path[_0xd098('0x4d')](config['root'],_0xd098('0x68'),_0x34c6cc[_0xd098('0x27')],util[_0xd098('0x65')](_0xd098('0x66'),_0x67c20e[_0xd098('0x27')],_0x67c20e['converted_format']));fs[_0xd098('0x69')](_0x41c680,_0x263e16);return _0x67c20e;}})['catch'](function(_0x59b355){throw new db[(_0xd098('0x5b'))][(_0xd098('0x5c'))](_0x59b355[_0xd098('0x5d')]);});})[_0xd098('0x21')](handleEntityNotFound(_0x2767b1,null))[_0xd098('0x21')](respondWithResult(_0x2767b1,0xc9))[_0xd098('0x45')](handleError(_0x2767b1,null));};exports['removeSound']=function(_0x1dd5d7,_0x2449cc,_0x55ca21){return db[_0xd098('0x4a')][_0xd098('0x4b')](function(_0x4b87a9){var _0x51e09b;return db['VoiceMusicOnHold'][_0xd098('0x60')]({'where':{'id':_0x1dd5d7[_0xd098('0x43')]['id']}})[_0xd098('0x21')](handleEntityNotFound(_0x2449cc,null))['then'](function(_0x165995){if(_0x165995){_0x51e09b=_0x165995;return _0x165995[_0xd098('0x6a')](_0x1dd5d7[_0xd098('0x43')][_0xd098('0x6b')]);}})[_0xd098('0x21')](function(_0x15ef45){if(_0x15ef45){return db['Sound'][_0xd098('0x60')]({'where':{'id':_0x1dd5d7['params'][_0xd098('0x6b')]},'attributes':['id',_0xd098('0x27'),_0xd098('0x61'),_0xd098('0x62'),'createdAt'],'raw':!![]});}})[_0xd098('0x21')](function(_0x4f0b0b){if(_0x4f0b0b){fs[_0xd098('0x59')](path[_0xd098('0x4d')](_0x51e09b['directory'],util['format']('%s.%s',_0x4f0b0b['name'],_0x4f0b0b[_0xd098('0x62')])));return _0x4f0b0b;}})[_0xd098('0x45')](function(_0x1c3852){throw new db[(_0xd098('0x5b'))]['ValidationError'](_0x1c3852['message']);});})[_0xd098('0x21')](handleEntityNotFound(_0x2449cc,null))[_0xd098('0x21')](respondWithStatusCode(_0x2449cc,0xcc))['catch'](handleError(_0x2449cc,null));};exports[_0xd098('0x6c')]=function(_0xe49fd8,_0x567c59,_0x22c346){var _0x434982={};var _0x518d65={};var _0x56d878;var _0x3e79e1;return db[_0xd098('0x2a')]['findOne']({'where':{'id':_0xe49fd8[_0xd098('0x43')]['id']}})['then'](handleEntityNotFound(_0x567c59,null))[_0xd098('0x21')](function(_0x336b2d){if(_0x336b2d){_0x56d878=_0x336b2d;_0x518d65['model']=_['keys'](db[_0xd098('0x5f')][_0xd098('0x2b')]);_0x518d65['query']=_[_0xd098('0x2f')](_0xe49fd8[_0xd098('0x2e')]);_0x518d65['filters']=_['intersection'](_0x518d65[_0xd098('0x2d')],_0x518d65[_0xd098('0x2e')]);_0x434982[_0xd098('0x31')]=_['intersection'](_0x518d65['model'],qs[_0xd098('0x32')](_0xe49fd8['query'][_0xd098('0x32')]));_0x434982[_0xd098('0x31')]=_0x434982[_0xd098('0x31')]['length']?_0x434982[_0xd098('0x31')]:_0x518d65['model'];_0x434982[_0xd098('0x36')]=qs['sort'](_0xe49fd8[_0xd098('0x2e')]['sort']);_0x434982[_0xd098('0x38')]=qs['filters'](_[_0xd098('0x3a')](_0xe49fd8[_0xd098('0x2e')],_0x518d65[_0xd098('0x39')]));if(_0xe49fd8[_0xd098('0x2e')][_0xd098('0x3b')]){_0x434982[_0xd098('0x38')]=_[_0xd098('0x3c')](_0x434982[_0xd098('0x38')],{'$or':_[_0xd098('0x29')](_0x434982['attributes'],function(_0x5d07ff){var _0x31540a={};_0x31540a[_0x5d07ff]={'$like':'%'+_0xe49fd8['query']['filter']+'%'};return _0x31540a;})});}_0x434982=_[_0xd098('0x3c')]({},_0x434982,_0xe49fd8[_0xd098('0x3f')]);return _0x56d878['getSounds'](_0x434982);}})[_0xd098('0x21')](function(_0x28f1f5){if(_0x28f1f5){_0x3e79e1=_0x28f1f5[_0xd098('0x33')];if(!_0xe49fd8['query']['hasOwnProperty'](_0xd098('0x35'))){_0x434982[_0xd098('0x1c')]=qs['limit'](_0xe49fd8[_0xd098('0x2e')]['limit']);_0x434982['offset']=qs[_0xd098('0x1a')](_0xe49fd8[_0xd098('0x2e')][_0xd098('0x1a')]);}return _0x56d878[_0xd098('0x6c')](_0x434982);}})[_0xd098('0x21')](function(_0x5a7288){if(_0x5a7288){return _0x5a7288?{'count':_0x3e79e1,'rows':_0x5a7288}:null;}})[_0xd098('0x21')](respondWithResult(_0x567c59,null))[_0xd098('0x45')](handleError(_0x567c59,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 8ca430e..a07ce99 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 _0xfa61=['moment','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger'];(function(_0x4be4b4,_0x3a107e){var _0xcb88dd=function(_0x25cc6a){while(--_0x25cc6a){_0x4be4b4['push'](_0x4be4b4['shift']());}};_0xcb88dd(++_0x3a107e);}(_0xfa61,0x12a));var _0x1fa6=function(_0xab22ae,_0x327bd1){_0xab22ae=_0xab22ae-0x0;var _0x10e9e8=_0xfa61[_0xab22ae];return _0x10e9e8;};'use strict';var _=require(_0x1fa6('0x0'));var util=require('util');var logger=require(_0x1fa6('0x1'))('api');var moment=require(_0x1fa6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fa6('0x3'));var rimraf=require(_0x1fa6('0x4'));var config=require(_0x1fa6('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x1fa6('0x6')]=function(_0x57a79c,_0x3c6df6){return _0x57a79c[_0x1fa6('0x7')](_0x1fa6('0x8'),attributes,{'tableName':_0x1fa6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28ee=['util','../../config/logger','api','bluebird','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x28ee,0x9a));var _0xe28e=function(_0x581b73,_0x4fa43c){_0x581b73=_0x581b73-0x0;var _0x3ea0ec=_0x28ee[_0x581b73];return _0x3ea0ec;};'use strict';var _=require('lodash');var util=require(_0xe28e('0x0'));var logger=require(_0xe28e('0x1'))(_0xe28e('0x2'));var moment=require('moment');var BPromise=require(_0xe28e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe28e('0x4'));var rimraf=require('rimraf');var config=require(_0xe28e('0x5'));var attributes=require(_0xe28e('0x6'));module[_0xe28e('0x7')]=function(_0x69235,_0x4d194c){return _0x69235[_0xe28e('0x8')](_0xe28e('0x9'),attributes,{'tableName':_0xe28e('0xa'),'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 5ab8475..1fe0685 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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x320f33,_0x1db212){var _0x217d1e=function(_0x3c068){while(--_0x3c068){_0x320f33['push'](_0x320f33['shift']());}};_0x217d1e(++_0x1db212);}(_0xe706,0xa3));var _0x6e70=function(_0x1856e8,_0x4532d6){_0x1856e8=_0x1856e8-0x0;var _0x4ad341=_0xe706[_0x1856e8];return _0x4ad341;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5e7602,_0x56a099){var _0x2b078d=function(_0x1b27e7){while(--_0x1b27e7){_0x5e7602['push'](_0x5e7602['shift']());}};_0x2b078d(++_0x56a099);}(_0x34e8,0x12c));var _0x834e=function(_0x26ff9d,_0x2ab59e){_0x26ff9d=_0x26ff9d-0x0;var _0x521ac2=_0x34e8[_0x26ff9d];return _0x521ac2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 4e07c0e..7e25d9c 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 _0xf21d=['../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id/users','getAgents','post','addAgents','/:id','destroy','delete','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x33a5e4,_0xd1014){var _0x56b74a=function(_0x5addd5){while(--_0x5addd5){_0x33a5e4['push'](_0x33a5e4['shift']());}};_0x56b74a(++_0xd1014);}(_0xf21d,0x1a8));var _0xdf21=function(_0x59e979,_0x1b941a){_0x59e979=_0x59e979-0x0;var _0x492d=_0xf21d[_0x59e979];return _0x492d;};'use strict';var multer=require(_0xdf21('0x0'));var util=require(_0xdf21('0x1'));var path=require(_0xdf21('0x2'));var timeout=require(_0xdf21('0x3'));var express=require(_0xdf21('0x4'));var router=express[_0xdf21('0x5')]();var fs_extra=require(_0xdf21('0x6'));var auth=require(_0xdf21('0x7'));var interaction=require(_0xdf21('0x8'));var config=require(_0xdf21('0x9'));var controller=require(_0xdf21('0xa'));router[_0xdf21('0xb')]('/',auth[_0xdf21('0xc')](),controller[_0xdf21('0xd')]);router['get'](_0xdf21('0xe'),auth['isAuthenticated'](),controller[_0xdf21('0xf')]);router['get']('/:id',auth[_0xdf21('0xc')](),controller['show']);router[_0xdf21('0xb')](_0xdf21('0x10'),auth[_0xdf21('0xc')](),controller[_0xdf21('0x11')]);router[_0xdf21('0x12')]('/',auth[_0xdf21('0xc')](),controller['create']);router['post'](_0xdf21('0x10'),auth[_0xdf21('0xc')](),controller[_0xdf21('0x13')]);router['put']('/:id',auth[_0xdf21('0xc')](),controller['update']);router['delete'](_0xdf21('0x14'),auth[_0xdf21('0xc')](),controller[_0xdf21('0x15')]);router[_0xdf21('0x16')](_0xdf21('0x10'),auth['isAuthenticated'](),controller[_0xdf21('0x17')]);module['exports']=router; \ No newline at end of file +var _0x96f1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/users','getAgents','create','post','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path'];(function(_0x5ad178,_0x3de88a){var _0x23a63f=function(_0x4ae396){while(--_0x4ae396){_0x5ad178['push'](_0x5ad178['shift']());}};_0x23a63f(++_0x3de88a);}(_0x96f1,0x110));var _0x196f=function(_0x405ca5,_0x470e92){_0x405ca5=_0x405ca5-0x0;var _0x2ee36e=_0x96f1[_0x405ca5];return _0x2ee36e;};'use strict';var multer=require(_0x196f('0x0'));var util=require(_0x196f('0x1'));var path=require(_0x196f('0x2'));var timeout=require(_0x196f('0x3'));var express=require(_0x196f('0x4'));var router=express[_0x196f('0x5')]();var fs_extra=require(_0x196f('0x6'));var auth=require(_0x196f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x196f('0x8'));var controller=require('./voicePrefix.controller');router[_0x196f('0x9')]('/',auth[_0x196f('0xa')](),controller['index']);router[_0x196f('0x9')](_0x196f('0xb'),auth[_0x196f('0xa')](),controller['describe']);router[_0x196f('0x9')](_0x196f('0xc'),auth[_0x196f('0xa')](),controller[_0x196f('0xd')]);router[_0x196f('0x9')](_0x196f('0xe'),auth[_0x196f('0xa')](),controller[_0x196f('0xf')]);router['post']('/',auth[_0x196f('0xa')](),controller[_0x196f('0x10')]);router[_0x196f('0x11')]('/:id/users',auth[_0x196f('0xa')](),controller[_0x196f('0x12')]);router[_0x196f('0x13')]('/:id',auth[_0x196f('0xa')](),controller[_0x196f('0x14')]);router[_0x196f('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x196f('0x16')]);router[_0x196f('0x15')]('/:id/users',auth[_0x196f('0xa')](),controller[_0x196f('0x17')]);module[_0x196f('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 0455eda..ab60124 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 _0x8c47=['STRING','system-','name','sequelize','exports'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x8c47,0xc6));var _0x78c4=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8c47[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x78c4('0x0'));module[_0x78c4('0x1')]={'name':{'type':Sequelize[_0x78c4('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x406c35){return _0x78c4('0x3')+this['getDataValue'](_0x78c4('0x4'))+'-';}},'description':{'type':Sequelize[_0x78c4('0x2')]},'callerIdAll':{'type':Sequelize[_0x78c4('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa232=['VIRTUAL','INTEGER','sequelize','exports','STRING','name'];(function(_0x2a5c01,_0x1d4a70){var _0xa07bf0=function(_0x518c1d){while(--_0x518c1d){_0x2a5c01['push'](_0x2a5c01['shift']());}};_0xa07bf0(++_0x1d4a70);}(_0xa232,0xe0));var _0x2a23=function(_0x2fb150,_0x5c25f0){_0x2fb150=_0x2fb150-0x0;var _0x32890a=_0xa232[_0x2fb150];return _0x32890a;};'use strict';var Sequelize=require(_0x2a23('0x0'));module[_0x2a23('0x1')]={'name':{'type':Sequelize[_0x2a23('0x2')],'allowNull':![],'unique':_0x2a23('0x3')},'prefix':{'type':Sequelize[_0x2a23('0x4')],'get':function(_0x2b4084){return'system-'+this['getDataValue'](_0x2a23('0x3'))+'-';}},'description':{'type':Sequelize[_0x2a23('0x2')]},'callerIdAll':{'type':Sequelize[_0x2a23('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x2a23('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index ac020fa..9fabaae 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 _0xa9e0=['VoicePrefix','includeAll','include','findAll','catch','show','params','find','describe','create','body','get','VoiceExtensionId','user','role','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','sequelize','findById','addAgents','ids','spread','emit','removeAgents','isArray','getAgents','findOne','User','pick','hasOwnProperty','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','redis','defaults','localhost','./voicePrefix.socket','register','status','offset','undefined','limit','count','set','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x33161b=_0x197ec0['get']({'plain':!![]});var _0x384319='VoicePrefixes';return db[_0x0a9e('0x25')]['destroy']({'where':{'type':_0x384319,'resourceId':_0x33161b['id']}})[_0x0a9e('0x23')](function(){return _0x197ec0;});})[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)[_0x0a9e('0x26')]();});}};}function handleEntityNotFound(_0x140511,_0x1538a4){return function(_0x11c3b6){if(!_0x11c3b6){_0x140511[_0x0a9e('0x27')](0x194);}return _0x11c3b6;};}function handleError(_0x5a101a,_0x3652a7){_0x3652a7=_0x3652a7||0x1f4;return function(_0x468813){logger[_0x0a9e('0x28')](_0x468813[_0x0a9e('0x29')]);if(_0x468813['name']){delete _0x468813[_0x0a9e('0x2a')];}_0x5a101a[_0x0a9e('0x1a')](_0x3652a7)[_0x0a9e('0x2b')](_0x468813);};}exports[_0x0a9e('0x2c')]=function(_0x58b06f,_0x563b45){var _0x296f41={},_0x2e8759={},_0x1dbde2={'count':0x0,'rows':[]};var _0x540530=_[_0x0a9e('0x2d')](db['VoicePrefix'][_0x0a9e('0x2e')],function(_0x3ae878){return{'name':_0x3ae878[_0x0a9e('0x2f')],'type':_0x3ae878[_0x0a9e('0x30')][_0x0a9e('0x31')]};});_0x2e8759['model']=_[_0x0a9e('0x2d')](_0x540530,_0x0a9e('0x2a'));_0x2e8759[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x58b06f[_0x0a9e('0x32')]);_0x2e8759[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2e8759[_0x0a9e('0x36')],_0x2e8759['query']);_0x296f41[_0x0a9e('0x37')]=_['intersection'](_0x2e8759[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x296f41['attributes']=_0x296f41[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x296f41[_0x0a9e('0x37')]:_0x2e8759[_0x0a9e('0x36')];if(!_0x58b06f['query']['hasOwnProperty'](_0x0a9e('0x3a'))){_0x296f41['limit']=qs[_0x0a9e('0x1d')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x296f41[_0x0a9e('0x1b')]=qs['offset'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x296f41[_0x0a9e('0x3b')]=qs['sort'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x296f41[_0x0a9e('0x3d')]=qs['filters'](_['pick'](_0x58b06f[_0x0a9e('0x32')],_0x2e8759[_0x0a9e('0x34')]),_0x540530);if(_0x58b06f['query'][_0x0a9e('0x3e')]){_0x296f41[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x296f41[_0x0a9e('0x3d')],{'$or':_['map'](_0x540530,function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x30')]!==_0x0a9e('0x40')){var _0x53f3ee={};_0x53f3ee[_0x5a594b[_0x0a9e('0x2a')]]={'$like':'%'+_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x53f3ee;}})});}_0x296f41=_['merge']({},_0x296f41,_0x58b06f[_0x0a9e('0x41')]);var _0x2cfea9={'where':_0x296f41[_0x0a9e('0x3d')]};return db[_0x0a9e('0x42')][_0x0a9e('0x1e')](_0x2cfea9)[_0x0a9e('0x23')](function(_0x2881b3){_0x1dbde2[_0x0a9e('0x1e')]=_0x2881b3;if(_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x296f41[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x42')][_0x0a9e('0x45')](_0x296f41);})[_0x0a9e('0x23')](function(_0x37f6cc){_0x1dbde2['rows']=_0x37f6cc;return _0x1dbde2;})['then'](respondWithFilteredResult(_0x563b45,_0x296f41))[_0x0a9e('0x46')](handleError(_0x563b45,null));};exports[_0x0a9e('0x47')]=function(_0x405c8f,_0x315881){var _0x1a69dd={'raw':![],'where':{'id':_0x405c8f[_0x0a9e('0x48')]['id']}},_0xc9a702={};_0xc9a702[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0xc9a702[_0x0a9e('0x32')]=_['keys'](_0x405c8f[_0x0a9e('0x32')]);_0xc9a702[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],_0xc9a702[_0x0a9e('0x32')]);_0x1a69dd[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],qs['fields'](_0x405c8f[_0x0a9e('0x32')]['fields']));_0x1a69dd[_0x0a9e('0x37')]=_0x1a69dd[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x1a69dd['attributes']:_0xc9a702[_0x0a9e('0x36')];if(_0x405c8f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x1a69dd[_0x0a9e('0x44')]=[{'all':!![]}];}_0x1a69dd=_[_0x0a9e('0x3f')]({},_0x1a69dd,_0x405c8f[_0x0a9e('0x41')]);return db[_0x0a9e('0x42')]['find'](_0x1a69dd)[_0x0a9e('0x23')](handleEntityNotFound(_0x315881,null))[_0x0a9e('0x23')](respondWithResult(_0x315881,null))[_0x0a9e('0x46')](handleError(_0x315881,null));};exports[_0x0a9e('0x24')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x409789[_0x0a9e('0x48')]['id']}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x23')](removeEntity(_0x992c77,null))[_0x0a9e('0x46')](handleError(_0x992c77,null));};exports['describe']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x42')][_0x0a9e('0x4a')]()[_0x0a9e('0x23')](respondWithResult(_0x5ddf84,null))[_0x0a9e('0x46')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x4b')]=function(_0x30decb,_0x2e5165){var _0x375c18;return db['sequelize']['transaction'](function(_0x53975a){return db[_0x0a9e('0x42')][_0x0a9e('0x4b')](_0x30decb[_0x0a9e('0x4c')],{'transaction':_0x53975a})['then'](function(_0x2b69d9){_0x375c18=_0x2b69d9[_0x0a9e('0x4d')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x375c18[_0x0a9e('0x4e')]},'raw':!![]})['then'](function(_0x443e72){return createVoicePrefixExtensions(_0x375c18,_0x443e72,_0x53975a);});});})['then'](function(){var _0x2e5e62=_0x30decb[_0x0a9e('0x4f')][_0x0a9e('0x4d')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x50')]===_0x0a9e('0x4f')){var _0x508b47=_0x375c18;return db['UserProfileSection'][_0x0a9e('0x49')]({'where':{'name':_0x0a9e('0x51'),'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x5ce9ac){if(_0x5ce9ac&&_0x5ce9ac[_0x0a9e('0x52')]===0x0){return db['UserProfileResource'][_0x0a9e('0x4b')]({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x5ce9ac['name'],'sectionId':_0x5ce9ac['id']},{})['then'](function(){return _0x375c18;});}else{return _0x375c18;}})[_0x0a9e('0x46')](function(_0x47de4c){logger[_0x0a9e('0x28')](_0x0a9e('0x53'),_0x47de4c);throw _0x47de4c;});}return _0x375c18;})[_0x0a9e('0x23')](respondWithResult(_0x2e5165,null))[_0x0a9e('0x46')](handleError(_0x2e5165,null));};function Extension(_0x232830,_0x272738,_0xd10662,_0x28d814){this['context']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x232830;this[_0x0a9e('0x56')]=_0xd10662;this[_0x0a9e('0x30')]=_0x0a9e('0x57');this[_0x0a9e('0x58')]='Voice\x20Prefix\x20Extension';this[_0x0a9e('0x59')]=_0x272738;this[_0x0a9e('0x5a')]=_0x28d814;}function createVoicePrefixExtensions(_0x5239ef,_0x3649cc,_0x5cc8fb){return new BPromise(function(_0x20c668,_0x5ba1f9){var _0x4b3c1a=new Extension(formatPrefixName(_0x5239ef['prefix']),0x1,_0x0a9e('0x5b'),'Voice\x20Prefix');_0x4b3c1a[_0x0a9e('0x5c')]=_0x5239ef['id'];return db[_0x0a9e('0x5d')][_0x0a9e('0x4b')](_0x4b3c1a,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x1cca9f){var _0x26d7db=_0x1cca9f['get']({'plain':!![]});var _0x1627a7=_['map'](addVoicePrefixExtensions(_0x5239ef,_0x3649cc),function(_0xca4ade){_0xca4ade[_0x0a9e('0x4e')]=_0x26d7db['id'];_0xca4ade[_0x0a9e('0x5c')]=_0x5239ef['id'];return _0xca4ade;});return db['VoiceExtension'][_0x0a9e('0x5e')](_0x1627a7,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x119677){if(!_0x119677){return _0x5ba1f9(_0x0a9e('0x5f'));}else{return _0x20c668(_0x119677);}})['catch'](function(_0x1d0dc8){return _0x5ba1f9(_0x1d0dc8);});});;});};function addVoicePrefixExtensions(_0xe05a5a,_0x54327c){var _0x797b45=[];var _0x17e88c=formatPrefixName(_0xe05a5a[_0x0a9e('0x60')]);_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x2,_0x0a9e('0x62'),'CDR(prefix)='+_0xe05a5a[_0x0a9e('0x2a')]));if(_0xe05a5a[_0x0a9e('0x63')]){_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x3,'Set',_0x0a9e('0x64')+_0xe05a5a['callerIdAll']));}else{_0x797b45['push'](new Extension(_0x17e88c,0x3,_0x0a9e('0x5b'),_0x0a9e('0x65')));}_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x4,_0x0a9e('0x66'),_0x54327c[_0x0a9e('0x67')]+','+_0x0a9e('0x68')+(0x8+_0xe05a5a[_0x0a9e('0x2a')][_0x0a9e('0x39')])+'}'+','+0x1));return _0x797b45;}function formatPrefixName(_0x2d7205){var _0x1cc4f3='_';for(var _0x2e89b7=0x0;_0x2e89b7<_0x2d7205[_0x0a9e('0x39')];_0x2e89b7++){if(_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)=='-'){_0x1cc4f3+=_0x2d7205[_0x0a9e('0x69')](_0x2e89b7);}else{_0x1cc4f3+='['+_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)+']';}}_0x1cc4f3+='.';return _0x1cc4f3;}exports[_0x0a9e('0x22')]=function(_0x2a28c0,_0x4257c9,_0x5150a4){var _0x1b0b98=_0x2a28c0[_0x0a9e('0x4c')];_0x1b0b98[_0x0a9e('0x60')]='system-'+_0x1b0b98[_0x0a9e('0x2a')]+'-';return db[_0x0a9e('0x6a')]['transaction'](function(_0x83f0b2){return db[_0x0a9e('0x42')][_0x0a9e('0x22')](_0x1b0b98,{'where':{'id':_0x1b0b98['id']},'transaction':_0x83f0b2})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x5d')]['destroy']({'where':{'VoicePrefixId':_0x1b0b98['id']},'transaction':_0x83f0b2})['then'](function(){return db['VoiceExtension'][_0x0a9e('0x49')]({'where':{'id':_0x1b0b98[_0x0a9e('0x4e')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x23a7d3){return createVoicePrefixExtensions(_0x1b0b98,_0x23a7d3,_0x83f0b2);});});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x42')][_0x0a9e('0x6b')](_0x1b0b98['id']);})[_0x0a9e('0x23')](respondWithResult(_0x4257c9,null))['catch'](handleError(_0x4257c9,null));};exports[_0x0a9e('0x6c')]=function(_0xcbc8b2,_0x12ccdb,_0x4a4fc7){return db[_0x0a9e('0x42')]['find']({'where':{'id':_0xcbc8b2[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x12ccdb,null))['then'](function(_0x2ed01e){if(_0x2ed01e){return _0x2ed01e[_0x0a9e('0x6c')](_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')],_['omit'](_0xcbc8b2[_0x0a9e('0x4c')],[_0x0a9e('0x6d'),'id'])||{})[_0x0a9e('0x6e')](function(_0x278ab4){for(var _0x5b7fc3=0x0;_0x5b7fc3<_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x0a9e('0x39')];_0x5b7fc3+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:save',{'UserId':_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x5b7fc3],'VoicePrefixId':_0xcbc8b2[_0x0a9e('0x48')]['id']});}return _0x278ab4;});}})[_0x0a9e('0x23')](respondWithResult(_0x12ccdb,null))[_0x0a9e('0x46')](handleError(_0x12ccdb,null));};exports[_0x0a9e('0x70')]=function(_0x40fc56,_0x3df0e3,_0x1a7b03){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x40fc56[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x3df0e3,null))[_0x0a9e('0x23')](function(_0x5b35db){if(_0x5b35db){return _0x5b35db[_0x0a9e('0x70')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])['then'](function(){if(_[_0x0a9e('0x71')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])){for(var _0x2b9463=0x0;_0x2b9463<_0x40fc56['query']['ids'][_0x0a9e('0x39')];_0x2b9463+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')]['ids'][_0x2b9463]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}}else{socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x3df0e3,null))[_0x0a9e('0x46')](handleError(_0x3df0e3,null));};exports[_0x0a9e('0x72')]=function(_0x444f1f,_0x482ca2,_0x2973d3){var _0x3ca9b9={};var _0x45c109={};var _0x16e5b9;var _0x492543;return db[_0x0a9e('0x42')][_0x0a9e('0x73')]({'where':{'id':_0x444f1f['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x482ca2,null))['then'](function(_0x163710){if(_0x163710){_0x16e5b9=_0x163710;_0x45c109[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x74')]['rawAttributes']);_0x45c109['query']=_[_0x0a9e('0x33')](_0x444f1f[_0x0a9e('0x32')]);_0x45c109[_0x0a9e('0x34')]=_['intersection'](_0x45c109[_0x0a9e('0x36')],_0x45c109[_0x0a9e('0x32')]);_0x3ca9b9['attributes']=_['intersection'](_0x45c109[_0x0a9e('0x36')],qs['fields'](_0x444f1f['query']['fields']));_0x3ca9b9[_0x0a9e('0x37')]=_0x3ca9b9[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x3ca9b9[_0x0a9e('0x37')]:_0x45c109[_0x0a9e('0x36')];_0x3ca9b9[_0x0a9e('0x3b')]=qs['sort'](_0x444f1f[_0x0a9e('0x32')]['sort']);_0x3ca9b9[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x75')](_0x444f1f[_0x0a9e('0x32')],_0x45c109['filters']));if(_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x3ca9b9[_0x0a9e('0x3d')]=_['merge'](_0x3ca9b9[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x3ca9b9[_0x0a9e('0x37')],function(_0x22063c){var _0x255e49={};_0x255e49[_0x22063c]={'$like':'%'+_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x255e49;})});}_0x3ca9b9=_[_0x0a9e('0x3f')]({},_0x3ca9b9,_0x444f1f['options']);return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){_0x492543=_0x589ff3[_0x0a9e('0x39')];if(!_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x76')]('nolimit')){_0x3ca9b9[_0x0a9e('0x1d')]=qs['limit'](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x3ca9b9[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x501050){if(_0x501050){return _0x501050?{'count':_0x492543,'rows':_0x501050}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x482ca2,null))[_0x0a9e('0x46')](handleError(_0x482ca2,null));}; \ No newline at end of file +var _0xa9e0=['VoicePrefix','includeAll','include','findAll','catch','show','params','find','describe','create','body','get','VoiceExtensionId','user','role','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','sequelize','findById','addAgents','ids','spread','emit','removeAgents','isArray','getAgents','findOne','User','pick','hasOwnProperty','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','redis','defaults','localhost','./voicePrefix.socket','register','status','offset','undefined','limit','count','set','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x33161b=_0x197ec0['get']({'plain':!![]});var _0x384319='VoicePrefixes';return db[_0x0a9e('0x25')]['destroy']({'where':{'type':_0x384319,'resourceId':_0x33161b['id']}})[_0x0a9e('0x23')](function(){return _0x197ec0;});})[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)[_0x0a9e('0x26')]();});}};}function handleEntityNotFound(_0x140511,_0x1538a4){return function(_0x11c3b6){if(!_0x11c3b6){_0x140511[_0x0a9e('0x27')](0x194);}return _0x11c3b6;};}function handleError(_0x5a101a,_0x3652a7){_0x3652a7=_0x3652a7||0x1f4;return function(_0x468813){logger[_0x0a9e('0x28')](_0x468813[_0x0a9e('0x29')]);if(_0x468813['name']){delete _0x468813[_0x0a9e('0x2a')];}_0x5a101a[_0x0a9e('0x1a')](_0x3652a7)[_0x0a9e('0x2b')](_0x468813);};}exports[_0x0a9e('0x2c')]=function(_0x58b06f,_0x563b45){var _0x296f41={},_0x2e8759={},_0x1dbde2={'count':0x0,'rows':[]};var _0x540530=_[_0x0a9e('0x2d')](db['VoicePrefix'][_0x0a9e('0x2e')],function(_0x3ae878){return{'name':_0x3ae878[_0x0a9e('0x2f')],'type':_0x3ae878[_0x0a9e('0x30')][_0x0a9e('0x31')]};});_0x2e8759['model']=_[_0x0a9e('0x2d')](_0x540530,_0x0a9e('0x2a'));_0x2e8759[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x58b06f[_0x0a9e('0x32')]);_0x2e8759[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2e8759[_0x0a9e('0x36')],_0x2e8759['query']);_0x296f41[_0x0a9e('0x37')]=_['intersection'](_0x2e8759[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x296f41['attributes']=_0x296f41[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x296f41[_0x0a9e('0x37')]:_0x2e8759[_0x0a9e('0x36')];if(!_0x58b06f['query']['hasOwnProperty'](_0x0a9e('0x3a'))){_0x296f41['limit']=qs[_0x0a9e('0x1d')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x296f41[_0x0a9e('0x1b')]=qs['offset'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x296f41[_0x0a9e('0x3b')]=qs['sort'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x296f41[_0x0a9e('0x3d')]=qs['filters'](_['pick'](_0x58b06f[_0x0a9e('0x32')],_0x2e8759[_0x0a9e('0x34')]),_0x540530);if(_0x58b06f['query'][_0x0a9e('0x3e')]){_0x296f41[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x296f41[_0x0a9e('0x3d')],{'$or':_['map'](_0x540530,function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x30')]!==_0x0a9e('0x40')){var _0x53f3ee={};_0x53f3ee[_0x5a594b[_0x0a9e('0x2a')]]={'$like':'%'+_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x53f3ee;}})});}_0x296f41=_['merge']({},_0x296f41,_0x58b06f[_0x0a9e('0x41')]);var _0x2cfea9={'where':_0x296f41[_0x0a9e('0x3d')]};return db[_0x0a9e('0x42')][_0x0a9e('0x1e')](_0x2cfea9)[_0x0a9e('0x23')](function(_0x2881b3){_0x1dbde2[_0x0a9e('0x1e')]=_0x2881b3;if(_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x296f41[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x42')][_0x0a9e('0x45')](_0x296f41);})[_0x0a9e('0x23')](function(_0x37f6cc){_0x1dbde2['rows']=_0x37f6cc;return _0x1dbde2;})['then'](respondWithFilteredResult(_0x563b45,_0x296f41))[_0x0a9e('0x46')](handleError(_0x563b45,null));};exports[_0x0a9e('0x47')]=function(_0x405c8f,_0x315881){var _0x1a69dd={'raw':![],'where':{'id':_0x405c8f[_0x0a9e('0x48')]['id']}},_0xc9a702={};_0xc9a702[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0xc9a702[_0x0a9e('0x32')]=_['keys'](_0x405c8f[_0x0a9e('0x32')]);_0xc9a702[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],_0xc9a702[_0x0a9e('0x32')]);_0x1a69dd[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],qs['fields'](_0x405c8f[_0x0a9e('0x32')]['fields']));_0x1a69dd[_0x0a9e('0x37')]=_0x1a69dd[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x1a69dd['attributes']:_0xc9a702[_0x0a9e('0x36')];if(_0x405c8f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x1a69dd[_0x0a9e('0x44')]=[{'all':!![]}];}_0x1a69dd=_[_0x0a9e('0x3f')]({},_0x1a69dd,_0x405c8f[_0x0a9e('0x41')]);return db[_0x0a9e('0x42')]['find'](_0x1a69dd)[_0x0a9e('0x23')](handleEntityNotFound(_0x315881,null))[_0x0a9e('0x23')](respondWithResult(_0x315881,null))[_0x0a9e('0x46')](handleError(_0x315881,null));};exports[_0x0a9e('0x24')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x409789[_0x0a9e('0x48')]['id']}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x23')](removeEntity(_0x992c77,null))[_0x0a9e('0x46')](handleError(_0x992c77,null));};exports['describe']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x42')][_0x0a9e('0x4a')]()[_0x0a9e('0x23')](respondWithResult(_0x5ddf84,null))[_0x0a9e('0x46')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x4b')]=function(_0x30decb,_0x2e5165){var _0x375c18;return db['sequelize']['transaction'](function(_0x53975a){return db[_0x0a9e('0x42')][_0x0a9e('0x4b')](_0x30decb[_0x0a9e('0x4c')],{'transaction':_0x53975a})['then'](function(_0x2b69d9){_0x375c18=_0x2b69d9[_0x0a9e('0x4d')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x375c18[_0x0a9e('0x4e')]},'raw':!![]})['then'](function(_0x443e72){return createVoicePrefixExtensions(_0x375c18,_0x443e72,_0x53975a);});});})['then'](function(){var _0x2e5e62=_0x30decb[_0x0a9e('0x4f')][_0x0a9e('0x4d')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x50')]===_0x0a9e('0x4f')){var _0x508b47=_0x375c18;return db['UserProfileSection'][_0x0a9e('0x49')]({'where':{'name':_0x0a9e('0x51'),'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x5ce9ac){if(_0x5ce9ac&&_0x5ce9ac[_0x0a9e('0x52')]===0x0){return db['UserProfileResource'][_0x0a9e('0x4b')]({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x5ce9ac['name'],'sectionId':_0x5ce9ac['id']},{})['then'](function(){return _0x375c18;});}else{return _0x375c18;}})[_0x0a9e('0x46')](function(_0x47de4c){logger[_0x0a9e('0x28')](_0x0a9e('0x53'),_0x47de4c);throw _0x47de4c;});}return _0x375c18;})[_0x0a9e('0x23')](respondWithResult(_0x2e5165,null))[_0x0a9e('0x46')](handleError(_0x2e5165,null));};function Extension(_0x232830,_0x272738,_0xd10662,_0x28d814){this['context']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x232830;this[_0x0a9e('0x56')]=_0xd10662;this[_0x0a9e('0x30')]=_0x0a9e('0x57');this[_0x0a9e('0x58')]='Voice\x20Prefix\x20Extension';this[_0x0a9e('0x59')]=_0x272738;this[_0x0a9e('0x5a')]=_0x28d814;}function createVoicePrefixExtensions(_0x5239ef,_0x3649cc,_0x5cc8fb){return new BPromise(function(_0x20c668,_0x5ba1f9){var _0x4b3c1a=new Extension(formatPrefixName(_0x5239ef['prefix']),0x1,_0x0a9e('0x5b'),'Voice\x20Prefix');_0x4b3c1a[_0x0a9e('0x5c')]=_0x5239ef['id'];return db[_0x0a9e('0x5d')][_0x0a9e('0x4b')](_0x4b3c1a,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x1cca9f){var _0x26d7db=_0x1cca9f['get']({'plain':!![]});var _0x1627a7=_['map'](addVoicePrefixExtensions(_0x5239ef,_0x3649cc),function(_0xca4ade){_0xca4ade[_0x0a9e('0x4e')]=_0x26d7db['id'];_0xca4ade[_0x0a9e('0x5c')]=_0x5239ef['id'];return _0xca4ade;});return db['VoiceExtension'][_0x0a9e('0x5e')](_0x1627a7,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x119677){if(!_0x119677){return _0x5ba1f9(_0x0a9e('0x5f'));}else{return _0x20c668(_0x119677);}})['catch'](function(_0x1d0dc8){return _0x5ba1f9(_0x1d0dc8);});});;});};function addVoicePrefixExtensions(_0xe05a5a,_0x54327c){var _0x797b45=[];var _0x17e88c=formatPrefixName(_0xe05a5a[_0x0a9e('0x60')]);_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x2,_0x0a9e('0x62'),'CDR(prefix)='+_0xe05a5a[_0x0a9e('0x2a')]));if(_0xe05a5a[_0x0a9e('0x63')]){_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x3,'Set',_0x0a9e('0x64')+_0xe05a5a['callerIdAll']));}else{_0x797b45['push'](new Extension(_0x17e88c,0x3,_0x0a9e('0x5b'),_0x0a9e('0x65')));}_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x4,_0x0a9e('0x66'),_0x54327c[_0x0a9e('0x67')]+','+_0x0a9e('0x68')+(0x8+_0xe05a5a[_0x0a9e('0x2a')][_0x0a9e('0x39')])+'}'+','+0x1));return _0x797b45;}function formatPrefixName(_0x2d7205){var _0x1cc4f3='_';for(var _0x2e89b7=0x0;_0x2e89b7<_0x2d7205[_0x0a9e('0x39')];_0x2e89b7++){if(_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)=='-'){_0x1cc4f3+=_0x2d7205[_0x0a9e('0x69')](_0x2e89b7);}else{_0x1cc4f3+='['+_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)+']';}}_0x1cc4f3+='.';return _0x1cc4f3;}exports[_0x0a9e('0x22')]=function(_0x2a28c0,_0x4257c9,_0x5150a4){var _0x1b0b98=_0x2a28c0[_0x0a9e('0x4c')];_0x1b0b98[_0x0a9e('0x60')]='system-'+_0x1b0b98[_0x0a9e('0x2a')]+'-';return db[_0x0a9e('0x6a')]['transaction'](function(_0x83f0b2){return db[_0x0a9e('0x42')][_0x0a9e('0x22')](_0x1b0b98,{'where':{'id':_0x1b0b98['id']},'transaction':_0x83f0b2})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x5d')]['destroy']({'where':{'VoicePrefixId':_0x1b0b98['id']},'transaction':_0x83f0b2})['then'](function(){return db['VoiceExtension'][_0x0a9e('0x49')]({'where':{'id':_0x1b0b98[_0x0a9e('0x4e')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x23a7d3){return createVoicePrefixExtensions(_0x1b0b98,_0x23a7d3,_0x83f0b2);});});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x42')][_0x0a9e('0x6b')](_0x1b0b98['id']);})[_0x0a9e('0x23')](respondWithResult(_0x4257c9,null))['catch'](handleError(_0x4257c9,null));};exports[_0x0a9e('0x6c')]=function(_0xcbc8b2,_0x12ccdb,_0x4a4fc7){return db[_0x0a9e('0x42')]['find']({'where':{'id':_0xcbc8b2[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x12ccdb,null))['then'](function(_0x2ed01e){if(_0x2ed01e){return _0x2ed01e[_0x0a9e('0x6c')](_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')],_['omit'](_0xcbc8b2[_0x0a9e('0x4c')],[_0x0a9e('0x6d'),'id'])||{})[_0x0a9e('0x6e')](function(_0x278ab4){for(var _0x5b7fc3=0x0;_0x5b7fc3<_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x0a9e('0x39')];_0x5b7fc3+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:save',{'UserId':_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x5b7fc3],'VoicePrefixId':_0xcbc8b2[_0x0a9e('0x48')]['id']});}return _0x278ab4;});}})[_0x0a9e('0x23')](respondWithResult(_0x12ccdb,null))[_0x0a9e('0x46')](handleError(_0x12ccdb,null));};exports[_0x0a9e('0x70')]=function(_0x40fc56,_0x3df0e3,_0x1a7b03){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x40fc56[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x3df0e3,null))[_0x0a9e('0x23')](function(_0x5b35db){if(_0x5b35db){return _0x5b35db[_0x0a9e('0x70')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])['then'](function(){if(_[_0x0a9e('0x71')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])){for(var _0x2b9463=0x0;_0x2b9463<_0x40fc56['query']['ids'][_0x0a9e('0x39')];_0x2b9463+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')]['ids'][_0x2b9463]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}}else{socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x3df0e3,null))[_0x0a9e('0x46')](handleError(_0x3df0e3,null));};exports[_0x0a9e('0x72')]=function(_0x444f1f,_0x482ca2,_0x2973d3){var _0x3ca9b9={};var _0x45c109={};var _0x16e5b9;var _0x492543;return db[_0x0a9e('0x42')][_0x0a9e('0x73')]({'where':{'id':_0x444f1f['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x482ca2,null))['then'](function(_0x163710){if(_0x163710){_0x16e5b9=_0x163710;_0x45c109[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x74')]['rawAttributes']);_0x45c109['query']=_[_0x0a9e('0x33')](_0x444f1f[_0x0a9e('0x32')]);_0x45c109[_0x0a9e('0x34')]=_['intersection'](_0x45c109[_0x0a9e('0x36')],_0x45c109[_0x0a9e('0x32')]);_0x3ca9b9['attributes']=_['intersection'](_0x45c109[_0x0a9e('0x36')],qs['fields'](_0x444f1f['query']['fields']));_0x3ca9b9[_0x0a9e('0x37')]=_0x3ca9b9[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x3ca9b9[_0x0a9e('0x37')]:_0x45c109[_0x0a9e('0x36')];_0x3ca9b9[_0x0a9e('0x3b')]=qs['sort'](_0x444f1f[_0x0a9e('0x32')]['sort']);_0x3ca9b9[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x75')](_0x444f1f[_0x0a9e('0x32')],_0x45c109['filters']));if(_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x3ca9b9[_0x0a9e('0x3d')]=_['merge'](_0x3ca9b9[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x3ca9b9[_0x0a9e('0x37')],function(_0x22063c){var _0x255e49={};_0x255e49[_0x22063c]={'$like':'%'+_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x255e49;})});}_0x3ca9b9=_[_0x0a9e('0x3f')]({},_0x3ca9b9,_0x444f1f['options']);return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){_0x492543=_0x589ff3[_0x0a9e('0x39')];if(!_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x76')]('nolimit')){_0x3ca9b9[_0x0a9e('0x1d')]=qs['limit'](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x3ca9b9[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x501050){if(_0x501050){return _0x501050?{'count':_0x492543,'rows':_0x501050}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x482ca2,null))[_0x0a9e('0x46')](handleError(_0x482ca2,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 6494357..7881c87 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 _0x28f5=['update','emit','hook','events','../../mysqldb','VoicePrefix'];(function(_0x5504fc,_0x2e161c){var _0xbad34c=function(_0x1f62de){while(--_0x1f62de){_0x5504fc['push'](_0x5504fc['shift']());}};_0xbad34c(++_0x2e161c);}(_0x28f5,0xf3));var _0x528f=function(_0x3238d7,_0x1601a5){_0x3238d7=_0x3238d7-0x0;var _0x5d5bca=_0x28f5[_0x3238d7];return _0x5d5bca;};'use strict';var EventEmitter=require(_0x528f('0x0'));var VoicePrefix=require(_0x528f('0x1'))['db'][_0x528f('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x528f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x584b1d){return function(_0x37c393,_0x13bb9e,_0x28927e){VoicePrefixEvents[_0x528f('0x4')](_0x584b1d+':'+_0x37c393['id'],_0x37c393);VoicePrefixEvents[_0x528f('0x4')](_0x584b1d,_0x37c393);_0x28927e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x528f('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x5454=['remove','emit','hasOwnProperty','hook','exports','VoicePrefix','setMaxListeners','save','update'];(function(_0x5b329c,_0x3109d8){var _0x318dae=function(_0x40b08c){while(--_0x40b08c){_0x5b329c['push'](_0x5b329c['shift']());}};_0x318dae(++_0x3109d8);}(_0x5454,0x10a));var _0x4545=function(_0x3090d3,_0x51c6df){_0x3090d3=_0x3090d3-0x0;var _0x797fdf=_0x5454[_0x3090d3];return _0x797fdf;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x4545('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4545('0x1')](0x0);var events={'afterCreate':_0x4545('0x2'),'afterUpdate':_0x4545('0x3'),'afterDestroy':_0x4545('0x4')};function emitEvent(_0x49f7a2){return function(_0x4f3d24,_0x5d64da,_0x432fb9){VoicePrefixEvents[_0x4545('0x5')](_0x49f7a2+':'+_0x4f3d24['id'],_0x4f3d24);VoicePrefixEvents[_0x4545('0x5')](_0x49f7a2,_0x4f3d24);_0x432fb9(null);};}for(var e in events){if(events[_0x4545('0x6')](e)){var event=events[e];VoicePrefix[_0x4545('0x7')](e,emitEvent(event));}}module[_0x4545('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index fbd8c6e..9208781 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 _0xfb66=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x39a0c4,_0x222bc1){var _0x5b661b=function(_0x404443){while(--_0x404443){_0x39a0c4['push'](_0x39a0c4['shift']());}};_0x5b661b(++_0x222bc1);}(_0xfb66,0x1b2));var _0x6fb6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xfb66[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x6fb6('0x0'));var util=require(_0x6fb6('0x1'));var logger=require(_0x6fb6('0x2'))(_0x6fb6('0x3'));var moment=require(_0x6fb6('0x4'));var BPromise=require(_0x6fb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fb6('0x6'));var rimraf=require(_0x6fb6('0x7'));var config=require(_0x6fb6('0x8'));var attributes=require(_0x6fb6('0x9'));module[_0x6fb6('0xa')]=function(_0x4efdaa,_0x1dbc55){return _0x4efdaa[_0x6fb6('0xb')](_0x6fb6('0xc'),attributes,{'tableName':_0x6fb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebd2=['api','request-promise','path','../../config/environment','./voicePrefix.attributes','VoicePrefix','util','../../config/logger'];(function(_0x8f0755,_0x9b2637){var _0x2b2997=function(_0x3a5b77){while(--_0x3a5b77){_0x8f0755['push'](_0x8f0755['shift']());}};_0x2b2997(++_0x9b2637);}(_0xebd2,0xae));var _0x2ebd=function(_0x3797ee,_0x1f3562){_0x3797ee=_0x3797ee-0x0;var _0x25057c=_0xebd2[_0x3797ee];return _0x25057c;};'use strict';var _=require('lodash');var util=require(_0x2ebd('0x0'));var logger=require(_0x2ebd('0x1'))(_0x2ebd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ebd('0x3'));var fs=require('fs');var path=require(_0x2ebd('0x4'));var rimraf=require('rimraf');var config=require(_0x2ebd('0x5'));var attributes=require(_0x2ebd('0x6'));module['exports']=function(_0x2a7278,_0x52980a){return _0x2a7278['define'](_0x2ebd('0x7'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index cba0659..7b857f8 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 _0x6f44=['socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x2c2d2a,_0x1d9882){var _0x1b1385=function(_0x52e0c1){while(--_0x52e0c1){_0x2c2d2a['push'](_0x2c2d2a['shift']());}};_0x1b1385(++_0x1d9882);}(_0x6f44,0x1ea));var _0x46f4=function(_0x3575e2,_0x2e6294){_0x3575e2=_0x3575e2-0x0;var _0x3f94e6=_0x6f44[_0x3575e2];return _0x3f94e6;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var moment=require('moment');var BPromise=require(_0x46f4('0x2'));var rs=require(_0x46f4('0x3'));var fs=require('fs');var Redis=require(_0x46f4('0x4'));var db=require(_0x46f4('0x5'))['db'];var utils=require(_0x46f4('0x6'));var logger=require(_0x46f4('0x7'))(_0x46f4('0x8'));var config=require(_0x46f4('0x9'));var jayson=require(_0x46f4('0xa'));var client=jayson['client'][_0x46f4('0xb')]({'port':0x232a});config[_0x46f4('0xc')]=_[_0x46f4('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x46f4('0xe'))(new Redis(config[_0x46f4('0xc')]));require('./voicePrefix.socket')[_0x46f4('0xf')](socket);function respondWithRpcPromise(_0x5662a3,_0x2064fd,_0x487ef8){return new BPromise(function(_0x14cc75,_0x1fe1a5){return client[_0x46f4('0x10')](_0x5662a3,_0x487ef8)[_0x46f4('0x11')](function(_0xbc1148){logger[_0x46f4('0x12')](_0x46f4('0x13'),_0x2064fd,_0x46f4('0x14'));logger[_0x46f4('0x15')](_0x46f4('0x16'),_0x2064fd,_0x46f4('0x14'),JSON[_0x46f4('0x17')](_0xbc1148));if(_0xbc1148['error']){if(_0xbc1148[_0x46f4('0x18')][_0x46f4('0x19')]===0x1f4){logger['error'](_0x46f4('0x13'),_0x2064fd,_0xbc1148[_0x46f4('0x18')][_0x46f4('0x1a')]);return _0x1fe1a5(_0xbc1148['error'][_0x46f4('0x1a')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x2064fd,_0xbc1148[_0x46f4('0x18')][_0x46f4('0x1a')]);return _0x14cc75(_0xbc1148[_0x46f4('0x18')]['message']);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x2064fd,'request\x20sent');_0x14cc75(_0xbc1148[_0x46f4('0x1b')][_0x46f4('0x1a')]);}})['catch'](function(_0x22209b){logger[_0x46f4('0x18')](_0x46f4('0x13'),_0x2064fd,_0x22209b);_0x1fe1a5(_0x22209b);});});} \ No newline at end of file +var _0xdb8b=['http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3d47ac,_0x2f451b){var _0x54c4d9=function(_0xe14a8b){while(--_0xe14a8b){_0x3d47ac['push'](_0x3d47ac['shift']());}};_0x54c4d9(++_0x2f451b);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x37a241,_0x1037bd){_0x37a241=_0x37a241-0x0;var _0x63132e=_0xdb8b[_0x37a241];return _0x63132e;};'use strict';var _=require('lodash');var util=require(_0xbdb8('0x0'));var moment=require(_0xbdb8('0x1'));var BPromise=require(_0xbdb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdb8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdb8('0x4'))(_0xbdb8('0x5'));var config=require(_0xbdb8('0x6'));var jayson=require(_0xbdb8('0x7'));var client=jayson['client'][_0xbdb8('0x8')]({'port':0x232a});config['redis']=_[_0xbdb8('0x9')](config[_0xbdb8('0xa')],{'host':_0xbdb8('0xb'),'port':0x18eb});var socket=require(_0xbdb8('0xc'))(new Redis(config[_0xbdb8('0xa')]));require(_0xbdb8('0xd'))['register'](socket);function respondWithRpcPromise(_0x3339c2,_0x176a31,_0x3cc8d1){return new BPromise(function(_0x682657,_0x2fba54){return client[_0xbdb8('0xe')](_0x3339c2,_0x3cc8d1)[_0xbdb8('0xf')](function(_0x55f17e){logger['info'](_0xbdb8('0x10'),_0x176a31,'request\x20sent');logger[_0xbdb8('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x176a31,_0xbdb8('0x12'),JSON['stringify'](_0x55f17e));if(_0x55f17e[_0xbdb8('0x13')]){if(_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x14')]===0x1f4){logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);return _0x2fba54(_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);}logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);return _0x682657(_0x55f17e['error'][_0xbdb8('0x15')]);}else{logger[_0xbdb8('0x16')](_0xbdb8('0x10'),_0x176a31,'request\x20sent');_0x682657(_0x55f17e['result'][_0xbdb8('0x15')]);}})['catch'](function(_0x37177b){logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x37177b);_0x2fba54(_0x37177b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 350bb0a..a419071 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 _0xd8cc=['removeListener','length','voicePrefix:','./voicePrefix.events','save','emit'];(function(_0x3d9662,_0x22b32c){var _0x302fb9=function(_0xf4a8de){while(--_0xf4a8de){_0x3d9662['push'](_0x3d9662['shift']());}};_0x302fb9(++_0x22b32c);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0xd8cc[_0x1b76e6];return _0x333b53;};'use strict';var VoicePrefixEvents=require(_0xcd8c('0x0'));var events=[_0xcd8c('0x1'),'remove','update'];function createListener(_0x1576d8,_0x7f40a7){return function(_0x1a1e1e){_0x7f40a7[_0xcd8c('0x2')](_0x1576d8,_0x1a1e1e);};}function removeListener(_0x58d2c9,_0x2dad29){return function(){VoicePrefixEvents[_0xcd8c('0x3')](_0x58d2c9,_0x2dad29);};}exports['register']=function(_0x5776fc){for(var _0x233d52=0x0,_0x55c4ed=events[_0xcd8c('0x4')];_0x233d52<_0x55c4ed;_0x233d52++){var _0x5814b4=events[_0x233d52];var _0x4740bf=createListener(_0xcd8c('0x5')+_0x5814b4,_0x5776fc);VoicePrefixEvents['on'](_0x5814b4,_0x4740bf);}}; \ No newline at end of file +var _0xc737=['remove','update','emit','removeListener','./voicePrefix.events','save'];(function(_0x2bdaba,_0x168be1){var _0x471b62=function(_0x33ae2f){while(--_0x33ae2f){_0x2bdaba['push'](_0x2bdaba['shift']());}};_0x471b62(++_0x168be1);}(_0xc737,0x154));var _0x7c73=function(_0x1263cc,_0x34b0a6){_0x1263cc=_0x1263cc-0x0;var _0x4132a0=_0xc737[_0x1263cc];return _0x4132a0;};'use strict';var VoicePrefixEvents=require(_0x7c73('0x0'));var events=[_0x7c73('0x1'),_0x7c73('0x2'),_0x7c73('0x3')];function createListener(_0x50f167,_0x3cb8f6){return function(_0x284ee4){_0x3cb8f6[_0x7c73('0x4')](_0x50f167,_0x284ee4);};}function removeListener(_0x597691,_0x36583e){return function(){VoicePrefixEvents[_0x7c73('0x5')](_0x597691,_0x36583e);};}exports['register']=function(_0x5ad227){for(var _0x37635c=0x0,_0x3f6f81=events['length'];_0x37635c<_0x3f6f81;_0x37635c++){var _0x9264a9=events[_0x37635c];var _0x3281fe=createListener('voicePrefix:'+_0x9264a9,_0x5ad227);VoicePrefixEvents['on'](_0x9264a9,_0x3281fe);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b24dda6..a522bb5 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 _0xa842=['path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','update','delete','removeTeams','removeLists','removeBlackLists','exports','util'];(function(_0x326876,_0x4bea84){var _0x44dfef=function(_0x3d6f8a){while(--_0x3d6f8a){_0x326876['push'](_0x326876['shift']());}};_0x44dfef(++_0x4bea84);}(_0xa842,0xb8));var _0x2a84=function(_0x292772,_0x309ee9){_0x292772=_0x292772-0x0;var _0x40f3ff=_0xa842[_0x292772];return _0x40f3ff;};'use strict';var multer=require('multer');var util=require(_0x2a84('0x0'));var path=require(_0x2a84('0x1'));var timeout=require('connect-timeout');var express=require(_0x2a84('0x2'));var router=express[_0x2a84('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2a84('0x4'));var config=require(_0x2a84('0x5'));var controller=require('./voiceQueue.controller');router[_0x2a84('0x6')]('/',auth[_0x2a84('0x7')](),controller[_0x2a84('0x8')]);router[_0x2a84('0x6')](_0x2a84('0x9'),auth[_0x2a84('0x7')](),controller['show']);router[_0x2a84('0x6')]('/:id/hoppers',auth[_0x2a84('0x7')](),controller['getHoppers']);router[_0x2a84('0x6')](_0x2a84('0xa'),auth[_0x2a84('0x7')](),controller[_0x2a84('0xb')]);router[_0x2a84('0x6')](_0x2a84('0xc'),auth[_0x2a84('0x7')](),controller[_0x2a84('0xd')]);router[_0x2a84('0x6')](_0x2a84('0xe'),auth[_0x2a84('0x7')](),controller[_0x2a84('0xf')]);router[_0x2a84('0x6')](_0x2a84('0x10'),auth['isAuthenticated'](),controller[_0x2a84('0x11')]);router[_0x2a84('0x6')](_0x2a84('0x12'),auth[_0x2a84('0x7')](),controller['getAgents']);router[_0x2a84('0x6')](_0x2a84('0x13'),auth[_0x2a84('0x7')](),controller['getMembers']);router[_0x2a84('0x6')](_0x2a84('0x14'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x15')]);router[_0x2a84('0x6')](_0x2a84('0x16'),auth[_0x2a84('0x7')](),controller['getBlackLists']);router[_0x2a84('0x17')]('/',auth[_0x2a84('0x7')](),controller[_0x2a84('0x18')]);router[_0x2a84('0x17')](_0x2a84('0x19'),auth['isAuthenticated'](),controller['clone']);router[_0x2a84('0x17')](_0x2a84('0x10'),auth['isAuthenticated'](),controller[_0x2a84('0x1a')]);router[_0x2a84('0x17')](_0x2a84('0x12'),auth['isAuthenticated'](),controller[_0x2a84('0x1b')]);router[_0x2a84('0x17')](_0x2a84('0x14'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x1c')]);router[_0x2a84('0x17')]('/:id/blacklists',auth[_0x2a84('0x7')](),controller[_0x2a84('0x1d')]);router[_0x2a84('0x1e')](_0x2a84('0x9'),auth['isAuthenticated'](),controller[_0x2a84('0x1f')]);router['delete'](_0x2a84('0x9'),auth[_0x2a84('0x7')](),controller['destroy']);router[_0x2a84('0x20')](_0x2a84('0x10'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x21')]);router[_0x2a84('0x20')](_0x2a84('0x12'),auth[_0x2a84('0x7')](),controller['removeAgents']);router[_0x2a84('0x20')](_0x2a84('0x14'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x22')]);router['delete'](_0x2a84('0x16'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x23')]);module[_0x2a84('0x24')]=router; \ No newline at end of file +var _0x3b19=['/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','put','delete','destroy','removeTeams','removeAgents','removeLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0x16e795,_0x41cc1f){var _0x5cd204=function(_0x62095f){while(--_0x62095f){_0x16e795['push'](_0x16e795['shift']());}};_0x5cd204(++_0x41cc1f);}(_0x3b19,0xbd));var _0x93b1=function(_0x3ead9a,_0x39848d){_0x3ead9a=_0x3ead9a-0x0;var _0x593ec2=_0x3b19[_0x3ead9a];return _0x593ec2;};'use strict';var multer=require(_0x93b1('0x0'));var util=require(_0x93b1('0x1'));var path=require(_0x93b1('0x2'));var timeout=require(_0x93b1('0x3'));var express=require('express');var router=express[_0x93b1('0x4')]();var fs_extra=require(_0x93b1('0x5'));var auth=require(_0x93b1('0x6'));var interaction=require(_0x93b1('0x7'));var config=require(_0x93b1('0x8'));var controller=require(_0x93b1('0x9'));router[_0x93b1('0xa')]('/',auth[_0x93b1('0xb')](),controller[_0x93b1('0xc')]);router[_0x93b1('0xa')](_0x93b1('0xd'),auth[_0x93b1('0xb')](),controller[_0x93b1('0xe')]);router[_0x93b1('0xa')](_0x93b1('0xf'),auth['isAuthenticated'](),controller[_0x93b1('0x10')]);router[_0x93b1('0xa')](_0x93b1('0x11'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x12')]);router['get'](_0x93b1('0x13'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x14')]);router[_0x93b1('0xa')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x93b1('0x15')]);router['get'](_0x93b1('0x16'),auth['isAuthenticated'](),controller[_0x93b1('0x17')]);router['get'](_0x93b1('0x18'),auth[_0x93b1('0xb')](),controller['getAgents']);router['get'](_0x93b1('0x19'),auth['isAuthenticated'](),controller['getMembers']);router[_0x93b1('0xa')](_0x93b1('0x1a'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x1b')]);router[_0x93b1('0xa')](_0x93b1('0x1c'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x1d')]);router[_0x93b1('0x1e')]('/',auth[_0x93b1('0xb')](),controller['create']);router[_0x93b1('0x1e')](_0x93b1('0x1f'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x20')]);router[_0x93b1('0x1e')](_0x93b1('0x16'),auth['isAuthenticated'](),controller[_0x93b1('0x21')]);router['post'](_0x93b1('0x18'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x22')]);router[_0x93b1('0x1e')](_0x93b1('0x1a'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x23')]);router[_0x93b1('0x1e')](_0x93b1('0x1c'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x24')]);router[_0x93b1('0x25')](_0x93b1('0xd'),auth[_0x93b1('0xb')](),controller['update']);router[_0x93b1('0x26')](_0x93b1('0xd'),auth[_0x93b1('0xb')](),controller[_0x93b1('0x27')]);router[_0x93b1('0x26')](_0x93b1('0x16'),auth['isAuthenticated'](),controller[_0x93b1('0x28')]);router[_0x93b1('0x26')]('/:id/users',auth[_0x93b1('0xb')](),controller[_0x93b1('0x29')]);router['delete'](_0x93b1('0x1a'),auth['isAuthenticated'](),controller[_0x93b1('0x2a')]);router[_0x93b1('0x26')](_0x93b1('0x1c'),auth[_0x93b1('0xb')](),controller['removeBlackLists']);module[_0x93b1('0x2b')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 88ef365..a9ef0ff 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 _0x72d2=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#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)','#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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','strategy','booked','progressive','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','split','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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)'];(function(_0x2489f0,_0x3b58a8){var _0x3d6f6a=function(_0x23ddb3){while(--_0x23ddb3){_0x2489f0['push'](_0x2489f0['shift']());}};_0x3d6f6a(++_0x3b58a8);}(_0x72d2,0xb9));var _0x272d=function(_0x5ecc63,_0x110d0d){_0x5ecc63=_0x5ecc63-0x0;var _0x56e65f=_0x72d2[_0x5ecc63];return _0x56e65f;};'use strict';var Sequelize=require(_0x272d('0x0'));module[_0x272d('0x1')]={'name':{'type':Sequelize[_0x272d('0x2')],'allowNull':![],'unique':_0x272d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x5'),_0x272d('0x6')),'allowNull':![],'defaultValue':_0x272d('0x5')},'musiconhold':{'type':Sequelize[_0x272d('0x2')],'defaultValue':_0x272d('0x7')},'announce':{'type':Sequelize[_0x272d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x272d('0x4')]('rr',_0x272d('0x8'),_0x272d('0x9'),_0x272d('0xa'),_0x272d('0xb'),_0x272d('0xc'),_0x272d('0xd'),_0x272d('0xe'),_0x272d('0xf')),'allowNull':![],'defaultValue':_0x272d('0x8'),'set':function(_0x50e181){this[_0x272d('0x10')]('strategy',_0x50e181?_0x50e181:'rrmemory');},'get':function(){var _0x259574=this['getDataValue']('type');var _0x35fe94=this[_0x272d('0x11')]('dialMethod');var _0x24bddd=this[_0x272d('0x11')](_0x272d('0x12'));if(_0x259574===_0x272d('0x5')){return _0x24bddd;}if(_0x35fe94===_0x272d('0x13')&&_0x24bddd===_0x272d('0xc')||_0x35fe94==='booked'&&_0x24bddd==='roundrobin'){return _0x24bddd;}if(_0x35fe94===_0x272d('0x14')||_0x35fe94===_0x272d('0x15')||_0x35fe94===_0x272d('0x16')){return _0x24bddd;}return null;}},'servicelevel':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x272d('0x17')](0xb)},'timeout':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x272d('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':_0x272d('0x18')},'autopause':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x272d('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':_0x272d('0x18')},'announce_holdtime':{'type':Sequelize[_0x272d('0x4')]('yes','no',_0x272d('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x272d('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x272d('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x272d('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x272d('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x272d('0x2')]},'queue_youarenext':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x272d('0x2')]},'queue_quantity1':{'type':Sequelize[_0x272d('0x2')]},'queue_quantity2':{'type':Sequelize[_0x272d('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x272d('0x2')]},'queue_less_than':{'type':Sequelize[_0x272d('0x2')]},'periodic_announce':{'type':Sequelize[_0x272d('0x1a')],'set':function(_0x3fb2e4){this[_0x272d('0x10')](_0x272d('0x1b'),_0x3fb2e4?_0x3fb2e4[_0x272d('0x1c')](','):[]);},'get':function(){return this[_0x272d('0x11')](_0x272d('0x1b'))?this[_0x272d('0x11')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x272d('0x2')],'defaultValue':_0x272d('0x18'),'set':function(_0x3921e4){this[_0x272d('0x10')](_0x272d('0x1d'),_0x3921e4?_0x3921e4['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x272d('0x1d'))?this[_0x272d('0x11')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x272d('0x2')],'defaultValue':'no','set':function(_0x238838){this[_0x272d('0x10')](_0x272d('0x1e'),_0x238838?_0x238838['join'](','):undefined);},'get':function(){return this[_0x272d('0x11')](_0x272d('0x1e'))?this[_0x272d('0x11')](_0x272d('0x1e'))[_0x272d('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x272d('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x272d('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x590ff6){this[_0x272d('0x10')]('acw',_0x590ff6);if(_0x590ff6){if(this[_0x272d('0x11')](_0x272d('0x20'))<0x2){this[_0x272d('0x10')](_0x272d('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x272d('0x21')],'defaultValue':0x0,'comment':_0x272d('0x22')},'dialMethod':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x23'),'progressive',_0x272d('0x16'),'predictive','booked'),'defaultValue':'progressive','comment':_0x272d('0x24')},'dialLimitChannel':{'type':Sequelize[_0x272d('0x17')](0x4)[_0x272d('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x272d('0x26')},'dialLimitQueue':{'type':Sequelize[_0x272d('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x272d('0x27')},'dialPowerLevel':{'type':Sequelize[_0x272d('0x28')](0x2)[_0x272d('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x272d('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x2a'),_0x272d('0x2b')),'defaultValue':_0x272d('0x2b'),'comment':_0x272d('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x272d('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x272d('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x272d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x272d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x272d('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x272d('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x30')},'dialQueueProject':{'type':Sequelize[_0x272d('0x2')],'comment':_0x272d('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x272d('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x36')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x272d('0x37')},'dialTimezone':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x272d('0x2')],'defaultValue':_0x272d('0x38')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x272d('0x39'),_0x272d('0x3a'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x272d('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x272d('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x272d('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x272d('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x272d('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x272d('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x272d('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x272d('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x272d('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x272d('0x21')],'defaultValue':0x0,'comment':_0x272d('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x272d('0x4')]('DESC','ASC'),'defaultValue':_0x272d('0x44')},'dialQueueProject2':{'type':Sequelize[_0x272d('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x272d('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x272d('0x45')},'dialCutDigit':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x272d('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x272d('0x17')],'allowNull':!![],'comment':_0x272d('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x272d('0x21')],'defaultValue':![],'comment':_0x272d('0x4d'),'set':function(_0x281fde){if(!_0x281fde)this[_0x272d('0x10')](_0x272d('0x4e'),null);this[_0x272d('0x10')](_0x272d('0x4f'),_0x281fde);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x2a9b=['#AMD\x20Greeting','#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)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','ENUM','inbound','STRING','default','ringall','leastrecent','fewestcalls','setDataValue','strategy','rrmemory','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x2a9b,0x14b));var _0xb2a9=function(_0x42e752,_0x32f4d9){_0x42e752=_0x42e752-0x0;var _0x2b1b49=_0x2a9b[_0x42e752];return _0x2b1b49;};'use strict';var Sequelize=require('sequelize');module[_0xb2a9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x2'),'outbound'),'allowNull':![],'defaultValue':_0xb2a9('0x2')},'musiconhold':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':_0xb2a9('0x4')},'announce':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb2a9('0x1')]('rr',_0xb2a9('0x5'),_0xb2a9('0x6'),_0xb2a9('0x7'),'random','rrmemory','linear','wrandom','rrordered'),'allowNull':![],'defaultValue':_0xb2a9('0x5'),'set':function(_0x232fee){this[_0xb2a9('0x8')](_0xb2a9('0x9'),_0x232fee?_0x232fee:_0xb2a9('0xa'));},'get':function(){var _0x20c41c=this['getDataValue']('type');var _0x2638f2=this[_0xb2a9('0xb')](_0xb2a9('0xc'));var _0x3897a2=this[_0xb2a9('0xb')](_0xb2a9('0x9'));if(_0x20c41c===_0xb2a9('0x2')){return _0x3897a2;}if(_0x2638f2==='booked'&&_0x3897a2===_0xb2a9('0xa')||_0x2638f2===_0xb2a9('0xd')&&_0x3897a2===_0xb2a9('0xe')){return _0x3897a2;}if(_0x2638f2===_0xb2a9('0xf')||_0x2638f2===_0xb2a9('0x10')||_0x2638f2==='power'){return _0x3897a2;}return null;}},'servicelevel':{'type':Sequelize[_0xb2a9('0x11')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb2a9('0x11')](0xb)},'timeout':{'type':Sequelize[_0xb2a9('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb2a9('0x3')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xb2a9('0x1')]('yes','no',_0xb2a9('0x13')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb2a9('0x11')](0xb)},'autopausebusy':{'type':Sequelize[_0xb2a9('0x1')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb2a9('0x1')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xb2a9('0x12'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb2a9('0x3')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb2a9('0x3')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb2a9('0x11')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb2a9('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xb2a9('0x12'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xb2a9('0x12'),'no'),'defaultValue':_0xb2a9('0x12')},'announce_holdtime':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no',_0xb2a9('0x14')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no')},'announce_position_limit':{'type':Sequelize[_0xb2a9('0x11')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb2a9('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb2a9('0x3')]},'queue_youarenext':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb2a9('0x3')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb2a9('0x3')]},'queue_quantity1':{'type':Sequelize[_0xb2a9('0x3')]},'queue_quantity2':{'type':Sequelize[_0xb2a9('0x3')]},'queue_periodic_announce':{'type':Sequelize[_0xb2a9('0x3')]},'queue_less_than':{'type':Sequelize[_0xb2a9('0x3')]},'periodic_announce':{'type':Sequelize[_0xb2a9('0x15')],'set':function(_0xe32594){this['setDataValue'](_0xb2a9('0x16'),_0xe32594?_0xe32594[_0xb2a9('0x17')](','):[]);},'get':function(){return this['getDataValue'](_0xb2a9('0x16'))?this[_0xb2a9('0xb')](_0xb2a9('0x16'))[_0xb2a9('0x18')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xb2a9('0x12'),'set':function(_0x1ca172){this['setDataValue'](_0xb2a9('0x19'),_0x1ca172?_0x1ca172[_0xb2a9('0x17')](','):undefined);},'get':function(){return this['getDataValue'](_0xb2a9('0x19'))?this[_0xb2a9('0xb')]('joinempty')[_0xb2a9('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':'no','set':function(_0x58fddb){this[_0xb2a9('0x8')](_0xb2a9('0x1a'),_0x58fddb?_0x58fddb[_0xb2a9('0x17')](','):undefined);},'get':function(){return this[_0xb2a9('0xb')]('leavewhenempty')?this[_0xb2a9('0xb')](_0xb2a9('0x1a'))[_0xb2a9('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb2a9('0x11')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x12'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb2a9('0x3')]},'description':{'type':Sequelize[_0xb2a9('0x3')]},'acw':{'type':Sequelize[_0xb2a9('0x1b')],'defaultValue':0x0,'set':function(_0x5906e2){this[_0xb2a9('0x8')](_0xb2a9('0x1c'),_0x5906e2);if(_0x5906e2){if(this[_0xb2a9('0xb')](_0xb2a9('0x1d'))<0x2){this[_0xb2a9('0x8')](_0xb2a9('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb2a9('0x11')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb2a9('0x1e')},'dialMethod':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x1f'),_0xb2a9('0xf'),_0xb2a9('0x20'),_0xb2a9('0x10'),_0xb2a9('0xd')),'defaultValue':_0xb2a9('0xf'),'comment':_0xb2a9('0x21')},'dialLimitChannel':{'type':Sequelize[_0xb2a9('0x11')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xb2a9('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb2a9('0x23')},'dialPowerLevel':{'type':Sequelize[_0xb2a9('0x24')](0x2)[_0xb2a9('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb2a9('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0xb2a9('0x1')]('agentBusyFactor','dropRate'),'defaultValue':_0xb2a9('0x26'),'comment':_0xb2a9('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb2a9('0x24')](0x2)[_0xb2a9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xb2a9('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb2a9('0x28')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb2a9('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb2a9('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':_0xb2a9('0x29'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb2a9('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2a9('0x2a')},'dialQueueProject':{'type':Sequelize[_0xb2a9('0x3')],'comment':_0xb2a9('0x2b')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2a9('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb2a9('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2a9('0x2d')},'dialBusyMaxRetry':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2a9('0x2e')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb2a9('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2a9('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb2a9('0x22')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb2a9('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2a9('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xb2a9('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x31'),_0xb2a9('0x32'),_0xb2a9('0x33')),'defaultValue':_0xb2a9('0x31')},'dialAMDActive':{'type':Sequelize[_0xb2a9('0x1b')],'defaultValue':0x0,'comment':_0xb2a9('0x34')},'dialAMDInitialSilence':{'type':Sequelize[_0xb2a9('0x11')](0x9)[_0xb2a9('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb2a9('0x35')},'dialAMDGreeting':{'type':Sequelize[_0xb2a9('0x11')](0x9)[_0xb2a9('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb2a9('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb2a9('0x11')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb2a9('0x11')](0x9)[_0xb2a9('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb2a9('0x37')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb2a9('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb2a9('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb2a9('0x11')](0x9)[_0xb2a9('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb2a9('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb2a9('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb2a9('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb2a9('0x11')](0x5)[_0xb2a9('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb2a9('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb2a9('0x11')](0x9)[_0xb2a9('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xb2a9('0x11')](0x5)[_0xb2a9('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb2a9('0x3c')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb2a9('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x3e'),_0xb2a9('0x3f')),'defaultValue':_0xb2a9('0x3e')},'dialQueueProject2':{'type':Sequelize[_0xb2a9('0x3')],'comment':_0xb2a9('0x2b')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb2a9('0x1b')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb2a9('0x1b')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb2a9('0x40')},'dialCutDigit':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb2a9('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2a9('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb2a9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xb2a9('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2a9('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0xb2a9('0x11')](0x5)[_0xb2a9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2a9('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2a9('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb2a9('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2a9('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb2a9('0x11')](0x5)[_0xb2a9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb2a9('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb2a9('0x11')](0x5)[_0xb2a9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb2a9('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xb2a9('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb2a9('0x4a'),'set':function(_0x335691){if(!_0x335691)this[_0xb2a9('0x8')](_0xb2a9('0x4b'),null);this['setDataValue'](_0xb2a9('0x4c'),_0x335691);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb2a9('0x11')](0x3)[_0xb2a9('0x22')],'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 531e7a0..3f34576 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 _0x738a=['addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','insert','cm_hopper','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','user','role','outbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','voicePause','interface','forEach','penalty','transaction','each','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','field','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList'];(function(_0x526786,_0x105cbf){var _0x3a512d=function(_0x4efa05){while(--_0x4efa05){_0x526786['push'](_0x526786['shift']());}};_0x3a512d(++_0x105cbf);}(_0x738a,0x18b));var _0xa738=function(_0x490e61,_0x7f848e){_0x490e61=_0x490e61-0x0;var _0x169bc6=_0x738a[_0x490e61];return _0x169bc6;};'use strict';var emlformat=require(_0xa738('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa738('0x1'));var rp=require(_0xa738('0x2'));var moment=require(_0xa738('0x3'));var BPromise=require(_0xa738('0x4'));var Mustache=require(_0xa738('0x5'));var util=require(_0xa738('0x6'));var path=require('path');var sox=require(_0xa738('0x7'));var csv=require('to-csv');var ejs=require(_0xa738('0x8'));var fs=require('fs');var fs_extra=require(_0xa738('0x9'));var _=require(_0xa738('0xa'));var squel=require(_0xa738('0xb'));var crypto=require(_0xa738('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa738('0xd'));var toCsv=require(_0xa738('0xe'));var querystring=require(_0xa738('0xf'));var Papa=require(_0xa738('0x10'));var Redis=require(_0xa738('0x11'));var authService=require(_0xa738('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa738('0x13'));var hardwareService=require(_0xa738('0x14'));var logger=require(_0xa738('0x15'))(_0xa738('0x16'));var utils=require(_0xa738('0x17'));var config=require(_0xa738('0x18'));var licenseUtil=require(_0xa738('0x19'));var db=require(_0xa738('0x1a'))['db'];config[_0xa738('0x1b')]=_['defaults'](config[_0xa738('0x1b')],{'host':_0xa738('0x1c'),'port':0x18eb});var socket=require(_0xa738('0x1d'))(new Redis(config[_0xa738('0x1b')]));require(_0xa738('0x1e'))[_0xa738('0x1f')](socket);function respondWithStatusCode(_0xd47666,_0x2c4dd5){_0x2c4dd5=_0x2c4dd5||0xcc;return function(_0x43ad2d){if(_0x43ad2d){return _0xd47666['sendStatus'](_0x2c4dd5);}return _0xd47666[_0xa738('0x20')](_0x2c4dd5)[_0xa738('0x21')]();};}function respondWithResult(_0xd75f96,_0x2acdfe){_0x2acdfe=_0x2acdfe||0xc8;return function(_0x417cb2){if(_0x417cb2){return _0xd75f96[_0xa738('0x20')](_0x2acdfe)[_0xa738('0x22')](_0x417cb2);}};}function respondWithFilteredResult(_0x3d1ad6,_0x109a14){return function(_0x404305){if(_0x404305){var _0x41884d=typeof _0x109a14['offset']===_0xa738('0x23')&&typeof _0x109a14[_0xa738('0x24')]===_0xa738('0x23');var _0x44f07b=_0x404305['count'];var _0x558014=_0x41884d?0x0:_0x109a14[_0xa738('0x25')];var _0x39507b=_0x41884d?_0x404305[_0xa738('0x26')]:_0x109a14['offset']+_0x109a14['limit'];var _0x4a93ed;if(_0x39507b>=_0x44f07b){_0x39507b=_0x44f07b;_0x4a93ed=0xc8;}else{_0x4a93ed=0xce;}_0x3d1ad6[_0xa738('0x20')](_0x4a93ed);return _0x3d1ad6[_0xa738('0x27')](_0xa738('0x28'),_0x558014+'-'+_0x39507b+'/'+_0x44f07b)[_0xa738('0x22')](_0x404305);}return null;};}function patchUpdates(_0x411492){return function(_0x3ca626){try{jsonpatch[_0xa738('0x29')](_0x3ca626,_0x411492,!![]);}catch(_0x5d9156){return BPromise[_0xa738('0x2a')](_0x5d9156);}return _0x3ca626['save']();};}function saveUpdates(_0x135f9c,_0x1cd959){return function(_0x9c0b99){if(_0x9c0b99){return _0x9c0b99[_0xa738('0x2b')](_0x135f9c)[_0xa738('0x2c')](function(_0x563a67){return _0x563a67;});}return null;};}function removeEntity(_0x154a14,_0xf5e552){return function(_0x216916){if(_0x216916){return _0x216916[_0xa738('0x2d')]()[_0xa738('0x2c')](function(){var _0x2fc4e5=_0x216916[_0xa738('0x2e')]({'plain':!![]});var _0x9fc761=[{'name':_0xa738('0x2f'),'value':_0xa738('0x30'),'ignore':![]},{'name':_0xa738('0x31'),'value':'outbound','ignore':![]}];var _0x200dd3=_(_0x9fc761)[_0xa738('0x32')](_0xa738('0x33'))[_0xa738('0x34')]('value')[_0xa738('0x35')]();if(_[_0xa738('0x36')](_0x200dd3,_0x2fc4e5['type'])){return;}var _0x417818=_[_0xa738('0x37')](_0x9fc761,[_0xa738('0x35'),_0x2fc4e5[_0xa738('0x38')]])[_0xa738('0x39')];return db[_0xa738('0x3a')]['destroy']({'where':{'type':_0x417818,'resourceId':_0x2fc4e5['id']}})[_0xa738('0x2c')](function(){return _0x216916;});})[_0xa738('0x2c')](function(){_0x154a14['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c7cf4,_0x495819){return function(_0x1e5f5a){if(!_0x1e5f5a){_0x3c7cf4['sendStatus'](0x194);}return _0x1e5f5a;};}function handleError(_0x360166,_0x375e64){_0x375e64=_0x375e64||0x1f4;return function(_0x3e2c64){logger[_0xa738('0x3b')](_0x3e2c64['stack']);if(_0x3e2c64[_0xa738('0x39')]){delete _0x3e2c64[_0xa738('0x39')];}_0x360166['status'](_0x375e64)[_0xa738('0x3c')](_0x3e2c64);};}exports[_0xa738('0x3d')]=function(_0x30b876,_0x45f24f){var _0x34b31e={},_0x2d60cd={},_0x2f357e={'count':0x0,'rows':[]};var _0x420058=_[_0xa738('0x34')](db[_0xa738('0x3e')][_0xa738('0x3f')],function(_0x41c922){return{'name':_0x41c922[_0xa738('0x40')],'type':_0x41c922[_0xa738('0x38')][_0xa738('0x41')]};});_0x2d60cd[_0xa738('0x42')]=_[_0xa738('0x34')](_0x420058,'name');_0x2d60cd[_0xa738('0x43')]=_[_0xa738('0x44')](_0x30b876[_0xa738('0x43')]);_0x2d60cd[_0xa738('0x45')]=_[_0xa738('0x46')](_0x2d60cd[_0xa738('0x42')],_0x2d60cd[_0xa738('0x43')]);_0x34b31e[_0xa738('0x47')]=_[_0xa738('0x46')](_0x2d60cd[_0xa738('0x42')],qs['fields'](_0x30b876[_0xa738('0x43')][_0xa738('0x48')]));_0x34b31e[_0xa738('0x47')]=_0x34b31e[_0xa738('0x47')][_0xa738('0x49')]?_0x34b31e['attributes']:_0x2d60cd[_0xa738('0x42')];if(!_0x30b876[_0xa738('0x43')][_0xa738('0x4a')]('nolimit')){_0x34b31e[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x30b876[_0xa738('0x43')][_0xa738('0x24')]);_0x34b31e[_0xa738('0x25')]=qs['offset'](_0x30b876['query'][_0xa738('0x25')]);}_0x34b31e[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x30b876[_0xa738('0x43')][_0xa738('0x4c')]);_0x34b31e['where']=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x30b876[_0xa738('0x43')],_0x2d60cd['filters']),_0x420058);if(_0x30b876[_0xa738('0x43')]['filter']){_0x34b31e[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x34b31e[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0x420058,function(_0x28a5af){if(_0x28a5af[_0xa738('0x38')]!==_0xa738('0x50')){var _0x2ce718={};_0x2ce718[_0x28a5af[_0xa738('0x39')]]={'$like':'%'+_0x30b876[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x2ce718;}})});}_0x34b31e=_[_0xa738('0x4f')]({},_0x34b31e,_0x30b876['options']);var _0x414884={'where':_0x34b31e[_0xa738('0x4e')]};return db['VoiceQueue'][_0xa738('0x26')](_0x414884)['then'](function(_0x2ac1a7){_0x2f357e[_0xa738('0x26')]=_0x2ac1a7;if(_0x30b876[_0xa738('0x43')][_0xa738('0x51')]){_0x34b31e[_0xa738('0x52')]=[{'all':!![]}];}return db['VoiceQueue'][_0xa738('0x53')](_0x34b31e);})[_0xa738('0x2c')](function(_0x3fa1c2){_0x2f357e['rows']=_0x3fa1c2;return _0x2f357e;})['then'](respondWithFilteredResult(_0x45f24f,_0x34b31e))[_0xa738('0x54')](handleError(_0x45f24f,null));};exports[_0xa738('0x55')]=function(_0x823770,_0x5e3c08){var _0x22d15e={'raw':![],'where':{'id':_0x823770[_0xa738('0x56')]['id']}},_0x2b2aa2={};_0x2b2aa2[_0xa738('0x42')]=_[_0xa738('0x44')](db['VoiceQueue'][_0xa738('0x3f')]);_0x2b2aa2[_0xa738('0x43')]=_[_0xa738('0x44')](_0x823770[_0xa738('0x43')]);_0x2b2aa2[_0xa738('0x45')]=_['intersection'](_0x2b2aa2[_0xa738('0x42')],_0x2b2aa2[_0xa738('0x43')]);_0x22d15e[_0xa738('0x47')]=_[_0xa738('0x46')](_0x2b2aa2['model'],qs[_0xa738('0x48')](_0x823770[_0xa738('0x43')][_0xa738('0x48')]));_0x22d15e[_0xa738('0x47')]=_0x22d15e[_0xa738('0x47')]['length']?_0x22d15e['attributes']:_0x2b2aa2[_0xa738('0x42')];if(_0x823770[_0xa738('0x43')][_0xa738('0x51')]){_0x22d15e[_0xa738('0x52')]=[{'all':!![]}];}_0x22d15e=_['merge']({},_0x22d15e,_0x823770[_0xa738('0x57')]);return db[_0xa738('0x3e')][_0xa738('0x37')](_0x22d15e)[_0xa738('0x2c')](handleEntityNotFound(_0x5e3c08,null))[_0xa738('0x2c')](respondWithResult(_0x5e3c08,null))[_0xa738('0x54')](handleError(_0x5e3c08,null));};exports[_0xa738('0x58')]=function(_0x1e28ff,_0x44ab30){return db[_0xa738('0x3e')][_0xa738('0x58')](_0x1e28ff[_0xa738('0x59')],{})['then'](function(_0x561bfc){var _0x1da184=_0x1e28ff[_0xa738('0x5a')][_0xa738('0x2e')]({'plain':!![]});if(!_0x1da184)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1da184[_0xa738('0x5b')]===_0xa738('0x5a')){var _0x409f6c=_0x561bfc[_0xa738('0x2e')]({'plain':!![]});var _0x38c00e=[{'name':_0xa738('0x2f'),'value':_0xa738('0x30')},{'name':'QueueCampaigns','value':_0xa738('0x5c')}];var _0x21c80c=_['find'](_0x38c00e,[_0xa738('0x35'),_0x409f6c[_0xa738('0x38')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x21c80c,'userProfileId':_0x1da184['userProfileId']},'raw':!![]})[_0xa738('0x2c')](function(_0x3b4a21){if(_0x3b4a21&&_0x3b4a21[_0xa738('0x5d')]===0x0){return db[_0xa738('0x3a')]['create']({'name':_0x409f6c[_0xa738('0x39')],'resourceId':_0x409f6c['id'],'type':_0x3b4a21['name'],'sectionId':_0x3b4a21['id']},{})[_0xa738('0x2c')](function(){return _0x561bfc;});}else{return _0x561bfc;}})[_0xa738('0x54')](function(_0x1740ff){logger[_0xa738('0x3b')](_0xa738('0x5e'),_0x1740ff);throw _0x1740ff;});}return _0x561bfc;})[_0xa738('0x2c')](respondWithResult(_0x44ab30,0xc9))[_0xa738('0x54')](handleError(_0x44ab30,null));};exports['clone']=function(_0x20a9db,_0x562041){var _0x342d32={'where':{'id':_0x20a9db[_0xa738('0x56')]['id']}},_0xa2c49d={};_0xa2c49d['model']=_['keys'](db[_0xa738('0x3e')][_0xa738('0x3f')]);_0x342d32[_0xa738('0x47')]=_[_0xa738('0x46')](_0xa2c49d[_0xa738('0x42')],qs[_0xa738('0x48')](_0x20a9db['query'][_0xa738('0x48')]));_0x342d32[_0xa738('0x47')]=_0x342d32[_0xa738('0x47')]['length']?_0x342d32[_0xa738('0x47')]:_0xa2c49d[_0xa738('0x42')];if(_0x20a9db[_0xa738('0x43')][_0xa738('0x51')]){_0x342d32[_0xa738('0x52')]=[{'all':!![]}];}_0x342d32=_[_0xa738('0x4f')]({},_0x342d32,_0x20a9db[_0xa738('0x57')]);return db[_0xa738('0x3e')][_0xa738('0x37')](_0x342d32)[_0xa738('0x2c')](handleEntityNotFound(_0x562041,null))[_0xa738('0x2c')](function(_0x23aca6){if(_0x23aca6){var _0x384087=_0x23aca6['get']({'plain':!![]});_0x384087=qs[_0xa738('0x5f')](_0x384087,['id',_0xa738('0x60'),_0xa738('0x61')]);_0x20a9db[_0xa738('0x59')]=_[_0xa738('0x5f')](_0x20a9db[_0xa738('0x59')],['id',_0xa738('0x60'),_0xa738('0x61')]);return db['VoiceQueue'][_0xa738('0x58')](_[_0xa738('0x4f')](_0x384087,_0x20a9db[_0xa738('0x59')]),{'include':_0x20a9db[_0xa738('0x43')][_0xa738('0x51')]?[{'all':!![]}]:undefined})[_0xa738('0x2c')](function(_0x23e154){var _0x565772=_0x20a9db['user'][_0xa738('0x2e')]({'plain':!![]});if(!_0x565772)throw new Error(_0xa738('0x62'));if(_0x565772[_0xa738('0x5b')]==='user'){var _0x33ef3a=_0x23e154[_0xa738('0x2e')]({'plain':!![]});var _0x19faa7=[{'name':_0xa738('0x2f'),'value':_0xa738('0x30')},{'name':_0xa738('0x31'),'value':_0xa738('0x5c')}];var _0x200398=_[_0xa738('0x37')](_0x19faa7,[_0xa738('0x35'),_0x33ef3a[_0xa738('0x38')]])[_0xa738('0x39')];return db[_0xa738('0x63')][_0xa738('0x37')]({'where':{'name':_0x200398,'userProfileId':_0x565772['userProfileId']},'raw':!![]})['then'](function(_0x3a7be8){if(_0x3a7be8&&_0x3a7be8[_0xa738('0x5d')]===0x0){return db[_0xa738('0x3a')][_0xa738('0x58')]({'name':_0x33ef3a[_0xa738('0x39')],'resourceId':_0x33ef3a['id'],'type':_0x3a7be8[_0xa738('0x39')],'sectionId':_0x3a7be8['id']},{})[_0xa738('0x2c')](function(){return _0x23e154;});}else{return _0x23e154;}})['catch'](function(_0x53edc6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53edc6);throw _0x53edc6;});}return _0x23e154;});}})[_0xa738('0x2c')](respondWithResult(_0x562041,0xc9))[_0xa738('0x54')](handleError(_0x562041,null));};exports['update']=function(_0x1eafa5,_0x45057d){if(_0x1eafa5[_0xa738('0x59')]['id']){delete _0x1eafa5[_0xa738('0x59')]['id'];}return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x1eafa5[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x45057d,null))[_0xa738('0x2c')](saveUpdates(_0x1eafa5[_0xa738('0x59')],null))[_0xa738('0x2c')](respondWithResult(_0x45057d,null))[_0xa738('0x54')](handleError(_0x45057d,null));};exports['destroy']=function(_0x18221c,_0x2b145c){return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x18221c[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b145c,null))['then'](removeEntity(_0x2b145c,null))[_0xa738('0x54')](handleError(_0x2b145c,null));};exports[_0xa738('0x64')]=function(_0x2a26f0,_0x31b2ee,_0x378a7b){var _0x113466={'raw':![],'where':{}};var _0x530158={};var _0xc29232={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x2a26f0[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x31b2ee,null))[_0xa738('0x2c')](function(_0x282044){if(_0x282044){_0x530158['model']=_[_0xa738('0x44')](db[_0xa738('0x66')][_0xa738('0x3f')]);_0x530158['query']=_['keys'](_0x2a26f0['query']);_0x530158[_0xa738('0x45')]=_['intersection'](_0x530158[_0xa738('0x42')],_0x530158[_0xa738('0x43')]);_0x113466[_0xa738('0x47')]=_['intersection'](_0x530158[_0xa738('0x42')],qs[_0xa738('0x48')](_0x2a26f0[_0xa738('0x43')][_0xa738('0x48')]));_0x113466['attributes']=_0x113466[_0xa738('0x47')][_0xa738('0x49')]?_0x113466[_0xa738('0x47')]:_0x530158[_0xa738('0x42')];if(!_0x2a26f0[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x113466[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x2a26f0[_0xa738('0x43')][_0xa738('0x24')]);_0x113466[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x2a26f0[_0xa738('0x43')]['offset']);}_0x113466[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x2a26f0[_0xa738('0x43')][_0xa738('0x4c')]);_0x113466[_0xa738('0x4e')]=qs['filters'](_['pick'](_0x2a26f0[_0xa738('0x43')],_0x530158[_0xa738('0x45')]));_0x113466[_0xa738('0x4e')][_0xa738('0x68')]=_0x282044['id'];if(_0x2a26f0[_0xa738('0x43')]['filter']){_0x113466['where']=_[_0xa738('0x4f')](_0x113466['where'],{'$or':_[_0xa738('0x34')](_0x113466['attributes'],function(_0x4cff26){var _0x975927={};_0x975927[_0x4cff26]={'$like':'%'+_0x2a26f0[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x975927;})});}_0x113466=_[_0xa738('0x4f')]({},_0x113466,_0x2a26f0['options']);return db['CmHopper']['count']({'where':_0x113466[_0xa738('0x4e')]})[_0xa738('0x2c')](function(_0x8a8d6c){_0xc29232[_0xa738('0x26')]=_0x8a8d6c;if(_0x2a26f0[_0xa738('0x43')][_0xa738('0x51')]){_0x113466[_0xa738('0x52')]=[{'all':!![]}];}return db[_0xa738('0x66')][_0xa738('0x53')](_0x113466);})[_0xa738('0x2c')](function(_0x4074a1){_0xc29232[_0xa738('0x69')]=_0x4074a1;return _0xc29232;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x31b2ee,_0x113466))[_0xa738('0x54')](handleError(_0x31b2ee,null));};exports[_0xa738('0x6a')]=function(_0x1fa85f,_0x5e56a3,_0x456738){var _0x106526={'raw':!![],'where':{}};var _0x1b267b={};var _0x4bdba7={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x1fa85f['params']['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x5e56a3,null))[_0xa738('0x2c')](function(_0x3b0feb){if(_0x3b0feb){_0x1b267b['model']=_[_0xa738('0x44')](db[_0xa738('0x6b')][_0xa738('0x3f')]);_0x1b267b[_0xa738('0x43')]=_['keys'](_0x1fa85f[_0xa738('0x43')]);_0x1b267b[_0xa738('0x45')]=_[_0xa738('0x46')](_0x1b267b[_0xa738('0x42')],_0x1b267b[_0xa738('0x43')]);_0x106526['attributes']=_['intersection'](_0x1b267b[_0xa738('0x42')],qs[_0xa738('0x48')](_0x1fa85f['query'][_0xa738('0x48')]));_0x106526['attributes']=_0x106526['attributes'][_0xa738('0x49')]?_0x106526[_0xa738('0x47')]:_0x1b267b[_0xa738('0x42')];if(!_0x1fa85f[_0xa738('0x43')]['hasOwnProperty']('nolimit')){_0x106526[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x1fa85f[_0xa738('0x43')][_0xa738('0x24')]);_0x106526['offset']=qs[_0xa738('0x25')](_0x1fa85f['query'][_0xa738('0x25')]);}_0x106526[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x1fa85f[_0xa738('0x43')]['sort']);_0x106526['where']=qs[_0xa738('0x45')](_['pick'](_0x1fa85f[_0xa738('0x43')],_0x1b267b[_0xa738('0x45')]));_0x106526[_0xa738('0x4e')][_0xa738('0x68')]=_0x3b0feb['id'];if(_0x1fa85f[_0xa738('0x43')]['filter']){_0x106526[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x106526[_0xa738('0x4e')],{'$or':_['map'](_0x106526[_0xa738('0x47')],function(_0x41fb14){var _0x1e3722={};_0x1e3722[_0x41fb14]={'$like':'%'+_0x1fa85f[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x1e3722;})});}_0x106526=_['merge']({},_0x106526,_0x1fa85f['options']);return db[_0xa738('0x6b')][_0xa738('0x26')]({'where':_0x106526[_0xa738('0x4e')]})[_0xa738('0x2c')](function(_0x2a2ec3){_0x4bdba7['count']=_0x2a2ec3;if(_0x1fa85f[_0xa738('0x43')][_0xa738('0x51')]){_0x106526[_0xa738('0x52')]=[{'all':!![]}];}return db[_0xa738('0x6b')][_0xa738('0x53')](_0x106526);})[_0xa738('0x2c')](function(_0x412373){_0x4bdba7['rows']=_0x412373;return _0x4bdba7;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x5e56a3,_0x106526))[_0xa738('0x54')](handleError(_0x5e56a3,null));};exports[_0xa738('0x6c')]=function(_0x2ccbcc,_0x1111e6,_0x3b7770){var _0xa9142c={'raw':!![],'where':{}};var _0x2e4b81={};var _0x24fe9a={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x2ccbcc['params']['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x1111e6,null))[_0xa738('0x2c')](function(_0x16e86b){if(_0x16e86b){_0x2e4b81[_0xa738('0x42')]=_['keys'](db[_0xa738('0x6d')][_0xa738('0x3f')]);_0x2e4b81[_0xa738('0x43')]=_['keys'](_0x2ccbcc['query']);_0x2e4b81[_0xa738('0x45')]=_[_0xa738('0x46')](_0x2e4b81['model'],_0x2e4b81[_0xa738('0x43')]);_0xa9142c[_0xa738('0x47')]=_[_0xa738('0x46')](_0x2e4b81[_0xa738('0x42')],qs[_0xa738('0x48')](_0x2ccbcc[_0xa738('0x43')]['fields']));_0xa9142c['attributes']=_0xa9142c[_0xa738('0x47')][_0xa738('0x49')]?_0xa9142c[_0xa738('0x47')]:_0x2e4b81[_0xa738('0x42')];if(!_0x2ccbcc['query'][_0xa738('0x4a')](_0xa738('0x67'))){_0xa9142c['limit']=qs[_0xa738('0x24')](_0x2ccbcc[_0xa738('0x43')]['limit']);_0xa9142c['offset']=qs[_0xa738('0x25')](_0x2ccbcc['query'][_0xa738('0x25')]);}_0xa9142c[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x2ccbcc[_0xa738('0x43')][_0xa738('0x4c')]);_0xa9142c[_0xa738('0x4e')]=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x2ccbcc['query'],_0x2e4b81['filters']));_0xa9142c[_0xa738('0x4e')][_0xa738('0x68')]=_0x16e86b['id'];if(_0x2ccbcc[_0xa738('0x43')][_0xa738('0x32')]){_0xa9142c[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0xa9142c[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0xa9142c[_0xa738('0x47')],function(_0x44a191){var _0x25ff65={};_0x25ff65[_0x44a191]={'$like':'%'+_0x2ccbcc['query'][_0xa738('0x32')]+'%'};return _0x25ff65;})});}_0xa9142c=_[_0xa738('0x4f')]({},_0xa9142c,_0x2ccbcc[_0xa738('0x57')]);return db[_0xa738('0x6d')]['count']({'where':_0xa9142c['where']})[_0xa738('0x2c')](function(_0x3b01c9){_0x24fe9a['count']=_0x3b01c9;if(_0x2ccbcc[_0xa738('0x43')][_0xa738('0x51')]){_0xa9142c[_0xa738('0x52')]=[{'all':!![]}];}return db[_0xa738('0x6d')][_0xa738('0x53')](_0xa9142c);})[_0xa738('0x2c')](function(_0x387629){_0x24fe9a['rows']=_0x387629;return _0x24fe9a;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x1111e6,_0xa9142c))[_0xa738('0x54')](handleError(_0x1111e6,null));};exports['getHopperBlacks']=function(_0x45afa0,_0x136a17,_0x7fa764){var _0x57644e={'raw':!![],'where':{}};var _0x162d39={};var _0x2626a5={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x45afa0[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x136a17,null))[_0xa738('0x2c')](function(_0x3c8aae){if(_0x3c8aae){_0x162d39[_0xa738('0x42')]=_['keys'](db[_0xa738('0x6e')][_0xa738('0x3f')]);_0x162d39['query']=_[_0xa738('0x44')](_0x45afa0[_0xa738('0x43')]);_0x162d39[_0xa738('0x45')]=_['intersection'](_0x162d39['model'],_0x162d39[_0xa738('0x43')]);_0x57644e[_0xa738('0x47')]=_['intersection'](_0x162d39[_0xa738('0x42')],qs[_0xa738('0x48')](_0x45afa0[_0xa738('0x43')][_0xa738('0x48')]));_0x57644e[_0xa738('0x47')]=_0x57644e[_0xa738('0x47')][_0xa738('0x49')]?_0x57644e[_0xa738('0x47')]:_0x162d39[_0xa738('0x42')];if(!_0x45afa0[_0xa738('0x43')]['hasOwnProperty'](_0xa738('0x67'))){_0x57644e['limit']=qs[_0xa738('0x24')](_0x45afa0[_0xa738('0x43')]['limit']);_0x57644e['offset']=qs[_0xa738('0x25')](_0x45afa0[_0xa738('0x43')][_0xa738('0x25')]);}_0x57644e[_0xa738('0x4b')]=qs['sort'](_0x45afa0[_0xa738('0x43')][_0xa738('0x4c')]);_0x57644e[_0xa738('0x4e')]=qs['filters'](_['pick'](_0x45afa0[_0xa738('0x43')],_0x162d39[_0xa738('0x45')]));_0x57644e['where'][_0xa738('0x68')]=_0x3c8aae['id'];if(_0x45afa0['query']['filter']){_0x57644e[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x57644e[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0x57644e[_0xa738('0x47')],function(_0x1cebce){var _0x1764be={};_0x1764be[_0x1cebce]={'$like':'%'+_0x45afa0[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x1764be;})});}_0x57644e=_['merge']({},_0x57644e,_0x45afa0[_0xa738('0x57')]);return db[_0xa738('0x6e')][_0xa738('0x26')]({'where':_0x57644e[_0xa738('0x4e')]})[_0xa738('0x2c')](function(_0x282c1d){_0x2626a5[_0xa738('0x26')]=_0x282c1d;if(_0x45afa0[_0xa738('0x43')]['includeAll']){_0x57644e['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x57644e);})[_0xa738('0x2c')](function(_0x1bbdb4){_0x2626a5[_0xa738('0x69')]=_0x1bbdb4;return _0x2626a5;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x136a17,_0x57644e))[_0xa738('0x54')](handleError(_0x136a17,null));};exports[_0xa738('0x6f')]=function(_0x5d053a,_0x37960e,_0x4d1817){var _0x1adf5e={};var _0x3b3b05={};var _0x3e5811;var _0x4cb392;return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x5d053a['params']['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x37960e,null))[_0xa738('0x2c')](function(_0xc4f39f){if(_0xc4f39f){_0x3e5811=_0xc4f39f;_0x3b3b05[_0xa738('0x42')]=_[_0xa738('0x44')](db['Team'][_0xa738('0x3f')]);_0x3b3b05['query']=_['keys'](_0x5d053a[_0xa738('0x43')]);_0x3b3b05['filters']=_[_0xa738('0x46')](_0x3b3b05['model'],_0x3b3b05[_0xa738('0x43')]);_0x1adf5e[_0xa738('0x47')]=_[_0xa738('0x46')](_0x3b3b05[_0xa738('0x42')],qs[_0xa738('0x48')](_0x5d053a[_0xa738('0x43')][_0xa738('0x48')]));_0x1adf5e[_0xa738('0x47')]=_0x1adf5e['attributes'][_0xa738('0x49')]?_0x1adf5e['attributes']:_0x3b3b05['model'];_0x1adf5e[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x5d053a[_0xa738('0x43')][_0xa738('0x4c')]);_0x1adf5e[_0xa738('0x4e')]=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x5d053a[_0xa738('0x43')],_0x3b3b05[_0xa738('0x45')]));if(_0x5d053a['query'][_0xa738('0x32')]){_0x1adf5e[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x1adf5e[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0x1adf5e[_0xa738('0x47')],function(_0x5108a3){var _0x2768d0={};_0x2768d0[_0x5108a3]={'$like':'%'+_0x5d053a[_0xa738('0x43')]['filter']+'%'};return _0x2768d0;})});}_0x1adf5e=_[_0xa738('0x4f')]({},_0x1adf5e,_0x5d053a['options']);return _0x3e5811[_0xa738('0x6f')](_0x1adf5e);}})[_0xa738('0x2c')](function(_0x347186){if(_0x347186){_0x4cb392=_0x347186[_0xa738('0x49')];if(!_0x5d053a[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x1adf5e[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x5d053a[_0xa738('0x43')]['limit']);_0x1adf5e[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x5d053a[_0xa738('0x43')]['offset']);}return _0x3e5811[_0xa738('0x6f')](_0x1adf5e);}})[_0xa738('0x2c')](function(_0x1c1631){if(_0x1c1631){return _0x1c1631?{'count':_0x4cb392,'rows':_0x1c1631}:null;}})[_0xa738('0x2c')](respondWithResult(_0x37960e,null))['catch'](handleError(_0x37960e,null));};exports[_0xa738('0x70')]=function(_0x17bfec,_0x3992de,_0x172a38){var _0x281477=_0x17bfec[_0xa738('0x59')][_0xa738('0x71')];var _0x5a2c4f=_[_0xa738('0x34')](_0x281477,'id');return db[_0xa738('0x72')][_0xa738('0x53')]({'where':{'id':_0x5a2c4f},'attributes':['id'],'include':[{'model':db[_0xa738('0x73')],'as':_0xa738('0x74'),'attributes':['id',_0xa738('0x39'),_0xa738('0x75'),_0xa738('0x76'),_0xa738('0x77')],'raw':!![]}]})['then'](function(_0x7cc2f5){if(_0x7cc2f5){var _0x58bb4c=_['flatMap'](_0x7cc2f5,function(_0x38228a){var _0x8b638=_0x38228a[_0xa738('0x2e')]({'plain':!![]});_0x8b638['Agents'][_0xa738('0x78')](function(_0x2063ce){_0x2063ce[_0xa738('0x79')]=_[_0xa738('0x37')](_0x281477,{'id':_0x8b638['id']})[_0xa738('0x79')];});return _0x8b638['Agents'];});return db['VoiceQueue'][_0xa738('0x37')]({'where':{'id':_0x17bfec[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](function(_0x134fe8){return db['sequelize'][_0xa738('0x7a')](function(_0x2c4cdb){return _0x134fe8[_0xa738('0x70')](_0x5a2c4f,{'transaction':_0x2c4cdb})[_0xa738('0x2c')](function(){return BPromise[_0xa738('0x7b')](_0x281477,function(_0x4f39e1){return db['TeamVoiceQueue'][_0xa738('0x7c')]({'TeamId':_0x4f39e1['id'],'VoiceQueueId':_0x17bfec[_0xa738('0x56')]['id'],'penalty':_0x4f39e1[_0xa738('0x79')]},{'transaction':_0x2c4cdb});});})[_0xa738('0x2c')](function(){return BPromise[_0xa738('0x7b')](_0x58bb4c,function(_0x984f47){return db[_0xa738('0x7d')]['findOrCreate']({'where':{'UserId':_0x984f47['id'],'VoiceQueueId':_0x17bfec[_0xa738('0x56')]['id']},'defaults':{'penalty':_0x984f47[_0xa738('0x79')]},'transaction':_0x2c4cdb});});})[_0xa738('0x2c')](function(){return BPromise[_0xa738('0x7b')](_[_0xa738('0x32')](_0x58bb4c,{'online':!![]}),function(_0x4e1fcb){return db[_0xa738('0x7e')][_0xa738('0x7c')]({'membername':_0x4e1fcb[_0xa738('0x39')],'UserId':_0x4e1fcb['id'],'queue_name':_0x134fe8[_0xa738('0x39')],'VoiceQueueId':_0x134fe8['id'],'interface':_[_0xa738('0x7f')](_0x4e1fcb[_0xa738('0x77')])?util[_0xa738('0x80')](_0xa738('0x81'),_0x4e1fcb[_0xa738('0x39')]):_0x4e1fcb[_0xa738('0x77')],'paused':_0x4e1fcb[_0xa738('0x76')]||![],'penalty':_0x4e1fcb[_0xa738('0x79')]},{'transaction':_0x2c4cdb});});})['then'](function(){_0x58bb4c['forEach'](function(_0x57e2c3){socket[_0xa738('0x82')](_0xa738('0x83'),{'UserId':_0x57e2c3['id'],'VoiceQueueId':_0x134fe8['id']});});});});});}})['then'](respondWithStatusCode(_0x3992de,null))[_0xa738('0x54')](handleError(_0x3992de,null));};exports['removeTeams']=function(_0x3a2d73,_0xbd20a1,_0x472f81){return db['Team'][_0xa738('0x53')]({'where':{'id':_0x3a2d73[_0xa738('0x43')][_0xa738('0x84')]},'attributes':['id'],'include':[{'model':db[_0xa738('0x73')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa738('0x2c')](handleEntityNotFound(_0xbd20a1,null))[_0xa738('0x2c')](function(_0x16501b){var _0x4de95a=_[_0xa738('0x34')](_0x16501b,'id');var _0x468d30=[];var _0x4daced=[];var _0xa7d461=squel['select']();_0xa7d461[_0xa738('0x85')]('tq.TeamId')[_0xa738('0x86')](_0xa738('0x87'),'tq')[_0xa738('0x88')](_0xa738('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa738('0x4e')](_0xa738('0x8a'),_0x3a2d73[_0xa738('0x56')]['id']);for(var _0x2bd3b0=0x0;_0x2bd3b0<_0x16501b[_0xa738('0x49')];_0x2bd3b0+=0x1){let _0x4f8e51=_0x16501b[_0x2bd3b0];for(var _0x194ecd=0x0;_0x194ecd<_0x4f8e51[_0xa738('0x74')][_0xa738('0x49')];_0x194ecd+=0x1){let _0x2b3435=_0x4f8e51[_0xa738('0x74')][_0x194ecd];var _0x3e6b1d=_0xa7d461[_0xa738('0x8b')]();_0x3e6b1d[_0xa738('0x4e')]('ut.UserId\x20=\x20?',_0x2b3435['id']);_0x4daced[_0xa738('0x8c')](db[_0xa738('0x8d')]['query'](_0x3e6b1d[_0xa738('0x8e')](),{'type':db[_0xa738('0x8d')][_0xa738('0x8f')][_0xa738('0x90')]})[_0xa738('0x2c')](function(_0x100e18){if(_0x100e18['length']===0x1){return _0x2b3435['id'];}else{var _0x5b76e7=_[_0xa738('0x91')](_[_0xa738('0x34')](_0x100e18,_0xa738('0x92')),function(_0x1ceac9){return _[_0xa738('0x36')](_0x4de95a,_0x1ceac9);});if(_0x5b76e7){return _0x2b3435['id'];}}}));}}return BPromise[_0xa738('0x93')](_0x4daced)[_0xa738('0x2c')](function(_0x14aedc){_0x468d30=_(_0x468d30)['union'](_0x14aedc)[_0xa738('0x94')]()[_0xa738('0x35')]();return db['VoiceQueue'][_0xa738('0x37')]({'where':{'id':_0x3a2d73[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](function(_0x1ea16b){return db['sequelize'][_0xa738('0x7a')](function(_0x59bf83){return _0x1ea16b[_0xa738('0x95')](_0x3a2d73[_0xa738('0x43')][_0xa738('0x84')],{'transaction':_0x59bf83})[_0xa738('0x2c')](function(){if(!_[_0xa738('0x96')](_0x468d30)){return _0x1ea16b[_0xa738('0x97')](_0x468d30,{'transaction':_0x59bf83})[_0xa738('0x2c')](function(){return db['UserVoiceQueueRt'][_0xa738('0x2d')]({'where':{'VoiceQueueId':_0x3a2d73[_0xa738('0x56')]['id'],'UserId':_0x468d30},'transaction':_0x59bf83});});}})[_0xa738('0x2c')](function(){_0x468d30[_0xa738('0x78')](function(_0x71d9d){socket['emit'](_0xa738('0x98'),{'UserId':_0x71d9d,'VoiceQueueId':_0x1ea16b['id']});});});});});});})[_0xa738('0x2c')](respondWithStatusCode(_0xbd20a1,null))[_0xa738('0x54')](handleError(_0xbd20a1,null));};exports[_0xa738('0x99')]=function(_0xb43761,_0x446adb,_0x97e756){var _0x41e0a9,_0x8fbced;return db[_0xa738('0x3e')]['find']({'where':{'id':_0xb43761[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x446adb,null))[_0xa738('0x2c')](function(_0x1c0723){if(_0x1c0723){_0x8fbced=_0x1c0723;return _0x1c0723[_0xa738('0x99')](_0xb43761[_0xa738('0x59')][_0xa738('0x84')],_['omit'](_0xb43761[_0xa738('0x59')],[_0xa738('0x84'),'id'])||{})[_0xa738('0x9a')](function(_0x4fa6b4){for(var _0x30e905=0x0;_0x30e905<_0xb43761[_0xa738('0x59')]['ids']['length'];_0x30e905+=0x1){socket['emit'](_0xa738('0x83'),{'UserId':_0xb43761['body'][_0xa738('0x84')][_0x30e905],'VoiceQueueId':_0xb43761[_0xa738('0x56')]['id']});}return _0x4fa6b4;});}})[_0xa738('0x2c')](function(_0x4e4ecf){_0x41e0a9=_0x4e4ecf||[];if(_0x8fbced){return db[_0xa738('0x73')][_0xa738('0x53')]({'where':{'id':_0xb43761[_0xa738('0x59')][_0xa738('0x84')]},'attributes':['id',_0xa738('0x39'),'online',_0xa738('0x76'),_0xa738('0x77')],'raw':!![]});}})[_0xa738('0x2c')](function(_0x487b41){if(!_[_0xa738('0x96')](_0x487b41)){var _0x32dcbb=[];for(var _0x47db93=0x0;_0x47db93<_0x487b41[_0xa738('0x49')];_0x47db93++){if(_0x487b41[_0x47db93][_0xa738('0x75')]){_0x32dcbb['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x487b41[_0x47db93][_0xa738('0x39')],'UserId':_0x487b41[_0x47db93]['id'],'queue_name':_0x8fbced[_0xa738('0x39')],'VoiceQueueId':_0x8fbced['id'],'interface':_[_0xa738('0x7f')](_0x487b41[_0x47db93][_0xa738('0x77')])?util[_0xa738('0x80')](_0xa738('0x81'),_0x487b41[_0x47db93][_0xa738('0x39')]):_0x487b41[_0x47db93]['interface'],'paused':_0x487b41[_0x47db93][_0xa738('0x76')]||![],'penalty':_0xb43761['body'][_0xa738('0x79')]||0x0}));}}return BPromise['all'](_0x32dcbb);}})[_0xa738('0x2c')](function(){return _0x41e0a9;})[_0xa738('0x2c')](respondWithResult(_0x446adb,null))[_0xa738('0x54')](handleError(_0x446adb,null));};exports[_0xa738('0x97')]=function(_0x353106,_0x108262,_0x9b010b){return db[_0xa738('0x3e')]['find']({'where':{'id':_0x353106[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x108262,null))[_0xa738('0x2c')](function(_0x5b3574){if(_0x5b3574){return _0x5b3574[_0xa738('0x97')](_0x353106['query'][_0xa738('0x84')])[_0xa738('0x2c')](function(){if(_[_0xa738('0x9b')](_0x353106[_0xa738('0x43')]['ids'])){for(var _0x26ba8e=0x0;_0x26ba8e<_0x353106['query'][_0xa738('0x84')][_0xa738('0x49')];_0x26ba8e+=0x1){socket[_0xa738('0x82')]('userVoiceQueue:remove',{'UserId':Number(_0x353106[_0xa738('0x43')][_0xa738('0x84')][_0x26ba8e]),'VoiceQueueId':Number(_0x353106['params']['id'])});}}else{socket[_0xa738('0x82')](_0xa738('0x98'),{'UserId':Number(_0x353106[_0xa738('0x43')][_0xa738('0x84')]),'VoiceQueueId':Number(_0x353106[_0xa738('0x56')]['id'])});}});}})[_0xa738('0x2c')](function(_0xd018f9){return db[_0xa738('0x7e')][_0xa738('0x2d')]({'where':{'VoiceQueueId':_0x353106[_0xa738('0x56')]['id'],'UserId':_0x353106[_0xa738('0x43')][_0xa738('0x84')]}})['then'](function(){return _0xd018f9;});})['then'](respondWithStatusCode(_0x108262,null))[_0xa738('0x54')](handleError(_0x108262,null));};exports[_0xa738('0x9c')]=function(_0x57b16e,_0x802a9f,_0x164ce7){var _0x5c00f8={};var _0x86b4ab={};var _0x47fa65;var _0xbe6540;return db['VoiceQueue'][_0xa738('0x65')]({'where':{'id':_0x57b16e[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x802a9f,null))[_0xa738('0x2c')](function(_0x2884d6){if(_0x2884d6){_0x47fa65=_0x2884d6;_0x86b4ab['model']=_[_0xa738('0x44')](db[_0xa738('0x73')][_0xa738('0x3f')]);_0x86b4ab[_0xa738('0x43')]=_['keys'](_0x57b16e[_0xa738('0x43')]);_0x86b4ab[_0xa738('0x45')]=_[_0xa738('0x46')](_0x86b4ab[_0xa738('0x42')],_0x86b4ab['query']);_0x5c00f8[_0xa738('0x47')]=_[_0xa738('0x46')](_0x86b4ab[_0xa738('0x42')],qs['fields'](_0x57b16e[_0xa738('0x43')][_0xa738('0x48')]));_0x5c00f8['attributes']=_0x5c00f8[_0xa738('0x47')][_0xa738('0x49')]?_0x5c00f8[_0xa738('0x47')]:_0x86b4ab[_0xa738('0x42')];_0x5c00f8['order']=qs[_0xa738('0x4c')](_0x57b16e[_0xa738('0x43')][_0xa738('0x4c')]);_0x5c00f8['where']=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x57b16e[_0xa738('0x43')],_0x86b4ab[_0xa738('0x45')]));if(_0x57b16e[_0xa738('0x43')]['filter']){_0x5c00f8[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x5c00f8['where'],{'$or':_[_0xa738('0x34')](_0x5c00f8[_0xa738('0x47')],function(_0x44fc88){var _0x366bd0={};_0x366bd0[_0x44fc88]={'$like':'%'+_0x57b16e[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x366bd0;})});}_0x5c00f8=_[_0xa738('0x4f')]({},_0x5c00f8,_0x57b16e['options']);return _0x47fa65[_0xa738('0x9c')](_0x5c00f8);}})[_0xa738('0x2c')](function(_0x3068ec){if(_0x3068ec){_0xbe6540=_0x3068ec[_0xa738('0x49')];if(!_0x57b16e[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x5c00f8[_0xa738('0x24')]=qs['limit'](_0x57b16e[_0xa738('0x43')][_0xa738('0x24')]);_0x5c00f8[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x57b16e[_0xa738('0x43')][_0xa738('0x25')]);}return _0x47fa65[_0xa738('0x9c')](_0x5c00f8);}})['then'](function(_0x530660){if(_0x530660){return _0x530660?{'count':_0xbe6540,'rows':_0x530660}:null;}})[_0xa738('0x2c')](respondWithResult(_0x802a9f,null))['catch'](handleError(_0x802a9f,null));};exports[_0xa738('0x9d')]=function(_0x1460a3,_0x5bb48f,_0x3c746c){var _0x33e191={};var _0x3120dc={};var _0x20ae19;var _0x19d7d4;return db['VoiceQueue'][_0xa738('0x65')]({'where':{'id':_0x1460a3[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x5bb48f,null))[_0xa738('0x2c')](function(_0x5e0c17){if(_0x5e0c17){_0x20ae19=_0x5e0c17;_0x3120dc[_0xa738('0x42')]=_['keys'](db[_0xa738('0x7e')][_0xa738('0x3f')]);_0x3120dc[_0xa738('0x43')]=_[_0xa738('0x44')](_0x1460a3[_0xa738('0x43')]);_0x3120dc[_0xa738('0x45')]=_[_0xa738('0x46')](_0x3120dc['model'],_0x3120dc[_0xa738('0x43')]);_0x33e191[_0xa738('0x47')]=_[_0xa738('0x46')](_0x3120dc['model'],qs['fields'](_0x1460a3[_0xa738('0x43')]['fields']));_0x33e191['attributes']=_0x33e191[_0xa738('0x47')][_0xa738('0x49')]?_0x33e191[_0xa738('0x47')]:_0x3120dc[_0xa738('0x42')];_0x33e191[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x1460a3['query'][_0xa738('0x4c')]);_0x33e191[_0xa738('0x4e')]=qs[_0xa738('0x45')](_['pick'](_0x1460a3[_0xa738('0x43')],_0x3120dc['filters']));if(_0x1460a3[_0xa738('0x43')]['filter']){_0x33e191[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x33e191['where'],{'$or':_['map'](_0x33e191['attributes'],function(_0x21179f){var _0x4c5e4b={};_0x4c5e4b[_0x21179f]={'$like':'%'+_0x1460a3[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x4c5e4b;})});}_0x33e191=_[_0xa738('0x4f')]({},_0x33e191,_0x1460a3[_0xa738('0x57')]);return _0x20ae19['getMembers'](_0x33e191);}})[_0xa738('0x2c')](function(_0x2a3831){if(_0x2a3831){_0x19d7d4=_0x2a3831['length'];if(!_0x1460a3[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x33e191[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x1460a3['query'][_0xa738('0x24')]);_0x33e191['offset']=qs[_0xa738('0x25')](_0x1460a3[_0xa738('0x43')][_0xa738('0x25')]);}return _0x20ae19[_0xa738('0x9d')](_0x33e191);}})[_0xa738('0x2c')](function(_0x560d66){return _0x560d66?{'count':_0x19d7d4,'rows':_0x560d66}:null;})[_0xa738('0x2c')](respondWithResult(_0x5bb48f,null))[_0xa738('0x54')](handleError(_0x5bb48f,null));};exports[_0xa738('0x9e')]=function(_0x2cf343,_0x57961a,_0x3befb9){var _0x45b0c2={};var _0x3f978f={};var _0x35e93a;var _0x5bde6b;return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x2cf343[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x57961a,null))[_0xa738('0x2c')](function(_0x5e35c8){if(_0x5e35c8){_0x35e93a=_0x5e35c8;_0x3f978f['model']=_['keys'](db[_0xa738('0x9f')][_0xa738('0x3f')]);_0x3f978f[_0xa738('0x43')]=_[_0xa738('0x44')](_0x2cf343[_0xa738('0x43')]);_0x3f978f[_0xa738('0x45')]=_[_0xa738('0x46')](_0x3f978f[_0xa738('0x42')],_0x3f978f[_0xa738('0x43')]);_0x45b0c2[_0xa738('0x47')]=_['intersection'](_0x3f978f['model'],qs[_0xa738('0x48')](_0x2cf343[_0xa738('0x43')][_0xa738('0x48')]));_0x45b0c2[_0xa738('0x47')]=_0x45b0c2[_0xa738('0x47')][_0xa738('0x49')]?_0x45b0c2[_0xa738('0x47')]:_0x3f978f[_0xa738('0x42')];_0x45b0c2[_0xa738('0x4b')]=qs['sort'](_0x2cf343['query'][_0xa738('0x4c')]);_0x45b0c2[_0xa738('0x4e')]=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x2cf343[_0xa738('0x43')],_0x3f978f[_0xa738('0x45')]));if(_0x2cf343[_0xa738('0x43')][_0xa738('0x32')]){_0x45b0c2[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x45b0c2[_0xa738('0x4e')],{'$or':_['map'](_0x45b0c2[_0xa738('0x47')],function(_0x107858){var _0x1fb597={};_0x1fb597[_0x107858]={'$like':'%'+_0x2cf343['query'][_0xa738('0x32')]+'%'};return _0x1fb597;})});}_0x45b0c2=_['merge']({},_0x45b0c2,_0x2cf343[_0xa738('0x57')]);return _0x35e93a[_0xa738('0x9e')](_0x45b0c2);}})[_0xa738('0x2c')](function(_0x208c28){if(_0x208c28){_0x5bde6b=_0x208c28['length'];if(!_0x2cf343[_0xa738('0x43')]['hasOwnProperty']('nolimit')){_0x45b0c2[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x2cf343['query'][_0xa738('0x24')]);_0x45b0c2[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x2cf343[_0xa738('0x43')][_0xa738('0x25')]);}return _0x35e93a[_0xa738('0x9e')](_0x45b0c2);}})['then'](function(_0x371f5a){if(_0x371f5a){return _0x371f5a?{'count':_0x5bde6b,'rows':_0x371f5a}:null;}})[_0xa738('0x2c')](respondWithResult(_0x57961a,null))[_0xa738('0x54')](handleError(_0x57961a,null));};exports[_0xa738('0xa0')]=function(_0x36ce52,_0x4f124c,_0x33e667){var _0x20a285,_0x5b6548;return db['VoiceQueue']['find']({'where':{'id':_0x36ce52[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x4f124c,null))[_0xa738('0x2c')](function(_0x4d12d2){if(_0x4d12d2){_0x5b6548=_0x4d12d2;return _0x4d12d2[_0xa738('0xa0')](_0x36ce52['body'][_0xa738('0x84')],_['omit'](_0x36ce52[_0xa738('0x59')],['ids','id'])||{});}return null;})['spread'](function(_0x287a34){var _0x5a304f;_0x20a285=_0x287a34||[];var _0x3b4302=[];if(_0x287a34){for(var _0x52d4e7=0x0;_0x52d4e7<_0x287a34[_0xa738('0x49')];_0x52d4e7+=0x1){var _0x58f677=_0x287a34[_0x52d4e7][_0xa738('0x2e')]({'plain':!![]});_0x5b6548['dialCheckDuplicateType']=_0x36ce52[_0xa738('0x59')][_0xa738('0xa1')]?_0x36ce52[_0xa738('0x59')][_0xa738('0xa1')]:_0x5b6548['dialCheckDuplicateType'];switch(_0x5b6548[_0xa738('0xa1')]){case _0xa738('0xa2'):_0x5a304f=squel['insert']()[_0xa738('0xa3')]('cm_hopper')[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa6'),_0xa738('0xa7'),_0xa738('0xa8'),_0xa738('0x68'),'createdAt','updatedAt'],squel[_0xa738('0xa9')]()['field'](_0xa738('0xa5'),_0xa738('0xa5'))[_0xa738('0x85')](_0xa738('0xaa'),'scheduledAt')['field']('id',_0xa738('0xa7'))['field'](_0x58f677[_0xa738('0xab')][_0xa738('0x8e')](),'ListId')[_0xa738('0x85')](_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')](),_0xa738('0x68'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x60'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x61'))[_0xa738('0x86')](_0xa738('0xac'))[_0xa738('0x4e')](_0xa738('0xad'))[_0xa738('0x4e')](_0xa738('0xae'),_0x58f677[_0xa738('0xab')][_0xa738('0x8e')]())['where'](_0xa738('0xaf'))[_0xa738('0x4e')](_0xa738('0xb0'),squel[_0xa738('0xa9')]()[_0xa738('0x85')](_0xa738('0xb1'))[_0xa738('0x86')]('cm_hopper_final')[_0xa738('0x4e')]('VoiceQueueId\x20=\x20?',_0x36ce52[_0xa738('0x56')]['id']['toString']()))[_0xa738('0x4e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xa738('0xb2'))[_0xa738('0x86')]('cm_hopper')['where'](_0xa738('0x8a'),_0x36ce52[_0xa738('0x56')]['id']['toString']())))[_0xa738('0x8e')]();break;case'onlyIfOpen':_0x5a304f=squel[_0xa738('0xb3')]()[_0xa738('0xa3')](_0xa738('0xb4'))[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa6'),_0xa738('0xa7'),_0xa738('0xa8'),_0xa738('0x68'),_0xa738('0x60'),_0xa738('0x61')],squel[_0xa738('0xa9')]()['field'](_0xa738('0xa5'),_0xa738('0xa5'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0xa6'))[_0xa738('0x85')]('id','ContactId')[_0xa738('0x85')](_0x58f677[_0xa738('0xab')]['toString'](),_0xa738('0xa8'))[_0xa738('0x85')](_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')](),_0xa738('0x68'))['field'](_0xa738('0xaa'),_0xa738('0x60'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x61'))['from'](_0xa738('0xac'))[_0xa738('0x4e')](_0xa738('0xad'))[_0xa738('0x4e')](_0xa738('0xae'),_0x58f677['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xa738('0xb0'),squel[_0xa738('0xa9')]()[_0xa738('0x85')](_0xa738('0xb2'))[_0xa738('0x86')]('cm_hopper')[_0xa738('0x4e')](_0xa738('0x8a'),_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')]())))[_0xa738('0x8e')]();break;default:_0x5a304f=squel[_0xa738('0xb3')]()[_0xa738('0xa3')](_0xa738('0xb4'))[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa6'),'ContactId','ListId','VoiceQueueId',_0xa738('0x60'),_0xa738('0x61')],squel['select']()['field'](_0xa738('0xa5'),_0xa738('0xa5'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0xa6'))['field']('id','ContactId')['field'](_0x58f677[_0xa738('0xab')][_0xa738('0x8e')](),'ListId')['field'](_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')](),'VoiceQueueId')['field'](_0xa738('0xaa'),_0xa738('0x60'))['field']('NOW()',_0xa738('0x61'))[_0xa738('0x86')](_0xa738('0xac'))[_0xa738('0x4e')](_0xa738('0xad'))[_0xa738('0x4e')]('ListId\x20=\x20?',_0x58f677[_0xa738('0xab')]['toString']())[_0xa738('0x4e')](_0xa738('0xaf')))[_0xa738('0x8e')]();}_0x3b4302[_0xa738('0x8c')](db[_0xa738('0x8d')][_0xa738('0x43')](_0x5a304f));}return BPromise[_0xa738('0x93')](_0x3b4302);}})['then'](function(){return _0x20a285;})[_0xa738('0x2c')](respondWithResult(_0x4f124c,null))[_0xa738('0x54')](handleError(_0x4f124c,null));};exports[_0xa738('0xb5')]=function(_0xf8cc1b,_0x2ccd0f,_0x32795d){return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0xf8cc1b[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x2ccd0f,null))[_0xa738('0x2c')](function(_0x44c113){if(_0x44c113){return _0x44c113[_0xa738('0xb5')](_0xf8cc1b[_0xa738('0x43')][_0xa738('0x84')]);}})['then'](function(_0x1fb95c){if(_0x1fb95c){return db[_0xa738('0x66')][_0xa738('0x2d')]({'where':{'ListId':_0xf8cc1b['query'][_0xa738('0x84')],'VoiceQueueId':_0xf8cc1b[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](function(){return _0x1fb95c;});}})[_0xa738('0x2c')](respondWithStatusCode(_0x2ccd0f,null))[_0xa738('0x54')](handleError(_0x2ccd0f,null));};exports[_0xa738('0xb6')]=function(_0x4422f0,_0x42192d,_0xcc1791){var _0x57dada={};var _0x518b0b={};var _0x3e5065;var _0x1392f8;return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x4422f0[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x42192d,null))['then'](function(_0x2ba76d){if(_0x2ba76d){_0x3e5065=_0x2ba76d;_0x518b0b[_0xa738('0x42')]=_['keys'](db[_0xa738('0x9f')]['rawAttributes']);_0x518b0b['query']=_['keys'](_0x4422f0[_0xa738('0x43')]);_0x518b0b[_0xa738('0x45')]=_[_0xa738('0x46')](_0x518b0b[_0xa738('0x42')],_0x518b0b[_0xa738('0x43')]);_0x57dada[_0xa738('0x47')]=_['intersection'](_0x518b0b[_0xa738('0x42')],qs[_0xa738('0x48')](_0x4422f0['query'][_0xa738('0x48')]));_0x57dada[_0xa738('0x47')]=_0x57dada['attributes'][_0xa738('0x49')]?_0x57dada[_0xa738('0x47')]:_0x518b0b[_0xa738('0x42')];_0x57dada['order']=qs['sort'](_0x4422f0['query'][_0xa738('0x4c')]);_0x57dada[_0xa738('0x4e')]=qs['filters'](_['pick'](_0x4422f0['query'],_0x518b0b[_0xa738('0x45')]));if(_0x4422f0['query'][_0xa738('0x32')]){_0x57dada[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x57dada[_0xa738('0x4e')],{'$or':_['map'](_0x57dada['attributes'],function(_0x3ef8cc){var _0x30361d={};_0x30361d[_0x3ef8cc]={'$like':'%'+_0x4422f0['query'][_0xa738('0x32')]+'%'};return _0x30361d;})});}_0x57dada=_[_0xa738('0x4f')]({},_0x57dada,_0x4422f0[_0xa738('0x57')]);return _0x3e5065['getBlackLists'](_0x57dada);}})[_0xa738('0x2c')](function(_0x3ab29f){if(_0x3ab29f){_0x1392f8=_0x3ab29f[_0xa738('0x49')];if(!_0x4422f0[_0xa738('0x43')]['hasOwnProperty'](_0xa738('0x67'))){_0x57dada[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x4422f0[_0xa738('0x43')]['limit']);_0x57dada['offset']=qs['offset'](_0x4422f0[_0xa738('0x43')][_0xa738('0x25')]);}return _0x3e5065[_0xa738('0xb6')](_0x57dada);}})[_0xa738('0x2c')](function(_0x10b72c){if(_0x10b72c){return _0x10b72c?{'count':_0x1392f8,'rows':_0x10b72c}:null;}})['then'](respondWithResult(_0x42192d,null))[_0xa738('0x54')](handleError(_0x42192d,null));};exports['addBlackLists']=function(_0x2b6988,_0xc3edda,_0x36269d){var _0x5b5f09,_0x1adc1c;return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x2b6988['params']['id']}})['then'](handleEntityNotFound(_0xc3edda,null))['then'](function(_0x583595){if(_0x583595){_0x1adc1c=_0x583595;return _0x583595[_0xa738('0xb7')](_0x2b6988[_0xa738('0x59')][_0xa738('0x84')],_[_0xa738('0x5f')](_0x2b6988[_0xa738('0x59')],[_0xa738('0x84'),'id'])||{});}return null;})[_0xa738('0x9a')](function(_0x5bc63b){var _0x47fb27;_0x5b5f09=_0x5bc63b||[];var _0x2c94d9=[];if(_0x5bc63b){for(var _0x191fc3=0x0;_0x191fc3<_0x5bc63b[_0xa738('0x49')];_0x191fc3+=0x1){var _0x55c087=_0x5bc63b[_0x191fc3][_0xa738('0x2e')]({'plain':!![]});_0x47fb27=squel[_0xa738('0xb3')]()[_0xa738('0xa3')](_0xa738('0xb8'))[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa7'),_0xa738('0xa8'),_0xa738('0x68'),_0xa738('0x60'),_0xa738('0x61')],squel[_0xa738('0xa9')]()[_0xa738('0x85')]('phone',_0xa738('0xa5'))[_0xa738('0x85')]('id','ContactId')[_0xa738('0x85')](_0x55c087[_0xa738('0xab')]['toString'](),_0xa738('0xa8'))[_0xa738('0x85')](_0x2b6988[_0xa738('0x56')]['id'][_0xa738('0x8e')](),_0xa738('0x68'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x60'))[_0xa738('0x85')](_0xa738('0xaa'),'updatedAt')[_0xa738('0x86')](_0xa738('0xac'))[_0xa738('0x4e')]('deletedAt\x20IS\x20NULL')[_0xa738('0x4e')](_0xa738('0xae'),_0x55c087['CmListId'][_0xa738('0x8e')]())['where'](_0xa738('0xaf')))['toString']();_0x2c94d9[_0xa738('0x8c')](db[_0xa738('0x8d')][_0xa738('0x43')](_0x47fb27));}return BPromise['all'](_0x2c94d9);}})[_0xa738('0x2c')](function(){return _0x5b5f09;})[_0xa738('0x2c')](respondWithResult(_0xc3edda,null))[_0xa738('0x54')](handleError(_0xc3edda,null));};exports['removeBlackLists']=function(_0x4def13,_0x581754,_0x294a3e){return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x4def13[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x581754,null))[_0xa738('0x2c')](function(_0x1b3abb){if(_0x1b3abb){return _0x1b3abb['removeBlackLists'](_0x4def13[_0xa738('0x43')][_0xa738('0x84')]);}})[_0xa738('0x2c')](function(_0x315951){if(_0x315951){return db['CmHopperBlack'][_0xa738('0x2d')]({'where':{'ListId':_0x4def13['query'][_0xa738('0x84')],'VoiceQueueId':_0x4def13[_0xa738('0x56')]['id']}})['then'](function(){return _0x315951;});}})[_0xa738('0x2c')](respondWithStatusCode(_0x581754,null))[_0xa738('0x54')](handleError(_0x581754,null));}; \ No newline at end of file +var _0x593d=['findOrCreate','UserVoiceQueueRt','isNil','format','emit','userVoiceQueue:save','removeTeams','ids','User','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','isEmpty','addAgents','spread','push','SIP/%s','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','type','name','destroy','sendStatus','stack','index','VoiceQueue','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','include','rows','catch','params','keys','filters','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','error','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','Team','addTeams','teams','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue'];(function(_0x92a3d9,_0xcf3970){var _0x56458b=function(_0x36a48c){while(--_0x36a48c){_0x92a3d9['push'](_0x92a3d9['shift']());}};_0x56458b(++_0xcf3970);}(_0x593d,0xfd));var _0xd593=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x593d[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xd593('0x0'));var rimraf=require(_0xd593('0x1'));var zipdir=require(_0xd593('0x2'));var jsonpatch=require(_0xd593('0x3'));var rp=require('request-promise');var moment=require(_0xd593('0x4'));var BPromise=require(_0xd593('0x5'));var Mustache=require(_0xd593('0x6'));var util=require(_0xd593('0x7'));var path=require(_0xd593('0x8'));var sox=require(_0xd593('0x9'));var csv=require(_0xd593('0xa'));var ejs=require(_0xd593('0xb'));var fs=require('fs');var fs_extra=require(_0xd593('0xc'));var _=require(_0xd593('0xd'));var squel=require(_0xd593('0xe'));var crypto=require(_0xd593('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd593('0x10'));var toCsv=require(_0xd593('0xa'));var querystring=require(_0xd593('0x11'));var Papa=require(_0xd593('0x12'));var Redis=require('ioredis');var authService=require(_0xd593('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd593('0x14'));var hardwareService=require(_0xd593('0x15'));var logger=require('../../config/logger')(_0xd593('0x16'));var utils=require('../../config/utils');var config=require(_0xd593('0x17'));var licenseUtil=require(_0xd593('0x18'));var db=require(_0xd593('0x19'))['db'];config[_0xd593('0x1a')]=_[_0xd593('0x1b')](config[_0xd593('0x1a')],{'host':_0xd593('0x1c'),'port':0x18eb});var socket=require(_0xd593('0x1d'))(new Redis(config[_0xd593('0x1a')]));require(_0xd593('0x1e'))[_0xd593('0x1f')](socket);function respondWithStatusCode(_0x776095,_0x11748b){_0x11748b=_0x11748b||0xcc;return function(_0x11c92d){if(_0x11c92d){return _0x776095['sendStatus'](_0x11748b);}return _0x776095[_0xd593('0x20')](_0x11748b)[_0xd593('0x21')]();};}function respondWithResult(_0x508685,_0x673263){_0x673263=_0x673263||0xc8;return function(_0x365adf){if(_0x365adf){return _0x508685[_0xd593('0x20')](_0x673263)[_0xd593('0x22')](_0x365adf);}};}function respondWithFilteredResult(_0x41483d,_0x4a1383){return function(_0x51ab96){if(_0x51ab96){var _0x559558=typeof _0x4a1383['offset']===_0xd593('0x23')&&typeof _0x4a1383['limit']==='undefined';var _0x4251fa=_0x51ab96[_0xd593('0x24')];var _0x21a32b=_0x559558?0x0:_0x4a1383[_0xd593('0x25')];var _0x4bc61f=_0x559558?_0x51ab96[_0xd593('0x24')]:_0x4a1383[_0xd593('0x25')]+_0x4a1383[_0xd593('0x26')];var _0x181a6f;if(_0x4bc61f>=_0x4251fa){_0x4bc61f=_0x4251fa;_0x181a6f=0xc8;}else{_0x181a6f=0xce;}_0x41483d[_0xd593('0x20')](_0x181a6f);return _0x41483d[_0xd593('0x27')](_0xd593('0x28'),_0x21a32b+'-'+_0x4bc61f+'/'+_0x4251fa)[_0xd593('0x22')](_0x51ab96);}return null;};}function patchUpdates(_0x55a2aa){return function(_0x2d3abd){try{jsonpatch['apply'](_0x2d3abd,_0x55a2aa,!![]);}catch(_0x426d85){return BPromise[_0xd593('0x29')](_0x426d85);}return _0x2d3abd[_0xd593('0x2a')]();};}function saveUpdates(_0x362fe7,_0x3d3f8e){return function(_0x543de5){if(_0x543de5){return _0x543de5[_0xd593('0x2b')](_0x362fe7)['then'](function(_0x481bae){return _0x481bae;});}return null;};}function removeEntity(_0x296efd,_0xb46ced){return function(_0x4801bf){if(_0x4801bf){return _0x4801bf['destroy']()[_0xd593('0x2c')](function(){var _0x56ff4a=_0x4801bf[_0xd593('0x2d')]({'plain':!![]});var _0x54c415=[{'name':_0xd593('0x2e'),'value':_0xd593('0x2f'),'ignore':![]},{'name':_0xd593('0x30'),'value':_0xd593('0x31'),'ignore':![]}];var _0x574f89=_(_0x54c415)[_0xd593('0x32')](_0xd593('0x33'))[_0xd593('0x34')](_0xd593('0x35'))['value']();if(_[_0xd593('0x36')](_0x574f89,_0x56ff4a['type'])){return;}var _0x1b65e3=_[_0xd593('0x37')](_0x54c415,[_0xd593('0x35'),_0x56ff4a[_0xd593('0x38')]])[_0xd593('0x39')];return db['UserProfileResource'][_0xd593('0x3a')]({'where':{'type':_0x1b65e3,'resourceId':_0x56ff4a['id']}})[_0xd593('0x2c')](function(){return _0x4801bf;});})[_0xd593('0x2c')](function(){_0x296efd['status'](0xcc)[_0xd593('0x21')]();});}};}function handleEntityNotFound(_0x3ce95a,_0x3b7fcd){return function(_0x15cd46){if(!_0x15cd46){_0x3ce95a[_0xd593('0x3b')](0x194);}return _0x15cd46;};}function handleError(_0x1b1861,_0x255673){_0x255673=_0x255673||0x1f4;return function(_0x5513d0){logger['error'](_0x5513d0[_0xd593('0x3c')]);if(_0x5513d0[_0xd593('0x39')]){delete _0x5513d0[_0xd593('0x39')];}_0x1b1861[_0xd593('0x20')](_0x255673)['send'](_0x5513d0);};}exports[_0xd593('0x3d')]=function(_0x49da9d,_0x2f3079){var _0xfe3d26={},_0x3ef3f0={},_0x324502={'count':0x0,'rows':[]};var _0x59b01c=_[_0xd593('0x34')](db[_0xd593('0x3e')][_0xd593('0x3f')],function(_0x545498){return{'name':_0x545498[_0xd593('0x40')],'type':_0x545498[_0xd593('0x38')][_0xd593('0x41')]};});_0x3ef3f0[_0xd593('0x42')]=_[_0xd593('0x34')](_0x59b01c,'name');_0x3ef3f0[_0xd593('0x43')]=_['keys'](_0x49da9d['query']);_0x3ef3f0['filters']=_['intersection'](_0x3ef3f0[_0xd593('0x42')],_0x3ef3f0['query']);_0xfe3d26[_0xd593('0x44')]=_[_0xd593('0x45')](_0x3ef3f0['model'],qs[_0xd593('0x46')](_0x49da9d[_0xd593('0x43')]['fields']));_0xfe3d26[_0xd593('0x44')]=_0xfe3d26[_0xd593('0x44')][_0xd593('0x47')]?_0xfe3d26[_0xd593('0x44')]:_0x3ef3f0['model'];if(!_0x49da9d[_0xd593('0x43')][_0xd593('0x48')](_0xd593('0x49'))){_0xfe3d26[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x49da9d[_0xd593('0x43')]['limit']);_0xfe3d26[_0xd593('0x25')]=qs[_0xd593('0x25')](_0x49da9d[_0xd593('0x43')][_0xd593('0x25')]);}_0xfe3d26[_0xd593('0x4a')]=qs['sort'](_0x49da9d[_0xd593('0x43')][_0xd593('0x4b')]);_0xfe3d26['where']=qs['filters'](_[_0xd593('0x4c')](_0x49da9d[_0xd593('0x43')],_0x3ef3f0['filters']),_0x59b01c);if(_0x49da9d['query'][_0xd593('0x32')]){_0xfe3d26['where']=_[_0xd593('0x4d')](_0xfe3d26[_0xd593('0x4e')],{'$or':_[_0xd593('0x34')](_0x59b01c,function(_0x3c5b8a){if(_0x3c5b8a[_0xd593('0x38')]!==_0xd593('0x4f')){var _0x1bccae={};_0x1bccae[_0x3c5b8a[_0xd593('0x39')]]={'$like':'%'+_0x49da9d[_0xd593('0x43')][_0xd593('0x32')]+'%'};return _0x1bccae;}})});}_0xfe3d26=_['merge']({},_0xfe3d26,_0x49da9d[_0xd593('0x50')]);var _0x5ae088={'where':_0xfe3d26[_0xd593('0x4e')]};return db['VoiceQueue'][_0xd593('0x24')](_0x5ae088)[_0xd593('0x2c')](function(_0x3bfaf9){_0x324502[_0xd593('0x24')]=_0x3bfaf9;if(_0x49da9d[_0xd593('0x43')][_0xd593('0x51')]){_0xfe3d26[_0xd593('0x52')]=[{'all':!![]}];}return db[_0xd593('0x3e')]['findAll'](_0xfe3d26);})[_0xd593('0x2c')](function(_0x485bd0){_0x324502[_0xd593('0x53')]=_0x485bd0;return _0x324502;})[_0xd593('0x2c')](respondWithFilteredResult(_0x2f3079,_0xfe3d26))[_0xd593('0x54')](handleError(_0x2f3079,null));};exports['show']=function(_0x38b061,_0x474b09){var _0x6218b0={'raw':![],'where':{'id':_0x38b061[_0xd593('0x55')]['id']}},_0x59d5ac={};_0x59d5ac['model']=_[_0xd593('0x56')](db[_0xd593('0x3e')][_0xd593('0x3f')]);_0x59d5ac['query']=_[_0xd593('0x56')](_0x38b061['query']);_0x59d5ac[_0xd593('0x57')]=_[_0xd593('0x45')](_0x59d5ac[_0xd593('0x42')],_0x59d5ac[_0xd593('0x43')]);_0x6218b0[_0xd593('0x44')]=_[_0xd593('0x45')](_0x59d5ac[_0xd593('0x42')],qs[_0xd593('0x46')](_0x38b061[_0xd593('0x43')][_0xd593('0x46')]));_0x6218b0[_0xd593('0x44')]=_0x6218b0[_0xd593('0x44')][_0xd593('0x47')]?_0x6218b0[_0xd593('0x44')]:_0x59d5ac[_0xd593('0x42')];if(_0x38b061['query'][_0xd593('0x51')]){_0x6218b0['include']=[{'all':!![]}];}_0x6218b0=_[_0xd593('0x4d')]({},_0x6218b0,_0x38b061['options']);return db['VoiceQueue'][_0xd593('0x37')](_0x6218b0)[_0xd593('0x2c')](handleEntityNotFound(_0x474b09,null))[_0xd593('0x2c')](respondWithResult(_0x474b09,null))[_0xd593('0x54')](handleError(_0x474b09,null));};exports['create']=function(_0x1d432d,_0x207f14){return db[_0xd593('0x3e')][_0xd593('0x58')](_0x1d432d[_0xd593('0x59')],{})[_0xd593('0x2c')](function(_0xea6626){var _0x18ce5f=_0x1d432d[_0xd593('0x5a')][_0xd593('0x2d')]({'plain':!![]});if(!_0x18ce5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18ce5f[_0xd593('0x5b')]===_0xd593('0x5a')){var _0x44a7cb=_0xea6626[_0xd593('0x2d')]({'plain':!![]});var _0x449019=[{'name':_0xd593('0x2e'),'value':_0xd593('0x2f')},{'name':_0xd593('0x30'),'value':_0xd593('0x31')}];var _0x2c44eb=_[_0xd593('0x37')](_0x449019,[_0xd593('0x35'),_0x44a7cb['type']])[_0xd593('0x39')];return db[_0xd593('0x5c')]['find']({'where':{'name':_0x2c44eb,'userProfileId':_0x18ce5f['userProfileId']},'raw':!![]})[_0xd593('0x2c')](function(_0x2328c8){if(_0x2328c8&&_0x2328c8[_0xd593('0x5d')]===0x0){return db[_0xd593('0x5e')]['create']({'name':_0x44a7cb[_0xd593('0x39')],'resourceId':_0x44a7cb['id'],'type':_0x2328c8[_0xd593('0x39')],'sectionId':_0x2328c8['id']},{})[_0xd593('0x2c')](function(){return _0xea6626;});}else{return _0xea6626;}})['catch'](function(_0x460648){logger[_0xd593('0x5f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x460648);throw _0x460648;});}return _0xea6626;})[_0xd593('0x2c')](respondWithResult(_0x207f14,0xc9))[_0xd593('0x54')](handleError(_0x207f14,null));};exports[_0xd593('0x60')]=function(_0x4763ac,_0x4a90ee){var _0x46803e={'where':{'id':_0x4763ac[_0xd593('0x55')]['id']}},_0x26cf0a={};_0x26cf0a[_0xd593('0x42')]=_[_0xd593('0x56')](db[_0xd593('0x3e')][_0xd593('0x3f')]);_0x46803e[_0xd593('0x44')]=_[_0xd593('0x45')](_0x26cf0a[_0xd593('0x42')],qs[_0xd593('0x46')](_0x4763ac[_0xd593('0x43')]['fields']));_0x46803e[_0xd593('0x44')]=_0x46803e[_0xd593('0x44')][_0xd593('0x47')]?_0x46803e[_0xd593('0x44')]:_0x26cf0a[_0xd593('0x42')];if(_0x4763ac['query'][_0xd593('0x51')]){_0x46803e[_0xd593('0x52')]=[{'all':!![]}];}_0x46803e=_['merge']({},_0x46803e,_0x4763ac['options']);return db[_0xd593('0x3e')][_0xd593('0x37')](_0x46803e)[_0xd593('0x2c')](handleEntityNotFound(_0x4a90ee,null))['then'](function(_0x5b1d84){if(_0x5b1d84){var _0xf57b17=_0x5b1d84[_0xd593('0x2d')]({'plain':!![]});_0xf57b17=qs[_0xd593('0x61')](_0xf57b17,['id',_0xd593('0x62'),_0xd593('0x63')]);_0x4763ac[_0xd593('0x59')]=_['omit'](_0x4763ac[_0xd593('0x59')],['id',_0xd593('0x62'),_0xd593('0x63')]);return db[_0xd593('0x3e')]['create'](_[_0xd593('0x4d')](_0xf57b17,_0x4763ac[_0xd593('0x59')]),{'include':_0x4763ac['query'][_0xd593('0x51')]?[{'all':!![]}]:undefined})[_0xd593('0x2c')](function(_0x1a8187){var _0x239a56=_0x4763ac[_0xd593('0x5a')]['get']({'plain':!![]});if(!_0x239a56)throw new Error(_0xd593('0x64'));if(_0x239a56[_0xd593('0x5b')]===_0xd593('0x5a')){var _0x3876bd=_0x1a8187[_0xd593('0x2d')]({'plain':!![]});var _0x1228df=[{'name':_0xd593('0x2e'),'value':_0xd593('0x2f')},{'name':_0xd593('0x30'),'value':_0xd593('0x31')}];var _0xd73645=_[_0xd593('0x37')](_0x1228df,[_0xd593('0x35'),_0x3876bd[_0xd593('0x38')]])['name'];return db[_0xd593('0x5c')][_0xd593('0x37')]({'where':{'name':_0xd73645,'userProfileId':_0x239a56[_0xd593('0x65')]},'raw':!![]})[_0xd593('0x2c')](function(_0x4c7818){if(_0x4c7818&&_0x4c7818['autoAssociation']===0x0){return db[_0xd593('0x5e')][_0xd593('0x58')]({'name':_0x3876bd[_0xd593('0x39')],'resourceId':_0x3876bd['id'],'type':_0x4c7818[_0xd593('0x39')],'sectionId':_0x4c7818['id']},{})[_0xd593('0x2c')](function(){return _0x1a8187;});}else{return _0x1a8187;}})['catch'](function(_0x2177e8){logger[_0xd593('0x5f')](_0xd593('0x66'),_0x2177e8);throw _0x2177e8;});}return _0x1a8187;});}})[_0xd593('0x2c')](respondWithResult(_0x4a90ee,0xc9))[_0xd593('0x54')](handleError(_0x4a90ee,null));};exports[_0xd593('0x2b')]=function(_0x36c555,_0x1433b4){if(_0x36c555[_0xd593('0x59')]['id']){delete _0x36c555[_0xd593('0x59')]['id'];}return db[_0xd593('0x3e')][_0xd593('0x37')]({'where':{'id':_0x36c555['params']['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x1433b4,null))[_0xd593('0x2c')](saveUpdates(_0x36c555[_0xd593('0x59')],null))[_0xd593('0x2c')](respondWithResult(_0x1433b4,null))['catch'](handleError(_0x1433b4,null));};exports[_0xd593('0x3a')]=function(_0x1d2d19,_0x386c0c){return db['VoiceQueue'][_0xd593('0x37')]({'where':{'id':_0x1d2d19[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x386c0c,null))[_0xd593('0x2c')](removeEntity(_0x386c0c,null))[_0xd593('0x54')](handleError(_0x386c0c,null));};exports[_0xd593('0x67')]=function(_0x8b1325,_0x1f192b,_0x49dcc1){var _0xdfca2c={'raw':![],'where':{}};var _0x381dfc={};var _0x58fa2c={'count':0x0,'rows':[]};return db[_0xd593('0x3e')]['findOne']({'where':{'id':_0x8b1325['params']['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x1f192b,null))[_0xd593('0x2c')](function(_0x1a4064){if(_0x1a4064){_0x381dfc[_0xd593('0x42')]=_['keys'](db[_0xd593('0x68')]['rawAttributes']);_0x381dfc[_0xd593('0x43')]=_[_0xd593('0x56')](_0x8b1325[_0xd593('0x43')]);_0x381dfc[_0xd593('0x57')]=_['intersection'](_0x381dfc[_0xd593('0x42')],_0x381dfc[_0xd593('0x43')]);_0xdfca2c['attributes']=_[_0xd593('0x45')](_0x381dfc['model'],qs['fields'](_0x8b1325['query'][_0xd593('0x46')]));_0xdfca2c[_0xd593('0x44')]=_0xdfca2c[_0xd593('0x44')][_0xd593('0x47')]?_0xdfca2c[_0xd593('0x44')]:_0x381dfc[_0xd593('0x42')];if(!_0x8b1325[_0xd593('0x43')][_0xd593('0x48')](_0xd593('0x49'))){_0xdfca2c[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x8b1325[_0xd593('0x43')][_0xd593('0x26')]);_0xdfca2c[_0xd593('0x25')]=qs[_0xd593('0x25')](_0x8b1325[_0xd593('0x43')][_0xd593('0x25')]);}_0xdfca2c[_0xd593('0x4a')]=qs['sort'](_0x8b1325[_0xd593('0x43')][_0xd593('0x4b')]);_0xdfca2c[_0xd593('0x4e')]=qs['filters'](_['pick'](_0x8b1325[_0xd593('0x43')],_0x381dfc[_0xd593('0x57')]));_0xdfca2c[_0xd593('0x4e')][_0xd593('0x69')]=_0x1a4064['id'];if(_0x8b1325[_0xd593('0x43')]['filter']){_0xdfca2c[_0xd593('0x4e')]=_[_0xd593('0x4d')](_0xdfca2c['where'],{'$or':_[_0xd593('0x34')](_0xdfca2c['attributes'],function(_0x57628e){var _0x272923={};_0x272923[_0x57628e]={'$like':'%'+_0x8b1325['query']['filter']+'%'};return _0x272923;})});}_0xdfca2c=_[_0xd593('0x4d')]({},_0xdfca2c,_0x8b1325['options']);return db[_0xd593('0x68')][_0xd593('0x24')]({'where':_0xdfca2c['where']})[_0xd593('0x2c')](function(_0x50482d){_0x58fa2c[_0xd593('0x24')]=_0x50482d;if(_0x8b1325[_0xd593('0x43')][_0xd593('0x51')]){_0xdfca2c[_0xd593('0x52')]=[{'all':!![]}];}return db[_0xd593('0x68')][_0xd593('0x6a')](_0xdfca2c);})[_0xd593('0x2c')](function(_0x1963f7){_0x58fa2c[_0xd593('0x53')]=_0x1963f7;return _0x58fa2c;});}})[_0xd593('0x2c')](respondWithFilteredResult(_0x1f192b,_0xdfca2c))['catch'](handleError(_0x1f192b,null));};exports[_0xd593('0x6b')]=function(_0x5b9b1a,_0x16204e,_0x335242){var _0x534717={'raw':!![],'where':{}};var _0x42a62c={};var _0x112730={'count':0x0,'rows':[]};return db[_0xd593('0x3e')][_0xd593('0x6c')]({'where':{'id':_0x5b9b1a[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x16204e,null))[_0xd593('0x2c')](function(_0x28f234){if(_0x28f234){_0x42a62c['model']=_[_0xd593('0x56')](db[_0xd593('0x6d')]['rawAttributes']);_0x42a62c[_0xd593('0x43')]=_['keys'](_0x5b9b1a[_0xd593('0x43')]);_0x42a62c[_0xd593('0x57')]=_[_0xd593('0x45')](_0x42a62c[_0xd593('0x42')],_0x42a62c[_0xd593('0x43')]);_0x534717[_0xd593('0x44')]=_[_0xd593('0x45')](_0x42a62c['model'],qs['fields'](_0x5b9b1a[_0xd593('0x43')]['fields']));_0x534717['attributes']=_0x534717[_0xd593('0x44')][_0xd593('0x47')]?_0x534717[_0xd593('0x44')]:_0x42a62c[_0xd593('0x42')];if(!_0x5b9b1a['query'][_0xd593('0x48')]('nolimit')){_0x534717[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x5b9b1a[_0xd593('0x43')]['limit']);_0x534717['offset']=qs[_0xd593('0x25')](_0x5b9b1a['query'][_0xd593('0x25')]);}_0x534717[_0xd593('0x4a')]=qs[_0xd593('0x4b')](_0x5b9b1a[_0xd593('0x43')][_0xd593('0x4b')]);_0x534717[_0xd593('0x4e')]=qs[_0xd593('0x57')](_[_0xd593('0x4c')](_0x5b9b1a[_0xd593('0x43')],_0x42a62c[_0xd593('0x57')]));_0x534717[_0xd593('0x4e')]['VoiceQueueId']=_0x28f234['id'];if(_0x5b9b1a[_0xd593('0x43')][_0xd593('0x32')]){_0x534717[_0xd593('0x4e')]=_[_0xd593('0x4d')](_0x534717[_0xd593('0x4e')],{'$or':_[_0xd593('0x34')](_0x534717['attributes'],function(_0xda4c1d){var _0x3cf192={};_0x3cf192[_0xda4c1d]={'$like':'%'+_0x5b9b1a[_0xd593('0x43')][_0xd593('0x32')]+'%'};return _0x3cf192;})});}_0x534717=_[_0xd593('0x4d')]({},_0x534717,_0x5b9b1a[_0xd593('0x50')]);return db['CmHopperHistory']['count']({'where':_0x534717['where']})[_0xd593('0x2c')](function(_0x1953b9){_0x112730[_0xd593('0x24')]=_0x1953b9;if(_0x5b9b1a[_0xd593('0x43')][_0xd593('0x51')]){_0x534717[_0xd593('0x52')]=[{'all':!![]}];}return db[_0xd593('0x6d')][_0xd593('0x6a')](_0x534717);})[_0xd593('0x2c')](function(_0x309bbb){_0x112730[_0xd593('0x53')]=_0x309bbb;return _0x112730;});}})[_0xd593('0x2c')](respondWithFilteredResult(_0x16204e,_0x534717))[_0xd593('0x54')](handleError(_0x16204e,null));};exports[_0xd593('0x6e')]=function(_0x50facb,_0x31866e,_0x508e26){var _0x372e7f={'raw':!![],'where':{}};var _0x39d3c5={};var _0x37277e={'count':0x0,'rows':[]};return db[_0xd593('0x3e')]['findOne']({'where':{'id':_0x50facb['params']['id']}})['then'](handleEntityNotFound(_0x31866e,null))[_0xd593('0x2c')](function(_0x20e6e4){if(_0x20e6e4){_0x39d3c5['model']=_[_0xd593('0x56')](db[_0xd593('0x6f')]['rawAttributes']);_0x39d3c5['query']=_[_0xd593('0x56')](_0x50facb[_0xd593('0x43')]);_0x39d3c5[_0xd593('0x57')]=_[_0xd593('0x45')](_0x39d3c5['model'],_0x39d3c5[_0xd593('0x43')]);_0x372e7f[_0xd593('0x44')]=_[_0xd593('0x45')](_0x39d3c5['model'],qs['fields'](_0x50facb[_0xd593('0x43')][_0xd593('0x46')]));_0x372e7f['attributes']=_0x372e7f[_0xd593('0x44')][_0xd593('0x47')]?_0x372e7f[_0xd593('0x44')]:_0x39d3c5[_0xd593('0x42')];if(!_0x50facb[_0xd593('0x43')][_0xd593('0x48')](_0xd593('0x49'))){_0x372e7f[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x50facb['query'][_0xd593('0x26')]);_0x372e7f[_0xd593('0x25')]=qs[_0xd593('0x25')](_0x50facb[_0xd593('0x43')][_0xd593('0x25')]);}_0x372e7f[_0xd593('0x4a')]=qs[_0xd593('0x4b')](_0x50facb[_0xd593('0x43')][_0xd593('0x4b')]);_0x372e7f[_0xd593('0x4e')]=qs[_0xd593('0x57')](_[_0xd593('0x4c')](_0x50facb['query'],_0x39d3c5[_0xd593('0x57')]));_0x372e7f[_0xd593('0x4e')][_0xd593('0x69')]=_0x20e6e4['id'];if(_0x50facb[_0xd593('0x43')][_0xd593('0x32')]){_0x372e7f[_0xd593('0x4e')]=_[_0xd593('0x4d')](_0x372e7f[_0xd593('0x4e')],{'$or':_[_0xd593('0x34')](_0x372e7f[_0xd593('0x44')],function(_0x26e75e){var _0x25278c={};_0x25278c[_0x26e75e]={'$like':'%'+_0x50facb['query']['filter']+'%'};return _0x25278c;})});}_0x372e7f=_[_0xd593('0x4d')]({},_0x372e7f,_0x50facb[_0xd593('0x50')]);return db[_0xd593('0x6f')][_0xd593('0x24')]({'where':_0x372e7f[_0xd593('0x4e')]})[_0xd593('0x2c')](function(_0x4fa945){_0x37277e['count']=_0x4fa945;if(_0x50facb[_0xd593('0x43')][_0xd593('0x51')]){_0x372e7f[_0xd593('0x52')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd593('0x6a')](_0x372e7f);})['then'](function(_0x41429d){_0x37277e[_0xd593('0x53')]=_0x41429d;return _0x37277e;});}})['then'](respondWithFilteredResult(_0x31866e,_0x372e7f))[_0xd593('0x54')](handleError(_0x31866e,null));};exports['getHopperBlacks']=function(_0x14485d,_0x3e4dda,_0x58d05c){var _0x16dfc8={'raw':!![],'where':{}};var _0x1817e6={};var _0x212d0a={'count':0x0,'rows':[]};return db[_0xd593('0x3e')][_0xd593('0x6c')]({'where':{'id':_0x14485d[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x3e4dda,null))['then'](function(_0x13314a){if(_0x13314a){_0x1817e6[_0xd593('0x42')]=_[_0xd593('0x56')](db['CmHopperBlack'][_0xd593('0x3f')]);_0x1817e6['query']=_['keys'](_0x14485d[_0xd593('0x43')]);_0x1817e6['filters']=_[_0xd593('0x45')](_0x1817e6[_0xd593('0x42')],_0x1817e6[_0xd593('0x43')]);_0x16dfc8[_0xd593('0x44')]=_[_0xd593('0x45')](_0x1817e6[_0xd593('0x42')],qs[_0xd593('0x46')](_0x14485d[_0xd593('0x43')][_0xd593('0x46')]));_0x16dfc8[_0xd593('0x44')]=_0x16dfc8[_0xd593('0x44')][_0xd593('0x47')]?_0x16dfc8['attributes']:_0x1817e6['model'];if(!_0x14485d[_0xd593('0x43')][_0xd593('0x48')](_0xd593('0x49'))){_0x16dfc8[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x14485d[_0xd593('0x43')][_0xd593('0x26')]);_0x16dfc8[_0xd593('0x25')]=qs[_0xd593('0x25')](_0x14485d[_0xd593('0x43')][_0xd593('0x25')]);}_0x16dfc8[_0xd593('0x4a')]=qs[_0xd593('0x4b')](_0x14485d[_0xd593('0x43')][_0xd593('0x4b')]);_0x16dfc8[_0xd593('0x4e')]=qs[_0xd593('0x57')](_[_0xd593('0x4c')](_0x14485d[_0xd593('0x43')],_0x1817e6[_0xd593('0x57')]));_0x16dfc8['where'][_0xd593('0x69')]=_0x13314a['id'];if(_0x14485d['query'][_0xd593('0x32')]){_0x16dfc8[_0xd593('0x4e')]=_['merge'](_0x16dfc8[_0xd593('0x4e')],{'$or':_['map'](_0x16dfc8['attributes'],function(_0x513f7a){var _0x3bd798={};_0x3bd798[_0x513f7a]={'$like':'%'+_0x14485d['query'][_0xd593('0x32')]+'%'};return _0x3bd798;})});}_0x16dfc8=_[_0xd593('0x4d')]({},_0x16dfc8,_0x14485d['options']);return db[_0xd593('0x70')][_0xd593('0x24')]({'where':_0x16dfc8[_0xd593('0x4e')]})[_0xd593('0x2c')](function(_0x22d92f){_0x212d0a[_0xd593('0x24')]=_0x22d92f;if(_0x14485d[_0xd593('0x43')][_0xd593('0x51')]){_0x16dfc8[_0xd593('0x52')]=[{'all':!![]}];}return db[_0xd593('0x70')][_0xd593('0x6a')](_0x16dfc8);})[_0xd593('0x2c')](function(_0x1250df){_0x212d0a[_0xd593('0x53')]=_0x1250df;return _0x212d0a;});}})[_0xd593('0x2c')](respondWithFilteredResult(_0x3e4dda,_0x16dfc8))[_0xd593('0x54')](handleError(_0x3e4dda,null));};exports['getTeams']=function(_0x138467,_0x5d1207,_0x5e29d5){var _0x4db4c8={};var _0x42f83a={};var _0x5c510c;var _0x54a210;return db[_0xd593('0x3e')]['findOne']({'where':{'id':_0x138467[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x5d1207,null))[_0xd593('0x2c')](function(_0x3671ca){if(_0x3671ca){_0x5c510c=_0x3671ca;_0x42f83a['model']=_[_0xd593('0x56')](db[_0xd593('0x71')][_0xd593('0x3f')]);_0x42f83a[_0xd593('0x43')]=_[_0xd593('0x56')](_0x138467[_0xd593('0x43')]);_0x42f83a['filters']=_[_0xd593('0x45')](_0x42f83a[_0xd593('0x42')],_0x42f83a[_0xd593('0x43')]);_0x4db4c8[_0xd593('0x44')]=_[_0xd593('0x45')](_0x42f83a[_0xd593('0x42')],qs['fields'](_0x138467['query'][_0xd593('0x46')]));_0x4db4c8[_0xd593('0x44')]=_0x4db4c8[_0xd593('0x44')][_0xd593('0x47')]?_0x4db4c8[_0xd593('0x44')]:_0x42f83a[_0xd593('0x42')];_0x4db4c8[_0xd593('0x4a')]=qs['sort'](_0x138467[_0xd593('0x43')]['sort']);_0x4db4c8[_0xd593('0x4e')]=qs[_0xd593('0x57')](_['pick'](_0x138467[_0xd593('0x43')],_0x42f83a['filters']));if(_0x138467[_0xd593('0x43')][_0xd593('0x32')]){_0x4db4c8[_0xd593('0x4e')]=_[_0xd593('0x4d')](_0x4db4c8[_0xd593('0x4e')],{'$or':_[_0xd593('0x34')](_0x4db4c8[_0xd593('0x44')],function(_0x18382e){var _0x178fa3={};_0x178fa3[_0x18382e]={'$like':'%'+_0x138467[_0xd593('0x43')][_0xd593('0x32')]+'%'};return _0x178fa3;})});}_0x4db4c8=_[_0xd593('0x4d')]({},_0x4db4c8,_0x138467[_0xd593('0x50')]);return _0x5c510c['getTeams'](_0x4db4c8);}})['then'](function(_0x4d6237){if(_0x4d6237){_0x54a210=_0x4d6237['length'];if(!_0x138467[_0xd593('0x43')][_0xd593('0x48')](_0xd593('0x49'))){_0x4db4c8['limit']=qs['limit'](_0x138467[_0xd593('0x43')][_0xd593('0x26')]);_0x4db4c8[_0xd593('0x25')]=qs['offset'](_0x138467[_0xd593('0x43')][_0xd593('0x25')]);}return _0x5c510c['getTeams'](_0x4db4c8);}})[_0xd593('0x2c')](function(_0x20160c){if(_0x20160c){return _0x20160c?{'count':_0x54a210,'rows':_0x20160c}:null;}})[_0xd593('0x2c')](respondWithResult(_0x5d1207,null))[_0xd593('0x54')](handleError(_0x5d1207,null));};exports[_0xd593('0x72')]=function(_0x18c89e,_0x9c90f2,_0x15a2a9){var _0x28154e=_0x18c89e[_0xd593('0x59')][_0xd593('0x73')];var _0x4fa73e=_[_0xd593('0x34')](_0x28154e,'id');return db[_0xd593('0x71')][_0xd593('0x6a')]({'where':{'id':_0x4fa73e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd593('0x74'),'attributes':['id',_0xd593('0x39'),_0xd593('0x75'),_0xd593('0x76'),_0xd593('0x77')],'raw':!![]}]})[_0xd593('0x2c')](function(_0x535ecc){if(_0x535ecc){var _0x2ea5b9=_[_0xd593('0x78')](_0x535ecc,function(_0x561cbb){var _0x5116fd=_0x561cbb[_0xd593('0x2d')]({'plain':!![]});_0x5116fd[_0xd593('0x74')][_0xd593('0x79')](function(_0x32b3c6){_0x32b3c6[_0xd593('0x7a')]=_[_0xd593('0x37')](_0x28154e,{'id':_0x5116fd['id']})[_0xd593('0x7a')];});return _0x5116fd['Agents'];});return db['VoiceQueue'][_0xd593('0x37')]({'where':{'id':_0x18c89e['params']['id']}})[_0xd593('0x2c')](function(_0x5551ba){return db[_0xd593('0x7b')][_0xd593('0x7c')](function(_0x1b856d){return _0x5551ba['addTeams'](_0x4fa73e,{'transaction':_0x1b856d})[_0xd593('0x2c')](function(){return BPromise['each'](_0x28154e,function(_0x154906){return db[_0xd593('0x7d')][_0xd593('0x7e')]({'TeamId':_0x154906['id'],'VoiceQueueId':_0x18c89e[_0xd593('0x55')]['id'],'penalty':_0x154906[_0xd593('0x7a')]},{'transaction':_0x1b856d});});})[_0xd593('0x2c')](function(){return BPromise[_0xd593('0x7f')](_0x2ea5b9,function(_0x322c62){return db[_0xd593('0x80')][_0xd593('0x81')]({'where':{'UserId':_0x322c62['id'],'VoiceQueueId':_0x18c89e[_0xd593('0x55')]['id']},'defaults':{'penalty':_0x322c62['penalty']},'transaction':_0x1b856d});});})['then'](function(){return BPromise[_0xd593('0x7f')](_[_0xd593('0x32')](_0x2ea5b9,{'online':!![]}),function(_0x2e6fe0){return db[_0xd593('0x82')]['upsert']({'membername':_0x2e6fe0[_0xd593('0x39')],'UserId':_0x2e6fe0['id'],'queue_name':_0x5551ba[_0xd593('0x39')],'VoiceQueueId':_0x5551ba['id'],'interface':_[_0xd593('0x83')](_0x2e6fe0['interface'])?util[_0xd593('0x84')]('SIP/%s',_0x2e6fe0[_0xd593('0x39')]):_0x2e6fe0[_0xd593('0x77')],'paused':_0x2e6fe0[_0xd593('0x76')]||![],'penalty':_0x2e6fe0[_0xd593('0x7a')]},{'transaction':_0x1b856d});});})[_0xd593('0x2c')](function(){_0x2ea5b9['forEach'](function(_0x19fc8e){socket[_0xd593('0x85')](_0xd593('0x86'),{'UserId':_0x19fc8e['id'],'VoiceQueueId':_0x5551ba['id']});});});});});}})[_0xd593('0x2c')](respondWithStatusCode(_0x9c90f2,null))['catch'](handleError(_0x9c90f2,null));};exports[_0xd593('0x87')]=function(_0x37afff,_0x2a3be6,_0xcc3309){return db['Team'][_0xd593('0x6a')]({'where':{'id':_0x37afff[_0xd593('0x43')][_0xd593('0x88')]},'attributes':['id'],'include':[{'model':db[_0xd593('0x89')],'as':_0xd593('0x74'),'attributes':['id'],'raw':!![]}]})[_0xd593('0x2c')](handleEntityNotFound(_0x2a3be6,null))[_0xd593('0x2c')](function(_0x1de6b3){var _0x5a2912=_[_0xd593('0x34')](_0x1de6b3,'id');var _0x33b941=[];var _0x2f9635=[];var _0x9b70ab=squel[_0xd593('0x8a')]();_0x9b70ab['field']('tq.TeamId')[_0xd593('0x8b')]('team_has_voice_queues','tq')[_0xd593('0x8c')](_0xd593('0x8d'),'ut',_0xd593('0x8e'))['where'](_0xd593('0x8f'),_0x37afff['params']['id']);for(var _0x33cf2c=0x0;_0x33cf2c<_0x1de6b3[_0xd593('0x47')];_0x33cf2c+=0x1){let _0x2f5f3a=_0x1de6b3[_0x33cf2c];for(var _0x30431c=0x0;_0x30431c<_0x2f5f3a['Agents'][_0xd593('0x47')];_0x30431c+=0x1){let _0x4f2a6c=_0x2f5f3a[_0xd593('0x74')][_0x30431c];var _0x5d3457=_0x9b70ab['clone']();_0x5d3457[_0xd593('0x4e')](_0xd593('0x90'),_0x4f2a6c['id']);_0x2f9635['push'](db[_0xd593('0x7b')][_0xd593('0x43')](_0x5d3457[_0xd593('0x91')](),{'type':db['sequelize']['QueryTypes'][_0xd593('0x92')]})[_0xd593('0x2c')](function(_0x199d5c){if(_0x199d5c['length']===0x1){return _0x4f2a6c['id'];}else{var _0x290379=_[_0xd593('0x93')](_[_0xd593('0x34')](_0x199d5c,_0xd593('0x94')),function(_0x217f11){return _[_0xd593('0x36')](_0x5a2912,_0x217f11);});if(_0x290379){return _0x4f2a6c['id'];}}}));}}return BPromise[_0xd593('0x95')](_0x2f9635)['then'](function(_0x1f7d74){_0x33b941=_(_0x33b941)[_0xd593('0x96')](_0x1f7d74)[_0xd593('0x97')]()[_0xd593('0x35')]();return db[_0xd593('0x3e')][_0xd593('0x37')]({'where':{'id':_0x37afff[_0xd593('0x55')]['id']}})['then'](function(_0x5ebdb0){return db[_0xd593('0x7b')][_0xd593('0x7c')](function(_0x359120){return _0x5ebdb0[_0xd593('0x87')](_0x37afff[_0xd593('0x43')][_0xd593('0x88')],{'transaction':_0x359120})[_0xd593('0x2c')](function(){if(!_[_0xd593('0x98')](_0x33b941)){return _0x5ebdb0['removeAgents'](_0x33b941,{'transaction':_0x359120})['then'](function(){return db[_0xd593('0x82')][_0xd593('0x3a')]({'where':{'VoiceQueueId':_0x37afff[_0xd593('0x55')]['id'],'UserId':_0x33b941},'transaction':_0x359120});});}})[_0xd593('0x2c')](function(){_0x33b941[_0xd593('0x79')](function(_0x15b6a7){socket[_0xd593('0x85')]('userVoiceQueue:remove',{'UserId':_0x15b6a7,'VoiceQueueId':_0x5ebdb0['id']});});});});});});})[_0xd593('0x2c')](respondWithStatusCode(_0x2a3be6,null))[_0xd593('0x54')](handleError(_0x2a3be6,null));};exports[_0xd593('0x99')]=function(_0x41cf4b,_0x1ab77f,_0x2f0d03){var _0x506017,_0x19d6cf;return db[_0xd593('0x3e')]['find']({'where':{'id':_0x41cf4b[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x1ab77f,null))[_0xd593('0x2c')](function(_0x40bd75){if(_0x40bd75){_0x19d6cf=_0x40bd75;return _0x40bd75[_0xd593('0x99')](_0x41cf4b[_0xd593('0x59')][_0xd593('0x88')],_[_0xd593('0x61')](_0x41cf4b['body'],[_0xd593('0x88'),'id'])||{})[_0xd593('0x9a')](function(_0xcb2ae7){for(var _0x3fe52b=0x0;_0x3fe52b<_0x41cf4b[_0xd593('0x59')][_0xd593('0x88')][_0xd593('0x47')];_0x3fe52b+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x41cf4b[_0xd593('0x59')][_0xd593('0x88')][_0x3fe52b],'VoiceQueueId':_0x41cf4b[_0xd593('0x55')]['id']});}return _0xcb2ae7;});}})[_0xd593('0x2c')](function(_0xb7a2fe){_0x506017=_0xb7a2fe||[];if(_0x19d6cf){return db['User'][_0xd593('0x6a')]({'where':{'id':_0x41cf4b[_0xd593('0x59')][_0xd593('0x88')]},'attributes':['id',_0xd593('0x39'),_0xd593('0x75'),_0xd593('0x76'),_0xd593('0x77')],'raw':!![]});}})[_0xd593('0x2c')](function(_0x1eb8be){if(!_[_0xd593('0x98')](_0x1eb8be)){var _0xd8bdb1=[];for(var _0x5d9035=0x0;_0x5d9035<_0x1eb8be[_0xd593('0x47')];_0x5d9035++){if(_0x1eb8be[_0x5d9035][_0xd593('0x75')]){_0xd8bdb1[_0xd593('0x9b')](db[_0xd593('0x82')][_0xd593('0x7e')]({'membername':_0x1eb8be[_0x5d9035][_0xd593('0x39')],'UserId':_0x1eb8be[_0x5d9035]['id'],'queue_name':_0x19d6cf['name'],'VoiceQueueId':_0x19d6cf['id'],'interface':_[_0xd593('0x83')](_0x1eb8be[_0x5d9035]['interface'])?util['format'](_0xd593('0x9c'),_0x1eb8be[_0x5d9035][_0xd593('0x39')]):_0x1eb8be[_0x5d9035][_0xd593('0x77')],'paused':_0x1eb8be[_0x5d9035][_0xd593('0x76')]||![],'penalty':_0x41cf4b[_0xd593('0x59')][_0xd593('0x7a')]||0x0}));}}return BPromise[_0xd593('0x95')](_0xd8bdb1);}})[_0xd593('0x2c')](function(){return _0x506017;})[_0xd593('0x2c')](respondWithResult(_0x1ab77f,null))['catch'](handleError(_0x1ab77f,null));};exports[_0xd593('0x9d')]=function(_0x344731,_0x3ad01b,_0xa02cf8){return db[_0xd593('0x3e')][_0xd593('0x37')]({'where':{'id':_0x344731[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x3ad01b,null))['then'](function(_0x674a9){if(_0x674a9){return _0x674a9['removeAgents'](_0x344731[_0xd593('0x43')]['ids'])['then'](function(){if(_[_0xd593('0x9e')](_0x344731[_0xd593('0x43')][_0xd593('0x88')])){for(var _0x1ccee7=0x0;_0x1ccee7<_0x344731[_0xd593('0x43')][_0xd593('0x88')][_0xd593('0x47')];_0x1ccee7+=0x1){socket[_0xd593('0x85')](_0xd593('0x9f'),{'UserId':Number(_0x344731[_0xd593('0x43')][_0xd593('0x88')][_0x1ccee7]),'VoiceQueueId':Number(_0x344731['params']['id'])});}}else{socket[_0xd593('0x85')](_0xd593('0x9f'),{'UserId':Number(_0x344731[_0xd593('0x43')][_0xd593('0x88')]),'VoiceQueueId':Number(_0x344731[_0xd593('0x55')]['id'])});}});}})['then'](function(_0x202e63){return db[_0xd593('0x82')][_0xd593('0x3a')]({'where':{'VoiceQueueId':_0x344731[_0xd593('0x55')]['id'],'UserId':_0x344731[_0xd593('0x43')][_0xd593('0x88')]}})['then'](function(){return _0x202e63;});})[_0xd593('0x2c')](respondWithStatusCode(_0x3ad01b,null))['catch'](handleError(_0x3ad01b,null));};exports[_0xd593('0xa0')]=function(_0x407837,_0x4dcfe4,_0x31bf18){var _0x119f2f={};var _0x2bb296={};var _0x2125ce;var _0x3d4f4a;return db[_0xd593('0x3e')][_0xd593('0x6c')]({'where':{'id':_0x407837[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x4dcfe4,null))[_0xd593('0x2c')](function(_0x35c521){if(_0x35c521){_0x2125ce=_0x35c521;_0x2bb296[_0xd593('0x42')]=_['keys'](db[_0xd593('0x89')]['rawAttributes']);_0x2bb296[_0xd593('0x43')]=_[_0xd593('0x56')](_0x407837['query']);_0x2bb296[_0xd593('0x57')]=_['intersection'](_0x2bb296[_0xd593('0x42')],_0x2bb296[_0xd593('0x43')]);_0x119f2f[_0xd593('0x44')]=_['intersection'](_0x2bb296[_0xd593('0x42')],qs[_0xd593('0x46')](_0x407837[_0xd593('0x43')][_0xd593('0x46')]));_0x119f2f[_0xd593('0x44')]=_0x119f2f[_0xd593('0x44')][_0xd593('0x47')]?_0x119f2f['attributes']:_0x2bb296[_0xd593('0x42')];_0x119f2f['order']=qs[_0xd593('0x4b')](_0x407837[_0xd593('0x43')][_0xd593('0x4b')]);_0x119f2f['where']=qs[_0xd593('0x57')](_[_0xd593('0x4c')](_0x407837[_0xd593('0x43')],_0x2bb296[_0xd593('0x57')]));if(_0x407837[_0xd593('0x43')][_0xd593('0x32')]){_0x119f2f[_0xd593('0x4e')]=_[_0xd593('0x4d')](_0x119f2f[_0xd593('0x4e')],{'$or':_['map'](_0x119f2f[_0xd593('0x44')],function(_0x6ddadd){var _0x4a76fc={};_0x4a76fc[_0x6ddadd]={'$like':'%'+_0x407837[_0xd593('0x43')][_0xd593('0x32')]+'%'};return _0x4a76fc;})});}_0x119f2f=_['merge']({},_0x119f2f,_0x407837['options']);return _0x2125ce[_0xd593('0xa0')](_0x119f2f);}})[_0xd593('0x2c')](function(_0x579c9a){if(_0x579c9a){_0x3d4f4a=_0x579c9a[_0xd593('0x47')];if(!_0x407837[_0xd593('0x43')][_0xd593('0x48')](_0xd593('0x49'))){_0x119f2f[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x407837[_0xd593('0x43')][_0xd593('0x26')]);_0x119f2f['offset']=qs[_0xd593('0x25')](_0x407837[_0xd593('0x43')][_0xd593('0x25')]);}return _0x2125ce['getAgents'](_0x119f2f);}})[_0xd593('0x2c')](function(_0xbf5cd2){if(_0xbf5cd2){return _0xbf5cd2?{'count':_0x3d4f4a,'rows':_0xbf5cd2}:null;}})[_0xd593('0x2c')](respondWithResult(_0x4dcfe4,null))[_0xd593('0x54')](handleError(_0x4dcfe4,null));};exports[_0xd593('0xa1')]=function(_0x37bdbd,_0x44bbdb,_0x399696){var _0x5f5bab={};var _0x16d56b={};var _0x309074;var _0x5e8d20;return db[_0xd593('0x3e')][_0xd593('0x6c')]({'where':{'id':_0x37bdbd[_0xd593('0x55')]['id']}})['then'](handleEntityNotFound(_0x44bbdb,null))[_0xd593('0x2c')](function(_0x4f0338){if(_0x4f0338){_0x309074=_0x4f0338;_0x16d56b[_0xd593('0x42')]=_[_0xd593('0x56')](db[_0xd593('0x82')][_0xd593('0x3f')]);_0x16d56b['query']=_[_0xd593('0x56')](_0x37bdbd['query']);_0x16d56b[_0xd593('0x57')]=_[_0xd593('0x45')](_0x16d56b[_0xd593('0x42')],_0x16d56b[_0xd593('0x43')]);_0x5f5bab[_0xd593('0x44')]=_['intersection'](_0x16d56b[_0xd593('0x42')],qs[_0xd593('0x46')](_0x37bdbd[_0xd593('0x43')][_0xd593('0x46')]));_0x5f5bab[_0xd593('0x44')]=_0x5f5bab[_0xd593('0x44')][_0xd593('0x47')]?_0x5f5bab[_0xd593('0x44')]:_0x16d56b[_0xd593('0x42')];_0x5f5bab[_0xd593('0x4a')]=qs[_0xd593('0x4b')](_0x37bdbd['query']['sort']);_0x5f5bab['where']=qs[_0xd593('0x57')](_['pick'](_0x37bdbd[_0xd593('0x43')],_0x16d56b['filters']));if(_0x37bdbd['query']['filter']){_0x5f5bab[_0xd593('0x4e')]=_[_0xd593('0x4d')](_0x5f5bab[_0xd593('0x4e')],{'$or':_[_0xd593('0x34')](_0x5f5bab['attributes'],function(_0x35e585){var _0x26b7cb={};_0x26b7cb[_0x35e585]={'$like':'%'+_0x37bdbd[_0xd593('0x43')][_0xd593('0x32')]+'%'};return _0x26b7cb;})});}_0x5f5bab=_[_0xd593('0x4d')]({},_0x5f5bab,_0x37bdbd['options']);return _0x309074[_0xd593('0xa1')](_0x5f5bab);}})[_0xd593('0x2c')](function(_0x5cfbf6){if(_0x5cfbf6){_0x5e8d20=_0x5cfbf6['length'];if(!_0x37bdbd['query'][_0xd593('0x48')]('nolimit')){_0x5f5bab[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x37bdbd[_0xd593('0x43')][_0xd593('0x26')]);_0x5f5bab[_0xd593('0x25')]=qs['offset'](_0x37bdbd[_0xd593('0x43')][_0xd593('0x25')]);}return _0x309074[_0xd593('0xa1')](_0x5f5bab);}})[_0xd593('0x2c')](function(_0x38a9f9){return _0x38a9f9?{'count':_0x5e8d20,'rows':_0x38a9f9}:null;})[_0xd593('0x2c')](respondWithResult(_0x44bbdb,null))[_0xd593('0x54')](handleError(_0x44bbdb,null));};exports[_0xd593('0xa2')]=function(_0x57b1f1,_0x50b174,_0x11a91b){var _0x3b5a79={};var _0x182f8a={};var _0x1576b7;var _0x1136dd;return db[_0xd593('0x3e')]['findOne']({'where':{'id':_0x57b1f1['params']['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x50b174,null))[_0xd593('0x2c')](function(_0x5fccf6){if(_0x5fccf6){_0x1576b7=_0x5fccf6;_0x182f8a[_0xd593('0x42')]=_[_0xd593('0x56')](db[_0xd593('0xa3')][_0xd593('0x3f')]);_0x182f8a[_0xd593('0x43')]=_[_0xd593('0x56')](_0x57b1f1[_0xd593('0x43')]);_0x182f8a[_0xd593('0x57')]=_['intersection'](_0x182f8a[_0xd593('0x42')],_0x182f8a['query']);_0x3b5a79[_0xd593('0x44')]=_[_0xd593('0x45')](_0x182f8a['model'],qs[_0xd593('0x46')](_0x57b1f1[_0xd593('0x43')][_0xd593('0x46')]));_0x3b5a79[_0xd593('0x44')]=_0x3b5a79[_0xd593('0x44')][_0xd593('0x47')]?_0x3b5a79[_0xd593('0x44')]:_0x182f8a[_0xd593('0x42')];_0x3b5a79['order']=qs[_0xd593('0x4b')](_0x57b1f1[_0xd593('0x43')]['sort']);_0x3b5a79['where']=qs['filters'](_[_0xd593('0x4c')](_0x57b1f1['query'],_0x182f8a['filters']));if(_0x57b1f1[_0xd593('0x43')][_0xd593('0x32')]){_0x3b5a79['where']=_['merge'](_0x3b5a79[_0xd593('0x4e')],{'$or':_[_0xd593('0x34')](_0x3b5a79[_0xd593('0x44')],function(_0x143851){var _0x1bb113={};_0x1bb113[_0x143851]={'$like':'%'+_0x57b1f1['query'][_0xd593('0x32')]+'%'};return _0x1bb113;})});}_0x3b5a79=_[_0xd593('0x4d')]({},_0x3b5a79,_0x57b1f1[_0xd593('0x50')]);return _0x1576b7['getLists'](_0x3b5a79);}})[_0xd593('0x2c')](function(_0xf67482){if(_0xf67482){_0x1136dd=_0xf67482[_0xd593('0x47')];if(!_0x57b1f1[_0xd593('0x43')]['hasOwnProperty']('nolimit')){_0x3b5a79[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x57b1f1[_0xd593('0x43')][_0xd593('0x26')]);_0x3b5a79[_0xd593('0x25')]=qs[_0xd593('0x25')](_0x57b1f1[_0xd593('0x43')][_0xd593('0x25')]);}return _0x1576b7['getLists'](_0x3b5a79);}})[_0xd593('0x2c')](function(_0x378974){if(_0x378974){return _0x378974?{'count':_0x1136dd,'rows':_0x378974}:null;}})[_0xd593('0x2c')](respondWithResult(_0x50b174,null))[_0xd593('0x54')](handleError(_0x50b174,null));};exports[_0xd593('0xa4')]=function(_0x3e0547,_0x377fee,_0x411c1d){var _0x5c0e74,_0x44a04e;return db[_0xd593('0x3e')][_0xd593('0x37')]({'where':{'id':_0x3e0547['params']['id']}})['then'](handleEntityNotFound(_0x377fee,null))[_0xd593('0x2c')](function(_0xfef069){if(_0xfef069){_0x44a04e=_0xfef069;return _0xfef069[_0xd593('0xa4')](_0x3e0547['body'][_0xd593('0x88')],_[_0xd593('0x61')](_0x3e0547[_0xd593('0x59')],['ids','id'])||{});}return null;})[_0xd593('0x9a')](function(_0x2bda23){var _0xd6c6a5;_0x5c0e74=_0x2bda23||[];var _0x5f35b5=[];if(_0x2bda23){for(var _0x463bec=0x0;_0x463bec<_0x2bda23[_0xd593('0x47')];_0x463bec+=0x1){var _0x2196b5=_0x2bda23[_0x463bec][_0xd593('0x2d')]({'plain':!![]});_0x44a04e[_0xd593('0xa5')]=_0x3e0547[_0xd593('0x59')]['dialCheckDuplicateType']?_0x3e0547['body']['dialCheckDuplicateType']:_0x44a04e[_0xd593('0xa5')];switch(_0x44a04e[_0xd593('0xa5')]){case _0xd593('0xa6'):_0xd6c6a5=squel[_0xd593('0xa7')]()[_0xd593('0xa8')](_0xd593('0xa9'))[_0xd593('0xaa')]([_0xd593('0xab'),'scheduledAt',_0xd593('0xac'),_0xd593('0xad'),_0xd593('0x69'),_0xd593('0x62'),_0xd593('0x63')],squel[_0xd593('0x8a')]()[_0xd593('0xae')](_0xd593('0xab'),_0xd593('0xab'))[_0xd593('0xae')](_0xd593('0xaf'),_0xd593('0xb0'))[_0xd593('0xae')]('id',_0xd593('0xac'))[_0xd593('0xae')](_0x2196b5[_0xd593('0xb1')][_0xd593('0x91')](),'ListId')['field'](_0x3e0547[_0xd593('0x55')]['id'][_0xd593('0x91')](),_0xd593('0x69'))['field'](_0xd593('0xaf'),'createdAt')['field'](_0xd593('0xaf'),_0xd593('0x63'))[_0xd593('0x8b')](_0xd593('0xb2'))['where'](_0xd593('0xb3'))['where'](_0xd593('0xb4'),_0x2196b5[_0xd593('0xb1')][_0xd593('0x91')]())['where'](_0xd593('0xb5'))[_0xd593('0x4e')](_0xd593('0xb6'),squel[_0xd593('0x8a')]()[_0xd593('0xae')](_0xd593('0xb7'))['from'](_0xd593('0xb8'))[_0xd593('0x4e')](_0xd593('0x8f'),_0x3e0547['params']['id'][_0xd593('0x91')]()))[_0xd593('0x4e')](_0xd593('0xb6'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xd593('0x8b')]('cm_hopper')['where'](_0xd593('0x8f'),_0x3e0547[_0xd593('0x55')]['id'][_0xd593('0x91')]())))[_0xd593('0x91')]();break;case _0xd593('0xb9'):_0xd6c6a5=squel['insert']()[_0xd593('0xa8')]('cm_hopper')[_0xd593('0xaa')]([_0xd593('0xab'),'scheduledAt',_0xd593('0xac'),_0xd593('0xad'),_0xd593('0x69'),_0xd593('0x62'),_0xd593('0x63')],squel[_0xd593('0x8a')]()['field'](_0xd593('0xab'),_0xd593('0xab'))['field'](_0xd593('0xaf'),_0xd593('0xb0'))['field']('id',_0xd593('0xac'))[_0xd593('0xae')](_0x2196b5[_0xd593('0xb1')]['toString'](),_0xd593('0xad'))[_0xd593('0xae')](_0x3e0547[_0xd593('0x55')]['id']['toString'](),'VoiceQueueId')[_0xd593('0xae')](_0xd593('0xaf'),_0xd593('0x62'))['field'](_0xd593('0xaf'),_0xd593('0x63'))[_0xd593('0x8b')](_0xd593('0xb2'))[_0xd593('0x4e')](_0xd593('0xb3'))[_0xd593('0x4e')](_0xd593('0xb4'),_0x2196b5[_0xd593('0xb1')][_0xd593('0x91')]())['where'](_0xd593('0xb5'))[_0xd593('0x4e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd593('0x8a')]()[_0xd593('0xae')](_0xd593('0xba'))[_0xd593('0x8b')]('cm_hopper')[_0xd593('0x4e')](_0xd593('0x8f'),_0x3e0547[_0xd593('0x55')]['id'][_0xd593('0x91')]())))[_0xd593('0x91')]();break;default:_0xd6c6a5=squel['insert']()[_0xd593('0xa8')](_0xd593('0xa9'))[_0xd593('0xaa')]([_0xd593('0xab'),_0xd593('0xb0'),'ContactId',_0xd593('0xad'),_0xd593('0x69'),_0xd593('0x62'),_0xd593('0x63')],squel['select']()[_0xd593('0xae')](_0xd593('0xab'),_0xd593('0xab'))[_0xd593('0xae')](_0xd593('0xaf'),_0xd593('0xb0'))['field']('id',_0xd593('0xac'))[_0xd593('0xae')](_0x2196b5[_0xd593('0xb1')]['toString'](),_0xd593('0xad'))['field'](_0x3e0547[_0xd593('0x55')]['id']['toString'](),_0xd593('0x69'))[_0xd593('0xae')](_0xd593('0xaf'),_0xd593('0x62'))['field'](_0xd593('0xaf'),_0xd593('0x63'))[_0xd593('0x8b')](_0xd593('0xb2'))['where'](_0xd593('0xb3'))[_0xd593('0x4e')](_0xd593('0xb4'),_0x2196b5['CmListId'][_0xd593('0x91')]())[_0xd593('0x4e')]('phone\x20IS\x20NOT\x20NULL'))[_0xd593('0x91')]();}_0x5f35b5[_0xd593('0x9b')](db[_0xd593('0x7b')][_0xd593('0x43')](_0xd6c6a5));}return BPromise[_0xd593('0x95')](_0x5f35b5);}})['then'](function(){return _0x5c0e74;})[_0xd593('0x2c')](respondWithResult(_0x377fee,null))['catch'](handleError(_0x377fee,null));};exports[_0xd593('0xbb')]=function(_0x33ee49,_0x24e436,_0x4217f4){return db[_0xd593('0x3e')][_0xd593('0x37')]({'where':{'id':_0x33ee49[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x24e436,null))['then'](function(_0x52ad1c){if(_0x52ad1c){return _0x52ad1c[_0xd593('0xbb')](_0x33ee49['query']['ids']);}})[_0xd593('0x2c')](function(_0x5afd42){if(_0x5afd42){return db['CmHopper'][_0xd593('0x3a')]({'where':{'ListId':_0x33ee49[_0xd593('0x43')][_0xd593('0x88')],'VoiceQueueId':_0x33ee49[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](function(){return _0x5afd42;});}})[_0xd593('0x2c')](respondWithStatusCode(_0x24e436,null))[_0xd593('0x54')](handleError(_0x24e436,null));};exports[_0xd593('0xbc')]=function(_0x47cd4a,_0x4c8ec8,_0x1f79c5){var _0x55156f={};var _0x294142={};var _0x122bb1;var _0xe45fc9;return db[_0xd593('0x3e')][_0xd593('0x6c')]({'where':{'id':_0x47cd4a['params']['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x4c8ec8,null))[_0xd593('0x2c')](function(_0x10222d){if(_0x10222d){_0x122bb1=_0x10222d;_0x294142[_0xd593('0x42')]=_['keys'](db[_0xd593('0xa3')][_0xd593('0x3f')]);_0x294142[_0xd593('0x43')]=_[_0xd593('0x56')](_0x47cd4a[_0xd593('0x43')]);_0x294142[_0xd593('0x57')]=_[_0xd593('0x45')](_0x294142[_0xd593('0x42')],_0x294142['query']);_0x55156f[_0xd593('0x44')]=_[_0xd593('0x45')](_0x294142[_0xd593('0x42')],qs[_0xd593('0x46')](_0x47cd4a[_0xd593('0x43')][_0xd593('0x46')]));_0x55156f[_0xd593('0x44')]=_0x55156f['attributes'][_0xd593('0x47')]?_0x55156f[_0xd593('0x44')]:_0x294142['model'];_0x55156f[_0xd593('0x4a')]=qs[_0xd593('0x4b')](_0x47cd4a[_0xd593('0x43')][_0xd593('0x4b')]);_0x55156f[_0xd593('0x4e')]=qs[_0xd593('0x57')](_[_0xd593('0x4c')](_0x47cd4a[_0xd593('0x43')],_0x294142[_0xd593('0x57')]));if(_0x47cd4a[_0xd593('0x43')]['filter']){_0x55156f[_0xd593('0x4e')]=_[_0xd593('0x4d')](_0x55156f[_0xd593('0x4e')],{'$or':_[_0xd593('0x34')](_0x55156f[_0xd593('0x44')],function(_0xffba2d){var _0x4462a4={};_0x4462a4[_0xffba2d]={'$like':'%'+_0x47cd4a[_0xd593('0x43')]['filter']+'%'};return _0x4462a4;})});}_0x55156f=_[_0xd593('0x4d')]({},_0x55156f,_0x47cd4a[_0xd593('0x50')]);return _0x122bb1[_0xd593('0xbc')](_0x55156f);}})['then'](function(_0x3cbd03){if(_0x3cbd03){_0xe45fc9=_0x3cbd03[_0xd593('0x47')];if(!_0x47cd4a[_0xd593('0x43')][_0xd593('0x48')](_0xd593('0x49'))){_0x55156f[_0xd593('0x26')]=qs[_0xd593('0x26')](_0x47cd4a[_0xd593('0x43')][_0xd593('0x26')]);_0x55156f[_0xd593('0x25')]=qs[_0xd593('0x25')](_0x47cd4a[_0xd593('0x43')][_0xd593('0x25')]);}return _0x122bb1['getBlackLists'](_0x55156f);}})[_0xd593('0x2c')](function(_0xbd11c2){if(_0xbd11c2){return _0xbd11c2?{'count':_0xe45fc9,'rows':_0xbd11c2}:null;}})[_0xd593('0x2c')](respondWithResult(_0x4c8ec8,null))['catch'](handleError(_0x4c8ec8,null));};exports[_0xd593('0xbd')]=function(_0x3e7d84,_0x3df87a,_0x4de727){var _0x219185,_0x450de8;return db[_0xd593('0x3e')]['find']({'where':{'id':_0x3e7d84[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x3df87a,null))[_0xd593('0x2c')](function(_0x2c60f3){if(_0x2c60f3){_0x450de8=_0x2c60f3;return _0x2c60f3[_0xd593('0xbd')](_0x3e7d84[_0xd593('0x59')]['ids'],_[_0xd593('0x61')](_0x3e7d84[_0xd593('0x59')],['ids','id'])||{});}return null;})[_0xd593('0x9a')](function(_0x2af71f){var _0x1be350;_0x219185=_0x2af71f||[];var _0x11d208=[];if(_0x2af71f){for(var _0x44f01e=0x0;_0x44f01e<_0x2af71f['length'];_0x44f01e+=0x1){var _0x4d3946=_0x2af71f[_0x44f01e][_0xd593('0x2d')]({'plain':!![]});_0x1be350=squel['insert']()[_0xd593('0xa8')](_0xd593('0xbe'))[_0xd593('0xaa')]([_0xd593('0xab'),_0xd593('0xac'),_0xd593('0xad'),_0xd593('0x69'),'createdAt',_0xd593('0x63')],squel[_0xd593('0x8a')]()[_0xd593('0xae')](_0xd593('0xab'),_0xd593('0xab'))[_0xd593('0xae')]('id',_0xd593('0xac'))[_0xd593('0xae')](_0x4d3946[_0xd593('0xb1')][_0xd593('0x91')](),_0xd593('0xad'))[_0xd593('0xae')](_0x3e7d84[_0xd593('0x55')]['id'][_0xd593('0x91')](),'VoiceQueueId')['field'](_0xd593('0xaf'),_0xd593('0x62'))[_0xd593('0xae')](_0xd593('0xaf'),_0xd593('0x63'))[_0xd593('0x8b')](_0xd593('0xb2'))['where'](_0xd593('0xb3'))['where']('ListId\x20=\x20?',_0x4d3946['CmListId'][_0xd593('0x91')]())[_0xd593('0x4e')](_0xd593('0xb5')))[_0xd593('0x91')]();_0x11d208[_0xd593('0x9b')](db[_0xd593('0x7b')][_0xd593('0x43')](_0x1be350));}return BPromise[_0xd593('0x95')](_0x11d208);}})[_0xd593('0x2c')](function(){return _0x219185;})['then'](respondWithResult(_0x3df87a,null))['catch'](handleError(_0x3df87a,null));};exports['removeBlackLists']=function(_0x34b091,_0x4fbda5,_0x452c5b){return db[_0xd593('0x3e')][_0xd593('0x37')]({'where':{'id':_0x34b091[_0xd593('0x55')]['id']}})[_0xd593('0x2c')](handleEntityNotFound(_0x4fbda5,null))['then'](function(_0x51a136){if(_0x51a136){return _0x51a136['removeBlackLists'](_0x34b091[_0xd593('0x43')][_0xd593('0x88')]);}})[_0xd593('0x2c')](function(_0x47bfc0){if(_0x47bfc0){return db[_0xd593('0x70')][_0xd593('0x3a')]({'where':{'ListId':_0x34b091[_0xd593('0x43')][_0xd593('0x88')],'VoiceQueueId':_0x34b091['params']['id']}})[_0xd593('0x2c')](function(){return _0x47bfc0;});}})[_0xd593('0x2c')](respondWithStatusCode(_0x4fbda5,null))[_0xd593('0x54')](handleError(_0x4fbda5,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 8efdf8d..84a89b7 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 _0x5df4=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x517b68,_0x7ed57){var _0x5c57a3=function(_0x26a2a6){while(--_0x26a2a6){_0x517b68['push'](_0x517b68['shift']());}};_0x5c57a3(++_0x7ed57);}(_0x5df4,0x197));var _0x45df=function(_0x5adad4,_0x18fce0){_0x5adad4=_0x5adad4-0x0;var _0x47e6be=_0x5df4[_0x5adad4];return _0x47e6be;};'use strict';var EventEmitter=require(_0x45df('0x0'));var VoiceQueue=require(_0x45df('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x45df('0x2'),'afterUpdate':_0x45df('0x3'),'afterDestroy':_0x45df('0x4')};function emitEvent(_0x393efd){return function(_0x3943e8,_0x5698a1,_0x23365c){VoiceQueueEvents[_0x45df('0x5')](_0x393efd+':'+_0x3943e8['id'],_0x3943e8);VoiceQueueEvents[_0x45df('0x5')](_0x393efd,_0x3943e8);_0x23365c(null);};}for(var e in events){if(events[_0x45df('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x45df('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xc4b5=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x26ae05,_0x53e7ea){var _0x1e8338=function(_0x241a59){while(--_0x241a59){_0x26ae05['push'](_0x26ae05['shift']());}};_0x1e8338(++_0x53e7ea);}(_0xc4b5,0xe2));var _0x5c4b=function(_0x28dc98,_0x22cd45){_0x28dc98=_0x28dc98-0x0;var _0x3adc56=_0xc4b5[_0x28dc98];return _0x3adc56;};'use strict';var EventEmitter=require(_0x5c4b('0x0'));var VoiceQueue=require(_0x5c4b('0x1'))['db'][_0x5c4b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x5c4b('0x3')](0x0);var events={'afterCreate':_0x5c4b('0x4'),'afterUpdate':_0x5c4b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x54dc60){return function(_0x56ff3d,_0x441ae2,_0xda7093){VoiceQueueEvents['emit'](_0x54dc60+':'+_0x56ff3d['id'],_0x56ff3d);VoiceQueueEvents[_0x5c4b('0x6')](_0x54dc60,_0x56ff3d);_0xda7093(null);};}for(var e in events){if(events[_0x5c4b('0x7')](e)){var event=events[e];VoiceQueue[_0x5c4b('0x8')](e,emitEvent(event));}}module[_0x5c4b('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 28f7738..dfb27b9 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x50e5a3,_0x27bd2d){var _0x37e6b3=function(_0x1a67ab){while(--_0x1a67ab){_0x50e5a3['push'](_0x50e5a3['shift']());}};_0x37e6b3(++_0x27bd2d);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x5d20e1,_0x14cc6d){var _0xa3d9a7=function(_0x32a73a){while(--_0x32a73a){_0x5d20e1['push'](_0x5d20e1['shift']());}};_0xa3d9a7(++_0x14cc6d);}(_0x34e8,0x12c));var _0x834e=function(_0x32be3e,_0x1cfe7d){_0x32be3e=_0x32be3e-0x0;var _0x5022e2=_0x34e8[_0x32be3e];return _0x5022e2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index d66a5f0..8308162 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 _0x57de=['../../config/logger','jayson/promise','client','redis','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceQueue','options','raw','attributes','include','map','model','GetVoiceQueue','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x26bc36,_0x95e54){var _0x173490=function(_0xc1dacb){while(--_0xc1dacb){_0x26bc36['push'](_0x26bc36['shift']());}};_0x173490(++_0x95e54);}(_0x57de,0x19d));var _0xe57d=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x57de[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xe57d('0x0'));var util=require(_0xe57d('0x1'));var moment=require(_0xe57d('0x2'));var BPromise=require(_0xe57d('0x3'));var rs=require(_0xe57d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe57d('0x5'))['db'];var utils=require(_0xe57d('0x6'));var logger=require(_0xe57d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe57d('0x8'));var client=jayson[_0xe57d('0x9')]['http']({'port':0x232a});config[_0xe57d('0xa')]=_['defaults'](config[_0xe57d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe57d('0xb'))(new Redis(config[_0xe57d('0xa')]));require(_0xe57d('0xc'))['register'](socket);function respondWithRpcPromise(_0x38e58e,_0x14695b,_0x2d8199){return new BPromise(function(_0x5f063d,_0xd79e77){return client[_0xe57d('0xd')](_0x38e58e,_0x2d8199)[_0xe57d('0xe')](function(_0x5c55bb){logger[_0xe57d('0xf')](_0xe57d('0x10'),_0x14695b,_0xe57d('0x11'));logger[_0xe57d('0x12')](_0xe57d('0x13'),_0x14695b,_0xe57d('0x11'),JSON['stringify'](_0x5c55bb));if(_0x5c55bb['error']){if(_0x5c55bb['error'][_0xe57d('0x14')]===0x1f4){logger[_0xe57d('0x15')](_0xe57d('0x10'),_0x14695b,_0x5c55bb[_0xe57d('0x15')][_0xe57d('0x16')]);return _0xd79e77(_0x5c55bb[_0xe57d('0x15')][_0xe57d('0x16')]);}logger[_0xe57d('0x15')](_0xe57d('0x10'),_0x14695b,_0x5c55bb[_0xe57d('0x15')][_0xe57d('0x16')]);return _0x5f063d(_0x5c55bb['error']['message']);}else{logger['info'](_0xe57d('0x10'),_0x14695b,_0xe57d('0x11'));_0x5f063d(_0x5c55bb[_0xe57d('0x17')]['message']);}})[_0xe57d('0x18')](function(_0x4f1731){logger[_0xe57d('0x15')](_0xe57d('0x10'),_0x14695b,_0x4f1731);_0xd79e77(_0x4f1731);});});}exports['GetVoiceQueue']=function(_0x5c4b55){var _0x33811b=this;return new Promise(function(_0x27dab6,_0x4686ef){return db[_0xe57d('0x19')]['findAll']({'raw':_0x5c4b55[_0xe57d('0x1a')]?_0x5c4b55[_0xe57d('0x1a')][_0xe57d('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c4b55[_0xe57d('0x1a')]?_0x5c4b55[_0xe57d('0x1a')]['where']||null:null,'attributes':_0x5c4b55[_0xe57d('0x1a')]?_0x5c4b55['options'][_0xe57d('0x1c')]||null:null,'limit':_0x5c4b55['options']?_0x5c4b55[_0xe57d('0x1a')]['limit']||null:null,'include':_0x5c4b55['options']?_0x5c4b55[_0xe57d('0x1a')][_0xe57d('0x1d')]?_[_0xe57d('0x1e')](_0x5c4b55[_0xe57d('0x1a')][_0xe57d('0x1d')],function(_0x52a3e8){return{'model':db[_0x52a3e8[_0xe57d('0x1f')]],'as':_0x52a3e8['as'],'attributes':_0x52a3e8['attributes'],'include':_0x52a3e8['include']?_[_0xe57d('0x1e')](_0x52a3e8['include'],function(_0x17bc12){return{'model':db[_0x17bc12[_0xe57d('0x1f')]],'as':_0x17bc12['as'],'attributes':_0x17bc12[_0xe57d('0x1c')],'include':_0x17bc12[_0xe57d('0x1d')]?_[_0xe57d('0x1e')](_0x17bc12[_0xe57d('0x1d')],function(_0x2cb1a4){return{'model':db[_0x2cb1a4[_0xe57d('0x1f')]],'as':_0x2cb1a4['as'],'attributes':_0x2cb1a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xe57d('0xe')](function(_0x3c3241){logger[_0xe57d('0xf')](_0xe57d('0x20'),_0x5c4b55);logger['debug'](_0xe57d('0x20'),_0x5c4b55,JSON['stringify'](_0x3c3241));_0x27dab6(_0x3c3241);})['catch'](function(_0x1f01eb){logger['error'](_0xe57d('0x20'),_0x1f01eb[_0xe57d('0x16')],_0x5c4b55);_0x4686ef(_0x33811b[_0xe57d('0x15')](0x1f4,_0x1f01eb[_0xe57d('0x16')]));});});};exports[_0xe57d('0x21')]=function(_0x4401d9){var _0x443d82=this;return new Promise(function(_0x47a6f3,_0x1e5e5b){return db[_0xe57d('0x19')][_0xe57d('0x22')]({'raw':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9[_0xe57d('0x1a')][_0xe57d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9['options']['where']||null:null,'attributes':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9[_0xe57d('0x1a')]['attributes']||null:null,'include':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9['options'][_0xe57d('0x1d')]?_[_0xe57d('0x1e')](_0x4401d9['options'][_0xe57d('0x1d')],function(_0xdc6a47){return{'model':db[_0xdc6a47[_0xe57d('0x1f')]],'as':_0xdc6a47['as'],'attributes':_0xdc6a47[_0xe57d('0x1c')],'include':_0xdc6a47['include']?_[_0xe57d('0x1e')](_0xdc6a47[_0xe57d('0x1d')],function(_0x9a546d){return{'model':db[_0x9a546d[_0xe57d('0x1f')]],'as':_0x9a546d['as'],'attributes':_0x9a546d[_0xe57d('0x1c')],'include':_0x9a546d['include']?_[_0xe57d('0x1e')](_0x9a546d['include'],function(_0x27f6ae){return{'model':db[_0x27f6ae[_0xe57d('0x1f')]],'as':_0x27f6ae['as'],'attributes':_0x27f6ae[_0xe57d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b1fbb){logger[_0xe57d('0xf')]('ShowVoiceQueue',_0x4401d9);logger['debug'](_0xe57d('0x21'),_0x4401d9,JSON['stringify'](_0x3b1fbb));_0x47a6f3(_0x3b1fbb);})[_0xe57d('0x18')](function(_0x27df1b){logger[_0xe57d('0x15')](_0xe57d('0x21'),_0x27df1b[_0xe57d('0x16')],_0x4401d9);_0x1e5e5b(_0x443d82[_0xe57d('0x15')](0x1f4,_0x27df1b[_0xe57d('0x16')]));});});}; \ No newline at end of file +var _0x6ed1=['debug','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','include','model','map','stringify','ShowVoiceQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./voiceQueue.socket','request','then','request\x20sent'];(function(_0x276993,_0x340745){var _0x1f6207=function(_0x27e94e){while(--_0x27e94e){_0x276993['push'](_0x276993['shift']());}};_0x1f6207(++_0x340745);}(_0x6ed1,0x12a));var _0x16ed=function(_0x2af0bd,_0x30c3ac){_0x2af0bd=_0x2af0bd-0x0;var _0x1f52cd=_0x6ed1[_0x2af0bd];return _0x1f52cd;};'use strict';var _=require(_0x16ed('0x0'));var util=require('util');var moment=require(_0x16ed('0x1'));var BPromise=require(_0x16ed('0x2'));var rs=require(_0x16ed('0x3'));var fs=require('fs');var Redis=require(_0x16ed('0x4'));var db=require(_0x16ed('0x5'))['db'];var utils=require(_0x16ed('0x6'));var logger=require(_0x16ed('0x7'))(_0x16ed('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x16ed('0x9')][_0x16ed('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x16ed('0xb')],{'host':_0x16ed('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x16ed('0xb')]));require(_0x16ed('0xd'))['register'](socket);function respondWithRpcPromise(_0x383429,_0x32dc6d,_0x369c70){return new BPromise(function(_0x274950,_0x420043){return client[_0x16ed('0xe')](_0x383429,_0x369c70)[_0x16ed('0xf')](function(_0x46fc48){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x32dc6d,_0x16ed('0x10'));logger[_0x16ed('0x11')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x32dc6d,_0x16ed('0x10'),JSON['stringify'](_0x46fc48));if(_0x46fc48[_0x16ed('0x12')]){if(_0x46fc48[_0x16ed('0x12')]['code']===0x1f4){logger[_0x16ed('0x12')](_0x16ed('0x13'),_0x32dc6d,_0x46fc48['error'][_0x16ed('0x14')]);return _0x420043(_0x46fc48[_0x16ed('0x12')][_0x16ed('0x14')]);}logger[_0x16ed('0x12')](_0x16ed('0x13'),_0x32dc6d,_0x46fc48['error'][_0x16ed('0x14')]);return _0x274950(_0x46fc48[_0x16ed('0x12')][_0x16ed('0x14')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x32dc6d,_0x16ed('0x10'));_0x274950(_0x46fc48[_0x16ed('0x15')][_0x16ed('0x14')]);}})[_0x16ed('0x16')](function(_0xfcb357){logger[_0x16ed('0x12')](_0x16ed('0x13'),_0x32dc6d,_0xfcb357);_0x420043(_0xfcb357);});});}exports[_0x16ed('0x17')]=function(_0xba9b9e){var _0x16260b=this;return new Promise(function(_0x293c4b,_0x4fa976){return db['VoiceQueue'][_0x16ed('0x18')]({'raw':_0xba9b9e[_0x16ed('0x19')]?_0xba9b9e[_0x16ed('0x19')][_0x16ed('0x1a')]===undefined?!![]:![]:!![],'where':_0xba9b9e[_0x16ed('0x19')]?_0xba9b9e[_0x16ed('0x19')][_0x16ed('0x1b')]||null:null,'attributes':_0xba9b9e['options']?_0xba9b9e[_0x16ed('0x19')][_0x16ed('0x1c')]||null:null,'limit':_0xba9b9e[_0x16ed('0x19')]?_0xba9b9e[_0x16ed('0x19')]['limit']||null:null,'include':_0xba9b9e['options']?_0xba9b9e[_0x16ed('0x19')][_0x16ed('0x1d')]?_['map'](_0xba9b9e[_0x16ed('0x19')][_0x16ed('0x1d')],function(_0x460764){return{'model':db[_0x460764[_0x16ed('0x1e')]],'as':_0x460764['as'],'attributes':_0x460764[_0x16ed('0x1c')],'include':_0x460764[_0x16ed('0x1d')]?_['map'](_0x460764[_0x16ed('0x1d')],function(_0x281e30){return{'model':db[_0x281e30['model']],'as':_0x281e30['as'],'attributes':_0x281e30[_0x16ed('0x1c')],'include':_0x281e30[_0x16ed('0x1d')]?_[_0x16ed('0x1f')](_0x281e30['include'],function(_0xfba0eb){return{'model':db[_0xfba0eb[_0x16ed('0x1e')]],'as':_0xfba0eb['as'],'attributes':_0xfba0eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x16ed('0xf')](function(_0xc0364a){logger['info'](_0x16ed('0x17'),_0xba9b9e);logger[_0x16ed('0x11')](_0x16ed('0x17'),_0xba9b9e,JSON[_0x16ed('0x20')](_0xc0364a));_0x293c4b(_0xc0364a);})[_0x16ed('0x16')](function(_0x11ac0d){logger[_0x16ed('0x12')](_0x16ed('0x17'),_0x11ac0d[_0x16ed('0x14')],_0xba9b9e);_0x4fa976(_0x16260b[_0x16ed('0x12')](0x1f4,_0x11ac0d[_0x16ed('0x14')]));});});};exports[_0x16ed('0x21')]=function(_0x45a43b){var _0x3e45a9=this;return new Promise(function(_0x30a261,_0x21dee1){return db['VoiceQueue'][_0x16ed('0x22')]({'raw':_0x45a43b['options']?_0x45a43b[_0x16ed('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x45a43b[_0x16ed('0x19')]?_0x45a43b[_0x16ed('0x19')][_0x16ed('0x1b')]||null:null,'attributes':_0x45a43b[_0x16ed('0x19')]?_0x45a43b[_0x16ed('0x19')][_0x16ed('0x1c')]||null:null,'include':_0x45a43b[_0x16ed('0x19')]?_0x45a43b[_0x16ed('0x19')][_0x16ed('0x1d')]?_['map'](_0x45a43b[_0x16ed('0x19')][_0x16ed('0x1d')],function(_0x21e9ae){return{'model':db[_0x21e9ae['model']],'as':_0x21e9ae['as'],'attributes':_0x21e9ae[_0x16ed('0x1c')],'include':_0x21e9ae[_0x16ed('0x1d')]?_[_0x16ed('0x1f')](_0x21e9ae[_0x16ed('0x1d')],function(_0x481009){return{'model':db[_0x481009[_0x16ed('0x1e')]],'as':_0x481009['as'],'attributes':_0x481009['attributes'],'include':_0x481009[_0x16ed('0x1d')]?_[_0x16ed('0x1f')](_0x481009['include'],function(_0x522d5d){return{'model':db[_0x522d5d['model']],'as':_0x522d5d['as'],'attributes':_0x522d5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x16ed('0xf')](function(_0x4870ef){logger['info'](_0x16ed('0x21'),_0x45a43b);logger[_0x16ed('0x11')]('ShowVoiceQueue',_0x45a43b,JSON['stringify'](_0x4870ef));_0x30a261(_0x4870ef);})[_0x16ed('0x16')](function(_0x5c7c49){logger[_0x16ed('0x12')](_0x16ed('0x21'),_0x5c7c49['message'],_0x45a43b);_0x21dee1(_0x3e45a9[_0x16ed('0x12')](0x1f4,_0x5c7c49[_0x16ed('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index baf5913..cc3f272 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 _0x2f79=['./voiceQueue.events','save','remove','update','removeListener','register'];(function(_0x371cbb,_0x3ffcba){var _0x5ea45d=function(_0x370c53){while(--_0x370c53){_0x371cbb['push'](_0x371cbb['shift']());}};_0x5ea45d(++_0x3ffcba);}(_0x2f79,0x186));var _0x92f7=function(_0x187b01,_0x5d27a6){_0x187b01=_0x187b01-0x0;var _0x3f0877=_0x2f79[_0x187b01];return _0x3f0877;};'use strict';var VoiceQueueEvents=require(_0x92f7('0x0'));var events=[_0x92f7('0x1'),_0x92f7('0x2'),_0x92f7('0x3')];function createListener(_0x7ca03e,_0x5ba378){return function(_0x520903){_0x5ba378['emit'](_0x7ca03e,_0x520903);};}function removeListener(_0x403152,_0xc1842f){return function(){VoiceQueueEvents[_0x92f7('0x4')](_0x403152,_0xc1842f);};}exports[_0x92f7('0x5')]=function(_0x191ae3){for(var _0x58385f=0x0,_0x2563ed=events['length'];_0x58385f<_0x2563ed;_0x58385f++){var _0x55ffc6=events[_0x58385f];var _0x3d35a2=createListener('voiceQueue:'+_0x55ffc6,_0x191ae3);VoiceQueueEvents['on'](_0x55ffc6,_0x3d35a2);}}; \ No newline at end of file +var _0x71dd=['register','length','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x4f2469,_0x3f0501){var _0x48aa8d=function(_0x6d7330){while(--_0x6d7330){_0x4f2469['push'](_0x4f2469['shift']());}};_0x48aa8d(++_0x3f0501);}(_0x71dd,0x182));var _0xd71d=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x71dd[_0xf79bae];return _0x5d2cb7;};'use strict';var VoiceQueueEvents=require(_0xd71d('0x0'));var events=[_0xd71d('0x1'),_0xd71d('0x2'),_0xd71d('0x3')];function createListener(_0x3fc46b,_0x3271c9){return function(_0x135013){_0x3271c9[_0xd71d('0x4')](_0x3fc46b,_0x135013);};}function removeListener(_0x56f653,_0x496a5c){return function(){VoiceQueueEvents[_0xd71d('0x5')](_0x56f653,_0x496a5c);};}exports[_0xd71d('0x6')]=function(_0x58c683){for(var _0x389e68=0x0,_0x40ddfe=events[_0xd71d('0x7')];_0x389e68<_0x40ddfe;_0x389e68++){var _0x624e4d=events[_0x389e68];var _0x2c6978=createListener('voiceQueue:'+_0x624e4d,_0x58c683);VoiceQueueEvents['on'](_0x624e4d,_0x2c6978);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index c365e6d..1cf55c2 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 _0xe600=['isAuthenticated','index','/describe','getVoiceQueuesReport','post','create','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xe600,0x160));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x0e60('0x0'));var path=require(_0x0e60('0x1'));var timeout=require(_0x0e60('0x2'));var express=require(_0x0e60('0x3'));var router=express[_0x0e60('0x4')]();var fs_extra=require(_0x0e60('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e60('0x6'));var controller=require(_0x0e60('0x7'));router[_0x0e60('0x8')]('/',auth[_0x0e60('0x9')](),controller[_0x0e60('0xa')]);router[_0x0e60('0x8')](_0x0e60('0xb'),auth[_0x0e60('0x9')](),controller['describe']);router[_0x0e60('0x8')]('/index',auth['isAuthenticated'](),controller[_0x0e60('0xc')]);router[_0x0e60('0x8')]('/:id',auth[_0x0e60('0x9')](),controller['show']);router[_0x0e60('0xd')]('/',auth[_0x0e60('0x9')](),controller[_0x0e60('0xe')]);router['put']('/:id',auth[_0x0e60('0x9')](),controller[_0x0e60('0xf')]);router[_0x0e60('0x10')](_0x0e60('0x11'),auth[_0x0e60('0x9')](),controller[_0x0e60('0x12')]);module['exports']=router; \ No newline at end of file +var _0x294a=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','describe','/index','getVoiceQueuesReport','/:id','post'];(function(_0x11ae16,_0xc4e958){var _0x19c76f=function(_0x20cb29){while(--_0x20cb29){_0x11ae16['push'](_0x11ae16['shift']());}};_0x19c76f(++_0xc4e958);}(_0x294a,0x74));var _0xa294=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x294a[_0x11f249];return _0x5c3656;};'use strict';var multer=require(_0xa294('0x0'));var util=require(_0xa294('0x1'));var path=require(_0xa294('0x2'));var timeout=require('connect-timeout');var express=require(_0xa294('0x3'));var router=express[_0xa294('0x4')]();var fs_extra=require(_0xa294('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa294('0x6'));var controller=require(_0xa294('0x7'));router['get']('/',auth[_0xa294('0x8')](),controller[_0xa294('0x9')]);router[_0xa294('0xa')]('/describe',auth[_0xa294('0x8')](),controller[_0xa294('0xb')]);router[_0xa294('0xa')](_0xa294('0xc'),auth[_0xa294('0x8')](),controller[_0xa294('0xd')]);router['get'](_0xa294('0xe'),auth[_0xa294('0x8')](),controller['show']);router[_0xa294('0xf')]('/',auth['isAuthenticated'](),controller[_0xa294('0x10')]);router[_0xa294('0x11')]('/:id',auth[_0xa294('0x8')](),controller[_0xa294('0x12')]);router[_0xa294('0x13')]('/:id',auth[_0xa294('0x8')](),controller[_0xa294('0x14')]);module[_0xa294('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index bc03b5d..fe17d9f 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 _0x34b8=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','BOOLEAN','DATE'];(function(_0x15b5cc,_0xf678db){var _0x5893c1=function(_0x1e3336){while(--_0x1e3336){_0x15b5cc['push'](_0x15b5cc['shift']());}};_0x5893c1(++_0xf678db);}(_0x34b8,0x179));var _0x834b=function(_0x4d2910,_0xbd72f){_0x4d2910=_0x4d2910-0x0;var _0x2f1e0c=_0x34b8[_0x4d2910];return _0x2f1e0c;};'use strict';var Sequelize=require(_0x834b('0x0'));var moment=require(_0x834b('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x834b('0x2')]},'calleridnum':{'type':Sequelize[_0x834b('0x2')]},'calleridname':{'type':Sequelize[_0x834b('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x57c405){var _0x165cd5=moment(_0x57c405);var _0x4d41c6=moment(this[_0x834b('0x3')](_0x834b('0x4')))[_0x834b('0x5')](_0x834b('0x6'));var _0x39c3d3=_0x165cd5[_0x834b('0x7')](_0x4d41c6,_0x834b('0x8'));this['setDataValue'](_0x834b('0x9'),_0x57c405);this[_0x834b('0xa')](_0x834b('0xb'),_0x39c3d3||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x834b('0xd')]},'queuecallercomplete':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x834b('0xd')]},'queuecallerexitreason':{'type':Sequelize[_0x834b('0x2')],'comment':_0x834b('0xe')},'originalposition':{'type':Sequelize[_0x834b('0xf')]},'channel':{'type':Sequelize[_0x834b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x834b('0x2')]},'accountcode':{'type':Sequelize[_0x834b('0x2')]},'context':{'type':Sequelize[_0x834b('0x2')]},'exten':{'type':Sequelize[_0x834b('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x834b('0xf')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x834b('0x2')],'comment':_0x834b('0x10')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x834b('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x834b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x834b('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x834b('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1bab=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x3a37c1,_0x417c91){var _0xb8c98f=function(_0x488f95){while(--_0x488f95){_0x3a37c1['push'](_0x3a37c1['shift']());}};_0xb8c98f(++_0x417c91);}(_0x1bab,0x161));var _0xb1ba=function(_0x2c0ce3,_0x250e94){_0x2c0ce3=_0x2c0ce3-0x0;var _0xcaf9f1=_0x1bab[_0x2c0ce3];return _0xcaf9f1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb1ba('0x0'));module[_0xb1ba('0x1')]={'type':{'type':Sequelize[_0xb1ba('0x2')]},'uniqueid':{'type':Sequelize[_0xb1ba('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb1ba('0x2')]},'queue':{'type':Sequelize[_0xb1ba('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xb1ba('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xb1ba('0x3')],'set':function(_0x526f02){var _0x1f91fc=moment(_0x526f02);var _0x71a186=moment(this[_0xb1ba('0x4')]('queuecallerjoinAt'))['format'](_0xb1ba('0x5'));var _0x16e6b6=_0x1f91fc[_0xb1ba('0x6')](_0x71a186,'seconds');this[_0xb1ba('0x7')](_0xb1ba('0x8'),_0x526f02);this[_0xb1ba('0x7')](_0xb1ba('0x9'),_0x16e6b6||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xb1ba('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb1ba('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xb1ba('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb1ba('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xb1ba('0x2')],'comment':_0xb1ba('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xb1ba('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb1ba('0x2')]},'accountcode':{'type':Sequelize[_0xb1ba('0x2')]},'context':{'type':Sequelize[_0xb1ba('0x2')]},'exten':{'type':Sequelize[_0xb1ba('0x2')]},'priority':{'type':Sequelize[_0xb1ba('0x2')]},'holdtime':{'type':Sequelize[_0xb1ba('0xa')]},'mohtime':{'type':Sequelize[_0xb1ba('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb1ba('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb1ba('0x2')]},'transfer':{'type':Sequelize[_0xb1ba('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb1ba('0x2')],'comment':_0xb1ba('0xd')},'transferexten':{'type':Sequelize[_0xb1ba('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb1ba('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb1ba('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xb1ba('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 c8247fc..d261324 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 _0x1e2c=['../../config/environment','../../config/license/util','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','VoiceQueueReport','findAll','rows','catch','show','params','length','find','create','body','describe','getVoiceQueuesReport','keys','pick','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x1e2c,0x90));var _0xc1e2=function(_0x20b000,_0x6befba){_0x20b000=_0x20b000-0x0;var _0x3cae2b=_0x1e2c[_0x20b000];return _0x3cae2b;};'use strict';var emlformat=require(_0xc1e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1e2('0x2'));var moment=require(_0xc1e2('0x3'));var BPromise=require(_0xc1e2('0x4'));var Mustache=require(_0xc1e2('0x5'));var util=require(_0xc1e2('0x6'));var path=require(_0xc1e2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc1e2('0x8'));var fs=require('fs');var fs_extra=require(_0xc1e2('0x9'));var _=require(_0xc1e2('0xa'));var squel=require(_0xc1e2('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1e2('0xc'));var deskjs=require(_0xc1e2('0xd'));var toCsv=require(_0xc1e2('0xe'));var querystring=require(_0xc1e2('0xf'));var Papa=require(_0xc1e2('0x10'));var Redis=require(_0xc1e2('0x11'));var authService=require(_0xc1e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc1e2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1e2('0x14'))('api');var utils=require(_0xc1e2('0x15'));var config=require(_0xc1e2('0x16'));var licenseUtil=require(_0xc1e2('0x17'));var db=require('../../mysqldb')['db'];config[_0xc1e2('0x18')]=_[_0xc1e2('0x19')](config[_0xc1e2('0x18')],{'host':_0xc1e2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1e2('0x18')]));require(_0xc1e2('0x1b'))[_0xc1e2('0x1c')](socket);function respondWithStatusCode(_0x43aea4,_0x24ebb4){_0x24ebb4=_0x24ebb4||0xcc;return function(_0x40fdd2){if(_0x40fdd2){return _0x43aea4[_0xc1e2('0x1d')](_0x24ebb4);}return _0x43aea4[_0xc1e2('0x1e')](_0x24ebb4)[_0xc1e2('0x1f')]();};}function respondWithResult(_0x2d94e7,_0x230775){_0x230775=_0x230775||0xc8;return function(_0x23106a){if(_0x23106a){return _0x2d94e7[_0xc1e2('0x1e')](_0x230775)[_0xc1e2('0x20')](_0x23106a);}};}function respondWithFilteredResult(_0x47b505,_0x57c2bf){return function(_0x345f89){if(_0x345f89){var _0x10ce85=typeof _0x57c2bf['offset']===_0xc1e2('0x21')&&typeof _0x57c2bf[_0xc1e2('0x22')]===_0xc1e2('0x21');var _0x423551=_0x345f89[_0xc1e2('0x23')];var _0xb44672=_0x10ce85?0x0:_0x57c2bf[_0xc1e2('0x24')];var _0x18bd10=_0x10ce85?_0x345f89[_0xc1e2('0x23')]:_0x57c2bf[_0xc1e2('0x24')]+_0x57c2bf[_0xc1e2('0x22')];var _0x24c0cf;if(_0x18bd10>=_0x423551){_0x18bd10=_0x423551;_0x24c0cf=0xc8;}else{_0x24c0cf=0xce;}_0x47b505[_0xc1e2('0x1e')](_0x24c0cf);return _0x47b505['set'](_0xc1e2('0x25'),_0xb44672+'-'+_0x18bd10+'/'+_0x423551)[_0xc1e2('0x20')](_0x345f89);}return null;};}function patchUpdates(_0x556cb3){return function(_0x4dae18){try{jsonpatch[_0xc1e2('0x26')](_0x4dae18,_0x556cb3,!![]);}catch(_0x3821ad){return BPromise[_0xc1e2('0x27')](_0x3821ad);}return _0x4dae18[_0xc1e2('0x28')]();};}function saveUpdates(_0x16e8e6,_0xfed21c){return function(_0x1f5dce){if(_0x1f5dce){return _0x1f5dce[_0xc1e2('0x29')](_0x16e8e6)[_0xc1e2('0x2a')](function(_0x2ddfcd){return _0x2ddfcd;});}return null;};}function removeEntity(_0x305a0a,_0x7739ed){return function(_0x3f4e88){if(_0x3f4e88){return _0x3f4e88[_0xc1e2('0x2b')]()[_0xc1e2('0x2a')](function(){_0x305a0a[_0xc1e2('0x1e')](0xcc)[_0xc1e2('0x1f')]();});}};}function handleEntityNotFound(_0x536e5a,_0x477939){return function(_0x33da5e){if(!_0x33da5e){_0x536e5a[_0xc1e2('0x1d')](0x194);}return _0x33da5e;};}function handleError(_0x585ac5,_0x53c330){_0x53c330=_0x53c330||0x1f4;return function(_0x356a0f){logger['error'](_0x356a0f[_0xc1e2('0x2c')]);if(_0x356a0f[_0xc1e2('0x2d')]){delete _0x356a0f['name'];}_0x585ac5[_0xc1e2('0x1e')](_0x53c330)[_0xc1e2('0x2e')](_0x356a0f);};}exports[_0xc1e2('0x2f')]=function(_0x2ecd38,_0x619314){var _0x140092={},_0x1063a2={},_0xf15f49={'count':0x0,'rows':[]};var _0xe0a914=_[_0xc1e2('0x30')](db['VoiceQueueReport'][_0xc1e2('0x31')],function(_0x136cb1){return{'name':_0x136cb1[_0xc1e2('0x32')],'type':_0x136cb1['type'][_0xc1e2('0x33')]};});_0x1063a2[_0xc1e2('0x34')]=_[_0xc1e2('0x30')](_0xe0a914,'name');_0x1063a2[_0xc1e2('0x35')]=_['keys'](_0x2ecd38['query']);_0x1063a2[_0xc1e2('0x36')]=_[_0xc1e2('0x37')](_0x1063a2[_0xc1e2('0x34')],_0x1063a2[_0xc1e2('0x35')]);_0x140092[_0xc1e2('0x38')]=_[_0xc1e2('0x37')](_0x1063a2[_0xc1e2('0x34')],qs[_0xc1e2('0x39')](_0x2ecd38[_0xc1e2('0x35')]['fields']));_0x140092['attributes']=_0x140092[_0xc1e2('0x38')]['length']?_0x140092[_0xc1e2('0x38')]:_0x1063a2['model'];if(!_0x2ecd38['query'][_0xc1e2('0x3a')](_0xc1e2('0x3b'))){_0x140092['limit']=qs[_0xc1e2('0x22')](_0x2ecd38['query'][_0xc1e2('0x22')]);_0x140092[_0xc1e2('0x24')]=qs[_0xc1e2('0x24')](_0x2ecd38['query'][_0xc1e2('0x24')]);}_0x140092['order']=qs[_0xc1e2('0x3c')](_0x2ecd38['query'][_0xc1e2('0x3c')]);_0x140092[_0xc1e2('0x3d')]=qs['filters'](_['pick'](_0x2ecd38[_0xc1e2('0x35')],_0x1063a2[_0xc1e2('0x36')]),_0xe0a914);if(_0x2ecd38[_0xc1e2('0x35')][_0xc1e2('0x3e')]){_0x140092[_0xc1e2('0x3d')]=_[_0xc1e2('0x3f')](_0x140092['where'],{'$or':_[_0xc1e2('0x30')](_0xe0a914,function(_0x4f0e7e){if(_0x4f0e7e[_0xc1e2('0x40')]!==_0xc1e2('0x41')){var _0x4256e2={};_0x4256e2[_0x4f0e7e['name']]={'$like':'%'+_0x2ecd38['query']['filter']+'%'};return _0x4256e2;}})});}_0x140092=_['merge']({},_0x140092,_0x2ecd38[_0xc1e2('0x42')]);var _0x52975d={'where':_0x140092[_0xc1e2('0x3d')]};return db['VoiceQueueReport']['count'](_0x52975d)[_0xc1e2('0x2a')](function(_0x436fe2){_0xf15f49[_0xc1e2('0x23')]=_0x436fe2;if(_0x2ecd38[_0xc1e2('0x35')][_0xc1e2('0x43')]){_0x140092[_0xc1e2('0x44')]=[{'all':!![]}];}return db[_0xc1e2('0x45')][_0xc1e2('0x46')](_0x140092);})['then'](function(_0x542937){_0xf15f49[_0xc1e2('0x47')]=_0x542937;return _0xf15f49;})[_0xc1e2('0x2a')](respondWithFilteredResult(_0x619314,_0x140092))[_0xc1e2('0x48')](handleError(_0x619314,null));};exports[_0xc1e2('0x49')]=function(_0x2ed7dc,_0x4e25d1){var _0x2d1752={'raw':![],'where':{'id':_0x2ed7dc[_0xc1e2('0x4a')]['id']}},_0x256482={};_0x256482[_0xc1e2('0x34')]=_['keys'](db['VoiceQueueReport']['rawAttributes']);_0x256482[_0xc1e2('0x35')]=_['keys'](_0x2ed7dc[_0xc1e2('0x35')]);_0x256482['filters']=_[_0xc1e2('0x37')](_0x256482[_0xc1e2('0x34')],_0x256482[_0xc1e2('0x35')]);_0x2d1752[_0xc1e2('0x38')]=_[_0xc1e2('0x37')](_0x256482[_0xc1e2('0x34')],qs[_0xc1e2('0x39')](_0x2ed7dc[_0xc1e2('0x35')][_0xc1e2('0x39')]));_0x2d1752[_0xc1e2('0x38')]=_0x2d1752[_0xc1e2('0x38')][_0xc1e2('0x4b')]?_0x2d1752['attributes']:_0x256482['model'];if(_0x2ed7dc[_0xc1e2('0x35')][_0xc1e2('0x43')]){_0x2d1752['include']=[{'all':!![]}];}_0x2d1752=_[_0xc1e2('0x3f')]({},_0x2d1752,_0x2ed7dc['options']);return db[_0xc1e2('0x45')][_0xc1e2('0x4c')](_0x2d1752)[_0xc1e2('0x2a')](handleEntityNotFound(_0x4e25d1,null))['then'](respondWithResult(_0x4e25d1,null))[_0xc1e2('0x48')](handleError(_0x4e25d1,null));};exports[_0xc1e2('0x4d')]=function(_0x393488,_0x33c884){return db[_0xc1e2('0x45')][_0xc1e2('0x4d')](_0x393488[_0xc1e2('0x4e')],{})['then'](respondWithResult(_0x33c884,0xc9))[_0xc1e2('0x48')](handleError(_0x33c884,null));};exports[_0xc1e2('0x29')]=function(_0x344caf,_0x261f34){if(_0x344caf[_0xc1e2('0x4e')]['id']){delete _0x344caf[_0xc1e2('0x4e')]['id'];}return db[_0xc1e2('0x45')][_0xc1e2('0x4c')]({'where':{'id':_0x344caf[_0xc1e2('0x4a')]['id']}})[_0xc1e2('0x2a')](handleEntityNotFound(_0x261f34,null))[_0xc1e2('0x2a')](saveUpdates(_0x344caf[_0xc1e2('0x4e')],null))[_0xc1e2('0x2a')](respondWithResult(_0x261f34,null))[_0xc1e2('0x48')](handleError(_0x261f34,null));};exports[_0xc1e2('0x2b')]=function(_0x2eb5e0,_0x595ae5){return db[_0xc1e2('0x45')]['find']({'where':{'id':_0x2eb5e0[_0xc1e2('0x4a')]['id']}})[_0xc1e2('0x2a')](handleEntityNotFound(_0x595ae5,null))[_0xc1e2('0x2a')](removeEntity(_0x595ae5,null))[_0xc1e2('0x48')](handleError(_0x595ae5,null));};exports[_0xc1e2('0x4f')]=function(_0x193e8a,_0x343788){return db[_0xc1e2('0x45')]['describe']()['then'](respondWithResult(_0x343788,null))['catch'](handleError(_0x343788,null));};exports[_0xc1e2('0x50')]=function(_0x261e1d,_0x307538){var _0x4ce1be={},_0x1f8b5a={},_0x214f04={'count':0x0,'rows':[]};_0x1f8b5a[_0xc1e2('0x34')]=_[_0xc1e2('0x51')](db['VoiceQueueReport']['rawAttributes']);_0x1f8b5a[_0xc1e2('0x35')]=_['keys'](_0x261e1d['query']);_0x1f8b5a['filters']=_['intersection'](_0x1f8b5a[_0xc1e2('0x34')],_0x1f8b5a['query']);_0x4ce1be[_0xc1e2('0x38')]=_['intersection'](_0x1f8b5a['model'],qs[_0xc1e2('0x39')](_0x261e1d['query'][_0xc1e2('0x39')]));_0x4ce1be['attributes']=_0x4ce1be[_0xc1e2('0x38')][_0xc1e2('0x4b')]?_0x4ce1be[_0xc1e2('0x38')]:_0x1f8b5a[_0xc1e2('0x34')];if(!_0x261e1d[_0xc1e2('0x35')]['hasOwnProperty'](_0xc1e2('0x3b'))){_0x4ce1be[_0xc1e2('0x22')]=qs[_0xc1e2('0x22')](_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x22')]);_0x4ce1be['offset']=qs[_0xc1e2('0x24')](_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x24')]);}_0x4ce1be['order']=qs[_0xc1e2('0x3c')](_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x3c')]);_0x4ce1be[_0xc1e2('0x3d')]=qs[_0xc1e2('0x36')](_[_0xc1e2('0x52')](_0x261e1d[_0xc1e2('0x35')],_0x1f8b5a[_0xc1e2('0x36')]));if(_0x261e1d[_0xc1e2('0x35')]['filter']){_0x4ce1be[_0xc1e2('0x3d')]=_[_0xc1e2('0x3f')](_0x4ce1be[_0xc1e2('0x3d')],{'$or':_[_0xc1e2('0x30')](_0x4ce1be['attributes'],function(_0x20b767){var _0x14792d={};_0x14792d[_0x20b767]={'$like':'%'+_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x3e')]+'%'};return _0x14792d;})});}_0x4ce1be=_[_0xc1e2('0x3f')]({},_0x4ce1be,_0x261e1d[_0xc1e2('0x42')]);var _0x515ff8={'where':_0x4ce1be[_0xc1e2('0x3d')]};return db['VoiceQueueReport'][_0xc1e2('0x23')](_0x515ff8)[_0xc1e2('0x2a')](function(_0xd74b71){_0x214f04[_0xc1e2('0x23')]=_0xd74b71;if(_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x43')]){_0x4ce1be['include']=[{'all':!![]}];}return db[_0xc1e2('0x45')][_0xc1e2('0x46')](_0x4ce1be);})[_0xc1e2('0x2a')](function(_0x4c017e){_0x214f04[_0xc1e2('0x47')]=_0x4c017e;return _0x214f04;})[_0xc1e2('0x2a')](respondWithFilteredResult(_0x307538,_0x4ce1be,_0xc1e2('0x50')))[_0xc1e2('0x48')](handleError(_0x307538,null,_0xc1e2('0x50')));}; \ No newline at end of file +var _0xb5fa=['length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','VoiceQueueReport','catch','show','params','keys','fields','find','create','body','describe','getVoiceQueuesReport','pick','findAll','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes'];(function(_0x77caa1,_0x134837){var _0x479c24=function(_0x338176){while(--_0x338176){_0x77caa1['push'](_0x77caa1['shift']());}};_0x479c24(++_0x134837);}(_0xb5fa,0x1bd));var _0xab5f=function(_0x24485a,_0xb2bcc4){_0x24485a=_0x24485a-0x0;var _0x45cf5f=_0xb5fa[_0x24485a];return _0x45cf5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab5f('0x0'));var zipdir=require(_0xab5f('0x1'));var jsonpatch=require(_0xab5f('0x2'));var rp=require(_0xab5f('0x3'));var moment=require(_0xab5f('0x4'));var BPromise=require(_0xab5f('0x5'));var Mustache=require(_0xab5f('0x6'));var util=require(_0xab5f('0x7'));var path=require(_0xab5f('0x8'));var sox=require(_0xab5f('0x9'));var csv=require(_0xab5f('0xa'));var ejs=require(_0xab5f('0xb'));var fs=require('fs');var fs_extra=require(_0xab5f('0xc'));var _=require(_0xab5f('0xd'));var squel=require(_0xab5f('0xe'));var crypto=require(_0xab5f('0xf'));var jsforce=require(_0xab5f('0x10'));var deskjs=require(_0xab5f('0x11'));var toCsv=require(_0xab5f('0xa'));var querystring=require(_0xab5f('0x12'));var Papa=require('papaparse');var Redis=require(_0xab5f('0x13'));var authService=require(_0xab5f('0x14'));var qs=require(_0xab5f('0x15'));var as=require(_0xab5f('0x16'));var hardwareService=require(_0xab5f('0x17'));var logger=require(_0xab5f('0x18'))(_0xab5f('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab5f('0x1a'));var db=require('../../mysqldb')['db'];config[_0xab5f('0x1b')]=_[_0xab5f('0x1c')](config['redis'],{'host':_0xab5f('0x1d'),'port':0x18eb});var socket=require(_0xab5f('0x1e'))(new Redis(config[_0xab5f('0x1b')]));require('./voiceQueueReport.socket')[_0xab5f('0x1f')](socket);function respondWithStatusCode(_0x492d44,_0x3e4700){_0x3e4700=_0x3e4700||0xcc;return function(_0x53e95a){if(_0x53e95a){return _0x492d44['sendStatus'](_0x3e4700);}return _0x492d44[_0xab5f('0x20')](_0x3e4700)[_0xab5f('0x21')]();};}function respondWithResult(_0x4c73e2,_0x23ceab){_0x23ceab=_0x23ceab||0xc8;return function(_0x3d4681){if(_0x3d4681){return _0x4c73e2[_0xab5f('0x20')](_0x23ceab)[_0xab5f('0x22')](_0x3d4681);}};}function respondWithFilteredResult(_0x4852b3,_0x5a544b){return function(_0x445605){if(_0x445605){var _0x26f6b9=typeof _0x5a544b[_0xab5f('0x23')]===_0xab5f('0x24')&&typeof _0x5a544b[_0xab5f('0x25')]===_0xab5f('0x24');var _0x45a8e4=_0x445605['count'];var _0x3fd009=_0x26f6b9?0x0:_0x5a544b[_0xab5f('0x23')];var _0x1889f3=_0x26f6b9?_0x445605[_0xab5f('0x26')]:_0x5a544b[_0xab5f('0x23')]+_0x5a544b['limit'];var _0xf6715b;if(_0x1889f3>=_0x45a8e4){_0x1889f3=_0x45a8e4;_0xf6715b=0xc8;}else{_0xf6715b=0xce;}_0x4852b3['status'](_0xf6715b);return _0x4852b3[_0xab5f('0x27')]('Content-Range',_0x3fd009+'-'+_0x1889f3+'/'+_0x45a8e4)[_0xab5f('0x22')](_0x445605);}return null;};}function patchUpdates(_0x290911){return function(_0x358690){try{jsonpatch[_0xab5f('0x28')](_0x358690,_0x290911,!![]);}catch(_0x1e40a0){return BPromise[_0xab5f('0x29')](_0x1e40a0);}return _0x358690['save']();};}function saveUpdates(_0x5a06a2,_0x22f9a3){return function(_0x3d3e3a){if(_0x3d3e3a){return _0x3d3e3a[_0xab5f('0x2a')](_0x5a06a2)[_0xab5f('0x2b')](function(_0x13d4de){return _0x13d4de;});}return null;};}function removeEntity(_0x32f958,_0x4d1ead){return function(_0x3c7cc7){if(_0x3c7cc7){return _0x3c7cc7[_0xab5f('0x2c')]()['then'](function(){_0x32f958['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x492021,_0x2243ee){return function(_0x30bdc8){if(!_0x30bdc8){_0x492021[_0xab5f('0x2d')](0x194);}return _0x30bdc8;};}function handleError(_0x4dfecf,_0x3563f5){_0x3563f5=_0x3563f5||0x1f4;return function(_0xe33709){logger[_0xab5f('0x2e')](_0xe33709[_0xab5f('0x2f')]);if(_0xe33709[_0xab5f('0x30')]){delete _0xe33709[_0xab5f('0x30')];}_0x4dfecf[_0xab5f('0x20')](_0x3563f5)[_0xab5f('0x31')](_0xe33709);};}exports['index']=function(_0x395269,_0xf1ae0b){var _0x52b4a2={},_0x5e7d05={},_0x158b0e={'count':0x0,'rows':[]};var _0x46a67f=_[_0xab5f('0x32')](db['VoiceQueueReport'][_0xab5f('0x33')],function(_0x3b2213){return{'name':_0x3b2213['fieldName'],'type':_0x3b2213[_0xab5f('0x34')][_0xab5f('0x35')]};});_0x5e7d05[_0xab5f('0x36')]=_[_0xab5f('0x32')](_0x46a67f,'name');_0x5e7d05[_0xab5f('0x37')]=_['keys'](_0x395269[_0xab5f('0x37')]);_0x5e7d05[_0xab5f('0x38')]=_[_0xab5f('0x39')](_0x5e7d05[_0xab5f('0x36')],_0x5e7d05[_0xab5f('0x37')]);_0x52b4a2['attributes']=_[_0xab5f('0x39')](_0x5e7d05[_0xab5f('0x36')],qs['fields'](_0x395269['query']['fields']));_0x52b4a2['attributes']=_0x52b4a2[_0xab5f('0x3a')][_0xab5f('0x3b')]?_0x52b4a2[_0xab5f('0x3a')]:_0x5e7d05[_0xab5f('0x36')];if(!_0x395269[_0xab5f('0x37')][_0xab5f('0x3c')](_0xab5f('0x3d'))){_0x52b4a2[_0xab5f('0x25')]=qs[_0xab5f('0x25')](_0x395269[_0xab5f('0x37')][_0xab5f('0x25')]);_0x52b4a2[_0xab5f('0x23')]=qs['offset'](_0x395269[_0xab5f('0x37')][_0xab5f('0x23')]);}_0x52b4a2[_0xab5f('0x3e')]=qs['sort'](_0x395269[_0xab5f('0x37')][_0xab5f('0x3f')]);_0x52b4a2[_0xab5f('0x40')]=qs[_0xab5f('0x38')](_['pick'](_0x395269[_0xab5f('0x37')],_0x5e7d05[_0xab5f('0x38')]),_0x46a67f);if(_0x395269[_0xab5f('0x37')]['filter']){_0x52b4a2[_0xab5f('0x40')]=_[_0xab5f('0x41')](_0x52b4a2['where'],{'$or':_[_0xab5f('0x32')](_0x46a67f,function(_0x330128){if(_0x330128['type']!==_0xab5f('0x42')){var _0x150634={};_0x150634[_0x330128[_0xab5f('0x30')]]={'$like':'%'+_0x395269[_0xab5f('0x37')][_0xab5f('0x43')]+'%'};return _0x150634;}})});}_0x52b4a2=_[_0xab5f('0x41')]({},_0x52b4a2,_0x395269[_0xab5f('0x44')]);var _0x28b8d7={'where':_0x52b4a2[_0xab5f('0x40')]};return db['VoiceQueueReport'][_0xab5f('0x26')](_0x28b8d7)['then'](function(_0x40f611){_0x158b0e[_0xab5f('0x26')]=_0x40f611;if(_0x395269[_0xab5f('0x37')][_0xab5f('0x45')]){_0x52b4a2[_0xab5f('0x46')]=[{'all':!![]}];}return db[_0xab5f('0x47')]['findAll'](_0x52b4a2);})[_0xab5f('0x2b')](function(_0x1735ff){_0x158b0e['rows']=_0x1735ff;return _0x158b0e;})[_0xab5f('0x2b')](respondWithFilteredResult(_0xf1ae0b,_0x52b4a2))[_0xab5f('0x48')](handleError(_0xf1ae0b,null));};exports[_0xab5f('0x49')]=function(_0x1bb602,_0x3eb452){var _0x46d4a5={'raw':![],'where':{'id':_0x1bb602[_0xab5f('0x4a')]['id']}},_0x1cd322={};_0x1cd322['model']=_[_0xab5f('0x4b')](db[_0xab5f('0x47')]['rawAttributes']);_0x1cd322[_0xab5f('0x37')]=_[_0xab5f('0x4b')](_0x1bb602[_0xab5f('0x37')]);_0x1cd322[_0xab5f('0x38')]=_[_0xab5f('0x39')](_0x1cd322[_0xab5f('0x36')],_0x1cd322[_0xab5f('0x37')]);_0x46d4a5[_0xab5f('0x3a')]=_[_0xab5f('0x39')](_0x1cd322[_0xab5f('0x36')],qs[_0xab5f('0x4c')](_0x1bb602[_0xab5f('0x37')][_0xab5f('0x4c')]));_0x46d4a5[_0xab5f('0x3a')]=_0x46d4a5[_0xab5f('0x3a')][_0xab5f('0x3b')]?_0x46d4a5[_0xab5f('0x3a')]:_0x1cd322[_0xab5f('0x36')];if(_0x1bb602[_0xab5f('0x37')]['includeAll']){_0x46d4a5['include']=[{'all':!![]}];}_0x46d4a5=_[_0xab5f('0x41')]({},_0x46d4a5,_0x1bb602[_0xab5f('0x44')]);return db[_0xab5f('0x47')][_0xab5f('0x4d')](_0x46d4a5)[_0xab5f('0x2b')](handleEntityNotFound(_0x3eb452,null))[_0xab5f('0x2b')](respondWithResult(_0x3eb452,null))[_0xab5f('0x48')](handleError(_0x3eb452,null));};exports[_0xab5f('0x4e')]=function(_0x58a8c0,_0x5f5b1a){return db[_0xab5f('0x47')][_0xab5f('0x4e')](_0x58a8c0[_0xab5f('0x4f')],{})[_0xab5f('0x2b')](respondWithResult(_0x5f5b1a,0xc9))[_0xab5f('0x48')](handleError(_0x5f5b1a,null));};exports[_0xab5f('0x2a')]=function(_0x238620,_0x2ce01f){if(_0x238620[_0xab5f('0x4f')]['id']){delete _0x238620[_0xab5f('0x4f')]['id'];}return db[_0xab5f('0x47')]['find']({'where':{'id':_0x238620[_0xab5f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ce01f,null))[_0xab5f('0x2b')](saveUpdates(_0x238620[_0xab5f('0x4f')],null))['then'](respondWithResult(_0x2ce01f,null))['catch'](handleError(_0x2ce01f,null));};exports[_0xab5f('0x2c')]=function(_0x2d3a48,_0x1f7cbf){return db[_0xab5f('0x47')]['find']({'where':{'id':_0x2d3a48[_0xab5f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f7cbf,null))['then'](removeEntity(_0x1f7cbf,null))[_0xab5f('0x48')](handleError(_0x1f7cbf,null));};exports['describe']=function(_0x21be51,_0x48fb05){return db[_0xab5f('0x47')][_0xab5f('0x50')]()[_0xab5f('0x2b')](respondWithResult(_0x48fb05,null))[_0xab5f('0x48')](handleError(_0x48fb05,null));};exports[_0xab5f('0x51')]=function(_0x26fab2,_0xf1dc63){var _0x266c33={},_0x105cca={},_0x225795={'count':0x0,'rows':[]};_0x105cca[_0xab5f('0x36')]=_[_0xab5f('0x4b')](db[_0xab5f('0x47')][_0xab5f('0x33')]);_0x105cca[_0xab5f('0x37')]=_[_0xab5f('0x4b')](_0x26fab2[_0xab5f('0x37')]);_0x105cca[_0xab5f('0x38')]=_[_0xab5f('0x39')](_0x105cca[_0xab5f('0x36')],_0x105cca['query']);_0x266c33[_0xab5f('0x3a')]=_['intersection'](_0x105cca[_0xab5f('0x36')],qs[_0xab5f('0x4c')](_0x26fab2['query'][_0xab5f('0x4c')]));_0x266c33[_0xab5f('0x3a')]=_0x266c33[_0xab5f('0x3a')][_0xab5f('0x3b')]?_0x266c33['attributes']:_0x105cca[_0xab5f('0x36')];if(!_0x26fab2[_0xab5f('0x37')]['hasOwnProperty'](_0xab5f('0x3d'))){_0x266c33[_0xab5f('0x25')]=qs['limit'](_0x26fab2[_0xab5f('0x37')][_0xab5f('0x25')]);_0x266c33[_0xab5f('0x23')]=qs[_0xab5f('0x23')](_0x26fab2[_0xab5f('0x37')][_0xab5f('0x23')]);}_0x266c33[_0xab5f('0x3e')]=qs[_0xab5f('0x3f')](_0x26fab2[_0xab5f('0x37')][_0xab5f('0x3f')]);_0x266c33[_0xab5f('0x40')]=qs[_0xab5f('0x38')](_[_0xab5f('0x52')](_0x26fab2['query'],_0x105cca['filters']));if(_0x26fab2[_0xab5f('0x37')][_0xab5f('0x43')]){_0x266c33[_0xab5f('0x40')]=_[_0xab5f('0x41')](_0x266c33[_0xab5f('0x40')],{'$or':_[_0xab5f('0x32')](_0x266c33['attributes'],function(_0x453530){var _0x32eaee={};_0x32eaee[_0x453530]={'$like':'%'+_0x26fab2[_0xab5f('0x37')][_0xab5f('0x43')]+'%'};return _0x32eaee;})});}_0x266c33=_[_0xab5f('0x41')]({},_0x266c33,_0x26fab2[_0xab5f('0x44')]);var _0x58e0ea={'where':_0x266c33['where']};return db['VoiceQueueReport']['count'](_0x58e0ea)[_0xab5f('0x2b')](function(_0x4981c){_0x225795[_0xab5f('0x26')]=_0x4981c;if(_0x26fab2[_0xab5f('0x37')][_0xab5f('0x45')]){_0x266c33[_0xab5f('0x46')]=[{'all':!![]}];}return db[_0xab5f('0x47')][_0xab5f('0x53')](_0x266c33);})[_0xab5f('0x2b')](function(_0x576078){_0x225795['rows']=_0x576078;return _0x225795;})['then'](respondWithFilteredResult(_0xf1dc63,_0x266c33,_0xab5f('0x51')))['catch'](handleError(_0xf1dc63,null,_0xab5f('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index efd0260..5005210 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 _0xee18=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x17a98a,_0x4a10d6){var _0xc5b705=function(_0x5b83eb){while(--_0x5b83eb){_0x17a98a['push'](_0x17a98a['shift']());}};_0xc5b705(++_0x4a10d6);}(_0xee18,0x1c8));var _0x8ee1=function(_0x333767,_0x220733){_0x333767=_0x333767-0x0;var _0x42a755=_0xee18[_0x333767];return _0x42a755;};'use strict';var EventEmitter=require(_0x8ee1('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8ee1('0x1')](0x0);var events={'afterCreate':_0x8ee1('0x2'),'afterUpdate':_0x8ee1('0x3'),'afterDestroy':_0x8ee1('0x4')};function emitEvent(_0x5e11e7){return function(_0x3d9bdf,_0x2615aa,_0x509964){VoiceQueueReportEvents[_0x8ee1('0x5')](_0x5e11e7+':'+_0x3d9bdf['id'],_0x3d9bdf);VoiceQueueReportEvents['emit'](_0x5e11e7,_0x3d9bdf);_0x509964(null);};}for(var e in events){if(events[_0x8ee1('0x6')](e)){var event=events[e];VoiceQueueReport[_0x8ee1('0x7')](e,emitEvent(event));}}module[_0x8ee1('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x63cf=['hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x63cf,0xc9));var _0xf63c=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x63cf[_0x4dab14];return _0xf41aa;};'use strict';var EventEmitter=require(_0xf63c('0x0'));var VoiceQueueReport=require(_0xf63c('0x1'))['db'][_0xf63c('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf63c('0x3')](0x0);var events={'afterCreate':_0xf63c('0x4'),'afterUpdate':_0xf63c('0x5'),'afterDestroy':_0xf63c('0x6')};function emitEvent(_0x568a2b){return function(_0x1aa7fd,_0x5844c1,_0x3e662e){VoiceQueueReportEvents[_0xf63c('0x7')](_0x568a2b+':'+_0x1aa7fd['id'],_0x1aa7fd);VoiceQueueReportEvents[_0xf63c('0x7')](_0x568a2b,_0x1aa7fd);_0x3e662e(null);};}for(var e in events){if(events[_0xf63c('0x8')](e)){var event=events[e];VoiceQueueReport[_0xf63c('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0d99180..fc35ad4 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 _0xcf15=['./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40ddca,_0x374da5){var _0x38064b=function(_0x1118e3){while(--_0x1118e3){_0x40ddca['push'](_0x40ddca['shift']());}};_0x38064b(++_0x374da5);}(_0xcf15,0x131));var _0x5cf1=function(_0x53d934,_0x346ce2){_0x53d934=_0x53d934-0x0;var _0x190dfc=_0xcf15[_0x53d934];return _0x190dfc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5cf1('0x0'))(_0x5cf1('0x1'));var moment=require('moment');var BPromise=require(_0x5cf1('0x2'));var rp=require(_0x5cf1('0x3'));var fs=require('fs');var path=require(_0x5cf1('0x4'));var rimraf=require(_0x5cf1('0x5'));var config=require(_0x5cf1('0x6'));var attributes=require(_0x5cf1('0x7'));module[_0x5cf1('0x8')]=function(_0x316663,_0x2111c3){return _0x316663['define'](_0x5cf1('0x9'),attributes,{'tableName':_0x5cf1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x5cf1('0xb')]},{'fields':[_0x5cf1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7705=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash'];(function(_0x2c087f,_0x22ef50){var _0xcacad0=function(_0x47fc7c){while(--_0x47fc7c){_0x2c087f['push'](_0x2c087f['shift']());}};_0xcacad0(++_0x22ef50);}(_0x7705,0x11f));var _0x5770=function(_0x571c47,_0x438835){_0x571c47=_0x571c47-0x0;var _0x3b2953=_0x7705[_0x571c47];return _0x3b2953;};'use strict';var _=require(_0x5770('0x0'));var util=require(_0x5770('0x1'));var logger=require(_0x5770('0x2'))(_0x5770('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5770('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5770('0x5'));var config=require(_0x5770('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x5770('0x7')]=function(_0x20c706,_0x2530d2){return _0x20c706[_0x5770('0x8')](_0x5770('0x9'),attributes,{'tableName':_0x5770('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x5770('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 16ad462..51799e0 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 _0xf7fc=['options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xf7fc,0x198));var _0xcf7f=function(_0x124e54,_0x5a2811){_0x124e54=_0x124e54-0x0;var _0x117368=_0xf7fc[_0x124e54];return _0x117368;};'use strict';var _=require(_0xcf7f('0x0'));var util=require(_0xcf7f('0x1'));var moment=require(_0xcf7f('0x2'));var BPromise=require(_0xcf7f('0x3'));var rs=require(_0xcf7f('0x4'));var fs=require('fs');var Redis=require(_0xcf7f('0x5'));var db=require(_0xcf7f('0x6'))['db'];var utils=require(_0xcf7f('0x7'));var logger=require(_0xcf7f('0x8'))(_0xcf7f('0x9'));var config=require(_0xcf7f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcf7f('0xb')][_0xcf7f('0xc')]({'port':0x232a});config[_0xcf7f('0xd')]=_['defaults'](config['redis'],{'host':_0xcf7f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf7f('0xd')]));require(_0xcf7f('0xf'))[_0xcf7f('0x10')](socket);function respondWithRpcPromise(_0x311491,_0x241380,_0x2e6fa2){return new BPromise(function(_0x37b0f1,_0x1df899){return client[_0xcf7f('0x11')](_0x311491,_0x2e6fa2)[_0xcf7f('0x12')](function(_0x4e7aff){logger[_0xcf7f('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x241380,_0xcf7f('0x14'));logger[_0xcf7f('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x241380,_0xcf7f('0x14'),JSON[_0xcf7f('0x16')](_0x4e7aff));if(_0x4e7aff[_0xcf7f('0x17')]){if(_0x4e7aff['error'][_0xcf7f('0x18')]===0x1f4){logger['error'](_0xcf7f('0x19'),_0x241380,_0x4e7aff[_0xcf7f('0x17')][_0xcf7f('0x1a')]);return _0x1df899(_0x4e7aff['error']['message']);}logger[_0xcf7f('0x17')](_0xcf7f('0x19'),_0x241380,_0x4e7aff[_0xcf7f('0x17')][_0xcf7f('0x1a')]);return _0x37b0f1(_0x4e7aff['error'][_0xcf7f('0x1a')]);}else{logger[_0xcf7f('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x241380,_0xcf7f('0x14'));_0x37b0f1(_0x4e7aff[_0xcf7f('0x1b')][_0xcf7f('0x1a')]);}})[_0xcf7f('0x1c')](function(_0x319a3c){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x241380,_0x319a3c);_0x1df899(_0x319a3c);});});}exports[_0xcf7f('0x1d')]=function(_0x394fd4){var _0x3b3bc8=this;return new Promise(function(_0x4681fe,_0x4ee9bc){return db[_0xcf7f('0x1e')][_0xcf7f('0x1f')]({'raw':_0x394fd4['options']?_0x394fd4[_0xcf7f('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x394fd4[_0xcf7f('0x20')]?_0x394fd4['options'][_0xcf7f('0x21')]||null:null,'attributes':_0x394fd4['options']?_0x394fd4[_0xcf7f('0x20')][_0xcf7f('0x22')]||null:null,'limit':_0x394fd4[_0xcf7f('0x20')]?_0x394fd4[_0xcf7f('0x20')][_0xcf7f('0x23')]||null:null,'include':_0x394fd4[_0xcf7f('0x20')]?_0x394fd4['options'][_0xcf7f('0x24')]?_['map'](_0x394fd4[_0xcf7f('0x20')][_0xcf7f('0x24')],function(_0x193c11){return{'model':db[_0x193c11['model']],'as':_0x193c11['as'],'attributes':_0x193c11[_0xcf7f('0x22')],'include':_0x193c11[_0xcf7f('0x24')]?_[_0xcf7f('0x25')](_0x193c11[_0xcf7f('0x24')],function(_0x12e112){return{'model':db[_0x12e112[_0xcf7f('0x26')]],'as':_0x12e112['as'],'attributes':_0x12e112['attributes'],'include':_0x12e112[_0xcf7f('0x24')]?_[_0xcf7f('0x25')](_0x12e112[_0xcf7f('0x24')],function(_0x4d62d8){return{'model':db[_0x4d62d8['model']],'as':_0x4d62d8['as'],'attributes':_0x4d62d8['attributes']};}):[]};}):[]};}):[]:[]})[_0xcf7f('0x12')](function(_0x909265){logger[_0xcf7f('0x13')](_0xcf7f('0x1d'),_0x394fd4);logger[_0xcf7f('0x15')]('GetVoiceQueueReport',_0x394fd4,JSON[_0xcf7f('0x16')](_0x909265));_0x4681fe(_0x909265);})[_0xcf7f('0x1c')](function(_0x5a665c){logger['error'](_0xcf7f('0x1d'),_0x5a665c[_0xcf7f('0x1a')],_0x394fd4);_0x4ee9bc(_0x3b3bc8[_0xcf7f('0x17')](0x1f4,_0x5a665c[_0xcf7f('0x1a')]));});});};exports[_0xcf7f('0x27')]=function(_0x4d4e80){var _0x326859=this;return new Promise(function(_0x3ff362,_0x170d2a){return db[_0xcf7f('0x1e')][_0xcf7f('0x28')](_0x4d4e80[_0xcf7f('0x29')],{'raw':_0x4d4e80[_0xcf7f('0x20')]?_0x4d4e80[_0xcf7f('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xcf7f('0x12')](function(_0x30344e){logger[_0xcf7f('0x13')](_0xcf7f('0x27'),_0x4d4e80);logger[_0xcf7f('0x15')]('CreateVoiceQueueReport',_0x4d4e80,JSON[_0xcf7f('0x16')](_0x30344e));_0x3ff362(_0x30344e);})[_0xcf7f('0x1c')](function(_0x44a4e4){logger[_0xcf7f('0x17')](_0xcf7f('0x27'),_0x44a4e4['message'],_0x4d4e80);_0x170d2a(_0x326859['error'](0x1f4,_0x44a4e4['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x2afb93){var _0x9628ba=this;return new Promise(function(_0xd6b393,_0x2157c0){return db[_0xcf7f('0x1e')][_0xcf7f('0x2a')](_0x2afb93[_0xcf7f('0x29')],{'raw':_0x2afb93[_0xcf7f('0x20')]?_0x2afb93[_0xcf7f('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2afb93[_0xcf7f('0x20')]?_0x2afb93[_0xcf7f('0x20')][_0xcf7f('0x21')]||null:null,'attributes':_0x2afb93['options']?_0x2afb93[_0xcf7f('0x20')][_0xcf7f('0x22')]||null:null,'limit':_0x2afb93[_0xcf7f('0x20')]?_0x2afb93[_0xcf7f('0x20')][_0xcf7f('0x23')]||null:null})[_0xcf7f('0x12')](function(_0x4c1b5f){logger[_0xcf7f('0x13')](_0xcf7f('0x2b'),_0x2afb93);logger['debug']('UpdateVoiceQueueReport',_0x2afb93,JSON[_0xcf7f('0x16')](_0x4c1b5f));_0xd6b393(_0x4c1b5f);})['catch'](function(_0x735f53){logger[_0xcf7f('0x17')]('UpdateVoiceQueueReport',_0x735f53[_0xcf7f('0x1a')],_0x2afb93);_0x2157c0(_0x9628ba[_0xcf7f('0x17')](0x1f4,_0x735f53[_0xcf7f('0x1a')]));});});}; \ No newline at end of file +var _0x9666=['VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','limit','include','map','model','attributes','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x189da6,_0x5eb5af){var _0x11236d=function(_0x2f22d5){while(--_0x2f22d5){_0x189da6['push'](_0x189da6['shift']());}};_0x11236d(++_0x5eb5af);}(_0x9666,0xba));var _0x6966=function(_0x3fc7a7,_0x14d99a){_0x3fc7a7=_0x3fc7a7-0x0;var _0x30b178=_0x9666[_0x3fc7a7];return _0x30b178;};'use strict';var _=require(_0x6966('0x0'));var util=require(_0x6966('0x1'));var moment=require('moment');var BPromise=require(_0x6966('0x2'));var rs=require(_0x6966('0x3'));var fs=require('fs');var Redis=require(_0x6966('0x4'));var db=require(_0x6966('0x5'))['db'];var utils=require(_0x6966('0x6'));var logger=require(_0x6966('0x7'))('rpc');var config=require(_0x6966('0x8'));var jayson=require(_0x6966('0x9'));var client=jayson[_0x6966('0xa')][_0x6966('0xb')]({'port':0x232a});config[_0x6966('0xc')]=_[_0x6966('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6966('0xe'))(new Redis(config[_0x6966('0xc')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x46d77e,_0x1e2249,_0x8cde2f){return new BPromise(function(_0x479d30,_0x14a2fe){return client[_0x6966('0xf')](_0x46d77e,_0x8cde2f)[_0x6966('0x10')](function(_0x295b82){logger[_0x6966('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e2249,_0x6966('0x12'));logger[_0x6966('0x13')](_0x6966('0x14'),_0x1e2249,'request\x20sent',JSON[_0x6966('0x15')](_0x295b82));if(_0x295b82[_0x6966('0x16')]){if(_0x295b82[_0x6966('0x16')][_0x6966('0x17')]===0x1f4){logger[_0x6966('0x16')](_0x6966('0x18'),_0x1e2249,_0x295b82[_0x6966('0x16')]['message']);return _0x14a2fe(_0x295b82[_0x6966('0x16')][_0x6966('0x19')]);}logger[_0x6966('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e2249,_0x295b82[_0x6966('0x16')][_0x6966('0x19')]);return _0x479d30(_0x295b82[_0x6966('0x16')][_0x6966('0x19')]);}else{logger[_0x6966('0x11')](_0x6966('0x18'),_0x1e2249,_0x6966('0x12'));_0x479d30(_0x295b82['result']['message']);}})[_0x6966('0x1a')](function(_0x5bdf5a){logger['error'](_0x6966('0x18'),_0x1e2249,_0x5bdf5a);_0x14a2fe(_0x5bdf5a);});});}exports[_0x6966('0x1b')]=function(_0x5aec29){var _0x4118b8=this;return new Promise(function(_0x1c245d,_0x5e87ae){return db[_0x6966('0x1c')]['findAll']({'raw':_0x5aec29[_0x6966('0x1d')]?_0x5aec29[_0x6966('0x1d')][_0x6966('0x1e')]===undefined?!![]:![]:!![],'where':_0x5aec29[_0x6966('0x1d')]?_0x5aec29[_0x6966('0x1d')][_0x6966('0x1f')]||null:null,'attributes':_0x5aec29['options']?_0x5aec29[_0x6966('0x1d')]['attributes']||null:null,'limit':_0x5aec29['options']?_0x5aec29[_0x6966('0x1d')][_0x6966('0x20')]||null:null,'include':_0x5aec29['options']?_0x5aec29[_0x6966('0x1d')][_0x6966('0x21')]?_[_0x6966('0x22')](_0x5aec29['options'][_0x6966('0x21')],function(_0x2c9cb9){return{'model':db[_0x2c9cb9[_0x6966('0x23')]],'as':_0x2c9cb9['as'],'attributes':_0x2c9cb9['attributes'],'include':_0x2c9cb9['include']?_[_0x6966('0x22')](_0x2c9cb9['include'],function(_0x449091){return{'model':db[_0x449091[_0x6966('0x23')]],'as':_0x449091['as'],'attributes':_0x449091['attributes'],'include':_0x449091[_0x6966('0x21')]?_[_0x6966('0x22')](_0x449091[_0x6966('0x21')],function(_0x43a887){return{'model':db[_0x43a887['model']],'as':_0x43a887['as'],'attributes':_0x43a887[_0x6966('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6966('0x10')](function(_0x273bd1){logger[_0x6966('0x11')](_0x6966('0x1b'),_0x5aec29);logger[_0x6966('0x13')]('GetVoiceQueueReport',_0x5aec29,JSON[_0x6966('0x15')](_0x273bd1));_0x1c245d(_0x273bd1);})[_0x6966('0x1a')](function(_0x194c65){logger[_0x6966('0x16')]('GetVoiceQueueReport',_0x194c65[_0x6966('0x19')],_0x5aec29);_0x5e87ae(_0x4118b8[_0x6966('0x16')](0x1f4,_0x194c65[_0x6966('0x19')]));});});};exports[_0x6966('0x25')]=function(_0x32a57b){var _0x14740f=this;return new Promise(function(_0x420682,_0x48485b){return db[_0x6966('0x1c')][_0x6966('0x26')](_0x32a57b[_0x6966('0x27')],{'raw':_0x32a57b[_0x6966('0x1d')]?_0x32a57b[_0x6966('0x1d')][_0x6966('0x1e')]===undefined?!![]:![]:!![]})[_0x6966('0x10')](function(_0x55022b){logger[_0x6966('0x11')](_0x6966('0x25'),_0x32a57b);logger[_0x6966('0x13')](_0x6966('0x25'),_0x32a57b,JSON[_0x6966('0x15')](_0x55022b));_0x420682(_0x55022b);})[_0x6966('0x1a')](function(_0x36e493){logger[_0x6966('0x16')](_0x6966('0x25'),_0x36e493[_0x6966('0x19')],_0x32a57b);_0x48485b(_0x14740f[_0x6966('0x16')](0x1f4,_0x36e493[_0x6966('0x19')]));});});};exports[_0x6966('0x28')]=function(_0x571244){var _0x4feb82=this;return new Promise(function(_0x3379d5,_0x4d83a9){return db['VoiceQueueReport'][_0x6966('0x29')](_0x571244[_0x6966('0x27')],{'raw':_0x571244[_0x6966('0x1d')]?_0x571244['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x571244[_0x6966('0x1d')]?_0x571244['options'][_0x6966('0x1f')]||null:null,'attributes':_0x571244[_0x6966('0x1d')]?_0x571244[_0x6966('0x1d')][_0x6966('0x24')]||null:null,'limit':_0x571244['options']?_0x571244[_0x6966('0x1d')][_0x6966('0x20')]||null:null})[_0x6966('0x10')](function(_0x46a816){logger[_0x6966('0x11')](_0x6966('0x28'),_0x571244);logger[_0x6966('0x13')](_0x6966('0x28'),_0x571244,JSON['stringify'](_0x46a816));_0x3379d5(_0x46a816);})['catch'](function(_0x78e6bf){logger[_0x6966('0x16')](_0x6966('0x28'),_0x78e6bf[_0x6966('0x19')],_0x571244);_0x4d83a9(_0x4feb82[_0x6966('0x16')](0x1f4,_0x78e6bf['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 5bf0d4b..49df261 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 _0x761e=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener','register','length'];(function(_0x581182,_0x4d140b){var _0x27eed2=function(_0x221e8f){while(--_0x221e8f){_0x581182['push'](_0x581182['shift']());}};_0x27eed2(++_0x4d140b);}(_0x761e,0x14e));var _0xe761=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0x761e[_0x3f8a03];return _0x147fb2;};'use strict';var VoiceQueueReportEvents=require(_0xe761('0x0'));var events=[_0xe761('0x1'),_0xe761('0x2'),_0xe761('0x3')];function createListener(_0x160864,_0x427b12){return function(_0x21ac2e){_0x427b12[_0xe761('0x4')](_0x160864,_0x21ac2e);};}function removeListener(_0x56e6c0,_0x47ae65){return function(){VoiceQueueReportEvents[_0xe761('0x5')](_0x56e6c0,_0x47ae65);};}exports[_0xe761('0x6')]=function(_0x4c35b7){for(var _0xbe7b6d=0x0,_0x3e435d=events[_0xe761('0x7')];_0xbe7b6d<_0x3e435d;_0xbe7b6d++){var _0x3b3a62=events[_0xbe7b6d];var _0x2925c2=createListener(_0xe761('0x8')+_0x3b3a62,_0x4c35b7);VoiceQueueReportEvents['on'](_0x3b3a62,_0x2925c2);}}; \ No newline at end of file +var _0xd56f=['remove','emit','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0xe2cbd3,_0x678694){var _0x5155e3=function(_0x3418e1){while(--_0x3418e1){_0xe2cbd3['push'](_0xe2cbd3['shift']());}};_0x5155e3(++_0x678694);}(_0xd56f,0xe8));var _0xfd56=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0xd56f[_0x11fb16];return _0x343de1;};'use strict';var VoiceQueueReportEvents=require(_0xfd56('0x0'));var events=[_0xfd56('0x1'),_0xfd56('0x2'),'update'];function createListener(_0x4299d1,_0x5b83cb){return function(_0x1b786e){_0x5b83cb[_0xfd56('0x3')](_0x4299d1,_0x1b786e);};}function removeListener(_0x529405,_0x27ff71){return function(){VoiceQueueReportEvents['removeListener'](_0x529405,_0x27ff71);};}exports['register']=function(_0x2454ba){for(var _0x1b0f15=0x0,_0x19a142=events[_0xfd56('0x4')];_0x1b0f15<_0x19a142;_0x1b0f15++){var _0x27c05a=events[_0x1b0f15];var _0x2cf392=createListener(_0xfd56('0x5')+_0x27c05a,_0x2454ba);VoiceQueueReportEvents['on'](_0x27c05a,_0x2cf392);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index ef491b9..d9753ab 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 _0xa6fa=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','post','create','update','destroy','exports'];(function(_0x44badf,_0x467490){var _0x2c06a5=function(_0x1b9e90){while(--_0x1b9e90){_0x44badf['push'](_0x44badf['shift']());}};_0x2c06a5(++_0x467490);}(_0xa6fa,0x130));var _0xaa6f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa6fa[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xaa6f('0x0'));var path=require(_0xaa6f('0x1'));var timeout=require(_0xaa6f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xaa6f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xaa6f('0x4'));var config=require(_0xaa6f('0x5'));var controller=require(_0xaa6f('0x6'));router['get']('/',auth[_0xaa6f('0x7')](),controller['index']);router[_0xaa6f('0x8')](_0xaa6f('0x9'),auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xa')]);router[_0xaa6f('0xb')]('/',auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xc')]);router['put'](_0xaa6f('0x9'),auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xd')]);router['delete']('/:id',auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xe')]);module[_0xaa6f('0xf')]=router; \ No newline at end of file +var _0x9a13=['../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x9a13,0x76));var _0x39a1=function(_0x1dd80b,_0x5e86dc){_0x1dd80b=_0x1dd80b-0x0;var _0x342c5c=_0x9a13[_0x1dd80b];return _0x342c5c;};'use strict';var multer=require(_0x39a1('0x0'));var util=require(_0x39a1('0x1'));var path=require(_0x39a1('0x2'));var timeout=require(_0x39a1('0x3'));var express=require(_0x39a1('0x4'));var router=express[_0x39a1('0x5')]();var fs_extra=require(_0x39a1('0x6'));var auth=require(_0x39a1('0x7'));var interaction=require(_0x39a1('0x8'));var config=require('../../config/environment');var controller=require(_0x39a1('0x9'));router[_0x39a1('0xa')]('/',auth[_0x39a1('0xb')](),controller[_0x39a1('0xc')]);router[_0x39a1('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x39a1('0xd')]);router['post']('/',auth[_0x39a1('0xb')](),controller[_0x39a1('0xe')]);router[_0x39a1('0xf')](_0x39a1('0x10'),auth['isAuthenticated'](),controller[_0x39a1('0x11')]);router[_0x39a1('0x12')]('/:id',auth[_0x39a1('0xb')](),controller[_0x39a1('0x13')]);module[_0x39a1('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 00ce31f..aa4fa6a 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 _0x7f9d=['format','sequelize','exports','STRING'];(function(_0xf8006,_0x3e9310){var _0x55c180=function(_0xcc1db8){while(--_0xcc1db8){_0xf8006['push'](_0xf8006['shift']());}};_0x55c180(++_0x3e9310);}(_0x7f9d,0xb9));var _0xd7f9=function(_0x2309e5,_0x19a137){_0x2309e5=_0x2309e5-0x0;var _0x1b1444=_0x7f9d[_0x2309e5];return _0x1b1444;};'use strict';var Sequelize=require(_0xd7f9('0x0'));var moment=require('moment');module[_0xd7f9('0x1')]={'time':{'type':Sequelize[_0xd7f9('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xd7f9('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xdc38=['format','moment','exports','STRING','DATE'];(function(_0x54c134,_0x33c8bb){var _0x2398d6=function(_0x49d64c){while(--_0x49d64c){_0x54c134['push'](_0x54c134['shift']());}};_0x2398d6(++_0x33c8bb);}(_0xdc38,0x114));var _0x8dc3=function(_0x45f484,_0x1426a8){_0x45f484=_0x45f484-0x0;var _0x40caba=_0xdc38[_0x45f484];return _0x40caba;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8dc3('0x0'));module[_0x8dc3('0x1')]={'time':{'type':Sequelize[_0x8dc3('0x2')]},'callid':{'type':Sequelize[_0x8dc3('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8dc3('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8dc3('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8dc3('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x8dc3('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8dc3('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8dc3('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8dc3('0x3')],'allowNull':![],'defaultValue':moment()[_0x8dc3('0x4')]('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 9e92e91..5d21dd2 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 _0x3c65=['filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x63f885,_0x2bc14d){var _0x579238=function(_0x307387){while(--_0x307387){_0x63f885['push'](_0x63f885['shift']());}};_0x579238(++_0x2bc14d);}(_0x3c65,0xf2));var _0x53c6=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x3c65[_0x836465];return _0x2150ea;};'use strict';var emlformat=require(_0x53c6('0x0'));var rimraf=require(_0x53c6('0x1'));var zipdir=require(_0x53c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53c6('0x3'));var moment=require(_0x53c6('0x4'));var BPromise=require(_0x53c6('0x5'));var Mustache=require('mustache');var util=require(_0x53c6('0x6'));var path=require(_0x53c6('0x7'));var sox=require(_0x53c6('0x8'));var csv=require(_0x53c6('0x9'));var ejs=require(_0x53c6('0xa'));var fs=require('fs');var fs_extra=require(_0x53c6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53c6('0xc'));var toCsv=require(_0x53c6('0x9'));var querystring=require(_0x53c6('0xd'));var Papa=require(_0x53c6('0xe'));var Redis=require('ioredis');var authService=require(_0x53c6('0xf'));var qs=require(_0x53c6('0x10'));var as=require(_0x53c6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53c6('0x12'))(_0x53c6('0x13'));var utils=require(_0x53c6('0x14'));var config=require(_0x53c6('0x15'));var licenseUtil=require(_0x53c6('0x16'));var db=require(_0x53c6('0x17'))['db'];function respondWithStatusCode(_0x10cbd5,_0x5b9a38){_0x5b9a38=_0x5b9a38||0xcc;return function(_0xff849b){if(_0xff849b){return _0x10cbd5[_0x53c6('0x18')](_0x5b9a38);}return _0x10cbd5[_0x53c6('0x19')](_0x5b9a38)[_0x53c6('0x1a')]();};}function respondWithResult(_0x52508d,_0x2f452e){_0x2f452e=_0x2f452e||0xc8;return function(_0x97987a){if(_0x97987a){return _0x52508d[_0x53c6('0x19')](_0x2f452e)[_0x53c6('0x1b')](_0x97987a);}};}function respondWithFilteredResult(_0x54142d,_0x34f5c6){return function(_0x8e5579){if(_0x8e5579){var _0x1b95bf=typeof _0x34f5c6[_0x53c6('0x1c')]===_0x53c6('0x1d')&&typeof _0x34f5c6['limit']===_0x53c6('0x1d');var _0x25a4a5=_0x8e5579[_0x53c6('0x1e')];var _0x50032e=_0x1b95bf?0x0:_0x34f5c6['offset'];var _0x5d1a6d=_0x1b95bf?_0x8e5579[_0x53c6('0x1e')]:_0x34f5c6['offset']+_0x34f5c6[_0x53c6('0x1f')];var _0x145b67;if(_0x5d1a6d>=_0x25a4a5){_0x5d1a6d=_0x25a4a5;_0x145b67=0xc8;}else{_0x145b67=0xce;}_0x54142d[_0x53c6('0x19')](_0x145b67);return _0x54142d[_0x53c6('0x20')](_0x53c6('0x21'),_0x50032e+'-'+_0x5d1a6d+'/'+_0x25a4a5)[_0x53c6('0x1b')](_0x8e5579);}return null;};}function patchUpdates(_0x1537b1){return function(_0x4d162a){try{jsonpatch[_0x53c6('0x22')](_0x4d162a,_0x1537b1,!![]);}catch(_0x423067){return BPromise[_0x53c6('0x23')](_0x423067);}return _0x4d162a[_0x53c6('0x24')]();};}function saveUpdates(_0x40b34f,_0x125895){return function(_0x8d88f5){if(_0x8d88f5){return _0x8d88f5[_0x53c6('0x25')](_0x40b34f)['then'](function(_0x7f644f){return _0x7f644f;});}return null;};}function removeEntity(_0x161946,_0x5ad447){return function(_0x5d99c7){if(_0x5d99c7){return _0x5d99c7[_0x53c6('0x26')]()[_0x53c6('0x27')](function(){_0x161946['status'](0xcc)[_0x53c6('0x1a')]();});}};}function handleEntityNotFound(_0x13b634,_0x11294d){return function(_0xeb2d3c){if(!_0xeb2d3c){_0x13b634['sendStatus'](0x194);}return _0xeb2d3c;};}function handleError(_0x436dce,_0x252a9e){_0x252a9e=_0x252a9e||0x1f4;return function(_0x2bdceb){logger['error'](_0x2bdceb[_0x53c6('0x28')]);if(_0x2bdceb[_0x53c6('0x29')]){delete _0x2bdceb[_0x53c6('0x29')];}_0x436dce[_0x53c6('0x19')](_0x252a9e)[_0x53c6('0x2a')](_0x2bdceb);};}exports[_0x53c6('0x2b')]=function(_0x4aabc1,_0x649caf){var _0x2b3e09={},_0x5424e3={},_0x222851={'count':0x0,'rows':[]};var _0x555642=_[_0x53c6('0x2c')](db[_0x53c6('0x2d')]['rawAttributes'],function(_0x35ad2f){return{'name':_0x35ad2f[_0x53c6('0x2e')],'type':_0x35ad2f[_0x53c6('0x2f')][_0x53c6('0x30')]};});_0x5424e3[_0x53c6('0x31')]=_[_0x53c6('0x2c')](_0x555642,'name');_0x5424e3[_0x53c6('0x32')]=_[_0x53c6('0x33')](_0x4aabc1['query']);_0x5424e3[_0x53c6('0x34')]=_[_0x53c6('0x35')](_0x5424e3[_0x53c6('0x31')],_0x5424e3[_0x53c6('0x32')]);_0x2b3e09['attributes']=_['intersection'](_0x5424e3[_0x53c6('0x31')],qs['fields'](_0x4aabc1['query'][_0x53c6('0x36')]));_0x2b3e09['attributes']=_0x2b3e09[_0x53c6('0x37')][_0x53c6('0x38')]?_0x2b3e09[_0x53c6('0x37')]:_0x5424e3[_0x53c6('0x31')];if(!_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x39')]('nolimit')){_0x2b3e09[_0x53c6('0x1f')]=qs[_0x53c6('0x1f')](_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x1f')]);_0x2b3e09['offset']=qs[_0x53c6('0x1c')](_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x1c')]);}_0x2b3e09[_0x53c6('0x3a')]=qs[_0x53c6('0x3b')](_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x3b')]);_0x2b3e09[_0x53c6('0x3c')]=qs[_0x53c6('0x34')](_[_0x53c6('0x3d')](_0x4aabc1['query'],_0x5424e3['filters']),_0x555642);if(_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x3e')]){_0x2b3e09[_0x53c6('0x3c')]=_['merge'](_0x2b3e09[_0x53c6('0x3c')],{'$or':_['map'](_0x555642,function(_0x4d9f36){if(_0x4d9f36['type']!==_0x53c6('0x3f')){var _0x431330={};_0x431330[_0x4d9f36[_0x53c6('0x29')]]={'$like':'%'+_0x4aabc1[_0x53c6('0x32')]['filter']+'%'};return _0x431330;}})});}_0x2b3e09=_[_0x53c6('0x40')]({},_0x2b3e09,_0x4aabc1['options']);var _0x106b3b={'where':_0x2b3e09['where']};return db[_0x53c6('0x2d')][_0x53c6('0x1e')](_0x106b3b)['then'](function(_0x480364){_0x222851['count']=_0x480364;if(_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x41')]){_0x2b3e09['include']=[{'all':!![]}];}return db[_0x53c6('0x2d')][_0x53c6('0x42')](_0x2b3e09);})[_0x53c6('0x27')](function(_0x5db02e){_0x222851[_0x53c6('0x43')]=_0x5db02e;return _0x222851;})[_0x53c6('0x27')](respondWithFilteredResult(_0x649caf,_0x2b3e09))[_0x53c6('0x44')](handleError(_0x649caf,null));};exports[_0x53c6('0x45')]=function(_0x269d12,_0x4b09eb){var _0x3456aa={'raw':!![],'where':{'id':_0x269d12[_0x53c6('0x46')]['id']}},_0x204b12={};_0x204b12[_0x53c6('0x31')]=_[_0x53c6('0x33')](db[_0x53c6('0x2d')][_0x53c6('0x47')]);_0x204b12[_0x53c6('0x32')]=_[_0x53c6('0x33')](_0x269d12[_0x53c6('0x32')]);_0x204b12['filters']=_[_0x53c6('0x35')](_0x204b12[_0x53c6('0x31')],_0x204b12[_0x53c6('0x32')]);_0x3456aa['attributes']=_[_0x53c6('0x35')](_0x204b12['model'],qs[_0x53c6('0x36')](_0x269d12[_0x53c6('0x32')]['fields']));_0x3456aa['attributes']=_0x3456aa[_0x53c6('0x37')][_0x53c6('0x38')]?_0x3456aa['attributes']:_0x204b12[_0x53c6('0x31')];if(_0x269d12[_0x53c6('0x32')][_0x53c6('0x41')]){_0x3456aa['include']=[{'all':!![]}];}_0x3456aa=_[_0x53c6('0x40')]({},_0x3456aa,_0x269d12[_0x53c6('0x48')]);return db[_0x53c6('0x2d')][_0x53c6('0x49')](_0x3456aa)['then'](handleEntityNotFound(_0x4b09eb,null))[_0x53c6('0x27')](respondWithResult(_0x4b09eb,null))['catch'](handleError(_0x4b09eb,null));};exports[_0x53c6('0x4a')]=function(_0x328e64,_0x13e17e){return db[_0x53c6('0x2d')]['create'](_0x328e64['body'],{})['then'](respondWithResult(_0x13e17e,0xc9))[_0x53c6('0x44')](handleError(_0x13e17e,null));};exports[_0x53c6('0x25')]=function(_0x4f4fb3,_0x1b2c22){if(_0x4f4fb3[_0x53c6('0x4b')]['id']){delete _0x4f4fb3[_0x53c6('0x4b')]['id'];}return db[_0x53c6('0x2d')][_0x53c6('0x49')]({'where':{'id':_0x4f4fb3[_0x53c6('0x46')]['id']}})[_0x53c6('0x27')](handleEntityNotFound(_0x1b2c22,null))[_0x53c6('0x27')](saveUpdates(_0x4f4fb3['body'],null))[_0x53c6('0x27')](respondWithResult(_0x1b2c22,null))[_0x53c6('0x44')](handleError(_0x1b2c22,null));};exports[_0x53c6('0x26')]=function(_0x29ec15,_0x5ec2cb){return db['VoiceQueuesLog'][_0x53c6('0x49')]({'where':{'id':_0x29ec15[_0x53c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ec2cb,null))['then'](removeEntity(_0x5ec2cb,null))[_0x53c6('0x44')](handleError(_0x5ec2cb,null));}; \ No newline at end of file +var _0x492c=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','VoiceQueuesLog','findAll','catch','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','index'];(function(_0x26957f,_0x49156f){var _0xb807ec=function(_0x19ab82){while(--_0x19ab82){_0x26957f['push'](_0x26957f['shift']());}};_0xb807ec(++_0x49156f);}(_0x492c,0x69));var _0xc492=function(_0x479fbe,_0xf9b0b7){_0x479fbe=_0x479fbe-0x0;var _0x2db696=_0x492c[_0x479fbe];return _0x2db696;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc492('0x0'));var zipdir=require(_0xc492('0x1'));var jsonpatch=require(_0xc492('0x2'));var rp=require(_0xc492('0x3'));var moment=require(_0xc492('0x4'));var BPromise=require(_0xc492('0x5'));var Mustache=require(_0xc492('0x6'));var util=require(_0xc492('0x7'));var path=require('path');var sox=require(_0xc492('0x8'));var csv=require(_0xc492('0x9'));var ejs=require(_0xc492('0xa'));var fs=require('fs');var fs_extra=require(_0xc492('0xb'));var _=require(_0xc492('0xc'));var squel=require(_0xc492('0xd'));var crypto=require(_0xc492('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc492('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc492('0x10'));var Redis=require(_0xc492('0x11'));var authService=require(_0xc492('0x12'));var qs=require(_0xc492('0x13'));var as=require(_0xc492('0x14'));var hardwareService=require(_0xc492('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc492('0x16'));var config=require(_0xc492('0x17'));var licenseUtil=require(_0xc492('0x18'));var db=require(_0xc492('0x19'))['db'];function respondWithStatusCode(_0x136729,_0xaa097e){_0xaa097e=_0xaa097e||0xcc;return function(_0x185822){if(_0x185822){return _0x136729[_0xc492('0x1a')](_0xaa097e);}return _0x136729[_0xc492('0x1b')](_0xaa097e)[_0xc492('0x1c')]();};}function respondWithResult(_0x2a69b6,_0x5adb08){_0x5adb08=_0x5adb08||0xc8;return function(_0x290797){if(_0x290797){return _0x2a69b6[_0xc492('0x1b')](_0x5adb08)[_0xc492('0x1d')](_0x290797);}};}function respondWithFilteredResult(_0x4e76e6,_0x3d81ea){return function(_0x1c4369){if(_0x1c4369){var _0x456345=typeof _0x3d81ea[_0xc492('0x1e')]===_0xc492('0x1f')&&typeof _0x3d81ea[_0xc492('0x20')]==='undefined';var _0x11ef92=_0x1c4369['count'];var _0x35bdb8=_0x456345?0x0:_0x3d81ea[_0xc492('0x1e')];var _0x8a4495=_0x456345?_0x1c4369[_0xc492('0x21')]:_0x3d81ea[_0xc492('0x1e')]+_0x3d81ea[_0xc492('0x20')];var _0x44cd7c;if(_0x8a4495>=_0x11ef92){_0x8a4495=_0x11ef92;_0x44cd7c=0xc8;}else{_0x44cd7c=0xce;}_0x4e76e6[_0xc492('0x1b')](_0x44cd7c);return _0x4e76e6[_0xc492('0x22')](_0xc492('0x23'),_0x35bdb8+'-'+_0x8a4495+'/'+_0x11ef92)['json'](_0x1c4369);}return null;};}function patchUpdates(_0x5bd871){return function(_0x1d71ed){try{jsonpatch[_0xc492('0x24')](_0x1d71ed,_0x5bd871,!![]);}catch(_0x1956f4){return BPromise['reject'](_0x1956f4);}return _0x1d71ed['save']();};}function saveUpdates(_0x1345f8,_0x31e8b9){return function(_0x5b3d44){if(_0x5b3d44){return _0x5b3d44[_0xc492('0x25')](_0x1345f8)[_0xc492('0x26')](function(_0x39b54f){return _0x39b54f;});}return null;};}function removeEntity(_0x5b3f79,_0x39473f){return function(_0x3a860b){if(_0x3a860b){return _0x3a860b['destroy']()[_0xc492('0x26')](function(){_0x5b3f79['status'](0xcc)[_0xc492('0x1c')]();});}};}function handleEntityNotFound(_0x48e214,_0x140508){return function(_0x2a29ca){if(!_0x2a29ca){_0x48e214[_0xc492('0x1a')](0x194);}return _0x2a29ca;};}function handleError(_0x5e4ba9,_0x747778){_0x747778=_0x747778||0x1f4;return function(_0x14ae6d){logger[_0xc492('0x27')](_0x14ae6d[_0xc492('0x28')]);if(_0x14ae6d[_0xc492('0x29')]){delete _0x14ae6d[_0xc492('0x29')];}_0x5e4ba9[_0xc492('0x1b')](_0x747778)['send'](_0x14ae6d);};}exports[_0xc492('0x2a')]=function(_0x1620b6,_0x1378fa){var _0x4af0dc={},_0x2df7a8={},_0x1fc3dd={'count':0x0,'rows':[]};var _0x57ccba=_[_0xc492('0x2b')](db['VoiceQueuesLog']['rawAttributes'],function(_0x290f90){return{'name':_0x290f90[_0xc492('0x2c')],'type':_0x290f90[_0xc492('0x2d')][_0xc492('0x2e')]};});_0x2df7a8[_0xc492('0x2f')]=_[_0xc492('0x2b')](_0x57ccba,_0xc492('0x29'));_0x2df7a8[_0xc492('0x30')]=_[_0xc492('0x31')](_0x1620b6[_0xc492('0x30')]);_0x2df7a8[_0xc492('0x32')]=_[_0xc492('0x33')](_0x2df7a8['model'],_0x2df7a8[_0xc492('0x30')]);_0x4af0dc[_0xc492('0x34')]=_[_0xc492('0x33')](_0x2df7a8['model'],qs[_0xc492('0x35')](_0x1620b6[_0xc492('0x30')][_0xc492('0x35')]));_0x4af0dc[_0xc492('0x34')]=_0x4af0dc[_0xc492('0x34')][_0xc492('0x36')]?_0x4af0dc[_0xc492('0x34')]:_0x2df7a8[_0xc492('0x2f')];if(!_0x1620b6[_0xc492('0x30')]['hasOwnProperty'](_0xc492('0x37'))){_0x4af0dc[_0xc492('0x20')]=qs['limit'](_0x1620b6[_0xc492('0x30')]['limit']);_0x4af0dc[_0xc492('0x1e')]=qs[_0xc492('0x1e')](_0x1620b6[_0xc492('0x30')][_0xc492('0x1e')]);}_0x4af0dc[_0xc492('0x38')]=qs[_0xc492('0x39')](_0x1620b6[_0xc492('0x30')]['sort']);_0x4af0dc[_0xc492('0x3a')]=qs[_0xc492('0x32')](_[_0xc492('0x3b')](_0x1620b6[_0xc492('0x30')],_0x2df7a8[_0xc492('0x32')]),_0x57ccba);if(_0x1620b6[_0xc492('0x30')][_0xc492('0x3c')]){_0x4af0dc['where']=_['merge'](_0x4af0dc[_0xc492('0x3a')],{'$or':_['map'](_0x57ccba,function(_0x4e930b){if(_0x4e930b[_0xc492('0x2d')]!==_0xc492('0x3d')){var _0x1ac107={};_0x1ac107[_0x4e930b['name']]={'$like':'%'+_0x1620b6[_0xc492('0x30')][_0xc492('0x3c')]+'%'};return _0x1ac107;}})});}_0x4af0dc=_[_0xc492('0x3e')]({},_0x4af0dc,_0x1620b6[_0xc492('0x3f')]);var _0x426158={'where':_0x4af0dc[_0xc492('0x3a')]};return db['VoiceQueuesLog'][_0xc492('0x21')](_0x426158)['then'](function(_0x21ff8a){_0x1fc3dd[_0xc492('0x21')]=_0x21ff8a;if(_0x1620b6[_0xc492('0x30')][_0xc492('0x40')]){_0x4af0dc[_0xc492('0x41')]=[{'all':!![]}];}return db[_0xc492('0x42')][_0xc492('0x43')](_0x4af0dc);})['then'](function(_0x2665c0){_0x1fc3dd['rows']=_0x2665c0;return _0x1fc3dd;})[_0xc492('0x26')](respondWithFilteredResult(_0x1378fa,_0x4af0dc))[_0xc492('0x44')](handleError(_0x1378fa,null));};exports['show']=function(_0x220960,_0x4726c6){var _0x21eae3={'raw':!![],'where':{'id':_0x220960['params']['id']}},_0x293f5c={};_0x293f5c['model']=_[_0xc492('0x31')](db['VoiceQueuesLog']['rawAttributes']);_0x293f5c[_0xc492('0x30')]=_[_0xc492('0x31')](_0x220960['query']);_0x293f5c['filters']=_[_0xc492('0x33')](_0x293f5c[_0xc492('0x2f')],_0x293f5c[_0xc492('0x30')]);_0x21eae3['attributes']=_[_0xc492('0x33')](_0x293f5c[_0xc492('0x2f')],qs[_0xc492('0x35')](_0x220960[_0xc492('0x30')][_0xc492('0x35')]));_0x21eae3[_0xc492('0x34')]=_0x21eae3['attributes']['length']?_0x21eae3[_0xc492('0x34')]:_0x293f5c['model'];if(_0x220960[_0xc492('0x30')][_0xc492('0x40')]){_0x21eae3[_0xc492('0x41')]=[{'all':!![]}];}_0x21eae3=_[_0xc492('0x3e')]({},_0x21eae3,_0x220960[_0xc492('0x3f')]);return db[_0xc492('0x42')][_0xc492('0x45')](_0x21eae3)[_0xc492('0x26')](handleEntityNotFound(_0x4726c6,null))['then'](respondWithResult(_0x4726c6,null))[_0xc492('0x44')](handleError(_0x4726c6,null));};exports[_0xc492('0x46')]=function(_0xa9d66b,_0x30ffe9){return db[_0xc492('0x42')][_0xc492('0x46')](_0xa9d66b[_0xc492('0x47')],{})[_0xc492('0x26')](respondWithResult(_0x30ffe9,0xc9))[_0xc492('0x44')](handleError(_0x30ffe9,null));};exports[_0xc492('0x25')]=function(_0x4d22ae,_0x4067cc){if(_0x4d22ae['body']['id']){delete _0x4d22ae[_0xc492('0x47')]['id'];}return db[_0xc492('0x42')][_0xc492('0x45')]({'where':{'id':_0x4d22ae[_0xc492('0x48')]['id']}})[_0xc492('0x26')](handleEntityNotFound(_0x4067cc,null))[_0xc492('0x26')](saveUpdates(_0x4d22ae[_0xc492('0x47')],null))[_0xc492('0x26')](respondWithResult(_0x4067cc,null))[_0xc492('0x44')](handleError(_0x4067cc,null));};exports[_0xc492('0x49')]=function(_0x21ee76,_0x111e47){return db[_0xc492('0x42')]['find']({'where':{'id':_0x21ee76[_0xc492('0x48')]['id']}})[_0xc492('0x26')](handleEntityNotFound(_0x111e47,null))[_0xc492('0x26')](removeEntity(_0x111e47,null))[_0xc492('0x44')](handleError(_0x111e47,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 9834105..812103a 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 _0x5a1f=['path','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58466c,_0x21a1d4){var _0x19c0f4=function(_0x3230b8){while(--_0x3230b8){_0x58466c['push'](_0x58466c['shift']());}};_0x19c0f4(++_0x21a1d4);}(_0x5a1f,0x1ba));var _0xf5a1=function(_0x4702c4,_0x408c98){_0x4702c4=_0x4702c4-0x0;var _0x4437cd=_0x5a1f[_0x4702c4];return _0x4437cd;};'use strict';var _=require('lodash');var util=require(_0xf5a1('0x0'));var logger=require(_0xf5a1('0x1'))(_0xf5a1('0x2'));var moment=require(_0xf5a1('0x3'));var BPromise=require(_0xf5a1('0x4'));var rp=require(_0xf5a1('0x5'));var fs=require('fs');var path=require(_0xf5a1('0x6'));var rimraf=require('rimraf');var config=require(_0xf5a1('0x7'));var attributes=require(_0xf5a1('0x8'));module['exports']=function(_0x30bc64,_0x5774ba){return _0x30bc64[_0xf5a1('0x9')](_0xf5a1('0xa'),attributes,{'tableName':_0xf5a1('0xb'),'paranoid':![],'indexes':[{'name':_0xf5a1('0xc'),'fields':['event',_0xf5a1('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5654=['api','moment','path','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5654,0x10e));var _0x4565=function(_0x1d3c96,_0x3a0886){_0x1d3c96=_0x1d3c96-0x0;var _0x53ca2e=_0x5654[_0x1d3c96];return _0x53ca2e;};'use strict';var _=require(_0x4565('0x0'));var util=require(_0x4565('0x1'));var logger=require(_0x4565('0x2'))(_0x4565('0x3'));var moment=require(_0x4565('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4565('0x5'));var rimraf=require('rimraf');var config=require(_0x4565('0x6'));var attributes=require(_0x4565('0x7'));module[_0x4565('0x8')]=function(_0x2e9089,_0x369a97){return _0x2e9089['define'](_0x4565('0x9'),attributes,{'tableName':_0x4565('0xa'),'paranoid':![],'indexes':[{'name':_0x4565('0xb'),'fields':['event',_0x4565('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 98a6529..08aa896 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 _0xf951=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util'];(function(_0x564f19,_0x185c9f){var _0x2ffdcb=function(_0x2db9e4){while(--_0x2db9e4){_0x564f19['push'](_0x564f19['shift']());}};_0x2ffdcb(++_0x185c9f);}(_0xf951,0x1f3));var _0x1f95=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0xf951[_0x5f49c0];return _0x5ab653;};'use strict';var _=require('lodash');var util=require(_0x1f95('0x0'));var moment=require('moment');var BPromise=require(_0x1f95('0x1'));var rs=require(_0x1f95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f95('0x3'))['db'];var utils=require(_0x1f95('0x4'));var logger=require(_0x1f95('0x5'))(_0x1f95('0x6'));var config=require('../../config/environment');var jayson=require(_0x1f95('0x7'));var client=jayson[_0x1f95('0x8')][_0x1f95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28c3fc,_0x38235b,_0x2a0faf){return new BPromise(function(_0x22cd65,_0x239305){return client[_0x1f95('0xa')](_0x28c3fc,_0x2a0faf)[_0x1f95('0xb')](function(_0x5a74c2){logger['info'](_0x1f95('0xc'),_0x38235b,'request\x20sent');logger['debug'](_0x1f95('0xd'),_0x38235b,'request\x20sent',JSON[_0x1f95('0xe')](_0x5a74c2));if(_0x5a74c2[_0x1f95('0xf')]){if(_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x10')]===0x1f4){logger[_0x1f95('0xf')](_0x1f95('0xc'),_0x38235b,_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);return _0x239305(_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);}logger['error'](_0x1f95('0xc'),_0x38235b,_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);return _0x22cd65(_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);}else{logger['info'](_0x1f95('0xc'),_0x38235b,_0x1f95('0x12'));_0x22cd65(_0x5a74c2['result']['message']);}})[_0x1f95('0x13')](function(_0x2175a6){logger[_0x1f95('0xf')](_0x1f95('0xc'),_0x38235b,_0x2175a6);_0x239305(_0x2175a6);});});} \ No newline at end of file +var _0xa6e2=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x1ad81d,_0x47201f){var _0x1749ef=function(_0x544e78){while(--_0x544e78){_0x1ad81d['push'](_0x1ad81d['shift']());}};_0x1749ef(++_0x47201f);}(_0xa6e2,0x132));var _0x2a6e=function(_0x281ff6,_0x2a86a7){_0x281ff6=_0x281ff6-0x0;var _0x294436=_0xa6e2[_0x281ff6];return _0x294436;};'use strict';var _=require(_0x2a6e('0x0'));var util=require(_0x2a6e('0x1'));var moment=require('moment');var BPromise=require(_0x2a6e('0x2'));var rs=require(_0x2a6e('0x3'));var fs=require('fs');var Redis=require(_0x2a6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2a6e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2a6e('0x6'));var client=jayson[_0x2a6e('0x7')][_0x2a6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10ec91,_0x478a8e,_0x238615){return new BPromise(function(_0x272ec4,_0x5212e4){return client[_0x2a6e('0x9')](_0x10ec91,_0x238615)[_0x2a6e('0xa')](function(_0x1af5f1){logger[_0x2a6e('0xb')](_0x2a6e('0xc'),_0x478a8e,_0x2a6e('0xd'));logger[_0x2a6e('0xe')](_0x2a6e('0xf'),_0x478a8e,_0x2a6e('0xd'),JSON[_0x2a6e('0x10')](_0x1af5f1));if(_0x1af5f1['error']){if(_0x1af5f1[_0x2a6e('0x11')]['code']===0x1f4){logger[_0x2a6e('0x11')](_0x2a6e('0xc'),_0x478a8e,_0x1af5f1[_0x2a6e('0x11')][_0x2a6e('0x12')]);return _0x5212e4(_0x1af5f1[_0x2a6e('0x11')][_0x2a6e('0x12')]);}logger[_0x2a6e('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x478a8e,_0x1af5f1[_0x2a6e('0x11')][_0x2a6e('0x12')]);return _0x272ec4(_0x1af5f1['error'][_0x2a6e('0x12')]);}else{logger[_0x2a6e('0xb')](_0x2a6e('0xc'),_0x478a8e,_0x2a6e('0xd'));_0x272ec4(_0x1af5f1['result'][_0x2a6e('0x12')]);}})[_0x2a6e('0x13')](function(_0x33193a){logger[_0x2a6e('0x11')](_0x2a6e('0xc'),_0x478a8e,_0x33193a);_0x5212e4(_0x33193a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5ec2def..d922bae 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 _0x58b8=['isAuthenticated','index','/describe','describe','/:id','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x199278,_0x5721f7){var _0x3751bf=function(_0x345842){while(--_0x345842){_0x199278['push'](_0x199278['shift']());}};_0x3751bf(++_0x5721f7);}(_0x58b8,0x153));var _0x858b=function(_0x451402,_0x561cb8){_0x451402=_0x451402-0x0;var _0x4ffb7f=_0x58b8[_0x451402];return _0x4ffb7f;};'use strict';var multer=require(_0x858b('0x0'));var util=require(_0x858b('0x1'));var path=require(_0x858b('0x2'));var timeout=require(_0x858b('0x3'));var express=require(_0x858b('0x4'));var router=express['Router']();var fs_extra=require(_0x858b('0x5'));var auth=require(_0x858b('0x6'));var interaction=require(_0x858b('0x7'));var config=require(_0x858b('0x8'));var controller=require(_0x858b('0x9'));router[_0x858b('0xa')]('/',auth[_0x858b('0xb')](),controller[_0x858b('0xc')]);router[_0x858b('0xa')](_0x858b('0xd'),auth[_0x858b('0xb')](),controller[_0x858b('0xe')]);router[_0x858b('0xa')](_0x858b('0xf'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0x858b('0xb')](),controller[_0x858b('0x10')]);router['get'](_0x858b('0x11'),controller[_0x858b('0x12')]);router[_0x858b('0xa')](_0x858b('0x13'),auth[_0x858b('0xb')](),controller[_0x858b('0x14')]);router[_0x858b('0x15')]('/',auth[_0x858b('0xb')](),controller['create']);router['post']('/:id/transcribe',auth[_0x858b('0xb')](),controller['runTranscribe']);router[_0x858b('0x16')](_0x858b('0xf'),auth[_0x858b('0xb')](),controller[_0x858b('0x17')]);router[_0x858b('0x18')](_0x858b('0xf'),auth[_0x858b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5287=['describe','/:id','/:id/download','downloads','/:id/transcribe','downloadTranscribe','post','create','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index'];(function(_0xb80310,_0x562e4b){var _0x4cdd4f=function(_0x43a8cc){while(--_0x43a8cc){_0xb80310['push'](_0xb80310['shift']());}};_0x4cdd4f(++_0x562e4b);}(_0x5287,0x94));var _0x7528=function(_0x58ffd2,_0x234096){_0x58ffd2=_0x58ffd2-0x0;var _0x363934=_0x5287[_0x58ffd2];return _0x363934;};'use strict';var multer=require(_0x7528('0x0'));var util=require(_0x7528('0x1'));var path=require(_0x7528('0x2'));var timeout=require(_0x7528('0x3'));var express=require('express');var router=express[_0x7528('0x4')]();var fs_extra=require(_0x7528('0x5'));var auth=require(_0x7528('0x6'));var interaction=require(_0x7528('0x7'));var config=require(_0x7528('0x8'));var controller=require(_0x7528('0x9'));router[_0x7528('0xa')]('/',auth[_0x7528('0xb')](),controller[_0x7528('0xc')]);router['get']('/describe',auth[_0x7528('0xb')](),controller[_0x7528('0xd')]);router[_0x7528('0xa')](_0x7528('0xe'),auth[_0x7528('0xb')](),controller['show']);router['get'](_0x7528('0xf'),auth[_0x7528('0xb')](),controller['download']);router['get']('/:id/downloads',controller[_0x7528('0x10')]);router['get'](_0x7528('0x11'),auth[_0x7528('0xb')](),controller[_0x7528('0x12')]);router[_0x7528('0x13')]('/',auth[_0x7528('0xb')](),controller[_0x7528('0x14')]);router[_0x7528('0x13')]('/:id/transcribe',auth['isAuthenticated'](),controller['runTranscribe']);router['put'](_0x7528('0xe'),auth[_0x7528('0xb')](),controller['update']);router[_0x7528('0x15')](_0x7528('0xe'),auth[_0x7528('0xb')](),controller[_0x7528('0x16')]);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 0f16469..2bd42c3 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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 72fc840..acde398 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 _0xc7ba=['runTranscribe','findOne','%s.cypher','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','map','VoiceRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','params','rawAttributes','options','find','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','sequelize','MD5','col','token','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','TranscriptionJob','TranscriptionJobStatus'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc7ba,0xb3));var _0xac7b=function(_0x34927a,_0x71fd97){_0x34927a=_0x34927a-0x0;var _0xf3d101=_0xc7ba[_0x34927a];return _0xf3d101;};'use strict';var emlformat=require(_0xac7b('0x0'));var rimraf=require(_0xac7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac7b('0x2'));var moment=require(_0xac7b('0x3'));var BPromise=require(_0xac7b('0x4'));var Mustache=require(_0xac7b('0x5'));var util=require(_0xac7b('0x6'));var path=require(_0xac7b('0x7'));var sox=require(_0xac7b('0x8'));var csv=require(_0xac7b('0x9'));var ejs=require(_0xac7b('0xa'));var fs=require('fs');var fs_extra=require(_0xac7b('0xb'));var _=require(_0xac7b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac7b('0xd'));var deskjs=require(_0xac7b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xac7b('0xf'));var Papa=require('papaparse');var AWS=require(_0xac7b('0x10'));var uuidv4=require(_0xac7b('0x11'));var Redis=require(_0xac7b('0x12'));var authService=require(_0xac7b('0x13'));var qs=require(_0xac7b('0x14'));var as=require(_0xac7b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac7b('0x16'))(_0xac7b('0x17'));var utils=require(_0xac7b('0x18'));var config=require(_0xac7b('0x19'));var licenseUtil=require(_0xac7b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49eb26,_0x36d203){_0x36d203=_0x36d203||0xcc;return function(_0x18caeb){if(_0x18caeb){return _0x49eb26[_0xac7b('0x1b')](_0x36d203);}return _0x49eb26[_0xac7b('0x1c')](_0x36d203)[_0xac7b('0x1d')]();};}function respondWithResult(_0x5a123a,_0xbdbef4){_0xbdbef4=_0xbdbef4||0xc8;return function(_0x50bd12){if(_0x50bd12){return _0x5a123a[_0xac7b('0x1c')](_0xbdbef4)[_0xac7b('0x1e')](_0x50bd12);}};}function respondWithFilteredResult(_0x532f8b,_0x2f436a){return function(_0x59d9de){if(_0x59d9de){var _0x59d6ae=typeof _0x2f436a[_0xac7b('0x1f')]===_0xac7b('0x20')&&typeof _0x2f436a[_0xac7b('0x21')]==='undefined';var _0x249590=_0x59d9de[_0xac7b('0x22')];var _0x15e5c6=_0x59d6ae?0x0:_0x2f436a[_0xac7b('0x1f')];var _0x3e7669=_0x59d6ae?_0x59d9de['count']:_0x2f436a[_0xac7b('0x1f')]+_0x2f436a['limit'];var _0x3fb7b7;if(_0x3e7669>=_0x249590){_0x3e7669=_0x249590;_0x3fb7b7=0xc8;}else{_0x3fb7b7=0xce;}_0x532f8b[_0xac7b('0x1c')](_0x3fb7b7);return _0x532f8b[_0xac7b('0x23')](_0xac7b('0x24'),_0x15e5c6+'-'+_0x3e7669+'/'+_0x249590)[_0xac7b('0x1e')](_0x59d9de);}return null;};}function patchUpdates(_0x3f33b2){return function(_0x3d062f){try{jsonpatch[_0xac7b('0x25')](_0x3d062f,_0x3f33b2,!![]);}catch(_0x27c8b9){return BPromise[_0xac7b('0x26')](_0x27c8b9);}return _0x3d062f[_0xac7b('0x27')]();};}function saveUpdates(_0xf1b7b9,_0x122cab){return function(_0x57c6de){if(_0x57c6de){return _0x57c6de[_0xac7b('0x28')](_0xf1b7b9)['then'](function(_0x457b6e){return _0x457b6e;});}return null;};}function removeEntity(_0x3c1023,_0x292956){return function(_0x20820e){if(_0x20820e){return _0x20820e[_0xac7b('0x29')]()['then'](function(){_0x3c1023[_0xac7b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47888a,_0x38bc33){return function(_0x555ec2){if(!_0x555ec2){_0x47888a['sendStatus'](0x194);}return _0x555ec2;};}function handleError(_0xf2ad85,_0x31b7af){_0x31b7af=_0x31b7af||0x1f4;return function(_0x469e32){logger[_0xac7b('0x2a')](_0x469e32[_0xac7b('0x2b')]);if(_0x469e32[_0xac7b('0x2c')]){delete _0x469e32['name'];}_0xf2ad85[_0xac7b('0x1c')](_0x31b7af)['send'](_0x469e32);};}exports['index']=function(_0x52ef69,_0x458702){var _0x1b4d68={},_0x3af1f0={},_0x58cc68={'count':0x0,'rows':[]};var _0x11a6ef=_[_0xac7b('0x2d')](db[_0xac7b('0x2e')]['rawAttributes'],function(_0x4e8f7f){return{'name':_0x4e8f7f['fieldName'],'type':_0x4e8f7f[_0xac7b('0x2f')][_0xac7b('0x30')]};});_0x3af1f0[_0xac7b('0x31')]=_[_0xac7b('0x32')](_[_0xac7b('0x2d')](_0x11a6ef,'name'),[_0xac7b('0x33')]);_0x3af1f0[_0xac7b('0x34')]=_[_0xac7b('0x35')](_0x52ef69[_0xac7b('0x34')]);_0x3af1f0[_0xac7b('0x36')]=_[_0xac7b('0x37')](_0x3af1f0[_0xac7b('0x31')],_0x3af1f0['query']);_0x1b4d68[_0xac7b('0x38')]=_['intersection'](_0x3af1f0[_0xac7b('0x31')],qs[_0xac7b('0x39')](_0x52ef69[_0xac7b('0x34')]['fields']));_0x1b4d68[_0xac7b('0x38')]=_0x1b4d68[_0xac7b('0x38')][_0xac7b('0x3a')]?_0x1b4d68[_0xac7b('0x38')]:_0x3af1f0[_0xac7b('0x31')];if(!_0x52ef69[_0xac7b('0x34')][_0xac7b('0x3b')](_0xac7b('0x3c'))){_0x1b4d68[_0xac7b('0x21')]=qs[_0xac7b('0x21')](_0x52ef69[_0xac7b('0x34')]['limit']);_0x1b4d68[_0xac7b('0x1f')]=qs[_0xac7b('0x1f')](_0x52ef69['query'][_0xac7b('0x1f')]);}_0x1b4d68[_0xac7b('0x3d')]=qs[_0xac7b('0x3e')](_0x52ef69[_0xac7b('0x34')]['sort']);_0x1b4d68[_0xac7b('0x3f')]=qs['filters'](_[_0xac7b('0x40')](_0x52ef69[_0xac7b('0x34')],_0x3af1f0[_0xac7b('0x36')]),_0x11a6ef);if(_0x52ef69[_0xac7b('0x34')][_0xac7b('0x41')]){_0x1b4d68['where']=_[_0xac7b('0x42')](_0x1b4d68[_0xac7b('0x3f')],{'$or':_[_0xac7b('0x2d')](_0x11a6ef,function(_0x2821eb){if(_0x2821eb[_0xac7b('0x2f')]!==_0xac7b('0x43')){var _0x1474c3={};_0x1474c3[_0x2821eb['name']]={'$like':'%'+_0x52ef69['query'][_0xac7b('0x41')]+'%'};return _0x1474c3;}})});}_0x1b4d68=_[_0xac7b('0x42')]({},_0x1b4d68,_0x52ef69['options']);var _0x2522f1={'where':_0x1b4d68['where']};return db['VoiceRecording'][_0xac7b('0x22')](_0x2522f1)[_0xac7b('0x44')](function(_0x42e36e){_0x58cc68[_0xac7b('0x22')]=_0x42e36e;if(_0x52ef69[_0xac7b('0x34')][_0xac7b('0x45')]){_0x1b4d68[_0xac7b('0x46')]=[{'all':!![]}];}return db[_0xac7b('0x2e')]['findAll'](_0x1b4d68);})[_0xac7b('0x44')](function(_0x4a8074){_0x58cc68[_0xac7b('0x47')]=_0x4a8074;return _0x58cc68;})['then'](respondWithFilteredResult(_0x458702,_0x1b4d68))[_0xac7b('0x48')](handleError(_0x458702,null));};exports['show']=function(_0x460edb,_0x29fcd0){var _0x52100a={'raw':![],'where':{'id':_0x460edb[_0xac7b('0x49')]['id']}},_0x2f6e37={};_0x2f6e37[_0xac7b('0x31')]=_[_0xac7b('0x35')](db[_0xac7b('0x2e')][_0xac7b('0x4a')]);_0x2f6e37[_0xac7b('0x34')]=_[_0xac7b('0x35')](_0x460edb[_0xac7b('0x34')]);_0x2f6e37[_0xac7b('0x36')]=_[_0xac7b('0x37')](_0x2f6e37[_0xac7b('0x31')],_0x2f6e37[_0xac7b('0x34')]);_0x52100a['attributes']=_[_0xac7b('0x37')](_0x2f6e37['model'],qs[_0xac7b('0x39')](_0x460edb[_0xac7b('0x34')]['fields']));_0x52100a[_0xac7b('0x38')]=_0x52100a['attributes'][_0xac7b('0x3a')]?_0x52100a[_0xac7b('0x38')]:_0x2f6e37[_0xac7b('0x31')];if(_0x460edb['query'][_0xac7b('0x45')]){_0x52100a[_0xac7b('0x46')]=[{'all':!![]}];}_0x52100a=_[_0xac7b('0x42')]({},_0x52100a,_0x460edb[_0xac7b('0x4b')]);return db[_0xac7b('0x2e')][_0xac7b('0x4c')](_0x52100a)['then'](handleEntityNotFound(_0x29fcd0,null))[_0xac7b('0x44')](respondWithResult(_0x29fcd0,null))[_0xac7b('0x48')](handleError(_0x29fcd0,null));};exports['create']=function(_0x51e0bb,_0x85d2ba){return db[_0xac7b('0x2e')][_0xac7b('0x4d')](_0x51e0bb[_0xac7b('0x4e')],{})[_0xac7b('0x44')](respondWithResult(_0x85d2ba,0xc9))[_0xac7b('0x48')](handleError(_0x85d2ba,null));};exports[_0xac7b('0x28')]=function(_0x1ae1e1,_0xc0f76e){if(_0x1ae1e1['body']['id']){delete _0x1ae1e1[_0xac7b('0x4e')]['id'];}return db[_0xac7b('0x2e')]['find']({'where':{'id':_0x1ae1e1[_0xac7b('0x49')]['id']}})[_0xac7b('0x44')](handleEntityNotFound(_0xc0f76e,null))['then'](saveUpdates(_0x1ae1e1[_0xac7b('0x4e')],null))['then'](respondWithResult(_0xc0f76e,null))[_0xac7b('0x48')](handleError(_0xc0f76e,null));};exports[_0xac7b('0x4f')]=function(_0x2a115c,_0x48ffdf){return db['VoiceRecording']['describe']()['then'](respondWithResult(_0x48ffdf,null))[_0xac7b('0x48')](handleError(_0x48ffdf,null));};exports[_0xac7b('0x50')]=function(_0xc93734,_0x3c4c42,_0x43d578){var _0x5ab993=require(_0xac7b('0x51'));var _0x9d5a93=![];var _0x404bda={};if(_0xc93734[_0xac7b('0x34')][_0xac7b('0x2f')]&&_0xc93734[_0xac7b('0x34')][_0xac7b('0x2f')]==='uniqueid'){_0x404bda[_0xac7b('0x52')]=_0xc93734['params']['id'];}else{_0x404bda['id']=_0xc93734['params']['id'];}return db[_0xac7b('0x2e')][_0xac7b('0x4c')]({'where':_0x404bda,'attributes':['id',_0xac7b('0x53')],'raw':!![]})[_0xac7b('0x44')](handleEntityNotFound(_0x3c4c42,null))[_0xac7b('0x44')](function(_0x5e8290){if(_0x5e8290){var _0x29c2a6=_0x5e8290[_0xac7b('0x53')];var _0xec86fd=util['format']('%s.cypher',_0x29c2a6);if(fs[_0xac7b('0x54')](_0xec86fd)){_0x9d5a93=!![];return _0x5ab993[_0xac7b('0x55')](_0xec86fd,_0x29c2a6,config[_0xac7b('0x56')][_0xac7b('0x57')])['then'](function(){return _0x5e8290;});}return _0x5e8290;}})[_0xac7b('0x44')](function(_0x2cf3fe){if(_0x2cf3fe){var _0x2b2149=_0x2cf3fe[_0xac7b('0x53')];if(!fs[_0xac7b('0x54')](_0x2b2149)){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x5a'));}if(_0x2cf3fe[_0xac7b('0x5b')]){return _0x3c4c42['download'](_0x2b2149,_0x2cf3fe[_0xac7b('0x5b')]+path[_0xac7b('0x5c')](_0x2b2149),function(){if(_0x9d5a93){fs['unlink'](_0x2b2149);}});}else{return _0x3c4c42[_0xac7b('0x50')](_0x2b2149,function(_0x584fdf){if(_0x9d5a93){fs[_0xac7b('0x5d')](_0x2b2149);}});}}})['catch'](function(_0x1e0324){if(_0x1e0324[_0xac7b('0x5e')]===_0xac7b('0x5a')){_0x3c4c42[_0xac7b('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x3c4c42,null);}});};exports['downloads']=function(_0xdf1d9d,_0x5b4534,_0x307103){var _0x4ecb86=require(_0xac7b('0x51'));var _0x132000=![];var _0x58803e={'$and':[db['sequelize'][_0xac7b('0x3f')](db[_0xac7b('0x5f')]['fn'](_0xac7b('0x60'),db[_0xac7b('0x5f')][_0xac7b('0x61')](_0xac7b('0x52'))),_0xdf1d9d[_0xac7b('0x34')][_0xac7b('0x62')])]};if(_0xdf1d9d['query'][_0xac7b('0x2f')]&&_0xdf1d9d[_0xac7b('0x34')][_0xac7b('0x2f')]==='uniqueid'){_0x58803e[_0xac7b('0x63')]['push']({'uniqueid':_0xdf1d9d[_0xac7b('0x49')]['id']});}else{_0x58803e[_0xac7b('0x63')][_0xac7b('0x64')]({'id':_0xdf1d9d[_0xac7b('0x49')]['id']});}return db[_0xac7b('0x2e')][_0xac7b('0x4c')]({'where':_0x58803e,'attributes':['id','value'],'raw':!![]})[_0xac7b('0x44')](handleEntityNotFound(_0x5b4534,null))[_0xac7b('0x44')](function(_0xf2a827){if(_0xf2a827){var _0x2cadfc=util[_0xac7b('0x33')]('%s.cypher',_0xf2a827[_0xac7b('0x53')]);if(fs['existsSync'](_0x2cadfc)){_0x132000=!![];return _0x4ecb86[_0xac7b('0x55')](_0x2cadfc,_0xf2a827[_0xac7b('0x53')],config[_0xac7b('0x56')][_0xac7b('0x57')])[_0xac7b('0x44')](function(){return _0xf2a827;});}return _0xf2a827;}})[_0xac7b('0x44')](function(_0x4443d7){if(_0x4443d7){if(!fs['existsSync'](_0x4443d7[_0xac7b('0x53')])){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x5a'));}if(_0x4443d7[_0xac7b('0x5b')]){return _0x5b4534[_0xac7b('0x50')](_0x4443d7[_0xac7b('0x53')],_0x4443d7[_0xac7b('0x5b')]+path[_0xac7b('0x5c')](_0x4443d7['value']),function(){if(_0x132000){fs['unlink'](_0x4443d7[_0xac7b('0x53')]);}});}else{return _0x5b4534[_0xac7b('0x50')](_0x4443d7[_0xac7b('0x53')],function(_0x4c965f){if(_0x132000){fs['unlink'](_0x4443d7[_0xac7b('0x53')]);}});}}})[_0xac7b('0x48')](handleError(_0x5b4534,null));};exports['destroy']=function(_0x38b7e7,_0x10ed94){return db[_0xac7b('0x2e')]['find']({'where':{'id':_0x38b7e7[_0xac7b('0x49')]['id']}})['then'](function(_0x4ae938){if(_[_0xac7b('0x65')](_0x4ae938)){throw new ReferenceError(_0xac7b('0x66'));}return _0x4ae938;})[_0xac7b('0x44')](function(_0x937d3c){var _0x2a89bf=_0x937d3c[_0xac7b('0x53')];logger[_0xac7b('0x67')](_0xac7b('0x68'),_0x2a89bf);if(!_[_0xac7b('0x65')](_0x937d3c[_0xac7b('0x53')])&&fs[_0xac7b('0x54')](_0x2a89bf)){logger[_0xac7b('0x67')](_0xac7b('0x69')+_0x2a89bf+_0xac7b('0x6a'));fs['unlinkSync'](_0x2a89bf);}_0x2a89bf=_0x2a89bf+_0xac7b('0x6b');if(!_['isNil'](_0x937d3c[_0xac7b('0x53')])&&fs[_0xac7b('0x54')](_0x2a89bf)){logger[_0xac7b('0x67')](_0xac7b('0x69')+_0x2a89bf+_0xac7b('0x6a'));fs[_0xac7b('0x6c')](_0x2a89bf);}return _0x937d3c;})['then'](function(_0x3aaff2){if(!_0x3aaff2)throw new InternalError();return _0x3aaff2[_0xac7b('0x29')]();})['then'](function(){_0x10ed94['status'](0xcc)[_0xac7b('0x1d')]();})[_0xac7b('0x48')](handleError(_0x10ed94,null));};function getBucketslist(_0x2d5592,_0x493075,_0x38273b){return new Promise(function(_0x5f24b0,_0x585f85){var _0x594c43=new AWS['S3']({'accessKeyId':_0x493075,'secretAccessKey':_0x2d5592,'region':_0x38273b});_0x594c43[_0xac7b('0x6d')]({},function(_0x55a88a,_0x1358aa){if(_0x55a88a){return _0x585f85(_0x55a88a);}else{return _0x5f24b0(_0x1358aa);}});});}function createBucket(_0xed7b27,_0xb59937,_0x510750,_0x65741c){return new Promise(function(_0x5e1d66,_0x55afcc){var _0x5ec2c8=new AWS['S3']({'accessKeyId':_0xb59937,'secretAccessKey':_0xed7b27,'region':_0x510750});_0x5ec2c8[_0xac7b('0x6e')]({'Bucket':_0x65741c},function(_0x2203f7,_0x4161b5){if(_0x2203f7){return _0x55afcc(_0x2203f7);}else{return _0x5e1d66(_0x4161b5);}});});}function uploadFile(_0x4e2f18,_0x2341e3,_0x4b93ea,_0x4cdd6f,_0x258113,_0x19440c){return new Promise(function(_0x14df70,_0x43249c){var _0x3e41f5=new AWS['S3']({'accessKeyId':_0x2341e3,'secretAccessKey':_0x4e2f18,'region':_0x4b93ea});_0x3e41f5[_0xac7b('0x6f')]({'Bucket':_0x4cdd6f,'Key':_0x258113,'Body':_0x19440c},function(_0x2be5fd,_0x87765a){if(_0x2be5fd){return _0x43249c(_0x2be5fd);}else{return _0x14df70(_0x87765a);}});});}function startTranscribe(_0x514ba7,_0x14a7da,_0xb4f4f3,_0x472fde,_0x297084,_0x16c9b9){return new Promise(function(_0x493722,_0x2c8446){var _0x4e2ba9=new AWS[(_0xac7b('0x70'))]({'accessKeyId':_0x14a7da,'secretAccessKey':_0x514ba7,'region':_0xb4f4f3});_0x4e2ba9['startTranscriptionJob']({'TranscriptionJobName':_0x472fde,'LanguageCode':_0x297084,'Media':{'MediaFileUri':_0x16c9b9}},function(_0x5daa14,_0x1101f2){if(_0x5daa14){return _0x2c8446(_0x5daa14);}else{return _0x493722(_0x1101f2);}});});}function transcribe(_0x336db9,_0x378d04,_0x985e51,_0x40459e,_0xcee777,_0x5591da,_0x21c854){return new Promise(function(_0x4fe8f4,_0x394cc7){var _0x5d0df8={};logger['info'](util[_0xac7b('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x336db9,_0xcee777));return uploadFile(_0x378d04,_0x985e51,_0x40459e,_0xcee777,path['basename'](_0x5591da),fs['readFileSync'](_0x5591da))[_0xac7b('0x44')](function(_0x5a952b){logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x71'),_0x336db9,_0xcee777,_0x5a952b[_0xac7b('0x72')]));_0x5d0df8[_0xac7b('0x73')]=_0x5a952b['Bucket'];_0x5d0df8[_0xac7b('0x74')]=_0x5a952b[_0xac7b('0x72')];logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x75'),_0x336db9));return startTranscribe(_0x378d04,_0x985e51,_0x40459e,uuidv4(),_0x21c854,_0x5a952b[_0xac7b('0x72')]);})['then'](function(_0x3a5cd0){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x336db9,_0x3a5cd0['TranscriptionJob'][_0xac7b('0x76')]));_0x5d0df8['transcribeName']=_0x3a5cd0['TranscriptionJob'][_0xac7b('0x76')];_0x5d0df8['transcribeStatus']=_0x3a5cd0[_0xac7b('0x77')][_0xac7b('0x78')];return _0x4fe8f4(_0x5d0df8);})[_0xac7b('0x48')](function(_0x1a2e82){return _0x394cc7(_0x1a2e82);});});}exports[_0xac7b('0x79')]=function(_0xb8fbb8,_0x2b1721,_0xe97009){var _0x3a7dab;var _0x47dad8;var _0x1e6b73;var _0x5f0b02=require('../../components/encryptor');return db[_0xac7b('0x2e')][_0xac7b('0x7a')]({'where':{'id':_0xb8fbb8[_0xac7b('0x49')]['id']}})[_0xac7b('0x44')](function(_0x5d784b){if(_0x5d784b){var _0x5f7f68=util[_0xac7b('0x33')](_0xac7b('0x7b'),_0x5d784b[_0xac7b('0x53')]);if(fs[_0xac7b('0x54')](_0x5f7f68)){cypher=!![];return _0x5f0b02['decryptFile'](_0x5f7f68,_0x5d784b[_0xac7b('0x53')],config[_0xac7b('0x56')]['recording'])[_0xac7b('0x44')](function(){return _0x5d784b;});}return _0x5d784b;}})[_0xac7b('0x44')](function(_0x26cb5f){if(!_0x26cb5f){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))]('Voice\x20Recording\x20not\x20found');}_0x47dad8=_0x26cb5f;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2b1721,null))['then'](function(_0x374ef9){if(_0x374ef9){_0x3a7dab=_0x374ef9;if(!_0x3a7dab[_0xac7b('0x7c')]||!_0x3a7dab[_0xac7b('0x7d')]||!_0x3a7dab[_0xac7b('0x7e')]||!_0x3a7dab[_0xac7b('0x7f')]||!_0x3a7dab[_0xac7b('0x73')]){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x80'));}if(_0xb8fbb8[_0xac7b('0x4e')]['runSentiment']&&(!_0x3a7dab[_0xac7b('0x81')]||!_0x3a7dab[_0xac7b('0x82')]||!_0x3a7dab['sentimentRegion']||!_0x3a7dab[_0xac7b('0x7f')]||!_0x3a7dab[_0xac7b('0x73')])){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x83'));}return db[_0xac7b('0x84')][_0xac7b('0x7a')]({'where':{'id':_0x3a7dab[_0xac7b('0x7d')]}});}})['then'](function(_0x426710){if(!_0x426710){throw new db[(_0xac7b('0x58'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x426710[_0xac7b('0x85')]||!_0x426710[_0xac7b('0x86')]){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x87'));}_0x1e6b73=_0x426710;return getBucketslist(_0x1e6b73['data1'],_0x1e6b73[_0xac7b('0x86')],_0x3a7dab[_0xac7b('0x7e')]);})[_0xac7b('0x44')](function(_0x12d047){if(_0x12d047&&_0x12d047[_0xac7b('0x88')]){var _0x518c09=_[_0xac7b('0x4c')](_0x12d047['Buckets'],function(_0x1bc6c0){return _0x1bc6c0['Name']===_0x3a7dab[_0xac7b('0x73')];});if(!_0x518c09){logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x89'),_0xb8fbb8['params']['id'],_0x3a7dab[_0xac7b('0x73')]));return createBucket(_0x1e6b73[_0xac7b('0x85')],_0x1e6b73[_0xac7b('0x86')],_0x3a7dab[_0xac7b('0x7e')],_0x3a7dab[_0xac7b('0x73')]);}logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x8a'),_0xb8fbb8[_0xac7b('0x49')]['id'],_0x3a7dab[_0xac7b('0x73')]));return;}})[_0xac7b('0x44')](function(_0x1f3a95){if(_0x47dad8[_0xac7b('0x8b')]===_0xac7b('0x8c')){return transcribe(_0xb8fbb8[_0xac7b('0x49')]['id'],_0x1e6b73[_0xac7b('0x85')],_0x1e6b73[_0xac7b('0x86')],_0x3a7dab[_0xac7b('0x7e')],_0x3a7dab[_0xac7b('0x73')],_0x47dad8['value'],_0x3a7dab[_0xac7b('0x7f')]);}else{logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x8d'),_0xb8fbb8[_0xac7b('0x49')]['id']));return{'transcribeStatus':_0xac7b('0x8e')};}})[_0xac7b('0x44')](function(_0x4a1bb2){if(_0x4a1bb2){_0x4a1bb2[_0xac7b('0x8f')]=_0xb8fbb8['body'][_0xac7b('0x90')];return _0x47dad8['updateAttributes'](_0x4a1bb2);}})[_0xac7b('0x44')](respondWithResult(_0x2b1721,null))[_0xac7b('0x48')](handleError(_0x2b1721,null));};function writeFile(_0x1f83f0,_0x1dd54f){return new Promise(function(_0x4812e4,_0x11230b){fs[_0xac7b('0x91')](_0x1dd54f,_0x1f83f0,function(_0x1bf5f5,_0x4a4222){if(_0x1bf5f5){return _0x11230b(_0x1bf5f5);}else{return _0x4812e4(_0x4a4222);}});});}exports['downloadTranscribe']=function(_0x2c0cc5,_0x2e984f,_0x34f514){return db[_0xac7b('0x2e')]['findOne']({'where':{'id':_0x2c0cc5[_0xac7b('0x49')]['id']}})[_0xac7b('0x44')](handleEntityNotFound(_0x2e984f))[_0xac7b('0x44')](function(_0x2094f3){if(_0x2094f3&&_0x2094f3[_0xac7b('0x92')]){var _0x115e25=_0x2094f3['fileText'];var _0x4fdd62=config['root']+_0xac7b('0x93')+_0x2094f3['id']+_0xac7b('0x94');if(fs[_0xac7b('0x54')](_0x4fdd62)){return _0x4fdd62;}return writeFile(_0x115e25,_0x4fdd62)[_0xac7b('0x44')](function(){return _0x4fdd62;});}else{throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x95'));}})['then'](function(_0x416bf4){return _0x2e984f[_0xac7b('0x50')](_0x416bf4);})['catch'](handleError(_0x2e984f));}; \ No newline at end of file +var _0x42dc=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','sequelize','MD5','col','token','$and','push','format','secrets','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','map','query','filters'];(function(_0x15de2e,_0x3bfad6){var _0x127a4e=function(_0x370249){while(--_0x370249){_0x15de2e['push'](_0x15de2e['shift']());}};_0x127a4e(++_0x3bfad6);}(_0x42dc,0x101));var _0xc42d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x42dc[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc42d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc42d('0x1'));var moment=require(_0xc42d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc42d('0x3'));var path=require(_0xc42d('0x4'));var sox=require(_0xc42d('0x5'));var csv=require('to-csv');var ejs=require(_0xc42d('0x6'));var fs=require('fs');var fs_extra=require(_0xc42d('0x7'));var _=require('lodash');var squel=require(_0xc42d('0x8'));var crypto=require(_0xc42d('0x9'));var jsforce=require(_0xc42d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc42d('0xb'));var querystring=require(_0xc42d('0xc'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xc42d('0xd'));var Redis=require(_0xc42d('0xe'));var authService=require(_0xc42d('0xf'));var qs=require(_0xc42d('0x10'));var as=require(_0xc42d('0x11'));var hardwareService=require(_0xc42d('0x12'));var logger=require(_0xc42d('0x13'))('api');var utils=require(_0xc42d('0x14'));var config=require(_0xc42d('0x15'));var licenseUtil=require(_0xc42d('0x16'));var db=require(_0xc42d('0x17'))['db'];function respondWithStatusCode(_0x1b2c50,_0x2977ce){_0x2977ce=_0x2977ce||0xcc;return function(_0x31aa6b){if(_0x31aa6b){return _0x1b2c50['sendStatus'](_0x2977ce);}return _0x1b2c50['status'](_0x2977ce)[_0xc42d('0x18')]();};}function respondWithResult(_0x2f9b34,_0x348391){_0x348391=_0x348391||0xc8;return function(_0x1455d6){if(_0x1455d6){return _0x2f9b34[_0xc42d('0x19')](_0x348391)[_0xc42d('0x1a')](_0x1455d6);}};}function respondWithFilteredResult(_0x2a2de0,_0x36717b){return function(_0x4811d0){if(_0x4811d0){var _0x205a7b=typeof _0x36717b[_0xc42d('0x1b')]==='undefined'&&typeof _0x36717b[_0xc42d('0x1c')]==='undefined';var _0x44df06=_0x4811d0[_0xc42d('0x1d')];var _0x31057e=_0x205a7b?0x0:_0x36717b[_0xc42d('0x1b')];var _0x8a44e9=_0x205a7b?_0x4811d0[_0xc42d('0x1d')]:_0x36717b[_0xc42d('0x1b')]+_0x36717b[_0xc42d('0x1c')];var _0x4e71d9;if(_0x8a44e9>=_0x44df06){_0x8a44e9=_0x44df06;_0x4e71d9=0xc8;}else{_0x4e71d9=0xce;}_0x2a2de0[_0xc42d('0x19')](_0x4e71d9);return _0x2a2de0[_0xc42d('0x1e')](_0xc42d('0x1f'),_0x31057e+'-'+_0x8a44e9+'/'+_0x44df06)[_0xc42d('0x1a')](_0x4811d0);}return null;};}function patchUpdates(_0x340b46){return function(_0x3c08c1){try{jsonpatch[_0xc42d('0x20')](_0x3c08c1,_0x340b46,!![]);}catch(_0x5ecc6b){return BPromise[_0xc42d('0x21')](_0x5ecc6b);}return _0x3c08c1[_0xc42d('0x22')]();};}function saveUpdates(_0x2e073e,_0x1a598a){return function(_0x18d426){if(_0x18d426){return _0x18d426[_0xc42d('0x23')](_0x2e073e)[_0xc42d('0x24')](function(_0x3a8ab5){return _0x3a8ab5;});}return null;};}function removeEntity(_0x3d8423,_0x2ca102){return function(_0x2d4342){if(_0x2d4342){return _0x2d4342[_0xc42d('0x25')]()[_0xc42d('0x24')](function(){_0x3d8423['status'](0xcc)[_0xc42d('0x18')]();});}};}function handleEntityNotFound(_0x48a25b,_0x4a3da6){return function(_0x233abe){if(!_0x233abe){_0x48a25b[_0xc42d('0x26')](0x194);}return _0x233abe;};}function handleError(_0x33a368,_0x321b44){_0x321b44=_0x321b44||0x1f4;return function(_0x3bbba0){logger['error'](_0x3bbba0['stack']);if(_0x3bbba0[_0xc42d('0x27')]){delete _0x3bbba0[_0xc42d('0x27')];}_0x33a368[_0xc42d('0x19')](_0x321b44)[_0xc42d('0x28')](_0x3bbba0);};}exports[_0xc42d('0x29')]=function(_0x3af5ae,_0x1489d5){var _0x311494={},_0x39d73b={},_0x463c01={'count':0x0,'rows':[]};var _0x54cb23=_['map'](db[_0xc42d('0x2a')][_0xc42d('0x2b')],function(_0xa714d1){return{'name':_0xa714d1[_0xc42d('0x2c')],'type':_0xa714d1['type'][_0xc42d('0x2d')]};});_0x39d73b[_0xc42d('0x2e')]=_[_0xc42d('0x2f')](_[_0xc42d('0x30')](_0x54cb23,_0xc42d('0x27')),['format']);_0x39d73b[_0xc42d('0x31')]=_['keys'](_0x3af5ae['query']);_0x39d73b[_0xc42d('0x32')]=_[_0xc42d('0x33')](_0x39d73b[_0xc42d('0x2e')],_0x39d73b[_0xc42d('0x31')]);_0x311494[_0xc42d('0x34')]=_['intersection'](_0x39d73b['model'],qs[_0xc42d('0x35')](_0x3af5ae[_0xc42d('0x31')][_0xc42d('0x35')]));_0x311494[_0xc42d('0x34')]=_0x311494[_0xc42d('0x34')][_0xc42d('0x36')]?_0x311494[_0xc42d('0x34')]:_0x39d73b['model'];if(!_0x3af5ae[_0xc42d('0x31')][_0xc42d('0x37')]('nolimit')){_0x311494[_0xc42d('0x1c')]=qs[_0xc42d('0x1c')](_0x3af5ae[_0xc42d('0x31')][_0xc42d('0x1c')]);_0x311494[_0xc42d('0x1b')]=qs[_0xc42d('0x1b')](_0x3af5ae[_0xc42d('0x31')]['offset']);}_0x311494[_0xc42d('0x38')]=qs[_0xc42d('0x39')](_0x3af5ae[_0xc42d('0x31')][_0xc42d('0x39')]);_0x311494[_0xc42d('0x3a')]=qs[_0xc42d('0x32')](_[_0xc42d('0x3b')](_0x3af5ae[_0xc42d('0x31')],_0x39d73b[_0xc42d('0x32')]),_0x54cb23);if(_0x3af5ae['query']['filter']){_0x311494[_0xc42d('0x3a')]=_['merge'](_0x311494[_0xc42d('0x3a')],{'$or':_[_0xc42d('0x30')](_0x54cb23,function(_0x5203d5){if(_0x5203d5[_0xc42d('0x3c')]!==_0xc42d('0x3d')){var _0x2d7e77={};_0x2d7e77[_0x5203d5[_0xc42d('0x27')]]={'$like':'%'+_0x3af5ae[_0xc42d('0x31')][_0xc42d('0x3e')]+'%'};return _0x2d7e77;}})});}_0x311494=_[_0xc42d('0x3f')]({},_0x311494,_0x3af5ae[_0xc42d('0x40')]);var _0x4cbd55={'where':_0x311494[_0xc42d('0x3a')]};return db['VoiceRecording']['count'](_0x4cbd55)[_0xc42d('0x24')](function(_0x2a135b){_0x463c01[_0xc42d('0x1d')]=_0x2a135b;if(_0x3af5ae['query']['includeAll']){_0x311494[_0xc42d('0x41')]=[{'all':!![]}];}return db[_0xc42d('0x2a')][_0xc42d('0x42')](_0x311494);})[_0xc42d('0x24')](function(_0x5c4f1a){_0x463c01[_0xc42d('0x43')]=_0x5c4f1a;return _0x463c01;})[_0xc42d('0x24')](respondWithFilteredResult(_0x1489d5,_0x311494))[_0xc42d('0x44')](handleError(_0x1489d5,null));};exports['show']=function(_0xb4f110,_0x10e456){var _0xac84e3={'raw':![],'where':{'id':_0xb4f110[_0xc42d('0x45')]['id']}},_0x5c4a62={};_0x5c4a62[_0xc42d('0x2e')]=_[_0xc42d('0x46')](db[_0xc42d('0x2a')][_0xc42d('0x2b')]);_0x5c4a62[_0xc42d('0x31')]=_[_0xc42d('0x46')](_0xb4f110['query']);_0x5c4a62[_0xc42d('0x32')]=_[_0xc42d('0x33')](_0x5c4a62[_0xc42d('0x2e')],_0x5c4a62['query']);_0xac84e3['attributes']=_[_0xc42d('0x33')](_0x5c4a62[_0xc42d('0x2e')],qs['fields'](_0xb4f110['query'][_0xc42d('0x35')]));_0xac84e3['attributes']=_0xac84e3['attributes']['length']?_0xac84e3[_0xc42d('0x34')]:_0x5c4a62[_0xc42d('0x2e')];if(_0xb4f110['query'][_0xc42d('0x47')]){_0xac84e3['include']=[{'all':!![]}];}_0xac84e3=_['merge']({},_0xac84e3,_0xb4f110[_0xc42d('0x40')]);return db['VoiceRecording'][_0xc42d('0x48')](_0xac84e3)['then'](handleEntityNotFound(_0x10e456,null))[_0xc42d('0x24')](respondWithResult(_0x10e456,null))['catch'](handleError(_0x10e456,null));};exports['create']=function(_0x4a9d5c,_0x1ccd44){return db[_0xc42d('0x2a')][_0xc42d('0x49')](_0x4a9d5c[_0xc42d('0x4a')],{})['then'](respondWithResult(_0x1ccd44,0xc9))[_0xc42d('0x44')](handleError(_0x1ccd44,null));};exports[_0xc42d('0x23')]=function(_0x21f6a2,_0x3686a7){if(_0x21f6a2['body']['id']){delete _0x21f6a2[_0xc42d('0x4a')]['id'];}return db[_0xc42d('0x2a')][_0xc42d('0x48')]({'where':{'id':_0x21f6a2[_0xc42d('0x45')]['id']}})[_0xc42d('0x24')](handleEntityNotFound(_0x3686a7,null))[_0xc42d('0x24')](saveUpdates(_0x21f6a2[_0xc42d('0x4a')],null))[_0xc42d('0x24')](respondWithResult(_0x3686a7,null))[_0xc42d('0x44')](handleError(_0x3686a7,null));};exports['describe']=function(_0x299719,_0x1bcf0c){return db[_0xc42d('0x2a')][_0xc42d('0x4b')]()[_0xc42d('0x24')](respondWithResult(_0x1bcf0c,null))['catch'](handleError(_0x1bcf0c,null));};exports[_0xc42d('0x4c')]=function(_0x52cca0,_0x232713,_0x4c8266){var _0x296629=require(_0xc42d('0x4d'));var _0xcdffeb=![];var _0x4c5216={};if(_0x52cca0[_0xc42d('0x31')][_0xc42d('0x3c')]&&_0x52cca0['query']['type']===_0xc42d('0x4e')){_0x4c5216[_0xc42d('0x4e')]=_0x52cca0[_0xc42d('0x45')]['id'];}else{_0x4c5216['id']=_0x52cca0[_0xc42d('0x45')]['id'];}return db[_0xc42d('0x2a')][_0xc42d('0x48')]({'where':_0x4c5216,'attributes':['id',_0xc42d('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x232713,null))[_0xc42d('0x24')](function(_0x13673e){if(_0x13673e){var _0x2baa86=_0x13673e['value'];var _0x27417b=util['format'](_0xc42d('0x50'),_0x2baa86);if(fs['existsSync'](_0x27417b)){_0xcdffeb=!![];return _0x296629[_0xc42d('0x51')](_0x27417b,_0x2baa86,config['secrets'][_0xc42d('0x52')])[_0xc42d('0x24')](function(){return _0x13673e;});}return _0x13673e;}})['then'](function(_0x4ae346){if(_0x4ae346){var _0x285bbb=_0x4ae346[_0xc42d('0x4f')];if(!fs[_0xc42d('0x53')](_0x285bbb)){throw new db[(_0xc42d('0x54'))][(_0xc42d('0x55'))](_0xc42d('0x56'));}if(_0x4ae346[_0xc42d('0x57')]){return _0x232713[_0xc42d('0x4c')](_0x285bbb,_0x4ae346[_0xc42d('0x57')]+path[_0xc42d('0x58')](_0x285bbb),function(){if(_0xcdffeb){fs[_0xc42d('0x59')](_0x285bbb);}});}else{return _0x232713[_0xc42d('0x4c')](_0x285bbb,function(_0x42a347){if(_0xcdffeb){fs[_0xc42d('0x59')](_0x285bbb);}});}}})['catch'](function(_0xe02eb7){if(_0xe02eb7['message']===_0xc42d('0x56')){_0x232713[_0xc42d('0x19')](0x194)[_0xc42d('0x28')](_0xc42d('0x5a'));}else{return handleError(_0x232713,null);}});};exports['downloads']=function(_0x4f7811,_0x25779c,_0x1ac760){var _0x1098a8=require(_0xc42d('0x4d'));var _0x1bb0c1=![];var _0x167c22={'$and':[db[_0xc42d('0x5b')][_0xc42d('0x3a')](db[_0xc42d('0x5b')]['fn'](_0xc42d('0x5c'),db[_0xc42d('0x5b')][_0xc42d('0x5d')](_0xc42d('0x4e'))),_0x4f7811['query'][_0xc42d('0x5e')])]};if(_0x4f7811[_0xc42d('0x31')][_0xc42d('0x3c')]&&_0x4f7811[_0xc42d('0x31')][_0xc42d('0x3c')]==='uniqueid'){_0x167c22[_0xc42d('0x5f')][_0xc42d('0x60')]({'uniqueid':_0x4f7811[_0xc42d('0x45')]['id']});}else{_0x167c22[_0xc42d('0x5f')][_0xc42d('0x60')]({'id':_0x4f7811[_0xc42d('0x45')]['id']});}return db['VoiceRecording'][_0xc42d('0x48')]({'where':_0x167c22,'attributes':['id',_0xc42d('0x4f')],'raw':!![]})[_0xc42d('0x24')](handleEntityNotFound(_0x25779c,null))[_0xc42d('0x24')](function(_0x556db6){if(_0x556db6){var _0x4d1709=util[_0xc42d('0x61')](_0xc42d('0x50'),_0x556db6[_0xc42d('0x4f')]);if(fs['existsSync'](_0x4d1709)){_0x1bb0c1=!![];return _0x1098a8['decryptFile'](_0x4d1709,_0x556db6['value'],config[_0xc42d('0x62')][_0xc42d('0x52')])['then'](function(){return _0x556db6;});}return _0x556db6;}})[_0xc42d('0x24')](function(_0x10b857){if(_0x10b857){if(!fs[_0xc42d('0x53')](_0x10b857[_0xc42d('0x4f')])){throw new db[(_0xc42d('0x54'))][(_0xc42d('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x10b857['filename']){return _0x25779c['download'](_0x10b857[_0xc42d('0x4f')],_0x10b857[_0xc42d('0x57')]+path['extname'](_0x10b857['value']),function(){if(_0x1bb0c1){fs[_0xc42d('0x59')](_0x10b857[_0xc42d('0x4f')]);}});}else{return _0x25779c[_0xc42d('0x4c')](_0x10b857[_0xc42d('0x4f')],function(_0xeb9056){if(_0x1bb0c1){fs[_0xc42d('0x59')](_0x10b857[_0xc42d('0x4f')]);}});}}})[_0xc42d('0x44')](handleError(_0x25779c,null));};exports[_0xc42d('0x25')]=function(_0xa1001e,_0x3abeff){return db['VoiceRecording'][_0xc42d('0x48')]({'where':{'id':_0xa1001e[_0xc42d('0x45')]['id']}})[_0xc42d('0x24')](function(_0xefc3ed){if(_[_0xc42d('0x63')](_0xefc3ed)){throw new ReferenceError('Entity\x20not\x20found');}return _0xefc3ed;})[_0xc42d('0x24')](function(_0x2472b8){var _0x3fc199=_0x2472b8[_0xc42d('0x4f')];logger[_0xc42d('0x64')](_0xc42d('0x65'),_0x3fc199);if(!_[_0xc42d('0x63')](_0x2472b8['value'])&&fs[_0xc42d('0x53')](_0x3fc199)){logger['info'](_0xc42d('0x66')+_0x3fc199+_0xc42d('0x67'));fs[_0xc42d('0x68')](_0x3fc199);}_0x3fc199=_0x3fc199+_0xc42d('0x69');if(!_['isNil'](_0x2472b8[_0xc42d('0x4f')])&&fs['existsSync'](_0x3fc199)){logger[_0xc42d('0x64')]('File:\x20\x22'+_0x3fc199+_0xc42d('0x67'));fs[_0xc42d('0x68')](_0x3fc199);}return _0x2472b8;})[_0xc42d('0x24')](function(_0x23ef91){if(!_0x23ef91)throw new InternalError();return _0x23ef91[_0xc42d('0x25')]();})[_0xc42d('0x24')](function(){_0x3abeff[_0xc42d('0x19')](0xcc)[_0xc42d('0x18')]();})[_0xc42d('0x44')](handleError(_0x3abeff,null));};function getBucketslist(_0x4dcb9f,_0x675ee2,_0x3492cf){return new Promise(function(_0x4c29b8,_0x19cc3e){var _0xa6359a=new AWS['S3']({'accessKeyId':_0x675ee2,'secretAccessKey':_0x4dcb9f,'region':_0x3492cf});_0xa6359a[_0xc42d('0x6a')]({},function(_0x4e6a42,_0x3cdf31){if(_0x4e6a42){return _0x19cc3e(_0x4e6a42);}else{return _0x4c29b8(_0x3cdf31);}});});}function createBucket(_0xc56ce9,_0x57f04d,_0x3293b7,_0x45597c){return new Promise(function(_0x22d53c,_0x1ff0fd){var _0x36df0d=new AWS['S3']({'accessKeyId':_0x57f04d,'secretAccessKey':_0xc56ce9,'region':_0x3293b7});_0x36df0d[_0xc42d('0x6b')]({'Bucket':_0x45597c},function(_0xd48902,_0x7fab1d){if(_0xd48902){return _0x1ff0fd(_0xd48902);}else{return _0x22d53c(_0x7fab1d);}});});}function uploadFile(_0x583eb1,_0x3e3d45,_0x4c021f,_0x379e8e,_0x2d3af,_0x1bdcae){return new Promise(function(_0x1df8f5,_0xf3adc6){var _0x109a31=new AWS['S3']({'accessKeyId':_0x3e3d45,'secretAccessKey':_0x583eb1,'region':_0x4c021f});_0x109a31[_0xc42d('0x6c')]({'Bucket':_0x379e8e,'Key':_0x2d3af,'Body':_0x1bdcae},function(_0x44d133,_0x21f7cc){if(_0x44d133){return _0xf3adc6(_0x44d133);}else{return _0x1df8f5(_0x21f7cc);}});});}function startTranscribe(_0xf4a23a,_0x56bb74,_0x5d6f5a,_0x3c476f,_0x32d371,_0x414bb0){return new Promise(function(_0x4caced,_0x4a5954){var _0x1af45e=new AWS[(_0xc42d('0x6d'))]({'accessKeyId':_0x56bb74,'secretAccessKey':_0xf4a23a,'region':_0x5d6f5a});_0x1af45e[_0xc42d('0x6e')]({'TranscriptionJobName':_0x3c476f,'LanguageCode':_0x32d371,'Media':{'MediaFileUri':_0x414bb0}},function(_0x4270cb,_0x19a8bc){if(_0x4270cb){return _0x4a5954(_0x4270cb);}else{return _0x4caced(_0x19a8bc);}});});}function transcribe(_0x423b5b,_0x54a4b3,_0x1ea954,_0x44163c,_0x2f9be2,_0x4809f4,_0x29fbed){return new Promise(function(_0x37d9d9,_0x274c6f){var _0xb1796d={};logger[_0xc42d('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x423b5b,_0x2f9be2));return uploadFile(_0x54a4b3,_0x1ea954,_0x44163c,_0x2f9be2,path['basename'](_0x4809f4),fs[_0xc42d('0x6f')](_0x4809f4))[_0xc42d('0x24')](function(_0x2cf09f){logger[_0xc42d('0x64')](util[_0xc42d('0x61')](_0xc42d('0x70'),_0x423b5b,_0x2f9be2,_0x2cf09f['Location']));_0xb1796d[_0xc42d('0x71')]=_0x2cf09f[_0xc42d('0x72')];_0xb1796d[_0xc42d('0x73')]=_0x2cf09f[_0xc42d('0x74')];logger[_0xc42d('0x64')](util[_0xc42d('0x61')](_0xc42d('0x75'),_0x423b5b));return startTranscribe(_0x54a4b3,_0x1ea954,_0x44163c,uuidv4(),_0x29fbed,_0x2cf09f['Location']);})['then'](function(_0x5c5aa3){logger[_0xc42d('0x64')](util[_0xc42d('0x61')](_0xc42d('0x76'),_0x423b5b,_0x5c5aa3[_0xc42d('0x77')][_0xc42d('0x78')]));_0xb1796d[_0xc42d('0x79')]=_0x5c5aa3[_0xc42d('0x77')]['TranscriptionJobName'];_0xb1796d['transcribeStatus']=_0x5c5aa3[_0xc42d('0x77')]['TranscriptionJobStatus'];return _0x37d9d9(_0xb1796d);})[_0xc42d('0x44')](function(_0x247323){return _0x274c6f(_0x247323);});});}exports['runTranscribe']=function(_0x3f383b,_0x335dea,_0x53b00e){var _0x2d0a56;var _0x140073;var _0x314414;var _0x359c1a=require(_0xc42d('0x4d'));return db['VoiceRecording']['findOne']({'where':{'id':_0x3f383b['params']['id']}})[_0xc42d('0x24')](function(_0x556e12){if(_0x556e12){var _0x44924d=util[_0xc42d('0x61')]('%s.cypher',_0x556e12[_0xc42d('0x4f')]);if(fs[_0xc42d('0x53')](_0x44924d)){cypher=!![];return _0x359c1a[_0xc42d('0x51')](_0x44924d,_0x556e12[_0xc42d('0x4f')],config[_0xc42d('0x62')][_0xc42d('0x52')])['then'](function(){return _0x556e12;});}return _0x556e12;}})[_0xc42d('0x24')](function(_0x438400){if(!_0x438400){throw new db['Sequelize'][(_0xc42d('0x55'))](_0xc42d('0x7a'));}_0x140073=_0x438400;return db[_0xc42d('0x7b')][_0xc42d('0x7c')]({'where':{'id':0x1}});})[_0xc42d('0x24')](handleEntityNotFound(_0x335dea,null))[_0xc42d('0x24')](function(_0x16f94d){if(_0x16f94d){_0x2d0a56=_0x16f94d;if(!_0x2d0a56[_0xc42d('0x7d')]||!_0x2d0a56[_0xc42d('0x7e')]||!_0x2d0a56['transcribeRegion']||!_0x2d0a56[_0xc42d('0x7f')]||!_0x2d0a56[_0xc42d('0x71')]){throw new db['Sequelize'][(_0xc42d('0x55'))](_0xc42d('0x80'));}if(_0x3f383b[_0xc42d('0x4a')]['runSentiment']&&(!_0x2d0a56[_0xc42d('0x81')]||!_0x2d0a56[_0xc42d('0x82')]||!_0x2d0a56[_0xc42d('0x83')]||!_0x2d0a56[_0xc42d('0x7f')]||!_0x2d0a56[_0xc42d('0x71')])){throw new db[(_0xc42d('0x54'))][(_0xc42d('0x55'))](_0xc42d('0x84'));}return db[_0xc42d('0x85')][_0xc42d('0x7c')]({'where':{'id':_0x2d0a56[_0xc42d('0x7e')]}});}})[_0xc42d('0x24')](function(_0x5e65d6){if(!_0x5e65d6){throw new db['Sequelize'][(_0xc42d('0x55'))](_0xc42d('0x86'));}if(!_0x5e65d6[_0xc42d('0x87')]||!_0x5e65d6[_0xc42d('0x88')]){throw new db[(_0xc42d('0x54'))]['ValidationError'](_0xc42d('0x89'));}_0x314414=_0x5e65d6;return getBucketslist(_0x314414[_0xc42d('0x87')],_0x314414[_0xc42d('0x88')],_0x2d0a56[_0xc42d('0x8a')]);})[_0xc42d('0x24')](function(_0x230e33){if(_0x230e33&&_0x230e33[_0xc42d('0x8b')]){var _0x45a207=_[_0xc42d('0x48')](_0x230e33[_0xc42d('0x8b')],function(_0x40f99c){return _0x40f99c[_0xc42d('0x8c')]===_0x2d0a56[_0xc42d('0x71')];});if(!_0x45a207){logger['info'](util[_0xc42d('0x61')](_0xc42d('0x8d'),_0x3f383b[_0xc42d('0x45')]['id'],_0x2d0a56[_0xc42d('0x71')]));return createBucket(_0x314414[_0xc42d('0x87')],_0x314414['data2'],_0x2d0a56['transcribeRegion'],_0x2d0a56[_0xc42d('0x71')]);}logger[_0xc42d('0x64')](util['format'](_0xc42d('0x8e'),_0x3f383b[_0xc42d('0x45')]['id'],_0x2d0a56[_0xc42d('0x71')]));return;}})[_0xc42d('0x24')](function(_0x3b792c){if(_0x140073['transcribeStatus']===_0xc42d('0x8f')){return transcribe(_0x3f383b[_0xc42d('0x45')]['id'],_0x314414[_0xc42d('0x87')],_0x314414[_0xc42d('0x88')],_0x2d0a56['transcribeRegion'],_0x2d0a56[_0xc42d('0x71')],_0x140073['value'],_0x2d0a56[_0xc42d('0x7f')]);}else{logger[_0xc42d('0x64')](util[_0xc42d('0x61')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x3f383b[_0xc42d('0x45')]['id']));return{'transcribeStatus':_0xc42d('0x90')};}})['then'](function(_0x4b404d){if(_0x4b404d){_0x4b404d[_0xc42d('0x91')]=_0x3f383b[_0xc42d('0x4a')][_0xc42d('0x92')];return _0x140073[_0xc42d('0x93')](_0x4b404d);}})['then'](respondWithResult(_0x335dea,null))[_0xc42d('0x44')](handleError(_0x335dea,null));};function writeFile(_0x49e92b,_0x2c854e){return new Promise(function(_0x80025,_0x553871){fs[_0xc42d('0x94')](_0x2c854e,_0x49e92b,function(_0x18d58b,_0x37ca6a){if(_0x18d58b){return _0x553871(_0x18d58b);}else{return _0x80025(_0x37ca6a);}});});}exports[_0xc42d('0x95')]=function(_0x53127a,_0x5d3d59,_0x3c6dc7){return db[_0xc42d('0x2a')]['findOne']({'where':{'id':_0x53127a['params']['id']}})[_0xc42d('0x24')](handleEntityNotFound(_0x5d3d59))[_0xc42d('0x24')](function(_0x5879cd){if(_0x5879cd&&_0x5879cd[_0xc42d('0x96')]){var _0x1e89b9=_0x5879cd[_0xc42d('0x96')];var _0x35fe0c=config[_0xc42d('0x97')]+_0xc42d('0x98')+_0x5879cd['id']+_0xc42d('0x99');if(fs['existsSync'](_0x35fe0c)){return _0x35fe0c;}return writeFile(_0x1e89b9,_0x35fe0c)[_0xc42d('0x24')](function(){return _0x35fe0c;});}else{throw new db['Sequelize']['ValidationError']('Transcript\x20not\x20available');}})['then'](function(_0x397b9b){return _0x5d3d59['download'](_0x397b9b);})[_0xc42d('0x44')](handleError(_0x5d3d59));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 9f506bb..301f9ec 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 _0x20cc=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid'];(function(_0x802244,_0x2deac1){var _0x303abf=function(_0x271094){while(--_0x271094){_0x802244['push'](_0x802244['shift']());}};_0x303abf(++_0x2deac1);}(_0x20cc,0x196));var _0xc20c=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x20cc[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var logger=require(_0xc20c('0x2'))('api');var moment=require(_0xc20c('0x3'));var BPromise=require(_0xc20c('0x4'));var rp=require(_0xc20c('0x5'));var fs=require('fs');var path=require(_0xc20c('0x6'));var rimraf=require(_0xc20c('0x7'));var config=require(_0xc20c('0x8'));var attributes=require(_0xc20c('0x9'));module[_0xc20c('0xa')]=function(_0xaa5fce,_0x34f9ac){return _0xaa5fce[_0xc20c('0xb')](_0xc20c('0xc'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xc20c('0xd'),'fields':[_0xc20c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa868=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','uniqueid','lodash','util','../../config/logger','api'];(function(_0xbda185,_0xc13c27){var _0x4700e1=function(_0x3bf0ef){while(--_0x3bf0ef){_0xbda185['push'](_0xbda185['shift']());}};_0x4700e1(++_0xc13c27);}(_0xa868,0x1b8));var _0x8a86=function(_0x2d8fdb,_0x30e70c){_0x2d8fdb=_0x2d8fdb-0x0;var _0x3bc1c2=_0xa868[_0x2d8fdb];return _0x3bc1c2;};'use strict';var _=require(_0x8a86('0x0'));var util=require(_0x8a86('0x1'));var logger=require(_0x8a86('0x2'))(_0x8a86('0x3'));var moment=require(_0x8a86('0x4'));var BPromise=require(_0x8a86('0x5'));var rp=require(_0x8a86('0x6'));var fs=require('fs');var path=require(_0x8a86('0x7'));var rimraf=require(_0x8a86('0x8'));var config=require(_0x8a86('0x9'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x41c0dc,_0x368ab8){return _0x41c0dc[_0x8a86('0xa')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8a86('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 17e351a..25c0a80 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 _0x4e2e=['error','message','result','VoiceRecording','update','body','options','raw','attributes','limit','UpdateVoiceRecording','debug','catch','../../components/encryptor','findOne','create','callRecordingEncryption','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d08f2,_0x2ce505){var _0xf7b7a9=function(_0xab5ab2){while(--_0xab5ab2){_0x1d08f2['push'](_0x1d08f2['shift']());}};_0xf7b7a9(++_0x2ce505);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x57299f,_0x77ba3e){_0x57299f=_0x57299f-0x0;var _0x1c1266=_0x4e2e[_0x57299f];return _0x1c1266;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}exports['UpdateVoiceRecording']=function(_0x196f16){var _0x54c80b=this;return new Promise(function(_0x1d5e9d,_0x3f313b){return db[_0xe4e2('0x15')][_0xe4e2('0x16')](_0x196f16[_0xe4e2('0x17')],{'raw':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')]['where']||null:null,'attributes':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x1a')]||null:null,'limit':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x1b')]||null:null})[_0xe4e2('0xc')](function(_0x51c67e){logger[_0xe4e2('0xd')](_0xe4e2('0x1c'),_0x196f16);logger[_0xe4e2('0x1d')]('UpdateVoiceRecording',_0x196f16,JSON[_0xe4e2('0x11')](_0x51c67e));_0x1d5e9d(_0x51c67e);})[_0xe4e2('0x1e')](function(_0x598fa3){logger[_0xe4e2('0x12')](_0xe4e2('0x1c'),_0x598fa3[_0xe4e2('0x13')],_0x196f16);_0x3f313b(_0x54c80b[_0xe4e2('0x12')](0x1f4,_0x598fa3[_0xe4e2('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x166610){var _0x357903=this;return new Promise(function(_0x1f6d1f,_0x5120fd){var _0x3a31b8=require(_0xe4e2('0x1f'));var _0x31f651;return db['Setting'][_0xe4e2('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xe4e2('0xc')](function(_0x1e21c0){_0x31f651=_0x1e21c0;return db['VoiceRecording'][_0xe4e2('0x21')](_0x166610[_0xe4e2('0x17')]);})[_0xe4e2('0xc')](function(_0x41500b){if(_0x31f651[_0xe4e2('0x22')]&&fs['existsSync'](_0x41500b['value'])){var _0x2cb235=util[_0xe4e2('0x23')](_0xe4e2('0x24'),_0x41500b[_0xe4e2('0x25')]);return _0x3a31b8[_0xe4e2('0x26')](_0x41500b[_0xe4e2('0x25')],_0x2cb235,config[_0xe4e2('0x27')][_0xe4e2('0x28')])[_0xe4e2('0xc')](function(){fs[_0xe4e2('0x29')](_0x41500b[_0xe4e2('0x25')]);logger[_0xe4e2('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x41500b;});}return _0x41500b;})[_0xe4e2('0xc')](function(_0x8ffc6){logger[_0xe4e2('0xd')](_0xe4e2('0x2a'),_0x166610);logger[_0xe4e2('0x1d')](_0xe4e2('0x2a'),_0x166610,JSON['stringify'](_0x8ffc6));_0x1f6d1f(_0x8ffc6);})[_0xe4e2('0x1e')](function(_0x286714){logger[_0xe4e2('0x12')](_0xe4e2('0x2a'),_0x286714[_0xe4e2('0x13')],_0x166610);_0x5120fd(_0x357903[_0xe4e2('0x12')](0x1f4,_0x286714[_0xe4e2('0x13')]));});});}; \ No newline at end of file +var _0x9582=['UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceRecording','body','options','where','attributes','limit','then'];(function(_0x2081ab,_0x4e2db2){var _0x7cad1f=function(_0x463637){while(--_0x463637){_0x2081ab['push'](_0x2081ab['shift']());}};_0x7cad1f(++_0x4e2db2);}(_0x9582,0x95));var _0x2958=function(_0x2944f5,_0xa679a5){_0x2944f5=_0x2944f5-0x0;var _0x135c91=_0x9582[_0x2944f5];return _0x135c91;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}exports['UpdateVoiceRecording']=function(_0x28a92c){var _0x160949=this;return new Promise(function(_0x310d07,_0x42bb99){return db[_0x2958('0x18')]['update'](_0x28a92c[_0x2958('0x19')],{'raw':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a92c[_0x2958('0x1a')]?_0x28a92c['options'][_0x2958('0x1b')]||null:null,'attributes':_0x28a92c['options']?_0x28a92c['options'][_0x2958('0x1c')]||null:null,'limit':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')][_0x2958('0x1d')]||null:null})[_0x2958('0x1e')](function(_0x412e42){logger[_0x2958('0x16')](_0x2958('0x1f'),_0x28a92c);logger[_0x2958('0xf')](_0x2958('0x1f'),_0x28a92c,JSON[_0x2958('0x12')](_0x412e42));_0x310d07(_0x412e42);})[_0x2958('0x20')](function(_0x119242){logger[_0x2958('0x13')](_0x2958('0x1f'),_0x119242['message'],_0x28a92c);_0x42bb99(_0x160949['error'](0x1f4,_0x119242[_0x2958('0x15')]));});});};exports[_0x2958('0x21')]=function(_0x28c1f5){var _0x43cf73=this;return new Promise(function(_0x52bd32,_0x2bd1ac){var _0x57ae96=require(_0x2958('0x22'));var _0x40adce;return db[_0x2958('0x23')][_0x2958('0x24')]({'attributes':['id',_0x2958('0x25')],'where':{'id':0x1},'raw':!![]})[_0x2958('0x1e')](function(_0x153958){_0x40adce=_0x153958;return db['VoiceRecording'][_0x2958('0x26')](_0x28c1f5['body']);})['then'](function(_0x28ee09){if(_0x40adce[_0x2958('0x25')]&&fs[_0x2958('0x27')](_0x28ee09[_0x2958('0x28')])){var _0x584179=util[_0x2958('0x29')](_0x2958('0x2a'),_0x28ee09[_0x2958('0x28')]);return _0x57ae96['encryptFile'](_0x28ee09[_0x2958('0x28')],_0x584179,config[_0x2958('0x2b')]['recording'])[_0x2958('0x1e')](function(){fs['unlink'](_0x28ee09[_0x2958('0x28')]);logger['info'](_0x2958('0x2c'));return _0x28ee09;});}return _0x28ee09;})['then'](function(_0x4477b5){logger[_0x2958('0x16')](_0x2958('0x21'),_0x28c1f5);logger[_0x2958('0xf')](_0x2958('0x21'),_0x28c1f5,JSON[_0x2958('0x12')](_0x4477b5));_0x52bd32(_0x4477b5);})[_0x2958('0x20')](function(_0x58f9b4){logger[_0x2958('0x13')]('CreateVoiceRecording',_0x58f9b4[_0x2958('0x15')],_0x28c1f5);_0x2bd1ac(_0x43cf73['error'](0x1f4,_0x58f9b4[_0x2958('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 63e3771..2f4413d 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 _0x7547=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7547,0x121));var _0x7754=function(_0x167e3a,_0x30f118){_0x167e3a=_0x167e3a-0x0;var _0x15a5aa=_0x7547[_0x167e3a];return _0x15a5aa;};'use strict';var multer=require(_0x7754('0x0'));var util=require(_0x7754('0x1'));var path=require('path');var timeout=require(_0x7754('0x2'));var express=require(_0x7754('0x3'));var router=express[_0x7754('0x4')]();var fs_extra=require(_0x7754('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7754('0x6'));var config=require(_0x7754('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x7754('0x8')]('/',auth[_0x7754('0x9')](),controller[_0x7754('0xa')]);router[_0x7754('0x8')](_0x7754('0xb'),auth[_0x7754('0x9')](),controller['describe']);router[_0x7754('0x8')](_0x7754('0xc'),auth[_0x7754('0x9')](),controller[_0x7754('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7754('0xe')]);router[_0x7754('0xf')](_0x7754('0xc'),auth[_0x7754('0x9')](),controller['update']);router[_0x7754('0x10')](_0x7754('0xc'),auth[_0x7754('0x9')](),controller[_0x7754('0x11')]);module[_0x7754('0x12')]=router; \ No newline at end of file +var _0x80fc=['multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','update','destroy'];(function(_0x1096af,_0x18174d){var _0x71c380=function(_0x3e661b){while(--_0x3e661b){_0x1096af['push'](_0x1096af['shift']());}};_0x71c380(++_0x18174d);}(_0x80fc,0x1b3));var _0xc80f=function(_0x309fe7,_0x23cbdf){_0x309fe7=_0x309fe7-0x0;var _0x82d4ba=_0x80fc[_0x309fe7];return _0x82d4ba;};'use strict';var multer=require(_0xc80f('0x0'));var util=require(_0xc80f('0x1'));var path=require(_0xc80f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc80f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc80f('0x4'));var config=require(_0xc80f('0x5'));var controller=require('./voiceTransferReport.controller');router[_0xc80f('0x6')]('/',auth[_0xc80f('0x7')](),controller['index']);router[_0xc80f('0x6')](_0xc80f('0x8'),auth[_0xc80f('0x7')](),controller[_0xc80f('0x9')]);router['get'](_0xc80f('0xa'),auth[_0xc80f('0x7')](),controller[_0xc80f('0xb')]);router[_0xc80f('0xc')]('/',auth[_0xc80f('0x7')](),controller['create']);router['put']('/:id',auth[_0xc80f('0x7')](),controller[_0xc80f('0xd')]);router['delete'](_0xc80f('0xa'),auth[_0xc80f('0x7')](),controller[_0xc80f('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d6121f7..e1122b1 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 _0xbb4e=['blind','attended','STRING','sequelize','moment','ENUM'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xbb4e,0xbd));var _0xebb4=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xbb4e[_0x28394f];return _0x2618d2;};'use strict';var Sequelize=require(_0xebb4('0x0'));var moment=require(_0xebb4('0x1'));module['exports']={'type':{'type':Sequelize[_0xebb4('0x2')](_0xebb4('0x3'),_0xebb4('0x4'))},'result':{'type':Sequelize[_0xebb4('0x5')]},'transfererchannel':{'type':Sequelize[_0xebb4('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xebb4('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xebb4('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xebb4('0x5')]},'transferercontext':{'type':Sequelize[_0xebb4('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xebb4('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xebb4('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xebb4('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xebb4('0x5')]},'transfereecontext':{'type':Sequelize[_0xebb4('0x5')]},'transfereeexten':{'type':Sequelize[_0xebb4('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xebb4('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xebb4('0x5')]},'extension':{'type':Sequelize[_0xebb4('0x5')]}}; \ No newline at end of file +var _0xc301=['STRING','Yes','sequelize','moment','exports','ENUM','blind','attended'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc301,0x72));var _0x1c30=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc301[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x1c30('0x0'));var moment=require(_0x1c30('0x1'));module[_0x1c30('0x2')]={'type':{'type':Sequelize[_0x1c30('0x3')](_0x1c30('0x4'),_0x1c30('0x5'))},'result':{'type':Sequelize[_0x1c30('0x6')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x1c30('0x6')]},'transferercalleridname':{'type':Sequelize[_0x1c30('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x1c30('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x1c30('0x6')]},'transferercontext':{'type':Sequelize[_0x1c30('0x6')]},'transfererexten':{'type':Sequelize[_0x1c30('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x1c30('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x1c30('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x1c30('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x1c30('0x6')]},'transfereecontext':{'type':Sequelize[_0x1c30('0x6')]},'transfereeexten':{'type':Sequelize[_0x1c30('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x1c30('0x3')](_0x1c30('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x1c30('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 301611d..dd8b5b6 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 _0x6396=['include','findAll','rows','catch','show','params','includeAll','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','options'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x6396,0x140));var _0x6639=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x6396[_0x20cb20];return _0x2fcf4b;};'use strict';var emlformat=require(_0x6639('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6639('0x1'));var jsonpatch=require(_0x6639('0x2'));var rp=require(_0x6639('0x3'));var moment=require(_0x6639('0x4'));var BPromise=require(_0x6639('0x5'));var Mustache=require('mustache');var util=require(_0x6639('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(_0x6639('0x7'));var _=require(_0x6639('0x8'));var squel=require(_0x6639('0x9'));var crypto=require(_0x6639('0xa'));var jsforce=require(_0x6639('0xb'));var deskjs=require(_0x6639('0xc'));var toCsv=require(_0x6639('0xd'));var querystring=require(_0x6639('0xe'));var Papa=require(_0x6639('0xf'));var Redis=require(_0x6639('0x10'));var authService=require(_0x6639('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6639('0x12'));var hardwareService=require(_0x6639('0x13'));var logger=require(_0x6639('0x14'))(_0x6639('0x15'));var utils=require(_0x6639('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6639('0x17'));var db=require(_0x6639('0x18'))['db'];function respondWithStatusCode(_0x46421c,_0x522f1c){_0x522f1c=_0x522f1c||0xcc;return function(_0x557257){if(_0x557257){return _0x46421c[_0x6639('0x19')](_0x522f1c);}return _0x46421c[_0x6639('0x1a')](_0x522f1c)[_0x6639('0x1b')]();};}function respondWithResult(_0x432218,_0x55a42f){_0x55a42f=_0x55a42f||0xc8;return function(_0x2cd22e){if(_0x2cd22e){return _0x432218['status'](_0x55a42f)[_0x6639('0x1c')](_0x2cd22e);}};}function respondWithFilteredResult(_0x3cc5ce,_0x2d6a12){return function(_0x1b4cb4){if(_0x1b4cb4){var _0x2fc7e2=typeof _0x2d6a12[_0x6639('0x1d')]===_0x6639('0x1e')&&typeof _0x2d6a12[_0x6639('0x1f')]===_0x6639('0x1e');var _0xf17c7f=_0x1b4cb4[_0x6639('0x20')];var _0x11df0a=_0x2fc7e2?0x0:_0x2d6a12['offset'];var _0x2827bc=_0x2fc7e2?_0x1b4cb4[_0x6639('0x20')]:_0x2d6a12[_0x6639('0x1d')]+_0x2d6a12[_0x6639('0x1f')];var _0x45376c;if(_0x2827bc>=_0xf17c7f){_0x2827bc=_0xf17c7f;_0x45376c=0xc8;}else{_0x45376c=0xce;}_0x3cc5ce['status'](_0x45376c);return _0x3cc5ce['set'](_0x6639('0x21'),_0x11df0a+'-'+_0x2827bc+'/'+_0xf17c7f)['json'](_0x1b4cb4);}return null;};}function patchUpdates(_0x209f4e){return function(_0x1a77a9){try{jsonpatch[_0x6639('0x22')](_0x1a77a9,_0x209f4e,!![]);}catch(_0x1b8976){return BPromise[_0x6639('0x23')](_0x1b8976);}return _0x1a77a9[_0x6639('0x24')]();};}function saveUpdates(_0x5ec1e0,_0x5dd316){return function(_0x58bb88){if(_0x58bb88){return _0x58bb88['update'](_0x5ec1e0)[_0x6639('0x25')](function(_0x1465c9){return _0x1465c9;});}return null;};}function removeEntity(_0x5e1ecf,_0x2c6dbf){return function(_0x542b0f){if(_0x542b0f){return _0x542b0f[_0x6639('0x26')]()[_0x6639('0x25')](function(){_0x5e1ecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6ed42,_0x2a3238){return function(_0xc602fb){if(!_0xc602fb){_0xd6ed42[_0x6639('0x19')](0x194);}return _0xc602fb;};}function handleError(_0x45e004,_0x4339ad){_0x4339ad=_0x4339ad||0x1f4;return function(_0x5e07a0){logger[_0x6639('0x27')](_0x5e07a0[_0x6639('0x28')]);if(_0x5e07a0['name']){delete _0x5e07a0[_0x6639('0x29')];}_0x45e004[_0x6639('0x1a')](_0x4339ad)[_0x6639('0x2a')](_0x5e07a0);};}exports[_0x6639('0x2b')]=function(_0x55f1c4,_0x48579f){var _0x1cb067={},_0xf612a5={},_0x153693={'count':0x0,'rows':[]};var _0x23c124=_['map'](db[_0x6639('0x2c')][_0x6639('0x2d')],function(_0x5621fe){return{'name':_0x5621fe[_0x6639('0x2e')],'type':_0x5621fe[_0x6639('0x2f')][_0x6639('0x30')]};});_0xf612a5[_0x6639('0x31')]=_[_0x6639('0x32')](_0x23c124,_0x6639('0x29'));_0xf612a5[_0x6639('0x33')]=_['keys'](_0x55f1c4[_0x6639('0x33')]);_0xf612a5[_0x6639('0x34')]=_[_0x6639('0x35')](_0xf612a5[_0x6639('0x31')],_0xf612a5[_0x6639('0x33')]);_0x1cb067[_0x6639('0x36')]=_[_0x6639('0x35')](_0xf612a5[_0x6639('0x31')],qs[_0x6639('0x37')](_0x55f1c4[_0x6639('0x33')][_0x6639('0x37')]));_0x1cb067['attributes']=_0x1cb067[_0x6639('0x36')][_0x6639('0x38')]?_0x1cb067[_0x6639('0x36')]:_0xf612a5[_0x6639('0x31')];if(!_0x55f1c4['query'][_0x6639('0x39')](_0x6639('0x3a'))){_0x1cb067['limit']=qs[_0x6639('0x1f')](_0x55f1c4[_0x6639('0x33')][_0x6639('0x1f')]);_0x1cb067[_0x6639('0x1d')]=qs['offset'](_0x55f1c4[_0x6639('0x33')][_0x6639('0x1d')]);}_0x1cb067[_0x6639('0x3b')]=qs['sort'](_0x55f1c4['query']['sort']);_0x1cb067['where']=qs['filters'](_[_0x6639('0x3c')](_0x55f1c4['query'],_0xf612a5[_0x6639('0x34')]),_0x23c124);if(_0x55f1c4[_0x6639('0x33')][_0x6639('0x3d')]){_0x1cb067['where']=_[_0x6639('0x3e')](_0x1cb067[_0x6639('0x3f')],{'$or':_[_0x6639('0x32')](_0x23c124,function(_0x1ff91f){if(_0x1ff91f[_0x6639('0x2f')]!=='VIRTUAL'){var _0xc8fedd={};_0xc8fedd[_0x1ff91f['name']]={'$like':'%'+_0x55f1c4[_0x6639('0x33')][_0x6639('0x3d')]+'%'};return _0xc8fedd;}})});}_0x1cb067=_['merge']({},_0x1cb067,_0x55f1c4[_0x6639('0x40')]);var _0x4eb620={'where':_0x1cb067[_0x6639('0x3f')]};return db[_0x6639('0x2c')][_0x6639('0x20')](_0x4eb620)[_0x6639('0x25')](function(_0x1c31d9){_0x153693['count']=_0x1c31d9;if(_0x55f1c4['query']['includeAll']){_0x1cb067[_0x6639('0x41')]=[{'all':!![]}];}return db[_0x6639('0x2c')][_0x6639('0x42')](_0x1cb067);})[_0x6639('0x25')](function(_0x2ca5bc){_0x153693[_0x6639('0x43')]=_0x2ca5bc;return _0x153693;})['then'](respondWithFilteredResult(_0x48579f,_0x1cb067))[_0x6639('0x44')](handleError(_0x48579f,null));};exports[_0x6639('0x45')]=function(_0x1d189f,_0x2b5198){var _0x11e224={'raw':!![],'where':{'id':_0x1d189f[_0x6639('0x46')]['id']}},_0xef2284={};_0xef2284['model']=_['keys'](db[_0x6639('0x2c')][_0x6639('0x2d')]);_0xef2284[_0x6639('0x33')]=_['keys'](_0x1d189f[_0x6639('0x33')]);_0xef2284['filters']=_['intersection'](_0xef2284[_0x6639('0x31')],_0xef2284['query']);_0x11e224[_0x6639('0x36')]=_[_0x6639('0x35')](_0xef2284[_0x6639('0x31')],qs[_0x6639('0x37')](_0x1d189f[_0x6639('0x33')][_0x6639('0x37')]));_0x11e224[_0x6639('0x36')]=_0x11e224[_0x6639('0x36')]['length']?_0x11e224[_0x6639('0x36')]:_0xef2284[_0x6639('0x31')];if(_0x1d189f['query'][_0x6639('0x47')]){_0x11e224[_0x6639('0x41')]=[{'all':!![]}];}_0x11e224=_[_0x6639('0x3e')]({},_0x11e224,_0x1d189f[_0x6639('0x40')]);return db['VoiceTransferReport']['find'](_0x11e224)[_0x6639('0x25')](handleEntityNotFound(_0x2b5198,null))[_0x6639('0x25')](respondWithResult(_0x2b5198,null))[_0x6639('0x44')](handleError(_0x2b5198,null));};exports[_0x6639('0x48')]=function(_0x5431d0,_0x4821ed){return db[_0x6639('0x2c')][_0x6639('0x48')](_0x5431d0[_0x6639('0x49')],{})[_0x6639('0x25')](respondWithResult(_0x4821ed,0xc9))['catch'](handleError(_0x4821ed,null));};exports[_0x6639('0x4a')]=function(_0xed7b04,_0x524fe4){if(_0xed7b04['body']['id']){delete _0xed7b04[_0x6639('0x49')]['id'];}return db['VoiceTransferReport'][_0x6639('0x4b')]({'where':{'id':_0xed7b04[_0x6639('0x46')]['id']}})[_0x6639('0x25')](handleEntityNotFound(_0x524fe4,null))['then'](saveUpdates(_0xed7b04[_0x6639('0x49')],null))[_0x6639('0x25')](respondWithResult(_0x524fe4,null))['catch'](handleError(_0x524fe4,null));};exports[_0x6639('0x26')]=function(_0x2f27c7,_0xa31255){return db[_0x6639('0x2c')][_0x6639('0x4b')]({'where':{'id':_0x2f27c7[_0x6639('0x46')]['id']}})[_0x6639('0x25')](handleEntityNotFound(_0xa31255,null))[_0x6639('0x25')](removeEntity(_0xa31255,null))[_0x6639('0x44')](handleError(_0xa31255,null));};exports[_0x6639('0x4c')]=function(_0x130b66,_0x27c562){return db[_0x6639('0x2c')][_0x6639('0x4c')]()['then'](respondWithResult(_0x27c562,null))['catch'](handleError(_0x27c562,null));}; \ No newline at end of file +var _0x168c=['find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','create','body'];(function(_0x4abe74,_0x254e84){var _0x227f6c=function(_0x253412){while(--_0x253412){_0x4abe74['push'](_0x4abe74['shift']());}};_0x227f6c(++_0x254e84);}(_0x168c,0x132));var _0xc168=function(_0x49bd50,_0x49918e){_0x49bd50=_0x49bd50-0x0;var _0x273187=_0x168c[_0x49bd50];return _0x273187;};'use strict';var emlformat=require(_0xc168('0x0'));var rimraf=require(_0xc168('0x1'));var zipdir=require(_0xc168('0x2'));var jsonpatch=require(_0xc168('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc168('0x4'));var Mustache=require(_0xc168('0x5'));var util=require(_0xc168('0x6'));var path=require(_0xc168('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc168('0x8'));var fs=require('fs');var fs_extra=require(_0xc168('0x9'));var _=require(_0xc168('0xa'));var squel=require(_0xc168('0xb'));var crypto=require(_0xc168('0xc'));var jsforce=require(_0xc168('0xd'));var deskjs=require(_0xc168('0xe'));var toCsv=require(_0xc168('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc168('0x10'));var authService=require(_0xc168('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc168('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc168('0x13'));var utils=require(_0xc168('0x14'));var config=require(_0xc168('0x15'));var licenseUtil=require(_0xc168('0x16'));var db=require(_0xc168('0x17'))['db'];function respondWithStatusCode(_0x2b6a45,_0x219956){_0x219956=_0x219956||0xcc;return function(_0x4bd592){if(_0x4bd592){return _0x2b6a45[_0xc168('0x18')](_0x219956);}return _0x2b6a45['status'](_0x219956)[_0xc168('0x19')]();};}function respondWithResult(_0x3056d8,_0x3cc1e5){_0x3cc1e5=_0x3cc1e5||0xc8;return function(_0x41fa59){if(_0x41fa59){return _0x3056d8['status'](_0x3cc1e5)[_0xc168('0x1a')](_0x41fa59);}};}function respondWithFilteredResult(_0xbd8e69,_0x42c4f6){return function(_0x5e2107){if(_0x5e2107){var _0x4127f2=typeof _0x42c4f6[_0xc168('0x1b')]===_0xc168('0x1c')&&typeof _0x42c4f6['limit']===_0xc168('0x1c');var _0x23cbbf=_0x5e2107[_0xc168('0x1d')];var _0xc94d26=_0x4127f2?0x0:_0x42c4f6[_0xc168('0x1b')];var _0x25906c=_0x4127f2?_0x5e2107['count']:_0x42c4f6[_0xc168('0x1b')]+_0x42c4f6['limit'];var _0x31b006;if(_0x25906c>=_0x23cbbf){_0x25906c=_0x23cbbf;_0x31b006=0xc8;}else{_0x31b006=0xce;}_0xbd8e69[_0xc168('0x1e')](_0x31b006);return _0xbd8e69[_0xc168('0x1f')](_0xc168('0x20'),_0xc94d26+'-'+_0x25906c+'/'+_0x23cbbf)['json'](_0x5e2107);}return null;};}function patchUpdates(_0x51004a){return function(_0x198188){try{jsonpatch[_0xc168('0x21')](_0x198188,_0x51004a,!![]);}catch(_0x495d63){return BPromise[_0xc168('0x22')](_0x495d63);}return _0x198188[_0xc168('0x23')]();};}function saveUpdates(_0x43b308,_0x26730c){return function(_0x3b2f0b){if(_0x3b2f0b){return _0x3b2f0b[_0xc168('0x24')](_0x43b308)[_0xc168('0x25')](function(_0x136b8f){return _0x136b8f;});}return null;};}function removeEntity(_0x453000,_0x31251c){return function(_0x5eb77a){if(_0x5eb77a){return _0x5eb77a[_0xc168('0x26')]()[_0xc168('0x25')](function(){_0x453000[_0xc168('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8d47,_0x37b8df){return function(_0x551cdc){if(!_0x551cdc){_0x2f8d47[_0xc168('0x18')](0x194);}return _0x551cdc;};}function handleError(_0x45c652,_0x4d659a){_0x4d659a=_0x4d659a||0x1f4;return function(_0xec4354){logger[_0xc168('0x27')](_0xec4354[_0xc168('0x28')]);if(_0xec4354[_0xc168('0x29')]){delete _0xec4354[_0xc168('0x29')];}_0x45c652[_0xc168('0x1e')](_0x4d659a)[_0xc168('0x2a')](_0xec4354);};}exports['index']=function(_0x1834fe,_0x244b81){var _0x3925ec={},_0x17bca5={},_0x50814a={'count':0x0,'rows':[]};var _0x40230d=_[_0xc168('0x2b')](db[_0xc168('0x2c')][_0xc168('0x2d')],function(_0x5e78a2){return{'name':_0x5e78a2[_0xc168('0x2e')],'type':_0x5e78a2[_0xc168('0x2f')]['key']};});_0x17bca5['model']=_[_0xc168('0x2b')](_0x40230d,_0xc168('0x29'));_0x17bca5[_0xc168('0x30')]=_[_0xc168('0x31')](_0x1834fe[_0xc168('0x30')]);_0x17bca5[_0xc168('0x32')]=_['intersection'](_0x17bca5[_0xc168('0x33')],_0x17bca5[_0xc168('0x30')]);_0x3925ec['attributes']=_[_0xc168('0x34')](_0x17bca5['model'],qs[_0xc168('0x35')](_0x1834fe['query'][_0xc168('0x35')]));_0x3925ec[_0xc168('0x36')]=_0x3925ec[_0xc168('0x36')]['length']?_0x3925ec[_0xc168('0x36')]:_0x17bca5[_0xc168('0x33')];if(!_0x1834fe[_0xc168('0x30')]['hasOwnProperty'](_0xc168('0x37'))){_0x3925ec['limit']=qs[_0xc168('0x38')](_0x1834fe[_0xc168('0x30')][_0xc168('0x38')]);_0x3925ec[_0xc168('0x1b')]=qs[_0xc168('0x1b')](_0x1834fe['query'][_0xc168('0x1b')]);}_0x3925ec[_0xc168('0x39')]=qs[_0xc168('0x3a')](_0x1834fe['query'][_0xc168('0x3a')]);_0x3925ec[_0xc168('0x3b')]=qs[_0xc168('0x32')](_[_0xc168('0x3c')](_0x1834fe[_0xc168('0x30')],_0x17bca5[_0xc168('0x32')]),_0x40230d);if(_0x1834fe[_0xc168('0x30')][_0xc168('0x3d')]){_0x3925ec['where']=_['merge'](_0x3925ec[_0xc168('0x3b')],{'$or':_[_0xc168('0x2b')](_0x40230d,function(_0x1f647a){if(_0x1f647a['type']!==_0xc168('0x3e')){var _0x181a64={};_0x181a64[_0x1f647a[_0xc168('0x29')]]={'$like':'%'+_0x1834fe[_0xc168('0x30')]['filter']+'%'};return _0x181a64;}})});}_0x3925ec=_[_0xc168('0x3f')]({},_0x3925ec,_0x1834fe[_0xc168('0x40')]);var _0x497521={'where':_0x3925ec[_0xc168('0x3b')]};return db[_0xc168('0x2c')][_0xc168('0x1d')](_0x497521)[_0xc168('0x25')](function(_0x427eb1){_0x50814a['count']=_0x427eb1;if(_0x1834fe[_0xc168('0x30')][_0xc168('0x41')]){_0x3925ec[_0xc168('0x42')]=[{'all':!![]}];}return db[_0xc168('0x2c')]['findAll'](_0x3925ec);})['then'](function(_0x4bbc45){_0x50814a[_0xc168('0x43')]=_0x4bbc45;return _0x50814a;})[_0xc168('0x25')](respondWithFilteredResult(_0x244b81,_0x3925ec))[_0xc168('0x44')](handleError(_0x244b81,null));};exports[_0xc168('0x45')]=function(_0x490442,_0x55af7c){var _0x267e3e={'raw':!![],'where':{'id':_0x490442[_0xc168('0x46')]['id']}},_0x2de35a={};_0x2de35a['model']=_[_0xc168('0x31')](db[_0xc168('0x2c')][_0xc168('0x2d')]);_0x2de35a[_0xc168('0x30')]=_[_0xc168('0x31')](_0x490442[_0xc168('0x30')]);_0x2de35a[_0xc168('0x32')]=_[_0xc168('0x34')](_0x2de35a[_0xc168('0x33')],_0x2de35a[_0xc168('0x30')]);_0x267e3e[_0xc168('0x36')]=_[_0xc168('0x34')](_0x2de35a[_0xc168('0x33')],qs[_0xc168('0x35')](_0x490442[_0xc168('0x30')][_0xc168('0x35')]));_0x267e3e[_0xc168('0x36')]=_0x267e3e[_0xc168('0x36')][_0xc168('0x47')]?_0x267e3e[_0xc168('0x36')]:_0x2de35a[_0xc168('0x33')];if(_0x490442['query'][_0xc168('0x41')]){_0x267e3e['include']=[{'all':!![]}];}_0x267e3e=_[_0xc168('0x3f')]({},_0x267e3e,_0x490442[_0xc168('0x40')]);return db['VoiceTransferReport']['find'](_0x267e3e)[_0xc168('0x25')](handleEntityNotFound(_0x55af7c,null))[_0xc168('0x25')](respondWithResult(_0x55af7c,null))[_0xc168('0x44')](handleError(_0x55af7c,null));};exports[_0xc168('0x48')]=function(_0x182bf4,_0x292e87){return db[_0xc168('0x2c')][_0xc168('0x48')](_0x182bf4[_0xc168('0x49')],{})[_0xc168('0x25')](respondWithResult(_0x292e87,0xc9))[_0xc168('0x44')](handleError(_0x292e87,null));};exports[_0xc168('0x24')]=function(_0x7bd220,_0x4f08cf){if(_0x7bd220[_0xc168('0x49')]['id']){delete _0x7bd220[_0xc168('0x49')]['id'];}return db[_0xc168('0x2c')][_0xc168('0x4a')]({'where':{'id':_0x7bd220[_0xc168('0x46')]['id']}})[_0xc168('0x25')](handleEntityNotFound(_0x4f08cf,null))[_0xc168('0x25')](saveUpdates(_0x7bd220[_0xc168('0x49')],null))[_0xc168('0x25')](respondWithResult(_0x4f08cf,null))[_0xc168('0x44')](handleError(_0x4f08cf,null));};exports[_0xc168('0x26')]=function(_0x1aa5f6,_0x10387c){return db[_0xc168('0x2c')][_0xc168('0x4a')]({'where':{'id':_0x1aa5f6[_0xc168('0x46')]['id']}})[_0xc168('0x25')](handleEntityNotFound(_0x10387c,null))['then'](removeEntity(_0x10387c,null))[_0xc168('0x44')](handleError(_0x10387c,null));};exports[_0xc168('0x4b')]=function(_0x2600bb,_0xf11d32){return db[_0xc168('0x2c')][_0xc168('0x4b')]()[_0xc168('0x25')](respondWithResult(_0xf11d32,null))[_0xc168('0x44')](handleError(_0xf11d32,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 55ab08e..1c6304e 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 _0xcecd=['bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcecd,0x10c));var _0xdcec=function(_0x622d,_0x51e4bc){_0x622d=_0x622d-0x0;var _0x212a5f=_0xcecd[_0x622d];return _0x212a5f;};'use strict';var _=require(_0xdcec('0x0'));var util=require(_0xdcec('0x1'));var logger=require(_0xdcec('0x2'))(_0xdcec('0x3'));var moment=require(_0xdcec('0x4'));var BPromise=require(_0xdcec('0x5'));var rp=require(_0xdcec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcec('0x7'));var config=require(_0xdcec('0x8'));var attributes=require(_0xdcec('0x9'));module[_0xdcec('0xa')]=function(_0x56559a,_0x1e9143){return _0x56559a[_0xdcec('0xb')]('VoiceTransferReport',attributes,{'tableName':_0xdcec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8769=['report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport'];(function(_0x42914d,_0x3355af){var _0x62d583=function(_0x17242f){while(--_0x17242f){_0x42914d['push'](_0x42914d['shift']());}};_0x62d583(++_0x3355af);}(_0x8769,0xde));var _0x9876=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x8769[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x9876('0x0'));var util=require(_0x9876('0x1'));var logger=require(_0x9876('0x2'))('api');var moment=require(_0x9876('0x3'));var BPromise=require(_0x9876('0x4'));var rp=require(_0x9876('0x5'));var fs=require('fs');var path=require(_0x9876('0x6'));var rimraf=require(_0x9876('0x7'));var config=require(_0x9876('0x8'));var attributes=require(_0x9876('0x9'));module['exports']=function(_0x470317,_0x5a8626){return _0x470317[_0x9876('0xa')](_0x9876('0xb'),attributes,{'tableName':_0x9876('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index ea1676a..b7d3826 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 _0x49c5=['../../config/utils','../../config/logger','../../config/environment','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','lodash','util','bluebird','randomstring'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x49c5,0x182));var _0x549c=function(_0x181936,_0x4666ea){_0x181936=_0x181936-0x0;var _0xb9e872=_0x49c5[_0x181936];return _0xb9e872;};'use strict';var _=require(_0x549c('0x0'));var util=require(_0x549c('0x1'));var moment=require('moment');var BPromise=require(_0x549c('0x2'));var rs=require(_0x549c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x549c('0x4'));var logger=require(_0x549c('0x5'))('rpc');var config=require(_0x549c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x549c('0x7')][_0x549c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfe5a4,_0x2f28af,_0x4c3daa){return new BPromise(function(_0x302257,_0x30e3c4){return client['request'](_0xfe5a4,_0x4c3daa)[_0x549c('0x9')](function(_0x45bcef){logger['info'](_0x549c('0xa'),_0x2f28af,_0x549c('0xb'));logger[_0x549c('0xc')](_0x549c('0xd'),_0x2f28af,'request\x20sent',JSON[_0x549c('0xe')](_0x45bcef));if(_0x45bcef[_0x549c('0xf')]){if(_0x45bcef[_0x549c('0xf')]['code']===0x1f4){logger['error'](_0x549c('0xa'),_0x2f28af,_0x45bcef[_0x549c('0xf')]['message']);return _0x30e3c4(_0x45bcef[_0x549c('0xf')][_0x549c('0x10')]);}logger['error'](_0x549c('0xa'),_0x2f28af,_0x45bcef[_0x549c('0xf')][_0x549c('0x10')]);return _0x302257(_0x45bcef[_0x549c('0xf')][_0x549c('0x10')]);}else{logger['info'](_0x549c('0xa'),_0x2f28af,_0x549c('0xb'));_0x302257(_0x45bcef[_0x549c('0x11')][_0x549c('0x10')]);}})[_0x549c('0x12')](function(_0x2531e4){logger[_0x549c('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x2f28af,_0x2531e4);_0x30e3c4(_0x2531e4);});});}exports[_0x549c('0x13')]=function(_0x395e2b){var _0x2883aa=this;return new Promise(function(_0x22aa7e,_0x2a0976){return db[_0x549c('0x14')][_0x549c('0x15')](_0x395e2b[_0x549c('0x16')],{'raw':_0x395e2b[_0x549c('0x17')]?_0x395e2b[_0x549c('0x17')][_0x549c('0x18')]===undefined?!![]:![]:!![]})[_0x549c('0x9')](function(_0x219726){logger[_0x549c('0x19')]('CreateVoiceTransferReport',_0x395e2b);logger[_0x549c('0xc')](_0x549c('0x13'),_0x395e2b,JSON[_0x549c('0xe')](_0x219726));_0x22aa7e(_0x219726);})['catch'](function(_0x203748){logger[_0x549c('0xf')](_0x549c('0x13'),_0x203748[_0x549c('0x10')],_0x395e2b);_0x2a0976(_0x2883aa[_0x549c('0xf')](0x1f4,_0x203748[_0x549c('0x10')]));});});}; \ No newline at end of file +var _0x988c=['VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateVoiceTransferReport','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x988c,0x17b));var _0xc988=function(_0x34ef88,_0x3fc927){_0x34ef88=_0x34ef88-0x0;var _0x1a3f02=_0x988c[_0x34ef88];return _0x1a3f02;};'use strict';var _=require(_0xc988('0x0'));var util=require(_0xc988('0x1'));var moment=require(_0xc988('0x2'));var BPromise=require(_0xc988('0x3'));var rs=require(_0xc988('0x4'));var fs=require('fs');var Redis=require(_0xc988('0x5'));var db=require(_0xc988('0x6'))['db'];var utils=require(_0xc988('0x7'));var logger=require(_0xc988('0x8'))(_0xc988('0x9'));var config=require(_0xc988('0xa'));var jayson=require(_0xc988('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5da7ee,_0x4027e1,_0xce54a2){return new BPromise(function(_0x43c904,_0x514688){return client['request'](_0x5da7ee,_0xce54a2)[_0xc988('0xc')](function(_0x1c25de){logger['info'](_0xc988('0xd'),_0x4027e1,'request\x20sent');logger['debug'](_0xc988('0xe'),_0x4027e1,_0xc988('0xf'),JSON[_0xc988('0x10')](_0x1c25de));if(_0x1c25de[_0xc988('0x11')]){if(_0x1c25de['error'][_0xc988('0x12')]===0x1f4){logger[_0xc988('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x4027e1,_0x1c25de[_0xc988('0x11')][_0xc988('0x13')]);return _0x514688(_0x1c25de[_0xc988('0x11')][_0xc988('0x13')]);}logger['error'](_0xc988('0xd'),_0x4027e1,_0x1c25de[_0xc988('0x11')][_0xc988('0x13')]);return _0x43c904(_0x1c25de['error'][_0xc988('0x13')]);}else{logger[_0xc988('0x14')](_0xc988('0xd'),_0x4027e1,'request\x20sent');_0x43c904(_0x1c25de[_0xc988('0x15')][_0xc988('0x13')]);}})['catch'](function(_0x43a23b){logger[_0xc988('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x4027e1,_0x43a23b);_0x514688(_0x43a23b);});});}exports[_0xc988('0x16')]=function(_0x5e212f){var _0x36ce81=this;return new Promise(function(_0x2b0ee2,_0x107cf7){return db['VoiceTransferReport']['create'](_0x5e212f[_0xc988('0x17')],{'raw':_0x5e212f[_0xc988('0x18')]?_0x5e212f[_0xc988('0x18')][_0xc988('0x19')]===undefined?!![]:![]:!![]})[_0xc988('0xc')](function(_0x44adac){logger[_0xc988('0x14')](_0xc988('0x16'),_0x5e212f);logger[_0xc988('0x1a')](_0xc988('0x16'),_0x5e212f,JSON[_0xc988('0x10')](_0x44adac));_0x2b0ee2(_0x44adac);})[_0xc988('0x1b')](function(_0x3dec2a){logger['error'](_0xc988('0x16'),_0x3dec2a['message'],_0x5e212f);_0x107cf7(_0x36ce81[_0xc988('0x11')](0x1f4,_0x3dec2a[_0xc988('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 1118ada..b888789 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 _0xdade=['express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','answer','/hold','hold','/unhold','unhold','/calls','/transfer','exports'];(function(_0x861f5a,_0x1855ce){var _0x18e11b=function(_0x3c2f96){while(--_0x3c2f96){_0x861f5a['push'](_0x861f5a['shift']());}};_0x18e11b(++_0x1855ce);}(_0xdade,0x1a9));var _0xedad=function(_0x259d11,_0x222597){_0x259d11=_0x259d11-0x0;var _0x34f70c=_0xdade[_0x259d11];return _0x34f70c;};'use strict';var express=require(_0xedad('0x0'));var router=express[_0xedad('0x1')]();var auth=require(_0xedad('0x2'));var controller=require('./webbar.controller');router[_0xedad('0x3')](_0xedad('0x4'),auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller[_0xedad('0x7')]);router['post'](_0xedad('0x8'),auth[_0xedad('0x5')](),auth['canUpdate'](),controller['hangup']);router[_0xedad('0x3')]('/answer',auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller[_0xedad('0x9')]);router['post'](_0xedad('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xedad('0xb')]);router[_0xedad('0x3')](_0xedad('0xc'),auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller[_0xedad('0xd')]);router[_0xedad('0x3')](_0xedad('0xe'),auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller['calls']);router['post'](_0xedad('0xf'),auth['isAuthenticated'](),auth['canUpdate'](),controller['transfer']);module[_0xedad('0x10')]=router; \ No newline at end of file +var _0x87c2=['/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','unhold','calls'];(function(_0x41be89,_0x265102){var _0x1ca09c=function(_0x5db5e8){while(--_0x5db5e8){_0x41be89['push'](_0x41be89['shift']());}};_0x1ca09c(++_0x265102);}(_0x87c2,0x193));var _0x287c=function(_0x30a91a,_0x32845a){_0x30a91a=_0x30a91a-0x0;var _0x50ec8f=_0x87c2[_0x30a91a];return _0x50ec8f;};'use strict';var express=require(_0x287c('0x0'));var router=express[_0x287c('0x1')]();var auth=require(_0x287c('0x2'));var controller=require(_0x287c('0x3'));router[_0x287c('0x4')]('/originate',auth[_0x287c('0x5')](),auth[_0x287c('0x6')](),controller[_0x287c('0x7')]);router['post'](_0x287c('0x8'),auth['isAuthenticated'](),auth[_0x287c('0x6')](),controller[_0x287c('0x9')]);router[_0x287c('0x4')](_0x287c('0xa'),auth[_0x287c('0x5')](),auth['canUpdate'](),controller[_0x287c('0xb')]);router[_0x287c('0x4')](_0x287c('0xc'),auth[_0x287c('0x5')](),auth[_0x287c('0x6')](),controller[_0x287c('0xd')]);router[_0x287c('0x4')](_0x287c('0xe'),auth[_0x287c('0x5')](),auth[_0x287c('0x6')](),controller[_0x287c('0xf')]);router[_0x287c('0x4')]('/calls',auth[_0x287c('0x5')](),auth[_0x287c('0x6')](),controller[_0x287c('0x10')]);router['post'](_0x287c('0x11'),auth['isAuthenticated'](),auth[_0x287c('0x6')](),controller[_0x287c('0x12')]);module[_0x287c('0x13')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 6a6d69c..90b94f3 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 _0x91a7=['sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','info','answer','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','lodash','../../mysqldb','../../config/environment','bluebird','client','webbarapi','ioredis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','stringify','error','name','status','send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter'];(function(_0x55caf3,_0x416017){var _0x35e565=function(_0x434c80){while(--_0x434c80){_0x55caf3['push'](_0x55caf3['shift']());}};_0x35e565(++_0x416017);}(_0x91a7,0xe7));var _0x791a=function(_0x31294f,_0x1c65da){_0x31294f=_0x31294f-0x0;var _0x9270f2=_0x91a7[_0x31294f];return _0x9270f2;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x791a('0x0'));var db=require(_0x791a('0x1'))['db'];var config=require(_0x791a('0x2'));var util=require('util');var BPromise=require(_0x791a('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x791a('0x4')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0x791a('0x5'));var Redis=require(_0x791a('0x6'));config['redis']=_[_0x791a('0x7')](config['redis'],{'host':_0x791a('0x8'),'port':0x18eb});var io=require(_0x791a('0x9'))(new Redis(config['redis']));var Schema=require(_0x791a('0xa'));var originateValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'callNumber':{'type':_0x791a('0xd'),'required':[!![],_0x791a('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x791a('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x791a('0xd'),'required':[!![],_0x791a('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]}});function emit(_0x575d11,_0x43dea6,_0x355155){logger['info'](_0x575d11,_0x43dea6,JSON[_0x791a('0x10')](_0x355155));io['to'](_0x575d11)['emit'](_0x43dea6,_0x355155);}function handleError(_0x35fe48){return function(_0x52941d){console['log']('handleError:',_0x52941d,_0x52941d instanceof RangeError);logger[_0x791a('0x11')](_0x52941d['stack']);if(_0x52941d instanceof RangeError){if(_0x52941d['name']){delete _0x52941d[_0x791a('0x12')];}_0x35fe48[_0x791a('0x13')](0x194)[_0x791a('0x14')](_0x52941d);}else{if(_0x52941d[_0x791a('0x12')]){delete _0x52941d['name'];}_0x35fe48[_0x791a('0x13')](0x1f4)[_0x791a('0x14')](_0x52941d);}};}function checkError(){return function(_0x234514){if(!_0x234514){throw new RangeError(_0x791a('0x15'));}return _0x234514;};}function respondWithRpcPromise(_0x530e32,_0x448085){return new BPromise(function(_0x2054c6,_0x25bae5){var _0x9e17b5=amiClient;return _0x9e17b5[_0x791a('0x16')](_0x530e32,_0x448085)[_0x791a('0x17')](function(_0x2241a0){if(_0x2241a0[_0x791a('0x11')]){if(_0x2241a0[_0x791a('0x11')][_0x791a('0x18')]===0x1f4){return _0x25bae5(_0x2241a0[_0x791a('0x11')]['message']);}return _0x2054c6(_0x2241a0[_0x791a('0x11')][_0x791a('0x19')]);}else{_0x2054c6(_0x2241a0[_0x791a('0x1a')]);}})[_0x791a('0x1b')](function(_0x4d748a){_0x25bae5(_0x4d748a);});});}function getAgent(_0x456480){return db[_0x791a('0x1c')]['findOne']({'where':{'id':_0x456480,'role':_0x791a('0x1d')}})[_0x791a('0x17')](checkError());}function getAgentCheckSession(_0x16dbaf,_0x4c1626){return new BPromise(function(_0x29194d,_0x2b3327){var _0x2b0784=respondWithRpcPromise(_0x791a('0x1e'));var _0x4f423=getAgent(_0x16dbaf);Promise[_0x791a('0x1f')]([_0x2b0784,_0x4f423])[_0x791a('0x17')](function(_0x889534){var _0x58bbc0=_0x889534[0x0];var _0xbc3436=_0x889534[0x1];var _0x9e9332=_[_0x791a('0x20')](_0x58bbc0['rows'],function(_0x1cdda9){return _0x1cdda9['UserId']==_0xbc3436['id']&&_0x1cdda9[_0x791a('0x21')]==_0x4c1626;});if(_0x9e9332[_0x791a('0x22')]==0x1){_0x29194d(_0xbc3436);}else{_0x2b3327(new RangeError(_0x791a('0x23')+_0x4c1626+_0x791a('0x24')));}});});}exports[_0x791a('0x25')]=function(_0x32c7b2,_0x15ff6e){logger['info'](_0x791a('0x26'),_0x32c7b2[_0x791a('0x27')]);var _0x3fa066=originateValidation[_0x791a('0xa')](_0x32c7b2[_0x791a('0x27')]);if(_0x3fa066['length']>0x0){return _0x15ff6e[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x3fa066);}var _0x423a1e=_0x32c7b2[_0x791a('0x27')][_0x791a('0x29')];var _0x4ef825=_0x32c7b2[_0x791a('0x27')][_0x791a('0x2a')];var _0x33f998=_0x32c7b2[_0x791a('0x27')][_0x791a('0x2b')];var _0x52104d=_0x32c7b2[_0x791a('0x27')]['callbackUrl'];return getAgent(_0x423a1e)[_0x791a('0x17')](function(_0x4cd047){logger['info'](_0x791a('0x2c'),_0x4cd047[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x4cd047[_0x791a('0x12')]),_0x791a('0x2f'),{'callNumber':_0x4ef825,'callerId':_0x33f998,'callbackUrl':_0x52104d});return _0x15ff6e[_0x791a('0x13')](0xc8)['json']({'error':![],'message':_0x791a('0x30')});})['catch'](handleError(_0x15ff6e));};exports[_0x791a('0x31')]=function(_0x496005,_0x25e8cc){logger[_0x791a('0x32')]('hangup\x20fired:',_0x496005[_0x791a('0x27')]);var _0x22fb89=hangupValidation['validate'](_0x496005[_0x791a('0x27')]);if(_0x22fb89[_0x791a('0x22')]>0x0){return _0x25e8cc[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x22fb89);}var _0x29d267=_0x496005[_0x791a('0x27')][_0x791a('0x29')];var _0xf223d8=_0x496005[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x29d267)['then'](function(_0x15f066){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x15f066['name']);emit(util[_0x791a('0x2d')]('user:%s',_0x15f066['name']),'webbar:hangup',{'sessionId':_0xf223d8});return _0x25e8cc[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x791a('0x1b')](handleError(_0x25e8cc));};exports[_0x791a('0x33')]=function(_0x7987fa,_0x288cc5){logger['info']('answer\x20fired:',_0x7987fa['body']);var _0x2f0395=answerValidation[_0x791a('0xa')](_0x7987fa['body']);if(_0x2f0395[_0x791a('0x22')]>0x0){return _0x288cc5[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x2f0395);}var _0x954164=_0x7987fa['body'][_0x791a('0x29')];var _0x5911db=_0x7987fa[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x954164)[_0x791a('0x17')](function(_0xfa245e){logger[_0x791a('0x32')]('entityFound:',_0xfa245e[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0xfa245e[_0x791a('0x12')]),_0x791a('0x34'),{'sessionId':_0x5911db});return _0x288cc5['status'](0xc8)[_0x791a('0x28')]({'error':![],'message':_0x791a('0x35')});})['catch'](handleError(_0x288cc5));};exports['hold']=function(_0x1eb5b1,_0x338e70){logger[_0x791a('0x32')]('hold\x20fired:',_0x1eb5b1['body']);var _0x37ca2e=holdValidation[_0x791a('0xa')](_0x1eb5b1['body']);if(_0x37ca2e[_0x791a('0x22')]>0x0){return _0x338e70[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x37ca2e);}var _0x549980=_0x1eb5b1['body'][_0x791a('0x29')];var _0x17acda=_0x1eb5b1[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x549980)['then'](function(_0x2d7c7d){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x2d7c7d[_0x791a('0x12')]);emit(util['format'](_0x791a('0x2e'),_0x2d7c7d[_0x791a('0x12')]),_0x791a('0x36'),{'sessionId':_0x17acda});return _0x338e70[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':_0x791a('0x37')});})[_0x791a('0x1b')](handleError(_0x338e70));};exports['unhold']=function(_0xdcb1b,_0x1fd826){logger['info'](_0x791a('0x38'),_0xdcb1b[_0x791a('0x27')]);var _0x5dff77=unholdValidation[_0x791a('0xa')](_0xdcb1b[_0x791a('0x27')]);if(_0x5dff77[_0x791a('0x22')]>0x0){return _0x1fd826[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x5dff77);}var _0x4d82eb=_0xdcb1b['body']['userId'];var _0x305033=_0xdcb1b['body']['sessionId'];return getAgent(_0x4d82eb)[_0x791a('0x17')](function(_0x548a4b){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x548a4b['name']);emit(util['format'](_0x791a('0x2e'),_0x548a4b['name']),_0x791a('0x39'),{'sessionId':_0x305033});return _0x1fd826[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'unhold\x20executed!'});})[_0x791a('0x1b')](handleError(_0x1fd826));};exports[_0x791a('0x3a')]=function(_0x5159dd,_0x2a2b95){logger[_0x791a('0x32')](_0x791a('0x3b'),_0x2a2b95[_0x791a('0x27')]);var _0x450ad8=callsValidation[_0x791a('0xa')](_0x5159dd['body']);if(_0x450ad8['length']>0x0){return _0x2a2b95[_0x791a('0x13')](0x190)['json'](_0x450ad8);}var _0x45541b=_0x5159dd[_0x791a('0x27')][_0x791a('0x29')];var _0xf11dea=respondWithRpcPromise(_0x791a('0x1e'));var _0x2bd2cc=getAgent(_0x45541b);return Promise[_0x791a('0x1f')]([_0xf11dea,_0x2bd2cc])['then'](function(_0x1ac6e1){var _0x4691d9=_0x1ac6e1[0x0];var _0xc34c5b=_0x1ac6e1[0x1];var _0x1a4376=_[_0x791a('0x20')](_0x4691d9[_0x791a('0x3c')],function(_0x182b3a){return _0x182b3a['UserId']==_0xc34c5b['id'];});return _0x2a2b95[_0x791a('0x13')](0xc8)['json']({'count':_0x1a4376['length'],'rows':_0x1a4376});})[_0x791a('0x1b')](handleError(_0x2a2b95));};exports[_0x791a('0x3d')]=function(_0x216b69,_0x2e3432){logger[_0x791a('0x32')](_0x791a('0x3e'),_0x216b69[_0x791a('0x27')]);var _0x623ce0=conferenceValidation[_0x791a('0xa')](_0x216b69[_0x791a('0x27')]);if(_0x623ce0[_0x791a('0x22')]>0x0){return _0x2e3432[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x623ce0);}var _0x35ea8c=_0x216b69[_0x791a('0x27')][_0x791a('0x29')];return getAgent(_0x35ea8c)[_0x791a('0x17')](function(_0x156d32){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x156d32['name']);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x156d32[_0x791a('0x12')]),_0x791a('0x3f'));return _0x2e3432[_0x791a('0x13')](0xc8)['json']({'error':![],'message':_0x791a('0x40')});})[_0x791a('0x1b')](handleError(_0x2e3432));};exports[_0x791a('0x41')]=function(_0x120122,_0x5468c4){logger[_0x791a('0x32')]('transfer\x20fired:',_0x120122['body']);var _0x482fa6=transferValidation['validate'](_0x120122[_0x791a('0x27')]);if(_0x482fa6[_0x791a('0x22')]>0x0){return _0x5468c4[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x482fa6);}var _0x1bf9a3=_0x120122[_0x791a('0x27')][_0x791a('0x29')];var _0x5dca78=_0x120122['body'][_0x791a('0x21')];var _0x185620=_0x120122['body']['transferNumber'];return getAgent(_0x1bf9a3)[_0x791a('0x17')](function(_0x2f9753){logger['info'](_0x791a('0x2c'),_0x2f9753[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x2f9753['name']),'webbar:transfer',{'sessionId':_0x5dca78,'transferNumber':_0x185620});return _0x5468c4[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'transfer\x20executed!'});})[_0x791a('0x1b')](handleError(_0x5468c4));}; \ No newline at end of file +var _0x9c5e=['webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','http','../../config/logger','ioredis','redis','defaults','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','User','findOne','agent','VoiceChannels','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20executed!','hold','sessionId','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','filter','conference\x20fired:'];(function(_0xeb1553,_0x83535c){var _0x55c798=function(_0x612e10){while(--_0x612e10){_0xeb1553['push'](_0xeb1553['shift']());}};_0x55c798(++_0x83535c);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x457bf1,_0x36f8b3){_0x457bf1=_0x457bf1-0x0;var _0x35ec36=_0x9c5e[_0x457bf1];return _0x35ec36;};'use strict';var path=require(_0xe9c5('0x0'));var fs=require('fs');var _=require(_0xe9c5('0x1'));var db=require(_0xe9c5('0x2'))['db'];var config=require(_0xe9c5('0x3'));var util=require(_0xe9c5('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson['client'][_0xe9c5('0x5')]({'port':0x232a});var logger=require(_0xe9c5('0x6'))('webbarapi');var Redis=require(_0xe9c5('0x7'));config[_0xe9c5('0x8')]=_[_0xe9c5('0x9')](config[_0xe9c5('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe9c5('0xa'))(new Redis(config[_0xe9c5('0x8')]));var Schema=require(_0xe9c5('0xb'));var originateValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xe9c5('0xd')]},'callerId':{'type':_0xe9c5('0xe')},'callbackUrl':{'type':_0xe9c5('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':[!![],_0xe9c5('0x10')]},'transferNumber':{'type':_0xe9c5('0xe'),'required':[!![],_0xe9c5('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]},'sessionId':{'type':_0xe9c5('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe9c5('0xc'),'required':[!![],_0xe9c5('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe9c5('0xf')]}});function emit(_0x14eb41,_0x5d5fb4,_0x3aa80b){logger[_0xe9c5('0x12')](_0x14eb41,_0x5d5fb4,JSON[_0xe9c5('0x13')](_0x3aa80b));io['to'](_0x14eb41)[_0xe9c5('0x14')](_0x5d5fb4,_0x3aa80b);}function handleError(_0x23156c){return function(_0x4d9c7d){console[_0xe9c5('0x15')](_0xe9c5('0x16'),_0x4d9c7d,_0x4d9c7d instanceof RangeError);logger[_0xe9c5('0x17')](_0x4d9c7d[_0xe9c5('0x18')]);if(_0x4d9c7d instanceof RangeError){if(_0x4d9c7d['name']){delete _0x4d9c7d[_0xe9c5('0x19')];}_0x23156c[_0xe9c5('0x1a')](0x194)[_0xe9c5('0x1b')](_0x4d9c7d);}else{if(_0x4d9c7d[_0xe9c5('0x19')]){delete _0x4d9c7d[_0xe9c5('0x19')];}_0x23156c['status'](0x1f4)['send'](_0x4d9c7d);}};}function checkError(){return function(_0xaa891){if(!_0xaa891){throw new RangeError('NotFound');}return _0xaa891;};}function respondWithRpcPromise(_0x3c3d53,_0xc4d208){return new BPromise(function(_0x21b02a,_0x4d16bc){var _0x5750ff=amiClient;return _0x5750ff[_0xe9c5('0x1c')](_0x3c3d53,_0xc4d208)[_0xe9c5('0x1d')](function(_0x37fb90){if(_0x37fb90[_0xe9c5('0x17')]){if(_0x37fb90[_0xe9c5('0x17')][_0xe9c5('0x1e')]===0x1f4){return _0x4d16bc(_0x37fb90[_0xe9c5('0x17')][_0xe9c5('0x1f')]);}return _0x21b02a(_0x37fb90[_0xe9c5('0x17')][_0xe9c5('0x1f')]);}else{_0x21b02a(_0x37fb90['result']);}})['catch'](function(_0x250e1c){_0x4d16bc(_0x250e1c);});});}function getAgent(_0x3dd39d){return db[_0xe9c5('0x20')][_0xe9c5('0x21')]({'where':{'id':_0x3dd39d,'role':_0xe9c5('0x22')}})[_0xe9c5('0x1d')](checkError());}function getAgentCheckSession(_0x493108,_0x2c3fcb){return new BPromise(function(_0x480187,_0x3fa00b){var _0x50256b=respondWithRpcPromise(_0xe9c5('0x23'));var _0x2112a6=getAgent(_0x493108);Promise['all']([_0x50256b,_0x2112a6])[_0xe9c5('0x1d')](function(_0x46d253){var _0x334f5a=_0x46d253[0x0];var _0x37cfa5=_0x46d253[0x1];var _0x1fa0f6=_['filter'](_0x334f5a[_0xe9c5('0x24')],function(_0x4fcabd){return _0x4fcabd[_0xe9c5('0x25')]==_0x37cfa5['id']&&_0x4fcabd['sessionId']==_0x2c3fcb;});if(_0x1fa0f6[_0xe9c5('0x26')]==0x1){_0x480187(_0x37cfa5);}else{_0x3fa00b(new RangeError(_0xe9c5('0x27')+_0x2c3fcb+_0xe9c5('0x28')));}});});}exports[_0xe9c5('0x29')]=function(_0x4766c8,_0x4e6043){logger[_0xe9c5('0x12')](_0xe9c5('0x2a'),_0x4766c8[_0xe9c5('0x2b')]);var _0x12ed89=originateValidation[_0xe9c5('0xb')](_0x4766c8['body']);if(_0x12ed89['length']>0x0){return _0x4e6043[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x12ed89);}var _0x3c409e=_0x4766c8[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x96753=_0x4766c8[_0xe9c5('0x2b')][_0xe9c5('0x2e')];var _0x4feba2=_0x4766c8[_0xe9c5('0x2b')][_0xe9c5('0x2f')];var _0x558277=_0x4766c8[_0xe9c5('0x2b')]['callbackUrl'];return getAgent(_0x3c409e)[_0xe9c5('0x1d')](function(_0x2642cc){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x2642cc[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x2642cc[_0xe9c5('0x19')]),_0xe9c5('0x33'),{'callNumber':_0x96753,'callerId':_0x4feba2,'callbackUrl':_0x558277});return _0x4e6043[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x34')});})[_0xe9c5('0x35')](handleError(_0x4e6043));};exports[_0xe9c5('0x36')]=function(_0x312168,_0x4570e9){logger[_0xe9c5('0x12')](_0xe9c5('0x37'),_0x312168[_0xe9c5('0x2b')]);var _0x55cd00=hangupValidation[_0xe9c5('0xb')](_0x312168[_0xe9c5('0x2b')]);if(_0x55cd00[_0xe9c5('0x26')]>0x0){return _0x4570e9[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x55cd00);}var _0x3b85bf=_0x312168['body'][_0xe9c5('0x2d')];var _0x420558=_0x312168[_0xe9c5('0x2b')]['sessionId'];return getAgent(_0x3b85bf)[_0xe9c5('0x1d')](function(_0x1bf7c5){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x1bf7c5[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x1bf7c5[_0xe9c5('0x19')]),_0xe9c5('0x38'),{'sessionId':_0x420558});return _0x4570e9[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x4570e9));};exports[_0xe9c5('0x39')]=function(_0xbde18b,_0x21bc80){logger[_0xe9c5('0x12')]('answer\x20fired:',_0xbde18b['body']);var _0x382405=answerValidation[_0xe9c5('0xb')](_0xbde18b['body']);if(_0x382405[_0xe9c5('0x26')]>0x0){return _0x21bc80['status'](0x190)['json'](_0x382405);}var _0x5c395d=_0xbde18b[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x1d081a=_0xbde18b[_0xe9c5('0x2b')]['sessionId'];return getAgent(_0x5c395d)[_0xe9c5('0x1d')](function(_0x2ae53a){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x2ae53a[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x2ae53a[_0xe9c5('0x19')]),'webbar:answer',{'sessionId':_0x1d081a});return _0x21bc80[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x3a')});})[_0xe9c5('0x35')](handleError(_0x21bc80));};exports[_0xe9c5('0x3b')]=function(_0x537fcc,_0x562066){logger['info']('hold\x20fired:',_0x537fcc['body']);var _0xa5bf36=holdValidation[_0xe9c5('0xb')](_0x537fcc[_0xe9c5('0x2b')]);if(_0xa5bf36['length']>0x0){return _0x562066[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0xa5bf36);}var _0x1ed99e=_0x537fcc[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x27b8db=_0x537fcc['body'][_0xe9c5('0x3c')];return getAgent(_0x1ed99e)[_0xe9c5('0x1d')](function(_0x1da6a3){logger[_0xe9c5('0x12')]('entityFound:',_0x1da6a3[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x1da6a3[_0xe9c5('0x19')]),_0xe9c5('0x3d'),{'sessionId':_0x27b8db});return _0x562066[_0xe9c5('0x1a')](0xc8)['json']({'error':![],'message':_0xe9c5('0x3e')});})[_0xe9c5('0x35')](handleError(_0x562066));};exports[_0xe9c5('0x3f')]=function(_0x9d0154,_0x5e7c24){logger[_0xe9c5('0x12')](_0xe9c5('0x40'),_0x9d0154[_0xe9c5('0x2b')]);var _0x284706=unholdValidation[_0xe9c5('0xb')](_0x9d0154[_0xe9c5('0x2b')]);if(_0x284706['length']>0x0){return _0x5e7c24['status'](0x190)[_0xe9c5('0x2c')](_0x284706);}var _0x15380c=_0x9d0154[_0xe9c5('0x2b')][_0xe9c5('0x2d')];var _0x30a79b=_0x9d0154[_0xe9c5('0x2b')][_0xe9c5('0x3c')];return getAgent(_0x15380c)[_0xe9c5('0x1d')](function(_0x276393){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0x276393[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')](_0xe9c5('0x32'),_0x276393[_0xe9c5('0x19')]),_0xe9c5('0x41'),{'sessionId':_0x30a79b});return _0x5e7c24['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0xe9c5('0x35')](handleError(_0x5e7c24));};exports[_0xe9c5('0x42')]=function(_0x2b8076,_0x5504d9){logger[_0xe9c5('0x12')]('calls\x20fired:',_0x5504d9[_0xe9c5('0x2b')]);var _0xbac8ef=callsValidation[_0xe9c5('0xb')](_0x2b8076[_0xe9c5('0x2b')]);if(_0xbac8ef[_0xe9c5('0x26')]>0x0){return _0x5504d9['status'](0x190)[_0xe9c5('0x2c')](_0xbac8ef);}var _0x1b4515=_0x2b8076['body'][_0xe9c5('0x2d')];var _0x424f1d=respondWithRpcPromise(_0xe9c5('0x23'));var _0x20d8e8=getAgent(_0x1b4515);return Promise['all']([_0x424f1d,_0x20d8e8])[_0xe9c5('0x1d')](function(_0x499f4f){var _0x1f978d=_0x499f4f[0x0];var _0x40c555=_0x499f4f[0x1];var _0x277323=_[_0xe9c5('0x43')](_0x1f978d['rows'],function(_0x4439cf){return _0x4439cf[_0xe9c5('0x25')]==_0x40c555['id'];});return _0x5504d9[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'count':_0x277323[_0xe9c5('0x26')],'rows':_0x277323});})[_0xe9c5('0x35')](handleError(_0x5504d9));};exports['conference']=function(_0x2dd877,_0x181a9c){logger['info'](_0xe9c5('0x44'),_0x2dd877['body']);var _0x1e5603=conferenceValidation[_0xe9c5('0xb')](_0x2dd877[_0xe9c5('0x2b')]);if(_0x1e5603[_0xe9c5('0x26')]>0x0){return _0x181a9c[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x1e5603);}var _0xa2ba99=_0x2dd877['body'][_0xe9c5('0x2d')];return getAgent(_0xa2ba99)[_0xe9c5('0x1d')](function(_0x117e9f){logger['info'](_0xe9c5('0x30'),_0x117e9f['name']);emit(util['format'](_0xe9c5('0x32'),_0x117e9f[_0xe9c5('0x19')]),_0xe9c5('0x45'));return _0x181a9c[_0xe9c5('0x1a')](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x46')});})[_0xe9c5('0x35')](handleError(_0x181a9c));};exports[_0xe9c5('0x47')]=function(_0x344235,_0x213be5){logger['info'](_0xe9c5('0x48'),_0x344235[_0xe9c5('0x2b')]);var _0x257a96=transferValidation[_0xe9c5('0xb')](_0x344235[_0xe9c5('0x2b')]);if(_0x257a96[_0xe9c5('0x26')]>0x0){return _0x213be5[_0xe9c5('0x1a')](0x190)[_0xe9c5('0x2c')](_0x257a96);}var _0x8b6101=_0x344235['body'][_0xe9c5('0x2d')];var _0x1caca3=_0x344235[_0xe9c5('0x2b')][_0xe9c5('0x3c')];var _0x1db82f=_0x344235[_0xe9c5('0x2b')][_0xe9c5('0x49')];return getAgent(_0x8b6101)['then'](function(_0xfe9e61){logger[_0xe9c5('0x12')](_0xe9c5('0x30'),_0xfe9e61[_0xe9c5('0x19')]);emit(util[_0xe9c5('0x31')]('user:%s',_0xfe9e61[_0xe9c5('0x19')]),'webbar:transfer',{'sessionId':_0x1caca3,'transferNumber':_0x1db82f});return _0x213be5['status'](0xc8)[_0xe9c5('0x2c')]({'error':![],'message':_0xe9c5('0x4a')});})['catch'](handleError(_0x213be5));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4804ca0..730c8c3 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 _0x4137=['get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','create','/:id/dispositions','post','addAnswer','addAgents','addApplications','notify','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller'];(function(_0x4a62ee,_0x575d71){var _0x2ecc13=function(_0x3f91ae){while(--_0x3f91ae){_0x4a62ee['push'](_0x4a62ee['shift']());}};_0x2ecc13(++_0x575d71);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/dispositions',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getAnswers']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0xb')](_0x7413('0x15'),auth['isAuthenticated'](),controller['getApplications']);router['post']('/',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x17'),auth[_0x7413('0xe')](),controller['addDisposition']);router[_0x7413('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7413('0x19')]);router['post'](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x1a')]);router[_0x7413('0x18')](_0x7413('0x15'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x18')]('/:id/notify',controller[_0x7413('0x1c')]);router[_0x7413('0x18')](_0x7413('0x1d'),auth[_0x7413('0xe')](),controller['send']);router[_0x7413('0x1e')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x1f')]);router[_0x7413('0x20')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x21')]);router['delete']('/:id/dispositions',auth[_0x7413('0xe')](),controller['removeDispositions']);router[_0x7413('0x20')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x22')]);router[_0x7413('0x20')](_0x7413('0x13'),auth[_0x7413('0xe')](),controller[_0x7413('0x23')]);module[_0x7413('0x24')]=router; \ No newline at end of file +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(_0x1ee4c4,_0x89a458){var _0x47733d=function(_0x113836){while(--_0x113836){_0x1ee4c4['push'](_0x1ee4c4['shift']());}};_0x47733d(++_0x89a458);}(_0x2ef3,0xba));var _0x32ef=function(_0x5bde6b,_0x14a97d){_0x5bde6b=_0x5bde6b-0x0;var _0x551288=_0x2ef3[_0x5bde6b];return _0x551288;};'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 diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f9b7a90..26581d9 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 _0x3be3=['mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','twilio','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x436738,_0x43c328){var _0x578681=function(_0x31e25d){while(--_0x31e25d){_0x436738['push'](_0x436738['shift']());}};_0x578681(++_0x43c328);}(_0x3be3,0x1a2));var _0x33be=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x3be3[_0x2de020];return _0x182b7c;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x33be('0x0'));module[_0x33be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x33be('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x33be('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x33be('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x33be('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x33be('0x3')]},'type':{'type':Sequelize['ENUM'](_0x33be('0x4'))},'accountSid':{'type':Sequelize[_0x33be('0x3')]},'authToken':{'type':Sequelize[_0x33be('0x3')]},'notificationTemplate':{'type':Sequelize[_0x33be('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x33be('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x33be('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x33be('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x33be('0x7')],'comment':_0x33be('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x33be('0x6')],'defaultValue':![],'comment':_0x33be('0x9'),'set':function(_0x280abd){if(!_0x280abd){this[_0x33be('0xa')](_0x33be('0xb'),null);}this[_0x33be('0xa')](_0x33be('0xc'),_0x280abd);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x80e4=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x80e4,0x1b5));var _0x480e=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x80e4[_0x174ef5];return _0x1cc379;};'use strict';var Sequelize=require(_0x480e('0x0'));var rs=require(_0x480e('0x1'));module[_0x480e('0x2')]={'name':{'type':Sequelize[_0x480e('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x480e('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x480e('0x3')],'defaultValue':function(){return rs[_0x480e('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x480e('0x5')](_0x480e('0x6'))},'accountSid':{'type':Sequelize[_0x480e('0x3')]},'authToken':{'type':Sequelize[_0x480e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x480e('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x480e('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x480e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x480e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x480e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x480e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x480e('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x480e('0x8')],'defaultValue':![],'comment':_0x480e('0xa'),'set':function(_0x5af0f9){if(!_0x5af0f9){this[_0x480e('0xb')](_0x480e('0xc'),null);}this['setDataValue'](_0x480e('0xd'),_0x5af0f9);}},'description':{'type':Sequelize[_0x480e('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index e2ff10e..e7af327 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 _0x994c=['fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','show','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','rows','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','nolimit','addApplications','WhatsappApplication','bulkCreate','priority','getApplications','notify','whatsapp','Applications','applications','orderBy','asc','account','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','whatsapp:','messageId','MessageSid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','WhatsappInteraction','interaction','created','push','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','stack','name','send','index','Pause','map','rawAttributes','type','model','query','keys','intersection','attributes'];(function(_0x49c452,_0x4d09b6){var _0x5090e2=function(_0x12a893){while(--_0x12a893){_0x49c452['push'](_0x49c452['shift']());}};_0x5090e2(++_0x4d09b6);}(_0x994c,0x128));var _0xc994=function(_0x1e9763,_0x1b53fd){_0x1e9763=_0x1e9763-0x0;var _0x3397c0=_0x994c[_0x1e9763];return _0x3397c0;};'use strict';var emlformat=require(_0xc994('0x0'));var rimraf=require(_0xc994('0x1'));var zipdir=require(_0xc994('0x2'));var jsonpatch=require(_0xc994('0x3'));var rp=require(_0xc994('0x4'));var moment=require(_0xc994('0x5'));var BPromise=require(_0xc994('0x6'));var Mustache=require(_0xc994('0x7'));var util=require(_0xc994('0x8'));var path=require('path');var sox=require(_0xc994('0x9'));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(_0xc994('0xa'));var jsforce=require(_0xc994('0xb'));var deskjs=require(_0xc994('0xc'));var toCsv=require(_0xc994('0xd'));var querystring=require(_0xc994('0xe'));var Papa=require(_0xc994('0xf'));var Redis=require(_0xc994('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc994('0x11'));var logger=require('../../config/logger')(_0xc994('0x12'));var utils=require(_0xc994('0x13'));var config=require(_0xc994('0x14'));var licenseUtil=require(_0xc994('0x15'));var db=require(_0xc994('0x16'))['db'];config[_0xc994('0x17')]=_[_0xc994('0x18')](config[_0xc994('0x17')],{'host':_0xc994('0x19'),'port':0x18eb});var socket=require(_0xc994('0x1a'))(new Redis(config[_0xc994('0x17')]));require(_0xc994('0x1b'))[_0xc994('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc994('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x2dc376,_0x21929f,_0x119360,_0x5c2f6e){return new BPromise(function(_0x8daefb,_0xa475e2){var _0x6864bf=_0x5c2f6e||client;return _0x6864bf[_0xc994('0x1e')](_0x2dc376,_0x119360)[_0xc994('0x1f')](function(_0x2d8699){logger[_0xc994('0x20')](_0xc994('0x21'),_0x21929f,_0xc994('0x22'));logger[_0xc994('0x23')](_0xc994('0x24'),_0x21929f,_0xc994('0x22'),JSON[_0xc994('0x25')](_0x2d8699));if(_0x2d8699[_0xc994('0x26')]){if(_0x2d8699[_0xc994('0x26')]['code']===0x1f4){logger[_0xc994('0x26')](_0xc994('0x21'),_0x21929f,_0x2d8699[_0xc994('0x26')]['message']);return _0xa475e2(_0x2d8699[_0xc994('0x26')][_0xc994('0x27')]);}logger[_0xc994('0x26')](_0xc994('0x21'),_0x21929f,_0x2d8699[_0xc994('0x26')]['message']);return _0x8daefb(_0x2d8699['error']['message']);}else{logger[_0xc994('0x20')](_0xc994('0x21'),_0x21929f,_0xc994('0x22'));_0x8daefb(_0x2d8699['result'][_0xc994('0x27')]);}})[_0xc994('0x28')](function(_0x1e7a11){logger[_0xc994('0x26')](_0xc994('0x21'),_0x21929f,_0x1e7a11);_0xa475e2(_0x1e7a11);});});}function respondWithStatusCode(_0x1899c4,_0xe3c783){_0xe3c783=_0xe3c783||0xcc;return function(_0x281111){if(_0x281111){return _0x1899c4[_0xc994('0x29')](_0xe3c783);}return _0x1899c4[_0xc994('0x2a')](_0xe3c783)[_0xc994('0x2b')]();};}function respondWithResult(_0x18d503,_0x512794){_0x512794=_0x512794||0xc8;return function(_0xca8897){if(_0xca8897){return _0x18d503[_0xc994('0x2a')](_0x512794)[_0xc994('0x2c')](_0xca8897);}};}function respondWithFilteredResult(_0x6ab90c,_0xee6726){return function(_0x4661b7){if(_0x4661b7){var _0x7a2244=typeof _0xee6726[_0xc994('0x2d')]===_0xc994('0x2e')&&typeof _0xee6726[_0xc994('0x2f')]===_0xc994('0x2e');var _0x29ef3b=_0x4661b7[_0xc994('0x30')];var _0x244571=_0x7a2244?0x0:_0xee6726[_0xc994('0x2d')];var _0x5e1272=_0x7a2244?_0x4661b7[_0xc994('0x30')]:_0xee6726[_0xc994('0x2d')]+_0xee6726[_0xc994('0x2f')];var _0x584fbb;if(_0x5e1272>=_0x29ef3b){_0x5e1272=_0x29ef3b;_0x584fbb=0xc8;}else{_0x584fbb=0xce;}_0x6ab90c[_0xc994('0x2a')](_0x584fbb);return _0x6ab90c[_0xc994('0x31')](_0xc994('0x32'),_0x244571+'-'+_0x5e1272+'/'+_0x29ef3b)[_0xc994('0x2c')](_0x4661b7);}return null;};}function patchUpdates(_0xb223f3){return function(_0x302a7b){try{jsonpatch[_0xc994('0x33')](_0x302a7b,_0xb223f3,!![]);}catch(_0x2f3505){return BPromise[_0xc994('0x34')](_0x2f3505);}return _0x302a7b[_0xc994('0x35')]();};}function saveUpdates(_0x51a538,_0x302412){return function(_0x225bff){if(_0x225bff){return _0x225bff[_0xc994('0x36')](_0x51a538)[_0xc994('0x1f')](function(_0x49281d){return _0x49281d;});}return null;};}function removeEntity(_0x973cf1,_0xfd1417){return function(_0x1662b5){if(_0x1662b5){return _0x1662b5[_0xc994('0x37')]()[_0xc994('0x1f')](function(){var _0x11378c=_0x1662b5[_0xc994('0x38')]({'plain':!![]});var _0x5bfe0d='WhatsappAccounts';return db['UserProfileResource'][_0xc994('0x37')]({'where':{'type':_0x5bfe0d,'resourceId':_0x11378c['id']}})[_0xc994('0x1f')](function(){return _0x1662b5;});})[_0xc994('0x1f')](function(){_0x973cf1[_0xc994('0x2a')](0xcc)[_0xc994('0x2b')]();});}};}function handleEntityNotFound(_0x38ba7b,_0x19771e){return function(_0x127f4e){if(!_0x127f4e){_0x38ba7b[_0xc994('0x29')](0x194);}return _0x127f4e;};}function handleError(_0x3b5312,_0x41ded5){_0x41ded5=_0x41ded5||0x1f4;return function(_0x46f0d9){logger['error'](_0x46f0d9[_0xc994('0x39')]);if(_0x46f0d9[_0xc994('0x3a')]){delete _0x46f0d9[_0xc994('0x3a')];}_0x3b5312[_0xc994('0x2a')](_0x41ded5)[_0xc994('0x3b')](_0x46f0d9);};}exports[_0xc994('0x3c')]=function(_0x2d6088,_0x5de762){var _0x1ff5fb={'include':[{'model':db[_0xc994('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1288fd={},_0x2b7879={'count':0x0,'rows':[]};var _0x47f0e3=_[_0xc994('0x3e')](db['WhatsappAccount'][_0xc994('0x3f')],function(_0x52e42d){return{'name':_0x52e42d['fieldName'],'type':_0x52e42d[_0xc994('0x40')]['key']};});_0x1288fd[_0xc994('0x41')]=_['map'](_0x47f0e3,_0xc994('0x3a'));_0x1288fd[_0xc994('0x42')]=_[_0xc994('0x43')](_0x2d6088[_0xc994('0x42')]);_0x1288fd['filters']=_[_0xc994('0x44')](_0x1288fd[_0xc994('0x41')],_0x1288fd[_0xc994('0x42')]);_0x1ff5fb[_0xc994('0x45')]=_[_0xc994('0x44')](_0x1288fd[_0xc994('0x41')],qs[_0xc994('0x46')](_0x2d6088[_0xc994('0x42')]['fields']));_0x1ff5fb[_0xc994('0x45')]=_0x1ff5fb['attributes'][_0xc994('0x47')]?_0x1ff5fb['attributes']:_0x1288fd[_0xc994('0x41')];if(!_0x2d6088['query'][_0xc994('0x48')]('nolimit')){_0x1ff5fb[_0xc994('0x2f')]=qs[_0xc994('0x2f')](_0x2d6088[_0xc994('0x42')]['limit']);_0x1ff5fb[_0xc994('0x2d')]=qs[_0xc994('0x2d')](_0x2d6088['query'][_0xc994('0x2d')]);}_0x1ff5fb[_0xc994('0x49')]=qs['sort'](_0x2d6088[_0xc994('0x42')][_0xc994('0x4a')]);_0x1ff5fb['where']=qs[_0xc994('0x4b')](_[_0xc994('0x4c')](_0x2d6088['query'],_0x1288fd[_0xc994('0x4b')]),_0x47f0e3);if(_0x2d6088[_0xc994('0x42')][_0xc994('0x4d')]){_0x1ff5fb[_0xc994('0x4e')]=_[_0xc994('0x4f')](_0x1ff5fb[_0xc994('0x4e')],{'$or':_['map'](_0x47f0e3,function(_0x3b9fc5){if(_0x3b9fc5['type']!==_0xc994('0x50')){var _0x1522d7={};_0x1522d7[_0x3b9fc5[_0xc994('0x3a')]]={'$like':'%'+_0x2d6088['query'][_0xc994('0x4d')]+'%'};return _0x1522d7;}})});}_0x1ff5fb=_[_0xc994('0x4f')]({},_0x1ff5fb,_0x2d6088[_0xc994('0x51')]);var _0x41fba8={'where':_0x1ff5fb[_0xc994('0x4e')]};return db[_0xc994('0x52')][_0xc994('0x30')](_0x41fba8)['then'](function(_0x2447a0){_0x2b7879[_0xc994('0x30')]=_0x2447a0;if(_0x2d6088[_0xc994('0x42')][_0xc994('0x53')]){_0x1ff5fb[_0xc994('0x54')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xc994('0x55')](_0x1ff5fb);})[_0xc994('0x1f')](function(_0x1ebfb1){_0x2b7879['rows']=_0x1ebfb1;return _0x2b7879;})['then'](respondWithFilteredResult(_0x5de762,_0x1ff5fb))[_0xc994('0x28')](handleError(_0x5de762,null));};exports[_0xc994('0x56')]=function(_0x45cfb3,_0x416fce){var _0xc620fa={'raw':![],'where':{'id':_0x45cfb3['params']['id']},'include':[{'model':db[_0xc994('0x3d')],'as':_0xc994('0x57')}]},_0x43ed2c={};_0x43ed2c[_0xc994('0x41')]=_[_0xc994('0x43')](db['WhatsappAccount'][_0xc994('0x3f')]);_0x43ed2c[_0xc994('0x42')]=_[_0xc994('0x43')](_0x45cfb3[_0xc994('0x42')]);_0x43ed2c[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x43ed2c['model'],_0x43ed2c[_0xc994('0x42')]);_0xc620fa['attributes']=_[_0xc994('0x44')](_0x43ed2c[_0xc994('0x41')],qs['fields'](_0x45cfb3[_0xc994('0x42')]['fields']));_0xc620fa['attributes']=_0xc620fa[_0xc994('0x45')][_0xc994('0x47')]?_0xc620fa[_0xc994('0x45')]:_0x43ed2c[_0xc994('0x41')];if(_0x45cfb3[_0xc994('0x42')][_0xc994('0x53')]){_0xc620fa[_0xc994('0x54')]=[{'all':!![]}];}_0xc620fa=_[_0xc994('0x4f')]({},_0xc620fa,_0x45cfb3[_0xc994('0x51')]);return db[_0xc994('0x52')][_0xc994('0x58')](_0xc620fa)[_0xc994('0x1f')](handleEntityNotFound(_0x416fce,null))[_0xc994('0x1f')](respondWithResult(_0x416fce,null))[_0xc994('0x28')](handleError(_0x416fce,null));};exports['create']=function(_0x550f57,_0x44280d){return db[_0xc994('0x52')][_0xc994('0x59')](_0x550f57[_0xc994('0x5a')],{})[_0xc994('0x1f')](function(_0x374a19){var _0x34d1b1=_0x550f57[_0xc994('0x5b')][_0xc994('0x38')]({'plain':!![]});if(!_0x34d1b1)throw new Error(_0xc994('0x5c'));if(_0x34d1b1[_0xc994('0x5d')]==='user'){var _0xc0b57a=_0x374a19[_0xc994('0x38')]({'plain':!![]});var _0x24ce25=_0xc994('0x5e');return db[_0xc994('0x5f')][_0xc994('0x58')]({'where':{'name':_0x24ce25,'userProfileId':_0x34d1b1[_0xc994('0x60')]},'raw':!![]})[_0xc994('0x1f')](function(_0x198b58){if(_0x198b58&&_0x198b58[_0xc994('0x61')]===0x0){return db[_0xc994('0x62')][_0xc994('0x59')]({'name':_0xc0b57a[_0xc994('0x3a')],'resourceId':_0xc0b57a['id'],'type':_0x198b58[_0xc994('0x3a')],'sectionId':_0x198b58['id']},{})['then'](function(){return _0x374a19;});}else{return _0x374a19;}})['catch'](function(_0x4e1485){logger[_0xc994('0x26')](_0xc994('0x63'),_0x4e1485);throw _0x4e1485;});}return _0x374a19;})[_0xc994('0x1f')](respondWithResult(_0x44280d,0xc9))[_0xc994('0x28')](handleError(_0x44280d,null));};exports[_0xc994('0x36')]=function(_0x3fab60,_0x8ab565){if(_0x3fab60[_0xc994('0x5a')]['id']){delete _0x3fab60['body']['id'];}return db['WhatsappAccount'][_0xc994('0x58')]({'where':{'id':_0x3fab60[_0xc994('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xc994('0x57')}]})['then'](handleEntityNotFound(_0x8ab565,null))['then'](saveUpdates(_0x3fab60[_0xc994('0x5a')],null))[_0xc994('0x1f')](respondWithResult(_0x8ab565,null))[_0xc994('0x28')](handleError(_0x8ab565,null));};exports['destroy']=function(_0x43accd,_0x71bd8c){return db['WhatsappAccount']['find']({'where':{'id':_0x43accd['params']['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x71bd8c,null))[_0xc994('0x1f')](removeEntity(_0x71bd8c,null))[_0xc994('0x28')](handleError(_0x71bd8c,null));};exports[_0xc994('0x65')]=function(_0x7e44bc,_0x3e6e2c){return db[_0xc994('0x52')][_0xc994('0x65')]()[_0xc994('0x1f')](respondWithResult(_0x3e6e2c,null))[_0xc994('0x28')](handleError(_0x3e6e2c,null));};exports[_0xc994('0x66')]=function(_0x120020,_0x4860cb,_0x11d3ff){if(_0x120020[_0xc994('0x5a')]['id']){delete _0x120020[_0xc994('0x5a')]['id'];}return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x120020['params']['id']}})['then'](handleEntityNotFound(_0x4860cb,null))[_0xc994('0x1f')](function(_0x30cc6a){if(_0x30cc6a){_0x120020[_0xc994('0x5a')][_0xc994('0x67')]=_0x30cc6a['id'];return db[_0xc994('0x68')][_0xc994('0x59')](_0x120020[_0xc994('0x5a')]);}})[_0xc994('0x1f')](respondWithResult(_0x4860cb,null))[_0xc994('0x28')](handleError(_0x4860cb,null));};exports[_0xc994('0x69')]=function(_0x9a93de,_0x42a395,_0xde1422){var _0x57760f={'raw':![],'where':{}};var _0xe83148={};var _0x5a3f94={'count':0x0,'rows':[]};return db[_0xc994('0x52')]['findOne']({'where':{'id':_0x9a93de[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x42a395,null))[_0xc994('0x1f')](function(_0x45094d){if(_0x45094d){_0xe83148['model']=_[_0xc994('0x43')](db[_0xc994('0x68')][_0xc994('0x3f')]);_0xe83148[_0xc994('0x42')]=_['keys'](_0x9a93de[_0xc994('0x42')]);_0xe83148[_0xc994('0x4b')]=_[_0xc994('0x44')](_0xe83148[_0xc994('0x41')],_0xe83148[_0xc994('0x42')]);_0x57760f[_0xc994('0x45')]=_[_0xc994('0x44')](_0xe83148[_0xc994('0x41')],qs[_0xc994('0x46')](_0x9a93de[_0xc994('0x42')][_0xc994('0x46')]));_0x57760f[_0xc994('0x45')]=_0x57760f['attributes'][_0xc994('0x47')]?_0x57760f[_0xc994('0x45')]:_0xe83148['model'];if(!_0x9a93de['query'][_0xc994('0x48')]('nolimit')){_0x57760f[_0xc994('0x2f')]=qs[_0xc994('0x2f')](_0x9a93de[_0xc994('0x42')][_0xc994('0x2f')]);_0x57760f['offset']=qs[_0xc994('0x2d')](_0x9a93de['query'][_0xc994('0x2d')]);}_0x57760f[_0xc994('0x49')]=qs[_0xc994('0x4a')](_0x9a93de[_0xc994('0x42')][_0xc994('0x4a')]);_0x57760f[_0xc994('0x4e')]=qs[_0xc994('0x4b')](_['pick'](_0x9a93de[_0xc994('0x42')],_0xe83148['filters']));_0x57760f[_0xc994('0x4e')][_0xc994('0x67')]=_0x45094d['id'];if(_0x9a93de[_0xc994('0x42')][_0xc994('0x4d')]){_0x57760f[_0xc994('0x4e')]=_['merge'](_0x57760f['where'],{'$or':_[_0xc994('0x3e')](_0x57760f[_0xc994('0x45')],function(_0x494458){var _0x88ec05={};_0x88ec05[_0x494458]={'$like':'%'+_0x9a93de[_0xc994('0x42')][_0xc994('0x4d')]+'%'};return _0x88ec05;})});}_0x57760f=_[_0xc994('0x4f')]({},_0x57760f,_0x9a93de[_0xc994('0x51')]);return db[_0xc994('0x68')]['count']({'where':_0x57760f['where']})['then'](function(_0x337b74){_0x5a3f94[_0xc994('0x30')]=_0x337b74;if(_0x9a93de[_0xc994('0x42')][_0xc994('0x53')]){_0x57760f[_0xc994('0x54')]=[{'all':!![]}];}return db[_0xc994('0x68')][_0xc994('0x55')](_0x57760f);})['then'](function(_0x2f0d84){_0x5a3f94[_0xc994('0x6a')]=_0x2f0d84;return _0x5a3f94;});}})[_0xc994('0x1f')](respondWithFilteredResult(_0x42a395,_0x57760f))[_0xc994('0x28')](handleError(_0x42a395,null));};exports[_0xc994('0x6b')]=function(_0x28a616,_0x40a2b1,_0xdfb731){return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x28a616[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x40a2b1,null))[_0xc994('0x1f')](function(_0x3ec2cf){if(_0x3ec2cf){return _0x3ec2cf['removeDispositions'](_0x28a616[_0xc994('0x42')][_0xc994('0x6c')]);}})[_0xc994('0x1f')](respondWithStatusCode(_0x40a2b1,null))['catch'](handleError(_0x40a2b1,null));};exports[_0xc994('0x6d')]=function(_0x166352,_0x3d1ca1,_0x2feb87){if(_0x166352[_0xc994('0x5a')]['id']){delete _0x166352[_0xc994('0x5a')]['id'];}return db[_0xc994('0x52')]['find']({'where':{'id':_0x166352[_0xc994('0x64')]['id']}})['then'](handleEntityNotFound(_0x3d1ca1,null))[_0xc994('0x1f')](function(_0x1baa0f){if(_0x1baa0f){_0x166352[_0xc994('0x5a')][_0xc994('0x67')]=_0x1baa0f['id'];return db['CannedAnswer']['create'](_0x166352[_0xc994('0x5a')]);}})['then'](respondWithResult(_0x3d1ca1,null))[_0xc994('0x28')](handleError(_0x3d1ca1,null));};exports['getAnswers']=function(_0x364f23,_0x424fa8,_0x206f72){var _0x2839db={'raw':![],'where':{}};var _0x4a6173={};var _0x1fbe0d={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xc994('0x6e')]({'where':{'id':_0x364f23[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x424fa8,null))[_0xc994('0x1f')](function(_0x3d6718){if(_0x3d6718){_0x4a6173[_0xc994('0x41')]=_[_0xc994('0x43')](db[_0xc994('0x6f')][_0xc994('0x3f')]);_0x4a6173['query']=_[_0xc994('0x43')](_0x364f23['query']);_0x4a6173[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x4a6173[_0xc994('0x41')],_0x4a6173[_0xc994('0x42')]);_0x2839db[_0xc994('0x45')]=_['intersection'](_0x4a6173[_0xc994('0x41')],qs[_0xc994('0x46')](_0x364f23[_0xc994('0x42')][_0xc994('0x46')]));_0x2839db['attributes']=_0x2839db[_0xc994('0x45')][_0xc994('0x47')]?_0x2839db[_0xc994('0x45')]:_0x4a6173[_0xc994('0x41')];if(!_0x364f23[_0xc994('0x42')][_0xc994('0x48')]('nolimit')){_0x2839db[_0xc994('0x2f')]=qs[_0xc994('0x2f')](_0x364f23['query']['limit']);_0x2839db[_0xc994('0x2d')]=qs['offset'](_0x364f23[_0xc994('0x42')]['offset']);}_0x2839db['order']=qs[_0xc994('0x4a')](_0x364f23[_0xc994('0x42')][_0xc994('0x4a')]);_0x2839db[_0xc994('0x4e')]=qs['filters'](_[_0xc994('0x4c')](_0x364f23[_0xc994('0x42')],_0x4a6173[_0xc994('0x4b')]));_0x2839db[_0xc994('0x4e')][_0xc994('0x67')]=_0x3d6718['id'];if(_0x364f23['query'][_0xc994('0x4d')]){_0x2839db[_0xc994('0x4e')]=_['merge'](_0x2839db['where'],{'$or':_[_0xc994('0x3e')](_0x2839db[_0xc994('0x45')],function(_0x10dd42){var _0x304721={};_0x304721[_0x10dd42]={'$like':'%'+_0x364f23[_0xc994('0x42')][_0xc994('0x4d')]+'%'};return _0x304721;})});}_0x2839db=_[_0xc994('0x4f')]({},_0x2839db,_0x364f23['options']);return db[_0xc994('0x6f')]['count']({'where':_0x2839db[_0xc994('0x4e')]})[_0xc994('0x1f')](function(_0x40c1f8){_0x1fbe0d[_0xc994('0x30')]=_0x40c1f8;if(_0x364f23['query'][_0xc994('0x53')]){_0x2839db['include']=[{'all':!![]}];}return db[_0xc994('0x6f')][_0xc994('0x55')](_0x2839db);})['then'](function(_0x3424c3){_0x1fbe0d[_0xc994('0x6a')]=_0x3424c3;return _0x1fbe0d;});}})[_0xc994('0x1f')](respondWithFilteredResult(_0x424fa8,_0x2839db))['catch'](handleError(_0x424fa8,null));};exports[_0xc994('0x70')]=function(_0x4bf9d4,_0x40a8d1,_0xd8a3c8){return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x4bf9d4[_0xc994('0x64')]['id']}})['then'](handleEntityNotFound(_0x40a8d1,null))['then'](function(_0x2fa3c3){if(_0x2fa3c3){return _0x2fa3c3[_0xc994('0x70')](_0x4bf9d4[_0xc994('0x42')][_0xc994('0x6c')]);}})[_0xc994('0x1f')](respondWithStatusCode(_0x40a8d1,null))[_0xc994('0x28')](handleError(_0x40a8d1,null));};exports[_0xc994('0x71')]=function(_0x134c48,_0xb355ca,_0x1e9614){return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x134c48[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0xb355ca,null))['then'](function(_0x1c0fc3){if(_0x1c0fc3){return _0x1c0fc3['addAgents'](_0x134c48['body'][_0xc994('0x6c')],_[_0xc994('0x72')](_0x134c48['body'],['ids','id'])||{})[_0xc994('0x73')](function(_0x5b93cf){for(var _0x2f1bae=0x0;_0x2f1bae<_0x134c48['body'][_0xc994('0x6c')]['length'];_0x2f1bae+=0x1){socket[_0xc994('0x74')]('userWhatsappAccount:save',{'UserId':_0x134c48[_0xc994('0x5a')][_0xc994('0x6c')][_0x2f1bae],'WhatsappAccountId':_0x134c48[_0xc994('0x64')]['id']});}return _0x5b93cf;});}})[_0xc994('0x1f')](respondWithResult(_0xb355ca,null))['catch'](handleError(_0xb355ca,null));};exports[_0xc994('0x75')]=function(_0x570f28,_0x10573f,_0x1f1173){return db['WhatsappAccount'][_0xc994('0x58')]({'where':{'id':_0x570f28[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x10573f,null))['then'](function(_0x158ebf){if(_0x158ebf){return _0x158ebf[_0xc994('0x75')](_0x570f28[_0xc994('0x42')][_0xc994('0x6c')])[_0xc994('0x1f')](function(){if(_[_0xc994('0x76')](_0x570f28[_0xc994('0x42')][_0xc994('0x6c')])){for(var _0x1fb225=0x0;_0x1fb225<_0x570f28[_0xc994('0x42')][_0xc994('0x6c')][_0xc994('0x47')];_0x1fb225+=0x1){socket['emit'](_0xc994('0x77'),{'UserId':Number(_0x570f28[_0xc994('0x42')][_0xc994('0x6c')][_0x1fb225]),'WhatsappAccountId':Number(_0x570f28[_0xc994('0x64')]['id'])});}}else{socket['emit'](_0xc994('0x77'),{'UserId':Number(_0x570f28[_0xc994('0x42')][_0xc994('0x6c')]),'WhatsappAccountId':Number(_0x570f28[_0xc994('0x64')]['id'])});}});}})[_0xc994('0x1f')](respondWithStatusCode(_0x10573f,null))[_0xc994('0x28')](handleError(_0x10573f,null));};exports[_0xc994('0x78')]=function(_0x1268f0,_0x42c8ca,_0x9f7226){var _0xefebc={};var _0x477408={};var _0x355137;var _0x3f5cb9;return db[_0xc994('0x52')][_0xc994('0x6e')]({'where':{'id':_0x1268f0[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x42c8ca,null))['then'](function(_0x293916){if(_0x293916){_0x355137=_0x293916;_0x477408[_0xc994('0x41')]=_[_0xc994('0x43')](db[_0xc994('0x79')]['rawAttributes']);_0x477408['query']=_['keys'](_0x1268f0[_0xc994('0x42')]);_0x477408[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x477408[_0xc994('0x41')],_0x477408[_0xc994('0x42')]);_0xefebc[_0xc994('0x45')]=_[_0xc994('0x44')](_0x477408[_0xc994('0x41')],qs[_0xc994('0x46')](_0x1268f0['query'][_0xc994('0x46')]));_0xefebc[_0xc994('0x45')]=_0xefebc[_0xc994('0x45')][_0xc994('0x47')]?_0xefebc[_0xc994('0x45')]:_0x477408[_0xc994('0x41')];_0xefebc['order']=qs[_0xc994('0x4a')](_0x1268f0[_0xc994('0x42')][_0xc994('0x4a')]);_0xefebc[_0xc994('0x4e')]=qs[_0xc994('0x4b')](_[_0xc994('0x4c')](_0x1268f0[_0xc994('0x42')],_0x477408[_0xc994('0x4b')]));if(_0x1268f0[_0xc994('0x42')][_0xc994('0x4d')]){_0xefebc[_0xc994('0x4e')]=_[_0xc994('0x4f')](_0xefebc[_0xc994('0x4e')],{'$or':_[_0xc994('0x3e')](_0xefebc[_0xc994('0x45')],function(_0x1491ea){var _0x2a9832={};_0x2a9832[_0x1491ea]={'$like':'%'+_0x1268f0[_0xc994('0x42')][_0xc994('0x4d')]+'%'};return _0x2a9832;})});}_0xefebc=_[_0xc994('0x4f')]({},_0xefebc,_0x1268f0[_0xc994('0x51')]);return _0x355137['getAgents'](_0xefebc);}})[_0xc994('0x1f')](function(_0x355dd0){if(_0x355dd0){_0x3f5cb9=_0x355dd0[_0xc994('0x47')];if(!_0x1268f0[_0xc994('0x42')]['hasOwnProperty'](_0xc994('0x7a'))){_0xefebc['limit']=qs[_0xc994('0x2f')](_0x1268f0[_0xc994('0x42')][_0xc994('0x2f')]);_0xefebc[_0xc994('0x2d')]=qs[_0xc994('0x2d')](_0x1268f0['query'][_0xc994('0x2d')]);}return _0x355137['getAgents'](_0xefebc);}})[_0xc994('0x1f')](function(_0x2edc02){if(_0x2edc02){return _0x2edc02?{'count':_0x3f5cb9,'rows':_0x2edc02}:null;}})[_0xc994('0x1f')](respondWithResult(_0x42c8ca,null))[_0xc994('0x28')](handleError(_0x42c8ca,null));};exports[_0xc994('0x7b')]=function(_0x4d590d,_0x4e60f3,_0x1df500){return db[_0xc994('0x52')][_0xc994('0x6e')]({'where':{'id':_0x4d590d[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x4e60f3,null))[_0xc994('0x1f')](function(_0x512682){if(_0x512682){return db['sequelize']['transaction'](function(_0x947b9f){return db['WhatsappApplication'][_0xc994('0x37')]({'where':{'WhatsappAccountId':_0x4d590d[_0xc994('0x64')]['id']},'transaction':_0x947b9f})[_0xc994('0x1f')](function(_0x468517){var _0xa2402f=_['map'](_0x4d590d[_0xc994('0x5a')],function(_0x152eef){_0x152eef['WhatsappAccountId']=_0x4d590d['params']['id'];return _0x152eef;});return db[_0xc994('0x7c')][_0xc994('0x7d')](_0xa2402f,{'transaction':_0x947b9f});});})[_0xc994('0x1f')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x4d590d[_0xc994('0x64')]['id']},'order':_0xc994('0x7e')});});}})['then'](respondWithResult(_0x4e60f3,null))['catch'](handleError(_0x4e60f3,null));};exports['getApplications']=function(_0x1b9042,_0x45f65e,_0x3d27f0){var _0x429e07={};var _0x21ae2d={};var _0x145fd0;var _0x6a0e35;return db[_0xc994('0x52')][_0xc994('0x6e')]({'where':{'id':_0x1b9042['params']['id']}})['then'](handleEntityNotFound(_0x45f65e,null))['then'](function(_0x3da51b){if(_0x3da51b){_0x145fd0=_0x3da51b;_0x21ae2d['model']=_[_0xc994('0x43')](db[_0xc994('0x7c')][_0xc994('0x3f')]);_0x21ae2d[_0xc994('0x42')]=_[_0xc994('0x43')](_0x1b9042['query']);_0x21ae2d[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x21ae2d[_0xc994('0x41')],_0x21ae2d[_0xc994('0x42')]);_0x429e07[_0xc994('0x45')]=_[_0xc994('0x44')](_0x21ae2d[_0xc994('0x41')],qs[_0xc994('0x46')](_0x1b9042['query'][_0xc994('0x46')]));_0x429e07[_0xc994('0x45')]=_0x429e07[_0xc994('0x45')][_0xc994('0x47')]?_0x429e07['attributes']:_0x21ae2d[_0xc994('0x41')];_0x429e07[_0xc994('0x49')]=qs['sort'](_0x1b9042[_0xc994('0x42')][_0xc994('0x4a')]);_0x429e07['where']=qs[_0xc994('0x4b')](_['pick'](_0x1b9042['query'],_0x21ae2d[_0xc994('0x4b')]));if(_0x1b9042[_0xc994('0x42')][_0xc994('0x4d')]){_0x429e07[_0xc994('0x4e')]=_[_0xc994('0x4f')](_0x429e07[_0xc994('0x4e')],{'$or':_['map'](_0x429e07[_0xc994('0x45')],function(_0xdfb45c){var _0x43d5d2={};_0x43d5d2[_0xdfb45c]={'$like':'%'+_0x1b9042['query']['filter']+'%'};return _0x43d5d2;})});}_0x429e07=_['merge']({},_0x429e07,_0x1b9042[_0xc994('0x51')]);return _0x145fd0[_0xc994('0x7f')](_0x429e07);}})[_0xc994('0x1f')](function(_0x2d9b0b){if(_0x2d9b0b){_0x6a0e35=_0x2d9b0b['length'];if(!_0x1b9042['query']['hasOwnProperty']('nolimit')){_0x429e07['limit']=qs['limit'](_0x1b9042['query'][_0xc994('0x2f')]);_0x429e07[_0xc994('0x2d')]=qs[_0xc994('0x2d')](_0x1b9042[_0xc994('0x42')][_0xc994('0x2d')]);}return _0x145fd0[_0xc994('0x7f')](_0x429e07);}})['then'](function(_0x2a0ba4){if(_0x2a0ba4){return _0x2a0ba4?{'count':_0x6a0e35,'rows':_0x2a0ba4}:null;}})[_0xc994('0x1f')](respondWithResult(_0x45f65e,null))[_0xc994('0x28')](handleError(_0x45f65e,null));};exports[_0xc994('0x80')]=function(_0x503dbb,_0x64ee8c,_0x66f879){var _0xc753bd={'channel':_0xc994('0x81')};var _0x85263f=[];var _0x153534=[];var _0xfbfa48={};return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x503dbb[_0xc994('0x64')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xc994('0x82')}]})[_0xc994('0x1f')](handleEntityNotFound(_0x64ee8c,null))['then'](function(_0x2a3dca){_0xc753bd['account']=_0x2a3dca;_0xc753bd[_0xc994('0x83')]=_[_0xc994('0x84')](_0x2a3dca[_0xc994('0x82')],['priority'],[_0xc994('0x85')]);if(_0xc753bd['account']['Applications']){delete _0xc753bd[_0xc994('0x86')][_0xc994('0x82')];}return db[_0xc994('0x87')][_0xc994('0x65')]();})['then'](function(_0xc33936){if(!_0xc33936){throw new db['Sequelize']['ValidationError'](_0xc994('0x88'));}_0x85263f=_[_0xc994('0x89')](_[_0xc994('0x43')](_0xc33936),[_0xc994('0x8a'),_0xc994('0x8b')]);_0x153534=_[_0xc994('0x89')](_[_0xc994('0x43')](_0xc33936),[_0xc994('0x8a'),_0xc994('0x8b'),'CompanyId',_0xc994('0x8c')]);_0xc753bd[_0xc994('0x5a')]={'mapKey':_0xc994('0x8d')};if(_0xc753bd[_0xc994('0x86')][_0xc994('0x40')]&&_0xc753bd[_0xc994('0x86')]['type']===_0xc994('0x8e')){_0xc753bd[_0xc994('0x5a')][_0xc994('0x8f')]=_0x503dbb[_0xc994('0x5a')]['From']['replace'](_0xc994('0x90'),'');_0xc753bd[_0xc994('0x5a')][_0xc994('0x5a')]=_0x503dbb['body']['Body'];_0xc753bd[_0xc994('0x5a')][_0xc994('0x91')]=_0x503dbb[_0xc994('0x5a')][_0xc994('0x92')];}if(_0xc753bd[_0xc994('0x5a')]['id']){delete _0xc753bd[_0xc994('0x5a')]['id'];}if(_[_0xc994('0x93')](_0xc753bd[_0xc994('0x5a')][_0xc994('0x8f')])){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))](_0xc994('0x96'));}if(_[_0xc994('0x93')](_0xc753bd['body'][_0xc994('0x5a')])||_0xc753bd[_0xc994('0x5a')]['body']===''){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))](_0xc994('0x97'));}if(_['isNil'](_0xc753bd[_0xc994('0x5a')][_0xc994('0x98')])){throw new db['Sequelize'][(_0xc994('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x153534);}if(!_[_0xc994('0x99')](_0x153534,_0xc753bd[_0xc994('0x5a')][_0xc994('0x98')])){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))](_0xc994('0x9a')+_0x153534);}_0xfbfa48[_0xc753bd[_0xc994('0x5a')]['mapKey']]=_0xc753bd[_0xc994('0x5a')]['from'];return db[_0xc994('0x9b')][_0xc994('0x58')]({'where':{'id':_0xc753bd[_0xc994('0x86')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xc994('0x9c'),'where':_0xfbfa48,'limit':0x1,'order':[[_0xc994('0x8b'),'DESC']]}]});})[_0xc994('0x1f')](handleEntityNotFound(_0x64ee8c,null))[_0xc994('0x1f')](function(_0x5c80a3){if(_0x5c80a3){_0xc753bd[_0xc994('0x9d')]=_['omit'](_0x5c80a3,[_0xc994('0x9c')]);if(_0x5c80a3[_0xc994('0x9c')][_0xc994('0x47')]){return _0x5c80a3['Contacts'][0x0];}var _0x5c256c=_[_0xc994('0x18')](_0xc753bd[_0xc994('0x5a')],{'firstName':_0xc753bd['body'][_0xc994('0x8f')],'ListId':_0x5c80a3['id']});_0x5c256c[_0xc753bd[_0xc994('0x5a')]['mapKey']]=_0xc753bd[_0xc994('0x5a')][_0xc994('0x8f')];return db[_0xc994('0x87')]['create'](_0x5c256c,{'fields':_0x85263f,'raw':!![]});}})['then'](handleEntityNotFound(_0x64ee8c,null))[_0xc994('0x1f')](function(_0x6ea40b){if(_0x6ea40b){_0xc753bd['contact']=_0x6ea40b;var _0x6a3612={'ContactId':_0x6ea40b['id'],'phone':_0xc753bd[_0xc994('0x5a')]['from'],'WhatsappAccountId':_0x503dbb['params']['id']};var _0xde0146={'ContactId':_0x6ea40b['id'],'WhatsappAccountId':_0x503dbb[_0xc994('0x64')]['id'],'closed':![]};return db[_0xc994('0x9e')][_0xc994('0x58')]({'where':_0xde0146})[_0xc994('0x1f')](function(_0x1d4a97){if(_0x1d4a97){return[_0x1d4a97,![]];}return db[_0xc994('0x9e')][_0xc994('0x59')](_0x6a3612)[_0xc994('0x1f')](function(_0x3a6dd1){return[_0x3a6dd1,!![]];});});}})['spread'](function(_0x5dae2d,_0x2a2593){_0xc753bd[_0xc994('0x9f')]=_0x5dae2d[_0xc994('0x38')]({'plain':!![]});_0xc753bd[_0xc994('0x9f')][_0xc994('0xa0')]=![];if(_0x2a2593){if(_0xc753bd[_0xc994('0x86')]['autoclose']){_0xc753bd['applications'][_0xc994('0xa1')]({'id':0x0,'priority':_0xc753bd[_0xc994('0x83')]['length']+0x1,'app':'close','appdata':_0xc994('0xa2'),'interval':'*,*,*,*'});}_0xc753bd['interaction'][_0xc994('0xa0')]=!![];}return db[_0xc994('0xa3')][_0xc994('0x59')]({'phone':_0xc753bd['body']['from'],'messageId':_0xc753bd[_0xc994('0x5a')][_0xc994('0x91')],'body':_0xc753bd['body']['body'],'WhatsappAccountId':_0x503dbb[_0xc994('0x64')]['id'],'WhatsappInteractionId':_0x5dae2d['id'],'direction':'in','ContactId':_0x5dae2d[_0xc994('0xa4')],'AttachmentId':_0xc753bd['body'][_0xc994('0xa5')]});})['then'](function(_0x7cb697){_0xc753bd[_0xc994('0x27')]=_0x7cb697;if(_0xc753bd[_0xc994('0x9f')][_0xc994('0xa6')]){return db[_0xc994('0x79')][_0xc994('0x58')]({'attributes':['id',_0xc994('0x3a')],'where':{'id':_0xc753bd[_0xc994('0x9f')][_0xc994('0xa6')]}})[_0xc994('0x1f')](function(_0x168815){if(_0x168815){_0xc753bd[_0xc994('0x83')][_0xc994('0xa7')]({'id':0x0,'priority':0x0,'app':_0xc994('0xa8'),'appdata':_0x168815[_0xc994('0x3a')]+','+(_0xc753bd[_0xc994('0x86')][_0xc994('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc994('0xaa'),_0xc994('0xab'),_0xc753bd);});}return respondWithRpcPromise(_0xc994('0xaa'),_0xc994('0xab'),_0xc753bd);})[_0xc994('0x1f')](function(_0x4f0d5a){if(_0x4f0d5a){var _0xdb2e7d=0xc8;var _0x4c9672=_0xc994('0xac');logger[_0xc994('0x20')](_0xc994('0x24'),_0x4c9672,_0xdb2e7d,_0xc994('0xad'));logger[_0xc994('0x23')](_0xc994('0xae'),_0x4c9672,_0xdb2e7d,_0xc994('0xad'),JSON[_0xc994('0x25')](_0x4f0d5a));if(_0xc753bd[_0xc994('0x86')][_0xc994('0x40')]===_0xc994('0x8e')){return _0x64ee8c[_0xc994('0x2a')](_0xdb2e7d)[_0xc994('0x31')](_0xc994('0xaf'),_0xc994('0xb0'))[_0xc994('0x3b')](_0xc994('0xb1'));}else{return _0x64ee8c[_0xc994('0x2a')](_0xdb2e7d)[_0xc994('0x2c')](_0x4f0d5a);}}})[_0xc994('0x28')](handleError(_0x64ee8c,null));};exports[_0xc994('0x3b')]=function(_0x56cca3,_0x5f7640,_0x2d8f67){var _0x31ff19,_0xda93a,_0x4a84c5;if(_[_0xc994('0x93')](_0x56cca3[_0xc994('0x5a')][_0xc994('0x5a')])||_0x56cca3[_0xc994('0x5a')][_0xc994('0x5a')]===''){throw new db[(_0xc994('0x94'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc994('0x93')](_0x56cca3[_0xc994('0x5a')]['to'])){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))]('to\x20is\x20mandatory');}_0x31ff19=_0x56cca3['body']['to'];return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x56cca3['params']['id']},'include':[{'model':db[_0xc994('0x9b')],'as':_0xc994('0xb2'),'include':[{'model':db['CmContact'],'as':_0xc994('0x9c'),'where':{'mobile':_0x31ff19},'limit':0x1,'order':[['updatedAt',_0xc994('0xb3')]]}]}]})[_0xc994('0x1f')](handleEntityNotFound(_0x5f7640,null))[_0xc994('0x1f')](function(_0x4f755b){if(_0x4f755b&&_0x4f755b[_0xc994('0xb2')]){_0xda93a=_0x4f755b[_0xc994('0x38')]({'plain':!![]});if(_0xda93a[_0xc994('0xb2')]&&_0xda93a[_0xc994('0xb2')][_0xc994('0x9c')][_0xc994('0x47')]){return _0xda93a['List'][_0xc994('0x9c')][0x0];}return db[_0xc994('0x87')][_0xc994('0x59')](_[_0xc994('0x18')](_0x56cca3[_0xc994('0x5a')],{'firstName':_0x31ff19,'mobile':_0x31ff19,'phone':_0x31ff19,'ListId':_0xda93a['ListId']}));}})[_0xc994('0x1f')](handleEntityNotFound(_0x5f7640,null))[_0xc994('0x1f')](function(_0x3647d2){if(_0x3647d2){_0x4a84c5=_0x3647d2;return db[_0xc994('0x9e')][_0xc994('0x58')]({'where':{'ContactId':_0x4a84c5['id'],'closed':![],'WhatsappAccountId':_0xda93a['id']}})['then'](function(_0x46d12e){if(_0x46d12e){return[_0x46d12e,![]];}return db[_0xc994('0x9e')][_0xc994('0x59')]({'UserId':_0x56cca3[_0xc994('0x5b')]['id'],'ContactId':_0x4a84c5['id'],'WhatsappAccountId':_0xda93a['id'],'phone':_0x31ff19,'firstMsgDirection':_0xc994('0xb4'),'Messages':[_[_0xc994('0x4f')](_0x56cca3[_0xc994('0x5a')],{'read':![],'body':_0x56cca3['body'][_0xc994('0x5a')],'phone':_0x31ff19,'WhatsappAccountId':_0xda93a['id'],'UserId':_0x56cca3['user']['id'],'ContactId':_0x4a84c5['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xc994('0xb5')}]})[_0xc994('0x1f')](function(_0x1f2048){return[_0x1f2048,!![]];});});}})['spread'](function(_0x3df943,_0x49b413){if(_0x49b413){return _0x3df943;}return db[_0xc994('0xa3')]['create'](_[_0xc994('0x4f')](_0x56cca3['body'],{'read':![],'body':_0x56cca3[_0xc994('0x5a')][_0xc994('0x5a')],'phone':_0x31ff19,'WhatsappAccountId':_0xda93a['id'],'WhatsappInteractionId':_0x3df943['id'],'UserId':_0x56cca3[_0xc994('0x5b')]['id'],'ContactId':_0x4a84c5['id']}))['then'](function(_0x6fa6da){_0x3df943['dataValues'][_0xc994('0xb5')]=[];_0x3df943[_0xc994('0xb6')][_0xc994('0xb5')][_0xc994('0xa1')](_0x6fa6da[_0xc994('0xb6')]);return _0x3df943;});})['then'](respondWithResult(_0x5f7640,null))[_0xc994('0x28')](handleError(_0x5f7640,null));}; \ No newline at end of file +var _0xf547=['messageId','MessageSid','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','updatedAt','list','defaults','contact','WhatsappInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','send','\x0a','List','DESC','out','dataValues','Messages','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','name','index','map','WhatsappAccount','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','Pause','mandatoryDispositionPause','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','WhatsappAccountId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','mobile','twilio','from','replace','whatsapp:','Body'];(function(_0x4dda14,_0x5a5185){var _0x379235=function(_0x59e400){while(--_0x59e400){_0x4dda14['push'](_0x4dda14['shift']());}};_0x379235(++_0x5a5185);}(_0xf547,0x1a9));var _0x7f54=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xf547[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0x7f54('0x0'));var rimraf=require(_0x7f54('0x1'));var zipdir=require(_0x7f54('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f54('0x3'));var moment=require(_0x7f54('0x4'));var BPromise=require(_0x7f54('0x5'));var Mustache=require(_0x7f54('0x6'));var util=require(_0x7f54('0x7'));var path=require(_0x7f54('0x8'));var sox=require(_0x7f54('0x9'));var csv=require(_0x7f54('0xa'));var ejs=require(_0x7f54('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f54('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7f54('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7f54('0xa'));var querystring=require(_0x7f54('0xe'));var Papa=require('papaparse');var Redis=require(_0x7f54('0xf'));var authService=require(_0x7f54('0x10'));var qs=require(_0x7f54('0x11'));var as=require(_0x7f54('0x12'));var hardwareService=require(_0x7f54('0x13'));var logger=require(_0x7f54('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7f54('0x15'));var licenseUtil=require(_0x7f54('0x16'));var db=require(_0x7f54('0x17'))['db'];config[_0x7f54('0x18')]=_['defaults'](config['redis'],{'host':_0x7f54('0x19'),'port':0x18eb});var socket=require(_0x7f54('0x1a'))(new Redis(config[_0x7f54('0x18')]));require(_0x7f54('0x1b'))[_0x7f54('0x1c')](socket);var jayson=require(_0x7f54('0x1d'));var client=jayson[_0x7f54('0x1e')][_0x7f54('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1f5d41,_0x11a288,_0x11b034,_0x413e13){return new BPromise(function(_0x450457,_0x708613){var _0x273de8=_0x413e13||client;return _0x273de8['request'](_0x1f5d41,_0x11b034)['then'](function(_0x4d03df){logger['info'](_0x7f54('0x20'),_0x11a288,'request\x20sent');logger[_0x7f54('0x21')](_0x7f54('0x22'),_0x11a288,'request\x20sent',JSON[_0x7f54('0x23')](_0x4d03df));if(_0x4d03df[_0x7f54('0x24')]){if(_0x4d03df[_0x7f54('0x24')][_0x7f54('0x25')]===0x1f4){logger[_0x7f54('0x24')](_0x7f54('0x20'),_0x11a288,_0x4d03df[_0x7f54('0x24')][_0x7f54('0x26')]);return _0x708613(_0x4d03df[_0x7f54('0x24')][_0x7f54('0x26')]);}logger['error'](_0x7f54('0x20'),_0x11a288,_0x4d03df[_0x7f54('0x24')][_0x7f54('0x26')]);return _0x450457(_0x4d03df[_0x7f54('0x24')]['message']);}else{logger[_0x7f54('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x11a288,'request\x20sent');_0x450457(_0x4d03df[_0x7f54('0x28')][_0x7f54('0x26')]);}})[_0x7f54('0x29')](function(_0xa9e572){logger['error'](_0x7f54('0x20'),_0x11a288,_0xa9e572);_0x708613(_0xa9e572);});});}function respondWithStatusCode(_0x4a01af,_0x173c50){_0x173c50=_0x173c50||0xcc;return function(_0xecae97){if(_0xecae97){return _0x4a01af[_0x7f54('0x2a')](_0x173c50);}return _0x4a01af[_0x7f54('0x2b')](_0x173c50)[_0x7f54('0x2c')]();};}function respondWithResult(_0x4383e3,_0x134849){_0x134849=_0x134849||0xc8;return function(_0x18753f){if(_0x18753f){return _0x4383e3[_0x7f54('0x2b')](_0x134849)['json'](_0x18753f);}};}function respondWithFilteredResult(_0x565643,_0x18e12b){return function(_0x55382a){if(_0x55382a){var _0x1c056c=typeof _0x18e12b[_0x7f54('0x2d')]===_0x7f54('0x2e')&&typeof _0x18e12b[_0x7f54('0x2f')]==='undefined';var _0x4eaa3d=_0x55382a['count'];var _0x5f1ca7=_0x1c056c?0x0:_0x18e12b[_0x7f54('0x2d')];var _0x1fac70=_0x1c056c?_0x55382a[_0x7f54('0x30')]:_0x18e12b[_0x7f54('0x2d')]+_0x18e12b[_0x7f54('0x2f')];var _0x29b533;if(_0x1fac70>=_0x4eaa3d){_0x1fac70=_0x4eaa3d;_0x29b533=0xc8;}else{_0x29b533=0xce;}_0x565643['status'](_0x29b533);return _0x565643[_0x7f54('0x31')](_0x7f54('0x32'),_0x5f1ca7+'-'+_0x1fac70+'/'+_0x4eaa3d)[_0x7f54('0x33')](_0x55382a);}return null;};}function patchUpdates(_0x248ccb){return function(_0x21e937){try{jsonpatch[_0x7f54('0x34')](_0x21e937,_0x248ccb,!![]);}catch(_0x21d0af){return BPromise[_0x7f54('0x35')](_0x21d0af);}return _0x21e937[_0x7f54('0x36')]();};}function saveUpdates(_0x1f28e4,_0x1fb7f4){return function(_0x361ea0){if(_0x361ea0){return _0x361ea0[_0x7f54('0x37')](_0x1f28e4)[_0x7f54('0x38')](function(_0x4d98ad){return _0x4d98ad;});}return null;};}function removeEntity(_0x3d4e67,_0x24b863){return function(_0x194c00){if(_0x194c00){return _0x194c00[_0x7f54('0x39')]()[_0x7f54('0x38')](function(){var _0x362688=_0x194c00[_0x7f54('0x3a')]({'plain':!![]});var _0x51bba6=_0x7f54('0x3b');return db[_0x7f54('0x3c')]['destroy']({'where':{'type':_0x51bba6,'resourceId':_0x362688['id']}})[_0x7f54('0x38')](function(){return _0x194c00;});})['then'](function(){_0x3d4e67['status'](0xcc)[_0x7f54('0x2c')]();});}};}function handleEntityNotFound(_0x473890,_0x9ea5f6){return function(_0x55b722){if(!_0x55b722){_0x473890[_0x7f54('0x2a')](0x194);}return _0x55b722;};}function handleError(_0x3e9481,_0x3db21c){_0x3db21c=_0x3db21c||0x1f4;return function(_0x4230af){logger['error'](_0x4230af['stack']);if(_0x4230af[_0x7f54('0x3d')]){delete _0x4230af[_0x7f54('0x3d')];}_0x3e9481[_0x7f54('0x2b')](_0x3db21c)['send'](_0x4230af);};}exports[_0x7f54('0x3e')]=function(_0x20415b,_0x22c893){var _0x435150={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xd6548d={},_0x3971bb={'count':0x0,'rows':[]};var _0x55f3aa=_[_0x7f54('0x3f')](db[_0x7f54('0x40')][_0x7f54('0x41')],function(_0x56a55e){return{'name':_0x56a55e['fieldName'],'type':_0x56a55e['type'][_0x7f54('0x42')]};});_0xd6548d[_0x7f54('0x43')]=_[_0x7f54('0x3f')](_0x55f3aa,'name');_0xd6548d[_0x7f54('0x44')]=_['keys'](_0x20415b[_0x7f54('0x44')]);_0xd6548d[_0x7f54('0x45')]=_['intersection'](_0xd6548d[_0x7f54('0x43')],_0xd6548d[_0x7f54('0x44')]);_0x435150[_0x7f54('0x46')]=_[_0x7f54('0x47')](_0xd6548d[_0x7f54('0x43')],qs[_0x7f54('0x48')](_0x20415b[_0x7f54('0x44')][_0x7f54('0x48')]));_0x435150[_0x7f54('0x46')]=_0x435150[_0x7f54('0x46')][_0x7f54('0x49')]?_0x435150[_0x7f54('0x46')]:_0xd6548d[_0x7f54('0x43')];if(!_0x20415b[_0x7f54('0x44')]['hasOwnProperty'](_0x7f54('0x4a'))){_0x435150[_0x7f54('0x2f')]=qs[_0x7f54('0x2f')](_0x20415b['query']['limit']);_0x435150[_0x7f54('0x2d')]=qs[_0x7f54('0x2d')](_0x20415b[_0x7f54('0x44')]['offset']);}_0x435150[_0x7f54('0x4b')]=qs['sort'](_0x20415b[_0x7f54('0x44')][_0x7f54('0x4c')]);_0x435150[_0x7f54('0x4d')]=qs[_0x7f54('0x45')](_[_0x7f54('0x4e')](_0x20415b[_0x7f54('0x44')],_0xd6548d[_0x7f54('0x45')]),_0x55f3aa);if(_0x20415b[_0x7f54('0x44')][_0x7f54('0x4f')]){_0x435150[_0x7f54('0x4d')]=_[_0x7f54('0x50')](_0x435150[_0x7f54('0x4d')],{'$or':_['map'](_0x55f3aa,function(_0x3b3425){if(_0x3b3425[_0x7f54('0x51')]!==_0x7f54('0x52')){var _0x31eca9={};_0x31eca9[_0x3b3425[_0x7f54('0x3d')]]={'$like':'%'+_0x20415b['query']['filter']+'%'};return _0x31eca9;}})});}_0x435150=_['merge']({},_0x435150,_0x20415b['options']);var _0x359f88={'where':_0x435150['where']};return db[_0x7f54('0x40')][_0x7f54('0x30')](_0x359f88)['then'](function(_0x2125fc){_0x3971bb[_0x7f54('0x30')]=_0x2125fc;if(_0x20415b[_0x7f54('0x44')][_0x7f54('0x53')]){_0x435150[_0x7f54('0x54')]=[{'all':!![]}];}return db[_0x7f54('0x40')][_0x7f54('0x55')](_0x435150);})[_0x7f54('0x38')](function(_0x57b674){_0x3971bb[_0x7f54('0x56')]=_0x57b674;return _0x3971bb;})[_0x7f54('0x38')](respondWithFilteredResult(_0x22c893,_0x435150))[_0x7f54('0x29')](handleError(_0x22c893,null));};exports['show']=function(_0x30a3ed,_0x1fa640){var _0x4f4e63={'raw':![],'where':{'id':_0x30a3ed[_0x7f54('0x57')]['id']},'include':[{'model':db[_0x7f54('0x58')],'as':_0x7f54('0x59')}]},_0x47eade={};_0x47eade[_0x7f54('0x43')]=_[_0x7f54('0x5a')](db['WhatsappAccount']['rawAttributes']);_0x47eade[_0x7f54('0x44')]=_[_0x7f54('0x5a')](_0x30a3ed[_0x7f54('0x44')]);_0x47eade[_0x7f54('0x45')]=_[_0x7f54('0x47')](_0x47eade['model'],_0x47eade['query']);_0x4f4e63[_0x7f54('0x46')]=_['intersection'](_0x47eade['model'],qs[_0x7f54('0x48')](_0x30a3ed[_0x7f54('0x44')][_0x7f54('0x48')]));_0x4f4e63[_0x7f54('0x46')]=_0x4f4e63[_0x7f54('0x46')]['length']?_0x4f4e63[_0x7f54('0x46')]:_0x47eade[_0x7f54('0x43')];if(_0x30a3ed[_0x7f54('0x44')][_0x7f54('0x53')]){_0x4f4e63[_0x7f54('0x54')]=[{'all':!![]}];}_0x4f4e63=_[_0x7f54('0x50')]({},_0x4f4e63,_0x30a3ed[_0x7f54('0x5b')]);return db['WhatsappAccount']['find'](_0x4f4e63)[_0x7f54('0x38')](handleEntityNotFound(_0x1fa640,null))[_0x7f54('0x38')](respondWithResult(_0x1fa640,null))[_0x7f54('0x29')](handleError(_0x1fa640,null));};exports[_0x7f54('0x5c')]=function(_0x42af11,_0x59dc0f){return db[_0x7f54('0x40')][_0x7f54('0x5c')](_0x42af11[_0x7f54('0x5d')],{})[_0x7f54('0x38')](function(_0x3f3d90){var _0x547782=_0x42af11[_0x7f54('0x5e')][_0x7f54('0x3a')]({'plain':!![]});if(!_0x547782)throw new Error(_0x7f54('0x5f'));if(_0x547782['role']===_0x7f54('0x5e')){var _0x28046c=_0x3f3d90[_0x7f54('0x3a')]({'plain':!![]});var _0x4e1dcc='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x4e1dcc,'userProfileId':_0x547782[_0x7f54('0x60')]},'raw':!![]})[_0x7f54('0x38')](function(_0x356934){if(_0x356934&&_0x356934[_0x7f54('0x61')]===0x0){return db[_0x7f54('0x3c')]['create']({'name':_0x28046c[_0x7f54('0x3d')],'resourceId':_0x28046c['id'],'type':_0x356934[_0x7f54('0x3d')],'sectionId':_0x356934['id']},{})['then'](function(){return _0x3f3d90;});}else{return _0x3f3d90;}})['catch'](function(_0x58a4c9){logger[_0x7f54('0x24')](_0x7f54('0x62'),_0x58a4c9);throw _0x58a4c9;});}return _0x3f3d90;})['then'](respondWithResult(_0x59dc0f,0xc9))[_0x7f54('0x29')](handleError(_0x59dc0f,null));};exports[_0x7f54('0x37')]=function(_0x10e902,_0x3ca14e){if(_0x10e902['body']['id']){delete _0x10e902['body']['id'];}return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x10e902[_0x7f54('0x57')]['id']},'include':[{'model':db[_0x7f54('0x58')],'as':_0x7f54('0x59')}]})[_0x7f54('0x38')](handleEntityNotFound(_0x3ca14e,null))['then'](saveUpdates(_0x10e902[_0x7f54('0x5d')],null))[_0x7f54('0x38')](respondWithResult(_0x3ca14e,null))[_0x7f54('0x29')](handleError(_0x3ca14e,null));};exports[_0x7f54('0x39')]=function(_0x57de22,_0x37adf7){return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x57de22['params']['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x37adf7,null))[_0x7f54('0x38')](removeEntity(_0x37adf7,null))[_0x7f54('0x29')](handleError(_0x37adf7,null));};exports[_0x7f54('0x64')]=function(_0x39211d,_0x77466){return db['WhatsappAccount'][_0x7f54('0x64')]()['then'](respondWithResult(_0x77466,null))['catch'](handleError(_0x77466,null));};exports[_0x7f54('0x65')]=function(_0x2bf254,_0x15d965,_0x498ee4){if(_0x2bf254[_0x7f54('0x5d')]['id']){delete _0x2bf254[_0x7f54('0x5d')]['id'];}return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x2bf254[_0x7f54('0x57')]['id']}})['then'](handleEntityNotFound(_0x15d965,null))[_0x7f54('0x38')](function(_0x3ad240){if(_0x3ad240){_0x2bf254[_0x7f54('0x5d')][_0x7f54('0x66')]=_0x3ad240['id'];return db[_0x7f54('0x67')]['create'](_0x2bf254['body']);}})['then'](respondWithResult(_0x15d965,null))[_0x7f54('0x29')](handleError(_0x15d965,null));};exports['getDispositions']=function(_0xc6c431,_0x3b0258,_0x5ed7ee){var _0x39584b={'raw':![],'where':{}};var _0x48d4c0={};var _0x2fb12b={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x7f54('0x68')]({'where':{'id':_0xc6c431['params']['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x3b0258,null))[_0x7f54('0x38')](function(_0x2974f3){if(_0x2974f3){_0x48d4c0[_0x7f54('0x43')]=_[_0x7f54('0x5a')](db[_0x7f54('0x67')][_0x7f54('0x41')]);_0x48d4c0['query']=_['keys'](_0xc6c431['query']);_0x48d4c0['filters']=_[_0x7f54('0x47')](_0x48d4c0['model'],_0x48d4c0['query']);_0x39584b[_0x7f54('0x46')]=_[_0x7f54('0x47')](_0x48d4c0['model'],qs['fields'](_0xc6c431[_0x7f54('0x44')][_0x7f54('0x48')]));_0x39584b['attributes']=_0x39584b[_0x7f54('0x46')][_0x7f54('0x49')]?_0x39584b['attributes']:_0x48d4c0[_0x7f54('0x43')];if(!_0xc6c431['query'][_0x7f54('0x69')](_0x7f54('0x4a'))){_0x39584b[_0x7f54('0x2f')]=qs['limit'](_0xc6c431[_0x7f54('0x44')]['limit']);_0x39584b[_0x7f54('0x2d')]=qs[_0x7f54('0x2d')](_0xc6c431['query']['offset']);}_0x39584b['order']=qs[_0x7f54('0x4c')](_0xc6c431[_0x7f54('0x44')][_0x7f54('0x4c')]);_0x39584b[_0x7f54('0x4d')]=qs[_0x7f54('0x45')](_[_0x7f54('0x4e')](_0xc6c431[_0x7f54('0x44')],_0x48d4c0[_0x7f54('0x45')]));_0x39584b[_0x7f54('0x4d')]['WhatsappAccountId']=_0x2974f3['id'];if(_0xc6c431['query'][_0x7f54('0x4f')]){_0x39584b[_0x7f54('0x4d')]=_[_0x7f54('0x50')](_0x39584b[_0x7f54('0x4d')],{'$or':_['map'](_0x39584b[_0x7f54('0x46')],function(_0x286551){var _0x2672c4={};_0x2672c4[_0x286551]={'$like':'%'+_0xc6c431[_0x7f54('0x44')][_0x7f54('0x4f')]+'%'};return _0x2672c4;})});}_0x39584b=_[_0x7f54('0x50')]({},_0x39584b,_0xc6c431[_0x7f54('0x5b')]);return db[_0x7f54('0x67')]['count']({'where':_0x39584b[_0x7f54('0x4d')]})[_0x7f54('0x38')](function(_0x22244c){_0x2fb12b['count']=_0x22244c;if(_0xc6c431['query'][_0x7f54('0x53')]){_0x39584b['include']=[{'all':!![]}];}return db['Disposition'][_0x7f54('0x55')](_0x39584b);})['then'](function(_0x5a1d83){_0x2fb12b[_0x7f54('0x56')]=_0x5a1d83;return _0x2fb12b;});}})[_0x7f54('0x38')](respondWithFilteredResult(_0x3b0258,_0x39584b))[_0x7f54('0x29')](handleError(_0x3b0258,null));};exports['removeDispositions']=function(_0x254059,_0xf4552d,_0x293482){return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x254059[_0x7f54('0x57')]['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0xf4552d,null))[_0x7f54('0x38')](function(_0x43edff){if(_0x43edff){return _0x43edff[_0x7f54('0x6a')](_0x254059[_0x7f54('0x44')][_0x7f54('0x6b')]);}})[_0x7f54('0x38')](respondWithStatusCode(_0xf4552d,null))[_0x7f54('0x29')](handleError(_0xf4552d,null));};exports[_0x7f54('0x6c')]=function(_0x49e34d,_0x3a4b47,_0x5dc71c){if(_0x49e34d['body']['id']){delete _0x49e34d[_0x7f54('0x5d')]['id'];}return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x49e34d[_0x7f54('0x57')]['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x3a4b47,null))[_0x7f54('0x38')](function(_0xd6fdd0){if(_0xd6fdd0){_0x49e34d[_0x7f54('0x5d')]['WhatsappAccountId']=_0xd6fdd0['id'];return db[_0x7f54('0x6d')]['create'](_0x49e34d[_0x7f54('0x5d')]);}})[_0x7f54('0x38')](respondWithResult(_0x3a4b47,null))[_0x7f54('0x29')](handleError(_0x3a4b47,null));};exports[_0x7f54('0x6e')]=function(_0x5d9681,_0x582e10,_0x1882f3){var _0x11105a={'raw':![],'where':{}};var _0x2d68b2={};var _0x2b06e0={'count':0x0,'rows':[]};return db[_0x7f54('0x40')]['findOne']({'where':{'id':_0x5d9681['params']['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x582e10,null))[_0x7f54('0x38')](function(_0x12035d){if(_0x12035d){_0x2d68b2[_0x7f54('0x43')]=_[_0x7f54('0x5a')](db['CannedAnswer'][_0x7f54('0x41')]);_0x2d68b2['query']=_[_0x7f54('0x5a')](_0x5d9681['query']);_0x2d68b2['filters']=_[_0x7f54('0x47')](_0x2d68b2['model'],_0x2d68b2[_0x7f54('0x44')]);_0x11105a[_0x7f54('0x46')]=_[_0x7f54('0x47')](_0x2d68b2[_0x7f54('0x43')],qs[_0x7f54('0x48')](_0x5d9681['query'][_0x7f54('0x48')]));_0x11105a['attributes']=_0x11105a['attributes'][_0x7f54('0x49')]?_0x11105a[_0x7f54('0x46')]:_0x2d68b2[_0x7f54('0x43')];if(!_0x5d9681[_0x7f54('0x44')]['hasOwnProperty'](_0x7f54('0x4a'))){_0x11105a[_0x7f54('0x2f')]=qs[_0x7f54('0x2f')](_0x5d9681[_0x7f54('0x44')][_0x7f54('0x2f')]);_0x11105a[_0x7f54('0x2d')]=qs[_0x7f54('0x2d')](_0x5d9681[_0x7f54('0x44')]['offset']);}_0x11105a['order']=qs['sort'](_0x5d9681[_0x7f54('0x44')]['sort']);_0x11105a[_0x7f54('0x4d')]=qs[_0x7f54('0x45')](_[_0x7f54('0x4e')](_0x5d9681[_0x7f54('0x44')],_0x2d68b2['filters']));_0x11105a[_0x7f54('0x4d')][_0x7f54('0x66')]=_0x12035d['id'];if(_0x5d9681['query'][_0x7f54('0x4f')]){_0x11105a[_0x7f54('0x4d')]=_[_0x7f54('0x50')](_0x11105a['where'],{'$or':_[_0x7f54('0x3f')](_0x11105a[_0x7f54('0x46')],function(_0x8101bf){var _0x185a04={};_0x185a04[_0x8101bf]={'$like':'%'+_0x5d9681[_0x7f54('0x44')]['filter']+'%'};return _0x185a04;})});}_0x11105a=_[_0x7f54('0x50')]({},_0x11105a,_0x5d9681[_0x7f54('0x5b')]);return db[_0x7f54('0x6d')][_0x7f54('0x30')]({'where':_0x11105a[_0x7f54('0x4d')]})[_0x7f54('0x38')](function(_0x1b4541){_0x2b06e0[_0x7f54('0x30')]=_0x1b4541;if(_0x5d9681[_0x7f54('0x44')][_0x7f54('0x53')]){_0x11105a['include']=[{'all':!![]}];}return db[_0x7f54('0x6d')][_0x7f54('0x55')](_0x11105a);})[_0x7f54('0x38')](function(_0x3121f4){_0x2b06e0['rows']=_0x3121f4;return _0x2b06e0;});}})['then'](respondWithFilteredResult(_0x582e10,_0x11105a))[_0x7f54('0x29')](handleError(_0x582e10,null));};exports[_0x7f54('0x6f')]=function(_0x161f58,_0x548720,_0x991e73){return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x161f58['params']['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x548720,null))['then'](function(_0x22f183){if(_0x22f183){return _0x22f183[_0x7f54('0x6f')](_0x161f58['query'][_0x7f54('0x6b')]);}})[_0x7f54('0x38')](respondWithStatusCode(_0x548720,null))['catch'](handleError(_0x548720,null));};exports[_0x7f54('0x70')]=function(_0x13e75f,_0x1ebd15,_0x41cb28){return db['WhatsappAccount'][_0x7f54('0x63')]({'where':{'id':_0x13e75f[_0x7f54('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ebd15,null))[_0x7f54('0x38')](function(_0x410dd8){if(_0x410dd8){return _0x410dd8['addAgents'](_0x13e75f[_0x7f54('0x5d')][_0x7f54('0x6b')],_[_0x7f54('0x71')](_0x13e75f[_0x7f54('0x5d')],['ids','id'])||{})[_0x7f54('0x72')](function(_0x6ef96d){for(var _0x5ac212=0x0;_0x5ac212<_0x13e75f[_0x7f54('0x5d')][_0x7f54('0x6b')]['length'];_0x5ac212+=0x1){socket[_0x7f54('0x73')](_0x7f54('0x74'),{'UserId':_0x13e75f[_0x7f54('0x5d')][_0x7f54('0x6b')][_0x5ac212],'WhatsappAccountId':_0x13e75f['params']['id']});}return _0x6ef96d;});}})[_0x7f54('0x38')](respondWithResult(_0x1ebd15,null))[_0x7f54('0x29')](handleError(_0x1ebd15,null));};exports['removeAgents']=function(_0x3c8ef9,_0x5452ad,_0x299612){return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x3c8ef9['params']['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x5452ad,null))[_0x7f54('0x38')](function(_0x139829){if(_0x139829){return _0x139829[_0x7f54('0x75')](_0x3c8ef9[_0x7f54('0x44')][_0x7f54('0x6b')])[_0x7f54('0x38')](function(){if(_[_0x7f54('0x76')](_0x3c8ef9[_0x7f54('0x44')][_0x7f54('0x6b')])){for(var _0x7a1eb0=0x0;_0x7a1eb0<_0x3c8ef9['query'][_0x7f54('0x6b')][_0x7f54('0x49')];_0x7a1eb0+=0x1){socket['emit'](_0x7f54('0x77'),{'UserId':Number(_0x3c8ef9[_0x7f54('0x44')]['ids'][_0x7a1eb0]),'WhatsappAccountId':Number(_0x3c8ef9['params']['id'])});}}else{socket['emit'](_0x7f54('0x77'),{'UserId':Number(_0x3c8ef9[_0x7f54('0x44')][_0x7f54('0x6b')]),'WhatsappAccountId':Number(_0x3c8ef9[_0x7f54('0x57')]['id'])});}});}})[_0x7f54('0x38')](respondWithStatusCode(_0x5452ad,null))[_0x7f54('0x29')](handleError(_0x5452ad,null));};exports[_0x7f54('0x78')]=function(_0x45fa61,_0x1072e1,_0x55a44b){var _0x126342={};var _0x6eea28={};var _0x3503d1;var _0xc051cf;return db['WhatsappAccount']['findOne']({'where':{'id':_0x45fa61[_0x7f54('0x57')]['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x1072e1,null))[_0x7f54('0x38')](function(_0x212a3f){if(_0x212a3f){_0x3503d1=_0x212a3f;_0x6eea28['model']=_['keys'](db[_0x7f54('0x79')][_0x7f54('0x41')]);_0x6eea28[_0x7f54('0x44')]=_['keys'](_0x45fa61[_0x7f54('0x44')]);_0x6eea28[_0x7f54('0x45')]=_['intersection'](_0x6eea28[_0x7f54('0x43')],_0x6eea28[_0x7f54('0x44')]);_0x126342['attributes']=_['intersection'](_0x6eea28['model'],qs[_0x7f54('0x48')](_0x45fa61[_0x7f54('0x44')][_0x7f54('0x48')]));_0x126342[_0x7f54('0x46')]=_0x126342[_0x7f54('0x46')][_0x7f54('0x49')]?_0x126342['attributes']:_0x6eea28[_0x7f54('0x43')];_0x126342[_0x7f54('0x4b')]=qs[_0x7f54('0x4c')](_0x45fa61[_0x7f54('0x44')][_0x7f54('0x4c')]);_0x126342[_0x7f54('0x4d')]=qs[_0x7f54('0x45')](_['pick'](_0x45fa61['query'],_0x6eea28[_0x7f54('0x45')]));if(_0x45fa61[_0x7f54('0x44')][_0x7f54('0x4f')]){_0x126342[_0x7f54('0x4d')]=_[_0x7f54('0x50')](_0x126342[_0x7f54('0x4d')],{'$or':_[_0x7f54('0x3f')](_0x126342[_0x7f54('0x46')],function(_0x528771){var _0x2a1069={};_0x2a1069[_0x528771]={'$like':'%'+_0x45fa61[_0x7f54('0x44')][_0x7f54('0x4f')]+'%'};return _0x2a1069;})});}_0x126342=_['merge']({},_0x126342,_0x45fa61['options']);return _0x3503d1['getAgents'](_0x126342);}})[_0x7f54('0x38')](function(_0x550073){if(_0x550073){_0xc051cf=_0x550073['length'];if(!_0x45fa61[_0x7f54('0x44')][_0x7f54('0x69')](_0x7f54('0x4a'))){_0x126342[_0x7f54('0x2f')]=qs['limit'](_0x45fa61[_0x7f54('0x44')][_0x7f54('0x2f')]);_0x126342[_0x7f54('0x2d')]=qs[_0x7f54('0x2d')](_0x45fa61[_0x7f54('0x44')]['offset']);}return _0x3503d1[_0x7f54('0x78')](_0x126342);}})[_0x7f54('0x38')](function(_0x253de8){if(_0x253de8){return _0x253de8?{'count':_0xc051cf,'rows':_0x253de8}:null;}})[_0x7f54('0x38')](respondWithResult(_0x1072e1,null))[_0x7f54('0x29')](handleError(_0x1072e1,null));};exports[_0x7f54('0x7a')]=function(_0x502f74,_0x25ea5b,_0x5d8ec1){return db['WhatsappAccount'][_0x7f54('0x68')]({'where':{'id':_0x502f74[_0x7f54('0x57')]['id']}})['then'](handleEntityNotFound(_0x25ea5b,null))[_0x7f54('0x38')](function(_0x1f2798){if(_0x1f2798){return db[_0x7f54('0x7b')]['transaction'](function(_0x1c8b17){return db[_0x7f54('0x7c')][_0x7f54('0x39')]({'where':{'WhatsappAccountId':_0x502f74['params']['id']},'transaction':_0x1c8b17})[_0x7f54('0x38')](function(_0x52c0a7){var _0x16686b=_[_0x7f54('0x3f')](_0x502f74[_0x7f54('0x5d')],function(_0x14878c){_0x14878c['WhatsappAccountId']=_0x502f74[_0x7f54('0x57')]['id'];return _0x14878c;});return db['WhatsappApplication']['bulkCreate'](_0x16686b,{'transaction':_0x1c8b17});});})[_0x7f54('0x38')](function(){return db['WhatsappApplication'][_0x7f54('0x7d')]({'where':{'WhatsappAccountId':_0x502f74[_0x7f54('0x57')]['id']},'order':_0x7f54('0x7e')});});}})['then'](respondWithResult(_0x25ea5b,null))['catch'](handleError(_0x25ea5b,null));};exports[_0x7f54('0x7f')]=function(_0x9efa3b,_0x4abf95,_0x2889c8){var _0x32d9d1={};var _0x142751={};var _0x5de5a7;var _0x28796b;return db[_0x7f54('0x40')][_0x7f54('0x68')]({'where':{'id':_0x9efa3b[_0x7f54('0x57')]['id']}})[_0x7f54('0x38')](handleEntityNotFound(_0x4abf95,null))[_0x7f54('0x38')](function(_0x29c0bc){if(_0x29c0bc){_0x5de5a7=_0x29c0bc;_0x142751['model']=_['keys'](db[_0x7f54('0x7c')]['rawAttributes']);_0x142751[_0x7f54('0x44')]=_['keys'](_0x9efa3b[_0x7f54('0x44')]);_0x142751[_0x7f54('0x45')]=_['intersection'](_0x142751[_0x7f54('0x43')],_0x142751[_0x7f54('0x44')]);_0x32d9d1[_0x7f54('0x46')]=_[_0x7f54('0x47')](_0x142751[_0x7f54('0x43')],qs[_0x7f54('0x48')](_0x9efa3b['query'][_0x7f54('0x48')]));_0x32d9d1[_0x7f54('0x46')]=_0x32d9d1[_0x7f54('0x46')][_0x7f54('0x49')]?_0x32d9d1['attributes']:_0x142751[_0x7f54('0x43')];_0x32d9d1[_0x7f54('0x4b')]=qs[_0x7f54('0x4c')](_0x9efa3b['query'][_0x7f54('0x4c')]);_0x32d9d1[_0x7f54('0x4d')]=qs[_0x7f54('0x45')](_[_0x7f54('0x4e')](_0x9efa3b['query'],_0x142751[_0x7f54('0x45')]));if(_0x9efa3b[_0x7f54('0x44')][_0x7f54('0x4f')]){_0x32d9d1[_0x7f54('0x4d')]=_[_0x7f54('0x50')](_0x32d9d1[_0x7f54('0x4d')],{'$or':_[_0x7f54('0x3f')](_0x32d9d1[_0x7f54('0x46')],function(_0x1e774d){var _0x6d611c={};_0x6d611c[_0x1e774d]={'$like':'%'+_0x9efa3b['query'][_0x7f54('0x4f')]+'%'};return _0x6d611c;})});}_0x32d9d1=_[_0x7f54('0x50')]({},_0x32d9d1,_0x9efa3b[_0x7f54('0x5b')]);return _0x5de5a7[_0x7f54('0x7f')](_0x32d9d1);}})[_0x7f54('0x38')](function(_0x283b06){if(_0x283b06){_0x28796b=_0x283b06[_0x7f54('0x49')];if(!_0x9efa3b['query'][_0x7f54('0x69')]('nolimit')){_0x32d9d1[_0x7f54('0x2f')]=qs[_0x7f54('0x2f')](_0x9efa3b[_0x7f54('0x44')][_0x7f54('0x2f')]);_0x32d9d1[_0x7f54('0x2d')]=qs[_0x7f54('0x2d')](_0x9efa3b[_0x7f54('0x44')][_0x7f54('0x2d')]);}return _0x5de5a7[_0x7f54('0x7f')](_0x32d9d1);}})[_0x7f54('0x38')](function(_0x367259){if(_0x367259){return _0x367259?{'count':_0x28796b,'rows':_0x367259}:null;}})[_0x7f54('0x38')](respondWithResult(_0x4abf95,null))[_0x7f54('0x29')](handleError(_0x4abf95,null));};exports[_0x7f54('0x80')]=function(_0x16efd9,_0x437db2,_0x37381c){var _0x309e03={'channel':_0x7f54('0x81')};var _0x31be7e=[];var _0x18bb1c=[];var _0x8e44ae={};return db[_0x7f54('0x40')]['find']({'where':{'id':_0x16efd9[_0x7f54('0x57')]['id']},'include':[{'model':db[_0x7f54('0x7c')],'as':_0x7f54('0x82')}]})[_0x7f54('0x38')](handleEntityNotFound(_0x437db2,null))['then'](function(_0x4bbc78){_0x309e03['account']=_0x4bbc78;_0x309e03[_0x7f54('0x83')]=_[_0x7f54('0x84')](_0x4bbc78[_0x7f54('0x82')],['priority'],[_0x7f54('0x85')]);if(_0x309e03['account']['Applications']){delete _0x309e03[_0x7f54('0x86')][_0x7f54('0x82')];}return db[_0x7f54('0x87')][_0x7f54('0x64')]();})[_0x7f54('0x38')](function(_0x4d62dd){if(!_0x4d62dd){throw new db[(_0x7f54('0x88'))][(_0x7f54('0x89'))](_0x7f54('0x8a'));}_0x31be7e=_[_0x7f54('0x8b')](_['keys'](_0x4d62dd),[_0x7f54('0x8c'),'updatedAt']);_0x18bb1c=_[_0x7f54('0x8b')](_[_0x7f54('0x5a')](_0x4d62dd),[_0x7f54('0x8c'),'updatedAt',_0x7f54('0x8d'),'ListId']);_0x309e03[_0x7f54('0x5d')]={'mapKey':_0x7f54('0x8e')};if(_0x309e03['account'][_0x7f54('0x51')]&&_0x309e03[_0x7f54('0x86')]['type']===_0x7f54('0x8f')){_0x309e03[_0x7f54('0x5d')][_0x7f54('0x90')]=_0x16efd9['body']['From'][_0x7f54('0x91')](_0x7f54('0x92'),'');_0x309e03[_0x7f54('0x5d')][_0x7f54('0x5d')]=_0x16efd9[_0x7f54('0x5d')][_0x7f54('0x93')];_0x309e03[_0x7f54('0x5d')][_0x7f54('0x94')]=_0x16efd9[_0x7f54('0x5d')][_0x7f54('0x95')];}if(_0x309e03[_0x7f54('0x5d')]['id']){delete _0x309e03['body']['id'];}if(_['isNil'](_0x309e03[_0x7f54('0x5d')][_0x7f54('0x90')])){throw new db[(_0x7f54('0x88'))][(_0x7f54('0x89'))](_0x7f54('0x96'));}if(_['isNil'](_0x309e03[_0x7f54('0x5d')][_0x7f54('0x5d')])||_0x309e03[_0x7f54('0x5d')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x7f54('0x97'));}if(_[_0x7f54('0x98')](_0x309e03[_0x7f54('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0x7f54('0x89'))](_0x7f54('0x99')+_0x18bb1c);}if(!_[_0x7f54('0x9a')](_0x18bb1c,_0x309e03[_0x7f54('0x5d')][_0x7f54('0x9b')])){throw new db['Sequelize']['ValidationError'](_0x7f54('0x9c')+_0x18bb1c);}_0x8e44ae[_0x309e03[_0x7f54('0x5d')]['mapKey']]=_0x309e03['body'][_0x7f54('0x90')];return db[_0x7f54('0x9d')][_0x7f54('0x63')]({'where':{'id':_0x309e03[_0x7f54('0x86')][_0x7f54('0x9e')]},'include':[{'model':db[_0x7f54('0x87')],'as':_0x7f54('0x9f'),'where':_0x8e44ae,'limit':0x1,'order':[[_0x7f54('0xa0'),'DESC']]}]});})[_0x7f54('0x38')](handleEntityNotFound(_0x437db2,null))[_0x7f54('0x38')](function(_0x57ed24){if(_0x57ed24){_0x309e03[_0x7f54('0xa1')]=_['omit'](_0x57ed24,[_0x7f54('0x9f')]);if(_0x57ed24[_0x7f54('0x9f')]['length']){return _0x57ed24[_0x7f54('0x9f')][0x0];}var _0x2f90c4=_[_0x7f54('0xa2')](_0x309e03[_0x7f54('0x5d')],{'firstName':_0x309e03['body'][_0x7f54('0x90')],'ListId':_0x57ed24['id']});_0x2f90c4[_0x309e03['body'][_0x7f54('0x9b')]]=_0x309e03[_0x7f54('0x5d')][_0x7f54('0x90')];return db[_0x7f54('0x87')][_0x7f54('0x5c')](_0x2f90c4,{'fields':_0x31be7e,'raw':!![]});}})['then'](handleEntityNotFound(_0x437db2,null))[_0x7f54('0x38')](function(_0x435c9f){if(_0x435c9f){_0x309e03[_0x7f54('0xa3')]=_0x435c9f;var _0x137925={'ContactId':_0x435c9f['id'],'phone':_0x309e03[_0x7f54('0x5d')][_0x7f54('0x90')],'WhatsappAccountId':_0x16efd9[_0x7f54('0x57')]['id']};var _0x44ad09={'ContactId':_0x435c9f['id'],'WhatsappAccountId':_0x16efd9[_0x7f54('0x57')]['id'],'closed':![]};return db[_0x7f54('0xa4')][_0x7f54('0x63')]({'where':_0x44ad09})[_0x7f54('0x38')](function(_0x1a4a56){if(_0x1a4a56){return[_0x1a4a56,![]];}return db['WhatsappInteraction'][_0x7f54('0x5c')](_0x137925)[_0x7f54('0x38')](function(_0x5029ff){return[_0x5029ff,!![]];});});}})[_0x7f54('0x72')](function(_0x4576b9,_0x58b052){_0x309e03[_0x7f54('0xa5')]=_0x4576b9['get']({'plain':!![]});_0x309e03[_0x7f54('0xa5')][_0x7f54('0xa6')]=![];if(_0x58b052){if(_0x309e03[_0x7f54('0x86')][_0x7f54('0xa7')]){_0x309e03['applications'][_0x7f54('0xa8')]({'id':0x0,'priority':_0x309e03['applications'][_0x7f54('0x49')]+0x1,'app':'close','appdata':_0x7f54('0xa9'),'interval':_0x7f54('0xaa')});}_0x309e03[_0x7f54('0xa5')][_0x7f54('0xa6')]=!![];}return db[_0x7f54('0xab')][_0x7f54('0x5c')]({'phone':_0x309e03[_0x7f54('0x5d')][_0x7f54('0x90')],'messageId':_0x309e03['body'][_0x7f54('0x94')],'body':_0x309e03[_0x7f54('0x5d')][_0x7f54('0x5d')],'WhatsappAccountId':_0x16efd9[_0x7f54('0x57')]['id'],'WhatsappInteractionId':_0x4576b9['id'],'direction':'in','ContactId':_0x4576b9[_0x7f54('0xac')],'AttachmentId':_0x309e03[_0x7f54('0x5d')][_0x7f54('0xad')]});})[_0x7f54('0x38')](function(_0x51eebb){_0x309e03[_0x7f54('0x26')]=_0x51eebb;if(_0x309e03[_0x7f54('0xa5')]['UserId']){return db[_0x7f54('0x79')]['find']({'attributes':['id','name'],'where':{'id':_0x309e03[_0x7f54('0xa5')][_0x7f54('0xae')]}})[_0x7f54('0x38')](function(_0x210ebd){if(_0x210ebd){_0x309e03[_0x7f54('0x83')][_0x7f54('0xaf')]({'id':0x0,'priority':0x0,'app':_0x7f54('0xb0'),'appdata':_0x210ebd[_0x7f54('0x3d')]+','+(_0x309e03[_0x7f54('0x86')][_0x7f54('0xb1')]||0xa),'interval':_0x7f54('0xaa')});}return respondWithRpcPromise(_0x7f54('0xb2'),_0x7f54('0xb3'),_0x309e03);});}return respondWithRpcPromise(_0x7f54('0xb2'),'startRouting',_0x309e03);})[_0x7f54('0x38')](function(_0x46de37){if(_0x46de37){var _0x207936=0xc8;var _0x3d1071=_0x7f54('0xb4');logger['info'](_0x7f54('0x22'),_0x3d1071,_0x207936,_0x7f54('0xb5'));logger['debug'](_0x7f54('0xb6'),_0x3d1071,_0x207936,_0x7f54('0xb5'),JSON[_0x7f54('0x23')](_0x46de37));if(_0x309e03['account'][_0x7f54('0x51')]===_0x7f54('0x8f')){return _0x437db2[_0x7f54('0x2b')](_0x207936)[_0x7f54('0x31')](_0x7f54('0xb7'),'text/xml')[_0x7f54('0xb8')](_0x7f54('0xb9'));}else{return _0x437db2[_0x7f54('0x2b')](_0x207936)[_0x7f54('0x33')](_0x46de37);}}})[_0x7f54('0x29')](handleError(_0x437db2,null));};exports[_0x7f54('0xb8')]=function(_0x5d72d5,_0x250bf8,_0x50f85e){var _0x38b040,_0xf20d9c,_0x1cba02;if(_[_0x7f54('0x98')](_0x5d72d5[_0x7f54('0x5d')][_0x7f54('0x5d')])||_0x5d72d5[_0x7f54('0x5d')][_0x7f54('0x5d')]===''){throw new db[(_0x7f54('0x88'))][(_0x7f54('0x89'))](_0x7f54('0x97'));}if(_['isNil'](_0x5d72d5['body']['to'])){throw new db['Sequelize'][(_0x7f54('0x89'))]('to\x20is\x20mandatory');}_0x38b040=_0x5d72d5[_0x7f54('0x5d')]['to'];return db[_0x7f54('0x40')][_0x7f54('0x63')]({'where':{'id':_0x5d72d5[_0x7f54('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x7f54('0xba'),'include':[{'model':db[_0x7f54('0x87')],'as':'Contacts','where':{'mobile':_0x38b040},'limit':0x1,'order':[[_0x7f54('0xa0'),_0x7f54('0xbb')]]}]}]})[_0x7f54('0x38')](handleEntityNotFound(_0x250bf8,null))['then'](function(_0x2b928e){if(_0x2b928e&&_0x2b928e[_0x7f54('0xba')]){_0xf20d9c=_0x2b928e[_0x7f54('0x3a')]({'plain':!![]});if(_0xf20d9c[_0x7f54('0xba')]&&_0xf20d9c['List'][_0x7f54('0x9f')][_0x7f54('0x49')]){return _0xf20d9c[_0x7f54('0xba')]['Contacts'][0x0];}return db[_0x7f54('0x87')][_0x7f54('0x5c')](_[_0x7f54('0xa2')](_0x5d72d5[_0x7f54('0x5d')],{'firstName':_0x38b040,'mobile':_0x38b040,'phone':_0x38b040,'ListId':_0xf20d9c[_0x7f54('0x9e')]}));}})[_0x7f54('0x38')](handleEntityNotFound(_0x250bf8,null))[_0x7f54('0x38')](function(_0x23d2f1){if(_0x23d2f1){_0x1cba02=_0x23d2f1;return db[_0x7f54('0xa4')][_0x7f54('0x63')]({'where':{'ContactId':_0x1cba02['id'],'closed':![],'WhatsappAccountId':_0xf20d9c['id']}})[_0x7f54('0x38')](function(_0x3bcf4a){if(_0x3bcf4a){return[_0x3bcf4a,![]];}return db['WhatsappInteraction'][_0x7f54('0x5c')]({'UserId':_0x5d72d5['user']['id'],'ContactId':_0x1cba02['id'],'WhatsappAccountId':_0xf20d9c['id'],'phone':_0x38b040,'firstMsgDirection':_0x7f54('0xbc'),'Messages':[_['merge'](_0x5d72d5[_0x7f54('0x5d')],{'read':![],'body':_0x5d72d5['body'][_0x7f54('0x5d')],'phone':_0x38b040,'WhatsappAccountId':_0xf20d9c['id'],'UserId':_0x5d72d5['user']['id'],'ContactId':_0x1cba02['id']})]},{'include':[{'model':db[_0x7f54('0xab')],'as':'Messages'}]})[_0x7f54('0x38')](function(_0x3354a0){return[_0x3354a0,!![]];});});}})[_0x7f54('0x72')](function(_0x5aaded,_0x5edc88){if(_0x5edc88){return _0x5aaded;}return db['WhatsappMessage'][_0x7f54('0x5c')](_['merge'](_0x5d72d5[_0x7f54('0x5d')],{'read':![],'body':_0x5d72d5[_0x7f54('0x5d')]['body'],'phone':_0x38b040,'WhatsappAccountId':_0xf20d9c['id'],'WhatsappInteractionId':_0x5aaded['id'],'UserId':_0x5d72d5['user']['id'],'ContactId':_0x1cba02['id']}))[_0x7f54('0x38')](function(_0x53ad73){_0x5aaded[_0x7f54('0xbd')][_0x7f54('0xbe')]=[];_0x5aaded['dataValues'][_0x7f54('0xbe')][_0x7f54('0xa8')](_0x53ad73['dataValues']);return _0x5aaded;});})['then'](respondWithResult(_0x250bf8,null))[_0x7f54('0x29')](handleError(_0x250bf8,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 54a14ce..3d7f2d7 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 _0x9172=['hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update','emit'];(function(_0x1ce9dc,_0x364a4c){var _0x2fdd91=function(_0x5ab26d){while(--_0x5ab26d){_0x1ce9dc['push'](_0x1ce9dc['shift']());}};_0x2fdd91(++_0x364a4c);}(_0x9172,0xc9));var _0x2917=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x9172[_0x1da527];return _0x40fc7c;};'use strict';var EventEmitter=require(_0x2917('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x2917('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2917('0x2')](0x0);var events={'afterCreate':_0x2917('0x3'),'afterUpdate':_0x2917('0x4'),'afterDestroy':'remove'};function emitEvent(_0x432825){return function(_0x112078,_0x11945a,_0x2e77cd){WhatsappAccountEvents[_0x2917('0x5')](_0x432825+':'+_0x112078['id'],_0x112078);WhatsappAccountEvents[_0x2917('0x5')](_0x432825,_0x112078);_0x2e77cd(null);};}for(var e in events){if(events[_0x2917('0x6')](e)){var event=events[e];WhatsappAccount[_0x2917('0x7')](e,emitEvent(event));}}module[_0x2917('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x55f3=['emit','hasOwnProperty','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55f3,0x1d7));var _0x355f=function(_0x450bc4,_0x49ee63){_0x450bc4=_0x450bc4-0x0;var _0x165096=_0x55f3[_0x450bc4];return _0x165096;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x355f('0x0'))['db'][_0x355f('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x355f('0x2')](0x0);var events={'afterCreate':_0x355f('0x3'),'afterUpdate':_0x355f('0x4'),'afterDestroy':_0x355f('0x5')};function emitEvent(_0x33da01){return function(_0xbb5582,_0x1d94c6,_0x4e228d){WhatsappAccountEvents[_0x355f('0x6')](_0x33da01+':'+_0xbb5582['id'],_0xbb5582);WhatsappAccountEvents[_0x355f('0x6')](_0x33da01,_0xbb5582);_0x4e228d(null);};}for(var e in events){if(events[_0x355f('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x355f('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 15160b3..c3c4214 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 _0x12f9=['./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x12f9,0x194));var _0x912f=function(_0x519a03,_0x2f3ec2){_0x519a03=_0x519a03-0x0;var _0x541b6b=_0x12f9[_0x519a03];return _0x541b6b;};'use strict';var _=require(_0x912f('0x0'));var util=require(_0x912f('0x1'));var logger=require(_0x912f('0x2'))('api');var moment=require(_0x912f('0x3'));var BPromise=require('bluebird');var rp=require(_0x912f('0x4'));var fs=require('fs');var path=require(_0x912f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x912f('0x6'));module[_0x912f('0x7')]=function(_0x291f3e,_0x1cdc69){return _0x291f3e['define'](_0x912f('0x8'),attributes,{'tableName':_0x912f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e71=['./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x186f59,_0x151827){var _0x390497=function(_0x42f3bc){while(--_0x42f3bc){_0x186f59['push'](_0x186f59['shift']());}};_0x390497(++_0x151827);}(_0x4e71,0xcc));var _0x14e7=function(_0x376409,_0x53efa2){_0x376409=_0x376409-0x0;var _0x21a68a=_0x4e71[_0x376409];return _0x21a68a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x14e7('0x0'))(_0x14e7('0x1'));var moment=require(_0x14e7('0x2'));var BPromise=require(_0x14e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14e7('0x4'));var rimraf=require(_0x14e7('0x5'));var config=require('../../config/environment');var attributes=require(_0x14e7('0x6'));module[_0x14e7('0x7')]=function(_0x38759a,_0x46514b){return _0x38759a['define'](_0x14e7('0x8'),attributes,{'tableName':_0x14e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index f36b163..a9b8b0c 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 _0x6946=['map','model','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','attributes','include'];(function(_0x5edafc,_0x22002c){var _0x1fa600=function(_0x5dc143){while(--_0x5dc143){_0x5edafc['push'](_0x5edafc['shift']());}};_0x1fa600(++_0x22002c);}(_0x6946,0x1b3));var _0x6694=function(_0x3f3ad8,_0x1dc2a3){_0x3f3ad8=_0x3f3ad8-0x0;var _0x1024ed=_0x6946[_0x3f3ad8];return _0x1024ed;};'use strict';var _=require(_0x6694('0x0'));var util=require(_0x6694('0x1'));var moment=require(_0x6694('0x2'));var BPromise=require(_0x6694('0x3'));var rs=require(_0x6694('0x4'));var fs=require('fs');var Redis=require(_0x6694('0x5'));var db=require(_0x6694('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6694('0x7'));var config=require(_0x6694('0x8'));var jayson=require(_0x6694('0x9'));var client=jayson[_0x6694('0xa')][_0x6694('0xb')]({'port':0x232a});config[_0x6694('0xc')]=_[_0x6694('0xd')](config[_0x6694('0xc')],{'host':_0x6694('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6694('0xf'))[_0x6694('0x10')](socket);function respondWithRpcPromise(_0x32aba8,_0x46f4a0,_0x35c5c7){return new BPromise(function(_0x3890c2,_0x1d9996){return client['request'](_0x32aba8,_0x35c5c7)[_0x6694('0x11')](function(_0x396009){logger[_0x6694('0x12')](_0x6694('0x13'),_0x46f4a0,'request\x20sent');logger[_0x6694('0x14')](_0x6694('0x15'),_0x46f4a0,_0x6694('0x16'),JSON[_0x6694('0x17')](_0x396009));if(_0x396009[_0x6694('0x18')]){if(_0x396009[_0x6694('0x18')][_0x6694('0x19')]===0x1f4){logger['error'](_0x6694('0x13'),_0x46f4a0,_0x396009[_0x6694('0x18')][_0x6694('0x1a')]);return _0x1d9996(_0x396009[_0x6694('0x18')][_0x6694('0x1a')]);}logger[_0x6694('0x18')](_0x6694('0x13'),_0x46f4a0,_0x396009['error'][_0x6694('0x1a')]);return _0x3890c2(_0x396009['error'][_0x6694('0x1a')]);}else{logger[_0x6694('0x12')](_0x6694('0x13'),_0x46f4a0,_0x6694('0x16'));_0x3890c2(_0x396009[_0x6694('0x1b')][_0x6694('0x1a')]);}})[_0x6694('0x1c')](function(_0x4157bc){logger[_0x6694('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x46f4a0,_0x4157bc);_0x1d9996(_0x4157bc);});});}exports['ShowWhatsappAccount']=function(_0x125f1f){var _0x577eb7=this;return new Promise(function(_0x2ceeab,_0xab1d7e){return db['WhatsappAccount']['find']({'raw':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')][_0x6694('0x1e')]===undefined?!![]:![]:!![],'where':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')]['where']||null:null,'attributes':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')][_0x6694('0x1f')]||null:null,'include':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')][_0x6694('0x20')]?_[_0x6694('0x21')](_0x125f1f[_0x6694('0x1d')][_0x6694('0x20')],function(_0x9cf925){return{'model':db[_0x9cf925['model']],'as':_0x9cf925['as'],'attributes':_0x9cf925[_0x6694('0x1f')],'include':_0x9cf925['include']?_[_0x6694('0x21')](_0x9cf925[_0x6694('0x20')],function(_0x5542ff){return{'model':db[_0x5542ff[_0x6694('0x22')]],'as':_0x5542ff['as'],'attributes':_0x5542ff[_0x6694('0x1f')],'include':_0x5542ff[_0x6694('0x20')]?_[_0x6694('0x21')](_0x5542ff['include'],function(_0x172a86){return{'model':db[_0x172a86[_0x6694('0x22')]],'as':_0x172a86['as'],'attributes':_0x172a86[_0x6694('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x305ab6){logger[_0x6694('0x12')](_0x6694('0x23'),_0x125f1f);logger[_0x6694('0x14')]('ShowWhatsappAccount',_0x125f1f,JSON['stringify'](_0x305ab6));_0x2ceeab(_0x305ab6);})['catch'](function(_0x5e521b){logger['error'](_0x6694('0x23'),_0x5e521b[_0x6694('0x1a')],_0x125f1f);_0xab1d7e(_0x577eb7[_0x6694('0x18')](0x1f4,_0x5e521b[_0x6694('0x1a')]));});});}; \ No newline at end of file +var _0x605f=['stringify','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','map','model'];(function(_0x67492e,_0x5add06){var _0x5eeb7b=function(_0x2a11c8){while(--_0x2a11c8){_0x67492e['push'](_0x67492e['shift']());}};_0x5eeb7b(++_0x5add06);}(_0x605f,0x1a6));var _0xf605=function(_0x2f0ca9,_0xdd847){_0x2f0ca9=_0x2f0ca9-0x0;var _0x3c8ce8=_0x605f[_0x2f0ca9];return _0x3c8ce8;};'use strict';var _=require('lodash');var util=require(_0xf605('0x0'));var moment=require(_0xf605('0x1'));var BPromise=require('bluebird');var rs=require(_0xf605('0x2'));var fs=require('fs');var Redis=require(_0xf605('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf605('0x4'));var logger=require(_0xf605('0x5'))('rpc');var config=require(_0xf605('0x6'));var jayson=require(_0xf605('0x7'));var client=jayson[_0xf605('0x8')]['http']({'port':0x232a});config[_0xf605('0x9')]=_[_0xf605('0xa')](config[_0xf605('0x9')],{'host':_0xf605('0xb'),'port':0x18eb});var socket=require(_0xf605('0xc'))(new Redis(config['redis']));require(_0xf605('0xd'))[_0xf605('0xe')](socket);function respondWithRpcPromise(_0xf248a3,_0x984ad1,_0x1352ee){return new BPromise(function(_0x32edb7,_0x1fe934){return client[_0xf605('0xf')](_0xf248a3,_0x1352ee)['then'](function(_0x3d7c47){logger[_0xf605('0x10')](_0xf605('0x11'),_0x984ad1,_0xf605('0x12'));logger[_0xf605('0x13')](_0xf605('0x14'),_0x984ad1,'request\x20sent',JSON['stringify'](_0x3d7c47));if(_0x3d7c47[_0xf605('0x15')]){if(_0x3d7c47[_0xf605('0x15')][_0xf605('0x16')]===0x1f4){logger['error'](_0xf605('0x11'),_0x984ad1,_0x3d7c47['error'][_0xf605('0x17')]);return _0x1fe934(_0x3d7c47[_0xf605('0x15')][_0xf605('0x17')]);}logger[_0xf605('0x15')](_0xf605('0x11'),_0x984ad1,_0x3d7c47[_0xf605('0x15')][_0xf605('0x17')]);return _0x32edb7(_0x3d7c47[_0xf605('0x15')][_0xf605('0x17')]);}else{logger[_0xf605('0x10')](_0xf605('0x11'),_0x984ad1,_0xf605('0x12'));_0x32edb7(_0x3d7c47['result']['message']);}})['catch'](function(_0x3330c){logger[_0xf605('0x15')](_0xf605('0x11'),_0x984ad1,_0x3330c);_0x1fe934(_0x3330c);});});}exports[_0xf605('0x18')]=function(_0x1e7acd){var _0x437489=this;return new Promise(function(_0x1655a0,_0x477967){return db[_0xf605('0x19')][_0xf605('0x1a')]({'raw':_0x1e7acd[_0xf605('0x1b')]?_0x1e7acd['options'][_0xf605('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e7acd['options']?_0x1e7acd[_0xf605('0x1b')]['where']||null:null,'attributes':_0x1e7acd[_0xf605('0x1b')]?_0x1e7acd['options'][_0xf605('0x1d')]||null:null,'include':_0x1e7acd[_0xf605('0x1b')]?_0x1e7acd[_0xf605('0x1b')][_0xf605('0x1e')]?_[_0xf605('0x1f')](_0x1e7acd[_0xf605('0x1b')]['include'],function(_0x751746){return{'model':db[_0x751746[_0xf605('0x20')]],'as':_0x751746['as'],'attributes':_0x751746['attributes'],'include':_0x751746['include']?_[_0xf605('0x1f')](_0x751746[_0xf605('0x1e')],function(_0x42bd98){return{'model':db[_0x42bd98[_0xf605('0x20')]],'as':_0x42bd98['as'],'attributes':_0x42bd98[_0xf605('0x1d')],'include':_0x42bd98[_0xf605('0x1e')]?_[_0xf605('0x1f')](_0x42bd98['include'],function(_0x3d8fd0){return{'model':db[_0x3d8fd0[_0xf605('0x20')]],'as':_0x3d8fd0['as'],'attributes':_0x3d8fd0[_0xf605('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f43fa){logger['info'](_0xf605('0x18'),_0x1e7acd);logger[_0xf605('0x13')](_0xf605('0x18'),_0x1e7acd,JSON[_0xf605('0x21')](_0x5f43fa));_0x1655a0(_0x5f43fa);})[_0xf605('0x22')](function(_0x73aeb4){logger[_0xf605('0x15')](_0xf605('0x18'),_0x73aeb4[_0xf605('0x17')],_0x1e7acd);_0x477967(_0x437489['error'](0x1f4,_0x73aeb4[_0xf605('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 7ef42b4..d524187 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 _0x8461=['save','remove','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x8461,0x109));var _0x1846=function(_0x3bb557,_0x2d4e15){_0x3bb557=_0x3bb557-0x0;var _0x5eebcb=_0x8461[_0x3bb557];return _0x5eebcb;};'use strict';var WhatsappAccountEvents=require(_0x1846('0x0'));var events=[_0x1846('0x1'),_0x1846('0x2'),'update'];function createListener(_0x47e8fc,_0x5e47ed){return function(_0x1ddc73){_0x5e47ed[_0x1846('0x3')](_0x47e8fc,_0x1ddc73);};}function removeListener(_0xdd71f6,_0x5afff2){return function(){WhatsappAccountEvents[_0x1846('0x4')](_0xdd71f6,_0x5afff2);};}exports['register']=function(_0x243c67){for(var _0x519112=0x0,_0x48eec0=events[_0x1846('0x5')];_0x519112<_0x48eec0;_0x519112++){var _0x149676=events[_0x519112];var _0x474651=createListener(_0x1846('0x6')+_0x149676,_0x243c67);WhatsappAccountEvents['on'](_0x149676,_0x474651);}}; \ No newline at end of file +var _0x236b=['register','length','whatsappAccount:','save','remove','update','emit','removeListener'];(function(_0x2e7f71,_0xb8d20c){var _0x145b93=function(_0x2a1460){while(--_0x2a1460){_0x2e7f71['push'](_0x2e7f71['shift']());}};_0x145b93(++_0xb8d20c);}(_0x236b,0x1bb));var _0xb236=function(_0x520d6c,_0x30492c){_0x520d6c=_0x520d6c-0x0;var _0x1ab76d=_0x236b[_0x520d6c];return _0x1ab76d;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xb236('0x0'),_0xb236('0x1'),_0xb236('0x2')];function createListener(_0x57113f,_0x2f05e2){return function(_0x380c9e){_0x2f05e2[_0xb236('0x3')](_0x57113f,_0x380c9e);};}function removeListener(_0x3d2532,_0xae2c01){return function(){WhatsappAccountEvents[_0xb236('0x4')](_0x3d2532,_0xae2c01);};}exports[_0xb236('0x5')]=function(_0x3406ce){for(var _0x43b8c2=0x0,_0x3b53d7=events[_0xb236('0x6')];_0x43b8c2<_0x3b53d7;_0x43b8c2++){var _0x25b0ff=events[_0x43b8c2];var _0x1fc3ec=createListener(_0xb236('0x7')+_0x25b0ff,_0x3406ce);WhatsappAccountEvents['on'](_0x25b0ff,_0x1fc3ec);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index f73548d..826e824 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 _0xc8d8=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x17862f,_0x2531cb){var _0x2f7c2a=function(_0x17edfc){while(--_0x17edfc){_0x17862f['push'](_0x17862f['shift']());}};_0x2f7c2a(++_0x2531cb);}(_0xc8d8,0x128));var _0x8c8d=function(_0x51b241,_0x187fab){_0x51b241=_0x51b241-0x0;var _0x16a3a7=_0xc8d8[_0x51b241];return _0x16a3a7;};'use strict';var multer=require(_0x8c8d('0x0'));var util=require('util');var path=require(_0x8c8d('0x1'));var timeout=require(_0x8c8d('0x2'));var express=require(_0x8c8d('0x3'));var router=express[_0x8c8d('0x4')]();var fs_extra=require(_0x8c8d('0x5'));var auth=require(_0x8c8d('0x6'));var interaction=require(_0x8c8d('0x7'));var config=require(_0x8c8d('0x8'));var controller=require(_0x8c8d('0x9'));router[_0x8c8d('0xa')]('/',auth[_0x8c8d('0xb')](),controller[_0x8c8d('0xc')]);router[_0x8c8d('0xa')](_0x8c8d('0xd'),auth[_0x8c8d('0xb')](),controller[_0x8c8d('0xe')]);router[_0x8c8d('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c8d('0x10')]);router[_0x8c8d('0x11')](_0x8c8d('0xd'),auth[_0x8c8d('0xb')](),controller[_0x8c8d('0x12')]);router[_0x8c8d('0x13')]('/:id',auth[_0x8c8d('0xb')](),controller[_0x8c8d('0x14')]);module['exports']=router; \ No newline at end of file +var _0xe216=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x1db8ad,_0x1f4757){var _0x42fae9=function(_0x551f43){while(--_0x551f43){_0x1db8ad['push'](_0x1db8ad['shift']());}};_0x42fae9(++_0x1f4757);}(_0xe216,0x16c));var _0x6e21=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xe216[_0x56e4e7];return _0x383618;};'use strict';var multer=require(_0x6e21('0x0'));var util=require(_0x6e21('0x1'));var path=require(_0x6e21('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e21('0x3'));var router=express[_0x6e21('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6e21('0x5'));var interaction=require(_0x6e21('0x6'));var config=require('../../config/environment');var controller=require(_0x6e21('0x7'));router['get']('/',auth[_0x6e21('0x8')](),controller[_0x6e21('0x9')]);router[_0x6e21('0xa')](_0x6e21('0xb'),auth[_0x6e21('0x8')](),controller[_0x6e21('0xc')]);router[_0x6e21('0xd')]('/',auth['isAuthenticated'](),controller[_0x6e21('0xe')]);router[_0x6e21('0xf')](_0x6e21('0xb'),auth[_0x6e21('0x8')](),controller[_0x6e21('0x10')]);router[_0x6e21('0x11')](_0x6e21('0xb'),auth[_0x6e21('0x8')](),controller[_0x6e21('0x12')]);module[_0x6e21('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d2a7c85..de1da55 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 _0x9306=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x3a3c3d,_0x3b8542){var _0xf3142f=function(_0x479bb0){while(--_0x479bb0){_0x3a3c3d['push'](_0x3a3c3d['shift']());}};_0xf3142f(++_0x3b8542);}(_0x9306,0xf1));var _0x6930=function(_0x4c6f50,_0x51e971){_0x4c6f50=_0x4c6f50-0x0;var _0xb2d3ba=_0x9306[_0x4c6f50];return _0xb2d3ba;};'use strict';var Sequelize=require(_0x6930('0x0'));module[_0x6930('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6930('0x2')],'allowNull':![],'defaultValue':_0x6930('0x3')},'appdata':{'type':Sequelize[_0x6930('0x4')]()},'description':{'type':Sequelize[_0x6930('0x2')]},'interval':{'type':Sequelize[_0x6930('0x2')],'defaultValue':_0x6930('0x5')}}; \ No newline at end of file +var _0x8b68=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x2baa0c,_0xc5016d){var _0xf9f6c8=function(_0x163be6){while(--_0x163be6){_0x2baa0c['push'](_0x2baa0c['shift']());}};_0xf9f6c8(++_0xc5016d);}(_0x8b68,0x164));var _0x88b6=function(_0x5a4bb1,_0x4d0bae){_0x5a4bb1=_0x5a4bb1-0x0;var _0x5c480b=_0x8b68[_0x5a4bb1];return _0x5c480b;};'use strict';var Sequelize=require(_0x88b6('0x0'));module['exports']={'priority':{'type':Sequelize[_0x88b6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x88b6('0x2')],'allowNull':![],'defaultValue':_0x88b6('0x3')},'appdata':{'type':Sequelize[_0x88b6('0x4')]()},'description':{'type':Sequelize[_0x88b6('0x2')]},'interval':{'type':Sequelize[_0x88b6('0x2')],'defaultValue':_0x88b6('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 67fd31a..a46740b 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 _0xcd2f=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','fieldName','type','key','query','keys','filters','intersection','attributes','model'];(function(_0x1cb381,_0x325815){var _0x4760b1=function(_0x2966e1){while(--_0x2966e1){_0x1cb381['push'](_0x1cb381['shift']());}};_0x4760b1(++_0x325815);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xcd2f[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcd2('0x0'));var rp=require(_0xfcd2('0x1'));var moment=require(_0xfcd2('0x2'));var BPromise=require(_0xfcd2('0x3'));var Mustache=require(_0xfcd2('0x4'));var util=require(_0xfcd2('0x5'));var path=require(_0xfcd2('0x6'));var sox=require(_0xfcd2('0x7'));var csv=require('to-csv');var ejs=require(_0xfcd2('0x8'));var fs=require('fs');var fs_extra=require(_0xfcd2('0x9'));var _=require(_0xfcd2('0xa'));var squel=require(_0xfcd2('0xb'));var crypto=require(_0xfcd2('0xc'));var jsforce=require(_0xfcd2('0xd'));var deskjs=require(_0xfcd2('0xe'));var toCsv=require(_0xfcd2('0xf'));var querystring=require(_0xfcd2('0x10'));var Papa=require(_0xfcd2('0x11'));var Redis=require(_0xfcd2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfcd2('0x13'));var as=require(_0xfcd2('0x14'));var hardwareService=require(_0xfcd2('0x15'));var logger=require(_0xfcd2('0x16'))(_0xfcd2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bff49,_0xdcfde9){_0xdcfde9=_0xdcfde9||0xcc;return function(_0x15aebb){if(_0x15aebb){return _0x5bff49['sendStatus'](_0xdcfde9);}return _0x5bff49[_0xfcd2('0x18')](_0xdcfde9)[_0xfcd2('0x19')]();};}function respondWithResult(_0x5ad180,_0x50f44c){_0x50f44c=_0x50f44c||0xc8;return function(_0x2825df){if(_0x2825df){return _0x5ad180[_0xfcd2('0x18')](_0x50f44c)[_0xfcd2('0x1a')](_0x2825df);}};}function respondWithFilteredResult(_0x4baf2f,_0x428cf3){return function(_0x4a2bcd){if(_0x4a2bcd){var _0x1a9f8f=typeof _0x428cf3[_0xfcd2('0x1b')]===_0xfcd2('0x1c')&&typeof _0x428cf3[_0xfcd2('0x1d')]===_0xfcd2('0x1c');var _0x378484=_0x4a2bcd['count'];var _0xba3186=_0x1a9f8f?0x0:_0x428cf3[_0xfcd2('0x1b')];var _0x32607c=_0x1a9f8f?_0x4a2bcd[_0xfcd2('0x1e')]:_0x428cf3[_0xfcd2('0x1b')]+_0x428cf3[_0xfcd2('0x1d')];var _0x5c8a4d;if(_0x32607c>=_0x378484){_0x32607c=_0x378484;_0x5c8a4d=0xc8;}else{_0x5c8a4d=0xce;}_0x4baf2f[_0xfcd2('0x18')](_0x5c8a4d);return _0x4baf2f[_0xfcd2('0x1f')](_0xfcd2('0x20'),_0xba3186+'-'+_0x32607c+'/'+_0x378484)[_0xfcd2('0x1a')](_0x4a2bcd);}return null;};}function patchUpdates(_0x266c86){return function(_0x55d8b0){try{jsonpatch[_0xfcd2('0x21')](_0x55d8b0,_0x266c86,!![]);}catch(_0x41c503){return BPromise[_0xfcd2('0x22')](_0x41c503);}return _0x55d8b0[_0xfcd2('0x23')]();};}function saveUpdates(_0x2a06d4,_0x37dafa){return function(_0x19ea4a){if(_0x19ea4a){return _0x19ea4a[_0xfcd2('0x24')](_0x2a06d4)[_0xfcd2('0x25')](function(_0x47fa14){return _0x47fa14;});}return null;};}function removeEntity(_0x23104f,_0x50c0cc){return function(_0xedae7a){if(_0xedae7a){return _0xedae7a[_0xfcd2('0x26')]()['then'](function(){_0x23104f['status'](0xcc)[_0xfcd2('0x19')]();});}};}function handleEntityNotFound(_0xe7fde9,_0x193dc3){return function(_0x2b0364){if(!_0x2b0364){_0xe7fde9['sendStatus'](0x194);}return _0x2b0364;};}function handleError(_0x1c4981,_0x2a8557){_0x2a8557=_0x2a8557||0x1f4;return function(_0x13e447){logger[_0xfcd2('0x27')](_0x13e447['stack']);if(_0x13e447[_0xfcd2('0x28')]){delete _0x13e447['name'];}_0x1c4981[_0xfcd2('0x18')](_0x2a8557)[_0xfcd2('0x29')](_0x13e447);};}exports['index']=function(_0x909257,_0x3cb642){var _0x41ecc9={},_0x4bffa9={},_0x15965e={'count':0x0,'rows':[]};var _0x4e79b=_[_0xfcd2('0x2a')](db['WhatsappApplication']['rawAttributes'],function(_0x5192b9){return{'name':_0x5192b9[_0xfcd2('0x2b')],'type':_0x5192b9[_0xfcd2('0x2c')][_0xfcd2('0x2d')]};});_0x4bffa9['model']=_[_0xfcd2('0x2a')](_0x4e79b,_0xfcd2('0x28'));_0x4bffa9[_0xfcd2('0x2e')]=_[_0xfcd2('0x2f')](_0x909257[_0xfcd2('0x2e')]);_0x4bffa9[_0xfcd2('0x30')]=_[_0xfcd2('0x31')](_0x4bffa9['model'],_0x4bffa9['query']);_0x41ecc9[_0xfcd2('0x32')]=_['intersection'](_0x4bffa9[_0xfcd2('0x33')],qs[_0xfcd2('0x34')](_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x34')]));_0x41ecc9[_0xfcd2('0x32')]=_0x41ecc9[_0xfcd2('0x32')][_0xfcd2('0x35')]?_0x41ecc9[_0xfcd2('0x32')]:_0x4bffa9[_0xfcd2('0x33')];if(!_0x909257['query'][_0xfcd2('0x36')](_0xfcd2('0x37'))){_0x41ecc9[_0xfcd2('0x1d')]=qs[_0xfcd2('0x1d')](_0x909257['query']['limit']);_0x41ecc9[_0xfcd2('0x1b')]=qs[_0xfcd2('0x1b')](_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x1b')]);}_0x41ecc9['order']=qs[_0xfcd2('0x38')](_0x909257[_0xfcd2('0x2e')]['sort']);_0x41ecc9[_0xfcd2('0x39')]=qs['filters'](_[_0xfcd2('0x3a')](_0x909257['query'],_0x4bffa9[_0xfcd2('0x30')]),_0x4e79b);if(_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x3b')]){_0x41ecc9['where']=_[_0xfcd2('0x3c')](_0x41ecc9[_0xfcd2('0x39')],{'$or':_[_0xfcd2('0x2a')](_0x4e79b,function(_0x89e532){if(_0x89e532[_0xfcd2('0x2c')]!==_0xfcd2('0x3d')){var _0x10249c={};_0x10249c[_0x89e532[_0xfcd2('0x28')]]={'$like':'%'+_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x3b')]+'%'};return _0x10249c;}})});}_0x41ecc9=_[_0xfcd2('0x3c')]({},_0x41ecc9,_0x909257[_0xfcd2('0x3e')]);var _0x31368e={'where':_0x41ecc9[_0xfcd2('0x39')]};return db[_0xfcd2('0x3f')][_0xfcd2('0x1e')](_0x31368e)[_0xfcd2('0x25')](function(_0x47d6b6){_0x15965e[_0xfcd2('0x1e')]=_0x47d6b6;if(_0x909257['query'][_0xfcd2('0x40')]){_0x41ecc9[_0xfcd2('0x41')]=[{'all':!![]}];}return db[_0xfcd2('0x3f')][_0xfcd2('0x42')](_0x41ecc9);})['then'](function(_0x20f985){_0x15965e[_0xfcd2('0x43')]=_0x20f985;return _0x15965e;})[_0xfcd2('0x25')](respondWithFilteredResult(_0x3cb642,_0x41ecc9))[_0xfcd2('0x44')](handleError(_0x3cb642,null));};exports[_0xfcd2('0x45')]=function(_0x100198,_0x20c15b){var _0x34ffd6={'raw':!![],'where':{'id':_0x100198[_0xfcd2('0x46')]['id']}},_0x4ba64d={};_0x4ba64d[_0xfcd2('0x33')]=_[_0xfcd2('0x2f')](db[_0xfcd2('0x3f')][_0xfcd2('0x47')]);_0x4ba64d['query']=_[_0xfcd2('0x2f')](_0x100198[_0xfcd2('0x2e')]);_0x4ba64d[_0xfcd2('0x30')]=_[_0xfcd2('0x31')](_0x4ba64d['model'],_0x4ba64d[_0xfcd2('0x2e')]);_0x34ffd6[_0xfcd2('0x32')]=_[_0xfcd2('0x31')](_0x4ba64d[_0xfcd2('0x33')],qs[_0xfcd2('0x34')](_0x100198[_0xfcd2('0x2e')][_0xfcd2('0x34')]));_0x34ffd6[_0xfcd2('0x32')]=_0x34ffd6[_0xfcd2('0x32')]['length']?_0x34ffd6['attributes']:_0x4ba64d['model'];if(_0x100198[_0xfcd2('0x2e')][_0xfcd2('0x40')]){_0x34ffd6[_0xfcd2('0x41')]=[{'all':!![]}];}_0x34ffd6=_[_0xfcd2('0x3c')]({},_0x34ffd6,_0x100198['options']);return db[_0xfcd2('0x3f')][_0xfcd2('0x48')](_0x34ffd6)[_0xfcd2('0x25')](handleEntityNotFound(_0x20c15b,null))[_0xfcd2('0x25')](respondWithResult(_0x20c15b,null))['catch'](handleError(_0x20c15b,null));};exports[_0xfcd2('0x49')]=function(_0x26dbe2,_0x36233a){return db['WhatsappApplication'][_0xfcd2('0x49')](_0x26dbe2[_0xfcd2('0x4a')],{})['then'](respondWithResult(_0x36233a,0xc9))[_0xfcd2('0x44')](handleError(_0x36233a,null));};exports['update']=function(_0x559dea,_0x7352bb){if(_0x559dea[_0xfcd2('0x4a')]['id']){delete _0x559dea[_0xfcd2('0x4a')]['id'];}return db[_0xfcd2('0x3f')]['find']({'where':{'id':_0x559dea[_0xfcd2('0x46')]['id']}})[_0xfcd2('0x25')](handleEntityNotFound(_0x7352bb,null))[_0xfcd2('0x25')](saveUpdates(_0x559dea['body'],null))[_0xfcd2('0x25')](respondWithResult(_0x7352bb,null))[_0xfcd2('0x44')](handleError(_0x7352bb,null));};exports[_0xfcd2('0x26')]=function(_0x50f31c,_0x159aec){return db[_0xfcd2('0x3f')][_0xfcd2('0x48')]({'where':{'id':_0x50f31c[_0xfcd2('0x46')]['id']}})[_0xfcd2('0x25')](handleEntityNotFound(_0x159aec,null))[_0xfcd2('0x25')](removeEntity(_0x159aec,null))[_0xfcd2('0x44')](handleError(_0x159aec,null));}; \ No newline at end of file +var _0xc359=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappApplication','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','includeAll','include','rows','catch','show','params','keys','length','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','crypto','jsforce','desk.js'];(function(_0x4f2ab5,_0xafef26){var _0xce9bc2=function(_0x443a22){while(--_0x443a22){_0x4f2ab5['push'](_0x4f2ab5['shift']());}};_0xce9bc2(++_0xafef26);}(_0xc359,0x1d9));var _0x9c35=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0xc359[_0x4cd21c];return _0x5d8e5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c35('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c35('0x1'));var rp=require(_0x9c35('0x2'));var moment=require(_0x9c35('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c35('0x4'));var util=require('util');var path=require(_0x9c35('0x5'));var sox=require('sox');var csv=require(_0x9c35('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c35('0x7'));var jsforce=require(_0x9c35('0x8'));var deskjs=require(_0x9c35('0x9'));var toCsv=require(_0x9c35('0x6'));var querystring=require(_0x9c35('0xa'));var Papa=require(_0x9c35('0xb'));var Redis=require('ioredis');var authService=require(_0x9c35('0xc'));var qs=require(_0x9c35('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9c35('0xe'));var utils=require('../../config/utils');var config=require(_0x9c35('0xf'));var licenseUtil=require(_0x9c35('0x10'));var db=require(_0x9c35('0x11'))['db'];function respondWithStatusCode(_0x575589,_0x24210f){_0x24210f=_0x24210f||0xcc;return function(_0x7dd8f){if(_0x7dd8f){return _0x575589[_0x9c35('0x12')](_0x24210f);}return _0x575589[_0x9c35('0x13')](_0x24210f)[_0x9c35('0x14')]();};}function respondWithResult(_0x4cc2ca,_0x280758){_0x280758=_0x280758||0xc8;return function(_0x4470df){if(_0x4470df){return _0x4cc2ca[_0x9c35('0x13')](_0x280758)[_0x9c35('0x15')](_0x4470df);}};}function respondWithFilteredResult(_0x2af21e,_0x308392){return function(_0x9e7d2d){if(_0x9e7d2d){var _0x77588e=typeof _0x308392[_0x9c35('0x16')]===_0x9c35('0x17')&&typeof _0x308392[_0x9c35('0x18')]===_0x9c35('0x17');var _0x1ef1d8=_0x9e7d2d[_0x9c35('0x19')];var _0x26db4b=_0x77588e?0x0:_0x308392['offset'];var _0x1d0227=_0x77588e?_0x9e7d2d[_0x9c35('0x19')]:_0x308392[_0x9c35('0x16')]+_0x308392[_0x9c35('0x18')];var _0x4d606f;if(_0x1d0227>=_0x1ef1d8){_0x1d0227=_0x1ef1d8;_0x4d606f=0xc8;}else{_0x4d606f=0xce;}_0x2af21e[_0x9c35('0x13')](_0x4d606f);return _0x2af21e[_0x9c35('0x1a')](_0x9c35('0x1b'),_0x26db4b+'-'+_0x1d0227+'/'+_0x1ef1d8)[_0x9c35('0x15')](_0x9e7d2d);}return null;};}function patchUpdates(_0x69d118){return function(_0x4a84dd){try{jsonpatch[_0x9c35('0x1c')](_0x4a84dd,_0x69d118,!![]);}catch(_0x57ef15){return BPromise[_0x9c35('0x1d')](_0x57ef15);}return _0x4a84dd[_0x9c35('0x1e')]();};}function saveUpdates(_0x29f569,_0x8ffae5){return function(_0x3d2193){if(_0x3d2193){return _0x3d2193[_0x9c35('0x1f')](_0x29f569)[_0x9c35('0x20')](function(_0x52aa95){return _0x52aa95;});}return null;};}function removeEntity(_0x572b46,_0x1bc7e4){return function(_0x2997d3){if(_0x2997d3){return _0x2997d3[_0x9c35('0x21')]()[_0x9c35('0x20')](function(){_0x572b46['status'](0xcc)[_0x9c35('0x14')]();});}};}function handleEntityNotFound(_0x578e00,_0x223d9e){return function(_0x4bf0ea){if(!_0x4bf0ea){_0x578e00['sendStatus'](0x194);}return _0x4bf0ea;};}function handleError(_0x39cd10,_0xaf9e58){_0xaf9e58=_0xaf9e58||0x1f4;return function(_0x2cba78){logger['error'](_0x2cba78[_0x9c35('0x22')]);if(_0x2cba78['name']){delete _0x2cba78[_0x9c35('0x23')];}_0x39cd10[_0x9c35('0x13')](_0xaf9e58)[_0x9c35('0x24')](_0x2cba78);};}exports[_0x9c35('0x25')]=function(_0x4525c9,_0x4f272a){var _0x4593e3={},_0x16e8dd={},_0x568925={'count':0x0,'rows':[]};var _0x476f94=_[_0x9c35('0x26')](db[_0x9c35('0x27')][_0x9c35('0x28')],function(_0x345fbc){return{'name':_0x345fbc['fieldName'],'type':_0x345fbc[_0x9c35('0x29')][_0x9c35('0x2a')]};});_0x16e8dd[_0x9c35('0x2b')]=_[_0x9c35('0x26')](_0x476f94,_0x9c35('0x23'));_0x16e8dd[_0x9c35('0x2c')]=_['keys'](_0x4525c9[_0x9c35('0x2c')]);_0x16e8dd['filters']=_[_0x9c35('0x2d')](_0x16e8dd[_0x9c35('0x2b')],_0x16e8dd[_0x9c35('0x2c')]);_0x4593e3[_0x9c35('0x2e')]=_[_0x9c35('0x2d')](_0x16e8dd['model'],qs[_0x9c35('0x2f')](_0x4525c9[_0x9c35('0x2c')]['fields']));_0x4593e3['attributes']=_0x4593e3[_0x9c35('0x2e')]['length']?_0x4593e3['attributes']:_0x16e8dd['model'];if(!_0x4525c9[_0x9c35('0x2c')][_0x9c35('0x30')](_0x9c35('0x31'))){_0x4593e3[_0x9c35('0x18')]=qs[_0x9c35('0x18')](_0x4525c9[_0x9c35('0x2c')]['limit']);_0x4593e3[_0x9c35('0x16')]=qs[_0x9c35('0x16')](_0x4525c9[_0x9c35('0x2c')][_0x9c35('0x16')]);}_0x4593e3['order']=qs[_0x9c35('0x32')](_0x4525c9[_0x9c35('0x2c')][_0x9c35('0x32')]);_0x4593e3[_0x9c35('0x33')]=qs[_0x9c35('0x34')](_[_0x9c35('0x35')](_0x4525c9[_0x9c35('0x2c')],_0x16e8dd['filters']),_0x476f94);if(_0x4525c9['query']['filter']){_0x4593e3[_0x9c35('0x33')]=_['merge'](_0x4593e3[_0x9c35('0x33')],{'$or':_['map'](_0x476f94,function(_0x49aadb){if(_0x49aadb[_0x9c35('0x29')]!==_0x9c35('0x36')){var _0x20f06e={};_0x20f06e[_0x49aadb[_0x9c35('0x23')]]={'$like':'%'+_0x4525c9[_0x9c35('0x2c')][_0x9c35('0x37')]+'%'};return _0x20f06e;}})});}_0x4593e3=_[_0x9c35('0x38')]({},_0x4593e3,_0x4525c9['options']);var _0x289222={'where':_0x4593e3['where']};return db[_0x9c35('0x27')]['count'](_0x289222)['then'](function(_0x4fc454){_0x568925['count']=_0x4fc454;if(_0x4525c9[_0x9c35('0x2c')][_0x9c35('0x39')]){_0x4593e3[_0x9c35('0x3a')]=[{'all':!![]}];}return db[_0x9c35('0x27')]['findAll'](_0x4593e3);})[_0x9c35('0x20')](function(_0xff952f){_0x568925[_0x9c35('0x3b')]=_0xff952f;return _0x568925;})['then'](respondWithFilteredResult(_0x4f272a,_0x4593e3))[_0x9c35('0x3c')](handleError(_0x4f272a,null));};exports[_0x9c35('0x3d')]=function(_0xc0d025,_0x3ac8e9){var _0x4269b0={'raw':!![],'where':{'id':_0xc0d025[_0x9c35('0x3e')]['id']}},_0x45d102={};_0x45d102[_0x9c35('0x2b')]=_[_0x9c35('0x3f')](db[_0x9c35('0x27')][_0x9c35('0x28')]);_0x45d102['query']=_[_0x9c35('0x3f')](_0xc0d025[_0x9c35('0x2c')]);_0x45d102[_0x9c35('0x34')]=_[_0x9c35('0x2d')](_0x45d102[_0x9c35('0x2b')],_0x45d102[_0x9c35('0x2c')]);_0x4269b0[_0x9c35('0x2e')]=_[_0x9c35('0x2d')](_0x45d102[_0x9c35('0x2b')],qs[_0x9c35('0x2f')](_0xc0d025[_0x9c35('0x2c')][_0x9c35('0x2f')]));_0x4269b0[_0x9c35('0x2e')]=_0x4269b0[_0x9c35('0x2e')][_0x9c35('0x40')]?_0x4269b0[_0x9c35('0x2e')]:_0x45d102[_0x9c35('0x2b')];if(_0xc0d025[_0x9c35('0x2c')][_0x9c35('0x39')]){_0x4269b0[_0x9c35('0x3a')]=[{'all':!![]}];}_0x4269b0=_[_0x9c35('0x38')]({},_0x4269b0,_0xc0d025[_0x9c35('0x41')]);return db['WhatsappApplication'][_0x9c35('0x42')](_0x4269b0)['then'](handleEntityNotFound(_0x3ac8e9,null))[_0x9c35('0x20')](respondWithResult(_0x3ac8e9,null))[_0x9c35('0x3c')](handleError(_0x3ac8e9,null));};exports[_0x9c35('0x43')]=function(_0x587af6,_0x307beb){return db[_0x9c35('0x27')][_0x9c35('0x43')](_0x587af6['body'],{})[_0x9c35('0x20')](respondWithResult(_0x307beb,0xc9))[_0x9c35('0x3c')](handleError(_0x307beb,null));};exports['update']=function(_0x1972dc,_0x4d6833){if(_0x1972dc[_0x9c35('0x44')]['id']){delete _0x1972dc[_0x9c35('0x44')]['id'];}return db[_0x9c35('0x27')][_0x9c35('0x42')]({'where':{'id':_0x1972dc[_0x9c35('0x3e')]['id']}})[_0x9c35('0x20')](handleEntityNotFound(_0x4d6833,null))[_0x9c35('0x20')](saveUpdates(_0x1972dc[_0x9c35('0x44')],null))[_0x9c35('0x20')](respondWithResult(_0x4d6833,null))['catch'](handleError(_0x4d6833,null));};exports[_0x9c35('0x21')]=function(_0x257d9c,_0x22d1c8){return db['WhatsappApplication']['find']({'where':{'id':_0x257d9c[_0x9c35('0x3e')]['id']}})[_0x9c35('0x20')](handleEntityNotFound(_0x22d1c8,null))['then'](removeEntity(_0x22d1c8,null))[_0x9c35('0x3c')](handleError(_0x22d1c8,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c299495..214a57b 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 _0xf25a=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2c84e5,_0x58a7c7){var _0x4990ec=function(_0x5b02b0){while(--_0x5b02b0){_0x2c84e5['push'](_0x2c84e5['shift']());}};_0x4990ec(++_0x58a7c7);}(_0xf25a,0x195));var _0xaf25=function(_0x48cbb3,_0x21b51d){_0x48cbb3=_0x48cbb3-0x0;var _0x125cec=_0xf25a[_0x48cbb3];return _0x125cec;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var logger=require(_0xaf25('0x2'))('api');var moment=require(_0xaf25('0x3'));var BPromise=require(_0xaf25('0x4'));var rp=require(_0xaf25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf25('0x6'));var config=require(_0xaf25('0x7'));var attributes=require(_0xaf25('0x8'));module['exports']=function(_0x49281b,_0x30eaae){return _0x49281b['define']('WhatsappApplication',attributes,{'tableName':_0xaf25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf25('0xa'),'collate':_0xaf25('0xb')});}; \ No newline at end of file +var _0x8ef6=['whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication'];(function(_0x368f40,_0x3a8cb9){var _0x529e=function(_0x551928){while(--_0x551928){_0x368f40['push'](_0x368f40['shift']());}};_0x529e(++_0x3a8cb9);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3b28eb,_0x190ae7){_0x3b28eb=_0x3b28eb-0x0;var _0x3eb454=_0x8ef6[_0x3b28eb];return _0x3eb454;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x68ef('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index c73cee2..8cbfdf5 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 _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x4e4c51,_0x1679c9){var _0x25d105=function(_0x5f233f){while(--_0x5f233f){_0x4e4c51['push'](_0x4e4c51['shift']());}};_0x25d105(++_0x1679c9);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3a0956,_0x46169e){_0x3a0956=_0x3a0956-0x0;var _0x4b5e18=_0x8d0e[_0x3a0956];return _0x4b5e18;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file +var _0x55e0=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x55e0,0xdc));var _0x055e=function(_0x5278da,_0x1afc2f){_0x5278da=_0x5278da-0x0;var _0x16fdf8=_0x55e0[_0x5278da];return _0x16fdf8;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 11ebb1a..772cdb3 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 _0x3831=['whatsappinteraction:destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete'];(function(_0x5ca7e5,_0x5b5eec){var _0x1a509f=function(_0x437d47){while(--_0x437d47){_0x5ca7e5['push'](_0x5ca7e5['shift']());}};_0x1a509f(++_0x5b5eec);}(_0x3831,0x14c));var _0x1383=function(_0x2bff9c,_0xe5758){_0x2bff9c=_0x2bff9c-0x0;var _0x24ca0b=_0x3831[_0x2bff9c];return _0x24ca0b;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0x8')](_0x1383('0xd'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0x8')](_0x1383('0xf'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);router['post']('/',auth[_0x1383('0x9')](),controller[_0x1383('0x11')]);router[_0x1383('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1383('0x13')]);router[_0x1383('0x12')](_0x1383('0x14'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x17')),controller[_0x1383('0x18')]);router['put'](_0x1383('0xb'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x19')),controller[_0x1383('0x1a')]);router[_0x1383('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x1383('0x15')]('whatsapp',_0x1383('0x1c')),controller['destroy']);router['delete']('/:id/tags',auth[_0x1383('0x9')](),controller['removeTags']);module[_0x1383('0x1d')]=router; \ No newline at end of file +var _0xe3da=['post','create','addMessage','/:id/tags','tracked','whatsapp','addTags','put','/:id','update','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages'];(function(_0x3ba529,_0x4b3319){var _0x3ee072=function(_0x3587c1){while(--_0x3587c1){_0x3ba529['push'](_0x3ba529['shift']());}};_0x3ee072(++_0x4b3319);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0xb')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0xb')]('/:id/download',auth[_0xae3d('0xc')](),controller['download']);router[_0xae3d('0x13')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x14')]);router[_0xae3d('0x13')]('/:id/messages',auth[_0xae3d('0xc')](),controller[_0xae3d('0x15')]);router[_0xae3d('0x13')](_0xae3d('0x16'),auth[_0xae3d('0xc')](),interaction[_0xae3d('0x17')](_0xae3d('0x18'),'whatsappinteraction:addtags'),controller[_0xae3d('0x19')]);router[_0xae3d('0x1a')](_0xae3d('0x1b'),auth[_0xae3d('0xc')](),interaction[_0xae3d('0x17')](_0xae3d('0x18'),'whatsappinteraction:update'),controller[_0xae3d('0x1c')]);router[_0xae3d('0x1d')](_0xae3d('0x1b'),auth['isAuthenticated'](),interaction[_0xae3d('0x17')](_0xae3d('0x18'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xae3d('0x1d')](_0xae3d('0x16'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1e')]);module[_0xae3d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index fae8768..8a4c438 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 _0x49fe=['STRING','DATE','out','ENUM','sequelize','moment','exports'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x49fe,0x100));var _0xe49f=function(_0x1a7896,_0x754ccf){_0x1a7896=_0x1a7896-0x0;var _0x56dd5a=_0x49fe[_0x1a7896];return _0x56dd5a;};'use strict';var Sequelize=require(_0xe49f('0x0'));var moment=require(_0xe49f('0x1'));module[_0xe49f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe49f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe49f('0x3')]},'note':{'type':Sequelize[_0xe49f('0x3')]},'phone':{'type':Sequelize[_0xe49f('0x3')]},'read1stAt':{'type':Sequelize[_0xe49f('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe49f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe49f('0x6')]('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd5da=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd5da,0x9f));var _0xad5d=function(_0x8b44ff,_0x59fbb3){_0x8b44ff=_0x8b44ff-0x0;var _0x93d1e0=_0xd5da[_0x8b44ff];return _0x93d1e0;};'use strict';var Sequelize=require(_0xad5d('0x0'));var moment=require(_0xad5d('0x1'));module['exports']={'closed':{'type':Sequelize[_0xad5d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xad5d('0x3')]},'disposition':{'type':Sequelize[_0xad5d('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xad5d('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xad5d('0x4')]},'read1stAt':{'type':Sequelize[_0xad5d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xad5d('0x5')]('in',_0xad5d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xad5d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xad5d('0x5')]('in',_0xad5d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xad5d('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index b5784df..7ed4721 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 _0xc7e9=['root','attachments','CmContact','lastName','Attachment','Messages','direction','WhatsappAccount','Account','Whatsapp','Owner','N.A.','closed','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','renderFile','downloadInteraction.ejs','createPdfFromHTML','download','log','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','Users','map','fullname','TagIds','split','Tags','index','WhatsappInteraction','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','select','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','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','catch','show','params','rawAttributes','include','create','describe','addMessage','ids','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','omit','Tag','color','emit','removeTags','join','server','files','tmp'];(function(_0x43561e,_0x30b35a){var _0x54ab11=function(_0x32d988){while(--_0x32d988){_0x43561e['push'](_0x43561e['shift']());}};_0x54ab11(++_0x30b35a);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xc7e9[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x9c7e('0x0'));var rimraf=require(_0x9c7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c7e('0x2'));var rp=require(_0x9c7e('0x3'));var moment=require(_0x9c7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c7e('0x5'));var util=require(_0x9c7e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9c7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c7e('0x8'));var _=require(_0x9c7e('0x9'));var squel=require(_0x9c7e('0xa'));var crypto=require(_0x9c7e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c7e('0xc'));var toCsv=require(_0x9c7e('0x7'));var querystring=require(_0x9c7e('0xd'));var Papa=require(_0x9c7e('0xe'));var Redis=require('ioredis');var authService=require(_0x9c7e('0xf'));var qs=require(_0x9c7e('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x9c7e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c7e('0x12'))(_0x9c7e('0x13'));var utils=require('../../config/utils');var config=require(_0x9c7e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c7e('0x15'))['db'];config[_0x9c7e('0x16')]=_[_0x9c7e('0x17')](config[_0x9c7e('0x16')],{'host':_0x9c7e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c7e('0x16')]));require(_0x9c7e('0x19'))[_0x9c7e('0x1a')](socket);function respondWithStatusCode(_0x3a65a6,_0x288f3b){_0x288f3b=_0x288f3b||0xcc;return function(_0x1dc25b){if(_0x1dc25b){return _0x3a65a6['sendStatus'](_0x288f3b);}return _0x3a65a6[_0x9c7e('0x1b')](_0x288f3b)[_0x9c7e('0x1c')]();};}function respondWithResult(_0x346951,_0x3fd3c9){_0x3fd3c9=_0x3fd3c9||0xc8;return function(_0x26871f){if(_0x26871f){return _0x346951['status'](_0x3fd3c9)[_0x9c7e('0x1d')](_0x26871f);}};}function respondWithFilteredResult(_0x412b17,_0x5af216){return function(_0x164412){if(_0x164412){var _0x26dd66=typeof _0x5af216[_0x9c7e('0x1e')]===_0x9c7e('0x1f')&&typeof _0x5af216[_0x9c7e('0x20')]==='undefined';var _0xc8ab00=_0x164412['count'];var _0x23599d=_0x26dd66?0x0:_0x5af216['offset'];var _0x52abd4=_0x26dd66?_0x164412[_0x9c7e('0x21')]:_0x5af216[_0x9c7e('0x1e')]+_0x5af216[_0x9c7e('0x20')];var _0x20e992;if(_0x52abd4>=_0xc8ab00){_0x52abd4=_0xc8ab00;_0x20e992=0xc8;}else{_0x20e992=0xce;}_0x412b17[_0x9c7e('0x1b')](_0x20e992);return _0x412b17['set'](_0x9c7e('0x22'),_0x23599d+'-'+_0x52abd4+'/'+_0xc8ab00)[_0x9c7e('0x1d')](_0x164412);}return null;};}function patchUpdates(_0x5fd78f){return function(_0x1d2e6d){try{jsonpatch[_0x9c7e('0x23')](_0x1d2e6d,_0x5fd78f,!![]);}catch(_0x28f031){return BPromise[_0x9c7e('0x24')](_0x28f031);}return _0x1d2e6d[_0x9c7e('0x25')]();};}function saveUpdates(_0x3567d8,_0x295ddd){return function(_0x1d1a75){if(_0x1d1a75){return _0x1d1a75[_0x9c7e('0x26')](_0x3567d8)['then'](function(_0x9780f8){return _0x9780f8;});}return null;};}function removeEntity(_0x2eaebb,_0x40ad31){return function(_0x467918){if(_0x467918){return _0x467918[_0x9c7e('0x27')]()[_0x9c7e('0x28')](function(){_0x2eaebb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8736,_0x46cfe0){return function(_0x443912){if(!_0x443912){_0x1c8736[_0x9c7e('0x29')](0x194);}return _0x443912;};}function handleError(_0x412a25,_0x33d696){_0x33d696=_0x33d696||0x1f4;return function(_0x324691){logger[_0x9c7e('0x2a')](_0x324691['stack']);if(_0x324691[_0x9c7e('0x2b')]){delete _0x324691['name'];}_0x412a25[_0x9c7e('0x1b')](_0x33d696)['send'](_0x324691);};}function getInteractionUsers(_0x5a33d7,_0x1114d2){return new BPromise(function(_0x2b5084,_0x1ca8bc){try{if(_0x1114d2[_0x5a33d7['id']]){_0x5a33d7[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0x1114d2[_0x5a33d7['id']],function(_0x1cf15e){return{'id':_0x1cf15e['id'],'fullname':_0x1cf15e[_0x9c7e('0x2e')]};});}}catch(_0x397824){_0x1ca8bc(_0x397824);}_0x2b5084(_0x5a33d7);});}function getInteractionTags(_0x2bbfe8,_0x3537b4){return new BPromise(function(_0x427015,_0x16fcfc){try{if(_0x2bbfe8[_0x9c7e('0x2f')]){_0x2bbfe8['Tags']=[];_0x2bbfe8[_0x9c7e('0x2f')][_0x9c7e('0x30')](',')['forEach'](function(_0x437aee){_0x2bbfe8[_0x9c7e('0x31')]['push'](_0x3537b4[_0x437aee]);});}delete _0x2bbfe8[_0x9c7e('0x2f')];}catch(_0x194691){_0x16fcfc(_0x194691);}_0x427015(_0x2bbfe8);});}function updateWhatsappInteraction(_0xf5d14f,_0x4a99c1,_0x1d8673){return new BPromise(function(_0x7b9649,_0x199de1){return getInteractionUsers(_0xf5d14f,_0x1d8673)[_0x9c7e('0x28')](function(_0x431073){return getInteractionTags(_0x431073,_0x4a99c1);})[_0x9c7e('0x28')](function(_0x4244bd){_0x7b9649(_0x4244bd);})['catch'](function(_0x22c532){_0x199de1(_0x22c532);});});}exports[_0x9c7e('0x32')]=function(_0x576876,_0x356cc5){var _0x4eb1d1={},_0x207856={},_0x2c02e8={'count':0x0,'rows':[]};var _0x3a52e9=_[_0x9c7e('0x2d')](db[_0x9c7e('0x33')]['rawAttributes'],function(_0x5730e1){return{'name':_0x5730e1[_0x9c7e('0x34')],'type':_0x5730e1[_0x9c7e('0x35')][_0x9c7e('0x36')]};});_0x207856[_0x9c7e('0x37')]=_[_0x9c7e('0x2d')](_0x3a52e9,'name');_0x207856['query']=_[_0x9c7e('0x38')](_0x576876[_0x9c7e('0x39')]);_0x207856[_0x9c7e('0x3a')]=_[_0x9c7e('0x3b')](_0x207856[_0x9c7e('0x37')],_0x207856[_0x9c7e('0x39')]);_0x4eb1d1[_0x9c7e('0x3c')]=_['intersection'](_0x207856['model'],qs[_0x9c7e('0x3d')](_0x576876['query'][_0x9c7e('0x3d')]));_0x4eb1d1[_0x9c7e('0x3c')]=_0x4eb1d1[_0x9c7e('0x3c')][_0x9c7e('0x3e')]?_0x4eb1d1['attributes']:_0x207856[_0x9c7e('0x37')];if(!_0x576876[_0x9c7e('0x39')][_0x9c7e('0x3f')](_0x9c7e('0x40'))){_0x4eb1d1[_0x9c7e('0x20')]=qs[_0x9c7e('0x20')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x20')]);_0x4eb1d1['offset']=qs[_0x9c7e('0x1e')](_0x576876['query'][_0x9c7e('0x1e')]);}_0x4eb1d1[_0x9c7e('0x41')]=qs[_0x9c7e('0x42')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x42')]);_0x4eb1d1[_0x9c7e('0x43')]=qs[_0x9c7e('0x3a')](_[_0x9c7e('0x44')](_0x576876['query'],_0x207856[_0x9c7e('0x3a')]),_0x3a52e9);var _0x58296f=[];var _0x518973=squel['select']()[_0x9c7e('0x45')]('id')['field'](_0x9c7e('0x2b'))[_0x9c7e('0x45')]('color')[_0x9c7e('0x46')](_0x9c7e('0x47'));var _0x548bea=squel['select']()[_0x9c7e('0x45')](_0x9c7e('0x48'))[_0x9c7e('0x45')](_0x9c7e('0x49'))[_0x9c7e('0x45')](_0x9c7e('0x4a'))[_0x9c7e('0x46')](_0x9c7e('0x4b'),'ui')[_0x9c7e('0x4c')](_0x9c7e('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x18d941=squel[_0x9c7e('0x4e')]()[_0x9c7e('0x46')](_0x9c7e('0x4f'),'i')[_0x9c7e('0x4c')](_0x9c7e('0x50'),'c',_0x9c7e('0x51'))['left_join'](_0x9c7e('0x4d'),'o',_0x9c7e('0x52'))[_0x9c7e('0x4c')]('whatsapp_accounts','a',_0x9c7e('0x53'))[_0x9c7e('0x4c')](_0x9c7e('0x54'),'me',_0x9c7e('0x55'))['left_join'](_0x9c7e('0x56'),'it',_0x9c7e('0x57'))[_0x9c7e('0x4c')](_0x9c7e('0x47'),'t',_0x9c7e('0x58'));var _0x5b6cb7=squel['expr']();var _0x4e75a0=[];var _0x2e76e8=squel[_0x9c7e('0x59')]();var _0x44ad2f;if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x5a')]){_0x44ad2f=as[_0x9c7e('0x5b')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x5a')]);var _0x44240d=_0x44ad2f[_0x9c7e('0x5c')];for(var _0x200898=0x0;_0x200898<_0x44ad2f[_0x9c7e('0x5d')][_0x9c7e('0x3e')];_0x200898++){var _0x288b56=_0x44ad2f[_0x9c7e('0x5d')][_0x200898];var _0x51b482='i';var _0x1b56dc=_[_0x9c7e('0x5e')](_0x3a52e9,[_0x9c7e('0x2b'),_0x288b56[_0x9c7e('0x45')]]);if(!_0x1b56dc){switch(_0x288b56[_0x9c7e('0x45')]){case _0x9c7e('0x5f'):if(_0x288b56[_0x9c7e('0x60')]==0x1){_0x18d941[_0x9c7e('0x61')]('`'+_0x288b56[_0x9c7e('0x45')]+'`\x20=\x200');}else{_0x18d941[_0x9c7e('0x61')]('`'+_0x288b56[_0x9c7e('0x45')]+_0x9c7e('0x62'));}break;case _0x9c7e('0x63'):if(_0x288b56[_0x9c7e('0x64')]===_0x9c7e('0x65')){if(_0x288b56[_0x9c7e('0x60')][_0x9c7e('0x30')]('\x20')[_0x9c7e('0x3e')]>0x1){_0x5b6cb7[_0x44240d](_0x9c7e('0x66'),qs[_0x9c7e('0x67')](_0x288b56[_0x9c7e('0x60')]),null);}else{var _0x4692c2='%'+_0x288b56[_0x9c7e('0x60')]+'%';_0x5b6cb7[_0x44240d](_0x9c7e('0x68'),_0x4692c2,_0x4692c2,_0x4692c2);}}else{_0x1b56dc=_['find'](_0x3a52e9,[_0x9c7e('0x2b'),'ContactId']);_0x288b56['field']=_0x9c7e('0x69');_0x15d9c2=as['buildExpression'](_0x51b482,_0x1b56dc[_0x9c7e('0x35')],_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2[_0x9c7e('0x6a')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x6b')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x1c')]);}break;case'Tag':var _0x4f1485=_0x288b56['value']['split'](',')[_0x9c7e('0x2d')](function(_0x2c7aff){return Number(_0x2c7aff);});_0x4f1485[_0x9c7e('0x6c')](function(_0x2c3880){_0x2e76e8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c3880+',%');});_0x4e75a0=_[_0x9c7e('0x6d')](_0x4e75a0,_0x4f1485);break;case _0x9c7e('0x6e'):if(_0x288b56[_0x9c7e('0x64')]===_0x9c7e('0x65')){_0x5b6cb7[_0x44240d](_0x9c7e('0x6f'),'%'+_0x288b56[_0x9c7e('0x60')]+'%',null);}else{_0x1b56dc=_[_0x9c7e('0x5e')](_0x3a52e9,[_0x9c7e('0x2b'),_0x9c7e('0x70')]);_0x288b56[_0x9c7e('0x45')]=_0x9c7e('0x70');_0x15d9c2=as['buildExpression'](_0x51b482,_0x1b56dc[_0x9c7e('0x35')],_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2[_0x9c7e('0x6a')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x6b')],_0x15d9c2[_0x9c7e('0x60')]['end']);}break;case _0x9c7e('0x71'):_0x15d9c2=as[_0x9c7e('0x72')]('me',null,_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2[_0x9c7e('0x6a')],_0x15d9c2[_0x9c7e('0x60')]['start'],_0x15d9c2['value'][_0x9c7e('0x1c')]);break;}}else{var _0x15d9c2=as[_0x9c7e('0x72')](_0x51b482,_0x1b56dc['type'],_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2['text'],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x6b')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x1c')]);}}}else{var _0x3732ca=_(_0x576876[_0x9c7e('0x39')])[_0x9c7e('0x38')]()[_0x9c7e('0x2d')](function(_0x485d86){return _[_0x9c7e('0x73')](_0x3a52e9,[_0x9c7e('0x2b'),_0x485d86])?_0x485d86:undefined;})[_0x9c7e('0x74')]()[_0x9c7e('0x60')]();if(!_[_0x9c7e('0x75')](_0x3732ca)){_0x3732ca[_0x9c7e('0x6c')](function(_0x4e5797){if(_0x4e5797===_0x9c7e('0x76')){_0x18d941[_0x9c7e('0x43')](_0x9c7e('0x77'),[][_0x9c7e('0x78')](_0x576876[_0x9c7e('0x39')][_0x4e5797]));}else if(_0x4e5797===_0x9c7e('0x79')){var _0x46bce6=JSON[_0x9c7e('0x7a')](_0x576876[_0x9c7e('0x39')][_0x4e5797])[_0x9c7e('0x7b')];var _0x4600d2=JSON['parse'](_0x576876[_0x9c7e('0x39')][_0x4e5797])[_0x9c7e('0x7c')];_0x18d941['where'](_0x9c7e('0x7d'),_0x46bce6,_0x4600d2);}else{if(_0x576876[_0x9c7e('0x39')][_0x4e5797]==='null'){_0x18d941[_0x9c7e('0x43')]('i.'+_0x4e5797+'\x20IS\x20NULL');}else{_0x18d941[_0x9c7e('0x43')]('i.'+_0x4e5797+_0x9c7e('0x7e'),_0x576876[_0x9c7e('0x39')][_0x4e5797]);}}});}if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x7f')]){if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x7f')]==0x1){_0x18d941[_0x9c7e('0x61')](_0x9c7e('0x80'));}else{_0x18d941[_0x9c7e('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x81')]){_0x4e75a0=_[_0x9c7e('0x82')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x81')])?_0x576876[_0x9c7e('0x39')]['tag']:new Array(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x81')]);_0x4e75a0[_0x9c7e('0x6c')](function(_0x7454e){_0x2e76e8['or'](_0x9c7e('0x83'),'%,'+_0x7454e+',%');});}if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x84')]){var _0x57cd1b=_0x576876['query'][_0x9c7e('0x84')][_0x9c7e('0x85')]('\x5c','\x5c\x5c')[_0x9c7e('0x85')](/'/g,'\x27\x27');if(qs[_0x9c7e('0x86')](_0x57cd1b)){_0x5b6cb7['or'](_0x9c7e('0x87'),_0x57cd1b+'%')['or']('i.phone\x20LIKE\x20?',_0x57cd1b+'%');}else{_0x5b6cb7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9c7e('0x67')](_0x57cd1b))['or'](_0x9c7e('0x88'),_0x57cd1b+'%');}}}_0x18d941[_0x9c7e('0x43')](_0x5b6cb7);_0x18d941[_0x9c7e('0x89')](_0x9c7e('0x8a'));var _0x1b76d0={'type':db[_0x9c7e('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3228ae=_0x18d941[_0x9c7e('0x8c')]();_0x3228ae[_0x9c7e('0x45')](_0x9c7e('0x8a'));_0x3228ae[_0x9c7e('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9c7e('0x5f'));if(_0x4eb1d1[_0x9c7e('0x41')]){_0x4eb1d1[_0x9c7e('0x41')][_0x9c7e('0x6c')](function(_0x4d0d3a){var _0xf2b131=_0x4d0d3a[0x0]===_0x9c7e('0x8d')?_0x4d0d3a[0x0]:'i.'+_0x4d0d3a[0x0];_0x18d941['order'](_0xf2b131,_0x4d0d3a[0x1]===_0x9c7e('0x8e')?![]:!![]);});}if(!_[_0x9c7e('0x75')](_0x4e75a0)){_0x18d941[_0x9c7e('0x61')](_0x2e76e8);_0x3228ae['where'](_0x9c7e('0x8f'),_0x4e75a0);}BPromise[_0x9c7e('0x90')]()[_0x9c7e('0x28')](function(){if(!_0x44ad2f){if(_0x576876[_0x9c7e('0x39')]['WhatsappAccountId'])return;_0x3228ae[_0x9c7e('0x43')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x18d941[_0x9c7e('0x43')](_0x9c7e('0x91'));return;}if(_0x576876['user'][_0x9c7e('0x92')]!==_0x9c7e('0x93'))return;return _0x576876[_0x9c7e('0x94')][_0x9c7e('0x95')]({'attributes':['id'],'raw':!![]})[_0x9c7e('0x28')](function(_0x5e686a){if(_['isEmpty'](_0x5e686a)){_0x3228ae['where'](_0x9c7e('0x96'));_0x18d941[_0x9c7e('0x43')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3228ae['where'](_0x9c7e('0x77'),_[_0x9c7e('0x2d')](_0x5e686a,'id'));_0x18d941[_0x9c7e('0x43')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x5e686a,'id'));}});})[_0x9c7e('0x28')](function(){if(_0x576876[_0x9c7e('0x94')][_0x9c7e('0x92')]===_0x9c7e('0x93')&&!_0x44ad2f&&!_0x576876[_0x9c7e('0x39')]['WhatsappAccountId'])return[];return db[_0x9c7e('0x97')][_0x9c7e('0x39')](_0x3228ae[_0x9c7e('0x98')](),_0x1b76d0);})[_0x9c7e('0x28')](function(_0x3cdffd){_0x2c02e8['count']=_0x3cdffd[_0x9c7e('0x3e')];if(_0x2c02e8[_0x9c7e('0x21')]===0x0)return[];return db['sequelize']['query'](_0x518973['toString'](),_0x1b76d0)[_0x9c7e('0x28')](function(_0x466c05){_0x58296f=_[_0x9c7e('0x99')](_0x466c05,'id');_0x1b76d0=_[_0x9c7e('0x9a')](_0x1b76d0,{'model':db[_0x9c7e('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x3d')]){_0x4eb1d1[_0x9c7e('0x3c')][_0x9c7e('0x6c')](function(_0x97a5cb){_0x18d941[_0x9c7e('0x45')]('i.'+_0x97a5cb);});}else{_0x18d941[_0x9c7e('0x45')](_0x9c7e('0x9b'),'unreadMessages');_0x18d941[_0x9c7e('0x45')](_0x9c7e('0x9c'),_0x9c7e('0x9d'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0x9e'),_0x9c7e('0x9f'));_0x18d941[_0x9c7e('0x45')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x9c7e('0x8d'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa0'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa1'),_0x9c7e('0xa2'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa3'),_0x9c7e('0xa4'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa5'),_0x9c7e('0xa6'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa7'),_0x9c7e('0xa8'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa9'),'Contact.mobile');_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xaa'),_0x9c7e('0xab'));_0x18d941[_0x9c7e('0x45')]('o.fullname',_0x9c7e('0xac'));_0x18d941['field'](_0x9c7e('0xad'),_0x9c7e('0xae'));_0x18d941['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9c7e('0x2f'));}if(_0x4eb1d1['limit'])_0x18d941[_0x9c7e('0x20')](_0x4eb1d1[_0x9c7e('0x20')]);if(_0x4eb1d1[_0x9c7e('0x1e')])_0x18d941[_0x9c7e('0x1e')](_0x4eb1d1[_0x9c7e('0x1e')]);return db['sequelize'][_0x9c7e('0x39')](_0x18d941[_0x9c7e('0x98')](),_0x1b76d0);})[_0x9c7e('0x28')](function(_0x166115){if(_0x166115[_0x9c7e('0x3e')]>0x0)_0x548bea[_0x9c7e('0x43')](_0x9c7e('0xaf'),_['map'](_0x166115,'id'));return db[_0x9c7e('0x97')]['query'](_0x548bea[_0x9c7e('0x98')](),_0x1b76d0)['then'](function(_0x319d77){var _0x19a8e9=_[_0x9c7e('0xb0')](_0x319d77,_0x9c7e('0xb1'));var _0x536f5b=[];_0x166115[_0x9c7e('0x6c')](function(_0x3cbfc0){_0x536f5b[_0x9c7e('0xb2')](updateWhatsappInteraction(_0x3cbfc0,_0x58296f,_0x19a8e9));});return BPromise[_0x9c7e('0xb3')](_0x536f5b);});});})['then'](function(_0x1cf300){_0x2c02e8[_0x9c7e('0xb4')]=_0x1cf300;return _0x2c02e8;})[_0x9c7e('0x28')](respondWithFilteredResult(_0x356cc5,_0x4eb1d1))[_0x9c7e('0xb5')](handleError(_0x356cc5,null));};exports[_0x9c7e('0xb6')]=function(_0x37171d,_0x53bebd){var _0x4f0a20={'raw':![],'where':{'id':_0x37171d[_0x9c7e('0xb7')]['id']}},_0x2e8909={};_0x2e8909['model']=_[_0x9c7e('0x38')](db[_0x9c7e('0x33')][_0x9c7e('0xb8')]);_0x2e8909[_0x9c7e('0x39')]=_['keys'](_0x37171d['query']);_0x2e8909[_0x9c7e('0x3a')]=_[_0x9c7e('0x3b')](_0x2e8909['model'],_0x2e8909[_0x9c7e('0x39')]);_0x4f0a20[_0x9c7e('0x3c')]=_[_0x9c7e('0x3b')](_0x2e8909[_0x9c7e('0x37')],qs['fields'](_0x37171d[_0x9c7e('0x39')][_0x9c7e('0x3d')]));_0x4f0a20[_0x9c7e('0x3c')]=_0x4f0a20[_0x9c7e('0x3c')][_0x9c7e('0x3e')]?_0x4f0a20[_0x9c7e('0x3c')]:_0x2e8909[_0x9c7e('0x37')];if(_0x37171d[_0x9c7e('0x39')]['includeAll']){_0x4f0a20[_0x9c7e('0xb9')]=[{'all':!![]}];}_0x4f0a20=_[_0x9c7e('0x9a')]({},_0x4f0a20,_0x37171d['options']);return db[_0x9c7e('0x33')][_0x9c7e('0x5e')](_0x4f0a20)['then'](handleEntityNotFound(_0x53bebd,null))['then'](respondWithResult(_0x53bebd,null))['catch'](handleError(_0x53bebd,null));};exports[_0x9c7e('0xba')]=function(_0xaad3fc,_0x3bbaa7){return db['WhatsappInteraction'][_0x9c7e('0xba')](_0xaad3fc[_0x9c7e('0x71')],{})[_0x9c7e('0x28')](respondWithResult(_0x3bbaa7,0xc9))[_0x9c7e('0xb5')](handleError(_0x3bbaa7,null));};exports[_0x9c7e('0x26')]=function(_0x70703c,_0x4e336b){if(_0x70703c[_0x9c7e('0x71')]['id']){delete _0x70703c[_0x9c7e('0x71')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x70703c[_0x9c7e('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4e336b,null))[_0x9c7e('0x28')](saveUpdates(_0x70703c[_0x9c7e('0x71')],null))[_0x9c7e('0x28')](respondWithResult(_0x4e336b,null))[_0x9c7e('0xb5')](handleError(_0x4e336b,null));};exports[_0x9c7e('0x27')]=function(_0x4fa44b,_0x2fe320){return db[_0x9c7e('0x33')]['find']({'where':{'id':_0x4fa44b[_0x9c7e('0xb7')]['id']}})[_0x9c7e('0x28')](handleEntityNotFound(_0x2fe320,null))['then'](removeEntity(_0x2fe320,null))[_0x9c7e('0xb5')](handleError(_0x2fe320,null));};exports[_0x9c7e('0xbb')]=function(_0x305f0c,_0x2308e4){return db['WhatsappInteraction'][_0x9c7e('0xbb')]()[_0x9c7e('0x28')](respondWithResult(_0x2308e4,null))['catch'](handleError(_0x2308e4,null));};exports[_0x9c7e('0xbc')]=function(_0x111e62,_0x4f6ed1,_0x2309ab){return db['WhatsappMessage'][_0x9c7e('0x5e')]({'where':{'id':_0x111e62[_0x9c7e('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4f6ed1,null))['then'](function(_0x37fb2f){if(_0x37fb2f){return _0x37fb2f[_0x9c7e('0xbc')](_0x111e62['body'][_0x9c7e('0xbd')],_['omit'](_0x111e62['body'],[_0x9c7e('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x4f6ed1,null))['catch'](handleError(_0x4f6ed1,null));};exports['getMessages']=function(_0x4afd2f,_0xef0c6c,_0x1c0a37){var _0x49b68b={'raw':![],'where':{}};var _0x36f7e2={};var _0x31f0d0={'count':0x0,'rows':[]};return db[_0x9c7e('0x33')][_0x9c7e('0xbe')]({'where':{'id':_0x4afd2f[_0x9c7e('0xb7')]['id']}})['then'](handleEntityNotFound(_0xef0c6c,null))[_0x9c7e('0x28')](function(_0x12035e){if(_0x12035e){_0x36f7e2[_0x9c7e('0x37')]=_[_0x9c7e('0x38')](db[_0x9c7e('0xbf')][_0x9c7e('0xb8')]);_0x36f7e2[_0x9c7e('0x39')]=_['keys'](_0x4afd2f['query']);_0x36f7e2[_0x9c7e('0x3a')]=_['intersection'](_0x36f7e2[_0x9c7e('0x37')],_0x36f7e2['query']);_0x49b68b['attributes']=_[_0x9c7e('0x3b')](_0x36f7e2['model'],qs[_0x9c7e('0x3d')](_0x4afd2f['query'][_0x9c7e('0x3d')]));_0x49b68b[_0x9c7e('0x3c')]=_0x49b68b[_0x9c7e('0x3c')][_0x9c7e('0x3e')]?_0x49b68b[_0x9c7e('0x3c')]:_0x36f7e2[_0x9c7e('0x37')];if(!_0x4afd2f['query']['hasOwnProperty'](_0x9c7e('0x40'))){_0x49b68b[_0x9c7e('0x20')]=qs['limit'](_0x4afd2f[_0x9c7e('0x39')]['limit']);_0x49b68b[_0x9c7e('0x1e')]=qs['offset'](_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0x1e')]);}_0x49b68b[_0x9c7e('0x41')]=qs['sort'](_0x4afd2f[_0x9c7e('0x39')]['sort']);_0x49b68b[_0x9c7e('0x43')]=qs[_0x9c7e('0x3a')](_[_0x9c7e('0x44')](_0x4afd2f['query'],_0x36f7e2[_0x9c7e('0x3a')]));_0x49b68b[_0x9c7e('0x43')][_0x9c7e('0xb1')]=_0x12035e['id'];if(_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0x84')]){_0x49b68b[_0x9c7e('0x43')]=_[_0x9c7e('0x9a')](_0x49b68b[_0x9c7e('0x43')],{'$or':_[_0x9c7e('0x2d')](_0x49b68b[_0x9c7e('0x3c')],function(_0x158fbf){var _0x3c787f={};_0x3c787f[_0x158fbf]={'$like':'%'+_0x4afd2f['query'][_0x9c7e('0x84')]+'%'};return _0x3c787f;})});}if(_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0x7b')]){var _0x5d0818=_0x4afd2f['query'][_0x9c7e('0x7b')]['split'](',');var _0x546d3b={};_0x546d3b[_0x5d0818[0x0]]={'$gte':moment(_0x5d0818[0x1])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))};_0x49b68b[_0x9c7e('0x43')]=_[_0x9c7e('0x9a')](_0x49b68b['where'],_0x546d3b);}_0x49b68b=_[_0x9c7e('0x9a')]({},_0x49b68b,_0x4afd2f[_0x9c7e('0xc2')]);return db[_0x9c7e('0xbf')][_0x9c7e('0x21')]({'where':_0x49b68b['where']})[_0x9c7e('0x28')](function(_0x30f6c1){_0x31f0d0['count']=_0x30f6c1;if(_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0xc3')]){_0x49b68b[_0x9c7e('0xb9')]=[{'all':!![]}];}return db[_0x9c7e('0xbf')]['findAll'](_0x49b68b);})[_0x9c7e('0x28')](function(_0x459a4e){_0x31f0d0[_0x9c7e('0xb4')]=_0x459a4e;return _0x31f0d0;});}})[_0x9c7e('0x28')](respondWithFilteredResult(_0xef0c6c,_0x49b68b))[_0x9c7e('0xb5')](handleError(_0xef0c6c,null));};exports[_0x9c7e('0xc4')]=function(_0xd79000,_0x2feb24,_0x264222){return db[_0x9c7e('0x33')][_0x9c7e('0x5e')]({'where':{'id':_0xd79000[_0x9c7e('0xb7')]['id']}})[_0x9c7e('0x28')](handleEntityNotFound(_0x2feb24,null))[_0x9c7e('0x28')](function(_0x2636e2){if(_0x2636e2){return _0x2636e2[_0x9c7e('0xc5')](_0xd79000[_0x9c7e('0x71')][_0x9c7e('0xbd')],_[_0x9c7e('0xc6')](_0xd79000[_0x9c7e('0x71')],['ids','id'])||{})['spread'](function(){return db[_0x9c7e('0xc7')]['findAll']({'attributes':['id',_0x9c7e('0x2b'),_0x9c7e('0xc8')],'where':{'id':_0xd79000['body'][_0x9c7e('0xbd')]}});})[_0x9c7e('0x28')](function(_0x330c91){socket[_0x9c7e('0xc9')]('whatsappInteractionTags:save',{'id':Number(_0xd79000['params']['id']),'tags':_0x330c91||[]});return{'id':Number(_0xd79000[_0x9c7e('0xb7')]['id']),'tags':_0x330c91||[]};});}})[_0x9c7e('0x28')](respondWithResult(_0x2feb24,null))[_0x9c7e('0xb5')](handleError(_0x2feb24,null));};exports[_0x9c7e('0xca')]=function(_0x27c167,_0xb44d48,_0x2cc4b7){return db[_0x9c7e('0x33')][_0x9c7e('0x5e')]({'where':{'id':_0x27c167['params']['id']}})[_0x9c7e('0x28')](handleEntityNotFound(_0xb44d48,null))[_0x9c7e('0x28')](function(_0x19f2d7){if(_0x19f2d7){return _0x19f2d7[_0x9c7e('0xca')](_0x27c167[_0x9c7e('0x39')][_0x9c7e('0xbd')]);}})[_0x9c7e('0x28')](respondWithStatusCode(_0xb44d48,null))['catch'](handleError(_0xb44d48,null));};exports['download']=function(_0x20ff86,_0x59ddfd){var _0x4617ff=moment()['unix']()['toString']();var _0x4b1e53=path[_0x9c7e('0xcb')](config['root'],_0x9c7e('0xcc'),_0x9c7e('0xcd'),_0x9c7e('0xce'));var _0x237ebe=path[_0x9c7e('0xcb')](config[_0x9c7e('0xcf')],_0x9c7e('0xcc'),_0x9c7e('0xcd'),_0x9c7e('0xd0'));var _0x4b2878=path[_0x9c7e('0xcb')](_0x4b1e53,_0x4617ff);var _0xef15f5=util[_0x9c7e('0xc0')]('transcript-%d-%s.zip',_0x20ff86[_0x9c7e('0xb7')]['id'],_0x4617ff);var _0x3e49e6=path['join'](_0x4b1e53,_0xef15f5);var _0x5ea826=[];_0x5ea826[_0x9c7e('0xb2')]({'model':db[_0x9c7e('0x6e')],'as':_0x9c7e('0x6e'),'attributes':['id',_0x9c7e('0x2e')],'raw':!![]});_0x5ea826['push']({'model':db[_0x9c7e('0xd1')],'as':_0x9c7e('0x63'),'attributes':['id','firstName',_0x9c7e('0xd2')],'raw':!![]});if(_0x20ff86['query']['attachments']){_0x5ea826[_0x9c7e('0xb2')]({'model':db[_0x9c7e('0xd3')],'as':_0x9c7e('0xd3'),'raw':!![]});}var _0x374f02=[{'model':db[_0x9c7e('0xbf')],'as':_0x9c7e('0xd4'),'attributes':['id',_0x9c7e('0x71'),_0x9c7e('0x79'),_0x9c7e('0xd5'),'secret',_0x9c7e('0x7f')],'include':_0x5ea826}];_0x374f02[_0x9c7e('0xb2')]({'model':db[_0x9c7e('0xd6')],'as':_0x9c7e('0xd7'),'attributes':['id','name']});_0x374f02['push']({'model':db[_0x9c7e('0x6e')],'as':'Owner','attributes':['id',_0x9c7e('0x2e')]});return db['WhatsappInteraction'][_0x9c7e('0x5e')]({'where':{'id':_0x20ff86['params']['id']},'include':_0x374f02})['then'](handleEntityNotFound(_0x59ddfd,null))[_0x9c7e('0x28')](function(_0x5da1b4){if(_0x5da1b4){var _0x4235c0=_0x5da1b4['get']({'plain':!![]});fs['mkdirSync'](_0x4b2878);var _0x127032={'channel':_0x9c7e('0xd8'),'account':_0x4235c0[_0x9c7e('0xd7')][_0x9c7e('0x2b')],'agent':_0x4235c0[_0x9c7e('0xd9')]?_0x4235c0[_0x9c7e('0xd9')][_0x9c7e('0x2e')]:_0x9c7e('0xda'),'createdAt':moment(_0x4235c0[_0x9c7e('0x79')])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))[_0x9c7e('0x98')](),'closedAt':_0x4235c0[_0x9c7e('0xdb')]?moment(_0x4235c0['closedAt'])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))['toString']():'','disposition':_0x4235c0[_0x9c7e('0xdc')],'messages':_(_0x4235c0[_0x9c7e('0xd4')])['filter']({'secret':![]})['map'](function(_0x51c0a4){if(_0x51c0a4[_0x9c7e('0xd3')]){var _0x3ceab0=path[_0x9c7e('0xcb')](_0x237ebe,_0x51c0a4[_0x9c7e('0xd3')][_0x9c7e('0xdd')]);if(fs[_0x9c7e('0xde')](_0x3ceab0)){fs[_0x9c7e('0xdf')](_0x3ceab0)[_0x9c7e('0xe0')](fs[_0x9c7e('0xe1')](path['join'](_0x4b2878,_0x51c0a4[_0x9c7e('0xd3')]['basename'])));}}return{'date':moment(_0x51c0a4[_0x9c7e('0x79')])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))[_0x9c7e('0x98')](),'sender':_0x51c0a4[_0x9c7e('0xd5')]===_0x9c7e('0xe2')?_0x51c0a4[_0x9c7e('0x6e')]?_0x51c0a4[_0x9c7e('0x6e')][_0x9c7e('0x2e')]:_0x9c7e('0xe3'):_0x51c0a4[_0x9c7e('0x63')]['firstName']+(_0x51c0a4[_0x9c7e('0x63')][_0x9c7e('0xd2')]?'\x20'+_0x51c0a4[_0x9c7e('0x63')]['lastName']:''),'body':_0x51c0a4[_0x9c7e('0xd3')]?_0x51c0a4[_0x9c7e('0xd3')]['basename']:_0x51c0a4[_0x9c7e('0x71')],'direction':_0x51c0a4[_0x9c7e('0xd5')]===_0x9c7e('0xe2')?'A':'C','secret':_0x51c0a4[_0x9c7e('0xe4')],'read':_0x51c0a4[_0x9c7e('0x7f')],'attachment':_0x51c0a4[_0x9c7e('0xd3')]};})[_0x9c7e('0x60')]()};return ejs[_0x9c7e('0xe5')](path['join'](config[_0x9c7e('0xcf')],_0x9c7e('0xcc'),'views',_0x9c7e('0xe6')),{'interaction':_0x127032})[_0x9c7e('0x28')](function(_0x1951f6){var _0x8c91d4=path[_0x9c7e('0xcb')](_0x4b2878,'transcript-'+_0x4235c0['id']+'-'+_0x4617ff+'.pdf');var _0x377cb1={'path':_0x8c91d4,'channel':'Whatsapp','interactionId':_0x4235c0['id']};return pdf[_0x9c7e('0xe7')](_0x1951f6,_0x377cb1);})[_0x9c7e('0x28')](function(){return new BPromise(function(_0x437476,_0x56c0f3){zipdir(_0x4b2878,{'saveTo':_0x3e49e6},function(_0x11a476,_0x43a546){if(_0x11a476)return _0x56c0f3(_0x11a476);return _0x437476(_0x43a546);});})[_0x9c7e('0x28')](function(){return new BPromise(function(_0x5778a6,_0x473c6d){rimraf(_0x4b2878,function(_0x16a730){if(_0x16a730)_0x473c6d(_0x16a730);return _0x5778a6();});});})[_0x9c7e('0x28')](function(){return _0x59ddfd[_0x9c7e('0xe8')](_0x3e49e6,_0xef15f5,function(_0x8fe071){if(_0x8fe071){console[_0x9c7e('0xe9')]('err',_0x8fe071);}else{fs['unlinkSync'](_0x3e49e6);}});});});}else{return _0x59ddfd[_0x9c7e('0x29')](0xc8);}})[_0x9c7e('0xb5')](handleError(_0x59ddfd,null));}; \ No newline at end of file +var _0xa261=['rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','field','color','from','select','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','value','having','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','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.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','all','catch','show','params','includeAll','include','options','create','body','describe','addMessage','WhatsappMessage','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','ids','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','closedAt','disposition','Messages','basename','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','index','WhatsappInteraction'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xa261,0x1a3));var _0x1a26=function(_0x593b81,_0x1d2c9b){_0x593b81=_0x593b81-0x0;var _0x4f61e3=_0xa261[_0x593b81];return _0x4f61e3;};'use strict';var emlformat=require(_0x1a26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a26('0x1'));var jsonpatch=require(_0x1a26('0x2'));var rp=require(_0x1a26('0x3'));var moment=require(_0x1a26('0x4'));var BPromise=require(_0x1a26('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1a26('0x6'));var csv=require(_0x1a26('0x7'));var ejs=require(_0x1a26('0x8'));var fs=require('fs');var fs_extra=require(_0x1a26('0x9'));var _=require(_0x1a26('0xa'));var squel=require('squel');var crypto=require(_0x1a26('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1a26('0xc'));var toCsv=require(_0x1a26('0x7'));var querystring=require(_0x1a26('0xd'));var Papa=require('papaparse');var Redis=require(_0x1a26('0xe'));var authService=require(_0x1a26('0xf'));var qs=require(_0x1a26('0x10'));var as=require(_0x1a26('0x11'));var pdf=require(_0x1a26('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a26('0x13'))(_0x1a26('0x14'));var utils=require(_0x1a26('0x15'));var config=require(_0x1a26('0x16'));var licenseUtil=require(_0x1a26('0x17'));var db=require(_0x1a26('0x18'))['db'];config['redis']=_[_0x1a26('0x19')](config['redis'],{'host':_0x1a26('0x1a'),'port':0x18eb});var socket=require(_0x1a26('0x1b'))(new Redis(config[_0x1a26('0x1c')]));require('./whatsappInteraction.socket')[_0x1a26('0x1d')](socket);function respondWithStatusCode(_0xdbe9c9,_0x2a2d23){_0x2a2d23=_0x2a2d23||0xcc;return function(_0x354e7d){if(_0x354e7d){return _0xdbe9c9[_0x1a26('0x1e')](_0x2a2d23);}return _0xdbe9c9['status'](_0x2a2d23)[_0x1a26('0x1f')]();};}function respondWithResult(_0x1607a1,_0xf7f900){_0xf7f900=_0xf7f900||0xc8;return function(_0x43495c){if(_0x43495c){return _0x1607a1[_0x1a26('0x20')](_0xf7f900)[_0x1a26('0x21')](_0x43495c);}};}function respondWithFilteredResult(_0x54b29c,_0x2f82a0){return function(_0x4a8d0c){if(_0x4a8d0c){var _0x5ef863=typeof _0x2f82a0['offset']===_0x1a26('0x22')&&typeof _0x2f82a0[_0x1a26('0x23')]===_0x1a26('0x22');var _0x332bb6=_0x4a8d0c['count'];var _0x270828=_0x5ef863?0x0:_0x2f82a0['offset'];var _0x42c8af=_0x5ef863?_0x4a8d0c[_0x1a26('0x24')]:_0x2f82a0[_0x1a26('0x25')]+_0x2f82a0[_0x1a26('0x23')];var _0x4ff8bf;if(_0x42c8af>=_0x332bb6){_0x42c8af=_0x332bb6;_0x4ff8bf=0xc8;}else{_0x4ff8bf=0xce;}_0x54b29c[_0x1a26('0x20')](_0x4ff8bf);return _0x54b29c[_0x1a26('0x26')](_0x1a26('0x27'),_0x270828+'-'+_0x42c8af+'/'+_0x332bb6)[_0x1a26('0x21')](_0x4a8d0c);}return null;};}function patchUpdates(_0x56be78){return function(_0x5a8494){try{jsonpatch['apply'](_0x5a8494,_0x56be78,!![]);}catch(_0x6550ee){return BPromise[_0x1a26('0x28')](_0x6550ee);}return _0x5a8494[_0x1a26('0x29')]();};}function saveUpdates(_0x4a45dd,_0x257823){return function(_0x1c7f89){if(_0x1c7f89){return _0x1c7f89[_0x1a26('0x2a')](_0x4a45dd)[_0x1a26('0x2b')](function(_0x3409bc){return _0x3409bc;});}return null;};}function removeEntity(_0x221643,_0x58e833){return function(_0x12a925){if(_0x12a925){return _0x12a925[_0x1a26('0x2c')]()[_0x1a26('0x2b')](function(){_0x221643[_0x1a26('0x20')](0xcc)[_0x1a26('0x1f')]();});}};}function handleEntityNotFound(_0x3ba47f,_0xc1287e){return function(_0x255a69){if(!_0x255a69){_0x3ba47f[_0x1a26('0x1e')](0x194);}return _0x255a69;};}function handleError(_0x3d1ef6,_0x405cec){_0x405cec=_0x405cec||0x1f4;return function(_0x58c63d){logger[_0x1a26('0x2d')](_0x58c63d[_0x1a26('0x2e')]);if(_0x58c63d[_0x1a26('0x2f')]){delete _0x58c63d[_0x1a26('0x2f')];}_0x3d1ef6[_0x1a26('0x20')](_0x405cec)[_0x1a26('0x30')](_0x58c63d);};}function getInteractionUsers(_0x5ce060,_0x54e7ce){return new BPromise(function(_0x510a7c,_0x5a3823){try{if(_0x54e7ce[_0x5ce060['id']]){_0x5ce060[_0x1a26('0x31')]=_[_0x1a26('0x32')](_0x54e7ce[_0x5ce060['id']],function(_0x579248){return{'id':_0x579248['id'],'fullname':_0x579248[_0x1a26('0x33')]};});}}catch(_0x15806e){_0x5a3823(_0x15806e);}_0x510a7c(_0x5ce060);});}function getInteractionTags(_0x24be85,_0x42c564){return new BPromise(function(_0x1c1c1c,_0x4945db){try{if(_0x24be85[_0x1a26('0x34')]){_0x24be85['Tags']=[];_0x24be85['TagIds'][_0x1a26('0x35')](',')[_0x1a26('0x36')](function(_0x3107e0){_0x24be85[_0x1a26('0x37')][_0x1a26('0x38')](_0x42c564[_0x3107e0]);});}delete _0x24be85['TagIds'];}catch(_0x5b1546){_0x4945db(_0x5b1546);}_0x1c1c1c(_0x24be85);});}function updateWhatsappInteraction(_0x366dfe,_0x59a7fd,_0x2b09a0){return new BPromise(function(_0x35e77e,_0x1f3eea){return getInteractionUsers(_0x366dfe,_0x2b09a0)['then'](function(_0x2eda1d){return getInteractionTags(_0x2eda1d,_0x59a7fd);})[_0x1a26('0x2b')](function(_0x1134d9){_0x35e77e(_0x1134d9);})['catch'](function(_0xcb2626){_0x1f3eea(_0xcb2626);});});}exports[_0x1a26('0x39')]=function(_0x3c9803,_0x51e1f9){var _0x2d1f63={},_0x25308c={},_0x374d17={'count':0x0,'rows':[]};var _0x5e0b8a=_[_0x1a26('0x32')](db[_0x1a26('0x3a')][_0x1a26('0x3b')],function(_0x3f8b81){return{'name':_0x3f8b81[_0x1a26('0x3c')],'type':_0x3f8b81[_0x1a26('0x3d')][_0x1a26('0x3e')]};});_0x25308c['model']=_[_0x1a26('0x32')](_0x5e0b8a,'name');_0x25308c[_0x1a26('0x3f')]=_[_0x1a26('0x40')](_0x3c9803['query']);_0x25308c[_0x1a26('0x41')]=_['intersection'](_0x25308c['model'],_0x25308c[_0x1a26('0x3f')]);_0x2d1f63[_0x1a26('0x42')]=_[_0x1a26('0x43')](_0x25308c[_0x1a26('0x44')],qs['fields'](_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x45')]));_0x2d1f63[_0x1a26('0x42')]=_0x2d1f63[_0x1a26('0x42')]['length']?_0x2d1f63[_0x1a26('0x42')]:_0x25308c[_0x1a26('0x44')];if(!_0x3c9803['query'][_0x1a26('0x46')](_0x1a26('0x47'))){_0x2d1f63[_0x1a26('0x23')]=qs[_0x1a26('0x23')](_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x23')]);_0x2d1f63[_0x1a26('0x25')]=qs[_0x1a26('0x25')](_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x25')]);}_0x2d1f63[_0x1a26('0x48')]=qs[_0x1a26('0x49')](_0x3c9803[_0x1a26('0x3f')]['sort']);_0x2d1f63[_0x1a26('0x4a')]=qs['filters'](_['pick'](_0x3c9803[_0x1a26('0x3f')],_0x25308c['filters']),_0x5e0b8a);var _0x14cdca=[];var _0x2536cb=squel['select']()['field']('id')[_0x1a26('0x4b')]('name')[_0x1a26('0x4b')](_0x1a26('0x4c'))[_0x1a26('0x4d')]('tools_tags');var _0x38c4c6=squel[_0x1a26('0x4e')]()['field']('u.id')['field'](_0x1a26('0x4f'))[_0x1a26('0x4b')](_0x1a26('0x50'))['from'](_0x1a26('0x51'),'ui')[_0x1a26('0x52')](_0x1a26('0x53'),'u',_0x1a26('0x54'));var _0x262cfb=squel[_0x1a26('0x4e')]()[_0x1a26('0x4d')](_0x1a26('0x55'),'i')['left_join'](_0x1a26('0x56'),'c',_0x1a26('0x57'))[_0x1a26('0x52')](_0x1a26('0x53'),'o',_0x1a26('0x58'))[_0x1a26('0x52')](_0x1a26('0x59'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x1a26('0x52')](_0x1a26('0x5a'),'me',_0x1a26('0x5b'))[_0x1a26('0x52')](_0x1a26('0x5c'),'it',_0x1a26('0x5d'))[_0x1a26('0x52')](_0x1a26('0x5e'),'t','t.id\x20=\x20it.TagId');var _0x169aa1=squel[_0x1a26('0x5f')]();var _0x10f013=[];var _0x1fd369=squel[_0x1a26('0x5f')]();var _0x517376;if(_0x3c9803['query'][_0x1a26('0x60')]){_0x517376=as[_0x1a26('0x61')](_0x3c9803[_0x1a26('0x3f')]['search']);var _0x3a9dc6=_0x517376[_0x1a26('0x62')];for(var _0x9652e4=0x0;_0x9652e4<_0x517376[_0x1a26('0x63')]['length'];_0x9652e4++){var _0x5e031c=_0x517376[_0x1a26('0x63')][_0x9652e4];var _0x102ab2='i';var _0x1781c3=_[_0x1a26('0x64')](_0x5e0b8a,[_0x1a26('0x2f'),_0x5e031c['field']]);if(!_0x1781c3){switch(_0x5e031c[_0x1a26('0x4b')]){case'unreadMessages':if(_0x5e031c[_0x1a26('0x65')]==0x1){_0x262cfb[_0x1a26('0x66')]('`'+_0x5e031c[_0x1a26('0x4b')]+'`\x20=\x200');}else{_0x262cfb[_0x1a26('0x66')]('`'+_0x5e031c[_0x1a26('0x4b')]+'`\x20>\x200');}break;case _0x1a26('0x67'):if(_0x5e031c[_0x1a26('0x68')]===_0x1a26('0x69')){if(_0x5e031c['value'][_0x1a26('0x35')]('\x20')[_0x1a26('0x6a')]>0x1){_0x169aa1[_0x3a9dc6](_0x1a26('0x6b'),qs['getFullTextValue'](_0x5e031c[_0x1a26('0x65')]),null);}else{var _0x37d61c='%'+_0x5e031c[_0x1a26('0x65')]+'%';_0x169aa1[_0x3a9dc6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x37d61c,_0x37d61c,_0x37d61c);}}else{_0x1781c3=_[_0x1a26('0x64')](_0x5e0b8a,[_0x1a26('0x2f'),_0x1a26('0x6c')]);_0x5e031c[_0x1a26('0x4b')]='ContactId';_0xd1648e=as[_0x1a26('0x6d')](_0x102ab2,_0x1781c3['type'],_0x5e031c);_0x169aa1[_0x3a9dc6](_0xd1648e[_0x1a26('0x6e')],_0xd1648e['value'][_0x1a26('0x6f')],_0xd1648e[_0x1a26('0x65')][_0x1a26('0x1f')]);}break;case _0x1a26('0x70'):var _0x3f23a8=_0x5e031c[_0x1a26('0x65')][_0x1a26('0x35')](',')[_0x1a26('0x32')](function(_0x302e3f){return Number(_0x302e3f);});_0x3f23a8['forEach'](function(_0x7719d){_0x1fd369['or'](_0x1a26('0x71'),'%,'+_0x7719d+',%');});_0x10f013=_[_0x1a26('0x72')](_0x10f013,_0x3f23a8);break;case _0x1a26('0x73'):if(_0x5e031c[_0x1a26('0x68')]===_0x1a26('0x69')){_0x169aa1[_0x3a9dc6](_0x1a26('0x74'),'%'+_0x5e031c[_0x1a26('0x65')]+'%',null);}else{_0x1781c3=_[_0x1a26('0x64')](_0x5e0b8a,['name',_0x1a26('0x75')]);_0x5e031c[_0x1a26('0x4b')]=_0x1a26('0x75');_0xd1648e=as[_0x1a26('0x6d')](_0x102ab2,_0x1781c3[_0x1a26('0x3d')],_0x5e031c);_0x169aa1[_0x3a9dc6](_0xd1648e[_0x1a26('0x6e')],_0xd1648e[_0x1a26('0x65')]['start'],_0xd1648e[_0x1a26('0x65')][_0x1a26('0x1f')]);}break;case'body':_0xd1648e=as['buildExpression']('me',null,_0x5e031c);_0x169aa1[_0x3a9dc6](_0xd1648e[_0x1a26('0x6e')],_0xd1648e[_0x1a26('0x65')][_0x1a26('0x6f')],_0xd1648e[_0x1a26('0x65')]['end']);break;}}else{var _0xd1648e=as[_0x1a26('0x6d')](_0x102ab2,_0x1781c3[_0x1a26('0x3d')],_0x5e031c);_0x169aa1[_0x3a9dc6](_0xd1648e[_0x1a26('0x6e')],_0xd1648e[_0x1a26('0x65')][_0x1a26('0x6f')],_0xd1648e[_0x1a26('0x65')][_0x1a26('0x1f')]);}}}else{var _0x1d46b7=_(_0x3c9803[_0x1a26('0x3f')])['keys']()[_0x1a26('0x32')](function(_0x4dd249){return _['some'](_0x5e0b8a,[_0x1a26('0x2f'),_0x4dd249])?_0x4dd249:undefined;})[_0x1a26('0x76')]()[_0x1a26('0x65')]();if(!_[_0x1a26('0x77')](_0x1d46b7)){_0x1d46b7[_0x1a26('0x36')](function(_0x950ea4){if(_0x950ea4===_0x1a26('0x78')){_0x262cfb[_0x1a26('0x4a')](_0x1a26('0x79'),[][_0x1a26('0x7a')](_0x3c9803[_0x1a26('0x3f')][_0x950ea4]));}else if(_0x950ea4===_0x1a26('0x7b')){var _0x4a7688=JSON[_0x1a26('0x7c')](_0x3c9803['query'][_0x950ea4])['$gte'];var _0x46a1cd=JSON[_0x1a26('0x7c')](_0x3c9803['query'][_0x950ea4])[_0x1a26('0x7d')];_0x262cfb[_0x1a26('0x4a')](_0x1a26('0x7e'),_0x4a7688,_0x46a1cd);}else{if(_0x3c9803[_0x1a26('0x3f')][_0x950ea4]===_0x1a26('0x7f')){_0x262cfb[_0x1a26('0x4a')]('i.'+_0x950ea4+_0x1a26('0x80'));}else{_0x262cfb[_0x1a26('0x4a')]('i.'+_0x950ea4+_0x1a26('0x81'),_0x3c9803[_0x1a26('0x3f')][_0x950ea4]);}}});}if(_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x82')]){if(_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x82')]==0x1){_0x262cfb[_0x1a26('0x66')](_0x1a26('0x83'));}else{_0x262cfb[_0x1a26('0x66')](_0x1a26('0x84'));}}if(_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x85')]){_0x10f013=_[_0x1a26('0x86')](_0x3c9803[_0x1a26('0x3f')]['tag'])?_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x85')]:new Array(_0x3c9803[_0x1a26('0x3f')]['tag']);_0x10f013[_0x1a26('0x36')](function(_0x5ac9ff){_0x1fd369['or'](_0x1a26('0x71'),'%,'+_0x5ac9ff+',%');});}if(_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x87')]){var _0x32e396=_0x3c9803[_0x1a26('0x3f')]['filter']['replace']('\x5c','\x5c\x5c')[_0x1a26('0x88')](/'/g,'\x27\x27');if(qs[_0x1a26('0x89')](_0x32e396)){_0x169aa1['or'](_0x1a26('0x8a'),_0x32e396+'%')['or'](_0x1a26('0x8b'),_0x32e396+'%');}else{_0x169aa1['or'](_0x1a26('0x8c'),qs[_0x1a26('0x8d')](_0x32e396))['or'](_0x1a26('0x8e'),_0x32e396+'%');}}}_0x262cfb[_0x1a26('0x4a')](_0x169aa1);_0x262cfb[_0x1a26('0x8f')](_0x1a26('0x90'));var _0x50a6d4={'type':db[_0x1a26('0x91')][_0x1a26('0x92')][_0x1a26('0x93')],'raw':!![]};var _0xcaf7f5=_0x262cfb['clone']();_0xcaf7f5[_0x1a26('0x4b')](_0x1a26('0x90'));_0xcaf7f5[_0x1a26('0x4b')](_0x1a26('0x94'),_0x1a26('0x95'));if(_0x2d1f63['order']){_0x2d1f63[_0x1a26('0x48')]['forEach'](function(_0x89b77a){var _0x388158=_0x89b77a[0x0]===_0x1a26('0x96')?_0x89b77a[0x0]:'i.'+_0x89b77a[0x0];_0x262cfb[_0x1a26('0x48')](_0x388158,_0x89b77a[0x1]===_0x1a26('0x97')?![]:!![]);});}if(!_[_0x1a26('0x77')](_0x10f013)){_0x262cfb[_0x1a26('0x66')](_0x1fd369);_0xcaf7f5['where']('t.id\x20IN\x20?',_0x10f013);}BPromise[_0x1a26('0x98')]()[_0x1a26('0x2b')](function(){if(!_0x517376){if(_0x3c9803[_0x1a26('0x3f')]['WhatsappAccountId'])return;_0xcaf7f5[_0x1a26('0x4a')](_0x1a26('0x99'));_0x262cfb[_0x1a26('0x4a')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3c9803[_0x1a26('0x9a')][_0x1a26('0x9b')]!==_0x1a26('0x9c'))return;return _0x3c9803[_0x1a26('0x9a')][_0x1a26('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x18eb3d){if(_[_0x1a26('0x77')](_0x18eb3d)){_0xcaf7f5[_0x1a26('0x4a')](_0x1a26('0x9e'));_0x262cfb['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0xcaf7f5[_0x1a26('0x4a')](_0x1a26('0x79'),_[_0x1a26('0x32')](_0x18eb3d,'id'));_0x262cfb[_0x1a26('0x4a')]('i.WhatsappAccountId\x20IN\x20?',_[_0x1a26('0x32')](_0x18eb3d,'id'));}});})['then'](function(){if(_0x3c9803[_0x1a26('0x9a')][_0x1a26('0x9b')]===_0x1a26('0x9c')&&!_0x517376&&!_0x3c9803[_0x1a26('0x3f')]['WhatsappAccountId'])return[];return db[_0x1a26('0x9f')][_0x1a26('0x3f')](_0xcaf7f5['toString'](),_0x50a6d4);})[_0x1a26('0x2b')](function(_0x24b101){_0x374d17[_0x1a26('0x24')]=_0x24b101['length'];if(_0x374d17['count']===0x0)return[];return db['sequelize'][_0x1a26('0x3f')](_0x2536cb[_0x1a26('0xa0')](),_0x50a6d4)[_0x1a26('0x2b')](function(_0x636e7d){_0x14cdca=_[_0x1a26('0xa1')](_0x636e7d,'id');_0x50a6d4=_[_0x1a26('0xa2')](_0x50a6d4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c9803[_0x1a26('0x3f')][_0x1a26('0x45')]){_0x2d1f63[_0x1a26('0x42')][_0x1a26('0x36')](function(_0x1eb047){_0x262cfb['field']('i.'+_0x1eb047);});}else{_0x262cfb[_0x1a26('0x4b')](_0x1a26('0x94'),_0x1a26('0x95'));_0x262cfb[_0x1a26('0x4b')]('a.key',_0x1a26('0xa3'));_0x262cfb[_0x1a26('0x4b')](_0x1a26('0xa4'),'Account.mandatoryDisposition');_0x262cfb[_0x1a26('0x4b')](_0x1a26('0xa5'),'contactName');_0x262cfb['field'](_0x1a26('0xa6'));_0x262cfb[_0x1a26('0x4b')](_0x1a26('0xa7'),_0x1a26('0xa8'));_0x262cfb[_0x1a26('0x4b')]('c.lastName',_0x1a26('0xa9'));_0x262cfb[_0x1a26('0x4b')]('c.email',_0x1a26('0xaa'));_0x262cfb['field'](_0x1a26('0xab'),_0x1a26('0xac'));_0x262cfb['field'](_0x1a26('0xad'),_0x1a26('0xae'));_0x262cfb[_0x1a26('0x4b')]('c.fax',_0x1a26('0xaf'));_0x262cfb[_0x1a26('0x4b')](_0x1a26('0xb0'),_0x1a26('0xb1'));_0x262cfb[_0x1a26('0x4b')](_0x1a26('0xb2'),'Owner.internal');_0x262cfb[_0x1a26('0x4b')](_0x1a26('0xb3'),'TagIds');}if(_0x2d1f63[_0x1a26('0x23')])_0x262cfb[_0x1a26('0x23')](_0x2d1f63['limit']);if(_0x2d1f63[_0x1a26('0x25')])_0x262cfb[_0x1a26('0x25')](_0x2d1f63[_0x1a26('0x25')]);return db[_0x1a26('0x9f')][_0x1a26('0x3f')](_0x262cfb[_0x1a26('0xa0')](),_0x50a6d4);})[_0x1a26('0x2b')](function(_0x4971ad){if(_0x4971ad[_0x1a26('0x6a')]>0x0)_0x38c4c6[_0x1a26('0x4a')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x1a26('0x32')](_0x4971ad,'id'));return db[_0x1a26('0x9f')]['query'](_0x38c4c6[_0x1a26('0xa0')](),_0x50a6d4)[_0x1a26('0x2b')](function(_0x46448c){var _0x4d9be7=_[_0x1a26('0xb4')](_0x46448c,_0x1a26('0xb5'));var _0x264e2b=[];_0x4971ad['forEach'](function(_0x201c98){_0x264e2b[_0x1a26('0x38')](updateWhatsappInteraction(_0x201c98,_0x14cdca,_0x4d9be7));});return BPromise[_0x1a26('0xb6')](_0x264e2b);});});})['then'](function(_0x3b9715){_0x374d17['rows']=_0x3b9715;return _0x374d17;})['then'](respondWithFilteredResult(_0x51e1f9,_0x2d1f63))[_0x1a26('0xb7')](handleError(_0x51e1f9,null));};exports[_0x1a26('0xb8')]=function(_0xf9a7eb,_0x3192ca){var _0x580b00={'raw':![],'where':{'id':_0xf9a7eb[_0x1a26('0xb9')]['id']}},_0x1cf320={};_0x1cf320['model']=_[_0x1a26('0x40')](db[_0x1a26('0x3a')][_0x1a26('0x3b')]);_0x1cf320[_0x1a26('0x3f')]=_[_0x1a26('0x40')](_0xf9a7eb['query']);_0x1cf320[_0x1a26('0x41')]=_[_0x1a26('0x43')](_0x1cf320['model'],_0x1cf320['query']);_0x580b00[_0x1a26('0x42')]=_[_0x1a26('0x43')](_0x1cf320['model'],qs['fields'](_0xf9a7eb[_0x1a26('0x3f')]['fields']));_0x580b00[_0x1a26('0x42')]=_0x580b00['attributes'][_0x1a26('0x6a')]?_0x580b00[_0x1a26('0x42')]:_0x1cf320[_0x1a26('0x44')];if(_0xf9a7eb[_0x1a26('0x3f')][_0x1a26('0xba')]){_0x580b00[_0x1a26('0xbb')]=[{'all':!![]}];}_0x580b00=_[_0x1a26('0xa2')]({},_0x580b00,_0xf9a7eb[_0x1a26('0xbc')]);return db['WhatsappInteraction'][_0x1a26('0x64')](_0x580b00)[_0x1a26('0x2b')](handleEntityNotFound(_0x3192ca,null))[_0x1a26('0x2b')](respondWithResult(_0x3192ca,null))[_0x1a26('0xb7')](handleError(_0x3192ca,null));};exports[_0x1a26('0xbd')]=function(_0x18e7fb,_0x50b2b8){return db[_0x1a26('0x3a')]['create'](_0x18e7fb[_0x1a26('0xbe')],{})[_0x1a26('0x2b')](respondWithResult(_0x50b2b8,0xc9))[_0x1a26('0xb7')](handleError(_0x50b2b8,null));};exports[_0x1a26('0x2a')]=function(_0x5ec3c0,_0x293081){if(_0x5ec3c0[_0x1a26('0xbe')]['id']){delete _0x5ec3c0['body']['id'];}return db[_0x1a26('0x3a')][_0x1a26('0x64')]({'where':{'id':_0x5ec3c0[_0x1a26('0xb9')]['id']}})[_0x1a26('0x2b')](handleEntityNotFound(_0x293081,null))[_0x1a26('0x2b')](saveUpdates(_0x5ec3c0[_0x1a26('0xbe')],null))['then'](respondWithResult(_0x293081,null))['catch'](handleError(_0x293081,null));};exports['destroy']=function(_0x55ba83,_0x270552){return db[_0x1a26('0x3a')][_0x1a26('0x64')]({'where':{'id':_0x55ba83[_0x1a26('0xb9')]['id']}})['then'](handleEntityNotFound(_0x270552,null))['then'](removeEntity(_0x270552,null))[_0x1a26('0xb7')](handleError(_0x270552,null));};exports[_0x1a26('0xbf')]=function(_0x57b5dc,_0x41f233){return db[_0x1a26('0x3a')][_0x1a26('0xbf')]()[_0x1a26('0x2b')](respondWithResult(_0x41f233,null))[_0x1a26('0xb7')](handleError(_0x41f233,null));};exports[_0x1a26('0xc0')]=function(_0x58c597,_0x159918,_0x57a91c){return db[_0x1a26('0xc1')][_0x1a26('0x64')]({'where':{'id':_0x58c597['params']['id']}})[_0x1a26('0x2b')](handleEntityNotFound(_0x159918,null))[_0x1a26('0x2b')](function(_0x2d1615){if(_0x2d1615){return _0x2d1615[_0x1a26('0xc0')](_0x58c597[_0x1a26('0xbe')]['ids'],_['omit'](_0x58c597['body'],['ids','id'])||{});}})[_0x1a26('0x2b')](respondWithResult(_0x159918,null))[_0x1a26('0xb7')](handleError(_0x159918,null));};exports[_0x1a26('0xc2')]=function(_0x52654c,_0x318eda,_0xe72b14){var _0x4af8bc={'raw':![],'where':{}};var _0x576c7b={};var _0x2def94={'count':0x0,'rows':[]};return db[_0x1a26('0x3a')]['findOne']({'where':{'id':_0x52654c[_0x1a26('0xb9')]['id']}})['then'](handleEntityNotFound(_0x318eda,null))[_0x1a26('0x2b')](function(_0x45d340){if(_0x45d340){_0x576c7b['model']=_[_0x1a26('0x40')](db[_0x1a26('0xc1')][_0x1a26('0x3b')]);_0x576c7b[_0x1a26('0x3f')]=_['keys'](_0x52654c[_0x1a26('0x3f')]);_0x576c7b['filters']=_[_0x1a26('0x43')](_0x576c7b[_0x1a26('0x44')],_0x576c7b[_0x1a26('0x3f')]);_0x4af8bc[_0x1a26('0x42')]=_[_0x1a26('0x43')](_0x576c7b['model'],qs[_0x1a26('0x45')](_0x52654c['query']['fields']));_0x4af8bc[_0x1a26('0x42')]=_0x4af8bc[_0x1a26('0x42')][_0x1a26('0x6a')]?_0x4af8bc['attributes']:_0x576c7b[_0x1a26('0x44')];if(!_0x52654c[_0x1a26('0x3f')][_0x1a26('0x46')]('nolimit')){_0x4af8bc['limit']=qs[_0x1a26('0x23')](_0x52654c['query'][_0x1a26('0x23')]);_0x4af8bc[_0x1a26('0x25')]=qs['offset'](_0x52654c[_0x1a26('0x3f')][_0x1a26('0x25')]);}_0x4af8bc[_0x1a26('0x48')]=qs['sort'](_0x52654c[_0x1a26('0x3f')][_0x1a26('0x49')]);_0x4af8bc[_0x1a26('0x4a')]=qs[_0x1a26('0x41')](_[_0x1a26('0xc3')](_0x52654c[_0x1a26('0x3f')],_0x576c7b[_0x1a26('0x41')]));_0x4af8bc[_0x1a26('0x4a')]['WhatsappInteractionId']=_0x45d340['id'];if(_0x52654c[_0x1a26('0x3f')][_0x1a26('0x87')]){_0x4af8bc[_0x1a26('0x4a')]=_['merge'](_0x4af8bc[_0x1a26('0x4a')],{'$or':_[_0x1a26('0x32')](_0x4af8bc[_0x1a26('0x42')],function(_0x107d30){var _0x39aa77={};_0x39aa77[_0x107d30]={'$like':'%'+_0x52654c[_0x1a26('0x3f')][_0x1a26('0x87')]+'%'};return _0x39aa77;})});}if(_0x52654c['query']['$gte']){var _0x990dd0=_0x52654c[_0x1a26('0x3f')][_0x1a26('0xc4')][_0x1a26('0x35')](',');var _0x4656bc={};_0x4656bc[_0x990dd0[0x0]]={'$gte':moment(_0x990dd0[0x1])[_0x1a26('0xc5')](_0x1a26('0xc6'))};_0x4af8bc['where']=_[_0x1a26('0xa2')](_0x4af8bc[_0x1a26('0x4a')],_0x4656bc);}_0x4af8bc=_['merge']({},_0x4af8bc,_0x52654c[_0x1a26('0xbc')]);return db[_0x1a26('0xc1')][_0x1a26('0x24')]({'where':_0x4af8bc['where']})[_0x1a26('0x2b')](function(_0x19695b){_0x2def94[_0x1a26('0x24')]=_0x19695b;if(_0x52654c[_0x1a26('0x3f')]['includeAll']){_0x4af8bc[_0x1a26('0xbb')]=[{'all':!![]}];}return db[_0x1a26('0xc1')][_0x1a26('0xc7')](_0x4af8bc);})[_0x1a26('0x2b')](function(_0x25458c){_0x2def94[_0x1a26('0xc8')]=_0x25458c;return _0x2def94;});}})[_0x1a26('0x2b')](respondWithFilteredResult(_0x318eda,_0x4af8bc))[_0x1a26('0xb7')](handleError(_0x318eda,null));};exports[_0x1a26('0xc9')]=function(_0x5cdc00,_0x58dcad,_0x2607bc){return db[_0x1a26('0x3a')][_0x1a26('0x64')]({'where':{'id':_0x5cdc00[_0x1a26('0xb9')]['id']}})[_0x1a26('0x2b')](handleEntityNotFound(_0x58dcad,null))[_0x1a26('0x2b')](function(_0x2e0156){if(_0x2e0156){return _0x2e0156[_0x1a26('0xca')](_0x5cdc00[_0x1a26('0xbe')]['ids'],_['omit'](_0x5cdc00[_0x1a26('0xbe')],[_0x1a26('0xcb'),'id'])||{})['spread'](function(){return db[_0x1a26('0x70')]['findAll']({'attributes':['id',_0x1a26('0x2f'),_0x1a26('0x4c')],'where':{'id':_0x5cdc00[_0x1a26('0xbe')][_0x1a26('0xcb')]}});})['then'](function(_0x683f38){socket['emit'](_0x1a26('0xcc'),{'id':Number(_0x5cdc00[_0x1a26('0xb9')]['id']),'tags':_0x683f38||[]});return{'id':Number(_0x5cdc00['params']['id']),'tags':_0x683f38||[]};});}})[_0x1a26('0x2b')](respondWithResult(_0x58dcad,null))[_0x1a26('0xb7')](handleError(_0x58dcad,null));};exports[_0x1a26('0xcd')]=function(_0x34804d,_0x5cd016,_0x3b8b27){return db[_0x1a26('0x3a')][_0x1a26('0x64')]({'where':{'id':_0x34804d['params']['id']}})[_0x1a26('0x2b')](handleEntityNotFound(_0x5cd016,null))[_0x1a26('0x2b')](function(_0x505450){if(_0x505450){return _0x505450[_0x1a26('0xcd')](_0x34804d['query']['ids']);}})['then'](respondWithStatusCode(_0x5cd016,null))[_0x1a26('0xb7')](handleError(_0x5cd016,null));};exports[_0x1a26('0xce')]=function(_0x29611b,_0x3771d5){var _0x4eefe7=moment()[_0x1a26('0xcf')]()[_0x1a26('0xa0')]();var _0x1eb3d0=path[_0x1a26('0xd0')](config[_0x1a26('0xd1')],_0x1a26('0xd2'),_0x1a26('0xd3'),_0x1a26('0xd4'));var _0x491e4f=path[_0x1a26('0xd0')](config['root'],_0x1a26('0xd2'),_0x1a26('0xd3'),_0x1a26('0xd5'));var _0x1f273f=path[_0x1a26('0xd0')](_0x1eb3d0,_0x4eefe7);var _0x233369=util[_0x1a26('0xc5')](_0x1a26('0xd6'),_0x29611b[_0x1a26('0xb9')]['id'],_0x4eefe7);var _0x5d10b5=path[_0x1a26('0xd0')](_0x1eb3d0,_0x233369);var _0x520764=[];_0x520764[_0x1a26('0x38')]({'model':db['User'],'as':_0x1a26('0x73'),'attributes':['id',_0x1a26('0x33')],'raw':!![]});_0x520764['push']({'model':db[_0x1a26('0xd7')],'as':_0x1a26('0x67'),'attributes':['id',_0x1a26('0xd8'),_0x1a26('0xd9')],'raw':!![]});if(_0x29611b[_0x1a26('0x3f')][_0x1a26('0xd5')]){_0x520764[_0x1a26('0x38')]({'model':db[_0x1a26('0xda')],'as':_0x1a26('0xda'),'raw':!![]});}var _0x80d695=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id','body',_0x1a26('0x7b'),_0x1a26('0xdb'),_0x1a26('0xdc'),_0x1a26('0x82')],'include':_0x520764}];_0x80d695[_0x1a26('0x38')]({'model':db[_0x1a26('0xdd')],'as':_0x1a26('0xde'),'attributes':['id',_0x1a26('0x2f')]});_0x80d695[_0x1a26('0x38')]({'model':db['User'],'as':_0x1a26('0xdf'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x1a26('0x64')]({'where':{'id':_0x29611b[_0x1a26('0xb9')]['id']},'include':_0x80d695})[_0x1a26('0x2b')](handleEntityNotFound(_0x3771d5,null))[_0x1a26('0x2b')](function(_0x406f3e){if(_0x406f3e){var _0x496737=_0x406f3e[_0x1a26('0xe0')]({'plain':!![]});fs[_0x1a26('0xe1')](_0x1f273f);var _0x5471fe={'channel':'Whatsapp','account':_0x496737[_0x1a26('0xde')][_0x1a26('0x2f')],'agent':_0x496737[_0x1a26('0xdf')]?_0x496737[_0x1a26('0xdf')][_0x1a26('0x33')]:'N.A.','createdAt':moment(_0x496737[_0x1a26('0x7b')])[_0x1a26('0xc5')](_0x1a26('0xc6'))[_0x1a26('0xa0')](),'closedAt':_0x496737['closed']?moment(_0x496737[_0x1a26('0xe2')])[_0x1a26('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x496737[_0x1a26('0xe3')],'messages':_(_0x496737[_0x1a26('0xe4')])['filter']({'secret':![]})['map'](function(_0x301d83){if(_0x301d83[_0x1a26('0xda')]){var _0x4f0d1e=path[_0x1a26('0xd0')](_0x491e4f,_0x301d83[_0x1a26('0xda')][_0x1a26('0xe5')]);if(fs['existsSync'](_0x4f0d1e)){fs[_0x1a26('0xe6')](_0x4f0d1e)[_0x1a26('0xe7')](fs[_0x1a26('0xe8')](path[_0x1a26('0xd0')](_0x1f273f,_0x301d83[_0x1a26('0xda')][_0x1a26('0xe5')])));}}return{'date':moment(_0x301d83[_0x1a26('0x7b')])['format'](_0x1a26('0xc6'))['toString'](),'sender':_0x301d83[_0x1a26('0xdb')]==='out'?_0x301d83[_0x1a26('0x73')]?_0x301d83[_0x1a26('0x73')][_0x1a26('0x33')]:'System':_0x301d83[_0x1a26('0x67')][_0x1a26('0xd8')]+(_0x301d83[_0x1a26('0x67')][_0x1a26('0xd9')]?'\x20'+_0x301d83[_0x1a26('0x67')][_0x1a26('0xd9')]:''),'body':_0x301d83[_0x1a26('0xda')]?_0x301d83[_0x1a26('0xda')][_0x1a26('0xe5')]:_0x301d83['body'],'direction':_0x301d83[_0x1a26('0xdb')]===_0x1a26('0xe9')?'A':'C','secret':_0x301d83[_0x1a26('0xdc')],'read':_0x301d83['read'],'attachment':_0x301d83['Attachment']};})[_0x1a26('0x65')]()};return ejs[_0x1a26('0xea')](path['join'](config[_0x1a26('0xd1')],'server',_0x1a26('0xeb'),_0x1a26('0xec')),{'interaction':_0x5471fe})[_0x1a26('0x2b')](function(_0x565668){var _0x2b18e8=path[_0x1a26('0xd0')](_0x1f273f,_0x1a26('0xed')+_0x496737['id']+'-'+_0x4eefe7+'.pdf');var _0x3689af={'path':_0x2b18e8,'channel':'Whatsapp','interactionId':_0x496737['id']};return pdf[_0x1a26('0xee')](_0x565668,_0x3689af);})[_0x1a26('0x2b')](function(){return new BPromise(function(_0x506321,_0x4538db){zipdir(_0x1f273f,{'saveTo':_0x5d10b5},function(_0x474872,_0x2c5ac9){if(_0x474872)return _0x4538db(_0x474872);return _0x506321(_0x2c5ac9);});})['then'](function(){return new BPromise(function(_0x50bfc1,_0x13445c){rimraf(_0x1f273f,function(_0x23d255){if(_0x23d255)_0x13445c(_0x23d255);return _0x50bfc1();});});})['then'](function(){return _0x3771d5[_0x1a26('0xce')](_0x5d10b5,_0x233369,function(_0x25ba21){if(_0x25ba21){console['log']('err',_0x25ba21);}else{fs['unlinkSync'](_0x5d10b5);}});});});}else{return _0x3771d5[_0x1a26('0x1e')](0xc8);}})['catch'](handleError(_0x3771d5,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4763e69..f698bbb 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 _0x3f19=['emit','catch','hasOwnProperty','hook','exports','events','WhatsappMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x421a2e,_0x450fc4){var _0x204e61=function(_0x1f6334){while(--_0x1f6334){_0x421a2e['push'](_0x421a2e['shift']());}};_0x204e61(++_0x450fc4);}(_0x3f19,0xc0));var _0x93f1=function(_0x4bf27a,_0x435cc2){_0x4bf27a=_0x4bf27a-0x0;var _0x22a0ba=_0x3f19[_0x4bf27a];return _0x22a0ba;};'use strict';var EventEmitter=require(_0x93f1('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x93f1('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93f1('0x2'),'afterUpdate':_0x93f1('0x3'),'afterDestroy':_0x93f1('0x4')};function emitEvent(_0x2057aa){return function(_0x5dbfbc,_0x1ca333,_0x522769){_0x5dbfbc[_0x93f1('0x5')]({'attributes':['id'],'raw':!![]})[_0x93f1('0x6')](function(_0x171bf6){_0x5dbfbc[_0x93f1('0x7')]('Users',_0x171bf6[_0x93f1('0x8')](function(_0xf3d309){return{'id':_0xf3d309['id']};}));return WhatsappMessage[_0x93f1('0x9')]({'where':{'WhatsappInteractionId':_0x5dbfbc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x93f1('0x6')](function(_0xfe4f0){_0x5dbfbc['setDataValue'](_0x93f1('0xa'),_0xfe4f0[_0x93f1('0xb')]);WhatsappInteractionEvents[_0x93f1('0xc')](_0x2057aa+':'+_0x5dbfbc['id'],_0x5dbfbc);WhatsappInteractionEvents[_0x93f1('0xc')](_0x2057aa,_0x5dbfbc);_0x522769(null);})[_0x93f1('0xd')](_0x522769(null));};}for(var e in events){if(events[_0x93f1('0xe')](e)){var event=events[e];WhatsappInteraction[_0x93f1('0xf')](e,emitEvent(event));}}module[_0x93f1('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x263f=['update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners'];(function(_0x151eb6,_0x304528){var _0x125adc=function(_0x2dab7f){while(--_0x2dab7f){_0x151eb6['push'](_0x151eb6['shift']());}};_0x125adc(++_0x304528);}(_0x263f,0x182));var _0xf263=function(_0xb8548d,_0x1e5cb4){_0xb8548d=_0xb8548d-0x0;var _0x655ada=_0x263f[_0xb8548d];return _0x655ada;};'use strict';var EventEmitter=require(_0xf263('0x0'));var WhatsappInteraction=require(_0xf263('0x1'))['db'][_0xf263('0x2')];var WhatsappMessage=require(_0xf263('0x1'))['db'][_0xf263('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xf263('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf263('0x5'),'afterDestroy':_0xf263('0x6')};function emitEvent(_0x453b6e){return function(_0x528b98,_0xbd1369,_0xdb2fc1){_0x528b98['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xa2b1b0){_0x528b98[_0xf263('0x7')](_0xf263('0x8'),_0xa2b1b0[_0xf263('0x9')](function(_0x5dcaa0){return{'id':_0x5dcaa0['id']};}));return WhatsappMessage[_0xf263('0xa')]({'where':{'WhatsappInteractionId':_0x528b98['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf263('0xb')](function(_0x3d8092){_0x528b98[_0xf263('0x7')](_0xf263('0xc'),_0x3d8092[_0xf263('0xd')]);WhatsappInteractionEvents[_0xf263('0xe')](_0x453b6e+':'+_0x528b98['id'],_0x528b98);WhatsappInteractionEvents['emit'](_0x453b6e,_0x528b98);_0xdb2fc1(null);})[_0xf263('0xf')](_0xdb2fc1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xf263('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 232d486..be5773e 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 _0xa1c9=['request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x161aa7,_0x15506c){var _0x2aa45e=function(_0x5f4e14){while(--_0x5f4e14){_0x161aa7['push'](_0x161aa7['shift']());}};_0x2aa45e(++_0x15506c);}(_0xa1c9,0x135));var _0x9a1c=function(_0x271571,_0x4737a8){_0x271571=_0x271571-0x0;var _0x30fde9=_0xa1c9[_0x271571];return _0x30fde9;};'use strict';var _=require(_0x9a1c('0x0'));var util=require(_0x9a1c('0x1'));var logger=require(_0x9a1c('0x2'))(_0x9a1c('0x3'));var moment=require(_0x9a1c('0x4'));var BPromise=require(_0x9a1c('0x5'));var rp=require(_0x9a1c('0x6'));var fs=require('fs');var path=require(_0x9a1c('0x7'));var rimraf=require(_0x9a1c('0x8'));var config=require('../../config/environment');var attributes=require(_0x9a1c('0x9'));module[_0x9a1c('0xa')]=function(_0x176efb,_0x304592){return _0x176efb[_0x9a1c('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x9a1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x98387f,_0x586994,_0x564d86){if(_0x98387f['changed']('closed')){_0x98387f[_0x9a1c('0xd')]=moment()[_0x9a1c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x564d86(null,_0x98387f);}}});}; \ No newline at end of file +var _0x68c7=['request-promise','path','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x1f53ce,_0x3abe28){var _0x5427b6=function(_0x12db5b){while(--_0x12db5b){_0x1f53ce['push'](_0x1f53ce['shift']());}};_0x5427b6(++_0x3abe28);}(_0x68c7,0x16a));var _0x768c=function(_0x4e5625,_0x1307c7){_0x4e5625=_0x4e5625-0x0;var _0x289cc5=_0x68c7[_0x4e5625];return _0x289cc5;};'use strict';var _=require(_0x768c('0x0'));var util=require(_0x768c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x768c('0x2'));var fs=require('fs');var path=require(_0x768c('0x3'));var rimraf=require(_0x768c('0x4'));var config=require('../../config/environment');var attributes=require(_0x768c('0x5'));module[_0x768c('0x6')]=function(_0x1a33c9,_0x58390c){return _0x1a33c9['define'](_0x768c('0x7'),attributes,{'tableName':_0x768c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e7610,_0x3858e6,_0x23f8c6){if(_0x5e7610[_0x768c('0x9')](_0x768c('0xa'))){_0x5e7610[_0x768c('0xb')]=moment()[_0x768c('0xc')](_0x768c('0xd'));}_0x23f8c6(null,_0x5e7610);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index bd6bdb2..6ceacae 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 _0x4249=['request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappInteraction','update','body','options','raw','where','limit','UpdateWhatsappInteraction','find','then','addTags','ids','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./whatsappInteraction.socket','register'];(function(_0x478b2e,_0x4ccf6e){var _0x50304c=function(_0x3bdb59){while(--_0x3bdb59){_0x478b2e['push'](_0x478b2e['shift']());}};_0x50304c(++_0x4ccf6e);}(_0x4249,0x159));var _0x9424=function(_0x417b15,_0x2a713d){_0x417b15=_0x417b15-0x0;var _0x475bda=_0x4249[_0x417b15];return _0x475bda;};'use strict';var _=require(_0x9424('0x0'));var util=require(_0x9424('0x1'));var moment=require('moment');var BPromise=require(_0x9424('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9424('0x3'))['db'];var utils=require(_0x9424('0x4'));var logger=require(_0x9424('0x5'))(_0x9424('0x6'));var config=require(_0x9424('0x7'));var jayson=require(_0x9424('0x8'));var client=jayson[_0x9424('0x9')][_0x9424('0xa')]({'port':0x232a});config['redis']=_[_0x9424('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9424('0xc')]));require(_0x9424('0xd'))[_0x9424('0xe')](socket);function respondWithRpcPromise(_0x567f33,_0x5d6044,_0x5c02ba){return new BPromise(function(_0x38b24a,_0x3ae8e0){return client[_0x9424('0xf')](_0x567f33,_0x5c02ba)['then'](function(_0x2782fe){logger[_0x9424('0x10')](_0x9424('0x11'),_0x5d6044,_0x9424('0x12'));logger[_0x9424('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5d6044,_0x9424('0x12'),JSON[_0x9424('0x14')](_0x2782fe));if(_0x2782fe[_0x9424('0x15')]){if(_0x2782fe[_0x9424('0x15')][_0x9424('0x16')]===0x1f4){logger[_0x9424('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x5d6044,_0x2782fe['error']['message']);return _0x3ae8e0(_0x2782fe[_0x9424('0x15')][_0x9424('0x17')]);}logger[_0x9424('0x15')](_0x9424('0x11'),_0x5d6044,_0x2782fe[_0x9424('0x15')][_0x9424('0x17')]);return _0x38b24a(_0x2782fe[_0x9424('0x15')][_0x9424('0x17')]);}else{logger[_0x9424('0x10')](_0x9424('0x11'),_0x5d6044,_0x9424('0x12'));_0x38b24a(_0x2782fe[_0x9424('0x18')][_0x9424('0x17')]);}})[_0x9424('0x19')](function(_0x51a82b){logger[_0x9424('0x15')](_0x9424('0x11'),_0x5d6044,_0x51a82b);_0x3ae8e0(_0x51a82b);});});}exports['UpdateWhatsappInteraction']=function(_0xd2a54b){var _0x1bd8c6=this;return new Promise(function(_0x418266,_0xd42691){return db[_0x9424('0x1a')][_0x9424('0x1b')](_0xd2a54b[_0x9424('0x1c')],{'raw':_0xd2a54b[_0x9424('0x1d')]?_0xd2a54b['options'][_0x9424('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd2a54b['options']?_0xd2a54b[_0x9424('0x1d')][_0x9424('0x1f')]||null:null,'attributes':_0xd2a54b[_0x9424('0x1d')]?_0xd2a54b[_0x9424('0x1d')]['attributes']||null:null,'limit':_0xd2a54b['options']?_0xd2a54b[_0x9424('0x1d')][_0x9424('0x20')]||null:null})['then'](function(_0x1ed8c6){logger[_0x9424('0x10')](_0x9424('0x21'),_0xd2a54b);logger['debug']('UpdateWhatsappInteraction',_0xd2a54b,JSON[_0x9424('0x14')](_0x1ed8c6));_0x418266(_0x1ed8c6);})[_0x9424('0x19')](function(_0x42b6bc){logger[_0x9424('0x15')]('UpdateWhatsappInteraction',_0x42b6bc[_0x9424('0x17')],_0xd2a54b);_0xd42691(_0x1bd8c6[_0x9424('0x15')](0x1f4,_0x42b6bc['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x76aae8){return new Promise(function(_0x39f267,_0x170545){return db['WhatsappInteraction'][_0x9424('0x22')]({'where':_0x76aae8['options']?_0x76aae8[_0x9424('0x1d')][_0x9424('0x1f')]||null:null})[_0x9424('0x23')](function(_0x3bc357){if(_0x3bc357){return _0x3bc357[_0x9424('0x24')](_0x76aae8[_0x9424('0x1c')]['ids'],_['omit'](_0x76aae8['body'],[_0x9424('0x25'),'id'])||{});}})[_0x9424('0x26')](function(_0x203ead){logger[_0x9424('0x10')](_0x9424('0x27'),_0x76aae8);logger[_0x9424('0x13')](_0x9424('0x27'),_0x76aae8,JSON[_0x9424('0x14')](_0x203ead));_0x39f267(_0x203ead);})[_0x9424('0x19')](function(_0x208510){logger[_0x9424('0x15')]('AddTags',_0x208510[_0x9424('0x17')],_0x76aae8);_0x170545(_this[_0x9424('0x15')](0x1f4,_0x208510[_0x9424('0x17')]));});});}; \ No newline at end of file +var _0x73ea=['request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','WhatsappInteraction','update','options','raw','attributes','limit','UpdateWhatsappInteraction','catch','find','where','addTags','body','ids','spread','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket'];(function(_0x1cb8ac,_0x573097){var _0x834ed5=function(_0x479426){while(--_0x479426){_0x1cb8ac['push'](_0x1cb8ac['shift']());}};_0x834ed5(++_0x573097);}(_0x73ea,0x1dd));var _0xa73e=function(_0x401535,_0x2a4675){_0x401535=_0x401535-0x0;var _0x32d11c=_0x73ea[_0x401535];return _0x32d11c;};'use strict';var _=require('lodash');var util=require(_0xa73e('0x0'));var moment=require('moment');var BPromise=require(_0xa73e('0x1'));var rs=require(_0xa73e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa73e('0x3'))['db'];var utils=require(_0xa73e('0x4'));var logger=require('../../config/logger')(_0xa73e('0x5'));var config=require(_0xa73e('0x6'));var jayson=require(_0xa73e('0x7'));var client=jayson[_0xa73e('0x8')][_0xa73e('0x9')]({'port':0x232a});config[_0xa73e('0xa')]=_[_0xa73e('0xb')](config[_0xa73e('0xa')],{'host':_0xa73e('0xc'),'port':0x18eb});var socket=require(_0xa73e('0xd'))(new Redis(config['redis']));require(_0xa73e('0xe'))['register'](socket);function respondWithRpcPromise(_0x54606b,_0x172d0d,_0x3b862a){return new BPromise(function(_0xc3d362,_0x4ad5c0){return client[_0xa73e('0xf')](_0x54606b,_0x3b862a)[_0xa73e('0x10')](function(_0x30f3df){logger[_0xa73e('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x172d0d,_0xa73e('0x12'));logger[_0xa73e('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x172d0d,_0xa73e('0x12'),JSON[_0xa73e('0x14')](_0x30f3df));if(_0x30f3df['error']){if(_0x30f3df[_0xa73e('0x15')][_0xa73e('0x16')]===0x1f4){logger[_0xa73e('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x172d0d,_0x30f3df['error'][_0xa73e('0x17')]);return _0x4ad5c0(_0x30f3df[_0xa73e('0x15')][_0xa73e('0x17')]);}logger[_0xa73e('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x172d0d,_0x30f3df[_0xa73e('0x15')][_0xa73e('0x17')]);return _0xc3d362(_0x30f3df['error'][_0xa73e('0x17')]);}else{logger['info'](_0xa73e('0x18'),_0x172d0d,_0xa73e('0x12'));_0xc3d362(_0x30f3df[_0xa73e('0x19')]['message']);}})['catch'](function(_0x59fa31){logger['error'](_0xa73e('0x18'),_0x172d0d,_0x59fa31);_0x4ad5c0(_0x59fa31);});});}exports['UpdateWhatsappInteraction']=function(_0x3c7ef2){var _0x239a3b=this;return new Promise(function(_0x29f01c,_0x2bf080){return db[_0xa73e('0x1a')][_0xa73e('0x1b')](_0x3c7ef2['body'],{'raw':_0x3c7ef2[_0xa73e('0x1c')]?_0x3c7ef2[_0xa73e('0x1c')][_0xa73e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c7ef2['options']?_0x3c7ef2[_0xa73e('0x1c')]['where']||null:null,'attributes':_0x3c7ef2['options']?_0x3c7ef2['options'][_0xa73e('0x1e')]||null:null,'limit':_0x3c7ef2[_0xa73e('0x1c')]?_0x3c7ef2[_0xa73e('0x1c')][_0xa73e('0x1f')]||null:null})[_0xa73e('0x10')](function(_0x3ea35a){logger['info'](_0xa73e('0x20'),_0x3c7ef2);logger['debug'](_0xa73e('0x20'),_0x3c7ef2,JSON[_0xa73e('0x14')](_0x3ea35a));_0x29f01c(_0x3ea35a);})[_0xa73e('0x21')](function(_0x3d4455){logger[_0xa73e('0x15')](_0xa73e('0x20'),_0x3d4455[_0xa73e('0x17')],_0x3c7ef2);_0x2bf080(_0x239a3b[_0xa73e('0x15')](0x1f4,_0x3d4455[_0xa73e('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x285bd2){return new Promise(function(_0x5d3b46,_0x3b654f){return db[_0xa73e('0x1a')][_0xa73e('0x22')]({'where':_0x285bd2[_0xa73e('0x1c')]?_0x285bd2[_0xa73e('0x1c')][_0xa73e('0x23')]||null:null})[_0xa73e('0x10')](function(_0x136991){if(_0x136991){return _0x136991[_0xa73e('0x24')](_0x285bd2[_0xa73e('0x25')][_0xa73e('0x26')],_['omit'](_0x285bd2['body'],[_0xa73e('0x26'),'id'])||{});}})[_0xa73e('0x27')](function(_0x527f4e){logger[_0xa73e('0x11')](_0xa73e('0x28'),_0x285bd2);logger[_0xa73e('0x13')](_0xa73e('0x28'),_0x285bd2,JSON[_0xa73e('0x14')](_0x527f4e));_0x5d3b46(_0x527f4e);})['catch'](function(_0x4e35c1){logger[_0xa73e('0x15')](_0xa73e('0x28'),_0x4e35c1[_0xa73e('0x17')],_0x285bd2);_0x3b654f(_this[_0xa73e('0x15')](0x1f4,_0x4e35c1[_0xa73e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index f06d121..4544fc5 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 _0xd7e6=['emit','removeListener','register','length','update'];(function(_0x21c69c,_0x1b7535){var _0x2acd03=function(_0x4c70f0){while(--_0x4c70f0){_0x21c69c['push'](_0x21c69c['shift']());}};_0x2acd03(++_0x1b7535);}(_0xd7e6,0xae));var _0x6d7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7e6[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0x6d7e('0x0')];function createListener(_0x27bfcd,_0x50dda6){return function(_0x20d96d){_0x50dda6[_0x6d7e('0x1')](_0x27bfcd,_0x20d96d);};}function removeListener(_0x242a4c,_0x5a260c){return function(){WhatsappInteractionEvents[_0x6d7e('0x2')](_0x242a4c,_0x5a260c);};}exports[_0x6d7e('0x3')]=function(_0x1bf105){for(var _0x45b029=0x0,_0x4fe389=events[_0x6d7e('0x4')];_0x45b029<_0x4fe389;_0x45b029++){var _0x5a466c=events[_0x45b029];var _0x248bf9=createListener('whatsappInteraction:'+_0x5a466c,_0x1bf105);WhatsappInteractionEvents['on'](_0x5a466c,_0x248bf9);}}; \ No newline at end of file +var _0xfc44=['emit','removeListener','register','length','./whatsappInteraction.events','remove','update'];(function(_0x20384b,_0x3a307c){var _0x19fe0a=function(_0x5c9962){while(--_0x5c9962){_0x20384b['push'](_0x20384b['shift']());}};_0x19fe0a(++_0x3a307c);}(_0xfc44,0xc8));var _0x4fc4=function(_0x3e3763,_0x410302){_0x3e3763=_0x3e3763-0x0;var _0x316b37=_0xfc44[_0x3e3763];return _0x316b37;};'use strict';var WhatsappInteractionEvents=require(_0x4fc4('0x0'));var events=['save',_0x4fc4('0x1'),_0x4fc4('0x2')];function createListener(_0x28fa56,_0x1cbbeb){return function(_0x53c939){_0x1cbbeb[_0x4fc4('0x3')](_0x28fa56,_0x53c939);};}function removeListener(_0x4682c0,_0x192dbd){return function(){WhatsappInteractionEvents[_0x4fc4('0x4')](_0x4682c0,_0x192dbd);};}exports[_0x4fc4('0x5')]=function(_0xd55f2d){for(var _0x4fafbd=0x0,_0x1b0fa8=events[_0x4fc4('0x6')];_0x4fafbd<_0x1b0fa8;_0x4fafbd++){var _0x33a8ed=events[_0x4fafbd];var _0x2e8e99=createListener('whatsappInteraction:'+_0x33a8ed,_0xd55f2d);WhatsappInteractionEvents['on'](_0x33a8ed,_0x2e8e99);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f8f4d32..d523944 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 _0x6b78=['create','/:id/status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/:id','show','post','whatsappmessage:create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b78,0x144));var _0x86b7=function(_0x3e044e,_0x549364){_0x3e044e=_0x3e044e-0x0;var _0x3acfa3=_0x6b78[_0x3e044e];return _0x3acfa3;};'use strict';var multer=require(_0x86b7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x86b7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86b7('0x2'));var interaction=require(_0x86b7('0x3'));var config=require('../../config/environment');var controller=require(_0x86b7('0x4'));router[_0x86b7('0x5')]('/',auth[_0x86b7('0x6')](),controller[_0x86b7('0x7')]);router[_0x86b7('0x5')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x86b7('0x5')](_0x86b7('0x8'),auth[_0x86b7('0x6')](),controller[_0x86b7('0x9')]);router[_0x86b7('0xa')]('/',auth[_0x86b7('0x6')](),interaction['tracked']('whatsapp',_0x86b7('0xb')),controller[_0x86b7('0xc')]);router['post'](_0x86b7('0xd'),controller['status']);router[_0x86b7('0xe')](_0x86b7('0x8'),auth['isAuthenticated'](),controller[_0x86b7('0xf')]);router[_0x86b7('0xe')](_0x86b7('0x10'),auth[_0x86b7('0x6')](),controller['accept']);router[_0x86b7('0xe')](_0x86b7('0x11'),auth[_0x86b7('0x6')](),controller[_0x86b7('0x12')]);router[_0x86b7('0x13')]('/:id',auth[_0x86b7('0x6')](),controller[_0x86b7('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdae4=['show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdae4,0xdb));var _0x4dae=function(_0x5aadfc,_0x3f2c74){_0x5aadfc=_0x5aadfc-0x0;var _0x473e6d=_0xdae4[_0x5aadfc];return _0x473e6d;};'use strict';var multer=require(_0x4dae('0x0'));var util=require('util');var path=require(_0x4dae('0x1'));var timeout=require(_0x4dae('0x2'));var express=require(_0x4dae('0x3'));var router=express[_0x4dae('0x4')]();var fs_extra=require(_0x4dae('0x5'));var auth=require(_0x4dae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4dae('0x7'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0x4dae('0x8')](),controller['index']);router[_0x4dae('0x9')](_0x4dae('0xa'),auth['isAuthenticated'](),controller[_0x4dae('0xb')]);router[_0x4dae('0x9')](_0x4dae('0xc'),auth[_0x4dae('0x8')](),controller[_0x4dae('0xd')]);router[_0x4dae('0xe')]('/',auth[_0x4dae('0x8')](),interaction[_0x4dae('0xf')](_0x4dae('0x10'),_0x4dae('0x11')),controller[_0x4dae('0x12')]);router[_0x4dae('0xe')](_0x4dae('0x13'),controller[_0x4dae('0x14')]);router[_0x4dae('0x15')]('/:id',auth[_0x4dae('0x8')](),controller[_0x4dae('0x16')]);router[_0x4dae('0x15')](_0x4dae('0x17'),auth[_0x4dae('0x8')](),controller[_0x4dae('0x18')]);router[_0x4dae('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0x4dae('0x19')]);router[_0x4dae('0x1a')](_0x4dae('0xc'),auth[_0x4dae('0x8')](),controller[_0x4dae('0x1b')]);module[_0x4dae('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 37faf58..b39a713 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 _0xc1bf=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x5cb5b1,_0xafc0d6){var _0x22d423=function(_0x1c60c1){while(--_0x1c60c1){_0x5cb5b1['push'](_0x5cb5b1['shift']());}};_0x22d423(++_0xafc0d6);}(_0xc1bf,0x79));var _0xfc1b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc1bf[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xfc1b('0x0'));module[_0xfc1b('0x1')]={'body':{'type':Sequelize[_0xfc1b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfc1b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfc1b('0x4')]('in',_0xfc1b('0x5')),'defaultValue':_0xfc1b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfc1b('0x6')](0xbe)},'phone':{'type':Sequelize[_0xfc1b('0x6')]},'readAt':{'type':Sequelize[_0xfc1b('0x7')]},'secret':{'type':Sequelize[_0xfc1b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfc1b('0x6')]},'providerResponse':{'type':Sequelize[_0xfc1b('0x2')]}}; \ No newline at end of file +var _0xa83f=['out','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0x45f7c9,_0x192a73){var _0x2c6810=function(_0xddb463){while(--_0xddb463){_0x45f7c9['push'](_0x45f7c9['shift']());}};_0x2c6810(++_0x192a73);}(_0xa83f,0xf8));var _0xfa83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa83f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfa83('0x0'));module['exports']={'body':{'type':Sequelize[_0xfa83('0x1')](_0xfa83('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfa83('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xfa83('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfa83('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xfa83('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfa83('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index eb994f8..69d2326 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 _0x0db9=['channel','EventManager','acceptmessage','whatsapp','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','inspect','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','options','WhatsappMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','whatsapp-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x0db9,0xa3));var _0x90db=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0x0db9[_0x623e7];return _0x121131;};'use strict';var emlformat=require(_0x90db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x90db('0x1'));var moment=require(_0x90db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90db('0x3'));var util=require('util');var path=require(_0x90db('0x4'));var sox=require(_0x90db('0x5'));var csv=require('to-csv');var ejs=require(_0x90db('0x6'));var fs=require('fs');var fs_extra=require(_0x90db('0x7'));var _=require(_0x90db('0x8'));var squel=require(_0x90db('0x9'));var crypto=require(_0x90db('0xa'));var jsforce=require(_0x90db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x90db('0xc'));var querystring=require(_0x90db('0xd'));var Papa=require(_0x90db('0xe'));var Redis=require(_0x90db('0xf'));var authService=require(_0x90db('0x10'));var qs=require(_0x90db('0x11'));var as=require(_0x90db('0x12'));var hardwareService=require(_0x90db('0x13'));var logger=require(_0x90db('0x14'))(_0x90db('0x15'));var utils=require(_0x90db('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90db('0x17'));var db=require(_0x90db('0x18'))['db'];config[_0x90db('0x19')]=_[_0x90db('0x1a')](config[_0x90db('0x19')],{'host':_0x90db('0x1b'),'port':0x18eb});var socket=require(_0x90db('0x1c'))(new Redis(config[_0x90db('0x19')]));require(_0x90db('0x1d'))[_0x90db('0x1e')](socket);var jayson=require(_0x90db('0x1f'));var client=jayson[_0x90db('0x20')][_0x90db('0x21')]({'port':0x232c});var client9002=jayson[_0x90db('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3124d4,_0x5ef456,_0x101a71,_0x266c19){return new BPromise(function(_0x3de860,_0x1bbb97){var _0x32ff04=_0x266c19||client;return _0x32ff04[_0x90db('0x22')](_0x3124d4,_0x101a71)[_0x90db('0x23')](function(_0x43f40b){logger[_0x90db('0x24')](_0x90db('0x25'),_0x5ef456,'request\x20sent');logger[_0x90db('0x26')](_0x90db('0x27'),_0x5ef456,'request\x20sent',JSON['stringify'](_0x43f40b));if(_0x43f40b[_0x90db('0x28')]){if(_0x43f40b[_0x90db('0x28')][_0x90db('0x29')]===0x1f4){logger[_0x90db('0x28')](_0x90db('0x25'),_0x5ef456,_0x43f40b[_0x90db('0x28')][_0x90db('0x2a')]);return _0x1bbb97(_0x43f40b['error'][_0x90db('0x2a')]);}logger[_0x90db('0x28')](_0x90db('0x25'),_0x5ef456,_0x43f40b[_0x90db('0x28')]['message']);return _0x3de860(_0x43f40b[_0x90db('0x28')]['message']);}else{logger[_0x90db('0x24')](_0x90db('0x25'),_0x5ef456,'request\x20sent');_0x3de860(_0x43f40b[_0x90db('0x2b')][_0x90db('0x2a')]);}})['catch'](function(_0x2f8469){logger[_0x90db('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x5ef456,_0x2f8469);_0x1bbb97(_0x2f8469);});});}function respondWithStatusCode(_0x1f02a6,_0xe026cf){_0xe026cf=_0xe026cf||0xcc;return function(_0x1cc660){if(_0x1cc660){return _0x1f02a6[_0x90db('0x2c')](_0xe026cf);}return _0x1f02a6['status'](_0xe026cf)[_0x90db('0x2d')]();};}function respondWithResult(_0x3e6200,_0x60439d){_0x60439d=_0x60439d||0xc8;return function(_0x27bd58){if(_0x27bd58){return _0x3e6200[_0x90db('0x2e')](_0x60439d)[_0x90db('0x2f')](_0x27bd58);}};}function respondWithFilteredResult(_0x44b5b6,_0x3c7f67){return function(_0x4c6311){if(_0x4c6311){var _0x3489d1=typeof _0x3c7f67['offset']===_0x90db('0x30')&&typeof _0x3c7f67[_0x90db('0x31')]==='undefined';var _0x116635=_0x4c6311[_0x90db('0x32')];var _0x2e9235=_0x3489d1?0x0:_0x3c7f67[_0x90db('0x33')];var _0x4c3dfa=_0x3489d1?_0x4c6311[_0x90db('0x32')]:_0x3c7f67[_0x90db('0x33')]+_0x3c7f67[_0x90db('0x31')];var _0x5ebe85;if(_0x4c3dfa>=_0x116635){_0x4c3dfa=_0x116635;_0x5ebe85=0xc8;}else{_0x5ebe85=0xce;}_0x44b5b6['status'](_0x5ebe85);return _0x44b5b6[_0x90db('0x34')](_0x90db('0x35'),_0x2e9235+'-'+_0x4c3dfa+'/'+_0x116635)[_0x90db('0x2f')](_0x4c6311);}return null;};}function patchUpdates(_0x4b3e47){return function(_0x418df9){try{jsonpatch[_0x90db('0x36')](_0x418df9,_0x4b3e47,!![]);}catch(_0x5322e4){return BPromise[_0x90db('0x37')](_0x5322e4);}return _0x418df9[_0x90db('0x38')]();};}function saveUpdates(_0x53b0a6,_0x21078f){return function(_0x1d94c2){if(_0x1d94c2){return _0x1d94c2[_0x90db('0x39')](_0x53b0a6)[_0x90db('0x23')](function(_0x58cf68){return _0x58cf68;});}return null;};}function removeEntity(_0x4f887b,_0x201eff){return function(_0x5ac04d){if(_0x5ac04d){return _0x5ac04d[_0x90db('0x3a')]()[_0x90db('0x23')](function(){_0x4f887b[_0x90db('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b71d8,_0x50847a){return function(_0x143561){if(!_0x143561){_0x3b71d8[_0x90db('0x2c')](0x194);}return _0x143561;};}function handleError(_0x57f519,_0x695387){_0x695387=_0x695387||0x1f4;return function(_0x2b4794){logger[_0x90db('0x28')](_0x2b4794[_0x90db('0x3b')]);if(_0x2b4794[_0x90db('0x3c')]){delete _0x2b4794[_0x90db('0x3c')];}_0x57f519['status'](_0x695387)[_0x90db('0x3d')](_0x2b4794);};}exports[_0x90db('0x3e')]=function(_0x4d04a1,_0x13be41){var _0x144c48={},_0x4492e0={},_0x58eda8={'count':0x0,'rows':[]};var _0x108833=_[_0x90db('0x3f')](db['WhatsappMessage']['rawAttributes'],function(_0x57c06b){return{'name':_0x57c06b['fieldName'],'type':_0x57c06b[_0x90db('0x40')][_0x90db('0x41')]};});_0x4492e0[_0x90db('0x42')]=_['map'](_0x108833,'name');_0x4492e0[_0x90db('0x43')]=_[_0x90db('0x44')](_0x4d04a1['query']);_0x4492e0[_0x90db('0x45')]=_['intersection'](_0x4492e0[_0x90db('0x42')],_0x4492e0[_0x90db('0x43')]);_0x144c48[_0x90db('0x46')]=_[_0x90db('0x47')](_0x4492e0[_0x90db('0x42')],qs[_0x90db('0x48')](_0x4d04a1[_0x90db('0x43')][_0x90db('0x48')]));_0x144c48[_0x90db('0x46')]=_0x144c48['attributes'][_0x90db('0x49')]?_0x144c48[_0x90db('0x46')]:_0x4492e0[_0x90db('0x42')];if(!_0x4d04a1[_0x90db('0x43')][_0x90db('0x4a')]('nolimit')){_0x144c48['limit']=qs[_0x90db('0x31')](_0x4d04a1['query'][_0x90db('0x31')]);_0x144c48[_0x90db('0x33')]=qs[_0x90db('0x33')](_0x4d04a1[_0x90db('0x43')][_0x90db('0x33')]);}_0x144c48['order']=qs['sort'](_0x4d04a1['query'][_0x90db('0x4b')]);_0x144c48[_0x90db('0x4c')]=qs[_0x90db('0x45')](_['pick'](_0x4d04a1[_0x90db('0x43')],_0x4492e0[_0x90db('0x45')]),_0x108833);if(_0x4d04a1[_0x90db('0x43')][_0x90db('0x4d')]){_0x144c48['where']=_[_0x90db('0x4e')](_0x144c48[_0x90db('0x4c')],{'$or':_[_0x90db('0x3f')](_0x108833,function(_0x5fa064){if(_0x5fa064['type']!=='VIRTUAL'){var _0xf7b4ae={};_0xf7b4ae[_0x5fa064[_0x90db('0x3c')]]={'$like':'%'+_0x4d04a1[_0x90db('0x43')][_0x90db('0x4d')]+'%'};return _0xf7b4ae;}})});}_0x144c48=_['merge']({},_0x144c48,_0x4d04a1[_0x90db('0x4f')]);var _0x5b8124={'where':_0x144c48[_0x90db('0x4c')]};return db[_0x90db('0x50')]['count'](_0x5b8124)[_0x90db('0x23')](function(_0x1adc8c){_0x58eda8[_0x90db('0x32')]=_0x1adc8c;if(_0x4d04a1[_0x90db('0x43')][_0x90db('0x51')]){_0x144c48[_0x90db('0x52')]=[{'all':!![]}];}return db[_0x90db('0x50')][_0x90db('0x53')](_0x144c48);})[_0x90db('0x23')](function(_0x33798f){_0x58eda8[_0x90db('0x54')]=_0x33798f;return _0x58eda8;})['then'](respondWithFilteredResult(_0x13be41,_0x144c48))[_0x90db('0x55')](handleError(_0x13be41,null));};exports[_0x90db('0x56')]=function(_0x40f958,_0x6f5fb3){var _0x128994={'raw':!![],'where':{'id':_0x40f958[_0x90db('0x57')]['id']}},_0x36c5f5={};_0x36c5f5[_0x90db('0x42')]=_[_0x90db('0x44')](db[_0x90db('0x50')][_0x90db('0x58')]);_0x36c5f5[_0x90db('0x43')]=_['keys'](_0x40f958[_0x90db('0x43')]);_0x36c5f5['filters']=_[_0x90db('0x47')](_0x36c5f5[_0x90db('0x42')],_0x36c5f5[_0x90db('0x43')]);_0x128994[_0x90db('0x46')]=_[_0x90db('0x47')](_0x36c5f5['model'],qs[_0x90db('0x48')](_0x40f958[_0x90db('0x43')][_0x90db('0x48')]));_0x128994['attributes']=_0x128994[_0x90db('0x46')]['length']?_0x128994['attributes']:_0x36c5f5[_0x90db('0x42')];if(_0x40f958[_0x90db('0x43')][_0x90db('0x51')]){_0x128994[_0x90db('0x52')]=[{'all':!![]}];}_0x128994=_[_0x90db('0x4e')]({},_0x128994,_0x40f958[_0x90db('0x4f')]);return db['WhatsappMessage']['find'](_0x128994)[_0x90db('0x23')](handleEntityNotFound(_0x6f5fb3,null))[_0x90db('0x23')](respondWithResult(_0x6f5fb3,null))[_0x90db('0x55')](handleError(_0x6f5fb3,null));};exports[_0x90db('0x59')]=function(_0x67010a,_0xf83f99){return db[_0x90db('0x50')][_0x90db('0x59')](_0x67010a[_0x90db('0x5a')],{})[_0x90db('0x23')](respondWithResult(_0xf83f99,0xc9))[_0x90db('0x55')](handleError(_0xf83f99,null));};exports[_0x90db('0x39')]=function(_0x1eb7c8,_0x160d26){if(_0x1eb7c8[_0x90db('0x5a')]['id']){delete _0x1eb7c8[_0x90db('0x5a')]['id'];}return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x1eb7c8[_0x90db('0x57')]['id']}})[_0x90db('0x23')](handleEntityNotFound(_0x160d26,null))[_0x90db('0x23')](saveUpdates(_0x1eb7c8[_0x90db('0x5a')],null))['then'](respondWithResult(_0x160d26,null))[_0x90db('0x55')](handleError(_0x160d26,null));};exports[_0x90db('0x3a')]=function(_0x305d67,_0x4317e2){return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x305d67[_0x90db('0x57')]['id']}})[_0x90db('0x23')](handleEntityNotFound(_0x4317e2,null))[_0x90db('0x23')](removeEntity(_0x4317e2,null))[_0x90db('0x55')](handleError(_0x4317e2,null));};exports[_0x90db('0x5c')]=function(_0x2636f5,_0x22a137){return db[_0x90db('0x50')][_0x90db('0x5c')]()[_0x90db('0x23')](respondWithResult(_0x22a137,null))[_0x90db('0x55')](handleError(_0x22a137,null));};var interaction_log=require(_0x90db('0x14'))(_0x90db('0x5d'));exports[_0x90db('0x5e')]=function(_0x59c99f,_0x6fc0ed,_0x2064f0){var _0x571b0d={'agent':{},'channel':'whatsapp'};if(_0x59c99f[_0x90db('0x5a')]['id']){delete _0x59c99f[_0x90db('0x5a')]['id'];}_0x59c99f['body'][_0x90db('0x5f')]=!![];_0x59c99f['body']['readAt']=moment()[_0x90db('0x60')](_0x90db('0x61'));_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')]=_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')]||_0x59c99f[_0x90db('0x63')]['id'];_0x571b0d[_0x90db('0x64')]['id']=_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')];return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x59c99f['params']['id'],'UserId':null}})[_0x90db('0x23')](handleEntityNotFound(_0x6fc0ed,null))['then'](saveUpdates(_0x59c99f[_0x90db('0x5a')],null))['then'](function(_0x159ac9){if(_0x159ac9){_0x571b0d[_0x90db('0x2a')]=_0x159ac9[_0x90db('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0x90db('0x5b')]({'where':{'id':_0x159ac9['WhatsappInteractionId']}});}return null;})[_0x90db('0x23')](handleEntityNotFound(_0x6fc0ed,null))[_0x90db('0x23')](function(_0x547134){if(_0x547134){return _0x547134[_0x90db('0x39')]({'UserId':_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')],'read1stAt':_['isNil'](_0x547134[_0x90db('0x66')])?moment()[_0x90db('0x60')](_0x90db('0x61')):undefined});}return null;})[_0x90db('0x23')](function(_0x47e743){if(_0x47e743){_0x571b0d['interaction']=_0x47e743['get']({'plain':!![]});interaction_log[_0x90db('0x24')](_0x90db('0x67'),_0x59c99f[_0x90db('0x63')]['id'],_0x59c99f[_0x90db('0x63')][_0x90db('0x3c')],_0x59c99f[_0x90db('0x63')]['role'],_0x571b0d[_0x90db('0x68')]['id'],_0x59c99f[_0x90db('0x5a')]?JSON[_0x90db('0x69')](_0x59c99f[_0x90db('0x5a')]):_0x90db('0x6a'));return respondWithRpcPromise(_0x90db('0x6b'),_0x90db('0x6c'),_0x571b0d);}return null;})[_0x90db('0x23')](function(_0x238c3f){var _0x5e581e=_0x90db('0x6d')+_0x238c3f[_0x90db('0x2a')][_0x90db('0x6e')];return db[_0x90db('0x6f')]['query'](_0x5e581e,{'type':db[_0x90db('0x70')][_0x90db('0x71')][_0x90db('0x72')],'raw':!![]})['then'](function(_0x195a3d){return _0x195a3d;});})['then'](function(_0x35185c){if(_0x35185c){_0x571b0d[_0x90db('0x2a')]['contact']=_0x35185c[0x0];if(!_0x59c99f[_0x90db('0x5a')]['UserId'])return;return db[_0x90db('0x73')][_0x90db('0x5b')]({'where':{'id':_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')],'role':'agent'},'attributes':['id',_0x90db('0x3c'),_0x90db('0x74'),_0x90db('0x75'),'internal'],'raw':!![]});}return null;})[_0x90db('0x23')](function(_0x379ec2){if(!_0x379ec2)return null;_0x571b0d[_0x90db('0x2a')][_0x90db('0x64')]=_0x379ec2;return _0x571b0d;})[_0x90db('0x23')](function(_0x15e2f3){if(_0x15e2f3){if(_0x59c99f[_0x90db('0x5a')][_0x90db('0x76')]){_0x571b0d[_0x90db('0x2a')][_0x90db('0x77')]=util[_0x90db('0x60')](_0x90db('0x78'),_0x59c99f[_0x90db('0x63')][_0x90db('0x3c')]);_0x571b0d[_0x90db('0x2a')]['channel']=_0x571b0d[_0x90db('0x79')];_0x571b0d[_0x90db('0x2a')]['event']=_0x90db('0x5e');return respondWithRpcPromise(_0x90db('0x7a'),'EventManager',{'event':_0x90db('0x7b'),'message':_0x571b0d[_0x90db('0x2a')]},client9002)[_0x90db('0x23')](function(){return _0x571b0d;});}return _0x571b0d;}return null;})[_0x90db('0x23')](respondWithResult(_0x6fc0ed,null))[_0x90db('0x55')](handleError(_0x6fc0ed,null));};var interaction_log=require(_0x90db('0x14'))(_0x90db('0x5d'));exports['reject']=function(_0x235035,_0x46023c,_0xe7b1a7){var _0x437f15={'agent':{},'channel':_0x90db('0x7c')};if(_0x235035[_0x90db('0x5a')]['id']){delete _0x235035[_0x90db('0x5a')]['id'];}_0x235035[_0x90db('0x5a')]['UserId']=_0x235035[_0x90db('0x5a')][_0x90db('0x62')]||_0x235035[_0x90db('0x63')]['id'];_0x437f15[_0x90db('0x64')]['id']=_0x235035[_0x90db('0x5a')][_0x90db('0x62')];return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x235035[_0x90db('0x57')]['id'],'UserId':null}})[_0x90db('0x23')](handleEntityNotFound(_0x46023c,null))[_0x90db('0x23')](function(_0x90a2a8){if(_0x90a2a8){_0x437f15['message']=_0x90a2a8['get']({'plain':!![]});return db[_0x90db('0x7d')][_0x90db('0x5b')]({'where':{'id':_0x90a2a8[_0x90db('0x7e')]}});}return null;})[_0x90db('0x23')](handleEntityNotFound(_0x46023c,null))['then'](function(_0x3f1afd){if(_0x3f1afd){_0x437f15[_0x90db('0x68')]=_0x3f1afd[_0x90db('0x65')]({'plain':!![]});interaction_log[_0x90db('0x24')](_0x90db('0x7f'),_0x235035['user']['id'],_0x235035[_0x90db('0x63')][_0x90db('0x3c')],_0x235035[_0x90db('0x63')][_0x90db('0x80')],_0x437f15[_0x90db('0x68')]['id'],_0x235035[_0x90db('0x5a')]?JSON[_0x90db('0x69')](_0x235035[_0x90db('0x5a')]):_0x90db('0x6a'));return respondWithRpcPromise(_0x90db('0x81'),_0x90db('0x82'),_0x437f15);}return null;})[_0x90db('0x23')](function(_0x3b6539){var _0x18b51c=_0x90db('0x6d')+_0x3b6539[_0x90db('0x2a')][_0x90db('0x6e')];return db[_0x90db('0x6f')]['query'](_0x18b51c,{'type':db['Sequelize']['QueryTypes'][_0x90db('0x72')],'raw':!![]})[_0x90db('0x23')](function(_0x262d47){return _0x262d47;});})[_0x90db('0x23')](function(_0x169491){if(_0x169491){_0x437f15[_0x90db('0x2a')]['contact']=_0x169491[0x0];if(!_0x235035[_0x90db('0x5a')][_0x90db('0x62')])return;return db[_0x90db('0x73')]['find']({'where':{'id':_0x235035[_0x90db('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0x90db('0x3c'),_0x90db('0x74'),'email',_0x90db('0x83')],'raw':!![]});}return null;})[_0x90db('0x23')](function(_0x2b46ed){if(!_0x2b46ed)return null;_0x437f15[_0x90db('0x2a')]['agent']=_0x2b46ed;return _0x437f15;})[_0x90db('0x23')](function(_0x1c57fd){if(_0x1c57fd){_0x1c57fd['message'][_0x90db('0x77')]=util[_0x90db('0x60')](_0x90db('0x78'),_0x235035[_0x90db('0x63')][_0x90db('0x3c')]);_0x1c57fd[_0x90db('0x2a')][_0x90db('0x79')]=_0x437f15[_0x90db('0x79')];_0x1c57fd['message']['event']=_0x90db('0x37');respondWithRpcPromise(_0x90db('0x7a'),_0x90db('0x7a'),{'event':_0x90db('0x84'),'message':_0x1c57fd['message']},client9002);return _0x437f15;}return null;})['then'](respondWithResult(_0x46023c,null))['catch'](handleError(_0x46023c,null));};exports[_0x90db('0x2e')]=function(_0x1f7a30,_0x1d41a7,_0x30c4bc){if(_0x1f7a30['body']['id']){delete _0x1f7a30[_0x90db('0x5a')]['id'];}var _0x2df660;return db['WhatsappMessage'][_0x90db('0x5b')]({'where':{'id':_0x1f7a30[_0x90db('0x57')]['id']}})[_0x90db('0x23')](handleEntityNotFound(_0x1d41a7,null))['then'](function(_0x3cf6fc){if(_0x3cf6fc){_0x2df660=_0x3cf6fc;return db[_0x90db('0x85')][_0x90db('0x5b')]({'where':{'id':_0x3cf6fc[_0x90db('0x86')]}});}})[_0x90db('0x23')](handleEntityNotFound(_0x1d41a7,null))[_0x90db('0x23')](function(_0x1d48d2){if(_0x1d48d2){logger[_0x90db('0x26')](_0x90db('0x87'),_0x90db('0x2e'),_0x90db('0x88'),_0x1d48d2['type'],util['inspect'](_0x1f7a30[_0x90db('0x5a')],{'showHidden':![],'depth':null}));switch(_0x1d48d2['type']){case _0x90db('0x89'):if(_0x1f7a30[_0x90db('0x5a')][_0x90db('0x8a')]&&_0x1f7a30['body'][_0x90db('0x8a')]===_0x2df660[_0x90db('0x8b')]&&_0x1f7a30[_0x90db('0x5a')][_0x90db('0x8c')]&&_0x1f7a30['body']['MessageStatus']===_0x90db('0x5f')){return _0x2df660[_0x90db('0x39')]({'read':!![]});}else{logger[_0x90db('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x90db('0x89'),util[_0x90db('0x8d')](_0x1f7a30[_0x90db('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x2df660;}})[_0x90db('0x23')](respondWithResult(_0x1d41a7,null))['catch'](handleError(_0x1d41a7,null));}; \ No newline at end of file +var _0x33e5=['format','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE: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','contact','User','agent','email','internal','manual','interface','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','fullname','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','status','undefined','limit','count','offset','set','reject','save','update','end','stack','name','send','index','map','WhatsappMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','show','params','keys','rawAttributes','include','create','body','find','destroy','describe','whatsapp-interactions','whatsapp','read'];(function(_0x2d1232,_0x2b90a5){var _0x32a74a=function(_0x3f6582){while(--_0x3f6582){_0x2d1232['push'](_0x2d1232['shift']());}};_0x32a74a(++_0x2b90a5);}(_0x33e5,0x13a));var _0x533e=function(_0x44091e,_0x1ebb70){_0x44091e=_0x44091e-0x0;var _0x4abffb=_0x33e5[_0x44091e];return _0x4abffb;};'use strict';var emlformat=require(_0x533e('0x0'));var rimraf=require(_0x533e('0x1'));var zipdir=require(_0x533e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533e('0x3'));var moment=require('moment');var BPromise=require(_0x533e('0x4'));var Mustache=require(_0x533e('0x5'));var util=require(_0x533e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x533e('0x7'));var ejs=require(_0x533e('0x8'));var fs=require('fs');var fs_extra=require(_0x533e('0x9'));var _=require(_0x533e('0xa'));var squel=require(_0x533e('0xb'));var crypto=require(_0x533e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x533e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x533e('0xe'));var Papa=require(_0x533e('0xf'));var Redis=require(_0x533e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x533e('0x11'));var as=require(_0x533e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533e('0x13'))(_0x533e('0x14'));var utils=require(_0x533e('0x15'));var config=require(_0x533e('0x16'));var licenseUtil=require(_0x533e('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x533e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x533e('0x19'))(new Redis(config[_0x533e('0x1a')]));require(_0x533e('0x1b'))[_0x533e('0x1c')](socket);var jayson=require(_0x533e('0x1d'));var client=jayson[_0x533e('0x1e')][_0x533e('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12d0bf,_0x56d898,_0x2821a4,_0x5d4d5f){return new BPromise(function(_0x1fb599,_0x532fa1){var _0x5bcafa=_0x5d4d5f||client;return _0x5bcafa[_0x533e('0x20')](_0x12d0bf,_0x2821a4)[_0x533e('0x21')](function(_0x59c0de){logger[_0x533e('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x56d898,_0x533e('0x23'));logger[_0x533e('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x56d898,_0x533e('0x23'),JSON['stringify'](_0x59c0de));if(_0x59c0de[_0x533e('0x25')]){if(_0x59c0de['error'][_0x533e('0x26')]===0x1f4){logger[_0x533e('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x56d898,_0x59c0de[_0x533e('0x25')][_0x533e('0x27')]);return _0x532fa1(_0x59c0de[_0x533e('0x25')][_0x533e('0x27')]);}logger[_0x533e('0x25')](_0x533e('0x28'),_0x56d898,_0x59c0de[_0x533e('0x25')]['message']);return _0x1fb599(_0x59c0de[_0x533e('0x25')][_0x533e('0x27')]);}else{logger['info'](_0x533e('0x28'),_0x56d898,_0x533e('0x23'));_0x1fb599(_0x59c0de[_0x533e('0x29')][_0x533e('0x27')]);}})[_0x533e('0x2a')](function(_0x5ce928){logger['error'](_0x533e('0x28'),_0x56d898,_0x5ce928);_0x532fa1(_0x5ce928);});});}function respondWithStatusCode(_0x3611b0,_0x7ce859){_0x7ce859=_0x7ce859||0xcc;return function(_0x53df1b){if(_0x53df1b){return _0x3611b0[_0x533e('0x2b')](_0x7ce859);}return _0x3611b0['status'](_0x7ce859)['end']();};}function respondWithResult(_0x2b99cb,_0x5b7921){_0x5b7921=_0x5b7921||0xc8;return function(_0x4151cc){if(_0x4151cc){return _0x2b99cb[_0x533e('0x2c')](_0x5b7921)['json'](_0x4151cc);}};}function respondWithFilteredResult(_0x221ec4,_0x2d7d08){return function(_0xaa53b6){if(_0xaa53b6){var _0x52e89d=typeof _0x2d7d08['offset']===_0x533e('0x2d')&&typeof _0x2d7d08[_0x533e('0x2e')]==='undefined';var _0x3a700c=_0xaa53b6[_0x533e('0x2f')];var _0x2a2b70=_0x52e89d?0x0:_0x2d7d08[_0x533e('0x30')];var _0x10289d=_0x52e89d?_0xaa53b6[_0x533e('0x2f')]:_0x2d7d08['offset']+_0x2d7d08[_0x533e('0x2e')];var _0x4d8120;if(_0x10289d>=_0x3a700c){_0x10289d=_0x3a700c;_0x4d8120=0xc8;}else{_0x4d8120=0xce;}_0x221ec4[_0x533e('0x2c')](_0x4d8120);return _0x221ec4[_0x533e('0x31')]('Content-Range',_0x2a2b70+'-'+_0x10289d+'/'+_0x3a700c)['json'](_0xaa53b6);}return null;};}function patchUpdates(_0xd88d2d){return function(_0x229821){try{jsonpatch['apply'](_0x229821,_0xd88d2d,!![]);}catch(_0xe3cb6c){return BPromise[_0x533e('0x32')](_0xe3cb6c);}return _0x229821[_0x533e('0x33')]();};}function saveUpdates(_0x5e7c16,_0x3a3490){return function(_0x1a37c8){if(_0x1a37c8){return _0x1a37c8[_0x533e('0x34')](_0x5e7c16)[_0x533e('0x21')](function(_0x476c4c){return _0x476c4c;});}return null;};}function removeEntity(_0x564f40,_0x12e4d6){return function(_0x5a7675){if(_0x5a7675){return _0x5a7675['destroy']()[_0x533e('0x21')](function(){_0x564f40[_0x533e('0x2c')](0xcc)[_0x533e('0x35')]();});}};}function handleEntityNotFound(_0x403534,_0x3a205d){return function(_0x5969ee){if(!_0x5969ee){_0x403534[_0x533e('0x2b')](0x194);}return _0x5969ee;};}function handleError(_0x1c27fa,_0x4431ac){_0x4431ac=_0x4431ac||0x1f4;return function(_0x136d6c){logger[_0x533e('0x25')](_0x136d6c[_0x533e('0x36')]);if(_0x136d6c[_0x533e('0x37')]){delete _0x136d6c['name'];}_0x1c27fa[_0x533e('0x2c')](_0x4431ac)[_0x533e('0x38')](_0x136d6c);};}exports[_0x533e('0x39')]=function(_0x4ce6f4,_0x58dc99){var _0x442b5d={},_0x4edf6b={},_0x50fb2b={'count':0x0,'rows':[]};var _0x3488c5=_[_0x533e('0x3a')](db[_0x533e('0x3b')]['rawAttributes'],function(_0x2a948f){return{'name':_0x2a948f[_0x533e('0x3c')],'type':_0x2a948f[_0x533e('0x3d')][_0x533e('0x3e')]};});_0x4edf6b[_0x533e('0x3f')]=_['map'](_0x3488c5,_0x533e('0x37'));_0x4edf6b[_0x533e('0x40')]=_['keys'](_0x4ce6f4[_0x533e('0x40')]);_0x4edf6b[_0x533e('0x41')]=_[_0x533e('0x42')](_0x4edf6b[_0x533e('0x3f')],_0x4edf6b[_0x533e('0x40')]);_0x442b5d[_0x533e('0x43')]=_['intersection'](_0x4edf6b[_0x533e('0x3f')],qs[_0x533e('0x44')](_0x4ce6f4[_0x533e('0x40')][_0x533e('0x44')]));_0x442b5d[_0x533e('0x43')]=_0x442b5d[_0x533e('0x43')][_0x533e('0x45')]?_0x442b5d[_0x533e('0x43')]:_0x4edf6b[_0x533e('0x3f')];if(!_0x4ce6f4[_0x533e('0x40')][_0x533e('0x46')](_0x533e('0x47'))){_0x442b5d[_0x533e('0x2e')]=qs['limit'](_0x4ce6f4[_0x533e('0x40')][_0x533e('0x2e')]);_0x442b5d[_0x533e('0x30')]=qs['offset'](_0x4ce6f4[_0x533e('0x40')][_0x533e('0x30')]);}_0x442b5d[_0x533e('0x48')]=qs[_0x533e('0x49')](_0x4ce6f4[_0x533e('0x40')][_0x533e('0x49')]);_0x442b5d[_0x533e('0x4a')]=qs[_0x533e('0x41')](_[_0x533e('0x4b')](_0x4ce6f4[_0x533e('0x40')],_0x4edf6b[_0x533e('0x41')]),_0x3488c5);if(_0x4ce6f4[_0x533e('0x40')][_0x533e('0x4c')]){_0x442b5d[_0x533e('0x4a')]=_[_0x533e('0x4d')](_0x442b5d['where'],{'$or':_[_0x533e('0x3a')](_0x3488c5,function(_0x572c68){if(_0x572c68[_0x533e('0x3d')]!==_0x533e('0x4e')){var _0x309498={};_0x309498[_0x572c68[_0x533e('0x37')]]={'$like':'%'+_0x4ce6f4[_0x533e('0x40')][_0x533e('0x4c')]+'%'};return _0x309498;}})});}_0x442b5d=_['merge']({},_0x442b5d,_0x4ce6f4[_0x533e('0x4f')]);var _0x358f24={'where':_0x442b5d[_0x533e('0x4a')]};return db[_0x533e('0x3b')]['count'](_0x358f24)['then'](function(_0x21a821){_0x50fb2b['count']=_0x21a821;if(_0x4ce6f4[_0x533e('0x40')][_0x533e('0x50')]){_0x442b5d['include']=[{'all':!![]}];}return db[_0x533e('0x3b')]['findAll'](_0x442b5d);})['then'](function(_0x4600ca){_0x50fb2b['rows']=_0x4600ca;return _0x50fb2b;})[_0x533e('0x21')](respondWithFilteredResult(_0x58dc99,_0x442b5d))[_0x533e('0x2a')](handleError(_0x58dc99,null));};exports[_0x533e('0x51')]=function(_0x598463,_0x2a9a5d){var _0x30c0f8={'raw':!![],'where':{'id':_0x598463[_0x533e('0x52')]['id']}},_0x5e6354={};_0x5e6354[_0x533e('0x3f')]=_[_0x533e('0x53')](db[_0x533e('0x3b')][_0x533e('0x54')]);_0x5e6354[_0x533e('0x40')]=_[_0x533e('0x53')](_0x598463[_0x533e('0x40')]);_0x5e6354[_0x533e('0x41')]=_[_0x533e('0x42')](_0x5e6354[_0x533e('0x3f')],_0x5e6354[_0x533e('0x40')]);_0x30c0f8[_0x533e('0x43')]=_['intersection'](_0x5e6354[_0x533e('0x3f')],qs['fields'](_0x598463['query']['fields']));_0x30c0f8['attributes']=_0x30c0f8[_0x533e('0x43')][_0x533e('0x45')]?_0x30c0f8['attributes']:_0x5e6354[_0x533e('0x3f')];if(_0x598463['query'][_0x533e('0x50')]){_0x30c0f8[_0x533e('0x55')]=[{'all':!![]}];}_0x30c0f8=_[_0x533e('0x4d')]({},_0x30c0f8,_0x598463[_0x533e('0x4f')]);return db[_0x533e('0x3b')]['find'](_0x30c0f8)[_0x533e('0x21')](handleEntityNotFound(_0x2a9a5d,null))[_0x533e('0x21')](respondWithResult(_0x2a9a5d,null))[_0x533e('0x2a')](handleError(_0x2a9a5d,null));};exports[_0x533e('0x56')]=function(_0x21cec8,_0x1aaad0){return db[_0x533e('0x3b')][_0x533e('0x56')](_0x21cec8[_0x533e('0x57')],{})[_0x533e('0x21')](respondWithResult(_0x1aaad0,0xc9))[_0x533e('0x2a')](handleError(_0x1aaad0,null));};exports[_0x533e('0x34')]=function(_0x1c62ed,_0x3cd9cc){if(_0x1c62ed[_0x533e('0x57')]['id']){delete _0x1c62ed['body']['id'];}return db[_0x533e('0x3b')][_0x533e('0x58')]({'where':{'id':_0x1c62ed[_0x533e('0x52')]['id']}})[_0x533e('0x21')](handleEntityNotFound(_0x3cd9cc,null))[_0x533e('0x21')](saveUpdates(_0x1c62ed[_0x533e('0x57')],null))[_0x533e('0x21')](respondWithResult(_0x3cd9cc,null))['catch'](handleError(_0x3cd9cc,null));};exports[_0x533e('0x59')]=function(_0x194747,_0xb5fb62){return db['WhatsappMessage'][_0x533e('0x58')]({'where':{'id':_0x194747[_0x533e('0x52')]['id']}})['then'](handleEntityNotFound(_0xb5fb62,null))['then'](removeEntity(_0xb5fb62,null))[_0x533e('0x2a')](handleError(_0xb5fb62,null));};exports[_0x533e('0x5a')]=function(_0x2e0e84,_0x495074){return db[_0x533e('0x3b')]['describe']()[_0x533e('0x21')](respondWithResult(_0x495074,null))[_0x533e('0x2a')](handleError(_0x495074,null));};var interaction_log=require(_0x533e('0x13'))(_0x533e('0x5b'));exports['accept']=function(_0x1cb374,_0x1da77f,_0x361e85){var _0x4232fa={'agent':{},'channel':_0x533e('0x5c')};if(_0x1cb374[_0x533e('0x57')]['id']){delete _0x1cb374[_0x533e('0x57')]['id'];}_0x1cb374[_0x533e('0x57')][_0x533e('0x5d')]=!![];_0x1cb374[_0x533e('0x57')]['readAt']=moment()[_0x533e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1cb374['body'][_0x533e('0x5f')]=_0x1cb374[_0x533e('0x57')][_0x533e('0x5f')]||_0x1cb374[_0x533e('0x60')]['id'];_0x4232fa['agent']['id']=_0x1cb374['body'][_0x533e('0x5f')];return db[_0x533e('0x3b')][_0x533e('0x58')]({'where':{'id':_0x1cb374[_0x533e('0x52')]['id'],'UserId':null}})[_0x533e('0x21')](handleEntityNotFound(_0x1da77f,null))[_0x533e('0x21')](saveUpdates(_0x1cb374[_0x533e('0x57')],null))['then'](function(_0x417eef){if(_0x417eef){_0x4232fa[_0x533e('0x27')]=_0x417eef[_0x533e('0x61')]({'plain':!![]});return db[_0x533e('0x62')]['find']({'where':{'id':_0x417eef[_0x533e('0x63')]}});}return null;})[_0x533e('0x21')](handleEntityNotFound(_0x1da77f,null))[_0x533e('0x21')](function(_0x558e58){if(_0x558e58){return _0x558e58[_0x533e('0x34')]({'UserId':_0x1cb374[_0x533e('0x57')][_0x533e('0x5f')],'read1stAt':_[_0x533e('0x64')](_0x558e58[_0x533e('0x65')])?moment()[_0x533e('0x5e')](_0x533e('0x66')):undefined});}return null;})[_0x533e('0x21')](function(_0x1f73c3){if(_0x1f73c3){_0x4232fa[_0x533e('0x67')]=_0x1f73c3[_0x533e('0x61')]({'plain':!![]});interaction_log[_0x533e('0x22')](_0x533e('0x68'),_0x1cb374[_0x533e('0x60')]['id'],_0x1cb374[_0x533e('0x60')]['name'],_0x1cb374['user'][_0x533e('0x69')],_0x4232fa[_0x533e('0x67')]['id'],_0x1cb374[_0x533e('0x57')]?JSON[_0x533e('0x6a')](_0x1cb374['body']):_0x533e('0x6b'));return respondWithRpcPromise(_0x533e('0x6c'),'acceptMessage',_0x4232fa);}return null;})[_0x533e('0x21')](function(_0x3d33c7){var _0x169b19=_0x533e('0x6d')+_0x3d33c7[_0x533e('0x27')][_0x533e('0x6e')];return db[_0x533e('0x6f')][_0x533e('0x40')](_0x169b19,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x533e('0x21')](function(_0x21cc39){return _0x21cc39;});})[_0x533e('0x21')](function(_0x3be697){if(_0x3be697){_0x4232fa[_0x533e('0x27')][_0x533e('0x70')]=_0x3be697[0x0];if(!_0x1cb374[_0x533e('0x57')]['UserId'])return;return db[_0x533e('0x71')]['find']({'where':{'id':_0x1cb374[_0x533e('0x57')][_0x533e('0x5f')],'role':_0x533e('0x72')},'attributes':['id',_0x533e('0x37'),'fullname',_0x533e('0x73'),_0x533e('0x74')],'raw':!![]});}return null;})['then'](function(_0x514886){if(!_0x514886)return null;_0x4232fa[_0x533e('0x27')][_0x533e('0x72')]=_0x514886;return _0x4232fa;})[_0x533e('0x21')](function(_0x3f74b4){if(_0x3f74b4){if(_0x1cb374['body'][_0x533e('0x75')]){_0x4232fa[_0x533e('0x27')][_0x533e('0x76')]=util['format']('SIP/%s',_0x1cb374[_0x533e('0x60')][_0x533e('0x37')]);_0x4232fa['message'][_0x533e('0x77')]=_0x4232fa[_0x533e('0x77')];_0x4232fa[_0x533e('0x27')][_0x533e('0x78')]='accept';return respondWithRpcPromise(_0x533e('0x79'),_0x533e('0x79'),{'event':_0x533e('0x7a'),'message':_0x4232fa[_0x533e('0x27')]},client9002)[_0x533e('0x21')](function(){return _0x4232fa;});}return _0x4232fa;}return null;})[_0x533e('0x21')](respondWithResult(_0x1da77f,null))[_0x533e('0x2a')](handleError(_0x1da77f,null));};var interaction_log=require(_0x533e('0x13'))(_0x533e('0x5b'));exports[_0x533e('0x32')]=function(_0x16a530,_0x4f57c2,_0xe117a){var _0x18964e={'agent':{},'channel':_0x533e('0x5c')};if(_0x16a530[_0x533e('0x57')]['id']){delete _0x16a530[_0x533e('0x57')]['id'];}_0x16a530[_0x533e('0x57')][_0x533e('0x5f')]=_0x16a530[_0x533e('0x57')][_0x533e('0x5f')]||_0x16a530[_0x533e('0x60')]['id'];_0x18964e[_0x533e('0x72')]['id']=_0x16a530['body'][_0x533e('0x5f')];return db[_0x533e('0x3b')][_0x533e('0x58')]({'where':{'id':_0x16a530[_0x533e('0x52')]['id'],'UserId':null}})[_0x533e('0x21')](handleEntityNotFound(_0x4f57c2,null))[_0x533e('0x21')](function(_0x21ce4e){if(_0x21ce4e){_0x18964e[_0x533e('0x27')]=_0x21ce4e[_0x533e('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0x533e('0x58')]({'where':{'id':_0x21ce4e['WhatsappInteractionId']}});}return null;})[_0x533e('0x21')](handleEntityNotFound(_0x4f57c2,null))[_0x533e('0x21')](function(_0x2a19b0){if(_0x2a19b0){_0x18964e[_0x533e('0x67')]=_0x2a19b0[_0x533e('0x61')]({'plain':!![]});interaction_log['info'](_0x533e('0x7b'),_0x16a530['user']['id'],_0x16a530[_0x533e('0x60')]['name'],_0x16a530['user'][_0x533e('0x69')],_0x18964e['interaction']['id'],_0x16a530['body']?JSON['stringify'](_0x16a530[_0x533e('0x57')]):'null');return respondWithRpcPromise(_0x533e('0x7c'),_0x533e('0x7d'),_0x18964e);}return null;})[_0x533e('0x21')](function(_0x63e1a4){var _0x3f9be0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x63e1a4[_0x533e('0x27')][_0x533e('0x6e')];return db[_0x533e('0x6f')]['query'](_0x3f9be0,{'type':db['Sequelize'][_0x533e('0x7e')]['SELECT'],'raw':!![]})['then'](function(_0x5da11b){return _0x5da11b;});})['then'](function(_0x290339){if(_0x290339){_0x18964e[_0x533e('0x27')][_0x533e('0x70')]=_0x290339[0x0];if(!_0x16a530['body'][_0x533e('0x5f')])return;return db[_0x533e('0x71')][_0x533e('0x58')]({'where':{'id':_0x16a530[_0x533e('0x57')][_0x533e('0x5f')],'role':'agent'},'attributes':['id',_0x533e('0x37'),_0x533e('0x7f'),'email',_0x533e('0x74')],'raw':!![]});}return null;})[_0x533e('0x21')](function(_0x4c126d){if(!_0x4c126d)return null;_0x18964e['message'][_0x533e('0x72')]=_0x4c126d;return _0x18964e;})[_0x533e('0x21')](function(_0x1ee525){if(_0x1ee525){_0x1ee525[_0x533e('0x27')][_0x533e('0x76')]=util[_0x533e('0x5e')]('SIP/%s',_0x16a530[_0x533e('0x60')][_0x533e('0x37')]);_0x1ee525[_0x533e('0x27')][_0x533e('0x77')]=_0x18964e['channel'];_0x1ee525[_0x533e('0x27')][_0x533e('0x78')]=_0x533e('0x32');respondWithRpcPromise('EventManager',_0x533e('0x79'),{'event':'rejectmessage','message':_0x1ee525[_0x533e('0x27')]},client9002);return _0x18964e;}return null;})[_0x533e('0x21')](respondWithResult(_0x4f57c2,null))[_0x533e('0x2a')](handleError(_0x4f57c2,null));};exports['status']=function(_0x1bca2c,_0x5132f5,_0x5068af){if(_0x1bca2c[_0x533e('0x57')]['id']){delete _0x1bca2c[_0x533e('0x57')]['id'];}var _0xb27902;return db[_0x533e('0x3b')]['find']({'where':{'id':_0x1bca2c[_0x533e('0x52')]['id']}})[_0x533e('0x21')](handleEntityNotFound(_0x5132f5,null))[_0x533e('0x21')](function(_0x4e06d4){if(_0x4e06d4){_0xb27902=_0x4e06d4;return db[_0x533e('0x80')][_0x533e('0x58')]({'where':{'id':_0x4e06d4[_0x533e('0x81')]}});}})[_0x533e('0x21')](handleEntityNotFound(_0x5132f5,null))[_0x533e('0x21')](function(_0x1f9a61){if(_0x1f9a61){logger['debug'](_0x533e('0x82'),'status','received\x20delivery\x20report\x20from',_0x1f9a61['type'],util[_0x533e('0x83')](_0x1bca2c[_0x533e('0x57')],{'showHidden':![],'depth':null}));switch(_0x1f9a61[_0x533e('0x3d')]){case'twilio':if(_0x1bca2c[_0x533e('0x57')][_0x533e('0x84')]&&_0x1bca2c[_0x533e('0x57')]['MessageSid']===_0xb27902[_0x533e('0x85')]&&_0x1bca2c['body'][_0x533e('0x86')]&&_0x1bca2c[_0x533e('0x57')][_0x533e('0x86')]===_0x533e('0x5d')){return _0xb27902[_0x533e('0x34')]({'read':!![]});}else{logger[_0x533e('0x25')](_0x533e('0x87'),_0x533e('0x2c'),'twilio',util[_0x533e('0x83')](_0x1bca2c[_0x533e('0x57')],{'showHidden':![],'depth':null}));}break;}return _0xb27902;}})[_0x533e('0x21')](respondWithResult(_0x5132f5,null))['catch'](handleError(_0x5132f5,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 79150d5..40d3c5d 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 _0xfc03=['emit','hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','update'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0xfc03,0x16f));var _0x3fc0=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xfc03[_0x346737];return _0x1ade2e;};'use strict';var EventEmitter=require(_0x3fc0('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x3fc0('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3fc0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fc0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13c308){return function(_0x1eeb62,_0x390f7e,_0x29d814){WhatsappMessageEvents[_0x3fc0('0x4')](_0x13c308+':'+_0x1eeb62['id'],_0x1eeb62);WhatsappMessageEvents[_0x3fc0('0x4')](_0x13c308,_0x1eeb62);_0x29d814(null);};}for(var e in events){if(events[_0x3fc0('0x5')](e)){var event=events[e];WhatsappMessage[_0x3fc0('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xefda=['save','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x5247e2,_0x18fd28){var _0x42943a=function(_0x82acf){while(--_0x82acf){_0x5247e2['push'](_0x5247e2['shift']());}};_0x42943a(++_0x18fd28);}(_0xefda,0x96));var _0xaefd=function(_0x39f65b,_0x21d3de){_0x39f65b=_0x39f65b-0x0;var _0x55f237=_0xefda[_0x39f65b];return _0x55f237;};'use strict';var EventEmitter=require(_0xaefd('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xaefd('0x1')](0x0);var events={'afterCreate':_0xaefd('0x2'),'afterUpdate':'update','afterDestroy':_0xaefd('0x3')};function emitEvent(_0x1c65db){return function(_0x2ade44,_0x22df24,_0x1ef6b4){WhatsappMessageEvents[_0xaefd('0x4')](_0x1c65db+':'+_0x2ade44['id'],_0x2ade44);WhatsappMessageEvents['emit'](_0x1c65db,_0x2ade44);_0x1ef6b4(null);};}for(var e in events){if(events[_0xaefd('0x5')](e)){var event=events[e];WhatsappMessage[_0xaefd('0x6')](e,emitEvent(event));}}module[_0xaefd('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 46954fa..6eb8553 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 _0x6eb6=['FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','then','update','createdAt','error','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','body'];(function(_0x1c430a,_0x14b71c){var _0x28e625=function(_0x535c34){while(--_0x535c34){_0x1c430a['push'](_0x1c430a['shift']());}};_0x28e625(++_0x14b71c);}(_0x6eb6,0x1bf));var _0x66eb=function(_0x442fdc,_0x2007d1){_0x442fdc=_0x442fdc-0x0;var _0x20f6ec=_0x6eb6[_0x442fdc];return _0x20f6ec;};'use strict';var _=require(_0x66eb('0x0'));var util=require(_0x66eb('0x1'));var logger=require('../../config/logger')(_0x66eb('0x2'));var moment=require(_0x66eb('0x3'));var BPromise=require(_0x66eb('0x4'));var rp=require(_0x66eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66eb('0x6'));var config=require(_0x66eb('0x7'));var attributes=require(_0x66eb('0x8'));module[_0x66eb('0x9')]=function(_0xb8928e,_0x79eb75){return _0xb8928e['define'](_0x66eb('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x66eb('0xb'),'fields':[_0x66eb('0xb')]},{'name':'fti_whatsapp_messages','fields':[_0x66eb('0xc')],'type':_0x66eb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e9bf0,_0x344c27,_0x4b792f){var _0x16bff1=_0xb8928e[_0x66eb('0xe')];var _0x123fcd=_0x2e9bf0['get']({'plain':!![]});if(_0x123fcd[_0x66eb('0xf')][_0x66eb('0x10')]()==='in'||_0x123fcd[_0x66eb('0xf')][_0x66eb('0x10')]()===_0x66eb('0x11')&&!_0x123fcd[_0x66eb('0x12')]&&!_[_0x66eb('0x13')](_0x123fcd[_0x66eb('0x14')])){_0x16bff1[_0x66eb('0x15')]['findOne']({'where':{'id':_0x123fcd['WhatsappInteractionId']}})[_0x66eb('0x16')](function(_0x410dee){if(_0x410dee){_0x410dee[_0x66eb('0x17')]({'lastMsgAt':_0x123fcd[_0x66eb('0x18')],'lastMsgDirection':_0x123fcd[_0x66eb('0xf')][_0x66eb('0x10')]()});}})['catch'](function(_0x255584){console[_0x66eb('0x19')](_0x255584);});}if(_0x123fcd[_0x66eb('0xf')]===_0x66eb('0x11')&&!_0x123fcd[_0x66eb('0x12')]){var _0x48a8d8;_0x16bff1['WhatsappAccount']['find']({'where':{'id':_0x123fcd[_0x66eb('0x1a')]},'raw':!![]})['then'](function(_0xb246ce){_0x48a8d8=_0xb246ce;if(_0x48a8d8&&_0x48a8d8[_0x66eb('0x1b')]){switch(_0x48a8d8[_0x66eb('0x1b')]){case _0x66eb('0x1c'):var _0x443bdb=require(_0x66eb('0x1c'));if(_0x48a8d8[_0x66eb('0x1d')]&&_0x48a8d8['authToken']&&_0x48a8d8['phone']){var _0x472f9f=new _0x443bdb(_0x48a8d8[_0x66eb('0x1d')],_0x48a8d8[_0x66eb('0x1e')]);_0x472f9f[_0x66eb('0x1f')][_0x66eb('0x20')]({'body':_0x123fcd[_0x66eb('0xc')],'to':'whatsapp:'+_0x123fcd['phone'],'from':_0x66eb('0x21')+_0x48a8d8[_0x66eb('0x22')],'statusCallback':_0x48a8d8[_0x66eb('0x23')]+_0x66eb('0x24')+_0x123fcd['id']+_0x66eb('0x25')+_0x48a8d8[_0x66eb('0x26')]})[_0x66eb('0x16')](function(_0x369250){if(_0x369250[_0x66eb('0x27')]){return _0x2e9bf0[_0x66eb('0x17')]({'messageId':_0x369250[_0x66eb('0x27')]});}})[_0x66eb('0x28')](function(_0xe6a2d9){logger[_0x66eb('0x19')](_0x66eb('0x29'),_0x66eb('0x2a'),_0x66eb('0x1c'),util[_0x66eb('0x2b')](_0xe6a2d9,{'showHidden':![],'depth':null}));});}else{logger[_0x66eb('0x19')](_0x66eb('0x29'),_0x66eb('0x2a'),_0x66eb('0x1c'),_0x66eb('0x2c'));}break;}}})['finally'](function(){_0x4b792f();});}else{_0x4b792f();}}},'charset':'utf8mb4','collate':_0x66eb('0x2d')});}; \ No newline at end of file +var _0xd5c6=['catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','whatsapp:','/api/whatsapp/messages/','/status?token=','token','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt'];(function(_0x5a20da,_0x27b1b3){var _0x4e820d=function(_0x547ffd){while(--_0x547ffd){_0x5a20da['push'](_0x5a20da['shift']());}};_0x4e820d(++_0x27b1b3);}(_0xd5c6,0x76));var _0x6d5c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd5c6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6d5c('0x0'));var util=require(_0x6d5c('0x1'));var logger=require(_0x6d5c('0x2'))(_0x6d5c('0x3'));var moment=require(_0x6d5c('0x4'));var BPromise=require('bluebird');var rp=require(_0x6d5c('0x5'));var fs=require('fs');var path=require(_0x6d5c('0x6'));var rimraf=require(_0x6d5c('0x7'));var config=require(_0x6d5c('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x6d5c('0x9')]=function(_0xe5b5b6,_0x225527){return _0xe5b5b6[_0x6d5c('0xa')](_0x6d5c('0xb'),attributes,{'tableName':_0x6d5c('0xc'),'paranoid':![],'indexes':[{'name':_0x6d5c('0xd'),'fields':[_0x6d5c('0xd')]},{'name':_0x6d5c('0xe'),'fields':[_0x6d5c('0xf')],'type':_0x6d5c('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x217dfb,_0x1a8aaf,_0x5d5193){var _0x27572f=_0xe5b5b6[_0x6d5c('0x11')];var _0x2841be=_0x217dfb[_0x6d5c('0x12')]({'plain':!![]});if(_0x2841be[_0x6d5c('0x13')]['toLowerCase']()==='in'||_0x2841be[_0x6d5c('0x13')]['toLowerCase']()===_0x6d5c('0x14')&&!_0x2841be['secret']&&!_[_0x6d5c('0x15')](_0x2841be[_0x6d5c('0x16')])){_0x27572f[_0x6d5c('0x17')][_0x6d5c('0x18')]({'where':{'id':_0x2841be[_0x6d5c('0x19')]}})[_0x6d5c('0x1a')](function(_0x29a2c8){if(_0x29a2c8){_0x29a2c8[_0x6d5c('0x1b')]({'lastMsgAt':_0x2841be[_0x6d5c('0x1c')],'lastMsgDirection':_0x2841be[_0x6d5c('0x13')]['toLowerCase']()});}})[_0x6d5c('0x1d')](function(_0xbdd01){console[_0x6d5c('0x1e')](_0xbdd01);});}if(_0x2841be[_0x6d5c('0x13')]===_0x6d5c('0x14')&&!_0x2841be['secret']){var _0x206e25;_0x27572f[_0x6d5c('0x1f')][_0x6d5c('0x20')]({'where':{'id':_0x2841be[_0x6d5c('0x21')]},'raw':!![]})[_0x6d5c('0x1a')](function(_0x4f45ea){_0x206e25=_0x4f45ea;if(_0x206e25&&_0x206e25[_0x6d5c('0x22')]){switch(_0x206e25[_0x6d5c('0x22')]){case _0x6d5c('0x23'):var _0x1e8442=require(_0x6d5c('0x23'));if(_0x206e25[_0x6d5c('0x24')]&&_0x206e25['authToken']&&_0x206e25[_0x6d5c('0x25')]){var _0x3d2e20=new _0x1e8442(_0x206e25['accountSid'],_0x206e25[_0x6d5c('0x26')]);_0x3d2e20[_0x6d5c('0x27')]['create']({'body':_0x2841be['body'],'to':_0x6d5c('0x28')+_0x2841be['phone'],'from':_0x6d5c('0x28')+_0x206e25[_0x6d5c('0x25')],'statusCallback':_0x206e25['remote']+_0x6d5c('0x29')+_0x2841be['id']+_0x6d5c('0x2a')+_0x206e25[_0x6d5c('0x2b')]})[_0x6d5c('0x1a')](function(_0x222059){if(_0x222059['sid']){return _0x217dfb[_0x6d5c('0x1b')]({'messageId':_0x222059['sid']});}})[_0x6d5c('0x1d')](function(_0x8c5e22){logger[_0x6d5c('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x6d5c('0x2c'),_0x6d5c('0x23'),util[_0x6d5c('0x2d')](_0x8c5e22,{'showHidden':![],'depth':null}));});}else{logger[_0x6d5c('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6d5c('0x23'),_0x6d5c('0x2e'));}break;}}})[_0x6d5c('0x2f')](function(){_0x5d5193();});}else{_0x5d5193();}}},'charset':'utf8mb4','collate':_0x6d5c('0x30')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 2891f73..254e44e 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 _0x8662=['catch','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','WhatsappMessage','create','body','options','raw','debug','CreateWhatsappMessage'];(function(_0x22c0e5,_0x21ba80){var _0x4c8935=function(_0x3bb825){while(--_0x3bb825){_0x22c0e5['push'](_0x22c0e5['shift']());}};_0x4c8935(++_0x21ba80);}(_0x8662,0x7d));var _0x2866=function(_0x8b56df,_0x4f8452){_0x8b56df=_0x8b56df-0x0;var _0x33f8d9=_0x8662[_0x8b56df];return _0x33f8d9;};'use strict';var _=require('lodash');var util=require(_0x2866('0x0'));var moment=require('moment');var BPromise=require(_0x2866('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2866('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2866('0x3'));var logger=require('../../config/logger')(_0x2866('0x4'));var config=require(_0x2866('0x5'));var jayson=require(_0x2866('0x6'));var client=jayson['client'][_0x2866('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2866('0x8')],{'host':_0x2866('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2866('0x8')]));require(_0x2866('0xa'))[_0x2866('0xb')](socket);function respondWithRpcPromise(_0xec3a74,_0x1e0ccb,_0x5e60fe){return new BPromise(function(_0x2aa6ff,_0x398bc5){return client[_0x2866('0xc')](_0xec3a74,_0x5e60fe)[_0x2866('0xd')](function(_0x236ec1){logger[_0x2866('0xe')]('WhatsappMessage,\x20%s,\x20%s',_0x1e0ccb,_0x2866('0xf'));logger['debug'](_0x2866('0x10'),_0x1e0ccb,_0x2866('0xf'),JSON[_0x2866('0x11')](_0x236ec1));if(_0x236ec1[_0x2866('0x12')]){if(_0x236ec1[_0x2866('0x12')][_0x2866('0x13')]===0x1f4){logger[_0x2866('0x12')](_0x2866('0x14'),_0x1e0ccb,_0x236ec1[_0x2866('0x12')]['message']);return _0x398bc5(_0x236ec1['error'][_0x2866('0x15')]);}logger[_0x2866('0x12')](_0x2866('0x14'),_0x1e0ccb,_0x236ec1['error'][_0x2866('0x15')]);return _0x2aa6ff(_0x236ec1[_0x2866('0x12')][_0x2866('0x15')]);}else{logger['info'](_0x2866('0x14'),_0x1e0ccb,_0x2866('0xf'));_0x2aa6ff(_0x236ec1[_0x2866('0x16')][_0x2866('0x15')]);}})['catch'](function(_0x28682f){logger[_0x2866('0x12')](_0x2866('0x14'),_0x1e0ccb,_0x28682f);_0x398bc5(_0x28682f);});});}exports['CreateWhatsappMessage']=function(_0x2650f6){var _0x53cecf=this;return new Promise(function(_0x59490a,_0x23bf03){return db[_0x2866('0x17')][_0x2866('0x18')](_0x2650f6[_0x2866('0x19')],{'raw':_0x2650f6[_0x2866('0x1a')]?_0x2650f6[_0x2866('0x1a')][_0x2866('0x1b')]===undefined?!![]:![]:!![]})[_0x2866('0xd')](function(_0x449111){logger['info']('CreateWhatsappMessage',_0x2650f6);logger[_0x2866('0x1c')](_0x2866('0x1d'),_0x2650f6,JSON[_0x2866('0x11')](_0x449111));_0x59490a(_0x449111);})[_0x2866('0x1e')](function(_0x58a6de){logger[_0x2866('0x12')]('CreateWhatsappMessage',_0x58a6de[_0x2866('0x15')],_0x2650f6);_0x23bf03(_0x53cecf['error'](0x1f4,_0x58a6de['message']));});});}; \ No newline at end of file +var _0x5f57=['create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage'];(function(_0x1539bf,_0x28aace){var _0x2607eb=function(_0x137f3e){while(--_0x137f3e){_0x1539bf['push'](_0x1539bf['shift']());}};_0x2607eb(++_0x28aace);}(_0x5f57,0xe4));var _0x75f5=function(_0x51b459,_0x1e5823){_0x51b459=_0x51b459-0x0;var _0x2d3066=_0x5f57[_0x51b459];return _0x2d3066;};'use strict';var _=require(_0x75f5('0x0'));var util=require('util');var moment=require(_0x75f5('0x1'));var BPromise=require(_0x75f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75f5('0x3'));var db=require(_0x75f5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75f5('0x5'))(_0x75f5('0x6'));var config=require(_0x75f5('0x7'));var jayson=require(_0x75f5('0x8'));var client=jayson[_0x75f5('0x9')][_0x75f5('0xa')]({'port':0x232a});config[_0x75f5('0xb')]=_[_0x75f5('0xc')](config[_0x75f5('0xb')],{'host':_0x75f5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5b1cd6,_0x731262,_0x4822a9){return new BPromise(function(_0x2167fc,_0x31a9a6){return client[_0x75f5('0xe')](_0x5b1cd6,_0x4822a9)[_0x75f5('0xf')](function(_0x1c43b5){logger['info'](_0x75f5('0x10'),_0x731262,'request\x20sent');logger[_0x75f5('0x11')](_0x75f5('0x12'),_0x731262,_0x75f5('0x13'),JSON[_0x75f5('0x14')](_0x1c43b5));if(_0x1c43b5[_0x75f5('0x15')]){if(_0x1c43b5[_0x75f5('0x15')][_0x75f5('0x16')]===0x1f4){logger['error'](_0x75f5('0x10'),_0x731262,_0x1c43b5[_0x75f5('0x15')][_0x75f5('0x17')]);return _0x31a9a6(_0x1c43b5[_0x75f5('0x15')]['message']);}logger[_0x75f5('0x15')](_0x75f5('0x10'),_0x731262,_0x1c43b5[_0x75f5('0x15')][_0x75f5('0x17')]);return _0x2167fc(_0x1c43b5['error'][_0x75f5('0x17')]);}else{logger['info'](_0x75f5('0x10'),_0x731262,_0x75f5('0x13'));_0x2167fc(_0x1c43b5[_0x75f5('0x18')][_0x75f5('0x17')]);}})[_0x75f5('0x19')](function(_0x98a103){logger[_0x75f5('0x15')](_0x75f5('0x10'),_0x731262,_0x98a103);_0x31a9a6(_0x98a103);});});}exports[_0x75f5('0x1a')]=function(_0x4d5eec){var _0x48715f=this;return new Promise(function(_0x1f25c2,_0x12d2b5){return db[_0x75f5('0x1b')][_0x75f5('0x1c')](_0x4d5eec[_0x75f5('0x1d')],{'raw':_0x4d5eec[_0x75f5('0x1e')]?_0x4d5eec[_0x75f5('0x1e')][_0x75f5('0x1f')]===undefined?!![]:![]:!![]})[_0x75f5('0xf')](function(_0x1032a5){logger['info'](_0x75f5('0x1a'),_0x4d5eec);logger['debug'](_0x75f5('0x1a'),_0x4d5eec,JSON[_0x75f5('0x14')](_0x1032a5));_0x1f25c2(_0x1032a5);})[_0x75f5('0x19')](function(_0x23ab4a){logger['error'](_0x75f5('0x1a'),_0x23ab4a[_0x75f5('0x17')],_0x4d5eec);_0x12d2b5(_0x48715f[_0x75f5('0x15')](0x1f4,_0x23ab4a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index afdaebe..0cee81b 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 _0xf987=['length','./whatsappMessage.events','save','remove','emit','removeListener','register'];(function(_0x2adf80,_0x3b0644){var _0x3b15b7=function(_0x492243){while(--_0x492243){_0x2adf80['push'](_0x2adf80['shift']());}};_0x3b15b7(++_0x3b0644);}(_0xf987,0x1dd));var _0x7f98=function(_0x10c66e,_0x5b7497){_0x10c66e=_0x10c66e-0x0;var _0x488f6a=_0xf987[_0x10c66e];return _0x488f6a;};'use strict';var WhatsappMessageEvents=require(_0x7f98('0x0'));var events=[_0x7f98('0x1'),_0x7f98('0x2'),'update'];function createListener(_0x553661,_0x41c06e){return function(_0xe56f24){_0x41c06e[_0x7f98('0x3')](_0x553661,_0xe56f24);};}function removeListener(_0x40993d,_0x891400){return function(){WhatsappMessageEvents[_0x7f98('0x4')](_0x40993d,_0x891400);};}exports[_0x7f98('0x5')]=function(_0x8ee805){for(var _0x28c1cf=0x0,_0x365d86=events[_0x7f98('0x6')];_0x28c1cf<_0x365d86;_0x28c1cf++){var _0x2a936=events[_0x28c1cf];var _0x1c25e4=createListener('whatsappMessage:'+_0x2a936,_0x8ee805);WhatsappMessageEvents['on'](_0x2a936,_0x1c25e4);}}; \ No newline at end of file +var _0xff48=['remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xff48,0xe7));var _0x8ff4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xff48[_0x321bb2];return _0x9c12ed;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x8ff4('0x0'),_0x8ff4('0x1')];function createListener(_0x59f6a9,_0x175152){return function(_0x5b8896){_0x175152[_0x8ff4('0x2')](_0x59f6a9,_0x5b8896);};}function removeListener(_0x196b48,_0x4c7692){return function(){WhatsappMessageEvents[_0x8ff4('0x3')](_0x196b48,_0x4c7692);};}exports[_0x8ff4('0x4')]=function(_0x1868f2){for(var _0x587ec1=0x0,_0x57589a=events[_0x8ff4('0x5')];_0x587ec1<_0x57589a;_0x587ec1++){var _0x45ee1a=events[_0x587ec1];var _0x882347=createListener(_0x8ff4('0x6')+_0x45ee1a,_0x1868f2);WhatsappMessageEvents['on'](_0x45ee1a,_0x882347);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a5f9fa6..f4e4264 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 _0xb6dc=['removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','/:id','removeTeams'];(function(_0x1424b1,_0x5129b2){var _0x5dfc38=function(_0x163dca){while(--_0x163dca){_0x1424b1['push'](_0x1424b1['shift']());}};_0x5dfc38(++_0x5129b2);}(_0xb6dc,0xaa));var _0xcb6d=function(_0x58c414,_0x1cf439){_0x58c414=_0x58c414-0x0;var _0x35dd9e=_0xb6dc[_0x58c414];return _0x35dd9e;};'use strict';var multer=require('multer');var util=require(_0xcb6d('0x0'));var path=require(_0xcb6d('0x1'));var timeout=require(_0xcb6d('0x2'));var express=require(_0xcb6d('0x3'));var router=express[_0xcb6d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb6d('0x5'));var interaction=require(_0xcb6d('0x6'));var config=require(_0xcb6d('0x7'));var controller=require('./whatsappQueue.controller');router[_0xcb6d('0x8')]('/',auth[_0xcb6d('0x9')](),controller['index']);router['get'](_0xcb6d('0xa'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0xb')]);router[_0xcb6d('0x8')]('/:id',auth[_0xcb6d('0x9')](),controller[_0xcb6d('0xc')]);router[_0xcb6d('0x8')](_0xcb6d('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0xcb6d('0x8')](_0xcb6d('0xe'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0xf')]);router[_0xcb6d('0x8')](_0xcb6d('0x10'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x11')]);router[_0xcb6d('0x12')]('/',auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x13')]);router[_0xcb6d('0x12')](_0xcb6d('0xe'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x14')]);router[_0xcb6d('0x12')]('/:id/users',auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x15')]);router[_0xcb6d('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcb6d('0x17')](_0xcb6d('0x18'),auth[_0xcb6d('0x9')](),controller['destroy']);router['delete'](_0xcb6d('0xe'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x19')]);router[_0xcb6d('0x17')](_0xcb6d('0x10'),auth['isAuthenticated'](),controller[_0xcb6d('0x1a')]);module[_0xcb6d('0x1b')]=router; \ No newline at end of file +var _0x0a1f=['index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','addAgents','put','delete','destroy','removeTeams','/:id/users','removeAgents','exports','util','path','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x154213,_0x4e72b1){var _0xd159ad=function(_0x1d0382){while(--_0x1d0382){_0x154213['push'](_0x154213['shift']());}};_0xd159ad(++_0x4e72b1);}(_0x0a1f,0x88));var _0xf0a1=function(_0x38eff9,_0x418912){_0x38eff9=_0x38eff9-0x0;var _0x4ec890=_0x0a1f[_0x38eff9];return _0x4ec890;};'use strict';var multer=require('multer');var util=require(_0xf0a1('0x0'));var path=require(_0xf0a1('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0a1('0x2'));var router=express[_0xf0a1('0x3')]();var fs_extra=require(_0xf0a1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0a1('0x5'));var controller=require(_0xf0a1('0x6'));router[_0xf0a1('0x7')]('/',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x9')]);router[_0xf0a1('0x7')](_0xf0a1('0xa'),auth['isAuthenticated'](),controller[_0xf0a1('0xb')]);router[_0xf0a1('0x7')](_0xf0a1('0xc'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0xd')]);router[_0xf0a1('0x7')]('/:id/members',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0xe')]);router[_0xf0a1('0x7')](_0xf0a1('0xf'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x10')]);router[_0xf0a1('0x7')]('/:id/users',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x11')]);router['post']('/',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x12')]);router[_0xf0a1('0x13')](_0xf0a1('0xf'),auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x14')]);router[_0xf0a1('0x13')]('/:id/users',auth[_0xf0a1('0x8')](),controller[_0xf0a1('0x15')]);router[_0xf0a1('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf0a1('0x17')](_0xf0a1('0xc'),auth['isAuthenticated'](),controller[_0xf0a1('0x18')]);router[_0xf0a1('0x17')](_0xf0a1('0xf'),auth['isAuthenticated'](),controller[_0xf0a1('0x19')]);router[_0xf0a1('0x17')](_0xf0a1('0x1a'),auth['isAuthenticated'](),controller[_0xf0a1('0x1b')]);module[_0xf0a1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 14013ef..6455f34 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 _0x8d97=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x2525e6,_0x27d74a){var _0x2af02a=function(_0x864f39){while(--_0x864f39){_0x2525e6['push'](_0x2525e6['shift']());}};_0x2af02a(++_0x27d74a);}(_0x8d97,0x82));var _0x78d9=function(_0x1467cc,_0x2cd110){_0x1467cc=_0x1467cc-0x0;var _0x3866e3=_0x8d97[_0x1467cc];return _0x3866e3;};'use strict';var Sequelize=require('sequelize');module[_0x78d9('0x0')]={'name':{'type':Sequelize[_0x78d9('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x78d9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78d9('0x3')](_0x78d9('0x4'),_0x78d9('0x5'),_0x78d9('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xed8a=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x1f621f,_0x52dff3){var _0x1d4320=function(_0x54cc34){while(--_0x54cc34){_0x1f621f['push'](_0x1f621f['shift']());}};_0x1d4320(++_0x52dff3);}(_0xed8a,0xc5));var _0xaed8=function(_0x4032a4,_0x5598fd){_0x4032a4=_0x4032a4-0x0;var _0x1a6efc=_0xed8a[_0x4032a4];return _0x1a6efc;};'use strict';var Sequelize=require(_0xaed8('0x0'));module[_0xaed8('0x1')]={'name':{'type':Sequelize[_0xaed8('0x2')],'unique':_0xaed8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaed8('0x4')](_0xaed8('0x5'),'beepall',_0xaed8('0x6'))},'description':{'type':Sequelize[_0xaed8('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 12c986f..d5b4f11 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 _0x8ef6=['key','keys','filters','model','query','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','find','params','describe','getMembers','UserWhatsappQueue','hasOwnProperty','findAndCountAll','UserId','updatedAt','format','SIP','whatsappPause','createdAt','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','forEach','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','end','json','limit','undefined','offset','status','set','Content-Range','apply','reject','save','update','then','get','WhatsappQueues','error','name','send','map','WhatsappQueue','fieldName'];(function(_0x2bd9c1,_0x26e3ae){var _0x2b44a7=function(_0x415c4e){while(--_0x415c4e){_0x2bd9c1['push'](_0x2bd9c1['shift']());}};_0x2b44a7(++_0x26e3ae);}(_0x8ef6,0xf2));var _0x68ef=function(_0xa78d97,_0x56848b){_0xa78d97=_0xa78d97-0x0;var _0x392e30=_0x8ef6[_0xa78d97];return _0x392e30;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];config[_0x68ef('0x1b')]=_[_0x68ef('0x1c')](config[_0x68ef('0x1b')],{'host':_0x68ef('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68ef('0x1b')]));require(_0x68ef('0x1e'))[_0x68ef('0x1f')](socket);function respondWithStatusCode(_0x47fbb5,_0x22fe96){_0x22fe96=_0x22fe96||0xcc;return function(_0x1764de){if(_0x1764de){return _0x47fbb5[_0x68ef('0x20')](_0x22fe96);}return _0x47fbb5['status'](_0x22fe96)[_0x68ef('0x21')]();};}function respondWithResult(_0x37c4cc,_0x3d1e90){_0x3d1e90=_0x3d1e90||0xc8;return function(_0x3780a4){if(_0x3780a4){return _0x37c4cc['status'](_0x3d1e90)[_0x68ef('0x22')](_0x3780a4);}};}function respondWithFilteredResult(_0x54139e,_0x5cbb78){return function(_0x2633c1){if(_0x2633c1){var _0x404870=typeof _0x5cbb78['offset']==='undefined'&&typeof _0x5cbb78[_0x68ef('0x23')]===_0x68ef('0x24');var _0x318514=_0x2633c1['count'];var _0x1dc49c=_0x404870?0x0:_0x5cbb78[_0x68ef('0x25')];var _0x183f5f=_0x404870?_0x2633c1['count']:_0x5cbb78[_0x68ef('0x25')]+_0x5cbb78[_0x68ef('0x23')];var _0x5af19f;if(_0x183f5f>=_0x318514){_0x183f5f=_0x318514;_0x5af19f=0xc8;}else{_0x5af19f=0xce;}_0x54139e[_0x68ef('0x26')](_0x5af19f);return _0x54139e[_0x68ef('0x27')](_0x68ef('0x28'),_0x1dc49c+'-'+_0x183f5f+'/'+_0x318514)['json'](_0x2633c1);}return null;};}function patchUpdates(_0x59723c){return function(_0x59bebc){try{jsonpatch[_0x68ef('0x29')](_0x59bebc,_0x59723c,!![]);}catch(_0x2023f2){return BPromise[_0x68ef('0x2a')](_0x2023f2);}return _0x59bebc[_0x68ef('0x2b')]();};}function saveUpdates(_0x438b4c,_0xfe2595){return function(_0x258cd5){if(_0x258cd5){return _0x258cd5[_0x68ef('0x2c')](_0x438b4c)[_0x68ef('0x2d')](function(_0x13280b){return _0x13280b;});}return null;};}function removeEntity(_0x5e4dbe,_0x178460){return function(_0x57f9ee){if(_0x57f9ee){return _0x57f9ee['destroy']()['then'](function(){var _0x1a7ce1=_0x57f9ee[_0x68ef('0x2e')]({'plain':!![]});var _0x123041=_0x68ef('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x123041,'resourceId':_0x1a7ce1['id']}})[_0x68ef('0x2d')](function(){return _0x57f9ee;});})[_0x68ef('0x2d')](function(){_0x5e4dbe[_0x68ef('0x26')](0xcc)[_0x68ef('0x21')]();});}};}function handleEntityNotFound(_0x22ef25,_0x201884){return function(_0x26288a){if(!_0x26288a){_0x22ef25[_0x68ef('0x20')](0x194);}return _0x26288a;};}function handleError(_0x5a6dfd,_0x3d19bf){_0x3d19bf=_0x3d19bf||0x1f4;return function(_0x4314bd){logger[_0x68ef('0x30')](_0x4314bd['stack']);if(_0x4314bd[_0x68ef('0x31')]){delete _0x4314bd['name'];}_0x5a6dfd[_0x68ef('0x26')](_0x3d19bf)[_0x68ef('0x32')](_0x4314bd);};}exports['index']=function(_0x5e1e1b,_0x159395){var _0x5fa72a={},_0x4b8fc8={},_0xf58fa1={'count':0x0,'rows':[]};var _0x8c0a06=_[_0x68ef('0x33')](db[_0x68ef('0x34')]['rawAttributes'],function(_0x2c8bd0){return{'name':_0x2c8bd0[_0x68ef('0x35')],'type':_0x2c8bd0['type'][_0x68ef('0x36')]};});_0x4b8fc8['model']=_[_0x68ef('0x33')](_0x8c0a06,_0x68ef('0x31'));_0x4b8fc8['query']=_[_0x68ef('0x37')](_0x5e1e1b['query']);_0x4b8fc8[_0x68ef('0x38')]=_['intersection'](_0x4b8fc8[_0x68ef('0x39')],_0x4b8fc8[_0x68ef('0x3a')]);_0x5fa72a[_0x68ef('0x3b')]=_['intersection'](_0x4b8fc8[_0x68ef('0x39')],qs['fields'](_0x5e1e1b[_0x68ef('0x3a')]['fields']));_0x5fa72a[_0x68ef('0x3b')]=_0x5fa72a[_0x68ef('0x3b')][_0x68ef('0x3c')]?_0x5fa72a[_0x68ef('0x3b')]:_0x4b8fc8[_0x68ef('0x39')];if(!_0x5e1e1b[_0x68ef('0x3a')]['hasOwnProperty'](_0x68ef('0x3d'))){_0x5fa72a[_0x68ef('0x23')]=qs[_0x68ef('0x23')](_0x5e1e1b['query'][_0x68ef('0x23')]);_0x5fa72a[_0x68ef('0x25')]=qs[_0x68ef('0x25')](_0x5e1e1b['query']['offset']);}_0x5fa72a[_0x68ef('0x3e')]=qs[_0x68ef('0x3f')](_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x3f')]);_0x5fa72a[_0x68ef('0x40')]=qs[_0x68ef('0x38')](_[_0x68ef('0x41')](_0x5e1e1b['query'],_0x4b8fc8[_0x68ef('0x38')]),_0x8c0a06);if(_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x42')]){_0x5fa72a[_0x68ef('0x40')]=_['merge'](_0x5fa72a[_0x68ef('0x40')],{'$or':_[_0x68ef('0x33')](_0x8c0a06,function(_0xcf595d){if(_0xcf595d[_0x68ef('0x43')]!==_0x68ef('0x44')){var _0x3b00ea={};_0x3b00ea[_0xcf595d['name']]={'$like':'%'+_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x42')]+'%'};return _0x3b00ea;}})});}_0x5fa72a=_[_0x68ef('0x45')]({},_0x5fa72a,_0x5e1e1b[_0x68ef('0x46')]);var _0x449f3c={'where':_0x5fa72a[_0x68ef('0x40')]};return db[_0x68ef('0x34')][_0x68ef('0x47')](_0x449f3c)[_0x68ef('0x2d')](function(_0x531096){_0xf58fa1[_0x68ef('0x47')]=_0x531096;if(_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x48')]){_0x5fa72a[_0x68ef('0x49')]=[{'all':!![]}];}return db[_0x68ef('0x34')][_0x68ef('0x4a')](_0x5fa72a);})[_0x68ef('0x2d')](function(_0x576767){_0xf58fa1[_0x68ef('0x4b')]=_0x576767;return _0xf58fa1;})['then'](respondWithFilteredResult(_0x159395,_0x5fa72a))[_0x68ef('0x4c')](handleError(_0x159395,null));};exports[_0x68ef('0x4d')]=function(_0x7470b9,_0xfc08d5){var _0x5a1330={'raw':!![],'where':{'id':_0x7470b9['params']['id']}},_0x428456={};_0x428456[_0x68ef('0x39')]=_['keys'](db[_0x68ef('0x34')][_0x68ef('0x4e')]);_0x428456[_0x68ef('0x3a')]=_['keys'](_0x7470b9['query']);_0x428456[_0x68ef('0x38')]=_[_0x68ef('0x4f')](_0x428456['model'],_0x428456['query']);_0x5a1330['attributes']=_[_0x68ef('0x4f')](_0x428456[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0x7470b9[_0x68ef('0x3a')][_0x68ef('0x50')]));_0x5a1330['attributes']=_0x5a1330['attributes'][_0x68ef('0x3c')]?_0x5a1330[_0x68ef('0x3b')]:_0x428456[_0x68ef('0x39')];if(_0x7470b9[_0x68ef('0x3a')]['includeAll']){_0x5a1330[_0x68ef('0x49')]=[{'all':!![]}];}_0x5a1330=_[_0x68ef('0x45')]({},_0x5a1330,_0x7470b9[_0x68ef('0x46')]);return db[_0x68ef('0x34')]['find'](_0x5a1330)['then'](handleEntityNotFound(_0xfc08d5,null))[_0x68ef('0x2d')](respondWithResult(_0xfc08d5,null))[_0x68ef('0x4c')](handleError(_0xfc08d5,null));};exports['create']=function(_0xfc7a74,_0x12fff3){return db[_0x68ef('0x34')][_0x68ef('0x51')](_0xfc7a74[_0x68ef('0x52')],{})['then'](function(_0x35d6bd){var _0x3984ca=_0xfc7a74[_0x68ef('0x53')]['get']({'plain':!![]});if(!_0x3984ca)throw new Error(_0x68ef('0x54'));if(_0x3984ca[_0x68ef('0x55')]===_0x68ef('0x53')){var _0x50ef1f=_0x35d6bd[_0x68ef('0x2e')]({'plain':!![]});var _0x59e8ee='WhatsappQueues';return db[_0x68ef('0x56')]['find']({'where':{'name':_0x59e8ee,'userProfileId':_0x3984ca[_0x68ef('0x57')]},'raw':!![]})[_0x68ef('0x2d')](function(_0x53ebd){if(_0x53ebd&&_0x53ebd[_0x68ef('0x58')]===0x0){return db[_0x68ef('0x59')][_0x68ef('0x51')]({'name':_0x50ef1f[_0x68ef('0x31')],'resourceId':_0x50ef1f['id'],'type':_0x53ebd[_0x68ef('0x31')],'sectionId':_0x53ebd['id']},{})[_0x68ef('0x2d')](function(){return _0x35d6bd;});}else{return _0x35d6bd;}})[_0x68ef('0x4c')](function(_0x538db4){logger['error'](_0x68ef('0x5a'),_0x538db4);throw _0x538db4;});}return _0x35d6bd;})[_0x68ef('0x2d')](respondWithResult(_0x12fff3,0xc9))[_0x68ef('0x4c')](handleError(_0x12fff3,null));};exports[_0x68ef('0x2c')]=function(_0x82df12,_0x1d11d7){if(_0x82df12[_0x68ef('0x52')]['id']){delete _0x82df12[_0x68ef('0x52')]['id'];}return db[_0x68ef('0x34')]['find']({'where':{'id':_0x82df12['params']['id']}})[_0x68ef('0x2d')](handleEntityNotFound(_0x1d11d7,null))['then'](saveUpdates(_0x82df12[_0x68ef('0x52')],null))['then'](respondWithResult(_0x1d11d7,null))[_0x68ef('0x4c')](handleError(_0x1d11d7,null));};exports[_0x68ef('0x5b')]=function(_0x552736,_0xa42737){return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x552736[_0x68ef('0x5d')]['id']}})[_0x68ef('0x2d')](handleEntityNotFound(_0xa42737,null))[_0x68ef('0x2d')](removeEntity(_0xa42737,null))[_0x68ef('0x4c')](handleError(_0xa42737,null));};exports[_0x68ef('0x5e')]=function(_0x5c347c,_0x1cdaef){return db[_0x68ef('0x34')][_0x68ef('0x5e')]()[_0x68ef('0x2d')](respondWithResult(_0x1cdaef,null))[_0x68ef('0x4c')](handleError(_0x1cdaef,null));};exports[_0x68ef('0x5f')]=function(_0x48e15a,_0x9a978f,_0x42d2a3){var _0x4886af={'raw':!![],'where':{}},_0x42fbac={},_0x114d9f;return db[_0x68ef('0x34')]['findOne']({'where':{'id':_0x48e15a[_0x68ef('0x5d')]['id']}})['then'](handleEntityNotFound(_0x9a978f,null))['then'](function(_0x3e5cca){if(_0x3e5cca){_0x114d9f=_0x3e5cca['get']({'plain':!![]});_0x42fbac[_0x68ef('0x39')]=_['keys'](db[_0x68ef('0x60')][_0x68ef('0x4e')]);_0x42fbac[_0x68ef('0x3a')]=_[_0x68ef('0x37')](_0x48e15a[_0x68ef('0x3a')]);_0x42fbac[_0x68ef('0x38')]=_['intersection'](_0x42fbac[_0x68ef('0x39')],_0x42fbac['query']);_0x4886af[_0x68ef('0x3b')]=_['intersection'](_0x42fbac[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0x48e15a[_0x68ef('0x3a')][_0x68ef('0x50')]));_0x4886af[_0x68ef('0x3b')]=_0x4886af[_0x68ef('0x3b')][_0x68ef('0x3c')]?_0x4886af['attributes']:_0x42fbac[_0x68ef('0x39')];if(!_0x48e15a[_0x68ef('0x3a')][_0x68ef('0x61')](_0x68ef('0x3d'))){_0x4886af[_0x68ef('0x23')]=qs['limit'](_0x48e15a[_0x68ef('0x3a')]['limit']);_0x4886af[_0x68ef('0x25')]=qs['offset'](_0x48e15a['query'][_0x68ef('0x25')]);}_0x4886af[_0x68ef('0x3e')]=qs[_0x68ef('0x3f')](_0x48e15a[_0x68ef('0x3a')]['sort']);_0x4886af[_0x68ef('0x40')]=qs['filters'](_[_0x68ef('0x41')](_0x48e15a[_0x68ef('0x3a')],_0x42fbac[_0x68ef('0x38')]));_0x4886af['where']['WhatsappQueueId']=_0x3e5cca['id'];if(_0x48e15a[_0x68ef('0x3a')][_0x68ef('0x42')]){_0x4886af[_0x68ef('0x40')]=_[_0x68ef('0x45')](_0x4886af['where'],{'$or':_[_0x68ef('0x33')](_0x4886af[_0x68ef('0x3b')],function(_0x19c20f){var _0x21b104={};_0x21b104[_0x19c20f]={'$like':'%'+_0x48e15a['query'][_0x68ef('0x42')]+'%'};return _0x21b104;})});}_0x4886af=_['merge']({},_0x4886af,_0x48e15a[_0x68ef('0x46')]);return db[_0x68ef('0x60')][_0x68ef('0x4a')](_0x4886af);}})[_0x68ef('0x2d')](function(_0xed16d1){if(_0xed16d1){return db['User'][_0x68ef('0x62')]({'where':{'id':_[_0x68ef('0x33')](_0xed16d1,_0x68ef('0x63')),'role':'agent'},'attributes':['id',_0x68ef('0x31'),'whatsappPause',_0x68ef('0x64'),'createdAt']});}})['then'](function(_0x100345){if(_0x100345){return{'count':_0x100345[_0x68ef('0x47')],'rows':_[_0x68ef('0x33')](_0x100345[_0x68ef('0x4b')],function(_0x501004){return{'membername':_0x501004[_0x68ef('0x31')],'UserId':_0x501004['id'],'queue_name':_0x114d9f[_0x68ef('0x31')],'WhatsappQueueId':_0x114d9f['id'],'interface':util[_0x68ef('0x65')]('%s/%s',_0x68ef('0x66'),_0x501004[_0x68ef('0x31')]),'penalty':0x0,'paused':_0x501004[_0x68ef('0x67')],'createdAt':_0x501004[_0x68ef('0x68')],'updatedAt':_0x501004[_0x68ef('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x68ef('0x2d')](respondWithFilteredResult(_0x9a978f,_0x4886af))[_0x68ef('0x4c')](handleError(_0x9a978f,null));};exports[_0x68ef('0x69')]=function(_0x156ce3,_0x11feff,_0x454999){var _0x6a48ad={};var _0x50e298={};var _0x15378c;var _0x391a81;return db['WhatsappQueue']['findOne']({'where':{'id':_0x156ce3[_0x68ef('0x5d')]['id']}})['then'](handleEntityNotFound(_0x11feff,null))[_0x68ef('0x2d')](function(_0x253947){if(_0x253947){_0x15378c=_0x253947;_0x50e298['model']=_['keys'](db[_0x68ef('0x6a')]['rawAttributes']);_0x50e298[_0x68ef('0x3a')]=_['keys'](_0x156ce3[_0x68ef('0x3a')]);_0x50e298['filters']=_[_0x68ef('0x4f')](_0x50e298[_0x68ef('0x39')],_0x50e298['query']);_0x6a48ad[_0x68ef('0x3b')]=_[_0x68ef('0x4f')](_0x50e298[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0x156ce3['query'][_0x68ef('0x50')]));_0x6a48ad[_0x68ef('0x3b')]=_0x6a48ad['attributes'][_0x68ef('0x3c')]?_0x6a48ad[_0x68ef('0x3b')]:_0x50e298[_0x68ef('0x39')];_0x6a48ad['order']=qs[_0x68ef('0x3f')](_0x156ce3['query'][_0x68ef('0x3f')]);_0x6a48ad[_0x68ef('0x40')]=qs['filters'](_['pick'](_0x156ce3['query'],_0x50e298['filters']));if(_0x156ce3[_0x68ef('0x3a')][_0x68ef('0x42')]){_0x6a48ad[_0x68ef('0x40')]=_[_0x68ef('0x45')](_0x6a48ad[_0x68ef('0x40')],{'$or':_[_0x68ef('0x33')](_0x6a48ad[_0x68ef('0x3b')],function(_0x285744){var _0x24ba34={};_0x24ba34[_0x285744]={'$like':'%'+_0x156ce3[_0x68ef('0x3a')][_0x68ef('0x42')]+'%'};return _0x24ba34;})});}_0x6a48ad=_[_0x68ef('0x45')]({},_0x6a48ad,_0x156ce3[_0x68ef('0x46')]);return _0x15378c['getTeams'](_0x6a48ad);}})[_0x68ef('0x2d')](function(_0x556dfc){if(_0x556dfc){_0x391a81=_0x556dfc[_0x68ef('0x3c')];if(!_0x156ce3['query']['hasOwnProperty'](_0x68ef('0x3d'))){_0x6a48ad[_0x68ef('0x23')]=qs[_0x68ef('0x23')](_0x156ce3[_0x68ef('0x3a')]['limit']);_0x6a48ad['offset']=qs[_0x68ef('0x25')](_0x156ce3[_0x68ef('0x3a')][_0x68ef('0x25')]);}return _0x15378c['getTeams'](_0x6a48ad);}})[_0x68ef('0x2d')](function(_0x23c69e){if(_0x23c69e){return _0x23c69e?{'count':_0x391a81,'rows':_0x23c69e}:null;}})[_0x68ef('0x2d')](respondWithResult(_0x11feff,null))[_0x68ef('0x4c')](handleError(_0x11feff,null));};exports['addTeams']=function(_0x214e89,_0x1d158f,_0x31550b){var _0x59d7d=_0x214e89[_0x68ef('0x52')][_0x68ef('0x6b')];return db['Team'][_0x68ef('0x4a')]({'where':{'id':_0x59d7d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68ef('0x6c'),'attributes':['id',_0x68ef('0x31'),_0x68ef('0x6d'),_0x68ef('0x6e'),'interface'],'raw':!![]}]})[_0x68ef('0x2d')](function(_0x4c47ab){if(_0x4c47ab){var _0x3d8d69=_[_0x68ef('0x6f')](_0x4c47ab,function(_0x5d6a31){var _0x55486a=_0x5d6a31[_0x68ef('0x2e')]({'plain':!![]});return _0x55486a['Agents'];});return db[_0x68ef('0x34')]['find']({'where':{'id':_0x214e89[_0x68ef('0x5d')]['id']}})[_0x68ef('0x2d')](function(_0x17385b){return db[_0x68ef('0x70')][_0x68ef('0x71')](function(_0x66a7a8){return _0x17385b['addTeams'](_0x59d7d,{'transaction':_0x66a7a8})[_0x68ef('0x2d')](function(){return BPromise[_0x68ef('0x72')](_0x3d8d69,function(_0x31cf5b){return db[_0x68ef('0x60')][_0x68ef('0x73')]({'where':{'UserId':_0x31cf5b['id'],'WhatsappQueueId':_0x214e89[_0x68ef('0x5d')]['id']},'transaction':_0x66a7a8});});})[_0x68ef('0x2d')](function(){_0x3d8d69['forEach'](function(_0x295c0f){socket[_0x68ef('0x74')](_0x68ef('0x75'),{'UserId':_0x295c0f['id'],'WhatsappQueueId':_0x17385b['id']});});});});});}})[_0x68ef('0x2d')](respondWithStatusCode(_0x1d158f,null))[_0x68ef('0x4c')](handleError(_0x1d158f,null));};exports[_0x68ef('0x76')]=function(_0x3e0d3d,_0x4478de,_0x1bcbbb){return db['Team'][_0x68ef('0x4a')]({'where':{'id':_0x3e0d3d['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68ef('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x68ef('0x2d')](handleEntityNotFound(_0x4478de,null))[_0x68ef('0x2d')](function(_0x55fc26){var _0x5aa209=_['map'](_0x55fc26,'id');var _0x2197c9=[];var _0x1d2b95=[];var _0x239d05=squel[_0x68ef('0x77')]();_0x239d05[_0x68ef('0x78')](_0x68ef('0x79'))['from'](_0x68ef('0x7a'),'tq')[_0x68ef('0x7b')](_0x68ef('0x7c'),'ut',_0x68ef('0x7d'))['where'](_0x68ef('0x7e'),_0x3e0d3d[_0x68ef('0x5d')]['id']);for(var _0x2e88ba=0x0;_0x2e88ba<_0x55fc26[_0x68ef('0x3c')];_0x2e88ba+=0x1){let _0x311a40=_0x55fc26[_0x2e88ba];for(var _0x254267=0x0;_0x254267<_0x311a40[_0x68ef('0x6c')][_0x68ef('0x3c')];_0x254267+=0x1){let _0x4cdc78=_0x311a40[_0x68ef('0x6c')][_0x254267];var _0x210ba6=_0x239d05['clone']();_0x210ba6[_0x68ef('0x40')](_0x68ef('0x7f'),_0x4cdc78['id']);_0x1d2b95[_0x68ef('0x80')](db[_0x68ef('0x70')][_0x68ef('0x3a')](_0x210ba6[_0x68ef('0x81')](),{'type':db[_0x68ef('0x70')][_0x68ef('0x82')][_0x68ef('0x83')]})[_0x68ef('0x2d')](function(_0x29522c){if(_0x29522c[_0x68ef('0x3c')]===0x1){return _0x4cdc78['id'];}else{var _0x2ce303=_[_0x68ef('0x84')](_[_0x68ef('0x33')](_0x29522c,_0x68ef('0x85')),function(_0x468130){return _[_0x68ef('0x86')](_0x5aa209,_0x468130);});if(_0x2ce303){return _0x4cdc78['id'];}}}));}}return BPromise['all'](_0x1d2b95)[_0x68ef('0x2d')](function(_0x2e815a){_0x2197c9=_(_0x2197c9)[_0x68ef('0x87')](_0x2e815a)[_0x68ef('0x88')]()[_0x68ef('0x89')]();return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x3e0d3d[_0x68ef('0x5d')]['id']}})['then'](function(_0x3d918b){return db['sequelize']['transaction'](function(_0x5a6148){return _0x3d918b['removeTeams'](_0x3e0d3d[_0x68ef('0x3a')]['ids'],{'transaction':_0x5a6148})[_0x68ef('0x2d')](function(){if(!_['isEmpty'](_0x2197c9)){return _0x3d918b['removeAgents'](_0x2197c9,{'transaction':_0x5a6148});}})['then'](function(){_0x2197c9[_0x68ef('0x8a')](function(_0x2e4c71){socket[_0x68ef('0x74')](_0x68ef('0x8b'),{'UserId':_0x2e4c71,'WhatsappQueueId':_0x3d918b['id']});});});});});});})[_0x68ef('0x2d')](respondWithStatusCode(_0x4478de,null))['catch'](handleError(_0x4478de,null));};exports[_0x68ef('0x8c')]=function(_0x263da0,_0x2fcfbe,_0x78f4f8){return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x263da0['params']['id']}})['then'](handleEntityNotFound(_0x2fcfbe,null))['then'](function(_0xbc0be3){if(_0xbc0be3){return _0xbc0be3[_0x68ef('0x8c')](_0x263da0[_0x68ef('0x52')][_0x68ef('0x6b')],_[_0x68ef('0x8d')](_0x263da0[_0x68ef('0x52')],[_0x68ef('0x6b'),'id'])||{})[_0x68ef('0x8e')](function(_0xa4e92){for(var _0x302c38=0x0;_0x302c38<_0x263da0[_0x68ef('0x52')][_0x68ef('0x6b')]['length'];_0x302c38+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':_0x263da0[_0x68ef('0x52')][_0x68ef('0x6b')][_0x302c38],'WhatsappQueueId':_0x263da0[_0x68ef('0x5d')]['id']});}return _0xa4e92;});}})['then'](respondWithResult(_0x2fcfbe,null))[_0x68ef('0x4c')](handleError(_0x2fcfbe,null));};exports['removeAgents']=function(_0x462a47,_0xc07b77,_0x635aa4){return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x462a47[_0x68ef('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc07b77,null))[_0x68ef('0x2d')](function(_0x1b9bfc){if(_0x1b9bfc){return _0x1b9bfc[_0x68ef('0x8f')](_0x462a47[_0x68ef('0x3a')][_0x68ef('0x6b')])[_0x68ef('0x2d')](function(){if(_[_0x68ef('0x90')](_0x462a47['query'][_0x68ef('0x6b')])){for(var _0x26121d=0x0;_0x26121d<_0x462a47[_0x68ef('0x3a')][_0x68ef('0x6b')][_0x68ef('0x3c')];_0x26121d+=0x1){socket[_0x68ef('0x74')](_0x68ef('0x8b'),{'UserId':Number(_0x462a47[_0x68ef('0x3a')][_0x68ef('0x6b')][_0x26121d]),'WhatsappQueueId':Number(_0x462a47[_0x68ef('0x5d')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x462a47[_0x68ef('0x3a')]['ids']),'WhatsappQueueId':Number(_0x462a47[_0x68ef('0x5d')]['id'])});}});}})[_0x68ef('0x2d')](respondWithStatusCode(_0xc07b77,null))[_0x68ef('0x4c')](handleError(_0xc07b77,null));};exports[_0x68ef('0x91')]=function(_0xd2a5d3,_0x489c26,_0x80fa59){var _0x1c3449={};var _0x1910d2={};var _0x3c862a;var _0x5129e9;return db['WhatsappQueue'][_0x68ef('0x92')]({'where':{'id':_0xd2a5d3[_0x68ef('0x5d')]['id']}})[_0x68ef('0x2d')](handleEntityNotFound(_0x489c26,null))[_0x68ef('0x2d')](function(_0x1914e9){if(_0x1914e9){_0x3c862a=_0x1914e9;_0x1910d2[_0x68ef('0x39')]=_[_0x68ef('0x37')](db[_0x68ef('0x93')][_0x68ef('0x4e')]);_0x1910d2[_0x68ef('0x3a')]=_[_0x68ef('0x37')](_0xd2a5d3['query']);_0x1910d2[_0x68ef('0x38')]=_[_0x68ef('0x4f')](_0x1910d2[_0x68ef('0x39')],_0x1910d2[_0x68ef('0x3a')]);_0x1c3449[_0x68ef('0x3b')]=_[_0x68ef('0x4f')](_0x1910d2[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0xd2a5d3[_0x68ef('0x3a')][_0x68ef('0x50')]));_0x1c3449['attributes']=_0x1c3449['attributes'][_0x68ef('0x3c')]?_0x1c3449[_0x68ef('0x3b')]:_0x1910d2[_0x68ef('0x39')];_0x1c3449[_0x68ef('0x3e')]=qs[_0x68ef('0x3f')](_0xd2a5d3[_0x68ef('0x3a')][_0x68ef('0x3f')]);_0x1c3449['where']=qs[_0x68ef('0x38')](_[_0x68ef('0x41')](_0xd2a5d3[_0x68ef('0x3a')],_0x1910d2[_0x68ef('0x38')]));if(_0xd2a5d3['query'][_0x68ef('0x42')]){_0x1c3449['where']=_[_0x68ef('0x45')](_0x1c3449[_0x68ef('0x40')],{'$or':_[_0x68ef('0x33')](_0x1c3449['attributes'],function(_0x53ff16){var _0xfc06d5={};_0xfc06d5[_0x53ff16]={'$like':'%'+_0xd2a5d3['query'][_0x68ef('0x42')]+'%'};return _0xfc06d5;})});}_0x1c3449=_['merge']({},_0x1c3449,_0xd2a5d3[_0x68ef('0x46')]);return _0x3c862a[_0x68ef('0x91')](_0x1c3449);}})['then'](function(_0x4a172f){if(_0x4a172f){_0x5129e9=_0x4a172f[_0x68ef('0x3c')];if(!_0xd2a5d3[_0x68ef('0x3a')]['hasOwnProperty'](_0x68ef('0x3d'))){_0x1c3449[_0x68ef('0x23')]=qs[_0x68ef('0x23')](_0xd2a5d3['query']['limit']);_0x1c3449[_0x68ef('0x25')]=qs['offset'](_0xd2a5d3[_0x68ef('0x3a')][_0x68ef('0x25')]);}return _0x3c862a[_0x68ef('0x91')](_0x1c3449);}})[_0x68ef('0x2d')](function(_0x15a8f1){if(_0x15a8f1){return _0x15a8f1?{'count':_0x5129e9,'rows':_0x15a8f1}:null;}})[_0x68ef('0x2d')](respondWithResult(_0x489c26,null))['catch'](handleError(_0x489c26,null));}; \ No newline at end of file +var _0x008c=['papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','WhatsappQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','params','describe','getMembers','findOne','rawAttributes','hasOwnProperty','WhatsappQueueId','UserWhatsappQueue','findAll','User','UserId','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','select','field','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','ids','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x3bd7f1,_0x5c71f8){var _0x247a7a=function(_0x38cc0f){while(--_0x38cc0f){_0x3bd7f1['push'](_0x3bd7f1['shift']());}};_0x247a7a(++_0x5c71f8);}(_0x008c,0x188));var _0xc008=function(_0x26bceb,_0x124ed3){_0x26bceb=_0x26bceb-0x0;var _0xcb6fef=_0x008c[_0x26bceb];return _0xcb6fef;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];config[_0xc008('0x18')]=_[_0xc008('0x19')](config[_0xc008('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc008('0x18')]));require('./whatsappQueue.socket')[_0xc008('0x1a')](socket);function respondWithStatusCode(_0x4584e1,_0x2073ef){_0x2073ef=_0x2073ef||0xcc;return function(_0x339ffc){if(_0x339ffc){return _0x4584e1[_0xc008('0x1b')](_0x2073ef);}return _0x4584e1['status'](_0x2073ef)['end']();};}function respondWithResult(_0x4bd0f4,_0x11ef38){_0x11ef38=_0x11ef38||0xc8;return function(_0x15a6ad){if(_0x15a6ad){return _0x4bd0f4[_0xc008('0x1c')](_0x11ef38)[_0xc008('0x1d')](_0x15a6ad);}};}function respondWithFilteredResult(_0x4fe771,_0x53b06e){return function(_0x540e45){if(_0x540e45){var _0x5c2668=typeof _0x53b06e[_0xc008('0x1e')]===_0xc008('0x1f')&&typeof _0x53b06e['limit']===_0xc008('0x1f');var _0x5906e6=_0x540e45['count'];var _0x543e5d=_0x5c2668?0x0:_0x53b06e['offset'];var _0x5754a0=_0x5c2668?_0x540e45['count']:_0x53b06e['offset']+_0x53b06e['limit'];var _0x4a582d;if(_0x5754a0>=_0x5906e6){_0x5754a0=_0x5906e6;_0x4a582d=0xc8;}else{_0x4a582d=0xce;}_0x4fe771['status'](_0x4a582d);return _0x4fe771[_0xc008('0x20')](_0xc008('0x21'),_0x543e5d+'-'+_0x5754a0+'/'+_0x5906e6)[_0xc008('0x1d')](_0x540e45);}return null;};}function patchUpdates(_0x415af3){return function(_0x11cc75){try{jsonpatch[_0xc008('0x22')](_0x11cc75,_0x415af3,!![]);}catch(_0x4f43e2){return BPromise[_0xc008('0x23')](_0x4f43e2);}return _0x11cc75['save']();};}function saveUpdates(_0x58a6ea,_0x218599){return function(_0x36f358){if(_0x36f358){return _0x36f358[_0xc008('0x24')](_0x58a6ea)[_0xc008('0x25')](function(_0x5410f5){return _0x5410f5;});}return null;};}function removeEntity(_0x48582b,_0x5de1e9){return function(_0x3f7b07){if(_0x3f7b07){return _0x3f7b07[_0xc008('0x26')]()[_0xc008('0x25')](function(){var _0x2e31c2=_0x3f7b07['get']({'plain':!![]});var _0x5e2aca='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x5e2aca,'resourceId':_0x2e31c2['id']}})[_0xc008('0x25')](function(){return _0x3f7b07;});})[_0xc008('0x25')](function(){_0x48582b[_0xc008('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c14c,_0x32390d){return function(_0x209591){if(!_0x209591){_0x24c14c[_0xc008('0x1b')](0x194);}return _0x209591;};}function handleError(_0x4c5dec,_0xcdb32b){_0xcdb32b=_0xcdb32b||0x1f4;return function(_0x2e0b4e){logger['error'](_0x2e0b4e['stack']);if(_0x2e0b4e['name']){delete _0x2e0b4e[_0xc008('0x27')];}_0x4c5dec[_0xc008('0x1c')](_0xcdb32b)[_0xc008('0x28')](_0x2e0b4e);};}exports[_0xc008('0x29')]=function(_0x1de04b,_0xceebc3){var _0x294f97={},_0x22d8e8={},_0x1fe1e1={'count':0x0,'rows':[]};var _0x2b862d=_[_0xc008('0x2a')](db[_0xc008('0x2b')]['rawAttributes'],function(_0x334a09){return{'name':_0x334a09[_0xc008('0x2c')],'type':_0x334a09['type'][_0xc008('0x2d')]};});_0x22d8e8[_0xc008('0x2e')]=_[_0xc008('0x2a')](_0x2b862d,_0xc008('0x27'));_0x22d8e8[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x1de04b[_0xc008('0x2f')]);_0x22d8e8[_0xc008('0x31')]=_[_0xc008('0x32')](_0x22d8e8['model'],_0x22d8e8[_0xc008('0x2f')]);_0x294f97[_0xc008('0x33')]=_[_0xc008('0x32')](_0x22d8e8[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x1de04b[_0xc008('0x2f')][_0xc008('0x34')]));_0x294f97['attributes']=_0x294f97[_0xc008('0x33')][_0xc008('0x35')]?_0x294f97['attributes']:_0x22d8e8[_0xc008('0x2e')];if(!_0x1de04b[_0xc008('0x2f')]['hasOwnProperty'](_0xc008('0x36'))){_0x294f97[_0xc008('0x37')]=qs[_0xc008('0x37')](_0x1de04b['query']['limit']);_0x294f97['offset']=qs[_0xc008('0x1e')](_0x1de04b['query'][_0xc008('0x1e')]);}_0x294f97[_0xc008('0x38')]=qs[_0xc008('0x39')](_0x1de04b[_0xc008('0x2f')][_0xc008('0x39')]);_0x294f97[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x1de04b[_0xc008('0x2f')],_0x22d8e8[_0xc008('0x31')]),_0x2b862d);if(_0x1de04b[_0xc008('0x2f')][_0xc008('0x3c')]){_0x294f97[_0xc008('0x3a')]=_[_0xc008('0x3d')](_0x294f97['where'],{'$or':_[_0xc008('0x2a')](_0x2b862d,function(_0x23c4db){if(_0x23c4db[_0xc008('0x3e')]!==_0xc008('0x3f')){var _0x49a16d={};_0x49a16d[_0x23c4db[_0xc008('0x27')]]={'$like':'%'+_0x1de04b[_0xc008('0x2f')][_0xc008('0x3c')]+'%'};return _0x49a16d;}})});}_0x294f97=_[_0xc008('0x3d')]({},_0x294f97,_0x1de04b[_0xc008('0x40')]);var _0x5706bb={'where':_0x294f97[_0xc008('0x3a')]};return db[_0xc008('0x2b')][_0xc008('0x41')](_0x5706bb)[_0xc008('0x25')](function(_0x7279e8){_0x1fe1e1['count']=_0x7279e8;if(_0x1de04b[_0xc008('0x2f')][_0xc008('0x42')]){_0x294f97[_0xc008('0x43')]=[{'all':!![]}];}return db[_0xc008('0x2b')]['findAll'](_0x294f97);})[_0xc008('0x25')](function(_0xe37446){_0x1fe1e1[_0xc008('0x44')]=_0xe37446;return _0x1fe1e1;})['then'](respondWithFilteredResult(_0xceebc3,_0x294f97))[_0xc008('0x45')](handleError(_0xceebc3,null));};exports['show']=function(_0x3dd097,_0x5d3a72){var _0x46fa8f={'raw':!![],'where':{'id':_0x3dd097['params']['id']}},_0x213014={};_0x213014[_0xc008('0x2e')]=_[_0xc008('0x30')](db[_0xc008('0x2b')]['rawAttributes']);_0x213014[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x3dd097[_0xc008('0x2f')]);_0x213014[_0xc008('0x31')]=_[_0xc008('0x32')](_0x213014[_0xc008('0x2e')],_0x213014['query']);_0x46fa8f['attributes']=_['intersection'](_0x213014[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x3dd097[_0xc008('0x2f')][_0xc008('0x34')]));_0x46fa8f[_0xc008('0x33')]=_0x46fa8f[_0xc008('0x33')][_0xc008('0x35')]?_0x46fa8f[_0xc008('0x33')]:_0x213014['model'];if(_0x3dd097['query']['includeAll']){_0x46fa8f[_0xc008('0x43')]=[{'all':!![]}];}_0x46fa8f=_[_0xc008('0x3d')]({},_0x46fa8f,_0x3dd097[_0xc008('0x40')]);return db['WhatsappQueue'][_0xc008('0x46')](_0x46fa8f)[_0xc008('0x25')](handleEntityNotFound(_0x5d3a72,null))[_0xc008('0x25')](respondWithResult(_0x5d3a72,null))[_0xc008('0x45')](handleError(_0x5d3a72,null));};exports[_0xc008('0x47')]=function(_0x56e4ac,_0x17ec90){return db[_0xc008('0x2b')][_0xc008('0x47')](_0x56e4ac[_0xc008('0x48')],{})['then'](function(_0x4c63d4){var _0x223056=_0x56e4ac['user'][_0xc008('0x49')]({'plain':!![]});if(!_0x223056)throw new Error(_0xc008('0x4a'));if(_0x223056[_0xc008('0x4b')]==='user'){var _0x144ab2=_0x4c63d4[_0xc008('0x49')]({'plain':!![]});var _0xee64=_0xc008('0x4c');return db[_0xc008('0x4d')]['find']({'where':{'name':_0xee64,'userProfileId':_0x223056[_0xc008('0x4e')]},'raw':!![]})[_0xc008('0x25')](function(_0x4b4c6d){if(_0x4b4c6d&&_0x4b4c6d[_0xc008('0x4f')]===0x0){return db[_0xc008('0x50')]['create']({'name':_0x144ab2['name'],'resourceId':_0x144ab2['id'],'type':_0x4b4c6d[_0xc008('0x27')],'sectionId':_0x4b4c6d['id']},{})[_0xc008('0x25')](function(){return _0x4c63d4;});}else{return _0x4c63d4;}})[_0xc008('0x45')](function(_0x30d0aa){logger[_0xc008('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30d0aa);throw _0x30d0aa;});}return _0x4c63d4;})['then'](respondWithResult(_0x17ec90,0xc9))[_0xc008('0x45')](handleError(_0x17ec90,null));};exports['update']=function(_0x3d7cce,_0x25d351){if(_0x3d7cce[_0xc008('0x48')]['id']){delete _0x3d7cce[_0xc008('0x48')]['id'];}return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x3d7cce['params']['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x25d351,null))[_0xc008('0x25')](saveUpdates(_0x3d7cce[_0xc008('0x48')],null))[_0xc008('0x25')](respondWithResult(_0x25d351,null))[_0xc008('0x45')](handleError(_0x25d351,null));};exports['destroy']=function(_0x41fae3,_0x4fdab4){return db['WhatsappQueue']['find']({'where':{'id':_0x41fae3[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x4fdab4,null))[_0xc008('0x25')](removeEntity(_0x4fdab4,null))['catch'](handleError(_0x4fdab4,null));};exports[_0xc008('0x53')]=function(_0x2d8361,_0x3dda82){return db['WhatsappQueue'][_0xc008('0x53')]()[_0xc008('0x25')](respondWithResult(_0x3dda82,null))[_0xc008('0x45')](handleError(_0x3dda82,null));};exports[_0xc008('0x54')]=function(_0x5baff1,_0x4022dd,_0x4eaa6d){var _0x23ef33={'raw':!![],'where':{}},_0x422e1f={},_0x2ae14e;return db[_0xc008('0x2b')][_0xc008('0x55')]({'where':{'id':_0x5baff1[_0xc008('0x52')]['id']}})['then'](handleEntityNotFound(_0x4022dd,null))[_0xc008('0x25')](function(_0x570001){if(_0x570001){_0x2ae14e=_0x570001['get']({'plain':!![]});_0x422e1f[_0xc008('0x2e')]=_[_0xc008('0x30')](db['UserWhatsappQueue'][_0xc008('0x56')]);_0x422e1f[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x5baff1[_0xc008('0x2f')]);_0x422e1f[_0xc008('0x31')]=_[_0xc008('0x32')](_0x422e1f[_0xc008('0x2e')],_0x422e1f['query']);_0x23ef33[_0xc008('0x33')]=_[_0xc008('0x32')](_0x422e1f[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x5baff1[_0xc008('0x2f')][_0xc008('0x34')]));_0x23ef33[_0xc008('0x33')]=_0x23ef33[_0xc008('0x33')][_0xc008('0x35')]?_0x23ef33[_0xc008('0x33')]:_0x422e1f[_0xc008('0x2e')];if(!_0x5baff1[_0xc008('0x2f')][_0xc008('0x57')](_0xc008('0x36'))){_0x23ef33['limit']=qs[_0xc008('0x37')](_0x5baff1[_0xc008('0x2f')][_0xc008('0x37')]);_0x23ef33['offset']=qs[_0xc008('0x1e')](_0x5baff1[_0xc008('0x2f')]['offset']);}_0x23ef33['order']=qs[_0xc008('0x39')](_0x5baff1[_0xc008('0x2f')][_0xc008('0x39')]);_0x23ef33[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x5baff1[_0xc008('0x2f')],_0x422e1f[_0xc008('0x31')]));_0x23ef33[_0xc008('0x3a')][_0xc008('0x58')]=_0x570001['id'];if(_0x5baff1[_0xc008('0x2f')]['filter']){_0x23ef33[_0xc008('0x3a')]=_[_0xc008('0x3d')](_0x23ef33[_0xc008('0x3a')],{'$or':_[_0xc008('0x2a')](_0x23ef33['attributes'],function(_0x17ffb1){var _0x5975de={};_0x5975de[_0x17ffb1]={'$like':'%'+_0x5baff1[_0xc008('0x2f')][_0xc008('0x3c')]+'%'};return _0x5975de;})});}_0x23ef33=_[_0xc008('0x3d')]({},_0x23ef33,_0x5baff1['options']);return db[_0xc008('0x59')][_0xc008('0x5a')](_0x23ef33);}})[_0xc008('0x25')](function(_0x553f5c){if(_0x553f5c){return db[_0xc008('0x5b')]['findAndCountAll']({'where':{'id':_[_0xc008('0x2a')](_0x553f5c,_0xc008('0x5c')),'role':_0xc008('0x5d')},'attributes':['id',_0xc008('0x27'),_0xc008('0x5e'),'updatedAt',_0xc008('0x5f')]});}})[_0xc008('0x25')](function(_0x49493b){if(_0x49493b){return{'count':_0x49493b[_0xc008('0x41')],'rows':_['map'](_0x49493b[_0xc008('0x44')],function(_0x50bfe5){return{'membername':_0x50bfe5[_0xc008('0x27')],'UserId':_0x50bfe5['id'],'queue_name':_0x2ae14e['name'],'WhatsappQueueId':_0x2ae14e['id'],'interface':util[_0xc008('0x60')](_0xc008('0x61'),_0xc008('0x62'),_0x50bfe5[_0xc008('0x27')]),'penalty':0x0,'paused':_0x50bfe5['whatsappPause'],'createdAt':_0x50bfe5[_0xc008('0x5f')],'updatedAt':_0x50bfe5[_0xc008('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc008('0x25')](respondWithFilteredResult(_0x4022dd,_0x23ef33))[_0xc008('0x45')](handleError(_0x4022dd,null));};exports[_0xc008('0x64')]=function(_0x13ef78,_0xd9e3fd,_0x3b46e4){var _0x5be2f8={};var _0x3e535b={};var _0x530c2f;var _0x511477;return db['WhatsappQueue'][_0xc008('0x55')]({'where':{'id':_0x13ef78[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0xd9e3fd,null))[_0xc008('0x25')](function(_0xc2f684){if(_0xc2f684){_0x530c2f=_0xc2f684;_0x3e535b[_0xc008('0x2e')]=_[_0xc008('0x30')](db[_0xc008('0x65')][_0xc008('0x56')]);_0x3e535b['query']=_[_0xc008('0x30')](_0x13ef78[_0xc008('0x2f')]);_0x3e535b[_0xc008('0x31')]=_[_0xc008('0x32')](_0x3e535b[_0xc008('0x2e')],_0x3e535b[_0xc008('0x2f')]);_0x5be2f8[_0xc008('0x33')]=_[_0xc008('0x32')](_0x3e535b[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x13ef78[_0xc008('0x2f')][_0xc008('0x34')]));_0x5be2f8['attributes']=_0x5be2f8['attributes'][_0xc008('0x35')]?_0x5be2f8[_0xc008('0x33')]:_0x3e535b[_0xc008('0x2e')];_0x5be2f8['order']=qs[_0xc008('0x39')](_0x13ef78[_0xc008('0x2f')]['sort']);_0x5be2f8['where']=qs['filters'](_[_0xc008('0x3b')](_0x13ef78[_0xc008('0x2f')],_0x3e535b[_0xc008('0x31')]));if(_0x13ef78[_0xc008('0x2f')][_0xc008('0x3c')]){_0x5be2f8[_0xc008('0x3a')]=_[_0xc008('0x3d')](_0x5be2f8[_0xc008('0x3a')],{'$or':_[_0xc008('0x2a')](_0x5be2f8[_0xc008('0x33')],function(_0x52091b){var _0x57b8ad={};_0x57b8ad[_0x52091b]={'$like':'%'+_0x13ef78[_0xc008('0x2f')][_0xc008('0x3c')]+'%'};return _0x57b8ad;})});}_0x5be2f8=_[_0xc008('0x3d')]({},_0x5be2f8,_0x13ef78[_0xc008('0x40')]);return _0x530c2f[_0xc008('0x64')](_0x5be2f8);}})[_0xc008('0x25')](function(_0x4b434f){if(_0x4b434f){_0x511477=_0x4b434f['length'];if(!_0x13ef78[_0xc008('0x2f')][_0xc008('0x57')](_0xc008('0x36'))){_0x5be2f8['limit']=qs['limit'](_0x13ef78['query']['limit']);_0x5be2f8['offset']=qs['offset'](_0x13ef78[_0xc008('0x2f')]['offset']);}return _0x530c2f[_0xc008('0x64')](_0x5be2f8);}})['then'](function(_0x2772c9){if(_0x2772c9){return _0x2772c9?{'count':_0x511477,'rows':_0x2772c9}:null;}})[_0xc008('0x25')](respondWithResult(_0xd9e3fd,null))[_0xc008('0x45')](handleError(_0xd9e3fd,null));};exports['addTeams']=function(_0x58f348,_0x2ff671,_0x51a194){var _0x29d8e0=_0x58f348[_0xc008('0x48')]['ids'];return db[_0xc008('0x65')]['findAll']({'where':{'id':_0x29d8e0},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc008('0x66'),'attributes':['id',_0xc008('0x27'),'online',_0xc008('0x67'),_0xc008('0x68')],'raw':!![]}]})[_0xc008('0x25')](function(_0x4bd290){if(_0x4bd290){var _0xf7c648=_[_0xc008('0x69')](_0x4bd290,function(_0x1181c5){var _0x29da7d=_0x1181c5[_0xc008('0x49')]({'plain':!![]});return _0x29da7d[_0xc008('0x66')];});return db['WhatsappQueue'][_0xc008('0x46')]({'where':{'id':_0x58f348[_0xc008('0x52')]['id']}})[_0xc008('0x25')](function(_0x4946d3){return db[_0xc008('0x6a')][_0xc008('0x6b')](function(_0x4452a8){return _0x4946d3['addTeams'](_0x29d8e0,{'transaction':_0x4452a8})['then'](function(){return BPromise['each'](_0xf7c648,function(_0x46cf1c){return db[_0xc008('0x59')][_0xc008('0x6c')]({'where':{'UserId':_0x46cf1c['id'],'WhatsappQueueId':_0x58f348[_0xc008('0x52')]['id']},'transaction':_0x4452a8});});})[_0xc008('0x25')](function(){_0xf7c648[_0xc008('0x6d')](function(_0x2ad409){socket[_0xc008('0x6e')]('userWhatsappQueue:save',{'UserId':_0x2ad409['id'],'WhatsappQueueId':_0x4946d3['id']});});});});});}})[_0xc008('0x25')](respondWithStatusCode(_0x2ff671,null))[_0xc008('0x45')](handleError(_0x2ff671,null));};exports['removeTeams']=function(_0x58949b,_0x2257b0,_0x128123){return db[_0xc008('0x65')][_0xc008('0x5a')]({'where':{'id':_0x58949b[_0xc008('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc008('0x5b')],'as':_0xc008('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2257b0,null))[_0xc008('0x25')](function(_0x1cc68f){var _0x9dff11=_[_0xc008('0x2a')](_0x1cc68f,'id');var _0x5261cb=[];var _0x360528=[];var _0x2d42e0=squel[_0xc008('0x6f')]();_0x2d42e0[_0xc008('0x70')]('tq.TeamId')[_0xc008('0x71')](_0xc008('0x72'),'tq')['join']('user_has_teams','ut',_0xc008('0x73'))['where'](_0xc008('0x74'),_0x58949b[_0xc008('0x52')]['id']);for(var _0x4a8546=0x0;_0x4a8546<_0x1cc68f[_0xc008('0x35')];_0x4a8546+=0x1){let _0x201ffa=_0x1cc68f[_0x4a8546];for(var _0x3ed6eb=0x0;_0x3ed6eb<_0x201ffa[_0xc008('0x66')][_0xc008('0x35')];_0x3ed6eb+=0x1){let _0x1cbd0c=_0x201ffa[_0xc008('0x66')][_0x3ed6eb];var _0x2b2bfb=_0x2d42e0[_0xc008('0x75')]();_0x2b2bfb[_0xc008('0x3a')]('ut.UserId\x20=\x20?',_0x1cbd0c['id']);_0x360528['push'](db[_0xc008('0x6a')][_0xc008('0x2f')](_0x2b2bfb['toString'](),{'type':db[_0xc008('0x6a')][_0xc008('0x76')][_0xc008('0x77')]})['then'](function(_0x303cdd){if(_0x303cdd[_0xc008('0x35')]===0x1){return _0x1cbd0c['id'];}else{var _0x399661=_[_0xc008('0x78')](_[_0xc008('0x2a')](_0x303cdd,_0xc008('0x79')),function(_0x3c9518){return _['includes'](_0x9dff11,_0x3c9518);});if(_0x399661){return _0x1cbd0c['id'];}}}));}}return BPromise[_0xc008('0x7a')](_0x360528)['then'](function(_0x3181d8){_0x5261cb=_(_0x5261cb)[_0xc008('0x7b')](_0x3181d8)[_0xc008('0x7c')]()['value']();return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x58949b[_0xc008('0x52')]['id']}})[_0xc008('0x25')](function(_0x349a34){return db[_0xc008('0x6a')][_0xc008('0x6b')](function(_0x287492){return _0x349a34[_0xc008('0x7d')](_0x58949b[_0xc008('0x2f')]['ids'],{'transaction':_0x287492})[_0xc008('0x25')](function(){if(!_[_0xc008('0x7e')](_0x5261cb)){return _0x349a34[_0xc008('0x7f')](_0x5261cb,{'transaction':_0x287492});}})[_0xc008('0x25')](function(){_0x5261cb[_0xc008('0x6d')](function(_0x5d7db6){socket[_0xc008('0x6e')](_0xc008('0x80'),{'UserId':_0x5d7db6,'WhatsappQueueId':_0x349a34['id']});});});});});});})[_0xc008('0x25')](respondWithStatusCode(_0x2257b0,null))[_0xc008('0x45')](handleError(_0x2257b0,null));};exports[_0xc008('0x81')]=function(_0x2503d2,_0x3c3067,_0x220170){return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x2503d2[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x3c3067,null))[_0xc008('0x25')](function(_0x1094bf){if(_0x1094bf){return _0x1094bf[_0xc008('0x81')](_0x2503d2['body']['ids'],_[_0xc008('0x82')](_0x2503d2[_0xc008('0x48')],[_0xc008('0x83'),'id'])||{})[_0xc008('0x84')](function(_0x1c32b7){for(var _0xcf64a4=0x0;_0xcf64a4<_0x2503d2[_0xc008('0x48')][_0xc008('0x83')][_0xc008('0x35')];_0xcf64a4+=0x1){socket['emit'](_0xc008('0x85'),{'UserId':_0x2503d2[_0xc008('0x48')]['ids'][_0xcf64a4],'WhatsappQueueId':_0x2503d2[_0xc008('0x52')]['id']});}return _0x1c32b7;});}})[_0xc008('0x25')](respondWithResult(_0x3c3067,null))[_0xc008('0x45')](handleError(_0x3c3067,null));};exports[_0xc008('0x7f')]=function(_0x130ded,_0x3718d9,_0x5c4196){return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x130ded[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x3718d9,null))['then'](function(_0x13a0bd){if(_0x13a0bd){return _0x13a0bd['removeAgents'](_0x130ded[_0xc008('0x2f')][_0xc008('0x83')])['then'](function(){if(_[_0xc008('0x86')](_0x130ded['query'][_0xc008('0x83')])){for(var _0x4cb7d7=0x0;_0x4cb7d7<_0x130ded['query']['ids'][_0xc008('0x35')];_0x4cb7d7+=0x1){socket[_0xc008('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x130ded[_0xc008('0x2f')][_0xc008('0x83')][_0x4cb7d7]),'WhatsappQueueId':Number(_0x130ded['params']['id'])});}}else{socket[_0xc008('0x6e')](_0xc008('0x80'),{'UserId':Number(_0x130ded[_0xc008('0x2f')]['ids']),'WhatsappQueueId':Number(_0x130ded[_0xc008('0x52')]['id'])});}});}})[_0xc008('0x25')](respondWithStatusCode(_0x3718d9,null))[_0xc008('0x45')](handleError(_0x3718d9,null));};exports[_0xc008('0x87')]=function(_0x3f4272,_0x9b6108,_0x2d87ff){var _0x45a4d4={};var _0x31bf26={};var _0x21c2dc;var _0x427fd2;return db['WhatsappQueue'][_0xc008('0x55')]({'where':{'id':_0x3f4272[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x9b6108,null))['then'](function(_0xeaa37d){if(_0xeaa37d){_0x21c2dc=_0xeaa37d;_0x31bf26[_0xc008('0x2e')]=_[_0xc008('0x30')](db['User'][_0xc008('0x56')]);_0x31bf26['query']=_[_0xc008('0x30')](_0x3f4272[_0xc008('0x2f')]);_0x31bf26[_0xc008('0x31')]=_['intersection'](_0x31bf26[_0xc008('0x2e')],_0x31bf26[_0xc008('0x2f')]);_0x45a4d4[_0xc008('0x33')]=_[_0xc008('0x32')](_0x31bf26[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x3f4272[_0xc008('0x2f')]['fields']));_0x45a4d4[_0xc008('0x33')]=_0x45a4d4[_0xc008('0x33')][_0xc008('0x35')]?_0x45a4d4[_0xc008('0x33')]:_0x31bf26['model'];_0x45a4d4[_0xc008('0x38')]=qs['sort'](_0x3f4272[_0xc008('0x2f')][_0xc008('0x39')]);_0x45a4d4[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x3f4272[_0xc008('0x2f')],_0x31bf26[_0xc008('0x31')]));if(_0x3f4272['query'][_0xc008('0x3c')]){_0x45a4d4[_0xc008('0x3a')]=_[_0xc008('0x3d')](_0x45a4d4[_0xc008('0x3a')],{'$or':_['map'](_0x45a4d4[_0xc008('0x33')],function(_0x493e24){var _0x2ea298={};_0x2ea298[_0x493e24]={'$like':'%'+_0x3f4272[_0xc008('0x2f')][_0xc008('0x3c')]+'%'};return _0x2ea298;})});}_0x45a4d4=_['merge']({},_0x45a4d4,_0x3f4272['options']);return _0x21c2dc[_0xc008('0x87')](_0x45a4d4);}})['then'](function(_0x4016fc){if(_0x4016fc){_0x427fd2=_0x4016fc[_0xc008('0x35')];if(!_0x3f4272[_0xc008('0x2f')][_0xc008('0x57')]('nolimit')){_0x45a4d4[_0xc008('0x37')]=qs[_0xc008('0x37')](_0x3f4272['query']['limit']);_0x45a4d4[_0xc008('0x1e')]=qs[_0xc008('0x1e')](_0x3f4272['query'][_0xc008('0x1e')]);}return _0x21c2dc[_0xc008('0x87')](_0x45a4d4);}})[_0xc008('0x25')](function(_0x3d571){if(_0x3d571){return _0x3d571?{'count':_0x427fd2,'rows':_0x3d571}:null;}})['then'](respondWithResult(_0x9b6108,null))[_0xc008('0x45')](handleError(_0x9b6108,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 75d13df..2da136c 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 _0x678f=['remove','emit','hasOwnProperty','hook','events','WhatsappQueue','setMaxListeners','save','update'];(function(_0xafc3be,_0xf69cd1){var _0x2d8c7c=function(_0x16b7fa){while(--_0x16b7fa){_0xafc3be['push'](_0xafc3be['shift']());}};_0x2d8c7c(++_0xf69cd1);}(_0x678f,0x17e));var _0xf678=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x678f[_0x4bb581];return _0x316bf5;};'use strict';var EventEmitter=require(_0xf678('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xf678('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf678('0x2')](0x0);var events={'afterCreate':_0xf678('0x3'),'afterUpdate':_0xf678('0x4'),'afterDestroy':_0xf678('0x5')};function emitEvent(_0x13968e){return function(_0x3dcf8d,_0x2ece04,_0x91f042){WhatsappQueueEvents[_0xf678('0x6')](_0x13968e+':'+_0x3dcf8d['id'],_0x3dcf8d);WhatsappQueueEvents[_0xf678('0x6')](_0x13968e,_0x3dcf8d);_0x91f042(null);};}for(var e in events){if(events[_0xf678('0x7')](e)){var event=events[e];WhatsappQueue[_0xf678('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xc344=['update','remove','emit','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x589fc9,_0x5999b9){var _0x3a0797=function(_0x976649){while(--_0x976649){_0x589fc9['push'](_0x589fc9['shift']());}};_0x3a0797(++_0x5999b9);}(_0xc344,0x1f3));var _0x4c34=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc344[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x4c34('0x0'));var WhatsappQueue=require(_0x4c34('0x1'))['db'][_0x4c34('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4c34('0x3')](0x0);var events={'afterCreate':_0x4c34('0x4'),'afterUpdate':_0x4c34('0x5'),'afterDestroy':_0x4c34('0x6')};function emitEvent(_0x343148){return function(_0x2fb420,_0x47a77b,_0x38df45){WhatsappQueueEvents[_0x4c34('0x7')](_0x343148+':'+_0x2fb420['id'],_0x2fb420);WhatsappQueueEvents[_0x4c34('0x7')](_0x343148,_0x2fb420);_0x38df45(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x4c34('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 2d64166..843fcd8 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 _0xb52a=['bluebird','rimraf','../../config/environment','./whatsappQueue.attributes','exports','lodash','../../config/logger','moment'];(function(_0x1bd8b7,_0x2a161f){var _0x2067ec=function(_0x2d9d7d){while(--_0x2d9d7d){_0x1bd8b7['push'](_0x1bd8b7['shift']());}};_0x2067ec(++_0x2a161f);}(_0xb52a,0x14d));var _0xab52=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0xb52a[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require(_0xab52('0x0'));var util=require('util');var logger=require(_0xab52('0x1'))('api');var moment=require(_0xab52('0x2'));var BPromise=require(_0xab52('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab52('0x4'));var config=require(_0xab52('0x5'));var attributes=require(_0xab52('0x6'));module[_0xab52('0x7')]=function(_0x40f8d3,_0x104e51){return _0x40f8d3['define']('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3885=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','util','../../config/logger','api'];(function(_0xa7dd32,_0x35561f){var _0x20f2f8=function(_0xe228c1){while(--_0xe228c1){_0xa7dd32['push'](_0xa7dd32['shift']());}};_0x20f2f8(++_0x35561f);}(_0x3885,0x115));var _0x5388=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3885[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x5388('0x0'));var logger=require(_0x5388('0x1'))(_0x5388('0x2'));var moment=require(_0x5388('0x3'));var BPromise=require(_0x5388('0x4'));var rp=require(_0x5388('0x5'));var fs=require('fs');var path=require(_0x5388('0x6'));var rimraf=require(_0x5388('0x7'));var config=require(_0x5388('0x8'));var attributes=require(_0x5388('0x9'));module[_0x5388('0xa')]=function(_0x4500cd,_0x4ca8ed){return _0x4500cd[_0x5388('0xb')](_0x5388('0xc'),attributes,{'tableName':_0x5388('0xd'),'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 cec9b42..ce5aa22 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 _0x9de7=['code','message','result','catch','WhatsappQueue','options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2543d7,_0x211f7d){var _0x3acf68=function(_0x24c12b){while(--_0x24c12b){_0x2543d7['push'](_0x2543d7['shift']());}};_0x3acf68(++_0x211f7d);}(_0x9de7,0x88));var _0x79de=function(_0x5f20f0,_0x4cfb6d){_0x5f20f0=_0x5f20f0-0x0;var _0x16b5a2=_0x9de7[_0x5f20f0];return _0x16b5a2;};'use strict';var _=require(_0x79de('0x0'));var util=require(_0x79de('0x1'));var moment=require(_0x79de('0x2'));var BPromise=require(_0x79de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79de('0x4'));var db=require(_0x79de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x79de('0x6'))('rpc');var config=require(_0x79de('0x7'));var jayson=require(_0x79de('0x8'));var client=jayson[_0x79de('0x9')][_0x79de('0xa')]({'port':0x232a});config[_0x79de('0xb')]=_[_0x79de('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79de('0xd'))[_0x79de('0xe')](socket);function respondWithRpcPromise(_0x2f3ec7,_0x105f37,_0x327d31){return new BPromise(function(_0x194c44,_0x5edbb4){return client[_0x79de('0xf')](_0x2f3ec7,_0x327d31)[_0x79de('0x10')](function(_0x1bb33c){logger[_0x79de('0x11')](_0x79de('0x12'),_0x105f37,_0x79de('0x13'));logger[_0x79de('0x14')](_0x79de('0x15'),_0x105f37,'request\x20sent',JSON[_0x79de('0x16')](_0x1bb33c));if(_0x1bb33c[_0x79de('0x17')]){if(_0x1bb33c[_0x79de('0x17')][_0x79de('0x18')]===0x1f4){logger[_0x79de('0x17')](_0x79de('0x12'),_0x105f37,_0x1bb33c[_0x79de('0x17')][_0x79de('0x19')]);return _0x5edbb4(_0x1bb33c['error'][_0x79de('0x19')]);}logger[_0x79de('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x105f37,_0x1bb33c[_0x79de('0x17')]['message']);return _0x194c44(_0x1bb33c['error'][_0x79de('0x19')]);}else{logger[_0x79de('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x105f37,_0x79de('0x13'));_0x194c44(_0x1bb33c[_0x79de('0x1a')][_0x79de('0x19')]);}})[_0x79de('0x1b')](function(_0x5c3e07){logger['error'](_0x79de('0x12'),_0x105f37,_0x5c3e07);_0x5edbb4(_0x5c3e07);});});}exports['GetWhatsappQueue']=function(_0x5c411c){var _0x2d94b6=this;return new Promise(function(_0x1e8913,_0x5cfbfd){return db[_0x79de('0x1c')]['findAll']({'raw':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')][_0x79de('0x1e')]||null:null,'attributes':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')][_0x79de('0x1f')]||null:null,'limit':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')][_0x79de('0x20')]||null:null,'include':_0x5c411c['options']?_0x5c411c['options'][_0x79de('0x21')]?_[_0x79de('0x22')](_0x5c411c[_0x79de('0x1d')][_0x79de('0x21')],function(_0x292334){return{'model':db[_0x292334[_0x79de('0x23')]],'as':_0x292334['as'],'attributes':_0x292334[_0x79de('0x1f')],'include':_0x292334['include']?_[_0x79de('0x22')](_0x292334['include'],function(_0x108c51){return{'model':db[_0x108c51['model']],'as':_0x108c51['as'],'attributes':_0x108c51[_0x79de('0x1f')],'include':_0x108c51[_0x79de('0x21')]?_[_0x79de('0x22')](_0x108c51[_0x79de('0x21')],function(_0x14da8f){return{'model':db[_0x14da8f[_0x79de('0x23')]],'as':_0x14da8f['as'],'attributes':_0x14da8f[_0x79de('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x79de('0x10')](function(_0x557384){logger[_0x79de('0x11')]('GetWhatsappQueue',_0x5c411c);logger[_0x79de('0x14')](_0x79de('0x24'),_0x5c411c,JSON[_0x79de('0x16')](_0x557384));_0x1e8913(_0x557384);})[_0x79de('0x1b')](function(_0x2f3335){logger[_0x79de('0x17')]('GetWhatsappQueue',_0x2f3335[_0x79de('0x19')],_0x5c411c);_0x5cfbfd(_0x2d94b6[_0x79de('0x17')](0x1f4,_0x2f3335[_0x79de('0x19')]));});});};exports[_0x79de('0x25')]=function(_0x5dfeaa){var _0x96650c=this;return new Promise(function(_0x59d28b,_0x534efe){return db[_0x79de('0x1c')][_0x79de('0x26')]({'raw':_0x5dfeaa['options']?_0x5dfeaa[_0x79de('0x1d')][_0x79de('0x27')]===undefined?!![]:![]:!![],'where':_0x5dfeaa['options']?_0x5dfeaa[_0x79de('0x1d')][_0x79de('0x1e')]||null:null,'attributes':_0x5dfeaa['options']?_0x5dfeaa['options'][_0x79de('0x1f')]||null:null,'include':_0x5dfeaa['options']?_0x5dfeaa['options'][_0x79de('0x21')]?_[_0x79de('0x22')](_0x5dfeaa[_0x79de('0x1d')][_0x79de('0x21')],function(_0x12dadb){return{'model':db[_0x12dadb[_0x79de('0x23')]],'as':_0x12dadb['as'],'attributes':_0x12dadb['attributes'],'include':_0x12dadb[_0x79de('0x21')]?_[_0x79de('0x22')](_0x12dadb[_0x79de('0x21')],function(_0x417afe){return{'model':db[_0x417afe[_0x79de('0x23')]],'as':_0x417afe['as'],'attributes':_0x417afe[_0x79de('0x1f')],'include':_0x417afe[_0x79de('0x21')]?_['map'](_0x417afe[_0x79de('0x21')],function(_0x257f9e){return{'model':db[_0x257f9e[_0x79de('0x23')]],'as':_0x257f9e['as'],'attributes':_0x257f9e[_0x79de('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x79de('0x10')](function(_0x3a681e){logger[_0x79de('0x11')](_0x79de('0x25'),_0x5dfeaa);logger[_0x79de('0x14')](_0x79de('0x25'),_0x5dfeaa,JSON['stringify'](_0x3a681e));_0x59d28b(_0x3a681e);})[_0x79de('0x1b')](function(_0x1ae550){logger[_0x79de('0x17')]('ShowWhatsappQueue',_0x1ae550[_0x79de('0x19')],_0x5dfeaa);_0x534efe(_0x96650c[_0x79de('0x17')](0x1f4,_0x1ae550[_0x79de('0x19')]));});});}; \ No newline at end of file +var _0xe33d=['findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue'];(function(_0x130079,_0x41274e){var _0x3b21fc=function(_0x247cc9){while(--_0x247cc9){_0x130079['push'](_0x130079['shift']());}};_0x3b21fc(++_0x41274e);}(_0xe33d,0x1cf));var _0xde33=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xe33d[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xde33('0x0'));var util=require(_0xde33('0x1'));var moment=require(_0xde33('0x2'));var BPromise=require(_0xde33('0x3'));var rs=require(_0xde33('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde33('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xde33('0x6'));var jayson=require(_0xde33('0x7'));var client=jayson[_0xde33('0x8')][_0xde33('0x9')]({'port':0x232a});config[_0xde33('0xa')]=_['defaults'](config[_0xde33('0xa')],{'host':_0xde33('0xb'),'port':0x18eb});var socket=require(_0xde33('0xc'))(new Redis(config[_0xde33('0xa')]));require(_0xde33('0xd'))[_0xde33('0xe')](socket);function respondWithRpcPromise(_0x6d56da,_0x47dd5b,_0x37d340){return new BPromise(function(_0x555913,_0xeb73e6){return client[_0xde33('0xf')](_0x6d56da,_0x37d340)[_0xde33('0x10')](function(_0xaddbb7){logger[_0xde33('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x47dd5b,_0xde33('0x12'));logger['debug'](_0xde33('0x13'),_0x47dd5b,_0xde33('0x12'),JSON[_0xde33('0x14')](_0xaddbb7));if(_0xaddbb7[_0xde33('0x15')]){if(_0xaddbb7[_0xde33('0x15')][_0xde33('0x16')]===0x1f4){logger[_0xde33('0x15')](_0xde33('0x17'),_0x47dd5b,_0xaddbb7[_0xde33('0x15')][_0xde33('0x18')]);return _0xeb73e6(_0xaddbb7[_0xde33('0x15')]['message']);}logger['error'](_0xde33('0x17'),_0x47dd5b,_0xaddbb7[_0xde33('0x15')]['message']);return _0x555913(_0xaddbb7[_0xde33('0x15')][_0xde33('0x18')]);}else{logger[_0xde33('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x47dd5b,_0xde33('0x12'));_0x555913(_0xaddbb7[_0xde33('0x19')][_0xde33('0x18')]);}})[_0xde33('0x1a')](function(_0x37f00c){logger['error'](_0xde33('0x17'),_0x47dd5b,_0x37f00c);_0xeb73e6(_0x37f00c);});});}exports[_0xde33('0x1b')]=function(_0x10c901){var _0xcb3cc4=this;return new Promise(function(_0x21b55f,_0x25b6ab){return db[_0xde33('0x1c')][_0xde33('0x1d')]({'raw':_0x10c901['options']?_0x10c901[_0xde33('0x1e')][_0xde33('0x1f')]===undefined?!![]:![]:!![],'where':_0x10c901[_0xde33('0x1e')]?_0x10c901[_0xde33('0x1e')][_0xde33('0x20')]||null:null,'attributes':_0x10c901['options']?_0x10c901[_0xde33('0x1e')][_0xde33('0x21')]||null:null,'limit':_0x10c901[_0xde33('0x1e')]?_0x10c901[_0xde33('0x1e')][_0xde33('0x22')]||null:null,'include':_0x10c901['options']?_0x10c901[_0xde33('0x1e')][_0xde33('0x23')]?_[_0xde33('0x24')](_0x10c901['options'][_0xde33('0x23')],function(_0x3b8cbe){return{'model':db[_0x3b8cbe['model']],'as':_0x3b8cbe['as'],'attributes':_0x3b8cbe[_0xde33('0x21')],'include':_0x3b8cbe[_0xde33('0x23')]?_[_0xde33('0x24')](_0x3b8cbe[_0xde33('0x23')],function(_0x2a0140){return{'model':db[_0x2a0140[_0xde33('0x25')]],'as':_0x2a0140['as'],'attributes':_0x2a0140['attributes'],'include':_0x2a0140[_0xde33('0x23')]?_[_0xde33('0x24')](_0x2a0140['include'],function(_0x12e582){return{'model':db[_0x12e582[_0xde33('0x25')]],'as':_0x12e582['as'],'attributes':_0x12e582[_0xde33('0x21')]};}):[]};}):[]};}):[]:[]})[_0xde33('0x10')](function(_0x11cce5){logger[_0xde33('0x11')]('GetWhatsappQueue',_0x10c901);logger[_0xde33('0x26')]('GetWhatsappQueue',_0x10c901,JSON['stringify'](_0x11cce5));_0x21b55f(_0x11cce5);})[_0xde33('0x1a')](function(_0x3db98f){logger[_0xde33('0x15')](_0xde33('0x1b'),_0x3db98f[_0xde33('0x18')],_0x10c901);_0x25b6ab(_0xcb3cc4[_0xde33('0x15')](0x1f4,_0x3db98f[_0xde33('0x18')]));});});};exports[_0xde33('0x27')]=function(_0x45bab6){var _0x1432ca=this;return new Promise(function(_0x28743d,_0x221703){return db[_0xde33('0x1c')][_0xde33('0x28')]({'raw':_0x45bab6[_0xde33('0x1e')]?_0x45bab6[_0xde33('0x1e')][_0xde33('0x1f')]===undefined?!![]:![]:!![],'where':_0x45bab6[_0xde33('0x1e')]?_0x45bab6[_0xde33('0x1e')]['where']||null:null,'attributes':_0x45bab6[_0xde33('0x1e')]?_0x45bab6[_0xde33('0x1e')][_0xde33('0x21')]||null:null,'include':_0x45bab6['options']?_0x45bab6[_0xde33('0x1e')][_0xde33('0x23')]?_['map'](_0x45bab6[_0xde33('0x1e')][_0xde33('0x23')],function(_0x118df8){return{'model':db[_0x118df8[_0xde33('0x25')]],'as':_0x118df8['as'],'attributes':_0x118df8[_0xde33('0x21')],'include':_0x118df8['include']?_[_0xde33('0x24')](_0x118df8[_0xde33('0x23')],function(_0x79ba9b){return{'model':db[_0x79ba9b[_0xde33('0x25')]],'as':_0x79ba9b['as'],'attributes':_0x79ba9b[_0xde33('0x21')],'include':_0x79ba9b[_0xde33('0x23')]?_['map'](_0x79ba9b['include'],function(_0x10d74e){return{'model':db[_0x10d74e[_0xde33('0x25')]],'as':_0x10d74e['as'],'attributes':_0x10d74e[_0xde33('0x21')]};}):[]};}):[]};}):[]:[]})[_0xde33('0x10')](function(_0x4825dc){logger[_0xde33('0x11')](_0xde33('0x27'),_0x45bab6);logger[_0xde33('0x26')](_0xde33('0x27'),_0x45bab6,JSON['stringify'](_0x4825dc));_0x28743d(_0x4825dc);})[_0xde33('0x1a')](function(_0x576716){logger[_0xde33('0x15')](_0xde33('0x27'),_0x576716['message'],_0x45bab6);_0x221703(_0x1432ca[_0xde33('0x15')](0x1f4,_0x576716[_0xde33('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a68be46..9de91a0 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 _0x4e4f=['./whatsappQueue.events','remove','removeListener','register','length','whatsappQueue:'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x4e4f,0x7e));var _0xf4e4=function(_0x3c3cca,_0x5f14ed){_0x3c3cca=_0x3c3cca-0x0;var _0x17e508=_0x4e4f[_0x3c3cca];return _0x17e508;};'use strict';var WhatsappQueueEvents=require(_0xf4e4('0x0'));var events=['save',_0xf4e4('0x1'),'update'];function createListener(_0x5ed846,_0xd39e92){return function(_0x3321b7){_0xd39e92['emit'](_0x5ed846,_0x3321b7);};}function removeListener(_0xd76a4,_0xba6783){return function(){WhatsappQueueEvents[_0xf4e4('0x2')](_0xd76a4,_0xba6783);};}exports[_0xf4e4('0x3')]=function(_0x2fc75e){for(var _0x1b5445=0x0,_0x5d905b=events[_0xf4e4('0x4')];_0x1b5445<_0x5d905b;_0x1b5445++){var _0x218a89=events[_0x1b5445];var _0x2c2023=createListener(_0xf4e4('0x5')+_0x218a89,_0x2fc75e);WhatsappQueueEvents['on'](_0x218a89,_0x2c2023);}}; \ No newline at end of file +var _0x371f=['whatsappQueue:','./whatsappQueue.events','remove','update','register','length'];(function(_0x14a34a,_0x424129){var _0x4d921e=function(_0x1982be){while(--_0x1982be){_0x14a34a['push'](_0x14a34a['shift']());}};_0x4d921e(++_0x424129);}(_0x371f,0x193));var _0xf371=function(_0x188219,_0x5bfa39){_0x188219=_0x188219-0x0;var _0x42b122=_0x371f[_0x188219];return _0x42b122;};'use strict';var WhatsappQueueEvents=require(_0xf371('0x0'));var events=['save',_0xf371('0x1'),_0xf371('0x2')];function createListener(_0x2daa21,_0x511f74){return function(_0x13a803){_0x511f74['emit'](_0x2daa21,_0x13a803);};}function removeListener(_0x40c9c9,_0x1b5bbd){return function(){WhatsappQueueEvents['removeListener'](_0x40c9c9,_0x1b5bbd);};}exports[_0xf371('0x3')]=function(_0x1f9225){for(var _0xb7fab5=0x0,_0x4b57c1=events[_0xf371('0x4')];_0xb7fab5<_0x4b57c1;_0xb7fab5++){var _0x45115b=events[_0xb7fab5];var _0x3c7bd0=createListener(_0xf371('0x5')+_0x45115b,_0x1f9225);WhatsappQueueEvents['on'](_0x45115b,_0x3c7bd0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index d1819a0..35eacf6 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 _0x9035=['../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x9035,0xd3));var _0x5903=function(_0xd0e3d8,_0x2d51d9){_0xd0e3d8=_0xd0e3d8-0x0;var _0x145da9=_0x9035[_0xd0e3d8];return _0x145da9;};'use strict';var multer=require(_0x5903('0x0'));var util=require(_0x5903('0x1'));var path=require(_0x5903('0x2'));var timeout=require(_0x5903('0x3'));var express=require(_0x5903('0x4'));var router=express[_0x5903('0x5')]();var fs_extra=require(_0x5903('0x6'));var auth=require(_0x5903('0x7'));var interaction=require(_0x5903('0x8'));var config=require(_0x5903('0x9'));var controller=require(_0x5903('0xa'));router[_0x5903('0xb')]('/',auth[_0x5903('0xc')](),controller[_0x5903('0xd')]);router[_0x5903('0xb')]('/describe',auth[_0x5903('0xc')](),controller[_0x5903('0xe')]);router[_0x5903('0xb')](_0x5903('0xf'),auth[_0x5903('0xc')](),controller[_0x5903('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5903('0x11')]);router['put'](_0x5903('0xf'),auth[_0x5903('0xc')](),controller[_0x5903('0x12')]);router[_0x5903('0x13')](_0x5903('0xf'),auth[_0x5903('0xc')](),controller[_0x5903('0x14')]);module[_0x5903('0x15')]=router; \ No newline at end of file +var _0x58e7=['./whatsappQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ec072,_0x43eb7a){var _0x25a1a5=function(_0x1f416e){while(--_0x1f416e){_0x4ec072['push'](_0x4ec072['shift']());}};_0x25a1a5(++_0x43eb7a);}(_0x58e7,0x1ec));var _0x758e=function(_0x2f6514,_0x2503fe){_0x2f6514=_0x2f6514-0x0;var _0x1d2c41=_0x58e7[_0x2f6514];return _0x1d2c41;};'use strict';var multer=require('multer');var util=require(_0x758e('0x0'));var path=require('path');var timeout=require(_0x758e('0x1'));var express=require(_0x758e('0x2'));var router=express[_0x758e('0x3')]();var fs_extra=require(_0x758e('0x4'));var auth=require(_0x758e('0x5'));var interaction=require(_0x758e('0x6'));var config=require(_0x758e('0x7'));var controller=require(_0x758e('0x8'));router[_0x758e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x758e('0x9')](_0x758e('0xa'),auth[_0x758e('0xb')](),controller[_0x758e('0xc')]);router[_0x758e('0x9')](_0x758e('0xd'),auth[_0x758e('0xb')](),controller['show']);router[_0x758e('0xe')]('/',auth[_0x758e('0xb')](),controller[_0x758e('0xf')]);router[_0x758e('0x10')](_0x758e('0xd'),auth[_0x758e('0xb')](),controller[_0x758e('0x11')]);router[_0x758e('0x12')](_0x758e('0xd'),auth[_0x758e('0xb')](),controller[_0x758e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index c142a4c..c977e5f 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(_0x55e4b7,_0x5b6806){var _0x57275d=function(_0x113941){while(--_0x113941){_0x55e4b7['push'](_0x55e4b7['shift']());}};_0x57275d(++_0x5b6806);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd65e,_0x5b9bc5){_0x1fd65e=_0x1fd65e-0x0;var _0x3fbbc9=_0x7a54[_0x1fd65e];return _0x3fbbc9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x167519,_0x2bd504){var _0x52f285=function(_0x2142b9){while(--_0x2142b9){_0x167519['push'](_0x167519['shift']());}};_0x52f285(++_0x2bd504);}(_0x7a54,0x106));var _0x47a5=function(_0x3da815,_0x3a5aa3){_0x3da815=_0x3da815-0x0;var _0x4975b9=_0x7a54[_0x3da815];return _0x4975b9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 9ae9dfb..749864d 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 _0xf45e=['Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','index','map','rawAttributes','type','key','model','name','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','update','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set'];(function(_0x1b0357,_0x1bdf14){var _0x164e7f=function(_0x47d36e){while(--_0x47d36e){_0x1b0357['push'](_0x1b0357['shift']());}};_0x164e7f(++_0x1bdf14);}(_0xf45e,0x115));var _0xef45=function(_0x4c1fe7,_0x511780){_0x4c1fe7=_0x4c1fe7-0x0;var _0x40052f=_0xf45e[_0x4c1fe7];return _0x40052f;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b35,_0x5f0593){return function(_0x38b470){if(!_0x38b470){_0x208b35[_0xef45('0x2a')](0x194);}return _0x38b470;};}function handleError(_0x578f03,_0x46e423){_0x46e423=_0x46e423||0x1f4;return function(_0x2c356d){logger['error'](_0x2c356d[_0xef45('0x2b')]);if(_0x2c356d['name']){delete _0x2c356d['name'];}_0x578f03['status'](_0x46e423)['send'](_0x2c356d);};}exports[_0xef45('0x2c')]=function(_0x2f72ef,_0x217e8d){var _0x15ad38={},_0x5782d0={},_0x18f304={'count':0x0,'rows':[]};var _0x4f028c=_[_0xef45('0x2d')](db['WhatsappQueueReport'][_0xef45('0x2e')],function(_0x5bfd2d){return{'name':_0x5bfd2d['fieldName'],'type':_0x5bfd2d[_0xef45('0x2f')][_0xef45('0x30')]};});_0x5782d0[_0xef45('0x31')]=_[_0xef45('0x2d')](_0x4f028c,_0xef45('0x32'));_0x5782d0['query']=_['keys'](_0x2f72ef['query']);_0x5782d0[_0xef45('0x33')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],_0x5782d0[_0xef45('0x35')]);_0x15ad38[_0xef45('0x36')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],qs['fields'](_0x2f72ef['query'][_0xef45('0x37')]));_0x15ad38['attributes']=_0x15ad38[_0xef45('0x36')]['length']?_0x15ad38[_0xef45('0x36')]:_0x5782d0[_0xef45('0x31')];if(!_0x2f72ef[_0xef45('0x35')][_0xef45('0x38')](_0xef45('0x39'))){_0x15ad38['limit']=qs[_0xef45('0x20')](_0x2f72ef[_0xef45('0x35')][_0xef45('0x20')]);_0x15ad38['offset']=qs['offset'](_0x2f72ef[_0xef45('0x35')][_0xef45('0x1e')]);}_0x15ad38['order']=qs[_0xef45('0x3a')](_0x2f72ef['query']['sort']);_0x15ad38[_0xef45('0x3b')]=qs[_0xef45('0x33')](_[_0xef45('0x3c')](_0x2f72ef['query'],_0x5782d0[_0xef45('0x33')]),_0x4f028c);if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]){_0x15ad38[_0xef45('0x3b')]=_['merge'](_0x15ad38['where'],{'$or':_[_0xef45('0x2d')](_0x4f028c,function(_0x474be1){if(_0x474be1[_0xef45('0x2f')]!==_0xef45('0x3e')){var _0x269a11={};_0x269a11[_0x474be1[_0xef45('0x32')]]={'$like':'%'+_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]+'%'};return _0x269a11;}})});}_0x15ad38=_['merge']({},_0x15ad38,_0x2f72ef['options']);var _0x13f8b2={'where':_0x15ad38[_0xef45('0x3b')]};return db[_0xef45('0x3f')][_0xef45('0x21')](_0x13f8b2)[_0xef45('0x29')](function(_0x3bcada){_0x18f304[_0xef45('0x21')]=_0x3bcada;if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x40')]){_0x15ad38[_0xef45('0x41')]=[{'all':!![]}];}return db[_0xef45('0x3f')][_0xef45('0x42')](_0x15ad38);})[_0xef45('0x29')](function(_0xd7d217){_0x18f304[_0xef45('0x43')]=_0xd7d217;return _0x18f304;})[_0xef45('0x29')](respondWithFilteredResult(_0x217e8d,_0x15ad38))['catch'](handleError(_0x217e8d,null));};exports[_0xef45('0x44')]=function(_0x5bdfad,_0x1b9d45){var _0x82c123={'raw':!![],'where':{'id':_0x5bdfad[_0xef45('0x45')]['id']}},_0x54ccb8={};_0x54ccb8['model']=_[_0xef45('0x46')](db['WhatsappQueueReport'][_0xef45('0x2e')]);_0x54ccb8[_0xef45('0x35')]=_[_0xef45('0x46')](_0x5bdfad[_0xef45('0x35')]);_0x54ccb8[_0xef45('0x33')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],_0x54ccb8['query']);_0x82c123[_0xef45('0x36')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],qs[_0xef45('0x37')](_0x5bdfad[_0xef45('0x35')][_0xef45('0x37')]));_0x82c123[_0xef45('0x36')]=_0x82c123[_0xef45('0x36')][_0xef45('0x47')]?_0x82c123[_0xef45('0x36')]:_0x54ccb8[_0xef45('0x31')];if(_0x5bdfad[_0xef45('0x35')][_0xef45('0x40')]){_0x82c123[_0xef45('0x41')]=[{'all':!![]}];}_0x82c123=_[_0xef45('0x48')]({},_0x82c123,_0x5bdfad['options']);return db[_0xef45('0x3f')][_0xef45('0x49')](_0x82c123)[_0xef45('0x29')](handleEntityNotFound(_0x1b9d45,null))['then'](respondWithResult(_0x1b9d45,null))['catch'](handleError(_0x1b9d45,null));};exports['create']=function(_0x29aeab,_0x18143c){return db[_0xef45('0x3f')][_0xef45('0x4a')](_0x29aeab[_0xef45('0x4b')],{})[_0xef45('0x29')](respondWithResult(_0x18143c,0xc9))['catch'](handleError(_0x18143c,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){if(_0x463796['body']['id']){delete _0x463796['body']['id'];}return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x463796['params']['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x2b2419,null))[_0xef45('0x29')](saveUpdates(_0x463796[_0xef45('0x4b')],null))[_0xef45('0x29')](respondWithResult(_0x2b2419,null))[_0xef45('0x4d')](handleError(_0x2b2419,null));};exports[_0xef45('0x28')]=function(_0x23581f,_0xfa5fdd){return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x23581f[_0xef45('0x45')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0xfa5fdd,null))[_0xef45('0x29')](removeEntity(_0xfa5fdd,null))[_0xef45('0x4d')](handleError(_0xfa5fdd,null));};exports['describe']=function(_0x22b75e,_0x24aceb){return db[_0xef45('0x3f')]['describe']()[_0xef45('0x29')](respondWithResult(_0x24aceb,null))[_0xef45('0x4d')](handleError(_0x24aceb,null));}; \ No newline at end of file +var _0xa902=['ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','WhatsappQueueReport','findAll','rows','catch','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv'];(function(_0x513571,_0x43beb3){var _0x2340bb=function(_0x4a6c12){while(--_0x4a6c12){_0x513571['push'](_0x513571['shift']());}};_0x2340bb(++_0x43beb3);}(_0xa902,0x8d));var _0x2a90=function(_0x682d41,_0x555e2c){_0x682d41=_0x682d41-0x0;var _0x5f6daf=_0xa902[_0x682d41];return _0x5f6daf;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];function respondWithStatusCode(_0x57458a,_0x1f6953){_0x1f6953=_0x1f6953||0xcc;return function(_0x57aee3){if(_0x57aee3){return _0x57458a[_0x2a90('0x17')](_0x1f6953);}return _0x57458a[_0x2a90('0x18')](_0x1f6953)[_0x2a90('0x19')]();};}function respondWithResult(_0x4c328b,_0x56d1b8){_0x56d1b8=_0x56d1b8||0xc8;return function(_0x57227c){if(_0x57227c){return _0x4c328b[_0x2a90('0x18')](_0x56d1b8)[_0x2a90('0x1a')](_0x57227c);}};}function respondWithFilteredResult(_0x5a2682,_0x1ff63d){return function(_0x21c648){if(_0x21c648){var _0x312782=typeof _0x1ff63d[_0x2a90('0x1b')]===_0x2a90('0x1c')&&typeof _0x1ff63d[_0x2a90('0x1d')]===_0x2a90('0x1c');var _0x10cf94=_0x21c648[_0x2a90('0x1e')];var _0x5c3e4b=_0x312782?0x0:_0x1ff63d[_0x2a90('0x1b')];var _0x1d9a28=_0x312782?_0x21c648[_0x2a90('0x1e')]:_0x1ff63d['offset']+_0x1ff63d[_0x2a90('0x1d')];var _0x1f51a6;if(_0x1d9a28>=_0x10cf94){_0x1d9a28=_0x10cf94;_0x1f51a6=0xc8;}else{_0x1f51a6=0xce;}_0x5a2682[_0x2a90('0x18')](_0x1f51a6);return _0x5a2682[_0x2a90('0x1f')](_0x2a90('0x20'),_0x5c3e4b+'-'+_0x1d9a28+'/'+_0x10cf94)[_0x2a90('0x1a')](_0x21c648);}return null;};}function patchUpdates(_0x312cd5){return function(_0x114d42){try{jsonpatch[_0x2a90('0x21')](_0x114d42,_0x312cd5,!![]);}catch(_0x465284){return BPromise[_0x2a90('0x22')](_0x465284);}return _0x114d42[_0x2a90('0x23')]();};}function saveUpdates(_0x4fdd62,_0x3da7d0){return function(_0x217873){if(_0x217873){return _0x217873[_0x2a90('0x24')](_0x4fdd62)[_0x2a90('0x25')](function(_0x5912fd){return _0x5912fd;});}return null;};}function removeEntity(_0x180485,_0xd033d){return function(_0x4ed9e6){if(_0x4ed9e6){return _0x4ed9e6[_0x2a90('0x26')]()[_0x2a90('0x25')](function(){_0x180485[_0x2a90('0x18')](0xcc)[_0x2a90('0x19')]();});}};}function handleEntityNotFound(_0x2a212c,_0x1303d9){return function(_0x29ed73){if(!_0x29ed73){_0x2a212c[_0x2a90('0x17')](0x194);}return _0x29ed73;};}function handleError(_0x48c2f9,_0x27f883){_0x27f883=_0x27f883||0x1f4;return function(_0x17f978){logger[_0x2a90('0x27')](_0x17f978[_0x2a90('0x28')]);if(_0x17f978[_0x2a90('0x29')]){delete _0x17f978['name'];}_0x48c2f9['status'](_0x27f883)[_0x2a90('0x2a')](_0x17f978);};}exports['index']=function(_0x53391e,_0x4969c3){var _0x2d83b3={},_0x3c78f5={},_0x595638={'count':0x0,'rows':[]};var _0x5bd700=_[_0x2a90('0x2b')](db['WhatsappQueueReport'][_0x2a90('0x2c')],function(_0x6892e1){return{'name':_0x6892e1[_0x2a90('0x2d')],'type':_0x6892e1[_0x2a90('0x2e')][_0x2a90('0x2f')]};});_0x3c78f5[_0x2a90('0x30')]=_[_0x2a90('0x2b')](_0x5bd700,'name');_0x3c78f5[_0x2a90('0x31')]=_[_0x2a90('0x32')](_0x53391e[_0x2a90('0x31')]);_0x3c78f5['filters']=_[_0x2a90('0x33')](_0x3c78f5[_0x2a90('0x30')],_0x3c78f5[_0x2a90('0x31')]);_0x2d83b3[_0x2a90('0x34')]=_['intersection'](_0x3c78f5[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x53391e[_0x2a90('0x31')][_0x2a90('0x35')]));_0x2d83b3[_0x2a90('0x34')]=_0x2d83b3[_0x2a90('0x34')]['length']?_0x2d83b3[_0x2a90('0x34')]:_0x3c78f5[_0x2a90('0x30')];if(!_0x53391e[_0x2a90('0x31')][_0x2a90('0x36')]('nolimit')){_0x2d83b3[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x53391e['query'][_0x2a90('0x1d')]);_0x2d83b3[_0x2a90('0x1b')]=qs['offset'](_0x53391e['query'][_0x2a90('0x1b')]);}_0x2d83b3[_0x2a90('0x37')]=qs[_0x2a90('0x38')](_0x53391e['query'][_0x2a90('0x38')]);_0x2d83b3['where']=qs[_0x2a90('0x39')](_['pick'](_0x53391e[_0x2a90('0x31')],_0x3c78f5['filters']),_0x5bd700);if(_0x53391e['query'][_0x2a90('0x3a')]){_0x2d83b3['where']=_[_0x2a90('0x3b')](_0x2d83b3[_0x2a90('0x3c')],{'$or':_[_0x2a90('0x2b')](_0x5bd700,function(_0x573aee){if(_0x573aee[_0x2a90('0x2e')]!==_0x2a90('0x3d')){var _0x3be438={};_0x3be438[_0x573aee['name']]={'$like':'%'+_0x53391e[_0x2a90('0x31')][_0x2a90('0x3a')]+'%'};return _0x3be438;}})});}_0x2d83b3=_[_0x2a90('0x3b')]({},_0x2d83b3,_0x53391e['options']);var _0x1aa096={'where':_0x2d83b3[_0x2a90('0x3c')]};return db['WhatsappQueueReport'][_0x2a90('0x1e')](_0x1aa096)[_0x2a90('0x25')](function(_0x2a6bea){_0x595638[_0x2a90('0x1e')]=_0x2a6bea;if(_0x53391e[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x2d83b3[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x40')][_0x2a90('0x41')](_0x2d83b3);})[_0x2a90('0x25')](function(_0x45b41c){_0x595638[_0x2a90('0x42')]=_0x45b41c;return _0x595638;})[_0x2a90('0x25')](respondWithFilteredResult(_0x4969c3,_0x2d83b3))[_0x2a90('0x43')](handleError(_0x4969c3,null));};exports['show']=function(_0x45cbc2,_0x3a70fe){var _0x528b41={'raw':!![],'where':{'id':_0x45cbc2[_0x2a90('0x44')]['id']}},_0x1045bb={};_0x1045bb[_0x2a90('0x30')]=_[_0x2a90('0x32')](db[_0x2a90('0x40')]['rawAttributes']);_0x1045bb[_0x2a90('0x31')]=_['keys'](_0x45cbc2[_0x2a90('0x31')]);_0x1045bb['filters']=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],_0x1045bb[_0x2a90('0x31')]);_0x528b41[_0x2a90('0x34')]=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x45cbc2['query']['fields']));_0x528b41[_0x2a90('0x34')]=_0x528b41[_0x2a90('0x34')][_0x2a90('0x45')]?_0x528b41[_0x2a90('0x34')]:_0x1045bb[_0x2a90('0x30')];if(_0x45cbc2[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x528b41[_0x2a90('0x3f')]=[{'all':!![]}];}_0x528b41=_['merge']({},_0x528b41,_0x45cbc2[_0x2a90('0x46')]);return db['WhatsappQueueReport'][_0x2a90('0x47')](_0x528b41)[_0x2a90('0x25')](handleEntityNotFound(_0x3a70fe,null))['then'](respondWithResult(_0x3a70fe,null))[_0x2a90('0x43')](handleError(_0x3a70fe,null));};exports[_0x2a90('0x48')]=function(_0x280e63,_0x1d55db){return db[_0x2a90('0x40')][_0x2a90('0x48')](_0x280e63[_0x2a90('0x49')],{})['then'](respondWithResult(_0x1d55db,0xc9))['catch'](handleError(_0x1d55db,null));};exports[_0x2a90('0x24')]=function(_0x2611d0,_0x42c890){if(_0x2611d0[_0x2a90('0x49')]['id']){delete _0x2611d0[_0x2a90('0x49')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x2611d0[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x42c890,null))['then'](saveUpdates(_0x2611d0['body'],null))['then'](respondWithResult(_0x42c890,null))[_0x2a90('0x43')](handleError(_0x42c890,null));};exports['destroy']=function(_0x370da3,_0x3dfe72){return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x370da3[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x3dfe72,null))['then'](removeEntity(_0x3dfe72,null))[_0x2a90('0x43')](handleError(_0x3dfe72,null));};exports[_0x2a90('0x4a')]=function(_0x48d3bc,_0x265769){return db['WhatsappQueueReport']['describe']()[_0x2a90('0x25')](respondWithResult(_0x265769,null))[_0x2a90('0x43')](handleError(_0x265769,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index cc47b0b..41c486d 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 _0xc8c6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xc8c6,0x179));var _0x6c8c=function(_0x159670,_0x55aa84){_0x159670=_0x159670-0x0;var _0x3a2519=_0xc8c6[_0x159670];return _0x3a2519;};'use strict';var _=require(_0x6c8c('0x0'));var util=require(_0x6c8c('0x1'));var logger=require(_0x6c8c('0x2'))(_0x6c8c('0x3'));var moment=require(_0x6c8c('0x4'));var BPromise=require(_0x6c8c('0x5'));var rp=require(_0x6c8c('0x6'));var fs=require('fs');var path=require(_0x6c8c('0x7'));var rimraf=require(_0x6c8c('0x8'));var config=require(_0x6c8c('0x9'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x5b1f81,_0x3b5d88){return _0x5b1f81['define'](_0x6c8c('0xa'),attributes,{'tableName':_0x6c8c('0xb'),'paranoid':![],'indexes':[{'name':_0x6c8c('0xc'),'fields':[_0x6c8c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe784=['util','../../config/logger','api','moment','./whatsappQueueReport.attributes','WhatsappQueueReport','lodash'];(function(_0xc511c7,_0x5b979a){var _0x3937ee=function(_0xb3c73b){while(--_0xb3c73b){_0xc511c7['push'](_0xc511c7['shift']());}};_0x3937ee(++_0x5b979a);}(_0xe784,0x11e));var _0x4e78=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xe784[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x4e78('0x0'));var util=require(_0x4e78('0x1'));var logger=require(_0x4e78('0x2'))(_0x4e78('0x3'));var moment=require(_0x4e78('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4e78('0x5'));module['exports']=function(_0x29c26f,_0x1735ef){return _0x29c26f['define'](_0x4e78('0x6'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 729275c..1d12f48 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 _0x6c78=['../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','debug','stringify','UpdateWhatsappQueueReport','update','attributes','limit','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x55dba4,_0x2713ec){var _0xdf0a05=function(_0x3c24b0){while(--_0x3c24b0){_0x55dba4['push'](_0x55dba4['shift']());}};_0xdf0a05(++_0x2713ec);}(_0x6c78,0x94));var _0x86c7=function(_0x225414,_0x245ff4){_0x225414=_0x225414-0x0;var _0x1d946a=_0x6c78[_0x225414];return _0x1d946a;};'use strict';var _=require(_0x86c7('0x0'));var util=require('util');var moment=require(_0x86c7('0x1'));var BPromise=require(_0x86c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86c7('0x3'));var db=require(_0x86c7('0x4'))['db'];var utils=require(_0x86c7('0x5'));var logger=require('../../config/logger')(_0x86c7('0x6'));var config=require(_0x86c7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x86c7('0x8')][_0x86c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49acc2,_0x35f977,_0x286252){return new BPromise(function(_0x16d05a,_0x43b1b6){return client[_0x86c7('0xa')](_0x49acc2,_0x286252)[_0x86c7('0xb')](function(_0x17e418){logger[_0x86c7('0xc')](_0x86c7('0xd'),_0x35f977,_0x86c7('0xe'));logger['debug'](_0x86c7('0xf'),_0x35f977,_0x86c7('0xe'),JSON['stringify'](_0x17e418));if(_0x17e418[_0x86c7('0x10')]){if(_0x17e418[_0x86c7('0x10')][_0x86c7('0x11')]===0x1f4){logger[_0x86c7('0x10')](_0x86c7('0xd'),_0x35f977,_0x17e418['error'][_0x86c7('0x12')]);return _0x43b1b6(_0x17e418['error'][_0x86c7('0x12')]);}logger[_0x86c7('0x10')](_0x86c7('0xd'),_0x35f977,_0x17e418[_0x86c7('0x10')]['message']);return _0x16d05a(_0x17e418[_0x86c7('0x10')]['message']);}else{logger['info'](_0x86c7('0xd'),_0x35f977,'request\x20sent');_0x16d05a(_0x17e418['result'][_0x86c7('0x12')]);}})['catch'](function(_0x474d2f){logger['error'](_0x86c7('0xd'),_0x35f977,_0x474d2f);_0x43b1b6(_0x474d2f);});});}exports[_0x86c7('0x13')]=function(_0x172328){var _0xc3aba3=this;return new Promise(function(_0x483d65,_0x272db9){return db[_0x86c7('0x14')][_0x86c7('0x15')](_0x172328['body'],{'raw':_0x172328[_0x86c7('0x16')]?_0x172328[_0x86c7('0x16')][_0x86c7('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4d4e9c){logger['info'](_0x86c7('0x13'),_0x172328);logger[_0x86c7('0x18')](_0x86c7('0x13'),_0x172328,JSON[_0x86c7('0x19')](_0x4d4e9c));_0x483d65(_0x4d4e9c);})['catch'](function(_0x3b09a6){logger[_0x86c7('0x10')](_0x86c7('0x13'),_0x3b09a6[_0x86c7('0x12')],_0x172328);_0x272db9(_0xc3aba3[_0x86c7('0x10')](0x1f4,_0x3b09a6['message']));});});};exports[_0x86c7('0x1a')]=function(_0x54a56a){var _0x5763a4=this;return new Promise(function(_0x204397,_0x204766){return db['WhatsappQueueReport'][_0x86c7('0x1b')](_0x54a56a['body'],{'raw':_0x54a56a[_0x86c7('0x16')]?_0x54a56a[_0x86c7('0x16')][_0x86c7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a56a['options']?_0x54a56a[_0x86c7('0x16')]['where']||null:null,'attributes':_0x54a56a['options']?_0x54a56a['options'][_0x86c7('0x1c')]||null:null,'limit':_0x54a56a[_0x86c7('0x16')]?_0x54a56a['options'][_0x86c7('0x1d')]||null:null})['then'](function(_0x4e51d2){logger[_0x86c7('0xc')]('UpdateWhatsappQueueReport',_0x54a56a);logger['debug']('UpdateWhatsappQueueReport',_0x54a56a,JSON[_0x86c7('0x19')](_0x4e51d2));_0x204397(_0x4e51d2);})[_0x86c7('0x1e')](function(_0x511bac){logger[_0x86c7('0x10')]('UpdateWhatsappQueueReport',_0x511bac[_0x86c7('0x12')],_0x54a56a);_0x204766(_0x5763a4[_0x86c7('0x10')](0x1f4,_0x511bac[_0x86c7('0x12')]));});});}; \ No newline at end of file +var _0x5068=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','where','attributes','lodash','util','bluebird','randomstring','ioredis'];(function(_0x56f13e,_0x2c7ee1){var _0x321fed=function(_0x26614d){while(--_0x26614d){_0x56f13e['push'](_0x56f13e['shift']());}};_0x321fed(++_0x2c7ee1);}(_0x5068,0x166));var _0x8506=function(_0x4cace2,_0x3f8764){_0x4cace2=_0x4cace2-0x0;var _0x3c081e=_0x5068[_0x4cace2];return _0x3c081e;};'use strict';var _=require(_0x8506('0x0'));var util=require(_0x8506('0x1'));var moment=require('moment');var BPromise=require(_0x8506('0x2'));var rs=require(_0x8506('0x3'));var fs=require('fs');var Redis=require(_0x8506('0x4'));var db=require(_0x8506('0x5'))['db'];var utils=require(_0x8506('0x6'));var logger=require(_0x8506('0x7'))('rpc');var config=require(_0x8506('0x8'));var jayson=require(_0x8506('0x9'));var client=jayson['client'][_0x8506('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x458585,_0x521f6a,_0x45cf41){return new BPromise(function(_0x5a6a45,_0xb46704){return client[_0x8506('0xb')](_0x458585,_0x45cf41)['then'](function(_0x11a913){logger[_0x8506('0xc')](_0x8506('0xd'),_0x521f6a,_0x8506('0xe'));logger[_0x8506('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x521f6a,'request\x20sent',JSON[_0x8506('0x10')](_0x11a913));if(_0x11a913['error']){if(_0x11a913[_0x8506('0x11')][_0x8506('0x12')]===0x1f4){logger[_0x8506('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x521f6a,_0x11a913['error']['message']);return _0xb46704(_0x11a913[_0x8506('0x11')][_0x8506('0x13')]);}logger[_0x8506('0x11')](_0x8506('0xd'),_0x521f6a,_0x11a913[_0x8506('0x11')]['message']);return _0x5a6a45(_0x11a913[_0x8506('0x11')][_0x8506('0x13')]);}else{logger[_0x8506('0xc')](_0x8506('0xd'),_0x521f6a,_0x8506('0xe'));_0x5a6a45(_0x11a913[_0x8506('0x14')][_0x8506('0x13')]);}})[_0x8506('0x15')](function(_0x5b9d0e){logger['error'](_0x8506('0xd'),_0x521f6a,_0x5b9d0e);_0xb46704(_0x5b9d0e);});});}exports['CreateWhatsappQueueReport']=function(_0x5c20dc){var _0x14c7bb=this;return new Promise(function(_0x4622eb,_0x244714){return db[_0x8506('0x16')][_0x8506('0x17')](_0x5c20dc[_0x8506('0x18')],{'raw':_0x5c20dc[_0x8506('0x19')]?_0x5c20dc[_0x8506('0x19')][_0x8506('0x1a')]===undefined?!![]:![]:!![]})[_0x8506('0x1b')](function(_0x569f09){logger[_0x8506('0xc')](_0x8506('0x1c'),_0x5c20dc);logger[_0x8506('0xf')](_0x8506('0x1c'),_0x5c20dc,JSON[_0x8506('0x10')](_0x569f09));_0x4622eb(_0x569f09);})[_0x8506('0x15')](function(_0x3bd736){logger[_0x8506('0x11')](_0x8506('0x1c'),_0x3bd736[_0x8506('0x13')],_0x5c20dc);_0x244714(_0x14c7bb[_0x8506('0x11')](0x1f4,_0x3bd736[_0x8506('0x13')]));});});};exports[_0x8506('0x1d')]=function(_0x29277c){var _0x236398=this;return new Promise(function(_0x281252,_0x50bfee){return db[_0x8506('0x16')][_0x8506('0x1e')](_0x29277c[_0x8506('0x18')],{'raw':_0x29277c[_0x8506('0x19')]?_0x29277c[_0x8506('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29277c[_0x8506('0x19')]?_0x29277c['options'][_0x8506('0x1f')]||null:null,'attributes':_0x29277c[_0x8506('0x19')]?_0x29277c[_0x8506('0x19')][_0x8506('0x20')]||null:null,'limit':_0x29277c['options']?_0x29277c[_0x8506('0x19')]['limit']||null:null})[_0x8506('0x1b')](function(_0x3230cc){logger[_0x8506('0xc')](_0x8506('0x1d'),_0x29277c);logger[_0x8506('0xf')]('UpdateWhatsappQueueReport',_0x29277c,JSON['stringify'](_0x3230cc));_0x281252(_0x3230cc);})[_0x8506('0x15')](function(_0x5a6fdc){logger[_0x8506('0x11')](_0x8506('0x1d'),_0x5a6fdc[_0x8506('0x13')],_0x29277c);_0x50bfee(_0x236398[_0x8506('0x11')](0x1f4,_0x5a6fdc['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 52cc40c..1c6c6bf 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 _0x343a=['describe','create','/:id','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x343a,0x17b));var _0xa343=function(_0x366357,_0x3c683a){_0x366357=_0x366357-0x0;var _0x58b913=_0x343a[_0x366357];return _0x58b913;};'use strict';var multer=require(_0xa343('0x0'));var util=require(_0xa343('0x1'));var path=require('path');var timeout=require(_0xa343('0x2'));var express=require(_0xa343('0x3'));var router=express['Router']();var fs_extra=require(_0xa343('0x4'));var auth=require(_0xa343('0x5'));var interaction=require(_0xa343('0x6'));var config=require(_0xa343('0x7'));var controller=require(_0xa343('0x8'));router[_0xa343('0x9')]('/',auth[_0xa343('0xa')](),controller[_0xa343('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa343('0xc')]);router[_0xa343('0x9')]('/:id',auth[_0xa343('0xa')](),controller['show']);router['post']('/',auth[_0xa343('0xa')](),controller[_0xa343('0xd')]);router['put'](_0xa343('0xe'),auth[_0xa343('0xa')](),controller[_0xa343('0xf')]);router['delete'](_0xa343('0xe'),auth[_0xa343('0xa')](),controller[_0xa343('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf9f2=['connect-timeout','express','Router','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','destroy','exports','multer','util','path'];(function(_0x47ba89,_0x342908){var _0x1ed2df=function(_0x39716d){while(--_0x39716d){_0x47ba89['push'](_0x47ba89['shift']());}};_0x1ed2df(++_0x342908);}(_0xf9f2,0x1c8));var _0x2f9f=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0xf9f2[_0x2defb5];return _0x229c53;};'use strict';var multer=require(_0x2f9f('0x0'));var util=require(_0x2f9f('0x1'));var path=require(_0x2f9f('0x2'));var timeout=require(_0x2f9f('0x3'));var express=require(_0x2f9f('0x4'));var router=express[_0x2f9f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2f9f('0x6'));var controller=require(_0x2f9f('0x7'));router[_0x2f9f('0x8')]('/',auth[_0x2f9f('0x9')](),controller[_0x2f9f('0xa')]);router[_0x2f9f('0x8')](_0x2f9f('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x2f9f('0x8')](_0x2f9f('0xc'),auth[_0x2f9f('0x9')](),controller[_0x2f9f('0xd')]);router[_0x2f9f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2f9f('0xc'),auth[_0x2f9f('0x9')](),controller['update']);router['delete'](_0x2f9f('0xc'),auth[_0x2f9f('0x9')](),controller[_0x2f9f('0xf')]);module[_0x2f9f('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index e0d1110..0f42b18 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 _0xe98f=['account','agent','sequelize','STRING'];(function(_0x3bc8ac,_0x3d59f0){var _0x3a4775=function(_0x4f2161){while(--_0x4f2161){_0x3bc8ac['push'](_0x3bc8ac['shift']());}};_0x3a4775(++_0x3d59f0);}(_0xe98f,0xde));var _0xfe98=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe98f[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xfe98('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xfe98('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfe98('0x2'),_0xfe98('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xd7d1=['agent','queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x402b1d,_0xe7eaec){var _0x538eeb=function(_0x3d6028){while(--_0x3d6028){_0x402b1d['push'](_0x402b1d['shift']());}};_0x538eeb(++_0xe7eaec);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2eedef,_0x368a36){_0x2eedef=_0x2eedef-0x0;var _0x2724c8=_0xd7d1[_0x2eedef];return _0x2724c8;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'uniqueid':{'type':Sequelize[_0x1d7d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1d7d('0x3')](_0x1d7d('0x4'),_0x1d7d('0x5'),_0x1d7d('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1d7d('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 8e95fca..38f2b34 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 _0x4dfd=['rawAttributes','type','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','WhatsappTransferReport','includeAll','findAll','rows','catch','show','params','keys','fields','options','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map'];(function(_0x58ab4c,_0x4091e6){var _0x13e23b=function(_0x6f7aaa){while(--_0x6f7aaa){_0x58ab4c['push'](_0x58ab4c['shift']());}};_0x13e23b(++_0x4091e6);}(_0x4dfd,0x148));var _0xd4df=function(_0x310149,_0x5e04f0){_0x310149=_0x310149-0x0;var _0x3312fb=_0x4dfd[_0x310149];return _0x3312fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd4df('0x0'));var jsonpatch=require(_0xd4df('0x1'));var rp=require(_0xd4df('0x2'));var moment=require(_0xd4df('0x3'));var BPromise=require(_0xd4df('0x4'));var Mustache=require(_0xd4df('0x5'));var util=require(_0xd4df('0x6'));var path=require(_0xd4df('0x7'));var sox=require(_0xd4df('0x8'));var csv=require(_0xd4df('0x9'));var ejs=require(_0xd4df('0xa'));var fs=require('fs');var fs_extra=require(_0xd4df('0xb'));var _=require('lodash');var squel=require(_0xd4df('0xc'));var crypto=require(_0xd4df('0xd'));var jsforce=require(_0xd4df('0xe'));var deskjs=require(_0xd4df('0xf'));var toCsv=require(_0xd4df('0x9'));var querystring=require(_0xd4df('0x10'));var Papa=require(_0xd4df('0x11'));var Redis=require('ioredis');var authService=require(_0xd4df('0x12'));var qs=require(_0xd4df('0x13'));var as=require(_0xd4df('0x14'));var hardwareService=require(_0xd4df('0x15'));var logger=require(_0xd4df('0x16'))(_0xd4df('0x17'));var utils=require('../../config/utils');var config=require(_0xd4df('0x18'));var licenseUtil=require(_0xd4df('0x19'));var db=require(_0xd4df('0x1a'))['db'];function respondWithStatusCode(_0x2f7d9e,_0x295be4){_0x295be4=_0x295be4||0xcc;return function(_0x30009b){if(_0x30009b){return _0x2f7d9e[_0xd4df('0x1b')](_0x295be4);}return _0x2f7d9e[_0xd4df('0x1c')](_0x295be4)[_0xd4df('0x1d')]();};}function respondWithResult(_0x531aea,_0x433771){_0x433771=_0x433771||0xc8;return function(_0x4e2d80){if(_0x4e2d80){return _0x531aea[_0xd4df('0x1c')](_0x433771)[_0xd4df('0x1e')](_0x4e2d80);}};}function respondWithFilteredResult(_0x2f88de,_0x2e9a83){return function(_0x32daa5){if(_0x32daa5){var _0x15db6d=typeof _0x2e9a83[_0xd4df('0x1f')]===_0xd4df('0x20')&&typeof _0x2e9a83[_0xd4df('0x21')]==='undefined';var _0xa40996=_0x32daa5[_0xd4df('0x22')];var _0x34b0b9=_0x15db6d?0x0:_0x2e9a83[_0xd4df('0x1f')];var _0x9b4ad4=_0x15db6d?_0x32daa5['count']:_0x2e9a83[_0xd4df('0x1f')]+_0x2e9a83[_0xd4df('0x21')];var _0x30edf7;if(_0x9b4ad4>=_0xa40996){_0x9b4ad4=_0xa40996;_0x30edf7=0xc8;}else{_0x30edf7=0xce;}_0x2f88de['status'](_0x30edf7);return _0x2f88de[_0xd4df('0x23')]('Content-Range',_0x34b0b9+'-'+_0x9b4ad4+'/'+_0xa40996)[_0xd4df('0x1e')](_0x32daa5);}return null;};}function patchUpdates(_0x949bd4){return function(_0x2f3f51){try{jsonpatch[_0xd4df('0x24')](_0x2f3f51,_0x949bd4,!![]);}catch(_0x44df46){return BPromise[_0xd4df('0x25')](_0x44df46);}return _0x2f3f51[_0xd4df('0x26')]();};}function saveUpdates(_0x58e2dd,_0x4daa75){return function(_0x544648){if(_0x544648){return _0x544648['update'](_0x58e2dd)[_0xd4df('0x27')](function(_0x3ec72d){return _0x3ec72d;});}return null;};}function removeEntity(_0x22b3a2,_0x3898af){return function(_0xdff551){if(_0xdff551){return _0xdff551[_0xd4df('0x28')]()[_0xd4df('0x27')](function(){_0x22b3a2[_0xd4df('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5030dc,_0x5efc0f){return function(_0x22f6f6){if(!_0x22f6f6){_0x5030dc['sendStatus'](0x194);}return _0x22f6f6;};}function handleError(_0x6ae6f8,_0x3a5883){_0x3a5883=_0x3a5883||0x1f4;return function(_0x65eccb){logger[_0xd4df('0x29')](_0x65eccb[_0xd4df('0x2a')]);if(_0x65eccb[_0xd4df('0x2b')]){delete _0x65eccb[_0xd4df('0x2b')];}_0x6ae6f8[_0xd4df('0x1c')](_0x3a5883)[_0xd4df('0x2c')](_0x65eccb);};}exports[_0xd4df('0x2d')]=function(_0x3db2ba,_0x47edc3){var _0x120577={},_0x2c9e4d={},_0x3e06ed={'count':0x0,'rows':[]};var _0x4bd75b=_[_0xd4df('0x2e')](db['WhatsappTransferReport'][_0xd4df('0x2f')],function(_0x110d42){return{'name':_0x110d42['fieldName'],'type':_0x110d42[_0xd4df('0x30')]['key']};});_0x2c9e4d['model']=_[_0xd4df('0x2e')](_0x4bd75b,_0xd4df('0x2b'));_0x2c9e4d[_0xd4df('0x31')]=_['keys'](_0x3db2ba[_0xd4df('0x31')]);_0x2c9e4d['filters']=_[_0xd4df('0x32')](_0x2c9e4d[_0xd4df('0x33')],_0x2c9e4d['query']);_0x120577[_0xd4df('0x34')]=_['intersection'](_0x2c9e4d[_0xd4df('0x33')],qs['fields'](_0x3db2ba[_0xd4df('0x31')]['fields']));_0x120577['attributes']=_0x120577[_0xd4df('0x34')][_0xd4df('0x35')]?_0x120577['attributes']:_0x2c9e4d[_0xd4df('0x33')];if(!_0x3db2ba[_0xd4df('0x31')][_0xd4df('0x36')](_0xd4df('0x37'))){_0x120577[_0xd4df('0x21')]=qs['limit'](_0x3db2ba['query'][_0xd4df('0x21')]);_0x120577[_0xd4df('0x1f')]=qs[_0xd4df('0x1f')](_0x3db2ba[_0xd4df('0x31')][_0xd4df('0x1f')]);}_0x120577[_0xd4df('0x38')]=qs[_0xd4df('0x39')](_0x3db2ba['query'][_0xd4df('0x39')]);_0x120577['where']=qs['filters'](_['pick'](_0x3db2ba[_0xd4df('0x31')],_0x2c9e4d['filters']),_0x4bd75b);if(_0x3db2ba['query']['filter']){_0x120577['where']=_[_0xd4df('0x3a')](_0x120577[_0xd4df('0x3b')],{'$or':_['map'](_0x4bd75b,function(_0x3e26b6){if(_0x3e26b6[_0xd4df('0x30')]!=='VIRTUAL'){var _0x2344e8={};_0x2344e8[_0x3e26b6[_0xd4df('0x2b')]]={'$like':'%'+_0x3db2ba[_0xd4df('0x31')]['filter']+'%'};return _0x2344e8;}})});}_0x120577=_[_0xd4df('0x3a')]({},_0x120577,_0x3db2ba['options']);var _0x23fe70={'where':_0x120577[_0xd4df('0x3b')]};return db[_0xd4df('0x3c')][_0xd4df('0x22')](_0x23fe70)[_0xd4df('0x27')](function(_0x532e71){_0x3e06ed[_0xd4df('0x22')]=_0x532e71;if(_0x3db2ba[_0xd4df('0x31')][_0xd4df('0x3d')]){_0x120577['include']=[{'all':!![]}];}return db[_0xd4df('0x3c')][_0xd4df('0x3e')](_0x120577);})[_0xd4df('0x27')](function(_0x2caaf5){_0x3e06ed[_0xd4df('0x3f')]=_0x2caaf5;return _0x3e06ed;})[_0xd4df('0x27')](respondWithFilteredResult(_0x47edc3,_0x120577))[_0xd4df('0x40')](handleError(_0x47edc3,null));};exports[_0xd4df('0x41')]=function(_0x27d9ad,_0x570edf){var _0x5b0e45={'raw':!![],'where':{'id':_0x27d9ad[_0xd4df('0x42')]['id']}},_0x3921ca={};_0x3921ca[_0xd4df('0x33')]=_[_0xd4df('0x43')](db[_0xd4df('0x3c')][_0xd4df('0x2f')]);_0x3921ca['query']=_[_0xd4df('0x43')](_0x27d9ad[_0xd4df('0x31')]);_0x3921ca['filters']=_[_0xd4df('0x32')](_0x3921ca[_0xd4df('0x33')],_0x3921ca[_0xd4df('0x31')]);_0x5b0e45[_0xd4df('0x34')]=_[_0xd4df('0x32')](_0x3921ca[_0xd4df('0x33')],qs[_0xd4df('0x44')](_0x27d9ad['query'][_0xd4df('0x44')]));_0x5b0e45[_0xd4df('0x34')]=_0x5b0e45[_0xd4df('0x34')][_0xd4df('0x35')]?_0x5b0e45[_0xd4df('0x34')]:_0x3921ca[_0xd4df('0x33')];if(_0x27d9ad[_0xd4df('0x31')][_0xd4df('0x3d')]){_0x5b0e45['include']=[{'all':!![]}];}_0x5b0e45=_[_0xd4df('0x3a')]({},_0x5b0e45,_0x27d9ad[_0xd4df('0x45')]);return db['WhatsappTransferReport'][_0xd4df('0x46')](_0x5b0e45)[_0xd4df('0x27')](handleEntityNotFound(_0x570edf,null))[_0xd4df('0x27')](respondWithResult(_0x570edf,null))[_0xd4df('0x40')](handleError(_0x570edf,null));};exports[_0xd4df('0x47')]=function(_0x147f52,_0x5f4ace){return db[_0xd4df('0x3c')]['create'](_0x147f52[_0xd4df('0x48')],{})[_0xd4df('0x27')](respondWithResult(_0x5f4ace,0xc9))[_0xd4df('0x40')](handleError(_0x5f4ace,null));};exports[_0xd4df('0x49')]=function(_0x4b716b,_0x181659){if(_0x4b716b[_0xd4df('0x48')]['id']){delete _0x4b716b[_0xd4df('0x48')]['id'];}return db[_0xd4df('0x3c')][_0xd4df('0x46')]({'where':{'id':_0x4b716b[_0xd4df('0x42')]['id']}})[_0xd4df('0x27')](handleEntityNotFound(_0x181659,null))[_0xd4df('0x27')](saveUpdates(_0x4b716b['body'],null))[_0xd4df('0x27')](respondWithResult(_0x181659,null))[_0xd4df('0x40')](handleError(_0x181659,null));};exports[_0xd4df('0x28')]=function(_0x257da8,_0x41aef1){return db[_0xd4df('0x3c')][_0xd4df('0x46')]({'where':{'id':_0x257da8['params']['id']}})[_0xd4df('0x27')](handleEntityNotFound(_0x41aef1,null))['then'](removeEntity(_0x41aef1,null))[_0xd4df('0x40')](handleError(_0x41aef1,null));};exports[_0xd4df('0x4a')]=function(_0x2c019e,_0x459410){return db[_0xd4df('0x3c')][_0xd4df('0x4a')]()['then'](respondWithResult(_0x459410,null))[_0xd4df('0x40')](handleError(_0x459410,null));}; \ No newline at end of file +var _0x49f3=['type','query','keys','intersection','model','fields','attributes','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/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','stack','name','send','index','map','WhatsappTransferReport','fieldName'];(function(_0x191934,_0x6703b8){var _0x5d1761=function(_0x45de98){while(--_0x45de98){_0x191934['push'](_0x191934['shift']());}};_0x5d1761(++_0x6703b8);}(_0x49f3,0xb0));var _0x349f=function(_0x2b7575,_0x5286bd){_0x2b7575=_0x2b7575-0x0;var _0x4e99e6=_0x49f3[_0x2b7575];return _0x4e99e6;};'use strict';var emlformat=require(_0x349f('0x0'));var rimraf=require(_0x349f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x349f('0x2'));var rp=require('request-promise');var moment=require(_0x349f('0x3'));var BPromise=require(_0x349f('0x4'));var Mustache=require(_0x349f('0x5'));var util=require(_0x349f('0x6'));var path=require(_0x349f('0x7'));var sox=require(_0x349f('0x8'));var csv=require(_0x349f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x349f('0xa'));var squel=require(_0x349f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x349f('0xc'));var toCsv=require(_0x349f('0x9'));var querystring=require(_0x349f('0xd'));var Papa=require(_0x349f('0xe'));var Redis=require('ioredis');var authService=require(_0x349f('0xf'));var qs=require(_0x349f('0x10'));var as=require(_0x349f('0x11'));var hardwareService=require(_0x349f('0x12'));var logger=require(_0x349f('0x13'))(_0x349f('0x14'));var utils=require(_0x349f('0x15'));var config=require(_0x349f('0x16'));var licenseUtil=require(_0x349f('0x17'));var db=require(_0x349f('0x18'))['db'];function respondWithStatusCode(_0x2004f2,_0x3b03e7){_0x3b03e7=_0x3b03e7||0xcc;return function(_0x1438f7){if(_0x1438f7){return _0x2004f2[_0x349f('0x19')](_0x3b03e7);}return _0x2004f2[_0x349f('0x1a')](_0x3b03e7)[_0x349f('0x1b')]();};}function respondWithResult(_0x152bef,_0x3e348a){_0x3e348a=_0x3e348a||0xc8;return function(_0x2ebb16){if(_0x2ebb16){return _0x152bef[_0x349f('0x1a')](_0x3e348a)[_0x349f('0x1c')](_0x2ebb16);}};}function respondWithFilteredResult(_0x539d7f,_0x2896f7){return function(_0x18860c){if(_0x18860c){var _0x51dd0e=typeof _0x2896f7[_0x349f('0x1d')]===_0x349f('0x1e')&&typeof _0x2896f7[_0x349f('0x1f')]===_0x349f('0x1e');var _0x34b5a9=_0x18860c[_0x349f('0x20')];var _0x3677db=_0x51dd0e?0x0:_0x2896f7['offset'];var _0x4b82c4=_0x51dd0e?_0x18860c['count']:_0x2896f7[_0x349f('0x1d')]+_0x2896f7[_0x349f('0x1f')];var _0x4ba17b;if(_0x4b82c4>=_0x34b5a9){_0x4b82c4=_0x34b5a9;_0x4ba17b=0xc8;}else{_0x4ba17b=0xce;}_0x539d7f[_0x349f('0x1a')](_0x4ba17b);return _0x539d7f[_0x349f('0x21')](_0x349f('0x22'),_0x3677db+'-'+_0x4b82c4+'/'+_0x34b5a9)[_0x349f('0x1c')](_0x18860c);}return null;};}function patchUpdates(_0xadebbc){return function(_0x275b1e){try{jsonpatch['apply'](_0x275b1e,_0xadebbc,!![]);}catch(_0x2689d5){return BPromise[_0x349f('0x23')](_0x2689d5);}return _0x275b1e['save']();};}function saveUpdates(_0x531b0b,_0x12d8f6){return function(_0x29fc0f){if(_0x29fc0f){return _0x29fc0f[_0x349f('0x24')](_0x531b0b)[_0x349f('0x25')](function(_0x193adc){return _0x193adc;});}return null;};}function removeEntity(_0x36b0f4,_0x14b6fe){return function(_0x1174d6){if(_0x1174d6){return _0x1174d6[_0x349f('0x26')]()[_0x349f('0x25')](function(){_0x36b0f4[_0x349f('0x1a')](0xcc)[_0x349f('0x1b')]();});}};}function handleEntityNotFound(_0x17074c,_0xa51138){return function(_0x2d677b){if(!_0x2d677b){_0x17074c[_0x349f('0x19')](0x194);}return _0x2d677b;};}function handleError(_0x1711fe,_0x3bb0ce){_0x3bb0ce=_0x3bb0ce||0x1f4;return function(_0x5099de){logger['error'](_0x5099de[_0x349f('0x27')]);if(_0x5099de['name']){delete _0x5099de[_0x349f('0x28')];}_0x1711fe[_0x349f('0x1a')](_0x3bb0ce)[_0x349f('0x29')](_0x5099de);};}exports[_0x349f('0x2a')]=function(_0x3725e4,_0x532bb9){var _0x2987b2={},_0x52e0cf={},_0x3cad73={'count':0x0,'rows':[]};var _0x1f03bc=_[_0x349f('0x2b')](db[_0x349f('0x2c')]['rawAttributes'],function(_0x1c8e1e){return{'name':_0x1c8e1e[_0x349f('0x2d')],'type':_0x1c8e1e[_0x349f('0x2e')]['key']};});_0x52e0cf['model']=_[_0x349f('0x2b')](_0x1f03bc,_0x349f('0x28'));_0x52e0cf[_0x349f('0x2f')]=_[_0x349f('0x30')](_0x3725e4[_0x349f('0x2f')]);_0x52e0cf['filters']=_[_0x349f('0x31')](_0x52e0cf[_0x349f('0x32')],_0x52e0cf[_0x349f('0x2f')]);_0x2987b2['attributes']=_[_0x349f('0x31')](_0x52e0cf[_0x349f('0x32')],qs[_0x349f('0x33')](_0x3725e4[_0x349f('0x2f')][_0x349f('0x33')]));_0x2987b2[_0x349f('0x34')]=_0x2987b2[_0x349f('0x34')]['length']?_0x2987b2[_0x349f('0x34')]:_0x52e0cf[_0x349f('0x32')];if(!_0x3725e4[_0x349f('0x2f')]['hasOwnProperty'](_0x349f('0x35'))){_0x2987b2[_0x349f('0x1f')]=qs[_0x349f('0x1f')](_0x3725e4[_0x349f('0x2f')][_0x349f('0x1f')]);_0x2987b2[_0x349f('0x1d')]=qs[_0x349f('0x1d')](_0x3725e4[_0x349f('0x2f')][_0x349f('0x1d')]);}_0x2987b2['order']=qs[_0x349f('0x36')](_0x3725e4[_0x349f('0x2f')]['sort']);_0x2987b2['where']=qs[_0x349f('0x37')](_[_0x349f('0x38')](_0x3725e4[_0x349f('0x2f')],_0x52e0cf[_0x349f('0x37')]),_0x1f03bc);if(_0x3725e4[_0x349f('0x2f')][_0x349f('0x39')]){_0x2987b2[_0x349f('0x3a')]=_['merge'](_0x2987b2[_0x349f('0x3a')],{'$or':_[_0x349f('0x2b')](_0x1f03bc,function(_0x2e5e9d){if(_0x2e5e9d[_0x349f('0x2e')]!==_0x349f('0x3b')){var _0x874afc={};_0x874afc[_0x2e5e9d[_0x349f('0x28')]]={'$like':'%'+_0x3725e4[_0x349f('0x2f')][_0x349f('0x39')]+'%'};return _0x874afc;}})});}_0x2987b2=_[_0x349f('0x3c')]({},_0x2987b2,_0x3725e4[_0x349f('0x3d')]);var _0x10444f={'where':_0x2987b2[_0x349f('0x3a')]};return db[_0x349f('0x2c')][_0x349f('0x20')](_0x10444f)['then'](function(_0x1b7e34){_0x3cad73[_0x349f('0x20')]=_0x1b7e34;if(_0x3725e4[_0x349f('0x2f')][_0x349f('0x3e')]){_0x2987b2['include']=[{'all':!![]}];}return db[_0x349f('0x2c')][_0x349f('0x3f')](_0x2987b2);})[_0x349f('0x25')](function(_0x454039){_0x3cad73[_0x349f('0x40')]=_0x454039;return _0x3cad73;})[_0x349f('0x25')](respondWithFilteredResult(_0x532bb9,_0x2987b2))[_0x349f('0x41')](handleError(_0x532bb9,null));};exports[_0x349f('0x42')]=function(_0xde09d4,_0x337f95){var _0x10658b={'raw':!![],'where':{'id':_0xde09d4[_0x349f('0x43')]['id']}},_0x11c30c={};_0x11c30c[_0x349f('0x32')]=_[_0x349f('0x30')](db[_0x349f('0x2c')][_0x349f('0x44')]);_0x11c30c[_0x349f('0x2f')]=_[_0x349f('0x30')](_0xde09d4['query']);_0x11c30c['filters']=_[_0x349f('0x31')](_0x11c30c[_0x349f('0x32')],_0x11c30c['query']);_0x10658b[_0x349f('0x34')]=_['intersection'](_0x11c30c[_0x349f('0x32')],qs[_0x349f('0x33')](_0xde09d4[_0x349f('0x2f')][_0x349f('0x33')]));_0x10658b[_0x349f('0x34')]=_0x10658b[_0x349f('0x34')]['length']?_0x10658b[_0x349f('0x34')]:_0x11c30c[_0x349f('0x32')];if(_0xde09d4[_0x349f('0x2f')][_0x349f('0x3e')]){_0x10658b[_0x349f('0x45')]=[{'all':!![]}];}_0x10658b=_[_0x349f('0x3c')]({},_0x10658b,_0xde09d4[_0x349f('0x3d')]);return db['WhatsappTransferReport'][_0x349f('0x46')](_0x10658b)[_0x349f('0x25')](handleEntityNotFound(_0x337f95,null))[_0x349f('0x25')](respondWithResult(_0x337f95,null))[_0x349f('0x41')](handleError(_0x337f95,null));};exports[_0x349f('0x47')]=function(_0xde9a16,_0x26877a){return db['WhatsappTransferReport'][_0x349f('0x47')](_0xde9a16[_0x349f('0x48')],{})['then'](respondWithResult(_0x26877a,0xc9))[_0x349f('0x41')](handleError(_0x26877a,null));};exports[_0x349f('0x24')]=function(_0x7666c,_0x483582){if(_0x7666c[_0x349f('0x48')]['id']){delete _0x7666c['body']['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x7666c[_0x349f('0x43')]['id']}})['then'](handleEntityNotFound(_0x483582,null))[_0x349f('0x25')](saveUpdates(_0x7666c['body'],null))[_0x349f('0x25')](respondWithResult(_0x483582,null))['catch'](handleError(_0x483582,null));};exports[_0x349f('0x26')]=function(_0x3e9b88,_0x5807ae){return db[_0x349f('0x2c')][_0x349f('0x46')]({'where':{'id':_0x3e9b88[_0x349f('0x43')]['id']}})[_0x349f('0x25')](handleEntityNotFound(_0x5807ae,null))[_0x349f('0x25')](removeEntity(_0x5807ae,null))['catch'](handleError(_0x5807ae,null));};exports['describe']=function(_0x2a3e7d,_0x4c3057){return db[_0x349f('0x2c')][_0x349f('0x49')]()[_0x349f('0x25')](respondWithResult(_0x4c3057,null))[_0x349f('0x41')](handleError(_0x4c3057,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a8f6eeb..b5b9d0c 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 _0x366e=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3495b9,_0x55d53a){var _0x5e453e=function(_0x48624f){while(--_0x48624f){_0x3495b9['push'](_0x3495b9['shift']());}};_0x5e453e(++_0x55d53a);}(_0x366e,0x108));var _0xe366=function(_0x5748e5,_0x44be89){_0x5748e5=_0x5748e5-0x0;var _0xe10ee0=_0x366e[_0x5748e5];return _0xe10ee0;};'use strict';var _=require(_0xe366('0x0'));var util=require(_0xe366('0x1'));var logger=require(_0xe366('0x2'))(_0xe366('0x3'));var moment=require(_0xe366('0x4'));var BPromise=require(_0xe366('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe366('0x6'));var rimraf=require(_0xe366('0x7'));var config=require(_0xe366('0x8'));var attributes=require(_0xe366('0x9'));module[_0xe366('0xa')]=function(_0x2eaf86,_0xb85705){return _0x2eaf86[_0xe366('0xb')](_0xe366('0xc'),attributes,{'tableName':_0xe366('0xd'),'paranoid':![],'indexes':[{'name':_0xe366('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7001=['request-promise','rimraf','../../config/environment','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2d3159,_0xf9a944){var _0x28f544=function(_0x22aa4c){while(--_0x22aa4c){_0x2d3159['push'](_0x2d3159['shift']());}};_0x28f544(++_0xf9a944);}(_0x7001,0xd7));var _0x1700=function(_0x5cab94,_0x3615f7){_0x5cab94=_0x5cab94-0x0;var _0xa08785=_0x7001[_0x5cab94];return _0xa08785;};'use strict';var _=require(_0x1700('0x0'));var util=require(_0x1700('0x1'));var logger=require(_0x1700('0x2'))(_0x1700('0x3'));var moment=require(_0x1700('0x4'));var BPromise=require(_0x1700('0x5'));var rp=require(_0x1700('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1700('0x7'));var config=require(_0x1700('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0x1700('0x9')]=function(_0x2fa9da,_0x8ffa69){return _0x2fa9da['define'](_0x1700('0xa'),attributes,{'tableName':_0x1700('0xb'),'paranoid':![],'indexes':[{'name':_0x1700('0xc'),'fields':[_0x1700('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 1301d58..ecde94a 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 _0xa98b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash'];(function(_0x2c8b7a,_0x483fe0){var _0x1c1cf9=function(_0x464bcf){while(--_0x464bcf){_0x2c8b7a['push'](_0x2c8b7a['shift']());}};_0x1c1cf9(++_0x483fe0);}(_0xa98b,0x158));var _0xba98=function(_0x35e301,_0x156fd6){_0x35e301=_0x35e301-0x0;var _0x16fcd1=_0xa98b[_0x35e301];return _0x16fcd1;};'use strict';var _=require(_0xba98('0x0'));var util=require('util');var moment=require(_0xba98('0x1'));var BPromise=require(_0xba98('0x2'));var rs=require(_0xba98('0x3'));var fs=require('fs');var Redis=require(_0xba98('0x4'));var db=require(_0xba98('0x5'))['db'];var utils=require(_0xba98('0x6'));var logger=require(_0xba98('0x7'))('rpc');var config=require(_0xba98('0x8'));var jayson=require(_0xba98('0x9'));var client=jayson[_0xba98('0xa')][_0xba98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb7c5,_0x2ef83a,_0xa3f8da){return new BPromise(function(_0x32f1fe,_0x2d6fb8){return client[_0xba98('0xc')](_0x1eb7c5,_0xa3f8da)[_0xba98('0xd')](function(_0x2c8cc5){logger['info'](_0xba98('0xe'),_0x2ef83a,_0xba98('0xf'));logger[_0xba98('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2ef83a,'request\x20sent',JSON[_0xba98('0x11')](_0x2c8cc5));if(_0x2c8cc5[_0xba98('0x12')]){if(_0x2c8cc5[_0xba98('0x12')]['code']===0x1f4){logger[_0xba98('0x12')](_0xba98('0xe'),_0x2ef83a,_0x2c8cc5[_0xba98('0x12')]['message']);return _0x2d6fb8(_0x2c8cc5[_0xba98('0x12')][_0xba98('0x13')]);}logger[_0xba98('0x12')](_0xba98('0xe'),_0x2ef83a,_0x2c8cc5[_0xba98('0x12')][_0xba98('0x13')]);return _0x32f1fe(_0x2c8cc5[_0xba98('0x12')][_0xba98('0x13')]);}else{logger[_0xba98('0x14')](_0xba98('0xe'),_0x2ef83a,_0xba98('0xf'));_0x32f1fe(_0x2c8cc5[_0xba98('0x15')][_0xba98('0x13')]);}})[_0xba98('0x16')](function(_0x30243b){logger['error'](_0xba98('0xe'),_0x2ef83a,_0x30243b);_0x2d6fb8(_0x30243b);});});} \ No newline at end of file +var _0x5113=['../../config/environment','jayson/promise','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5113,0x111));var _0x3511=function(_0x54f4f1,_0x2e603b){_0x54f4f1=_0x54f4f1-0x0;var _0x14b71f=_0x5113[_0x54f4f1];return _0x14b71f;};'use strict';var _=require(_0x3511('0x0'));var util=require(_0x3511('0x1'));var moment=require(_0x3511('0x2'));var BPromise=require('bluebird');var rs=require(_0x3511('0x3'));var fs=require('fs');var Redis=require(_0x3511('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3511('0x5'))(_0x3511('0x6'));var config=require(_0x3511('0x7'));var jayson=require(_0x3511('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ee673,_0x37e57e,_0x17d39c){return new BPromise(function(_0x2edc3f,_0x5e3d2c){return client[_0x3511('0x9')](_0x5ee673,_0x17d39c)[_0x3511('0xa')](function(_0x13d128){logger['info'](_0x3511('0xb'),_0x37e57e,_0x3511('0xc'));logger[_0x3511('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x37e57e,_0x3511('0xc'),JSON[_0x3511('0xe')](_0x13d128));if(_0x13d128[_0x3511('0xf')]){if(_0x13d128[_0x3511('0xf')][_0x3511('0x10')]===0x1f4){logger[_0x3511('0xf')](_0x3511('0xb'),_0x37e57e,_0x13d128[_0x3511('0xf')][_0x3511('0x11')]);return _0x5e3d2c(_0x13d128[_0x3511('0xf')]['message']);}logger[_0x3511('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x37e57e,_0x13d128['error']['message']);return _0x2edc3f(_0x13d128[_0x3511('0xf')][_0x3511('0x11')]);}else{logger['info'](_0x3511('0xb'),_0x37e57e,_0x3511('0xc'));_0x2edc3f(_0x13d128[_0x3511('0x12')][_0x3511('0x11')]);}})[_0x3511('0x13')](function(_0x3ce9d9){logger[_0x3511('0xf')](_0x3511('0xb'),_0x37e57e,_0x3ce9d9);_0x5e3d2c(_0x3ce9d9);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index ecc0f00..7106cba 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42d9=['lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','start','info','Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','online','seedDB','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x3a0cb2,_0x17bf0f){var _0x5ef05b=function(_0x35ee33){while(--_0x35ee33){_0x3a0cb2['push'](_0x3a0cb2['shift']());}};_0x5ef05b(++_0x17bf0f);}(_0x42d9,0x13f));var _0x942d=function(_0x21ba39,_0x413046){_0x21ba39=_0x21ba39-0x0;var _0x7a1e4f=_0x42d9[_0x21ba39];return _0x7a1e4f;};'use strict';var _=require(_0x942d('0x0'));var mysqldb=require(_0x942d('0x1'));var rpc=require(_0x942d('0x2'));var config=require(_0x942d('0x3'));var logger=require('./config/logger')(_0x942d('0x4'));var pm2=require(_0x942d('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x942d('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x942d('0x7'));var transcribe=require(_0x942d('0x8'));function main(){return mysqldb['db'][_0x942d('0x9')][_0x942d('0xa')]()[_0x942d('0xb')](function(){return rpc['listen']();})[_0x942d('0xb')](function(_0x4772e1){logger['info'](_0x4772e1);return chat[_0x942d('0xc')]();})[_0x942d('0xb')](function(){return whatsapp['start']();})[_0x942d('0xb')](function(){return schedule[_0x942d('0xc')]();})[_0x942d('0xb')](function(){return transcribe[_0x942d('0xc')]();})[_0x942d('0xb')](function(_0x136742){logger[_0x942d('0xd')](_0x136742);return pm2[_0x942d('0xc')](pm2Config);})[_0x942d('0xb')](function(_0x4d132e){logger['info'](_0x942d('0xe'),_[_0x942d('0xf')](_[_0x942d('0x10')](_0x4d132e,{'status':'online'}),_0x942d('0x11'))[_0x942d('0x12')]());logger['info'](_0x942d('0x13'),_['map'](_[_0x942d('0x10')](_0x4d132e,function(_0x1fceed){return _0x1fceed[_0x942d('0x14')]!==_0x942d('0x15');}),_0x942d('0x11'))[_0x942d('0x12')]()||'None');config[_0x942d('0x16')]&&require(_0x942d('0x17'))[_0x942d('0x18')]();require(_0x942d('0x19'))[_0x942d('0x18')]();})['catch'](function(_0x256634){logger[_0x942d('0x1a')](_0x942d('0x1b'),_0x256634);process[_0x942d('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x3599=['./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','then','start','info','Online\x20apps:','map','filter','online','status','name','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment'];(function(_0x1ae15e,_0x27172f){var _0x5e23b6=function(_0x5813eb){while(--_0x5813eb){_0x1ae15e['push'](_0x1ae15e['shift']());}};_0x5e23b6(++_0x27172f);}(_0x3599,0x88));var _0x9359=function(_0x3a1af5,_0x3577f7){_0x3a1af5=_0x3a1af5-0x0;var _0x1f7025=_0x3599[_0x3a1af5];return _0x1f7025;};'use strict';var _=require(_0x9359('0x0'));var mysqldb=require(_0x9359('0x1'));var rpc=require(_0x9359('0x2'));var config=require(_0x9359('0x3'));var logger=require(_0x9359('0x4'))(_0x9359('0x5'));var pm2=require(_0x9359('0x6'));var pm2Config=require(_0x9359('0x7'));var schedule=require(_0x9359('0x8'));var chat=require(_0x9359('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x9359('0xa')]['sync']()[_0x9359('0xb')](function(){return rpc['listen']();})[_0x9359('0xb')](function(_0x3e137b){logger['info'](_0x3e137b);return chat[_0x9359('0xc')]();})['then'](function(){return whatsapp[_0x9359('0xc')]();})[_0x9359('0xb')](function(){return schedule['start']();})[_0x9359('0xb')](function(){return transcribe['start']();})['then'](function(_0x420a94){logger[_0x9359('0xd')](_0x420a94);return pm2[_0x9359('0xc')](pm2Config);})['then'](function(_0x3f1b96){logger[_0x9359('0xd')](_0x9359('0xe'),_[_0x9359('0xf')](_[_0x9359('0x10')](_0x3f1b96,{'status':_0x9359('0x11')}),'name')['join']());logger[_0x9359('0xd')]('Offline\x20apps:',_[_0x9359('0xf')](_['filter'](_0x3f1b96,function(_0x5189ce){return _0x5189ce[_0x9359('0x12')]!==_0x9359('0x11');}),_0x9359('0x13'))['join']()||'None');config[_0x9359('0x14')]&&require(_0x9359('0x15'))[_0x9359('0x16')]();require(_0x9359('0x17'))[_0x9359('0x16')]();})[_0x9359('0x18')](function(_0xc2d387){logger[_0x9359('0x19')](_0x9359('0x1a'),_0xc2d387);process[_0x9359('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 77d5f71..45aa1ee 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 _0x466f=['user','ChatInteraction','findOne','params','closed','then','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','find','authenticate','pass','status','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','isEqual','nonce','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','use','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','validatePasswordPattern','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.','Sequelize','length','splice','unshift','encryptString','join','sign','secret','session','payload','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','composable-middleware','bluebird','util','moment','secrets','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated'];(function(_0x329159,_0x4fef75){var _0x1158fd=function(_0x2132d3){while(--_0x2132d3){_0x329159['push'](_0x329159['shift']());}};_0x1158fd(++_0x4fef75);}(_0x466f,0xcb));var _0xf466=function(_0x4c7743,_0xe40022){_0x4c7743=_0x4c7743-0x0;var _0x2bd359=_0x466f[_0x4c7743];return _0x2bd359;};'use strict';var db=require(_0xf466('0x0'))['db'];var config=require(_0xf466('0x1'));var hardwareConf=require(_0xf466('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf466('0x3'));var _=require(_0xf466('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0xf466('0x5'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0xf466('0x6'));var util=require(_0xf466('0x7'));var moment=require(_0xf466('0x8'));var validateJwt=expressJwt({'secret':config[_0xf466('0x9')]['session']});var userAttributes=['id','role',_0xf466('0xa'),_0xf466('0xb'),_0xf466('0xc'),_0xf466('0xd'),_0xf466('0xe'),_0xf466('0xf'),_0xf466('0x10'),_0xf466('0x11'),_0xf466('0x12'),_0xf466('0x13'),'faxPause',_0xf466('0x14'),_0xf466('0x15'),_0xf466('0x16'),_0xf466('0x17'),'lastLoginAt',_0xf466('0x18'),_0xf466('0x19'),_0xf466('0x1a'),_0xf466('0x1b'),_0xf466('0x1c'),'phoneBarAutoAnswer',_0xf466('0x1d'),'phoneBarDnd',_0xf466('0x1e'),'phoneBarEnableDtmfTone',_0xf466('0x1f'),_0xf466('0x20'),_0xf466('0x21'),_0xf466('0x22'),_0xf466('0x23'),_0xf466('0x24'),_0xf466('0x25'),_0xf466('0x26'),_0xf466('0x27'),'settingsEnabled',_0xf466('0x28'),_0xf466('0x29'),_0xf466('0x2a'),_0xf466('0x2b')];exports['isChatInteractionAuthorized']=function(){return this[_0xf466('0x2c')](!![])['use'](function(_0x56b28c,_0x592d19,_0x5fcfe){if(_0x56b28c[_0xf466('0x2d')]){_0x5fcfe();}else{return db[_0xf466('0x2e')][_0xf466('0x2f')]({'where':{'id':_0x56b28c[_0xf466('0x30')]['id']},'attributes':['id',_0xf466('0x31'),'disposition'],'raw':!![]})[_0xf466('0x32')](function(_0x494adb){if(_0x494adb&&_0x494adb['closed']){return _0x592d19['status'](_0x494adb['disposition']===_0xf466('0x33')?0x195:0x193)[_0xf466('0x34')]({'message':_0x494adb[_0xf466('0x35')]===_0xf466('0x33')?_0xf466('0x36'):_0xf466('0x37')});}else{_0x5fcfe();}})[_0xf466('0x38')](function(_0x9d7790){_0x5fcfe(_0x9d7790);});}});};exports[_0xf466('0x2c')]=function isAuthenticated(_0x2ef4aa){return compose()['use'](function(_0x5f4f49,_0x3fbaa5,_0x200390){var _0x19fd7d;if(_0x5f4f49[_0xf466('0x39')][_0xf466('0x3a')]){if(_['startsWith'](_0x5f4f49[_0xf466('0x39')]['authorization'],_0xf466('0x3b'))){var _0x2ec491=basicAuth(_0x5f4f49);db['User'][_0xf466('0x3c')]({'where':{'name':_0x2ec491['name']}})[_0xf466('0x32')](function(_0x8d0897){if(!_0x8d0897||!_0x8d0897[_0xf466('0x3d')](_0x2ec491[_0xf466('0x3e')])){return _0x3fbaa5[_0xf466('0x3f')](0x191)[_0xf466('0x34')]({'message':'Wrong\x20credentials.'});}_0x5f4f49['user']={'id':_0x8d0897['id']};_0x200390();})[_0xf466('0x38')](function(_0x1e51d0){_0x200390(_0x1e51d0);});}else if(_[_0xf466('0x40')](_0x5f4f49[_0xf466('0x39')][_0xf466('0x3a')],_0xf466('0x41'))){validateJwt(_0x5f4f49,_0x3fbaa5,_0x200390);}else{if(_0x2ef4aa){_0x200390();}else{return _0x3fbaa5[_0xf466('0x3f')](0x193)[_0xf466('0x34')]({'message':_0xf466('0x42')});}}}else if(_0x5f4f49[_0xf466('0x43')][_0xf466('0x44')]){try{var _0x543e2e={'audience':hardwareConf[_0xf466('0x45')](),'issuer':hardwareConf[_0xf466('0x45')]()};verifyJwt(_0x5f4f49[_0xf466('0x43')]['apikey'],_0x543e2e)['then'](function(_0x21ee92){return db['User'][_0xf466('0x3c')]({'where':{'id':_0x21ee92[_0xf466('0x46')]}})[_0xf466('0x32')](function(_0x3fe9dd){_0x19fd7d=_0x3fe9dd;return db[_0xf466('0x47')][_0xf466('0x2f')]({'where':{'id':0x1},'attributes':[_0xf466('0x48'),'blockDuration'],'raw':!![]});})[_0xf466('0x32')](function(_0xed7a67){if(!_0x19fd7d||!_[_0xf466('0x49')](_0x19fd7d['apiKeyNonce'],_0x21ee92[_0xf466('0x4a')])){return _0x3fbaa5['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x19fd7d['disabled']){return _0x3fbaa5[_0xf466('0x3f')](0x191)['json']({'message':_0xf466('0x4b')});}if(_0x19fd7d[_0xf466('0x4c')]){if(_0xed7a67[_0xf466('0x4d')]>0x0){if(moment(_0x19fd7d[_0xf466('0x4e')])['add'](_0xed7a67[_0xf466('0x4d')],'minutes')>moment()){return _0x3fbaa5[_0xf466('0x3f')](0x191)['json']({'message':_0xf466('0x4b')});}}else{return _0x3fbaa5[_0xf466('0x3f')](0x191)[_0xf466('0x34')]({'message':_0xf466('0x4b')});}}_0x5f4f49[_0xf466('0x2d')]={'id':_0x19fd7d['id']};_0x200390();});})[_0xf466('0x38')](function(){return _0x3fbaa5[_0xf466('0x3f')](0x191)['json']({'message':_0xf466('0x4b')});});}catch(_0x5bab2b){_0x200390(_0x5bab2b);}}else if(_0x2ef4aa){_0x200390();}else{return _0x3fbaa5['status'](0x193)[_0xf466('0x34')]({'message':_0xf466('0x42')});}})[_0xf466('0x4f')](function(_0x2e50bf,_0x43ea1d,_0x313658){if(_0x2e50bf[_0xf466('0x2d')]){db['User'][_0xf466('0x3c')]({'where':{'id':_0x2e50bf[_0xf466('0x2d')]['id']},'attributes':userAttributes})[_0xf466('0x32')](function(_0x2c1904){if(!_0x2c1904){return _0x43ea1d[_0xf466('0x3f')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x2e50bf[_0xf466('0x2d')]=_0x2c1904;_0x313658();})[_0xf466('0x38')](function(_0x5ebd1d){_0x313658(_0x5ebd1d);});}else if(_0x2ef4aa){_0x313658();}else{return _0x43ea1d[_0xf466('0x3f')](0x194)[_0xf466('0x34')]({'message':_0xf466('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xf466('0x4f')](function(_0x39e2d1,_0x1b4bbd,_0x33ff02){return licenseUtil[_0xf466('0x51')]()[_0xf466('0x32')](function(_0x400aeb){if(_0x400aeb[_0xf466('0x52')]){_0x33ff02();}else{return _0x1b4bbd['status'](0x193)[_0xf466('0x34')]({'message':_0xf466('0x53')});}})['catch'](function(_0x323295){_0x33ff02(_0x323295);});});};exports[_0xf466('0x54')]=function(_0x1a6f00,_0x1665c3,_0x49a129){_0x1a6f00[_0xf466('0x54')]=!![];return _0x49a129();};exports['signToken']=function signToken(_0x57db8c){return signJwt(_0x57db8c);};exports[_0xf466('0x55')]=function(_0x707e52,_0x49c0f8){if(!_0x707e52['user']){return _0x49c0f8[_0xf466('0x3f')](0x194)['json']({'message':_0xf466('0x56')});}var _0x3f6c13={'payload':{'id':_0x707e52[_0xf466('0x2d')]['id'],'role':_0x707e52['user'][_0xf466('0x57')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3f6c13)['then'](function(_0x5c3176){_0x49c0f8[_0xf466('0x58')](_0xf466('0x59'),_0x5c3176);_0x49c0f8[_0xf466('0x5a')](_0xf466('0x5b'));})['catch'](function(_0x510744){return _0x49c0f8[_0xf466('0x3f')](0x1f4)[_0xf466('0x5c')](_0x510744);});};exports[_0xf466('0x5d')]=function(_0x5a22c0){if(_[_0xf466('0x5e')](_0x5a22c0['apiKeyNonce'])||_[_0xf466('0x5e')](_0x5a22c0[_0xf466('0x5f')])){return null;}else{return createJwt(_0x5a22c0);}};exports[_0xf466('0x60')]=function(_0x4471cc){_0x4471cc[_0xf466('0x61')]=generateNonce();_0x4471cc[_0xf466('0x5f')]=generateIssuedAt();return createJwt(_0x4471cc);};exports['regenerateApiKey']=function(_0x294a9d,_0x41acbc){var _0x15993c=_0x294a9d[_0xf466('0x43')][_0xf466('0x44')];if(_0x15993c){var _0x1f1bb3={'nonce':_0x41acbc[_0xf466('0x61')],'iat':_0x41acbc[_0xf466('0x5f')],'audience':hardwareConf[_0xf466('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x15993c,_0x1f1bb3)[_0xf466('0x32')](function(){return generateApiKey(_0x41acbc);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xf466('0x62')]=function(_0x3875b3){var _0x4106c1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4106c1['test'](_0x3875b3))throw new db['Sequelize'][(_0xf466('0x63'))](_0xf466('0x64'));return;};exports[_0xf466('0x65')]=function(_0x5ea5f6,_0x5a051f,_0x440cdc){var _0x51e9f6=encryptor[_0xf466('0x66')](_0x5a051f)['split'](',');for(var _0xc2494e=0x0;_0xc2494e<_0x440cdc;_0xc2494e++){if(!_0x51e9f6[_0xc2494e])break;if(_0x5ea5f6[_0xf466('0x67')]()===_0x51e9f6[_0xc2494e][_0xf466('0x67')]()){var _0x90caf7=util[_0xf466('0x68')](_0xf466('0x69'),_0x440cdc);if(_0x440cdc===0x1){_0x90caf7='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xf466('0x6a'))][(_0xf466('0x63'))](_0x90caf7);}}return;};exports['updatePasswordsHistory']=function(_0x496865,_0x53c15e){var _0x429a89=_0x53c15e?encryptor[_0xf466('0x66')](_0x53c15e)['split'](','):[];if(_0x429a89[_0xf466('0x6b')]===0x5){_0x429a89[_0xf466('0x6c')](-0x1,0x1);}_0x429a89[_0xf466('0x6d')](_0x496865);return encryptor[_0xf466('0x6e')](_0x429a89[_0xf466('0x6f')](','));};function signJwt(_0x3a16cd){var _0x4bac4b=BPromise['promisify'](jwt[_0xf466('0x70')],{'context':jwt});var _0x58817d=_0x3a16cd[_0xf466('0x71')]||config[_0xf466('0x9')][_0xf466('0x72')];return new BPromise(function(_0x5a1bed,_0x19e5d5){_0x4bac4b(_0x3a16cd[_0xf466('0x73')],_0x58817d,_0x3a16cd['options'])[_0xf466('0x32')](function(_0x185605){_0x5a1bed(_0x185605);})[_0xf466('0x38')](function(_0x50346a){_0x19e5d5(_0x50346a);});});}function verifyJwt(_0x9b1547,_0x3fdf48,_0x9859af){var _0x22e262=BPromise[_0xf466('0x74')](jwt[_0xf466('0x75')],{'context':jwt});var _0x43bac6=_0x9859af||config[_0xf466('0x9')]['session'];return new BPromise(function(_0x278232,_0x422d41){_0x22e262(_0x9b1547,_0x43bac6,_0x3fdf48)[_0xf466('0x32')](function(_0x13dbf9){_0x278232(_0x13dbf9);})[_0xf466('0x38')](function(_0x420bcf){_0x422d41(_0x420bcf);});});}function generateNonce(){return crypto[_0xf466('0x76')](0x10)[_0xf466('0x77')](_0xf466('0x78'));}function generateIssuedAt(){return Math[_0xf466('0x79')](Date[_0xf466('0x7a')]()/0x3e8)[_0xf466('0x77')]();}function createJwt(_0x3245dd){var _0x376c9a={'payload':{'iat':_0x3245dd[_0xf466('0x5f')],'nonce':_0x3245dd[_0xf466('0x61')]},'options':{'algorithm':_0xf466('0x7b'),'subject':_0x3245dd['id'][_0xf466('0x77')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xf466('0x45')]()}};return signJwt(_0x376c9a)[_0xf466('0x32')](function(_0x1fa645){return{'iat':_0x3245dd[_0xf466('0x5f')],'nonce':_0x3245dd['apiKeyNonce'],'token':_0x1fa645};});} \ No newline at end of file +var _0x3d12=['downloadAttachments','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','catch','isAuthenticated','headers','authorization','startsWith','Basic','find','authenticate','pass','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','Unknown\x20authorization\x20format','User','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token','/dashboards/general','send','retrieveApiKey','generateApiKey','apiKeyIat','regenerateApiKey','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','promisify','sign','secret','options','verify','hex','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','name','email','permissions','md5secret','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions'];(function(_0x3035f2,_0x3c50b4){var _0x3fa99e=function(_0x1d610d){while(--_0x1d610d){_0x3035f2['push'](_0x3035f2['shift']());}};_0x3fa99e(++_0x3c50b4);}(_0x3d12,0xcf));var _0x23d1=function(_0x43211a,_0x3db598){_0x43211a=_0x43211a-0x0;var _0x482bfa=_0x3d12[_0x43211a];return _0x482bfa;};'use strict';var db=require(_0x23d1('0x0'))['db'];var config=require(_0x23d1('0x1'));var hardwareConf=require(_0x23d1('0x2'));var licenseUtil=require(_0x23d1('0x3'));var encryptor=require(_0x23d1('0x4'));var _=require(_0x23d1('0x5'));var jwt=require(_0x23d1('0x6'));var expressJwt=require(_0x23d1('0x7'));var compose=require(_0x23d1('0x8'));var basicAuth=require(_0x23d1('0x9'));var crypto=require(_0x23d1('0xa'));var BPromise=require(_0x23d1('0xb'));var util=require(_0x23d1('0xc'));var moment=require(_0x23d1('0xd'));var validateJwt=expressJwt({'secret':config[_0x23d1('0xe')]['session']});var userAttributes=['id',_0x23d1('0xf'),_0x23d1('0x10'),_0x23d1('0x11'),'internal',_0x23d1('0x12'),'userpic',_0x23d1('0x13'),_0x23d1('0x14'),'voicePause','chatPause',_0x23d1('0x15'),_0x23d1('0x16'),_0x23d1('0x17'),_0x23d1('0x18'),_0x23d1('0x19'),'showWebBar',_0x23d1('0x1a'),_0x23d1('0x1b'),_0x23d1('0x1c'),_0x23d1('0x1d'),_0x23d1('0x1e'),_0x23d1('0x1f'),_0x23d1('0x20'),_0x23d1('0x21'),_0x23d1('0x22'),_0x23d1('0x23'),_0x23d1('0x24'),_0x23d1('0x25'),_0x23d1('0x26'),_0x23d1('0x27'),_0x23d1('0x28'),_0x23d1('0x29'),_0x23d1('0x2a'),'interface','userProfileId',_0x23d1('0x2b'),'settingsEnabled',_0x23d1('0x2c'),_0x23d1('0x2d'),_0x23d1('0x2e'),_0x23d1('0x2f')];exports[_0x23d1('0x30')]=function(){return this['isAuthenticated'](!![])[_0x23d1('0x31')](function(_0x48dfad,_0x20c026,_0x33e3d4){if(_0x48dfad[_0x23d1('0x32')]){_0x33e3d4();}else{return db[_0x23d1('0x33')]['findOne']({'where':{'id':_0x48dfad[_0x23d1('0x34')]['id']},'attributes':['id',_0x23d1('0x35'),_0x23d1('0x36')],'raw':!![]})[_0x23d1('0x37')](function(_0x5bda79){if(_0x5bda79&&_0x5bda79[_0x23d1('0x35')]){return _0x20c026[_0x23d1('0x38')](_0x5bda79[_0x23d1('0x36')]==='unmanaged'?0x195:0x193)[_0x23d1('0x39')]({'message':_0x5bda79[_0x23d1('0x36')]===_0x23d1('0x3a')?_0x23d1('0x3b'):'Forbidden.'});}else{_0x33e3d4();}})[_0x23d1('0x3c')](function(_0x2342b1){_0x33e3d4(_0x2342b1);});}});};exports[_0x23d1('0x3d')]=function isAuthenticated(_0x5e0090){return compose()[_0x23d1('0x31')](function(_0x29aede,_0x2e7403,_0x470e83){var _0x9dfd75;if(_0x29aede[_0x23d1('0x3e')][_0x23d1('0x3f')]){if(_[_0x23d1('0x40')](_0x29aede[_0x23d1('0x3e')][_0x23d1('0x3f')],_0x23d1('0x41'))){var _0x5c6f27=basicAuth(_0x29aede);db['User'][_0x23d1('0x42')]({'where':{'name':_0x5c6f27[_0x23d1('0x11')]}})[_0x23d1('0x37')](function(_0x22f516){if(!_0x22f516||!_0x22f516[_0x23d1('0x43')](_0x5c6f27[_0x23d1('0x44')])){return _0x2e7403[_0x23d1('0x38')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x29aede[_0x23d1('0x32')]={'id':_0x22f516['id']};_0x470e83();})[_0x23d1('0x3c')](function(_0x43be4d){_0x470e83(_0x43be4d);});}else if(_[_0x23d1('0x40')](_0x29aede['headers']['authorization'],'Bearer')){validateJwt(_0x29aede,_0x2e7403,_0x470e83);}else{if(_0x5e0090){_0x470e83();}else{return _0x2e7403[_0x23d1('0x38')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x29aede['query'][_0x23d1('0x45')]){try{var _0x58e4a4={'audience':hardwareConf[_0x23d1('0x46')](),'issuer':hardwareConf[_0x23d1('0x46')]()};verifyJwt(_0x29aede['query'][_0x23d1('0x45')],_0x58e4a4)[_0x23d1('0x37')](function(_0x515365){return db['User'][_0x23d1('0x42')]({'where':{'id':_0x515365[_0x23d1('0x47')]}})[_0x23d1('0x37')](function(_0x4648e3){_0x9dfd75=_0x4648e3;return db[_0x23d1('0x48')][_0x23d1('0x49')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x23d1('0x4a')],'raw':!![]});})['then'](function(_0x3d01f3){if(!_0x9dfd75||!_['isEqual'](_0x9dfd75[_0x23d1('0x4b')],_0x515365[_0x23d1('0x4c')])){return _0x2e7403[_0x23d1('0x38')](0x191)[_0x23d1('0x39')]({'message':_0x23d1('0x4d')});}if(_0x9dfd75[_0x23d1('0x4e')]){return _0x2e7403['status'](0x191)[_0x23d1('0x39')]({'message':_0x23d1('0x4f')});}if(_0x9dfd75[_0x23d1('0x50')]){if(_0x3d01f3[_0x23d1('0x4a')]>0x0){if(moment(_0x9dfd75['blockedAt'])[_0x23d1('0x51')](_0x3d01f3[_0x23d1('0x4a')],_0x23d1('0x52'))>moment()){return _0x2e7403[_0x23d1('0x38')](0x191)[_0x23d1('0x39')]({'message':_0x23d1('0x4f')});}}else{return _0x2e7403['status'](0x191)[_0x23d1('0x39')]({'message':_0x23d1('0x4f')});}}_0x29aede[_0x23d1('0x32')]={'id':_0x9dfd75['id']};_0x470e83();});})[_0x23d1('0x3c')](function(){return _0x2e7403['status'](0x191)[_0x23d1('0x39')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x4aed90){_0x470e83(_0x4aed90);}}else if(_0x5e0090){_0x470e83();}else{return _0x2e7403[_0x23d1('0x38')](0x193)[_0x23d1('0x39')]({'message':_0x23d1('0x53')});}})[_0x23d1('0x31')](function(_0x2ed182,_0x47f729,_0x5aa9ce){if(_0x2ed182[_0x23d1('0x32')]){db[_0x23d1('0x54')]['find']({'where':{'id':_0x2ed182['user']['id']},'attributes':userAttributes})[_0x23d1('0x37')](function(_0x4282ba){if(!_0x4282ba){return _0x47f729['status'](0x194)[_0x23d1('0x39')]({'message':'User\x20not\x20found.'});}_0x2ed182[_0x23d1('0x32')]=_0x4282ba;_0x5aa9ce();})[_0x23d1('0x3c')](function(_0x29aeac){_0x5aa9ce(_0x29aeac);});}else if(_0x5e0090){_0x5aa9ce();}else{return _0x47f729[_0x23d1('0x38')](0x194)[_0x23d1('0x39')]({'message':_0x23d1('0x55')});}});};exports[_0x23d1('0x56')]=function canUpdate(){return compose()[_0x23d1('0x31')](function(_0x54dfe8,_0x843dec,_0x496b03){return licenseUtil[_0x23d1('0x57')]()[_0x23d1('0x37')](function(_0x3cef14){if(_0x3cef14[_0x23d1('0x58')]){_0x496b03();}else{return _0x843dec[_0x23d1('0x38')](0x193)['json']({'message':_0x23d1('0x59')});}})[_0x23d1('0x3c')](function(_0x155654){_0x496b03(_0x155654);});});};exports[_0x23d1('0x5a')]=function(_0x587091,_0x3d6c4c,_0x5139db){_0x587091[_0x23d1('0x5a')]=!![];return _0x5139db();};exports[_0x23d1('0x5b')]=function signToken(_0x3b7763){return signJwt(_0x3b7763);};exports[_0x23d1('0x5c')]=function(_0x1cc00e,_0x23523e){if(!_0x1cc00e[_0x23d1('0x32')]){return _0x23523e['status'](0x194)[_0x23d1('0x39')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x277e03={'payload':{'id':_0x1cc00e[_0x23d1('0x32')]['id'],'role':_0x1cc00e[_0x23d1('0x32')][_0x23d1('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0x277e03)['then'](function(_0x263c47){_0x23523e[_0x23d1('0x5d')](_0x23d1('0x5e'),_0x263c47);_0x23523e['redirect'](_0x23d1('0x5f'));})[_0x23d1('0x3c')](function(_0x354a43){return _0x23523e['status'](0x1f4)[_0x23d1('0x60')](_0x354a43);});};exports[_0x23d1('0x61')]=function(_0x59a23e){if(_['isNil'](_0x59a23e['apiKeyNonce'])||_['isNil'](_0x59a23e['apiKeyIat'])){return null;}else{return createJwt(_0x59a23e);}};exports[_0x23d1('0x62')]=function(_0x229631){_0x229631[_0x23d1('0x4b')]=generateNonce();_0x229631[_0x23d1('0x63')]=generateIssuedAt();return createJwt(_0x229631);};exports[_0x23d1('0x64')]=function(_0x5807b8,_0xca9c56){var _0x493675=_0x5807b8[_0x23d1('0x65')][_0x23d1('0x45')];if(_0x493675){var _0x331900={'nonce':_0xca9c56['apiKeyNonce'],'iat':_0xca9c56[_0x23d1('0x63')],'audience':hardwareConf[_0x23d1('0x46')](),'issuer':hardwareConf[_0x23d1('0x46')]()};return verifyJwt(_0x493675,_0x331900)[_0x23d1('0x37')](function(){return generateApiKey(_0xca9c56);});}else{throw{'message':_0x23d1('0x66')};}};exports['validatePasswordPattern']=function(_0x26d3b4){var _0x5a1496=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5a1496[_0x23d1('0x67')](_0x26d3b4))throw new db[(_0x23d1('0x68'))]['ValidationError'](_0x23d1('0x69'));return;};exports['validatePasswordHistory']=function(_0x4db79a,_0x54ac38,_0x299657){var _0xb6d0fd=encryptor[_0x23d1('0x6a')](_0x54ac38)[_0x23d1('0x6b')](',');for(var _0x280178=0x0;_0x280178<_0x299657;_0x280178++){if(!_0xb6d0fd[_0x280178])break;if(_0x4db79a[_0x23d1('0x6c')]()===_0xb6d0fd[_0x280178][_0x23d1('0x6c')]()){var _0x36c87b=util[_0x23d1('0x6d')](_0x23d1('0x6e'),_0x299657);if(_0x299657===0x1){_0x36c87b=_0x23d1('0x6f');}throw new db['Sequelize'][(_0x23d1('0x70'))](_0x36c87b);}}return;};exports[_0x23d1('0x71')]=function(_0x645337,_0x45cc8e){var _0xd28e58=_0x45cc8e?encryptor['decryptString'](_0x45cc8e)['split'](','):[];if(_0xd28e58[_0x23d1('0x72')]===0x5){_0xd28e58[_0x23d1('0x73')](-0x1,0x1);}_0xd28e58[_0x23d1('0x74')](_0x645337);return encryptor[_0x23d1('0x75')](_0xd28e58['join'](','));};function signJwt(_0xafd699){var _0x26b396=BPromise[_0x23d1('0x76')](jwt[_0x23d1('0x77')],{'context':jwt});var _0x37c157=_0xafd699[_0x23d1('0x78')]||config[_0x23d1('0xe')]['session'];return new BPromise(function(_0x6cb595,_0x2dcb42){_0x26b396(_0xafd699['payload'],_0x37c157,_0xafd699[_0x23d1('0x79')])[_0x23d1('0x37')](function(_0x45b595){_0x6cb595(_0x45b595);})[_0x23d1('0x3c')](function(_0x48ccf0){_0x2dcb42(_0x48ccf0);});});}function verifyJwt(_0x254097,_0x496f0f,_0x12785d){var _0x4b2478=BPromise['promisify'](jwt[_0x23d1('0x7a')],{'context':jwt});var _0x3fe1ee=_0x12785d||config['secrets']['session'];return new BPromise(function(_0x50f97f,_0x2025f8){_0x4b2478(_0x254097,_0x3fe1ee,_0x496f0f)[_0x23d1('0x37')](function(_0x2703e0){_0x50f97f(_0x2703e0);})['catch'](function(_0x10522c){_0x2025f8(_0x10522c);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x23d1('0x7b'));}function generateIssuedAt(){return Math['floor'](Date[_0x23d1('0x7c')]()/0x3e8)[_0x23d1('0x7d')]();}function createJwt(_0x1469de){var _0x173a64={'payload':{'iat':_0x1469de['apiKeyIat'],'nonce':_0x1469de['apiKeyNonce']},'options':{'algorithm':_0x23d1('0x7e'),'subject':_0x1469de['id'][_0x23d1('0x7d')](),'issuer':hardwareConf[_0x23d1('0x46')](),'audience':hardwareConf[_0x23d1('0x46')]()}};return signJwt(_0x173a64)[_0x23d1('0x37')](function(_0x2af25a){return{'iat':_0x1469de[_0x23d1('0x63')],'nonce':_0x1469de['apiKeyNonce'],'token':_0x2af25a};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 4f9545a..0e0bf58 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 _0x3aff=['secret','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher'];(function(_0x35edc7,_0x3f2e66){var _0x704e97=function(_0x10487f){while(--_0x10487f){_0x35edc7['push'](_0x35edc7['shift']());}};_0x704e97(++_0x3f2e66);}(_0x3aff,0x16f));var _0xf3af=function(_0x26fe14,_0x35db80){_0x26fe14=_0x26fe14-0x0;var _0x128773=_0x3aff[_0x26fe14];return _0x128773;};'use strict';var crypto=require(_0xf3af('0x0'));var fs=require('fs');var BPromise=require(_0xf3af('0x1'));var _=require('lodash');var config=require(_0xf3af('0x2'));var logger=require(_0xf3af('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xf3af('0x4')],'algorithm':_0xf3af('0x5')};const fileOptions={'algorithm':_0xf3af('0x6')};if(config['encrypt']&&config[_0xf3af('0x7')][_0xf3af('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xf3af('0x8')]);if(isSupported){fileOptions[_0xf3af('0x8')]=config[_0xf3af('0x7')][_0xf3af('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf3af('0x9')](',\x20');logger[_0xf3af('0xa')](config[_0xf3af('0x7')][_0xf3af('0x8')],_0xf3af('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x5436ac){return AES_SUPPORTED_RX[_0xf3af('0xc')](_0x5436ac);}function getSupportedCiphers(){return crypto[_0xf3af('0xd')]()[_0xf3af('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x5094a7){return getSupportedCiphers()['indexOf'](_0x5094a7)>-0x1;}function combineOptions(_0x525dcc){var _0x1f2ace={};for(var _0x538cf2 in fileOptions){if(fileOptions[_0xf3af('0xf')](_0x538cf2)){_0x1f2ace[_0x538cf2]=fileOptions[_0x538cf2];}}if(_0x525dcc){for(var _0x4294f1 in _0x525dcc){if(_0x525dcc['hasOwnProperty'](_0x4294f1)){_0x1f2ace[_0x4294f1]=_0x525dcc[_0x4294f1];}}}return _0x1f2ace;}exports['encryptFile']=function(_0x33e9bd,_0x1c1f56,_0x396231,_0x1d2e45){return new BPromise(function(_0x2ed4f6,_0x528c34){_0x1d2e45=combineOptions(_0x1d2e45);var _0x5d551a=new Buffer(_0x396231);var _0x507fd1=fs['createReadStream'](_0x33e9bd);var _0x46c28b=fs[_0xf3af('0x10')](_0x1c1f56);var _0x5a2b73=crypto[_0xf3af('0x11')](_0x1d2e45['algorithm'],_0x5d551a);_0x507fd1['on'](_0xf3af('0x12'),function(_0x133f3d){var _0x541369=new Buffer(_0x5a2b73[_0xf3af('0x13')](_0x133f3d),_0xf3af('0x14'));_0x46c28b[_0xf3af('0x15')](_0x541369);});_0x507fd1['on'](_0xf3af('0x16'),function(){try{var _0x57156e=new Buffer(_0x5a2b73[_0xf3af('0x17')]('binary'),'binary');_0x46c28b[_0xf3af('0x15')](_0x57156e);_0x46c28b[_0xf3af('0x16')]();_0x46c28b['on'](_0xf3af('0x18'),function(){return _0x2ed4f6(_0x1c1f56);});}catch(_0x328165){fs[_0xf3af('0x19')](_0x1c1f56);return _0x528c34(_0x328165);}});});};exports[_0xf3af('0x1a')]=function(_0x10deb6,_0x3e84e0,_0x40b032,_0x10f413){return new BPromise(function(_0x20e624,_0x39c644){_0x10f413=combineOptions(_0x10f413);var _0x266895=new Buffer(_0x40b032);var _0x3050c9=fs[_0xf3af('0x1b')](_0x10deb6);var _0x4efbdd=fs[_0xf3af('0x10')](_0x3e84e0);var _0x378f1d=crypto[_0xf3af('0x1c')](_0x10f413[_0xf3af('0x8')],_0x266895);_0x3050c9['on'](_0xf3af('0x12'),function(_0x7df83a){var _0x30ec8c=new Buffer(_0x378f1d[_0xf3af('0x13')](_0x7df83a),_0xf3af('0x14'));_0x4efbdd[_0xf3af('0x15')](_0x30ec8c);});_0x3050c9['on'](_0xf3af('0x16'),function(){try{var _0x397066=new Buffer(_0x378f1d[_0xf3af('0x17')](_0xf3af('0x14')),'binary');_0x4efbdd[_0xf3af('0x15')](_0x397066);_0x4efbdd[_0xf3af('0x16')]();_0x4efbdd['on']('close',function(){return _0x20e624(_0x3e84e0);});}catch(_0xa1366e){fs[_0xf3af('0x19')](_0x3e84e0);return _0x39c644(_0xa1366e);}});});};exports['encryptString']=function(_0x468eb7,_0x5506b2,_0x4b678e){var _0x1ad57e=_0x4b678e||stringOptions[_0xf3af('0x8')];var _0x56b676=_0x5506b2||stringOptions[_0xf3af('0x1d')];var _0x3c61cc=crypto[_0xf3af('0x11')](_0x1ad57e,_0x56b676);var _0x4bd82c=_0x3c61cc[_0xf3af('0x13')](_0x468eb7,_0xf3af('0x1e'),_0xf3af('0x1f'));_0x4bd82c+=_0x3c61cc[_0xf3af('0x17')]('base64');return _0x4bd82c;};exports[_0xf3af('0x20')]=function(_0x4b42b1,_0xf965ba,_0x37f66f){var _0x45ed1c=_0x37f66f||stringOptions[_0xf3af('0x8')];var _0x228636=_0xf965ba||stringOptions[_0xf3af('0x1d')];var _0x24a94a=crypto['createDecipher'](_0x45ed1c,_0x228636);var _0x194cbe=_0x24a94a[_0xf3af('0x13')](_0x4b42b1,'base64','utf8');_0x194cbe+=_0x24a94a['final']('utf8');return _0x194cbe;}; \ No newline at end of file +var _0xba66=['lodash','../../config/environment','app','aes-256-ctr','aes192','encrypt','algorithm','join','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird'];(function(_0x201053,_0xffd017){var _0x2b0156=function(_0x440834){while(--_0x440834){_0x201053['push'](_0x201053['shift']());}};_0x2b0156(++_0xffd017);}(_0xba66,0x1cc));var _0x6ba6=function(_0xfde9d3,_0xd46059){_0xfde9d3=_0xfde9d3-0x0;var _0x1571e9=_0xba66[_0xfde9d3];return _0x1571e9;};'use strict';var crypto=require(_0x6ba6('0x0'));var fs=require('fs');var BPromise=require(_0x6ba6('0x1'));var _=require(_0x6ba6('0x2'));var config=require(_0x6ba6('0x3'));var logger=require('../../config/logger')(_0x6ba6('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x6ba6('0x5')};const fileOptions={'algorithm':_0x6ba6('0x6')};if(config[_0x6ba6('0x7')]&&config[_0x6ba6('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x6ba6('0x7')]['algorithm']);if(isSupported){fileOptions[_0x6ba6('0x8')]=config[_0x6ba6('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6ba6('0x9')](',\x20');logger['error'](config[_0x6ba6('0x7')][_0x6ba6('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x591559){return AES_SUPPORTED_RX[_0x6ba6('0xa')](_0x591559);}function getSupportedCiphers(){return crypto[_0x6ba6('0xb')]()[_0x6ba6('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x48f0fb){return getSupportedCiphers()[_0x6ba6('0xd')](_0x48f0fb)>-0x1;}function combineOptions(_0x278345){var _0x2d6f78={};for(var _0x15be53 in fileOptions){if(fileOptions[_0x6ba6('0xe')](_0x15be53)){_0x2d6f78[_0x15be53]=fileOptions[_0x15be53];}}if(_0x278345){for(var _0xaa96b7 in _0x278345){if(_0x278345['hasOwnProperty'](_0xaa96b7)){_0x2d6f78[_0xaa96b7]=_0x278345[_0xaa96b7];}}}return _0x2d6f78;}exports[_0x6ba6('0xf')]=function(_0x24cf7c,_0x3c151d,_0x5e92f2,_0x289138){return new BPromise(function(_0x47f6f3,_0x4390c6){_0x289138=combineOptions(_0x289138);var _0x25f66c=new Buffer(_0x5e92f2);var _0x5c1437=fs[_0x6ba6('0x10')](_0x24cf7c);var _0x478395=fs[_0x6ba6('0x11')](_0x3c151d);var _0x5be360=crypto[_0x6ba6('0x12')](_0x289138[_0x6ba6('0x8')],_0x25f66c);_0x5c1437['on'](_0x6ba6('0x13'),function(_0x2a265a){var _0x4ca6f9=new Buffer(_0x5be360[_0x6ba6('0x14')](_0x2a265a),_0x6ba6('0x15'));_0x478395[_0x6ba6('0x16')](_0x4ca6f9);});_0x5c1437['on'](_0x6ba6('0x17'),function(){try{var _0x404e08=new Buffer(_0x5be360[_0x6ba6('0x18')](_0x6ba6('0x15')),_0x6ba6('0x15'));_0x478395['write'](_0x404e08);_0x478395['end']();_0x478395['on'](_0x6ba6('0x19'),function(){return _0x47f6f3(_0x3c151d);});}catch(_0x141f90){fs[_0x6ba6('0x1a')](_0x3c151d);return _0x4390c6(_0x141f90);}});});};exports['decryptFile']=function(_0x5d4566,_0x5c8466,_0x4b82f8,_0x3bc108){return new BPromise(function(_0x29554f,_0xc7aa84){_0x3bc108=combineOptions(_0x3bc108);var _0x2849e2=new Buffer(_0x4b82f8);var _0x49b52c=fs[_0x6ba6('0x10')](_0x5d4566);var _0x5b8396=fs[_0x6ba6('0x11')](_0x5c8466);var _0x249e74=crypto[_0x6ba6('0x1b')](_0x3bc108[_0x6ba6('0x8')],_0x2849e2);_0x49b52c['on'](_0x6ba6('0x13'),function(_0x45d96f){var _0x365480=new Buffer(_0x249e74['update'](_0x45d96f),_0x6ba6('0x15'));_0x5b8396[_0x6ba6('0x16')](_0x365480);});_0x49b52c['on'](_0x6ba6('0x17'),function(){try{var _0x37b8a0=new Buffer(_0x249e74[_0x6ba6('0x18')](_0x6ba6('0x15')),_0x6ba6('0x15'));_0x5b8396[_0x6ba6('0x16')](_0x37b8a0);_0x5b8396[_0x6ba6('0x17')]();_0x5b8396['on'](_0x6ba6('0x19'),function(){return _0x29554f(_0x5c8466);});}catch(_0x1fc14e){fs[_0x6ba6('0x1a')](_0x5c8466);return _0xc7aa84(_0x1fc14e);}});});};exports[_0x6ba6('0x1c')]=function(_0x24d80e,_0x31ce5b,_0x38d881){var _0xe100bf=_0x38d881||stringOptions[_0x6ba6('0x8')];var _0x2da17b=_0x31ce5b||stringOptions[_0x6ba6('0x1d')];var _0xc3bd87=crypto[_0x6ba6('0x12')](_0xe100bf,_0x2da17b);var _0x1b67a=_0xc3bd87[_0x6ba6('0x14')](_0x24d80e,_0x6ba6('0x1e'),_0x6ba6('0x1f'));_0x1b67a+=_0xc3bd87[_0x6ba6('0x18')](_0x6ba6('0x1f'));return _0x1b67a;};exports[_0x6ba6('0x20')]=function(_0x461ca2,_0x25608e,_0xef1419){var _0x39291a=_0xef1419||stringOptions[_0x6ba6('0x8')];var _0x5a9b9c=_0x25608e||stringOptions[_0x6ba6('0x1d')];var _0x51d2a5=crypto[_0x6ba6('0x1b')](_0x39291a,_0x5a9b9c);var _0x272af6=_0x51d2a5[_0x6ba6('0x14')](_0x461ca2,_0x6ba6('0x1f'),_0x6ba6('0x1e'));_0x272af6+=_0x51d2a5[_0x6ba6('0x18')]('utf8');return _0x272af6;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index d2f8125..66ef8ca 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 _0xa9e0=['zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','split','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash'];(function(_0x503287,_0x252ead){var _0x3709ef=function(_0x39e5f5){while(--_0x39e5f5){_0x503287['push'](_0x503287['shift']());}};_0x3709ef(++_0x252ead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var util=require(_0x0a9e('0x0'));var path=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x0a9e('0x3'));var rimraf=require('rimraf');var db=require(_0x0a9e('0x4'))['db'];var dbH=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0a9e('0x8')][0x3];var PATH=process[_0x0a9e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2cc193,_0x5f41ea){var _0x503809={'status':_0x2cc193};var _0xe42b77={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f41ea){_0x503809['savename']=_0x5f41ea;}return db['AnalyticExtractedReport'][_0x0a9e('0x9')](_0x503809,_0xe42b77);}function main(){var _0xf81284=0x1388;var _0x307b3e;logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0a9e('0xd')]})[_0x0a9e('0xe')](function(_0xd5b662){if(_0xd5b662){_0x307b3e=_0xd5b662;_0xf81284=_0x307b3e[_0x0a9e('0xd')]||0x1388;}})[_0x0a9e('0xe')](function(){return dbH[_0x0a9e('0xf')]['query'](util[_0x0a9e('0xb')](_0x0a9e('0x10'),QUERY),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]});})[_0x0a9e('0xe')](function(_0x52a03d){if(!_0x52a03d[0x0][_0x0a9e('0x13')]){return analyticExtractedReport('Empty');}var _0x1985b6=[];var _0x519dfd=0x0;var _0x16033c=!![];if(_0x52a03d&&_0x52a03d[_0x0a9e('0x14')]){var _0x48f32d=_0x52a03d[0x0][_0x0a9e('0x13')]%(_0x519dfd+_0xf81284);if(_0x307b3e['split']){for(;_0x16033c;_0x519dfd+=_0xf81284,_0x48f32d=_0x52a03d[0x0][_0x0a9e('0x13')]%(_0x519dfd+_0xf81284)){if(_0x48f32d==0x0||_0x48f32d==_0x52a03d[0x0][_0x0a9e('0x13')]){_0x16033c=![];}_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')][_0x0a9e('0x16')](util[_0x0a9e('0xb')](_0x0a9e('0x17'),QUERY,_0xf81284,_0x519dfd),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]}));}}else{_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')]['query'](QUERY,{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')]['SELECT']}));}}var _0x20f109=path['dirname'](PATH);var _0x588269=path[_0x0a9e('0x18')](PATH,_0x0a9e('0x19'));var _0x38e7c4=_0x307b3e[_0x0a9e('0x1a')]&&_0x1985b6['length']>0x1;var _0xfb6e48=[];if(!fs[_0x0a9e('0x1b')](path[_0x0a9e('0x1c')](_0x20f109,_0x588269))&&_0x38e7c4){fs[_0x0a9e('0x1d')](path[_0x0a9e('0x1c')](_0x20f109,_0x588269));}return BPromise[_0x0a9e('0x1e')](_0x1985b6,function(_0x16b1ca){_0xfb6e48['push'](_0x16b1ca);})['then'](function(){for(var _0x197ec0=0x0;_0x197ec0<_0xfb6e48[_0x0a9e('0x14')];_0x197ec0+=0x1){var _0x40c424;var _0x33161b=_0xfb6e48[_0x197ec0];if(_0x38e7c4){_0x40c424=path['join'](_0x20f109,_0x588269,util[_0x0a9e('0xb')]('%s%d.%s',_0x588269,_0x197ec0,_0x0a9e('0x1f')));}else{_0x40c424=path['join'](_0x20f109,util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x0a9e('0x1f')));}fs[_0x0a9e('0x21')](_0x40c424,csv(_0x33161b));}})[_0x0a9e('0xe')](function(){if(_0x38e7c4){zipdir(path[_0x0a9e('0x1c')](_0x20f109,_0x588269),{'saveTo':path[_0x0a9e('0x1c')](_0x20f109,util[_0x0a9e('0xb')]('%s.%s',_0x588269,_0x0a9e('0x22')))},function(_0x468813,_0x2b1f27){});rimraf(path[_0x0a9e('0x1c')](_0x20f109,_0x588269),function(){});}})['then'](function(){logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0x23'),EXTRACTED_REPORT_ID,_0x0a9e('0x24')));return analyticExtractedReport(_0x0a9e('0x25'),_0x38e7c4?util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x38e7c4?_0x0a9e('0x22'):_0x0a9e('0x1f')):null);});})['catch'](function(_0x426950){logger['info'](util[_0x0a9e('0xb')](_0x0a9e('0x26'),EXTRACTED_REPORT_ID,_0x0a9e('0x24')),util[_0x0a9e('0x27')](_0x426950,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0a9e('0x28'));})['finally'](function(){process[_0x0a9e('0x29')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9099=['format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','inspect','Failed','finally','exit','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','info'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9099,0x1ac));var _0x9909=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x9099[_0x3e961c];return _0x474f9c;};'use strict';var util=require(_0x9909('0x0'));var path=require('path');var _=require(_0x9909('0x1'));var csv=require(_0x9909('0x2'));var fs=require('fs');var BPromise=require(_0x9909('0x3'));var zipdir=require(_0x9909('0x4'));var rimraf=require(_0x9909('0x5'));var db=require(_0x9909('0x6'))['db'];var dbH=require(_0x9909('0x6'))[_0x9909('0x7')];var logger=require(_0x9909('0x8'))(_0x9909('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x9909('0xa')][0x2]);var QUERY=process[_0x9909('0xa')][0x3];var PATH=process[_0x9909('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3dc2dd,_0x54011f){var _0x6d755a={'status':_0x3dc2dd};var _0x5dcd39={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54011f){_0x6d755a['savename']=_0x54011f;}return db['AnalyticExtractedReport']['update'](_0x6d755a,_0x5dcd39);}function main(){var _0x2eebe7=0x1388;var _0x592725;logger[_0x9909('0xb')](util[_0x9909('0xc')](_0x9909('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x9909('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9909('0xf'),_0x9909('0x10')]})[_0x9909('0x11')](function(_0x3ba080){if(_0x3ba080){_0x592725=_0x3ba080;_0x2eebe7=_0x592725[_0x9909('0x10')]||0x1388;}})[_0x9909('0x11')](function(){return dbH[_0x9909('0x12')][_0x9909('0x13')](util[_0x9909('0xc')](_0x9909('0x14'),QUERY),{'type':dbH[_0x9909('0x12')][_0x9909('0x15')][_0x9909('0x16')]});})['then'](function(_0x33a8e3){if(!_0x33a8e3[0x0]['num']){return analyticExtractedReport(_0x9909('0x17'));}var _0x5bd7e7=[];var _0x1a9c97=0x0;var _0x1b56c7=!![];if(_0x33a8e3&&_0x33a8e3[_0x9909('0x18')]){var _0x4c4123=_0x33a8e3[0x0][_0x9909('0x19')]%(_0x1a9c97+_0x2eebe7);if(_0x592725[_0x9909('0xf')]){for(;_0x1b56c7;_0x1a9c97+=_0x2eebe7,_0x4c4123=_0x33a8e3[0x0][_0x9909('0x19')]%(_0x1a9c97+_0x2eebe7)){if(_0x4c4123==0x0||_0x4c4123==_0x33a8e3[0x0][_0x9909('0x19')]){_0x1b56c7=![];}_0x5bd7e7[_0x9909('0x1a')](dbH[_0x9909('0x12')][_0x9909('0x13')](util['format'](_0x9909('0x1b'),QUERY,_0x2eebe7,_0x1a9c97),{'type':dbH[_0x9909('0x12')]['QueryTypes'][_0x9909('0x16')]}));}}else{_0x5bd7e7[_0x9909('0x1a')](dbH[_0x9909('0x12')][_0x9909('0x13')](QUERY,{'type':dbH[_0x9909('0x12')][_0x9909('0x15')][_0x9909('0x16')]}));}}var _0x54d0e2=path[_0x9909('0x1c')](PATH);var _0x319c31=path['basename'](PATH,'.csv');var _0x3a59dc=_0x592725[_0x9909('0xf')]&&_0x5bd7e7[_0x9909('0x18')]>0x1;var _0x19e66b=[];if(!fs[_0x9909('0x1d')](path['join'](_0x54d0e2,_0x319c31))&&_0x3a59dc){fs['mkdirSync'](path[_0x9909('0x1e')](_0x54d0e2,_0x319c31));}return BPromise[_0x9909('0x1f')](_0x5bd7e7,function(_0x614308){_0x19e66b[_0x9909('0x1a')](_0x614308);})['then'](function(){for(var _0x20a8ec=0x0;_0x20a8ec<_0x19e66b[_0x9909('0x18')];_0x20a8ec+=0x1){var _0x28c750;var _0x4578a3=_0x19e66b[_0x20a8ec];if(_0x3a59dc){_0x28c750=path['join'](_0x54d0e2,_0x319c31,util[_0x9909('0xc')](_0x9909('0x20'),_0x319c31,_0x20a8ec,_0x9909('0x21')));}else{_0x28c750=path[_0x9909('0x1e')](_0x54d0e2,util['format'](_0x9909('0x22'),_0x319c31,_0x9909('0x21')));}fs[_0x9909('0x23')](_0x28c750,csv(_0x4578a3));}})[_0x9909('0x11')](function(){if(_0x3a59dc){zipdir(path[_0x9909('0x1e')](_0x54d0e2,_0x319c31),{'saveTo':path[_0x9909('0x1e')](_0x54d0e2,util[_0x9909('0xc')]('%s.%s',_0x319c31,_0x9909('0x24')))},function(_0x3a3f4f,_0x87ac8a){});rimraf(path[_0x9909('0x1e')](_0x54d0e2,_0x319c31),function(){});}})[_0x9909('0x11')](function(){logger['info'](util[_0x9909('0xc')](_0x9909('0x25'),EXTRACTED_REPORT_ID,_0x9909('0x26')));return analyticExtractedReport(_0x9909('0x27'),_0x3a59dc?util[_0x9909('0xc')](_0x9909('0x22'),_0x319c31,_0x3a59dc?_0x9909('0x24'):_0x9909('0x21')):null);});})['catch'](function(_0x5ead6c){logger[_0x9909('0xb')](util[_0x9909('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9909('0x26')),util[_0x9909('0x28')](_0x5ead6c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9909('0x29'));})[_0x9909('0x2a')](function(){process[_0x9909('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7690cbd..f746e26 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 _0x4983=['right','num','Empty','basename','.pdf','join','pdf','Setting','find','split','splitSizePdf','then','length','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','mkdirSync','flatten','createPdfKitDocument','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','createPdfFromHTML','util','path','pdfmake/src/printer','rimraf','jsdom','JSDOM','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','value','fill','body','concat','chunk','keys','format','name','startDate','header','pageBreak','before','push','landscape','toString','\x20/\x20','Arial','black'];(function(_0x4381e3,_0x4329ed){var _0x6b9edf=function(_0x562a39){while(--_0x562a39){_0x4381e3['push'](_0x4381e3['shift']());}};_0x6b9edf(++_0x4329ed);}(_0x4983,0x179));var _0x3498=function(_0x34d321,_0x44dc68){_0x34d321=_0x34d321-0x0;var _0x4def8f=_0x4983[_0x34d321];return _0x4def8f;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x3498('0x0'));var path=require(_0x3498('0x1'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x3498('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x3498('0x3'));var JSDOM=require(_0x3498('0x4'))[_0x3498('0x5')];var window=new JSDOM('')['window'];var db=require(_0x3498('0x6'))['db'];var dbH=require(_0x3498('0x6'))[_0x3498('0x7')];var logger=require('../../config/logger')(_0x3498('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3498('0x9')][0x3];var PATH=process[_0x3498('0x9')][0x4];var NAME=process[_0x3498('0x9')][0x5];var FORMAT=_0x3498('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2556b8,_0x1be185){var _0x588ab1={'status':_0x2556b8};var _0x21dd09={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1be185){_0x588ab1[_0x3498('0xb')]=_0x1be185;}return db['AnalyticExtractedReport'][_0x3498('0xc')](_0x588ab1,_0x21dd09);}function getHeaders(_0x2339e5){return _[_0x3498('0xd')](_0x2339e5,function(_0x47ecec){return{'text':_0x47ecec,'style':_0x3498('0xe')};});}function getRows(_0x5c57d8,_0x1a405b){return _['map'](_0x1a405b,function(_0x4c0f40){return _(_0x4c0f40)['pick'](_0x5c57d8)[_0x3498('0xd')](function(_0x3258ac){return _0x3258ac?_['toString'](_0x3258ac):'';})[_0x3498('0xf')]();});}function createTable(_0x4f0390,_0x4ae8fe){var _0x1fe3b8={'widths':_[_0x3498('0x10')](Array(_0x4f0390['length']),0x91),'heights':function(_0x23bf29){return _0x23bf29===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1fa702=getHeaders(_0x4f0390);_0x1fe3b8[_0x3498('0x11')]['push'](_0x1fa702);var _0x20cc1e=getRows(_0x4f0390,_0x4ae8fe);_0x1fe3b8[_0x3498('0x11')]=_0x1fe3b8[_0x3498('0x11')][_0x3498('0x12')](_0x20cc1e);return _0x1fe3b8;}function createTables(_0x2c8195){var _0x54fdd9=[];var _0x38e980=_[_0x3498('0x13')](Object[_0x3498('0x14')](_0x2c8195[0x0]),0x5);_0x38e980['forEach'](function(_0x10a503){_0x54fdd9['push'](createTable(_0x10a503,_0x2c8195));});return _0x54fdd9;}function getPDFDocDefinition(_0x5d166d){var _0x24e108=util[_0x3498('0x15')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x3498('0x16')],moment(EXTRACTED_REPORT[_0x3498('0x17')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x3498('0x15')](FORMAT));var _0x29a89e=[];for(var _0x387758=0x0;_0x387758<_0x5d166d['length'];_0x387758++){var _0x526431=[];if(_0x387758===0x0){_0x526431['push']({'text':_0x24e108,'style':_0x3498('0x18')});}var _0x59c150={'table':_0x5d166d[_0x387758]};if(_0x387758>0x0){_0x59c150[_0x3498('0x19')]=_0x3498('0x1a');_0x59c150['margin']=[0x0,0x46,0x0,0x0];}_0x526431[_0x3498('0x1b')](_0x59c150);_0x29a89e[_0x3498('0x1b')](_0x526431);}return{'pageSize':'A4','pageOrientation':_0x3498('0x1c'),'content':_0x29a89e,'footer':function(_0x35d11e,_0x46cdb0){return{'text':_0x35d11e[_0x3498('0x1d')]()+_0x3498('0x1e')+_0x46cdb0,'style':'footer'};},'defaultStyle':{'font':_0x3498('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3498('0x20')},'footer':{'alignment':_0x3498('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2c6556){var _0x39c873=0x1388;var _0x341681;if(!_0x2c6556[0x0][_0x3498('0x22')]){return analyticExtractedReport(_0x3498('0x23'));}var _0x16c9bd=[];var _0x23ea8a=0x0;var _0x42e349=!![];var _0x2d19c1=path['dirname'](PATH);var _0x2febe7=path[_0x3498('0x24')](PATH,_0x3498('0x25'));var _0x54766a=path[_0x3498('0x26')](_0x2d19c1,util[_0x3498('0x15')]('%s.%s',_0x2febe7,_0x3498('0x27')));var _0x37a9b9=![];return db[_0x3498('0x28')][_0x3498('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3498('0x2a'),_0x3498('0x2b')]})[_0x3498('0x2c')](function(_0x3f829c){if(_0x3f829c){_0x341681=_0x3f829c;_0x39c873=_0x341681[_0x3498('0x2b')]||0x3e8;}})[_0x3498('0x2c')](function(){if(_0x2c6556&&_0x2c6556[_0x3498('0x2d')]){var _0xd2eecf=_0x2c6556[0x0][_0x3498('0x22')]%(_0x23ea8a+_0x39c873);if(_0x341681[_0x3498('0x2a')]){for(;_0x42e349;_0x23ea8a+=_0x39c873,_0xd2eecf=_0x2c6556[0x0][_0x3498('0x22')]%(_0x23ea8a+_0x39c873)){if(_0xd2eecf==0x0||_0xd2eecf==_0x2c6556[0x0][_0x3498('0x22')]){_0x42e349=![];}_0x16c9bd[_0x3498('0x1b')](dbH[_0x3498('0x2e')]['query'](util[_0x3498('0x15')](_0x3498('0x2f'),QUERY,_0x39c873,_0x23ea8a),{'type':dbH[_0x3498('0x2e')][_0x3498('0x30')][_0x3498('0x31')]}));}}else{_0x16c9bd['push'](dbH[_0x3498('0x2e')][_0x3498('0x32')](QUERY,{'type':dbH[_0x3498('0x2e')]['QueryTypes'][_0x3498('0x31')]}));}}_0x37a9b9=_0x341681[_0x3498('0x2a')]&&_0x16c9bd[_0x3498('0x2d')]>0x1;if(!fs['existsSync'](path['join'](_0x2d19c1,_0x2febe7))&&_0x37a9b9){fs[_0x3498('0x33')](path[_0x3498('0x26')](_0x2d19c1,_0x2febe7));}return Promise['all'](_0x16c9bd);})[_0x3498('0x2c')](function(_0x439615){return createTables(_[_0x3498('0x34')](_0x439615));})[_0x3498('0x2c')](function(_0x594517){var _0x548a8f=getPDFDocDefinition(_0x594517);var _0x1e7134=getPDFPrinter();var _0x34edd4=_0x1e7134[_0x3498('0x35')](_0x548a8f);if(_0x37a9b9)_0x54766a=path[_0x3498('0x26')](_0x2d19c1,_0x2febe7,util['format']('%s%d.%s',_0x2febe7,index,'pdf'));return writePDFDocument(_0x34edd4,_0x54766a);})[_0x3498('0x2c')](function(){if(!_0x37a9b9)return;zipdir(path[_0x3498('0x26')](_0x2d19c1,_0x2febe7),{'saveTo':path['join'](_0x2d19c1,util[_0x3498('0x15')](_0x3498('0x36'),_0x2febe7,_0x3498('0x37')))},function(_0x3b1aee){if(_0x3b1aee)throw _0x3b1aee;return;});})['then'](function(){if(!_0x37a9b9)return;rimraf(path[_0x3498('0x26')](_0x2d19c1,_0x2febe7),function(){});})[_0x3498('0x2c')](function(){logger[_0x3498('0x38')](util[_0x3498('0x15')](_0x3498('0x39'),EXTRACTED_REPORT_ID,_0x3498('0x3a')));return analyticExtractedReport(_0x3498('0x3b'),_0x37a9b9?util[_0x3498('0x15')](_0x3498('0x36'),_0x2febe7,_0x37a9b9?_0x3498('0x37'):_0x3498('0x27')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3498('0x38')](util['format'](_0x3498('0x3c'),EXTRACTED_REPORT_ID,_0x3498('0x3d')));return db[_0x3498('0x3e')][_0x3498('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x50b018){EXTRACTED_REPORT=_0x50b018;return dbH['sequelize'][_0x3498('0x32')](util[_0x3498('0x15')](_0x3498('0x40'),QUERY),{'type':dbH[_0x3498('0x2e')]['QueryTypes'][_0x3498('0x31')]});})[_0x3498('0x2c')](extractReport)[_0x3498('0x41')](function(_0x579c0a){logger[_0x3498('0x38')](util[_0x3498('0x15')](_0x3498('0x42'),EXTRACTED_REPORT_ID,_0x3498('0x3d')),util['inspect'](_0x579c0a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3498('0x43'));})['finally'](function(){process[_0x3498('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x524fe6=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x3498('0x45'),'italics':__dirname+_0x3498('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x524fe6;}function getPDFDocDefinitionFromHTML(_0x3d65b7,_0x2e532c){var _0x270e12=util[_0x3498('0x15')](_0x3498('0x47'),_0x2e532c['channel'],_0x2e532c[_0x3498('0x48')]);var _0x18d73d=moment()['format'](_0x3498('0x49'))[_0x3498('0x1d')]();var _0x1ecee4=htmlToPdfmake(_0x3d65b7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1ecee4],'defaultStyle':{'font':_0x3498('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3498('0x4a'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3498('0x4a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3498('0x4a')}},'header':function(){return[{'text':_0x3498('0x4b'),'style':_0x3498('0x18')}];},'footer':function(_0x16da07,_0x5b3715){return[{'text':util[_0x3498('0x15')](_0x3498('0x4c'),_0x270e12,_0x16da07,_0x5b3715,_0x18d73d),'style':_0x3498('0x4d')}];}};}function writePDFDocument(_0x42b5c9,_0x5bb731){return new Promise(function(_0x1b0132,_0x5c709b){var _0x4989d6=_0x42b5c9[_0x3498('0x4e')](fs[_0x3498('0x4f')](_0x5bb731));_0x4989d6['on'](_0x3498('0x50'),function(){_0x1b0132(_0x3498('0x50'));});_0x4989d6['on']('error',function(_0x542f4b){_0x5c709b(_0x542f4b);});_0x42b5c9['end']();});}exports[_0x3498('0x51')]=function(_0x35d868,_0x4f9642){var _0x18197e=getPDFPrinter();var _0x3998dc=getPDFDocDefinitionFromHTML(_0x35d868,_0x4f9642);var _0x49f919=_0x18197e[_0x3498('0x35')](_0x3998dc);return writePDFDocument(_0x49f919,_0x4f9642['path'])[_0x3498('0x41')](function(_0x411537){throw _0x411537;});}; \ No newline at end of file +var _0xf51f=['header','pageBreak','before','landscape','\x20/\x20','footer','black','num','Empty','basename','.pdf','join','%s.%s','pdf','Setting','find','split','then','splitSizePdf','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','QueryTypes','existsSync','mkdirSync','all','flatten','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','auto','push','body','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length'];(function(_0x3e58f2,_0xb41915){var _0x3a3169=function(_0x347112){while(--_0x347112){_0x3e58f2['push'](_0x3e58f2['shift']());}};_0x3a3169(++_0xb41915);}(_0xf51f,0x1a5));var _0xff51=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0xf51f[_0x1f7201];return _0x289fd2;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xff51('0x0'));var path=require(_0xff51('0x1'));var moment=require(_0xff51('0x2'));var htmlToPdfmake=require(_0xff51('0x3'));var PdfPrinter=require(_0xff51('0x4'));var zipdir=require(_0xff51('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0xff51('0x6'))[_0xff51('0x7')];var window=new JSDOM('')[_0xff51('0x8')];var db=require(_0xff51('0x9'))['db'];var dbH=require(_0xff51('0x9'))['dbH'];var logger=require(_0xff51('0xa'))(_0xff51('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xff51('0xc')][0x2]);var QUERY=process[_0xff51('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xff51('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5cc151,_0x2dc1c0){var _0x5ef19e={'status':_0x5cc151};var _0x4467a0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2dc1c0){_0x5ef19e['savename']=_0x2dc1c0;}return db[_0xff51('0xe')][_0xff51('0xf')](_0x5ef19e,_0x4467a0);}function getHeaders(_0x16ba39){return _[_0xff51('0x10')](_0x16ba39,function(_0x495841){return{'text':_0x495841,'style':_0xff51('0x11')};});}function getRows(_0x61dbea,_0x134b87){return _['map'](_0x134b87,function(_0x595c35){return _(_0x595c35)[_0xff51('0x12')](_0x61dbea)[_0xff51('0x10')](function(_0x546492){return _0x546492?_[_0xff51('0x13')](_0x546492):'';})[_0xff51('0x14')]();});}function createTable(_0x5e17ee,_0x214958){var _0x4a23d2={'widths':_[_0xff51('0x15')](Array(_0x5e17ee['length']),0x91),'heights':function(_0x5d1967){return _0x5d1967===0x0?_0xff51('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5629bc=getHeaders(_0x5e17ee);_0x4a23d2['body'][_0xff51('0x17')](_0x5629bc);var _0x171542=getRows(_0x5e17ee,_0x214958);_0x4a23d2['body']=_0x4a23d2[_0xff51('0x18')][_0xff51('0x19')](_0x171542);return _0x4a23d2;}function createTables(_0x3dadbf){var _0x195a35=[];var _0x5d7943=_['chunk'](Object[_0xff51('0x1a')](_0x3dadbf[0x0]),0x5);_0x5d7943[_0xff51('0x1b')](function(_0x2e0f5b){_0x195a35[_0xff51('0x17')](createTable(_0x2e0f5b,_0x3dadbf));});return _0x195a35;}function getPDFDocDefinition(_0x365784){var _0x5e0b9b=util[_0xff51('0x1c')](_0xff51('0x1d'),NAME,EXTRACTED_REPORT[_0xff51('0x1e')],moment(EXTRACTED_REPORT[_0xff51('0x1f')])[_0xff51('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0xff51('0x20')])[_0xff51('0x1c')](FORMAT));var _0x324ef3=[];for(var _0x94c82f=0x0;_0x94c82f<_0x365784[_0xff51('0x21')];_0x94c82f++){var _0x525aea=[];if(_0x94c82f===0x0){_0x525aea[_0xff51('0x17')]({'text':_0x5e0b9b,'style':_0xff51('0x22')});}var _0x3d44b7={'table':_0x365784[_0x94c82f]};if(_0x94c82f>0x0){_0x3d44b7[_0xff51('0x23')]=_0xff51('0x24');_0x3d44b7['margin']=[0x0,0x46,0x0,0x0];}_0x525aea['push'](_0x3d44b7);_0x324ef3['push'](_0x525aea);}return{'pageSize':'A4','pageOrientation':_0xff51('0x25'),'content':_0x324ef3,'footer':function(_0xccdff9,_0xd5d093){return{'text':_0xccdff9[_0xff51('0x13')]()+_0xff51('0x26')+_0xd5d093,'style':_0xff51('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xff51('0x28')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1e66d4){var _0x2cb8f8=0x1388;var _0xc40fa5;if(!_0x1e66d4[0x0][_0xff51('0x29')]){return analyticExtractedReport(_0xff51('0x2a'));}var _0x590f69=[];var _0x3befd6=0x0;var _0x12e530=!![];var _0x12b1b5=path['dirname'](PATH);var _0x5028b4=path[_0xff51('0x2b')](PATH,_0xff51('0x2c'));var _0x41adcc=path[_0xff51('0x2d')](_0x12b1b5,util[_0xff51('0x1c')](_0xff51('0x2e'),_0x5028b4,_0xff51('0x2f')));var _0x34de66=![];return db[_0xff51('0x30')][_0xff51('0x31')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xff51('0x32'),'splitSizePdf']})[_0xff51('0x33')](function(_0x1218e1){if(_0x1218e1){_0xc40fa5=_0x1218e1;_0x2cb8f8=_0xc40fa5[_0xff51('0x34')]||0x3e8;}})[_0xff51('0x33')](function(){if(_0x1e66d4&&_0x1e66d4['length']){var _0x5b051c=_0x1e66d4[0x0][_0xff51('0x29')]%(_0x3befd6+_0x2cb8f8);if(_0xc40fa5[_0xff51('0x32')]){for(;_0x12e530;_0x3befd6+=_0x2cb8f8,_0x5b051c=_0x1e66d4[0x0][_0xff51('0x29')]%(_0x3befd6+_0x2cb8f8)){if(_0x5b051c==0x0||_0x5b051c==_0x1e66d4[0x0]['num']){_0x12e530=![];}_0x590f69[_0xff51('0x17')](dbH['sequelize'][_0xff51('0x35')](util[_0xff51('0x1c')](_0xff51('0x36'),QUERY,_0x2cb8f8,_0x3befd6),{'type':dbH[_0xff51('0x37')]['QueryTypes'][_0xff51('0x38')]}));}}else{_0x590f69['push'](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0xff51('0x39')][_0xff51('0x38')]}));}}_0x34de66=_0xc40fa5[_0xff51('0x32')]&&_0x590f69['length']>0x1;if(!fs[_0xff51('0x3a')](path[_0xff51('0x2d')](_0x12b1b5,_0x5028b4))&&_0x34de66){fs[_0xff51('0x3b')](path[_0xff51('0x2d')](_0x12b1b5,_0x5028b4));}return Promise[_0xff51('0x3c')](_0x590f69);})['then'](function(_0x17d18f){return createTables(_[_0xff51('0x3d')](_0x17d18f));})[_0xff51('0x33')](function(_0xae840b){var _0x4309ce=getPDFDocDefinition(_0xae840b);var _0x533967=getPDFPrinter();var _0x5b1f7a=_0x533967['createPdfKitDocument'](_0x4309ce);if(_0x34de66)_0x41adcc=path[_0xff51('0x2d')](_0x12b1b5,_0x5028b4,util[_0xff51('0x1c')]('%s%d.%s',_0x5028b4,index,_0xff51('0x2f')));return writePDFDocument(_0x5b1f7a,_0x41adcc);})[_0xff51('0x33')](function(){if(!_0x34de66)return;zipdir(path[_0xff51('0x2d')](_0x12b1b5,_0x5028b4),{'saveTo':path[_0xff51('0x2d')](_0x12b1b5,util[_0xff51('0x1c')](_0xff51('0x2e'),_0x5028b4,_0xff51('0x3e')))},function(_0x41a40f){if(_0x41a40f)throw _0x41a40f;return;});})[_0xff51('0x33')](function(){if(!_0x34de66)return;rimraf(path['join'](_0x12b1b5,_0x5028b4),function(){});})['then'](function(){logger[_0xff51('0x3f')](util[_0xff51('0x1c')](_0xff51('0x40'),EXTRACTED_REPORT_ID,_0xff51('0x41')));return analyticExtractedReport(_0xff51('0x42'),_0x34de66?util['format'](_0xff51('0x2e'),_0x5028b4,_0x34de66?'zip':'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xff51('0x3f')](util[_0xff51('0x1c')](_0xff51('0x43'),EXTRACTED_REPORT_ID,_0xff51('0x44')));return db[_0xff51('0xe')][_0xff51('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4dc575){EXTRACTED_REPORT=_0x4dc575;return dbH[_0xff51('0x37')]['query'](util[_0xff51('0x1c')](_0xff51('0x46'),QUERY),{'type':dbH[_0xff51('0x37')]['QueryTypes'][_0xff51('0x38')]});})[_0xff51('0x33')](extractReport)[_0xff51('0x47')](function(_0x232e08){logger[_0xff51('0x3f')](util[_0xff51('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xff51('0x44')),util[_0xff51('0x48')](_0x232e08,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xff51('0x49')](function(){process[_0xff51('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x40a20d=new PdfPrinter({'Arial':{'normal':__dirname+_0xff51('0x4b'),'bold':__dirname+_0xff51('0x4c'),'italics':__dirname+_0xff51('0x4d'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x40a20d;}function getPDFDocDefinitionFromHTML(_0x41fc16,_0x51dcbd){var _0x1014c7=util[_0xff51('0x1c')](_0xff51('0x4e'),_0x51dcbd[_0xff51('0x4f')],_0x51dcbd[_0xff51('0x50')]);var _0x2748ff=moment()[_0xff51('0x1c')](_0xff51('0x51'))[_0xff51('0x13')]();var _0x5df6fb=htmlToPdfmake(_0x41fc16,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5df6fb],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xff51('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xff51('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xff51('0x52')}},'header':function(){return[{'text':_0xff51('0x53'),'style':_0xff51('0x22')}];},'footer':function(_0x58685e,_0x4f155d){return[{'text':util[_0xff51('0x1c')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1014c7,_0x58685e,_0x4f155d,_0x2748ff),'style':'footer'}];}};}function writePDFDocument(_0x1afd03,_0x51fd2b){return new Promise(function(_0x5ff0c9,_0x3661dd){var _0x345ba9=_0x1afd03[_0xff51('0x54')](fs[_0xff51('0x55')](_0x51fd2b));_0x345ba9['on'](_0xff51('0x56'),function(){_0x5ff0c9(_0xff51('0x56'));});_0x345ba9['on'](_0xff51('0x57'),function(_0x528e82){_0x3661dd(_0x528e82);});_0x1afd03[_0xff51('0x58')]();});}exports[_0xff51('0x59')]=function(_0x2a44fe,_0x439652){var _0x2c9d09=getPDFPrinter();var _0x2df071=getPDFDocDefinitionFromHTML(_0x2a44fe,_0x439652);var _0x3659e7=_0x2c9d09[_0xff51('0x5a')](_0x2df071);return writePDFDocument(_0x3659e7,_0x439652['path'])[_0xff51('0x47')](function(_0x585aea){throw _0x585aea;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 20967cd..0fa9beb 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 _0x8b0f=['zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s'];(function(_0x36dcde,_0x1e92cb){var _0x24c3b9=function(_0x44697e){while(--_0x44697e){_0x36dcde['push'](_0x36dcde['shift']());}};_0x24c3b9(++_0x1e92cb);}(_0x8b0f,0xcd));var _0xf8b0=function(_0x9a5fd5,_0x1e2c7a){_0x9a5fd5=_0x9a5fd5-0x0;var _0x2bba88=_0x8b0f[_0x9a5fd5];return _0x2bba88;};'use strict';var util=require('util');var path=require(_0xf8b0('0x0'));var _=require(_0xf8b0('0x1'));var fs=require('fs');var json2xls=require(_0xf8b0('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xf8b0('0x3'));var db=require(_0xf8b0('0x4'))['db'];var dbH=require('../../mysqldb')[_0xf8b0('0x5')];var logger=require(_0xf8b0('0x6'))(_0xf8b0('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xf8b0('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x43e60b,_0x490f55){var _0x178b82={'status':_0x43e60b};var _0x574fbe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x490f55){_0x178b82['savename']=_0x490f55;}return db[_0xf8b0('0x9')]['update'](_0x178b82,_0x574fbe);}function main(){var _0x5eee33=0x1388;var _0x1b4a11;logger[_0xf8b0('0xa')](util[_0xf8b0('0xb')](_0xf8b0('0xc'),EXTRACTED_REPORT_ID,_0xf8b0('0xd')));return db[_0xf8b0('0xe')][_0xf8b0('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf8b0('0x10'),_0xf8b0('0x11')]})[_0xf8b0('0x12')](function(_0x540c83){if(_0x540c83){_0x1b4a11=_0x540c83;_0x5eee33=_0x1b4a11[_0xf8b0('0x11')]||0x1388;}})[_0xf8b0('0x12')](function(){return dbH[_0xf8b0('0x13')][_0xf8b0('0x14')](util[_0xf8b0('0xb')](_0xf8b0('0x15'),QUERY),{'type':dbH[_0xf8b0('0x13')][_0xf8b0('0x16')]['SELECT']});})[_0xf8b0('0x12')](function(_0xc26787){if(!_0xc26787[0x0]['num']){return analyticExtractedReport(_0xf8b0('0x17'));}var _0x245065=[];var _0xbb3e33=0x0;var _0x30341e=!![];if(_0x1b4a11[_0xf8b0('0x10')]){if(_0xc26787&&_0xc26787[_0xf8b0('0x18')]){var _0x252435=_0xc26787[0x0]['num']%(_0xbb3e33+_0x5eee33);for(;_0x30341e;_0xbb3e33+=_0x5eee33,_0x252435=_0xc26787[0x0][_0xf8b0('0x19')]%(_0xbb3e33+_0x5eee33)){if(_0x252435==0x0||_0x252435==_0xc26787[0x0][_0xf8b0('0x19')]){_0x30341e=![];}_0x245065['push'](dbH[_0xf8b0('0x13')][_0xf8b0('0x14')](util[_0xf8b0('0xb')](_0xf8b0('0x1a'),QUERY,_0x5eee33,_0xbb3e33),{'type':dbH[_0xf8b0('0x13')][_0xf8b0('0x16')]['SELECT']}));}}}else{_0x245065[_0xf8b0('0x1b')](dbH[_0xf8b0('0x13')][_0xf8b0('0x14')](QUERY,{'type':dbH['sequelize'][_0xf8b0('0x16')][_0xf8b0('0x1c')]}));}var _0x5b274f=path[_0xf8b0('0x1d')](PATH);var _0x5ae90f=path[_0xf8b0('0x1e')](PATH,_0xf8b0('0x1f'));var _0x1c5a35=_0x1b4a11[_0xf8b0('0x10')]&&_0x245065[_0xf8b0('0x18')]>0x1;var _0xb3e304=[];if(!fs[_0xf8b0('0x20')](path['join'](_0x5b274f,_0x5ae90f))&&_0x1c5a35){fs['mkdirSync'](path[_0xf8b0('0x21')](_0x5b274f,_0x5ae90f));}return BPromise[_0xf8b0('0x22')](_0x245065,function(_0x5a3046){_0xb3e304['push'](_0x5a3046);})[_0xf8b0('0x12')](function(){for(var _0x183543=0x0;_0x183543<_0xb3e304[_0xf8b0('0x18')];_0x183543+=0x1){var _0x303423;var _0x47fb4f=_0xb3e304[_0x183543];if(_0x1c5a35){_0x303423=path['join'](_0x5b274f,_0x5ae90f,util['format'](_0xf8b0('0x23'),_0x5ae90f,_0x183543,_0xf8b0('0x24')));}else{_0x303423=path[_0xf8b0('0x21')](_0x5b274f,util[_0xf8b0('0xb')]('%s.%s',_0x5ae90f,_0xf8b0('0x24')));}fs[_0xf8b0('0x25')](_0x303423,json2xls(_0x47fb4f),_0xf8b0('0x26'));}})[_0xf8b0('0x12')](function(){if(_0x1c5a35){zipdir(path[_0xf8b0('0x21')](_0x5b274f,_0x5ae90f),{'saveTo':path[_0xf8b0('0x21')](_0x5b274f,util[_0xf8b0('0xb')](_0xf8b0('0x27'),_0x5ae90f,_0xf8b0('0x28')))},function(_0x5951a9,_0x4ff3da){});rimraf(path[_0xf8b0('0x21')](_0x5b274f,_0x5ae90f),function(){});}})['then'](function(){logger['info'](util[_0xf8b0('0xb')](_0xf8b0('0x29'),EXTRACTED_REPORT_ID,_0xf8b0('0xd')));return analyticExtractedReport(_0xf8b0('0x2a'),_0x1c5a35?util['format'](_0xf8b0('0x27'),_0x5ae90f,_0x1c5a35?_0xf8b0('0x28'):_0xf8b0('0x24')):null);});})[_0xf8b0('0x2b')](function(_0x3f77c){logger[_0xf8b0('0xa')](util[_0xf8b0('0xb')](_0xf8b0('0x2c'),EXTRACTED_REPORT_ID,_0xf8b0('0xd')),util[_0xf8b0('0x2d')](_0x3f77c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf8b0('0x2e'));})[_0xf8b0('0x2f')](function(){process[_0xf8b0('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x142a=['dirname','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','split','length','push'];(function(_0x50b62b,_0xeb3d67){var _0x4cc02c=function(_0x2f008a){while(--_0x2f008a){_0x50b62b['push'](_0x50b62b['shift']());}};_0x4cc02c(++_0xeb3d67);}(_0x142a,0xf7));var _0xa142=function(_0x4c70cf,_0x35abf8){_0x4c70cf=_0x4c70cf-0x0;var _0x2fa4f4=_0x142a[_0x4c70cf];return _0x2fa4f4;};'use strict';var util=require(_0xa142('0x0'));var path=require('path');var _=require(_0xa142('0x1'));var fs=require('fs');var json2xls=require(_0xa142('0x2'));var BPromise=require(_0xa142('0x3'));var zipdir=require(_0xa142('0x4'));var rimraf=require(_0xa142('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa142('0x6'))[_0xa142('0x7')];var logger=require(_0xa142('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa142('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2d5428,_0x45a5c9){var _0x5bc57d={'status':_0x2d5428};var _0x26abdd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45a5c9){_0x5bc57d[_0xa142('0xa')]=_0x45a5c9;}return db[_0xa142('0xb')][_0xa142('0xc')](_0x5bc57d,_0x26abdd);}function main(){var _0x11e4f1=0x1388;var _0x10e0a7;logger[_0xa142('0xd')](util[_0xa142('0xe')](_0xa142('0xf'),EXTRACTED_REPORT_ID,_0xa142('0x10')));return db[_0xa142('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xa142('0x12')](function(_0x34b788){if(_0x34b788){_0x10e0a7=_0x34b788;_0x11e4f1=_0x10e0a7[_0xa142('0x13')]||0x1388;}})[_0xa142('0x12')](function(){return dbH[_0xa142('0x14')][_0xa142('0x15')](util[_0xa142('0xe')](_0xa142('0x16'),QUERY),{'type':dbH[_0xa142('0x14')][_0xa142('0x17')][_0xa142('0x18')]});})[_0xa142('0x12')](function(_0x5e997f){if(!_0x5e997f[0x0][_0xa142('0x19')]){return analyticExtractedReport('Empty');}var _0x3e53c2=[];var _0x91b7f7=0x0;var _0x5bcfe8=!![];if(_0x10e0a7[_0xa142('0x1a')]){if(_0x5e997f&&_0x5e997f[_0xa142('0x1b')]){var _0x2174cf=_0x5e997f[0x0][_0xa142('0x19')]%(_0x91b7f7+_0x11e4f1);for(;_0x5bcfe8;_0x91b7f7+=_0x11e4f1,_0x2174cf=_0x5e997f[0x0][_0xa142('0x19')]%(_0x91b7f7+_0x11e4f1)){if(_0x2174cf==0x0||_0x2174cf==_0x5e997f[0x0]['num']){_0x5bcfe8=![];}_0x3e53c2[_0xa142('0x1c')](dbH[_0xa142('0x14')][_0xa142('0x15')](util[_0xa142('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x11e4f1,_0x91b7f7),{'type':dbH['sequelize'][_0xa142('0x17')][_0xa142('0x18')]}));}}}else{_0x3e53c2['push'](dbH[_0xa142('0x14')]['query'](QUERY,{'type':dbH[_0xa142('0x14')][_0xa142('0x17')][_0xa142('0x18')]}));}var _0x2fa479=path[_0xa142('0x1d')](PATH);var _0x3a4f09=path['basename'](PATH,_0xa142('0x1e'));var _0x4cea85=_0x10e0a7['split']&&_0x3e53c2[_0xa142('0x1b')]>0x1;var _0x3883f3=[];if(!fs[_0xa142('0x1f')](path['join'](_0x2fa479,_0x3a4f09))&&_0x4cea85){fs[_0xa142('0x20')](path[_0xa142('0x21')](_0x2fa479,_0x3a4f09));}return BPromise[_0xa142('0x22')](_0x3e53c2,function(_0x310100){_0x3883f3[_0xa142('0x1c')](_0x310100);})['then'](function(){for(var _0x472fc4=0x0;_0x472fc4<_0x3883f3[_0xa142('0x1b')];_0x472fc4+=0x1){var _0x3a5295;var _0x27a232=_0x3883f3[_0x472fc4];if(_0x4cea85){_0x3a5295=path[_0xa142('0x21')](_0x2fa479,_0x3a4f09,util[_0xa142('0xe')](_0xa142('0x23'),_0x3a4f09,_0x472fc4,_0xa142('0x24')));}else{_0x3a5295=path[_0xa142('0x21')](_0x2fa479,util[_0xa142('0xe')](_0xa142('0x25'),_0x3a4f09,_0xa142('0x24')));}fs[_0xa142('0x26')](_0x3a5295,json2xls(_0x27a232),'binary');}})[_0xa142('0x12')](function(){if(_0x4cea85){zipdir(path[_0xa142('0x21')](_0x2fa479,_0x3a4f09),{'saveTo':path[_0xa142('0x21')](_0x2fa479,util['format']('%s.%s',_0x3a4f09,_0xa142('0x27')))},function(_0x5e1ccd,_0x259a54){});rimraf(path['join'](_0x2fa479,_0x3a4f09),function(){});}})['then'](function(){logger[_0xa142('0xd')](util[_0xa142('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa142('0x10')));return analyticExtractedReport(_0xa142('0x28'),_0x4cea85?util[_0xa142('0xe')](_0xa142('0x25'),_0x3a4f09,_0x4cea85?_0xa142('0x27'):_0xa142('0x24')):null);});})[_0xa142('0x29')](function(_0x50e9b6){logger[_0xa142('0xd')](util[_0xa142('0xe')](_0xa142('0x2a'),EXTRACTED_REPORT_ID,_0xa142('0x10')),util[_0xa142('0x2b')](_0x50e9b6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa142('0x2c'));})[_0xa142('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 91a8b32..029dbbc 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 _0x2107=['VoiceExtension','filter','groupBy','exten','queue','hasOwnProperty','priority','extensions','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','tag','CDR(tag)=','callerID','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','Hangup','transaction','destroy','sortBy','catch','error','util','models','Interval','findAll','intervals','IntervalId','then'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2107,0x7b));var _0x7210=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x2107[_0xbeb808];return _0x5d6909;};'use strict';var _=require('lodash');var util=require(_0x7210('0x0'));function rewrite(_0x550b4f,_0x2ce526){var _0x142588=this;return _0x550b4f[_0x7210('0x1')][_0x7210('0x2')][_0x7210('0x3')]({'raw':!![]})['then'](function(_0x3fdda7){_0x142588[_0x7210('0x4')]=_0x3fdda7;return _0x550b4f[_0x7210('0x1')]['VoiceExtension'][_0x7210('0x3')]({'where':{'IntervalId':_0x2ce526[_0x7210('0x5')]},'raw':!![]});})[_0x7210('0x6')](function(_0x79589e){return _0x550b4f[_0x7210('0x1')][_0x7210('0x7')][_0x7210('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x79589e,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7210('0x6')](function(_0x166bd4){var _0x1be17a=_[_0x7210('0x8')](_0x166bd4,{'priority':'1'});var _0x3ec2d6=_[_0x7210('0x8')](_0x166bd4,{'isApp':0x1});var _0x31e443=_[_0x7210('0x9')](_0x3ec2d6,_0x7210('0xa'));var _0x2ce0f4=[_0x7210('0xb'),'playback'];var _0x4b0259=[];var _0x1fbcfe=[];for(var _0x1219b3 in _0x31e443){if(_0x31e443[_0x7210('0xc')](_0x1219b3)){_0x142588[_0x7210('0xd')]=0x2;_0x142588[_0x7210('0xe')]=[];_0x142588['extension']=_[_0x7210('0xf')](_0x1be17a,{'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')]});_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':_0x7210('0x11'),'appdata':util[_0x7210('0x12')](_0x7210('0x13'),_0x31e443[_0x1219b3][0x0][_0x7210('0x14')]),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});if(_0x31e443[_0x1219b3][0x0][_0x7210('0x14')]===_0x7210('0x17')){if(_0x142588[_0x7210('0x18')]){_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x19')+(_0x142588['extension'][_0x7210('0x1a')]?_0x7210('0x1b')+_0x142588[_0x7210('0x18')]['cutdigits']+'}':_0x7210('0x1c')),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});}_0x142588['extensions'][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':'CDR(routeid)='+_0x31e443[_0x1219b3][0x0]['VoiceExtensionId'],'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});var _0x100f97=_0x142588[_0x7210('0xd')]++;_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':_0x7210('0x1e')+(_0x100f97+0x2)+'):Goto('+(_0x100f97+0x1)+')','context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x100f97,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});if(_0x142588['extension']){_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x142588[_0x7210('0x18')][_0x7210('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x142588[_0x7210('0x18')][_0x7210('0x1a')]+'}':_0x7210('0x1f'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});}_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':_0x7210('0x11'),'appdata':'outboundrouteid='+_0x31e443[_0x1219b3][0x0][_0x7210('0x16')],'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});if(_0x142588[_0x7210('0x18')]&&_0x142588[_0x7210('0x18')][_0x7210('0xc')](_0x7210('0x20'))&&_0x142588['extension'][_0x7210('0x20')]!==_0x7210('0x21')){_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':'Set','appdata':_0x7210('0x22'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x142588[_0x7210('0xe')]['push']({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':_0x7210('0x11'),'appdata':_0x7210('0x23')+_0x142588[_0x7210('0x18')][_0x7210('0x20')]||_0x7210('0x24'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588['priority']++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});}}_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x25'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588['priority']++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x142588[_0x7210('0xe')]['push']({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x31e443[_0x1219b3][0x0]['context'],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x142588[_0x7210('0xe')]['push']({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':'Set','appdata':_0x7210('0x26'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588['priority']++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});for(var _0x311400=0x0,_0x36d5a2=0x0;_0x311400<_0x31e443[_0x1219b3][_0x7210('0x27')];_0x311400+=0x1,_0x36d5a2=0x0){var _0x558c30=_0x31e443[_0x1219b3][_0x311400];if(_0x558c30['type']){_0x558c30[_0x7210('0x14')]=_0x558c30[_0x7210('0x14')][_0x7210('0x28')]();}var _0x53836e=[];var _0x3bd31d=[];delete _0x558c30['id'];delete _0x558c30[_0x7210('0x29')];delete _0x558c30[_0x7210('0x2a')];var _0x3e6a98=_0x558c30['interval']!==_0x7210('0x2b')?[_0x558c30['interval']]:_0x558c30[_0x7210('0x5')]?_['map'](_[_0x7210('0x8')](_0x142588[_0x7210('0x4')],{'IntervalId':_0x558c30[_0x7210('0x5')]}),'interval'):[];if(_0x558c30['hasOwnProperty'](_0x7210('0x2c'))){if(_0x558c30['tag']&&_0x558c30[_0x7210('0x2c')]!=='--'){_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x2d')+_0x558c30[_0x7210('0x2c')],'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30['exten'],'priority':_0x3e6a98['length']+_0x142588[_0x7210('0xd')]+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}}if(_0x558c30[_0x7210('0x14')]===_0x7210('0x17')&&_0x558c30[_0x7210('0xc')]('callerID')){if(_0x558c30['callerID']){_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x558c30[_0x7210('0x2e')]+')','context':_0x558c30['context'],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}else{_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30['exten'],'priority':_0x3e6a98['length']+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}}if(_0x558c30[_0x7210('0xc')](_0x7210('0x2f'))){if(_0x2ce0f4[_0x7210('0x30')](_0x558c30[_0x7210('0x31')]['toLowerCase']())>=0x0&&_0x558c30['appType']!==_0x7210('0x32')){if(_0x558c30[_0x7210('0x2f')]){_0x53836e['push']({'type':_0x558c30['type'],'app':'ExecIf','appdata':_0x7210('0x33'),'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x34'),'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588[_0x7210('0xd')]+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}else{_0x53836e['push']({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':_0x7210('0x35'),'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588[_0x7210('0xd')]+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x36'),'context':_0x558c30['context'],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98['length']+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30['VoiceExtensionId']});}}}for(var _0x2fb998=0x0;_0x2fb998<_0x3e6a98['length'];_0x2fb998+=0x1){var _0x4af69c=_0x142588[_0x7210('0xd')]+_0x3e6a98[_0x7210('0x27')];var _0x5123c1=_0x2fb998===_0x3e6a98['length']-0x1?_0x142588[_0x7210('0xd')]+_0x53836e[_0x7210('0x27')]+_0x3bd31d[_0x7210('0x27')]+0x2:_0x142588[_0x7210('0xd')]+_0x2fb998+0x1;_0x53836e[_0x7210('0x37')](_0x2fb998,0x0,{'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x38'),'appdata':_0x3e6a98[_0x2fb998]+'?'+_0x558c30[_0x7210('0x15')]+_0x7210('0x39')+_0x4af69c+':'+_0x558c30['context']+_0x7210('0x39')+_0x5123c1,'exten':_0x558c30[_0x7210('0xa')],'context':_0x558c30[_0x7210('0x15')],'priority':_0x142588[_0x7210('0xd')]+_0x2fb998,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0]['VoiceExtensionId']});}_0x558c30[_0x7210('0xd')]=_0x53836e[_0x7210('0x27')]?_['last'](_0x53836e)['priority']+0x1:_0x142588['priority'];_0x142588['priority']=(_0x3bd31d[_0x7210('0x27')]?_['last'](_0x3bd31d)[_0x7210('0xd')]:_0x558c30[_0x7210('0xd')])+0x1;_0x142588[_0x7210('0xe')]=_[_0x7210('0x3a')](_0x142588['extensions'],_0x53836e,[_0x558c30],_0x3bd31d);}_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x3b'),'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'context':_0x31e443[_0x1219b3][0x0]['context'],'priority':_0x142588[_0x7210('0xd')],'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x4b0259[_0x7210('0x10')](_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]);_0x1fbcfe=_['concat'](_0x1fbcfe,_0x142588['extensions']);}}return _0x550b4f[_0x7210('0x3c')](function(_0x17382c){return _0x550b4f[_0x7210('0x1')][_0x7210('0x7')][_0x7210('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x4b0259}},'transaction':_0x17382c})['then'](function(_0x38e305){return _0x550b4f[_0x7210('0x1')][_0x7210('0x7')]['bulkCreate'](_[_0x7210('0x3e')](_0x1fbcfe,_0x7210('0xd')),{'transaction':_0x17382c});});});})[_0x7210('0x3f')](function(_0x28961e){console[_0x7210('0x40')](_0x28961e);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xae07=['CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','Set','CDR(type)=%s','type','context','VoiceExtensionId','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag'];(function(_0x330c1a,_0x4c9cb9){var _0x1972a2=function(_0x84fea0){while(--_0x84fea0){_0x330c1a['push'](_0x330c1a['shift']());}};_0x1972a2(++_0x4c9cb9);}(_0xae07,0xa0));var _0x7ae0=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xae07[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x7ae0('0x0'));var util=require(_0x7ae0('0x1'));function rewrite(_0x9cab62,_0x1dc421){var _0xfcd399=this;return _0x9cab62[_0x7ae0('0x2')]['Interval'][_0x7ae0('0x3')]({'raw':!![]})[_0x7ae0('0x4')](function(_0xf1c70e){_0xfcd399[_0x7ae0('0x5')]=_0xf1c70e;return _0x9cab62[_0x7ae0('0x2')][_0x7ae0('0x6')][_0x7ae0('0x3')]({'where':{'IntervalId':_0x1dc421[_0x7ae0('0x7')]},'raw':!![]});})[_0x7ae0('0x4')](function(_0x271fab){return _0x9cab62[_0x7ae0('0x2')][_0x7ae0('0x6')][_0x7ae0('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x7ae0('0x8')](_0x271fab,_0x7ae0('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7ae0('0x4')](function(_0x1cb1c9){var _0x651c86=_[_0x7ae0('0xa')](_0x1cb1c9,{'priority':'1'});var _0x136bba=_['filter'](_0x1cb1c9,{'isApp':0x1});var _0xb51887=_[_0x7ae0('0xb')](_0x136bba,_0x7ae0('0x9'));var _0x13e434=[_0x7ae0('0xc'),_0x7ae0('0xd')];var _0x50e655=[];var _0xc5973d=[];for(var _0x3da1d2 in _0xb51887){if(_0xb51887[_0x7ae0('0xe')](_0x3da1d2)){_0xfcd399[_0x7ae0('0xf')]=0x2;_0xfcd399[_0x7ae0('0x10')]=[];_0xfcd399[_0x7ae0('0x11')]=_[_0x7ae0('0x12')](_0x651c86,{'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')]});_0xfcd399[_0x7ae0('0x10')]['push']({'type':_0xb51887[_0x3da1d2][0x0]['type'],'app':_0x7ae0('0x13'),'appdata':util['format'](_0x7ae0('0x14'),_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')]),'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});if(_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')]==='outbound'){if(_0xfcd399['extension']){_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x19')+(_0xfcd399['extension'][_0x7ae0('0x1a')]?_0x7ae0('0x1b')+_0xfcd399[_0x7ae0('0x11')][_0x7ae0('0x1a')]+'}':_0x7ae0('0x1c')),'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0]['VoiceExtensionId']});}_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0]['type'],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x1d')+_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')],'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0]['VoiceExtensionId']});var _0x4f2060=_0xfcd399[_0x7ae0('0xf')]++;_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x1e'),'appdata':_0x7ae0('0x1f')+(_0x4f2060+0x2)+_0x7ae0('0x20')+(_0x4f2060+0x1)+')','context':_0xb51887[_0x3da1d2][0x0]['context'],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0x4f2060,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});if(_0xfcd399['extension']){_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0]['type'],'app':'Set','appdata':_0xfcd399[_0x7ae0('0x11')][_0x7ae0('0x1a')]?_0x7ae0('0x21')+_0xfcd399[_0x7ae0('0x11')][_0x7ae0('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});}_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x22')+_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')],'context':_0xb51887[_0x3da1d2][0x0]['context'],'exten':_0xb51887[_0x3da1d2][0x0]['exten'],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});if(_0xfcd399['extension']&&_0xfcd399[_0x7ae0('0x11')]['hasOwnProperty']('recordingFormat')&&_0xfcd399['extension'][_0x7ae0('0x23')]!=='none'){_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':'Set','appdata':_0x7ae0('0x24')+_0xfcd399[_0x7ae0('0x11')][_0x7ae0('0x23')]||_0x7ae0('0x25'),'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});}}_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x26'),'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0]['VoiceExtensionId']});_0xfcd399['extensions'][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x27'),'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});_0xfcd399[_0x7ae0('0x10')][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x28'),'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'exten':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x9')],'priority':_0xfcd399[_0x7ae0('0xf')]++,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});for(var _0x6b92ab=0x0,_0x124825=0x0;_0x6b92ab<_0xb51887[_0x3da1d2][_0x7ae0('0x29')];_0x6b92ab+=0x1,_0x124825=0x0){var _0x19981b=_0xb51887[_0x3da1d2][_0x6b92ab];if(_0x19981b['type']){_0x19981b[_0x7ae0('0x15')]=_0x19981b[_0x7ae0('0x15')][_0x7ae0('0x2a')]();}var _0x3ca10f=[];var _0x46f8d7=[];delete _0x19981b['id'];delete _0x19981b['createdAt'];delete _0x19981b[_0x7ae0('0x2b')];var _0x565629=_0x19981b[_0x7ae0('0x2c')]!==_0x7ae0('0x2d')?[_0x19981b[_0x7ae0('0x2c')]]:_0x19981b['IntervalId']?_[_0x7ae0('0x8')](_[_0x7ae0('0xa')](_0xfcd399[_0x7ae0('0x5')],{'IntervalId':_0x19981b[_0x7ae0('0x7')]}),_0x7ae0('0x2c')):[];if(_0x19981b[_0x7ae0('0xe')]('tag')){if(_0x19981b[_0x7ae0('0x2e')]&&_0x19981b[_0x7ae0('0x2e')]!=='--'){_0x3ca10f[_0x7ae0('0x18')]({'type':_0x19981b['type'],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x2f')+_0x19981b['tag'],'context':_0x19981b['context'],'exten':_0x19981b[_0x7ae0('0x9')],'priority':_0x565629[_0x7ae0('0x29')]+_0xfcd399[_0x7ae0('0xf')]+_0x124825++,'VoiceExtensionId':_0x19981b[_0x7ae0('0x17')]});}}if(_0x19981b[_0x7ae0('0x15')]==='outbound'&&_0x19981b[_0x7ae0('0xe')](_0x7ae0('0x30'))){if(_0x19981b[_0x7ae0('0x30')]){_0x3ca10f[_0x7ae0('0x18')]({'type':_0x19981b[_0x7ae0('0x15')],'app':'ExecIf','appdata':_0x7ae0('0x31')+_0x19981b[_0x7ae0('0x30')]+')','context':_0x19981b[_0x7ae0('0x16')],'exten':_0x19981b[_0x7ae0('0x9')],'priority':_0x565629[_0x7ae0('0x29')]+_0xfcd399[_0x7ae0('0xf')]+_0x124825++,'VoiceExtensionId':_0x19981b[_0x7ae0('0x17')]});}else{_0x3ca10f['push']({'type':_0x19981b[_0x7ae0('0x15')],'app':_0x7ae0('0x1e'),'appdata':_0x7ae0('0x32'),'context':_0x19981b[_0x7ae0('0x16')],'exten':_0x19981b[_0x7ae0('0x9')],'priority':_0x565629[_0x7ae0('0x29')]+_0xfcd399[_0x7ae0('0xf')]+_0x124825++,'VoiceExtensionId':_0x19981b[_0x7ae0('0x17')]});}}if(_0x19981b[_0x7ae0('0xe')](_0x7ae0('0x33'))){if(_0x13e434['indexOf'](_0x19981b[_0x7ae0('0x34')][_0x7ae0('0x2a')]())>=0x0&&_0x19981b['appType']!==_0x7ae0('0x35')){if(_0x19981b[_0x7ae0('0x33')]){_0x3ca10f[_0x7ae0('0x18')]({'type':_0x19981b[_0x7ae0('0x15')],'app':_0x7ae0('0x1e'),'appdata':_0x7ae0('0x36'),'context':_0x19981b['context'],'exten':_0x19981b[_0x7ae0('0x9')],'priority':_0x565629['length']+_0xfcd399[_0x7ae0('0xf')]+_0x124825++,'VoiceExtensionId':_0x19981b['VoiceExtensionId']});_0x3ca10f[_0x7ae0('0x18')]({'type':_0x19981b[_0x7ae0('0x15')],'app':_0x7ae0('0x13'),'appdata':_0x7ae0('0x37'),'context':_0x19981b[_0x7ae0('0x16')],'exten':_0x19981b[_0x7ae0('0x9')],'priority':_0x565629['length']+_0xfcd399[_0x7ae0('0xf')]+_0x124825++,'VoiceExtensionId':_0x19981b['VoiceExtensionId']});}else{_0x3ca10f[_0x7ae0('0x18')]({'type':_0x19981b[_0x7ae0('0x15')],'app':_0x7ae0('0x1e'),'appdata':_0x7ae0('0x38'),'context':_0x19981b[_0x7ae0('0x16')],'exten':_0x19981b['exten'],'priority':_0x565629['length']+_0xfcd399[_0x7ae0('0xf')]+_0x124825++,'VoiceExtensionId':_0x19981b['VoiceExtensionId']});_0x3ca10f['push']({'type':_0x19981b['type'],'app':'Set','appdata':_0x7ae0('0x39'),'context':_0x19981b[_0x7ae0('0x16')],'exten':_0x19981b[_0x7ae0('0x9')],'priority':_0x565629[_0x7ae0('0x29')]+_0xfcd399[_0x7ae0('0xf')]+_0x124825++,'VoiceExtensionId':_0x19981b[_0x7ae0('0x17')]});}}}for(var _0x1e1147=0x0;_0x1e1147<_0x565629[_0x7ae0('0x29')];_0x1e1147+=0x1){var _0x34c7e6=_0xfcd399[_0x7ae0('0xf')]+_0x565629[_0x7ae0('0x29')];var _0x50d20e=_0x1e1147===_0x565629[_0x7ae0('0x29')]-0x1?_0xfcd399[_0x7ae0('0xf')]+_0x3ca10f['length']+_0x46f8d7[_0x7ae0('0x29')]+0x2:_0xfcd399['priority']+_0x1e1147+0x1;_0x3ca10f['splice'](_0x1e1147,0x0,{'type':_0x19981b[_0x7ae0('0x15')],'app':_0x7ae0('0x3a'),'appdata':_0x565629[_0x1e1147]+'?'+_0x19981b[_0x7ae0('0x16')]+_0x7ae0('0x3b')+_0x34c7e6+':'+_0x19981b[_0x7ae0('0x16')]+_0x7ae0('0x3b')+_0x50d20e,'exten':_0x19981b['exten'],'context':_0x19981b[_0x7ae0('0x16')],'priority':_0xfcd399[_0x7ae0('0xf')]+_0x1e1147,'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});}_0x19981b[_0x7ae0('0xf')]=_0x3ca10f[_0x7ae0('0x29')]?_[_0x7ae0('0x3c')](_0x3ca10f)['priority']+0x1:_0xfcd399[_0x7ae0('0xf')];_0xfcd399[_0x7ae0('0xf')]=(_0x46f8d7[_0x7ae0('0x29')]?_['last'](_0x46f8d7)[_0x7ae0('0xf')]:_0x19981b[_0x7ae0('0xf')])+0x1;_0xfcd399[_0x7ae0('0x10')]=_[_0x7ae0('0x3d')](_0xfcd399['extensions'],_0x3ca10f,[_0x19981b],_0x46f8d7);}_0xfcd399['extensions'][_0x7ae0('0x18')]({'type':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x15')],'app':_0x7ae0('0x3e'),'exten':_0xb51887[_0x3da1d2][0x0]['exten'],'context':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x16')],'priority':_0xfcd399[_0x7ae0('0xf')],'VoiceExtensionId':_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]});_0x50e655[_0x7ae0('0x18')](_0xb51887[_0x3da1d2][0x0][_0x7ae0('0x17')]);_0xc5973d=_[_0x7ae0('0x3d')](_0xc5973d,_0xfcd399['extensions']);}}return _0x9cab62[_0x7ae0('0x3f')](function(_0x56494a){return _0x9cab62[_0x7ae0('0x2')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x50e655}},'transaction':_0x56494a})[_0x7ae0('0x4')](function(_0x4d2855){return _0x9cab62[_0x7ae0('0x2')][_0x7ae0('0x6')][_0x7ae0('0x40')](_[_0x7ae0('0x41')](_0xc5973d,'priority'),{'transaction':_0x56494a});});});})[_0x7ae0('0x42')](function(_0x5ebfe5){console[_0x7ae0('0x43')](_0x5ebfe5);});}exports[_0x7ae0('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 d587fa8..147b232 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 _0xa80a=['dialCheckDuplicateType','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','catch','BlackLists','all','Campaign','CampaignId','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','squel','papaparse','ioredis','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','register','undefined','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','CmContact','keys','then','stringify','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','id\x20IN\x20?','str','VoiceQueue','findAll','outbound','CmList','Lists','get'];(function(_0x180fc6,_0x5f3c92){var _0x4dbf08=function(_0x995139){while(--_0x995139){_0x180fc6['push'](_0x180fc6['shift']());}};_0x4dbf08(++_0x5f3c92);}(_0xa80a,0x82));var _0xaa80=function(_0x19cf8b,_0x2edf53){_0x19cf8b=_0x19cf8b-0x0;var _0x14394c=_0xa80a[_0x19cf8b];return _0x14394c;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0xaa80('0x0'));var Papa=require(_0xaa80('0x1'));var Redis=require(_0xaa80('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xaa80('0x3'));var logger=require('../../../config/logger')(_0xaa80('0x4'));config[_0xaa80('0x5')]=_[_0xaa80('0x6')](config[_0xaa80('0x5')],{'host':_0xaa80('0x7'),'port':0x18eb});var socket=require(_0xaa80('0x8'))(new Redis(config[_0xaa80('0x5')]));require('../../../api/cmContact/cmContact.socket')[_0xaa80('0x9')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x2]===_0xaa80('0xc')){throw new Error(_0xaa80('0xd'));}var FILEPATH=process[_0xaa80('0xb')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x3]==='null'||!process['argv'][0x4]||process[_0xaa80('0xb')][0x4]===_0xaa80('0xa')||process['argv'][0x4]===_0xaa80('0xc')){throw new Error(_0xaa80('0xe'));}var FIELDS=_[_0xaa80('0xf')](process[_0xaa80('0xb')][0x3]['split'](','),process[_0xaa80('0xb')][0x4][_0xaa80('0x10')](','));if(!process[_0xaa80('0xb')][0x5]||process[_0xaa80('0xb')][0x5]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x5]===_0xaa80('0xc')){throw new Error(_0xaa80('0x11'));}var LISTID=process[_0xaa80('0xb')][0x5];var COMPANYID=process[_0xaa80('0xb')][0x6]&&process[_0xaa80('0xb')][0x6]!=='undefined'&&process[_0xaa80('0xb')][0x6]!==_0xaa80('0xc')?process[_0xaa80('0xb')][0x6]:null;var DUPLICATES=process[_0xaa80('0xb')][0x7]&&process[_0xaa80('0xb')][0x7]!=='undefined'&&process[_0xaa80('0xb')][0x7]!==_0xaa80('0xc')?process[_0xaa80('0xb')][0x7]:null;if(!process[_0xaa80('0xb')][0x8]||process[_0xaa80('0xb')][0x8]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x8]===_0xaa80('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xaa80('0xb')][0x8];}catch(_0xc28241){logger[_0xaa80('0x12')](_0xc28241);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(_0x5beeb5,_0x49b507,_0x567367,_0x4767c0){var _0x5ee3d4={'message':_0x49b507};_0x5ee3d4[_0x5beeb5]=!![];if(_0x567367){_0x5ee3d4[_0xaa80('0x13')]=_0x567367;}if(_0x4767c0){_0x5ee3d4['index']=_0x4767c0;}return _0x5ee3d4;}function isEmail(_0x2733fc){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))*$/[_0xaa80('0x14')](_0x2733fc);}function checkRow(_0xc8b139,_0x179057,_0xf00509){return new BPromise(function(_0x39317d,_0x118311){if(_[_0xaa80('0x15')](_0xc8b139)){return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0xaa80('0x16'),null,_0xf00509));}if(_0xc8b139['errors']&&_0xc8b139[_0xaa80('0x17')][_0xaa80('0x18')]){var _0x1d8a65=_[_0xaa80('0x19')](_0xc8b139[_0xaa80('0x17')],_0xaa80('0x1a'))[_0xaa80('0x1b')](';');return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0x1d8a65,null,_0xf00509));}var _0x4c258a={};for(var _0x1f5a79 in FIELDS){if(FIELDS[_0xaa80('0x1c')](_0x1f5a79)&&FIELDS[_0x1f5a79]){_0x4c258a[_0x1f5a79]=_0xc8b139[_0xaa80('0x1d')][0x0][FIELDS[_0x1f5a79]]||_0xc8b139[_0xaa80('0x1d')][0x0]['\ufeff'+FIELDS[_0x1f5a79]];}}if(!_0x4c258a['firstName']){return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0xaa80('0x1e'),null,_0xf00509));}if(!_0x4c258a['phone']){return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0xaa80('0x1f'),null,_0xf00509));}if(_0x4c258a[_0xaa80('0x20')]){var _0xb078fa=moment(_0x4c258a['birthDate'],_0xaa80('0x21'));if(!_0xb078fa[_0xaa80('0x22')]()){return _0x118311(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0xf00509));}}if(_0x4c258a['email']){if(!isEmail(_0x4c258a['email'])){return _0x118311(handleCheckRowError('error',_0xaa80('0x23'),null,_0xf00509));}}_0x4c258a[_0xaa80('0x24')]=LISTID;_0x4c258a[_0xaa80('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xaa80('0x18')]&&_0x179057){var _0x13d0ff={};for(var _0x429a01=0x0,_0x72dd75=DUPLICATES[_0xaa80('0x18')];_0x429a01<_0x72dd75;_0x429a01+=0x1){_0x13d0ff[DUPLICATES[_0x429a01]]=_0x4c258a[DUPLICATES[_0x429a01]];}var _0x4fa078=_['find'](_0x179057,_0x13d0ff);if(_0x4fa078){return _0x118311(handleCheckRowError(_0xaa80('0x26'),'Duplicate\x20Contact',_0x4fa078,_0xf00509));}}return db[_0xaa80('0x27')]['create'](_0x4c258a,{'raw':!![],'hooks':![],'fields':_[_0xaa80('0x28')](_0x4c258a)})[_0xaa80('0x29')](function(_0x41e624){if(DUPLICATES&&DUPLICATES[_0xaa80('0x18')]&&_0x179057){_0x179057['push'](_['pick'](_0x4c258a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x41e624['id'];return _0x39317d();})['catch'](function(_0x2dbe98){return _0x118311(handleCheckRowError(_0xaa80('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x2dbe98[_0xaa80('0x1a')]||JSON[_0xaa80('0x2a')](_0x2dbe98)),null,_0xf00509));});});}function checkHopper(){function _0x7440f1(){return function(_0x926f7){logger[_0xaa80('0x12')](_0xaa80('0x2b'),_0xaa80('0x2c'),util['inspect'](_0x926f7,{'showHidden':![],'depth':null}));};}var _0x5008df=function(_0x3987a5,_0x592b32){var _0x5a2ad7=squel[_0xaa80('0x2d')]()[_0xaa80('0x2e')](_0xaa80('0x2f'))[_0xaa80('0x30')]([_0xaa80('0x31'),_0xaa80('0x32'),_0xaa80('0x33'),_0xaa80('0x24'),_0x592b32,_0xaa80('0x34'),_0xaa80('0x35')],squel['select']()[_0xaa80('0x36')](_0xaa80('0x31'),_0xaa80('0x31'))[_0xaa80('0x36')]('NOW()','scheduledAt')[_0xaa80('0x36')]('id','ContactId')[_0xaa80('0x36')](LISTID[_0xaa80('0x37')](),_0xaa80('0x24'))[_0xaa80('0x36')](_0x3987a5['id'][_0xaa80('0x37')](),_0x592b32)[_0xaa80('0x36')](_0xaa80('0x38'),'createdAt')[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x35'))[_0xaa80('0x39')](_0xaa80('0x3a'))[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')](_0xaa80('0x3d'),LISTID['toString']())[_0xaa80('0x3b')](_0xaa80('0x3e'))[_0xaa80('0x3b')](_0xaa80('0x3f'),squel[_0xaa80('0x40')]()[_0xaa80('0x36')](_0xaa80('0x31'))[_0xaa80('0x39')](_0xaa80('0x2f'))['where'](_0x592b32+_0xaa80('0x41'),_0x3987a5['id']['toString']())))[_0xaa80('0x37')]();return _0x5a2ad7;};var _0x3bf5d2=function(_0x1d6f1e,_0x279c30){var _0x427f18=squel[_0xaa80('0x2d')]()['into'](_0xaa80('0x2f'))[_0xaa80('0x30')]([_0xaa80('0x31'),'scheduledAt','ContactId',_0xaa80('0x24'),_0x279c30,_0xaa80('0x34'),_0xaa80('0x35')],squel[_0xaa80('0x40')]()[_0xaa80('0x36')](_0xaa80('0x31'),'phone')[_0xaa80('0x36')](_0xaa80('0x38'),'scheduledAt')[_0xaa80('0x36')]('id',_0xaa80('0x33'))[_0xaa80('0x36')](LISTID['toString'](),'ListId')[_0xaa80('0x36')](_0x1d6f1e['id'][_0xaa80('0x37')](),_0x279c30)[_0xaa80('0x36')](_0xaa80('0x38'),'createdAt')['field'](_0xaa80('0x38'),_0xaa80('0x35'))[_0xaa80('0x39')]('cm_contacts')[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')](_0xaa80('0x3d'),LISTID['toString']())['where'](_0xaa80('0x42'),squel[_0xaa80('0x43')](hopperContacts))[_0xaa80('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0xaa80('0x3b')](_0xaa80('0x3f'),squel['select']()[_0xaa80('0x36')]('calleridnum')[_0xaa80('0x39')]('cm_hopper_final')[_0xaa80('0x3b')](_0x279c30+_0xaa80('0x41'),_0x1d6f1e['id']['toString']()))['where'](_0xaa80('0x3f'),squel[_0xaa80('0x40')]()['field'](_0xaa80('0x31'))[_0xaa80('0x39')]('cm_hopper')['where'](_0x279c30+_0xaa80('0x41'),_0x1d6f1e['id'][_0xaa80('0x37')]())))['toString']();return _0x427f18;};function _0x305297(_0x169bfe,_0x3987ab){var _0x315315=squel[_0xaa80('0x2d')]()[_0xaa80('0x2e')](_0xaa80('0x2f'))[_0xaa80('0x30')](['phone',_0xaa80('0x32'),'ContactId',_0xaa80('0x24'),_0x3987ab,_0xaa80('0x34'),_0xaa80('0x35')],squel['select']()[_0xaa80('0x36')](_0xaa80('0x31'),'phone')[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x32'))['field']('id',_0xaa80('0x33'))['field'](LISTID[_0xaa80('0x37')](),_0xaa80('0x24'))['field'](_0x169bfe['id'][_0xaa80('0x37')](),_0x3987ab)[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x34'))['field'](_0xaa80('0x38'),_0xaa80('0x35'))[_0xaa80('0x39')](_0xaa80('0x3a'))[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')](_0xaa80('0x3d'),LISTID[_0xaa80('0x37')]())['where'](_0xaa80('0x42'),squel['str'](hopperContacts))[_0xaa80('0x3b')](_0xaa80('0x3e')))[_0xaa80('0x37')]();return _0x315315;}function _0x550fe2(_0x3650fc,_0x51807a){var _0x59474e=squel[_0xaa80('0x2d')]()['into']('cm_hopper_black')['fromQuery']([_0xaa80('0x31'),'ContactId',_0xaa80('0x24'),_0x51807a,_0xaa80('0x34'),_0xaa80('0x35')],squel[_0xaa80('0x40')]()['field'](_0xaa80('0x31'),'phone')['field']('id',_0xaa80('0x33'))[_0xaa80('0x36')](LISTID[_0xaa80('0x37')](),'ListId')[_0xaa80('0x36')](_0x3650fc['id']['toString'](),_0x51807a)[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x34'))['field'](_0xaa80('0x38'),_0xaa80('0x35'))['from'](_0xaa80('0x3a'))[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')]('ListId\x20=\x20?',LISTID[_0xaa80('0x37')]())['where'](_0xaa80('0x42'),squel[_0xaa80('0x43')](hopperContacts))[_0xaa80('0x3b')](_0xaa80('0x3e')))['toString']();return _0x59474e;}return db[_0xaa80('0x44')][_0xaa80('0x45')]({'where':{'type':_0xaa80('0x46')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x48'),'where':{'id':LISTID}}]})[_0xaa80('0x29')](function(_0x32e0d0){var _0x480f2b=[];if(_0x32e0d0){var _0x24e1c5;for(var _0x4fcaa2=0x0,_0x20d899;_0x4fcaa2<_0x32e0d0[_0xaa80('0x18')];_0x4fcaa2+=0x1){_0x20d899=_0x32e0d0[_0x4fcaa2][_0xaa80('0x49')]({'plain':!![]});switch(_0x20d899[_0xaa80('0x4a')]){case _0xaa80('0x4b'):_0x480f2b[_0xaa80('0x4c')](db['sequelize'][_0xaa80('0x4d')](_0x3bf5d2(_0x20d899,_0xaa80('0x4e')))['then'](function(){})['catch'](_0x7440f1()));break;case _0xaa80('0x4f'):_0x480f2b['push'](db[_0xaa80('0x50')][_0xaa80('0x4d')](_0x5008df(_0x20d899,_0xaa80('0x4e')))['then'](function(){})[_0xaa80('0x51')](_0x7440f1()));break;default:_0x480f2b[_0xaa80('0x4c')](db['sequelize'][_0xaa80('0x4d')](_0x305297(_0x20d899,_0xaa80('0x4e')))['then'](function(){})[_0xaa80('0x51')](_0x7440f1()));}}}return _0x480f2b;})['all']()[_0xaa80('0x29')](function(){return db['VoiceQueue'][_0xaa80('0x45')]({'where':{'type':_0xaa80('0x46')},'attributes':['id'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x3b6898){var _0x1678b5=[];if(_0x3b6898){var _0x26ff96;for(var _0x46b3bb=0x0,_0x354de5;_0x46b3bb<_0x3b6898[_0xaa80('0x18')];_0x46b3bb+=0x1){_0x354de5=_0x3b6898[_0x46b3bb][_0xaa80('0x49')]({'plain':!![]});_0x1678b5['push'](db['sequelize']['query'](_0x550fe2(_0x354de5,'VoiceQueueId'))[_0xaa80('0x29')](function(){})[_0xaa80('0x51')](_0x7440f1()));}}return _0x1678b5;})[_0xaa80('0x53')]();})[_0xaa80('0x29')](function(){return db[_0xaa80('0x54')][_0xaa80('0x45')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x48'),'where':{'id':LISTID}}]})[_0xaa80('0x29')](function(_0x3b858b){var _0x18201f=[];if(_0x3b858b){for(var _0x24782a=0x0,_0x37730a;_0x24782a<_0x3b858b[_0xaa80('0x18')];_0x24782a+=0x1){_0x37730a=_0x3b858b[_0x24782a][_0xaa80('0x49')]({'plain':!![]});switch(_0x37730a[_0xaa80('0x4a')]){case _0xaa80('0x4b'):_0x18201f[_0xaa80('0x4c')](db[_0xaa80('0x50')][_0xaa80('0x4d')](_0x3bf5d2(_0x37730a,_0xaa80('0x55')))[_0xaa80('0x29')](function(){})[_0xaa80('0x51')](_0x7440f1()));break;case _0xaa80('0x4f'):_0x18201f[_0xaa80('0x4c')](db['sequelize'][_0xaa80('0x4d')](_0x5008df(_0x37730a,_0xaa80('0x55')))['then'](function(){})[_0xaa80('0x51')](_0x7440f1()));break;default:_0x18201f['push'](db['sequelize']['query'](_0x305297(_0x37730a,_0xaa80('0x55')))[_0xaa80('0x29')](function(){})[_0xaa80('0x51')](_0x7440f1()));}}}return _0x18201f;})[_0xaa80('0x53')]();})[_0xaa80('0x29')](function(){return db[_0xaa80('0x54')][_0xaa80('0x45')]({'attributes':['id'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x245111){var _0xfd4d4e=[];if(_0x245111){for(var _0x195cf6=0x0,_0xfe2561;_0x195cf6<_0x245111[_0xaa80('0x18')];_0x195cf6+=0x1){_0xfe2561=_0x245111[_0x195cf6]['get']({'plain':!![]});_0xfd4d4e[_0xaa80('0x4c')](db[_0xaa80('0x50')]['query'](_0x550fe2(_0xfe2561,_0xaa80('0x55')))[_0xaa80('0x29')](function(){})['catch'](_0x7440f1()));}}return _0xfd4d4e;})['all']();})[_0xaa80('0x51')](function(_0x246c08){logger['error']('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x246c08['message']);});}var processPromises=function(_0x159e78){return BPromise['all'](promises)[_0xaa80('0x29')](function(_0x210513){})[_0xaa80('0x51')](function(_0x3e0598){logger[_0xaa80('0x12')](_0xaa80('0x56'),JSON[_0xaa80('0x2a')](_0x3e0598));})[_0xaa80('0x57')](function(){socket[_0xaa80('0x58')](_0xaa80('0x59')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x159e78){return _0x159e78[_0xaa80('0x5a')]();}});};var endCsv=function(){return BPromise[_0xaa80('0x5b')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xaa80('0x29')](function(){socket[_0xaa80('0x58')](_0xaa80('0x59')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xaa80('0x5c')](FILEPATH);}catch(_0x3f11e3){logger['error'](_0xaa80('0x5d'),JSON[_0xaa80('0x2a')](_0x3f11e3));}finally{process[_0xaa80('0x5e')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xaa80('0x5f'));endCsv();});function main(){return BPromise['resolve']()[_0xaa80('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xaa80('0x10')](',');return db[_0xaa80('0x27')][_0xaa80('0x45')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xaa80('0x29')](function(_0x57e78a){var _0x397e86=fs[_0xaa80('0x60')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xaa80('0x61')](_0x397e86,{'header':!![],'skipEmptyLines':!![],'step':function(_0x43f4e2,_0x5c7727){total+=0x1;var _0x27064c=total;promises['push'](checkRow(_0x43f4e2,_0x57e78a,_0x27064c)[_0xaa80('0x29')](function(){success+=0x1;})[_0xaa80('0x51')](function(_0xdc3b10){if(_0xdc3b10['error']){errors+=0x1;delete _0xdc3b10[_0xaa80('0x12')];}else if(_0xdc3b10[_0xaa80('0x26')]){duplicates+=0x1;delete _0xdc3b10[_0xaa80('0x26')];}rows[_0xaa80('0x4c')](_0xdc3b10);}));if(total%0xc8===0x0){_0x5c7727['pause']();return processPromises(_0x5c7727);}},'complete':function(){return processPromises()[_0xaa80('0x29')](function(){logger['info'](_0xaa80('0x62'));endCsv();});},'error':function(_0x4d195e,_0x27702d){logger[_0xaa80('0x63')](_0xaa80('0x64'),JSON[_0xaa80('0x2a')](_0x4d195e));endCsv();}});})[_0xaa80('0x51')](function(_0xc257dd){logger[_0xaa80('0x12')](_0xaa80('0x65'),JSON[_0xaa80('0x2a')](_0xc257dd));});}main(); \ No newline at end of file +var _0x5530=['Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','errors','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','insert','into','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper','\x20=\x20?','fromQuery','phone\x20NOT\x20IN\x20(?)','calleridnum','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resolve'];(function(_0x4e61bc,_0x1cff51){var _0x4e0fb1=function(_0x587f0d){while(--_0x587f0d){_0x4e61bc['push'](_0x4e61bc['shift']());}};_0x4e0fb1(++_0x1cff51);}(_0x5530,0x77));var _0x0553=function(_0x5ddc65,_0x2433cf){_0x5ddc65=_0x5ddc65-0x0;var _0x5054e5=_0x5530[_0x5ddc65];return _0x5054e5;};'use strict';var BPromise=require(_0x0553('0x0'));var util=require(_0x0553('0x1'));var _=require(_0x0553('0x2'));var fs=require('fs');var squel=require(_0x0553('0x3'));var Papa=require(_0x0553('0x4'));var Redis=require(_0x0553('0x5'));var db=require(_0x0553('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0553('0x7'));config[_0x0553('0x8')]=_[_0x0553('0x9')](config['redis'],{'host':_0x0553('0xa'),'port':0x18eb});var socket=require(_0x0553('0xb'))(new Redis(config[_0x0553('0x8')]));require(_0x0553('0xc'))[_0x0553('0xd')](socket);try{if(!process[_0x0553('0xe')][0x2]||process[_0x0553('0xe')][0x2]===_0x0553('0xf')||process[_0x0553('0xe')][0x2]===_0x0553('0x10')){throw new Error(_0x0553('0x11'));}var FILEPATH=process[_0x0553('0xe')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]==='undefined'||process[_0x0553('0xe')][0x3]===_0x0553('0x10')||!process['argv'][0x4]||process[_0x0553('0xe')][0x4]===_0x0553('0xf')||process[_0x0553('0xe')][0x4]===_0x0553('0x10')){throw new Error(_0x0553('0x12'));}var FIELDS=_[_0x0553('0x13')](process['argv'][0x3][_0x0553('0x14')](','),process['argv'][0x4][_0x0553('0x14')](','));if(!process[_0x0553('0xe')][0x5]||process[_0x0553('0xe')][0x5]===_0x0553('0xf')||process[_0x0553('0xe')][0x5]===_0x0553('0x10')){throw new Error(_0x0553('0x15'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0553('0xe')][0x6]!==_0x0553('0xf')&&process[_0x0553('0xe')][0x6]!=='null'?process[_0x0553('0xe')][0x6]:null;var DUPLICATES=process[_0x0553('0xe')][0x7]&&process[_0x0553('0xe')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x0553('0x10')?process['argv'][0x7]:null;if(!process[_0x0553('0xe')][0x8]||process['argv'][0x8]===_0x0553('0xf')||process[_0x0553('0xe')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x0553('0xe')][0x8];}catch(_0xd0d3fa){logger[_0x0553('0x16')](_0xd0d3fa);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(_0x383657,_0x49052f,_0x2bdc01,_0x53d5b0){var _0x53cd7a={'message':_0x49052f};_0x53cd7a[_0x383657]=!![];if(_0x2bdc01){_0x53cd7a[_0x0553('0x17')]=_0x2bdc01;}if(_0x53d5b0){_0x53cd7a[_0x0553('0x18')]=_0x53d5b0;}return _0x53cd7a;}function isEmail(_0x255eef){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))*$/[_0x0553('0x19')](_0x255eef);}function checkRow(_0x57b4d1,_0x5defa4,_0x51c38c){return new BPromise(function(_0x41712a,_0x548625){if(_[_0x0553('0x1a')](_0x57b4d1)){return _0x548625(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x51c38c));}if(_0x57b4d1[_0x0553('0x1b')]&&_0x57b4d1[_0x0553('0x1b')]['length']){var _0x48c8b8=_[_0x0553('0x1c')](_0x57b4d1[_0x0553('0x1b')],'message')[_0x0553('0x1d')](';');return _0x548625(handleCheckRowError(_0x0553('0x16'),_0x48c8b8,null,_0x51c38c));}var _0x59453e={};for(var _0xee97b8 in FIELDS){if(FIELDS[_0x0553('0x1e')](_0xee97b8)&&FIELDS[_0xee97b8]){_0x59453e[_0xee97b8]=_0x57b4d1[_0x0553('0x1f')][0x0][FIELDS[_0xee97b8]]||_0x57b4d1['data'][0x0]['\ufeff'+FIELDS[_0xee97b8]];}}if(!_0x59453e[_0x0553('0x20')]){return _0x548625(handleCheckRowError(_0x0553('0x16'),_0x0553('0x21'),null,_0x51c38c));}if(!_0x59453e[_0x0553('0x22')]){return _0x548625(handleCheckRowError(_0x0553('0x16'),'phone\x20not\x20specified!',null,_0x51c38c));}if(_0x59453e[_0x0553('0x23')]){var _0x10975c=moment(_0x59453e[_0x0553('0x23')],_0x0553('0x24'));if(!_0x10975c[_0x0553('0x25')]()){return _0x548625(handleCheckRowError(_0x0553('0x16'),_0x0553('0x26'),null,_0x51c38c));}}if(_0x59453e[_0x0553('0x27')]){if(!isEmail(_0x59453e[_0x0553('0x27')])){return _0x548625(handleCheckRowError(_0x0553('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x51c38c));}}_0x59453e['ListId']=LISTID;_0x59453e[_0x0553('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0553('0x29')]&&_0x5defa4){var _0x23741f={};for(var _0x534d54=0x0,_0x5a3ec1=DUPLICATES[_0x0553('0x29')];_0x534d54<_0x5a3ec1;_0x534d54+=0x1){_0x23741f[DUPLICATES[_0x534d54]]=_0x59453e[DUPLICATES[_0x534d54]];}var _0x377552=_[_0x0553('0x2a')](_0x5defa4,_0x23741f);if(_0x377552){return _0x548625(handleCheckRowError(_0x0553('0x2b'),_0x0553('0x2c'),_0x377552,_0x51c38c));}}return db[_0x0553('0x2d')][_0x0553('0x2e')](_0x59453e,{'raw':!![],'hooks':![],'fields':_[_0x0553('0x2f')](_0x59453e)})['then'](function(_0x370932){if(DUPLICATES&&DUPLICATES[_0x0553('0x29')]&&_0x5defa4){_0x5defa4[_0x0553('0x30')](_[_0x0553('0x31')](_0x59453e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x370932['id'];return _0x41712a();})[_0x0553('0x32')](function(_0x5b778d){return _0x548625(handleCheckRowError(_0x0553('0x16'),'Error\x20while\x20creating\x20contact:\x20'+(_0x5b778d[_0x0553('0x33')]||JSON[_0x0553('0x34')](_0x5b778d)),null,_0x51c38c));});});}function checkHopper(){function _0x4cada8(){return function(_0x5aac12){logger[_0x0553('0x16')](_0x0553('0x35'),_0x0553('0x36'),util[_0x0553('0x37')](_0x5aac12,{'showHidden':![],'depth':null}));};}var _0xd9099a=function(_0x7dd6b,_0x1863ec){var _0x17223b=squel[_0x0553('0x38')]()[_0x0553('0x39')]('cm_hopper')['fromQuery']([_0x0553('0x22'),_0x0553('0x3a'),_0x0553('0x3b'),_0x0553('0x3c'),_0x1863ec,_0x0553('0x3d'),_0x0553('0x3e')],squel[_0x0553('0x3f')]()[_0x0553('0x40')]('phone',_0x0553('0x22'))[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3a'))[_0x0553('0x40')]('id',_0x0553('0x3b'))[_0x0553('0x40')](LISTID[_0x0553('0x42')](),_0x0553('0x3c'))[_0x0553('0x40')](_0x7dd6b['id'][_0x0553('0x42')](),_0x1863ec)[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3d'))['field']('NOW()','updatedAt')[_0x0553('0x43')](_0x0553('0x44'))[_0x0553('0x45')]('deletedAt\x20IS\x20NULL')[_0x0553('0x45')](_0x0553('0x46'),LISTID[_0x0553('0x42')]())['where'](_0x0553('0x47'))[_0x0553('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0553('0x3f')]()[_0x0553('0x40')](_0x0553('0x22'))['from'](_0x0553('0x48'))[_0x0553('0x45')](_0x1863ec+_0x0553('0x49'),_0x7dd6b['id'][_0x0553('0x42')]())))[_0x0553('0x42')]();return _0x17223b;};var _0x1dbbaf=function(_0x91c5d6,_0x4d7325){var _0x20e786=squel[_0x0553('0x38')]()[_0x0553('0x39')]('cm_hopper')[_0x0553('0x4a')]([_0x0553('0x22'),_0x0553('0x3a'),_0x0553('0x3b'),_0x0553('0x3c'),_0x4d7325,_0x0553('0x3d'),_0x0553('0x3e')],squel['select']()[_0x0553('0x40')](_0x0553('0x22'),_0x0553('0x22'))[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3a'))['field']('id',_0x0553('0x3b'))[_0x0553('0x40')](LISTID[_0x0553('0x42')](),_0x0553('0x3c'))[_0x0553('0x40')](_0x91c5d6['id'][_0x0553('0x42')](),_0x4d7325)[_0x0553('0x40')](_0x0553('0x41'),'createdAt')[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3e'))[_0x0553('0x43')](_0x0553('0x44'))[_0x0553('0x45')]('deletedAt\x20IS\x20NULL')[_0x0553('0x45')](_0x0553('0x46'),LISTID[_0x0553('0x42')]())[_0x0553('0x45')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x0553('0x45')](_0x0553('0x47'))[_0x0553('0x45')](_0x0553('0x4b'),squel[_0x0553('0x3f')]()[_0x0553('0x40')](_0x0553('0x4c'))[_0x0553('0x43')]('cm_hopper_final')['where'](_0x4d7325+_0x0553('0x49'),_0x91c5d6['id'][_0x0553('0x42')]()))[_0x0553('0x45')](_0x0553('0x4b'),squel[_0x0553('0x3f')]()[_0x0553('0x40')](_0x0553('0x22'))[_0x0553('0x43')]('cm_hopper')[_0x0553('0x45')](_0x4d7325+_0x0553('0x49'),_0x91c5d6['id'][_0x0553('0x42')]())))[_0x0553('0x42')]();return _0x20e786;};function _0x5e3e0a(_0x18c188,_0x11aca3){var _0x22c765=squel[_0x0553('0x38')]()[_0x0553('0x39')](_0x0553('0x48'))[_0x0553('0x4a')](['phone',_0x0553('0x3a'),_0x0553('0x3b'),_0x0553('0x3c'),_0x11aca3,_0x0553('0x3d'),_0x0553('0x3e')],squel[_0x0553('0x3f')]()[_0x0553('0x40')]('phone',_0x0553('0x22'))[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3a'))[_0x0553('0x40')]('id',_0x0553('0x3b'))[_0x0553('0x40')](LISTID[_0x0553('0x42')](),_0x0553('0x3c'))[_0x0553('0x40')](_0x18c188['id'][_0x0553('0x42')](),_0x11aca3)[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3d'))[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3e'))[_0x0553('0x43')](_0x0553('0x44'))[_0x0553('0x45')](_0x0553('0x4d'))['where']('ListId\x20=\x20?',LISTID[_0x0553('0x42')]())[_0x0553('0x45')](_0x0553('0x4e'),squel['str'](hopperContacts))[_0x0553('0x45')](_0x0553('0x47')))['toString']();return _0x22c765;}function _0x1065b1(_0x5c9afe,_0x29c491){var _0x66feb9=squel[_0x0553('0x38')]()[_0x0553('0x39')]('cm_hopper_black')[_0x0553('0x4a')](['phone',_0x0553('0x3b'),_0x0553('0x3c'),_0x29c491,'createdAt',_0x0553('0x3e')],squel['select']()[_0x0553('0x40')](_0x0553('0x22'),_0x0553('0x22'))[_0x0553('0x40')]('id',_0x0553('0x3b'))[_0x0553('0x40')](LISTID[_0x0553('0x42')](),_0x0553('0x3c'))[_0x0553('0x40')](_0x5c9afe['id'][_0x0553('0x42')](),_0x29c491)[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3d'))[_0x0553('0x40')](_0x0553('0x41'),_0x0553('0x3e'))[_0x0553('0x43')](_0x0553('0x44'))[_0x0553('0x45')](_0x0553('0x4d'))[_0x0553('0x45')]('ListId\x20=\x20?',LISTID[_0x0553('0x42')]())[_0x0553('0x45')](_0x0553('0x4e'),squel[_0x0553('0x4f')](hopperContacts))[_0x0553('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x0553('0x42')]();return _0x66feb9;}return db[_0x0553('0x50')]['findAll']({'where':{'type':_0x0553('0x51')},'attributes':['id',_0x0553('0x52')],'include':[{'model':db[_0x0553('0x53')],'as':_0x0553('0x54'),'where':{'id':LISTID}}]})[_0x0553('0x55')](function(_0xd7e294){var _0x534d40=[];if(_0xd7e294){var _0x26725a;for(var _0x21495f=0x0,_0x27ebde;_0x21495f<_0xd7e294['length'];_0x21495f+=0x1){_0x27ebde=_0xd7e294[_0x21495f][_0x0553('0x56')]({'plain':!![]});switch(_0x27ebde[_0x0553('0x52')]){case _0x0553('0x57'):_0x534d40['push'](db[_0x0553('0x58')][_0x0553('0x59')](_0x1dbbaf(_0x27ebde,_0x0553('0x5a')))[_0x0553('0x55')](function(){})[_0x0553('0x32')](_0x4cada8()));break;case _0x0553('0x5b'):_0x534d40['push'](db[_0x0553('0x58')]['query'](_0xd9099a(_0x27ebde,_0x0553('0x5a')))[_0x0553('0x55')](function(){})[_0x0553('0x32')](_0x4cada8()));break;default:_0x534d40[_0x0553('0x30')](db['sequelize'][_0x0553('0x59')](_0x5e3e0a(_0x27ebde,_0x0553('0x5a')))['then'](function(){})['catch'](_0x4cada8()));}}}return _0x534d40;})[_0x0553('0x5c')]()[_0x0553('0x55')](function(){return db[_0x0553('0x50')]['findAll']({'where':{'type':_0x0553('0x51')},'attributes':['id'],'include':[{'model':db[_0x0553('0x53')],'as':_0x0553('0x5d'),'where':{'id':LISTID}}]})[_0x0553('0x55')](function(_0x5df434){var _0x58ee48=[];if(_0x5df434){var _0x48bc9a;for(var _0x45c172=0x0,_0x262431;_0x45c172<_0x5df434[_0x0553('0x29')];_0x45c172+=0x1){_0x262431=_0x5df434[_0x45c172][_0x0553('0x56')]({'plain':!![]});_0x58ee48['push'](db[_0x0553('0x58')][_0x0553('0x59')](_0x1065b1(_0x262431,'VoiceQueueId'))[_0x0553('0x55')](function(){})[_0x0553('0x32')](_0x4cada8()));}}return _0x58ee48;})['all']();})[_0x0553('0x55')](function(){return db[_0x0553('0x5e')][_0x0553('0x5f')]({'attributes':['id',_0x0553('0x52')],'include':[{'model':db[_0x0553('0x53')],'as':_0x0553('0x54'),'where':{'id':LISTID}}]})[_0x0553('0x55')](function(_0x365566){var _0xbd8179=[];if(_0x365566){for(var _0x2fdd15=0x0,_0x2216c1;_0x2fdd15<_0x365566[_0x0553('0x29')];_0x2fdd15+=0x1){_0x2216c1=_0x365566[_0x2fdd15][_0x0553('0x56')]({'plain':!![]});switch(_0x2216c1['dialCheckDuplicateType']){case _0x0553('0x57'):_0xbd8179['push'](db['sequelize']['query'](_0x1dbbaf(_0x2216c1,'CampaignId'))[_0x0553('0x55')](function(){})[_0x0553('0x32')](_0x4cada8()));break;case'onlyIfOpen':_0xbd8179[_0x0553('0x30')](db[_0x0553('0x58')][_0x0553('0x59')](_0xd9099a(_0x2216c1,_0x0553('0x60')))[_0x0553('0x55')](function(){})[_0x0553('0x32')](_0x4cada8()));break;default:_0xbd8179[_0x0553('0x30')](db['sequelize'][_0x0553('0x59')](_0x5e3e0a(_0x2216c1,_0x0553('0x60')))['then'](function(){})[_0x0553('0x32')](_0x4cada8()));}}}return _0xbd8179;})[_0x0553('0x5c')]();})[_0x0553('0x55')](function(){return db[_0x0553('0x5e')][_0x0553('0x5f')]({'attributes':['id'],'include':[{'model':db[_0x0553('0x53')],'as':_0x0553('0x5d'),'where':{'id':LISTID}}]})[_0x0553('0x55')](function(_0x984079){var _0xd5fd61=[];if(_0x984079){for(var _0x11a175=0x0,_0x315845;_0x11a175<_0x984079[_0x0553('0x29')];_0x11a175+=0x1){_0x315845=_0x984079[_0x11a175][_0x0553('0x56')]({'plain':!![]});_0xd5fd61['push'](db[_0x0553('0x58')][_0x0553('0x59')](_0x1065b1(_0x315845,'CampaignId'))[_0x0553('0x55')](function(){})[_0x0553('0x32')](_0x4cada8()));}}return _0xd5fd61;})[_0x0553('0x5c')]();})['catch'](function(_0x4dbe85){logger[_0x0553('0x16')](_0x0553('0x61'),_0x0553('0x62'),_0x4dbe85['message']);});}var processPromises=function(_0x401371){return BPromise[_0x0553('0x5c')](promises)['then'](function(_0x50e1d3){})[_0x0553('0x32')](function(_0x311a50){logger[_0x0553('0x16')](_0x0553('0x63'),JSON[_0x0553('0x34')](_0x311a50));})['finally'](function(){socket[_0x0553('0x64')](_0x0553('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x401371){return _0x401371['resume']();}});};var endCsv=function(){return BPromise[_0x0553('0x66')]()[_0x0553('0x55')](function(){if(hopperContacts){return checkHopper();}})[_0x0553('0x55')](function(){socket[_0x0553('0x64')](_0x0553('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x47a526){logger[_0x0553('0x16')](_0x0553('0x67'),JSON[_0x0553('0x34')](_0x47a526));}finally{process[_0x0553('0x68')](0x0);}});};process['on'](_0x0553('0x69'),function(){logger['info'](_0x0553('0x6a'));endCsv();});function main(){return BPromise[_0x0553('0x66')]()[_0x0553('0x55')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0553('0x14')](',');return db[_0x0553('0x2d')][_0x0553('0x5f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0553('0x55')](function(_0x1e8a09){var _0x46cdd4=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x46cdd4,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2fafb8,_0xa20d00){total+=0x1;var _0x438306=total;promises[_0x0553('0x30')](checkRow(_0x2fafb8,_0x1e8a09,_0x438306)['then'](function(){success+=0x1;})[_0x0553('0x32')](function(_0x4ddb1a){if(_0x4ddb1a['error']){errors+=0x1;delete _0x4ddb1a[_0x0553('0x16')];}else if(_0x4ddb1a[_0x0553('0x2b')]){duplicates+=0x1;delete _0x4ddb1a[_0x0553('0x2b')];}rows['push'](_0x4ddb1a);}));if(total%0xc8===0x0){_0xa20d00['pause']();return processPromises(_0xa20d00);}},'complete':function(){return processPromises()[_0x0553('0x55')](function(){logger[_0x0553('0x6b')](_0x0553('0x6c'));endCsv();});},'error':function(_0x550fa5,_0x592c4d){logger[_0x0553('0x6b')](_0x0553('0x6d'),JSON['stringify'](_0x550fa5));endCsv();}});})[_0x0553('0x32')](function(_0x1b01bc){logger[_0x0553('0x16')](_0x0553('0x6e'),JSON[_0x0553('0x34')](_0x1b01bc));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b346d87..b8c9cdd 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 _0xf34e=['contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','squel','ioredis','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','.id\x20=\x20','where','\x20=\x20','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','into','cm_hopper_black','ListId','from','cm_contacts.ListId\x20=\x20','.CmListId','field','phone','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','sequelize','query','spread','push','catch','stringify','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','length','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xf34e,0x12c));var _0xef34=function(_0x14a7ba,_0x304cc9){_0x14a7ba=_0x14a7ba-0x0;var _0x59c936=_0xf34e[_0x14a7ba];return _0x59c936;};'use strict';var fs=require('fs');var path=require(_0xef34('0x0'));var _=require(_0xef34('0x1'));var Papa=require(_0xef34('0x2'));var util=require('util');var BPromise=require(_0xef34('0x3'));var moment=require('moment');var squel=require(_0xef34('0x4'));var Redis=require(_0xef34('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xef34('0x6'));var logger=require(_0xef34('0x7'))(_0xef34('0x8'));config['redis']=_[_0xef34('0x9')](config[_0xef34('0xa')],{'host':_0xef34('0xb'),'port':0x18eb});var socket=require(_0xef34('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xef34('0xd')](_0xef34('0xe'));function isEmail(_0x8989c6){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'](_0x8989c6);}function selectNotIn(_0x588dff,_0x43e105,_0x5c94e6,_0x526c75,_0x48c439){return squel[_0xef34('0xf')]()['field']('phone')['from'](_0x526c75)['join'](_0x43e105,null,_0x43e105+_0xef34('0x10')+_0x526c75+'.'+_0x5c94e6)[_0xef34('0x11')](_0x526c75+'.'+_0x5c94e6+_0xef34('0x12')+_0x588dff+'.'+_0x5c94e6)[_0xef34('0x11')](_0x43e105+'.dialCheckDuplicateType\x20IN\x20('+_0x48c439[_0xef34('0x13')]()+')');}function insertCmHopper(_0x5dfe6c,_0x78ef9b,_0xeaad41,_0x150de2,_0x2cfa7d){var _0x233bcf=[_0xef34('0x14'),_0xef34('0x15'),_0xef34('0x16'),'cm_contacts.ListId',_0x78ef9b+'.'+_0x150de2,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xef34('0x17'),_0xef34('0x18'),'\x22'+_0x2cfa7d+'\x22'];return squel[_0xef34('0x19')]()['into'](_0xef34('0x1a'))[_0xef34('0x1b')](['phone',_0xef34('0x1c'),_0xef34('0x1d'),'ListId',_0x150de2,_0xef34('0x1e'),_0xef34('0x1f'),_0xef34('0x20'),_0xef34('0x21'),_0xef34('0x22')],squel['select']()[_0xef34('0x23')](_0x233bcf)['from'](_0x78ef9b)[_0xef34('0x13')](_0xef34('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x78ef9b+'.CmListId')[_0xef34('0x13')](_0xeaad41,null,_0xeaad41+_0xef34('0x10')+_0x78ef9b+'.'+_0x150de2)[_0xef34('0x11')](_0x78ef9b+_0xef34('0x25'),_0x5dfe6c)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xef34('0x26'),selectNotIn(_0x78ef9b,_0xeaad41,_0x150de2,_0xef34('0x1a'),[_0xef34('0x27'),_0xef34('0x28')]))[_0xef34('0x11')](_0xef34('0x26'),selectNotIn(_0x78ef9b,_0xeaad41,_0x150de2,_0xef34('0x1a'),['\x22always\x22'])))[_0xef34('0x29')]();}function insertCmHopperBlack(_0x1ab6c9,_0x1869ca,_0x5aa4cb,_0x35b970){var _0x16b2dc=[_0xef34('0x14'),_0xef34('0x16'),_0xef34('0x2a'),_0x1869ca+'.'+_0x35b970,_0xef34('0x2b'),_0xef34('0x2c')];return squel[_0xef34('0x19')]()[_0xef34('0x2d')](_0xef34('0x2e'))[_0xef34('0x1b')](['phone',_0xef34('0x1d'),_0xef34('0x2f'),_0x35b970,_0xef34('0x1e'),'updatedAt'],squel[_0xef34('0xf')]()[_0xef34('0x23')](_0x16b2dc)[_0xef34('0x30')](_0x1869ca)[_0xef34('0x13')]('cm_contacts',null,_0xef34('0x31')+_0x1869ca+_0xef34('0x32'))[_0xef34('0x13')](_0x5aa4cb,null,_0x5aa4cb+'.id\x20=\x20'+_0x1869ca+'.'+_0x35b970)[_0xef34('0x11')](_0x1869ca+_0xef34('0x25'),_0x1ab6c9)[_0xef34('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xef34('0x11')](_0xef34('0x26'),squel[_0xef34('0xf')]()[_0xef34('0x33')](_0xef34('0x34'))[_0xef34('0x30')](_0xef34('0x2e'))['where'](_0xef34('0x35'),_0x1ab6c9)[_0xef34('0x11')](_0x35b970+_0xef34('0x36'),_0x1869ca+'.'+_0x35b970)))[_0xef34('0x29')]();}function insertCmContact(_0x1b1da9,_0x118156,_0x5efc44,_0x540e7e){var _0x1a9a6f=_['concat'](_[_0xef34('0x37')](_0x540e7e),[_0xef34('0x2f'),_0xef34('0x38'),_0xef34('0x1e'),'updatedAt']);return squel['insert']()[_0xef34('0x2d')](_0xef34('0x24'))[_0xef34('0x1b')](_0x1a9a6f,squel[_0xef34('0xf')]()['fields'](_0x1a9a6f)['from'](_0x118156)['where']('('+_0x5efc44[_0xef34('0x13')](',')+_0xef34('0x39'),squel['select']()[_0xef34('0x23')](_0x5efc44)[_0xef34('0x30')](_0xef34('0x24'))[_0xef34('0x11')]('ListId\x20=\x20?',_0x1b1da9)[_0xef34('0x11')]('deletedAt\x20IS\x20NULL'))[_0xef34('0x11')](_0xef34('0x3a'),squel[_0xef34('0xf')]()['field'](_0xef34('0x3b'),_0xef34('0x3c'))['from'](_0x118156)[_0xef34('0x3d')](_0x5efc44[_0xef34('0x13')](','))))[_0xef34('0x29')]();}function handleStop(){logger[_0xef34('0x3e')](_0xef34('0x3f'));stopped=!![];}function handleUncaughtException(_0x349035){logger[_0xef34('0x40')](_0x349035[_0xef34('0x41')]);process[_0xef34('0x42')](0x1);}function handleError(_0x494e2b,_0x41d54d){stats[_0xef34('0x43')]['push']({'name':_0x41d54d['code'],'message':_0x41d54d[_0xef34('0x41')],'row':_0x494e2b});}function handleQuery(_0x71eb6f){logger[_0xef34('0x3e')](_0x71eb6f);return db[_0xef34('0x44')][_0xef34('0x45')](_0x71eb6f)[_0xef34('0x46')](function(_0x962431){results[_0xef34('0x47')](_0x962431);})[_0xef34('0x48')](function(_0x445bdc){logger[_0xef34('0x40')](_0x445bdc['message']);});}function main(_0x34c426,_0x31e6f9,_0x347fa2,_0x2fd44f){logger['info']('main',_0x34c426,JSON[_0xef34('0x49')](_0x31e6f9));process['send']('start');var _0x46489f=_0x31e6f9[_0xef34('0x4a')];var _0xbf0552=_0x31e6f9[_0xef34('0x4b')];var _0x565b46=path['join'](config[_0xef34('0x4c')],_0xef34('0x4d'),_0xbf0552+_0xef34('0x4e'));var _0x36cff2=_[_0xef34('0x37')](_0x46489f)['join']();logger[_0xef34('0x3e')](_0xef34('0x4f'),_0x36cff2);fs[_0xef34('0x50')](_0x565b46,_0x36cff2+'\x0a');Papa[_0xef34('0x51')](fs['createReadStream'](_0x34c426),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4793f6,_0x2399d1){try{for(var _0x13a4d9=0x0,_0xda920c=[];_0x13a4d9<_0x4793f6['data'][_0xef34('0x52')];_0x13a4d9++){stats['rows']+=0x1;if(_0x4793f6['errors'][_0x13a4d9]){handleError(_0x4793f6[_0xef34('0x53')][_0x13a4d9],_0x4793f6[_0xef34('0x43')][_0x13a4d9]);}else{var _0x4f441a=[];for(var _0x109f49 in _0x46489f){if(_0x46489f[_0xef34('0x54')](_0x109f49)){if(_0x4793f6['data'][_0x13a4d9][_0x46489f[_0x109f49]]){var _0x3b454b=_[_0xef34('0x55')](_0x4793f6[_0xef34('0x53')][_0x13a4d9][_0x46489f[_0x109f49]][_0xef34('0x56')](/"/g,'\x27'));switch(_0x109f49){case _0xef34('0x1c'):var _0xdad3c2=moment(_0x3b454b,_0xef34('0xe'),!![]);if(_0xdad3c2[_0xef34('0x57')]()){_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');}else{_0x4f441a[_0xef34('0x47')](_0xef34('0x58'));}break;case'priority':var _0x2b2593=parseInt(_0x3b454b);_0x3b454b=_[_0xef34('0x59')](_0x2b2593)||_0x2b2593<0x0||_0x2b2593>0x4?_0x2fd44f?0x3:0x2:_0x2b2593;_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');break;case'UserId':var _0x2b606b=parseInt(_0x3b454b);if(_['isNumber'](_0x2b606b)&&_[_0xef34('0x5a')](_0x347fa2,_0x2b606b)){_0xda920c[_0xef34('0x47')]('\x22'+_0x2b606b+'\x22');}else{_0x4f441a[_0xef34('0x47')]('agent\x20not\x20exists');}break;case _0xef34('0x5b'):if(isEmail(_0x3b454b)){_0xda920c['push']('\x22'+_0x3b454b+'\x22');}else{_0x4f441a['push'](_0xef34('0x5c'));}break;case _0xef34('0x5d'):var _0xd91a99=moment(_0x3b454b,_0xef34('0x5e'),!![]);if(_0xd91a99[_0xef34('0x57')]()){_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');}else{_0x4f441a['push'](_0xef34('0x5f'));}break;default:_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');}}else{switch(_0x109f49){case _0xef34('0x60'):case _0xef34('0x34'):_0x4f441a[_0xef34('0x47')](_0x109f49+_0xef34('0x61'));break;default:_0xda920c['push']('\x22\x22');}}}}if(_0x4f441a[_0xef34('0x52')]){handleError(_0x4793f6[_0xef34('0x53')][_0x13a4d9],{'code':_0xef34('0x62'),'message':_0x4f441a['join']()});}else{fs[_0xef34('0x63')](_0x565b46,_0xda920c[_0xef34('0x13')]()+'\x0a');}_0xda920c=[];}if(!(stats[_0xef34('0x64')]%0xc8)){socket[_0xef34('0x65')](_0xef34('0x66')+_0xbf0552,stats);stats[_0xef34('0x43')]=[];}}if(stopped){logger[_0xef34('0x3e')](_0xef34('0x67'));_0x2399d1[_0xef34('0x68')]();}}catch(_0x3462e4){handleError(_0x4793f6[_0xef34('0x53')][_0x13a4d9],{'code':_0xef34('0x69'),'message':_0x3462e4[_0xef34('0x41')]});logger[_0xef34('0x40')]('step',_0x3462e4[_0xef34('0x41')]);}},'complete':function(){try{var _0x204e60=[];var _0xa01d1f=_0xef34('0x24');if(_0x31e6f9[_0xef34('0x6a')]&&_0x31e6f9[_0xef34('0x6a')][_0xef34('0x52')]){_0xa01d1f=_0xef34('0x6b')+_0xbf0552;_0x204e60[_0xef34('0x47')]('CREATE\x20TABLE\x20'+_0xa01d1f+_0xef34('0x6c'));}var _0x4c9864=util[_0xef34('0xd')]('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',_0x565b46,_0xa01d1f,_0x36cff2,_0x31e6f9[_0xef34('0x2f')],_0x31e6f9['CompanyId']||null,NOW,NOW);if(_[_0xef34('0x6d')](_0x46489f['scheduledat'])){_0x4c9864+=_0xef34('0x6e');}_0x204e60['push'](_0x4c9864);if(_0x31e6f9[_0xef34('0x6a')]&&_0x31e6f9['duplicates'][_0xef34('0x52')]){_0x204e60[_0xef34('0x47')](insertCmContact(_0x31e6f9[_0xef34('0x2f')],_0xa01d1f,_0x31e6f9['duplicates'],_0x46489f));_0x204e60['push'](_0xef34('0x6f')+_0xa01d1f+';');}_0x204e60[_0xef34('0x47')](insertCmHopper(_0x31e6f9['ListId'],_0xef34('0x70'),_0xef34('0x71'),_0xef34('0x72'),_0x2fd44f));_0x204e60[_0xef34('0x47')](insertCmHopperBlack(_0x31e6f9[_0xef34('0x2f')],_0xef34('0x73'),_0xef34('0x71'),'VoiceQueueId'));_0x204e60[_0xef34('0x47')](insertCmHopper(_0x31e6f9[_0xef34('0x2f')],_0xef34('0x74'),_0xef34('0x75'),_0xef34('0x76'),_0x2fd44f));_0x204e60[_0xef34('0x47')](insertCmHopperBlack(_0x31e6f9['ListId'],_0xef34('0x77'),_0xef34('0x75'),_0xef34('0x76')));BPromise[_0xef34('0x78')](_0x204e60,handleQuery)[_0xef34('0x79')](function(_0x7ec132){stats[_0xef34('0x7a')]=!![];stats[_0xef34('0x7b')]=_0x31e6f9[_0xef34('0x6a')]&&_0x31e6f9[_0xef34('0x6a')][_0xef34('0x52')]?results[0x2][_0xef34('0x7b')]:results[0x0][_0xef34('0x7b')];socket[_0xef34('0x65')]('contact:import:'+_0xbf0552,stats);fs[_0xef34('0x7c')](_0x34c426);fs[_0xef34('0x7c')](_0x565b46);process[_0xef34('0x42')](0x0);})[_0xef34('0x48')](function(_0x209d8e){logger[_0xef34('0x40')](_0x209d8e[_0xef34('0x41')]);process[_0xef34('0x42')](0x1);});}catch(_0x18ff2f){logger[_0xef34('0x40')]('complete',_0x18ff2f[_0xef34('0x41')]);process[_0xef34('0x42')](0x1);}},'error':function(_0x1245c6,_0x366aec,_0x3616de,_0x193b20){throw new Error(_0x193b20);}});}function validate(){if(process[_0xef34('0x7d')]&&process[_0xef34('0x7d')][_0xef34('0x52')]<0x4){throw new Error(_0xef34('0x7e'));}var _0x45e82a=path[_0xef34('0x13')](config[_0xef34('0x4c')],'server/files/tmp',process[_0xef34('0x7d')][0x2]);if(!fs[_0xef34('0x7f')](_0x45e82a)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x276d69={};try{_0x276d69=JSON[_0xef34('0x51')](process['argv'][0x3]);if(!_0x276d69[_0xef34('0x4a')]){throw new Error(_0xef34('0x80'));}if(!_0x276d69[_0xef34('0x4a')]['phone']){throw new Error(_0xef34('0x81'));}if(!_0x276d69[_0xef34('0x4a')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x55fd68=0x0;if(_0x276d69[_0xef34('0x4a')]['UserId']){_0x55fd68=0x1;}if(!_0x276d69[_0xef34('0x2f')]){throw new Error(_0xef34('0x82'));}}catch(_0x28684b){throw new Error(_0xef34('0x83'));}var _0x2c0c1b=[];try{_0x2c0c1b=_[_0xef34('0x84')](JSON[_0xef34('0x51')](process[_0xef34('0x7d')][0x4]),'id');}catch(_0x15916f){logger[_0xef34('0x3e')]('No\x20agent\x20available');}main(_0x45e82a,_0x276d69,_0x2c0c1b,_0x55fd68);}validate();process['on'](_0xef34('0x85'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x3b1a=['campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','insert','cm_hopper_black','.CmListId','\x20=\x20?','concat','keys','CompanyId','fromQuery',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','push','code','message','sequelize','query','spread','catch','main','stringify','send','start','socket_timestamp','root','server/files/tmp','header','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','error','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId'];(function(_0x758679,_0x5da254){var _0x232303=function(_0x4f8dc5){while(--_0x4f8dc5){_0x758679['push'](_0x758679['shift']());}};_0x232303(++_0x5da254);}(_0x3b1a,0x9e));var _0xa3b1=function(_0x22c50e,_0x4ea131){_0x22c50e=_0x22c50e-0x0;var _0x500f85=_0x3b1a[_0x22c50e];return _0x500f85;};'use strict';var fs=require('fs');var path=require(_0xa3b1('0x0'));var _=require(_0xa3b1('0x1'));var Papa=require(_0xa3b1('0x2'));var util=require(_0xa3b1('0x3'));var BPromise=require(_0xa3b1('0x4'));var moment=require(_0xa3b1('0x5'));var squel=require(_0xa3b1('0x6'));var Redis=require('ioredis');var db=require(_0xa3b1('0x7'))['db'];var config=require(_0xa3b1('0x8'));var logger=require(_0xa3b1('0x9'))('import');config[_0xa3b1('0xa')]=_[_0xa3b1('0xb')](config[_0xa3b1('0xa')],{'host':_0xa3b1('0xc'),'port':0x18eb});var socket=require(_0xa3b1('0xd'))(new Redis(config[_0xa3b1('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa3b1('0xe')](_0xa3b1('0xf'));function isEmail(_0x2157cd){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))*$/[_0xa3b1('0x10')](_0x2157cd);}function selectNotIn(_0x15c496,_0xde9c8d,_0x55deba,_0x451618,_0x5fc72){return squel['select']()[_0xa3b1('0x11')](_0xa3b1('0x12'))['from'](_0x451618)[_0xa3b1('0x13')](_0xde9c8d,null,_0xde9c8d+_0xa3b1('0x14')+_0x451618+'.'+_0x55deba)[_0xa3b1('0x15')](_0x451618+'.'+_0x55deba+_0xa3b1('0x16')+_0x15c496+'.'+_0x55deba)[_0xa3b1('0x15')](_0xde9c8d+_0xa3b1('0x17')+_0x5fc72[_0xa3b1('0x13')]()+')');}function insertCmHopper(_0x2294bb,_0x48a4c3,_0x3f32a3,_0x4f6fc0,_0x4b9875){var _0x366474=['cm_contacts.phone',_0xa3b1('0x18'),_0xa3b1('0x19'),_0xa3b1('0x1a'),_0x48a4c3+'.'+_0x4f6fc0,_0xa3b1('0x1b'),_0xa3b1('0x1c'),_0xa3b1('0x1d'),_0xa3b1('0x1e'),'\x22'+_0x4b9875+'\x22'];return squel['insert']()[_0xa3b1('0x1f')](_0xa3b1('0x20'))['fromQuery'](['phone',_0xa3b1('0x21'),_0xa3b1('0x22'),_0xa3b1('0x23'),_0x4f6fc0,_0xa3b1('0x24'),_0xa3b1('0x25'),_0xa3b1('0x26'),_0xa3b1('0x27'),_0xa3b1('0x28')],squel[_0xa3b1('0x29')]()[_0xa3b1('0x2a')](_0x366474)[_0xa3b1('0x2b')](_0x48a4c3)[_0xa3b1('0x13')](_0xa3b1('0x2c'),null,_0xa3b1('0x2d')+_0x48a4c3+'.CmListId')[_0xa3b1('0x13')](_0x3f32a3,null,_0x3f32a3+_0xa3b1('0x14')+_0x48a4c3+'.'+_0x4f6fc0)[_0xa3b1('0x15')](_0x48a4c3+_0xa3b1('0x2e'),_0x2294bb)[_0xa3b1('0x15')](_0xa3b1('0x2f'),NOW)[_0xa3b1('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x48a4c3,_0x3f32a3,_0x4f6fc0,'cm_hopper',['\x22always\x22',_0xa3b1('0x30')]))[_0xa3b1('0x15')](_0xa3b1('0x31'),selectNotIn(_0x48a4c3,_0x3f32a3,_0x4f6fc0,'cm_hopper',[_0xa3b1('0x32')])))[_0xa3b1('0x33')]();}function insertCmHopperBlack(_0x5d29a5,_0x58b8a0,_0x5b0a79,_0x58a9af){var _0x382c7b=[_0xa3b1('0x34'),_0xa3b1('0x19'),_0xa3b1('0x1a'),_0x58b8a0+'.'+_0x58a9af,_0xa3b1('0x1b'),'cm_contacts.updatedAt'];return squel[_0xa3b1('0x35')]()[_0xa3b1('0x1f')](_0xa3b1('0x36'))['fromQuery']([_0xa3b1('0x12'),_0xa3b1('0x22'),_0xa3b1('0x23'),_0x58a9af,_0xa3b1('0x24'),_0xa3b1('0x25')],squel['select']()[_0xa3b1('0x2a')](_0x382c7b)[_0xa3b1('0x2b')](_0x58b8a0)[_0xa3b1('0x13')](_0xa3b1('0x2c'),null,_0xa3b1('0x2d')+_0x58b8a0+_0xa3b1('0x37'))[_0xa3b1('0x13')](_0x5b0a79,null,_0x5b0a79+_0xa3b1('0x14')+_0x58b8a0+'.'+_0x58a9af)[_0xa3b1('0x15')](_0x58b8a0+_0xa3b1('0x2e'),_0x5d29a5)[_0xa3b1('0x15')](_0xa3b1('0x2f'),NOW)[_0xa3b1('0x15')](_0xa3b1('0x31'),squel[_0xa3b1('0x29')]()['field']('phone')[_0xa3b1('0x2b')](_0xa3b1('0x36'))['where']('ListId\x20=\x20?',_0x5d29a5)[_0xa3b1('0x15')](_0x58a9af+_0xa3b1('0x38'),_0x58b8a0+'.'+_0x58a9af)))['toString']();}function insertCmContact(_0x40609f,_0xe5c634,_0x36266d,_0x4dcd0b){var _0x5b848b=_[_0xa3b1('0x39')](_[_0xa3b1('0x3a')](_0x4dcd0b),['ListId',_0xa3b1('0x3b'),_0xa3b1('0x24'),_0xa3b1('0x25')]);return squel[_0xa3b1('0x35')]()[_0xa3b1('0x1f')](_0xa3b1('0x2c'))[_0xa3b1('0x3c')](_0x5b848b,squel['select']()[_0xa3b1('0x2a')](_0x5b848b)[_0xa3b1('0x2b')](_0xe5c634)[_0xa3b1('0x15')]('('+_0x36266d['join'](',')+_0xa3b1('0x3d'),squel[_0xa3b1('0x29')]()[_0xa3b1('0x2a')](_0x36266d)['from'](_0xa3b1('0x2c'))[_0xa3b1('0x15')]('ListId\x20=\x20?',_0x40609f)[_0xa3b1('0x15')](_0xa3b1('0x3e')))[_0xa3b1('0x15')]('id\x20IN\x20?',squel[_0xa3b1('0x29')]()[_0xa3b1('0x11')](_0xa3b1('0x3f'),_0xa3b1('0x40'))[_0xa3b1('0x2b')](_0xe5c634)[_0xa3b1('0x41')](_0x36266d[_0xa3b1('0x13')](','))))['toString']();}function handleStop(){logger[_0xa3b1('0x42')](_0xa3b1('0x43'));stopped=!![];}function handleUncaughtException(_0x2760d0){logger['error'](_0x2760d0['message']);process[_0xa3b1('0x44')](0x1);}function handleError(_0x47cc90,_0x1df625){stats[_0xa3b1('0x45')][_0xa3b1('0x46')]({'name':_0x1df625[_0xa3b1('0x47')],'message':_0x1df625[_0xa3b1('0x48')],'row':_0x47cc90});}function handleQuery(_0x491fc9){logger['info'](_0x491fc9);return db[_0xa3b1('0x49')][_0xa3b1('0x4a')](_0x491fc9)[_0xa3b1('0x4b')](function(_0x47c5c1){results[_0xa3b1('0x46')](_0x47c5c1);})[_0xa3b1('0x4c')](function(_0x22f4d9){logger['error'](_0x22f4d9['message']);});}function main(_0xeaa18e,_0x5332cc,_0x2d7310,_0xfb035d){logger['info'](_0xa3b1('0x4d'),_0xeaa18e,JSON[_0xa3b1('0x4e')](_0x5332cc));process[_0xa3b1('0x4f')](_0xa3b1('0x50'));var _0x3f21a4=_0x5332cc['binding'];var _0x2ca6d0=_0x5332cc[_0xa3b1('0x51')];var _0x9ed121=path[_0xa3b1('0x13')](config[_0xa3b1('0x52')],_0xa3b1('0x53'),_0x2ca6d0+'.csv');var _0x48ca35=_[_0xa3b1('0x3a')](_0x3f21a4)[_0xa3b1('0x13')]();logger[_0xa3b1('0x42')](_0xa3b1('0x54'),_0x48ca35);fs['writeFileSync'](_0x9ed121,_0x48ca35+'\x0a');Papa[_0xa3b1('0x55')](fs[_0xa3b1('0x56')](_0xeaa18e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x487607,_0x5d1b6d){try{for(var _0x26e4fe=0x0,_0x539fa6=[];_0x26e4fe<_0x487607[_0xa3b1('0x57')][_0xa3b1('0x58')];_0x26e4fe++){stats[_0xa3b1('0x59')]+=0x1;if(_0x487607[_0xa3b1('0x45')][_0x26e4fe]){handleError(_0x487607['data'][_0x26e4fe],_0x487607['errors'][_0x26e4fe]);}else{var _0x195d72=[];for(var _0x333817 in _0x3f21a4){if(_0x3f21a4[_0xa3b1('0x5a')](_0x333817)){if(_0x487607[_0xa3b1('0x57')][_0x26e4fe][_0x3f21a4[_0x333817]]){var _0x22a810=_[_0xa3b1('0x5b')](_0x487607[_0xa3b1('0x57')][_0x26e4fe][_0x3f21a4[_0x333817]][_0xa3b1('0x5c')](/"/g,'\x27'));switch(_0x333817){case'scheduledat':var _0x4e1711=moment(_0x22a810,_0xa3b1('0xf'),!![]);if(_0x4e1711[_0xa3b1('0x5d')]()){_0x539fa6[_0xa3b1('0x46')]('\x22'+_0x22a810+'\x22');}else{_0x195d72[_0xa3b1('0x46')](_0xa3b1('0x5e'));}break;case _0xa3b1('0x26'):var _0xfb07ad=parseInt(_0x22a810);_0x22a810=_[_0xa3b1('0x5f')](_0xfb07ad)||_0xfb07ad<0x0||_0xfb07ad>0x4?_0xfb035d?0x3:0x2:_0xfb07ad;_0x539fa6['push']('\x22'+_0x22a810+'\x22');break;case _0xa3b1('0x27'):var _0x3e4211=parseInt(_0x22a810);if(_[_0xa3b1('0x60')](_0x3e4211)&&_[_0xa3b1('0x61')](_0x2d7310,_0x3e4211)){_0x539fa6['push']('\x22'+_0x3e4211+'\x22');}else{_0x195d72['push'](_0xa3b1('0x62'));}break;case'email':if(isEmail(_0x22a810)){_0x539fa6[_0xa3b1('0x46')]('\x22'+_0x22a810+'\x22');}else{_0x195d72[_0xa3b1('0x46')](_0xa3b1('0x63'));}break;case'dateOfBirth':var _0x171a76=moment(_0x22a810,_0xa3b1('0x64'),!![]);if(_0x171a76[_0xa3b1('0x5d')]()){_0x539fa6['push']('\x22'+_0x22a810+'\x22');}else{_0x195d72['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x539fa6[_0xa3b1('0x46')]('\x22'+_0x22a810+'\x22');}}else{switch(_0x333817){case _0xa3b1('0x65'):case _0xa3b1('0x12'):_0x195d72['push'](_0x333817+_0xa3b1('0x66'));break;default:_0x539fa6[_0xa3b1('0x46')]('\x22\x22');}}}}if(_0x195d72[_0xa3b1('0x58')]){handleError(_0x487607[_0xa3b1('0x57')][_0x26e4fe],{'code':_0xa3b1('0x67'),'message':_0x195d72[_0xa3b1('0x13')]()});}else{fs[_0xa3b1('0x68')](_0x9ed121,_0x539fa6['join']()+'\x0a');}_0x539fa6=[];}if(!(stats[_0xa3b1('0x59')]%0xc8)){socket[_0xa3b1('0x69')](_0xa3b1('0x6a')+_0x2ca6d0,stats);stats[_0xa3b1('0x45')]=[];}}if(stopped){logger[_0xa3b1('0x42')]('Abort\x20parser');_0x5d1b6d['abort']();}}catch(_0x2bd70c){handleError(_0x487607[_0xa3b1('0x57')][_0x26e4fe],{'code':'SystemError','message':_0x2bd70c['message']});logger[_0xa3b1('0x6b')]('step',_0x2bd70c[_0xa3b1('0x48')]);}},'complete':function(){try{var _0x328a70=[];var _0x20ec07=_0xa3b1('0x2c');if(_0x5332cc['duplicates']&&_0x5332cc[_0xa3b1('0x6c')][_0xa3b1('0x58')]){_0x20ec07='cm_contacts_'+_0x2ca6d0;_0x328a70[_0xa3b1('0x46')](_0xa3b1('0x6d')+_0x20ec07+_0xa3b1('0x6e'));}var _0x591f72=util[_0xa3b1('0xe')](_0xa3b1('0x6f'),_0x9ed121,_0x20ec07,_0x48ca35,_0x5332cc[_0xa3b1('0x23')],_0x5332cc[_0xa3b1('0x3b')]||null,NOW,NOW);if(_[_0xa3b1('0x70')](_0x3f21a4[_0xa3b1('0x21')])){_0x591f72+=_0xa3b1('0x71');}_0x328a70['push'](_0x591f72);if(_0x5332cc['duplicates']&&_0x5332cc['duplicates']['length']){_0x328a70['push'](insertCmContact(_0x5332cc[_0xa3b1('0x23')],_0x20ec07,_0x5332cc[_0xa3b1('0x6c')],_0x3f21a4));_0x328a70[_0xa3b1('0x46')](_0xa3b1('0x72')+_0x20ec07+';');}_0x328a70[_0xa3b1('0x46')](insertCmHopper(_0x5332cc['ListId'],_0xa3b1('0x73'),_0xa3b1('0x74'),_0xa3b1('0x75'),_0xfb035d));_0x328a70['push'](insertCmHopperBlack(_0x5332cc[_0xa3b1('0x23')],_0xa3b1('0x76'),_0xa3b1('0x74'),_0xa3b1('0x75')));_0x328a70[_0xa3b1('0x46')](insertCmHopper(_0x5332cc[_0xa3b1('0x23')],_0xa3b1('0x77'),_0xa3b1('0x78'),_0xa3b1('0x79'),_0xfb035d));_0x328a70['push'](insertCmHopperBlack(_0x5332cc['ListId'],_0xa3b1('0x7a'),_0xa3b1('0x78'),_0xa3b1('0x79')));BPromise[_0xa3b1('0x7b')](_0x328a70,handleQuery)[_0xa3b1('0x7c')](function(_0x4c40a4){stats[_0xa3b1('0x7d')]=!![];stats['affectedRows']=_0x5332cc[_0xa3b1('0x6c')]&&_0x5332cc[_0xa3b1('0x6c')]['length']?results[0x2][_0xa3b1('0x7e')]:results[0x0]['affectedRows'];socket[_0xa3b1('0x69')](_0xa3b1('0x6a')+_0x2ca6d0,stats);fs[_0xa3b1('0x7f')](_0xeaa18e);fs[_0xa3b1('0x7f')](_0x9ed121);process[_0xa3b1('0x44')](0x0);})[_0xa3b1('0x4c')](function(_0x559e18){logger[_0xa3b1('0x6b')](_0x559e18[_0xa3b1('0x48')]);process[_0xa3b1('0x44')](0x1);});}catch(_0x5c182c){logger['error'](_0xa3b1('0x80'),_0x5c182c[_0xa3b1('0x48')]);process[_0xa3b1('0x44')](0x1);}},'error':function(_0x5a0c8a,_0x54f443,_0x1cd32b,_0xd10846){throw new Error(_0xd10846);}});}function validate(){if(process[_0xa3b1('0x81')]&&process[_0xa3b1('0x81')][_0xa3b1('0x58')]<0x4){throw new Error(_0xa3b1('0x82'));}var _0x2208eb=path[_0xa3b1('0x13')](config[_0xa3b1('0x52')],'server/files/tmp',process[_0xa3b1('0x81')][0x2]);if(!fs[_0xa3b1('0x83')](_0x2208eb)){throw new Error(_0xa3b1('0x84'));}var _0x8c830e={};try{_0x8c830e=JSON[_0xa3b1('0x55')](process[_0xa3b1('0x81')][0x3]);if(!_0x8c830e[_0xa3b1('0x85')]){throw new Error(_0xa3b1('0x86'));}if(!_0x8c830e[_0xa3b1('0x85')][_0xa3b1('0x12')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x8c830e[_0xa3b1('0x85')][_0xa3b1('0x65')]){throw new Error('firstName\x20is\x20mandatory');}var _0x50fcf0=0x0;if(_0x8c830e[_0xa3b1('0x85')][_0xa3b1('0x27')]){_0x50fcf0=0x1;}if(!_0x8c830e[_0xa3b1('0x23')]){throw new Error(_0xa3b1('0x87'));}}catch(_0x3a73ce){throw new Error(_0xa3b1('0x88'));}var _0x25ce2b=[];try{_0x25ce2b=_['map'](JSON[_0xa3b1('0x55')](process[_0xa3b1('0x81')][0x4]),'id');}catch(_0xcd05ea){logger[_0xa3b1('0x42')](_0xa3b1('0x89'));}main(_0x2208eb,_0x8c830e,_0x25ce2b,_0x50fcf0);}validate();process['on'](_0xa3b1('0x8a'),handleStop);process['on'](_0xa3b1('0x8b'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 17ea58f..f18cac1 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 _0x295b=['Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','agentconnectAt','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','calleridnum','outbound','push','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','queue','UniqueId','uniqueid','Date'];(function(_0x3815b2,_0xdeaa84){var _0x2ebd79=function(_0x4ed85a){while(--_0x4ed85a){_0x3815b2['push'](_0x3815b2['shift']());}};_0x2ebd79(++_0xdeaa84);}(_0x295b,0x64));var _0xb295=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x295b[_0x476bf4];return _0x788ffe;};'use strict';exports[_0xb295('0x0')]=function(_0x3acb7a,_0x69a02b){var _0x2fe5b8=[{'type':_0xb295('0x1'),'content':_0xb295('0x2'),'variableName':null}];switch(_0x3acb7a[_0xb295('0x3')]()){case _0xb295('0x4'):switch(_0x69a02b[_0xb295('0x3')]()){case _0xb295('0x5'):_0x2fe5b8['push']({'type':_0xb295('0x6'),'content':'','variableName':'queue'});_0x2fe5b8['push']({'type':'variable','content':'','variableName':_0xb295('0x7')});break;case _0xb295('0x8'):_0x2fe5b8[_0xb295('0x9')]({'type':_0xb295('0x1'),'content':_0xb295('0xa'),'variableName':null});_0x2fe5b8[_0xb295('0x9')]({'type':_0xb295('0x6'),'content':'','variableName':_0xb295('0xb')});break;}}return _0x2fe5b8;};exports[_0xb295('0xc')]=function(_0x502645,_0x2e1b12){var _0x106158=[];switch(_0x502645['toLowerCase']()){case _0xb295('0x4'):switch(_0x2e1b12[_0xb295('0x3')]()){case _0xb295('0x5'):_0x106158=[{'type':_0xb295('0x1'),'content':_0xb295('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xb295('0xe'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0xb295('0x7')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0xf'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x10')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x11'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x12')},{'type':_0xb295('0xe'),'content':'','key':'Queue','keyType':_0xb295('0x6'),'variableName':_0xb295('0x13')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x14'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x15')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x16'),'keyType':_0xb295('0x6'),'variableName':'agentcalledAt'},{'type':_0xb295('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x17'),'keyType':_0xb295('0x6'),'variableName':'destcalleridname'},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x18'),'keyType':_0xb295('0x6'),'variableName':'destcalleridnum'},{'type':_0xb295('0x1'),'content':_0xb295('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xb295('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1a')},{'type':_0xb295('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1b')},{'type':_0xb295('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1c')},{'type':_0xb295('0xe'),'content':'','key':'Hold\x20Time','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1d')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x1e'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x1f')}];break;case _0xb295('0x8'):_0x106158=[{'type':'string','content':_0xb295('0xd'),'variableName':null},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x20'),'keyType':'variable','keyContent':'','variableName':_0xb295('0xb')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x21'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x14'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x15')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x16'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x22')},{'type':_0xb295('0x1'),'content':_0xb295('0x19')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x23'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xb295('0x24'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x25')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x26'),'keyType':'variable','keyContent':'','variableName':_0xb295('0x27')},{'type':_0xb295('0xe'),'content':'','key':'Billable\x20Time','keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x28')}];break;}}return _0x106158;}; \ No newline at end of file +var _0x1d64=['inbound','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','keyValue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice'];(function(_0x1d1f94,_0x43e0b6){var _0x1568cc=function(_0x55c400){while(--_0x55c400){_0x1d1f94['push'](_0x1d1f94['shift']());}};_0x1568cc(++_0x43e0b6);}(_0x1d64,0x80));var _0x41d6=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x1d64[_0x507ac5];return _0x12c1bc;};'use strict';exports[_0x41d6('0x0')]=function(_0x1c59e7,_0x4a43a6){var _0x438b4c=[{'type':_0x41d6('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1c59e7[_0x41d6('0x2')]()){case _0x41d6('0x3'):switch(_0x4a43a6[_0x41d6('0x2')]()){case _0x41d6('0x4'):_0x438b4c[_0x41d6('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x438b4c[_0x41d6('0x5')]({'type':_0x41d6('0x6'),'content':'','variableName':_0x41d6('0x7')});break;case _0x41d6('0x8'):_0x438b4c['push']({'type':'string','content':_0x41d6('0x9'),'variableName':null});_0x438b4c[_0x41d6('0x5')]({'type':_0x41d6('0x6'),'content':'','variableName':_0x41d6('0xa')});break;}}return _0x438b4c;};exports[_0x41d6('0xb')]=function(_0x4d0928,_0x1f816b){var _0x3a561b=[];switch(_0x4d0928[_0x41d6('0x2')]()){case _0x41d6('0x3'):switch(_0x1f816b['toLowerCase']()){case _0x41d6('0x4'):_0x3a561b=[{'type':_0x41d6('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x41d6('0xc'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0x7')},{'type':'keyValue','content':'','key':_0x41d6('0xd'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0xe')},{'type':'keyValue','content':'','key':_0x41d6('0xf'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0x10')},{'type':_0x41d6('0x11'),'content':'','key':'Queue','keyType':_0x41d6('0x6'),'variableName':_0x41d6('0x12')},{'type':'keyValue','content':'','key':_0x41d6('0x13'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0x14')},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x15'),'keyType':'variable','variableName':_0x41d6('0x16')},{'type':_0x41d6('0x1'),'content':_0x41d6('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x18'),'keyType':_0x41d6('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x41d6('0x19'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0xa')},{'type':_0x41d6('0x1'),'content':_0x41d6('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x1b'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0x16')},{'type':'keyValue','content':'','key':_0x41d6('0x1c'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0x1d')},{'type':_0x41d6('0x11'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0x41d6('0x1e')},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x1f'),'keyType':_0x41d6('0x6'),'variableName':_0x41d6('0x20')},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x21'),'keyType':_0x41d6('0x6'),'variableName':'talktime'}];break;case _0x41d6('0x8'):_0x3a561b=[{'type':_0x41d6('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x41d6('0x11'),'content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x22'),'keyType':'variable','keyContent':'','variableName':_0x41d6('0x23')},{'type':'keyValue','content':'','key':_0x41d6('0x13'),'keyType':_0x41d6('0x6'),'keyContent':'','variableName':_0x41d6('0x14')},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x15'),'keyType':_0x41d6('0x6'),'keyContent':'','variableName':_0x41d6('0x24')},{'type':_0x41d6('0x1'),'content':_0x41d6('0x1a')},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x25'),'keyType':_0x41d6('0x6'),'keyContent':'','variableName':_0x41d6('0x26')},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x27'),'keyType':'variable','keyContent':'','variableName':_0x41d6('0x28')},{'type':'keyValue','content':'','key':_0x41d6('0x29'),'keyType':_0x41d6('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x41d6('0x11'),'content':'','key':_0x41d6('0x2a'),'keyType':_0x41d6('0x6'),'keyContent':'','variableName':_0x41d6('0x2b')}];break;}}return _0x3a561b;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 32018ea..d4d07b3 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 _0x897d=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId'];(function(_0x5f138f,_0x2592e6){var _0x38b3f1=function(_0x7b43b8){while(--_0x7b43b8){_0x5f138f['push'](_0x5f138f['shift']());}};_0x38b3f1(++_0x2592e6);}(_0x897d,0x82));var _0xd897=function(_0x412a65,_0x33a276){_0x412a65=_0x412a65-0x0;var _0x5a03bf=_0x897d[_0x412a65];return _0x5a03bf;};'use strict';var _=require(_0xd897('0x0'));var db=require(_0xd897('0x1'))['db'];var loggers={'openchannel':require(_0xd897('0x2'))('openchannel-interactions'),'mail':require(_0xd897('0x2'))(_0xd897('0x3')),'fax':require('../../config/logger')(_0xd897('0x4')),'sms':require(_0xd897('0x2'))(_0xd897('0x5')),'chat':require(_0xd897('0x2'))(_0xd897('0x6')),'whatsapp':require('../../config/logger')(_0xd897('0x7'))};function getInteractionId(_0x54e66d,_0x1db548,_0x42b05a){if(_0x54e66d&&_0x54e66d[_[_0xd897('0x8')](_0x42b05a)+_0xd897('0x9')]){return _0x54e66d[_['upperFirst'](_0x42b05a)+_0xd897('0x9')];}else if(_0x54e66d&&_0x54e66d['id']){return _0x54e66d['id'];}else if(_0x1db548&&_0x1db548['id']){return _0x1db548['id'];}else{return _0xd897('0xa');}}function log(_0x296863,_0x50abb1,_0x447e55,_0x26bbe2,_0x59f622,_0x3deb8d){loggers[_0x59f622[_0xd897('0xb')]()][_0x296863](_0xd897('0xc'),_0x3deb8d[_0xd897('0xd')](),_0x50abb1?_0x50abb1['id']:null,_0x50abb1?_0x50abb1[_0xd897('0xe')]:null,_0x50abb1?_0x50abb1[_0xd897('0xf')]:null,getInteractionId(_0x447e55,_0x26bbe2,_0x59f622),_0x447e55?JSON[_0xd897('0x10')](_0x447e55):_0xd897('0x11'));}function updateUser(_0x2bed98,_0x543ff5,_0x5a91,_0x235c7b,_0x2f73b2){db[_[_0xd897('0x8')](_0x235c7b)+_0xd897('0x12')][_0xd897('0x13')]({'where':{'id':getInteractionId(_0x543ff5,_0x5a91,_0x235c7b)}})[_0xd897('0x14')](function(_0x5b8066){if(_0x5b8066){return _0x5b8066[_0xd897('0x15')]({'UserId':_0x2bed98?_0x2bed98['id']:null});}})[_0xd897('0x14')](function(_0x433191){if(_0x433191){log(_0xd897('0x16'),_0x2bed98,_0x543ff5,_0x5a91,_0x235c7b,_0x2f73b2);}})[_0xd897('0x17')](function(){log(_0xd897('0x18'),_0x2bed98,_0x543ff5,_0x5a91,_0x235c7b,_0x2f73b2);});}exports[_0xd897('0x19')]=function(_0x50a780,_0x530052){return function(_0x58646c,_0x29b61b,_0x38c3f5){var _0x3b0e3e=_0x58646c[_0xd897('0x1a')];var _0x15f308={};var _0xf8c12a=_0x58646c[_0xd897('0x1b')];if(_0x15f308){_0x15f308=_[_0xd897('0x1c')](_0x58646c[_0xd897('0x1d')]);_0x15f308=_[_0xd897('0x1e')](_0x15f308,['body',_0xd897('0x1f'),_0xd897('0x20'),_0xd897('0x21'),_0xd897('0x22')]);}updateUser(_0x3b0e3e,_0x15f308,_0xf8c12a,_0x50a780,_0x530052);_0x38c3f5(null);};}; \ No newline at end of file +var _0xc209=['InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','update','info','catch','tracked','clone','body','omit','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst'];(function(_0x3d6dd5,_0x451e3d){var _0x34ff9c=function(_0x4e287f){while(--_0x4e287f){_0x3d6dd5['push'](_0x3d6dd5['shift']());}};_0x34ff9c(++_0x451e3d);}(_0xc209,0xe7));var _0x9c20=function(_0x4c4886,_0x39860b){_0x4c4886=_0x4c4886-0x0;var _0x1bd682=_0xc209[_0x4c4886];return _0x1bd682;};'use strict';var _=require(_0x9c20('0x0'));var db=require(_0x9c20('0x1'))['db'];var loggers={'openchannel':require(_0x9c20('0x2'))(_0x9c20('0x3')),'mail':require(_0x9c20('0x2'))(_0x9c20('0x4')),'fax':require(_0x9c20('0x2'))('fax-interactions'),'sms':require(_0x9c20('0x2'))(_0x9c20('0x5')),'chat':require(_0x9c20('0x2'))(_0x9c20('0x6')),'whatsapp':require(_0x9c20('0x2'))(_0x9c20('0x7'))};function getInteractionId(_0x2053a7,_0x2e62f9,_0x242ab8){if(_0x2053a7&&_0x2053a7[_[_0x9c20('0x8')](_0x242ab8)+_0x9c20('0x9')]){return _0x2053a7[_[_0x9c20('0x8')](_0x242ab8)+_0x9c20('0x9')];}else if(_0x2053a7&&_0x2053a7['id']){return _0x2053a7['id'];}else if(_0x2e62f9&&_0x2e62f9['id']){return _0x2e62f9['id'];}else{return _0x9c20('0xa');}}function log(_0x3d4c6e,_0x25dc51,_0x1749d6,_0x4b122d,_0x3c3d66,_0x103efc){loggers[_0x3c3d66[_0x9c20('0xb')]()][_0x3d4c6e](_0x9c20('0xc'),_0x103efc[_0x9c20('0xd')](),_0x25dc51?_0x25dc51['id']:null,_0x25dc51?_0x25dc51[_0x9c20('0xe')]:null,_0x25dc51?_0x25dc51[_0x9c20('0xf')]:null,getInteractionId(_0x1749d6,_0x4b122d,_0x3c3d66),_0x1749d6?JSON[_0x9c20('0x10')](_0x1749d6):_0x9c20('0x11'));}function updateUser(_0x3510e1,_0x1c0ff9,_0x4da55e,_0x1e1f86,_0x18dcac){db[_[_0x9c20('0x8')](_0x1e1f86)+_0x9c20('0x12')][_0x9c20('0x13')]({'where':{'id':getInteractionId(_0x1c0ff9,_0x4da55e,_0x1e1f86)}})['then'](function(_0x2d45a4){if(_0x2d45a4){return _0x2d45a4[_0x9c20('0x14')]({'UserId':_0x3510e1?_0x3510e1['id']:null});}})['then'](function(_0x48684b){if(_0x48684b){log(_0x9c20('0x15'),_0x3510e1,_0x1c0ff9,_0x4da55e,_0x1e1f86,_0x18dcac);}})[_0x9c20('0x16')](function(){log('error',_0x3510e1,_0x1c0ff9,_0x4da55e,_0x1e1f86,_0x18dcac);});}exports[_0x9c20('0x17')]=function(_0x432435,_0x5490de){return function(_0x12e4a6,_0x893f81,_0x178870){var _0x1a3187=_0x12e4a6['user'];var _0x29d3a0={};var _0x5f519f=_0x12e4a6['query'];if(_0x29d3a0){_0x29d3a0=_[_0x9c20('0x18')](_0x12e4a6[_0x9c20('0x19')]);_0x29d3a0=_[_0x9c20('0x1a')](_0x29d3a0,[_0x9c20('0x19'),'html',_0x9c20('0x1b'),_0x9c20('0x1c'),_0x9c20('0x1d')]);}updateUser(_0x1a3187,_0x29d3a0,_0x5f519f,_0x432435,_0x5490de);_0x178870(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 30993fc..52beda8 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 _0x692e=['final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','admin','user','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8'];(function(_0x16b51e,_0x30cb17){var _0x27b91a=function(_0x131411){while(--_0x131411){_0x16b51e['push'](_0x16b51e['shift']());}};_0x27b91a(++_0x30cb17);}(_0x692e,0x137));var _0xe692=function(_0x15f235,_0x4f45e9){_0x15f235=_0x15f235-0x0;var _0x1b3f64=_0x692e[_0x15f235];return _0x1b3f64;};'use strict';var crypto=require('crypto');var util=require(_0xe692('0x0'));var compose=require(_0xe692('0x1'));var db=require(_0xe692('0x2'))['db'];var config=require(_0xe692('0x3'));function getValueFromLicense(_0x251ab4,_0x27693d){if(_0x251ab4&&_0x27693d){if(_0x27693d[_0xe692('0x4')]&&_0x27693d[_0xe692('0x5')]){var _0x5d5405=_0x27693d[_0xe692('0x4')];var _0x234f57=_0x27693d[_0xe692('0x5')];var _0x447616=_0x5d5405[_0xe692('0x6')]('-')[0x4];var _0x1f1800=_0x5d5405[_0xe692('0x6')]('-')[0x0];var _0x195aba=crypto['createDecipher'](_0xe692('0x7'),util[_0xe692('0x8')](_0xe692('0x9'),_0x447616,_0x5d5405,_0x1f1800));var _0x12e7e7=_0x195aba[_0xe692('0xa')](_0x234f57,_0xe692('0xb'),_0xe692('0xc'));_0x12e7e7+=_0x195aba[_0xe692('0xd')]('utf8');var _0xf7052d=JSON[_0xe692('0xe')](_0x12e7e7);return _0xf7052d[_0xe692('0xf')](_0x251ab4)?_0xf7052d[_0x251ab4]:null;}}return null;}function isLimit(_0x2feb8b,_0xf9174e,_0x276b92,_0x1020b3){var _0x12f02a=_0xf9174e;return compose()[_0xe692('0x10')](function(_0x951a3,_0x59c177,_0x5cef2a){return db[_0xe692('0x11')][_0xe692('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xe692('0x13')](function(_0x53605c){var _0x423133=getValueFromLicense(_0x2feb8b,_0x53605c);return _0x423133?_0x423133:_0x12f02a;})[_0xe692('0x13')](function(_0x3ca203){_0x12f02a=_0x3ca203;return _0x276b92[_0xe692('0x14')](_0x1020b3);})[_0xe692('0x13')](function(_0x6aed12){if(_0x6aed12>=_0x12f02a){return _0x59c177[_0xe692('0x15')](0x193)[_0xe692('0x16')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2feb8b)});}_0x5cef2a();})[_0xe692('0x17')](function(_0x93a5d6){_0x5cef2a(_0x93a5d6);});});}function isUserLimit(){return isLimit(_0xe692('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xe692('0x19')},{'role':_0xe692('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xf057=['user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','count','status','json','catch','users','User','admin'];(function(_0x58ee36,_0x2295de){var _0x4d8487=function(_0x5f0944){while(--_0x5f0944){_0x58ee36['push'](_0x58ee36['shift']());}};_0x4d8487(++_0x2295de);}(_0xf057,0x16e));var _0x7f05=function(_0x33d2d5,_0x16b062){_0x33d2d5=_0x33d2d5-0x0;var _0x25fd6a=_0xf057[_0x33d2d5];return _0x25fd6a;};'use strict';var crypto=require(_0x7f05('0x0'));var util=require(_0x7f05('0x1'));var compose=require(_0x7f05('0x2'));var db=require(_0x7f05('0x3'))['db'];var config=require(_0x7f05('0x4'));function getValueFromLicense(_0x40edc4,_0x21d103){if(_0x40edc4&&_0x21d103){if(_0x21d103['data1']&&_0x21d103[_0x7f05('0x5')]){var _0x21759d=_0x21d103[_0x7f05('0x6')];var _0x19e98f=_0x21d103[_0x7f05('0x5')];var _0x4d4940=_0x21759d[_0x7f05('0x7')]('-')[0x4];var _0x474f3f=_0x21759d[_0x7f05('0x7')]('-')[0x0];var _0x420bec=crypto[_0x7f05('0x8')]('aes-256-ctr',util[_0x7f05('0x9')](_0x7f05('0xa'),_0x4d4940,_0x21759d,_0x474f3f));var _0x4b840f=_0x420bec['update'](_0x19e98f,_0x7f05('0xb'),_0x7f05('0xc'));_0x4b840f+=_0x420bec[_0x7f05('0xd')]('utf8');var _0x453fc0=JSON[_0x7f05('0xe')](_0x4b840f);return _0x453fc0[_0x7f05('0xf')](_0x40edc4)?_0x453fc0[_0x40edc4]:null;}}return null;}function isLimit(_0x5cb0d3,_0x2d7cf0,_0x36a040,_0x1b9a1d){var _0x9b7c1d=_0x2d7cf0;return compose()['use'](function(_0x2bf5f3,_0x5b585d,_0x43f927){return db[_0x7f05('0x10')][_0x7f05('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x7f05('0x12')](function(_0x43f77e){var _0x4160d5=getValueFromLicense(_0x5cb0d3,_0x43f77e);return _0x4160d5?_0x4160d5:_0x9b7c1d;})[_0x7f05('0x12')](function(_0x438fa7){_0x9b7c1d=_0x438fa7;return _0x36a040[_0x7f05('0x13')](_0x1b9a1d);})[_0x7f05('0x12')](function(_0x3869e0){if(_0x3869e0>=_0x9b7c1d){return _0x5b585d[_0x7f05('0x14')](0x193)[_0x7f05('0x15')]({'message':util[_0x7f05('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5cb0d3)});}_0x43f927();})[_0x7f05('0x16')](function(_0x47261a){_0x43f927(_0x47261a);});});}function isUserLimit(){return isLimit(_0x7f05('0x17'),0x1,db[_0x7f05('0x18')],{'where':{'$or':[{'role':_0x7f05('0x19')},{'role':_0x7f05('0x1a')}]}});}exports[_0x7f05('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 15677d5..2cc1976 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 _0x67c4=['seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','CAST(','\x20AS\x20','$ne','text','\x20OR\x20','$in','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','$startsWith','pop','hours','minutes'];(function(_0x36329c,_0x761dd7){var _0x3b0dd8=function(_0x1eafb5){while(--_0x1eafb5){_0x36329c['push'](_0x36329c['shift']());}};_0x3b0dd8(++_0x761dd7);}(_0x67c4,0x145));var _0x467c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x67c4[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x467c('0x0'));var moment=require(_0x467c('0x1'));exports[_0x467c('0x2')]=function(_0x12b7de){var _0x59b05d={'conditions':[]};_0x59b05d[_0x467c('0x3')]=_[_0x467c('0x4')](_0x12b7de,_0x467c('0x5'))?'or':_0x467c('0x6');var _0x43511b=_0x12b7de[_0x467c('0x7')](_0x467c('0x8'),'')[_0x467c('0x7')](_0x467c('0x5'),'')[_0x467c('0x9')]('||');for(var _0x5812fe=0x0;_0x5812fe<_0x43511b[_0x467c('0xa')];_0x5812fe++){var _0x210ab9=_0x43511b[_0x5812fe][_0x467c('0x9')](':=');var _0x101cc3=_0x210ab9[0x0];var _0x393370=_0x210ab9[_0x467c('0xb')](0x1);_0x393370[_0x467c('0xc')](function(_0x19ab54){var _0x44e72b=_0x19ab54[_0x467c('0x9')]('[')[_0x467c('0xd')]();var _0x4c7065=_0x19ab54[_0x467c('0xe')](/\[(.*?)\]/g);_0x4c7065[_0x467c('0xc')](function(_0x6c919d){var _0x355168=_0x6c919d['split']('[')[_0x467c('0xf')](function(_0x5280c2){return _0x5280c2[_0x467c('0x10')](']')>-0x1;})[_0x467c('0x11')](function(_0x551ad0){return _0x551ad0[_0x467c('0x9')](']')[0x0];})[0x0];_0x59b05d[_0x467c('0x12')][_0x467c('0x13')]({'field':_0x101cc3,'operator':_0x44e72b,'value':_0x355168});});});}return _0x59b05d;};exports['buildExpression']=function(_0x65030,_0x5edf90,_0x32dbfe){var _0x57478d={};if(_0x5edf90===_0x467c('0x14')){if(_0x32dbfe[_0x467c('0x15')]===_0x467c('0x16')){_0x32dbfe[_0x467c('0x15')]=_0x467c('0x17');_0x32dbfe[_0x467c('0x18')]+=','+_0x32dbfe[_0x467c('0x18')];}else if(_[_0x467c('0x19')]([_0x467c('0x1a'),_0x467c('0x1b')],_0x32dbfe[_0x467c('0x15')])){_0x32dbfe[_0x467c('0x18')]=moment(_0x32dbfe['value'])[_0x467c('0x1c')](0x1,'days')[_0x467c('0x1d')](_0x467c('0x1e'));}}if(_0x32dbfe[_0x467c('0x1f')]){_0x5edf90=_0x32dbfe['castTo'];_0x57478d['text']=_0x467c('0x20')+_0x65030+'.'+_0x32dbfe['field']+_0x467c('0x21')+_0x32dbfe[_0x467c('0x1f')]+')\x20'+parseOperator(_0x32dbfe[_0x467c('0x15')]);}else{_0x57478d['text']=_0x65030+'.'+_0x32dbfe['field']+'\x20'+parseOperator(_0x32dbfe[_0x467c('0x15')]);}if(_[_0x467c('0x19')]([_0x467c('0x22'),'$notIn'],_0x32dbfe['operator']))_0x57478d[_0x467c('0x23')]='('+_0x57478d['text']+_0x467c('0x24')+_0x65030+'.'+_0x32dbfe['field']+'\x20IS\x20NULL)';_0x57478d[_0x467c('0x18')]=parseValue(_0x5edf90,_0x32dbfe[_0x467c('0x15')],_0x32dbfe[_0x467c('0x18')]);return _0x57478d;};function parseOperator(_0x54e4bf){var _0x4fe6ad;switch(_0x54e4bf){case _0x467c('0x25'):_0x4fe6ad='IN\x20?';break;case'$notIn':_0x4fe6ad='NOT\x20IN\x20?';break;case _0x467c('0x16'):_0x4fe6ad='=\x20?';break;case'$ne':_0x4fe6ad=_0x467c('0x26');break;case _0x467c('0x27'):case'$startsWith':case _0x467c('0x28'):_0x4fe6ad=_0x467c('0x29');break;case'$lt':_0x4fe6ad=_0x467c('0x2a');break;case _0x467c('0x1a'):_0x4fe6ad=_0x467c('0x2b');break;case'$lte':_0x4fe6ad='<=\x20?';break;case _0x467c('0x2c'):_0x4fe6ad=_0x467c('0x2d');break;case _0x467c('0x17'):_0x4fe6ad=_0x467c('0x2e');break;}return _0x4fe6ad;}function parseValue(_0x415370,_0xc63d1f,_0x1ed806){var _0x159f32={'start':undefined,'end':undefined};switch(_0xc63d1f){case _0x467c('0x25'):case _0x467c('0x2f'):_0x159f32[_0x467c('0x30')]=_0x1ed806[_0x467c('0x9')](',');break;case _0x467c('0x27'):_0x159f32['start']='%'+_0x1ed806+'%';break;case _0x467c('0x31'):_0x159f32['start']=_0x1ed806+'%';break;case _0x467c('0x28'):_0x159f32[_0x467c('0x30')]='%'+_0x1ed806;break;case'$between':var _0x542834=_0x1ed806[_0x467c('0x9')](',');var _0x1ed806=_0x542834[_0x467c('0xd')]();var _0x4bc538=_0x542834[_0x467c('0x32')]();if(_0x415370===_0x467c('0x14')){_0x1ed806=moment(_0x1ed806)['utcOffset'](0x0,!![])['format']();_0x4bc538=moment(_0x4bc538)['utcOffset'](0x0,!![])[_0x467c('0x1c')](0x17,_0x467c('0x33'))[_0x467c('0x1c')](0x3b,_0x467c('0x34'))[_0x467c('0x1c')](0x3b,_0x467c('0x35'))[_0x467c('0x1d')]();}_0x159f32={'start':_0x1ed806,'end':_0x4bc538};break;default:_0x159f32['start']=_0x1ed806;break;}return _0x159f32;} \ No newline at end of file +var _0xfed8=['YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','>\x20?','$lte','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','slice','forEach','shift','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','$gt','add','format'];(function(_0xd0cc91,_0x24e178){var _0x1f7b0d=function(_0x2ca345){while(--_0x2ca345){_0xd0cc91['push'](_0xd0cc91['shift']());}};_0x1f7b0d(++_0x24e178);}(_0xfed8,0x11f));var _0x8fed=function(_0x2d63f1,_0x418717){_0x2d63f1=_0x2d63f1-0x0;var _0x31f145=_0xfed8[_0x2d63f1];return _0x31f145;};'use strict';var _=require(_0x8fed('0x0'));var moment=require(_0x8fed('0x1'));exports['parseSearch']=function(_0x5166a1){var _0x3b63ef={'conditions':[]};_0x3b63ef[_0x8fed('0x2')]=_[_0x8fed('0x3')](_0x5166a1,_0x8fed('0x4'))?'or':_0x8fed('0x5');var _0x10e2d3=_0x5166a1['replace'](_0x8fed('0x6'),'')[_0x8fed('0x7')](_0x8fed('0x4'),'')[_0x8fed('0x8')]('||');for(var _0x483fcd=0x0;_0x483fcd<_0x10e2d3['length'];_0x483fcd++){var _0x5435f1=_0x10e2d3[_0x483fcd][_0x8fed('0x8')](':=');var _0x2466ee=_0x5435f1[0x0];var _0x5263fb=_0x5435f1[_0x8fed('0x9')](0x1);_0x5263fb[_0x8fed('0xa')](function(_0x10def3){var _0x593b45=_0x10def3['split']('[')[_0x8fed('0xb')]();var _0x5bba5e=_0x10def3['match'](/\[(.*?)\]/g);_0x5bba5e[_0x8fed('0xa')](function(_0x14b2a3){var _0x40d51c=_0x14b2a3[_0x8fed('0x8')]('[')[_0x8fed('0xc')](function(_0x310512){return _0x310512[_0x8fed('0xd')](']')>-0x1;})[_0x8fed('0xe')](function(_0x5dc42b){return _0x5dc42b[_0x8fed('0x8')](']')[0x0];})[0x0];_0x3b63ef[_0x8fed('0xf')]['push']({'field':_0x2466ee,'operator':_0x593b45,'value':_0x40d51c});});});}return _0x3b63ef;};exports[_0x8fed('0x10')]=function(_0x46dacc,_0x1d24e6,_0x3e27ec){var _0x3f732f={};if(_0x1d24e6===_0x8fed('0x11')){if(_0x3e27ec[_0x8fed('0x12')]===_0x8fed('0x13')){_0x3e27ec[_0x8fed('0x12')]=_0x8fed('0x14');_0x3e27ec[_0x8fed('0x15')]+=','+_0x3e27ec[_0x8fed('0x15')];}else if(_['includes']([_0x8fed('0x16'),'$lte'],_0x3e27ec[_0x8fed('0x12')])){_0x3e27ec[_0x8fed('0x15')]=moment(_0x3e27ec[_0x8fed('0x15')])[_0x8fed('0x17')](0x1,'days')[_0x8fed('0x18')](_0x8fed('0x19'));}}if(_0x3e27ec[_0x8fed('0x1a')]){_0x1d24e6=_0x3e27ec[_0x8fed('0x1a')];_0x3f732f[_0x8fed('0x1b')]=_0x8fed('0x1c')+_0x46dacc+'.'+_0x3e27ec[_0x8fed('0x1d')]+'\x20AS\x20'+_0x3e27ec[_0x8fed('0x1a')]+')\x20'+parseOperator(_0x3e27ec[_0x8fed('0x12')]);}else{_0x3f732f[_0x8fed('0x1b')]=_0x46dacc+'.'+_0x3e27ec[_0x8fed('0x1d')]+'\x20'+parseOperator(_0x3e27ec[_0x8fed('0x12')]);}if(_['includes']([_0x8fed('0x1e'),_0x8fed('0x1f')],_0x3e27ec['operator']))_0x3f732f[_0x8fed('0x1b')]='('+_0x3f732f['text']+'\x20OR\x20'+_0x46dacc+'.'+_0x3e27ec[_0x8fed('0x1d')]+_0x8fed('0x20');_0x3f732f[_0x8fed('0x15')]=parseValue(_0x1d24e6,_0x3e27ec['operator'],_0x3e27ec['value']);return _0x3f732f;};function parseOperator(_0x352a8f){var _0xcb402;switch(_0x352a8f){case _0x8fed('0x21'):_0xcb402=_0x8fed('0x22');break;case'$notIn':_0xcb402=_0x8fed('0x23');break;case _0x8fed('0x13'):_0xcb402=_0x8fed('0x24');break;case _0x8fed('0x1e'):_0xcb402=_0x8fed('0x25');break;case _0x8fed('0x26'):case _0x8fed('0x27'):case _0x8fed('0x28'):_0xcb402='LIKE\x20?';break;case _0x8fed('0x29'):_0xcb402='<\x20?';break;case _0x8fed('0x16'):_0xcb402=_0x8fed('0x2a');break;case _0x8fed('0x2b'):_0xcb402=_0x8fed('0x2c');break;case'$gte':_0xcb402=_0x8fed('0x2d');break;case'$between':_0xcb402=_0x8fed('0x2e');break;}return _0xcb402;}function parseValue(_0x2981e0,_0x1bb754,_0x274aca){var _0xbcc0c2={'start':undefined,'end':undefined};switch(_0x1bb754){case _0x8fed('0x21'):case'$notIn':_0xbcc0c2[_0x8fed('0x2f')]=_0x274aca[_0x8fed('0x8')](',');break;case _0x8fed('0x26'):_0xbcc0c2['start']='%'+_0x274aca+'%';break;case _0x8fed('0x27'):_0xbcc0c2[_0x8fed('0x2f')]=_0x274aca+'%';break;case _0x8fed('0x28'):_0xbcc0c2['start']='%'+_0x274aca;break;case'$between':var _0x54cd2e=_0x274aca[_0x8fed('0x8')](',');var _0x274aca=_0x54cd2e[_0x8fed('0xb')]();var _0x4efe4c=_0x54cd2e[_0x8fed('0x30')]();if(_0x2981e0===_0x8fed('0x11')){_0x274aca=moment(_0x274aca)[_0x8fed('0x31')](0x0,!![])['format']();_0x4efe4c=moment(_0x4efe4c)[_0x8fed('0x31')](0x0,!![])[_0x8fed('0x17')](0x17,'hours')[_0x8fed('0x17')](0x3b,_0x8fed('0x32'))[_0x8fed('0x17')](0x3b,_0x8fed('0x33'))[_0x8fed('0x18')]();}_0xbcc0c2={'start':_0x274aca,'end':_0x4efe4c};break;default:_0xbcc0c2[_0x8fed('0x2f')]=_0x274aca;break;}return _0xbcc0c2;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6cb0c43..6f8e0ad 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 _0x1c12=['length','isObject','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','forEach','lodash','sequelize','moment','fields','split','filters','isEmpty','forOwn','type','DATE','parse','utc','format','$lte','YYYY-MM-DD','subtract','name','isArray','limit','sort','map','priority','cast','col','DESC','unsigned','omit'];(function(_0x551822,_0x2ef6ff){var _0x2c5e96=function(_0x56d282){while(--_0x56d282){_0x551822['push'](_0x551822['shift']());}};_0x2c5e96(++_0x2ef6ff);}(_0x1c12,0x195));var _0x21c1=function(_0x52561a,_0x3a3208){_0x52561a=_0x52561a-0x0;var _0x2a086a=_0x1c12[_0x52561a];return _0x2a086a;};'use strict';var _=require(_0x21c1('0x0'));var sequelize=require(_0x21c1('0x1'));var moment=require(_0x21c1('0x2'));var LIMIT_VALUE=0xfa;exports[_0x21c1('0x3')]=function(_0x5211e7){var _0x3cb135=null;if(_0x5211e7){_0x3cb135=_0x5211e7[_0x21c1('0x4')](',');}return _0x3cb135;};exports[_0x21c1('0x5')]=function(_0x452b3a,_0x1d718a){var _0x38690e={};if(!_[_0x21c1('0x6')](_0x452b3a)){_[_0x21c1('0x7')](_0x452b3a,function(_0x158629,_0x1d3290){try{if(_0x1d718a){var _0x5b9a02=_['find'](_0x1d718a,{'name':_0x1d3290})||{};if(_0x5b9a02[_0x21c1('0x8')]===_0x21c1('0x9')&&_['isPlainObject'](_0x158629)){var _0x40edf8=JSON[_0x21c1('0xa')](_0x158629);var _0x450741={'$gte':moment(moment(_0x40edf8['$gte'])['format']('YYYY-MM-DD'))[_0x21c1('0xb')]()[_0x21c1('0xc')](),'$lte':moment(moment(_0x40edf8[_0x21c1('0xd')])[_0x21c1('0xc')](_0x21c1('0xe')))[_0x21c1('0xb')]()[_0x21c1('0xf')](0x1,'s')[_0x21c1('0xc')]()};_0x38690e[_0x1d3290]=_0x450741;}else if(_0x5b9a02[_0x21c1('0x10')]==='uniqueid'){_0x38690e[_0x1d3290]=_0x158629;}else{_0x38690e[_0x1d3290]=_[_0x21c1('0x11')](_0x158629)?_0x158629:JSON['parse'](_0x158629);}}else{_0x38690e[_0x1d3290]=_[_0x21c1('0x11')](_0x158629)?_0x158629:JSON[_0x21c1('0xa')](_0x158629);}}catch(_0x1b11db){_0x38690e[_0x1d3290]=_0x158629['split'](',');}});}return _0x38690e;};exports[_0x21c1('0x12')]=function(_0x3bcddd){_0x3bcddd=parseInt(_0x3bcddd,0xa);if(!_0x3bcddd||_0x3bcddd<0x0){_0x3bcddd=LIMIT_VALUE;}return _0x3bcddd;};exports['offset']=function(_0x358dc3){_0x358dc3=parseInt(_0x358dc3,0xa);if(!_0x358dc3||_0x358dc3<0x0){_0x358dc3=0x0;}return _0x358dc3;};exports[_0x21c1('0x13')]=function(_0xa1e41d){var _0x50b97d,_0x37e882=null;if(_0xa1e41d){_0x50b97d=_0xa1e41d[_0x21c1('0x4')](',');_0x37e882=_[_0x21c1('0x14')](_0x50b97d,function(_0x32b857){if(_0x32b857['indexOf']('-')===0x0){return[_0x32b857===_0x21c1('0x15')?sequelize[_0x21c1('0x16')](sequelize[_0x21c1('0x17')](_0x21c1('0x15')),'unsigned'):_0x32b857['substr'](0x1),_0x21c1('0x18')];}else{return[_0x32b857===_0x21c1('0x15')?sequelize['cast'](sequelize['col']('priority'),_0x21c1('0x19')):_0x32b857,'ASC'];}});}return _0x37e882;};exports[_0x21c1('0x1a')]=function(_0x304f0f,_0x158a8f){if(_[_0x21c1('0x6')](_0x304f0f)){return _0x304f0f;}if(_[_0x21c1('0x11')](_0x304f0f)){for(var _0x17ecb4=0x0;_0x17ecb4<_0x304f0f[_0x21c1('0x1b')];_0x17ecb4+=0x1){_0x304f0f[_0x17ecb4]=this[_0x21c1('0x1a')](_0x304f0f[_0x17ecb4],_0x158a8f);}return _0x304f0f;}if(!_[_0x21c1('0x1c')](_0x304f0f)){return _0x304f0f;}if(_['isString'](_0x158a8f)){_0x158a8f=[_0x158a8f];}if(!_[_0x21c1('0x11')](_0x158a8f)){return _0x304f0f;}for(var _0x52803a=0x0;_0x52803a<_0x158a8f[_0x21c1('0x1b')];_0x52803a+=0x1){_[_0x21c1('0x1d')](_0x304f0f,_0x158a8f[_0x52803a]);}for(var _0x296cf6 in _0x304f0f){if(_0x304f0f[_0x21c1('0x1e')](_0x296cf6)){_0x304f0f[_0x296cf6]=this[_0x21c1('0x1a')](_0x304f0f[_0x296cf6],_0x158a8f);}}return _0x304f0f;};exports[_0x21c1('0x1f')]=function(_0x4e764a){return _0x4e764a['match'](RegExp(_0x21c1('0x20')))?!![]:![];};exports[_0x21c1('0x21')]=function(_0x26a3f6){return _0x26a3f6[_0x21c1('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x120e83){var _0x224f56=[];_0x120e83['split'](/[ ,]+/)[_0x21c1('0x23')](function(_0x57186a){_0x57186a=_0x57186a['replace'](/([^:]")"+/g,'$1');_0x57186a='+'+_0x57186a+'*';if(_0x57186a['includes']('@'))_0x57186a='\x22'+_0x57186a+'\x22';_0x224f56['push'](_0x57186a);});return _0x224f56['join']('\x20');}; \ No newline at end of file +var _0x9d29=['omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','sequelize','moment','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','parse','limit','offset','map','priority','cast','col','unsigned','substr','DESC'];(function(_0x30f1de,_0x5b6564){var _0xa03256=function(_0x23b50d){while(--_0x23b50d){_0x30f1de['push'](_0x30f1de['shift']());}};_0xa03256(++_0x5b6564);}(_0x9d29,0x188));var _0x99d2=function(_0x5f87a7,_0x56023e){_0x5f87a7=_0x5f87a7-0x0;var _0x4337fb=_0x9d29[_0x5f87a7];return _0x4337fb;};'use strict';var _=require('lodash');var sequelize=require(_0x99d2('0x0'));var moment=require(_0x99d2('0x1'));var LIMIT_VALUE=0xfa;exports[_0x99d2('0x2')]=function(_0x2f49d5){var _0x1658be=null;if(_0x2f49d5){_0x1658be=_0x2f49d5[_0x99d2('0x3')](',');}return _0x1658be;};exports['filters']=function(_0x593c07,_0x26ed8c){var _0x1433e0={};if(!_[_0x99d2('0x4')](_0x593c07)){_[_0x99d2('0x5')](_0x593c07,function(_0x3b1a30,_0x3f42ff){try{if(_0x26ed8c){var _0x3a11c7=_[_0x99d2('0x6')](_0x26ed8c,{'name':_0x3f42ff})||{};if(_0x3a11c7[_0x99d2('0x7')]===_0x99d2('0x8')&&_[_0x99d2('0x9')](_0x3b1a30)){var _0x22da76=JSON['parse'](_0x3b1a30);var _0xd73f4f={'$gte':moment(moment(_0x22da76[_0x99d2('0xa')])[_0x99d2('0xb')](_0x99d2('0xc')))[_0x99d2('0xd')]()[_0x99d2('0xb')](),'$lte':moment(moment(_0x22da76['$lte'])[_0x99d2('0xb')](_0x99d2('0xc')))['utc']()[_0x99d2('0xe')](0x1,'s')['format']()};_0x1433e0[_0x3f42ff]=_0xd73f4f;}else if(_0x3a11c7[_0x99d2('0xf')]===_0x99d2('0x10')){_0x1433e0[_0x3f42ff]=_0x3b1a30;}else{_0x1433e0[_0x3f42ff]=_[_0x99d2('0x11')](_0x3b1a30)?_0x3b1a30:JSON[_0x99d2('0x12')](_0x3b1a30);}}else{_0x1433e0[_0x3f42ff]=_[_0x99d2('0x11')](_0x3b1a30)?_0x3b1a30:JSON[_0x99d2('0x12')](_0x3b1a30);}}catch(_0x586d82){_0x1433e0[_0x3f42ff]=_0x3b1a30[_0x99d2('0x3')](',');}});}return _0x1433e0;};exports[_0x99d2('0x13')]=function(_0x2c0b90){_0x2c0b90=parseInt(_0x2c0b90,0xa);if(!_0x2c0b90||_0x2c0b90<0x0){_0x2c0b90=LIMIT_VALUE;}return _0x2c0b90;};exports[_0x99d2('0x14')]=function(_0x4d9486){_0x4d9486=parseInt(_0x4d9486,0xa);if(!_0x4d9486||_0x4d9486<0x0){_0x4d9486=0x0;}return _0x4d9486;};exports['sort']=function(_0x482299){var _0x585eb9,_0x86d65a=null;if(_0x482299){_0x585eb9=_0x482299['split'](',');_0x86d65a=_[_0x99d2('0x15')](_0x585eb9,function(_0x2c42f0){if(_0x2c42f0['indexOf']('-')===0x0){return[_0x2c42f0===_0x99d2('0x16')?sequelize[_0x99d2('0x17')](sequelize[_0x99d2('0x18')](_0x99d2('0x16')),_0x99d2('0x19')):_0x2c42f0[_0x99d2('0x1a')](0x1),_0x99d2('0x1b')];}else{return[_0x2c42f0==='priority'?sequelize[_0x99d2('0x17')](sequelize['col']('priority'),'unsigned'):_0x2c42f0,'ASC'];}});}return _0x86d65a;};exports[_0x99d2('0x1c')]=function(_0x4a24d4,_0x4fd4ea){if(_[_0x99d2('0x4')](_0x4a24d4)){return _0x4a24d4;}if(_[_0x99d2('0x11')](_0x4a24d4)){for(var _0x21e75a=0x0;_0x21e75a<_0x4a24d4[_0x99d2('0x1d')];_0x21e75a+=0x1){_0x4a24d4[_0x21e75a]=this[_0x99d2('0x1c')](_0x4a24d4[_0x21e75a],_0x4fd4ea);}return _0x4a24d4;}if(!_[_0x99d2('0x1e')](_0x4a24d4)){return _0x4a24d4;}if(_[_0x99d2('0x1f')](_0x4fd4ea)){_0x4fd4ea=[_0x4fd4ea];}if(!_[_0x99d2('0x11')](_0x4fd4ea)){return _0x4a24d4;}for(var _0x290d7d=0x0;_0x290d7d<_0x4fd4ea[_0x99d2('0x1d')];_0x290d7d+=0x1){_[_0x99d2('0x20')](_0x4a24d4,_0x4fd4ea[_0x290d7d]);}for(var _0x5460a8 in _0x4a24d4){if(_0x4a24d4[_0x99d2('0x21')](_0x5460a8)){_0x4a24d4[_0x5460a8]=this[_0x99d2('0x1c')](_0x4a24d4[_0x5460a8],_0x4fd4ea);}}return _0x4a24d4;};exports[_0x99d2('0x22')]=function(_0x574c9e){return _0x574c9e[_0x99d2('0x23')](RegExp(_0x99d2('0x24')))?!![]:![];};exports['isEmail']=function(_0x3c9dfa){return _0x3c9dfa[_0x99d2('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x99d2('0x25')]=function(_0x25e47f){var _0x3c7579=[];_0x25e47f[_0x99d2('0x3')](/[ ,]+/)[_0x99d2('0x26')](function(_0x54e6c7){_0x54e6c7=_0x54e6c7[_0x99d2('0x27')](/([^:]")"+/g,'$1');_0x54e6c7='+'+_0x54e6c7+'*';if(_0x54e6c7['includes']('@'))_0x54e6c7='\x22'+_0x54e6c7+'\x22';_0x3c7579[_0x99d2('0x28')](_0x54e6c7);});return _0x3c7579[_0x99d2('0x29')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 5be0fca..9144252 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25e7=['../mysqldb','default','production','appPath','join','root','public','development','set','client','json\x20replacer','split','static','get','views','html','ejs','use','urlencoded','50mb','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment'];(function(_0x585f3e,_0x39967d){var _0x4847db=function(_0x41a05b){while(--_0x41a05b){_0x585f3e['push'](_0x585f3e['shift']());}};_0x4847db(++_0x39967d);}(_0x25e7,0x72));var _0x725e=function(_0x35f3c9,_0x1aaafe){_0x35f3c9=_0x35f3c9-0x0;var _0x483f61=_0x25e7[_0x35f3c9];return _0x483f61;};'use strict';var express=require(_0x725e('0x0'));var favicon=require(_0x725e('0x1'));var bodyParser=require(_0x725e('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x725e('0x3'));var errorHandler=require(_0x725e('0x4'));var path=require(_0x725e('0x5'));var passport=require(_0x725e('0x6'));var cors=require(_0x725e('0x7'));var moment=require(_0x725e('0x8'));var config=require(_0x725e('0x9'));var db=require(_0x725e('0xa'))['db'];exports[_0x725e('0xb')]=function(_0x5e3717){var _0x153508=_0x5e3717['get']('env');if(_0x153508===_0x725e('0xc')){_0x5e3717['set'](_0x725e('0xd'),path[_0x725e('0xe')](config[_0x725e('0xf')],_0x725e('0x10')));}if(_0x153508===_0x725e('0x11')||_0x153508==='test'){_0x5e3717[_0x725e('0x12')](_0x725e('0xd'),path[_0x725e('0xe')](config['root'],_0x725e('0x13')));_0x5e3717['use'](errorHandler());}_0x5e3717[_0x725e('0x12')](_0x725e('0x14'),function(_0x131d82,_0x1b93ee){if(this[_0x131d82]instanceof Date){_0x1b93ee=this[_0x131d82]['toISOString']()[_0x725e('0x15')]('.')[0x0]+'Z';}return _0x1b93ee;});_0x5e3717['use'](express[_0x725e('0x16')](_0x5e3717[_0x725e('0x17')](_0x725e('0xd'))));_0x5e3717[_0x725e('0x12')](_0x725e('0x18'),config[_0x725e('0xf')]+'/server/views');_0x5e3717['engine'](_0x725e('0x19'),require(_0x725e('0x1a'))['renderFile']);_0x5e3717[_0x725e('0x12')]('view\x20engine','html');_0x5e3717[_0x725e('0x1b')](bodyParser[_0x725e('0x1c')]({'limit':_0x725e('0x1d'),'extended':!![]}));_0x5e3717[_0x725e('0x1b')](bodyParser['json']({'limit':'50mb'}));_0x5e3717[_0x725e('0x1b')](cors());_0x5e3717['use'](methodOverride());_0x5e3717['use'](cookieParser());_0x5e3717[_0x725e('0x1b')](passport[_0x725e('0x1e')]());}; \ No newline at end of file +var _0x6034=['body-parser','method-override','cookie-parser','errorhandler','path','passport','../mysqldb','env','production','set','join','public','development','test','appPath','client','use','json\x20replacer','split','static','get','views','root','/server/views','engine','renderFile','view\x20engine','50mb','json','initialize','serve-favicon'];(function(_0x2595ed,_0x4d286c){var _0x52ffe0=function(_0x2720b7){while(--_0x2720b7){_0x2595ed['push'](_0x2595ed['shift']());}};_0x52ffe0(++_0x4d286c);}(_0x6034,0x9a));var _0x4603=function(_0x2b5448,_0x267c4c){_0x2b5448=_0x2b5448-0x0;var _0x3c5f86=_0x6034[_0x2b5448];return _0x3c5f86;};'use strict';var express=require('express');var favicon=require(_0x4603('0x0'));var bodyParser=require(_0x4603('0x1'));var methodOverride=require(_0x4603('0x2'));var cookieParser=require(_0x4603('0x3'));var errorHandler=require(_0x4603('0x4'));var path=require(_0x4603('0x5'));var passport=require(_0x4603('0x6'));var cors=require('cors');var moment=require('moment');var config=require('./environment');var db=require(_0x4603('0x7'))['db'];exports['default']=function(_0x736bfb){var _0x1c257d=_0x736bfb['get'](_0x4603('0x8'));if(_0x1c257d===_0x4603('0x9')){_0x736bfb[_0x4603('0xa')]('appPath',path[_0x4603('0xb')](config['root'],_0x4603('0xc')));}if(_0x1c257d===_0x4603('0xd')||_0x1c257d===_0x4603('0xe')){_0x736bfb['set'](_0x4603('0xf'),path[_0x4603('0xb')](config['root'],_0x4603('0x10')));_0x736bfb[_0x4603('0x11')](errorHandler());}_0x736bfb['set'](_0x4603('0x12'),function(_0x11391f,_0x2b3e93){if(this[_0x11391f]instanceof Date){_0x2b3e93=this[_0x11391f]['toISOString']()[_0x4603('0x13')]('.')[0x0]+'Z';}return _0x2b3e93;});_0x736bfb[_0x4603('0x11')](express[_0x4603('0x14')](_0x736bfb[_0x4603('0x15')](_0x4603('0xf'))));_0x736bfb[_0x4603('0xa')](_0x4603('0x16'),config[_0x4603('0x17')]+_0x4603('0x18'));_0x736bfb[_0x4603('0x19')]('html',require('ejs')[_0x4603('0x1a')]);_0x736bfb[_0x4603('0xa')](_0x4603('0x1b'),'html');_0x736bfb[_0x4603('0x11')](bodyParser['urlencoded']({'limit':_0x4603('0x1c'),'extended':!![]}));_0x736bfb[_0x4603('0x11')](bodyParser[_0x4603('0x1d')]({'limit':_0x4603('0x1c')}));_0x736bfb[_0x4603('0x11')](cors());_0x736bfb[_0x4603('0x11')](methodOverride());_0x736bfb[_0x4603('0x11')](cookieParser());_0x736bfb[_0x4603('0x11')](passport[_0x4603('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 3589572..61d00c7 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 _0x11ef=['win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','platform','licenseToken','test'];(function(_0x513f04,_0x979225){var _0x4498f2=function(_0x462429){while(--_0x462429){_0x513f04['push'](_0x513f04['shift']());}};_0x4498f2(++_0x979225);}(_0x11ef,0xda));var _0xf11e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x11ef[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xf11e('0x0'));var os=require('os');var crypto=require(_0xf11e('0x1'));var machine=require(_0xf11e('0x2'));var exec=require(_0xf11e('0x3'))['execSync'];var config=require(_0xf11e('0x4'));function getInterfaces(){var _0x325d3e=[];var _0x1407e7=os[_0xf11e('0x5')]();var _0x171b40=_[_0xf11e('0x6')](_[_0xf11e('0x7')](_0x1407e7));for(var _0xdc4f0b=0x0;_0xdc4f0b<_0x171b40[_0xf11e('0x8')];_0xdc4f0b++){var _0x4814d9=_0x1407e7[_0x171b40[_0xdc4f0b]][_0xf11e('0x9')](function(_0x397ef4){return _0x397ef4['family']===_0xf11e('0xa')&&_0x397ef4[_0xf11e('0xb')]===![];});_0x325d3e=_0x325d3e[_0xf11e('0xc')](_0x4814d9);}return _0x325d3e;}function getFirstInterface(){var _0x1b6f6f=_[_0xf11e('0xd')](getInterfaces());return{'macAddress':_0x1b6f6f&&_0x1b6f6f[_0xf11e('0xe')]?_0x1b6f6f[_0xf11e('0xe')]:_0xf11e('0xf'),'ipAddress':_0x1b6f6f&&_0x1b6f6f[_0xf11e('0x10')]?_0x1b6f6f['address']:_0xf11e('0x11')};}exports[_0xf11e('0x12')]=getFirstInterface;function getCPUhash(){var _0x24ddd1=_[_0xf11e('0x6')](os['cpus']()['map'](function(_0x42692f){return _0x42692f[_0xf11e('0x13')];}))[_0xf11e('0x14')](':');return crypto[_0xf11e('0x15')](_0xf11e('0x16'))[_0xf11e('0x17')](_0x24ddd1)['digest']('hex');}exports['getUuid']=function(){var _0x5f30eb=os[_0xf11e('0x18')]();var _0x14fefc=/[0-9a-f-]{36}/;if(config[_0xf11e('0x19')]&&_0x14fefc[_0xf11e('0x1a')](config['licenseToken'])){return config[_0xf11e('0x19')];}else if(_0x5f30eb===_0xf11e('0x1b')){return exec(_0xf11e('0x1c'),{'encoding':_0xf11e('0x1d')})[_0xf11e('0x1e')]('\x0d\x0a','');}else{var _0x2ab96c=getFirstInterface();var _0x19e105=getCPUhash();var _0xef3007=_0x19e105+'|'+os[_0xf11e('0x1f')]()+'|'+_0x2ab96c[_0xf11e('0x20')]+'|'+_0x2ab96c['ipAddress'];var _0x44b6ef=crypto[_0xf11e('0x15')](_0xf11e('0x16'))['update'](_0xef3007)['digest'](_0xf11e('0x21'));return _0x44b6ef[_0xf11e('0x22')](0x0,0x8)+'-'+_0x44b6ef[_0xf11e('0x22')](0x8,0xc)+'-'+_0x44b6ef[_0xf11e('0x22')](0xc,0x10)+'-'+_0x44b6ef['substring'](0x10,0x14)+'-'+_0x44b6ef[_0xf11e('0x22')](0x14);}}; \ No newline at end of file +var _0x518f=['utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','length','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','model','join','createHash','md5','update','digest','hex','platform','licenseToken','test','win32'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x518f,0xba));var _0xf518=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x518f[_0x5ec454];return _0x5ebf50;};'use strict';var _=require(_0xf518('0x0'));var os=require('os');var crypto=require(_0xf518('0x1'));var machine=require(_0xf518('0x2'));var exec=require(_0xf518('0x3'))[_0xf518('0x4')];var config=require(_0xf518('0x5'));function getInterfaces(){var _0xcfd0b=[];var _0x238752=os[_0xf518('0x6')]();var _0x2fb36a=_['orderBy'](_[_0xf518('0x7')](_0x238752));for(var _0xc6dbcb=0x0;_0xc6dbcb<_0x2fb36a[_0xf518('0x8')];_0xc6dbcb++){var _0x5396d1=_0x238752[_0x2fb36a[_0xc6dbcb]]['filter'](function(_0x252cdb){return _0x252cdb['family']==='IPv4'&&_0x252cdb[_0xf518('0x9')]===![];});_0xcfd0b=_0xcfd0b[_0xf518('0xa')](_0x5396d1);}return _0xcfd0b;}function getFirstInterface(){var _0xc818a2=_[_0xf518('0xb')](getInterfaces());return{'macAddress':_0xc818a2&&_0xc818a2[_0xf518('0xc')]?_0xc818a2['mac']:_0xf518('0xd'),'ipAddress':_0xc818a2&&_0xc818a2[_0xf518('0xe')]?_0xc818a2[_0xf518('0xe')]:_0xf518('0xf')};}exports[_0xf518('0x10')]=getFirstInterface;function getCPUhash(){var _0x517d4b=_[_0xf518('0x11')](os[_0xf518('0x12')]()['map'](function(_0x2a6d8b){return _0x2a6d8b[_0xf518('0x13')];}))[_0xf518('0x14')](':');return crypto[_0xf518('0x15')](_0xf518('0x16'))[_0xf518('0x17')](_0x517d4b)[_0xf518('0x18')](_0xf518('0x19'));}exports['getUuid']=function(){var _0x372902=os[_0xf518('0x1a')]();var _0x21c432=/[0-9a-f-]{36}/;if(config[_0xf518('0x1b')]&&_0x21c432[_0xf518('0x1c')](config[_0xf518('0x1b')])){return config[_0xf518('0x1b')];}else if(_0x372902===_0xf518('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xf518('0x1e')})[_0xf518('0x1f')]('\x0d\x0a','');}else{var _0x44b4c9=getFirstInterface();var _0x5b9f95=getCPUhash();var _0x3cf0ce=_0x5b9f95+'|'+os[_0xf518('0x20')]()+'|'+_0x44b4c9[_0xf518('0x21')]+'|'+_0x44b4c9[_0xf518('0x22')];var _0x48cc6b=crypto[_0xf518('0x15')](_0xf518('0x16'))['update'](_0x3cf0ce)[_0xf518('0x18')](_0xf518('0x19'));return _0x48cc6b[_0xf518('0x23')](0x0,0x8)+'-'+_0x48cc6b['substring'](0x8,0xc)+'-'+_0x48cc6b['substring'](0xc,0x10)+'-'+_0x48cc6b[_0xf518('0x23')](0x10,0x14)+'-'+_0x48cc6b['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index fd7118d..679ce5f 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 _0x7475=['util','request-promise','bluebird','pkginfo','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','exports','GET','catch','get','data2','data1','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Changed','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default'];(function(_0x2ebacc,_0xdc5ab3){var _0x44e8ad=function(_0x300190){while(--_0x300190){_0x2ebacc['push'](_0x2ebacc['shift']());}};_0x44e8ad(++_0xdc5ab3);}(_0x7475,0x190));var _0x5747=function(_0x13f93d,_0xfda5c){_0x13f93d=_0x13f93d-0x0;var _0x1908cc=_0x7475[_0x13f93d];return _0x1908cc;};'use strict';var util=require(_0x5747('0x0'));var moment=require('moment');var rp=require(_0x5747('0x1'));var BPromise=require(_0x5747('0x2'));var pkginfo=require(_0x5747('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x5747('0x4'));var hardware=require(_0x5747('0x5'));var logger=require(_0x5747('0x6'))(_0x5747('0x7'));var HOST=_0x5747('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2d6cca){return new BPromise(function(_0x219b09,_0x126644){var _0x125fd9=util[_0x5747('0x9')](_0x5747('0xa'),HOST,_0x2d6cca,module['exports'][_0x5747('0xb')]);if(oldToken){_0x125fd9=util[_0x5747('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2d6cca,module[_0x5747('0xc')][_0x5747('0xb')],oldToken);}var _0x565d5f={'uri':_0x125fd9,'method':_0x5747('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x565d5f)['then'](function(_0x554e78){_0x219b09(_0x554e78);})[_0x5747('0xe')](function(_0x10401c){_0x126644(_0x10401c);});});}function manageLicense(_0x34993e,_0x290a0a){var _0x8b9db1=_0x290a0a[_0x5747('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x8b9db1['data1']!==_0x34993e&&!_0x8b9db1[_0x5747('0x10')]){oldToken=_0x8b9db1[_0x5747('0x11')];}httpRequest(_0x34993e)[_0x5747('0x12')](function(_0x431c5f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x431c5f[_0x5747('0x13')]){isOldTokenSent=![];if(!_0x8b9db1[_0x5747('0x7')]&&_0x8b9db1[_0x5747('0x7')]!=_0x431c5f[_0x5747('0x7')]||_0x8b9db1[_0x5747('0x7')]&&_0x8b9db1[_0x5747('0x10')]){logger['info'](_0x5747('0x14'));}if(_0x8b9db1[_0x5747('0x7')]&&!_0x8b9db1['data2']&&_0x8b9db1[_0x5747('0x7')]!=_0x431c5f[_0x5747('0x7')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x8b9db1['license']&&!_0x8b9db1[_0x5747('0x10')]&&_0x8b9db1['license']==_0x431c5f[_0x5747('0x7')]){return _0x290a0a;}return _0x290a0a[_0x5747('0x15')]({'data1':_0x34993e,'data2':null,'license':_0x431c5f[_0x5747('0x7')]});}else{if(_0x431c5f[_0x5747('0x7')]||_0x8b9db1['license']){if(!_0x8b9db1['data2']){if(_0x8b9db1[_0x5747('0x11')]==_0x34993e){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x5747('0x16');logger[_0x5747('0x17')](_0x5747('0x18'),_0x8b9db1[_0x5747('0x11')],_0x34993e);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x5747('0x19')](),moment()[_0x5747('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x290a0a[_0x5747('0x15')]({'data2':encryptor[_0x5747('0x1a')](moment()[_0x5747('0x9')](_0x5747('0x1b')))});}else{if(moment()[_0x5747('0x1c')](encryptor[_0x5747('0x1d')](_0x8b9db1[_0x5747('0x10')]),'days')>DAYS){logger[_0x5747('0x17')](_0x5747('0x1e'),moment()['format'](_0x5747('0x1b')));isOldTokenSent=![];return _0x290a0a[_0x5747('0x15')]({'data1':_0x34993e,'data2':null,'license':null});}}}else{if(_0x8b9db1[_0x5747('0x11')]!=_0x34993e){logger['info'](_0x5747('0x18'),_0x8b9db1[_0x5747('0x11')],_0x34993e);return _0x290a0a[_0x5747('0x15')]({'data1':_0x34993e,'data2':null,'license':null});}}}return _0x290a0a;})[_0x5747('0x12')](function(_0xbb2343){_0x290a0a=_0xbb2343;})[_0x5747('0xe')](function(_0xbfb30){logger[_0x5747('0x1f')](_0xbfb30['message']);})[_0x5747('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x5747('0x21')](),_0x290a0a);},TIME);});}function defaultLicense(){var _0x1529ea=hardware[_0x5747('0x21')]();if(_0x1529ea){return db[_0x5747('0x22')][_0x5747('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x1529ea}})[_0x5747('0x24')](function(_0x540a0c,_0x1d42aa){logger[_0x5747('0x17')](_0x5747('0x25'),_0x1529ea);manageLicense(_0x1529ea,_0x540a0c);})['catch'](function(_0x51e1a5){logger[_0x5747('0x1f')](_0x51e1a5[_0x5747('0x26')]);});}}exports[_0x5747('0x27')]=defaultLicense; \ No newline at end of file +var _0x8ef0=['THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','error','message','default','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info'];(function(_0x25810e,_0x406ddd){var _0x2f670c=function(_0x369207){while(--_0x369207){_0x25810e['push'](_0x25810e['shift']());}};_0x2f670c(++_0x406ddd);}(_0x8ef0,0x1f2));var _0x08ef=function(_0x8a4654,_0x13e800){_0x8a4654=_0x8a4654-0x0;var _0x23bee4=_0x8ef0[_0x8a4654];return _0x23bee4;};'use strict';var util=require(_0x08ef('0x0'));var moment=require(_0x08ef('0x1'));var rp=require('request-promise');var BPromise=require(_0x08ef('0x2'));var pkginfo=require(_0x08ef('0x3'))(module,_0x08ef('0x4'));var db=require(_0x08ef('0x5'))['db'];var encryptor=require(_0x08ef('0x6'));var hardware=require(_0x08ef('0x7'));var logger=require(_0x08ef('0x8'))(_0x08ef('0x9'));var HOST=_0x08ef('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x42c042){return new BPromise(function(_0x56ed0e,_0x468775){var _0x428ccc=util['format'](_0x08ef('0xb'),HOST,_0x42c042,module['exports']['version']);if(oldToken){_0x428ccc=util[_0x08ef('0xc')](_0x08ef('0xd'),HOST,_0x42c042,module[_0x08ef('0xe')][_0x08ef('0x4')],oldToken);}var _0x715d99={'uri':_0x428ccc,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x715d99)[_0x08ef('0xf')](function(_0x3992cb){_0x56ed0e(_0x3992cb);})['catch'](function(_0x18bfc5){_0x468775(_0x18bfc5);});});}function manageLicense(_0x77f1d9,_0x459336){var _0x2bf520=_0x459336[_0x08ef('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x2bf520[_0x08ef('0x11')]!==_0x77f1d9&&!_0x2bf520[_0x08ef('0x12')]){oldToken=_0x2bf520['data1'];}httpRequest(_0x77f1d9)[_0x08ef('0xf')](function(_0x465475){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x465475[_0x08ef('0x13')]){isOldTokenSent=![];if(!_0x2bf520[_0x08ef('0x9')]&&_0x2bf520[_0x08ef('0x9')]!=_0x465475[_0x08ef('0x9')]||_0x2bf520[_0x08ef('0x9')]&&_0x2bf520['data2']){logger['info'](_0x08ef('0x14'));}if(_0x2bf520[_0x08ef('0x9')]&&!_0x2bf520[_0x08ef('0x12')]&&_0x2bf520[_0x08ef('0x9')]!=_0x465475[_0x08ef('0x9')]){logger[_0x08ef('0x15')](_0x08ef('0x16'));}if(_0x2bf520[_0x08ef('0x9')]&&!_0x2bf520[_0x08ef('0x12')]&&_0x2bf520[_0x08ef('0x9')]==_0x465475[_0x08ef('0x9')]){return _0x459336;}return _0x459336[_0x08ef('0x17')]({'data1':_0x77f1d9,'data2':null,'license':_0x465475[_0x08ef('0x9')]});}else{if(_0x465475[_0x08ef('0x9')]||_0x2bf520['license']){if(!_0x2bf520[_0x08ef('0x12')]){if(_0x2bf520['data1']==_0x77f1d9){GRAY_PERIOD_REASON='Disabled';logger[_0x08ef('0x15')](_0x08ef('0x18'));}else{GRAY_PERIOD_REASON=_0x08ef('0x19');logger[_0x08ef('0x15')](_0x08ef('0x1a'),_0x2bf520[_0x08ef('0x11')],_0x77f1d9);}logger[_0x08ef('0x15')](_0x08ef('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x08ef('0xc')](_0x08ef('0x1c')));return _0x459336['update']({'data2':encryptor[_0x08ef('0x1d')](moment()[_0x08ef('0xc')](_0x08ef('0x1c')))});}else{if(moment()[_0x08ef('0x1e')](encryptor[_0x08ef('0x1f')](_0x2bf520['data2']),'days')>DAYS){logger[_0x08ef('0x15')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x08ef('0x1c')));isOldTokenSent=![];return _0x459336[_0x08ef('0x17')]({'data1':_0x77f1d9,'data2':null,'license':null});}}}else{if(_0x2bf520['data1']!=_0x77f1d9){logger[_0x08ef('0x15')](_0x08ef('0x1a'),_0x2bf520[_0x08ef('0x11')],_0x77f1d9);return _0x459336[_0x08ef('0x17')]({'data1':_0x77f1d9,'data2':null,'license':null});}}}return _0x459336;})['then'](function(_0x3a1877){_0x459336=_0x3a1877;})['catch'](function(_0x21e96f){logger['error'](_0x21e96f['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x459336);},TIME);});}function defaultLicense(){var _0xa21f2c=hardware[_0x08ef('0x20')]();if(_0xa21f2c){return db[_0x08ef('0x21')][_0x08ef('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0xa21f2c}})['spread'](function(_0x2e3ee0,_0x2c0999){logger['info'](_0x08ef('0x23'),_0xa21f2c);manageLicense(_0xa21f2c,_0x2e3ee0);})[_0x08ef('0x24')](function(_0x1d1a5c){logger[_0x08ef('0x25')](_0x1d1a5c[_0x08ef('0x26')]);});}}exports[_0x08ef('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index eb13f50..6b73bba 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 _0xdaf2=['count','admin','user','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','add','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col'];(function(_0x5575c1,_0x11b31a){var _0x50ea4e=function(_0x225d89){while(--_0x225d89){_0x5575c1['push'](_0x5575c1['shift']());}};_0x50ea4e(++_0x11b31a);}(_0xdaf2,0x122));var _0x2daf=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0xdaf2[_0x10c51f];return _0x56a0cd;};'use strict';var util=require(_0x2daf('0x0'));var _=require(_0x2daf('0x1'));var moment=require(_0x2daf('0x2'));var BPromise=require('bluebird');var hardware=require(_0x2daf('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x2daf('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2daf('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2daf('0x6'),'machineUuid':hardware[_0x2daf('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2daf('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2daf('0x8'),'machineUuid':hardware[_0x2daf('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x25adbf){return new BPromise(function(_0xa4a2d8,_0xb55cf3){return db['License'][_0x2daf('0x9')](_[_0x2daf('0xa')](_0x25adbf,{'raw':!![],'where':{'id':0x1}}))[_0x2daf('0xb')](function(_0x4991cc){return checkLicense(_0x4991cc,null);})[_0x2daf('0xb')](function(_0x521b14){_0xa4a2d8(_0x521b14);return;})[_0x2daf('0xc')](function(_0x251685){_0xb55cf3(_0x251685);});});}function checkLicense(_0x3ef607,_0x4e0fa7){if(!_0x3ef607){demoLicense['uuid']=_0x3ef607[_0x2daf('0xd')];return demoLicense;}try{var _0x909560=_0x4e0fa7||_0x3ef607[_0x2daf('0xe')];if(_[_0x2daf('0xf')](_0x909560)){throw new Error(_0x2daf('0x10'));}var _0x44dde2=_0x3ef607['data1'];var _0x1747b5=_0x3ef607[_0x2daf('0x11')];var _0x30b4a5=_0x44dde2['split']('-')[0x4];var _0x270640=_0x44dde2[_0x2daf('0x12')]('-')[0x0];var _0x58d467=encryptor[_0x2daf('0x13')](_0x909560,util[_0x2daf('0x14')](_0x2daf('0x15'),_0x30b4a5,_0x44dde2,_0x270640));var _0x100a74=JSON[_0x2daf('0x16')](_0x58d467);_0x100a74[_0x2daf('0x17')]=![];_0x100a74[_0x2daf('0x18')]=_0x44dde2;_0x100a74[_0x2daf('0x19')]=hardware['getUuid']();if(_0x1747b5){var _0x34ecc6=encryptor[_0x2daf('0x13')](_0x1747b5);_0x100a74[_0x2daf('0x1a')]=_0x34ecc6;_0x100a74[_0x2daf('0x1b')]=moment(_0x34ecc6)[_0x2daf('0x1c')](0x7,'days')['format']();_0x100a74[_0x2daf('0x1d')]=_0x100a74[_0x2daf('0x18')]!=_0x100a74['machineUuid']?_0x2daf('0x1e'):_0x2daf('0x1f');}return _0x100a74;}catch(_0xe61f23){breakingLicense['uuid']=_0x3ef607['data1'];breakingLicense['message']=_0xe61f23[_0x2daf('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xd5a58d,_0x5b0101){getLicense()[_0x2daf('0xb')](function(_0x45d50b){return db[_0x2daf('0x21')][_0x2daf('0x22')]({'attributes':[_0x2daf('0x23'),[db[_0x2daf('0x24')]['fn'](_0x2daf('0x25'),db['sequelize'][_0x2daf('0x26')]('role')),_0x2daf('0x27')]],'group':'role','where':{'role':{'$or':[_0x2daf('0x28'),'user','telephone']}},'raw':!![]})[_0x2daf('0xb')](function(_0x4fa46c){var _0x5403d1={'user':_0x45d50b['users']||0x0,'telephone':_0x45d50b['telephones']||0x0};_0x4fa46c['forEach'](function(_0xcfed7e){var _0x253401=_0xcfed7e['role']==='admin'?_0x2daf('0x29'):_0xcfed7e['role'];_0x5403d1[_0x253401]-=_0xcfed7e[_0x2daf('0x27')];if(_0x5403d1[_0x253401]<0x0)_0x5403d1[_0x253401]=0x0;});_0xd5a58d(_0x5403d1);return;});})[_0x2daf('0xc')](function(_0x4a199a){_0x5b0101(_0x4a199a);});});}function checkUserLimits(_0x53999a){return new BPromise(function(_0x15c773,_0x183728){getLimits()[_0x2daf('0xb')](function(_0x567f98){var _0x4b224b=_[_0x2daf('0x2a')](_['countBy'](_0x53999a,_0x2daf('0x23')),['admin','user',_0x2daf('0x2b')]);var _0x3d091a=(_0x4b224b[_0x2daf('0x28')]||0x0)+(_0x4b224b['user']||0x0);var _0x24b689=_0x4b224b['telephone']||0x0;if(_0x3d091a>_0x567f98[_0x2daf('0x29')])return _0x183728(_0x2daf('0x2c'));if(_0x24b689>_0x567f98[_0x2daf('0x2b')])return _0x183728(_0x2daf('0x2d'));return _0x15c773();})[_0x2daf('0xc')](function(_0x5a2f65){_0x183728(_0x5a2f65);});});}module[_0x2daf('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x020b=['parse','demo','machineUuid','decryptString','gray','deadline','days','changed','disabled','message','findAll','sequelize','col','count','admin','user','telephone','users','role','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','format','%s:%s:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x020b,0x9a));var _0xb020=function(_0x4772cb,_0x275fa3){_0x4772cb=_0x4772cb-0x0;var _0x29ae86=_0x020b[_0x4772cb];return _0x29ae86;};'use strict';var util=require(_0xb020('0x0'));var _=require('lodash');var moment=require(_0xb020('0x1'));var BPromise=require(_0xb020('0x2'));var hardware=require(_0xb020('0x3'));var encryptor=require(_0xb020('0x4'));var db=require(_0xb020('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb020('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xb020('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb020('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb020('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4ae079){return new BPromise(function(_0x2914c7,_0x2d5426){return db[_0xb020('0x9')][_0xb020('0xa')](_[_0xb020('0xb')](_0x4ae079,{'raw':!![],'where':{'id':0x1}}))[_0xb020('0xc')](function(_0x4146ff){return checkLicense(_0x4146ff,null);})['then'](function(_0x1e0ec5){_0x2914c7(_0x1e0ec5);return;})[_0xb020('0xd')](function(_0x226b8f){_0x2d5426(_0x226b8f);});});}function checkLicense(_0x49df48,_0x5eeec6){if(!_0x49df48){demoLicense[_0xb020('0xe')]=_0x49df48[_0xb020('0xf')];return demoLicense;}try{var _0x3a19b6=_0x5eeec6||_0x49df48[_0xb020('0x10')];if(_[_0xb020('0x11')](_0x3a19b6)){throw new Error(_0xb020('0x12'));}var _0x57eb13=_0x49df48[_0xb020('0xf')];var _0x196b9e=_0x49df48['data2'];var _0x1adfde=_0x57eb13[_0xb020('0x13')]('-')[0x4];var _0xcf4002=_0x57eb13[_0xb020('0x13')]('-')[0x0];var _0x5f2c3c=encryptor['decryptString'](_0x3a19b6,util[_0xb020('0x14')](_0xb020('0x15'),_0x1adfde,_0x57eb13,_0xcf4002));var _0x45e21e=JSON[_0xb020('0x16')](_0x5f2c3c);_0x45e21e[_0xb020('0x17')]=![];_0x45e21e[_0xb020('0xe')]=_0x57eb13;_0x45e21e[_0xb020('0x18')]=hardware['getUuid']();if(_0x196b9e){var _0x3a6d22=encryptor[_0xb020('0x19')](_0x196b9e);_0x45e21e[_0xb020('0x1a')]=_0x3a6d22;_0x45e21e[_0xb020('0x1b')]=moment(_0x3a6d22)['add'](0x7,_0xb020('0x1c'))[_0xb020('0x14')]();_0x45e21e['grayReason']=_0x45e21e[_0xb020('0xe')]!=_0x45e21e[_0xb020('0x18')]?_0xb020('0x1d'):_0xb020('0x1e');}return _0x45e21e;}catch(_0x1d9957){breakingLicense[_0xb020('0xe')]=_0x49df48['data1'];breakingLicense[_0xb020('0x1f')]=_0x1d9957[_0xb020('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5dbfdd,_0x51743f){getLicense()[_0xb020('0xc')](function(_0xe9146a){return db['User'][_0xb020('0x20')]({'attributes':['role',[db[_0xb020('0x21')]['fn']('COUNT',db[_0xb020('0x21')][_0xb020('0x22')]('role')),_0xb020('0x23')]],'group':'role','where':{'role':{'$or':[_0xb020('0x24'),_0xb020('0x25'),_0xb020('0x26')]}},'raw':!![]})[_0xb020('0xc')](function(_0x417e21){var _0x217800={'user':_0xe9146a[_0xb020('0x27')]||0x0,'telephone':_0xe9146a['telephones']||0x0};_0x417e21['forEach'](function(_0x206019){var _0x4d59a3=_0x206019[_0xb020('0x28')]===_0xb020('0x24')?_0xb020('0x25'):_0x206019[_0xb020('0x28')];_0x217800[_0x4d59a3]-=_0x206019['count'];if(_0x217800[_0x4d59a3]<0x0)_0x217800[_0x4d59a3]=0x0;});_0x5dbfdd(_0x217800);return;});})[_0xb020('0xd')](function(_0x2edb66){_0x51743f(_0x2edb66);});});}function checkUserLimits(_0x390554){return new BPromise(function(_0x29d6c2,_0x3fcf60){getLimits()[_0xb020('0xc')](function(_0x30dfb0){var _0x2fb22b=_[_0xb020('0x29')](_['countBy'](_0x390554,_0xb020('0x28')),['admin',_0xb020('0x25'),_0xb020('0x26')]);var _0x2a2c93=(_0x2fb22b[_0xb020('0x24')]||0x0)+(_0x2fb22b['user']||0x0);var _0x172268=_0x2fb22b['telephone']||0x0;if(_0x2a2c93>_0x30dfb0[_0xb020('0x25')])return _0x3fcf60(_0xb020('0x2a'));if(_0x172268>_0x30dfb0[_0xb020('0x26')])return _0x3fcf60(_0xb020('0x2b'));return _0x29d6c2();})['catch'](function(_0x534df9){_0x3fcf60(_0x534df9);});});}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 c1c71ea..eb89b0a 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 _0x3266=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x54e33f,_0x286c6d){var _0x56eba7=function(_0xb53535){while(--_0xb53535){_0x54e33f['push'](_0x54e33f['shift']());}};_0x56eba7(++_0x286c6d);}(_0x3266,0x6a));var _0x6326=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x3266[_0x1ab180];return _0xfb2c2d;};'use strict';module[_0x6326('0x0')]={'DOMAIN':_0x6326('0x1'),'SESSION_SECRET':_0x6326('0x2'),'GOOGLE_ID':_0x6326('0x3'),'GOOGLE_SECRET':_0x6326('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xb44a=['myappanuglar-secret','secret'];(function(_0x3848b8,_0x2bb0b9){var _0x43bc25=function(_0x4db7a7){while(--_0x4db7a7){_0x3848b8['push'](_0x3848b8['shift']());}};_0x43bc25(++_0x2bb0b9);}(_0xb44a,0x1c2));var _0xab44=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0xb44a[_0x13843f];return _0x1063ae;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xab44('0x0'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xab44('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ad0f122..337186e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf760=['format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','%s-%s','error','File','info','env','debugLevel','moment','winston','util','INFO','join','/var','log'];(function(_0x4736ea,_0x9256c4){var _0x29ee17=function(_0x1e949b){while(--_0x1e949b){_0x4736ea['push'](_0x4736ea['shift']());}};_0x29ee17(++_0x9256c4);}(_0xf760,0x101));var _0x0f76=function(_0x389030,_0x1a931b){_0x389030=_0x389030-0x0;var _0x3597bb=_0xf760[_0x389030];return _0x3597bb;};'use strict';var moment=require(_0x0f76('0x0'));var winston=require(_0x0f76('0x1'));var util=require(_0x0f76('0x2'));var path=require('path');var debugLevel=_0x0f76('0x3');function filename(_0x8882de,_0x5444a0){return path[_0x0f76('0x4')](_0x0f76('0x5'),_0x0f76('0x6'),'xcally',util[_0x0f76('0x7')](_0x0f76('0x8'),_0x8882de,_0x5444a0));}function formatter(_0x5016fb,_0x3babd7){_0x3babd7[_0x0f76('0x9')]=_0x3babd7[_0x0f76('0x9')][_0x0f76('0xa')](/@@{/g,_0x0f76('0xb'))[_0x0f76('0xa')](/}@@/g,_0x0f76('0xc'))[_0x0f76('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x0f76('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x0f76('0x7')](_0x0f76('0xd')),_0x3babd7['level'][_0x0f76('0xe')](),_0x5016fb,_0x3babd7[_0x0f76('0x9')]);}module[_0x0f76('0xf')]=function(_0x1ee637){return new winston[(_0x0f76('0x10'))]({'transports':[new winston[(_0x0f76('0x11'))]['File']({'name':util[_0x0f76('0x7')](_0x0f76('0x12'),_0x1ee637,_0x0f76('0x13')),'filename':filename(_0x1ee637,_0x0f76('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x355343){return formatter(_0x1ee637,_0x355343);}}),new winston['transports'][(_0x0f76('0x14'))]({'name':util['format'](_0x0f76('0x12'),_0x1ee637,_0x0f76('0x15')),'filename':filename(_0x1ee637,_0x0f76('0x15')),'level':_0x0f76('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38c918){return formatter(_0x1ee637,_0x38c918);}}),new winston['transports']['Console']({'level':process[_0x0f76('0x16')][_0x0f76('0x17')]||debugLevel,'json':![],'formatter':function(_0x5945b1){return formatter(_0x1ee637,_0x5945b1);}})]});}; \ No newline at end of file +var _0x868d=['/var','log','xcally','format','%s-%s.log','message','replace','{{{','}}}','toUpperCase','transports','File','%s-%s','error','info','Console','debugLevel','moment','winston','util','path','INFO','join'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0x868d,0x10e));var _0xd868=function(_0x2fbfe2,_0x3807a9){_0x2fbfe2=_0x2fbfe2-0x0;var _0x5ad6f6=_0x868d[_0x2fbfe2];return _0x5ad6f6;};'use strict';var moment=require(_0xd868('0x0'));var winston=require(_0xd868('0x1'));var util=require(_0xd868('0x2'));var path=require(_0xd868('0x3'));var debugLevel=_0xd868('0x4');function filename(_0x43d01e,_0xe7b6d2){return path[_0xd868('0x5')](_0xd868('0x6'),_0xd868('0x7'),_0xd868('0x8'),util[_0xd868('0x9')](_0xd868('0xa'),_0x43d01e,_0xe7b6d2));}function formatter(_0x318fba,_0x473208){_0x473208['message']=_0x473208[_0xd868('0xb')][_0xd868('0xc')](/@@{/g,_0xd868('0xd'))[_0xd868('0xc')](/}@@/g,_0xd868('0xe'))['replace'](/@{/g,'{{')[_0xd868('0xc')](/}@/g,'}}');return util[_0xd868('0x9')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xd868('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),_0x473208['level'][_0xd868('0xf')](),_0x318fba,_0x473208[_0xd868('0xb')]);}module['exports']=function(_0x482a81){return new winston['Logger']({'transports':[new winston[(_0xd868('0x10'))][(_0xd868('0x11'))]({'name':util['format'](_0xd868('0x12'),_0x482a81,_0xd868('0x13')),'filename':filename(_0x482a81,_0xd868('0x13')),'level':_0xd868('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f15cd){return formatter(_0x482a81,_0x1f15cd);}}),new winston[(_0xd868('0x10'))][(_0xd868('0x11'))]({'name':util['format'](_0xd868('0x12'),_0x482a81,_0xd868('0x14')),'filename':filename(_0x482a81,_0xd868('0x14')),'level':_0xd868('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x54956b){return formatter(_0x482a81,_0x54956b);}}),new winston[(_0xd868('0x10'))][(_0xd868('0x15'))]({'level':process['env'][_0xd868('0x16')]||debugLevel,'json':![],'formatter':function(_0x249bd9){return formatter(_0x482a81,_0x249bd9);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9248e59..ad2302e 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 _0xdf8f=['routing','../../services/routing/index.js','express','join','../../services/express/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x437e1c,_0x2795d6){var _0x2a48b4=function(_0x4ff34f){while(--_0x4ff34f){_0x437e1c['push'](_0x437e1c['shift']());}};_0x2a48b4(++_0x2795d6);}(_0xdf8f,0x1a0));var _0xfdf8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdf8f[_0x178e48];return _0x440d7e;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xfdf8('0x0'),'script':path[_0xfdf8('0x1')](__dirname,_0xfdf8('0x2'))},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0xfdf8('0x3'),'script':path['join'](__dirname,_0xfdf8('0x4'))},{'name':_0xfdf8('0x5'),'script':path['join'](__dirname,_0xfdf8('0x6'))},{'name':_0xfdf8('0x7'),'script':path[_0xfdf8('0x1')](__dirname,_0xfdf8('0x8'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0x8eab=['xdr','exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x410b6d,_0x13f475){var _0x3cc0c9=function(_0x1b27f4){while(--_0x1b27f4){_0x410b6d['push'](_0x410b6d['shift']());}};_0x3cc0c9(++_0x13f475);}(_0x8eab,0x13a));var _0xb8ea=function(_0x5f316a,_0xdd26f0){_0x5f316a=_0x5f316a-0x0;var _0x28e9f1=_0x8eab[_0x5f316a];return _0x28e9f1;};'use strict';var path=require(_0xb8ea('0x0'));var os=require('os');var config={'apps':[{'name':_0xb8ea('0x1'),'script':path['join'](__dirname,_0xb8ea('0x2'))},{'name':_0xb8ea('0x3'),'script':path[_0xb8ea('0x4')](__dirname,_0xb8ea('0x5'))},{'name':'agi','script':path[_0xb8ea('0x4')](__dirname,_0xb8ea('0x6'))},{'name':_0xb8ea('0x7'),'script':path[_0xb8ea('0x4')](__dirname,_0xb8ea('0x8'))},{'name':_0xb8ea('0x9'),'script':path[_0xb8ea('0x4')](__dirname,'../../services/routing/index.js')},{'name':_0xb8ea('0xa'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0xb8ea('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 453c30b..0169115 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 _0xa068=['list','describe','delete','dump','pm2','bluebird','./config','connect','start','then','disconnect','restart'];(function(_0x428065,_0xf48298){var _0x3b8a85=function(_0x1f7329){while(--_0x1f7329){_0x428065['push'](_0x428065['shift']());}};_0x3b8a85(++_0xf48298);}(_0xa068,0x16c));var _0x8a06=function(_0x144419,_0xbc26ae){_0x144419=_0x144419-0x0;var _0x1b652c=_0xa068[_0x144419];return _0x1b652c;};'use strict';var pm2=require(_0x8a06('0x0'));var BPromise=require(_0x8a06('0x1'));var config=require(_0x8a06('0x2'));function connect(){return new BPromise(function(_0x3fdd0,_0x4e9317){return pm2[_0x8a06('0x3')](function(_0x579503){if(_0x579503){return _0x4e9317(_0x579503);}return _0x3fdd0('connected');});});};exports[_0x8a06('0x4')]=function(_0x61b9d1){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x464119,_0x58b42e){return pm2[_0x8a06('0x4')](_0x61b9d1,function(_0x1934dd,_0x44b637){if(_0x1934dd){return _0x58b42e(_0x1934dd);}pm2[_0x8a06('0x6')]();return _0x464119(_0x44b637);});});});};exports['stop']=function(_0x369763){return connect()['then'](function(){return new BPromise(function(_0x561e15,_0x32f42b){return pm2['stop'](_0x369763,function(_0x2aa966,_0x1fd1ca){if(_0x2aa966){return _0x32f42b(_0x2aa966);}pm2['disconnect']();return _0x561e15(_0x1fd1ca);});});});};exports[_0x8a06('0x7')]=function(_0x427971){return connect()['then'](function(){return new BPromise(function(_0x292fb6,_0x2be751){return pm2['restart'](_0x427971,function(_0x4e50f1,_0xf36e17){if(_0x4e50f1){return _0x2be751(_0x4e50f1);}pm2[_0x8a06('0x6')]();return _0x292fb6(_0xf36e17);});});});};exports[_0x8a06('0x8')]=function(){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x5bd114,_0x39e265){return pm2[_0x8a06('0x8')](function(_0x359a23,_0x3d3142){if(_0x359a23){return _0x39e265(_0x359a23);}pm2[_0x8a06('0x6')]();return _0x5bd114(_0x3d3142);});});});};exports[_0x8a06('0x9')]=function(_0x15873e){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x25dbfb,_0xe469bb){return pm2['describe'](_0x15873e,function(_0x3cc2ac,_0x47d699){if(_0x3cc2ac){return _0xe469bb(_0x3cc2ac);}pm2[_0x8a06('0x6')]();return _0x25dbfb(_0x47d699);});});});};exports[_0x8a06('0xa')]=function(_0x27e73e){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x2150c7,_0x1de61f){return pm2[_0x8a06('0xa')](_0x27e73e,function(_0x58b85c,_0x2ad72c){if(_0x58b85c){return _0x1de61f(_0x58b85c);}pm2[_0x8a06('0x6')]();return _0x2150c7(_0x2ad72c);});});});};exports[_0x8a06('0xb')]=function(){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x3cb237,_0x5ce5d2){return pm2['dump'](function(_0x5b868d){if(_0x5b868d){return _0x5ce5d2(_0x5b868d);}return _0x3cb237('saved');});});});}; \ No newline at end of file +var _0xc815=['connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config','connect'];(function(_0x4ee1ac,_0x2da10c){var _0x5646d8=function(_0x133808){while(--_0x133808){_0x4ee1ac['push'](_0x4ee1ac['shift']());}};_0x5646d8(++_0x2da10c);}(_0xc815,0xcf));var _0x5c81=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc815[_0x17b6e3];return _0x3906f3;};'use strict';var pm2=require('pm2');var BPromise=require(_0x5c81('0x0'));var config=require(_0x5c81('0x1'));function connect(){return new BPromise(function(_0x95c161,_0x52e19b){return pm2[_0x5c81('0x2')](function(_0x5e9afd){if(_0x5e9afd){return _0x52e19b(_0x5e9afd);}return _0x95c161(_0x5c81('0x3'));});});};exports[_0x5c81('0x4')]=function(_0x1af335){return connect()[_0x5c81('0x5')](function(){return new BPromise(function(_0x21be36,_0x3f1966){return pm2[_0x5c81('0x4')](_0x1af335,function(_0x18feb2,_0x2ec609){if(_0x18feb2){return _0x3f1966(_0x18feb2);}pm2[_0x5c81('0x6')]();return _0x21be36(_0x2ec609);});});});};exports[_0x5c81('0x7')]=function(_0x549508){return connect()[_0x5c81('0x5')](function(){return new BPromise(function(_0x30c7d0,_0xb8c72b){return pm2[_0x5c81('0x7')](_0x549508,function(_0x489b57,_0x59782f){if(_0x489b57){return _0xb8c72b(_0x489b57);}pm2[_0x5c81('0x6')]();return _0x30c7d0(_0x59782f);});});});};exports[_0x5c81('0x8')]=function(_0x15e202){return connect()[_0x5c81('0x5')](function(){return new BPromise(function(_0x14e17f,_0x15af9e){return pm2['restart'](_0x15e202,function(_0x2c0fb2,_0x4319a4){if(_0x2c0fb2){return _0x15af9e(_0x2c0fb2);}pm2[_0x5c81('0x6')]();return _0x14e17f(_0x4319a4);});});});};exports[_0x5c81('0x9')]=function(){return connect()[_0x5c81('0x5')](function(){return new BPromise(function(_0x1454a8,_0x210147){return pm2[_0x5c81('0x9')](function(_0x19ff7a,_0x29904c){if(_0x19ff7a){return _0x210147(_0x19ff7a);}pm2[_0x5c81('0x6')]();return _0x1454a8(_0x29904c);});});});};exports[_0x5c81('0xa')]=function(_0x747769){return connect()[_0x5c81('0x5')](function(){return new BPromise(function(_0x339341,_0x32936a){return pm2[_0x5c81('0xa')](_0x747769,function(_0x46d6ab,_0x5b0ba8){if(_0x46d6ab){return _0x32936a(_0x46d6ab);}pm2[_0x5c81('0x6')]();return _0x339341(_0x5b0ba8);});});});};exports[_0x5c81('0xb')]=function(_0x2871f1){return connect()['then'](function(){return new BPromise(function(_0x50ac83,_0x5ed218){return pm2[_0x5c81('0xb')](_0x2871f1,function(_0x8e488f,_0x4a4afa){if(_0x8e488f){return _0x5ed218(_0x8e488f);}pm2['disconnect']();return _0x50ac83(_0x4a4afa);});});});};exports[_0x5c81('0xc')]=function(){return connect()[_0x5c81('0x5')](function(){return new BPromise(function(_0x40216a,_0x4688b5){return pm2[_0x5c81('0xc')](function(_0x34384f){if(_0x34384f){return _0x4688b5(_0x34384f);}return _0x40216a(_0x5c81('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index ecc91e6..d7a87d4 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 _0x795f=['system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','map','[CHAT]\x20Interactions\x20to\x20close:','join','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x795f,0x1bd));var _0xf795=function(_0x96d8ca,_0x59b44c){_0x96d8ca=_0x96d8ca-0x0;var _0x44a49e=_0x795f[_0x96d8ca];return _0x44a49e;};'use strict';var _=require('lodash');var moment=require(_0xf795('0x0'));var Redis=require(_0xf795('0x1'));var util=require('util');var config=require(_0xf795('0x2'));var db=require(_0xf795('0x3'))['db'];var logger=require(_0xf795('0x4'))(_0xf795('0x5'));config[_0xf795('0x6')]=_[_0xf795('0x7')](config[_0xf795('0x6')],{'host':_0xf795('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf795('0x6')]));function closeInteractions(){var _0x5ce517=0x0;var _0x16d56f=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xf795('0x9')],'where':{'id':0x1}})[_0xf795('0xa')](function(_0x24894b){_0x5ce517=_0x24894b[_0xf795('0x9')];if(_0x5ce517){return db[_0xf795('0xb')][_0xf795('0xc')]({'raw':!![],'attributes':['id',_0xf795('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x24894b[_0xf795('0x9')],_0xf795('0xe'))}}});}else{return[];}})[_0xf795('0xa')](function(_0x1f7831){if(_0x1f7831&&_0x1f7831['length']){_0x16d56f=_[_0xf795('0xf')](_0x1f7831||[],'id');logger['info'](_0xf795('0x10'),_0x16d56f[_0xf795('0x11')]());return db['ChatInteraction'][_0xf795('0x12')]({'closeReason':_0xf795('0x13'),'disposition':_0xf795('0x14'),'closed':!![],'closedAt':moment()['format'](_0xf795('0x15'))},{'where':{'id':_0x16d56f}});}})['then'](function(){if(_0x16d56f&&_0x16d56f['length']){logger['info'](_0xf795('0x16'),_0x16d56f[_0xf795('0x11')]());for(var _0x2638df=0x0;_0x2638df<_0x16d56f[_0xf795('0x17')];_0x2638df++){io[_0xf795('0x18')]('chatInteraction:update',{'id':_0x16d56f[_0x2638df],'closed':!![]});}}})[_0xf795('0x19')](function(_0x4e823a){logger[_0xf795('0x1a')](_0xf795('0x1b'),_0x4e823a?util['inspect'](_0x4e823a,{'showHidden':![],'depth':null}):'');});}exports[_0xf795('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6e19=['chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../mysqldb','../logger','redis','defaults','localhost'];(function(_0x20628b,_0x460042){var _0xf74f84=function(_0x362b27){while(--_0x362b27){_0x20628b['push'](_0x20628b['shift']());}};_0xf74f84(++_0x460042);}(_0x6e19,0xd1));var _0x96e1=function(_0x739b4d,_0x5c2e49){_0x739b4d=_0x739b4d-0x0;var _0x5dc5f6=_0x6e19[_0x739b4d];return _0x5dc5f6;};'use strict';var _=require(_0x96e1('0x0'));var moment=require(_0x96e1('0x1'));var Redis=require('ioredis');var util=require(_0x96e1('0x2'));var config=require('../../config/environment');var db=require(_0x96e1('0x3'))['db'];var logger=require(_0x96e1('0x4'))('schedule');config[_0x96e1('0x5')]=_[_0x96e1('0x6')](config[_0x96e1('0x5')],{'host':_0x96e1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x96e1('0x5')]));function closeInteractions(){var _0x38bd84=0x0;var _0x396f64=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x96e1('0x8')],'where':{'id':0x1}})[_0x96e1('0x9')](function(_0x45c027){_0x38bd84=_0x45c027[_0x96e1('0x8')];if(_0x38bd84){return db['ChatInteraction'][_0x96e1('0xa')]({'raw':!![],'attributes':['id',_0x96e1('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x96e1('0xc')](_0x45c027[_0x96e1('0x8')],_0x96e1('0xd'))}}});}else{return[];}})[_0x96e1('0x9')](function(_0x9257d3){if(_0x9257d3&&_0x9257d3[_0x96e1('0xe')]){_0x396f64=_['map'](_0x9257d3||[],'id');logger[_0x96e1('0xf')](_0x96e1('0x10'),_0x396f64['join']());return db[_0x96e1('0x11')][_0x96e1('0x12')]({'closeReason':_0x96e1('0x13'),'disposition':_0x96e1('0x14'),'closed':!![],'closedAt':moment()[_0x96e1('0x15')](_0x96e1('0x16'))},{'where':{'id':_0x396f64}});}})[_0x96e1('0x9')](function(){if(_0x396f64&&_0x396f64['length']){logger[_0x96e1('0xf')](_0x96e1('0x17'),_0x396f64[_0x96e1('0x18')]());for(var _0x3edc5e=0x0;_0x3edc5e<_0x396f64['length'];_0x3edc5e++){io['emit'](_0x96e1('0x19'),{'id':_0x396f64[_0x3edc5e],'closed':!![]});}}})[_0x96e1('0x1a')](function(_0x42c0a2){logger[_0x96e1('0x1b')](_0x96e1('0x1c'),_0x42c0a2?util[_0x96e1('0x1d')](_0x42c0a2,{'showHidden':![],'depth':null}):'');});}exports[_0x96e1('0x1e')]=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 2fc6519..f62ddd5 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 _0xaacd=['run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop','stop\x20cron','active','update','update\x20cron','run','path','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','secure','auth','user','\x22%s\x22\x20<%s>','name','bcc','format','subtractNumber','savename','%s.%s','extname','zip','join','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','error','error\x20mail','info','email\x20sent','catch','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','exec\x20custom\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','then','keys','map','keyBy','difference','intersection','toString','exists','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve'];(function(_0x1ea707,_0x1e0a43){var _0xe1b4e0=function(_0x18ebc3){while(--_0x18ebc3){_0x1ea707['push'](_0x1ea707['shift']());}};_0xe1b4e0(++_0x1e0a43);}(_0xaacd,0x119));var _0xdaac=function(_0x31a961,_0xe193c3){_0x31a961=_0x31a961-0x0;var _0xd09142=_0xaacd[_0x31a961];return _0xd09142;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xdaac('0x0'));var _=require(_0xdaac('0x1'));var moment=require('moment');var CronJobManager=require(_0xdaac('0x2'));var jayson=require(_0xdaac('0x3'));var BPromise=require('bluebird');var logger=require(_0xdaac('0x4'))(_0xdaac('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xdaac('0x6'));var client=jayson[_0xdaac('0x7')][_0xdaac('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x19a766,_0x367521){return function(){logger['info'](_0xdaac('0x9'),_0x19a766[_0xdaac('0xa')]);var _0x3d151b=!![];var _0x1f8d3d={'tls':{'rejectUnauthorized':![]}};if(_0x19a766[_0xdaac('0xb')]['Smtp'][_0xdaac('0xc')]){_0x1f8d3d[_0xdaac('0xc')]=_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')][_0xdaac('0xc')];}else{_0x1f8d3d[_0xdaac('0xe')]=_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')]['host'];_0x1f8d3d['port']=_0x19a766[_0xdaac('0xb')]['Smtp']['port'];_0x1f8d3d[_0xdaac('0xf')]=_0x19a766['MailAccount'][_0xdaac('0xd')][_0xdaac('0xf')];}if(_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')]['authentication']){_0x1f8d3d[_0xdaac('0x10')]={'user':_0x19a766['MailAccount'][_0xdaac('0xd')][_0xdaac('0x11')],'pass':_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')]['pass']};}var _0x467a4e={'account':_0x1f8d3d,'message':{'from':util['format'](_0xdaac('0x12'),_0x19a766['MailAccount'][_0xdaac('0x13')],_0x19a766[_0xdaac('0xb')]['email']||_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')][_0xdaac('0x11')]),'to':_0x19a766[_0xdaac('0xa')],'cc':_0x19a766['cc'],'bcc':_0x19a766[_0xdaac('0x14')],'subject':util[_0xdaac('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x367521[_0xdaac('0x13')],_0x19a766[_0xdaac('0x16')],_0x19a766['subtractUnit'])}};var _0x29aea4=path['join'](__dirname,'../../files/reports');var _0x3897ff=_0x367521[_0xdaac('0x17')];var _0x23fb02=util[_0xdaac('0x15')](_0xdaac('0x18'),path['basename'](_0x367521[_0xdaac('0x17')],path[_0xdaac('0x19')](_0x367521[_0xdaac('0x17')])),_0xdaac('0x1a'));var _0xd425ec=path[_0xdaac('0x1b')](_0x29aea4,_0x3897ff);var _0x21de2c=path[_0xdaac('0x1b')](_0x29aea4,_0x23fb02);if(fs[_0xdaac('0x1c')](_0xd425ec)){_0x367521[_0xdaac('0x1d')]=_0xdaac('0x1e');_0x467a4e[_0xdaac('0x1f')]['attachments']=[{'filename':_0x3897ff,'path':_0xd425ec}];_0x467a4e[_0xdaac('0x1f')][_0xdaac('0x20')]=util[_0xdaac('0x15')](_0xdaac('0x21'),JSON[_0xdaac('0x22')](_0x367521,null,0x2));}else if(fs['existsSync'](_0x21de2c)){_0x367521[_0xdaac('0x1d')]=_0xdaac('0x1e');_0x467a4e[_0xdaac('0x1f')][_0xdaac('0x23')]=[{'filename':_0x23fb02,'path':_0x21de2c}];}else{_0x467a4e[_0xdaac('0x1f')]['text']=_0xdaac('0x24');if(!_0x19a766[_0xdaac('0x25')]){_0x3d151b=![];logger['info'](_0xdaac('0x26'));}}if(_0x3d151b){return client['request'](_0xdaac('0x27'),_0x467a4e)['then'](function(_0x5510cf){if(_0x5510cf[_0xdaac('0x28')]){return logger[_0xdaac('0x28')](_0xdaac('0x29'),JSON[_0xdaac('0x22')](_0x5510cf));}return logger[_0xdaac('0x2a')](_0xdaac('0x2b'));})[_0xdaac('0x2c')](function(_0xd44144){return logger[_0xdaac('0x28')](_0xdaac('0x29'),JSON[_0xdaac('0x22')](_0xd44144));});}};}function handleError(){return function(_0xa743f1){return logger[_0xdaac('0x28')](JSON[_0xdaac('0x22')](_0xa743f1));};}function handleResult(_0xcd9406){return function(_0x55c5ec){logger[_0xdaac('0x2a')]('data',JSON['stringify'](_0x55c5ec));if(_0xcd9406[_0xdaac('0xb')]&&_0xcd9406['MailAccount'][_0xdaac('0xd')]&&!_[_0xdaac('0x2d')](_0xcd9406[_0xdaac('0xa')])){setTimeout(handleSendEmail(_0xcd9406,_0x55c5ec),0x3c*0x3e8);}};}function handleJob(_0x517043){return function(){try{if(_[_0xdaac('0x2d')](_0x517043[_0xdaac('0x16')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xdaac('0x2d')](_0x517043['subtractUnit'])){return logger[_0xdaac('0x2a')](_0xdaac('0x2e'));}var _0x3c51f5={'startDate':moment()[_0xdaac('0x2f')](_0x517043['subtractNumber'],_0x517043['subtractUnit'])[_0xdaac('0x15')](_0xdaac('0x30')),'endDate':moment()[_0xdaac('0x15')](_0xdaac('0x30')),'type':_0xdaac('0x31'),'output':_0x517043[_0xdaac('0x32')],'name':_0x517043[_0xdaac('0x13')]};if(!_['isNil'](_0x517043[_0xdaac('0x33')])){logger[_0xdaac('0x2a')](_0xdaac('0x34'),_0x517043[_0xdaac('0x33')]);return analyticDefaultReportController['runReport']({'id':_0x517043[_0xdaac('0x33')]},_0x3c51f5)['then'](handleResult(_0x517043))[_0xdaac('0x2c')](handleError());}if(!_[_0xdaac('0x2d')](_0x517043['CustomReportId'])){logger[_0xdaac('0x2a')](_0xdaac('0x35'),_0x517043[_0xdaac('0x36')]);return analyticCustomReportController[_0xdaac('0x37')]({'id':_0x517043[_0xdaac('0x36')]},_0x3c51f5)['then'](handleResult(_0x517043))[_0xdaac('0x2c')](handleError());}}catch(_0x414fac){logger[_0xdaac('0x28')](JSON['stringify'](_0x414fac));}return logger[_0xdaac('0x2a')](_0xdaac('0x38'));};}function getJobs(_0xd74c81){var _0x37173c={};if(_0xd74c81){_0x37173c['id']=_0xd74c81;}return db[_0xdaac('0x39')][_0xdaac('0x3a')]({'where':_0x37173c,'include':[{'model':db[_0xdaac('0xb')],'attributes':['id',_0xdaac('0x13'),_0xdaac('0xa')],'include':[{'model':db[_0xdaac('0x3b')],'as':_0xdaac('0xd')}]}]})[_0xdaac('0x3c')](function(_0x21423c){var _0x1378f6=_[_0xdaac('0x3d')](manager['jobs']);var _0x2c2374=_[_0xdaac('0x3e')](_0x21423c,function(_0x11a469){return _0x11a469['id']['toString']();});var _0x258056=_[_0xdaac('0x3f')](_0x21423c,function(_0x25211c){return _0x25211c['id']['toString']();});var _0x1132ce=_0xd74c81?_0x2c2374:_[_0xdaac('0x40')](_0x2c2374,_0x1378f6);var _0xdc5c2e=_[_0xdaac('0x41')](_0x2c2374,_0x1378f6);var _0x5138fc=_[_0xdaac('0x40')](_0x1378f6,_0x2c2374);var _0x35e588;var _0x4d0c7c;for(_0x35e588=0x0;_0x35e588<_0x5138fc['length']&&!_0xd74c81;_0x35e588+=0x1){_0x4d0c7c=_0x5138fc[_0x35e588][_0xdaac('0x42')]();if(manager[_0xdaac('0x43')](_0x4d0c7c)){manager['stop'](_0x4d0c7c);manager[_0xdaac('0x44')](_0x4d0c7c);logger[_0xdaac('0x2a')](_0xdaac('0x45'),_0x4d0c7c);}}logger[_0xdaac('0x2a')](_0xdaac('0x46'),JSON[_0xdaac('0x22')](_0x1132ce));for(_0x35e588=0x0;_0x35e588<_0x1132ce[_0xdaac('0x47')];_0x35e588+=0x1){_0x4d0c7c=_0x1132ce[_0x35e588][_0xdaac('0x42')]();logger[_0xdaac('0x2a')](_0xdaac('0x48'),_0x4d0c7c);if(_0xd74c81){logger[_0xdaac('0x2a')](_0xdaac('0x49'),_0xd74c81);logger[_0xdaac('0x2a')](JSON[_0xdaac('0x22')](_0x258056[_0x4d0c7c]));BPromise[_0xdaac('0x4a')]()[_0xdaac('0x3c')](handleJob(_0x258056[_0x4d0c7c]));logger[_0xdaac('0x2a')](_0xdaac('0x4b'),_0x258056[_0x4d0c7c]['name'],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}else if(_0x258056[_0x4d0c7c][_0xdaac('0x4c')]&&_0x258056[_0x4d0c7c]['active']&&moment()[_0xdaac('0x4d')](_0x258056[_0x4d0c7c][_0xdaac('0x4e')],_0x258056[_0x4d0c7c][_0xdaac('0x4f')])){manager[_0xdaac('0x50')](_0x4d0c7c,_0x258056[_0x4d0c7c][_0xdaac('0x4c')],handleJob(_0x258056[_0x4d0c7c]));manager[_0xdaac('0x51')](_0x4d0c7c);logger['info'](_0xdaac('0x52'),_0x258056[_0x4d0c7c]['name'],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}else if(manager[_0xdaac('0x43')](_0x4d0c7c)){manager[_0xdaac('0x53')](_0x4d0c7c);manager[_0xdaac('0x44')](_0x4d0c7c);logger[_0xdaac('0x2a')](_0xdaac('0x54'),_0x258056[_0x4d0c7c][_0xdaac('0x13')],_0x258056[_0x4d0c7c]['cron']);}}for(_0x35e588=0x0,_0x4d0c7c;_0x35e588<_0xdc5c2e[_0xdaac('0x47')]&&!_0xd74c81;_0x35e588+=0x1){_0x4d0c7c=_0xdc5c2e[_0x35e588]['toString']();if(manager[_0xdaac('0x43')](_0x4d0c7c)){if(_0x258056[_0x4d0c7c][_0xdaac('0x4c')]&&_0x258056[_0x4d0c7c][_0xdaac('0x55')]&&moment()[_0xdaac('0x4d')](_0x258056[_0x4d0c7c]['startAt'],_0x258056[_0x4d0c7c][_0xdaac('0x4f')])){manager[_0xdaac('0x56')](_0x4d0c7c,_0x258056[_0x4d0c7c]['cron'],handleJob(_0x258056[_0x4d0c7c]));logger[_0xdaac('0x2a')](_0xdaac('0x57'),_0x258056[_0x4d0c7c][_0xdaac('0x13')],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}else{manager['stop'](_0x4d0c7c);manager[_0xdaac('0x44')](_0x4d0c7c);logger['info'](_0xdaac('0x54'),_0x258056[_0x4d0c7c]['name'],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}}}})[_0xdaac('0x2c')](function(_0x636d65){logger[_0xdaac('0x28')](JSON[_0xdaac('0x22')](_0x636d65));});}exports[_0xdaac('0x58')]=function(_0x4ce995){return getJobs(_0x4ce995);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2b07=['update','update\x20cron','util','path','lodash','moment','cron-job-manager','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','user','\x22%s\x22\x20<%s>','name','format','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','exists','stop\x20cron'];(function(_0x207ced,_0x54af55){var _0x104700=function(_0x472217){while(--_0x472217){_0x207ced['push'](_0x207ced['shift']());}};_0x104700(++_0x54af55);}(_0x2b07,0x16a));var _0x72b0=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x2b07[_0x25662e];return _0x59b7bc;};'use strict';var fs=require('fs');var util=require(_0x72b0('0x0'));var path=require(_0x72b0('0x1'));var _=require(_0x72b0('0x2'));var moment=require(_0x72b0('0x3'));var CronJobManager=require(_0x72b0('0x4'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x72b0('0x5'))('schedule');var db=require(_0x72b0('0x6'))['db'];var analyticCustomReportController=require(_0x72b0('0x7'));var analyticDefaultReportController=require(_0x72b0('0x8'));var client=jayson[_0x72b0('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4668d9,_0x1ea007){return function(){logger[_0x72b0('0xa')](_0x72b0('0xb'),_0x4668d9[_0x72b0('0xc')]);var _0x35f1df=!![];var _0x49f118={'tls':{'rejectUnauthorized':![]}};if(_0x4668d9['MailAccount'][_0x72b0('0xd')][_0x72b0('0xe')]){_0x49f118[_0x72b0('0xe')]=_0x4668d9[_0x72b0('0xf')][_0x72b0('0xd')][_0x72b0('0xe')];}else{_0x49f118[_0x72b0('0x10')]=_0x4668d9[_0x72b0('0xf')][_0x72b0('0xd')][_0x72b0('0x10')];_0x49f118[_0x72b0('0x11')]=_0x4668d9[_0x72b0('0xf')][_0x72b0('0xd')]['port'];_0x49f118['secure']=_0x4668d9[_0x72b0('0xf')][_0x72b0('0xd')][_0x72b0('0x12')];}if(_0x4668d9[_0x72b0('0xf')]['Smtp']['authentication']){_0x49f118['auth']={'user':_0x4668d9[_0x72b0('0xf')][_0x72b0('0xd')][_0x72b0('0x13')],'pass':_0x4668d9[_0x72b0('0xf')]['Smtp']['pass']};}var _0x18c1bf={'account':_0x49f118,'message':{'from':util['format'](_0x72b0('0x14'),_0x4668d9['MailAccount'][_0x72b0('0x15')],_0x4668d9['MailAccount'][_0x72b0('0xc')]||_0x4668d9[_0x72b0('0xf')]['Smtp'][_0x72b0('0x13')]),'to':_0x4668d9[_0x72b0('0xc')],'cc':_0x4668d9['cc'],'bcc':_0x4668d9['bcc'],'subject':util[_0x72b0('0x16')]('Report\x20%s\x20last\x20%s\x20%s',_0x1ea007[_0x72b0('0x15')],_0x4668d9['subtractNumber'],_0x4668d9[_0x72b0('0x17')])}};var _0x513415=path[_0x72b0('0x18')](__dirname,_0x72b0('0x19'));var _0x8f80b9=_0x1ea007[_0x72b0('0x1a')];var _0x2e0764=util[_0x72b0('0x16')](_0x72b0('0x1b'),path[_0x72b0('0x1c')](_0x1ea007[_0x72b0('0x1a')],path[_0x72b0('0x1d')](_0x1ea007[_0x72b0('0x1a')])),_0x72b0('0x1e'));var _0x48009f=path[_0x72b0('0x18')](_0x513415,_0x8f80b9);var _0x166804=path[_0x72b0('0x18')](_0x513415,_0x2e0764);if(fs[_0x72b0('0x1f')](_0x48009f)){_0x1ea007[_0x72b0('0x20')]=_0x72b0('0x21');_0x18c1bf[_0x72b0('0x22')]['attachments']=[{'filename':_0x8f80b9,'path':_0x48009f}];_0x18c1bf[_0x72b0('0x22')][_0x72b0('0x23')]=util[_0x72b0('0x16')](_0x72b0('0x24'),JSON[_0x72b0('0x25')](_0x1ea007,null,0x2));}else if(fs[_0x72b0('0x1f')](_0x166804)){_0x1ea007['status']='Sent';_0x18c1bf[_0x72b0('0x22')][_0x72b0('0x26')]=[{'filename':_0x2e0764,'path':_0x166804}];}else{_0x18c1bf[_0x72b0('0x22')][_0x72b0('0x23')]=_0x72b0('0x27');if(!_0x4668d9[_0x72b0('0x28')]){_0x35f1df=![];logger['info'](_0x72b0('0x29'));}}if(_0x35f1df){return client[_0x72b0('0x2a')](_0x72b0('0x2b'),_0x18c1bf)['then'](function(_0x4e1e5f){if(_0x4e1e5f[_0x72b0('0x2c')]){return logger[_0x72b0('0x2c')](_0x72b0('0x2d'),JSON[_0x72b0('0x25')](_0x4e1e5f));}return logger[_0x72b0('0xa')](_0x72b0('0x2e'));})[_0x72b0('0x2f')](function(_0x211eea){return logger[_0x72b0('0x2c')](_0x72b0('0x2d'),JSON['stringify'](_0x211eea));});}};}function handleError(){return function(_0x3355bc){return logger['error'](JSON['stringify'](_0x3355bc));};}function handleResult(_0x227b99){return function(_0x3b894a){logger[_0x72b0('0xa')](_0x72b0('0x30'),JSON[_0x72b0('0x25')](_0x3b894a));if(_0x227b99['MailAccount']&&_0x227b99[_0x72b0('0xf')]['Smtp']&&!_[_0x72b0('0x31')](_0x227b99['email'])){setTimeout(handleSendEmail(_0x227b99,_0x3b894a),0x3c*0x3e8);}};}function handleJob(_0x389d6b){return function(){try{if(_['isNil'](_0x389d6b[_0x72b0('0x32')])){return logger[_0x72b0('0xa')](_0x72b0('0x33'));}if(_[_0x72b0('0x31')](_0x389d6b['subtractUnit'])){return logger[_0x72b0('0xa')](_0x72b0('0x34'));}var _0x4376c2={'startDate':moment()[_0x72b0('0x35')](_0x389d6b[_0x72b0('0x32')],_0x389d6b[_0x72b0('0x17')])[_0x72b0('0x16')](_0x72b0('0x36')),'endDate':moment()[_0x72b0('0x16')](_0x72b0('0x36')),'type':'scheduled','output':_0x389d6b[_0x72b0('0x37')],'name':_0x389d6b[_0x72b0('0x15')]};if(!_[_0x72b0('0x31')](_0x389d6b[_0x72b0('0x38')])){logger[_0x72b0('0xa')](_0x72b0('0x39'),_0x389d6b[_0x72b0('0x38')]);return analyticDefaultReportController[_0x72b0('0x3a')]({'id':_0x389d6b[_0x72b0('0x38')]},_0x4376c2)[_0x72b0('0x3b')](handleResult(_0x389d6b))[_0x72b0('0x2f')](handleError());}if(!_[_0x72b0('0x31')](_0x389d6b[_0x72b0('0x3c')])){logger[_0x72b0('0xa')](_0x72b0('0x3d'),_0x389d6b['CustomReportId']);return analyticCustomReportController[_0x72b0('0x3a')]({'id':_0x389d6b[_0x72b0('0x3c')]},_0x4376c2)[_0x72b0('0x3b')](handleResult(_0x389d6b))[_0x72b0('0x2f')](handleError());}}catch(_0x41ccfc){logger[_0x72b0('0x2c')](JSON[_0x72b0('0x25')](_0x41ccfc));}return logger[_0x72b0('0xa')](_0x72b0('0x3e'));};}function getJobs(_0x12be07){var _0x277413={};if(_0x12be07){_0x277413['id']=_0x12be07;}return db['Schedule']['findAll']({'where':_0x277413,'include':[{'model':db[_0x72b0('0xf')],'attributes':['id',_0x72b0('0x15'),_0x72b0('0xc')],'include':[{'model':db[_0x72b0('0x3f')],'as':_0x72b0('0xd')}]}]})[_0x72b0('0x3b')](function(_0x262dc0){var _0x5f2b5c=_[_0x72b0('0x40')](manager[_0x72b0('0x41')]);var _0x46c6a3=_[_0x72b0('0x42')](_0x262dc0,function(_0x519655){return _0x519655['id']['toString']();});var _0x5cbf27=_[_0x72b0('0x43')](_0x262dc0,function(_0x47bff0){return _0x47bff0['id'][_0x72b0('0x44')]();});var _0x5f3547=_0x12be07?_0x46c6a3:_[_0x72b0('0x45')](_0x46c6a3,_0x5f2b5c);var _0x342881=_[_0x72b0('0x46')](_0x46c6a3,_0x5f2b5c);var _0x369929=_['difference'](_0x5f2b5c,_0x46c6a3);var _0x10484f;var _0x3b5906;for(_0x10484f=0x0;_0x10484f<_0x369929[_0x72b0('0x47')]&&!_0x12be07;_0x10484f+=0x1){_0x3b5906=_0x369929[_0x10484f][_0x72b0('0x44')]();if(manager['exists'](_0x3b5906)){manager[_0x72b0('0x48')](_0x3b5906);manager[_0x72b0('0x49')](_0x3b5906);logger[_0x72b0('0xa')](_0x72b0('0x4a'),_0x3b5906);}}logger['info']('toRun',JSON[_0x72b0('0x25')](_0x5f3547));for(_0x10484f=0x0;_0x10484f<_0x5f3547[_0x72b0('0x47')];_0x10484f+=0x1){_0x3b5906=_0x5f3547[_0x10484f]['toString']();logger['info'](_0x72b0('0x4b'),_0x3b5906);if(_0x12be07){logger['info'](_0x72b0('0x4c'),_0x12be07);logger[_0x72b0('0xa')](JSON[_0x72b0('0x25')](_0x5cbf27[_0x3b5906]));BPromise[_0x72b0('0x4d')]()['then'](handleJob(_0x5cbf27[_0x3b5906]));logger[_0x72b0('0xa')](_0x72b0('0x4e'),_0x5cbf27[_0x3b5906][_0x72b0('0x15')],_0x5cbf27[_0x3b5906][_0x72b0('0x4f')]);}else if(_0x5cbf27[_0x3b5906][_0x72b0('0x4f')]&&_0x5cbf27[_0x3b5906][_0x72b0('0x50')]&&moment()[_0x72b0('0x51')](_0x5cbf27[_0x3b5906][_0x72b0('0x52')],_0x5cbf27[_0x3b5906][_0x72b0('0x53')])){manager['add'](_0x3b5906,_0x5cbf27[_0x3b5906][_0x72b0('0x4f')],handleJob(_0x5cbf27[_0x3b5906]));manager[_0x72b0('0x54')](_0x3b5906);logger[_0x72b0('0xa')](_0x72b0('0x55'),_0x5cbf27[_0x3b5906][_0x72b0('0x15')],_0x5cbf27[_0x3b5906][_0x72b0('0x4f')]);}else if(manager[_0x72b0('0x56')](_0x3b5906)){manager[_0x72b0('0x48')](_0x3b5906);manager[_0x72b0('0x49')](_0x3b5906);logger[_0x72b0('0xa')](_0x72b0('0x57'),_0x5cbf27[_0x3b5906][_0x72b0('0x15')],_0x5cbf27[_0x3b5906]['cron']);}}for(_0x10484f=0x0,_0x3b5906;_0x10484f<_0x342881[_0x72b0('0x47')]&&!_0x12be07;_0x10484f+=0x1){_0x3b5906=_0x342881[_0x10484f]['toString']();if(manager['exists'](_0x3b5906)){if(_0x5cbf27[_0x3b5906][_0x72b0('0x4f')]&&_0x5cbf27[_0x3b5906]['active']&&moment()['isBetween'](_0x5cbf27[_0x3b5906][_0x72b0('0x52')],_0x5cbf27[_0x3b5906][_0x72b0('0x53')])){manager[_0x72b0('0x58')](_0x3b5906,_0x5cbf27[_0x3b5906][_0x72b0('0x4f')],handleJob(_0x5cbf27[_0x3b5906]));logger[_0x72b0('0xa')](_0x72b0('0x59'),_0x5cbf27[_0x3b5906][_0x72b0('0x15')],_0x5cbf27[_0x3b5906][_0x72b0('0x4f')]);}else{manager[_0x72b0('0x48')](_0x3b5906);manager['deleteJob'](_0x3b5906);logger[_0x72b0('0xa')](_0x72b0('0x57'),_0x5cbf27[_0x3b5906][_0x72b0('0x15')],_0x5cbf27[_0x3b5906]['cron']);}}}})['catch'](function(_0x3dfc70){logger['error'](JSON['stringify'](_0x3dfc70));});}exports['run']=function(_0x93b26a){return getJobs(_0x93b26a);};exports[_0x72b0('0x54')]=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 0ecb571..a7f3834 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 _0x0abf=['Neutral','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','catch','name','SequelizeValidationError','lodash','request-promise','util','../../config/logger','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative'];(function(_0x2e8dd4,_0x1a9d97){var _0x564dec=function(_0xe2bd7c){while(--_0xe2bd7c){_0x2e8dd4['push'](_0x2e8dd4['shift']());}};_0x564dec(++_0x1a9d97);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};var _=require(_0xf0ab('0x0'));var AWS=require('aws-sdk');var rp=require(_0xf0ab('0x1'));var util=require(_0xf0ab('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xf0ab('0x3'))('transcribe');function getTranscriptionJob(_0x7ea4e0,_0x3be05e,_0x2efe43,_0xbb1f91){return new Promise(function(_0x2ab7d6,_0x4d2ea8){var _0x233afe=new AWS['TranscribeService']({'accessKeyId':_0x3be05e,'secretAccessKey':_0x7ea4e0,'region':_0x2efe43});_0x233afe[_0xf0ab('0x4')]({'TranscriptionJobName':_0xbb1f91},function(_0x3f7e2b,_0x3ca099){if(_0x3f7e2b){return _0x4d2ea8(_0x3f7e2b);}else{return _0x2ab7d6(_0x3ca099);}});});}function sentiment(_0x236b07,_0x480f49,_0x472508,_0x4688d8,_0x1e7887){return new Promise(function(_0x4ab8e7,_0x5d25a0){var _0x30042c=new AWS['Comprehend']({'accessKeyId':_0x480f49,'secretAccessKey':_0x236b07,'region':_0x472508});_0x30042c[_0xf0ab('0x5')]({'Text':_0x4688d8,'LanguageCode':_0x1e7887[_0xf0ab('0x6')](0x0,0x2)},function(_0xf34cc6,_0x410df5){if(_0xf34cc6){return _0x5d25a0(_0xf34cc6);}else{return _0x4ab8e7(_0x410df5);}});});}function checkTranscribeJob(_0x2dc4f8,_0x38ca67,_0x34ccdc){var _0x4fdd5f;return new BPromise(function(_0x39b4e7,_0x2cc002){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x9'),_0x2dc4f8['id'],_0x2dc4f8[_0xf0ab('0xa')]));return getTranscriptionJob(_0x34ccdc[_0xf0ab('0xb')],_0x34ccdc[_0xf0ab('0xc')],_0x38ca67[_0xf0ab('0xd')],_0x2dc4f8[_0xf0ab('0xa')])[_0xf0ab('0xe')](function(_0x221bac){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0xf'),_0x2dc4f8['id'],_0x2dc4f8['transcribeName'],_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')]));if(!_0x2dc4f8[_0xf0ab('0x12')]){switch(_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')]){case _0xf0ab('0x13'):var _0x3a0edf={'transcribeStatus':_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')],'fileUri':_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x14')][_0xf0ab('0x15')]};logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x16'),_0x2dc4f8['id']));return rp({'uri':_0x221bac[_0xf0ab('0x10')]['Transcript'][_0xf0ab('0x15')],'json':!![]})[_0xf0ab('0xe')](function(_0x1e1483){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x17'),_0x2dc4f8['id']));if(_0x1e1483&&_0x1e1483[_0xf0ab('0x18')]&&_0x1e1483[_0xf0ab('0x18')][_0xf0ab('0x19')]&&_0x1e1483[_0xf0ab('0x18')][_0xf0ab('0x19')]['length']){_0x3a0edf['fileText']='';for(var _0x4eee21=0x0;_0x4eee21<_0x1e1483[_0xf0ab('0x18')]['transcripts'][_0xf0ab('0x1a')];_0x4eee21++){_0x3a0edf[_0xf0ab('0x12')]+=_0x1e1483['results'][_0xf0ab('0x19')][_0x4eee21][_0xf0ab('0x1b')]+'';}}return _0x2dc4f8[_0xf0ab('0x1c')](_0x3a0edf);})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util['format'](_0xf0ab('0x1d'),_0x2dc4f8['id']));if(!_0x2dc4f8['tempSentiment']){throw new db['Sequelize'][(_0xf0ab('0x1e'))](_0xf0ab('0x1f'));}if(!_0x38ca67[_0xf0ab('0x20')]||!_0x38ca67[_0xf0ab('0x21')]||!_0x38ca67[_0xf0ab('0x22')]||!_0x38ca67[_0xf0ab('0x23')]||!_0x38ca67[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x26'));}if(!_0x3a0edf[_0xf0ab('0x12')]){throw new Error(_0xf0ab('0x27'));}if(_0x38ca67['sentimentAccountId']===_0x34ccdc['id']){return _0x34ccdc;}else{return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1eff91){if(!_0x1eff91){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1eff91['data1']||!_0x1eff91[_0xf0ab('0xc')]){throw new db['Sequelize'][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x4fdd5f=_0x1eff91;logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2dc4f8['id']));return sentiment(_0x4fdd5f['data1'],_0x4fdd5f[_0xf0ab('0xc')],_0x38ca67[_0xf0ab('0x22')],_0x3a0edf[_0xf0ab('0x12')],_0x38ca67[_0xf0ab('0x23')]);})[_0xf0ab('0xe')](function(_0x36195d){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x2a'),_0x2dc4f8['id']));return _0x2dc4f8[_0xf0ab('0x1c')]({'sentiment':_0x36195d[_0xf0ab('0x2b')],'sPositive':_0x36195d[_0xf0ab('0x2c')][_0xf0ab('0x2d')],'sNegative':_0x36195d[_0xf0ab('0x2c')]['Negative'],'sMixed':_0x36195d[_0xf0ab('0x2c')][_0xf0ab('0x2e')],'sNeutral':_0x36195d[_0xf0ab('0x2c')]['Neutral']});})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dc4f8['id']));_0x39b4e7();});case _0xf0ab('0x2f'):return _0x2dc4f8['update']({'transcribeStatus':_0xf0ab('0x2f'),'failureReason':_0x221bac['TranscriptionJob'][_0xf0ab('0x30')]})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x1d'),_0x2dc4f8['id']));_0x39b4e7();});default:logger[_0xf0ab('0x7')](util['format'](_0xf0ab('0x31'),_0x2dc4f8['id']));break;}}else{return BPromise[_0xf0ab('0x32')]()['then'](function(){if(!_0x2dc4f8[_0xf0ab('0x33')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x1f'));}if(!_0x38ca67[_0xf0ab('0x20')]||!_0x38ca67[_0xf0ab('0x21')]||!_0x38ca67[_0xf0ab('0x22')]||!_0x38ca67['language']||!_0x38ca67[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2dc4f8[_0xf0ab('0x12')]){throw new Error(_0xf0ab('0x27'));}if(_0x38ca67[_0xf0ab('0x21')]===_0x34ccdc['id']){return _0x34ccdc;}else{return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf0ab('0xe')](function(_0x39a212){if(!_0x39a212){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x34'));}if(!_0x39a212[_0xf0ab('0xb')]||!_0x39a212[_0xf0ab('0xc')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x35'));}_0x4fdd5f=_0x39a212;logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x36'),_0x2dc4f8['id']));return sentiment(_0x4fdd5f['data1'],_0x4fdd5f['data2'],_0x38ca67[_0xf0ab('0x22')],_0x2dc4f8['fileText'],_0x38ca67[_0xf0ab('0x23')]);})[_0xf0ab('0xe')](function(_0x4bbdf6){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2dc4f8['id']));return _0x2dc4f8[_0xf0ab('0x1c')]({'sentiment':_0x4bbdf6[_0xf0ab('0x2b')],'sPositive':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x2d')],'sNegative':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x37')],'sMixed':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x2e')],'sNeutral':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x38')],'transcribeStatus':_0xf0ab('0x13')});})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dc4f8['id']));_0x39b4e7();});}})['catch'](function(_0x3f173c){if(_0x3f173c){if(!_0x3f173c['name']||_0x3f173c['name']!=='SequelizeValidationError'){logger[_0xf0ab('0x39')](util[_0xf0ab('0x8')](_0xf0ab('0x3a'),_0x2dc4f8['id']),util[_0xf0ab('0x3b')](_0x3f173c,{'showHidden':![],'depth':null}));}}_0x39b4e7();});});}function checkTranscribe(){var _0x1a2ee9;var _0x132ada;var _0x472c1b;return db[_0xf0ab('0x3c')][_0xf0ab('0x3d')]({'where':{'transcribeStatus':_0xf0ab('0x3e')}})[_0xf0ab('0xe')](function(_0x157287){if(!_0x157287||!_0x157287['length']){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x3f'));}_0x1a2ee9=_0x157287;return db[_0xf0ab('0x40')][_0xf0ab('0x29')]({'where':{'id':0x1}});})[_0xf0ab('0xe')](function(_0x430921){if(!_0x430921){throw new db[(_0xf0ab('0x25'))]['ValidationError']('Settings\x20not\x20available');}_0x132ada=_0x430921;if(!_0x132ada['transcribe']||!_0x132ada[_0xf0ab('0x41')]||!_0x132ada[_0xf0ab('0xd')]||!_0x132ada['language']||!_0x132ada[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))]['ValidationError'](_0xf0ab('0x42'));}return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_0x132ada[_0xf0ab('0x41')]}});})[_0xf0ab('0xe')](function(_0x33112b){if(!_0x33112b){throw new db[(_0xf0ab('0x25'))]['ValidationError'](_0xf0ab('0x34'));}if(!_0x33112b['data1']||!_0x33112b[_0xf0ab('0xc')]){throw new db['Sequelize'][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x472c1b=_0x33112b;var _0x535274=[];_0x1a2ee9[_0xf0ab('0x43')](function(_0x58ac39){_0x535274[_0xf0ab('0x44')](checkTranscribeJob(_0x58ac39,_0x132ada,_0x472c1b));});return BPromise['all'](_0x535274);})[_0xf0ab('0x45')](function(_0x488001){if(_0x488001){if(!_0x488001[_0xf0ab('0x46')]||_0x488001[_0xf0ab('0x46')]!==_0xf0ab('0x47')){logger['error'](util['inspect'](_0x488001,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x6a00=['lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','then','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Neutral','FAILED','resolve','Sentiment\x20Analysis\x20not\x20requested','Transcript\x20not\x20available','Sentiment','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','all','catch'];(function(_0x59234e,_0x252b58){var _0xdb3005=function(_0x81126d){while(--_0x81126d){_0x59234e['push'](_0x59234e['shift']());}};_0xdb3005(++_0x252b58);}(_0x6a00,0xc9));var _0x06a0=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x6a00[_0xc4001c];return _0x49f7bc;};var _=require(_0x06a0('0x0'));var AWS=require(_0x06a0('0x1'));var rp=require('request-promise');var util=require(_0x06a0('0x2'));var BPromise=require(_0x06a0('0x3'));var db=require(_0x06a0('0x4'))['db'];var logger=require(_0x06a0('0x5'))(_0x06a0('0x6'));function getTranscriptionJob(_0x47fa1f,_0x4a423e,_0x34c32c,_0x3b042f){return new Promise(function(_0x1de0c2,_0xa49954){var _0xa78ab8=new AWS[(_0x06a0('0x7'))]({'accessKeyId':_0x4a423e,'secretAccessKey':_0x47fa1f,'region':_0x34c32c});_0xa78ab8['getTranscriptionJob']({'TranscriptionJobName':_0x3b042f},function(_0xac416d,_0x22d146){if(_0xac416d){return _0xa49954(_0xac416d);}else{return _0x1de0c2(_0x22d146);}});});}function sentiment(_0x91eaab,_0x35af04,_0x38a7d3,_0x26c616,_0x4109fd){return new Promise(function(_0x1a3df3,_0x469f3d){var _0x380d12=new AWS[(_0x06a0('0x8'))]({'accessKeyId':_0x35af04,'secretAccessKey':_0x91eaab,'region':_0x38a7d3});_0x380d12['detectSentiment']({'Text':_0x26c616,'LanguageCode':_0x4109fd['substring'](0x0,0x2)},function(_0x2155d6,_0x4103c8){if(_0x2155d6){return _0x469f3d(_0x2155d6);}else{return _0x1a3df3(_0x4103c8);}});});}function checkTranscribeJob(_0x43279d,_0x1d2b7f,_0x688bf0){var _0x177234;return new BPromise(function(_0x2f9712,_0x33f494){logger['info'](util[_0x06a0('0x9')](_0x06a0('0xa'),_0x43279d['id'],_0x43279d[_0x06a0('0xb')]));return getTranscriptionJob(_0x688bf0['data1'],_0x688bf0[_0x06a0('0xc')],_0x1d2b7f[_0x06a0('0xd')],_0x43279d[_0x06a0('0xb')])['then'](function(_0x4083e7){logger[_0x06a0('0xe')](util['format'](_0x06a0('0xf'),_0x43279d['id'],_0x43279d[_0x06a0('0xb')],_0x4083e7[_0x06a0('0x10')][_0x06a0('0x11')]));if(!_0x43279d[_0x06a0('0x12')]){switch(_0x4083e7['TranscriptionJob'][_0x06a0('0x11')]){case _0x06a0('0x13'):var _0x35e239={'transcribeStatus':_0x4083e7[_0x06a0('0x10')][_0x06a0('0x11')],'fileUri':_0x4083e7[_0x06a0('0x10')][_0x06a0('0x14')][_0x06a0('0x15')]};logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x43279d['id']));return rp({'uri':_0x4083e7[_0x06a0('0x10')][_0x06a0('0x14')][_0x06a0('0x15')],'json':!![]})[_0x06a0('0x16')](function(_0x422603){logger[_0x06a0('0xe')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x43279d['id']));if(_0x422603&&_0x422603[_0x06a0('0x17')]&&_0x422603[_0x06a0('0x17')]['transcripts']&&_0x422603[_0x06a0('0x17')][_0x06a0('0x18')][_0x06a0('0x19')]){_0x35e239['fileText']='';for(var _0x98ae05=0x0;_0x98ae05<_0x422603[_0x06a0('0x17')]['transcripts']['length'];_0x98ae05++){_0x35e239['fileText']+=_0x422603[_0x06a0('0x17')][_0x06a0('0x18')][_0x98ae05][_0x06a0('0x1a')]+'';}}return _0x43279d[_0x06a0('0x1b')](_0x35e239);})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')](_0x06a0('0x1c'),_0x43279d['id']));if(!_0x43279d[_0x06a0('0x1d')]){throw new db['Sequelize'][(_0x06a0('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1d2b7f[_0x06a0('0x1f')]||!_0x1d2b7f[_0x06a0('0x20')]||!_0x1d2b7f[_0x06a0('0x21')]||!_0x1d2b7f[_0x06a0('0x22')]||!_0x1d2b7f[_0x06a0('0x23')]){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x25'));}if(!_0x35e239[_0x06a0('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x1d2b7f[_0x06a0('0x20')]===_0x688bf0['id']){return _0x688bf0;}else{return db[_0x06a0('0x26')][_0x06a0('0x27')]({'where':{'id':_settings[_0x06a0('0x20')]}});}})[_0x06a0('0x16')](function(_0x485e26){if(!_0x485e26){throw new db[(_0x06a0('0x24'))]['ValidationError'](_0x06a0('0x28'));}if(!_0x485e26[_0x06a0('0x29')]||!_0x485e26['data2']){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x2a'));}_0x177234=_0x485e26;logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x43279d['id']));return sentiment(_0x177234[_0x06a0('0x29')],_0x177234['data2'],_0x1d2b7f[_0x06a0('0x21')],_0x35e239[_0x06a0('0x12')],_0x1d2b7f['language']);})[_0x06a0('0x16')](function(_0x12ffdb){logger['info'](util[_0x06a0('0x9')](_0x06a0('0x2b'),_0x43279d['id']));return _0x43279d['update']({'sentiment':_0x12ffdb['Sentiment'],'sPositive':_0x12ffdb[_0x06a0('0x2c')][_0x06a0('0x2d')],'sNegative':_0x12ffdb['SentimentScore'][_0x06a0('0x2e')],'sMixed':_0x12ffdb[_0x06a0('0x2c')]['Mixed'],'sNeutral':_0x12ffdb[_0x06a0('0x2c')][_0x06a0('0x2f')]});})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x43279d['id']));_0x2f9712();});case _0x06a0('0x30'):return _0x43279d[_0x06a0('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x4083e7[_0x06a0('0x10')]['FailureReason']})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')](_0x06a0('0x1c'),_0x43279d['id']));_0x2f9712();});default:logger[_0x06a0('0xe')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x43279d['id']));break;}}else{return BPromise[_0x06a0('0x31')]()[_0x06a0('0x16')](function(){if(!_0x43279d[_0x06a0('0x1d')]){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x32'));}if(!_0x1d2b7f[_0x06a0('0x1f')]||!_0x1d2b7f['sentimentAccountId']||!_0x1d2b7f['sentimentRegion']||!_0x1d2b7f[_0x06a0('0x22')]||!_0x1d2b7f['bucket']){throw new db['Sequelize']['ValidationError'](_0x06a0('0x25'));}if(!_0x43279d['fileText']){throw new Error(_0x06a0('0x33'));}if(_0x1d2b7f[_0x06a0('0x20')]===_0x688bf0['id']){return _0x688bf0;}else{return db[_0x06a0('0x26')][_0x06a0('0x27')]({'where':{'id':_settings[_0x06a0('0x20')]}});}})[_0x06a0('0x16')](function(_0x5ce0dd){if(!_0x5ce0dd){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x28'));}if(!_0x5ce0dd[_0x06a0('0x29')]||!_0x5ce0dd['data2']){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x177234=_0x5ce0dd;logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x43279d['id']));return sentiment(_0x177234['data1'],_0x177234['data2'],_0x1d2b7f[_0x06a0('0x21')],_0x43279d['fileText'],_0x1d2b7f[_0x06a0('0x22')]);})['then'](function(_0x208681){logger[_0x06a0('0xe')](util['format'](_0x06a0('0x2b'),_0x43279d['id']));return _0x43279d['update']({'sentiment':_0x208681[_0x06a0('0x34')],'sPositive':_0x208681[_0x06a0('0x2c')][_0x06a0('0x2d')],'sNegative':_0x208681[_0x06a0('0x2c')][_0x06a0('0x2e')],'sMixed':_0x208681[_0x06a0('0x2c')]['Mixed'],'sNeutral':_0x208681[_0x06a0('0x2c')][_0x06a0('0x2f')],'transcribeStatus':'COMPLETED'});})[_0x06a0('0x16')](function(){logger[_0x06a0('0xe')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x43279d['id']));_0x2f9712();});}})['catch'](function(_0x4121f6){if(_0x4121f6){if(!_0x4121f6[_0x06a0('0x35')]||_0x4121f6[_0x06a0('0x35')]!==_0x06a0('0x36')){logger[_0x06a0('0x37')](util[_0x06a0('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x43279d['id']),util[_0x06a0('0x38')](_0x4121f6,{'showHidden':![],'depth':null}));}}_0x2f9712();});});}function checkTranscribe(){var _0x42921a;var _0x1b7ca7;var _0x423bc0;return db[_0x06a0('0x39')][_0x06a0('0x3a')]({'where':{'transcribeStatus':_0x06a0('0x3b')}})[_0x06a0('0x16')](function(_0x3cddf6){if(!_0x3cddf6||!_0x3cddf6['length']){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x3c'));}_0x42921a=_0x3cddf6;return db[_0x06a0('0x3d')][_0x06a0('0x27')]({'where':{'id':0x1}});})[_0x06a0('0x16')](function(_0x4e9351){if(!_0x4e9351){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x3e'));}_0x1b7ca7=_0x4e9351;if(!_0x1b7ca7[_0x06a0('0x6')]||!_0x1b7ca7[_0x06a0('0x3f')]||!_0x1b7ca7[_0x06a0('0xd')]||!_0x1b7ca7['language']||!_0x1b7ca7[_0x06a0('0x23')]){throw new db['Sequelize'][(_0x06a0('0x1e'))](_0x06a0('0x40'));}return db[_0x06a0('0x26')]['findOne']({'where':{'id':_0x1b7ca7[_0x06a0('0x3f')]}});})[_0x06a0('0x16')](function(_0x207989){if(!_0x207989){throw new db[(_0x06a0('0x24'))][(_0x06a0('0x1e'))](_0x06a0('0x28'));}if(!_0x207989['data1']||!_0x207989[_0x06a0('0xc')]){throw new db['Sequelize']['ValidationError'](_0x06a0('0x2a'));}_0x423bc0=_0x207989;var _0x1ddc6b=[];_0x42921a['forEach'](function(_0x438406){_0x1ddc6b['push'](checkTranscribeJob(_0x438406,_0x1b7ca7,_0x423bc0));});return BPromise[_0x06a0('0x41')](_0x1ddc6b);})[_0x06a0('0x42')](function(_0x3ae8a9){if(_0x3ae8a9){if(!_0x3ae8a9[_0x06a0('0x35')]||_0x3ae8a9[_0x06a0('0x35')]!==_0x06a0('0x36')){logger['error'](util[_0x06a0('0x38')](_0x3ae8a9,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 05d69bd..c508d4e 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 _0x172c=['then','emit','whatsappInteraction:update','catch','start','lodash','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','findAll','lastMsgAt','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2923f9,_0x2b19c8){var _0x3df535=function(_0x8091de){while(--_0x8091de){_0x2923f9['push'](_0x2923f9['shift']());}};_0x3df535(++_0x2b19c8);}(_0x172c,0x95));var _0xc172=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x172c[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xc172('0x0'));var moment=require('moment');var Redis=require(_0xc172('0x1'));var util=require('util');var config=require(_0xc172('0x2'));var db=require(_0xc172('0x3'))['db'];var logger=require(_0xc172('0x4'))(_0xc172('0x5'));config[_0xc172('0x6')]=_[_0xc172('0x7')](config[_0xc172('0x6')],{'host':_0xc172('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x1634f6=[];return db['WhatsappInteraction'][_0xc172('0x9')]({'raw':!![],'attributes':['id',_0xc172('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})['then'](function(_0x5de4f2){if(_0x5de4f2&&_0x5de4f2[_0xc172('0xb')]){_0x1634f6=_[_0xc172('0xc')](_0x5de4f2||[],'id');logger['info'](_0xc172('0xd'),_0x1634f6[_0xc172('0xe')]());return db[_0xc172('0xf')][_0xc172('0x10')]({'closeReason':_0xc172('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xc172('0x12'))},{'where':{'id':_0x1634f6}});}})[_0xc172('0x13')](function(){if(_0x1634f6&&_0x1634f6['length']){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x1634f6[_0xc172('0xe')]());for(var _0x20d53c=0x0;_0x20d53c<_0x1634f6['length'];_0x20d53c++){io[_0xc172('0x14')](_0xc172('0x15'),{'id':_0x1634f6[_0x20d53c],'closed':!![]});}}})[_0xc172('0x16')](function(_0x193afd){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x193afd?util['inspect'](_0x193afd,{'showHidden':![],'depth':null}):'');});}exports[_0xc172('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9e9f=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','../../mysqldb','../logger','redis','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','format','length'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x9e9f,0x1cd));var _0xf9e9=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0x9e9f[_0x1d7037];return _0x4d6568;};'use strict';var _=require(_0xf9e9('0x0'));var moment=require(_0xf9e9('0x1'));var Redis=require(_0xf9e9('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0xf9e9('0x3'))['db'];var logger=require(_0xf9e9('0x4'))('schedule');config[_0xf9e9('0x5')]=_['defaults'](config['redis'],{'host':_0xf9e9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf9e9('0x5')]));function closeInteractions(){var _0x290499=[];return db[_0xf9e9('0x7')][_0xf9e9('0x8')]({'raw':!![],'attributes':['id',_0xf9e9('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf9e9('0xa')](0x18,_0xf9e9('0xb'))}}})[_0xf9e9('0xc')](function(_0x24609c){if(_0x24609c&&_0x24609c['length']){_0x290499=_[_0xf9e9('0xd')](_0x24609c||[],'id');logger['info'](_0xf9e9('0xe'),_0x290499[_0xf9e9('0xf')]());return db['WhatsappInteraction']['update']({'closeReason':_0xf9e9('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xf9e9('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x290499}});}})['then'](function(){if(_0x290499&&_0x290499[_0xf9e9('0x12')]){logger['info'](_0xf9e9('0x13'),_0x290499[_0xf9e9('0xf')]());for(var _0x336c8d=0x0;_0x336c8d<_0x290499['length'];_0x336c8d++){io[_0xf9e9('0x14')]('whatsappInteraction:update',{'id':_0x290499[_0x336c8d],'closed':!![]});}}})[_0xf9e9('0x15')](function(_0x2d780d){logger['error'](_0xf9e9('0x16'),_0x2d780d?util['inspect'](_0x2d780d,{'showHidden':![],'depth':null}):'');});}exports[_0xf9e9('0x17')]=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 7fcbc7e..64a8f64 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x102b=['then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x102b,0x172));var _0xb102=function(_0xfbffea,_0xb5d80a){_0xfbffea=_0xfbffea-0x0;var _0xc99a5d=_0x102b[_0xfbffea];return _0xc99a5d;};'use strict';var util=require(_0xb102('0x0'));var db=require(_0xb102('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb102('0x2')]({'id':i,'firstName':_0xb102('0x3')+i,'lastName':_0xb102('0x4')+i,'phone':0xf879fb460+i,'email':_0xb102('0x5')+i+_0xb102('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb102('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb102('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xb102('0x3')+i,'lastName':_0xb102('0x4')+i,'phone':0xf879fb460+i,'email':_0xb102('0x5')+i+_0xb102('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb102('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb102('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb102('0x7')](),'updatedAt':Date[_0xb102('0x7')]()});}db[_0xb102('0x8')][_0xb102('0x9')]({'where':{}})[_0xb102('0xa')](function(){return db[_0xb102('0x8')]['bulkCreate'](contacts);})[_0xb102('0xa')](function(){console[_0xb102('0xb')](_0xb102('0xc'),_0xb102('0xd'));return db['CmHopper'][_0xb102('0x9')]({'where':{}});})[_0xb102('0xa')](function(){return db[_0xb102('0xe')][_0xb102('0xf')](hopper);})['then'](function(){console[_0xb102('0xb')]('finished\x20populating',_0xb102('0x10'));return db[_0xb102('0x8')][_0xb102('0xf')](contacts2);})[_0xb102('0xa')](function(){console[_0xb102('0xb')]('finished\x20populating',_0xb102('0x11'));return db[_0xb102('0xe')][_0xb102('0xf')](hopper2);})[_0xb102('0xa')](function(){console[_0xb102('0xb')](_0xb102('0xc'),_0xb102('0x12'));})[_0xb102('0x13')](function(_0x540be4){console[_0xb102('0xb')](_0x540be4);}); \ No newline at end of file +var _0x37d8=['destroy','then','bulkCreate','log','CmHopper','finished\x20populating','contacts2','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x37d8,0x127));var _0x837d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37d8[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x837d('0x0'));var db=require(_0x837d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x837d('0x2')]({'id':i,'firstName':_0x837d('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x837d('0x4')+i+_0x837d('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x837d('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x837d('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x837d('0x2')]({'id':i,'firstName':_0x837d('0x3')+i,'lastName':_0x837d('0x7')+i,'phone':0xf879fb460+i,'email':_0x837d('0x4')+i+_0x837d('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x837d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x837d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x837d('0x8')][_0x837d('0x9')]({'where':{}})[_0x837d('0xa')](function(){return db[_0x837d('0x8')][_0x837d('0xb')](contacts);})[_0x837d('0xa')](function(){console[_0x837d('0xc')]('finished\x20populating','contacts1');return db[_0x837d('0xd')][_0x837d('0x9')]({'where':{}});})['then'](function(){return db[_0x837d('0xd')][_0x837d('0xb')](hopper);})[_0x837d('0xa')](function(){console['log'](_0x837d('0xe'),'hopper1');return db[_0x837d('0x8')]['bulkCreate'](contacts2);})[_0x837d('0xa')](function(){console['log'](_0x837d('0xe'),_0x837d('0xf'));return db[_0x837d('0xd')]['bulkCreate'](hopper2);})[_0x837d('0xa')](function(){console['log'](_0x837d('0xe'),'hopper2');})['catch'](function(_0x3bf36c){console[_0x837d('0xc')](_0x3bf36c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 383ca3d..c14298f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4a3=['add\x20user','catch','../mysqldb','format','%s%s','agent','%s%s@xcally.com','friend','udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0xb4a3,0x112));var _0x3b4a=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0xb4a3[_0x5e6bec];return _0x5dc5cf;};'use strict';var util=require('util');var db=require(_0x3b4a('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x3b4a('0x1')](_0x3b4a('0x2'),_0x3b4a('0x3'),i),'fullname':util[_0x3b4a('0x1')](_0x3b4a('0x2'),_0x3b4a('0x3'),i),'email':util[_0x3b4a('0x1')](_0x3b4a('0x4'),'agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x3b4a('0x5'),'transport':[_0x3b4a('0x6'),'ws','wss'],'disallow':[_0x3b4a('0x7')],'allow':[_0x3b4a('0x8')],'defaultuser':util['format'](_0x3b4a('0x2'),_0x3b4a('0x3'),i),'encryption':_0x3b4a('0x9'),'avpf':_0x3b4a('0x9'),'force_avp':_0x3b4a('0x9'),'icesupport':'yes','dtlsenable':_0x3b4a('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3b4a('0xa'),'dtlssetup':'actpass','callerid':util[_0x3b4a('0x1')](_0x3b4a('0xb'),util[_0x3b4a('0x1')](_0x3b4a('0x2'),_0x3b4a('0x3'),i),0xfa0+i)});}db[_0x3b4a('0xc')]['bulkCreate'](users)[_0x3b4a('0xd')](function(){console[_0x3b4a('0xe')](_0x3b4a('0xf'));})[_0x3b4a('0x10')](function(_0xd2ac64){console[_0x3b4a('0xe')](_0xd2ac64);}); \ No newline at end of file +var _0x5e9c=['log','add\x20user','catch','util','../mysqldb','agent','%s%s','format','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x532ed7,_0x470a53){var _0x4a2902=function(_0x12a0a5){while(--_0x12a0a5){_0x532ed7['push'](_0x532ed7['shift']());}};_0x4a2902(++_0x470a53);}(_0x5e9c,0x67));var _0xc5e9=function(_0x3ebfec,_0x4a52b1){_0x3ebfec=_0x3ebfec-0x0;var _0x2b6afa=_0x5e9c[_0x3ebfec];return _0x2b6afa;};'use strict';var util=require(_0xc5e9('0x0'));var db=require(_0xc5e9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0xc5e9('0x2'),i),'fullname':util['format'](_0xc5e9('0x3'),_0xc5e9('0x2'),i),'email':util[_0xc5e9('0x4')](_0xc5e9('0x5'),_0xc5e9('0x2'),i),'role':_0xc5e9('0x2'),'password':_0xc5e9('0x6'),'internal':0xfa0+i,'type':_0xc5e9('0x7'),'transport':[_0xc5e9('0x8'),'ws',_0xc5e9('0x9')],'disallow':[_0xc5e9('0xa')],'allow':[_0xc5e9('0xb')],'defaultuser':util[_0xc5e9('0x4')](_0xc5e9('0x3'),_0xc5e9('0x2'),i),'encryption':_0xc5e9('0xc'),'avpf':_0xc5e9('0xc'),'force_avp':_0xc5e9('0xc'),'icesupport':_0xc5e9('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xc5e9('0xd'),'dtlssetup':_0xc5e9('0xe'),'callerid':util['format'](_0xc5e9('0xf'),util['format'](_0xc5e9('0x3'),_0xc5e9('0x2'),i),0xfa0+i)});}db[_0xc5e9('0x10')]['bulkCreate'](users)['then'](function(){console[_0xc5e9('0x11')](_0xc5e9('0x12'));})[_0xc5e9('0x13')](function(_0x5ce87d){console[_0xc5e9('0x11')](_0x5ce87d);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 4c4eb18..006b244 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb89c=['nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','role','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','telephone','Campaign','format','%s:queue:%s','length','user:%s','handshake','User','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','FaxQueues','MailQueues','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','connectedAt','SocketIO\x20'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xb89c,0x198));var _0xcb89=function(_0x30bdf2,_0x332d40){_0x30bdf2=_0x30bdf2-0x0;var _0xb0ab50=_0xb89c[_0x30bdf2];return _0xb0ab50;};'use strict';var _=require(_0xcb89('0x0'));var util=require(_0xcb89('0x1'));var BPromise=require(_0xcb89('0x2'));var db=require(_0xcb89('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xcb89('0x4')],'include':[{'as':_0xcb89('0x5'),'model':db['User'],'attributes':['id',_0xcb89('0x4'),_0xcb89('0x6')],'raw':!![],'where':{'role':_0xcb89('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xcb89('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xcb89('0x4')],'where':{'role':_0xcb89('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xcb89('0x8')],'where':{'type':_0xcb89('0x9')}};function getAssociatedResources(_0x5419ce,_0x4d7f50,_0x46aa90){return db['UserProfileSection'][_0xcb89('0xa')]({'where':{'name':_0x5419ce,'userProfileId':_0x4d7f50},'raw':!![]})[_0xcb89('0xb')](function(_0xbff62){if(_0xbff62){if(_0xbff62[_0xcb89('0xc')]){switch(_0x5419ce){case _0xcb89('0xd'):case _0xcb89('0xe'):case'FaxQueues':case _0xcb89('0xf'):case'MailQueues':case _0xcb89('0x10'):case _0xcb89('0x11'):return db[_0x46aa90][_0xcb89('0x12')](queryQueues);case _0xcb89('0x13'):return db[_0x46aa90][_0xcb89('0x12')](queryTelephones);case _0xcb89('0x14'):return db[_0x46aa90][_0xcb89('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x46aa90][_0xcb89('0x12')](queryCampaigns);}}else{return db[_0xcb89('0x15')]['findAll']({'attributes':[_0xcb89('0x16')],'where':{'sectionId':_0xbff62['id']},'raw':!![]})[_0xcb89('0xb')](function(_0x1805fa){if(_0x1805fa){var _0x50a395={'where':{'id':_[_0xcb89('0x17')](_0x1805fa,'resourceId')},'raw':!![]};switch(_0x46aa90){case'User':_0x50a395[_0xcb89('0x18')][_0xcb89('0x6')]=_0xcb89('0x19');break;case _0xcb89('0x1a'):_0x50a395[_0xcb89('0x18')][_0xcb89('0x8')]=_0xcb89('0x9');break;}return db[_0x46aa90][_0xcb89('0x12')](_0x50a395);}else{return[];}});}}else{return[];}})['then'](function(_0x122eae){return _0x122eae;});}function joinOrLeaveQueues(_0x2bcb0b,_0x5ec8a3,_0x4c3fb9,_0x4262ac){_0x2bcb0b[_0x5ec8a3](util[_0xcb89('0x1b')](_0xcb89('0x1c'),_0x4c3fb9,_0x4262ac[_0xcb89('0x4')]));if(_0x4262ac[_0xcb89('0x5')]){for(var _0x355994=0x0;_0x355994<_0x4262ac[_0xcb89('0x5')][_0xcb89('0x1d')];_0x355994+=0x1){_0x2bcb0b[_0x5ec8a3](util['format'](_0xcb89('0x1e'),_0x4262ac[_0xcb89('0x5')][_0x355994][_0xcb89('0x4')]));}}}function joinOrLeave(_0x25ed37,_0x5d164c,_0x136ecb){var _0x4e81e2;if(_0x25ed37[_0xcb89('0x1f')]['query']['id']){db[_0xcb89('0x20')][_0xcb89('0x21')]({'attributes':['id',_0xcb89('0x4'),'role',_0xcb89('0x22')],'where':{'id':_0x25ed37[_0xcb89('0x1f')][_0xcb89('0x23')]['id']},'include':[{'model':db[_0xcb89('0x24')],'as':_0xcb89('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xcb89('0x26')],'as':_0xcb89('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xcb89('0x28')],'as':_0xcb89('0x29'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xcb89('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xcb89('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xcb89('0xb')](function(_0x407daa){if(_0x407daa){_0x4e81e2=_0x407daa;_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x1e'),_0x407daa[_0xcb89('0x4')]));var _0x12ec9c=[];switch(_0x407daa[_0xcb89('0x6')]){case _0xcb89('0x2c'):_0x25ed37[_0x5d164c](_0xcb89('0x2d'));_0x25ed37[_0x5d164c](_0xcb89('0x2e'));if(queryQueues[_0xcb89('0x2f')]('include')){delete queryQueues['include'];}_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x31')]['findAll'](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x32')]['findAll'](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x33')][_0xcb89('0x12')](queryQueues));_0x12ec9c['push'](db[_0xcb89('0x34')]['findAll'](queryQueues));_0x12ec9c['push'](db[_0xcb89('0x35')][_0xcb89('0x12')](queryQueues));_0x12ec9c[_0xcb89('0x30')](db['OpenchannelQueue'][_0xcb89('0x12')](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x36')]['findAll'](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x20')][_0xcb89('0x12')](queryTelephones));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x37')][_0xcb89('0x12')](queryTrunks));_0x12ec9c['push'](db[_0xcb89('0x1a')][_0xcb89('0x12')](queryCampaigns));_0x12ec9c['push'](db[_0xcb89('0x20')][_0xcb89('0x12')](queryAgents));break;case _0xcb89('0x38'):_0x25ed37[_0x5d164c]('voice:inbound');_0x25ed37[_0x5d164c](_0xcb89('0x2e'));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0xd'),_0x407daa[_0xcb89('0x22')],_0xcb89('0x31')));_0x12ec9c['push'](getAssociatedResources('ChatQueues',_0x407daa[_0xcb89('0x22')],_0xcb89('0x32')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x39'),_0x407daa['userProfileId'],'FaxQueue'));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources('SmsQueues',_0x407daa[_0xcb89('0x22')],_0xcb89('0x34')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x3a'),_0x407daa['userProfileId'],_0xcb89('0x35')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x10'),_0x407daa[_0xcb89('0x22')],_0xcb89('0x3b')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x11'),_0x407daa['userProfileId'],_0xcb89('0x36')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources('Telephones',_0x407daa[_0xcb89('0x22')],'User'));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x14'),_0x407daa[_0xcb89('0x22')],_0xcb89('0x37')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x3c'),_0x407daa['userProfileId'],'Campaign'));_0x12ec9c['push'](db[_0xcb89('0x20')][_0xcb89('0x12')](queryAgents));break;case _0xcb89('0x7'):_0x25ed37[_0x5d164c](_0xcb89('0x2d'));_0x25ed37[_0x5d164c]('voice:outbound');_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x3d')]({'attributes':['id','name']}));_0x12ec9c['push'](_0x407daa[_0xcb89('0x3e')]({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x3f')]({'attributes':['id','name']}));_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x40')]({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c[_0xcb89('0x30')](_0x407daa['getMailQueues']({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c['push'](_0x407daa[_0xcb89('0x41')]({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x42')]({'attributes':['id',_0xcb89('0x4')]}));break;}return BPromise['all'](_0x12ec9c);}})[_0xcb89('0xb')](function(_0x34f488){if(_0x34f488&&_0x34f488['length']){for(var _0x39ab55=0x0;_0x39ab55<_0x34f488[_0xcb89('0x1d')];_0x39ab55+=0x1){for(var _0x511841=0x0;_0x511841<_0x34f488[_0x39ab55]['length'];_0x511841+=0x1){switch(_0x39ab55){case 0x0:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x43'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x1:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x44'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x2:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x45'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x3:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x46'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x4:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x47'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x5:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x48'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x6:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x49'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x7:if(_0x4e81e2[_0xcb89('0x6')]!=='agent')_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x4a'),_0x34f488[_0x39ab55][_0x511841]['name']));break;case 0x8:if(_0x4e81e2[_0xcb89('0x6')]!=='agent')_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x4b'),_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x4')]));break;case 0x9:if(_0x4e81e2[_0xcb89('0x6')]!=='agent')_0x25ed37[_0x5d164c](util['format'](_0xcb89('0x4c'),_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x8')],_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x4')]));break;case 0xa:_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x1e'),_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x4')]));break;}}}}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x209157=_['map'](_0x4e81e2[_0xcb89('0x25')],'id');return _0x4e81e2[_0xcb89('0x4e')](_0x209157)[_0xcb89('0xb')](function(){for(var _0x5dd60f=0x0;_0x5dd60f<_0x209157[_0xcb89('0x1d')];_0x5dd60f+=0x1){_0x136ecb['emit'](_0xcb89('0x4f'),{'ChatInteractionId':Number(_0x209157[_0x5dd60f]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x14dd28=_[_0xcb89('0x17')](_0x4e81e2[_0xcb89('0x27')],'id');return _0x4e81e2[_0xcb89('0x50')](_0x14dd28)[_0xcb89('0xb')](function(){for(var _0x2759a5=0x0;_0x2759a5<_0x14dd28[_0xcb89('0x1d')];_0x2759a5+=0x1){_0x136ecb[_0xcb89('0x51')](_0xcb89('0x52'),{'MailInteractionId':Number(_0x14dd28[_0x2759a5]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x3c9494=_['map'](_0x4e81e2['FaxInteractions'],'id');return _0x4e81e2[_0xcb89('0x53')](_0x3c9494)[_0xcb89('0xb')](function(){for(var _0x50c87e=0x0;_0x50c87e<_0x3c9494['length'];_0x50c87e+=0x1){_0x136ecb[_0xcb89('0x51')](_0xcb89('0x54'),{'FaxInteractionId':Number(_0x3c9494[_0x50c87e]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x422e01=_[_0xcb89('0x17')](_0x4e81e2[_0xcb89('0x2a')],'id');return _0x4e81e2[_0xcb89('0x55')](_0x422e01)[_0xcb89('0xb')](function(){for(var _0x1c7de1=0x0;_0x1c7de1<_0x422e01[_0xcb89('0x1d')];_0x1c7de1+=0x1){_0x136ecb[_0xcb89('0x51')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x422e01[_0x1c7de1]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x596fdb=_[_0xcb89('0x17')](_0x4e81e2[_0xcb89('0x2b')],'id');return _0x4e81e2['removeOpenchannelInteractions'](_0x596fdb)[_0xcb89('0xb')](function(){for(var _0x3b3f16=0x0;_0x3b3f16<_0x596fdb[_0xcb89('0x1d')];_0x3b3f16+=0x1){_0x136ecb['emit'](_0xcb89('0x56'),{'OpenchannelInteractionId':Number(_0x596fdb[_0x3b3f16]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x252414=_[_0xcb89('0x17')](_0x4e81e2['WhatsappInteractions'],'id');return _0x4e81e2['removeWhatsappInteractions'](_0x252414)[_0xcb89('0xb')](function(){for(var _0x2e2456=0x0;_0x2e2456<_0x252414[_0xcb89('0x1d')];_0x2e2456+=0x1){_0x136ecb[_0xcb89('0x51')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x252414[_0x2e2456]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0x57')](function(_0x204929){_0x25ed37[_0xcb89('0x58')](_0x204929);});}}function onDisconnect(_0x33a9ce,_0x57cd89){joinOrLeave(_0x33a9ce,_0xcb89('0x4d'),_0x57cd89);}function onConnect(_0x3294bc){joinOrLeave(_0x3294bc,_0xcb89('0x59'));}exports[_0xcb89('0x5a')]=function(_0x9eff03){_0x9eff03['on'](_0xcb89('0x5b'),function(_0x4aa066){_0x4aa066[_0xcb89('0x5c')](0x0);_0x4aa066['address']=_0x4aa066[_0xcb89('0x5d')][_0xcb89('0x5b')][_0xcb89('0x5e')]+':'+_0x4aa066['request'][_0xcb89('0x5b')]['remotePort'];_0x4aa066[_0xcb89('0x5f')]=new Date();_0x4aa066[_0xcb89('0x58')]=function(_0xb25ecf){console[_0xcb89('0x58')](_0xcb89('0x60')+_0x4aa066[_0xcb89('0x61')]['name']+'['+_0x4aa066['address']+']',_0xb25ecf);};_0x4aa066['on'](_0xcb89('0x62'),function(){onDisconnect(_0x4aa066,_0x9eff03);_0x4aa066['log'](_0xcb89('0x63'));});onConnect(_0x4aa066);_0x4aa066[_0xcb89('0x58')](_0xcb89('0x64'));});}; \ No newline at end of file +var _0x2581=['join','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','%s:queue:%s','length','user:%s','query','find','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','SmsQueue','MailQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','VoiceQueues','userProfileId','ChatQueue','FaxQueues','FaxQueue','OpenchannelQueue','Telephones','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','chat','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','leave','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','log'];(function(_0x4d07d1,_0x207b4b){var _0x504e9d=function(_0x2d7bb4){while(--_0x2d7bb4){_0x4d07d1['push'](_0x4d07d1['shift']());}};_0x504e9d(++_0x207b4b);}(_0x2581,0x72));var _0x1258=function(_0x50b1c5,_0x1cf2a9){_0x50b1c5=_0x50b1c5-0x0;var _0x344f99=_0x2581[_0x50b1c5];return _0x344f99;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var BPromise=require(_0x1258('0x2'));var db=require(_0x1258('0x3'))['db'];var config=require(_0x1258('0x4'));var queryQueues={'attributes':['id',_0x1258('0x5')],'include':[{'as':_0x1258('0x6'),'model':db[_0x1258('0x7')],'attributes':['id',_0x1258('0x5'),_0x1258('0x8')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1258('0x5')],'where':{'role':_0x1258('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1258('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x1258('0x5')],'where':{'role':_0x1258('0xa')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1258('0x5'),_0x1258('0xb')],'where':{'type':_0x1258('0xc')}};function getAssociatedResources(_0x1fcb74,_0x121279,_0x5574ea){return db[_0x1258('0xd')][_0x1258('0xe')]({'where':{'name':_0x1fcb74,'userProfileId':_0x121279},'raw':!![]})[_0x1258('0xf')](function(_0x803c81){if(_0x803c81){if(_0x803c81[_0x1258('0x10')]){switch(_0x1fcb74){case'VoiceQueues':case'ChatQueues':case'FaxQueues':case _0x1258('0x11'):case _0x1258('0x12'):case _0x1258('0x13'):case _0x1258('0x14'):return db[_0x5574ea][_0x1258('0x15')](queryQueues);case'Telephones':return db[_0x5574ea][_0x1258('0x15')](queryTelephones);case _0x1258('0x16'):return db[_0x5574ea]['findAll'](queryTrunks);case _0x1258('0x17'):return db[_0x5574ea][_0x1258('0x15')](queryCampaigns);}}else{return db[_0x1258('0x18')][_0x1258('0x15')]({'attributes':[_0x1258('0x19')],'where':{'sectionId':_0x803c81['id']},'raw':!![]})['then'](function(_0x2e1069){if(_0x2e1069){var _0x33c34a={'where':{'id':_[_0x1258('0x1a')](_0x2e1069,_0x1258('0x19'))},'raw':!![]};switch(_0x5574ea){case _0x1258('0x7'):_0x33c34a[_0x1258('0x1b')]['role']=_0x1258('0x9');break;case'Campaign':_0x33c34a[_0x1258('0x1b')][_0x1258('0xb')]=_0x1258('0xc');break;}return db[_0x5574ea][_0x1258('0x15')](_0x33c34a);}else{return[];}});}}else{return[];}})['then'](function(_0x8ad29c){return _0x8ad29c;});}function joinOrLeaveQueues(_0x11b4e4,_0x4b0990,_0x1911ae,_0x16ae6e){_0x11b4e4[_0x4b0990](util[_0x1258('0x1c')](_0x1258('0x1d'),_0x1911ae,_0x16ae6e['name']));if(_0x16ae6e[_0x1258('0x6')]){for(var _0x4f1d41=0x0;_0x4f1d41<_0x16ae6e[_0x1258('0x6')][_0x1258('0x1e')];_0x4f1d41+=0x1){_0x11b4e4[_0x4b0990](util[_0x1258('0x1c')](_0x1258('0x1f'),_0x16ae6e[_0x1258('0x6')][_0x4f1d41][_0x1258('0x5')]));}}}function joinOrLeave(_0x518384,_0x4bb110,_0x850c24){var _0x204c26;if(_0x518384['handshake'][_0x1258('0x20')]['id']){db[_0x1258('0x7')][_0x1258('0x21')]({'attributes':['id','name','role','userProfileId'],'where':{'id':_0x518384[_0x1258('0x22')][_0x1258('0x20')]['id']},'include':[{'model':db[_0x1258('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1258('0x24')],'as':_0x1258('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x1258('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1258('0x27')],'as':_0x1258('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x1258('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1258('0x2a')],'as':_0x1258('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x1258('0xf')](function(_0x59e40b){if(_0x59e40b){_0x204c26=_0x59e40b;_0x518384[_0x4bb110](util['format']('user:%s',_0x59e40b[_0x1258('0x5')]));var _0x5d580a=[];switch(_0x59e40b[_0x1258('0x8')]){case _0x1258('0x2c'):_0x518384[_0x4bb110](_0x1258('0x2d'));_0x518384[_0x4bb110]('voice:outbound');if(queryQueues[_0x1258('0x2e')](_0x1258('0x2f'))){delete queryQueues['include'];}_0x5d580a['push'](db['VoiceQueue']['findAll'](queryQueues));_0x5d580a['push'](db['ChatQueue']['findAll'](queryQueues));_0x5d580a['push'](db['FaxQueue'][_0x1258('0x15')](queryQueues));_0x5d580a[_0x1258('0x30')](db[_0x1258('0x31')][_0x1258('0x15')](queryQueues));_0x5d580a[_0x1258('0x30')](db[_0x1258('0x32')][_0x1258('0x15')](queryQueues));_0x5d580a[_0x1258('0x30')](db['OpenchannelQueue'][_0x1258('0x15')](queryQueues));_0x5d580a['push'](db[_0x1258('0x33')][_0x1258('0x15')](queryQueues));_0x5d580a[_0x1258('0x30')](db[_0x1258('0x7')][_0x1258('0x15')](queryTelephones));_0x5d580a['push'](db[_0x1258('0x34')]['findAll'](queryTrunks));_0x5d580a['push'](db[_0x1258('0x35')][_0x1258('0x15')](queryCampaigns));_0x5d580a[_0x1258('0x30')](db[_0x1258('0x7')]['findAll'](queryAgents));break;case _0x1258('0x36'):_0x518384[_0x4bb110](_0x1258('0x2d'));_0x518384[_0x4bb110](_0x1258('0x37'));_0x5d580a['push'](getAssociatedResources(_0x1258('0x38'),_0x59e40b['userProfileId'],'VoiceQueue'));_0x5d580a[_0x1258('0x30')](getAssociatedResources('ChatQueues',_0x59e40b[_0x1258('0x39')],_0x1258('0x3a')));_0x5d580a[_0x1258('0x30')](getAssociatedResources(_0x1258('0x3b'),_0x59e40b[_0x1258('0x39')],_0x1258('0x3c')));_0x5d580a['push'](getAssociatedResources(_0x1258('0x11'),_0x59e40b[_0x1258('0x39')],_0x1258('0x31')));_0x5d580a[_0x1258('0x30')](getAssociatedResources(_0x1258('0x12'),_0x59e40b[_0x1258('0x39')],'MailQueue'));_0x5d580a[_0x1258('0x30')](getAssociatedResources('OpenchannelQueues',_0x59e40b[_0x1258('0x39')],_0x1258('0x3d')));_0x5d580a[_0x1258('0x30')](getAssociatedResources(_0x1258('0x14'),_0x59e40b[_0x1258('0x39')],_0x1258('0x33')));_0x5d580a[_0x1258('0x30')](getAssociatedResources(_0x1258('0x3e'),_0x59e40b[_0x1258('0x39')],'User'));_0x5d580a['push'](getAssociatedResources(_0x1258('0x16'),_0x59e40b[_0x1258('0x39')],'Trunk'));_0x5d580a[_0x1258('0x30')](getAssociatedResources(_0x1258('0x17'),_0x59e40b['userProfileId'],_0x1258('0x35')));_0x5d580a['push'](db[_0x1258('0x7')][_0x1258('0x15')](queryAgents));break;case'agent':_0x518384[_0x4bb110](_0x1258('0x2d'));_0x518384[_0x4bb110](_0x1258('0x37'));_0x5d580a['push'](_0x59e40b[_0x1258('0x3f')]({'attributes':['id','name']}));_0x5d580a[_0x1258('0x30')](_0x59e40b['getChatQueues']({'attributes':['id',_0x1258('0x5')]}));_0x5d580a[_0x1258('0x30')](_0x59e40b[_0x1258('0x40')]({'attributes':['id','name']}));_0x5d580a[_0x1258('0x30')](_0x59e40b[_0x1258('0x41')]({'attributes':['id',_0x1258('0x5')]}));_0x5d580a[_0x1258('0x30')](_0x59e40b[_0x1258('0x42')]({'attributes':['id',_0x1258('0x5')]}));_0x5d580a[_0x1258('0x30')](_0x59e40b[_0x1258('0x43')]({'attributes':['id',_0x1258('0x5')]}));_0x5d580a['push'](_0x59e40b[_0x1258('0x44')]({'attributes':['id',_0x1258('0x5')]}));break;}return BPromise['all'](_0x5d580a);}})[_0x1258('0xf')](function(_0x11ab9a){if(_0x11ab9a&&_0x11ab9a[_0x1258('0x1e')]){for(var _0x5471b4=0x0;_0x5471b4<_0x11ab9a[_0x1258('0x1e')];_0x5471b4+=0x1){for(var _0x2b9b68=0x0;_0x2b9b68<_0x11ab9a[_0x5471b4][_0x1258('0x1e')];_0x2b9b68+=0x1){switch(_0x5471b4){case 0x0:joinOrLeaveQueues(_0x518384,_0x4bb110,'voice',_0x11ab9a[_0x5471b4][_0x2b9b68]);break;case 0x1:joinOrLeaveQueues(_0x518384,_0x4bb110,_0x1258('0x45'),_0x11ab9a[_0x5471b4][_0x2b9b68]);break;case 0x2:joinOrLeaveQueues(_0x518384,_0x4bb110,_0x1258('0x46'),_0x11ab9a[_0x5471b4][_0x2b9b68]);break;case 0x3:joinOrLeaveQueues(_0x518384,_0x4bb110,_0x1258('0x47'),_0x11ab9a[_0x5471b4][_0x2b9b68]);break;case 0x4:joinOrLeaveQueues(_0x518384,_0x4bb110,_0x1258('0x48'),_0x11ab9a[_0x5471b4][_0x2b9b68]);break;case 0x5:joinOrLeaveQueues(_0x518384,_0x4bb110,_0x1258('0x49'),_0x11ab9a[_0x5471b4][_0x2b9b68]);break;case 0x6:joinOrLeaveQueues(_0x518384,_0x4bb110,'whatsapp',_0x11ab9a[_0x5471b4][_0x2b9b68]);break;case 0x7:if(_0x204c26[_0x1258('0x8')]!==_0x1258('0xa'))_0x518384[_0x4bb110](util['format']('telephone:%s',_0x11ab9a[_0x5471b4][_0x2b9b68]['name']));break;case 0x8:if(_0x204c26['role']!==_0x1258('0xa'))_0x518384[_0x4bb110](util[_0x1258('0x1c')](_0x1258('0x4a'),_0x11ab9a[_0x5471b4][_0x2b9b68][_0x1258('0x5')]));break;case 0x9:if(_0x204c26[_0x1258('0x8')]!==_0x1258('0xa'))_0x518384[_0x4bb110](util[_0x1258('0x1c')](_0x1258('0x4b'),_0x11ab9a[_0x5471b4][_0x2b9b68]['type'],_0x11ab9a[_0x5471b4][_0x2b9b68][_0x1258('0x5')]));break;case 0xa:_0x518384[_0x4bb110](util[_0x1258('0x1c')](_0x1258('0x1f'),_0x11ab9a[_0x5471b4][_0x2b9b68][_0x1258('0x5')]));break;}}}}})['then'](function(){if(_0x4bb110==='leave'){var _0x4d40d2=_[_0x1258('0x1a')](_0x204c26[_0x1258('0x4c')],'id');return _0x204c26[_0x1258('0x4d')](_0x4d40d2)['then'](function(){for(var _0x5ac6fb=0x0;_0x5ac6fb<_0x4d40d2['length'];_0x5ac6fb+=0x1){_0x850c24['emit'](_0x1258('0x4e'),{'ChatInteractionId':Number(_0x4d40d2[_0x5ac6fb]),'UserId':Number(_0x204c26['id'])});}});}})[_0x1258('0xf')](function(){if(_0x4bb110==='leave'){var _0x220a17=_[_0x1258('0x1a')](_0x204c26[_0x1258('0x25')],'id');return _0x204c26[_0x1258('0x4f')](_0x220a17)[_0x1258('0xf')](function(){for(var _0x558033=0x0;_0x558033<_0x220a17['length'];_0x558033+=0x1){_0x850c24['emit'](_0x1258('0x50'),{'MailInteractionId':Number(_0x220a17[_0x558033]),'UserId':Number(_0x204c26['id'])});}});}})['then'](function(){if(_0x4bb110==='leave'){var _0x7dee7a=_[_0x1258('0x1a')](_0x204c26[_0x1258('0x26')],'id');return _0x204c26[_0x1258('0x51')](_0x7dee7a)[_0x1258('0xf')](function(){for(var _0x20e82f=0x0;_0x20e82f<_0x7dee7a['length'];_0x20e82f+=0x1){_0x850c24[_0x1258('0x52')](_0x1258('0x53'),{'FaxInteractionId':Number(_0x7dee7a[_0x20e82f]),'UserId':Number(_0x204c26['id'])});}});}})['then'](function(){if(_0x4bb110==='leave'){var _0x21ef28=_[_0x1258('0x1a')](_0x204c26[_0x1258('0x28')],'id');return _0x204c26[_0x1258('0x54')](_0x21ef28)[_0x1258('0xf')](function(){for(var _0x5ade15=0x0;_0x5ade15<_0x21ef28[_0x1258('0x1e')];_0x5ade15+=0x1){_0x850c24[_0x1258('0x52')](_0x1258('0x55'),{'SmsInteractionId':Number(_0x21ef28[_0x5ade15]),'UserId':Number(_0x204c26['id'])});}});}})[_0x1258('0xf')](function(){if(_0x4bb110===_0x1258('0x56')){var _0x5b6f28=_[_0x1258('0x1a')](_0x204c26[_0x1258('0x57')],'id');return _0x204c26[_0x1258('0x58')](_0x5b6f28)[_0x1258('0xf')](function(){for(var _0x57a2f0=0x0;_0x57a2f0<_0x5b6f28['length'];_0x57a2f0+=0x1){_0x850c24[_0x1258('0x52')](_0x1258('0x59'),{'OpenchannelInteractionId':Number(_0x5b6f28[_0x57a2f0]),'UserId':Number(_0x204c26['id'])});}});}})[_0x1258('0xf')](function(){if(_0x4bb110==='leave'){var _0x2efbcb=_['map'](_0x204c26[_0x1258('0x2b')],'id');return _0x204c26[_0x1258('0x5a')](_0x2efbcb)[_0x1258('0xf')](function(){for(var _0x34b938=0x0;_0x34b938<_0x2efbcb['length'];_0x34b938+=0x1){_0x850c24[_0x1258('0x52')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2efbcb[_0x34b938]),'UserId':Number(_0x204c26['id'])});}});}})['catch'](function(_0x39631d){_0x518384[_0x1258('0x5b')](_0x39631d);});}}function onDisconnect(_0x1598c7,_0x1747aa){joinOrLeave(_0x1598c7,_0x1258('0x56'),_0x1747aa);}function onConnect(_0x1889f8){joinOrLeave(_0x1889f8,_0x1258('0x5c'));}exports['default']=function(_0x11ba15){_0x11ba15['on']('connection',function(_0x22f1b3){_0x22f1b3[_0x1258('0x5d')](0x0);_0x22f1b3[_0x1258('0x5e')]=_0x22f1b3[_0x1258('0x5f')][_0x1258('0x60')][_0x1258('0x61')]+':'+_0x22f1b3['request'][_0x1258('0x60')][_0x1258('0x62')];_0x22f1b3[_0x1258('0x63')]=new Date();_0x22f1b3[_0x1258('0x5b')]=function(_0x79dc71){console[_0x1258('0x5b')](_0x1258('0x64')+_0x22f1b3[_0x1258('0x65')][_0x1258('0x5')]+'['+_0x22f1b3[_0x1258('0x5e')]+']',_0x79dc71);};_0x22f1b3['on'](_0x1258('0x66'),function(){onDisconnect(_0x22f1b3,_0x11ba15);_0x22f1b3[_0x1258('0x5b')]('DISCONNECTED');});onConnect(_0x22f1b3);_0x22f1b3[_0x1258('0x5b')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index c4291d4..53178dd 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 _0xd74b=['Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','Trigger,\x20%s','error','code','catch','channel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','QueryTypes','SELECT','contact','find','UserId','fullname','email','internal','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','get','opened','ContactId','changed','closed','sequelize','Sequelize','name','default','length','hasOwnProperty','model','callback','toLowerCase','jayson/promise','../logger','triggers','lodash','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage'];(function(_0xa530be,_0x50eae3){var _0x4ed49b=function(_0x3c41e1){while(--_0x3c41e1){_0xa530be['push'](_0xa530be['shift']());}};_0x4ed49b(++_0x50eae3);}(_0xd74b,0xf3));var _0xbd74=function(_0xb7d070,_0x47bf37){_0xb7d070=_0xb7d070-0x0;var _0x277860=_0xd74b[_0xb7d070];return _0x277860;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0xbd74('0x0'));var logger=require(_0xbd74('0x1'))(_0xbd74('0x2'));var _=require(_0xbd74('0x3'));var client=jayson['client'][_0xbd74('0x4')]({'port':0x232a});var triggers=[{'channel':_0xbd74('0x5'),'model':'ChatInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x5'),'model':_0xbd74('0x8'),'event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x5'),'model':_0xbd74('0xb'),'event':_0xbd74('0x6'),'condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0xd'),'model':_0xbd74('0xe'),'event':'afterCreate','condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0xd'),'model':_0xbd74('0xe'),'event':'afterUpdate','condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0xd'),'model':_0xbd74('0xf'),'event':_0xbd74('0x6'),'condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0x10'),'model':'WhatsappInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x10'),'model':_0xbd74('0x11'),'event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x10'),'model':'WhatsappMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xbd74('0x12'),'model':'FaxInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x12'),'model':'FaxInteraction','event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x12'),'model':_0xbd74('0x13'),'event':_0xbd74('0x6'),'condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0x14'),'model':_0xbd74('0x15'),'event':'afterCreate','condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x14'),'model':_0xbd74('0x15'),'event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x14'),'model':_0xbd74('0x16'),'event':'afterCreate','condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0x17'),'model':'OpenchannelInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x17'),'model':_0xbd74('0x18'),'event':_0xbd74('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0xbd74('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x47d2c2){return client[_0xbd74('0x19')](_0xbd74('0x1a'),_0x47d2c2)[_0xbd74('0x1b')](function(_0x7adeb0){logger['info'](_0xbd74('0x1c'),_0xbd74('0x1a'),_0x7adeb0);if(_0x7adeb0[_0xbd74('0x1d')]){if(_0x7adeb0[_0xbd74('0x1d')][_0xbd74('0x1e')]===0x1f4){logger[_0xbd74('0x1d')](_0xbd74('0x1c'),_0xbd74('0x1a'),_0x7adeb0[_0xbd74('0x1d')]);}}})[_0xbd74('0x1f')](function(_0x3888a0){logger[_0xbd74('0x1d')](_0xbd74('0x1c'),_0xbd74('0x1a'),_0x3888a0);});}function afterCreateMessage(_0x1dbeeb,_0x27c384){return function(_0x4896b6,_0x1eaa29){_0x4896b6=_0x4896b6['get']({'plain':!![]});_0x4896b6[_0xbd74('0x20')]=_0x1dbeeb;_0x4896b6[_0xbd74('0x21')]=_0x4896b6['direction'];var _0x701030=_0xbd74('0x22')+_0x4896b6['ContactId'];return db['sequelize'][_0xbd74('0x23')](_0x701030,{'type':db['Sequelize'][_0xbd74('0x24')][_0xbd74('0x25')],'raw':!![]})[_0xbd74('0x1b')](function(_0x5e2301){return _0x5e2301;})[_0xbd74('0x1b')](function(_0x3cac0c){if(_0x3cac0c){_0x4896b6[_0xbd74('0x26')]=_0x3cac0c[0x0];}if(_0x4896b6['UserId']){return db['User'][_0xbd74('0x27')]({'where':{'id':_0x4896b6[_0xbd74('0x28')]},'attributes':['id','name',_0xbd74('0x29'),_0xbd74('0x2a'),_0xbd74('0x2b')],'raw':!![]})[_0xbd74('0x1b')](function(_0x5a6469){_0x4896b6[_0xbd74('0x2c')]=util[_0xbd74('0x2d')](_0xbd74('0x2e'),_0x5a6469['name']);_0x4896b6[_0xbd74('0x20')]=_0x1dbeeb;_0x4896b6[_0xbd74('0x2f')]=_0x5a6469;return request({'event':_0xbd74('0x30'),'message':_0x4896b6});})[_0xbd74('0x1f')](function(_0xa0cd06){console[_0xbd74('0x1d')](_0xa0cd06);});}else{return request({'event':_0xbd74('0x31'),'message':_0x4896b6});}});};}function afterCreate(_0x3a0d7e,_0x2e05b6){return function(_0x3e8b75,_0x832506){_0x3e8b75=_0x3e8b75[_0xbd74('0x32')]({'plain':!![]});_0x3e8b75[_0xbd74('0x20')]=_0x3a0d7e;_0x3e8b75[_0xbd74('0x21')]=_0xbd74('0x33');var _0x306da6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e8b75[_0xbd74('0x34')];return db['sequelize'][_0xbd74('0x23')](_0x306da6,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xbd74('0x1b')](function(_0xbb5d1b){return _0xbb5d1b;})[_0xbd74('0x1b')](function(_0x326cf8){if(_0x326cf8){_0x3e8b75['contact']=_0x326cf8[0x0];}return request({'event':_0x2e05b6,'message':_0x3e8b75});});};}function afterUpdate(_0x4a2122,_0x2fd4f8){return function(_0x2e61fc,_0x3e6488){if(_0x2e61fc[_0xbd74('0x35')]('closed')&&_0x2e61fc[_0xbd74('0x36')]){_0x2e61fc=_0x2e61fc[_0xbd74('0x32')]({'plain':!![]});_0x2e61fc[_0xbd74('0x20')]=_0x4a2122;_0x2e61fc[_0xbd74('0x21')]=_0xbd74('0x36');var _0x4b070a=_0xbd74('0x22')+_0x2e61fc[_0xbd74('0x34')];return db[_0xbd74('0x37')][_0xbd74('0x23')](_0x4b070a,{'type':db[_0xbd74('0x38')][_0xbd74('0x24')][_0xbd74('0x25')],'raw':!![]})['then'](function(_0x2a50d8){return _0x2a50d8;})[_0xbd74('0x1b')](function(_0x258449){if(_0x258449){_0x2e61fc[_0xbd74('0x26')]=_0x258449[0x0];}if(_0x2e61fc[_0xbd74('0x28')]){return db['User'][_0xbd74('0x27')]({'where':{'id':_0x2e61fc['UserId']},'attributes':['id',_0xbd74('0x39'),_0xbd74('0x29'),'email',_0xbd74('0x2b')],'raw':!![]})[_0xbd74('0x1b')](function(_0x24208d){_0x2e61fc[_0xbd74('0x2c')]=util[_0xbd74('0x2d')](_0xbd74('0x2e'),_0x24208d['name']);_0x2e61fc['agent']=_0x24208d;return request({'event':_0x2fd4f8,'message':_0x2e61fc});})[_0xbd74('0x1f')](function(_0x224a11){console[_0xbd74('0x1d')](_0x224a11);});}else{return request({'event':_0x2fd4f8,'message':_0x2e61fc});}});}};}exports[_0xbd74('0x3a')]=function(){for(var _0x423f57=0x0;_0x423f57=_0x4ae849[_0x0de6('0x16')]){throw Error(_0x0de6('0x17'));}_0x3ccdfb(_0x9a3f6a);})['catch'](function(_0x2ae5e8){_0x371c51(_0x2ae5e8);});});}; \ No newline at end of file +var _0x5824=['../mysqldb','mail','chat','sms','whatsapp','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','role','agent','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x5824,0x153));var _0x4582=function(_0x49f1e1,_0x2304d1){_0x49f1e1=_0x49f1e1-0x0;var _0x1026ee=_0x5824[_0x49f1e1];return _0x1026ee;};'use strict';var _=require('lodash');var BPromise=require(_0x4582('0x0'));var db=require(_0x4582('0x1'))['db'];var util=require('./license/util');var channels=['voice',_0x4582('0x2'),_0x4582('0x3'),'fax',_0x4582('0x4'),_0x4582('0x5'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x4582('0x6')]=function(_0x229474){_0x229474=_0x229474[_0x4582('0x7')]();return _[_0x4582('0x8')](channels,_0x229474);};exports[_0x4582('0x9')]=function(_0x59da2d,_0x35346f,_0x2603ee,_0x472a66){var _0x1ee01b={'loginAttempts':_0x35346f,'blocked':_0x2603ee};if(!_['isUndefined'](_0x472a66)){_0x1ee01b[_0x4582('0xa')]=_0x472a66;}return _0x59da2d[_0x4582('0xb')](_0x1ee01b);};exports['getLicense']=function(_0x14df00){return new BPromise(function(_0x1e0b6b,_0x8304bf){var _0x38c18e=0x0;if(_0x14df00[_0x4582('0xc')]!==_0x4582('0xd')){_0x1e0b6b(_0x14df00);}db['User'][_0x4582('0xe')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x14df00['id']}}})[_0x4582('0xf')](function(_0x54b627){_0x38c18e=_0x54b627;return util[_0x4582('0x10')]();})[_0x4582('0xf')](function(_0x543354){if(_0x543354&&_0x543354[_0x4582('0x11')]&&_0x38c18e>=_0x543354[_0x4582('0x11')]){throw Error(_0x4582('0x12'));}_0x1e0b6b(_0x14df00);})[_0x4582('0x13')](function(_0x31198e){_0x8304bf(_0x31198e);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 04dfdab..2e86b7b 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66e5=['json','exports','status','render'];(function(_0x3e07aa,_0x124658){var _0x502b74=function(_0x3c251c){while(--_0x3c251c){_0x3e07aa['push'](_0x3e07aa['shift']());}};_0x502b74(++_0x124658);}(_0x66e5,0x1a1));var _0x566e=function(_0x3ec0e8,_0x485a9d){_0x3ec0e8=_0x3ec0e8-0x0;var _0x26fd54=_0x66e5[_0x3ec0e8];return _0x26fd54;};'use strict';module[_0x566e('0x0')][0x194]=function pageNotFound(_0x5b934e,_0x5e02a4){var _0x10680e='404';var _0x473887=0x194;var _0x1bb931={'status':_0x473887};_0x5e02a4[_0x566e('0x1')](_0x1bb931[_0x566e('0x1')]);_0x5e02a4[_0x566e('0x2')](_0x10680e,{},function(_0x54866a,_0x36fb76){if(_0x54866a){return _0x5e02a4[_0x566e('0x1')](_0x1bb931[_0x566e('0x1')])[_0x566e('0x3')](_0x1bb931);}_0x5e02a4['send'](_0x36fb76);});}; \ No newline at end of file +var _0xd8e6=['render','json','send','exports','404','status'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0xd8e6,0xb7));var _0x6d8e=function(_0x523791,_0x23c981){_0x523791=_0x523791-0x0;var _0x226d2d=_0xd8e6[_0x523791];return _0x226d2d;};'use strict';module[_0x6d8e('0x0')][0x194]=function pageNotFound(_0x96b651,_0x41a25d){var _0x2a4445=_0x6d8e('0x1');var _0x58e115=0x194;var _0x187d43={'status':_0x58e115};_0x41a25d[_0x6d8e('0x2')](_0x187d43['status']);_0x41a25d[_0x6d8e('0x3')](_0x2a4445,{},function(_0x1417c7,_0x16bcb4){if(_0x1417c7){return _0x41a25d[_0x6d8e('0x2')](_0x187d43[_0x6d8e('0x2')])[_0x6d8e('0x4')](_0x187d43);}_0x41a25d[_0x6d8e('0x5')](_0x16bcb4);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index b3d2d0e..11a76f4 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f81=['../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','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','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','VoiceMail','cascade','UserId','VoiceQueuesRt','hasMany','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','JscriptySessionReport','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','MailAccountId','hasOne','Imap','Smtp','Dispositions','List','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatOfflineMessageId','restrict','TagId','Items','FaxAccountId','Answers','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','Agent','ChatQueue','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','UserChatQueue','ChatGroupId','Members','Contacts','CompanyId','Hoppers','JscriptySessions','Company','cm_contact_has_tags','CampaignId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','AnalyticDefaultReport','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Variable','VariableId','SugarcrmAccount','DeskAccount','int_desk_configuration_has_tags','Field','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowAccount','ServicenowConfiguration','FromId','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','VoiceQueues','team_has_chat_queues','team_has_fax_queues','team_has_whatsapp_queues','HopperBlacks','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','ToUserId','ToAgent','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','FromAccount','FromAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','CustomFields','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','UserWhatsappQueue','WhatsappQueueId','exports','path','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8','sequelizeHistory','127.0.0.1','name','database','username','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory'];(function(_0x46fcee,_0x472080){var _0x23fe99=function(_0x1c07f2){while(--_0x1c07f2){_0x46fcee['push'](_0x46fcee['shift']());}};_0x23fe99(++_0x472080);}(_0x6f81,0x17d));var _0x16f8=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x6f81[_0x4ea69d];return _0x5318e0;};'use strict';var path=require(_0x16f8('0x0'));var config=require(_0x16f8('0x1'));var Sequelize=require(_0x16f8('0x2'));var _=require('lodash');var jstz=require(_0x16f8('0x3'));var timezone=jstz[_0x16f8('0x4')]();config[_0x16f8('0x2')]=_[_0x16f8('0x5')](config[_0x16f8('0x2')],{'database':_0x16f8('0x6'),'username':_0x16f8('0x7'),'password':_0x16f8('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x16f8('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x16f8('0xa'),'collate':'utf8_general_ci'}}});config[_0x16f8('0xb')]=_[_0x16f8('0x5')](config[_0x16f8('0xb')],{'database':_0x16f8('0x6'),'username':_0x16f8('0x7'),'password':_0x16f8('0x8'),'options':{'host':_0x16f8('0xc'),'port':0xcea,'dialect':_0x16f8('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x16f8('0xd')](),'define':{'charset':_0x16f8('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x16f8('0xe')],config[_0x16f8('0x2')][_0x16f8('0xf')],config[_0x16f8('0x2')]['password'],config['sequelize'][_0x16f8('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x16f8('0xe')],config['sequelizeHistory'][_0x16f8('0xf')],config[_0x16f8('0xb')]['password'],config[_0x16f8('0xb')]['options'])};db[_0x16f8('0x11')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x13'));db[_0x16f8('0x14')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x15'));db['VoiceContext']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x16'));db[_0x16f8('0x17')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x18'));db[_0x16f8('0x19')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x1a'));db[_0x16f8('0x1b')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x1c'));db[_0x16f8('0x1d')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x1e'));db['ScreenRecording']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x1f'));db['VoiceMail']=db[_0x16f8('0x2')]['import'](_0x16f8('0x20'));db[_0x16f8('0x21')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x22'));db[_0x16f8('0x23')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x24'));db[_0x16f8('0x25')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/voiceDialReport/voiceDialReport.model');db[_0x16f8('0x26')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x27'));db['VoiceQueueReport']=db[_0x16f8('0x2')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x28'));db[_0x16f8('0x29')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x2a'));db[_0x16f8('0x2b')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x2c'));db[_0x16f8('0x2d')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x2e'));db[_0x16f8('0x2f')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x30'));db['UserChatQueue']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0x16f8('0x31')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x32'));db[_0x16f8('0x33')]=db['sequelize'][_0x16f8('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0x16f8('0x34')]=db['sequelize'][_0x16f8('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x16f8('0x35')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x36'));db['UserWhatsappQueue']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x37'));db['MailServerIn']=db[_0x16f8('0x2')]['import'](_0x16f8('0x38'));db[_0x16f8('0x39')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x3a'));db['MailAccount']=db[_0x16f8('0x2')]['import'](_0x16f8('0x3b'));db[_0x16f8('0x3c')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0x16f8('0x3d')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x3e'));db[_0x16f8('0x3f')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x40'));db[_0x16f8('0x41')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x42'));db[_0x16f8('0x43')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/mailApplication/mailApplication.model');db[_0x16f8('0x44')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x45'));db[_0x16f8('0x46')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x47'));db['DashboardItem']=db[_0x16f8('0x2')]['import'](_0x16f8('0x48'));db[_0x16f8('0x49')]=db[_0x16f8('0x2')]['import']('../api/faxAccount/faxAccount.model');db[_0x16f8('0x4a')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x4b'));db[_0x16f8('0x4c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x4d'));db[_0x16f8('0x4e')]=db['sequelize'][_0x16f8('0x12')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0x16f8('0x12')]('../api/faxQueue/faxQueue.model');db[_0x16f8('0x4f')]=db['sequelize']['import'](_0x16f8('0x50'));db[_0x16f8('0x51')]=db['sequelize'][_0x16f8('0x12')]('../api/smsAccount/smsAccount.model');db[_0x16f8('0x52')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x53'));db[_0x16f8('0x54')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x55'));db[_0x16f8('0x56')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x57'));db[_0x16f8('0x58')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x59'));db[_0x16f8('0x5a')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x5b'));db[_0x16f8('0x5c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x5d'));db[_0x16f8('0x5e')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x5f'));db[_0x16f8('0x60')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/openchannelQueue/openchannelQueue.model');db[_0x16f8('0x61')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x62'));db[_0x16f8('0x63')]=db['sequelize']['import'](_0x16f8('0x64'));db[_0x16f8('0x65')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x66'));db[_0x16f8('0x67')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x68'));db[_0x16f8('0x69')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/chatMessage/chatMessage.model');db[_0x16f8('0x6a')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x6b'));db['ChatQueue']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x6c'));db['ChatGroup']=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x16f8('0x6d')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/cmCompany/cmCompany.model');db[_0x16f8('0x6e')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x6f'));db[_0x16f8('0x70')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x71'));db[_0x16f8('0x72')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x73'));db[_0x16f8('0x74')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x75'));db[_0x16f8('0x76')]=db['sequelize']['import'](_0x16f8('0x77'));db[_0x16f8('0x78')]=db['sequelize']['import'](_0x16f8('0x79'));db[_0x16f8('0x7a')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x7b'));db[_0x16f8('0x7c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x7d'));db[_0x16f8('0x7e')]=db['sequelize'][_0x16f8('0x12')]('../api/automation/automation.model');db[_0x16f8('0x7f')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x80'));db[_0x16f8('0x81')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x82'));db[_0x16f8('0x83')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x84'));db[_0x16f8('0x85')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x86'));db[_0x16f8('0x87')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x88'));db[_0x16f8('0x89')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8a'));db['VoiceQueuesLog']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8b'));db['Schedule']=db[_0x16f8('0x2')]['import']('../api/schedule/schedule.model');db[_0x16f8('0x8c')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8d'));db[_0x16f8('0x8e')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8f'));db[_0x16f8('0x90')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x91'));db[_0x16f8('0x92')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/trigger/trigger.model');db['Variable']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x93'));db[_0x16f8('0x94')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x95'));db[_0x16f8('0x96')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x97'));db[_0x16f8('0x98')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x99'));db['AnalyticDefaultReport']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x16f8('0x9a')]=db['sequelize'][_0x16f8('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x16f8('0x9b')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x9c'));db[_0x16f8('0x9d')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x9e'));db[_0x16f8('0x9f')]=db[_0x16f8('0x2')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa0'));db[_0x16f8('0xa1')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa2'));db[_0x16f8('0xa3')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa4'));db['SugarcrmAccount']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa5'));db[_0x16f8('0xa6')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xa7'));db[_0x16f8('0xa8')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa9'));db['DeskAccount']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xaa'));db[_0x16f8('0xab')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xac'));db[_0x16f8('0xad')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xae'));db[_0x16f8('0xaf')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xb0'));db[_0x16f8('0xb1')]=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intZohoField/intZohoField.model');db[_0x16f8('0xb2')]=db[_0x16f8('0x2')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x16f8('0xb3')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x16f8('0xb4')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xb5'));db[_0x16f8('0xb6')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xb7'));db[_0x16f8('0xb8')]=db['sequelize'][_0x16f8('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x16f8('0xb9')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xba'));db['VtigerAccount']=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xbb'));db[_0x16f8('0xbc')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x16f8('0xbd')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xbe'));db['ServicenowAccount']=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xbf'));db['ServicenowConfiguration']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc0'));db[_0x16f8('0xc1')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc2'));db[_0x16f8('0xc3')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x16f8('0xc4')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc5'));db[_0x16f8('0xc6')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc7'));db[_0x16f8('0xc8')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc9'));db[_0x16f8('0xca')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xcb'));db[_0x16f8('0xcc')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xcd'));db['Integration']=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x95'));db[_0x16f8('0xce')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xcf'));db[_0x16f8('0xd0')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xd1'));db[_0x16f8('0xd2')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x16f8('0xd3')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xd4'));db['JscriptyQuestionReport']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xd5'));db['JscriptySessionReport']=db[_0x16f8('0x2')]['import'](_0x16f8('0xd6'));db['SmsQueueReport']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x16f8('0xd7')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xd8'));db[_0x16f8('0xd9')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xda'));db[_0x16f8('0xdb')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xdc'));db[_0x16f8('0xdd')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xde'));db[_0x16f8('0xdf')]=db[_0x16f8('0x2')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x16f8('0xe0')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xe1'));db[_0x16f8('0xe2')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xe3'));db[_0x16f8('0xe4')]=db['sequelize'][_0x16f8('0x12')]('../api/squareMessage/squareMessage.model');db[_0x16f8('0xe5')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xe6'));db[_0x16f8('0xe7')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xe8'));db[_0x16f8('0xe9')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xea'));db[_0x16f8('0xeb')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xec'));db[_0x16f8('0xed')]=db['sequelize']['import'](_0x16f8('0xee'));db[_0x16f8('0xef')]=db[_0x16f8('0x2')]['import']('../api/plugin/plugin.model');db[_0x16f8('0xf0')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xf1'));db['ChatTransferReport']=db[_0x16f8('0x2')]['import'](_0x16f8('0xf2'));db['FaxTransferReport']=db[_0x16f8('0x2')]['import'](_0x16f8('0xf3'));db[_0x16f8('0xf4')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xf5'));db[_0x16f8('0xf6')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xf7'));db[_0x16f8('0xf8')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xf9'));db['VoicePrefix']=db['sequelize'][_0x16f8('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x16f8('0xfa')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xfb'));db[_0x16f8('0xfc')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xfd'));db['UserProfileResource']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xfe'));db[_0x16f8('0xff')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x100'));db[_0x16f8('0x101')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x102'));db['WhatsappApplication']=db[_0x16f8('0x2')]['import'](_0x16f8('0x103'));db[_0x16f8('0x104')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x105'));db[_0x16f8('0x106')]=db['sequelize'][_0x16f8('0x12')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x107'));db[_0x16f8('0x108')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x109'));db[_0x16f8('0x10a')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x10b'));db[_0x16f8('0x10c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x10d'));db[_0x16f8('0x10e')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x10f'));db[_0x16f8('0x11')]['hasOne'](db['VoiceMail'],{'as':_0x16f8('0x110'),'onDelete':_0x16f8('0x111'),'foreignKey':'UserId'});db[_0x16f8('0x11')]['hasMany'](db[_0x16f8('0x1d')],{'as':'Recordings','foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')]['hasMany'](db[_0x16f8('0x2d')],{'as':_0x16f8('0x113'),'foreignKey':'UserId'});db[_0x16f8('0x11')][_0x16f8('0x114')](db[_0x16f8('0x17')],{'as':_0x16f8('0x115'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db['User'][_0x16f8('0x114')](db[_0x16f8('0x74')],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x117'),'foreignKey':'UserId'});db[_0x16f8('0x11')]['hasMany'](db['ReportAgentPreview'],{'as':_0x16f8('0x78'),'foreignKey':'UserId'});db['User'][_0x16f8('0x114')](db[_0x16f8('0x5c')],{'as':_0x16f8('0x118'),'foreignKey':'UserId'});db['User'][_0x16f8('0x114')](db[_0x16f8('0x67')],{'as':'ChatInteractions','foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')][_0x16f8('0x114')](db['SmsInteraction'],{'as':_0x16f8('0x119'),'foreignKey':'UserId'});db['User']['hasMany'](db['FaxInteraction'],{'as':_0x16f8('0x11a'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')]['hasMany'](db[_0x16f8('0x3f')],{'as':_0x16f8('0x11b'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')][_0x16f8('0x114')](db[_0x16f8('0x104')],{'as':_0x16f8('0x11c'),'foreignKey':'UserId'});db[_0x16f8('0x11')]['hasMany'](db['UserNotification'],{'as':_0x16f8('0x11d'),'foreignKey':_0x16f8('0x11e')});db[_0x16f8('0x11')][_0x16f8('0x11f')](db[_0x16f8('0xfa')],{'as':'UserProfile','foreignKey':_0x16f8('0x120')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x122')],{'as':_0x16f8('0x123'),'through':_0x16f8('0x124')});db[_0x16f8('0x11')][_0x16f8('0x121')](db['CmContact'],{'as':'Contacts','through':_0x16f8('0x125')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x126'),'through':_0x16f8('0x127')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':_0x16f8('0x128')});db['User'][_0x16f8('0x121')](db[_0x16f8('0x3f')],{'as':_0x16f8('0x11b'),'through':_0x16f8('0x129')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x67')],{'as':_0x16f8('0x12a'),'through':_0x16f8('0x12b')});db[_0x16f8('0x11')][_0x16f8('0x121')](db['FaxInteraction'],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x54')],{'as':'SmsInteractions','through':_0x16f8('0x12c')});db[_0x16f8('0x11')]['belongsToMany'](db[_0x16f8('0x5c')],{'as':'OpenchannelInteractions','through':_0x16f8('0x12d')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x104')],{'as':_0x16f8('0x11c'),'through':_0x16f8('0x12e')});db['User']['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x16f8('0x2f'),'required':![]});db[_0x16f8('0x11')]['belongsToMany'](db[_0x16f8('0x3c')],{'as':_0x16f8('0x12f'),'through':_0x16f8('0x31'),'required':![]});db['User'][_0x16f8('0x121')](db['ChatQueue'],{'as':_0x16f8('0x130'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0x131')],{'as':_0x16f8('0x132'),'through':_0x16f8('0x33'),'required':![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0x56')],{'as':_0x16f8('0x133'),'through':_0x16f8('0x34'),'required':![]});db[_0x16f8('0x11')][_0x16f8('0x121')](db['OpenchannelQueue'],{'as':_0x16f8('0x134'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0x10a')],{'as':_0x16f8('0x135'),'through':'UserWhatsappQueue','required':![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'through':_0x16f8('0x127')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x136')],{'as':_0x16f8('0x137'),'through':_0x16f8('0x138'),'required':![]});db['User'][_0x16f8('0x121')](db['ChatWebsite'],{'as':'ChatWebsites','through':'user_has_chat_websites'});db['User'][_0x16f8('0x121')](db[_0x16f8('0x49')],{'as':_0x16f8('0x139'),'through':_0x16f8('0x13a')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x13c'),'through':_0x16f8('0x13d')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0x16f8('0x11')][_0x16f8('0x121')](db['SmsAccount'],{'as':_0x16f8('0x13e'),'through':_0x16f8('0x13f')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x101')],{'as':_0x16f8('0x140'),'through':_0x16f8('0x141')});db[_0x16f8('0x11')][_0x16f8('0x121')](db['SquareProject'],{'as':_0x16f8('0x142'),'through':_0x16f8('0x143')});db[_0x16f8('0x14')][_0x16f8('0x114')](db[_0x16f8('0x17')],{'as':'SpiedAgents','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x144')});db['VoiceContext'][_0x16f8('0x114')](db[_0x16f8('0x17')],{'onDelete':_0x16f8('0x111')});db['VoiceExtension'][_0x16f8('0x114')](db[_0x16f8('0x17')],{'as':_0x16f8('0x145'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x19')][_0x16f8('0x121')](db[_0x16f8('0x8c')],{'as':_0x16f8('0x146'),'through':_0x16f8('0x147')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')]['hasMany'](db[_0x16f8('0x74')],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x148')});db['VoiceQueue'][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x149'),'foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')]['hasMany'](db['ReportAgentPreview'],{'as':_0x16f8('0x78'),'foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db[_0x16f8('0x72')],{'as':'HopperBlacks','foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db[_0x16f8('0x14a')],{'as':'JscriptySessions','foreignKey':_0x16f8('0x148')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0x16f8('0x29'),'foreignKey':_0x16f8('0x14b')});db[_0x16f8('0x1b')][_0x16f8('0x11f')](db['Trunk'],{'as':_0x16f8('0x14c'),'foreignKey':_0x16f8('0x14d')});db[_0x16f8('0x1b')]['belongsTo'](db['Interval'],{'as':_0x16f8('0x85'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x1b')][_0x16f8('0x11f')](db['Pause'],{'as':_0x16f8('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x16f8('0x1b')][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'as':'Lists','through':_0x16f8('0x150')});db[_0x16f8('0x1b')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x2f')});db[_0x16f8('0x1b')]['belongsToMany'](db[_0x16f8('0xe5')],{'as':_0x16f8('0x152'),'through':_0x16f8('0x10e')});db[_0x16f8('0x1b')][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x153'),'through':_0x16f8('0x154')});db[_0x16f8('0x1d')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x155')][_0x16f8('0x11f')](db['User'],{'as':_0x16f8('0x11'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x110')][_0x16f8('0x114')](db[_0x16f8('0x21')],{'as':_0x16f8('0x156'),'onDelete':'cascade','foreignKey':_0x16f8('0x157'),'sourceKey':'mailbox'});db[_0x16f8('0x21')][_0x16f8('0x11f')](db[_0x16f8('0x110')],{'foreignKey':_0x16f8('0x157'),'targetKey':_0x16f8('0x158')});db[_0x16f8('0x23')][_0x16f8('0x114')](db['VoiceQueueReport'],{'as':_0x16f8('0x159'),'foreignKey':_0x16f8('0x15a'),'constraints':![]});db[_0x16f8('0x23')][_0x16f8('0x114')](db[_0x16f8('0x26')],{'as':'AgentReports','foreignKey':_0x16f8('0x15a'),'constraints':![]});db[_0x16f8('0x23')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x23')]['belongsTo'](db['CmContact'],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db['MailServerIn'][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x13b'),'foreignKey':'MailAccountId'});db[_0x16f8('0x39')][_0x16f8('0x11f')](db['MailAccount'],{'as':_0x16f8('0x13b'),'foreignKey':_0x16f8('0x15c')});db[_0x16f8('0x13b')][_0x16f8('0x15d')](db['MailServerIn'],{'as':_0x16f8('0x15e'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x13b')]['hasOne'](db[_0x16f8('0x39')],{'as':_0x16f8('0x15f'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x13b')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':_0x16f8('0x160'),'foreignKey':_0x16f8('0x15c')});db[_0x16f8('0x13b')]['hasMany'](db[_0x16f8('0x7f')],{'as':'Answers','foreignKey':_0x16f8('0x15c')});db['MailAccount'][_0x16f8('0x114')](db[_0x16f8('0x41')],{'as':_0x16f8('0x156'),'foreignKey':'MailAccountId'});db[_0x16f8('0x13b')]['hasMany'](db[_0x16f8('0x3f')],{'as':'Interactions'});db[_0x16f8('0x13b')]['hasMany'](db[_0x16f8('0x43')],{'as':'Applications'});db['MailAccount'][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db['MailAccount'][_0x16f8('0x11f')](db['Template'],{'as':_0x16f8('0x90'),'foreignKey':_0x16f8('0x163')});db[_0x16f8('0x13b')]['belongsTo'](db['Pause'],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x13b')][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x151'),'through':_0x16f8('0x13d')});db['MailQueue']['belongsToMany'](db['User'],{'as':_0x16f8('0x151'),'through':'UserMailQueue'});db[_0x16f8('0x3c')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':_0x16f8('0x165'),'as':_0x16f8('0x152')});db[_0x16f8('0x3f')][_0x16f8('0x114')](db[_0x16f8('0x41')],{'as':_0x16f8('0x156'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x166')});db['MailInteraction'][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x167'),'foreignKey':'MailAccountId'});db[_0x16f8('0x3f')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x3f')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x3f')]['belongsToMany'](db['Tag'],{'through':_0x16f8('0x16a'),'as':_0x16f8('0x16b')});db[_0x16f8('0x3f')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x16a'),'as':_0x16f8('0x16c')});db['MailInteraction'][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x129'),'foreignKey':_0x16f8('0x166')});db[_0x16f8('0x41')][_0x16f8('0x114')](db[_0x16f8('0xed')],{'as':_0x16f8('0x16e'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11')});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':'Contact'});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x3f')],{'as':'Interaction','foreignKey':_0x16f8('0x166')});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x167'),'foreignKey':'MailAccountId'});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x61')],{'as':_0x16f8('0x61'),'foreignKey':'ChatWebsiteId'});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x6a')],{'as':'ChatOfflineMessage','foreignKey':_0x16f8('0x16f')});db[_0x16f8('0x43')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x43')][_0x16f8('0x11f')](db[_0x16f8('0x3c')],{'onDelete':_0x16f8('0x170')});db['MailApplication'][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'onDelete':'restrict'});db[_0x16f8('0x43')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x43')]['belongsTo'](db[_0x16f8('0x8e')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db[_0x16f8('0x44')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{});db[_0x16f8('0x44')]['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x44')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x44')][_0x16f8('0x11f')](db['MailInteraction'],{});db[_0x16f8('0x44')]['belongsTo'](db[_0x16f8('0x41')],{});db[_0x16f8('0x44')][_0x16f8('0x11f')](db['User'],{});db[_0x16f8('0x44')][_0x16f8('0x11f')](db[_0x16f8('0x3c')],{});db[_0x16f8('0x46')][_0x16f8('0x114')](db['DashboardItem'],{'as':_0x16f8('0x172'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x49')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':_0x16f8('0x173')});db['FaxAccount'][_0x16f8('0x114')](db[_0x16f8('0x7f')],{'as':_0x16f8('0x174'),'foreignKey':_0x16f8('0x173')});db[_0x16f8('0x49')][_0x16f8('0x114')](db[_0x16f8('0x4c')],{'as':_0x16f8('0x175')});db['FaxAccount']['hasMany'](db[_0x16f8('0x4a')],{'as':'Applications'});db[_0x16f8('0x49')]['hasMany'](db[_0x16f8('0x17')],{'as':_0x16f8('0x176'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x49')]['hasMany'](db['FaxMessage'],{'as':'Messages'});db[_0x16f8('0x49')][_0x16f8('0x11f')](db[_0x16f8('0x29')],{'as':_0x16f8('0x29')});db[_0x16f8('0x49')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x49')][_0x16f8('0x11f')](db[_0x16f8('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x16f8('0x164')});db['FaxAccount'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':'user_has_fax_accounts'});db[_0x16f8('0x4a')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':'restrict'});db[_0x16f8('0x4a')][_0x16f8('0x11f')](db['FaxQueue'],{'onDelete':'restrict'});db[_0x16f8('0x4a')][_0x16f8('0x11f')](db[_0x16f8('0x49')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x4a')][_0x16f8('0x11f')](db[_0x16f8('0x8e')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db['FaxInteraction'][_0x16f8('0x114')](db[_0x16f8('0x4e')],{'as':_0x16f8('0x156'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x177')});db[_0x16f8('0x4c')]['belongsTo'](db[_0x16f8('0x49')],{'as':_0x16f8('0x167'),'foreignKey':'FaxAccountId'});db[_0x16f8('0x4c')][_0x16f8('0x11f')](db['CmContact'],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x4c')]['belongsTo'](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x4c')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x178'),'as':_0x16f8('0x16b')});db[_0x16f8('0x4c')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x178'),'as':_0x16f8('0x16c')});db[_0x16f8('0x4c')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':'Users','through':_0x16f8('0x179'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x11')});db[_0x16f8('0x4e')][_0x16f8('0x11f')](db[_0x16f8('0x4c')],{'as':_0x16f8('0x17a'),'foreignKey':'FaxInteractionId'});db[_0x16f8('0x4e')][_0x16f8('0x11f')](db['CmContact'],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x15b')});db['FaxMessage'][_0x16f8('0x11f')](db[_0x16f8('0xed')],{'as':_0x16f8('0xed'),'foreignKey':_0x16f8('0x17b')});db['FaxMessage'][_0x16f8('0x11f')](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x16f8('0x131')]['belongsToMany'](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x33')});db[_0x16f8('0x131')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport'][_0x16f8('0x11f')](db['FaxAccount'],{});db['FaxQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':'List','foreignKey':'ListId'});db[_0x16f8('0x4f')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0x16f8('0x4c')],{});db[_0x16f8('0x4f')]['belongsTo'](db[_0x16f8('0x4e')],{});db[_0x16f8('0x4f')]['belongsTo'](db[_0x16f8('0x11')],{});db[_0x16f8('0x4f')][_0x16f8('0x11f')](db[_0x16f8('0x131')],{});db[_0x16f8('0x51')][_0x16f8('0x114')](db['Disposition'],{'as':_0x16f8('0x160'),'foreignKey':_0x16f8('0x17c')});db[_0x16f8('0x51')][_0x16f8('0x114')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x16f8('0x17c')});db['SmsAccount'][_0x16f8('0x114')](db[_0x16f8('0x17d')],{'as':_0x16f8('0x156'),'foreignKey':'SmsAccountId'});db[_0x16f8('0x51')][_0x16f8('0x114')](db[_0x16f8('0x54')],{'as':_0x16f8('0x175')});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':_0x16f8('0x145')});db[_0x16f8('0x51')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db['SmsAccount']['belongsTo'](db[_0x16f8('0x87')],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x51')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x13f')});db['SmsApplication']['belongsTo'](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x52')][_0x16f8('0x11f')](db['SmsQueue'],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x52')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x16f8('0x170')});db['SmsApplication'][_0x16f8('0x11f')](db['Interval'],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x52')][_0x16f8('0x11f')](db['Tag'],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db[_0x16f8('0x54')][_0x16f8('0x114')](db[_0x16f8('0x17d')],{'as':_0x16f8('0x156'),'onDelete':'cascade','foreignKey':_0x16f8('0x17e')});db[_0x16f8('0x54')][_0x16f8('0x11f')](db['SmsAccount'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x17c')});db[_0x16f8('0x54')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db[_0x16f8('0x54')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x54')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x17f'),'as':'Tags'});db[_0x16f8('0x54')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x17f'),'as':_0x16f8('0x16c')});db['SmsInteraction'][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12c'),'foreignKey':_0x16f8('0x17e')});db['SmsMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11')});db[_0x16f8('0x17d')][_0x16f8('0x11f')](db['CmContact'],{'onDelete':'cascade','as':_0x16f8('0x15b')});db[_0x16f8('0x17d')][_0x16f8('0x11f')](db[_0x16f8('0x54')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x17a'),'foreignKey':_0x16f8('0x17e')});db[_0x16f8('0x17d')][_0x16f8('0x11f')](db[_0x16f8('0x51')],{'as':'Account','foreignKey':_0x16f8('0x17c')});db[_0x16f8('0x56')][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x151'),'through':_0x16f8('0x34'),'foreignKey':'SmsQueueId'});db[_0x16f8('0x56')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x16f8('0x58')]['hasMany'](db['Disposition'],{'as':_0x16f8('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0x16f8('0x58')][_0x16f8('0x114')](db['CannedAnswer'],{'as':_0x16f8('0x174'),'foreignKey':'OpenchannelAccountId'});db[_0x16f8('0x58')]['hasMany'](db[_0x16f8('0x5c')],{'as':_0x16f8('0x175'),'foreignKey':_0x16f8('0x180')});db[_0x16f8('0x58')][_0x16f8('0x114')](db[_0x16f8('0x5e')],{'as':_0x16f8('0x156'),'foreignKey':_0x16f8('0x180')});db[_0x16f8('0x58')][_0x16f8('0x114')](db[_0x16f8('0x5a')],{'as':_0x16f8('0x145'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x58')][_0x16f8('0x11f')](db['Pause'],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x58')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x181')});db[_0x16f8('0x5a')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x5a')][_0x16f8('0x11f')](db[_0x16f8('0x60')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x182')});db['OpenchannelApplication'][_0x16f8('0x11f')](db[_0x16f8('0x58')],{'onDelete':'restrict','foreignKey':_0x16f8('0x180')});db[_0x16f8('0x5a')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db['OpenchannelApplication'][_0x16f8('0x11f')](db[_0x16f8('0x8e')],{'onDelete':_0x16f8('0x170'),'foreignKey':'TagId'});db[_0x16f8('0x5c')]['hasMany'](db[_0x16f8('0x5e')],{'as':'Messages','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x183')});db['OpenchannelInteraction'][_0x16f8('0x11f')](db[_0x16f8('0x58')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x180')});db[_0x16f8('0x5c')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x5c')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':'UserId'});db[_0x16f8('0x5c')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x184'),'as':_0x16f8('0x16b')});db[_0x16f8('0x5c')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x184'),'as':_0x16f8('0x16c')});db['OpenchannelInteraction'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12d'),'foreignKey':_0x16f8('0x183')});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x111'),'as':'User'});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db['CmContact'],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x15b')});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db[_0x16f8('0x5c')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x17a'),'foreignKey':_0x16f8('0x183')});db['OpenchannelMessage'][_0x16f8('0x11f')](db['Attachment'],{'as':_0x16f8('0xed'),'foreignKey':'AttachmentId'});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db['OpenchannelAccount'],{'as':_0x16f8('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x16f8('0x60')]['belongsToMany'](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x35'),'foreignKey':_0x16f8('0x182')});db[_0x16f8('0x60')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':'team_has_openchannel_queues','as':_0x16f8('0x152')});db['ChatWebsite'][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':_0x16f8('0x160'),'foreignKey':_0x16f8('0x185')});db['ChatWebsite'][_0x16f8('0x114')](db[_0x16f8('0x7f')],{'as':_0x16f8('0x174'),'foreignKey':'ChatWebsiteId'});db[_0x16f8('0x61')]['hasMany'](db['ChatProactiveAction'],{'as':_0x16f8('0x186')});db['ChatWebsite'][_0x16f8('0x114')](db[_0x16f8('0x67')],{'as':'Interactions'});db['ChatWebsite'][_0x16f8('0x114')](db['ChatApplication'],{'as':_0x16f8('0x145')});db[_0x16f8('0x61')]['hasMany'](db[_0x16f8('0x69')],{'as':_0x16f8('0x156')});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':'List','foreignKey':_0x16f8('0x162')});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x13b'),'foreignKey':_0x16f8('0x15c')});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0x87')],{'as':_0x16f8('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x16f8('0x61')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':'Agents','through':'user_has_chat_websites'});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x58')],{});db[_0x16f8('0x63')]['belongsTo'](db['CmList'],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x5c')],{});db['OpenchannelQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x5e')],{});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x60')],{});db[_0x16f8('0x65')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x187'),'foreignKey':_0x16f8('0x112'),'onDelete':'restrict'});db[_0x16f8('0x65')][_0x16f8('0x11f')](db[_0x16f8('0x188')],{'as':_0x16f8('0x189'),'foreignKey':_0x16f8('0x18a'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x65')][_0x16f8('0x11f')](db['ChatWebsite'],{'as':_0x16f8('0x18b'),'foreignKey':_0x16f8('0x185'),'onDelete':'restrict'});db[_0x16f8('0x65')][_0x16f8('0x11f')](db['Tag'],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db[_0x16f8('0x67')][_0x16f8('0x114')](db[_0x16f8('0x69')],{'as':_0x16f8('0x156'),'onDelete':_0x16f8('0x111'),'foreignKey':'ChatInteractionId'});db[_0x16f8('0x67')][_0x16f8('0x11f')](db['ChatWebsite'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x185')});db[_0x16f8('0x67')][_0x16f8('0x11f')](db['CmContact'],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x67')][_0x16f8('0x121')](db['Tag'],{'through':_0x16f8('0x18c'),'as':'Tags'});db[_0x16f8('0x67')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x18c'),'as':_0x16f8('0x16c')});db[_0x16f8('0x67')][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12b'),'foreignKey':_0x16f8('0x18d')});db[_0x16f8('0x69')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x11')});db[_0x16f8('0x69')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':'Contact','foreignKey':'ContactId'});db[_0x16f8('0x69')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x17a'),'foreignKey':_0x16f8('0x18d')});db[_0x16f8('0x69')][_0x16f8('0x11f')](db[_0x16f8('0xed')],{'as':_0x16f8('0xed'),'foreignKey':_0x16f8('0x17b')});db[_0x16f8('0x69')]['belongsTo'](db[_0x16f8('0x61')],{'as':_0x16f8('0x167'),'foreignKey':'ChatWebsiteId'});db[_0x16f8('0x6a')]['hasMany'](db[_0x16f8('0xed')],{'as':_0x16f8('0x16e'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x6a')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':'Contact','foreignKey':_0x16f8('0x168')});db['ChatOfflineMessage'][_0x16f8('0x11f')](db[_0x16f8('0x61')],{'as':_0x16f8('0x167'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x18e'),'hooks':!![]});db[_0x16f8('0x188')]['belongsToMany'](db[_0x16f8('0xe5')],{'through':'team_has_chat_queues','as':_0x16f8('0x152')});db[_0x16f8('0x122')][_0x16f8('0x114')](db[_0x16f8('0xd2')],{'as':_0x16f8('0x156'),'foreignKey':_0x16f8('0x18f'),'onDelete':_0x16f8('0x111')});db['ChatGroup'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x190'),'through':_0x16f8('0x124')});db['ChatProactiveAction']['belongsTo'](db[_0x16f8('0x61')],{'as':'Website','foreignKey':_0x16f8('0x185')});db[_0x16f8('0x6d')][_0x16f8('0x114')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x191'),'foreignKey':_0x16f8('0x192')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x70')],{'as':_0x16f8('0x193'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['CmHopperFinal'],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x149'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')]['hasMany'](db[_0x16f8('0x78')],{'as':_0x16f8('0x78'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x14a')],{'as':_0x16f8('0x194'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['OpenchannelInteraction'],{'as':_0x16f8('0x118'),'foreignKey':'ContactId','onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x67')],{'as':_0x16f8('0x12a'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['SmsInteraction'],{'as':_0x16f8('0x119'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x3f')],{'as':_0x16f8('0x11b'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')]['belongsTo'](db[_0x16f8('0x6d')],{'as':_0x16f8('0x195'),'foreignKey':_0x16f8('0x192')});db[_0x16f8('0x6e')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x16f8('0x162'),'onDelete':'cascade'});db['CmContact'][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x125')});db[_0x16f8('0x6e')][_0x16f8('0x121')](db['Tag'],{'as':_0x16f8('0x16b'),'through':_0x16f8('0x196')});db[_0x16f8('0x6e')][_0x16f8('0x121')](db['Tag'],{'through':_0x16f8('0x196'),'as':'ThroughTags'});db[_0x16f8('0x70')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x70')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':'ListId','onDelete':_0x16f8('0x111')});db[_0x16f8('0x70')]['belongsTo'](db[_0x16f8('0x11')],{'as':'Agent','foreignKey':'UserId'});db['CmHopper'][_0x16f8('0x11f')](db[_0x16f8('0x1b')],{'as':_0x16f8('0x189'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x16f8('0x70')][_0x16f8('0x11f')](db['Campaign'],{'as':_0x16f8('0xe9'),'foreignKey':_0x16f8('0x197'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x70')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':'OwnerId'});db[_0x16f8('0x72')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168'),'onDelete':'cascade'});db[_0x16f8('0x72')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':'List','foreignKey':_0x16f8('0x162'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x72')][_0x16f8('0x11f')](db[_0x16f8('0x1b')],{'as':'Queue','foreignKey':_0x16f8('0x148'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x72')]['belongsTo'](db[_0x16f8('0xe9')],{'as':_0x16f8('0xe9'),'foreignKey':'CampaignId','onDelete':_0x16f8('0x111')});db[_0x16f8('0x7e')][_0x16f8('0x114')](db[_0x16f8('0x83')],{'as':{'plural':_0x16f8('0x198'),'singular':'OneAll'},'foreignKey':_0x16f8('0x199'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db['Automation'][_0x16f8('0x114')](db['Condition'],{'as':{'plural':_0x16f8('0x19a'),'singular':_0x16f8('0x19b')},'foreignKey':_0x16f8('0x19c'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x7e')][_0x16f8('0x114')](db[_0x16f8('0x7c')],{'as':_0x16f8('0x19d'),'foreignKey':'AutomationId','onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x81')]['hasMany'](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':_0x16f8('0x19e'),'onDelete':'cascade'});db['Interval'][_0x16f8('0x114')](db[_0x16f8('0x85')],{'as':_0x16f8('0x19f'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x16f8('0x17')],{'as':_0x16f8('0x115'),'foreignKey':_0x16f8('0x14e'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x43')],{'as':_0x16f8('0x1a0'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x65')],{'as':_0x16f8('0x1a1'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x4a')],{'as':_0x16f8('0x1a2'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x52')],{'as':'SmsApplications','foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x1a3')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{});db['Schedule']['belongsTo'](db[_0x16f8('0x1a4')],{'foreignKey':_0x16f8('0x1a5')});db[_0x16f8('0x1a3')][_0x16f8('0x11f')](db[_0x16f8('0x98')],{'foreignKey':'CustomReportId'});db[_0x16f8('0x8c')][_0x16f8('0x121')](db[_0x16f8('0x19')],{'as':_0x16f8('0x1a6'),'through':_0x16f8('0x147'),'onDelete':'restrict'});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x6e')],{'through':_0x16f8('0x196')});db['Tag'][_0x16f8('0x121')](db['ChatInteraction'],{'through':_0x16f8('0x18c')});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x3f')],{'through':_0x16f8('0x16a')});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x54')],{'through':_0x16f8('0x17f')});db[_0x16f8('0x8e')]['belongsToMany'](db[_0x16f8('0x4c')],{'through':_0x16f8('0x178')});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x5c')],{'through':_0x16f8('0x184')});db['Tag'][_0x16f8('0x121')](db[_0x16f8('0x104')],{'through':_0x16f8('0x1a7')});db['Trigger'][_0x16f8('0x114')](db[_0x16f8('0x83')],{'as':{'plural':_0x16f8('0x1a8'),'singular':'AllCondition'},'foreignKey':_0x16f8('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0x16f8('0x92')][_0x16f8('0x114')](db['Condition'],{'as':{'plural':_0x16f8('0x1aa'),'singular':_0x16f8('0x1ab')},'foreignKey':_0x16f8('0x1ac'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x92')][_0x16f8('0x114')](db[_0x16f8('0x7c')],{'as':_0x16f8('0x19d'),'foreignKey':_0x16f8('0x1ad'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db['AnalyticCustomReport'][_0x16f8('0x114')](db[_0x16f8('0x9d')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1af'),'hooks':!![]});db[_0x16f8('0x1a4')][_0x16f8('0x114')](db[_0x16f8('0x9d')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':'DefaultReportId'});db[_0x16f8('0x9b')]['hasMany'](db[_0x16f8('0x9d')],{'as':'Fields','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b0')});db[_0x16f8('0x9d')][_0x16f8('0x11f')](db[_0x16f8('0x9b')],{'foreignKey':_0x16f8('0x1b0')});db[_0x16f8('0x1b1')][_0x16f8('0x114')](db[_0x16f8('0xa1')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xa1')]['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1b4'),'onDelete':_0x16f8('0x111'),'foreignKey':'SubjectId'});db[_0x16f8('0xa1')]['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1b5'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xa1')]['hasMany'](db['SalesforceField'],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db['SalesforceConfiguration'][_0x16f8('0x11f')](db[_0x16f8('0x1b1')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xa3')]['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db['SalesforceField']['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xa3')]['hasMany'](db[_0x16f8('0xa3')],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0xa3')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0x1bd')][_0x16f8('0x114')](db['SugarcrmConfiguration'],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db['SugarcrmConfiguration'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1b4'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b9')});db['SugarcrmConfiguration'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1b5'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xa6')][_0x16f8('0x114')](db['SugarcrmField'],{'as':'Fields','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xa6')][_0x16f8('0x11f')](db[_0x16f8('0x1bd')],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db['SugarcrmField'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1b8'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1ba'),'foreignKey':'DescriptionId'});db[_0x16f8('0xa8')][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0xa8')][_0x16f8('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0x1be')][_0x16f8('0x114')](db['DeskConfiguration'],{'as':_0x16f8('0x1b2'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xab')]['hasMany'](db[_0x16f8('0xad')],{'as':'Subjects','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xab')][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1b5'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xab')][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xab')][_0x16f8('0x11f')](db['DeskAccount'],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db[_0x16f8('0xab')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x1bf')});db['DeskField'][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1b8'),'foreignKey':'SubjectId'});db[_0x16f8('0xad')][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xad')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db['ZohoAccount'][_0x16f8('0x114')](db[_0x16f8('0xb1')],{'as':_0x16f8('0x1b2'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xb1')][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':_0x16f8('0x1b4'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b9')});db['ZohoConfiguration'][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':_0x16f8('0x1b5'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb1')][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':'Fields','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xb1')][_0x16f8('0x11f')](db[_0x16f8('0xaf')],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db['ZohoField']['hasMany'](db['ZohoField'],{'as':'Subject','foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0x1c1')][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':_0x16f8('0x1ba'),'foreignKey':'DescriptionId'});db[_0x16f8('0x1c1')][_0x16f8('0x114')](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0x1c1')][_0x16f8('0x11f')](db['Variable'],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0xb2')][_0x16f8('0x114')](db[_0x16f8('0xb3')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db['ZendeskConfiguration'][_0x16f8('0x114')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xb3')][_0x16f8('0x114')](db['ZendeskField'],{'as':_0x16f8('0x1b5'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb3')]['hasMany'](db['ZendeskField'],{'as':_0x16f8('0x1ae'),'foreignKey':'FieldId'});db[_0x16f8('0xb3')][_0x16f8('0x11f')](db['ZendeskAccount'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xb3')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x1c2')});db[_0x16f8('0xb4')][_0x16f8('0x114')](db['ZendeskField'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xb4')]['hasMany'](db[_0x16f8('0xb4')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb4')]['hasMany'](db[_0x16f8('0xb4')],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0xb4')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':'VariableId'});db[_0x16f8('0xb6')][_0x16f8('0x114')](db[_0x16f8('0xb8')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x16f8('0x1b3')});db['FreshdeskConfiguration']['hasMany'](db[_0x16f8('0xb9')],{'as':_0x16f8('0x1b4'),'onDelete':_0x16f8('0x111'),'foreignKey':'SubjectId'});db[_0x16f8('0xb8')][_0x16f8('0x114')](db[_0x16f8('0xb9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x16f8('0xb8')][_0x16f8('0x114')](db[_0x16f8('0xb9')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xb8')][_0x16f8('0x11f')](db['FreshdeskAccount'],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x16f8('0x121')](db['Tag'],{'through':_0x16f8('0x1c3')});db[_0x16f8('0xb9')][_0x16f8('0x114')](db['FreshdeskField'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xb9')][_0x16f8('0x114')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb9')][_0x16f8('0x114')](db[_0x16f8('0xb9')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db['FreshdeskField'][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':'VariableId'});db[_0x16f8('0x1c4')][_0x16f8('0x114')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xbc')][_0x16f8('0x114')](db[_0x16f8('0xbd')],{'as':_0x16f8('0x1b4'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xbc')][_0x16f8('0x114')](db[_0x16f8('0xbd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x16f8('0xbc')]['hasMany'](db[_0x16f8('0xbd')],{'as':'Fields','foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xbc')][_0x16f8('0x11f')](db[_0x16f8('0x1c4')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xbd')][_0x16f8('0x114')](db['VtigerField'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db['VtigerField'][_0x16f8('0x114')](db[_0x16f8('0xbd')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xbd')]['hasMany'](db[_0x16f8('0xbd')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xbd')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0x1c5')][_0x16f8('0x114')](db['ServicenowConfiguration'],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':'AccountId'});db[_0x16f8('0x1c6')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1b4'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0x1c6')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1b5'),'foreignKey':'DescriptionId'});db[_0x16f8('0x1c6')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1ae'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0x1c6')][_0x16f8('0x11f')](db[_0x16f8('0x1c5')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xc1')]['hasMany'](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xc1')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xc1')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xc1')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0xc3')][_0x16f8('0x114')](db[_0x16f8('0xc4')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xc4')][_0x16f8('0x114')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xc4')][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':_0x16f8('0x1b5'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b6')});db['Dynamics365Configuration'][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xc4')][_0x16f8('0x11f')](db[_0x16f8('0xc3')],{'as':'Account','foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xc6')][_0x16f8('0x114')](db['Dynamics365Field'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xc6')][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xc6')][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':'Field','foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xc6')][_0x16f8('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0x16f8('0x1bc')});db['FreshsalesAccount']['hasMany'](db[_0x16f8('0xca')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xca')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1b4'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xca')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1b5'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xca')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1ae'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xca')][_0x16f8('0x11f')](db[_0x16f8('0xc8')],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db[_0x16f8('0xcc')]['hasMany'](db[_0x16f8('0xcc')],{'as':'Subject','foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xcc')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1ba'),'foreignKey':'DescriptionId'});db[_0x16f8('0xcc')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db['FreshsalesField'][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0xd0')][_0x16f8('0x11f')](db[_0x16f8('0x61')],{});db[_0x16f8('0xd0')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':'ListId'});db[_0x16f8('0xd0')]['belongsTo'](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db['ChatQueueReport']['belongsTo'](db[_0x16f8('0x67')],{});db[_0x16f8('0xd0')]['belongsTo'](db['ChatMessage'],{});db[_0x16f8('0xd0')][_0x16f8('0x11f')](db['User'],{});db['ChatQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x188')],{});db[_0x16f8('0xd2')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':'cascade','foreignKey':_0x16f8('0x1c7')});db['ChatInternalMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':'cascade','foreignKey':_0x16f8('0x1c8')});db[_0x16f8('0x14a')][_0x16f8('0x114')](db[_0x16f8('0x1c9')],{'foreignKey':_0x16f8('0x1ca'),'onDelete':'cascade'});db[_0x16f8('0x14a')][_0x16f8('0x114')](db[_0x16f8('0xd3')],{'foreignKey':_0x16f8('0x1ca'),'onDelete':_0x16f8('0x111')});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x51')],{});db[_0x16f8('0x1cb')]['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x54')],{});db[_0x16f8('0x1cb')]['belongsTo'](db[_0x16f8('0x17d')],{});db[_0x16f8('0x1cb')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x56')],{});db[_0x16f8('0xdb')][_0x16f8('0x114')](db[_0x16f8('0x14a')],{'foreignKey':_0x16f8('0x1cc')});db[_0x16f8('0xdb')][_0x16f8('0x114')](db[_0x16f8('0x1c9')],{'foreignKey':_0x16f8('0x1cc')});db[_0x16f8('0xdb')][_0x16f8('0x114')](db[_0x16f8('0xd3')],{'foreignKey':_0x16f8('0x1cc')});db[_0x16f8('0xe0')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x143')});db['Team']['belongsToMany'](db['User'],{'as':_0x16f8('0x151'),'through':_0x16f8('0x128')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db[_0x16f8('0x1b')],{'through':_0x16f8('0x10e'),'as':_0x16f8('0x1cd')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db[_0x16f8('0x3c')],{'through':'team_has_mail_queues','as':_0x16f8('0x12f')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db['ChatQueue'],{'through':_0x16f8('0x1ce'),'as':_0x16f8('0x130')});db[_0x16f8('0xe5')]['belongsToMany'](db[_0x16f8('0x131')],{'through':_0x16f8('0x1cf'),'as':'FaxQueues'});db[_0x16f8('0xe5')]['belongsToMany'](db['SmsQueue'],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0x16f8('0xe5')][_0x16f8('0x121')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x16f8('0x134')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db[_0x16f8('0x10a')],{'through':_0x16f8('0x1d0'),'as':_0x16f8('0x135')});db['Campaign'][_0x16f8('0x114')](db[_0x16f8('0x70')],{'as':_0x16f8('0x193'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x16f8('0x74')],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x197')});db['Campaign']['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x16f8('0x72')],{'as':_0x16f8('0x1d1'),'foreignKey':_0x16f8('0x197')});db[_0x16f8('0xe9')]['belongsTo'](db[_0x16f8('0x29')],{'as':_0x16f8('0x29'),'foreignKey':'TrunkId'});db[_0x16f8('0xe9')]['belongsTo'](db['Trunk'],{'as':_0x16f8('0x14c'),'foreignKey':_0x16f8('0x14d')});db[_0x16f8('0xe9')]['belongsTo'](db[_0x16f8('0x85')],{'as':'Interval','foreignKey':_0x16f8('0x14e')});db[_0x16f8('0xe9')]['belongsTo'](db[_0x16f8('0xe0')],{'as':_0x16f8('0xe0'),'foreignKey':_0x16f8('0x1d2')});db[_0x16f8('0xe9')][_0x16f8('0x121')](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x16f8('0xe9')]['belongsToMany'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x153'),'through':_0x16f8('0x1d3')});db[_0x16f8('0xed')][_0x16f8('0x11f')](db[_0x16f8('0x6a')],{'as':_0x16f8('0x6a'),'foreignKey':_0x16f8('0x16f')});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x41')],{});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db['MailInteraction'],{});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'foreignKey':_0x16f8('0x1d4'),'as':'FromAccount'});db[_0x16f8('0xf0')]['belongsTo'](db['User'],{'foreignKey':_0x16f8('0x1d5'),'as':'FromAgent'});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':_0x16f8('0x1d7')});db[_0x16f8('0xf0')]['belongsTo'](db[_0x16f8('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'foreignKey':_0x16f8('0x1d8'),'as':'ToAccount'});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db['ChatMessage'],{});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db['ChatInteraction'],{});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db['ChatWebsite'],{'foreignKey':_0x16f8('0x1da'),'as':_0x16f8('0x1db')});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d5'),'as':_0x16f8('0x1dc')});db[_0x16f8('0x1d9')]['belongsTo'](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':_0x16f8('0x1d7')});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db[_0x16f8('0x188')],{'foreignKey':_0x16f8('0x1dd'),'as':_0x16f8('0x1de')});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db[_0x16f8('0x61')],{'foreignKey':_0x16f8('0x1df'),'as':_0x16f8('0x1e0')});db[_0x16f8('0x1e1')]['belongsTo'](db[_0x16f8('0x4e')],{});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x4c')],{});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db['FaxAccount'],{'foreignKey':_0x16f8('0x1e2'),'as':'FromAccount'});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d5'),'as':_0x16f8('0x1dc')});db[_0x16f8('0x1e1')]['belongsTo'](db[_0x16f8('0x11')],{'foreignKey':'ToUserId','as':_0x16f8('0x1d7')});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x131')],{'foreignKey':_0x16f8('0x1e3'),'as':_0x16f8('0x1de')});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x49')],{'foreignKey':_0x16f8('0x1e4'),'as':_0x16f8('0x1e0')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x16f8('0x58')],{'foreignKey':_0x16f8('0x1e5'),'as':_0x16f8('0x1db')});db['OpenchannelTransferReport'][_0x16f8('0x11f')](db['User'],{'foreignKey':'FromUserId','as':_0x16f8('0x1dc')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':_0x16f8('0x1d7')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db[_0x16f8('0x60')],{'foreignKey':_0x16f8('0x1e6'),'as':_0x16f8('0x1de')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db[_0x16f8('0x58')],{'foreignKey':_0x16f8('0x1e7'),'as':_0x16f8('0x1e0')});db[_0x16f8('0xf6')][_0x16f8('0x11f')](db[_0x16f8('0x17d')],{});db['SmsTransferReport']['belongsTo'](db[_0x16f8('0x54')],{});db[_0x16f8('0xf6')][_0x16f8('0x11f')](db[_0x16f8('0x51')],{'foreignKey':_0x16f8('0x1e8'),'as':_0x16f8('0x1db')});db['SmsTransferReport'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':'FromUserId','as':_0x16f8('0x1dc')});db[_0x16f8('0xf6')]['belongsTo'](db[_0x16f8('0x11')],{'foreignKey':'ToUserId','as':_0x16f8('0x1d7')});db[_0x16f8('0xf6')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x16f8('0x1de')});db[_0x16f8('0xf6')][_0x16f8('0x11f')](db[_0x16f8('0x51')],{'foreignKey':'ToSmsAccountId','as':_0x16f8('0x1e0')});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':_0x16f8('0x162')});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x7a')],{'as':_0x16f8('0x1e9'),'foreignKey':_0x16f8('0x162')});db['CmList']['hasMany'](db[_0x16f8('0x6e')],{'as':_0x16f8('0x191'),'onDelete':_0x16f8('0x111'),'foreignKey':'ListId'});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x74')],{'as':'HopperFinals','foreignKey':_0x16f8('0x162')});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x117'),'foreignKey':'ListId'});db[_0x16f8('0xf8')][_0x16f8('0x114')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x16f8('0x162')});db[_0x16f8('0xf8')]['belongsToMany'](db[_0x16f8('0x1b')],{'as':'Queues','through':_0x16f8('0x150')});db[_0x16f8('0xf8')]['belongsToMany'](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x127')});db[_0x16f8('0x136')][_0x16f8('0x114')](db['VoiceExtension'],{'as':_0x16f8('0x115'),'onDelete':_0x16f8('0x111')});db['VoicePrefix'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':'Agents','through':_0x16f8('0x138')});db['UserProfile'][_0x16f8('0x114')](db[_0x16f8('0x11')],{'as':_0x16f8('0x16d'),'foreignKey':'userProfileId'});db[_0x16f8('0xfa')][_0x16f8('0x114')](db[_0x16f8('0xfc')],{'as':'UserProfileSections','foreignKey':_0x16f8('0x120'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0xfc')][_0x16f8('0x114')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x16f8('0x1ea'),'onDelete':'cascade'});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':'WhatsappAccountId'});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x7f')],{'as':_0x16f8('0x174'),'foreignKey':_0x16f8('0x1eb')});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x106')],{'as':_0x16f8('0x156'),'foreignKey':_0x16f8('0x1eb')});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x104')],{'as':_0x16f8('0x175')});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x1ec')],{'as':'Applications'});db[_0x16f8('0x101')]['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x101')][_0x16f8('0x11f')](db[_0x16f8('0x87')],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x101')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x141')});db[_0x16f8('0x1ec')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x1ec')]['belongsTo'](db[_0x16f8('0x10a')],{'onDelete':'restrict'});db[_0x16f8('0x1ec')][_0x16f8('0x11f')](db[_0x16f8('0x101')],{'onDelete':'restrict'});db[_0x16f8('0x1ec')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db['WhatsappApplication'][_0x16f8('0x11f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x16f8('0x171')});db[_0x16f8('0x104')]['hasMany'](db[_0x16f8('0x106')],{'as':'Messages','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1ed')});db[_0x16f8('0x104')][_0x16f8('0x11f')](db['WhatsappAccount'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1eb')});db['WhatsappInteraction']['belongsTo'](db[_0x16f8('0x6e')],{'as':'Contact','foreignKey':_0x16f8('0x168')});db[_0x16f8('0x104')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x104')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0x16f8('0x104')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x1a7'),'as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12e'),'foreignKey':_0x16f8('0x1ed')});db['WhatsappMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11')});db[_0x16f8('0x106')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x15b')});db['WhatsappMessage'][_0x16f8('0x11f')](db[_0x16f8('0x104')],{'onDelete':_0x16f8('0x111'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x16f8('0x106')][_0x16f8('0x11f')](db[_0x16f8('0x101')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1eb')});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0x16f8('0x1ee')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x1ee')]['belongsTo'](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x1ee')][_0x16f8('0x11f')](db[_0x16f8('0x104')],{});db[_0x16f8('0x1ee')][_0x16f8('0x11f')](db[_0x16f8('0x10a')],{});db[_0x16f8('0x1ee')]['belongsTo'](db[_0x16f8('0x106')],{});db[_0x16f8('0x1ee')]['belongsTo'](db['User'],{});db[_0x16f8('0x108')]['belongsTo'](db[_0x16f8('0x106')],{});db[_0x16f8('0x108')][_0x16f8('0x11f')](db['WhatsappInteraction'],{});db[_0x16f8('0x108')][_0x16f8('0x11f')](db[_0x16f8('0x101')],{'foreignKey':_0x16f8('0x1ef'),'as':_0x16f8('0x1db')});db[_0x16f8('0x108')]['belongsTo'](db[_0x16f8('0x101')],{'foreignKey':'ToWhatsappAccountId','as':_0x16f8('0x1e0')});db[_0x16f8('0x108')]['belongsTo'](db[_0x16f8('0x10a')],{'foreignKey':_0x16f8('0x1f0'),'as':_0x16f8('0x1de')});db[_0x16f8('0x108')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':'FromUserId','as':_0x16f8('0x1dc')});db[_0x16f8('0x108')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':'ToAgent'});db['WhatsappQueue'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x1f1'),'foreignKey':_0x16f8('0x1f2')});db[_0x16f8('0x10a')]['belongsToMany'](db[_0x16f8('0xe5')],{'through':_0x16f8('0x1d0'),'as':'Teams'});module[_0x16f8('0x1f3')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa925=['../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappApplication','WhatsappInteraction','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','UserId','hasMany','VoiceRecording','UserVoiceQueueRt','Extensions','HopperFinals','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','MailQueue','MailQueues','FaxQueue','FaxQueues','SmsQueue','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceMusicOnHold','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMail','Messages','mailboxuser','mailbox','QueueCalls','ContactId','MailAccountId','Imap','CannedAnswer','Answers','MailApplication','TemplateId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','ChatWebsiteId','restrict','MailQueueReport','List','ListId','DashboardItem','Items','FaxAccountId','Interactions','Applications','Exntensions','user_has_fax_accounts','TagId','fax_interaction_has_tags','Users','FaxInteractionId','team_has_fax_queues','Dispositions','SmsAccountId','SmsApplication','SmsMessage','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','ChatMessage','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','chat_group_has_users','cm_contact_has_tags','CampaignId','OwnerId','Queue','All','OneAll','AutomationAllId','Condition','Any','AutomationAnyId','AutomationId','ParentId','MailApplications','ChatApplications','SmsApplications','DefaultReportId','Mohs','moh_has_sounds','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','SalesforceField','FieldId','Description','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','Descriptions','Subject','VariableId','int_desk_configuration_has_tags','Field','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','ServicenowConfiguration','Dynamics365Configuration','FreshsalesAccount','FreshsalesConfiguration','FromId','ToId','ProjectId','JscriptyAnswerReport','ChatQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','HopperHistory','Queues','VoicePrefix','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','path','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8_general_ci','sequelizeHistory','utf8mb4','utf8','username','password','database','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','Disposition','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField'];(function(_0x2f31ea,_0x351d88){var _0x5b6a5d=function(_0xf990d6){while(--_0xf990d6){_0x2f31ea['push'](_0x2f31ea['shift']());}};_0x5b6a5d(++_0x351d88);}(_0xa925,0x12c));var _0x5a92=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa925[_0x138adb];return _0x1b27f2;};'use strict';var path=require(_0x5a92('0x0'));var config=require(_0x5a92('0x1'));var Sequelize=require(_0x5a92('0x2'));var _=require(_0x5a92('0x3'));var jstz=require('jstz');var timezone=jstz[_0x5a92('0x4')]();config['sequelize']=_[_0x5a92('0x5')](config[_0x5a92('0x2')],{'database':_0x5a92('0x6'),'username':_0x5a92('0x7'),'password':_0x5a92('0x8'),'options':{'host':_0x5a92('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x5a92('0xa')}}});config[_0x5a92('0xb')]=_[_0x5a92('0x5')](config[_0x5a92('0xb')],{'database':_0x5a92('0x6'),'username':_0x5a92('0x7'),'password':_0x5a92('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x5a92('0xc')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x5a92('0xd'),'collate':_0x5a92('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x5a92('0x2')]['database'],config['sequelize'][_0x5a92('0xe')],config[_0x5a92('0x2')][_0x5a92('0xf')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x5a92('0x10')],config[_0x5a92('0xb')]['username'],config[_0x5a92('0xb')][_0x5a92('0xf')],config['sequelizeHistory'][_0x5a92('0x11')])};db[_0x5a92('0x12')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x14'));db[_0x5a92('0x15')]=db['sequelize'][_0x5a92('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x5a92('0x16')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x17'));db[_0x5a92('0x18')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x19'));db[_0x5a92('0x1a')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x1b'));db['VoiceRecording']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x1c'));db['ScreenRecording']=db[_0x5a92('0x2')]['import'](_0x5a92('0x1d'));db['VoiceMail']=db[_0x5a92('0x2')]['import']('../api/voiceMail/voiceMail.model');db[_0x5a92('0x1e')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x5a92('0x1f')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x20'));db[_0x5a92('0x21')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x5a92('0x22')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x23'));db[_0x5a92('0x24')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x5a92('0x25')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x26'));db['Trunk']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x27'));db[_0x5a92('0x28')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x29'));db[_0x5a92('0x2a')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x2b'));db[_0x5a92('0x2c')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x2d'));db['UserMailQueue']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x2e'));db['UserFaxQueue']=db[_0x5a92('0x2')]['import'](_0x5a92('0x2f'));db['UserSmsQueue']=db[_0x5a92('0x2')]['import'](_0x5a92('0x30'));db['UserOpenchannelQueue']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x31'));db[_0x5a92('0x32')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x33'));db[_0x5a92('0x34')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x35'));db[_0x5a92('0x36')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x37'));db[_0x5a92('0x38')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x39'));db['MailQueue']=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x5a92('0x2')]['import'](_0x5a92('0x3a'));db[_0x5a92('0x3b')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x3c'));db[_0x5a92('0x3d')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x3e'));db['MailApplication']=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x3f'));db['Dashboard']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x40'));db['DashboardItem']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x41'));db[_0x5a92('0x42')]=db['sequelize']['import'](_0x5a92('0x43'));db[_0x5a92('0x44')]=db['sequelize'][_0x5a92('0x13')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x45'));db[_0x5a92('0x46')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/faxQueue/faxQueue.model');db[_0x5a92('0x47')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x48'));db[_0x5a92('0x49')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x4a'));db['SmsApplication']=db['sequelize']['import'](_0x5a92('0x4b'));db[_0x5a92('0x4c')]=db[_0x5a92('0x2')]['import']('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x5a92('0x2')]['import']('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x5a92('0x2')]['import'](_0x5a92('0x4d'));db['OpenchannelAccount']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x4e'));db[_0x5a92('0x4f')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x50'));db[_0x5a92('0x51')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x52'));db[_0x5a92('0x53')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x54'));db['ChatWebsite']=db[_0x5a92('0x2')]['import'](_0x5a92('0x55'));db[_0x5a92('0x56')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x57'));db[_0x5a92('0x58')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/chatApplication/chatApplication.model');db[_0x5a92('0x59')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x5a'));db['ChatMessage']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x5b'));db[_0x5a92('0x5c')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x5d'));db[_0x5a92('0x5e')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x5f'));db[_0x5a92('0x60')]=db[_0x5a92('0x2')]['import']('../api/chatGroup/chatGroup.model');db[_0x5a92('0x61')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x62'));db[_0x5a92('0x63')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x64'));db[_0x5a92('0x65')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x66'));db[_0x5a92('0x67')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x68'));db[_0x5a92('0x69')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x6a'));db[_0x5a92('0x6b')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x6c'));db[_0x5a92('0x6d')]=db[_0x5a92('0x2')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x5a92('0x6e')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x6f'));db[_0x5a92('0x70')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x71'));db[_0x5a92('0x72')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x73'));db[_0x5a92('0x74')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x75'));db['CannedAnswer']=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x5a92('0x76')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/disposition/disposition.model');db['Condition']=db[_0x5a92('0x2')]['import']('../api/condition/condition.model');db[_0x5a92('0x77')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x78'));db['Pause']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x79'));db[_0x5a92('0x7a')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x7b'));db[_0x5a92('0x7c')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x5a92('0x7d')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x7e'));db[_0x5a92('0x7f')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x80'));db['Tag']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x81'));db[_0x5a92('0x82')]=db[_0x5a92('0x2')]['import'](_0x5a92('0x83'));db[_0x5a92('0x84')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x85'));db[_0x5a92('0x86')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/variable/variable.model');db['Integration']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x87'));db[_0x5a92('0x88')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x89'));db[_0x5a92('0x8a')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x8b'));db[_0x5a92('0x8c')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x8d'));db['AnalyticExtractedReport']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x8e'));db[_0x5a92('0x8f')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x90'));db[_0x5a92('0x91')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x92'));db[_0x5a92('0x93')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x5a92('0x94')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x95'));db[_0x5a92('0x96')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x97'));db['SalesforceField']=db[_0x5a92('0x2')]['import'](_0x5a92('0x98'));db['SugarcrmAccount']=db[_0x5a92('0x2')]['import'](_0x5a92('0x99'));db['SugarcrmConfiguration']=db['sequelize'][_0x5a92('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0x9a'));db[_0x5a92('0x9b')]=db['sequelize']['import'](_0x5a92('0x9c'));db[_0x5a92('0x9d')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x9e'));db[_0x5a92('0x9f')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xa0'));db[_0x5a92('0xa1')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x5a92('0xa2')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x5a92('0xa3')]=db['sequelize']['import'](_0x5a92('0xa4'));db[_0x5a92('0xa5')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x5a92('0xa6')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xa7'));db[_0x5a92('0xa8')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xa9'));db[_0x5a92('0xaa')]=db['sequelize']['import'](_0x5a92('0xab'));db['FreshdeskField']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0xac'));db[_0x5a92('0xad')]=db[_0x5a92('0x2')]['import'](_0x5a92('0xae'));db[_0x5a92('0xaf')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xb0'));db['VtigerField']=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x5a92('0xb1')]=db['sequelize'][_0x5a92('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x5a92('0x2')]['import'](_0x5a92('0xb2'));db[_0x5a92('0xb3')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x5a92('0x2')]['import'](_0x5a92('0xb4'));db[_0x5a92('0xb5')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xb6'));db['FreshsalesAccount']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xb7'));db['FreshsalesConfiguration']=db['sequelize']['import'](_0x5a92('0xb8'));db[_0x5a92('0xb9')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xba'));db[_0x5a92('0xbb')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0x87'));db[_0x5a92('0xbc')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0xbd'));db[_0x5a92('0xbe')]=db['sequelize']['import'](_0x5a92('0xbf'));db[_0x5a92('0xc0')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xc1'));db['JscriptyAnswerReport']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xc2'));db[_0x5a92('0xc3')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x5a92('0xc4')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xc5'));db[_0x5a92('0xc6')]=db[_0x5a92('0x2')]['import'](_0x5a92('0xc7'));db[_0x5a92('0xc8')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xc9'));db['SquareDetailsReport']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xca'));db[_0x5a92('0xcb')]=db['sequelize']['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x5a92('0xcc')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xcd'));db[_0x5a92('0xce')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x5a92('0xcf')]=db[_0x5a92('0x2')]['import'](_0x5a92('0xd0'));db[_0x5a92('0xd1')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xd2'));db[_0x5a92('0xd3')]=db[_0x5a92('0x2')]['import']('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0xd4'));db[_0x5a92('0xd5')]=db['sequelize'][_0x5a92('0x13')]('../api/license/license.model');db[_0x5a92('0xd6')]=db[_0x5a92('0x2')]['import'](_0x5a92('0xd7'));db[_0x5a92('0xd8')]=db[_0x5a92('0x2')]['import'](_0x5a92('0xd9'));db[_0x5a92('0xda')]=db['sequelize'][_0x5a92('0x13')]('../api/attachment/attachment.model');db['Plugin']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xdb'));db[_0x5a92('0xdc')]=db[_0x5a92('0x2')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x5a92('0x2')]['import'](_0x5a92('0xdd'));db['FaxTransferReport']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xde'));db[_0x5a92('0xdf')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x5a92('0xe0')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xe1'));db[_0x5a92('0xe2')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xe3'));db['VoicePrefix']=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xe4'));db[_0x5a92('0xe5')]=db[_0x5a92('0x2')]['import'](_0x5a92('0xe6'));db[_0x5a92('0xe7')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0xe8'));db[_0x5a92('0xe9')]=db['sequelize'][_0x5a92('0x13')](_0x5a92('0xea'));db[_0x5a92('0xeb')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xec'));db['WhatsappAccount']=db['sequelize'][_0x5a92('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0x5a92('0xed')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x5a92('0xee')]=db['sequelize']['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x5a92('0xef')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db['sequelize'][_0x5a92('0x13')](_0x5a92('0xf0'));db[_0x5a92('0xf1')]=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x5a92('0xf2')]=db[_0x5a92('0x2')][_0x5a92('0x13')](_0x5a92('0xf3'));db['CloudProvider']=db[_0x5a92('0x2')][_0x5a92('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x5a92('0xf4')]=db[_0x5a92('0x2')]['import'](_0x5a92('0xf5'));db[_0x5a92('0x12')][_0x5a92('0xf6')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0xf8')});db['User'][_0x5a92('0xf9')](db[_0x5a92('0xfa')],{'as':'Recordings','foreignKey':_0x5a92('0xf8')});db['User'][_0x5a92('0xf9')](db[_0x5a92('0xfb')],{'as':'VoiceQueuesRt','foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x12')][_0x5a92('0xf9')](db[_0x5a92('0x18')],{'as':_0x5a92('0xfc'),'onDelete':_0x5a92('0xf7'),'hooks':!![]});db[_0x5a92('0x12')][_0x5a92('0xf9')](db[_0x5a92('0x6b')],{'as':_0x5a92('0xfd'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x12')][_0x5a92('0xf9')](db[_0x5a92('0x6d')],{'as':'HopperHistory','foreignKey':_0x5a92('0xf8')});db['User'][_0x5a92('0xf9')](db[_0x5a92('0x6e')],{'as':'ReportAgentPreview','foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x12')][_0x5a92('0xf9')](db[_0x5a92('0x51')],{'as':_0x5a92('0xfe'),'foreignKey':'UserId'});db[_0x5a92('0x12')][_0x5a92('0xf9')](db['ChatInteraction'],{'as':_0x5a92('0xff'),'foreignKey':_0x5a92('0xf8')});db['User'][_0x5a92('0xf9')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x12')][_0x5a92('0xf9')](db[_0x5a92('0x100')],{'as':_0x5a92('0x101'),'foreignKey':_0x5a92('0xf8')});db['User'][_0x5a92('0xf9')](db[_0x5a92('0x3b')],{'as':_0x5a92('0x102'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x12')][_0x5a92('0xf9')](db['WhatsappInteraction'],{'as':_0x5a92('0x103'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x12')]['hasMany'](db[_0x5a92('0xeb')],{'as':_0x5a92('0x104'),'foreignKey':_0x5a92('0x105')});db['User'][_0x5a92('0x106')](db['UserProfile'],{'as':_0x5a92('0xe5'),'foreignKey':_0x5a92('0x107')});db['User'][_0x5a92('0x108')](db[_0x5a92('0x60')],{'as':_0x5a92('0x109'),'through':'chat_group_has_users'});db['User'][_0x5a92('0x108')](db[_0x5a92('0x65')],{'as':_0x5a92('0x10a'),'through':_0x5a92('0x10b')});db[_0x5a92('0x12')]['belongsToMany'](db['CmList'],{'as':_0x5a92('0x10c'),'through':_0x5a92('0x10d')});db[_0x5a92('0x12')][_0x5a92('0x108')](db[_0x5a92('0x10e')],{'through':_0x5a92('0x10f')});db['User']['belongsToMany'](db[_0x5a92('0x3b')],{'as':_0x5a92('0x102'),'through':'user_has_mail_interactions'});db[_0x5a92('0x12')][_0x5a92('0x108')](db['ChatInteraction'],{'as':_0x5a92('0xff'),'through':'user_has_chat_interactions'});db[_0x5a92('0x12')]['belongsToMany'](db[_0x5a92('0x100')],{'as':'FaxInteractions','through':_0x5a92('0x110')});db['User']['belongsToMany'](db[_0x5a92('0x4c')],{'as':_0x5a92('0x111'),'through':_0x5a92('0x112')});db[_0x5a92('0x12')]['belongsToMany'](db[_0x5a92('0x51')],{'as':_0x5a92('0xfe'),'through':_0x5a92('0x113')});db['User']['belongsToMany'](db[_0x5a92('0xee')],{'as':_0x5a92('0x103'),'through':'user_has_whatsapp_interactions'});db['User'][_0x5a92('0x108')](db[_0x5a92('0x1a')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db['User'][_0x5a92('0x108')](db[_0x5a92('0x114')],{'as':_0x5a92('0x115'),'through':'UserMailQueue','required':![]});db[_0x5a92('0x12')][_0x5a92('0x108')](db[_0x5a92('0x5e')],{'as':'ChatQueues','through':_0x5a92('0x2c'),'required':![],'hooks':!![]});db[_0x5a92('0x12')]['belongsToMany'](db[_0x5a92('0x116')],{'as':_0x5a92('0x117'),'through':'UserFaxQueue','required':![]});db['User'][_0x5a92('0x108')](db[_0x5a92('0x118')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db['User'][_0x5a92('0x108')](db[_0x5a92('0x53')],{'as':_0x5a92('0x119'),'through':'UserOpenchannelQueue','required':![]});db[_0x5a92('0x12')]['belongsToMany'](db[_0x5a92('0xf2')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x5a92('0x12')][_0x5a92('0x108')](db[_0x5a92('0xe2')],{'through':_0x5a92('0x10d')});db[_0x5a92('0x12')][_0x5a92('0x108')](db['VoicePrefix'],{'as':_0x5a92('0x11a'),'through':_0x5a92('0x11b'),'required':![]});db[_0x5a92('0x12')][_0x5a92('0x108')](db[_0x5a92('0x11c')],{'as':_0x5a92('0x11d'),'through':_0x5a92('0x11e')});db['User'][_0x5a92('0x108')](db[_0x5a92('0x42')],{'as':_0x5a92('0x11f'),'through':'user_has_fax_accounts'});db[_0x5a92('0x12')][_0x5a92('0x108')](db[_0x5a92('0x38')],{'as':_0x5a92('0x120'),'through':'user_has_mail_accounts'});db[_0x5a92('0x12')]['belongsToMany'](db[_0x5a92('0x121')],{'as':_0x5a92('0x122'),'through':'user_has_openchannel_accounts'});db[_0x5a92('0x12')][_0x5a92('0x108')](db[_0x5a92('0x49')],{'as':_0x5a92('0x123'),'through':_0x5a92('0x124')});db[_0x5a92('0x12')][_0x5a92('0x108')](db[_0x5a92('0x125')],{'as':_0x5a92('0x126'),'through':_0x5a92('0x127')});db['User']['belongsToMany'](db[_0x5a92('0xcf')],{'as':_0x5a92('0x128'),'through':_0x5a92('0x129')});db[_0x5a92('0x15')][_0x5a92('0xf9')](db[_0x5a92('0x18')],{'as':_0x5a92('0x12a'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x12b')});db[_0x5a92('0x16')][_0x5a92('0xf9')](db[_0x5a92('0x18')],{'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x18')][_0x5a92('0xf9')](db[_0x5a92('0x18')],{'as':'Applications','onDelete':_0x5a92('0xf7')});db[_0x5a92('0x12c')][_0x5a92('0x108')](db[_0x5a92('0x7f')],{'as':_0x5a92('0x12d'),'through':'moh_has_sounds'});db[_0x5a92('0x1a')][_0x5a92('0xf9')](db[_0x5a92('0xfb')],{'as':_0x5a92('0x12e'),'foreignKey':_0x5a92('0x12f')});db[_0x5a92('0x1a')]['hasMany'](db[_0x5a92('0x67')],{'as':_0x5a92('0x130'),'foreignKey':_0x5a92('0x12f')});db[_0x5a92('0x1a')]['hasMany'](db[_0x5a92('0x6b')],{'as':'HopperFinals','foreignKey':_0x5a92('0x12f')});db[_0x5a92('0x1a')][_0x5a92('0xf9')](db[_0x5a92('0x6d')],{'as':_0x5a92('0x131'),'foreignKey':'VoiceQueueId'});db[_0x5a92('0x1a')]['hasMany'](db[_0x5a92('0x6e')],{'as':'ReportAgentPreview','foreignKey':_0x5a92('0x12f')});db['VoiceQueue'][_0x5a92('0xf9')](db[_0x5a92('0x69')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x5a92('0xf9')](db[_0x5a92('0xc4')],{'as':_0x5a92('0x132'),'foreignKey':_0x5a92('0x12f')});db[_0x5a92('0x1a')]['belongsTo'](db[_0x5a92('0x133')],{'as':_0x5a92('0x133'),'foreignKey':_0x5a92('0x134')});db['VoiceQueue'][_0x5a92('0x106')](db[_0x5a92('0x133')],{'as':_0x5a92('0x135'),'foreignKey':_0x5a92('0x136')});db[_0x5a92('0x1a')][_0x5a92('0x106')](db['Interval'],{'as':_0x5a92('0x77'),'foreignKey':_0x5a92('0x137')});db[_0x5a92('0x1a')][_0x5a92('0x106')](db[_0x5a92('0x138')],{'as':_0x5a92('0x139'),'foreignKey':_0x5a92('0x13a')});db['VoiceQueue'][_0x5a92('0x108')](db['CmList'],{'as':_0x5a92('0x10c'),'through':_0x5a92('0x13b')});db[_0x5a92('0x1a')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x2a')});db['VoiceQueue']['belongsToMany'](db[_0x5a92('0x10e')],{'as':_0x5a92('0x13d'),'through':'TeamVoiceQueue'});db[_0x5a92('0x1a')][_0x5a92('0x108')](db[_0x5a92('0xe2')],{'as':_0x5a92('0x13e'),'through':_0x5a92('0x13f')});db[_0x5a92('0xfa')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'as':_0x5a92('0x12'),'foreignKey':_0x5a92('0xf8')});db['ScreenRecording'][_0x5a92('0x106')](db[_0x5a92('0x12')],{'as':_0x5a92('0x12'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x140')]['hasMany'](db['VoiceMailMessage'],{'as':_0x5a92('0x141'),'onDelete':'cascade','foreignKey':_0x5a92('0x142'),'sourceKey':_0x5a92('0x143')});db[_0x5a92('0x1e')]['belongsTo'](db[_0x5a92('0x140')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db['VoiceCallReport'][_0x5a92('0xf9')](db[_0x5a92('0x24')],{'as':_0x5a92('0x144'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x5a92('0xf9')](db[_0x5a92('0x22')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x5a92('0x12')],{'as':_0x5a92('0x12'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x1f')]['belongsTo'](db[_0x5a92('0x65')],{'as':'Contact','foreignKey':_0x5a92('0x145')});db['MailServerIn'][_0x5a92('0x106')](db[_0x5a92('0x38')],{'as':_0x5a92('0x38'),'foreignKey':_0x5a92('0x146')});db[_0x5a92('0x36')][_0x5a92('0x106')](db[_0x5a92('0x38')],{'as':_0x5a92('0x38'),'foreignKey':_0x5a92('0x146')});db[_0x5a92('0x38')]['hasOne'](db[_0x5a92('0x34')],{'as':_0x5a92('0x147'),'onDelete':'cascade'});db['MailAccount']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x5a92('0xf7')});db['MailAccount']['hasMany'](db[_0x5a92('0x76')],{'as':'Dispositions','foreignKey':_0x5a92('0x146')});db['MailAccount']['hasMany'](db[_0x5a92('0x148')],{'as':_0x5a92('0x149'),'foreignKey':_0x5a92('0x146')});db[_0x5a92('0x38')][_0x5a92('0xf9')](db[_0x5a92('0x3d')],{'as':_0x5a92('0x141'),'foreignKey':_0x5a92('0x146')});db[_0x5a92('0x38')]['hasMany'](db[_0x5a92('0x3b')],{'as':'Interactions'});db[_0x5a92('0x38')]['hasMany'](db[_0x5a92('0x14a')],{'as':'Applications'});db['MailAccount'][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':'List','foreignKey':'ListId'});db[_0x5a92('0x38')][_0x5a92('0x106')](db[_0x5a92('0x82')],{'as':_0x5a92('0x82'),'foreignKey':_0x5a92('0x14b')});db[_0x5a92('0x38')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x5a92('0x13a')});db['MailAccount'][_0x5a92('0x108')](db['User'],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x14c')});db[_0x5a92('0x114')]['belongsToMany'](db[_0x5a92('0x12')],{'as':'Agents','through':'UserMailQueue'});db['MailQueue'][_0x5a92('0x108')](db[_0x5a92('0x10e')],{'through':_0x5a92('0x14d'),'as':_0x5a92('0x13d')});db[_0x5a92('0x3b')]['hasMany'](db['MailMessage'],{'as':_0x5a92('0x141'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x14e')});db[_0x5a92('0x3b')][_0x5a92('0x106')](db[_0x5a92('0x38')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x146')});db[_0x5a92('0x3b')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x3b')]['belongsTo'](db[_0x5a92('0x12')],{'as':_0x5a92('0x151'),'foreignKey':'UserId'});db['MailInteraction'][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x153'),'as':_0x5a92('0x154')});db[_0x5a92('0x3b')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x153'),'as':_0x5a92('0x155')});db[_0x5a92('0x3b')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0x5a92('0x14e')});db['MailMessage'][_0x5a92('0xf9')](db['Attachment'],{'as':_0x5a92('0x156'),'onDelete':_0x5a92('0xf7')});db['MailMessage'][_0x5a92('0x106')](db['User'],{'as':'User'});db[_0x5a92('0x3d')]['belongsTo'](db[_0x5a92('0x65')],{'onDelete':_0x5a92('0xf7'),'as':_0x5a92('0x150')});db['MailMessage'][_0x5a92('0x106')](db['MailInteraction'],{'as':_0x5a92('0x157'),'foreignKey':'MailInteractionId'});db[_0x5a92('0x3d')][_0x5a92('0x106')](db[_0x5a92('0x38')],{'as':_0x5a92('0x14f'),'foreignKey':'MailAccountId'});db[_0x5a92('0x3d')][_0x5a92('0x106')](db[_0x5a92('0x11c')],{'as':_0x5a92('0x11c'),'foreignKey':_0x5a92('0x158')});db[_0x5a92('0x3d')]['belongsTo'](db[_0x5a92('0x5c')],{'as':_0x5a92('0x5c'),'foreignKey':'ChatOfflineMessageId'});db[_0x5a92('0x14a')][_0x5a92('0x106')](db['User'],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x14a')][_0x5a92('0x106')](db['MailQueue'],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x14a')][_0x5a92('0x106')](db[_0x5a92('0x38')],{'onDelete':'restrict'});db['MailApplication'][_0x5a92('0x106')](db['Interval'],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x137')});db[_0x5a92('0x14a')][_0x5a92('0x106')](db[_0x5a92('0x152')],{'onDelete':_0x5a92('0x159'),'foreignKey':'TagId'});db[_0x5a92('0x15a')][_0x5a92('0x106')](db[_0x5a92('0x38')],{});db['MailQueueReport'][_0x5a92('0x106')](db['CmList'],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0x15a')][_0x5a92('0x106')](db['CmContact'],{'as':_0x5a92('0x150'),'foreignKey':'ContactId'});db['MailQueueReport']['belongsTo'](db[_0x5a92('0x3b')],{});db[_0x5a92('0x15a')][_0x5a92('0x106')](db[_0x5a92('0x3d')],{});db['MailQueueReport'][_0x5a92('0x106')](db['User'],{});db[_0x5a92('0x15a')][_0x5a92('0x106')](db[_0x5a92('0x114')],{});db['Dashboard']['hasMany'](db[_0x5a92('0x15d')],{'as':_0x5a92('0x15e'),'onDelete':'cascade'});db[_0x5a92('0x42')]['hasMany'](db[_0x5a92('0x76')],{'as':'Dispositions','foreignKey':_0x5a92('0x15f')});db['FaxAccount'][_0x5a92('0xf9')](db[_0x5a92('0x148')],{'as':_0x5a92('0x149'),'foreignKey':_0x5a92('0x15f')});db['FaxAccount'][_0x5a92('0xf9')](db[_0x5a92('0x100')],{'as':_0x5a92('0x160')});db[_0x5a92('0x42')]['hasMany'](db[_0x5a92('0x44')],{'as':_0x5a92('0x161')});db[_0x5a92('0x42')]['hasMany'](db[_0x5a92('0x18')],{'as':_0x5a92('0x162'),'onDelete':_0x5a92('0xf7')});db['FaxAccount'][_0x5a92('0xf9')](db['FaxMessage'],{'as':_0x5a92('0x141')});db[_0x5a92('0x42')][_0x5a92('0x106')](db[_0x5a92('0x133')],{'as':'Trunk'});db[_0x5a92('0x42')][_0x5a92('0x106')](db['CmList'],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db['FaxAccount'][_0x5a92('0x106')](db[_0x5a92('0x138')],{'as':'mandatoryDispositionPause','foreignKey':_0x5a92('0x13a')});db[_0x5a92('0x42')]['belongsToMany'](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x163')});db[_0x5a92('0x44')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x44')][_0x5a92('0x106')](db['FaxQueue'],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x44')][_0x5a92('0x106')](db[_0x5a92('0x42')],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x44')]['belongsTo'](db['Tag'],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x164')});db['FaxInteraction'][_0x5a92('0xf9')](db['FaxMessage'],{'as':_0x5a92('0x141'),'onDelete':_0x5a92('0xf7'),'foreignKey':'FaxInteractionId'});db[_0x5a92('0x100')]['belongsTo'](db[_0x5a92('0x42')],{'as':'Account','foreignKey':_0x5a92('0x15f')});db[_0x5a92('0x100')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':'ContactId'});db[_0x5a92('0x100')]['belongsTo'](db[_0x5a92('0x12')],{'as':_0x5a92('0x151'),'foreignKey':'UserId'});db[_0x5a92('0x100')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x165'),'as':_0x5a92('0x154')});db[_0x5a92('0x100')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db['FaxInteraction']['belongsToMany'](db[_0x5a92('0x12')],{'as':_0x5a92('0x166'),'through':_0x5a92('0x110'),'foreignKey':_0x5a92('0x167')});db[_0x5a92('0x46')][_0x5a92('0x106')](db['User'],{'onDelete':_0x5a92('0xf7'),'as':_0x5a92('0x12')});db[_0x5a92('0x46')][_0x5a92('0x106')](db[_0x5a92('0x100')],{'as':'Interaction','foreignKey':_0x5a92('0x167')});db[_0x5a92('0x46')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage'][_0x5a92('0x106')](db[_0x5a92('0xda')],{'as':_0x5a92('0xda'),'foreignKey':'AttachmentId'});db[_0x5a92('0x46')][_0x5a92('0x106')](db[_0x5a92('0x42')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x15f')});db[_0x5a92('0x116')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':'UserFaxQueue'});db[_0x5a92('0x116')][_0x5a92('0x108')](db[_0x5a92('0x10e')],{'through':_0x5a92('0x168'),'as':_0x5a92('0x13d')});db[_0x5a92('0x47')][_0x5a92('0x106')](db[_0x5a92('0x42')],{});db['FaxQueueReport']['belongsTo'](db[_0x5a92('0xe2')],{'as':_0x5a92('0x15b'),'foreignKey':'ListId'});db[_0x5a92('0x47')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x47')][_0x5a92('0x106')](db[_0x5a92('0x100')],{});db['FaxQueueReport'][_0x5a92('0x106')](db[_0x5a92('0x46')],{});db[_0x5a92('0x47')][_0x5a92('0x106')](db[_0x5a92('0x12')],{});db[_0x5a92('0x47')][_0x5a92('0x106')](db[_0x5a92('0x116')],{});db[_0x5a92('0x49')][_0x5a92('0xf9')](db[_0x5a92('0x76')],{'as':_0x5a92('0x169'),'foreignKey':_0x5a92('0x16a')});db['SmsAccount']['hasMany'](db[_0x5a92('0x148')],{'as':_0x5a92('0x149'),'foreignKey':'SmsAccountId'});db[_0x5a92('0x49')]['hasMany'](db['SmsMessage'],{'as':_0x5a92('0x141'),'foreignKey':'SmsAccountId'});db[_0x5a92('0x49')][_0x5a92('0xf9')](db[_0x5a92('0x4c')],{'as':_0x5a92('0x160')});db[_0x5a92('0x49')][_0x5a92('0xf9')](db[_0x5a92('0x16b')],{'as':_0x5a92('0x161')});db[_0x5a92('0x49')][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0x49')][_0x5a92('0x106')](db[_0x5a92('0x138')],{'as':_0x5a92('0x139'),'foreignKey':_0x5a92('0x13a')});db[_0x5a92('0x49')][_0x5a92('0x108')](db['User'],{'as':'Agents','through':_0x5a92('0x124')});db[_0x5a92('0x16b')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'onDelete':_0x5a92('0x159')});db['SmsApplication'][_0x5a92('0x106')](db[_0x5a92('0x118')],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x16b')][_0x5a92('0x106')](db[_0x5a92('0x49')],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x16b')][_0x5a92('0x106')](db['Interval'],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x137')});db[_0x5a92('0x16b')][_0x5a92('0x106')](db[_0x5a92('0x152')],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x164')});db[_0x5a92('0x4c')]['hasMany'](db[_0x5a92('0x16c')],{'as':_0x5a92('0x141'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x16d')});db[_0x5a92('0x4c')][_0x5a92('0x106')](db['SmsAccount'],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x16a')});db[_0x5a92('0x4c')][_0x5a92('0x106')](db['CmContact'],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x4c')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'as':_0x5a92('0x151'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x4c')]['belongsToMany'](db[_0x5a92('0x152')],{'through':_0x5a92('0x16e'),'as':'Tags'});db[_0x5a92('0x4c')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':'sms_interaction_has_tags','as':_0x5a92('0x155')});db[_0x5a92('0x4c')]['belongsToMany'](db[_0x5a92('0x12')],{'as':_0x5a92('0x166'),'through':_0x5a92('0x112'),'foreignKey':_0x5a92('0x16d')});db[_0x5a92('0x16c')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'as':_0x5a92('0x12')});db[_0x5a92('0x16c')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'onDelete':_0x5a92('0xf7'),'as':_0x5a92('0x150')});db['SmsMessage'][_0x5a92('0x106')](db['SmsInteraction'],{'onDelete':_0x5a92('0xf7'),'as':_0x5a92('0x157'),'foreignKey':_0x5a92('0x16d')});db[_0x5a92('0x16c')][_0x5a92('0x106')](db[_0x5a92('0x49')],{'as':'Account','foreignKey':'SmsAccountId'});db['SmsQueue'][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue'][_0x5a92('0x108')](db[_0x5a92('0x10e')],{'through':_0x5a92('0x16f'),'as':_0x5a92('0x13d')});db['OpenchannelAccount'][_0x5a92('0xf9')](db[_0x5a92('0x76')],{'as':'Dispositions','foreignKey':'OpenchannelAccountId'});db[_0x5a92('0x121')][_0x5a92('0xf9')](db[_0x5a92('0x148')],{'as':_0x5a92('0x149'),'foreignKey':'OpenchannelAccountId'});db[_0x5a92('0x121')][_0x5a92('0xf9')](db[_0x5a92('0x51')],{'as':_0x5a92('0x160'),'foreignKey':_0x5a92('0x170')});db['OpenchannelAccount'][_0x5a92('0xf9')](db[_0x5a92('0x171')],{'as':_0x5a92('0x141'),'foreignKey':_0x5a92('0x170')});db[_0x5a92('0x121')][_0x5a92('0xf9')](db[_0x5a92('0x4f')],{'as':_0x5a92('0x161'),'foreignKey':_0x5a92('0x170')});db[_0x5a92('0x121')][_0x5a92('0x106')](db['CmList'],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0x121')][_0x5a92('0x106')](db[_0x5a92('0x138')],{'as':_0x5a92('0x139'),'foreignKey':_0x5a92('0x13a')});db[_0x5a92('0x121')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x172')});db[_0x5a92('0x4f')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0x4f')][_0x5a92('0x106')](db[_0x5a92('0x53')],{'onDelete':'restrict','foreignKey':_0x5a92('0x173')});db[_0x5a92('0x4f')][_0x5a92('0x106')](db[_0x5a92('0x121')],{'onDelete':_0x5a92('0x159'),'foreignKey':'OpenchannelAccountId'});db[_0x5a92('0x4f')]['belongsTo'](db[_0x5a92('0x77')],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x137')});db['OpenchannelApplication'][_0x5a92('0x106')](db[_0x5a92('0x152')],{'onDelete':'restrict','foreignKey':_0x5a92('0x164')});db['OpenchannelInteraction'][_0x5a92('0xf9')](db[_0x5a92('0x171')],{'as':_0x5a92('0x141'),'onDelete':'cascade','foreignKey':_0x5a92('0x174')});db[_0x5a92('0x51')][_0x5a92('0x106')](db[_0x5a92('0x121')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x170')});db[_0x5a92('0x51')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x51')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'as':_0x5a92('0x151'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x51')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':'openchannel_interaction_has_tags','as':_0x5a92('0x154')});db[_0x5a92('0x51')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x175'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':'Users','through':_0x5a92('0x113'),'foreignKey':_0x5a92('0x174')});db[_0x5a92('0x171')][_0x5a92('0x106')](db['User'],{'onDelete':_0x5a92('0xf7'),'as':'User'});db[_0x5a92('0x171')]['belongsTo'](db['CmContact'],{'onDelete':_0x5a92('0xf7'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0x5a92('0x51')],{'onDelete':_0x5a92('0xf7'),'as':'Interaction','foreignKey':_0x5a92('0x174')});db[_0x5a92('0x171')][_0x5a92('0x106')](db[_0x5a92('0xda')],{'as':_0x5a92('0xda'),'foreignKey':_0x5a92('0x176')});db[_0x5a92('0x171')][_0x5a92('0x106')](db[_0x5a92('0x121')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x170')});db['OpenchannelQueue']['belongsToMany'](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':'UserOpenchannelQueue','foreignKey':_0x5a92('0x173')});db[_0x5a92('0x53')][_0x5a92('0x108')](db[_0x5a92('0x10e')],{'through':_0x5a92('0x177'),'as':'Teams'});db[_0x5a92('0x11c')][_0x5a92('0xf9')](db[_0x5a92('0x76')],{'as':_0x5a92('0x169'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0x5a92('0x148')],{'as':_0x5a92('0x149'),'foreignKey':_0x5a92('0x158')});db[_0x5a92('0x11c')][_0x5a92('0xf9')](db['ChatProactiveAction'],{'as':_0x5a92('0x178')});db['ChatWebsite']['hasMany'](db[_0x5a92('0x59')],{'as':'Interactions'});db['ChatWebsite'][_0x5a92('0xf9')](db['ChatApplication'],{'as':'Applications'});db[_0x5a92('0x11c')][_0x5a92('0xf9')](db[_0x5a92('0x179')],{'as':_0x5a92('0x141')});db[_0x5a92('0x11c')][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0x11c')][_0x5a92('0x106')](db[_0x5a92('0x77')],{'as':_0x5a92('0x77'),'foreignKey':_0x5a92('0x137')});db['ChatWebsite'][_0x5a92('0x106')](db[_0x5a92('0x38')],{'as':_0x5a92('0x38'),'foreignKey':_0x5a92('0x146')});db[_0x5a92('0x11c')][_0x5a92('0x106')](db[_0x5a92('0x138')],{'as':_0x5a92('0x139'),'foreignKey':_0x5a92('0x13a')});db['ChatWebsite'][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x11e')});db['OpenchannelQueueReport']['belongsTo'](db[_0x5a92('0x121')],{});db[_0x5a92('0x56')][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0x56')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x56')][_0x5a92('0x106')](db[_0x5a92('0x51')],{});db[_0x5a92('0x56')][_0x5a92('0x106')](db[_0x5a92('0x171')],{});db[_0x5a92('0x56')]['belongsTo'](db[_0x5a92('0x12')],{});db[_0x5a92('0x56')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x5a92('0x58')]['belongsTo'](db['User'],{'as':_0x5a92('0x17a'),'foreignKey':'UserId','onDelete':_0x5a92('0x159')});db[_0x5a92('0x58')][_0x5a92('0x106')](db['ChatQueue'],{'as':'Queue','foreignKey':_0x5a92('0x17b'),'onDelete':_0x5a92('0x159')});db[_0x5a92('0x58')]['belongsTo'](db['ChatWebsite'],{'as':_0x5a92('0x17c'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication'][_0x5a92('0x106')](db['Tag'],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x164')});db[_0x5a92('0x59')]['hasMany'](db[_0x5a92('0x179')],{'as':'Messages','onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x17d')});db[_0x5a92('0x59')]['belongsTo'](db[_0x5a92('0x11c')],{'as':_0x5a92('0x14f'),'foreignKey':'ChatWebsiteId'});db[_0x5a92('0x59')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x59')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'as':'Owner','foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x59')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x17e'),'as':'Tags'});db['ChatInteraction'][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':'chat_interaction_has_tags','as':_0x5a92('0x155')});db[_0x5a92('0x59')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x166'),'through':_0x5a92('0x17f'),'foreignKey':_0x5a92('0x17d')});db[_0x5a92('0x179')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'onDelete':_0x5a92('0xf7'),'as':'User'});db['ChatMessage']['belongsTo'](db[_0x5a92('0x65')],{'onDelete':_0x5a92('0xf7'),'as':_0x5a92('0x150'),'foreignKey':'ContactId'});db['ChatMessage'][_0x5a92('0x106')](db[_0x5a92('0x59')],{'onDelete':_0x5a92('0xf7'),'as':_0x5a92('0x157'),'foreignKey':'ChatInteractionId'});db[_0x5a92('0x179')][_0x5a92('0x106')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x5a92('0x179')][_0x5a92('0x106')](db[_0x5a92('0x11c')],{'as':_0x5a92('0x14f'),'foreignKey':'ChatWebsiteId'});db[_0x5a92('0x5c')][_0x5a92('0xf9')](db[_0x5a92('0xda')],{'as':'Attachments','foreignKey':_0x5a92('0x180'),'onDelete':'cascade','hooks':!![]});db[_0x5a92('0x5c')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x5a92('0x145')});db[_0x5a92('0x5c')][_0x5a92('0x106')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x5a92('0x158')});db[_0x5a92('0x5e')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x2c'),'hooks':!![]});db[_0x5a92('0x5e')][_0x5a92('0x108')](db['Team'],{'through':_0x5a92('0x181'),'as':_0x5a92('0x13d')});db[_0x5a92('0x60')]['hasMany'](db[_0x5a92('0xc0')],{'as':_0x5a92('0x141'),'foreignKey':_0x5a92('0x182'),'onDelete':'cascade'});db[_0x5a92('0x60')]['belongsToMany'](db['User'],{'as':_0x5a92('0x12e'),'through':_0x5a92('0x183')});db[_0x5a92('0x61')][_0x5a92('0x106')](db[_0x5a92('0x11c')],{'as':_0x5a92('0x17c'),'foreignKey':_0x5a92('0x158')});db[_0x5a92('0x63')][_0x5a92('0xf9')](db[_0x5a92('0x65')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x5a92('0x65')][_0x5a92('0xf9')](db['CmHopper'],{'as':_0x5a92('0x130'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x65')][_0x5a92('0xf9')](db[_0x5a92('0x6b')],{'as':_0x5a92('0xfd'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x65')][_0x5a92('0xf9')](db[_0x5a92('0x6d')],{'as':_0x5a92('0x131'),'foreignKey':_0x5a92('0x145')});db['CmContact'][_0x5a92('0xf9')](db[_0x5a92('0x6e')],{'as':_0x5a92('0x6e'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0x65')]['hasMany'](db[_0x5a92('0xc4')],{'as':_0x5a92('0x132'),'foreignKey':_0x5a92('0x145')});db['CmContact'][_0x5a92('0xf9')](db[_0x5a92('0x51')],{'as':_0x5a92('0xfe'),'foreignKey':_0x5a92('0x145'),'onDelete':_0x5a92('0x159')});db[_0x5a92('0x65')]['hasMany'](db[_0x5a92('0x59')],{'as':_0x5a92('0xff'),'foreignKey':'ContactId','onDelete':_0x5a92('0x159')});db['CmContact'][_0x5a92('0xf9')](db[_0x5a92('0x4c')],{'as':'SmsInteractions','foreignKey':_0x5a92('0x145'),'onDelete':_0x5a92('0x159')});db[_0x5a92('0x65')][_0x5a92('0xf9')](db[_0x5a92('0x100')],{'as':_0x5a92('0x101'),'foreignKey':'ContactId','onDelete':_0x5a92('0x159')});db[_0x5a92('0x65')][_0x5a92('0xf9')](db[_0x5a92('0x3b')],{'as':'MailInteractions','foreignKey':_0x5a92('0x145'),'onDelete':_0x5a92('0x159')});db[_0x5a92('0x65')][_0x5a92('0x106')](db[_0x5a92('0x63')],{'as':'Company','foreignKey':'CompanyId'});db['CmContact'][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c'),'onDelete':'cascade'});db[_0x5a92('0x65')][_0x5a92('0x108')](db['User'],{'as':_0x5a92('0x166'),'through':'cm_user_has_contacts'});db[_0x5a92('0x65')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'as':_0x5a92('0x154'),'through':'cm_contact_has_tags'});db[_0x5a92('0x65')]['belongsToMany'](db[_0x5a92('0x152')],{'through':_0x5a92('0x184'),'as':'ThroughTags'});db[_0x5a92('0x67')]['belongsTo'](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145'),'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x67')][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':'List','foreignKey':'ListId','onDelete':_0x5a92('0xf7')});db['CmHopper'][_0x5a92('0x106')](db['User'],{'as':'Agent','foreignKey':_0x5a92('0xf8')});db[_0x5a92('0x67')][_0x5a92('0x106')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x5a92('0x12f'),'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x67')][_0x5a92('0x106')](db[_0x5a92('0xd6')],{'as':_0x5a92('0xd6'),'foreignKey':_0x5a92('0x185'),'onDelete':_0x5a92('0xf7')});db['CmHopper']['belongsTo'](db[_0x5a92('0x12')],{'as':_0x5a92('0x151'),'foreignKey':_0x5a92('0x186')});db[_0x5a92('0x69')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145'),'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x69')][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c'),'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x69')][_0x5a92('0x106')](db[_0x5a92('0x1a')],{'as':_0x5a92('0x187'),'foreignKey':_0x5a92('0x12f'),'onDelete':_0x5a92('0xf7')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0x5a92('0xd6'),'foreignKey':_0x5a92('0x185'),'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x74')][_0x5a92('0xf9')](db['Condition'],{'as':{'plural':_0x5a92('0x188'),'singular':_0x5a92('0x189')},'foreignKey':_0x5a92('0x18a'),'onDelete':_0x5a92('0xf7'),'hooks':!![]});db[_0x5a92('0x74')][_0x5a92('0xf9')](db[_0x5a92('0x18b')],{'as':{'plural':_0x5a92('0x18c'),'singular':'OneAny'},'foreignKey':_0x5a92('0x18d'),'onDelete':_0x5a92('0xf7'),'hooks':!![]});db['Automation'][_0x5a92('0xf9')](db[_0x5a92('0x72')],{'as':'Actions','foreignKey':_0x5a92('0x18e'),'onDelete':_0x5a92('0xf7'),'hooks':!![]});db[_0x5a92('0x76')]['hasMany'](db[_0x5a92('0x76')],{'as':_0x5a92('0x169'),'foreignKey':_0x5a92('0x18f'),'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x77')]['hasMany'](db[_0x5a92('0x77')],{'as':'Intervals','foreignKey':_0x5a92('0x137'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x5a92('0x77')][_0x5a92('0xf9')](db[_0x5a92('0x18')],{'as':_0x5a92('0xfc'),'foreignKey':'IntervalId','onDelete':_0x5a92('0x159')});db[_0x5a92('0x77')]['hasMany'](db['MailApplication'],{'as':_0x5a92('0x190'),'foreignKey':_0x5a92('0x137')});db[_0x5a92('0x77')]['hasMany'](db['ChatApplication'],{'as':_0x5a92('0x191'),'foreignKey':_0x5a92('0x137')});db['Interval'][_0x5a92('0xf9')](db[_0x5a92('0x44')],{'as':'FaxApplications','foreignKey':_0x5a92('0x137')});db[_0x5a92('0x77')][_0x5a92('0xf9')](db[_0x5a92('0x16b')],{'as':_0x5a92('0x192'),'foreignKey':_0x5a92('0x137')});db['Schedule']['belongsTo'](db['MailAccount'],{});db['Schedule'][_0x5a92('0x106')](db[_0x5a92('0x8c')],{'foreignKey':_0x5a92('0x193')});db[_0x5a92('0x7d')][_0x5a92('0x106')](db[_0x5a92('0x8a')],{'foreignKey':'CustomReportId'});db[_0x5a92('0x7f')][_0x5a92('0x108')](db[_0x5a92('0x12c')],{'as':_0x5a92('0x194'),'through':_0x5a92('0x195'),'onDelete':_0x5a92('0x159')});db['Tag'][_0x5a92('0x108')](db[_0x5a92('0x65')],{'through':_0x5a92('0x184')});db[_0x5a92('0x152')]['belongsToMany'](db['ChatInteraction'],{'through':_0x5a92('0x17e')});db[_0x5a92('0x152')][_0x5a92('0x108')](db[_0x5a92('0x3b')],{'through':'mail_interaction_has_tags'});db[_0x5a92('0x152')][_0x5a92('0x108')](db[_0x5a92('0x4c')],{'through':_0x5a92('0x16e')});db['Tag'][_0x5a92('0x108')](db['FaxInteraction'],{'through':_0x5a92('0x165')});db[_0x5a92('0x152')][_0x5a92('0x108')](db[_0x5a92('0x51')],{'through':_0x5a92('0x175')});db[_0x5a92('0x152')][_0x5a92('0x108')](db[_0x5a92('0xee')],{'through':'whatsapp_interaction_has_tags'});db['Trigger'][_0x5a92('0xf9')](db[_0x5a92('0x18b')],{'as':{'plural':_0x5a92('0x196'),'singular':_0x5a92('0x197')},'foreignKey':_0x5a92('0x198'),'onDelete':_0x5a92('0xf7'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x5a92('0x18b')],{'as':{'plural':_0x5a92('0x199'),'singular':_0x5a92('0x19a')},'foreignKey':_0x5a92('0x19b'),'onDelete':_0x5a92('0xf7'),'hooks':!![]});db[_0x5a92('0x84')][_0x5a92('0xf9')](db[_0x5a92('0x72')],{'as':'Actions','foreignKey':_0x5a92('0x19c'),'onDelete':_0x5a92('0xf7'),'hooks':!![]});db[_0x5a92('0x8a')]['hasMany'](db[_0x5a92('0x91')],{'as':_0x5a92('0x19d'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x5a92('0xf9')](db[_0x5a92('0x91')],{'as':_0x5a92('0x19d'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x193')});db[_0x5a92('0x8f')]['hasMany'](db[_0x5a92('0x91')],{'as':'Fields','onDelete':'cascade','foreignKey':'MetricId'});db[_0x5a92('0x91')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x5a92('0x19e')});db[_0x5a92('0x94')][_0x5a92('0xf9')](db[_0x5a92('0x96')],{'as':_0x5a92('0x19f'),'onDelete':'cascade','foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0x96')][_0x5a92('0xf9')](db['SalesforceField'],{'as':_0x5a92('0x1a1'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0x96')][_0x5a92('0xf9')](db['SalesforceField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x96')][_0x5a92('0xf9')](db[_0x5a92('0x1a4')],{'as':_0x5a92('0x19d'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a5')});db['SalesforceConfiguration'][_0x5a92('0x106')](db[_0x5a92('0x94')],{'as':'Account','foreignKey':'AccountId'});db[_0x5a92('0x1a4')][_0x5a92('0xf9')](db[_0x5a92('0x1a4')],{'as':'Subject','foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0x1a4')][_0x5a92('0xf9')](db['SalesforceField'],{'as':_0x5a92('0x1a6'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x1a4')][_0x5a92('0xf9')](db[_0x5a92('0x1a4')],{'as':'Field','foreignKey':'FieldId'});db[_0x5a92('0x1a4')]['belongsTo'](db[_0x5a92('0x86')],{'as':_0x5a92('0x86'),'foreignKey':'VariableId'});db[_0x5a92('0x1a7')][_0x5a92('0xf9')](db[_0x5a92('0x1a8')],{'as':_0x5a92('0x19f'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x5a92('0x1a8')][_0x5a92('0xf9')](db[_0x5a92('0x1a9')],{'as':_0x5a92('0x1a1'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a2')});db['SugarcrmConfiguration']['hasMany'](db[_0x5a92('0x1a9')],{'as':_0x5a92('0x1aa'),'onDelete':_0x5a92('0xf7'),'foreignKey':'DescriptionId'});db[_0x5a92('0x1a8')][_0x5a92('0xf9')](db[_0x5a92('0x1a9')],{'as':_0x5a92('0x19d'),'onDelete':'cascade','foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0x1a8')][_0x5a92('0x106')](db[_0x5a92('0x1a7')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0x1a9')][_0x5a92('0xf9')](db['SugarcrmField'],{'as':_0x5a92('0x1ab'),'foreignKey':'SubjectId'});db[_0x5a92('0x1a9')][_0x5a92('0xf9')](db['SugarcrmField'],{'as':_0x5a92('0x1a6'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x1a9')][_0x5a92('0xf9')](db['SugarcrmField'],{'as':'Field','foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0x1a9')]['belongsTo'](db[_0x5a92('0x86')],{'as':_0x5a92('0x86'),'foreignKey':_0x5a92('0x1ac')});db[_0x5a92('0x9b')][_0x5a92('0xf9')](db['DeskConfiguration'],{'as':_0x5a92('0x19f'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0x9d')][_0x5a92('0xf9')](db[_0x5a92('0x9f')],{'as':'Subjects','onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0x9d')]['hasMany'](db[_0x5a92('0x9f')],{'as':_0x5a92('0x1aa'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x9d')]['hasMany'](db[_0x5a92('0x9f')],{'as':'Fields','onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0x9d')]['belongsTo'](db[_0x5a92('0x9b')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1a0')});db['DeskConfiguration'][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x1ad')});db['DeskField']['hasMany'](db[_0x5a92('0x9f')],{'as':'Subject','foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0x9f')][_0x5a92('0xf9')](db[_0x5a92('0x9f')],{'as':_0x5a92('0x1a6'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x9f')][_0x5a92('0xf9')](db[_0x5a92('0x9f')],{'as':_0x5a92('0x1ae'),'foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0x9f')][_0x5a92('0x106')](db[_0x5a92('0x86')],{'as':_0x5a92('0x86'),'foreignKey':_0x5a92('0x1ac')});db[_0x5a92('0xa1')][_0x5a92('0xf9')](db['ZohoConfiguration'],{'as':_0x5a92('0x19f'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a0')});db['ZohoConfiguration'][_0x5a92('0xf9')](db[_0x5a92('0xa3')],{'as':_0x5a92('0x1a1'),'onDelete':'cascade','foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0xa2')][_0x5a92('0xf9')](db[_0x5a92('0xa3')],{'as':_0x5a92('0x1aa'),'onDelete':'cascade','foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0xa2')][_0x5a92('0xf9')](db['ZohoField'],{'as':_0x5a92('0x19d'),'onDelete':_0x5a92('0xf7'),'foreignKey':'FieldId'});db[_0x5a92('0xa2')][_0x5a92('0x106')](db['ZohoAccount'],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0xa3')][_0x5a92('0xf9')](db[_0x5a92('0xa3')],{'as':'Subject','foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0xa3')]['hasMany'](db[_0x5a92('0xa3')],{'as':_0x5a92('0x1a6'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0xa3')]['hasMany'](db[_0x5a92('0xa3')],{'as':_0x5a92('0x1ae'),'foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0xa3')][_0x5a92('0x106')](db[_0x5a92('0x86')],{'as':'Variable','foreignKey':'VariableId'});db[_0x5a92('0xa5')]['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0x1af')][_0x5a92('0xf9')](db[_0x5a92('0xa6')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x5a92('0x1af')][_0x5a92('0xf9')](db[_0x5a92('0xa6')],{'as':_0x5a92('0x1aa'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x1af')][_0x5a92('0xf9')](db[_0x5a92('0xa6')],{'as':'Fields','foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0x1af')]['belongsTo'](db[_0x5a92('0xa5')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1a0')});db['ZendeskConfiguration'][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x1b0')});db[_0x5a92('0xa6')]['hasMany'](db[_0x5a92('0xa6')],{'as':_0x5a92('0x1ab'),'foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0xa6')][_0x5a92('0xf9')](db[_0x5a92('0xa6')],{'as':_0x5a92('0x1a6'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0xa6')]['hasMany'](db[_0x5a92('0xa6')],{'as':_0x5a92('0x1ae'),'foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0xa6')][_0x5a92('0x106')](db[_0x5a92('0x86')],{'as':_0x5a92('0x86'),'foreignKey':_0x5a92('0x1ac')});db['FreshdeskAccount'][_0x5a92('0xf9')](db[_0x5a92('0xaa')],{'as':_0x5a92('0x19f'),'onDelete':'cascade','foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0xaa')][_0x5a92('0xf9')](db[_0x5a92('0x1b1')],{'as':_0x5a92('0x1a1'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a2')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0x5a92('0x1aa'),'onDelete':'cascade','foreignKey':_0x5a92('0x1a3')});db['FreshdeskConfiguration'][_0x5a92('0xf9')](db['FreshdeskField'],{'as':'Fields','onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a5')});db['FreshdeskConfiguration'][_0x5a92('0x106')](db[_0x5a92('0xa8')],{'as':'Account','foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0xaa')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x1b2')});db[_0x5a92('0x1b1')]['hasMany'](db['FreshdeskField'],{'as':_0x5a92('0x1ab'),'foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0x1b1')][_0x5a92('0xf9')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x1b1')][_0x5a92('0xf9')](db[_0x5a92('0x1b1')],{'as':_0x5a92('0x1ae'),'foreignKey':_0x5a92('0x1a5')});db['FreshdeskField']['belongsTo'](db[_0x5a92('0x86')],{'as':_0x5a92('0x86'),'foreignKey':_0x5a92('0x1ac')});db[_0x5a92('0xad')]['hasMany'](db[_0x5a92('0xaf')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['VtigerConfiguration']['hasMany'](db[_0x5a92('0x1b3')],{'as':_0x5a92('0x1a1'),'foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0xaf')][_0x5a92('0xf9')](db[_0x5a92('0x1b3')],{'as':_0x5a92('0x1aa'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0xaf')][_0x5a92('0xf9')](db[_0x5a92('0x1b3')],{'as':'Fields','foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0xaf')]['belongsTo'](db[_0x5a92('0xad')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0x1b3')]['hasMany'](db[_0x5a92('0x1b3')],{'as':_0x5a92('0x1ab'),'foreignKey':'SubjectId'});db[_0x5a92('0x1b3')][_0x5a92('0xf9')](db[_0x5a92('0x1b3')],{'as':_0x5a92('0x1a6'),'foreignKey':'DescriptionId'});db[_0x5a92('0x1b3')][_0x5a92('0xf9')](db['VtigerField'],{'as':_0x5a92('0x1ae'),'foreignKey':'FieldId'});db[_0x5a92('0x1b3')][_0x5a92('0x106')](db[_0x5a92('0x86')],{'as':_0x5a92('0x86'),'foreignKey':_0x5a92('0x1ac')});db[_0x5a92('0xb1')][_0x5a92('0xf9')](db[_0x5a92('0x1b4')],{'as':_0x5a92('0x19f'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x5a92('0x1b4')]['hasMany'](db[_0x5a92('0xb3')],{'as':_0x5a92('0x1a1'),'foreignKey':_0x5a92('0x1a2')});db['ServicenowConfiguration'][_0x5a92('0xf9')](db[_0x5a92('0xb3')],{'as':_0x5a92('0x1aa'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x1b4')][_0x5a92('0xf9')](db[_0x5a92('0xb3')],{'as':_0x5a92('0x19d'),'foreignKey':'FieldId'});db[_0x5a92('0x1b4')][_0x5a92('0x106')](db[_0x5a92('0xb1')],{'as':'Account','foreignKey':'AccountId'});db[_0x5a92('0xb3')][_0x5a92('0xf9')](db[_0x5a92('0xb3')],{'as':_0x5a92('0x1ab'),'foreignKey':'SubjectId'});db[_0x5a92('0xb3')][_0x5a92('0xf9')](db[_0x5a92('0xb3')],{'as':_0x5a92('0x1a6'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0xb3')][_0x5a92('0xf9')](db['ServicenowField'],{'as':_0x5a92('0x1ae'),'foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0xb3')]['belongsTo'](db['Variable'],{'as':_0x5a92('0x86'),'foreignKey':_0x5a92('0x1ac')});db['Dynamics365Account'][_0x5a92('0xf9')](db['Dynamics365Configuration'],{'as':_0x5a92('0x19f'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0x1b5')][_0x5a92('0xf9')](db[_0x5a92('0xb5')],{'as':_0x5a92('0x1a1'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0x1b5')][_0x5a92('0xf9')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x5a92('0xf7'),'foreignKey':'DescriptionId'});db[_0x5a92('0x1b5')]['hasMany'](db[_0x5a92('0xb5')],{'as':_0x5a92('0x19d'),'onDelete':'cascade','foreignKey':_0x5a92('0x1a5')});db[_0x5a92('0x1b5')][_0x5a92('0x106')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0xb5')]['hasMany'](db[_0x5a92('0xb5')],{'as':_0x5a92('0x1ab'),'foreignKey':_0x5a92('0x1a2')});db['Dynamics365Field'][_0x5a92('0xf9')](db['Dynamics365Field'],{'as':_0x5a92('0x1a6'),'foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0xb5')][_0x5a92('0xf9')](db[_0x5a92('0xb5')],{'as':'Field','foreignKey':'FieldId'});db[_0x5a92('0xb5')]['belongsTo'](db[_0x5a92('0x86')],{'as':'Variable','foreignKey':'VariableId'});db[_0x5a92('0x1b6')]['hasMany'](db[_0x5a92('0x1b7')],{'as':_0x5a92('0x19f'),'onDelete':_0x5a92('0xf7'),'foreignKey':'AccountId'});db[_0x5a92('0x1b7')][_0x5a92('0xf9')](db[_0x5a92('0xb9')],{'as':'Subjects','foreignKey':_0x5a92('0x1a2')});db['FreshsalesConfiguration']['hasMany'](db[_0x5a92('0xb9')],{'as':'Descriptions','foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0x1b7')][_0x5a92('0xf9')](db['FreshsalesField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x5a92('0x1b7')][_0x5a92('0x106')](db[_0x5a92('0x1b6')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1a0')});db[_0x5a92('0xb9')][_0x5a92('0xf9')](db['FreshsalesField'],{'as':_0x5a92('0x1ab'),'foreignKey':_0x5a92('0x1a2')});db[_0x5a92('0xb9')][_0x5a92('0xf9')](db['FreshsalesField'],{'as':'Description','foreignKey':_0x5a92('0x1a3')});db[_0x5a92('0xb9')]['hasMany'](db[_0x5a92('0xb9')],{'as':'Field','foreignKey':_0x5a92('0x1a5')});db['FreshsalesField']['belongsTo'](db['Variable'],{'as':_0x5a92('0x86'),'foreignKey':_0x5a92('0x1ac')});db[_0x5a92('0xbe')][_0x5a92('0x106')](db[_0x5a92('0x11c')],{});db['ChatQueueReport'][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':_0x5a92('0x15b'),'foreignKey':'ListId'});db['ChatQueueReport'][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':'Contact','foreignKey':'ContactId'});db['ChatQueueReport'][_0x5a92('0x106')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x5a92('0x106')](db[_0x5a92('0x179')],{});db[_0x5a92('0xbe')]['belongsTo'](db[_0x5a92('0x12')],{});db[_0x5a92('0xbe')][_0x5a92('0x106')](db[_0x5a92('0x5e')],{});db[_0x5a92('0xc0')][_0x5a92('0x106')](db['User'],{'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1b8')});db[_0x5a92('0xc0')][_0x5a92('0x106')](db['User'],{'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1b9')});db[_0x5a92('0xc4')]['hasMany'](db[_0x5a92('0xc3')],{'foreignKey':'SessionId','onDelete':_0x5a92('0xf7')});db[_0x5a92('0xc4')][_0x5a92('0xf9')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x5a92('0xc6')][_0x5a92('0x106')](db[_0x5a92('0x49')],{});db[_0x5a92('0xc6')]['belongsTo'](db['CmList'],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db['SmsQueueReport'][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':'ContactId'});db[_0x5a92('0xc6')][_0x5a92('0x106')](db[_0x5a92('0x4c')],{});db[_0x5a92('0xc6')][_0x5a92('0x106')](db[_0x5a92('0x16c')],{});db[_0x5a92('0xc6')]['belongsTo'](db[_0x5a92('0x12')],{});db['SmsQueueReport'][_0x5a92('0x106')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db[_0x5a92('0xc4')],{'foreignKey':_0x5a92('0x1ba')});db[_0x5a92('0xcb')][_0x5a92('0xf9')](db[_0x5a92('0xc3')],{'foreignKey':_0x5a92('0x1ba')});db['JscriptyProject'][_0x5a92('0xf9')](db[_0x5a92('0x1bb')],{'foreignKey':_0x5a92('0x1ba')});db[_0x5a92('0xcf')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x166'),'through':_0x5a92('0x129')});db['Team'][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x10f')});db[_0x5a92('0x10e')]['belongsToMany'](db[_0x5a92('0x1a')],{'through':_0x5a92('0xf4'),'as':'VoiceQueues'});db[_0x5a92('0x10e')][_0x5a92('0x108')](db[_0x5a92('0x114')],{'through':_0x5a92('0x14d'),'as':_0x5a92('0x115')});db[_0x5a92('0x10e')][_0x5a92('0x108')](db['ChatQueue'],{'through':_0x5a92('0x181'),'as':_0x5a92('0x1bc')});db['Team'][_0x5a92('0x108')](db['FaxQueue'],{'through':_0x5a92('0x168'),'as':'FaxQueues'});db[_0x5a92('0x10e')][_0x5a92('0x108')](db[_0x5a92('0x118')],{'through':_0x5a92('0x16f'),'as':'SmsQueues'});db['Team'][_0x5a92('0x108')](db[_0x5a92('0x53')],{'through':_0x5a92('0x177'),'as':_0x5a92('0x119')});db[_0x5a92('0x10e')][_0x5a92('0x108')](db[_0x5a92('0xf2')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x5a92('0xd6')]['hasMany'](db[_0x5a92('0x67')],{'as':_0x5a92('0x130'),'foreignKey':'CampaignId'});db[_0x5a92('0xd6')][_0x5a92('0xf9')](db['CmHopperFinal'],{'as':_0x5a92('0xfd'),'foreignKey':'CampaignId'});db[_0x5a92('0xd6')][_0x5a92('0xf9')](db['CmHopperHistory'],{'as':_0x5a92('0x131'),'foreignKey':_0x5a92('0x185')});db['Campaign'][_0x5a92('0xf9')](db[_0x5a92('0x69')],{'as':'HopperBlacks','foreignKey':_0x5a92('0x185')});db[_0x5a92('0xd6')][_0x5a92('0x106')](db[_0x5a92('0x133')],{'as':_0x5a92('0x133'),'foreignKey':'TrunkId'});db[_0x5a92('0xd6')][_0x5a92('0x106')](db['Trunk'],{'as':_0x5a92('0x135'),'foreignKey':_0x5a92('0x136')});db[_0x5a92('0xd6')][_0x5a92('0x106')](db[_0x5a92('0x77')],{'as':_0x5a92('0x77'),'foreignKey':'IntervalId'});db[_0x5a92('0xd6')][_0x5a92('0x106')](db[_0x5a92('0xcf')],{'as':_0x5a92('0xcf'),'foreignKey':_0x5a92('0x1bd')});db[_0x5a92('0xd6')]['belongsToMany'](db[_0x5a92('0xe2')],{'as':'Lists','through':_0x5a92('0x1be')});db[_0x5a92('0xd6')][_0x5a92('0x108')](db['CmList'],{'as':'BlackLists','through':_0x5a92('0x1bf')});db[_0x5a92('0xda')][_0x5a92('0x106')](db['ChatOfflineMessage'],{'as':_0x5a92('0x5c'),'foreignKey':_0x5a92('0x180')});db[_0x5a92('0xdc')][_0x5a92('0x106')](db[_0x5a92('0x3d')],{});db[_0x5a92('0xdc')]['belongsTo'](db[_0x5a92('0x3b')],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0x5a92('0x1c0'),'as':_0x5a92('0x1c1')});db[_0x5a92('0xdc')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c2'),'as':_0x5a92('0x1c3')});db[_0x5a92('0xdc')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c4'),'as':'ToAgent'});db[_0x5a92('0xdc')]['belongsTo'](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x5a92('0x1c5')});db['MailTransferReport'][_0x5a92('0x106')](db[_0x5a92('0x38')],{'foreignKey':_0x5a92('0x1c6'),'as':_0x5a92('0x1c7')});db['ChatTransferReport'][_0x5a92('0x106')](db['ChatMessage'],{});db[_0x5a92('0x1c8')][_0x5a92('0x106')](db['ChatInteraction'],{});db[_0x5a92('0x1c8')][_0x5a92('0x106')](db[_0x5a92('0x11c')],{'foreignKey':_0x5a92('0x1c9'),'as':_0x5a92('0x1c1')});db[_0x5a92('0x1c8')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'foreignKey':'FromUserId','as':_0x5a92('0x1c3')});db[_0x5a92('0x1c8')][_0x5a92('0x106')](db['User'],{'foreignKey':'ToUserId','as':_0x5a92('0x1ca')});db[_0x5a92('0x1c8')][_0x5a92('0x106')](db[_0x5a92('0x5e')],{'foreignKey':_0x5a92('0x1cb'),'as':_0x5a92('0x1c5')});db[_0x5a92('0x1c8')]['belongsTo'](db[_0x5a92('0x11c')],{'foreignKey':_0x5a92('0x1cc'),'as':'ToAccount'});db[_0x5a92('0x1cd')][_0x5a92('0x106')](db[_0x5a92('0x46')],{});db[_0x5a92('0x1cd')]['belongsTo'](db['FaxInteraction'],{});db[_0x5a92('0x1cd')][_0x5a92('0x106')](db[_0x5a92('0x42')],{'foreignKey':'FromFaxAccountId','as':_0x5a92('0x1c1')});db[_0x5a92('0x1cd')]['belongsTo'](db['User'],{'foreignKey':_0x5a92('0x1c2'),'as':_0x5a92('0x1c3')});db[_0x5a92('0x1cd')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c4'),'as':_0x5a92('0x1ca')});db[_0x5a92('0x1cd')][_0x5a92('0x106')](db[_0x5a92('0x116')],{'foreignKey':_0x5a92('0x1ce'),'as':'ToQueue'});db['FaxTransferReport'][_0x5a92('0x106')](db['FaxAccount'],{'foreignKey':_0x5a92('0x1cf'),'as':_0x5a92('0x1c7')});db[_0x5a92('0xdf')][_0x5a92('0x106')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x5a92('0xdf')]['belongsTo'](db[_0x5a92('0x121')],{'foreignKey':_0x5a92('0x1d0'),'as':_0x5a92('0x1c1')});db[_0x5a92('0xdf')]['belongsTo'](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c2'),'as':_0x5a92('0x1c3')});db[_0x5a92('0xdf')]['belongsTo'](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c4'),'as':_0x5a92('0x1ca')});db[_0x5a92('0xdf')]['belongsTo'](db[_0x5a92('0x53')],{'foreignKey':_0x5a92('0x1d1'),'as':_0x5a92('0x1c5')});db['OpenchannelTransferReport'][_0x5a92('0x106')](db[_0x5a92('0x121')],{'foreignKey':_0x5a92('0x1d2'),'as':_0x5a92('0x1c7')});db[_0x5a92('0xe0')]['belongsTo'](db['SmsMessage'],{});db['SmsTransferReport']['belongsTo'](db['SmsInteraction'],{});db['SmsTransferReport'][_0x5a92('0x106')](db[_0x5a92('0x49')],{'foreignKey':_0x5a92('0x1d3'),'as':_0x5a92('0x1c1')});db['SmsTransferReport'][_0x5a92('0x106')](db['User'],{'foreignKey':_0x5a92('0x1c2'),'as':_0x5a92('0x1c3')});db[_0x5a92('0xe0')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c4'),'as':'ToAgent'});db[_0x5a92('0xe0')]['belongsTo'](db[_0x5a92('0x118')],{'foreignKey':_0x5a92('0x1d4'),'as':_0x5a92('0x1c5')});db['SmsTransferReport'][_0x5a92('0x106')](db[_0x5a92('0x49')],{'foreignKey':_0x5a92('0x1d5'),'as':_0x5a92('0x1c7')});db[_0x5a92('0xe2')][_0x5a92('0xf9')](db[_0x5a92('0x76')],{'as':_0x5a92('0x169'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0xe2')][_0x5a92('0xf9')](db[_0x5a92('0x70')],{'as':'CustomFields','foreignKey':_0x5a92('0x15c')});db[_0x5a92('0xe2')][_0x5a92('0xf9')](db[_0x5a92('0x65')],{'as':_0x5a92('0x10a'),'onDelete':'cascade','foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x5a92('0x6b')],{'as':'HopperFinals','foreignKey':_0x5a92('0x15c')});db['CmList'][_0x5a92('0xf9')](db['CmHopperHistory'],{'as':_0x5a92('0x1d6'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0xe2')]['hasMany'](db[_0x5a92('0x6e')],{'as':_0x5a92('0x6e'),'foreignKey':'ListId'});db[_0x5a92('0xe2')]['belongsToMany'](db[_0x5a92('0x1a')],{'as':_0x5a92('0x1d7'),'through':_0x5a92('0x13b')});db[_0x5a92('0xe2')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x10d')});db['VoicePrefix'][_0x5a92('0xf9')](db['VoiceExtension'],{'as':_0x5a92('0xfc'),'onDelete':'cascade'});db[_0x5a92('0x1d8')][_0x5a92('0x108')](db['User'],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x11b')});db[_0x5a92('0xe5')][_0x5a92('0xf9')](db[_0x5a92('0x12')],{'as':_0x5a92('0x166'),'foreignKey':_0x5a92('0x107')});db['UserProfile']['hasMany'](db[_0x5a92('0xe7')],{'as':_0x5a92('0x1d9'),'foreignKey':'userProfileId','onDelete':_0x5a92('0xf7')});db[_0x5a92('0xe7')][_0x5a92('0xf9')](db['UserProfileResource'],{'as':_0x5a92('0x1da'),'foreignKey':_0x5a92('0x1db'),'onDelete':_0x5a92('0xf7')});db[_0x5a92('0x125')]['hasMany'](db[_0x5a92('0x76')],{'as':'Dispositions','foreignKey':_0x5a92('0x1dc')});db[_0x5a92('0x125')][_0x5a92('0xf9')](db[_0x5a92('0x148')],{'as':_0x5a92('0x149'),'foreignKey':_0x5a92('0x1dc')});db[_0x5a92('0x125')][_0x5a92('0xf9')](db[_0x5a92('0xef')],{'as':_0x5a92('0x141'),'foreignKey':_0x5a92('0x1dc')});db[_0x5a92('0x125')][_0x5a92('0xf9')](db[_0x5a92('0xee')],{'as':_0x5a92('0x160')});db['WhatsappAccount'][_0x5a92('0xf9')](db[_0x5a92('0xed')],{'as':'Applications'});db['WhatsappAccount'][_0x5a92('0x106')](db['CmList'],{'as':_0x5a92('0x15b'),'foreignKey':_0x5a92('0x15c')});db[_0x5a92('0x125')][_0x5a92('0x106')](db[_0x5a92('0x138')],{'as':_0x5a92('0x139'),'foreignKey':_0x5a92('0x13a')});db[_0x5a92('0x125')][_0x5a92('0x108')](db['User'],{'as':_0x5a92('0x13c'),'through':_0x5a92('0x127')});db['WhatsappApplication']['belongsTo'](db['User'],{'onDelete':_0x5a92('0x159')});db['WhatsappApplication'][_0x5a92('0x106')](db[_0x5a92('0xf2')],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0xed')]['belongsTo'](db[_0x5a92('0x125')],{'onDelete':_0x5a92('0x159')});db[_0x5a92('0xed')][_0x5a92('0x106')](db[_0x5a92('0x77')],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x137')});db['WhatsappApplication'][_0x5a92('0x106')](db[_0x5a92('0x152')],{'onDelete':_0x5a92('0x159'),'foreignKey':_0x5a92('0x164')});db['WhatsappInteraction'][_0x5a92('0xf9')](db[_0x5a92('0xef')],{'as':_0x5a92('0x141'),'onDelete':_0x5a92('0xf7'),'foreignKey':_0x5a92('0x1dd')});db[_0x5a92('0xee')][_0x5a92('0x106')](db['WhatsappAccount'],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1dc')});db['WhatsappInteraction'][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db[_0x5a92('0xee')][_0x5a92('0x106')](db['User'],{'as':_0x5a92('0x151'),'foreignKey':_0x5a92('0xf8')});db[_0x5a92('0xee')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x1de'),'as':'Tags'});db[_0x5a92('0xee')][_0x5a92('0x108')](db[_0x5a92('0x152')],{'through':_0x5a92('0x1de'),'as':'ThroughTags'});db[_0x5a92('0xee')][_0x5a92('0x108')](db[_0x5a92('0x12')],{'as':_0x5a92('0x166'),'through':'user_has_whatsapp_interactions','foreignKey':_0x5a92('0x1dd')});db['WhatsappMessage'][_0x5a92('0x106')](db['User'],{'as':_0x5a92('0x12')});db['WhatsappMessage'][_0x5a92('0x106')](db[_0x5a92('0x65')],{'onDelete':_0x5a92('0xf7'),'as':_0x5a92('0x150')});db['WhatsappMessage']['belongsTo'](db[_0x5a92('0xee')],{'onDelete':'cascade','as':_0x5a92('0x157'),'foreignKey':_0x5a92('0x1dd')});db[_0x5a92('0xef')][_0x5a92('0x106')](db[_0x5a92('0x125')],{'as':_0x5a92('0x14f'),'foreignKey':_0x5a92('0x1dc')});db[_0x5a92('0x1df')]['belongsTo'](db[_0x5a92('0x125')],{});db['WhatsappQueueReport'][_0x5a92('0x106')](db[_0x5a92('0xe2')],{'as':'List','foreignKey':_0x5a92('0x15c')});db[_0x5a92('0x1df')][_0x5a92('0x106')](db[_0x5a92('0x65')],{'as':_0x5a92('0x150'),'foreignKey':_0x5a92('0x145')});db['WhatsappQueueReport'][_0x5a92('0x106')](db[_0x5a92('0xee')],{});db[_0x5a92('0x1df')][_0x5a92('0x106')](db[_0x5a92('0xf2')],{});db[_0x5a92('0x1df')][_0x5a92('0x106')](db[_0x5a92('0xef')],{});db[_0x5a92('0x1df')][_0x5a92('0x106')](db[_0x5a92('0x12')],{});db[_0x5a92('0xf1')]['belongsTo'](db[_0x5a92('0xef')],{});db['WhatsappTransferReport'][_0x5a92('0x106')](db['WhatsappInteraction'],{});db[_0x5a92('0xf1')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x5a92('0x1e0'),'as':_0x5a92('0x1c1')});db['WhatsappTransferReport'][_0x5a92('0x106')](db[_0x5a92('0x125')],{'foreignKey':_0x5a92('0x1e1'),'as':_0x5a92('0x1c7')});db[_0x5a92('0xf1')][_0x5a92('0x106')](db[_0x5a92('0xf2')],{'foreignKey':_0x5a92('0x1e2'),'as':_0x5a92('0x1c5')});db[_0x5a92('0xf1')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c2'),'as':_0x5a92('0x1c3')});db[_0x5a92('0xf1')][_0x5a92('0x106')](db[_0x5a92('0x12')],{'foreignKey':_0x5a92('0x1c4'),'as':_0x5a92('0x1ca')});db[_0x5a92('0xf2')][_0x5a92('0x108')](db['User'],{'as':_0x5a92('0x13c'),'through':'UserWhatsappQueue','foreignKey':_0x5a92('0x1e3')});db[_0x5a92('0xf2')][_0x5a92('0x108')](db[_0x5a92('0x10e')],{'through':_0x5a92('0x1e4'),'as':_0x5a92('0x13d')});module[_0x5a92('0x1e5')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index ae4f042..a9b2725 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a7=['/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperFinal','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/trigger','/api/variables','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','/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/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','secret','registry','oldPassword','isArray','length','@@{','replace','}@@','includes','path','./errors','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','connection','remoteAddress','url','responseTime','user','role','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','x-forwarded-for','name','other','agent_name','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold'];(function(_0x5a7de2,_0x2c0c67){var _0x4c5a8e=function(_0x123d79){while(--_0x123d79){_0x5a7de2['push'](_0x5a7de2['shift']());}};_0x4c5a8e(++_0x2c0c67);}(_0xb9a7,0x112));var _0x7b9a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb9a7[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var path=require(_0x7b9a('0x0'));var express=require('express');var ewinston=require('express-winston');var util=require('util');var errors=require(_0x7b9a('0x1'));var config=require('./config/environment');var logger=require(_0x7b9a('0x2'))(_0x7b9a('0x3'));var authLogger=require(_0x7b9a('0x2'))(_0x7b9a('0x4'));exports[_0x7b9a('0x5')]=function(_0xf6dae2){_0xf6dae2[_0x7b9a('0x6')](ewinston[_0x7b9a('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x37ce81,_0x3e51f0){var _0x4d3f20=_0x7b9a('0x8');if(!_[_0x7b9a('0x9')](_0x37ce81['body'])){_0x4d3f20+='\x20body=%s';var _0x47e220=_0x37ce81[_0x7b9a('0xa')];maskSensitiveData(_0x47e220);}return util[_0x7b9a('0xb')](_0x4d3f20,_0x37ce81['method'],_0x37ce81[_0x7b9a('0xc')]['x-forwarded-for']?_0x37ce81[_0x7b9a('0xc')]['x-forwarded-for']:_0x37ce81[_0x7b9a('0xd')][_0x7b9a('0xe')]||_0x37ce81['ip'],_0x37ce81[_0x7b9a('0xf')],_0x3e51f0['statusCode'],_0x3e51f0[_0x7b9a('0x10')],_0x37ce81[_0x7b9a('0x11')]?_0x37ce81['user']['id']:null,_0x37ce81[_0x7b9a('0x11')]?_0x37ce81[_0x7b9a('0x11')]['name']:null,_0x37ce81[_0x7b9a('0x11')]?_0x37ce81[_0x7b9a('0x11')][_0x7b9a('0x12')]:null,_0x47e220?util[_0x7b9a('0x13')](_0x47e220,![],null):'');}}));_0xf6dae2[_0x7b9a('0x6')](ewinston[_0x7b9a('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x22a7e4,_0x35e602){var _0x2f1899='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x14')]&&_0x22a7e4[_0x7b9a('0xa')][_0x7b9a('0x15')]){_0x2f1899=_0x7b9a('0x16');}return util[_0x7b9a('0xb')](_0x2f1899,_0x22a7e4[_0x7b9a('0x17')],_0x22a7e4[_0x7b9a('0xc')][_0x7b9a('0x18')]?_0x22a7e4[_0x7b9a('0xc')][_0x7b9a('0x18')]:_0x22a7e4[_0x7b9a('0xd')][_0x7b9a('0xe')]||_0x22a7e4['ip'],_0x22a7e4[_0x7b9a('0xf')],_0x35e602['statusCode'],_0x35e602[_0x7b9a('0x10')],_0x22a7e4['user']?_0x22a7e4[_0x7b9a('0x11')]['id']:null,_0x22a7e4['user']?_0x22a7e4[_0x7b9a('0x11')][_0x7b9a('0x19')]:null,_0x22a7e4[_0x7b9a('0x11')]?_0x22a7e4['user'][_0x7b9a('0x12')]:null,_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x14')]?_0x22a7e4[_0x7b9a('0xa')][_0x7b9a('0x14')]:_0x7b9a('0x1a'),_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x15')]?_0x22a7e4[_0x7b9a('0xa')]['agent_id']:'',_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x1b')]?_0x22a7e4[_0x7b9a('0xa')]['agent_name']:'');},'ignoreRoute':function(_0x55d01c){var _0x24d886=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x24d886['test'](_0x55d01c['url']);}}));_0xf6dae2[_0x7b9a('0x6')]('/api/users',require('./api/user'));_0xf6dae2[_0x7b9a('0x6')]('/api/voice/chanspy',require(_0x7b9a('0x1c')));_0xf6dae2[_0x7b9a('0x6')]('/api/voice/contexts',require(_0x7b9a('0x1d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x1e'),require('./api/voiceExtension'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x1f'),require(_0x7b9a('0x20')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x21'),require(_0x7b9a('0x22')));_0xf6dae2['use']('/api/voice/recordings',require(_0x7b9a('0x23')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x24'),require('./api/screenRecording'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x25'),require('./api/voiceMail'));_0xf6dae2['use'](_0x7b9a('0x26'),require(_0x7b9a('0x27')));_0xf6dae2['use'](_0x7b9a('0x28'),require(_0x7b9a('0x29')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x2a'),require(_0x7b9a('0x2b')));_0xf6dae2['use'](_0x7b9a('0x2c'),require(_0x7b9a('0x2d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x2e'),require(_0x7b9a('0x2f')));_0xf6dae2[_0x7b9a('0x6')]('/api/members/reports',require('./api/memberReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x30'),require('./api/trunk'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x31'),require(_0x7b9a('0x32')));_0xf6dae2['use'](_0x7b9a('0x33'),require(_0x7b9a('0x34')));_0xf6dae2['use']('/api/mail/accounts',require(_0x7b9a('0x35')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x36'),require(_0x7b9a('0x37')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x38'),require(_0x7b9a('0x39')));_0xf6dae2[_0x7b9a('0x6')]('/api/mail/interactions',require(_0x7b9a('0x3a')));_0xf6dae2['use'](_0x7b9a('0x3b'),require(_0x7b9a('0x3c')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x3d'),require(_0x7b9a('0x3e')));_0xf6dae2[_0x7b9a('0x6')]('/api/mail/reports/queue',require(_0x7b9a('0x3f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x40'),require(_0x7b9a('0x41')));_0xf6dae2['use'](_0x7b9a('0x42'),require(_0x7b9a('0x43')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x44'),require('./api/faxAccount'));_0xf6dae2[_0x7b9a('0x6')]('/api/fax/applications',require(_0x7b9a('0x45')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x46'),require(_0x7b9a('0x47')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x48'),require('./api/faxMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x49'),require(_0x7b9a('0x4a')));_0xf6dae2['use']('/api/fax/reports/queue',require(_0x7b9a('0x4b')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x4c'),require(_0x7b9a('0x4d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x4e'),require('./api/smsApplication'));_0xf6dae2['use']('/api/sms/interactions',require(_0x7b9a('0x4f')));_0xf6dae2[_0x7b9a('0x6')]('/api/sms/messages',require(_0x7b9a('0x50')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x51'),require('./api/smsQueue'));_0xf6dae2[_0x7b9a('0x6')]('/api/openchannel/accounts',require(_0x7b9a('0x52')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x53'),require(_0x7b9a('0x54')));_0xf6dae2[_0x7b9a('0x6')]('/api/openchannel/interactions',require(_0x7b9a('0x55')));_0xf6dae2['use'](_0x7b9a('0x56'),require('./api/openchannelMessage'));_0xf6dae2['use'](_0x7b9a('0x57'),require(_0x7b9a('0x58')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x59'),require(_0x7b9a('0x5a')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x5b'),require(_0x7b9a('0x5c')));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/applications',require(_0x7b9a('0x5d')));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/interactions',require('./api/chatInteraction'));_0xf6dae2['use'](_0x7b9a('0x5e'),require(_0x7b9a('0x5f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x60'),require('./api/chatOfflineMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x61'),require(_0x7b9a('0x62')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x63'),require('./api/chatGroup'));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/proactive_actions',require(_0x7b9a('0x64')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x65'),require(_0x7b9a('0x66')));_0xf6dae2['use'](_0x7b9a('0x67'),require(_0x7b9a('0x68')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x69'),require(_0x7b9a('0x6a')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x6b'),require('./api/cmHopperBlack'));_0xf6dae2['use']('/api/cm/hopper_final',require(_0x7b9a('0x6c')));_0xf6dae2[_0x7b9a('0x6')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0xf6dae2['use']('/api/cm/custom_fields',require(_0x7b9a('0x6d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x6e'),require(_0x7b9a('0x6f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x70'),require(_0x7b9a('0x71')));_0xf6dae2[_0x7b9a('0x6')]('/api/canned_answers',require(_0x7b9a('0x72')));_0xf6dae2['use'](_0x7b9a('0x73'),require(_0x7b9a('0x74')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x75'),require(_0x7b9a('0x76')));_0xf6dae2['use'](_0x7b9a('0x77'),require('./api/interval'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x78'),require(_0x7b9a('0x79')));_0xf6dae2['use']('/api/cdr',require('./api/cdr'));_0xf6dae2['use'](_0x7b9a('0x7a'),require(_0x7b9a('0x7b')));_0xf6dae2[_0x7b9a('0x6')]('/api/schedules',require(_0x7b9a('0x7c')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x7d'),require(_0x7b9a('0x7e')));_0xf6dae2[_0x7b9a('0x6')]('/api/tags',require(_0x7b9a('0x7f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x80'),require('./api/template'));_0xf6dae2['use']('/api/triggers',require(_0x7b9a('0x81')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x82'),require('./api/variable'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x83'),require('./api/integration'));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/reports',require(_0x7b9a('0x84')));_0xf6dae2['use'](_0x7b9a('0x85'),require(_0x7b9a('0x86')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x87'),require('./api/analyticDefaultReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x88'),require(_0x7b9a('0x89')));_0xf6dae2[_0x7b9a('0x6')]('/api/analytics/metrics',require(_0x7b9a('0x8a')));_0xf6dae2['use'](_0x7b9a('0x8b'),require('./api/analyticFieldReport'));_0xf6dae2[_0x7b9a('0x6')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0xf6dae2['use']('/api/integrations/salesforce/accounts',require(_0x7b9a('0x8c')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x8d'),require(_0x7b9a('0x8e')));_0xf6dae2['use'](_0x7b9a('0x8f'),require('./api/intSalesforceField'));_0xf6dae2['use'](_0x7b9a('0x90'),require('./api/intSugarcrmAccount'));_0xf6dae2['use'](_0x7b9a('0x91'),require(_0x7b9a('0x92')));_0xf6dae2['use'](_0x7b9a('0x93'),require('./api/intSugarcrmField'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x94'),require(_0x7b9a('0x95')));_0xf6dae2['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0xf6dae2['use'](_0x7b9a('0x96'),require(_0x7b9a('0x97')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x98'),require(_0x7b9a('0x99')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x9a'),require('./api/intZohoConfiguration'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x9b'),require('./api/intZohoField'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x9c'),require(_0x7b9a('0x9d')));_0xf6dae2['use']('/api/integrations/zendesk/configurations',require(_0x7b9a('0x9e')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/zendesk/fields',require(_0x7b9a('0x9f')));_0xf6dae2['use'](_0x7b9a('0xa0'),require(_0x7b9a('0xa1')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/freshdesk/configurations',require(_0x7b9a('0xa2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa3'),require(_0x7b9a('0xa4')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa5'),require('./api/intVtigerConfiguration'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa6'),require(_0x7b9a('0xa7')));_0xf6dae2['use']('/api/integrations/servicenow/accounts',require(_0x7b9a('0xa8')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa9'),require(_0x7b9a('0xaa')));_0xf6dae2['use'](_0x7b9a('0xab'),require(_0x7b9a('0xac')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xad'),require(_0x7b9a('0xae')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/dynamics365/fields',require(_0x7b9a('0xaf')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/freshsales/accounts',require(_0x7b9a('0xb0')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb1'),require(_0x7b9a('0xb2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb3'),require(_0x7b9a('0xb4')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb5'),require(_0x7b9a('0xb6')));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb7'),require('./api/chatInternalMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb8'),require('./api/jscriptyAnswerReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb9'),require(_0x7b9a('0xba')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xbb'),require(_0x7b9a('0xbc')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xbd'),require(_0x7b9a('0xbe')));_0xf6dae2['use'](_0x7b9a('0xbf'),require(_0x7b9a('0xc0')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xc1'),require(_0x7b9a('0xc2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xc3'),require(_0x7b9a('0xc4')));_0xf6dae2['use'](_0x7b9a('0xc5'),require(_0x7b9a('0xc6')));_0xf6dae2[_0x7b9a('0x6')]('/api/square/odbc',require(_0x7b9a('0xc7')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xc8'),require(_0x7b9a('0xc9')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xca'),require(_0x7b9a('0xcb')));_0xf6dae2[_0x7b9a('0x6')]('/api/square/messages',require('./api/squareMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xcc'),require(_0x7b9a('0xcd')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xce'),require(_0x7b9a('0xcf')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd0'),require(_0x7b9a('0xd1')));_0xf6dae2[_0x7b9a('0x6')]('/api/migrations',require(_0x7b9a('0xd2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd3'),require('./api/attachment'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd4'),require(_0x7b9a('0xd5')));_0xf6dae2[_0x7b9a('0x6')]('/api/mail/reports/transfer',require(_0x7b9a('0xd6')));_0xf6dae2['use']('/api/chat/reports/transfer',require(_0x7b9a('0xd7')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd8'),require(_0x7b9a('0xd9')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xda'),require('./api/openchannelTransferReport'));_0xf6dae2['use'](_0x7b9a('0xdb'),require(_0x7b9a('0xdc')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xdd'),require('./api/cmList'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xde'),require(_0x7b9a('0xdf')));_0xf6dae2['use'](_0x7b9a('0xe0'),require(_0x7b9a('0xe1')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe2'),require(_0x7b9a('0xe3')));_0xf6dae2['use'](_0x7b9a('0xe4'),require(_0x7b9a('0xe5')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe6'),require(_0x7b9a('0xe7')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe8'),require('./api/whatsappAccount'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe9'),require(_0x7b9a('0xea')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xeb'),require(_0x7b9a('0xec')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xed'),require('./api/whatsappMessage'));_0xf6dae2[_0x7b9a('0x6')]('/api/whatsapp/reports/queue',require(_0x7b9a('0xee')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xef'),require(_0x7b9a('0xf0')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf1'),require(_0x7b9a('0xf2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf3'),require('./api/cloudProvider'));_0xf6dae2[_0x7b9a('0x6')]('/api/auth/local',require(_0x7b9a('0xf4')));_0xf6dae2['use'](_0x7b9a('0xf5'),require(_0x7b9a('0xf6')));_0xf6dae2[_0x7b9a('0x6')]('/api/jira',require('./api/jira'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf7'),require('./api/rpc'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf8'),require(_0x7b9a('0xf9')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xfa'),require(_0x7b9a('0xfb')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xfc'),require(_0x7b9a('0xfd')));_0xf6dae2['use'](_0x7b9a('0xfe'),require('./api/webbar'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xff'),express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],'/apidoc')));_0xf6dae2[_0x7b9a('0x6')]('/www',express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],'/www')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x103'),express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],_0x7b9a('0x103'))));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x104'),express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],_0x7b9a('0x105'),_0x7b9a('0x106'))));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x107'),express[_0x7b9a('0x100')](path['join'](config[_0x7b9a('0x102')],_0x7b9a('0x108'))));_0xf6dae2[_0x7b9a('0x109')](_0x7b9a('0x10a'))[_0x7b9a('0x10b')](errors[0x194]);_0xf6dae2[_0x7b9a('0x109')]('/*')[_0x7b9a('0x10b')](function(_0x2c3a1d,_0x145e1d){_0x145e1d['sendFile'](path[_0x7b9a('0x10c')](_0xf6dae2[_0x7b9a('0x10b')](_0x7b9a('0x10d'))+'/index.html'));});};var sensitiveFields=['username',_0x7b9a('0x10e'),_0x7b9a('0x10f'),_0x7b9a('0x110'),_0x7b9a('0x111'),_0x7b9a('0x112'),_0x7b9a('0x113'),_0x7b9a('0x114'),_0x7b9a('0x115'),'fax',_0x7b9a('0x116'),_0x7b9a('0x117'),_0x7b9a('0x118'),_0x7b9a('0x119'),_0x7b9a('0x11a'),_0x7b9a('0x11b'),_0x7b9a('0x11c'),_0x7b9a('0x11d'),'channelSecret',_0x7b9a('0x11e'),_0x7b9a('0x11f'),_0x7b9a('0x120'),_0x7b9a('0x121'),_0x7b9a('0x122'),_0x7b9a('0x123'),_0x7b9a('0x124'),'calleridnum',_0x7b9a('0x125'),'vidaooApiKey',_0x7b9a('0x126'),_0x7b9a('0x127'),_0x7b9a('0x128'),_0x7b9a('0x129'),'key',_0x7b9a('0x11'),'pass','accountSid','localstationid','dsn',_0x7b9a('0x12a'),_0x7b9a('0x12b'),_0x7b9a('0x12c')];function maskSensitiveData(_0x56ed34){var _0x19ac27=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x56ed34))return;for(var _0xc16a7a in _0x56ed34){if(_[_0x7b9a('0x12d')](_0x56ed34[_0xc16a7a])){for(var _0x419943=0x0;_0x419943<_0x56ed34[_0xc16a7a][_0x7b9a('0x12e')];_0x419943++){maskSensitiveData(_0x56ed34[_0xc16a7a][_0x419943]);}}else if(_['isPlainObject'](_0x56ed34[_0xc16a7a])){maskSensitiveData(_0x56ed34[_0xc16a7a]);}else if(_['isString'](_0x56ed34[_0xc16a7a])){_0x56ed34[_0xc16a7a]=_0x56ed34[_0xc16a7a]['replace'](/{{{/g,_0x7b9a('0x12f'))[_0x7b9a('0x130')](/}}}/g,_0x7b9a('0x131'))[_0x7b9a('0x130')](/{{/g,'@{')[_0x7b9a('0x130')](/}}/g,'}@');if(_[_0x7b9a('0x132')](sensitiveFields,_0xc16a7a)){_0x56ed34[_0xc16a7a]=_0x56ed34[_0xc16a7a][_0x7b9a('0x130')](_0x19ac27,'*');}}}} \ No newline at end of file +var _0xd2bb=['./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/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/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','./api/pm2','/api/webbar','./api/webbar','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','apiKey','firstName','street','phone','mobile','fax','clientId','clientSecret','accessKey','tenantId','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','exten','vidaooApiKey','privateKey','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','util','./config/environment','api','./config/logger','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','responseTime','user','name','inspect','logger','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','url','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/voiceTransferReport','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/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/chatGroup','/api/chat/proactive_actions','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','./api/trigger','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/configurations','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/configurations'];(function(_0x3358a8,_0x16ac88){var _0x2fac5c=function(_0x2dcc90){while(--_0x2dcc90){_0x3358a8['push'](_0x3358a8['shift']());}};_0x2fac5c(++_0x16ac88);}(_0xd2bb,0x1d2));var _0xbd2b=function(_0x5f19ce,_0x2283a6){_0x5f19ce=_0x5f19ce-0x0;var _0x5fe12c=_0xd2bb[_0x5f19ce];return _0x5fe12c;};'use strict';var _=require(_0xbd2b('0x0'));var path=require(_0xbd2b('0x1'));var express=require(_0xbd2b('0x2'));var ewinston=require(_0xbd2b('0x3'));var util=require(_0xbd2b('0x4'));var errors=require('./errors');var config=require(_0xbd2b('0x5'));var logger=require('./config/logger')(_0xbd2b('0x6'));var authLogger=require(_0xbd2b('0x7'))(_0xbd2b('0x8'));exports[_0xbd2b('0x9')]=function(_0xb0a744){_0xb0a744[_0xbd2b('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2338f2,_0x1dba43){var _0x491a3f=_0xbd2b('0xb');if(!_[_0xbd2b('0xc')](_0x2338f2['body'])){_0x491a3f+=_0xbd2b('0xd');var _0xc43eab=_0x2338f2[_0xbd2b('0xe')];maskSensitiveData(_0xc43eab);}return util[_0xbd2b('0xf')](_0x491a3f,_0x2338f2[_0xbd2b('0x10')],_0x2338f2['headers']['x-forwarded-for']?_0x2338f2[_0xbd2b('0x11')][_0xbd2b('0x12')]:_0x2338f2[_0xbd2b('0x13')]['remoteAddress']||_0x2338f2['ip'],_0x2338f2['url'],_0x1dba43['statusCode'],_0x1dba43[_0xbd2b('0x14')],_0x2338f2['user']?_0x2338f2[_0xbd2b('0x15')]['id']:null,_0x2338f2[_0xbd2b('0x15')]?_0x2338f2[_0xbd2b('0x15')][_0xbd2b('0x16')]:null,_0x2338f2['user']?_0x2338f2[_0xbd2b('0x15')]['role']:null,_0xc43eab?util[_0xbd2b('0x17')](_0xc43eab,![],null):'');}}));_0xb0a744[_0xbd2b('0xa')](ewinston[_0xbd2b('0x18')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x475325,_0xe108d2){var _0x4ae305='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x475325['body']&&_0x475325[_0xbd2b('0xe')][_0xbd2b('0x19')]&&_0x475325[_0xbd2b('0xe')][_0xbd2b('0x1a')]){_0x4ae305=_0xbd2b('0x1b');}return util[_0xbd2b('0xf')](_0x4ae305,_0x475325[_0xbd2b('0x10')],_0x475325[_0xbd2b('0x11')][_0xbd2b('0x12')]?_0x475325[_0xbd2b('0x11')][_0xbd2b('0x12')]:_0x475325['connection'][_0xbd2b('0x1c')]||_0x475325['ip'],_0x475325[_0xbd2b('0x1d')],_0xe108d2['statusCode'],_0xe108d2['responseTime'],_0x475325['user']?_0x475325['user']['id']:null,_0x475325['user']?_0x475325[_0xbd2b('0x15')][_0xbd2b('0x16')]:null,_0x475325[_0xbd2b('0x15')]?_0x475325[_0xbd2b('0x15')]['role']:null,_0x475325['body']&&_0x475325[_0xbd2b('0xe')][_0xbd2b('0x19')]?_0x475325[_0xbd2b('0xe')]['device']:_0xbd2b('0x1e'),_0x475325[_0xbd2b('0xe')]&&_0x475325[_0xbd2b('0xe')]['agent_id']?_0x475325[_0xbd2b('0xe')]['agent_id']:'',_0x475325[_0xbd2b('0xe')]&&_0x475325['body']['agent_name']?_0x475325[_0xbd2b('0xe')][_0xbd2b('0x1f')]:'');},'ignoreRoute':function(_0xe09e01){var _0x4d85d6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4d85d6[_0xbd2b('0x20')](_0xe09e01[_0xbd2b('0x1d')]);}}));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x21'),require(_0xbd2b('0x22')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x23'),require('./api/voiceChanSpy'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x24'),require(_0xbd2b('0x25')));_0xb0a744[_0xbd2b('0xa')]('/api/voice/extensions',require(_0xbd2b('0x26')));_0xb0a744['use'](_0xbd2b('0x27'),require(_0xbd2b('0x28')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x29'),require(_0xbd2b('0x2a')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x2b'),require(_0xbd2b('0x2c')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x2d'),require(_0xbd2b('0x2e')));_0xb0a744['use'](_0xbd2b('0x2f'),require(_0xbd2b('0x30')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x31'),require(_0xbd2b('0x32')));_0xb0a744['use'](_0xbd2b('0x33'),require(_0xbd2b('0x34')));_0xb0a744[_0xbd2b('0xa')]('/api/voice/dials/reports',require(_0xbd2b('0x35')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x36'),require('./api/voiceAgentReport'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x37'),require(_0xbd2b('0x38')));_0xb0a744[_0xbd2b('0xa')]('/api/members/reports',require(_0xbd2b('0x39')));_0xb0a744[_0xbd2b('0xa')]('/api/trunks',require('./api/trunk'));_0xb0a744[_0xbd2b('0xa')]('/api/voice/transfers/reports',require(_0xbd2b('0x3a')));_0xb0a744['use']('/api/mail/out_servers',require('./api/mailServerOut'));_0xb0a744['use']('/api/mail/accounts',require(_0xbd2b('0x3b')));_0xb0a744['use'](_0xbd2b('0x3c'),require(_0xbd2b('0x3d')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x3e'),require(_0xbd2b('0x3f')));_0xb0a744[_0xbd2b('0xa')]('/api/mail/interactions',require(_0xbd2b('0x40')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x41'),require(_0xbd2b('0x42')));_0xb0a744['use'](_0xbd2b('0x43'),require('./api/mailApplication'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x44'),require('./api/mailQueueReport'));_0xb0a744[_0xbd2b('0xa')]('/api/dashboards',require(_0xbd2b('0x45')));_0xb0a744['use'](_0xbd2b('0x46'),require(_0xbd2b('0x47')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x48'),require('./api/faxAccount'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x49'),require('./api/faxApplication'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x4a'),require(_0xbd2b('0x4b')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x4c'),require('./api/faxMessage'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x4d'),require(_0xbd2b('0x4e')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x4f'),require(_0xbd2b('0x50')));_0xb0a744[_0xbd2b('0xa')]('/api/sms/accounts',require('./api/smsAccount'));_0xb0a744['use'](_0xbd2b('0x51'),require(_0xbd2b('0x52')));_0xb0a744['use'](_0xbd2b('0x53'),require(_0xbd2b('0x54')));_0xb0a744[_0xbd2b('0xa')]('/api/sms/messages',require(_0xbd2b('0x55')));_0xb0a744['use'](_0xbd2b('0x56'),require('./api/smsQueue'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x57'),require('./api/openchannelAccount'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x58'),require('./api/openchannelApplication'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x59'),require(_0xbd2b('0x5a')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x5b'),require('./api/openchannelMessage'));_0xb0a744['use'](_0xbd2b('0x5c'),require(_0xbd2b('0x5d')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x5e'),require(_0xbd2b('0x5f')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x60'),require(_0xbd2b('0x61')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x62'),require(_0xbd2b('0x63')));_0xb0a744['use'](_0xbd2b('0x64'),require(_0xbd2b('0x65')));_0xb0a744['use'](_0xbd2b('0x66'),require(_0xbd2b('0x67')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x68'),require(_0xbd2b('0x69')));_0xb0a744['use'](_0xbd2b('0x6a'),require(_0xbd2b('0x6b')));_0xb0a744['use'](_0xbd2b('0x6c'),require(_0xbd2b('0x6d')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x6e'),require('./api/chatProactiveAction'));_0xb0a744['use']('/api/cm/companies',require('./api/cmCompany'));_0xb0a744['use'](_0xbd2b('0x6f'),require(_0xbd2b('0x70')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x71'),require('./api/cmHopper'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x72'),require(_0xbd2b('0x73')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x74'),require(_0xbd2b('0x75')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x76'),require(_0xbd2b('0x77')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x78'),require('./api/cmCustomField'));_0xb0a744[_0xbd2b('0xa')]('/api/actions',require(_0xbd2b('0x79')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x7a'),require(_0xbd2b('0x7b')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x7c'),require(_0xbd2b('0x7d')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x7e'),require('./api/disposition'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x7f'),require(_0xbd2b('0x80')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x81'),require(_0xbd2b('0x82')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x83'),require(_0xbd2b('0x84')));_0xb0a744[_0xbd2b('0xa')]('/api/cdr',require(_0xbd2b('0x85')));_0xb0a744[_0xbd2b('0xa')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x86'),require(_0xbd2b('0x87')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x88'),require(_0xbd2b('0x89')));_0xb0a744['use'](_0xbd2b('0x8a'),require(_0xbd2b('0x8b')));_0xb0a744[_0xbd2b('0xa')]('/api/templates',require(_0xbd2b('0x8c')));_0xb0a744[_0xbd2b('0xa')]('/api/triggers',require(_0xbd2b('0x8d')));_0xb0a744[_0xbd2b('0xa')]('/api/variables',require('./api/variable'));_0xb0a744['use']('/api/integrations',require(_0xbd2b('0x8e')));_0xb0a744['use'](_0xbd2b('0x8f'),require('./api/integrationReport'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x90'),require(_0xbd2b('0x91')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x92'),require('./api/analyticDefaultReport'));_0xb0a744[_0xbd2b('0xa')]('/api/analytics/extracted_reports',require(_0xbd2b('0x93')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x94'),require('./api/analyticMetric'));_0xb0a744['use'](_0xbd2b('0x95'),require(_0xbd2b('0x96')));_0xb0a744['use'](_0xbd2b('0x97'),require(_0xbd2b('0x98')));_0xb0a744[_0xbd2b('0xa')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x99'),require('./api/intSalesforceConfiguration'));_0xb0a744[_0xbd2b('0xa')]('/api/integrations/salesforce/fields',require(_0xbd2b('0x9a')));_0xb0a744['use']('/api/integrations/sugarcrm/accounts',require(_0xbd2b('0x9b')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x9c'),require('./api/intSugarcrmConfiguration'));_0xb0a744['use'](_0xbd2b('0x9d'),require('./api/intSugarcrmField'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x9e'),require(_0xbd2b('0x9f')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xa0'),require(_0xbd2b('0xa1')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xa2'),require(_0xbd2b('0xa3')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xa4'),require(_0xbd2b('0xa5')));_0xb0a744['use'](_0xbd2b('0xa6'),require(_0xbd2b('0xa7')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xa8'),require(_0xbd2b('0xa9')));_0xb0a744['use'](_0xbd2b('0xaa'),require(_0xbd2b('0xab')));_0xb0a744[_0xbd2b('0xa')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0xb0a744['use']('/api/integrations/zendesk/fields',require(_0xbd2b('0xac')));_0xb0a744['use'](_0xbd2b('0xad'),require(_0xbd2b('0xae')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xaf'),require(_0xbd2b('0xb0')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xb1'),require(_0xbd2b('0xb2')));_0xb0a744['use'](_0xbd2b('0xb3'),require('./api/intVtigerAccount'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xb4'),require(_0xbd2b('0xb5')));_0xb0a744[_0xbd2b('0xa')]('/api/integrations/vtiger/fields',require(_0xbd2b('0xb6')));_0xb0a744[_0xbd2b('0xa')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0xb0a744['use'](_0xbd2b('0xb7'),require(_0xbd2b('0xb8')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xb9'),require(_0xbd2b('0xba')));_0xb0a744['use'](_0xbd2b('0xbb'),require('./api/intDynamics365Account'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xbc'),require(_0xbd2b('0xbd')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xbe'),require(_0xbd2b('0xbf')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xc0'),require(_0xbd2b('0xc1')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xc2'),require(_0xbd2b('0xc3')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xc4'),require('./api/intFreshsalesField'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xc5'),require(_0xbd2b('0xc6')));_0xb0a744[_0xbd2b('0xa')]('/api/chat/reports/queue',require(_0xbd2b('0xc7')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xc8'),require(_0xbd2b('0xc9')));_0xb0a744[_0xbd2b('0xa')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xca'),require('./api/jscriptyQuestionReport'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xcb'),require(_0xbd2b('0xcc')));_0xb0a744[_0xbd2b('0xa')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xcd'),require(_0xbd2b('0xce')));_0xb0a744['use'](_0xbd2b('0xcf'),require(_0xbd2b('0xd0')));_0xb0a744['use'](_0xbd2b('0xd1'),require(_0xbd2b('0xd2')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xd3'),require(_0xbd2b('0xd4')));_0xb0a744['use'](_0xbd2b('0xd5'),require(_0xbd2b('0xd6')));_0xb0a744['use']('/api/square/projects',require(_0xbd2b('0xd7')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xd8'),require(_0xbd2b('0xd9')));_0xb0a744['use'](_0xbd2b('0xda'),require(_0xbd2b('0xdb')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xdc'),require(_0xbd2b('0xdd')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xde'),require(_0xbd2b('0xdf')));_0xb0a744[_0xbd2b('0xa')]('/api/campaigns',require('./api/campaign'));_0xb0a744[_0xbd2b('0xa')]('/api/migrations',require(_0xbd2b('0xe0')));_0xb0a744['use'](_0xbd2b('0xe1'),require(_0xbd2b('0xe2')));_0xb0a744['use'](_0xbd2b('0xe3'),require(_0xbd2b('0xe4')));_0xb0a744['use']('/api/mail/reports/transfer',require(_0xbd2b('0xe5')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xe6'),require(_0xbd2b('0xe7')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xe8'),require('./api/faxTransferReport'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xe9'),require(_0xbd2b('0xea')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xeb'),require(_0xbd2b('0xec')));_0xb0a744['use'](_0xbd2b('0xed'),require(_0xbd2b('0xee')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xef'),require(_0xbd2b('0xf0')));_0xb0a744['use']('/api/userProfiles',require(_0xbd2b('0xf1')));_0xb0a744['use'](_0xbd2b('0xf2'),require(_0xbd2b('0xf3')));_0xb0a744['use']('/api/userProfile/resources',require(_0xbd2b('0xf4')));_0xb0a744['use'](_0xbd2b('0xf5'),require('./api/userNotification'));_0xb0a744['use']('/api/whatsapp/accounts',require(_0xbd2b('0xf6')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xf7'),require(_0xbd2b('0xf8')));_0xb0a744['use'](_0xbd2b('0xf9'),require(_0xbd2b('0xfa')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xfb'),require(_0xbd2b('0xfc')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xfd'),require('./api/whatsappQueueReport'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0xfe'),require(_0xbd2b('0xff')));_0xb0a744['use'](_0xbd2b('0x100'),require('./api/whatsappQueue'));_0xb0a744['use']('/api/cloudProviders',require(_0xbd2b('0x101')));_0xb0a744['use'](_0xbd2b('0x102'),require(_0xbd2b('0x103')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x104'),require(_0xbd2b('0x105')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x106'),require('./api/jira'));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x107'),require(_0xbd2b('0x108')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x109'),require(_0xbd2b('0x10a')));_0xb0a744['use']('/api/system',require(_0xbd2b('0x10b')));_0xb0a744[_0xbd2b('0xa')]('/api/pm2',require(_0xbd2b('0x10c')));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x10d'),require(_0xbd2b('0x10e')));_0xb0a744[_0xbd2b('0xa')]('/apidoc',express[_0xbd2b('0x10f')](path[_0xbd2b('0x110')](config[_0xbd2b('0x111')],'/apidoc')));_0xb0a744['use'](_0xbd2b('0x112'),express[_0xbd2b('0x10f')](path[_0xbd2b('0x110')](config['root'],_0xbd2b('0x112'))));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x113'),express[_0xbd2b('0x10f')](path[_0xbd2b('0x110')](config[_0xbd2b('0x111')],_0xbd2b('0x113'))));_0xb0a744[_0xbd2b('0xa')](_0xbd2b('0x114'),express[_0xbd2b('0x10f')](path[_0xbd2b('0x110')](config['root'],_0xbd2b('0x115'),_0xbd2b('0x116'))));_0xb0a744['use'](_0xbd2b('0x117'),express['static'](path[_0xbd2b('0x110')](config['root'],_0xbd2b('0x118'))));_0xb0a744[_0xbd2b('0x119')](_0xbd2b('0x11a'))[_0xbd2b('0x11b')](errors[0x194]);_0xb0a744[_0xbd2b('0x119')]('/*')[_0xbd2b('0x11b')](function(_0xa6dcdf,_0x2934c9){_0x2934c9[_0xbd2b('0x11c')](path[_0xbd2b('0x11d')](_0xb0a744[_0xbd2b('0x11b')](_0xbd2b('0x11e'))+_0xbd2b('0x11f')));});};var sensitiveFields=['username','password','newPassword',_0xbd2b('0x120'),_0xbd2b('0x121'),'lastName',_0xbd2b('0x122'),_0xbd2b('0x123'),_0xbd2b('0x124'),_0xbd2b('0x125'),'email',_0xbd2b('0x126'),_0xbd2b('0x127'),'securityToken','code',_0xbd2b('0x128'),_0xbd2b('0x129'),_0xbd2b('0x12a'),'channelSecret',_0xbd2b('0x12b'),_0xbd2b('0x12c'),_0xbd2b('0x12d'),_0xbd2b('0x12e'),_0xbd2b('0x12f'),'membername',_0xbd2b('0x130'),'calleridnum',_0xbd2b('0x131'),_0xbd2b('0x132'),'clientEmail',_0xbd2b('0x133'),'accesskeyid',_0xbd2b('0x134'),_0xbd2b('0x135'),_0xbd2b('0x15'),_0xbd2b('0x136'),_0xbd2b('0x137'),_0xbd2b('0x138'),_0xbd2b('0x139'),_0xbd2b('0x13a'),_0xbd2b('0x13b'),_0xbd2b('0x13c')];function maskSensitiveData(_0x3da88e){var _0x46c8ec=/(?!^)[\s\S](?!$)/g;if(!_[_0xbd2b('0x13d')](_0x3da88e))return;for(var _0xe0714 in _0x3da88e){if(_[_0xbd2b('0x13e')](_0x3da88e[_0xe0714])){for(var _0x506ebf=0x0;_0x506ebf<_0x3da88e[_0xe0714][_0xbd2b('0x13f')];_0x506ebf++){maskSensitiveData(_0x3da88e[_0xe0714][_0x506ebf]);}}else if(_[_0xbd2b('0x13d')](_0x3da88e[_0xe0714])){maskSensitiveData(_0x3da88e[_0xe0714]);}else if(_[_0xbd2b('0x140')](_0x3da88e[_0xe0714])){_0x3da88e[_0xe0714]=_0x3da88e[_0xe0714][_0xbd2b('0x141')](/{{{/g,_0xbd2b('0x142'))['replace'](/}}}/g,_0xbd2b('0x143'))[_0xbd2b('0x141')](/{{/g,'@{')[_0xbd2b('0x141')](/}}/g,'}@');if(_[_0xbd2b('0x144')](sensitiveFields,_0xe0714)){_0x3da88e[_0xe0714]=_0x3da88e[_0xe0714][_0xbd2b('0x141')](_0x46c8ec,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 03b7b41..76a0d38 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa624=['../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.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/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','server','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.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/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa624,0xb0));var _0x4a62=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xa624[_0x487ab4];return _0x3bef77;};'use strict';var jayson=require(_0x4a62('0x0'));var BPromise=require(_0x4a62('0x1'));var _=require(_0x4a62('0x2'));var config=require(_0x4a62('0x3'));exports[_0x4a62('0x4')]=function(){return new BPromise(function(_0x518ef1,_0x29957d){var _0x5ef583={};_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x6')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x7')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x8')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/voiceRecording/voiceRecording.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x9')));_0x5ef583=_['merge'](_0x5ef583,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xa')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0xb')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xc')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xd')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xe')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xf')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x10')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x11')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x12')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x13')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x14')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x15')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/faxAccount/faxAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x16')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/faxInteraction/faxInteraction.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x17')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x18')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x19')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x1a')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x1b')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x1c')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x1d')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x1e')));_0x5ef583=_['merge'](_0x5ef583,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x1f')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x20')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x21')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/chatMessage/chatMessage.rpc'));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x22')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x23')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x24')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x25')));_0x5ef583=_['merge'](_0x5ef583,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x26')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x27')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x28')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x29')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2a')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2b')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2c')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2d')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x2e')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x2f')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x5ef583=_['merge'](_0x5ef583,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x30')));_0x5ef583=_['merge'](_0x5ef583,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x31')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x32')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x33')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/squareReport/squareReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x34')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/setting/setting.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x35')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x36')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x37')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x38')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/campaign/campaign.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x39')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x3a')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x3b')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x3c')));_0x5ef583=_['merge'](_0x5ef583,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5ef583=_['merge'](_0x5ef583,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x361ab8=jayson[_0x4a62('0x3d')](_0x5ef583)['http']();var _0xd36c16=config[_0x4a62('0x3e')][_0x4a62('0x3f')]||config[_0x4a62('0x3f')]+0x1;var _0x171dda=config[_0x4a62('0x3e')]['ip']||'localhost';_0x361ab8['on'](_0x4a62('0x40'),function(_0x350334){return _0x29957d(_0x350334);});_0x361ab8['listen'](_0xd36c16,_0x171dda,function(){console[_0x4a62('0x41')](_0x4a62('0x42'),_0x171dda,_0xd36c16);require(_0x4a62('0x43'))['default']();return _0x518ef1(_0x4a62('0x44')+_0x171dda+':'+_0xd36c16);});});}; \ No newline at end of file +var _0xc142=['../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc142,0xb5));var _0x2c14=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xc142[_0x531d15];return _0x271a18;};'use strict';var jayson=require(_0x2c14('0x0'));var BPromise=require('bluebird');var _=require(_0x2c14('0x1'));var config=require(_0x2c14('0x2'));exports[_0x2c14('0x3')]=function(){return new BPromise(function(_0x324a8a,_0x209b0f){var _0x281d7a={};_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/user/user.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x5')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x6')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x7')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x8')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x9')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/memberReport/memberReport.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/trunk/trunk.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0xa')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0xb')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0xc')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0xd')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/mailQueue/mailQueue.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0xe')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/mailMessage/mailMessage.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0xf')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x10')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/faxAccount/faxAccount.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x11')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x12')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x13')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x14')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x15')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/smsAccount/smsAccount.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/smsInteraction/smsInteraction.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x16')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x17')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x18')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x19')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x1a')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x1b')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x1c')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x1d')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x1e')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x1f')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x20')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x21')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x22')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x23')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x24')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x25')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x26')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/pause/pause.rpc'));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x27')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/template/template.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x28')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x29')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x2a')));_0x281d7a=_['merge'](_0x281d7a,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x2b')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x2c')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x2d')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x2e')));_0x281d7a=_['merge'](_0x281d7a,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x2f')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x281d7a=_['merge'](_0x281d7a,require('../api/squareReport/squareReport.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x30')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x31')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require('../api/squareProject/squareProject.rpc'));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x32')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x33')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x34')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x35')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x36')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x37')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x38')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x39')));_0x281d7a=_['merge'](_0x281d7a,require(_0x2c14('0x3a')));_0x281d7a=_[_0x2c14('0x4')](_0x281d7a,require(_0x2c14('0x3b')));var _0x289bbd=jayson[_0x2c14('0x3c')](_0x281d7a)['http']();var _0x48d67a=config[_0x2c14('0x3d')][_0x2c14('0x3e')]||config[_0x2c14('0x3e')]+0x1;var _0x1b8491=config[_0x2c14('0x3d')]['ip']||_0x2c14('0x3f');_0x289bbd['on'](_0x2c14('0x40'),function(_0x32660a){return _0x209b0f(_0x32660a);});_0x289bbd[_0x2c14('0x3')](_0x48d67a,_0x1b8491,function(){console[_0x2c14('0x41')](_0x2c14('0x42'),_0x1b8491,_0x48d67a);require(_0x2c14('0x43'))[_0x2c14('0x44')]();return _0x324a8a('RPC\x20listening\x20on\x20'+_0x1b8491+':'+_0x48d67a);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index ab03328..b8bc735 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 _0xe6e4=['search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xe6e4,0x139));var _0x4e6e=function(_0x2fc284,_0x5d271c){_0x2fc284=_0x2fc284-0x0;var _0x221234=_0xe6e4[_0x2fc284];return _0x221234;};'use strict';var util=require(_0x4e6e('0x0'));var _=require(_0x4e6e('0x1'));var EventEmitter=require('events')[_0x4e6e('0x2')];var AGIReply=require(_0x4e6e('0x3'));var AGIError=require(_0x4e6e('0x4'));function AGIChannel(_0x57de71){var _0x4346cc=this,_0x280be0=new AGIReply(),_0x44cd95=![],_0x28220a={};EventEmitter['call'](_0x4346cc);_0x57de71[_0x4e6e('0x5')](_0x4e6e('0x6'));_0x57de71[_0x4e6e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x280be0[_0x4e6e('0x5')](_0x4e6e('0x6'));_0x280be0['on'](_0x4e6e('0x8'),function(_0xb81bc2){for(var _0x5debaf in _0xb81bc2){_0x4346cc[_0x5debaf]=_0xb81bc2[_0x5debaf];}_0x4346cc[_0x4e6e('0x9')](_0x4e6e('0xa'));});_0x280be0['on'](_0x4e6e('0xb'),function(_0x5e36ce){if(_0x5e36ce[_0x4e6e('0xc')]()=='hangup'){_0x4346cc[_0x4e6e('0x9')](_0x4e6e('0xd'));return;}if(_0x5e36ce[_0x4e6e('0xe')](0x0,0xb)=='520-Invalid'){_0x44cd95=!![];}if(_0x44cd95){_0x28220a['rx']+=_0x5e36ce+'\x0a';if(_0x5e36ce[_0x4e6e('0xf')](_0x4e6e('0x10'))!=-0x1){_0x44cd95=![];}}else{_0x28220a['rx']=_0x5e36ce;}if(_0x44cd95){return;}if(typeof _0x28220a['cb']==_0x4e6e('0x11')){var _0x2163e8=_0x28220a['rx'][_0x4e6e('0xe')](0x0,0x3),_0x2b1ef8=null,_0xef9381=null;_0x2163e8=parseInt(_0x2163e8);if(isNaN(_0x2163e8)){_0x28220a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2163e8!=0xc8){_0x28220a['cb'](null,{'code':_0x2163e8,'result':-0x1,'extra':'KO'});return;}_0x2b1ef8=_0x28220a['rx']['substring'](0x4)[_0x4e6e('0x12')](_0x4e6e('0x13'),'');if(_0x2b1ef8[_0x4e6e('0x14')]('\x20')!=-0x1){_0x2b1ef8=_0x2b1ef8[_0x4e6e('0x15')](0x0,_0x2b1ef8[_0x4e6e('0x14')]('\x20'));}if(_[_0x4e6e('0x16')](_0x2b1ef8,'-1')){_0x2b1ef8=parseInt(_0x2b1ef8);}_0xef9381=_0x28220a['rx'][_0x4e6e('0x17')]('\x20');if(_0xef9381[_0x4e6e('0x18')]==0x3){_0xef9381=_0xef9381[0x2][_0x4e6e('0xe')](0x1,_0xef9381[0x2][_0x4e6e('0x18')]-0x1);}else if(_0xef9381[_0x4e6e('0x18')]>0x3){var _0x1c6550=/\((.+)\)/;var _0x1c2eba=_0x28220a['rx'][_0x4e6e('0x19')](_0x1c6550);if(_0x1c2eba){_0xef9381=_0x1c2eba[0x1];}else{_0xef9381=null;}}else{_0xef9381=null;}_0x28220a['cb'](null,{'code':_0x2163e8,'result':_0x2b1ef8,'extra':_0xef9381});}});_0x57de71['on'](_0x4e6e('0x1a'),function(_0x4924e9){_0x4346cc['emit'](_0x4e6e('0x1a'),new AGIError(_0x4e6e('0x1b'),_0x4924e9['code']));});_0x57de71['on'](_0x4e6e('0x1c'),function(){_0x4346cc['emit'](_0x4e6e('0x1c'),new AGIError(_0x4e6e('0x1d')));});_0x57de71['on'](_0x4e6e('0x1e'),function(){_0x4346cc['emit']('timeout',new AGIError(_0x4e6e('0x1f')));_0x57de71[_0x4e6e('0x20')]();});_0x57de71[_0x4e6e('0x21')](_0x280be0);this[_0x4e6e('0x22')]=function(_0x8d3c32,_0x5860a2){var _0x8d3c32=_0x8d3c32||'',_0x5860a2=typeof _0x5860a2==_0x4e6e('0x11')?_0x5860a2:new Function();_0x28220a={'tx':_0x8d3c32,'rx':'','cb':_0x5860a2};_0x57de71[_0x4e6e('0x23')](_0x8d3c32+'\x0a');},this[_0x4e6e('0x1c')]=function(){_0x57de71[_0x4e6e('0x20')]();};}util[_0x4e6e('0x24')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x4e6e('0x25')]=function(_0x1ad7ca){return this[_0x4e6e('0x22')][_0x4e6e('0x26')](this,_0x1ad7ca);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x28')]=function(){return this[_0x4e6e('0x25')](_0x4e6e('0x29'));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x2a')]=function(_0x334bac,_0x1eab17,_0x949807){_0x334bac=_0x334bac===undefined?_0x4e6e('0x2b'):_0x334bac;_0x1eab17=_0x1eab17===undefined?'5':_0x1eab17;_0x949807=_0x949807===undefined?'1':_0x949807;return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x2d'),_0x334bac,_0x1eab17*0x3e8,_0x949807));};AGIChannel[_0x4e6e('0x27')]['noop']=function(_0x598bb6){_0x598bb6=_0x598bb6||_0x4e6e('0x2e');return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')]('VERBOSE\x20\x22%s\x22',_0x598bb6));};AGIChannel['prototype']['exec']=function(_0x2c2472,_0x25da20){if(_[_0x4e6e('0x2f')](_0x25da20)){return this['sendRequest'](util[_0x4e6e('0x2c')]('EXEC\x20%s\x20%s',_0x2c2472,_0x25da20[_0x4e6e('0x30')](',')));}return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x31'),_0x2c2472,_0x25da20));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x32')]=function(_0x4c4d91){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x33'),_0x4c4d91));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x34')]=function(_0x1ddf55){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x35'),_0x1ddf55));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x36')]=function(_0x233327){return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x37'),_0x233327));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0xd')]=function(){return this[_0x4e6e('0x25')](_0x4e6e('0x38'));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x39')]=function(_0x27b4a9,_0x1418a3){var _0x5c51f4=_[_0x4e6e('0x3a')](_0x1418a3)||_[_0x4e6e('0x3b')](_0x1418a3)?_0x1418a3['toString']():_0x1418a3;return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x3c'),_0x27b4a9,_0x5c51f4?_0x5c51f4[_0x4e6e('0x3d')]()[_0x4e6e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x3e')]=function(_0x128668,_0x4a9409){return this[_0x4e6e('0x25')](util['format'](_0x4e6e('0x3f'),_0x128668,_0x4a9409));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x40')]=function(_0x46ce64,_0x2ba26c){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x46ce64,_0x2ba26c));};AGIChannel[_0x4e6e('0x27')]['sayPhonetic']=function(_0x19281a,_0x176480){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x41'),_0x19281a,_0x176480));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x42')]=function(_0x365c15,_0x13742a,_0x3b94dc){_0x13742a=_0x13742a||this['extension'];_0x3b94dc=_0x3b94dc||0x1;this[_0x4e6e('0x32')](_0x365c15);this[_0x4e6e('0x34')](_0x13742a);this[_0x4e6e('0x36')](_0x3b94dc);return this[_0x4e6e('0x43')](util['format'](_0x4e6e('0x44'),_0x365c15,_0x13742a,_0x3b94dc));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x45')]=function(_0x37b306){return this[_0x4e6e('0x25')](util['format'](_0x4e6e('0x46'),_0x37b306));};AGIChannel[_0x4e6e('0x27')]['recordFile']=function(_0x34aa39,_0x2c44dd,_0x577e5c,_0x1132be,_0x37f045,_0x13f453){_0x2c44dd=_0x2c44dd||_0x4e6e('0x47');_0x577e5c=_0x577e5c||'';_0x1132be=_0x1132be===undefined?-0x1:_0x1132be==='-1'?-0x1:_0x1132be*0x3e8;_0x37f045=_0x37f045===undefined?'':'s='+_0x37f045;_0x13f453=_0x13f453?'BEEP':'';return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x48'),_0x34aa39,_0x2c44dd,_0x577e5c,_0x1132be,_0x13f453,_0x37f045));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x49')]=function(_0x5d1582,_0x1ddd6e){_0x1ddd6e=_0x1ddd6e||'';return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x4a'),_0x5d1582,_0x1ddd6e));};AGIChannel['prototype'][_0x4e6e('0x4b')]=function(_0x4f1442){return this['exec'](_0x4e6e('0x4c'),_0x4f1442);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x4d')]=function(_0x12c1b3){return this[_0x4e6e('0x4e')]('WAIT',_0x12c1b3);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x1a')]=function(_0x43973b,_0x4379b7){this[_0x4e6e('0x43')](util['format'](_0x4e6e('0x4f'),_0x43973b['id'],_0x43973b[_0x4e6e('0x50')],_0x4379b7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4e6e('0x51')]=AGIChannel; \ No newline at end of file +var _0x0619=['setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','sync','prototype','answer','sendRequest','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0619,0x90));var _0x9061=function(_0x10fa53,_0x44d1b1){_0x10fa53=_0x10fa53-0x0;var _0x26317c=_0x0619[_0x10fa53];return _0x26317c;};'use strict';var util=require(_0x9061('0x0'));var _=require(_0x9061('0x1'));var EventEmitter=require(_0x9061('0x2'))[_0x9061('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x9061('0x4'));function AGIChannel(_0x69e4c){var _0x1f0fe8=this,_0x1384a7=new AGIReply(),_0x1bc8ce=![],_0xa713e1={};EventEmitter[_0x9061('0x5')](_0x1f0fe8);_0x69e4c[_0x9061('0x6')](_0x9061('0x7'));_0x69e4c[_0x9061('0x8')](0x8*0x3c*0x3c*0x3e8);_0x1384a7[_0x9061('0x6')]('utf8');_0x1384a7['on'](_0x9061('0x9'),function(_0x59c323){for(var _0x5cb5c6 in _0x59c323){_0x1f0fe8[_0x5cb5c6]=_0x59c323[_0x5cb5c6];}_0x1f0fe8[_0x9061('0xa')](_0x9061('0xb'));});_0x1384a7['on']('line',function(_0x502660){if(_0x502660[_0x9061('0xc')]()==_0x9061('0xd')){_0x1f0fe8[_0x9061('0xa')](_0x9061('0xd'));return;}if(_0x502660[_0x9061('0xe')](0x0,0xb)==_0x9061('0xf')){_0x1bc8ce=!![];}if(_0x1bc8ce){_0xa713e1['rx']+=_0x502660+'\x0a';if(_0x502660[_0x9061('0x10')](_0x9061('0x11'))!=-0x1){_0x1bc8ce=![];}}else{_0xa713e1['rx']=_0x502660;}if(_0x1bc8ce){return;}if(typeof _0xa713e1['cb']==_0x9061('0x12')){var _0x602ec8=_0xa713e1['rx'][_0x9061('0xe')](0x0,0x3),_0x2b6393=null,_0x464db2=null;_0x602ec8=parseInt(_0x602ec8);if(isNaN(_0x602ec8)){_0xa713e1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x602ec8!=0xc8){_0xa713e1['cb'](null,{'code':_0x602ec8,'result':-0x1,'extra':'KO'});return;}_0x2b6393=_0xa713e1['rx']['substring'](0x4)[_0x9061('0x13')](_0x9061('0x14'),'');if(_0x2b6393[_0x9061('0x15')]('\x20')!=-0x1){_0x2b6393=_0x2b6393[_0x9061('0x16')](0x0,_0x2b6393[_0x9061('0x15')]('\x20'));}if(_['startsWith'](_0x2b6393,'-1')){_0x2b6393=parseInt(_0x2b6393);}_0x464db2=_0xa713e1['rx']['split']('\x20');if(_0x464db2[_0x9061('0x17')]==0x3){_0x464db2=_0x464db2[0x2][_0x9061('0xe')](0x1,_0x464db2[0x2]['length']-0x1);}else if(_0x464db2[_0x9061('0x17')]>0x3){var _0x4f2ea6=/\((.+)\)/;var _0x1ea714=_0xa713e1['rx']['match'](_0x4f2ea6);if(_0x1ea714){_0x464db2=_0x1ea714[0x1];}else{_0x464db2=null;}}else{_0x464db2=null;}_0xa713e1['cb'](null,{'code':_0x602ec8,'result':_0x2b6393,'extra':_0x464db2});}});_0x69e4c['on'](_0x9061('0x18'),function(_0x5eae3a){_0x1f0fe8[_0x9061('0xa')](_0x9061('0x18'),new AGIError(_0x9061('0x19'),_0x5eae3a[_0x9061('0x1a')]));});_0x69e4c['on'](_0x9061('0x1b'),function(){_0x1f0fe8[_0x9061('0xa')](_0x9061('0x1b'),new AGIError(_0x9061('0x1c')));});_0x69e4c['on']('timeout',function(){_0x1f0fe8[_0x9061('0xa')](_0x9061('0x1d'),new AGIError(_0x9061('0x1e')));_0x69e4c[_0x9061('0x1f')]();});_0x69e4c['pipe'](_0x1384a7);this[_0x9061('0x20')]=function(_0x30b8be,_0x4d0d95){var _0x30b8be=_0x30b8be||'',_0x4d0d95=typeof _0x4d0d95==_0x9061('0x12')?_0x4d0d95:new Function();_0xa713e1={'tx':_0x30b8be,'rx':'','cb':_0x4d0d95};_0x69e4c[_0x9061('0x21')](_0x30b8be+'\x0a');},this['close']=function(){_0x69e4c['destroy']();};}util[_0x9061('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x2b017d){return this[_0x9061('0x20')][_0x9061('0x23')](this,_0x2b017d);};AGIChannel[_0x9061('0x24')][_0x9061('0x25')]=function(){return this[_0x9061('0x26')](_0x9061('0x27'));};AGIChannel[_0x9061('0x24')][_0x9061('0x28')]=function(_0x26962b,_0x7f18d5,_0x45403a){_0x26962b=_0x26962b===undefined?'beep':_0x26962b;_0x7f18d5=_0x7f18d5===undefined?'5':_0x7f18d5;_0x45403a=_0x45403a===undefined?'1':_0x45403a;return this['sendRequest'](util[_0x9061('0x29')](_0x9061('0x2a'),_0x26962b,_0x7f18d5*0x3e8,_0x45403a));};AGIChannel[_0x9061('0x24')][_0x9061('0x2b')]=function(_0x4231ed){_0x4231ed=_0x4231ed||'NO\x20MESSAGE';return this[_0x9061('0x26')](util['format']('VERBOSE\x20\x22%s\x22',_0x4231ed));};AGIChannel[_0x9061('0x24')][_0x9061('0x2c')]=function(_0x9a8304,_0x1cbb32){if(_[_0x9061('0x2d')](_0x1cbb32)){return this[_0x9061('0x26')](util[_0x9061('0x29')](_0x9061('0x2e'),_0x9a8304,_0x1cbb32[_0x9061('0x2f')](',')));}return this[_0x9061('0x26')](util[_0x9061('0x29')]('EXEC\x20%s\x20%s',_0x9a8304,_0x1cbb32));};AGIChannel[_0x9061('0x24')][_0x9061('0x30')]=function(_0x54370a){return this[_0x9061('0x26')](util['format'](_0x9061('0x31'),_0x54370a));};AGIChannel['prototype']['setExtension']=function(_0x13f804){return this[_0x9061('0x26')](util['format'](_0x9061('0x32'),_0x13f804));};AGIChannel['prototype'][_0x9061('0x33')]=function(_0x3e8c34){return this['sendRequest'](util[_0x9061('0x29')](_0x9061('0x34'),_0x3e8c34));};AGIChannel[_0x9061('0x24')][_0x9061('0xd')]=function(){return this[_0x9061('0x26')](_0x9061('0x35'));};AGIChannel[_0x9061('0x24')]['setVariable']=function(_0x4ac059,_0x30026f){var _0x2ae343=_['isBoolean'](_0x30026f)||_[_0x9061('0x36')](_0x30026f)?_0x30026f[_0x9061('0x37')]():_0x30026f;return this['sendRequest'](util[_0x9061('0x29')](_0x9061('0x38'),_0x4ac059,_0x2ae343?_0x2ae343[_0x9061('0x37')]()[_0x9061('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9061('0x24')][_0x9061('0x39')]=function(_0x146e47,_0x2cded0){return this[_0x9061('0x26')](util['format'](_0x9061('0x3a'),_0x146e47,_0x2cded0));};AGIChannel['prototype'][_0x9061('0x3b')]=function(_0x4e5228,_0x1696a7){return this[_0x9061('0x26')](util[_0x9061('0x29')](_0x9061('0x3c'),_0x4e5228,_0x1696a7));};AGIChannel['prototype']['sayPhonetic']=function(_0x1f7428,_0x5265eb){return this[_0x9061('0x26')](util['format'](_0x9061('0x3d'),_0x1f7428,_0x5265eb));};AGIChannel[_0x9061('0x24')][_0x9061('0x3e')]=function(_0x106793,_0x499318,_0x2dbbb9){_0x499318=_0x499318||this[_0x9061('0x3f')];_0x2dbbb9=_0x2dbbb9||0x1;this[_0x9061('0x30')](_0x106793);this[_0x9061('0x40')](_0x499318);this[_0x9061('0x33')](_0x2dbbb9);return this[_0x9061('0x2b')](util[_0x9061('0x29')](_0x9061('0x41'),_0x106793,_0x499318,_0x2dbbb9));};AGIChannel[_0x9061('0x24')][_0x9061('0x42')]=function(_0x1b0a09){return this[_0x9061('0x26')](util['format'](_0x9061('0x43'),_0x1b0a09));};AGIChannel[_0x9061('0x24')][_0x9061('0x44')]=function(_0x431f98,_0x1937bf,_0x584b21,_0x386229,_0x3a76a5,_0x3b463c){_0x1937bf=_0x1937bf||'wav';_0x584b21=_0x584b21||'';_0x386229=_0x386229===undefined?-0x1:_0x386229==='-1'?-0x1:_0x386229*0x3e8;_0x3a76a5=_0x3a76a5===undefined?'':'s='+_0x3a76a5;_0x3b463c=_0x3b463c?'BEEP':'';return this[_0x9061('0x26')](util[_0x9061('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x431f98,_0x1937bf,_0x584b21,_0x386229,_0x3b463c,_0x3a76a5));};AGIChannel['prototype'][_0x9061('0x45')]=function(_0x369a3a,_0x4eaf59){_0x4eaf59=_0x4eaf59||'';return this[_0x9061('0x26')](util[_0x9061('0x29')](_0x9061('0x46'),_0x369a3a,_0x4eaf59));};AGIChannel[_0x9061('0x24')]['agi']=function(_0x3f1ddc){return this[_0x9061('0x2c')]('AGI',_0x3f1ddc);};AGIChannel[_0x9061('0x24')][_0x9061('0x47')]=function(_0x4d676c){return this[_0x9061('0x2c')](_0x9061('0x48'),_0x4d676c);};AGIChannel[_0x9061('0x24')][_0x9061('0x18')]=function(_0x36c0e6,_0x5204ca){this[_0x9061('0x2b')](util[_0x9061('0x29')](_0x9061('0x49'),_0x36c0e6['id'],_0x36c0e6[_0x9061('0x4a')],_0x5204ca));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9061('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 4b29b5a..a6b90da 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 _0x4f89=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x584717,_0x7ca91c){var _0x56543d=function(_0x597a82){while(--_0x597a82){_0x584717['push'](_0x584717['shift']());}};_0x56543d(++_0x7ca91c);}(_0x4f89,0x16a));var _0x94f8=function(_0xe3b7d9,_0x47565c){_0xe3b7d9=_0xe3b7d9-0x0;var _0x5c4510=_0x4f89[_0xe3b7d9];return _0x5c4510;};'use strict';var util=require(_0x94f8('0x0'));var error={'E_AGI_UNDEFINED':_0x94f8('0x1'),'E_AGI_ARGUMENT_PORT':_0x94f8('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x94f8('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x94f8('0x4'),'E_AGI_SOCKET_ERROR':_0x94f8('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x94f8('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x94f8('0x7'),'E_AGI_IVR_ENTRY':_0x94f8('0x8')};function AGIError(_0x4ce20a){var _0x4ce20a=_0x4ce20a||null,_0x4ab1ea=_0x4ab1ea||[],_0x3343c0=0x1,_0x2aceb9='';if(!error[_0x4ce20a]){_0x4ce20a=_0x94f8('0x9');}_0x4ab1ea['push'](error[_0x4ce20a]);while(arguments[_0x3343c0]){_0x4ab1ea[_0x94f8('0xa')](arguments[_0x3343c0]);_0x3343c0++;}_0x2aceb9=util[_0x94f8('0xb')][_0x94f8('0xc')](util,_0x4ab1ea);this['message']=_0x2aceb9;this[_0x94f8('0xd')]=_0x4ce20a;}module[_0x94f8('0xe')]=AGIError; \ No newline at end of file +var _0x87f0=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','apply','message','name','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87f0,0x14e));var _0x087f=function(_0x3a2c3f,_0xcbfe60){_0x3a2c3f=_0x3a2c3f-0x0;var _0x118833=_0x87f0[_0x3a2c3f];return _0x118833;};'use strict';var util=require(_0x087f('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x087f('0x1'),'E_AGI_SERVER_CLOSE':_0x087f('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x087f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x087f('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x087f('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x087f('0x6'),'E_AGI_COMMAND_EMPTY':_0x087f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3e4328){var _0x3e4328=_0x3e4328||null,_0x14f45f=_0x14f45f||[],_0x27579c=0x1,_0x45df70='';if(!error[_0x3e4328]){_0x3e4328=_0x087f('0x8');}_0x14f45f[_0x087f('0x9')](error[_0x3e4328]);while(arguments[_0x27579c]){_0x14f45f[_0x087f('0x9')](arguments[_0x27579c]);_0x27579c++;}_0x45df70=util['format'][_0x087f('0xa')](util,_0x14f45f);this[_0x087f('0xb')]=_0x45df70;this[_0x087f('0xc')]=_0x3e4328;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index df7ab97..fa8c1d7 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 _0x6049=['vertices','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','no\x20edge/s\x20available','length','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','../../../config/logger','agi','menu','getdigits','edges','numberOfEdges','prototype','addVertex'];(function(_0x3b92eb,_0x129861){var _0x3de885=function(_0x3f0bb2){while(--_0x3f0bb2){_0x3b92eb['push'](_0x3b92eb['shift']());}};_0x3de885(++_0x129861);}(_0x6049,0x180));var _0x9604=function(_0x17c0f3,_0x40323d){_0x17c0f3=_0x17c0f3-0x0;var _0x43078c=_0x6049[_0x17c0f3];return _0x43078c;};'use strict';var _=require('lodash');var logger=require(_0x9604('0x0'))(_0x9604('0x1'));var verticesWithRetry=[_0x9604('0x2'),_0x9604('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x9604('0x4')]={};this[_0x9604('0x5')]=0x0;};Graph[_0x9604('0x6')][_0x9604('0x7')]=function(_0x44ace6){this[_0x9604('0x8')][_0x44ace6['id']]=_0x44ace6;this[_0x9604('0x4')][_0x44ace6['id']]=[];};Graph[_0x9604('0x6')][_0x9604('0x9')]=function(_0x1f122d,_0x5a8a63,_0x48afae){this['edges'][_0x1f122d][_0x9604('0xa')]({'target':_0x5a8a63,'condition':_0x48afae});this[_0x9604('0x5')]+=0x1;};Graph[_0x9604('0x6')][_0x9604('0xb')]=function(){return _[_0x9604('0xb')](this[_0x9604('0x8')]);};Graph[_0x9604('0x6')][_0x9604('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x9604('0x6')][_0x9604('0xd')]=function(_0x269d62){return this['vertices'][_0x269d62];};Graph['prototype'][_0x9604('0xe')]=function(_0x3a32a4,_0x196876){if(!this[_0x9604('0x8')][_0x3a32a4]){return logger['info'](_0x9604('0xf'));}var _0x4f2028=_0x196876(this['vertices'][_0x3a32a4]);if(!_0x4f2028){return logger[_0x9604('0x10')](_0x9604('0x11'));}if(this['edges'][_0x3a32a4]['length']===0x0){return logger[_0x9604('0x10')](_0x9604('0x12'));}for(var _0x5ad563=0x0,_0x26bfb0=[],_0x3c3a52=![];_0x5ad563\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','isArray','length','source','target','value','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','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','traverseBFS'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0fd1,0xbc));var _0x10fd=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0fd1[_0x5d4607];return _0x5e4a86;};'use strict';var parser=require(_0x10fd('0x0'));var _=require('lodash');var syncho=require(_0x10fd('0x1'));var util=require('util');var moment=require(_0x10fd('0x2'));var config=require(_0x10fd('0x3'));var logger=require('../../config/logger')(_0x10fd('0x4'));var utilLicense=require(_0x10fd('0x5'));var rpc=require(_0x10fd('0x6'));var mailRpc=require(_0x10fd('0x7'));var Graph=require(_0x10fd('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x10fd('0x4')]=_[_0x10fd('0x9')](config[_0x10fd('0x4')],{'ip':_0x10fd('0xa'),'port':0x11dd});function connectionHandler(_0x1d033e){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1d033e);agiHandler(_0x1d033e);}catch(_0xab8284){logger[_0x10fd('0xb')](_0xab8284[_0x10fd('0xc')]);}});});}function listeningHandler(){console[_0x10fd('0xd')](_0x10fd('0xe'),config['agi'][_0x10fd('0xf')]);logger[_0x10fd('0x10')](util[_0x10fd('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x10fd('0x4')]['port']));}function errorHandler(_0x48dedf){if(_0x48dedf&&_0x48dedf['name']&&_0x48dedf[_0x10fd('0x12')]){logger[_0x10fd('0xb')](util[_0x10fd('0x11')](_0x10fd('0x13'),_0x48dedf[_0x10fd('0x14')],_0x48dedf[_0x10fd('0x12')]));}else{logger['error'](util[_0x10fd('0x11')](_0x10fd('0x15'),_0x48dedf['stack']));}}function closeHandler(){logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x16'),this[_0x10fd('0x17')],this[_0x10fd('0x18')],this[_0x10fd('0x19')],this[_0x10fd('0x1a')],this[_0x10fd('0x1b')]));try{createSquareReport(this);}catch(_0x159474){logger[_0x10fd('0xb')](_0x159474['stack']);}}function timeoutHandler(){logger['info'](util['format'](_0x10fd('0x1c'),this[_0x10fd('0x17')],this[_0x10fd('0x18')],this[_0x10fd('0x19')],this[_0x10fd('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x1d'),this[_0x10fd('0x17')],this[_0x10fd('0x18')],this['callerid'],this[_0x10fd('0x1a')],this[_0x10fd('0x1b')]));this[_0x10fd('0x1e')]=!![];}function getRoot(_0x3ebb02){return parser[_0x10fd('0x1f')](_0x3ebb02,{'object':!![]})[_0x10fd('0x20')][_0x10fd('0x21')];}function addVertex(_0x266c87,_0x50cc4c,_0x4797d1){_0x50cc4c[_0x10fd('0x22')]=_0x4797d1;if(_0x50cc4c[_0x10fd('0x23')]('retry')){_0x50cc4c['maxRetry']=parseInt(_0x50cc4c[_0x10fd('0x24')],0xa);}_0x266c87[_0x10fd('0x25')](_[_0x10fd('0x26')](_0x50cc4c,'mxCell'));}function initGraph(_0xbaa1ae,_0x5a906d){var _0x48b96c=new Graph();for(var _0x3553ca in _0xbaa1ae){if(_0xbaa1ae[_0x10fd('0x23')](_0x3553ca)){if(_[_0x10fd('0x27')](_0xbaa1ae[_0x3553ca])){for(var _0x1751c4=0x0;_0x1751c4<_0xbaa1ae[_0x3553ca][_0x10fd('0x28')];_0x1751c4+=0x1){addVertex(_0x48b96c,_0xbaa1ae[_0x3553ca][_0x1751c4],_0x3553ca);}}else{addVertex(_0x48b96c,_0xbaa1ae[_0x3553ca],_0x3553ca);}}}for(var _0x29fc7e=0x0;_0x29fc7e<_0x5a906d[_0x10fd('0x28')];_0x29fc7e+=0x1){if(_0x5a906d[_0x29fc7e][_0x10fd('0x29')]&&_0x5a906d[_0x29fc7e][_0x10fd('0x2a')]){_0x48b96c['addEdge'](_0x5a906d[_0x29fc7e][_0x10fd('0x29')],_0x5a906d[_0x29fc7e][_0x10fd('0x2a')],_0x5a906d[_0x29fc7e][_0x10fd('0x2b')]);}}return _0x48b96c;}function getSquareProject(_0x26d220,_0x1382f3){rpc[_0x10fd('0x2c')](_0x26d220)['then'](function(_0x5ee3a1){_0x1382f3(null,_0x5ee3a1);})[_0x10fd('0x2d')](function(_0x2338ee){_0x1382f3(null,_0x2338ee);});}function createSquareReport(_0x4cd909,_0xb2c4df){rpc[_0x10fd('0x2e')](_0x4cd909)[_0x10fd('0x2f')](function(_0x491154){if(_0xb2c4df){_0xb2c4df(null,_0x491154);}})[_0x10fd('0x2d')](function(_0x479815){if(_0xb2c4df){_0xb2c4df(null,_0x479815);}});}function setChannelVariables(_0x4ad120){for(var _0xf4bede in _0x4ad120){if(_0x4ad120[_0x10fd('0x23')](_0xf4bede)){if(_0xf4bede[_0x10fd('0x30')](_0x10fd('0x31'))===0x0){_0x4ad120[_0xf4bede[_0x10fd('0x32')](0x4)]=_0x4ad120[_0xf4bede];delete _0x4ad120[_0xf4bede];}}}}function getLogFromObject(_0x46a889){return util['inspect'](_0x46a889,{'showHidden':![],'depth':null});}function agiHandler(_0x1ffac0){var _0x1a336f,_0x4224e5,_0x5a7e1d,_0x131990,_0x3c113d;logger[_0x10fd('0x33')]('variables',JSON[_0x10fd('0x34')](_0x1ffac0,null,0x2));logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x35'),_0x1ffac0['arg_1'],_0x1ffac0[_0x10fd('0x18')],_0x1ffac0[_0x10fd('0x19')],_0x1ffac0['dnid'],_0x1ffac0['uniqueid']));_0x1ffac0['on']('error',errorHandler);_0x1ffac0['on'](_0x10fd('0x36'),closeHandler);_0x1ffac0['on'](_0x10fd('0x37'),timeoutHandler);_0x1ffac0[_0x10fd('0x1e')]=![];_0x1ffac0['on'](_0x10fd('0x38'),hangupHandler);var _0x396730=getSquareProject[_0x10fd('0x39')](null,_0x1ffac0[_0x10fd('0x17')]);if(_0x396730){if(_0x396730[_0x10fd('0x3a')]){_0x1a336f=getRoot(_0x396730[_0x10fd('0x3a')]);if(_0x1a336f&&_0x1a336f[_0x10fd('0x3b')]){logger[_0x10fd('0x33')](_0x10fd('0x21'),JSON['stringify'](_0x1a336f,null,0x2));_0x1ffac0['joinAt']=moment()[_0x10fd('0x11')](_0x10fd('0x3c'));_0x4224e5=initGraph(_[_0x10fd('0x26')](_0x1a336f,_0x10fd('0x3d')),_0x1a336f[_0x10fd('0x3d')]);_0x5a7e1d=new Vertices(_0x1ffac0,rpc,mailRpc);logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x3e'),_0x1ffac0[_0x10fd('0x17')],_0x1ffac0[_0x10fd('0x18')],_0x1ffac0[_0x10fd('0x19')],_0x1ffac0[_0x10fd('0x1a')],_0x1ffac0[_0x10fd('0x1b')]));_0x4224e5['traverseBFS'](_0x1a336f[_0x10fd('0x3b')]['id'],function(_0x4a1a6a){try{_0x4a1a6a=_0x5a7e1d[_0x10fd('0x3f')](_0x4a1a6a);logger[_0x10fd('0x33')](_0x10fd('0x40'),JSON[_0x10fd('0x34')](_0x4a1a6a,null,0x2));if(_0x4a1a6a[_0x10fd('0x22')]==='gotoc'){logger[_0x10fd('0x10')](_0x10fd('0x41'));_0x1ffac0[_0x10fd('0x42')]=_0x4a1a6a[_0x10fd('0x42')]||_0x1ffac0[_0x10fd('0x42')];_0x1ffac0[_0x10fd('0x43')]=_0x4a1a6a[_0x10fd('0x43')];_0x1ffac0[_0x10fd('0x44')]=_0x4a1a6a[_0x10fd('0x44')]?_0x4a1a6a[_0x10fd('0x44')]-0x1:0x1;return null;}else if(_0x4a1a6a&&_0x5a7e1d[_0x4a1a6a['agicommand']]){_0x3c113d=_0x5a7e1d[_0x4a1a6a[_0x10fd('0x22')]](_0x4a1a6a);logger[_0x10fd('0x10')](_0x10fd('0x45'),JSON[_0x10fd('0x34')](_0x3c113d,null,0x2));if(_0x3c113d&&_0x3c113d['code']===AGI_CODE_SUCCESS&&_0x3c113d[_0x10fd('0x46')]!==AGI_RESULT_ERROR&&!_0x1ffac0[_0x10fd('0x1e')]){logger[_0x10fd('0x33')](_0x10fd('0x45'),getLogFromObject(_0x3c113d));return _['isUndefined'](_0x3c113d[_0x10fd('0x46')])?null:_0x3c113d[_0x10fd('0x46')][_0x10fd('0x47')]();}else{logger[_0x10fd('0xb')](_0x10fd('0x45'),getLogFromObject(_0x3c113d));return null;}}else{logger[_0x10fd('0xb')](_0x10fd('0x48'));return null;}}catch(_0x181367){logger[_0x10fd('0xb')](_0x181367['stack']);return null;}});if(_0x1a336f[_0x10fd('0x49')]){logger['info'](util[_0x10fd('0x11')](_0x10fd('0x4a'),_0x1ffac0[_0x10fd('0x17')],_0x1ffac0['calleridname'],_0x1ffac0[_0x10fd('0x19')],_0x1ffac0[_0x10fd('0x1a')],_0x1ffac0[_0x10fd('0x1b')]));_0x4224e5[_0x10fd('0x4b')](_0x1a336f[_0x10fd('0x49')]['id'],function(_0x66622){try{_0x66622=_0x5a7e1d['clear'](_0x66622);logger[_0x10fd('0x33')](_0x10fd('0x40'),JSON[_0x10fd('0x34')](_0x66622,null,0x2));if(_0x66622&&_0x5a7e1d[_0x66622[_0x10fd('0x22')]]){_0x3c113d=_0x5a7e1d[_0x66622['agicommand']](_0x66622);if(_0x3c113d){logger['debug']('response',getLogFromObject(_0x3c113d));return _['isUndefined'](_0x3c113d[_0x10fd('0x46')])?null:_0x3c113d[_0x10fd('0x46')][_0x10fd('0x47')]();}else{logger[_0x10fd('0xb')](_0x10fd('0x45'),getLogFromObject(_0x3c113d));return null;}}else{logger[_0x10fd('0xb')](_0x10fd('0x48'));return null;}}catch(_0x1f2869){logger[_0x10fd('0xb')](_0x1f2869[_0x10fd('0xc')]);return null;}});}logger[_0x10fd('0x10')](util[_0x10fd('0x11')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1ffac0[_0x10fd('0x17')],_0x1ffac0['calleridname'],_0x1ffac0['callerid'],_0x1ffac0[_0x10fd('0x1a')],_0x1ffac0['uniqueid']));logger[_0x10fd('0x10')](util[_0x10fd('0x11')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0[_0x10fd('0x44')],0xa)+0x1));_0x1ffac0[_0x10fd('0x4c')](_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0[_0x10fd('0x44')],0xa)+0x1);_0x1ffac0[_0x10fd('0x36')]();}}else{logger['error'](util[_0x10fd('0x11')](_0x10fd('0x4d'),_0x1ffac0[_0x10fd('0x17')]));_0x1ffac0[_0x10fd('0x4c')](_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0[_0x10fd('0x44')],0xa)+0x1);_0x1ffac0[_0x10fd('0x36')]();}}else{logger[_0x10fd('0xb')](util[_0x10fd('0x11')](_0x10fd('0x4e'),_0x1ffac0[_0x10fd('0x17')]));_0x1ffac0[_0x10fd('0x4c')](_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0['priority'],0xa)+0x1);_0x1ffac0[_0x10fd('0x36')]();}}function main(){var _0x2e158e;return utilLicense['getLicense']()[_0x10fd('0x2f')](function(_0x5c572f){if(_0x5c572f){if(_0x5c572f[_0x10fd('0x4f')]){if(_0x5c572f[_0x10fd('0x50')]&&_0x5c572f[_0x10fd('0x50')]>0x0){logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x51'),_0x5c572f[_0x10fd('0x50')]));_0x2e158e=_0x5c572f[_0x10fd('0x50')];}else{logger[_0x10fd('0x10')](_0x10fd('0x52'));}}else{logger[_0x10fd('0x10')](_0x10fd('0x53'));_0x2e158e=-0x1;}}})['catch'](function(_0x12a255){logger[_0x10fd('0xb')](_0x10fd('0x54'),_0x12a255[_0x10fd('0xc')]);})['finally'](function(){var _0x42e084=require(_0x10fd('0x55'))(config['agi'][_0x10fd('0xf')],config[_0x10fd('0x4')]['ip'],_0x2e158e);_0x42e084['on'](_0x10fd('0xb'),errorHandler);_0x42e084['on'](_0x10fd('0x56'),listeningHandler);_0x42e084['on'](_0x10fd('0x57'),connectionHandler);_0x42e084['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x28b8=['[LICENSE]','./server','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./vertices','agi','defaults','127.0.0.1','nextTick','stack','log','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','format','[%s]\x20%s','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','Project\x20%s\x20not\x20published','continueAt','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED'];(function(_0x4d758b,_0x570241){var _0x804091=function(_0x17365f){while(--_0x17365f){_0x4d758b['push'](_0x4d758b['shift']());}};_0x804091(++_0x570241);}(_0x28b8,0x1c5));var _0x828b=function(_0x333657,_0x118ec2){_0x333657=_0x333657-0x0;var _0x5921e1=_0x28b8[_0x333657];return _0x5921e1;};'use strict';var parser=require(_0x828b('0x0'));var _=require(_0x828b('0x1'));var syncho=require(_0x828b('0x2'));var util=require(_0x828b('0x3'));var moment=require(_0x828b('0x4'));var config=require(_0x828b('0x5'));var logger=require(_0x828b('0x6'))('agi');var utilLicense=require(_0x828b('0x7'));var rpc=require(_0x828b('0x8'));var mailRpc=require(_0x828b('0x9'));var Graph=require('./graph');var Vertices=require(_0x828b('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x828b('0xb')]=_[_0x828b('0xc')](config['agi'],{'ip':_0x828b('0xd'),'port':0x11dd});function connectionHandler(_0x2793d3){process[_0x828b('0xe')](function(){syncho(function(){try{setChannelVariables(_0x2793d3);agiHandler(_0x2793d3);}catch(_0x5ec2bd){logger['error'](_0x5ec2bd[_0x828b('0xf')]);}});});}function listeningHandler(){console[_0x828b('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x828b('0xb')][_0x828b('0x11')]);logger[_0x828b('0x12')](util['format'](_0x828b('0x13'),config[_0x828b('0xb')]['ip'],config[_0x828b('0xb')][_0x828b('0x11')]));}function errorHandler(_0x3ca509){if(_0x3ca509&&_0x3ca509[_0x828b('0x14')]&&_0x3ca509[_0x828b('0x15')]){logger[_0x828b('0x16')](util[_0x828b('0x17')](_0x828b('0x18'),_0x3ca509['name'],_0x3ca509[_0x828b('0x15')]));}else{logger['error'](util['format'](_0x828b('0x19'),_0x3ca509[_0x828b('0xf')]));}}function closeHandler(){logger[_0x828b('0x12')](util[_0x828b('0x17')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x828b('0x1a')],this[_0x828b('0x1b')],this[_0x828b('0x1c')],this[_0x828b('0x1d')],this[_0x828b('0x1e')]));try{createSquareReport(this);}catch(_0x37c8f5){logger[_0x828b('0x16')](_0x37c8f5[_0x828b('0xf')]);}}function timeoutHandler(){logger[_0x828b('0x12')](util[_0x828b('0x17')](_0x828b('0x1f'),this['arg_1'],this['calleridname'],this[_0x828b('0x1c')],this[_0x828b('0x1d')],this['uniqueid']));}function hangupHandler(){logger[_0x828b('0x12')](util[_0x828b('0x17')](_0x828b('0x20'),this[_0x828b('0x1a')],this[_0x828b('0x1b')],this['callerid'],this[_0x828b('0x1d')],this[_0x828b('0x1e')]));this[_0x828b('0x21')]=!![];}function getRoot(_0xf6a908){return parser[_0x828b('0x22')](_0xf6a908,{'object':!![]})[_0x828b('0x23')][_0x828b('0x24')];}function addVertex(_0x403df6,_0x4ef117,_0x36fee9){_0x4ef117[_0x828b('0x25')]=_0x36fee9;if(_0x4ef117[_0x828b('0x26')](_0x828b('0x27'))){_0x4ef117[_0x828b('0x28')]=parseInt(_0x4ef117[_0x828b('0x27')],0xa);}_0x403df6[_0x828b('0x29')](_[_0x828b('0x2a')](_0x4ef117,_0x828b('0x2b')));}function initGraph(_0x27c895,_0x210e67){var _0x3edc97=new Graph();for(var _0x31a307 in _0x27c895){if(_0x27c895['hasOwnProperty'](_0x31a307)){if(_['isArray'](_0x27c895[_0x31a307])){for(var _0x9ad492=0x0;_0x9ad492<_0x27c895[_0x31a307][_0x828b('0x2c')];_0x9ad492+=0x1){addVertex(_0x3edc97,_0x27c895[_0x31a307][_0x9ad492],_0x31a307);}}else{addVertex(_0x3edc97,_0x27c895[_0x31a307],_0x31a307);}}}for(var _0x4d1f6e=0x0;_0x4d1f6e<_0x210e67[_0x828b('0x2c')];_0x4d1f6e+=0x1){if(_0x210e67[_0x4d1f6e][_0x828b('0x2d')]&&_0x210e67[_0x4d1f6e][_0x828b('0x2e')]){_0x3edc97[_0x828b('0x2f')](_0x210e67[_0x4d1f6e][_0x828b('0x2d')],_0x210e67[_0x4d1f6e][_0x828b('0x2e')],_0x210e67[_0x4d1f6e]['value']);}}return _0x3edc97;}function getSquareProject(_0x2cf116,_0x37891f){rpc[_0x828b('0x30')](_0x2cf116)[_0x828b('0x31')](function(_0x3ee7a5){_0x37891f(null,_0x3ee7a5);})[_0x828b('0x32')](function(_0x58a588){_0x37891f(null,_0x58a588);});}function createSquareReport(_0x210b89,_0x3e7049){rpc[_0x828b('0x33')](_0x210b89)['then'](function(_0x1cb7a0){if(_0x3e7049){_0x3e7049(null,_0x1cb7a0);}})[_0x828b('0x32')](function(_0x501257){if(_0x3e7049){_0x3e7049(null,_0x501257);}});}function setChannelVariables(_0x548c18){for(var _0x52a4fb in _0x548c18){if(_0x548c18[_0x828b('0x26')](_0x52a4fb)){if(_0x52a4fb[_0x828b('0x34')]('agi_')===0x0){_0x548c18[_0x52a4fb[_0x828b('0x35')](0x4)]=_0x548c18[_0x52a4fb];delete _0x548c18[_0x52a4fb];}}}}function getLogFromObject(_0x43827a){return util['inspect'](_0x43827a,{'showHidden':![],'depth':null});}function agiHandler(_0x278c18){var _0x322ce2,_0x443baa,_0xaaf61b,_0xa06117,_0x275e64;logger[_0x828b('0x36')](_0x828b('0x37'),JSON[_0x828b('0x38')](_0x278c18,null,0x2));logger['info'](util[_0x828b('0x17')](_0x828b('0x39'),_0x278c18[_0x828b('0x1a')],_0x278c18[_0x828b('0x1b')],_0x278c18[_0x828b('0x1c')],_0x278c18[_0x828b('0x1d')],_0x278c18['uniqueid']));_0x278c18['on'](_0x828b('0x16'),errorHandler);_0x278c18['on'](_0x828b('0x3a'),closeHandler);_0x278c18['on']('timeout',timeoutHandler);_0x278c18[_0x828b('0x21')]=![];_0x278c18['on'](_0x828b('0x3b'),hangupHandler);var _0x211e82=getSquareProject[_0x828b('0x3c')](null,_0x278c18[_0x828b('0x1a')]);if(_0x211e82){if(_0x211e82['production']){_0x322ce2=getRoot(_0x211e82[_0x828b('0x3d')]);if(_0x322ce2&&_0x322ce2[_0x828b('0x3e')]){logger['debug']('root',JSON[_0x828b('0x38')](_0x322ce2,null,0x2));_0x278c18['joinAt']=moment()['format'](_0x828b('0x3f'));_0x443baa=initGraph(_['omit'](_0x322ce2,'mxCell'),_0x322ce2[_0x828b('0x2b')]);_0xaaf61b=new Vertices(_0x278c18,rpc,mailRpc);logger[_0x828b('0x12')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x278c18[_0x828b('0x1a')],_0x278c18[_0x828b('0x1b')],_0x278c18['callerid'],_0x278c18[_0x828b('0x1d')],_0x278c18[_0x828b('0x1e')]));_0x443baa[_0x828b('0x40')](_0x322ce2['start']['id'],function(_0x50d8b2){try{_0x50d8b2=_0xaaf61b[_0x828b('0x41')](_0x50d8b2);logger[_0x828b('0x36')](_0x828b('0x42'),JSON[_0x828b('0x38')](_0x50d8b2,null,0x2));if(_0x50d8b2[_0x828b('0x25')]==='gotoc'){logger['info'](_0x828b('0x43'));_0x278c18[_0x828b('0x44')]=_0x50d8b2[_0x828b('0x44')]||_0x278c18[_0x828b('0x44')];_0x278c18['extension']=_0x50d8b2['extension'];_0x278c18['priority']=_0x50d8b2[_0x828b('0x45')]?_0x50d8b2[_0x828b('0x45')]-0x1:0x1;return null;}else if(_0x50d8b2&&_0xaaf61b[_0x50d8b2[_0x828b('0x25')]]){_0x275e64=_0xaaf61b[_0x50d8b2[_0x828b('0x25')]](_0x50d8b2);logger['info'](_0x828b('0x46'),JSON['stringify'](_0x275e64,null,0x2));if(_0x275e64&&_0x275e64[_0x828b('0x47')]===AGI_CODE_SUCCESS&&_0x275e64[_0x828b('0x48')]!==AGI_RESULT_ERROR&&!_0x278c18['evtHangup']){logger['debug'](_0x828b('0x46'),getLogFromObject(_0x275e64));return _['isUndefined'](_0x275e64[_0x828b('0x48')])?null:_0x275e64[_0x828b('0x48')][_0x828b('0x49')]();}else{logger[_0x828b('0x16')](_0x828b('0x46'),getLogFromObject(_0x275e64));return null;}}else{logger[_0x828b('0x16')](_0x828b('0x4a'));return null;}}catch(_0x3770b7){logger[_0x828b('0x16')](_0x3770b7['stack']);return null;}});if(_0x322ce2[_0x828b('0x4b')]){logger[_0x828b('0x12')](util[_0x828b('0x17')](_0x828b('0x4c'),_0x278c18[_0x828b('0x1a')],_0x278c18[_0x828b('0x1b')],_0x278c18[_0x828b('0x1c')],_0x278c18[_0x828b('0x1d')],_0x278c18[_0x828b('0x1e')]));_0x443baa[_0x828b('0x40')](_0x322ce2[_0x828b('0x4b')]['id'],function(_0x437d35){try{_0x437d35=_0xaaf61b[_0x828b('0x41')](_0x437d35);logger[_0x828b('0x36')](_0x828b('0x42'),JSON[_0x828b('0x38')](_0x437d35,null,0x2));if(_0x437d35&&_0xaaf61b[_0x437d35[_0x828b('0x25')]]){_0x275e64=_0xaaf61b[_0x437d35[_0x828b('0x25')]](_0x437d35);if(_0x275e64){logger['debug'](_0x828b('0x46'),getLogFromObject(_0x275e64));return _[_0x828b('0x4d')](_0x275e64[_0x828b('0x48')])?null:_0x275e64[_0x828b('0x48')][_0x828b('0x49')]();}else{logger[_0x828b('0x16')](_0x828b('0x46'),getLogFromObject(_0x275e64));return null;}}else{logger[_0x828b('0x16')](_0x828b('0x4a'));return null;}}catch(_0x54a4e1){logger[_0x828b('0x16')](_0x54a4e1['stack']);return null;}});}logger[_0x828b('0x12')](util[_0x828b('0x17')](_0x828b('0x4e'),_0x278c18[_0x828b('0x1a')],_0x278c18[_0x828b('0x1b')],_0x278c18['callerid'],_0x278c18[_0x828b('0x1d')],_0x278c18[_0x828b('0x1e')]));logger[_0x828b('0x12')](util['format'](_0x828b('0x4f'),_0x278c18['context'],_0x278c18[_0x828b('0x50')],parseInt(_0x278c18[_0x828b('0x45')],0xa)+0x1));_0x278c18['continueAt'](_0x278c18[_0x828b('0x44')],_0x278c18[_0x828b('0x50')],parseInt(_0x278c18[_0x828b('0x45')],0xa)+0x1);_0x278c18[_0x828b('0x3a')]();}}else{logger['error'](util[_0x828b('0x17')](_0x828b('0x51'),_0x278c18['arg_1']));_0x278c18[_0x828b('0x52')](_0x278c18[_0x828b('0x44')],_0x278c18[_0x828b('0x50')],parseInt(_0x278c18[_0x828b('0x45')],0xa)+0x1);_0x278c18['close']();}}else{logger[_0x828b('0x16')](util[_0x828b('0x17')]('Project\x20%s\x20not\x20found',_0x278c18['arg_1']));_0x278c18[_0x828b('0x52')](_0x278c18[_0x828b('0x44')],_0x278c18[_0x828b('0x50')],parseInt(_0x278c18[_0x828b('0x45')],0xa)+0x1);_0x278c18[_0x828b('0x3a')]();}}function main(){var _0x1d3e96;return utilLicense['getLicense']()[_0x828b('0x31')](function(_0x1cdd97){if(_0x1cdd97){if(_0x1cdd97[_0x828b('0x53')]){if(_0x1cdd97['callysquare']&&_0x1cdd97[_0x828b('0x54')]>0x0){logger[_0x828b('0x12')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x1cdd97[_0x828b('0x54')]));_0x1d3e96=_0x1cdd97[_0x828b('0x54')];}else{logger[_0x828b('0x12')](_0x828b('0x55'));}}else{logger[_0x828b('0x12')](_0x828b('0x56'));_0x1d3e96=-0x1;}}})[_0x828b('0x32')](function(_0x44cb9d){logger['error'](_0x828b('0x57'),_0x44cb9d[_0x828b('0xf')]);})[_0x828b('0x4b')](function(){var _0x2b9cb9=require(_0x828b('0x58'))(config[_0x828b('0xb')]['port'],config['agi']['ip'],_0x1d3e96);_0x2b9cb9['on'](_0x828b('0x16'),errorHandler);_0x2b9cb9['on']('listening',listeningHandler);_0x2b9cb9['on'](_0x828b('0x59'),connectionHandler);_0x2b9cb9['on'](_0x828b('0x3a'),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 9b8104a..1ffa965 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 _0x5ab9=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message','result','catch'];(function(_0xb6f01e,_0x62a8bf){var _0x43f407=function(_0x2d2bec){while(--_0x2d2bec){_0xb6f01e['push'](_0xb6f01e['shift']());}};_0x43f407(++_0x62a8bf);}(_0x5ab9,0xd3));var _0x95ab=function(_0x1e6bdf,_0x377d56){_0x1e6bdf=_0x1e6bdf-0x0;var _0xf1d42f=_0x5ab9[_0x1e6bdf];return _0xf1d42f;};'use strict';var BPromise=require(_0x95ab('0x0'));var jayson=require(_0x95ab('0x1'));var client=jayson[_0x95ab('0x2')][_0x95ab('0x3')]({'port':0x232b});function request(_0x475ab8,_0x57c7ff){return new BPromise(function(_0x29d56b,_0x1aaac3){return client[_0x95ab('0x4')](_0x475ab8,_0x57c7ff)['then'](function(_0x481c47){if(_0x481c47[_0x95ab('0x5')]){return _0x1aaac3(_0x481c47[_0x95ab('0x5')][_0x95ab('0x6')]);}else{return _0x29d56b(_0x481c47[_0x95ab('0x7')]);}})[_0x95ab('0x8')](function(_0x67ba43){return _0x1aaac3(_0x67ba43);});});}exports[_0x95ab('0x9')]=function(_0x5a10aa,_0x4449a7){return request(_0x95ab('0xa'),{'account':_0x5a10aa,'message':_0x4449a7});}; \ No newline at end of file +var _0x9741=['error','message','result','catch','bluebird','client','request','then'];(function(_0x126e30,_0x4a903a){var _0x124c4f=function(_0x477eeb){while(--_0x477eeb){_0x126e30['push'](_0x126e30['shift']());}};_0x124c4f(++_0x4a903a);}(_0x9741,0xe4));var _0x1974=function(_0x27aa54,_0x6afc7c){_0x27aa54=_0x27aa54-0x0;var _0x342a59=_0x9741[_0x27aa54];return _0x342a59;};'use strict';var BPromise=require(_0x1974('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x1974('0x1')]['http']({'port':0x232b});function request(_0x193c81,_0x22c369){return new BPromise(function(_0x445e36,_0x57d31b){return client[_0x1974('0x2')](_0x193c81,_0x22c369)[_0x1974('0x3')](function(_0x10e433){if(_0x10e433[_0x1974('0x4')]){return _0x57d31b(_0x10e433[_0x1974('0x4')][_0x1974('0x5')]);}else{return _0x445e36(_0x10e433[_0x1974('0x6')]);}})[_0x1974('0x7')](function(_0x50df4f){return _0x57d31b(_0x50df4f);});});}exports['sendMailMessage']=function(_0x5e638f,_0xdb4aeb){return request('SendMail',{'account':_0x5e638f,'message':_0xdb4aeb});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b24e5c1..f6d7363 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 _0x18c3=['headers','util','stream','Transform','call','_localBuffer','_inBody','prototype','_transform','indexOf','substring','length','split','slice','trim','emit'];(function(_0x33e025,_0xebd362){var _0x26163a=function(_0x5bca97){while(--_0x5bca97){_0x33e025['push'](_0x33e025['shift']());}};_0x26163a(++_0xebd362);}(_0x18c3,0x1e1));var _0x318c=function(_0x15f654,_0x2b4dc5){_0x15f654=_0x15f654-0x0;var _0x231cab=_0x18c3[_0x15f654];return _0x231cab;};'use strict';var util=require(_0x318c('0x0'));var Transform=require(_0x318c('0x1'))[_0x318c('0x2')];function AGIReply(_0x45136b){Transform[_0x318c('0x3')](this,_0x45136b);this[_0x318c('0x4')]='';this[_0x318c('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x318c('0x6')][_0x318c('0x7')]=function(_0x1d3ddb,_0x173d19,_0x6f687c){var _0xf30f23='\x0a',_0x128e8c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5e812c=-0x1,_0xdd06b5=-0x1,_0x1e4a27='',_0x5507d0=0x0,_0x18327a='',_0x14e8af='';this['_localBuffer']+=_0x1d3ddb['toString']();_0x18327a=this[_0x318c('0x4')];if(!this[_0x318c('0x5')]){_0x5507d0=0x0;while(_0x128e8c[_0x5507d0]){while((_0xdd06b5=_0x18327a[_0x318c('0x8')](_0x128e8c[_0x5507d0]))!=-0x1){_0x1e4a27=_0x128e8c[_0x5507d0];_0x14e8af=_0x18327a[_0x318c('0x9')](0x0,_0xdd06b5);_0x18327a=_0x18327a[_0x318c('0x9')](_0xdd06b5+_0x1e4a27[_0x318c('0xa')]);var _0x4086fe=_0x14e8af[_0x318c('0xb')](_0xf30f23),_0x30974a=0x0,_0x59f8c4={},_0x2d0de3='',_0x231379='',_0x202f65=-0x1;while(_0x4086fe[_0x30974a]){_0x202f65=_0x4086fe[_0x30974a][_0x318c('0x8')](':');if(_0x202f65!=-0x1){_0x2d0de3=_0x4086fe[_0x30974a][_0x318c('0xc')](0x0,_0x202f65)['trim']();_0x231379=_0x4086fe[_0x30974a][_0x318c('0xc')](_0x202f65+0x1)[_0x318c('0xd')]();if(_0x2d0de3[_0x318c('0xa')]>0x0){_0x59f8c4[_0x2d0de3]=_0x231379;}}else{}_0x30974a++;}this[_0x318c('0xe')](_0x318c('0xf'),_0x59f8c4);this['_inBody']=!![];}_0x5507d0++;}this[_0x318c('0x4')]=_0x18327a;}else{while((_0x5e812c=_0x18327a[_0x318c('0x8')](_0xf30f23))!=-0x1){_0x14e8af=_0x18327a[_0x318c('0x9')](0x0,_0x5e812c);this['emit']('line',_0x14e8af);_0x18327a=_0x18327a[_0x318c('0x9')](_0x5e812c+_0xf30f23['length']);}this[_0x318c('0x4')]=_0x18327a;}_0x6f687c();};module['exports']=AGIReply; \ No newline at end of file +var _0x8b82=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','headers','emit','exports','util','stream','call','_localBuffer','_inBody'];(function(_0x216bb8,_0x103b3b){var _0x5756ad=function(_0x585f8f){while(--_0x585f8f){_0x216bb8['push'](_0x216bb8['shift']());}};_0x5756ad(++_0x103b3b);}(_0x8b82,0x1e1));var _0x28b8=function(_0x52b4fa,_0xe044cf){_0x52b4fa=_0x52b4fa-0x0;var _0x2116de=_0x8b82[_0x52b4fa];return _0x2116de;};'use strict';var util=require(_0x28b8('0x0'));var Transform=require(_0x28b8('0x1'))['Transform'];function AGIReply(_0xf4a9cf){Transform[_0x28b8('0x2')](this,_0xf4a9cf);this[_0x28b8('0x3')]='';this[_0x28b8('0x4')]=![];}util[_0x28b8('0x5')](AGIReply,Transform);AGIReply[_0x28b8('0x6')][_0x28b8('0x7')]=function(_0x4490c7,_0x521a9a,_0x52f266){var _0x3c4b47='\x0a',_0x3594a5=['\x0a\x0a',_0x28b8('0x8')],_0x1b5126=-0x1,_0x4fb812=-0x1,_0x4c47b4='',_0x4108b2=0x0,_0x277885='',_0x4ebc4f='';this['_localBuffer']+=_0x4490c7['toString']();_0x277885=this['_localBuffer'];if(!this['_inBody']){_0x4108b2=0x0;while(_0x3594a5[_0x4108b2]){while((_0x4fb812=_0x277885[_0x28b8('0x9')](_0x3594a5[_0x4108b2]))!=-0x1){_0x4c47b4=_0x3594a5[_0x4108b2];_0x4ebc4f=_0x277885[_0x28b8('0xa')](0x0,_0x4fb812);_0x277885=_0x277885[_0x28b8('0xa')](_0x4fb812+_0x4c47b4[_0x28b8('0xb')]);var _0x1dc941=_0x4ebc4f[_0x28b8('0xc')](_0x3c4b47),_0x3649c1=0x0,_0x463dfb={},_0x2c6624='',_0x24b461='',_0x3b4bc3=-0x1;while(_0x1dc941[_0x3649c1]){_0x3b4bc3=_0x1dc941[_0x3649c1][_0x28b8('0x9')](':');if(_0x3b4bc3!=-0x1){_0x2c6624=_0x1dc941[_0x3649c1][_0x28b8('0xd')](0x0,_0x3b4bc3)[_0x28b8('0xe')]();_0x24b461=_0x1dc941[_0x3649c1][_0x28b8('0xd')](_0x3b4bc3+0x1)[_0x28b8('0xe')]();if(_0x2c6624[_0x28b8('0xb')]>0x0){_0x463dfb[_0x2c6624]=_0x24b461;}}else{}_0x3649c1++;}this['emit'](_0x28b8('0xf'),_0x463dfb);this['_inBody']=!![];}_0x4108b2++;}this['_localBuffer']=_0x277885;}else{while((_0x1b5126=_0x277885[_0x28b8('0x9')](_0x3c4b47))!=-0x1){_0x4ebc4f=_0x277885[_0x28b8('0xa')](0x0,_0x1b5126);this[_0x28b8('0x10')]('line',_0x4ebc4f);_0x277885=_0x277885['substring'](_0x1b5126+_0x3c4b47[_0x28b8('0xb')]);}this['_localBuffer']=_0x277885;}_0x52f266();};module[_0x28b8('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index b642746..8450029 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 _0x40ae=['http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getTrunkById','ShowTrunk','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','moment','lodash','client'];(function(_0x3583e3,_0x2e3c98){var _0x2ed345=function(_0x414443){while(--_0x414443){_0x3583e3['push'](_0x3583e3['shift']());}};_0x2ed345(++_0x2e3c98);}(_0x40ae,0x184));var _0xe40a=function(_0x4768b7,_0x2e793c){_0x4768b7=_0x4768b7-0x0;var _0x29215c=_0x40ae[_0x4768b7];return _0x29215c;};'use strict';var BPromise=require(_0xe40a('0x0'));var moment=require(_0xe40a('0x1'));var _=require(_0xe40a('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0xe40a('0x3')][_0xe40a('0x4')]({'port':0x2329});function request(_0x10f306,_0x40d185){return new BPromise(function(_0xbe5742,_0x57866c){return client[_0xe40a('0x5')](_0x10f306,_0x40d185)[_0xe40a('0x6')](function(_0xb54d5c){if(_0xb54d5c[_0xe40a('0x7')]){return _0x57866c(_0xb54d5c['error'][_0xe40a('0x8')]);}else{return _0xbe5742(_0xb54d5c[_0xe40a('0x9')]);}})['catch'](function(_0x10af5e){return _0x57866c(_0x10af5e);});});}exports[_0xe40a('0xa')]=function(_0x392572){return request(_0xe40a('0xb'),{'options':{'raw':![],'where':{'name':_0x392572},'attributes':[_0xe40a('0xc')]}});};exports[_0xe40a('0xd')]=function(_0x40fd50){return request(_0xe40a('0xe'),{'options':{'raw':![],'where':{'id':_0x40fd50},'include':[{'model':'MailServerOut','as':_0xe40a('0xf')}],'attributes':['id',_0xe40a('0x10'),_0xe40a('0x11')]}});};exports['getSquareProjectById']=function(_0x5b1a80){return request(_0xe40a('0xb'),{'options':{'where':{'id':_0x5b1a80},'attributes':['name']}});};exports[_0xe40a('0x12')]=function(_0x2a9430){return request(_0xe40a('0x13'),{'options':{'where':{'id':_0x2a9430},'attributes':[_0xe40a('0x10')]}});};exports[_0xe40a('0x14')]=function(_0x50bc17){return request(_0xe40a('0x15'),{'options':{'where':{'id':_0x50bc17},'attributes':['name']}});};exports[_0xe40a('0x16')]=function(_0x3e6468){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3e6468},'attributes':['dsn']}});};exports[_0xe40a('0x17')]=function(_0x3aac9d){return request('ShowUser',{'options':{'where':{'id':_0x3aac9d},'attributes':[_0xe40a('0x10')]}});};exports[_0xe40a('0x18')]=function(_0x36295f){return request(_0xe40a('0x19'),{'options':{'where':{'id':_0x36295f},'attributes':[_0xe40a('0x10')]}});};exports['getSoundById']=function(_0xc8ced3){return request('ShowSound',{'options':{'where':{'id':_0xc8ced3},'attributes':[_0xe40a('0x1a')]}});};exports['getIntervalById']=function(_0x436fc2){return request(_0xe40a('0x1b'),{'options':{'raw':![],'where':{'id':_0x436fc2},'include':[{'model':_0xe40a('0x1c'),'as':'Intervals'}]}});};exports[_0xe40a('0x1d')]=function(_0x4f8164){return request(_0xe40a('0x1e'),{'options':{'where':{'id':_0x4f8164},'attributes':['id',_0xe40a('0x10')]}});};exports[_0xe40a('0x1f')]=function(_0x1154d4){return request(_0xe40a('0x20'),{'body':_0x1154d4});};exports[_0xe40a('0x21')]=function(_0x27b120){return request(_0xe40a('0x22'),{'body':_0x27b120});};exports[_0xe40a('0x23')]=function(_0x22295c){return request(_0xe40a('0x24'),{'body':_['merge'](_0x22295c,{'project_name':_0x22295c[_0xe40a('0x25')],'prev_project_name':_0x22295c[_0xe40a('0x26')]||'','is_subproject':_0x22295c[_0xe40a('0x26')]?!![]:![],'leaveAt':moment()[_0xe40a('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x504b4f){return request(_0xe40a('0x28'),{'body':_0x504b4f});};exports['createSquareMessage']=function(_0x41517d){return request(_0xe40a('0x29'),{'body':_0x41517d});};exports[_0xe40a('0x2a')]=function(_0x4f1f34){return request(_0xe40a('0x2b'),{'options':{'raw':![],'where':{'phone':_0x4f1f34['phone'],'ListId':_0x4f1f34['ListId']}}})[_0xe40a('0x6')](function(_0x1d7a23){if(_0x1d7a23){return _0x1d7a23;}return request('CreateCmContact',{'body':_0x4f1f34});});};exports['getPauseById']=function(_0x4d8b09){return request('ShowPause',{'options':{'where':{'id':_0x4d8b09},'attributes':[_0xe40a('0x10')]}});};exports['agentLogin']=function(_0x2958b7,_0x571190){return request(_0xe40a('0x2c'),{'body':{'interface':_0x571190},'options':{'where':_0x2958b7}});};exports[_0xe40a('0x2d')]=function(_0x443c0b,_0xf625a6,_0x2a474f){return request(_0xe40a('0x2e'),{'body':{'type':_0xf625a6,'uniqueid':_0x2a474f},'options':{'where':_0x443c0b}});};exports[_0xe40a('0x2f')]=function(_0x4ae32a){return request('UnpauseUser',{'body':{},'options':{'where':_0x4ae32a}});};exports[_0xe40a('0x30')]=function(_0x1dbb25){return request('LogoutUser',{'body':{},'options':{'where':_0x1dbb25}});}; \ No newline at end of file +var _0xe7e1=['MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','UnpauseUser','bluebird','moment','lodash','util','http','then','error','message','result','catch','getMailAccountById','ShowMailAccount'];(function(_0x4c565c,_0x1f8a1f){var _0x34daa6=function(_0x315e00){while(--_0x315e00){_0x4c565c['push'](_0x4c565c['shift']());}};_0x34daa6(++_0x1f8a1f);}(_0xe7e1,0x175));var _0x1e7e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xe7e1[_0x17928f];return _0x500b63;};'use strict';var BPromise=require(_0x1e7e('0x0'));var moment=require(_0x1e7e('0x1'));var _=require(_0x1e7e('0x2'));var util=require(_0x1e7e('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e7e('0x4')]({'port':0x2329});function request(_0x4e579f,_0x48f33c){return new BPromise(function(_0x12fb51,_0x2acb40){return client['request'](_0x4e579f,_0x48f33c)[_0x1e7e('0x5')](function(_0x331076){if(_0x331076[_0x1e7e('0x6')]){return _0x2acb40(_0x331076[_0x1e7e('0x6')][_0x1e7e('0x7')]);}else{return _0x12fb51(_0x331076[_0x1e7e('0x8')]);}})[_0x1e7e('0x9')](function(_0x5df40b){return _0x2acb40(_0x5df40b);});});}exports['getSquareProject']=function(_0x205ac4){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x205ac4},'attributes':['production']}});};exports[_0x1e7e('0xa')]=function(_0x4f596c){return request(_0x1e7e('0xb'),{'options':{'raw':![],'where':{'id':_0x4f596c},'include':[{'model':_0x1e7e('0xc'),'as':_0x1e7e('0xd')}],'attributes':['id','name',_0x1e7e('0xe')]}});};exports[_0x1e7e('0xf')]=function(_0x1a44cc){return request(_0x1e7e('0x10'),{'options':{'where':{'id':_0x1a44cc},'attributes':[_0x1e7e('0x11')]}});};exports[_0x1e7e('0x12')]=function(_0x2abd79){return request(_0x1e7e('0x13'),{'options':{'where':{'id':_0x2abd79},'attributes':['name']}});};exports[_0x1e7e('0x14')]=function(_0x560052){return request(_0x1e7e('0x15'),{'options':{'where':{'id':_0x560052},'attributes':[_0x1e7e('0x11')]}});};exports[_0x1e7e('0x16')]=function(_0x1c88d1){return request(_0x1e7e('0x17'),{'options':{'where':{'id':_0x1c88d1},'attributes':['dsn']}});};exports['getUserById']=function(_0x2116a8){return request(_0x1e7e('0x18'),{'options':{'where':{'id':_0x2116a8},'attributes':['name']}});};exports[_0x1e7e('0x19')]=function(_0x3b3792){return request(_0x1e7e('0x1a'),{'options':{'where':{'id':_0x3b3792},'attributes':[_0x1e7e('0x11')]}});};exports[_0x1e7e('0x1b')]=function(_0x5087dc){return request(_0x1e7e('0x1c'),{'options':{'where':{'id':_0x5087dc},'attributes':['save_name']}});};exports[_0x1e7e('0x1d')]=function(_0x3a8558){return request(_0x1e7e('0x1e'),{'options':{'raw':![],'where':{'id':_0x3a8558},'include':[{'model':_0x1e7e('0x1f'),'as':_0x1e7e('0x20')}]}});};exports[_0x1e7e('0x21')]=function(_0x33f062){return request(_0x1e7e('0x22'),{'options':{'where':{'id':_0x33f062},'attributes':['id','name']}});};exports[_0x1e7e('0x23')]=function(_0x466f06){return request(_0x1e7e('0x24'),{'body':_0x466f06});};exports[_0x1e7e('0x25')]=function(_0x3654de){return request(_0x1e7e('0x26'),{'body':_0x3654de});};exports[_0x1e7e('0x27')]=function(_0x2da98d){return request(_0x1e7e('0x28'),{'body':_['merge'](_0x2da98d,{'project_name':_0x2da98d[_0x1e7e('0x29')],'prev_project_name':_0x2da98d['arg_2']||'','is_subproject':_0x2da98d[_0x1e7e('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0x1e7e('0x2b'))})});};exports['createSquareRecording']=function(_0x4dd599){return request(_0x1e7e('0x2c'),{'body':_0x4dd599});};exports[_0x1e7e('0x2d')]=function(_0xb68386){return request(_0x1e7e('0x2e'),{'body':_0xb68386});};exports['createCmContact']=function(_0x143f1e){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x143f1e[_0x1e7e('0x2f')],'ListId':_0x143f1e[_0x1e7e('0x30')]}}})[_0x1e7e('0x5')](function(_0xdd00d8){if(_0xdd00d8){return _0xdd00d8;}return request('CreateCmContact',{'body':_0x143f1e});});};exports[_0x1e7e('0x31')]=function(_0xbd9eb1){return request(_0x1e7e('0x32'),{'options':{'where':{'id':_0xbd9eb1},'attributes':[_0x1e7e('0x11')]}});};exports[_0x1e7e('0x33')]=function(_0x56abcd,_0x5742a4){return request('LoginUser',{'body':{'interface':_0x5742a4},'options':{'where':_0x56abcd}});};exports[_0x1e7e('0x34')]=function(_0x420dd5,_0x379ad4,_0x92ad6e){return request(_0x1e7e('0x35'),{'body':{'type':_0x379ad4,'uniqueid':_0x92ad6e},'options':{'where':_0x420dd5}});};exports['agentUnpause']=function(_0x1775d6){return request(_0x1e7e('0x36'),{'body':{},'options':{'where':_0x1775d6}});};exports['agentLogout']=function(_0x1cf03c){return request('LogoutUser',{'body':{},'options':{'where':_0x1cf03c}});}; \ 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 a97fcd9..28cfe96 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 _0xc2d6=['exports','./lex'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xc2d6,0x171));var _0x6c2d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xc2d6[_0x102e37];return _0x35a07c;};var polly=require('./polly');var lex=require(_0x6c2d('0x0'));module[_0x6c2d('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 39fa544..40eaeb6 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 _0x41bb=['exports','./lib/api'];(function(_0x36681c,_0x41981b){var _0x445cc6=function(_0x47fe46){while(--_0x47fe46){_0x36681c['push'](_0x36681c['shift']());}};_0x445cc6(++_0x41981b);}(_0x41bb,0xc5));var _0xb41b=function(_0x203ab9,_0x132be7){_0x203ab9=_0x203ab9-0x0;var _0x4ec0e7=_0x41bb[_0x203ab9];return _0x4ec0e7;};'use strict';var lex=require(_0xb41b('0x0'));module[_0xb41b('0x1')]=function(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333){return lex(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333);}; \ No newline at end of file +var _0xbdb7=['./lib/api','exports'];(function(_0x2528c1,_0x5bdab5){var _0x40f183=function(_0x211622){while(--_0x211622){_0x2528c1['push'](_0x2528c1['shift']());}};_0x40f183(++_0x5bdab5);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0xbdb7[_0x10d670];return _0x20d6f8;};'use strict';var lex=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]=function(_0x44467d,_0x2a2c1c,_0x23c326,_0x433850,_0x4496ac,_0x2c7e07){return lex(_0x44467d,_0x2a2c1c,_0x23c326,_0x433850,_0x4496ac,_0x2c7e07);}; \ 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 72b2fb8..e6ef9f0 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(_0x3f355f,_0x5693a7){var _0x3dc257=function(_0x77a676){while(--_0x77a676){_0x3f355f['push'](_0x3f355f['shift']());}};_0x3dc257(++_0x5693a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x22d8c6,_0x1a6279){var _0xdcd5f2=function(_0x27888f){while(--_0x27888f){_0x22d8c6['push'](_0x22d8c6['shift']());}};_0xdcd5f2(++_0x1a6279);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 a771c67..6fda6a6 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 _0x117f=['exports'];(function(_0x44cad9,_0x205bb5){var _0x570e1d=function(_0x436e51){while(--_0x436e51){_0x44cad9['push'](_0x44cad9['shift']());}};_0x570e1d(++_0x205bb5);}(_0x117f,0xfa));var _0xf117=function(_0x17f0b4,_0x260306){_0x17f0b4=_0x17f0b4-0x0;var _0xe3c5c1=_0x117f[_0x17f0b4];return _0xe3c5c1;};'use strict';var polly=require('./lib/api');module[_0xf117('0x0')]=function(_0x126b32,_0x2a0de1,_0x3fc324,_0x2a1198,_0xda90e6,_0x32c8cd,_0x201ee8){return polly(_0x126b32,_0x2a0de1,_0x3fc324,_0x2a1198,_0xda90e6,_0x32c8cd,_0x201ee8);}; \ No newline at end of file +var _0x20f4=['exports','./lib/api'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0x20f4,0x87));var _0x420f=function(_0x4fb5ca,_0x3cf9ba){_0x4fb5ca=_0x4fb5ca-0x0;var _0xebce6b=_0x20f4[_0x4fb5ca];return _0xebce6b;};'use strict';var polly=require(_0x420f('0x0'));module[_0x420f('0x1')]=function(_0x521818,_0x474e27,_0x5d86a0,_0x421df7,_0x2c6240,_0x13cd62,_0x276c3b){return polly(_0x521818,_0x474e27,_0x5d86a0,_0x421df7,_0x2c6240,_0x13cd62,_0x276c3b);}; \ 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 f57067d..0823442 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 _0xaecc=['text','bluebird','randomstring','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x53d6e4,_0x3306db){var _0x52bb23=function(_0x478b61){while(--_0x478b61){_0x53d6e4['push'](_0x53d6e4['shift']());}};_0x52bb23(++_0x3306db);}(_0xaecc,0xe9));var _0xcaec=function(_0x273e0d,_0x57ced8){_0x273e0d=_0x273e0d-0x0;var _0x251355=_0xaecc[_0x273e0d];return _0x251355;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xcaec('0x0'));var rs=require(_0xcaec('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x1d36b7,_0x418f31,_0x5c88e1){return new BPromise(function(_0x4a6c0b,_0x484bb2){_0x1d36b7[_0xcaec('0x2')](_0x418f31,function(_0x28ae35,_0x31895f){if(_0x28ae35){_0x484bb2(_0x28ae35);}else if(_0x31895f){if(_0x31895f[_0xcaec('0x3')]instanceof Buffer){fs['writeFile'](_0x5c88e1,_0x31895f[_0xcaec('0x3')],function(_0x32a9ff){if(_0x32a9ff){_0x484bb2(_0x32a9ff);}else{_0x4a6c0b();}});}else{_0x484bb2(new Error(_0xcaec('0x4')));}}else{_0x484bb2(new Error(_0xcaec('0x5')));}});});}module[_0xcaec('0x6')]=function(_0x564a02,_0x24f599,_0x5ae70e,_0x1b83c5,_0x5ebd9e,_0x4e04da,_0x22dfb2){var _0x358b3a=new AWS['Polly']({'accessKeyId':_0x564a02,'secretAccessKey':_0x24f599,'region':_0x5ae70e});var _0x106056={'Text':_0x5ebd9e,'TextType':_0x4e04da||_0xcaec('0x7'),'OutputFormat':'mp3','VoiceId':_0x1b83c5};return pollyResult(_0x358b3a,_0x106056,_0x22dfb2);}; \ No newline at end of file +var _0xab42=['Polly','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x505877,_0xca5077){var _0x5efaa7=function(_0x51d67e){while(--_0x51d67e){_0x505877['push'](_0x505877['shift']());}};_0x5efaa7(++_0xca5077);}(_0xab42,0xdd));var _0x2ab4=function(_0x2f63f4,_0x5156f2){_0x2f63f4=_0x2f63f4-0x0;var _0x3dd760=_0xab42[_0x2f63f4];return _0x3dd760;};'use strict';var fs=require('fs');var path=require(_0x2ab4('0x0'));var BPromise=require(_0x2ab4('0x1'));var rs=require(_0x2ab4('0x2'));var AWS=require(_0x2ab4('0x3'));function pollyResult(_0x450bfc,_0x266629,_0x163b2b){return new BPromise(function(_0x557e8a,_0xf87d33){_0x450bfc[_0x2ab4('0x4')](_0x266629,function(_0x311054,_0x56bbe2){if(_0x311054){_0xf87d33(_0x311054);}else if(_0x56bbe2){if(_0x56bbe2['AudioStream']instanceof Buffer){fs[_0x2ab4('0x5')](_0x163b2b,_0x56bbe2[_0x2ab4('0x6')],function(_0x1f4129){if(_0x1f4129){_0xf87d33(_0x1f4129);}else{_0x557e8a();}});}else{_0xf87d33(new Error(_0x2ab4('0x7')));}}else{_0xf87d33(new Error(_0x2ab4('0x8')));}});});}module['exports']=function(_0x908239,_0x192967,_0x2f1ddb,_0x5a3d01,_0x3c5d59,_0x18e384,_0x4ebe70){var _0x977ab=new AWS[(_0x2ab4('0x9'))]({'accessKeyId':_0x908239,'secretAccessKey':_0x192967,'region':_0x2f1ddb});var _0x2b5181={'Text':_0x3c5d59,'TextType':_0x18e384||'text','OutputFormat':'mp3','VoiceId':_0x5a3d01};return pollyResult(_0x977ab,_0x2b5181,_0x4ebe70);}; \ 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 2419d69..42f38b6 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 _0x45ee=['./lib/api','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x45ee,0x110));var _0xe45e=function(_0x12a600,_0x4aa209){_0x12a600=_0x12a600-0x0;var _0x236c37=_0x45ee[_0x12a600];return _0x236c37;};'use strict';var asr=require(_0xe45e('0x0'));module[_0xe45e('0x1')]=function(_0x197a19,_0x30026f,_0xf69c9a,_0x4481ab){return asr(_0x197a19,_0x30026f,_0xf69c9a);}; \ No newline at end of file +var _0x35d4=['exports','./lib/api'];(function(_0x1acc03,_0x1794d6){var _0x51bc63=function(_0x5bbd7a){while(--_0x5bbd7a){_0x1acc03['push'](_0x1acc03['shift']());}};_0x51bc63(++_0x1794d6);}(_0x35d4,0x87));var _0x435d=function(_0x1c83b8,_0x59b5d0){_0x1c83b8=_0x1c83b8-0x0;var _0x163c66=_0x35d4[_0x1c83b8];return _0x163c66;};'use strict';var asr=require(_0x435d('0x0'));module[_0x435d('0x1')]=function(_0x325b4b,_0x48a45c,_0x46f2e3,_0xd2d404){return asr(_0x325b4b,_0x48a45c,_0x46f2e3);}; \ 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 387ac57..5fd2679 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 _0xfaa4=['filepath\x20should\x20be\x20a\x20string','length','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string'];(function(_0x3e8fc3,_0x298789){var _0x39a2bf=function(_0x5b0e2c){while(--_0x5b0e2c){_0x3e8fc3['push'](_0x3e8fc3['shift']());}};_0x39a2bf(++_0x298789);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x591148,_0xcb1087){_0x591148=_0x591148-0x0;var _0x56316e=_0xfaa4[_0x591148];return _0x56316e;};'use strict';var url=require(_0x4faa('0x0'));var BPromise=require(_0x4faa('0x1'));var fs=require('fs');var host=_0x4faa('0x2');module[_0x4faa('0x3')]=function(_0x122c51,_0x1f79b7,_0x5141d1){return new BPromise(function(_0x1d9494,_0x819149){var _0x144600;if(typeof _0x122c51!==_0x4faa('0x4')||_0x122c51['length']===0x0){return _0x819149(_0x4faa('0x5'));}if(typeof _0x1f79b7!==_0x4faa('0x4')||_0x1f79b7[_0x4faa('0x6')]===0x0){return _0x819149('key\x20should\x20be\x20a\x20string');}if(typeof _0x5141d1!=='undefined'&&(typeof _0x5141d1!=='string'||_0x5141d1[_0x4faa('0x6')]===0x0)){return _0x819149(_0x4faa('0x7'));}try{_0x144600=fs[_0x4faa('0x8')](_0x122c51)['toString'](_0x4faa('0x9'));}catch(_0x383778){return _0x819149(_0x383778);}return _0x1d9494({'method':_0x4faa('0xa'),'uri':host+_0x4faa('0xb')+_0x1f79b7,'body':{'config':{'encoding':_0x4faa('0xc'),'sampleRateHertz':'8000','languageCode':_0x5141d1},'audio':{'content':_0x144600}},'json':!![]});});}; \ No newline at end of file +var _0xfe57=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','8000','url','bluebird','string'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfe57,0x195));var _0x7fe5=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xfe57[_0x30b0d8];return _0x459c09;};'use strict';var url=require(_0x7fe5('0x0'));var BPromise=require(_0x7fe5('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x3f7dca,_0x4744a9,_0xc27f79){return new BPromise(function(_0x421809,_0x89ad5f){var _0x1254d2;if(typeof _0x3f7dca!==_0x7fe5('0x2')||_0x3f7dca[_0x7fe5('0x3')]===0x0){return _0x89ad5f(_0x7fe5('0x4'));}if(typeof _0x4744a9!==_0x7fe5('0x2')||_0x4744a9[_0x7fe5('0x3')]===0x0){return _0x89ad5f(_0x7fe5('0x5'));}if(typeof _0xc27f79!==_0x7fe5('0x6')&&(typeof _0xc27f79!=='string'||_0xc27f79[_0x7fe5('0x3')]===0x0)){return _0x89ad5f('lang\x20should\x20be\x20a\x20string');}try{_0x1254d2=fs[_0x7fe5('0x7')](_0x3f7dca)[_0x7fe5('0x8')]('base64');}catch(_0x534b10){return _0x89ad5f(_0x534b10);}return _0x421809({'method':_0x7fe5('0x9'),'uri':host+_0x7fe5('0xa')+_0x4744a9,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x7fe5('0xb'),'languageCode':_0xc27f79},'audio':{'content':_0x1254d2}},'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 af0ecb8..c9db772 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 _0x9872=['exports'];(function(_0xb930e2,_0x291d08){var _0x3af9a4=function(_0x403e85){while(--_0x403e85){_0xb930e2['push'](_0xb930e2['shift']());}};_0x3af9a4(++_0x291d08);}(_0x9872,0x1a8));var _0x2987=function(_0x47f15a,_0x2dd8a4){_0x47f15a=_0x47f15a-0x0;var _0x4fcfa2=_0x9872[_0x47f15a];return _0x4fcfa2;};var asr=require('./asr');module[_0x2987('0x0')]={'asr':asr}; \ No newline at end of file +var _0x7790=['./asr'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x7790,0x17b));var _0x0779=function(_0x192fff,_0xcfba42){_0x192fff=_0x192fff-0x0;var _0x8d7170=_0x7790[_0x192fff];return _0x8d7170;};var asr=require(_0x0779('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index b904779..fe29b87 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 _0xd916=['text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','base64','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','then','.mp3','from','audioContent','writeFile','777','.wav','split','googleTTS','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','chmodSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','name','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','parse','sestekNDA','nda'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xd916,0x87));var _0x6d91=function(_0x9bee87,_0x5db69e){_0x9bee87=_0x9bee87-0x0;var _0x3d8161=_0xd916[_0x9bee87];return _0x3d8161;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x6d91('0x0'));var fs=require('fs');var http=require(_0x6d91('0x1'));var https=require(_0x6d91('0x2'));var md5=require(_0x6d91('0x3'));var path=require(_0x6d91('0x4'));var querystring=require(_0x6d91('0x5'));var rp=require(_0x6d91('0x6'));var rs=require(_0x6d91('0x7'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x6d91('0x8'))['parse'];var util=require(_0x6d91('0x9'));var aws=require(_0x6d91('0xa'));var google=require(_0x6d91('0xb'));var sestek=require(_0x6d91('0xc'));var tilde=require(_0x6d91('0xd'));var logger=require(_0x6d91('0xe'))(_0x6d91('0xf'));var ISPEECH_API=_0x6d91('0x10');function downloadFile(_0x2b0b85,_0x520db0){return new BPromise(function(_0x28009e,_0x16f862){var _0x9c87fa=urlParse(_0x2b0b85);var _0x1bedb6=_0x9c87fa[_0x6d91('0x11')]===_0x6d91('0x12')?https:http;var _0x561527={'host':_0x9c87fa[_0x6d91('0x13')],'path':_0x9c87fa['path'],'headers':{'user-agent':_0x6d91('0x14')}};_0x1bedb6['get'](_0x561527,function(_0x260edf){if(_0x260edf[_0x6d91('0x15')]!==0xc8){logger[_0x6d91('0x16')](_0x6d91('0x17')+_0x2b0b85+_0x6d91('0x18')+_0x260edf[_0x6d91('0x15')]+'\x20('+_0x260edf[_0x6d91('0x19')]+')');_0x16f862(new Error(_0x6d91('0x17')+_0x2b0b85+_0x6d91('0x18')+_0x260edf[_0x6d91('0x15')]+'\x20('+_0x260edf['statusMessage']+')'));return;}var _0x666f0f=fs['createWriteStream'](_0x520db0);_0x666f0f['on'](_0x6d91('0x1a'),function(){logger[_0x6d91('0x1b')](_0x6d91('0x1c'));_0x666f0f[_0x6d91('0x1d')](_0x28009e);});_0x666f0f['on'](_0x6d91('0x16'),function(_0x4e6eaa){fs[_0x6d91('0x1e')](_0x520db0);logger['error'](_0x6d91('0x1f'),_0x4e6eaa);_0x16f862(_0x4e6eaa);});_0x260edf[_0x6d91('0x20')](_0x666f0f);})['on']('error',function(_0x5db7e3){logger[_0x6d91('0x16')](_0x5db7e3);_0x16f862(_0x5db7e3);})[_0x6d91('0x21')]();});}function uploadFile(_0x3439d1){return new BPromise(function(_0x4a8553,_0x301f7d){var _0x399fa0=urlParse(_0x3439d1);var _0x4190a0=_0x399fa0['protocol']===_0x6d91('0x12')?https:http;var _0x4e49d3={'host':_0x399fa0[_0x6d91('0x13')],'path':_0x399fa0[_0x6d91('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x4190a0['get'](_0x4e49d3,function(_0x5ab3c1){if(_0x5ab3c1[_0x6d91('0x15')]!==0xc8){_0x301f7d(new Error('request\x20to\x20'+_0x3439d1+_0x6d91('0x18')+_0x5ab3c1[_0x6d91('0x15')]+'\x20('+_0x5ab3c1[_0x6d91('0x19')]+')'));return;}var _0x52d5db='';_0x5ab3c1['on'](_0x6d91('0x22'),function(_0xd7db56){_0x52d5db+=_0xd7db56;});_0x5ab3c1['on'](_0x6d91('0x21'),function(){_0x4a8553(_0x52d5db);});})['on'](_0x6d91('0x16'),function(_0x5d8b67){_0x301f7d(_0x5d8b67);})[_0x6d91('0x21')]();});}function convertFile(_0x2d835b,_0x845361){return new BPromise(function(_0x319a0b,_0x3fc149){var _0x49e6eb=sox['transcode'](_0x2d835b,_0x845361,{'sampleRate':0x1f40,'format':_0x6d91('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x49e6eb['on'](_0x6d91('0x16'),function(_0x166a48){logger[_0x6d91('0x16')](_0x6d91('0x24'),_0x166a48);_0x3fc149(_0x166a48);});_0x49e6eb['on'](_0x6d91('0x21'),function(){logger['info'](_0x6d91('0x25'));_0x319a0b();});_0x49e6eb[_0x6d91('0x26')]();});}function base64Decode(_0xd8cfd5,_0x556f52){var _0x2573c3=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+'.wav');fs['writeFileSync'](_0x2573c3,_0xd8cfd5,_0x6d91('0x2a'));return convertFile(_0x2573c3,_0x556f52)['then'](function(){try{fs[_0x6d91('0x1e')](_0x2573c3);fs['chmodSync'](_0x556f52,'777');}catch(_0x2403af){logger['error'](_0x2403af);}return _0x556f52['split']('.')[0x0];});}function base64Encode(_0x2f0f85){var _0x536cfc=fs[_0x6d91('0x2b')](_0x2f0f85);return new Buffer(_0x536cfc)[_0x6d91('0x2c')]('base64');}exports[_0x6d91('0x2d')]=function(_0x54072b,_0x2905ca,_0x8b9042,_0x1dfc34,_0x51ae49,_0x4dbd52){var _0x1458a1,_0x4a036d;var _0x406a49=_0x6d91('0x2e');var _0x387573=_0x6d91('0x2f')+_0x54072b;var _0x29c576={};if(_0x2905ca===_0x6d91('0x30')){_0x29c576[_0x6d91('0x31')]={'ssml':_0x8b9042};}else{_0x29c576[_0x6d91('0x31')]={'text':_0x8b9042};};_0x29c576[_0x6d91('0x32')]={'languageCode':_0x1dfc34,'ssmlGender':_0x51ae49};_0x29c576[_0x6d91('0x33')]={'audioEncoding':_0x6d91('0x34'),'sampleRateHertz':0x1f40};var _0x257d34={'url':_0x406a49+'text:synthesize'+_0x387573,'method':_0x6d91('0x35'),'json':!![],'body':_0x29c576};return rp(_0x257d34)[_0x6d91('0x36')](function(_0x36cef0){return new BPromise(function(_0x26a28a,_0x359569){_0x1458a1=path['resolve'](__dirname,'tmp',rs[_0x6d91('0x29')](0x4)+_0x6d91('0x37'));var _0x31c3cd=Buffer[_0x6d91('0x38')](_0x36cef0[_0x6d91('0x39')],'base64');return fs[_0x6d91('0x3a')](_0x1458a1,_0x31c3cd,function(_0x4fc801){_0x359569(_0x4fc801);},function(_0x452f06){fs['chmodSync'](_0x1458a1,_0x6d91('0x3b'));_0x26a28a(_0x452f06);});});})[_0x6d91('0x36')](function(_0x5c3291){_0x4a036d=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x1458a1,_0x4a036d);})[_0x6d91('0x36')](function(){try{fs['unlink'](_0x1458a1);fs['chmodSync'](_0x4a036d,_0x6d91('0x3b'));}catch(_0x587a55){logger['error'](_0x587a55);}logger[_0x6d91('0x1b')]('googleCloudTTS\x20path',_0x4a036d[_0x6d91('0x3d')]('.')[0x0]);return _0x4a036d[_0x6d91('0x3d')]('.')[0x0];});};exports[_0x6d91('0x3e')]=function(_0x166aee,_0x72a403){var _0x340193='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x453865,_0x1d3639;var _0x3da2b5;var _0x1291bc={'encoding':'utf8','method':_0x6d91('0x35'),'timeout':0x2710,'url':_0x340193,'headers':{'Content-Type':_0x6d91('0x3f')},'body':_0x6d91('0x40')+encodeURIComponent(JSON[_0x6d91('0x41')]([[[_0x6d91('0x42'),JSON['stringify']([_0x166aee,_0x72a403||'en',![],_0x6d91('0x43')]),null,'generic']]]))};return rp(_0x1291bc)[_0x6d91('0x36')](function(_0x2b7a52){try{_0x3da2b5=eval(_0x2b7a52[_0x6d91('0x44')](0x5))[0x0][0x2];}catch(_0x477d3f){throw new Error('parse\x20response\x20failed:\x0a'+_0x2b7a52[_0x6d91('0x22')]);}if(!_0x3da2b5){if(_0x166aee[_0x6d91('0x45')]>0xc8){throw new Error(_0x6d91('0x46'));}else{throw new Error('lang\x20\x22'+_0x72a403+_0x6d91('0x47'));}}try{_0x3da2b5=eval(_0x3da2b5)[0x0];}catch(_0x501dd0){throw new Error(_0x6d91('0x48')+res['data']);}const _0x3e4757=_0x3da2b5;_0x453865=path['resolve'](__dirname,_0x6d91('0x28'),rs['generate'](0x4)+_0x6d91('0x37'));fs['writeFileSync'](_0x453865,_0x3da2b5,{'encoding':_0x6d91('0x2a')});_0x1d3639=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x453865,_0x1d3639);})[_0x6d91('0x36')](function(){try{fs['unlink'](_0x453865);fs[_0x6d91('0x49')](_0x1d3639,_0x6d91('0x3b'));}catch(_0x103a09){logger['error'](_0x103a09);}logger['info'](_0x6d91('0x4a'),_0x1d3639[_0x6d91('0x3d')]('.')[0x0]);return _0x1d3639[_0x6d91('0x3d')]('.')[0x0];});};exports[_0x6d91('0x4b')]=function(_0xc07905,_0x13b861,_0x5d8066){return google[_0x6d91('0x4c')](_0xc07905,_0x13b861,_0x5d8066)[_0x6d91('0x36')](function(_0xee5014){logger['info'](_0xee5014['uri']);return rp(_0xee5014);})[_0x6d91('0x36')](function(_0x3b960d){var _0x6eee2b='';var _0x896477=0x0;try{fs['unlink'](_0xc07905);}catch(_0x292dba){logger[_0x6d91('0x16')](_0x292dba);}if(_0x3b960d&&_0x3b960d[_0x6d91('0x4d')]){_0x6eee2b=_0x3b960d[_0x6d91('0x4d')][_0x6d91('0x4e')](function(_0x27171f){return _0x27171f&&_0x27171f[_0x6d91('0x4f')][0x0]&&_0x27171f[_0x6d91('0x4f')][0x0][_0x6d91('0x50')]?_0x27171f[_0x6d91('0x4f')][0x0][_0x6d91('0x50')]:'';})[_0x6d91('0x51')]('\x0a');_0x896477=_0x3b960d[_0x6d91('0x4d')][_0x6d91('0x4e')](function(_0xe88b50){return _0xe88b50&&_0xe88b50[_0x6d91('0x4f')][0x0]&&_0xe88b50['alternatives'][0x0][_0x6d91('0x52')]?_0xe88b50[_0x6d91('0x4f')][0x0][_0x6d91('0x52')]:0x0;})[_0x6d91('0x51')]('\x0a');}logger[_0x6d91('0x1b')](_0x6d91('0x53'),_0x6eee2b);logger['info']('googleASR\x20confidence',_0x896477);return{'transcript':_0x6eee2b,'confidence':_0x896477};})['catch'](function(_0x2394b4){logger[_0x6d91('0x16')](_0x6d91('0x54'),_0x2394b4[_0x6d91('0x15')],_0x2394b4['name'],_0x2394b4['message']);});};exports['googleDialogflow']=function(_0x2dfa92,_0x284533,_0x131341,_0x55b102){var _0x52aa47=apiai(_0x284533,{'language':_0x55b102||'en'});return _0x52aa47['textRequest'](_0x131341,{'sessionId':md5(_0x2dfa92)})[_0x6d91('0x36')](function(_0x5dc60f){logger['info'](JSON['stringify'](_0x5dc60f));return{'source':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x56')],'resolvedQuery':_0x5dc60f['result'][_0x6d91('0x57')],'action':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x58')],'actionIncomplete':_0x5dc60f['result'][_0x6d91('0x59')],'speech':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x5a')][_0x6d91('0x5b')],'score':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x5c')],'statusCode':_0x5dc60f[_0x6d91('0x5d')][_0x6d91('0x5e')],'endConversation':_0x5dc60f['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x5dc60f['result'][_0x6d91('0x5f')][_0x6d91('0x60')]};});};exports[_0x6d91('0x61')]=function(_0x33fe26,_0x4a61df,_0x5c8927,_0x1ae58c,_0x55378b,_0x26b088){var _0x2b2701=_0x1ae58c[_0x6d91('0x62')](/\\n/g,'\x0a');var _0x50d116={'credentials':{'private_key':_0x2b2701,'client_email':_0x5c8927}};var _0x1ea890=new dialogflow[(_0x6d91('0x63'))](_0x50d116);var _0x375143=_0x1ea890['sessionPath'](_0x4a61df,md5(_0x33fe26));var _0x91ca67={'session':_0x375143,'queryInput':{'text':{'text':_0x55378b,'languageCode':_0x26b088}}};return _0x1ea890[_0x6d91('0x64')](_0x91ca67)['then'](function(_0x1d4073){if(_0x1d4073&&_0x1d4073['length']){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x6d91('0x41')](_0x1d4073));var _0x458f9f=_0x1d4073[0x0];if(_0x458f9f){var _0x102199={'action':_0x458f9f[_0x6d91('0x65')]['action'],'allRequiredParamsPresent':_0x458f9f['queryResult'][_0x6d91('0x66')],'endConversation':_0x458f9f[_0x6d91('0x65')][_0x6d91('0x67')]&&_0x458f9f[_0x6d91('0x65')][_0x6d91('0x67')][_0x6d91('0x68')]?_0x458f9f[_0x6d91('0x65')][_0x6d91('0x67')][_0x6d91('0x68')]['end_conversation'][_0x6d91('0x69')]:![],'fulfillmentText':_0x458f9f['queryResult'][_0x6d91('0x6a')],'intentName':_0x458f9f[_0x6d91('0x65')]['intent'][_0x6d91('0x6b')],'intentDisplayName':_0x458f9f[_0x6d91('0x65')]['intent']['displayName'],'isFallbackIntent':_0x458f9f[_0x6d91('0x65')]['intent'][_0x6d91('0x6c')],'languageCode':_0x458f9f['queryResult'][_0x6d91('0x6d')],'queryText':_0x458f9f[_0x6d91('0x65')][_0x6d91('0x6e')],'responseId':_0x458f9f[_0x6d91('0x6f')],'score':_0x458f9f[_0x6d91('0x65')][_0x6d91('0x70')],'speech':_0x458f9f['queryResult'][_0x6d91('0x6a')],'providerResponse':JSON[_0x6d91('0x41')](_0x1d4073)};return _0x102199;}}});};exports[_0x6d91('0x71')]=function(_0x5eab5d,_0x422afb,_0x50c9d2,_0x7e6987){return tilde['asr'](_0x5eab5d,_0x422afb,_0x50c9d2,_0x7e6987)[_0x6d91('0x36')](function(_0x4f1c6f){try{fs['unlink'](_0x5eab5d);}catch(_0x32e95d){logger['error'](_0x32e95d);}logger['info']('Tilde\x20ASR\x20transcription',_0x4f1c6f[_0x6d91('0x50')]);logger[_0x6d91('0x1b')](_0x6d91('0x72'),_0x4f1c6f['confidence']);return _0x4f1c6f;});};exports[_0x6d91('0x73')]=function(_0x509b1d,_0xa4632f,_0x48ee38,_0xbe2170,_0x102e99,_0x5786b8){var _0x350200=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs['generate'](0x4)+_0x6d91('0x37'));var _0x4f001d;return aws[_0x6d91('0x74')](_0x509b1d,_0xa4632f,_0x48ee38,_0xbe2170,_0x102e99,_0x5786b8,_0x350200)[_0x6d91('0x36')](function(){_0x4f001d=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x350200,_0x4f001d);})[_0x6d91('0x36')](function(){try{fs[_0x6d91('0x1e')](_0x350200);fs['chmodSync'](_0x4f001d,_0x6d91('0x3b'));}catch(_0x5f38e9){logger[_0x6d91('0x16')](_0x5f38e9);}return _0x4f001d[_0x6d91('0x3d')]('.')[0x0];});};exports['awsLex']=function(_0xe6b2de,_0x5e6a6c,_0xc75a1a,_0x23a6ed,_0x29146f,_0x5a414c){return aws['lex'](_0xe6b2de,_0x5e6a6c,_0xc75a1a,_0x23a6ed,_0x29146f,_0x5a414c)[_0x6d91('0x36')](function(_0x1efb9d){logger['info'](JSON[_0x6d91('0x41')](_0x1efb9d));return _0x1efb9d;});};exports['ispeechTTS']=function(_0x2683ca,_0x3e9859,_0x2e330f,_0x2e9a8c){var _0x4e4670=util['format'](_0x6d91('0x75'),ISPEECH_API,_0x2683ca,encodeURIComponent(_0x3e9859),_0x2e330f,_0x2e9a8c);var _0x3fd692=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x37'));var _0x50c9fd;return downloadFile(_0x4e4670,_0x3fd692)[_0x6d91('0x36')](function(){_0x50c9fd=path['resolve'](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x3fd692,_0x50c9fd);})[_0x6d91('0x36')](function(){try{fs[_0x6d91('0x1e')](_0x3fd692);fs[_0x6d91('0x49')](_0x50c9fd,_0x6d91('0x3b'));}catch(_0x58252f){logger[_0x6d91('0x16')](_0x58252f);}return _0x50c9fd['split']('.')[0x0];});};exports['ispeechASR']=function(_0x15eaa1,_0x5d7730,_0x9036,_0xcf2c43){var _0x47b02a=util['format'](_0x6d91('0x76'),ISPEECH_API,_0x5d7730,_0x9036,base64Encode(_0x15eaa1),_0xcf2c43?util[_0x6d91('0x77')]('model=%s',encodeURIComponent(_0xcf2c43)):'freeform=3');return uploadFile(_0x47b02a)[_0x6d91('0x36')](function(_0x2880d0){return querystring[_0x6d91('0x78')](_0x2880d0);});};exports[_0x6d91('0x79')]=function(_0x171395,_0x264eff){return sestek[_0x6d91('0x7a')](_0x171395,_0x264eff)[_0x6d91('0x36')](function(_0x2f7cda){logger[_0x6d91('0x1b')](JSON[_0x6d91('0x41')](_0x2f7cda));var _0xa904e2={'speech':_0x2f7cda[_0x6d91('0x7b')],'action':_0x2f7cda['channelData']?_0x2f7cda[_0x6d91('0x7c')]['CustomAction']:undefined,'actiondata':_0x2f7cda[_0x6d91('0x7c')]?_0x2f7cda[_0x6d91('0x7c')][_0x6d91('0x7d')]:undefined};if(_0x2f7cda[_0x6d91('0x7c')]&&_0x2f7cda['channelData'][_0x6d91('0x7e')]){return base64Decode(_0x2f7cda[_0x6d91('0x7c')][_0x6d91('0x7e')][_0x6d91('0x7f')],path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+'.wav'))[_0x6d91('0x36')](function(_0x2a2aa0){_0xa904e2[_0x6d91('0x80')]=_0x2a2aa0;return _0xa904e2;});}return _0xa904e2;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xf274=['generate','base64','then','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','ssml','audioConfig','MP3','text:synthesize','.mp3','from','.wav','googleCloudTTS\x20path','googleTTS','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','null','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','md5','querystring','request-promise','randomstring','sox','parse','util','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','path','WHAT_EVER','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','unlink','download\x20error','end','host','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp'];(function(_0x247b2c,_0x52354c){var _0x14986e=function(_0xe60b3d){while(--_0xe60b3d){_0x247b2c['push'](_0x247b2c['shift']());}};_0x14986e(++_0x52354c);}(_0xf274,0x1e3));var _0x4f27=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xf274[_0x47aa64];return _0x549c7a;};'use strict';var apiai=require(_0x4f27('0x0'));var BPromise=require(_0x4f27('0x1'));var dialogflow=require(_0x4f27('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x4f27('0x3'));var path=require('path');var querystring=require(_0x4f27('0x4'));var rp=require(_0x4f27('0x5'));var rs=require(_0x4f27('0x6'));var sox=require(_0x4f27('0x7'));var tts=require('google-tts-api');var urlParse=require('url')[_0x4f27('0x8')];var util=require(_0x4f27('0x9'));var aws=require('./aws');var google=require(_0x4f27('0xa'));var sestek=require('./sestek');var tilde=require(_0x4f27('0xb'));var logger=require(_0x4f27('0xc'))(_0x4f27('0xd'));var ISPEECH_API=_0x4f27('0xe');function downloadFile(_0x1a7cc0,_0x568ddd){return new BPromise(function(_0x280fea,_0x367a9e){var _0x3886ca=urlParse(_0x1a7cc0);var _0x19b628=_0x3886ca[_0x4f27('0xf')]===_0x4f27('0x10')?https:http;var _0x55f183={'host':_0x3886ca['host'],'path':_0x3886ca[_0x4f27('0x11')],'headers':{'user-agent':_0x4f27('0x12')}};_0x19b628['get'](_0x55f183,function(_0x4d1284){if(_0x4d1284[_0x4f27('0x13')]!==0xc8){logger[_0x4f27('0x14')](_0x4f27('0x15')+_0x1a7cc0+'\x20failed,\x20status\x20code\x20=\x20'+_0x4d1284[_0x4f27('0x13')]+'\x20('+_0x4d1284[_0x4f27('0x16')]+')');_0x367a9e(new Error(_0x4f27('0x15')+_0x1a7cc0+_0x4f27('0x17')+_0x4d1284[_0x4f27('0x13')]+'\x20('+_0x4d1284[_0x4f27('0x16')]+')'));return;}var _0x271c91=fs[_0x4f27('0x18')](_0x568ddd);_0x271c91['on'](_0x4f27('0x19'),function(){logger[_0x4f27('0x1a')]('finish\x20download\x20file');_0x271c91[_0x4f27('0x1b')](_0x280fea);});_0x271c91['on']('error',function(_0x2d160a){fs[_0x4f27('0x1c')](_0x568ddd);logger[_0x4f27('0x14')](_0x4f27('0x1d'),_0x2d160a);_0x367a9e(_0x2d160a);});_0x4d1284['pipe'](_0x271c91);})['on']('error',function(_0x28a52a){logger[_0x4f27('0x14')](_0x28a52a);_0x367a9e(_0x28a52a);})[_0x4f27('0x1e')]();});}function uploadFile(_0x305162){return new BPromise(function(_0x16fd45,_0x2220f7){var _0x31e254=urlParse(_0x305162);var _0x4346f3=_0x31e254[_0x4f27('0xf')]===_0x4f27('0x10')?https:http;var _0x1e4e58={'host':_0x31e254[_0x4f27('0x1f')],'path':_0x31e254[_0x4f27('0x11')],'headers':{'user-agent':_0x4f27('0x12')}};_0x4346f3[_0x4f27('0x20')](_0x1e4e58,function(_0x19f91b){if(_0x19f91b['statusCode']!==0xc8){_0x2220f7(new Error(_0x4f27('0x15')+_0x305162+_0x4f27('0x17')+_0x19f91b[_0x4f27('0x13')]+'\x20('+_0x19f91b['statusMessage']+')'));return;}var _0x2e9d86='';_0x19f91b['on'](_0x4f27('0x21'),function(_0x1d6dc1){_0x2e9d86+=_0x1d6dc1;});_0x19f91b['on'](_0x4f27('0x1e'),function(){_0x16fd45(_0x2e9d86);});})['on'](_0x4f27('0x14'),function(_0xc392b6){_0x2220f7(_0xc392b6);})[_0x4f27('0x1e')]();});}function convertFile(_0x2b1366,_0x44e92d){return new BPromise(function(_0x5c04f8,_0x4ba5c8){var _0x3dcb95=sox[_0x4f27('0x22')](_0x2b1366,_0x44e92d,{'sampleRate':0x1f40,'format':_0x4f27('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3dcb95['on']('error',function(_0x9fd3be){logger[_0x4f27('0x14')](_0x4f27('0x24'),_0x9fd3be);_0x4ba5c8(_0x9fd3be);});_0x3dcb95['on'](_0x4f27('0x1e'),function(){logger[_0x4f27('0x1a')](_0x4f27('0x25'));_0x5c04f8();});_0x3dcb95[_0x4f27('0x26')]();});}function base64Decode(_0x5a9ac2,_0x201aaa){var _0x24315f=path[_0x4f27('0x27')](__dirname,_0x4f27('0x28'),rs[_0x4f27('0x29')](0x4)+'.wav');fs['writeFileSync'](_0x24315f,_0x5a9ac2,_0x4f27('0x2a'));return convertFile(_0x24315f,_0x201aaa)[_0x4f27('0x2b')](function(){try{fs[_0x4f27('0x1c')](_0x24315f);fs[_0x4f27('0x2c')](_0x201aaa,_0x4f27('0x2d'));}catch(_0xce5e5e){logger['error'](_0xce5e5e);}return _0x201aaa[_0x4f27('0x2e')]('.')[0x0];});}function base64Encode(_0x7ebc21){var _0x4cd6eb=fs[_0x4f27('0x2f')](_0x7ebc21);return new Buffer(_0x4cd6eb)['toString'](_0x4f27('0x2a'));}exports['googleCloudTTS']=function(_0x2efc96,_0x14bc2e,_0x40868e,_0x5137b2,_0x4b0b81,_0x242ffa){var _0x2144be,_0x1240d7;var _0x407b32=_0x4f27('0x30');var _0x570636='?key='+_0x2efc96;var _0x455a5e={};if(_0x14bc2e===_0x4f27('0x31')){_0x455a5e['input']={'ssml':_0x40868e};}else{_0x455a5e['input']={'text':_0x40868e};};_0x455a5e['voice']={'languageCode':_0x5137b2,'ssmlGender':_0x4b0b81};_0x455a5e[_0x4f27('0x32')]={'audioEncoding':_0x4f27('0x33'),'sampleRateHertz':0x1f40};var _0x9e63af={'url':_0x407b32+_0x4f27('0x34')+_0x570636,'method':'POST','json':!![],'body':_0x455a5e};return rp(_0x9e63af)[_0x4f27('0x2b')](function(_0x5286a1){return new BPromise(function(_0x1fe6c5,_0x337fb6){_0x2144be=path[_0x4f27('0x27')](__dirname,_0x4f27('0x28'),rs[_0x4f27('0x29')](0x4)+_0x4f27('0x35'));var _0x47578b=Buffer[_0x4f27('0x36')](_0x5286a1['audioContent'],_0x4f27('0x2a'));return fs['writeFile'](_0x2144be,_0x47578b,function(_0x26a952){_0x337fb6(_0x26a952);},function(_0x1d28dd){fs[_0x4f27('0x2c')](_0x2144be,_0x4f27('0x2d'));_0x1fe6c5(_0x1d28dd);});});})['then'](function(_0x460b99){_0x1240d7=path[_0x4f27('0x27')](__dirname,_0x4f27('0x28'),rs[_0x4f27('0x29')](0x4)+_0x4f27('0x37'));return convertFile(_0x2144be,_0x1240d7);})[_0x4f27('0x2b')](function(){try{fs[_0x4f27('0x1c')](_0x2144be);fs[_0x4f27('0x2c')](_0x1240d7,_0x4f27('0x2d'));}catch(_0x10cb20){logger[_0x4f27('0x14')](_0x10cb20);}logger[_0x4f27('0x1a')](_0x4f27('0x38'),_0x1240d7[_0x4f27('0x2e')]('.')[0x0]);return _0x1240d7[_0x4f27('0x2e')]('.')[0x0];});};exports[_0x4f27('0x39')]=function(_0xff94,_0x268bbf){var _0x14c2fa='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5623e5,_0x4e3851;var _0x1003f7;var _0x1200f8={'encoding':_0x4f27('0x3a'),'method':_0x4f27('0x3b'),'timeout':0x2710,'url':_0x14c2fa,'headers':{'Content-Type':_0x4f27('0x3c')},'body':_0x4f27('0x3d')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x4f27('0x3e')]([_0xff94,_0x268bbf||'en',![],_0x4f27('0x3f')]),null,'generic']]]))};return rp(_0x1200f8)[_0x4f27('0x2b')](function(_0x109e7c){try{_0x1003f7=eval(_0x109e7c[_0x4f27('0x40')](0x5))[0x0][0x2];}catch(_0x35f61d){throw new Error('parse\x20response\x20failed:\x0a'+_0x109e7c['data']);}if(!_0x1003f7){if(_0xff94[_0x4f27('0x41')]>0xc8){throw new Error(_0x4f27('0x42'));}else{throw new Error(_0x4f27('0x43')+_0x268bbf+_0x4f27('0x44'));}}try{_0x1003f7=eval(_0x1003f7)[0x0];}catch(_0xa642d2){throw new Error(_0x4f27('0x45')+res[_0x4f27('0x21')]);}const _0x593ac2=_0x1003f7;_0x5623e5=path['resolve'](__dirname,_0x4f27('0x28'),rs[_0x4f27('0x29')](0x4)+_0x4f27('0x35'));fs[_0x4f27('0x46')](_0x5623e5,_0x1003f7,{'encoding':_0x4f27('0x2a')});_0x4e3851=path[_0x4f27('0x27')](__dirname,'tmp',rs[_0x4f27('0x29')](0x4)+'.wav');return convertFile(_0x5623e5,_0x4e3851);})[_0x4f27('0x2b')](function(){try{fs[_0x4f27('0x1c')](_0x5623e5);fs[_0x4f27('0x2c')](_0x4e3851,_0x4f27('0x2d'));}catch(_0xb64ffe){logger[_0x4f27('0x14')](_0xb64ffe);}logger[_0x4f27('0x1a')](_0x4f27('0x47'),_0x4e3851['split']('.')[0x0]);return _0x4e3851[_0x4f27('0x2e')]('.')[0x0];});};exports[_0x4f27('0x48')]=function(_0x364fcd,_0x372ae1,_0x376da3){return google['asr'](_0x364fcd,_0x372ae1,_0x376da3)['then'](function(_0x43c01a){logger[_0x4f27('0x1a')](_0x43c01a[_0x4f27('0x49')]);return rp(_0x43c01a);})[_0x4f27('0x2b')](function(_0x407c57){var _0x46b683='';var _0xa37629=0x0;try{fs[_0x4f27('0x1c')](_0x364fcd);}catch(_0x37049a){logger[_0x4f27('0x14')](_0x37049a);}if(_0x407c57&&_0x407c57['results']){_0x46b683=_0x407c57[_0x4f27('0x4a')][_0x4f27('0x4b')](function(_0x2546ed){return _0x2546ed&&_0x2546ed[_0x4f27('0x4c')][0x0]&&_0x2546ed['alternatives'][0x0][_0x4f27('0x4d')]?_0x2546ed['alternatives'][0x0][_0x4f27('0x4d')]:'';})['join']('\x0a');_0xa37629=_0x407c57[_0x4f27('0x4a')]['map'](function(_0x386f93){return _0x386f93&&_0x386f93[_0x4f27('0x4c')][0x0]&&_0x386f93['alternatives'][0x0][_0x4f27('0x4e')]?_0x386f93[_0x4f27('0x4c')][0x0][_0x4f27('0x4e')]:0x0;})[_0x4f27('0x4f')]('\x0a');}logger[_0x4f27('0x1a')](_0x4f27('0x50'),_0x46b683);logger[_0x4f27('0x1a')]('googleASR\x20confidence',_0xa37629);return{'transcript':_0x46b683,'confidence':_0xa37629};})[_0x4f27('0x51')](function(_0x28924f){logger[_0x4f27('0x14')](_0x4f27('0x52'),_0x28924f[_0x4f27('0x13')],_0x28924f[_0x4f27('0x53')],_0x28924f[_0x4f27('0x54')]);});};exports[_0x4f27('0x55')]=function(_0x559085,_0x1f0b98,_0x542e7b,_0x404bdd){var _0x418d7e=apiai(_0x1f0b98,{'language':_0x404bdd||'en'});return _0x418d7e['textRequest'](_0x542e7b,{'sessionId':md5(_0x559085)})[_0x4f27('0x2b')](function(_0x3fd886){logger['info'](JSON['stringify'](_0x3fd886));return{'source':_0x3fd886['result']['source'],'resolvedQuery':_0x3fd886[_0x4f27('0x56')][_0x4f27('0x57')],'action':_0x3fd886[_0x4f27('0x56')][_0x4f27('0x58')],'actionIncomplete':_0x3fd886[_0x4f27('0x56')][_0x4f27('0x59')],'speech':_0x3fd886[_0x4f27('0x56')][_0x4f27('0x5a')][_0x4f27('0x5b')],'score':_0x3fd886['result'][_0x4f27('0x5c')],'statusCode':_0x3fd886[_0x4f27('0x5d')]['code'],'endConversation':_0x3fd886[_0x4f27('0x56')]['metadata'][_0x4f27('0x5e')]||![],'isFallbackIntent':_0x3fd886['result']['metadata'][_0x4f27('0x5f')]};});};exports[_0x4f27('0x60')]=function(_0x528897,_0x20cf12,_0x5095a4,_0x58b8b9,_0x20eeb4,_0x37bf9f){var _0x2d6f61=_0x58b8b9[_0x4f27('0x61')](/\\n/g,'\x0a');var _0x560ece={'credentials':{'private_key':_0x2d6f61,'client_email':_0x5095a4}};var _0xee03f2=new dialogflow['SessionsClient'](_0x560ece);var _0x26037e=_0xee03f2[_0x4f27('0x62')](_0x20cf12,md5(_0x528897));var _0x229cca={'session':_0x26037e,'queryInput':{'text':{'text':_0x20eeb4,'languageCode':_0x37bf9f}}};return _0xee03f2['detectIntent'](_0x229cca)['then'](function(_0x5546c6){if(_0x5546c6&&_0x5546c6[_0x4f27('0x41')]){logger[_0x4f27('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0x4f27('0x3e')](_0x5546c6));var _0x36ade7=_0x5546c6[0x0];if(_0x36ade7){var _0x187ef9={'action':_0x36ade7[_0x4f27('0x63')]['action'],'allRequiredParamsPresent':_0x36ade7[_0x4f27('0x63')][_0x4f27('0x64')],'endConversation':_0x36ade7[_0x4f27('0x63')][_0x4f27('0x65')]&&_0x36ade7[_0x4f27('0x63')][_0x4f27('0x65')]['fields']?_0x36ade7[_0x4f27('0x63')][_0x4f27('0x65')][_0x4f27('0x66')]['end_conversation'][_0x4f27('0x67')]:![],'fulfillmentText':_0x36ade7['queryResult']['fulfillmentText'],'intentName':_0x36ade7['queryResult'][_0x4f27('0x68')][_0x4f27('0x53')],'intentDisplayName':_0x36ade7[_0x4f27('0x63')]['intent'][_0x4f27('0x69')],'isFallbackIntent':_0x36ade7[_0x4f27('0x63')]['intent'][_0x4f27('0x6a')],'languageCode':_0x36ade7[_0x4f27('0x63')][_0x4f27('0x6b')],'queryText':_0x36ade7[_0x4f27('0x63')][_0x4f27('0x6c')],'responseId':_0x36ade7[_0x4f27('0x6d')],'score':_0x36ade7[_0x4f27('0x63')][_0x4f27('0x6e')],'speech':_0x36ade7[_0x4f27('0x63')][_0x4f27('0x6f')],'providerResponse':JSON[_0x4f27('0x3e')](_0x5546c6)};return _0x187ef9;}}});};exports[_0x4f27('0x70')]=function(_0x2e6475,_0x364c5d,_0x577a7b,_0x2caf70){return tilde[_0x4f27('0x71')](_0x2e6475,_0x364c5d,_0x577a7b,_0x2caf70)[_0x4f27('0x2b')](function(_0x327063){try{fs[_0x4f27('0x1c')](_0x2e6475);}catch(_0x5e8e2d){logger['error'](_0x5e8e2d);}logger[_0x4f27('0x1a')](_0x4f27('0x72'),_0x327063[_0x4f27('0x4d')]);logger[_0x4f27('0x1a')]('Tilde\x20ASR\x20confidence',_0x327063['confidence']);return _0x327063;});};exports[_0x4f27('0x73')]=function(_0xcc82fa,_0x12430e,_0x4e9308,_0x47fe3f,_0x46a1cd,_0x576854){var _0x522b1d=path[_0x4f27('0x27')](__dirname,_0x4f27('0x28'),rs[_0x4f27('0x29')](0x4)+_0x4f27('0x35'));var _0x6fdad2;return aws[_0x4f27('0x74')](_0xcc82fa,_0x12430e,_0x4e9308,_0x47fe3f,_0x46a1cd,_0x576854,_0x522b1d)[_0x4f27('0x2b')](function(){_0x6fdad2=path[_0x4f27('0x27')](__dirname,'tmp',rs[_0x4f27('0x29')](0x4)+_0x4f27('0x37'));return convertFile(_0x522b1d,_0x6fdad2);})[_0x4f27('0x2b')](function(){try{fs[_0x4f27('0x1c')](_0x522b1d);fs[_0x4f27('0x2c')](_0x6fdad2,'777');}catch(_0x9020cf){logger[_0x4f27('0x14')](_0x9020cf);}return _0x6fdad2[_0x4f27('0x2e')]('.')[0x0];});};exports[_0x4f27('0x75')]=function(_0x17e1a5,_0x40c5b9,_0x2ea124,_0x5ec077,_0x3feaf5,_0x47b251){return aws[_0x4f27('0x76')](_0x17e1a5,_0x40c5b9,_0x2ea124,_0x5ec077,_0x3feaf5,_0x47b251)[_0x4f27('0x2b')](function(_0x4be379){logger['info'](JSON['stringify'](_0x4be379));return _0x4be379;});};exports[_0x4f27('0x77')]=function(_0x2093d1,_0x2fa4f5,_0x105805,_0x490902){var _0x36ece0=util[_0x4f27('0x78')](_0x4f27('0x79'),ISPEECH_API,_0x2093d1,encodeURIComponent(_0x2fa4f5),_0x105805,_0x490902);var _0x1c9aaa=path['resolve'](__dirname,_0x4f27('0x28'),rs['generate'](0x4)+_0x4f27('0x35'));var _0x356a5f;return downloadFile(_0x36ece0,_0x1c9aaa)['then'](function(){_0x356a5f=path[_0x4f27('0x27')](__dirname,_0x4f27('0x28'),rs[_0x4f27('0x29')](0x4)+_0x4f27('0x37'));return convertFile(_0x1c9aaa,_0x356a5f);})[_0x4f27('0x2b')](function(){try{fs[_0x4f27('0x1c')](_0x1c9aaa);fs[_0x4f27('0x2c')](_0x356a5f,_0x4f27('0x2d'));}catch(_0x3c6e4){logger[_0x4f27('0x14')](_0x3c6e4);}return _0x356a5f[_0x4f27('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0x17ded2,_0x41cd83,_0x2cdff1,_0x23ea89){var _0x375eaf=util[_0x4f27('0x78')](_0x4f27('0x7a'),ISPEECH_API,_0x41cd83,_0x2cdff1,base64Encode(_0x17ded2),_0x23ea89?util[_0x4f27('0x78')]('model=%s',encodeURIComponent(_0x23ea89)):_0x4f27('0x7b'));return uploadFile(_0x375eaf)[_0x4f27('0x2b')](function(_0x367203){return querystring[_0x4f27('0x8')](_0x367203);});};exports[_0x4f27('0x7c')]=function(_0x3ad90c,_0xf81ce4){return sestek[_0x4f27('0x7d')](_0x3ad90c,_0xf81ce4)[_0x4f27('0x2b')](function(_0x5b41a5){logger['info'](JSON[_0x4f27('0x3e')](_0x5b41a5));var _0x40b7e9={'speech':_0x5b41a5[_0x4f27('0x7e')],'action':_0x5b41a5['channelData']?_0x5b41a5[_0x4f27('0x7f')]['CustomAction']:undefined,'actiondata':_0x5b41a5[_0x4f27('0x7f')]?_0x5b41a5[_0x4f27('0x7f')]['CustomActionData']:undefined};if(_0x5b41a5['channelData']&&_0x5b41a5[_0x4f27('0x7f')]['AudioFromTts']){return base64Decode(_0x5b41a5[_0x4f27('0x7f')][_0x4f27('0x80')][_0x4f27('0x81')],path[_0x4f27('0x27')](__dirname,_0x4f27('0x28'),rs[_0x4f27('0x29')](0x4)+_0x4f27('0x37')))['then'](function(_0x3c43e4){_0x40b7e9['audiofile']=_0x3c43e4;return _0x40b7e9;});}return _0x40b7e9;});};exports[_0x4f27('0x82')]=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 296f137..8f34e03 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 _0x6d34=['./nda'];(function(_0x44d3f3,_0x9d29eb){var _0x33c0a1=function(_0x14e5ee){while(--_0x14e5ee){_0x44d3f3['push'](_0x44d3f3['shift']());}};_0x33c0a1(++_0x9d29eb);}(_0x6d34,0x151));var _0x46d3=function(_0x5caeb8,_0x2b70ce){_0x5caeb8=_0x5caeb8-0x0;var _0x2c99ef=_0x6d34[_0x5caeb8];return _0x2c99ef;};var nda=require(_0x46d3('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var nda=require('./nda');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 75309eb..fa764b2 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 _0xcd60=['info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData'];(function(_0x583ed9,_0x1edd2b){var _0x4f9bd2=function(_0x4d7a62){while(--_0x4d7a62){_0x583ed9['push'](_0x583ed9['shift']());}};_0x4f9bd2(++_0x1edd2b);}(_0xcd60,0xf0));var _0x0cd6=function(_0x280c72,_0x3c5e34){_0x280c72=_0x280c72-0x0;var _0x1d265e=_0xcd60[_0x280c72];return _0x1d265e;};'use strict';var rp=require(_0x0cd6('0x0'));var url=require(_0x0cd6('0x1'));var logger=require(_0x0cd6('0x2'))(_0x0cd6('0x3'));module[_0x0cd6('0x4')]=function(_0x455593,_0x155444){var _0x498fbe={'method':_0x0cd6('0x5'),'uri':url[_0x0cd6('0x6')](_0x155444[_0x0cd6('0x7')],_0x0cd6('0x8')),'form':{'grant_type':_0x0cd6('0x9'),'username':_0x155444['username'],'password':_0x155444[_0x0cd6('0x9')]},'json':!![]};return rp(_0x498fbe)[_0x0cd6('0xa')](function(_0x47c8b2){var _0x4714bf={'method':'POST','uri':url[_0x0cd6('0x6')](_0x155444[_0x0cd6('0xb')],_0x0cd6('0xc')),'body':{'type':_0x155444[_0x0cd6('0xd')]||_0x0cd6('0xe'),'channelId':'Nda','conversation':{'id':_0x455593[_0x0cd6('0xf')]},'from':{'id':_0x455593[_0x0cd6('0x10')],'name':_0x455593[_0x0cd6('0x11')]},'recipient':{'id':_0x455593[_0x0cd6('0x12')],'name':_0x455593[_0x0cd6('0x13')]},'text':_0x155444['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x47c8b2[_0x0cd6('0x14')]},'json':!![]};if(_0x155444[_0x0cd6('0x15')]){_0x4714bf[_0x0cd6('0x16')]['channelData'][_0x0cd6('0x17')]=_0x155444['project'];}if(_0x155444[_0x0cd6('0x18')]=='1'){_0x4714bf[_0x0cd6('0x16')][_0x0cd6('0x19')][_0x0cd6('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0cd6('0x1b')};}if(_0x155444[_0x0cd6('0x1c')]){_0x4714bf[_0x0cd6('0x16')][_0x0cd6('0x19')][_0x0cd6('0x1d')]=_0x155444[_0x0cd6('0x1c')];if(_0x155444[_0x0cd6('0x1e')]){_0x4714bf[_0x0cd6('0x16')][_0x0cd6('0x19')][_0x0cd6('0x1f')]=_0x155444['custom_action_data'];}}logger[_0x0cd6('0x20')](JSON[_0x0cd6('0x21')](_0x4714bf));return rp(_0x4714bf);});}; \ No newline at end of file +var _0xf430=['ndassistant_url','ndaactivity_type','message','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','password','username'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0xf430,0x1e4));var _0x0f43=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xf430[_0x471448];return _0x38190b;};'use strict';var rp=require(_0x0f43('0x0'));var url=require(_0x0f43('0x1'));var logger=require(_0x0f43('0x2'))('agi');module[_0x0f43('0x3')]=function(_0x7d24d9,_0x5f0981){var _0x4e2851={'method':_0x0f43('0x4'),'uri':url[_0x0f43('0x5')](_0x5f0981[_0x0f43('0x6')],'/token'),'form':{'grant_type':_0x0f43('0x7'),'username':_0x5f0981[_0x0f43('0x8')],'password':_0x5f0981[_0x0f43('0x7')]},'json':!![]};return rp(_0x4e2851)['then'](function(_0x2e8f68){var _0x39bc4c={'method':_0x0f43('0x4'),'uri':url['resolve'](_0x5f0981[_0x0f43('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5f0981[_0x0f43('0xa')]||_0x0f43('0xb'),'channelId':'Nda','conversation':{'id':_0x7d24d9['uniqueid']},'from':{'id':_0x7d24d9[_0x0f43('0xc')],'name':_0x7d24d9[_0x0f43('0xd')]},'recipient':{'id':_0x7d24d9[_0x0f43('0xe')],'name':_0x7d24d9[_0x0f43('0xf')]},'text':_0x5f0981[_0x0f43('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2e8f68[_0x0f43('0x11')]},'json':!![]};if(_0x5f0981[_0x0f43('0x12')]){_0x39bc4c[_0x0f43('0x13')][_0x0f43('0x14')][_0x0f43('0x15')]=_0x5f0981[_0x0f43('0x12')];}if(_0x5f0981[_0x0f43('0x16')]=='1'){_0x39bc4c[_0x0f43('0x13')][_0x0f43('0x14')][_0x0f43('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0f43('0x18')};}if(_0x5f0981['custom_action']){_0x39bc4c[_0x0f43('0x13')][_0x0f43('0x14')]['CustomAction']=_0x5f0981[_0x0f43('0x19')];if(_0x5f0981[_0x0f43('0x1a')]){_0x39bc4c[_0x0f43('0x13')]['channelData'][_0x0f43('0x1b')]=_0x5f0981['custom_action_data'];}}logger[_0x0f43('0x1c')](JSON['stringify'](_0x39bc4c));return rp(_0x39bc4c);});}; \ 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 6af7a63..8996793 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(_0x2e0d7a,_0x58ec52,_0xee5183,_0x50499d){return asr(_0x2e0d7a,_0x58ec52,_0xee5183,_0x50499d);}; \ No newline at end of file +var _0xcd9a=['exports','./lib/api'];(function(_0x2c8bf6,_0x56eab8){var _0x11efa8=function(_0x3f43f0){while(--_0x3f43f0){_0x2c8bf6['push'](_0x2c8bf6['shift']());}};_0x11efa8(++_0x56eab8);}(_0xcd9a,0x1b3));var _0xacd9=function(_0x57ddcd,_0x4bb970){_0x57ddcd=_0x57ddcd-0x0;var _0x244500=_0xcd9a[_0x57ddcd];return _0x244500;};'use strict';var asr=require(_0xacd9('0x0'));module[_0xacd9('0x1')]=function(_0x28c563,_0x26bc91,_0x12a47f,_0x1eff04){return asr(_0x28c563,_0x26bc91,_0x12a47f,_0x1eff04);}; \ 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 ae23b74..f75cc6e 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 _0x6b38=['unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','result','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','message','bluebird','lodash','moment','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket'];(function(_0x1e7fcb,_0x15562b){var _0xed577e=function(_0x2db6d7){while(--_0x2db6d7){_0x1e7fcb['push'](_0x1e7fcb['shift']());}};_0xed577e(++_0x15562b);}(_0x6b38,0x8f));var _0x86b3=function(_0xa6ae78,_0x3aad08){_0xa6ae78=_0xa6ae78-0x0;var _0x371a58=_0x6b38[_0xa6ae78];return _0x371a58;};'use strict';var BPromise=require(_0x86b3('0x0'));var _=require(_0x86b3('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x86b3('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x86b3('0x3'));module[_0x86b3('0x4')]=function(_0x3b6786,_0xf80a9c,_0x1c947f,_0x3abd8f){return new BPromise(function(_0x1cb140,_0x23a3fb){logger[_0x86b3('0x5')](_0x86b3('0x6'),_0x3abd8f||_0x86b3('0x7'));var _0x29ee56=new WebSocket(_0x3abd8f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x172f1f='';var _0x4d17d7='0';var _0x1b3907='1';var _0x2d6e30=_0x86b3('0x8');function _0x49ea0d(_0x22b32e){var _0xa35f48=crypto['createHash'](_0x86b3('0x9'));_0xa35f48[_0x86b3('0xa')](_0x22b32e);return _0xa35f48[_0x86b3('0xb')]('hex');}function _0x30d82e(){try{logger['info'](_0x86b3('0xc'));var _0x1bb9a2=moment()[_0x86b3('0xd')]();var _0xf7f053=_0x49ea0d(_0x1bb9a2+_0xf80a9c+_0x1c947f);_0x29ee56[_0x86b3('0xe')](JSON[_0x86b3('0xf')]({'appID':_0xf80a9c,'timestamp':_0x1bb9a2,'appKey':_0xf7f053}));var _0x3c1f14=fs[_0x86b3('0x10')](_0x3b6786);_0x3c1f14['on'](_0x86b3('0x11'),function(_0x5c13fe){_0x29ee56[_0x86b3('0xe')](_0x5c13fe);});_0x3c1f14['on'](_0x86b3('0x12'),function(){_0x29ee56['send']('EOS');});}catch(_0x215f8d){logger[_0x86b3('0x13')](_0x86b3('0x14'),JSON[_0x86b3('0xf')](_0x215f8d));_0x29ee56[_0x86b3('0x15')]();}}function _0x16fc1a(_0x44773d){try{if(_0x44773d){var _0x52a1bd=JSON[_0x86b3('0x16')](_0x44773d);switch(_0x52a1bd[_0x86b3('0x17')]){case 0x0:if(_0x52a1bd['result']){if(_0x52a1bd['result'][_0x86b3('0x18')]){logger['info'](_0x86b3('0x19'),JSON[_0x86b3('0xf')](_0x52a1bd['result'][_0x86b3('0x1a')]));_0x172f1f=_0x52a1bd['result']['hypotheses'][0x0][_0x86b3('0x1b')];_0x4d17d7=_0x52a1bd[_0x86b3('0x1c')][_0x86b3('0x1a')][0x0][_0x86b3('0x1d')];_0x1b3907='0';_0x2d6e30=_0x86b3('0x1e');_0x29ee56[_0x86b3('0x15')]();}}break;case 0x1:logger[_0x86b3('0x5')](_0x86b3('0x8'));_0x1b3907='1';_0x2d6e30=_0x86b3('0x8');break;case 0x2:logger[_0x86b3('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x1b3907='2';_0x2d6e30=_0x86b3('0x1f');break;case 0x9:logger[_0x86b3('0x5')](_0x86b3('0x20'));_0x1b3907='9';_0x2d6e30=_0x86b3('0x20');break;case 0xa:logger[_0x86b3('0x5')](_0x86b3('0x21'));_0x1b3907='10';_0x2d6e30=_0x86b3('0x21');break;case 0xb:logger[_0x86b3('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1b3907='11';_0x2d6e30=_0x86b3('0x22');}}}catch(_0x4594a1){logger[_0x86b3('0x13')](_0x86b3('0x23'),JSON['stringify'](_0x4594a1));_0x29ee56['terminate']();}}function _0xb68f19(){logger[_0x86b3('0x5')](_0x86b3('0x24'));_0x1cb140({'transcript':_0x172f1f,'confidence':_0x4d17d7,'status':_0x1b3907,'status_message':_0x2d6e30});}function _0x38ae08(_0x316859){logger[_0x86b3('0x13')](_0x86b3('0x25'));if(!_['isNil'](_0x316859)){logger[_0x86b3('0x13')](_['isObject'](_0x316859)?JSON[_0x86b3('0xf')](_0x316859):_0x316859);}}_0x29ee56['on']('open',_0x30d82e);_0x29ee56['on'](_0x86b3('0x26'),_0x16fc1a);_0x29ee56['on'](_0x86b3('0x12'),_0xb68f19);_0x29ee56['on'](_0x86b3('0x13'),_0x38ae08);});}; \ No newline at end of file +var _0x4a29=['Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS'];(function(_0x2c2dad,_0x5dbd27){var _0x5bc367=function(_0x2a398c){while(--_0x2a398c){_0x2c2dad['push'](_0x2c2dad['shift']());}};_0x5bc367(++_0x5dbd27);}(_0x4a29,0xbe));var _0x94a2=function(_0x17a68f,_0x50136c){_0x17a68f=_0x17a68f-0x0;var _0x367be5=_0x4a29[_0x17a68f];return _0x367be5;};'use strict';var BPromise=require(_0x94a2('0x0'));var _=require(_0x94a2('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x94a2('0x2'));var crypto=require(_0x94a2('0x3'));var logger=require(_0x94a2('0x4'))(_0x94a2('0x5'));module[_0x94a2('0x6')]=function(_0x24d13c,_0x594a85,_0x1f9c02,_0x14191e){return new BPromise(function(_0x30d1fd,_0x2cbb98){logger[_0x94a2('0x7')](_0x94a2('0x8'),_0x14191e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1f39e2=new WebSocket(_0x14191e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x2dba94='';var _0xe960f6='0';var _0x1a2b4a='1';var _0x7c472f=_0x94a2('0x9');function _0x1776c1(_0x36d358){var _0x4c4d1f=crypto['createHash'](_0x94a2('0xa'));_0x4c4d1f[_0x94a2('0xb')](_0x36d358);return _0x4c4d1f[_0x94a2('0xc')]('hex');}function _0x9a1110(){try{logger[_0x94a2('0x7')](_0x94a2('0xd'));var _0x2eba63=moment()[_0x94a2('0xe')]();var _0x21bc7f=_0x1776c1(_0x2eba63+_0x594a85+_0x1f9c02);_0x1f39e2[_0x94a2('0xf')](JSON[_0x94a2('0x10')]({'appID':_0x594a85,'timestamp':_0x2eba63,'appKey':_0x21bc7f}));var _0x219851=fs['createReadStream'](_0x24d13c);_0x219851['on'](_0x94a2('0x11'),function(_0x34507e){_0x1f39e2['send'](_0x34507e);});_0x219851['on'](_0x94a2('0x12'),function(){_0x1f39e2[_0x94a2('0xf')](_0x94a2('0x13'));});}catch(_0x15365d){logger['error'](_0x94a2('0x14'),JSON[_0x94a2('0x10')](_0x15365d));_0x1f39e2['terminate']();}}function _0x248582(_0x104d44){try{if(_0x104d44){var _0x5643cf=JSON[_0x94a2('0x15')](_0x104d44);switch(_0x5643cf[_0x94a2('0x16')]){case 0x0:if(_0x5643cf[_0x94a2('0x17')]){if(_0x5643cf[_0x94a2('0x17')][_0x94a2('0x18')]){logger[_0x94a2('0x7')](_0x94a2('0x19'),JSON[_0x94a2('0x10')](_0x5643cf[_0x94a2('0x17')]['hypotheses']));_0x2dba94=_0x5643cf[_0x94a2('0x17')][_0x94a2('0x1a')][0x0][_0x94a2('0x1b')];_0xe960f6=_0x5643cf[_0x94a2('0x17')][_0x94a2('0x1a')][0x0]['likelihood'];_0x1a2b4a='0';_0x7c472f=_0x94a2('0x1c');_0x1f39e2[_0x94a2('0x1d')]();}}break;case 0x1:logger[_0x94a2('0x7')](_0x94a2('0x9'));_0x1a2b4a='1';_0x7c472f=_0x94a2('0x9');break;case 0x2:logger[_0x94a2('0x7')](_0x94a2('0x1e'));_0x1a2b4a='2';_0x7c472f=_0x94a2('0x1e');break;case 0x9:logger['info'](_0x94a2('0x1f'));_0x1a2b4a='9';_0x7c472f=_0x94a2('0x1f');break;case 0xa:logger[_0x94a2('0x7')](_0x94a2('0x20'));_0x1a2b4a='10';_0x7c472f=_0x94a2('0x20');break;case 0xb:logger[_0x94a2('0x7')](_0x94a2('0x21'));_0x1a2b4a='11';_0x7c472f='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x28041f){logger[_0x94a2('0x22')](_0x94a2('0x23'),JSON[_0x94a2('0x10')](_0x28041f));_0x1f39e2[_0x94a2('0x1d')]();}}function _0x462215(){logger[_0x94a2('0x7')](_0x94a2('0x24'));_0x30d1fd({'transcript':_0x2dba94,'confidence':_0xe960f6,'status':_0x1a2b4a,'status_message':_0x7c472f});}function _0x6ea764(_0x7433e4){logger[_0x94a2('0x22')](_0x94a2('0x25'));if(!_[_0x94a2('0x26')](_0x7433e4)){logger[_0x94a2('0x22')](_[_0x94a2('0x27')](_0x7433e4)?JSON[_0x94a2('0x10')](_0x7433e4):_0x7433e4);}}_0x1f39e2['on'](_0x94a2('0x28'),_0x9a1110);_0x1f39e2['on'](_0x94a2('0x29'),_0x248582);_0x1f39e2['on'](_0x94a2('0x12'),_0x462215);_0x1f39e2['on'](_0x94a2('0x22'),_0x6ea764);});}; \ 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 1183f96..391c380 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 _0x5adf=['./asr'];(function(_0x1a29b5,_0x2cc4c9){var _0xc8b6d2=function(_0x17d574){while(--_0x17d574){_0x1a29b5['push'](_0x1a29b5['shift']());}};_0xc8b6d2(++_0x2cc4c9);}(_0x5adf,0x146));var _0xf5ad=function(_0x28a2bd,_0x23dd76){_0x28a2bd=_0x28a2bd-0x0;var _0x4f3a8e=_0x5adf[_0x28a2bd];return _0x4f3a8e;};var asr=require(_0xf5ad('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x954f=['./asr'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x954f,0xd3));var _0xf954=function(_0x59285e,_0xcdcc45){_0x59285e=_0x59285e-0x0;var _0x5f47f5=_0x954f[_0x59285e];return _0x5f47f5;};var asr=require(_0xf954('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 9d7a1e5..7cf8bff 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 _0x3c68=['error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_MAXCONNECTION','destroy','ready','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','EventEmitter','./channel','call','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3c68,0x1c1));var _0x83c6=function(_0x5b0ac7,_0x261372){_0x5b0ac7=_0x5b0ac7-0x0;var _0x377c33=_0x3c68[_0x5b0ac7];return _0x377c33;};'use strict';var util=require(_0x83c6('0x0'));var net=require(_0x83c6('0x1'));var EventEmitter=require(_0x83c6('0x2'))[_0x83c6('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x83c6('0x4'));var AGIServer=function(_0x3f9d08,_0x4f8c01,_0x4ead42){var _0x5e9a2d=this,_0x3f9d08=_0x3f9d08||0x11dd,_0x4f8c01=_0x4f8c01||'127.0.0.1',_0x8290d5=null,_0x180967=0x0;EventEmitter[_0x83c6('0x5')](_0x5e9a2d);function _0x548fc7(){if(!_0x3f9d08){_0x5e9a2d[_0x83c6('0x6')](_0x83c6('0x7'),new AGIError(_0x83c6('0x8')));return![];}_0x8290d5=net[_0x83c6('0x9')]();_0x8290d5['listen'](_0x3f9d08,_0x4f8c01);_0x8290d5['on']('listening',function(){_0x5e9a2d[_0x83c6('0x6')](_0x83c6('0xa'));});_0x8290d5['on'](_0x83c6('0xb'),function(_0x1b7a6f){_0x8290d5[_0x83c6('0xc')](function(_0x2ff448,_0x1cb2b1){if(_0x2ff448){_0x5e9a2d[_0x83c6('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x2ff448));}else if(_0x4ead42&&_0x4ead42<0x0){_0x5e9a2d[_0x83c6('0x6')](_0x83c6('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1b7a6f['destroy']();}else if(_0x4ead42&&_0x4ead42>0x0&&_0x4ead42<_0x1cb2b1){_0x180967+=0x1;_0x5e9a2d['emit'](_0x83c6('0x7'),new AGIError(_0x83c6('0xd'),_0x180967));_0x1b7a6f[_0x83c6('0xe')]();}else{var _0x31ed9f=new AGIChannel(_0x1b7a6f);_0x31ed9f['on'](_0x83c6('0xf'),function(){_0x5e9a2d['emit'](_0x83c6('0xb'),_0x31ed9f);});}});});_0x8290d5['on'](_0x83c6('0x7'),function(_0x14d1d8){_0x5e9a2d['emit'](_0x83c6('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x14d1d8['code']));});_0x8290d5['on']('close',function(){_0x5e9a2d[_0x83c6('0x6')]('close',new AGIError(_0x83c6('0x10')));});}process[_0x83c6('0x11')](function(){_0x548fc7();});};util[_0x83c6('0x12')](AGIServer,EventEmitter);module['exports']=function(_0x46129a,_0xb61a3b,_0xf46e40){return new AGIServer(_0x46129a,_0xb61a3b,_0xf46e40);}; \ No newline at end of file +var _0xae0c=['error','listen','listening','getConnections','emit','E_AGI_SERVER_ERROR','destroy','ready','code','close','nextTick','inherits','util','events','EventEmitter','./error','127.0.0.1','call'];(function(_0x455810,_0x47fa09){var _0x59b21e=function(_0x4920d9){while(--_0x4920d9){_0x455810['push'](_0x455810['shift']());}};_0x59b21e(++_0x47fa09);}(_0xae0c,0x108));var _0xcae0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xae0c[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xcae0('0x0'));var net=require('net');var EventEmitter=require(_0xcae0('0x1'))[_0xcae0('0x2')];var AGIError=require(_0xcae0('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x402382,_0x582ca9,_0x27729e){var _0x30d41f=this,_0x402382=_0x402382||0x11dd,_0x582ca9=_0x582ca9||_0xcae0('0x4'),_0x498283=null,_0xa9baf6=0x0;EventEmitter[_0xcae0('0x5')](_0x30d41f);function _0x2f8d62(){if(!_0x402382){_0x30d41f['emit'](_0xcae0('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x498283=net['createServer']();_0x498283[_0xcae0('0x7')](_0x402382,_0x582ca9);_0x498283['on'](_0xcae0('0x8'),function(){_0x30d41f['emit'](_0xcae0('0x8'));});_0x498283['on']('connection',function(_0x4bbabd){_0x498283[_0xcae0('0x9')](function(_0x57a408,_0x5066a6){if(_0x57a408){_0x30d41f[_0xcae0('0xa')](_0xcae0('0x6'),new AGIError(_0xcae0('0xb'),_0x57a408));}else if(_0x27729e&&_0x27729e<0x0){_0x30d41f[_0xcae0('0xa')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x4bbabd['destroy']();}else if(_0x27729e&&_0x27729e>0x0&&_0x27729e<_0x5066a6){_0xa9baf6+=0x1;_0x30d41f['emit'](_0xcae0('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0xa9baf6));_0x4bbabd[_0xcae0('0xc')]();}else{var _0x4d1773=new AGIChannel(_0x4bbabd);_0x4d1773['on'](_0xcae0('0xd'),function(){_0x30d41f[_0xcae0('0xa')]('connection',_0x4d1773);});}});});_0x498283['on'](_0xcae0('0x6'),function(_0x42e29d){_0x30d41f['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x42e29d[_0xcae0('0xe')]));});_0x498283['on']('close',function(){_0x30d41f[_0xcae0('0xa')](_0xcae0('0xf'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xcae0('0x10')](function(){_0x2f8d62();});};util[_0xcae0('0x11')](AGIServer,EventEmitter);module['exports']=function(_0x492957,_0x398139,_0xdc63fa){return new AGIServer(_0x492957,_0x398139,_0xdc63fa);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e06c250..9a79cef 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 _0x0f6c=['Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','lodash','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','menu','channel','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','Intervals','interval','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','isNil','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','number','timeout','includes','POST','PUT','method','body','headers','computedVariables','sync','render','url','parse','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','isArray','length','replaceObjectAllVariables','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','providerResponse','out','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','maxRetry','retry','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','NOBEEP','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','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','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','no\x20find\x20by\x20configured','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','service','host','port','secure','authentication','auth','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','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','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','arg_1','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Executed\x20command\x20%s\x20%s','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch'];(function(_0x3f2658,_0xbaea6f){var _0x39ef4b=function(_0x5850d3){while(--_0x5850d3){_0x3f2658['push'](_0x3f2658['shift']());}};_0x39ef4b(++_0xbaea6f);}(_0x0f6c,0x1d4));var _0xc0f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0f6c[_0x4cf98e];return _0x1623ac;};'use strict';var fs=require('fs');var path=require(_0xc0f6('0x0'));var util=require('util');var _=require(_0xc0f6('0x1'));var sh=require('shelljs');var odbc=require(_0xc0f6('0x2'))();var rs=require(_0xc0f6('0x3'));var moment=require('moment');var Mustache=require(_0xc0f6('0x4'));var rp=require('request-promise');var logger=require(_0xc0f6('0x5'))(_0xc0f6('0x6'));var config=require(_0xc0f6('0x7'));var scripts=require('./scripts');var FILES_PATH=_0xc0f6('0x8');var recursiveMapAttributes=[_0xc0f6('0x9'),'rawBody'];var verticesWithRetry=[_0xc0f6('0xa'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x2cf839,_0x10d79a,_0x4b9aa8){this[_0xc0f6('0xb')]=_0x2cf839;this[_0xc0f6('0xc')]=_0x10d79a;this[_0xc0f6('0xd')]=_0x4b9aa8;};AGIVertices[_0xc0f6('0xe')]['getVariable']=function(_0x5d2569,_0x4b6c05){this['rpc'][_0xc0f6('0xf')](_0x5d2569)['then'](function(_0xdf14b9){_0x4b6c05(null,_0xdf14b9?_0xdf14b9[_0xc0f6('0x10')]:![]);})[_0xc0f6('0x11')](function(_0x1ff540){_0x4b6c05(_0x1ff540);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x12')]=function(_0x2139be,_0x281145){this[_0xc0f6('0xc')][_0xc0f6('0x13')](_0x2139be)[_0xc0f6('0x14')](function(_0x2c22c6){_0x281145(null,_0x2c22c6?_0x2c22c6['name']:![]);})['catch'](function(_0x1bd7ce){_0x281145(_0x1bd7ce);});};AGIVertices[_0xc0f6('0xe')]['getSquareProject']=function(_0xacfe72,_0x37d08e){this[_0xc0f6('0xc')][_0xc0f6('0x15')](_0xacfe72)[_0xc0f6('0x14')](function(_0x217ec3){_0x37d08e(null,_0x217ec3?_0x217ec3[_0xc0f6('0x10')]:![]);})['catch'](function(_0x389ccd){_0x37d08e(_0x389ccd);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x16')]=function(_0x4953ed,_0x1bb08a){this[_0xc0f6('0xc')]['getSquareOdbcById'](_0x4953ed)['then'](function(_0x3a2315){_0x1bb08a(null,_0x3a2315?_0x3a2315[_0xc0f6('0x17')]:![]);})[_0xc0f6('0x11')](function(_0x16f6f7){_0x1bb08a(_0x16f6f7);});};AGIVertices[_0xc0f6('0xe')]['getUser']=function(_0x136871,_0x25342d){this['rpc'][_0xc0f6('0x18')](_0x136871)[_0xc0f6('0x14')](function(_0x54cc3b){_0x25342d(null,_0x54cc3b?_0x54cc3b[_0xc0f6('0x10')]:![]);})[_0xc0f6('0x11')](function(_0x5ee087){_0x25342d(_0x5ee087);});};AGIVertices['prototype'][_0xc0f6('0x19')]=function(_0x5804c9,_0x3e7d3c){this[_0xc0f6('0xc')][_0xc0f6('0x1a')](_0x5804c9)[_0xc0f6('0x14')](function(_0x318223){_0x3e7d3c(null,_0x318223?_0x318223['name']:![]);})['catch'](function(_0x14b674){_0x3e7d3c(_0x14b674);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1b')]=function(_0x545d3e,_0x4cb1d7){var _0x1e0bf1=this;this[_0xc0f6('0xc')][_0xc0f6('0x1c')](_0x545d3e)[_0xc0f6('0x14')](function(_0x4ba885){_0x4cb1d7(null,_0x4ba885?_0x1e0bf1[_0xc0f6('0x1d')](_0x4ba885[_0xc0f6('0x1e')]):![]);})[_0xc0f6('0x11')](function(_0x416a8b){_0x4cb1d7(_0x416a8b);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1f')]=function(_0x1128bb,_0x45bee9){this['rpc']['getMailAccountById'](_0x1128bb)[_0xc0f6('0x14')](function(_0x4f847c){_0x45bee9(null,_0x4f847c?_0x4f847c:![]);})[_0xc0f6('0x11')](function(_0x5a94d0){_0x45bee9(_0x5a94d0);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x20')]=function(_0x55ef20,_0x2e44e0,_0x165753){this[_0xc0f6('0xd')][_0xc0f6('0x20')](_0x55ef20,_0x2e44e0)[_0xc0f6('0x14')](function(){_0x165753(null);})[_0xc0f6('0x11')](function(_0x24fbe1){_0x165753(_0x24fbe1);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x21')]=function(_0x99f8a2,_0x50367f){this[_0xc0f6('0xc')]['getIntervalById'](_0x99f8a2)[_0xc0f6('0x14')](function(_0x557ad4){if(_0x557ad4){if(_0x557ad4[_0xc0f6('0x22')]){_0x50367f(null,[_0x557ad4['interval']]);}else{_0x50367f(null,_['map'](_0x557ad4[_0xc0f6('0x23')],_0xc0f6('0x24')));}}else{_0x50367f(null,![]);}})[_0xc0f6('0x11')](function(_0x44c91b){_0x50367f(_0x44c91b);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1d')]=function(_0x259090){return util['format'](_0xc0f6('0x25'),FILES_PATH,_0x259090);};AGIVertices['prototype'][_0xc0f6('0x26')]=function(_0xaa8189,_0x3e3f08,_0x308fe8){odbc['open'](_0xaa8189,function(_0x4e739b){if(_0x4e739b){logger[_0xc0f6('0x27')](_0xc0f6('0x28'),_0x4e739b);_0x308fe8(_0x4e739b);}else{logger[_0xc0f6('0x29')](_0xc0f6('0x2a'));odbc[_0xc0f6('0x2b')](_0x3e3f08,function(_0x1cefb2,_0x210c2d){if(_0x1cefb2){logger[_0xc0f6('0x29')]('Error\x20executing\x20query\x20%s',_0x3e3f08);_0x308fe8(_0x1cefb2);}else{logger['info'](_0xc0f6('0x2c'),_0x3e3f08);odbc[_0xc0f6('0x2d')](function(_0x1429d1){if(_0x1429d1){logger[_0xc0f6('0x27')](_0xc0f6('0x2e'),_0x1429d1);}_0x308fe8(null,_0x210c2d);});}});}});};AGIVertices[_0xc0f6('0xe')]['getSmsAccount']=function(_0x422921,_0x41e1d6){this['rpc'][_0xc0f6('0x2f')](_0x422921)[_0xc0f6('0x14')](function(_0x5911dd){_0x41e1d6(null,_0x5911dd?_0x5911dd:![]);})[_0xc0f6('0x11')](function(_0x2db558){_0x41e1d6(_0x2db558);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x30')]=function(_0x459efc,_0x51e693){this[_0xc0f6('0xc')][_0xc0f6('0x30')](_0x459efc)[_0xc0f6('0x14')](function(_0x551e69){_0x51e693(null,_0x551e69);})[_0xc0f6('0x11')](function(_0x25960c){_0x51e693(_0x25960c);});};AGIVertices['prototype'][_0xc0f6('0x31')]=function(_0x399cbd,_0x192f3d,_0x349896){this[_0xc0f6('0xc')][_0xc0f6('0x31')]({'uniqueid':this[_0xc0f6('0xb')][_0xc0f6('0x32')],'node':_0x399cbd[_0xc0f6('0x33')],'application':_0x399cbd[_0xc0f6('0x34')],'data':_0x192f3d||null,'project_name':this[_0xc0f6('0xb')]['arg_1'],'callerid':this['channel']['callerid']})[_0xc0f6('0x14')](function(_0x5c8fe4){if(_0x349896){_0x349896(null,_0x5c8fe4);}})[_0xc0f6('0x11')](function(_0x19305f){if(_0x349896){_0x349896(_0x19305f);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x448fce,_0x5d7c37,_0x2c0d52,_0x7d1bae){this[_0xc0f6('0xc')]['createSquareRecording']({'uniqueid':this['channel'][_0xc0f6('0x32')],'callerid':this['channel'][_0xc0f6('0x35')],'calleridname':this[_0xc0f6('0xb')]['calleridname'],'context':this['channel']['context'],'extension':this['channel'][_0xc0f6('0x36')],'priority':this[_0xc0f6('0xb')]['priority'],'accountcode':this['channel'][_0xc0f6('0x37')],'dnid':this['channel'][_0xc0f6('0x38')],'projectName':this[_0xc0f6('0xb')]['arg_1'],'saveName':_0x5d7c37,'filename':_0x448fce[_0xc0f6('0x39')]||_0x5d7c37,'savePath':_0x2c0d52})['then'](function(_0x2e3738){_0x7d1bae(null,_0x2e3738);})[_0xc0f6('0x11')](function(_0x4813b5){_0x7d1bae(_0x4813b5);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x3a')]=function(_0x732ef9,_0x1b1b17,_0x296406,_0x34489f,_0x4452d5){this[_0xc0f6('0xc')][_0xc0f6('0x3a')]({'uniqueid':this[_0xc0f6('0xb')][_0xc0f6('0x32')],'body':_0x732ef9,'direction':_0x1b1b17,'providerName':_0x296406,'providerResponse':_0x34489f})[_0xc0f6('0x14')](function(_0x555174){if(_0x4452d5){_0x4452d5(null,_0x555174);}})[_0xc0f6('0x11')](function(_0x27938d){if(_0x4452d5){_0x4452d5(_0x27938d);}});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x3b')]=function(_0x2dd45d,_0x8ab1b9){this[_0xc0f6('0xc')][_0xc0f6('0x3b')]({'firstName':_[_0xc0f6('0x3c')](_0x2dd45d[_0xc0f6('0x10')])||_['isNil'](_0x2dd45d['name'])?_0xc0f6('0x3d')+Math[_0xc0f6('0x3e')]():_0x2dd45d['name'],'lastName':_['isEmpty'](_0x2dd45d[_0xc0f6('0x3f')])||_['isNil'](_0x2dd45d[_0xc0f6('0x3f')])?null:_0x2dd45d[_0xc0f6('0x3f')],'phone':_0x2dd45d[_0xc0f6('0x40')],'ListId':_0x2dd45d[_0xc0f6('0x41')],'scheduledat':_0x2dd45d[_0xc0f6('0x42')],'callbackUniqueid':this[_0xc0f6('0xb')][_0xc0f6('0x32')],'tags':_0xc0f6('0x43'),'description':_0xc0f6('0x44')+_0x2dd45d[_0xc0f6('0x42')][_0xc0f6('0x45')](),'priority':_0x2dd45d[_0xc0f6('0x46')]})[_0xc0f6('0x14')](function(_0x4e39be){_0x8ab1b9(null,_0x4e39be);})[_0xc0f6('0x11')](function(_0x2ad4bc){_0x8ab1b9(_0x2ad4bc);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x47')]=function(_0x492761,_0x15680f){this[_0xc0f6('0xc')][_0xc0f6('0x48')](_0x492761)['then'](function(_0x389867){_0x15680f(null,_0x389867?_0x389867['name']:![]);})['catch'](function(_0x322e63){_0x15680f(_0x322e63);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x49')]=function(_0x36cb85,_0x138353,_0x2cedb7){var _0x5f4dde={'role':'agent'};_0x5f4dde[_0x36cb85]=this[_0xc0f6('0xb')][_0xc0f6('0x35')];this['rpc'][_0xc0f6('0x49')](_0x5f4dde,_0x138353,this[_0xc0f6('0xb')][_0xc0f6('0x32')])[_0xc0f6('0x14')](function(_0x220651){_0x2cedb7(null,_[_0xc0f6('0x4a')](_0x220651)?![]:!![]);})['catch'](function(_0x3667fe){logger['error'](_0x3667fe);_0x2cedb7(null,![]);});};AGIVertices[_0xc0f6('0xe')]['agentUnpause']=function(_0x2e8474,_0x419143){var _0x134a57={'role':_0xc0f6('0x4b')};_0x134a57[_0x2e8474]=this[_0xc0f6('0xb')]['callerid'];this['rpc'][_0xc0f6('0x4c')](_0x134a57)[_0xc0f6('0x14')](function(_0x18ef07){_0x419143(null,_[_0xc0f6('0x4a')](_0x18ef07)?![]:!![]);})[_0xc0f6('0x11')](function(_0xa14f4){logger['error'](_0xa14f4);_0x419143(null,![]);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x4d')]=function(_0x4de5f4,_0x2a5947){var _0x3c462f={'role':_0xc0f6('0x4b')};_0x3c462f[_0x4de5f4]=this[_0xc0f6('0xb')][_0xc0f6('0x35')];this['rpc'][_0xc0f6('0x4d')](_0x3c462f)['then'](function(_0x14c347){_0x2a5947(null,_[_0xc0f6('0x4a')](_0x14c347)?![]:!![]);})['catch'](function(_0x435d94){logger[_0xc0f6('0x27')](_0x435d94);_0x2a5947(null,![]);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x4e')]=function(_0x53db25,_0x3cbed2){var _0x2a0581={'role':_0xc0f6('0x4b')};_0x2a0581[_0x53db25]=this['channel'][_0xc0f6('0x35')];var _0x541269=_0x53db25!=_0xc0f6('0x4f')?util[_0xc0f6('0x50')](_0xc0f6('0x51'),_0xc0f6('0x52'),this[_0xc0f6('0xb')][_0xc0f6('0x35')]):undefined;this[_0xc0f6('0xc')][_0xc0f6('0x4e')](_0x2a0581,_0x541269)['then'](function(_0x108f5c){_0x3cbed2(null,_['isNil'](_0x108f5c)?![]:!![]);})[_0xc0f6('0x11')](function(_0x3a8acd){logger[_0xc0f6('0x27')](_0x3a8acd);_0x3cbed2(null,![]);});};AGIVertices['prototype'][_0xc0f6('0x53')]=function(_0x56d251,_0x17d775){sh['exec'](_[_0xc0f6('0x54')](_0x56d251),function(_0x3b2f72,_0xadb7e2){var _0x2bd784=_0xadb7e2[_0xc0f6('0x55')](/(\r\n|\n|\r)/gm,'');_0x17d775(null,_0x2bd784);});};AGIVertices[_0xc0f6('0xe')]['googleCloudTTS']=function(_0x395b3e,_0x45e649){scripts[_0xc0f6('0x56')](_0x395b3e[_0xc0f6('0x57')],_0x395b3e[_0xc0f6('0x58')]||_0xc0f6('0x59'),_0x395b3e[_0xc0f6('0x59')],_0x395b3e[_0xc0f6('0x5a')]||_0xc0f6('0x5b'),_0x395b3e[_0xc0f6('0x5c')]||_0xc0f6('0x5d'),_0x395b3e[_0xc0f6('0x5e')]||_0xc0f6('0x5f'))[_0xc0f6('0x14')](function(_0x183442){_0x45e649(null,_0x183442);})[_0xc0f6('0x11')](function(_0x3c6774){_0x45e649(_0x3c6774);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x60')]=function(_0x36630a,_0x1045fc){scripts[_0xc0f6('0x60')](_0x36630a[_0xc0f6('0x59')],_0x36630a['google_tts_language']||'en',0x1)[_0xc0f6('0x14')](function(_0x27dffc){_0x1045fc(null,_0x27dffc);})[_0xc0f6('0x11')](function(_0x99b1c7){_0x1045fc(_0x99b1c7);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x61')]=function(_0x93a0a7,_0xa1c8bc){var _0x1053b9={'uri':_0x93a0a7['url'],'method':_0x93a0a7['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x93a0a7['timeout'])===_0xc0f6('0x62')&&parseInt(_0x93a0a7[_0xc0f6('0x63')])>=0x1?parseInt(_0x93a0a7[_0xc0f6('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xc0f6('0x64')]([_0xc0f6('0x65'),_0xc0f6('0x66')],_0x1053b9[_0xc0f6('0x67')]['toUpperCase']())){try{_0x1053b9[_0xc0f6('0x68')]=_0x93a0a7['rawBody']?JSON['parse'](_0x93a0a7['rawBody']):{};}catch(_0x53c797){logger[_0xc0f6('0x27')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x53c797);}}try{_0x1053b9[_0xc0f6('0x69')]=_0x93a0a7['rawHeaders']?JSON['parse'](_0x93a0a7[_0xc0f6('0x9')]):{};}catch(_0x5ac92f){logger[_0xc0f6('0x27')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5ac92f);}if(_0x93a0a7[_0xc0f6('0x6a')]){try{var _0x4ad349=require(_0x93a0a7['computedVariables'])[_0xc0f6('0x6b')](this,_0x1053b9);_0x1053b9['uri']=Mustache[_0xc0f6('0x6c')](_0x93a0a7[_0xc0f6('0x6d')],_0x4ad349,{},['$$','$$']);if(_0x1053b9['headers']){_0x1053b9['headers']=JSON[_0xc0f6('0x6e')](Mustache[_0xc0f6('0x6c')](JSON[_0xc0f6('0x6f')](_0x1053b9[_0xc0f6('0x69')]),_0x4ad349,{},['$$','$$']));}if(_0x1053b9[_0xc0f6('0x68')]){_0x1053b9[_0xc0f6('0x68')]=JSON[_0xc0f6('0x6e')](Mustache[_0xc0f6('0x6c')](JSON[_0xc0f6('0x6f')](_0x1053b9[_0xc0f6('0x68')]),_0x4ad349,{},['$$','$$']));}}catch(_0x5cfd00){logger[_0xc0f6('0x27')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5cfd00);}}rp(_0x1053b9)['then'](function(_0x90951b){var _0x370970={'statusCode':_0x90951b['statusCode']||0xc8,'statusMessage':_0x90951b['statusMessage']||'OK','headers':_0x90951b[_0xc0f6('0x69')]||{},'body':_0x90951b[_0xc0f6('0x68')]||{}};_0xa1c8bc(null,_0x370970);})[_0xc0f6('0x11')](function(_0x5a6c97){var _0x33674f={'statusCode':_0x5a6c97[_0xc0f6('0x70')]||0x1f4,'statusMessage':_0x5a6c97[_0xc0f6('0x71')]||_0xc0f6('0x72'),'headers':_0x5a6c97[_0xc0f6('0x73')][_0xc0f6('0x69')]||{},'body':_0x5a6c97[_0xc0f6('0x73')][_0xc0f6('0x68')]||{}};_0xa1c8bc(null,_0x33674f);});};AGIVertices['prototype']['googleDialogflow']=function(_0x4233c0,_0x4331f1){scripts[_0xc0f6('0x74')](this[_0xc0f6('0xb')][_0xc0f6('0x32')],_0x4233c0['key'],_0x4233c0[_0xc0f6('0x59')],_0x4233c0[_0xc0f6('0x75')]||'en')[_0xc0f6('0x14')](function(_0xc31bb3){_0x4331f1(null,_0xc31bb3);})['catch'](function(_0x562c3a){_0x4331f1(_0x562c3a);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x76')]=function(_0x1310cc,_0x1e577b){scripts[_0xc0f6('0x76')](this['channel'][_0xc0f6('0x32')],_0x1310cc[_0xc0f6('0x77')],_0x1310cc['client_email'],_0x1310cc[_0xc0f6('0x78')],_0x1310cc['text'],_0x1310cc[_0xc0f6('0x79')]||'en')['then'](function(_0x4b7bec){_0x1e577b(null,_0x4b7bec);})[_0xc0f6('0x11')](function(_0xbbba0d){_0x1e577b(_0xbbba0d);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x7a')]=function(_0x2cd2b8,_0x420092){scripts[_0xc0f6('0x7a')](this[_0xc0f6('0xb')],_0x2cd2b8)[_0xc0f6('0x14')](function(_0x558f95){_0x420092(null,_0x558f95);})[_0xc0f6('0x11')](function(_0x1cd0f3){_0x420092(_0x1cd0f3);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x7b')]=function(_0x5a58dd,_0x3c83dc){scripts[_0xc0f6('0x7b')](_0x5a58dd[_0xc0f6('0x7c')],_0x5a58dd[_0xc0f6('0x59')],_0x5a58dd['ispeech_tts_language']||_0xc0f6('0x5b'),_0x5a58dd[_0xc0f6('0x7d')])[_0xc0f6('0x14')](function(_0x5104d1){_0x3c83dc(null,_0x5104d1);})[_0xc0f6('0x11')](function(_0x5bd27e){_0x3c83dc(_0x5bd27e);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x7e')]=function(_0x4be172,_0x405660,_0x4f52ab){scripts[_0xc0f6('0x7e')](_0x405660,_0x4be172[_0xc0f6('0x7c')],_0x4be172[_0xc0f6('0x7f')]||_0xc0f6('0x5b'),this[_0xc0f6('0x80')](_0x4be172[_0xc0f6('0x81')])?_0x4be172[_0xc0f6('0x81')]:undefined)[_0xc0f6('0x14')](function(_0x1da996){_0x4f52ab(null,_0x1da996);})[_0xc0f6('0x11')](function(_0x46bca3){_0x4f52ab(_0x46bca3);});};AGIVertices['prototype']['awsPolly']=function(_0x4175c8,_0x1d9a3b){scripts[_0xc0f6('0x82')](_0x4175c8[_0xc0f6('0x83')],_0x4175c8[_0xc0f6('0x84')],_0x4175c8['aws_polly_region'],_0x4175c8['aws_polly_voice']||_0xc0f6('0x85'),_0x4175c8[_0xc0f6('0x59')],_0x4175c8[_0xc0f6('0x86')]||'text')[_0xc0f6('0x14')](function(_0x1a2327){_0x1d9a3b(null,_0x1a2327);})[_0xc0f6('0x11')](function(_0x52b678){_0x1d9a3b(_0x52b678);});};AGIVertices['prototype']['awsLex']=function(_0x28cb84,_0x591973){scripts[_0xc0f6('0x87')](this['channel'][_0xc0f6('0x32')],_0x28cb84[_0xc0f6('0x83')],_0x28cb84[_0xc0f6('0x84')],_0x28cb84[_0xc0f6('0x88')],_0x28cb84['text'],_0x28cb84['aws_bot_name'])[_0xc0f6('0x14')](function(_0x578ec4){_0x591973(null,_0x578ec4);})['catch'](function(_0x23bb9e){_0x591973(_0x23bb9e);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x89')]=function(_0x53a96c,_0x1a0964,_0x32f0ac){scripts[_0xc0f6('0x89')](_0x1a0964,_0x53a96c['key'],_0x53a96c['google_asr_language']||_0xc0f6('0x5b'))[_0xc0f6('0x14')](function(_0x33257f){_0x32f0ac(null,_0x33257f);})[_0xc0f6('0x11')](function(_0x27da34){_0x32f0ac(_0x27da34);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x8a')]=function(_0x2fed7f,_0x35670e,_0x21469d){scripts['tildeASR'](_0x35670e,_0x2fed7f['appid'],_0x2fed7f[_0xc0f6('0x8b')],_0x2fed7f[_0xc0f6('0x8c')])[_0xc0f6('0x14')](function(_0x2da205){_0x21469d(null,_0x2da205);})[_0xc0f6('0x11')](function(_0x53727d){_0x21469d(_0x53727d);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x8d')]=function(_0xe8ff47){var _0x39ba8d=_[_0xc0f6('0x64')](verticesWithRetry,_0xe8ff47[_0xc0f6('0x34')])?_0xe8ff47:_[_0xc0f6('0x8e')](_0xe8ff47);for(var _0x2a2ad1 in _0x39ba8d){if(_0x39ba8d[_0xc0f6('0x8f')](_0x2a2ad1)){if(_0x39ba8d[_0x2a2ad1]&&_[_0xc0f6('0x90')](_0x39ba8d[_0x2a2ad1])){if(_[_0xc0f6('0x64')](recursiveMapAttributes,_0x2a2ad1)){_0x39ba8d[_0x2a2ad1]=this['replaceObjectAllVariables'](_0x39ba8d[_0x2a2ad1]);}else{_0x39ba8d[_0x2a2ad1]=this[_0xc0f6('0x91')](_0x39ba8d[_0x2a2ad1]);}}}}return _0x39ba8d;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x92')]=function(_0x36f755){for(var _0x49065c in _0x36f755){if(_0x36f755[_0xc0f6('0x8f')](_0x49065c)){if(_[_0xc0f6('0x93')](_0x36f755[_0x49065c])){this[_0xc0f6('0x92')](_0x36f755[_0x49065c]);}else if(_['isArray'](_0x36f755[_0x49065c])){for(var _0x1a00d9=0x0;_0x1a00d9<_0x36f755[_0x49065c]['length'];_0x1a00d9++){this['recursiveNodeIndex'](_0x36f755[_0x49065c][_0x1a00d9]);}}else if(_[_0xc0f6('0x90')](_0x36f755[_0x49065c])){_0x36f755[_0x49065c]=this[_0xc0f6('0x91')](_0x36f755[_0x49065c]);}}}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x94')]=function(_0x222916,_0x150f22){for(var _0xfaef5a in _0x222916){if(_0x222916['hasOwnProperty'](_0xfaef5a)){if(_['isPlainObject'](_0x222916[_0xfaef5a])){if(!_[_0xc0f6('0x3c')](_0x222916[_0xfaef5a])){this[_0xc0f6('0x94')](_0x222916[_0xfaef5a],util['format'](_0xc0f6('0x95'),_0x150f22,_0xfaef5a));}}else if(_[_0xc0f6('0x96')](_0x222916[_0xfaef5a])){for(var _0x493e90=0x0;_0x493e90<_0x222916[_0xfaef5a][_0xc0f6('0x97')];_0x493e90++){this[_0xc0f6('0x94')](_0x222916[_0xfaef5a][_0x493e90],util[_0xc0f6('0x50')](_0xc0f6('0x95'),_0x150f22,_0xfaef5a+'['+_0x493e90+']'));}}else{if(!_[_0xc0f6('0x4a')](_0x222916[_0xfaef5a])){this[_0xc0f6('0xb')]['setVariable'](util[_0xc0f6('0x50')](_0xc0f6('0x95'),_0x150f22,_0xfaef5a),_0x222916[_0xfaef5a]);}}}}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x98')]=function(_0x13f7c1){try{var _0x23cfcb=JSON[_0xc0f6('0x6e')](_0x13f7c1);this['recursiveNodeIndex'](_0x23cfcb);return JSON['stringify'](_0x23cfcb);}catch(_0x49b320){return this[_0xc0f6('0x91')](_0x13f7c1);}};AGIVertices['prototype'][_0xc0f6('0x91')]=function(_0x2abce5){var _0x409249=_0x2abce5[_0xc0f6('0x99')]('{');for(var _0x3a38e4=0x1;_0x3a38e4<_0x409249[_0xc0f6('0x97')];_0x3a38e4+=0x1){var _0x1f4b14=_0x409249[_0x3a38e4]['split']('}');if(_0x1f4b14[_0xc0f6('0x97')]>0x1){_0x2abce5=_0x2abce5[_0xc0f6('0x9a')]('{'+_0x1f4b14[0x0]+'}',this['channel'][_0xc0f6('0x9b')](_0x1f4b14[0x0])[_0xc0f6('0x9c')]||_0x1f4b14[0x0]);}}if(_0x409249['length']===0x1){return _0x2abce5[_0xc0f6('0x45')]();}return this[_0xc0f6('0x91')](_0x2abce5);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x9d')]=function(_0xb273f,_0x14e894){var _0x14b212=this[_0xc0f6('0xb')][_0xc0f6('0x9b')](_0xb273f);if(_0x14b212['result']===-0x1){return _0x14b212;}logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x9e'),_0x14e894,_0x14b212[_0xc0f6('0x9c')]));return this['channel']['setVariable'](_0x14e894,_0x14b212[_0xc0f6('0x9c')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x80')]=function(_0xa06eb8){return _0xa06eb8&&_0xa06eb8!=='0'&&_0xa06eb8!=='-1'&&_0xa06eb8!=='';};AGIVertices[_0xc0f6('0xe')]['maxRetry']=function(_0x36c485){this['createSquareDetailsReport'][_0xc0f6('0x6b')](this,_0x36c485,'-');_0x36c485['retry']=_0x36c485['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc0f6('0xe')]['mrcpsynth']=function(_0x1b5ea8){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x9f'),_0x1b5ea8[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x1b5ea8[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20text\x20configured');}var _0x289b0e='\x22'+_0x1b5ea8[_0xc0f6('0x59')]+'\x22';if(this[_0xc0f6('0x80')](_0x1b5ea8[_0xc0f6('0x73')])){_0x289b0e+=','+_0x1b5ea8[_0xc0f6('0x73')];}var _0x3f60eb=this['channel']['exec'](_0xc0f6('0xa1'),_0x289b0e);if(_0x3f60eb[_0xc0f6('0xa2')]===-0x1){return _0x3f60eb;}return this['channel'][_0xc0f6('0xa0')](util['format'](_0xc0f6('0xa3'),_0x289b0e));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xa4')]=function(_0x1d8f2e){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0xa5'),_0x1d8f2e[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x1d8f2e['grammar'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20grammar\x20configured');}var _0x36b202=_0x1d8f2e[_0xc0f6('0xa6')];if(this[_0xc0f6('0x80')](_0x1d8f2e['options'])){_0x36b202+=','+_0x1d8f2e[_0xc0f6('0x73')];}var _0x2ea619=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0xa8'),_0x36b202);if(_0x2ea619[_0xc0f6('0xa2')]===-0x1){return _0x2ea619;}var _0x9f2392=this[_0xc0f6('0x9d')](_0xc0f6('0xa9'),_0xc0f6('0xaa'));if(_0x9f2392['result']===-0x1){return _0x9f2392;}var _0x40fe54=this[_0xc0f6('0x9d')](_0xc0f6('0xab'),'MRCP_RECOG_TRANSCRIPT');if(_0x40fe54[_0xc0f6('0xa2')]===-0x1){return _0x40fe54;}var _0x51604d=this[_0xc0f6('0x9d')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x51604d['result']===-0x1){return _0x51604d;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xac'),_0x36b202));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x6')]=function(_0x486e0c){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0xad'),_0x486e0c['label']));return this['channel']['agi']([_0x486e0c[_0xc0f6('0xae')],_0x486e0c['args']]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xaf')]=function(_0x21dae0){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xb0'),_0x21dae0[_0xc0f6('0x33')]));if(this[_0xc0f6('0x80')](_0x21dae0['timeout'])){logger[_0xc0f6('0x29')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x21dae0[_0xc0f6('0x63')]));var _0x308d20=this[_0xc0f6('0xb')][_0xc0f6('0xb1')](_0x21dae0[_0xc0f6('0x63')]);if(_0x308d20['result']===-0x1){return _0x308d20;}}return this[_0xc0f6('0xb')][_0xc0f6('0xaf')]();};AGIVertices['prototype'][_0xc0f6('0x43')]=function(_0x4926c2){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0xb2'),_0x4926c2[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x4926c2['list_id'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4926c2,_0xc0f6('0xb3'));}_0x4926c2[_0xc0f6('0x42')]=moment();if(this[_0xc0f6('0x80')](_0x4926c2['delay'])){_0x4926c2[_0xc0f6('0x42')]=moment()[_0xc0f6('0xb4')](_0x4926c2['delay'],'minutes');}if(!this['isConfigured'](_0x4926c2[_0xc0f6('0x46')])){_0x4926c2[_0xc0f6('0x46')]=0x2;}this[_0xc0f6('0x3b')][_0xc0f6('0x6b')](this,_0x4926c2);return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xb5'),_0x4926c2[_0xc0f6('0x40')],_0x4926c2[_0xc0f6('0x41')],_0x4926c2[_0xc0f6('0x42')]));};AGIVertices['prototype'][_0xc0f6('0xb6')]=function(_0x2ac697){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2ac697[_0xc0f6('0x33')]));var _0x4bcbb3=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0x2ac697['application'],_0x2ac697[_0xc0f6('0x73')]);if(_0x4bcbb3['result']===-0x1){return _0x4bcbb3;}return this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s\x20%s',_0x2ac697[_0xc0f6('0xb7')],_0x2ac697['options']));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xb8')]=function(_0x376bb2){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xb9'),_0x376bb2[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x376bb2[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0xba'));}var _0x542e6d='\x22'+_0x376bb2[_0xc0f6('0x59')]+'\x22';if(this['isConfigured'](_0x376bb2[_0xc0f6('0x73')])){_0x542e6d+=','+_0x376bb2[_0xc0f6('0x73')];}var _0x3524f2=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xa1'),_0x542e6d);if(_0x3524f2[_0xc0f6('0xa2')]===-0x1){return _0x3524f2;}return this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xa3'),_0x542e6d));};AGIVertices[_0xc0f6('0xe')]['sestektts']=function(_0x59aaaa){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xbb'),_0x59aaaa[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x59aaaa[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0xba'));}var _0x4b61d5='\x22'+_0x59aaaa[_0xc0f6('0x59')]+'\x22';if(this[_0xc0f6('0x80')](_0x59aaaa[_0xc0f6('0x73')])){_0x4b61d5+=','+_0x59aaaa[_0xc0f6('0x73')];}var _0x578752=this['channel']['exec'](_0xc0f6('0xa1'),_0x4b61d5);if(_0x578752[_0xc0f6('0xa2')]===-0x1){return _0x578752;}return this[_0xc0f6('0xb')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4b61d5));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xbc')]=function(_0x25e573){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x25e573[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x25e573['grammar'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xbd'));}var _0x13f9e2=_0x25e573[_0xc0f6('0xa6')];if(this[_0xc0f6('0x80')](_0x25e573[_0xc0f6('0x73')])){_0x13f9e2+=','+_0x25e573[_0xc0f6('0x73')];}var _0x38c828=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0xa8'),_0x13f9e2);if(_0x38c828[_0xc0f6('0xa2')]===-0x1){return _0x38c828;}var _0xf3db58=this[_0xc0f6('0x9d')](_0xc0f6('0xa9'),_0xc0f6('0xbe'));if(_0xf3db58[_0xc0f6('0xa2')]===-0x1){return _0xf3db58;}var _0x199690=this[_0xc0f6('0x9d')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x199690['result']===-0x1){return _0x199690;}var _0x6712a8=this[_0xc0f6('0x9d')](_0xc0f6('0xbf'),_0xc0f6('0xc0'));if(_0x6712a8[_0xc0f6('0xa2')]===-0x1){return _0x6712a8;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20MRCPRecog\x20%s',_0x13f9e2));};AGIVertices['prototype'][_0xc0f6('0xc1')]=function(_0x310d07){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0xc2'),_0x310d07['label']));if(!this['isConfigured'](_0x310d07['grammar'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xbd'));}var _0x317e16=_0x310d07[_0xc0f6('0xa6')];if(this[_0xc0f6('0x80')](_0x310d07[_0xc0f6('0x73')])){_0x317e16+=','+_0x310d07[_0xc0f6('0x73')];}var _0xbefbd6=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xa8'),_0x317e16);if(_0xbefbd6[_0xc0f6('0xa2')]===-0x1){return _0xbefbd6;}var _0xea7ab3=this[_0xc0f6('0x9d')]('RECOG_CONFIDENCE()',_0xc0f6('0xc3'));if(_0xea7ab3['result']===-0x1){return _0xea7ab3;}var _0x5b0d4c=this[_0xc0f6('0x9d')]('RECOG_INPUT()',_0xc0f6('0xc4'));if(_0x5b0d4c['result']===-0x1){return _0x5b0d4c;}var _0x1ac0c6=this[_0xc0f6('0x9d')]('RECOG_INSTANCE()',_0xc0f6('0xc5'));if(_0x1ac0c6['result']===-0x1){return _0x1ac0c6;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x317e16));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xc6')]=function(_0x4fb9c3){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0xc7'),_0x4fb9c3['label']));if(!this['isConfigured'](_0x4fb9c3['odbc_id'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4fb9c3,_0xc0f6('0xc8'));}var _0x46bdbe=this['getSquareOdbc']['sync'](this,_0x4fb9c3[_0xc0f6('0xc9')]);if(!_0x46bdbe){return this['channel'][_0xc0f6('0x27')](_0x4fb9c3,_0xc0f6('0xca'));}if(!this[_0xc0f6('0x80')](_0x4fb9c3[_0xc0f6('0x2b')])){return this[_0xc0f6('0xb')]['error'](_0x4fb9c3,_0xc0f6('0xcb'));}var _0x40c757=_0x4fb9c3[_0xc0f6('0x2b')][_0xc0f6('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0xcc'),_0x40c757));var _0x480d50=this[_0xc0f6('0x26')][_0xc0f6('0x6b')](this,_0x46bdbe,_0x40c757);this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x4fb9c3,_0x40c757);if(!this[_0xc0f6('0x80')](_0x4fb9c3[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x46edcf=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x4fb9c3[_0xc0f6('0xcd')]);if(!_0x46edcf){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4fb9c3,_0xc0f6('0xce'));}var _0x4af774=this;_0x480d50[_0xc0f6('0xcf')](function(_0x365d5d,_0x3b0255){Object[_0xc0f6('0xd0')](_0x365d5d)[_0xc0f6('0xcf')](function(_0x1780a8){_0x4af774[_0xc0f6('0xb')][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xd2'),_0x46edcf,_0x3b0255,_0x1780a8),_0x365d5d[_0x1780a8]);});});this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xd3'),_0x46edcf),_0x480d50[_0xc0f6('0x97')]);return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0xd4'),_0x46edcf));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xd5')]=function(_0x244384){logger[_0xc0f6('0xd6')](util[_0xc0f6('0x50')](_0xc0f6('0xd7'),_0x244384[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x244384[_0xc0f6('0xd8')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x244384,_0xc0f6('0xd9'));}var _0x190fa5=this[_0xc0f6('0xda')][_0xc0f6('0x6b')](this,_0x244384[_0xc0f6('0xd8')]);if(!_0x190fa5){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x244384,_0xc0f6('0xdb'));}var _0x44ea6b=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xdc'),[util[_0xc0f6('0x50')](_0xc0f6('0xdd'),_0x190fa5),_0x244384[_0xc0f6('0x63')],_0x244384[_0xc0f6('0xde')],_0x244384[_0xc0f6('0x6d')]]);if(_0x44ea6b[_0xc0f6('0xa2')]===-0x1){return _0x44ea6b;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s',_0xc0f6('0xdc')));};AGIVertices['prototype'][_0xc0f6('0xdf')]=function(_0x2009ce){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xe0'),_0x2009ce['label']));if(!this[_0xc0f6('0x80')](_0x2009ce[_0xc0f6('0x7c')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x2009ce['text'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this['channel'][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x2009ce);this['createSquareMessage'](_0x2009ce[_0xc0f6('0x59')],'in','','');this['channel'][_0xc0f6('0xa0')](util['format'](_0xc0f6('0xe2'),_0x2009ce[_0xc0f6('0x59')]));var _0x4da855=this[_0xc0f6('0x74')][_0xc0f6('0x6b')](this,_0x2009ce);if(_0x4da855){for(var _0x4f21a4 in _0x4da855){if(_0x4da855['hasOwnProperty'](_0x4f21a4)){this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0xe3'),_0x4f21a4[_0xc0f6('0xe4')]()),_0x4da855[_0x4f21a4]);}}this[_0xc0f6('0x3a')](_0x4da855[_0xc0f6('0xe5')],'out',_0xc0f6('0xdf'),'');return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xe6'),_0x4da855[_0xc0f6('0xe5')]));}return this['channel'][_0xc0f6('0x27')](_0x2009ce,_0xc0f6('0xe7'));};AGIVertices['prototype'][_0xc0f6('0xe8')]=function(_0x3ede86){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3ede86[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x3ede86[_0xc0f6('0x77')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20project_id\x20configured');}if(!this[_0xc0f6('0x80')](_0x3ede86['client_email'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xe9'));}if(!this[_0xc0f6('0x80')](_0x3ede86[_0xc0f6('0x78')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20private_key\x20configured');}if(!this[_0xc0f6('0x80')](_0x3ede86[_0xc0f6('0x79')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20anguage\x20configured');}if(!this[_0xc0f6('0x80')](_0x3ede86[_0xc0f6('0x59')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x3ede86);this[_0xc0f6('0x3a')](_0x3ede86[_0xc0f6('0x59')],'in','','');this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Trying\x20DialogflowV2:\x20%s',_0x3ede86[_0xc0f6('0x59')]));var _0x52e89c=this[_0xc0f6('0x76')][_0xc0f6('0x6b')](this,_0x3ede86);if(_0x52e89c){for(var _0xfb504b in _0x52e89c){if(_0x52e89c[_0xc0f6('0x8f')](_0xfb504b)){if(_0xfb504b!==_0xc0f6('0xea')){this['channel'][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xe3'),_0xfb504b['toUpperCase']()),_0x52e89c[_0xfb504b]);}}}this[_0xc0f6('0x3a')](_0x52e89c[_0xc0f6('0xe5')],_0xc0f6('0xeb'),_0xc0f6('0xe8'),_0x52e89c[_0xc0f6('0xea')]);return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('DialogflowV2\x20Result\x20%s',_0x52e89c[_0xc0f6('0xe5')]));}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x3ede86,_0xc0f6('0xec'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xed')]=function(_0x3c0dfd){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0xee'),_0x3c0dfd['label']));if(!this[_0xc0f6('0x80')](_0x3c0dfd[_0xc0f6('0xef')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xc0f6('0x80')](_0x3c0dfd[_0xc0f6('0xf0')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0xf1'));}if(!this[_0xc0f6('0x80')](_0x3c0dfd[_0xc0f6('0xf2')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xf3'));}if(!this[_0xc0f6('0x80')](_0x3c0dfd['ndassistant_url'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xc0f6('0xb')][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x3c0dfd);this[_0xc0f6('0x3a')](_0x3c0dfd[_0xc0f6('0x59')],'in','','');this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xf4'),_0x3c0dfd[_0xc0f6('0x59')]));var _0x9e431b=this[_0xc0f6('0x7a')][_0xc0f6('0x6b')](this,_0x3c0dfd);if(_0x9e431b){for(var _0x4c3af1 in _0x9e431b){if(_0x9e431b[_0xc0f6('0x8f')](_0x4c3af1)){this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xf5'),_0x4c3af1[_0xc0f6('0xe4')]()),_0x9e431b[_0x4c3af1]);}}this[_0xc0f6('0x3a')](_0x9e431b[_0xc0f6('0xe5')],_0xc0f6('0xeb'),_0xc0f6('0xed'),'');if(_0x9e431b[_0xc0f6('0xf6')]){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xf7'),_0x9e431b['audiofile']));var _0x30ec0a=this[_0xc0f6('0xb')][_0xc0f6('0xf8')](_0x9e431b[_0xc0f6('0xf6')]);try{fs[_0xc0f6('0xf9')](_0x9e431b['audiofile']+_0xc0f6('0xfa'));}catch(_0x3d1279){logger[_0xc0f6('0x27')](_0x3d1279);}return _0x30ec0a;}else{return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0xfb'),_0x9e431b[_0xc0f6('0xe5')]));}}return this['channel'][_0xc0f6('0x27')](_0x3c0dfd,_0xc0f6('0xfc'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xfd')]=function(_0xfdc2c9){logger[_0xc0f6('0x29')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0xfdc2c9[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xfd'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xfe')]=function(_0x4abcd5){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4abcd5['label']));var _0x41a4f3='';if(_0x4abcd5['trunk_id']){if(!this['isConfigured'](_0x4abcd5['trunk_id'])){return this[_0xc0f6('0xb')]['error'](_0x4abcd5,_0xc0f6('0xff'));}else{var _0x5950fe=parseInt(_0x4abcd5[_0xc0f6('0x100')],0xa);if(isNaN(_0x5950fe)){_0x41a4f3=_0x4abcd5[_0xc0f6('0x100')];}else{_0x41a4f3=this['getTrunk'][_0xc0f6('0x6b')](this,_0x4abcd5[_0xc0f6('0x100')]);if(!_0x41a4f3){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4abcd5,_0xc0f6('0x101'));}}}}else if(_0x4abcd5['trunk_name']){_0x41a4f3=_0x4abcd5[_0xc0f6('0x102')];}else{return this['channel'][_0xc0f6('0x27')](_0x4abcd5,_0xc0f6('0xff'));}var _0x5499b8=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xdc'),[util[_0xc0f6('0x50')](_0xc0f6('0x103'),_0x41a4f3,_0x4abcd5[_0xc0f6('0x40')]),_0x4abcd5[_0xc0f6('0x63')],_0x4abcd5[_0xc0f6('0xde')],_0x4abcd5[_0xc0f6('0x6d')]]);if(_0x5499b8[_0xc0f6('0xa2')]===-0x1){return _0x5499b8;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s',_0xc0f6('0xdc')));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x104')]=function(_0x3a059b){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x105'),_0x3a059b[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x104'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x106')]=function(_0x40d812){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x40d812[_0xc0f6('0x33')]));if(_0x40d812['retry']===0x0){return this[_0xc0f6('0x107')](_0x40d812);}_0x40d812[_0xc0f6('0x108')]-=0x1;if(!this[_0xc0f6('0x80')](_0x40d812[_0xc0f6('0x109')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x40d812,'no\x20file\x20audio\x20selected');}var _0x38a1ac=this[_0xc0f6('0x1b')][_0xc0f6('0x6b')](this,_0x40d812[_0xc0f6('0x109')]);if(!_0x38a1ac){return this['channel'][_0xc0f6('0x27')](_0x40d812,_0xc0f6('0x10a'));}if(!this[_0xc0f6('0x80')](_0x40d812[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xc0f6('0x10b'));}var _0x58f1f5=this['channel']['getData'](_0x38a1ac,_0x40d812[_0xc0f6('0x10c')],_0x40d812['maxdigit']);var _0x296339=_0x58f1f5[_0xc0f6('0xa2')]?_0x58f1f5['result'][_0xc0f6('0x45')]():'';logger[_0xc0f6('0x29')](_0xc0f6('0x10d'),JSON[_0xc0f6('0x6f')](_0x58f1f5));if(_0x58f1f5[_0xc0f6('0xa2')]===-0x1){this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x40d812,_0x296339);return _0x58f1f5;}else if(_0x58f1f5[_0xc0f6('0x9c')]==='timeout'){_0x58f1f5[_0xc0f6('0xa2')]=_0x296339[_0xc0f6('0x97')]>=parseInt(_0x40d812[_0xc0f6('0x10e')])?'x':'i';}else{_0x58f1f5['result']=_0x296339[_0xc0f6('0x97')]>=parseInt(_0x40d812[_0xc0f6('0x10e')])&&_0x296339[_0xc0f6('0x97')]<=parseInt(_0x40d812[_0xc0f6('0x10f')])?'x':'i';}var _0x4270e0=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x40d812[_0xc0f6('0xcd')]);if(!_0x4270e0){return this[_0xc0f6('0xb')]['error'](_0x40d812,'no\x20variable\x20found');}this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0x4270e0,_0x296339);if(this[_0xc0f6('0x80')](_0x40d812[_0xc0f6('0x110')])){var _0x2165ff=parseInt(_0x40d812[_0xc0f6('0x110')],0xa);var _0x3f5764=rs[_0xc0f6('0x111')]({'charset':'*','length':_0x2165ff});var _0x754d65=_0x296339[_0xc0f6('0x97')];if(_0x754d65>0x0){if(_0x754d65>_0x2165ff){this[_0xc0f6('0x31')]['sync'](this,_0x40d812,_0x40d812[_0xc0f6('0x112')]===_0xc0f6('0x113')?_0x3f5764+_0x296339[_0xc0f6('0x114')](_0x2165ff):_0x296339[_0xc0f6('0x114')](0x0,_0x754d65-_0x2165ff)+_0x3f5764);}else{this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x40d812,rs['generate']({'charset':'*','length':_0x754d65}));}}else{this[_0xc0f6('0x31')]['sync'](this,_0x40d812,'');}}else{this['createSquareDetailsReport'][_0xc0f6('0x6b')](this,_0x40d812,_0x296339);}return _0x58f1f5;};AGIVertices['prototype'][_0xc0f6('0x115')]=function(_0x5a2c89){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x116'),_0x5a2c89[_0xc0f6('0x33')]));return this[_0xc0f6('0x106')](_0x5a2c89);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x117')]=function(_0x4570a0){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4570a0[_0xc0f6('0x33')]));this['createSquareDetailsReport'][_0xc0f6('0x6b')](this,_0x4570a0,_0x4570a0[_0xc0f6('0x118')]);return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x119'),_0x4570a0[_0xc0f6('0x118')]));};AGIVertices['prototype'][_0xc0f6('0x11a')]=function(_0x59e2b9){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x11b'),_0x59e2b9[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x59e2b9[_0xc0f6('0x83')])||!this[_0xc0f6('0x80')](_0x59e2b9[_0xc0f6('0x84')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0x11c'));}if(!this[_0xc0f6('0x80')](_0x59e2b9[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x11d'),_0x59e2b9['text']));var _0x35a3df=this['awsPolly'][_0xc0f6('0x6b')](this,_0x59e2b9);if(_0x35a3df){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x11e'),_0x35a3df));var _0x26ae60=this[_0xc0f6('0xb')][_0xc0f6('0xf8')](_0x35a3df);try{fs[_0xc0f6('0xf9')](_0x35a3df+_0xc0f6('0xfa'));}catch(_0x48367f){logger[_0xc0f6('0x27')](_0x48367f);}return _0x26ae60;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x59e2b9,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x11f')]=function(_0x3d1790){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x120'),_0x3d1790[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x3d1790[_0xc0f6('0x83')])||!this[_0xc0f6('0x80')](_0x3d1790[_0xc0f6('0x84')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x11c'));}if(!this[_0xc0f6('0x80')](_0x3d1790[_0xc0f6('0x121')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x122'));}if(!this[_0xc0f6('0x80')](_0x3d1790['text'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x3d1790);this[_0xc0f6('0x3a')](_0x3d1790[_0xc0f6('0x59')],'in','','');this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x123'),_0x3d1790['text']));var _0x1c6b21=this[_0xc0f6('0x87')][_0xc0f6('0x6b')](this,_0x3d1790);if(_0x1c6b21){for(var _0x5957b6 in _0x1c6b21){if(_0x1c6b21[_0xc0f6('0x8f')](_0x5957b6)&&_['isString'](_0x1c6b21[_0x5957b6])){this[_0xc0f6('0xb')]['setVariable'](util[_0xc0f6('0x50')](_0xc0f6('0x124'),_0x5957b6[_0xc0f6('0xe4')]()),_0x1c6b21[_0x5957b6]);}}if(_[_0xc0f6('0x4a')](_0x1c6b21[_0xc0f6('0x71')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xc0f6('0x3a')](_0x1c6b21[_0xc0f6('0x71')],_0xc0f6('0xeb'),_0xc0f6('0x125'),'');return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x126'),_0x1c6b21['message']));}}return this['channel'][_0xc0f6('0x27')](_0x3d1790,_0xc0f6('0x127'));};AGIVertices['prototype'][_0xc0f6('0x128')]=function(_0x4e8bb9){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x129'),_0x4e8bb9[_0xc0f6('0x33')],_0x4e8bb9[_0xc0f6('0x63')]));if(!this[_0xc0f6('0x80')](_0x4e8bb9[_0xc0f6('0x7c')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x12a'));}var _0x37076c=_0xc0f6('0x12b');var _0x1c88a0=util[_0xc0f6('0x50')](_0xc0f6('0x12c'),FILES_PATH,rs[_0xc0f6('0x111')](0x4));var _0x28f918=util['format'](_0xc0f6('0x95'),_0x1c88a0,_0x37076c);var _0x3c8bc0=!![];if(_0x4e8bb9['beep']==='NOBEEP'){_0x3c8bc0=![];}var _0x32d9bc=this[_0xc0f6('0xb')][_0xc0f6('0x12d')](_0x1c88a0,_0x37076c,_0x4e8bb9[_0xc0f6('0x12e')],_0x4e8bb9[_0xc0f6('0x63')],undefined,_0x3c8bc0);if(_0x32d9bc['result']!==-0x1){this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x12f'),_0x28f918));var _0x21e37a=this[_0xc0f6('0x89')]['sync'](this,_0x4e8bb9,_0x28f918);if(_0x21e37a){for(var _0x245bca in _0x21e37a){if(_0x21e37a[_0xc0f6('0x8f')](_0x245bca)){this['channel'][_0xc0f6('0xd1')](util['format']('GOOGLE_ASR_%s',_0x245bca[_0xc0f6('0xe4')]()),_0x21e37a[_0x245bca]);}}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x130'),JSON['stringify'](_0x21e37a)));}}return _0x32d9bc;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x131')]=function(_0x1c13f4){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x132'),_0x1c13f4['label']));if(!this[_0xc0f6('0x80')](_0x1c13f4[_0xc0f6('0x133')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x134'));}if(!this[_0xc0f6('0x80')](_0x1c13f4[_0xc0f6('0x8b')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x135'));}var _0x45a2d7='wav';var _0x3d2e1b=util[_0xc0f6('0x50')](_0xc0f6('0x12c'),FILES_PATH,rs[_0xc0f6('0x111')](0x4));var _0x5810b9=util[_0xc0f6('0x50')](_0xc0f6('0x95'),_0x3d2e1b,_0x45a2d7);var _0x2c8557=!![];if(_0x1c13f4[_0xc0f6('0x136')]===_0xc0f6('0x137')){_0x2c8557=![];}var _0x2164b3=this[_0xc0f6('0xb')][_0xc0f6('0x12d')](_0x3d2e1b,_0x45a2d7,_0x1c13f4[_0xc0f6('0x12e')],_0x1c13f4[_0xc0f6('0x63')],undefined,_0x2c8557);if(_0x2164b3[_0xc0f6('0xa2')]!==-0x1){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('tilde\x20%s\x20file\x20created',_0x5810b9));var _0x26a4d6=this[_0xc0f6('0x8a')][_0xc0f6('0x6b')](this,_0x1c13f4,_0x5810b9);if(_0x26a4d6){for(var _0x4017f1 in _0x26a4d6){if(_0x26a4d6[_0xc0f6('0x8f')](_0x4017f1)){this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0x138'),_0x4017f1[_0xc0f6('0xe4')]()),_0x26a4d6[_0x4017f1]);}}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('TildeASR\x20Result\x20%s',JSON[_0xc0f6('0x6f')](_0x26a4d6)));}}return _0x2164b3;};AGIVertices[_0xc0f6('0xe')]['gotoc']=function(_0x25e998){logger['info'](util['format'](_0xc0f6('0x139'),_0x25e998[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0x13a')](_0x25e998[_0xc0f6('0x13b')],_0x25e998[_0xc0f6('0x36')],_0x25e998[_0xc0f6('0x13c')]);};AGIVertices['prototype'][_0xc0f6('0x13d')]=function(_0x599965){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x13e'),_0x599965[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x599965['condition'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x599965,_0xc0f6('0x13f'));}try{var _0x49c7fa=eval(_0x599965[_0xc0f6('0x140')])?_0xc0f6('0x141'):_0xc0f6('0x142');this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x143'),_0x599965['condition'],_0x49c7fa));return{'code':0xc8,'result':_0x49c7fa};}catch(_0x1ebcb8){return{'code':0xc8,'result':_0xc0f6('0x142')};}};AGIVertices[_0xc0f6('0xe')]['gotoiftime']=function(_0x486647){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x144'),_0x486647[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x486647['interval_id'])){return this[_0xc0f6('0xb')]['error'](_0x486647,_0xc0f6('0x145'));}var _0x3bf021=this[_0xc0f6('0x21')][_0xc0f6('0x6b')](this,_0x486647[_0xc0f6('0x146')]);if(!_0x3bf021){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x486647,'no\x20intervals\x20found');}for(var _0x464abd=0x0;_0x464abd<_0x3bf021[_0xc0f6('0x97')];_0x464abd+=0x1){var _0x3a7627=this['channel'][_0xc0f6('0x9b')](util['format'](_0xc0f6('0x147'),_0x3bf021[_0x464abd]));if(_0x3a7627[_0xc0f6('0xa2')]===-0x1){return _0x3a7627;}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0x3a7627[_0xc0f6('0x9c')]));if(_0x3a7627[_0xc0f6('0x9c')]===_0xc0f6('0x141')){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x141')));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x141')));return{'code':0xc8,'result':_0xc0f6('0x141')};}else{logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x142')));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x142')));}}return{'code':0xc8,'result':_0xc0f6('0x142')};};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x149')]=function(_0x380bbd){logger['info'](util[_0xc0f6('0x50')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x380bbd[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0x149')]();};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x14a')]=function(_0x5d35b1){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x14b'),_0x5d35b1[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x5d35b1[_0xc0f6('0x7c')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x12a'));}var _0x2baae2=_0xc0f6('0x12b');var _0x51dd5b=util['format'](_0xc0f6('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x47d21f=util['format'](_0xc0f6('0x95'),_0x51dd5b,_0x2baae2);var _0x543354=!![];if(_0x5d35b1[_0xc0f6('0x136')]===_0xc0f6('0x137')){_0x543354=![];}var _0x4f8156=this['channel'][_0xc0f6('0x12d')](_0x51dd5b,_0x2baae2,_0x5d35b1[_0xc0f6('0x12e')],_0x5d35b1['timeout'],undefined,_0x543354);if(_0x4f8156['result']!==-0x1){this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')]('ispeech\x20%s\x20file\x20created',_0x47d21f));var _0x4e6f3c=this[_0xc0f6('0x7e')][_0xc0f6('0x6b')](this,_0x5d35b1,_0x47d21f);if(_0x4e6f3c){for(var _0x2f46b2 in _0x4e6f3c){if(_0x4e6f3c['hasOwnProperty'](_0x2f46b2)){this['channel'][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0x14c'),_0x2f46b2[_0xc0f6('0xe4')]()),_0x4e6f3c[_0x2f46b2]);}}return this['channel'][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x14d'),JSON[_0xc0f6('0x6f')](_0x4e6f3c)));}}return _0x4f8156;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x14e')]=function(_0x28fc95){logger['info'](util[_0xc0f6('0x50')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x28fc95['label']));if(!this['isConfigured'](_0x28fc95[_0xc0f6('0x7c')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20key\x20configured');}if(!this[_0xc0f6('0x80')](_0x28fc95[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x14f'),_0x28fc95[_0xc0f6('0x59')]));var _0x3c37b0=this[_0xc0f6('0x7b')][_0xc0f6('0x6b')](this,_0x28fc95);if(_0x3c37b0){this['channel']['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x150'),_0x3c37b0));var _0xddf469=this['channel'][_0xc0f6('0xf8')](_0x3c37b0,_0x28fc95[_0xc0f6('0x12e')]);try{fs['unlink'](_0x3c37b0+_0xc0f6('0xfa'));}catch(_0x4d5c2c){logger[_0xc0f6('0x27')](_0x4d5c2c);}return _0xddf469;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x28fc95,_0xc0f6('0x151'));};AGIVertices['prototype'][_0xc0f6('0x152')]=function(_0xb23002){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x153'),_0xb23002[_0xc0f6('0x33')]));if(!this['isConfigured'](_0xb23002['findBy'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb23002,'no\x20find\x20by\x20configured');}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x154'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));var _0x6b2851=this['agentLogin'][_0xc0f6('0x6b')](this,_0xb23002[_0xc0f6('0x155')]);if(_0x6b2851){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002['findBy']));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger[_0xc0f6('0x29')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x14520b){logger['info'](util[_0xc0f6('0x50')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x14520b[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x14520b[_0xc0f6('0x155')])){return this[_0xc0f6('0xb')]['error'](_0x14520b,_0xc0f6('0x159'));}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x154'),this['channel'][_0xc0f6('0x35')],_0x14520b[_0xc0f6('0x155')]));var _0x2ebba9=this['agentLogout']['sync'](this,_0x14520b[_0xc0f6('0x155')]);if(_0x2ebba9){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x14520b[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x14520b['findBy']));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this['channel']['callerid'],_0x14520b[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x14520b['findBy']));return{'code':0xc8,'result':_0xc0f6('0x15a')};}};AGIVertices['prototype'][_0xc0f6('0x15b')]=function(_0x2e97bc){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x15c'),_0x2e97bc[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x2e97bc[_0xc0f6('0x15d')])){return this['channel'][_0xc0f6('0x27')](_0x2e97bc,_0xc0f6('0x15e'));}this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x15f'),_0x2e97bc[_0xc0f6('0x15d')]));var _0x3f7f80=eval(_0x2e97bc[_0xc0f6('0x15d')]);if(!this[_0xc0f6('0x80')](_0x2e97bc[_0xc0f6('0xcd')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x10b'));}var _0x3c8540=this[_0xc0f6('0x9b')]['sync'](this,_0x2e97bc[_0xc0f6('0xcd')]);if(!_0x3c8540){return this['channel']['error'](_0x2e97bc,_0xc0f6('0xce'));}if(_[_0xc0f6('0x96')](_0x3f7f80)){var _0x179ccf=this;_0x3f7f80[_0xc0f6('0xcf')](function(_0x2dc1ca,_0x547932){_0x179ccf['channel']['setVariable'](util['format'](_0xc0f6('0x160'),_0x3c8540,_0x547932),_0x2dc1ca);});return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x161'),_0x3c8540));}else{return this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0x3c8540,_0x3f7f80);}};AGIVertices[_0xc0f6('0xe')]['menu']=function(_0x318192){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x162'),_0x318192[_0xc0f6('0x33')]));if(_0x318192[_0xc0f6('0x108')]===0x0){return this['maxRetry'](_0x318192);}_0x318192[_0xc0f6('0x108')]-=0x1;if(!this[_0xc0f6('0x80')](_0x318192[_0xc0f6('0x109')])){return this[_0xc0f6('0xb')]['error'](_0x318192,_0xc0f6('0x163'));}var _0x1fb16d=this['getSound'][_0xc0f6('0x6b')](this,_0x318192[_0xc0f6('0x109')]);if(!_0x1fb16d){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x318192,_0xc0f6('0x10a'));}var _0x5f15ed=this[_0xc0f6('0xb')][_0xc0f6('0x164')](_0x1fb16d,_0x318192[_0xc0f6('0x10c')],_0x318192[_0xc0f6('0x165')]);var _0x3fe0fb=_0x5f15ed['result'];if(_0x5f15ed[_0xc0f6('0xa2')]===-0x1){this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x318192,'-1');return _0x5f15ed;}else if(_0x5f15ed[_0xc0f6('0x9c')]==='timeout'){_0x5f15ed[_0xc0f6('0xa2')]=_0x5f15ed[_0xc0f6('0xa2')]['length']>0x0?_0x5f15ed[_0xc0f6('0xa2')]:'t';}else if(_[_0xc0f6('0x3c')](_0x5f15ed['result'])){_0x5f15ed[_0xc0f6('0xa2')]='#';_0x3fe0fb='#';}if(!this[_0xc0f6('0x80')](_0x318192[_0xc0f6('0xcd')])){this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x10b'));}else{var _0xa36533=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x318192['variable_id']);if(!_0xa36533){return this['channel'][_0xc0f6('0x27')](_0x318192,_0xc0f6('0xce'));}this[_0xc0f6('0xb')]['setVariable'](_0xa36533,_0x3fe0fb);}this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x318192,_0x3fe0fb);return _0x5f15ed;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xa0')]=function(_0x4edf9){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x166'),_0x4edf9['label']));return this[_0xc0f6('0xb')]['noop'](_0x4edf9[_0xc0f6('0x167')]||_0x4edf9[_0xc0f6('0x33')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x168')]=function(_0x7629db){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x169'),_0x7629db[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x7629db['findBy'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x7629db,_0xc0f6('0x159'));}logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x154'),this[_0xc0f6('0xb')]['callerid'],_0x7629db[_0xc0f6('0x155')]));var _0xc7e16c=this[_0xc0f6('0x47')]['sync'](this,_0x7629db[_0xc0f6('0x16a')]);var _0x54ceec=this[_0xc0f6('0x49')][_0xc0f6('0x6b')](this,_0x7629db[_0xc0f6('0x155')],_0xc7e16c);if(_0x54ceec){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this['channel'][_0xc0f6('0x35')],_0x7629db[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this['channel'][_0xc0f6('0x35')],_0x7629db[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this['channel']['callerid'],_0x7629db[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x156'),this[_0xc0f6('0xb')]['callerid'],_0x7629db['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x16b')]=function(_0x4b9afa){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x16c'),_0x4b9afa[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x4b9afa[_0xc0f6('0x109')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4b9afa,_0xc0f6('0x163'));}var _0x5dddd6=this['getSound'][_0xc0f6('0x6b')](this,_0x4b9afa[_0xc0f6('0x109')]);if(!_0x5dddd6){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4b9afa,_0xc0f6('0x10a'));}var _0xd14311=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0x16d'),[_0x5dddd6,_0x4b9afa[_0xc0f6('0xde')]]);if(_0xd14311[_0xc0f6('0xa2')]===-0x1){return _0xd14311;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format']('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x5dddd6));};AGIVertices['prototype'][_0xc0f6('0x16e')]=function(_0xb87817){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x16f'),_0xb87817['label']));if(!this['isConfigured'](_0xb87817[_0xc0f6('0x170')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb87817,_0xc0f6('0x171'));}var _0x36cd5b='';var _0x2c0658=parseInt(_0xb87817['queue_id'],0xa);if(isNaN(_0x2c0658)){_0x36cd5b=_0xb87817[_0xc0f6('0x170')];}else{_0x36cd5b=this['getVoiceQueue'][_0xc0f6('0x6b')](this,_0xb87817[_0xc0f6('0x170')]);if(!_0x36cd5b){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb87817,_0xc0f6('0x172'));}}var _0xf79dda='';if(this[_0xc0f6('0x80')](_0xb87817['file_id'])){var _0x200a91=this[_0xc0f6('0x1b')][_0xc0f6('0x6b')](this,_0xb87817[_0xc0f6('0x109')]);if(_0x200a91){_0xf79dda=_0x200a91;}}this[_0xc0f6('0x31')]['sync'](this,_0xb87817,_0x36cd5b);if(_0xb87817[_0xc0f6('0xde')]['indexOf']('x')<0x0){_0xb87817[_0xc0f6('0xde')]+='x';}if(_0xb87817[_0xc0f6('0xde')][_0xc0f6('0x173')]('X')<0x0){_0xb87817['opts']+='X';}this['channel'][_0xc0f6('0xd1')](_0xc0f6('0x174'),_0x36cd5b?_0x36cd5b[_0xc0f6('0x175')]():'');var _0x31ed2b=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0x176'),[_0x36cd5b,_0xb87817[_0xc0f6('0xde')],_0xb87817[_0xc0f6('0x6d')],_0xf79dda,_0xb87817[_0xc0f6('0x63')],_0xb87817[_0xc0f6('0x6')],_0xb87817[_0xc0f6('0x177')],_0xb87817[_0xc0f6('0x178')],'',_0xb87817[_0xc0f6('0x179')]]);if(_0x31ed2b[_0xc0f6('0xa2')]===-0x1){return _0x31ed2b;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x36cd5b));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x17a')]=function(_0x1569b8){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x17b'),_0x1569b8[_0xc0f6('0x33')]));var _0x24ba2c=_0x1569b8[_0xc0f6('0x17c')]||'wav';var _0x869a14=util['format'](_0xc0f6('0x17d'),this[_0xc0f6('0xb')]['uniqueid'],rs[_0xc0f6('0x111')](0x5));var _0x231cc3=util[_0xc0f6('0x50')](_0xc0f6('0x17e'),FILES_PATH,_0x869a14,_0x24ba2c);var _0x2dc90d=util[_0xc0f6('0x50')](_0xc0f6('0x12c'),FILES_PATH,_0x869a14);this[_0xc0f6('0x17f')][_0xc0f6('0x6b')](this,_0x1569b8,_0x869a14,_0x231cc3);this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0xc0f6('0x180'),_0x869a14);logger[_0xc0f6('0x29')](_0xc0f6('0x181'),_0x2dc90d,_0x24ba2c,_0x1569b8['escape_digits'],_0x1569b8[_0xc0f6('0x63')]);return this[_0xc0f6('0xb')][_0xc0f6('0x12d')](_0x2dc90d,_0x24ba2c,_0x1569b8[_0xc0f6('0x182')],_0x1569b8['timeout'],undefined,!![]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x183')]=function(_0x2e758d){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x184'),_0x2e758d[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x2e758d[_0xc0f6('0x6d')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20url\x20configured');}var _0x36d496=this[_0xc0f6('0x61')][_0xc0f6('0x6b')](this,_0x2e758d);logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Response:',util['inspect'](_0x36d496,{'showHidden':![],'depth':null})));if(!this[_0xc0f6('0x80')](_0x2e758d[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x185'));}var _0x56943c=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x2e758d['variable_id']);if(!_0x56943c){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x2e758d,'no\x20variable\x20found');}this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0x186'),_0x56943c),_0x36d496[_0xc0f6('0x70')]?_0x36d496[_0xc0f6('0x70')]:_0xc0f6('0x187'));this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0x188'),_0x56943c),_0x36d496[_0xc0f6('0x189')]?_0x36d496[_0xc0f6('0x189')]:'OK');if(_0x36d496[_0xc0f6('0x68')]){try{this[_0xc0f6('0x94')](_0x36d496[_0xc0f6('0x68')],_0x56943c);}catch(_0x51d8f9){logger[_0xc0f6('0x27')](util[_0xc0f6('0x50')](_0xc0f6('0x18a'),_0x56943c));}}return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0xd4'),_0x56943c));};AGIVertices[_0xc0f6('0xe')]['saydigits']=function(_0x38f3b2){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x18b'),_0x38f3b2[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')]['sayDigits'](_0x38f3b2[_0xc0f6('0x18c')]['replace'](/\s+/g,''),_0x38f3b2[_0xc0f6('0x182')]);};AGIVertices[_0xc0f6('0xe')]['saynumber']=function(_0x566a98){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x18d'),_0x566a98['label']));return this[_0xc0f6('0xb')]['sayNumber'](_0x566a98[_0xc0f6('0x62')][_0xc0f6('0x55')](/\s+/g,''),_0x566a98[_0xc0f6('0x182')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x18e')]=function(_0x559750){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x18f'),_0x559750['label']));return this['channel']['sayPhonetic'](_0x559750[_0xc0f6('0x59')],_0x559750['escape_digits']);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x190')]=function(_0x132181){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x191'),_0x132181[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x132181[_0xc0f6('0x192')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0x193'));}var _0x33d766=this[_0xc0f6('0x1f')]['sync'](this,_0x132181[_0xc0f6('0x192')]);if(!_0x33d766||!_0x33d766['Smtp']){return this[_0xc0f6('0xb')]['error'](_0x132181,_0xc0f6('0x194'));}var _0x5e8269={'from':util[_0xc0f6('0x50')](_0xc0f6('0x195'),_0x33d766[_0xc0f6('0x10')],_0x33d766[_0xc0f6('0x196')]||_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x198')]),'to':_0x132181['to']||'','cc':_0x132181['cc']||'','bcc':_0x132181['bcc']||'','subject':_0x132181[_0xc0f6('0x199')],'html':_0x132181['text'],'text':_0x132181['text']};var _0x4d999b={'tls':{'rejectUnauthorized':![]}};if(_0x33d766['Smtp'][_0xc0f6('0x19a')]){_0x4d999b[_0xc0f6('0x19a')]=_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x19a')];}else{_0x4d999b['host']=_0x33d766['Smtp'][_0xc0f6('0x19b')];_0x4d999b[_0xc0f6('0x19c')]=_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x19c')];_0x4d999b[_0xc0f6('0x19d')]=_0x33d766['Smtp'][_0xc0f6('0x19d')];}if(_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x19e')]){_0x4d999b[_0xc0f6('0x19f')]={'user':_0x33d766['Smtp'][_0xc0f6('0x198')],'pass':_0x33d766['Smtp'][_0xc0f6('0x1a0')]};}if(this[_0xc0f6('0x80')](_0x132181[_0xc0f6('0x1a1')])){}logger[_0xc0f6('0xd6')]('sendMail\x20message',JSON[_0xc0f6('0x6f')](_0x5e8269));this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x132181,_0x132181[_0xc0f6('0x192')]);this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1a2'),_0x33d766[_0xc0f6('0x10')]));this[_0xc0f6('0x20')][_0xc0f6('0x6b')](this,_0x4d999b,_0x5e8269);return this['channel'][_0xc0f6('0xa0')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1a3')]=function(_0xfb8ec){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x1a4'),_0xfb8ec[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x1a5'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1a6')]=function(_0x3ac735){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x1a7'),_0x3ac735[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x3ac735[_0xc0f6('0x1a8')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0x1a9'));}var _0x46d634=this['getSmsAccount'][_0xc0f6('0x6b')](this,_0x3ac735['sms_account_id']);if(!_0x46d634){return this['channel'][_0xc0f6('0x27')](_0x3ac735,_0xc0f6('0x1aa'));}var _0x4c2ab1={'body':_0x3ac735[_0xc0f6('0x1ab')],'phone':_0x3ac735['to']||'','SmsAccountId':_0x46d634['id']};logger[_0xc0f6('0xd6')]('sendSMS\x20message',JSON[_0xc0f6('0x6f')](_0x4c2ab1));this[_0xc0f6('0x31')]['sync'](this,_0x3ac735,_0x3ac735[_0xc0f6('0x1a8')]);this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1ac'),_0x46d634[_0xc0f6('0x10')]));this[_0xc0f6('0x30')][_0xc0f6('0x6b')](this,_0x4c2ab1);return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x1ad'));};AGIVertices['prototype'][_0xc0f6('0x1ae')]=function(_0x38848b){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x1af'),_0x38848b[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x38848b[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x38848b,_0xc0f6('0x1b0'));}var _0x2f9080=this['getVariable'][_0xc0f6('0x6b')](this,_0x38848b[_0xc0f6('0xcd')]);if(!_0x2f9080){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x38848b,_0xc0f6('0xce'));}return this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0x2f9080,_0x38848b[_0xc0f6('0x1b1')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1b2')]=function(_0x40086a){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x1b3'),_0x40086a[_0xc0f6('0x33')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x1b4'));if(_0x40086a[_0xc0f6('0xaf')]==='yes'){this['channel'][_0xc0f6('0xa0')]('Answer');return this[_0xc0f6('0xb')][_0xc0f6('0xaf')]();}return this[_0xc0f6('0xb')]['noop']('Skipped\x20Answer');};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1b5')]=function(_0xb2470a){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x1b6'),_0xb2470a[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0xb2470a['project_id'])){return this[_0xc0f6('0xb')]['error'](_0xb2470a,_0xc0f6('0x1b7'));}var _0x3f732c=this[_0xc0f6('0x1b8')][_0xc0f6('0x6b')](this,_0xb2470a[_0xc0f6('0x1b9')]);if(!this[_0xc0f6('0x80')](_0x3f732c)){return this['channel']['error'](_0xb2470a,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0xb2470a[_0xc0f6('0x1b9')]));}if(_0x3f732c===this[_0xc0f6('0xb')][_0xc0f6('0x1ba')]){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb2470a,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0xb2470a,_0x3f732c);var _0x4b4e31=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0x1bb'),util[_0xc0f6('0x50')](_0xc0f6('0x1bc'),config[_0xc0f6('0x6')][_0xc0f6('0x19b')]||_0xc0f6('0x1bd'),_0x3f732c,this['channel'][_0xc0f6('0x1ba')]));if(_0x4b4e31[_0xc0f6('0xa2')]===-0x1){return _0x4b4e31;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1be'),_0xc0f6('0x1bb'),_0x3f732c));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1bf')]=function(_0x561581){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x1c0'),_0x561581[_0xc0f6('0x33')]));var _0x542a72=this[_0xc0f6('0x53')]['sync'](this,_0x561581['command']);this[_0xc0f6('0x31')]['sync'](this,_0x561581,_0x561581[_0xc0f6('0xae')]);if(this['isConfigured'](_0x561581[_0xc0f6('0xcd')])){var _0x150277=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x561581['variable_id']);if(_0x150277){this['channel'][_0xc0f6('0xd1')](_0x150277,_0x542a72);return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x561581[_0xc0f6('0xae')],_0x150277));}}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1c1'),_0x561581[_0xc0f6('0xae')]));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1c2')]=function(_0x5947df){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x1c3'),_0x5947df[_0xc0f6('0x33')]));_0x5947df[_0xc0f6('0x59')]=_0x5947df['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5947df[_0xc0f6('0x57')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x1c4'));}if(!this[_0xc0f6('0x80')](_0x5947df[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0xba'));}this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x1c5'),_0x5947df[_0xc0f6('0x59')]));var _0x1ce23b=this[_0xc0f6('0x56')][_0xc0f6('0x6b')](this,_0x5947df);if(_0x1ce23b){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x1ce23b));var _0x38df5b=this['channel'][_0xc0f6('0xf8')](_0x1ce23b);try{fs[_0xc0f6('0xf9')](_0x1ce23b+_0xc0f6('0xfa'));}catch(_0x1679ca){logger[_0xc0f6('0x27')](_0x1679ca);}return _0x38df5b;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x5947df,_0xc0f6('0x1c6'));};AGIVertices[_0xc0f6('0xe')]['tts']=function(_0x196998){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x196998[_0xc0f6('0x33')]));_0x196998[_0xc0f6('0x59')]=_0x196998[_0xc0f6('0x59')][_0xc0f6('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc0f6('0x80')](_0x196998['text'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x1c7'),_0x196998[_0xc0f6('0x59')]));var _0x43ec95=this[_0xc0f6('0x60')]['sync'](this,_0x196998);if(_0x43ec95){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1c8'),_0x43ec95));var _0x452e68=this[_0xc0f6('0xb')][_0xc0f6('0xf8')](_0x43ec95);try{fs[_0xc0f6('0xf9')](_0x43ec95+_0xc0f6('0xfa'));}catch(_0x127ed1){logger[_0xc0f6('0x27')](_0x127ed1);}return _0x452e68;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x196998,_0xc0f6('0x1c9'));};AGIVertices[_0xc0f6('0xe')]['unpause']=function(_0x2d4a5e){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x1ca'),_0x2d4a5e['label']));if(!this['isConfigured'](_0x2d4a5e['findBy'])){return this['channel'][_0xc0f6('0x27')](_0x2d4a5e,_0xc0f6('0x159'));}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xc0f6('0x35')],_0x2d4a5e['findBy']));var _0x1dd3a6=this[_0xc0f6('0x4c')][_0xc0f6('0x6b')](this,_0x2d4a5e['findBy']);if(_0x1dd3a6){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x15a')};}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1cb')]=function(_0x22e5a0){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x1cc'),_0x22e5a0['label']));var _0xa910ac=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0x1cd'),[_0x22e5a0[_0xc0f6('0x1ce')],_0x22e5a0['options']]);if(_0xa910ac['result']===-0x1){return _0xa910ac;}return this['channel']['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x1be'),_0xc0f6('0x1cd'),_0x22e5a0[_0xc0f6('0x1ce')]));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1cf')]=function(_0x5959cf){logger['info'](util['format'](_0xc0f6('0x1d0'),_0x5959cf[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x5959cf['variable_id'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x5959cf,_0xc0f6('0x1b0'));}var _0x396932=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x5959cf[_0xc0f6('0xcd')]);if(!_0x396932){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x5959cf,'no\x20variable\x20found');}var _0x9915e0=this[_0xc0f6('0xb')][_0xc0f6('0x9b')](_0x396932);return{'code':0xc8,'result':_0x9915e0['extra']?_0x9915e0[_0xc0f6('0x9c')]:'-'};};String['prototype'][_0xc0f6('0x9a')]=function(_0x150344,_0x16b9b7){return this['split'](_0x150344)['join'](_0x16b9b7);};module[_0xc0f6('0x1d1')]=AGIVertices; \ No newline at end of file +var _0x552b=['restAPI','url','method','number','timeout','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','isString','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','getAndSetVariable','result','extra','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','grammar','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','minutes','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','out','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\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','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\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','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\x20ready\x20for\x20fulfillment','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','success','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','QUEUE','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','\x22%s\x22\x20<%s>','email','Smtp','bcc','subject','service','port','secure','authentication','auth','user','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\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','mailbox','VOICEMAIL','vswitch','path','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','channel','prototype','getVariable','rpc','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','dsn','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agentLogout','agent','agentLogin','internal','format','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','MALE','audioEncoding','MP3','googleTTS'];(function(_0x2af117,_0x130693){var _0x41e5ef=function(_0x5797cf){while(--_0x5797cf){_0x2af117['push'](_0x2af117['shift']());}};_0x41e5ef(++_0x130693);}(_0x552b,0x16d));var _0xb552=function(_0x46bb5e,_0x4fbb0){_0x46bb5e=_0x46bb5e-0x0;var _0x39c5f9=_0x552b[_0x46bb5e];return _0x39c5f9;};'use strict';var fs=require('fs');var path=require(_0xb552('0x0'));var util=require('util');var _=require(_0xb552('0x1'));var sh=require(_0xb552('0x2'));var odbc=require(_0xb552('0x3'))();var rs=require(_0xb552('0x4'));var moment=require(_0xb552('0x5'));var Mustache=require(_0xb552('0x6'));var rp=require(_0xb552('0x7'));var logger=require(_0xb552('0x8'))(_0xb552('0x9'));var config=require(_0xb552('0xa'));var scripts=require(_0xb552('0xb'));var FILES_PATH=_0xb552('0xc');var recursiveMapAttributes=[_0xb552('0xd'),'rawBody'];var verticesWithRetry=['menu',_0xb552('0xe'),'getsecretdigits'];var AGIVertices=function(_0x3f2fac,_0x4e50bf,_0x2f2c7d){this[_0xb552('0xf')]=_0x3f2fac;this['rpc']=_0x4e50bf;this['mailRpc']=_0x2f2c7d;};AGIVertices[_0xb552('0x10')][_0xb552('0x11')]=function(_0x249dca,_0x53e2c5){this[_0xb552('0x12')][_0xb552('0x13')](_0x249dca)['then'](function(_0x25ccad){_0x53e2c5(null,_0x25ccad?_0x25ccad[_0xb552('0x14')]:![]);})[_0xb552('0x15')](function(_0x5c2276){_0x53e2c5(_0x5c2276);});};AGIVertices['prototype'][_0xb552('0x16')]=function(_0x5293ab,_0x43bb4b){this[_0xb552('0x12')][_0xb552('0x17')](_0x5293ab)[_0xb552('0x18')](function(_0x487837){_0x43bb4b(null,_0x487837?_0x487837[_0xb552('0x14')]:![]);})[_0xb552('0x15')](function(_0x19d8eb){_0x43bb4b(_0x19d8eb);});};AGIVertices[_0xb552('0x10')][_0xb552('0x19')]=function(_0x389974,_0x44b963){this[_0xb552('0x12')]['getSquareProjectById'](_0x389974)['then'](function(_0x5418e5){_0x44b963(null,_0x5418e5?_0x5418e5['name']:![]);})['catch'](function(_0x1de252){_0x44b963(_0x1de252);});};AGIVertices[_0xb552('0x10')]['getSquareOdbc']=function(_0x110868,_0x26c497){this[_0xb552('0x12')]['getSquareOdbcById'](_0x110868)[_0xb552('0x18')](function(_0x23f5e9){_0x26c497(null,_0x23f5e9?_0x23f5e9[_0xb552('0x1a')]:![]);})['catch'](function(_0x5d441a){_0x26c497(_0x5d441a);});};AGIVertices['prototype']['getUser']=function(_0x5b52fa,_0x2c26ad){this[_0xb552('0x12')][_0xb552('0x1b')](_0x5b52fa)[_0xb552('0x18')](function(_0x8277f2){_0x2c26ad(null,_0x8277f2?_0x8277f2['name']:![]);})[_0xb552('0x15')](function(_0xe460fe){_0x2c26ad(_0xe460fe);});};AGIVertices[_0xb552('0x10')]['getTrunk']=function(_0x27936b,_0x4d1582){this[_0xb552('0x12')][_0xb552('0x1c')](_0x27936b)[_0xb552('0x18')](function(_0x3e45c){_0x4d1582(null,_0x3e45c?_0x3e45c[_0xb552('0x14')]:![]);})[_0xb552('0x15')](function(_0x3a2f40){_0x4d1582(_0x3a2f40);});};AGIVertices[_0xb552('0x10')][_0xb552('0x1d')]=function(_0xc3b792,_0x4f4fed){var _0xd280fc=this;this[_0xb552('0x12')][_0xb552('0x1e')](_0xc3b792)['then'](function(_0x292673){_0x4f4fed(null,_0x292673?_0xd280fc[_0xb552('0x1f')](_0x292673[_0xb552('0x20')]):![]);})[_0xb552('0x15')](function(_0x4e080a){_0x4f4fed(_0x4e080a);});};AGIVertices[_0xb552('0x10')]['getMailAccount']=function(_0x16a298,_0x4e7b15){this[_0xb552('0x12')][_0xb552('0x21')](_0x16a298)[_0xb552('0x18')](function(_0x23e902){_0x4e7b15(null,_0x23e902?_0x23e902:![]);})[_0xb552('0x15')](function(_0x5e4581){_0x4e7b15(_0x5e4581);});};AGIVertices[_0xb552('0x10')][_0xb552('0x22')]=function(_0x1b988e,_0x1889da,_0x1b0e3c){this[_0xb552('0x23')][_0xb552('0x22')](_0x1b988e,_0x1889da)[_0xb552('0x18')](function(){_0x1b0e3c(null);})[_0xb552('0x15')](function(_0x304eec){_0x1b0e3c(_0x304eec);});};AGIVertices['prototype']['getIntervals']=function(_0x250bcb,_0x47af9c){this['rpc'][_0xb552('0x24')](_0x250bcb)[_0xb552('0x18')](function(_0x225475){if(_0x225475){if(_0x225475[_0xb552('0x25')]){_0x47af9c(null,[_0x225475[_0xb552('0x26')]]);}else{_0x47af9c(null,_[_0xb552('0x27')](_0x225475[_0xb552('0x28')],'interval'));}}else{_0x47af9c(null,![]);}})[_0xb552('0x15')](function(_0x5d9d5c){_0x47af9c(_0x5d9d5c);});};AGIVertices[_0xb552('0x10')]['getSoundPath']=function(_0x3d154c){return util['format'](_0xb552('0x29'),FILES_PATH,_0x3d154c);};AGIVertices[_0xb552('0x10')]['getQueryOdbc']=function(_0x4625cb,_0xb9bbdf,_0x584020){odbc[_0xb552('0x2a')](_0x4625cb,function(_0x419339){if(_0x419339){logger[_0xb552('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x419339);_0x584020(_0x419339);}else{logger[_0xb552('0x2c')](_0xb552('0x2d'));odbc[_0xb552('0x2e')](_0xb9bbdf,function(_0x428416,_0x280c26){if(_0x428416){logger[_0xb552('0x2c')](_0xb552('0x2f'),_0xb9bbdf);_0x584020(_0x428416);}else{logger[_0xb552('0x2c')]('Query\x20executed\x20correctly\x20%s',_0xb9bbdf);odbc[_0xb552('0x30')](function(_0x3a415d){if(_0x3a415d){logger[_0xb552('0x2b')](_0xb552('0x31'),_0x3a415d);}_0x584020(null,_0x280c26);});}});}});};AGIVertices['prototype'][_0xb552('0x32')]=function(_0x32740b,_0x45ffce){this[_0xb552('0x12')][_0xb552('0x33')](_0x32740b)['then'](function(_0x19ce26){_0x45ffce(null,_0x19ce26?_0x19ce26:![]);})[_0xb552('0x15')](function(_0x46ac40){_0x45ffce(_0x46ac40);});};AGIVertices[_0xb552('0x10')]['createSmsMessage']=function(_0x823042,_0x6a8e1a){this[_0xb552('0x12')][_0xb552('0x34')](_0x823042)[_0xb552('0x18')](function(_0x14567a){_0x6a8e1a(null,_0x14567a);})[_0xb552('0x15')](function(_0x3a7ed9){_0x6a8e1a(_0x3a7ed9);});};AGIVertices[_0xb552('0x10')][_0xb552('0x35')]=function(_0x459168,_0x49762d,_0x1104e5){this['rpc'][_0xb552('0x35')]({'uniqueid':this['channel'][_0xb552('0x36')],'node':_0x459168[_0xb552('0x37')],'application':_0x459168['agicommand'],'data':_0x49762d||null,'project_name':this[_0xb552('0xf')][_0xb552('0x38')],'callerid':this[_0xb552('0xf')][_0xb552('0x39')]})['then'](function(_0x5293eb){if(_0x1104e5){_0x1104e5(null,_0x5293eb);}})['catch'](function(_0x43be5b){if(_0x1104e5){_0x1104e5(_0x43be5b);}});};AGIVertices[_0xb552('0x10')]['createSquareRecording']=function(_0x4013b9,_0x16372c,_0x6e742b,_0x44978c){this['rpc'][_0xb552('0x3a')]({'uniqueid':this[_0xb552('0xf')][_0xb552('0x36')],'callerid':this['channel'][_0xb552('0x39')],'calleridname':this[_0xb552('0xf')][_0xb552('0x3b')],'context':this[_0xb552('0xf')][_0xb552('0x3c')],'extension':this[_0xb552('0xf')][_0xb552('0x3d')],'priority':this[_0xb552('0xf')][_0xb552('0x3e')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xb552('0xf')][_0xb552('0x3f')],'projectName':this[_0xb552('0xf')][_0xb552('0x38')],'saveName':_0x16372c,'filename':_0x4013b9[_0xb552('0x40')]||_0x16372c,'savePath':_0x6e742b})[_0xb552('0x18')](function(_0x18cadf){_0x44978c(null,_0x18cadf);})[_0xb552('0x15')](function(_0x2a47a4){_0x44978c(_0x2a47a4);});};AGIVertices[_0xb552('0x10')][_0xb552('0x41')]=function(_0x291049,_0x1a232e,_0x87cd20,_0x339191,_0xc19aac){this[_0xb552('0x12')][_0xb552('0x41')]({'uniqueid':this['channel'][_0xb552('0x36')],'body':_0x291049,'direction':_0x1a232e,'providerName':_0x87cd20,'providerResponse':_0x339191})['then'](function(_0x614f7c){if(_0xc19aac){_0xc19aac(null,_0x614f7c);}})['catch'](function(_0x217686){if(_0xc19aac){_0xc19aac(_0x217686);}});};AGIVertices[_0xb552('0x10')][_0xb552('0x42')]=function(_0x533558,_0xfbeb2e){this['rpc'][_0xb552('0x42')]({'firstName':_[_0xb552('0x43')](_0x533558[_0xb552('0x14')])||_[_0xb552('0x44')](_0x533558[_0xb552('0x14')])?_0xb552('0x45')+Math[_0xb552('0x46')]():_0x533558['name'],'lastName':_[_0xb552('0x43')](_0x533558[_0xb552('0x47')])||_[_0xb552('0x44')](_0x533558[_0xb552('0x47')])?null:_0x533558[_0xb552('0x47')],'phone':_0x533558[_0xb552('0x48')],'ListId':_0x533558[_0xb552('0x49')],'scheduledat':_0x533558[_0xb552('0x4a')],'callbackUniqueid':this[_0xb552('0xf')][_0xb552('0x36')],'tags':_0xb552('0x4b'),'description':_0xb552('0x4c')+_0x533558[_0xb552('0x4a')][_0xb552('0x4d')](),'priority':_0x533558[_0xb552('0x4e')]})[_0xb552('0x18')](function(_0x5dca51){_0xfbeb2e(null,_0x5dca51);})[_0xb552('0x15')](function(_0x152de2){_0xfbeb2e(_0x152de2);});};AGIVertices['prototype'][_0xb552('0x4f')]=function(_0x50d311,_0x1e2ca1){this['rpc'][_0xb552('0x50')](_0x50d311)[_0xb552('0x18')](function(_0x435ccf){_0x1e2ca1(null,_0x435ccf?_0x435ccf[_0xb552('0x14')]:![]);})[_0xb552('0x15')](function(_0x5191ce){_0x1e2ca1(_0x5191ce);});};AGIVertices[_0xb552('0x10')][_0xb552('0x51')]=function(_0x385f01,_0x2d66ab,_0x10358f){var _0x5bb739={'role':'agent'};_0x5bb739[_0x385f01]=this[_0xb552('0xf')][_0xb552('0x39')];this[_0xb552('0x12')]['agentPause'](_0x5bb739,_0x2d66ab,this['channel'][_0xb552('0x36')])[_0xb552('0x18')](function(_0x46d0f4){_0x10358f(null,_['isNil'](_0x46d0f4)?![]:!![]);})['catch'](function(_0x2e5179){logger['error'](_0x2e5179);_0x10358f(null,![]);});};AGIVertices[_0xb552('0x10')]['agentUnpause']=function(_0x15d08b,_0x90731e){var _0x506900={'role':'agent'};_0x506900[_0x15d08b]=this['channel']['callerid'];this['rpc']['agentUnpause'](_0x506900)[_0xb552('0x18')](function(_0x32652f){_0x90731e(null,_[_0xb552('0x44')](_0x32652f)?![]:!![]);})[_0xb552('0x15')](function(_0x51e988){logger[_0xb552('0x2b')](_0x51e988);_0x90731e(null,![]);});};AGIVertices[_0xb552('0x10')][_0xb552('0x52')]=function(_0x154111,_0x20b42d){var _0x41d683={'role':_0xb552('0x53')};_0x41d683[_0x154111]=this['channel'][_0xb552('0x39')];this[_0xb552('0x12')][_0xb552('0x52')](_0x41d683)[_0xb552('0x18')](function(_0x4aac22){_0x20b42d(null,_[_0xb552('0x44')](_0x4aac22)?![]:!![]);})['catch'](function(_0x4e2a9c){logger['error'](_0x4e2a9c);_0x20b42d(null,![]);});};AGIVertices['prototype'][_0xb552('0x54')]=function(_0x5ed78e,_0x22f3d9){var _0x1d3453={'role':'agent'};_0x1d3453[_0x5ed78e]=this[_0xb552('0xf')]['callerid'];var _0x423a3d=_0x5ed78e!=_0xb552('0x55')?util[_0xb552('0x56')]('%s/%s@from-sip/n',_0xb552('0x57'),this['channel'][_0xb552('0x39')]):undefined;this['rpc'][_0xb552('0x54')](_0x1d3453,_0x423a3d)[_0xb552('0x18')](function(_0x167b43){_0x22f3d9(null,_['isNil'](_0x167b43)?![]:!![]);})[_0xb552('0x15')](function(_0x4ae2d6){logger['error'](_0x4ae2d6);_0x22f3d9(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x3810ad,_0x488e9f){sh[_0xb552('0x58')](_[_0xb552('0x59')](_0x3810ad),function(_0x5255d5,_0x3ea1a3){var _0x41e5b0=_0x3ea1a3[_0xb552('0x5a')](/(\r\n|\n|\r)/gm,'');_0x488e9f(null,_0x41e5b0);});};AGIVertices['prototype'][_0xb552('0x5b')]=function(_0x41329d,_0x55f242){scripts[_0xb552('0x5b')](_0x41329d[_0xb552('0x5c')],_0x41329d[_0xb552('0x5d')]||_0xb552('0x5e'),_0x41329d['text'],_0x41329d[_0xb552('0x5f')]||'en-US',_0x41329d['ssmlGender']||_0xb552('0x60'),_0x41329d[_0xb552('0x61')]||_0xb552('0x62'))[_0xb552('0x18')](function(_0x18c2a8){_0x55f242(null,_0x18c2a8);})[_0xb552('0x15')](function(_0x1e1fa1){_0x55f242(_0x1e1fa1);});};AGIVertices[_0xb552('0x10')][_0xb552('0x63')]=function(_0x27206a,_0x58cd9d){scripts[_0xb552('0x63')](_0x27206a[_0xb552('0x5e')],_0x27206a['google_tts_language']||'en',0x1)[_0xb552('0x18')](function(_0x490ac2){_0x58cd9d(null,_0x490ac2);})[_0xb552('0x15')](function(_0x566e22){_0x58cd9d(_0x566e22);});};AGIVertices[_0xb552('0x10')][_0xb552('0x64')]=function(_0x512ff4,_0x218849){var _0x5969d0={'uri':_0x512ff4[_0xb552('0x65')],'method':_0x512ff4[_0xb552('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x512ff4['timeout'])===_0xb552('0x67')&&parseInt(_0x512ff4[_0xb552('0x68')])>=0x1?parseInt(_0x512ff4[_0xb552('0x68')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xb552('0x69'),_0xb552('0x6a')],_0x5969d0['method'][_0xb552('0x6b')]())){try{_0x5969d0[_0xb552('0x6c')]=_0x512ff4[_0xb552('0x6d')]?JSON[_0xb552('0x6e')](_0x512ff4[_0xb552('0x6d')]):{};}catch(_0x5a06e2){logger['error'](_0xb552('0x6f'),_0x5a06e2);}}try{_0x5969d0['headers']=_0x512ff4[_0xb552('0xd')]?JSON[_0xb552('0x6e')](_0x512ff4[_0xb552('0xd')]):{};}catch(_0x4acda4){logger[_0xb552('0x2b')](_0xb552('0x70'),_0x4acda4);}if(_0x512ff4[_0xb552('0x71')]){try{var _0x54537a=require(_0x512ff4[_0xb552('0x71')])[_0xb552('0x72')](this,_0x5969d0);_0x5969d0[_0xb552('0x73')]=Mustache[_0xb552('0x74')](_0x512ff4[_0xb552('0x65')],_0x54537a,{},['$$','$$']);if(_0x5969d0[_0xb552('0x75')]){_0x5969d0[_0xb552('0x75')]=JSON[_0xb552('0x6e')](Mustache[_0xb552('0x74')](JSON[_0xb552('0x76')](_0x5969d0['headers']),_0x54537a,{},['$$','$$']));}if(_0x5969d0['body']){_0x5969d0[_0xb552('0x6c')]=JSON[_0xb552('0x6e')](Mustache['render'](JSON[_0xb552('0x76')](_0x5969d0[_0xb552('0x6c')]),_0x54537a,{},['$$','$$']));}}catch(_0x959a8a){logger[_0xb552('0x2b')](_0xb552('0x77'),_0x959a8a);}}rp(_0x5969d0)['then'](function(_0x196269){var _0x458d40={'statusCode':_0x196269[_0xb552('0x78')]||0xc8,'statusMessage':_0x196269[_0xb552('0x79')]||'OK','headers':_0x196269['headers']||{},'body':_0x196269['body']||{}};_0x218849(null,_0x458d40);})[_0xb552('0x15')](function(_0x527fce){var _0x4cb08a={'statusCode':_0x527fce[_0xb552('0x78')]||0x1f4,'statusMessage':_0x527fce['message']||_0xb552('0x7a'),'headers':_0x527fce[_0xb552('0x7b')][_0xb552('0x75')]||{},'body':_0x527fce['options'][_0xb552('0x6c')]||{}};_0x218849(null,_0x4cb08a);});};AGIVertices[_0xb552('0x10')][_0xb552('0x7c')]=function(_0x53cb69,_0x580710){scripts[_0xb552('0x7c')](this[_0xb552('0xf')][_0xb552('0x36')],_0x53cb69[_0xb552('0x7d')],_0x53cb69[_0xb552('0x5e')],_0x53cb69['dialogflow_language']||'en')[_0xb552('0x18')](function(_0x1ad862){_0x580710(null,_0x1ad862);})[_0xb552('0x15')](function(_0x5711b6){_0x580710(_0x5711b6);});};AGIVertices['prototype'][_0xb552('0x7e')]=function(_0x225e36,_0x16ec03){scripts[_0xb552('0x7e')](this[_0xb552('0xf')][_0xb552('0x36')],_0x225e36[_0xb552('0x7f')],_0x225e36[_0xb552('0x80')],_0x225e36[_0xb552('0x81')],_0x225e36['text'],_0x225e36[_0xb552('0x82')]||'en')[_0xb552('0x18')](function(_0x4b0c7b){_0x16ec03(null,_0x4b0c7b);})[_0xb552('0x15')](function(_0x40b326){_0x16ec03(_0x40b326);});};AGIVertices[_0xb552('0x10')]['sestekNDA']=function(_0x3de3b5,_0x2919ba){scripts[_0xb552('0x83')](this[_0xb552('0xf')],_0x3de3b5)['then'](function(_0x4b0e3c){_0x2919ba(null,_0x4b0e3c);})[_0xb552('0x15')](function(_0x2ed246){_0x2919ba(_0x2ed246);});};AGIVertices[_0xb552('0x10')][_0xb552('0x84')]=function(_0x21d1e5,_0x3a0f33){scripts['ispeechTTS'](_0x21d1e5[_0xb552('0x7d')],_0x21d1e5[_0xb552('0x5e')],_0x21d1e5['ispeech_tts_language']||_0xb552('0x85'),_0x21d1e5['speed'])[_0xb552('0x18')](function(_0x3fa280){_0x3a0f33(null,_0x3fa280);})[_0xb552('0x15')](function(_0x42788a){_0x3a0f33(_0x42788a);});};AGIVertices[_0xb552('0x10')]['ispeechASR']=function(_0x58e42e,_0x5e3e8a,_0x25bde1){scripts[_0xb552('0x86')](_0x5e3e8a,_0x58e42e[_0xb552('0x7d')],_0x58e42e['ispeech_asr_language']||_0xb552('0x85'),this[_0xb552('0x87')](_0x58e42e['model'])?_0x58e42e[_0xb552('0x88')]:undefined)[_0xb552('0x18')](function(_0x466866){_0x25bde1(null,_0x466866);})['catch'](function(_0x247eda){_0x25bde1(_0x247eda);});};AGIVertices[_0xb552('0x10')][_0xb552('0x89')]=function(_0x833246,_0x187441){scripts['awsPolly'](_0x833246['aws_access_key_id'],_0x833246[_0xb552('0x8a')],_0x833246['aws_polly_region'],_0x833246[_0xb552('0x8b')]||_0xb552('0x8c'),_0x833246[_0xb552('0x5e')],_0x833246[_0xb552('0x8d')]||_0xb552('0x5e'))[_0xb552('0x18')](function(_0xde0a93){_0x187441(null,_0xde0a93);})['catch'](function(_0x41e832){_0x187441(_0x41e832);});};AGIVertices[_0xb552('0x10')]['awsLex']=function(_0x5e0302,_0x33c3c6){scripts[_0xb552('0x8e')](this[_0xb552('0xf')][_0xb552('0x36')],_0x5e0302[_0xb552('0x8f')],_0x5e0302[_0xb552('0x8a')],_0x5e0302['aws_lex_region'],_0x5e0302[_0xb552('0x5e')],_0x5e0302[_0xb552('0x90')])[_0xb552('0x18')](function(_0x111410){_0x33c3c6(null,_0x111410);})[_0xb552('0x15')](function(_0x5a3b02){_0x33c3c6(_0x5a3b02);});};AGIVertices[_0xb552('0x10')][_0xb552('0x91')]=function(_0x2caafb,_0x1e829c,_0xd71c36){scripts[_0xb552('0x91')](_0x1e829c,_0x2caafb['key'],_0x2caafb['google_asr_language']||_0xb552('0x85'))[_0xb552('0x18')](function(_0x565494){_0xd71c36(null,_0x565494);})[_0xb552('0x15')](function(_0x5ea1da){_0xd71c36(_0x5ea1da);});};AGIVertices[_0xb552('0x10')][_0xb552('0x92')]=function(_0x569ce0,_0x33f846,_0x3344cd){scripts[_0xb552('0x92')](_0x33f846,_0x569ce0[_0xb552('0x93')],_0x569ce0[_0xb552('0x94')],_0x569ce0['uri'])[_0xb552('0x18')](function(_0x21c511){_0x3344cd(null,_0x21c511);})[_0xb552('0x15')](function(_0x5df344){_0x3344cd(_0x5df344);});};AGIVertices[_0xb552('0x10')][_0xb552('0x95')]=function(_0x3d90de){var _0x33ea98=_['includes'](verticesWithRetry,_0x3d90de['agicommand'])?_0x3d90de:_[_0xb552('0x96')](_0x3d90de);for(var _0x58c364 in _0x33ea98){if(_0x33ea98[_0xb552('0x97')](_0x58c364)){if(_0x33ea98[_0x58c364]&&_['isString'](_0x33ea98[_0x58c364])){if(_['includes'](recursiveMapAttributes,_0x58c364)){_0x33ea98[_0x58c364]=this[_0xb552('0x98')](_0x33ea98[_0x58c364]);}else{_0x33ea98[_0x58c364]=this[_0xb552('0x99')](_0x33ea98[_0x58c364]);}}}}return _0x33ea98;};AGIVertices['prototype'][_0xb552('0x9a')]=function(_0x4bbda3){for(var _0xd5abac in _0x4bbda3){if(_0x4bbda3[_0xb552('0x97')](_0xd5abac)){if(_[_0xb552('0x9b')](_0x4bbda3[_0xd5abac])){this[_0xb552('0x9a')](_0x4bbda3[_0xd5abac]);}else if(_['isArray'](_0x4bbda3[_0xd5abac])){for(var _0x342aec=0x0;_0x342aec<_0x4bbda3[_0xd5abac][_0xb552('0x9c')];_0x342aec++){this[_0xb552('0x9a')](_0x4bbda3[_0xd5abac][_0x342aec]);}}else if(_[_0xb552('0x9d')](_0x4bbda3[_0xd5abac])){_0x4bbda3[_0xd5abac]=this[_0xb552('0x99')](_0x4bbda3[_0xd5abac]);}}}};AGIVertices[_0xb552('0x10')][_0xb552('0x9e')]=function(_0x567c67,_0x4dae04){for(var _0x317c2d in _0x567c67){if(_0x567c67[_0xb552('0x97')](_0x317c2d)){if(_['isPlainObject'](_0x567c67[_0x317c2d])){if(!_[_0xb552('0x43')](_0x567c67[_0x317c2d])){this[_0xb552('0x9e')](_0x567c67[_0x317c2d],util[_0xb552('0x56')](_0xb552('0x9f'),_0x4dae04,_0x317c2d));}}else if(_[_0xb552('0xa0')](_0x567c67[_0x317c2d])){for(var _0x3fe48b=0x0;_0x3fe48b<_0x567c67[_0x317c2d][_0xb552('0x9c')];_0x3fe48b++){this[_0xb552('0x9e')](_0x567c67[_0x317c2d][_0x3fe48b],util[_0xb552('0x56')](_0xb552('0x9f'),_0x4dae04,_0x317c2d+'['+_0x3fe48b+']'));}}else{if(!_['isNil'](_0x567c67[_0x317c2d])){this[_0xb552('0xf')][_0xb552('0xa1')](util[_0xb552('0x56')]('%s.%s',_0x4dae04,_0x317c2d),_0x567c67[_0x317c2d]);}}}}};AGIVertices[_0xb552('0x10')][_0xb552('0x98')]=function(_0x3996c5){try{var _0x3431f3=JSON[_0xb552('0x6e')](_0x3996c5);this[_0xb552('0x9a')](_0x3431f3);return JSON[_0xb552('0x76')](_0x3431f3);}catch(_0x92b019){return this['replaceAllVariables'](_0x3996c5);}};AGIVertices[_0xb552('0x10')][_0xb552('0x99')]=function(_0x52250f){var _0x714c19=_0x52250f['split']('{');for(var _0x1361dd=0x1;_0x1361dd<_0x714c19[_0xb552('0x9c')];_0x1361dd+=0x1){var _0x59b1f8=_0x714c19[_0x1361dd][_0xb552('0xa2')]('}');if(_0x59b1f8['length']>0x1){_0x52250f=_0x52250f[_0xb552('0xa3')]('{'+_0x59b1f8[0x0]+'}',this['channel']['getVariable'](_0x59b1f8[0x0])['extra']||_0x59b1f8[0x0]);}}if(_0x714c19[_0xb552('0x9c')]===0x1){return _0x52250f[_0xb552('0x4d')]();}return this['replaceAllVariables'](_0x52250f);};AGIVertices[_0xb552('0x10')][_0xb552('0xa4')]=function(_0x2448fa,_0x2da4a4){var _0x3e9cf8=this[_0xb552('0xf')][_0xb552('0x11')](_0x2448fa);if(_0x3e9cf8[_0xb552('0xa5')]===-0x1){return _0x3e9cf8;}logger[_0xb552('0x2c')](util[_0xb552('0x56')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2da4a4,_0x3e9cf8['extra']));return this['channel'][_0xb552('0xa1')](_0x2da4a4,_0x3e9cf8[_0xb552('0xa6')]);};AGIVertices['prototype']['isConfigured']=function(_0x23de37){return _0x23de37&&_0x23de37!=='0'&&_0x23de37!=='-1'&&_0x23de37!=='';};AGIVertices[_0xb552('0x10')][_0xb552('0xa7')]=function(_0x396c02){this[_0xb552('0x35')]['sync'](this,_0x396c02,'-');_0x396c02['retry']=_0x396c02[_0xb552('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xb552('0xa8')]=function(_0x53dc8b){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xa9'),_0x53dc8b[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x53dc8b[_0xb552('0x5e')])){return this['channel'][_0xb552('0xaa')](_0xb552('0xab'));}var _0x1bca24='\x22'+_0x53dc8b['text']+'\x22';if(this['isConfigured'](_0x53dc8b[_0xb552('0x7b')])){_0x1bca24+=','+_0x53dc8b[_0xb552('0x7b')];}var _0x23f382=this[_0xb552('0xf')][_0xb552('0x58')](_0xb552('0xac'),_0x1bca24);if(_0x23f382[_0xb552('0xa5')]===-0x1){return _0x23f382;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1bca24));};AGIVertices[_0xb552('0x10')][_0xb552('0xad')]=function(_0x41c709){logger[_0xb552('0x2c')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x41c709[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x41c709[_0xb552('0xae')])){return this[_0xb552('0xf')][_0xb552('0xaa')]('no\x20grammar\x20configured');}var _0x42334f=_0x41c709[_0xb552('0xae')];if(this[_0xb552('0x87')](_0x41c709[_0xb552('0x7b')])){_0x42334f+=','+_0x41c709['options'];}var _0x654981=this['channel'][_0xb552('0x58')]('MRCPRecog',_0x42334f);if(_0x654981[_0xb552('0xa5')]===-0x1){return _0x654981;}var _0x1eb0e7=this[_0xb552('0xa4')](_0xb552('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0x1eb0e7[_0xb552('0xa5')]===-0x1){return _0x1eb0e7;}var _0x2e701e=this[_0xb552('0xa4')](_0xb552('0xb0'),_0xb552('0xb1'));if(_0x2e701e[_0xb552('0xa5')]===-0x1){return _0x2e701e;}var _0x19317b=this[_0xb552('0xa4')](_0xb552('0xb2'),_0xb552('0xb3'));if(_0x19317b[_0xb552('0xa5')]===-0x1){return _0x19317b;}return this[_0xb552('0xf')][_0xb552('0xaa')](util['format'](_0xb552('0xb4'),_0x42334f));};AGIVertices[_0xb552('0x10')][_0xb552('0x9')]=function(_0x45d325){logger['info'](util[_0xb552('0x56')](_0xb552('0xb5'),_0x45d325[_0xb552('0x37')]));return this[_0xb552('0xf')][_0xb552('0x9')]([_0x45d325[_0xb552('0xb6')],_0x45d325[_0xb552('0xb7')]]);};AGIVertices[_0xb552('0x10')][_0xb552('0xb8')]=function(_0x185b78){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xb9'),_0x185b78[_0xb552('0x37')]));if(this[_0xb552('0x87')](_0x185b78[_0xb552('0x68')])){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xba'),_0x185b78['timeout']));var _0x424df2=this[_0xb552('0xf')][_0xb552('0xbb')](_0x185b78[_0xb552('0x68')]);if(_0x424df2[_0xb552('0xa5')]===-0x1){return _0x424df2;}}return this['channel'][_0xb552('0xb8')]();};AGIVertices[_0xb552('0x10')][_0xb552('0x4b')]=function(_0x17d13b){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xbc'),_0x17d13b[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x17d13b[_0xb552('0x49')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x17d13b,_0xb552('0xbd'));}_0x17d13b['scheduledAt']=moment();if(this[_0xb552('0x87')](_0x17d13b['delay'])){_0x17d13b[_0xb552('0x4a')]=moment()['add'](_0x17d13b['delay'],_0xb552('0xbe'));}if(!this[_0xb552('0x87')](_0x17d13b[_0xb552('0x4e')])){_0x17d13b['callback_priority']=0x2;}this[_0xb552('0x42')]['sync'](this,_0x17d13b);return this[_0xb552('0xf')][_0xb552('0xaa')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x17d13b['phone'],_0x17d13b['list_id'],_0x17d13b['scheduledAt']));};AGIVertices['prototype'][_0xb552('0xbf')]=function(_0x294270){logger[_0xb552('0x2c')](util[_0xb552('0x56')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x294270[_0xb552('0x37')]));var _0x1e3fdf=this[_0xb552('0xf')][_0xb552('0x58')](_0x294270['application'],_0x294270[_0xb552('0x7b')]);if(_0x1e3fdf[_0xb552('0xa5')]===-0x1){return _0x1e3fdf;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xc0'),_0x294270[_0xb552('0xc1')],_0x294270[_0xb552('0x7b')]));};AGIVertices[_0xb552('0x10')][_0xb552('0xc2')]=function(_0x3a726f){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xc3'),_0x3a726f[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x3a726f[_0xb552('0x5e')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}var _0x3756ff='\x22'+_0x3a726f[_0xb552('0x5e')]+'\x22';if(this[_0xb552('0x87')](_0x3a726f[_0xb552('0x7b')])){_0x3756ff+=','+_0x3a726f[_0xb552('0x7b')];}var _0x3b683c=this[_0xb552('0xf')][_0xb552('0x58')](_0xb552('0xac'),_0x3756ff);if(_0x3b683c[_0xb552('0xa5')]===-0x1){return _0x3b683c;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xc4'),_0x3756ff));};AGIVertices[_0xb552('0x10')][_0xb552('0xc5')]=function(_0x3ffa26){logger['info'](util[_0xb552('0x56')](_0xb552('0xc6'),_0x3ffa26[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x3ffa26[_0xb552('0x5e')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}var _0x4d9406='\x22'+_0x3ffa26[_0xb552('0x5e')]+'\x22';if(this['isConfigured'](_0x3ffa26['options'])){_0x4d9406+=','+_0x3ffa26[_0xb552('0x7b')];}var _0x476d0b=this[_0xb552('0xf')][_0xb552('0x58')](_0xb552('0xac'),_0x4d9406);if(_0x476d0b[_0xb552('0xa5')]===-0x1){return _0x476d0b;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4d9406));};AGIVertices[_0xb552('0x10')][_0xb552('0xc7')]=function(_0x162cdf){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xc8'),_0x162cdf[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x162cdf[_0xb552('0xae')])){return this['channel'][_0xb552('0xaa')]('no\x20grammar\x20configured');}var _0x42695a=_0x162cdf[_0xb552('0xae')];if(this[_0xb552('0x87')](_0x162cdf[_0xb552('0x7b')])){_0x42695a+=','+_0x162cdf['options'];}var _0x5e56f3=this[_0xb552('0xf')][_0xb552('0x58')](_0xb552('0xc9'),_0x42695a);if(_0x5e56f3['result']===-0x1){return _0x5e56f3;}var _0x4cb712=this['getAndSetVariable'](_0xb552('0xaf'),_0xb552('0xca'));if(_0x4cb712[_0xb552('0xa5')]===-0x1){return _0x4cb712;}var _0x281581=this[_0xb552('0xa4')](_0xb552('0xb0'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x281581['result']===-0x1){return _0x281581;}var _0x49d6a5=this[_0xb552('0xa4')](_0xb552('0xb2'),_0xb552('0xcb'));if(_0x49d6a5[_0xb552('0xa5')]===-0x1){return _0x49d6a5;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')]('Executed\x20command\x20MRCPRecog\x20%s',_0x42695a));};AGIVertices[_0xb552('0x10')][_0xb552('0xcc')]=function(_0xde33f8){logger[_0xb552('0x2c')](util[_0xb552('0x56')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0xde33f8[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0xde33f8[_0xb552('0xae')])){return this['channel'][_0xb552('0xaa')]('no\x20grammar\x20configured');}var _0x416399=_0xde33f8['grammar'];if(this['isConfigured'](_0xde33f8[_0xb552('0x7b')])){_0x416399+=','+_0xde33f8[_0xb552('0x7b')];}var _0x51b644=this[_0xb552('0xf')][_0xb552('0x58')](_0xb552('0xc9'),_0x416399);if(_0x51b644[_0xb552('0xa5')]===-0x1){return _0x51b644;}var _0x5c2759=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xb552('0xcd'));if(_0x5c2759[_0xb552('0xa5')]===-0x1){return _0x5c2759;}var _0x543a63=this[_0xb552('0xa4')](_0xb552('0xb0'),'SESTEK_ASR_TRANSCRIPT');if(_0x543a63['result']===-0x1){return _0x543a63;}var _0x2b7dfd=this[_0xb552('0xa4')](_0xb552('0xb2'),_0xb552('0xce'));if(_0x2b7dfd['result']===-0x1){return _0x2b7dfd;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xb4'),_0x416399));};AGIVertices[_0xb552('0x10')][_0xb552('0xcf')]=function(_0x99b7b0){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xd0'),_0x99b7b0[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x99b7b0[_0xb552('0xd1')])){return this['channel']['error'](_0x99b7b0,'no\x20database\x20selected');}var _0x38638d=this[_0xb552('0xd2')][_0xb552('0x72')](this,_0x99b7b0[_0xb552('0xd1')]);if(!_0x38638d){return this['channel'][_0xb552('0x2b')](_0x99b7b0,_0xb552('0xd3'));}if(!this[_0xb552('0x87')](_0x99b7b0[_0xb552('0x2e')])){return this[_0xb552('0xf')]['error'](_0x99b7b0,_0xb552('0xd4'));}var _0x37f173=_0x99b7b0[_0xb552('0x2e')][_0xb552('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb552('0xf')][_0xb552('0xaa')](util['format'](_0xb552('0xd5'),_0x37f173));var _0x180116=this[_0xb552('0xd6')][_0xb552('0x72')](this,_0x38638d,_0x37f173);this[_0xb552('0x35')]['sync'](this,_0x99b7b0,_0x37f173);if(!this[_0xb552('0x87')](_0x99b7b0['variable_id'])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xd7'));}var _0x30ef66=this[_0xb552('0x11')][_0xb552('0x72')](this,_0x99b7b0['variable_id']);if(!_0x30ef66){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x99b7b0,_0xb552('0xd8'));}var _0x37f858=this;_0x180116[_0xb552('0xd9')](function(_0x266d77,_0x2f637e){Object[_0xb552('0xda')](_0x266d77)[_0xb552('0xd9')](function(_0x42f4c3){_0x37f858['channel'][_0xb552('0xa1')](util['format']('%s[%s][%s]',_0x30ef66,_0x2f637e,_0x42f4c3),_0x266d77[_0x42f4c3]);});});this['channel'][_0xb552('0xa1')](util[_0xb552('0x56')]('%s_ROWS_COUNT',_0x30ef66),_0x180116[_0xb552('0x9c')]);return this[_0xb552('0xf')][_0xb552('0xaa')](util['format'](_0xb552('0xdb'),_0x30ef66));};AGIVertices[_0xb552('0x10')]['dial']=function(_0x12fa20){logger[_0xb552('0xdc')](util[_0xb552('0x56')](_0xb552('0xdd'),_0x12fa20[_0xb552('0x37')]));if(!this['isConfigured'](_0x12fa20[_0xb552('0xde')])){return this['channel'][_0xb552('0x2b')](_0x12fa20,_0xb552('0xdf'));}var _0x3ba9c7=this['getUser'][_0xb552('0x72')](this,_0x12fa20[_0xb552('0xde')]);if(!_0x3ba9c7){return this['channel'][_0xb552('0x2b')](_0x12fa20,_0xb552('0xe0'));}var _0x3af9bf=this[_0xb552('0xf')][_0xb552('0x58')]('DIAL',[util[_0xb552('0x56')](_0xb552('0xe1'),_0x3ba9c7),_0x12fa20[_0xb552('0x68')],_0x12fa20[_0xb552('0xe2')],_0x12fa20[_0xb552('0x65')]]);if(_0x3af9bf['result']===-0x1){return _0x3af9bf;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xe3'),_0xb552('0xe4')));};AGIVertices[_0xb552('0x10')][_0xb552('0xe5')]=function(_0x358c18){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xe6'),_0x358c18[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x358c18['key'])){return this['channel'][_0xb552('0xaa')](_0xb552('0xe7'));}if(!this['isConfigured'](_0x358c18['text'])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}this[_0xb552('0xf')][_0xb552('0xe8')]=!![];this[_0xb552('0x35')](_0x358c18);this['createSquareMessage'](_0x358c18[_0xb552('0x5e')],'in','','');this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')]('Trying\x20Dialogflow:\x20%s',_0x358c18[_0xb552('0x5e')]));var _0x587b76=this[_0xb552('0x7c')][_0xb552('0x72')](this,_0x358c18);if(_0x587b76){for(var _0x2a59f3 in _0x587b76){if(_0x587b76[_0xb552('0x97')](_0x2a59f3)){this[_0xb552('0xf')][_0xb552('0xa1')](util[_0xb552('0x56')]('DIALOGFLOW_%s',_0x2a59f3[_0xb552('0x6b')]()),_0x587b76[_0x2a59f3]);}}this[_0xb552('0x41')](_0x587b76['speech'],_0xb552('0xe9'),_0xb552('0xe5'),'');return this['channel']['noop'](util[_0xb552('0x56')](_0xb552('0xea'),_0x587b76[_0xb552('0xeb')]));}return this[_0xb552('0xf')][_0xb552('0x2b')](_0x358c18,_0xb552('0xec'));};AGIVertices['prototype'][_0xb552('0xed')]=function(_0x5aea4d){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xee'),_0x5aea4d[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x5aea4d[_0xb552('0x7f')])){return this[_0xb552('0xf')]['noop'](_0xb552('0xef'));}if(!this['isConfigured'](_0x5aea4d[_0xb552('0x80')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xf0'));}if(!this['isConfigured'](_0x5aea4d[_0xb552('0x81')])){return this[_0xb552('0xf')][_0xb552('0xaa')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x5aea4d[_0xb552('0x82')])){return this['channel'][_0xb552('0xaa')](_0xb552('0xf1'));}if(!this[_0xb552('0x87')](_0x5aea4d[_0xb552('0x5e')])){return this[_0xb552('0xf')][_0xb552('0xaa')]('no\x20text\x20configured');}this['channel'][_0xb552('0xe8')]=!![];this[_0xb552('0x35')](_0x5aea4d);this[_0xb552('0x41')](_0x5aea4d[_0xb552('0x5e')],'in','','');this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xf2'),_0x5aea4d['text']));var _0x2a760b=this[_0xb552('0x7e')][_0xb552('0x72')](this,_0x5aea4d);if(_0x2a760b){for(var _0x31e09a in _0x2a760b){if(_0x2a760b[_0xb552('0x97')](_0x31e09a)){if(_0x31e09a!==_0xb552('0xf3')){this[_0xb552('0xf')][_0xb552('0xa1')](util[_0xb552('0x56')](_0xb552('0xf4'),_0x31e09a[_0xb552('0x6b')]()),_0x2a760b[_0x31e09a]);}}}this[_0xb552('0x41')](_0x2a760b['speech'],_0xb552('0xe9'),_0xb552('0xed'),_0x2a760b[_0xb552('0xf3')]);return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xf5'),_0x2a760b['speech']));}return this[_0xb552('0xf')][_0xb552('0x2b')](_0x5aea4d,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xb552('0x10')][_0xb552('0xf6')]=function(_0x670847){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0xf7'),_0x670847[_0xb552('0x37')]));if(!this['isConfigured'](_0x670847[_0xb552('0xf8')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xf9'));}if(!this[_0xb552('0x87')](_0x670847['username'])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xfa'));}if(!this[_0xb552('0x87')](_0x670847[_0xb552('0xfb')])){return this['channel']['noop'](_0xb552('0xfc'));}if(!this[_0xb552('0x87')](_0x670847[_0xb552('0xfd')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}this['channel'][_0xb552('0xe8')]=!![];this[_0xb552('0x35')](_0x670847);this['createSquareMessage'](_0x670847[_0xb552('0x5e')],'in','','');this['channel'][_0xb552('0xaa')](util['format'](_0xb552('0xfe'),_0x670847[_0xb552('0x5e')]));var _0x5e7f0a=this['sestekNDA'][_0xb552('0x72')](this,_0x670847);if(_0x5e7f0a){for(var _0x3d3356 in _0x5e7f0a){if(_0x5e7f0a[_0xb552('0x97')](_0x3d3356)){this[_0xb552('0xf')][_0xb552('0xa1')](util[_0xb552('0x56')](_0xb552('0xff'),_0x3d3356[_0xb552('0x6b')]()),_0x5e7f0a[_0x3d3356]);}}this['createSquareMessage'](_0x5e7f0a[_0xb552('0xeb')],_0xb552('0xe9'),_0xb552('0xf6'),'');if(_0x5e7f0a[_0xb552('0x100')]){this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x101'),_0x5e7f0a[_0xb552('0x100')]));var _0x3ff2c8=this[_0xb552('0xf')][_0xb552('0x102')](_0x5e7f0a['audiofile']);try{fs[_0xb552('0x103')](_0x5e7f0a['audiofile']+'.wav');}catch(_0x57037a){logger[_0xb552('0x2b')](_0x57037a);}return _0x3ff2c8;}else{return this[_0xb552('0xf')]['noop'](util['format'](_0xb552('0x104'),_0x5e7f0a[_0xb552('0xeb')]));}}return this[_0xb552('0xf')][_0xb552('0x2b')](_0x670847,_0xb552('0x105'));};AGIVertices['prototype'][_0xb552('0x106')]=function(_0x5a171d){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x107'),_0x5a171d[_0xb552('0x37')]));return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x106'));};AGIVertices[_0xb552('0x10')][_0xb552('0x108')]=function(_0x1ecbd2){logger['info'](util[_0xb552('0x56')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1ecbd2[_0xb552('0x37')]));var _0x5b8da0='';if(_0x1ecbd2[_0xb552('0x109')]){if(!this[_0xb552('0x87')](_0x1ecbd2[_0xb552('0x109')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x1ecbd2,_0xb552('0x10a'));}else{var _0x2d5a8d=parseInt(_0x1ecbd2['trunk_id'],0xa);if(isNaN(_0x2d5a8d)){_0x5b8da0=_0x1ecbd2[_0xb552('0x109')];}else{_0x5b8da0=this[_0xb552('0x10b')][_0xb552('0x72')](this,_0x1ecbd2[_0xb552('0x109')]);if(!_0x5b8da0){return this[_0xb552('0xf')]['error'](_0x1ecbd2,_0xb552('0x10c'));}}}}else if(_0x1ecbd2['trunk_name']){_0x5b8da0=_0x1ecbd2[_0xb552('0x10d')];}else{return this['channel'][_0xb552('0x2b')](_0x1ecbd2,_0xb552('0x10a'));}var _0x1b73a4=this[_0xb552('0xf')][_0xb552('0x58')](_0xb552('0xe4'),[util[_0xb552('0x56')](_0xb552('0x10e'),_0x5b8da0,_0x1ecbd2[_0xb552('0x48')]),_0x1ecbd2[_0xb552('0x68')],_0x1ecbd2[_0xb552('0xe2')],_0x1ecbd2[_0xb552('0x65')]]);if(_0x1b73a4['result']===-0x1){return _0x1b73a4;}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xe3'),_0xb552('0xe4')));};AGIVertices[_0xb552('0x10')][_0xb552('0x10f')]=function(_0x316bf4){logger['info'](util[_0xb552('0x56')](_0xb552('0x110'),_0x316bf4[_0xb552('0x37')]));return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x10f'));};AGIVertices[_0xb552('0x10')][_0xb552('0xe')]=function(_0x1ee4ac){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x111'),_0x1ee4ac['label']));if(_0x1ee4ac[_0xb552('0x112')]===0x0){return this[_0xb552('0xa7')](_0x1ee4ac);}_0x1ee4ac[_0xb552('0x112')]-=0x1;if(!this['isConfigured'](_0x1ee4ac[_0xb552('0x113')])){return this['channel'][_0xb552('0x2b')](_0x1ee4ac,_0xb552('0x114'));}var _0xa62c5c=this[_0xb552('0x1d')][_0xb552('0x72')](this,_0x1ee4ac['file_id']);if(!_0xa62c5c){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x1ee4ac,_0xb552('0x115'));}if(!this[_0xb552('0x87')](_0x1ee4ac[_0xb552('0x116')])){return this[_0xb552('0xf')]['error'](_0xb552('0xd7'));}var _0x5ca79f=this['channel']['getData'](_0xa62c5c,_0x1ee4ac[_0xb552('0x117')],_0x1ee4ac[_0xb552('0x118')]);var _0x34ab3f=_0x5ca79f[_0xb552('0xa5')]?_0x5ca79f[_0xb552('0xa5')][_0xb552('0x4d')]():'';logger[_0xb552('0x2c')]('test',JSON[_0xb552('0x76')](_0x5ca79f));if(_0x5ca79f['result']===-0x1){this[_0xb552('0x35')]['sync'](this,_0x1ee4ac,_0x34ab3f);return _0x5ca79f;}else if(_0x5ca79f['extra']===_0xb552('0x68')){_0x5ca79f[_0xb552('0xa5')]=_0x34ab3f['length']>=parseInt(_0x1ee4ac[_0xb552('0x119')])?'x':'i';}else{_0x5ca79f[_0xb552('0xa5')]=_0x34ab3f['length']>=parseInt(_0x1ee4ac['mindigit'])&&_0x34ab3f['length']<=parseInt(_0x1ee4ac[_0xb552('0x118')])?'x':'i';}var _0x4ea586=this[_0xb552('0x11')]['sync'](this,_0x1ee4ac[_0xb552('0x116')]);if(!_0x4ea586){return this['channel'][_0xb552('0x2b')](_0x1ee4ac,_0xb552('0xd8'));}this[_0xb552('0xf')]['setVariable'](_0x4ea586,_0x34ab3f);if(this[_0xb552('0x87')](_0x1ee4ac[_0xb552('0x11a')])){var _0x4489f2=parseInt(_0x1ee4ac[_0xb552('0x11a')],0xa);var _0x50f07a=rs[_0xb552('0x11b')]({'charset':'*','length':_0x4489f2});var _0x5abcf6=_0x34ab3f[_0xb552('0x9c')];if(_0x5abcf6>0x0){if(_0x5abcf6>_0x4489f2){this['createSquareDetailsReport'][_0xb552('0x72')](this,_0x1ee4ac,_0x1ee4ac[_0xb552('0x11c')]==='first'?_0x50f07a+_0x34ab3f[_0xb552('0x11d')](_0x4489f2):_0x34ab3f['substr'](0x0,_0x5abcf6-_0x4489f2)+_0x50f07a);}else{this[_0xb552('0x35')][_0xb552('0x72')](this,_0x1ee4ac,rs['generate']({'charset':'*','length':_0x5abcf6}));}}else{this[_0xb552('0x35')][_0xb552('0x72')](this,_0x1ee4ac,'');}}else{this[_0xb552('0x35')][_0xb552('0x72')](this,_0x1ee4ac,_0x34ab3f);}return _0x5ca79f;};AGIVertices[_0xb552('0x10')][_0xb552('0x11e')]=function(_0x764eac){logger['info'](util[_0xb552('0x56')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x764eac['label']));return this[_0xb552('0xe')](_0x764eac);};AGIVertices['prototype']['goal']=function(_0x2dad87){logger[_0xb552('0x2c')](util['format'](_0xb552('0x11f'),_0x2dad87[_0xb552('0x37')]));this[_0xb552('0x35')]['sync'](this,_0x2dad87,_0x2dad87[_0xb552('0x120')]);return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x121'),_0x2dad87[_0xb552('0x120')]));};AGIVertices[_0xb552('0x10')][_0xb552('0x122')]=function(_0x4ebbfb){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x123'),_0x4ebbfb[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x4ebbfb['aws_access_key_id'])||!this[_0xb552('0x87')](_0x4ebbfb[_0xb552('0x8a')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x124'));}if(!this[_0xb552('0x87')](_0x4ebbfb[_0xb552('0x5e')])){return this[_0xb552('0xf')]['noop'](_0xb552('0xab'));}this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x125'),_0x4ebbfb[_0xb552('0x5e')]));var _0x538cd3=this['awsPolly'][_0xb552('0x72')](this,_0x4ebbfb);if(_0x538cd3){this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')]('aws\x20Polly\x20%s\x20file\x20created',_0x538cd3));var _0x3271b7=this[_0xb552('0xf')]['streamFile'](_0x538cd3);try{fs['unlink'](_0x538cd3+_0xb552('0x126'));}catch(_0x1f4b6f){logger[_0xb552('0x2b')](_0x1f4b6f);}return _0x3271b7;}return this['channel'][_0xb552('0x2b')](_0x4ebbfb,_0xb552('0x127'));};AGIVertices[_0xb552('0x10')][_0xb552('0x128')]=function(_0x4fa366){logger['info'](util['format'](_0xb552('0x129'),_0x4fa366[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x4fa366[_0xb552('0x8f')])||!this['isConfigured'](_0x4fa366[_0xb552('0x8a')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x124'));}if(!this[_0xb552('0x87')](_0x4fa366[_0xb552('0x90')])){return this['channel'][_0xb552('0xaa')](_0xb552('0x12a'));}if(!this[_0xb552('0x87')](_0x4fa366[_0xb552('0x5e')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}this[_0xb552('0xf')][_0xb552('0xe8')]=!![];this[_0xb552('0x35')](_0x4fa366);this[_0xb552('0x41')](_0x4fa366['text'],'in','','');this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x12b'),_0x4fa366[_0xb552('0x5e')]));var _0x23be70=this['awsLex'][_0xb552('0x72')](this,_0x4fa366);if(_0x23be70){for(var _0x2369e5 in _0x23be70){if(_0x23be70[_0xb552('0x97')](_0x2369e5)&&_[_0xb552('0x9d')](_0x23be70[_0x2369e5])){this['channel']['setVariable'](util['format'](_0xb552('0x12c'),_0x2369e5['toUpperCase']()),_0x23be70[_0x2369e5]);}}if(_['isNil'](_0x23be70['message'])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x12d'));}else{this[_0xb552('0x41')](_0x23be70[_0xb552('0x12e')],_0xb552('0xe9'),_0xb552('0x12f'),'');return this[_0xb552('0xf')]['noop'](util[_0xb552('0x56')](_0xb552('0x130'),_0x23be70['message']));}}return this[_0xb552('0xf')][_0xb552('0x2b')](_0x4fa366,_0xb552('0x131'));};AGIVertices[_0xb552('0x10')]['googleasr']=function(_0xc5aec6){logger['info'](util[_0xb552('0x56')](_0xb552('0x132'),_0xc5aec6[_0xb552('0x37')],_0xc5aec6['timeout']));if(!this[_0xb552('0x87')](_0xc5aec6[_0xb552('0x7d')])){return this['channel'][_0xb552('0xaa')](_0xb552('0xe7'));}var _0x383c14=_0xb552('0x133');var _0x4bcdb9=util[_0xb552('0x56')]('%s/recordings/%s',FILES_PATH,rs[_0xb552('0x11b')](0x4));var _0x1f8eb9=util['format'](_0xb552('0x9f'),_0x4bcdb9,_0x383c14);var _0x20e9ab=!![];if(_0xc5aec6[_0xb552('0x134')]===_0xb552('0x135')){_0x20e9ab=![];}var _0x27b921=this[_0xb552('0xf')][_0xb552('0x136')](_0x4bcdb9,_0x383c14,_0xc5aec6['intKey'],_0xc5aec6[_0xb552('0x68')],undefined,_0x20e9ab);if(_0x27b921[_0xb552('0xa5')]!==-0x1){this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')]('google\x20%s\x20file\x20created',_0x1f8eb9));var _0xde0278=this[_0xb552('0x91')][_0xb552('0x72')](this,_0xc5aec6,_0x1f8eb9);if(_0xde0278){for(var _0x3606a1 in _0xde0278){if(_0xde0278['hasOwnProperty'](_0x3606a1)){this[_0xb552('0xf')]['setVariable'](util[_0xb552('0x56')](_0xb552('0x137'),_0x3606a1[_0xb552('0x6b')]()),_0xde0278[_0x3606a1]);}}return this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')]('GoogleASR\x20Result\x20%s',JSON[_0xb552('0x76')](_0xde0278)));}}return _0x27b921;};AGIVertices['prototype']['tildeasr']=function(_0x585f84){logger[_0xb552('0x2c')](util['format'](_0xb552('0x138'),_0x585f84[_0xb552('0x37')]));if(!this['isConfigured'](_0x585f84[_0xb552('0x93')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x139'));}if(!this['isConfigured'](_0x585f84[_0xb552('0x94')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x13a'));}var _0x14d66c='wav';var _0x4640c9=util[_0xb552('0x56')]('%s/recordings/%s',FILES_PATH,rs[_0xb552('0x11b')](0x4));var _0x2efb50=util['format']('%s.%s',_0x4640c9,_0x14d66c);var _0x4f1e6f=!![];if(_0x585f84[_0xb552('0x134')]===_0xb552('0x135')){_0x4f1e6f=![];}var _0x291715=this[_0xb552('0xf')][_0xb552('0x136')](_0x4640c9,_0x14d66c,_0x585f84[_0xb552('0x13b')],_0x585f84[_0xb552('0x68')],undefined,_0x4f1e6f);if(_0x291715[_0xb552('0xa5')]!==-0x1){this[_0xb552('0xf')][_0xb552('0xaa')](util['format'](_0xb552('0x13c'),_0x2efb50));var _0x3b963a=this[_0xb552('0x92')][_0xb552('0x72')](this,_0x585f84,_0x2efb50);if(_0x3b963a){for(var _0x179ec1 in _0x3b963a){if(_0x3b963a[_0xb552('0x97')](_0x179ec1)){this[_0xb552('0xf')]['setVariable'](util['format'](_0xb552('0x13d'),_0x179ec1[_0xb552('0x6b')]()),_0x3b963a[_0x179ec1]);}}return this[_0xb552('0xf')]['noop'](util[_0xb552('0x56')]('TildeASR\x20Result\x20%s',JSON[_0xb552('0x76')](_0x3b963a)));}}return _0x291715;};AGIVertices[_0xb552('0x10')]['gotoc']=function(_0x2a31c0){logger[_0xb552('0x2c')](util[_0xb552('0x56')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2a31c0['label']));return this[_0xb552('0xf')]['continueAt'](_0x2a31c0[_0xb552('0x3c')],_0x2a31c0[_0xb552('0x3d')],_0x2a31c0[_0xb552('0x3e')]);};AGIVertices[_0xb552('0x10')][_0xb552('0x13e')]=function(_0x177abc){logger['info'](util[_0xb552('0x56')](_0xb552('0x13f'),_0x177abc['label']));if(!this['isConfigured'](_0x177abc[_0xb552('0x140')])){return this['channel'][_0xb552('0x2b')](_0x177abc,_0xb552('0x141'));}try{var _0x2b6780=eval(_0x177abc[_0xb552('0x140')])?_0xb552('0x142'):_0xb552('0x143');this[_0xb552('0xf')]['noop'](util[_0xb552('0x56')](_0xb552('0x144'),_0x177abc['condition'],_0x2b6780));return{'code':0xc8,'result':_0x2b6780};}catch(_0x498693){return{'code':0xc8,'result':_0xb552('0x143')};}};AGIVertices[_0xb552('0x10')][_0xb552('0x145')]=function(_0x1922cd){logger['info'](util[_0xb552('0x56')](_0xb552('0x146'),_0x1922cd[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x1922cd[_0xb552('0x147')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x1922cd,_0xb552('0x148'));}var _0x3bd991=this[_0xb552('0x149')][_0xb552('0x72')](this,_0x1922cd['interval_id']);if(!_0x3bd991){return this['channel'][_0xb552('0x2b')](_0x1922cd,_0xb552('0x14a'));}for(var _0x2e03fc=0x0;_0x2e03fc<_0x3bd991[_0xb552('0x9c')];_0x2e03fc+=0x1){var _0x30bb72=this[_0xb552('0xf')]['getVariable'](util[_0xb552('0x56')](_0xb552('0x14b'),_0x3bd991[_0x2e03fc]));if(_0x30bb72['result']===-0x1){return _0x30bb72;}logger[_0xb552('0x2c')](util['format'](_0xb552('0x14c'),_0x3bd991[_0x2e03fc],_0x30bb72[_0xb552('0xa6')]));if(_0x30bb72[_0xb552('0xa6')]==='true'){logger[_0xb552('0x2c')](util['format'](_0xb552('0x14c'),_0x3bd991[_0x2e03fc],_0xb552('0x142')));this[_0xb552('0xf')]['noop'](util[_0xb552('0x56')](_0xb552('0x14c'),_0x3bd991[_0x2e03fc],_0xb552('0x142')));return{'code':0xc8,'result':_0xb552('0x142')};}else{logger['info'](util[_0xb552('0x56')](_0xb552('0x14c'),_0x3bd991[_0x2e03fc],_0xb552('0x143')));this['channel'][_0xb552('0xaa')](util['format'](_0xb552('0x14c'),_0x3bd991[_0x2e03fc],_0xb552('0x143')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0xb552('0x14d')]=function(_0x50867b){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x14e'),_0x50867b[_0xb552('0x37')]));return this[_0xb552('0xf')][_0xb552('0x14d')]();};AGIVertices[_0xb552('0x10')][_0xb552('0x14f')]=function(_0x46eca3){logger['info'](util['format'](_0xb552('0x150'),_0x46eca3[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x46eca3[_0xb552('0x7d')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xe7'));}var _0x43d0d3=_0xb552('0x133');var _0x1ee4f2=util[_0xb552('0x56')](_0xb552('0x151'),FILES_PATH,rs['generate'](0x4));var _0xbbe273=util[_0xb552('0x56')](_0xb552('0x9f'),_0x1ee4f2,_0x43d0d3);var _0x452964=!![];if(_0x46eca3[_0xb552('0x134')]===_0xb552('0x135')){_0x452964=![];}var _0x376a29=this[_0xb552('0xf')][_0xb552('0x136')](_0x1ee4f2,_0x43d0d3,_0x46eca3[_0xb552('0x13b')],_0x46eca3['timeout'],undefined,_0x452964);if(_0x376a29[_0xb552('0xa5')]!==-0x1){this[_0xb552('0xf')][_0xb552('0xaa')](util['format']('ispeech\x20%s\x20file\x20created',_0xbbe273));var _0x537359=this[_0xb552('0x86')][_0xb552('0x72')](this,_0x46eca3,_0xbbe273);if(_0x537359){for(var _0x4e16df in _0x537359){if(_0x537359[_0xb552('0x97')](_0x4e16df)){this['channel'][_0xb552('0xa1')](util[_0xb552('0x56')]('ISPEECH_ASR_%s',_0x4e16df[_0xb552('0x6b')]()),_0x537359[_0x4e16df]);}}return this['channel']['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON[_0xb552('0x76')](_0x537359)));}}return _0x376a29;};AGIVertices[_0xb552('0x10')][_0xb552('0x152')]=function(_0x297c57){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x153'),_0x297c57[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x297c57[_0xb552('0x7d')])){return this[_0xb552('0xf')]['noop'](_0xb552('0xe7'));}if(!this[_0xb552('0x87')](_0x297c57['text'])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}this[_0xb552('0xf')][_0xb552('0xaa')](util['format'](_0xb552('0x154'),_0x297c57[_0xb552('0x5e')]));var _0x3c1917=this['ispeechTTS']['sync'](this,_0x297c57);if(_0x3c1917){this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x155'),_0x3c1917));var _0x45e898=this['channel']['streamFile'](_0x3c1917,_0x297c57['intKey']);try{fs['unlink'](_0x3c1917+_0xb552('0x126'));}catch(_0x1fa028){logger[_0xb552('0x2b')](_0x1fa028);}return _0x45e898;}return this[_0xb552('0xf')][_0xb552('0x2b')](_0x297c57,_0xb552('0x156'));};AGIVertices[_0xb552('0x10')][_0xb552('0x157')]=function(_0x20ca2b){logger[_0xb552('0x2c')](util['format'](_0xb552('0x158'),_0x20ca2b[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x20ca2b[_0xb552('0x159')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x20ca2b,_0xb552('0x15a'));}logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x15b'),this[_0xb552('0xf')]['callerid'],_0x20ca2b[_0xb552('0x159')]));var _0x56a497=this[_0xb552('0x54')][_0xb552('0x72')](this,_0x20ca2b[_0xb552('0x159')]);if(_0x56a497){logger[_0xb552('0x2c')](util[_0xb552('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb552('0xf')]['callerid'],_0x20ca2b[_0xb552('0x159')]));this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb552('0x39')],_0x20ca2b[_0xb552('0x159')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xb552('0x39')],_0x20ca2b[_0xb552('0x159')]));this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x15c'),this['channel'][_0xb552('0x39')],_0x20ca2b[_0xb552('0x159')]));return{'code':0xc8,'result':_0xb552('0x15d')};}};AGIVertices['prototype']['logout']=function(_0x5654e4){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x15e'),_0x5654e4[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x5654e4[_0xb552('0x159')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x5654e4,_0xb552('0x15a'));}logger[_0xb552('0x2c')](util[_0xb552('0x56')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb552('0xf')]['callerid'],_0x5654e4['findBy']));var _0x13f83c=this['agentLogout']['sync'](this,_0x5654e4[_0xb552('0x159')]);if(_0x13f83c){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x15f'),this['channel'][_0xb552('0x39')],_0x5654e4['findBy']));this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x15f'),this[_0xb552('0xf')][_0xb552('0x39')],_0x5654e4[_0xb552('0x159')]));return{'code':0xc8,'result':_0xb552('0x160')};}else{logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x15c'),this['channel'][_0xb552('0x39')],_0x5654e4['findBy']));this[_0xb552('0xf')]['noop'](util['format'](_0xb552('0x15c'),this[_0xb552('0xf')][_0xb552('0x39')],_0x5654e4[_0xb552('0x159')]));return{'code':0xc8,'result':_0xb552('0x15d')};}};AGIVertices[_0xb552('0x10')]['math']=function(_0x5a3b11){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5a3b11[_0xb552('0x37')]));if(!this['isConfigured'](_0x5a3b11[_0xb552('0x161')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x5a3b11,_0xb552('0x162'));}this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x163'),_0x5a3b11[_0xb552('0x161')]));var _0x78fd51=eval(_0x5a3b11[_0xb552('0x161')]);if(!this[_0xb552('0x87')](_0x5a3b11[_0xb552('0x116')])){return this[_0xb552('0xf')][_0xb552('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x37a517=this[_0xb552('0x11')]['sync'](this,_0x5a3b11[_0xb552('0x116')]);if(!_0x37a517){return this['channel']['error'](_0x5a3b11,_0xb552('0xd8'));}if(_[_0xb552('0xa0')](_0x78fd51)){var _0x5d64b1=this;_0x78fd51[_0xb552('0xd9')](function(_0x54d78c,_0x107081){_0x5d64b1[_0xb552('0xf')][_0xb552('0xa1')](util[_0xb552('0x56')](_0xb552('0x164'),_0x37a517,_0x107081),_0x54d78c);});return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x165'),_0x37a517));}else{return this[_0xb552('0xf')]['setVariable'](_0x37a517,_0x78fd51);}};AGIVertices[_0xb552('0x10')][_0xb552('0x166')]=function(_0x4902eb){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x167'),_0x4902eb['label']));if(_0x4902eb[_0xb552('0x112')]===0x0){return this[_0xb552('0xa7')](_0x4902eb);}_0x4902eb['retry']-=0x1;if(!this[_0xb552('0x87')](_0x4902eb[_0xb552('0x113')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x4902eb,_0xb552('0x114'));}var _0x438f1b=this['getSound'][_0xb552('0x72')](this,_0x4902eb[_0xb552('0x113')]);if(!_0x438f1b){return this[_0xb552('0xf')]['error'](_0x4902eb,_0xb552('0x115'));}var _0x1c1abc=this[_0xb552('0xf')][_0xb552('0x168')](_0x438f1b,_0x4902eb[_0xb552('0x117')],_0x4902eb[_0xb552('0x169')]);var _0x345e60=_0x1c1abc[_0xb552('0xa5')];if(_0x1c1abc[_0xb552('0xa5')]===-0x1){this[_0xb552('0x35')][_0xb552('0x72')](this,_0x4902eb,'-1');return _0x1c1abc;}else if(_0x1c1abc[_0xb552('0xa6')]==='timeout'){_0x1c1abc[_0xb552('0xa5')]=_0x1c1abc[_0xb552('0xa5')][_0xb552('0x9c')]>0x0?_0x1c1abc[_0xb552('0xa5')]:'t';}else if(_[_0xb552('0x43')](_0x1c1abc[_0xb552('0xa5')])){_0x1c1abc[_0xb552('0xa5')]='#';_0x345e60='#';}if(!this[_0xb552('0x87')](_0x4902eb[_0xb552('0x116')])){this['channel'][_0xb552('0xaa')](_0xb552('0xd7'));}else{var _0x31525e=this[_0xb552('0x11')]['sync'](this,_0x4902eb['variable_id']);if(!_0x31525e){return this[_0xb552('0xf')]['error'](_0x4902eb,_0xb552('0xd8'));}this[_0xb552('0xf')][_0xb552('0xa1')](_0x31525e,_0x345e60);}this['createSquareDetailsReport'][_0xb552('0x72')](this,_0x4902eb,_0x345e60);return _0x1c1abc;};AGIVertices[_0xb552('0x10')][_0xb552('0xaa')]=function(_0x30aeef){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x16a'),_0x30aeef[_0xb552('0x37')]));return this['channel'][_0xb552('0xaa')](_0x30aeef[_0xb552('0x16b')]||_0x30aeef['label']);};AGIVertices['prototype'][_0xb552('0x16c')]=function(_0x14e75f){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x16d'),_0x14e75f[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x14e75f[_0xb552('0x159')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x14e75f,_0xb552('0x15a'));}logger['info'](util[_0xb552('0x56')](_0xb552('0x15b'),this[_0xb552('0xf')][_0xb552('0x39')],_0x14e75f[_0xb552('0x159')]));var _0x3fd21e=this['getPause'][_0xb552('0x72')](this,_0x14e75f['pause_id']);var _0x51c76d=this[_0xb552('0x51')][_0xb552('0x72')](this,_0x14e75f[_0xb552('0x159')],_0x3fd21e);if(_0x51c76d){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x15f'),this[_0xb552('0xf')][_0xb552('0x39')],_0x14e75f[_0xb552('0x159')]));this[_0xb552('0xf')][_0xb552('0xaa')](util['format'](_0xb552('0x15f'),this[_0xb552('0xf')][_0xb552('0x39')],_0x14e75f[_0xb552('0x159')]));return{'code':0xc8,'result':_0xb552('0x160')};}else{logger[_0xb552('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb552('0xf')][_0xb552('0x39')],_0x14e75f['findBy']));this['channel']['noop'](util['format'](_0xb552('0x15f'),this['channel'][_0xb552('0x39')],_0x14e75f[_0xb552('0x159')]));return{'code':0xc8,'result':_0xb552('0x15d')};}};AGIVertices[_0xb552('0x10')]['playback']=function(_0x1c2a95){logger[_0xb552('0x2c')](util['format'](_0xb552('0x16e'),_0x1c2a95[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x1c2a95[_0xb552('0x113')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x1c2a95,_0xb552('0x114'));}var _0x2025be=this[_0xb552('0x1d')][_0xb552('0x72')](this,_0x1c2a95[_0xb552('0x113')]);if(!_0x2025be){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x1c2a95,_0xb552('0x115'));}var _0x3930e0=this[_0xb552('0xf')][_0xb552('0x58')](_0xb552('0x16f'),[_0x2025be,_0x1c2a95[_0xb552('0xe2')]]);if(_0x3930e0[_0xb552('0xa5')]===-0x1){return _0x3930e0;}return this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xc0'),_0xb552('0x16f'),_0x2025be));};AGIVertices[_0xb552('0x10')][_0xb552('0x170')]=function(_0x373ddb){logger[_0xb552('0x2c')](util['format'](_0xb552('0x171'),_0x373ddb[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x373ddb['queue_id'])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x373ddb,_0xb552('0x172'));}var _0x392d55='';var _0x309a0b=parseInt(_0x373ddb[_0xb552('0x173')],0xa);if(isNaN(_0x309a0b)){_0x392d55=_0x373ddb['queue_id'];}else{_0x392d55=this[_0xb552('0x16')][_0xb552('0x72')](this,_0x373ddb[_0xb552('0x173')]);if(!_0x392d55){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x373ddb,'no\x20queue\x20found');}}var _0xb49762='';if(this[_0xb552('0x87')](_0x373ddb[_0xb552('0x113')])){var _0x15ca77=this['getSound'][_0xb552('0x72')](this,_0x373ddb['file_id']);if(_0x15ca77){_0xb49762=_0x15ca77;}}this[_0xb552('0x35')]['sync'](this,_0x373ddb,_0x392d55);if(_0x373ddb[_0xb552('0xe2')][_0xb552('0x174')]('x')<0x0){_0x373ddb[_0xb552('0xe2')]+='x';}if(_0x373ddb[_0xb552('0xe2')]['indexOf']('X')<0x0){_0x373ddb['opts']+='X';}this[_0xb552('0xf')][_0xb552('0xa1')](_0xb552('0x175'),_0x392d55?_0x392d55['toLowerCase']():'');var _0x35d602=this['channel']['exec'](_0xb552('0x176'),[_0x392d55,_0x373ddb['opts'],_0x373ddb[_0xb552('0x65')],_0xb49762,_0x373ddb[_0xb552('0x68')],_0x373ddb[_0xb552('0x9')],_0x373ddb[_0xb552('0x177')],_0x373ddb['gosub'],'',_0x373ddb[_0xb552('0x178')]]);if(_0x35d602['result']===-0x1){return _0x35d602;}return this['channel']['noop'](util['format'](_0xb552('0xc0'),_0xb552('0x176'),_0x392d55));};AGIVertices[_0xb552('0x10')]['record']=function(_0xe7bc50){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x179'),_0xe7bc50['label']));var _0x1a41e3=_0xe7bc50[_0xb552('0x17a')]||_0xb552('0x133');var _0x289731=util['format'](_0xb552('0x17b'),this[_0xb552('0xf')]['uniqueid'],rs[_0xb552('0x11b')](0x5));var _0x3c7991=util[_0xb552('0x56')](_0xb552('0x17c'),FILES_PATH,_0x289731,_0x1a41e3);var _0x5ccb01=util['format'](_0xb552('0x151'),FILES_PATH,_0x289731);this[_0xb552('0x3a')][_0xb552('0x72')](this,_0xe7bc50,_0x289731,_0x3c7991);this[_0xb552('0xf')]['setVariable'](_0xb552('0x17d'),_0x289731);logger['info'](_0xb552('0x17e'),_0x5ccb01,_0x1a41e3,_0xe7bc50[_0xb552('0x17f')],_0xe7bc50[_0xb552('0x68')]);return this['channel'][_0xb552('0x136')](_0x5ccb01,_0x1a41e3,_0xe7bc50[_0xb552('0x17f')],_0xe7bc50[_0xb552('0x68')],undefined,!![]);};AGIVertices[_0xb552('0x10')][_0xb552('0x180')]=function(_0x46b1c1){logger['info'](util[_0xb552('0x56')](_0xb552('0x181'),_0x46b1c1['label']));if(!this[_0xb552('0x87')](_0x46b1c1[_0xb552('0x65')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x182'));}var _0x3328c1=this[_0xb552('0x64')]['sync'](this,_0x46b1c1);logger[_0xb552('0x2c')](util['format'](_0xb552('0x183'),util['inspect'](_0x3328c1,{'showHidden':![],'depth':null})));if(!this[_0xb552('0x87')](_0x46b1c1[_0xb552('0x116')])){return this['channel']['noop'](_0xb552('0x184'));}var _0x554ffa=this[_0xb552('0x11')]['sync'](this,_0x46b1c1[_0xb552('0x116')]);if(!_0x554ffa){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x46b1c1,'no\x20variable\x20found');}this[_0xb552('0xf')][_0xb552('0xa1')](util['format'](_0xb552('0x185'),_0x554ffa),_0x3328c1[_0xb552('0x78')]?_0x3328c1[_0xb552('0x78')]:_0xb552('0x186'));this[_0xb552('0xf')]['setVariable'](util['format'](_0xb552('0x187'),_0x554ffa),_0x3328c1[_0xb552('0x79')]?_0x3328c1['statusMessage']:'OK');if(_0x3328c1['body']){try{this[_0xb552('0x9e')](_0x3328c1[_0xb552('0x6c')],_0x554ffa);}catch(_0x2923e3){logger[_0xb552('0x2b')](util[_0xb552('0x56')](_0xb552('0x188'),_0x554ffa));}}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xdb'),_0x554ffa));};AGIVertices[_0xb552('0x10')][_0xb552('0x189')]=function(_0x5ca3e4){logger['info'](util[_0xb552('0x56')](_0xb552('0x18a'),_0x5ca3e4[_0xb552('0x37')]));return this['channel']['sayDigits'](_0x5ca3e4['digits'][_0xb552('0x5a')](/\s+/g,''),_0x5ca3e4[_0xb552('0x17f')]);};AGIVertices[_0xb552('0x10')][_0xb552('0x18b')]=function(_0x2150d8){logger[_0xb552('0x2c')](util[_0xb552('0x56')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2150d8[_0xb552('0x37')]));return this[_0xb552('0xf')][_0xb552('0x18c')](_0x2150d8['number'][_0xb552('0x5a')](/\s+/g,''),_0x2150d8[_0xb552('0x17f')]);};AGIVertices[_0xb552('0x10')][_0xb552('0x18d')]=function(_0x3af9c2){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x18e'),_0x3af9c2[_0xb552('0x37')]));return this['channel']['sayPhonetic'](_0x3af9c2[_0xb552('0x5e')],_0x3af9c2[_0xb552('0x17f')]);};AGIVertices['prototype']['sendMail']=function(_0x20965f){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x18f'),_0x20965f[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x20965f[_0xb552('0x190')])){return this['channel'][_0xb552('0xaa')](_0xb552('0x191'));}var _0x48c773=this[_0xb552('0x192')][_0xb552('0x72')](this,_0x20965f[_0xb552('0x190')]);if(!_0x48c773||!_0x48c773['Smtp']){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x20965f,'no\x20mail\x20account\x20found');}var _0xfd662f={'from':util[_0xb552('0x56')](_0xb552('0x193'),_0x48c773[_0xb552('0x14')],_0x48c773[_0xb552('0x194')]||_0x48c773[_0xb552('0x195')]['user']),'to':_0x20965f['to']||'','cc':_0x20965f['cc']||'','bcc':_0x20965f[_0xb552('0x196')]||'','subject':_0x20965f[_0xb552('0x197')],'html':_0x20965f['text'],'text':_0x20965f[_0xb552('0x5e')]};var _0x20a724={'tls':{'rejectUnauthorized':![]}};if(_0x48c773['Smtp'][_0xb552('0x198')]){_0x20a724[_0xb552('0x198')]=_0x48c773[_0xb552('0x195')][_0xb552('0x198')];}else{_0x20a724['host']=_0x48c773[_0xb552('0x195')]['host'];_0x20a724[_0xb552('0x199')]=_0x48c773['Smtp'][_0xb552('0x199')];_0x20a724[_0xb552('0x19a')]=_0x48c773[_0xb552('0x195')]['secure'];}if(_0x48c773[_0xb552('0x195')][_0xb552('0x19b')]){_0x20a724[_0xb552('0x19c')]={'user':_0x48c773[_0xb552('0x195')][_0xb552('0x19d')],'pass':_0x48c773['Smtp'][_0xb552('0x19e')]};}if(this[_0xb552('0x87')](_0x20965f[_0xb552('0x19f')])){}logger['debug'](_0xb552('0x1a0'),JSON[_0xb552('0x76')](_0xfd662f));this[_0xb552('0x35')][_0xb552('0x72')](this,_0x20965f,_0x20965f['account_id']);this['channel'][_0xb552('0xaa')](util['format'](_0xb552('0x1a1'),_0x48c773[_0xb552('0x14')]));this[_0xb552('0x22')][_0xb552('0x72')](this,_0x20a724,_0xfd662f);return this['channel']['noop'](_0xb552('0x1a2'));};AGIVertices[_0xb552('0x10')][_0xb552('0x1a3')]=function(_0x4af6c1){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x1a4'),_0x4af6c1[_0xb552('0x37')]));return this[_0xb552('0xf')]['noop'](_0xb552('0x1a5'));};AGIVertices[_0xb552('0x10')][_0xb552('0x1a6')]=function(_0x4dbfef){logger['info'](util[_0xb552('0x56')](_0xb552('0x1a7'),_0x4dbfef[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x4dbfef[_0xb552('0x1a8')])){return this['channel']['noop'](_0xb552('0x1a9'));}var _0x1e16a2=this[_0xb552('0x32')][_0xb552('0x72')](this,_0x4dbfef[_0xb552('0x1a8')]);if(!_0x1e16a2){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x4dbfef,_0xb552('0x1aa'));}var _0x18e0af={'body':_0x4dbfef[_0xb552('0x1ab')],'phone':_0x4dbfef['to']||'','SmsAccountId':_0x1e16a2['id']};logger[_0xb552('0xdc')]('sendSMS\x20message',JSON[_0xb552('0x76')](_0x18e0af));this[_0xb552('0x35')][_0xb552('0x72')](this,_0x4dbfef,_0x4dbfef['sms_account_id']);this[_0xb552('0xf')]['noop'](util[_0xb552('0x56')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1e16a2['name']));this[_0xb552('0x34')][_0xb552('0x72')](this,_0x18e0af);return this[_0xb552('0xf')]['noop'](_0xb552('0x1ac'));};AGIVertices[_0xb552('0x10')]['set']=function(_0x53bc56){logger[_0xb552('0x2c')](util[_0xb552('0x56')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x53bc56['label']));if(!this[_0xb552('0x87')](_0x53bc56[_0xb552('0x116')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x53bc56,_0xb552('0x1ad'));}var _0x2746c9=this[_0xb552('0x11')][_0xb552('0x72')](this,_0x53bc56[_0xb552('0x116')]);if(!_0x2746c9){return this['channel'][_0xb552('0x2b')](_0x53bc56,_0xb552('0xd8'));}return this['channel'][_0xb552('0xa1')](_0x2746c9,_0x53bc56[_0xb552('0x1ae')]);};AGIVertices[_0xb552('0x10')][_0xb552('0x1af')]=function(_0x1a8792){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x1b0'),_0x1a8792['label']));this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x1b1'));if(_0x1a8792[_0xb552('0xb8')]==='yes'){this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x1b2'));return this['channel'][_0xb552('0xb8')]();}return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0x1b3'));};AGIVertices[_0xb552('0x10')][_0xb552('0x1b4')]=function(_0x4e55e5){logger['info'](util[_0xb552('0x56')](_0xb552('0x1b5'),_0x4e55e5[_0xb552('0x37')]));if(!this[_0xb552('0x87')](_0x4e55e5[_0xb552('0x1b6')])){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x4e55e5,_0xb552('0x1b7'));}var _0x3cce72=this[_0xb552('0x19')][_0xb552('0x72')](this,_0x4e55e5[_0xb552('0x1b6')]);if(!this[_0xb552('0x87')](_0x3cce72)){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x4e55e5,util[_0xb552('0x56')](_0xb552('0x1b8'),_0x4e55e5[_0xb552('0x1b6')]));}if(_0x3cce72===this[_0xb552('0xf')][_0xb552('0x38')]){return this['channel'][_0xb552('0x2b')](_0x4e55e5,_0xb552('0x1b9'));}this['createSquareDetailsReport'][_0xb552('0x72')](this,_0x4e55e5,_0x3cce72);var _0x58b2e6=this[_0xb552('0xf')]['exec'](_0xb552('0x1ba'),util[_0xb552('0x56')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xb552('0x9')][_0xb552('0x1bb')]||_0xb552('0x1bc'),_0x3cce72,this[_0xb552('0xf')][_0xb552('0x38')]));if(_0x58b2e6[_0xb552('0xa5')]===-0x1){return _0x58b2e6;}return this[_0xb552('0xf')][_0xb552('0xaa')](util['format']('Executed\x20command\x20%s\x20%s',_0xb552('0x1ba'),_0x3cce72));};AGIVertices['prototype'][_0xb552('0x1bd')]=function(_0x433f61){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x1be'),_0x433f61[_0xb552('0x37')]));var _0x542e3f=this[_0xb552('0x1bf')][_0xb552('0x72')](this,_0x433f61[_0xb552('0xb6')]);this[_0xb552('0x35')][_0xb552('0x72')](this,_0x433f61,_0x433f61[_0xb552('0xb6')]);if(this[_0xb552('0x87')](_0x433f61['variable_id'])){var _0x344e36=this[_0xb552('0x11')][_0xb552('0x72')](this,_0x433f61[_0xb552('0x116')]);if(_0x344e36){this[_0xb552('0xf')][_0xb552('0xa1')](_0x344e36,_0x542e3f);return this['channel']['noop'](util[_0xb552('0x56')](_0xb552('0x1c0'),_0x433f61['command'],_0x344e36));}}return this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x1c1'),_0x433f61[_0xb552('0xb6')]));};AGIVertices['prototype'][_0xb552('0x1c2')]=function(_0x4d3da4){logger['info'](util['format'](_0xb552('0x1c3'),_0x4d3da4[_0xb552('0x37')]));_0x4d3da4[_0xb552('0x5e')]=_0x4d3da4['text'][_0xb552('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb552('0x87')](_0x4d3da4[_0xb552('0x5c')])){return this[_0xb552('0xf')]['noop'](_0xb552('0x1c4'));}if(!this[_0xb552('0x87')](_0x4d3da4[_0xb552('0x5e')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x1c5'),_0x4d3da4[_0xb552('0x5e')]));var _0x1c3097=this[_0xb552('0x5b')]['sync'](this,_0x4d3da4);if(_0x1c3097){this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x1c3097));var _0x271ee4=this[_0xb552('0xf')][_0xb552('0x102')](_0x1c3097);try{fs[_0xb552('0x103')](_0x1c3097+_0xb552('0x126'));}catch(_0x39264c){logger[_0xb552('0x2b')](_0x39264c);}return _0x271ee4;}return this[_0xb552('0xf')][_0xb552('0x2b')](_0x4d3da4,_0xb552('0x1c6'));};AGIVertices[_0xb552('0x10')][_0xb552('0x1c7')]=function(_0x26a158){logger[_0xb552('0x2c')](util[_0xb552('0x56')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x26a158[_0xb552('0x37')]));_0x26a158[_0xb552('0x5e')]=_0x26a158[_0xb552('0x5e')][_0xb552('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x26a158[_0xb552('0x5e')])){return this[_0xb552('0xf')][_0xb552('0xaa')](_0xb552('0xab'));}this[_0xb552('0xf')]['noop'](util[_0xb552('0x56')](_0xb552('0x1c8'),_0x26a158[_0xb552('0x5e')]));var _0x4f6759=this[_0xb552('0x63')][_0xb552('0x72')](this,_0x26a158);if(_0x4f6759){this['channel']['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x4f6759));var _0x187936=this['channel'][_0xb552('0x102')](_0x4f6759);try{fs['unlink'](_0x4f6759+_0xb552('0x126'));}catch(_0x54ba17){logger[_0xb552('0x2b')](_0x54ba17);}return _0x187936;}return this[_0xb552('0xf')][_0xb552('0x2b')](_0x26a158,_0xb552('0x1c9'));};AGIVertices[_0xb552('0x10')][_0xb552('0x1ca')]=function(_0x3d2d52){logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x1cb'),_0x3d2d52[_0xb552('0x37')]));if(!this['isConfigured'](_0x3d2d52[_0xb552('0x159')])){return this['channel'][_0xb552('0x2b')](_0x3d2d52,_0xb552('0x15a'));}logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x15b'),this['channel'][_0xb552('0x39')],_0x3d2d52[_0xb552('0x159')]));var _0x4867eb=this[_0xb552('0x1cc')][_0xb552('0x72')](this,_0x3d2d52[_0xb552('0x159')]);if(_0x4867eb){logger['info'](util[_0xb552('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb552('0x39')],_0x3d2d52[_0xb552('0x159')]));this[_0xb552('0xf')][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0x15f'),this['channel'][_0xb552('0x39')],_0x3d2d52[_0xb552('0x159')]));return{'code':0xc8,'result':_0xb552('0x160')};}else{logger[_0xb552('0x2c')](util[_0xb552('0x56')](_0xb552('0x15c'),this[_0xb552('0xf')][_0xb552('0x39')],_0x3d2d52[_0xb552('0x159')]));this['channel']['noop'](util[_0xb552('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb552('0xf')][_0xb552('0x39')],_0x3d2d52[_0xb552('0x159')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xb552('0x10')][_0xb552('0x1cd')]=function(_0xb0b075){logger[_0xb552('0x2c')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0xb0b075[_0xb552('0x37')]));var _0x18047b=this[_0xb552('0xf')]['exec']('VOICEMAIL',[_0xb0b075[_0xb552('0x1ce')],_0xb0b075[_0xb552('0x7b')]]);if(_0x18047b[_0xb552('0xa5')]===-0x1){return _0x18047b;}return this['channel'][_0xb552('0xaa')](util[_0xb552('0x56')](_0xb552('0xc0'),_0xb552('0x1cf'),_0xb0b075[_0xb552('0x1ce')]));};AGIVertices[_0xb552('0x10')][_0xb552('0x1d0')]=function(_0x4d8f04){logger[_0xb552('0x2c')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4d8f04['label']));if(!this[_0xb552('0x87')](_0x4d8f04[_0xb552('0x116')])){return this['channel'][_0xb552('0x2b')](_0x4d8f04,_0xb552('0x1ad'));}var _0x4647d8=this[_0xb552('0x11')][_0xb552('0x72')](this,_0x4d8f04[_0xb552('0x116')]);if(!_0x4647d8){return this[_0xb552('0xf')][_0xb552('0x2b')](_0x4d8f04,'no\x20variable\x20found');}var _0x1c91a2=this[_0xb552('0xf')][_0xb552('0x11')](_0x4647d8);return{'code':0xc8,'result':_0x1c91a2[_0xb552('0xa6')]?_0x1c91a2[_0xb552('0xa6')]:'-'};};String['prototype'][_0xb552('0xa3')]=function(_0x140477,_0x991f07){return this['split'](_0x140477)['join'](_0x991f07);};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 6c38a40..1e748c4 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 _0x661a=['savePause','timers','acwTimeout','timer','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','prototype','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','syncAgentConnectPreview','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','milliseconds','diff','startAcw','interface','mandatoryDisposition','mandatoryDispositionPause','name','Action','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid'];(function(_0x468581,_0x372887){var _0x653976=function(_0x112dde){while(--_0x112dde){_0x468581['push'](_0x468581['shift']());}};_0x653976(++_0x372887);}(_0x661a,0x85));var _0xa661=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x661a[_0x40220a];return _0x3903cc;};'use strict';var util=require(_0xa661('0x0'));var _=require(_0xa661('0x1'));var moment=require(_0xa661('0x2'));var ami=require(_0xa661('0x3'));var logger=require(_0xa661('0x4'))(_0xa661('0x5'));var RpcUser=require(_0xa661('0x6'));var RpcVoiceAgentReport=require(_0xa661('0x7'));function Acw(_0x28b74b){this[_0xa661('0x8')]=_0x28b74b[_0xa661('0x8')];this[_0xa661('0x9')]=_0x28b74b[_0xa661('0x9')];this['timers']=_0x28b74b['timers'];this[_0xa661('0xa')]={};ami['on'](_0xa661('0xb'),this['syncAgentConnect']['bind'](this));ami['on'](_0xa661('0xc'),this[_0xa661('0xd')][_0xa661('0xe')](this));ami['on'](_0xa661('0xf'),this[_0xa661('0x10')]['bind'](this));ami['on'](_0xa661('0x11'),this[_0xa661('0x12')][_0xa661('0xe')](this));ami['on'](_0xa661('0x13'),this[_0xa661('0x14')][_0xa661('0xe')](this));ami['on'](_0xa661('0x15'),this['syncBlindTransfer'][_0xa661('0xe')](this));ami['on'](_0xa661('0x16'),this['syncAgentConnectPreview'][_0xa661('0xe')](this));}function getDiff(_0x258bc4){var _0x4d3d56=moment()[_0xa661('0x17')](0x0);var _0x428ee2=moment(_0x258bc4)[_0xa661('0x17')](0x0);return _0x4d3d56[_0xa661('0x18')](_0x428ee2,'seconds');}Acw['prototype'][_0xa661('0x19')]=function(_0x522d56){try{var _0x5c4538=this;var _0x353b4d=this['channels'][_0x522d56][_0xa661('0x1a')];var _0x1df5f5=this[_0xa661('0xa')][_0x522d56]['queue'];var _0x27eb47=this[_0xa661('0x8')][_0x1df5f5];var _0x5db7b2=![];var _0x5df3f0='ACW';if(_0x27eb47[_0xa661('0x1b')]){if(_0x27eb47[_0xa661('0x1c')][_0xa661('0x1d')]){_0x5db7b2=!![];_0x5df3f0=_0x27eb47[_0xa661('0x1c')]['name'];}}ami[_0xa661('0x1e')]({'action':'QueuePause','interface':_0x353b4d,'paused':!![],'reason':_0x5df3f0})['then'](function(_0xb418d0){if(_0x5c4538[_0xa661('0x9')][_0x353b4d]){return RpcUser[_0xa661('0x1f')](_0x5c4538[_0xa661('0x9')][_0x353b4d]['id'])[_0xa661('0x20')](function(_0x12c2eb){if(_0x12c2eb&&!_0x12c2eb['voicePause']){logger[_0xa661('0x21')](_0xa661('0x22'),_0x522d56,_0x353b4d,_0x1df5f5);var _0x349e0e=_0x5c4538[_0xa661('0xa')][_0x522d56][_0xa661('0x23')]&&_0x5c4538['channels'][_0x522d56][_0xa661('0x24')]?_0x5c4538[_0xa661('0xa')][_0x522d56][_0xa661('0x24')]:_0x522d56;return RpcUser[_0xa661('0x25')](_0x5c4538[_0xa661('0x9')][_0x353b4d],_0x5df3f0,_0x349e0e)[_0xa661('0x20')](function(_0xac220e){if(!_0x5db7b2){_0x5c4538[_0xa661('0x26')][_0x353b4d]={};logger[_0xa661('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x522d56,_0x5c4538[_0xa661('0x8')][_0x1df5f5][_0xa661('0x27')],_0x353b4d,_0x1df5f5);_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x28')]=setTimeout(_0x5c4538['stopAcw'][_0xa661('0xe')](_0x5c4538,_0x353b4d),_0x5c4538['voiceQueues'][_0x1df5f5][_0xa661('0x27')]*0x3e8);_0x5c4538[_0xa661('0x26')][_0x353b4d]['lastPauseAt']=moment()[_0xa661('0x29')](_0xa661('0x2a'));_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2b')]=_0x522d56;_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2c')]=_0x1df5f5;_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2d')]=function(){var _0x2c6413=getDiff(_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2e')]);clearTimeout(_0x5c4538[_0xa661('0x26')][_0x353b4d]['timer']);_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2c6413},_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2b')],_0x353b4d)['then'](function(_0x4889d7){logger[_0xa661('0x21')](_0xa661('0x2f'),_0x522d56,_0x2c6413,_0x4889d7);})[_0xa661('0x30')](function(_0x586914){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x522d56,_0x586914);});delete _0x5c4538[_0xa661('0x26')][_0x353b4d];};}});}else{logger[_0xa661('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x522d56,_0x353b4d,_0x1df5f5);}});}})[_0xa661('0x30')](function(_0x2cba8a){logger[_0xa661('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x522d56,_0x5c4538[_0xa661('0x8')][_0x1df5f5][_0xa661('0x27')],_0x353b4d,_0x1df5f5);})[_0xa661('0x32')](function(){delete _0x5c4538[_0xa661('0xa')][_0x522d56];});}catch(_0x17f017){logger[_0xa661('0x31')](_0xa661('0x33'),_0x17f017[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0x36')]=function(_0x241026){try{var _0x50e9db=this;if(_0x50e9db[_0xa661('0x26')][_0x241026]){_0x50e9db[_0xa661('0x26')][_0x241026][_0xa661('0x28')]=![];var _0x3656fd=_0x50e9db[_0xa661('0x26')][_0x241026][_0xa661('0x2b')];var _0x2707bb=_0x50e9db['timers'][_0x241026][_0xa661('0x2c')];var _0xd5733=_0x50e9db[_0xa661('0x8')][_0x2707bb][_0xa661('0x27')];logger[_0xa661('0x21')](_0xa661('0x37'),_0x3656fd,_0x241026);RpcUser[_0xa661('0x38')](this['agents'][_0x241026]);RpcVoiceAgentReport[_0xa661('0x39')]({'acwtime':_0xd5733,'agentacw':!![]},_0x3656fd,_0x241026)[_0xa661('0x20')](function(_0x2d0cf8){logger[_0xa661('0x21')](_0xa661('0x2f'),_0x3656fd,_0xd5733,_0x2d0cf8);})['catch'](function(_0x2adabb){logger[_0xa661('0x31')](_0xa661('0x3a'),_0x3656fd,_0x2adabb);});}else{logger[_0xa661('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x241026);if(_0x50e9db['timers']){logger[_0xa661('0x21')](_0xa661('0x3b'),JSON[_0xa661('0x3c')](_0x50e9db[_0xa661('0x26')]));}}}catch(_0x275841){logger[_0xa661('0x31')](_0xa661('0x3d'),_0x275841[_0xa661('0x34')]);}};Acw['prototype'][_0xa661('0x3e')]=function(_0x27d2a4){try{if(this['voiceQueues'][_0x27d2a4[_0xa661('0x2c')]]&&(this[_0xa661('0x8')][_0x27d2a4[_0xa661('0x2c')]][_0xa661('0x5')]||this[_0xa661('0x8')][_0x27d2a4[_0xa661('0x2c')]]['mandatoryDisposition'])){if(this[_0xa661('0x9')][_0x27d2a4[_0xa661('0x1a')]]){this[_0xa661('0xa')][_0x27d2a4[_0xa661('0x2b')]]={'queue':_0x27d2a4[_0xa661('0x2c')],'interface':_0x27d2a4['interface'],'destlinkedid':_0x27d2a4[_0xa661('0x24')]};}}}catch(_0x140bea){logger[_0xa661('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x140bea[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0x3f')]=function(_0x4b64f3){try{if(this[_0xa661('0x8')][_0x4b64f3[_0xa661('0x2c')]]&&(this[_0xa661('0x8')][_0x4b64f3[_0xa661('0x2c')]]['acw']||this[_0xa661('0x8')][_0x4b64f3[_0xa661('0x2c')]][_0xa661('0x1b')])){if(this[_0xa661('0x9')][_0x4b64f3[_0xa661('0x1a')]]){this[_0xa661('0xa')][_0x4b64f3[_0xa661('0x2b')]]={'queue':_0x4b64f3['queue'],'interface':_0x4b64f3['interface']};}}}catch(_0x2b8fd1){logger[_0xa661('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2b8fd1[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0xd')]=function(_0x456b74){try{if(this['channels'][_0x456b74[_0xa661('0x2b')]]&&_['isUndefined'](this[_0xa661('0xa')][_0x456b74[_0xa661('0x2b')]][_0xa661('0x23')])){logger[_0xa661('0x21')](_0xa661('0x40'),_0x456b74[_0xa661('0x2b')]);this[_0xa661('0x19')](_0x456b74[_0xa661('0x2b')]);}else if(this[_0xa661('0xa')][_0x456b74[_0xa661('0x41')]]&&_['isUndefined'](this[_0xa661('0xa')][_0x456b74[_0xa661('0x41')]][_0xa661('0x23')])){logger[_0xa661('0x21')](_0xa661('0x42'),_0x456b74[_0xa661('0x41')]);this[_0xa661('0x19')](_0x456b74[_0xa661('0x41')]);}}catch(_0x89f130){logger[_0xa661('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x89f130[_0xa661('0x34')]);}};Acw[_0xa661('0x35')]['syncHangup']=function(_0x3caa73){try{if(this[_0xa661('0xa')][_0x3caa73['uniqueid']]&&this[_0xa661('0xa')][_0x3caa73[_0xa661('0x2b')]]['attended']){logger[_0xa661('0x21')](_0xa661('0x43'),_0x3caa73['uniqueid']);this[_0xa661('0x19')](_0x3caa73[_0xa661('0x2b')]);}else if(this[_0xa661('0xa')][_0x3caa73['linkedid']]&&this[_0xa661('0xa')][_0x3caa73[_0xa661('0x41')]][_0xa661('0x23')]){logger[_0xa661('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3caa73[_0xa661('0x41')]);this[_0xa661('0x19')](_0x3caa73[_0xa661('0x41')]);}}catch(_0x47e868){logger[_0xa661('0x31')]('[ACW][syncHangup]\x20%s',_0x47e868[_0xa661('0x34')]);}};Acw['prototype'][_0xa661('0x14')]=function(_0x3b18eb){try{if(!_['isNil'](this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x44')]])){this['startAcw'](_0x3b18eb[_0xa661('0x44')]);if(this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x45')]]){this[_0xa661('0xa')][_0x3b18eb['secondtransfereruniqueid']][_0xa661('0x23')]=!![];this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x46')]]=this[_0xa661('0xa')][_0x3b18eb['secondtransfereruniqueid']];delete this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x45')]];}}else if(!_[_0xa661('0x47')](this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x46')]])){this['startAcw'](_0x3b18eb[_0xa661('0x46')]);if(this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x48')]]){this['channels'][_0x3b18eb[_0xa661('0x48')]][_0xa661('0x23')]=!![];this['channels'][_0x3b18eb[_0xa661('0x44')]]=this['channels'][_0x3b18eb[_0xa661('0x48')]];delete this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x48')]];}}}catch(_0x4a891a){logger[_0xa661('0x31')](_0xa661('0x49'),_0x4a891a[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0x4a')]=function(_0x4b15a7){try{if(this[_0xa661('0xa')][_0x4b15a7[_0xa661('0x4b')]]){logger[_0xa661('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xa661('0x3c')](_0x4b15a7[_0xa661('0x4b')]));this[_0xa661('0x19')](_0x4b15a7[_0xa661('0x4b')]);}else if(this[_0xa661('0xa')][_0x4b15a7[_0xa661('0x4c')]]){logger[_0xa661('0x21')](_0xa661('0x4d'),JSON[_0xa661('0x3c')](_0x4b15a7[_0xa661('0x4c')]));this[_0xa661('0x19')](_0x4b15a7[_0xa661('0x4c')]);}}catch(_0x40b0a6){logger['error'](_0xa661('0x4e'),_0x40b0a6[_0xa661('0x34')]);}};Acw[_0xa661('0x35')]['syncAgentRingNoAnswer']=function(_0x363fe6){try{if(this[_0xa661('0x8')][_0x363fe6['queue']]&&this[_0xa661('0x8')][_0x363fe6[_0xa661('0x2c')]][_0xa661('0x4f')]===_0xa661('0x50')){if(this[_0xa661('0x9')][_0x363fe6[_0xa661('0x1a')]]){logger[_0xa661('0x21')](_0xa661('0x51'),_0x363fe6[_0xa661('0x2b')],_0x363fe6[_0xa661('0x1a')],_0x363fe6['queue']);return RpcUser['savePause'](this['agents'][_0x363fe6[_0xa661('0x1a')]],_0xa661('0x52'),_0x363fe6[_0xa661('0x2b')]);}}}catch(_0x52e72a){logger['error'](_0xa661('0x53'),_0x52e72a[_0xa661('0x34')]);}};module[_0xa661('0x54')]=Acw; \ No newline at end of file +var _0x4c44=['[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','queue','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','stringify','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','syncHangup','bind','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','updateAcw','timer','uniqueid','[%s][UPDATE][ACWTIME:%s]','error'];(function(_0x3511f5,_0x5c5449){var _0x4e0e66=function(_0x57512b){while(--_0x57512b){_0x3511f5['push'](_0x3511f5['shift']());}};_0x4e0e66(++_0x5c5449);}(_0x4c44,0x125));var _0x44c4=function(_0x2ed345,_0x59c3c2){_0x2ed345=_0x2ed345-0x0;var _0x1e812c=_0x4c44[_0x2ed345];return _0x1e812c;};'use strict';var util=require(_0x44c4('0x0'));var _=require(_0x44c4('0x1'));var moment=require(_0x44c4('0x2'));var ami=require(_0x44c4('0x3'));var logger=require(_0x44c4('0x4'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x44c4('0x5'));function Acw(_0x4bc875){this['voiceQueues']=_0x4bc875[_0x44c4('0x6')];this[_0x44c4('0x7')]=_0x4bc875['agents'];this[_0x44c4('0x8')]=_0x4bc875['timers'];this[_0x44c4('0x9')]={};ami['on'](_0x44c4('0xa'),this[_0x44c4('0xb')]['bind'](this));ami['on'](_0x44c4('0xc'),this[_0x44c4('0xd')]['bind'](this));ami['on']('hangup',this[_0x44c4('0xe')][_0x44c4('0xf')](this));ami['on'](_0x44c4('0x10'),this[_0x44c4('0x11')][_0x44c4('0xf')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x44c4('0xf')](this));ami['on'](_0x44c4('0x12'),this[_0x44c4('0x13')][_0x44c4('0xf')](this));ami['on']('custom:agentConnectPreview',this[_0x44c4('0x14')][_0x44c4('0xf')](this));}function getDiff(_0x1fc624){var _0x1ba59d=moment()[_0x44c4('0x15')](0x0);var _0x2d4a74=moment(_0x1fc624)[_0x44c4('0x15')](0x0);return _0x1ba59d['diff'](_0x2d4a74,_0x44c4('0x16'));}Acw[_0x44c4('0x17')][_0x44c4('0x18')]=function(_0x519a58){try{var _0x341b11=this;var _0x34e4c9=this[_0x44c4('0x9')][_0x519a58][_0x44c4('0x19')];var _0x1c37d0=this[_0x44c4('0x9')][_0x519a58]['queue'];var _0x4aad5a=this[_0x44c4('0x6')][_0x1c37d0];var _0x9eec45=![];var _0x536f1e=_0x44c4('0x1a');if(_0x4aad5a['mandatoryDisposition']){if(_0x4aad5a[_0x44c4('0x1b')][_0x44c4('0x1c')]){_0x9eec45=!![];_0x536f1e=_0x4aad5a[_0x44c4('0x1b')][_0x44c4('0x1c')];}}ami[_0x44c4('0x1d')]({'action':_0x44c4('0x1e'),'interface':_0x34e4c9,'paused':!![],'reason':_0x536f1e})[_0x44c4('0x1f')](function(_0x1ae321){if(_0x341b11[_0x44c4('0x7')][_0x34e4c9]){return RpcUser[_0x44c4('0x20')](_0x341b11[_0x44c4('0x7')][_0x34e4c9]['id'])['then'](function(_0x387653){if(_0x387653&&!_0x387653[_0x44c4('0x21')]){logger['info'](_0x44c4('0x22'),_0x519a58,_0x34e4c9,_0x1c37d0);var _0x1de504=_0x341b11[_0x44c4('0x9')][_0x519a58][_0x44c4('0x23')]&&_0x341b11[_0x44c4('0x9')][_0x519a58][_0x44c4('0x24')]?_0x341b11[_0x44c4('0x9')][_0x519a58][_0x44c4('0x24')]:_0x519a58;return RpcUser['savePause'](_0x341b11[_0x44c4('0x7')][_0x34e4c9],_0x536f1e,_0x1de504)[_0x44c4('0x1f')](function(_0x3e1343){if(!_0x9eec45){_0x341b11['timers'][_0x34e4c9]={};logger[_0x44c4('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x519a58,_0x341b11['voiceQueues'][_0x1c37d0]['acwTimeout'],_0x34e4c9,_0x1c37d0);_0x341b11[_0x44c4('0x8')][_0x34e4c9]['timer']=setTimeout(_0x341b11[_0x44c4('0x26')][_0x44c4('0xf')](_0x341b11,_0x34e4c9),_0x341b11[_0x44c4('0x6')][_0x1c37d0][_0x44c4('0x27')]*0x3e8);_0x341b11[_0x44c4('0x8')][_0x34e4c9][_0x44c4('0x28')]=moment()['format'](_0x44c4('0x29'));_0x341b11[_0x44c4('0x8')][_0x34e4c9]['uniqueid']=_0x519a58;_0x341b11[_0x44c4('0x8')][_0x34e4c9]['queue']=_0x1c37d0;_0x341b11['timers'][_0x34e4c9][_0x44c4('0x2a')]=function(){var _0x243668=getDiff(_0x341b11[_0x44c4('0x8')][_0x34e4c9]['lastPauseAt']);clearTimeout(_0x341b11['timers'][_0x34e4c9][_0x44c4('0x2b')]);_0x341b11[_0x44c4('0x8')][_0x34e4c9][_0x44c4('0x2b')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x243668},_0x341b11[_0x44c4('0x8')][_0x34e4c9][_0x44c4('0x2c')],_0x34e4c9)[_0x44c4('0x1f')](function(_0x2d653f){logger[_0x44c4('0x25')](_0x44c4('0x2d'),_0x519a58,_0x243668,_0x2d653f);})['catch'](function(_0x3da608){logger[_0x44c4('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x519a58,_0x3da608);});delete _0x341b11[_0x44c4('0x8')][_0x34e4c9];};}});}else{logger[_0x44c4('0x25')](_0x44c4('0x2f'),_0x519a58,_0x34e4c9,_0x1c37d0);}});}})[_0x44c4('0x30')](function(_0x457801){logger['error'](_0x44c4('0x31'),_0x519a58,_0x341b11[_0x44c4('0x6')][_0x1c37d0][_0x44c4('0x27')],_0x34e4c9,_0x1c37d0);})['finally'](function(){delete _0x341b11[_0x44c4('0x9')][_0x519a58];});}catch(_0x36abd4){logger[_0x44c4('0x2e')](_0x44c4('0x32'),_0x36abd4['message']);}};Acw[_0x44c4('0x17')][_0x44c4('0x26')]=function(_0x413d9a){try{var _0x24c68b=this;if(_0x24c68b[_0x44c4('0x8')][_0x413d9a]){_0x24c68b[_0x44c4('0x8')][_0x413d9a][_0x44c4('0x2b')]=![];var _0x585ca7=_0x24c68b['timers'][_0x413d9a][_0x44c4('0x2c')];var _0x5a6630=_0x24c68b[_0x44c4('0x8')][_0x413d9a][_0x44c4('0x33')];var _0x105857=_0x24c68b[_0x44c4('0x6')][_0x5a6630][_0x44c4('0x27')];logger[_0x44c4('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x585ca7,_0x413d9a);RpcUser[_0x44c4('0x34')](this[_0x44c4('0x7')][_0x413d9a]);RpcVoiceAgentReport[_0x44c4('0x35')]({'acwtime':_0x105857,'agentacw':!![]},_0x585ca7,_0x413d9a)[_0x44c4('0x1f')](function(_0x2bdfc3){logger[_0x44c4('0x25')](_0x44c4('0x2d'),_0x585ca7,_0x105857,_0x2bdfc3);})[_0x44c4('0x30')](function(_0x14fd51){logger[_0x44c4('0x2e')](_0x44c4('0x36'),_0x585ca7,_0x14fd51);});}else{logger[_0x44c4('0x2e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x413d9a);if(_0x24c68b[_0x44c4('0x8')]){logger['info'](_0x44c4('0x37'),JSON['stringify'](_0x24c68b[_0x44c4('0x8')]));}}}catch(_0x59145c){logger[_0x44c4('0x2e')](_0x44c4('0x38'),_0x59145c[_0x44c4('0x39')]);}};Acw[_0x44c4('0x17')][_0x44c4('0xb')]=function(_0x1acf8e){try{if(this[_0x44c4('0x6')][_0x1acf8e['queue']]&&(this[_0x44c4('0x6')][_0x1acf8e[_0x44c4('0x33')]]['acw']||this[_0x44c4('0x6')][_0x1acf8e[_0x44c4('0x33')]]['mandatoryDisposition'])){if(this[_0x44c4('0x7')][_0x1acf8e[_0x44c4('0x19')]]){this[_0x44c4('0x9')][_0x1acf8e[_0x44c4('0x2c')]]={'queue':_0x1acf8e[_0x44c4('0x33')],'interface':_0x1acf8e['interface'],'destlinkedid':_0x1acf8e[_0x44c4('0x24')]};}}}catch(_0x58d16d){logger['error'](_0x44c4('0x3a'),_0x58d16d[_0x44c4('0x39')]);}};Acw[_0x44c4('0x17')]['syncAgentConnectPreview']=function(_0x26c4ca){try{if(this[_0x44c4('0x6')][_0x26c4ca[_0x44c4('0x33')]]&&(this[_0x44c4('0x6')][_0x26c4ca[_0x44c4('0x33')]]['acw']||this['voiceQueues'][_0x26c4ca[_0x44c4('0x33')]][_0x44c4('0x3b')])){if(this[_0x44c4('0x7')][_0x26c4ca[_0x44c4('0x19')]]){this[_0x44c4('0x9')][_0x26c4ca[_0x44c4('0x2c')]]={'queue':_0x26c4ca[_0x44c4('0x33')],'interface':_0x26c4ca[_0x44c4('0x19')]};}}}catch(_0x16b915){logger[_0x44c4('0x2e')](_0x44c4('0x3c'),_0x16b915[_0x44c4('0x39')]);}};Acw[_0x44c4('0x17')][_0x44c4('0xd')]=function(_0x53b9ca){try{if(this['channels'][_0x53b9ca[_0x44c4('0x2c')]]&&_[_0x44c4('0x3d')](this['channels'][_0x53b9ca[_0x44c4('0x2c')]][_0x44c4('0x23')])){logger[_0x44c4('0x25')](_0x44c4('0x3e'),_0x53b9ca[_0x44c4('0x2c')]);this[_0x44c4('0x18')](_0x53b9ca[_0x44c4('0x2c')]);}else if(this[_0x44c4('0x9')][_0x53b9ca[_0x44c4('0x3f')]]&&_['isUndefined'](this[_0x44c4('0x9')][_0x53b9ca[_0x44c4('0x3f')]][_0x44c4('0x23')])){logger[_0x44c4('0x25')](_0x44c4('0x40'),_0x53b9ca[_0x44c4('0x3f')]);this[_0x44c4('0x18')](_0x53b9ca['linkedid']);}}catch(_0x5548dc){logger[_0x44c4('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x5548dc['message']);}};Acw['prototype'][_0x44c4('0xe')]=function(_0x3264f8){try{if(this[_0x44c4('0x9')][_0x3264f8['uniqueid']]&&this[_0x44c4('0x9')][_0x3264f8['uniqueid']][_0x44c4('0x23')]){logger[_0x44c4('0x25')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3264f8[_0x44c4('0x2c')]);this[_0x44c4('0x18')](_0x3264f8['uniqueid']);}else if(this[_0x44c4('0x9')][_0x3264f8[_0x44c4('0x3f')]]&&this['channels'][_0x3264f8[_0x44c4('0x3f')]][_0x44c4('0x23')]){logger[_0x44c4('0x25')](_0x44c4('0x41'),_0x3264f8[_0x44c4('0x3f')]);this[_0x44c4('0x18')](_0x3264f8[_0x44c4('0x3f')]);}}catch(_0x2d600d){logger[_0x44c4('0x2e')](_0x44c4('0x42'),_0x2d600d[_0x44c4('0x39')]);}};Acw[_0x44c4('0x17')][_0x44c4('0x43')]=function(_0x2dc562){try{if(!_[_0x44c4('0x44')](this[_0x44c4('0x9')][_0x2dc562[_0x44c4('0x45')]])){this[_0x44c4('0x18')](_0x2dc562[_0x44c4('0x45')]);if(this[_0x44c4('0x9')][_0x2dc562[_0x44c4('0x46')]]){this['channels'][_0x2dc562[_0x44c4('0x46')]]['attended']=!![];this['channels'][_0x2dc562['transfertargetuniqueid']]=this['channels'][_0x2dc562[_0x44c4('0x46')]];delete this[_0x44c4('0x9')][_0x2dc562[_0x44c4('0x46')]];}}else if(!_[_0x44c4('0x44')](this[_0x44c4('0x9')][_0x2dc562['transfertargetuniqueid']])){this[_0x44c4('0x18')](_0x2dc562[_0x44c4('0x47')]);if(this['channels'][_0x2dc562[_0x44c4('0x48')]]){this[_0x44c4('0x9')][_0x2dc562[_0x44c4('0x48')]]['attended']=!![];this[_0x44c4('0x9')][_0x2dc562[_0x44c4('0x45')]]=this[_0x44c4('0x9')][_0x2dc562[_0x44c4('0x48')]];delete this[_0x44c4('0x9')][_0x2dc562[_0x44c4('0x48')]];}}}catch(_0x3bf6a){logger['error'](_0x44c4('0x49'),_0x3bf6a[_0x44c4('0x39')]);}};Acw[_0x44c4('0x17')][_0x44c4('0x13')]=function(_0x4e6cf6){try{if(this[_0x44c4('0x9')][_0x4e6cf6['transfereruniqueid']]){logger[_0x44c4('0x25')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x44c4('0x4a')](_0x4e6cf6[_0x44c4('0x4b')]));this[_0x44c4('0x18')](_0x4e6cf6[_0x44c4('0x4b')]);}else if(this[_0x44c4('0x9')][_0x4e6cf6['transfererlinkedid']]){logger[_0x44c4('0x25')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x44c4('0x4a')](_0x4e6cf6['transfererlinkedid']));this[_0x44c4('0x18')](_0x4e6cf6[_0x44c4('0x4c')]);}}catch(_0x4a800a){logger[_0x44c4('0x2e')](_0x44c4('0x4d'),_0x4a800a[_0x44c4('0x39')]);}};Acw['prototype'][_0x44c4('0x11')]=function(_0x23650c){try{if(this[_0x44c4('0x6')][_0x23650c[_0x44c4('0x33')]]&&this[_0x44c4('0x6')][_0x23650c[_0x44c4('0x33')]][_0x44c4('0x4e')]===_0x44c4('0x4f')){if(this['agents'][_0x23650c['interface']]){logger[_0x44c4('0x25')](_0x44c4('0x50'),_0x23650c['uniqueid'],_0x23650c['interface'],_0x23650c[_0x44c4('0x33')]);return RpcUser[_0x44c4('0x51')](this[_0x44c4('0x7')][_0x23650c[_0x44c4('0x19')]],_0x44c4('0x52'),_0x23650c[_0x44c4('0x2c')]);}}}catch(_0x2f796a){logger['error'](_0x44c4('0x53'),_0x2f796a[_0x44c4('0x39')]);}};module[_0x44c4('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index b299118..c366467 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 _0x7e05=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','fullybooted','resolve','then','log','once','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../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'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x7e05,0x129));var _0x57e0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7e05[_0x501510];return _0x1e6ee5;};'use strict';var Manager=require(_0x57e0('0x0'));var BPromise=require(_0x57e0('0x1'));var moment=require(_0x57e0('0x2'));var util=require(_0x57e0('0x3'));var _=require(_0x57e0('0x4'));var logger=require(_0x57e0('0x5'))('ami');var config=require(_0x57e0('0x6'));var ami=new Manager(config[_0x57e0('0x7')][_0x57e0('0x8')],config[_0x57e0('0x7')]['ip'],config['asterisk'][_0x57e0('0x9')],config[_0x57e0('0x7')][_0x57e0('0xa')],!![]);ami['keepConnected']();ami[_0x57e0('0xb')]=BPromise[_0x57e0('0xc')](ami[_0x57e0('0xd')]);function error(_0x428a7d){logger[_0x57e0('0xe')](util[_0x57e0('0xf')](_0x57e0('0x10'),config[_0x57e0('0x7')][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config[_0x57e0('0x7')]['port'],util[_0x57e0('0x11')](_0x428a7d,![],null)));}function close(){logger[_0x57e0('0xe')](util[_0x57e0('0xf')](_0x57e0('0x12'),config['asterisk'][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config['asterisk'][_0x57e0('0x8')]));}ami[_0x57e0('0x13')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':'sipshowregistry'});};};ami[_0x57e0('0x14')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':_0x57e0('0x15')});};};ami[_0x57e0('0x16')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':'sippeerstatus'});};};ami[_0x57e0('0x17')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x57e0('0x18')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':_0x57e0('0x19')});};};function connect(_0x21e9bc){logger[_0x57e0('0x1a')](util[_0x57e0('0xf')](_0x57e0('0x1b'),config[_0x57e0('0x7')][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config[_0x57e0('0x7')]['port']));ami['once'](_0x57e0('0xe'),error);ami['once']('close',close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x3c45af){logger['info'](util[_0x57e0('0xf')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x57e0('0x7')]['username'],config['asterisk']['ip'],config[_0x57e0('0x7')][_0x57e0('0x8')],util['inspect'](_0x3c45af,![],null)));});ami['on'](_0x57e0('0x1c'),function(_0x4a78e3){logger['info'](util[_0x57e0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x57e0('0x7')][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config[_0x57e0('0x7')]['port']));return BPromise[_0x57e0('0x1d')]()[_0x57e0('0x1e')](ami[_0x57e0('0x13')]())[_0x57e0('0x1e')](ami['actionDeviceStateList']())[_0x57e0('0x1e')](ami[_0x57e0('0x16')]())['then'](ami['actionQueueSummary']())['then'](ami[_0x57e0('0x18')]())['catch'](function(_0x548dd1){console[_0x57e0('0x1f')](_0x548dd1);});});ami[_0x57e0('0x20')](_0x57e0('0xe'),error);ami[_0x57e0('0x20')](_0x57e0('0x21'),close);module[_0x57e0('0x22')]=ami; \ No newline at end of file +var _0x6184=['resolve','then','catch','log','close','exports','asterisk-manager','bluebird','lodash','../../config/logger','../../config/environment','asterisk','port','password','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','Action','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x292bab,_0x4eb300){var _0x18b22a=function(_0x5e8aff){while(--_0x5e8aff){_0x292bab['push'](_0x292bab['shift']());}};_0x18b22a(++_0x4eb300);}(_0x6184,0x153));var _0x4618=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x6184[_0x4ed32d];return _0xf624df;};'use strict';var Manager=require(_0x4618('0x0'));var BPromise=require(_0x4618('0x1'));var moment=require('moment');var util=require('util');var _=require(_0x4618('0x2'));var logger=require(_0x4618('0x3'))('ami');var config=require(_0x4618('0x4'));var ami=new Manager(config[_0x4618('0x5')][_0x4618('0x6')],config[_0x4618('0x5')]['ip'],config[_0x4618('0x5')]['username'],config[_0x4618('0x5')][_0x4618('0x7')],!![]);ami[_0x4618('0x8')]();ami['Action']=BPromise['promisify'](ami[_0x4618('0x9')]);function error(_0x4e52a7){logger[_0x4618('0xa')](util[_0x4618('0xb')](_0x4618('0xc'),config['asterisk'][_0x4618('0xd')],config[_0x4618('0x5')]['ip'],config[_0x4618('0x5')][_0x4618('0x6')],util[_0x4618('0xe')](_0x4e52a7,![],null)));}function close(){logger[_0x4618('0xa')](util[_0x4618('0xb')](_0x4618('0xf'),config[_0x4618('0x5')][_0x4618('0xd')],config['asterisk']['ip'],config[_0x4618('0x5')][_0x4618('0x6')]));}ami[_0x4618('0x10')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x4618('0x11')]=function(){return function(){return ami[_0x4618('0x12')]({'action':_0x4618('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x4618('0x12')]({'action':_0x4618('0x14')});};};ami[_0x4618('0x15')]=function(){return function(){return ami[_0x4618('0x12')]({'action':_0x4618('0x16')});};};ami[_0x4618('0x17')]=function(){return function(){return ami[_0x4618('0x12')]({'action':_0x4618('0x18')});};};function connect(_0x526ac3){logger[_0x4618('0x19')](util[_0x4618('0xb')](_0x4618('0x1a'),config[_0x4618('0x5')][_0x4618('0xd')],config[_0x4618('0x5')]['ip'],config['asterisk'][_0x4618('0x6')]));ami[_0x4618('0x1b')](_0x4618('0xa'),error);ami[_0x4618('0x1b')]('close',close);}ami['on'](_0x4618('0x1c'),connect);ami['on'](_0x4618('0x1d'),function(_0x10e0f2){logger[_0x4618('0x19')](util[_0x4618('0xb')](_0x4618('0x1e'),config[_0x4618('0x5')][_0x4618('0xd')],config[_0x4618('0x5')]['ip'],config[_0x4618('0x5')][_0x4618('0x6')],util[_0x4618('0xe')](_0x10e0f2,![],null)));});ami['on']('fullybooted',function(_0x239f4e){logger[_0x4618('0x19')](util[_0x4618('0xb')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0x4618('0xd')],config['asterisk']['ip'],config[_0x4618('0x5')][_0x4618('0x6')]));return BPromise[_0x4618('0x1f')]()[_0x4618('0x20')](ami[_0x4618('0x10')]())[_0x4618('0x20')](ami['actionDeviceStateList']())[_0x4618('0x20')](ami['actionSipPeerStatus']())[_0x4618('0x20')](ami[_0x4618('0x15')]())[_0x4618('0x20')](ami[_0x4618('0x17')]())[_0x4618('0x21')](function(_0xb825c2){console[_0x4618('0x22')](_0xb825c2);});});ami['once'](_0x4618('0xa'),error);ami[_0x4618('0x1b')](_0x4618('0x23'),close);module[_0x4618('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index e6eef41..2d09c6b 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xe706,0xa3));var _0x6e70=function(_0x48051b,_0x368d0b){_0x48051b=_0x48051b-0x0;var _0x5669e1=_0xe706[_0x48051b];return _0x5669e1;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x534ced,_0x205b08){var _0x500691=function(_0x10359e){while(--_0x10359e){_0x534ced['push'](_0x534ced['shift']());}};_0x500691(++_0x205b08);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index b387c2e..6730973 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 _0x84f3=['util','lodash','moment','isNil','string','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','voiceQueue'];(function(_0x1b3666,_0x3a1ad1){var _0x45da37=function(_0x78d51a){while(--_0x78d51a){_0x1b3666['push'](_0x1b3666['shift']());}};_0x45da37(++_0x3a1ad1);}(_0x84f3,0x148));var _0x384f=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x84f3[_0x8c43de];return _0xa6591b;};'use strict';var util=require(_0x384f('0x0'));var _=require(_0x384f('0x1'));var moment=require(_0x384f('0x2'));function checkNameSurname(_0x153484,_0x4e82ab,_0x3dc562){var _0x23019d='';if(!_['isNil'](_0x4e82ab)&&'string'===typeof _0x4e82ab){_0x23019d+=_0x4e82ab;}if(!_[_0x384f('0x3')](_0x3dc562)&&_0x384f('0x4')===typeof _0x3dc562){_0x23019d+='\x20'+_0x3dc562;}if(_0x23019d!==''){return _0x23019d;}return _0x153484;}function Action(_0x3551b8,_0x528e61,_0x27d658){this['voiceQueue']=_0x3551b8;this['uniqueid']=_0x27d658||undefined;this[_0x384f('0x5')]=checkNameSurname(_0x528e61[_0x384f('0x6')][_0x384f('0x7')],_0x528e61[_0x384f('0x6')][_0x384f('0x8')],_0x528e61[_0x384f('0x6')][_0x384f('0x9')]);this[_0x384f('0xa')]=_0x528e61[_0x384f('0x6')][_0x384f('0x7')];this[_0x384f('0xb')]=_0x3551b8[_0x384f('0x5')];this['active']=_0x528e61[_0x384f('0xc')]||![];this['type']=_0x3551b8[_0x384f('0xd')];this[_0x384f('0xe')]=_0x3551b8['dialQueueTimeout']||0x3;this['scheduledat']=_0x528e61[_0x384f('0xf')];this['countbusyretry']=_0x528e61[_0x384f('0x10')];this[_0x384f('0x11')]=_0x528e61[_0x384f('0x11')];this[_0x384f('0x12')]=_0x528e61['countnoanswerretry'];this[_0x384f('0x13')]=_0x528e61[_0x384f('0x13')];this[_0x384f('0x14')]=_0x528e61['countdropretry'];this[_0x384f('0x15')]=_0x528e61[_0x384f('0x15')];this['countmachineretry']=_0x528e61[_0x384f('0x16')];this[_0x384f('0x17')]=_0x528e61[_0x384f('0x17')];this[_0x384f('0x18')]=_0x528e61['ContactId'];this[_0x384f('0x19')]=_0x528e61['ListId'];this[_0x384f('0x1a')]=_0x528e61['UserId'];this[_0x384f('0x1b')]=_0x528e61['VoiceQueueId'];this[_0x384f('0x1c')]=_0x528e61[_0x384f('0x1c')];this['idHopper']=_0x528e61['id'];this[_0x384f('0x1d')]=_0x528e61['Contact']['firstName']||'';this[_0x384f('0x1e')]=moment()[_0x384f('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x384f('0x20')]=_0x528e61[_0x384f('0x20')];this[_0x384f('0x21')]=_0x528e61[_0x384f('0x21')];this[_0x384f('0x22')]=_0x528e61[_0x384f('0x22')];this['recallme']=_0x528e61['recallme'];this[_0x384f('0x23')]='';this['originatecalleridname']='';}Action[_0x384f('0x24')][_0x384f('0x25')]=function(){return util[_0x384f('0x1f')](_0x384f('0x26'),this[_0x384f('0x5')],this['voiceQueue'][_0x384f('0x27')]>0x0?this[_0x384f('0xa')]['substring'](this[_0x384f('0x28')][_0x384f('0x27')]):this[_0x384f('0xa')]);};Action[_0x384f('0x24')]['getQueue']=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x7c25=['UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','lastName','number','name','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x20c349,_0x13196a){var _0x162c06=function(_0x4b21a9){while(--_0x4b21a9){_0x20c349['push'](_0x20c349['shift']());}};_0x162c06(++_0x13196a);}(_0x7c25,0xc8));var _0x57c2=function(_0x3bc1c1,_0x2c09a5){_0x3bc1c1=_0x3bc1c1-0x0;var _0x13c935=_0x7c25[_0x3bc1c1];return _0x13c935;};'use strict';var util=require(_0x57c2('0x0'));var _=require(_0x57c2('0x1'));var moment=require(_0x57c2('0x2'));function checkNameSurname(_0xca3443,_0x59f187,_0x276b96){var _0x5f5ca1='';if(!_[_0x57c2('0x3')](_0x59f187)&&_0x57c2('0x4')===typeof _0x59f187){_0x5f5ca1+=_0x59f187;}if(!_['isNil'](_0x276b96)&&_0x57c2('0x4')===typeof _0x276b96){_0x5f5ca1+='\x20'+_0x276b96;}if(_0x5f5ca1!==''){return _0x5f5ca1;}return _0xca3443;}function Action(_0x67e448,_0x2ea501,_0x3aa44b){this[_0x57c2('0x5')]=_0x67e448;this[_0x57c2('0x6')]=_0x3aa44b||undefined;this['name']=checkNameSurname(_0x2ea501[_0x57c2('0x7')][_0x57c2('0x8')],_0x2ea501[_0x57c2('0x7')]['firstName'],_0x2ea501[_0x57c2('0x7')][_0x57c2('0x9')]);this[_0x57c2('0xa')]=_0x2ea501['Contact'][_0x57c2('0x8')];this['queue']=_0x67e448[_0x57c2('0xb')];this[_0x57c2('0xc')]=_0x2ea501['active']||![];this['type']=_0x67e448['type'];this[_0x57c2('0xd')]=_0x67e448[_0x57c2('0xd')]||0x3;this[_0x57c2('0xe')]=_0x2ea501['scheduledat'];this[_0x57c2('0xf')]=_0x2ea501[_0x57c2('0xf')];this[_0x57c2('0x10')]=_0x2ea501[_0x57c2('0x10')];this['countnoanswerretry']=_0x2ea501[_0x57c2('0x11')];this[_0x57c2('0x12')]=_0x2ea501[_0x57c2('0x12')];this[_0x57c2('0x13')]=_0x2ea501['countdropretry'];this[_0x57c2('0x14')]=_0x2ea501[_0x57c2('0x14')];this[_0x57c2('0x15')]=_0x2ea501[_0x57c2('0x15')];this[_0x57c2('0x16')]=_0x2ea501['countagentrejectretry'];this[_0x57c2('0x17')]=_0x2ea501[_0x57c2('0x17')];this[_0x57c2('0x18')]=_0x2ea501[_0x57c2('0x18')];this[_0x57c2('0x19')]=_0x2ea501[_0x57c2('0x19')];this['VoiceQueueId']=_0x2ea501[_0x57c2('0x1a')];this[_0x57c2('0x1b')]=_0x2ea501[_0x57c2('0x1b')];this[_0x57c2('0x1c')]=_0x2ea501['id'];this['ContactFirstName']=_0x2ea501[_0x57c2('0x7')][_0x57c2('0x1d')]||'';this[_0x57c2('0x1e')]=moment()['format'](_0x57c2('0x1f'));this[_0x57c2('0x20')]=_0x2ea501['callback'];this['callbackuniqueid']=_0x2ea501[_0x57c2('0x21')];this['callbackat']=_0x2ea501['callbackat'];this[_0x57c2('0x22')]=_0x2ea501[_0x57c2('0x22')];this['originatecalleridnum']='';this[_0x57c2('0x23')]='';}Action[_0x57c2('0x24')][_0x57c2('0x25')]=function(){return util[_0x57c2('0x26')](_0x57c2('0x27'),this[_0x57c2('0xb')],this[_0x57c2('0x5')][_0x57c2('0x28')]>0x0?this['number'][_0x57c2('0x29')](this[_0x57c2('0x5')][_0x57c2('0x28')]):this[_0x57c2('0xa')]);};Action['prototype'][_0x57c2('0x2a')]=function(){return this[_0x57c2('0x2b')];};module[_0x57c2('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b343527..65e5769 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 _0x4ab6=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','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','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer'];(function(_0x5946df,_0x3ac359){var _0x481992=function(_0xbe6ab4){while(--_0xbe6ab4){_0x5946df['push'](_0x5946df['shift']());}};_0x481992(++_0x3ac359);}(_0x4ab6,0x19f));var _0x64ab=function(_0x149a41,_0x3cbb44){_0x149a41=_0x149a41-0x0;var _0x10132c=_0x4ab6[_0x149a41];return _0x10132c;};'use strict';var util=require('util');var _=require(_0x64ab('0x0'));var moment=require(_0x64ab('0x1'));function getSeconds(_0x3e8c84,_0x2eb6a9){var _0x3b70ad=moment(_0x3e8c84)[_0x64ab('0x2')](0x0);var _0x30c54a=moment(_0x2eb6a9)[_0x64ab('0x2')](0x0);return _0x3b70ad[_0x64ab('0x3')](_0x30c54a,_0x64ab('0x4'));}function AgentComplete(_0x46037d,_0xc66191){this[_0x64ab('0x5')]=0x4;this[_0x64ab('0x6')]=_0x64ab('0x7');this[_0x64ab('0x8')]=_0x46037d['scheduledat'];this[_0x64ab('0x9')]=_0x46037d[_0x64ab('0x9')];this[_0x64ab('0xa')]=_0x46037d[_0x64ab('0x9')]===_0x64ab('0xb')?'queue':_0x46037d['type'];this[_0x64ab('0xc')]=_0x46037d[_0x64ab('0xc')];this[_0x64ab('0xd')]=_0x46037d[_0x64ab('0xd')];this[_0x64ab('0xe')]=_0x46037d[_0x64ab('0xe')];this[_0x64ab('0xf')]=_0x46037d[_0x64ab('0xc')]+_0x46037d[_0x64ab('0xd')]+_0x46037d[_0x64ab('0xe')]+_0x46037d[_0x64ab('0x10')]+_0x46037d['countdropretry']+_0x46037d[_0x64ab('0x11')]+_0x46037d['countmachineretry']+_0x46037d[_0x64ab('0x12')];this['countnosuchnumberretry']=_0x46037d['countnosuchnumberretry'];this['countdropretry']=_0x46037d[_0x64ab('0x13')];this['countabandonedretry']=_0x46037d[_0x64ab('0x11')];this[_0x64ab('0x14')]=_0x46037d[_0x64ab('0x14')];this[_0x64ab('0x12')]=_0x46037d['countagentrejectretry'];this[_0x64ab('0x15')]=_0xc66191[_0x64ab('0x15')];this['calleridname']=_0x46037d[_0x64ab('0x16')];this[_0x64ab('0x17')]=_0x46037d[_0x64ab('0x18')];this[_0x64ab('0x19')]=_0x46037d[_0x64ab('0x19')];this[_0x64ab('0x1a')]=_0x46037d[_0x64ab('0x1a')];this['answertime']=_0x46037d[_0x64ab('0x1b')];this[_0x64ab('0x1c')]=moment()[_0x64ab('0x1d')](_0x64ab('0x1e'));this[_0x64ab('0x1f')]=getSeconds(_0x46037d[_0x64ab('0x1a')],_0x46037d['starttime']);this[_0x64ab('0x20')]=getSeconds(_0x46037d[_0x64ab('0x1b')],_0x46037d[_0x64ab('0x1a')]);this['talktime']=getSeconds(this[_0x64ab('0x1c')],_0x46037d[_0x64ab('0x1b')]);this['queue']=_0xc66191['queue'];this['membername']=_0xc66191[_0x64ab('0x21')];this['reason']=_0xc66191[_0x64ab('0x22')];this[_0x64ab('0x23')]=_0x46037d['callback'];this[_0x64ab('0x24')]=_0x46037d['callbackuniqueid'];this[_0x64ab('0x25')]=_0x46037d['callbackat'];this[_0x64ab('0x26')]=_0x46037d['recallme'];this['ContactId']=_0x46037d[_0x64ab('0x27')];this['ListId']=_0x46037d[_0x64ab('0x28')];this['UserId']=_0x46037d[_0x64ab('0x29')];this[_0x64ab('0x2a')]=_0x46037d[_0x64ab('0x2a')];this['CampaignId']=_0x46037d[_0x64ab('0x2b')];this['originatecalleridnum']=_0x46037d[_0x64ab('0x2c')]||'';this[_0x64ab('0x2d')]=_0x46037d[_0x64ab('0x2d')]||'';}module[_0x64ab('0x2e')]=AgentComplete; \ No newline at end of file +var _0xb973=['exports','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','number','starttime','responsetime','answertime','endtime','format','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x368952,_0x593141){var _0x14c5b2=function(_0x67f0ba){while(--_0x67f0ba){_0x368952['push'](_0x368952['shift']());}};_0x14c5b2(++_0x593141);}(_0xb973,0xd8));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x5c6210,_0x35758b){var _0x5e1ed5=moment(_0x5c6210)[_0x3b97('0x0')](0x0);var _0x43f4c3=moment(_0x35758b)[_0x3b97('0x0')](0x0);return _0x5e1ed5[_0x3b97('0x1')](_0x43f4c3,_0x3b97('0x2'));}function AgentComplete(_0x137b4f,_0x388e0d){this[_0x3b97('0x3')]=0x4;this[_0x3b97('0x4')]=_0x3b97('0x5');this['scheduledat']=_0x137b4f[_0x3b97('0x6')];this[_0x3b97('0x7')]=_0x137b4f[_0x3b97('0x7')];this[_0x3b97('0x8')]=_0x137b4f[_0x3b97('0x7')]==='outbound'?_0x3b97('0x9'):_0x137b4f[_0x3b97('0x7')];this['countbusyretry']=_0x137b4f[_0x3b97('0xa')];this[_0x3b97('0xb')]=_0x137b4f[_0x3b97('0xb')];this[_0x3b97('0xc')]=_0x137b4f[_0x3b97('0xc')];this[_0x3b97('0xd')]=_0x137b4f[_0x3b97('0xa')]+_0x137b4f[_0x3b97('0xb')]+_0x137b4f[_0x3b97('0xc')]+_0x137b4f[_0x3b97('0xe')]+_0x137b4f[_0x3b97('0xf')]+_0x137b4f[_0x3b97('0x10')]+_0x137b4f['countmachineretry']+_0x137b4f[_0x3b97('0x11')];this[_0x3b97('0xe')]=_0x137b4f['countnosuchnumberretry'];this[_0x3b97('0xf')]=_0x137b4f[_0x3b97('0xf')];this[_0x3b97('0x10')]=_0x137b4f['countabandonedretry'];this[_0x3b97('0x12')]=_0x137b4f[_0x3b97('0x12')];this[_0x3b97('0x11')]=_0x137b4f['countagentrejectretry'];this[_0x3b97('0x13')]=_0x388e0d['uniqueid'];this[_0x3b97('0x14')]=_0x137b4f['name'];this['calleridnum']=_0x137b4f[_0x3b97('0x15')];this['starttime']=_0x137b4f[_0x3b97('0x16')];this[_0x3b97('0x17')]=_0x137b4f[_0x3b97('0x17')];this[_0x3b97('0x18')]=_0x137b4f[_0x3b97('0x18')];this[_0x3b97('0x19')]=moment()[_0x3b97('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x137b4f[_0x3b97('0x17')],_0x137b4f['starttime']);this[_0x3b97('0x1b')]=getSeconds(_0x137b4f[_0x3b97('0x18')],_0x137b4f['responsetime']);this[_0x3b97('0x1c')]=getSeconds(this['endtime'],_0x137b4f[_0x3b97('0x18')]);this[_0x3b97('0x9')]=_0x388e0d[_0x3b97('0x9')];this[_0x3b97('0x1d')]=_0x388e0d[_0x3b97('0x1d')];this[_0x3b97('0x1e')]=_0x388e0d[_0x3b97('0x1e')];this[_0x3b97('0x1f')]=_0x137b4f[_0x3b97('0x1f')];this[_0x3b97('0x20')]=_0x137b4f[_0x3b97('0x20')];this['callbackat']=_0x137b4f[_0x3b97('0x21')];this[_0x3b97('0x22')]=_0x137b4f[_0x3b97('0x22')];this['ContactId']=_0x137b4f[_0x3b97('0x23')];this[_0x3b97('0x24')]=_0x137b4f[_0x3b97('0x24')];this[_0x3b97('0x25')]=_0x137b4f[_0x3b97('0x25')];this[_0x3b97('0x26')]=_0x137b4f[_0x3b97('0x26')];this[_0x3b97('0x27')]=_0x137b4f[_0x3b97('0x27')];this[_0x3b97('0x28')]=_0x137b4f[_0x3b97('0x28')]||'';this[_0x3b97('0x29')]=_0x137b4f['originatecalleridname']||'';}module[_0x3b97('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 753f379..4215c42 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 _0x8ce1=['recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x403d9e,_0x27e15a){var _0x86beac=function(_0xfffe25){while(--_0xfffe25){_0x403d9e['push'](_0x403d9e['shift']());}};_0x86beac(++_0x27e15a);}(_0x8ce1,0x183));var _0x18ce=function(_0x47f717,_0x2ee238){_0x47f717=_0x47f717-0x0;var _0x4ab2d3=_0x8ce1[_0x47f717];return _0x4ab2d3;};'use strict';var util=require(_0x18ce('0x0'));var _=require(_0x18ce('0x1'));var moment=require(_0x18ce('0x2'));function getSeconds(_0x1ba15f,_0x202f93){var _0x22b196=moment(_0x1ba15f)[_0x18ce('0x3')](0x0);var _0xfc68a8=moment(_0x202f93)[_0x18ce('0x3')](0x0);return _0x22b196[_0x18ce('0x4')](_0xfc68a8,_0x18ce('0x5'));}function Final(_0x280142){this[_0x18ce('0x6')]=_0x280142[_0x18ce('0x6')];this[_0x18ce('0x7')]=_0x280142[_0x18ce('0x7')];this['type']=_0x280142[_0x18ce('0x8')];this[_0x18ce('0x9')]=_0x280142[_0x18ce('0x8')]===_0x18ce('0xa')?'queue':_0x280142[_0x18ce('0x8')];this[_0x18ce('0xb')]=_0x280142[_0x18ce('0xb')];this[_0x18ce('0xc')]=_0x280142['countcongestionretry'];this['countnoanswerretry']=_0x280142[_0x18ce('0xd')];this[_0x18ce('0xe')]=_0x280142[_0x18ce('0xb')]+_0x280142[_0x18ce('0xc')]+_0x280142[_0x18ce('0xd')]+_0x280142['countnosuchnumberretry']+_0x280142[_0x18ce('0xf')]+_0x280142[_0x18ce('0x10')]+_0x280142[_0x18ce('0x11')]+_0x280142[_0x18ce('0x12')];this[_0x18ce('0x13')]=_0x280142['countnosuchnumberretry'];this[_0x18ce('0xf')]=_0x280142[_0x18ce('0xf')];this[_0x18ce('0x10')]=_0x280142[_0x18ce('0x10')];this[_0x18ce('0x11')]=_0x280142[_0x18ce('0x11')];this[_0x18ce('0x12')]=_0x280142['countagentrejectretry'];this[_0x18ce('0x14')]=_0x280142[_0x18ce('0x14')];this[_0x18ce('0x15')]=_0x280142[_0x18ce('0x15')];this[_0x18ce('0x16')]=_0x280142[_0x18ce('0x16')];this['starttime']=_0x280142[_0x18ce('0x17')];this[_0x18ce('0x18')]=_0x280142[_0x18ce('0x18')];this['endtime']=_0x280142[_0x18ce('0x18')];this[_0x18ce('0x19')]=_0x280142[_0x18ce('0x19')]||0x0;this['holdtime']=_0x280142[_0x18ce('0x1a')]||0x0;this[_0x18ce('0x1b')]=_0x280142['talktime']||0x0;this[_0x18ce('0x1c')]=_0x280142[_0x18ce('0x1c')];this[_0x18ce('0x1d')]=_0x280142[_0x18ce('0x1d')];this[_0x18ce('0x1e')]=_0x280142[_0x18ce('0x1e')];this[_0x18ce('0x1f')]=_0x280142[_0x18ce('0x1f')];this[_0x18ce('0x20')]=_0x280142['ContactId'];this['ListId']=_0x280142['ListId'];this[_0x18ce('0x21')]=_0x280142['UserId'];this[_0x18ce('0x22')]=_0x280142[_0x18ce('0x22')];this[_0x18ce('0x23')]=_0x280142['CampaignId'];this['originatecalleridnum']=_0x280142['originatecalleridnum']||'';this[_0x18ce('0x24')]=_0x280142[_0x18ce('0x24')]||'';}module[_0x18ce('0x25')]=Final; \ No newline at end of file +var _0xec39=['countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','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','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x2dc6e8,_0x484d63){var _0x534842=function(_0xa20819){while(--_0xa20819){_0x2dc6e8['push'](_0x2dc6e8['shift']());}};_0x534842(++_0x484d63);}(_0xec39,0x19f));var _0x9ec3=function(_0x375da2,_0x33cef3){_0x375da2=_0x375da2-0x0;var _0x47a523=_0xec39[_0x375da2];return _0x47a523;};'use strict';var util=require(_0x9ec3('0x0'));var _=require(_0x9ec3('0x1'));var moment=require(_0x9ec3('0x2'));function getSeconds(_0x3ea667,_0x1fc7a7){var _0xb3d117=moment(_0x3ea667)[_0x9ec3('0x3')](0x0);var _0x5c0885=moment(_0x1fc7a7)[_0x9ec3('0x3')](0x0);return _0xb3d117[_0x9ec3('0x4')](_0x5c0885,_0x9ec3('0x5'));}function Final(_0x4a3996){this['uniqueid']=_0x4a3996['uniqueid'];this[_0x9ec3('0x6')]=_0x4a3996[_0x9ec3('0x6')];this[_0x9ec3('0x7')]=_0x4a3996['type'];this[_0x9ec3('0x8')]=_0x4a3996[_0x9ec3('0x7')]===_0x9ec3('0x9')?_0x9ec3('0xa'):_0x4a3996[_0x9ec3('0x7')];this[_0x9ec3('0xb')]=_0x4a3996[_0x9ec3('0xb')];this['countcongestionretry']=_0x4a3996[_0x9ec3('0xc')];this[_0x9ec3('0xd')]=_0x4a3996[_0x9ec3('0xd')];this[_0x9ec3('0xe')]=_0x4a3996[_0x9ec3('0xb')]+_0x4a3996[_0x9ec3('0xc')]+_0x4a3996[_0x9ec3('0xd')]+_0x4a3996['countnosuchnumberretry']+_0x4a3996[_0x9ec3('0xf')]+_0x4a3996[_0x9ec3('0x10')]+_0x4a3996[_0x9ec3('0x11')]+_0x4a3996['countagentrejectretry'];this[_0x9ec3('0x12')]=_0x4a3996['countnosuchnumberretry'];this[_0x9ec3('0xf')]=_0x4a3996[_0x9ec3('0xf')];this[_0x9ec3('0x10')]=_0x4a3996[_0x9ec3('0x10')];this[_0x9ec3('0x11')]=_0x4a3996[_0x9ec3('0x11')];this[_0x9ec3('0x13')]=_0x4a3996[_0x9ec3('0x13')];this[_0x9ec3('0xa')]=_0x4a3996['queue'];this[_0x9ec3('0x14')]=_0x4a3996['calleridname'];this['calleridnum']=_0x4a3996[_0x9ec3('0x15')];this[_0x9ec3('0x16')]=_0x4a3996[_0x9ec3('0x16')];this[_0x9ec3('0x17')]=_0x4a3996[_0x9ec3('0x17')];this['endtime']=_0x4a3996[_0x9ec3('0x17')];this['ringtime']=_0x4a3996[_0x9ec3('0x18')]||0x0;this['holdtime']=_0x4a3996[_0x9ec3('0x19')]||0x0;this[_0x9ec3('0x1a')]=_0x4a3996[_0x9ec3('0x1a')]||0x0;this['callback']=_0x4a3996[_0x9ec3('0x1b')];this['callbackuniqueid']=_0x4a3996[_0x9ec3('0x1c')];this['callbackat']=_0x4a3996[_0x9ec3('0x1d')];this[_0x9ec3('0x1e')]=_0x4a3996[_0x9ec3('0x1e')];this[_0x9ec3('0x1f')]=_0x4a3996[_0x9ec3('0x1f')];this[_0x9ec3('0x20')]=_0x4a3996[_0x9ec3('0x20')];this['UserId']=_0x4a3996[_0x9ec3('0x21')];this[_0x9ec3('0x22')]=_0x4a3996[_0x9ec3('0x22')];this[_0x9ec3('0x23')]=_0x4a3996[_0x9ec3('0x23')];this[_0x9ec3('0x24')]=_0x4a3996[_0x9ec3('0x24')]||'';this[_0x9ec3('0x25')]=_0x4a3996[_0x9ec3('0x25')]||'';}module[_0x9ec3('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 27c96b7..af6ecec 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 _0x729b=['countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','endtime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x729b,0xa0));var _0xb729=function(_0x2db0a7,_0x2662aa){_0x2db0a7=_0x2db0a7-0x0;var _0x3f4e27=_0x729b[_0x2db0a7];return _0x3f4e27;};'use strict';var util=require(_0xb729('0x0'));var _=require(_0xb729('0x1'));var moment=require(_0xb729('0x2'));function getSeconds(_0x34ba6e,_0x4f8f5f){var _0x101659=moment(_0x34ba6e)['milliseconds'](0x0);var _0x28b690=moment(_0x4f8f5f)[_0xb729('0x3')](0x0);return _0x101659[_0xb729('0x4')](_0x28b690,_0xb729('0x5'));}function Hangup(_0x18fd5c,_0x1fcfd8){this[_0xb729('0x6')]=0x4;this[_0xb729('0x7')]=_0xb729('0x8');this[_0xb729('0x9')]=_0x18fd5c['scheduledat'];this['type']=_0x18fd5c[_0xb729('0xa')];this[_0xb729('0xb')]=_0x18fd5c['type']===_0xb729('0xc')?'queue':_0x18fd5c[_0xb729('0xa')];this[_0xb729('0xd')]=_0x18fd5c[_0xb729('0xd')];this['countcongestionretry']=_0x18fd5c[_0xb729('0xe')];this[_0xb729('0xf')]=_0x18fd5c['countnoanswerretry'];this['countglobal']=_0x18fd5c[_0xb729('0xd')]+_0x18fd5c[_0xb729('0xe')]+_0x18fd5c[_0xb729('0xf')]+_0x18fd5c[_0xb729('0x10')]+_0x18fd5c[_0xb729('0x11')]+_0x18fd5c['countabandonedretry']+_0x18fd5c[_0xb729('0x12')]+_0x18fd5c[_0xb729('0x13')];this[_0xb729('0x10')]=_0x18fd5c[_0xb729('0x10')];this[_0xb729('0x11')]=_0x18fd5c[_0xb729('0x11')];this[_0xb729('0x14')]=_0x18fd5c[_0xb729('0x14')];this[_0xb729('0x12')]=_0x18fd5c['countmachineretry'];this[_0xb729('0x13')]=_0x18fd5c[_0xb729('0x13')];this[_0xb729('0x15')]=_0x1fcfd8['uniqueid'];this[_0xb729('0x16')]=_0x18fd5c[_0xb729('0x17')];this[_0xb729('0x18')]=_0x18fd5c[_0xb729('0x19')];this[_0xb729('0x1a')]=_0x18fd5c[_0xb729('0x1a')];this['responsetime']=_0x18fd5c['responsetime'];this['endtime']=moment()[_0xb729('0x1b')](_0xb729('0x1c'));this[_0xb729('0x1d')]=getSeconds(_0x18fd5c[_0xb729('0x1e')],_0x18fd5c['starttime']);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0xb729('0x1f')],_0x18fd5c[_0xb729('0x1e')]);this[_0xb729('0x20')]=_0x18fd5c[_0xb729('0x20')];this[_0xb729('0x21')]='IVR';this[_0xb729('0x22')]=_0x1fcfd8[_0xb729('0x23')];this[_0xb729('0x24')]=_0x18fd5c[_0xb729('0x24')];this[_0xb729('0x25')]=_0x18fd5c['callbackuniqueid'];this[_0xb729('0x26')]=_0x18fd5c['callbackat'];this[_0xb729('0x27')]=_0x18fd5c[_0xb729('0x27')];this[_0xb729('0x28')]=_0x18fd5c[_0xb729('0x28')];this['ListId']=_0x18fd5c['ListId'];this[_0xb729('0x29')]=_0x18fd5c[_0xb729('0x29')];this[_0xb729('0x2a')]=_0x18fd5c[_0xb729('0x2a')];this[_0xb729('0x2b')]=_0x18fd5c[_0xb729('0x2b')];}module[_0xb729('0x2c')]=Hangup; \ No newline at end of file +var _0xa6e0=['starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum'];(function(_0x2f1a51,_0x3c1f80){var _0x581809=function(_0x190b5c){while(--_0x190b5c){_0x2f1a51['push'](_0x2f1a51['shift']());}};_0x581809(++_0x3c1f80);}(_0xa6e0,0x91));var _0x0a6e=function(_0x43924d,_0x222997){_0x43924d=_0x43924d-0x0;var _0x518a61=_0xa6e0[_0x43924d];return _0x518a61;};'use strict';var util=require(_0x0a6e('0x0'));var _=require(_0x0a6e('0x1'));var moment=require(_0x0a6e('0x2'));function getSeconds(_0x23678a,_0xb07315){var _0x8cef6=moment(_0x23678a)[_0x0a6e('0x3')](0x0);var _0x2438ef=moment(_0xb07315)[_0x0a6e('0x3')](0x0);return _0x8cef6[_0x0a6e('0x4')](_0x2438ef,_0x0a6e('0x5'));}function Hangup(_0x4a7601,_0xd40c38){this[_0x0a6e('0x6')]=0x4;this['statedesc']=_0x0a6e('0x7');this[_0x0a6e('0x8')]=_0x4a7601[_0x0a6e('0x8')];this[_0x0a6e('0x9')]=_0x4a7601[_0x0a6e('0x9')];this[_0x0a6e('0xa')]=_0x4a7601[_0x0a6e('0x9')]==='outbound'?_0x0a6e('0xb'):_0x4a7601[_0x0a6e('0x9')];this[_0x0a6e('0xc')]=_0x4a7601[_0x0a6e('0xc')];this[_0x0a6e('0xd')]=_0x4a7601['countcongestionretry'];this['countnoanswerretry']=_0x4a7601['countnoanswerretry'];this['countglobal']=_0x4a7601['countbusyretry']+_0x4a7601[_0x0a6e('0xd')]+_0x4a7601['countnoanswerretry']+_0x4a7601[_0x0a6e('0xe')]+_0x4a7601[_0x0a6e('0xf')]+_0x4a7601[_0x0a6e('0x10')]+_0x4a7601[_0x0a6e('0x11')]+_0x4a7601[_0x0a6e('0x12')];this[_0x0a6e('0xe')]=_0x4a7601[_0x0a6e('0xe')];this[_0x0a6e('0xf')]=_0x4a7601[_0x0a6e('0xf')];this['countabandonedretry']=_0x4a7601[_0x0a6e('0x10')];this[_0x0a6e('0x11')]=_0x4a7601[_0x0a6e('0x11')];this[_0x0a6e('0x12')]=_0x4a7601[_0x0a6e('0x12')];this[_0x0a6e('0x13')]=_0xd40c38['uniqueid'];this[_0x0a6e('0x14')]=_0x4a7601[_0x0a6e('0x15')];this[_0x0a6e('0x16')]=_0x4a7601['number'];this[_0x0a6e('0x17')]=_0x4a7601['starttime'];this[_0x0a6e('0x18')]=_0x4a7601[_0x0a6e('0x18')];this[_0x0a6e('0x19')]=moment()['format'](_0x0a6e('0x1a'));this[_0x0a6e('0x1b')]=getSeconds(_0x4a7601['responsetime'],_0x4a7601[_0x0a6e('0x17')]);this[_0x0a6e('0x1c')]=0x0;this[_0x0a6e('0x1d')]=getSeconds(this['endtime'],_0x4a7601[_0x0a6e('0x18')]);this['queue']=_0x4a7601[_0x0a6e('0xb')];this[_0x0a6e('0x1e')]=_0x0a6e('0x1f');this[_0x0a6e('0x20')]=_0xd40c38[_0x0a6e('0x21')];this[_0x0a6e('0x22')]=_0x4a7601[_0x0a6e('0x22')];this['callbackuniqueid']=_0x4a7601[_0x0a6e('0x23')];this['callbackat']=_0x4a7601[_0x0a6e('0x24')];this[_0x0a6e('0x25')]=_0x4a7601[_0x0a6e('0x25')];this[_0x0a6e('0x26')]=_0x4a7601['ContactId'];this['ListId']=_0x4a7601['ListId'];this[_0x0a6e('0x27')]=_0x4a7601[_0x0a6e('0x27')];this[_0x0a6e('0x28')]=_0x4a7601[_0x0a6e('0x28')];this[_0x0a6e('0x29')]=_0x4a7601[_0x0a6e('0x29')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b50b1c2..3c14d55 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 _0xab91=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash'];(function(_0x59df08,_0x5de18e){var _0x3128d5=function(_0x255087){while(--_0x255087){_0x59df08['push'](_0x59df08['shift']());}};_0x3128d5(++_0x5de18e);}(_0xab91,0x14b));var _0x1ab9=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0xab91[_0x414297];return _0x51ea47;};'use strict';var util=require(_0x1ab9('0x0'));var _=require(_0x1ab9('0x1'));var moment=require(_0x1ab9('0x2'));function getSeconds(_0x5b5f0b,_0x2a0aff){var _0x409d66=moment(_0x5b5f0b)['milliseconds'](0x0);var _0x1caf0d=moment(_0x2a0aff)[_0x1ab9('0x3')](0x0);return _0x409d66[_0x1ab9('0x4')](_0x1caf0d,_0x1ab9('0x5'));}function History(_0x3f00da){this[_0x1ab9('0x6')]=_0x3f00da['uniqueid'];this['scheduledat']=_0x3f00da[_0x1ab9('0x7')]||undefined;this['type']=_0x3f00da[_0x1ab9('0x8')];this['campaigntype']=_0x3f00da[_0x1ab9('0x8')]===_0x1ab9('0x9')?_0x1ab9('0xa'):_0x3f00da[_0x1ab9('0x8')];this[_0x1ab9('0xb')]=_0x3f00da[_0x1ab9('0xb')];this[_0x1ab9('0xc')]=_0x3f00da[_0x1ab9('0xc')];this[_0x1ab9('0xd')]=_0x3f00da[_0x1ab9('0xd')];this['countglobal']=_0x3f00da[_0x1ab9('0xb')]+_0x3f00da[_0x1ab9('0xc')]+_0x3f00da[_0x1ab9('0xd')]+_0x3f00da[_0x1ab9('0xe')]+_0x3f00da[_0x1ab9('0xf')]+_0x3f00da[_0x1ab9('0x10')]+_0x3f00da[_0x1ab9('0x11')]+_0x3f00da['countagentrejectretry'];this[_0x1ab9('0xe')]=_0x3f00da['countnosuchnumberretry'];this[_0x1ab9('0xf')]=_0x3f00da['countdropretry'];this['countabandonedretry']=_0x3f00da[_0x1ab9('0x10')];this['countmachineretry']=_0x3f00da['countmachineretry'];this[_0x1ab9('0x12')]=_0x3f00da['countagentrejectretry'];this['queue']=_0x3f00da[_0x1ab9('0xa')];this[_0x1ab9('0x13')]=_0x3f00da['name'];this[_0x1ab9('0x14')]=_0x3f00da['number'];this[_0x1ab9('0x15')]=_0x3f00da[_0x1ab9('0x15')];this[_0x1ab9('0x16')]=_0x3f00da['responsetime'];this[_0x1ab9('0x17')]=_0x3f00da[_0x1ab9('0x16')];this[_0x1ab9('0x18')]=getSeconds(_0x3f00da[_0x1ab9('0x16')],_0x3f00da[_0x1ab9('0x15')]);this[_0x1ab9('0x19')]=0x0;this[_0x1ab9('0x1a')]=0x0;this['callback']=_0x3f00da[_0x1ab9('0x1b')];this[_0x1ab9('0x1c')]=_0x3f00da[_0x1ab9('0x1c')];this[_0x1ab9('0x1d')]=_0x3f00da['callbackat'];this[_0x1ab9('0x1e')]=_0x3f00da[_0x1ab9('0x1e')];this[_0x1ab9('0x1f')]=_0x3f00da['ContactId'];this[_0x1ab9('0x20')]=_0x3f00da[_0x1ab9('0x20')];this['UserId']=_0x3f00da[_0x1ab9('0x21')];this[_0x1ab9('0x22')]=_0x3f00da[_0x1ab9('0x22')];this[_0x1ab9('0x23')]=_0x3f00da[_0x1ab9('0x23')];this[_0x1ab9('0x24')]=_0x3f00da[_0x1ab9('0x24')]||'';this['originatecalleridname']=_0x3f00da['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file +var _0x807a=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','starttime','responsetime','endtime','ringtime','holdtime'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x807a,0x158));var _0xa807=function(_0x47b0f6,_0x15ed84){_0x47b0f6=_0x47b0f6-0x0;var _0x15b5b0=_0x807a[_0x47b0f6];return _0x15b5b0;};'use strict';var util=require(_0xa807('0x0'));var _=require(_0xa807('0x1'));var moment=require('moment');function getSeconds(_0x1831d8,_0x11870a){var _0x2eb3ad=moment(_0x1831d8)[_0xa807('0x2')](0x0);var _0x53b55c=moment(_0x11870a)[_0xa807('0x2')](0x0);return _0x2eb3ad[_0xa807('0x3')](_0x53b55c,_0xa807('0x4'));}function History(_0x590d98){this[_0xa807('0x5')]=_0x590d98[_0xa807('0x5')];this[_0xa807('0x6')]=_0x590d98[_0xa807('0x6')]||undefined;this['type']=_0x590d98[_0xa807('0x7')];this[_0xa807('0x8')]=_0x590d98[_0xa807('0x7')]===_0xa807('0x9')?_0xa807('0xa'):_0x590d98[_0xa807('0x7')];this[_0xa807('0xb')]=_0x590d98['countbusyretry'];this[_0xa807('0xc')]=_0x590d98[_0xa807('0xc')];this[_0xa807('0xd')]=_0x590d98[_0xa807('0xd')];this[_0xa807('0xe')]=_0x590d98[_0xa807('0xb')]+_0x590d98[_0xa807('0xc')]+_0x590d98[_0xa807('0xd')]+_0x590d98[_0xa807('0xf')]+_0x590d98['countdropretry']+_0x590d98[_0xa807('0x10')]+_0x590d98[_0xa807('0x11')]+_0x590d98[_0xa807('0x12')];this[_0xa807('0xf')]=_0x590d98[_0xa807('0xf')];this[_0xa807('0x13')]=_0x590d98[_0xa807('0x13')];this[_0xa807('0x10')]=_0x590d98[_0xa807('0x10')];this[_0xa807('0x11')]=_0x590d98['countmachineretry'];this['countagentrejectretry']=_0x590d98['countagentrejectretry'];this[_0xa807('0xa')]=_0x590d98[_0xa807('0xa')];this['calleridname']=_0x590d98[_0xa807('0x14')];this['calleridnum']=_0x590d98['number'];this[_0xa807('0x15')]=_0x590d98['starttime'];this[_0xa807('0x16')]=_0x590d98[_0xa807('0x16')];this[_0xa807('0x17')]=_0x590d98[_0xa807('0x16')];this[_0xa807('0x18')]=getSeconds(_0x590d98[_0xa807('0x16')],_0x590d98[_0xa807('0x15')]);this[_0xa807('0x19')]=0x0;this['talktime']=0x0;this[_0xa807('0x1a')]=_0x590d98[_0xa807('0x1a')];this['callbackuniqueid']=_0x590d98[_0xa807('0x1b')];this[_0xa807('0x1c')]=_0x590d98[_0xa807('0x1c')];this['recallme']=_0x590d98[_0xa807('0x1d')];this['ContactId']=_0x590d98[_0xa807('0x1e')];this[_0xa807('0x1f')]=_0x590d98[_0xa807('0x1f')];this['UserId']=_0x590d98[_0xa807('0x20')];this['VoiceQueueId']=_0x590d98[_0xa807('0x21')];this[_0xa807('0x22')]=_0x590d98[_0xa807('0x22')];this['originatecalleridnum']=_0x590d98['originatecalleridnum']||'';this[_0xa807('0x23')]=_0x590d98[_0xa807('0x23')]||'';}module[_0xa807('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 5556b45..7560dab 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 _0x149c=['statedesc','HangupInAMD','membername','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','state','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','reason19\x20machine....','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','syncNewExten','roundrobin','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','launchHandleIvr','\x5cw{0,','pow','replace','random','match','actionOriginate','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','object','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','reason','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','getContactDialer','ACTIVE','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Ts\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','env','127.0.0.1','rrmemory','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','originateresponse','bind','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','stringify','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','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','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','inspect','error','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','moveContactManagedDialer','uniqueId','uniqueid','variable','xcally-motion-dialer','dialAMDActive','value','HANGUP'];(function(_0x1d08cf,_0x39cbd3){var _0x409854=function(_0x6e816c){while(--_0x6e816c){_0x1d08cf['push'](_0x1d08cf['shift']());}};_0x409854(++_0x39cbd3);}(_0x149c,0x143));var _0xc149=function(_0x1961dc,_0x2f5130){_0x1961dc=_0x1961dc-0x0;var _0x1a83f1=_0x149c[_0x1961dc];return _0x1a83f1;};'use strict';var util=require(_0xc149('0x0'));var _=require('lodash');var BPromise=require(_0xc149('0x1'));var uuid=require(_0xc149('0x2'));var moment=require(_0xc149('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xc149('0x4'));var ut=require(_0xc149('0x5'));var config=require(_0xc149('0x6'));var logger=require(_0xc149('0x7'))(_0xc149('0x8'));var loggerBooked=require(_0xc149('0x7'))(_0xc149('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0xc149('0x7'))(_0xc149('0xa'));var loggerSyncQueueSummary=require(_0xc149('0x7'))(_0xc149('0xb'));var ami=require(_0xc149('0xc'));config[_0xc149('0xd')]=_[_0xc149('0xe')](config[_0xc149('0xd')],{'host':_0xc149('0xf'),'port':0x18eb});var io=require(_0xc149('0x10'))(new Redis(config[_0xc149('0xd')]));var cmHopper=require(_0xc149('0x11'));var cmHopperHistory=require(_0xc149('0x12'));var cmHopperBlack=require(_0xc149('0x13'));var voiceQueueRt=require(_0xc149('0x14'));var Action=require(_0xc149('0x15'));var History=require(_0xc149('0x16'));var Final=require(_0xc149('0x17'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xc149('0x18'));var Hangup=require('./hangup');var ipAgi=process[_0xc149('0x19')]['XCALLY_IP_AGI']||_0xc149('0x1a');var strategy={'rrmemory':_0xc149('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0xc149('0x1c')]=function(_0xd4bc13){this[_0xc149('0x1d')]=this[_0xc149('0x1d')]?this[_0xc149('0x1d')][_0xc149('0x1e')](_0xd4bc13):_0xd4bc13();};function Dialer(_0x4f8562,_0x43269e){this[_0xc149('0x1f')]=new Sequence();this[_0xc149('0x20')]=_0x43269e;this[_0xc149('0x21')]=_0x4f8562[_0xc149('0x21')];this['campaigns']=_0x4f8562[_0xc149('0x22')];this[_0xc149('0x23')]=_0x4f8562[_0xc149('0x23')];this[_0xc149('0x24')]=_0x4f8562[_0xc149('0x24')];this[_0xc149('0x25')]=config['maxNumberOriginate']||0x2;this[_0xc149('0x26')]={};this[_0xc149('0x27')]={};this['contactsId']={};this['uniqueId']={};this[_0xc149('0x28')]={};this[_0xc149('0x29')]={};this[_0xc149('0x2a')]={};this[_0xc149('0x2b')]={};this[_0xc149('0x2c')]={};this[_0xc149('0x2d')]={};ami['on'](_0xc149('0x2e'),this['syncAgentConnect']['bind'](this));ami['on'](_0xc149('0x2f'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xc149('0x30'),this['syncOriginateResponse'][_0xc149('0x31')](this));ami['on']('agentcomplete',this[_0xc149('0x32')][_0xc149('0x31')](this));ami['on'](_0xc149('0x33'),this[_0xc149('0xb')][_0xc149('0x31')](this));ami['on'](_0xc149('0x34'),this[_0xc149('0x35')]['bind'](this));ami['on'](_0xc149('0x36'),this['syncNewExten'][_0xc149('0x31')](this));ami['on'](_0xc149('0x37'),this[_0xc149('0x38')][_0xc149('0x31')](this));ami['on'](_0xc149('0x39'),this[_0xc149('0x3a')][_0xc149('0x31')](this));ami['on'](_0xc149('0x3b'),this[_0xc149('0x3c')][_0xc149('0x31')](this));this[_0xc149('0x3d')]();this['loopClearZombieChannels']();}function isNotNull(_0x7b9227){return _0x7b9227!==null&&!_[_0xc149('0x3e')](_0x7b9227);}function checkIsLoggedIn(_0x576629,_0x1c8fd5){return function(){if(_0x1c8fd5<=0x0){_0x576629['message']=_0xc149('0x3f');throw _0x576629[_0xc149('0x40')]+_0xc149('0x41');}};}function isActive(_0x19f130){return _0x19f130;}function checkIsActive(_0x217e18,_0x3d9e80){return function(){if(!isActive(_0x3d9e80)){_0x217e18[_0xc149('0x42')]=_0xc149('0x43');throw _0x217e18[_0xc149('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4440be){return function(){if(!isNotNull(_0x4440be[_0xc149('0x44')])){_0x4440be['message']=_0xc149('0x45');throw _0x4440be[_0xc149('0x40')]+_0xc149('0x46');}if(!isNotNull(_0x4440be['Interval'][_0xc149('0x47')])){_0x4440be[_0xc149('0x42')]=_0xc149('0x45');throw _0x4440be[_0xc149('0x40')]+_0xc149('0x46');}if(!isNotNull(_['isEmpty'](_0x4440be['Interval'][_0xc149('0x47')]))){_0x4440be['message']=_0xc149('0x45');throw _0x4440be[_0xc149('0x40')]+_0xc149('0x46');}};}function msgResponse(_0x2b53aa,_0x26081,_0x28541e){return{'action':_0x2b53aa,'response':_0x26081,'message':_0x28541e,'stack':_0x28541e};}function myreject(_0xceccf9){return function(_0x26151c){return _0xceccf9(msgResponse(_0xc149('0x48'),_0xc149('0x49'),JSON['stringify'](_0x26151c)));};}function getSeconds(_0x1b361e,_0x2c396d){var _0x345ad7=moment(_0x1b361e)[_0xc149('0x4a')](0x0);var _0x24d5f3=moment(_0x2c396d)[_0xc149('0x4a')](0x0);return _0x345ad7[_0xc149('0x4b')](_0x24d5f3,_0xc149('0x4c'));}function emit(_0x2e15e0,_0x420645,_0x4e34e4){io['to'](_0x2e15e0)[_0xc149('0x4d')](_0x420645,_0x4e34e4);}function emitVoiceQueueSummary(_0x507596){if(_0x507596['type']==='outbound'){var _0x5390db={'id':_0x507596['id'],'name':_0x507596[_0xc149('0x40')],'strategy':_0x507596[_0xc149('0x4e')],'answered':_0x507596[_0xc149('0x4f')],'available':_0x507596[_0xc149('0x50')],'loggedIn':_0x507596[_0xc149('0x51')],'pTalking':_0x507596[_0xc149('0x52')],'sumBillable':_0x507596[_0xc149('0x53')],'sumDuration':_0x507596[_0xc149('0x54')],'sumHoldTime':_0x507596['sumHoldTime']||0x0,'talking':_0x507596[_0xc149('0x55')],'total':_0x507596[_0xc149('0x56')],'type':_0x507596[_0xc149('0x57')],'unmanaged':_0x507596['unmanaged'],'abandoned':_0x507596[_0xc149('0x58')],'waiting':_0x507596[_0xc149('0x59')],'loggedInDb':_0x507596[_0xc149('0x5a')],'dialActive':_0x507596[_0xc149('0x5b')],'dialMethod':_0x507596['dialMethod'],'dialOriginateCallerIdName':_0x507596[_0xc149('0x5c')],'dialOriginateCallerIdNumber':_0x507596[_0xc149('0x5d')],'dialOriginateTimeout':_0x507596[_0xc149('0x5e')],'dialPrefix':_0x507596[_0xc149('0x5f')],'outboundAnswerAgiCallsDay':_0x507596[_0xc149('0x60')],'outboundAnswerCallsDay':_0x507596['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x507596[_0xc149('0x61')],'outboundBusyCallsDay':_0x507596[_0xc149('0x62')],'outboundCongestionCallsDay':_0x507596[_0xc149('0x63')],'outboundDropCallsDayACS':_0x507596[_0xc149('0x64')],'outboundDropCallsDayCallersExit':_0x507596[_0xc149('0x65')],'outboundDropCallsDayTimeout':_0x507596['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x507596[_0xc149('0x66')],'outboundNoSuchCallsDay':_0x507596[_0xc149('0x67')],'outboundOriginateFailureCallsDay':_0x507596[_0xc149('0x68')],'outboundReCallsDay':_0x507596[_0xc149('0x69')],'outboundRejectCallsDay':_0x507596[_0xc149('0x6a')],'outboundUnknownCallsDay':_0x507596[_0xc149('0x6b')],'predictiveIntervalAnsweredCalls':_0x507596[_0xc149('0x6c')],'predictiveIntervalAvgHoldtime':_0x507596[_0xc149('0x6d')],'predictiveIntervalAvgTalktime':_0x507596['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x507596[_0xc149('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x507596[_0xc149('0x6f')],'predictiveIntervalErlangCalls':_0x507596['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x507596['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x507596[_0xc149('0x70')],'predictiveIntervalMultiplicativeFactor':_0x507596[_0xc149('0x71')],'predictiveIntervalPauses':_0x507596['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x507596[_0xc149('0x72')],'predictiveIntervalTotalCalls':_0x507596[_0xc149('0x73')],'message':_0x507596[_0xc149('0x42')],'originated':_0x507596[_0xc149('0x74')],'erlangCalls':_0x507596['erlangCalls'],'erlangCallToSecond':_0x507596[_0xc149('0x75')],'erlangAbandonmentRate':_0x507596[_0xc149('0x76')],'erlangBusyFactor':_0x507596[_0xc149('0x77')],'startPredictive':_0x507596[_0xc149('0x29')],'startProgressive':_0x507596[_0xc149('0x2a')]};if(_0x507596['Trunk']){_0x5390db[_0xc149('0x78')]={'id':_0x507596[_0xc149('0x78')]['id'],'name':_0x507596[_0xc149('0x78')][_0xc149('0x40')],'active':_0x507596[_0xc149('0x78')][_0xc149('0x79')],'callerid':_0x507596[_0xc149('0x78')]['callerid']};}if(_0x507596[_0xc149('0x44')]){_0x5390db[_0xc149('0x44')]={'id':_0x507596[_0xc149('0x44')]['id'],'name':_0x507596[_0xc149('0x44')][_0xc149('0x40')]};}var _0x5c2f59=md5(JSON[_0xc149('0x7a')](_0x5390db));if(_0x507596[_0xc149('0x7b')]!==_0x5c2f59){_0x507596['md5']=_0x5c2f59;emit(util[_0xc149('0x7c')](_0xc149('0x7d'),_0x5390db[_0xc149('0x40')]),_0xc149('0x7e'),_0x5390db);}}}function emitCampaignSummary(_0x1fb432){if(_0x1fb432[_0xc149('0x57')]===_0xc149('0x7f')){emit(util[_0xc149('0x7c')](_0xc149('0x80'),_0x1fb432[_0xc149('0x40')]),_0xc149('0x81'),_0x1fb432);}}function checkGetDataPredictive(_0x2c88e6){if(isNotNull(_0x2c88e6)&&!_[_0xc149('0x82')](_0x2c88e6)){loggerPredictive[_0xc149('0x83')](_0xc149('0x84'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c88e6['predictiveIntervalTotalCalls']);loggerPredictive[_0xc149('0x83')](_0xc149('0x85'),_0x2c88e6[_0xc149('0x6c')]);loggerPredictive['info'](_0xc149('0x86'),_0x2c88e6[_0xc149('0x6f')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x87'),_0x2c88e6[_0xc149('0x6e')]);loggerPredictive['info'](_0xc149('0x88'),_0x2c88e6['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xc149('0x89'),_0x2c88e6[_0xc149('0x8a')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x8b'));if(_0x2c88e6[_0xc149('0x73')]>0x0){if(!_[_0xc149('0x3e')](_0x2c88e6['predictiveIntervalAvgTalktime'])&&_0x2c88e6[_0xc149('0x8a')]>0x0){return!![];}loggerPredictive[_0xc149('0x83')](_0xc149('0x8c'));if(!_['isUndefined'](_0x2c88e6[_0xc149('0x6d')])&&_0x2c88e6[_0xc149('0x6d')]>0x0){return!![];}loggerPredictive[_0xc149('0x83')](_0xc149('0x8d'));}else{loggerPredictive[_0xc149('0x83')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xc149('0x83')](_0xc149('0x8e'));}return![];}function mergeDataErlangB(_0xe4e626){return function(_0x52ef1c){loggerPredictive[_0xc149('0x83')](_0xc149('0x8f'));loggerPredictive[_0xc149('0x83')](_0xc149('0x90'),_0x52ef1c[_0xc149('0x91')]);loggerPredictive['info'](_0xc149('0x92'),_0x52ef1c[_0xc149('0x75')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x93'),_0x52ef1c[_0xc149('0x76')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x94'),_0x52ef1c[_0xc149('0x77')]);loggerPredictive['info'](_0xc149('0x93'),_0x52ef1c['erlangAbandonmentRate']);loggerPredictive['info'](_0xc149('0x8b'));_[_0xc149('0x95')](_0xe4e626,_0x52ef1c);};}function getDiff(_0x410ced){var _0x2573af=moment()['milliseconds'](0x0);var _0x42a604=moment(_0x410ced)[_0xc149('0x4a')](0x0);return _0x2573af[_0xc149('0x4b')](_0x42a604,_0xc149('0x4c'));}function ifInterval(_0x1d6233,_0x31ce7b){if(_[_0xc149('0x3e')](_0x31ce7b)){return![];}return getDiff(_0x31ce7b)<_0x1d6233*0x3c;}function freeVariablesPredictive(_0x21d1a2){if(isNotNull(_0x21d1a2)){if(!_['isUndefined'](_0x21d1a2[_0xc149('0x2a')])){_0x21d1a2[_0xc149('0x2a')]=undefined;loggerPredictive[_0xc149('0x83')](_0x21d1a2['name'],_0xc149('0x96'));}if(!_['isUndefined'](_0x21d1a2[_0xc149('0x29')])){_0x21d1a2[_0xc149('0x29')]=undefined;loggerPredictive[_0xc149('0x83')](_0x21d1a2['name'],_0xc149('0x97'));}if(!_[_0xc149('0x3e')](_0x21d1a2['handlePredictive'])){clearInterval(_0x21d1a2[_0xc149('0x98')]);_0x21d1a2['handlePredictive']=undefined;loggerPredictive['info'](_0x21d1a2[_0xc149('0x40')],_0xc149('0x99'));}}}function erlangb(_0x3f2cd7,_0x531a2c){if(_0x531a2c===0x0){return 0x0;}var _0x28958a=0x1;for(var _0x2feeff=0x1;_0x2feeff<=_0x531a2c;_0x2feeff+=0x1){_0x28958a=0x1+_0x28958a*_0x2feeff/_0x3f2cd7;}return 0x1/_0x28958a;}function isVoiceQueueOutbound(_0x19ed54){return _0x19ed54==='outbound';}function isNotPreview(_0x4b3225){return _0x4b3225!==_0xc149('0x20');}function isCampaignIvr(_0xbe4c5){return _0xbe4c5==='ivr';}function getCallerId(_0x16990d,_0x181b42,_0x419045){if(!_[_0xc149('0x3e')](_0x419045)&&typeof _0x419045==='string'&&!_[_0xc149('0x82')](_0x419045)){if(!_[_0xc149('0x3e')](_0x181b42)&&typeof _0x181b42===_0xc149('0x9a')&&!_[_0xc149('0x82')](_0x181b42)){return util[_0xc149('0x7c')](_0xc149('0x9b'),_0x181b42,_0x419045);}return util[_0xc149('0x7c')](_0xc149('0x9b'),_0x419045,_0x419045);}if(!_[_0xc149('0x3e')](_0x16990d)&&typeof _0x16990d===_0xc149('0x9a')&&!_[_0xc149('0x82')](_0x16990d)){return _0x16990d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x546d1b,_0x5ab75e){return function(_0x39535c){freeVariablesPredictive(_0x5ab75e);emitVoiceQueueSummary(_0x5ab75e);emitCampaignSummary(_0x5ab75e);loggerSyncQueueSummary['error'](_0x546d1b,util[_0xc149('0x9c')](_0x39535c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x27ca68,_0x1a9afe){return function(_0x3d80c7){loggerPredictive[_0xc149('0x9d')](_0x1a9afe[_0xc149('0x40')],_0x27ca68);loggerPredictive[_0xc149('0x9d')](_0x3d80c7[_0xc149('0x9e')]);freeVariablesPredictive(_0x1a9afe);};}function loggerCatch(_0x4ad74c){return function(_0x55e378){logger['error'](_0x4ad74c,util['inspect'](_0x55e378,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x296494){return _0x296494&&!_[_0xc149('0x3e')](_0x296494)&&_0x296494[_0xc149('0x9f')]>0x0;}function decremetOriginate(_0xaed35a){if(!_[_0xc149('0x3e')](_0xaed35a)&&_0xaed35a!==null){if(typeof _0xaed35a[_0xc149('0x74')]!==_0xc149('0xa0')){if(_0xaed35a[_0xc149('0x74')]>0x0){_0xaed35a['originated']-=0x1;}else{logger[_0xc149('0x9d')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0xc149('0xa1'));}}function checkContactLowerLimitOriginate(_0x570f49,_0x408369,_0x42f65d){if(_0x408369>_0x42f65d){for(var _0x3bf5b6=0x0;_0x3bf5b6<_0x408369-_0x42f65d;_0x3bf5b6+=0x1){decremetOriginate(_0x570f49);}}}function loggerGetContactDialer(_0x5c15be,_0x234cee,_0x4005d2){return function(_0x3dd56f){checkContactLowerLimitOriginate(_0x234cee,_0x4005d2,0x0);logger[_0xc149('0x9d')](_0x5c15be,util[_0xc149('0x9c')](_0x3dd56f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x55841c){return function(_0x2d02d0){if(isNotNull(_0x2d02d0)&&isNotNull(_0x2d02d0[0x0])){if(_0x2d02d0[0x0][_0xc149('0xa2')]>0x0){_0x55841c[_0xc149('0x42')]=_0xc149('0xa3');logger['info'](_0xc149('0xa4')+_0x55841c[_0xc149('0x40')],_0x2d02d0[0x0][_0xc149('0xa2')],_0xc149('0xa5'));}else{_0x55841c[_0xc149('0x42')]=_0xc149('0xa6');logger[_0xc149('0x83')](_0xc149('0xa7')+_0x55841c[_0xc149('0x40')]);}}};}function notSendMessagesQueue(_0x59f59b){if(_0x59f59b['sendMessageOneNotActive']){freeVariablesPredictive(_0x59f59b);if(_0x59f59b[_0xc149('0x74')]===0x0&&_0x59f59b['talking']===0x0&&_0x59f59b[_0xc149('0x59')]===0x0&&(_0x59f59b[_0xc149('0x52')]||0x0)===0x0){_0x59f59b[_0xc149('0xa8')]=![];_0x59f59b[_0xc149('0x50')]=0x0;_0x59f59b[_0xc149('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xc149('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x59f59b[_0xc149('0x40')],'is\x20not\x20active');}else{_0x59f59b['message']='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xc149('0xa9'),_0x59f59b[_0xc149('0x40')],_0xc149('0xaa'));}emitVoiceQueueSummary(_0x59f59b);}}function notSendMessagesCampaign(_0x53fb2b){if(_0x53fb2b['sendMessageOneNotActive']){if(_0x53fb2b['originated']===0x0){_0x53fb2b[_0xc149('0xa8')]=![];_0x53fb2b[_0xc149('0x42')]=_0xc149('0x43');loggerSyncQueueSummary[_0xc149('0x9d')](_0xc149('0xab'),_0x53fb2b['name'],_0xc149('0xac'));}else{_0x53fb2b[_0xc149('0x42')]=_0xc149('0xad');loggerSyncQueueSummary[_0xc149('0x9d')](_0xc149('0xab'),_0x53fb2b['name'],_0xc149('0xaa'));}emitCampaignSummary(_0x53fb2b);}}function createObjHistory(_0x1325e5,_0x1ebe82,_0x3a6f6e,_0x57c452,_0x5479ed){_0x1325e5[_0xc149('0x42')]=_0x3a6f6e;var _0x31c5d8=new Action(_0x1325e5,_0x1ebe82);var _0x5f4f07=new History(_0x31c5d8);_0x5f4f07['state']=_0x57c452;_0x5f4f07['statedesc']=_0x5479ed;_0x5f4f07[_0xc149('0xae')]=_0x31c5d8[_0xc149('0xaf')];return _0x5f4f07;}Dialer[_0xc149('0xb0')]['loopClearZombieChannels']=function(){var _0x513f31=this;setInterval(function(){_0x513f31[_0xc149('0xb1')](_0x513f31['uniqueId'],_0xc149('0xb2'));_0x513f31[_0xc149('0xb1')](_0x513f31[_0xc149('0x27')],'[actions]');},0x32c8);};Dialer[_0xc149('0xb0')][_0xc149('0xb1')]=function(_0x2a6cb1,_0x32555f){var _0x1106e6=this;for(var _0x2442bd in _0x2a6cb1){if(typeof _0x2a6cb1[_0x2442bd]!==_0xc149('0xa0')){this[_0xc149('0x1f')][_0xc149('0x1c')](function(){if(!_[_0xc149('0xb3')](_0x2a6cb1[_0x2442bd])){return ami['Action']({'action':_0xc149('0xb4'),'channel':_0x2a6cb1[_0x2442bd][_0xc149('0xb5')]})[_0xc149('0xb6')](function(_0x2e01b6){if(_0x2e01b6[_0xc149('0x42')]===_0xc149('0xb7')){setTimeout(function(){if(_0x2a6cb1[_0x2442bd]&&_0x2a6cb1[_0x2442bd][_0xc149('0x57')]!=='ivr'){_0x1106e6[_0xc149('0xb8')](_0x1106e6[_0xc149('0x21')][_0x2a6cb1[_0x2442bd][_0xc149('0xb9')]]);logger[_0xc149('0x9d')](_0xc149('0xba'),_0x32555f,_0x2442bd,_0x2a6cb1[_0x2442bd][_0xc149('0xb9')]);delete _0x2a6cb1[_0x2442bd];}if(_0x2a6cb1[_0x2442bd]&&_0x2a6cb1[_0x2442bd][_0xc149('0x57')]===_0xc149('0x7f')){_0x1106e6[_0xc149('0xb8')](_0x1106e6[_0xc149('0x22')][_0x2a6cb1[_0x2442bd]['queue']]);logger[_0xc149('0x9d')](_0xc149('0xbb'),_0x32555f,_0x2442bd,_0x2a6cb1[_0x2442bd][_0xc149('0xb9')]);delete _0x2a6cb1[_0x2442bd];}},0x2328);}});}});}}};Dialer[_0xc149('0xb0')]['countReScheduled']=function(_0x51a2d6){return BPromise[_0xc149('0xbc')]()['then'](cmHopper[_0xc149('0xbd')](_0x51a2d6))[_0xc149('0xb6')](loggerCatch(_0xc149('0xbe')));};Dialer[_0xc149('0xb0')]['checkIsBlackList']=function(_0x2e369f){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopperBlack[_0xc149('0xc0')](_0x2e369f))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc1')));};Dialer[_0xc149('0xb0')][_0xc149('0xc2')]=function(_0x1ed557){return BPromise['resolve']()[_0xc149('0xbf')](cmHopperBlack[_0xc149('0xc2')](_0x1ed557))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc3')));};Dialer[_0xc149('0xb0')]['averageHandleTime']=function(_0x40e599){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopperHistory[_0xc149('0xc4')](_0x40e599))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc5')));};Dialer[_0xc149('0xb0')][_0xc149('0xc6')]=function(_0x3167e5){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopper[_0xc149('0xc6')](_0x3167e5))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc7')));};Dialer[_0xc149('0xb0')][_0xc149('0xc8')]=function(_0x1bf064,_0x312748,_0xb28e9c){return BPromise['resolve']()[_0xc149('0xbf')](cmHopper[_0xc149('0xc8')](_0x1bf064,_0x312748,_0xb28e9c))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc9')));};Dialer[_0xc149('0xb0')]['getContactDialer']=function(_0x1834f9,_0x256840,_0x5c6b7a,_0x544c59,_0x262945){return BPromise[_0xc149('0xbc')]()['then'](cmHopper['getContactDialer'](_0x1834f9,_0x256840,_0x5c6b7a,_0x544c59))[_0xc149('0xb6')](function(_0x3bf7d3){_0x262945['temp']-=_0x5c6b7a;_0x262945[_0xc149('0xca')]=_0x262945[_0xc149('0xca')]>0x0?_0x262945[_0xc149('0xca')]:0x0;loggerCatch(_0xc149('0xcb'))(_0x3bf7d3);});};Dialer[_0xc149('0xb0')][_0xc149('0xcc')]=function(_0x574224,_0x4aa974,_0x42d5fb,_0x51f4f1){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopper['getContactDialerIvr'](_0x574224,_0x4aa974,_0x42d5fb))['catch'](function(_0x3cd65a){_0x51f4f1[_0xc149('0xca')]-=_0x4aa974;_0x51f4f1[_0xc149('0xca')]=_0x51f4f1[_0xc149('0xca')]>0x0?_0x51f4f1[_0xc149('0xca')]:0x0;loggerCatch(_0xc149('0xcd'))(_0x3cd65a);});};Dialer[_0xc149('0xb0')]['getVoiceQueueRtPauses']=function(_0xd7252f){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](voiceQueueRt[_0xc149('0xce')](_0xd7252f))[_0xc149('0xb6')](loggerCatch(_0xc149('0xcf')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x1d1895){return BPromise['resolve']()[_0xc149('0xbf')](cmHopper['moveContactManagedDialer'](_0x1d1895))[_0xc149('0xb6')](loggerCatch(_0xc149('0xd0')));};Dialer['prototype']['createHistory']=function(_0x1ee47f){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopperHistory[_0xc149('0xd1')](_0x1ee47f))[_0xc149('0xb6')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0xc149('0xb8')]=function(_0xa076d9){if(!_[_0xc149('0x3e')](_0xa076d9)&&_0xa076d9!==null){if(typeof _0xa076d9[_0xc149('0x74')]!==_0xc149('0xa0')){if(_0xa076d9['originated']>0x0){_0xa076d9['originated']-=0x1;}else{logger[_0xc149('0x9d')](_0xc149('0xd2'));}}}else{logger[_0xc149('0x9d')](_0xc149('0xd3'));}};Dialer[_0xc149('0xb0')][_0xc149('0xd4')]=function(_0xae543b,_0xe1076b){var _0x3e558c=this;return function(_0x382f7b){_0x3e558c[_0xc149('0xb8')](_0xe1076b);logger[_0xc149('0x9d')](_0xae543b,util[_0xc149('0x9c')](_0x382f7b,{'showHidden':![],'depth':null}));};};Dialer[_0xc149('0xb0')][_0xc149('0xd5')]=function(_0x43165b,_0x39db02,_0x59849b){var _0x47fcf9={'state':0x19,'statedesc':_0xc149('0xd6')};this['updateOriginated'](_0x39db02);this['saveInDb'](_[_0xc149('0x95')](_0x47fcf9,_[_0xc149('0xd7')](_0x59849b,[_0xc149('0xd8'),_0xc149('0xd9'),_0xc149('0xda'),'VoiceQueueId',_0xc149('0xdb')])),_0xc149('0xdc'),_0xc149('0xdd'));logger[_0xc149('0x9d')](_0x43165b);};Dialer['prototype'][_0xc149('0xde')]=function(_0x381ce7){return _0x381ce7==='Success';};Dialer[_0xc149('0xb0')][_0xc149('0xdf')]=function(_0x10ce5a){return!_['isUndefined'](_0x10ce5a)&&_0x10ce5a&&!_[_0xc149('0x3e')](_0x10ce5a[_0xc149('0x40')])&&!_[_0xc149('0x3e')](_0x10ce5a[_0xc149('0x79')])&&_0x10ce5a[_0xc149('0x79')]&&(this[_0xc149('0x24')][util['format'](_0xc149('0xe0'),_0x10ce5a[_0xc149('0x40')])]['status']==='reachable'||this[_0xc149('0x24')][util['format'](_0xc149('0xe0'),_0x10ce5a['name'])][_0xc149('0xb4')]==='unmonitored');};Dialer[_0xc149('0xb0')]['saveInDb']=function(_0x40623b,_0x1226b5,_0xb0290d){this[_0xc149('0xd1')](_0x40623b)[_0xc149('0xb6')](loggerCatch(_0x1226b5));this[_0xc149('0xe1')](_0x40623b)['catch'](loggerCatch(_0xb0290d));};Dialer['prototype'][_0xc149('0x38')]=function(_0x1e6063){var _0x5176f8=this[_0xc149('0xe2')][_0x1e6063[_0xc149('0xe3')]];var _0x5c7288;if(!_[_0xc149('0xb3')](_0x1e6063)&&!_[_0xc149('0xb3')](_0x1e6063[_0xc149('0xe4')])&&!_[_0xc149('0xb3')](_0x1e6063['variable']['amdstatus'])&&_0x1e6063['exten']===_0xc149('0xe5')&&_0x5176f8){if(_0x5176f8[_0xc149('0x57')]!==_0xc149('0x7f')&&this[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063[_0xc149('0xe7')]===_0xc149('0xe8')){delete this['uniqueId'][_0x1e6063['uniqueid']];this[_0xc149('0xb8')](this['voiceQueues'][_0x5176f8[_0xc149('0xb9')]]);this[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;this[_0xc149('0x21')][_0x5176f8['queue']][_0xc149('0x60')]+=0x1;_0x5c7288=new Hangup(_0x5176f8,_0x1e6063);_0x5c7288['state']=0x12;_0x5c7288[_0xc149('0xe9')]=_0xc149('0xea');_0x5c7288[_0xc149('0xeb')]='AMD';ami[_0xc149('0x4d')](_0xc149('0xec'),ut[_0xc149('0xed')](_0x5c7288,'amd'));this[_0xc149('0xee')](_0x5c7288,_0xc149('0xef'),_0xc149('0xf0'));}if(_0x5176f8[_0xc149('0x57')]!=='ivr'&&this[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063['value']===_0xc149('0xf1')){var _0x2df90d=this;return new BPromise(function(_0x20c61f,_0x410f8f){delete _0x2df90d[_0xc149('0xe2')][_0x1e6063[_0xc149('0xe3')]];_0x2df90d['updateOriginated'](_0x2df90d['voiceQueues'][_0x5176f8['queue']]);_0x2df90d[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x2df90d['voiceQueues'][_0x5176f8[_0xc149('0xb9')]][_0xc149('0x60')]+=0x1;var _0x4bc140=_0x2df90d[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]];var _0xf3896=new Hangup(_0x5176f8,_0x1e6063);_0xf3896['state']=0x13;_0xf3896['statedesc']=_0xc149('0xf2');_0xf3896[_0xc149('0xeb')]='AMD';_0xf3896['countmachineretry']+=0x1;_0xf3896[_0xc149('0xf3')]+=0x1;_0xf3896[_0xc149('0xf4')]=!![];ami[_0xc149('0x4d')](_0xc149('0xec'),ut[_0xc149('0xed')](_0xf3896,_0xc149('0xf4')));_0x2df90d[_0xc149('0xd1')](_0xf3896)[_0xc149('0xb6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xf3896[_0xc149('0xf5')]+_0xf3896[_0xc149('0xf6')]+_0xf3896[_0xc149('0xf7')]+_0xf3896[_0xc149('0xf8')]+_0xf3896[_0xc149('0xf9')]+_0xf3896[_0xc149('0xfa')]+_0xf3896['countmachineretry']+_0xf3896[_0xc149('0xfb')]>=_0x4bc140['dialGlobalMaxRetry']){_0x2df90d[_0xc149('0xfc')](_0xf3896,_0x20c61f,_0x410f8f,'reason19\x20machine....');}else{if(_0xf3896[_0xc149('0xfd')]>=_0x4bc140[_0xc149('0xfe')]){_0x2df90d[_0xc149('0xff')](_0xf3896,_0x20c61f,_0x410f8f,_0xc149('0x100'));}else{_0x2df90d['rescheduleContact']({'active':![],'countmachineretry':_0xf3896[_0xc149('0xfd')],'scheduledat':moment()[_0xc149('0x101')](_0x4bc140['dialMachineRetryFrequency'],'minutes')[_0xc149('0x7c')](_0xc149('0x102')),'ContactId':_0xf3896['ContactId'],'ListId':_0xf3896[_0xc149('0xd9')],'VoiceQueueId':_0xf3896[_0xc149('0x103')]||undefined,'CampaignId':_0xf3896[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x104')));_0x20c61f({'reschedule':0x1});}}});}if(_0x5176f8[_0xc149('0x57')]===_0xc149('0x7f')&&this[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063[_0xc149('0xe7')]===_0xc149('0xe8')){delete this['uniqueId'][_0x1e6063[_0xc149('0xe3')]];this[_0xc149('0xb8')](this['campaigns'][_0x5176f8[_0xc149('0xb9')]]);_0x5c7288=new Hangup(_0x5176f8,_0x1e6063);_0x5c7288['state']=0x12;_0x5c7288[_0xc149('0xe9')]=_0xc149('0xea');_0x5c7288[_0xc149('0xeb')]=_0xc149('0x105');ami[_0xc149('0x4d')](_0xc149('0xec'),ut[_0xc149('0xed')](_0x5c7288,_0xc149('0xf4')));this[_0xc149('0xee')](_0x5c7288,_0xc149('0x106'),_0xc149('0x107'));}if(_0x5176f8[_0xc149('0x57')]==='ivr'&&this[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063[_0xc149('0xe7')]===_0xc149('0xf1')){var _0x2df90d=this;return new BPromise(function(_0xafff07,_0x2c59f9){delete _0x2df90d[_0xc149('0xe2')][_0x1e6063['uniqueid']];_0x2df90d[_0xc149('0xb8')](_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]]);_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0x60')]+=0x1;var _0x33232c=_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]];var _0x426883=new Hangup(_0x5176f8,_0x1e6063);_0x426883[_0xc149('0x108')]=0x13;_0x426883['statedesc']=_0xc149('0xf2');_0x426883[_0xc149('0xeb')]=_0xc149('0x105');_0x426883[_0xc149('0xfd')]+=0x1;_0x426883[_0xc149('0xf3')]+=0x1;_0x426883[_0xc149('0xf4')]=!![];ami[_0xc149('0x4d')](_0xc149('0xec'),ut['buildObj'](_0x426883,'amd'));_0x2df90d['createHistory'](_0x426883)[_0xc149('0xb6')](loggerCatch(_0xc149('0x109')));if(_0x426883['countbusyretry']+_0x426883['countcongestionretry']+_0x426883[_0xc149('0xf7')]+_0x426883[_0xc149('0xf8')]+_0x426883['countdropretry']+_0x426883[_0xc149('0xfa')]+_0x426883[_0xc149('0xfd')]+_0x426883['countagentrejectretry']>=_0x33232c[_0xc149('0x10a')]){_0x2df90d[_0xc149('0xfc')](_0x426883,_0xafff07,_0x2c59f9,_0xc149('0x10b'));}else{if(_0x426883[_0xc149('0xfd')]>=_0x33232c[_0xc149('0xfe')]){_0x2df90d['createStateFinal'](_0x426883,_0xafff07,_0x2c59f9,_0xc149('0x100'));}else{_0x2df90d[_0xc149('0xc6')]({'active':![],'countmachineretry':_0x426883[_0xc149('0xfd')],'scheduledat':moment()[_0xc149('0x101')](_0x33232c[_0xc149('0x10c')],'minutes')['format'](_0xc149('0x102')),'ContactId':_0x426883[_0xc149('0xd8')],'ListId':_0x426883['ListId'],'VoiceQueueId':_0x426883[_0xc149('0x103')]||undefined,'CampaignId':_0x426883[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][Machine]'));_0xafff07({'reschedule':0x1});}}});}}};Dialer[_0xc149('0xb0')][_0xc149('0x35')]=function(_0x811d6b){var _0x104be0=this[_0xc149('0xe2')][_0x811d6b[_0xc149('0xe3')]];var _0x535f1c=this;var _0x45db63;if(_0x104be0&&_0x104be0[_0xc149('0x57')]===_0xc149('0x7f')){delete this['uniqueId'][_0x811d6b[_0xc149('0xe3')]];this[_0xc149('0xb8')](this[_0xc149('0x22')][_0x104be0['queue']]);this[_0xc149('0x22')][_0x104be0[_0xc149('0xb9')]][_0xc149('0x10d')]+=0x1;_0x45db63=new Hangup(_0x104be0,_0x811d6b);this['createHistory'](_0x45db63)[_0xc149('0xb6')](loggerCatch(_0xc149('0x10e')));this[_0xc149('0xe1')](_0x45db63)[_0xc149('0xb6')](loggerCatch(_0xc149('0x10f')));}if(_0x104be0&&_0x104be0[_0xc149('0x57')]!==_0xc149('0x7f')&&isNotNull(this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]]['dialQueueProject'])){delete this['uniqueId'][_0x811d6b['uniqueid']];this[_0xc149('0xb8')](this['voiceQueues'][_0x104be0['queue']]);this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x104be0[_0xc149('0xb9')]][_0xc149('0x60')]+=0x1;_0x45db63=new Hangup(_0x104be0,_0x811d6b);_0x45db63[_0xc149('0x108')]=0x10;_0x45db63[_0xc149('0xe9')]=_0xc149('0x110');_0x45db63['membername']=_0xc149('0x111');this['createHistory'](_0x45db63)['catch'](loggerCatch(_0xc149('0x10e')));this['moveContactManagedDialer'](_0x45db63)[_0xc149('0xb6')](loggerCatch(_0xc149('0x10f')));}if(_0x104be0&&_0x104be0[_0xc149('0x57')]!==_0xc149('0x7f')&&!isNotNull(this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]][_0xc149('0x112')])){delete this[_0xc149('0xe2')][_0x811d6b[_0xc149('0xe3')]];this[_0xc149('0xb8')](this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]]);this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]][_0xc149('0x6b')]+=0x1;_0x45db63=new Hangup(_0x104be0,_0x811d6b);_0x45db63[_0xc149('0x108')]=0xc;_0x45db63[_0xc149('0xe9')]=_0x811d6b[_0xc149('0x113')];_0x45db63[_0xc149('0xeb')]=_0xc149('0x114');this[_0xc149('0xd1')](_0x45db63)[_0xc149('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc149('0xe1')](_0x45db63)[_0xc149('0xb6')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc149('0xb0')]['syncAgentComplete']=function(_0xa9123d){var _0x302fcc=this[_0xc149('0xe2')][_0xa9123d[_0xc149('0xe3')]];var _0x1ead91=this;if(this['voiceQueues'][_0xa9123d[_0xc149('0xb9')]]){if(_0x302fcc&&_0x302fcc[_0xc149('0x57')]!==_0xc149('0x7f')){delete this['uniqueId'][_0xa9123d[_0xc149('0xe3')]];this['voiceQueues'][_0xa9123d['queue']][_0xc149('0x115')]+=0x1;var _0x42ac94=new AgentComplete(_0x302fcc,_0xa9123d);if(_0xa9123d['reason']===_0xc149('0x116')){_0x42ac94[_0xc149('0x117')]=this[_0xc149('0x21')][_0xa9123d[_0xc149('0xb9')]][_0xc149('0x118')]&&this[_0xc149('0x21')][_0xa9123d[_0xc149('0xb9')]][_0xc149('0x119')]?moment()[_0xc149('0x7c')](_0xc149('0x102')):undefined;}this[_0xc149('0xd1')](_0x42ac94)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11a')));this[_0xc149('0xe1')](_0x42ac94)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11b')));}}};Dialer[_0xc149('0xb0')]['syncAgentConnect']=function(_0x56b090){if(this[_0xc149('0x21')][_0x56b090[_0xc149('0xb9')]]){if(this['uniqueId'][_0x56b090[_0xc149('0xe3')]]&&this[_0xc149('0xe2')][_0x56b090['uniqueid']]['type']!=='ivr'){this[_0xc149('0xb8')](this[_0xc149('0x21')][_0x56b090['queue']]);this['uniqueId'][_0x56b090[_0xc149('0xe3')]][_0xc149('0x11c')]=moment()[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xc149('0x11d')]=function(_0x2b14ae){this['createHistory'](_0x2b14ae)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11a')));this[_0xc149('0xe1')](_0x2b14ae)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11e')));};Dialer[_0xc149('0xb0')][_0xc149('0x11f')]=function(_0x2652d2){var _0x1f8113=this['uniqueId'][_0x2652d2['uniqueid']];var _0x2aa18f=this;if(this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]]){if(_0x1f8113&&_0x1f8113[_0xc149('0x57')]!==_0xc149('0x7f')){delete this[_0xc149('0xe2')][_0x2652d2[_0xc149('0xe3')]];this['updateOriginated'](this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]]);_0x1f8113[_0xc149('0x120')]=moment()[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4f8d61=new QueueCallerAbandon(_0x1f8113,_0x2652d2);if(getSeconds(_0x1f8113[_0xc149('0x120')],_0x1f8113[_0xc149('0x121')])>=_0x1f8113['dialQueueTimeout']){this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x6f')]+=0x1;this[_0xc149('0x21')][_0x2652d2['queue']][_0xc149('0x122')]+=0x1;this['voiceQueues'][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x123')]+=0x1;_0x4f8d61['state']=0xa;_0x4f8d61[_0xc149('0xe9')]=_0xc149('0x124');_0x4f8d61[_0xc149('0x125')]=_0xc149('0x126');_0x4f8d61[_0xc149('0x117')]=this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x118')]?moment()['format'](_0xc149('0x102')):undefined;_0x4f8d61[_0xc149('0xf9')]+=0x1;_0x4f8d61['countglobal']+=0x1;if(_0x4f8d61[_0xc149('0xf9')]>=this['voiceQueues'][_0x2652d2[_0xc149('0xb9')]]['dialDropMaxRetry']){this[_0xc149('0x11d')](_0x4f8d61);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4f8d61['countdropretry'],'scheduledat':moment()[_0xc149('0x101')](this[_0xc149('0x21')][_0x2652d2['queue']][_0xc149('0x127')],_0xc149('0x128'))[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1f8113[_0xc149('0xd8')],'ListId':_0x1f8113[_0xc149('0xd9')],'VoiceQueueId':_0x1f8113[_0xc149('0x103')]||undefined,'CampaignId':_0x1f8113[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x129')));var _0x364637=new History(_0x4f8d61);_0x364637[_0xc149('0x108')]=0xa;_0x364637[_0xc149('0xe9')]=_0xc149('0x124');_0x364637[_0xc149('0xaf')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));_0x364637[_0xc149('0xae')]=_0x364637[_0xc149('0xaf')];_0x364637[_0xc149('0x12a')]=_0x4f8d61[_0xc149('0x12a')];_0x364637['calleridnum']=_0x4f8d61[_0xc149('0x12b')];this[_0xc149('0xd1')](_0x364637)[_0xc149('0xb6')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x6e')]+=0x1;this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x65')]+=0x1;_0x4f8d61[_0xc149('0x108')]=0xb;_0x4f8d61[_0xc149('0xe9')]=_0xc149('0x12c');_0x4f8d61[_0xc149('0x125')]=_0xc149('0x12d');_0x4f8d61[_0xc149('0xfa')]+=0x1;_0x4f8d61[_0xc149('0xf3')]+=0x1;if(_0x4f8d61['countabandonedretry']>=this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x12e')]){this[_0xc149('0x11d')](_0x4f8d61);}else{this[_0xc149('0xc6')]({'active':![],'countabandonedretry':_0x4f8d61['countabandonedretry'],'scheduledat':moment()[_0xc149('0x101')](this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x12f')],_0xc149('0x128'))[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1f8113[_0xc149('0xd8')],'ListId':_0x1f8113[_0xc149('0xd9')],'VoiceQueueId':_0x1f8113[_0xc149('0x103')]||undefined,'CampaignId':_0x1f8113['CampaignId']||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x364637=new History(_0x4f8d61);_0x364637['state']=0xb;_0x364637[_0xc149('0xe9')]=_0xc149('0x12c');_0x364637['starttime']=moment()[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x364637[_0xc149('0xae')]=_0x364637[_0xc149('0xaf')];_0x364637[_0xc149('0x12a')]=_0x4f8d61[_0xc149('0x12a')];_0x364637[_0xc149('0x12b')]=_0x4f8d61[_0xc149('0x12b')];this[_0xc149('0xd1')](_0x364637)[_0xc149('0xb6')](loggerCatch(_0xc149('0x130')));}}}}};Dialer['prototype'][_0xc149('0x131')]=function(_0x4fc5c8){if(this['actions'][_0x4fc5c8[_0xc149('0xe3')]]){this[_0xc149('0x27')][_0x4fc5c8[_0xc149('0xe3')]][_0xc149('0xb5')]=_0x4fc5c8['channel'];}if(this[_0xc149('0xe2')][_0x4fc5c8[_0xc149('0xe3')]]){this[_0xc149('0xe2')][_0x4fc5c8[_0xc149('0xe3')]][_0xc149('0xb5')]=_0x4fc5c8['channel'];}};Dialer[_0xc149('0xb0')]['syncQueueMember']=function(_0x3b487e){if(strategy[this[_0xc149('0x21')][this['actions'][_0x3b487e['actionid']][_0xc149('0xb9')]][_0xc149('0x4e')]]===_0xc149('0x132')){if(this['actions'][_0x3b487e[_0xc149('0x133')]]&&_[_0xc149('0xb3')](this[_0xc149('0x27')][_0x3b487e['actionid']][_0xc149('0x134')])&&_0x3b487e['status']==='1'&&_0x3b487e[_0xc149('0x135')]==='0'){if(this[_0xc149('0x23')][_0x3b487e[_0xc149('0x136')]]){if(!this[_0xc149('0x23')][_0x3b487e['stateinterface']]['locked']){this[_0xc149('0x23')][_0x3b487e['stateinterface']]['locked']=!![];this[_0xc149('0x27')][_0x3b487e['actionid']][_0xc149('0x134')]=!![];this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]][_0xc149('0x136')]=_0x3b487e['stateinterface'];}}}}else if((strategy[this[_0xc149('0x21')][this[_0xc149('0x27')][_0x3b487e['actionid']][_0xc149('0xb9')]][_0xc149('0x4e')]]||_0xc149('0x1b'))==='rrmemory'){if(this[_0xc149('0x27')][_0x3b487e['actionid']]){if(this[_0xc149('0x23')][_0x3b487e['stateinterface']]){this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]]['stateinterface']=_0x3b487e[_0xc149('0x136')];if(_[_0xc149('0xb3')](this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]][_0xc149('0xb9')]])){this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]][_0xc149('0xb9')]]=[];}this['queueBooked'][this['actions'][_0x3b487e[_0xc149('0x133')]][_0xc149('0xb9')]][_0xc149('0x137')](_[_0xc149('0x95')](_[_0xc149('0xd7')](this['actions'][_0x3b487e[_0xc149('0x133')]],[_0xc149('0x138'),'stateinterface']),{'status':_0x3b487e[_0xc149('0xb4')],'paused':_0x3b487e[_0xc149('0x135')]}));}}}};function unlockQueueStatus(_0x872a33,_0x24772d){setTimeout(function(){if(_[_0xc149('0x3e')](_0x872a33[_0xc149('0x139')])){loggerBooked['error'](_0xc149('0x13a'),_0x24772d);}_0x872a33[_0xc149('0x139')]=!![];loggerBooked[_0xc149('0x83')](_0xc149('0x13b'),_0x24772d,JSON['stringify'](_[_0xc149('0xd7')](_0x872a33,[_0xc149('0x40'),_0xc149('0x139')])));},0x1f3);}Dialer[_0xc149('0xb0')]['syncQueueStatusComplete']=function(_0x5355f1){var _0x165148=this;var _0x38ba64=_0x165148[_0xc149('0x21')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]];if(strategy[this[_0xc149('0x21')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']][_0xc149('0x4e')]]===_0xc149('0x132')){if(this['actions'][_0x5355f1[_0xc149('0x133')]]&&this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0x136')]){this[_0xc149('0x20')]['run'](this['actions'][_0x5355f1[_0xc149('0x133')]]['idHopper'],this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['stateinterface'])[_0xc149('0xb6')](function(_0x4649ce){logger[_0xc149('0x9d')](_0xc149('0x13c'),util[_0xc149('0x9c')](_0x4649ce,{'showHidden':![],'depth':null}));})[_0xc149('0x1e')](function(){_0x165148['updateOriginated'](_0x165148[_0xc149('0x21')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]);_0x165148[_0xc149('0x23')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0x136')]]['locked']=![];delete _0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64);});}else{this[_0xc149('0xb8')](this[_0xc149('0x21')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]);this[_0xc149('0xc6')]({'active':![],'ContactId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['ContactId'],'ListId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['ListId'],'VoiceQueueId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0x103')]||undefined,'CampaignId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x13d')));delete this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64);}}else if((strategy[this[_0xc149('0x21')][this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]][_0xc149('0x4e')]]||_0xc149('0x1b'))===_0xc149('0x1b')){var _0x1005d9;if(this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]&&!_[_0xc149('0x82')](this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']])){if(this['queueBookedRR'][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]){this[_0xc149('0x2d')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]=this[_0xc149('0x2d')][this[_0xc149('0x27')][_0x5355f1['actionid']][_0xc149('0xb9')]]?this['queueBookedRR'][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]:this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]?this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]['_rr']||0x0:0x0;}this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]][_0xc149('0x13e')]=this[_0xc149('0x2d')][this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]];for(var _0x160e6a=0x0;_0x160e6a=0x0;})[_0xc149('0xb6')](myreject(_0x40ae61)));}}else{_0x48063c['push'](ami[_0xc149('0x156')]({'action':_0xc149('0x157'),'command':util[_0xc149('0x7c')]('iftime\x20%s,%s',_0x126793,!_[_0xc149('0x3e')](config[_0xc149('0x153')][_0x5c478c])?_0x5c478c:'')})['then'](function(_0x3184dd){return _0x3184dd[_0xc149('0x159')][_0xc149('0x15a')](_0xc149('0x15b'))>=0x0;})[_0xc149('0xb6')](myreject(_0x40ae61)));}BPromise[_0xc149('0x15c')](_0x48063c)[_0xc149('0xbf')](function(_0x58774b){var _0x3c5932=_[_0xc149('0x15d')](_0x58774b);if(_0x3c5932){return _0x4aa6c2(_0x3c5932);}else{_0xbf81c5[_0xc149('0x42')]=_0x403a38?_0xc149('0x15e'):_0xc149('0x15f');return _0x40ae61(msgResponse('[ifTime][promiseAll]',_0xc149('0x150'),_0xc149('0x160')+_0x403a38+'\x20'+_0x330c69+_0xc149('0x161')+util[_0xc149('0x9c')](_0x126793,{'showHidden':![],'depth':null})+_0xc149('0x162')+_0x5c478c));}})[_0xc149('0xb6')](function(_0x571b0f){return _0x40ae61(msgResponse('ifTime','Failure',JSON[_0xc149('0x7a')](_0x571b0f)));});});};Dialer[_0xc149('0xb0')][_0xc149('0x163')]=function(_0x315c89){var _0x5aa373=this;return function(){switch(_0x315c89[_0xc149('0x164')]){case _0xc149('0x165'):freeVariablesPredictive(_0x315c89);_0x5aa373[_0xc149('0x166')](_0x315c89,0x1);break;case'power':freeVariablesPredictive(_0x315c89);_0x5aa373[_0xc149('0x166')](_0x315c89,_0x315c89[_0xc149('0x167')]);break;case _0xc149('0x168'):_0x5aa373[_0xc149('0x168')](_0x315c89);break;case'booked':freeVariablesPredictive(_0x315c89);_0x5aa373[_0xc149('0x166')](_0x315c89,0x1);break;default:freeVariablesPredictive(_0x315c89);logger[_0xc149('0x9d')](_0xc149('0x169'),_0x315c89[_0xc149('0x40')],_0xc149('0x16a'));}};};Dialer[_0xc149('0xb0')]['launchHandleIvr']=function(_0x82612c){var _0x403144=this;return function(){_0x403144[_0xc149('0x16b')](_0x82612c);};};Dialer[_0xc149('0xb0')][_0xc149('0xb')]=function(_0x3c3002){var _0x4fde28=this;if(isNotPreview(_0x3c3002[_0xc149('0x164')])){if(isVoiceQueueOutbound(_0x3c3002[_0xc149('0x57')])&&isActive(_0x3c3002['dialActive'])){_0x3c3002[_0xc149('0xa8')]=!![];BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](checkIsLoggedIn(_0x3c3002,_0x3c3002[_0xc149('0x51')]))[_0xc149('0xbf')](checkIsActive(_0x3c3002,_0x3c3002[_0xc149('0x5b')]))['then'](checkInterval(_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x14a')](_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x14d')](_0x3c3002[_0xc149('0x16c')],_0x3c3002['dialTimezone'],_0x3c3002[_0xc149('0x40')],_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x14f')](_0x3c3002[_0xc149('0x44')],_0x3c3002[_0xc149('0x16d')],_0x3c3002[_0xc149('0x40')],_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x163')](_0x3c3002))[_0xc149('0xb6')](loggerCatchQueueSummary('[syncQueueSummary]',_0x3c3002));}else{notSendMessagesQueue(_0x3c3002);}}else{freeVariablesPredictive(_0x3c3002);}};Dialer[_0xc149('0xb0')]['syncCampaigns']=function(){var _0x17bbe0=this;var _0x4a7efc;for(var _0xeadd8d in this[_0xc149('0x22')]){if(typeof this[_0xc149('0x22')][_0xeadd8d]!==_0xc149('0xa0')){_0x4a7efc=this['campaigns'][_0xeadd8d];if(isCampaignIvr(_0x4a7efc[_0xc149('0x57')])&&isActive(_0x4a7efc['active'])){_0x4a7efc[_0xc149('0xa8')]=!![];BPromise[_0xc149('0xbc')]()['then'](checkIsActive(_0x4a7efc,_0x4a7efc[_0xc149('0x79')]))[_0xc149('0xbf')](checkInterval(_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0[_0xc149('0x14a')](_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0['checkIfTime'](_0x4a7efc[_0xc149('0x16c')],_0x4a7efc[_0xc149('0x16d')],_0x4a7efc[_0xc149('0x40')],_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0[_0xc149('0x14f')](_0x4a7efc[_0xc149('0x44')],_0x4a7efc[_0xc149('0x16d')],_0x4a7efc[_0xc149('0x40')],_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0[_0xc149('0x16e')](_0x4a7efc))[_0xc149('0xb6')](loggerCatchQueueSummary('[syncCampaigns]',_0x4a7efc));}else{notSendMessagesCampaign(_0x4a7efc);}}}};function getCallerIdRandom(_0x2a3cdd,_0x1cbfb6){var _0x5282f7;var _0xbd8a3f;var _0x12e8f2;if(_0x1cbfb6<=0x0){_0x1cbfb6=0x1;}_0x5282f7=new RegExp(_0xc149('0x16f')+_0x1cbfb6+'}$');_0xbd8a3f=Math[_0xc149('0x170')](0xa,_0x1cbfb6-0x1);_0x12e8f2=Math['pow'](0xa,_0x1cbfb6)-0x1;return util[_0xc149('0x7c')]('%s',_[_0xc149('0x171')](_0x2a3cdd,_0x5282f7,_[_0xc149('0x172')](_0xbd8a3f,_0x12e8f2)));}function extractCalleridName(_0xe6ccf3){var _0x4ff64b=_0xe6ccf3['match'](/"(.*?)"/);return _0x4ff64b?_0x4ff64b[0x1]:_0xe6ccf3;}function extractCalleridNumber(_0x341d7a){var _0x21959b=_0x341d7a[_0xc149('0x173')](/<(.*?)>/);return _0x21959b?_0x21959b[0x1]:_0x341d7a;}Dialer[_0xc149('0xb0')][_0xc149('0x174')]=function(_0x5b9280,_0x52aee4){var _0x91e06=this;var _0x229040=uuid['v4']();this[_0xc149('0x27')][_0x229040]=new Action(_0x5b9280,_0x52aee4,_0x229040);return new BPromise(function(_0x212592,_0x2671f3){if(_[_0xc149('0x3e')](_0x5b9280)&&typeof _0x5b9280!=='object'){return _0x2671f3(msgResponse('originate',_0xc149('0x150'),_0xc149('0x175')));}if(_[_0xc149('0x3e')](_0x52aee4[_0xc149('0x176')][_0xc149('0x177')])||_0x52aee4[_0xc149('0x176')][_0xc149('0x177')]===null){return _0x2671f3(msgResponse(_0xc149('0x178'),'Failure',_0xc149('0x179')));}var _0x47b699={'XMD-CALLERID':_0x91e06['actions'][_0x229040][_0xc149('0x17a')](),'XMD-AGI':_0x5b9280[_0xc149('0x112')]?util[_0xc149('0x7c')](_0xc149('0x17b'),ipAgi,_0x5b9280['dialQueueProject']):_0xc149('0x17c'),'XMD-AGIAFTER':_0x5b9280[_0xc149('0x118')]?util[_0xc149('0x7c')](_0xc149('0x17b'),ipAgi,_0x5b9280[_0xc149('0x118')]):_0xc149('0x17c'),'XMD-QUEUE':_0x5b9280[_0xc149('0x57')]===_0xc149('0x17d')?util['format'](_0xc149('0x17e'),_0x5b9280[_0xc149('0x40')],_0x5b9280['dialQueueOptions']||'',_0x5b9280[_0xc149('0x119')]?'c':'',_0x5b9280['dialQueueTimeout']||0x3):_0xc149('0x17c'),'XMD-CONTACTID':_0x52aee4['ContactId'],'XMD-CDRTYPE':_0xc149('0x8'),'CALLERID(all)':_0x91e06[_0xc149('0x27')][_0x229040][_0xc149('0x17a')](),'XMD-AMD':_0x5b9280[_0xc149('0xe6')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xc149('0xe5')};if(_0x5b9280['dialAMDActive']){_0x47b699[_0xc149('0x17f')]=_0x5b9280[_0xc149('0x180')]||0x9c4;_0x47b699[_0xc149('0x181')]=_0x5b9280[_0xc149('0x182')]||0x5dc;_0x47b699[_0xc149('0x183')]=_0x5b9280[_0xc149('0x184')]||0x320;_0x47b699[_0xc149('0x185')]=_0x5b9280[_0xc149('0x186')]||0x1388;_0x47b699['XMD-AMDMINWORDLENGTH']=_0x5b9280[_0xc149('0x187')]||0x64;_0x47b699[_0xc149('0x188')]=_0x5b9280[_0xc149('0x189')]||0x32;_0x47b699[_0xc149('0x18a')]=_0x5b9280[_0xc149('0x18b')]||0x3;_0x47b699[_0xc149('0x18c')]=_0x5b9280['dialAMDSilenceThreshold']||0x100;_0x47b699[_0xc149('0x18d')]=_0x5b9280[_0xc149('0x18e')]||0x1388;}if(_0x5b9280[_0xc149('0x57')]==='outbound'){_0x47b699[_0xc149('0x18f')]=_0x52aee4['VoiceQueueId'];}else{_0x47b699[_0xc149('0x190')]=_0x52aee4['CampaignId'];}for(var _0x2dbf58 in _0x52aee4[_0xc149('0x176')]){if(typeof _0x52aee4['Contact'][_0x2dbf58]!==_0xc149('0xa0')){if(isNotNull(_0x52aee4[_0xc149('0x176')][_0x2dbf58])&&_0x2dbf58!=='id'&&_0x2dbf58!=='tags'&&_0x2dbf58!==_0xc149('0x191')&&_0x2dbf58!==_0xc149('0x192')){_0x47b699[util[_0xc149('0x7c')](_0xc149('0x193'),'XMD-',_[_0xc149('0x194')](_0x2dbf58))]=_0x52aee4[_0xc149('0x176')][_0x2dbf58];}}}var _0x780508=_0x91e06[_0xc149('0xdf')](_0x5b9280['Trunk'])?getCallerId(_0x5b9280[_0xc149('0x78')]['callerid'],_0x5b9280[_0xc149('0x5c')],_0x5b9280[_0xc149('0x195')]>0x0?getCallerIdRandom(_0x5b9280['dialOriginateCallerIdNumber'],_0x5b9280[_0xc149('0x195')]):_0x5b9280['dialOriginateCallerIdNumber']):getCallerId(_[_0xc149('0xb3')](_0x5b9280[_0xc149('0x196')])?_0x5b9280[_0xc149('0x78')][_0xc149('0x197')]:_0x5b9280[_0xc149('0x196')][_0xc149('0x197')],_0x5b9280['dialOriginateCallerIdName'],_0x5b9280[_0xc149('0x195')]>0x0?getCallerIdRandom(_0x5b9280[_0xc149('0x5d')],_0x5b9280['dialRandomLastDigitCallerIdNumber']):_0x5b9280[_0xc149('0x5d')]);if(_0x780508){_0x47b699[_0xc149('0x198')]=_0x91e06[_0xc149('0x27')][_0x229040]['originatecalleridname']=extractCalleridName(_0x780508);_0x47b699[_0xc149('0x199')]=_0x91e06[_0xc149('0x27')][_0x229040]['originatecalleridnum']=extractCalleridNumber(_0x780508);}return ami[_0xc149('0x156')]({'actionid':_0x229040,'action':'originate','channel':_0x91e06[_0xc149('0xdf')](_0x5b9280[_0xc149('0x78')])?util[_0xc149('0x7c')](_0xc149('0x19a'),_0x5b9280[_0xc149('0x78')][_0xc149('0x40')],isNotNull(_0x5b9280[_0xc149('0x5f')])?_0x5b9280[_0xc149('0x5f')]['trim']()||'':'',_0x5b9280[_0xc149('0x19b')]>0x0?_0x52aee4[_0xc149('0x176')][_0xc149('0x177')][_0xc149('0x19c')](_0x5b9280[_0xc149('0x19b')]):_0x52aee4[_0xc149('0x176')]['phone']):util[_0xc149('0x7c')](_0xc149('0x19a'),_[_0xc149('0xb3')](_0x5b9280['TrunkBackup'])?_0x5b9280[_0xc149('0x78')]['name']:_0x5b9280[_0xc149('0x196')][_0xc149('0x40')],isNotNull(_0x5b9280[_0xc149('0x5f')])?_0x5b9280['dialPrefix'][_0xc149('0x19d')]()||'':'',_0x5b9280[_0xc149('0x19b')]>0x0?_0x52aee4['Contact'][_0xc149('0x177')]['substring'](_0x5b9280['dialCutDigit']):_0x52aee4[_0xc149('0x176')][_0xc149('0x177')]),'callerid':_0x780508,'Exten':'xcally-motion-dialer','Context':_0xc149('0x19e'),'Priority':'1','variable':_0x47b699,'timeout':(_0x5b9280[_0xc149('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x229040})['then'](function(_0x280669){return _0x212592(_0x280669);})['catch'](function(_0x471fe2){_0x5b9280[_0xc149('0x68')]+=0x1;var _0x40fa2=new History(_0x91e06[_0xc149('0x27')][_0x229040]);logger[_0xc149('0x9d')](util['format'](_0xc149('0x19f'),JSON[_0xc149('0x7a')](_0x471fe2)));_0x40fa2['state']=0xe;_0x40fa2[_0xc149('0xe9')]=_0xc149('0x1a0');_0x40fa2[_0xc149('0xaf')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));_0x40fa2[_0xc149('0xae')]=_0x40fa2[_0xc149('0xaf')];_0x91e06[_0xc149('0xd1')](_0x40fa2)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1a1')));_0x91e06[_0xc149('0xe1')](_0x40fa2)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1a1')))['finally'](function(){delete _0x91e06[_0xc149('0x27')][_0x229040];return _0x2671f3(msgResponse(_0xc149('0x178'),_0xc149('0x49'),_0xc149('0x1a2')));});});});};Dialer[_0xc149('0xb0')][_0xc149('0x1a3')]=function(_0x417479){var _0x4e0591=this[_0xc149('0x27')][_0x417479[_0xc149('0x133')]];if(_0x4e0591){delete this[_0xc149('0x27')][_0x417479[_0xc149('0x133')]];_0x4e0591[_0xc149('0x121')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));var _0x3f6631=_0x4e0591['type']==='ivr'?this['campaigns'][_0x4e0591[_0xc149('0xb9')]]:this['voiceQueues'][_0x4e0591[_0xc149('0x1a4')]()];if(!this[_0xc149('0xde')](_0x417479['response'])){this[_0xc149('0xb8')](_0x3f6631);return this['callProgressDetecting'](_0x4e0591,_0x3f6631,_0x417479)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1a5')));}this[_0xc149('0xe2')][_0x417479[_0xc149('0xe3')]]=_0x4e0591;}};Dialer[_0xc149('0xb0')][_0xc149('0x1a6')]=function(_0x124d24,_0x388816,_0x5ee6e8){var _0x654836=new History(_0x388816);if(_0x654836[_0xc149('0xf5')]+_0x654836[_0xc149('0xf6')]+_0x654836[_0xc149('0xf7')]+_0x654836['countnosuchnumberretry']+_0x654836['countdropretry']+_0x654836[_0xc149('0xfa')]+_0x654836[_0xc149('0xfd')]+_0x654836[_0xc149('0xfb')]>=_0x5ee6e8[_0xc149('0x10a')]-0x1){return!![];}switch(_0x124d24){case 0x3:if(_0x654836['countnoanswerretry']>=_0x5ee6e8[_0xc149('0x1a7')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countnoanswerretry':_0x654836[_0xc149('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x5ee6e8[_0xc149('0x1a8')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x654836[_0xc149('0xf5')]>=_0x5ee6e8[_0xc149('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x654836['countbusyretry']+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x1aa')],_0xc149('0x128'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1ab')));break;case 0x8:if(_0x654836[_0xc149('0xf6')]>=_0x5ee6e8['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x654836[_0xc149('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x5ee6e8[_0xc149('0x1ac')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836[_0xc149('0xd8')],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836['VoiceQueueId']||undefined,'CampaignId':_0x654836['CampaignId']||undefined})['catch'](loggerCatch(_0xc149('0x1ad')));break;case 0x0:if(_0x654836[_0xc149('0xf8')]>=_0x5ee6e8['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xc149('0xc6')]({'active':![],'countnosuchnumberretry':_0x654836[_0xc149('0xf8')]+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x1ae')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836[_0xc149('0xd8')],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x654836[_0xc149('0xf9')]>=_0x5ee6e8['dialDropMaxRetry']-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countdropretry':_0x654836[_0xc149('0xf9')]+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x127')],'minutes')[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x129')));break;case 0xb:if(_0x654836[_0xc149('0xfa')]>=_0x5ee6e8[_0xc149('0x12e')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countabandonedretry':_0x654836['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x12f')],_0xc149('0x128'))[_0xc149('0x7c')](_0xc149('0x102')),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836['VoiceQueueId']||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1af')));break;case 0x13:if(_0x654836[_0xc149('0xfd')]>=_0x5ee6e8[_0xc149('0xfe')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countmachineretry':_0x654836[_0xc149('0xfd')]+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x10c')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836[_0xc149('0xd8')],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x654836[_0xc149('0xfb')]>=_0x5ee6e8[_0xc149('0x1b0')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countagentrejectretry':_0x654836[_0xc149('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x5ee6e8[_0xc149('0x1b1')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836['VoiceQueueId']||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1b2')));break;default:return!![];}};Dialer[_0xc149('0xb0')][_0xc149('0x1b3')]=function(_0x13e27d,_0x36aa25,_0x23c79f){var _0x3352fa=this;var _0x2612bf=new History(_0x13e27d);return new BPromise(function(_0x13c33e,_0x41c8c6){if(_[_0xc149('0x3e')](_0x36aa25)&&typeof _0x36aa25!=='object'){return _0x41c8c6(msgResponse('[callProgressDetecting]','Failure',_0xc149('0x1b4')));}if(_['isUndefined'](_0x23c79f)&&typeof _0x23c79f!==_0xc149('0x1b5')){return _0x41c8c6(msgResponse(_0xc149('0x1b6'),_0xc149('0x150'),_0xc149('0x1b7')));}switch(_0x23c79f['reason']){case'0':_0x36aa25['outboundNoSuchCallsDay']+=0x1;_0x2612bf[_0xc149('0x108')]=0x0;_0x2612bf[_0xc149('0xe9')]='NoSuchNumber';_0x2612bf['countnosuchnumberretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')](_0xc149('0x1b8'),ut[_0xc149('0xed')](_0x13e27d,_0xc149('0x1b9')));_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch(_0xc149('0x109')));if(_0x3352fa[_0xc149('0x1a6')](0x0,_0x13e27d,_0x36aa25)){if(_0x2612bf['countnosuchnumberretry']>=_0x36aa25[_0xc149('0x1ba')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1bb'));}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1bb'));}}break;case'3':_0x36aa25[_0xc149('0x66')]+=0x1;_0x2612bf['state']=0x3;_0x2612bf['statedesc']='NoAnswer';_0x2612bf['countnoanswerretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')](_0xc149('0x1bc'),ut['buildObj'](_0x13e27d,'noanswer'));_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch(_0xc149('0x1bd')));if(_0x3352fa['checkRetriveMax'](0x3,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf7')]>=_0x36aa25[_0xc149('0x1a7')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1be'));}}break;case'5':_0x36aa25['outboundBusyCallsDay']+=0x1;_0x2612bf[_0xc149('0x108')]=0x5;_0x2612bf[_0xc149('0xe9')]='Busy';_0x2612bf[_0xc149('0xf5')]+=0x1;_0x2612bf['countglobal']+=0x1;ami['emit'](_0xc149('0x1bf'),ut[_0xc149('0xed')](_0x13e27d,_0xc149('0x1c0')));_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch(_0xc149('0x1c1')));if(_0x3352fa['checkRetriveMax'](0x5,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf5')]>=_0x36aa25[_0xc149('0x1a9')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x205\x20busy');}else{_0x3352fa['stateGlobal'](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x205\x20busy');}}break;case'8':_0x36aa25[_0xc149('0x63')]+=0x1;_0x2612bf['state']=0x8;_0x2612bf[_0xc149('0xe9')]=_0xc149('0x1c2');_0x2612bf['countcongestionretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')](_0xc149('0x1c3'),ut['buildObj'](_0x13e27d,_0xc149('0x1c4')));_0x3352fa['createHistory'](_0x2612bf)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1c5')));if(_0x3352fa[_0xc149('0x1a6')](0x8,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf6')]>=_0x36aa25[_0xc149('0x1c6')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x208\x20congestion');}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1c7'));}}break;case'11':_0x36aa25[_0xc149('0x1c8')]+=0x1;_0x2612bf[_0xc149('0x108')]=0xb;_0x2612bf[_0xc149('0xe9')]='Abandoned';_0x2612bf['countabandonedretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;_0x3352fa[_0xc149('0xd1')](_0x2612bf)[_0xc149('0xb6')](loggerCatch(_0xc149('0x130')));if(_0x3352fa['checkRetriveMax'](0xb,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xfa')]>=_0x36aa25[_0xc149('0x12e')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1c9'));}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1c9'));}}break;case'20':_0x36aa25[_0xc149('0x6a')]+=0x1;_0x2612bf[_0xc149('0x108')]=0x14;_0x2612bf[_0xc149('0xe9')]=_0xc149('0x1ca');_0x2612bf['countagentrejectretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')]('custom:agentreject',ut['buildObj'](_0x13e27d,_0xc149('0x1cb')));_0x3352fa['createHistory'](_0x2612bf)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1cc')));if(_0x3352fa['checkRetriveMax'](0x14,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xfb')]>=_0x36aa25[_0xc149('0x1b0')]){_0x3352fa['createStateFinal'](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x2020\x20agentreject');}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1cd'));}}break;default:_0x36aa25[_0xc149('0x6b')]+=0x1;_0x2612bf['state']=0xc;_0x2612bf[_0xc149('0xe9')]=_0x23c79f['reason'];_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3352fa[_0xc149('0x1a6')](_0x23c79f[_0xc149('0x1ce')],_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf5')]+_0x2612bf[_0xc149('0xf6')]+_0x2612bf[_0xc149('0xf7')]+_0x2612bf[_0xc149('0xf8')]+_0x2612bf[_0xc149('0xf9')]+_0x2612bf['countabandonedretry']+_0x2612bf[_0xc149('0xfd')]+_0x2612bf[_0xc149('0xfb')]>=_0x36aa25[_0xc149('0x10a')]){_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0x23c79f['reason']);}else{_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,_0x23c79f[_0xc149('0x1ce')]);}}}});};Dialer[_0xc149('0xb0')][_0xc149('0xfc')]=function(_0x21eb46,_0x4d44e2,_0x2985ba,_0x3b83b4){var _0x1fff27=new Final(_0x21eb46);_0x1fff27[_0xc149('0x108')]=0xf;_0x1fff27['statedesc']=_0xc149('0x1cf');this[_0xc149('0xff')](_0x1fff27,_0x4d44e2,_0x2985ba,_0x3b83b4);};Dialer[_0xc149('0xb0')][_0xc149('0xff')]=function(_0x58a403,_0x9f52ec,_0x430ce1,_0x3023cf){this[_0xc149('0xe1')](_0x58a403)[_0xc149('0xbf')](function(){return _0x9f52ec(msgResponse(_0xc149('0x1b6'),'Success',_0x3023cf));})[_0xc149('0xb6')](function(){return _0x430ce1(msgResponse(_0xc149('0x1d0'),'Failure',_0xc149('0x1d1')));});};Dialer[_0xc149('0xb0')]['predictive']=function(_0x2bb2e2){var _0x485acd=_0x2bb2e2[_0xc149('0x1d2')]/0x64;var _0x11095f=_0x2bb2e2[_0xc149('0x122')]/(_0x2bb2e2['outboundDropCallsDayTimeout']+_0x2bb2e2[_0xc149('0x115')]);var _0x5799bb=Math[_0xc149('0x1d3')](_0x2bb2e2[_0xc149('0x72')]*(_0x2bb2e2[_0xc149('0x1d4')]/0x64));var _0x1f1e36=Math[_0xc149('0x1d3')](_0x2bb2e2[_0xc149('0x72')]*(_0x2bb2e2['predictiveIntervalMinThreshold']/0x64));var _0x110415=_0x2bb2e2[_0xc149('0x50')]+_0x2bb2e2[_0xc149('0x55')];var _0x29d28c=Math[_0xc149('0x1d5')](_0x2bb2e2['erlangCalls']*_0x2bb2e2[_0xc149('0x76')]*_0x2bb2e2[_0xc149('0x70')]*_0x2bb2e2[_0xc149('0x71')]);if(_[_0xc149('0x3e')](_0x2bb2e2[_0xc149('0x2a')])){if(!_[_0xc149('0x3e')](_0x2bb2e2[_0xc149('0x29')])){_0x2bb2e2[_0xc149('0x29')]=undefined;loggerPredictive[_0xc149('0x9d')](_0xc149('0x1d6'),_0xc149('0x1d7'));}if(!_['isUndefined'](_0x2bb2e2[_0xc149('0x98')])){loggerPredictive[_0xc149('0x9d')](_0xc149('0x1d6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2bb2e2[_0xc149('0x98')]);_0x2bb2e2[_0xc149('0x98')]=undefined;}_0x2bb2e2[_0xc149('0x2a')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));loggerPredictive[_0xc149('0x83')](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1d8'),_0x2bb2e2[_0xc149('0x2a')]);this[_0xc149('0x166')](_0x2bb2e2,0x1);}else if(ifInterval(_0x2bb2e2[_0xc149('0x1d9')],_0x2bb2e2[_0xc149('0x2a')])){this[_0xc149('0x166')](_0x2bb2e2,0x1);loggerPredictiveCalls['info'](_0xc149('0x1da'),_0x2bb2e2[_0xc149('0x2a')],_0x2bb2e2[_0xc149('0x40')]);_0x2bb2e2[_0xc149('0x91')]=0x0;_0x2bb2e2[_0xc149('0x123')]=0x0;}else if(_0x485acd<_0x11095f&&_0x2bb2e2[_0xc149('0x1db')]===_0xc149('0x1dc')){freeVariablesPredictive(_0x2bb2e2);loggerPredictive[_0xc149('0x83')](_0xc149('0x1dd'),_0xc149('0x1de'),_0x11095f,_0xc149('0x2a'),_0x2bb2e2['name']);}else if(_0x29d28c<_0x2bb2e2[_0xc149('0x123')]&&_0x2bb2e2['dialPredictiveOptimization']===_0xc149('0x1dc')){freeVariablesPredictive(_0x2bb2e2);loggerPredictive[_0xc149('0x83')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc149('0x1df'),_0x29d28c,_0xc149('0x1e0'),_0x2bb2e2[_0xc149('0x123')],_0xc149('0x2a'),_0x2bb2e2['name']);}else if(!ifInterval(_0x2bb2e2[_0xc149('0x1d9')],_0x2bb2e2['startProgressive'])&&_[_0xc149('0x3e')](_0x2bb2e2['startPredictive'])&&!_['isUndefined'](_0x2bb2e2['startProgressive'])){_0x2bb2e2[_0xc149('0x29')]=moment()['format'](_0xc149('0x102'));loggerPredictive['info'](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1e1'),_0x2bb2e2[_0xc149('0x29')]);this[_0xc149('0x1e2')](_0x2bb2e2[_0xc149('0x1d9')])[_0xc149('0xbf')](this[_0xc149('0x1e3')](_0x2bb2e2))[_0xc149('0xbf')](mergeDataErlangB(_0x2bb2e2))[_0xc149('0xbf')](this['startMethodPredictive'](_0x2bb2e2))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2bb2e2));}else if(!ifInterval(_0x2bb2e2[_0xc149('0x1d9')],_0x2bb2e2[_0xc149('0x29')])){_0x2bb2e2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2bb2e2[_0xc149('0x29')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));loggerPredictive['info'](_0x2bb2e2['name'],_0xc149('0x1e4'),_0x2bb2e2[_0xc149('0x29')]);clearInterval(_0x2bb2e2[_0xc149('0x98')]);_0x2bb2e2['handlePredictive']=undefined;this[_0xc149('0x1e2')](_0x2bb2e2['dialPredictiveInterval'])[_0xc149('0xbf')](this[_0xc149('0x1e3')](_0x2bb2e2))[_0xc149('0xbf')](mergeDataErlangB(_0x2bb2e2))['then'](this[_0xc149('0x1e5')](_0x2bb2e2))[_0xc149('0xb6')](loggerCatchPredictive(_0xc149('0x1e6'),_0x2bb2e2));}else if(_0x2bb2e2['predictiveIntervalAvailable']&&_0x110415<_0x2bb2e2[_0xc149('0x72')]-_0x1f1e36){freeVariablesPredictive(_0x2bb2e2);loggerPredictive[_0xc149('0x83')](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1e7'),_0x110415,_0xc149('0x1e8'),_0x2bb2e2['predictiveIntervalAvailable'],'-',_0x1f1e36,'=',_0x2bb2e2[_0xc149('0x72')]-_0x1f1e36,')');}else if(_0x2bb2e2['predictiveIntervalAvailable']&&_0x110415>_0x2bb2e2[_0xc149('0x72')]+_0x5799bb){freeVariablesPredictive(_0x2bb2e2);loggerPredictive['info'](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1e7'),_0x110415,_0xc149('0x1e9'),_0x2bb2e2['predictiveIntervalAvailable'],'+',_0x5799bb,'=',_0x2bb2e2[_0xc149('0x72')]+_0x5799bb,')');}};Dialer[_0xc149('0xb0')][_0xc149('0x1e3')]=function(_0x249049){var _0x51e2fd=this;return function(_0x39ccd2){return new BPromise(function(_0x4fcfcc,_0x468402){_[_0xc149('0x95')](_0x249049,_0x39ccd2[0x0]);if(checkGetDataPredictive(_0x39ccd2[0x0])){var _0x4202fb=_0x249049['predictiveIntervalAvailable']=_0x249049[_0xc149('0x55')]+_0x249049[_0xc149('0x50')];var _0xdf5c8d=_0x249049[_0xc149('0x1d9')]*0x3c;var _0x50907d=_0x39ccd2[0x0][_0xc149('0x8a')]+_0x39ccd2[0x0][_0xc149('0x6d')];var _0x20f1f1=(_0x39ccd2[0x0][_0xc149('0x6c')]+_0x39ccd2[0x0][_0xc149('0x6f')]+_0x39ccd2[0x0][_0xc149('0x6e')])/_0x39ccd2[0x0][_0xc149('0x73')];_0x249049['predictiveIntervalHitRate']=_0x20f1f1>0x0?_0x20f1f1:0x1;switch(_0x249049[_0xc149('0x1db')]){case _0xc149('0x1dc'):var _0x2bcbd7=_0x249049[_0xc149('0x1d2')]/0x64;return _0x51e2fd[_0xc149('0x1ea')](_0x4202fb,_0xdf5c8d,_0x50907d,_0x20f1f1,_0x2bcbd7)[_0xc149('0xbf')](function(_0x292da8){return _0x4fcfcc(_0x292da8);});case _0xc149('0x1eb'):var _0x4e5e46=_0x249049[_0xc149('0x1d2')]/0x64;return _0x51e2fd[_0xc149('0x1ec')](_0x4202fb,_0xdf5c8d,_0x50907d,_0x20f1f1,_0x4e5e46)[_0xc149('0xbf')](function(_0x21b51b){return _0x4fcfcc(_0x21b51b);});default:return _0x468402(msgResponse('[getDataPredictive]',_0xc149('0x150'),_0xc149('0x1ed')));}}else{return _0x468402(msgResponse(_0xc149('0x1ee'),_0xc149('0x150'),_0xc149('0x1ef')));}});};};Dialer[_0xc149('0xb0')][_0xc149('0x1f0')]=function(_0x5f5226){var _0x5664ca=this;return function(_0x4b445a){return new BPromise(function(_0x17a14c,_0x459634){_[_0xc149('0x95')](_0x5f5226,_0x4b445a[0x0]);if(checkGetDataPredictive(_0x4b445a[0x0])){loggerPredictive[_0xc149('0x83')](JSON[_0xc149('0x7a')](_0x4b445a[0x0]));if(_0x5f5226[_0xc149('0x1db')]===_0xc149('0x1dc')){return _0x5664ca['getVoiceQueueRtPauses'](_0x5f5226['id'])['then'](function(_0x3d5c87){var _0x210b0b=_0x5f5226[_0xc149('0x51')]-_0x3d5c87[0x0][_0xc149('0x1f1')];var _0x1794e7=_0x5f5226[_0xc149('0x1d9')]*0x3c;var _0x15a4a2=_0x4b445a[0x0][_0xc149('0x8a')]+_0x4b445a[0x0][_0xc149('0x6d')];var _0x4888ad=(_0x4b445a[0x0][_0xc149('0x6c')]+_0x4b445a[0x0][_0xc149('0x6f')]+_0x4b445a[0x0][_0xc149('0x6e')])/_0x4b445a[0x0][_0xc149('0x73')];var _0x5d8c7c=_0x5f5226[_0xc149('0x1d2')]/0x64;_0x5f5226[_0xc149('0x1f2')]=_0x3d5c87[0x0][_0xc149('0x1f1')]||0x0;_0x5f5226[_0xc149('0x70')]=_0x4888ad>0x0?_0x4888ad:0x1;return _0x5664ca['abandonmentRate'](_0x210b0b,_0x1794e7,_0x15a4a2,_0x4888ad,_0x5d8c7c);})[_0xc149('0xbf')](function(_0x66d205){return _0x17a14c(_0x66d205);})[_0xc149('0xb6')](function(_0x4c4f0d){return _0x459634(msgResponse('[CatchErlangB]',_0xc149('0x150'),JSON[_0xc149('0x7a')](_0x4c4f0d)));});}if(_0x5f5226[_0xc149('0x1db')]===_0xc149('0x1eb')){return _0x5664ca[_0xc149('0xce')](_0x5f5226['id'])[_0xc149('0xbf')](function(_0x4d2ced){var _0x1ae677=_0x5f5226[_0xc149('0x51')]-_0x4d2ced[0x0][_0xc149('0x1f1')];var _0x504db4=_0x5f5226[_0xc149('0x1d9')]*0x3c;var _0x253c5e=_0x4b445a[0x0][_0xc149('0x8a')]+_0x4b445a[0x0][_0xc149('0x6d')];var _0x8d3a7f=(_0x4b445a[0x0]['predictiveIntervalAnsweredCalls']+_0x4b445a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b445a[0x0][_0xc149('0x6e')])/_0x4b445a[0x0][_0xc149('0x73')];var _0x28dff4=_0x5f5226['dialPredictiveOptimizationPercentage']/0x64;_0x5f5226[_0xc149('0x1f2')]=_0x4d2ced[0x0][_0xc149('0x1f1')]||0x0;_0x5f5226[_0xc149('0x70')]=_0x8d3a7f>0x0?_0x8d3a7f:0x1;return _0x5664ca[_0xc149('0x1ec')](_0x1ae677,_0x504db4,_0x253c5e,_0x8d3a7f,_0x28dff4);})[_0xc149('0xbf')](function(_0x3d2bee){return _0x17a14c(_0x3d2bee);})[_0xc149('0xb6')](function(_0x274bb4){return _0x459634(msgResponse('[CatchErlangB]',_0xc149('0x150'),JSON['stringify'](_0x274bb4)));});}}else{return _0x459634(msgResponse('[getDataPredictive]',_0xc149('0x150'),'check\x20failure'));}});};};Dialer['prototype'][_0xc149('0x1e5')]=function(_0x17c72e){var _0x224261=this;return function(){var _0x3dbb3f=0x0;var _0x468027=Math[_0xc149('0x1d5')](_0x17c72e[_0xc149('0x75')]*0x3e8);if(_0x468027>0x0){_0x468027=_0x468027<0x64?0x64:_0x468027;loggerPredictive[_0xc149('0x83')](_0x17c72e[_0xc149('0x40')],_0xc149('0x1f3'),_0x468027,'milliseconds');_0x17c72e['handlePredictive']=setInterval(function(){_0x224261[_0xc149('0x98')](_0x17c72e);loggerPredictiveCalls[_0xc149('0x83')](_0xc149('0x1f4'),_0x3dbb3f+=0x1);},_0x468027);}else{loggerPredictive['info'](_0x17c72e['name'],_0xc149('0x1f5'));}};};Dialer['prototype']['checkContactBlack']=function(_0x16396d,_0x3e3c20){var _0x2f4bb5=this;return function(_0x2fd400){if(_['isEmpty'](_0x2fd400)){if(_[_0xc149('0xb3')](_0x3e3c20[_0xc149('0xda')])||!_0x3e3c20[_0xc149('0x1f6')]){if(_0x16396d[_0xc149('0x164')]===_0xc149('0x9')){_0x16396d['queueStatusComplete']=_['isUndefined'](_0x16396d[_0xc149('0x139')])?!![]:_0x16396d[_0xc149('0x139')];var _0x306914=uuid['v4']();_0x2f4bb5[_0xc149('0x27')][_0x306914]=new Action(_0x16396d,_0x3e3c20,_0x306914);loggerBooked[_0xc149('0x83')]('[booked][checkContactBlack]',_0x306914,_0xc149('0x1f7'),JSON[_0xc149('0x7a')](_0x16396d[_0xc149('0x139')]),_0xc149('0x1f8'),_0x16396d[_0xc149('0x40')]);if(_0x16396d[_0xc149('0x139')]){_0x16396d[_0xc149('0x139')]=![];_0x2f4bb5[_0xc149('0x2c')][_0x2f4bb5[_0xc149('0x27')][_0x306914]['queue']]=[];ami[_0xc149('0x156')]({'actionid':_0x306914,'action':_0xc149('0x1f9'),'queue':_0x16396d[_0xc149('0x40')]})[_0xc149('0xb6')](function(){_0x2f4bb5[_0xc149('0xb8')](_0x16396d);_0x2f4bb5['rescheduleContact']({'active':![],'ContactId':_0x2f4bb5['actions'][_0x306914][_0xc149('0xd8')],'ListId':_0x2f4bb5[_0xc149('0x27')][_0x306914]['ListId'],'VoiceQueueId':_0x2f4bb5['actions'][_0x306914][_0xc149('0x103')]||undefined,'CampaignId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f4bb5[_0xc149('0x27')][_0x306914];});}else{loggerBooked['info'](_0xc149('0x1fa'),JSON[_0xc149('0x7a')](_0x16396d[_0xc149('0x139')]),_0xc149('0x1f8'),_0x16396d[_0xc149('0x40')]);_0x2f4bb5[_0xc149('0xb8')](_0x16396d);_0x2f4bb5['rescheduleContact']({'active':![],'ContactId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0xd8')],'ListId':_0x2f4bb5['actions'][_0x306914][_0xc149('0xd9')],'VoiceQueueId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0x103')]||undefined,'CampaignId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f4bb5[_0xc149('0x27')][_0x306914];}}else{return _0x2f4bb5[_0xc149('0x174')](_0x16396d,_0x3e3c20);}}else{if(getDiff(_0x3e3c20['scheduledat'])<_0x16396d[_0xc149('0x1fb')]*0x3c){if(_0x3e3c20[_0xc149('0x1fc')]&&!_0x3e3c20[_0xc149('0x1fc')]['voicePause']){_0x2f4bb5[_0xc149('0x20')][_0xc149('0x143')](_0x3e3c20['id'])[_0xc149('0x1e')](function(){_0x2f4bb5[_0xc149('0xb8')](_0x16396d);});}else{_0x2f4bb5['unlockContact']({'active':![]},_0x3e3c20['id'],0x1)['finally'](function(){_0x2f4bb5[_0xc149('0xb8')](_0x16396d);});}}else{_0x16396d[_0xc149('0x69')]+=0x1;_0x2f4bb5[_0xc149('0xb8')](_0x16396d);if(_0x16396d['dialRecallInQueue']){_0x2f4bb5[_0xc149('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3e3c20['ContactId'],'ListId':_0x3e3c20[_0xc149('0xd9')],'VoiceQueueId':_0x3e3c20[_0xc149('0x103')]||undefined,'CampaignId':_0x3e3c20[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1fd')));_0x2f4bb5[_0xc149('0xd1')](createObjHistory(_0x16396d,_0x3e3c20,_0xc149('0x1fe'),0x17,_0xc149('0x1ff')))['catch'](loggerCatch(_0xc149('0x200')));}else{_0x2f4bb5['saveInDb'](createObjHistory(_0x16396d,_0x3e3c20,_0xc149('0x201'),0x16,_0xc149('0x202')),_0xc149('0x203'),_0xc149('0x204'));}}}}else{_0x16396d[_0xc149('0x61')]+=0x1;_0x2f4bb5[_0xc149('0xee')](createObjHistory(_0x16396d,_0x3e3c20,'BLACKLIST',0xd,_0xc149('0x205')),_0xc149('0x206'),_0xc149('0x207'));throw _0xc149('0x208');}};};Dialer[_0xc149('0xb0')][_0xc149('0x16b')]=function(_0x11ca54){var _0x4398b0=this;var _0x42044a=_0x11ca54[_0xc149('0x209')]-_0x11ca54[_0xc149('0x74')]-_0x11ca54[_0xc149('0xca')];emitCampaignSummary(_0x11ca54);if(_0x42044a>0x0){if(_0x42044a>this['maxNumberOriginate']){_0x42044a=this[_0xc149('0x25')];}_0x11ca54['temp']+=_0x42044a;this[_0xc149('0xcc')](_0x11ca54['id'],_0x42044a,_0x11ca54[_0xc149('0x20a')],_0x11ca54)[_0xc149('0xbf')](function(_0x3582eb){_0x11ca54['temp']-=_0x42044a;_0x11ca54[_0xc149('0xca')]=_0x11ca54['temp']>0x0?_0x11ca54[_0xc149('0xca')]:0x0;if(!checkContactEmpty(_0x3582eb)){_0x11ca54[_0xc149('0x42')]=_0xc149('0xa6');logger[_0xc149('0x83')](_0xc149('0x20b')+_0x11ca54[_0xc149('0x40')]);}else{_0x11ca54['originated']+=_0x3582eb['length'];_0x11ca54[_0xc149('0x42')]=_0xc149('0x20c');for(var _0x49f184=0x0;_0x49f184<_0x3582eb[_0xc149('0x9f')];_0x49f184+=0x1){_0x11ca54[_0xc149('0x20d')]+=0x1;if(_[_0xc149('0xb3')](_0x3582eb[_0x49f184])||_[_0xc149('0xb3')](_0x3582eb[_0x49f184]['Contact'])||_['isNil'](_0x3582eb[_0x49f184][_0xc149('0x176')][_0xc149('0x177')])){_0x4398b0[_0xc149('0xd5')](_0xc149('0x20e'),_0x11ca54,_0x3582eb[_0x49f184]);}else{_0x4398b0[_0xc149('0xc2')](_[_0xc149('0xd7')](_0x3582eb[_0x49f184],[_0xc149('0xdb'),_0xc149('0x20f')]))[_0xc149('0xbf')](_0x4398b0['checkContactBlack'](_0x11ca54,_0x3582eb[_0x49f184]))[_0xc149('0xb6')](_0x4398b0[_0xc149('0xd4')](_0xc149('0x210'),_0x11ca54));}}}})[_0xc149('0xb6')](loggerGetContactDialer(_0xc149('0x211'),_0x11ca54,_0x42044a));}};Dialer['prototype'][_0xc149('0x166')]=function(_0x72165,_0x49020f){var _0x47c067=this;var _0xafdb00=[];var _0x30b876=_0x49020f>=0x1?_0x49020f:0x1;if(_0x72165['dialMethod']===_0xc149('0x9')){_0x30b876=0x1;}var _0x2eb74a=Math[_0xc149('0x1d5')](_0x72165[_0xc149('0x50')]*_0x30b876)-_0x72165[_0xc149('0x74')]-_0x72165['temp'];emitVoiceQueueSummary(_0x72165);if(_0x72165[_0xc149('0x212')]>0x0){var _0x1d268e=_0x72165[_0xc149('0x212')]-_0x72165[_0xc149('0x74')]-_0x72165[_0xc149('0x55')]-_0x72165['temp']-_0x72165[_0xc149('0x52')];if(_0x2eb74a>_0x1d268e){_0x2eb74a=_0x1d268e;}}if(_0x2eb74a>0x0){if(_0x72165[_0xc149('0x164')]===_0xc149('0x9')){_0x2eb74a=0x1;}if(_0x2eb74a>this[_0xc149('0x25')]){_0x2eb74a=this[_0xc149('0x25')];}_0x72165[_0xc149('0xca')]+=_0x2eb74a;for(var _0x198d7a in this[_0xc149('0x23')]){if(typeof this[_0xc149('0x23')][_0x198d7a]!==_0xc149('0xa0')){if(this[_0xc149('0x23')][_0x198d7a]['state']===_0xc149('0x213')&&this[_0xc149('0x23')][_0x198d7a][_0xc149('0xb4')]===_0xc149('0x214')){_0xafdb00[_0xc149('0x137')](this[_0xc149('0x23')][_0x198d7a]['id']);}}}this[_0xc149('0x215')](_0x72165['id'],_0xafdb00,_0x2eb74a,_0x72165[_0xc149('0x20a')],_0x72165)[_0xc149('0xbf')](function(_0x11b405){_0x72165[_0xc149('0xca')]-=_0x2eb74a;_0x72165[_0xc149('0xca')]=_0x72165['temp']>0x0?_0x72165[_0xc149('0xca')]:0x0;if(!checkContactEmpty(_0x11b405)){_0x47c067['countReScheduled'](_0x72165)[_0xc149('0xbf')](sendMessageReschedule(_0x72165))[_0xc149('0xb6')](loggerCatch(_0xc149('0xbe')));}else{_0x72165[_0xc149('0x74')]+=_0x11b405[_0xc149('0x9f')];_0x72165[_0xc149('0x42')]=_0x72165[_0xc149('0x164')]===_0xc149('0x9')?_0xc149('0x216'):_0xc149('0x20c');for(var _0xa42061=0x0;_0xa42061<_0x11b405[_0xc149('0x9f')];_0xa42061+=0x1){if(_['isNil'](_0x11b405[_0xa42061])||_[_0xc149('0xb3')](_0x11b405[_0xa42061][_0xc149('0x176')])||_[_0xc149('0xb3')](_0x11b405[_0xa42061]['Contact'][_0xc149('0x177')])){_0x47c067[_0xc149('0xd5')]('[actionOriginate]\x20',_0x72165,_0x11b405[_0xa42061]);}else{_0x47c067[_0xc149('0xc0')](_[_0xc149('0xd7')](_0x11b405[_0xa42061],[_0xc149('0x103'),_0xc149('0x20f')]))[_0xc149('0xbf')](_0x47c067[_0xc149('0x217')](_0x72165,_0x11b405[_0xa42061]))[_0xc149('0xb6')](_0x47c067[_0xc149('0xd4')](_0xc149('0x20e'),_0x72165));}}}})[_0xc149('0xb6')](loggerGetContactDialer(_0xc149('0x218'),_0x72165,_0x2eb74a));}};Dialer[_0xc149('0xb0')][_0xc149('0x98')]=function(_0x526942){if(_0x526942[_0xc149('0x212')]>0x0){var _0x2c7675=_0x526942[_0xc149('0x212')]-_0x526942[_0xc149('0x74')]-_0x526942[_0xc149('0x55')];if(_0x2c7675>0x0){this[_0xc149('0x219')](_0x526942);}else{loggerPredictiveCalls[_0xc149('0x83')](_0xc149('0x21a'));}}else{this[_0xc149('0x219')](_0x526942);}};Dialer['prototype'][_0xc149('0x219')]=function(_0x4d588d){var _0x465620=this;var _0x1c6d05=[];_0x4d588d['originated']+=0x1;for(var _0x5be900 in this['agents']){if(typeof this['agents'][_0x5be900]!==_0xc149('0xa0')){if(this[_0xc149('0x23')][_0x5be900][_0xc149('0x108')]==='not_inuse'&&this[_0xc149('0x23')][_0x5be900][_0xc149('0xb4')]===_0xc149('0x214')){_0x1c6d05[_0xc149('0x137')](this['agents'][_0x5be900]['id']);}}}this[_0xc149('0x215')](_0x4d588d['id'],_0x1c6d05,0x1,_0x4d588d['dialOrderByScheduledAt'],_0x4d588d)[_0xc149('0xbf')](function(_0x7eddd9){if(!checkContactEmpty(_0x7eddd9)){checkContactLowerLimitOriginate(_0x4d588d,0x1,0x0);_0x465620[_0xc149('0xbd')](_0x4d588d)[_0xc149('0xbf')](sendMessageReschedule(_0x4d588d))['catch'](loggerCatch(_0xc149('0xbe')));}else{_0x4d588d[_0xc149('0x42')]=_0xc149('0x20c');if(_['isNil'](_0x7eddd9[0x0])||_['isNil'](_0x7eddd9[0x0][_0xc149('0x176')])||_[_0xc149('0xb3')](_0x7eddd9[0x0][_0xc149('0x176')][_0xc149('0x177')])){_0x465620[_0xc149('0xd5')](_0xc149('0x20e'),_0x4d588d,_0x7eddd9[0x0]);}else{_0x465620[_0xc149('0xc0')](_[_0xc149('0xd7')](_0x7eddd9[0x0],[_0xc149('0x103'),_0xc149('0x20f')]))[_0xc149('0xbf')](_0x465620['checkContactBlack'](_0x4d588d,_0x7eddd9[0x0]))[_0xc149('0xb6')](_0x465620[_0xc149('0xd4')](_0xc149('0x21b'),_0x4d588d));}}})['catch'](loggerGetContactDialer(_0xc149('0x21c'),_0x4d588d,0x1));emitVoiceQueueSummary(_0x4d588d);};Dialer[_0xc149('0xb0')][_0xc149('0x1ea')]=function(_0x3fd904,_0x243bca,_0x137174,_0x28d058,_0x4b5575,_0x57db62){loggerPredictive[_0xc149('0x83')](_0xc149('0x21d'));loggerPredictive[_0xc149('0x83')](_0xc149('0x21e'),_0x3fd904);loggerPredictive[_0xc149('0x83')](_0xc149('0x21f'),_0x243bca);loggerPredictive[_0xc149('0x83')]('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',_0x137174);loggerPredictive[_0xc149('0x83')](_0xc149('0x220'),_0x28d058);loggerPredictive['info'](_0xc149('0x221'),_0x4b5575);loggerPredictive[_0xc149('0x83')](_0xc149('0x8b'));return new BPromise(function(_0x4c51d4,_0x4d98d0){if(_0x3fd904<=0x0||isNaN(_0x3fd904)){return _0x4d98d0(msgResponse('[abandonmentRate]',_0xc149('0x49'),'m\x20=\x20'+_0x3fd904));}if(_0x137174<=0x0||isNaN(_0x137174)){return _0x4d98d0(msgResponse('[abandonmentRate]',_0xc149('0x49'),_0xc149('0x222')+_0x137174));}if(_0x28d058<=0x0||isNaN(_0x28d058)){return _0x4d98d0(msgResponse(_0xc149('0x223'),_0xc149('0x49'),_0xc149('0x224')+_0x28d058));}if(_0x243bca<=0x0||isNaN(_0x243bca)){return _0x4d98d0(msgResponse(_0xc149('0x223'),_0xc149('0x49'),_0xc149('0x225')+_0x243bca));}if(_0x4b5575<=0x0||isNaN(_0x4b5575)){return _0x4d98d0(msgResponse(_0xc149('0x223'),_0xc149('0x49'),_0xc149('0x226')+_0x4b5575));}_0x57db62=_0x57db62||0x0;var _0x721f1e=0x1/_0x137174;var _0x5415ee=0x0;var _0x3743cf=0x0;var _0xf0ea5d=0x0;var _0x4b73fd=0x0;for(var _0x2d6cd0=0x0;_0xf0ea5d<_0x4b5575;_0x2d6cd0+=0x1){_0x3743cf=_0x2d6cd0/_0x243bca;_0x5415ee=(_0x28d058*_0x3743cf+_0x57db62)/_0x721f1e;_0xf0ea5d=erlangb(_0x5415ee,_0x3fd904);_0x4b73fd=_0x5415ee/_0x3fd904*(0x1-erlangb(_0x5415ee,_0x3fd904));}return _0x4c51d4({'erlangCalls':_0x2d6cd0,'erlangCallToSecond':_0x243bca/_0x2d6cd0,'erlangAbandonmentRate':_0xf0ea5d,'erlangBusyFactor':_0x4b73fd});});};Dialer['prototype'][_0xc149('0x1ec')]=function(_0x275bae,_0x1616d0,_0x14d55c,_0x297909,_0x182a5b,_0x52ab1d){loggerPredictive[_0xc149('0x83')](_0xc149('0x227'));loggerPredictive[_0xc149('0x83')]('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',_0x275bae);loggerPredictive[_0xc149('0x83')](_0xc149('0x21f'),_0x1616d0);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14d55c);loggerPredictive[_0xc149('0x83')](_0xc149('0x220'),_0x297909);loggerPredictive[_0xc149('0x83')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x182a5b);loggerPredictive[_0xc149('0x83')]('---------------------------');return new BPromise(function(_0x51129a,_0x49f4cd){if(_0x275bae<=0x0||isNaN(_0x275bae)){return _0x49f4cd(msgResponse(_0xc149('0x228'),_0xc149('0x49'),_0xc149('0x229')+_0x275bae));}if(_0x14d55c<=0x0||isNaN(_0x14d55c)){return _0x49f4cd(msgResponse(_0xc149('0x228'),_0xc149('0x49'),_0xc149('0x222')+_0x14d55c));}if(_0x297909<=0x0||isNaN(_0x297909)){return _0x49f4cd(msgResponse('[busyFactor]',_0xc149('0x49'),_0xc149('0x224')+_0x297909));}if(_0x1616d0<=0x0||isNaN(_0x1616d0)){return _0x49f4cd(msgResponse(_0xc149('0x228'),_0xc149('0x49'),_0xc149('0x225')+_0x1616d0));}if(_0x182a5b<=0x0||isNaN(_0x182a5b)){return _0x49f4cd(msgResponse(_0xc149('0x228'),'Error',_0xc149('0x22a')+_0x182a5b));}_0x52ab1d=_0x52ab1d||0x0;var _0x33a911=0x1/_0x14d55c;var _0x3c5e15=0x0;var _0x57816a=0x0;var _0x1d2184=0x0;var _0x3c2392=0x0;for(var _0x466181=0x0;_0x3c2392<_0x182a5b;_0x466181+=0x1){_0x57816a=_0x466181/_0x1616d0;_0x3c5e15=(_0x297909*_0x57816a+_0x52ab1d)/_0x33a911;_0x1d2184=erlangb(_0x3c5e15,_0x275bae);_0x3c2392=_0x3c5e15/_0x275bae*(0x1-erlangb(_0x3c5e15,_0x275bae));}return _0x51129a({'erlangCalls':_0x466181,'erlangCallToSecond':_0x1616d0/_0x466181,'erlangAbandonmentRate':_0x1d2184,'erlangBusyFactor':_0x3c2392});});};module[_0xc149('0x22b')]=Dialer; \ No newline at end of file +var _0x1948=['CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','SIP/%s','status','unmonitored','createHistory','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countglobal','emit','[syncAgentComplete][createHistory][0]','countcongestionretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','membername','countnoanswerretry','countnosuchnumberretry','countdropretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialDropMaxRetry','add','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','locked','stateinterface','strategy','push','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','pick','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','predictive','Queue','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIsTrunkReachable','\x5cw{0,','pow','replace','random','match','actionOriginate','object','phone','Contact','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','handlePredictive','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','getContactDialer','RUNNING','[getContactDialer2]','tryOriginatePredictive','not_inuse','reachable','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','agents','trunks','maxNumberOriginate','contactsId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','loopClearZombieChannels','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','name','\x20INTERVAL_IS_NULL','Interval','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','available','loggedIn','pTalking','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\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','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','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','clearing\x20variable\x20handle\x20predictive','outbound','preview','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','isNil','Action','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','campaigns','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','ContactId','VoiceQueueId'];(function(_0x2db9c3,_0x3a8faa){var _0x3e36cc=function(_0xb96757){while(--_0xb96757){_0x2db9c3['push'](_0x2db9c3['shift']());}};_0x3e36cc(++_0x3a8faa);}(_0x1948,0x145));var _0x8194=function(_0x1f8be7,_0x5a2265){_0x1f8be7=_0x1f8be7-0x0;var _0x1aac57=_0x1948[_0x1f8be7];return _0x1aac57;};'use strict';var util=require(_0x8194('0x0'));var _=require(_0x8194('0x1'));var BPromise=require(_0x8194('0x2'));var uuid=require(_0x8194('0x3'));var moment=require(_0x8194('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x8194('0x5'));var ut=require(_0x8194('0x6'));var config=require(_0x8194('0x7'));var logger=require(_0x8194('0x8'))(_0x8194('0x9'));var loggerBooked=require(_0x8194('0x8'))(_0x8194('0xa'));var loggerPredictive=require(_0x8194('0x8'))('predictive');var loggerPredictiveCalls=require(_0x8194('0x8'))(_0x8194('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x8194('0xc'));var ami=require(_0x8194('0xd'));config['redis']=_['defaults'](config[_0x8194('0xe')],{'host':_0x8194('0xf'),'port':0x18eb});var io=require(_0x8194('0x10'))(new Redis(config[_0x8194('0xe')]));var cmHopper=require(_0x8194('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x8194('0x12'));var voiceQueueRt=require(_0x8194('0x13'));var Action=require(_0x8194('0x14'));var History=require('./history');var Final=require(_0x8194('0x15'));var AgentComplete=require(_0x8194('0x16'));var QueueCallerAbandon=require(_0x8194('0x17'));var Hangup=require(_0x8194('0x18'));var ipAgi=process[_0x8194('0x19')][_0x8194('0x1a')]||'127.0.0.1';var strategy={'rrmemory':_0x8194('0x1b'),'roundrobin':_0x8194('0x1c')};var Sequence=function(){};Sequence[_0x8194('0x1d')][_0x8194('0x1e')]=function(_0x2d4463){this[_0x8194('0x1f')]=this[_0x8194('0x1f')]?this[_0x8194('0x1f')][_0x8194('0x20')](_0x2d4463):_0x2d4463();};function Dialer(_0x5abd09,_0x49731d){this[_0x8194('0x21')]=new Sequence();this['preview']=_0x49731d;this[_0x8194('0x22')]=_0x5abd09['voiceQueues'];this['campaigns']=_0x5abd09['campaigns'];this[_0x8194('0x23')]=_0x5abd09[_0x8194('0x23')];this[_0x8194('0x24')]=_0x5abd09[_0x8194('0x24')];this[_0x8194('0x25')]=config[_0x8194('0x25')]||0x2;this['channels']={};this['actions']={};this[_0x8194('0x26')]={};this['uniqueId']={};this[_0x8194('0x27')]={};this[_0x8194('0x28')]={};this[_0x8194('0x29')]={};this['ivrOriginated']={};this[_0x8194('0x2a')]={};this[_0x8194('0x2b')]={};ami['on'](_0x8194('0x2c'),this[_0x8194('0x2d')][_0x8194('0x2e')](this));ami['on'](_0x8194('0x2f'),this[_0x8194('0x30')][_0x8194('0x2e')](this));ami['on'](_0x8194('0x31'),this[_0x8194('0x32')][_0x8194('0x2e')](this));ami['on'](_0x8194('0x33'),this['syncAgentComplete'][_0x8194('0x2e')](this));ami['on'](_0x8194('0x34'),this[_0x8194('0xc')][_0x8194('0x2e')](this));ami['on']('hangup',this[_0x8194('0x35')][_0x8194('0x2e')](this));ami['on'](_0x8194('0x36'),this[_0x8194('0x37')][_0x8194('0x2e')](this));ami['on']('varset',this['syncVarSet'][_0x8194('0x2e')](this));ami['on'](_0x8194('0x38'),this[_0x8194('0x39')][_0x8194('0x2e')](this));ami['on'](_0x8194('0x3a'),this['syncQueueStatusComplete']['bind'](this));this['loopCampaigns']();this[_0x8194('0x3b')]();}function isNotNull(_0x56b5bc){return _0x56b5bc!==null&&!_['isUndefined'](_0x56b5bc);}function checkIsLoggedIn(_0xb8910b,_0x4178f4){return function(){if(_0x4178f4<=0x0){_0xb8910b['message']=_0x8194('0x3c');throw _0xb8910b['name']+_0x8194('0x3d');}};}function isActive(_0x593043){return _0x593043;}function checkIsActive(_0x2fa6ff,_0x1a8bf9){return function(){if(!isActive(_0x1a8bf9)){_0x2fa6ff[_0x8194('0x3e')]=_0x8194('0x3f');throw _0x2fa6ff[_0x8194('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x1721a1){return function(){if(!isNotNull(_0x1721a1['Interval'])){_0x1721a1[_0x8194('0x3e')]='INTERVAL_IS_NULL';throw _0x1721a1[_0x8194('0x40')]+_0x8194('0x41');}if(!isNotNull(_0x1721a1[_0x8194('0x42')]['Intervals'])){_0x1721a1['message']=_0x8194('0x43');throw _0x1721a1[_0x8194('0x40')]+_0x8194('0x41');}if(!isNotNull(_[_0x8194('0x44')](_0x1721a1['Interval']['Intervals']))){_0x1721a1['message']=_0x8194('0x43');throw _0x1721a1[_0x8194('0x40')]+_0x8194('0x41');}};}function msgResponse(_0x3ffbec,_0x3e0181,_0x53797a){return{'action':_0x3ffbec,'response':_0x3e0181,'message':_0x53797a,'stack':_0x53797a};}function myreject(_0x5a2345){return function(_0x2f479e){return _0x5a2345(msgResponse(_0x8194('0x45'),_0x8194('0x46'),JSON[_0x8194('0x47')](_0x2f479e)));};}function getSeconds(_0x3f2ac3,_0x1f288c){var _0xa5dedc=moment(_0x3f2ac3)[_0x8194('0x48')](0x0);var _0x3627ec=moment(_0x1f288c)[_0x8194('0x48')](0x0);return _0xa5dedc[_0x8194('0x49')](_0x3627ec,_0x8194('0x4a'));}function emit(_0x4fc1f5,_0x1be49d,_0x48a8ee){io['to'](_0x4fc1f5)['emit'](_0x1be49d,_0x48a8ee);}function emitVoiceQueueSummary(_0x3026fd){if(_0x3026fd[_0x8194('0x4b')]==='outbound'){var _0x5dcd15={'id':_0x3026fd['id'],'name':_0x3026fd['name'],'strategy':_0x3026fd['strategy'],'answered':_0x3026fd['answered'],'available':_0x3026fd[_0x8194('0x4c')],'loggedIn':_0x3026fd[_0x8194('0x4d')],'pTalking':_0x3026fd[_0x8194('0x4e')],'sumBillable':_0x3026fd['sumBillable'],'sumDuration':_0x3026fd['sumDuration'],'sumHoldTime':_0x3026fd['sumHoldTime']||0x0,'talking':_0x3026fd[_0x8194('0x4f')],'total':_0x3026fd[_0x8194('0x50')],'type':_0x3026fd[_0x8194('0x4b')],'unmanaged':_0x3026fd[_0x8194('0x51')],'abandoned':_0x3026fd['abandoned'],'waiting':_0x3026fd[_0x8194('0x52')],'loggedInDb':_0x3026fd[_0x8194('0x53')],'dialActive':_0x3026fd[_0x8194('0x54')],'dialMethod':_0x3026fd[_0x8194('0x55')],'dialOriginateCallerIdName':_0x3026fd[_0x8194('0x56')],'dialOriginateCallerIdNumber':_0x3026fd['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3026fd[_0x8194('0x57')],'dialPrefix':_0x3026fd[_0x8194('0x58')],'outboundAnswerAgiCallsDay':_0x3026fd[_0x8194('0x59')],'outboundAnswerCallsDay':_0x3026fd[_0x8194('0x5a')],'outboundBlacklistCallsDay':_0x3026fd[_0x8194('0x5b')],'outboundBusyCallsDay':_0x3026fd[_0x8194('0x5c')],'outboundCongestionCallsDay':_0x3026fd[_0x8194('0x5d')],'outboundDropCallsDayACS':_0x3026fd['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3026fd[_0x8194('0x5e')],'outboundDropCallsDayTimeout':_0x3026fd[_0x8194('0x5f')],'outboundNoAnswerCallsDay':_0x3026fd[_0x8194('0x60')],'outboundNoSuchCallsDay':_0x3026fd[_0x8194('0x61')],'outboundOriginateFailureCallsDay':_0x3026fd['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3026fd['outboundReCallsDay'],'outboundRejectCallsDay':_0x3026fd[_0x8194('0x62')],'outboundUnknownCallsDay':_0x3026fd['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3026fd[_0x8194('0x63')],'predictiveIntervalAvgHoldtime':_0x3026fd['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3026fd[_0x8194('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x3026fd['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3026fd[_0x8194('0x65')],'predictiveIntervalErlangCalls':_0x3026fd[_0x8194('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x3026fd[_0x8194('0x67')],'predictiveIntervalHitRate':_0x3026fd[_0x8194('0x68')],'predictiveIntervalMultiplicativeFactor':_0x3026fd['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3026fd[_0x8194('0x69')],'predictiveIntervalAvailable':_0x3026fd[_0x8194('0x6a')],'predictiveIntervalTotalCalls':_0x3026fd[_0x8194('0x6b')],'message':_0x3026fd['message'],'originated':_0x3026fd[_0x8194('0x6c')],'erlangCalls':_0x3026fd[_0x8194('0x6d')],'erlangCallToSecond':_0x3026fd[_0x8194('0x6e')],'erlangAbandonmentRate':_0x3026fd[_0x8194('0x6f')],'erlangBusyFactor':_0x3026fd[_0x8194('0x70')],'startPredictive':_0x3026fd['startPredictive'],'startProgressive':_0x3026fd[_0x8194('0x29')]};if(_0x3026fd['Trunk']){_0x5dcd15[_0x8194('0x71')]={'id':_0x3026fd[_0x8194('0x71')]['id'],'name':_0x3026fd[_0x8194('0x71')][_0x8194('0x40')],'active':_0x3026fd[_0x8194('0x71')][_0x8194('0x72')],'callerid':_0x3026fd[_0x8194('0x71')][_0x8194('0x73')]};}if(_0x3026fd[_0x8194('0x42')]){_0x5dcd15[_0x8194('0x42')]={'id':_0x3026fd[_0x8194('0x42')]['id'],'name':_0x3026fd[_0x8194('0x42')][_0x8194('0x40')]};}var _0x349e27=md5(JSON[_0x8194('0x47')](_0x5dcd15));if(_0x3026fd[_0x8194('0x74')]!==_0x349e27){_0x3026fd[_0x8194('0x74')]=_0x349e27;emit(util[_0x8194('0x75')]('voice:queue:%s',_0x5dcd15[_0x8194('0x40')]),_0x8194('0x76'),_0x5dcd15);}}}function emitCampaignSummary(_0x5542ed){if(_0x5542ed['type']===_0x8194('0x77')){emit(util[_0x8194('0x75')](_0x8194('0x78'),_0x5542ed[_0x8194('0x40')]),_0x8194('0x79'),_0x5542ed);}}function checkGetDataPredictive(_0x33aadc){if(isNotNull(_0x33aadc)&&!_[_0x8194('0x44')](_0x33aadc)){loggerPredictive[_0x8194('0x7a')](_0x8194('0x7b'));loggerPredictive[_0x8194('0x7a')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33aadc['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33aadc[_0x8194('0x63')]);loggerPredictive[_0x8194('0x7a')](_0x8194('0x7c'),_0x33aadc[_0x8194('0x65')]);loggerPredictive[_0x8194('0x7a')](_0x8194('0x7d'),_0x33aadc[_0x8194('0x7e')]);loggerPredictive[_0x8194('0x7a')](_0x8194('0x7f'),_0x33aadc['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x8194('0x80'),_0x33aadc[_0x8194('0x64')]);loggerPredictive[_0x8194('0x7a')](_0x8194('0x81'));if(_0x33aadc[_0x8194('0x6b')]>0x0){if(!_[_0x8194('0x82')](_0x33aadc['predictiveIntervalAvgTalktime'])&&_0x33aadc[_0x8194('0x64')]>0x0){return!![];}loggerPredictive[_0x8194('0x7a')](_0x8194('0x83'));if(!_[_0x8194('0x82')](_0x33aadc[_0x8194('0x84')])&&_0x33aadc[_0x8194('0x84')]>0x0){return!![];}loggerPredictive[_0x8194('0x7a')](_0x8194('0x85'));}else{loggerPredictive['info'](_0x8194('0x86'));}}else{loggerPredictive[_0x8194('0x7a')](_0x8194('0x87'));}return![];}function mergeDataErlangB(_0x2ca00a){return function(_0x3105cb){loggerPredictive[_0x8194('0x7a')](_0x8194('0x88'));loggerPredictive[_0x8194('0x7a')](_0x8194('0x89'),_0x3105cb[_0x8194('0x6d')]);loggerPredictive[_0x8194('0x7a')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3105cb[_0x8194('0x6e')]);loggerPredictive[_0x8194('0x7a')](_0x8194('0x8a'),_0x3105cb[_0x8194('0x6f')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3105cb[_0x8194('0x70')]);loggerPredictive[_0x8194('0x7a')](_0x8194('0x8a'),_0x3105cb[_0x8194('0x6f')]);loggerPredictive[_0x8194('0x7a')]('---------------------------');_[_0x8194('0x8b')](_0x2ca00a,_0x3105cb);};}function getDiff(_0xb8ad36){var _0x131e23=moment()[_0x8194('0x48')](0x0);var _0x1ba2cb=moment(_0xb8ad36)[_0x8194('0x48')](0x0);return _0x131e23[_0x8194('0x49')](_0x1ba2cb,_0x8194('0x4a'));}function ifInterval(_0x297bc7,_0xc2e8e8){if(_[_0x8194('0x82')](_0xc2e8e8)){return![];}return getDiff(_0xc2e8e8)<_0x297bc7*0x3c;}function freeVariablesPredictive(_0x764b80){if(isNotNull(_0x764b80)){if(!_[_0x8194('0x82')](_0x764b80['startProgressive'])){_0x764b80['startProgressive']=undefined;loggerPredictive['info'](_0x764b80[_0x8194('0x40')],_0x8194('0x8c'));}if(!_[_0x8194('0x82')](_0x764b80['startPredictive'])){_0x764b80[_0x8194('0x28')]=undefined;loggerPredictive[_0x8194('0x7a')](_0x764b80['name'],_0x8194('0x8d'));}if(!_['isUndefined'](_0x764b80['handlePredictive'])){clearInterval(_0x764b80['handlePredictive']);_0x764b80['handlePredictive']=undefined;loggerPredictive[_0x8194('0x7a')](_0x764b80[_0x8194('0x40')],_0x8194('0x8e'));}}}function erlangb(_0x41e3fb,_0x4ec334){if(_0x4ec334===0x0){return 0x0;}var _0x21cb9d=0x1;for(var _0x31fd4e=0x1;_0x31fd4e<=_0x4ec334;_0x31fd4e+=0x1){_0x21cb9d=0x1+_0x21cb9d*_0x31fd4e/_0x41e3fb;}return 0x1/_0x21cb9d;}function isVoiceQueueOutbound(_0x5df7a2){return _0x5df7a2===_0x8194('0x8f');}function isNotPreview(_0x36a40b){return _0x36a40b!==_0x8194('0x90');}function isCampaignIvr(_0x281507){return _0x281507===_0x8194('0x77');}function getCallerId(_0x3e354b,_0xca4c55,_0x4b4c70){if(!_['isUndefined'](_0x4b4c70)&&typeof _0x4b4c70==='string'&&!_[_0x8194('0x44')](_0x4b4c70)){if(!_[_0x8194('0x82')](_0xca4c55)&&typeof _0xca4c55==='string'&&!_[_0x8194('0x44')](_0xca4c55)){return util[_0x8194('0x75')]('\x22%s\x22\x20<%s>',_0xca4c55,_0x4b4c70);}return util['format'](_0x8194('0x91'),_0x4b4c70,_0x4b4c70);}if(!_[_0x8194('0x82')](_0x3e354b)&&typeof _0x3e354b===_0x8194('0x92')&&!_[_0x8194('0x44')](_0x3e354b)){return _0x3e354b;}return _0x8194('0x93');}function loggerCatchQueueSummary(_0x482c5c,_0x4de8d5){return function(_0x5bfb4c){freeVariablesPredictive(_0x4de8d5);emitVoiceQueueSummary(_0x4de8d5);emitCampaignSummary(_0x4de8d5);loggerSyncQueueSummary[_0x8194('0x94')](_0x482c5c,util[_0x8194('0x95')](_0x5bfb4c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x13f881,_0x4ea859){return function(_0x24b6f9){loggerPredictive['error'](_0x4ea859[_0x8194('0x40')],_0x13f881);loggerPredictive[_0x8194('0x94')](_0x24b6f9[_0x8194('0x96')]);freeVariablesPredictive(_0x4ea859);};}function loggerCatch(_0x4a233a){return function(_0x1341ce){logger['error'](_0x4a233a,util['inspect'](_0x1341ce,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x574094){return _0x574094&&!_[_0x8194('0x82')](_0x574094)&&_0x574094[_0x8194('0x97')]>0x0;}function decremetOriginate(_0x1deb8){if(!_[_0x8194('0x82')](_0x1deb8)&&_0x1deb8!==null){if(typeof _0x1deb8['originated']!==_0x8194('0x98')){if(_0x1deb8['originated']>0x0){_0x1deb8[_0x8194('0x6c')]-=0x1;}else{logger[_0x8194('0x94')](_0x8194('0x99'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x40d6d7,_0x58623f,_0x472680){if(_0x58623f>_0x472680){for(var _0xd26f9a=0x0;_0xd26f9a<_0x58623f-_0x472680;_0xd26f9a+=0x1){decremetOriginate(_0x40d6d7);}}}function loggerGetContactDialer(_0x41d813,_0x221e7a,_0x353dab){return function(_0x4413fb){checkContactLowerLimitOriginate(_0x221e7a,_0x353dab,0x0);logger[_0x8194('0x94')](_0x41d813,util[_0x8194('0x95')](_0x4413fb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x26bd94){return function(_0x47cc54){if(isNotNull(_0x47cc54)&&isNotNull(_0x47cc54[0x0])){if(_0x47cc54[0x0]['contactsRescheduled']>0x0){_0x26bd94['message']=_0x8194('0x9a');logger[_0x8194('0x7a')](_0x8194('0x9b')+_0x26bd94['name'],_0x47cc54[0x0][_0x8194('0x9c')],_0x8194('0x9d'));}else{_0x26bd94[_0x8194('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x8194('0x7a')](_0x8194('0x9e')+_0x26bd94[_0x8194('0x40')]);}}};}function notSendMessagesQueue(_0x4465d7){if(_0x4465d7[_0x8194('0x9f')]){freeVariablesPredictive(_0x4465d7);if(_0x4465d7['originated']===0x0&&_0x4465d7[_0x8194('0x4f')]===0x0&&_0x4465d7[_0x8194('0x52')]===0x0&&(_0x4465d7['pTalking']||0x0)===0x0){_0x4465d7[_0x8194('0x9f')]=![];_0x4465d7['available']=0x0;_0x4465d7[_0x8194('0x3e')]=_0x8194('0x3f');loggerSyncQueueSummary[_0x8194('0x94')](_0x8194('0xa0'),_0x4465d7[_0x8194('0x40')],_0x8194('0xa1'));}else{_0x4465d7[_0x8194('0x3e')]=_0x8194('0xa2');loggerSyncQueueSummary['error'](_0x8194('0xa0'),_0x4465d7[_0x8194('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x4465d7);}}function notSendMessagesCampaign(_0x58845f){if(_0x58845f[_0x8194('0x9f')]){if(_0x58845f[_0x8194('0x6c')]===0x0){_0x58845f[_0x8194('0x9f')]=![];_0x58845f[_0x8194('0x3e')]=_0x8194('0x3f');loggerSyncQueueSummary['error'](_0x8194('0xa3'),_0x58845f[_0x8194('0x40')],'is\x20not\x20active');}else{_0x58845f[_0x8194('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x8194('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x58845f[_0x8194('0x40')],_0x8194('0xa4'));}emitCampaignSummary(_0x58845f);}}function createObjHistory(_0x286d9d,_0x57a13b,_0x55a34d,_0x3b7e06,_0x327131){_0x286d9d[_0x8194('0x3e')]=_0x55a34d;var _0x2caa44=new Action(_0x286d9d,_0x57a13b);var _0x127370=new History(_0x2caa44);_0x127370[_0x8194('0xa5')]=_0x3b7e06;_0x127370[_0x8194('0xa6')]=_0x327131;_0x127370[_0x8194('0xa7')]=_0x2caa44[_0x8194('0xa8')];return _0x127370;}Dialer[_0x8194('0x1d')][_0x8194('0x3b')]=function(){var _0x129e04=this;setInterval(function(){_0x129e04[_0x8194('0xa9')](_0x129e04[_0x8194('0xaa')],_0x8194('0xab'));_0x129e04[_0x8194('0xa9')](_0x129e04['actions'],_0x8194('0xac'));},0x32c8);};Dialer[_0x8194('0x1d')]['clearZombieChannels']=function(_0x28c384,_0x299e52){var _0x363018=this;for(var _0x57ad12 in _0x28c384){if(typeof _0x28c384[_0x57ad12]!==_0x8194('0x98')){this['sequence'][_0x8194('0x1e')](function(){if(!_[_0x8194('0xad')](_0x28c384[_0x57ad12])){return ami[_0x8194('0xae')]({'action':'status','channel':_0x28c384[_0x57ad12]['channel']})[_0x8194('0xaf')](function(_0x5efe64){if(_0x5efe64[_0x8194('0x3e')]===_0x8194('0xb0')){setTimeout(function(){if(_0x28c384[_0x57ad12]&&_0x28c384[_0x57ad12][_0x8194('0x4b')]!=='ivr'){_0x363018['updateOriginated'](_0x363018['voiceQueues'][_0x28c384[_0x57ad12][_0x8194('0xb1')]]);logger[_0x8194('0x94')](_0x8194('0xb2'),_0x299e52,_0x57ad12,_0x28c384[_0x57ad12]['queue']);delete _0x28c384[_0x57ad12];}if(_0x28c384[_0x57ad12]&&_0x28c384[_0x57ad12][_0x8194('0x4b')]===_0x8194('0x77')){_0x363018[_0x8194('0xb3')](_0x363018[_0x8194('0xb4')][_0x28c384[_0x57ad12][_0x8194('0xb1')]]);logger['error'](_0x8194('0xb5'),_0x299e52,_0x57ad12,_0x28c384[_0x57ad12][_0x8194('0xb1')]);delete _0x28c384[_0x57ad12];}},0x2328);}});}});}}};Dialer[_0x8194('0x1d')][_0x8194('0xb6')]=function(_0x415d1e){return BPromise[_0x8194('0xb7')]()['then'](cmHopper['countReScheduled'](_0x415d1e))[_0x8194('0xaf')](loggerCatch(_0x8194('0xb8')));};Dialer['prototype']['checkIsBlackList']=function(_0x1bf3f7){return BPromise['resolve']()[_0x8194('0xb9')](cmHopperBlack[_0x8194('0xba')](_0x1bf3f7))[_0x8194('0xaf')](loggerCatch(_0x8194('0xbb')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x354ff2){return BPromise[_0x8194('0xb7')]()['then'](cmHopperBlack[_0x8194('0xbc')](_0x354ff2))[_0x8194('0xaf')](loggerCatch(_0x8194('0xbd')));};Dialer['prototype'][_0x8194('0xbe')]=function(_0x4c79d5){return BPromise['resolve']()[_0x8194('0xb9')](cmHopperHistory[_0x8194('0xbf')](_0x4c79d5))[_0x8194('0xaf')](loggerCatch(_0x8194('0xc0')));};Dialer['prototype'][_0x8194('0xc1')]=function(_0x240324){return BPromise[_0x8194('0xb7')]()['then'](cmHopper[_0x8194('0xc1')](_0x240324))[_0x8194('0xaf')](loggerCatch(_0x8194('0xc2')));};Dialer['prototype'][_0x8194('0xc3')]=function(_0xa725bf,_0x4f1f8d,_0x157690){return BPromise[_0x8194('0xb7')]()[_0x8194('0xb9')](cmHopper[_0x8194('0xc3')](_0xa725bf,_0x4f1f8d,_0x157690))['catch'](loggerCatch(_0x8194('0xc4')));};Dialer[_0x8194('0x1d')]['getContactDialer']=function(_0x678b41,_0xb3da9d,_0x315d95,_0x712f1f,_0x441f65){return BPromise['resolve']()[_0x8194('0xb9')](cmHopper['getContactDialer'](_0x678b41,_0xb3da9d,_0x315d95,_0x712f1f))['catch'](function(_0x57919f){_0x441f65[_0x8194('0xc5')]-=_0x315d95;_0x441f65[_0x8194('0xc5')]=_0x441f65[_0x8194('0xc5')]>0x0?_0x441f65[_0x8194('0xc5')]:0x0;loggerCatch(_0x8194('0xc6'))(_0x57919f);});};Dialer[_0x8194('0x1d')][_0x8194('0xc7')]=function(_0x58c353,_0x1e3cdb,_0x72d774,_0x4052ba){return BPromise['resolve']()[_0x8194('0xb9')](cmHopper['getContactDialerIvr'](_0x58c353,_0x1e3cdb,_0x72d774))[_0x8194('0xaf')](function(_0x5cc378){_0x4052ba[_0x8194('0xc5')]-=_0x1e3cdb;_0x4052ba['temp']=_0x4052ba['temp']>0x0?_0x4052ba[_0x8194('0xc5')]:0x0;loggerCatch(_0x8194('0xc8'))(_0x5cc378);});};Dialer[_0x8194('0x1d')][_0x8194('0xc9')]=function(_0x3e60ae){return BPromise['resolve']()[_0x8194('0xb9')](voiceQueueRt['getVoiceQueueRtPauses'](_0x3e60ae))[_0x8194('0xaf')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x8194('0x1d')][_0x8194('0xca')]=function(_0x2acc87){return BPromise['resolve']()['then'](cmHopper['moveContactManagedDialer'](_0x2acc87))['catch'](loggerCatch(_0x8194('0xcb')));};Dialer[_0x8194('0x1d')]['createHistory']=function(_0x28ec84){return BPromise[_0x8194('0xb7')]()[_0x8194('0xb9')](cmHopperHistory['createHistory'](_0x28ec84))[_0x8194('0xaf')](loggerCatch('[createHistory]\x20'));};Dialer[_0x8194('0x1d')]['updateOriginated']=function(_0xaf261f){if(!_[_0x8194('0x82')](_0xaf261f)&&_0xaf261f!==null){if(typeof _0xaf261f[_0x8194('0x6c')]!==_0x8194('0x98')){if(_0xaf261f[_0x8194('0x6c')]>0x0){_0xaf261f[_0x8194('0x6c')]-=0x1;}else{logger[_0x8194('0x94')](_0x8194('0xcc'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x8194('0x1d')][_0x8194('0xcd')]=function(_0x279a84,_0x148d95){var _0x563799=this;return function(_0x3b4fc4){_0x563799[_0x8194('0xb3')](_0x148d95);logger[_0x8194('0x94')](_0x279a84,util['inspect'](_0x3b4fc4,{'showHidden':![],'depth':null}));};};Dialer[_0x8194('0x1d')][_0x8194('0xce')]=function(_0x165c72,_0x4749e0,_0x5b38cc){var _0x10d490={'state':0x19,'statedesc':_0x8194('0xcf')};this[_0x8194('0xb3')](_0x4749e0);this[_0x8194('0xd0')](_[_0x8194('0x8b')](_0x10d490,_['pick'](_0x5b38cc,[_0x8194('0xd1'),'ListId','UserId',_0x8194('0xd2'),_0x8194('0xd3')])),_0x8194('0xd4'),_0x8194('0xd5'));logger[_0x8194('0x94')](_0x165c72);};Dialer[_0x8194('0x1d')][_0x8194('0xd6')]=function(_0x2236ea){return _0x2236ea==='Success';};Dialer['prototype']['isTrunkReachable']=function(_0xc9b8f0){return!_[_0x8194('0x82')](_0xc9b8f0)&&_0xc9b8f0&&!_[_0x8194('0x82')](_0xc9b8f0[_0x8194('0x40')])&&!_[_0x8194('0x82')](_0xc9b8f0['active'])&&_0xc9b8f0[_0x8194('0x72')]&&(this[_0x8194('0x24')][util[_0x8194('0x75')](_0x8194('0xd7'),_0xc9b8f0['name'])]['status']==='reachable'||this[_0x8194('0x24')][util[_0x8194('0x75')]('SIP/%s',_0xc9b8f0[_0x8194('0x40')])][_0x8194('0xd8')]===_0x8194('0xd9'));};Dialer[_0x8194('0x1d')][_0x8194('0xd0')]=function(_0x38bca1,_0x3a536e,_0x59a6d5){this[_0x8194('0xda')](_0x38bca1)[_0x8194('0xaf')](loggerCatch(_0x3a536e));this[_0x8194('0xca')](_0x38bca1)[_0x8194('0xaf')](loggerCatch(_0x59a6d5));};Dialer[_0x8194('0x1d')][_0x8194('0xdb')]=function(_0x4fb806){var _0xbad68c=this['uniqueId'][_0x4fb806['uniqueid']];var _0x21f236;if(!_[_0x8194('0xad')](_0x4fb806)&&!_[_0x8194('0xad')](_0x4fb806[_0x8194('0xdc')])&&!_['isNil'](_0x4fb806[_0x8194('0xdc')][_0x8194('0xdd')])&&_0x4fb806[_0x8194('0xde')]===_0x8194('0xdf')&&_0xbad68c){if(_0xbad68c[_0x8194('0x4b')]!=='ivr'&&this[_0x8194('0x22')][_0xbad68c[_0x8194('0xb1')]][_0x8194('0xe0')]&&_0x4fb806[_0x8194('0xe1')]===_0x8194('0xe2')){delete this['uniqueId'][_0x4fb806[_0x8194('0xe3')]];this[_0x8194('0xb3')](this[_0x8194('0x22')][_0xbad68c[_0x8194('0xb1')]]);this['voiceQueues'][_0xbad68c[_0x8194('0xb1')]][_0x8194('0x5a')]+=0x1;this[_0x8194('0x22')][_0xbad68c[_0x8194('0xb1')]][_0x8194('0x59')]+=0x1;_0x21f236=new Hangup(_0xbad68c,_0x4fb806);_0x21f236['state']=0x12;_0x21f236['statedesc']=_0x8194('0xe4');_0x21f236['membername']=_0x8194('0xe5');ami['emit'](_0x8194('0xe6'),ut[_0x8194('0xe7')](_0x21f236,_0x8194('0xe8')));this[_0x8194('0xd0')](_0x21f236,_0x8194('0xe9'),_0x8194('0xea'));}if(_0xbad68c[_0x8194('0x4b')]!==_0x8194('0x77')&&this['voiceQueues'][_0xbad68c[_0x8194('0xb1')]][_0x8194('0xe0')]&&_0x4fb806[_0x8194('0xe1')]===_0x8194('0xeb')){var _0x4d2a4c=this;return new BPromise(function(_0xdf74c5,_0x302052){delete _0x4d2a4c[_0x8194('0xaa')][_0x4fb806[_0x8194('0xe3')]];_0x4d2a4c[_0x8194('0xb3')](_0x4d2a4c['voiceQueues'][_0xbad68c[_0x8194('0xb1')]]);_0x4d2a4c[_0x8194('0x22')][_0xbad68c[_0x8194('0xb1')]][_0x8194('0x5a')]+=0x1;_0x4d2a4c[_0x8194('0x22')][_0xbad68c[_0x8194('0xb1')]][_0x8194('0x59')]+=0x1;var _0x267b2a=_0x4d2a4c[_0x8194('0x22')][_0xbad68c[_0x8194('0xb1')]];var _0x283885=new Hangup(_0xbad68c,_0x4fb806);_0x283885['state']=0x13;_0x283885['statedesc']='Machine';_0x283885['membername']=_0x8194('0xe5');_0x283885['countmachineretry']+=0x1;_0x283885[_0x8194('0xec')]+=0x1;_0x283885[_0x8194('0xe8')]=!![];ami[_0x8194('0xed')](_0x8194('0xe6'),ut[_0x8194('0xe7')](_0x283885,_0x8194('0xe8')));_0x4d2a4c[_0x8194('0xda')](_0x283885)['catch'](loggerCatch(_0x8194('0xee')));if(_0x283885['countbusyretry']+_0x283885[_0x8194('0xef')]+_0x283885['countnoanswerretry']+_0x283885['countnosuchnumberretry']+_0x283885['countdropretry']+_0x283885[_0x8194('0xf0')]+_0x283885[_0x8194('0xf1')]+_0x283885[_0x8194('0xf2')]>=_0x267b2a[_0x8194('0xf3')]){_0x4d2a4c[_0x8194('0xf4')](_0x283885,_0xdf74c5,_0x302052,_0x8194('0xf5'));}else{if(_0x283885[_0x8194('0xf1')]>=_0x267b2a['dialMachineMaxRetry']){_0x4d2a4c['createStateFinal'](_0x283885,_0xdf74c5,_0x302052,'reason\x2019\x20machine....');}else{_0x4d2a4c[_0x8194('0xc1')]({'active':![],'countmachineretry':_0x283885['countmachineretry'],'scheduledat':moment()['add'](_0x267b2a[_0x8194('0xf6')],_0x8194('0xf7'))[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x283885[_0x8194('0xd1')],'ListId':_0x283885[_0x8194('0xf9')],'VoiceQueueId':_0x283885[_0x8194('0xd2')]||undefined,'CampaignId':_0x283885[_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0xfa')));_0xdf74c5({'reschedule':0x1});}}});}if(_0xbad68c[_0x8194('0x4b')]===_0x8194('0x77')&&this[_0x8194('0xb4')][_0xbad68c[_0x8194('0xb1')]][_0x8194('0xe0')]&&_0x4fb806['value']==='HANGUP'){delete this[_0x8194('0xaa')][_0x4fb806[_0x8194('0xe3')]];this[_0x8194('0xb3')](this[_0x8194('0xb4')][_0xbad68c[_0x8194('0xb1')]]);_0x21f236=new Hangup(_0xbad68c,_0x4fb806);_0x21f236[_0x8194('0xa5')]=0x12;_0x21f236[_0x8194('0xa6')]=_0x8194('0xe4');_0x21f236['membername']='AMD';ami[_0x8194('0xed')](_0x8194('0xe6'),ut[_0x8194('0xe7')](_0x21f236,_0x8194('0xe8')));this[_0x8194('0xd0')](_0x21f236,_0x8194('0xfb'),'[syncHangupInAMDIvr]');}if(_0xbad68c[_0x8194('0x4b')]===_0x8194('0x77')&&this[_0x8194('0xb4')][_0xbad68c[_0x8194('0xb1')]][_0x8194('0xe0')]&&_0x4fb806[_0x8194('0xe1')]===_0x8194('0xeb')){var _0x4d2a4c=this;return new BPromise(function(_0x17579a,_0x59c449){delete _0x4d2a4c[_0x8194('0xaa')][_0x4fb806[_0x8194('0xe3')]];_0x4d2a4c[_0x8194('0xb3')](_0x4d2a4c['campaigns'][_0xbad68c['queue']]);_0x4d2a4c[_0x8194('0xb4')][_0xbad68c[_0x8194('0xb1')]][_0x8194('0x5a')]+=0x1;_0x4d2a4c['campaigns'][_0xbad68c[_0x8194('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2351f3=_0x4d2a4c[_0x8194('0xb4')][_0xbad68c[_0x8194('0xb1')]];var _0x27c729=new Hangup(_0xbad68c,_0x4fb806);_0x27c729['state']=0x13;_0x27c729[_0x8194('0xa6')]='Machine';_0x27c729[_0x8194('0xfc')]='AMD';_0x27c729[_0x8194('0xf1')]+=0x1;_0x27c729[_0x8194('0xec')]+=0x1;_0x27c729[_0x8194('0xe8')]=!![];ami[_0x8194('0xed')](_0x8194('0xe6'),ut[_0x8194('0xe7')](_0x27c729,'amd'));_0x4d2a4c[_0x8194('0xda')](_0x27c729)[_0x8194('0xaf')](loggerCatch(_0x8194('0xee')));if(_0x27c729['countbusyretry']+_0x27c729[_0x8194('0xef')]+_0x27c729[_0x8194('0xfd')]+_0x27c729[_0x8194('0xfe')]+_0x27c729[_0x8194('0xff')]+_0x27c729[_0x8194('0xf0')]+_0x27c729[_0x8194('0xf1')]+_0x27c729[_0x8194('0xf2')]>=_0x2351f3[_0x8194('0xf3')]){_0x4d2a4c[_0x8194('0xf4')](_0x27c729,_0x17579a,_0x59c449,_0x8194('0xf5'));}else{if(_0x27c729[_0x8194('0xf1')]>=_0x2351f3[_0x8194('0x100')]){_0x4d2a4c[_0x8194('0x101')](_0x27c729,_0x17579a,_0x59c449,_0x8194('0x102'));}else{_0x4d2a4c[_0x8194('0xc1')]({'active':![],'countmachineretry':_0x27c729['countmachineretry'],'scheduledat':moment()['add'](_0x2351f3['dialMachineRetryFrequency'],_0x8194('0xf7'))[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x27c729['ContactId'],'ListId':_0x27c729['ListId'],'VoiceQueueId':_0x27c729[_0x8194('0xd2')]||undefined,'CampaignId':_0x27c729['CampaignId']||undefined})[_0x8194('0xaf')](loggerCatch('[rescheduleContact][Machine]'));_0x17579a({'reschedule':0x1});}}});}}};Dialer[_0x8194('0x1d')]['syncHangup']=function(_0x370bbf){var _0xa62c6e=this[_0x8194('0xaa')][_0x370bbf[_0x8194('0xe3')]];var _0x354993=this;var _0x2f77ea;if(_0xa62c6e&&_0xa62c6e[_0x8194('0x4b')]===_0x8194('0x77')){delete this['uniqueId'][_0x370bbf[_0x8194('0xe3')]];this[_0x8194('0xb3')](this[_0x8194('0xb4')][_0xa62c6e[_0x8194('0xb1')]]);this['campaigns'][_0xa62c6e[_0x8194('0xb1')]]['ivrAnswerCallsDay']+=0x1;_0x2f77ea=new Hangup(_0xa62c6e,_0x370bbf);this[_0x8194('0xda')](_0x2f77ea)[_0x8194('0xaf')](loggerCatch(_0x8194('0x103')));this[_0x8194('0xca')](_0x2f77ea)[_0x8194('0xaf')](loggerCatch(_0x8194('0x104')));}if(_0xa62c6e&&_0xa62c6e['type']!=='ivr'&&isNotNull(this[_0x8194('0x22')][_0xa62c6e['queue']][_0x8194('0x105')])){delete this[_0x8194('0xaa')][_0x370bbf[_0x8194('0xe3')]];this[_0x8194('0xb3')](this[_0x8194('0x22')][_0xa62c6e[_0x8194('0xb1')]]);this[_0x8194('0x22')][_0xa62c6e[_0x8194('0xb1')]][_0x8194('0x5a')]+=0x1;this[_0x8194('0x22')][_0xa62c6e[_0x8194('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2f77ea=new Hangup(_0xa62c6e,_0x370bbf);_0x2f77ea['state']=0x10;_0x2f77ea[_0x8194('0xa6')]=_0x8194('0x106');_0x2f77ea['membername']=_0x8194('0x107');this[_0x8194('0xda')](_0x2f77ea)['catch'](loggerCatch(_0x8194('0x103')));this[_0x8194('0xca')](_0x2f77ea)['catch'](loggerCatch(_0x8194('0x104')));}if(_0xa62c6e&&_0xa62c6e[_0x8194('0x4b')]!==_0x8194('0x77')&&!isNotNull(this[_0x8194('0x22')][_0xa62c6e[_0x8194('0xb1')]][_0x8194('0x105')])){delete this[_0x8194('0xaa')][_0x370bbf[_0x8194('0xe3')]];this[_0x8194('0xb3')](this[_0x8194('0x22')][_0xa62c6e['queue']]);this['voiceQueues'][_0xa62c6e[_0x8194('0xb1')]]['outboundUnknownCallsDay']+=0x1;_0x2f77ea=new Hangup(_0xa62c6e,_0x370bbf);_0x2f77ea[_0x8194('0xa5')]=0xc;_0x2f77ea[_0x8194('0xa6')]=_0x370bbf[_0x8194('0x108')];_0x2f77ea[_0x8194('0xfc')]=_0x8194('0x109');this[_0x8194('0xda')](_0x2f77ea)[_0x8194('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x2f77ea)[_0x8194('0xaf')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype']['syncAgentComplete']=function(_0x265629){var _0x4881f5=this[_0x8194('0xaa')][_0x265629[_0x8194('0xe3')]];var _0x4257ba=this;if(this['voiceQueues'][_0x265629[_0x8194('0xb1')]]){if(_0x4881f5&&_0x4881f5[_0x8194('0x4b')]!==_0x8194('0x77')){delete this['uniqueId'][_0x265629[_0x8194('0xe3')]];this['voiceQueues'][_0x265629[_0x8194('0xb1')]]['outboundAnswerCallsDay']+=0x1;var _0x5f49fa=new AgentComplete(_0x4881f5,_0x265629);if(_0x265629['reason']==='agent'){_0x5f49fa[_0x8194('0x10a')]=this[_0x8194('0x22')][_0x265629[_0x8194('0xb1')]][_0x8194('0x10b')]&&this[_0x8194('0x22')][_0x265629[_0x8194('0xb1')]][_0x8194('0x10c')]?moment()[_0x8194('0x75')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x8194('0xda')](_0x5f49fa)['catch'](loggerCatch(_0x8194('0x10d')));this['moveContactManagedDialer'](_0x5f49fa)[_0x8194('0xaf')](loggerCatch(_0x8194('0x10e')));}}};Dialer[_0x8194('0x1d')][_0x8194('0x2d')]=function(_0x130d94){if(this[_0x8194('0x22')][_0x130d94[_0x8194('0xb1')]]){if(this[_0x8194('0xaa')][_0x130d94[_0x8194('0xe3')]]&&this[_0x8194('0xaa')][_0x130d94['uniqueid']][_0x8194('0x4b')]!==_0x8194('0x77')){this['updateOriginated'](this[_0x8194('0x22')][_0x130d94[_0x8194('0xb1')]]);this['uniqueId'][_0x130d94[_0x8194('0xe3')]]['answertime']=moment()[_0x8194('0x75')](_0x8194('0xf8'));}}};Dialer[_0x8194('0x1d')][_0x8194('0x10f')]=function(_0x3798b9){this[_0x8194('0xda')](_0x3798b9)['catch'](loggerCatch(_0x8194('0x10d')));this[_0x8194('0xca')](_0x3798b9)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x8194('0x1d')][_0x8194('0x30')]=function(_0xecd024){var _0x5178fa=this['uniqueId'][_0xecd024[_0x8194('0xe3')]];var _0x11126b=this;if(this[_0x8194('0x22')][_0xecd024['queue']]){if(_0x5178fa&&_0x5178fa[_0x8194('0x4b')]!==_0x8194('0x77')){delete this[_0x8194('0xaa')][_0xecd024[_0x8194('0xe3')]];this[_0x8194('0xb3')](this['voiceQueues'][_0xecd024[_0x8194('0xb1')]]);_0x5178fa['droptime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x54ac2b=new QueueCallerAbandon(_0x5178fa,_0xecd024);if(getSeconds(_0x5178fa[_0x8194('0x110')],_0x5178fa[_0x8194('0x111')])>=_0x5178fa[_0x8194('0x112')]){this[_0x8194('0x22')][_0xecd024[_0x8194('0xb1')]][_0x8194('0x65')]+=0x1;this[_0x8194('0x22')][_0xecd024[_0x8194('0xb1')]][_0x8194('0x5f')]+=0x1;this[_0x8194('0x22')][_0xecd024['queue']][_0x8194('0x67')]+=0x1;_0x54ac2b[_0x8194('0xa5')]=0xa;_0x54ac2b[_0x8194('0xa6')]=_0x8194('0x113');_0x54ac2b['dropreason']=_0x8194('0x114');_0x54ac2b[_0x8194('0x10a')]=this['voiceQueues'][_0xecd024[_0x8194('0xb1')]][_0x8194('0x10b')]?moment()['format'](_0x8194('0xf8')):undefined;_0x54ac2b['countdropretry']+=0x1;_0x54ac2b[_0x8194('0xec')]+=0x1;if(_0x54ac2b['countdropretry']>=this[_0x8194('0x22')][_0xecd024[_0x8194('0xb1')]][_0x8194('0x115')]){this[_0x8194('0x10f')](_0x54ac2b);}else{this[_0x8194('0xc1')]({'active':![],'countdropretry':_0x54ac2b['countdropretry'],'scheduledat':moment()[_0x8194('0x116')](this[_0x8194('0x22')][_0xecd024['queue']][_0x8194('0x117')],_0x8194('0xf7'))['format'](_0x8194('0xf8')),'ContactId':_0x5178fa[_0x8194('0xd1')],'ListId':_0x5178fa['ListId'],'VoiceQueueId':_0x5178fa['VoiceQueueId']||undefined,'CampaignId':_0x5178fa[_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x118')));var _0x314ec1=new History(_0x54ac2b);_0x314ec1['state']=0xa;_0x314ec1[_0x8194('0xa6')]=_0x8194('0x113');_0x314ec1[_0x8194('0xa8')]=moment()[_0x8194('0x75')](_0x8194('0xf8'));_0x314ec1[_0x8194('0xa7')]=_0x314ec1[_0x8194('0xa8')];_0x314ec1[_0x8194('0x119')]=_0x54ac2b['calleridname'];_0x314ec1[_0x8194('0x11a')]=_0x54ac2b[_0x8194('0x11a')];this[_0x8194('0xda')](_0x314ec1)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x8194('0x22')][_0xecd024[_0x8194('0xb1')]][_0x8194('0x7e')]+=0x1;this[_0x8194('0x22')][_0xecd024['queue']][_0x8194('0x5e')]+=0x1;_0x54ac2b[_0x8194('0xa5')]=0xb;_0x54ac2b[_0x8194('0xa6')]=_0x8194('0x11b');_0x54ac2b[_0x8194('0x11c')]=_0x8194('0x11d');_0x54ac2b[_0x8194('0xf0')]+=0x1;_0x54ac2b[_0x8194('0xec')]+=0x1;if(_0x54ac2b[_0x8194('0xf0')]>=this[_0x8194('0x22')][_0xecd024[_0x8194('0xb1')]][_0x8194('0x11e')]){this[_0x8194('0x10f')](_0x54ac2b);}else{this[_0x8194('0xc1')]({'active':![],'countabandonedretry':_0x54ac2b[_0x8194('0xf0')],'scheduledat':moment()['add'](this[_0x8194('0x22')][_0xecd024['queue']][_0x8194('0x11f')],_0x8194('0xf7'))[_0x8194('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5178fa[_0x8194('0xd1')],'ListId':_0x5178fa[_0x8194('0xf9')],'VoiceQueueId':_0x5178fa[_0x8194('0xd2')]||undefined,'CampaignId':_0x5178fa['CampaignId']||undefined})['catch'](loggerCatch(_0x8194('0x120')));var _0x314ec1=new History(_0x54ac2b);_0x314ec1[_0x8194('0xa5')]=0xb;_0x314ec1['statedesc']=_0x8194('0x11b');_0x314ec1[_0x8194('0xa8')]=moment()[_0x8194('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0x314ec1['endtime']=_0x314ec1[_0x8194('0xa8')];_0x314ec1[_0x8194('0x119')]=_0x54ac2b['calleridname'];_0x314ec1[_0x8194('0x11a')]=_0x54ac2b[_0x8194('0x11a')];this['createHistory'](_0x314ec1)[_0x8194('0xaf')](loggerCatch(_0x8194('0x121')));}}}}};Dialer[_0x8194('0x1d')][_0x8194('0x37')]=function(_0x10e69c){if(this[_0x8194('0x122')][_0x10e69c[_0x8194('0xe3')]]){this[_0x8194('0x122')][_0x10e69c['uniqueid']][_0x8194('0x123')]=_0x10e69c[_0x8194('0x123')];}if(this[_0x8194('0xaa')][_0x10e69c[_0x8194('0xe3')]]){this[_0x8194('0xaa')][_0x10e69c['uniqueid']][_0x8194('0x123')]=_0x10e69c[_0x8194('0x123')];}};Dialer[_0x8194('0x1d')][_0x8194('0x39')]=function(_0x5ed149){if(strategy[this['voiceQueues'][this[_0x8194('0x122')][_0x5ed149[_0x8194('0x124')]][_0x8194('0xb1')]]['strategy']]===_0x8194('0x1c')){if(this[_0x8194('0x122')][_0x5ed149[_0x8194('0x124')]]&&_[_0x8194('0xad')](this[_0x8194('0x122')][_0x5ed149[_0x8194('0x124')]][_0x8194('0x125')])&&_0x5ed149['status']==='1'&&_0x5ed149['paused']==='0'){if(this['agents'][_0x5ed149['stateinterface']]){if(!this['agents'][_0x5ed149[_0x8194('0x126')]][_0x8194('0x125')]){this[_0x8194('0x23')][_0x5ed149[_0x8194('0x126')]][_0x8194('0x125')]=!![];this[_0x8194('0x122')][_0x5ed149['actionid']][_0x8194('0x125')]=!![];this[_0x8194('0x122')][_0x5ed149[_0x8194('0x124')]]['stateinterface']=_0x5ed149[_0x8194('0x126')];}}}}else if((strategy[this[_0x8194('0x22')][this[_0x8194('0x122')][_0x5ed149[_0x8194('0x124')]][_0x8194('0xb1')]][_0x8194('0x127')]]||_0x8194('0x1b'))==='rrmemory'){if(this[_0x8194('0x122')][_0x5ed149[_0x8194('0x124')]]){if(this['agents'][_0x5ed149[_0x8194('0x126')]]){this[_0x8194('0x122')][_0x5ed149['actionid']][_0x8194('0x126')]=_0x5ed149[_0x8194('0x126')];if(_[_0x8194('0xad')](this[_0x8194('0x2a')][this['actions'][_0x5ed149[_0x8194('0x124')]][_0x8194('0xb1')]])){this[_0x8194('0x2a')][this['actions'][_0x5ed149[_0x8194('0x124')]]['queue']]=[];}this['queueBooked'][this['actions'][_0x5ed149[_0x8194('0x124')]][_0x8194('0xb1')]][_0x8194('0x128')](_[_0x8194('0x8b')](_['pick'](this[_0x8194('0x122')][_0x5ed149[_0x8194('0x124')]],[_0x8194('0x129'),_0x8194('0x126')]),{'status':_0x5ed149[_0x8194('0xd8')],'paused':_0x5ed149[_0x8194('0x12a')]}));}}}};function unlockQueueStatus(_0x590113,_0x1b9486){setTimeout(function(){if(_[_0x8194('0x82')](_0x590113[_0x8194('0x12b')])){loggerBooked[_0x8194('0x94')]('[unlockQueueStatus][undefined]',_0x1b9486);}_0x590113[_0x8194('0x12b')]=!![];loggerBooked[_0x8194('0x7a')](_0x8194('0x12c'),_0x1b9486,JSON[_0x8194('0x47')](_[_0x8194('0x12d')](_0x590113,['name',_0x8194('0x12b')])));},0x1f3);}Dialer[_0x8194('0x1d')][_0x8194('0x12e')]=function(_0x389c8a){var _0x1e92e5=this;var _0x42001a=_0x1e92e5[_0x8194('0x22')][_0x1e92e5['actions'][_0x389c8a['actionid']][_0x8194('0xb1')]];if(strategy[this[_0x8194('0x22')][this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]]['queue']]['strategy']]===_0x8194('0x1c')){if(this[_0x8194('0x122')][_0x389c8a['actionid']]&&this[_0x8194('0x122')][_0x389c8a['actionid']][_0x8194('0x126')]){this[_0x8194('0x90')][_0x8194('0x12f')](this['actions'][_0x389c8a[_0x8194('0x124')]][_0x8194('0x129')],this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]]['stateinterface'])['catch'](function(_0x4419ad){logger[_0x8194('0x94')](_0x8194('0x130'),util[_0x8194('0x95')](_0x4419ad,{'showHidden':![],'depth':null}));})[_0x8194('0x20')](function(){_0x1e92e5[_0x8194('0xb3')](_0x1e92e5[_0x8194('0x22')][_0x1e92e5[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]][_0x8194('0xb1')]]);_0x1e92e5['agents'][_0x1e92e5[_0x8194('0x122')][_0x389c8a['actionid']]['stateinterface']][_0x8194('0x125')]=![];delete _0x1e92e5[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]];unlockQueueStatus(_0x42001a);});}else{this[_0x8194('0xb3')](this[_0x8194('0x22')][this[_0x8194('0x122')][_0x389c8a['actionid']][_0x8194('0xb1')]]);this[_0x8194('0xc1')]({'active':![],'ContactId':this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]]['ContactId'],'ListId':this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]][_0x8194('0xf9')],'VoiceQueueId':this['actions'][_0x389c8a[_0x8194('0x124')]][_0x8194('0xd2')]||undefined,'CampaignId':this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]][_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x131')));delete this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]];unlockQueueStatus(_0x42001a);}}else if((strategy[this[_0x8194('0x22')][this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]]['queue']][_0x8194('0x127')]]||'rrmemory')===_0x8194('0x1b')){var _0x4c4e67;if(this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]]&&!_[_0x8194('0x44')](this[_0x8194('0x2a')][this[_0x8194('0x122')][_0x389c8a['actionid']][_0x8194('0xb1')]])){if(this['queueBookedRR'][_0x1e92e5['actions'][_0x389c8a[_0x8194('0x124')]][_0x8194('0xb1')]]){this[_0x8194('0x2b')][_0x1e92e5[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]][_0x8194('0xb1')]]=this['queueBookedRR'][this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]][_0x8194('0xb1')]]?this[_0x8194('0x2b')][this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]][_0x8194('0xb1')]]:this[_0x8194('0x2a')][this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]][_0x8194('0xb1')]]?this['queueBooked'][this['actions'][_0x389c8a[_0x8194('0x124')]]['queue']]['_rr']||0x0:0x0;}this[_0x8194('0x2a')][this[_0x8194('0x122')][_0x389c8a[_0x8194('0x124')]]['queue']][_0x8194('0x132')]=this[_0x8194('0x2b')][this[_0x8194('0x122')][_0x389c8a['actionid']]['queue']];for(var _0x11965a=0x0;_0x11965a=0x0;})[_0x8194('0xaf')](myreject(_0x3d07c7)));}}else{_0x354dcd[_0x8194('0x128')](ami[_0x8194('0xae')]({'action':_0x8194('0x14a'),'command':util[_0x8194('0x75')](_0x8194('0x14b'),_0x27ac97,!_[_0x8194('0x82')](config['timezones'][_0x27b096])?_0x27b096:'')})[_0x8194('0xb9')](function(_0x3f9db2){return _0x3f9db2[_0x8194('0x14f')]['indexOf'](_0x8194('0x14e'))>=0x0;})['catch'](myreject(_0x3d07c7)));}BPromise[_0x8194('0x150')](_0x354dcd)[_0x8194('0xb9')](function(_0xb3099){var _0x7661a0=_['some'](_0xb3099);if(_0x7661a0){return _0xa8a20b(_0x7661a0);}else{_0xf64d98[_0x8194('0x3e')]=_0x233540?_0x8194('0x151'):_0x8194('0x152');return _0x3d07c7(msgResponse(_0x8194('0x153'),_0x8194('0x145'),_0x8194('0x154')+_0x233540+'\x20'+_0x2df709+'\x20Interval\x20is\x20overtime:\x20'+util[_0x8194('0x95')](_0x27ac97,{'showHidden':![],'depth':null})+_0x8194('0x155')+_0x27b096));}})['catch'](function(_0x5258ee){return _0x3d07c7(msgResponse('ifTime',_0x8194('0x145'),JSON[_0x8194('0x47')](_0x5258ee)));});});};Dialer['prototype'][_0x8194('0x156')]=function(_0x593eec){var _0x2ae5cb=this;return function(){switch(_0x593eec[_0x8194('0x55')]){case _0x8194('0x157'):freeVariablesPredictive(_0x593eec);_0x2ae5cb['handlePower'](_0x593eec,0x1);break;case _0x8194('0x158'):freeVariablesPredictive(_0x593eec);_0x2ae5cb[_0x8194('0x159')](_0x593eec,_0x593eec[_0x8194('0x15a')]);break;case _0x8194('0x15b'):_0x2ae5cb[_0x8194('0x15b')](_0x593eec);break;case _0x8194('0xa'):freeVariablesPredictive(_0x593eec);_0x2ae5cb[_0x8194('0x159')](_0x593eec,0x1);break;default:freeVariablesPredictive(_0x593eec);logger[_0x8194('0x94')](_0x8194('0x15c'),_0x593eec[_0x8194('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x8194('0x1d')][_0x8194('0x15d')]=function(_0x463e40){var _0x5a1a6d=this;return function(){_0x5a1a6d['handleIvr'](_0x463e40);};};Dialer[_0x8194('0x1d')][_0x8194('0xc')]=function(_0xa6f610){var _0xc6dc6c=this;if(isNotPreview(_0xa6f610[_0x8194('0x55')])){if(isVoiceQueueOutbound(_0xa6f610[_0x8194('0x4b')])&&isActive(_0xa6f610['dialActive'])){_0xa6f610[_0x8194('0x9f')]=!![];BPromise[_0x8194('0xb7')]()[_0x8194('0xb9')](checkIsLoggedIn(_0xa6f610,_0xa6f610[_0x8194('0x4d')]))[_0x8194('0xb9')](checkIsActive(_0xa6f610,_0xa6f610['dialActive']))[_0x8194('0xb9')](checkInterval(_0xa6f610))['then'](_0xc6dc6c['checkIsTrunkReachable'](_0xa6f610))['then'](_0xc6dc6c['checkIfTime'](_0xa6f610[_0x8194('0x15e')],_0xa6f610[_0x8194('0x15f')],_0xa6f610['name'],_0xa6f610))['then'](_0xc6dc6c[_0x8194('0x141')](_0xa6f610['Interval'],_0xa6f610[_0x8194('0x15f')],_0xa6f610[_0x8194('0x40')],_0xa6f610))[_0x8194('0xb9')](_0xc6dc6c[_0x8194('0x156')](_0xa6f610))['catch'](loggerCatchQueueSummary(_0x8194('0x160'),_0xa6f610));}else{notSendMessagesQueue(_0xa6f610);}}else{freeVariablesPredictive(_0xa6f610);}};Dialer[_0x8194('0x1d')][_0x8194('0x13b')]=function(){var _0x41ed0c=this;var _0x5ebf76;for(var _0x429d56 in this[_0x8194('0xb4')]){if(typeof this[_0x8194('0xb4')][_0x429d56]!==_0x8194('0x98')){_0x5ebf76=this[_0x8194('0xb4')][_0x429d56];if(isCampaignIvr(_0x5ebf76[_0x8194('0x4b')])&&isActive(_0x5ebf76[_0x8194('0x72')])){_0x5ebf76['sendMessageOneNotActive']=!![];BPromise[_0x8194('0xb7')]()[_0x8194('0xb9')](checkIsActive(_0x5ebf76,_0x5ebf76[_0x8194('0x72')]))[_0x8194('0xb9')](checkInterval(_0x5ebf76))['then'](_0x41ed0c[_0x8194('0x161')](_0x5ebf76))['then'](_0x41ed0c[_0x8194('0x140')](_0x5ebf76[_0x8194('0x15e')],_0x5ebf76[_0x8194('0x15f')],_0x5ebf76[_0x8194('0x40')],_0x5ebf76))['then'](_0x41ed0c['checkIfTimeIntervals'](_0x5ebf76[_0x8194('0x42')],_0x5ebf76[_0x8194('0x15f')],_0x5ebf76[_0x8194('0x40')],_0x5ebf76))[_0x8194('0xb9')](_0x41ed0c['launchHandleIvr'](_0x5ebf76))[_0x8194('0xaf')](loggerCatchQueueSummary('[syncCampaigns]',_0x5ebf76));}else{notSendMessagesCampaign(_0x5ebf76);}}}};function getCallerIdRandom(_0x1249a2,_0x1e76fd){var _0x311cfd;var _0x924750;var _0x165482;if(_0x1e76fd<=0x0){_0x1e76fd=0x1;}_0x311cfd=new RegExp(_0x8194('0x162')+_0x1e76fd+'}$');_0x924750=Math[_0x8194('0x163')](0xa,_0x1e76fd-0x1);_0x165482=Math[_0x8194('0x163')](0xa,_0x1e76fd)-0x1;return util[_0x8194('0x75')]('%s',_[_0x8194('0x164')](_0x1249a2,_0x311cfd,_[_0x8194('0x165')](_0x924750,_0x165482)));}function extractCalleridName(_0x1fa305){var _0x3c1bb8=_0x1fa305[_0x8194('0x166')](/"(.*?)"/);return _0x3c1bb8?_0x3c1bb8[0x1]:_0x1fa305;}function extractCalleridNumber(_0x13dfef){var _0x55abf0=_0x13dfef[_0x8194('0x166')](/<(.*?)>/);return _0x55abf0?_0x55abf0[0x1]:_0x13dfef;}Dialer[_0x8194('0x1d')][_0x8194('0x167')]=function(_0x2f83fd,_0x4cd98a){var _0x5b5254=this;var _0x48409a=uuid['v4']();this[_0x8194('0x122')][_0x48409a]=new Action(_0x2f83fd,_0x4cd98a,_0x48409a);return new BPromise(function(_0x4cf456,_0x1db6df){if(_[_0x8194('0x82')](_0x2f83fd)&&typeof _0x2f83fd!==_0x8194('0x168')){return _0x1db6df(msgResponse('originate',_0x8194('0x145'),'voiceQueue\x20is\x20undefine'));}if(_[_0x8194('0x82')](_0x4cd98a['Contact'][_0x8194('0x169')])||_0x4cd98a[_0x8194('0x16a')]['phone']===null){return _0x1db6df(msgResponse(_0x8194('0x16b'),_0x8194('0x145'),_0x8194('0x16c')));}var _0x50bf99={'XMD-CALLERID':_0x5b5254['actions'][_0x48409a][_0x8194('0x16d')](),'XMD-AGI':_0x2f83fd[_0x8194('0x105')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x2f83fd[_0x8194('0x105')]):'NONE','XMD-AGIAFTER':_0x2f83fd[_0x8194('0x10b')]?util[_0x8194('0x75')](_0x8194('0x16e'),ipAgi,_0x2f83fd[_0x8194('0x10b')]):_0x8194('0x16f'),'XMD-QUEUE':_0x2f83fd[_0x8194('0x4b')]===_0x8194('0x8f')?util[_0x8194('0x75')]('\x22%s,%s%s,,,%s\x22',_0x2f83fd['name'],_0x2f83fd[_0x8194('0x170')]||'',_0x2f83fd[_0x8194('0x10c')]?'c':'',_0x2f83fd[_0x8194('0x112')]||0x3):'NONE','XMD-CONTACTID':_0x4cd98a[_0x8194('0xd1')],'XMD-CDRTYPE':_0x8194('0x9'),'CALLERID(all)':_0x5b5254[_0x8194('0x122')][_0x48409a][_0x8194('0x16d')](),'XMD-AMD':_0x2f83fd['dialAMDActive']?'ACTIVE':_0x8194('0x16f'),'XMD-DESTINATION':_0x8194('0xdf')};if(_0x2f83fd[_0x8194('0xe0')]){_0x50bf99[_0x8194('0x171')]=_0x2f83fd[_0x8194('0x172')]||0x9c4;_0x50bf99[_0x8194('0x173')]=_0x2f83fd[_0x8194('0x174')]||0x5dc;_0x50bf99['XMD-AMDAFTERGREETINGSILENCE']=_0x2f83fd[_0x8194('0x175')]||0x320;_0x50bf99[_0x8194('0x176')]=_0x2f83fd['dialAMDTotalAnalysisTime']||0x1388;_0x50bf99['XMD-AMDMINWORDLENGTH']=_0x2f83fd[_0x8194('0x177')]||0x64;_0x50bf99[_0x8194('0x178')]=_0x2f83fd['dialAMDBetweenWordsSilence']||0x32;_0x50bf99[_0x8194('0x179')]=_0x2f83fd[_0x8194('0x17a')]||0x3;_0x50bf99[_0x8194('0x17b')]=_0x2f83fd[_0x8194('0x17c')]||0x100;_0x50bf99['XMD-AMDMAXIMUMWORDLENGTH']=_0x2f83fd['dialAMDMaximumWordLength']||0x1388;}if(_0x2f83fd[_0x8194('0x4b')]===_0x8194('0x8f')){_0x50bf99[_0x8194('0x17d')]=_0x4cd98a['VoiceQueueId'];}else{_0x50bf99['XMD-CAMPAIGNID']=_0x4cd98a[_0x8194('0xd3')];}for(var _0x4310f7 in _0x4cd98a['Contact']){if(typeof _0x4cd98a['Contact'][_0x4310f7]!=='undefined'){if(isNotNull(_0x4cd98a[_0x8194('0x16a')][_0x4310f7])&&_0x4310f7!=='id'&&_0x4310f7!==_0x8194('0x17e')&&_0x4310f7!==_0x8194('0x17f')&&_0x4310f7!==_0x8194('0x180')){_0x50bf99[util[_0x8194('0x75')](_0x8194('0x181'),'XMD-',_['toUpper'](_0x4310f7))]=_0x4cd98a[_0x8194('0x16a')][_0x4310f7];}}}var _0x3e16b0=_0x5b5254[_0x8194('0x13c')](_0x2f83fd['Trunk'])?getCallerId(_0x2f83fd[_0x8194('0x71')]['callerid'],_0x2f83fd[_0x8194('0x56')],_0x2f83fd[_0x8194('0x182')]>0x0?getCallerIdRandom(_0x2f83fd[_0x8194('0x183')],_0x2f83fd[_0x8194('0x182')]):_0x2f83fd[_0x8194('0x183')]):getCallerId(_[_0x8194('0xad')](_0x2f83fd[_0x8194('0x13d')])?_0x2f83fd[_0x8194('0x71')][_0x8194('0x73')]:_0x2f83fd[_0x8194('0x13d')]['callerid'],_0x2f83fd['dialOriginateCallerIdName'],_0x2f83fd[_0x8194('0x182')]>0x0?getCallerIdRandom(_0x2f83fd['dialOriginateCallerIdNumber'],_0x2f83fd['dialRandomLastDigitCallerIdNumber']):_0x2f83fd[_0x8194('0x183')]);if(_0x3e16b0){_0x50bf99['XMD-ORIGINATECALLERIDNAME']=_0x5b5254[_0x8194('0x122')][_0x48409a][_0x8194('0x184')]=extractCalleridName(_0x3e16b0);_0x50bf99['XMD-ORIGINATECALLERIDNUM']=_0x5b5254[_0x8194('0x122')][_0x48409a][_0x8194('0x185')]=extractCalleridNumber(_0x3e16b0);}return ami['Action']({'actionid':_0x48409a,'action':_0x8194('0x16b'),'channel':_0x5b5254[_0x8194('0x13c')](_0x2f83fd[_0x8194('0x71')])?util[_0x8194('0x75')](_0x8194('0x186'),_0x2f83fd[_0x8194('0x71')][_0x8194('0x40')],isNotNull(_0x2f83fd[_0x8194('0x58')])?_0x2f83fd[_0x8194('0x58')][_0x8194('0x187')]()||'':'',_0x2f83fd[_0x8194('0x188')]>0x0?_0x4cd98a[_0x8194('0x16a')]['phone'][_0x8194('0x189')](_0x2f83fd[_0x8194('0x188')]):_0x4cd98a[_0x8194('0x16a')][_0x8194('0x169')]):util[_0x8194('0x75')](_0x8194('0x186'),_[_0x8194('0xad')](_0x2f83fd[_0x8194('0x13d')])?_0x2f83fd['Trunk'][_0x8194('0x40')]:_0x2f83fd[_0x8194('0x13d')]['name'],isNotNull(_0x2f83fd[_0x8194('0x58')])?_0x2f83fd[_0x8194('0x58')][_0x8194('0x187')]()||'':'',_0x2f83fd[_0x8194('0x188')]>0x0?_0x4cd98a[_0x8194('0x16a')][_0x8194('0x169')][_0x8194('0x189')](_0x2f83fd['dialCutDigit']):_0x4cd98a[_0x8194('0x16a')]['phone']),'callerid':_0x3e16b0,'Exten':_0x8194('0xdf'),'Context':'from-sip','Priority':'1','variable':_0x50bf99,'timeout':(_0x2f83fd[_0x8194('0x57')]||0x1e)*0x3e8,'async':!![],'channelid':_0x48409a})['then'](function(_0x840116){return _0x4cf456(_0x840116);})['catch'](function(_0x53a1f9){_0x2f83fd[_0x8194('0x18a')]+=0x1;var _0x59aa0b=new History(_0x5b5254[_0x8194('0x122')][_0x48409a]);logger[_0x8194('0x94')](util[_0x8194('0x75')](_0x8194('0x18b'),JSON[_0x8194('0x47')](_0x53a1f9)));_0x59aa0b['state']=0xe;_0x59aa0b['statedesc']=_0x8194('0x18c');_0x59aa0b[_0x8194('0xa8')]=moment()[_0x8194('0x75')](_0x8194('0xf8'));_0x59aa0b[_0x8194('0xa7')]=_0x59aa0b[_0x8194('0xa8')];_0x5b5254[_0x8194('0xda')](_0x59aa0b)[_0x8194('0xaf')](loggerCatch('[originate][error]'));_0x5b5254[_0x8194('0xca')](_0x59aa0b)[_0x8194('0xaf')](loggerCatch(_0x8194('0x18d')))[_0x8194('0x20')](function(){delete _0x5b5254[_0x8194('0x122')][_0x48409a];return _0x1db6df(msgResponse('originate',_0x8194('0x46'),_0x8194('0x18e')));});});});};Dialer[_0x8194('0x1d')][_0x8194('0x32')]=function(_0x11a941){var _0x2a4aaa=this[_0x8194('0x122')][_0x11a941[_0x8194('0x124')]];if(_0x2a4aaa){delete this[_0x8194('0x122')][_0x11a941['actionid']];_0x2a4aaa[_0x8194('0x111')]=moment()[_0x8194('0x75')](_0x8194('0xf8'));var _0x3f9303=_0x2a4aaa[_0x8194('0x4b')]===_0x8194('0x77')?this['campaigns'][_0x2a4aaa[_0x8194('0xb1')]]:this[_0x8194('0x22')][_0x2a4aaa[_0x8194('0x18f')]()];if(!this[_0x8194('0xd6')](_0x11a941[_0x8194('0x190')])){this['updateOriginated'](_0x3f9303);return this[_0x8194('0x191')](_0x2a4aaa,_0x3f9303,_0x11a941)[_0x8194('0xaf')](loggerCatch(_0x8194('0x192')));}this[_0x8194('0xaa')][_0x11a941[_0x8194('0xe3')]]=_0x2a4aaa;}};Dialer[_0x8194('0x1d')]['checkRetriveMax']=function(_0x5c51c8,_0x57b9fe,_0x5730ef){var _0x43ed90=new History(_0x57b9fe);if(_0x43ed90[_0x8194('0x193')]+_0x43ed90[_0x8194('0xef')]+_0x43ed90[_0x8194('0xfd')]+_0x43ed90[_0x8194('0xfe')]+_0x43ed90[_0x8194('0xff')]+_0x43ed90[_0x8194('0xf0')]+_0x43ed90[_0x8194('0xf1')]+_0x43ed90['countagentrejectretry']>=_0x5730ef[_0x8194('0xf3')]-0x1){return!![];}switch(_0x5c51c8){case 0x3:if(_0x43ed90['countnoanswerretry']>=_0x5730ef[_0x8194('0x194')]-0x1){return!![];}this[_0x8194('0xc1')]({'active':![],'countnoanswerretry':_0x43ed90[_0x8194('0xfd')]+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef[_0x8194('0x195')],_0x8194('0xf7'))[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90['ListId'],'VoiceQueueId':_0x43ed90['VoiceQueueId']||undefined,'CampaignId':_0x43ed90[_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x43ed90[_0x8194('0x193')]>=_0x5730ef['dialBusyMaxRetry']-0x1){return!![];}this[_0x8194('0xc1')]({'active':![],'countbusyretry':_0x43ed90['countbusyretry']+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef[_0x8194('0x196')],_0x8194('0xf7'))[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90['ListId'],'VoiceQueueId':_0x43ed90['VoiceQueueId']||undefined,'CampaignId':_0x43ed90[_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x197')));break;case 0x8:if(_0x43ed90[_0x8194('0xef')]>=_0x5730ef[_0x8194('0x198')]-0x1){return!![];}this[_0x8194('0xc1')]({'active':![],'countcongestionretry':_0x43ed90[_0x8194('0xef')]+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef['dialCongestionRetryFrequency'],_0x8194('0xf7'))[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90['ListId'],'VoiceQueueId':_0x43ed90['VoiceQueueId']||undefined,'CampaignId':_0x43ed90[_0x8194('0xd3')]||undefined})['catch'](loggerCatch(_0x8194('0x199')));break;case 0x0:if(_0x43ed90[_0x8194('0xfe')]>=_0x5730ef[_0x8194('0x19a')]-0x1){return!![];}else{this[_0x8194('0xc1')]({'active':![],'countnosuchnumberretry':_0x43ed90[_0x8194('0xfe')]+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef[_0x8194('0x19b')],_0x8194('0xf7'))[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90[_0x8194('0xf9')],'VoiceQueueId':_0x43ed90[_0x8194('0xd2')]||undefined,'CampaignId':_0x43ed90[_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x19c')));}break;case 0xa:if(_0x43ed90[_0x8194('0xff')]>=_0x5730ef[_0x8194('0x115')]-0x1){return!![];}this[_0x8194('0xc1')]({'active':![],'countdropretry':_0x43ed90[_0x8194('0xff')]+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef[_0x8194('0x117')],_0x8194('0xf7'))[_0x8194('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90[_0x8194('0xf9')],'VoiceQueueId':_0x43ed90[_0x8194('0xd2')]||undefined,'CampaignId':_0x43ed90['CampaignId']||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x118')));break;case 0xb:if(_0x43ed90[_0x8194('0xf0')]>=_0x5730ef[_0x8194('0x11e')]-0x1){return!![];}this[_0x8194('0xc1')]({'active':![],'countabandonedretry':_0x43ed90[_0x8194('0xf0')]+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef[_0x8194('0x11f')],'minutes')[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90['ListId'],'VoiceQueueId':_0x43ed90['VoiceQueueId']||undefined,'CampaignId':_0x43ed90[_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x120')));break;case 0x13:if(_0x43ed90[_0x8194('0xf1')]>=_0x5730ef[_0x8194('0x100')]-0x1){return!![];}this[_0x8194('0xc1')]({'active':![],'countmachineretry':_0x43ed90[_0x8194('0xf1')]+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef['dialMachineRetryFrequency'],'minutes')[_0x8194('0x75')](_0x8194('0xf8')),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90[_0x8194('0xf9')],'VoiceQueueId':_0x43ed90[_0x8194('0xd2')]||undefined,'CampaignId':_0x43ed90[_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x43ed90[_0x8194('0xf2')]>=_0x5730ef[_0x8194('0x19d')]-0x1){return!![];}this[_0x8194('0xc1')]({'active':![],'countagentrejectretry':_0x43ed90[_0x8194('0xf2')]+=0x1,'scheduledat':moment()[_0x8194('0x116')](_0x5730ef[_0x8194('0x19e')],_0x8194('0xf7'))['format'](_0x8194('0xf8')),'ContactId':_0x43ed90[_0x8194('0xd1')],'ListId':_0x43ed90[_0x8194('0xf9')],'VoiceQueueId':_0x43ed90['VoiceQueueId']||undefined,'CampaignId':_0x43ed90[_0x8194('0xd3')]||undefined})['catch'](loggerCatch(_0x8194('0x19f')));break;default:return!![];}};Dialer[_0x8194('0x1d')][_0x8194('0x191')]=function(_0x3faad3,_0x21e114,_0x1e08d3){var _0x49df3a=this;var _0x3d1ae1=new History(_0x3faad3);return new BPromise(function(_0x29a071,_0x4cdfd2){if(_['isUndefined'](_0x21e114)&&typeof _0x21e114!==_0x8194('0x168')){return _0x4cdfd2(msgResponse(_0x8194('0x1a0'),'Failure',_0x8194('0x1a1')));}if(_['isUndefined'](_0x1e08d3)&&typeof _0x1e08d3!==_0x8194('0x168')){return _0x4cdfd2(msgResponse(_0x8194('0x1a0'),_0x8194('0x145'),_0x8194('0x1a2')));}switch(_0x1e08d3[_0x8194('0x1a3')]){case'0':_0x21e114['outboundNoSuchCallsDay']+=0x1;_0x3d1ae1[_0x8194('0xa5')]=0x0;_0x3d1ae1['statedesc']=_0x8194('0x1a4');_0x3d1ae1[_0x8194('0xfe')]+=0x1;_0x3d1ae1[_0x8194('0xec')]+=0x1;ami[_0x8194('0xed')](_0x8194('0x1a5'),ut[_0x8194('0xe7')](_0x3faad3,_0x8194('0x1a6')));_0x49df3a[_0x8194('0xda')](_0x3d1ae1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x49df3a[_0x8194('0x1a7')](0x0,_0x3faad3,_0x21e114)){if(_0x3d1ae1['countnosuchnumberretry']>=_0x21e114[_0x8194('0x19a')]){_0x49df3a['createStateFinal'](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1a8'));}else{_0x49df3a[_0x8194('0xf4')](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1a8'));}}break;case'3':_0x21e114[_0x8194('0x60')]+=0x1;_0x3d1ae1['state']=0x3;_0x3d1ae1[_0x8194('0xa6')]='NoAnswer';_0x3d1ae1['countnoanswerretry']+=0x1;_0x3d1ae1['countglobal']+=0x1;ami['emit'](_0x8194('0x1a9'),ut[_0x8194('0xe7')](_0x3faad3,_0x8194('0x1aa')));_0x49df3a[_0x8194('0xda')](_0x3d1ae1)[_0x8194('0xaf')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x49df3a['checkRetriveMax'](0x3,_0x3faad3,_0x21e114)){if(_0x3d1ae1[_0x8194('0xfd')]>=_0x21e114[_0x8194('0x194')]){_0x49df3a[_0x8194('0x101')](_0x3d1ae1,_0x29a071,_0x4cdfd2,'reason\x203\x20ringing\x20no\x20answer');}else{_0x49df3a['stateGlobal'](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1ab'));}}break;case'5':_0x21e114[_0x8194('0x5c')]+=0x1;_0x3d1ae1[_0x8194('0xa5')]=0x5;_0x3d1ae1['statedesc']=_0x8194('0x1ac');_0x3d1ae1[_0x8194('0x193')]+=0x1;_0x3d1ae1[_0x8194('0xec')]+=0x1;ami[_0x8194('0xed')](_0x8194('0x1ad'),ut[_0x8194('0xe7')](_0x3faad3,'busy'));_0x49df3a[_0x8194('0xda')](_0x3d1ae1)['catch'](loggerCatch(_0x8194('0x1ae')));if(_0x49df3a['checkRetriveMax'](0x5,_0x3faad3,_0x21e114)){if(_0x3d1ae1[_0x8194('0x193')]>=_0x21e114['dialBusyMaxRetry']){_0x49df3a[_0x8194('0x101')](_0x3d1ae1,_0x29a071,_0x4cdfd2,'reason\x205\x20busy');}else{_0x49df3a['stateGlobal'](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1af'));}}break;case'8':_0x21e114[_0x8194('0x5d')]+=0x1;_0x3d1ae1[_0x8194('0xa5')]=0x8;_0x3d1ae1[_0x8194('0xa6')]=_0x8194('0x1b0');_0x3d1ae1['countcongestionretry']+=0x1;_0x3d1ae1[_0x8194('0xec')]+=0x1;ami[_0x8194('0xed')](_0x8194('0x1b1'),ut[_0x8194('0xe7')](_0x3faad3,_0x8194('0x1b2')));_0x49df3a['createHistory'](_0x3d1ae1)[_0x8194('0xaf')](loggerCatch(_0x8194('0x1b3')));if(_0x49df3a['checkRetriveMax'](0x8,_0x3faad3,_0x21e114)){if(_0x3d1ae1['countcongestionretry']>=_0x21e114[_0x8194('0x198')]){_0x49df3a[_0x8194('0x101')](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1b4'));}else{_0x49df3a['stateGlobal'](_0x3d1ae1,_0x29a071,_0x4cdfd2,'reason\x208\x20congestion');}}break;case'11':_0x21e114[_0x8194('0x1b5')]+=0x1;_0x3d1ae1[_0x8194('0xa5')]=0xb;_0x3d1ae1[_0x8194('0xa6')]='Abandoned';_0x3d1ae1[_0x8194('0xf0')]+=0x1;_0x3d1ae1[_0x8194('0xec')]+=0x1;_0x49df3a[_0x8194('0xda')](_0x3d1ae1)[_0x8194('0xaf')](loggerCatch(_0x8194('0x121')));if(_0x49df3a[_0x8194('0x1a7')](0xb,_0x3faad3,_0x21e114)){if(_0x3d1ae1['countabandonedretry']>=_0x21e114[_0x8194('0x11e')]){_0x49df3a[_0x8194('0x101')](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1b6'));}else{_0x49df3a[_0x8194('0xf4')](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1b6'));}}break;case'20':_0x21e114['outboundRejectCallsDay']+=0x1;_0x3d1ae1[_0x8194('0xa5')]=0x14;_0x3d1ae1[_0x8194('0xa6')]='AgentReject';_0x3d1ae1['countagentrejectretry']+=0x1;_0x3d1ae1[_0x8194('0xec')]+=0x1;ami[_0x8194('0xed')](_0x8194('0x1b7'),ut[_0x8194('0xe7')](_0x3faad3,_0x8194('0x1b8')));_0x49df3a[_0x8194('0xda')](_0x3d1ae1)['catch'](loggerCatch(_0x8194('0x1b9')));if(_0x49df3a['checkRetriveMax'](0x14,_0x3faad3,_0x21e114)){if(_0x3d1ae1[_0x8194('0xf2')]>=_0x21e114[_0x8194('0x19d')]){_0x49df3a[_0x8194('0x101')](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1ba'));}else{_0x49df3a[_0x8194('0xf4')](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x8194('0x1ba'));}}break;default:_0x21e114['outboundUnknownCallsDay']+=0x1;_0x3d1ae1['state']=0xc;_0x3d1ae1['statedesc']=_0x1e08d3[_0x8194('0x1a3')];_0x49df3a[_0x8194('0xda')](_0x3d1ae1)[_0x8194('0xaf')](loggerCatch(_0x8194('0x1bb')));if(_0x49df3a[_0x8194('0x1a7')](_0x1e08d3['reason'],_0x3faad3,_0x21e114)){if(_0x3d1ae1[_0x8194('0x193')]+_0x3d1ae1[_0x8194('0xef')]+_0x3d1ae1[_0x8194('0xfd')]+_0x3d1ae1[_0x8194('0xfe')]+_0x3d1ae1['countdropretry']+_0x3d1ae1[_0x8194('0xf0')]+_0x3d1ae1[_0x8194('0xf1')]+_0x3d1ae1[_0x8194('0xf2')]>=_0x21e114[_0x8194('0xf3')]){_0x49df3a[_0x8194('0xf4')](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x1e08d3[_0x8194('0x1a3')]);}else{_0x49df3a['createStateFinal'](_0x3d1ae1,_0x29a071,_0x4cdfd2,_0x1e08d3[_0x8194('0x1a3')]);}}}});};Dialer['prototype'][_0x8194('0xf4')]=function(_0x5ee235,_0x4c4b54,_0x5d835d,_0x162b44){var _0xa1791=new Final(_0x5ee235);_0xa1791[_0x8194('0xa5')]=0xf;_0xa1791[_0x8194('0xa6')]=_0x8194('0x1bc');this[_0x8194('0x101')](_0xa1791,_0x4c4b54,_0x5d835d,_0x162b44);};Dialer[_0x8194('0x1d')][_0x8194('0x101')]=function(_0x12be28,_0x27cd4b,_0x12cdcd,_0x2df5b1){this[_0x8194('0xca')](_0x12be28)[_0x8194('0xb9')](function(){return _0x27cd4b(msgResponse(_0x8194('0x1a0'),_0x8194('0x1bd'),_0x2df5b1));})[_0x8194('0xaf')](function(){return _0x12cdcd(msgResponse(_0x8194('0x1be'),_0x8194('0x145'),_0x8194('0x1bf')));});};Dialer['prototype'][_0x8194('0x15b')]=function(_0x5de59f){var _0x5c9fc0=_0x5de59f[_0x8194('0x1c0')]/0x64;var _0x5067f4=_0x5de59f[_0x8194('0x5f')]/(_0x5de59f['outboundDropCallsDayTimeout']+_0x5de59f[_0x8194('0x5a')]);var _0x52e158=Math[_0x8194('0x1c1')](_0x5de59f[_0x8194('0x6a')]*(_0x5de59f[_0x8194('0x1c2')]/0x64));var _0x48feff=Math[_0x8194('0x1c1')](_0x5de59f[_0x8194('0x6a')]*(_0x5de59f['predictiveIntervalMinThreshold']/0x64));var _0x158c35=_0x5de59f[_0x8194('0x4c')]+_0x5de59f[_0x8194('0x4f')];var _0x547d90=Math[_0x8194('0x1c3')](_0x5de59f['erlangCalls']*_0x5de59f[_0x8194('0x6f')]*_0x5de59f[_0x8194('0x68')]*_0x5de59f[_0x8194('0x1c4')]);if(_['isUndefined'](_0x5de59f[_0x8194('0x29')])){if(!_[_0x8194('0x82')](_0x5de59f[_0x8194('0x28')])){_0x5de59f[_0x8194('0x28')]=undefined;loggerPredictive[_0x8194('0x94')]('[startMethodPredictive][StartProgressive]',_0x8194('0x1c5'));}if(!_[_0x8194('0x82')](_0x5de59f[_0x8194('0x1c6')])){loggerPredictive[_0x8194('0x94')]('[startMethodPredictive][StartProgressive]',_0x8194('0x1c7'));clearInterval(_0x5de59f[_0x8194('0x1c6')]);_0x5de59f['handlePredictive']=undefined;}_0x5de59f[_0x8194('0x29')]=moment()[_0x8194('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8194('0x7a')](_0x5de59f[_0x8194('0x40')],_0x8194('0x1c8'),_0x5de59f['startProgressive']);this[_0x8194('0x159')](_0x5de59f,0x1);}else if(ifInterval(_0x5de59f[_0x8194('0x1c9')],_0x5de59f[_0x8194('0x29')])){this[_0x8194('0x159')](_0x5de59f,0x1);loggerPredictiveCalls[_0x8194('0x7a')](_0x8194('0x1ca'),_0x5de59f[_0x8194('0x29')],_0x5de59f[_0x8194('0x40')]);_0x5de59f[_0x8194('0x6d')]=0x0;_0x5de59f[_0x8194('0x67')]=0x0;}else if(_0x5c9fc0<_0x5067f4&&_0x5de59f['dialPredictiveOptimization']===_0x8194('0x1cb')){freeVariablesPredictive(_0x5de59f);loggerPredictive[_0x8194('0x7a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x8194('0x1cc'),_0x5067f4,_0x8194('0x29'),_0x5de59f[_0x8194('0x40')]);}else if(_0x547d90<_0x5de59f['predictiveIntervalErlangCallsDroppedCalls']&&_0x5de59f[_0x8194('0x1cd')]==='dropRate'){freeVariablesPredictive(_0x5de59f);loggerPredictive[_0x8194('0x7a')](_0x8194('0x1ce'),'Max\x20Drop\x20',_0x547d90,'Drop\x20in\x20this\x20interval',_0x5de59f['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x5de59f[_0x8194('0x40')]);}else if(!ifInterval(_0x5de59f[_0x8194('0x1c9')],_0x5de59f[_0x8194('0x29')])&&_['isUndefined'](_0x5de59f['startPredictive'])&&!_[_0x8194('0x82')](_0x5de59f[_0x8194('0x29')])){_0x5de59f[_0x8194('0x28')]=moment()[_0x8194('0x75')](_0x8194('0xf8'));loggerPredictive[_0x8194('0x7a')](_0x5de59f[_0x8194('0x40')],_0x8194('0x1cf'),_0x5de59f['startPredictive']);this['averageHandleTime'](_0x5de59f[_0x8194('0x1c9')])['then'](this[_0x8194('0x1d0')](_0x5de59f))[_0x8194('0xb9')](mergeDataErlangB(_0x5de59f))['then'](this[_0x8194('0x1d1')](_0x5de59f))[_0x8194('0xaf')](loggerCatchPredictive(_0x8194('0x1d2'),_0x5de59f));}else if(!ifInterval(_0x5de59f[_0x8194('0x1c9')],_0x5de59f['startPredictive'])){_0x5de59f[_0x8194('0x67')]=0x0;_0x5de59f[_0x8194('0x28')]=moment()[_0x8194('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8194('0x7a')](_0x5de59f[_0x8194('0x40')],_0x8194('0x1d3'),_0x5de59f[_0x8194('0x28')]);clearInterval(_0x5de59f[_0x8194('0x1c6')]);_0x5de59f[_0x8194('0x1c6')]=undefined;this[_0x8194('0xbe')](_0x5de59f[_0x8194('0x1c9')])[_0x8194('0xb9')](this[_0x8194('0x1d0')](_0x5de59f))['then'](mergeDataErlangB(_0x5de59f))['then'](this[_0x8194('0x1d1')](_0x5de59f))[_0x8194('0xaf')](loggerCatchPredictive(_0x8194('0x1d4'),_0x5de59f));}else if(_0x5de59f[_0x8194('0x6a')]&&_0x158c35<_0x5de59f[_0x8194('0x6a')]-_0x48feff){freeVariablesPredictive(_0x5de59f);loggerPredictive[_0x8194('0x7a')](_0x5de59f[_0x8194('0x40')],_0x8194('0x1d5'),_0x158c35,_0x8194('0x1d6'),_0x5de59f['predictiveIntervalAvailable'],'-',_0x48feff,'=',_0x5de59f[_0x8194('0x6a')]-_0x48feff,')');}else if(_0x5de59f[_0x8194('0x6a')]&&_0x158c35>_0x5de59f['predictiveIntervalAvailable']+_0x52e158){freeVariablesPredictive(_0x5de59f);loggerPredictive[_0x8194('0x7a')](_0x5de59f[_0x8194('0x40')],_0x8194('0x1d5'),_0x158c35,_0x8194('0x1d7'),_0x5de59f['predictiveIntervalAvailable'],'+',_0x52e158,'=',_0x5de59f[_0x8194('0x6a')]+_0x52e158,')');}};Dialer[_0x8194('0x1d')][_0x8194('0x1d0')]=function(_0x6eab18){var _0xcc9af3=this;return function(_0x3e69c6){return new BPromise(function(_0xd8ab00,_0xc18860){_[_0x8194('0x8b')](_0x6eab18,_0x3e69c6[0x0]);if(checkGetDataPredictive(_0x3e69c6[0x0])){var _0x352338=_0x6eab18[_0x8194('0x6a')]=_0x6eab18[_0x8194('0x4f')]+_0x6eab18[_0x8194('0x4c')];var _0x1c18df=_0x6eab18['dialPredictiveInterval']*0x3c;var _0xb12ba8=_0x3e69c6[0x0][_0x8194('0x64')]+_0x3e69c6[0x0][_0x8194('0x84')];var _0x4bddb8=(_0x3e69c6[0x0][_0x8194('0x63')]+_0x3e69c6[0x0][_0x8194('0x65')]+_0x3e69c6[0x0][_0x8194('0x7e')])/_0x3e69c6[0x0][_0x8194('0x6b')];_0x6eab18[_0x8194('0x68')]=_0x4bddb8>0x0?_0x4bddb8:0x1;switch(_0x6eab18['dialPredictiveOptimization']){case _0x8194('0x1cb'):var _0x5163b4=_0x6eab18[_0x8194('0x1c0')]/0x64;return _0xcc9af3['abandonmentRate'](_0x352338,_0x1c18df,_0xb12ba8,_0x4bddb8,_0x5163b4)['then'](function(_0x8189ad){return _0xd8ab00(_0x8189ad);});case'agentBusyFactor':var _0x3f2066=_0x6eab18[_0x8194('0x1c0')]/0x64;return _0xcc9af3[_0x8194('0x1d8')](_0x352338,_0x1c18df,_0xb12ba8,_0x4bddb8,_0x3f2066)[_0x8194('0xb9')](function(_0xd9c56c){return _0xd8ab00(_0xd9c56c);});default:return _0xc18860(msgResponse('[getDataPredictive]',_0x8194('0x145'),_0x8194('0x1d9')));}}else{return _0xc18860(msgResponse(_0x8194('0x1da'),_0x8194('0x145'),_0x8194('0x1db')));}});};};Dialer[_0x8194('0x1d')]['getDataPredictiveOld']=function(_0x161eba){var _0x3e38b0=this;return function(_0x2bf3d6){return new BPromise(function(_0xf4c6ac,_0x305186){_[_0x8194('0x8b')](_0x161eba,_0x2bf3d6[0x0]);if(checkGetDataPredictive(_0x2bf3d6[0x0])){loggerPredictive[_0x8194('0x7a')](JSON['stringify'](_0x2bf3d6[0x0]));if(_0x161eba[_0x8194('0x1cd')]==='dropRate'){return _0x3e38b0['getVoiceQueueRtPauses'](_0x161eba['id'])[_0x8194('0xb9')](function(_0x1e90ac){var _0x2123dd=_0x161eba[_0x8194('0x4d')]-_0x1e90ac[0x0][_0x8194('0x1dc')];var _0x11d178=_0x161eba[_0x8194('0x1c9')]*0x3c;var _0x2e30eb=_0x2bf3d6[0x0][_0x8194('0x64')]+_0x2bf3d6[0x0][_0x8194('0x84')];var _0x4eea95=(_0x2bf3d6[0x0][_0x8194('0x63')]+_0x2bf3d6[0x0][_0x8194('0x65')]+_0x2bf3d6[0x0][_0x8194('0x7e')])/_0x2bf3d6[0x0][_0x8194('0x6b')];var _0x5ab70f=_0x161eba[_0x8194('0x1c0')]/0x64;_0x161eba['predictiveIntervalPauses']=_0x1e90ac[0x0][_0x8194('0x1dc')]||0x0;_0x161eba['predictiveIntervalHitRate']=_0x4eea95>0x0?_0x4eea95:0x1;return _0x3e38b0[_0x8194('0x1dd')](_0x2123dd,_0x11d178,_0x2e30eb,_0x4eea95,_0x5ab70f);})[_0x8194('0xb9')](function(_0x1a8b63){return _0xf4c6ac(_0x1a8b63);})[_0x8194('0xaf')](function(_0x657e38){return _0x305186(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x657e38)));});}if(_0x161eba[_0x8194('0x1cd')]==='agentBusyFactor'){return _0x3e38b0[_0x8194('0xc9')](_0x161eba['id'])[_0x8194('0xb9')](function(_0x1af77c){var _0x241f0e=_0x161eba[_0x8194('0x4d')]-_0x1af77c[0x0][_0x8194('0x1dc')];var _0x351c0f=_0x161eba['dialPredictiveInterval']*0x3c;var _0x5c463d=_0x2bf3d6[0x0][_0x8194('0x64')]+_0x2bf3d6[0x0][_0x8194('0x84')];var _0x2cdd15=(_0x2bf3d6[0x0][_0x8194('0x63')]+_0x2bf3d6[0x0][_0x8194('0x65')]+_0x2bf3d6[0x0][_0x8194('0x7e')])/_0x2bf3d6[0x0]['predictiveIntervalTotalCalls'];var _0x39b1f7=_0x161eba['dialPredictiveOptimizationPercentage']/0x64;_0x161eba[_0x8194('0x69')]=_0x1af77c[0x0][_0x8194('0x1dc')]||0x0;_0x161eba['predictiveIntervalHitRate']=_0x2cdd15>0x0?_0x2cdd15:0x1;return _0x3e38b0[_0x8194('0x1d8')](_0x241f0e,_0x351c0f,_0x5c463d,_0x2cdd15,_0x39b1f7);})[_0x8194('0xb9')](function(_0x285b99){return _0xf4c6ac(_0x285b99);})[_0x8194('0xaf')](function(_0x1523ef){return _0x305186(msgResponse(_0x8194('0x1de'),_0x8194('0x145'),JSON['stringify'](_0x1523ef)));});}}else{return _0x305186(msgResponse(_0x8194('0x1da'),_0x8194('0x145'),_0x8194('0x1db')));}});};};Dialer[_0x8194('0x1d')]['startMethodPredictive']=function(_0x16a3ee){var _0x4dd84b=this;return function(){var _0x503065=0x0;var _0x5bfff0=Math[_0x8194('0x1c3')](_0x16a3ee['erlangCallToSecond']*0x3e8);if(_0x5bfff0>0x0){_0x5bfff0=_0x5bfff0<0x64?0x64:_0x5bfff0;loggerPredictive['info'](_0x16a3ee[_0x8194('0x40')],_0x8194('0x1df'),_0x5bfff0,_0x8194('0x48'));_0x16a3ee[_0x8194('0x1c6')]=setInterval(function(){_0x4dd84b['handlePredictive'](_0x16a3ee);loggerPredictiveCalls[_0x8194('0x7a')](_0x8194('0x1e0'),_0x503065+=0x1);},_0x5bfff0);}else{loggerPredictive[_0x8194('0x7a')](_0x16a3ee[_0x8194('0x40')],_0x8194('0x1e1'));}};};Dialer[_0x8194('0x1d')][_0x8194('0x1e2')]=function(_0x5c38a9,_0x2b04ef){var _0x15b661=this;return function(_0x28ef01){if(_['isEmpty'](_0x28ef01)){if(_['isNil'](_0x2b04ef[_0x8194('0x1e3')])||!_0x2b04ef[_0x8194('0x1e4')]){if(_0x5c38a9[_0x8194('0x55')]===_0x8194('0xa')){_0x5c38a9[_0x8194('0x12b')]=_['isUndefined'](_0x5c38a9[_0x8194('0x12b')])?!![]:_0x5c38a9[_0x8194('0x12b')];var _0x250ed8=uuid['v4']();_0x15b661[_0x8194('0x122')][_0x250ed8]=new Action(_0x5c38a9,_0x2b04ef,_0x250ed8);loggerBooked['info']('[booked][checkContactBlack]',_0x250ed8,_0x8194('0x1e5'),JSON[_0x8194('0x47')](_0x5c38a9[_0x8194('0x12b')]),'Queue:\x20',_0x5c38a9[_0x8194('0x40')]);if(_0x5c38a9[_0x8194('0x12b')]){_0x5c38a9['queueStatusComplete']=![];_0x15b661[_0x8194('0x2a')][_0x15b661[_0x8194('0x122')][_0x250ed8][_0x8194('0xb1')]]=[];ami[_0x8194('0xae')]({'actionid':_0x250ed8,'action':'queuestatus','queue':_0x5c38a9[_0x8194('0x40')]})[_0x8194('0xaf')](function(){_0x15b661[_0x8194('0xb3')](_0x5c38a9);_0x15b661[_0x8194('0xc1')]({'active':![],'ContactId':_0x15b661['actions'][_0x250ed8][_0x8194('0xd1')],'ListId':_0x15b661['actions'][_0x250ed8][_0x8194('0xf9')],'VoiceQueueId':_0x15b661[_0x8194('0x122')][_0x250ed8]['VoiceQueueId']||undefined,'CampaignId':_0x15b661[_0x8194('0x122')][_0x250ed8][_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x1e6')));delete _0x15b661[_0x8194('0x122')][_0x250ed8];});}else{loggerBooked['info'](_0x8194('0x1e7'),JSON[_0x8194('0x47')](_0x5c38a9[_0x8194('0x12b')]),_0x8194('0x1e8'),_0x5c38a9[_0x8194('0x40')]);_0x15b661[_0x8194('0xb3')](_0x5c38a9);_0x15b661[_0x8194('0xc1')]({'active':![],'ContactId':_0x15b661[_0x8194('0x122')][_0x250ed8]['ContactId'],'ListId':_0x15b661['actions'][_0x250ed8][_0x8194('0xf9')],'VoiceQueueId':_0x15b661['actions'][_0x250ed8]['VoiceQueueId']||undefined,'CampaignId':_0x15b661[_0x8194('0x122')][_0x250ed8][_0x8194('0xd3')]||undefined})[_0x8194('0xaf')](loggerCatch(_0x8194('0x1e6')));delete _0x15b661[_0x8194('0x122')][_0x250ed8];}}else{return _0x15b661[_0x8194('0x167')](_0x5c38a9,_0x2b04ef);}}else{if(getDiff(_0x2b04ef[_0x8194('0x1e9')])<_0x5c38a9[_0x8194('0x1ea')]*0x3c){if(_0x2b04ef[_0x8194('0x1eb')]&&!_0x2b04ef[_0x8194('0x1eb')][_0x8194('0x1ec')]){_0x15b661[_0x8194('0x90')]['run'](_0x2b04ef['id'])['finally'](function(){_0x15b661[_0x8194('0xb3')](_0x5c38a9);});}else{_0x15b661[_0x8194('0xc3')]({'active':![]},_0x2b04ef['id'],0x1)[_0x8194('0x20')](function(){_0x15b661[_0x8194('0xb3')](_0x5c38a9);});}}else{_0x5c38a9[_0x8194('0x1ed')]+=0x1;_0x15b661['updateOriginated'](_0x5c38a9);if(_0x5c38a9['dialRecallInQueue']){_0x15b661[_0x8194('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b04ef[_0x8194('0xd1')],'ListId':_0x2b04ef[_0x8194('0xf9')],'VoiceQueueId':_0x2b04ef[_0x8194('0xd2')]||undefined,'CampaignId':_0x2b04ef['CampaignId']||undefined})['catch'](loggerCatch(_0x8194('0x1ee')));_0x15b661[_0x8194('0xda')](createObjHistory(_0x5c38a9,_0x2b04ef,_0x8194('0x1ef'),0x17,_0x8194('0x1f0')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x15b661['saveInDb'](createObjHistory(_0x5c38a9,_0x2b04ef,_0x8194('0x1f1'),0x16,_0x8194('0x1f2')),_0x8194('0x1f3'),'[Originate][HistoryRecallClose]');}}}}else{_0x5c38a9[_0x8194('0x5b')]+=0x1;_0x15b661[_0x8194('0xd0')](createObjHistory(_0x5c38a9,_0x2b04ef,_0x8194('0x1f4'),0xd,_0x8194('0x1f5')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x8194('0x1f6');}};};Dialer[_0x8194('0x1d')]['handleIvr']=function(_0x5d7e8c){var _0x2e8ea2=this;var _0x108b0c=_0x5d7e8c[_0x8194('0x1f7')]-_0x5d7e8c[_0x8194('0x6c')]-_0x5d7e8c[_0x8194('0xc5')];emitCampaignSummary(_0x5d7e8c);if(_0x108b0c>0x0){if(_0x108b0c>this[_0x8194('0x25')]){_0x108b0c=this[_0x8194('0x25')];}_0x5d7e8c[_0x8194('0xc5')]+=_0x108b0c;this[_0x8194('0xc7')](_0x5d7e8c['id'],_0x108b0c,_0x5d7e8c[_0x8194('0x1f8')],_0x5d7e8c)[_0x8194('0xb9')](function(_0x56e535){_0x5d7e8c[_0x8194('0xc5')]-=_0x108b0c;_0x5d7e8c[_0x8194('0xc5')]=_0x5d7e8c['temp']>0x0?_0x5d7e8c[_0x8194('0xc5')]:0x0;if(!checkContactEmpty(_0x56e535)){_0x5d7e8c[_0x8194('0x3e')]=_0x8194('0x1f9');logger[_0x8194('0x7a')](_0x8194('0x1fa')+_0x5d7e8c[_0x8194('0x40')]);}else{_0x5d7e8c[_0x8194('0x6c')]+=_0x56e535[_0x8194('0x97')];_0x5d7e8c['message']='RUNNING';for(var _0x559553=0x0;_0x559553<_0x56e535[_0x8194('0x97')];_0x559553+=0x1){_0x5d7e8c['ivrTotalCallsDays']+=0x1;if(_[_0x8194('0xad')](_0x56e535[_0x559553])||_[_0x8194('0xad')](_0x56e535[_0x559553]['Contact'])||_[_0x8194('0xad')](_0x56e535[_0x559553][_0x8194('0x16a')]['phone'])){_0x2e8ea2[_0x8194('0xce')](_0x8194('0x1fb'),_0x5d7e8c,_0x56e535[_0x559553]);}else{_0x2e8ea2[_0x8194('0xbc')](_['pick'](_0x56e535[_0x559553],[_0x8194('0xd3'),_0x8194('0x1fc')]))['then'](_0x2e8ea2['checkContactBlack'](_0x5d7e8c,_0x56e535[_0x559553]))[_0x8194('0xaf')](_0x2e8ea2['loggerHandler'](_0x8194('0x1fd'),_0x5d7e8c));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x5d7e8c,_0x108b0c));}};Dialer[_0x8194('0x1d')][_0x8194('0x159')]=function(_0x26402b,_0xb1213b){var _0x2a7dd6=this;var _0x512e6c=[];var _0x18271f=_0xb1213b>=0x1?_0xb1213b:0x1;if(_0x26402b[_0x8194('0x55')]==='booked'){_0x18271f=0x1;}var _0x4c2fac=Math[_0x8194('0x1c3')](_0x26402b['available']*_0x18271f)-_0x26402b[_0x8194('0x6c')]-_0x26402b[_0x8194('0xc5')];emitVoiceQueueSummary(_0x26402b);if(_0x26402b[_0x8194('0x1fe')]>0x0){var _0x14f4ab=_0x26402b[_0x8194('0x1fe')]-_0x26402b['originated']-_0x26402b[_0x8194('0x4f')]-_0x26402b[_0x8194('0xc5')]-_0x26402b['pTalking'];if(_0x4c2fac>_0x14f4ab){_0x4c2fac=_0x14f4ab;}}if(_0x4c2fac>0x0){if(_0x26402b[_0x8194('0x55')]==='booked'){_0x4c2fac=0x1;}if(_0x4c2fac>this[_0x8194('0x25')]){_0x4c2fac=this[_0x8194('0x25')];}_0x26402b[_0x8194('0xc5')]+=_0x4c2fac;for(var _0x3a9d91 in this[_0x8194('0x23')]){if(typeof this[_0x8194('0x23')][_0x3a9d91]!==_0x8194('0x98')){if(this['agents'][_0x3a9d91][_0x8194('0xa5')]==='not_inuse'&&this[_0x8194('0x23')][_0x3a9d91][_0x8194('0xd8')]==='reachable'){_0x512e6c[_0x8194('0x128')](this[_0x8194('0x23')][_0x3a9d91]['id']);}}}this[_0x8194('0x1ff')](_0x26402b['id'],_0x512e6c,_0x4c2fac,_0x26402b[_0x8194('0x1f8')],_0x26402b)[_0x8194('0xb9')](function(_0xe8c283){_0x26402b[_0x8194('0xc5')]-=_0x4c2fac;_0x26402b['temp']=_0x26402b[_0x8194('0xc5')]>0x0?_0x26402b['temp']:0x0;if(!checkContactEmpty(_0xe8c283)){_0x2a7dd6[_0x8194('0xb6')](_0x26402b)[_0x8194('0xb9')](sendMessageReschedule(_0x26402b))[_0x8194('0xaf')](loggerCatch('[countReScheduled]\x20'));}else{_0x26402b[_0x8194('0x6c')]+=_0xe8c283[_0x8194('0x97')];_0x26402b['message']=_0x26402b[_0x8194('0x55')]==='booked'?'ACTIVE':_0x8194('0x200');for(var _0x30362e=0x0;_0x30362e<_0xe8c283['length'];_0x30362e+=0x1){if(_['isNil'](_0xe8c283[_0x30362e])||_[_0x8194('0xad')](_0xe8c283[_0x30362e][_0x8194('0x16a')])||_[_0x8194('0xad')](_0xe8c283[_0x30362e][_0x8194('0x16a')]['phone'])){_0x2a7dd6[_0x8194('0xce')](_0x8194('0x1fb'),_0x26402b,_0xe8c283[_0x30362e]);}else{_0x2a7dd6[_0x8194('0xba')](_[_0x8194('0x12d')](_0xe8c283[_0x30362e],[_0x8194('0xd2'),_0x8194('0x1fc')]))[_0x8194('0xb9')](_0x2a7dd6[_0x8194('0x1e2')](_0x26402b,_0xe8c283[_0x30362e]))['catch'](_0x2a7dd6[_0x8194('0xcd')](_0x8194('0x1fb'),_0x26402b));}}}})['catch'](loggerGetContactDialer(_0x8194('0x201'),_0x26402b,_0x4c2fac));}};Dialer[_0x8194('0x1d')]['handlePredictive']=function(_0x25dd64){if(_0x25dd64[_0x8194('0x1fe')]>0x0){var _0x115222=_0x25dd64['dialLimitQueue']-_0x25dd64['originated']-_0x25dd64['talking'];if(_0x115222>0x0){this[_0x8194('0x202')](_0x25dd64);}else{loggerPredictiveCalls[_0x8194('0x7a')]('[handlePredictive][limitChannel]');}}else{this[_0x8194('0x202')](_0x25dd64);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x2bdc00){var _0x3f95cd=this;var _0x29952d=[];_0x2bdc00[_0x8194('0x6c')]+=0x1;for(var _0x19cde5 in this[_0x8194('0x23')]){if(typeof this[_0x8194('0x23')][_0x19cde5]!==_0x8194('0x98')){if(this[_0x8194('0x23')][_0x19cde5][_0x8194('0xa5')]===_0x8194('0x203')&&this['agents'][_0x19cde5][_0x8194('0xd8')]===_0x8194('0x204')){_0x29952d[_0x8194('0x128')](this[_0x8194('0x23')][_0x19cde5]['id']);}}}this[_0x8194('0x1ff')](_0x2bdc00['id'],_0x29952d,0x1,_0x2bdc00[_0x8194('0x1f8')],_0x2bdc00)['then'](function(_0x64120c){if(!checkContactEmpty(_0x64120c)){checkContactLowerLimitOriginate(_0x2bdc00,0x1,0x0);_0x3f95cd[_0x8194('0xb6')](_0x2bdc00)[_0x8194('0xb9')](sendMessageReschedule(_0x2bdc00))[_0x8194('0xaf')](loggerCatch(_0x8194('0xb8')));}else{_0x2bdc00[_0x8194('0x3e')]=_0x8194('0x200');if(_[_0x8194('0xad')](_0x64120c[0x0])||_[_0x8194('0xad')](_0x64120c[0x0][_0x8194('0x16a')])||_['isNil'](_0x64120c[0x0][_0x8194('0x16a')][_0x8194('0x169')])){_0x3f95cd[_0x8194('0xce')](_0x8194('0x1fb'),_0x2bdc00,_0x64120c[0x0]);}else{_0x3f95cd[_0x8194('0xba')](_['pick'](_0x64120c[0x0],[_0x8194('0xd2'),_0x8194('0x1fc')]))[_0x8194('0xb9')](_0x3f95cd[_0x8194('0x1e2')](_0x2bdc00,_0x64120c[0x0]))['catch'](_0x3f95cd[_0x8194('0xcd')](_0x8194('0x205'),_0x2bdc00));}}})[_0x8194('0xaf')](loggerGetContactDialer(_0x8194('0x206'),_0x2bdc00,0x1));emitVoiceQueueSummary(_0x2bdc00);};Dialer[_0x8194('0x1d')][_0x8194('0x1dd')]=function(_0x27e3e5,_0x5331ca,_0x6ff354,_0x416034,_0x563766,_0x239a86){loggerPredictive[_0x8194('0x7a')](_0x8194('0x207'));loggerPredictive[_0x8194('0x7a')]('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',_0x27e3e5);loggerPredictive[_0x8194('0x7a')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5331ca);loggerPredictive[_0x8194('0x7a')](_0x8194('0x208'),_0x6ff354);loggerPredictive[_0x8194('0x7a')](_0x8194('0x209'),_0x416034);loggerPredictive[_0x8194('0x7a')](_0x8194('0x20a'),_0x563766);loggerPredictive[_0x8194('0x7a')]('---------------------------');return new BPromise(function(_0x4ecc35,_0x53e4a9){if(_0x27e3e5<=0x0||isNaN(_0x27e3e5)){return _0x53e4a9(msgResponse('[abandonmentRate]','Error',_0x8194('0x20b')+_0x27e3e5));}if(_0x6ff354<=0x0||isNaN(_0x6ff354)){return _0x53e4a9(msgResponse('[abandonmentRate]',_0x8194('0x46'),'Ts\x20=\x20'+_0x6ff354));}if(_0x416034<=0x0||isNaN(_0x416034)){return _0x53e4a9(msgResponse(_0x8194('0x20c'),'Error',_0x8194('0x20d')+_0x416034));}if(_0x5331ca<=0x0||isNaN(_0x5331ca)){return _0x53e4a9(msgResponse(_0x8194('0x20c'),'Error',_0x8194('0x20e')+_0x5331ca));}if(_0x563766<=0x0||isNaN(_0x563766)){return _0x53e4a9(msgResponse(_0x8194('0x20c'),_0x8194('0x46'),_0x8194('0x20f')+_0x563766));}_0x239a86=_0x239a86||0x0;var _0x23a11d=0x1/_0x6ff354;var _0x4be33a=0x0;var _0x1e454a=0x0;var _0x249e2f=0x0;var _0x42f149=0x0;for(var _0x30d64b=0x0;_0x249e2f<_0x563766;_0x30d64b+=0x1){_0x1e454a=_0x30d64b/_0x5331ca;_0x4be33a=(_0x416034*_0x1e454a+_0x239a86)/_0x23a11d;_0x249e2f=erlangb(_0x4be33a,_0x27e3e5);_0x42f149=_0x4be33a/_0x27e3e5*(0x1-erlangb(_0x4be33a,_0x27e3e5));}return _0x4ecc35({'erlangCalls':_0x30d64b,'erlangCallToSecond':_0x5331ca/_0x30d64b,'erlangAbandonmentRate':_0x249e2f,'erlangBusyFactor':_0x42f149});});};Dialer['prototype'][_0x8194('0x1d8')]=function(_0x53212f,_0x3b19dc,_0x10a4b1,_0x3a4964,_0x4ec66a,_0x4fbdae){loggerPredictive[_0x8194('0x7a')](_0x8194('0x210'));loggerPredictive['info'](_0x8194('0x211'),_0x53212f);loggerPredictive[_0x8194('0x7a')](_0x8194('0x212'),_0x3b19dc);loggerPredictive[_0x8194('0x7a')](_0x8194('0x208'),_0x10a4b1);loggerPredictive[_0x8194('0x7a')](_0x8194('0x209'),_0x3a4964);loggerPredictive[_0x8194('0x7a')](_0x8194('0x213'),_0x4ec66a);loggerPredictive[_0x8194('0x7a')](_0x8194('0x81'));return new BPromise(function(_0x1cda39,_0x5bdee7){if(_0x53212f<=0x0||isNaN(_0x53212f)){return _0x5bdee7(msgResponse(_0x8194('0x214'),_0x8194('0x46'),_0x8194('0x20b')+_0x53212f));}if(_0x10a4b1<=0x0||isNaN(_0x10a4b1)){return _0x5bdee7(msgResponse(_0x8194('0x214'),_0x8194('0x46'),_0x8194('0x215')+_0x10a4b1));}if(_0x3a4964<=0x0||isNaN(_0x3a4964)){return _0x5bdee7(msgResponse(_0x8194('0x214'),_0x8194('0x46'),'p\x20=\x20'+_0x3a4964));}if(_0x3b19dc<=0x0||isNaN(_0x3b19dc)){return _0x5bdee7(msgResponse('[busyFactor]',_0x8194('0x46'),_0x8194('0x20e')+_0x3b19dc));}if(_0x4ec66a<=0x0||isNaN(_0x4ec66a)){return _0x5bdee7(msgResponse('[busyFactor]',_0x8194('0x46'),_0x8194('0x216')+_0x4ec66a));}_0x4fbdae=_0x4fbdae||0x0;var _0x5bde95=0x1/_0x10a4b1;var _0x57110b=0x0;var _0x12dced=0x0;var _0x4e3e37=0x0;var _0x5b140c=0x0;for(var _0x36edd0=0x0;_0x5b140c<_0x4ec66a;_0x36edd0+=0x1){_0x12dced=_0x36edd0/_0x3b19dc;_0x57110b=(_0x3a4964*_0x12dced+_0x4fbdae)/_0x5bde95;_0x4e3e37=erlangb(_0x57110b,_0x53212f);_0x5b140c=_0x57110b/_0x53212f*(0x1-erlangb(_0x57110b,_0x53212f));}return _0x1cda39({'erlangCalls':_0x36edd0,'erlangCallToSecond':_0x3b19dc/_0x36edd0,'erlangAbandonmentRate':_0x4e3e37,'erlangBusyFactor':_0x5b140c});});};module[_0x8194('0x217')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5275e91..565f0fa 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 _0x758d=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x526376,_0x51dd16){var _0x1668f9=function(_0x169750){while(--_0x169750){_0x526376['push'](_0x526376['shift']());}};_0x1668f9(++_0x51dd16);}(_0x758d,0xc0));var _0xd758=function(_0x1290d0,_0xce7d14){_0x1290d0=_0x1290d0-0x0;var _0x1da1b7=_0x758d[_0x1290d0];return _0x1da1b7;};'use strict';var util=require(_0xd758('0x0'));var _=require(_0xd758('0x1'));var moment=require('moment');function getSeconds(_0x554c19,_0x52d3cc){var _0x5d6e2e=moment(_0x554c19)['milliseconds'](0x0);var _0x2bb2c9=moment(_0x52d3cc)[_0xd758('0x2')](0x0);return _0x5d6e2e[_0xd758('0x3')](_0x2bb2c9,_0xd758('0x4'));}function QueueCallerAbandon(_0x52c3c2,_0x519d27){this['scheduledat']=_0x52c3c2[_0xd758('0x5')];this[_0xd758('0x6')]=_0x52c3c2[_0xd758('0x6')];this[_0xd758('0x7')]=_0x52c3c2[_0xd758('0x6')]===_0xd758('0x8')?_0xd758('0x9'):_0x52c3c2[_0xd758('0x6')];this['countbusyretry']=_0x52c3c2[_0xd758('0xa')];this[_0xd758('0xb')]=_0x52c3c2['countcongestionretry'];this[_0xd758('0xc')]=_0x52c3c2[_0xd758('0xc')];this[_0xd758('0xd')]=_0x52c3c2[_0xd758('0xa')]+_0x52c3c2[_0xd758('0xb')]+_0x52c3c2['countnoanswerretry']+_0x52c3c2[_0xd758('0xe')]+_0x52c3c2[_0xd758('0xf')]+_0x52c3c2[_0xd758('0x10')]+_0x52c3c2[_0xd758('0x11')]+_0x52c3c2[_0xd758('0x12')];this[_0xd758('0xe')]=_0x52c3c2[_0xd758('0xe')];this['countdropretry']=_0x52c3c2[_0xd758('0xf')];this[_0xd758('0x10')]=_0x52c3c2[_0xd758('0x10')];this['countmachineretry']=_0x52c3c2[_0xd758('0x11')];this[_0xd758('0x12')]=_0x52c3c2[_0xd758('0x12')];this['uniqueid']=_0x519d27[_0xd758('0x13')];this[_0xd758('0x14')]=_0x52c3c2[_0xd758('0x15')];this[_0xd758('0x16')]=_0x52c3c2[_0xd758('0x17')];this[_0xd758('0x18')]=_0x52c3c2['starttime'];this[_0xd758('0x19')]=_0x52c3c2['responsetime'];this[_0xd758('0x1a')]=_0x52c3c2['droptime'];this[_0xd758('0x1b')]=this[_0xd758('0x1a')];this[_0xd758('0x1c')]=getSeconds(_0x52c3c2[_0xd758('0x19')],_0x52c3c2['starttime']);this['holdtime']=getSeconds(this[_0xd758('0x1a')],_0x52c3c2[_0xd758('0x19')]);this[_0xd758('0x1d')]=0x0;this['queue']=_0x519d27[_0xd758('0x9')];this['membername']=_0x519d27['connectedlinename'];this[_0xd758('0x1e')]=_0x519d27[_0xd758('0x1e')];this[_0xd758('0x1f')]=_0x52c3c2['callback'];this[_0xd758('0x20')]=_0x52c3c2['callbackuniqueid'];this[_0xd758('0x21')]=_0x52c3c2[_0xd758('0x21')];this[_0xd758('0x22')]=_0x52c3c2[_0xd758('0x22')];this['ContactId']=_0x52c3c2[_0xd758('0x23')];this['ListId']=_0x52c3c2['ListId'];this['UserId']=_0x52c3c2[_0xd758('0x24')];this[_0xd758('0x25')]=_0x52c3c2[_0xd758('0x25')];this['CampaignId']=_0x52c3c2[_0xd758('0x26')];this[_0xd758('0x27')]=_0x52c3c2[_0xd758('0x27')]||'';this[_0xd758('0x28')]=_0x52c3c2[_0xd758('0x28')]||'';}module[_0xd758('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xeccd=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x2ea725,_0x429ede){var _0x33fb61=function(_0x13ad58){while(--_0x13ad58){_0x2ea725['push'](_0x2ea725['shift']());}};_0x33fb61(++_0x429ede);}(_0xeccd,0x1b3));var _0xdecc=function(_0xa44b8d,_0x2cf8a4){_0xa44b8d=_0xa44b8d-0x0;var _0x333f9b=_0xeccd[_0xa44b8d];return _0x333f9b;};'use strict';var util=require(_0xdecc('0x0'));var _=require(_0xdecc('0x1'));var moment=require(_0xdecc('0x2'));function getSeconds(_0xdb9198,_0x5bb22d){var _0x17eb98=moment(_0xdb9198)['milliseconds'](0x0);var _0x3dd3ff=moment(_0x5bb22d)['milliseconds'](0x0);return _0x17eb98[_0xdecc('0x3')](_0x3dd3ff,_0xdecc('0x4'));}function QueueCallerAbandon(_0x1dd00e,_0x38a7a4){this[_0xdecc('0x5')]=_0x1dd00e[_0xdecc('0x5')];this[_0xdecc('0x6')]=_0x1dd00e['type'];this['campaigntype']=_0x1dd00e[_0xdecc('0x6')]===_0xdecc('0x7')?_0xdecc('0x8'):_0x1dd00e[_0xdecc('0x6')];this[_0xdecc('0x9')]=_0x1dd00e[_0xdecc('0x9')];this[_0xdecc('0xa')]=_0x1dd00e['countcongestionretry'];this['countnoanswerretry']=_0x1dd00e[_0xdecc('0xb')];this[_0xdecc('0xc')]=_0x1dd00e[_0xdecc('0x9')]+_0x1dd00e['countcongestionretry']+_0x1dd00e[_0xdecc('0xb')]+_0x1dd00e['countnosuchnumberretry']+_0x1dd00e['countdropretry']+_0x1dd00e[_0xdecc('0xd')]+_0x1dd00e[_0xdecc('0xe')]+_0x1dd00e[_0xdecc('0xf')];this[_0xdecc('0x10')]=_0x1dd00e[_0xdecc('0x10')];this[_0xdecc('0x11')]=_0x1dd00e[_0xdecc('0x11')];this[_0xdecc('0xd')]=_0x1dd00e[_0xdecc('0xd')];this[_0xdecc('0xe')]=_0x1dd00e['countmachineretry'];this[_0xdecc('0xf')]=_0x1dd00e['countagentrejectretry'];this[_0xdecc('0x12')]=_0x38a7a4[_0xdecc('0x12')];this[_0xdecc('0x13')]=_0x1dd00e[_0xdecc('0x14')];this[_0xdecc('0x15')]=_0x1dd00e[_0xdecc('0x16')];this[_0xdecc('0x17')]=_0x1dd00e[_0xdecc('0x17')];this[_0xdecc('0x18')]=_0x1dd00e[_0xdecc('0x18')];this['droptime']=_0x1dd00e[_0xdecc('0x19')];this['endtime']=this[_0xdecc('0x19')];this[_0xdecc('0x1a')]=getSeconds(_0x1dd00e[_0xdecc('0x18')],_0x1dd00e[_0xdecc('0x17')]);this[_0xdecc('0x1b')]=getSeconds(this[_0xdecc('0x19')],_0x1dd00e[_0xdecc('0x18')]);this[_0xdecc('0x1c')]=0x0;this[_0xdecc('0x8')]=_0x38a7a4[_0xdecc('0x8')];this['membername']=_0x38a7a4[_0xdecc('0x1d')];this[_0xdecc('0x1e')]=_0x38a7a4[_0xdecc('0x1e')];this[_0xdecc('0x1f')]=_0x1dd00e[_0xdecc('0x1f')];this[_0xdecc('0x20')]=_0x1dd00e['callbackuniqueid'];this[_0xdecc('0x21')]=_0x1dd00e[_0xdecc('0x21')];this['recallme']=_0x1dd00e[_0xdecc('0x22')];this[_0xdecc('0x23')]=_0x1dd00e[_0xdecc('0x23')];this[_0xdecc('0x24')]=_0x1dd00e['ListId'];this[_0xdecc('0x25')]=_0x1dd00e[_0xdecc('0x25')];this['VoiceQueueId']=_0x1dd00e[_0xdecc('0x26')];this[_0xdecc('0x27')]=_0x1dd00e[_0xdecc('0x27')];this[_0xdecc('0x28')]=_0x1dd00e[_0xdecc('0x28')]||'';this[_0xdecc('0x29')]=_0x1dd00e[_0xdecc('0x29')]||'';}module[_0xdecc('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 961fce0..70b3293 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(_0x34cbe3,_0x1f0a75){var _0x27f327=function(_0x3905b3){while(--_0x3905b3){_0x34cbe3['push'](_0x34cbe3['shift']());}};_0x27f327(++_0x1f0a75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x57eb84,_0x465ca0){var _0x38c6ff=function(_0x1fea27){while(--_0x1fea27){_0x57eb84['push'](_0x57eb84['shift']());}};_0x38c6ff(++_0x465ca0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 f91def6..8e827e7 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 _0xca9f=['./rpcDb','./channel','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','varset','syncVarSet','newstate','syncNewState','syncNewExten','bind','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','logger','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','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','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami'];(function(_0x4a2860,_0x1ac3f0){var _0xc4d1cf=function(_0xe315dd){while(--_0xe315dd){_0x4a2860['push'](_0x4a2860['shift']());}};_0xc4d1cf(++_0x1ac3f0);}(_0xca9f,0x15e));var _0xfca9=function(_0x3cba1d,_0x2825ae){_0x3cba1d=_0x3cba1d-0x0;var _0x5f192b=_0xca9f[_0x3cba1d];return _0x5f192b;};'use strict';var util=require(_0xfca9('0x0'));var _=require(_0xfca9('0x1'));var BPromise=require(_0xfca9('0x2'));var uuid=require(_0xfca9('0x3'));var moment=require(_0xfca9('0x4'));var path=require(_0xfca9('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xfca9('0x6'));var logger=require(_0xfca9('0x7'))(_0xfca9('0x8'));var ami=require(_0xfca9('0x9'));var rpcDb=require(_0xfca9('0xa'));var Channel=require(_0xfca9('0xb'));var ut=require('./util/util');var Action=require(_0xfca9('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xfca9('0xd'));var faxMessage=require(_0xfca9('0xe'));function Fax(_0x2f41ce){this[_0xfca9('0xf')]={};this[_0xfca9('0x10')]=_0x2f41ce[_0xfca9('0x10')];this['trunks']=_0x2f41ce[_0xfca9('0x11')];this['actions']={};ami['on']('newchannel',this['syncNewchannel']['bind'](this));ami['on'](_0xfca9('0x12'),this[_0xfca9('0x13')]['bind'](this));ami['on'](_0xfca9('0x14'),this[_0xfca9('0x15')]['bind'](this));ami['on']('newexten',this[_0xfca9('0x16')][_0xfca9('0x17')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0xfca9('0x17')](this));ami['on']('receivefax',this['syncReceiveFax'][_0xfca9('0x17')](this));ami['on'](_0xfca9('0x18'),this[_0xfca9('0x19')][_0xfca9('0x17')](this));ami['on'](_0xfca9('0x1a'),this[_0xfca9('0x1b')][_0xfca9('0x17')](this));}Fax[_0xfca9('0x1c')][_0xfca9('0x1d')]=function(_0x18d0e9){if(_0x18d0e9[_0xfca9('0x1e')]===_0xfca9('0x1f')){for(var _0x560597 in this[_0xfca9('0x10')]){if(this[_0xfca9('0x10')][_0xfca9('0x20')](_0x560597)){if(_0x18d0e9[_0xfca9('0x21')]===this[_0xfca9('0x10')][_0x560597][_0xfca9('0x22')]){this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]]={};this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]][_0xfca9('0x24')]=_0x18d0e9[_0xfca9('0x24')];this['channels'][_0x18d0e9[_0xfca9('0x23')]]['id']=this[_0xfca9('0x10')][_0x560597]['id'];this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]][_0xfca9('0x25')]=this[_0xfca9('0x10')][_0x560597][_0xfca9('0x25')];logger[_0xfca9('0x26')](_0x18d0e9[_0xfca9('0x23')],_0xfca9('0x27'));}}}}if(this[_0xfca9('0x28')][_0x18d0e9[_0xfca9('0x23')]]){this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]]={};this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]][_0xfca9('0x24')]=_0x18d0e9[_0xfca9('0x24')];logger[_0xfca9('0x26')](_0x18d0e9['uniqueid'],_0xfca9('0x27'));}};Fax[_0xfca9('0x1c')][_0xfca9('0x13')]=function(_0x306168){if(this[_0xfca9('0xf')][_0x306168[_0xfca9('0x23')]]){for(var _0xe4f7ef in _0x306168['variable']){if(_0x306168['variable'][_0xfca9('0x20')](_0xe4f7ef)){this[_0xfca9('0xf')][_0x306168[_0xfca9('0x23')]][_0xe4f7ef]=_0x306168[_0xfca9('0x29')];}}}};Fax['prototype']['syncNewState']=function(_0x5ce63c){if(this[_0xfca9('0xf')][_0x5ce63c[_0xfca9('0x23')]]){this[_0xfca9('0xf')][_0x5ce63c[_0xfca9('0x23')]][_0xfca9('0x2a')]=_0x5ce63c[_0xfca9('0x2a')];this[_0xfca9('0xf')][_0x5ce63c[_0xfca9('0x23')]][_0xfca9('0x2b')]=_0x5ce63c[_0xfca9('0x2b')];}};Fax[_0xfca9('0x1c')][_0xfca9('0x16')]=function(_0xa92a56){if(this[_0xfca9('0xf')][_0xa92a56['uniqueid']]){for(var _0x4b6b11 in _0xa92a56['variable']){if(_0xa92a56['variable'][_0xfca9('0x20')](_0x4b6b11)){this[_0xfca9('0xf')][_0xa92a56[_0xfca9('0x23')]][_0x4b6b11]=_0xa92a56[_0xfca9('0x29')];}}}};Fax['prototype'][_0xfca9('0x2c')]=function(_0x1de581){if(this[_0xfca9('0xf')][_0x1de581[_0xfca9('0x23')]]){this['channels'][_0x1de581[_0xfca9('0x23')]][_0xfca9('0x2d')]=_0x1de581['operation'];this[_0xfca9('0xf')][_0x1de581[_0xfca9('0x23')]][_0xfca9('0x2e')]=_0x1de581[_0xfca9('0x2e')];this['channels'][_0x1de581[_0xfca9('0x23')]][_0xfca9('0x22')]=_0x1de581['localstationid'];this[_0xfca9('0xf')][_0x1de581['uniqueid']][_0xfca9('0x2f')]=_0x1de581['filename'];logger[_0xfca9('0x26')](_0x1de581[_0xfca9('0x23')],_0xfca9('0x30'));}};Fax['prototype'][_0xfca9('0x31')]=function(_0xcbfd7f){var _0x3acbfc=this;if(this[_0xfca9('0xf')][_0xcbfd7f['uniqueid']]){var _0x3993a9=this['channels'][_0xcbfd7f[_0xfca9('0x23')]]['id'];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x32')]=_0xcbfd7f[_0xfca9('0x32')];this[_0xfca9('0xf')][_0xcbfd7f['uniqueid']][_0xfca9('0x33')]=_0xcbfd7f[_0xfca9('0x33')];this['channels'][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x22')]=_0xcbfd7f['localstationid'];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]]['resolution']=_0xcbfd7f[_0xfca9('0x34')];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x35')]=_0xcbfd7f[_0xfca9('0x35')];this['channels'][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x2f')]=_0xcbfd7f['filename'];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]]['calleridnum']=_0xcbfd7f[_0xfca9('0x36')];if(this[_0xfca9('0xf')][_0xcbfd7f['uniqueid']][_0xfca9('0x33')]>0x0){tiff2pdf(_0xcbfd7f[_0xfca9('0x2f')],_0xfca9('0x37'),function(_0x58db3a){logger[_0xfca9('0x26')](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x38'),_0x58db3a[_0xfca9('0x39')]);attachment[_0xfca9('0x3a')]({'name':path[_0xfca9('0x3b')](_0xcbfd7f['filename'])['name'],'basename':path['parse'](_0xcbfd7f[_0xfca9('0x2f')])[_0xfca9('0x25')]+_0xfca9('0x3c'),'type':_0xfca9('0x3d')})['then'](function(_0x572f40){faxAccount[_0xfca9('0x3e')](_0x3993a9,{'from':_0xcbfd7f[_0xfca9('0x36')],'mapKey':'fax','body':path['parse'](_0xcbfd7f['filename'])[_0xfca9('0x25')]+'.pdf','AttachmentId':_0x572f40['id']})[_0xfca9('0x3f')](function(_0x4c5c70){logger['error'](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x40'),JSON[_0xfca9('0x41')](_0x4c5c70));});})[_0xfca9('0x3f')](function(_0x23780a){logger[_0xfca9('0x42')](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x43'),JSON[_0xfca9('0x41')](_0x23780a));});});}logger[_0xfca9('0x26')](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x43'));}};Fax[_0xfca9('0x1c')][_0xfca9('0x1b')]=function(_0x3eb61e){if(this[_0xfca9('0x28')][_0x3eb61e[_0xfca9('0x23')]]){_[_0xfca9('0x44')](this[_0xfca9('0xf')][_0x3eb61e['uniqueid']],_['pick'](_0x3eb61e,[_0xfca9('0x45'),_0xfca9('0x46')]));}};function updateStatus(_0x355033){if(_0x355033[_0xfca9('0x47')]){faxMessage[_0xfca9('0x48')](_0x355033[_0xfca9('0x47')],{'failMessage':_0xfca9('0x49')})['then'](function(_0x2f4932){ut['logger'](_0xfca9('0x4a'),_0x2f4932);})[_0xfca9('0x3f')](function(_0x1b7236){ut['logger'](_0xfca9('0x4b'),_0x1b7236);});}else{ut['logger'](_0xfca9('0x4c'));}}Fax['prototype'][_0xfca9('0x4d')]=function(_0x12f3d4,_0x158ec9,_0x5adc5e){var _0x232852=this;var _0x59e0cf={};if(_0x158ec9){_0x59e0cf={'read':_0x158ec9};}else{_0x59e0cf={'failMessage':_0x5adc5e};}if(this[_0xfca9('0x28')][_0x12f3d4][_0xfca9('0x47')]){faxMessage[_0xfca9('0x48')](this[_0xfca9('0x28')][_0x12f3d4][_0xfca9('0x47')],_0x59e0cf)[_0xfca9('0x4e')](function(_0xa0243e){ut[_0xfca9('0x4f')]('[Fax][Message][Updated]',_0xa0243e);})[_0xfca9('0x3f')](function(_0x41d82c){ut[_0xfca9('0x4f')](_0xfca9('0x50'),_0x41d82c);})[_0xfca9('0x51')](function(){delete _0x232852[_0xfca9('0xf')][_0x12f3d4];delete _0x232852[_0xfca9('0x28')][_0x12f3d4];});}else{ut[_0xfca9('0x4f')](_0xfca9('0x52'));delete this[_0xfca9('0xf')][_0x12f3d4];delete this['actions'][_0x12f3d4];}};Fax[_0xfca9('0x1c')][_0xfca9('0x19')]=function(_0xb2fd7c){var _0x1c1a7a=this;if(this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]]){if(this[_0xfca9('0x28')][_0xb2fd7c[_0xfca9('0x23')]]){this['channels'][_0xb2fd7c['uniqueid']]['id']=this[_0xfca9('0x28')][_0xb2fd7c[_0xfca9('0x23')]]['id'];this[_0xfca9('0xf')][_0xb2fd7c['uniqueid']]['name']=this['actions'][_0xb2fd7c['uniqueid']]['name'];}logger['info'](_0xb2fd7c[_0xfca9('0x23')],this['actions'][_0xb2fd7c[_0xfca9('0x23')]]?_0xfca9('0x53'):_0xfca9('0x54'),JSON[_0xfca9('0x41')](this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]]));if(this[_0xfca9('0x28')][_0xb2fd7c[_0xfca9('0x23')]]){if(this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]][_0xfca9('0x55')]>0x0&&this[_0xfca9('0xf')][_0xb2fd7c['uniqueid']][_0xfca9('0x56')]===_0xfca9('0x57')){this[_0xfca9('0x4d')](_0xb2fd7c[_0xfca9('0x23')],!![]);}else{this[_0xfca9('0x4d')](_0xb2fd7c['uniqueid'],![],this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]][_0xfca9('0x58')]:_0xfca9('0x59'));}}}};Fax[_0xfca9('0x1c')][_0xfca9('0x5a')]=function(_0x9a02ac){var _0x2d98ba=this;return new BPromise(function(_0x34632e,_0x3cd4a1){_0x2d98ba[_0xfca9('0x5b')](_0x9a02ac,_0x2d98ba[_0xfca9('0x10')][_0x9a02ac[_0xfca9('0x5c')]])[_0xfca9('0x4e')](function(_0x30b3b6){ut[_0xfca9('0x4f')]('[Fax][execOriginate][success]',_0x30b3b6);_0x34632e(ut['message'](_0xfca9('0x5d')));})['catch'](function(_0x3870eb){ut[_0xfca9('0x4f')](_0xfca9('0x5e'),_0x3870eb);updateStatus(_0x9a02ac);_0x3cd4a1(ut['message'](_0xfca9('0x5f')));});});};Fax[_0xfca9('0x1c')][_0xfca9('0x60')]=function(_0x2fb3e0){var _0x29d9fe=this;return new BPromise(function(_0x43c1f2,_0x52b3e1){var _0xb1eeb=_0x29d9fe[_0xfca9('0x61')](_0x29d9fe['faxAccounts'][_0x2fb3e0['FaxAccountId']]['Trunk'],_0x2fb3e0);if(_0xb1eeb[_0xfca9('0x62')]){_0x43c1f2(ut[_0xfca9('0x39')](_0xfca9('0x63')));}else{_0x52b3e1(ut[_0xfca9('0x39')](_0xb1eeb['message']));}});};function originate(_0x19ed9c,_0x287add,_0xc7f750){return new BPromise(function(_0x345396,_0x14dceb){if(_0xc7f750){var _0x20b236=util[_0xfca9('0x64')](_0xfca9('0x65'),path[_0xfca9('0x3b')](_0x19ed9c[_0xfca9('0x5')])['name'],_0x19ed9c[_0xfca9('0x5')]);gs[_0xfca9('0x66')](_0x20b236)[_0xfca9('0x4e')](function(){_0x19ed9c[_0xfca9('0x5')]=util[_0xfca9('0x64')](_0xfca9('0x67'),path[_0xfca9('0x3b')](_0x19ed9c[_0xfca9('0x5')])['dir'],path[_0xfca9('0x3b')](_0x19ed9c[_0xfca9('0x5')])['name']);_0x287add[_0xfca9('0x68')]=_0x19ed9c[_0xfca9('0x5')];ut['logger'](_0xfca9('0x69'),'');ami['Action'](ut[_0xfca9('0x6a')](_0x19ed9c,_0x287add))['then'](function(_0x504344){_0x345396(_0x504344);})[_0xfca9('0x3f')](function(_0x43caa1){_0x14dceb(_0x43caa1);});})[_0xfca9('0x3f')](function(_0x58e7a2){_0x14dceb(_0x58e7a2);});}else{ami['Action'](ut[_0xfca9('0x6a')](_0x19ed9c,_0x287add))[_0xfca9('0x4e')](function(_0x30dcf3){_0x345396(_0x30dcf3);})[_0xfca9('0x3f')](function(_0x357726){_0x14dceb(_0x357726);});}});}Fax[_0xfca9('0x1c')][_0xfca9('0x5b')]=function(_0x2cb3cf,_0x5d2f2b){var _0x49ff4f=this;return new BPromise(function(_0x4f0e10,_0x8318c){var _0x53f723=uuid['v4']();var _0x11ffe1=ut[_0xfca9('0x6b')](_0x2cb3cf,_0x5d2f2b);_0x49ff4f[_0xfca9('0x28')][_0x53f723]=new Action(_0x53f723,_0x5d2f2b,_0x2cb3cf);var _0x5dd584=_0x49ff4f[_0xfca9('0x28')][_0x53f723];if(path['parse'](_0x2cb3cf[_0xfca9('0x5')])[_0xfca9('0x6c')]===_0xfca9('0x3c')){originate(_0x5dd584,_0x11ffe1,!![])[_0xfca9('0x4e')](function(_0x1a5264){_0x4f0e10(_0x1a5264);})[_0xfca9('0x3f')](function(_0x3a9fa1){_0x8318c(_0x3a9fa1);});}else{originate(_0x5dd584,_0x11ffe1,![])[_0xfca9('0x4e')](function(_0x575c11){_0x4f0e10(_0x575c11);})[_0xfca9('0x3f')](function(_0x21ecbc){_0x8318c(_0x21ecbc);});}});};Fax[_0xfca9('0x1c')][_0xfca9('0x6d')]=function(_0x213f6d){return!_[_0xfca9('0x6e')](_0x213f6d)&&!_[_0xfca9('0x6e')](_0x213f6d[_0xfca9('0x25')])&&!_[_0xfca9('0x6e')](_0x213f6d[_0xfca9('0x6f')])&&_0x213f6d[_0xfca9('0x6f')]&&!_['isNil'](this[_0xfca9('0x11')][util[_0xfca9('0x64')](_0xfca9('0x70'),_0x213f6d[_0xfca9('0x25')])])&&!_[_0xfca9('0x6e')](this[_0xfca9('0x11')][util[_0xfca9('0x64')](_0xfca9('0x70'),_0x213f6d['name'])][_0xfca9('0x2e')])&&(this['trunks'][util[_0xfca9('0x64')]('SIP/%s',_0x213f6d[_0xfca9('0x25')])][_0xfca9('0x2e')]===_0xfca9('0x71')||this[_0xfca9('0x11')][util[_0xfca9('0x64')]('SIP/%s',_0x213f6d[_0xfca9('0x25')])][_0xfca9('0x2e')]===_0xfca9('0x72'));};Fax[_0xfca9('0x1c')][_0xfca9('0x61')]=function(_0x452268,_0x474174){if(!this[_0xfca9('0x6d')](_0x452268)){ut[_0xfca9('0x4f')](_0xfca9('0x73'),_[_0xfca9('0x6e')](_0x452268)?'':_0x452268[_0xfca9('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xfca9('0x74')};}if(_['isNil'](_0x474174[_0xfca9('0x8')])){ut['logger'](_0xfca9('0x75'),JSON[_0xfca9('0x41')](_0x474174));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xfca9('0x6e')](_0x474174['path'])){ut[_0xfca9('0x4f')](_0xfca9('0x76'),JSON[_0xfca9('0x41')](_0x474174));return{'isValid':![],'message':_0xfca9('0x77')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0xe67d=['channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','actions','merge','response','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','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','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','bluebird','uuid','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','syncNewState','channelstate'];(function(_0x39f39f,_0x3dd9bd){var _0x2acd18=function(_0x3d1d8b){while(--_0x3d1d8b){_0x39f39f['push'](_0x39f39f['shift']());}};_0x2acd18(++_0x3dd9bd);}(_0xe67d,0x1aa));var _0xde67=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0xe67d[_0x46e182];return _0x42ade0;};'use strict';var util=require(_0xde67('0x0'));var _=require('lodash');var BPromise=require(_0xde67('0x1'));var uuid=require(_0xde67('0x2'));var moment=require('moment');var path=require(_0xde67('0x3'));var tiff2pdf=require(_0xde67('0x4'));var gs=require(_0xde67('0x5'));var logger=require('../../../config/logger')(_0xde67('0x6'));var ami=require('../ami');var rpcDb=require(_0xde67('0x7'));var Channel=require(_0xde67('0x8'));var ut=require(_0xde67('0x9'));var Action=require(_0xde67('0xa'));var faxAccount=require(_0xde67('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x4236e1){this[_0xde67('0xc')]={};this['faxAccounts']=_0x4236e1[_0xde67('0xd')];this['trunks']=_0x4236e1[_0xde67('0xe')];this['actions']={};ami['on'](_0xde67('0xf'),this[_0xde67('0x10')][_0xde67('0x11')](this));ami['on'](_0xde67('0x12'),this[_0xde67('0x13')][_0xde67('0x11')](this));ami['on'](_0xde67('0x14'),this['syncNewState'][_0xde67('0x11')](this));ami['on'](_0xde67('0x15'),this['syncNewExten']['bind'](this));ami['on'](_0xde67('0x16'),this[_0xde67('0x17')]['bind'](this));ami['on'](_0xde67('0x18'),this['syncReceiveFax'][_0xde67('0x11')](this));ami['on'](_0xde67('0x19'),this[_0xde67('0x1a')][_0xde67('0x11')](this));ami['on'](_0xde67('0x1b'),this['syncOriginateResponse'][_0xde67('0x11')](this));}Fax['prototype'][_0xde67('0x10')]=function(_0x374202){if(_0x374202[_0xde67('0x1c')]===_0xde67('0x1d')){for(var _0x5ae744 in this[_0xde67('0xd')]){if(this[_0xde67('0xd')]['hasOwnProperty'](_0x5ae744)){if(_0x374202[_0xde67('0x1e')]===this[_0xde67('0xd')][_0x5ae744][_0xde67('0x1f')]){this['channels'][_0x374202[_0xde67('0x20')]]={};this['channels'][_0x374202[_0xde67('0x20')]][_0xde67('0x21')]=_0x374202[_0xde67('0x21')];this[_0xde67('0xc')][_0x374202[_0xde67('0x20')]]['id']=this[_0xde67('0xd')][_0x5ae744]['id'];this['channels'][_0x374202[_0xde67('0x20')]]['name']=this[_0xde67('0xd')][_0x5ae744][_0xde67('0x22')];logger[_0xde67('0x23')](_0x374202[_0xde67('0x20')],_0xde67('0x24'));}}}}if(this['actions'][_0x374202['uniqueid']]){this['channels'][_0x374202['uniqueid']]={};this[_0xde67('0xc')][_0x374202[_0xde67('0x20')]][_0xde67('0x21')]=_0x374202[_0xde67('0x21')];logger['info'](_0x374202['uniqueid'],_0xde67('0x24'));}};Fax['prototype'][_0xde67('0x13')]=function(_0x1aa8b3){if(this['channels'][_0x1aa8b3[_0xde67('0x20')]]){for(var _0x7ec2be in _0x1aa8b3['variable']){if(_0x1aa8b3[_0xde67('0x25')]['hasOwnProperty'](_0x7ec2be)){this[_0xde67('0xc')][_0x1aa8b3[_0xde67('0x20')]][_0x7ec2be]=_0x1aa8b3[_0xde67('0x26')];}}}};Fax[_0xde67('0x27')][_0xde67('0x28')]=function(_0x5ec744){if(this[_0xde67('0xc')][_0x5ec744[_0xde67('0x20')]]){this[_0xde67('0xc')][_0x5ec744[_0xde67('0x20')]][_0xde67('0x29')]=_0x5ec744[_0xde67('0x29')];this[_0xde67('0xc')][_0x5ec744[_0xde67('0x20')]][_0xde67('0x2a')]=_0x5ec744['channelstatedesc'];}};Fax[_0xde67('0x27')][_0xde67('0x2b')]=function(_0x1bbadb){if(this['channels'][_0x1bbadb[_0xde67('0x20')]]){for(var _0x468261 in _0x1bbadb[_0xde67('0x25')]){if(_0x1bbadb[_0xde67('0x25')]['hasOwnProperty'](_0x468261)){this[_0xde67('0xc')][_0x1bbadb[_0xde67('0x20')]][_0x468261]=_0x1bbadb[_0xde67('0x26')];}}}};Fax[_0xde67('0x27')][_0xde67('0x17')]=function(_0x209f9b){if(this[_0xde67('0xc')][_0x209f9b[_0xde67('0x20')]]){this[_0xde67('0xc')][_0x209f9b[_0xde67('0x20')]][_0xde67('0x2c')]=_0x209f9b['operation'];this['channels'][_0x209f9b['uniqueid']][_0xde67('0x2d')]=_0x209f9b[_0xde67('0x2d')];this[_0xde67('0xc')][_0x209f9b[_0xde67('0x20')]][_0xde67('0x1f')]=_0x209f9b['localstationid'];this[_0xde67('0xc')][_0x209f9b[_0xde67('0x20')]][_0xde67('0x2e')]=_0x209f9b[_0xde67('0x2e')];logger[_0xde67('0x23')](_0x209f9b[_0xde67('0x20')],_0xde67('0x2f'));}};Fax[_0xde67('0x27')][_0xde67('0x30')]=function(_0x5b8dcd){var _0x31e2d6=this;if(this[_0xde67('0xc')][_0x5b8dcd[_0xde67('0x20')]]){var _0xab56a2=this[_0xde67('0xc')][_0x5b8dcd[_0xde67('0x20')]]['id'];this[_0xde67('0xc')][_0x5b8dcd['uniqueid']][_0xde67('0x31')]=_0x5b8dcd[_0xde67('0x31')];this[_0xde67('0xc')][_0x5b8dcd[_0xde67('0x20')]]['pagestransferred']=_0x5b8dcd[_0xde67('0x32')];this[_0xde67('0xc')][_0x5b8dcd[_0xde67('0x20')]]['localstationid']=_0x5b8dcd['localstationid'];this['channels'][_0x5b8dcd[_0xde67('0x20')]][_0xde67('0x33')]=_0x5b8dcd[_0xde67('0x33')];this['channels'][_0x5b8dcd[_0xde67('0x20')]][_0xde67('0x34')]=_0x5b8dcd[_0xde67('0x34')];this[_0xde67('0xc')][_0x5b8dcd['uniqueid']]['filename']=_0x5b8dcd[_0xde67('0x2e')];this[_0xde67('0xc')][_0x5b8dcd[_0xde67('0x20')]][_0xde67('0x35')]=_0x5b8dcd['calleridnum'];if(this['channels'][_0x5b8dcd[_0xde67('0x20')]][_0xde67('0x32')]>0x0){tiff2pdf(_0x5b8dcd[_0xde67('0x2e')],_0xde67('0x36'),function(_0x18783a){logger['info'](_0x5b8dcd[_0xde67('0x20')],_0xde67('0x37'),_0x18783a[_0xde67('0x38')]);attachment['create']({'name':path[_0xde67('0x39')](_0x5b8dcd['filename'])[_0xde67('0x22')],'basename':path['parse'](_0x5b8dcd[_0xde67('0x2e')])[_0xde67('0x22')]+'.pdf','type':_0xde67('0x3a')})[_0xde67('0x3b')](function(_0x2f06bc){faxAccount[_0xde67('0x3c')](_0xab56a2,{'from':_0x5b8dcd[_0xde67('0x35')],'mapKey':'fax','body':path[_0xde67('0x39')](_0x5b8dcd[_0xde67('0x2e')])[_0xde67('0x22')]+'.pdf','AttachmentId':_0x2f06bc['id']})[_0xde67('0x3d')](function(_0x2c8487){logger[_0xde67('0x3e')](_0x5b8dcd['uniqueid'],_0xde67('0x3f'),JSON[_0xde67('0x40')](_0x2c8487));});})[_0xde67('0x3d')](function(_0x260cd8){logger[_0xde67('0x3e')](_0x5b8dcd[_0xde67('0x20')],_0xde67('0x41'),JSON[_0xde67('0x40')](_0x260cd8));});});}logger[_0xde67('0x23')](_0x5b8dcd[_0xde67('0x20')],_0xde67('0x41'));}};Fax[_0xde67('0x27')][_0xde67('0x42')]=function(_0x5673de){if(this[_0xde67('0x43')][_0x5673de['uniqueid']]){_[_0xde67('0x44')](this[_0xde67('0xc')][_0x5673de['uniqueid']],_['pick'](_0x5673de,[_0xde67('0x45'),'reason']));}};function updateStatus(_0x210e11){if(_0x210e11[_0xde67('0x46')]){faxMessage[_0xde67('0x47')](_0x210e11[_0xde67('0x46')],{'failMessage':_0xde67('0x48')})['then'](function(_0x976939){ut['logger'](_0xde67('0x49'),_0x976939);})[_0xde67('0x3d')](function(_0x51e373){ut[_0xde67('0x4a')](_0xde67('0x4b'),_0x51e373);});}else{ut[_0xde67('0x4a')](_0xde67('0x4c'));}}Fax['prototype'][_0xde67('0x4d')]=function(_0x275ded,_0x426858,_0x2f57c5){var _0x1c56a5=this;var _0x41b17a={};if(_0x426858){_0x41b17a={'read':_0x426858};}else{_0x41b17a={'failMessage':_0x2f57c5};}if(this[_0xde67('0x43')][_0x275ded][_0xde67('0x46')]){faxMessage['update'](this['actions'][_0x275ded][_0xde67('0x46')],_0x41b17a)[_0xde67('0x3b')](function(_0x4d377d){ut[_0xde67('0x4a')](_0xde67('0x4e'),_0x4d377d);})[_0xde67('0x3d')](function(_0x45e497){ut[_0xde67('0x4a')](_0xde67('0x4f'),_0x45e497);})[_0xde67('0x50')](function(){delete _0x1c56a5[_0xde67('0xc')][_0x275ded];delete _0x1c56a5[_0xde67('0x43')][_0x275ded];});}else{ut[_0xde67('0x4a')](_0xde67('0x51'));delete this[_0xde67('0xc')][_0x275ded];delete this[_0xde67('0x43')][_0x275ded];}};Fax['prototype'][_0xde67('0x1a')]=function(_0x567a57){var _0x235c7f=this;if(this[_0xde67('0xc')][_0x567a57['uniqueid']]){if(this[_0xde67('0x43')][_0x567a57[_0xde67('0x20')]]){this[_0xde67('0xc')][_0x567a57[_0xde67('0x20')]]['id']=this['actions'][_0x567a57[_0xde67('0x20')]]['id'];this[_0xde67('0xc')][_0x567a57[_0xde67('0x20')]][_0xde67('0x22')]=this[_0xde67('0x43')][_0x567a57[_0xde67('0x20')]][_0xde67('0x22')];}logger['info'](_0x567a57[_0xde67('0x20')],this[_0xde67('0x43')][_0x567a57[_0xde67('0x20')]]?_0xde67('0x52'):_0xde67('0x53'),JSON[_0xde67('0x40')](this['channels'][_0x567a57['uniqueid']]));if(this['actions'][_0x567a57[_0xde67('0x20')]]){if(this['channels'][_0x567a57['uniqueid']]['faxpages']>0x0&&this['channels'][_0x567a57[_0xde67('0x20')]][_0xde67('0x16')]===_0xde67('0x54')){this[_0xde67('0x4d')](_0x567a57[_0xde67('0x20')],!![]);}else{this[_0xde67('0x4d')](_0x567a57[_0xde67('0x20')],![],this[_0xde67('0xc')][_0x567a57[_0xde67('0x20')]][_0xde67('0x55')]?_0xde67('0x56')+this['channels'][_0x567a57[_0xde67('0x20')]]['faxstatusstring']:_0xde67('0x57'));}}}};Fax[_0xde67('0x27')][_0xde67('0x58')]=function(_0x22d63c){var _0x468bf2=this;return new BPromise(function(_0x11e170,_0x5a1f20){_0x468bf2[_0xde67('0x59')](_0x22d63c,_0x468bf2['faxAccounts'][_0x22d63c['FaxAccountId']])[_0xde67('0x3b')](function(_0x50b8d2){ut['logger']('[Fax][execOriginate][success]',_0x50b8d2);_0x11e170(ut[_0xde67('0x38')](_0xde67('0x5a')));})[_0xde67('0x3d')](function(_0x58b6e9){ut[_0xde67('0x4a')]('[Fax][execOriginate][failure]',_0x58b6e9);updateStatus(_0x22d63c);_0x5a1f20(ut[_0xde67('0x38')](_0xde67('0x5b')));});});};Fax[_0xde67('0x27')][_0xde67('0x5c')]=function(_0x37b92e){var _0x23f272=this;return new BPromise(function(_0x3c2850,_0x250340){var _0x3707ac=_0x23f272[_0xde67('0x5d')](_0x23f272['faxAccounts'][_0x37b92e[_0xde67('0x5e')]][_0xde67('0x5f')],_0x37b92e);if(_0x3707ac[_0xde67('0x60')]){_0x3c2850(ut[_0xde67('0x38')](_0xde67('0x61')));}else{_0x250340(ut[_0xde67('0x38')](_0x3707ac[_0xde67('0x38')]));}});};function originate(_0xde34e5,_0x536b3e,_0xf1218b){return new BPromise(function(_0x36f012,_0xbb9fa){if(_0xf1218b){var _0x32b714=util[_0xde67('0x62')](_0xde67('0x63'),path[_0xde67('0x39')](_0xde34e5[_0xde67('0x3')])[_0xde67('0x22')],_0xde34e5[_0xde67('0x3')]);gs[_0xde67('0x64')](_0x32b714)[_0xde67('0x3b')](function(){_0xde34e5[_0xde67('0x3')]=util[_0xde67('0x62')](_0xde67('0x65'),path['parse'](_0xde34e5['path'])[_0xde67('0x66')],path[_0xde67('0x39')](_0xde34e5[_0xde67('0x3')])['name']);_0x536b3e['XMF-PATH']=_0xde34e5['path'];ut[_0xde67('0x4a')](_0xde67('0x67'),'');ami[_0xde67('0x68')](ut[_0xde67('0x69')](_0xde34e5,_0x536b3e))[_0xde67('0x3b')](function(_0x36eb50){_0x36f012(_0x36eb50);})[_0xde67('0x3d')](function(_0x47432e){_0xbb9fa(_0x47432e);});})[_0xde67('0x3d')](function(_0x3cd69){_0xbb9fa(_0x3cd69);});}else{ami['Action'](ut[_0xde67('0x69')](_0xde34e5,_0x536b3e))[_0xde67('0x3b')](function(_0x4824e3){_0x36f012(_0x4824e3);})['catch'](function(_0x300872){_0xbb9fa(_0x300872);});}});}Fax[_0xde67('0x27')][_0xde67('0x59')]=function(_0x5977c1,_0xe60fa1){var _0x42a8b5=this;return new BPromise(function(_0x44ae4e,_0x50080e){var _0x4b0784=uuid['v4']();var _0x33a222=ut['addVariables'](_0x5977c1,_0xe60fa1);_0x42a8b5[_0xde67('0x43')][_0x4b0784]=new Action(_0x4b0784,_0xe60fa1,_0x5977c1);var _0x575c47=_0x42a8b5[_0xde67('0x43')][_0x4b0784];if(path[_0xde67('0x39')](_0x5977c1['path'])['ext']==='.pdf'){originate(_0x575c47,_0x33a222,!![])[_0xde67('0x3b')](function(_0x507bfc){_0x44ae4e(_0x507bfc);})[_0xde67('0x3d')](function(_0x4a19f5){_0x50080e(_0x4a19f5);});}else{originate(_0x575c47,_0x33a222,![])[_0xde67('0x3b')](function(_0x180f9c){_0x44ae4e(_0x180f9c);})['catch'](function(_0x3c7ab5){_0x50080e(_0x3c7ab5);});}});};Fax[_0xde67('0x27')][_0xde67('0x6a')]=function(_0x4b266b){return!_[_0xde67('0x6b')](_0x4b266b)&&!_['isNil'](_0x4b266b[_0xde67('0x22')])&&!_[_0xde67('0x6b')](_0x4b266b[_0xde67('0x6c')])&&_0x4b266b[_0xde67('0x6c')]&&!_[_0xde67('0x6b')](this[_0xde67('0xe')][util[_0xde67('0x62')](_0xde67('0x6d'),_0x4b266b[_0xde67('0x22')])])&&!_['isNil'](this[_0xde67('0xe')][util[_0xde67('0x62')]('SIP/%s',_0x4b266b['name'])][_0xde67('0x2d')])&&(this[_0xde67('0xe')][util[_0xde67('0x62')](_0xde67('0x6d'),_0x4b266b[_0xde67('0x22')])][_0xde67('0x2d')]==='reachable'||this['trunks'][util[_0xde67('0x62')](_0xde67('0x6d'),_0x4b266b[_0xde67('0x22')])][_0xde67('0x2d')]===_0xde67('0x6e'));};Fax[_0xde67('0x27')][_0xde67('0x5d')]=function(_0x437655,_0x443edf){if(!this[_0xde67('0x6a')](_0x437655)){ut[_0xde67('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xde67('0x6b')](_0x437655)?'':_0x437655[_0xde67('0x22')]+_0xde67('0x6f'));return{'isValid':![],'message':_0xde67('0x70')};}if(_['isNil'](_0x443edf[_0xde67('0x6')])){ut[_0xde67('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x443edf));return{'isValid':![],'message':_0xde67('0x71')};}if(_[_0xde67('0x6b')](_0x443edf[_0xde67('0x3')])){ut['logger'](_0xde67('0x72'),JSON['stringify'](_0x443edf));return{'isValid':![],'message':_0xde67('0x73')};}return{'isValid':!![],'message':_0xde67('0x74')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index cf3a1b7..8fa52bb 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 _0xd4e9=['../../../config/logger','preview','lodash','error','notify','then','util','bluebird'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd4e9,0x1be));var _0x9d4e=function(_0xba5a8a,_0xb328f3){_0xba5a8a=_0xba5a8a-0x0;var _0x5219b6=_0xd4e9[_0xba5a8a];return _0x5219b6;};'use strict';var util=require(_0x9d4e('0x0'));var BPromise=require(_0x9d4e('0x1'));var logger=require(_0x9d4e('0x2'))(_0x9d4e('0x3'));var _=require(_0x9d4e('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x12bc2b){return function(_0xa67571){logger[_0x9d4e('0x5')](_0x12bc2b,util['inspect'](_0xa67571,{'showHidden':![],'depth':null}));};}exports[_0x9d4e('0x6')]=function(_0xe8a7db,_0x330e5f){return BPromise['resolve']()[_0x9d4e('0x7')](faxAccount['notify'](_0xe8a7db,_0x330e5f))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xf9d1=['bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf9d1,0x11d));var _0x1f9d=function(_0x55f288,_0xc1d971){_0x55f288=_0x55f288-0x0;var _0x217263=_0xf9d1[_0x55f288];return _0x217263;};'use strict';var util=require(_0x1f9d('0x0'));var BPromise=require(_0x1f9d('0x1'));var logger=require(_0x1f9d('0x2'))('preview');var _=require(_0x1f9d('0x3'));var faxAccount=require(_0x1f9d('0x4'));function loggerCatch(_0x5e4b84){return function(_0x30084f){logger[_0x1f9d('0x5')](_0x5e4b84,util[_0x1f9d('0x6')](_0x30084f,{'showHidden':![],'depth':null}));};}exports[_0x1f9d('0x7')]=function(_0x146b38,_0x1539f3){return BPromise[_0x1f9d('0x8')]()[_0x1f9d('0x9')](faxAccount[_0x1f9d('0x7')](_0x146b38,_0x1539f3))['catch'](loggerCatch(_0x1f9d('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index c737b79..4524545 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 _0x4c22=['util','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x4046b6,_0x238c36){var _0x1443be=function(_0x2e6c5d){while(--_0x2e6c5d){_0x4046b6['push'](_0x4046b6['shift']());}};_0x1443be(++_0x238c36);}(_0x4c22,0x17a));var _0x24c2=function(_0x22068c,_0x3f1c49){_0x22068c=_0x22068c-0x0;var _0x277169=_0x4c22[_0x22068c];return _0x277169;};'use strict';var util=require(_0x24c2('0x0'));var logger=require('../../../../config/logger')(_0x24c2('0x1'));var BPromise=require(_0x24c2('0x2'));var exec=require(_0x24c2('0x3'))['exec'];exports[_0x24c2('0x4')]=function(_0x141d4b){return new BPromise(function(_0x2210a3,_0x2d3c7a){exec(_0x141d4b,function(_0x252ab9,_0x3e1220,_0x29e3cd){logger[_0x24c2('0x5')]('Exec\x20gs',_0x3e1220);if(_0x252ab9){logger[_0x24c2('0x5')](_0x24c2('0x6'),_0x24c2('0x7'),util[_0x24c2('0x8')](_0x252ab9,{'showHidden':![],'depth':null}),_0x3e1220,_0x29e3cd);_0x2d3c7a(_0x252ab9);}_0x2210a3(_0x3e1220);});});}; \ No newline at end of file +var _0x0bb8=['Exec\x20gs','inspect','util','../../../../config/logger','fax','child_process','execute','info'];(function(_0x54b4b5,_0x2f8680){var _0xa33d32=function(_0x5597d8){while(--_0x5597d8){_0x54b4b5['push'](_0x54b4b5['shift']());}};_0xa33d32(++_0x2f8680);}(_0x0bb8,0x14a));var _0x80bb=function(_0x590b26,_0x4796ec){_0x590b26=_0x590b26-0x0;var _0x1c0a7b=_0x0bb8[_0x590b26];return _0x1c0a7b;};'use strict';var util=require(_0x80bb('0x0'));var logger=require(_0x80bb('0x1'))(_0x80bb('0x2'));var BPromise=require('bluebird');var exec=require(_0x80bb('0x3'))['exec'];exports[_0x80bb('0x4')]=function(_0x48ce20){return new BPromise(function(_0x4fb962,_0x597504){exec(_0x48ce20,function(_0x23a0c4,_0x8d5152,_0x3b254c){logger[_0x80bb('0x5')](_0x80bb('0x6'),_0x8d5152);if(_0x23a0c4){logger[_0x80bb('0x5')](_0x80bb('0x6'),'\x20Error\x20:',util[_0x80bb('0x7')](_0x23a0c4,{'showHidden':![],'depth':null}),_0x8d5152,_0x3b254c);_0x597504(_0x23a0c4);}_0x4fb962(_0x8d5152);});});}; \ 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 8a51360..14e41a7 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 _0x33aa=['format','\x22%s\x22','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','minrate','maxrate'];(function(_0x1f2379,_0x19ec5f){var _0xad633c=function(_0x5fc8f0){while(--_0x5fc8f0){_0x1f2379['push'](_0x1f2379['shift']());}};_0xad633c(++_0x19ec5f);}(_0x33aa,0x18d));var _0xa33a=function(_0x1e4d03,_0x4e18){_0x1e4d03=_0x1e4d03-0x0;var _0xacb601=_0x33aa[_0x1e4d03];return _0xacb601;};'use strict';var util=require(_0xa33a('0x0'));var _=require(_0xa33a('0x1'));var moment=require('moment');var logger=require(_0xa33a('0x2'))(_0xa33a('0x3'));exports[_0xa33a('0x4')]=function(_0x51ca49){return{'message':_0x51ca49};};exports[_0xa33a('0x5')]=function(_0x3f94c2,_0x9162d9){logger[_0xa33a('0x6')](_0x3f94c2,util[_0xa33a('0x7')](_0x9162d9,{'showHidden':![],'depth':null}));};exports[_0xa33a('0x8')]=function(_0x593fe2,_0x21e8e6){var _0x34e2ff={'XMF-ECM':_0x21e8e6['ecm'],'XMF-HEADERINFO':_0x21e8e6['headerinfo'],'XMF-MINRATE':_0x21e8e6[_0xa33a('0x9')],'XMF-MAXRATE':_0x21e8e6[_0xa33a('0xa')],'XMF-MODEM':util[_0xa33a('0xb')](_0xa33a('0xc'),_0x21e8e6['modem']),'XMF-GATEWAY':_0x21e8e6['gateway'],'XMF-FAXDETECT':_0x21e8e6[_0xa33a('0xd')],'XMF-T38TIMEOUT':_0x21e8e6[_0xa33a('0xe')],'XMF-LOCALSTATIONID':_0x21e8e6[_0xa33a('0xf')],'XMF-PATH':_0x593fe2[_0xa33a('0x10')]};return _0x34e2ff;};exports[_0xa33a('0x11')]=function(_0x4714c4,_0x38101d){return{'actionid':_0x4714c4[_0xa33a('0x12')],'action':_0xa33a('0x13'),'channel':_0x4714c4[_0xa33a('0x14')],'Exten':'xcally-motion-fax','Context':_0xa33a('0x15'),'Priority':'1','callerid':util[_0xa33a('0xb')](_0xa33a('0x16'),_0x4714c4[_0xa33a('0x17')]?_0x4714c4[_0xa33a('0x17')]:'',_0x4714c4['localstationid']),'variable':_0x38101d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4714c4[_0xa33a('0x12')]};}; \ No newline at end of file +var _0x559a=['message','logger','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','localstationid','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax'];(function(_0x3ee1fe,_0x59f2a1){var _0x1ae57a=function(_0x1ef0c4){while(--_0x1ef0c4){_0x3ee1fe['push'](_0x3ee1fe['shift']());}};_0x1ae57a(++_0x59f2a1);}(_0x559a,0x1db));var _0xa559=function(_0xf22264,_0x2b9d42){_0xf22264=_0xf22264-0x0;var _0x130ea7=_0x559a[_0xf22264];return _0x130ea7;};'use strict';var util=require(_0xa559('0x0'));var _=require(_0xa559('0x1'));var moment=require(_0xa559('0x2'));var logger=require(_0xa559('0x3'))(_0xa559('0x4'));exports[_0xa559('0x5')]=function(_0x42c0b5){return{'message':_0x42c0b5};};exports[_0xa559('0x6')]=function(_0xf17518,_0x2b6881){logger['info'](_0xf17518,util[_0xa559('0x7')](_0x2b6881,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4077de,_0x1b1c82){var _0x480051={'XMF-ECM':_0x1b1c82[_0xa559('0x8')],'XMF-HEADERINFO':_0x1b1c82[_0xa559('0x9')],'XMF-MINRATE':_0x1b1c82[_0xa559('0xa')],'XMF-MAXRATE':_0x1b1c82[_0xa559('0xb')],'XMF-MODEM':util[_0xa559('0xc')](_0xa559('0xd'),_0x1b1c82[_0xa559('0xe')]),'XMF-GATEWAY':_0x1b1c82['gateway'],'XMF-FAXDETECT':_0x1b1c82[_0xa559('0xf')],'XMF-T38TIMEOUT':_0x1b1c82['t38timeout'],'XMF-LOCALSTATIONID':_0x1b1c82[_0xa559('0x10')],'XMF-PATH':_0x4077de['path']};return _0x480051;};exports[_0xa559('0x11')]=function(_0x3187bd,_0x2e7dde){return{'actionid':_0x3187bd['uniqueid'],'action':_0xa559('0x12'),'channel':_0x3187bd[_0xa559('0x13')],'Exten':_0xa559('0x14'),'Context':_0xa559('0x15'),'Priority':'1','callerid':util[_0xa559('0xc')](_0xa559('0x16'),_0x3187bd['headerinfo']?_0x3187bd[_0xa559('0x9')]:'',_0x3187bd[_0xa559('0x10')]),'variable':_0x2e7dde,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3187bd[_0xa559('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index aa423a8..b001313 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 _0xc63a=['./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','log','bluebird','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0xc63a,0x1ee));var _0xac63=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0xc63a[_0x318840];return _0x223da4;};'use strict';var BPromise=require(_0xac63('0x0'));var util=require(_0xac63('0x1'));var moment=require(_0xac63('0x2'));var server=require(_0xac63('0x3'));var Realtime=require(_0xac63('0x4'));var Report=require('./report');var Acw=require(_0xac63('0x5'));var Trigger=require(_0xac63('0x6'));var Dialer=require(_0xac63('0x7'));var Preview=require(_0xac63('0x8'));var Fax=require(_0xac63('0x9'));var user=require(_0xac63('0xa'));var voiceQueue=require(_0xac63('0xb'));var voiceQueueReport=require(_0xac63('0xc'));var voiceCallReport=require(_0xac63('0xd'));var trunk=require(_0xac63('0xe'));var trigger=require(_0xac63('0xf'));var template=require(_0xac63('0x10'));var cmHopperHistory=require(_0xac63('0x11'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xac63('0x12'));var faxAccount=require(_0xac63('0x13'));var zendesk=require(_0xac63('0x14'));var salesforce=require(_0xac63('0x15'));var sugarcrm=require(_0xac63('0x16'));var freshdesk=require(_0xac63('0x17'));var desk=require(_0xac63('0x18'));var zoho=require(_0xac63('0x19'));var vtiger=require(_0xac63('0x1a'));var freshsales=require(_0xac63('0x1b'));var servicenow=require(_0xac63('0x1c'));var dynamics365=require(_0xac63('0x1d'));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()[_0xac63('0x1e')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xac63('0x1e')](_0xac63('0x1f'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xac63('0x20')](user[_0xac63('0x21')]())['then'](realtime[_0xac63('0x22')]())[_0xac63('0x20')](user[_0xac63('0x23')]())[_0xac63('0x20')](realtime[_0xac63('0x24')]())[_0xac63('0x20')](trunk[_0xac63('0x25')]())[_0xac63('0x20')](realtime['initTrunks']())[_0xac63('0x20')](voiceQueue[_0xac63('0x26')]())[_0xac63('0x20')](realtime[_0xac63('0x27')]())[_0xac63('0x20')](trigger[_0xac63('0x28')]())[_0xac63('0x20')](realtime['initTriggers']())[_0xac63('0x20')](template['getTemplates']())[_0xac63('0x20')](realtime['initTemplates']())[_0xac63('0x20')](zendesk[_0xac63('0x29')]())[_0xac63('0x20')](realtime[_0xac63('0x2a')]())[_0xac63('0x20')](salesforce[_0xac63('0x2b')]())[_0xac63('0x20')](realtime['initSalesforceAccounts']())[_0xac63('0x20')](sugarcrm[_0xac63('0x2c')]())['then'](realtime['initSugarcrmAccounts']())[_0xac63('0x20')](freshdesk['getFreshdeskAccounts']())[_0xac63('0x20')](realtime['initFreshdeskAccounts']())['then'](desk[_0xac63('0x2d')]())[_0xac63('0x20')](realtime[_0xac63('0x2e')]())[_0xac63('0x20')](zoho[_0xac63('0x2f')]())[_0xac63('0x20')](realtime[_0xac63('0x30')]())[_0xac63('0x20')](vtiger['getVtigerAccounts']())[_0xac63('0x20')](realtime[_0xac63('0x31')]())[_0xac63('0x20')](freshsales[_0xac63('0x32')]())[_0xac63('0x20')](realtime[_0xac63('0x33')]())[_0xac63('0x20')](servicenow[_0xac63('0x34')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xac63('0x35')]())['then'](realtime[_0xac63('0x36')]())[_0xac63('0x20')](campaign['getCampaigns']())[_0xac63('0x20')](realtime[_0xac63('0x37')]())[_0xac63('0x20')](voiceExtension[_0xac63('0x38')]())['then'](realtime[_0xac63('0x39')]())[_0xac63('0x20')](faxAccount[_0xac63('0x3a')]())[_0xac63('0x20')](realtime[_0xac63('0x3b')]())[_0xac63('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0xac63('0x3c')]()['then'](voiceQueueReport[_0xac63('0x3d')]())[_0xac63('0x20')](realtime['initVoiceQueueReports']())[_0xac63('0x20')](cmHopperHistory[_0xac63('0x3e')]())[_0xac63('0x20')](realtime[_0xac63('0x3f')]())[_0xac63('0x20')](cmHopperHistory[_0xac63('0x40')]())[_0xac63('0x20')](realtime[_0xac63('0x41')]())[_0xac63('0x20')](voiceCallReport[_0xac63('0x42')]())['then'](realtime[_0xac63('0x43')]())[_0xac63('0x20')](function(_0xe2c04d){})[_0xac63('0x44')](function(_0x18c5ff){console['log'](_0x18c5ff);});}function main(){return server[_0xac63('0x45')](realtime,preview,fax)[_0xac63('0x20')](function(_0x384fe7){return initRealtime();})['then'](function(){return initParams();})[_0xac63('0x20')](function(){report[_0xac63('0x46')]();setInterval(initRealtime,0x1388);})[_0xac63('0x44')](function(_0x4e3ab2){console[_0xac63('0x47')](_0x4e3ab2);});}main(); \ No newline at end of file +var _0x7e99=['getTrunks','initTrunks','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','then','initAgents','getTelephones'];(function(_0x315ccb,_0x42db06){var _0x5f024c=function(_0x234fd2){while(--_0x234fd2){_0x315ccb['push'](_0x315ccb['shift']());}};_0x5f024c(++_0x42db06);}(_0x7e99,0xad));var _0x97e9=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0x7e99[_0x71cd05];return _0x59c9e7;};'use strict';var BPromise=require(_0x97e9('0x0'));var util=require(_0x97e9('0x1'));var moment=require(_0x97e9('0x2'));var server=require(_0x97e9('0x3'));var Realtime=require(_0x97e9('0x4'));var Report=require(_0x97e9('0x5'));var Acw=require(_0x97e9('0x6'));var Trigger=require(_0x97e9('0x7'));var Dialer=require(_0x97e9('0x8'));var Preview=require('./preview');var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x97e9('0x9'));var voiceCallReport=require(_0x97e9('0xa'));var trunk=require(_0x97e9('0xb'));var trigger=require(_0x97e9('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0x97e9('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x97e9('0xe'));var faxAccount=require(_0x97e9('0xf'));var zendesk=require(_0x97e9('0x10'));var salesforce=require(_0x97e9('0x11'));var sugarcrm=require(_0x97e9('0x12'));var freshdesk=require(_0x97e9('0x13'));var desk=require(_0x97e9('0x14'));var zoho=require(_0x97e9('0x15'));var vtiger=require(_0x97e9('0x16'));var freshsales=require(_0x97e9('0x17'));var servicenow=require(_0x97e9('0x18'));var dynamics365=require(_0x97e9('0x19'));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()[_0x97e9('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x97e9('0x1b')]()[_0x97e9('0x1c')](user['getAgents']())[_0x97e9('0x1c')](realtime[_0x97e9('0x1d')]())['then'](user[_0x97e9('0x1e')]())['then'](realtime['initTelephones']())['then'](trunk[_0x97e9('0x1f')]())['then'](realtime[_0x97e9('0x20')]())[_0x97e9('0x1c')](voiceQueue['getVoiceQueues']())[_0x97e9('0x1c')](realtime['initVoiceQueues']())[_0x97e9('0x1c')](trigger[_0x97e9('0x21')]())[_0x97e9('0x1c')](realtime[_0x97e9('0x22')]())['then'](template['getTemplates']())[_0x97e9('0x1c')](realtime[_0x97e9('0x23')]())['then'](zendesk[_0x97e9('0x24')]())[_0x97e9('0x1c')](realtime[_0x97e9('0x25')]())['then'](salesforce[_0x97e9('0x26')]())[_0x97e9('0x1c')](realtime[_0x97e9('0x27')]())[_0x97e9('0x1c')](sugarcrm[_0x97e9('0x28')]())[_0x97e9('0x1c')](realtime[_0x97e9('0x29')]())['then'](freshdesk[_0x97e9('0x2a')]())[_0x97e9('0x1c')](realtime[_0x97e9('0x2b')]())[_0x97e9('0x1c')](desk[_0x97e9('0x2c')]())['then'](realtime[_0x97e9('0x2d')]())[_0x97e9('0x1c')](zoho[_0x97e9('0x2e')]())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0x97e9('0x2f')]())['then'](realtime['initVtigerAccounts']())[_0x97e9('0x1c')](freshsales['getFreshsalesAccounts']())[_0x97e9('0x1c')](realtime[_0x97e9('0x30')]())[_0x97e9('0x1c')](servicenow['getServicenowAccounts']())[_0x97e9('0x1c')](realtime[_0x97e9('0x31')]())[_0x97e9('0x1c')](dynamics365['getDynamics365Accounts']())[_0x97e9('0x1c')](realtime[_0x97e9('0x32')]())[_0x97e9('0x1c')](campaign[_0x97e9('0x33')]())['then'](realtime[_0x97e9('0x34')]())[_0x97e9('0x1c')](voiceExtension['getVoiceExtensions']())[_0x97e9('0x1c')](realtime[_0x97e9('0x35')]())[_0x97e9('0x1c')](faxAccount[_0x97e9('0x36')]())[_0x97e9('0x1c')](realtime[_0x97e9('0x37')]())[_0x97e9('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x97e9('0x1b')]()[_0x97e9('0x1c')](voiceQueueReport[_0x97e9('0x38')]())['then'](realtime[_0x97e9('0x39')]())[_0x97e9('0x1c')](cmHopperHistory[_0x97e9('0x3a')]())[_0x97e9('0x1c')](realtime[_0x97e9('0x3b')]())['then'](cmHopperHistory[_0x97e9('0x3c')]())['then'](realtime[_0x97e9('0x3d')]())['then'](voiceCallReport[_0x97e9('0x3e')]())['then'](realtime[_0x97e9('0x3f')]())[_0x97e9('0x1c')](function(_0x27fecb){})[_0x97e9('0x40')](function(_0x5c76f0){console[_0x97e9('0x41')](_0x5c76f0);});}function main(){return server[_0x97e9('0x42')](realtime,preview,fax)[_0x97e9('0x1c')](function(_0x422aa8){return initRealtime();})[_0x97e9('0x1c')](function(){return initParams();})[_0x97e9('0x1c')](function(){report[_0x97e9('0x43')]();setInterval(initRealtime,0x1388);})[_0x97e9('0x40')](function(_0x5f1f63){console[_0x97e9('0x41')](_0x5f1f63);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 19cf40a..99561d2 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 _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x3cfd3d,_0x5c9e2f){var _0x11a438=function(_0x19718b){while(--_0x19718b){_0x3cfd3d['push'](_0x3cfd3d['shift']());}};_0x11a438(++_0x5c9e2f);}(_0x34e8,0x12c));var _0x834e=function(_0x64553f,_0x11ebdb){_0x64553f=_0x64553f-0x0;var _0x1cdd46=_0x34e8[_0x64553f];return _0x1cdd46;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x1af08f,_0x210e17){var _0x181293=function(_0x1362ea){while(--_0x1362ea){_0x1af08f['push'](_0x1af08f['shift']());}};_0x181293(++_0x210e17);}(_0xe706,0xa3));var _0x6e70=function(_0x34c553,_0x3e7dfc){_0x34c553=_0x34c553-0x0;var _0x1357d2=_0xe706[_0x34c553];return _0x1357d2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index d7ff5bb..a877b01 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 _0xac26=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','active'];(function(_0x31447a,_0x2204ea){var _0x23928e=function(_0x3a1b71){while(--_0x3a1b71){_0x31447a['push'](_0x31447a['shift']());}};_0x23928e(++_0x2204ea);}(_0xac26,0xc0));var _0x6ac2=function(_0x40c608,_0x9b7ad5){_0x40c608=_0x40c608-0x0;var _0x317471=_0xac26[_0x40c608];return _0x317471;};'use strict';function Campaign(_0x4f3149){this['id']=_0x4f3149['id']||0x0;this[_0x6ac2('0x0')]=_0x4f3149['name']||'';this[_0x6ac2('0x1')]=_0x4f3149[_0x6ac2('0x1')]||_0x6ac2('0x2');this[_0x6ac2('0x3')]=0x0;this[_0x6ac2('0x4')]=0x0;this[_0x6ac2('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x6ac2('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x6ac2('0x7')]=_0x4f3149['active'];this[_0x6ac2('0x8')]=_0x4f3149[_0x6ac2('0x8')];this['dialTimezone']=_0x4f3149[_0x6ac2('0x9')]||null;this[_0x6ac2('0xa')]=_0x4f3149['dialGlobalInterval']?_0x4f3149['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x4f3149[_0x6ac2('0xb')];this[_0x6ac2('0xc')]=_0x4f3149['dialOriginateCallerIdNumber'];this[_0x6ac2('0xd')]=_0x4f3149[_0x6ac2('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x4f3149[_0x6ac2('0xe')];this[_0x6ac2('0xf')]=_0x4f3149[_0x6ac2('0xf')];this[_0x6ac2('0x10')]=_0x4f3149[_0x6ac2('0x10')];this[_0x6ac2('0x11')]=_0x4f3149[_0x6ac2('0x11')];this[_0x6ac2('0x12')]=_0x4f3149[_0x6ac2('0x12')];this['dialNoAnswerRetryFrequency']=_0x4f3149[_0x6ac2('0x13')];this[_0x6ac2('0x14')]=_0x4f3149['dialGlobalMaxRetry'];this[_0x6ac2('0x15')]=_0x4f3149[_0x6ac2('0x15')]||0x3;this[_0x6ac2('0x16')]=_0x4f3149['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x4f3149[_0x6ac2('0x17')]||0x3;this[_0x6ac2('0x18')]=_0x4f3149[_0x6ac2('0x18')]||0x96;this[_0x6ac2('0x19')]=_0x4f3149[_0x6ac2('0x19')]||0x3;this[_0x6ac2('0x1a')]=_0x4f3149[_0x6ac2('0x1a')]||0x96;this[_0x6ac2('0x1b')]=_0x4f3149['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x4f3149[_0x6ac2('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x4f3149[_0x6ac2('0x1d')]||0x3;this[_0x6ac2('0x1e')]=_0x4f3149[_0x6ac2('0x1e')]||0x96;this[_0x6ac2('0x1f')]=_0x4f3149[_0x6ac2('0x1f')]||_0x6ac2('0x20');this[_0x6ac2('0x21')]=_0x4f3149[_0x6ac2('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x4f3149['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x6ac2('0x22')]=_0x4f3149[_0x6ac2('0x22')]||undefined;this[_0x6ac2('0x23')]=_0x4f3149['TrunkBackup']?_0x4f3149[_0x6ac2('0x23')]:undefined;this[_0x6ac2('0x24')]=_0x4f3149['Trunk']?_0x4f3149[_0x6ac2('0x24')]:undefined;this[_0x6ac2('0x25')]=_0x4f3149[_0x6ac2('0x25')]?_0x4f3149[_0x6ac2('0x25')]:undefined;this[_0x6ac2('0x26')]=_0x4f3149['SquareProject']?_0x4f3149[_0x6ac2('0x26')]:undefined;this[_0x6ac2('0x27')]=_0x4f3149[_0x6ac2('0x26')]?_0x4f3149[_0x6ac2('0x26')]['name']:undefined;this['dialAMDActive']=_0x4f3149[_0x6ac2('0x28')]||![];this[_0x6ac2('0x29')]=_0x4f3149[_0x6ac2('0x29')];this[_0x6ac2('0x2a')]=_0x4f3149[_0x6ac2('0x2a')];this[_0x6ac2('0x2b')]=_0x4f3149[_0x6ac2('0x2b')];this[_0x6ac2('0x2c')]=_0x4f3149[_0x6ac2('0x2c')];this[_0x6ac2('0x2d')]=_0x4f3149[_0x6ac2('0x2d')];this[_0x6ac2('0x2e')]=_0x4f3149[_0x6ac2('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x4f3149[_0x6ac2('0x2f')];this[_0x6ac2('0x30')]=_0x4f3149['dialAMDSilenceThreshold'];this[_0x6ac2('0x31')]=_0x4f3149[_0x6ac2('0x31')];}module['exports']=Campaign; \ No newline at end of file +var _0xa627=['name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports'];(function(_0x245b63,_0x377897){var _0x208755=function(_0x81e999){while(--_0x81e999){_0x245b63['push'](_0x245b63['shift']());}};_0x208755(++_0x377897);}(_0xa627,0x132));var _0x7a62=function(_0x1b2552,_0x461135){_0x1b2552=_0x1b2552-0x0;var _0x154afa=_0xa627[_0x1b2552];return _0x154afa;};'use strict';function Campaign(_0xa12963){this['id']=_0xa12963['id']||0x0;this[_0x7a62('0x0')]=_0xa12963[_0x7a62('0x0')]||'';this[_0x7a62('0x1')]=_0xa12963['type']||_0x7a62('0x2');this[_0x7a62('0x3')]=0x0;this[_0x7a62('0x4')]=0x0;this[_0x7a62('0x5')]=0x0;this[_0x7a62('0x6')]=0x0;this['message']='';this[_0x7a62('0x7')]=!![];this[_0x7a62('0x8')]=_0xa12963['active'];this['limitCalls']=_0xa12963['limitCalls'];this[_0x7a62('0x9')]=_0xa12963[_0x7a62('0x9')]||null;this[_0x7a62('0xa')]=_0xa12963[_0x7a62('0xa')]?_0xa12963[_0x7a62('0xa')]:null;this[_0x7a62('0xb')]=_0xa12963[_0x7a62('0xb')];this[_0x7a62('0xc')]=_0xa12963[_0x7a62('0xc')];this[_0x7a62('0xd')]=_0xa12963['dialOriginateTimeout']||0x1e;this[_0x7a62('0xe')]=_0xa12963['dialCongestionMaxRetry'];this[_0x7a62('0xf')]=_0xa12963[_0x7a62('0xf')];this['dialBusyMaxRetry']=_0xa12963[_0x7a62('0x10')];this[_0x7a62('0x11')]=_0xa12963[_0x7a62('0x11')];this['dialNoAnswerMaxRetry']=_0xa12963[_0x7a62('0x12')];this[_0x7a62('0x13')]=_0xa12963['dialNoAnswerRetryFrequency'];this[_0x7a62('0x14')]=_0xa12963[_0x7a62('0x14')];this[_0x7a62('0x15')]=_0xa12963['dialNoSuchNumberMaxRetry']||0x3;this[_0x7a62('0x16')]=_0xa12963[_0x7a62('0x16')]||0x96;this[_0x7a62('0x17')]=_0xa12963[_0x7a62('0x17')]||0x3;this[_0x7a62('0x18')]=_0xa12963[_0x7a62('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0xa12963['dialAbandonedMaxRetry']||0x3;this[_0x7a62('0x19')]=_0xa12963[_0x7a62('0x19')]||0x96;this[_0x7a62('0x1a')]=_0xa12963[_0x7a62('0x1a')]||0x3;this[_0x7a62('0x1b')]=_0xa12963['dialMachineRetryFrequency']||0x96;this[_0x7a62('0x1c')]=_0xa12963[_0x7a62('0x1c')]||0x3;this[_0x7a62('0x1d')]=_0xa12963[_0x7a62('0x1d')]||0x96;this[_0x7a62('0x1e')]=_0xa12963[_0x7a62('0x1e')]||_0x7a62('0x1f');this[_0x7a62('0x20')]=_0xa12963[_0x7a62('0x20')]||undefined;this[_0x7a62('0x21')]=_0xa12963[_0x7a62('0x21')]||undefined;this[_0x7a62('0x22')]=_0xa12963['dialCutDigit']||undefined;this[_0x7a62('0x23')]=_0xa12963[_0x7a62('0x23')]?_0xa12963['TrunkBackup']:undefined;this[_0x7a62('0x24')]=_0xa12963[_0x7a62('0x24')]?_0xa12963[_0x7a62('0x24')]:undefined;this[_0x7a62('0x25')]=_0xa12963[_0x7a62('0x25')]?_0xa12963['Interval']:undefined;this[_0x7a62('0x26')]=_0xa12963['SquareProject']?_0xa12963['SquareProject']:undefined;this[_0x7a62('0x27')]=_0xa12963[_0x7a62('0x26')]?_0xa12963[_0x7a62('0x26')][_0x7a62('0x0')]:undefined;this[_0x7a62('0x28')]=_0xa12963[_0x7a62('0x28')]||![];this['dialAMDInitialSilence']=_0xa12963[_0x7a62('0x29')];this[_0x7a62('0x2a')]=_0xa12963[_0x7a62('0x2a')];this['dialAMDAfterGreetingSilence']=_0xa12963[_0x7a62('0x2b')];this['dialAMDTotalAnalysisTime']=_0xa12963[_0x7a62('0x2c')];this[_0x7a62('0x2d')]=_0xa12963['dialAMDMinWordLength'];this[_0x7a62('0x2e')]=_0xa12963[_0x7a62('0x2e')];this[_0x7a62('0x2f')]=_0xa12963[_0x7a62('0x2f')];this[_0x7a62('0x30')]=_0xa12963[_0x7a62('0x30')];this[_0x7a62('0x31')]=_0xa12963[_0x7a62('0x31')];}module[_0x7a62('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 f496bcc..b7f24b5 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 _0xa486=['transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa486,0x17d));var _0x6a48=function(_0x3b240c,_0x214414){_0x3b240c=_0x3b240c-0x0;var _0x3ce8e3=_0xa486[_0x3b240c];return _0x3ce8e3;};'use strict';function Channel(){this[_0x6a48('0x0')]=null;this['channel']='';this[_0x6a48('0x1')]='';this['calleridnum']=0x0;this[_0x6a48('0x2')]='';this['connectedlinenum']=undefined;this[_0x6a48('0x3')]=undefined;this[_0x6a48('0x4')]=0x0;this[_0x6a48('0x5')]='';this[_0x6a48('0x6')]=0x0;this[_0x6a48('0x7')]=0x0;this[_0x6a48('0x8')]=0x0;this[_0x6a48('0x9')]=![];this[_0x6a48('0xa')]=null;this[_0x6a48('0xb')]=null;this[_0x6a48('0xc')]=![];this[_0x6a48('0xd')]=![];this[_0x6a48('0xe')]='';this[_0x6a48('0xf')]='';this[_0x6a48('0x10')]=0x0;this[_0x6a48('0x11')]=0x0;this[_0x6a48('0x12')]=0x0;this['type']=null;this[_0x6a48('0x13')]=null;this['disposition']=null;this[_0x6a48('0x14')]=![];this[_0x6a48('0x15')]=null;this[_0x6a48('0x16')]=null;this[_0x6a48('0x17')]=[];this[_0x6a48('0x18')]=undefined;this[_0x6a48('0x19')]=undefined;this[_0x6a48('0x1a')]=undefined;this[_0x6a48('0x1b')]=0x0;}module[_0x6a48('0x1c')]=Channel; \ No newline at end of file +var _0xa057=['transfercalleridnum','mohtime','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','accountcode','context','linkedid','answertime','endtime','unmanaged','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','monitors'];(function(_0x109409,_0x531e67){var _0x841581=function(_0x17f5e0){while(--_0x17f5e0){_0x109409['push'](_0x109409['shift']());}};_0x841581(++_0x531e67);}(_0xa057,0x123));var _0x7a05=function(_0x3b7789,_0x428bc8){_0x3b7789=_0x3b7789-0x0;var _0x4d430e=_0xa057[_0x3b7789];return _0x4d430e;};'use strict';function Channel(){this[_0x7a05('0x0')]=null;this[_0x7a05('0x1')]='';this['destinationchannel']='';this[_0x7a05('0x2')]=0x0;this[_0x7a05('0x3')]='';this[_0x7a05('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x7a05('0x5')]=0x0;this[_0x7a05('0x6')]='';this['uniqueid']=0x0;this[_0x7a05('0x7')]=0x0;this['exten']=0x0;this['answered']=![];this[_0x7a05('0x8')]=null;this[_0x7a05('0x9')]=null;this[_0x7a05('0xa')]=![];this['abandoned']=![];this[_0x7a05('0xb')]='';this[_0x7a05('0xc')]='';this[_0x7a05('0xd')]=0x0;this['billableseconds']=0x0;this[_0x7a05('0xe')]=0x0;this[_0x7a05('0xf')]=null;this[_0x7a05('0x10')]=null;this[_0x7a05('0x11')]=null;this[_0x7a05('0x12')]=![];this[_0x7a05('0x13')]=null;this['queue']=null;this[_0x7a05('0x14')]=[];this[_0x7a05('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x7a05('0x16')]=0x0;}module[_0x7a05('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 906c909..cebc2bf 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 _0xbd23=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0xbd23,0x134));var _0x3bd2=function(_0x41cb9f,_0x34f6e0){_0x41cb9f=_0x41cb9f-0x0;var _0x426494=_0xbd23[_0x41cb9f];return _0x426494;};'use strict';function DeskAccount(_0x14d149){this['id']=_0x14d149['id']||0x0;this[_0x3bd2('0x0')]=_0x14d149[_0x3bd2('0x0')]||'';this[_0x3bd2('0x1')]=_0x14d149['username']||'';this[_0x3bd2('0x2')]=_0x14d149[_0x3bd2('0x2')]||'';this['authType']=_0x14d149['authType']||'';this['password']=_0x14d149[_0x3bd2('0x3')]||'';this[_0x3bd2('0x4')]=_0x14d149['consumerKey']||'';this[_0x3bd2('0x5')]=_0x14d149[_0x3bd2('0x5')]||'';this[_0x3bd2('0x6')]=_0x14d149[_0x3bd2('0x6')]||'';this[_0x3bd2('0x7')]=_0x14d149[_0x3bd2('0x7')]||'';this[_0x3bd2('0x8')]=_0x14d149[_0x3bd2('0x8')]||'';this[_0x3bd2('0x9')]=_0x14d149[_0x3bd2('0x9')]||'';this[_0x3bd2('0xa')]=_0x14d149[_0x3bd2('0xa')]||{};}module[_0x3bd2('0xb')]=DeskAccount; \ No newline at end of file +var _0xbc67=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xbc67,0x1c0));var _0x7bc6=function(_0x554c14,_0x5c276f){_0x554c14=_0x554c14-0x0;var _0x5e9375=_0xbc67[_0x554c14];return _0x5e9375;};'use strict';function DeskAccount(_0x5569d6){this['id']=_0x5569d6['id']||0x0;this[_0x7bc6('0x0')]=_0x5569d6[_0x7bc6('0x0')]||'';this['username']=_0x5569d6[_0x7bc6('0x1')]||'';this['remoteUri']=_0x5569d6[_0x7bc6('0x2')]||'';this[_0x7bc6('0x3')]=_0x5569d6[_0x7bc6('0x3')]||'';this[_0x7bc6('0x4')]=_0x5569d6[_0x7bc6('0x4')]||'';this[_0x7bc6('0x5')]=_0x5569d6[_0x7bc6('0x5')]||'';this['consumerSecret']=_0x5569d6[_0x7bc6('0x6')]||'';this['token']=_0x5569d6[_0x7bc6('0x7')]||'';this[_0x7bc6('0x8')]=_0x5569d6[_0x7bc6('0x8')]||'';this[_0x7bc6('0x9')]=_0x5569d6[_0x7bc6('0x9')]||'';this[_0x7bc6('0xa')]=_0x5569d6[_0x7bc6('0xa')]||'';this[_0x7bc6('0xb')]=_0x5569d6[_0x7bc6('0xb')]||{};}module[_0x7bc6('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 544b321..eb21cc8 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 _0x2547=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x2547,0x1cd));var _0x7254=function(_0x1c8d04,_0x21119c){_0x1c8d04=_0x1c8d04-0x0;var _0x2216e4=_0x2547[_0x1c8d04];return _0x2216e4;};'use strict';function Dynamics365Account(_0x4cc9c6){this['id']=_0x4cc9c6['id']||0x0;this[_0x7254('0x0')]=_0x4cc9c6[_0x7254('0x0')]||'';this[_0x7254('0x1')]=_0x4cc9c6[_0x7254('0x1')]||'';this[_0x7254('0x2')]=_0x4cc9c6[_0x7254('0x2')]||'';this[_0x7254('0x3')]=_0x4cc9c6[_0x7254('0x3')]||'';this['tenantId']=_0x4cc9c6[_0x7254('0x4')]||'';this[_0x7254('0x5')]=_0x4cc9c6[_0x7254('0x5')]||'';this[_0x7254('0x6')]=_0x4cc9c6['clientSecret']||{};this[_0x7254('0x7')]=_0x4cc9c6[_0x7254('0x7')]||'';this[_0x7254('0x8')]=_0x4cc9c6['Configurations']||{};}module[_0x7254('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x13f6=['clientId','clientSecret','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x27a5d5,_0x1ceb1e){var _0x1a9c99=function(_0x1356a6){while(--_0x1356a6){_0x27a5d5['push'](_0x27a5d5['shift']());}};_0x1a9c99(++_0x1ceb1e);}(_0x13f6,0x124));var _0x613f=function(_0x28add8,_0x18d6bd){_0x28add8=_0x28add8-0x0;var _0x2b1f4f=_0x13f6[_0x28add8];return _0x2b1f4f;};'use strict';function Dynamics365Account(_0xf31e04){this['id']=_0xf31e04['id']||0x0;this[_0x613f('0x0')]=_0xf31e04['name']||'';this['username']=_0xf31e04[_0x613f('0x1')]||'';this[_0x613f('0x2')]=_0xf31e04[_0x613f('0x2')]||'';this['remoteUri']=_0xf31e04[_0x613f('0x3')]||'';this[_0x613f('0x4')]=_0xf31e04[_0x613f('0x4')]||'';this['clientId']=_0xf31e04[_0x613f('0x5')]||'';this[_0x613f('0x6')]=_0xf31e04['clientSecret']||{};this['serverUrl']=_0xf31e04['serverUrl']||'';this['Configurations']=_0xf31e04[_0x613f('0x7')]||{};}module[_0x613f('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 889006d..aaf0da6 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 _0xb66c=['localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x279304,_0x5e717d){var _0x55f7a7=function(_0x3f1d4a){while(--_0x3f1d4a){_0x279304['push'](_0x279304['shift']());}};_0x55f7a7(++_0x5e717d);}(_0xb66c,0x12a));var _0xcb66=function(_0xb246b8,_0x47e683){_0xb246b8=_0xb246b8-0x0;var _0x456a7b=_0xb66c[_0xb246b8];return _0x456a7b;};'use strict';function FaxAccount(_0x244066){this['id']=_0x244066['id']||0x0;this[_0xcb66('0x0')]=_0x244066[_0xcb66('0x0')]||'';this['description']=_0x244066[_0xcb66('0x1')];this['ecm']=_0x244066['ecm'];this['headerinfo']=_0x244066['headerinfo'];this[_0xcb66('0x2')]=_0x244066[_0xcb66('0x2')];this[_0xcb66('0x3')]=_0x244066['minrate']||0x960;this[_0xcb66('0x4')]=_0x244066[_0xcb66('0x4')]||0x3840;this['modem']=_0x244066['modem']||_0xcb66('0x5');this[_0xcb66('0x6')]=_0x244066[_0xcb66('0x6')]||'no';this[_0xcb66('0x7')]=_0x244066[_0xcb66('0x7')]||'no';this[_0xcb66('0x8')]=_0x244066[_0xcb66('0x8')]||0x1388;this[_0xcb66('0x9')]=_0x244066[_0xcb66('0x9')]||_0xcb66('0xa');this['Trunk']=_0x244066[_0xcb66('0xb')]?_0x244066['Trunk']:undefined;this[_0xcb66('0xc')]=_0x244066[_0xcb66('0xc')];this[_0xcb66('0xd')]=_0x244066[_0xcb66('0xd')];}module[_0xcb66('0xe')]=FaxAccount; \ No newline at end of file +var _0x04b6=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x392e5a,_0x3c0b88){var _0x10f3b2=function(_0x4666ef){while(--_0x4666ef){_0x392e5a['push'](_0x392e5a['shift']());}};_0x10f3b2(++_0x3c0b88);}(_0x04b6,0x17d));var _0x604b=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x04b6[_0x46800d];return _0x3824cd;};'use strict';function FaxAccount(_0x20363d){this['id']=_0x20363d['id']||0x0;this['name']=_0x20363d[_0x604b('0x0')]||'';this['description']=_0x20363d[_0x604b('0x1')];this[_0x604b('0x2')]=_0x20363d[_0x604b('0x2')];this[_0x604b('0x3')]=_0x20363d[_0x604b('0x3')];this[_0x604b('0x4')]=_0x20363d[_0x604b('0x4')];this[_0x604b('0x5')]=_0x20363d[_0x604b('0x5')]||0x960;this['maxrate']=_0x20363d[_0x604b('0x6')]||0x3840;this['modem']=_0x20363d[_0x604b('0x7')]||_0x604b('0x8');this[_0x604b('0x9')]=_0x20363d[_0x604b('0x9')]||'no';this[_0x604b('0xa')]=_0x20363d[_0x604b('0xa')]||'no';this['t38timeout']=_0x20363d[_0x604b('0xb')]||0x1388;this[_0x604b('0xc')]=_0x20363d[_0x604b('0xc')]||_0x604b('0xd');this[_0x604b('0xe')]=_0x20363d[_0x604b('0xe')]?_0x20363d[_0x604b('0xe')]:undefined;this['ListId']=_0x20363d[_0x604b('0xf')];this[_0x604b('0x10')]=_0x20363d[_0x604b('0x10')];}module[_0x604b('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d80599a..863d2a6 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 _0x599c=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x5fdf6c,_0x118b9a){var _0x5c07be=function(_0x316454){while(--_0x316454){_0x5fdf6c['push'](_0x5fdf6c['shift']());}};_0x5c07be(++_0x118b9a);}(_0x599c,0x1e9));var _0xc599=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x599c[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x3b8c18){this['id']=_0x3b8c18['id']||0x0;this[_0xc599('0x0')]=_0x3b8c18[_0xc599('0x0')]||'';this[_0xc599('0x1')]=_0x3b8c18[_0xc599('0x1')]||'';this[_0xc599('0x2')]=_0x3b8c18[_0xc599('0x3')]||'';this[_0xc599('0x4')]=_0x3b8c18[_0xc599('0x4')]||'';this[_0xc599('0x5')]=_0x3b8c18[_0xc599('0x5')]||'';this['Configurations']=_0x3b8c18[_0xc599('0x6')]||{};}module[_0xc599('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xa688=['token','serverUrl','Configurations','exports','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa688,0x18a));var _0x8a68=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0xa688[_0x30182f];return _0x5207db;};'use strict';function FreshdeskAccount(_0x5b0677){this['id']=_0x5b0677['id']||0x0;this[_0x8a68('0x0')]=_0x5b0677['name']||'';this['username']=_0x5b0677['username']||'';this['apiKey']=_0x5b0677[_0x8a68('0x1')]||'';this['remoteUri']=_0x5b0677['remoteUri']||'';this[_0x8a68('0x2')]=_0x5b0677['serverUrl']||'';this[_0x8a68('0x3')]=_0x5b0677['Configurations']||{};}module[_0x8a68('0x4')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index e1ec1d7..efcbf8d 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 _0xa23f=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0xde8299,_0x274581){var _0x5cbb28=function(_0x342845){while(--_0x342845){_0xde8299['push'](_0xde8299['shift']());}};_0x5cbb28(++_0x274581);}(_0xa23f,0x7c));var _0xfa23=function(_0x5aa1eb,_0x57d866){_0x5aa1eb=_0x5aa1eb-0x0;var _0x489b0d=_0xa23f[_0x5aa1eb];return _0x489b0d;};'use strict';function FreshsalesAccount(_0x3212d1){this['id']=_0x3212d1['id']||0x0;this[_0xfa23('0x0')]=_0x3212d1['name']||'';this['username']=_0x3212d1[_0xfa23('0x1')]||'';this[_0xfa23('0x2')]=_0x3212d1[_0xfa23('0x3')]||'';this[_0xfa23('0x4')]=_0x3212d1['remoteUri']||'';this[_0xfa23('0x5')]=_0x3212d1['serverUrl']||'';this[_0xfa23('0x6')]=_0x3212d1[_0xfa23('0x6')]||{};}module[_0xfa23('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xa63f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa63f,0x1b6));var _0xfa63=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xa63f[_0xbb14db];return _0x36bed7;};'use strict';function FreshsalesAccount(_0xa59e5){this['id']=_0xa59e5['id']||0x0;this[_0xfa63('0x0')]=_0xa59e5[_0xfa63('0x0')]||'';this[_0xfa63('0x1')]=_0xa59e5[_0xfa63('0x1')]||'';this[_0xfa63('0x2')]=_0xa59e5[_0xfa63('0x3')]||'';this[_0xfa63('0x4')]=_0xa59e5[_0xfa63('0x4')]||'';this[_0xfa63('0x5')]=_0xa59e5['serverUrl']||'';this['Configurations']=_0xa59e5[_0xfa63('0x6')]||{};}module[_0xfa63('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 029909c..c25bb55 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 _0x62be=['queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt'];(function(_0x4eff33,_0x48430f){var _0x4cdbd1=function(_0x22ee37){while(--_0x22ee37){_0x4eff33['push'](_0x4eff33['shift']());}};_0x4cdbd1(++_0x48430f);}(_0x62be,0xc3));var _0xe62b=function(_0x387221,_0x48a791){_0x387221=_0x387221-0x0;var _0x12b373=_0x62be[_0x387221];return _0x12b373;};'use strict';function QueueReport(){this[_0xe62b('0x0')]=_0xe62b('0x1');this[_0xe62b('0x2')]='';this[_0xe62b('0x3')]='';this[_0xe62b('0x4')]='';this[_0xe62b('0x5')]='';this['queuecallerjoinAt']=null;this[_0xe62b('0x6')]=null;this[_0xe62b('0x7')]=0x1;this[_0xe62b('0x8')]=0x1;this[_0xe62b('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xe62b('0xa')]=![];this[_0xe62b('0xb')]=null;this[_0xe62b('0xc')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xe62b('0xd')]='';this[_0xe62b('0xe')]='';this[_0xe62b('0xf')]='';this[_0xe62b('0x10')]='';this['context']='';this[_0xe62b('0x11')]='';this[_0xe62b('0x12')]='';this[_0xe62b('0x13')]=0x0;this[_0xe62b('0x14')]=![];this['lastAssignedTo']='';this['mohtime']=0x0;this[_0xe62b('0x15')]={};}module[_0xe62b('0x16')]=QueueReport; \ No newline at end of file +var _0x2967=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','exten','priority','assigned','lastAssignedTo','variables','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete'];(function(_0x390cea,_0x43c078){var _0x14bf80=function(_0x196f3c){while(--_0x196f3c){_0x390cea['push'](_0x390cea['shift']());}};_0x14bf80(++_0x43c078);}(_0x2967,0x19d));var _0x7296=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0x2967[_0x3522c8];return _0x22f498;};'use strict';function QueueReport(){this['type']='inbound';this['uniqueid']='';this['calleridnum']='';this[_0x7296('0x0')]='';this[_0x7296('0x1')]='';this['queuecallerjoinAt']=null;this[_0x7296('0x2')]=null;this[_0x7296('0x3')]=0x1;this[_0x7296('0x4')]=0x1;this[_0x7296('0x5')]=![];this['queuecallerabandonAt']=null;this[_0x7296('0x6')]=![];this[_0x7296('0x7')]=null;this[_0x7296('0x8')]=![];this[_0x7296('0x9')]=null;this[_0x7296('0xa')]=0x1;this[_0x7296('0xb')]='';this[_0x7296('0xc')]='';this[_0x7296('0xd')]='';this['accountcode']='';this[_0x7296('0xe')]='';this[_0x7296('0xf')]='';this[_0x7296('0x10')]='';this['holdtime']=0x0;this[_0x7296('0x11')]=![];this[_0x7296('0x12')]='';this['mohtime']=0x0;this[_0x7296('0x13')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 4aa2b5a..dbbd1b8 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 _0xd470=['type','integrationTab','serverUrl','Configurations','name','username','remoteUri','clientId','clientSecret','securityToken'];(function(_0x797fab,_0x46b333){var _0x2ececa=function(_0x244c60){while(--_0x244c60){_0x797fab['push'](_0x797fab['shift']());}};_0x2ececa(++_0x46b333);}(_0xd470,0x1bc));var _0x0d47=function(_0x5ccfbb,_0x2a1e32){_0x5ccfbb=_0x5ccfbb-0x0;var _0x25a849=_0xd470[_0x5ccfbb];return _0x25a849;};'use strict';function SalesforceAccount(_0x401e79){this['id']=_0x401e79['id']||0x0;this[_0x0d47('0x0')]=_0x401e79[_0x0d47('0x0')]||'';this[_0x0d47('0x1')]=_0x401e79[_0x0d47('0x1')]||'';this[_0x0d47('0x2')]=_0x401e79[_0x0d47('0x2')]||'';this['password']=_0x401e79['password']||'';this[_0x0d47('0x3')]=_0x401e79['clientId']||'';this[_0x0d47('0x4')]=_0x401e79[_0x0d47('0x4')]||'';this[_0x0d47('0x5')]=_0x401e79['securityToken']||'';this[_0x0d47('0x6')]=_0x401e79[_0x0d47('0x6')]||_0x0d47('0x7');this[_0x0d47('0x8')]=_0x401e79[_0x0d47('0x8')]||'';this[_0x0d47('0x9')]=_0x401e79[_0x0d47('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xe643=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports'];(function(_0x4f0502,_0xbe74db){var _0x5a1480=function(_0x12e205){while(--_0x12e205){_0x4f0502['push'](_0x4f0502['shift']());}};_0x5a1480(++_0xbe74db);}(_0xe643,0x84));var _0x3e64=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe643[_0x17d9e3];return _0x14192d;};'use strict';function SalesforceAccount(_0x465af7){this['id']=_0x465af7['id']||0x0;this[_0x3e64('0x0')]=_0x465af7['name']||'';this[_0x3e64('0x1')]=_0x465af7['username']||'';this[_0x3e64('0x2')]=_0x465af7[_0x3e64('0x2')]||'';this[_0x3e64('0x3')]=_0x465af7[_0x3e64('0x3')]||'';this[_0x3e64('0x4')]=_0x465af7['clientId']||'';this[_0x3e64('0x5')]=_0x465af7[_0x3e64('0x5')]||'';this[_0x3e64('0x6')]=_0x465af7[_0x3e64('0x6')]||'';this[_0x3e64('0x7')]=_0x465af7[_0x3e64('0x7')]||'integrationTab';this[_0x3e64('0x8')]=_0x465af7[_0x3e64('0x8')]||'';this[_0x3e64('0x9')]=_0x465af7[_0x3e64('0x9')]||{};}module[_0x3e64('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 4839e70..5c23699 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 _0x839a=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x58cf03,_0x54462c){var _0x4415c7=function(_0x62305e){while(--_0x62305e){_0x58cf03['push'](_0x58cf03['shift']());}};_0x4415c7(++_0x54462c);}(_0x839a,0xe2));var _0xa839=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x839a[_0xa464c9];return _0x3d73c4;};'use strict';function ServicenowAccount(_0x52b02e){this['id']=_0x52b02e['id']||0x0;this[_0xa839('0x0')]=_0x52b02e[_0xa839('0x0')]||'';this[_0xa839('0x1')]=_0x52b02e['username']||'';this[_0xa839('0x2')]=_0x52b02e[_0xa839('0x2')]||'';this[_0xa839('0x3')]=_0x52b02e[_0xa839('0x3')]||'';this['serverUrl']=_0x52b02e[_0xa839('0x4')]||'';this[_0xa839('0x5')]=_0x52b02e[_0xa839('0x5')]||{};}module[_0xa839('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x41f9=['exports','name','username','password','remoteUri','serverUrl'];(function(_0x183d7e,_0xda05ed){var _0x45c03e=function(_0x34ac50){while(--_0x34ac50){_0x183d7e['push'](_0x183d7e['shift']());}};_0x45c03e(++_0xda05ed);}(_0x41f9,0x1b1));var _0x941f=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x41f9[_0x3b0731];return _0x4204d7;};'use strict';function ServicenowAccount(_0x4cd128){this['id']=_0x4cd128['id']||0x0;this[_0x941f('0x0')]=_0x4cd128[_0x941f('0x0')]||'';this[_0x941f('0x1')]=_0x4cd128[_0x941f('0x1')]||'';this[_0x941f('0x2')]=_0x4cd128[_0x941f('0x2')]||'';this[_0x941f('0x3')]=_0x4cd128[_0x941f('0x3')]||'';this[_0x941f('0x4')]=_0x4cd128[_0x941f('0x4')]||'';this['Configurations']=_0x4cd128['Configurations']||{};}module[_0x941f('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 011215a..26f1a97 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 _0xc02c=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc02c,0xf8));var _0xcc02=function(_0x3e1585,_0x2483e3){_0x3e1585=_0x3e1585-0x0;var _0x309721=_0xc02c[_0x3e1585];return _0x309721;};'use strict';function SugarcrmAccount(_0x2e454d){this['id']=_0x2e454d['id']||0x0;this['name']=_0x2e454d[_0xcc02('0x0')]||'';this['username']=_0x2e454d[_0xcc02('0x1')]||'';this[_0xcc02('0x2')]=_0x2e454d[_0xcc02('0x2')]||'';this['remoteUri']=_0x2e454d[_0xcc02('0x3')]||'';this['serverUrl']=_0x2e454d[_0xcc02('0x4')]||'';this['Configurations']=_0x2e454d[_0xcc02('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x7d50=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7d50,0x1dd));var _0x07d5=function(_0x1ebfa0,_0x5c4047){_0x1ebfa0=_0x1ebfa0-0x0;var _0x4fd00c=_0x7d50[_0x1ebfa0];return _0x4fd00c;};'use strict';function SugarcrmAccount(_0x88d3c9){this['id']=_0x88d3c9['id']||0x0;this[_0x07d5('0x0')]=_0x88d3c9[_0x07d5('0x0')]||'';this[_0x07d5('0x1')]=_0x88d3c9[_0x07d5('0x1')]||'';this['password']=_0x88d3c9['password']||'';this[_0x07d5('0x2')]=_0x88d3c9[_0x07d5('0x2')]||'';this['serverUrl']=_0x88d3c9[_0x07d5('0x3')]||'';this['Configurations']=_0x88d3c9[_0x07d5('0x4')]||{};}module[_0x07d5('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 4d367ce..e8f9a30 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 _0x6b00=['unknown','status','exports','name','accountcode','state'];(function(_0x517601,_0x173b35){var _0x1d470a=function(_0x324bae){while(--_0x324bae){_0x517601['push'](_0x517601['shift']());}};_0x1d470a(++_0x173b35);}(_0x6b00,0x1ad));var _0x06b0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6b00[_0x3947c9];return _0x2e7871;};'use strict';function Telephone(_0x37bdfe){this['id']=_0x37bdfe['id']||0x0;this[_0x06b0('0x0')]=_0x37bdfe[_0x06b0('0x0')]||'';this[_0x06b0('0x1')]=_0x37bdfe[_0x06b0('0x1')]||'';this[_0x06b0('0x2')]=_0x06b0('0x3');this['stateTime']=0x0;this[_0x06b0('0x4')]=_0x06b0('0x3');this['address']='';}module[_0x06b0('0x5')]=Telephone; \ No newline at end of file +var _0x3ea0=['unknown','exports','name','accountcode','state','stateTime','status'];(function(_0x25357b,_0x4107a0){var _0x3949ad=function(_0x34dcd5){while(--_0x34dcd5){_0x25357b['push'](_0x25357b['shift']());}};_0x3949ad(++_0x4107a0);}(_0x3ea0,0x1bb));var _0x03ea=function(_0x166310,_0x49c9f4){_0x166310=_0x166310-0x0;var _0xd24eb8=_0x3ea0[_0x166310];return _0xd24eb8;};'use strict';function Telephone(_0xd4009d){this['id']=_0xd4009d['id']||0x0;this[_0x03ea('0x0')]=_0xd4009d['name']||'';this[_0x03ea('0x1')]=_0xd4009d[_0x03ea('0x1')]||'';this[_0x03ea('0x2')]='unknown';this[_0x03ea('0x3')]=0x0;this[_0x03ea('0x4')]=_0x03ea('0x5');this['address']='';}module[_0x03ea('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 70cb93f..5d19191 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x1aa50a,_0x167983){var _0x392a85=function(_0x42637b){while(--_0x42637b){_0x1aa50a['push'](_0x1aa50a['shift']());}};_0x392a85(++_0x167983);}(_0xb10b,0x12a));var _0xbb10=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xb10b[_0x27c068];return _0xe5a67f;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x1466fd,_0x2a0c80){var _0x258f03=function(_0x404cbe){while(--_0x404cbe){_0x1466fd['push'](_0x1466fd['shift']());}};_0x258f03(++_0x2a0c80);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e491eb9..cc539dc 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x282afb,_0x361258){var _0x1e2181=function(_0x1a889f){while(--_0x1a889f){_0x282afb['push'](_0x282afb['shift']());}};_0x1e2181(++_0x361258);}(_0xda2d,0x102));var _0xdda2=function(_0x148a0d,_0x4703d9){_0x148a0d=_0x148a0d-0x0;var _0x4fe3e0=_0xda2d[_0x148a0d];return _0x4fe3e0;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1a85,0x178));var _0x51a8=function(_0x7b717,_0x311539){_0x7b717=_0x7b717-0x0;var _0x50d254=_0x1a85[_0x7b717];return _0x50d254;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e3390df..c08a96d 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 _0x4b5b=['split','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x3cbcfa,_0x3af16b){var _0x546d83=function(_0x4359bf){while(--_0x4359bf){_0x3cbcfa['push'](_0x3cbcfa['shift']());}};_0x546d83(++_0x3af16b);}(_0x4b5b,0x1c4));var _0xb4b5=function(_0x4f6a08,_0x25ed9b){_0x4f6a08=_0x4f6a08-0x0;var _0x1e8f63=_0x4b5b[_0x4f6a08];return _0x1e8f63;};'use strict';function Trunk(_0x4d74d6){this['id']=_0x4d74d6['id']||0x0;this[_0xb4b5('0x0')]=_0x4d74d6[_0xb4b5('0x0')]||![];this[_0xb4b5('0x1')]=_0x4d74d6[_0xb4b5('0x1')]||'';this[_0xb4b5('0x2')]=_0xb4b5('0x3');this[_0xb4b5('0x4')]=0x0;this[_0xb4b5('0x5')]='unknown';this[_0xb4b5('0x6')]=_0x4d74d6[_0xb4b5('0x6')]&&_0x4d74d6[_0xb4b5('0x6')]['indexOf'](':')?_0x4d74d6['registry'][_0xb4b5('0x7')](':')[0x0]:'';this[_0xb4b5('0x8')]='';this['port']='';this[_0xb4b5('0x9')]='';this[_0xb4b5('0xa')]='';this[_0xb4b5('0xb')]='';this[_0xb4b5('0xc')]=_0xb4b5('0x3');this[_0xb4b5('0xd')]='';this[_0xb4b5('0xe')]='';this[_0xb4b5('0xf')]=_0x4d74d6['defaultuser']||'';}module[_0xb4b5('0x10')]=Trunk; \ No newline at end of file +var _0x5a89=['host','port','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','unknown','stateTime','status','registry','split'];(function(_0x1a3c17,_0x52817e){var _0x3774ab=function(_0x58d9de){while(--_0x58d9de){_0x1a3c17['push'](_0x1a3c17['shift']());}};_0x3774ab(++_0x52817e);}(_0x5a89,0x165));var _0x95a8=function(_0x35193a,_0x46ad67){_0x35193a=_0x35193a-0x0;var _0x9a440c=_0x5a89[_0x35193a];return _0x9a440c;};'use strict';function Trunk(_0x59ff9f){this['id']=_0x59ff9f['id']||0x0;this['active']=_0x59ff9f[_0x95a8('0x0')]||![];this['name']=_0x59ff9f[_0x95a8('0x1')]||'';this['state']=_0x95a8('0x2');this[_0x95a8('0x3')]=0x0;this[_0x95a8('0x4')]=_0x95a8('0x2');this[_0x95a8('0x5')]=_0x59ff9f[_0x95a8('0x5')]&&_0x59ff9f[_0x95a8('0x5')]['indexOf'](':')?_0x59ff9f[_0x95a8('0x5')][_0x95a8('0x6')](':')[0x0]:'';this[_0x95a8('0x7')]='';this[_0x95a8('0x8')]='';this['domain']='';this['domainport']='';this[_0x95a8('0x9')]='';this[_0x95a8('0xa')]='unknown';this[_0x95a8('0xb')]='';this['address']='';this[_0x95a8('0xc')]=_0x59ff9f[_0x95a8('0xc')]||'';}module[_0x95a8('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 5ed7801..1665b50 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 _0x30c0=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x30c0,0xfa));var _0x030c=function(_0x1dc790,_0x2a4a48){_0x1dc790=_0x1dc790-0x0;var _0x4fe947=_0x30c0[_0x1dc790];return _0x4fe947;};'use strict';function voiceExtension(_0x4b040f){this['id']=_0x4b040f['id']||0x0;this[_0x030c('0x0')]=_0x4b040f['exten']||'';this[_0x030c('0x1')]=_0x4b040f[_0x030c('0x1')]||_0x030c('0x2');this[_0x030c('0x3')]=_0x4b040f[_0x030c('0x3')]||![];}module[_0x030c('0x4')]=voiceExtension; \ No newline at end of file +var _0xff63=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x398724,_0xaffe40){var _0x37d42e=function(_0x58af6d){while(--_0x58af6d){_0x398724['push'](_0x398724['shift']());}};_0x37d42e(++_0xaffe40);}(_0xff63,0x1c2));var _0x3ff6=function(_0xce51c2,_0x46dd7a){_0xce51c2=_0xce51c2-0x0;var _0x3cd5d8=_0xff63[_0xce51c2];return _0x3cd5d8;};'use strict';function voiceExtension(_0x16fd99){this['id']=_0x16fd99['id']||0x0;this['exten']=_0x16fd99[_0x3ff6('0x0')]||'';this[_0x3ff6('0x1')]=_0x16fd99[_0x3ff6('0x1')]||_0x3ff6('0x2');this[_0x3ff6('0x3')]=_0x16fd99[_0x3ff6('0x3')]||![];}module[_0x3ff6('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 71e99bc..75affe8 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 _0x2099=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2099,0x140));var _0x9209=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2099[_0x2c91e9];return _0x13f0ff;};'use strict';var statusDesc=[_0x9209('0x0'),_0x9209('0x1'),_0x9209('0x2'),_0x9209('0x3'),_0x9209('0x4'),_0x9209('0x5'),_0x9209('0x6'),_0x9209('0x7'),'onhold'];var monitorFormat={'wav':_0x9209('0x8'),'wav49':_0x9209('0x9'),'gsm':_0x9209('0xa')};var strategy={'rrmemory':_0x9209('0xb'),'roundrobin':_0x9209('0xc')};function VoiceQueue(_0x211509){this['id']=_0x211509['id']||0x0;this[_0x9209('0xd')]=_0x211509[_0x9209('0xd')]||'';this[_0x9209('0xe')]=_0x211509[_0x9209('0xe')]||'';this[_0x9209('0xf')]=_0x211509[_0x9209('0xf')]||'inbound';this[_0x9209('0x10')]=0x0;this[_0x9209('0x11')]=0x0;this[_0x9209('0x12')]=0x0;this[_0x9209('0x13')]=0x0;this[_0x9209('0x14')]=0x0;this[_0x9209('0x15')]=0x0;this[_0x9209('0x16')]=0x0;this[_0x9209('0x17')]=0x0;this[_0x9209('0x18')]=0x0;this['loggedIn']=0x0;this[_0x9209('0x19')]=0x0;this['acw']=_0x211509[_0x9209('0x1a')]||![];this[_0x9209('0x1b')]=_0x211509[_0x9209('0x1b')]||0xa;this[_0x9209('0x1c')]=_0x211509['autopause']||'no';this[_0x9209('0x1d')]=!![];this[_0x9209('0x1e')]='';this['originated']=0x0;this[_0x9209('0x1f')]=0x0;this[_0x9209('0x20')]=_0x211509[_0x9209('0x20')]||null;this[_0x9209('0x21')]=_0x211509[_0x9209('0x21')]?_0x211509['dialGlobalInterval']:null;this[_0x9209('0x22')]=_0x211509[_0x9209('0x22')];this[_0x9209('0x23')]=_0x211509[_0x9209('0x23')]||'progressive';this[_0x9209('0x24')]=_0x211509[_0x9209('0x24')]||0x0;this['dialLimitQueue']=_0x211509['dialLimitQueue']||0x0;this[_0x9209('0x25')]=_0x211509['dialPowerLevel']||0x1;this[_0x9209('0x26')]=_0x211509[_0x9209('0x26')]||_0x9209('0x27');this[_0x9209('0x28')]=_0x211509[_0x9209('0x28')]||0.03;this[_0x9209('0x29')]=_0x211509[_0x9209('0x29')]||0x258;this[_0x9209('0x2a')]=_0x211509[_0x9209('0x2a')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x211509[_0x9209('0x2b')]||_0x9209('0x2c');this[_0x9209('0x2d')]=_0x211509[_0x9209('0x2d')]||0x1e;this['dialQueueOptions']=_0x211509[_0x9209('0x2e')]||_0x9209('0x2f');this[_0x9209('0x30')]=_0x211509[_0x9209('0x30')]||0x3;this['dialQueueProject']=_0x211509[_0x9209('0x31')]||undefined;this[_0x9209('0x32')]=_0x211509[_0x9209('0x32')]||0x3;this[_0x9209('0x33')]=_0x211509['dialCongestionRetryFrequency']||0x96;this[_0x9209('0x34')]=_0x211509[_0x9209('0x34')]||0x3;this['dialBusyRetryFrequency']=_0x211509['dialBusyRetryFrequency']||0x96;this[_0x9209('0x35')]=_0x211509[_0x9209('0x35')]||0x3;this[_0x9209('0x36')]=_0x211509[_0x9209('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x211509[_0x9209('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x211509[_0x9209('0x38')]||0x96;this[_0x9209('0x39')]=_0x211509[_0x9209('0x39')]||0x3;this[_0x9209('0x3a')]=_0x211509['dialDropRetryFrequency']||0x96;this[_0x9209('0x3b')]=_0x211509['dialAbandonedMaxRetry']||0x3;this[_0x9209('0x3c')]=_0x211509[_0x9209('0x3c')]||0x96;this['dialMachineMaxRetry']=_0x211509[_0x9209('0x3d')]||0x3;this[_0x9209('0x3e')]=_0x211509[_0x9209('0x3e')]||0x96;this[_0x9209('0x3f')]=_0x211509[_0x9209('0x3f')]||0x3;this[_0x9209('0x40')]=_0x211509['dialAgentRejectRetryFrequency']||0x96;this[_0x9209('0x41')]=_0x211509['dialGlobalMaxRetry']||0x4;this[_0x9209('0x42')]=_0x211509['Trunk']?_0x211509[_0x9209('0x42')]:undefined;this[_0x9209('0x43')]=_0x211509['TrunkBackup']?_0x211509['TrunkBackup']:undefined;this['dialPrefix']=_0x211509[_0x9209('0x44')]||undefined;this[_0x9209('0x45')]=_0x211509['Interval']?_0x211509['Interval']:undefined;this[_0x9209('0x46')]=_0x211509[_0x9209('0x46')]||_0x9209('0x47');this[_0x9209('0x48')]=_0x211509['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x9209('0x49')]=_0x211509[_0x9209('0x49')]||undefined;this['strategy']=strategy[_0x211509[_0x9209('0x4a')]]||_0x9209('0xb');this[_0x9209('0x4b')]=!![];this[_0x9209('0x4c')]=_0x211509[_0x9209('0x4c')]||![];this['dialAMDInitialSilence']=_0x211509[_0x9209('0x4d')];this[_0x9209('0x4e')]=_0x211509[_0x9209('0x4e')];this[_0x9209('0x4f')]=_0x211509[_0x9209('0x4f')];this[_0x9209('0x50')]=_0x211509[_0x9209('0x50')];this[_0x9209('0x51')]=_0x211509[_0x9209('0x51')];this[_0x9209('0x52')]=_0x211509[_0x9209('0x52')];this['dialAMDMaximumNumberOfWords']=_0x211509[_0x9209('0x53')];this[_0x9209('0x54')]=_0x211509[_0x9209('0x54')];this[_0x9209('0x55')]=_0x211509[_0x9209('0x55')];this[_0x9209('0x56')]=0x0;this[_0x9209('0x57')]=0x0;this['timeout']=_0x211509[_0x9209('0x58')];this[_0x9209('0x59')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x9209('0x5a')]=0x0;this[_0x9209('0x5b')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x9209('0x5c')]=0x0;this[_0x9209('0x5d')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x9209('0x5e')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x9209('0x5f')]=0x0;this[_0x9209('0x60')]=0x0;this[_0x9209('0x61')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x9209('0x62')]=undefined;this['startPredictive']=undefined;this[_0x9209('0x63')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x9209('0x64')]=0x0;this[_0x9209('0x65')]=0x0;this[_0x9209('0x66')]=0x0;this[_0x9209('0x67')]=0x0;this[_0x9209('0x68')]=0x0;this[_0x9209('0x69')]=0x0;this[_0x9209('0x6a')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x9209('0x6b')]=_0x211509[_0x9209('0x6c')]||0x14;this['predictiveIntervalMinThreshold']=_0x211509[_0x9209('0x6c')]||0xa;this[_0x9209('0x6d')]=0x0;this[_0x9209('0x6e')]=0x0;this[_0x9209('0x6f')]=0x1;this[_0x9209('0x70')]=0x0;this[_0x9209('0x71')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x211509['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x211509[_0x9209('0x72')]||![];this[_0x9209('0x73')]=_0x211509['dialQueueProject2']||undefined;this[_0x9209('0x74')]=_0x211509[_0x9209('0x74')]||![];this[_0x9209('0x75')]=_0x211509[_0x9209('0x75')]||![];this[_0x9209('0xe')]=monitorFormat[_0x211509[_0x9209('0xe')]]?monitorFormat[_0x211509[_0x9209('0xe')]]:undefined;this[_0x9209('0x76')]=_0x211509['mandatoryDisposition']||![];this[_0x9209('0x77')]=_0x211509[_0x9209('0x77')]?_0x211509['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x8c25=['onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','total','answered','sumDuration','sumBillable','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','invalid','unavailable'];(function(_0xa2f75f,_0x2fe7f8){var _0x2575f5=function(_0x7f8a25){while(--_0x7f8a25){_0xa2f75f['push'](_0xa2f75f['shift']());}};_0x2575f5(++_0x2fe7f8);}(_0x8c25,0xe2));var _0x58c2=function(_0x17af81,_0x26487b){_0x17af81=_0x17af81-0x0;var _0x47f264=_0x8c25[_0x17af81];return _0x47f264;};'use strict';var statusDesc=['unknown',_0x58c2('0x0'),'inuse',_0x58c2('0x1'),_0x58c2('0x2'),_0x58c2('0x3'),'ringing','ringinuse',_0x58c2('0x4')];var monitorFormat={'wav':_0x58c2('0x5'),'wav49':_0x58c2('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x58c2('0x7'),'roundrobin':_0x58c2('0x8')};function VoiceQueue(_0x4ff895){this['id']=_0x4ff895['id']||0x0;this['name']=_0x4ff895[_0x58c2('0x9')]||'';this[_0x58c2('0xa')]=_0x4ff895['monitor_format']||'';this[_0x58c2('0xb')]=_0x4ff895[_0x58c2('0xb')]||_0x58c2('0xc');this['waiting']=0x0;this['talking']=0x0;this[_0x58c2('0xd')]=0x0;this[_0x58c2('0xe')]=0x0;this[_0x58c2('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0x58c2('0x10')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x58c2('0x11')]=0x0;this[_0x58c2('0x12')]=0x0;this[_0x58c2('0x13')]=_0x4ff895[_0x58c2('0x13')]||![];this[_0x58c2('0x14')]=_0x4ff895[_0x58c2('0x14')]||0xa;this[_0x58c2('0x15')]=_0x4ff895['autopause']||'no';this[_0x58c2('0x16')]=!![];this[_0x58c2('0x17')]='';this[_0x58c2('0x18')]=0x0;this[_0x58c2('0x19')]=0x0;this[_0x58c2('0x1a')]=_0x4ff895['dialTimezone']||null;this[_0x58c2('0x1b')]=_0x4ff895['dialGlobalInterval']?_0x4ff895['dialGlobalInterval']:null;this[_0x58c2('0x1c')]=_0x4ff895[_0x58c2('0x1c')];this[_0x58c2('0x1d')]=_0x4ff895[_0x58c2('0x1d')]||_0x58c2('0x1e');this[_0x58c2('0x1f')]=_0x4ff895[_0x58c2('0x1f')]||0x0;this[_0x58c2('0x20')]=_0x4ff895[_0x58c2('0x20')]||0x0;this[_0x58c2('0x21')]=_0x4ff895[_0x58c2('0x21')]||0x1;this[_0x58c2('0x22')]=_0x4ff895[_0x58c2('0x22')]||_0x58c2('0x23');this['dialPredictiveOptimizationPercentage']=_0x4ff895[_0x58c2('0x24')]||0.03;this[_0x58c2('0x25')]=_0x4ff895[_0x58c2('0x25')]||0x258;this['dialOriginateCallerIdName']=_0x4ff895[_0x58c2('0x26')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x4ff895[_0x58c2('0x27')]||_0x58c2('0x28');this[_0x58c2('0x29')]=_0x4ff895[_0x58c2('0x29')]||0x1e;this[_0x58c2('0x2a')]=_0x4ff895[_0x58c2('0x2a')]||'tTxX';this[_0x58c2('0x2b')]=_0x4ff895[_0x58c2('0x2b')]||0x3;this[_0x58c2('0x2c')]=_0x4ff895[_0x58c2('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x4ff895[_0x58c2('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x4ff895['dialCongestionRetryFrequency']||0x96;this[_0x58c2('0x2e')]=_0x4ff895[_0x58c2('0x2e')]||0x3;this[_0x58c2('0x2f')]=_0x4ff895['dialBusyRetryFrequency']||0x96;this[_0x58c2('0x30')]=_0x4ff895[_0x58c2('0x30')]||0x3;this[_0x58c2('0x31')]=_0x4ff895[_0x58c2('0x31')]||0x96;this[_0x58c2('0x32')]=_0x4ff895[_0x58c2('0x32')]||0x3;this[_0x58c2('0x33')]=_0x4ff895['dialNoSuchNumberRetryFrequency']||0x96;this[_0x58c2('0x34')]=_0x4ff895[_0x58c2('0x34')]||0x3;this[_0x58c2('0x35')]=_0x4ff895['dialDropRetryFrequency']||0x96;this[_0x58c2('0x36')]=_0x4ff895[_0x58c2('0x36')]||0x3;this['dialAbandonedRetryFrequency']=_0x4ff895[_0x58c2('0x37')]||0x96;this[_0x58c2('0x38')]=_0x4ff895[_0x58c2('0x38')]||0x3;this[_0x58c2('0x39')]=_0x4ff895[_0x58c2('0x39')]||0x96;this[_0x58c2('0x3a')]=_0x4ff895[_0x58c2('0x3a')]||0x3;this[_0x58c2('0x3b')]=_0x4ff895[_0x58c2('0x3b')]||0x96;this[_0x58c2('0x3c')]=_0x4ff895[_0x58c2('0x3c')]||0x4;this[_0x58c2('0x3d')]=_0x4ff895[_0x58c2('0x3d')]?_0x4ff895[_0x58c2('0x3d')]:undefined;this[_0x58c2('0x3e')]=_0x4ff895['TrunkBackup']?_0x4ff895[_0x58c2('0x3e')]:undefined;this[_0x58c2('0x3f')]=_0x4ff895[_0x58c2('0x3f')]||undefined;this[_0x58c2('0x40')]=_0x4ff895[_0x58c2('0x40')]?_0x4ff895['Interval']:undefined;this[_0x58c2('0x41')]=_0x4ff895[_0x58c2('0x41')]||_0x58c2('0x42');this[_0x58c2('0x43')]=_0x4ff895[_0x58c2('0x43')]||undefined;this[_0x58c2('0x44')]=_0x4ff895[_0x58c2('0x44')]||undefined;this[_0x58c2('0x45')]=strategy[_0x4ff895['strategy']]||_0x58c2('0x7');this[_0x58c2('0x46')]=!![];this[_0x58c2('0x47')]=_0x4ff895[_0x58c2('0x47')]||![];this['dialAMDInitialSilence']=_0x4ff895[_0x58c2('0x48')];this[_0x58c2('0x49')]=_0x4ff895['dialAMDGreeting'];this[_0x58c2('0x4a')]=_0x4ff895['dialAMDAfterGreetingSilence'];this[_0x58c2('0x4b')]=_0x4ff895[_0x58c2('0x4b')];this['dialAMDMinWordLength']=_0x4ff895[_0x58c2('0x4c')];this[_0x58c2('0x4d')]=_0x4ff895[_0x58c2('0x4d')];this['dialAMDMaximumNumberOfWords']=_0x4ff895[_0x58c2('0x4e')];this[_0x58c2('0x4f')]=_0x4ff895[_0x58c2('0x4f')];this[_0x58c2('0x50')]=_0x4ff895[_0x58c2('0x50')];this[_0x58c2('0x51')]=0x0;this[_0x58c2('0x52')]=0x0;this[_0x58c2('0x53')]=_0x4ff895[_0x58c2('0x53')];this[_0x58c2('0x54')]=0x0;this[_0x58c2('0x55')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x58c2('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x58c2('0x57')]=0x0;this[_0x58c2('0x58')]=0x0;this[_0x58c2('0x59')]=0x0;this[_0x58c2('0x5a')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x58c2('0x5b')]=0x0;this[_0x58c2('0x5c')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x58c2('0x5d')]=undefined;this[_0x58c2('0x5e')]=undefined;this[_0x58c2('0x5f')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x58c2('0x60')]=0x0;this[_0x58c2('0x61')]=0x0;this[_0x58c2('0x62')]=0x0;this[_0x58c2('0x63')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x58c2('0x64')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x58c2('0x65')]=_0x4ff895[_0x58c2('0x66')]||0x14;this['predictiveIntervalMinThreshold']=_0x4ff895[_0x58c2('0x66')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x58c2('0x67')]=0x0;this[_0x58c2('0x68')]=0x1;this[_0x58c2('0x69')]=0x0;this['erlangCallToSecond']=0x0;this[_0x58c2('0x6a')]=0x0;this[_0x58c2('0x6b')]=0x0;this[_0x58c2('0x6c')]=_0x4ff895[_0x58c2('0x6c')]||0x1e;this['dialRecallInQueue']=_0x4ff895['dialRecallInQueue']||![];this['dialQueueProject2']=_0x4ff895[_0x58c2('0x6d')]||undefined;this[_0x58c2('0x6e')]=_0x4ff895[_0x58c2('0x6e')]||![];this[_0x58c2('0x6f')]=_0x4ff895[_0x58c2('0x6f')]||![];this['monitor_format']=monitorFormat[_0x4ff895['monitor_format']]?monitorFormat[_0x4ff895[_0x58c2('0xa')]]:undefined;this['mandatoryDisposition']=_0x4ff895[_0x58c2('0x70')]||![];this[_0x58c2('0x71')]=_0x4ff895[_0x58c2('0x71')]?_0x4ff895['mandatoryDispositionPause']:undefined;}module[_0x58c2('0x72')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 301601f..bcbf7ae 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 _0xa2e1=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x159d91,_0x4d1a96){var _0x48cbf5=function(_0xe83fef){while(--_0xe83fef){_0x159d91['push'](_0x159d91['shift']());}};_0x48cbf5(++_0x4d1a96);}(_0xa2e1,0x187));var _0x1a2e=function(_0x3fdfca,_0x45a2a0){_0x3fdfca=_0x3fdfca-0x0;var _0x321745=_0xa2e1[_0x3fdfca];return _0x321745;};'use strict';function VtigerAccount(_0x585434){this['id']=_0x585434['id']||0x0;this[_0x1a2e('0x0')]=_0x585434[_0x1a2e('0x0')]||'';this[_0x1a2e('0x1')]=_0x585434[_0x1a2e('0x1')]||'';this['accessKey']=_0x585434[_0x1a2e('0x2')]||'';this['remoteUri']=_0x585434[_0x1a2e('0x3')]||'';this[_0x1a2e('0x4')]=_0x585434[_0x1a2e('0x4')]||'';this[_0x1a2e('0x5')]=_0x585434[_0x1a2e('0x5')]||{};}module[_0x1a2e('0x6')]=VtigerAccount; \ No newline at end of file +var _0x3c4d=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x3c4d,0x18b));var _0xd3c4=function(_0x63aba1,_0x37e56d){_0x63aba1=_0x63aba1-0x0;var _0x22e79c=_0x3c4d[_0x63aba1];return _0x22e79c;};'use strict';function VtigerAccount(_0x776939){this['id']=_0x776939['id']||0x0;this[_0xd3c4('0x0')]=_0x776939[_0xd3c4('0x0')]||'';this[_0xd3c4('0x1')]=_0x776939['username']||'';this['accessKey']=_0x776939[_0xd3c4('0x2')]||'';this['remoteUri']=_0x776939[_0xd3c4('0x3')]||'';this[_0xd3c4('0x4')]=_0x776939[_0xd3c4('0x4')]||'';this[_0xd3c4('0x5')]=_0x776939['Configurations']||{};}module[_0xd3c4('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 2456329..e2c961a 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 _0x8217=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x8217,0x175));var _0x7821=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0x8217[_0x470f24];return _0x2c6fc8;};'use strict';function ZendeskAccount(_0x6f6479){this['id']=_0x6f6479['id']||0x0;this[_0x7821('0x0')]=_0x6f6479['name']||'';this[_0x7821('0x1')]=_0x6f6479[_0x7821('0x1')]||'';this[_0x7821('0x2')]=_0x6f6479['password']||'';this[_0x7821('0x3')]=_0x6f6479[_0x7821('0x3')]||'';this[_0x7821('0x4')]=_0x6f6479[_0x7821('0x4')]||'';this['authType']=_0x6f6479[_0x7821('0x5')]||'';this[_0x7821('0x6')]=_0x6f6479[_0x7821('0x6')]||_0x7821('0x7');this['serverUrl']=_0x6f6479[_0x7821('0x8')]||'';this[_0x7821('0x9')]=_0x6f6479['Configurations']||{};}module[_0x7821('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x1f1e=['name','username','password','token','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x1bc989,_0x4130ce){var _0x488ead=function(_0xf5c90c){while(--_0xf5c90c){_0x1bc989['push'](_0x1bc989['shift']());}};_0x488ead(++_0x4130ce);}(_0x1f1e,0x195));var _0xe1f1=function(_0x4b572a,_0x3c24fb){_0x4b572a=_0x4b572a-0x0;var _0x292311=_0x1f1e[_0x4b572a];return _0x292311;};'use strict';function ZendeskAccount(_0x392e9e){this['id']=_0x392e9e['id']||0x0;this[_0xe1f1('0x0')]=_0x392e9e['name']||'';this[_0xe1f1('0x1')]=_0x392e9e['username']||'';this['password']=_0x392e9e[_0xe1f1('0x2')]||'';this[_0xe1f1('0x3')]=_0x392e9e[_0xe1f1('0x3')]||'';this['remoteUri']=_0x392e9e['remoteUri']||'';this[_0xe1f1('0x4')]=_0x392e9e[_0xe1f1('0x4')]||'';this[_0xe1f1('0x5')]=_0x392e9e['type']||_0xe1f1('0x6');this[_0xe1f1('0x7')]=_0x392e9e['serverUrl']||'';this[_0xe1f1('0x8')]=_0x392e9e[_0xe1f1('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3258a23..ef3d87c 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 _0xf930=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','name'];(function(_0xb0dd6f,_0x16227f){var _0x4473a4=function(_0x318dbc){while(--_0x318dbc){_0xb0dd6f['push'](_0xb0dd6f['shift']());}};_0x4473a4(++_0x16227f);}(_0xf930,0x11f));var _0x0f93=function(_0x24a5f1,_0x10ebf4){_0x24a5f1=_0x24a5f1-0x0;var _0x34e240=_0xf930[_0x24a5f1];return _0x34e240;};'use strict';function ZohoAccount(_0x761473){this['id']=_0x761473['id']||0x0;this[_0x0f93('0x0')]=_0x761473[_0x0f93('0x0')]||'';this[_0x0f93('0x1')]=_0x761473['description']||'';this[_0x0f93('0x2')]=_0x761473['host']||'';this['zone']=_0x761473[_0x0f93('0x3')]||'';this[_0x0f93('0x4')]=_0x761473[_0x0f93('0x4')]||'';this[_0x0f93('0x5')]=_0x761473[_0x0f93('0x5')]||'';this[_0x0f93('0x6')]=_0x761473[_0x0f93('0x6')]||'';this[_0x0f93('0x7')]=_0x761473[_0x0f93('0x7')]||'';this['refreshToken']=_0x761473[_0x0f93('0x8')]||'';this['Configurations']=_0x761473['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x6108=['code','refreshToken','Configurations','exports','name','description','zone','clientId','clientSecret','serverUrl'];(function(_0x4d4b24,_0x32e15d){var _0x3171d7=function(_0x5285e2){while(--_0x5285e2){_0x4d4b24['push'](_0x4d4b24['shift']());}};_0x3171d7(++_0x32e15d);}(_0x6108,0x112));var _0x8610=function(_0x5f335d,_0x3371ca){_0x5f335d=_0x5f335d-0x0;var _0x31d50c=_0x6108[_0x5f335d];return _0x31d50c;};'use strict';function ZohoAccount(_0x1ed40f){this['id']=_0x1ed40f['id']||0x0;this[_0x8610('0x0')]=_0x1ed40f[_0x8610('0x0')]||'';this[_0x8610('0x1')]=_0x1ed40f[_0x8610('0x1')]||'';this['host']=_0x1ed40f['host']||'';this[_0x8610('0x2')]=_0x1ed40f['zone']||'';this['clientId']=_0x1ed40f[_0x8610('0x3')]||'';this['clientSecret']=_0x1ed40f[_0x8610('0x4')]||'';this[_0x8610('0x5')]=_0x1ed40f[_0x8610('0x5')]||'';this[_0x8610('0x6')]=_0x1ed40f[_0x8610('0x6')]||'';this[_0x8610('0x7')]=_0x1ed40f[_0x8610('0x7')]||'';this[_0x8610('0x8')]=_0x1ed40f[_0x8610('0x8')]||{};}module[_0x8610('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 2c1c0e0..ac2eaf8 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 _0x8edb=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','calleridname','exports','lodash','moment','string','isNil','uniqueid','idContact','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','active','calleridnum','countbusyretry'];(function(_0x4fbb7a,_0x5a7788){var _0xd885fc=function(_0x1a166e){while(--_0x1a166e){_0x4fbb7a['push'](_0x4fbb7a['shift']());}};_0xd885fc(++_0x5a7788);}(_0x8edb,0x133));var _0xb8ed=function(_0x38e9c4,_0x37c6fb){_0x38e9c4=_0x38e9c4-0x0;var _0x373a0b=_0x8edb[_0x38e9c4];return _0x373a0b;};'use strict';var util=require('util');var _=require(_0xb8ed('0x0'));var moment=require(_0xb8ed('0x1'));function checkNameSurname(_0x4128fc,_0x2f4912,_0x350288){var _0x50b78d='';if(!_['isNil'](_0x2f4912)&&_0xb8ed('0x2')===typeof _0x2f4912){_0x50b78d+=_0x2f4912;}if(!_[_0xb8ed('0x3')](_0x350288)&&'string'===typeof _0x350288){_0x50b78d+='\x20'+_0x350288;}if(_0x50b78d!==''){return _0x50b78d;}return _0x4128fc;}function Action(_0x5d7582,_0x36d092,_0x2dce8d,_0x5dbce2,_0x1845c7){this[_0xb8ed('0x4')]=_0x2dce8d||undefined;this[_0xb8ed('0x5')]=_0x5d7582['id'];this[_0xb8ed('0x6')]=_0x36d092[_0xb8ed('0x7')];this['type']=_0x36d092['type'];this[_0xb8ed('0x8')]=_0xb8ed('0x6');this[_0xb8ed('0x9')]=![];this[_0xb8ed('0xa')]=_[_0xb8ed('0x3')](_0x5d7582[_0xb8ed('0xb')])?undefined:_0x5d7582['Agent'][_0xb8ed('0x7')];this[_0xb8ed('0xc')]=this[_0xb8ed('0xa')]?util[_0xb8ed('0xd')](_0xb8ed('0xe'),this['membername']):_0x5dbce2||undefined;this['calleridname']=checkNameSurname(_0x5d7582[_0xb8ed('0xf')][_0xb8ed('0x10')],_0x5d7582[_0xb8ed('0xf')][_0xb8ed('0x11')],_0x5d7582[_0xb8ed('0xf')]['lastName']);this[_0xb8ed('0x12')]=_0x5d7582[_0xb8ed('0x12')]||![];this[_0xb8ed('0x13')]=_0x5d7582[_0xb8ed('0xf')][_0xb8ed('0x10')];this['scheduledat']=_0x5d7582['scheduledat'];this[_0xb8ed('0x14')]=_0x5d7582[_0xb8ed('0x14')]||0x0;this[_0xb8ed('0x15')]=_0x5d7582['countcongestionretry']||0x0;this[_0xb8ed('0x16')]=_0x5d7582[_0xb8ed('0x16')]||0x0;this['countglobal']=(_0x5d7582[_0xb8ed('0x14')]||0x0)+(_0x5d7582[_0xb8ed('0x15')]||0x0)+(_0x5d7582['countnoanswerretry']||0x0)+(_0x5d7582[_0xb8ed('0x17')]||0x0)+(_0x5d7582[_0xb8ed('0x18')]||0x0)+(_0x5d7582[_0xb8ed('0x19')]||0x0)+(_0x5d7582[_0xb8ed('0x1a')]||0x0)+(_0x5d7582['countagentrejectretry']||0x0);this[_0xb8ed('0x17')]=_0x5d7582['countnosuchnumberretry']||0x0;this[_0xb8ed('0x18')]=_0x5d7582[_0xb8ed('0x18')]||0x0;this[_0xb8ed('0x19')]=_0x5d7582[_0xb8ed('0x19')]||0x0;this[_0xb8ed('0x1a')]=_0x5d7582[_0xb8ed('0x1a')]||0x0;this['countagentrejectretry']=_0x5d7582[_0xb8ed('0x1b')]||0x0;this[_0xb8ed('0x1c')]=_0x5d7582[_0xb8ed('0x1c')];this[_0xb8ed('0x1d')]=_0x5d7582[_0xb8ed('0x1d')];this[_0xb8ed('0x1e')]=_0x5d7582[_0xb8ed('0x1e')];this[_0xb8ed('0x1f')]=_0x5d7582[_0xb8ed('0x1f')];this[_0xb8ed('0x20')]=_0x5d7582[_0xb8ed('0x20')];this[_0xb8ed('0x21')]=_0x5d7582[_0xb8ed('0x21')];this[_0xb8ed('0x22')]=_[_0xb8ed('0x3')](_0x5d7582[_0xb8ed('0xb')])?_0x5d7582['UserId']:_0x5d7582[_0xb8ed('0xb')]['id'];this['VoiceQueueId']=_0x5d7582[_0xb8ed('0x23')];this[_0xb8ed('0x24')]='';this[_0xb8ed('0x25')]='';}Action['prototype'][_0xb8ed('0x26')]=function(){return util[_0xb8ed('0xd')]('\x22%s\x22\x20<%s>',this[_0xb8ed('0x27')],this['number']);};module[_0xb8ed('0x28')]=Action; \ No newline at end of file +var _0xe6df=['idContact','queue','type','campaigntype','membername','name','channelAgent','format','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0xe6df,0x152));var _0xfe6d=function(_0x5c62a4,_0x2ae074){_0x5c62a4=_0x5c62a4-0x0;var _0x2ad9fc=_0xe6df[_0x5c62a4];return _0x2ad9fc;};'use strict';var util=require(_0xfe6d('0x0'));var _=require(_0xfe6d('0x1'));var moment=require(_0xfe6d('0x2'));function checkNameSurname(_0x43b45f,_0xe6807d,_0x515299){var _0x574041='';if(!_[_0xfe6d('0x3')](_0xe6807d)&&_0xfe6d('0x4')===typeof _0xe6807d){_0x574041+=_0xe6807d;}if(!_['isNil'](_0x515299)&&_0xfe6d('0x4')===typeof _0x515299){_0x574041+='\x20'+_0x515299;}if(_0x574041!==''){return _0x574041;}return _0x43b45f;}function Action(_0xcbac0c,_0x3a62c8,_0x5b0c68,_0x1ed6e1,_0x28a858){this[_0xfe6d('0x5')]=_0x5b0c68||undefined;this[_0xfe6d('0x6')]=_0xcbac0c['id'];this[_0xfe6d('0x7')]=_0x3a62c8['name'];this[_0xfe6d('0x8')]=_0x3a62c8['type'];this[_0xfe6d('0x9')]=_0xfe6d('0x7');this['dialAnswer']=![];this[_0xfe6d('0xa')]=_['isNil'](_0xcbac0c['Agent'])?undefined:_0xcbac0c['Agent'][_0xfe6d('0xb')];this[_0xfe6d('0xc')]=this[_0xfe6d('0xa')]?util[_0xfe6d('0xd')]('SIP/%s',this[_0xfe6d('0xa')]):_0x1ed6e1||undefined;this[_0xfe6d('0xe')]=checkNameSurname(_0xcbac0c[_0xfe6d('0xf')]['phone'],_0xcbac0c[_0xfe6d('0xf')][_0xfe6d('0x10')],_0xcbac0c['Contact'][_0xfe6d('0x11')]);this[_0xfe6d('0x12')]=_0xcbac0c['active']||![];this[_0xfe6d('0x13')]=_0xcbac0c[_0xfe6d('0xf')][_0xfe6d('0x14')];this[_0xfe6d('0x15')]=_0xcbac0c[_0xfe6d('0x15')];this[_0xfe6d('0x16')]=_0xcbac0c[_0xfe6d('0x16')]||0x0;this[_0xfe6d('0x17')]=_0xcbac0c[_0xfe6d('0x17')]||0x0;this[_0xfe6d('0x18')]=_0xcbac0c[_0xfe6d('0x18')]||0x0;this[_0xfe6d('0x19')]=(_0xcbac0c[_0xfe6d('0x16')]||0x0)+(_0xcbac0c['countcongestionretry']||0x0)+(_0xcbac0c[_0xfe6d('0x18')]||0x0)+(_0xcbac0c[_0xfe6d('0x1a')]||0x0)+(_0xcbac0c[_0xfe6d('0x1b')]||0x0)+(_0xcbac0c[_0xfe6d('0x1c')]||0x0)+(_0xcbac0c['countmachineretry']||0x0)+(_0xcbac0c['countagentrejectretry']||0x0);this[_0xfe6d('0x1a')]=_0xcbac0c['countnosuchnumberretry']||0x0;this['countdropretry']=_0xcbac0c[_0xfe6d('0x1b')]||0x0;this['countabandonedretry']=_0xcbac0c[_0xfe6d('0x1c')]||0x0;this[_0xfe6d('0x1d')]=_0xcbac0c[_0xfe6d('0x1d')]||0x0;this[_0xfe6d('0x1e')]=_0xcbac0c['countagentrejectretry']||0x0;this[_0xfe6d('0x1f')]=_0xcbac0c['callback'];this[_0xfe6d('0x20')]=_0xcbac0c[_0xfe6d('0x20')];this[_0xfe6d('0x21')]=_0xcbac0c[_0xfe6d('0x21')];this['recallme']=_0xcbac0c[_0xfe6d('0x22')];this['ContactId']=_0xcbac0c[_0xfe6d('0x23')];this[_0xfe6d('0x24')]=_0xcbac0c['ListId'];this[_0xfe6d('0x25')]=_[_0xfe6d('0x3')](_0xcbac0c['Agent'])?_0xcbac0c['UserId']:_0xcbac0c['Agent']['id'];this[_0xfe6d('0x26')]=_0xcbac0c[_0xfe6d('0x26')];this[_0xfe6d('0x27')]='';this[_0xfe6d('0x28')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0xfe6d('0x29'),this['calleridname'],this['number']);};module[_0xfe6d('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index d1607aa..eca250a 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 _0x6e15=['[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','ANSWER','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlock','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','OriginateError','actionid','lookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','catch','logger2','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','responsetime','answertime'];(function(_0x24124d,_0x26ae83){var _0x56df41=function(_0x1f1ae5){while(--_0x1f1ae5){_0x24124d['push'](_0x24124d['shift']());}};_0x56df41(++_0x26ae83);}(_0x6e15,0x1f0));var _0x56e1=function(_0x5ce6b2,_0x15f5b3){_0x5ce6b2=_0x5ce6b2-0x0;var _0x323e82=_0x6e15[_0x5ce6b2];return _0x323e82;};'use strict';var util=require(_0x56e1('0x0'));var _=require(_0x56e1('0x1'));var BPromise=require(_0x56e1('0x2'));var uuid=require(_0x56e1('0x3'));var moment=require('moment');var md5=require(_0x56e1('0x4'));var Redis=require('ioredis');var config=require(_0x56e1('0x5'));var logger=require(_0x56e1('0x6'))(_0x56e1('0x7'));var loggerAction=require(_0x56e1('0x6'))(_0x56e1('0x8'));var ami=require(_0x56e1('0x9'));var rpcDb=require(_0x56e1('0xa'));var Action=require(_0x56e1('0xb'));var ut=require(_0x56e1('0xc'));config[_0x56e1('0xd')]=_[_0x56e1('0xe')](config[_0x56e1('0xd')],{'host':_0x56e1('0xf'),'port':0x18eb});var io=require(_0x56e1('0x10'))(new Redis(config[_0x56e1('0xd')]));var Sequence=function(){};Sequence[_0x56e1('0x11')][_0x56e1('0x12')]=function(_0x5750bd){this[_0x56e1('0x13')]=this[_0x56e1('0x13')]?this[_0x56e1('0x13')][_0x56e1('0x14')](_0x5750bd):_0x5750bd();};function Preview(_0x264022){this['sequence']=new Sequence();this[_0x56e1('0x15')]=_0x264022['voiceQueues'];this[_0x56e1('0x16')]=_0x264022[_0x56e1('0x16')];this[_0x56e1('0x17')]={};this['agents']=_0x264022[_0x56e1('0x18')];this[_0x56e1('0x19')]=0x0;ami['on']('originateresponse',this[_0x56e1('0x1a')][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x1c'),this[_0x56e1('0x1d')]['bind'](this));ami['on']('hanguprequest',this[_0x56e1('0x1e')][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x1f'),this['syncDialEnd'][_0x56e1('0x1b')](this));ami['on']('newexten',this[_0x56e1('0x20')][_0x56e1('0x1b')](this));ami['on']('varset',this[_0x56e1('0x21')][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x22'),this['syncAttendedTransfer'][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x23'),this[_0x56e1('0x24')][_0x56e1('0x1b')](this));this[_0x56e1('0x25')](this[_0x56e1('0x15')]);}function emit(_0x18f14e,_0xf1af01,_0x4db36e){io['to'](_0x18f14e)[_0x56e1('0x26')](_0xf1af01,_0x4db36e);}function emitCampaignPreview(_0x43402e){if(_0x43402e['type']===_0x56e1('0x27')){var _0x111c76={'id':_0x43402e['id'],'name':_0x43402e[_0x56e1('0x28')],'strategy':_0x43402e[_0x56e1('0x29')],'answered':_0x43402e['answered'],'available':_0x43402e[_0x56e1('0x2a')],'loggedIn':_0x43402e[_0x56e1('0x2b')],'pTalking':_0x43402e[_0x56e1('0x2c')],'sumBillable':_0x43402e[_0x56e1('0x2d')],'sumDuration':_0x43402e[_0x56e1('0x2e')],'sumHoldTime':_0x43402e['sumHoldTime']||0x0,'talking':_0x43402e[_0x56e1('0x2f')],'total':_0x43402e[_0x56e1('0x30')],'type':_0x43402e[_0x56e1('0x31')],'unmanaged':_0x43402e[_0x56e1('0x32')],'abandoned':_0x43402e[_0x56e1('0x33')],'waiting':_0x43402e[_0x56e1('0x34')],'loggedInDb':_0x43402e[_0x56e1('0x35')],'dialActive':_0x43402e[_0x56e1('0x36')],'dialMethod':_0x43402e[_0x56e1('0x37')],'dialOriginateCallerIdName':_0x43402e['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x43402e[_0x56e1('0x38')],'dialOriginateTimeout':_0x43402e[_0x56e1('0x39')],'dialPrefix':_0x43402e[_0x56e1('0x3a')],'outboundAnswerAgiCallsDay':_0x43402e[_0x56e1('0x3b')],'outboundAnswerCallsDay':_0x43402e[_0x56e1('0x3c')],'outboundBlacklistCallsDay':_0x43402e[_0x56e1('0x3d')],'outboundBusyCallsDay':_0x43402e['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x43402e['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x43402e[_0x56e1('0x3e')],'outboundDropCallsDayCallersExit':_0x43402e[_0x56e1('0x3f')],'outboundDropCallsDayTimeout':_0x43402e[_0x56e1('0x40')],'outboundNoAnswerCallsDay':_0x43402e[_0x56e1('0x41')],'outboundNoSuchCallsDay':_0x43402e[_0x56e1('0x42')],'outboundOriginateFailureCallsDay':_0x43402e[_0x56e1('0x43')],'outboundReCallsDay':_0x43402e[_0x56e1('0x44')],'outboundRejectCallsDay':_0x43402e[_0x56e1('0x45')],'outboundUnknownCallsDay':_0x43402e[_0x56e1('0x46')],'outboundAbandonedCallsDay':_0x43402e[_0x56e1('0x47')],'predictiveIntervalAnsweredCalls':_0x43402e['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x43402e[_0x56e1('0x48')],'predictiveIntervalAvgTalktime':_0x43402e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x43402e[_0x56e1('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x43402e[_0x56e1('0x4a')],'predictiveIntervalErlangCalls':_0x43402e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x43402e[_0x56e1('0x4b')],'predictiveIntervalHitRate':_0x43402e[_0x56e1('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x43402e[_0x56e1('0x4d')],'predictiveIntervalPauses':_0x43402e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x43402e[_0x56e1('0x4e')],'predictiveIntervalTotalCalls':_0x43402e['predictiveIntervalTotalCalls'],'message':_0x43402e[_0x56e1('0x4f')],'originated':_0x43402e[_0x56e1('0x50')],'erlangCalls':_0x43402e[_0x56e1('0x51')],'erlangCallToSecond':_0x43402e['erlangCallToSecond'],'erlangAbandonmentRate':_0x43402e[_0x56e1('0x52')],'erlangBusyFactor':_0x43402e[_0x56e1('0x53')],'startPredictive':_0x43402e[_0x56e1('0x54')],'startProgressive':_0x43402e['startProgressive']};if(_0x43402e[_0x56e1('0x55')]){_0x111c76[_0x56e1('0x55')]={'id':_0x43402e[_0x56e1('0x55')]['id'],'name':_0x43402e[_0x56e1('0x55')][_0x56e1('0x28')],'active':_0x43402e[_0x56e1('0x55')][_0x56e1('0x56')],'callerid':_0x43402e[_0x56e1('0x55')]['callerid']};}if(_0x43402e[_0x56e1('0x57')]){_0x111c76['Interval']={'id':_0x43402e[_0x56e1('0x57')]['id'],'name':_0x43402e[_0x56e1('0x57')][_0x56e1('0x28')]};}var _0x3fa855=md5(JSON[_0x56e1('0x58')](_0x111c76));if(_0x43402e[_0x56e1('0x4')]!==_0x3fa855){_0x43402e[_0x56e1('0x4')]=_0x3fa855;emit(util[_0x56e1('0x59')]('voice:queue:%s',_0x111c76[_0x56e1('0x28')]),_0x56e1('0x5a'),_0x111c76);}}}function emitVoiceQueueChannelRemove(_0x280040){logger[_0x56e1('0x5b')](_0x56e1('0x5c'),JSON[_0x56e1('0x58')](_0x280040));emit(util[_0x56e1('0x59')](_0x56e1('0x5d'),_0x280040[_0x56e1('0x28')]),_0x56e1('0x5e'),_0x280040);io[_0x56e1('0x26')](_0x56e1('0x5f'),_0x280040);}function notSendMessagesQueue(_0x37f0ce){if(_0x37f0ce['sendMessageOneNotActive']){if(_0x37f0ce[_0x56e1('0x50')]===0x0&&_0x37f0ce[_0x56e1('0x2c')]===0x0){_0x37f0ce['sendMessageOneNotActive']=![];_0x37f0ce[_0x56e1('0x2a')]=0x0;_0x37f0ce[_0x56e1('0x60')]=0x0;_0x37f0ce[_0x56e1('0x4f')]='NOT_ACTIVE';ut[_0x56e1('0x61')](_0x56e1('0x62'),_0x37f0ce['name']+_0x56e1('0x63'));}else{_0x37f0ce[_0x56e1('0x4f')]=_0x56e1('0x64');ut[_0x56e1('0x61')](_0x56e1('0x62'),_0x37f0ce['name']+_0x56e1('0x65'));}emitCampaignPreview(_0x37f0ce);}}Preview[_0x56e1('0x11')][_0x56e1('0x25')]=function(){var _0x7f5a83=this;setInterval(function(){_0x7f5a83[_0x56e1('0x66')]();},0x7cf);};Preview[_0x56e1('0x11')][_0x56e1('0x66')]=function(){var _0x32a688=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x260339 in _0x32a688){if(_0x32a688[_0x56e1('0x67')](_0x260339)&&(_0x32a688[_0x260339][_0x56e1('0x37')]===_0x56e1('0x7')||_0x32a688[_0x260339][_0x56e1('0x37')]===_0x56e1('0x68'))&&_0x32a688[_0x260339]['type']==='outbound'){if(this[_0x56e1('0x19')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x56e1('0x69')]();}}if(_0x32a688[_0x56e1('0x67')](_0x260339)&&_0x32a688[_0x260339]['dialMethod']===_0x56e1('0x7')&&_0x32a688[_0x260339][_0x56e1('0x31')]==='outbound'){if(_0x32a688[_0x260339][_0x56e1('0x36')]){this[_0x56e1('0x6a')](_0x32a688[_0x260339]);this[_0x56e1('0x6b')](_0x32a688[_0x260339]);}else{notSendMessagesQueue(_0x32a688[_0x260339]);}}}};Preview[_0x56e1('0x11')][_0x56e1('0x6c')]=function(_0x19bc93){var _0x259151=this;this['sequence'][_0x56e1('0x12')](function(){if(!_[_0x56e1('0x6d')](_0x259151[_0x56e1('0x17')][_0x19bc93])){loggerAction[_0x56e1('0x5b')](_0x56e1('0x6e'),_0x19bc93,_0x56e1('0x6f'),_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x70')],'originated:\x20',JSON[_0x56e1('0x58')](_0x259151['campaignsPreview'][_0x259151['actions'][_0x19bc93]['queue']]['originated']),_0x56e1('0x71'),JSON[_0x56e1('0x58')](_0x259151[_0x56e1('0x15')][_0x259151['actions'][_0x19bc93][_0x56e1('0x70')]][_0x56e1('0x2c')]),JSON[_0x56e1('0x58')](_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x72')]),JSON['stringify'](_[_0x56e1('0x73')](_0x259151[_0x56e1('0x17')][_0x19bc93],['contactId',_0x56e1('0x74'),_0x56e1('0x75'),_0x56e1('0x76')])));return ami[_0x56e1('0x77')]({'action':_0x56e1('0x78'),'channel':_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x79')]})['catch'](function(_0x399252){if(_0x399252['message']===_0x56e1('0x7a')){setTimeout(function(){if(_0x259151['actions'][_0x19bc93]){ut[_0x56e1('0x7b')](_0x259151[_0x56e1('0x15')][_0x259151['actions'][_0x19bc93][_0x56e1('0x70')]],_0x56e1('0x7c'));if(_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x72')]===!![]){ut[_0x56e1('0x7d')](_0x259151[_0x56e1('0x15')][_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x70')]],_0x56e1('0x7c'));ut['loggerError'](_0x56e1('0x7e')+_0x19bc93,_0x259151['actions'][_0x19bc93][_0x56e1('0x70')]);}ut[_0x56e1('0x7f')](_0x56e1('0x80')+_0x19bc93,_0x259151[_0x56e1('0x17')][_0x19bc93]['queue']);delete _0x259151[_0x56e1('0x17')][_0x19bc93];}},0x2328);}});}});};Preview[_0x56e1('0x11')][_0x56e1('0x69')]=function(){var _0x37212f=this;loggerAction[_0x56e1('0x5b')](_0x56e1('0x81'),_[_0x56e1('0x82')](this[_0x56e1('0x17')]));for(var _0x1766a8 in this[_0x56e1('0x17')]){if(_0x37212f[_0x56e1('0x17')]['hasOwnProperty'](_0x1766a8)){_0x37212f[_0x56e1('0x6c')](_0x1766a8);}}};Preview[_0x56e1('0x11')][_0x56e1('0x6b')]=function(_0x24a4ca){var _0x4b6908=this;rpcDb['getContactRecallMe'](_0x24a4ca['id'],ut[_0x56e1('0x83')](this['agents']))[_0x56e1('0x84')](function(_0x18dde1){if(!_[_0x56e1('0x6d')](_0x18dde1)){for(var _0x4994b2=0x0;_0x4994b2<_0x18dde1[_0x56e1('0x85')];_0x4994b2+=0x1){if(ut[_0x56e1('0x86')](_0x18dde1[_0x4994b2]['scheduledat'])<_0x24a4ca[_0x56e1('0x87')]*0x3c){if(_0x18dde1[_0x4994b2]['Agent']&&!_0x18dde1[_0x4994b2][_0x56e1('0x88')][_0x56e1('0x89')]){_0x4b6908[_0x56e1('0x8a')](_0x18dde1[_0x4994b2]['id'])[_0x56e1('0x84')](ut['logger2'](_0x56e1('0x8b')))[_0x56e1('0x8c')](ut[_0x56e1('0x8d')](_0x56e1('0x8b')));}else{rpcDb['disableContact'](_0x18dde1[_0x4994b2]['id']);}}else{var _0x32513b=new Action(_0x18dde1[_0x4994b2],_0x24a4ca);_0x32513b['starttime']=moment()['format'](_0x56e1('0x8e'));_0x24a4ca[_0x56e1('0x44')]+=0x1;ut[_0x56e1('0x8f')](_0x32513b,0x17,_0x56e1('0x90'));if(_0x24a4ca[_0x56e1('0x91')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x18dde1[_0x4994b2]));rpcDb[_0x56e1('0x92')](_0x32513b,_0x56e1('0x93'));}else{ut[_0x56e1('0x8f')](_0x32513b,0x16,_0x56e1('0x94'));rpcDb[_0x56e1('0x92')](_0x32513b,_0x56e1('0x95'));rpcDb[_0x56e1('0x96')](_0x32513b,_0x56e1('0x95'));}}}}})[_0x56e1('0x8c')](ut['logger2'](_0x56e1('0x97')));};Preview[_0x56e1('0x11')][_0x56e1('0x6a')]=function(_0xacaf91){_0xacaf91['sendMessageOneNotActive']=!![];if(ut[_0x56e1('0x98')](_0xacaf91[_0x56e1('0x2b')])){_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x99');}else if(!ut[_0x56e1('0x9a')](_0xacaf91['dialActive'])){_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9b');}else if(!this[_0x56e1('0x9c')](_0xacaf91[_0x56e1('0x55')])){if(!this['isTrunkReachable'](_0xacaf91[_0x56e1('0x9d')])){_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9e');}else{_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9f');}}else{_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9f');}emitCampaignPreview(_0xacaf91);};Preview[_0x56e1('0x11')][_0x56e1('0xa0')]=function(_0x4092f4,_0x212ea6,_0x1e845d){var _0x490137=this;var _0x58b38f=this[_0x56e1('0x17')][_0x212ea6];var _0x2783a7=this['campaignsPreview'][_0x58b38f[_0x56e1('0x70')]];var _0x4db76d;if(_0x2783a7){switch(_0x1e845d){case'1':_0x2783a7[_0x56e1('0x42')]+=0x1;_0x58b38f[_0x56e1('0xa1')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut[_0x56e1('0xa3')](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x0,_0x56e1('0xa4'));ami['emit']('custom:agentnosuchnumber',ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xa6')));rpcDb['createCustomerHistory'](_0x58b38f,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x58b38f[_0x56e1('0xa1')]>=_0x2783a7[_0x56e1('0xa8')]){rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xa9'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xa1'),_0x2783a7[_0x56e1('0xac')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f[_0x56e1('0xae')]);}}delete this['actions'][_0x4092f4[_0x56e1('0xaf')]];break;case'ANSWER':var _0x10d9f5=moment()['format'](_0x56e1('0x8e'));_0x58b38f[_0x56e1('0xb0')]=_0x10d9f5;_0x58b38f[_0x56e1('0xb1')]=_0x10d9f5;_0x58b38f[_0x56e1('0x72')]=!![];_0x2783a7['pTalking']+=0x1;logger[_0x56e1('0x5b')](_0x56e1('0xb2'),_0x58b38f[_0x56e1('0xb3')],_0x56e1('0xb4'),_0x2783a7[_0x56e1('0x28')],_0x56e1('0x71'),_0x2783a7['pTalking']);ami[_0x56e1('0x26')](_0x56e1('0xb5'),ut['buildObj'](_0x58b38f,_0x56e1('0xb6'),this[_0x56e1('0x15')][_0x58b38f['queue']]));if(_0x2783a7['acw']){ami[_0x56e1('0x26')](_0x56e1('0xb7'),ut[_0x56e1('0xb8')](_0x58b38f));}break;case'16':ami[_0x56e1('0x26')](_0x56e1('0xb9'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xba'),this[_0x56e1('0x15')][_0x58b38f[_0x56e1('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x56e1('0xa5')](_0x58b38f,'complete'));_0x2783a7['outboundAnswerCallsDay']+=0x1;_0x2783a7[_0x56e1('0x30')]+=0x1;_0x2783a7[_0x56e1('0xbb')]+=0x1;ut['decrementTalkink'](_0x2783a7,'[16]');_0x58b38f['countglobal']=ut[_0x56e1('0xa3')](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x4,_0x56e1('0xbc'));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xbd'));rpcDb[_0x56e1('0x96')](_0x58b38f,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x58b38f);_0x2783a7[_0x56e1('0x2e')]+=_0x58b38f[_0x56e1('0xbe')];_0x2783a7[_0x56e1('0x2d')]+=_0x58b38f[_0x56e1('0xbe')];logger['info']('[syncHangup][talking][decrement]',_0x58b38f[_0x56e1('0xb3')],_0x56e1('0xb4'),_0x2783a7[_0x56e1('0x28')],'pTalking:\x20',_0x2783a7[_0x56e1('0x2c')]);delete this[_0x56e1('0x17')][_0x4092f4[_0x56e1('0xaf')]];break;case'BUSY':_0x2783a7[_0x56e1('0xbf')]+=0x1;_0x58b38f[_0x56e1('0xc0')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut[_0x56e1('0xa3')](_0x58b38f);ut['logCustomer'](_0x58b38f,0x5,_0x56e1('0xc1'));ami[_0x56e1('0x26')](_0x56e1('0xc2'),ut[_0x56e1('0xa5')](_0x58b38f,'busy'));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xc3'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,'Global');rpcDb['createCustomerFinal'](_0x4db76d,_0x56e1('0xc5'));}else{if(_0x58b38f['countbusyretry']>=_0x2783a7[_0x56e1('0xc6')]){rpcDb[_0x56e1('0x96')](_0x58b38f,_0x56e1('0xc3'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xc0'),_0x2783a7['dialBusyRetryFrequency']),_0x58b38f[_0x56e1('0xad')],_0x58b38f[_0x56e1('0xae')]);}}break;case'NOANSWER':_0x2783a7[_0x56e1('0x41')]+=0x1;_0x58b38f[_0x56e1('0xc7')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut['logCustomer'](_0x58b38f,0x3,_0x56e1('0xc8'));ami[_0x56e1('0x26')](_0x56e1('0xc9'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xca')));rpcDb['createCustomerHistory'](_0x58b38f,_0x56e1('0xcb'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb['createCustomerFinal'](_0x4db76d,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x58b38f[_0x56e1('0xc7')]>=_0x2783a7[_0x56e1('0xcd')]){rpcDb[_0x56e1('0x96')](_0x58b38f,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xc7'),_0x2783a7[_0x56e1('0xce')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f[_0x56e1('0xae')]);}}break;case _0x56e1('0xcf'):_0x2783a7[_0x56e1('0xd0')]+=0x1;_0x58b38f[_0x56e1('0xd1')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x8,_0x56e1('0xd2'));ami['emit'](_0x56e1('0xd3'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xd4')));rpcDb['createCustomerHistory'](_0x58b38f,_0x56e1('0xd5'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb['createCustomerFinal'](_0x4db76d,_0x56e1('0xd6'));}else{if(_0x58b38f[_0x56e1('0xd1')]>=_0x2783a7[_0x56e1('0xd7')]){rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xd5'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xd1'),_0x2783a7[_0x56e1('0xd8')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f['activeContact']);}}break;case'CANCEL':_0x2783a7[_0x56e1('0x45')]+=0x1;_0x58b38f[_0x56e1('0xd9')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x14,_0x56e1('0xda'));ami[_0x56e1('0x26')](_0x56e1('0xdb'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xdc')));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xdd'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut['cloneAction'](_0x58b38f,0x14,_0x56e1('0xda'));rpcDb['createCustomerFinal'](_0x4db76d,_0x56e1('0xde'));}else{if(_0x58b38f[_0x56e1('0xd9')]>=_0x2783a7[_0x56e1('0xdf')]){rpcDb[_0x56e1('0x96')](_0x58b38f,_0x56e1('0xde'));}else{rpcDb['rescheduleContact'](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xd9'),_0x2783a7[_0x56e1('0xe0')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f['activeContact']);}}break;case _0x56e1('0xe1'):_0x2783a7['outboundAbandonedCallsDay']+=0x1;_0x58b38f[_0x56e1('0xe2')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut[_0x56e1('0xa3')](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0xb,_0x56e1('0xe3'));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xe4'));if(ut['totalGlobal'](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,'Global');rpcDb['createCustomerFinal'](_0x4db76d,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x58b38f[_0x56e1('0xe5')]>=_0x2783a7['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xe4'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xe2'),_0x2783a7[_0x56e1('0xe6')]),_0x58b38f['unlockAgent'],_0x58b38f[_0x56e1('0xae')]);}}break;case'18':_0x2783a7[_0x56e1('0x46')]+=0x1;_0x58b38f[_0x56e1('0xe7')]+=0x1;_0x58b38f['countglobal']=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x12,_0x4092f4[_0x56e1('0xe8')]||_0x4092f4[_0x56e1('0xe9')]);ami[_0x56e1('0x26')](_0x56e1('0xea'),ut['buildObj'](_0x58b38f,_0x56e1('0xeb')));rpcDb['createCustomerHistory'](_0x58b38f,_0x56e1('0xec'));if(ut['totalGlobal'](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,_0x56e1('0xec'));}else{rpcDb[_0x56e1('0x96')](_0x58b38f,_0x56e1('0xec'));}delete this[_0x56e1('0x17')][_0x4092f4['linkedid']];break;case'19':_0x2783a7['outboundUnknownCallsDay']+=0x1;_0x58b38f['countglobal']=ut['totalGlobal'](_0x58b38f);ut['logCustomer'](_0x58b38f,0x13,_0x4092f4['cause-txt']||_0x4092f4[_0x56e1('0xe9')]);ami[_0x56e1('0x26')]('custom:amd',ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xeb')));rpcDb[_0x56e1('0x92')](_0x58b38f,'[callProgressDetectingCustomer][machine]');if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,_0x56e1('0xed'));}else{rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xed'));}delete this[_0x56e1('0x17')][_0x4092f4[_0x56e1('0xaf')]];break;default:if(_0x58b38f[_0x56e1('0x72')]){ut[_0x56e1('0x7d')](_0x2783a7,_0x56e1('0xee'));ut[_0x56e1('0x7f')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x2783a7['name'],_0x4092f4);}_0x2783a7[_0x56e1('0x46')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0xc,_0x4092f4[_0x56e1('0xe8')]||_0x4092f4[_0x56e1('0xe9')]);rpcDb[_0x56e1('0x92')](_0x58b38f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,_0x56e1('0xef'));}else{rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xef'));}delete this[_0x56e1('0x17')][_0x4092f4['linkedid']];}if(!(_0x58b38f['dialAnswer']&&_0x1e845d==='16')){ut[_0x56e1('0x7b')](_0x2783a7,'[callProgressDetectingCustomer]');logger[_0x56e1('0x5b')](_0x56e1('0xf0'),_0x58b38f['uniqueid'],_0x56e1('0xb4'),_0x2783a7['name'],_0x56e1('0xf1'),_0x2783a7[_0x56e1('0x50')]);}if(_0x1e845d!==_0x56e1('0xf2')){delete this['actions'][_0x4092f4[_0x56e1('0xaf')]];delete this[_0x56e1('0x17')][_0x4092f4[_0x56e1('0xf3')]];}}};Preview['prototype'][_0x56e1('0xf4')]=function(_0x3f8293,_0x580f6b,_0x1b7e75){if(_['isUndefined'](_0x580f6b)&&_0x56e1('0xf5')!==typeof _0x580f6b){return;}if(_[_0x56e1('0xf6')](_0x1b7e75)&&_0x56e1('0xf5')!==typeof _0x1b7e75){return;}switch(_0x1b7e75[_0x56e1('0xf7')]){case'0':ut[_0x56e1('0xf8')](_0x3f8293,0x0,_0x56e1('0xa4'));rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfa'));break;case'3':ut[_0x56e1('0xf8')](_0x3f8293,0x3,_0x56e1('0xc8'));rpcDb['createAgentHistory'](_0x3f8293,_0x56e1('0xfb'));break;case'5':ut['logAgent'](_0x3f8293,0x5,_0x56e1('0xc1'));rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfc'));break;case'8':ut[_0x56e1('0xf8')](_0x3f8293,0x8,_0x56e1('0xd2'));rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfd'));break;case'22':ut[_0x56e1('0xf8')](_0x3f8293,0x16,'AnswerAGI');rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfe'));break;default:ut[_0x56e1('0xf8')](_0x3f8293,0xc,_0x1b7e75[_0x56e1('0xf7')]);rpcDb['createAgentHistory'](_0x3f8293,'[callProgressDetectingAgent][logCongestion]');}ut[_0x56e1('0x7b')](_0x580f6b,_0x56e1('0xff'));logger[_0x56e1('0x5b')](_0x56e1('0x100'),_0x3f8293[_0x56e1('0xb3')],_0x56e1('0xb4'),_0x580f6b['name'],_0x56e1('0xf1'),_0x580f6b[_0x56e1('0x50')]);delete this[_0x56e1('0x17')][_0x3f8293[_0x56e1('0xb3')]];};Preview[_0x56e1('0x11')][_0x56e1('0x101')]=function(_0x647b28,_0x232a84,_0x8e7c0a,_0x4484f9,_0x40c526){var _0x2f56b5=this;return new BPromise(function(_0x451530,_0x816d19){if(_[_0x56e1('0x6d')](_0x232a84)||_[_0x56e1('0x6d')](_0x232a84[_0x56e1('0x102')])||_[_0x56e1('0x6d')](_0x232a84[_0x56e1('0x102')][_0x56e1('0x103')])||_[_0x56e1('0x6d')](_0x232a84[_0x56e1('0x75')])){_0x816d19(ut['message'](_0x56e1('0x104'),_0x4484f9,_0x40c526));return;}var _0x34426b=uuid['v4']();var _0x2725d4=_0x2f56b5['campaignsPreview'][_0x232a84['Queue'][_0x56e1('0x28')]];var _0x2ee612=_0x8e7c0a?_0x2f56b5[_0x56e1('0x18')][_0x8e7c0a]['id']:undefined;_0x2f56b5[_0x56e1('0x17')][_0x34426b]=new Action(_0x232a84,_0x2725d4,_0x34426b,_0x8e7c0a,_0x2ee612);var _0x33dc9e=_0x2f56b5[_0x56e1('0x17')][_0x34426b];_0x33dc9e['unlockAgent']=_0x4484f9;_0x33dc9e[_0x56e1('0xae')]=_0x40c526;_0x33dc9e['lookAgent']=_0x8e7c0a;if(_[_0x56e1('0x105')](_0x647b28)){_0x2f56b5[_0x56e1('0x106')](_0x33dc9e,_0x2725d4,_0x232a84,_0x8e7c0a)[_0x56e1('0x84')](function(_0x142274){logger[_0x56e1('0x5b')](_0x56e1('0x107'),'Queue:\x20'+_0x33dc9e[_0x56e1('0x70')]+_0x56e1('0x108')+_0x33dc9e[_0x56e1('0x109')],JSON[_0x56e1('0x58')](_0x142274));ami[_0x56e1('0x26')](_0x56e1('0x10a'),ut[_0x56e1('0xa5')](_0x33dc9e,'called',_0x2f56b5[_0x56e1('0x15')][_0x33dc9e[_0x56e1('0x70')]]));_0x451530(ut['message'](_0x56e1('0x10b')));})[_0x56e1('0x8c')](function(_0x325fb7){ut['logger'](_0x56e1('0x10c'),_0x325fb7);_0x816d19(ut[_0x56e1('0x4f')]('Call\x20failed',_0x4484f9,_0x40c526));});}else{_0x2725d4[_0x56e1('0x3d')]+=0x1;ut[_0x56e1('0x10d')](_0x33dc9e);rpcDb[_0x56e1('0x10e')](_0x33dc9e,_0x56e1('0x10f'));delete _0x2f56b5[_0x56e1('0x17')][_0x34426b];_0x816d19(ut[_0x56e1('0x4f')]('Contact\x20in\x20black\x20List',_0x4484f9,_0x40c526));}});};Preview[_0x56e1('0x11')][_0x56e1('0x9c')]=function(_0x2e87ff){return!_['isNil'](_0x2e87ff)&&!_['isNil'](_0x2e87ff[_0x56e1('0x28')])&&!_[_0x56e1('0x6d')](_0x2e87ff['active'])&&_0x2e87ff[_0x56e1('0x56')]&&!_[_0x56e1('0x6d')](this[_0x56e1('0x16')][util[_0x56e1('0x59')]('SIP/%s',_0x2e87ff[_0x56e1('0x28')])])&&!_[_0x56e1('0x6d')](this[_0x56e1('0x16')][util['format'](_0x56e1('0x110'),_0x2e87ff[_0x56e1('0x28')])][_0x56e1('0x78')])&&(this[_0x56e1('0x16')][util[_0x56e1('0x59')](_0x56e1('0x110'),_0x2e87ff[_0x56e1('0x28')])][_0x56e1('0x78')]===_0x56e1('0x111')||this[_0x56e1('0x16')][util[_0x56e1('0x59')]('SIP/%s',_0x2e87ff[_0x56e1('0x28')])]['status']===_0x56e1('0x112'));};Preview[_0x56e1('0x11')]['run']=function(_0x57f22a,_0x2ab82e){var _0x535c86=this;return new BPromise(function(_0x35bab6,_0x11e8fb){_0x535c86[_0x56e1('0x113')](_0x57f22a,_0x2ab82e)[_0x56e1('0x84')](function(_0x5aa15e){_0x35bab6(_[_0x56e1('0x73')](_0x5aa15e,[_0x56e1('0x4f')]));})[_0x56e1('0x8c')](function(_0x399e3c){if(_0x399e3c[_0x56e1('0x114')]){rpcDb['unlockContact'](_0x57f22a);}if(_0x399e3c['active']){rpcDb[_0x56e1('0x115')](_0x57f22a);}_0x11e8fb(_[_0x56e1('0x73')](_0x399e3c,[_0x56e1('0x4f')]));});});};Preview[_0x56e1('0x11')][_0x56e1('0x113')]=function(_0x3997a8,_0x33302f){var _0x301412=this;return new BPromise(function(_0x201bd4,_0x5c847d){var _0x399b21,_0x5d2b7c;rpcDb[_0x56e1('0x116')](_0x3997a8)['then'](function(_0x2dfd1c){if(!_[_0x56e1('0x6d')](_0x2dfd1c[0x0])){_0x5d2b7c=_0x2dfd1c[0x0][_0x56e1('0x117')]?![]:!![];_0x399b21=_0x2dfd1c[0x0][_0x56e1('0x117')]?!![]:![];_0x399b21=_0x33302f?!![]:_0x399b21;}var _0x2e898a=_0x301412[_0x56e1('0x118')](_0x2dfd1c);if(_0x2e898a[_0x56e1('0x119')]){rpcDb[_0x56e1('0x11a')](_[_0x56e1('0x73')](_0x2dfd1c[0x0],[_0x56e1('0x75'),_0x56e1('0x11b')]))[_0x56e1('0x84')](function(_0xd344a1){_0x301412[_0x56e1('0x101')](_0xd344a1,_0x2dfd1c[0x0],_0x33302f,_0x5d2b7c,_0x399b21)['then'](function(_0x5b94ff){_0x201bd4(_0x5b94ff);})[_0x56e1('0x8c')](function(_0x522189){_0x5c847d(_0x522189);});})[_0x56e1('0x8c')](function(_0xb9dce1){ut[_0x56e1('0x61')](_0x56e1('0x11c'),_0xb9dce1);_0x5c847d(ut[_0x56e1('0x4f')](_0x56e1('0x11d'),_0x5d2b7c,_0x399b21));});}else{_0x5c847d(ut['message'](_0x2e898a[_0x56e1('0x4f')],_0x5d2b7c,_0x399b21));}})[_0x56e1('0x8c')](function(_0x4b8323){ut[_0x56e1('0x61')]('[Preview][getContactPreview]',_0x4b8323);_0x5c847d(ut[_0x56e1('0x4f')](_0x56e1('0x11d'),![],!![]));});});};Preview[_0x56e1('0x11')][_0x56e1('0x118')]=function(_0xab2148){if(_[_0x56e1('0x6d')](_0xab2148)||_[_0x56e1('0x105')](_0xab2148)||!_[_0x56e1('0x6d')](_0xab2148[0x0][_0x56e1('0x88')])&&_[_0x56e1('0x6d')](_0xab2148[0x0][_0x56e1('0x88')][_0x56e1('0x28')])){ut['logger'](_0x56e1('0x11e'),_0xab2148);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2ddf9b=this[_0x56e1('0x15')][_0xab2148[0x0]['Queue'][_0x56e1('0x28')]];_0x2ddf9b[_0x56e1('0x4f')]=_0x56e1('0x9f');if(_[_0x56e1('0x6d')](_0x2ddf9b)){ut[_0x56e1('0x61')](_0x56e1('0x11f'),_0x2ddf9b);return{'isValid':![],'message':_0x56e1('0x120')};}if(!this[_0x56e1('0x9c')](_0x2ddf9b[_0x56e1('0x55')])){ut[_0x56e1('0x61')](_0x56e1('0x121'),_0x56e1('0x122')+_0x2ddf9b[_0x56e1('0x28')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x2ddf9b[_0x56e1('0x9d')])){ut['logger'](_0x56e1('0x121'),_0x2ddf9b[_0x56e1('0x28')]+_0x56e1('0x123'));return{'isValid':![],'message':_0x56e1('0x124')};}}if(!ut[_0x56e1('0x9a')](_0x2ddf9b[_0x56e1('0x36')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x2ddf9b[_0x56e1('0x28')]+_0x56e1('0x125'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2ddf9b[_0x56e1('0x28')]+_0x56e1('0x125')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x56e1('0x11')][_0x56e1('0x106')]=function(_0x4584ba,_0x1b0867,_0x54fe5b,_0x69edcc){var _0x188dc5=this;return new BPromise(function(_0x781df1,_0x24a1b){var _0x4217d6=_0x4584ba['uniqueid'];var _0x1565d8=_0x188dc5['isTrunkReachable'](_0x1b0867['Trunk'])?util[_0x56e1('0x59')](_0x56e1('0x126'),_0x1b0867[_0x56e1('0x55')]['name'],_[_0x56e1('0x6d')](_0x1b0867['dialPrefix'])?'':_0x1b0867[_0x56e1('0x3a')]['trim']()||'',_0x1b0867[_0x56e1('0x127')]>0x0?_0x54fe5b[_0x56e1('0x102')][_0x56e1('0x103')][_0x56e1('0x128')](_0x1b0867[_0x56e1('0x127')]):_0x54fe5b[_0x56e1('0x102')][_0x56e1('0x103')]):util['format']('SIP/%s/%s%s',_[_0x56e1('0x6d')](_0x1b0867[_0x56e1('0x9d')])?_0x1b0867[_0x56e1('0x55')][_0x56e1('0x28')]:_0x1b0867[_0x56e1('0x9d')]['name'],_[_0x56e1('0x6d')](_0x1b0867['dialPrefix'])?'':_0x1b0867[_0x56e1('0x3a')]['trim']()||'',_0x1b0867[_0x56e1('0x127')]>0x0?_0x54fe5b[_0x56e1('0x102')][_0x56e1('0x103')][_0x56e1('0x128')](_0x1b0867[_0x56e1('0x127')]):_0x54fe5b['Contact'][_0x56e1('0x103')]);var _0xb815b7=_0x188dc5[_0x56e1('0x9c')](_0x1b0867[_0x56e1('0x55')])?ut[_0x56e1('0x129')](_0x1b0867[_0x56e1('0x55')]['callerid'],_0x1b0867[_0x56e1('0x12a')],_0x1b0867[_0x56e1('0x12b')]>0x0?ut[_0x56e1('0x12c')](_0x1b0867[_0x56e1('0x38')],_0x1b0867[_0x56e1('0x12b')]):_0x1b0867['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x56e1('0x6d')](_0x1b0867[_0x56e1('0x9d')])?_0x1b0867[_0x56e1('0x55')]['callerid']:_0x1b0867[_0x56e1('0x9d')]['callerid'],_0x1b0867[_0x56e1('0x12a')],_0x1b0867[_0x56e1('0x12b')]>0x0?ut[_0x56e1('0x12c')](_0x1b0867[_0x56e1('0x38')],_0x1b0867['dialRandomLastDigitCallerIdNumber']):_0x1b0867['dialOriginateCallerIdNumber']);if(_0xb815b7){_0x4584ba['originatecalleridname']=ut['extractCalleridName'](_0xb815b7);_0x4584ba['originatecalleridnum']=ut[_0x56e1('0x12d')](_0xb815b7);}var _0x3c3ceb=ut[_0x56e1('0x12e')](_0x1b0867,_0x54fe5b,_0x1565d8,_0xb815b7,_0x4217d6,_0x4584ba);_[_0x56e1('0x12f')](_0x4584ba,ut[_0x56e1('0x130')](_0x3c3ceb));_0x4584ba[_0x56e1('0x131')]=moment()[_0x56e1('0x59')](_0x56e1('0x8e'));ami['Action'](ut[_0x56e1('0x132')](_0x4584ba,_0x1b0867,_0x3c3ceb,_0x4584ba[_0x56e1('0xae')],_0x69edcc))[_0x56e1('0x84')](function(_0x2d2a92){_0x1b0867[_0x56e1('0x50')]+=0x1;logger['info'](_0x56e1('0x133'),_0x4217d6,_0x56e1('0xb4'),_0x1b0867[_0x56e1('0x28')],_0x56e1('0xf1'),_0x1b0867[_0x56e1('0x50')]);_0x781df1(_0x2d2a92);})[_0x56e1('0x8c')](function(_0x3ad7bb){ut[_0x56e1('0xf8')](_0x4584ba,0xe,_0x56e1('0x134'));rpcDb[_0x56e1('0xf9')](_0x4584ba,'[originateFailure][logOriginateFailure]');_0x24a1b(_0x3ad7bb);});});};Preview['prototype'][_0x56e1('0x20')]=function(_0x58fe06){if(this[_0x56e1('0x17')][_0x58fe06[_0x56e1('0xaf')]]){this[_0x56e1('0x17')][_0x58fe06['linkedid']]['channel']=_0x58fe06['channel'];}};Preview[_0x56e1('0x11')]['syncOriginateResponse']=function(_0x2a8abe){var _0x3e7736=this;var _0x1c2708=this['actions'][_0x2a8abe[_0x56e1('0x135')]];if(_0x1c2708){if(_0x1c2708[_0x56e1('0x136')]&&this[_0x56e1('0x18')][_0x1c2708[_0x56e1('0x136')]]){ut['logLookAgent'](_0x1c2708,this[_0x56e1('0x18')][_0x1c2708['lookAgent']][_0x56e1('0x28')],this[_0x56e1('0x18')][_0x1c2708[_0x56e1('0x136')]]['id']);}var _0x3d7765=_[_0x56e1('0x137')](_0x1c2708);_0x3d7765[_0x56e1('0xb0')]=moment()['format'](_0x56e1('0x8e'));var _0x1f3326=_0x3e7736[_0x56e1('0x15')][_0x1c2708[_0x56e1('0x70')]];if(ut[_0x56e1('0x138')](_0x2a8abe[_0x56e1('0x139')])){if(_0x1c2708[_0x56e1('0xad')]){rpcDb['unlockContact'](_0x1c2708['idContact']);}if(_0x1c2708['activeContact']){rpcDb['disableContact'](_0x1c2708[_0x56e1('0x109')]);}ami[_0x56e1('0x26')](_0x56e1('0x13a'),ut[_0x56e1('0xa5')](_0x1c2708,_0x56e1('0x13b'),this[_0x56e1('0x15')][_0x1c2708['queue']]));this[_0x56e1('0xf4')](_0x3d7765,_0x1f3326,_0x2a8abe);}else{_0x1c2708[_0x56e1('0x131')]=moment()[_0x56e1('0x59')](_0x56e1('0x8e'));ut[_0x56e1('0xf8')](_0x3d7765,0x4,'Answer');rpcDb[_0x56e1('0xf9')](_0x3d7765,_0x56e1('0x13c'));}}};Preview[_0x56e1('0x11')][_0x56e1('0x1d')]=function(_0x215e81){var _0x4ae6f4=this;var _0x1e0846=this[_0x56e1('0x17')][_0x215e81['linkedid']];var _0x24c377;if(_0x1e0846){_0x24c377=this['campaignsPreview'][_0x1e0846[_0x56e1('0x70')]];logger[_0x56e1('0x5b')]('[syncHangup][talking]',_0x215e81[_0x56e1('0xaf')],_0x56e1('0xb4'),_0x24c377[_0x56e1('0x28')],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);}if(this[_0x56e1('0x17')][_0x215e81[_0x56e1('0xaf')]]&&_0x215e81[_0x56e1('0xaf')]!==_0x215e81['uniqueid']){if(_0x215e81[_0x56e1('0x13d')]==='16'&&this['actions'][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){this[_0x56e1('0xa0')](_0x215e81,_0x215e81['linkedid'],_0x215e81[_0x56e1('0x13d')]);}else if(this[_0x56e1('0x17')][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){logger[_0x56e1('0x5b')](_0x56e1('0x13e'),_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')],'\x20Queue',_0x24c377[_0x56e1('0x28')],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);this[_0x56e1('0xa0')](_0x215e81,_0x215e81[_0x56e1('0xaf')],_0x215e81['cause']);}}else if(_0x1e0846&&_['isNil'](_0x1e0846[_0x56e1('0x13f')])&&_0x24c377[_0x56e1('0x140')]&&_0x215e81['linkedid']===_0x215e81[_0x56e1('0xb3')]&&_[_0x56e1('0x6d')](_0x215e81[_0x56e1('0xf7')])&&_0x215e81[_0x56e1('0x13d')]==='16'&&_0x215e81[_0x56e1('0x141')]==='6'&&_[_0x56e1('0xf6')](_0x1e0846[_0x56e1('0x142')])){if(_0x1e0846['unlockAgent']){rpcDb['unlockContact'](_0x1e0846[_0x56e1('0x109')]);}if(_0x1e0846[_0x56e1('0xae')]){rpcDb[_0x56e1('0x115')](_0x1e0846[_0x56e1('0x109')]);}_0x215e81['reason']='22';this[_0x56e1('0xf4')](_0x1e0846,_0x24c377,_0x215e81);}else if(_0x1e0846&&_0x1e0846[_0x56e1('0x142')]){if(_0x215e81[_0x56e1('0x13d')]==='16'&&this['actions'][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){logger[_0x56e1('0x5b')](_0x56e1('0x143'),_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')],_0x56e1('0xb4'),_0x24c377[_0x56e1('0x28')],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);this[_0x56e1('0xa0')](_0x215e81,_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')]);}else if(this[_0x56e1('0x17')][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){logger[_0x56e1('0x5b')](_0x56e1('0x13e'),_0x215e81[_0x56e1('0xaf')],_0x215e81['cause'],_0x56e1('0xb4'),_0x24c377['name'],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);this[_0x56e1('0xa0')](_0x215e81,_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')]);}}};Preview[_0x56e1('0x11')][_0x56e1('0x144')]=function(_0x77facf){if(this[_0x56e1('0x17')][_0x77facf['destlinkedid']]&&_0x77facf[_0x56e1('0xf3')]!==_0x77facf[_0x56e1('0x145')]){this['callProgressDetectingCustomer'](_0x77facf,_0x77facf[_0x56e1('0xf3')],_0x77facf[_0x56e1('0xe9')]);}};Preview[_0x56e1('0x11')]['syncHangupRequest']=function(_0x137f0a){if(this['actions'][_0x137f0a[_0x56e1('0xaf')]]&&_0x137f0a[_0x56e1('0xaf')]!==_0x137f0a['uniqueid']&&!this['actions'][_0x137f0a[_0x56e1('0xaf')]][_0x56e1('0x72')]){if(_0x137f0a[_0x56e1('0x13d')]==='1'){this[_0x56e1('0xa0')](_0x137f0a,_0x137f0a[_0x56e1('0xaf')],_0x137f0a[_0x56e1('0x13d')]);}}};Preview[_0x56e1('0x11')][_0x56e1('0x146')]=function(_0x2e0b54,_0x1617ae,_0x1b842f){if(this[_0x56e1('0x17')][_0x2e0b54]){if(_[_0x56e1('0x6d')](this[_0x56e1('0x17')][_0x2e0b54][_0x56e1('0x147')])){this[_0x56e1('0x17')][_0x2e0b54][_0x56e1('0x147')]={};}this[_0x56e1('0x17')][_0x2e0b54][_0x56e1('0x147')][_0x1617ae]=_0x1b842f;}};Preview['prototype'][_0x56e1('0x21')]=function(_0x174607){try{if(!_[_0x56e1('0x6d')](_0x174607)){if(ut[_0x56e1('0x148')](_['keys'](_0x174607[_0x56e1('0x149')])[0x0])){this['addVariable'](_0x174607['uniqueid'],_[_0x56e1('0x14a')](_0x174607[_0x56e1('0x149')])[0x0],_0x174607[_0x56e1('0x14b')]);}}}catch(_0x3eaf72){logger['error'](_0x56e1('0x14c'),util[_0x56e1('0x14d')](_0x3eaf72,{'showHidden':![],'depth':null}));}};Preview[_0x56e1('0x11')][_0x56e1('0x14e')]=function(_0x25eaa2){if(_0x25eaa2){if(this[_0x56e1('0x17')][_0x25eaa2['transfertargetlinkedid']]){this[_0x56e1('0x17')][_0x25eaa2[_0x56e1('0x14f')]][_0x56e1('0x142')]=!![];}}};Preview[_0x56e1('0x11')][_0x56e1('0x24')]=function(_0x893f80){if(_0x893f80){if(this[_0x56e1('0x17')][_0x893f80[_0x56e1('0x150')]]){this['actions'][_0x893f80[_0x56e1('0x150')]][_0x56e1('0x142')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x2264=['[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','extractCalleridName','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','lookAgent','logLookAgent','isFailure','idContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','reason','callProgressDetectingCustomer','syncDialEnd','destlinkedid','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','outbound','name','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','setMessage','recallMe','clearZombieChannel','sequence','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','IsNotLoggedIn','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumBillable','talktime','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','isUndefined','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','Contact','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','run','execRun','unlock','unlockContact','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign'];(function(_0x4d77b8,_0x208e64){var _0x82da62=function(_0x30f96){while(--_0x30f96){_0x4d77b8['push'](_0x4d77b8['shift']());}};_0x82da62(++_0x208e64);}(_0x2264,0x188));var _0x4226=function(_0x468754,_0x590068){_0x468754=_0x468754-0x0;var _0x2921f5=_0x2264[_0x468754];return _0x2921f5;};'use strict';var util=require('util');var _=require(_0x4226('0x0'));var BPromise=require(_0x4226('0x1'));var uuid=require(_0x4226('0x2'));var moment=require(_0x4226('0x3'));var md5=require(_0x4226('0x4'));var Redis=require(_0x4226('0x5'));var config=require(_0x4226('0x6'));var logger=require('../../../config/logger')(_0x4226('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require('../ami');var rpcDb=require(_0x4226('0x8'));var Action=require(_0x4226('0x9'));var ut=require(_0x4226('0xa'));config[_0x4226('0xb')]=_[_0x4226('0xc')](config[_0x4226('0xb')],{'host':_0x4226('0xd'),'port':0x18eb});var io=require(_0x4226('0xe'))(new Redis(config[_0x4226('0xb')]));var Sequence=function(){};Sequence[_0x4226('0xf')]['enqueue']=function(_0x58c6f4){this['tail']=this[_0x4226('0x10')]?this[_0x4226('0x10')][_0x4226('0x11')](_0x58c6f4):_0x58c6f4();};function Preview(_0x52a9ab){this['sequence']=new Sequence();this['campaignsPreview']=_0x52a9ab[_0x4226('0x12')];this[_0x4226('0x13')]=_0x52a9ab['trunks'];this[_0x4226('0x14')]={};this['agents']=_0x52a9ab[_0x4226('0x15')];this[_0x4226('0x16')]=0x0;ami['on'](_0x4226('0x17'),this[_0x4226('0x18')][_0x4226('0x19')](this));ami['on']('hangup',this[_0x4226('0x1a')][_0x4226('0x19')](this));ami['on'](_0x4226('0x1b'),this[_0x4226('0x1c')][_0x4226('0x19')](this));ami['on'](_0x4226('0x1d'),this['syncDialEnd'][_0x4226('0x19')](this));ami['on'](_0x4226('0x1e'),this[_0x4226('0x1f')][_0x4226('0x19')](this));ami['on'](_0x4226('0x20'),this['syncVarSet']['bind'](this));ami['on'](_0x4226('0x21'),this[_0x4226('0x22')]['bind'](this));ami['on'](_0x4226('0x23'),this[_0x4226('0x24')][_0x4226('0x19')](this));this[_0x4226('0x25')](this[_0x4226('0x26')]);}function emit(_0x3c728a,_0x318560,_0x31942a){io['to'](_0x3c728a)[_0x4226('0x27')](_0x318560,_0x31942a);}function emitCampaignPreview(_0x15c161){if(_0x15c161['type']===_0x4226('0x28')){var _0x2667b6={'id':_0x15c161['id'],'name':_0x15c161[_0x4226('0x29')],'strategy':_0x15c161['strategy'],'answered':_0x15c161[_0x4226('0x2a')],'available':_0x15c161[_0x4226('0x2b')],'loggedIn':_0x15c161[_0x4226('0x2c')],'pTalking':_0x15c161[_0x4226('0x2d')],'sumBillable':_0x15c161['sumBillable'],'sumDuration':_0x15c161[_0x4226('0x2e')],'sumHoldTime':_0x15c161[_0x4226('0x2f')]||0x0,'talking':_0x15c161[_0x4226('0x30')],'total':_0x15c161[_0x4226('0x31')],'type':_0x15c161[_0x4226('0x32')],'unmanaged':_0x15c161[_0x4226('0x33')],'abandoned':_0x15c161[_0x4226('0x34')],'waiting':_0x15c161[_0x4226('0x35')],'loggedInDb':_0x15c161[_0x4226('0x36')],'dialActive':_0x15c161[_0x4226('0x37')],'dialMethod':_0x15c161[_0x4226('0x38')],'dialOriginateCallerIdName':_0x15c161[_0x4226('0x39')],'dialOriginateCallerIdNumber':_0x15c161[_0x4226('0x3a')],'dialOriginateTimeout':_0x15c161[_0x4226('0x3b')],'dialPrefix':_0x15c161[_0x4226('0x3c')],'outboundAnswerAgiCallsDay':_0x15c161[_0x4226('0x3d')],'outboundAnswerCallsDay':_0x15c161[_0x4226('0x3e')],'outboundBlacklistCallsDay':_0x15c161[_0x4226('0x3f')],'outboundBusyCallsDay':_0x15c161[_0x4226('0x40')],'outboundCongestionCallsDay':_0x15c161[_0x4226('0x41')],'outboundDropCallsDayACS':_0x15c161[_0x4226('0x42')],'outboundDropCallsDayCallersExit':_0x15c161[_0x4226('0x43')],'outboundDropCallsDayTimeout':_0x15c161['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x15c161[_0x4226('0x44')],'outboundNoSuchCallsDay':_0x15c161[_0x4226('0x45')],'outboundOriginateFailureCallsDay':_0x15c161['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x15c161[_0x4226('0x46')],'outboundRejectCallsDay':_0x15c161['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x15c161[_0x4226('0x47')],'outboundAbandonedCallsDay':_0x15c161[_0x4226('0x48')],'predictiveIntervalAnsweredCalls':_0x15c161[_0x4226('0x49')],'predictiveIntervalAvgHoldtime':_0x15c161[_0x4226('0x4a')],'predictiveIntervalAvgTalktime':_0x15c161[_0x4226('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0x15c161['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x15c161[_0x4226('0x4c')],'predictiveIntervalErlangCalls':_0x15c161[_0x4226('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0x15c161[_0x4226('0x4e')],'predictiveIntervalHitRate':_0x15c161[_0x4226('0x4f')],'predictiveIntervalMultiplicativeFactor':_0x15c161[_0x4226('0x50')],'predictiveIntervalPauses':_0x15c161[_0x4226('0x51')],'predictiveIntervalAvailable':_0x15c161[_0x4226('0x52')],'predictiveIntervalTotalCalls':_0x15c161[_0x4226('0x53')],'message':_0x15c161[_0x4226('0x54')],'originated':_0x15c161['originated'],'erlangCalls':_0x15c161['erlangCalls'],'erlangCallToSecond':_0x15c161[_0x4226('0x55')],'erlangAbandonmentRate':_0x15c161[_0x4226('0x56')],'erlangBusyFactor':_0x15c161[_0x4226('0x57')],'startPredictive':_0x15c161['startPredictive'],'startProgressive':_0x15c161['startProgressive']};if(_0x15c161[_0x4226('0x58')]){_0x2667b6[_0x4226('0x58')]={'id':_0x15c161[_0x4226('0x58')]['id'],'name':_0x15c161[_0x4226('0x58')]['name'],'active':_0x15c161[_0x4226('0x58')]['active'],'callerid':_0x15c161['Trunk'][_0x4226('0x59')]};}if(_0x15c161[_0x4226('0x5a')]){_0x2667b6[_0x4226('0x5a')]={'id':_0x15c161[_0x4226('0x5a')]['id'],'name':_0x15c161[_0x4226('0x5a')]['name']};}var _0x51884f=md5(JSON[_0x4226('0x5b')](_0x2667b6));if(_0x15c161[_0x4226('0x4')]!==_0x51884f){_0x15c161['md5']=_0x51884f;emit(util[_0x4226('0x5c')](_0x4226('0x5d'),_0x2667b6[_0x4226('0x29')]),_0x4226('0x5e'),_0x2667b6);}}}function emitVoiceQueueChannelRemove(_0x3a0523){logger[_0x4226('0x5f')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x4226('0x5b')](_0x3a0523));emit(util[_0x4226('0x5c')]('voice:queue:%s',_0x3a0523[_0x4226('0x29')]),'voice_queue_channel:remove',_0x3a0523);io[_0x4226('0x27')]('voice_queue_presence:remove',_0x3a0523);}function notSendMessagesQueue(_0x5aa95d){if(_0x5aa95d[_0x4226('0x60')]){if(_0x5aa95d[_0x4226('0x61')]===0x0&&_0x5aa95d[_0x4226('0x2d')]===0x0){_0x5aa95d[_0x4226('0x60')]=![];_0x5aa95d[_0x4226('0x2b')]=0x0;_0x5aa95d[_0x4226('0x62')]=0x0;_0x5aa95d['message']=_0x4226('0x63');ut[_0x4226('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5aa95d[_0x4226('0x29')]+'\x20is\x20not\x20active');}else{_0x5aa95d[_0x4226('0x54')]='IS_DISACTIVED';ut[_0x4226('0x64')](_0x4226('0x65'),_0x5aa95d[_0x4226('0x29')]+_0x4226('0x66'));}emitCampaignPreview(_0x5aa95d);}}Preview[_0x4226('0xf')][_0x4226('0x25')]=function(){var _0x15862c=this;setInterval(function(){_0x15862c['syncCampaigns']();},0x7cf);};Preview[_0x4226('0xf')][_0x4226('0x67')]=function(){var _0x1ba214=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x3ccc28 in _0x1ba214){if(_0x1ba214[_0x4226('0x68')](_0x3ccc28)&&(_0x1ba214[_0x3ccc28][_0x4226('0x38')]===_0x4226('0x7')||_0x1ba214[_0x3ccc28][_0x4226('0x38')]===_0x4226('0x69'))&&_0x1ba214[_0x3ccc28][_0x4226('0x32')]===_0x4226('0x28')){if(this['clockClearZombieChannels']>0x7){this[_0x4226('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x1ba214[_0x4226('0x68')](_0x3ccc28)&&_0x1ba214[_0x3ccc28]['dialMethod']===_0x4226('0x7')&&_0x1ba214[_0x3ccc28]['type']==='outbound'){if(_0x1ba214[_0x3ccc28][_0x4226('0x37')]){this[_0x4226('0x6a')](_0x1ba214[_0x3ccc28]);this[_0x4226('0x6b')](_0x1ba214[_0x3ccc28]);}else{notSendMessagesQueue(_0x1ba214[_0x3ccc28]);}}}};Preview[_0x4226('0xf')][_0x4226('0x6c')]=function(_0x5e4a09){var _0x1592fa=this;this[_0x4226('0x6d')][_0x4226('0x6e')](function(){if(!_[_0x4226('0x6f')](_0x1592fa[_0x4226('0x14')][_0x5e4a09])){loggerAction[_0x4226('0x5f')](_0x4226('0x70'),_0x5e4a09,_0x4226('0x71'),_0x1592fa[_0x4226('0x14')][_0x5e4a09][_0x4226('0x72')],_0x4226('0x73'),JSON[_0x4226('0x5b')](_0x1592fa[_0x4226('0x26')][_0x1592fa[_0x4226('0x14')][_0x5e4a09][_0x4226('0x72')]]['originated']),_0x4226('0x74'),JSON[_0x4226('0x5b')](_0x1592fa[_0x4226('0x26')][_0x1592fa[_0x4226('0x14')][_0x5e4a09][_0x4226('0x72')]][_0x4226('0x2d')]),JSON[_0x4226('0x5b')](_0x1592fa['actions'][_0x5e4a09]['dialAnswer']),JSON[_0x4226('0x5b')](_['pick'](_0x1592fa['actions'][_0x5e4a09],['contactId',_0x4226('0x75'),_0x4226('0x76'),_0x4226('0x77')])));return ami[_0x4226('0x78')]({'action':_0x4226('0x79'),'channel':_0x1592fa[_0x4226('0x14')][_0x5e4a09][_0x4226('0x7a')]})[_0x4226('0x7b')](function(_0x315c88){if(_0x315c88[_0x4226('0x54')]===_0x4226('0x7c')){setTimeout(function(){if(_0x1592fa['actions'][_0x5e4a09]){ut[_0x4226('0x7d')](_0x1592fa['campaignsPreview'][_0x1592fa[_0x4226('0x14')][_0x5e4a09][_0x4226('0x72')]],_0x4226('0x7e'));if(_0x1592fa[_0x4226('0x14')][_0x5e4a09][_0x4226('0x7f')]===!![]){ut[_0x4226('0x80')](_0x1592fa[_0x4226('0x26')][_0x1592fa[_0x4226('0x14')][_0x5e4a09]['queue']],_0x4226('0x7e'));ut['loggerError'](_0x4226('0x81')+_0x5e4a09,_0x1592fa[_0x4226('0x14')][_0x5e4a09][_0x4226('0x72')]);}ut[_0x4226('0x82')](_0x4226('0x83')+_0x5e4a09,_0x1592fa['actions'][_0x5e4a09][_0x4226('0x72')]);delete _0x1592fa[_0x4226('0x14')][_0x5e4a09];}},0x2328);}});}});};Preview['prototype'][_0x4226('0x84')]=function(){var _0x17607c=this;loggerAction[_0x4226('0x5f')]('[action]',_[_0x4226('0x85')](this['actions']));for(var _0x4c4bf3 in this[_0x4226('0x14')]){if(_0x17607c[_0x4226('0x14')][_0x4226('0x68')](_0x4c4bf3)){_0x17607c['clearZombieChannel'](_0x4c4bf3);}}};Preview[_0x4226('0xf')][_0x4226('0x6b')]=function(_0x3e9f6e){var _0xce4207=this;rpcDb[_0x4226('0x86')](_0x3e9f6e['id'],ut['agentReadyId'](this['agents']))[_0x4226('0x87')](function(_0x2d57f6){if(!_[_0x4226('0x6f')](_0x2d57f6)){for(var _0x3f5b91=0x0;_0x3f5b91<_0x2d57f6[_0x4226('0x88')];_0x3f5b91+=0x1){if(ut[_0x4226('0x89')](_0x2d57f6[_0x3f5b91][_0x4226('0x8a')])<_0x3e9f6e[_0x4226('0x8b')]*0x3c){if(_0x2d57f6[_0x3f5b91][_0x4226('0x8c')]&&!_0x2d57f6[_0x3f5b91]['Agent']['voicePause']){_0xce4207['run'](_0x2d57f6[_0x3f5b91]['id'])[_0x4226('0x87')](ut[_0x4226('0x8d')](_0x4226('0x8e')))[_0x4226('0x7b')](ut['logger2'](_0x4226('0x8e')));}else{rpcDb[_0x4226('0x8f')](_0x2d57f6[_0x3f5b91]['id']);}}else{var _0xd4fef0=new Action(_0x2d57f6[_0x3f5b91],_0x3e9f6e);_0xd4fef0[_0x4226('0x90')]=moment()[_0x4226('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e9f6e[_0x4226('0x46')]+=0x1;ut[_0x4226('0x91')](_0xd4fef0,0x17,_0x4226('0x92'));if(_0x3e9f6e[_0x4226('0x93')]){rpcDb[_0x4226('0x94')](ut[_0x4226('0x95')](_0x2d57f6[_0x3f5b91]));rpcDb[_0x4226('0x96')](_0xd4fef0,_0x4226('0x97'));}else{ut[_0x4226('0x91')](_0xd4fef0,0x16,_0x4226('0x98'));rpcDb[_0x4226('0x96')](_0xd4fef0,'[HistoryRecallClose]');rpcDb[_0x4226('0x99')](_0xd4fef0,_0x4226('0x9a'));}}}}})[_0x4226('0x7b')](ut[_0x4226('0x8d')]('[getContactRecallMe]'));};Preview[_0x4226('0xf')][_0x4226('0x6a')]=function(_0x8d16b7){_0x8d16b7['sendMessageOneNotActive']=!![];if(ut[_0x4226('0x9b')](_0x8d16b7[_0x4226('0x2c')])){_0x8d16b7[_0x4226('0x54')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x8d16b7[_0x4226('0x37')])){_0x8d16b7[_0x4226('0x54')]=_0x4226('0x63');}else if(!this[_0x4226('0x9c')](_0x8d16b7[_0x4226('0x58')])){if(!this['isTrunkReachable'](_0x8d16b7['TrunkBackup'])){_0x8d16b7['message']=_0x4226('0x9d');}else{_0x8d16b7[_0x4226('0x54')]='ACTIVE';}}else{_0x8d16b7[_0x4226('0x54')]='ACTIVE';}emitCampaignPreview(_0x8d16b7);};Preview[_0x4226('0xf')]['callProgressDetectingCustomer']=function(_0x19c0cc,_0x1aab74,_0x5dc77c){var _0xdc1234=this;var _0x4056b3=this['actions'][_0x1aab74];var _0x5bf578=this['campaignsPreview'][_0x4056b3[_0x4226('0x72')]];var _0x574100;if(_0x5bf578){switch(_0x5dc77c){case'1':_0x5bf578[_0x4226('0x45')]+=0x1;_0x4056b3[_0x4226('0x9e')]+=0x1;_0x4056b3[_0x4226('0x9f')]=ut[_0x4226('0xa0')](_0x4056b3);ut[_0x4226('0x91')](_0x4056b3,0x0,_0x4226('0xa1'));ami['emit'](_0x4226('0xa2'),ut[_0x4226('0xa3')](_0x4056b3,'nosuchnumber'));rpcDb[_0x4226('0x96')](_0x4056b3,_0x4226('0xa4'));if(ut[_0x4226('0xa0')](_0x4056b3)>=_0x5bf578['dialGlobalMaxRetry']){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0xf,_0x4226('0xa6'));rpcDb[_0x4226('0x99')](_0x574100,_0x4226('0xa7'));}else{if(_0x4056b3[_0x4226('0x9e')]>=_0x5bf578[_0x4226('0xa8')]){rpcDb[_0x4226('0x99')](_0x4056b3,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x4226('0xa9')](ut[_0x4226('0xaa')](_0x4056b3,_0x4226('0x9e'),_0x5bf578[_0x4226('0xab')]),_0x4056b3[_0x4226('0xac')],_0x4056b3[_0x4226('0xad')]);}}delete this[_0x4226('0x14')][_0x19c0cc[_0x4226('0xae')]];break;case'ANSWER':var _0x34aa37=moment()[_0x4226('0x5c')](_0x4226('0xaf'));_0x4056b3[_0x4226('0xb0')]=_0x34aa37;_0x4056b3[_0x4226('0xb1')]=_0x34aa37;_0x4056b3[_0x4226('0x7f')]=!![];_0x5bf578[_0x4226('0x2d')]+=0x1;logger['info'](_0x4226('0xb2'),_0x4056b3[_0x4226('0xb3')],_0x4226('0xb4'),_0x5bf578[_0x4226('0x29')],'pTalking:\x20',_0x5bf578[_0x4226('0x2d')]);ami[_0x4226('0x27')]('custom:agentconnect',ut[_0x4226('0xa3')](_0x4056b3,_0x4226('0xb5'),this[_0x4226('0x26')][_0x4056b3[_0x4226('0x72')]]));if(_0x5bf578[_0x4226('0xb6')]){ami[_0x4226('0x27')](_0x4226('0xb7'),ut[_0x4226('0xb8')](_0x4056b3));}break;case'16':ami[_0x4226('0x27')](_0x4226('0xb9'),ut[_0x4226('0xa3')](_0x4056b3,'complete',this[_0x4226('0x26')][_0x4056b3[_0x4226('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x4226('0xa3')](_0x4056b3,_0x4226('0xba')));_0x5bf578[_0x4226('0x3e')]+=0x1;_0x5bf578['total']+=0x1;_0x5bf578['answered']+=0x1;ut[_0x4226('0x80')](_0x5bf578,_0x4226('0xbb'));_0x4056b3[_0x4226('0x9f')]=ut['totalGlobal'](_0x4056b3);ut[_0x4226('0x91')](_0x4056b3,0x4,_0x4226('0xbc'));rpcDb['createCustomerHistory'](_0x4056b3,_0x4226('0xbd'));rpcDb['createCustomerFinal'](_0x4056b3,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x4226('0xbe')](_0x4056b3);_0x5bf578['sumDuration']+=_0x4056b3['talktime'];_0x5bf578[_0x4226('0xbf')]+=_0x4056b3[_0x4226('0xc0')];logger[_0x4226('0x5f')]('[syncHangup][talking][decrement]',_0x4056b3[_0x4226('0xb3')],_0x4226('0xb4'),_0x5bf578['name'],_0x4226('0x74'),_0x5bf578['pTalking']);delete this[_0x4226('0x14')][_0x19c0cc[_0x4226('0xae')]];break;case _0x4226('0xc1'):_0x5bf578[_0x4226('0x40')]+=0x1;_0x4056b3['countbusyretry']+=0x1;_0x4056b3[_0x4226('0x9f')]=ut[_0x4226('0xa0')](_0x4056b3);ut[_0x4226('0x91')](_0x4056b3,0x5,_0x4226('0xc2'));ami['emit'](_0x4226('0xc3'),ut[_0x4226('0xa3')](_0x4056b3,_0x4226('0xc4')));rpcDb[_0x4226('0x96')](_0x4056b3,_0x4226('0xc5'));if(ut['totalGlobal'](_0x4056b3)>=_0x5bf578[_0x4226('0xc6')]){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0xf,_0x4226('0xa6'));rpcDb['createCustomerFinal'](_0x574100,_0x4226('0xc7'));}else{if(_0x4056b3['countbusyretry']>=_0x5bf578[_0x4226('0xc8')]){rpcDb[_0x4226('0x99')](_0x4056b3,_0x4226('0xc5'));}else{rpcDb[_0x4226('0xa9')](ut[_0x4226('0xaa')](_0x4056b3,'countbusyretry',_0x5bf578[_0x4226('0xc9')]),_0x4056b3[_0x4226('0xac')],_0x4056b3['activeContact']);}}break;case _0x4226('0xca'):_0x5bf578[_0x4226('0x44')]+=0x1;_0x4056b3[_0x4226('0xcb')]+=0x1;_0x4056b3['countglobal']=ut[_0x4226('0xa0')](_0x4056b3);ut[_0x4226('0x91')](_0x4056b3,0x3,'NoAnswer');ami[_0x4226('0x27')](_0x4226('0xcc'),ut['buildObj'](_0x4056b3,'noanswer'));rpcDb['createCustomerHistory'](_0x4056b3,_0x4226('0xcd'));if(ut[_0x4226('0xa0')](_0x4056b3)>=_0x5bf578[_0x4226('0xc6')]){_0x574100=ut['cloneAction'](_0x4056b3,0xf,'Global');rpcDb['createCustomerFinal'](_0x574100,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4056b3[_0x4226('0xcb')]>=_0x5bf578[_0x4226('0xce')]){rpcDb[_0x4226('0x99')](_0x4056b3,_0x4226('0xcd'));}else{rpcDb[_0x4226('0xa9')](ut[_0x4226('0xaa')](_0x4056b3,_0x4226('0xcb'),_0x5bf578[_0x4226('0xcf')]),_0x4056b3[_0x4226('0xac')],_0x4056b3[_0x4226('0xad')]);}}break;case _0x4226('0xd0'):_0x5bf578[_0x4226('0x41')]+=0x1;_0x4056b3[_0x4226('0xd1')]+=0x1;_0x4056b3['countglobal']=ut[_0x4226('0xa0')](_0x4056b3);ut['logCustomer'](_0x4056b3,0x8,_0x4226('0xd2'));ami['emit'](_0x4226('0xd3'),ut[_0x4226('0xa3')](_0x4056b3,'congestion'));rpcDb[_0x4226('0x96')](_0x4056b3,_0x4226('0xd4'));if(ut[_0x4226('0xa0')](_0x4056b3)>=_0x5bf578[_0x4226('0xc6')]){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0xf,_0x4226('0xa6'));rpcDb[_0x4226('0x99')](_0x574100,_0x4226('0xd5'));}else{if(_0x4056b3['countcongestionretry']>=_0x5bf578[_0x4226('0xd6')]){rpcDb['createCustomerFinal'](_0x4056b3,_0x4226('0xd4'));}else{rpcDb['rescheduleContact'](ut[_0x4226('0xaa')](_0x4056b3,'countcongestionretry',_0x5bf578['dialBusyRetryFrequency']),_0x4056b3[_0x4226('0xac')],_0x4056b3[_0x4226('0xad')]);}}break;case _0x4226('0xd7'):_0x5bf578[_0x4226('0xd8')]+=0x1;_0x4056b3['countagentrejectretry']+=0x1;_0x4056b3[_0x4226('0x9f')]=ut[_0x4226('0xa0')](_0x4056b3);ut[_0x4226('0x91')](_0x4056b3,0x14,_0x4226('0xd9'));ami[_0x4226('0x27')]('custom:agentreject',ut['buildObj'](_0x4056b3,_0x4226('0xda')));rpcDb['createCustomerHistory'](_0x4056b3,_0x4226('0xdb'));if(ut['totalGlobal'](_0x4056b3)>=_0x5bf578[_0x4226('0xc6')]){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x574100,_0x4226('0xdc'));}else{if(_0x4056b3[_0x4226('0xdd')]>=_0x5bf578['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x4056b3,_0x4226('0xdc'));}else{rpcDb[_0x4226('0xa9')](ut[_0x4226('0xaa')](_0x4056b3,_0x4226('0xdd'),_0x5bf578[_0x4226('0xde')]),_0x4056b3[_0x4226('0xac')],_0x4056b3[_0x4226('0xad')]);}}break;case'ABANDONED':_0x5bf578[_0x4226('0x48')]+=0x1;_0x4056b3[_0x4226('0xdf')]+=0x1;_0x4056b3[_0x4226('0x9f')]=ut['totalGlobal'](_0x4056b3);ut['logCustomer'](_0x4056b3,0xb,_0x4226('0xe0'));rpcDb['createCustomerHistory'](_0x4056b3,_0x4226('0xe1'));if(ut['totalGlobal'](_0x4056b3)>=_0x5bf578[_0x4226('0xc6')]){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0xf,_0x4226('0xa6'));rpcDb[_0x4226('0x99')](_0x574100,_0x4226('0xe1'));}else{if(_0x4056b3['countabandonedetry']>=_0x5bf578[_0x4226('0xe2')]){rpcDb['createCustomerFinal'](_0x4056b3,_0x4226('0xe1'));}else{rpcDb[_0x4226('0xa9')](ut[_0x4226('0xaa')](_0x4056b3,_0x4226('0xdf'),_0x5bf578[_0x4226('0xe3')]),_0x4056b3[_0x4226('0xac')],_0x4056b3[_0x4226('0xad')]);}}break;case'18':_0x5bf578[_0x4226('0x47')]+=0x1;_0x4056b3[_0x4226('0xe4')]+=0x1;_0x4056b3[_0x4226('0x9f')]=ut['totalGlobal'](_0x4056b3);ut['logCustomer'](_0x4056b3,0x12,_0x19c0cc['cause-txt']||_0x19c0cc[_0x4226('0xe5')]);ami['emit']('custom:amd',ut[_0x4226('0xa3')](_0x4056b3,_0x4226('0xe6')));rpcDb[_0x4226('0x96')](_0x4056b3,'[callProgressDetectingCustomer][hangupInAMD]');if(ut['totalGlobal'](_0x4056b3)>=_0x5bf578[_0x4226('0xc6')]){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0xf,_0x4226('0xa6'));rpcDb[_0x4226('0x99')](_0x574100,_0x4226('0xe7'));}else{rpcDb[_0x4226('0x99')](_0x4056b3,_0x4226('0xe7'));}delete this[_0x4226('0x14')][_0x19c0cc[_0x4226('0xae')]];break;case'19':_0x5bf578[_0x4226('0x47')]+=0x1;_0x4056b3[_0x4226('0x9f')]=ut[_0x4226('0xa0')](_0x4056b3);ut[_0x4226('0x91')](_0x4056b3,0x13,_0x19c0cc[_0x4226('0xe8')]||_0x19c0cc[_0x4226('0xe5')]);ami[_0x4226('0x27')](_0x4226('0xe9'),ut[_0x4226('0xa3')](_0x4056b3,'amd'));rpcDb[_0x4226('0x96')](_0x4056b3,_0x4226('0xea'));if(ut[_0x4226('0xa0')](_0x4056b3)>=_0x5bf578['dialGlobalMaxRetry']){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0xf,'Global');rpcDb[_0x4226('0x99')](_0x574100,_0x4226('0xea'));}else{rpcDb[_0x4226('0x99')](_0x4056b3,'[callProgressDetectingCustomer][machine]');}delete this[_0x4226('0x14')][_0x19c0cc['linkedid']];break;default:if(_0x4056b3['dialAnswer']){ut[_0x4226('0x80')](_0x5bf578,_0x4226('0xeb'));ut[_0x4226('0x82')](_0x4226('0xec')+_0x5bf578[_0x4226('0x29')],_0x19c0cc);}_0x5bf578[_0x4226('0x47')]+=0x1;_0x4056b3['countglobal']=ut['totalGlobal'](_0x4056b3);ut[_0x4226('0x91')](_0x4056b3,0xc,_0x19c0cc[_0x4226('0xe8')]||_0x19c0cc[_0x4226('0xe5')]);rpcDb[_0x4226('0x96')](_0x4056b3,_0x4226('0xed'));if(ut[_0x4226('0xa0')](_0x4056b3)>=_0x5bf578[_0x4226('0xc6')]){_0x574100=ut[_0x4226('0xa5')](_0x4056b3,0xf,_0x4226('0xa6'));rpcDb['createCustomerFinal'](_0x574100,_0x4226('0xee'));}else{rpcDb['createCustomerFinal'](_0x4056b3,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x4226('0x14')][_0x19c0cc['linkedid']];}if(!(_0x4056b3[_0x4226('0x7f')]&&_0x5dc77c==='16')){ut[_0x4226('0x7d')](_0x5bf578,_0x4226('0xef'));logger[_0x4226('0x5f')](_0x4226('0xf0'),_0x4056b3[_0x4226('0xb3')],_0x4226('0xb4'),_0x5bf578[_0x4226('0x29')],_0x4226('0x73'),_0x5bf578[_0x4226('0x61')]);}if(_0x5dc77c!==_0x4226('0xf1')){delete this['actions'][_0x19c0cc[_0x4226('0xae')]];delete this[_0x4226('0x14')][_0x19c0cc['destlinkedid']];}}};Preview[_0x4226('0xf')]['callProgressDetectingAgent']=function(_0x369b87,_0x5cccbe,_0x2752b8){if(_['isUndefined'](_0x5cccbe)&&'object'!==typeof _0x5cccbe){return;}if(_[_0x4226('0xf2')](_0x2752b8)&&'object'!==typeof _0x2752b8){return;}switch(_0x2752b8['reason']){case'0':ut[_0x4226('0xf3')](_0x369b87,0x0,_0x4226('0xa1'));rpcDb['createAgentHistory'](_0x369b87,_0x4226('0xf4'));break;case'3':ut[_0x4226('0xf3')](_0x369b87,0x3,_0x4226('0xf5'));rpcDb['createAgentHistory'](_0x369b87,_0x4226('0xf6'));break;case'5':ut['logAgent'](_0x369b87,0x5,_0x4226('0xc2'));rpcDb[_0x4226('0xf7')](_0x369b87,_0x4226('0xf8'));break;case'8':ut[_0x4226('0xf3')](_0x369b87,0x8,_0x4226('0xd2'));rpcDb[_0x4226('0xf7')](_0x369b87,_0x4226('0xf9'));break;case'22':ut['logAgent'](_0x369b87,0x16,'AnswerAGI');rpcDb[_0x4226('0xf7')](_0x369b87,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x4226('0xf3')](_0x369b87,0xc,_0x2752b8['reason']);rpcDb[_0x4226('0xf7')](_0x369b87,_0x4226('0xf9'));}ut[_0x4226('0x7d')](_0x5cccbe,'[callProgressDetectingAgent]');logger[_0x4226('0x5f')]('[originated][decrement][callProgressDetectingAgent]',_0x369b87[_0x4226('0xb3')],_0x4226('0xb4'),_0x5cccbe[_0x4226('0x29')],_0x4226('0x73'),_0x5cccbe[_0x4226('0x61')]);delete this[_0x4226('0x14')][_0x369b87[_0x4226('0xb3')]];};Preview['prototype']['checkInBlack']=function(_0x5c864e,_0x40bf8b,_0x3b91bb,_0x37abc2,_0x43e915){var _0x1bbbf2=this;return new BPromise(function(_0x3817ab,_0x536765){if(_[_0x4226('0x6f')](_0x40bf8b)||_['isNil'](_0x40bf8b['Contact'])||_[_0x4226('0x6f')](_0x40bf8b[_0x4226('0xfa')][_0x4226('0xfb')])||_[_0x4226('0x6f')](_0x40bf8b[_0x4226('0x76')])){_0x536765(ut[_0x4226('0x54')](_0x4226('0xfc'),_0x37abc2,_0x43e915));return;}var _0x100a85=uuid['v4']();var _0x336cd5=_0x1bbbf2[_0x4226('0x26')][_0x40bf8b[_0x4226('0x71')][_0x4226('0x29')]];var _0x3cea69=_0x3b91bb?_0x1bbbf2[_0x4226('0x15')][_0x3b91bb]['id']:undefined;_0x1bbbf2['actions'][_0x100a85]=new Action(_0x40bf8b,_0x336cd5,_0x100a85,_0x3b91bb,_0x3cea69);var _0x2630db=_0x1bbbf2[_0x4226('0x14')][_0x100a85];_0x2630db[_0x4226('0xac')]=_0x37abc2;_0x2630db['activeContact']=_0x43e915;_0x2630db['lookAgent']=_0x3b91bb;if(_['isEmpty'](_0x5c864e)){_0x1bbbf2[_0x4226('0xfd')](_0x2630db,_0x336cd5,_0x40bf8b,_0x3b91bb)['then'](function(_0x5d0d35){logger[_0x4226('0x5f')](_0x4226('0xfe'),_0x4226('0xff')+_0x2630db[_0x4226('0x72')]+'\x20IdHopper:\x20'+_0x2630db['idContact'],JSON['stringify'](_0x5d0d35));ami[_0x4226('0x27')]('custom:agentcalled',ut['buildObj'](_0x2630db,_0x4226('0x100'),_0x1bbbf2[_0x4226('0x26')][_0x2630db[_0x4226('0x72')]]));_0x3817ab(ut['message'](_0x4226('0x101')));})[_0x4226('0x7b')](function(_0x3f5335){ut[_0x4226('0x64')](_0x4226('0x102'),_0x3f5335);_0x536765(ut[_0x4226('0x54')](_0x4226('0x103'),_0x37abc2,_0x43e915));});}else{_0x336cd5['outboundBlacklistCallsDay']+=0x1;ut[_0x4226('0x104')](_0x2630db);rpcDb[_0x4226('0x105')](_0x2630db,_0x4226('0x106'));delete _0x1bbbf2[_0x4226('0x14')][_0x100a85];_0x536765(ut[_0x4226('0x54')](_0x4226('0x107'),_0x37abc2,_0x43e915));}});};Preview[_0x4226('0xf')][_0x4226('0x9c')]=function(_0x352c40){return!_[_0x4226('0x6f')](_0x352c40)&&!_[_0x4226('0x6f')](_0x352c40['name'])&&!_[_0x4226('0x6f')](_0x352c40['active'])&&_0x352c40[_0x4226('0x108')]&&!_[_0x4226('0x6f')](this[_0x4226('0x13')][util['format']('SIP/%s',_0x352c40[_0x4226('0x29')])])&&!_['isNil'](this[_0x4226('0x13')][util[_0x4226('0x5c')](_0x4226('0x109'),_0x352c40[_0x4226('0x29')])]['status'])&&(this[_0x4226('0x13')][util[_0x4226('0x5c')](_0x4226('0x109'),_0x352c40['name'])]['status']===_0x4226('0x10a')||this[_0x4226('0x13')][util['format'](_0x4226('0x109'),_0x352c40[_0x4226('0x29')])][_0x4226('0x79')]===_0x4226('0x10b'));};Preview[_0x4226('0xf')][_0x4226('0x10c')]=function(_0x3efe43,_0x5ae325){var _0x4cddfc=this;return new BPromise(function(_0x441bcf,_0x25c321){_0x4cddfc[_0x4226('0x10d')](_0x3efe43,_0x5ae325)[_0x4226('0x87')](function(_0x4a966c){_0x441bcf(_['pick'](_0x4a966c,[_0x4226('0x54')]));})['catch'](function(_0x133209){if(_0x133209[_0x4226('0x10e')]){rpcDb[_0x4226('0x10f')](_0x3efe43);}if(_0x133209['active']){rpcDb['disableContact'](_0x3efe43);}_0x25c321(_[_0x4226('0x110')](_0x133209,['message']));});});};Preview[_0x4226('0xf')]['execRun']=function(_0x27fdc2,_0x319c83){var _0x3be726=this;return new BPromise(function(_0x4356ad,_0x23cd33){var _0x49f6a0,_0x1c1f98;rpcDb[_0x4226('0x111')](_0x27fdc2)[_0x4226('0x87')](function(_0x38cd03){if(!_[_0x4226('0x6f')](_0x38cd03[0x0])){_0x1c1f98=_0x38cd03[0x0]['recallme']?![]:!![];_0x49f6a0=_0x38cd03[0x0][_0x4226('0x112')]?!![]:![];_0x49f6a0=_0x319c83?!![]:_0x49f6a0;}var _0x3f67f4=_0x3be726[_0x4226('0x113')](_0x38cd03);if(_0x3f67f4[_0x4226('0x114')]){rpcDb[_0x4226('0x115')](_[_0x4226('0x110')](_0x38cd03[0x0],['VoiceQueueId',_0x4226('0x116')]))['then'](function(_0x48e8e7){_0x3be726[_0x4226('0x117')](_0x48e8e7,_0x38cd03[0x0],_0x319c83,_0x1c1f98,_0x49f6a0)[_0x4226('0x87')](function(_0x59d1f0){_0x4356ad(_0x59d1f0);})[_0x4226('0x7b')](function(_0x561197){_0x23cd33(_0x561197);});})[_0x4226('0x7b')](function(_0xb3c265){ut[_0x4226('0x64')](_0x4226('0x118'),_0xb3c265);_0x23cd33(ut[_0x4226('0x54')](_0x4226('0x119'),_0x1c1f98,_0x49f6a0));});}else{_0x23cd33(ut[_0x4226('0x54')](_0x3f67f4[_0x4226('0x54')],_0x1c1f98,_0x49f6a0));}})[_0x4226('0x7b')](function(_0x4722e3){ut[_0x4226('0x64')](_0x4226('0x11a'),_0x4722e3);_0x23cd33(ut[_0x4226('0x54')](_0x4226('0x119'),![],!![]));});});};Preview[_0x4226('0xf')]['validateContact']=function(_0x1780ea){if(_[_0x4226('0x6f')](_0x1780ea)||_['isEmpty'](_0x1780ea)||!_[_0x4226('0x6f')](_0x1780ea[0x0][_0x4226('0x8c')])&&_['isNil'](_0x1780ea[0x0][_0x4226('0x8c')][_0x4226('0x29')])){ut['logger'](_0x4226('0x11b'),_0x1780ea);return{'isValid':![],'message':_0x4226('0x11c')};}var _0x1647c1=this[_0x4226('0x26')][_0x1780ea[0x0]['Queue'][_0x4226('0x29')]];_0x1647c1['message']=_0x4226('0x11d');if(_[_0x4226('0x6f')](_0x1647c1)){ut[_0x4226('0x64')](_0x4226('0x11e'),_0x1647c1);return{'isValid':![],'message':_0x4226('0x11f')};}if(!this[_0x4226('0x9c')](_0x1647c1['Trunk'])){ut[_0x4226('0x64')](_0x4226('0x120'),_0x4226('0x121')+_0x1647c1[_0x4226('0x29')]+_0x4226('0x122'));if(!this[_0x4226('0x9c')](_0x1647c1['TrunkBackup'])){ut[_0x4226('0x64')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x1647c1[_0x4226('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x4226('0x123')};}}if(!ut[_0x4226('0x124')](_0x1647c1[_0x4226('0x37')])){ut[_0x4226('0x64')](_0x4226('0x125'),_0x1647c1[_0x4226('0x29')]+_0x4226('0x126'));return{'isValid':![],'message':_0x4226('0x121')+_0x1647c1[_0x4226('0x29')]+_0x4226('0x126')};}return{'isValid':!![],'message':_0x4226('0x127')};};Preview[_0x4226('0xf')][_0x4226('0xfd')]=function(_0x26a903,_0xbab7f0,_0xf3da47,_0x1e7de5){var _0x40421b=this;return new BPromise(function(_0x5671c4,_0x32c01e){var _0x482618=_0x26a903[_0x4226('0xb3')];var _0xeb875d=_0x40421b[_0x4226('0x9c')](_0xbab7f0[_0x4226('0x58')])?util[_0x4226('0x5c')](_0x4226('0x128'),_0xbab7f0[_0x4226('0x58')]['name'],_[_0x4226('0x6f')](_0xbab7f0[_0x4226('0x3c')])?'':_0xbab7f0['dialPrefix'][_0x4226('0x129')]()||'',_0xbab7f0[_0x4226('0x12a')]>0x0?_0xf3da47[_0x4226('0xfa')][_0x4226('0xfb')][_0x4226('0x12b')](_0xbab7f0[_0x4226('0x12a')]):_0xf3da47[_0x4226('0xfa')][_0x4226('0xfb')]):util['format'](_0x4226('0x128'),_[_0x4226('0x6f')](_0xbab7f0['TrunkBackup'])?_0xbab7f0[_0x4226('0x58')][_0x4226('0x29')]:_0xbab7f0[_0x4226('0x12c')][_0x4226('0x29')],_[_0x4226('0x6f')](_0xbab7f0[_0x4226('0x3c')])?'':_0xbab7f0[_0x4226('0x3c')][_0x4226('0x129')]()||'',_0xbab7f0[_0x4226('0x12a')]>0x0?_0xf3da47[_0x4226('0xfa')][_0x4226('0xfb')][_0x4226('0x12b')](_0xbab7f0[_0x4226('0x12a')]):_0xf3da47[_0x4226('0xfa')]['phone']);var _0x2e41b5=_0x40421b['isTrunkReachable'](_0xbab7f0[_0x4226('0x58')])?ut[_0x4226('0x12d')](_0xbab7f0['Trunk'][_0x4226('0x59')],_0xbab7f0[_0x4226('0x39')],_0xbab7f0['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x4226('0x12e')](_0xbab7f0[_0x4226('0x3a')],_0xbab7f0[_0x4226('0x12f')]):_0xbab7f0[_0x4226('0x3a')]):ut[_0x4226('0x12d')](_['isNil'](_0xbab7f0['TrunkBackup'])?_0xbab7f0[_0x4226('0x58')]['callerid']:_0xbab7f0[_0x4226('0x12c')][_0x4226('0x59')],_0xbab7f0[_0x4226('0x39')],_0xbab7f0[_0x4226('0x12f')]>0x0?ut['getCallerIdRandom'](_0xbab7f0[_0x4226('0x3a')],_0xbab7f0[_0x4226('0x12f')]):_0xbab7f0[_0x4226('0x3a')]);if(_0x2e41b5){_0x26a903['originatecalleridname']=ut[_0x4226('0x130')](_0x2e41b5);_0x26a903['originatecalleridnum']=ut[_0x4226('0x131')](_0x2e41b5);}var _0x115df4=ut[_0x4226('0x132')](_0xbab7f0,_0xf3da47,_0xeb875d,_0x2e41b5,_0x482618,_0x26a903);_['merge'](_0x26a903,ut[_0x4226('0x133')](_0x115df4));_0x26a903[_0x4226('0x90')]=moment()[_0x4226('0x5c')](_0x4226('0xaf'));ami['Action'](ut[_0x4226('0x134')](_0x26a903,_0xbab7f0,_0x115df4,_0x26a903[_0x4226('0xad')],_0x1e7de5))[_0x4226('0x87')](function(_0x156c7d){_0xbab7f0['originated']+=0x1;logger[_0x4226('0x5f')]('[originated][increment]',_0x482618,_0x4226('0xb4'),_0xbab7f0[_0x4226('0x29')],_0x4226('0x73'),_0xbab7f0['originated']);_0x5671c4(_0x156c7d);})[_0x4226('0x7b')](function(_0x313e21){ut[_0x4226('0xf3')](_0x26a903,0xe,_0x4226('0x135'));rpcDb[_0x4226('0xf7')](_0x26a903,_0x4226('0x136'));_0x32c01e(_0x313e21);});});};Preview[_0x4226('0xf')][_0x4226('0x1f')]=function(_0x3ae976){if(this[_0x4226('0x14')][_0x3ae976[_0x4226('0xae')]]){this[_0x4226('0x14')][_0x3ae976[_0x4226('0xae')]]['channel']=_0x3ae976[_0x4226('0x7a')];}};Preview['prototype'][_0x4226('0x18')]=function(_0x1f2342){var _0x9ac5d=this;var _0x226774=this[_0x4226('0x14')][_0x1f2342['actionid']];if(_0x226774){if(_0x226774['lookAgent']&&this[_0x4226('0x15')][_0x226774[_0x4226('0x137')]]){ut[_0x4226('0x138')](_0x226774,this['agents'][_0x226774[_0x4226('0x137')]]['name'],this['agents'][_0x226774[_0x4226('0x137')]]['id']);}var _0x51b8eb=_['clone'](_0x226774);_0x51b8eb['responsetime']=moment()[_0x4226('0x5c')](_0x4226('0xaf'));var _0x3dc7e2=_0x9ac5d[_0x4226('0x26')][_0x226774[_0x4226('0x72')]];if(ut[_0x4226('0x139')](_0x1f2342['response'])){if(_0x226774[_0x4226('0xac')]){rpcDb[_0x4226('0x10f')](_0x226774[_0x4226('0x13a')]);}if(_0x226774['activeContact']){rpcDb[_0x4226('0x8f')](_0x226774['idContact']);}ami[_0x4226('0x27')](_0x4226('0x13b'),ut['buildObj'](_0x226774,_0x4226('0x13c'),this['campaignsPreview'][_0x226774[_0x4226('0x72')]]));this[_0x4226('0x13d')](_0x51b8eb,_0x3dc7e2,_0x1f2342);}else{_0x226774['starttime']=moment()[_0x4226('0x5c')](_0x4226('0xaf'));ut[_0x4226('0xf3')](_0x51b8eb,0x4,_0x4226('0xbc'));rpcDb['createAgentHistory'](_0x51b8eb,_0x4226('0x13e'));}}};Preview[_0x4226('0xf')][_0x4226('0x1a')]=function(_0xf2753d){var _0x46b3af=this;var _0x23d60d=this[_0x4226('0x14')][_0xf2753d[_0x4226('0xae')]];var _0x1c7a51;if(_0x23d60d){_0x1c7a51=this['campaignsPreview'][_0x23d60d[_0x4226('0x72')]];logger[_0x4226('0x5f')](_0x4226('0x13f'),_0xf2753d[_0x4226('0xae')],_0x4226('0xb4'),_0x1c7a51[_0x4226('0x29')],'pTalking:\x20',_0x1c7a51['pTalking']);}if(this[_0x4226('0x14')][_0xf2753d['linkedid']]&&_0xf2753d[_0x4226('0xae')]!==_0xf2753d[_0x4226('0xb3')]){if(_0xf2753d[_0x4226('0x140')]==='16'&&this['actions'][_0xf2753d['linkedid']][_0x4226('0x7f')]){this['callProgressDetectingCustomer'](_0xf2753d,_0xf2753d[_0x4226('0xae')],_0xf2753d[_0x4226('0x140')]);}else if(this[_0x4226('0x14')][_0xf2753d['linkedid']][_0x4226('0x7f')]){logger['info']('[syncHangup][talking][cause]',_0xf2753d[_0x4226('0xae')],_0xf2753d[_0x4226('0x140')],'\x20Queue',_0x1c7a51[_0x4226('0x29')],_0x4226('0x74'),_0x1c7a51['pTalking']);this['callProgressDetectingCustomer'](_0xf2753d,_0xf2753d[_0x4226('0xae')],_0xf2753d[_0x4226('0x140')]);}}else if(_0x23d60d&&_[_0x4226('0x6f')](_0x23d60d[_0x4226('0x141')])&&_0x1c7a51[_0x4226('0x142')]&&_0xf2753d[_0x4226('0xae')]===_0xf2753d[_0x4226('0xb3')]&&_[_0x4226('0x6f')](_0xf2753d['reason'])&&_0xf2753d[_0x4226('0x140')]==='16'&&_0xf2753d[_0x4226('0x143')]==='6'&&_[_0x4226('0xf2')](_0x23d60d[_0x4226('0x144')])){if(_0x23d60d['unlockAgent']){rpcDb['unlockContact'](_0x23d60d[_0x4226('0x13a')]);}if(_0x23d60d[_0x4226('0xad')]){rpcDb[_0x4226('0x8f')](_0x23d60d[_0x4226('0x13a')]);}_0xf2753d[_0x4226('0x145')]='22';this[_0x4226('0x13d')](_0x23d60d,_0x1c7a51,_0xf2753d);}else if(_0x23d60d&&_0x23d60d[_0x4226('0x144')]){if(_0xf2753d['cause']==='16'&&this[_0x4226('0x14')][_0xf2753d['linkedid']][_0x4226('0x7f')]){logger[_0x4226('0x5f')]('[syncHangup][talking][transfer]',_0xf2753d['linkedid'],_0xf2753d[_0x4226('0x140')],'\x20Queue',_0x1c7a51[_0x4226('0x29')],_0x4226('0x74'),_0x1c7a51[_0x4226('0x2d')]);this['callProgressDetectingCustomer'](_0xf2753d,_0xf2753d[_0x4226('0xae')],_0xf2753d[_0x4226('0x140')]);}else if(this[_0x4226('0x14')][_0xf2753d['linkedid']]['dialAnswer']){logger[_0x4226('0x5f')]('[syncHangup][talking][cause]',_0xf2753d['linkedid'],_0xf2753d[_0x4226('0x140')],'\x20Queue',_0x1c7a51[_0x4226('0x29')],'pTalking:\x20',_0x1c7a51[_0x4226('0x2d')]);this[_0x4226('0x146')](_0xf2753d,_0xf2753d[_0x4226('0xae')],_0xf2753d['cause']);}}};Preview[_0x4226('0xf')][_0x4226('0x147')]=function(_0x9ed45a){if(this[_0x4226('0x14')][_0x9ed45a[_0x4226('0x148')]]&&_0x9ed45a[_0x4226('0x148')]!==_0x9ed45a['destuniqueid']){this['callProgressDetectingCustomer'](_0x9ed45a,_0x9ed45a[_0x4226('0x148')],_0x9ed45a[_0x4226('0xe5')]);}};Preview['prototype']['syncHangupRequest']=function(_0x67c6c9){if(this[_0x4226('0x14')][_0x67c6c9['linkedid']]&&_0x67c6c9['linkedid']!==_0x67c6c9['uniqueid']&&!this[_0x4226('0x14')][_0x67c6c9[_0x4226('0xae')]][_0x4226('0x7f')]){if(_0x67c6c9[_0x4226('0x140')]==='1'){this[_0x4226('0x146')](_0x67c6c9,_0x67c6c9[_0x4226('0xae')],_0x67c6c9[_0x4226('0x140')]);}}};Preview['prototype'][_0x4226('0x149')]=function(_0x35c91f,_0x582a22,_0x497544){if(this[_0x4226('0x14')][_0x35c91f]){if(_[_0x4226('0x6f')](this[_0x4226('0x14')][_0x35c91f][_0x4226('0x14a')])){this['actions'][_0x35c91f][_0x4226('0x14a')]={};}this[_0x4226('0x14')][_0x35c91f]['variables'][_0x582a22]=_0x497544;}};Preview[_0x4226('0xf')][_0x4226('0x14b')]=function(_0x544921){try{if(!_['isNil'](_0x544921)){if(ut[_0x4226('0x14c')](_[_0x4226('0x14d')](_0x544921[_0x4226('0x14e')])[0x0])){this[_0x4226('0x149')](_0x544921[_0x4226('0xb3')],_['keys'](_0x544921['variable'])[0x0],_0x544921['value']);}}}catch(_0x38e882){logger[_0x4226('0x14f')](_0x4226('0x150'),util[_0x4226('0x151')](_0x38e882,{'showHidden':![],'depth':null}));}};Preview[_0x4226('0xf')][_0x4226('0x22')]=function(_0x13f63c){if(_0x13f63c){if(this[_0x4226('0x14')][_0x13f63c['transfertargetlinkedid']]){this[_0x4226('0x14')][_0x13f63c['transfertargetlinkedid']][_0x4226('0x144')]=!![];}}};Preview[_0x4226('0xf')][_0x4226('0x24')]=function(_0x4d3f5e){if(_0x4d3f5e){if(this['actions'][_0x4d3f5e[_0x4226('0x152')]]){this[_0x4226('0x14')][_0x4d3f5e[_0x4226('0x152')]][_0x4226('0x144')]=!![];}}};module[_0x4226('0x153')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d72eae2..baa0580 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 _0x6487=['assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','exten','xcally-motion-preview','holdtime'];(function(_0x37940c,_0x10ccc5){var _0x58fe29=function(_0x20c2d1){while(--_0x20c2d1){_0x37940c['push'](_0x37940c['shift']());}};_0x58fe29(++_0x10ccc5);}(_0x6487,0x191));var _0x7648=function(_0x415364,_0x3281db){_0x415364=_0x415364-0x0;var _0x42e147=_0x6487[_0x415364];return _0x42e147;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x7648('0x0'))(_0x7648('0x1'));var _=require(_0x7648('0x2'));var cmHopper=require(_0x7648('0x3'));var cmHopperFinal=require(_0x7648('0x4'));var cmHopperHistory=require(_0x7648('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7648('0x6'));var agentReportPreview=require(_0x7648('0x7'));var voiceQueueReport=require(_0x7648('0x8'));function loggerCatch(_0x2ed423){return function(_0x1628df){logger[_0x7648('0x9')](_0x2ed423,util['inspect'](_0x1628df,{'showHidden':![],'depth':null}));};}function create(_0x4ba1cd){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopperHistory['createHistory'](_0x4ba1cd))[_0x7648('0xc')](loggerCatch(_0x7648('0xd')));}function createAgent(_0x52a08e){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](agentReportPreview['createHistory'](_0x52a08e))[_0x7648('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x570e5a){return BPromise[_0x7648('0xa')]()['then'](cmHopper[_0x7648('0xe')](_0x570e5a,!![]))['catch'](loggerCatch(_0x7648('0xf')));}exports[_0x7648('0x10')]=function(_0x2470c4){return BPromise['resolve']()[_0x7648('0xb')](cmHopperBlack[_0x7648('0x10')](_0x2470c4))['catch'](loggerCatch(_0x7648('0x11')));};exports['getContactPreview']=function(_0xd60a47){return BPromise[_0x7648('0xa')]()['then'](cmHopper[_0x7648('0x12')](_0xd60a47))[_0x7648('0xc')](loggerCatch(_0x7648('0x13')));};exports[_0x7648('0x14')]=function(_0x3cfc8d,_0x400cea){create(_0x3cfc8d)['catch'](loggerCatch(_0x400cea));moveContact(_0x3cfc8d)[_0x7648('0xc')](loggerCatch(_0x400cea));};exports['createAgentHistory']=function(_0x2d08c9,_0x67f468){createAgent(_0x2d08c9)[_0x7648('0xc')](loggerCatch(_0x67f468));};exports['createCustomerHistory']=function(_0x119e84,_0x256e40){create(_0x119e84)[_0x7648('0xc')](loggerCatch(_0x256e40));};exports[_0x7648('0x15')]=function(_0x148897,_0x184353){moveContact(_0x148897)[_0x7648('0xc')](loggerCatch(_0x184353));};exports[_0x7648('0x16')]=function(_0xf39cf6,_0xf5974b,_0x1d69e9){if(_0xf5974b){_0xf39cf6[_0x7648('0x17')]=null;}if(_0x1d69e9){_0xf39cf6[_0x7648('0x18')]=![];}return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper[_0x7648('0x16')](_0xf39cf6))[_0x7648('0xc')](loggerCatch(_0x7648('0x19')));};exports[_0x7648('0x1a')]=function(_0x9c0bc2){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper['countReScheduled'](_0x9c0bc2))['catch'](loggerCatch(_0x7648('0x1b')));};exports[_0x7648('0x1c')]=function(_0x3104fc){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper[_0x7648('0x1c')]({'UserId':null},_0x3104fc,0x1))[_0x7648('0xc')](loggerCatch(_0x7648('0x1d')));};exports[_0x7648('0x1e')]=function(_0x24bfc3){return BPromise['resolve']()[_0x7648('0xb')](cmHopper['unlockContact']({'active':![]},_0x24bfc3,0x1))['catch'](loggerCatch(_0x7648('0x1f')));};exports['crateCustomerReportQueue']=function(_0x2014bf){var _0x3ebf25={};_0x3ebf25[_0x7648('0x20')]=_0x2014bf['type'];_0x3ebf25[_0x7648('0x21')]=_0x2014bf[_0x7648('0x21')];_0x3ebf25[_0x7648('0x22')]=_0x2014bf['calleridnum'];_0x3ebf25['calleridname']=_0x2014bf[_0x7648('0x23')];_0x3ebf25[_0x7648('0x24')]=_0x2014bf[_0x7648('0x24')];_0x3ebf25[_0x7648('0x25')]=_0x2014bf[_0x7648('0x26')];_0x3ebf25['queuecallerleaveAt']=_0x2014bf[_0x7648('0x26')];_0x3ebf25[_0x7648('0x27')]=0x1;_0x3ebf25[_0x7648('0x28')]=_0x2014bf[_0x7648('0x29')];_0x3ebf25[_0x7648('0x2a')]=_0x2014bf['membername'];_0x3ebf25['context']=_0x7648('0x2b');_0x3ebf25[_0x7648('0x2c')]=_0x7648('0x2d');_0x3ebf25[_0x7648('0x2e')]=0x0;_0x3ebf25[_0x7648('0x2f')]=0x1;_0x3ebf25[_0x7648('0x30')]=_0x2014bf[_0x7648('0x31')];_0x3ebf25[_0x7648('0x32')]=_0x7648('0x33');return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](voiceQueueReport[_0x7648('0x34')](_0x3ebf25))[_0x7648('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x7648('0x35')]=function(_0x33b514,_0x568124){return BPromise['resolve']()[_0x7648('0xb')](cmHopper[_0x7648('0x35')](_0x33b514,_0x568124))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x7648('0x36')]=function(_0x2400e1){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper[_0x7648('0x16')](_0x2400e1,!![],!![]))[_0x7648('0xc')](loggerCatch(_0x7648('0x37')));}; \ No newline at end of file +var _0x7a72=['queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','createHistory','[createHistory]\x20','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo'];(function(_0x1aa7f1,_0xe9c63){var _0x4373ff=function(_0x1dfd88){while(--_0x1dfd88){_0x1aa7f1['push'](_0x1aa7f1['shift']());}};_0x4373ff(++_0xe9c63);}(_0x7a72,0x1d6));var _0x27a7=function(_0xdd504b,_0xe4878){_0xdd504b=_0xdd504b-0x0;var _0x5c84a9=_0x7a72[_0xdd504b];return _0x5c84a9;};'use strict';var util=require(_0x27a7('0x0'));var BPromise=require(_0x27a7('0x1'));var logger=require(_0x27a7('0x2'))('preview');var _=require(_0x27a7('0x3'));var cmHopper=require(_0x27a7('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x27a7('0x5'));var cmHopperBlack=require(_0x27a7('0x6'));var voiceQueueRt=require(_0x27a7('0x7'));var agentReportPreview=require(_0x27a7('0x8'));var voiceQueueReport=require(_0x27a7('0x9'));function loggerCatch(_0x58f475){return function(_0x1bf366){logger[_0x27a7('0xa')](_0x58f475,util['inspect'](_0x1bf366,{'showHidden':![],'depth':null}));};}function create(_0x394f38){return BPromise[_0x27a7('0xb')]()['then'](cmHopperHistory[_0x27a7('0xc')](_0x394f38))['catch'](loggerCatch(_0x27a7('0xd')));}function createAgent(_0x185ec3){return BPromise[_0x27a7('0xb')]()[_0x27a7('0xe')](agentReportPreview['createHistory'](_0x185ec3))[_0x27a7('0xf')](loggerCatch(_0x27a7('0xd')));}function moveContact(_0x232119){return BPromise[_0x27a7('0xb')]()['then'](cmHopper[_0x27a7('0x10')](_0x232119,!![]))[_0x27a7('0xf')](loggerCatch(_0x27a7('0x11')));}exports[_0x27a7('0x12')]=function(_0x9f284b){return BPromise[_0x27a7('0xb')]()[_0x27a7('0xe')](cmHopperBlack[_0x27a7('0x12')](_0x9f284b))[_0x27a7('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x27a7('0x13')]=function(_0x137c2a){return BPromise[_0x27a7('0xb')]()[_0x27a7('0xe')](cmHopper[_0x27a7('0x13')](_0x137c2a))['catch'](loggerCatch(_0x27a7('0x14')));};exports[_0x27a7('0xc')]=function(_0xff2172,_0x6ecb6a){create(_0xff2172)[_0x27a7('0xf')](loggerCatch(_0x6ecb6a));moveContact(_0xff2172)[_0x27a7('0xf')](loggerCatch(_0x6ecb6a));};exports[_0x27a7('0x15')]=function(_0x4f9600,_0x5f3d1b){createAgent(_0x4f9600)[_0x27a7('0xf')](loggerCatch(_0x5f3d1b));};exports[_0x27a7('0x16')]=function(_0x27c169,_0x4ce467){create(_0x27c169)[_0x27a7('0xf')](loggerCatch(_0x4ce467));};exports[_0x27a7('0x17')]=function(_0x262570,_0x1cd356){moveContact(_0x262570)[_0x27a7('0xf')](loggerCatch(_0x1cd356));};exports[_0x27a7('0x18')]=function(_0x1ce5dc,_0x4a04be,_0x5dfae2){if(_0x4a04be){_0x1ce5dc[_0x27a7('0x19')]=null;}if(_0x5dfae2){_0x1ce5dc[_0x27a7('0x1a')]=![];}return BPromise[_0x27a7('0xb')]()[_0x27a7('0xe')](cmHopper[_0x27a7('0x18')](_0x1ce5dc))[_0x27a7('0xf')](loggerCatch(_0x27a7('0x1b')));};exports['countReScheduled']=function(_0x33c11e){return BPromise['resolve']()[_0x27a7('0xe')](cmHopper[_0x27a7('0x1c')](_0x33c11e))[_0x27a7('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0x27a7('0x1d')]=function(_0x107298){return BPromise[_0x27a7('0xb')]()[_0x27a7('0xe')](cmHopper[_0x27a7('0x1d')]({'UserId':null},_0x107298,0x1))[_0x27a7('0xf')](loggerCatch(_0x27a7('0x1e')));};exports[_0x27a7('0x1f')]=function(_0x271c69){return BPromise['resolve']()[_0x27a7('0xe')](cmHopper[_0x27a7('0x1d')]({'active':![]},_0x271c69,0x1))[_0x27a7('0xf')](loggerCatch(_0x27a7('0x20')));};exports[_0x27a7('0x21')]=function(_0x405a31){var _0x34d519={};_0x34d519['type']=_0x405a31[_0x27a7('0x22')];_0x34d519['uniqueid']=_0x405a31[_0x27a7('0x23')];_0x34d519[_0x27a7('0x24')]=_0x405a31[_0x27a7('0x24')];_0x34d519[_0x27a7('0x25')]=_0x405a31[_0x27a7('0x25')];_0x34d519[_0x27a7('0x26')]=_0x405a31[_0x27a7('0x26')];_0x34d519[_0x27a7('0x27')]=_0x405a31['answertime'];_0x34d519[_0x27a7('0x28')]=_0x405a31[_0x27a7('0x29')];_0x34d519[_0x27a7('0x2a')]=0x1;_0x34d519[_0x27a7('0x2b')]=_0x405a31[_0x27a7('0x2c')];_0x34d519[_0x27a7('0x2d')]=_0x405a31['membername'];_0x34d519[_0x27a7('0x2e')]='from-sip';_0x34d519[_0x27a7('0x2f')]=_0x27a7('0x30');_0x34d519[_0x27a7('0x31')]=0x0;_0x34d519[_0x27a7('0x32')]=0x1;_0x34d519[_0x27a7('0x33')]=_0x405a31['membername'];_0x34d519[_0x27a7('0x34')]=_0x27a7('0x35');return BPromise[_0x27a7('0xb')]()[_0x27a7('0xe')](voiceQueueReport['create'](_0x34d519))[_0x27a7('0xf')](loggerCatch(_0x27a7('0x36')));};exports[_0x27a7('0x37')]=function(_0x1c0bf5,_0x5eaed5){return BPromise['resolve']()[_0x27a7('0xe')](cmHopper['getContactRecallMe'](_0x1c0bf5,_0x5eaed5))[_0x27a7('0xf')](loggerCatch(_0x27a7('0x38')));};exports['rescheduleContactInQueue']=function(_0x5ac82c){return BPromise[_0x27a7('0xb')]()[_0x27a7('0xe')](cmHopper['rescheduleContact'](_0x5ac82c,!![],!![]))['catch'](loggerCatch(_0x27a7('0x39')));}; \ 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 7ceec1e..6162b18 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 _0x6601=['active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','interface','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','createBody','idContact','type','campaigntype','dialAnswer','callback','recallme','UserId','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','diff','seconds','loggerCatch','error','inspect','logger','info','message','isUndefined','string','isEmpty','format','isActive','isNil','Queue','name','\x22%s\x22\x20<%s>','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','starttime','responsetime','endtime','logAgent','state','statedesc','ringtime','logLookAgent','membername','logCustomer','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','cloneAction','clone','scheduledAt'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6601,0x158));var _0x1660=function(_0x71a7e6,_0x5f5cef){_0x71a7e6=_0x71a7e6-0x0;var _0x39cf2d=_0x6601[_0x71a7e6];return _0x39cf2d;};'use strict';var util=require(_0x1660('0x0'));var _=require(_0x1660('0x1'));var moment=require(_0x1660('0x2'));var logger=require(_0x1660('0x3'))(_0x1660('0x4'));var ipAgi=process[_0x1660('0x5')][_0x1660('0x6')]||'127.0.0.1';function getSeconds(_0x2881bd,_0x4ab274){var _0x59a58c=moment(_0x2881bd)['milliseconds'](0x0);var _0x4a679b=moment(_0x4ab274)['milliseconds'](0x0);return _0x59a58c[_0x1660('0x7')](_0x4a679b,_0x1660('0x8'));}exports[_0x1660('0x9')]=function(_0x478171){return function(_0x840ae8){logger[_0x1660('0xa')](_0x478171,util[_0x1660('0xb')](_0x840ae8,{'showHidden':![],'depth':null}));};};exports[_0x1660('0xc')]=function(_0x224ae2,_0x224646){logger[_0x1660('0xd')](_0x224ae2,util[_0x1660('0xb')](_0x224646,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0xd62264,_0xbdbecd){logger[_0x1660('0xa')](_0xd62264,util[_0x1660('0xb')](_0xbdbecd,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3a0c6e){return function(_0x563828){logger['info'](_0x3a0c6e,util[_0x1660('0xb')](_0x563828,{'showHidden':![],'depth':null}));};};exports[_0x1660('0xe')]=function(_0x4e3809,_0x17ac69,_0xd23eb0){return{'message':_0x4e3809,'unlock':_0x17ac69,'active':_0xd23eb0};};exports['getCallerId']=function(_0x41b439,_0x503366,_0x421b1f){if(!_[_0x1660('0xf')](_0x421b1f)&&_0x1660('0x10')===typeof _0x421b1f&&!_[_0x1660('0x11')](_0x421b1f)){if(!_[_0x1660('0xf')](_0x503366)&&'string'===typeof _0x503366&&!_['isEmpty'](_0x503366)){return util[_0x1660('0x12')]('\x22%s\x22\x20<%s>',_0x503366,_0x421b1f);}return util['format']('\x22%s\x22\x20<%s>',_0x421b1f,_0x421b1f);}if(!_[_0x1660('0xf')](_0x41b439)&&_0x1660('0x10')===typeof _0x41b439&&!_[_0x1660('0x11')](_0x41b439)){return _0x41b439;}return'\x22\x22\x20<>';};exports[_0x1660('0x13')]=function(_0x187868){if(_[_0x1660('0x14')](_0x187868)){return![];}return _0x187868;};exports['addVariables']=function(_0x5691f1,_0x2f4dae,_0x35ba37,_0x416e91,_0x3e5e4a,_0x2915b3){var _0x451f63={'XMD-QUEUE':_0x2f4dae[_0x1660('0x15')]?_0x2f4dae[_0x1660('0x15')][_0x1660('0x16')]:'','XMD-CALLERID':_0x416e91,'XMD-CALLERID-PREVIEW':_0x2915b3?util[_0x1660('0x12')](_0x1660('0x17'),_0x2915b3['calleridname'],_0x2915b3[_0x1660('0x18')]):_0x416e91,'XMD-DIALID':_0x3e5e4a,'XMD-CONTACTID':_0x2f4dae['ContactId'],'XMD-CDRTYPE':_0x1660('0x19'),'CALLERID(all)':_0x416e91,'XMD-VOICEQUEUEID':_0x2f4dae[_0x1660('0x1a')],'XMD-DIALCHANNEL':_0x35ba37,'XMD-DIALTIMEOUT':_0x5691f1[_0x1660('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x1660('0x12')](_0x1660('0x1c'),_0x5691f1[_0x1660('0x1d')]?'g':'',_[_0x1660('0x11')](_0x5691f1[_0x1660('0x1e')])?'':_0x1660('0x1f')),'XMD-DIALURL':_0x5691f1[_0x1660('0x20')]||'','XMD-AGI':_0x5691f1['dialQueueProject']?util[_0x1660('0x12')](_0x1660('0x21'),ipAgi,_0x5691f1[_0x1660('0x22')]):_0x1660('0x23'),'XMD-AGIAFTER':_0x5691f1['dialQueueProject2']?util[_0x1660('0x12')](_0x1660('0x21'),ipAgi,_0x5691f1[_0x1660('0x1d')]):_0x1660('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x2915b3?_0x2915b3[_0x1660('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x2915b3?_0x2915b3[_0x1660('0x25')]:'','XMD-DESTINATION':_0x1660('0x26')};if(!_['isEmpty'](_0x5691f1[_0x1660('0x1e')])){_0x451f63[util[_0x1660('0x12')]('%s',_0x1660('0x27'))]=_0x5691f1[_0x1660('0x1e')];_0x451f63[util[_0x1660('0x12')]('%s',_0x1660('0x28'))]=_0x3e5e4a;}if(_0x2f4dae&&_0x2f4dae[_0x1660('0x29')]){for(var _0xf2b6ac in _0x2f4dae[_0x1660('0x29')]){if(_0x2f4dae['Contact'][_0x1660('0x2a')](_0xf2b6ac)){if(!_[_0x1660('0x14')](_0x2f4dae[_0x1660('0x29')][_0xf2b6ac])&&_0xf2b6ac!=='id'&&_0xf2b6ac!==_0x1660('0x2b')&&_0xf2b6ac!==_0x1660('0x2c')&&_0xf2b6ac!==_0x1660('0x2d')){_0x451f63[util[_0x1660('0x12')](_0x1660('0x2e'),'XMD-',_[_0x1660('0x2f')](_0xf2b6ac))]=_0x2f4dae[_0x1660('0x29')][_0xf2b6ac];}}}}return _0x451f63;};exports[_0x1660('0x30')]=function(_0x58f560){var _0x10921b={};for(var _0x402dd4 in _0x58f560){if(_0x58f560['hasOwnProperty'](_0x402dd4)){_0x10921b[util[_0x1660('0x12')]('%s',_[_0x1660('0x31')](_0x402dd4))]=_0x58f560[_0x402dd4];}}return{'variables':_0x10921b};};exports['updateOriginated']=function(_0x797953,_0x372744){if(!_[_0x1660('0x14')](_0x797953)){if(_0x797953[_0x1660('0x2a')]('originated')){if(_0x797953[_0x1660('0x32')]>0x0){_0x797953[_0x1660('0x32')]-=0x1;}else{logger[_0x1660('0xa')](_0x1660('0x33'),_0x372744);}}}else{logger[_0x1660('0xa')](_0x1660('0x34'),_0x372744);}};exports[_0x1660('0x35')]=function(_0x21cca0){var _0x310dbe=moment()[_0x1660('0x12')](_0x1660('0x36'));_0x21cca0['state']=0xd;_0x21cca0['statedesc']='Blacklist';_0x21cca0[_0x1660('0x37')]=_0x310dbe;_0x21cca0[_0x1660('0x38')]=_0x310dbe;_0x21cca0[_0x1660('0x39')]=_0x310dbe;};exports[_0x1660('0x3a')]=function(_0x282903,_0x5cceca,_0x5e8467){var _0x44d1b2=moment()[_0x1660('0x12')](_0x1660('0x36'));_0x282903[_0x1660('0x3b')]=_0x5cceca;_0x282903[_0x1660('0x3c')]=_0x5e8467;_0x282903[_0x1660('0x38')]=_0x44d1b2;_0x282903[_0x1660('0x3d')]=getSeconds(_0x282903[_0x1660('0x38')],_0x282903[_0x1660('0x37')]);};exports[_0x1660('0x3e')]=function(_0x5885f0,_0x4fd8ad,_0x5c1aa2){_0x5885f0[_0x1660('0x3f')]=_0x4fd8ad;_0x5885f0['UserId']=_0x5c1aa2;};exports[_0x1660('0x40')]=function(_0x3854fd,_0x18e4f9,_0x2a889d){var _0x434d2f=moment()['format'](_0x1660('0x36'));_0x3854fd[_0x1660('0x3b')]=_0x18e4f9;_0x3854fd[_0x1660('0x3c')]=_0x2a889d;_0x3854fd['responsetime']=_0x3854fd['responsetime']?_0x3854fd['responsetime']:_0x434d2f;_0x3854fd['endtime']=_0x3854fd[_0x1660('0x39')]?_0x3854fd[_0x1660('0x39')]:_0x434d2f;_0x3854fd[_0x1660('0x3d')]=getSeconds(_0x3854fd[_0x1660('0x38')]||0x0,_0x3854fd[_0x1660('0x37')]||0x0);_0x3854fd['talktime']=_0x3854fd[_0x1660('0x41')]?getSeconds(_0x3854fd[_0x1660('0x39')],_0x3854fd[_0x1660('0x41')]):0x0;};exports[_0x1660('0x42')]=function(_0x1af075){return _0x1af075===_0x1660('0x43');};exports[_0x1660('0x44')]=function(_0x155d35,_0x1f1c9f,_0x1156ac,_0x23d46a,_0x688067){var _0x413c1c=_0x23d46a?'RECALL':_0x155d35[_0x1660('0x45')];_0x413c1c=_0x688067?_0x1660('0x46'):_0x413c1c;return{'actionid':_0x155d35[_0x1660('0x47')],'action':_0x1660('0x48'),'channel':_0x155d35[_0x1660('0x49')],'callerid':util[_0x1660('0x12')]('\x22%s\x22\x20<%s>',_0x413c1c,_0x155d35[_0x1660('0x18')]),'Exten':'xcally-motion-preview','Context':_0x1660('0x4a'),'Priority':'1','variable':_0x1156ac,'timeout':(_0x1f1c9f[_0x1660('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x155d35[_0x1660('0x47')]};};exports[_0x1660('0x4c')]=function(_0x1706bd){return _0x1706bd['countbusyretry']+_0x1706bd[_0x1660('0x4d')]+_0x1706bd[_0x1660('0x4e')]+_0x1706bd['countagentrejectretry']+_0x1706bd['countnosuchnumberretry'];};exports[_0x1660('0x4f')]=function(_0x3bcef7){var _0x343420=_[_0x1660('0x50')](_0x3bcef7);_0x343420[_0x1660('0x3b')]=0xf;_0x343420[_0x1660('0x3c')]='Global';return _0x343420;};exports[_0x1660('0x51')]=function(_0x5b9c7f,_0x27010a,_0x84ac0b){var _0x403f9f={};_0x403f9f[_0x27010a]=_0x5b9c7f[_0x27010a];_0x403f9f[_0x1660('0x52')]=![];_0x403f9f[_0x1660('0x53')]=moment()[_0x1660('0x54')](_0x84ac0b,_0x1660('0x55'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x403f9f[_0x1660('0x56')]=_0x5b9c7f[_0x1660('0x56')];_0x403f9f[_0x1660('0x57')]=_0x5b9c7f['ListId'];_0x403f9f['VoiceQueueId']=_0x5b9c7f[_0x1660('0x1a')]||undefined;return _0x403f9f;};exports[_0x1660('0x58')]=function(_0x2b3cc3,_0x571105){if(!_[_0x1660('0x14')](_0x2b3cc3)){if(_0x2b3cc3[_0x1660('0x59')]>0x0){_0x2b3cc3[_0x1660('0x59')]-=0x1;}else{logger[_0x1660('0xa')](_0x571105,_0x1660('0x5a'));}}else{logger[_0x1660('0xa')](_0x571105,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x1660('0x5b')]=function(_0x1a47ae){if(_0x1a47ae<=0x0){return!![];}return![];};exports[_0x1660('0x5c')]=function(_0x584a42,_0x2f1e56,_0x56c8cb){_0x584a42[_0x1660('0x5d')]=_0x2f1e56;_0x584a42[_0x1660('0x16')]=_0x584a42['queue'];_0x584a42[_0x1660('0x5e')]=_0x584a42[_0x1660('0x49')];if(_0x56c8cb){_0x584a42[_0x1660('0x5f')]=_0x56c8cb[_0x1660('0x5f')];}return _0x584a42;};exports[_0x1660('0x60')]=function(_0xfcddd6){var _0x50c77a={};_0x50c77a[_0x1660('0x61')]=_0xfcddd6[_0x1660('0x61')];_0x50c77a['interface']=_0xfcddd6['channelAgent'];_0x50c77a['uniqueid']=_0xfcddd6[_0x1660('0x47')];return _0x50c77a;};exports[_0x1660('0x62')]=function(_0x2510cb){var _0x8ec588=[];for(var _0x484d0c in _0x2510cb){if(_0x2510cb[_0x1660('0x2a')](_0x484d0c)){if(!_[_0x1660('0x14')](_0x2510cb[_0x484d0c])&&_0x2510cb[_0x484d0c][_0x1660('0x3b')]===_0x1660('0x63')&&_0x2510cb[_0x484d0c]['status']===_0x1660('0x64')){_0x8ec588[_0x1660('0x65')](_0x2510cb[_0x484d0c]['id']);}}}return _0x8ec588;};exports[_0x1660('0x66')]=function(_0x53504d){var _0x549c8f=moment()[_0x1660('0x67')](0x0);var _0x2bfd29=moment(_0x53504d)[_0x1660('0x67')](0x0);return _0x549c8f['diff'](_0x2bfd29,_0x1660('0x8'));};exports[_0x1660('0x68')]=function(_0x3eed5a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3eed5a['ContactId'],'ListId':_0x3eed5a[_0x1660('0x57')],'VoiceQueueId':_0x3eed5a[_0x1660('0x1a')]||undefined,'CampaignId':_0x3eed5a['CampaignId']||undefined};};exports['filterKey']=function(_0x6c9f4){if(_0x6c9f4===_0x1660('0x47')||_0x6c9f4===_0x1660('0x69')||_0x6c9f4===_0x1660('0x61')||_0x6c9f4===_0x1660('0x6a')||_0x6c9f4===_0x1660('0x6b')||_0x6c9f4===_0x1660('0x6c')||_0x6c9f4==='membername'||_0x6c9f4==='channelAgent'||_0x6c9f4===_0x1660('0x45')||_0x6c9f4===_0x1660('0x52')||_0x6c9f4===_0x1660('0x18')||_0x6c9f4==='scheduledat'||_0x6c9f4==='countbusyretry'||_0x6c9f4==='countcongestionretry'||_0x6c9f4===_0x1660('0x4e')||_0x6c9f4==='countglobal'||_0x6c9f4===_0x1660('0x6d')||_0x6c9f4==='callbackuniqueid'||_0x6c9f4==='callbackat'||_0x6c9f4===_0x1660('0x6e')||_0x6c9f4===_0x1660('0x56')||_0x6c9f4==='ListId'||_0x6c9f4===_0x1660('0x6f')||_0x6c9f4===_0x1660('0x1a')||_0x6c9f4==='sipcallid'||_0x6c9f4===_0x1660('0x70')||_0x6c9f4===_0x1660('0x71')||_0x6c9f4===_0x1660('0x72')||_0x6c9f4===_0x1660('0x73')||_0x6c9f4===_0x1660('0x74')||_0x6c9f4===_0x1660('0x75')||_0x6c9f4===_0x1660('0x76')||_0x6c9f4===_0x1660('0x77')||_0x6c9f4===_0x1660('0x78')||_0x6c9f4===_0x1660('0x79')||_0x6c9f4===_0x1660('0x7a')||_0x6c9f4===_0x1660('0x7b')||_0x6c9f4===_0x1660('0x7c')||_0x6c9f4===_0x1660('0x7d')||_0x6c9f4==='rtpaudioqos'||_0x6c9f4===_0x1660('0x7e')||_0x6c9f4===_0x1660('0x7f')||_0x6c9f4==='rtpaudioqosjitterbridged'||_0x6c9f4===_0x1660('0x80')||_0x6c9f4===_0x1660('0x81')||_0x6c9f4===_0x1660('0x82')||_0x6c9f4===_0x1660('0x83')||_0x6c9f4===_0x1660('0x84')||_0x6c9f4===_0x1660('0x7e')||_0x6c9f4===_0x1660('0x7f')||_0x6c9f4===_0x1660('0x85')||_0x6c9f4==='rtpaudioqosloss'||_0x6c9f4===_0x1660('0x81')||_0x6c9f4===_0x1660('0x82')||_0x6c9f4===_0x1660('0x83')||_0x6c9f4==='bridgepeer'||_0x6c9f4===_0x1660('0x86')||_0x6c9f4===_0x1660('0x3b')||_0x6c9f4===_0x1660('0x3c')){return![];}return!![];};exports[_0x1660('0x87')]=function(_0xd3c68c,_0x25c755){var _0x35734a,_0x5e0ceb,_0x5c4c8c;if(_0x25c755<=0x0){_0x25c755=0x1;}_0x35734a=new RegExp(_0x1660('0x88')+_0x25c755+'}$');_0x5e0ceb=Math[_0x1660('0x89')](0xa,_0x25c755-0x1);_0x5c4c8c=Math[_0x1660('0x89')](0xa,_0x25c755)-0x1;return util[_0x1660('0x12')]('%s',_[_0x1660('0x8a')](_0xd3c68c,_0x35734a,_['random'](_0x5e0ceb,_0x5c4c8c)));};exports[_0x1660('0x8b')]=function(_0x447881){var _0x37ef8e=_0x447881[_0x1660('0x8c')](/"(.*?)"/);return _0x37ef8e?_0x37ef8e[0x1]:_0x447881;};exports[_0x1660('0x8d')]=function(_0x3454fa){var _0x425411=_0x3454fa[_0x1660('0x8c')](/<(.*?)>/);return _0x425411?_0x425411[0x1]:_0x3454fa;}; \ No newline at end of file +var _0xe65d=['from-sip','timeout','totalGlobal','countbusyretry','countagentrejectretry','clone','Global','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','name','interface','mandatoryDisposition','queue','not_inuse','status','reachable','push','getDiff','seconds','CampaignId','filterKey','campaigntype','active','scheduledat','countcongestionretry','countnoanswerretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitter','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','loggerCatch','error','logger','info','inspect','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','UserId','state','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview'];(function(_0x9c768b,_0x4888a1){var _0x35f3f1=function(_0x1addf6){while(--_0x1addf6){_0x9c768b['push'](_0x9c768b['shift']());}};_0x35f3f1(++_0x4888a1);}(_0xe65d,0x1cf));var _0xde65=function(_0x47e332,_0x2153ce){_0x47e332=_0x47e332-0x0;var _0x962a9b=_0xe65d[_0x47e332];return _0x962a9b;};'use strict';var util=require(_0xde65('0x0'));var _=require(_0xde65('0x1'));var moment=require(_0xde65('0x2'));var logger=require(_0xde65('0x3'))(_0xde65('0x4'));var ipAgi=process[_0xde65('0x5')]['XCALLY_IP_AGI']||_0xde65('0x6');function getSeconds(_0xed6ec4,_0x1b148d){var _0x4e5a59=moment(_0xed6ec4)[_0xde65('0x7')](0x0);var _0x4d5699=moment(_0x1b148d)['milliseconds'](0x0);return _0x4e5a59[_0xde65('0x8')](_0x4d5699,'seconds');}exports[_0xde65('0x9')]=function(_0x20171c){return function(_0x4a8f22){logger[_0xde65('0xa')](_0x20171c,util['inspect'](_0x4a8f22,{'showHidden':![],'depth':null}));};};exports[_0xde65('0xb')]=function(_0x535482,_0x4d901b){logger[_0xde65('0xc')](_0x535482,util[_0xde65('0xd')](_0x4d901b,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x5767d7,_0x37b61b){logger[_0xde65('0xa')](_0x5767d7,util['inspect'](_0x37b61b,{'showHidden':![],'depth':null}));};exports[_0xde65('0xe')]=function(_0x3ac9c7){return function(_0x311f25){logger[_0xde65('0xc')](_0x3ac9c7,util[_0xde65('0xd')](_0x311f25,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1f3f48,_0x3e7c78,_0x519cf7){return{'message':_0x1f3f48,'unlock':_0x3e7c78,'active':_0x519cf7};};exports[_0xde65('0xf')]=function(_0x45697e,_0x5da65c,_0xc2812b){if(!_[_0xde65('0x10')](_0xc2812b)&&_0xde65('0x11')===typeof _0xc2812b&&!_[_0xde65('0x12')](_0xc2812b)){if(!_[_0xde65('0x10')](_0x5da65c)&&_0xde65('0x11')===typeof _0x5da65c&&!_[_0xde65('0x12')](_0x5da65c)){return util['format']('\x22%s\x22\x20<%s>',_0x5da65c,_0xc2812b);}return util[_0xde65('0x13')](_0xde65('0x14'),_0xc2812b,_0xc2812b);}if(!_[_0xde65('0x10')](_0x45697e)&&'string'===typeof _0x45697e&&!_[_0xde65('0x12')](_0x45697e)){return _0x45697e;}return'\x22\x22\x20<>';};exports[_0xde65('0x15')]=function(_0x1b1410){if(_[_0xde65('0x16')](_0x1b1410)){return![];}return _0x1b1410;};exports[_0xde65('0x17')]=function(_0x46e56b,_0x32f2fc,_0x5d2abd,_0xd60277,_0x543dc5,_0x246b30){var _0x2cbcc5={'XMD-QUEUE':_0x32f2fc[_0xde65('0x18')]?_0x32f2fc[_0xde65('0x18')]['name']:'','XMD-CALLERID':_0xd60277,'XMD-CALLERID-PREVIEW':_0x246b30?util[_0xde65('0x13')](_0xde65('0x14'),_0x246b30[_0xde65('0x19')],_0x246b30[_0xde65('0x1a')]):_0xd60277,'XMD-DIALID':_0x543dc5,'XMD-CONTACTID':_0x32f2fc[_0xde65('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xd60277,'XMD-VOICEQUEUEID':_0x32f2fc[_0xde65('0x1c')],'XMD-DIALCHANNEL':_0x5d2abd,'XMD-DIALTIMEOUT':_0x46e56b[_0xde65('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xde65('0x13')](_0xde65('0x1e'),_0x46e56b[_0xde65('0x1f')]?'g':'',_[_0xde65('0x12')](_0x46e56b[_0xde65('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x46e56b[_0xde65('0x21')]||'','XMD-AGI':_0x46e56b[_0xde65('0x22')]?util[_0xde65('0x13')](_0xde65('0x23'),ipAgi,_0x46e56b[_0xde65('0x22')]):_0xde65('0x24'),'XMD-AGIAFTER':_0x46e56b[_0xde65('0x1f')]?util[_0xde65('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x46e56b[_0xde65('0x1f')]):_0xde65('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x246b30?_0x246b30[_0xde65('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x246b30?_0x246b30[_0xde65('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xde65('0x12')](_0x46e56b['monitor_format'])){_0x2cbcc5[util[_0xde65('0x13')]('%s',_0xde65('0x27'))]=_0x46e56b[_0xde65('0x20')];_0x2cbcc5[util['format']('%s',_0xde65('0x28'))]=_0x543dc5;}if(_0x32f2fc&&_0x32f2fc[_0xde65('0x29')]){for(var _0x270773 in _0x32f2fc[_0xde65('0x29')]){if(_0x32f2fc[_0xde65('0x29')][_0xde65('0x2a')](_0x270773)){if(!_['isNil'](_0x32f2fc[_0xde65('0x29')][_0x270773])&&_0x270773!=='id'&&_0x270773!==_0xde65('0x2b')&&_0x270773!=='createdAt'&&_0x270773!==_0xde65('0x2c')){_0x2cbcc5[util[_0xde65('0x13')](_0xde65('0x2d'),_0xde65('0x2e'),_['toUpper'](_0x270773))]=_0x32f2fc[_0xde65('0x29')][_0x270773];}}}}return _0x2cbcc5;};exports[_0xde65('0x2f')]=function(_0x4a55cc){var _0x5485a2={};for(var _0x254baa in _0x4a55cc){if(_0x4a55cc[_0xde65('0x2a')](_0x254baa)){_0x5485a2[util[_0xde65('0x13')]('%s',_[_0xde65('0x30')](_0x254baa))]=_0x4a55cc[_0x254baa];}}return{'variables':_0x5485a2};};exports[_0xde65('0x31')]=function(_0x34282c,_0x287c1d){if(!_['isNil'](_0x34282c)){if(_0x34282c[_0xde65('0x2a')](_0xde65('0x32'))){if(_0x34282c['originated']>0x0){_0x34282c[_0xde65('0x32')]-=0x1;}else{logger[_0xde65('0xa')](_0xde65('0x33'),_0x287c1d);}}}else{logger[_0xde65('0xa')](_0xde65('0x34'),_0x287c1d);}};exports[_0xde65('0x35')]=function(_0x3d6fde){var _0x33debe=moment()[_0xde65('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d6fde['state']=0xd;_0x3d6fde[_0xde65('0x36')]=_0xde65('0x37');_0x3d6fde[_0xde65('0x38')]=_0x33debe;_0x3d6fde[_0xde65('0x39')]=_0x33debe;_0x3d6fde[_0xde65('0x3a')]=_0x33debe;};exports['logAgent']=function(_0x445d70,_0x21bb8b,_0x4393fc){var _0x57afe1=moment()[_0xde65('0x13')](_0xde65('0x3b'));_0x445d70['state']=_0x21bb8b;_0x445d70[_0xde65('0x36')]=_0x4393fc;_0x445d70['responsetime']=_0x57afe1;_0x445d70[_0xde65('0x3c')]=getSeconds(_0x445d70[_0xde65('0x39')],_0x445d70[_0xde65('0x38')]);};exports['logLookAgent']=function(_0x1676d0,_0x4c4463,_0x58c266){_0x1676d0[_0xde65('0x3d')]=_0x4c4463;_0x1676d0[_0xde65('0x3e')]=_0x58c266;};exports['logCustomer']=function(_0x1204a7,_0x156ddf,_0x5ed6a1){var _0x5230b8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1204a7[_0xde65('0x3f')]=_0x156ddf;_0x1204a7['statedesc']=_0x5ed6a1;_0x1204a7[_0xde65('0x39')]=_0x1204a7[_0xde65('0x39')]?_0x1204a7[_0xde65('0x39')]:_0x5230b8;_0x1204a7[_0xde65('0x3a')]=_0x1204a7[_0xde65('0x3a')]?_0x1204a7[_0xde65('0x3a')]:_0x5230b8;_0x1204a7[_0xde65('0x3c')]=getSeconds(_0x1204a7[_0xde65('0x39')]||0x0,_0x1204a7[_0xde65('0x38')]||0x0);_0x1204a7['talktime']=_0x1204a7[_0xde65('0x40')]?getSeconds(_0x1204a7[_0xde65('0x3a')],_0x1204a7[_0xde65('0x40')]):0x0;};exports[_0xde65('0x41')]=function(_0x4f67cf){return _0x4f67cf==='Failure';};exports[_0xde65('0x42')]=function(_0x3635aa,_0x4529bf,_0x4163b4,_0x9aa9f2,_0x40d8aa){var _0x527fdf=_0x9aa9f2?_0xde65('0x43'):_0x3635aa['calleridname'];_0x527fdf=_0x40d8aa?_0xde65('0x44'):_0x527fdf;return{'actionid':_0x3635aa[_0xde65('0x45')],'action':_0xde65('0x46'),'channel':_0x3635aa[_0xde65('0x47')],'callerid':util[_0xde65('0x13')](_0xde65('0x14'),_0x527fdf,_0x3635aa[_0xde65('0x1a')]),'Exten':_0xde65('0x48'),'Context':_0xde65('0x49'),'Priority':'1','variable':_0x4163b4,'timeout':(_0x4529bf[_0xde65('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3635aa[_0xde65('0x45')]};};exports[_0xde65('0x4b')]=function(_0x3a30fd){return _0x3a30fd[_0xde65('0x4c')]+_0x3a30fd['countcongestionretry']+_0x3a30fd['countnoanswerretry']+_0x3a30fd[_0xde65('0x4d')]+_0x3a30fd['countnosuchnumberretry'];};exports['cloneAction']=function(_0x44dc8c){var _0x5ea985=_[_0xde65('0x4e')](_0x44dc8c);_0x5ea985[_0xde65('0x3f')]=0xf;_0x5ea985[_0xde65('0x36')]=_0xde65('0x4f');return _0x5ea985;};exports['scheduledAt']=function(_0x2b9747,_0x58e6e1,_0x711b86){var _0x22f7dc={};_0x22f7dc[_0x58e6e1]=_0x2b9747[_0x58e6e1];_0x22f7dc['active']=![];_0x22f7dc['scheduledat']=moment()['add'](_0x711b86,_0xde65('0x50'))[_0xde65('0x13')](_0xde65('0x3b'));_0x22f7dc['ContactId']=_0x2b9747[_0xde65('0x1b')];_0x22f7dc[_0xde65('0x51')]=_0x2b9747[_0xde65('0x51')];_0x22f7dc[_0xde65('0x1c')]=_0x2b9747['VoiceQueueId']||undefined;return _0x22f7dc;};exports['decrementTalkink']=function(_0x186847,_0x2b7ce5){if(!_['isNil'](_0x186847)){if(_0x186847[_0xde65('0x52')]>0x0){_0x186847[_0xde65('0x52')]-=0x1;}else{logger[_0xde65('0xa')](_0x2b7ce5,_0xde65('0x53'));}}else{logger[_0xde65('0xa')](_0x2b7ce5,_0xde65('0x54'));}};exports['IsNotLoggedIn']=function(_0x54af8a){if(_0x54af8a<=0x0){return!![];}return![];};exports[_0xde65('0x55')]=function(_0x11cb60,_0x21807c,_0x47cd89){_0x11cb60[_0xde65('0x56')]=_0x21807c;_0x11cb60[_0xde65('0x57')]=_0x11cb60['queue'];_0x11cb60[_0xde65('0x58')]=_0x11cb60[_0xde65('0x47')];if(_0x47cd89){_0x11cb60['mandatoryDisposition']=_0x47cd89[_0xde65('0x59')];}return _0x11cb60;};exports['buildAcw']=function(_0x15d7b5){var _0x18e792={};_0x18e792[_0xde65('0x5a')]=_0x15d7b5[_0xde65('0x5a')];_0x18e792[_0xde65('0x58')]=_0x15d7b5[_0xde65('0x47')];_0x18e792[_0xde65('0x45')]=_0x15d7b5[_0xde65('0x45')];return _0x18e792;};exports['agentReadyId']=function(_0x3dc973){var _0x555917=[];for(var _0x52fc54 in _0x3dc973){if(_0x3dc973['hasOwnProperty'](_0x52fc54)){if(!_[_0xde65('0x16')](_0x3dc973[_0x52fc54])&&_0x3dc973[_0x52fc54]['state']===_0xde65('0x5b')&&_0x3dc973[_0x52fc54][_0xde65('0x5c')]===_0xde65('0x5d')){_0x555917[_0xde65('0x5e')](_0x3dc973[_0x52fc54]['id']);}}}return _0x555917;};exports[_0xde65('0x5f')]=function(_0x198991){var _0xad1a61=moment()[_0xde65('0x7')](0x0);var _0x2be4e4=moment(_0x198991)[_0xde65('0x7')](0x0);return _0xad1a61[_0xde65('0x8')](_0x2be4e4,_0xde65('0x60'));};exports['createBody']=function(_0x2d4883){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2d4883[_0xde65('0x1b')],'ListId':_0x2d4883[_0xde65('0x51')],'VoiceQueueId':_0x2d4883['VoiceQueueId']||undefined,'CampaignId':_0x2d4883[_0xde65('0x61')]||undefined};};exports[_0xde65('0x62')]=function(_0x53e535){if(_0x53e535===_0xde65('0x45')||_0x53e535==='idContact'||_0x53e535===_0xde65('0x5a')||_0x53e535==='type'||_0x53e535===_0xde65('0x63')||_0x53e535==='dialAnswer'||_0x53e535===_0xde65('0x3d')||_0x53e535==='channelAgent'||_0x53e535===_0xde65('0x19')||_0x53e535===_0xde65('0x64')||_0x53e535==='calleridnum'||_0x53e535===_0xde65('0x65')||_0x53e535===_0xde65('0x4c')||_0x53e535===_0xde65('0x66')||_0x53e535===_0xde65('0x67')||_0x53e535===_0xde65('0x68')||_0x53e535===_0xde65('0x69')||_0x53e535==='callbackuniqueid'||_0x53e535===_0xde65('0x6a')||_0x53e535===_0xde65('0x6b')||_0x53e535===_0xde65('0x1b')||_0x53e535===_0xde65('0x51')||_0x53e535===_0xde65('0x3e')||_0x53e535===_0xde65('0x1c')||_0x53e535===_0xde65('0x6c')||_0x53e535==='xmd-voicequeueid'||_0x53e535===_0xde65('0x6d')||_0x53e535===_0xde65('0x6e')||_0x53e535===_0xde65('0x6f')||_0x53e535===_0xde65('0x70')||_0x53e535===_0xde65('0x71')||_0x53e535==='xmd-dialoptions'||_0x53e535===_0xde65('0x72')||_0x53e535===_0xde65('0x73')||_0x53e535==='xmd-contactid'||_0x53e535==='xmd-cdrtype'||_0x53e535==='xmd-callerid'||_0x53e535===_0xde65('0x74')||_0x53e535===_0xde65('0x75')||_0x53e535===_0xde65('0x76')||_0x53e535===_0xde65('0x77')||_0x53e535==='rtpaudioqosjitter'||_0x53e535===_0xde65('0x78')||_0x53e535===_0xde65('0x79')||_0x53e535===_0xde65('0x7a')||_0x53e535===_0xde65('0x7b')||_0x53e535==='rtpaudioqosrttbridged'||_0x53e535===_0xde65('0x76')||_0x53e535===_0xde65('0x77')||_0x53e535===_0xde65('0x7c')||_0x53e535===_0xde65('0x78')||_0x53e535===_0xde65('0x79')||_0x53e535==='rtpaudioqoslossbridged'||_0x53e535===_0xde65('0x7b')||_0x53e535===_0xde65('0x7d')||_0x53e535===_0xde65('0x7e')||_0x53e535===_0xde65('0x7f')||_0x53e535==='state'||_0x53e535==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x29978e,_0x1d1c9b){var _0x472ed6,_0x4ea01c,_0x30b94f;if(_0x1d1c9b<=0x0){_0x1d1c9b=0x1;}_0x472ed6=new RegExp(_0xde65('0x80')+_0x1d1c9b+'}$');_0x4ea01c=Math['pow'](0xa,_0x1d1c9b-0x1);_0x30b94f=Math[_0xde65('0x81')](0xa,_0x1d1c9b)-0x1;return util[_0xde65('0x13')]('%s',_[_0xde65('0x82')](_0x29978e,_0x472ed6,_[_0xde65('0x83')](_0x4ea01c,_0x30b94f)));};exports[_0xde65('0x84')]=function(_0x285242){var _0x1f7ca6=_0x285242[_0xde65('0x85')](/"(.*?)"/);return _0x1f7ca6?_0x1f7ca6[0x1]:_0x285242;};exports['extractCalleridNumber']=function(_0x5c09be){var _0x3f1e48=_0x5c09be[_0xde65('0x85')](/<(.*?)>/);return _0x3f1e48?_0x3f1e48[0x1]:_0x5c09be;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index be87c54..2b91ab2 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 _0xa4a0=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','voicequeuechannelhangup'];(function(_0x274f0a,_0x4b0ed2){var _0x388cf4=function(_0x4e09c0){while(--_0x4e09c0){_0x274f0a['push'](_0x274f0a['shift']());}};_0x388cf4(++_0x4b0ed2);}(_0xa4a0,0x12e));var _0x0a4a=function(_0x4c7c8f,_0x26d5a7){_0x4c7c8f=_0x4c7c8f-0x0;var _0x47ded1=_0xa4a0[_0x4c7c8f];return _0x47ded1;};'use strict';exports[_0x0a4a('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0a4a('0x1'),'required':!![]},'membername':{'type':_0x0a4a('0x1'),'required':!![]},'penalty':{'type':_0x0a4a('0x2'),'required':![]},'paused':{'type':_0x0a4a('0x3'),'required':![]}};exports[_0x0a4a('0x4')]={'queue':{'type':_0x0a4a('0x1'),'required':!![]},'interface':{'type':_0x0a4a('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x0a4a('0x1'),'required':!![]},'paused':{'type':_0x0a4a('0x3')},'reason':{'type':_0x0a4a('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x0a4a('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x0a4a('0x1'),'required':!![]},'filename':{'type':_0x0a4a('0x1')},'format':{'type':_0x0a4a('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x0a4a('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x0a4a('0x6')]={'uniqueid':{'type':_0x0a4a('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x0948=['voicequeuechannelredirect','queueadd','string','number','boolean','queuepause','voicequeuechannel','voicechannel'];(function(_0x4e3147,_0x43fc89){var _0x5c3888=function(_0x2f7541){while(--_0x2f7541){_0x4e3147['push'](_0x4e3147['shift']());}};_0x5c3888(++_0x43fc89);}(_0x0948,0x119));var _0x8094=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x0948[_0x593564];return _0x211a89;};'use strict';exports[_0x8094('0x0')]={'queue':{'type':_0x8094('0x1'),'required':!![]},'interface':{'type':_0x8094('0x1'),'required':!![]},'membername':{'type':_0x8094('0x1'),'required':!![]},'penalty':{'type':_0x8094('0x2'),'required':![]},'paused':{'type':_0x8094('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x8094('0x1'),'required':!![]},'interface':{'type':_0x8094('0x1'),'required':!![]}};exports[_0x8094('0x4')]={'interface':{'type':_0x8094('0x1'),'required':!![]},'paused':{'type':_0x8094('0x3')},'reason':{'type':_0x8094('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x8094('0x1'),'required':![]}};exports[_0x8094('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x8094('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x8094('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x8094('0x1'),'required':!![]}};exports[_0x8094('0x7')]={'uniqueid':{'type':_0x8094('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x8094('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index d129a16..9c5479e 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 _0xad62=['initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','isUndefined','prototype','initTelephones','initTrunks','initVoiceQueues','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','answered','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xad62,0x142));var _0x2ad6=function(_0x2af009,_0x5432ee){_0x2af009=_0x2af009-0x0;var _0x46d15f=_0xad62[_0x2af009];return _0x46d15f;};'use strict';var BPromise=require('bluebird');var util=require(_0x2ad6('0x0'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x2ad6('0x1'));var Telephone=require('../model/telephone');var Trunk=require(_0x2ad6('0x2'));var VoiceQueue=require(_0x2ad6('0x3'));var Trigger=require(_0x2ad6('0x4'));var Template=require(_0x2ad6('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x2ad6('0x6'));var SalesforceAccount=require(_0x2ad6('0x7'));var FreshdeskAccount=require(_0x2ad6('0x8'));var SugarcrmAccount=require(_0x2ad6('0x9'));var ZohoAccount=require(_0x2ad6('0xa'));var DeskAccount=require(_0x2ad6('0xb'));var VtigerAccount=require(_0x2ad6('0xc'));var ServicenowAccount=require(_0x2ad6('0xd'));var Dynamics365Account=require(_0x2ad6('0xe'));var FreshsalesAccount=require(_0x2ad6('0xf'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x2ad6('0x10')]={};this[_0x2ad6('0x11')]={};this[_0x2ad6('0x12')]={};this[_0x2ad6('0x13')]={};this[_0x2ad6('0x14')]={};this[_0x2ad6('0x15')]={};this[_0x2ad6('0x16')]={};this[_0x2ad6('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x2ad6('0x18')]={};this[_0x2ad6('0x19')]={};this['queueChannels']={};this[_0x2ad6('0x1a')]={};this[_0x2ad6('0x1b')]={};this[_0x2ad6('0x1c')]={};this[_0x2ad6('0x1d')]={};this[_0x2ad6('0x1e')]={};this[_0x2ad6('0x1f')]={};this['freshdeskAccounts']={};this[_0x2ad6('0x20')]={};this['deskAccounts']={};this[_0x2ad6('0x21')]={};this[_0x2ad6('0x22')]={};this[_0x2ad6('0x23')]={};this[_0x2ad6('0x24')]={};this[_0x2ad6('0x25')]={};};function freeIsNotKey(_0x1246db,_0x454b9d,_0x52768a){var _0x21ec39=_[_0x2ad6('0x26')](_0x1246db,function(_0x273a58,_0x46a46e){return _0x273a58[_0x52768a];});for(var _0x536b3a in _0x454b9d){if(_0x454b9d[_0x2ad6('0x27')](_0x536b3a)){if(!_0x21ec39[_0x536b3a]){delete _0x454b9d[_0x536b3a];}}}}function freeIsNotKeySip(_0x3192c6,_0x1049a7){var _0xa5bbf=_[_0x2ad6('0x26')](_0x3192c6,function(_0x144131,_0x4a6acf){return util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x144131[_0x2ad6('0x2a')]);});for(var _0x219a02 in _0x1049a7){if(_0x1049a7['hasOwnProperty'](_0x219a02)){if(!_0xa5bbf[_0x219a02]){delete _0x1049a7[_0x219a02];}}}}function freeIsNotKeyAgent(_0x5b0163,_0xcc8310){var _0x536e89=_['mapKeys'](_0x5b0163,function(_0x363150,_0xa6ccaf){var _0x468348=_['isNil'](_0x363150[_0x2ad6('0x2b')])?util['format']('SIP/%s',_0x363150[_0x2ad6('0x2a')]):_0x363150[_0x2ad6('0x2b')];return _0x468348;});for(var _0x55acaf in _0xcc8310){if(_0xcc8310['hasOwnProperty'](_0x55acaf)){if(!_0x536e89[_0x55acaf]){delete _0xcc8310[_0x55acaf];}}}}function clearVoiceCallReports(_0x644137){_0x644137[_0x2ad6('0x2c')]=0x0;_0x644137['answered']=0x0;_0x644137[_0x2ad6('0x2d')]=0x0;_0x644137[_0x2ad6('0x2e')]=0x0;_0x644137[_0x2ad6('0x2f')]=0x0;}function clearCampaigns(_0x3053f2){if(!_[_0x2ad6('0x30')](_0x3053f2)){for(var _0x4fce3f in _0x3053f2){if(_0x3053f2[_0x2ad6('0x27')](_0x4fce3f)){_0x3053f2[_0x4fce3f]['ivrTotalCallsDays']=0x0;_0x3053f2[_0x4fce3f][_0x2ad6('0x31')]=0x0;}}}}function clearVoiceQueues(_0x144e45){if(!_[_0x2ad6('0x30')](_0x144e45)){for(var _0x116518 in _0x144e45){if(_0x144e45[_0x2ad6('0x27')](_0x116518)){_0x144e45[_0x116518][_0x2ad6('0x2c')]=0x0;_0x144e45[_0x116518]['answered']=0x0;_0x144e45[_0x116518][_0x2ad6('0x32')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x33')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x2d')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x2e')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x2f')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x34')]=0x0;_0x144e45[_0x116518]['outboundNoAnswerCallsDay']=0x0;_0x144e45[_0x116518]['outboundBusyCallsDay']=0x0;_0x144e45[_0x116518][_0x2ad6('0x35')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x36')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x37')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x38')]=0x0;_0x144e45[_0x116518]['outboundDropCallsDayCallersExit']=0x0;_0x144e45[_0x116518][_0x2ad6('0x39')]=0x0;_0x144e45[_0x116518]['outboundOriginateFailureCallsDay']=0x0;_0x144e45[_0x116518]['outboundRejectCallsDay']=0x0;_0x144e45[_0x116518][_0x2ad6('0x3a')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x34')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x3b')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x3c')]=!![];}}}}Realtime['prototype'][_0x2ad6('0x3d')]=function(_0x5c1ed3,_0x157b04){for(var _0x2ea198 in _0x157b04){if(_0x5c1ed3[_0x2ad6('0x27')](_0x2ea198)){_0x5c1ed3[_0x2ea198]=_0x157b04[_0x2ea198];}}};Realtime['prototype'][_0x2ad6('0x3e')]=function(){var _0x32a551=this;return function(_0x294eab){if(_0x294eab){freeIsNotKeyAgent(_0x294eab,_0x32a551[_0x2ad6('0x10')]);for(var _0x2ef003=0x0,_0xf49ae7={},_0x2b762c={};_0x2ef003<_0x294eab[_0x2ad6('0x3f')];_0x2ef003+=0x1){_0xf49ae7=_0x294eab[_0x2ef003];var _0x1b85a8=_[_0x2ad6('0x40')](_0xf49ae7['interface'])?util['format'](_0x2ad6('0x29'),_0xf49ae7['name']):_0xf49ae7[_0x2ad6('0x2b')];if(_[_0x2ad6('0x41')](_0x32a551['agents'][_0x1b85a8])){_0x32a551['agents'][_0x1b85a8]=new Agent(_0xf49ae7);}else{_0x32a551[_0x2ad6('0x3d')](_0x32a551[_0x2ad6('0x10')][_0x1b85a8],_0xf49ae7);}}}return _0x32a551[_0x2ad6('0x10')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x43')]=function(){var _0x42191b=this;return function(_0x46f92c){if(_0x46f92c){freeIsNotKeySip(_0x46f92c,_0x42191b[_0x2ad6('0x11')]);for(var _0x125307=0x0,_0x8d95d7={},_0x3d1b15={};_0x125307<_0x46f92c[_0x2ad6('0x3f')];_0x125307+=0x1){_0x8d95d7=_0x46f92c[_0x125307];if(_[_0x2ad6('0x41')](_0x42191b[_0x2ad6('0x11')][util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x8d95d7[_0x2ad6('0x2a')])])){_0x42191b[_0x2ad6('0x11')][util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x8d95d7['name'])]=new Telephone(_0x8d95d7);}else{_0x42191b[_0x2ad6('0x3d')](_0x42191b[_0x2ad6('0x11')][util['format'](_0x2ad6('0x29'),_0x8d95d7[_0x2ad6('0x2a')])],_0x8d95d7);}}}return _0x42191b[_0x2ad6('0x11')];};};Realtime['prototype'][_0x2ad6('0x44')]=function(){var _0x51fd42=this;return function(_0x20c358){if(_0x20c358){freeIsNotKeySip(_0x20c358,_0x51fd42['trunks']);for(var _0xcb1d4=0x0,_0x5f583e={},_0x40402d={};_0xcb1d4<_0x20c358['length'];_0xcb1d4+=0x1){_0x5f583e=_0x20c358[_0xcb1d4];if(_[_0x2ad6('0x41')](_0x51fd42[_0x2ad6('0x12')][util[_0x2ad6('0x28')]('SIP/%s',_0x5f583e['name'])])){_0x51fd42['trunks'][util['format'](_0x2ad6('0x29'),_0x5f583e['name'])]=new Trunk(_0x5f583e);}else{_0x51fd42[_0x2ad6('0x3d')](_0x51fd42[_0x2ad6('0x12')][util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x5f583e[_0x2ad6('0x2a')])],_0x5f583e);}}}return _0x51fd42[_0x2ad6('0x12')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x45')]=function(){var _0x4729d6=this;return function(_0x1354dd){if(_0x1354dd){freeIsNotKey(_0x1354dd,_0x4729d6[_0x2ad6('0x13')],_0x2ad6('0x2a'));for(var _0x202f7b=0x0,_0x483bca={},_0x487ef4={};_0x202f7b<_0x1354dd[_0x2ad6('0x3f')];_0x202f7b+=0x1){_0x483bca=_0x1354dd[_0x202f7b];if(_[_0x2ad6('0x41')](_0x4729d6[_0x2ad6('0x13')][_0x483bca[_0x2ad6('0x2a')]])){_0x4729d6[_0x2ad6('0x13')][_0x483bca[_0x2ad6('0x2a')]]=new VoiceQueue(_0x483bca);}else{_0x4729d6[_0x2ad6('0x3d')](_0x4729d6[_0x2ad6('0x13')][_0x483bca[_0x2ad6('0x2a')]],_0x483bca);}}}return _0x4729d6['voiceQueues'];};};Realtime[_0x2ad6('0x42')]['initTriggers']=function(){var _0xbe8131=this;return function(_0x5b95cf){if(_0x5b95cf){freeIsNotKey(_0x5b95cf,_0xbe8131[_0x2ad6('0x14')],'id');for(var _0x46185e=0x0,_0x351f14={},_0x3b03f8={};_0x46185e<_0x5b95cf[_0x2ad6('0x3f')];_0x46185e+=0x1){_0x351f14=_0x5b95cf[_0x46185e];if(_[_0x2ad6('0x41')](_0xbe8131[_0x2ad6('0x14')][_0x351f14['id']])){_0xbe8131[_0x2ad6('0x14')][_0x351f14['id']]=new Trigger(_0x351f14);}else{_0xbe8131[_0x2ad6('0x3d')](_0xbe8131[_0x2ad6('0x14')][_0x351f14['id']],_0x351f14);}}}return _0xbe8131[_0x2ad6('0x14')];};};Realtime[_0x2ad6('0x42')]['initTemplates']=function(){var _0x1856ed=this;return function(_0x2b75ab){if(_0x2b75ab){freeIsNotKey(_0x2b75ab,_0x1856ed[_0x2ad6('0x16')],'id');for(var _0x30c00e=0x0,_0x40a2ec={},_0x1c5e6c={};_0x30c00e<_0x2b75ab[_0x2ad6('0x3f')];_0x30c00e+=0x1){_0x40a2ec=_0x2b75ab[_0x30c00e];if(_[_0x2ad6('0x41')](_0x1856ed[_0x2ad6('0x16')][_0x40a2ec['id']])){_0x1856ed[_0x2ad6('0x16')][_0x40a2ec['id']]=new Template(_0x40a2ec);}else{_0x1856ed[_0x2ad6('0x3d')](_0x1856ed['templates'][_0x40a2ec['id']],_0x40a2ec);}}}return _0x1856ed[_0x2ad6('0x16')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x46')]=function(){var _0x5001b6=this;return function(_0x43305d){if(_0x43305d){freeIsNotKey(_0x43305d,_0x5001b6[_0x2ad6('0x1d')],'id');for(var _0x20963d=0x0,_0x1dfd09={},_0xa6349c={};_0x20963d<_0x43305d[_0x2ad6('0x3f')];_0x20963d+=0x1){_0x1dfd09=_0x43305d[_0x20963d];if(_[_0x2ad6('0x41')](_0x5001b6[_0x2ad6('0x1d')][_0x1dfd09['id']])){_0x5001b6[_0x2ad6('0x1d')][_0x1dfd09['id']]=new ZendeskAccount(_0x1dfd09);}else{_0x5001b6[_0x2ad6('0x3d')](_0x5001b6['zendeskAccounts'][_0x1dfd09['id']],_0x1dfd09);}}}return _0x5001b6['zendeskAccounts'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x47')]=function(){var _0xd8dfb6=this;return function(_0x52d742){if(_0x52d742){freeIsNotKey(_0x52d742,_0xd8dfb6[_0x2ad6('0x1e')],'id');for(var _0x3555cf=0x0,_0x785cff={},_0x401b9e={};_0x3555cf<_0x52d742['length'];_0x3555cf+=0x1){_0x785cff=_0x52d742[_0x3555cf];if(_[_0x2ad6('0x41')](_0xd8dfb6[_0x2ad6('0x1e')][_0x785cff['id']])){_0xd8dfb6[_0x2ad6('0x1e')][_0x785cff['id']]=new SalesforceAccount(_0x785cff);}else{_0xd8dfb6['mergeFromDatabase'](_0xd8dfb6[_0x2ad6('0x1e')][_0x785cff['id']],_0x785cff);}}}return _0xd8dfb6['salesforceAccounts'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x48')]=function(){var _0x297c8a=this;return function(_0x50fb92){if(_0x50fb92){freeIsNotKey(_0x50fb92,_0x297c8a['freshdeskAccounts'],'id');for(var _0x6599d1=0x0,_0x4052d4={},_0x54c1b5={};_0x6599d1<_0x50fb92[_0x2ad6('0x3f')];_0x6599d1+=0x1){_0x4052d4=_0x50fb92[_0x6599d1];if(_[_0x2ad6('0x41')](_0x297c8a[_0x2ad6('0x49')][_0x4052d4['id']])){_0x297c8a[_0x2ad6('0x49')][_0x4052d4['id']]=new FreshdeskAccount(_0x4052d4);}else{_0x297c8a[_0x2ad6('0x3d')](_0x297c8a[_0x2ad6('0x49')][_0x4052d4['id']],_0x4052d4);}}}return _0x297c8a[_0x2ad6('0x49')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4a')]=function(){var _0x4d0f43=this;return function(_0xbd25c7){if(_0xbd25c7){freeIsNotKey(_0xbd25c7,_0x4d0f43[_0x2ad6('0x20')],'id');for(var _0x4a658c=0x0,_0x34bb4b={},_0x46b57c={};_0x4a658c<_0xbd25c7[_0x2ad6('0x3f')];_0x4a658c+=0x1){_0x34bb4b=_0xbd25c7[_0x4a658c];if(_[_0x2ad6('0x41')](_0x4d0f43['zohoAccounts'][_0x34bb4b['id']])){_0x4d0f43[_0x2ad6('0x20')][_0x34bb4b['id']]=new ZohoAccount(_0x34bb4b);}else{_0x4d0f43[_0x2ad6('0x3d')](_0x4d0f43[_0x2ad6('0x20')][_0x34bb4b['id']],_0x34bb4b);}}}return _0x4d0f43[_0x2ad6('0x20')];};};Realtime[_0x2ad6('0x42')]['initDeskAccounts']=function(){var _0x129074=this;return function(_0x51f4b0){if(_0x51f4b0){freeIsNotKey(_0x51f4b0,_0x129074[_0x2ad6('0x4b')],'id');for(var _0x5e671e=0x0,_0x23e709={},_0x2196be={};_0x5e671e<_0x51f4b0['length'];_0x5e671e+=0x1){_0x23e709=_0x51f4b0[_0x5e671e];if(_[_0x2ad6('0x41')](_0x129074[_0x2ad6('0x4b')][_0x23e709['id']])){_0x129074['deskAccounts'][_0x23e709['id']]=new DeskAccount(_0x23e709);}else{_0x129074[_0x2ad6('0x3d')](_0x129074[_0x2ad6('0x4b')][_0x23e709['id']],_0x23e709);}}}return _0x129074[_0x2ad6('0x4b')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4c')]=function(){var _0x25144b=this;return function(_0x51316b){if(_0x51316b){freeIsNotKey(_0x51316b,_0x25144b[_0x2ad6('0x1f')],'id');for(var _0xd85bf5=0x0,_0x5b26b2={},_0x12e47e={};_0xd85bf5<_0x51316b['length'];_0xd85bf5+=0x1){_0x5b26b2=_0x51316b[_0xd85bf5];if(_['isUndefined'](_0x25144b['sugarcrmAccounts'][_0x5b26b2['id']])){_0x25144b[_0x2ad6('0x1f')][_0x5b26b2['id']]=new SugarcrmAccount(_0x5b26b2);}else{_0x25144b[_0x2ad6('0x3d')](_0x25144b[_0x2ad6('0x1f')][_0x5b26b2['id']],_0x5b26b2);}}}return _0x25144b['sugarcrmAccounts'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4d')]=function(){var _0x4c5d78=this;return function(_0x51c404){if(_0x51c404){freeIsNotKey(_0x51c404,_0x4c5d78[_0x2ad6('0x21')],'id');for(var _0x64635e=0x0,_0x1acb74={},_0x7b2315={};_0x64635e<_0x51c404[_0x2ad6('0x3f')];_0x64635e+=0x1){_0x1acb74=_0x51c404[_0x64635e];if(_['isUndefined'](_0x4c5d78[_0x2ad6('0x21')][_0x1acb74['id']])){_0x4c5d78['vtigerAccounts'][_0x1acb74['id']]=new VtigerAccount(_0x1acb74);}else{_0x4c5d78[_0x2ad6('0x3d')](_0x4c5d78[_0x2ad6('0x21')][_0x1acb74['id']],_0x1acb74);}}}return _0x4c5d78[_0x2ad6('0x21')];};};Realtime[_0x2ad6('0x42')]['initServicenowAccounts']=function(){var _0x526577=this;return function(_0x1130d9){if(_0x1130d9){freeIsNotKey(_0x1130d9,_0x526577[_0x2ad6('0x22')],'id');for(var _0x12d66e=0x0,_0x3d7955={},_0x30cb3a={};_0x12d66e<_0x1130d9[_0x2ad6('0x3f')];_0x12d66e+=0x1){_0x3d7955=_0x1130d9[_0x12d66e];if(_['isUndefined'](_0x526577['servicenowAccounts'][_0x3d7955['id']])){_0x526577[_0x2ad6('0x22')][_0x3d7955['id']]=new ServicenowAccount(_0x3d7955);}else{_0x526577['mergeFromDatabase'](_0x526577[_0x2ad6('0x22')][_0x3d7955['id']],_0x3d7955);}}}return _0x526577[_0x2ad6('0x22')];};};Realtime['prototype'][_0x2ad6('0x4e')]=function(){var _0x190056=this;return function(_0xbae205){if(_0xbae205){freeIsNotKey(_0xbae205,_0x190056[_0x2ad6('0x23')],'id');for(var _0xfeed5e=0x0,_0x58a8b3={},_0x323e71={};_0xfeed5e<_0xbae205['length'];_0xfeed5e+=0x1){_0x58a8b3=_0xbae205[_0xfeed5e];if(_[_0x2ad6('0x41')](_0x190056[_0x2ad6('0x23')][_0x58a8b3['id']])){_0x190056[_0x2ad6('0x23')][_0x58a8b3['id']]=new Dynamics365Account(_0x58a8b3);}else{_0x190056['mergeFromDatabase'](_0x190056[_0x2ad6('0x23')][_0x58a8b3['id']],_0x58a8b3);}}}return _0x190056[_0x2ad6('0x23')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4f')]=function(){var _0x5764f3=this;return function(_0x863e5d){if(_0x863e5d){freeIsNotKey(_0x863e5d,_0x5764f3[_0x2ad6('0x24')],'id');for(var _0x456afb=0x0,_0x38ef78={},_0x3ba89d={};_0x456afb<_0x863e5d['length'];_0x456afb+=0x1){_0x38ef78=_0x863e5d[_0x456afb];if(_[_0x2ad6('0x41')](_0x5764f3[_0x2ad6('0x24')][_0x38ef78['id']])){_0x5764f3[_0x2ad6('0x24')][_0x38ef78['id']]=new FreshsalesAccount(_0x38ef78);}else{_0x5764f3[_0x2ad6('0x3d')](_0x5764f3[_0x2ad6('0x24')][_0x38ef78['id']],_0x38ef78);}}}return _0x5764f3['freshsalesAccounts'];};};Realtime[_0x2ad6('0x42')]['initVoiceQueueHopperHistory']=function(){var _0x1dbdaa=this;return function(_0x255db9){for(var _0x27694c=0x0;_0x27694c<_0x255db9['length'];_0x27694c+=0x1){_[_0x2ad6('0x50')](_0x1dbdaa[_0x2ad6('0x13')][_0x255db9[_0x27694c]['name']],_0x255db9[_0x27694c]);}return _0x1dbdaa['voiceQueues'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x51')]=function(){var _0x1cff97=this;return function(_0x115e4e){clearVoiceQueues(_0x1cff97['voiceQueues']);if(_0x115e4e){_0x115e4e=_[_0x2ad6('0x52')](_0x115e4e,_0x2ad6('0x53'));for(var _0x7bc7f4 in _0x115e4e){if(_0x115e4e[_0x2ad6('0x27')](_0x7bc7f4)){var _0xebe6c7={};for(var _0x32c5fb=0x0;_0x32c5fb<_0x115e4e[_0x7bc7f4][_0x2ad6('0x3f')];_0x32c5fb+=0x1){var _0x562142=_0x115e4e[_0x7bc7f4][_0x32c5fb]['queue'];if(_0x1cff97[_0x2ad6('0x13')][_0x562142]){if(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x54')]){_0x1cff97['voiceQueues'][_0x562142][_0x2ad6('0x32')]+=0x1;}if(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x55')]){_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x33')]+=0x1;}_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x2d')]+=moment(_0x115e4e[_0x7bc7f4][_0x32c5fb]['queuecallerleaveAt'])[_0x2ad6('0x56')](moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x57')]),_0x2ad6('0x58'))||0x0;if(_0x32c5fb===_0x115e4e[_0x7bc7f4][_0x2ad6('0x3f')]-0x1){_0x1cff97[_0x2ad6('0x13')][_0x562142]['sumDuration']+=moment(_0x115e4e[_0x7bc7f4][_0x32c5fb]['queuecallercompleteAt']||_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x59')]||_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5a')])[_0x2ad6('0x56')](moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x57')]),_0x2ad6('0x58'))||0x0;_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x2c')]+=0x1;if(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5b')]){_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x5c')]+=0x1;_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x2f')]+=moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5d')])[_0x2ad6('0x56')](moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5e')]),_0x2ad6('0x58'))||0x0;}}else{_0x1cff97[_0x2ad6('0x13')][_0x562142]['sumDuration']+=_0x1cff97['voiceQueues'][_0x562142][_0x2ad6('0x2d')]||0x0;}}}}}}return _0x1cff97[_0x2ad6('0x13')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x5f')]=function(){var _0x26d08c=this;return function(_0x50e490){clearVoiceCallReports(_0x26d08c['outbound']);if(_0x50e490){for(var _0x2015a2=0x0;_0x2015a2<_0x50e490[_0x2ad6('0x3f')];_0x2015a2+=0x1){_0x26d08c[_0x2ad6('0x17')][_0x2ad6('0x2c')]+=0x1;_0x26d08c['outbound'][_0x2ad6('0x2e')]+=_0x50e490[_0x2015a2][_0x2ad6('0x60')];if(_0x50e490[_0x2015a2][_0x2ad6('0x61')]==='ANSWERED'){_0x26d08c[_0x2ad6('0x17')][_0x2ad6('0x5c')]+=0x1;_0x26d08c[_0x2ad6('0x17')]['sumHoldTime']+=_0x50e490[_0x2015a2][_0x2ad6('0x60')]-_0x50e490[_0x2015a2][_0x2ad6('0x62')]||0x0;_0x26d08c['outbound'][_0x2ad6('0x2f')]+=_0x50e490[_0x2015a2][_0x2ad6('0x62')];}}}return _0x26d08c[_0x2ad6('0x17')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x63')]=function(){var _0x18b8fd=this;return function(_0x249a17){if(_0x249a17){freeIsNotKey(_0x249a17,_0x18b8fd['campaigns'],_0x2ad6('0x2a'));for(var _0x299ac3=0x0,_0x12b5e9={};_0x299ac3<_0x249a17['length'];_0x299ac3+=0x1){_0x12b5e9=_0x249a17[_0x299ac3];if(_['isUndefined'](_0x18b8fd[_0x2ad6('0x15')][_0x12b5e9[_0x2ad6('0x2a')]])){_0x18b8fd['campaigns'][_0x12b5e9['name']]=new Campaign(_0x12b5e9);}else{_0x18b8fd[_0x2ad6('0x3d')](_0x18b8fd[_0x2ad6('0x15')][_0x12b5e9['name']],_0x12b5e9);_0x18b8fd[_0x2ad6('0x15')][_0x12b5e9[_0x2ad6('0x2a')]][_0x2ad6('0x64')]=_0x12b5e9[_0x2ad6('0x65')]?_0x12b5e9['SquareProject'][_0x2ad6('0x2a')]:undefined;}}}return _0x18b8fd[_0x2ad6('0x15')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x66')]=function(){var _0x5ac591=this;return function(_0x521c39){if(_0x521c39){freeIsNotKey(_0x521c39,_0x5ac591[_0x2ad6('0x18')],'id');for(var _0x64d9f7=0x0,_0x57c9d7={};_0x64d9f7<_0x521c39[_0x2ad6('0x3f')];_0x64d9f7+=0x1){_0x57c9d7=_0x521c39[_0x64d9f7];if(_[_0x2ad6('0x41')](_0x5ac591['voiceExtensions'][_0x57c9d7['id']])){_0x5ac591[_0x2ad6('0x18')][_0x57c9d7['id']]=new VoiceExtension(_0x57c9d7);}else{_0x5ac591[_0x2ad6('0x3d')](_0x5ac591[_0x2ad6('0x18')][_0x57c9d7['id']],_0x57c9d7);}}}return _0x5ac591[_0x2ad6('0x18')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x67')]=function(){var _0x4438c5=this;return function(_0x1db44e){clearCampaigns(_0x4438c5[_0x2ad6('0x15')]);for(var _0x5f3f33=0x0;_0x5f3f33<_0x1db44e['length'];_0x5f3f33+=0x1){_[_0x2ad6('0x50')](_0x4438c5[_0x2ad6('0x15')][_0x1db44e[_0x5f3f33][_0x2ad6('0x2a')]],_0x1db44e[_0x5f3f33]);}return _0x4438c5['campaigns'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x68')]=function(){var _0x1ef93e=this;return function(_0x5d87b8){if(_0x5d87b8){freeIsNotKey(_0x5d87b8,_0x1ef93e[_0x2ad6('0x25')],'id');for(var _0x55409f=0x0,_0x11c61d={},_0x56685a={};_0x55409f<_0x5d87b8['length'];_0x55409f+=0x1){_0x11c61d=_0x5d87b8[_0x55409f];if(_[_0x2ad6('0x41')](_0x1ef93e[_0x2ad6('0x25')][_0x11c61d['id']])){_0x1ef93e[_0x2ad6('0x25')][_0x11c61d['id']]=new FaxAccount(_0x11c61d);}else{_0x1ef93e[_0x2ad6('0x3d')](_0x1ef93e['faxAccounts'][_0x11c61d['id']],_0x11c61d);}}}return _0x1ef93e[_0x2ad6('0x25')];};};module[_0x2ad6('0x69')]=Realtime; \ No newline at end of file +var _0x0c76=['faxAccounts','hasOwnProperty','SIP/%s','name','mapKeys','interface','format','total','answered','sumBillable','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','agents','length','isUndefined','initTelephones','initTrunks','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','queue','queuecallerexit','queuecallerabandon','sumHoldTime','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallerleaveAt','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','outbound','voiceExtensions','outboundChannels','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','freshsalesAccounts'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x0c76,0x1cf));var _0x60c7=function(_0x52ec16,_0x5b93f6){_0x52ec16=_0x52ec16-0x0;var _0x4763cb=_0x0c76[_0x52ec16];return _0x4763cb;};'use strict';var BPromise=require('bluebird');var util=require(_0x60c7('0x0'));var _=require(_0x60c7('0x1'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x60c7('0x2'));var Trunk=require(_0x60c7('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x60c7('0x4'));var Campaign=require(_0x60c7('0x5'));var VoiceExtension=require(_0x60c7('0x6'));var ZendeskAccount=require(_0x60c7('0x7'));var SalesforceAccount=require(_0x60c7('0x8'));var FreshdeskAccount=require(_0x60c7('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x60c7('0xa'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x60c7('0xb'));var ServicenowAccount=require(_0x60c7('0xc'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x60c7('0xd'));var Realtime=function(){this['agents']={};this[_0x60c7('0xe')]={};this[_0x60c7('0xf')]={};this[_0x60c7('0x10')]={};this[_0x60c7('0x11')]={};this['campaigns']={};this['templates']={};this[_0x60c7('0x12')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x60c7('0x13')]={};this['channels']={};this['queueChannels']={};this[_0x60c7('0x14')]={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x60c7('0x15')]={};this[_0x60c7('0x16')]={};this[_0x60c7('0x17')]={};this[_0x60c7('0x18')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x60c7('0x19')]={};this[_0x60c7('0x1a')]={};this[_0x60c7('0x1b')]={};};function freeIsNotKey(_0x190b91,_0x316930,_0x1092a5){var _0x5ac1b1=_['mapKeys'](_0x190b91,function(_0x35c9b1,_0x279692){return _0x35c9b1[_0x1092a5];});for(var _0xd22857 in _0x316930){if(_0x316930[_0x60c7('0x1c')](_0xd22857)){if(!_0x5ac1b1[_0xd22857]){delete _0x316930[_0xd22857];}}}}function freeIsNotKeySip(_0x5b183d,_0x4551e9){var _0x2a80ab=_['mapKeys'](_0x5b183d,function(_0xa1703d,_0x4f4872){return util['format'](_0x60c7('0x1d'),_0xa1703d[_0x60c7('0x1e')]);});for(var _0x5ee3af in _0x4551e9){if(_0x4551e9[_0x60c7('0x1c')](_0x5ee3af)){if(!_0x2a80ab[_0x5ee3af]){delete _0x4551e9[_0x5ee3af];}}}}function freeIsNotKeyAgent(_0x37e84e,_0x36f823){var _0x2d452b=_[_0x60c7('0x1f')](_0x37e84e,function(_0x42d4a6,_0x205e46){var _0x175c74=_['isNil'](_0x42d4a6[_0x60c7('0x20')])?util[_0x60c7('0x21')]('SIP/%s',_0x42d4a6[_0x60c7('0x1e')]):_0x42d4a6[_0x60c7('0x20')];return _0x175c74;});for(var _0x4509a2 in _0x36f823){if(_0x36f823[_0x60c7('0x1c')](_0x4509a2)){if(!_0x2d452b[_0x4509a2]){delete _0x36f823[_0x4509a2];}}}}function clearVoiceCallReports(_0x7e3824){_0x7e3824[_0x60c7('0x22')]=0x0;_0x7e3824[_0x60c7('0x23')]=0x0;_0x7e3824['sumHoldTime']=0x0;_0x7e3824['sumDuration']=0x0;_0x7e3824[_0x60c7('0x24')]=0x0;}function clearCampaigns(_0x10a839){if(!_['isEmpty'](_0x10a839)){for(var _0x4a4607 in _0x10a839){if(_0x10a839[_0x60c7('0x1c')](_0x4a4607)){_0x10a839[_0x4a4607]['ivrTotalCallsDays']=0x0;_0x10a839[_0x4a4607][_0x60c7('0x25')]=0x0;}}}}function clearVoiceQueues(_0x2aa7dc){if(!_[_0x60c7('0x26')](_0x2aa7dc)){for(var _0x20f2af in _0x2aa7dc){if(_0x2aa7dc[_0x60c7('0x1c')](_0x20f2af)){_0x2aa7dc[_0x20f2af][_0x60c7('0x22')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x23')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x27')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x28')]=0x0;_0x2aa7dc[_0x20f2af]['sumHoldTime']=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x29')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x24')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x2a')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x2b')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x2c')]=0x0;_0x2aa7dc[_0x20f2af]['outboundCongestionCallsDay']=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x2d')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x2e')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x2f')]=0x0;_0x2aa7dc[_0x20f2af]['outboundDropCallsDayCallersExit']=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x30')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x31')]=0x0;_0x2aa7dc[_0x20f2af]['outboundRejectCallsDay']=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x32')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x2a')]=0x0;_0x2aa7dc[_0x20f2af][_0x60c7('0x33')]=0x0;_0x2aa7dc[_0x20f2af]['queueStatusComplete']=!![];}}}}Realtime[_0x60c7('0x34')][_0x60c7('0x35')]=function(_0x515cab,_0x6beda5){for(var _0x141285 in _0x6beda5){if(_0x515cab[_0x60c7('0x1c')](_0x141285)){_0x515cab[_0x141285]=_0x6beda5[_0x141285];}}};Realtime[_0x60c7('0x34')]['initAgents']=function(){var _0x1ae305=this;return function(_0x5ab688){if(_0x5ab688){freeIsNotKeyAgent(_0x5ab688,_0x1ae305[_0x60c7('0x36')]);for(var _0xeb4f62=0x0,_0x593d53={},_0x519377={};_0xeb4f62<_0x5ab688[_0x60c7('0x37')];_0xeb4f62+=0x1){_0x593d53=_0x5ab688[_0xeb4f62];var _0x4f49c2=_['isNil'](_0x593d53[_0x60c7('0x20')])?util[_0x60c7('0x21')]('SIP/%s',_0x593d53['name']):_0x593d53['interface'];if(_[_0x60c7('0x38')](_0x1ae305[_0x60c7('0x36')][_0x4f49c2])){_0x1ae305['agents'][_0x4f49c2]=new Agent(_0x593d53);}else{_0x1ae305[_0x60c7('0x35')](_0x1ae305[_0x60c7('0x36')][_0x4f49c2],_0x593d53);}}}return _0x1ae305[_0x60c7('0x36')];};};Realtime['prototype'][_0x60c7('0x39')]=function(){var _0x27c424=this;return function(_0x54a857){if(_0x54a857){freeIsNotKeySip(_0x54a857,_0x27c424[_0x60c7('0xe')]);for(var _0x2a8f7c=0x0,_0x58b15b={},_0x3132f4={};_0x2a8f7c<_0x54a857[_0x60c7('0x37')];_0x2a8f7c+=0x1){_0x58b15b=_0x54a857[_0x2a8f7c];if(_[_0x60c7('0x38')](_0x27c424['telephones'][util[_0x60c7('0x21')](_0x60c7('0x1d'),_0x58b15b[_0x60c7('0x1e')])])){_0x27c424['telephones'][util[_0x60c7('0x21')](_0x60c7('0x1d'),_0x58b15b[_0x60c7('0x1e')])]=new Telephone(_0x58b15b);}else{_0x27c424[_0x60c7('0x35')](_0x27c424[_0x60c7('0xe')][util['format'](_0x60c7('0x1d'),_0x58b15b[_0x60c7('0x1e')])],_0x58b15b);}}}return _0x27c424[_0x60c7('0xe')];};};Realtime['prototype'][_0x60c7('0x3a')]=function(){var _0x4bbeaa=this;return function(_0x424078){if(_0x424078){freeIsNotKeySip(_0x424078,_0x4bbeaa[_0x60c7('0xf')]);for(var _0x56f444=0x0,_0x574d9d={},_0x45d8de={};_0x56f444<_0x424078['length'];_0x56f444+=0x1){_0x574d9d=_0x424078[_0x56f444];if(_[_0x60c7('0x38')](_0x4bbeaa['trunks'][util['format'](_0x60c7('0x1d'),_0x574d9d['name'])])){_0x4bbeaa[_0x60c7('0xf')][util[_0x60c7('0x21')](_0x60c7('0x1d'),_0x574d9d[_0x60c7('0x1e')])]=new Trunk(_0x574d9d);}else{_0x4bbeaa[_0x60c7('0x35')](_0x4bbeaa[_0x60c7('0xf')][util[_0x60c7('0x21')]('SIP/%s',_0x574d9d[_0x60c7('0x1e')])],_0x574d9d);}}}return _0x4bbeaa[_0x60c7('0xf')];};};Realtime[_0x60c7('0x34')]['initVoiceQueues']=function(){var _0x51d419=this;return function(_0x32bc7f){if(_0x32bc7f){freeIsNotKey(_0x32bc7f,_0x51d419['voiceQueues'],'name');for(var _0x2df808=0x0,_0x52b792={},_0x4f4f7c={};_0x2df808<_0x32bc7f['length'];_0x2df808+=0x1){_0x52b792=_0x32bc7f[_0x2df808];if(_[_0x60c7('0x38')](_0x51d419['voiceQueues'][_0x52b792[_0x60c7('0x1e')]])){_0x51d419['voiceQueues'][_0x52b792[_0x60c7('0x1e')]]=new VoiceQueue(_0x52b792);}else{_0x51d419[_0x60c7('0x35')](_0x51d419[_0x60c7('0x10')][_0x52b792[_0x60c7('0x1e')]],_0x52b792);}}}return _0x51d419['voiceQueues'];};};Realtime['prototype']['initTriggers']=function(){var _0x2a9e4f=this;return function(_0x39e0fc){if(_0x39e0fc){freeIsNotKey(_0x39e0fc,_0x2a9e4f[_0x60c7('0x11')],'id');for(var _0x4ebf67=0x0,_0x299d3e={},_0x78641={};_0x4ebf67<_0x39e0fc[_0x60c7('0x37')];_0x4ebf67+=0x1){_0x299d3e=_0x39e0fc[_0x4ebf67];if(_[_0x60c7('0x38')](_0x2a9e4f[_0x60c7('0x11')][_0x299d3e['id']])){_0x2a9e4f[_0x60c7('0x11')][_0x299d3e['id']]=new Trigger(_0x299d3e);}else{_0x2a9e4f[_0x60c7('0x35')](_0x2a9e4f['triggers'][_0x299d3e['id']],_0x299d3e);}}}return _0x2a9e4f[_0x60c7('0x11')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x3b')]=function(){var _0x401074=this;return function(_0x1106bd){if(_0x1106bd){freeIsNotKey(_0x1106bd,_0x401074[_0x60c7('0x3c')],'id');for(var _0x4327b7=0x0,_0x3f4eea={},_0x3c4627={};_0x4327b7<_0x1106bd[_0x60c7('0x37')];_0x4327b7+=0x1){_0x3f4eea=_0x1106bd[_0x4327b7];if(_[_0x60c7('0x38')](_0x401074[_0x60c7('0x3c')][_0x3f4eea['id']])){_0x401074[_0x60c7('0x3c')][_0x3f4eea['id']]=new Template(_0x3f4eea);}else{_0x401074[_0x60c7('0x35')](_0x401074[_0x60c7('0x3c')][_0x3f4eea['id']],_0x3f4eea);}}}return _0x401074[_0x60c7('0x3c')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x3d')]=function(){var _0x2446c1=this;return function(_0x41cc18){if(_0x41cc18){freeIsNotKey(_0x41cc18,_0x2446c1[_0x60c7('0x3e')],'id');for(var _0xedabf0=0x0,_0x45c42f={},_0x42e669={};_0xedabf0<_0x41cc18[_0x60c7('0x37')];_0xedabf0+=0x1){_0x45c42f=_0x41cc18[_0xedabf0];if(_[_0x60c7('0x38')](_0x2446c1[_0x60c7('0x3e')][_0x45c42f['id']])){_0x2446c1[_0x60c7('0x3e')][_0x45c42f['id']]=new ZendeskAccount(_0x45c42f);}else{_0x2446c1[_0x60c7('0x35')](_0x2446c1[_0x60c7('0x3e')][_0x45c42f['id']],_0x45c42f);}}}return _0x2446c1['zendeskAccounts'];};};Realtime['prototype'][_0x60c7('0x3f')]=function(){var _0x9af9f8=this;return function(_0x1f7fdd){if(_0x1f7fdd){freeIsNotKey(_0x1f7fdd,_0x9af9f8[_0x60c7('0x40')],'id');for(var _0x17d064=0x0,_0x35732a={},_0xcd140d={};_0x17d064<_0x1f7fdd[_0x60c7('0x37')];_0x17d064+=0x1){_0x35732a=_0x1f7fdd[_0x17d064];if(_['isUndefined'](_0x9af9f8['salesforceAccounts'][_0x35732a['id']])){_0x9af9f8[_0x60c7('0x40')][_0x35732a['id']]=new SalesforceAccount(_0x35732a);}else{_0x9af9f8[_0x60c7('0x35')](_0x9af9f8[_0x60c7('0x40')][_0x35732a['id']],_0x35732a);}}}return _0x9af9f8['salesforceAccounts'];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x41feba=this;return function(_0x44938e){if(_0x44938e){freeIsNotKey(_0x44938e,_0x41feba['freshdeskAccounts'],'id');for(var _0x32963a=0x0,_0x39e925={},_0x31653f={};_0x32963a<_0x44938e[_0x60c7('0x37')];_0x32963a+=0x1){_0x39e925=_0x44938e[_0x32963a];if(_[_0x60c7('0x38')](_0x41feba[_0x60c7('0x16')][_0x39e925['id']])){_0x41feba[_0x60c7('0x16')][_0x39e925['id']]=new FreshdeskAccount(_0x39e925);}else{_0x41feba[_0x60c7('0x35')](_0x41feba[_0x60c7('0x16')][_0x39e925['id']],_0x39e925);}}}return _0x41feba[_0x60c7('0x16')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x41')]=function(){var _0xcaca3f=this;return function(_0x1a7d4e){if(_0x1a7d4e){freeIsNotKey(_0x1a7d4e,_0xcaca3f[_0x60c7('0x17')],'id');for(var _0x30d1a2=0x0,_0x4f5527={},_0x32182b={};_0x30d1a2<_0x1a7d4e[_0x60c7('0x37')];_0x30d1a2+=0x1){_0x4f5527=_0x1a7d4e[_0x30d1a2];if(_[_0x60c7('0x38')](_0xcaca3f[_0x60c7('0x17')][_0x4f5527['id']])){_0xcaca3f[_0x60c7('0x17')][_0x4f5527['id']]=new ZohoAccount(_0x4f5527);}else{_0xcaca3f['mergeFromDatabase'](_0xcaca3f[_0x60c7('0x17')][_0x4f5527['id']],_0x4f5527);}}}return _0xcaca3f['zohoAccounts'];};};Realtime[_0x60c7('0x34')][_0x60c7('0x42')]=function(){var _0x532538=this;return function(_0x41cfe4){if(_0x41cfe4){freeIsNotKey(_0x41cfe4,_0x532538[_0x60c7('0x18')],'id');for(var _0x107c83=0x0,_0x29e8f3={},_0x3b91bd={};_0x107c83<_0x41cfe4[_0x60c7('0x37')];_0x107c83+=0x1){_0x29e8f3=_0x41cfe4[_0x107c83];if(_[_0x60c7('0x38')](_0x532538[_0x60c7('0x18')][_0x29e8f3['id']])){_0x532538[_0x60c7('0x18')][_0x29e8f3['id']]=new DeskAccount(_0x29e8f3);}else{_0x532538[_0x60c7('0x35')](_0x532538[_0x60c7('0x18')][_0x29e8f3['id']],_0x29e8f3);}}}return _0x532538[_0x60c7('0x18')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x43')]=function(){var _0x4b59f5=this;return function(_0x5d1146){if(_0x5d1146){freeIsNotKey(_0x5d1146,_0x4b59f5['sugarcrmAccounts'],'id');for(var _0x4bab39=0x0,_0x41255f={},_0xafba93={};_0x4bab39<_0x5d1146[_0x60c7('0x37')];_0x4bab39+=0x1){_0x41255f=_0x5d1146[_0x4bab39];if(_[_0x60c7('0x38')](_0x4b59f5[_0x60c7('0x15')][_0x41255f['id']])){_0x4b59f5[_0x60c7('0x15')][_0x41255f['id']]=new SugarcrmAccount(_0x41255f);}else{_0x4b59f5[_0x60c7('0x35')](_0x4b59f5[_0x60c7('0x15')][_0x41255f['id']],_0x41255f);}}}return _0x4b59f5[_0x60c7('0x15')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x44')]=function(){var _0x364363=this;return function(_0x718958){if(_0x718958){freeIsNotKey(_0x718958,_0x364363[_0x60c7('0x45')],'id');for(var _0x54504a=0x0,_0x137efd={},_0x481cd0={};_0x54504a<_0x718958['length'];_0x54504a+=0x1){_0x137efd=_0x718958[_0x54504a];if(_[_0x60c7('0x38')](_0x364363[_0x60c7('0x45')][_0x137efd['id']])){_0x364363['vtigerAccounts'][_0x137efd['id']]=new VtigerAccount(_0x137efd);}else{_0x364363[_0x60c7('0x35')](_0x364363[_0x60c7('0x45')][_0x137efd['id']],_0x137efd);}}}return _0x364363[_0x60c7('0x45')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x46')]=function(){var _0xce85d9=this;return function(_0x109c0a){if(_0x109c0a){freeIsNotKey(_0x109c0a,_0xce85d9['servicenowAccounts'],'id');for(var _0xa09a12=0x0,_0x40a80b={},_0x469ff0={};_0xa09a12<_0x109c0a[_0x60c7('0x37')];_0xa09a12+=0x1){_0x40a80b=_0x109c0a[_0xa09a12];if(_[_0x60c7('0x38')](_0xce85d9[_0x60c7('0x47')][_0x40a80b['id']])){_0xce85d9[_0x60c7('0x47')][_0x40a80b['id']]=new ServicenowAccount(_0x40a80b);}else{_0xce85d9[_0x60c7('0x35')](_0xce85d9[_0x60c7('0x47')][_0x40a80b['id']],_0x40a80b);}}}return _0xce85d9['servicenowAccounts'];};};Realtime[_0x60c7('0x34')][_0x60c7('0x48')]=function(){var _0x5db627=this;return function(_0x43aebf){if(_0x43aebf){freeIsNotKey(_0x43aebf,_0x5db627['dynamics365Accounts'],'id');for(var _0x5d27d6=0x0,_0x1a81f4={},_0x29a075={};_0x5d27d6<_0x43aebf[_0x60c7('0x37')];_0x5d27d6+=0x1){_0x1a81f4=_0x43aebf[_0x5d27d6];if(_['isUndefined'](_0x5db627[_0x60c7('0x19')][_0x1a81f4['id']])){_0x5db627[_0x60c7('0x19')][_0x1a81f4['id']]=new Dynamics365Account(_0x1a81f4);}else{_0x5db627['mergeFromDatabase'](_0x5db627[_0x60c7('0x19')][_0x1a81f4['id']],_0x1a81f4);}}}return _0x5db627[_0x60c7('0x19')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x49')]=function(){var _0x3e28c7=this;return function(_0x59897a){if(_0x59897a){freeIsNotKey(_0x59897a,_0x3e28c7[_0x60c7('0x1a')],'id');for(var _0x2a4033=0x0,_0x4410ab={},_0x4d3c38={};_0x2a4033<_0x59897a[_0x60c7('0x37')];_0x2a4033+=0x1){_0x4410ab=_0x59897a[_0x2a4033];if(_[_0x60c7('0x38')](_0x3e28c7[_0x60c7('0x1a')][_0x4410ab['id']])){_0x3e28c7['freshsalesAccounts'][_0x4410ab['id']]=new FreshsalesAccount(_0x4410ab);}else{_0x3e28c7[_0x60c7('0x35')](_0x3e28c7[_0x60c7('0x1a')][_0x4410ab['id']],_0x4410ab);}}}return _0x3e28c7[_0x60c7('0x1a')];};};Realtime[_0x60c7('0x34')]['initVoiceQueueHopperHistory']=function(){var _0x3215f4=this;return function(_0x394ccd){for(var _0x8004d7=0x0;_0x8004d7<_0x394ccd[_0x60c7('0x37')];_0x8004d7+=0x1){_[_0x60c7('0x4a')](_0x3215f4[_0x60c7('0x10')][_0x394ccd[_0x8004d7][_0x60c7('0x1e')]],_0x394ccd[_0x8004d7]);}return _0x3215f4[_0x60c7('0x10')];};};Realtime[_0x60c7('0x34')]['initVoiceQueueReports']=function(){var _0x4d1b21=this;return function(_0x3a8115){clearVoiceQueues(_0x4d1b21['voiceQueues']);if(_0x3a8115){_0x3a8115=_['groupBy'](_0x3a8115,'uniqueid');for(var _0x49d638 in _0x3a8115){if(_0x3a8115[_0x60c7('0x1c')](_0x49d638)){var _0x5c7789={};for(var _0x8aa44=0x0;_0x8aa44<_0x3a8115[_0x49d638][_0x60c7('0x37')];_0x8aa44+=0x1){var _0x1535f5=_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x4b')];if(_0x4d1b21[_0x60c7('0x10')][_0x1535f5]){if(_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x4c')]){_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x27')]+=0x1;}if(_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x4d')]){_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x28')]+=0x1;}_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x4e')]+=moment(_0x3a8115[_0x49d638][_0x8aa44]['queuecallerleaveAt'])[_0x60c7('0x4f')](moment(_0x3a8115[_0x49d638][_0x8aa44]['queuecallerjoinAt']),_0x60c7('0x50'))||0x0;if(_0x8aa44===_0x3a8115[_0x49d638][_0x60c7('0x37')]-0x1){_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x29')]+=moment(_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x51')]||_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x52')]||_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x53')])[_0x60c7('0x4f')](moment(_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x54')]),_0x60c7('0x50'))||0x0;_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x22')]+=0x1;if(_0x3a8115[_0x49d638][_0x8aa44]['queuecallercomplete']){_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x23')]+=0x1;_0x4d1b21['voiceQueues'][_0x1535f5][_0x60c7('0x24')]+=moment(_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x51')])['diff'](moment(_0x3a8115[_0x49d638][_0x8aa44][_0x60c7('0x55')]),_0x60c7('0x50'))||0x0;}}else{_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x29')]+=_0x4d1b21[_0x60c7('0x10')][_0x1535f5][_0x60c7('0x4e')]||0x0;}}}}}}return _0x4d1b21[_0x60c7('0x10')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x56')]=function(){var _0x3d9d78=this;return function(_0x4825c9){clearVoiceCallReports(_0x3d9d78[_0x60c7('0x12')]);if(_0x4825c9){for(var _0x3abdaa=0x0;_0x3abdaa<_0x4825c9[_0x60c7('0x37')];_0x3abdaa+=0x1){_0x3d9d78['outbound']['total']+=0x1;_0x3d9d78[_0x60c7('0x12')][_0x60c7('0x29')]+=_0x4825c9[_0x3abdaa]['duration'];if(_0x4825c9[_0x3abdaa][_0x60c7('0x57')]===_0x60c7('0x58')){_0x3d9d78['outbound'][_0x60c7('0x23')]+=0x1;_0x3d9d78[_0x60c7('0x12')][_0x60c7('0x4e')]+=_0x4825c9[_0x3abdaa][_0x60c7('0x59')]-_0x4825c9[_0x3abdaa][_0x60c7('0x5a')]||0x0;_0x3d9d78[_0x60c7('0x12')][_0x60c7('0x24')]+=_0x4825c9[_0x3abdaa][_0x60c7('0x5a')];}}}return _0x3d9d78[_0x60c7('0x12')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x5b')]=function(){var _0x4b4959=this;return function(_0x9ef0a){if(_0x9ef0a){freeIsNotKey(_0x9ef0a,_0x4b4959[_0x60c7('0x5c')],_0x60c7('0x1e'));for(var _0xab8827=0x0,_0x351add={};_0xab8827<_0x9ef0a[_0x60c7('0x37')];_0xab8827+=0x1){_0x351add=_0x9ef0a[_0xab8827];if(_['isUndefined'](_0x4b4959[_0x60c7('0x5c')][_0x351add['name']])){_0x4b4959[_0x60c7('0x5c')][_0x351add['name']]=new Campaign(_0x351add);}else{_0x4b4959[_0x60c7('0x35')](_0x4b4959[_0x60c7('0x5c')][_0x351add[_0x60c7('0x1e')]],_0x351add);_0x4b4959[_0x60c7('0x5c')][_0x351add['name']]['dialQueueProject']=_0x351add[_0x60c7('0x5d')]?_0x351add[_0x60c7('0x5d')][_0x60c7('0x1e')]:undefined;}}}return _0x4b4959[_0x60c7('0x5c')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x5e')]=function(){var _0x19f727=this;return function(_0x43588e){if(_0x43588e){freeIsNotKey(_0x43588e,_0x19f727[_0x60c7('0x13')],'id');for(var _0x43038b=0x0,_0x14ef0e={};_0x43038b<_0x43588e[_0x60c7('0x37')];_0x43038b+=0x1){_0x14ef0e=_0x43588e[_0x43038b];if(_[_0x60c7('0x38')](_0x19f727[_0x60c7('0x13')][_0x14ef0e['id']])){_0x19f727[_0x60c7('0x13')][_0x14ef0e['id']]=new VoiceExtension(_0x14ef0e);}else{_0x19f727[_0x60c7('0x35')](_0x19f727['voiceExtensions'][_0x14ef0e['id']],_0x14ef0e);}}}return _0x19f727[_0x60c7('0x13')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x5f')]=function(){var _0x42e43c=this;return function(_0x16d1d4){clearCampaigns(_0x42e43c['campaigns']);for(var _0x222770=0x0;_0x222770<_0x16d1d4[_0x60c7('0x37')];_0x222770+=0x1){_[_0x60c7('0x4a')](_0x42e43c['campaigns'][_0x16d1d4[_0x222770][_0x60c7('0x1e')]],_0x16d1d4[_0x222770]);}return _0x42e43c[_0x60c7('0x5c')];};};Realtime[_0x60c7('0x34')][_0x60c7('0x60')]=function(){var _0x5c4c3a=this;return function(_0x5d5b52){if(_0x5d5b52){freeIsNotKey(_0x5d5b52,_0x5c4c3a['faxAccounts'],'id');for(var _0x5b3aae=0x0,_0xb173c1={},_0x521b56={};_0x5b3aae<_0x5d5b52[_0x60c7('0x37')];_0x5b3aae+=0x1){_0xb173c1=_0x5d5b52[_0x5b3aae];if(_['isUndefined'](_0x5c4c3a['faxAccounts'][_0xb173c1['id']])){_0x5c4c3a[_0x60c7('0x1b')][_0xb173c1['id']]=new FaxAccount(_0xb173c1);}else{_0x5c4c3a[_0x60c7('0x35')](_0x5c4c3a[_0x60c7('0x1b')][_0xb173c1['id']],_0xb173c1);}}}return _0x5c4c3a[_0x60c7('0x1b')];};};module[_0x60c7('0x61')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 7bdcbf5..387b34b 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 _0xab55=['destination','exten','type','dialer','lastapplication','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','create','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','name','interface','format','SIP/%s','length','accountcode','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xab55,0x137));var _0x5ab5=function(_0x683092,_0x4e32dc){_0x683092=_0x683092-0x0;var _0xba9778=_0xab55[_0x683092];return _0xba9778;};'use strict';var _=require(_0x5ab5('0x0'));var moment=require('moment');var util=require(_0x5ab5('0x1'));var config=require(_0x5ab5('0x2'));var ami=require(_0x5ab5('0x3'));var RpcVoiceAgentReport=require(_0x5ab5('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x5ab5('0x5'));var RpcMemberReport=require(_0x5ab5('0x6'));var RpcVoiceQueueReport=require(_0x5ab5('0x7'));var RpcVoiceRecording=require(_0x5ab5('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x5ab5('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x5ab5('0xa'));var VoiceDialReport=require(_0x5ab5('0xb'));var UserReport=require(_0x5ab5('0xc'));function Report(_0x18e6e3){this['realtime']=_0x18e6e3;this[_0x5ab5('0xd')]=_0x18e6e3[_0x5ab5('0xd')];this[_0x5ab5('0xe')]=_0x18e6e3[_0x5ab5('0xe')];}Report[_0x5ab5('0xf')]['sync']=function(_0x335432){var _0x33713e=new VoiceQueueReport(this[_0x5ab5('0x10')]);var _0x5d1d9e=new VoiceAgentReport(this[_0x5ab5('0x10')]);var _0x4e7510=new VoiceDialReport(this[_0x5ab5('0x10')]);var _0x2525ea=new VoiceCallReport(this['realtime']);var _0x5592ee=new UserReport(this[_0x5ab5('0x10')]);if(config[_0x5ab5('0x11')]&&config['xdr']['disabled']){ami['on'](_0x5ab5('0x12'),this[_0x5ab5('0x13')][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x15'),this[_0x5ab5('0x16')][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x17'),this['voiceAgentReport'][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x18'),this[_0x5ab5('0x19')][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x1a'),this['blindTransfer'][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x1b'),this[_0x5ab5('0x1c')][_0x5ab5('0x14')](this));}};Report[_0x5ab5('0xf')][_0x5ab5('0x1d')]=function(_0x144042){var _0x354a75;_0x354a75=_[_0x5ab5('0x1e')](this[_0x5ab5('0xd')],function(_0x188eb8){return _0x188eb8['accountcode']==_0x144042||_0x188eb8['name']==_0x144042;});if(_[_0x5ab5('0x1f')](_0x354a75)){var _0x502542=_['find'](this['telephones'],function(_0x957c21){return _0x957c21['accountcode']==_0x144042||_0x957c21[_0x5ab5('0x20')]==_0x144042;});if(_0x502542){_0x354a75=_[_0x5ab5('0x1e')](this['agents'],function(_0x50ec77){return _0x50ec77[_0x5ab5('0x21')]==util[_0x5ab5('0x22')](_0x5ab5('0x23'),_0x502542[_0x5ab5('0x20')]);});}}return _0x354a75;};Report[_0x5ab5('0xf')]['voiceQueueReport']=function(_0x648bdf){for(var _0x2a8e82=0x0;_0x2a8e82<_0x648bdf[_0x5ab5('0x24')];_0x2a8e82+=0x1){var _0x28dc52=this[_0x5ab5('0x1d')](_0x648bdf[_0x2a8e82]['connectedlinenum']);if(_0x28dc52){_0x648bdf[_0x2a8e82][_0x5ab5('0x25')]=_0x28dc52['accountcode'];_0x648bdf[_0x2a8e82][_0x5ab5('0x26')]=!![];_0x648bdf[_0x2a8e82][_0x5ab5('0x27')]=_0x28dc52[_0x5ab5('0x20')];_0x648bdf[_0x2a8e82][_0x5ab5('0x21')]=_['isNil'](_0x28dc52[_0x5ab5('0x21')])?util[_0x5ab5('0x22')]('SIP/%s',_0x28dc52[_0x5ab5('0x20')]):_0x28dc52['interface'];if(_0x648bdf[_0x2a8e82][_0x5ab5('0x28')]){_0x648bdf[_0x2a8e82][_0x5ab5('0x29')]=moment()[_0x5ab5('0x22')](_0x5ab5('0x2a'));}if(_0x648bdf[_0x2a8e82][_0x5ab5('0x2b')]){_0x648bdf[_0x2a8e82][_0x5ab5('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x5ab5('0x13')](_0x648bdf[_0x2a8e82]);}RpcVoiceQueueReport['create'](_0x648bdf[_0x2a8e82]);}};function extractCalleridNumber(_0x3433e1){var _0x52def4=_0x3433e1['match'](/<(.*?)>/);return _0x52def4?_0x52def4[0x1]:_0x3433e1;}Report[_0x5ab5('0xf')][_0x5ab5('0x16')]=function(_0xf0451a){_0xf0451a[_0x5ab5('0x2d')]=_0xf0451a[_0x5ab5('0x2d')]||_0xf0451a[_0x5ab5('0x2e')];if(_0xf0451a[_0x5ab5('0x2f')]==_0x5ab5('0x30')){_0xf0451a[_0x5ab5('0x31')]='queue';_0xf0451a[_0x5ab5('0x32')]=_0xf0451a['queue'];if(_0xf0451a[_0x5ab5('0x33')]==_0x5ab5('0x34')){_0xf0451a[_0x5ab5('0x25')]='';_0xf0451a[_0x5ab5('0x2d')]=extractCalleridNumber(_0xf0451a[_0x5ab5('0x35')]);}else if(_0xf0451a['context']==_0x5ab5('0x36')){if(_0xf0451a['destination']==_0x5ab5('0x37')){_0xf0451a[_0x5ab5('0x2d')]=extractCalleridNumber(_0xf0451a[_0x5ab5('0x38')]);_0xf0451a[_0x5ab5('0x39')]=_0xf0451a[_0x5ab5('0x3a')];_0xf0451a[_0x5ab5('0x3b')]=[_0xf0451a[_0x5ab5('0x3c')],_0xf0451a[_0x5ab5('0x3c')]=_0xf0451a['destinationchannel']][0x0];_0xf0451a['callerid']=_0xf0451a[_0x5ab5('0x38')];}else{_0xf0451a[_0x5ab5('0x2d')]=_0xf0451a[_0x5ab5('0x39')];_0xf0451a[_0x5ab5('0x39')]=_0xf0451a[_0x5ab5('0x3a')];if(_0xf0451a[_0x5ab5('0x3d')]==_0x5ab5('0x3e')){_0xf0451a['accountcode']=_0xf0451a[_0x5ab5('0x3f')];}else{_0xf0451a['accountcode']='';}}}}else{_0xf0451a[_0x5ab5('0x35')]=util['format'](_0x5ab5('0x40'),_0xf0451a[_0x5ab5('0x41')],_0xf0451a[_0x5ab5('0x39')]);}if(RpcVoiceTransferReport[_0x5ab5('0x42')][_0xf0451a[_0x5ab5('0x43')]]){var _0x466343=RpcVoiceTransferReport[_0x5ab5('0x42')][_0xf0451a[_0x5ab5('0x43')]];_0x466343[_0x5ab5('0x44')]=_0xf0451a['uniqueid'];RpcVoiceTransferReport[_0x5ab5('0x45')](_0x466343);delete RpcVoiceTransferReport['transfers'][_0xf0451a[_0x5ab5('0x43')]];}RpcVoiceCallReport[_0x5ab5('0x46')](_0xf0451a);if(_0xf0451a[_0x5ab5('0x47')]){for(var _0x2bedb8=0x0;_0x2bedb8<_0xf0451a[_0x5ab5('0x48')]['length'];_0x2bedb8+=0x1){_0xf0451a[_0x5ab5('0x49')]=_0xf0451a[_0x5ab5('0x48')][_0x2bedb8]['filename'];_0xf0451a[_0x5ab5('0x4a')]=_0xf0451a[_0x5ab5('0x48')][_0x2bedb8]['createdAt'];if(_0xf0451a[_0x5ab5('0x2e')]==_0x5ab5('0x37')){_0xf0451a['calleridnum']=_0xf0451a['connectedlinenum'];_0xf0451a['calleridname']=_0xf0451a[_0x5ab5('0x4b')];_0xf0451a[_0x5ab5('0x3f')]=_0xf0451a[_0x5ab5('0x25')];_0xf0451a['connectedlinename']=_0xf0451a[_0x5ab5('0x4c')];_0xf0451a[_0x5ab5('0x2e')]=_0xf0451a[_0x5ab5('0x3a')];}else if(_0xf0451a[_0x5ab5('0x2e')]=='xcally-motion-dialer'){_0xf0451a[_0x5ab5('0x39')]=_0xf0451a['destination'];_0xf0451a[_0x5ab5('0x2e')]=_0xf0451a[_0x5ab5('0x3a')];}RpcVoiceRecording['create'](_0xf0451a);}}};Report[_0x5ab5('0xf')][_0x5ab5('0x4d')]=function(_0x4496a0){if(_[_0x5ab5('0x4e')](_0x4496a0)){_0x4496a0[_0x5ab5('0x4f')](function(_0x5e98dc){RpcVoiceAgentReport[_0x5ab5('0x46')](_0x5e98dc);});}else{RpcVoiceAgentReport[_0x5ab5('0x46')](_0x4496a0);}};Report[_0x5ab5('0xf')][_0x5ab5('0x19')]=function(_0x6d1ca6){RpcVoiceDialReport[_0x5ab5('0x46')](_0x6d1ca6);var _0x5d5702;var _0xe8ff83;var _0x340cfd=_0x6d1ca6[_0x5ab5('0x3c')];if(_[_0x5ab5('0x50')](_0x340cfd,_0x5ab5('0x51'))){_0xe8ff83=_0x340cfd[_0x5ab5('0x52')](_0x340cfd[_0x5ab5('0x53')]('/')+0x1,_0x340cfd[_0x5ab5('0x53')]('@'));_0x5d5702=_[_0x5ab5('0x1e')](this['agents'],function(_0x5d3fbb){return _0x5d3fbb[_0x5ab5('0x54')]==_0xe8ff83||_0x5d3fbb[_0x5ab5('0x55')]==_0xe8ff83||_0x5d3fbb[_0x5ab5('0x25')]==_0xe8ff83;});}else{_0xe8ff83=_0x340cfd[_0x5ab5('0x52')](_0x340cfd[_0x5ab5('0x53')]('/')+0x1,_0x340cfd[_0x5ab5('0x56')]('-'));_0x5d5702=this[_0x5ab5('0x1d')](_0xe8ff83);}if(_0x5d5702){_0x6d1ca6[_0x5ab5('0x21')]=_[_0x5ab5('0x1f')](_0x5d5702[_0x5ab5('0x21')])?util['format'](_0x5ab5('0x23'),_0x5d5702['name']):_0x5d5702[_0x5ab5('0x21')];_0x6d1ca6[_0x5ab5('0x4c')]=_0x5d5702[_0x5ab5('0x20')];_0x6d1ca6[_0x5ab5('0x25')]=_0x5d5702[_0x5ab5('0x25')];RpcMemberReport[_0x5ab5('0x19')](_0x6d1ca6);}};Report['prototype'][_0x5ab5('0x45')]=function(_0x3f10e0){RpcVoiceTransferReport[_0x5ab5('0x42')][_0x3f10e0[_0x5ab5('0x57')]]=_0x3f10e0;};Report['prototype'][_0x5ab5('0x1c')]=function(_0x34fb82){RpcVoiceTransferReport['attendedTransfer'](_0x34fb82);};module[_0x5ab5('0x58')]=Report; \ No newline at end of file +var _0x703c=['util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','custom:voiceQueueReport','bind','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','name','isNil','accountcode','format','SIP/%s','voiceQueueReport','length','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallerexit','YYYY-MM-DD\x20HH:mm:ss','match','destination','exten','dialer','lastapplication','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','monitor','monitors','filename','createdAt','connectedlinename','membername','create','forEach','startsWith','Local','indexOf','transfererlinkedid','exports','lodash'];(function(_0x51227,_0x6b5273){var _0x4abfc8=function(_0x15a936){while(--_0x15a936){_0x51227['push'](_0x51227['shift']());}};_0x4abfc8(++_0x6b5273);}(_0x703c,0x19e));var _0xc703=function(_0x564a2d,_0x45f534){_0x564a2d=_0x564a2d-0x0;var _0x4f90fb=_0x703c[_0x564a2d];return _0x4f90fb;};'use strict';var _=require(_0xc703('0x0'));var moment=require('moment');var util=require(_0xc703('0x1'));var config=require(_0xc703('0x2'));var ami=require(_0xc703('0x3'));var RpcVoiceAgentReport=require(_0xc703('0x4'));var RpcVoiceCallReport=require(_0xc703('0x5'));var RpcVoiceDialReport=require(_0xc703('0x6'));var RpcMemberReport=require(_0xc703('0x7'));var RpcVoiceQueueReport=require(_0xc703('0x8'));var RpcVoiceRecording=require(_0xc703('0x9'));var RpcVoiceTransferReport=require(_0xc703('0xa'));var VoiceQueueReport=require(_0xc703('0xb'));var VoiceCallReport=require(_0xc703('0xc'));var VoiceAgentReport=require(_0xc703('0xd'));var VoiceDialReport=require(_0xc703('0xe'));var UserReport=require(_0xc703('0xf'));function Report(_0x5d8f42){this[_0xc703('0x10')]=_0x5d8f42;this[_0xc703('0x11')]=_0x5d8f42[_0xc703('0x11')];this[_0xc703('0x12')]=_0x5d8f42['telephones'];}Report[_0xc703('0x13')]['sync']=function(_0x170b1c){var _0x3ffcee=new VoiceQueueReport(this[_0xc703('0x10')]);var _0x4f0e0=new VoiceAgentReport(this[_0xc703('0x10')]);var _0xd5401=new VoiceDialReport(this[_0xc703('0x10')]);var _0x127e89=new VoiceCallReport(this[_0xc703('0x10')]);var _0x5b27c7=new UserReport(this[_0xc703('0x10')]);if(config[_0xc703('0x14')]&&config[_0xc703('0x14')]['disabled']){ami['on'](_0xc703('0x15'),this['voiceQueueReport'][_0xc703('0x16')](this));ami['on']('custom:voiceCallReport',this[_0xc703('0x17')][_0xc703('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0xc703('0x18')][_0xc703('0x16')](this));ami['on'](_0xc703('0x19'),this[_0xc703('0x1a')][_0xc703('0x16')](this));ami['on'](_0xc703('0x1b'),this[_0xc703('0x1c')][_0xc703('0x16')](this));ami['on'](_0xc703('0x1d'),this[_0xc703('0x1e')][_0xc703('0x16')](this));}};Report[_0xc703('0x13')]['findAgent']=function(_0x22830f){var _0x507f76;_0x507f76=_[_0xc703('0x1f')](this[_0xc703('0x11')],function(_0x574484){return _0x574484['accountcode']==_0x22830f||_0x574484[_0xc703('0x20')]==_0x22830f;});if(_[_0xc703('0x21')](_0x507f76)){var _0x520d35=_['find'](this[_0xc703('0x12')],function(_0x192a86){return _0x192a86[_0xc703('0x22')]==_0x22830f||_0x192a86[_0xc703('0x20')]==_0x22830f;});if(_0x520d35){_0x507f76=_[_0xc703('0x1f')](this[_0xc703('0x11')],function(_0x2c67b5){return _0x2c67b5['interface']==util[_0xc703('0x23')](_0xc703('0x24'),_0x520d35[_0xc703('0x20')]);});}}return _0x507f76;};Report[_0xc703('0x13')][_0xc703('0x25')]=function(_0x5dd34e){for(var _0x4eeeab=0x0;_0x4eeeab<_0x5dd34e[_0xc703('0x26')];_0x4eeeab+=0x1){var _0x4befd4=this[_0xc703('0x27')](_0x5dd34e[_0x4eeeab][_0xc703('0x28')]);if(_0x4befd4){_0x5dd34e[_0x4eeeab][_0xc703('0x22')]=_0x4befd4[_0xc703('0x22')];_0x5dd34e[_0x4eeeab][_0xc703('0x29')]=!![];_0x5dd34e[_0x4eeeab][_0xc703('0x2a')]=_0x4befd4[_0xc703('0x20')];_0x5dd34e[_0x4eeeab][_0xc703('0x2b')]=_['isNil'](_0x4befd4[_0xc703('0x2b')])?util['format'](_0xc703('0x24'),_0x4befd4['name']):_0x4befd4[_0xc703('0x2b')];if(_0x5dd34e[_0x4eeeab][_0xc703('0x2c')]){_0x5dd34e[_0x4eeeab]['queuecallercompleteAt']=moment()[_0xc703('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5dd34e[_0x4eeeab][_0xc703('0x2d')]){_0x5dd34e[_0x4eeeab]['queuecallerexitAt']=moment()[_0xc703('0x23')](_0xc703('0x2e'));}RpcMemberReport[_0xc703('0x25')](_0x5dd34e[_0x4eeeab]);}RpcVoiceQueueReport['create'](_0x5dd34e[_0x4eeeab]);}};function extractCalleridNumber(_0x34a5de){var _0x4ef555=_0x34a5de[_0xc703('0x2f')](/<(.*?)>/);return _0x4ef555?_0x4ef555[0x1]:_0x34a5de;}Report[_0xc703('0x13')][_0xc703('0x17')]=function(_0x5cc213){_0x5cc213['destination']=_0x5cc213[_0xc703('0x30')]||_0x5cc213[_0xc703('0x31')];if(_0x5cc213['type']==_0xc703('0x32')){_0x5cc213[_0xc703('0x33')]='queue';_0x5cc213['lastdata']=_0x5cc213[_0xc703('0x34')];if(_0x5cc213[_0xc703('0x35')]==_0xc703('0x36')){_0x5cc213['accountcode']='';_0x5cc213[_0xc703('0x30')]=extractCalleridNumber(_0x5cc213['callerid']);}else if(_0x5cc213[_0xc703('0x35')]==_0xc703('0x37')){if(_0x5cc213[_0xc703('0x30')]==_0xc703('0x38')){_0x5cc213[_0xc703('0x30')]=extractCalleridNumber(_0x5cc213[_0xc703('0x39')]);_0x5cc213[_0xc703('0x3a')]=_0x5cc213[_0xc703('0x3b')];_0x5cc213[_0xc703('0x3c')]=[_0x5cc213[_0xc703('0x3d')],_0x5cc213[_0xc703('0x3d')]=_0x5cc213[_0xc703('0x3c')]][0x0];_0x5cc213[_0xc703('0x3e')]=_0x5cc213[_0xc703('0x39')];}else{_0x5cc213[_0xc703('0x30')]=_0x5cc213[_0xc703('0x3a')];_0x5cc213[_0xc703('0x3a')]=_0x5cc213[_0xc703('0x3b')];if(_0x5cc213[_0xc703('0x3f')]==_0xc703('0x40')){_0x5cc213[_0xc703('0x22')]=_0x5cc213[_0xc703('0x28')];}else{_0x5cc213['accountcode']='';}}}}else{_0x5cc213[_0xc703('0x3e')]=util['format'](_0xc703('0x41'),_0x5cc213[_0xc703('0x42')],_0x5cc213['calleridnum']);}if(RpcVoiceTransferReport[_0xc703('0x43')][_0x5cc213[_0xc703('0x44')]]){var _0x4c42b2=RpcVoiceTransferReport[_0xc703('0x43')][_0x5cc213['linkedid']];_0x4c42b2[_0xc703('0x45')]=_0x5cc213['uniqueid'];RpcVoiceTransferReport[_0xc703('0x1c')](_0x4c42b2);delete RpcVoiceTransferReport[_0xc703('0x43')][_0x5cc213[_0xc703('0x44')]];}RpcVoiceCallReport['create'](_0x5cc213);if(_0x5cc213[_0xc703('0x46')]){for(var _0x24367b=0x0;_0x24367b<_0x5cc213[_0xc703('0x47')][_0xc703('0x26')];_0x24367b+=0x1){_0x5cc213['monitorFilename']=_0x5cc213[_0xc703('0x47')][_0x24367b][_0xc703('0x48')];_0x5cc213['createdAt']=_0x5cc213['monitors'][_0x24367b][_0xc703('0x49')];if(_0x5cc213['exten']==_0xc703('0x38')){_0x5cc213['calleridnum']=_0x5cc213[_0xc703('0x28')];_0x5cc213['calleridname']=_0x5cc213[_0xc703('0x4a')];_0x5cc213[_0xc703('0x28')]=_0x5cc213['accountcode'];_0x5cc213[_0xc703('0x4a')]=_0x5cc213[_0xc703('0x4b')];_0x5cc213[_0xc703('0x31')]=_0x5cc213[_0xc703('0x3b')];}else if(_0x5cc213[_0xc703('0x31')]=='xcally-motion-dialer'){_0x5cc213[_0xc703('0x3a')]=_0x5cc213['destination'];_0x5cc213[_0xc703('0x31')]=_0x5cc213[_0xc703('0x3b')];}RpcVoiceRecording[_0xc703('0x4c')](_0x5cc213);}}};Report[_0xc703('0x13')][_0xc703('0x18')]=function(_0xdad5a){if(_['isArray'](_0xdad5a)){_0xdad5a[_0xc703('0x4d')](function(_0x38fd7b){RpcVoiceAgentReport['create'](_0x38fd7b);});}else{RpcVoiceAgentReport[_0xc703('0x4c')](_0xdad5a);}};Report[_0xc703('0x13')][_0xc703('0x1a')]=function(_0x2f473f){RpcVoiceDialReport[_0xc703('0x4c')](_0x2f473f);var _0x42b381;var _0x1eaa60;var _0x15620c=_0x2f473f[_0xc703('0x3d')];if(_[_0xc703('0x4e')](_0x15620c,_0xc703('0x4f'))){_0x1eaa60=_0x15620c['substring'](_0x15620c[_0xc703('0x50')]('/')+0x1,_0x15620c[_0xc703('0x50')]('@'));_0x42b381=_[_0xc703('0x1f')](this[_0xc703('0x11')],function(_0x899a64){return _0x899a64['mobile']==_0x1eaa60||_0x899a64['phone']==_0x1eaa60||_0x899a64[_0xc703('0x22')]==_0x1eaa60;});}else{_0x1eaa60=_0x15620c['substring'](_0x15620c['indexOf']('/')+0x1,_0x15620c['lastIndexOf']('-'));_0x42b381=this[_0xc703('0x27')](_0x1eaa60);}if(_0x42b381){_0x2f473f[_0xc703('0x2b')]=_['isNil'](_0x42b381['interface'])?util[_0xc703('0x23')](_0xc703('0x24'),_0x42b381[_0xc703('0x20')]):_0x42b381[_0xc703('0x2b')];_0x2f473f[_0xc703('0x4b')]=_0x42b381[_0xc703('0x20')];_0x2f473f['accountcode']=_0x42b381[_0xc703('0x22')];RpcMemberReport[_0xc703('0x1a')](_0x2f473f);}};Report[_0xc703('0x13')]['blindTransfer']=function(_0x118821){RpcVoiceTransferReport[_0xc703('0x43')][_0x118821[_0xc703('0x51')]]=_0x118821;};Report[_0xc703('0x13')][_0xc703('0x1e')]=function(_0x2bee35){RpcVoiceTransferReport[_0xc703('0x1e')](_0x2bee35);};module[_0xc703('0x52')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index fd93dc3..7f6bd05 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 _0xfe86=['telephone:save','substring','indexOf','mobile','phone','updateStatusRealtime','syncPeerStatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','telephone:%s'];(function(_0x2aac51,_0x2dbc51){var _0x4ba79b=function(_0x507343){while(--_0x507343){_0x2aac51['push'](_0x2aac51['shift']());}};_0x4ba79b(++_0x2dbc51);}(_0xfe86,0x16d));var _0x6fe8=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0xfe86[_0x483d8b];return _0x6500f1;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require(_0x6fe8('0x0'));var BPromise=require('bluebird');var config=require(_0x6fe8('0x1'));var logger=require(_0x6fe8('0x2'))(_0x6fe8('0x3'));var ami=require('../ami');config['redis']=_[_0x6fe8('0x4')](config[_0x6fe8('0x5')],{'host':_0x6fe8('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x423b4c){this['trunks']=_0x423b4c[_0x6fe8('0x7')];this[_0x6fe8('0x8')]=_0x423b4c['agents'];this[_0x6fe8('0x9')]=_0x423b4c[_0x6fe8('0x9')];ami['on'](_0x6fe8('0xa'),this[_0x6fe8('0xb')]['bind'](this));ami['on'](_0x6fe8('0xc'),this['syncRegistry'][_0x6fe8('0xd')](this));ami['on'](_0x6fe8('0xe'),this[_0x6fe8('0xf')]['bind'](this));ami['on'](_0x6fe8('0x10'),this['syncPeerStatus'][_0x6fe8('0xd')](this));return this[_0x6fe8('0x11')]();}function showSipRegistrations(){Promise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](ami['actionSipShowRegistry']())[_0x6fe8('0x14')](function(_0x2824e2){logger['error'](_0x6fe8('0x15'),util[_0x6fe8('0x16')](_0x2824e2,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](ami[_0x6fe8('0x17')]())[_0x6fe8('0x14')](function(_0x2cc42b){logger[_0x6fe8('0x18')](_0x6fe8('0x19'),util[_0x6fe8('0x16')](_0x2cc42b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](ami[_0x6fe8('0x1a')]())[_0x6fe8('0x14')](function(_0x48ce2a){logger[_0x6fe8('0x18')](_0x6fe8('0x1b'),util[_0x6fe8('0x16')](_0x48ce2a,{'showHidden':![],'depth':null}));});}UserReport[_0x6fe8('0x1c')][_0x6fe8('0x11')]=function(){setInterval(function(){BPromise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](showSipRegistrations())[_0x6fe8('0x13')](listDeviceStates())[_0x6fe8('0x13')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x6fe8('0x1d')]=function(_0x2ee671){return _0x2ee671!==null&&!_['isUndefined'](_0x2ee671);};UserReport[_0x6fe8('0x1c')]['emit']=function(_0xc508cd,_0x462187,_0x3cb673){io['to'](_0xc508cd)['emit'](_0x462187,_0x3cb673);};UserReport[_0x6fe8('0x1c')]['syncRegistry']=function(_0x1779ec){try{if(this['isNotNull'](_0x1779ec)){logger[_0x6fe8('0x1e')](_0x6fe8('0x1f'),_0x1779ec[_0x6fe8('0x20')],_0x1779ec[_0x6fe8('0x21')]);logger[_0x6fe8('0x22')]('[userReport][registry]',util[_0x6fe8('0x16')](_0x1779ec,{'showHidden':![],'depth':null}));var _0x41e1b5=_[_0x6fe8('0x23')](this[_0x6fe8('0x7')],{'defaultuser':_0x1779ec['username']});if(_0x41e1b5){_0x1779ec[_0x6fe8('0x24')]=_0x1779ec[_0x6fe8('0x21')];_['merge'](_0x41e1b5,_[_0x6fe8('0x25')](_0x1779ec,[_0x6fe8('0x26'),_0x6fe8('0x27'),_0x6fe8('0x20'),_0x6fe8('0x21')]));logger[_0x6fe8('0x22')](_0x6fe8('0x28'),util[_0x6fe8('0x16')](_0x41e1b5,{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util[_0x6fe8('0x2a')](_0x6fe8('0x2b'),_0x41e1b5[_0x6fe8('0x2c')]),_0x6fe8('0x2d'),_0x41e1b5);}}}catch(_0x1c9b13){logger[_0x6fe8('0x18')]('[userReport][registry]',util[_0x6fe8('0x16')](_0x1c9b13,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x51878b){try{if(this['isNotNull'](_0x51878b)){logger[_0x6fe8('0x1e')](_0x6fe8('0x2e'),_0x51878b[_0x6fe8('0x2f')],_0x51878b[_0x6fe8('0x21')]);logger[_0x6fe8('0x22')](_0x6fe8('0x30'),util['inspect'](_0x51878b,{'showHidden':![],'depth':null}));if(this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]]){if(!this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x31')]||_0x51878b[_0x6fe8('0x21')]['toLowerCase']()==_0x6fe8('0x32')){this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]]['local']=![];if(this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]]['state']!==_0x51878b['state'][_0x6fe8('0x33')]()){this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x34')]=_[_0x6fe8('0x35')](moment()[_0x6fe8('0x2a')]('x'));}this['agents'][_0x51878b['device']]['state']=_0x51878b[_0x6fe8('0x21')]['toLowerCase']();this['agents'][_0x51878b[_0x6fe8('0x2f')]]['updateStatusRealtime'](_0x51878b);}}else if(this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]]){if(this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x21')]!==_0x51878b['state'][_0x6fe8('0x33')]()){this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x34')]=_['toNumber'](moment()['format']('x'));}this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]]['state']=_0x51878b[_0x6fe8('0x21')][_0x6fe8('0x33')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]],{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util['format'](_0x6fe8('0x36'),this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x2c')]),_0x6fe8('0x37'),this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]]);}else if(this[_0x6fe8('0x7')][_0x51878b[_0x6fe8('0x2f')]]){if(this[_0x6fe8('0x7')][_0x51878b['device']][_0x6fe8('0x21')]!==_0x51878b[_0x6fe8('0x21')][_0x6fe8('0x33')]()){this[_0x6fe8('0x7')][_0x51878b['device']][_0x6fe8('0x34')]=_[_0x6fe8('0x35')](moment()[_0x6fe8('0x2a')]('x'));}this[_0x6fe8('0x7')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x21')]=_0x51878b[_0x6fe8('0x21')]['toLowerCase']();logger[_0x6fe8('0x22')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x6fe8('0x7')][_0x51878b[_0x6fe8('0x2f')]],{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util[_0x6fe8('0x2a')]('trunk:%s',this['trunks'][_0x51878b['device']][_0x6fe8('0x2c')]),'trunk:save',this[_0x6fe8('0x7')][_0x51878b['device']]);}else if(_['startsWith'](_0x51878b[_0x6fe8('0x2f')],'Local')){var _0x35cf49=_0x51878b['device'];var _0xcaedb3=_0x35cf49[_0x6fe8('0x38')](_0x35cf49[_0x6fe8('0x39')]('/')+0x1,_0x35cf49['indexOf']('@'));var _0x16fbf1=_[_0x6fe8('0x23')](this[_0x6fe8('0x8')],function(_0x15e7d3){return _0x15e7d3[_0x6fe8('0x3a')]==_0xcaedb3||_0x15e7d3[_0x6fe8('0x3b')]==_0xcaedb3||_0x15e7d3['accountcode']==_0xcaedb3;});if(_0x16fbf1){if(_0x16fbf1[_0x6fe8('0x21')]!==_0x51878b['state']['toLowerCase']()){_0x16fbf1[_0x6fe8('0x34')]=_['toNumber'](moment()[_0x6fe8('0x2a')]('x'));}_0x16fbf1[_0x6fe8('0x21')]=_0x51878b['state'][_0x6fe8('0x33')]();_0x16fbf1[_0x6fe8('0x31')]=!![];_0x16fbf1[_0x6fe8('0x3c')](_0x51878b);}}}}catch(_0x480d99){logger[_0x6fe8('0x18')]('[userReport][devicestatechange]',util['inspect'](_0x480d99,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6fe8('0x3d')]=function(_0x1cd85a){try{if(this['isNotNull'](_0x1cd85a)&&this[_0x6fe8('0x1d')](_0x1cd85a['peerstatus'])){logger[_0x6fe8('0x1e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x1cd85a[_0x6fe8('0x3e')],_0x1cd85a[_0x6fe8('0x3f')],_0x1cd85a[_0x6fe8('0x10')]);logger['debug'](_0x6fe8('0x40'),util['inspect'](_0x1cd85a,{'showHidden':![],'depth':null}));if(this['agents'][_0x1cd85a[_0x6fe8('0x3e')]]){if(!this[_0x6fe8('0x8')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x31')]||_0x1cd85a[_0x6fe8('0x10')][_0x6fe8('0x33')]()==_0x6fe8('0x41')){this[_0x6fe8('0x8')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x31')]=![];this[_0x6fe8('0x8')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x42')]=_0x1cd85a['peerstatus'][_0x6fe8('0x33')]();this['agents'][_0x1cd85a['peer']][_0x6fe8('0x3f')]=_0x1cd85a['address'];this[_0x6fe8('0x8')][_0x1cd85a['peer']][_0x6fe8('0x3c')](_0x1cd85a);}}else if(this['telephones'][_0x1cd85a[_0x6fe8('0x3e')]]){this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x42')]=_0x1cd85a[_0x6fe8('0x10')][_0x6fe8('0x33')]();this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x3f')]=_0x1cd85a[_0x6fe8('0x3f')];logger[_0x6fe8('0x22')](_0x6fe8('0x43'),util['inspect'](this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x2c')]),_0x6fe8('0x37'),this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]]);}else if(this[_0x6fe8('0x7')][_0x1cd85a[_0x6fe8('0x3e')]]){this[_0x6fe8('0x7')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x42')]=_0x1cd85a[_0x6fe8('0x10')][_0x6fe8('0x33')]();this['trunks'][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x3f')]=_0x1cd85a['address'];logger[_0x6fe8('0x22')](_0x6fe8('0x44'),util['inspect'](this['trunks'][_0x1cd85a[_0x6fe8('0x3e')]],{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util['format'](_0x6fe8('0x2b'),this[_0x6fe8('0x7')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x2c')]),_0x6fe8('0x2d'),this['trunks'][_0x1cd85a[_0x6fe8('0x3e')]]);}}}catch(_0x386696){logger[_0x6fe8('0x18')](_0x6fe8('0x40'),util[_0x6fe8('0x16')](_0x386696,{'showHidden':![],'depth':null}));}};module[_0x6fe8('0x45')]=UserReport; \ No newline at end of file +var _0x8af4=['redis','defaults','socket.io-emitter','trunks','telephones','bind','syncRegistry','devicestatechange','peerstatus','syncPeerStatus','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','resolve','actionDeviceStateList','catch','[userReport][sippeerstatus]','isNotNull','isUndefined','prototype','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','agents','local','toLowerCase','stateTime','toNumber','format','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami'];(function(_0x1bc4c1,_0x2edfdb){var _0x1c34ef=function(_0x4ac4e4){while(--_0x4ac4e4){_0x1bc4c1['push'](_0x1bc4c1['shift']());}};_0x1c34ef(++_0x2edfdb);}(_0x8af4,0x88));var _0x48af=function(_0x332985,_0x216420){_0x332985=_0x332985-0x0;var _0x1a77c1=_0x8af4[_0x332985];return _0x1a77c1;};'use strict';var _=require(_0x48af('0x0'));var moment=require(_0x48af('0x1'));var util=require(_0x48af('0x2'));var Redis=require(_0x48af('0x3'));var BPromise=require(_0x48af('0x4'));var config=require(_0x48af('0x5'));var logger=require('../../../config/logger')(_0x48af('0x6'));var ami=require(_0x48af('0x7'));config[_0x48af('0x8')]=_[_0x48af('0x9')](config[_0x48af('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x48af('0xa'))(new Redis(config[_0x48af('0x8')]));function UserReport(_0x3c6935){this[_0x48af('0xb')]=_0x3c6935['trunks'];this['agents']=_0x3c6935['agents'];this[_0x48af('0xc')]=_0x3c6935[_0x48af('0xc')];ami['on']('registryentry',this['syncRegistry'][_0x48af('0xd')](this));ami['on']('registry',this[_0x48af('0xe')][_0x48af('0xd')](this));ami['on'](_0x48af('0xf'),this['syncDeviceState'][_0x48af('0xd')](this));ami['on'](_0x48af('0x10'),this[_0x48af('0x11')]['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0x48af('0x12')](ami[_0x48af('0x13')]())['catch'](function(_0x3a1ff6){logger[_0x48af('0x14')](_0x48af('0x15'),util[_0x48af('0x16')](_0x3a1ff6,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x48af('0x17')]()[_0x48af('0x12')](ami[_0x48af('0x18')]())[_0x48af('0x19')](function(_0x65a2ef){logger[_0x48af('0x14')]('[userReport][devicestatelist]',util['inspect'](_0x65a2ef,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x48af('0x17')]()['then'](ami['actionSipPeerStatus']())[_0x48af('0x19')](function(_0x523048){logger[_0x48af('0x14')](_0x48af('0x1a'),util[_0x48af('0x16')](_0x523048,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x48af('0x17')]()['then'](showSipRegistrations())[_0x48af('0x12')](listDeviceStates())[_0x48af('0x12')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x48af('0x1b')]=function(_0x63ed10){return _0x63ed10!==null&&!_[_0x48af('0x1c')](_0x63ed10);};UserReport[_0x48af('0x1d')][_0x48af('0x1e')]=function(_0x3f6d60,_0x2a7c18,_0x2b0e41){io['to'](_0x3f6d60)[_0x48af('0x1e')](_0x2a7c18,_0x2b0e41);};UserReport[_0x48af('0x1d')][_0x48af('0xe')]=function(_0x20ef73){try{if(this[_0x48af('0x1b')](_0x20ef73)){logger[_0x48af('0x1f')](_0x48af('0x20'),_0x20ef73[_0x48af('0x21')],_0x20ef73[_0x48af('0x22')]);logger[_0x48af('0x23')](_0x48af('0x24'),util[_0x48af('0x16')](_0x20ef73,{'showHidden':![],'depth':null}));var _0x412486=_[_0x48af('0x25')](this[_0x48af('0xb')],{'defaultuser':_0x20ef73[_0x48af('0x21')]});if(_0x412486){_0x20ef73['stateRegistry']=_0x20ef73[_0x48af('0x22')];_[_0x48af('0x26')](_0x412486,_[_0x48af('0x27')](_0x20ef73,[_0x48af('0x28'),'actionid',_0x48af('0x21'),_0x48af('0x22')]));logger[_0x48af('0x23')](_0x48af('0x29'),util[_0x48af('0x16')](_0x412486,{'showHidden':![],'depth':null}));this[_0x48af('0x1e')](util['format'](_0x48af('0x2a'),_0x412486[_0x48af('0x2b')]),_0x48af('0x2c'),_0x412486);}}}catch(_0x49a715){logger[_0x48af('0x14')](_0x48af('0x24'),util['inspect'](_0x49a715,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0xc4f672){try{if(this[_0x48af('0x1b')](_0xc4f672)){logger[_0x48af('0x1f')](_0x48af('0x2d'),_0xc4f672[_0x48af('0x2e')],_0xc4f672['state']);logger[_0x48af('0x23')]('[userReport][devicestatechange]',util['inspect'](_0xc4f672,{'showHidden':![],'depth':null}));if(this[_0x48af('0x2f')][_0xc4f672[_0x48af('0x2e')]]){if(!this['agents'][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x30')]||_0xc4f672[_0x48af('0x22')]['toLowerCase']()=='inuse'){this[_0x48af('0x2f')][_0xc4f672[_0x48af('0x2e')]]['local']=![];if(this[_0x48af('0x2f')][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x22')]!==_0xc4f672[_0x48af('0x22')][_0x48af('0x31')]()){this[_0x48af('0x2f')][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x32')]=_[_0x48af('0x33')](moment()[_0x48af('0x34')]('x'));}this[_0x48af('0x2f')][_0xc4f672['device']]['state']=_0xc4f672[_0x48af('0x22')][_0x48af('0x31')]();this['agents'][_0xc4f672['device']][_0x48af('0x35')](_0xc4f672);}}else if(this[_0x48af('0xc')][_0xc4f672[_0x48af('0x2e')]]){if(this[_0x48af('0xc')][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x22')]!==_0xc4f672[_0x48af('0x22')][_0x48af('0x31')]()){this[_0x48af('0xc')][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x32')]=_[_0x48af('0x33')](moment()[_0x48af('0x34')]('x'));}this[_0x48af('0xc')][_0xc4f672['device']][_0x48af('0x22')]=_0xc4f672[_0x48af('0x22')][_0x48af('0x31')]();logger['debug'](_0x48af('0x36'),util[_0x48af('0x16')](this[_0x48af('0xc')][_0xc4f672[_0x48af('0x2e')]],{'showHidden':![],'depth':null}));this[_0x48af('0x1e')](util[_0x48af('0x34')](_0x48af('0x37'),this['telephones'][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x2b')]),_0x48af('0x38'),this[_0x48af('0xc')][_0xc4f672[_0x48af('0x2e')]]);}else if(this[_0x48af('0xb')][_0xc4f672[_0x48af('0x2e')]]){if(this[_0x48af('0xb')][_0xc4f672[_0x48af('0x2e')]]['state']!==_0xc4f672[_0x48af('0x22')][_0x48af('0x31')]()){this[_0x48af('0xb')][_0xc4f672['device']]['stateTime']=_[_0x48af('0x33')](moment()[_0x48af('0x34')]('x'));}this[_0x48af('0xb')][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x22')]=_0xc4f672[_0x48af('0x22')][_0x48af('0x31')]();logger[_0x48af('0x23')](_0x48af('0x39'),util[_0x48af('0x16')](this['trunks'][_0xc4f672['device']],{'showHidden':![],'depth':null}));this[_0x48af('0x1e')](util[_0x48af('0x34')]('trunk:%s',this[_0x48af('0xb')][_0xc4f672[_0x48af('0x2e')]][_0x48af('0x2b')]),_0x48af('0x2c'),this[_0x48af('0xb')][_0xc4f672[_0x48af('0x2e')]]);}else if(_['startsWith'](_0xc4f672[_0x48af('0x2e')],_0x48af('0x3a'))){var _0x58c4ca=_0xc4f672[_0x48af('0x2e')];var _0x2abfb2=_0x58c4ca[_0x48af('0x3b')](_0x58c4ca['indexOf']('/')+0x1,_0x58c4ca[_0x48af('0x3c')]('@'));var _0x274a16=_[_0x48af('0x25')](this[_0x48af('0x2f')],function(_0x157319){return _0x157319[_0x48af('0x3d')]==_0x2abfb2||_0x157319[_0x48af('0x3e')]==_0x2abfb2||_0x157319[_0x48af('0x3f')]==_0x2abfb2;});if(_0x274a16){if(_0x274a16['state']!==_0xc4f672[_0x48af('0x22')][_0x48af('0x31')]()){_0x274a16[_0x48af('0x32')]=_[_0x48af('0x33')](moment()[_0x48af('0x34')]('x'));}_0x274a16[_0x48af('0x22')]=_0xc4f672['state'][_0x48af('0x31')]();_0x274a16[_0x48af('0x30')]=!![];_0x274a16[_0x48af('0x35')](_0xc4f672);}}}}catch(_0x12e733){logger[_0x48af('0x14')]('[userReport][devicestatechange]',util[_0x48af('0x16')](_0x12e733,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x5dc172){try{if(this[_0x48af('0x1b')](_0x5dc172)&&this[_0x48af('0x1b')](_0x5dc172['peerstatus'])){logger['info'](_0x48af('0x40'),_0x5dc172['peer'],_0x5dc172['address'],_0x5dc172[_0x48af('0x10')]);logger[_0x48af('0x23')]('[userReport][peerstatus]',util[_0x48af('0x16')](_0x5dc172,{'showHidden':![],'depth':null}));if(this[_0x48af('0x2f')][_0x5dc172[_0x48af('0x41')]]){if(!this[_0x48af('0x2f')][_0x5dc172[_0x48af('0x41')]]['local']||_0x5dc172[_0x48af('0x10')][_0x48af('0x31')]()==_0x48af('0x42')){this['agents'][_0x5dc172[_0x48af('0x41')]][_0x48af('0x30')]=![];this['agents'][_0x5dc172[_0x48af('0x41')]][_0x48af('0x43')]=_0x5dc172[_0x48af('0x10')][_0x48af('0x31')]();this[_0x48af('0x2f')][_0x5dc172[_0x48af('0x41')]][_0x48af('0x44')]=_0x5dc172[_0x48af('0x44')];this[_0x48af('0x2f')][_0x5dc172[_0x48af('0x41')]][_0x48af('0x35')](_0x5dc172);}}else if(this[_0x48af('0xc')][_0x5dc172[_0x48af('0x41')]]){this[_0x48af('0xc')][_0x5dc172[_0x48af('0x41')]][_0x48af('0x43')]=_0x5dc172['peerstatus'][_0x48af('0x31')]();this[_0x48af('0xc')][_0x5dc172[_0x48af('0x41')]][_0x48af('0x44')]=_0x5dc172[_0x48af('0x44')];logger[_0x48af('0x23')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x48af('0xc')][_0x5dc172['peer']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x48af('0x37'),this[_0x48af('0xc')][_0x5dc172[_0x48af('0x41')]]['name']),'telephone:save',this[_0x48af('0xc')][_0x5dc172[_0x48af('0x41')]]);}else if(this[_0x48af('0xb')][_0x5dc172[_0x48af('0x41')]]){this[_0x48af('0xb')][_0x5dc172['peer']]['status']=_0x5dc172[_0x48af('0x10')][_0x48af('0x31')]();this[_0x48af('0xb')][_0x5dc172['peer']]['address']=_0x5dc172[_0x48af('0x44')];logger[_0x48af('0x23')](_0x48af('0x45'),util[_0x48af('0x16')](this[_0x48af('0xb')][_0x5dc172[_0x48af('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x48af('0x34')]('trunk:%s',this[_0x48af('0xb')][_0x5dc172[_0x48af('0x41')]][_0x48af('0x2b')]),_0x48af('0x2c'),this['trunks'][_0x5dc172['peer']]);}}}catch(_0x3874fa){logger[_0x48af('0x14')](_0x48af('0x46'),util[_0x48af('0x16')](_0x3874fa,{'showHidden':![],'depth':null}));}};module[_0x48af('0x47')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 768249a..90d3d45 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 _0x539c=['moment','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','channels','format','queue','mandatoryDisposition','type','inbound','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','merge','interface','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','lastevent','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','isNotNull','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','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','agentcompleteAt','complete','reason','transfer','agent','talktime','acwtime','acwTimeout','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x539c,0x1c8));var _0xc539=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x539c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0xc539('0x0'));var util=require(_0xc539('0x1'));var Redis=require(_0xc539('0x2'));var config=require(_0xc539('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0xc539('0x4'));config[_0xc539('0x5')]=_[_0xc539('0x6')](config[_0xc539('0x5')],{'host':_0xc539('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc539('0x5')]));function VoiceAgentReport(_0x378fcd){this['channels']={};this['voiceQueues']=_0x378fcd[_0xc539('0x8')];this['agents']=_0x378fcd[_0xc539('0x9')];this[_0xc539('0xa')]={};ami['on'](_0xc539('0xb'),this[_0xc539('0xc')][_0xc539('0xd')](this));ami['on']('agentconnect',this[_0xc539('0xe')][_0xc539('0xd')](this));ami['on']('agentringnoanswer',this[_0xc539('0xf')][_0xc539('0xd')](this));ami['on'](_0xc539('0x10'),this[_0xc539('0x11')]['bind'](this));ami['on'](_0xc539('0x12'),this['syncAgentComplete'][_0xc539('0xd')](this));ami['on'](_0xc539('0x13'),this['syncVarSet'][_0xc539('0xd')](this));ami['on'](_0xc539('0x14'),this['syncHangup']['bind'](this));ami['on'](_0xc539('0x15'),this[_0xc539('0x16')][_0xc539('0xd')](this));ami['on'](_0xc539('0x17'),this['syncMusicOnHoldStop'][_0xc539('0xd')](this));ami['on'](_0xc539('0x18'),this[_0xc539('0x19')][_0xc539('0xd')](this));ami['on'](_0xc539('0x1a'),this[_0xc539('0x1b')][_0xc539('0xd')](this));}VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x1d')]=function(_0x4aa1ae,_0x3ec186,_0x4ddc46){io['to'](_0x4aa1ae)[_0xc539('0x1d')](_0x3ec186,_0x4ddc46);};VoiceAgentReport['prototype']['isNotNull']=function(_0x2bc609){return _0x2bc609!==null&&!_[_0xc539('0x1e')](_0x2bc609);};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0xc')]=function(_0x261174){try{if(this['isNotNull'](_0x261174)){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x261174['uniqueid'],_0x261174[_0xc539('0x20')],_0x261174[_0xc539('0x21')]);logger[_0xc539('0x22')](_0xc539('0x23'),_0x261174[_0xc539('0x24')],util[_0xc539('0x25')](_0x261174,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xc539('0x26')][_0x261174['uniqueid']])){this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]]={};}if(_['isUndefined'](this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]])){this['channels'][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]]={'agentcalledAt':moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','mandatoryDisposition':this[_0xc539('0x8')][_0x261174[_0xc539('0x28')]]?this[_0xc539('0x8')][_0x261174[_0xc539('0x28')]][_0xc539('0x29')]||![]:![],'type':this['voiceQueues'][_0x261174[_0xc539('0x28')]]?this[_0xc539('0x8')][_0x261174[_0xc539('0x28')]][_0xc539('0x2a')]||_0xc539('0x2b'):'inbound','variables':this[_0xc539('0xa')][_0x261174[_0xc539('0x24')]]};}_['merge'](this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174['destuniqueid']],_[_0xc539('0x2c')](_0x261174,['event',_0xc539('0x2d')]));logger[_0xc539('0x22')](_0xc539('0x2e'),_0x261174['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcalled',this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]]);logger[_0xc539('0x22')](_0xc539('0x2f'),_0x261174['uniqueid'],util[_0xc539('0x25')](this['channels'][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]],{'showHidden':![],'depth':null}));this[_0xc539('0x1d')](util[_0xc539('0x27')](_0xc539('0x30'),_0x261174['membername']),_0xc539('0x31'),this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]]);}}catch(_0xbcbb19){logger[_0xc539('0x32')](_0xc539('0x33'),_0x261174['uniqueid'],util[_0xc539('0x25')](_0xbcbb19,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc539('0xe')]=function(_0x5e48e7){try{if(this['isNotNull'](_0x5e48e7)){if(this['channels'][_0x5e48e7[_0xc539('0x24')]]){logger['debug'](_0xc539('0x34'),_0x5e48e7['uniqueid'],util[_0xc539('0x25')](_0x5e48e7,{'showHidden':![],'depth':null}));for(var _0x28177b in this[_0xc539('0x26')][_0x5e48e7['uniqueid']]){if(this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0xc539('0x35')](_0x28177b)){if(_0x5e48e7[_0xc539('0x21')]===_0x28177b){logger[_0xc539('0x1f')](_0xc539('0x36'),_0x5e48e7[_0xc539('0x24')],_0x5e48e7[_0xc539('0x20')],_0x5e48e7['destuniqueid']);this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x37')]=moment()[_0xc539('0x27')](_0xc539('0x38'));this['channels'][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x39')]=_0x5e48e7[_0xc539('0x39')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x3a')]=_0x5e48e7[_0xc539('0x3a')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x3b')]=_0x5e48e7[_0xc539('0x3b')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b]['destchannelstatedesc']=_0x5e48e7[_0xc539('0x3c')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x3d')]=_0x5e48e7[_0xc539('0x3d')];this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b]['lastevent']=_0xc539('0x3e');_[_0xc539('0x3f')](this[_0xc539('0x9')][_0x5e48e7[_0xc539('0x40')]],_[_0xc539('0x41')](_0x5e48e7,[_0xc539('0x28'),'destconnectedlinenum']));logger[_0xc539('0x22')](_0xc539('0x42'),_0x5e48e7[_0xc539('0x24')],util['inspect'](this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x5e48e7[_0xc539('0x21')]],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x43'),this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x5e48e7['destuniqueid']]);logger[_0xc539('0x22')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x5e48e7[_0xc539('0x24')],util['inspect'](this['channels'][_0x5e48e7[_0xc539('0x24')]][_0x5e48e7['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xc539('0x1d')](util[_0xc539('0x27')]('user:%s',_0x5e48e7[_0xc539('0x20')]),_0xc539('0x44'),this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x5e48e7['destuniqueid']]);}else if(!this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x45')]&&!this['channels'][_0x5e48e7['uniqueid']][_0x28177b]['agentcomplete']){logger[_0xc539('0x1f')](_0xc539('0x46'),_0x5e48e7[_0xc539('0x24')],this['channels'][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x20')],_0x28177b);this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x45')]=!![];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x47')]=moment()[_0xc539('0x27')](_0xc539('0x38'));this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b][_0xc539('0x48')]=_0x5e48e7[_0xc539('0x21')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b]['answeredelsewheremembername']=_0x5e48e7[_0xc539('0x20')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x49')]='answered_elsewhere';this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b]['reason']=_0xc539('0x4a');logger[_0xc539('0x22')](_0xc539('0x4b'),_0x5e48e7['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x4c'),this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b]);}}}}}}catch(_0x4838db){logger[_0xc539('0x32')](_0xc539('0x4d'),_0x5e48e7[_0xc539('0x24')],util['inspect'](_0x4838db,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0xf')]=function(_0x332f8b){try{if(this[_0xc539('0x4e')](_0x332f8b)){logger[_0xc539('0x22')](_0xc539('0x4f'),_0x332f8b[_0xc539('0x24')],util['inspect'](_0x332f8b,{'showHidden':![],'depth':null}));if(this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]]&&this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b[_0xc539('0x21')]]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x332f8b['uniqueid'],_0x332f8b[_0xc539('0x20')],_0x332f8b['destuniqueid']);this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']][_0xc539('0x45')]=!![];this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']][_0xc539('0x47')]=moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x332f8b[_0xc539('0x24')]][_0x332f8b[_0xc539('0x21')]][_0xc539('0x49')]=_0xc539('0x50');this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b[_0xc539('0x21')]]['reason']=_0xc539('0x50');logger['debug'](_0xc539('0x51'),_0x332f8b['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x52'),this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']]);}}}catch(_0x587684){logger[_0xc539('0x32')](_0xc539('0x53'),_0x332f8b[_0xc539('0x24')],util[_0xc539('0x25')](_0x587684,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x11')]=function(_0x2cccfd){try{if(this[_0xc539('0x4e')](_0x2cccfd)){logger[_0xc539('0x22')](_0xc539('0x54'),_0x2cccfd[_0xc539('0x24')],util[_0xc539('0x25')](_0x2cccfd,{'showHidden':![],'depth':null}));if(this['channels'][_0x2cccfd[_0xc539('0x24')]]){for(var _0xf1caa1 in this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xc539('0x35')](_0xf1caa1)&&!this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1][_0xc539('0x45')]&&!this['channels'][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1][_0xc539('0x12')]){logger['info']('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2cccfd['uniqueid'],this['channels'][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]['membername'],_0xf1caa1);this['channels'][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1][_0xc539('0x45')]=!![];this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]['agentringnoanswerAt']=moment()['format'](_0xc539('0x38'));this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]['lastevent']=_0xc539('0x55');this['channels'][_0x2cccfd['uniqueid']][_0xf1caa1]['reason']='abandoned';logger[_0xc539('0x22')](_0xc539('0x56'),_0x2cccfd['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x2cccfd['uniqueid']][_0xf1caa1],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x57'),this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]);}}}}}catch(_0x4bc9c9){logger['error'](_0xc539('0x58'),_0x2cccfd[_0xc539('0x24')],util[_0xc539('0x25')](_0x4bc9c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x59')]=function(_0x3816cd){try{if(this[_0xc539('0x4e')](_0x3816cd)){logger[_0xc539('0x22')](_0xc539('0x5a'),_0x3816cd[_0xc539('0x24')],util[_0xc539('0x25')](_0x3816cd,{'showHidden':![],'depth':null}));if(this['channels'][_0x3816cd[_0xc539('0x24')]]){for(var _0x41673b in this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0xc539('0x35')](_0x41673b)){if(this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x37')]&&!this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x12')]){logger[_0xc539('0x1f')](_0xc539('0x5b'),_0x3816cd[_0xc539('0x24')],this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x20')],_0x41673b);this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x12')]=!![];this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x5c')]=moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x49')]=_0xc539('0x5d');this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x5e')]=_0x3816cd[_0xc539('0x5e')]==_0xc539('0x5f')?_0xc539('0x60'):_0x3816cd[_0xc539('0x5e')];this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x61')]=_0x3816cd[_0xc539('0x61')];if(this[_0xc539('0x8')][_0x3816cd[_0xc539('0x28')]]&&this[_0xc539('0x8')][_0x3816cd['queue']]['acw']){this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x62')]=this[_0xc539('0x8')][_0x3816cd[_0xc539('0x28')]][_0xc539('0x63')];this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x64')]=!![];}this[_0xc539('0x9')][_0x3816cd[_0xc539('0x40')]]=_[_0xc539('0x2c')](this['agents'][_0x3816cd['interface']],[_0xc539('0x28'),_0xc539('0x65')]);logger['debug'](_0xc539('0x66'),_0x3816cd[_0xc539('0x24')],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x3816cd['uniqueid']][_0x41673b],{'showHidden':![],'depth':null}));ami['emit'](_0xc539('0x67'),this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b]);logger[_0xc539('0x22')](_0xc539('0x68'),_0x3816cd[_0xc539('0x24')],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b],{'showHidden':![],'depth':null}));this[_0xc539('0x1d')](util[_0xc539('0x27')](_0xc539('0x30'),_0x3816cd['membername']),_0xc539('0x69'),this[_0xc539('0x26')][_0x3816cd['uniqueid']][_0x41673b]);}}}}}}catch(_0x4e402e){logger[_0xc539('0x32')]('[%s][voiceAgentReport][agentcomplete]',_0x3816cd['uniqueid'],util[_0xc539('0x25')](_0x4e402e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x6a')]=function(_0x10302e){try{if(this[_0xc539('0x4e')](_0x10302e)){logger[_0xc539('0x22')](_0xc539('0x6b'),_0x10302e[_0xc539('0x24')],util[_0xc539('0x25')](_0x10302e,{'showHidden':![],'depth':null}));this[_0xc539('0x6c')](_0x10302e['uniqueid'],_[_0xc539('0x6d')](_0x10302e['variable'])[0x0],_0x10302e[_0xc539('0x6e')]);if(this[_0xc539('0x26')][_0x10302e[_0xc539('0x24')]]){for(var _0x3f508a in this[_0xc539('0x26')][_0x10302e[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x10302e['uniqueid']]['hasOwnProperty'](_0x3f508a)){logger['info']('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x10302e[_0xc539('0x24')],_0x3f508a,_[_0xc539('0x6d')](_0x10302e[_0xc539('0x6f')])[0x0],_0x10302e[_0xc539('0x6e')]);if(_[_0xc539('0x1e')](this['channels'][_0x10302e[_0xc539('0x24')]][_0x3f508a][_0xc539('0xa')])){this[_0xc539('0x26')][_0x10302e[_0xc539('0x24')]][_0x3f508a][_0xc539('0xa')]={};}this[_0xc539('0x26')][_0x10302e['uniqueid']][_0x3f508a]['variables']=this['variables'][_0x10302e[_0xc539('0x24')]];}}}}}catch(_0x48dc57){logger[_0xc539('0x32')](_0xc539('0x70'),_0x10302e[_0xc539('0x24')],util[_0xc539('0x25')](_0x48dc57,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x6c')]=function(_0x32f4ba,_0x1b15ba,_0x199dba){var _0x4b60a7=[_0xc539('0x71'),_0xc539('0x72'),_0xc539('0x73'),'rtpaudioqosjitterbridged',_0xc539('0x74'),_0xc539('0x75'),_0xc539('0x76'),'rtpaudioqosrttbridged',_0xc539('0x77'),'sipuri',_0xc539('0x78'),_0xc539('0x79'),'membercalls',_0xc539('0x7a'),_0xc539('0x7b'),'memberlastcall',_0xc539('0x20'),_0xc539('0x7c'),_0xc539('0x7d')];if(!_[_0xc539('0x7e')](_0x1b15ba)&&!_['includes'](_0x4b60a7,_0x1b15ba)){if(_['isUndefined'](this[_0xc539('0xa')][_0x32f4ba])){this[_0xc539('0xa')][_0x32f4ba]={};}this['variables'][_0x32f4ba][_0x1b15ba]=_0x199dba;}};VoiceAgentReport['prototype'][_0xc539('0x7f')]=function(_0x26d225){try{if(this[_0xc539('0x4e')](_0x26d225)){logger[_0xc539('0x22')](_0xc539('0x80'),_0x26d225[_0xc539('0x24')],util['inspect'](_0x26d225,{'showHidden':![],'depth':null}));if(this[_0xc539('0x26')][_0x26d225['uniqueid']]){for(var _0x2c649e in this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]][_0xc539('0x35')](_0x2c649e)){if(this[_0xc539('0x26')][_0x26d225['uniqueid']][_0x2c649e][_0xc539('0x5e')]==_0xc539('0x5f')&&this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]][_0x2c649e][_0xc539('0x12')]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x26d225[_0xc539('0x24')],_0x2c649e);this['channels'][_0x26d225[_0xc539('0x24')]][_0x2c649e][_0xc539('0x5c')]=moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0xc539('0x81'),_0x26d225[_0xc539('0x24')],util[_0xc539('0x25')](_[_0xc539('0x82')](this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]]),{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x83'),_['values'](this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]]));delete this['channels'][_0x26d225[_0xc539('0x24')]];}if(this[_0xc539('0xa')][_0x26d225[_0xc539('0x24')]]){delete this[_0xc539('0xa')][_0x26d225[_0xc539('0x24')]];}}}catch(_0x5eaa91){logger[_0xc539('0x32')](_0xc539('0x84'),_0x26d225['uniqueid'],util['inspect'](_0x5eaa91,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc539('0x19')]=function(_0xacc7ce){try{if(this[_0xc539('0x4e')](_0xacc7ce)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0xacc7ce['uniqueid'],util[_0xc539('0x25')](_0xacc7ce,{'showHidden':![],'depth':null}));if(this['channels'][_0xacc7ce[_0xc539('0x85')]]){for(var _0x13ec7d in this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]]){if(this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0xc539('0x35')](_0x13ec7d)){if(_0xacc7ce[_0xc539('0x86')]===_0x13ec7d){logger['info'](_0xc539('0x87'),_0xacc7ce[_0xc539('0x24')],this[_0xc539('0x26')][_0xacc7ce['transfereeuniqueid']][_0x13ec7d][_0xc539('0x20')],_0x13ec7d);var _0x4ec6e2=moment();this['channels'][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d]['agentcomplete']=!![];this[_0xc539('0x26')][_0xacc7ce['transfereeuniqueid']][_0x13ec7d][_0xc539('0x5c')]=moment()['format'](_0xc539('0x38'));this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d][_0xc539('0x49')]='complete';this[_0xc539('0x26')][_0xacc7ce['transfereeuniqueid']][_0x13ec7d][_0xc539('0x5e')]=_0xc539('0x5f');this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d][_0xc539('0x61')]=_0x4ec6e2[_0xc539('0x88')](this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d][_0xc539('0x37')],'seconds');}}}}if(this['channels'][_0xacc7ce[_0xc539('0x89')]]){var _0x5e1881=this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x89')]];this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x89')]]=this['channels'][_0xacc7ce[_0xc539('0x85')]];this['channels'][_0xacc7ce['transfereeuniqueid']]=_0x5e1881;}}}catch(_0x4730c0){logger['error'](_0xc539('0x8a'),_0xacc7ce[_0xc539('0x24')],util['inspect'](_0x4730c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x1b')]=function(_0x3300b6){try{if(this['isNotNull'](_0x3300b6)){logger[_0xc539('0x22')](_0xc539('0x8b'),_0x3300b6[_0xc539('0x24')],util[_0xc539('0x25')](_0x3300b6,{'showHidden':![],'depth':null}));if(this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]]){for(var _0x27ffc5 in this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]]){if(this['channels'][_0x3300b6[_0xc539('0x85')]][_0xc539('0x35')](_0x27ffc5)){if(_0x3300b6[_0xc539('0x8c')]===_0x27ffc5){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3300b6[_0xc539('0x24')],this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x20')],_0x27ffc5);var _0x7f4c98=moment();this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x12')]=!![];this['channels'][_0x3300b6['transfereeuniqueid']][_0x27ffc5][_0xc539('0x5c')]=_0x7f4c98;this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5]['lastevent']='complete';this['channels'][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x5e')]=_0xc539('0x5f');this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x61')]=_0x7f4c98[_0xc539('0x88')](this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5]['agentconnectAt'],'seconds');}}}}}}catch(_0x549e54){logger[_0xc539('0x32')](_0xc539('0x8d'),_0x3300b6[_0xc539('0x24')],util[_0xc539('0x25')](_0x549e54,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x16')]=function(_0x2ee58b){var _0x4a9e51='';try{if(this[_0xc539('0x4e')](_0x2ee58b)){logger[_0xc539('0x22')](_0xc539('0x8e'),_0x2ee58b[_0xc539('0x24')],util[_0xc539('0x25')](_0x2ee58b,{'showHidden':![],'depth':null}));if(_0x2ee58b[_0xc539('0x8f')]){_0x4a9e51=_0x2ee58b[_0xc539('0x8f')]['substring'](0x0,_0x2ee58b['channel'][_0xc539('0x90')]('-'));if(this[_0xc539('0x9')][_0x4a9e51]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x2ee58b['uniqueid'],_0x4a9e51);this[_0xc539('0x9')][_0x4a9e51][_0xc539('0x91')]=!![];}}}}catch(_0x45a329){logger[_0xc539('0x32')](_0xc539('0x92'),_0x2ee58b[_0xc539('0x24')],util[_0xc539('0x25')](_0x45a329,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x93')]=function(_0x470162){var _0x41e836='';try{if(this[_0xc539('0x4e')](_0x470162)){logger[_0xc539('0x22')](_0xc539('0x94'),_0x470162[_0xc539('0x24')],util[_0xc539('0x25')](_0x470162,{'showHidden':![],'depth':null}));if(_0x470162[_0xc539('0x8f')]){_0x41e836=_0x470162[_0xc539('0x8f')][_0xc539('0x95')](0x0,_0x470162[_0xc539('0x8f')][_0xc539('0x90')]('-'));if(this[_0xc539('0x9')][_0x41e836]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x470162[_0xc539('0x24')],_0x41e836);this[_0xc539('0x9')][_0x41e836][_0xc539('0x91')]=![];}}}}catch(_0x8cdaae){logger['error'](_0xc539('0x96'),_0x470162[_0xc539('0x24')],util[_0xc539('0x25')](_0x8cdaae,{'showHidden':![],'depth':null}));}};module[_0xc539('0x97')]=VoiceAgentReport; \ No newline at end of file +var _0x2208=['syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','isUndefined','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','variables','merge','omit','privilege','custom:agentcalled','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','reason','answered_elsewhere','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:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','agentconnectAt','agentcompleteAt','transfer','agent','talktime','acw','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','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','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','ioredis','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','agentcalled'];(function(_0x282230,_0x163201){var _0x107b62=function(_0x32f6b7){while(--_0x32f6b7){_0x282230['push'](_0x282230['shift']());}};_0x107b62(++_0x163201);}(_0x2208,0x11e));var _0x8220=function(_0x501664,_0x16cf8f){_0x501664=_0x501664-0x0;var _0x44b411=_0x2208[_0x501664];return _0x44b411;};'use strict';var _=require('lodash');var moment=require(_0x8220('0x0'));var util=require('util');var Redis=require(_0x8220('0x1'));var config=require('../../../config/environment');var logger=require(_0x8220('0x2'))(_0x8220('0x3'));var ami=require(_0x8220('0x4'));config[_0x8220('0x5')]=_[_0x8220('0x6')](config[_0x8220('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8220('0x7'))(new Redis(config['redis']));function VoiceAgentReport(_0xc5e293){this[_0x8220('0x8')]={};this[_0x8220('0x9')]=_0xc5e293[_0x8220('0x9')];this[_0x8220('0xa')]=_0xc5e293[_0x8220('0xa')];this['variables']={};ami['on'](_0x8220('0xb'),this[_0x8220('0xc')]['bind'](this));ami['on'](_0x8220('0xd'),this[_0x8220('0xe')][_0x8220('0xf')](this));ami['on'](_0x8220('0x10'),this[_0x8220('0x11')]['bind'](this));ami['on']('queuecallerabandon',this[_0x8220('0x12')][_0x8220('0xf')](this));ami['on'](_0x8220('0x13'),this[_0x8220('0x14')][_0x8220('0xf')](this));ami['on'](_0x8220('0x15'),this[_0x8220('0x16')][_0x8220('0xf')](this));ami['on'](_0x8220('0x17'),this[_0x8220('0x18')][_0x8220('0xf')](this));ami['on'](_0x8220('0x19'),this[_0x8220('0x1a')]['bind'](this));ami['on']('musiconholdstop',this[_0x8220('0x1b')][_0x8220('0xf')](this));ami['on'](_0x8220('0x1c'),this[_0x8220('0x1d')][_0x8220('0xf')](this));ami['on'](_0x8220('0x1e'),this[_0x8220('0x1f')][_0x8220('0xf')](this));}VoiceAgentReport[_0x8220('0x20')]['emit']=function(_0x7fd695,_0x38a96c,_0x492dac){io['to'](_0x7fd695)[_0x8220('0x21')](_0x38a96c,_0x492dac);};VoiceAgentReport['prototype']['isNotNull']=function(_0x3fb792){return _0x3fb792!==null&&!_['isUndefined'](_0x3fb792);};VoiceAgentReport[_0x8220('0x20')][_0x8220('0xc')]=function(_0x3886b4){try{if(this[_0x8220('0x22')](_0x3886b4)){logger[_0x8220('0x23')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3886b4['uniqueid'],_0x3886b4[_0x8220('0x24')],_0x3886b4[_0x8220('0x25')]);logger[_0x8220('0x26')](_0x8220('0x27'),_0x3886b4[_0x8220('0x28')],util[_0x8220('0x29')](_0x3886b4,{'showHidden':![],'depth':null}));if(_[_0x8220('0x2a')](this['channels'][_0x3886b4[_0x8220('0x28')]])){this['channels'][_0x3886b4[_0x8220('0x28')]]={};}if(_[_0x8220('0x2a')](this[_0x8220('0x8')][_0x3886b4['uniqueid']][_0x3886b4[_0x8220('0x25')]])){this[_0x8220('0x8')][_0x3886b4[_0x8220('0x28')]][_0x3886b4[_0x8220('0x25')]]={'agentcalledAt':moment()['format'](_0x8220('0x2b')),'lastevent':_0x8220('0x2c'),'mandatoryDisposition':this[_0x8220('0x9')][_0x3886b4['queue']]?this[_0x8220('0x9')][_0x3886b4[_0x8220('0x2d')]][_0x8220('0x2e')]||![]:![],'type':this[_0x8220('0x9')][_0x3886b4[_0x8220('0x2d')]]?this['voiceQueues'][_0x3886b4[_0x8220('0x2d')]][_0x8220('0x2f')]||_0x8220('0x30'):_0x8220('0x30'),'variables':this[_0x8220('0x31')][_0x3886b4[_0x8220('0x28')]]};}_[_0x8220('0x32')](this[_0x8220('0x8')][_0x3886b4[_0x8220('0x28')]][_0x3886b4['destuniqueid']],_[_0x8220('0x33')](_0x3886b4,['event',_0x8220('0x34')]));logger[_0x8220('0x26')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x3886b4[_0x8220('0x28')],util[_0x8220('0x29')](this[_0x8220('0x8')][_0x3886b4[_0x8220('0x28')]][_0x3886b4[_0x8220('0x25')]],{'showHidden':![],'depth':null}));ami[_0x8220('0x21')](_0x8220('0x35'),this[_0x8220('0x8')][_0x3886b4['uniqueid']][_0x3886b4[_0x8220('0x25')]]);logger[_0x8220('0x26')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x3886b4['uniqueid'],util[_0x8220('0x29')](this[_0x8220('0x8')][_0x3886b4[_0x8220('0x28')]][_0x3886b4['destuniqueid']],{'showHidden':![],'depth':null}));this['emit'](util[_0x8220('0x36')](_0x8220('0x37'),_0x3886b4[_0x8220('0x24')]),_0x8220('0x38'),this['channels'][_0x3886b4[_0x8220('0x28')]][_0x3886b4[_0x8220('0x25')]]);}}catch(_0x47b2cf){logger[_0x8220('0x39')](_0x8220('0x3a'),_0x3886b4['uniqueid'],util[_0x8220('0x29')](_0x47b2cf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8220('0x20')][_0x8220('0xe')]=function(_0x372f6d){try{if(this[_0x8220('0x22')](_0x372f6d)){if(this[_0x8220('0x8')][_0x372f6d['uniqueid']]){logger['debug'](_0x8220('0x3b'),_0x372f6d[_0x8220('0x28')],util[_0x8220('0x29')](_0x372f6d,{'showHidden':![],'depth':null}));for(var _0x2810ca in this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]]){if(this[_0x8220('0x8')][_0x372f6d['uniqueid']][_0x8220('0x3c')](_0x2810ca)){if(_0x372f6d[_0x8220('0x25')]===_0x2810ca){logger[_0x8220('0x23')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x372f6d[_0x8220('0x28')],_0x372f6d[_0x8220('0x24')],_0x372f6d[_0x8220('0x25')]);this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca]['agentconnectAt']=moment()[_0x8220('0x36')](_0x8220('0x2b'));this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x3d')]=_0x372f6d[_0x8220('0x3d')];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x3e')]=_0x372f6d['connectedlinenum'];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x3f')]=_0x372f6d[_0x8220('0x3f')];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x40')]=_0x372f6d['destchannelstatedesc'];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x41')]=_0x372f6d['holdtime'];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca]['lastevent']='connect';_[_0x8220('0x32')](this[_0x8220('0xa')][_0x372f6d[_0x8220('0x42')]],_[_0x8220('0x43')](_0x372f6d,[_0x8220('0x2d'),_0x8220('0x44')]));logger['debug'](_0x8220('0x45'),_0x372f6d['uniqueid'],util[_0x8220('0x29')](this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x372f6d[_0x8220('0x25')]],{'showHidden':![],'depth':null}));ami[_0x8220('0x21')](_0x8220('0x46'),this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x372f6d[_0x8220('0x25')]]);logger[_0x8220('0x26')](_0x8220('0x47'),_0x372f6d['uniqueid'],util[_0x8220('0x29')](this[_0x8220('0x8')][_0x372f6d['uniqueid']][_0x372f6d['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x8220('0x21')](util[_0x8220('0x36')](_0x8220('0x37'),_0x372f6d[_0x8220('0x24')]),_0x8220('0x48'),this['channels'][_0x372f6d[_0x8220('0x28')]][_0x372f6d['destuniqueid']]);}else if(!this['channels'][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x10')]&&!this[_0x8220('0x8')][_0x372f6d['uniqueid']][_0x2810ca][_0x8220('0x13')]){logger[_0x8220('0x23')](_0x8220('0x49'),_0x372f6d[_0x8220('0x28')],this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x24')],_0x2810ca);this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x10')]=!![];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x4a')]=moment()[_0x8220('0x36')](_0x8220('0x2b'));this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x4b')]=_0x372f6d[_0x8220('0x25')];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x4c')]=_0x372f6d[_0x8220('0x24')];this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x4d')]='answered_elsewhere';this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca][_0x8220('0x4e')]=_0x8220('0x4f');logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x372f6d[_0x8220('0x28')],util[_0x8220('0x29')](this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca],{'showHidden':![],'depth':null}));ami[_0x8220('0x21')](_0x8220('0x50'),this[_0x8220('0x8')][_0x372f6d[_0x8220('0x28')]][_0x2810ca]);}}}}}}catch(_0x2207ed){logger[_0x8220('0x39')](_0x8220('0x51'),_0x372f6d[_0x8220('0x28')],util[_0x8220('0x29')](_0x2207ed,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8220('0x20')][_0x8220('0x11')]=function(_0x281ee9){try{if(this[_0x8220('0x22')](_0x281ee9)){logger[_0x8220('0x26')](_0x8220('0x52'),_0x281ee9['uniqueid'],util[_0x8220('0x29')](_0x281ee9,{'showHidden':![],'depth':null}));if(this[_0x8220('0x8')][_0x281ee9[_0x8220('0x28')]]&&this['channels'][_0x281ee9[_0x8220('0x28')]][_0x281ee9[_0x8220('0x25')]]){logger[_0x8220('0x23')](_0x8220('0x53'),_0x281ee9[_0x8220('0x28')],_0x281ee9[_0x8220('0x24')],_0x281ee9['destuniqueid']);this[_0x8220('0x8')][_0x281ee9['uniqueid']][_0x281ee9['destuniqueid']][_0x8220('0x10')]=!![];this[_0x8220('0x8')][_0x281ee9[_0x8220('0x28')]][_0x281ee9[_0x8220('0x25')]][_0x8220('0x4a')]=moment()[_0x8220('0x36')](_0x8220('0x2b'));this['channels'][_0x281ee9['uniqueid']][_0x281ee9[_0x8220('0x25')]][_0x8220('0x4d')]=_0x8220('0x54');this[_0x8220('0x8')][_0x281ee9[_0x8220('0x28')]][_0x281ee9['destuniqueid']][_0x8220('0x4e')]=_0x8220('0x54');logger[_0x8220('0x26')](_0x8220('0x55'),_0x281ee9[_0x8220('0x28')],util['inspect'](this[_0x8220('0x8')][_0x281ee9[_0x8220('0x28')]][_0x281ee9[_0x8220('0x25')]],{'showHidden':![],'depth':null}));ami[_0x8220('0x21')]('custom:agentringnoanswer',this[_0x8220('0x8')][_0x281ee9['uniqueid']][_0x281ee9['destuniqueid']]);}}}catch(_0x10121a){logger[_0x8220('0x39')]('[%s][voiceAgentReport][agentringnoanswer]',_0x281ee9[_0x8220('0x28')],util[_0x8220('0x29')](_0x10121a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x5a7c3c){try{if(this[_0x8220('0x22')](_0x5a7c3c)){logger[_0x8220('0x26')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x5a7c3c[_0x8220('0x28')],util[_0x8220('0x29')](_0x5a7c3c,{'showHidden':![],'depth':null}));if(this[_0x8220('0x8')][_0x5a7c3c['uniqueid']]){for(var _0x5703ea in this[_0x8220('0x8')][_0x5a7c3c[_0x8220('0x28')]]){if(this['channels'][_0x5a7c3c['uniqueid']][_0x8220('0x3c')](_0x5703ea)&&!this['channels'][_0x5a7c3c['uniqueid']][_0x5703ea][_0x8220('0x10')]&&!this[_0x8220('0x8')][_0x5a7c3c[_0x8220('0x28')]][_0x5703ea]['agentcomplete']){logger['info'](_0x8220('0x56'),_0x5a7c3c['uniqueid'],this[_0x8220('0x8')][_0x5a7c3c[_0x8220('0x28')]][_0x5703ea]['membername'],_0x5703ea);this['channels'][_0x5a7c3c[_0x8220('0x28')]][_0x5703ea][_0x8220('0x10')]=!![];this[_0x8220('0x8')][_0x5a7c3c[_0x8220('0x28')]][_0x5703ea][_0x8220('0x4a')]=moment()[_0x8220('0x36')](_0x8220('0x2b'));this[_0x8220('0x8')][_0x5a7c3c[_0x8220('0x28')]][_0x5703ea][_0x8220('0x4d')]='abandoned';this[_0x8220('0x8')][_0x5a7c3c[_0x8220('0x28')]][_0x5703ea]['reason']=_0x8220('0x57');logger[_0x8220('0x26')](_0x8220('0x58'),_0x5a7c3c['uniqueid'],util[_0x8220('0x29')](this[_0x8220('0x8')][_0x5a7c3c['uniqueid']][_0x5703ea],{'showHidden':![],'depth':null}));ami[_0x8220('0x21')](_0x8220('0x59'),this[_0x8220('0x8')][_0x5a7c3c[_0x8220('0x28')]][_0x5703ea]);}}}}}catch(_0x17cad6){logger[_0x8220('0x39')](_0x8220('0x5a'),_0x5a7c3c['uniqueid'],util[_0x8220('0x29')](_0x17cad6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8220('0x20')][_0x8220('0x14')]=function(_0x2701c3){try{if(this[_0x8220('0x22')](_0x2701c3)){logger[_0x8220('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2701c3[_0x8220('0x28')],util[_0x8220('0x29')](_0x2701c3,{'showHidden':![],'depth':null}));if(this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]]){for(var _0x305ba6 in this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]]){if(this[_0x8220('0x8')][_0x2701c3['uniqueid']][_0x8220('0x3c')](_0x305ba6)){if(this['channels'][_0x2701c3['uniqueid']][_0x305ba6][_0x8220('0x5b')]&&!this['channels'][_0x2701c3[_0x8220('0x28')]][_0x305ba6]['agentcomplete']){logger[_0x8220('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2701c3[_0x8220('0x28')],this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]][_0x305ba6][_0x8220('0x24')],_0x305ba6);this['channels'][_0x2701c3['uniqueid']][_0x305ba6][_0x8220('0x13')]=!![];this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]][_0x305ba6][_0x8220('0x5c')]=moment()[_0x8220('0x36')](_0x8220('0x2b'));this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]][_0x305ba6][_0x8220('0x4d')]='complete';this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]][_0x305ba6][_0x8220('0x4e')]=_0x2701c3[_0x8220('0x4e')]==_0x8220('0x5d')?_0x8220('0x5e'):_0x2701c3['reason'];this['channels'][_0x2701c3[_0x8220('0x28')]][_0x305ba6]['talktime']=_0x2701c3[_0x8220('0x5f')];if(this[_0x8220('0x9')][_0x2701c3[_0x8220('0x2d')]]&&this[_0x8220('0x9')][_0x2701c3[_0x8220('0x2d')]][_0x8220('0x60')]){this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]][_0x305ba6]['acwtime']=this[_0x8220('0x9')][_0x2701c3['queue']][_0x8220('0x61')];this['channels'][_0x2701c3[_0x8220('0x28')]][_0x305ba6][_0x8220('0x62')]=!![];}this['agents'][_0x2701c3[_0x8220('0x42')]]=_[_0x8220('0x33')](this[_0x8220('0xa')][_0x2701c3[_0x8220('0x42')]],['queue',_0x8220('0x44')]);logger[_0x8220('0x26')](_0x8220('0x63'),_0x2701c3[_0x8220('0x28')],util['inspect'](this['channels'][_0x2701c3['uniqueid']][_0x305ba6],{'showHidden':![],'depth':null}));ami[_0x8220('0x21')](_0x8220('0x64'),this['channels'][_0x2701c3[_0x8220('0x28')]][_0x305ba6]);logger[_0x8220('0x26')](_0x8220('0x65'),_0x2701c3[_0x8220('0x28')],util[_0x8220('0x29')](this['channels'][_0x2701c3[_0x8220('0x28')]][_0x305ba6],{'showHidden':![],'depth':null}));this['emit'](util[_0x8220('0x36')](_0x8220('0x37'),_0x2701c3[_0x8220('0x24')]),_0x8220('0x66'),this[_0x8220('0x8')][_0x2701c3[_0x8220('0x28')]][_0x305ba6]);}}}}}}catch(_0x4af518){logger[_0x8220('0x39')](_0x8220('0x67'),_0x2701c3[_0x8220('0x28')],util[_0x8220('0x29')](_0x4af518,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8220('0x16')]=function(_0x2725aa){try{if(this[_0x8220('0x22')](_0x2725aa)){logger[_0x8220('0x26')](_0x8220('0x68'),_0x2725aa[_0x8220('0x28')],util[_0x8220('0x29')](_0x2725aa,{'showHidden':![],'depth':null}));this[_0x8220('0x69')](_0x2725aa['uniqueid'],_[_0x8220('0x6a')](_0x2725aa[_0x8220('0x6b')])[0x0],_0x2725aa[_0x8220('0x6c')]);if(this[_0x8220('0x8')][_0x2725aa[_0x8220('0x28')]]){for(var _0x1b20fd in this[_0x8220('0x8')][_0x2725aa[_0x8220('0x28')]]){if(this[_0x8220('0x8')][_0x2725aa[_0x8220('0x28')]][_0x8220('0x3c')](_0x1b20fd)){logger[_0x8220('0x23')](_0x8220('0x6d'),_0x2725aa[_0x8220('0x28')],_0x1b20fd,_['keys'](_0x2725aa[_0x8220('0x6b')])[0x0],_0x2725aa['value']);if(_['isUndefined'](this['channels'][_0x2725aa[_0x8220('0x28')]][_0x1b20fd][_0x8220('0x31')])){this[_0x8220('0x8')][_0x2725aa[_0x8220('0x28')]][_0x1b20fd][_0x8220('0x31')]={};}this[_0x8220('0x8')][_0x2725aa['uniqueid']][_0x1b20fd]['variables']=this[_0x8220('0x31')][_0x2725aa[_0x8220('0x28')]];}}}}}catch(_0x4bcaad){logger['error']('[%s][voiceAgentReport][varset]',_0x2725aa[_0x8220('0x28')],util[_0x8220('0x29')](_0x4bcaad,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x30a8fa,_0x52a842,_0x576ad6){var _0x5089c5=['rtpaudioqos',_0x8220('0x6e'),'rtpaudioqosjitter',_0x8220('0x6f'),_0x8220('0x70'),'rtpaudioqoslossbridged',_0x8220('0x71'),_0x8220('0x72'),'sipcallid','sipuri',_0x8220('0x73'),_0x8220('0x74'),_0x8220('0x75'),_0x8220('0x76'),'memberinterface',_0x8220('0x77'),'membername',_0x8220('0x78'),_0x8220('0x79')];if(!_[_0x8220('0x7a')](_0x52a842)&&!_[_0x8220('0x7b')](_0x5089c5,_0x52a842)){if(_['isUndefined'](this['variables'][_0x30a8fa])){this['variables'][_0x30a8fa]={};}this[_0x8220('0x31')][_0x30a8fa][_0x52a842]=_0x576ad6;}};VoiceAgentReport[_0x8220('0x20')]['syncHangup']=function(_0x2cb851){try{if(this[_0x8220('0x22')](_0x2cb851)){logger[_0x8220('0x26')](_0x8220('0x7c'),_0x2cb851[_0x8220('0x28')],util[_0x8220('0x29')](_0x2cb851,{'showHidden':![],'depth':null}));if(this[_0x8220('0x8')][_0x2cb851['uniqueid']]){for(var _0x52b7f9 in this['channels'][_0x2cb851['uniqueid']]){if(this[_0x8220('0x8')][_0x2cb851[_0x8220('0x28')]][_0x8220('0x3c')](_0x52b7f9)){if(this[_0x8220('0x8')][_0x2cb851['uniqueid']][_0x52b7f9][_0x8220('0x4e')]==_0x8220('0x5d')&&this[_0x8220('0x8')][_0x2cb851['uniqueid']][_0x52b7f9][_0x8220('0x13')]){logger[_0x8220('0x23')](_0x8220('0x7d'),_0x2cb851[_0x8220('0x28')],_0x52b7f9);this[_0x8220('0x8')][_0x2cb851[_0x8220('0x28')]][_0x52b7f9]['agentcompleteAt']=moment()[_0x8220('0x36')](_0x8220('0x2b'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x2cb851['uniqueid'],util['inspect'](_[_0x8220('0x7e')](this[_0x8220('0x8')][_0x2cb851[_0x8220('0x28')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x8220('0x7f'),_[_0x8220('0x7e')](this[_0x8220('0x8')][_0x2cb851['uniqueid']]));delete this[_0x8220('0x8')][_0x2cb851[_0x8220('0x28')]];}if(this['variables'][_0x2cb851['uniqueid']]){delete this['variables'][_0x2cb851[_0x8220('0x28')]];}}}catch(_0x3061cd){logger['error']('[%s][voiceAgentReport][hangup]',_0x2cb851['uniqueid'],util[_0x8220('0x29')](_0x3061cd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8220('0x20')][_0x8220('0x1d')]=function(_0x463c1d){try{if(this[_0x8220('0x22')](_0x463c1d)){logger['debug'](_0x8220('0x80'),_0x463c1d['uniqueid'],util[_0x8220('0x29')](_0x463c1d,{'showHidden':![],'depth':null}));if(this['channels'][_0x463c1d[_0x8220('0x81')]]){for(var _0x4f263a in this['channels'][_0x463c1d['transfereeuniqueid']]){if(this[_0x8220('0x8')][_0x463c1d[_0x8220('0x81')]][_0x8220('0x3c')](_0x4f263a)){if(_0x463c1d[_0x8220('0x82')]===_0x4f263a){logger[_0x8220('0x23')](_0x8220('0x83'),_0x463c1d['uniqueid'],this['channels'][_0x463c1d[_0x8220('0x81')]][_0x4f263a][_0x8220('0x24')],_0x4f263a);var _0x50a6f4=moment();this[_0x8220('0x8')][_0x463c1d[_0x8220('0x81')]][_0x4f263a][_0x8220('0x13')]=!![];this[_0x8220('0x8')][_0x463c1d[_0x8220('0x81')]][_0x4f263a][_0x8220('0x5c')]=moment()[_0x8220('0x36')](_0x8220('0x2b'));this[_0x8220('0x8')][_0x463c1d[_0x8220('0x81')]][_0x4f263a]['lastevent']='complete';this['channels'][_0x463c1d[_0x8220('0x81')]][_0x4f263a][_0x8220('0x4e')]='transfer';this[_0x8220('0x8')][_0x463c1d[_0x8220('0x81')]][_0x4f263a][_0x8220('0x5f')]=_0x50a6f4[_0x8220('0x84')](this['channels'][_0x463c1d[_0x8220('0x81')]][_0x4f263a][_0x8220('0x5b')],_0x8220('0x85'));}}}}if(this['channels'][_0x463c1d[_0x8220('0x86')]]){var _0x460885=this['channels'][_0x463c1d['secondtransfereruniqueid']];this[_0x8220('0x8')][_0x463c1d[_0x8220('0x86')]]=this[_0x8220('0x8')][_0x463c1d[_0x8220('0x81')]];this[_0x8220('0x8')][_0x463c1d['transfereeuniqueid']]=_0x460885;}}}catch(_0x2ef992){logger[_0x8220('0x39')](_0x8220('0x87'),_0x463c1d[_0x8220('0x28')],util['inspect'](_0x2ef992,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x6e8663){try{if(this[_0x8220('0x22')](_0x6e8663)){logger[_0x8220('0x26')](_0x8220('0x88'),_0x6e8663[_0x8220('0x28')],util[_0x8220('0x29')](_0x6e8663,{'showHidden':![],'depth':null}));if(this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]]){for(var _0x30b0dc in this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]]){if(this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]][_0x8220('0x3c')](_0x30b0dc)){if(_0x6e8663['transfereruniqueid']===_0x30b0dc){logger[_0x8220('0x23')](_0x8220('0x89'),_0x6e8663['uniqueid'],this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]][_0x30b0dc]['membername'],_0x30b0dc);var _0x4bd61d=moment();this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]][_0x30b0dc][_0x8220('0x13')]=!![];this['channels'][_0x6e8663[_0x8220('0x81')]][_0x30b0dc]['agentcompleteAt']=_0x4bd61d;this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]][_0x30b0dc][_0x8220('0x4d')]=_0x8220('0x8a');this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]][_0x30b0dc][_0x8220('0x4e')]=_0x8220('0x5d');this[_0x8220('0x8')][_0x6e8663[_0x8220('0x81')]][_0x30b0dc]['talktime']=_0x4bd61d[_0x8220('0x84')](this['channels'][_0x6e8663['transfereeuniqueid']][_0x30b0dc][_0x8220('0x5b')],_0x8220('0x85'));}}}}}}catch(_0x209a09){logger[_0x8220('0x39')](_0x8220('0x8b'),_0x6e8663[_0x8220('0x28')],util[_0x8220('0x29')](_0x209a09,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8220('0x20')][_0x8220('0x1a')]=function(_0x116556){var _0x35e92b='';try{if(this[_0x8220('0x22')](_0x116556)){logger[_0x8220('0x26')](_0x8220('0x8c'),_0x116556[_0x8220('0x28')],util['inspect'](_0x116556,{'showHidden':![],'depth':null}));if(_0x116556[_0x8220('0x8d')]){_0x35e92b=_0x116556[_0x8220('0x8d')][_0x8220('0x8e')](0x0,_0x116556[_0x8220('0x8d')][_0x8220('0x8f')]('-'));if(this[_0x8220('0xa')][_0x35e92b]){logger['info'](_0x8220('0x90'),_0x116556[_0x8220('0x28')],_0x35e92b);this['agents'][_0x35e92b][_0x8220('0x91')]=!![];}}}}catch(_0x4ffd45){logger[_0x8220('0x39')]('[%s][voiceAgentReport][musiconholdstart]',_0x116556[_0x8220('0x28')],util[_0x8220('0x29')](_0x4ffd45,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8220('0x20')][_0x8220('0x1b')]=function(_0x46479d){var _0x281648='';try{if(this[_0x8220('0x22')](_0x46479d)){logger[_0x8220('0x26')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x46479d[_0x8220('0x28')],util[_0x8220('0x29')](_0x46479d,{'showHidden':![],'depth':null}));if(_0x46479d[_0x8220('0x8d')]){_0x281648=_0x46479d[_0x8220('0x8d')][_0x8220('0x8e')](0x0,_0x46479d['channel']['lastIndexOf']('-'));if(this['agents'][_0x281648]){logger[_0x8220('0x23')](_0x8220('0x92'),_0x46479d['uniqueid'],_0x281648);this[_0x8220('0xa')][_0x281648][_0x8220('0x91')]=![];}}}}catch(_0x4dc3a1){logger[_0x8220('0x39')](_0x8220('0x93'),_0x46479d['uniqueid'],util[_0x8220('0x29')](_0x4dc3a1,{'showHidden':![],'depth':null}));}};module[_0x8220('0x94')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 6bf7f31..2301ff3 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 _0x5fc3=['bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','uniqueid','linkedid','merge','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','pick','from-sip','split','exten','accountcode','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','format','keys','includes','lastapplication','lastdata','startsWith','cdr(','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','holdtime','diff','xcally-motion-preview','connectedlinenum','destinationchannel','membername','name','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','answertime','omit','destconnectedlinenum','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:%s','transferType','getSettings','then','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','inuse','invalid','unavailable','ringing','ringinuse','onhold','set','queue','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','channels','agents','blindTransfers','coreshowchannel'];(function(_0x3029ad,_0x4a48e1){var _0x221c99=function(_0xbb9186){while(--_0xbb9186){_0x3029ad['push'](_0x3029ad['shift']());}};_0x221c99(++_0x4a48e1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0x5fc3[_0x53b594];return _0x1e616f;};'use strict';var BPromise=require(_0x35fc('0x0'));var _=require(_0x35fc('0x1'));var moment=require('moment');var util=require(_0x35fc('0x2'));var path=require(_0x35fc('0x3'));var Redis=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('ami');var ami=require(_0x35fc('0x7'));var Channel=require(_0x35fc('0x8'));var RpcSetting=require(_0x35fc('0x9'));var statusDesc=['unknown','not_inuse',_0x35fc('0xa'),'busy',_0x35fc('0xb'),_0x35fc('0xc'),_0x35fc('0xd'),_0x35fc('0xe'),_0x35fc('0xf')];var applications=[_0x35fc('0x10'),_0x35fc('0x11'),'agi',_0x35fc('0x12'),_0x35fc('0x13'),'voicemail'];var dispositions=[_0x35fc('0x14'),_0x35fc('0x15'),'FAILED',_0x35fc('0x14'),_0x35fc('0x14'),'NO\x20ANSWER','ANSWERED',_0x35fc('0x16'),'FAILED',_0x35fc('0x15'),_0x35fc('0x15')];var actions={};config[_0x35fc('0x17')]=_[_0x35fc('0x18')](config[_0x35fc('0x17')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x558364){this[_0x35fc('0x19')]=_0x558364[_0x35fc('0x19')];this[_0x35fc('0x1a')]=_0x558364[_0x35fc('0x1a')];this[_0x35fc('0x1b')]={};ami['on'](_0x35fc('0x1c'),this['syncNewExten'][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x1e'),this['syncNewExten'][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x1f'),this[_0x35fc('0x20')]['bind'](this));ami['on'](_0x35fc('0x21'),this[_0x35fc('0x22')][_0x35fc('0x1d')](this));ami['on']('varset',this[_0x35fc('0x23')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x24'),this[_0x35fc('0x25')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x26'),this[_0x35fc('0x27')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x28'),this[_0x35fc('0x29')]['bind'](this));ami['on'](_0x35fc('0x2a'),this[_0x35fc('0x2b')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x2c'),this[_0x35fc('0x2d')]['bind'](this));ami['on'](_0x35fc('0x2e'),this[_0x35fc('0x2f')]['bind'](this));try{logger[_0x35fc('0x30')](_0x35fc('0x31'));ami[_0x35fc('0x32')]();}catch(_0x51cfec){logger[_0x35fc('0x33')]('[voiceCallReport][coreshowchannels]',util[_0x35fc('0x34')](_0x51cfec,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x35fc('0x35')]['isNotNull']=function(_0x519264){return _0x519264!==null&&!_[_0x35fc('0x36')](_0x519264);};VoiceCallReport['prototype'][_0x35fc('0x37')]=function(_0x1a5d92,_0x57001c,_0x26b7cb){io['to'](_0x1a5d92)[_0x35fc('0x37')](_0x57001c,_0x26b7cb);};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x27')]=function(_0x3735da){try{if(this[_0x35fc('0x38')](_0x3735da)){logger[_0x35fc('0x30')](_0x35fc('0x39'),_0x3735da['uniqueid'],_0x3735da[_0x35fc('0x3a')],_0x3735da[_0x35fc('0x3b')]);logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x3735da[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x3735da,{'showHidden':![],'depth':null}));if(_0x3735da[_0x35fc('0x3d')]===_0x3735da[_0x35fc('0x3e')]){if(!_[_0x35fc('0x36')](this[_0x35fc('0x19')][_0x3735da[_0x35fc('0x3d')]])){_[_0x35fc('0x3f')](this[_0x35fc('0x19')][_0x3735da[_0x35fc('0x3d')]],_['pick'](_0x3735da,_['keys'](this[_0x35fc('0x19')][_0x3735da['uniqueid']])));}}}}catch(_0x37b394){logger[_0x35fc('0x33')](_0x35fc('0x40'),_0x3735da[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x37b394,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncNewChannel']=function(_0x3fe193){try{if(this[_0x35fc('0x38')](_0x3fe193)){logger[_0x35fc('0x3c')](_0x35fc('0x41'),_0x3fe193[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x3fe193,{'showHidden':![],'depth':null}));if(_0x3fe193['uniqueid']===_0x3fe193[_0x35fc('0x3e')]&&_0x3fe193[_0x35fc('0x42')]!=_0x35fc('0x43')){if(_['isUndefined'](this[_0x35fc('0x19')][_0x3fe193['uniqueid']])){logger[_0x35fc('0x30')](_0x35fc('0x44'),_0x3fe193[_0x35fc('0x3d')],_0x3fe193[_0x35fc('0x45')],_0x3fe193['exten']);this['channels'][_0x3fe193['uniqueid']]=new Channel();this[_0x35fc('0x19')][_0x3fe193['uniqueid']][_0x35fc('0x46')]=moment()['format'](_0x35fc('0x47'));this[_0x35fc('0x19')][_0x3fe193[_0x35fc('0x3d')]][_0x35fc('0x48')]=dispositions[_[_0x35fc('0x49')](_0x3fe193[_0x35fc('0x4a')])];_[_0x35fc('0x3f')](this['channels'][_0x3fe193[_0x35fc('0x3d')]],_[_0x35fc('0x4b')](_0x3fe193,_['keys'](this[_0x35fc('0x19')][_0x3fe193[_0x35fc('0x3d')]])));if(_0x3fe193[_0x35fc('0x45')]===_0x35fc('0x4c')){if(this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]]){this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['destconnectedlinenum']=_0x3fe193[_0x35fc('0x4e')];logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3fe193[_0x35fc('0x3d')],util[_0x35fc('0x34')]({'destaccountcode':this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x4f')],'destconnectedlinenum':_0x3fe193[_0x35fc('0x4e')]},{'showHidden':![],'depth':null}));this[_0x35fc('0x37')](util['format']('user:%s',this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]][_0x35fc('0x4f')],'destconnectedlinenum':_0x3fe193[_0x35fc('0x4e')]});}}}}}}catch(_0x1fb0a6){logger[_0x35fc('0x33')]('[%s][voiceCallReport][newchannel]',_0x3fe193['uniqueid'],util['inspect'](_0x1fb0a6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0xb26e3f){try{if(this[_0x35fc('0x38')](_0xb26e3f)){logger['debug'](_0x35fc('0x50'),_0xb26e3f['uniqueid'],util[_0x35fc('0x34')](_0xb26e3f,{'showHidden':![],'depth':null}));if(_0xb26e3f[_0x35fc('0x3d')]===_0xb26e3f[_0x35fc('0x3e')]&&_0xb26e3f[_0x35fc('0x4e')]!='h'&&_0xb26e3f[_0x35fc('0x42')]!='OutgoingSpoolFailed'){_0xb26e3f[_0x35fc('0x51')]=_0xb26e3f[_0x35fc('0x51')]['toLowerCase']();_0xb26e3f[_0x35fc('0x52')]=(_0xb26e3f[_0x35fc('0x53')]||_0xb26e3f[_0x35fc('0x52')])[_0x35fc('0x54')]();logger['info'](_0x35fc('0x55'),_0xb26e3f['uniqueid'],_0xb26e3f['application'],_0xb26e3f[_0x35fc('0x52')]);if(_[_0x35fc('0x36')](this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]])){this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]]=new Channel();this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]]['starttime']=_0xb26e3f[_0x35fc('0x56')]?moment()[_0x35fc('0x57')](moment[_0x35fc('0x56')](_0xb26e3f[_0x35fc('0x56')])[_0x35fc('0x58')](),_0x35fc('0x58'))[_0x35fc('0x59')](_0x35fc('0x47')):moment()[_0x35fc('0x59')](_0x35fc('0x47'));this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x48')]=_0x35fc('0x14');}_['merge'](this['channels'][_0xb26e3f[_0x35fc('0x3d')]],_[_0x35fc('0x4b')](_0xb26e3f,_[_0x35fc('0x5a')](this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]])));if(_[_0x35fc('0x5b')](applications,_0xb26e3f['application'])){this['channels'][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x5c')]=_0xb26e3f[_0x35fc('0x51')];this[_0x35fc('0x19')][_0xb26e3f['uniqueid']][_0x35fc('0x5d')]=_0xb26e3f[_0x35fc('0x52')];if(_0xb26e3f['application']===_0x35fc('0x10')&&_[_0x35fc('0x5e')](_0xb26e3f['applicationdata'],_0x35fc('0x5f'))){var _0x1ab472=_0xb26e3f[_0x35fc('0x52')][_0x35fc('0x4d')]('=');var _0x5e4018=_0x1ab472[0x0]['match'](/cdr\((.*)\)/);if(_0x5e4018){this['channels'][_0xb26e3f[_0x35fc('0x3d')]][_0x5e4018[0x1]]=_0x1ab472[0x1];}}else if(_0xb26e3f[_0x35fc('0x51')]==='queue'){this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0xb26e3f[_0x35fc('0x52')][_0x35fc('0x4d')](',')[0x0];}}}}}catch(_0x538be0){logger[_0x35fc('0x33')](_0x35fc('0x60'),_0xb26e3f[_0x35fc('0x3d')],util['inspect'](_0x538be0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x22')]=function(_0x47fb1a){try{if(this[_0x35fc('0x38')](_0x47fb1a)){logger[_0x35fc('0x30')](_0x35fc('0x61'),_0x47fb1a[_0x35fc('0x3d')],_0x47fb1a[_0x35fc('0x3e')],_0x47fb1a[_0x35fc('0x3a')],_0x47fb1a[_0x35fc('0x3b')]);logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newstate]\x20event:',_0x47fb1a[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x47fb1a,{'showHidden':![],'depth':null}));if(_0x47fb1a[_0x35fc('0x3d')]!==_0x47fb1a['linkedid']){if(this[_0x35fc('0x19')][_0x47fb1a['linkedid']]){if(_0x47fb1a['channelstate']==='6'){if(!this['channels'][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x62')]){var _0x39a1ee=moment();this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['answered']=!![];this['channels'][_0x47fb1a['linkedid']]['answertime']=_0x39a1ee['format'](_0x35fc('0x47'));if(this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x46')]){this['channels'][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x63')]=_0x39a1ee[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x46')],_0x35fc('0x58'));}}this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['linkedid']=_0x47fb1a[_0x35fc('0x3d')];if(_0x47fb1a['calleridnum']!==_0x35fc('0x65')){this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x66')]=_0x47fb1a['calleridnum'];}this[_0x35fc('0x19')][_0x47fb1a['linkedid']]['connectedlinename']=_0x47fb1a['calleridname'];this[_0x35fc('0x19')][_0x47fb1a['linkedid']][_0x35fc('0x67')]=_0x47fb1a['channel'];this[_0x35fc('0x19')][_0x47fb1a['linkedid']][_0x35fc('0x48')]=dispositions[_[_0x35fc('0x49')](_0x47fb1a[_0x35fc('0x4a')])];if(this[_0x35fc('0x1a')][_0x47fb1a['channel'][_0x35fc('0x4d')]('-')[0x0]]){this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['UserId']=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['id'];this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x68')]=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')]['split']('-')[0x0]][_0x35fc('0x69')];}}}}else{if(this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3d')]]){if(_0x47fb1a['channelstate']==='6'){if(this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')]['split']('-')[0x0]]){this['channels'][_0x47fb1a[_0x35fc('0x3d')]]['UserId']=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['id'];this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3d')]][_0x35fc('0x68')]=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x69')];}}}}}}catch(_0x65ee1b){logger[_0x35fc('0x33')](_0x35fc('0x6a'),_0x47fb1a[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x65ee1b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x6b')]=function(_0x2d7b16,_0x3b2160){try{if(this[_0x35fc('0x19')][_0x2d7b16]){logger['info'](_0x35fc('0x6c'),_0x2d7b16,_0x3b2160);this['channels'][_0x2d7b16][_0x35fc('0x6d')]=!![];if(_[_0x35fc('0x6e')](_0x3b2160,_0x35fc('0x6f'))){_0x3b2160=_0x3b2160[_0x35fc('0x70')](_0x35fc('0x6f'),_0x35fc('0x71'));}this[_0x35fc('0x19')][_0x2d7b16][_0x35fc('0x72')]=_0x3b2160;var _0x2fed7b=_[_0x35fc('0x73')](this[_0x35fc('0x19')][_0x2d7b16]['monitors'],{'filename':_0x3b2160});if(_[_0x35fc('0x74')](_0x2fed7b)){this[_0x35fc('0x19')][_0x2d7b16][_0x35fc('0x75')][_0x35fc('0x76')]({'filename':_0x3b2160,'createdAt':moment()[_0x35fc('0x59')](_0x35fc('0x47')),'mixmonitorid':'','status':'rec'});}}}catch(_0x43ef1f){logger[_0x35fc('0x33')](_0x35fc('0x77'),_0x2d7b16,util[_0x35fc('0x34')](_0x43ef1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x23')]=function(_0x2d1cbf){try{if(this[_0x35fc('0x38')](_0x2d1cbf)){logger[_0x35fc('0x3c')]('[%s][voiceCallReport][varset]\x20event:',_0x2d1cbf[_0x35fc('0x3d')],util['inspect'](_0x2d1cbf,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]]&&_0x2d1cbf['channel']!=_0x35fc('0x43')){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')])){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x79')])){logger[_0x35fc('0x30')](_0x35fc('0x7a'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value']);this['syncMixMonitorFilename'](_0x2d1cbf['uniqueid'],_0x2d1cbf['value']);}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x7b')])){logger[_0x35fc('0x30')](_0x35fc('0x7c'),_0x2d1cbf['uniqueid'],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x3b')]=_0x2d1cbf['value'];}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x7e')])){logger['info'](_0x35fc('0x7f'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x80')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x81')])){logger[_0x35fc('0x30')](_0x35fc('0x82'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x83')]=_0x2d1cbf['value'];}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')]['xmd-queue'])){logger[_0x35fc('0x30')](_0x35fc('0x84'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value'][_0x35fc('0x4d')](',')[0x0]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0x2d1cbf[_0x35fc('0x7d')]['split'](',')[0x0];}else if(this['isNotNull'](_0x2d1cbf['variable'][_0x35fc('0x85')])){logger['info'](_0x35fc('0x86'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x87')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x88')])){logger[_0x35fc('0x30')](_0x35fc('0x89'),_0x2d1cbf['uniqueid'],_0x2d1cbf['value']);this['channels'][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x8a')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x8b')])){logger[_0x35fc('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x2d1cbf['uniqueid'],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]]['calleridpreview']=_0x2d1cbf['value'];}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')]['xmcs-queue'])){logger[_0x35fc('0x30')](_0x35fc('0x8c'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value']);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x8d')])){logger[_0x35fc('0x30')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x8e')]=_0x2d1cbf[_0x35fc('0x7d')];}}}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x79')])){if(_0x2d1cbf[_0x35fc('0x7d')]){var _0x45eaae=path[_0x35fc('0x8f')](_0x2d1cbf[_0x35fc('0x7d')])[_0x35fc('0x69')];logger[_0x35fc('0x30')](_0x35fc('0x7a'),_0x45eaae,_0x2d1cbf['value']);this[_0x35fc('0x6b')](_0x45eaae,_0x2d1cbf[_0x35fc('0x7d')]);}}else if(this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3e')]]){if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')])){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x8d')])){logger[_0x35fc('0x30')](_0x35fc('0x90'),_0x2d1cbf[_0x35fc('0x3e')],_0x2d1cbf[_0x35fc('0x7d')]);this['channels'][_0x2d1cbf['linkedid']][_0x35fc('0x91')]=_0x2d1cbf[_0x35fc('0x7d')];}}}}}catch(_0x961ee9){logger['error'](_0x35fc('0x92'),_0x2d1cbf[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x961ee9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncHangup']=function(_0x5874db){try{if(this[_0x35fc('0x38')](_0x5874db)){logger['debug'](_0x35fc('0x93'),_0x5874db[_0x35fc('0x3d')],util['inspect'](_0x5874db,{'showHidden':![],'depth':null}));if(this['channels'][_0x5874db[_0x35fc('0x3d')]]){logger[_0x35fc('0x30')](_0x35fc('0x94'),_0x5874db['uniqueid'],_0x5874db[_0x35fc('0x95')]);var _0x177088=moment();this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x96')]=_0x177088[_0x35fc('0x59')](_0x35fc('0x47'));this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x56')]=_0x177088[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x46')],_0x35fc('0x58'));if(this['channels'][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x62')]){this['channels'][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x97')]=_0x177088['diff'](this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x98')],_0x35fc('0x58'));this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x63')]=this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]]['duration']-this[_0x35fc('0x19')][_0x5874db['uniqueid']]['billableseconds'];}if(_0x5874db[_0x35fc('0x45')]===_0x35fc('0x4c')){if(this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]){this['agents'][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]=_[_0x35fc('0x99')](this['agents'][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]],[_0x35fc('0x9a')]);logger[_0x35fc('0x3c')](_0x35fc('0x9b'),_0x5874db['uniqueid'],util[_0x35fc('0x34')]({'destaccountcode':this[_0x35fc('0x1a')][_0x5874db['channel']['split']('-')[0x0]][_0x35fc('0x4f')]},{'showHidden':![],'depth':null}));this[_0x35fc('0x37')](util[_0x35fc('0x59')](_0x35fc('0x9c'),this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x4f')]});}}var _0x1c3630=this;Promise['resolve']()['then'](function(){var _0x2c213d=_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]];if(typeof _0x2c213d[_0x35fc('0x9d')]==='undefined')return;if(_['isEmpty'](_0x2c213d[_0x35fc('0x75')]))return;return RpcSetting[_0x35fc('0x9e')]()[_0x35fc('0x9f')](function(_0xd46d64){if(!_0xd46d64['stopRecordingOnTransfer'])return;return Promise['resolve']()[_0x35fc('0x9f')](function(){return ami[_0x35fc('0xa0')]({'action':'StopMixMonitor','channel':_0x2c213d[_0x35fc('0x42')]})[_0x35fc('0xa1')](function(){});})[_0x35fc('0x9f')](function(){return ami[_0x35fc('0xa0')]({'action':_0x35fc('0xa2'),'channel':_0x2c213d[_0x35fc('0x67')]})[_0x35fc('0xa1')](function(){})[_0x35fc('0xa3')](function(){var _0x42836b=_0x1c3630[_0x35fc('0x1a')][_0x2c213d[_0x35fc('0x67')][_0x35fc('0x4d')]('-')[0x0]];if(!_0x42836b)return;io[_0x35fc('0x37')](_0x35fc('0xa4'),{'agentId':_0x42836b['id'],'uniqueid':_0x2c213d[_0x35fc('0x3d')]});});});});})[_0x35fc('0x9f')](function(){if(_0x5874db['event']===_0x35fc('0xa5')){_0x1c3630['blindTransfers'][_0x5874db[_0x35fc('0x3d')]]=_0x1c3630['channels'][_0x5874db['uniqueid']];}else{if(_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x83')]==='outbound'&&_0x1c3630[_0x35fc('0x1b')][_0x5874db[_0x35fc('0x3d')]]){_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x3d')]=[_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['linkedid'],_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['linkedid']=_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['uniqueid']][0x0];delete _0x1c3630['blindTransfers'][_0x5874db[_0x35fc('0x3d')]];}}logger['debug'](_0x35fc('0xa6'),_0x5874db[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]],{'showHidden':![],'depth':null}));ami[_0x35fc('0x37')]('custom:voiceCallReport',_0x1c3630['channels'][_0x5874db[_0x35fc('0x3d')]]);delete _0x1c3630['channels'][_0x5874db[_0x35fc('0x3d')]];});}}}catch(_0x39d9ec){logger['error']('[%s][voiceCallReport][hangup]',_0x5874db['uniqueid'],util[_0x35fc('0x34')](_0x39d9ec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x29')]=function(_0x135e18){try{if(this[_0x35fc('0x38')](_0x135e18)){logger[_0x35fc('0x30')](_0x35fc('0xa7'),_0x135e18[_0x35fc('0x3d')],_0x135e18['origtransferercalleridnum'],_0x135e18['transfertargetcalleridnum']);logger['debug']('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x135e18[_0x35fc('0x3d')],util['inspect'](_0x135e18,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x135e18['transfereeuniqueid']]){this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]]['transfercalleridnum']=_0x135e18['origtransferercalleridnum'];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]][_0x35fc('0xa9')]=_0x135e18[_0x35fc('0xaa')];if(this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]){var _0x57bbed=this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']];this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]=this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]]=_0x57bbed;}}else if(this['channels'][_0x135e18[_0x35fc('0xab')]]){this['channels'][_0x135e18[_0x35fc('0xab')]]['transfercalleridnum']=_0x135e18['origtransferercalleridnum'];this[_0x35fc('0x19')][_0x135e18['transfertargetuniqueid']][_0x35fc('0xa9')]=_0x135e18[_0x35fc('0xaa')];if(this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]){var _0x57bbed=this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]=this['channels'][_0x135e18[_0x35fc('0xab')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xab')]]=_0x57bbed;}}if((this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]||this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]])&&this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]){var _0x59c81a=_['some']([this['channels'][_0x135e18['origtransfereruniqueid']],this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]],this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xae')]]],function(_0x243e0d){return _0x243e0d&&_0x243e0d['type']===_0x35fc('0xaf')&&_0x243e0d[_0x35fc('0xb0')];});if(_0x59c81a){if(this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]])this[_0x35fc('0x19')][_0x135e18['origtransfereruniqueid']][_0x35fc('0x9d')]=_0x35fc('0xb1');if(this[_0x35fc('0x19')][_0x135e18['origtransfererlinkedid']])this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]][_0x35fc('0x9d')]=_0x35fc('0xb1');this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xae')]][_0x35fc('0x9d')]=_0x35fc('0xb1');}}}}catch(_0x1eaab6){logger[_0x35fc('0x33')](_0x35fc('0xb2'),_0x135e18[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x1eaab6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x2b')]=function(_0x47a52d){try{if(this['isNotNull'](_0x47a52d)){logger[_0x35fc('0x30')](_0x35fc('0xb3'),_0x47a52d[_0x35fc('0x3d')],_0x47a52d[_0x35fc('0xb4')],_0x47a52d[_0x35fc('0xb5')]);logger[_0x35fc('0x3c')](_0x35fc('0xb6'),_0x47a52d[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x47a52d,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]]){this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0xb7')]=_0x47a52d[_0x35fc('0xb4')];this['channels'][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0xa9')]=_0x47a52d[_0x35fc('0xb5')];this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0x9d')]=_0x35fc('0xb8');this[_0x35fc('0x25')]({'event':'BlindTransfer','uniqueid':_0x47a52d['transfereeuniqueid'],'context':_0x47a52d[_0x35fc('0x45')],'channel':_0x47a52d[_0x35fc('0xb9')]});}else{this['channels'][_0x47a52d[_0x35fc('0xba')]][_0x35fc('0x9d')]=_0x35fc('0xb8');}}}catch(_0x287555){logger['error'](_0x35fc('0xbb'),_0x47a52d[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x287555,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncMusicOnHoldStart']=function(_0x49ed6b){try{if(this[_0x35fc('0x38')](_0x49ed6b)){logger['debug'](_0x35fc('0xbc'),_0x49ed6b[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x49ed6b,{'showHidden':![],'depth':null}));if(this['channels'][_0x49ed6b[_0x35fc('0x3d')]]){if(!_['isNil'](this[_0x35fc('0x19')][_0x49ed6b[_0x35fc('0x3d')]]['answertime'])){this[_0x35fc('0x19')][_0x49ed6b[_0x35fc('0x3d')]][_0x35fc('0xbd')]=moment()[_0x35fc('0x59')](_0x35fc('0x47'));logger[_0x35fc('0x30')](_0x35fc('0xbe'),_0x49ed6b['uniqueid'],this['channels'][_0x49ed6b[_0x35fc('0x3d')]][_0x35fc('0xbd')]);}}}}catch(_0x2463dd){logger[_0x35fc('0x33')](_0x35fc('0xbf'),_0x49ed6b[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x2463dd,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x35fc('0x2f')]=function(_0x4110e7){try{if(this[_0x35fc('0x38')](_0x4110e7)){logger['debug'](_0x35fc('0xc0'),_0x4110e7[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x4110e7,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]]){if(!_[_0x35fc('0x74')](this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')])){this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xc1')]+=moment()[_0x35fc('0xc2')](0x0)[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')],_0x35fc('0x58'));logger[_0x35fc('0x30')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x4110e7[_0x35fc('0x3d')],this['channels'][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xc1')]);delete this['channels'][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')];}}}}catch(_0x462c30){logger[_0x35fc('0x33')](_0x35fc('0xc3'),_0x4110e7[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x462c30,{'showHidden':![],'depth':null}));}};module[_0x35fc('0xc4')]=VoiceCallReport; \ No newline at end of file +var _0x5fc3=['bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','uniqueid','linkedid','merge','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','pick','from-sip','split','exten','accountcode','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','format','keys','includes','lastapplication','lastdata','startsWith','cdr(','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','holdtime','diff','xcally-motion-preview','connectedlinenum','destinationchannel','membername','name','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','answertime','omit','destconnectedlinenum','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:%s','transferType','getSettings','then','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','inuse','invalid','unavailable','ringing','ringinuse','onhold','set','queue','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','channels','agents','blindTransfers','coreshowchannel'];(function(_0x38a653,_0x1a5872){var _0x370492=function(_0x33a556){while(--_0x33a556){_0x38a653['push'](_0x38a653['shift']());}};_0x370492(++_0x1a5872);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x5fc3[_0x3ceb54];return _0x26d8a6;};'use strict';var BPromise=require(_0x35fc('0x0'));var _=require(_0x35fc('0x1'));var moment=require('moment');var util=require(_0x35fc('0x2'));var path=require(_0x35fc('0x3'));var Redis=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('ami');var ami=require(_0x35fc('0x7'));var Channel=require(_0x35fc('0x8'));var RpcSetting=require(_0x35fc('0x9'));var statusDesc=['unknown','not_inuse',_0x35fc('0xa'),'busy',_0x35fc('0xb'),_0x35fc('0xc'),_0x35fc('0xd'),_0x35fc('0xe'),_0x35fc('0xf')];var applications=[_0x35fc('0x10'),_0x35fc('0x11'),'agi',_0x35fc('0x12'),_0x35fc('0x13'),'voicemail'];var dispositions=[_0x35fc('0x14'),_0x35fc('0x15'),'FAILED',_0x35fc('0x14'),_0x35fc('0x14'),'NO\x20ANSWER','ANSWERED',_0x35fc('0x16'),'FAILED',_0x35fc('0x15'),_0x35fc('0x15')];var actions={};config[_0x35fc('0x17')]=_[_0x35fc('0x18')](config[_0x35fc('0x17')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x558364){this[_0x35fc('0x19')]=_0x558364[_0x35fc('0x19')];this[_0x35fc('0x1a')]=_0x558364[_0x35fc('0x1a')];this[_0x35fc('0x1b')]={};ami['on'](_0x35fc('0x1c'),this['syncNewExten'][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x1e'),this['syncNewExten'][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x1f'),this[_0x35fc('0x20')]['bind'](this));ami['on'](_0x35fc('0x21'),this[_0x35fc('0x22')][_0x35fc('0x1d')](this));ami['on']('varset',this[_0x35fc('0x23')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x24'),this[_0x35fc('0x25')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x26'),this[_0x35fc('0x27')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x28'),this[_0x35fc('0x29')]['bind'](this));ami['on'](_0x35fc('0x2a'),this[_0x35fc('0x2b')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x2c'),this[_0x35fc('0x2d')]['bind'](this));ami['on'](_0x35fc('0x2e'),this[_0x35fc('0x2f')]['bind'](this));try{logger[_0x35fc('0x30')](_0x35fc('0x31'));ami[_0x35fc('0x32')]();}catch(_0x51cfec){logger[_0x35fc('0x33')]('[voiceCallReport][coreshowchannels]',util[_0x35fc('0x34')](_0x51cfec,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x35fc('0x35')]['isNotNull']=function(_0x519264){return _0x519264!==null&&!_[_0x35fc('0x36')](_0x519264);};VoiceCallReport['prototype'][_0x35fc('0x37')]=function(_0x1a5d92,_0x57001c,_0x26b7cb){io['to'](_0x1a5d92)[_0x35fc('0x37')](_0x57001c,_0x26b7cb);};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x27')]=function(_0x3735da){try{if(this[_0x35fc('0x38')](_0x3735da)){logger[_0x35fc('0x30')](_0x35fc('0x39'),_0x3735da['uniqueid'],_0x3735da[_0x35fc('0x3a')],_0x3735da[_0x35fc('0x3b')]);logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x3735da[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x3735da,{'showHidden':![],'depth':null}));if(_0x3735da[_0x35fc('0x3d')]===_0x3735da[_0x35fc('0x3e')]){if(!_[_0x35fc('0x36')](this[_0x35fc('0x19')][_0x3735da[_0x35fc('0x3d')]])){_[_0x35fc('0x3f')](this[_0x35fc('0x19')][_0x3735da[_0x35fc('0x3d')]],_['pick'](_0x3735da,_['keys'](this[_0x35fc('0x19')][_0x3735da['uniqueid']])));}}}}catch(_0x37b394){logger[_0x35fc('0x33')](_0x35fc('0x40'),_0x3735da[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x37b394,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncNewChannel']=function(_0x3fe193){try{if(this[_0x35fc('0x38')](_0x3fe193)){logger[_0x35fc('0x3c')](_0x35fc('0x41'),_0x3fe193[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x3fe193,{'showHidden':![],'depth':null}));if(_0x3fe193['uniqueid']===_0x3fe193[_0x35fc('0x3e')]&&_0x3fe193[_0x35fc('0x42')]!=_0x35fc('0x43')){if(_['isUndefined'](this[_0x35fc('0x19')][_0x3fe193['uniqueid']])){logger[_0x35fc('0x30')](_0x35fc('0x44'),_0x3fe193[_0x35fc('0x3d')],_0x3fe193[_0x35fc('0x45')],_0x3fe193['exten']);this['channels'][_0x3fe193['uniqueid']]=new Channel();this[_0x35fc('0x19')][_0x3fe193['uniqueid']][_0x35fc('0x46')]=moment()['format'](_0x35fc('0x47'));this[_0x35fc('0x19')][_0x3fe193[_0x35fc('0x3d')]][_0x35fc('0x48')]=dispositions[_[_0x35fc('0x49')](_0x3fe193[_0x35fc('0x4a')])];_[_0x35fc('0x3f')](this['channels'][_0x3fe193[_0x35fc('0x3d')]],_[_0x35fc('0x4b')](_0x3fe193,_['keys'](this[_0x35fc('0x19')][_0x3fe193[_0x35fc('0x3d')]])));if(_0x3fe193[_0x35fc('0x45')]===_0x35fc('0x4c')){if(this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]]){this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['destconnectedlinenum']=_0x3fe193[_0x35fc('0x4e')];logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3fe193[_0x35fc('0x3d')],util[_0x35fc('0x34')]({'destaccountcode':this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x4f')],'destconnectedlinenum':_0x3fe193[_0x35fc('0x4e')]},{'showHidden':![],'depth':null}));this[_0x35fc('0x37')](util['format']('user:%s',this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]][_0x35fc('0x4f')],'destconnectedlinenum':_0x3fe193[_0x35fc('0x4e')]});}}}}}}catch(_0x1fb0a6){logger[_0x35fc('0x33')]('[%s][voiceCallReport][newchannel]',_0x3fe193['uniqueid'],util['inspect'](_0x1fb0a6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0xb26e3f){try{if(this[_0x35fc('0x38')](_0xb26e3f)){logger['debug'](_0x35fc('0x50'),_0xb26e3f['uniqueid'],util[_0x35fc('0x34')](_0xb26e3f,{'showHidden':![],'depth':null}));if(_0xb26e3f[_0x35fc('0x3d')]===_0xb26e3f[_0x35fc('0x3e')]&&_0xb26e3f[_0x35fc('0x4e')]!='h'&&_0xb26e3f[_0x35fc('0x42')]!='OutgoingSpoolFailed'){_0xb26e3f[_0x35fc('0x51')]=_0xb26e3f[_0x35fc('0x51')]['toLowerCase']();_0xb26e3f[_0x35fc('0x52')]=(_0xb26e3f[_0x35fc('0x53')]||_0xb26e3f[_0x35fc('0x52')])[_0x35fc('0x54')]();logger['info'](_0x35fc('0x55'),_0xb26e3f['uniqueid'],_0xb26e3f['application'],_0xb26e3f[_0x35fc('0x52')]);if(_[_0x35fc('0x36')](this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]])){this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]]=new Channel();this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]]['starttime']=_0xb26e3f[_0x35fc('0x56')]?moment()[_0x35fc('0x57')](moment[_0x35fc('0x56')](_0xb26e3f[_0x35fc('0x56')])[_0x35fc('0x58')](),_0x35fc('0x58'))[_0x35fc('0x59')](_0x35fc('0x47')):moment()[_0x35fc('0x59')](_0x35fc('0x47'));this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x48')]=_0x35fc('0x14');}_['merge'](this['channels'][_0xb26e3f[_0x35fc('0x3d')]],_[_0x35fc('0x4b')](_0xb26e3f,_[_0x35fc('0x5a')](this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]])));if(_[_0x35fc('0x5b')](applications,_0xb26e3f['application'])){this['channels'][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x5c')]=_0xb26e3f[_0x35fc('0x51')];this[_0x35fc('0x19')][_0xb26e3f['uniqueid']][_0x35fc('0x5d')]=_0xb26e3f[_0x35fc('0x52')];if(_0xb26e3f['application']===_0x35fc('0x10')&&_[_0x35fc('0x5e')](_0xb26e3f['applicationdata'],_0x35fc('0x5f'))){var _0x1ab472=_0xb26e3f[_0x35fc('0x52')][_0x35fc('0x4d')]('=');var _0x5e4018=_0x1ab472[0x0]['match'](/cdr\((.*)\)/);if(_0x5e4018){this['channels'][_0xb26e3f[_0x35fc('0x3d')]][_0x5e4018[0x1]]=_0x1ab472[0x1];}}else if(_0xb26e3f[_0x35fc('0x51')]==='queue'){this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0xb26e3f[_0x35fc('0x52')][_0x35fc('0x4d')](',')[0x0];}}}}}catch(_0x538be0){logger[_0x35fc('0x33')](_0x35fc('0x60'),_0xb26e3f[_0x35fc('0x3d')],util['inspect'](_0x538be0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x22')]=function(_0x47fb1a){try{if(this[_0x35fc('0x38')](_0x47fb1a)){logger[_0x35fc('0x30')](_0x35fc('0x61'),_0x47fb1a[_0x35fc('0x3d')],_0x47fb1a[_0x35fc('0x3e')],_0x47fb1a[_0x35fc('0x3a')],_0x47fb1a[_0x35fc('0x3b')]);logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newstate]\x20event:',_0x47fb1a[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x47fb1a,{'showHidden':![],'depth':null}));if(_0x47fb1a[_0x35fc('0x3d')]!==_0x47fb1a['linkedid']){if(this[_0x35fc('0x19')][_0x47fb1a['linkedid']]){if(_0x47fb1a['channelstate']==='6'){if(!this['channels'][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x62')]){var _0x39a1ee=moment();this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['answered']=!![];this['channels'][_0x47fb1a['linkedid']]['answertime']=_0x39a1ee['format'](_0x35fc('0x47'));if(this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x46')]){this['channels'][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x63')]=_0x39a1ee[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x46')],_0x35fc('0x58'));}}this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['linkedid']=_0x47fb1a[_0x35fc('0x3d')];if(_0x47fb1a['calleridnum']!==_0x35fc('0x65')){this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x66')]=_0x47fb1a['calleridnum'];}this[_0x35fc('0x19')][_0x47fb1a['linkedid']]['connectedlinename']=_0x47fb1a['calleridname'];this[_0x35fc('0x19')][_0x47fb1a['linkedid']][_0x35fc('0x67')]=_0x47fb1a['channel'];this[_0x35fc('0x19')][_0x47fb1a['linkedid']][_0x35fc('0x48')]=dispositions[_[_0x35fc('0x49')](_0x47fb1a[_0x35fc('0x4a')])];if(this[_0x35fc('0x1a')][_0x47fb1a['channel'][_0x35fc('0x4d')]('-')[0x0]]){this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['UserId']=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['id'];this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x68')]=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')]['split']('-')[0x0]][_0x35fc('0x69')];}}}}else{if(this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3d')]]){if(_0x47fb1a['channelstate']==='6'){if(this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')]['split']('-')[0x0]]){this['channels'][_0x47fb1a[_0x35fc('0x3d')]]['UserId']=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['id'];this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3d')]][_0x35fc('0x68')]=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x69')];}}}}}}catch(_0x65ee1b){logger[_0x35fc('0x33')](_0x35fc('0x6a'),_0x47fb1a[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x65ee1b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x6b')]=function(_0x2d7b16,_0x3b2160){try{if(this[_0x35fc('0x19')][_0x2d7b16]){logger['info'](_0x35fc('0x6c'),_0x2d7b16,_0x3b2160);this['channels'][_0x2d7b16][_0x35fc('0x6d')]=!![];if(_[_0x35fc('0x6e')](_0x3b2160,_0x35fc('0x6f'))){_0x3b2160=_0x3b2160[_0x35fc('0x70')](_0x35fc('0x6f'),_0x35fc('0x71'));}this[_0x35fc('0x19')][_0x2d7b16][_0x35fc('0x72')]=_0x3b2160;var _0x2fed7b=_[_0x35fc('0x73')](this[_0x35fc('0x19')][_0x2d7b16]['monitors'],{'filename':_0x3b2160});if(_[_0x35fc('0x74')](_0x2fed7b)){this[_0x35fc('0x19')][_0x2d7b16][_0x35fc('0x75')][_0x35fc('0x76')]({'filename':_0x3b2160,'createdAt':moment()[_0x35fc('0x59')](_0x35fc('0x47')),'mixmonitorid':'','status':'rec'});}}}catch(_0x43ef1f){logger[_0x35fc('0x33')](_0x35fc('0x77'),_0x2d7b16,util[_0x35fc('0x34')](_0x43ef1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x23')]=function(_0x2d1cbf){try{if(this[_0x35fc('0x38')](_0x2d1cbf)){logger[_0x35fc('0x3c')]('[%s][voiceCallReport][varset]\x20event:',_0x2d1cbf[_0x35fc('0x3d')],util['inspect'](_0x2d1cbf,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]]&&_0x2d1cbf['channel']!=_0x35fc('0x43')){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')])){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x79')])){logger[_0x35fc('0x30')](_0x35fc('0x7a'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value']);this['syncMixMonitorFilename'](_0x2d1cbf['uniqueid'],_0x2d1cbf['value']);}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x7b')])){logger[_0x35fc('0x30')](_0x35fc('0x7c'),_0x2d1cbf['uniqueid'],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x3b')]=_0x2d1cbf['value'];}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x7e')])){logger['info'](_0x35fc('0x7f'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x80')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x81')])){logger[_0x35fc('0x30')](_0x35fc('0x82'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x83')]=_0x2d1cbf['value'];}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')]['xmd-queue'])){logger[_0x35fc('0x30')](_0x35fc('0x84'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value'][_0x35fc('0x4d')](',')[0x0]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0x2d1cbf[_0x35fc('0x7d')]['split'](',')[0x0];}else if(this['isNotNull'](_0x2d1cbf['variable'][_0x35fc('0x85')])){logger['info'](_0x35fc('0x86'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x87')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x88')])){logger[_0x35fc('0x30')](_0x35fc('0x89'),_0x2d1cbf['uniqueid'],_0x2d1cbf['value']);this['channels'][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x8a')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x8b')])){logger[_0x35fc('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x2d1cbf['uniqueid'],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]]['calleridpreview']=_0x2d1cbf['value'];}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')]['xmcs-queue'])){logger[_0x35fc('0x30')](_0x35fc('0x8c'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value']);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x8d')])){logger[_0x35fc('0x30')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x8e')]=_0x2d1cbf[_0x35fc('0x7d')];}}}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x79')])){if(_0x2d1cbf[_0x35fc('0x7d')]){var _0x45eaae=path[_0x35fc('0x8f')](_0x2d1cbf[_0x35fc('0x7d')])[_0x35fc('0x69')];logger[_0x35fc('0x30')](_0x35fc('0x7a'),_0x45eaae,_0x2d1cbf['value']);this[_0x35fc('0x6b')](_0x45eaae,_0x2d1cbf[_0x35fc('0x7d')]);}}else if(this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3e')]]){if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')])){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x8d')])){logger[_0x35fc('0x30')](_0x35fc('0x90'),_0x2d1cbf[_0x35fc('0x3e')],_0x2d1cbf[_0x35fc('0x7d')]);this['channels'][_0x2d1cbf['linkedid']][_0x35fc('0x91')]=_0x2d1cbf[_0x35fc('0x7d')];}}}}}catch(_0x961ee9){logger['error'](_0x35fc('0x92'),_0x2d1cbf[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x961ee9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncHangup']=function(_0x5874db){try{if(this[_0x35fc('0x38')](_0x5874db)){logger['debug'](_0x35fc('0x93'),_0x5874db[_0x35fc('0x3d')],util['inspect'](_0x5874db,{'showHidden':![],'depth':null}));if(this['channels'][_0x5874db[_0x35fc('0x3d')]]){logger[_0x35fc('0x30')](_0x35fc('0x94'),_0x5874db['uniqueid'],_0x5874db[_0x35fc('0x95')]);var _0x177088=moment();this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x96')]=_0x177088[_0x35fc('0x59')](_0x35fc('0x47'));this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x56')]=_0x177088[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x46')],_0x35fc('0x58'));if(this['channels'][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x62')]){this['channels'][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x97')]=_0x177088['diff'](this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x98')],_0x35fc('0x58'));this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x63')]=this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]]['duration']-this[_0x35fc('0x19')][_0x5874db['uniqueid']]['billableseconds'];}if(_0x5874db[_0x35fc('0x45')]===_0x35fc('0x4c')){if(this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]){this['agents'][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]=_[_0x35fc('0x99')](this['agents'][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]],[_0x35fc('0x9a')]);logger[_0x35fc('0x3c')](_0x35fc('0x9b'),_0x5874db['uniqueid'],util[_0x35fc('0x34')]({'destaccountcode':this[_0x35fc('0x1a')][_0x5874db['channel']['split']('-')[0x0]][_0x35fc('0x4f')]},{'showHidden':![],'depth':null}));this[_0x35fc('0x37')](util[_0x35fc('0x59')](_0x35fc('0x9c'),this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x4f')]});}}var _0x1c3630=this;Promise['resolve']()['then'](function(){var _0x2c213d=_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]];if(typeof _0x2c213d[_0x35fc('0x9d')]==='undefined')return;if(_['isEmpty'](_0x2c213d[_0x35fc('0x75')]))return;return RpcSetting[_0x35fc('0x9e')]()[_0x35fc('0x9f')](function(_0xd46d64){if(!_0xd46d64['stopRecordingOnTransfer'])return;return Promise['resolve']()[_0x35fc('0x9f')](function(){return ami[_0x35fc('0xa0')]({'action':'StopMixMonitor','channel':_0x2c213d[_0x35fc('0x42')]})[_0x35fc('0xa1')](function(){});})[_0x35fc('0x9f')](function(){return ami[_0x35fc('0xa0')]({'action':_0x35fc('0xa2'),'channel':_0x2c213d[_0x35fc('0x67')]})[_0x35fc('0xa1')](function(){})[_0x35fc('0xa3')](function(){var _0x42836b=_0x1c3630[_0x35fc('0x1a')][_0x2c213d[_0x35fc('0x67')][_0x35fc('0x4d')]('-')[0x0]];if(!_0x42836b)return;io[_0x35fc('0x37')](_0x35fc('0xa4'),{'agentId':_0x42836b['id'],'uniqueid':_0x2c213d[_0x35fc('0x3d')]});});});});})[_0x35fc('0x9f')](function(){if(_0x5874db['event']===_0x35fc('0xa5')){_0x1c3630['blindTransfers'][_0x5874db[_0x35fc('0x3d')]]=_0x1c3630['channels'][_0x5874db['uniqueid']];}else{if(_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x83')]==='outbound'&&_0x1c3630[_0x35fc('0x1b')][_0x5874db[_0x35fc('0x3d')]]){_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x3d')]=[_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['linkedid'],_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['linkedid']=_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['uniqueid']][0x0];delete _0x1c3630['blindTransfers'][_0x5874db[_0x35fc('0x3d')]];}}logger['debug'](_0x35fc('0xa6'),_0x5874db[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]],{'showHidden':![],'depth':null}));ami[_0x35fc('0x37')]('custom:voiceCallReport',_0x1c3630['channels'][_0x5874db[_0x35fc('0x3d')]]);delete _0x1c3630['channels'][_0x5874db[_0x35fc('0x3d')]];});}}}catch(_0x39d9ec){logger['error']('[%s][voiceCallReport][hangup]',_0x5874db['uniqueid'],util[_0x35fc('0x34')](_0x39d9ec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x29')]=function(_0x135e18){try{if(this[_0x35fc('0x38')](_0x135e18)){logger[_0x35fc('0x30')](_0x35fc('0xa7'),_0x135e18[_0x35fc('0x3d')],_0x135e18['origtransferercalleridnum'],_0x135e18['transfertargetcalleridnum']);logger['debug']('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x135e18[_0x35fc('0x3d')],util['inspect'](_0x135e18,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x135e18['transfereeuniqueid']]){this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]]['transfercalleridnum']=_0x135e18['origtransferercalleridnum'];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]][_0x35fc('0xa9')]=_0x135e18[_0x35fc('0xaa')];if(this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]){var _0x57bbed=this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']];this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]=this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]]=_0x57bbed;}}else if(this['channels'][_0x135e18[_0x35fc('0xab')]]){this['channels'][_0x135e18[_0x35fc('0xab')]]['transfercalleridnum']=_0x135e18['origtransferercalleridnum'];this[_0x35fc('0x19')][_0x135e18['transfertargetuniqueid']][_0x35fc('0xa9')]=_0x135e18[_0x35fc('0xaa')];if(this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]){var _0x57bbed=this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]=this['channels'][_0x135e18[_0x35fc('0xab')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xab')]]=_0x57bbed;}}if((this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]||this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]])&&this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]){var _0x59c81a=_['some']([this['channels'][_0x135e18['origtransfereruniqueid']],this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]],this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xae')]]],function(_0x243e0d){return _0x243e0d&&_0x243e0d['type']===_0x35fc('0xaf')&&_0x243e0d[_0x35fc('0xb0')];});if(_0x59c81a){if(this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]])this[_0x35fc('0x19')][_0x135e18['origtransfereruniqueid']][_0x35fc('0x9d')]=_0x35fc('0xb1');if(this[_0x35fc('0x19')][_0x135e18['origtransfererlinkedid']])this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]][_0x35fc('0x9d')]=_0x35fc('0xb1');this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xae')]][_0x35fc('0x9d')]=_0x35fc('0xb1');}}}}catch(_0x1eaab6){logger[_0x35fc('0x33')](_0x35fc('0xb2'),_0x135e18[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x1eaab6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x2b')]=function(_0x47a52d){try{if(this['isNotNull'](_0x47a52d)){logger[_0x35fc('0x30')](_0x35fc('0xb3'),_0x47a52d[_0x35fc('0x3d')],_0x47a52d[_0x35fc('0xb4')],_0x47a52d[_0x35fc('0xb5')]);logger[_0x35fc('0x3c')](_0x35fc('0xb6'),_0x47a52d[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x47a52d,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]]){this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0xb7')]=_0x47a52d[_0x35fc('0xb4')];this['channels'][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0xa9')]=_0x47a52d[_0x35fc('0xb5')];this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0x9d')]=_0x35fc('0xb8');this[_0x35fc('0x25')]({'event':'BlindTransfer','uniqueid':_0x47a52d['transfereeuniqueid'],'context':_0x47a52d[_0x35fc('0x45')],'channel':_0x47a52d[_0x35fc('0xb9')]});}else{this['channels'][_0x47a52d[_0x35fc('0xba')]][_0x35fc('0x9d')]=_0x35fc('0xb8');}}}catch(_0x287555){logger['error'](_0x35fc('0xbb'),_0x47a52d[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x287555,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncMusicOnHoldStart']=function(_0x49ed6b){try{if(this[_0x35fc('0x38')](_0x49ed6b)){logger['debug'](_0x35fc('0xbc'),_0x49ed6b[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x49ed6b,{'showHidden':![],'depth':null}));if(this['channels'][_0x49ed6b[_0x35fc('0x3d')]]){if(!_['isNil'](this[_0x35fc('0x19')][_0x49ed6b[_0x35fc('0x3d')]]['answertime'])){this[_0x35fc('0x19')][_0x49ed6b[_0x35fc('0x3d')]][_0x35fc('0xbd')]=moment()[_0x35fc('0x59')](_0x35fc('0x47'));logger[_0x35fc('0x30')](_0x35fc('0xbe'),_0x49ed6b['uniqueid'],this['channels'][_0x49ed6b[_0x35fc('0x3d')]][_0x35fc('0xbd')]);}}}}catch(_0x2463dd){logger[_0x35fc('0x33')](_0x35fc('0xbf'),_0x49ed6b[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x2463dd,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x35fc('0x2f')]=function(_0x4110e7){try{if(this[_0x35fc('0x38')](_0x4110e7)){logger['debug'](_0x35fc('0xc0'),_0x4110e7[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x4110e7,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]]){if(!_[_0x35fc('0x74')](this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')])){this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xc1')]+=moment()[_0x35fc('0xc2')](0x0)[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')],_0x35fc('0x58'));logger[_0x35fc('0x30')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x4110e7[_0x35fc('0x3d')],this['channels'][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xc1')]);delete this['channels'][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')];}}}}catch(_0x462c30){logger[_0x35fc('0x33')](_0x35fc('0xc3'),_0x4110e7[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x462c30,{'showHidden':![],'depth':null}));}};module[_0x35fc('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 7676883..442bd13 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 _0x2040=['localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','dialend','syncDialEnd','bind','varset','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','substring','lastIndexOf','omit','privilege','info','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','dialstatus','ANSWER','connectedlinenum','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','YYYY-MM-DD\x20HH:mm:ss','duration','diff','starttime','seconds','total','answered','holdtime','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','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','lodash','moment','util','ioredis','ami','../ami','redis'];(function(_0x15fb5c,_0x2126b2){var _0x2e866a=function(_0x4c7aff){while(--_0x4c7aff){_0x15fb5c['push'](_0x15fb5c['shift']());}};_0x2e866a(++_0x2126b2);}(_0x2040,0xd3));var _0x0204=function(_0x17237a,_0x2164e8){_0x17237a=_0x17237a-0x0;var _0x5d1e40=_0x2040[_0x17237a];return _0x5d1e40;};'use strict';var _=require(_0x0204('0x0'));var moment=require(_0x0204('0x1'));var util=require(_0x0204('0x2'));var Redis=require(_0x0204('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0204('0x4'));var ami=require(_0x0204('0x5'));config[_0x0204('0x6')]=_['defaults'](config[_0x0204('0x6')],{'host':_0x0204('0x7'),'port':0x18eb});var io=require(_0x0204('0x8'))(new Redis(config[_0x0204('0x6')]));function VoiceDialReport(_0x1309cb){this[_0x0204('0x9')]=_0x1309cb[_0x0204('0xa')];this[_0x0204('0xb')]=_0x1309cb[_0x0204('0xb')];this[_0x0204('0xc')]={};ami['on']('dialbegin',this[_0x0204('0xd')]['bind'](this));ami['on'](_0x0204('0xe'),this[_0x0204('0xf')][_0x0204('0x10')](this));ami['on'](_0x0204('0x11'),this[_0x0204('0x12')][_0x0204('0x10')](this));ami['on'](_0x0204('0x13'),this[_0x0204('0x14')][_0x0204('0x10')](this));}VoiceDialReport['prototype'][_0x0204('0x15')]=function(_0x20d6a6){return _0x20d6a6!==null&&!_[_0x0204('0x16')](_0x20d6a6);};VoiceDialReport[_0x0204('0x17')]['emit']=function(_0x195ce5,_0xfe2d25,_0x3c281a){io['to'](_0x195ce5)[_0x0204('0x18')](_0xfe2d25,_0x3c281a);};VoiceDialReport[_0x0204('0x17')][_0x0204('0xd')]=function(_0x2cf53a){try{if(this[_0x0204('0x15')](_0x2cf53a)){logger[_0x0204('0x19')](_0x0204('0x1a'),_0x2cf53a[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x2cf53a,{'showHidden':![],'depth':null}));if(this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]]){_[_0x0204('0x1d')](this['channels'][_0x2cf53a['uniqueid']],{'starttime':moment()[_0x0204('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x0204('0x1f'),'interface':_0x2cf53a[_0x0204('0x20')][_0x0204('0x21')](0x0,_0x2cf53a['channel'][_0x0204('0x22')]('-')),'membername':_0x2cf53a[_0x0204('0x20')][_0x0204('0x21')](_0x2cf53a['channel'][_0x0204('0x22')]('/')+0x1,_0x2cf53a[_0x0204('0x20')][_0x0204('0x22')]('-'))},_[_0x0204('0x23')](_0x2cf53a,['event',_0x0204('0x24')]));logger[_0x0204('0x25')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x2cf53a[_0x0204('0x1b')],this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]]['membername'],this[_0x0204('0x9')][_0x2cf53a['uniqueid']][_0x0204('0x26')]);logger[_0x0204('0x19')](_0x0204('0x27'),_0x2cf53a[_0x0204('0x1b')],util['inspect'](this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this[_0x0204('0x18')](_0x0204('0x28'),'voice_outbound_channel:save',this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]]);logger[_0x0204('0x19')](_0x0204('0x29'),_0x2cf53a[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x2cf53a['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x2a'),this['channels'][_0x2cf53a[_0x0204('0x1b')]]);}}}catch(_0x48b021){logger['error']('[%s][voiceDialReport][dialbegin]',_0x2cf53a[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x48b021,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x0204('0x17')][_0x0204('0xf')]=function(_0x4a026e){try{if(this[_0x0204('0x15')](_0x4a026e)){logger[_0x0204('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x4a026e,{'showHidden':![],'depth':null}));if(this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]]){this['channels'][_0x4a026e['uniqueid']][_0x0204('0x2b')]=_0x4a026e[_0x0204('0x2b')];if(_0x4a026e[_0x0204('0x2b')]===_0x0204('0x2c')){this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]][_0x0204('0x2d')]=_0x4a026e[_0x0204('0x2d')];this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]]['connectedlinename']=_0x4a026e['connectedlinename'];this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]][_0x0204('0x2e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]][_0x0204('0x2f')]=_0x0204('0x30');logger[_0x0204('0x25')](_0x0204('0x31'),_0x4a026e['uniqueid'],_0x4a026e['channel']['substring'](_0x4a026e['channel'][_0x0204('0x22')]('/')+0x1,_0x4a026e[_0x0204('0x20')][_0x0204('0x22')]('-')));logger[_0x0204('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x32'),this['channels'][_0x4a026e['uniqueid']]);}logger['debug'](_0x0204('0x33'),_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](this['channels'][_0x4a026e['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x0204('0x34'),this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]]);}}}catch(_0x14d731){logger[_0x0204('0x35')](_0x0204('0x36'),_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x14d731,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x0204('0x17')][_0x0204('0x12')]=function(_0x5d074e){try{if(this[_0x0204('0x15')](_0x5d074e)){logger[_0x0204('0x19')](_0x0204('0x37'),_0x5d074e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x5d074e,{'showHidden':![],'depth':null}));this[_0x0204('0x38')](_0x5d074e[_0x0204('0x1b')],_[_0x0204('0x39')](_0x5d074e[_0x0204('0x3a')])[0x0],_0x5d074e[_0x0204('0x3b')]);if(this[_0x0204('0x15')](_0x5d074e[_0x0204('0x3a')])&&this['isNotNull'](_0x5d074e['variable']['outboundrouteid'])){if(_[_0x0204('0x16')](this['channels'][_0x5d074e['uniqueid']])){this['channels'][_0x5d074e['uniqueid']]={'routeId':_0x5d074e[_0x0204('0x3b')],'variables':this['variables'][_0x5d074e[_0x0204('0x1b')]]};logger[_0x0204('0x25')](_0x0204('0x3c'),_0x5d074e[_0x0204('0x1b')],_0x5d074e[_0x0204('0x3a')][_0x0204('0x3d')],_['keys'](_0x5d074e[_0x0204('0x3a')])[0x0],_0x5d074e[_0x0204('0x3b')]);logger['debug'](_0x0204('0x3e'),_0x5d074e[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x5d074e[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this[_0x0204('0x18')](_0x0204('0x28'),_0x0204('0x34'),this[_0x0204('0x9')][_0x5d074e[_0x0204('0x1b')]]);}}}}catch(_0x4f5873){logger[_0x0204('0x35')](_0x0204('0x3f'),_0x5d074e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x4f5873,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x0204('0x17')][_0x0204('0x38')]=function(_0xaf5161,_0x54c195,_0x28fefa){var _0x5a283c=[_0x0204('0x40'),_0x0204('0x41'),_0x0204('0x42'),_0x0204('0x43'),_0x0204('0x44'),_0x0204('0x45'),_0x0204('0x46'),_0x0204('0x47'),'sipcallid',_0x0204('0x48'),_0x0204('0x49'),_0x0204('0x4a'),'membercalls',_0x0204('0x4b'),_0x0204('0x4c'),_0x0204('0x4d'),'membername',_0x0204('0x4e'),_0x0204('0x4f')];if(!_[_0x0204('0x50')](_0x54c195)&&!_[_0x0204('0x51')](_0x5a283c,_0x54c195)){if(_[_0x0204('0x16')](this[_0x0204('0xc')][_0xaf5161])){this[_0x0204('0xc')][_0xaf5161]={};}this[_0x0204('0xc')][_0xaf5161][_0x54c195]=_0x28fefa;}};VoiceDialReport['prototype']['syncHangup']=function(_0x1c370c){try{if(this[_0x0204('0x15')](_0x1c370c)){logger[_0x0204('0x19')](_0x0204('0x52'),_0x1c370c['uniqueid'],util['inspect'](_0x1c370c,{'showHidden':![],'depth':null}));if(this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]){logger[_0x0204('0x25')](_0x0204('0x53'),_0x1c370c['uniqueid'],_0x1c370c[_0x0204('0x54')]);this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x55')]=moment()[_0x0204('0x1e')](_0x0204('0x56'));this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x57')]=moment(this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x55')])[_0x0204('0x58')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x59')],_0x0204('0x5a'));this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x2f')]='complete';this[_0x0204('0xb')][_0x0204('0x5b')]+=0x1;if(this[_0x0204('0x9')][_0x1c370c['uniqueid']][_0x0204('0x2e')]){this[_0x0204('0xb')][_0x0204('0x5c')]+=0x1;this['channels'][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x5d')]=moment(this[_0x0204('0x9')][_0x1c370c['uniqueid']]['answertime'])['diff'](this['channels'][_0x1c370c[_0x0204('0x1b')]]['starttime'],_0x0204('0x5a'));this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]['billableseconds']=moment(this[_0x0204('0x9')][_0x1c370c['uniqueid']][_0x0204('0x55')])[_0x0204('0x58')](this['channels'][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x2e')],_0x0204('0x5a'));this[_0x0204('0xb')][_0x0204('0x5e')]+=this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]['holdtime']||0x0;this[_0x0204('0xb')][_0x0204('0x5f')]+=this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]['billableseconds'];}this[_0x0204('0xb')][_0x0204('0x60')]+=this[_0x0204('0x9')][_0x1c370c['uniqueid']][_0x0204('0x57')];logger[_0x0204('0x19')](_0x0204('0x61'),_0x1c370c[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x62'),this['channels'][_0x1c370c['uniqueid']]);logger[_0x0204('0x19')](_0x0204('0x63'),_0x1c370c['uniqueid'],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x64'),this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]);logger[_0x0204('0x19')](_0x0204('0x65'),_0x1c370c[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x0204('0x28'),_0x0204('0x66'),this[_0x0204('0xb')]);logger[_0x0204('0x25')](_0x0204('0x67'),JSON[_0x0204('0x68')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]));logger[_0x0204('0x19')](_0x0204('0x69'),_0x1c370c[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this[_0x0204('0x18')](_0x0204('0x28'),_0x0204('0x6a'),this['channels'][_0x1c370c[_0x0204('0x1b')]]);delete this['channels'][_0x1c370c[_0x0204('0x1b')]];}else if(this[_0x0204('0x9')][_0x1c370c[_0x0204('0x6b')]]){this[_0x0204('0x9')][_0x1c370c[_0x0204('0x6b')]][_0x0204('0x1b')]=this[_0x0204('0x9')][_0x1c370c['linkedid']][_0x0204('0x6c')];}if(this[_0x0204('0xc')][_0x1c370c[_0x0204('0x1b')]]){delete this[_0x0204('0xc')][_0x1c370c[_0x0204('0x1b')]];}}}catch(_0x47ad8c){logger[_0x0204('0x35')]('[%s][voiceDialReport][hangup]',_0x1c370c['uniqueid'],util[_0x0204('0x1c')](_0x47ad8c,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0xb30c=['custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','exports','lodash','moment','util','ioredis','../../../config/logger','redis','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncVarSet','syncHangup','prototype','isNotNull','isUndefined','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','channels','format','called','substring','channel','lastIndexOf','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][varset]','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','YYYY-MM-DD\x20HH:mm:ss','duration','diff','seconds','complete','total','holdtime','starttime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport'];(function(_0x59a3e9,_0x27fb38){var _0x5179ac=function(_0x5a9b1c){while(--_0x5a9b1c){_0x59a3e9['push'](_0x59a3e9['shift']());}};_0x5179ac(++_0x27fb38);}(_0xb30c,0xcf));var _0xcb30=function(_0x35b49f,_0x52af44){_0x35b49f=_0x35b49f-0x0;var _0xa8efc7=_0xb30c[_0x35b49f];return _0xa8efc7;};'use strict';var _=require(_0xcb30('0x0'));var moment=require(_0xcb30('0x1'));var util=require(_0xcb30('0x2'));var Redis=require(_0xcb30('0x3'));var config=require('../../../config/environment');var logger=require(_0xcb30('0x4'))('ami');var ami=require('../ami');config[_0xcb30('0x5')]=_['defaults'](config[_0xcb30('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xcb30('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0x530940){this['channels']=_0x530940[_0xcb30('0x7')];this['outbound']=_0x530940[_0xcb30('0x8')];this[_0xcb30('0x9')]={};ami['on'](_0xcb30('0xa'),this[_0xcb30('0xb')][_0xcb30('0xc')](this));ami['on'](_0xcb30('0xd'),this['syncDialEnd'][_0xcb30('0xc')](this));ami['on']('varset',this[_0xcb30('0xe')][_0xcb30('0xc')](this));ami['on']('hangup',this[_0xcb30('0xf')][_0xcb30('0xc')](this));}VoiceDialReport[_0xcb30('0x10')][_0xcb30('0x11')]=function(_0x45a202){return _0x45a202!==null&&!_[_0xcb30('0x12')](_0x45a202);};VoiceDialReport[_0xcb30('0x10')][_0xcb30('0x13')]=function(_0x2654c3,_0x4b5d68,_0x42958d){io['to'](_0x2654c3)['emit'](_0x4b5d68,_0x42958d);};VoiceDialReport[_0xcb30('0x10')][_0xcb30('0xb')]=function(_0x5d2ccd){try{if(this[_0xcb30('0x11')](_0x5d2ccd)){logger['debug'](_0xcb30('0x14'),_0x5d2ccd[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x5d2ccd,{'showHidden':![],'depth':null}));if(this[_0xcb30('0x17')][_0x5d2ccd[_0xcb30('0x15')]]){_['merge'](this['channels'][_0x5d2ccd['uniqueid']],{'starttime':moment()[_0xcb30('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xcb30('0x19'),'interface':_0x5d2ccd['channel'][_0xcb30('0x1a')](0x0,_0x5d2ccd['channel']['lastIndexOf']('-')),'membername':_0x5d2ccd[_0xcb30('0x1b')][_0xcb30('0x1a')](_0x5d2ccd[_0xcb30('0x1b')][_0xcb30('0x1c')]('/')+0x1,_0x5d2ccd['channel'][_0xcb30('0x1c')]('-'))},_[_0xcb30('0x1d')](_0x5d2ccd,[_0xcb30('0x1e'),'privilege']));logger[_0xcb30('0x1f')](_0xcb30('0x20'),_0x5d2ccd['uniqueid'],this[_0xcb30('0x17')][_0x5d2ccd[_0xcb30('0x15')]]['membername'],this[_0xcb30('0x17')][_0x5d2ccd[_0xcb30('0x15')]]['interface']);logger['debug'](_0xcb30('0x21'),_0x5d2ccd[_0xcb30('0x15')],util['inspect'](this[_0xcb30('0x17')][_0x5d2ccd[_0xcb30('0x15')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound_channel:save',this['channels'][_0x5d2ccd[_0xcb30('0x15')]]);logger[_0xcb30('0x22')](_0xcb30('0x23'),_0x5d2ccd[_0xcb30('0x15')],util[_0xcb30('0x16')](this[_0xcb30('0x17')][_0x5d2ccd[_0xcb30('0x15')]],{'showHidden':![],'depth':null}));ami[_0xcb30('0x13')](_0xcb30('0x24'),this[_0xcb30('0x17')][_0x5d2ccd[_0xcb30('0x15')]]);}}}catch(_0x1e57a6){logger[_0xcb30('0x25')](_0xcb30('0x26'),_0x5d2ccd[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x1e57a6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xcb30('0x10')]['syncDialEnd']=function(_0x3ad59f){try{if(this[_0xcb30('0x11')](_0x3ad59f)){logger[_0xcb30('0x22')]('[%s][voiceDialReport][dialend]\x20event:',_0x3ad59f[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x3ad59f,{'showHidden':![],'depth':null}));if(this[_0xcb30('0x17')][_0x3ad59f[_0xcb30('0x15')]]){this['channels'][_0x3ad59f[_0xcb30('0x15')]]['dialstatus']=_0x3ad59f[_0xcb30('0x27')];if(_0x3ad59f[_0xcb30('0x27')]===_0xcb30('0x28')){this[_0xcb30('0x17')][_0x3ad59f['uniqueid']][_0xcb30('0x29')]=_0x3ad59f[_0xcb30('0x29')];this[_0xcb30('0x17')][_0x3ad59f[_0xcb30('0x15')]][_0xcb30('0x2a')]=_0x3ad59f[_0xcb30('0x2a')];this[_0xcb30('0x17')][_0x3ad59f[_0xcb30('0x15')]][_0xcb30('0x2b')]=moment()[_0xcb30('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcb30('0x17')][_0x3ad59f['uniqueid']][_0xcb30('0x2c')]='connect';logger['info'](_0xcb30('0x2d'),_0x3ad59f['uniqueid'],_0x3ad59f[_0xcb30('0x1b')]['substring'](_0x3ad59f[_0xcb30('0x1b')][_0xcb30('0x1c')]('/')+0x1,_0x3ad59f[_0xcb30('0x1b')][_0xcb30('0x1c')]('-')));logger[_0xcb30('0x22')](_0xcb30('0x2e'),_0x3ad59f[_0xcb30('0x15')],util['inspect'](this[_0xcb30('0x17')][_0x3ad59f[_0xcb30('0x15')]],{'showHidden':![],'depth':null}));ami[_0xcb30('0x13')](_0xcb30('0x2f'),this[_0xcb30('0x17')][_0x3ad59f[_0xcb30('0x15')]]);}logger[_0xcb30('0x22')](_0xcb30('0x30'),_0x3ad59f['uniqueid'],util['inspect'](this[_0xcb30('0x17')][_0x3ad59f[_0xcb30('0x15')]],{'showHidden':![],'depth':null}));this[_0xcb30('0x13')]('voice:outbound','voice_outbound_channel:save',this[_0xcb30('0x17')][_0x3ad59f[_0xcb30('0x15')]]);}}}catch(_0x3c35a7){logger[_0xcb30('0x25')](_0xcb30('0x31'),_0x3ad59f[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x3c35a7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xcb30('0x10')][_0xcb30('0xe')]=function(_0x5ec8f8){try{if(this[_0xcb30('0x11')](_0x5ec8f8)){logger['debug'](_0xcb30('0x32'),_0x5ec8f8[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x5ec8f8,{'showHidden':![],'depth':null}));this[_0xcb30('0x33')](_0x5ec8f8[_0xcb30('0x15')],_[_0xcb30('0x34')](_0x5ec8f8[_0xcb30('0x35')])[0x0],_0x5ec8f8[_0xcb30('0x36')]);if(this[_0xcb30('0x11')](_0x5ec8f8[_0xcb30('0x35')])&&this[_0xcb30('0x11')](_0x5ec8f8[_0xcb30('0x35')]['outboundrouteid'])){if(_[_0xcb30('0x12')](this['channels'][_0x5ec8f8[_0xcb30('0x15')]])){this[_0xcb30('0x17')][_0x5ec8f8[_0xcb30('0x15')]]={'routeId':_0x5ec8f8[_0xcb30('0x36')],'variables':this[_0xcb30('0x9')][_0x5ec8f8[_0xcb30('0x15')]]};logger[_0xcb30('0x1f')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x5ec8f8['uniqueid'],_0x5ec8f8[_0xcb30('0x35')][_0xcb30('0x37')],_[_0xcb30('0x34')](_0x5ec8f8[_0xcb30('0x35')])[0x0],_0x5ec8f8['value']);logger[_0xcb30('0x22')](_0xcb30('0x38'),_0x5ec8f8[_0xcb30('0x15')],util[_0xcb30('0x16')](this[_0xcb30('0x17')][_0x5ec8f8['uniqueid']],{'showHidden':![],'depth':null}));this[_0xcb30('0x13')](_0xcb30('0x39'),_0xcb30('0x3a'),this[_0xcb30('0x17')][_0x5ec8f8[_0xcb30('0x15')]]);}}}}catch(_0x5c5f41){logger[_0xcb30('0x25')](_0xcb30('0x3b'),_0x5ec8f8[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x5c5f41,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x481a98,_0x3c21db,_0x2f3d78){var _0x43bd42=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xcb30('0x3c'),_0xcb30('0x3d'),_0xcb30('0x3e'),_0xcb30('0x3f'),_0xcb30('0x40'),'sipuri','bridgepeer',_0xcb30('0x41'),_0xcb30('0x42'),_0xcb30('0x43'),_0xcb30('0x44'),_0xcb30('0x45'),'membername',_0xcb30('0x46'),'memberrealtime'];if(!_['isNil'](_0x3c21db)&&!_[_0xcb30('0x47')](_0x43bd42,_0x3c21db)){if(_['isUndefined'](this[_0xcb30('0x9')][_0x481a98])){this[_0xcb30('0x9')][_0x481a98]={};}this[_0xcb30('0x9')][_0x481a98][_0x3c21db]=_0x2f3d78;}};VoiceDialReport[_0xcb30('0x10')][_0xcb30('0xf')]=function(_0x384ae0){try{if(this[_0xcb30('0x11')](_0x384ae0)){logger[_0xcb30('0x22')](_0xcb30('0x48'),_0x384ae0[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x384ae0,{'showHidden':![],'depth':null}));if(this['channels'][_0x384ae0['uniqueid']]){logger[_0xcb30('0x1f')](_0xcb30('0x49'),_0x384ae0[_0xcb30('0x15')],_0x384ae0[_0xcb30('0x4a')]);this[_0xcb30('0x17')][_0x384ae0['uniqueid']][_0xcb30('0x4b')]=moment()[_0xcb30('0x18')](_0xcb30('0x4c'));this['channels'][_0x384ae0[_0xcb30('0x15')]][_0xcb30('0x4d')]=moment(this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]]['endtime'])[_0xcb30('0x4e')](this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]]['starttime'],_0xcb30('0x4f'));this['channels'][_0x384ae0[_0xcb30('0x15')]]['lastevent']=_0xcb30('0x50');this[_0xcb30('0x8')][_0xcb30('0x51')]+=0x1;if(this[_0xcb30('0x17')][_0x384ae0['uniqueid']]['answertime']){this['outbound']['answered']+=0x1;this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]][_0xcb30('0x52')]=moment(this[_0xcb30('0x17')][_0x384ae0['uniqueid']][_0xcb30('0x2b')])['diff'](this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]][_0xcb30('0x53')],_0xcb30('0x4f'));this['channels'][_0x384ae0[_0xcb30('0x15')]][_0xcb30('0x54')]=moment(this['channels'][_0x384ae0[_0xcb30('0x15')]]['endtime'])[_0xcb30('0x4e')](this[_0xcb30('0x17')][_0x384ae0['uniqueid']][_0xcb30('0x2b')],'seconds');this[_0xcb30('0x8')][_0xcb30('0x55')]+=this['channels'][_0x384ae0[_0xcb30('0x15')]]['holdtime']||0x0;this[_0xcb30('0x8')][_0xcb30('0x56')]+=this[_0xcb30('0x17')][_0x384ae0['uniqueid']]['billableseconds'];}this[_0xcb30('0x8')][_0xcb30('0x57')]+=this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]]['duration'];logger['debug'](_0xcb30('0x58'),_0x384ae0[_0xcb30('0x15')],util['inspect'](this[_0xcb30('0x17')][_0x384ae0['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xcb30('0x13')](_0xcb30('0x59'),this[_0xcb30('0x17')][_0x384ae0['uniqueid']]);logger[_0xcb30('0x22')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x384ae0[_0xcb30('0x15')],util[_0xcb30('0x16')](this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]],{'showHidden':![],'depth':null}));ami['emit'](_0xcb30('0x5a'),this['channels'][_0x384ae0[_0xcb30('0x15')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x384ae0['uniqueid'],util[_0xcb30('0x16')](this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]],{'showHidden':![],'depth':null}));this[_0xcb30('0x13')](_0xcb30('0x39'),_0xcb30('0x5b'),this[_0xcb30('0x8')]);logger[_0xcb30('0x1f')](_0xcb30('0x5c'),JSON[_0xcb30('0x5d')](this[_0xcb30('0x17')][_0x384ae0['uniqueid']]));logger[_0xcb30('0x22')](_0xcb30('0x5e'),_0x384ae0[_0xcb30('0x15')],util[_0xcb30('0x16')](this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]],{'showHidden':![],'depth':null}));this['emit'](_0xcb30('0x39'),'voice_outbound_channel:remove',this[_0xcb30('0x17')][_0x384ae0['uniqueid']]);delete this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x15')]];}else if(this['channels'][_0x384ae0[_0xcb30('0x5f')]]){this[_0xcb30('0x17')][_0x384ae0[_0xcb30('0x5f')]][_0xcb30('0x15')]=this[_0xcb30('0x17')][_0x384ae0['linkedid']][_0xcb30('0x60')];}if(this[_0xcb30('0x9')][_0x384ae0[_0xcb30('0x15')]]){delete this[_0xcb30('0x9')][_0x384ae0[_0xcb30('0x15')]];}}}catch(_0x28a63e){logger[_0xcb30('0x25')](_0xcb30('0x61'),_0x384ae0[_0xcb30('0x15')],util[_0xcb30('0x16')](_0x28a63e,{'showHidden':![],'depth':null}));}};module[_0xcb30('0x62')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 50ad996..f60cfb3 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 _0x09c9=['sequence','isNil','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','debug','[%s][voiceQueueReport][','voice_queue_channel:remove','voice_queue_presence:remove','type','strategy','answered','sumDuration','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','flagQueueSummary','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','toNumber','callers','loggedIn','loggedin','available','emitVoiceQueueSummary','custom:queuesummary','isUndefined','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','queuecallerabandonAt','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','emitVoiceQueueChannelRemove','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','membername','transfer','reason','COMPLETED','startsWith','toLowerCase','linkedid','queuecallerexitAt','add','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','queuecallerexit','TIMEOUT','queuecallerleaveAt','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','diff','seconds','sumBillable','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','queueReports','agents','channels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch'];(function(_0x2a7210,_0x2f3d23){var _0x460766=function(_0xd575dd){while(--_0xd575dd){_0x2a7210['push'](_0x2a7210['shift']());}};_0x460766(++_0x2f3d23);}(_0x09c9,0xa3));var _0x909c=function(_0x30ca19,_0x2a12db){_0x30ca19=_0x30ca19-0x0;var _0x17da76=_0x09c9[_0x30ca19];return _0x17da76;};'use strict';var _=require(_0x909c('0x0'));var moment=require(_0x909c('0x1'));var util=require(_0x909c('0x2'));var md5=require(_0x909c('0x3'));var Redis=require(_0x909c('0x4'));var config=require(_0x909c('0x5'));var logger=require(_0x909c('0x6'))(_0x909c('0x7'));var ami=require('../ami');var QueueReport=require(_0x909c('0x8'));config[_0x909c('0x9')]=_[_0x909c('0xa')](config[_0x909c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x909c('0xb'))(new Redis(config[_0x909c('0x9')]));var Sequence=function(){};Sequence[_0x909c('0xc')][_0x909c('0xd')]=function(_0x120306){this['tail']=this['tail']?this['tail']['finally'](_0x120306):_0x120306();};function VoiceQueueReport(_0x598a48){this['sequence']=new Sequence();this[_0x909c('0xe')]={};this[_0x909c('0xf')]=_0x598a48[_0x909c('0xf')];this[_0x909c('0x10')]=_0x598a48['queueChannels'];this[_0x909c('0x11')]=_0x598a48['voiceQueues'];this['flagQueueSummary']=!![];this[_0x909c('0x12')]=_0x598a48[_0x909c('0x12')];this[_0x909c('0x13')]={};ami['on'](_0x909c('0x14'),this[_0x909c('0x15')]['bind'](this));ami['on'](_0x909c('0x16'),this[_0x909c('0x17')][_0x909c('0x18')](this));ami['on'](_0x909c('0x19'),this[_0x909c('0x1a')][_0x909c('0x18')](this));ami['on'](_0x909c('0x1b'),this[_0x909c('0x1c')][_0x909c('0x18')](this));ami['on'](_0x909c('0x1d'),this[_0x909c('0x1e')][_0x909c('0x18')](this));ami['on'](_0x909c('0x1f'),this[_0x909c('0x20')]['bind'](this));ami['on'](_0x909c('0x21'),this[_0x909c('0x22')][_0x909c('0x18')](this));ami['on'](_0x909c('0x23'),this['syncVarSet'][_0x909c('0x18')](this));ami['on'](_0x909c('0x24'),this[_0x909c('0x25')][_0x909c('0x18')](this));ami['on'](_0x909c('0x26'),this[_0x909c('0x27')][_0x909c('0x18')](this));ami['on'](_0x909c('0x28'),this[_0x909c('0x29')][_0x909c('0x18')](this));ami['on'](_0x909c('0x2a'),this['syncMusicOnHoldStop'][_0x909c('0x18')](this));ami['on'](_0x909c('0x2b'),this[_0x909c('0x2c')][_0x909c('0x18')](this));ami['on']('blindtransfer',this[_0x909c('0x2d')][_0x909c('0x18')](this));this[_0x909c('0x2e')]();this[_0x909c('0x2f')]();}function clearChannels(_0x188a61){if(!_['isEmpty'](_0x188a61)){for(var _0x242503 in _0x188a61){if(_0x188a61[_0x909c('0x30')](_0x242503)){delete _0x188a61[_0x242503];}}}}function clearCampaigns(_0x30382a){if(!_[_0x909c('0x31')](_0x30382a)){for(var _0x5b026a in _0x30382a){if(_0x30382a[_0x909c('0x30')](_0x5b026a)){_0x30382a[_0x5b026a][_0x909c('0x32')]=0x0;}}}}function clearVoiceQueues(_0x4b66cc){if(!_['isEmpty'](_0x4b66cc)){for(var _0x5a7331 in _0x4b66cc){if(_0x4b66cc[_0x909c('0x30')](_0x5a7331)){_0x4b66cc[_0x5a7331][_0x909c('0x32')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x33')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x34')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x35')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x36')]=!![];}}}}function clearAgentBooked(_0x2e710b){if(!_[_0x909c('0x31')](_0x2e710b)){for(var _0x2462d0 in _0x2e710b){if(_0x2e710b[_0x909c('0x30')](_0x2462d0)){_0x2e710b[_0x2462d0][_0x909c('0x37')]=!![];}}}}VoiceQueueReport[_0x909c('0xc')][_0x909c('0x38')]=function(){var _0x1f3525=this;for(var _0x5c99bc in this['channels']){if(this[_0x909c('0x10')]['hasOwnProperty'](_0x5c99bc)&&!this[_0x909c('0x10')][_0x5c99bc][_0x909c('0x39')]){this[_0x909c('0x3a')][_0x909c('0xd')](function(){if(!_[_0x909c('0x3b')](_0x1f3525[_0x909c('0x10')][_0x5c99bc])){return ami['Action']({'action':'status','channel':_0x1f3525[_0x909c('0x10')][_0x5c99bc][_0x909c('0x3c')]})[_0x909c('0x3d')](function(_0x573924){if(_0x573924['message']===_0x909c('0x3e')){setTimeout(function(){if(_0x1f3525['channels'][_0x5c99bc]){delete _0x1f3525[_0x909c('0x10')][_0x5c99bc];logger[_0x909c('0x3f')](_0x909c('0x40'),_0x5c99bc,util[_0x909c('0x41')](_0x573924,{'showHidden':![],'depth':null}));}if(_0x1f3525['queueReports'][_0x5c99bc]){delete _0x1f3525[_0x909c('0xe')][_0x5c99bc];logger['error'](_0x909c('0x42'),_0x5c99bc,util['inspect'](_0x573924,{'showHidden':![],'depth':null}));}if(_0x1f3525[_0x909c('0x13')][_0x5c99bc]){delete _0x1f3525[_0x909c('0x13')][_0x5c99bc];logger[_0x909c('0x3f')](_0x909c('0x43'),_0x5c99bc,util[_0x909c('0x41')](_0x573924,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x909c('0xc')]['syncFullyBooted']=function(){logger[_0x909c('0x3f')](_0x909c('0x44'));clearChannels(this[_0x909c('0x10')]);this[_0x909c('0x45')](this[_0x909c('0xe')]);clearAgentBooked(this[_0x909c('0xf')]);clearVoiceQueues(this[_0x909c('0x11')]);clearCampaigns(this[_0x909c('0x12')]);};VoiceQueueReport[_0x909c('0xc')]['clearQueueReport']=function(_0x6b6759){var _0x3e05fb=this;if(!_[_0x909c('0x31')](_0x6b6759)){for(var _0x208b26 in _0x6b6759){if(_0x6b6759[_0x909c('0x30')](_0x208b26)){_0x3e05fb['emitVoiceQueueChannelRemove'](_0x6b6759[_0x208b26],_0x909c('0x46'));delete _0x6b6759[_0x208b26];}}}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x47')]=function(_0x1f118d,_0x12bb1a,_0x46f571){io['to'](_0x1f118d)[_0x909c('0x47')](_0x12bb1a,_0x46f571);};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x48')]=function(_0x494848,_0x58459a){logger['debug']('[%s][voiceQueueReport]['+_0x58459a+_0x909c('0x49'),_0x494848[_0x909c('0x4a')],util['inspect'](_0x494848,{'showHidden':![],'depth':null}));this[_0x909c('0x47')](util[_0x909c('0x4b')](_0x909c('0x4c'),_0x494848[_0x909c('0x4d')]),_0x909c('0x4e'),_0x494848);io[_0x909c('0x47')](_0x909c('0x4f'),_0x494848);};VoiceQueueReport[_0x909c('0xc')]['emitVoiceQueueChannelRemove']=function(_0x26fba6,_0x52a093){logger[_0x909c('0x50')](_0x909c('0x51')+_0x52a093+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x26fba6[_0x909c('0x4a')],util[_0x909c('0x41')](_0x26fba6,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x26fba6[_0x909c('0x4d')]),_0x909c('0x52'),_0x26fba6);io[_0x909c('0x47')](_0x909c('0x53'),_0x26fba6);};VoiceQueueReport[_0x909c('0xc')]['emitVoiceQueueSummary']=function(_0x25935e,_0x4fda9f){if(_0x25935e[_0x909c('0x54')]==='inbound'){var _0xaac92f={'id':_0x25935e['id'],'name':_0x25935e[_0x909c('0x4d')],'strategy':_0x25935e[_0x909c('0x55')],'answered':_0x25935e[_0x909c('0x56')],'available':_0x25935e['available'],'loggedIn':_0x25935e['loggedIn'],'pTalking':_0x25935e[_0x909c('0x34')],'sumBillable':_0x25935e['sumBillable'],'sumDuration':_0x25935e[_0x909c('0x57')],'sumHoldTime':_0x25935e['sumHoldTime']||0x0,'talking':_0x25935e[_0x909c('0x33')],'total':_0x25935e[_0x909c('0x58')],'type':_0x25935e[_0x909c('0x54')],'unmanaged':_0x25935e[_0x909c('0x59')],'abandoned':_0x25935e[_0x909c('0x5a')],'waiting':_0x25935e['waiting']};if(_0x25935e[_0x909c('0x5b')]){_0xaac92f[_0x909c('0x5b')]={'id':_0x25935e[_0x909c('0x5b')]['id'],'name':_0x25935e['Trunk']['name'],'active':_0x25935e[_0x909c('0x5b')][_0x909c('0x5c')],'callerid':_0x25935e[_0x909c('0x5b')][_0x909c('0x5d')]};}if(_0x25935e['Interval']){_0xaac92f[_0x909c('0x5e')]={'id':_0x25935e[_0x909c('0x5e')]['id'],'name':_0x25935e[_0x909c('0x5e')][_0x909c('0x4d')]};}var _0x300957=md5(JSON[_0x909c('0x5f')](_0xaac92f));if(_0x25935e[_0x909c('0x3')]!==_0x300957){_0x25935e['md5']=_0x300957;logger[_0x909c('0x50')](_0x909c('0x60')+_0x4fda9f+_0x909c('0x61'),util[_0x909c('0x41')](_0xaac92f,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x909c('0x4c'),_0xaac92f['name']),_0x909c('0x62'),_0xaac92f);}}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x63')]=function(_0x13e703){return _0x13e703!==null&&!_['isUndefined'](_0x13e703);};VoiceQueueReport[_0x909c('0xc')]['loopQueueShow']=function(){var _0x1904eb=this;setInterval(function(){_0x1904eb[_0x909c('0x38')]();ami['Action']({'action':_0x909c('0x64')})[_0x909c('0x3d')](function(_0x16b699){logger[_0x909c('0x3f')](_0x909c('0x65'),util['inspect'](_0x16b699,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x909c('0x2e')]=function(){var _0x4595c3=this;setInterval(function(){if(_0x4595c3[_0x909c('0x66')]){return ami['Action']({'action':'queuesummary'})[_0x909c('0x67')](function(_0x5df82b){_0x4595c3[_0x909c('0x66')]=![];})[_0x909c('0x3d')](function(_0x553450){logger['error'](_0x909c('0x68'),util['inspect'](_0x553450,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x909c('0xc')]['syncQueueSummary']=function(_0xbf0ed0){try{if(this[_0x909c('0x63')](_0xbf0ed0)&&this[_0x909c('0x63')](_0xbf0ed0[_0x909c('0x69')])){logger['debug'](_0x909c('0x6a'),util[_0x909c('0x41')](_0xbf0ed0,{'showHidden':![],'depth':null}));if(this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]]){logger[_0x909c('0x6b')]('[voiceQueueReport][queuesummary]\x20name:%s',_0xbf0ed0[_0x909c('0x69')]);var _0x4c7df1=_[_0x909c('0x6c')](this[_0x909c('0x10')],'queue')[_0xbf0ed0[_0x909c('0x69')]]||0x0;var _0x18bfd0=_0x4c7df1-_0xbf0ed0['callers'];if(this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x35')]!==_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x6e')])||this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x6f')]!==_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x70')])||this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x71')]!==_[_0x909c('0x6d')](_0xbf0ed0['available'])||this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x33')]!==_0x18bfd0){this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x35')]=_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x6e')]);this['voiceQueues'][_0xbf0ed0['queue']]['loggedIn']=_[_0x909c('0x6d')](_0xbf0ed0['loggedin']);this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x71')]=_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x71')]);this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x33')]=_0x18bfd0>0x0?_0x18bfd0:0x0;this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x33')]=this[_0x909c('0x11')][_0xbf0ed0['queue']][_0x909c('0x33')]>_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x70')])?_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x70')]):this[_0x909c('0x11')][_0xbf0ed0['queue']][_0x909c('0x33')];this[_0x909c('0x72')](this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]],_0x909c('0x14'));}logger[_0x909c('0x50')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x909c('0x41')](this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]],{'showHidden':![],'depth':null}));ami[_0x909c('0x47')](_0x909c('0x73'),this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]]);}}}catch(_0x5bcee4){logger[_0x909c('0x3f')]('[voiceQueueReport][queuesummary]',util[_0x909c('0x41')](_0x5bcee4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x17')]=function(_0x2cbe1b){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x909c('0x41')](_0x2cbe1b,{'showHidden':![],'depth':null}));this[_0x909c('0x66')]=!![];};VoiceQueueReport[_0x909c('0xc')]['syncQueueCallerJoin']=function(_0x2bf00a){try{if(this[_0x909c('0x63')](_0x2bf00a)){logger[_0x909c('0x50')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2bf00a[_0x909c('0x4a')],util['inspect'](_0x2bf00a,{'showHidden':![],'depth':null}));if(_[_0x909c('0x74')](this[_0x909c('0xe')][_0x2bf00a[_0x909c('0x4a')]])){this[_0x909c('0xe')][_0x2bf00a[_0x909c('0x4a')]]=[];this[_0x909c('0x10')][_0x2bf00a[_0x909c('0x4a')]]={};}var _0x14f10b=new QueueReport();_0x14f10b[_0x909c('0x4d')]=_0x2bf00a[_0x909c('0x69')];_0x14f10b[_0x909c('0x54')]=this[_0x909c('0x11')][_0x14f10b[_0x909c('0x4d')]]&&this[_0x909c('0x11')][_0x14f10b[_0x909c('0x4d')]][_0x909c('0x54')]?this[_0x909c('0x11')][_0x14f10b[_0x909c('0x4d')]][_0x909c('0x54')]||_0x909c('0x75'):_0x909c('0x75');_0x14f10b[_0x909c('0x69')]=_0x2bf00a[_0x909c('0x69')];_0x14f10b[_0x909c('0x76')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));_0x14f10b[_0x909c('0x78')]=_0x2bf00a[_0x909c('0x78')];_0x14f10b[_0x909c('0x79')]=_0x2bf00a[_0x909c('0x79')];_0x14f10b[_0x909c('0x4a')]=_0x2bf00a[_0x909c('0x4a')];logger[_0x909c('0x6b')](_0x909c('0x7a'),_0x14f10b[_0x909c('0x4d')],_0x14f10b['type']);_['merge'](_0x14f10b,_[_0x909c('0x7b')](_0x2bf00a,_[_0x909c('0x7c')](_0x14f10b)));this[_0x909c('0xe')][_0x2bf00a[_0x909c('0x4a')]][_0x909c('0x7d')](_0x14f10b);this[_0x909c('0x10')][_0x2bf00a['uniqueid']]=_0x14f10b;this[_0x909c('0x48')](_0x14f10b,_0x909c('0x19'));}}catch(_0x3ae43f){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x2bf00a[_0x909c('0x4a')],util[_0x909c('0x41')](_0x3ae43f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')]['syncQueueCallerAbandon']=function(_0x15e373){try{if(this['isNotNull'](_0x15e373)){logger[_0x909c('0x50')](_0x909c('0x7e'),_0x15e373[_0x909c('0x4a')],util[_0x909c('0x41')](_0x15e373,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x15e373[_0x909c('0x4a')]]){var _0x1e95c4=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x15e373['uniqueid']]);_0x1e95c4[_0x909c('0x80')]=![];_0x1e95c4[_0x909c('0x81')]=null;_0x1e95c4[_0x909c('0x82')]=_0x15e373[_0x909c('0x82')];_0x1e95c4['originalposition']=_0x15e373['originalposition'];_0x1e95c4[_0x909c('0x1b')]=!![];_0x1e95c4[_0x909c('0x83')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));_0x1e95c4['queuecallerexitreason']='ABANDONED';_0x1e95c4[_0x909c('0x84')]=null;logger[_0x909c('0x6b')](_0x909c('0x85'),_0x1e95c4[_0x909c('0x4d')],_0x1e95c4[_0x909c('0x54')]);this['channels'][_0x15e373[_0x909c('0x4a')]]=_0x1e95c4;this[_0x909c('0x86')](_0x1e95c4,'queuecallerabandon');}}}catch(_0x5ebb7e){logger[_0x909c('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x15e373[_0x909c('0x4a')],util[_0x909c('0x41')](_0x5ebb7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')]['syncQueueCallerLeave']=function(_0x5b6892){try{if(this[_0x909c('0x63')](_0x5b6892)){logger[_0x909c('0x50')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b6892[_0x909c('0x4a')],util[_0x909c('0x41')](_0x5b6892,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x5b6892[_0x909c('0x4a')]]){var _0x25ed8c=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x5b6892[_0x909c('0x4a')]]);_0x25ed8c['queuecallerleaveAt']=moment()[_0x909c('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x25ed8c[_0x909c('0x87')]=_0x5b6892[_0x909c('0x87')];_0x25ed8c[_0x909c('0x88')]=_0x5b6892[_0x909c('0x88')];logger[_0x909c('0x6b')](_0x909c('0x89'),_0x25ed8c[_0x909c('0x4d')],_0x25ed8c['type'],_0x5b6892[_0x909c('0x87')],_0x5b6892[_0x909c('0x88')]);this[_0x909c('0x10')][_0x5b6892[_0x909c('0x4a')]]=_0x25ed8c;this[_0x909c('0x48')](_0x25ed8c,_0x909c('0x1d'));}}}catch(_0x42cde5){logger[_0x909c('0x3f')](_0x909c('0x8a'),_0x5b6892[_0x909c('0x4a')],util['inspect'](_0x42cde5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')]['syncAgentConnect']=function(_0x3f30d8){try{if(this[_0x909c('0x63')](_0x3f30d8)){logger[_0x909c('0x50')](_0x909c('0x8b'),_0x3f30d8[_0x909c('0x4a')],util['inspect'](_0x3f30d8,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x3f30d8[_0x909c('0x4a')]]){var _0x4ababc=_['last'](this[_0x909c('0xe')][_0x3f30d8[_0x909c('0x4a')]]);_0x4ababc[_0x909c('0x80')]=!![];_0x4ababc[_0x909c('0x8c')]='COMPLETEDBYAGENT';logger[_0x909c('0x6b')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4ababc['name'],_0x4ababc[_0x909c('0x54')]);}}}catch(_0x254a5f){logger[_0x909c('0x3f')](_0x909c('0x8b'),_0x3f30d8[_0x909c('0x4a')],util['inspect'](_0x254a5f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x20')]=function(_0x49e220){try{if(this[_0x909c('0x63')](_0x49e220)){logger[_0x909c('0x50')]('[%s][voiceQueueReport][agentcomplete]',_0x49e220['uniqueid'],util[_0x909c('0x41')](_0x49e220,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x49e220[_0x909c('0x4a')]]){var _0x344d60=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x49e220[_0x909c('0x4a')]]);_0x344d60[_0x909c('0x1b')]=![];_0x344d60[_0x909c('0x83')]=null;_0x344d60['assigned']=!![];_0x344d60[_0x909c('0x84')]=_0x49e220[_0x909c('0x8d')];_0x344d60[_0x909c('0x82')]=_0x49e220['holdtime'];_0x344d60[_0x909c('0x80')]=!![];_0x344d60['queuecallerexit']=![];_0x344d60['queuecallerexitAt']=null;if(!_0x344d60[_0x909c('0x8e')]){if(_0x49e220[_0x909c('0x8f')]==_0x909c('0x8e')){_0x344d60[_0x909c('0x8c')]=_0x909c('0x90');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x344d60['name'],_0x344d60['type']);}else{if(_[_0x909c('0x91')](_0x49e220[_0x909c('0x3c')][_0x909c('0x92')](),'local/')){if(this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]]){var _0x521ff2=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]]);_0x521ff2['queuecallercomplete']=![];_0x521ff2['queuecallerexit']=!![];_0x521ff2[_0x909c('0x94')]=moment(_0x344d60[_0x909c('0x76')])[_0x909c('0x95')](_0x49e220['holdtime'],'seconds')[_0x909c('0x4b')](_0x909c('0x77'));_0x521ff2[_0x909c('0x8c')]=_0x909c('0x96');_0x521ff2['transfer']=!![];_0x521ff2[_0x909c('0x97')]=_0x909c('0x98');_0x521ff2[_0x909c('0x99')]=_0x49e220[_0x909c('0x9a')];_0x521ff2[_0x909c('0x9b')]=_0x49e220[_0x909c('0x4a')];logger[_0x909c('0x6b')](_0x909c('0x9c'),_0x521ff2[_0x909c('0x4d')],_0x521ff2[_0x909c('0x54')]);var _0x26642e=this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]];this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]]=this['queueReports'][_0x49e220[_0x909c('0x4a')]];this[_0x909c('0xe')][_0x49e220['uniqueid']]=_0x26642e;}}else{_0x344d60[_0x909c('0x8c')]=_0x909c('0x9d')+_0x49e220['reason']['toUpperCase']();logger[_0x909c('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x344d60[_0x909c('0x4d')],_0x344d60[_0x909c('0x54')],_0x344d60[_0x909c('0x8c')]);}}}this[_0x909c('0x10')][_0x49e220[_0x909c('0x4a')]]=_0x344d60;this[_0x909c('0x86')](_0x344d60,_0x909c('0x1f'));}}}catch(_0xbe936d){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x49e220[_0x909c('0x4a')],util[_0x909c('0x41')](_0xbe936d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x9e')]=function(_0x4adc51){try{if(this[_0x909c('0x63')](_0x4adc51)){logger['debug'](_0x909c('0x9f'),_0x4adc51[_0x909c('0x4a')],util[_0x909c('0x41')](_0x4adc51,{'showHidden':![],'depth':null}));this[_0x909c('0xa0')](_0x4adc51[_0x909c('0x4a')],_['keys'](_0x4adc51[_0x909c('0xa1')])[0x0],_0x4adc51[_0x909c('0xa2')]);if(this[_0x909c('0xe')][_0x4adc51[_0x909c('0x4a')]]){var _0x464a14=_['last'](this[_0x909c('0xe')][_0x4adc51[_0x909c('0x4a')]]);if(_0x464a14){if(this[_0x909c('0x63')](_0x4adc51[_0x909c('0xa1')])&&this['isNotNull'](_0x4adc51['variable'][_0x909c('0xa3')])){switch(_0x4adc51[_0x909c('0xa2')]){case'CONTINUE':_0x464a14[_0x909c('0xa4')]=![];_0x464a14[_0x909c('0x94')]=null;break;case _0x909c('0xa5'):_0x464a14['lastevent']='timeout';_0x464a14[_0x909c('0xa4')]=!![];_0x464a14[_0x909c('0x94')]=moment()['format'](_0x909c('0x77'));_0x464a14[_0x909c('0xa6')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));logger[_0x909c('0x50')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4adc51[_0x909c('0x4a')],util[_0x909c('0x41')](_0x464a14,{'showHidden':![],'depth':null}));ami[_0x909c('0x47')](_0x909c('0xa7'),_0x464a14);break;default:_0x464a14[_0x909c('0xa4')]=!![];_0x464a14['queuecallerexitAt']=moment()[_0x909c('0x4b')](_0x909c('0x77'));_0x464a14[_0x909c('0xa6')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));}_0x464a14['queuecallerabandon']=![];_0x464a14[_0x909c('0x83')]=null;_0x464a14[_0x909c('0x8c')]=_0x4adc51[_0x909c('0xa2')];this['channels'][_0x4adc51[_0x909c('0x4a')]]=_0x464a14;this[_0x909c('0x86')](_0x464a14,_0x909c('0x23'));}else if(this[_0x909c('0x63')](_0x4adc51[_0x909c('0xa1')])&&this[_0x909c('0x63')](_0x4adc51[_0x909c('0xa1')][_0x909c('0xa8')])){if(!_0x464a14[_0x909c('0x1b')]){_0x464a14[_0x909c('0xa4')]=!![];_0x464a14['queuecallerexitAt']=moment()['format'](_0x909c('0x77'));_0x464a14[_0x909c('0x8c')]=_0x909c('0xa9');_0x464a14[_0x909c('0xa6')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));this[_0x909c('0x10')][_0x4adc51[_0x909c('0x4a')]]=_0x464a14;}}logger['info'](_0x909c('0xaa'),_0x4adc51[_0x909c('0x4a')],_0x464a14[_0x909c('0x4d')],_0x464a14[_0x909c('0x54')],_[_0x909c('0x7c')](_0x4adc51[_0x909c('0xa1')])[0x0],_0x4adc51[_0x909c('0xa2')]);_0x464a14['variables']=this[_0x909c('0x13')][_0x4adc51[_0x909c('0x4a')]];}}}}catch(_0x22d2e1){logger[_0x909c('0x3f')](_0x909c('0x9f'),_0x4adc51[_0x909c('0x4a')],util[_0x909c('0x41')](_0x22d2e1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0xa0')]=function(_0x55a8e1,_0x51427f,_0x224df3){var _0x2fcfdf=[_0x909c('0xab'),'rtpaudioqosbridged',_0x909c('0xac'),_0x909c('0xad'),_0x909c('0xae'),_0x909c('0xaf'),_0x909c('0xb0'),_0x909c('0xb1'),_0x909c('0xb2'),_0x909c('0xb3'),_0x909c('0xb4'),_0x909c('0xb5'),_0x909c('0xb6'),'memberdynamic',_0x909c('0xb7'),'memberlastcall',_0x909c('0x8d'),_0x909c('0xb8'),_0x909c('0xb9')];if(!_[_0x909c('0x3b')](_0x51427f)&&!_[_0x909c('0xba')](_0x2fcfdf,_0x51427f)){if(_[_0x909c('0x74')](this['variables'][_0x55a8e1])){this['variables'][_0x55a8e1]={};}this[_0x909c('0x13')][_0x55a8e1][_0x51427f]=_0x224df3;}};VoiceQueueReport[_0x909c('0xc')]['syncHangup']=function(_0x1b23b9){try{if(this[_0x909c('0x63')](_0x1b23b9)){logger['debug'](_0x909c('0xbb'),_0x1b23b9[_0x909c('0x4a')],util[_0x909c('0x41')](_0x1b23b9,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1b23b9['uniqueid']]){for(var _0x4ecbe9=0x0,_0x7afada={};_0x4ecbe90x0?_0x28a63e:0x0;this[_0x8838('0x10')][_0x5be163[_0x8838('0x63')]]['talking']=this[_0x8838('0x10')][_0x5be163[_0x8838('0x63')]]['talking']>_[_0x8838('0x67')](_0x5be163[_0x8838('0x69')])?_[_0x8838('0x67')](_0x5be163[_0x8838('0x69')]):this[_0x8838('0x10')][_0x5be163[_0x8838('0x63')]][_0x8838('0x2f')];this[_0x8838('0x6a')](this[_0x8838('0x10')][_0x5be163[_0x8838('0x63')]],_0x8838('0x14'));}logger[_0x8838('0x42')](_0x8838('0x6b'),util[_0x8838('0x3c')](this[_0x8838('0x10')][_0x5be163[_0x8838('0x63')]],{'showHidden':![],'depth':null}));ami[_0x8838('0x40')](_0x8838('0x6c'),this['voiceQueues'][_0x5be163[_0x8838('0x63')]]);}}}catch(_0x3e46dc){logger[_0x8838('0x3d')](_0x8838('0x6d'),util[_0x8838('0x3c')](_0x3e46dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8838('0x8')][_0x8838('0x18')]=function(_0x2392a6){logger[_0x8838('0x42')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x8838('0x3c')](_0x2392a6,{'showHidden':![],'depth':null}));this[_0x8838('0x11')]=!![];};VoiceQueueReport[_0x8838('0x8')][_0x8838('0x1a')]=function(_0x294acd){try{if(this[_0x8838('0x5d')](_0x294acd)){logger[_0x8838('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x294acd[_0x8838('0x44')],util[_0x8838('0x3c')](_0x294acd,{'showHidden':![],'depth':null}));if(_[_0x8838('0x5e')](this['queueReports'][_0x294acd['uniqueid']])){this['queueReports'][_0x294acd[_0x8838('0x44')]]=[];this[_0x8838('0x34')][_0x294acd[_0x8838('0x44')]]={};}var _0x419c09=new QueueReport();_0x419c09[_0x8838('0x46')]=_0x294acd[_0x8838('0x63')];_0x419c09['type']=this[_0x8838('0x10')][_0x419c09[_0x8838('0x46')]]&&this[_0x8838('0x10')][_0x419c09['name']][_0x8838('0x4b')]?this[_0x8838('0x10')][_0x419c09[_0x8838('0x46')]]['type']||'inbound':_0x8838('0x6e');_0x419c09['queue']=_0x294acd[_0x8838('0x63')];_0x419c09['queuecallerjoinAt']=moment()[_0x8838('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x419c09[_0x8838('0x6f')]=_0x294acd[_0x8838('0x6f')];_0x419c09[_0x8838('0x70')]=_0x294acd[_0x8838('0x70')];_0x419c09[_0x8838('0x44')]=_0x294acd[_0x8838('0x44')];logger[_0x8838('0x65')](_0x8838('0x71'),_0x419c09['name'],_0x419c09['type']);_[_0x8838('0x72')](_0x419c09,_[_0x8838('0x73')](_0x294acd,_[_0x8838('0x74')](_0x419c09)));this[_0x8838('0xd')][_0x294acd[_0x8838('0x44')]][_0x8838('0x75')](_0x419c09);this[_0x8838('0x34')][_0x294acd['uniqueid']]=_0x419c09;this[_0x8838('0x41')](_0x419c09,'queuecallerjoin');}}catch(_0x14341a){logger[_0x8838('0x3d')](_0x8838('0x76'),_0x294acd[_0x8838('0x44')],util[_0x8838('0x3c')](_0x14341a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8838('0x1c')]=function(_0x647e35){try{if(this[_0x8838('0x5d')](_0x647e35)){logger[_0x8838('0x42')](_0x8838('0x77'),_0x647e35['uniqueid'],util[_0x8838('0x3c')](_0x647e35,{'showHidden':![],'depth':null}));if(this[_0x8838('0xd')][_0x647e35[_0x8838('0x44')]]){var _0x55fb66=_[_0x8838('0x78')](this['queueReports'][_0x647e35[_0x8838('0x44')]]);_0x55fb66[_0x8838('0x79')]=![];_0x55fb66[_0x8838('0x7a')]=null;_0x55fb66[_0x8838('0x7b')]=_0x647e35['holdtime'];_0x55fb66[_0x8838('0x7c')]=_0x647e35[_0x8838('0x7c')];_0x55fb66[_0x8838('0x1b')]=!![];_0x55fb66['queuecallerabandonAt']=moment()[_0x8838('0x45')](_0x8838('0x7d'));_0x55fb66[_0x8838('0x7e')]='ABANDONED';_0x55fb66[_0x8838('0x7f')]=null;logger[_0x8838('0x65')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x55fb66[_0x8838('0x46')],_0x55fb66[_0x8838('0x4b')]);this[_0x8838('0x34')][_0x647e35[_0x8838('0x44')]]=_0x55fb66;this['emitVoiceQueueChannelRemove'](_0x55fb66,_0x8838('0x1b'));}}}catch(_0x1d69fc){logger[_0x8838('0x3d')](_0x8838('0x77'),_0x647e35[_0x8838('0x44')],util['inspect'](_0x1d69fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8838('0x80')]=function(_0x26524b){try{if(this['isNotNull'](_0x26524b)){logger[_0x8838('0x42')](_0x8838('0x81'),_0x26524b[_0x8838('0x44')],util[_0x8838('0x3c')](_0x26524b,{'showHidden':![],'depth':null}));if(this[_0x8838('0xd')][_0x26524b[_0x8838('0x44')]]){var _0x22e89a=_[_0x8838('0x78')](this[_0x8838('0xd')][_0x26524b[_0x8838('0x44')]]);_0x22e89a['queuecallerleaveAt']=moment()[_0x8838('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x22e89a[_0x8838('0x82')]=_0x26524b[_0x8838('0x82')];_0x22e89a[_0x8838('0x83')]=_0x26524b['connectedlinename'];logger[_0x8838('0x65')](_0x8838('0x84'),_0x22e89a[_0x8838('0x46')],_0x22e89a[_0x8838('0x4b')],_0x26524b['connectedlinenum'],_0x26524b['connectedlinename']);this[_0x8838('0x34')][_0x26524b[_0x8838('0x44')]]=_0x22e89a;this['emitVoiceQueueChannelSave'](_0x22e89a,_0x8838('0x1d'));}}}catch(_0x41ca0b){logger[_0x8838('0x3d')]('[%s][voiceQueueReport][queuecallerleave]',_0x26524b[_0x8838('0x44')],util['inspect'](_0x41ca0b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8838('0x8')]['syncAgentConnect']=function(_0x3a9e9e){try{if(this[_0x8838('0x5d')](_0x3a9e9e)){logger[_0x8838('0x42')](_0x8838('0x85'),_0x3a9e9e['uniqueid'],util[_0x8838('0x3c')](_0x3a9e9e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3a9e9e['uniqueid']]){var _0x3c4538=_[_0x8838('0x78')](this[_0x8838('0xd')][_0x3a9e9e[_0x8838('0x44')]]);_0x3c4538['queuecallercomplete']=!![];_0x3c4538[_0x8838('0x7e')]=_0x8838('0x86');logger[_0x8838('0x65')](_0x8838('0x87'),_0x3c4538[_0x8838('0x46')],_0x3c4538['type']);}}}catch(_0x52547f){logger[_0x8838('0x3d')](_0x8838('0x85'),_0x3a9e9e[_0x8838('0x44')],util['inspect'](_0x52547f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8838('0x8')][_0x8838('0x1f')]=function(_0x17fb7a){try{if(this[_0x8838('0x5d')](_0x17fb7a)){logger[_0x8838('0x42')](_0x8838('0x88'),_0x17fb7a[_0x8838('0x44')],util[_0x8838('0x3c')](_0x17fb7a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x17fb7a[_0x8838('0x44')]]){var _0x4fc952=_['last'](this['queueReports'][_0x17fb7a[_0x8838('0x44')]]);_0x4fc952['queuecallerabandon']=![];_0x4fc952[_0x8838('0x89')]=null;_0x4fc952['assigned']=!![];_0x4fc952[_0x8838('0x7f')]=_0x17fb7a[_0x8838('0x8a')];_0x4fc952[_0x8838('0x7b')]=_0x17fb7a[_0x8838('0x7b')];_0x4fc952[_0x8838('0x79')]=!![];_0x4fc952[_0x8838('0x8b')]=![];_0x4fc952[_0x8838('0x8c')]=null;if(!_0x4fc952[_0x8838('0x8d')]){if(_0x17fb7a[_0x8838('0x8e')]=='transfer'){_0x4fc952[_0x8838('0x7e')]=_0x8838('0x8f');logger[_0x8838('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x4fc952[_0x8838('0x46')],_0x4fc952[_0x8838('0x4b')]);}else{if(_[_0x8838('0x90')](_0x17fb7a[_0x8838('0x39')][_0x8838('0x91')](),_0x8838('0x92'))){if(this['queueReports'][_0x17fb7a[_0x8838('0x93')]]){var _0x950fa9=_[_0x8838('0x78')](this[_0x8838('0xd')][_0x17fb7a[_0x8838('0x93')]]);_0x950fa9[_0x8838('0x79')]=![];_0x950fa9[_0x8838('0x8b')]=!![];_0x950fa9[_0x8838('0x8c')]=moment(_0x4fc952[_0x8838('0x94')])[_0x8838('0x95')](_0x17fb7a[_0x8838('0x7b')],_0x8838('0x96'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x950fa9[_0x8838('0x7e')]=_0x8838('0x97');_0x950fa9[_0x8838('0x8d')]=!![];_0x950fa9[_0x8838('0x98')]=_0x8838('0x99');_0x950fa9[_0x8838('0x9a')]=_0x17fb7a[_0x8838('0x9b')];_0x950fa9[_0x8838('0x9c')]=_0x17fb7a[_0x8838('0x44')];logger['info'](_0x8838('0x9d'),_0x950fa9[_0x8838('0x46')],_0x950fa9[_0x8838('0x4b')]);var _0x5301f5=this[_0x8838('0xd')][_0x17fb7a[_0x8838('0x93')]];this[_0x8838('0xd')][_0x17fb7a['linkedid']]=this['queueReports'][_0x17fb7a[_0x8838('0x44')]];this[_0x8838('0xd')][_0x17fb7a[_0x8838('0x44')]]=_0x5301f5;}}else{_0x4fc952[_0x8838('0x7e')]=_0x8838('0x9e')+_0x17fb7a[_0x8838('0x8e')][_0x8838('0x9f')]();logger['info'](_0x8838('0xa0'),_0x4fc952[_0x8838('0x46')],_0x4fc952[_0x8838('0x4b')],_0x4fc952[_0x8838('0x7e')]);}}}this[_0x8838('0x34')][_0x17fb7a[_0x8838('0x44')]]=_0x4fc952;this[_0x8838('0x3e')](_0x4fc952,_0x8838('0x1e'));}}}catch(_0x520377){logger['error'](_0x8838('0x88'),_0x17fb7a['uniqueid'],util[_0x8838('0x3c')](_0x520377,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8838('0x8')][_0x8838('0x21')]=function(_0x6e84f8){try{if(this[_0x8838('0x5d')](_0x6e84f8)){logger[_0x8838('0x42')](_0x8838('0xa1'),_0x6e84f8[_0x8838('0x44')],util['inspect'](_0x6e84f8,{'showHidden':![],'depth':null}));this[_0x8838('0xa2')](_0x6e84f8['uniqueid'],_[_0x8838('0x74')](_0x6e84f8['variable'])[0x0],_0x6e84f8[_0x8838('0xa3')]);if(this[_0x8838('0xd')][_0x6e84f8[_0x8838('0x44')]]){var _0x27f027=_['last'](this[_0x8838('0xd')][_0x6e84f8['uniqueid']]);if(_0x27f027){if(this[_0x8838('0x5d')](_0x6e84f8['variable'])&&this[_0x8838('0x5d')](_0x6e84f8[_0x8838('0xa4')]['queuestatus'])){switch(_0x6e84f8[_0x8838('0xa3')]){case _0x8838('0xa5'):_0x27f027[_0x8838('0x8b')]=![];_0x27f027[_0x8838('0x8c')]=null;break;case _0x8838('0xa6'):_0x27f027[_0x8838('0xa7')]=_0x8838('0xa8');_0x27f027[_0x8838('0x8b')]=!![];_0x27f027[_0x8838('0x8c')]=moment()['format'](_0x8838('0x7d'));_0x27f027[_0x8838('0xa9')]=moment()[_0x8838('0x45')](_0x8838('0x7d'));logger[_0x8838('0x42')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x6e84f8[_0x8838('0x44')],util['inspect'](_0x27f027,{'showHidden':![],'depth':null}));ami[_0x8838('0x40')](_0x8838('0xaa'),_0x27f027);break;default:_0x27f027[_0x8838('0x8b')]=!![];_0x27f027[_0x8838('0x8c')]=moment()['format'](_0x8838('0x7d'));_0x27f027[_0x8838('0xa9')]=moment()[_0x8838('0x45')](_0x8838('0x7d'));}_0x27f027[_0x8838('0x1b')]=![];_0x27f027[_0x8838('0x89')]=null;_0x27f027['queuecallerexitreason']=_0x6e84f8['value'];this[_0x8838('0x34')][_0x6e84f8['uniqueid']]=_0x27f027;this[_0x8838('0x3e')](_0x27f027,'varset');}else if(this[_0x8838('0x5d')](_0x6e84f8[_0x8838('0xa4')])&&this[_0x8838('0x5d')](_0x6e84f8[_0x8838('0xa4')][_0x8838('0xab')])){if(!_0x27f027[_0x8838('0x1b')]){_0x27f027[_0x8838('0x8b')]=!![];_0x27f027[_0x8838('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x27f027[_0x8838('0x7e')]=_0x8838('0xac');_0x27f027[_0x8838('0xa9')]=moment()['format'](_0x8838('0x7d'));this[_0x8838('0x34')][_0x6e84f8[_0x8838('0x44')]]=_0x27f027;}}logger[_0x8838('0x65')](_0x8838('0xad'),_0x6e84f8[_0x8838('0x44')],_0x27f027['name'],_0x27f027[_0x8838('0x4b')],_[_0x8838('0x74')](_0x6e84f8['variable'])[0x0],_0x6e84f8[_0x8838('0xa3')]);_0x27f027['variables']=this[_0x8838('0x13')][_0x6e84f8[_0x8838('0x44')]];}}}}catch(_0x42e32a){logger[_0x8838('0x3d')](_0x8838('0xa1'),_0x6e84f8[_0x8838('0x44')],util[_0x8838('0x3c')](_0x42e32a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8838('0x8')]['addVariable']=function(_0xd34cfe,_0x5db434,_0x11edbc){var _0x533232=[_0x8838('0xae'),_0x8838('0xaf'),_0x8838('0xb0'),_0x8838('0xb1'),_0x8838('0xb2'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x8838('0xb3'),'sipcallid',_0x8838('0xb4'),_0x8838('0xb5'),_0x8838('0xb6'),'membercalls','memberdynamic','memberinterface',_0x8838('0xb7'),'membername',_0x8838('0xb8'),_0x8838('0xb9')];if(!_['isNil'](_0x5db434)&&!_[_0x8838('0xba')](_0x533232,_0x5db434)){if(_[_0x8838('0x5e')](this[_0x8838('0x13')][_0xd34cfe])){this[_0x8838('0x13')][_0xd34cfe]={};}this[_0x8838('0x13')][_0xd34cfe][_0x5db434]=_0x11edbc;}};VoiceQueueReport[_0x8838('0x8')][_0x8838('0xbb')]=function(_0x15e366){try{if(this[_0x8838('0x5d')](_0x15e366)){logger[_0x8838('0x42')](_0x8838('0xbc'),_0x15e366[_0x8838('0x44')],util[_0x8838('0x3c')](_0x15e366,{'showHidden':![],'depth':null}));if(this[_0x8838('0xd')][_0x15e366[_0x8838('0x44')]]){for(var _0x51745b=0x0,_0x170869={};_0x51745b=0x0?moment(_0x419b53['endtime'])[_0x3428('0xb')](_0x419b53[_0x3428('0x15')],'seconds'):null,'data1':_0x3428('0x17'),'data2':_0x419b53[_0x3428('0x12')],'data3':_0x419b53[_0x3428('0xf')],'data4':_0x419b53['dialstring']||null,'role':_0x3428('0x10'),'internal':_0x419b53[_0x3428('0x12')]?_[_0x3428('0x11')](_0x419b53[_0x3428('0x12')]):undefined,'uniqueid':_0x419b53[_0x3428('0x18')]},'log':_0x3428('0x5')});}; \ No newline at end of file +var _0x9a0f=['queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','accountcode','toNumber','uniqueid','starttime','endtime','seconds','outbound','dialstring','agent','moment','lodash','../client','voiceQueueReport'];(function(_0x55cd8f,_0x3f01ac){var _0x395ffb=function(_0x195172){while(--_0x195172){_0x55cd8f['push'](_0x55cd8f['shift']());}};_0x395ffb(++_0x3f01ac);}(_0x9a0f,0x15b));var _0xf9a0=function(_0x476212,_0x30957b){_0x476212=_0x476212-0x0;var _0x310888=_0x9a0f[_0x476212];return _0x310888;};'use strict';var moment=require(_0xf9a0('0x0'));var _=require(_0xf9a0('0x1'));var util=require('util');var client=require(_0xf9a0('0x2'));exports[_0xf9a0('0x3')]=function(_0x2cec63){var _0x1e92fa=_0x2cec63[_0xf9a0('0x4')]||_0x2cec63[_0xf9a0('0x5')];return client[_0xf9a0('0x6')](_0xf9a0('0x7'),{'body':{'channel':_0xf9a0('0x8'),'membername':_0x2cec63[_0xf9a0('0x9')],'interface':_[_0xf9a0('0xa')](_0x2cec63[_0xf9a0('0xb')])?util['format']('SIP/%s',_0x2cec63[_0xf9a0('0x9')]):_0x2cec63[_0xf9a0('0xb')],'type':_0xf9a0('0xc'),'enterAt':_0x2cec63[_0xf9a0('0xd')],'exitAt':_0x1e92fa,'duration':moment(_0x1e92fa)[_0xf9a0('0xe')](_0x2cec63[_0xf9a0('0xd')],'seconds'),'data1':_0xf9a0('0xf'),'data2':_0x2cec63[_0xf9a0('0x10')],'data3':_0x2cec63[_0xf9a0('0x11')],'data4':null,'data5':_0x2cec63['queue'],'role':'agent','internal':_0x2cec63[_0xf9a0('0x12')]?_[_0xf9a0('0x13')](_0x2cec63[_0xf9a0('0x12')]):undefined,'uniqueid':_0x2cec63[_0xf9a0('0x14')]},'log':_0xf9a0('0x7')});};exports['voiceDialReport']=function(_0x42e2da){return client[_0xf9a0('0x6')]('CreateMemberReport',{'body':{'channel':_0xf9a0('0x8'),'membername':_0x42e2da['membername'],'interface':_0x42e2da[_0xf9a0('0xb')],'type':'TALKING','enterAt':_0x42e2da[_0xf9a0('0x15')],'exitAt':_0x42e2da[_0xf9a0('0x16')],'duration':moment(_0x42e2da[_0xf9a0('0x16')])[_0xf9a0('0xe')](_0x42e2da[_0xf9a0('0x15')],_0xf9a0('0x17'))>=0x0?moment(_0x42e2da[_0xf9a0('0x16')])[_0xf9a0('0xe')](_0x42e2da[_0xf9a0('0x15')],'seconds'):null,'data1':_0xf9a0('0x18'),'data2':_0x42e2da[_0xf9a0('0x12')],'data3':_0x42e2da[_0xf9a0('0x11')],'data4':_0x42e2da[_0xf9a0('0x19')]||null,'role':_0xf9a0('0x1a'),'internal':_0x42e2da[_0xf9a0('0x12')]?_[_0xf9a0('0x13')](_0x42e2da[_0xf9a0('0x12')]):undefined,'uniqueid':_0x42e2da['uniqueid']},'log':_0xf9a0('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f1d901d..feda5b1 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 _0x6345=['../client','Request','stopRecordingOnTransfer','GetSettings'];(function(_0x34ea22,_0x1270b3){var _0x1ca470=function(_0xf63cf4){while(--_0xf63cf4){_0x34ea22['push'](_0x34ea22['shift']());}};_0x1ca470(++_0x1270b3);}(_0x6345,0xa4));var _0x5634=function(_0x504ff8,_0x1c0b37){_0x504ff8=_0x504ff8-0x0;var _0x5ca963=_0x6345[_0x504ff8];return _0x5ca963;};'use strict';var client=require(_0x5634('0x0'));exports['getSettings']=function(){return client[_0x5634('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5634('0x2')]},'log':_0x5634('0x3')});}; \ No newline at end of file +var _0xe5b5=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x4edad3,_0x21d8f1){var _0xb168cc=function(_0x11ce11){while(--_0x11ce11){_0x4edad3['push'](_0x4edad3['shift']());}};_0xb168cc(++_0x21d8f1);}(_0xe5b5,0x73));var _0x5e5b=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0xe5b5[_0x363b81];return _0x1d92fb;};'use strict';var client=require('../client');exports[_0x5e5b('0x0')]=function(){return client[_0x5e5b('0x1')](_0x5e5b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5e5b('0x3')]},'log':_0x5e5b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index d3c5d32..17ceb00 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 _0xe2c5=['name','html','GetTemplate','getTemplates'];(function(_0x29f110,_0x277744){var _0x5e4390=function(_0x24d5bd){while(--_0x24d5bd){_0x29f110['push'](_0x29f110['shift']());}};_0x5e4390(++_0x277744);}(_0xe2c5,0xd3));var _0x5e2c=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0xe2c5[_0x42bb6d];return _0x1db89b;};'use strict';var client=require('../client');exports[_0x5e2c('0x0')]=function(_0x10edd3){return function(_0x58e70a){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x5e2c('0x1'),_0x5e2c('0x2')]},'log':_0x5e2c('0x3')});};}; \ No newline at end of file +var _0x6706=['getTemplates','GetTemplate','name','html'];(function(_0xf5fc10,_0x59fe9d){var _0x48fc1c=function(_0x24d8fe){while(--_0x24d8fe){_0xf5fc10['push'](_0xf5fc10['shift']());}};_0x48fc1c(++_0x59fe9d);}(_0x6706,0x114));var _0x6670=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6706[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x6670('0x0')]=function(_0x3f6566){return function(_0x11fd1b){return client['Request'](_0x6670('0x1'),{'options':{'raw':!![],'attributes':['id',_0x6670('0x2'),_0x6670('0x3')]},'log':_0x6670('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index d7964ad..4d12e51 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 _0x95be=['operator','value','AnyConditions','Action','Actions','action','data1','data2','data4','data6','../client','getTriggers','Request','GetTrigger','name','channel','Condition','field'];(function(_0x259384,_0xf2a61e){var _0x243d3b=function(_0x5dbb57){while(--_0x5dbb57){_0x259384['push'](_0x259384['shift']());}};_0x243d3b(++_0xf2a61e);}(_0x95be,0xd0));var _0xe95b=function(_0x40ec5d,_0x305425){_0x40ec5d=_0x40ec5d-0x0;var _0x3c712d=_0x95be[_0x40ec5d];return _0x3c712d;};'use strict';var client=require(_0xe95b('0x0'));exports[_0xe95b('0x1')]=function(_0x2ae2b5){return function(_0x1ede12){return client[_0xe95b('0x2')](_0xe95b('0x3'),{'options':{'raw':![],'attributes':['id',_0xe95b('0x4'),_0xe95b('0x5'),'status'],'include':[{'model':_0xe95b('0x6'),'as':'AllConditions','attributes':['id',_0xe95b('0x7'),_0xe95b('0x8'),_0xe95b('0x9')]},{'model':_0xe95b('0x6'),'as':_0xe95b('0xa'),'attributes':['id',_0xe95b('0x7'),'operator',_0xe95b('0x9')]},{'model':_0xe95b('0xb'),'as':_0xe95b('0xc'),'attributes':['id',_0xe95b('0xd'),_0xe95b('0xe'),_0xe95b('0xf'),'data3',_0xe95b('0x10'),'data5',_0xe95b('0x11'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xaded=['channel','status','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data3','data4','data5','data7','../client','getTriggers','Request','GetTrigger'];(function(_0x3cf150,_0x178cb5){var _0x931f8b=function(_0x40a693){while(--_0x40a693){_0x3cf150['push'](_0x3cf150['shift']());}};_0x931f8b(++_0x178cb5);}(_0xaded,0x12c));var _0xdade=function(_0x30bf8e,_0x2b588d){_0x30bf8e=_0x30bf8e-0x0;var _0x3d3da4=_0xaded[_0x30bf8e];return _0x3d3da4;};'use strict';var client=require(_0xdade('0x0'));exports[_0xdade('0x1')]=function(_0x50cbe0){return function(_0x5a79d8){return client[_0xdade('0x2')](_0xdade('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdade('0x4'),_0xdade('0x5')],'include':[{'model':_0xdade('0x6'),'as':_0xdade('0x7'),'attributes':['id','field',_0xdade('0x8'),_0xdade('0x9')]},{'model':_0xdade('0x6'),'as':_0xdade('0xa'),'attributes':['id',_0xdade('0xb'),_0xdade('0x8'),_0xdade('0x9')]},{'model':_0xdade('0xc'),'as':_0xdade('0xd'),'attributes':['id',_0xdade('0xe'),'data1','data2',_0xdade('0xf'),_0xdade('0x10'),_0xdade('0x11'),'data6',_0xdade('0x12')]}]},'log':_0xdade('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index ca0e19d..e038b24 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 _0x5e37=['GetTrunk','../client','getTrunks','Request','name','registry','defaultuser'];(function(_0x139d2c,_0x24e6d8){var _0x4611c6=function(_0x3bcc0d){while(--_0x3bcc0d){_0x139d2c['push'](_0x139d2c['shift']());}};_0x4611c6(++_0x24e6d8);}(_0x5e37,0xcc));var _0x75e3=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x5e37[_0x2ff4bd];return _0x28edc6;};'use strict';var client=require(_0x75e3('0x0'));exports[_0x75e3('0x1')]=function(_0x19ac70){return function(_0x3e6508){return client[_0x75e3('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x75e3('0x3'),_0x75e3('0x4'),_0x75e3('0x5')]},'log':_0x75e3('0x6')});};}; \ No newline at end of file +var _0x89c7=['name','registry','defaultuser','../client','getTrunks','GetTrunk'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x89c7,0x135));var _0x789c=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x89c7[_0x4d7a70];return _0x3aafbb;};'use strict';var client=require(_0x789c('0x0'));exports[_0x789c('0x1')]=function(_0x3b080a){return function(_0x1f0789){return client['Request'](_0x789c('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x789c('0x3'),_0x789c('0x4'),_0x789c('0x5')]},'log':_0x789c('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 44c6d14..1d0f1de 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x1eec3c,_0x4732e2){var _0x35ed38=function(_0x4caef0){while(--_0x4caef0){_0x1eec3c['push'](_0x1eec3c['shift']());}};_0x35ed38(++_0x4732e2);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x4d8f02,_0x5dd29a){var _0x5a8202=function(_0x2a7ec8){while(--_0x2a7ec8){_0x4d8f02['push'](_0x4d8f02['shift']());}};_0x5a8202(++_0x5dd29a);}(_0xedd9,0xfc));var _0x9edd=function(_0x352f8d,_0x1b40e5){_0x352f8d=_0x352f8d-0x0;var _0x5c5768=_0xedd9[_0x352f8d];return _0x5c5768;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 7fda43e..0040c6e 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 _0x7d65=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x7d65,0x127));var _0x57d6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7d65[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x57d6('0x0'));exports['create']=function(_0x3e200c){return client[_0x57d6('0x1')]('CreateVoiceAgentReport',{'body':_0x3e200c,'log':_0x57d6('0x2')});};exports[_0x57d6('0x3')]=function(_0x401462,_0x49489f,_0x5eafa9){return client[_0x57d6('0x1')]('UpdateVoiceAgentReport',{'body':_0x401462,'options':{'where':{'uniqueid':_0x49489f,'interface':_0x5eafa9,'agentcomplete':!![]}},'log':_0x57d6('0x4')});}; \ No newline at end of file +var _0xe5d5=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x5ddcdc,_0x2ee986){var _0x5a4bff=function(_0x2243a5){while(--_0x2243a5){_0x5ddcdc['push'](_0x5ddcdc['shift']());}};_0x5a4bff(++_0x2ee986);}(_0xe5d5,0x1b1));var _0x5e5d=function(_0x2a5bad,_0x310d00){_0x2a5bad=_0x2a5bad-0x0;var _0x16ccd9=_0xe5d5[_0x2a5bad];return _0x16ccd9;};'use strict';var client=require(_0x5e5d('0x0'));exports[_0x5e5d('0x1')]=function(_0x451c9d){return client[_0x5e5d('0x2')](_0x5e5d('0x3'),{'body':_0x451c9d,'log':'CreateVoiceAgentReport'});};exports[_0x5e5d('0x4')]=function(_0x3fe572,_0x3cb187,_0x2f70ae){return client[_0x5e5d('0x2')](_0x5e5d('0x5'),{'body':_0x3fe572,'options':{'where':{'uniqueid':_0x3cb187,'interface':_0x2f70ae,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 1037eda..2905e25 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 _0x5306=['context','callerid','DOCUMENTATION','Request','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport','merge'];(function(_0x22b756,_0x33afc5){var _0x42e6fd=function(_0x39ce6a){while(--_0x39ce6a){_0x22b756['push'](_0x22b756['shift']());}};_0x42e6fd(++_0x33afc5);}(_0x5306,0x150));var _0x6530=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5306[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x6530('0x0'));var util=require(_0x6530('0x1'));var _=require(_0x6530('0x2'));var client=require('../client');exports[_0x6530('0x3')]=function(_0xfaefcc){return client['Request'](_0x6530('0x4'),{'body':_[_0x6530('0x5')](_0xfaefcc,{'source':_0xfaefcc['calleridnum'],'destinationcontext':_0xfaefcc[_0x6530('0x6')],'callerid':_0xfaefcc[_0x6530('0x7')],'amaflags':_0x6530('0x8')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x6530('0x9')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x6530('0xa')](_0x6530('0xb'))[_0x6530('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x6530('0xd')]('day')[_0x6530('0xc')](_0x6530('0xe'))]}},'attributes':['type',_0x6530('0xf'),_0x6530('0x10'),_0x6530('0x11')]},'log':_0x6530('0x12')});};}; \ No newline at end of file +var _0x7c44=['type','disposition','billableseconds','GetVoiceCallReports','lodash','../client','CreateVoiceCallReport','merge','calleridnum','callerid','getVoiceCallReports','Request','GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x20c3ba,_0x3935fb){var _0x49406d=function(_0x2d550b){while(--_0x2d550b){_0x20c3ba['push'](_0x20c3ba['shift']());}};_0x49406d(++_0x3935fb);}(_0x7c44,0xe1));var _0x47c4=function(_0x3867ef,_0x1caac6){_0x3867ef=_0x3867ef-0x0;var _0x12f1ca=_0x7c44[_0x3867ef];return _0x12f1ca;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x47c4('0x0'));var client=require(_0x47c4('0x1'));exports['create']=function(_0x453f72){return client['Request'](_0x47c4('0x2'),{'body':_[_0x47c4('0x3')](_0x453f72,{'source':_0x453f72[_0x47c4('0x4')],'destinationcontext':_0x453f72['context'],'callerid':_0x453f72[_0x47c4('0x5')],'amaflags':'DOCUMENTATION'}),'log':_0x47c4('0x2')});};exports[_0x47c4('0x6')]=function(){return function(){return client[_0x47c4('0x7')](_0x47c4('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x47c4('0x9'))[_0x47c4('0xa')](_0x47c4('0xb')),moment()[_0x47c4('0xc')](_0x47c4('0x9'))[_0x47c4('0xa')](_0x47c4('0xb'))]}},'attributes':[_0x47c4('0xd'),_0x47c4('0xe'),'duration',_0x47c4('0xf')]},'log':_0x47c4('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fdd0895..203bdc0 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 _0x6f4b=['CreateVoiceDialReport','../client','create','Request'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x6f4b,0x175));var _0xb6f4=function(_0x4de9a7,_0x3732cf){_0x4de9a7=_0x4de9a7-0x0;var _0x6a84af=_0x6f4b[_0x4de9a7];return _0x6a84af;};'use strict';var client=require(_0xb6f4('0x0'));exports[_0xb6f4('0x1')]=function(_0x58227e){return client[_0xb6f4('0x2')](_0xb6f4('0x3'),{'body':_0x58227e,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x5124=['CreateVoiceDialReport','../client','create','Request'];(function(_0x5c8968,_0x58644a){var _0x5d27dc=function(_0x4b727b){while(--_0x4b727b){_0x5c8968['push'](_0x5c8968['shift']());}};_0x5d27dc(++_0x58644a);}(_0x5124,0xb5));var _0x4512=function(_0x465ede,_0x1e1367){_0x465ede=_0x465ede-0x0;var _0x2b56d2=_0x5124[_0x465ede];return _0x2b56d2;};'use strict';var client=require(_0x4512('0x0'));exports[_0x4512('0x1')]=function(_0x8a63d6){return client[_0x4512('0x2')](_0x4512('0x3'),{'body':_0x8a63d6,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index fbb3423..e5550a6 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 _0xa588=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x15318c,_0x2e50e4){var _0x10d3ce=function(_0x2fecdd){while(--_0x2fecdd){_0x15318c['push'](_0x15318c['shift']());}};_0x10d3ce(++_0x2e50e4);}(_0xa588,0xe1));var _0x8a58=function(_0x38d657,_0x3522a1){_0x38d657=_0x38d657-0x0;var _0x1de063=_0xa588[_0x38d657];return _0x1de063;};'use strict';var client=require('../client');exports[_0x8a58('0x0')]=function(){return function(){return client[_0x8a58('0x1')](_0x8a58('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8a58('0x3'),_0x8a58('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x8a58('0x0')});};}; \ No newline at end of file +var _0x1491=['Request','GetVoiceExtension','recordingFormat','../client','getVoiceExtensions'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x1491,0x1b1));var _0x1149=function(_0x34fb46,_0x2c9b1b){_0x34fb46=_0x34fb46-0x0;var _0x56800d=_0x1491[_0x34fb46];return _0x56800d;};'use strict';var client=require(_0x1149('0x0'));exports[_0x1149('0x1')]=function(){return function(){return client[_0x1149('0x2')](_0x1149('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x1149('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x1149('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 220cbaf..e8d332b 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 _0x5f84=['dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','active','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','callerid','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x5f84,0x6e));var _0x45f8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5f84[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0x45f8('0x0'));exports[_0x45f8('0x1')]=function(){return function(){return client[_0x45f8('0x2')](_0x45f8('0x3'),{'options':{'raw':![],'attributes':['id',_0x45f8('0x4'),_0x45f8('0x5'),_0x45f8('0x6'),'autopause',_0x45f8('0x7'),_0x45f8('0x8'),_0x45f8('0x9'),_0x45f8('0xa'),_0x45f8('0xb'),_0x45f8('0xc'),_0x45f8('0xd'),_0x45f8('0xe'),_0x45f8('0xf'),_0x45f8('0x10'),_0x45f8('0x11'),_0x45f8('0x12'),_0x45f8('0x13'),_0x45f8('0x14'),'dialQueueTimeout',_0x45f8('0x15'),_0x45f8('0x16'),_0x45f8('0x17'),_0x45f8('0x18'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x45f8('0x19'),'dialGlobalMaxRetry','dialTimezone',_0x45f8('0x1a'),_0x45f8('0x1b'),_0x45f8('0x1c'),_0x45f8('0x1d'),'dialAMDInitialSilence',_0x45f8('0x1e'),_0x45f8('0x1f'),_0x45f8('0x20'),'dialAMDMinWordLength',_0x45f8('0x21'),_0x45f8('0x22'),_0x45f8('0x23'),_0x45f8('0x24'),_0x45f8('0x25'),_0x45f8('0x26'),_0x45f8('0x27'),_0x45f8('0x28'),_0x45f8('0x29'),'dialAgiAfterHangupClient',_0x45f8('0x2a'),_0x45f8('0x7'),_0x45f8('0x2b'),_0x45f8('0x2c'),_0x45f8('0x2d'),_0x45f8('0x2e'),'dialNoSuchNumberRetryFrequency',_0x45f8('0x2f'),_0x45f8('0x30'),_0x45f8('0x31'),_0x45f8('0x32'),_0x45f8('0x33'),_0x45f8('0x34'),_0x45f8('0x35'),_0x45f8('0x36'),'mandatoryDisposition',_0x45f8('0x37'),_0x45f8('0x38')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x45f8('0x4'),'callerid',_0x45f8('0x39')]},{'model':_0x45f8('0x3a'),'as':_0x45f8('0x3b'),'attributes':['id','name']},{'model':_0x45f8('0x3c'),'as':_0x45f8('0x3d'),'attributes':['id',_0x45f8('0x4'),_0x45f8('0x3e'),'active']},{'model':_0x45f8('0x3f'),'as':_0x45f8('0x3f'),'attributes':['id','name'],'include':[{'model':_0x45f8('0x3f'),'as':'Intervals','attributes':['id','name',_0x45f8('0x40')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x2513=['autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','acwTimeout'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x2513,0x1b6));var _0x3251=function(_0x59ba43,_0x1a1f40){_0x59ba43=_0x59ba43-0x0;var _0x242511=_0x2513[_0x59ba43];return _0x242511;};'use strict';var client=require(_0x3251('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x3251('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0x3251('0x2'),_0x3251('0x3'),_0x3251('0x4'),_0x3251('0x5'),'dialActive',_0x3251('0x6'),_0x3251('0x7'),_0x3251('0x8'),_0x3251('0x9'),'dialPredictiveOptimization',_0x3251('0xa'),_0x3251('0xb'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x3251('0xc'),_0x3251('0xd'),_0x3251('0xe'),_0x3251('0xf'),_0x3251('0x10'),_0x3251('0x11'),'dialBusyMaxRetry',_0x3251('0x12'),_0x3251('0x13'),_0x3251('0x14'),'dialGlobalMaxRetry',_0x3251('0x15'),_0x3251('0x16'),_0x3251('0x17'),_0x3251('0x18'),_0x3251('0x19'),_0x3251('0x1a'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x3251('0x1b'),_0x3251('0x1c'),_0x3251('0x1d'),_0x3251('0x1e'),_0x3251('0x1f'),_0x3251('0x20'),_0x3251('0x21'),_0x3251('0x22'),_0x3251('0x23'),_0x3251('0x24'),_0x3251('0x25'),_0x3251('0x26'),_0x3251('0x27'),_0x3251('0x4'),_0x3251('0x28'),_0x3251('0x29'),'dialCutDigit',_0x3251('0x2a'),_0x3251('0x2b'),_0x3251('0x2c'),'dialDropRetryFrequency',_0x3251('0x2d'),_0x3251('0x2e'),_0x3251('0x2f'),_0x3251('0x30'),_0x3251('0x31'),_0x3251('0x32'),_0x3251('0x33'),'dialPredictiveIntervalMaxThreshold',_0x3251('0x34')],'include':[{'model':'Trunk','as':_0x3251('0x35'),'attributes':['id',_0x3251('0x36'),_0x3251('0x37'),_0x3251('0x38')]},{'model':'Pause','as':_0x3251('0x39'),'attributes':['id','name']},{'model':'Trunk','as':_0x3251('0x3a'),'attributes':['id',_0x3251('0x36'),'callerid',_0x3251('0x38')]},{'model':_0x3251('0x3b'),'as':_0x3251('0x3b'),'attributes':['id',_0x3251('0x36')],'include':[{'model':_0x3251('0x3b'),'as':_0x3251('0x3c'),'attributes':['id',_0x3251('0x36'),_0x3251('0x3d')]}]}]},'log':_0x3251('0x3e')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 2154e1e..68c45b7 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(_0x579801,_0x439eb3){var _0x1260d3=function(_0x88ee2e){while(--_0x88ee2e){_0x579801['push'](_0x579801['shift']());}};_0x1260d3(++_0x439eb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x4896cb,_0x1ae1fa){var _0x64c3a6=function(_0x46bf36){while(--_0x46bf36){_0x4896cb['push'](_0x4896cb['shift']());}};_0x64c3a6(++_0x1ae1fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 b8cc1a7..a913a7f 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 _0x754a=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x510ab0,_0x5f4ea6){var _0x238e3b=function(_0x408825){while(--_0x408825){_0x510ab0['push'](_0x510ab0['shift']());}};_0x238e3b(++_0x5f4ea6);}(_0x754a,0x74));var _0xa754=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x754a[_0x4bfac3];return _0x15f0f2;};'use strict';var client=require(_0xa754('0x0'));exports[_0xa754('0x1')]=function(_0x3f8c9b){return function(){return client['Request'](_0xa754('0x2'),{'options':{'where':{'VoiceQueueId':_0x3f8c9b,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x9319=['../client','Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x1a9501,_0x23b6c1){var _0x2b4501=function(_0x4944d3){while(--_0x4944d3){_0x1a9501['push'](_0x1a9501['shift']());}};_0x2b4501(++_0x23b6c1);}(_0x9319,0x78));var _0x9931=function(_0x4c26e8,_0x5ac632){_0x4c26e8=_0x4c26e8-0x0;var _0x38a2e2=_0x9319[_0x4c26e8];return _0x38a2e2;};'use strict';var client=require(_0x9931('0x0'));exports['getVoiceQueueRtPauses']=function(_0x25b0b7){return function(){return client[_0x9931('0x1')](_0x9931('0x2'),{'options':{'where':{'VoiceQueueId':_0x25b0b7,'paused':!![]},'raw':!![]},'log':_0x9931('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 41f86a9..7b6e424 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(_0xd17cde,_0x577243){var _0x1d3692=function(_0x4f1d32){while(--_0x4f1d32){_0xd17cde['push'](_0xd17cde['shift']());}};_0x1d3692(++_0x577243);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed3a4,_0x34413c){_0x1ed3a4=_0x1ed3a4-0x0;var _0xd8ff1a=_0x7a54[_0x1ed3a4];return _0xd8ff1a;};'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(_0x1ad34b,_0x409ff1){var _0xda5cc=function(_0x509816){while(--_0x509816){_0x1ad34b['push'](_0x1ad34b['shift']());}};_0xda5cc(++_0x409ff1);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 66a1b58..237dd06 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 _0x72cd=['context','extension','CreateVoiceTransferReport','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','origtransferercontext','attended','transfers','Request','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x72cd,0x118));var _0xd72c=function(_0x3957e6,_0x146981){_0x3957e6=_0x3957e6-0x0;var _0x375a34=_0x72cd[_0x3957e6];return _0x375a34;};'use strict';var client=require('../client');exports[_0xd72c('0x0')]={};exports['blindTransfer']=function(_0x2263f7){return client[_0xd72c('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x2263f7['result'],'transfererchannel':_0x2263f7['transfererchannel'],'transferercalleridnum':_0x2263f7[_0xd72c('0x2')],'transferercalleridname':_0x2263f7['transferercalleridname'],'transfererconnectedlinenum':_0x2263f7[_0xd72c('0x3')],'transfererconnectedlinename':_0x2263f7[_0xd72c('0x4')],'transfereraccountcode':_0x2263f7[_0xd72c('0x5')],'transferercontext':_0x2263f7[_0xd72c('0x6')],'transfererexten':_0x2263f7[_0xd72c('0x7')],'transfererlinkedid':_0x2263f7[_0xd72c('0x8')],'transfereechannel':_0x2263f7[_0xd72c('0x9')],'transfereecalleridnum':_0x2263f7[_0xd72c('0xa')],'transfereecalleridname':_0x2263f7[_0xd72c('0xb')],'transfereeconnectedlinenum':_0x2263f7[_0xd72c('0xc')],'transfereeconnectedlinename':_0x2263f7[_0xd72c('0xd')],'transfereeaccountcode':_0x2263f7['transfereeaccountcode'],'transfereecontext':_0x2263f7[_0xd72c('0xe')],'transfereeexten':_0x2263f7[_0xd72c('0xf')],'transfereelinkedid':_0x2263f7['transfereelinkedid'],'isexternal':_0x2263f7[_0xd72c('0x10')],'context':_0x2263f7[_0xd72c('0x11')],'extension':_0x2263f7[_0xd72c('0x12')],'type':'blind'},'log':_0xd72c('0x13')});};exports[_0xd72c('0x14')]=function(_0xfe4940){return client[_0xd72c('0x1')](_0xd72c('0x13'),{'body':{'result':_0xfe4940['result'],'transfererchannel':_0xfe4940['origtransfererchannel'],'transferercalleridnum':_0xfe4940[_0xd72c('0x15')],'transferercalleridname':_0xfe4940[_0xd72c('0x16')],'transfererconnectedlinenum':_0xfe4940[_0xd72c('0x17')],'transfererconnectedlinename':_0xfe4940[_0xd72c('0x18')],'transfereraccountcode':_0xfe4940[_0xd72c('0x19')],'transferercontext':_0xfe4940['secondtransferercontext'],'transfererexten':_0xfe4940[_0xd72c('0x1a')],'transfererlinkedid':_0xfe4940[_0xd72c('0x1b')],'transfereechannel':_0xfe4940['transfertargetchannel'],'transfereecalleridnum':_0xfe4940[_0xd72c('0x1c')],'transfereecalleridname':_0xfe4940[_0xd72c('0x1d')],'transfereeconnectedlinenum':_0xfe4940[_0xd72c('0x1e')],'transfereeconnectedlinename':_0xfe4940['transfertargetconnectedlinename'],'transfereeaccountcode':_0xfe4940['transfertargetaccountcode'],'transfereecontext':_0xfe4940['transfertargetcontext'],'transfereeexten':_0xfe4940['transfertargetexten'],'transfereelinkedid':_0xfe4940['transfertargetlinkedid'],'isexternal':_0xfe4940['isexternal'],'context':_0xfe4940[_0xd72c('0x1f')],'extension':_0xfe4940['origtransfererexten'],'type':_0xd72c('0x20')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x9ad1=['context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal'];(function(_0x3ce97d,_0x2e687e){var _0x4d41fa=function(_0x132d24){while(--_0x132d24){_0x3ce97d['push'](_0x3ce97d['shift']());}};_0x4d41fa(++_0x2e687e);}(_0x9ad1,0x14d));var _0x19ad=function(_0x3ec774,_0x5150bd){_0x3ec774=_0x3ec774-0x0;var _0x8f475c=_0x9ad1[_0x3ec774];return _0x8f475c;};'use strict';var client=require(_0x19ad('0x0'));exports[_0x19ad('0x1')]={};exports[_0x19ad('0x2')]=function(_0x5c900d){return client[_0x19ad('0x3')](_0x19ad('0x4'),{'body':{'result':_0x5c900d[_0x19ad('0x5')],'transfererchannel':_0x5c900d['transfererchannel'],'transferercalleridnum':_0x5c900d['transferercalleridnum'],'transferercalleridname':_0x5c900d[_0x19ad('0x6')],'transfererconnectedlinenum':_0x5c900d[_0x19ad('0x7')],'transfererconnectedlinename':_0x5c900d[_0x19ad('0x8')],'transfereraccountcode':_0x5c900d[_0x19ad('0x9')],'transferercontext':_0x5c900d['transferercontext'],'transfererexten':_0x5c900d['transfererexten'],'transfererlinkedid':_0x5c900d[_0x19ad('0xa')],'transfereechannel':_0x5c900d['transfereechannel'],'transfereecalleridnum':_0x5c900d[_0x19ad('0xb')],'transfereecalleridname':_0x5c900d[_0x19ad('0xc')],'transfereeconnectedlinenum':_0x5c900d['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5c900d['transfereeconnectedlinename'],'transfereeaccountcode':_0x5c900d[_0x19ad('0xd')],'transfereecontext':_0x5c900d[_0x19ad('0xe')],'transfereeexten':_0x5c900d[_0x19ad('0xf')],'transfereelinkedid':_0x5c900d[_0x19ad('0x10')],'isexternal':_0x5c900d[_0x19ad('0x11')],'context':_0x5c900d[_0x19ad('0x12')],'extension':_0x5c900d[_0x19ad('0x13')],'type':_0x19ad('0x14')},'log':_0x19ad('0x4')});};exports[_0x19ad('0x15')]=function(_0x35a539){return client[_0x19ad('0x3')](_0x19ad('0x4'),{'body':{'result':_0x35a539[_0x19ad('0x5')],'transfererchannel':_0x35a539[_0x19ad('0x16')],'transferercalleridnum':_0x35a539['origtransferercalleridnum'],'transferercalleridname':_0x35a539[_0x19ad('0x17')],'transfererconnectedlinenum':_0x35a539['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x35a539[_0x19ad('0x18')],'transfereraccountcode':_0x35a539['origtransfereraccountcode'],'transferercontext':_0x35a539[_0x19ad('0x19')],'transfererexten':_0x35a539[_0x19ad('0x1a')],'transfererlinkedid':_0x35a539[_0x19ad('0x1b')],'transfereechannel':_0x35a539[_0x19ad('0x1c')],'transfereecalleridnum':_0x35a539['transfertargetcalleridnum'],'transfereecalleridname':_0x35a539[_0x19ad('0x1d')],'transfereeconnectedlinenum':_0x35a539[_0x19ad('0x1e')],'transfereeconnectedlinename':_0x35a539[_0x19ad('0x1f')],'transfereeaccountcode':_0x35a539[_0x19ad('0x20')],'transfereecontext':_0x35a539[_0x19ad('0x21')],'transfereeexten':_0x35a539[_0x19ad('0x22')],'transfereelinkedid':_0x35a539[_0x19ad('0x23')],'isexternal':_0x35a539[_0x19ad('0x11')],'context':_0x35a539[_0x19ad('0x24')],'extension':_0x35a539[_0x19ad('0x25')],'type':_0x19ad('0x26')},'log':_0x19ad('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 02aed6f..d6a48e5 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 _0x3fa4=['name','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','validate','find','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','filename','toLowerCase','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','server','127.0.0.1','lodash','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','timers','timer','agents','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','keys','module','action','Reload','Action','then','catch','error','message','isConnected','username','command','Command','content','voiceQueues'];(function(_0x2fe4b5,_0x439480){var _0x2b9c0b=function(_0x5bfca9){while(--_0x5bfca9){_0x2fe4b5['push'](_0x2fe4b5['shift']());}};_0x2b9c0b(++_0x439480);}(_0x3fa4,0xf0));var _0x43fa=function(_0x46e7aa,_0x5cfe0a){_0x46e7aa=_0x46e7aa-0x0;var _0x2befe6=_0x3fa4[_0x46e7aa];return _0x2befe6;};'use strict';var _=require(_0x43fa('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var config=require(_0x43fa('0x3'));var properties=require(_0x43fa('0x4'));var ami=require(_0x43fa('0x5'));exports[_0x43fa('0x6')]=function(_0x41ded6,_0x4cd7ec,_0x2c7789){return new BPromise(function(_0x1e53b3,_0x6df71c){var _0x584209={'QueuePause':function(_0x3dc891){return new Promise(function(_0x46adc7,_0x1dc401){var _0x5a3921=util[_0x43fa('0x7')](_0x43fa('0x8'),'SIP',_0x3dc891['name']);if(_0x41ded6[_0x43fa('0x9')]&&_0x41ded6[_0x43fa('0x9')][_0x5a3921]&&_0x41ded6[_0x43fa('0x9')][_0x5a3921][_0x43fa('0xa')]){_0x41ded6[_0x43fa('0x9')][_0x5a3921]['updateAcw']();}if(_0x41ded6[_0x43fa('0xb')][_0x5a3921]){_0x41ded6[_0x43fa('0xb')][_0x5a3921][_0x43fa('0xc')]({'statePause':_0x3dc891['pause']?!![]:![]});}_0x46adc7({'code':0xc8,'message':_0x43fa('0xd')});});},'Reload':function(_0x4353c1){var _0x4665c1=this;return new Promise(function(_0x529c85,_0x24fb1e){if(ami['isConnected']()==![]){return _0x24fb1e(_0x4665c1['error'](0x1f4,[config['asterisk']['ip'],config[_0x43fa('0xe')]['username'],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}_0x4353c1=_['pick'](_0x4353c1,_[_0x43fa('0x11')](properties[_0x43fa('0x12')]));_0x4353c1[_0x43fa('0x13')]=_0x43fa('0x14');return ami[_0x43fa('0x15')](_0x4353c1)[_0x43fa('0x16')](function(_0x5d12ac){_0x529c85({'code':0xc8,'message':_0x5d12ac['message']});})[_0x43fa('0x17')](function(_0x29b8aa){_0x24fb1e(_0x4665c1[_0x43fa('0x18')](0x1f5,_0x29b8aa[_0x43fa('0x19')]));});});},'Command':function(_0x660f61){var _0x15e594=this;return new Promise(function(_0xdf68a6,_0x2d8594){if(ami[_0x43fa('0x1a')]()==![]){return _0x2d8594(_0x15e594['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')][_0x43fa('0x1b')],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}_0x660f61=_['pick'](_0x660f61,_0x43fa('0x1c'));_0x660f61[_0x43fa('0x13')]=_0x43fa('0x1d');return ami[_0x43fa('0x15')](_0x660f61)[_0x43fa('0x16')](function(_0x1d3328){_0xdf68a6({'code':0xc8,'message':_0x1d3328[_0x43fa('0x1e')]});})[_0x43fa('0x17')](function(_0x427426){_0x2d8594(_0x15e594['error'](0x1f5,_0x427426['message']));});});},'VoiceQueues':function(_0xdb62ec){return new Promise(function(_0x197eac,_0x28f695){var _0x78f105=[];for(var _0x40969a in _0x41ded6[_0x43fa('0x1f')]){if(_0x41ded6['voiceQueues']['hasOwnProperty'](_0x40969a)){var _0x1fa077=_0x41ded6[_0x43fa('0x1f')][_0x40969a];var _0x3d6365={'id':_0x1fa077['id'],'name':_0x1fa077[_0x43fa('0x20')],'strategy':_0x1fa077['strategy'],'answered':_0x1fa077[_0x43fa('0x21')],'available':_0x1fa077[_0x43fa('0x22')],'loggedIn':_0x1fa077[_0x43fa('0x23')],'pTalking':_0x1fa077[_0x43fa('0x24')],'sumBillable':_0x1fa077['sumBillable'],'sumDuration':_0x1fa077[_0x43fa('0x25')],'sumHoldTime':_0x1fa077[_0x43fa('0x26')]||0x0,'talking':_0x1fa077[_0x43fa('0x27')],'total':_0x1fa077[_0x43fa('0x28')],'type':_0x1fa077[_0x43fa('0x29')],'unmanaged':_0x1fa077[_0x43fa('0x2a')],'abandoned':_0x1fa077[_0x43fa('0x2b')],'waiting':_0x1fa077[_0x43fa('0x2c')],'loggedInDb':_0x1fa077[_0x43fa('0x2d')]};if(_0x1fa077[_0x43fa('0x29')]===_0x43fa('0x2e')){_0x3d6365[_0x43fa('0x2f')]=_0x1fa077['dialActive'];_0x3d6365['dialMethod']=_0x1fa077[_0x43fa('0x30')];_0x3d6365[_0x43fa('0x31')]=_0x1fa077[_0x43fa('0x31')];_0x3d6365[_0x43fa('0x32')]=_0x1fa077['dialOriginateCallerIdNumber'];_0x3d6365[_0x43fa('0x33')]=_0x1fa077[_0x43fa('0x33')];_0x3d6365[_0x43fa('0x34')]=_0x1fa077['dialPrefix'];_0x3d6365[_0x43fa('0x35')]=_0x1fa077[_0x43fa('0x35')];_0x3d6365[_0x43fa('0x36')]=_0x1fa077[_0x43fa('0x36')];_0x3d6365['outboundAnswerCallsDay']=_0x1fa077[_0x43fa('0x37')];_0x3d6365['outboundBlacklistCallsDay']=_0x1fa077[_0x43fa('0x38')];_0x3d6365[_0x43fa('0x39')]=_0x1fa077[_0x43fa('0x39')];_0x3d6365['outboundCongestionCallsDay']=_0x1fa077[_0x43fa('0x3a')];_0x3d6365['outboundDropCallsDayACS']=_0x1fa077['outboundDropCallsDayACS'];_0x3d6365[_0x43fa('0x3b')]=_0x1fa077[_0x43fa('0x3b')];_0x3d6365[_0x43fa('0x3c')]=_0x1fa077['outboundDropCallsDayTimeout'];_0x3d6365[_0x43fa('0x3d')]=_0x1fa077[_0x43fa('0x3d')];_0x3d6365[_0x43fa('0x3e')]=_0x1fa077[_0x43fa('0x3e')];_0x3d6365[_0x43fa('0x3f')]=_0x1fa077['outboundOriginateFailureCallsDay'];_0x3d6365[_0x43fa('0x40')]=_0x1fa077[_0x43fa('0x40')];_0x3d6365[_0x43fa('0x41')]=_0x1fa077[_0x43fa('0x41')];_0x3d6365['outboundUnknownCallsDay']=_0x1fa077['outboundUnknownCallsDay'];_0x3d6365[_0x43fa('0x42')]=_0x1fa077[_0x43fa('0x42')];_0x3d6365[_0x43fa('0x43')]=_0x1fa077[_0x43fa('0x43')];_0x3d6365[_0x43fa('0x44')]=_0x1fa077['predictiveIntervalAvgTalktime'];_0x3d6365[_0x43fa('0x45')]=_0x1fa077['predictiveIntervalDroppedCallsCallersExit'];_0x3d6365['predictiveIntervalDroppedCallsTimeout']=_0x1fa077[_0x43fa('0x46')];_0x3d6365['predictiveIntervalErlangCalls']=_0x1fa077[_0x43fa('0x47')];_0x3d6365[_0x43fa('0x48')]=_0x1fa077[_0x43fa('0x48')];_0x3d6365[_0x43fa('0x49')]=_0x1fa077['predictiveIntervalHitRate'];_0x3d6365['predictiveIntervalMultiplicativeFactor']=_0x1fa077['predictiveIntervalMultiplicativeFactor'];_0x3d6365[_0x43fa('0x4a')]=_0x1fa077[_0x43fa('0x4a')];_0x3d6365['predictiveIntervalAvailable']=_0x1fa077[_0x43fa('0x4b')];_0x3d6365[_0x43fa('0x4c')]=_0x1fa077[_0x43fa('0x4c')];_0x3d6365[_0x43fa('0x19')]=_0x1fa077['message'];_0x3d6365[_0x43fa('0x4d')]=_0x1fa077[_0x43fa('0x4d')];_0x3d6365['erlangCalls']=_0x1fa077['erlangCalls'];_0x3d6365[_0x43fa('0x4e')]=_0x1fa077['erlangCallToSecond'];_0x3d6365[_0x43fa('0x4f')]=_0x1fa077[_0x43fa('0x4f')];_0x3d6365['erlangBusyFactor']=_0x1fa077[_0x43fa('0x50')];_0x3d6365['startPredictive']=_0x1fa077[_0x43fa('0x51')];_0x3d6365[_0x43fa('0x52')]=_0x1fa077[_0x43fa('0x52')];}if(_0x1fa077['Trunk']){_0x3d6365[_0x43fa('0x53')]={'id':_0x1fa077[_0x43fa('0x53')]['id'],'name':_0x1fa077[_0x43fa('0x53')][_0x43fa('0x20')],'active':_0x1fa077[_0x43fa('0x53')][_0x43fa('0x54')],'callerid':_0x1fa077['Trunk'][_0x43fa('0x55')]};}if(_0x1fa077['Interval']){_0x3d6365[_0x43fa('0x56')]={'id':_0x1fa077['Interval']['id'],'name':_0x1fa077[_0x43fa('0x56')][_0x43fa('0x20')]};}_0x78f105[_0x43fa('0x57')](_0x3d6365);}}_0x197eac({'count':_0x78f105[_0x43fa('0x58')],'rows':_0x78f105});});},'UpdateVoiceQueue':function(_0x1b8851){return new Promise(function(_0x5575a7,_0x2fffef){var _0x5c96e1=_['find'](_0x41ded6['voiceQueues'],{'id':parseInt(_0x1b8851['id'])});var _0x436da4=_[_0x43fa('0x59')](_0x1b8851,['id']);if(_0x5c96e1){for(var _0x2c246e in _0x436da4){if(typeof _0x436da4[_0x2c246e]!==_0x43fa('0x5a')&&typeof _0x5c96e1[_0x2c246e]!==_0x43fa('0x5a')){_0x5c96e1[_0x2c246e]=_0x436da4[_0x2c246e];}}_0x5575a7(_0x5c96e1);}else{_0x2fffef();}});},'VoiceChannels':function(_0x4d3522){return new Promise(function(_0x42bf1c,_0x1662d5){var _0x305e90=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x5c')]);_0x42bf1c({'count':_0x305e90[_0x43fa('0x58')],'rows':_0x305e90});});},'VoiceChannelMixMonitor':function(_0x1e2acd){var _0x33f828=this;return new Promise(function(_0x345c65,_0x458e11){if(ami[_0x43fa('0x1a')]()==![]){return _0x458e11(_0x33f828['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')]['username'],_0x43fa('0xf')]['join']('\x20')));}var _0x193a0b=schema(properties[_0x43fa('0x5d')])[_0x43fa('0x5e')](_0x1e2acd);if(_0x193a0b[_0x43fa('0x58')]>0x0){return _0x458e11(_0x33f828[_0x43fa('0x18')](0x1f4,_['map'](_0x193a0b,_0x43fa('0x19'))['join'](',\x20')));}var _0x12ac3f=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x5c')],{'uniqueid':_0x1e2acd['uniqueid']});if(_0x12ac3f&&_0x12ac3f['channel']){var _0xc3f7aa=util['format'](_0x43fa('0x60'),_0x1e2acd['filename']||_0x1e2acd['uniqueid'],_0x1e2acd[_0x43fa('0x7')]||_0x43fa('0x61'));return ami['Action']({'action':_0x43fa('0x62'),'channel':_0x12ac3f[_0x43fa('0x63')],'file':_0xc3f7aa,'options':_0x43fa('0x64')})[_0x43fa('0x16')](function(_0x51d224){var _0xb03adb=_[_0x43fa('0x5f')](_0x12ac3f[_0x43fa('0x65')],{'filename':_0x43fa('0x66')+_0xc3f7aa['toLowerCase']()});if(_['isNil'](_0xb03adb)){_0x12ac3f[_0x43fa('0x65')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0xc3f7aa['toLowerCase'](),'createdAt':moment()[_0x43fa('0x7')](_0x43fa('0x67')),'mixmonitorid':_0x51d224[_0x43fa('0x68')],'status':_0x43fa('0x69')});}else{_0xb03adb[_0x43fa('0x68')]=_0x51d224[_0x43fa('0x68')];_0xb03adb[_0x43fa('0x6a')]='rec';}_0x345c65({'code':0xc8,'message':[_0x1e2acd[_0x43fa('0x6b')],_0x43fa('0x6c'),_0x51d224['mixmonitorid']][_0x43fa('0x10')]('\x20'),'mixmonitorid':_0x51d224['mixmonitorid']});})[_0x43fa('0x17')](function(_0x18cea7){_0x458e11(_0x33f828[_0x43fa('0x18')](0x1f5,[_0x1e2acd[_0x43fa('0x6b')],_0x18cea7['message']['toLowerCase']()][_0x43fa('0x10')]('\x20')));});}else{return _0x458e11(_0x33f828[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x3ba2e0){var _0x5aa7af=this;return new Promise(function(_0x4cfc61,_0x4045d1){if(ami['isConnected']()==![]){return _0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')][_0x43fa('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x220e2a=schema(properties['voicechannel'])[_0x43fa('0x5e')](_0x3ba2e0);if(_0x220e2a[_0x43fa('0x58')]>0x0){return _0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f4,_[_0x43fa('0x6e')](_0x220e2a,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x3f89f4=_['find'](_0x41ded6[_0x43fa('0x5c')],{'uniqueid':_0x3ba2e0[_0x43fa('0x6b')]});if(_0x3f89f4){return BPromise[_0x43fa('0x6f')]()[_0x43fa('0x16')](function(){if(_0x3f89f4[_0x43fa('0x63')]){return ami['Action']({'action':_0x43fa('0x70'),'channel':_0x3f89f4[_0x43fa('0x63')],'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]})[_0x43fa('0x17')](function(_0x78f0a9){});}})[_0x43fa('0x16')](function(){if(_0x3f89f4[_0x43fa('0x71')]){return ami[_0x43fa('0x15')]({'action':_0x43fa('0x70'),'channel':_0x3f89f4['destinationchannel'],'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]})[_0x43fa('0x17')](function(_0x2d8a01){});}})[_0x43fa('0x16')](function(_0x31fdeb){var _0x4e9f30=_['find'](_0x3f89f4[_0x43fa('0x65')],{'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]});if(_0x4e9f30){_0x4e9f30[_0x43fa('0x6a')]=_0x43fa('0x72');}})[_0x43fa('0x16')](function(){var _0x2bae57=util[_0x43fa('0x7')](_0x43fa('0x60'),_0x3ba2e0[_0x43fa('0x73')]||_0x3ba2e0[_0x43fa('0x6b')],_0x3ba2e0[_0x43fa('0x7')]||_0x43fa('0x61'));var _0xa96468=_[_0x43fa('0x5f')](_0x3f89f4[_0x43fa('0x65')],{'filename':_0x43fa('0x66')+_0x2bae57[_0x43fa('0x74')]()});if(_0xa96468){_0xa96468[_0x43fa('0x6a')]=_0x43fa('0x72');}})[_0x43fa('0x16')](function(){_0x4cfc61({'code':0xc8,'message':[_0x3ba2e0[_0x43fa('0x6b')],_0x43fa('0x75')]['join']('\x20')});})['catch'](function(_0x2840d9){_0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f5,[_0x3ba2e0['uniqueid'],_0x2840d9[_0x43fa('0x19')]['toLowerCase']()][_0x43fa('0x10')]('\x20')));});}else{return _0x4045d1(_0x5aa7af['error'](0x1f5,_0x43fa('0x6d')));}});},'VoiceQueuesChannels':function(_0x6679e0){return new Promise(function(_0x1b79b3,_0x149093){var _0x61aef=_['values'](_0x41ded6[_0x43fa('0x76')]);_0x1b79b3({'count':_0x61aef['length'],'rows':_0x61aef});});},'VoiceQueuesChannel':function(_0x1ea3a0){var _0x310232=this;return new Promise(function(_0x2ed970,_0x1619ae){var _0x195c8b=schema(properties['voicequeuechannel'])[_0x43fa('0x5e')](_0x1ea3a0);if(_0x195c8b[_0x43fa('0x58')]>0x0){return _0x1619ae(_0x310232['error'](0x1f4,_[_0x43fa('0x6e')](_0x195c8b,'message')[_0x43fa('0x10')](',\x20')));}var _0x3c138c=_['find'](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x1ea3a0[_0x43fa('0x6b')]});if(_0x3c138c){_0x2ed970(_0x3c138c);}else{return _0x1619ae(_0x310232[_0x43fa('0x18')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x5c2538){var _0x43088a=this;return new Promise(function(_0x334642,_0x161e93){if(ami[_0x43fa('0x1a')]()==![]){return _0x161e93(_0x43088a['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config['asterisk']['username'],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}var _0xb7596=schema(properties[_0x43fa('0x77')])[_0x43fa('0x5e')](_0x5c2538);if(_0xb7596[_0x43fa('0x58')]>0x0){return _0x161e93(_0x43088a['error'](0x1f4,_[_0x43fa('0x6e')](_0xb7596,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x5779d1=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x5c2538[_0x43fa('0x6b')]});if(_0x5779d1&&_0x5779d1['channel']){return ami[_0x43fa('0x15')]({'action':_0x43fa('0x78'),'channel':_0x5779d1['channel']})['then'](function(_0xa71bb){_0x334642({'code':0xc8,'message':[_0x5c2538[_0x43fa('0x6b')],_0xa71bb[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')});})[_0x43fa('0x17')](function(_0x241200){_0x161e93(_0x43088a[_0x43fa('0x18')](0x1f5,[_0x5c2538[_0x43fa('0x6b')],_0x241200[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')));});}else{return _0x161e93(_0x43088a[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x41ea25){var _0x33b067=this;return new Promise(function(_0x5d3d43,_0x2c3333){if(ami[_0x43fa('0x1a')]()==![]){return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f4,[config[_0x43fa('0xe')]['ip'],config['asterisk'][_0x43fa('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x4931dd=schema(properties[_0x43fa('0x79')])['validate'](_0x41ea25);if(_0x4931dd[_0x43fa('0x58')]>0x0){return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f4,_[_0x43fa('0x6e')](_0x4931dd,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x521d7a=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x41ea25[_0x43fa('0x6b')]});if(_0x521d7a&&_0x521d7a[_0x43fa('0x63')]){return ami['Action']({'action':'Redirect','channel':_0x521d7a['channel'],'exten':_0x41ea25['exten'],'context':_0x41ea25[_0x43fa('0x7a')]||_0x521d7a[_0x43fa('0x7a')],'priority':0x1})[_0x43fa('0x16')](function(_0x583deb){_0x5d3d43({'code':0xc8,'message':[_0x41ea25[_0x43fa('0x6b')],_0x583deb[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')});})['catch'](function(_0x170e69){_0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f5,[_0x41ea25[_0x43fa('0x6b')],_0x170e69[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')));});}else{return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'Agents':function(_0x5c98df){return new Promise(function(_0x4b31b2,_0x278242){var _0xe218b0=_[_0x43fa('0x5b')](_0x41ded6['agents']);_0x4b31b2({'count':_0xe218b0[_0x43fa('0x58')],'rows':_0xe218b0});});},'Telephones':function(_0x3f4839){return new Promise(function(_0x268cb2,_0x563487){var _0x3a3771=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7b')]);_0x268cb2({'count':_0x3a3771['length'],'rows':_0x3a3771});});},'Trunks':function(_0x10123f){return new Promise(function(_0x457006,_0x461abd){var _0x5272eb=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7c')]);_0x457006({'count':_0x5272eb['length'],'rows':_0x5272eb});});},'OutboundChannels':function(_0x733caf){return new Promise(function(_0x941b71,_0xb7fb97){var _0x50a4a9=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7d')]);_0x941b71({'count':_0x50a4a9[_0x43fa('0x58')],'rows':_0x50a4a9});});},'Outbound':function(_0x1d033b){return new Promise(function(_0x2ee768,_0xb7474f){_0x2ee768(_0x41ded6['outbound']);});},'Campaigns':function(_0x179678){return new Promise(function(_0x1e2e8e,_0x302f7c){var _0x1f7593=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7e')]);_0x1e2e8e({'count':_0x1f7593[_0x43fa('0x58')],'rows':_0x1f7593});});},'VoiceQueuesPreview':function(_0x2a56a9){var _0x59cda3=this;return new Promise(function(_0x5a615c,_0x1c881d){_0x4cd7ec[_0x43fa('0x7f')](_0x2a56a9['id'])[_0x43fa('0x16')](function(_0x1f1dd0){_0x5a615c({'code':0xc8,'message':_0x1f1dd0['message']});})[_0x43fa('0x17')](function(_0x374039){_0x1c881d(_0x59cda3['error'](0x1f4,_0x374039[_0x43fa('0x19')]));});});},'EventManager':function(_0x1f240a){var _0x3c2c3c=this;return new Promise(function(_0x1f5df6,_0x187b74){if(!_0x1f240a['event']){return _0x187b74(_0x3c2c3c[_0x43fa('0x18')](0x1f4,_0x43fa('0x80')));}ami[_0x43fa('0x81')](_0x43fa('0x82')+_0x1f240a[_0x43fa('0x83')],_0x1f240a[_0x43fa('0x19')]);_0x1f5df6({'code':0xc8,'message':_0x1f240a});});},'FaxAccounts':function(_0x303923){return new Promise(function(_0xac5e4f,_0x121f31){var _0x5af6e3=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x84')]);_0xac5e4f({'count':_0x5af6e3[_0x43fa('0x58')],'rows':_0x5af6e3});});},'SendFax':function(_0x3ef055){var _0x15230c=this;return new Promise(function(_0x3480c6,_0x1d4217){_0x2c7789['send'](_0x3ef055)[_0x43fa('0x16')](function(_0x5250b4){_0x3480c6({'code':0xc8,'message':_0x5250b4[_0x43fa('0x19')]});})[_0x43fa('0x17')](function(_0x484c73){_0x1d4217(_0x15230c['error'](0x1f4,_0x484c73[_0x43fa('0x19')]));});});},'CheckAfterSend':function(_0x12a889){var _0x30a504=this;return new Promise(function(_0x262aee,_0x131afb){_0x2c7789[_0x43fa('0x85')](_0x12a889)[_0x43fa('0x16')](function(_0xdec4bc){_0x262aee({'code':0xc8,'message':_0xdec4bc['message']});})[_0x43fa('0x17')](function(_0x1c41a1){_0x131afb(_0x30a504[_0x43fa('0x18')](0x1f4,_0x1c41a1[_0x43fa('0x19')]));});});}};var _0x377a73=jayson[_0x43fa('0x86')](_0x584209)['http']();_0x377a73['on']('error',function(_0x5c75b0){return _0x6df71c(_0x5c75b0);});_0x377a73[_0x43fa('0x6')](0x232a,_0x43fa('0x87'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1e53b3('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xee3c=['originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','wav','MixMonitor','ai(mixmonitorid)','toLowerCase','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','monitors','stop','%s.%s','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','context','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','join','keys','action','Reload','then','message','catch','error','isConnected','username','ami\x20disconnected','pick','command','Command','Action','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumBillable','sumDuration','talking','unmanaged','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls'];(function(_0x31e90a,_0x17b96c){var _0x246af9=function(_0x2e7075){while(--_0x2e7075){_0x31e90a['push'](_0x31e90a['shift']());}};_0x246af9(++_0x17b96c);}(_0xee3c,0x14a));var _0xcee3=function(_0x453fe4,_0x162a76){_0x453fe4=_0x453fe4-0x0;var _0x2a4343=_0xee3c[_0x453fe4];return _0x2a4343;};'use strict';var _=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var jayson=require(_0xcee3('0x2'));var schema=require(_0xcee3('0x3'));var BPromise=require(_0xcee3('0x4'));var moment=require(_0xcee3('0x5'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xcee3('0x6'));exports[_0xcee3('0x7')]=function(_0x39d2a8,_0x2c3409,_0x9350f3){return new BPromise(function(_0x44e46f,_0x3b8ffe){var _0x97f00e={'QueuePause':function(_0x22953c){return new Promise(function(_0x364eb2,_0x4770ed){var _0x2d13c3=util[_0xcee3('0x8')](_0xcee3('0x9'),_0xcee3('0xa'),_0x22953c['name']);if(_0x39d2a8[_0xcee3('0xb')]&&_0x39d2a8[_0xcee3('0xb')][_0x2d13c3]&&_0x39d2a8[_0xcee3('0xb')][_0x2d13c3][_0xcee3('0xc')]){_0x39d2a8[_0xcee3('0xb')][_0x2d13c3][_0xcee3('0xd')]();}if(_0x39d2a8['agents'][_0x2d13c3]){_0x39d2a8[_0xcee3('0xe')][_0x2d13c3][_0xcee3('0xf')]({'statePause':_0x22953c[_0xcee3('0x10')]?!![]:![]});}_0x364eb2({'code':0xc8,'message':_0xcee3('0x11')});});},'Reload':function(_0xc4f4f2){var _0x520ac6=this;return new Promise(function(_0x34e3b2,_0x573561){if(ami['isConnected']()==![]){return _0x573561(_0x520ac6['error'](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')]['username'],'ami\x20disconnected'][_0xcee3('0x13')]('\x20')));}_0xc4f4f2=_['pick'](_0xc4f4f2,_[_0xcee3('0x14')](properties['module']));_0xc4f4f2[_0xcee3('0x15')]=_0xcee3('0x16');return ami['Action'](_0xc4f4f2)[_0xcee3('0x17')](function(_0x3fe37f){_0x34e3b2({'code':0xc8,'message':_0x3fe37f[_0xcee3('0x18')]});})[_0xcee3('0x19')](function(_0x50bf6e){_0x573561(_0x520ac6[_0xcee3('0x1a')](0x1f5,_0x50bf6e[_0xcee3('0x18')]));});});},'Command':function(_0x135bb0){var _0x11bf37=this;return new Promise(function(_0x52f4d7,_0x254de7){if(ami[_0xcee3('0x1b')]()==![]){return _0x254de7(_0x11bf37[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')][_0xcee3('0x1c')],_0xcee3('0x1d')][_0xcee3('0x13')]('\x20')));}_0x135bb0=_[_0xcee3('0x1e')](_0x135bb0,_0xcee3('0x1f'));_0x135bb0[_0xcee3('0x15')]=_0xcee3('0x20');return ami[_0xcee3('0x21')](_0x135bb0)['then'](function(_0x1fee89){_0x52f4d7({'code':0xc8,'message':_0x1fee89[_0xcee3('0x22')]});})[_0xcee3('0x19')](function(_0x1ee247){_0x254de7(_0x11bf37[_0xcee3('0x1a')](0x1f5,_0x1ee247['message']));});});},'VoiceQueues':function(_0x5dae8f){return new Promise(function(_0x42f4d1,_0x5b92ba){var _0x544509=[];for(var _0x228ff6 in _0x39d2a8['voiceQueues']){if(_0x39d2a8[_0xcee3('0x23')][_0xcee3('0x24')](_0x228ff6)){var _0x19a15e=_0x39d2a8['voiceQueues'][_0x228ff6];var _0x46f37e={'id':_0x19a15e['id'],'name':_0x19a15e['name'],'strategy':_0x19a15e[_0xcee3('0x25')],'answered':_0x19a15e['answered'],'available':_0x19a15e[_0xcee3('0x26')],'loggedIn':_0x19a15e[_0xcee3('0x27')],'pTalking':_0x19a15e['pTalking'],'sumBillable':_0x19a15e[_0xcee3('0x28')],'sumDuration':_0x19a15e[_0xcee3('0x29')],'sumHoldTime':_0x19a15e['sumHoldTime']||0x0,'talking':_0x19a15e[_0xcee3('0x2a')],'total':_0x19a15e['total'],'type':_0x19a15e['type'],'unmanaged':_0x19a15e[_0xcee3('0x2b')],'abandoned':_0x19a15e['abandoned'],'waiting':_0x19a15e[_0xcee3('0x2c')],'loggedInDb':_0x19a15e[_0xcee3('0x2d')]};if(_0x19a15e[_0xcee3('0x2e')]===_0xcee3('0x2f')){_0x46f37e[_0xcee3('0x30')]=_0x19a15e[_0xcee3('0x30')];_0x46f37e[_0xcee3('0x31')]=_0x19a15e['dialMethod'];_0x46f37e[_0xcee3('0x32')]=_0x19a15e['dialOriginateCallerIdName'];_0x46f37e[_0xcee3('0x33')]=_0x19a15e[_0xcee3('0x33')];_0x46f37e[_0xcee3('0x34')]=_0x19a15e[_0xcee3('0x34')];_0x46f37e[_0xcee3('0x35')]=_0x19a15e[_0xcee3('0x35')];_0x46f37e[_0xcee3('0x36')]=_0x19a15e[_0xcee3('0x36')];_0x46f37e['outboundAnswerAgiCallsDay']=_0x19a15e[_0xcee3('0x37')];_0x46f37e[_0xcee3('0x38')]=_0x19a15e[_0xcee3('0x38')];_0x46f37e['outboundBlacklistCallsDay']=_0x19a15e[_0xcee3('0x39')];_0x46f37e[_0xcee3('0x3a')]=_0x19a15e['outboundBusyCallsDay'];_0x46f37e[_0xcee3('0x3b')]=_0x19a15e['outboundCongestionCallsDay'];_0x46f37e[_0xcee3('0x3c')]=_0x19a15e['outboundDropCallsDayACS'];_0x46f37e['outboundDropCallsDayCallersExit']=_0x19a15e[_0xcee3('0x3d')];_0x46f37e['outboundDropCallsDayTimeout']=_0x19a15e[_0xcee3('0x3e')];_0x46f37e[_0xcee3('0x3f')]=_0x19a15e[_0xcee3('0x3f')];_0x46f37e[_0xcee3('0x40')]=_0x19a15e['outboundNoSuchCallsDay'];_0x46f37e['outboundOriginateFailureCallsDay']=_0x19a15e[_0xcee3('0x41')];_0x46f37e[_0xcee3('0x42')]=_0x19a15e['outboundReCallsDay'];_0x46f37e[_0xcee3('0x43')]=_0x19a15e[_0xcee3('0x43')];_0x46f37e['outboundUnknownCallsDay']=_0x19a15e[_0xcee3('0x44')];_0x46f37e[_0xcee3('0x45')]=_0x19a15e[_0xcee3('0x45')];_0x46f37e[_0xcee3('0x46')]=_0x19a15e[_0xcee3('0x46')];_0x46f37e[_0xcee3('0x47')]=_0x19a15e['predictiveIntervalAvgTalktime'];_0x46f37e[_0xcee3('0x48')]=_0x19a15e[_0xcee3('0x48')];_0x46f37e[_0xcee3('0x49')]=_0x19a15e[_0xcee3('0x49')];_0x46f37e[_0xcee3('0x4a')]=_0x19a15e[_0xcee3('0x4a')];_0x46f37e[_0xcee3('0x4b')]=_0x19a15e['predictiveIntervalErlangCallsDroppedCalls'];_0x46f37e[_0xcee3('0x4c')]=_0x19a15e[_0xcee3('0x4c')];_0x46f37e[_0xcee3('0x4d')]=_0x19a15e['predictiveIntervalMultiplicativeFactor'];_0x46f37e[_0xcee3('0x4e')]=_0x19a15e[_0xcee3('0x4e')];_0x46f37e['predictiveIntervalAvailable']=_0x19a15e[_0xcee3('0x4f')];_0x46f37e[_0xcee3('0x50')]=_0x19a15e[_0xcee3('0x50')];_0x46f37e['message']=_0x19a15e[_0xcee3('0x18')];_0x46f37e[_0xcee3('0x51')]=_0x19a15e[_0xcee3('0x51')];_0x46f37e[_0xcee3('0x52')]=_0x19a15e[_0xcee3('0x52')];_0x46f37e['erlangCallToSecond']=_0x19a15e['erlangCallToSecond'];_0x46f37e[_0xcee3('0x53')]=_0x19a15e[_0xcee3('0x53')];_0x46f37e[_0xcee3('0x54')]=_0x19a15e[_0xcee3('0x54')];_0x46f37e[_0xcee3('0x55')]=_0x19a15e[_0xcee3('0x55')];_0x46f37e[_0xcee3('0x56')]=_0x19a15e[_0xcee3('0x56')];}if(_0x19a15e['Trunk']){_0x46f37e[_0xcee3('0x57')]={'id':_0x19a15e[_0xcee3('0x57')]['id'],'name':_0x19a15e[_0xcee3('0x57')][_0xcee3('0x58')],'active':_0x19a15e[_0xcee3('0x57')][_0xcee3('0x59')],'callerid':_0x19a15e[_0xcee3('0x57')]['callerid']};}if(_0x19a15e[_0xcee3('0x5a')]){_0x46f37e['Interval']={'id':_0x19a15e[_0xcee3('0x5a')]['id'],'name':_0x19a15e[_0xcee3('0x5a')]['name']};}_0x544509[_0xcee3('0x5b')](_0x46f37e);}}_0x42f4d1({'count':_0x544509[_0xcee3('0x5c')],'rows':_0x544509});});},'UpdateVoiceQueue':function(_0x206c46){return new Promise(function(_0x16edab,_0x12d32e){var _0x14e0ca=_[_0xcee3('0x5d')](_0x39d2a8[_0xcee3('0x23')],{'id':parseInt(_0x206c46['id'])});var _0x92712c=_[_0xcee3('0x5e')](_0x206c46,['id']);if(_0x14e0ca){for(var _0x5afc13 in _0x92712c){if(typeof _0x92712c[_0x5afc13]!==_0xcee3('0x5f')&&typeof _0x14e0ca[_0x5afc13]!==_0xcee3('0x5f')){_0x14e0ca[_0x5afc13]=_0x92712c[_0x5afc13];}}_0x16edab(_0x14e0ca);}else{_0x12d32e();}});},'VoiceChannels':function(_0x5df9a8){return new Promise(function(_0x3f0b1e,_0x1b8077){var _0x31393e=_[_0xcee3('0x60')](_0x39d2a8[_0xcee3('0x61')]);_0x3f0b1e({'count':_0x31393e[_0xcee3('0x5c')],'rows':_0x31393e});});},'VoiceChannelMixMonitor':function(_0x1c8bb2){var _0x5aae9a=this;return new Promise(function(_0xefda1d,_0x1a2ebc){if(ami[_0xcee3('0x1b')]()==![]){return _0x1a2ebc(_0x5aae9a[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')]['username'],_0xcee3('0x1d')]['join']('\x20')));}var _0xc0d104=schema(properties[_0xcee3('0x62')])[_0xcee3('0x3')](_0x1c8bb2);if(_0xc0d104['length']>0x0){return _0x1a2ebc(_0x5aae9a['error'](0x1f4,_[_0xcee3('0x63')](_0xc0d104,_0xcee3('0x18'))['join'](',\x20')));}var _0x210cdf=_['find'](_0x39d2a8[_0xcee3('0x61')],{'uniqueid':_0x1c8bb2[_0xcee3('0x64')]});if(_0x210cdf&&_0x210cdf[_0xcee3('0x65')]){var _0x189dbd=util['format']('%s.%s',_0x1c8bb2['filename']||_0x1c8bb2[_0xcee3('0x64')],_0x1c8bb2[_0xcee3('0x8')]||_0xcee3('0x66'));return ami['Action']({'action':_0xcee3('0x67'),'channel':_0x210cdf[_0xcee3('0x65')],'file':_0x189dbd,'options':_0xcee3('0x68')})[_0xcee3('0x17')](function(_0x183aee){var _0x33fdce=_[_0xcee3('0x5d')](_0x210cdf['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x189dbd[_0xcee3('0x69')]()});if(_['isNil'](_0x33fdce)){_0x210cdf['monitors']['push']({'filename':_0xcee3('0x6a')+_0x189dbd[_0xcee3('0x69')](),'createdAt':moment()[_0xcee3('0x8')](_0xcee3('0x6b')),'mixmonitorid':_0x183aee[_0xcee3('0x6c')],'status':'rec'});}else{_0x33fdce[_0xcee3('0x6c')]=_0x183aee[_0xcee3('0x6c')];_0x33fdce[_0xcee3('0x6d')]=_0xcee3('0x6e');}_0xefda1d({'code':0xc8,'message':[_0x1c8bb2[_0xcee3('0x64')],_0xcee3('0x6f'),_0x183aee[_0xcee3('0x6c')]][_0xcee3('0x13')]('\x20'),'mixmonitorid':_0x183aee[_0xcee3('0x6c')]});})['catch'](function(_0x2ed9ec){_0x1a2ebc(_0x5aae9a[_0xcee3('0x1a')](0x1f5,[_0x1c8bb2[_0xcee3('0x64')],_0x2ed9ec['message'][_0xcee3('0x69')]()]['join']('\x20')));});}else{return _0x1a2ebc(_0x5aae9a['error'](0x1f5,_0xcee3('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x31e6c2){var _0x468ed5=this;return new Promise(function(_0x14d12e,_0x506455){if(ami[_0xcee3('0x1b')]()==![]){return _0x506455(_0x468ed5[_0xcee3('0x1a')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xcee3('0x1c')],_0xcee3('0x1d')][_0xcee3('0x13')]('\x20')));}var _0x2ab773=schema(properties[_0xcee3('0x62')])[_0xcee3('0x3')](_0x31e6c2);if(_0x2ab773[_0xcee3('0x5c')]>0x0){return _0x506455(_0x468ed5['error'](0x1f4,_[_0xcee3('0x63')](_0x2ab773,_0xcee3('0x18'))['join'](',\x20')));}var _0x4a674d=_['find'](_0x39d2a8[_0xcee3('0x61')],{'uniqueid':_0x31e6c2[_0xcee3('0x64')]});if(_0x4a674d){return BPromise['resolve']()['then'](function(){if(_0x4a674d[_0xcee3('0x65')]){return ami['Action']({'action':_0xcee3('0x71'),'channel':_0x4a674d[_0xcee3('0x65')],'mixmonitorid':_0x31e6c2[_0xcee3('0x6c')]})['catch'](function(_0x1db43d){});}})[_0xcee3('0x17')](function(){if(_0x4a674d[_0xcee3('0x72')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x4a674d[_0xcee3('0x72')],'mixmonitorid':_0x31e6c2[_0xcee3('0x6c')]})['catch'](function(_0x4eda0f){});}})[_0xcee3('0x17')](function(_0x3ce8ad){var _0x1d0ae9=_[_0xcee3('0x5d')](_0x4a674d[_0xcee3('0x73')],{'mixmonitorid':_0x31e6c2['mixmonitorid']});if(_0x1d0ae9){_0x1d0ae9[_0xcee3('0x6d')]=_0xcee3('0x74');}})['then'](function(){var _0x384ae8=util[_0xcee3('0x8')](_0xcee3('0x75'),_0x31e6c2['filename']||_0x31e6c2[_0xcee3('0x64')],_0x31e6c2[_0xcee3('0x8')]||'wav');var _0x52dd87=_[_0xcee3('0x5d')](_0x4a674d[_0xcee3('0x73')],{'filename':_0xcee3('0x6a')+_0x384ae8[_0xcee3('0x69')]()});if(_0x52dd87){_0x52dd87[_0xcee3('0x6d')]=_0xcee3('0x74');}})[_0xcee3('0x17')](function(){_0x14d12e({'code':0xc8,'message':[_0x31e6c2[_0xcee3('0x64')],_0xcee3('0x76')][_0xcee3('0x13')]('\x20')});})['catch'](function(_0x85a8c6){_0x506455(_0x468ed5[_0xcee3('0x1a')](0x1f5,[_0x31e6c2[_0xcee3('0x64')],_0x85a8c6[_0xcee3('0x18')][_0xcee3('0x69')]()]['join']('\x20')));});}else{return _0x506455(_0x468ed5[_0xcee3('0x1a')](0x1f5,_0xcee3('0x70')));}});},'VoiceQueuesChannels':function(_0xa0102e){return new Promise(function(_0x5ecaf5,_0x40be5d){var _0x2a012d=_['values'](_0x39d2a8['queueChannels']);_0x5ecaf5({'count':_0x2a012d[_0xcee3('0x5c')],'rows':_0x2a012d});});},'VoiceQueuesChannel':function(_0x1d4245){var _0x2bb979=this;return new Promise(function(_0x5b3b07,_0x2b0050){var _0xb084d3=schema(properties[_0xcee3('0x77')])['validate'](_0x1d4245);if(_0xb084d3['length']>0x0){return _0x2b0050(_0x2bb979[_0xcee3('0x1a')](0x1f4,_['map'](_0xb084d3,_0xcee3('0x18'))[_0xcee3('0x13')](',\x20')));}var _0xcc9b98=_[_0xcee3('0x5d')](_0x39d2a8[_0xcee3('0x78')],{'uniqueid':_0x1d4245[_0xcee3('0x64')]});if(_0xcc9b98){_0x5b3b07(_0xcc9b98);}else{return _0x2b0050(_0x2bb979['error'](0x1f5,_0xcee3('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x584b04){var _0x3945a2=this;return new Promise(function(_0x31d6fb,_0x4b58f9){if(ami[_0xcee3('0x1b')]()==![]){return _0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')][_0xcee3('0x1c')],'ami\x20disconnected'][_0xcee3('0x13')]('\x20')));}var _0x1f6238=schema(properties[_0xcee3('0x79')])['validate'](_0x584b04);if(_0x1f6238['length']>0x0){return _0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f4,_[_0xcee3('0x63')](_0x1f6238,_0xcee3('0x18'))[_0xcee3('0x13')](',\x20')));}var _0xfb99fd=_['find'](_0x39d2a8[_0xcee3('0x78')],{'uniqueid':_0x584b04['uniqueid']});if(_0xfb99fd&&_0xfb99fd['channel']){return ami['Action']({'action':_0xcee3('0x7a'),'channel':_0xfb99fd[_0xcee3('0x65')]})[_0xcee3('0x17')](function(_0x4c0c69){_0x31d6fb({'code':0xc8,'message':[_0x584b04[_0xcee3('0x64')],_0x4c0c69[_0xcee3('0x18')][_0xcee3('0x69')]()][_0xcee3('0x13')]('\x20')});})[_0xcee3('0x19')](function(_0x281369){_0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f5,[_0x584b04[_0xcee3('0x64')],_0x281369[_0xcee3('0x18')]['toLowerCase']()][_0xcee3('0x13')]('\x20')));});}else{return _0x4b58f9(_0x3945a2[_0xcee3('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x6d6431){var _0xc71255=this;return new Promise(function(_0x2ba860,_0x37c64a){if(ami[_0xcee3('0x1b')]()==![]){return _0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f4,[config[_0xcee3('0x12')]['ip'],config[_0xcee3('0x12')][_0xcee3('0x1c')],_0xcee3('0x1d')][_0xcee3('0x13')]('\x20')));}var _0x228f45=schema(properties['voicequeuechannelredirect'])['validate'](_0x6d6431);if(_0x228f45['length']>0x0){return _0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f4,_[_0xcee3('0x63')](_0x228f45,_0xcee3('0x18'))['join'](',\x20')));}var _0x50aa78=_['find'](_0x39d2a8[_0xcee3('0x78')],{'uniqueid':_0x6d6431['uniqueid']});if(_0x50aa78&&_0x50aa78[_0xcee3('0x65')]){return ami[_0xcee3('0x21')]({'action':'Redirect','channel':_0x50aa78[_0xcee3('0x65')],'exten':_0x6d6431['exten'],'context':_0x6d6431[_0xcee3('0x7b')]||_0x50aa78['context'],'priority':0x1})[_0xcee3('0x17')](function(_0x6469cf){_0x2ba860({'code':0xc8,'message':[_0x6d6431[_0xcee3('0x64')],_0x6469cf['message'][_0xcee3('0x69')]()][_0xcee3('0x13')]('\x20')});})['catch'](function(_0x223e2e){_0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f5,[_0x6d6431[_0xcee3('0x64')],_0x223e2e[_0xcee3('0x18')][_0xcee3('0x69')]()][_0xcee3('0x13')]('\x20')));});}else{return _0x37c64a(_0xc71255[_0xcee3('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x54bdef){return new Promise(function(_0x54f2d3,_0x40d39b){var _0x2233d5=_[_0xcee3('0x60')](_0x39d2a8['agents']);_0x54f2d3({'count':_0x2233d5[_0xcee3('0x5c')],'rows':_0x2233d5});});},'Telephones':function(_0x4b6f66){return new Promise(function(_0x3731d8,_0xe47ecf){var _0x55c878=_[_0xcee3('0x60')](_0x39d2a8['telephones']);_0x3731d8({'count':_0x55c878[_0xcee3('0x5c')],'rows':_0x55c878});});},'Trunks':function(_0xe1bb60){return new Promise(function(_0x44aa1f,_0x480ee1){var _0x242e97=_[_0xcee3('0x60')](_0x39d2a8['trunks']);_0x44aa1f({'count':_0x242e97[_0xcee3('0x5c')],'rows':_0x242e97});});},'OutboundChannels':function(_0x5645b9){return new Promise(function(_0x5d6af4,_0x423868){var _0x17de6d=_[_0xcee3('0x60')](_0x39d2a8[_0xcee3('0x7c')]);_0x5d6af4({'count':_0x17de6d['length'],'rows':_0x17de6d});});},'Outbound':function(_0x52b5e6){return new Promise(function(_0x2408c3,_0x93db38){_0x2408c3(_0x39d2a8[_0xcee3('0x2f')]);});},'Campaigns':function(_0x38895d){return new Promise(function(_0x177e0c,_0x272988){var _0x49b093=_[_0xcee3('0x60')](_0x39d2a8[_0xcee3('0x7d')]);_0x177e0c({'count':_0x49b093[_0xcee3('0x5c')],'rows':_0x49b093});});},'VoiceQueuesPreview':function(_0x26f987){var _0x22c354=this;return new Promise(function(_0x1ec1aa,_0x21143a){_0x2c3409[_0xcee3('0x7e')](_0x26f987['id'])[_0xcee3('0x17')](function(_0x823914){_0x1ec1aa({'code':0xc8,'message':_0x823914[_0xcee3('0x18')]});})[_0xcee3('0x19')](function(_0x4cf682){_0x21143a(_0x22c354[_0xcee3('0x1a')](0x1f4,_0x4cf682[_0xcee3('0x18')]));});});},'EventManager':function(_0x190f1d){var _0x3e5c73=this;return new Promise(function(_0x3bd156,_0x1fdb4b){if(!_0x190f1d[_0xcee3('0x7f')]){return _0x1fdb4b(_0x3e5c73[_0xcee3('0x1a')](0x1f4,_0xcee3('0x80')));}ami['emit'](_0xcee3('0x81')+_0x190f1d[_0xcee3('0x7f')],_0x190f1d['message']);_0x3bd156({'code':0xc8,'message':_0x190f1d});});},'FaxAccounts':function(_0x2d3602){return new Promise(function(_0x22146b,_0x72d5d){var _0x54beee=_[_0xcee3('0x60')](_0x39d2a8['faxAccounts']);_0x22146b({'count':_0x54beee[_0xcee3('0x5c')],'rows':_0x54beee});});},'SendFax':function(_0x4064d5){var _0x25c2ec=this;return new Promise(function(_0x154dad,_0x39bee6){_0x9350f3[_0xcee3('0x82')](_0x4064d5)[_0xcee3('0x17')](function(_0x56596a){_0x154dad({'code':0xc8,'message':_0x56596a[_0xcee3('0x18')]});})['catch'](function(_0x123e5c){_0x39bee6(_0x25c2ec['error'](0x1f4,_0x123e5c[_0xcee3('0x18')]));});});},'CheckAfterSend':function(_0x1fe31d){var _0x513858=this;return new Promise(function(_0x1d85e6,_0xe7e41b){_0x9350f3[_0xcee3('0x83')](_0x1fe31d)[_0xcee3('0x17')](function(_0x5509b0){_0x1d85e6({'code':0xc8,'message':_0x5509b0[_0xcee3('0x18')]});})[_0xcee3('0x19')](function(_0x412412){_0xe7e41b(_0x513858['error'](0x1f4,_0x412412['message']));});});}};var _0x2bf190=jayson['server'](_0x97f00e)[_0xcee3('0x84')]();_0x2bf190['on'](_0xcee3('0x1a'),function(_0x2de8fc){return _0x3b8ffe(_0x2de8fc);});_0x2bf190[_0xcee3('0x7')](0x232a,_0xcee3('0x85'),function(){console[_0xcee3('0x86')](_0xcee3('0x87'),0x232a);return _0x44e46f(_0xcee3('0x88')+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 dc2a499..06534e8 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 _0x3d86=['../../../../config/logger','trigger','../../rpc/cmContact','redis','info','[CM][%s][%s]','stringify','data1','data2','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','name','format','trigger:%s','action','merge','bluebird','ioredis','util','../../../../config/environment'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3d86,0x16f));var _0x63d8=function(_0x53f0ac,_0x564425){_0x53f0ac=_0x53f0ac-0x0;var _0x1a8b12=_0x3d86[_0x53f0ac];return _0x1a8b12;};'use strict';var _=require('lodash');var BPromise=require(_0x63d8('0x0'));var Redis=require(_0x63d8('0x1'));var util=require(_0x63d8('0x2'));var config=require(_0x63d8('0x3'));var logger=require(_0x63d8('0x4'))(_0x63d8('0x5'));var cmContactRpc=require(_0x63d8('0x6'));config[_0x63d8('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x35371a,_0x2e8cdf,_0x31c479,_0x24fd12,_0x4d06ad){logger[_0x63d8('0x8')](_0x63d8('0x9'),_0x35371a,_0x2e8cdf['id'],_0x31c479,_0x24fd12,JSON[_0x63d8('0xa')](_0x4d06ad));io['to'](_0x31c479)['emit'](_0x24fd12,_0x4d06ad);}exports['exec']=function(_0x273c15,_0x2cf164,_0xf321a5,_0x4a8ada){var _0x14316a,_0x4d9b03;var _0x30cf03={};var _0x2c8964=Number(_0xf321a5[_0x63d8('0xb')]);var _0x116db1=_0xf321a5[_0x63d8('0xc')]?Boolean(Number(_0xf321a5['data2'])):![];var _0x461aa3;if(_0x4a8ada[_0x63d8('0xd')]){_0x30cf03['id']=_0x4a8ada[_0x63d8('0xd')];}if(!_0x30cf03['id']){_0x30cf03[_0x63d8('0xe')]=_0x2c8964;_0x461aa3=_0xf321a5[_0x63d8('0xf')]&&_0xf321a5[_0x63d8('0xf')]!=='0'?_0xf321a5[_0x63d8('0xf')][_0x63d8('0x10')](','):['phone'];_0x30cf03[_0x63d8('0x11')]=_[_0x63d8('0x12')](_0x461aa3,function(_0x5d46d1){var _0x5a9ba0={};_0x5a9ba0[_0x5d46d1]=_0x4a8ada[_0x63d8('0x13')]?_0x4a8ada[_0x63d8('0x14')]:_0x4a8ada[_0x63d8('0x15')];return _0x5a9ba0;});}var _0x353779=['id',_0x63d8('0x16'),_0x63d8('0x17'),_0x63d8('0x18'),'mobile',_0x63d8('0x19'),_0x63d8('0xe'),'createdAt',_0x63d8('0x1a'),_0x63d8('0x1b')];var _0x22083e=_[_0x63d8('0x1c')](_0x353779,_0x461aa3);BPromise['resolve']()[_0x63d8('0x1d')](cmContactRpc[_0x63d8('0x1e')]({'attributes':_0x22083e,'where':_0x30cf03}))[_0x63d8('0x1d')](function(_0x29d581){_0x4d9b03=_0x29d581;if(!_[_0x63d8('0x1f')](_0x4d9b03)){if(_0x4d9b03[_0x63d8('0x20')]===0x1){_0x14316a=_0x4d9b03[0x0];logger[_0x63d8('0x8')](_0x63d8('0x21'),_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id'],_0x14316a['id']);}else{logger[_0x63d8('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id'],_[_0x63d8('0x12')](_0x4d9b03,'id')[_0x63d8('0x23')](','));}return;}else{logger[_0x63d8('0x8')](_0x63d8('0x24'),_0x4a8ada['uniqueid'],_0x2cf164['id']);var _0x263122={'ListId':_0x2c8964};var _0xd3da65=_0xf321a5[_0x63d8('0x25')]&&_0xf321a5[_0x63d8('0x25')]!=='0'?_0xf321a5[_0x63d8('0x25')]:_0x63d8('0x18');if(_0x116db1){logger[_0x63d8('0x8')](_0x63d8('0x26'),_0x4a8ada['uniqueid'],_0x2cf164['id']);_0x263122[_0xd3da65]=_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])?_0x4a8ada[_0x63d8('0x15')]:_0x4a8ada['destcalleridnum'];if(_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])){_0x263122[_0x63d8('0x16')]=_0x4a8ada[_0x63d8('0x28')]&&_0x4a8ada[_0x63d8('0x28')]!==''?_0x4a8ada[_0x63d8('0x28')]:_0x63d8('0x29');}else{_0x263122[_0x63d8('0x16')]=_0x4a8ada[_0x63d8('0x2a')]&&_0x4a8ada['destcalleridname']!==_0x63d8('0x2b')?_0x4a8ada[_0x63d8('0x2a')]:'Unknown';}return BPromise['resolve']()[_0x63d8('0x1d')](cmContactRpc[_0x63d8('0x2c')](_0x263122))[_0x63d8('0x1d')](function(_0x3068b3){_0x14316a=_0x3068b3;_0x4d9b03['push'](_0x3068b3);if(_0x14316a){logger[_0x63d8('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id'],_0x14316a['id']);}return;});}else{logger[_0x63d8('0x8')](_0x63d8('0x2d'),_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id']);_0x263122[_0xd3da65]=_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])?_0x4a8ada[_0x63d8('0x15')]:_0x4a8ada[_0x63d8('0x14')];if(_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])){_0x263122[_0x63d8('0x16')]=_0x4a8ada['calleridname']&&_0x4a8ada[_0x63d8('0x28')]!==_0x63d8('0x2b')?_0x4a8ada[_0x63d8('0x28')]:_0x63d8('0x29');}else{_0x263122[_0x63d8('0x16')]=_0x4a8ada['destcalleridname']&&_0x4a8ada[_0x63d8('0x2a')]!==_0x63d8('0x2b')?_0x4a8ada[_0x63d8('0x2a')]:_0x63d8('0x29');}_0x14316a=_0x263122;_0x4d9b03[_0x63d8('0x2e')](_0x263122);return;}}})['then'](function(){if(_0x273c15){emit(_0x4a8ada[_0x63d8('0x22')],_0x2cf164,util['format'](_0x63d8('0x2f'),_0x273c15[_0x63d8('0x30')]),util[_0x63d8('0x31')](_0x63d8('0x32'),_0xf321a5[_0x63d8('0x33')]['toLowerCase']()),{'evt':_[_0x63d8('0x34')](_0x4a8ada,{'autoCreate':_0x116db1}),'contact':_0x14316a===undefined?{}:_0x14316a,'contacts':_0x4d9b03[_0x63d8('0x20')]===0x0?undefined:_0x4d9b03});}});}; \ No newline at end of file +var _0x85d7=['name','merge','lodash','ioredis','util','../../../../config/environment','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','firstName','mobile','updatedAt','union','then','getContacts','length','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridname','','destcalleridname','resolve','[CM][%s][%s]\x20Contact\x20created:%s','calleridnum','Unknown','push','format'];(function(_0x5aed8d,_0x17b716){var _0x3fcb6b=function(_0x4fb3f3){while(--_0x4fb3f3){_0x5aed8d['push'](_0x5aed8d['shift']());}};_0x3fcb6b(++_0x17b716);}(_0x85d7,0x144));var _0x785d=function(_0x5a0681,_0x5cbc10){_0x5a0681=_0x5a0681-0x0;var _0x2d3a74=_0x85d7[_0x5a0681];return _0x2d3a74;};'use strict';var _=require(_0x785d('0x0'));var BPromise=require('bluebird');var Redis=require(_0x785d('0x1'));var util=require(_0x785d('0x2'));var config=require(_0x785d('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x785d('0x4'));config['redis']=_[_0x785d('0x5')](config[_0x785d('0x6')],{'host':_0x785d('0x7'),'port':0x18eb});var io=require(_0x785d('0x8'))(new Redis(config[_0x785d('0x6')]));function emit(_0x48f3bf,_0x4068aa,_0x366add,_0x1c15c5,_0x4a987e){logger[_0x785d('0x9')]('[CM][%s][%s]',_0x48f3bf,_0x4068aa['id'],_0x366add,_0x1c15c5,JSON[_0x785d('0xa')](_0x4a987e));io['to'](_0x366add)['emit'](_0x1c15c5,_0x4a987e);}exports[_0x785d('0xb')]=function(_0x2baa94,_0x55c9a1,_0x2bcd76,_0x8b556c){var _0x1941a4,_0xdf22e2;var _0xbf377a={};var _0x137df9=Number(_0x2bcd76[_0x785d('0xc')]);var _0x4729c3=_0x2bcd76[_0x785d('0xd')]?Boolean(Number(_0x2bcd76[_0x785d('0xd')])):![];var _0x28bad5;if(_0x8b556c[_0x785d('0xe')]){_0xbf377a['id']=_0x8b556c[_0x785d('0xe')];}if(!_0xbf377a['id']){_0xbf377a[_0x785d('0xf')]=_0x137df9;_0x28bad5=_0x2bcd76[_0x785d('0x10')]&&_0x2bcd76[_0x785d('0x10')]!=='0'?_0x2bcd76[_0x785d('0x10')][_0x785d('0x11')](','):[_0x785d('0x12')];_0xbf377a['$or']=_[_0x785d('0x13')](_0x28bad5,function(_0x53a316){var _0x57a857={};_0x57a857[_0x53a316]=_0x8b556c['routeId']?_0x8b556c[_0x785d('0x14')]:_0x8b556c['calleridnum'];return _0x57a857;});}var _0x308926=['id',_0x785d('0x15'),'lastName',_0x785d('0x12'),_0x785d('0x16'),'fax',_0x785d('0xf'),'createdAt','scheduledAt',_0x785d('0x17')];var _0x360ba0=_[_0x785d('0x18')](_0x308926,_0x28bad5);BPromise['resolve']()[_0x785d('0x19')](cmContactRpc[_0x785d('0x1a')]({'attributes':_0x360ba0,'where':_0xbf377a}))[_0x785d('0x19')](function(_0x4a5b45){_0xdf22e2=_0x4a5b45;if(!_['isEmpty'](_0xdf22e2)){if(_0xdf22e2[_0x785d('0x1b')]===0x1){_0x1941a4=_0xdf22e2[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x8b556c['uniqueid'],_0x55c9a1['id'],_0x1941a4['id']);}else{logger['info'](_0x785d('0x1c'),_0x8b556c[_0x785d('0x1d')],_0x55c9a1['id'],_[_0x785d('0x13')](_0xdf22e2,'id')[_0x785d('0x1e')](','));}return;}else{logger[_0x785d('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x8b556c['uniqueid'],_0x55c9a1['id']);var _0x4613e1={'ListId':_0x137df9};var _0x17eaae=_0x2bcd76[_0x785d('0x1f')]&&_0x2bcd76[_0x785d('0x1f')]!=='0'?_0x2bcd76[_0x785d('0x1f')]:_0x785d('0x12');if(_0x4729c3){logger[_0x785d('0x9')](_0x785d('0x20'),_0x8b556c[_0x785d('0x1d')],_0x55c9a1['id']);_0x4613e1[_0x17eaae]=_[_0x785d('0x21')](_0x8b556c[_0x785d('0x22')])?_0x8b556c['calleridnum']:_0x8b556c[_0x785d('0x14')];if(_[_0x785d('0x21')](_0x8b556c[_0x785d('0x22')])){_0x4613e1[_0x785d('0x15')]=_0x8b556c['calleridname']&&_0x8b556c[_0x785d('0x23')]!==_0x785d('0x24')?_0x8b556c[_0x785d('0x23')]:'Unknown';}else{_0x4613e1[_0x785d('0x15')]=_0x8b556c[_0x785d('0x25')]&&_0x8b556c[_0x785d('0x25')]!==''?_0x8b556c[_0x785d('0x25')]:'Unknown';}return BPromise[_0x785d('0x26')]()[_0x785d('0x19')](cmContactRpc['createContact'](_0x4613e1))[_0x785d('0x19')](function(_0x33eb9f){_0x1941a4=_0x33eb9f;_0xdf22e2['push'](_0x33eb9f);if(_0x1941a4){logger[_0x785d('0x9')](_0x785d('0x27'),_0x8b556c[_0x785d('0x1d')],_0x55c9a1['id'],_0x1941a4['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x8b556c[_0x785d('0x1d')],_0x55c9a1['id']);_0x4613e1[_0x17eaae]=_[_0x785d('0x21')](_0x8b556c[_0x785d('0x22')])?_0x8b556c[_0x785d('0x28')]:_0x8b556c[_0x785d('0x14')];if(_[_0x785d('0x21')](_0x8b556c[_0x785d('0x22')])){_0x4613e1['firstName']=_0x8b556c[_0x785d('0x23')]&&_0x8b556c[_0x785d('0x23')]!==_0x785d('0x24')?_0x8b556c[_0x785d('0x23')]:_0x785d('0x29');}else{_0x4613e1['firstName']=_0x8b556c[_0x785d('0x25')]&&_0x8b556c[_0x785d('0x25')]!==''?_0x8b556c[_0x785d('0x25')]:_0x785d('0x29');}_0x1941a4=_0x4613e1;_0xdf22e2[_0x785d('0x2a')](_0x4613e1);return;}}})[_0x785d('0x19')](function(){if(_0x2baa94){emit(_0x8b556c[_0x785d('0x1d')],_0x55c9a1,util[_0x785d('0x2b')]('user:%s',_0x2baa94[_0x785d('0x2c')]),util[_0x785d('0x2b')]('trigger:%s',_0x2bcd76['action']['toLowerCase']()),{'evt':_[_0x785d('0x2d')](_0x8b556c,{'autoCreate':_0x4729c3}),'contact':_0x1941a4===undefined?{}:_0x1941a4,'contacts':_0xdf22e2['length']===0x0?undefined:_0xdf22e2});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 62a86b1..b6e27e1 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 _0x6c37=['freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','template\x20not\x20found','uri','buildUri','data3','isNil','data4','location','windowWidth','data5','800','windowHeight','data6','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','toLowerCase','jscripty','trigger:%s','exec','integration','queue','urlforward','parse','query','replace','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','ChatWebsiteId','upperFirst','AccountId','value','interaction','message','event','operator','membername','lastevent','routeId','util','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../ami','defaults','localhost','socket.io-emitter','redis','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts'];(function(_0x3403bd,_0x2231f2){var _0x5941f8=function(_0x4140c0){while(--_0x4140c0){_0x3403bd['push'](_0x3403bd['shift']());}};_0x5941f8(++_0x2231f2);}(_0x6c37,0x1c9));var _0x76c3=function(_0x573895,_0x5cbeec){_0x573895=_0x573895-0x0;var _0x4f67cb=_0x6c37[_0x573895];return _0x4f67cb;};'use strict';var util=require(_0x76c3('0x0'));var _=require(_0x76c3('0x1'));var url=require(_0x76c3('0x2'));var Mustache=require('mustache');var Redis=require(_0x76c3('0x3'));var urlforward=require(_0x76c3('0x4'));var integration=require('./integration');var cmContact=require(_0x76c3('0x5'));var script=require(_0x76c3('0x6'));var config=require(_0x76c3('0x7'));var logger=require('../../../config/logger')('trigger');var ami=require(_0x76c3('0x8'));config['redis']=_[_0x76c3('0x9')](config['redis'],{'host':_0x76c3('0xa'),'port':0x18eb});var io=require(_0x76c3('0xb'))(new Redis(config[_0x76c3('0xc')]));var operators={'equals':function(_0x7fd1a9,_0x54fd23){return _0x7fd1a9==_0x54fd23;},'not_equals':function(_0x31611b,_0x4d3159){return _0x31611b!=_0x4d3159;}};var barAndWebActions=['popup',_0x76c3('0x2'),'winapp'];function Trigger(_0x2674ab){this[_0x76c3('0xd')]=_0x2674ab[_0x76c3('0xd')];this[_0x76c3('0xe')]=_0x2674ab[_0x76c3('0xe')];this[_0x76c3('0xf')]=_0x2674ab['voiceQueues'];this['templates']=_0x2674ab[_0x76c3('0x10')];this[_0x76c3('0x11')]=_0x2674ab[_0x76c3('0x11')];this[_0x76c3('0x12')]=_0x2674ab['zendeskAccounts'];this['freshdeskAccounts']=_0x2674ab[_0x76c3('0x13')];this[_0x76c3('0x14')]=_0x2674ab[_0x76c3('0x14')];this[_0x76c3('0x15')]=_0x2674ab[_0x76c3('0x15')];this['zohoAccounts']=_0x2674ab['zohoAccounts'];this['deskAccounts']=_0x2674ab[_0x76c3('0x16')];this[_0x76c3('0x17')]=_0x2674ab['vtigerAccounts'];this[_0x76c3('0x18')]=_0x2674ab[_0x76c3('0x18')];this[_0x76c3('0x19')]=_0x2674ab[_0x76c3('0x19')];this['freshsalesAccounts']=_0x2674ab[_0x76c3('0x1a')];this[_0x76c3('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x76c3('0x14')],'freshdesk':this[_0x76c3('0x13')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x76c3('0x1c')],'desk':this[_0x76c3('0x16')],'vtiger':this[_0x76c3('0x17')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x76c3('0x1a')],'servicenow':this[_0x76c3('0x18')]};ami['on'](_0x76c3('0x1d'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x76c3('0x21'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x22'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x23'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x24'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent']['bind'](this));ami['on'](_0x76c3('0x25'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x26'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x27'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on']('custom:timeout',this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x28'),this[_0x76c3('0x29')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2a'),this[_0x76c3('0x29')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2b'),this[_0x76c3('0x29')]['bind'](this));ami['on'](_0x76c3('0x2c'),this['syncCustomEvent'][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2d'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2e'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x2f'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x30'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x31'),this['syncCustomEvent'][_0x76c3('0x1f')](this));}Trigger[_0x76c3('0x32')][_0x76c3('0x33')]=function(_0x552c28,_0x3c91b0,_0x2c96ae){logger['info'](_0x552c28,_0x3c91b0,JSON[_0x76c3('0x34')](_0x2c96ae));io['to'](_0x552c28)[_0x76c3('0x33')](_0x3c91b0,_0x2c96ae);};Trigger['prototype'][_0x76c3('0x1e')]=function(_0x34bbbb){var _0x3108f2=_[_0x76c3('0x35')](_0x34bbbb);this[_0x76c3('0x36')](_0x3108f2);};Trigger[_0x76c3('0x32')][_0x76c3('0x29')]=function(_0x319ee3){if(this[_0x76c3('0xe')][_0x319ee3[_0x76c3('0x37')]]){this[_0x76c3('0x1e')](_0x319ee3);}};Trigger[_0x76c3('0x32')][_0x76c3('0x36')]=function(_0x32bb40){var _0x23f7dd;for(var _0x3c6a89 in this[_0x76c3('0xd')]){if(this[_0x76c3('0xd')][_0x76c3('0x38')](_0x3c6a89)){if(this['triggers'][_0x3c6a89]['status']){_0x23f7dd=this[_0x76c3('0x39')](this[_0x76c3('0xd')][_0x3c6a89],_0x32bb40);if(_0x23f7dd){_[_0x76c3('0x3a')](_0x32bb40,_0x32bb40[_0x76c3('0x3b')]);for(var _0x44ad62=0x0,_0x35e4bf,_0x514580,_0xfba2f6;_0x44ad620x0){_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 _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x588653,_0xf0e2a9){var _0x370a90=function(_0x48c6a7){while(--_0x48c6a7){_0x588653['push'](_0x588653['shift']());}};_0x370a90(++_0xf0e2a9);}(_0x814b,0x1a2));var _0xb814=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x814b[_0xf34109];return _0x570bfc;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 22f73d7..61488ec 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 _0xf9b2=['systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','username','userId','catch','message','toLowerCase','outbound','destcalleridnum','calleridnum','Bearer\x20','headers','odata-entityid','substring','enduserId','contacts?$select=telephone1','value','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','/systemusers(','Fields','/contacts(','callDirection','queue','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\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','lodash','bluebird','request-promise','util','md5','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','GET','4.0','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20'];(function(_0x3f9531,_0x860bae){var _0x529e01=function(_0x5c0385){while(--_0x5c0385){_0x3f9531['push'](_0x3f9531['shift']());}};_0x529e01(++_0x860bae);}(_0xf9b2,0x9a));var _0x2f9b=function(_0x1fc770,_0x3e4a33){_0x1fc770=_0x1fc770-0x0;var _0x2942ec=_0xf9b2[_0x1fc770];return _0x2942ec;};'use strict';var _=require(_0x2f9b('0x0'));var BPromise=require(_0x2f9b('0x1'));var rp=require(_0x2f9b('0x2'));var util=require(_0x2f9b('0x3'));var intUtil=require('./util');var md5=require(_0x2f9b('0x4'));var Redis=require('ioredis');var logger=require(_0x2f9b('0x5'))('dynamics365');var config=require('../../../../config/environment');config[_0x2f9b('0x6')]=_[_0x2f9b('0x7')](config[_0x2f9b('0x6')],{'host':_0x2f9b('0x8'),'port':0x18eb});var io=require(_0x2f9b('0x9'))(new Redis(config[_0x2f9b('0x6')]));function getAuthToken(_0xcf6aea,_0x4bf726,_0x21a47e){var _0x42be8c={'method':_0x2f9b('0xa'),'uri':_0x4bf726,'form':{'client_id':_0xcf6aea['clientId'],'resource':_0xcf6aea[_0x2f9b('0xb')],'username':_0xcf6aea['username'],'password':_0xcf6aea[_0x2f9b('0xc')],'grant_type':_0x2f9b('0xc'),'client_secret':_0xcf6aea[_0x2f9b('0xd')]},'json':!![]};return rp(_0x42be8c)[_0x2f9b('0xe')](function(_0x1d2e47){return _0x1d2e47[_0x2f9b('0xf')];})['catch'](function(_0x125517){logger[_0x2f9b('0x10')]('['+[_0x21a47e[_0x2f9b('0x11')]()]+_0x2f9b('0x12'));return _0x125517['message'];});}function getUser(_0x5873ad,_0x23cf2b,_0x47a95c,_0x195cd2,_0x398170,_0x542505){return new BPromise(function(_0x4a95d4,_0xab80f9){return getAuthToken(_0x23cf2b,_0x195cd2,_0x542505)[_0x2f9b('0xe')](function(_0xa1008d){var _0x40b1f7={'method':_0x2f9b('0x13'),'uri':_0x398170+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0xa1008d,'OData-Version':_0x2f9b('0x14')},'json':!![]};return rp(_0x40b1f7);})[_0x2f9b('0xe')](function(_0x48ebbe){var _0x2f141c=_0x48ebbe['value'];var _0x2c6b16=![];var _0x147ce4=null;if(!_['isNil'](_0x47a95c)){if(intUtil[_0x2f9b('0x15')](_0x47a95c[_0x2f9b('0x16')])){_0x5873ad[_0x2f9b('0x17')]=_0x47a95c[_0x2f9b('0x16')];for(_0x147ce4=0x0;_0x147ce4<_0x2f141c['length'];_0x147ce4++){if(_0x2f141c[_0x147ce4][_0x2f9b('0x18')]===_0x47a95c[_0x2f9b('0x16')]&&!_0x2f141c[_0x147ce4][_0x2f9b('0x19')]){_0x2c6b16=!![];logger[_0x2f9b('0x1a')]('['+[_0x542505['toUpperCase']()]+_0x2f9b('0x1b')+_0x2f141c[_0x147ce4][_0x2f9b('0x1c')]+'!');_0x5873ad['userId']=_0x2f141c[_0x147ce4][_0x2f9b('0x1c')];}}}}if(!_0x2c6b16){logger[_0x2f9b('0x1a')]('['+[_0x542505[_0x2f9b('0x11')]()]+_0x2f9b('0x1d'));_0x5873ad['userEmail']=_0x23cf2b['username'];for(_0x147ce4=0x0;_0x147ce4<_0x2f141c[_0x2f9b('0x1e')];_0x147ce4++){if(_0x2f141c[_0x147ce4][_0x2f9b('0x18')]===_0x23cf2b[_0x2f9b('0x1f')]){_0x5873ad[_0x2f9b('0x20')]=_0x2f141c[_0x147ce4][_0x2f9b('0x1c')];}}}_0x4a95d4(_0x5873ad);})[_0x2f9b('0x21')](function(_0x44f47b){_0xab80f9(_0x44f47b[_0x2f9b('0x22')]);});});}function createEndUser(_0x9613db,_0x416bc6,_0x1430be,_0x4d8daf,_0x280787,_0x4e4aaf){return new BPromise(function(_0x337df7,_0x48e933){return getAuthToken(_0x416bc6,_0x1430be,_0x4e4aaf)[_0x2f9b('0xe')](function(_0x138c5f){var _0x45dbde=_0x4e4aaf[_0x2f9b('0x23')]()===_0x2f9b('0x24')?_0x280787[_0x2f9b('0x25')]:_0x280787[_0x2f9b('0x26')];var _0xf43880={'method':'POST','uri':_0x4d8daf+'contacts','body':{'telephone1':_0x45dbde,'fullname':_0x45dbde,'firstname':_0x45dbde,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x9613db['userId']+')'},'headers':{'Authorization':_0x2f9b('0x27')+_0x138c5f,'OData-Version':_0x2f9b('0x14')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xf43880);})[_0x2f9b('0xe')](function(_0x178403){var _0x4da6c1=_0x178403[_0x2f9b('0x28')][_0x2f9b('0x29')];var _0x941524=_0x4da6c1[_0x2f9b('0x2a')](_0x4da6c1['lastIndexOf']('(')+0x1,_0x4da6c1['lastIndexOf'](')'));_0x9613db[_0x2f9b('0x2b')]=_0x941524;_0x337df7(_0x9613db);})[_0x2f9b('0x21')](function(_0x3c4c9a){_0x48e933(_0x3c4c9a[_0x2f9b('0x22')]);});});}function getEndUser(_0x3acfed,_0x27fefd,_0x5cb9ca,_0x9a5948,_0x22d1ca,_0x338a8d){return new BPromise(function(_0x5346e3,_0x68708c){return getAuthToken(_0x27fefd,_0x5cb9ca,_0x338a8d)[_0x2f9b('0xe')](function(_0x1bad52){var _0x887eb4={'method':'GET','uri':_0x9a5948+_0x2f9b('0x2c'),'headers':{'Authorization':_0x2f9b('0x27')+_0x1bad52,'If-None-Match':null,'OData-Version':_0x2f9b('0x14')},'json':!![]};return rp(_0x887eb4);})[_0x2f9b('0xe')](function(_0x19657e){var _0x1f1081=null;if(_0x19657e){var _0x50d131=_0x19657e[_0x2f9b('0x2d')];var _0x4c4ef4=![];for(_0x1f1081=0x0;_0x1f1081<_0x50d131[_0x2f9b('0x1e')];_0x1f1081++){var _0x38636e=_0x338a8d[_0x2f9b('0x23')]()===_0x2f9b('0x24')?_0x22d1ca[_0x2f9b('0x25')]:_0x22d1ca[_0x2f9b('0x26')];if(_0x50d131[_0x1f1081][_0x2f9b('0x2e')]===_0x38636e){_0x4c4ef4=!![];_0x3acfed[_0x2f9b('0x2b')]=_0x50d131[_0x1f1081]['contactid'];}}if(_0x4c4ef4){_0x5346e3(_0x3acfed);}else{return createEndUser(_0x3acfed,_0x27fefd,_0x5cb9ca,_0x9a5948,_0x22d1ca,_0x338a8d)['then'](function(_0x5e036d){logger[_0x2f9b('0x1a')]('['+[_0x338a8d[_0x2f9b('0x11')]()]+_0x2f9b('0x2f'),_0x5e036d[_0x2f9b('0x2b')]);_0x5346e3(_0x5e036d);});}}else{return createEndUser(_0x3acfed,_0x27fefd,_0x5cb9ca,_0x9a5948,_0x22d1ca,_0x338a8d)[_0x2f9b('0xe')](function(_0x9cfc86){logger['info']('['+[_0x338a8d[_0x2f9b('0x11')]()]+_0x2f9b('0x30'),_0x9cfc86[_0x2f9b('0x2b')]);_0x5346e3(_0x9cfc86);});}});});}function getCustomFields(_0x4fcd23,_0x408cdf,_0x4a7fe1){var _0x10a2b1={};if(_0x4fcd23['length']>0x0){_[_0x2f9b('0x31')](_0x4fcd23,function(_0x42f7d5){if(_[_0x2f9b('0x32')]([_0x2f9b('0x33'),_0x2f9b('0x34')],_0x42f7d5[_0x2f9b('0x35')])&&_0x42f7d5[_0x2f9b('0x36')]&&!_0x42f7d5[_0x2f9b('0x37')]){var _0x116ac2=_0x42f7d5['idField']['toLowerCase']();var _0x27a73e=_0x116ac2[_0x2f9b('0x2a')](0x0,_0x116ac2[_0x2f9b('0x38')]('_'));var _0x5c3d1b=_0x116ac2[_0x2f9b('0x2a')](_0x116ac2[_0x2f9b('0x38')]('_')+0x1);if(_0x27a73e===_0x4a7fe1){_0x10a2b1[_0x5c3d1b]=_0x42f7d5[_0x2f9b('0x39')];}}});}return _0x10a2b1;}function getTicket(_0x36c2ac,_0x313e3a,_0x559a73,_0x8d4dee,_0x61fc21,_0x32e705,_0x3a8c76){return new BPromise(function(_0x273322,_0x238414){var _0x3e32cc;return getAuthToken(_0x313e3a,_0x559a73,_0x3a8c76)[_0x2f9b('0xe')](function(_0x4c987b){if(_0x32e705[_0x2f9b('0x3a')]==='incident'){_0x3e32cc={'method':_0x2f9b('0xa'),'uri':_0x8d4dee+_0x2f9b('0x3b'),'body':Object[_0x2f9b('0x3c')]({},{'title':intUtil[_0x2f9b('0x3d')](_0x32e705[_0x2f9b('0x3e')],_0x61fc21,'\x20'),'description':intUtil[_0x2f9b('0x3d')](_0x32e705[_0x2f9b('0x3f')],_0x61fc21,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x36c2ac['enduserId']+')','ownerid@odata.bind':_0x2f9b('0x40')+_0x36c2ac[_0x2f9b('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x32e705[_0x2f9b('0x41')],_0x61fc21,_0x32e705[_0x2f9b('0x3a')])),'headers':{'Authorization':'Bearer\x20'+_0x4c987b,'OData-Version':_0x2f9b('0x14')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x32e705[_0x2f9b('0x3a')]==='phonecall'){_0x3e32cc={'method':_0x2f9b('0xa'),'uri':_0x8d4dee+'phonecalls','body':Object[_0x2f9b('0x3c')]({},{'subject':intUtil['getString'](_0x32e705[_0x2f9b('0x3e')],_0x61fc21,'\x20'),'phonenumber':String(_0x61fc21[_0x2f9b('0x26')]),'description':intUtil[_0x2f9b('0x3d')](_0x32e705[_0x2f9b('0x3f')],_0x61fc21,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2f9b('0x42')+_0x36c2ac[_0x2f9b('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0x36c2ac['userId']+')','directioncode':_0x36c2ac[_0x2f9b('0x43')]===_0x2f9b('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2f9b('0x40')+_0x36c2ac['userId']+')','participationtypemask':_0x36c2ac['callDirection']===_0x2f9b('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x2f9b('0x42')+_0x36c2ac[_0x2f9b('0x2b')]+')','participationtypemask':_0x36c2ac[_0x2f9b('0x43')]===_0x2f9b('0x44')?0x1:0x2}]},getCustomFields(_0x32e705[_0x2f9b('0x41')],_0x61fc21,_0x32e705['ticketType'])),'headers':{'Authorization':_0x2f9b('0x27')+_0x4c987b,'OData-Version':_0x2f9b('0x14')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3e32cc);})['then'](function(_0x709e5c){var _0x38b998=_0x709e5c[_0x2f9b('0x28')][_0x2f9b('0x29')];var _0x1a21ad=_0x38b998[_0x2f9b('0x2a')](_0x38b998[_0x2f9b('0x45')]('(')+0x1,_0x38b998[_0x2f9b('0x45')](')'));_0x36c2ac[_0x2f9b('0x46')]=_0x1a21ad;_0x273322(_0x36c2ac);})[_0x2f9b('0x21')](function(_0x442d35){_0x238414(_0x442d35[_0x2f9b('0x22')]);});});}function emit(_0x2f345e,_0x3ca010,_0x4b5165,_0x2f8099){var _0x497e18={'uri':util[_0x2f9b('0x47')](_0x2f9b('0x48'),_0x2f345e,_0x4b5165,_0x2f8099)};io['to'](util['format'](_0x2f9b('0x49'),_0x3ca010))['emit']('trigger:browser:url',_0x497e18);}exports['cs']=function(_0x1f89c3,_0x2e90e5,_0x38847d,_0x436711,_0x185678,_0x3f0355,_0x4e68b1,_0x5890e2){var _0x20c8c8={};_0x3f0355[_0x2f9b('0xb')]=intUtil['stripTrailingSlash'](_0x3f0355[_0x2f9b('0xb')]);_0x3f0355[_0x2f9b('0x4a')]=intUtil[_0x2f9b('0x4b')](_0x3f0355['serverUrl']);_0x20c8c8[_0x2f9b('0x43')]=_0x5890e2===_0x2f9b('0x44')||_0x5890e2===_0x2f9b('0x4c')?_0x2f9b('0x44'):'outbound';var _0x3283c9=util[_0x2f9b('0x47')](_0x2f9b('0x4d'),_0x3f0355[_0x2f9b('0xb')]);var _0x10fd05=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x3f0355['tenantId']);var _0x26eb44=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f0355[_0x2f9b('0x4a')],_0x2e90e5['uniqueid'],md5(_0x2e90e5['uniqueid']));if(_0x185678&&_0x185678[_0x2f9b('0x4e')]){logger['info'](_0x2f9b('0x4f'),'Recording\x20is\x20enabled!');_0x2e90e5[_0x2f9b('0x50')]=_0x26eb44;}else if(_0x4e68b1&&_0x4e68b1[_0x2f9b('0x51')]&&_0x4e68b1[_0x2f9b('0x51')]!==_0x2f9b('0x52')){logger[_0x2f9b('0x1a')]('[OUTBOUND]',_0x2f9b('0x53'));_0x2e90e5['recordingURL']=_0x26eb44;}else{_0x2e90e5[_0x2f9b('0x50')]='';}return getUser(_0x20c8c8,_0x3f0355,_0x436711,_0x10fd05,_0x3283c9,_0x5890e2)['then'](function(_0x96736f){logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x54'),_0x96736f[_0x2f9b('0x20')]);logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x55'),_0x96736f[_0x2f9b('0x17')]);return getEndUser(_0x96736f,_0x3f0355,_0x10fd05,_0x3283c9,_0x2e90e5,_0x5890e2);})[_0x2f9b('0xe')](function(_0x34d40f){logger[_0x2f9b('0x1a')]('['+_0x5890e2['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x34d40f[_0x2f9b('0x2b')]);logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x56'),_0x2e90e5[_0x2f9b('0x26')]);return getTicket(_0x34d40f,_0x3f0355,_0x10fd05,_0x3283c9,_0x2e90e5,_0x38847d,_0x5890e2);})['then'](function(_0x56d6ff){logger[_0x2f9b('0x1a')](util[_0x2f9b('0x47')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x57'),_0x38847d[_0x2f9b('0x3a')],_0x56d6ff[_0x2f9b('0x46')]));logger['info'](util[_0x2f9b('0x47')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x58'),_0x5890e2));if(_0x5890e2!=='unmanaged'){logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+']',_0x2f9b('0x59'));emit(_0x3f0355[_0x2f9b('0xb')],_0x436711['name'],_0x38847d[_0x2f9b('0x3a')],_0x56d6ff[_0x2f9b('0x46')]);}})[_0x2f9b('0x21')](function(_0x462f5e){logger[_0x2f9b('0x10')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x5a'),util['inspect'](_0x462f5e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe87e=[']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','picklist','nameField','indexOf','content','ticketType','incidents','assign','getString','Subjects','/contacts(','Fields','phonecalls','Descriptions','callDirection','queue','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name'];(function(_0x588a02,_0x2236d2){var _0x5893b7=function(_0x46adee){while(--_0x46adee){_0x588a02['push'](_0x588a02['shift']());}};_0x5893b7(++_0x2236d2);}(_0xe87e,0x17d));var _0xee87=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xe87e[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0xee87('0x0'));var BPromise=require(_0xee87('0x1'));var rp=require(_0xee87('0x2'));var util=require(_0xee87('0x3'));var intUtil=require(_0xee87('0x4'));var md5=require('md5');var Redis=require(_0xee87('0x5'));var logger=require(_0xee87('0x6'))(_0xee87('0x7'));var config=require(_0xee87('0x8'));config[_0xee87('0x9')]=_[_0xee87('0xa')](config[_0xee87('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xee87('0x9')]));function getAuthToken(_0x2ee165,_0x2fda67,_0x71d659){var _0x2d8349={'method':'POST','uri':_0x2fda67,'form':{'client_id':_0x2ee165[_0xee87('0xb')],'resource':_0x2ee165[_0xee87('0xc')],'username':_0x2ee165[_0xee87('0xd')],'password':_0x2ee165[_0xee87('0xe')],'grant_type':'password','client_secret':_0x2ee165[_0xee87('0xf')]},'json':!![]};return rp(_0x2d8349)[_0xee87('0x10')](function(_0x507b28){return _0x507b28[_0xee87('0x11')];})[_0xee87('0x12')](function(_0x3eb1ce){logger[_0xee87('0x13')]('['+[_0x71d659[_0xee87('0x14')]()]+_0xee87('0x15'));return _0x3eb1ce[_0xee87('0x16')];});}function getUser(_0x129b04,_0x5f4c4c,_0x24cd1c,_0x2377a7,_0x49df11,_0x4be77d){return new BPromise(function(_0x37780f,_0x1d082a){return getAuthToken(_0x5f4c4c,_0x2377a7,_0x4be77d)['then'](function(_0x420526){var _0x35d1c7={'method':_0xee87('0x17'),'uri':_0x49df11+_0xee87('0x18'),'headers':{'Authorization':'Bearer\x20'+_0x420526,'OData-Version':_0xee87('0x19')},'json':!![]};return rp(_0x35d1c7);})['then'](function(_0x2f7ad3){var _0x305924=_0x2f7ad3[_0xee87('0x1a')];var _0x5f378c=![];var _0x48a330=null;if(!_[_0xee87('0x1b')](_0x24cd1c)){if(intUtil[_0xee87('0x1c')](_0x24cd1c[_0xee87('0x1d')])){_0x129b04['userEmail']=_0x24cd1c[_0xee87('0x1d')];for(_0x48a330=0x0;_0x48a330<_0x305924[_0xee87('0x1e')];_0x48a330++){if(_0x305924[_0x48a330][_0xee87('0x1f')]===_0x24cd1c[_0xee87('0x1d')]&&!_0x305924[_0x48a330][_0xee87('0x20')]){_0x5f378c=!![];logger[_0xee87('0x21')]('['+[_0x4be77d[_0xee87('0x14')]()]+']\x20Agent\x20found\x20'+_0x305924[_0x48a330][_0xee87('0x22')]+'!');_0x129b04[_0xee87('0x23')]=_0x305924[_0x48a330][_0xee87('0x22')];}}}}if(!_0x5f378c){logger[_0xee87('0x21')]('['+[_0x4be77d[_0xee87('0x14')]()]+_0xee87('0x24'));_0x129b04[_0xee87('0x25')]=_0x5f4c4c[_0xee87('0xd')];for(_0x48a330=0x0;_0x48a330<_0x305924[_0xee87('0x1e')];_0x48a330++){if(_0x305924[_0x48a330]['internalemailaddress']===_0x5f4c4c['username']){_0x129b04[_0xee87('0x23')]=_0x305924[_0x48a330][_0xee87('0x22')];}}}_0x37780f(_0x129b04);})['catch'](function(_0x25ca5f){_0x1d082a(_0x25ca5f[_0xee87('0x16')]);});});}function createEndUser(_0x36a651,_0x55236e,_0x4f5c11,_0x18dd0d,_0x48fe19,_0x36e381){return new BPromise(function(_0x49bf41,_0x2d2bae){return getAuthToken(_0x55236e,_0x4f5c11,_0x36e381)[_0xee87('0x10')](function(_0x47d9dc){var _0x22caf5=_0x36e381[_0xee87('0x26')]()===_0xee87('0x27')?_0x48fe19[_0xee87('0x28')]:_0x48fe19[_0xee87('0x29')];var _0x5ac56a={'method':_0xee87('0x2a'),'uri':_0x18dd0d+_0xee87('0x2b'),'body':{'telephone1':_0x22caf5,'fullname':_0x22caf5,'firstname':_0x22caf5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xee87('0x2c')+_0x36a651[_0xee87('0x23')]+')'},'headers':{'Authorization':_0xee87('0x2d')+_0x47d9dc,'OData-Version':_0xee87('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5ac56a);})[_0xee87('0x10')](function(_0x5bbd08){var _0x301651=_0x5bbd08[_0xee87('0x2e')][_0xee87('0x2f')];var _0x163a5a=_0x301651[_0xee87('0x30')](_0x301651[_0xee87('0x31')]('(')+0x1,_0x301651[_0xee87('0x31')](')'));_0x36a651[_0xee87('0x32')]=_0x163a5a;_0x49bf41(_0x36a651);})[_0xee87('0x12')](function(_0x49e1ab){_0x2d2bae(_0x49e1ab['message']);});});}function getEndUser(_0x15cd09,_0x4dded0,_0xaae890,_0x15130d,_0x26f8c7,_0x1cd421){return new BPromise(function(_0x84d70a,_0x1aab67){return getAuthToken(_0x4dded0,_0xaae890,_0x1cd421)['then'](function(_0x51a3da){var _0x403dcc={'method':'GET','uri':_0x15130d+'contacts?$select=telephone1','headers':{'Authorization':_0xee87('0x2d')+_0x51a3da,'If-None-Match':null,'OData-Version':_0xee87('0x19')},'json':!![]};return rp(_0x403dcc);})[_0xee87('0x10')](function(_0x5746e7){var _0x27420a=null;if(_0x5746e7){var _0x1502fc=_0x5746e7[_0xee87('0x1a')];var _0x11b7ef=![];for(_0x27420a=0x0;_0x27420a<_0x1502fc['length'];_0x27420a++){var _0x136f0d=_0x1cd421[_0xee87('0x26')]()===_0xee87('0x27')?_0x26f8c7['destcalleridnum']:_0x26f8c7[_0xee87('0x29')];if(_0x1502fc[_0x27420a][_0xee87('0x33')]===_0x136f0d){_0x11b7ef=!![];_0x15cd09[_0xee87('0x32')]=_0x1502fc[_0x27420a][_0xee87('0x34')];}}if(_0x11b7ef){_0x84d70a(_0x15cd09);}else{return createEndUser(_0x15cd09,_0x4dded0,_0xaae890,_0x15130d,_0x26f8c7,_0x1cd421)['then'](function(_0x44b1d7){logger['info']('['+[_0x1cd421[_0xee87('0x14')]()]+_0xee87('0x35'),_0x44b1d7[_0xee87('0x32')]);_0x84d70a(_0x44b1d7);});}}else{return createEndUser(_0x15cd09,_0x4dded0,_0xaae890,_0x15130d,_0x26f8c7,_0x1cd421)['then'](function(_0x1f6575){logger[_0xee87('0x21')]('['+[_0x1cd421[_0xee87('0x14')]()]+_0xee87('0x36'),_0x1f6575[_0xee87('0x32')]);_0x84d70a(_0x1f6575);});}});});}function getCustomFields(_0x203e0a,_0x51f56a,_0x17e8ff){var _0xd39cd2={};if(_0x203e0a['length']>0x0){_[_0xee87('0x37')](_0x203e0a,function(_0x468aff){if(_['includes']([_0xee87('0x38'),_0xee87('0x39')],_0x468aff['type'])&&_0x468aff[_0xee87('0x3a')]&&!_0x468aff['customField']){var _0x33deba=_0x468aff['idField'][_0xee87('0x26')]();var _0x40f88e=_0x33deba[_0xee87('0x30')](0x0,_0x33deba[_0xee87('0x3b')]('_'));var _0x4eadab=_0x33deba[_0xee87('0x30')](_0x33deba['indexOf']('_')+0x1);if(_0x40f88e===_0x17e8ff){_0xd39cd2[_0x4eadab]=_0x468aff[_0xee87('0x3c')];}}});}return _0xd39cd2;}function getTicket(_0xd6952b,_0x5a7786,_0x1652a3,_0x3fd9d4,_0x59362b,_0x203911,_0x895440){return new BPromise(function(_0xe503e9,_0x2abf70){var _0x4eb562;return getAuthToken(_0x5a7786,_0x1652a3,_0x895440)[_0xee87('0x10')](function(_0x14d8fa){if(_0x203911[_0xee87('0x3d')]==='incident'){_0x4eb562={'method':_0xee87('0x2a'),'uri':_0x3fd9d4+_0xee87('0x3e'),'body':Object[_0xee87('0x3f')]({},{'title':intUtil[_0xee87('0x40')](_0x203911[_0xee87('0x41')],_0x59362b,'\x20'),'description':intUtil[_0xee87('0x40')](_0x203911['Descriptions'],_0x59362b,'\x0a'),'customerid_contact@odata.bind':_0xee87('0x42')+_0xd6952b[_0xee87('0x32')]+')','ownerid@odata.bind':_0xee87('0x2c')+_0xd6952b[_0xee87('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x203911[_0xee87('0x43')],_0x59362b,_0x203911[_0xee87('0x3d')])),'headers':{'Authorization':'Bearer\x20'+_0x14d8fa,'OData-Version':_0xee87('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x203911[_0xee87('0x3d')]==='phonecall'){_0x4eb562={'method':_0xee87('0x2a'),'uri':_0x3fd9d4+_0xee87('0x44'),'body':Object[_0xee87('0x3f')]({},{'subject':intUtil[_0xee87('0x40')](_0x203911[_0xee87('0x41')],_0x59362b,'\x20'),'phonenumber':String(_0x59362b['calleridnum']),'description':intUtil[_0xee87('0x40')](_0x203911[_0xee87('0x45')],_0x59362b,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0xd6952b[_0xee87('0x32')]+')','ownerid@odata.bind':_0xee87('0x2c')+_0xd6952b[_0xee87('0x23')]+')','directioncode':_0xd6952b[_0xee87('0x46')]===_0xee87('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xee87('0x2c')+_0xd6952b['userId']+')','participationtypemask':_0xd6952b[_0xee87('0x46')]===_0xee87('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xee87('0x42')+_0xd6952b['enduserId']+')','participationtypemask':_0xd6952b[_0xee87('0x46')]===_0xee87('0x47')?0x1:0x2}]},getCustomFields(_0x203911['Fields'],_0x59362b,_0x203911[_0xee87('0x3d')])),'headers':{'Authorization':_0xee87('0x2d')+_0x14d8fa,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4eb562);})[_0xee87('0x10')](function(_0x4be789){var _0x352bc3=_0x4be789[_0xee87('0x2e')][_0xee87('0x2f')];var _0x18c605=_0x352bc3[_0xee87('0x30')](_0x352bc3[_0xee87('0x31')]('(')+0x1,_0x352bc3[_0xee87('0x31')](')'));_0xd6952b['ticketId']=_0x18c605;_0xe503e9(_0xd6952b);})[_0xee87('0x12')](function(_0x373e1b){_0x2abf70(_0x373e1b['message']);});});}function emit(_0x40f9df,_0x10d307,_0x5dc4e3,_0x1f6511){var _0x25e473={'uri':util['format'](_0xee87('0x48'),_0x40f9df,_0x5dc4e3,_0x1f6511)};io['to'](util[_0xee87('0x49')](_0xee87('0x4a'),_0x10d307))['emit'](_0xee87('0x4b'),_0x25e473);}exports['cs']=function(_0x38d811,_0x40f68e,_0x3e3a13,_0x1fe2b5,_0x4b4ca0,_0x4581c6,_0x4f22ea,_0x2217d0){var _0x1a8856={};_0x4581c6[_0xee87('0xc')]=intUtil[_0xee87('0x4c')](_0x4581c6['remoteUri']);_0x4581c6[_0xee87('0x4d')]=intUtil['stripTrailingSlash'](_0x4581c6[_0xee87('0x4d')]);_0x1a8856['callDirection']=_0x2217d0==='queue'||_0x2217d0==='unmanaged'?_0xee87('0x47'):_0xee87('0x27');var _0x387395=util[_0xee87('0x49')](_0xee87('0x4e'),_0x4581c6[_0xee87('0xc')]);var _0x275c45=util[_0xee87('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x4581c6['tenantId']);var _0x561b62=util[_0xee87('0x49')](_0xee87('0x4f'),_0x4581c6[_0xee87('0x4d')],_0x40f68e['uniqueid'],md5(_0x40f68e[_0xee87('0x50')]));if(_0x4b4ca0&&_0x4b4ca0[_0xee87('0x51')]){logger[_0xee87('0x21')](_0xee87('0x52'),'Recording\x20is\x20enabled!');_0x40f68e[_0xee87('0x53')]=_0x561b62;}else if(_0x4f22ea&&_0x4f22ea[_0xee87('0x54')]&&_0x4f22ea[_0xee87('0x54')]!==_0xee87('0x55')){logger[_0xee87('0x21')](_0xee87('0x56'),'Recording\x20is\x20enabled!');_0x40f68e[_0xee87('0x53')]=_0x561b62;}else{_0x40f68e[_0xee87('0x53')]='';}return getUser(_0x1a8856,_0x4581c6,_0x1fe2b5,_0x275c45,_0x387395,_0x2217d0)[_0xee87('0x10')](function(_0xbb7bce){logger['info']('['+_0x2217d0[_0xee87('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0xbb7bce[_0xee87('0x23')]);logger[_0xee87('0x21')]('['+_0x2217d0[_0xee87('0x14')]()+_0xee87('0x57'),_0xbb7bce['userEmail']);return getEndUser(_0xbb7bce,_0x4581c6,_0x275c45,_0x387395,_0x40f68e,_0x2217d0);})['then'](function(_0x342a8b){logger[_0xee87('0x21')]('['+_0x2217d0['toUpperCase']()+_0xee87('0x58'),_0x342a8b[_0xee87('0x32')]);logger[_0xee87('0x21')]('['+_0x2217d0[_0xee87('0x14')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x40f68e['calleridnum']);return getTicket(_0x342a8b,_0x4581c6,_0x275c45,_0x387395,_0x40f68e,_0x3e3a13,_0x2217d0);})[_0xee87('0x10')](function(_0x1f0827){logger[_0xee87('0x21')](util[_0xee87('0x49')]('['+_0x2217d0[_0xee87('0x14')]()+_0xee87('0x59'),_0x3e3a13[_0xee87('0x3d')],_0x1f0827[_0xee87('0x5a')]));logger[_0xee87('0x21')](util[_0xee87('0x49')]('['+_0x2217d0[_0xee87('0x14')]()+_0xee87('0x5b'),_0x2217d0));if(_0x2217d0!=='unmanaged'){logger[_0xee87('0x21')]('['+_0x2217d0['toUpperCase']()+']',_0xee87('0x5c'));emit(_0x4581c6[_0xee87('0xc')],_0x1fe2b5[_0xee87('0x5d')],_0x3e3a13[_0xee87('0x3d')],_0x1f0827[_0xee87('0x5a')]);}})[_0xee87('0x12')](function(_0x1a5f33){logger[_0xee87('0x13')]('['+_0x2217d0[_0xee87('0x14')]()+_0xee87('0x5e'),util['inspect'](_0x1a5f33,{'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 d988e4f..8c8cd84 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 _0x186a=['Caller\x20-\x20%s','calleridname','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','format','remoteUri','then','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','map','forEach','includes','picklist','type','nameField','content','string','idField','push','variable','variableName','customField','customVariable','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','%s/helpdesk/tickets/%d','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge'];(function(_0xc5009e,_0x1e92e8){var _0x513c9b=function(_0x294031){while(--_0x294031){_0xc5009e['push'](_0xc5009e['shift']());}};_0x513c9b(++_0x1e92e8);}(_0x186a,0x1d5));var _0xa186=function(_0x5a4408,_0x5892bc){_0x5a4408=_0x5a4408-0x0;var _0x4a998c=_0x186a[_0x5a4408];return _0x4a998c;};'use strict';var _=require(_0xa186('0x0'));var rp=require(_0xa186('0x1'));var md5=require(_0xa186('0x2'));var util=require('util');var Redis=require(_0xa186('0x3'));var intUtil=require(_0xa186('0x4'));var config=require(_0xa186('0x5'));var logger=require(_0xa186('0x6'))(_0xa186('0x7'));config[_0xa186('0x8')]=_[_0xa186('0x9')](config['redis'],{'host':_0xa186('0xa'),'port':0x18eb});var io=require(_0xa186('0xb'))(new Redis(config[_0xa186('0x8')]));var headers={'Content-Type':_0xa186('0xc'),'Accept':_0xa186('0xc')};function emit(_0x39ca55,_0x3977ac,_0x33d3af){io['to'](_0x39ca55)['emit'](_0x3977ac,_0x33d3af);}function getTicket(_0xe515f2,_0x3b597d,_0x5ce593,_0x14378d,_0x5251d9){logger[_0xa186('0xd')](_0xa186('0xe'));var _0x28cb00=_[_0xa186('0xf')]({'responder_id':_0x3b597d['id'],'requester_id':_0x5ce593['id'],'name':util['format'](_0xa186('0x10'),_0x5251d9[_0xa186('0x11')]),'phone':_0x5251d9['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa186('0x12')](_0x14378d['Subjects'],_0x5251d9,'\x20'),'description':intUtil[_0xa186('0x12')](_0x14378d[_0xa186('0x13')],_0x5251d9,_0xa186('0x14')),'tags':getTags(_0x14378d[_0xa186('0x15')],'name')},getCustomFields(_0x14378d[_0xa186('0x16')],_0x5251d9));_0x28cb00[_0xa186('0x17')]=_[_0xa186('0x18')](_[_0xa186('0x19')](_0x28cb00[_0xa186('0x17')],'id'),_0xa186('0x1a'));return request({'uri':util[_0xa186('0x1b')]('%s/api/v2/tickets',_0xe515f2[_0xa186('0x1c')]),'method':'POST','body':_0x28cb00})[_0xa186('0x1d')](function(_0x1082b6){logger[_0xa186('0xd')](_0xa186('0x1e'));return _0x1082b6;});}function getUser(_0x194f74,_0x33242f){if(intUtil[_0xa186('0x1f')](_0x33242f)){return request({'uri':util[_0xa186('0x1b')]('%s/api/v2/agents',_0x194f74[_0xa186('0x1c')]),'qs':{'email':_0x33242f}})[_0xa186('0x1d')](function(_0x358898){if(_0x358898['length']){logger['info'](_0xa186('0x20'));return _[_0xa186('0x21')](_0x358898,function(_0x47fbb2){return _0x47fbb2[_0xa186('0x22')][_0xa186('0x23')]===_0x33242f;});}else{logger[_0xa186('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa186('0x1b')](_0xa186('0x24'),_0x194f74[_0xa186('0x1c')])})['then'](function(_0x49e598){logger[_0xa186('0xd')](_0xa186('0x25'));return _0x49e598;});}});}else{logger['info'](_0xa186('0x26'));return request({'uri':util[_0xa186('0x1b')](_0xa186('0x24'),_0x194f74[_0xa186('0x1c')])})[_0xa186('0x1d')](function(_0x1792d6){logger['info'](_0xa186('0x25'));return _0x1792d6;});}}function getEndUser(_0x4cd894,_0x88c728,_0x148568){logger[_0xa186('0xd')](_0xa186('0x27'),_0x148568);return request({'uri':util[_0xa186('0x1b')](_0xa186('0x28'),_0x4cd894[_0xa186('0x1c')]),'qs':{'phone':_0x148568}})['then'](function(_0x55fd7a){if(_0x55fd7a[_0xa186('0x29')]){logger[_0xa186('0xd')](_0xa186('0x2a'));return _['find'](_0x55fd7a,{'phone':_0x148568});}else{logger['info'](_0xa186('0x2b'));return request({'uri':util[_0xa186('0x1b')](_0xa186('0x28'),_0x4cd894[_0xa186('0x1c')]),'method':_0xa186('0x2c'),'body':{'name':_0x88c728,'phone':_0x148568}})['then'](function(_0x733c0a){logger[_0xa186('0xd')](_0xa186('0x2d'));return _0x733c0a;});}});}function getAuth(_0x38765b){return util[_0xa186('0x1b')](_0xa186('0x2e'),new Buffer(_0x38765b[_0xa186('0x2f')]+':X')[_0xa186('0x30')](_0xa186('0x31')));}function request(_0x3ea86f){logger[_0xa186('0x32')](_0xa186('0x33'),JSON[_0xa186('0x34')](_0x3ea86f));return rp(_[_0xa186('0x9')](_0x3ea86f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x71a9fd,_0x33ae3e){var _0x5072a3=[];if(_0x71a9fd&&_0x71a9fd['length']>0x0){_0x5072a3=_[_0xa186('0x35')](_0x71a9fd,_0x33ae3e);}return _0x5072a3;}function getCustomFields(_0x1d4a33,_0x17e6ff){var _0x39f8ee=[];var _0x5d3a08={'custom_fields':[]};if(_0x1d4a33[_0xa186('0x29')]>0x0){_[_0xa186('0x36')](_0x1d4a33,function(_0xb2fb7d){if(_[_0xa186('0x37')](['string',_0xa186('0x38')],_0xb2fb7d[_0xa186('0x39')])&&_0xb2fb7d[_0xa186('0x3a')]&&!_0xb2fb7d['customField']){_0x5d3a08[_0xb2fb7d[_0xa186('0x3a')]['toLowerCase']()]=_0xb2fb7d[_0xa186('0x3b')][_0xa186('0x30')]();}else if(_[_0xa186('0x37')]([_0xa186('0x3c'),_0xa186('0x38')],_0xb2fb7d[_0xa186('0x39')])&&_0xb2fb7d[_0xa186('0x3d')]&&_0xb2fb7d['customField']){_0x5d3a08[_0xa186('0x17')][_0xa186('0x3e')]({'id':_0xb2fb7d[_0xa186('0x3d')],'value':_0xb2fb7d[_0xa186('0x3b')][_0xa186('0x30')]()});}else if(_0xb2fb7d[_0xa186('0x39')]===_0xa186('0x3f')&&_0xb2fb7d[_0xa186('0x40')]&&_0xb2fb7d[_0xa186('0x3d')]&&_0xb2fb7d[_0xa186('0x41')]){_0x17e6ff[_0xb2fb7d[_0xa186('0x40')]]&&_0x5d3a08[_0xa186('0x17')][_0xa186('0x3e')]({'id':_0xb2fb7d[_0xa186('0x3d')],'value':_0x17e6ff[_0xb2fb7d[_0xa186('0x40')]][_0xa186('0x30')]()});}else if(_0xb2fb7d[_0xa186('0x39')]===_0xa186('0x42')&&_0xb2fb7d[_0xa186('0x43')]&&_0xb2fb7d[_0xa186('0x43')][_0xa186('0x44')]&&_0xb2fb7d['idField']&&_0xb2fb7d[_0xa186('0x41')]){_0x17e6ff[_0xb2fb7d[_0xa186('0x43')][_0xa186('0x44')][_0xa186('0x45')]()]&&_0x5d3a08['custom_fields']['push']({'id':_0xb2fb7d[_0xa186('0x3d')],'value':_0x17e6ff[_0xb2fb7d['Variable'][_0xa186('0x44')][_0xa186('0x45')]()]['toString']()});}});}return _0x5d3a08;}exports[_0xa186('0x46')]=function(_0x3f72c2,_0x10b12b,_0x35ea90,_0x8397da,_0x1b13dd,_0x6e1f4e){var _0x3831da,_0xf196ab;_0x6e1f4e[_0xa186('0x1c')]=intUtil['stripTrailingSlash'](_0x6e1f4e[_0xa186('0x1c')]);_0x6e1f4e[_0xa186('0x47')]=intUtil[_0xa186('0x48')](_0x6e1f4e['serverUrl']);if(_0x1b13dd&&_0x1b13dd[_0xa186('0x49')]){logger[_0xa186('0xd')](_0xa186('0x4a'),'Recording\x20is\x20enabled!');_0x10b12b[_0xa186('0x4b')]=util[_0xa186('0x1b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6e1f4e[_0xa186('0x47')],_0x10b12b[_0xa186('0x4c')],md5(_0x10b12b['uniqueid']));}else{_0x10b12b[_0xa186('0x4b')]='';}headers['Authorization']=getAuth(_0x6e1f4e);return getUser(_0x6e1f4e,_0x8397da[_0xa186('0x23')])[_0xa186('0x1d')](function(_0x4b3184){_0x3831da=_0x4b3184;logger[_0xa186('0xd')](_0xa186('0x4d'),_0x3831da['id']);return getEndUser(_0x6e1f4e,_0x10b12b[_0xa186('0x11')],_0x10b12b[_0xa186('0x4e')]);})[_0xa186('0x1d')](function(_0x1f4cac){_0xf196ab=_0x1f4cac;logger[_0xa186('0xd')](_0xa186('0x4f'),_0xf196ab['id']);return getTicket(_0x6e1f4e,_0x3831da,_0xf196ab,_0x35ea90,_0x10b12b);})[_0xa186('0x1d')](function(_0x2ae8e4){if(_0x2ae8e4&&_0x2ae8e4['id']){logger[_0xa186('0xd')](_0xa186('0x1e'));logger[_0xa186('0xd')](_0xa186('0x50'),_0x2ae8e4['id']);logger['info'](_0xa186('0x4a'),_0xa186('0x51'));emit(util[_0xa186('0x1b')](_0xa186('0x52'),_0x8397da[_0xa186('0x44')]),_0xa186('0x53'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x6e1f4e['remoteUri'],_0x2ae8e4['id'])});}})[_0xa186('0x54')](function(_0x498998){logger[_0xa186('0x55')]('[QUEUE]',JSON[_0xa186('0x34')](_0x498998));});};exports[_0xa186('0x56')]=function(_0x160ae7,_0x321b8f,_0x5c8e0b,_0x3bc358,_0x16d85b,_0x1d7905,_0x2ce7e2){var _0x2a484a,_0x4c2687;_0x1d7905['remoteUri']=intUtil[_0xa186('0x48')](_0x1d7905['remoteUri']);_0x1d7905['serverUrl']=intUtil[_0xa186('0x48')](_0x1d7905[_0xa186('0x47')]);if(_0x2ce7e2&&_0x2ce7e2[_0xa186('0x57')]&&_0x2ce7e2['recordingFormat']!==_0xa186('0x58')){logger['info']('[OUTBOUND]',_0xa186('0x59'));_0x321b8f[_0xa186('0x4b')]=util[_0xa186('0x1b')](_0xa186('0x5a'),_0x1d7905['serverUrl'],_0x321b8f[_0xa186('0x4c')],md5(_0x321b8f[_0xa186('0x4c')]));}headers[_0xa186('0x5b')]=getAuth(_0x1d7905);return getUser(_0x1d7905,_0x3bc358[_0xa186('0x23')])[_0xa186('0x1d')](function(_0x5256ae){_0x2a484a=_0x5256ae;logger[_0xa186('0xd')](_0xa186('0x4d'),_0x2a484a['id']);return getEndUser(_0x1d7905,_0x321b8f[_0xa186('0x5c')],_0x321b8f['destcalleridnum']);})[_0xa186('0x1d')](function(_0x1c354f){_0x4c2687=_0x1c354f;logger['info'](_0xa186('0x4f'),_0x4c2687['id']);return getTicket(_0x1d7905,_0x2a484a,_0x4c2687,_0x5c8e0b,_0x321b8f);})[_0xa186('0x1d')](function(_0x152040){if(_0x152040&&_0x152040['id']){logger[_0xa186('0xd')](_0xa186('0x1e'));logger[_0xa186('0xd')](_0xa186('0x50'),_0x152040['id']);logger[_0xa186('0xd')]('[OUTBOUND]',_0xa186('0x51'));emit(util['format']('user:%s',_0x3bc358[_0xa186('0x44')]),_0xa186('0x53'),{'uri':util[_0xa186('0x1b')](_0xa186('0x5d'),_0x1d7905['remoteUri'],_0x152040['id'])});}})['catch'](function(_0x4b2217){logger[_0xa186('0x55')]('[OUTBOUND]',JSON[_0xa186('0x34')](_0x4b2217));});};exports[_0xa186('0x5e')]=function(_0x560c40,_0x37e395,_0x45cac5,_0x3a8513,_0x2e2bf2,_0x2797af){var _0x4471e7,_0x24146b;_0x2797af[_0xa186('0x1c')]=intUtil[_0xa186('0x48')](_0x2797af[_0xa186('0x1c')]);_0x2797af[_0xa186('0x47')]=intUtil[_0xa186('0x48')](_0x2797af[_0xa186('0x47')]);if(_0x2e2bf2&&_0x2e2bf2[_0xa186('0x49')]){logger[_0xa186('0xd')]('['+_0x37e395['lastevent'][_0xa186('0x5f')]()+']',_0xa186('0x59'));_0x37e395[_0xa186('0x4b')]=util[_0xa186('0x1b')](_0xa186('0x5a'),_0x2797af[_0xa186('0x47')],_0x37e395[_0xa186('0x4c')],md5(_0x37e395[_0xa186('0x4c')]));}else{_0x37e395['recordingURL']='';}headers[_0xa186('0x5b')]=getAuth(_0x2797af);return getUser(_0x2797af,'')[_0xa186('0x1d')](function(_0x3616f2){_0x4471e7=_0x3616f2;logger[_0xa186('0xd')](_0xa186('0x4d'),_0x4471e7['id']);return getEndUser(_0x2797af,_0x37e395[_0xa186('0x11')],_0x37e395[_0xa186('0x4e')]);})[_0xa186('0x1d')](function(_0x4c7dcd){_0x24146b=_0x4c7dcd;logger['info']('The\x20Enduser\x20ID\x20is:',_0x24146b['id']);return getTicket(_0x2797af,_0x4471e7,_0x24146b,_0x45cac5,_0x37e395);})['then'](function(_0x2b609a){if(_0x2b609a){logger['info'](_0xa186('0x1e'));logger['info'](_0xa186('0x50'),_0x2b609a['id']);}})[_0xa186('0x54')](function(_0x5279c0){logger['error']('['+_0x37e395[_0xa186('0x60')][_0xa186('0x5f')]()+']',JSON[_0xa186('0x34')](_0x5279c0));});}; \ No newline at end of file +var _0x8b03=['Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','base64','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','push','toString','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','lastevent','toUpperCase','error','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','then','length','info','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8b03,0xee));var _0x38b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b03[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x38b0('0x0'));var rp=require(_0x38b0('0x1'));var md5=require(_0x38b0('0x2'));var util=require(_0x38b0('0x3'));var Redis=require(_0x38b0('0x4'));var intUtil=require(_0x38b0('0x5'));var config=require(_0x38b0('0x6'));var logger=require(_0x38b0('0x7'))(_0x38b0('0x8'));config[_0x38b0('0x9')]=_[_0x38b0('0xa')](config['redis'],{'host':_0x38b0('0xb'),'port':0x18eb});var io=require(_0x38b0('0xc'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0x38b0('0xd')};function emit(_0x47990b,_0x31b1d1,_0x29e4ee){io['to'](_0x47990b)[_0x38b0('0xe')](_0x31b1d1,_0x29e4ee);}function getTicket(_0x1d4650,_0x532591,_0x19962a,_0x7886ae,_0x5c23af){logger['info'](_0x38b0('0xf'));var _0x1cabb6=_[_0x38b0('0x10')]({'responder_id':_0x532591['id'],'requester_id':_0x19962a['id'],'name':util[_0x38b0('0x11')](_0x38b0('0x12'),_0x5c23af[_0x38b0('0x13')]),'phone':_0x5c23af[_0x38b0('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x7886ae['Subjects'],_0x5c23af,'\x20'),'description':intUtil[_0x38b0('0x15')](_0x7886ae[_0x38b0('0x16')],_0x5c23af,_0x38b0('0x17')),'tags':getTags(_0x7886ae[_0x38b0('0x18')],_0x38b0('0x19'))},getCustomFields(_0x7886ae[_0x38b0('0x1a')],_0x5c23af));_0x1cabb6[_0x38b0('0x1b')]=_[_0x38b0('0x1c')](_[_0x38b0('0x1d')](_0x1cabb6[_0x38b0('0x1b')],'id'),'value');return request({'uri':util[_0x38b0('0x11')](_0x38b0('0x1e'),_0x1d4650[_0x38b0('0x1f')]),'method':_0x38b0('0x20'),'body':_0x1cabb6})['then'](function(_0x1cdb89){logger['info'](_0x38b0('0x21'));return _0x1cdb89;});}function getUser(_0x2689ba,_0x4a957d){if(intUtil[_0x38b0('0x22')](_0x4a957d)){return request({'uri':util[_0x38b0('0x11')]('%s/api/v2/agents',_0x2689ba['remoteUri']),'qs':{'email':_0x4a957d}})[_0x38b0('0x23')](function(_0x4e1b22){if(_0x4e1b22[_0x38b0('0x24')]){logger[_0x38b0('0x25')](_0x38b0('0x26'));return _[_0x38b0('0x27')](_0x4e1b22,function(_0x579796){return _0x579796[_0x38b0('0x28')][_0x38b0('0x29')]===_0x4a957d;});}else{logger[_0x38b0('0x25')](_0x38b0('0x2a'));return request({'uri':util[_0x38b0('0x11')](_0x38b0('0x2b'),_0x2689ba[_0x38b0('0x1f')])})[_0x38b0('0x23')](function(_0x1431a5){logger[_0x38b0('0x25')]('Admin\x20account\x20selected.');return _0x1431a5;});}});}else{logger['info'](_0x38b0('0x2c'));return request({'uri':util[_0x38b0('0x11')](_0x38b0('0x2b'),_0x2689ba[_0x38b0('0x1f')])})['then'](function(_0x40e379){logger[_0x38b0('0x25')](_0x38b0('0x2d'));return _0x40e379;});}}function getEndUser(_0x38e91f,_0x546d39,_0x4ae9ae){logger[_0x38b0('0x25')]('Searching\x20enduser\x20with\x20phone',_0x4ae9ae);return request({'uri':util[_0x38b0('0x11')](_0x38b0('0x2e'),_0x38e91f[_0x38b0('0x1f')]),'qs':{'phone':_0x4ae9ae}})[_0x38b0('0x23')](function(_0x2abcae){if(_0x2abcae['length']){logger[_0x38b0('0x25')](_0x38b0('0x2f'));return _[_0x38b0('0x27')](_0x2abcae,{'phone':_0x4ae9ae});}else{logger[_0x38b0('0x25')](_0x38b0('0x30'));return request({'uri':util[_0x38b0('0x11')](_0x38b0('0x2e'),_0x38e91f[_0x38b0('0x1f')]),'method':_0x38b0('0x20'),'body':{'name':_0x546d39,'phone':_0x4ae9ae}})[_0x38b0('0x23')](function(_0x2f5918){logger[_0x38b0('0x25')]('Enduser\x20created.');return _0x2f5918;});}});}function getAuth(_0x58cac5){return util[_0x38b0('0x11')]('Basic\x20%s',new Buffer(_0x58cac5['apiKey']+':X')['toString'](_0x38b0('0x31')));}function request(_0x21db20){logger['debug']('[HTTP]',JSON[_0x38b0('0x32')](_0x21db20));return rp(_['defaults'](_0x21db20,{'method':_0x38b0('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x49cd0f,_0x2c0b36){var _0x5306fa=[];if(_0x49cd0f&&_0x49cd0f['length']>0x0){_0x5306fa=_[_0x38b0('0x34')](_0x49cd0f,_0x2c0b36);}return _0x5306fa;}function getCustomFields(_0x2af23d,_0x3aa3e8){var _0x1e7780=[];var _0x4f2691={'custom_fields':[]};if(_0x2af23d['length']>0x0){_[_0x38b0('0x35')](_0x2af23d,function(_0x4ca549){if(_[_0x38b0('0x36')]([_0x38b0('0x37'),_0x38b0('0x38')],_0x4ca549['type'])&&_0x4ca549[_0x38b0('0x39')]&&!_0x4ca549[_0x38b0('0x3a')]){_0x4f2691[_0x4ca549[_0x38b0('0x39')][_0x38b0('0x3b')]()]=_0x4ca549[_0x38b0('0x3c')]['toString']();}else if(_[_0x38b0('0x36')]([_0x38b0('0x37'),_0x38b0('0x38')],_0x4ca549[_0x38b0('0x3d')])&&_0x4ca549[_0x38b0('0x3e')]&&_0x4ca549['customField']){_0x4f2691[_0x38b0('0x1b')][_0x38b0('0x3f')]({'id':_0x4ca549[_0x38b0('0x3e')],'value':_0x4ca549[_0x38b0('0x3c')][_0x38b0('0x40')]()});}else if(_0x4ca549['type']===_0x38b0('0x41')&&_0x4ca549[_0x38b0('0x42')]&&_0x4ca549[_0x38b0('0x3e')]&&_0x4ca549[_0x38b0('0x3a')]){_0x3aa3e8[_0x4ca549[_0x38b0('0x42')]]&&_0x4f2691[_0x38b0('0x1b')][_0x38b0('0x3f')]({'id':_0x4ca549[_0x38b0('0x3e')],'value':_0x3aa3e8[_0x4ca549[_0x38b0('0x42')]]['toString']()});}else if(_0x4ca549[_0x38b0('0x3d')]==='customVariable'&&_0x4ca549[_0x38b0('0x43')]&&_0x4ca549['Variable'][_0x38b0('0x19')]&&_0x4ca549[_0x38b0('0x3e')]&&_0x4ca549[_0x38b0('0x3a')]){_0x3aa3e8[_0x4ca549['Variable'][_0x38b0('0x19')]['toLowerCase']()]&&_0x4f2691[_0x38b0('0x1b')][_0x38b0('0x3f')]({'id':_0x4ca549['idField'],'value':_0x3aa3e8[_0x4ca549[_0x38b0('0x43')][_0x38b0('0x19')]['toLowerCase']()]['toString']()});}});}return _0x4f2691;}exports['queue']=function(_0x23fa68,_0x30d94f,_0x3a0d9f,_0x1433b6,_0x38f2f0,_0x33feba){var _0x1b5b52,_0x20ea9e;_0x33feba['remoteUri']=intUtil[_0x38b0('0x44')](_0x33feba[_0x38b0('0x1f')]);_0x33feba[_0x38b0('0x45')]=intUtil[_0x38b0('0x44')](_0x33feba[_0x38b0('0x45')]);if(_0x38f2f0&&_0x38f2f0[_0x38b0('0x46')]){logger[_0x38b0('0x25')](_0x38b0('0x47'),_0x38b0('0x48'));_0x30d94f['recordingURL']=util['format'](_0x38b0('0x49'),_0x33feba[_0x38b0('0x45')],_0x30d94f[_0x38b0('0x4a')],md5(_0x30d94f['uniqueid']));}else{_0x30d94f[_0x38b0('0x4b')]='';}headers[_0x38b0('0x4c')]=getAuth(_0x33feba);return getUser(_0x33feba,_0x1433b6[_0x38b0('0x29')])['then'](function(_0x25d4fd){_0x1b5b52=_0x25d4fd;logger[_0x38b0('0x25')](_0x38b0('0x4d'),_0x1b5b52['id']);return getEndUser(_0x33feba,_0x30d94f[_0x38b0('0x13')],_0x30d94f[_0x38b0('0x14')]);})[_0x38b0('0x23')](function(_0x384362){_0x20ea9e=_0x384362;logger[_0x38b0('0x25')]('The\x20Enduser\x20ID\x20is:',_0x20ea9e['id']);return getTicket(_0x33feba,_0x1b5b52,_0x20ea9e,_0x3a0d9f,_0x30d94f);})[_0x38b0('0x23')](function(_0x1e31f4){if(_0x1e31f4&&_0x1e31f4['id']){logger['info'](_0x38b0('0x21'));logger[_0x38b0('0x25')](_0x38b0('0x4e'),_0x1e31f4['id']);logger[_0x38b0('0x25')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x38b0('0x4f'),_0x1433b6[_0x38b0('0x19')]),'trigger:browser:url',{'uri':util['format'](_0x38b0('0x50'),_0x33feba[_0x38b0('0x1f')],_0x1e31f4['id'])});}})[_0x38b0('0x51')](function(_0x5ad37b){logger['error'](_0x38b0('0x47'),JSON[_0x38b0('0x32')](_0x5ad37b));});};exports[_0x38b0('0x52')]=function(_0x1a4b5c,_0x2c7fb3,_0x58ee72,_0x3040d2,_0x34884d,_0x2cae0d,_0x41345b){var _0x12561f,_0x2455ff;_0x2cae0d[_0x38b0('0x1f')]=intUtil[_0x38b0('0x44')](_0x2cae0d[_0x38b0('0x1f')]);_0x2cae0d[_0x38b0('0x45')]=intUtil[_0x38b0('0x44')](_0x2cae0d[_0x38b0('0x45')]);if(_0x41345b&&_0x41345b[_0x38b0('0x53')]&&_0x41345b[_0x38b0('0x53')]!==_0x38b0('0x54')){logger[_0x38b0('0x25')](_0x38b0('0x55'),'Recording\x20is\x20enabled!');_0x2c7fb3[_0x38b0('0x4b')]=util[_0x38b0('0x11')](_0x38b0('0x49'),_0x2cae0d[_0x38b0('0x45')],_0x2c7fb3[_0x38b0('0x4a')],md5(_0x2c7fb3['uniqueid']));}headers['Authorization']=getAuth(_0x2cae0d);return getUser(_0x2cae0d,_0x3040d2[_0x38b0('0x29')])[_0x38b0('0x23')](function(_0xeacce4){_0x12561f=_0xeacce4;logger[_0x38b0('0x25')](_0x38b0('0x4d'),_0x12561f['id']);return getEndUser(_0x2cae0d,_0x2c7fb3[_0x38b0('0x56')],_0x2c7fb3[_0x38b0('0x57')]);})['then'](function(_0x1b36c5){_0x2455ff=_0x1b36c5;logger['info'](_0x38b0('0x58'),_0x2455ff['id']);return getTicket(_0x2cae0d,_0x12561f,_0x2455ff,_0x58ee72,_0x2c7fb3);})['then'](function(_0x2a3785){if(_0x2a3785&&_0x2a3785['id']){logger[_0x38b0('0x25')](_0x38b0('0x21'));logger[_0x38b0('0x25')](_0x38b0('0x4e'),_0x2a3785['id']);logger[_0x38b0('0x25')]('[OUTBOUND]',_0x38b0('0x59'));emit(util['format'](_0x38b0('0x4f'),_0x3040d2[_0x38b0('0x19')]),_0x38b0('0x5a'),{'uri':util[_0x38b0('0x11')](_0x38b0('0x50'),_0x2cae0d[_0x38b0('0x1f')],_0x2a3785['id'])});}})[_0x38b0('0x51')](function(_0x548974){logger['error']('[OUTBOUND]',JSON['stringify'](_0x548974));});};exports[_0x38b0('0x5b')]=function(_0x126517,_0x5d4772,_0x10e4cb,_0x4831cb,_0x415d11,_0xc273a4){var _0x5b54a8,_0x1a2e28;_0xc273a4['remoteUri']=intUtil[_0x38b0('0x44')](_0xc273a4[_0x38b0('0x1f')]);_0xc273a4['serverUrl']=intUtil[_0x38b0('0x44')](_0xc273a4[_0x38b0('0x45')]);if(_0x415d11&&_0x415d11[_0x38b0('0x46')]){logger[_0x38b0('0x25')]('['+_0x5d4772[_0x38b0('0x5c')][_0x38b0('0x5d')]()+']',_0x38b0('0x48'));_0x5d4772[_0x38b0('0x4b')]=util[_0x38b0('0x11')](_0x38b0('0x49'),_0xc273a4[_0x38b0('0x45')],_0x5d4772['uniqueid'],md5(_0x5d4772['uniqueid']));}else{_0x5d4772[_0x38b0('0x4b')]='';}headers[_0x38b0('0x4c')]=getAuth(_0xc273a4);return getUser(_0xc273a4,'')[_0x38b0('0x23')](function(_0x3bff2f){_0x5b54a8=_0x3bff2f;logger[_0x38b0('0x25')](_0x38b0('0x4d'),_0x5b54a8['id']);return getEndUser(_0xc273a4,_0x5d4772[_0x38b0('0x13')],_0x5d4772[_0x38b0('0x14')]);})['then'](function(_0x2cb782){_0x1a2e28=_0x2cb782;logger['info'](_0x38b0('0x58'),_0x1a2e28['id']);return getTicket(_0xc273a4,_0x5b54a8,_0x1a2e28,_0x10e4cb,_0x5d4772);})[_0x38b0('0x23')](function(_0x15d1d5){if(_0x15d1d5){logger[_0x38b0('0x25')](_0x38b0('0x21'));logger[_0x38b0('0x25')](_0x38b0('0x4e'),_0x15d1d5['id']);}})['catch'](function(_0x32c574){logger[_0x38b0('0x5e')]('['+_0x5d4772[_0x38b0('0x5c')]['toUpperCase']()+']',JSON[_0x38b0('0x32')](_0x32c574));});}; \ 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 d275e9b..4c28511 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 _0xda05=['ticketId','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','userEmail','toUpperCase','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','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','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xda05,0x105));var _0x5da0=function(_0x4c158d,_0x1f815e){_0x4c158d=_0x4c158d-0x0;var _0x3623c2=_0xda05[_0x4c158d];return _0x3623c2;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x5da0('0x0'));var moment=require(_0x5da0('0x1'));var Promise=require('bluebird');var Redis=require(_0x5da0('0x2'));var intUtil=require('./util');var config=require(_0x5da0('0x3'));var logger=require(_0x5da0('0x4'))('freshsales');config['redis']=_['defaults'](config[_0x5da0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x5da0('0x6'))(new Redis(config[_0x5da0('0x5')]));function getAdminId(_0x2ccbf8,_0x41e992,_0x4daa84,_0x38b18d){return new Promise(function(_0x16b5f5,_0x4333b4){var _0x5acc7c=![];var _0x42e11c={'method':_0x5da0('0x7'),'uri':_0x38b18d+_0x5da0('0x8'),'json':!![]};_0x42e11c[_0x5da0('0x9')]=_0x4daa84;logger[_0x5da0('0xa')](_0x5da0('0xb'));return rp(_0x42e11c)['then'](function(_0x5b51af){if(_0x5b51af){var _0x142e57=_0x5b51af[_0x5da0('0xc')];var _0x491cfc=null;for(_0x491cfc=0x0;_0x491cfc<_0x142e57['length'];_0x491cfc++){if(_0x142e57[_0x491cfc][_0x5da0('0xd')]===_0x2ccbf8[_0x5da0('0xe')]){_0x2ccbf8['adminId']=_0x142e57[_0x491cfc]['id'];_0x5acc7c=!![];}}if(_0x5acc7c){logger['info'](_0x5da0('0xf'),_0x2ccbf8[_0x5da0('0x10')]);_0x16b5f5(_0x2ccbf8);}else{_0x4333b4({'statusCode':0x194,'message':_0x5da0('0x11')});}}else{_0x4333b4({'statusCode':0x194,'message':_0x5da0('0x11')});}})[_0x5da0('0x12')](function(_0x3e043d){logger[_0x5da0('0x13')]('['+[_0x41e992['toUpperCase']()]+']',_0x3e043d[_0x5da0('0x14')]);_0x4333b4(_0x3e043d);});});}function getUser(_0x289116,_0x44b7fa,_0x2628de){return function(_0x3e50da){return new Promise(function(_0x1a3e20,_0x5e2be9){var _0x4cde3c={'method':_0x5da0('0x7'),'uri':_0x2628de+_0x5da0('0x8'),'json':!![]};_0x4cde3c['headers']=_0x44b7fa;logger[_0x5da0('0xa')](_0x5da0('0x15'));return rp(_0x4cde3c)[_0x5da0('0x16')](function(_0x1ecdc7){if(_0x1ecdc7){var _0x21c6c5=_0x1ecdc7[_0x5da0('0xc')];var _0x1dca59=![];var _0x2033eb=null;if(_0x3e50da[_0x5da0('0x17')]!==null){logger[_0x5da0('0xa')](_0x5da0('0x18'),_0x3e50da[_0x5da0('0x17')]);_0x3e50da['userEmail']=_0x3e50da[_0x5da0('0x17')];for(_0x2033eb=0x0;_0x2033eb<_0x21c6c5[_0x5da0('0x19')];_0x2033eb++){if(_0x21c6c5[_0x2033eb][_0x5da0('0xd')]===_0x3e50da['agentEmail']){_0x1dca59=!![];_0x3e50da[_0x5da0('0x1a')]=_0x21c6c5[_0x2033eb]['id'];logger['info'](_0x5da0('0x1b'),_0x3e50da[_0x5da0('0x1a')]);}}}if(!_0x1dca59){logger[_0x5da0('0xa')]('Admin\x20selected');_0x3e50da[_0x5da0('0x1c')]=_0x3e50da[_0x5da0('0xe')];_0x3e50da[_0x5da0('0x1a')]=_0x3e50da['adminId'];_0x1dca59=!![];}if(_0x1dca59){_0x1a3e20(_0x3e50da);}else{_0x5e2be9({'statusCode':0x194,'message':_0x5da0('0x11')});}}else{_0x5e2be9({'statusCode':0x194,'message':_0x5da0('0x11')});}})['catch'](function(_0x4d3170){logger['error']('['+[_0x289116[_0x5da0('0x1d')]()]+']',_0x4d3170[_0x5da0('0x14')]);_0x5e2be9(_0x4d3170);});});};}function searchContact(_0x1a0cbd,_0x2f658a,_0x13cab7,_0x80fffd){return new Promise(function(_0x5109bd,_0x4ef609){var _0x5285de={'method':_0x5da0('0x7'),'headers':_0x2f658a,'uri':_0x1a0cbd+'/api/lookup?q='+_0x80fffd+'&f='+_0x13cab7+_0x5da0('0x1e'),'json':!![]};rp(_0x5285de)[_0x5da0('0x16')](function(_0x1e4155){var _0x3d5350=_['find'](_0x1e4155[_0x5da0('0x1f')][_0x5da0('0x1f')],[_0x13cab7,_0x80fffd]);_0x5109bd(_0x3d5350);})[_0x5da0('0x12')](function(_0x3ccddc){_0x4ef609(_0x3ccddc);});});}function getEndUser(_0x2c0782,_0x56fec2,_0x1cb197){return function(_0x4cc442){return new Promise(function(_0x241f87,_0x106250){logger['info'](util[_0x5da0('0x20')](_0x5da0('0x21'),_0x4cc442[_0x5da0('0x22')]));searchContact(_0x1cb197,_0x56fec2,'mobile_number',_0x4cc442[_0x5da0('0x22')])[_0x5da0('0x16')](function(_0x29ec3c){if(_0x29ec3c){_0x4cc442[_0x5da0('0x23')]=_0x29ec3c['id'];logger[_0x5da0('0xa')](_0x5da0('0x24'),_0x4cc442['endUserId']);return _0x241f87(_0x4cc442);}searchContact(_0x1cb197,_0x56fec2,_0x5da0('0x25'),_0x4cc442[_0x5da0('0x22')])['then'](function(_0x358689){if(_0x358689){_0x4cc442[_0x5da0('0x23')]=_0x358689['id'];logger[_0x5da0('0xa')](_0x5da0('0x26'),_0x4cc442[_0x5da0('0x23')]);return _0x241f87(_0x4cc442);}createEndUser(_0x4cc442,_0x2c0782,_0x56fec2,_0x1cb197)[_0x5da0('0x16')](function(_0x44aade){logger[_0x5da0('0xa')](_0x5da0('0x27'),_0x44aade[_0x5da0('0x23')]);return _0x241f87(_0x44aade);});});})[_0x5da0('0x12')](function(_0x1399bc){_0x106250(_0x1399bc);});});};}function createEndUser(_0x4ab3f9,_0x30d086,_0x3e7847,_0x2ae226){return new Promise(function(_0x38365c,_0x4b4385){var _0x38c6d6=moment();var _0x12fe3d={'method':_0x5da0('0x28'),'uri':_0x2ae226+_0x5da0('0x29'),'body':{'contact':{'last_name':_0x4ab3f9['contactNumber'],'work_number':_0x4ab3f9[_0x5da0('0x22')],'mobile_number':_0x4ab3f9['contactNumber'],'owner_id':_0x4ab3f9[_0x5da0('0x1a')],'created_at':_0x38c6d6[_0x5da0('0x20')](_0x5da0('0x2a'))}},'json':!![]};_0x12fe3d['headers']=_0x3e7847;logger['info'](_0x5da0('0x2b'));return rp(_0x12fe3d)[_0x5da0('0x16')](function(_0xc57ad){_0x4ab3f9[_0x5da0('0x23')]=_0xc57ad[_0x5da0('0x2c')]['id'];_0x38365c(_0x4ab3f9);})[_0x5da0('0x12')](function(_0x4512f0){logger[_0x5da0('0x13')]('['+[_0x30d086[_0x5da0('0x1d')]()]+']',_0x4512f0[_0x5da0('0x14')]);_0x4b4385(_0x4512f0[_0x5da0('0x14')]);});});}function getTicket(_0x4f85a6,_0x27b57c,_0x5a1538,_0x129b8e,_0xfcb42b){return function(_0x16eeb3){logger[_0x5da0('0xa')](_0x5da0('0x2d'));return new Promise(function(_0xf5478a,_0x177332){var _0x483508=moment();var _0x565b29={'method':'POST','uri':_0x5a1538+_0x5da0('0x2e'),'body':{'title':intUtil[_0x5da0('0x2f')](_0x129b8e[_0x5da0('0x30')],_0xfcb42b,'\x20'),'description':intUtil[_0x5da0('0x2f')](_0x129b8e['Descriptions'],_0xfcb42b,'\x0a'),'owner_id':_0x16eeb3[_0x5da0('0x1a')],'creater_id':_0x16eeb3[_0x5da0('0x10')],'targetable_id':_0x16eeb3[_0x5da0('0x23')],'targetable_type':_0x5da0('0x31'),'created_at':_0x483508[_0x5da0('0x20')](_0x5da0('0x2a')),'due_date':_0x483508[_0x5da0('0x32')](0x1e,'m')[_0x5da0('0x20')](_0x5da0('0x2a'))},'json':!![]};_0x565b29[_0x5da0('0x9')]=_0x27b57c;return rp(_0x565b29)[_0x5da0('0x16')](function(_0x1a9359){_0x16eeb3[_0x5da0('0x33')]=_0x1a9359['task']['id'];logger[_0x5da0('0xa')](_0x5da0('0x34'),_0x16eeb3[_0x5da0('0x33')]);_0xf5478a(_0x16eeb3);})['catch'](function(_0x320186){logger[_0x5da0('0x13')]('['+[_0x4f85a6[_0x5da0('0x1d')]()]+']',_0x320186[_0x5da0('0x14')]);_0x177332(_0x320186['message']);});});};}function emit(_0x1e6131,_0x4fb514,_0xd05e5c){var _0x14de2d={'uri':_0x1e6131+_0x5da0('0x35')+_0xd05e5c};io['to'](util['format'](_0x5da0('0x36'),_0x4fb514))[_0x5da0('0x37')]('trigger:browser:url',_0x14de2d);}exports['cs']=function(_0x540fd6,_0x2b287b,_0x521201,_0x5e8f83,_0x1a1036,_0x5d75f6,_0x123789,_0x155106){var _0x17f719={};var _0x4aa862={'Authorization':_0x5da0('0x38')+_0x5d75f6[_0x5da0('0x39')]};_0x5d75f6[_0x5da0('0x3a')]=intUtil['stripTrailingSlash'](_0x5d75f6['remoteUri']);_0x5d75f6[_0x5da0('0x3b')]=intUtil[_0x5da0('0x3c')](_0x5d75f6[_0x5da0('0x3b')]);var _0x17c3c4=_0x5d75f6[_0x5da0('0x3a')];_0x17f719['adminEmail']=_0x5d75f6[_0x5da0('0x3d')];_0x17f719[_0x5da0('0x22')]=_0x155106[_0x5da0('0x3e')]()===_0x5da0('0x3f')?_0x2b287b[_0x5da0('0x40')]:_0x2b287b[_0x5da0('0x41')];_0x17f719['callDirection']=_0x155106==='queue'||_0x155106==='unmanaged'?_0x5da0('0x42'):_0x5da0('0x3f');if(_0x5e8f83){_0x17f719[_0x5da0('0x17')]=_0x5e8f83[_0x5da0('0xd')];}var _0x2008f9=util[_0x5da0('0x20')](_0x5da0('0x43'),_0x5d75f6[_0x5da0('0x3b')],_0x2b287b[_0x5da0('0x44')],md5(_0x2b287b[_0x5da0('0x44')]));if(_0x1a1036&&_0x1a1036[_0x5da0('0x45')]){logger['info']('[QUEUE]',_0x5da0('0x46'));_0x2b287b['recordingURL']=_0x2008f9;}else if(_0x123789&&_0x123789[_0x5da0('0x47')]&&_0x123789[_0x5da0('0x47')]!=='none'){logger[_0x5da0('0xa')](_0x5da0('0x48'),_0x5da0('0x46'));_0x2b287b[_0x5da0('0x49')]=_0x2008f9;}else{_0x2b287b[_0x5da0('0x49')]='';}return getAdminId(_0x17f719,_0x155106,_0x4aa862,_0x17c3c4)[_0x5da0('0x16')](getUser(_0x155106,_0x4aa862,_0x17c3c4))['then'](getEndUser(_0x155106,_0x4aa862,_0x17c3c4))[_0x5da0('0x16')](getTicket(_0x155106,_0x4aa862,_0x17c3c4,_0x521201,_0x2b287b))[_0x5da0('0x16')](function(_0x381abd){logger[_0x5da0('0xa')](util[_0x5da0('0x20')](_0x5da0('0x4a'),_0x381abd['ticketId']));if(_0x155106!=='unmanaged'){logger[_0x5da0('0xa')]('['+[_0x155106[_0x5da0('0x1d')]()]+']',_0x5da0('0x4b'));emit(_0x17c3c4,_0x5e8f83[_0x5da0('0x4c')],_0x381abd['endUserId']);}})[_0x5da0('0x12')](function(_0x310c86){logger['error']('['+[_0x155106[_0x5da0('0x1d')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x5da0('0x4d')](_0x310c86,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6080=['error','/api/lookup?q=','&f=','&entities=contact','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','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','./util','freshsales','redis','defaults','localhost','GET','headers','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','info','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected'];(function(_0x5f458c,_0x382344){var _0x1f000f=function(_0x1ea272){while(--_0x1ea272){_0x5f458c['push'](_0x5f458c['shift']());}};_0x1f000f(++_0x382344);}(_0x6080,0xe0));var _0x0608=function(_0x3956fc,_0x41d327){_0x3956fc=_0x3956fc-0x0;var _0x351078=_0x6080[_0x3956fc];return _0x351078;};'use strict';var _=require(_0x0608('0x0'));var rp=require(_0x0608('0x1'));var md5=require(_0x0608('0x2'));var util=require(_0x0608('0x3'));var moment=require(_0x0608('0x4'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x0608('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x0608('0x6'));config[_0x0608('0x7')]=_[_0x0608('0x8')](config[_0x0608('0x7')],{'host':_0x0608('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0608('0x7')]));function getAdminId(_0x53749c,_0x8ee1a8,_0x3636c7,_0xa41267){return new Promise(function(_0x596665,_0x5e21df){var _0x10d2fd=![];var _0x17a389={'method':_0x0608('0xa'),'uri':_0xa41267+'/api/selector/owners','json':!![]};_0x17a389[_0x0608('0xb')]=_0x3636c7;logger['info']('Getting\x20admin\x20information');return rp(_0x17a389)[_0x0608('0xc')](function(_0x5d82e1){if(_0x5d82e1){var _0x31ec3a=_0x5d82e1['users'];var _0x1a8cd8=null;for(_0x1a8cd8=0x0;_0x1a8cd8<_0x31ec3a[_0x0608('0xd')];_0x1a8cd8++){if(_0x31ec3a[_0x1a8cd8][_0x0608('0xe')]===_0x53749c[_0x0608('0xf')]){_0x53749c[_0x0608('0x10')]=_0x31ec3a[_0x1a8cd8]['id'];_0x10d2fd=!![];}}if(_0x10d2fd){logger['info'](_0x0608('0x11'),_0x53749c[_0x0608('0x10')]);_0x596665(_0x53749c);}else{_0x5e21df({'statusCode':0x194,'message':_0x0608('0x12')});}}else{_0x5e21df({'statusCode':0x194,'message':_0x0608('0x12')});}})[_0x0608('0x13')](function(_0x2351bc){logger['error']('['+[_0x8ee1a8[_0x0608('0x14')]()]+']',_0x2351bc[_0x0608('0x15')]);_0x5e21df(_0x2351bc);});});}function getUser(_0x2a3a73,_0x40c0e1,_0x3b1437){return function(_0x328d0e){return new Promise(function(_0x3a69fb,_0x6560b9){var _0x5c26a6={'method':_0x0608('0xa'),'uri':_0x3b1437+'/api/selector/owners','json':!![]};_0x5c26a6[_0x0608('0xb')]=_0x40c0e1;logger[_0x0608('0x16')](_0x0608('0x17'));return rp(_0x5c26a6)[_0x0608('0xc')](function(_0x58dcfa){if(_0x58dcfa){var _0x29e401=_0x58dcfa[_0x0608('0x18')];var _0x1c785a=![];var _0x58b794=null;if(_0x328d0e[_0x0608('0x19')]!==null){logger[_0x0608('0x16')](_0x0608('0x1a'),_0x328d0e[_0x0608('0x19')]);_0x328d0e[_0x0608('0x1b')]=_0x328d0e[_0x0608('0x19')];for(_0x58b794=0x0;_0x58b794<_0x29e401[_0x0608('0xd')];_0x58b794++){if(_0x29e401[_0x58b794][_0x0608('0xe')]===_0x328d0e[_0x0608('0x19')]){_0x1c785a=!![];_0x328d0e[_0x0608('0x1c')]=_0x29e401[_0x58b794]['id'];logger['info'](_0x0608('0x1d'),_0x328d0e[_0x0608('0x1c')]);}}}if(!_0x1c785a){logger[_0x0608('0x16')](_0x0608('0x1e'));_0x328d0e[_0x0608('0x1b')]=_0x328d0e[_0x0608('0xf')];_0x328d0e[_0x0608('0x1c')]=_0x328d0e['adminId'];_0x1c785a=!![];}if(_0x1c785a){_0x3a69fb(_0x328d0e);}else{_0x6560b9({'statusCode':0x194,'message':_0x0608('0x12')});}}else{_0x6560b9({'statusCode':0x194,'message':_0x0608('0x12')});}})['catch'](function(_0x432a95){logger[_0x0608('0x1f')]('['+[_0x2a3a73['toUpperCase']()]+']',_0x432a95[_0x0608('0x15')]);_0x6560b9(_0x432a95);});});};}function searchContact(_0xa1c566,_0x34c81c,_0x4c1230,_0x1e8bab){return new Promise(function(_0x5b8cdf,_0x471511){var _0x2ea054={'method':'GET','headers':_0x34c81c,'uri':_0xa1c566+_0x0608('0x20')+_0x1e8bab+_0x0608('0x21')+_0x4c1230+_0x0608('0x22'),'json':!![]};rp(_0x2ea054)['then'](function(_0x3dac5){var _0x130bc1=_[_0x0608('0x23')](_0x3dac5[_0x0608('0x24')][_0x0608('0x24')],[_0x4c1230,_0x1e8bab]);_0x5b8cdf(_0x130bc1);})[_0x0608('0x13')](function(_0xcebd8){_0x471511(_0xcebd8);});});}function getEndUser(_0x50f42d,_0x57708b,_0x3885b6){return function(_0x160ed0){return new Promise(function(_0x35ebd2,_0x58745c){logger['info'](util[_0x0608('0x25')](_0x0608('0x26'),_0x160ed0[_0x0608('0x27')]));searchContact(_0x3885b6,_0x57708b,_0x0608('0x28'),_0x160ed0[_0x0608('0x27')])[_0x0608('0xc')](function(_0x9a6627){if(_0x9a6627){_0x160ed0[_0x0608('0x29')]=_0x9a6627['id'];logger['info'](_0x0608('0x2a'),_0x160ed0[_0x0608('0x29')]);return _0x35ebd2(_0x160ed0);}searchContact(_0x3885b6,_0x57708b,_0x0608('0x2b'),_0x160ed0['contactNumber'])[_0x0608('0xc')](function(_0x522698){if(_0x522698){_0x160ed0[_0x0608('0x29')]=_0x522698['id'];logger[_0x0608('0x16')](_0x0608('0x2c'),_0x160ed0[_0x0608('0x29')]);return _0x35ebd2(_0x160ed0);}createEndUser(_0x160ed0,_0x50f42d,_0x57708b,_0x3885b6)[_0x0608('0xc')](function(_0x2edb53){logger['info'](_0x0608('0x2d'),_0x2edb53['endUserId']);return _0x35ebd2(_0x2edb53);});});})['catch'](function(_0x2e6726){_0x58745c(_0x2e6726);});});};}function createEndUser(_0x1607ae,_0x2898bb,_0x5173cd,_0x392349){return new Promise(function(_0x55c14b,_0x36f6a6){var _0xa905dd=moment();var _0x2da126={'method':_0x0608('0x2e'),'uri':_0x392349+_0x0608('0x2f'),'body':{'contact':{'last_name':_0x1607ae[_0x0608('0x27')],'work_number':_0x1607ae[_0x0608('0x27')],'mobile_number':_0x1607ae['contactNumber'],'owner_id':_0x1607ae[_0x0608('0x1c')],'created_at':_0xa905dd[_0x0608('0x25')](_0x0608('0x30'))}},'json':!![]};_0x2da126[_0x0608('0xb')]=_0x5173cd;logger[_0x0608('0x16')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2da126)['then'](function(_0x31a9e3){_0x1607ae['endUserId']=_0x31a9e3['contact']['id'];_0x55c14b(_0x1607ae);})['catch'](function(_0x4e8316){logger[_0x0608('0x1f')]('['+[_0x2898bb[_0x0608('0x14')]()]+']',_0x4e8316['message']);_0x36f6a6(_0x4e8316[_0x0608('0x15')]);});});}function getTicket(_0x87c782,_0x14b066,_0x5ee3a6,_0x4ffe7b,_0x294518){return function(_0xf46ec3){logger[_0x0608('0x16')]('Creating\x20new\x20task');return new Promise(function(_0x3a127b,_0x1ae6b6){var _0x446ce3=moment();var _0x497e54={'method':'POST','uri':_0x5ee3a6+_0x0608('0x31'),'body':{'title':intUtil[_0x0608('0x32')](_0x4ffe7b['Subjects'],_0x294518,'\x20'),'description':intUtil[_0x0608('0x32')](_0x4ffe7b[_0x0608('0x33')],_0x294518,'\x0a'),'owner_id':_0xf46ec3[_0x0608('0x1c')],'creater_id':_0xf46ec3[_0x0608('0x10')],'targetable_id':_0xf46ec3['endUserId'],'targetable_type':_0x0608('0x34'),'created_at':_0x446ce3[_0x0608('0x25')](_0x0608('0x30')),'due_date':_0x446ce3[_0x0608('0x35')](0x1e,'m')['format'](_0x0608('0x30'))},'json':!![]};_0x497e54['headers']=_0x14b066;return rp(_0x497e54)[_0x0608('0xc')](function(_0xf395d9){_0xf46ec3[_0x0608('0x36')]=_0xf395d9[_0x0608('0x37')]['id'];logger[_0x0608('0x16')](_0x0608('0x38'),_0xf46ec3[_0x0608('0x36')]);_0x3a127b(_0xf46ec3);})[_0x0608('0x13')](function(_0x51c810){logger['error']('['+[_0x87c782[_0x0608('0x14')]()]+']',_0x51c810[_0x0608('0x15')]);_0x1ae6b6(_0x51c810[_0x0608('0x15')]);});});};}function emit(_0x5aafde,_0x3b4236,_0x220684){var _0x5702f5={'uri':_0x5aafde+_0x0608('0x39')+_0x220684};io['to'](util[_0x0608('0x25')](_0x0608('0x3a'),_0x3b4236))[_0x0608('0x3b')](_0x0608('0x3c'),_0x5702f5);}exports['cs']=function(_0xd4bf45,_0x470ce1,_0xd30784,_0x39cd22,_0x5b917b,_0x3d1b4a,_0x3cdb13,_0x3d2669){var _0x17c016={};var _0x50a97c={'Authorization':_0x0608('0x3d')+_0x3d1b4a['apiKey']};_0x3d1b4a[_0x0608('0x3e')]=intUtil[_0x0608('0x3f')](_0x3d1b4a[_0x0608('0x3e')]);_0x3d1b4a['serverUrl']=intUtil[_0x0608('0x3f')](_0x3d1b4a[_0x0608('0x40')]);var _0x7ee7d0=_0x3d1b4a['remoteUri'];_0x17c016[_0x0608('0xf')]=_0x3d1b4a['username'];_0x17c016[_0x0608('0x27')]=_0x3d2669[_0x0608('0x41')]()==='outbound'?_0x470ce1[_0x0608('0x42')]:_0x470ce1[_0x0608('0x43')];_0x17c016[_0x0608('0x44')]=_0x3d2669===_0x0608('0x45')||_0x3d2669===_0x0608('0x46')?'queue':_0x0608('0x47');if(_0x39cd22){_0x17c016[_0x0608('0x19')]=_0x39cd22[_0x0608('0xe')];}var _0x4baa20=util['format'](_0x0608('0x48'),_0x3d1b4a['serverUrl'],_0x470ce1[_0x0608('0x49')],md5(_0x470ce1['uniqueid']));if(_0x5b917b&&_0x5b917b[_0x0608('0x4a')]){logger[_0x0608('0x16')](_0x0608('0x4b'),'Recording\x20is\x20enabled!');_0x470ce1[_0x0608('0x4c')]=_0x4baa20;}else if(_0x3cdb13&&_0x3cdb13[_0x0608('0x4d')]&&_0x3cdb13[_0x0608('0x4d')]!==_0x0608('0x4e')){logger[_0x0608('0x16')](_0x0608('0x4f'),_0x0608('0x50'));_0x470ce1[_0x0608('0x4c')]=_0x4baa20;}else{_0x470ce1['recordingURL']='';}return getAdminId(_0x17c016,_0x3d2669,_0x50a97c,_0x7ee7d0)[_0x0608('0xc')](getUser(_0x3d2669,_0x50a97c,_0x7ee7d0))['then'](getEndUser(_0x3d2669,_0x50a97c,_0x7ee7d0))[_0x0608('0xc')](getTicket(_0x3d2669,_0x50a97c,_0x7ee7d0,_0xd30784,_0x470ce1))[_0x0608('0xc')](function(_0x45cca5){logger['info'](util[_0x0608('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0x45cca5['ticketId']));if(_0x3d2669!==_0x0608('0x46')){logger[_0x0608('0x16')]('['+[_0x3d2669['toUpperCase']()]+']',_0x0608('0x51'));emit(_0x7ee7d0,_0x39cd22[_0x0608('0x52')],_0x45cca5[_0x0608('0x29')]);}})[_0x0608('0x13')](function(_0xabf99d){logger[_0x0608('0x1f')]('['+[_0x3d2669['toUpperCase']()]+_0x0608('0x53'),util[_0x0608('0x54')](_0xabf99d,{'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 e0b3e56..75af0d7 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 _0x5895=['dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','freshdesk','zoho','desk'];(function(_0x3e32d6,_0x37c0bb){var _0x52af90=function(_0x185bc1){while(--_0x185bc1){_0x3e32d6['push'](_0x3e32d6['shift']());}};_0x52af90(++_0x37c0bb);}(_0x5895,0xcf));var _0x5589=function(_0x595d9d,_0x4c0c69){_0x595d9d=_0x595d9d-0x0;var _0x4175f2=_0x5895[_0x595d9d];return _0x4175f2;};'use strict';var _=require(_0x5589('0x0'));var util=require('util');var zendesk=require(_0x5589('0x1'));var salesforce=require(_0x5589('0x2'));var sugarcrm=require(_0x5589('0x3'));var freshdesk=require(_0x5589('0x4'));var zoho=require(_0x5589('0x5'));var desk=require(_0x5589('0x6'));var vtiger=require(_0x5589('0x7'));var servicenow=require(_0x5589('0x8'));var dynamics365=require(_0x5589('0x9'));var freshsales=require(_0x5589('0xa'));var integrations=['zendesk',_0x5589('0xb'),'sugarcrm',_0x5589('0xc'),_0x5589('0xd'),_0x5589('0xe'),'vtiger',_0x5589('0xf'),_0x5589('0x10'),_0x5589('0x11')];exports[_0x5589('0x12')]=function(_0x49b05d,_0x97d09a,_0x2c5c09,_0x587d27,_0x2a9d12,_0x107b2c){if(_0x2c5c09){if(_['includes'](integrations,_0x49b05d[_0x5589('0x13')]['toLowerCase']())){try{var _0x588e30=null;var _0x4a09b0='';var _0x5f00bd=_0x2c5c09[_0x49b05d[_0x5589('0x13')][_0x5589('0x14')]()];if(_0x5f00bd){var _0x9d4459=_0x5f00bd[_0x49b05d[_0x5589('0x15')]];if(_0x9d4459){var _0x506de5=_['find'](_0x9d4459['Configurations'],{'id':parseInt(_0x49b05d[_0x5589('0x16')],0xa)});if(_0x506de5){if(_0x587d27){if(_0x2a9d12&&_0x97d09a[_0x5589('0x17')]){_0x4a09b0=_0x5589('0x17');}else if(_0x97d09a[_0x5589('0x18')]){_0x4a09b0=_0x5589('0x19');}else{console[_0x5589('0x1a')](_0x5589('0x1b'),_0x97d09a);}}else{_0x4a09b0=_0x5589('0x1c');}switch(_0x49b05d['data1']['toLowerCase']()){case'zendesk':zendesk[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xb'):salesforce[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0x1d'):sugarcrm[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xc'):freshdesk[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xd'):zoho[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xe'):desk[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case'vtiger':vtiger[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0x10'):freshsales['cs'](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c,_0x4a09b0);break;case _0x5589('0x11'):servicenow['cs'](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c,_0x4a09b0);break;case'dynamics365':dynamics365['cs'](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c,_0x4a09b0);break;default:console['log'](_0x5589('0x1e'));}}else{_0x588e30=require(_0x5589('0x1f'))(_0x49b05d['data1'][_0x5589('0x14')]());_0x588e30[_0x5589('0x20')]('[EXEC]',util[_0x5589('0x21')](_0x5589('0x22'),_0x49b05d[_0x5589('0x13')]['toLowerCase'](),_0x49b05d[_0x5589('0x16')]));}}else{_0x588e30=require(_0x5589('0x1f'))(_0x49b05d[_0x5589('0x13')][_0x5589('0x14')]());_0x588e30['error'](_0x5589('0x23'),util[_0x5589('0x21')](_0x5589('0x24'),_0x49b05d[_0x5589('0x13')][_0x5589('0x14')](),_0x49b05d[_0x5589('0x15')]));}}else{}}catch(_0x2abcf6){console['error'](_0x2abcf6);}}}}; \ No newline at end of file +var _0x9258=['zoho','desk','freshsales','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','vtiger','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk'];(function(_0x24c313,_0x236e20){var _0x49319e=function(_0x519265){while(--_0x519265){_0x24c313['push'](_0x24c313['shift']());}};_0x49319e(++_0x236e20);}(_0x9258,0x1a0));var _0x8925=function(_0x99698f,_0x5a6cc5){_0x99698f=_0x99698f-0x0;var _0x351de6=_0x9258[_0x99698f];return _0x351de6;};'use strict';var _=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var zendesk=require(_0x8925('0x2'));var salesforce=require(_0x8925('0x3'));var sugarcrm=require(_0x8925('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x8925('0x5'));var desk=require(_0x8925('0x6'));var vtiger=require(_0x8925('0x7'));var servicenow=require(_0x8925('0x8'));var dynamics365=require(_0x8925('0x9'));var freshsales=require(_0x8925('0xa'));var integrations=['zendesk','salesforce',_0x8925('0xb'),_0x8925('0xc'),_0x8925('0xd'),_0x8925('0xe'),'vtiger','dynamics365',_0x8925('0xf'),_0x8925('0x10')];exports[_0x8925('0x11')]=function(_0x225599,_0x379cba,_0x156871,_0x1d39ae,_0x27ad88,_0x183aa7){if(_0x156871){if(_[_0x8925('0x12')](integrations,_0x225599[_0x8925('0x13')][_0x8925('0x14')]())){try{var _0xd9558a=null;var _0x2470e5='';var _0x34e12a=_0x156871[_0x225599['data1'][_0x8925('0x14')]()];if(_0x34e12a){var _0x68785=_0x34e12a[_0x225599['data2']];if(_0x68785){var _0x2feb29=_[_0x8925('0x15')](_0x68785[_0x8925('0x16')],{'id':parseInt(_0x225599[_0x8925('0x17')],0xa)});if(_0x2feb29){if(_0x1d39ae){if(_0x27ad88&&_0x379cba['queue']){_0x2470e5='queue';}else if(_0x379cba[_0x8925('0x18')]){_0x2470e5=_0x8925('0x19');}else{console[_0x8925('0x1a')](_0x8925('0x1b'),_0x379cba);}}else{_0x2470e5=_0x8925('0x1c');}switch(_0x225599[_0x8925('0x13')][_0x8925('0x14')]()){case'zendesk':zendesk[_0x2470e5](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7);break;case _0x8925('0x1d'):salesforce[_0x2470e5](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7);break;case _0x8925('0xb'):sugarcrm[_0x2470e5](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7);break;case _0x8925('0xc'):freshdesk[_0x2470e5](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7);break;case _0x8925('0xd'):zoho[_0x2470e5](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7);break;case _0x8925('0xe'):desk[_0x2470e5](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7);break;case _0x8925('0x1e'):vtiger[_0x2470e5](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7);break;case _0x8925('0xf'):freshsales['cs'](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7,_0x2470e5);break;case _0x8925('0x10'):servicenow['cs'](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7,_0x2470e5);break;case _0x8925('0x1f'):dynamics365['cs'](_0x225599,_0x379cba,_0x2feb29,_0x1d39ae,_0x27ad88,_0x68785,_0x183aa7,_0x2470e5);break;default:console[_0x8925('0x1a')](_0x8925('0x20'));}}else{_0xd9558a=require(_0x8925('0x21'))(_0x225599[_0x8925('0x13')][_0x8925('0x14')]());_0xd9558a[_0x8925('0x22')](_0x8925('0x23'),util[_0x8925('0x24')](_0x8925('0x25'),_0x225599['data1'][_0x8925('0x14')](),_0x225599[_0x8925('0x17')]));}}else{_0xd9558a=require(_0x8925('0x21'))(_0x225599[_0x8925('0x13')]['toLowerCase']());_0xd9558a[_0x8925('0x22')]('[EXEC]',util[_0x8925('0x24')](_0x8925('0x26'),_0x225599[_0x8925('0x13')][_0x8925('0x14')](),_0x225599['data2']));}}else{}}catch(_0x2cb459){console[_0x8925('0x22')](_0x2cb459);}}}}; \ 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 32ee3c6..6755d48 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 _0xed7f=['display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','$or','Account','execute','first','Name','attributes','type','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','create','forEach','idField','content','toString','variable','customVariable','Variable','name','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','Subjects','getString','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','then','length','find','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xed7f,0x13c));var _0xfed7=function(_0x401a04,_0x27cd04){_0x401a04=_0x401a04-0x0;var _0x469676=_0xed7f[_0x401a04];return _0x469676;};'use strict';var _=require(_0xfed7('0x0'));var rp=require(_0xfed7('0x1'));var moment=require(_0xfed7('0x2'));var BPromise=require(_0xfed7('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0xfed7('0x4'));var intUtil=require(_0xfed7('0x5'));var config=require('../../../../config/environment');var logger=require(_0xfed7('0x6'))(_0xfed7('0x7'));config[_0xfed7('0x8')]=_['defaults'](config[_0xfed7('0x8')],{'host':_0xfed7('0x9'),'port':0x18eb});var io=require(_0xfed7('0xa'))(new Redis(config[_0xfed7('0x8')]));function emit(_0x4f70ad,_0x594e49,_0x202a3a){io['to'](_0x4f70ad)[_0xfed7('0xb')](_0x594e49,_0x202a3a);}function getTicket(_0x27e4c5,_0x2badb8,_0x909bbc,_0xbc3685,_0x2a3573,_0x5c2b45,_0x4774d1,_0x184c47){var _0x3e80f6=Object[_0xfed7('0xc')]({},{'OwnerId':_0x2badb8['id'],'Subject':intUtil['getString'](_0xbc3685[_0xfed7('0xd')],_0x2a3573,'\x20'),'Description':intUtil[_0xfed7('0xe')](_0xbc3685['Descriptions'],_0x2a3573,'\x0a')},getCustomFields(_0x5c2b45,_0x2a3573));if(_0x909bbc){if(_0xbc3685[_0xfed7('0xf')]==='Task'){_0x3e80f6[_0xfed7('0x10')]=moment[_0xfed7('0x11')]();_0x3e80f6[_0xfed7('0x12')]=![];_0x3e80f6[_0xfed7('0x13')]=![];if(_0x909bbc[_0xfed7('0x14')]===_0xfed7('0x15')||_0x909bbc[_0xfed7('0x14')]===_0xfed7('0x16')){_0x3e80f6[_0xfed7('0x17')]=_0x909bbc['id'];}else if(_0x909bbc['endUserType']===_0xfed7('0x18')){_0x3e80f6[_0xfed7('0x19')]=_0x909bbc['id'];}}else if(_0xbc3685[_0xfed7('0xf')]==='Case'){if(_0x909bbc['endUserType']===_0xfed7('0x15')){_0x3e80f6[_0xfed7('0x1a')]=_0x909bbc['id'];}else if(_0x909bbc[_0xfed7('0x14')]===_0xfed7('0x18')){_0x3e80f6['AccountId']=_0x909bbc['id'];}else if(_0x909bbc['endUserType']==='lead'&&_0xbc3685[_0xfed7('0x1b')]){_0x3e80f6[_0xbc3685[_0xfed7('0x1b')]]=_0x909bbc['id'];}else{logger[_0xfed7('0x1c')](_0xfed7('0x1d'));}}}return _0x4774d1[_0xfed7('0x1e')](_0xbc3685[_0xfed7('0xf')])['create'](_0x3e80f6);}function getUser(_0x5dd434,_0x1d629c,_0x54329f){if(!_['isNil'](_0x1d629c)&&intUtil[_0xfed7('0x1f')](_0x1d629c)){var _0x51f5cb={'Email':_0x1d629c};var _0x4bd2c6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x54329f[_0xfed7('0x1e')]('User')['find'](_0x51f5cb,_0x4bd2c6)['execute']()[_0xfed7('0x20')](function(_0x278cde){if(_0x278cde[_0xfed7('0x21')]){var _0x44197d=_[_0xfed7('0x22')](_0x278cde,function(_0x58a3a3){return _0x58a3a3[_0xfed7('0x23')]===_0x1d629c;});if(_0x44197d){logger['info'](_0xfed7('0x24'),_0x1d629c);return BPromise[_0xfed7('0x25')]({'id':_0x44197d['Id'],'name':_0x44197d['Name']});}}else{logger['info'](_0xfed7('0x26'),_0x1d629c);return _0x54329f[_0xfed7('0x27')]()[_0xfed7('0x20')](function(_0x529b3d){return BPromise[_0xfed7('0x25')]({'id':_0x529b3d[_0xfed7('0x28')],'name':_0x529b3d[_0xfed7('0x29')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1d629c);return _0x54329f[_0xfed7('0x27')]()[_0xfed7('0x20')](function(_0x164a6d){return BPromise['resolve']({'id':_0x164a6d[_0xfed7('0x28')],'name':_0x164a6d['display_name']});});}}function getEndUser(_0x361221,_0x38af04,_0x166f01,_0x4c6994,_0x3af541){var _0x9d9a60={'$or':{'Phone':_0x4c6994}};var _0x27b173={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xfed7('0x20')](function(){logger[_0xfed7('0x1c')](_0xfed7('0x2a'),_0x4c6994,_0x38af04['moduleSearch']);switch(_0x38af04[_0xfed7('0x2b')]){case _0xfed7('0x2c'):var _0x181882=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x2e')]){var _0x5026cd={};_0x5026cd[_0x38af04['additionalSearchContact']]=_0x4c6994;_[_0xfed7('0x2f')](_0x181882['$or'],_0x5026cd);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x30'))[_0xfed7('0x22')](_0x181882,_0x27b173)['execute']()['then'](function(_0x526a72){if(_0x526a72&&_0x526a72['length']){return _0x526a72;}else{var _0x4b4cba=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x31')]){var _0x482ab6={};_0x482ab6[_0x38af04[_0xfed7('0x31')]]=_0x4c6994;_['merge'](_0x4b4cba['$or'],_0x482ab6);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x32'))['find'](_0x4b4cba,_0x27b173);}});case _0xfed7('0x33'):var _0x7b295b=_['cloneDeep'](_0x9d9a60);if(_0x38af04[_0xfed7('0x34')]){var _0x5026cd={};_0x5026cd[_0x38af04[_0xfed7('0x34')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x7b295b[_0xfed7('0x35')],_0x5026cd);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x36'))[_0xfed7('0x22')](_0x7b295b,_0x27b173)[_0xfed7('0x37')]()[_0xfed7('0x20')](function(_0x344383){if(_0x344383&&_0x344383['length']){return _0x344383;}else{var _0x33eeb1=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x2e')]){var _0x27df9e={};_0x27df9e[_0x38af04[_0xfed7('0x2e')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x33eeb1[_0xfed7('0x35')],_0x27df9e);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x30'))[_0xfed7('0x22')](_0x33eeb1,_0x27b173)[_0xfed7('0x20')](function(_0x38c833){if(_0x38c833&&_0x38c833[_0xfed7('0x21')]){return _0x38c833;}else{var _0x254452=_['cloneDeep'](_0x9d9a60);if(_0x38af04['additionalSearchLead']){var _0xc26349={};_0xc26349[_0x38af04[_0xfed7('0x31')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x254452[_0xfed7('0x35')],_0xc26349);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x32'))[_0xfed7('0x22')](_0x254452,_0x27b173);}});}});case _0xfed7('0x15'):var _0x181882=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x2e')]){var _0x5026cd={};_0x5026cd[_0x38af04[_0xfed7('0x2e')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x181882[_0xfed7('0x35')],_0x5026cd);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x30'))[_0xfed7('0x22')](_0x181882,_0x27b173)[_0xfed7('0x37')]();case _0xfed7('0x16'):var _0x106153=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04['additionalSearchLead']){var _0x5026cd={};_0x5026cd[_0x38af04[_0xfed7('0x31')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x106153[_0xfed7('0x35')],_0x5026cd);}return _0x3af541['sobject']('Lead')['find'](_0x106153,_0x27b173);case _0xfed7('0x18'):var _0x7b295b=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x34')]){var _0x5026cd={};_0x5026cd[_0x38af04['additionalSearchAccount']]=_0x4c6994;_['merge'](_0x7b295b[_0xfed7('0x35')],_0x5026cd);}return _0x3af541['sobject']('Account')[_0xfed7('0x22')](_0x7b295b,_0x27b173);default:return null;}})[_0xfed7('0x20')](function(_0x51a0b8){if(_0x51a0b8&&_0x51a0b8[_0xfed7('0x21')]){var _0x546c21=_[_0xfed7('0x38')](_0x51a0b8);if(_0x546c21){return BPromise[_0xfed7('0x25')]({'id':_0x546c21['Id'],'name':_0x546c21[_0xfed7('0x39')],'phone':_0x546c21['Phone'],'endUserType':_0x546c21[_0xfed7('0x3a')][_0xfed7('0x3b')]['toLowerCase']()});}}})[_0xfed7('0x20')](function(_0x184552){if(_0x184552){logger[_0xfed7('0x1c')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x184552['endUserType'],_0x4c6994);return BPromise['resolve'](_0x184552);}else{logger[_0xfed7('0x1c')](_0xfed7('0x3c'),_0x4c6994);var _0x1233d5={'Phone':_0x4c6994};if(_0x38af04[_0xfed7('0x3d')]){if(_0x38af04[_0xfed7('0x3d')]===_0xfed7('0x15')){logger[_0xfed7('0x1c')](_0xfed7('0x3e'),_0x4c6994,_0x38af04[_0xfed7('0x3d')]);_0x1233d5['LastName']=_0x166f01!==_0xfed7('0x3f')?_0x166f01:util[_0xfed7('0x40')](_0xfed7('0x41'),_0x4c6994);}else if(_0x38af04[_0xfed7('0x3d')]===_0xfed7('0x16')){logger[_0xfed7('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4c6994,_0x38af04[_0xfed7('0x3d')]);_0x1233d5[_0xfed7('0x42')]=_0x166f01!==_0xfed7('0x3f')?_0x166f01:util[_0xfed7('0x40')](_0xfed7('0x41'),_0x4c6994);_0x1233d5[_0xfed7('0x43')]=_0xfed7('0x44');}else if(_0x38af04[_0xfed7('0x3d')]===_0xfed7('0x18')){logger['info'](_0xfed7('0x3e'),_0x4c6994,_0x38af04[_0xfed7('0x3d')]);_0x1233d5['Name']=_0x166f01!==_0xfed7('0x3f')?_0x166f01:util[_0xfed7('0x40')](_0xfed7('0x41'),_0x4c6994);}else{return null;}}return _0x3af541[_0xfed7('0x1e')](_['upperFirst'](_0x38af04['moduleCreate']))[_0xfed7('0x45')](_0x1233d5)[_0xfed7('0x20')](function(_0x2ddf53){return BPromise['resolve']({'id':_0x2ddf53['id'],'endUserType':_0x38af04['moduleCreate']});});}});}function getCustomFields(_0x4e3a2c,_0x3289cd){var _0x30f566={};if(_0x4e3a2c[_0xfed7('0x21')]>0x0){_[_0xfed7('0x46')](_0x4e3a2c,function(_0x134b67){if(_['includes'](['string','picklist'],_0x134b67[_0xfed7('0x3b')])&&_0x134b67[_0xfed7('0x47')]){_0x30f566[_0x134b67['idField']]=_0x134b67[_0xfed7('0x48')][_0xfed7('0x49')]();}else if(_0x134b67[_0xfed7('0x3b')]===_0xfed7('0x4a')&&_0x134b67['variableName']&&_0x134b67[_0xfed7('0x47')]){_0x3289cd[_0x134b67['variableName']]&&(_0x30f566[_0x134b67[_0xfed7('0x47')]]=_0x3289cd[_0x134b67['variableName']][_0xfed7('0x49')]());}else if(_0x134b67[_0xfed7('0x3b')]===_0xfed7('0x4b')&&_0x134b67[_0xfed7('0x4c')]&&_0x134b67['Variable']['name']&&_0x134b67['idField']){_0x3289cd[_0x134b67[_0xfed7('0x4c')][_0xfed7('0x4d')]['toLowerCase']()]&&(_0x30f566[_0x134b67[_0xfed7('0x47')]]=_0x3289cd[_0x134b67[_0xfed7('0x4c')][_0xfed7('0x4d')]['toLowerCase']()][_0xfed7('0x49')]());}});}return _0x30f566;}function getConnection(_0x1c88b2){var _0x2ed828=_0x1c88b2['password'][_0xfed7('0x4e')](_0x1c88b2['securityToken']);var _0x393e54=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1c88b2[_0xfed7('0x4f')]||_0xfed7('0x50'),'clientId':_0x1c88b2[_0xfed7('0x51')],'clientSecret':_0x1c88b2[_0xfed7('0x52')]}});return _0x393e54[_0xfed7('0x53')](_0x1c88b2[_0xfed7('0x54')],_0x2ed828)[_0xfed7('0x20')](function(){logger[_0xfed7('0x1c')](_0xfed7('0x55'));return _0x393e54;});}exports['queue']=function(_0x55c77e,_0x40eaa2,_0x3aaf16,_0x2fe9de,_0x2ce76b,_0x134522){var _0x1ef70e,_0xe5cea5,_0xbb04fc,_0x209600;_0x134522[_0xfed7('0x56')]=intUtil[_0xfed7('0x57')](_0x134522[_0xfed7('0x56')]);_0x134522[_0xfed7('0x4f')]=intUtil[_0xfed7('0x57')](_0x134522[_0xfed7('0x4f')]);if(_0x2ce76b&&_0x2ce76b['monitor_format']){logger[_0xfed7('0x1c')](_0xfed7('0x58'),_0xfed7('0x59'));_0x40eaa2[_0xfed7('0x5a')]=util[_0xfed7('0x40')](_0xfed7('0x5b'),_0x134522['serverUrl'],_0x40eaa2[_0xfed7('0x5c')],md5(_0x40eaa2['uniqueid']));}else{_0x40eaa2[_0xfed7('0x5a')]='';}return getConnection(_0x134522)[_0xfed7('0x20')](function(_0x88f3d8){_0x209600=_0x88f3d8;return getUser(_0x134522,_0x2fe9de[_0xfed7('0x5d')],_0x209600);})[_0xfed7('0x20')](function(_0x387205){_0x1ef70e=_0x387205;return getEndUser(_0x134522,_0x3aaf16,_0x40eaa2[_0xfed7('0x5e')],_0x40eaa2['calleridnum'],_0x209600);})[_0xfed7('0x20')](function(_0x22095a){_0xe5cea5=_0x22095a;return getTicket(_0x134522,_0x1ef70e,_0xe5cea5,_0x3aaf16,_0x40eaa2,_0x3aaf16[_0xfed7('0x5f')],_0x209600,_0xfed7('0x60'));})[_0xfed7('0x20')](function(_0x39db7b){_0xbb04fc=_0x39db7b;logger[_0xfed7('0x1c')](_0xfed7('0x61'),_0xbb04fc['id']);logger[_0xfed7('0x1c')](_0xfed7('0x62'),_0xbb04fc['id'],_0x2fe9de['name'],_0x134522[_0xfed7('0x3b')]);switch(_0x134522[_0xfed7('0x3b')]){case _0xfed7('0x63'):emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x2fe9de[_0xfed7('0x4d')]),'trigger:salesforce:display',{'recordId':_0xbb04fc['id']});break;case'newTab':emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x2fe9de[_0xfed7('0x4d')]),_0xfed7('0x65'),{'uri':util[_0xfed7('0x40')](_0xfed7('0x66'),_0x209600[_0xfed7('0x67')],_0xbb04fc['id'])});break;default:logger[_0xfed7('0x68')](_0xfed7('0x69'));}})[_0xfed7('0x6a')](function(_0x1b726e){logger[_0xfed7('0x68')](_0xfed7('0x58'),_0x1b726e);});};exports[_0xfed7('0x6b')]=function(_0x32212a,_0xc1a130,_0x3a2c2e,_0x115f23,_0x11f66c,_0x4d7acb,_0x3d35ea){var _0x1eaf5d,_0x59ca36,_0xe0634d,_0x239a6f;_0x4d7acb[_0xfed7('0x56')]=intUtil[_0xfed7('0x57')](_0x4d7acb[_0xfed7('0x56')]);_0x4d7acb[_0xfed7('0x4f')]=intUtil[_0xfed7('0x57')](_0x4d7acb[_0xfed7('0x4f')]);if(_0x3d35ea&&_0x3d35ea['recordingFormat']&&_0x3d35ea['recordingFormat']!=='none'){logger[_0xfed7('0x1c')]('[OUTBOUND]',_0xfed7('0x59'));_0xc1a130[_0xfed7('0x5a')]=util[_0xfed7('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d7acb[_0xfed7('0x56')],_0xc1a130[_0xfed7('0x5c')],md5(_0xc1a130[_0xfed7('0x5c')]));}return getConnection(_0x4d7acb)[_0xfed7('0x20')](function(_0x17f9fd){_0x239a6f=_0x17f9fd;return getUser(_0x4d7acb,_0x115f23['email'],_0x239a6f);})['then'](function(_0x40f0b2){_0x1eaf5d=_0x40f0b2;return getEndUser(_0x4d7acb,_0x3a2c2e,_0xc1a130['destcalleridname'],_0xc1a130['destcalleridnum'],_0x239a6f);})[_0xfed7('0x20')](function(_0xa69fd1){_0x59ca36=_0xa69fd1;return getTicket(_0x4d7acb,_0x1eaf5d,_0x59ca36,_0x3a2c2e,_0xc1a130,_0x3a2c2e[_0xfed7('0x5f')],_0x239a6f,_0xfed7('0x6b'));})['then'](function(_0x333b16){_0xe0634d=_0x333b16;logger['info'](_0xfed7('0x6c'),_0xe0634d['id']);logger[_0xfed7('0x1c')](_0xfed7('0x6d'),_0xe0634d['id'],_0x115f23[_0xfed7('0x4d')],_0x4d7acb[_0xfed7('0x3b')]);switch(_0x4d7acb[_0xfed7('0x3b')]){case'integrationTab':emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x115f23[_0xfed7('0x4d')]),'trigger:salesforce:display',{'recordId':_0xe0634d['id']});break;case _0xfed7('0x6e'):emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x115f23[_0xfed7('0x4d')]),_0xfed7('0x65'),{'uri':util[_0xfed7('0x40')](_0xfed7('0x66'),_0x239a6f[_0xfed7('0x67')],_0xe0634d['id'])});break;default:logger[_0xfed7('0x68')](_0xfed7('0x6f'),_0xfed7('0x70'));}})[_0xfed7('0x6a')](function(_0x2a1e7f){logger[_0xfed7('0x68')](_0xfed7('0x6f'),_0x2a1e7f);});};exports[_0xfed7('0x71')]=function(_0x242242,_0x202f11,_0x545f6d,_0x3e2aeb,_0x373d62,_0x2fddf2){var _0x36ac2a,_0x11a69d,_0x113c66,_0x196d82;_0x2fddf2[_0xfed7('0x56')]=intUtil[_0xfed7('0x57')](_0x2fddf2[_0xfed7('0x56')]);_0x2fddf2[_0xfed7('0x4f')]=intUtil['stripTrailingSlash'](_0x2fddf2[_0xfed7('0x4f')]);if(_0x373d62&&_0x373d62[_0xfed7('0x72')]){logger['info']('['+_0x202f11[_0xfed7('0x73')][_0xfed7('0x74')]()+']',_0xfed7('0x59'));_0x202f11[_0xfed7('0x5a')]=util['format'](_0xfed7('0x5b'),_0x2fddf2[_0xfed7('0x56')],_0x202f11[_0xfed7('0x5c')],md5(_0x202f11['uniqueid']));}else{_0x202f11[_0xfed7('0x5a')]='';}return getConnection(_0x2fddf2)[_0xfed7('0x20')](function(_0x5ef448){_0x196d82=_0x5ef448;if(!_[_0xfed7('0x75')](_0x3e2aeb)){return getUser(_0x2fddf2,_0x3e2aeb[_0xfed7('0x4d')],_0x196d82);}else{return getUser(_0x2fddf2,null,_0x196d82);}})['then'](function(_0x17cbf0){_0x36ac2a=_0x17cbf0;return getEndUser(_0x2fddf2,_0x545f6d,_0x202f11[_0xfed7('0x5e')],_0x202f11['calleridnum'],_0x196d82);})[_0xfed7('0x20')](function(_0x1ddb92){_0x11a69d=_0x1ddb92;return getTicket(_0x2fddf2,_0x36ac2a,_0x11a69d,_0x545f6d,_0x202f11,_0x545f6d[_0xfed7('0x5f')],_0x196d82);})[_0xfed7('0x20')](function(_0x22634d){_0x113c66=_0x22634d;logger[_0xfed7('0x1c')]('['+_0x202f11[_0xfed7('0x73')]['toUpperCase']()+_0xfed7('0x76'),_0x113c66['id']);logger[_0xfed7('0x1c')]('['+_0x202f11[_0xfed7('0x73')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x2fddf2[_0xfed7('0x3b')]);})[_0xfed7('0x6a')](function(_0x36a1b1){logger[_0xfed7('0x68')]('['+_0x202f11[_0xfed7('0x73')][_0xfed7('0x74')]()+']',_0x36a1b1);});}; \ No newline at end of file +var _0xb3bc=['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','additionalSearchContact','$or','Contact','cloneDeep','additionalSearchLead','Lead','additionalSearchAccount','merge','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','forEach','includes','string','picklist','idField','variable','variableName','toString','Variable','name','toLowerCase','password','concat','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','remoteUri','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','recordingURL','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','./util','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','Task','utc','IsReminderSet','IsRecurrence','endUserType','lead','account','WhatId','ticketType','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','then','length','Agent\x20%s\x20found.','resolve'];(function(_0x3ed987,_0x12c53b){var _0x3e0a7b=function(_0x33aaf3){while(--_0x33aaf3){_0x3ed987['push'](_0x3ed987['shift']());}};_0x3e0a7b(++_0x12c53b);}(_0xb3bc,0x153));var _0xcb3b=function(_0xaf595,_0x98e696){_0xaf595=_0xaf595-0x0;var _0x14f27d=_0xb3bc[_0xaf595];return _0x14f27d;};'use strict';var _=require(_0xcb3b('0x0'));var rp=require(_0xcb3b('0x1'));var moment=require(_0xcb3b('0x2'));var BPromise=require(_0xcb3b('0x3'));var md5=require(_0xcb3b('0x4'));var jsforce=require(_0xcb3b('0x5'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xcb3b('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xcb3b('0x7'));config[_0xcb3b('0x8')]=_[_0xcb3b('0x9')](config[_0xcb3b('0x8')],{'host':_0xcb3b('0xa'),'port':0x18eb});var io=require(_0xcb3b('0xb'))(new Redis(config[_0xcb3b('0x8')]));function emit(_0x3633d3,_0x5a039b,_0x341791){io['to'](_0x3633d3)[_0xcb3b('0xc')](_0x5a039b,_0x341791);}function getTicket(_0x38c127,_0x296f60,_0x4bc979,_0x267029,_0x44c657,_0x56f3e3,_0x43d7c4,_0x12a2a8){var _0xb7542a=Object[_0xcb3b('0xd')]({},{'OwnerId':_0x296f60['id'],'Subject':intUtil[_0xcb3b('0xe')](_0x267029['Subjects'],_0x44c657,'\x20'),'Description':intUtil[_0xcb3b('0xe')](_0x267029[_0xcb3b('0xf')],_0x44c657,'\x0a')},getCustomFields(_0x56f3e3,_0x44c657));if(_0x4bc979){if(_0x267029['ticketType']===_0xcb3b('0x10')){_0xb7542a['ActivityDate']=moment[_0xcb3b('0x11')]();_0xb7542a[_0xcb3b('0x12')]=![];_0xb7542a[_0xcb3b('0x13')]=![];if(_0x4bc979['endUserType']==='contact'||_0x4bc979[_0xcb3b('0x14')]===_0xcb3b('0x15')){_0xb7542a['WhoId']=_0x4bc979['id'];}else if(_0x4bc979[_0xcb3b('0x14')]===_0xcb3b('0x16')){_0xb7542a[_0xcb3b('0x17')]=_0x4bc979['id'];}}else if(_0x267029[_0xcb3b('0x18')]===_0xcb3b('0x19')){if(_0x4bc979['endUserType']===_0xcb3b('0x1a')){_0xb7542a[_0xcb3b('0x1b')]=_0x4bc979['id'];}else if(_0x4bc979[_0xcb3b('0x14')]===_0xcb3b('0x16')){_0xb7542a[_0xcb3b('0x1c')]=_0x4bc979['id'];}else if(_0x4bc979[_0xcb3b('0x14')]==='lead'&&_0x267029[_0xcb3b('0x1d')]){_0xb7542a[_0x267029[_0xcb3b('0x1d')]]=_0x4bc979['id'];}else{logger[_0xcb3b('0x1e')](_0xcb3b('0x1f'));}}}return _0x43d7c4[_0xcb3b('0x20')](_0x267029[_0xcb3b('0x18')])[_0xcb3b('0x21')](_0xb7542a);}function getUser(_0x21ff2d,_0x4dc617,_0x1f4e60){if(!_[_0xcb3b('0x22')](_0x4dc617)&&intUtil['validateEmail'](_0x4dc617)){var _0x1702d6={'Email':_0x4dc617};var _0xcdacb4={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1f4e60['sobject'](_0xcb3b('0x23'))[_0xcb3b('0x24')](_0x1702d6,_0xcdacb4)[_0xcb3b('0x25')]()[_0xcb3b('0x26')](function(_0x976c8){if(_0x976c8[_0xcb3b('0x27')]){var _0x443cd4=_[_0xcb3b('0x24')](_0x976c8,function(_0x30e86f){return _0x30e86f['Email']===_0x4dc617;});if(_0x443cd4){logger['info'](_0xcb3b('0x28'),_0x4dc617);return BPromise[_0xcb3b('0x29')]({'id':_0x443cd4['Id'],'name':_0x443cd4[_0xcb3b('0x2a')]});}}else{logger[_0xcb3b('0x1e')](_0xcb3b('0x2b'),_0x4dc617);return _0x1f4e60[_0xcb3b('0x2c')]()[_0xcb3b('0x26')](function(_0x84ccf){return BPromise[_0xcb3b('0x29')]({'id':_0x84ccf[_0xcb3b('0x2d')],'name':_0x84ccf[_0xcb3b('0x2e')]});});}});}else{logger[_0xcb3b('0x1e')](_0xcb3b('0x2b'),_0x4dc617);return _0x1f4e60['identity']()[_0xcb3b('0x26')](function(_0x549f98){return BPromise['resolve']({'id':_0x549f98[_0xcb3b('0x2d')],'name':_0x549f98[_0xcb3b('0x2e')]});});}}function getEndUser(_0x260bcb,_0x2a4848,_0x428c17,_0x35fbb2,_0x4195c2){var _0x2ce93c={'$or':{'Phone':_0x35fbb2}};var _0x612ddd={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xcb3b('0x29')]()['then'](function(){logger['info'](_0xcb3b('0x2f'),_0x35fbb2,_0x2a4848[_0xcb3b('0x30')]);switch(_0x2a4848['moduleSearch']){case _0xcb3b('0x31'):var _0x9988fe=_['cloneDeep'](_0x2ce93c);if(_0x2a4848['additionalSearchContact']){var _0x2e8216={};_0x2e8216[_0x2a4848[_0xcb3b('0x32')]]=_0x35fbb2;_['merge'](_0x9988fe[_0xcb3b('0x33')],_0x2e8216);}return _0x4195c2['sobject'](_0xcb3b('0x34'))[_0xcb3b('0x24')](_0x9988fe,_0x612ddd)[_0xcb3b('0x25')]()[_0xcb3b('0x26')](function(_0x99e263){if(_0x99e263&&_0x99e263[_0xcb3b('0x27')]){return _0x99e263;}else{var _0x45d8b1=_[_0xcb3b('0x35')](_0x2ce93c);if(_0x2a4848[_0xcb3b('0x36')]){var _0x4dd226={};_0x4dd226[_0x2a4848[_0xcb3b('0x36')]]=_0x35fbb2;_['merge'](_0x45d8b1[_0xcb3b('0x33')],_0x4dd226);}return _0x4195c2[_0xcb3b('0x20')](_0xcb3b('0x37'))[_0xcb3b('0x24')](_0x45d8b1,_0x612ddd);}});case'account_contact_lead':var _0x5a2276=_[_0xcb3b('0x35')](_0x2ce93c);if(_0x2a4848[_0xcb3b('0x38')]){var _0x2e8216={};_0x2e8216[_0x2a4848['additionalSearchAccount']]=_0x35fbb2;_['merge'](_0x5a2276['$or'],_0x2e8216);}return _0x4195c2[_0xcb3b('0x20')]('Account')[_0xcb3b('0x24')](_0x5a2276,_0x612ddd)[_0xcb3b('0x25')]()[_0xcb3b('0x26')](function(_0x1c530d){if(_0x1c530d&&_0x1c530d['length']){return _0x1c530d;}else{var _0x26a6a4=_[_0xcb3b('0x35')](_0x2ce93c);if(_0x2a4848[_0xcb3b('0x32')]){var _0x17be98={};_0x17be98[_0x2a4848[_0xcb3b('0x32')]]=_0x35fbb2;_[_0xcb3b('0x39')](_0x26a6a4[_0xcb3b('0x33')],_0x17be98);}return _0x4195c2[_0xcb3b('0x20')](_0xcb3b('0x34'))['find'](_0x26a6a4,_0x612ddd)['then'](function(_0x51bf15){if(_0x51bf15&&_0x51bf15[_0xcb3b('0x27')]){return _0x51bf15;}else{var _0x2dfce4=_['cloneDeep'](_0x2ce93c);if(_0x2a4848[_0xcb3b('0x36')]){var _0x3a8fe7={};_0x3a8fe7[_0x2a4848[_0xcb3b('0x36')]]=_0x35fbb2;_[_0xcb3b('0x39')](_0x2dfce4[_0xcb3b('0x33')],_0x3a8fe7);}return _0x4195c2[_0xcb3b('0x20')]('Lead')['find'](_0x2dfce4,_0x612ddd);}});}});case _0xcb3b('0x1a'):var _0x9988fe=_[_0xcb3b('0x35')](_0x2ce93c);if(_0x2a4848['additionalSearchContact']){var _0x2e8216={};_0x2e8216[_0x2a4848[_0xcb3b('0x32')]]=_0x35fbb2;_['merge'](_0x9988fe[_0xcb3b('0x33')],_0x2e8216);}return _0x4195c2['sobject'](_0xcb3b('0x34'))['find'](_0x9988fe,_0x612ddd)[_0xcb3b('0x25')]();case'lead':var _0x1af7ad=_['cloneDeep'](_0x2ce93c);if(_0x2a4848[_0xcb3b('0x36')]){var _0x2e8216={};_0x2e8216[_0x2a4848[_0xcb3b('0x36')]]=_0x35fbb2;_[_0xcb3b('0x39')](_0x1af7ad[_0xcb3b('0x33')],_0x2e8216);}return _0x4195c2['sobject']('Lead')[_0xcb3b('0x24')](_0x1af7ad,_0x612ddd);case _0xcb3b('0x16'):var _0x5a2276=_[_0xcb3b('0x35')](_0x2ce93c);if(_0x2a4848[_0xcb3b('0x38')]){var _0x2e8216={};_0x2e8216[_0x2a4848[_0xcb3b('0x38')]]=_0x35fbb2;_[_0xcb3b('0x39')](_0x5a2276[_0xcb3b('0x33')],_0x2e8216);}return _0x4195c2[_0xcb3b('0x20')]('Account')['find'](_0x5a2276,_0x612ddd);default:return null;}})['then'](function(_0x340010){if(_0x340010&&_0x340010[_0xcb3b('0x27')]){var _0xc2c570=_[_0xcb3b('0x3a')](_0x340010);if(_0xc2c570){return BPromise[_0xcb3b('0x29')]({'id':_0xc2c570['Id'],'name':_0xc2c570[_0xcb3b('0x2a')],'phone':_0xc2c570[_0xcb3b('0x3b')],'endUserType':_0xc2c570[_0xcb3b('0x3c')][_0xcb3b('0x3d')]['toLowerCase']()});}}})['then'](function(_0x4d0887){if(_0x4d0887){logger['info'](_0xcb3b('0x3e'),_0x4d0887[_0xcb3b('0x14')],_0x35fbb2);return BPromise['resolve'](_0x4d0887);}else{logger[_0xcb3b('0x1e')](_0xcb3b('0x3f'),_0x35fbb2);var _0x10d1b9={'Phone':_0x35fbb2};if(_0x2a4848[_0xcb3b('0x40')]){if(_0x2a4848[_0xcb3b('0x40')]===_0xcb3b('0x1a')){logger[_0xcb3b('0x1e')](_0xcb3b('0x41'),_0x35fbb2,_0x2a4848['moduleCreate']);_0x10d1b9[_0xcb3b('0x42')]=_0x428c17!==_0xcb3b('0x43')?_0x428c17:util[_0xcb3b('0x44')](_0xcb3b('0x45'),_0x35fbb2);}else if(_0x2a4848['moduleCreate']===_0xcb3b('0x15')){logger[_0xcb3b('0x1e')](_0xcb3b('0x41'),_0x35fbb2,_0x2a4848[_0xcb3b('0x40')]);_0x10d1b9['LastName']=_0x428c17!==_0xcb3b('0x43')?_0x428c17:util[_0xcb3b('0x44')](_0xcb3b('0x45'),_0x35fbb2);_0x10d1b9[_0xcb3b('0x46')]='No\x20Company';}else if(_0x2a4848[_0xcb3b('0x40')]===_0xcb3b('0x16')){logger[_0xcb3b('0x1e')](_0xcb3b('0x41'),_0x35fbb2,_0x2a4848['moduleCreate']);_0x10d1b9[_0xcb3b('0x2a')]=_0x428c17!==''?_0x428c17:util['format'](_0xcb3b('0x45'),_0x35fbb2);}else{return null;}}return _0x4195c2[_0xcb3b('0x20')](_[_0xcb3b('0x47')](_0x2a4848[_0xcb3b('0x40')]))[_0xcb3b('0x21')](_0x10d1b9)['then'](function(_0xe8f9b8){return BPromise[_0xcb3b('0x29')]({'id':_0xe8f9b8['id'],'endUserType':_0x2a4848[_0xcb3b('0x40')]});});}});}function getCustomFields(_0x2f97de,_0x70d13d){var _0x22fece={};if(_0x2f97de[_0xcb3b('0x27')]>0x0){_[_0xcb3b('0x48')](_0x2f97de,function(_0x5b8cf3){if(_[_0xcb3b('0x49')]([_0xcb3b('0x4a'),_0xcb3b('0x4b')],_0x5b8cf3[_0xcb3b('0x3d')])&&_0x5b8cf3[_0xcb3b('0x4c')]){_0x22fece[_0x5b8cf3[_0xcb3b('0x4c')]]=_0x5b8cf3['content']['toString']();}else if(_0x5b8cf3['type']===_0xcb3b('0x4d')&&_0x5b8cf3[_0xcb3b('0x4e')]&&_0x5b8cf3[_0xcb3b('0x4c')]){_0x70d13d[_0x5b8cf3['variableName']]&&(_0x22fece[_0x5b8cf3[_0xcb3b('0x4c')]]=_0x70d13d[_0x5b8cf3[_0xcb3b('0x4e')]][_0xcb3b('0x4f')]());}else if(_0x5b8cf3[_0xcb3b('0x3d')]==='customVariable'&&_0x5b8cf3[_0xcb3b('0x50')]&&_0x5b8cf3[_0xcb3b('0x50')][_0xcb3b('0x51')]&&_0x5b8cf3[_0xcb3b('0x4c')]){_0x70d13d[_0x5b8cf3[_0xcb3b('0x50')][_0xcb3b('0x51')][_0xcb3b('0x52')]()]&&(_0x22fece[_0x5b8cf3[_0xcb3b('0x4c')]]=_0x70d13d[_0x5b8cf3['Variable']['name'][_0xcb3b('0x52')]()]['toString']());}});}return _0x22fece;}function getConnection(_0x4d7878){var _0x493d82=_0x4d7878[_0xcb3b('0x53')][_0xcb3b('0x54')](_0x4d7878['securityToken']);var _0xd1ccf8=new jsforce[(_0xcb3b('0x55'))]({'oauth2':{'loginUrl':_0x4d7878['remoteUri']||_0xcb3b('0x56'),'clientId':_0x4d7878[_0xcb3b('0x57')],'clientSecret':_0x4d7878[_0xcb3b('0x58')]}});return _0xd1ccf8[_0xcb3b('0x59')](_0x4d7878[_0xcb3b('0x5a')],_0x493d82)[_0xcb3b('0x26')](function(){logger[_0xcb3b('0x1e')]('Connection\x20established.');return _0xd1ccf8;});}exports[_0xcb3b('0x5b')]=function(_0x2a6ad0,_0x2af5b5,_0x53b1ad,_0x182553,_0x410e1b,_0x5b3abf){var _0x416efc,_0x402b7e,_0x2d992d,_0x4230ed;_0x5b3abf[_0xcb3b('0x5c')]=intUtil[_0xcb3b('0x5d')](_0x5b3abf[_0xcb3b('0x5c')]);_0x5b3abf[_0xcb3b('0x5e')]=intUtil[_0xcb3b('0x5d')](_0x5b3abf['remoteUri']);if(_0x410e1b&&_0x410e1b['monitor_format']){logger[_0xcb3b('0x1e')]('[QUEUE]',_0xcb3b('0x5f'));_0x2af5b5['recordingURL']=util[_0xcb3b('0x44')](_0xcb3b('0x60'),_0x5b3abf['serverUrl'],_0x2af5b5['uniqueid'],md5(_0x2af5b5[_0xcb3b('0x61')]));}else{_0x2af5b5['recordingURL']='';}return getConnection(_0x5b3abf)['then'](function(_0x283b33){_0x4230ed=_0x283b33;return getUser(_0x5b3abf,_0x182553['email'],_0x4230ed);})[_0xcb3b('0x26')](function(_0x48521c){_0x416efc=_0x48521c;return getEndUser(_0x5b3abf,_0x53b1ad,_0x2af5b5[_0xcb3b('0x62')],_0x2af5b5[_0xcb3b('0x63')],_0x4230ed);})[_0xcb3b('0x26')](function(_0x34ad03){_0x402b7e=_0x34ad03;return getTicket(_0x5b3abf,_0x416efc,_0x402b7e,_0x53b1ad,_0x2af5b5,_0x53b1ad[_0xcb3b('0x64')],_0x4230ed,'queue');})[_0xcb3b('0x26')](function(_0x4d30a7){_0x2d992d=_0x4d30a7;logger[_0xcb3b('0x1e')](_0xcb3b('0x65'),_0x2d992d['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2d992d['id'],_0x182553[_0xcb3b('0x51')],_0x5b3abf[_0xcb3b('0x3d')]);switch(_0x5b3abf['type']){case _0xcb3b('0x66'):emit(util[_0xcb3b('0x44')]('user:%s',_0x182553[_0xcb3b('0x51')]),_0xcb3b('0x67'),{'recordId':_0x2d992d['id']});break;case'newTab':emit(util[_0xcb3b('0x44')](_0xcb3b('0x68'),_0x182553[_0xcb3b('0x51')]),_0xcb3b('0x69'),{'uri':util[_0xcb3b('0x44')]('%s/%s/e',_0x4230ed[_0xcb3b('0x6a')],_0x2d992d['id'])});break;default:logger[_0xcb3b('0x6b')](_0xcb3b('0x6c'));}})[_0xcb3b('0x6d')](function(_0x89f5b0){logger[_0xcb3b('0x6b')](_0xcb3b('0x6e'),_0x89f5b0);});};exports[_0xcb3b('0x6f')]=function(_0x463c17,_0xabd23f,_0x25e0fb,_0xdb9349,_0x47ed0b,_0x43ae67,_0xd1410b){var _0x32b7d6,_0x3cd960,_0xa49768,_0x53180a;_0x43ae67[_0xcb3b('0x5c')]=intUtil['stripTrailingSlash'](_0x43ae67['serverUrl']);_0x43ae67[_0xcb3b('0x5e')]=intUtil[_0xcb3b('0x5d')](_0x43ae67[_0xcb3b('0x5e')]);if(_0xd1410b&&_0xd1410b[_0xcb3b('0x70')]&&_0xd1410b[_0xcb3b('0x70')]!=='none'){logger[_0xcb3b('0x1e')]('[OUTBOUND]',_0xcb3b('0x5f'));_0xabd23f['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43ae67['serverUrl'],_0xabd23f[_0xcb3b('0x61')],md5(_0xabd23f[_0xcb3b('0x61')]));}return getConnection(_0x43ae67)['then'](function(_0x114ef4){_0x53180a=_0x114ef4;return getUser(_0x43ae67,_0xdb9349[_0xcb3b('0x71')],_0x53180a);})[_0xcb3b('0x26')](function(_0x2683a1){_0x32b7d6=_0x2683a1;return getEndUser(_0x43ae67,_0x25e0fb,_0xabd23f[_0xcb3b('0x72')],_0xabd23f['destcalleridnum'],_0x53180a);})['then'](function(_0x6340a8){_0x3cd960=_0x6340a8;return getTicket(_0x43ae67,_0x32b7d6,_0x3cd960,_0x25e0fb,_0xabd23f,_0x25e0fb['Fields'],_0x53180a,'outbound');})[_0xcb3b('0x26')](function(_0x46d7bf){_0xa49768=_0x46d7bf;logger[_0xcb3b('0x1e')](_0xcb3b('0x73'),_0xa49768['id']);logger[_0xcb3b('0x1e')](_0xcb3b('0x74'),_0xa49768['id'],_0xdb9349[_0xcb3b('0x51')],_0x43ae67[_0xcb3b('0x3d')]);switch(_0x43ae67['type']){case _0xcb3b('0x66'):emit(util[_0xcb3b('0x44')](_0xcb3b('0x68'),_0xdb9349[_0xcb3b('0x51')]),_0xcb3b('0x67'),{'recordId':_0xa49768['id']});break;case _0xcb3b('0x75'):emit(util[_0xcb3b('0x44')]('user:%s',_0xdb9349[_0xcb3b('0x51')]),_0xcb3b('0x69'),{'uri':util[_0xcb3b('0x44')](_0xcb3b('0x76'),_0x53180a[_0xcb3b('0x6a')],_0xa49768['id'])});break;default:logger['error'](_0xcb3b('0x77'),_0xcb3b('0x78'));}})['catch'](function(_0x38ac1b){logger[_0xcb3b('0x6b')](_0xcb3b('0x77'),_0x38ac1b);});};exports[_0xcb3b('0x79')]=function(_0x5a314d,_0x18e422,_0x2ae84b,_0x4e5072,_0x5888b0,_0x3d383b){var _0x2666ef,_0x307716,_0x194ac4,_0x1e7e74;_0x3d383b['serverUrl']=intUtil[_0xcb3b('0x5d')](_0x3d383b[_0xcb3b('0x5c')]);_0x3d383b[_0xcb3b('0x5e')]=intUtil[_0xcb3b('0x5d')](_0x3d383b[_0xcb3b('0x5e')]);if(_0x5888b0&&_0x5888b0['monitor_format']){logger['info']('['+_0x18e422['lastevent'][_0xcb3b('0x7a')]()+']',_0xcb3b('0x5f'));_0x18e422[_0xcb3b('0x7b')]=util[_0xcb3b('0x44')](_0xcb3b('0x60'),_0x3d383b['serverUrl'],_0x18e422['uniqueid'],md5(_0x18e422[_0xcb3b('0x61')]));}else{_0x18e422['recordingURL']='';}return getConnection(_0x3d383b)[_0xcb3b('0x26')](function(_0x5615de){_0x1e7e74=_0x5615de;if(!_[_0xcb3b('0x22')](_0x4e5072)){return getUser(_0x3d383b,_0x4e5072[_0xcb3b('0x51')],_0x1e7e74);}else{return getUser(_0x3d383b,null,_0x1e7e74);}})[_0xcb3b('0x26')](function(_0x36c268){_0x2666ef=_0x36c268;return getEndUser(_0x3d383b,_0x2ae84b,_0x18e422[_0xcb3b('0x62')],_0x18e422[_0xcb3b('0x63')],_0x1e7e74);})[_0xcb3b('0x26')](function(_0x537925){_0x307716=_0x537925;return getTicket(_0x3d383b,_0x2666ef,_0x307716,_0x2ae84b,_0x18e422,_0x2ae84b[_0xcb3b('0x64')],_0x1e7e74);})[_0xcb3b('0x26')](function(_0x2d56fe){_0x194ac4=_0x2d56fe;logger[_0xcb3b('0x1e')]('['+_0x18e422[_0xcb3b('0x7c')]['toUpperCase']()+_0xcb3b('0x7d'),_0x194ac4['id']);logger['info']('['+_0x18e422['lastevent'][_0xcb3b('0x7a')]()+_0xcb3b('0x7e'),_0x3d383b[_0xcb3b('0x3d')]);})[_0xcb3b('0x6d')](function(_0x5d65cd){logger[_0xcb3b('0x6b')]('['+_0x18e422[_0xcb3b('0x7c')]['toUpperCase']()+']',_0x5d65cd);});}; \ 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 e87d366..a9d45b0 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 _0xa792=['true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','content','idField','customField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','label_entry','incident','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','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','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active'];(function(_0x58632b,_0x59d68b){var _0x4a08cd=function(_0x2ba3a4){while(--_0x2ba3a4){_0x58632b['push'](_0x58632b['shift']());}};_0x4a08cd(++_0x59d68b);}(_0xa792,0x13f));var _0x2a79=function(_0x389c96,_0x2eb57c){_0x389c96=_0x389c96-0x0;var _0x169844=_0xa792[_0x389c96];return _0x169844;};'use strict';var _=require(_0x2a79('0x0'));var Promise=require(_0x2a79('0x1'));var rp=require(_0x2a79('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x2a79('0x3'));var intUtil=require(_0x2a79('0x4'));var config=require(_0x2a79('0x5'));var logger=require('../../../../config/logger')(_0x2a79('0x6'));config[_0x2a79('0x7')]=_[_0x2a79('0x8')](config[_0x2a79('0x7')],{'host':_0x2a79('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x5afb55,_0x34f92a,_0xed4820,_0x429cf1,_0x356205,_0x1fa8a1){return new Promise(function(_0x472e58,_0x48b890){var _0x2d443e={'method':_0x2a79('0xa'),'uri':_0x429cf1+_0x2a79('0xb')+'&'+_0x356205+'&'+_0x1fa8a1,'auth':_0x34f92a,'json':!![]};return rp(_0x2d443e)[_0x2a79('0xc')](function(_0x7a691f){if(_0x7a691f[_0x2a79('0xd')]['length']>0x0){_0xed4820['adminId']=_0x7a691f[_0x2a79('0xd')][0x0][_0x2a79('0xe')];}logger[_0x2a79('0xf')]('['+[_0x5afb55[_0x2a79('0x10')]()]+_0x2a79('0x11'),_0xed4820);_0x472e58(_0xed4820);})[_0x2a79('0x12')](function(_0x50de7d){logger[_0x2a79('0x13')]('['+[_0x5afb55[_0x2a79('0x10')]()]+']',_0x50de7d[_0x2a79('0x14')]);_0x48b890(_0x50de7d[_0x2a79('0x14')]);});});}function getUser(_0x1964b2,_0x21fc8b,_0xcb2000,_0x576883,_0x4c1b28){return function(_0x2ba52d){logger['info']('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x15'),_0x2ba52d);return new Promise(function(_0x5140d9,_0x3723d5){if(intUtil['validateEmail'](_0x2ba52d['userEmail'])){var _0x26cfac={'method':_0x2a79('0xa'),'uri':_0xcb2000+'sys_user?sysparm_query=email%3D'+_0x2ba52d[_0x2a79('0x16')]+'&'+_0x576883+'&'+_0x4c1b28,'auth':_0x21fc8b,'json':!![]};logger[_0x2a79('0xf')]('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x17'),_0x26cfac);return rp(_0x26cfac)[_0x2a79('0xc')](function(_0x33919f){logger[_0x2a79('0xf')]('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x18'),_0x33919f);if(_0x33919f[_0x2a79('0xd')]['length']>0x0&&String(_0x33919f['result'][0x0][_0x2a79('0x19')])===_0x2a79('0x1a')){_0x2ba52d[_0x2a79('0x1b')]=_0x33919f['result'][0x0][_0x2a79('0xe')];}else{_0x2ba52d[_0x2a79('0x1b')]=_0x2ba52d[_0x2a79('0x1c')];_0x2ba52d[_0x2a79('0x16')]=_0x2ba52d[_0x2a79('0x1d')];}logger['info']('['+[_0x1964b2['toUpperCase']()]+_0x2a79('0x1e'),_0x2ba52d);_0x5140d9(_0x2ba52d);})['catch'](function(_0x117e5a){logger[_0x2a79('0x13')]('['+[_0x1964b2['toUpperCase']()]+']',_0x117e5a[_0x2a79('0x14')]);_0x3723d5(_0x117e5a[_0x2a79('0x14')]);});}else{logger[_0x2a79('0xf')]('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x1f'));_0x2ba52d['userId']=_0x2ba52d[_0x2a79('0x1c')];_0x2ba52d['userEmail']=_0x2ba52d[_0x2a79('0x1d')];_0x5140d9(_0x2ba52d);}});};}function createEndUser(_0x3785c4,_0x530710,_0x1ae4ff,_0x8a4b43,_0x34121e){logger[_0x2a79('0xf')]('['+[_0x3785c4['toUpperCase']()]+_0x2a79('0x20'),_0x1ae4ff);return new Promise(function(_0xd066ac,_0x1cb6dc){var _0x384905={'method':_0x2a79('0x21'),'uri':_0x8a4b43+_0x2a79('0x22')+_0x34121e,'body':{'user_name':_0x1ae4ff[_0x2a79('0x23')],'roles':_0x2a79('0x24'),'first_name':_0x1ae4ff[_0x2a79('0x23')],'active':'true','date_format':_0x2a79('0x25'),'phone':_0x1ae4ff[_0x2a79('0x23')]},'auth':_0x530710,'json':!![]};return rp(_0x384905)[_0x2a79('0xc')](function(_0x1223fe){logger['info']('['+[_0x3785c4[_0x2a79('0x10')]()]+_0x2a79('0x26'),_0x1223fe[_0x2a79('0xd')]);_0x1ae4ff['endUserId']=_0x1223fe['result'][_0x2a79('0xe')];_0xd066ac(_0x1ae4ff);})['catch'](function(_0x3fdc2a){logger[_0x2a79('0x13')]('['+[_0x3785c4['toUpperCase']()]+']',_0x3fdc2a['message']);_0x1cb6dc(_0x3fdc2a[_0x2a79('0x14')]);});});}function getEndUser(_0x446bfe,_0xc1debe,_0xa4f227,_0x4f5e0e,_0x3361ec){return function(_0x57e09e){logger[_0x2a79('0xf')]('['+[_0x446bfe[_0x2a79('0x10')]()]+_0x2a79('0x27'),_0x57e09e);return new Promise(function(_0x58ed70,_0x5d006a){var _0x4cf7a7={'method':_0x2a79('0xa'),'uri':_0xa4f227+_0x2a79('0x28')+_0x57e09e[_0x2a79('0x23')]+'&'+_0x4f5e0e+'&'+_0x3361ec,'auth':_0xc1debe,'json':!![]};return rp(_0x4cf7a7)[_0x2a79('0xc')](function(_0x32da07){if(_0x32da07[_0x2a79('0xd')][_0x2a79('0x29')]>0x0){_0x57e09e[_0x2a79('0x2a')]=_0x32da07['result'][0x0][_0x2a79('0xe')];logger['info']('['+[_0x446bfe['toUpperCase']()]+_0x2a79('0x2b'),_0x57e09e);_0x58ed70(_0x57e09e);}else{return createEndUser(_0x446bfe,_0xc1debe,_0x57e09e,_0xa4f227,_0x4f5e0e)[_0x2a79('0xc')](function(_0x5720f4){logger[_0x2a79('0xf')]('['+[_0x446bfe['toUpperCase']()]+_0x2a79('0x2c'),_0x5720f4);_0x58ed70(_0x5720f4);});}})[_0x2a79('0x12')](function(_0x16da20){logger[_0x2a79('0x13')]('['+[_0x446bfe[_0x2a79('0x10')]()]+']',_0x16da20[_0x2a79('0x14')]);_0x5d006a(_0x16da20['message']);});});};}function getCustomFields(_0x23141b,_0x132fa9){var _0x3180f7={};if(_0x23141b[_0x2a79('0x29')]>0x0){_[_0x2a79('0x2d')](_0x23141b,function(_0x9a0412){if(_['includes']([_0x2a79('0x2e'),_0x2a79('0x2f')],_0x9a0412[_0x2a79('0x30')])&&_0x9a0412[_0x2a79('0x31')]&&!_0x9a0412['customField']){_0x3180f7[_0x9a0412[_0x2a79('0x31')][_0x2a79('0x32')]()]=_0x9a0412[_0x2a79('0x33')]['toString']();}else if(_['includes']([_0x2a79('0x2e'),'picklist'],_0x9a0412[_0x2a79('0x30')])&&_0x9a0412[_0x2a79('0x34')]&&_0x9a0412[_0x2a79('0x35')]){_0x3180f7[_0x9a0412[_0x2a79('0x34')]['toLowerCase']()]=_0x9a0412['content'][_0x2a79('0x36')]();}else if(_0x9a0412[_0x2a79('0x30')]===_0x2a79('0x37')&&_0x9a0412['variableName']&&_0x9a0412['idField']&&_0x9a0412[_0x2a79('0x35')]){_0x3180f7[_0x9a0412['idField'][_0x2a79('0x32')]()]=_0x132fa9[_0x9a0412[_0x2a79('0x38')]][_0x2a79('0x36')]();}else if(_0x9a0412[_0x2a79('0x30')]===_0x2a79('0x39')&&_0x9a0412['Variable']&&_0x9a0412[_0x2a79('0x3a')][_0x2a79('0x3b')]&&_0x9a0412['idField']&&_0x9a0412[_0x2a79('0x35')]){_0x3180f7[_0x9a0412['idField'][_0x2a79('0x32')]()]=_0x132fa9[_0x9a0412['Variable'][_0x2a79('0x3b')][_0x2a79('0x32')]()]['toString']();}});}return _0x3180f7;}function getTicket(_0x164a32,_0x51456e,_0x6b5321,_0x3b2d07,_0x32210c,_0x5ec305){return function(_0x5ee4b8){logger[_0x2a79('0xf')]('['+[_0x164a32[_0x2a79('0x10')]()]+_0x2a79('0x3c'),_0x5ee4b8);return new Promise(function(_0x5d761c,_0x87a653){var _0x29dfcd=_0x164a32[_0x2a79('0x32')]()==='outbound'?_0x5ee4b8[_0x2a79('0x1b')]:_0x5ee4b8['endUserId'];var _0x2a979e={'method':_0x2a79('0x21'),'uri':_0x6b5321+'incident'+'?'+_0x5ec305,'body':Object[_0x2a79('0x3d')]({},{'active':_0x2a79('0x1a'),'caller_id':_0x29dfcd,'assigned_to':_0x5ee4b8['userId'],'short_description':intUtil[_0x2a79('0x3e')](_0x3b2d07[_0x2a79('0x3f')],_0x32210c,'\x20'),'description':intUtil[_0x2a79('0x3e')](_0x3b2d07[_0x2a79('0x40')],_0x32210c,'\x0a')},getCustomFields(_0x3b2d07[_0x2a79('0x41')],_0x32210c)),'auth':_0x51456e,'json':!![]};return rp(_0x2a979e)[_0x2a79('0xc')](function(_0x2c8a79){logger[_0x2a79('0xf')]('['+[_0x164a32['toUpperCase']()]+_0x2a79('0x42'),_0x2c8a79[_0x2a79('0xd')]);_0x5ee4b8[_0x2a79('0x43')]=_0x2c8a79[_0x2a79('0xd')]['sys_id'];_0x5ee4b8[_0x2a79('0x44')]=_0x2c8a79[_0x2a79('0xd')][_0x2a79('0x45')];logger[_0x2a79('0xf')]('['+[_0x164a32['toUpperCase']()]+']\x20getTicket\x20crm',_0x5ee4b8);_0x5d761c(_0x5ee4b8);})[_0x2a79('0x12')](function(_0x25e510){logger[_0x2a79('0x13')]('['+[_0x164a32[_0x2a79('0x10')]()]+']',_0x25e510['message']);_0x87a653(_0x25e510[_0x2a79('0x14')]);});});};}function createRemoteTag(_0x4738df,_0x3d661b,_0x22dea3,_0x3a1af6){return new Promise(function(_0x3708c4,_0x1e7c09){var _0x13245a={'method':_0x2a79('0x21'),'uri':_0x22dea3+_0x2a79('0x46')+'?'+_0x3a1af6,'body':{'short_description':_0x4738df,'global':!![],'active':!![],'name':_0x4738df},'auth':_0x3d661b,'json':!![]};return rp(_0x13245a)['then'](function(_0x48d0eb){var _0x1aedbe=_0x48d0eb[_0x2a79('0xd')][_0x2a79('0xe')];_0x3708c4(_0x1aedbe);});});}function getRemoteTag(_0x4a0d3a,_0xa667d,_0x48cd8b,_0x5a27da,_0x144e76){return new Promise(function(_0x5ecb18,_0x26d5c1){var _0x4c064e={'method':_0x2a79('0xa'),'uri':_0x48cd8b+'label'+'?sysparm_query=name%3D'+_0x4a0d3a+'&'+_0x5a27da,'auth':_0xa667d,'json':!![]};return rp(_0x4c064e)[_0x2a79('0xc')](function(_0x2f97d6){if(_0x2f97d6['result'][_0x2a79('0x29')]>0x0){var _0x47fb74=_0x2f97d6[_0x2a79('0xd')][0x0][_0x2a79('0xe')];_0x5ecb18(_0x47fb74);}else{return createRemoteTag(_0x4a0d3a,_0xa667d,_0x48cd8b,_0x5a27da)['then'](function(_0x6c77f8){_0x5ecb18(_0x6c77f8);});}});});}function assignTagToIncident(_0x493bd2,_0x2c9aa7,_0x430cd3,_0x5ac37b,_0x3b7fec){return new Promise(function(_0x370cd1,_0x205fd1){var _0x517dfc={'method':_0x2a79('0x21'),'uri':_0x430cd3+_0x2a79('0x47')+'?'+_0x3b7fec,'body':{'label':_0x493bd2,'table':_0x2a79('0x48'),'id_type':_0x2a79('0x49'),'table_key':_0x5ac37b[_0x2a79('0x43')],'title':_0x2a79('0x4a')+_0x5ac37b[_0x2a79('0x44')],'id_display':_0x5ac37b[_0x2a79('0x44')]},'auth':_0x2c9aa7,'json':!![]};return rp(_0x517dfc)[_0x2a79('0xc')](function(_0x579e0a){_0x370cd1();})[_0x2a79('0x12')](function(){_0x370cd1();});});}function manageTags(_0x66b0cc,_0x327992,_0x179d6d,_0x29000f,_0x50557b,_0x204cbc,_0x507c9f){return new Promise(function(_0x3613f9,_0x1574d2){var _0x2ef24a=[];_0x327992[_0x2a79('0x2d')](function(_0x4a8fb7){_0x2ef24a[_0x2a79('0x4b')](getRemoteTag(_0x4a8fb7,_0x179d6d,_0x29000f,_0x204cbc,_0x507c9f));});return Promise[_0x2a79('0x4c')](_0x2ef24a)['then'](function(_0x54cdc4){if(_0x54cdc4[_0x2a79('0x29')]){logger[_0x2a79('0xf')]('['+[_0x66b0cc[_0x2a79('0x10')]()]+_0x2a79('0x4d'),_0x54cdc4);var _0x189c76=[];_0x54cdc4['forEach'](function(_0x2f2225){_0x189c76[_0x2a79('0x4b')](assignTagToIncident(_0x2f2225,_0x179d6d,_0x29000f,_0x50557b,_0x204cbc));});return Promise['all'](_0x189c76)[_0x2a79('0xc')](function(){_0x3613f9();})[_0x2a79('0x12')](function(){_0x3613f9();});}else{_0x3613f9();}});});}function getTags(_0x2193ab,_0x515da7,_0x7009a,_0x5247eb,_0x20ecbe,_0x2de9a4){return function(_0xbace00){return new Promise(function(_0x238384,_0x1c927d){var _0x4134cd=[];var _0x32405d=_0x5247eb['Tags'];if(_0x32405d&&_0x32405d[_0x2a79('0x29')]>0x0){_0x4134cd=_[_0x2a79('0x4e')](_0x32405d,_0x2a79('0x3b'));}if(_0x4134cd['length']>0x0){return manageTags(_0x2193ab,_0x4134cd,_0x515da7,_0x7009a,_0xbace00,_0x20ecbe,_0x2de9a4)[_0x2a79('0xc')](function(){_0x238384(_0xbace00);});}else{_0x238384(_0xbace00);}});};}function emit(_0x5d8070,_0x15198b,_0x48e20f){var _0x3cc44c=_0x2a79('0x4f')+_0x2a79('0x50')+_0x2a79('0x51')+_0x2a79('0x52');var _0x33184c={'uri':_0x5d8070+_0x2a79('0x53')+_0x48e20f+_0x3cc44c};io['to'](util[_0x2a79('0x54')](_0x2a79('0x55'),_0x15198b))[_0x2a79('0x56')](_0x2a79('0x57'),_0x33184c);}exports['cs']=function(_0x11c9a5,_0x205e21,_0x5a2d63,_0x414a09,_0x59489a,_0x4772ac,_0xb5fdff,_0x5b170e){var _0x749408={};var _0x4fada4={'user':_0x4772ac[_0x2a79('0x58')],'pass':_0x4772ac[_0x2a79('0x59')]};var _0x20b149=_0x2a79('0x5a');var _0x412aa6='sysparm_display_value=true';_0x4772ac['remoteUri']=intUtil[_0x2a79('0x5b')](_0x4772ac[_0x2a79('0x5c')]);_0x4772ac['serverUrl']=intUtil['stripTrailingSlash'](_0x4772ac[_0x2a79('0x5d')]);var _0x51bd11=util[_0x2a79('0x54')](_0x2a79('0x5e'),_0x4772ac['remoteUri']);_0x749408[_0x2a79('0x16')]=!_[_0x2a79('0x5f')](_0x414a09)?_0x414a09[_0x2a79('0x60')]:null;_0x749408[_0x2a79('0x1d')]=_0x4772ac[_0x2a79('0x60')];_0x749408[_0x2a79('0x23')]=_0x5b170e['toLowerCase']()===_0x2a79('0x61')?_0x205e21[_0x2a79('0x62')]:_0x205e21['calleridnum'];_0x749408[_0x2a79('0x63')]=_0x5b170e==='queue'||_0x5b170e===_0x2a79('0x64')?_0x2a79('0x65'):_0x2a79('0x61');var _0x2b2d80=util[_0x2a79('0x54')](_0x2a79('0x66'),_0x4772ac['serverUrl'],_0x205e21[_0x2a79('0x67')],md5(_0x205e21[_0x2a79('0x67')]));if(_0x59489a&&_0x59489a[_0x2a79('0x68')]){logger['info'](_0x2a79('0x69'),_0x2a79('0x6a'));_0x205e21[_0x2a79('0x6b')]=_0x2b2d80;}else if(_0xb5fdff&&_0xb5fdff[_0x2a79('0x6c')]&&_0xb5fdff[_0x2a79('0x6c')]!==_0x2a79('0x6d')){logger[_0x2a79('0xf')]('[OUTBOUND]',_0x2a79('0x6a'));_0x205e21[_0x2a79('0x6b')]=_0x2b2d80;}else{_0x205e21[_0x2a79('0x6b')]='';}return getAdminUser(_0x5b170e,_0x4fada4,_0x749408,_0x51bd11,_0x412aa6,_0x20b149)[_0x2a79('0xc')](getUser(_0x5b170e,_0x4fada4,_0x51bd11,_0x412aa6,_0x20b149))[_0x2a79('0xc')](getEndUser(_0x5b170e,_0x4fada4,_0x51bd11,_0x412aa6,_0x20b149))['then'](getTicket(_0x5b170e,_0x4fada4,_0x51bd11,_0x5a2d63,_0x205e21,_0x412aa6))[_0x2a79('0xc')](function(_0x47e6f8){logger[_0x2a79('0xf')](util[_0x2a79('0x54')](_0x2a79('0x6e'),_0x47e6f8[_0x2a79('0x43')]));logger[_0x2a79('0xf')](util[_0x2a79('0x54')](_0x2a79('0x6f'),_0x5b170e));if(_0x5b170e!==_0x2a79('0x64')){logger['info']('['+[_0x5b170e['toUpperCase']()]+']',_0x2a79('0x70'));emit(_0x4772ac[_0x2a79('0x5c')],_0x414a09[_0x2a79('0x3b')],_0x47e6f8[_0x2a79('0x43')]);}})[_0x2a79('0x12')](function(_0x2dad71){logger[_0x2a79('0x13')]('['+[_0x5b170e[_0x2a79('0x10')]()]+_0x2a79('0x71'),util[_0x2a79('0x72')](_0x2dad71,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0cdd=['error','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','toString','includes','idField','content','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','calleridnum','callDirection','unmanaged','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','then','result','length','sys_id','info','],\x20getAdminUser\x20crm','catch','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20entity','true','userId','adminId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','endUserId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cdd,0x16e));var _0xd0cd=function(_0x54cd2e,_0x248f9c){_0x54cd2e=_0x54cd2e-0x0;var _0x443911=_0x0cdd[_0x54cd2e];return _0x443911;};'use strict';var _=require('lodash');var Promise=require(_0xd0cd('0x0'));var rp=require(_0xd0cd('0x1'));var util=require(_0xd0cd('0x2'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xd0cd('0x3'));var config=require(_0xd0cd('0x4'));var logger=require(_0xd0cd('0x5'))(_0xd0cd('0x6'));config[_0xd0cd('0x7')]=_['defaults'](config[_0xd0cd('0x7')],{'host':_0xd0cd('0x8'),'port':0x18eb});var io=require(_0xd0cd('0x9'))(new Redis(config[_0xd0cd('0x7')]));function getAdminUser(_0x14c7ab,_0x523e48,_0x35c2fe,_0x25b187,_0x3646df,_0x249a8d){return new Promise(function(_0x25a530,_0x3bfa07){var _0x3bb10a={'method':'GET','uri':_0x25b187+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x3646df+'&'+_0x249a8d,'auth':_0x523e48,'json':!![]};return rp(_0x3bb10a)[_0xd0cd('0xa')](function(_0x40dabd){if(_0x40dabd[_0xd0cd('0xb')][_0xd0cd('0xc')]>0x0){_0x35c2fe['adminId']=_0x40dabd['result'][0x0][_0xd0cd('0xd')];}logger[_0xd0cd('0xe')]('['+[_0x14c7ab['toUpperCase']()]+_0xd0cd('0xf'),_0x35c2fe);_0x25a530(_0x35c2fe);})[_0xd0cd('0x10')](function(_0x421323){logger['error']('['+[_0x14c7ab['toUpperCase']()]+']',_0x421323['message']);_0x3bfa07(_0x421323[_0xd0cd('0x11')]);});});}function getUser(_0x31b5cc,_0x314850,_0x471389,_0x4f39b4,_0x3d9511){return function(_0x9a26af){logger[_0xd0cd('0xe')]('['+[_0x31b5cc[_0xd0cd('0x12')]()]+_0xd0cd('0x13'),_0x9a26af);return new Promise(function(_0x214efe,_0x33e42a){if(intUtil[_0xd0cd('0x14')](_0x9a26af[_0xd0cd('0x15')])){var _0x428b2a={'method':_0xd0cd('0x16'),'uri':_0x471389+'sys_user?sysparm_query=email%3D'+_0x9a26af[_0xd0cd('0x15')]+'&'+_0x4f39b4+'&'+_0x3d9511,'auth':_0x314850,'json':!![]};logger['info']('['+[_0x31b5cc[_0xd0cd('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x428b2a);return rp(_0x428b2a)[_0xd0cd('0xa')](function(_0x22ba2b){logger[_0xd0cd('0xe')]('['+[_0x31b5cc['toUpperCase']()]+_0xd0cd('0x17'),_0x22ba2b);if(_0x22ba2b[_0xd0cd('0xb')][_0xd0cd('0xc')]>0x0&&String(_0x22ba2b[_0xd0cd('0xb')][0x0]['active'])===_0xd0cd('0x18')){_0x9a26af[_0xd0cd('0x19')]=_0x22ba2b['result'][0x0][_0xd0cd('0xd')];}else{_0x9a26af[_0xd0cd('0x19')]=_0x9a26af[_0xd0cd('0x1a')];_0x9a26af['userEmail']=_0x9a26af[_0xd0cd('0x1b')];}logger[_0xd0cd('0xe')]('['+[_0x31b5cc[_0xd0cd('0x12')]()]+'],\x20getUser\x20crm',_0x9a26af);_0x214efe(_0x9a26af);})[_0xd0cd('0x10')](function(_0x7ca094){logger['error']('['+[_0x31b5cc[_0xd0cd('0x12')]()]+']',_0x7ca094[_0xd0cd('0x11')]);_0x33e42a(_0x7ca094['message']);});}else{logger['info']('['+[_0x31b5cc[_0xd0cd('0x12')]()]+_0xd0cd('0x1c'));_0x9a26af[_0xd0cd('0x19')]=_0x9a26af[_0xd0cd('0x1a')];_0x9a26af['userEmail']=_0x9a26af[_0xd0cd('0x1b')];_0x214efe(_0x9a26af);}});};}function createEndUser(_0x3c0495,_0x5d7571,_0x1afed2,_0x4a9b14,_0x3ba2ab){logger[_0xd0cd('0xe')]('['+[_0x3c0495[_0xd0cd('0x12')]()]+_0xd0cd('0x1d'),_0x1afed2);return new Promise(function(_0x24be48,_0x229667){var _0x4ec743={'method':_0xd0cd('0x1e'),'uri':_0x4a9b14+'sys_user?'+_0x3ba2ab,'body':{'user_name':_0x1afed2['endUserNumber'],'roles':'user','first_name':_0x1afed2[_0xd0cd('0x1f')],'active':_0xd0cd('0x18'),'date_format':_0xd0cd('0x20'),'phone':_0x1afed2[_0xd0cd('0x1f')]},'auth':_0x5d7571,'json':!![]};return rp(_0x4ec743)[_0xd0cd('0xa')](function(_0x19a9b5){logger[_0xd0cd('0xe')]('['+[_0x3c0495[_0xd0cd('0x12')]()]+'],\x20EndUser\x20schema',_0x19a9b5[_0xd0cd('0xb')]);_0x1afed2[_0xd0cd('0x21')]=_0x19a9b5[_0xd0cd('0xb')]['sys_id'];_0x24be48(_0x1afed2);})[_0xd0cd('0x10')](function(_0x158e45){logger[_0xd0cd('0x22')]('['+[_0x3c0495[_0xd0cd('0x12')]()]+']',_0x158e45[_0xd0cd('0x11')]);_0x229667(_0x158e45['message']);});});}function getEndUser(_0x3d5a27,_0x3f4797,_0x596105,_0x3a79c4,_0xdcefc8){return function(_0x1827e3){logger[_0xd0cd('0xe')]('['+[_0x3d5a27[_0xd0cd('0x12')]()]+_0xd0cd('0x23'),_0x1827e3);return new Promise(function(_0x2f0a0a,_0x1bd16e){var _0x96669e={'method':'GET','uri':_0x596105+'sys_user?sysparm_query=phone%3D'+_0x1827e3[_0xd0cd('0x1f')]+'&'+_0x3a79c4+'&'+_0xdcefc8,'auth':_0x3f4797,'json':!![]};return rp(_0x96669e)[_0xd0cd('0xa')](function(_0x1fbc2a){if(_0x1fbc2a[_0xd0cd('0xb')][_0xd0cd('0xc')]>0x0){_0x1827e3[_0xd0cd('0x21')]=_0x1fbc2a['result'][0x0][_0xd0cd('0xd')];logger[_0xd0cd('0xe')]('['+[_0x3d5a27[_0xd0cd('0x12')]()]+_0xd0cd('0x24'),_0x1827e3);_0x2f0a0a(_0x1827e3);}else{return createEndUser(_0x3d5a27,_0x3f4797,_0x1827e3,_0x596105,_0x3a79c4)['then'](function(_0x296584){logger[_0xd0cd('0xe')]('['+[_0x3d5a27[_0xd0cd('0x12')]()]+_0xd0cd('0x25'),_0x296584);_0x2f0a0a(_0x296584);});}})[_0xd0cd('0x10')](function(_0x246bd2){logger[_0xd0cd('0x22')]('['+[_0x3d5a27[_0xd0cd('0x12')]()]+']',_0x246bd2[_0xd0cd('0x11')]);_0x1bd16e(_0x246bd2[_0xd0cd('0x11')]);});});};}function getCustomFields(_0x3ecc6b,_0x2bccf7){var _0x121d5b={};if(_0x3ecc6b[_0xd0cd('0xc')]>0x0){_[_0xd0cd('0x26')](_0x3ecc6b,function(_0x417c5e){if(_['includes']([_0xd0cd('0x27'),_0xd0cd('0x28')],_0x417c5e[_0xd0cd('0x29')])&&_0x417c5e[_0xd0cd('0x2a')]&&!_0x417c5e[_0xd0cd('0x2b')]){_0x121d5b[_0x417c5e[_0xd0cd('0x2a')][_0xd0cd('0x2c')]()]=_0x417c5e['content'][_0xd0cd('0x2d')]();}else if(_[_0xd0cd('0x2e')](['string',_0xd0cd('0x28')],_0x417c5e[_0xd0cd('0x29')])&&_0x417c5e[_0xd0cd('0x2f')]&&_0x417c5e[_0xd0cd('0x2b')]){_0x121d5b[_0x417c5e[_0xd0cd('0x2f')][_0xd0cd('0x2c')]()]=_0x417c5e[_0xd0cd('0x30')][_0xd0cd('0x2d')]();}else if(_0x417c5e[_0xd0cd('0x29')]===_0xd0cd('0x31')&&_0x417c5e['variableName']&&_0x417c5e[_0xd0cd('0x2f')]&&_0x417c5e[_0xd0cd('0x2b')]){_0x121d5b[_0x417c5e[_0xd0cd('0x2f')][_0xd0cd('0x2c')]()]=_0x2bccf7[_0x417c5e[_0xd0cd('0x32')]][_0xd0cd('0x2d')]();}else if(_0x417c5e[_0xd0cd('0x29')]==='customVariable'&&_0x417c5e[_0xd0cd('0x33')]&&_0x417c5e[_0xd0cd('0x33')][_0xd0cd('0x34')]&&_0x417c5e[_0xd0cd('0x2f')]&&_0x417c5e['customField']){_0x121d5b[_0x417c5e[_0xd0cd('0x2f')]['toLowerCase']()]=_0x2bccf7[_0x417c5e['Variable'][_0xd0cd('0x34')]['toLowerCase']()]['toString']();}});}return _0x121d5b;}function getTicket(_0x5c989f,_0x4b7379,_0x21417e,_0x3b9e5a,_0x1e913d,_0x45bbfa){return function(_0x3fbe8e){logger['info']('['+[_0x5c989f[_0xd0cd('0x12')]()]+_0xd0cd('0x35'),_0x3fbe8e);return new Promise(function(_0x597162,_0x598be5){var _0xb32941=_0x5c989f[_0xd0cd('0x2c')]()===_0xd0cd('0x36')?_0x3fbe8e[_0xd0cd('0x19')]:_0x3fbe8e[_0xd0cd('0x21')];var _0x5ee863={'method':'POST','uri':_0x21417e+_0xd0cd('0x37')+'?'+_0x45bbfa,'body':Object[_0xd0cd('0x38')]({},{'active':_0xd0cd('0x18'),'caller_id':_0xb32941,'assigned_to':_0x3fbe8e[_0xd0cd('0x19')],'short_description':intUtil[_0xd0cd('0x39')](_0x3b9e5a[_0xd0cd('0x3a')],_0x1e913d,'\x20'),'description':intUtil[_0xd0cd('0x39')](_0x3b9e5a[_0xd0cd('0x3b')],_0x1e913d,'\x0a')},getCustomFields(_0x3b9e5a['Fields'],_0x1e913d)),'auth':_0x4b7379,'json':!![]};return rp(_0x5ee863)[_0xd0cd('0xa')](function(_0x3b4809){logger['info']('['+[_0x5c989f['toUpperCase']()]+_0xd0cd('0x3c'),_0x3b4809[_0xd0cd('0xb')]);_0x3fbe8e[_0xd0cd('0x3d')]=_0x3b4809[_0xd0cd('0xb')][_0xd0cd('0xd')];_0x3fbe8e[_0xd0cd('0x3e')]=_0x3b4809['result']['number'];logger[_0xd0cd('0xe')]('['+[_0x5c989f['toUpperCase']()]+_0xd0cd('0x3f'),_0x3fbe8e);_0x597162(_0x3fbe8e);})[_0xd0cd('0x10')](function(_0x128a88){logger['error']('['+[_0x5c989f[_0xd0cd('0x12')]()]+']',_0x128a88['message']);_0x598be5(_0x128a88[_0xd0cd('0x11')]);});});};}function createRemoteTag(_0x3592af,_0x1e25a0,_0x318dc5,_0x2f022d){return new Promise(function(_0x761e26,_0x54a6ee){var _0x7703d3={'method':_0xd0cd('0x1e'),'uri':_0x318dc5+'label'+'?'+_0x2f022d,'body':{'short_description':_0x3592af,'global':!![],'active':!![],'name':_0x3592af},'auth':_0x1e25a0,'json':!![]};return rp(_0x7703d3)[_0xd0cd('0xa')](function(_0x9507a3){var _0xe58c5e=_0x9507a3[_0xd0cd('0xb')][_0xd0cd('0xd')];_0x761e26(_0xe58c5e);});});}function getRemoteTag(_0x357bea,_0x24afdc,_0x542fe9,_0x130753,_0x39cfa3){return new Promise(function(_0x5d08e1,_0x1e8494){var _0x7667a3={'method':'GET','uri':_0x542fe9+_0xd0cd('0x40')+_0xd0cd('0x41')+_0x357bea+'&'+_0x130753,'auth':_0x24afdc,'json':!![]};return rp(_0x7667a3)[_0xd0cd('0xa')](function(_0x49f1f6){if(_0x49f1f6['result'][_0xd0cd('0xc')]>0x0){var _0x1ffcb5=_0x49f1f6[_0xd0cd('0xb')][0x0][_0xd0cd('0xd')];_0x5d08e1(_0x1ffcb5);}else{return createRemoteTag(_0x357bea,_0x24afdc,_0x542fe9,_0x130753)[_0xd0cd('0xa')](function(_0x2bd3c3){_0x5d08e1(_0x2bd3c3);});}});});}function assignTagToIncident(_0xe6bf06,_0x4514b8,_0x41e7df,_0x4babb5,_0x42aa0e){return new Promise(function(_0xa2201e,_0x4c1ba6){var _0xdd5bb5={'method':_0xd0cd('0x1e'),'uri':_0x41e7df+_0xd0cd('0x42')+'?'+_0x42aa0e,'body':{'label':_0xe6bf06,'table':_0xd0cd('0x37'),'id_type':'Incident','table_key':_0x4babb5[_0xd0cd('0x3d')],'title':_0xd0cd('0x43')+_0x4babb5[_0xd0cd('0x3e')],'id_display':_0x4babb5[_0xd0cd('0x3e')]},'auth':_0x4514b8,'json':!![]};return rp(_0xdd5bb5)[_0xd0cd('0xa')](function(_0x166fa1){_0xa2201e();})[_0xd0cd('0x10')](function(){_0xa2201e();});});}function manageTags(_0x211514,_0x12c6d3,_0x2aab59,_0x55acd9,_0x5256c5,_0x51fc1f,_0x1ab276){return new Promise(function(_0x1b6838,_0x2f6fed){var _0x2fb47f=[];_0x12c6d3[_0xd0cd('0x26')](function(_0x2fac53){_0x2fb47f[_0xd0cd('0x44')](getRemoteTag(_0x2fac53,_0x2aab59,_0x55acd9,_0x51fc1f,_0x1ab276));});return Promise[_0xd0cd('0x45')](_0x2fb47f)[_0xd0cd('0xa')](function(_0xac3a9e){if(_0xac3a9e[_0xd0cd('0xc')]){logger['info']('['+[_0x211514[_0xd0cd('0x12')]()]+_0xd0cd('0x46'),_0xac3a9e);var _0x44784b=[];_0xac3a9e[_0xd0cd('0x26')](function(_0x254dcb){_0x44784b[_0xd0cd('0x44')](assignTagToIncident(_0x254dcb,_0x2aab59,_0x55acd9,_0x5256c5,_0x51fc1f));});return Promise[_0xd0cd('0x45')](_0x44784b)[_0xd0cd('0xa')](function(){_0x1b6838();})[_0xd0cd('0x10')](function(){_0x1b6838();});}else{_0x1b6838();}});});}function getTags(_0x28869f,_0x4ab855,_0x46798a,_0x5ba9e3,_0x39231c,_0xe6de4f){return function(_0x46fc73){return new Promise(function(_0x364a78,_0x6b610c){var _0x418fdc=[];var _0x480a47=_0x5ba9e3['Tags'];if(_0x480a47&&_0x480a47[_0xd0cd('0xc')]>0x0){_0x418fdc=_['map'](_0x480a47,_0xd0cd('0x34'));}if(_0x418fdc[_0xd0cd('0xc')]>0x0){return manageTags(_0x28869f,_0x418fdc,_0x4ab855,_0x46798a,_0x46fc73,_0x39231c,_0xe6de4f)[_0xd0cd('0xa')](function(){_0x364a78(_0x46fc73);});}else{_0x364a78(_0x46fc73);}});};}function emit(_0x76c848,_0x2f496b,_0x1c760e){var _0xa8e171='%26sysparm_record_target%3Dincident'+_0xd0cd('0x47')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xd0cd('0x48');var _0x3445f4={'uri':_0x76c848+_0xd0cd('0x49')+_0x1c760e+_0xa8e171};io['to'](util[_0xd0cd('0x4a')]('user:%s',_0x2f496b))[_0xd0cd('0x4b')](_0xd0cd('0x4c'),_0x3445f4);}exports['cs']=function(_0x5d8add,_0x2fd46d,_0xc7dabc,_0x169075,_0x3dfded,_0x2dada9,_0x35b4f0,_0x4e3325){var _0x1ae78b={};var _0x2b27a9={'user':_0x2dada9[_0xd0cd('0x4d')],'pass':_0x2dada9[_0xd0cd('0x4e')]};var _0x2d5ef9=_0xd0cd('0x4f');var _0x17ff2b=_0xd0cd('0x50');_0x2dada9[_0xd0cd('0x51')]=intUtil[_0xd0cd('0x52')](_0x2dada9['remoteUri']);_0x2dada9['serverUrl']=intUtil['stripTrailingSlash'](_0x2dada9[_0xd0cd('0x53')]);var _0x189683=util['format']('%s/api/now/table/',_0x2dada9[_0xd0cd('0x51')]);_0x1ae78b[_0xd0cd('0x15')]=!_[_0xd0cd('0x54')](_0x169075)?_0x169075[_0xd0cd('0x55')]:null;_0x1ae78b['adminEmail']=_0x2dada9[_0xd0cd('0x55')];_0x1ae78b[_0xd0cd('0x1f')]=_0x4e3325[_0xd0cd('0x2c')]()===_0xd0cd('0x36')?_0x2fd46d['destcalleridnum']:_0x2fd46d[_0xd0cd('0x56')];_0x1ae78b[_0xd0cd('0x57')]=_0x4e3325==='queue'||_0x4e3325===_0xd0cd('0x58')?'queue':_0xd0cd('0x36');var _0x583cc4=util[_0xd0cd('0x4a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dada9['serverUrl'],_0x2fd46d[_0xd0cd('0x59')],md5(_0x2fd46d['uniqueid']));if(_0x3dfded&&_0x3dfded['monitor_format']){logger['info']('[QUEUE]',_0xd0cd('0x5a'));_0x2fd46d[_0xd0cd('0x5b')]=_0x583cc4;}else if(_0x35b4f0&&_0x35b4f0[_0xd0cd('0x5c')]&&_0x35b4f0[_0xd0cd('0x5c')]!==_0xd0cd('0x5d')){logger[_0xd0cd('0xe')](_0xd0cd('0x5e'),_0xd0cd('0x5a'));_0x2fd46d[_0xd0cd('0x5b')]=_0x583cc4;}else{_0x2fd46d[_0xd0cd('0x5b')]='';}return getAdminUser(_0x4e3325,_0x2b27a9,_0x1ae78b,_0x189683,_0x17ff2b,_0x2d5ef9)[_0xd0cd('0xa')](getUser(_0x4e3325,_0x2b27a9,_0x189683,_0x17ff2b,_0x2d5ef9))[_0xd0cd('0xa')](getEndUser(_0x4e3325,_0x2b27a9,_0x189683,_0x17ff2b,_0x2d5ef9))[_0xd0cd('0xa')](getTicket(_0x4e3325,_0x2b27a9,_0x189683,_0xc7dabc,_0x2fd46d,_0x17ff2b))[_0xd0cd('0xa')](function(_0x16bfd6){logger[_0xd0cd('0xe')](util['format'](_0xd0cd('0x5f'),_0x16bfd6[_0xd0cd('0x3d')]));logger['info'](util[_0xd0cd('0x4a')](_0xd0cd('0x60'),_0x4e3325));if(_0x4e3325!=='unmanaged'){logger['info']('['+[_0x4e3325['toUpperCase']()]+']',_0xd0cd('0x61'));emit(_0x2dada9['remoteUri'],_0x169075[_0xd0cd('0x34')],_0x16bfd6[_0xd0cd('0x3d')]);}})[_0xd0cd('0x10')](function(_0x8e55d2){logger[_0xd0cd('0x22')]('['+[_0x4e3325[_0xd0cd('0x12')]()]+_0xd0cd('0x62'),util[_0xd0cd('0x63')](_0x8e55d2,{'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 27367a2..db79cbc 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 _0x40ec=['unmanaged','lastevent','toUpperCase','calleridname','Fields','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','created_by','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','direction','length','variableName','JSON','stringify','format','apiKey','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable','toString','customVariable','Variable','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','uri','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','[OUTBOUND]','error'];(function(_0x338391,_0x4d5e84){var _0x363e1c=function(_0x15f7f6){while(--_0x15f7f6){_0x338391['push'](_0x338391['shift']());}};_0x363e1c(++_0x4d5e84);}(_0x40ec,0x1f1));var _0xc40e=function(_0x454e78,_0x599695){_0x454e78=_0x454e78-0x0;var _0x54f35e=_0x40ec[_0x454e78];return _0x54f35e;};'use strict';var _=require('lodash');var rp=require(_0xc40e('0x0'));var BPromise=require(_0xc40e('0x1'));var md5=require(_0xc40e('0x2'));var util=require('util');var Redis=require(_0xc40e('0x3'));var intUtil=require(_0xc40e('0x4'));var config=require(_0xc40e('0x5'));var logger=require(_0xc40e('0x6'))(_0xc40e('0x7'));config[_0xc40e('0x8')]=_[_0xc40e('0x9')](config[_0xc40e('0x8')],{'host':_0xc40e('0xa'),'port':0x18eb});var io=require(_0xc40e('0xb'))(new Redis(config[_0xc40e('0x8')]));var def={'method':_0xc40e('0xc'),'json':!![]};function emit(_0x475e3a,_0x12bb14,_0x40746d){io['to'](_0x475e3a)[_0xc40e('0xd')](_0x12bb14,_0x40746d);}function getTicket(_0xc81e82,_0xe79ea2,_0x1afce3,_0x4c94a7,_0x575783,_0x3e10a1,_0x322c78,_0x13f668){logger['info'](_0xc40e('0xe'));var _0x29f37d=new Date();var _0x483467=[{'name':_0xc40e('0xf'),'value':intUtil[_0xc40e('0x10')](_0x4c94a7['Subjects'],_0x575783,'\x20')},{'name':'assigned_user_id','value':_0xe79ea2['id']},{'name':_0xc40e('0x11'),'value':_0xe79ea2['id']},{'name':'description','value':intUtil['getString'](_0x4c94a7[_0xc40e('0x12')],_0x575783,'\x0a')},{'name':_0xc40e('0x13'),'value':_0x29f37d[_0xc40e('0x14')]()[_0xc40e('0x15')](0x0,0x13)[_0xc40e('0x16')]('T','\x20')},{'name':_0xc40e('0x17'),'value':'0'},{'name':_0xc40e('0x18'),'value':'15'},{'name':_0xc40e('0x19'),'value':_0x1afce3['id']},{'name':'parent_type','value':_0xc40e('0x1a')},{'name':'parent_name','value':_0x1afce3[_0xc40e('0xf')]},{'name':_0xc40e('0x1b'),'value':_0x13f668}];if(_0x3e10a1[_0xc40e('0x1c')]){_['forEach'](_0x3e10a1,function(_0x2afc28){if(_0x575783[_0x2afc28[_0xc40e('0x1d')]]){_0x483467['push']({'name':_0x2afc28['idField'],'value':_0x575783[_0x2afc28[_0xc40e('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x322c78['id'],'module_name':'Calls','name_value_list':_0x483467})}});}function getAuth(_0x2e5dc4){return util[_0xc40e('0x20')]('Basic\x20%s',new Buffer(_0x2e5dc4[_0xc40e('0x21')]+':X')['toString'](_0xc40e('0x22')));}function getServerInfo(_0x5e9ad4){return request({'form':{'method':'get_server_info','input_type':_0xc40e('0x1e'),'response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x5e9ad4['id']})}});}function getUser(_0x29104e,_0x41bf01,_0x4d0697){if(!_[_0xc40e('0x23')](_0x41bf01)){logger[_0xc40e('0x24')](_0xc40e('0x25'),_0x41bf01);return request({'form':{'method':_0xc40e('0x26'),'input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON['stringify']({'session':_0x4d0697['id'],'module_name':_0xc40e('0x27'),'query':util[_0xc40e('0x20')](_0xc40e('0x28'),_0x41bf01),'order_by':'','offset':'0','select_fields':['id',_0xc40e('0xf'),_0xc40e('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc40e('0x2a')](function(_0x2b0227){if(_0x2b0227[_0xc40e('0x2b')][_0xc40e('0x1c')]){var _0xeda089=_[_0xc40e('0x2c')](_0x2b0227[_0xc40e('0x2b')],function(_0x59146d){return _0x59146d[_0xc40e('0x2d')][_0xc40e('0x29')][_0xc40e('0x2e')]===_0x41bf01;});if(_0xeda089){logger[_0xc40e('0x24')](_0xc40e('0x2f'));return BPromise[_0xc40e('0x30')]({'id':_0xeda089['name_value_list']['id'][_0xc40e('0x2e')],'name':_0xeda089[_0xc40e('0x2d')][_0xc40e('0xf')]['value']});}}logger[_0xc40e('0x24')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc40e('0x30')]({'id':_0x4d0697[_0xc40e('0x2d')][_0xc40e('0x31')]['value'],'name':_0x4d0697[_0xc40e('0x2d')][_0xc40e('0x29')][_0xc40e('0x2e')]});});}else{logger['info'](_0xc40e('0x32'));return BPromise[_0xc40e('0x30')]({'id':_0x4d0697[_0xc40e('0x2d')][_0xc40e('0x31')][_0xc40e('0x2e')],'name':_0x4d0697['name_value_list'][_0xc40e('0x29')][_0xc40e('0x2e')]});}}function getEndUser(_0x3850af,_0x5c6a1c,_0x3a522e,_0x1552a5){logger[_0xc40e('0x24')]('Searching\x20enduser\x20with\x20phone',_0x3a522e);return request({'form':{'method':_0xc40e('0x26'),'input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x1552a5['id'],'module_name':_0xc40e('0x1a'),'query':util[_0xc40e('0x20')](_0xc40e('0x33'),_0x3a522e),'order_by':'','offset':'0','select_fields':['id',_0xc40e('0xf'),_0xc40e('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc40e('0x2a')](function(_0x1b0186){if(_0x1b0186[_0xc40e('0x2b')][_0xc40e('0x1c')]){var _0x5a124c=_[_0xc40e('0x2c')](_0x1b0186[_0xc40e('0x2b')],function(_0x38f5b0){return _0x38f5b0[_0xc40e('0x2d')][_0xc40e('0x34')][_0xc40e('0x2e')]===_0x3a522e;});if(_0x5a124c){logger['info'](_0xc40e('0x35'));return BPromise[_0xc40e('0x30')]({'id':_0x5a124c[_0xc40e('0x2d')]['id'][_0xc40e('0x2e')],'name':_0x5a124c[_0xc40e('0x2d')][_0xc40e('0xf')][_0xc40e('0x2e')],'phone':_0x5a124c[_0xc40e('0x2d')][_0xc40e('0x34')][_0xc40e('0x2e')]});}}else{logger[_0xc40e('0x24')](_0xc40e('0x36'));return request({'form':{'method':_0xc40e('0x37'),'input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x1552a5['id'],'module_name':'Contacts','name_value_list':[{'name':_0xc40e('0x38'),'value':_0x5c6a1c!==_0xc40e('0x39')?_0x5c6a1c:util[_0xc40e('0x20')](_0xc40e('0x3a'),_0x3a522e)},{'name':_0xc40e('0x34'),'value':_0x3a522e}]})}})[_0xc40e('0x2a')](function(_0x42c8dd){logger[_0xc40e('0x24')](_0xc40e('0x3b'));return BPromise[_0xc40e('0x30')]({'id':_0x42c8dd['id'],'name':_0x42c8dd['entry_list'][_0xc40e('0x38')][_0xc40e('0x2e')],'phone':_0x42c8dd[_0xc40e('0x2b')]['phone_home'][_0xc40e('0x2e')]});});}});}function request(_0x54c8f7){logger[_0xc40e('0x3c')](_0xc40e('0x3d'),JSON[_0xc40e('0x1f')](_0x54c8f7));return rp(_[_0xc40e('0x3e')](def,_0x54c8f7));}function getTags(_0x139f46,_0xbde9a9){var _0x5b1e8e=[];if(_0x139f46&&_0x139f46[_0xc40e('0x1c')]>0x0){_0x5b1e8e=_[_0xc40e('0x3f')](_0x139f46,_0xbde9a9);}return _0x5b1e8e;}function getCustomFields(_0x5d6fb4,_0x209fab){var _0xe7c5b0=[];var _0xf8f8bf={'custom_fields':[]};if(_0x5d6fb4[_0xc40e('0x1c')]>0x0){_[_0xc40e('0x40')](_0x5d6fb4,function(_0x52ea1f){if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x42')&&_0x52ea1f[_0xc40e('0x43')]&&!_0x52ea1f[_0xc40e('0x44')]){_0xf8f8bf[_0x52ea1f['nameField'][_0xc40e('0x45')]()]=_0x52ea1f[_0xc40e('0x46')]['toString']();}else if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x42')&&_0x52ea1f['idField']&&_0x52ea1f[_0xc40e('0x44')]){_0xf8f8bf[_0xc40e('0x47')][_0xc40e('0x48')]({'id':_0x52ea1f[_0xc40e('0x49')],'value':_0x52ea1f[_0xc40e('0x46')]['toString']()});}else if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x4a')&&_0x52ea1f[_0xc40e('0x1d')]&&_0x52ea1f[_0xc40e('0x49')]&&_0x52ea1f['customField']){_0x209fab[_0x52ea1f[_0xc40e('0x1d')]]&&_0xf8f8bf[_0xc40e('0x47')][_0xc40e('0x48')]({'id':_0x52ea1f[_0xc40e('0x49')],'value':_0x209fab[_0x52ea1f[_0xc40e('0x1d')]][_0xc40e('0x4b')]()});}else if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x4c')&&_0x52ea1f[_0xc40e('0x4d')]&&_0x52ea1f[_0xc40e('0x4d')]['name']&&_0x52ea1f['idField']&&_0x52ea1f['customField']){_0x209fab[_0x52ea1f[_0xc40e('0x4d')][_0xc40e('0xf')][_0xc40e('0x45')]()]&&_0xf8f8bf[_0xc40e('0x47')][_0xc40e('0x48')]({'id':_0x52ea1f['idField'],'value':_0x209fab[_0x52ea1f[_0xc40e('0x4d')][_0xc40e('0xf')][_0xc40e('0x45')]()][_0xc40e('0x4b')]()});}});}return _0xf8f8bf;}function getConnection(_0x1b6473){return request({'method':_0xc40e('0xc'),'form':{'method':'login','input_type':_0xc40e('0x1e'),'response_type':'JSON','rest_data':JSON[_0xc40e('0x1f')]({'user_auth':{'user_name':_0x1b6473['username'],'password':_0x1b6473[_0xc40e('0x4e')],'encryption':'PLAIN'},'application':_0xc40e('0x4f')})}})[_0xc40e('0x2a')](function(_0x41225c){var _0x191221=_0x41225c;if(_0x191221['id']){def[_0xc40e('0x50')]=_0x191221['id'];return BPromise['resolve'](_0x191221);}else{throw new Error(util[_0xc40e('0x20')](_0xc40e('0x51'),_0x1b6473['id']));}});}function setRelationship(_0x39503b,_0x14cb50,_0xc30aae,_0x3ec60d){return request({'form':{'method':_0xc40e('0x52'),'input_type':_0xc40e('0x1e'),'response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x39503b['id'],'module_name':'Calls','module_id':_0xc30aae['id'],'link_field_name':_0x3ec60d,'related_ids':[_0x14cb50['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xc40e('0x53')]=function(_0xeab57,_0x55a796,_0x119730,_0x136d39,_0x119365,_0x54effd){var _0x48f266,_0x5d5432,_0x48040c,_0x1c9fc4;_0x54effd['remoteUri']=intUtil['stripTrailingSlash'](_0x54effd['remoteUri']);_0x54effd[_0xc40e('0x54')]=intUtil[_0xc40e('0x55')](_0x54effd[_0xc40e('0x54')]);def['uri']=util[_0xc40e('0x20')](_0xc40e('0x56'),_0x54effd[_0xc40e('0x57')]);if(_0x119365&&_0x119365[_0xc40e('0x58')]){logger[_0xc40e('0x24')](_0xc40e('0x59'),_0xc40e('0x5a'));_0x55a796[_0xc40e('0x5b')]=util[_0xc40e('0x20')](_0xc40e('0x5c'),_0x54effd[_0xc40e('0x54')],_0x55a796['uniqueid'],md5(_0x55a796[_0xc40e('0x5d')]));}else{_0x55a796['recordingURL']='';}return getConnection(_0x54effd)[_0xc40e('0x2a')](function(_0x17620d){_0x1c9fc4=_0x17620d;return getUser(_0x54effd,_0x136d39[_0xc40e('0xf')],_0x1c9fc4);})[_0xc40e('0x2a')](function(_0x2c8fcf){_0x48f266=_0x2c8fcf;logger[_0xc40e('0x24')]('The\x20User\x20ID\x20is:',_0x48f266['id']);return getEndUser(_0x54effd,_0x55a796['calleridname'],_0x55a796[_0xc40e('0x5e')],_0x1c9fc4);})[_0xc40e('0x2a')](function(_0x5f1703){_0x5d5432=_0x5f1703;logger[_0xc40e('0x24')]('The\x20Enduser\x20ID\x20is:',_0x5d5432['id']);return getTicket(_0x54effd,_0x48f266,_0x5d5432,_0x119730,_0x55a796,_0x119730['Fields'],_0x1c9fc4,_0xc40e('0x5f'));})[_0xc40e('0x2a')](function(_0x5bfe4){_0x48040c=_0x5bfe4;logger[_0xc40e('0x24')](_0xc40e('0x60'));logger['info'](_0xc40e('0x61'),_0x48040c['id']);return setRelationship(_0x1c9fc4,_0x48f266,_0x48040c,_0xc40e('0x62'));})['then'](function(){return setRelationship(_0x1c9fc4,_0x5d5432,_0x48040c,_0xc40e('0x63'));})['then'](function(){return getServerInfo(_0x1c9fc4);})[_0xc40e('0x2a')](function(_0x2a8405){var _0x3a3a9a=parseInt(_0x2a8405[_0xc40e('0x64')][_0xc40e('0x65')](0x0));var _0xa272b5=util[_0xc40e('0x20')](_0xc40e('0x66'),_0x54effd[_0xc40e('0x57')],_0x48040c['id']);if(_0x3a3a9a>0x6){_0xa272b5=util['format'](_0xc40e('0x67'),_0x54effd['remoteUri'],_0x48040c['id']);}logger[_0xc40e('0x24')](_0xc40e('0x59'),_0xc40e('0x68'));emit(util[_0xc40e('0x20')](_0xc40e('0x69'),_0x136d39[_0xc40e('0xf')]),_0xc40e('0x6a'),{'uri':_0xa272b5});})[_0xc40e('0x6b')](function(_0x5174ec){logger['error'](_0xc40e('0x59'),JSON['stringify'](_0x5174ec));});};exports['outbound']=function(_0x1a8739,_0x1871e0,_0x44aea4,_0x31cfb,_0x190fc6,_0x58808b,_0x4b556e){var _0x4a00de,_0x459978,_0x3653f9,_0x437ccc;_0x58808b['remoteUri']=intUtil['stripTrailingSlash'](_0x58808b['remoteUri']);_0x58808b[_0xc40e('0x54')]=intUtil['stripTrailingSlash'](_0x58808b[_0xc40e('0x54')]);def[_0xc40e('0x6c')]=util['format']('%s/service/v4_1/rest.php',_0x58808b[_0xc40e('0x57')]);if(_0x4b556e&&_0x4b556e['recordingFormat']&&_0x4b556e[_0xc40e('0x6d')]!==_0xc40e('0x6e')){logger[_0xc40e('0x24')]('[OUTBOUND]',_0xc40e('0x5a'));_0x1871e0[_0xc40e('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x58808b[_0xc40e('0x54')],_0x1871e0[_0xc40e('0x5d')],md5(_0x1871e0['uniqueid']));}return getConnection(_0x58808b)[_0xc40e('0x2a')](function(_0x571da0){_0x437ccc=_0x571da0;return getUser(_0x58808b,_0x31cfb[_0xc40e('0xf')],_0x437ccc);})[_0xc40e('0x2a')](function(_0x12f52d){_0x4a00de=_0x12f52d;logger['info'](_0xc40e('0x6f'),_0x4a00de['id']);return getEndUser(_0x58808b,_0x1871e0[_0xc40e('0x70')],_0x1871e0[_0xc40e('0x71')],_0x437ccc);})[_0xc40e('0x2a')](function(_0x5af4b6){_0x459978=_0x5af4b6;logger[_0xc40e('0x24')](_0xc40e('0x72'),_0x459978['id']);return getTicket(_0x58808b,_0x4a00de,_0x459978,_0x44aea4,_0x1871e0,_0x44aea4['Fields'],_0x437ccc,_0xc40e('0x73'));})[_0xc40e('0x2a')](function(_0x4a54bd){_0x3653f9=_0x4a54bd;logger[_0xc40e('0x24')](_0xc40e('0x60'));logger['info'](_0xc40e('0x61'),_0x3653f9['id']);return setRelationship(_0x437ccc,_0x4a00de,_0x3653f9,'users');})[_0xc40e('0x2a')](function(){return setRelationship(_0x437ccc,_0x459978,_0x3653f9,_0xc40e('0x63'));})['then'](function(){return getServerInfo(_0x437ccc);})[_0xc40e('0x2a')](function(_0x26a364){var _0x234e11=parseInt(_0x26a364[_0xc40e('0x64')][_0xc40e('0x65')](0x0));var _0xcf5ade=util[_0xc40e('0x20')](_0xc40e('0x66'),_0x58808b['remoteUri'],_0x3653f9['id']);if(_0x234e11>0x6){_0xcf5ade=util['format'](_0xc40e('0x67'),_0x58808b[_0xc40e('0x57')],_0x3653f9['id']);}logger['info'](_0xc40e('0x74'),_0xc40e('0x68'));emit(util['format'](_0xc40e('0x69'),_0x31cfb[_0xc40e('0xf')]),_0xc40e('0x6a'),{'uri':_0xcf5ade});})[_0xc40e('0x6b')](function(_0x203354){logger[_0xc40e('0x75')](_0xc40e('0x74'),JSON['stringify'](_0x203354));});};exports[_0xc40e('0x76')]=function(_0x1aab56,_0x3bba95,_0x32d99a,_0x419aa5,_0x57bd2b,_0x56a64a){var _0x3f76b4,_0x3b5aef,_0xec9f05,_0x16b263;_0x56a64a[_0xc40e('0x57')]=intUtil[_0xc40e('0x55')](_0x56a64a[_0xc40e('0x57')]);_0x56a64a['serverUrl']=intUtil[_0xc40e('0x55')](_0x56a64a['serverUrl']);def[_0xc40e('0x6c')]=util[_0xc40e('0x20')](_0xc40e('0x56'),_0x56a64a['remoteUri']);if(_0x57bd2b&&_0x57bd2b[_0xc40e('0x58')]){logger[_0xc40e('0x24')]('['+_0x3bba95[_0xc40e('0x77')][_0xc40e('0x78')]()+']',_0xc40e('0x5a'));_0x3bba95[_0xc40e('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56a64a[_0xc40e('0x54')],_0x3bba95[_0xc40e('0x5d')],md5(_0x3bba95['uniqueid']));}else{_0x3bba95[_0xc40e('0x5b')]='';}return getConnection(_0x56a64a)[_0xc40e('0x2a')](function(_0x3111d6){_0x16b263=_0x3111d6;if(!_['isNil'](_0x419aa5)){return getUser(_0x56a64a,_0x419aa5[_0xc40e('0xf')],_0x16b263);}else{return getUser(_0x56a64a,null,_0x16b263);}})[_0xc40e('0x2a')](function(_0x1cd185){_0x3f76b4=_0x1cd185;logger[_0xc40e('0x24')]('The\x20User\x20ID\x20is:',_0x3f76b4['id']);return getEndUser(_0x56a64a,_0x3bba95[_0xc40e('0x79')],_0x3bba95[_0xc40e('0x5e')],_0x16b263);})[_0xc40e('0x2a')](function(_0x512512){_0x3b5aef=_0x512512;logger[_0xc40e('0x24')](_0xc40e('0x72'),_0x3b5aef['id']);return getTicket(_0x56a64a,_0x3f76b4,_0x3b5aef,_0x32d99a,_0x3bba95,_0x32d99a[_0xc40e('0x7a')],_0x16b263,'Inbound');})[_0xc40e('0x2a')](function(_0x5e26f7){_0xec9f05=_0x5e26f7;logger[_0xc40e('0x24')](_0xc40e('0x60'));logger[_0xc40e('0x24')](_0xc40e('0x61'),_0xec9f05['id']);return setRelationship(_0x16b263,_0x3f76b4,_0xec9f05,'users');})[_0xc40e('0x2a')](function(){return setRelationship(_0x16b263,_0x3b5aef,_0xec9f05,_0xc40e('0x63'));})[_0xc40e('0x2a')](function(){return getServerInfo(_0x16b263);})[_0xc40e('0x6b')](function(_0x4cbb58){logger[_0xc40e('0x75')]('['+_0x3bba95[_0xc40e('0x77')][_0xc40e('0x78')]()+']',JSON[_0xc40e('0x1f')](_0x4cbb58));});}; \ No newline at end of file +var _0x91ba=['defaults','redis','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','Descriptions','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','phone_home','Enduser\x20found!','Enduser\x20created.','first_name','debug','[HTTP]','merge','type','string','nameField','toLowerCase','content','customField','variable','customVariable','Variable','custom_fields','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','charAt','catch','unmanaged','lastevent','calleridnum','toUpperCase','lodash','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x91ba,0x68));var _0xa91b=function(_0xcce669,_0x1e7f34){_0xcce669=_0xcce669-0x0;var _0x253b52=_0x91ba[_0xcce669];return _0x253b52;};'use strict';var _=require(_0xa91b('0x0'));var rp=require('request-promise');var BPromise=require(_0xa91b('0x1'));var md5=require(_0xa91b('0x2'));var util=require(_0xa91b('0x3'));var Redis=require(_0xa91b('0x4'));var intUtil=require('./util');var config=require(_0xa91b('0x5'));var logger=require(_0xa91b('0x6'))(_0xa91b('0x7'));config['redis']=_[_0xa91b('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa91b('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x38672b,_0x193da0,_0x1137a1){io['to'](_0x38672b)['emit'](_0x193da0,_0x1137a1);}function getTicket(_0x4065d5,_0x2bdb57,_0x302fd9,_0x12e923,_0x17fc9e,_0x2e04b9,_0x228372,_0xfc9549){logger[_0xa91b('0xa')](_0xa91b('0xb'));var _0x1c7266=new Date();var _0x2a6327=[{'name':_0xa91b('0xc'),'value':intUtil['getString'](_0x12e923['Subjects'],_0x17fc9e,'\x20')},{'name':_0xa91b('0xd'),'value':_0x2bdb57['id']},{'name':_0xa91b('0xe'),'value':_0x2bdb57['id']},{'name':_0xa91b('0xf'),'value':intUtil['getString'](_0x12e923[_0xa91b('0x10')],_0x17fc9e,'\x0a')},{'name':'date_start','value':_0x1c7266['toISOString']()['slice'](0x0,0x13)[_0xa91b('0x11')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xa91b('0x12'),'value':'15'},{'name':_0xa91b('0x13'),'value':_0x302fd9['id']},{'name':_0xa91b('0x14'),'value':_0xa91b('0x15')},{'name':_0xa91b('0x16'),'value':_0x302fd9['name']},{'name':_0xa91b('0x17'),'value':_0xfc9549}];if(_0x2e04b9[_0xa91b('0x18')]){_[_0xa91b('0x19')](_0x2e04b9,function(_0x526121){if(_0x17fc9e[_0x526121[_0xa91b('0x1a')]]){_0x2a6327[_0xa91b('0x1b')]({'name':_0x526121[_0xa91b('0x1c')],'value':_0x17fc9e[_0x526121[_0xa91b('0x1a')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xa91b('0x1d'),'rest_data':JSON[_0xa91b('0x1e')]({'session':_0x228372['id'],'module_name':_0xa91b('0x1f'),'name_value_list':_0x2a6327})}});}function getAuth(_0x4c200c){return util[_0xa91b('0x20')](_0xa91b('0x21'),new Buffer(_0x4c200c[_0xa91b('0x22')]+':X')[_0xa91b('0x23')](_0xa91b('0x24')));}function getServerInfo(_0x183940){return request({'form':{'method':_0xa91b('0x25'),'input_type':_0xa91b('0x1d'),'response_type':_0xa91b('0x1d'),'rest_data':JSON[_0xa91b('0x1e')]({'session':_0x183940['id']})}});}function getUser(_0x551fd9,_0x415eb8,_0x14764c){if(!_[_0xa91b('0x26')](_0x415eb8)){logger[_0xa91b('0xa')](_0xa91b('0x27'),_0x415eb8);return request({'form':{'method':_0xa91b('0x28'),'input_type':_0xa91b('0x1d'),'response_type':_0xa91b('0x1d'),'rest_data':JSON['stringify']({'session':_0x14764c['id'],'module_name':'Employees','query':util[_0xa91b('0x20')](_0xa91b('0x29'),_0x415eb8),'order_by':'','offset':'0','select_fields':['id','name',_0xa91b('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa91b('0x2b')](function(_0x6f1295){if(_0x6f1295[_0xa91b('0x2c')][_0xa91b('0x18')]){var _0x799e47=_[_0xa91b('0x2d')](_0x6f1295[_0xa91b('0x2c')],function(_0x2d0d94){return _0x2d0d94[_0xa91b('0x2e')][_0xa91b('0x2a')][_0xa91b('0x2f')]===_0x415eb8;});if(_0x799e47){logger[_0xa91b('0xa')](_0xa91b('0x30'));return BPromise['resolve']({'id':_0x799e47[_0xa91b('0x2e')]['id'][_0xa91b('0x2f')],'name':_0x799e47[_0xa91b('0x2e')][_0xa91b('0xc')][_0xa91b('0x2f')]});}}logger['info'](_0xa91b('0x31'));return BPromise['resolve']({'id':_0x14764c['name_value_list']['user_id'][_0xa91b('0x2f')],'name':_0x14764c['name_value_list']['user_name'][_0xa91b('0x2f')]});});}else{logger[_0xa91b('0xa')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa91b('0x32')]({'id':_0x14764c['name_value_list'][_0xa91b('0x33')][_0xa91b('0x2f')],'name':_0x14764c[_0xa91b('0x2e')][_0xa91b('0x2a')][_0xa91b('0x2f')]});}}function getEndUser(_0x328a91,_0xd56aee,_0x43eeb4,_0x501bd8){logger[_0xa91b('0xa')]('Searching\x20enduser\x20with\x20phone',_0x43eeb4);return request({'form':{'method':_0xa91b('0x28'),'input_type':_0xa91b('0x1d'),'response_type':_0xa91b('0x1d'),'rest_data':JSON['stringify']({'session':_0x501bd8['id'],'module_name':'Contacts','query':util[_0xa91b('0x20')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x43eeb4),'order_by':'','offset':'0','select_fields':['id',_0xa91b('0xc'),_0xa91b('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa91b('0x2b')](function(_0x46cd0a){if(_0x46cd0a['entry_list'][_0xa91b('0x18')]){var _0x15694d=_[_0xa91b('0x2d')](_0x46cd0a[_0xa91b('0x2c')],function(_0x53724d){return _0x53724d['name_value_list'][_0xa91b('0x34')][_0xa91b('0x2f')]===_0x43eeb4;});if(_0x15694d){logger[_0xa91b('0xa')](_0xa91b('0x35'));return BPromise[_0xa91b('0x32')]({'id':_0x15694d[_0xa91b('0x2e')]['id'][_0xa91b('0x2f')],'name':_0x15694d[_0xa91b('0x2e')][_0xa91b('0xc')][_0xa91b('0x2f')],'phone':_0x15694d[_0xa91b('0x2e')][_0xa91b('0x34')]['value']});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0xa91b('0x1d'),'response_type':_0xa91b('0x1d'),'rest_data':JSON[_0xa91b('0x1e')]({'session':_0x501bd8['id'],'module_name':_0xa91b('0x15'),'name_value_list':[{'name':'first_name','value':_0xd56aee!==''?_0xd56aee:util[_0xa91b('0x20')]('Caller\x20-\x20%s',_0x43eeb4)},{'name':'phone_home','value':_0x43eeb4}]})}})[_0xa91b('0x2b')](function(_0xcd92a6){logger[_0xa91b('0xa')](_0xa91b('0x36'));return BPromise[_0xa91b('0x32')]({'id':_0xcd92a6['id'],'name':_0xcd92a6['entry_list'][_0xa91b('0x37')]['value'],'phone':_0xcd92a6['entry_list'][_0xa91b('0x34')]['value']});});}});}function request(_0x189111){logger[_0xa91b('0x38')](_0xa91b('0x39'),JSON[_0xa91b('0x1e')](_0x189111));return rp(_[_0xa91b('0x3a')](def,_0x189111));}function getTags(_0x512141,_0x10e693){var _0x23fef3=[];if(_0x512141&&_0x512141[_0xa91b('0x18')]>0x0){_0x23fef3=_['map'](_0x512141,_0x10e693);}return _0x23fef3;}function getCustomFields(_0xae2546,_0x455a97){var _0x58be27=[];var _0x15519b={'custom_fields':[]};if(_0xae2546[_0xa91b('0x18')]>0x0){_['forEach'](_0xae2546,function(_0x4ac6bf){if(_0x4ac6bf[_0xa91b('0x3b')]===_0xa91b('0x3c')&&_0x4ac6bf[_0xa91b('0x3d')]&&!_0x4ac6bf['customField']){_0x15519b[_0x4ac6bf[_0xa91b('0x3d')][_0xa91b('0x3e')]()]=_0x4ac6bf[_0xa91b('0x3f')]['toString']();}else if(_0x4ac6bf[_0xa91b('0x3b')]===_0xa91b('0x3c')&&_0x4ac6bf['idField']&&_0x4ac6bf[_0xa91b('0x40')]){_0x15519b['custom_fields'][_0xa91b('0x1b')]({'id':_0x4ac6bf['idField'],'value':_0x4ac6bf['content'][_0xa91b('0x23')]()});}else if(_0x4ac6bf['type']===_0xa91b('0x41')&&_0x4ac6bf[_0xa91b('0x1a')]&&_0x4ac6bf[_0xa91b('0x1c')]&&_0x4ac6bf[_0xa91b('0x40')]){_0x455a97[_0x4ac6bf[_0xa91b('0x1a')]]&&_0x15519b['custom_fields'][_0xa91b('0x1b')]({'id':_0x4ac6bf[_0xa91b('0x1c')],'value':_0x455a97[_0x4ac6bf[_0xa91b('0x1a')]]['toString']()});}else if(_0x4ac6bf['type']===_0xa91b('0x42')&&_0x4ac6bf['Variable']&&_0x4ac6bf[_0xa91b('0x43')][_0xa91b('0xc')]&&_0x4ac6bf[_0xa91b('0x1c')]&&_0x4ac6bf[_0xa91b('0x40')]){_0x455a97[_0x4ac6bf[_0xa91b('0x43')][_0xa91b('0xc')][_0xa91b('0x3e')]()]&&_0x15519b[_0xa91b('0x44')]['push']({'id':_0x4ac6bf['idField'],'value':_0x455a97[_0x4ac6bf['Variable'][_0xa91b('0xc')][_0xa91b('0x3e')]()][_0xa91b('0x23')]()});}});}return _0x15519b;}function getConnection(_0x5b8b2c){return request({'method':'POST','form':{'method':_0xa91b('0x45'),'input_type':_0xa91b('0x1d'),'response_type':_0xa91b('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5b8b2c[_0xa91b('0x46')],'password':_0x5b8b2c['password'],'encryption':_0xa91b('0x47')},'application':_0xa91b('0x48')})}})[_0xa91b('0x2b')](function(_0x12d12b){var _0x38185a=_0x12d12b;if(_0x38185a['id']){def[_0xa91b('0x49')]=_0x38185a['id'];return BPromise[_0xa91b('0x32')](_0x38185a);}else{throw new Error(util[_0xa91b('0x20')](_0xa91b('0x4a'),_0x5b8b2c['id']));}});}function setRelationship(_0x576635,_0x5a7454,_0x40f671,_0x359c09){return request({'form':{'method':_0xa91b('0x4b'),'input_type':_0xa91b('0x1d'),'response_type':_0xa91b('0x1d'),'rest_data':JSON[_0xa91b('0x1e')]({'session':_0x576635['id'],'module_name':_0xa91b('0x1f'),'module_id':_0x40f671['id'],'link_field_name':_0x359c09,'related_ids':[_0x5a7454['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3ed739,_0x4cb454,_0xa08df9,_0x545fce,_0xc1f344,_0x1f3efc){var _0x538288,_0x7126d7,_0x2d85eb,_0x45d0de;_0x1f3efc[_0xa91b('0x4c')]=intUtil[_0xa91b('0x4d')](_0x1f3efc[_0xa91b('0x4c')]);_0x1f3efc[_0xa91b('0x4e')]=intUtil['stripTrailingSlash'](_0x1f3efc[_0xa91b('0x4e')]);def['uri']=util[_0xa91b('0x20')](_0xa91b('0x4f'),_0x1f3efc[_0xa91b('0x4c')]);if(_0xc1f344&&_0xc1f344[_0xa91b('0x50')]){logger[_0xa91b('0xa')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4cb454[_0xa91b('0x51')]=util[_0xa91b('0x20')](_0xa91b('0x52'),_0x1f3efc[_0xa91b('0x4e')],_0x4cb454['uniqueid'],md5(_0x4cb454[_0xa91b('0x53')]));}else{_0x4cb454[_0xa91b('0x51')]='';}return getConnection(_0x1f3efc)['then'](function(_0x289ef5){_0x45d0de=_0x289ef5;return getUser(_0x1f3efc,_0x545fce[_0xa91b('0xc')],_0x45d0de);})[_0xa91b('0x2b')](function(_0x4bffca){_0x538288=_0x4bffca;logger[_0xa91b('0xa')](_0xa91b('0x54'),_0x538288['id']);return getEndUser(_0x1f3efc,_0x4cb454[_0xa91b('0x55')],_0x4cb454['calleridnum'],_0x45d0de);})[_0xa91b('0x2b')](function(_0x518430){_0x7126d7=_0x518430;logger[_0xa91b('0xa')](_0xa91b('0x56'),_0x7126d7['id']);return getTicket(_0x1f3efc,_0x538288,_0x7126d7,_0xa08df9,_0x4cb454,_0xa08df9[_0xa91b('0x57')],_0x45d0de,_0xa91b('0x58'));})[_0xa91b('0x2b')](function(_0x18f2d4){_0x2d85eb=_0x18f2d4;logger[_0xa91b('0xa')]('Ticket\x20created!');logger[_0xa91b('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2d85eb['id']);return setRelationship(_0x45d0de,_0x538288,_0x2d85eb,_0xa91b('0x59'));})[_0xa91b('0x2b')](function(){return setRelationship(_0x45d0de,_0x7126d7,_0x2d85eb,_0xa91b('0x5a'));})[_0xa91b('0x2b')](function(){return getServerInfo(_0x45d0de);})[_0xa91b('0x2b')](function(_0x17d748){var _0x86980b=parseInt(_0x17d748[_0xa91b('0x5b')]['charAt'](0x0));var _0x48f27a=util[_0xa91b('0x20')](_0xa91b('0x5c'),_0x1f3efc[_0xa91b('0x4c')],_0x2d85eb['id']);if(_0x86980b>0x6){_0x48f27a=util[_0xa91b('0x20')](_0xa91b('0x5d'),_0x1f3efc['remoteUri'],_0x2d85eb['id']);}logger[_0xa91b('0xa')](_0xa91b('0x5e'),_0xa91b('0x5f'));emit(util[_0xa91b('0x20')]('user:%s',_0x545fce[_0xa91b('0xc')]),_0xa91b('0x60'),{'uri':_0x48f27a});})['catch'](function(_0x2c1483){logger[_0xa91b('0x61')]('[QUEUE]',JSON['stringify'](_0x2c1483));});};exports['outbound']=function(_0x1020b6,_0x545785,_0xf12a86,_0x40d766,_0x301606,_0x1338c3,_0xc436a4){var _0x550cce,_0x14de78,_0x45651c,_0x2b1d9b;_0x1338c3[_0xa91b('0x4c')]=intUtil[_0xa91b('0x4d')](_0x1338c3['remoteUri']);_0x1338c3[_0xa91b('0x4e')]=intUtil['stripTrailingSlash'](_0x1338c3[_0xa91b('0x4e')]);def[_0xa91b('0x62')]=util['format'](_0xa91b('0x4f'),_0x1338c3[_0xa91b('0x4c')]);if(_0xc436a4&&_0xc436a4['recordingFormat']&&_0xc436a4[_0xa91b('0x63')]!==_0xa91b('0x64')){logger[_0xa91b('0xa')](_0xa91b('0x65'),_0xa91b('0x66'));_0x545785[_0xa91b('0x51')]=util['format'](_0xa91b('0x52'),_0x1338c3['serverUrl'],_0x545785[_0xa91b('0x53')],md5(_0x545785[_0xa91b('0x53')]));}return getConnection(_0x1338c3)['then'](function(_0x2f4e0b){_0x2b1d9b=_0x2f4e0b;return getUser(_0x1338c3,_0x40d766['name'],_0x2b1d9b);})[_0xa91b('0x2b')](function(_0x3e5a94){_0x550cce=_0x3e5a94;logger['info']('The\x20User\x20ID\x20is:',_0x550cce['id']);return getEndUser(_0x1338c3,_0x545785['destcalleridname'],_0x545785[_0xa91b('0x67')],_0x2b1d9b);})[_0xa91b('0x2b')](function(_0x1a08b6){_0x14de78=_0x1a08b6;logger[_0xa91b('0xa')](_0xa91b('0x56'),_0x14de78['id']);return getTicket(_0x1338c3,_0x550cce,_0x14de78,_0xf12a86,_0x545785,_0xf12a86['Fields'],_0x2b1d9b,'Outbound');})[_0xa91b('0x2b')](function(_0x557280){_0x45651c=_0x557280;logger['info'](_0xa91b('0x68'));logger[_0xa91b('0xa')](_0xa91b('0x69'),_0x45651c['id']);return setRelationship(_0x2b1d9b,_0x550cce,_0x45651c,_0xa91b('0x59'));})[_0xa91b('0x2b')](function(){return setRelationship(_0x2b1d9b,_0x14de78,_0x45651c,_0xa91b('0x5a'));})[_0xa91b('0x2b')](function(){return getServerInfo(_0x2b1d9b);})['then'](function(_0x8fa26d){var _0x204eb9=parseInt(_0x8fa26d['version'][_0xa91b('0x6a')](0x0));var _0x4c0af6=util[_0xa91b('0x20')](_0xa91b('0x5c'),_0x1338c3[_0xa91b('0x4c')],_0x45651c['id']);if(_0x204eb9>0x6){_0x4c0af6=util[_0xa91b('0x20')](_0xa91b('0x5d'),_0x1338c3[_0xa91b('0x4c')],_0x45651c['id']);}logger[_0xa91b('0xa')](_0xa91b('0x65'),_0xa91b('0x5f'));emit(util['format']('user:%s',_0x40d766[_0xa91b('0xc')]),_0xa91b('0x60'),{'uri':_0x4c0af6});})[_0xa91b('0x6b')](function(_0x59ee48){logger[_0xa91b('0x61')](_0xa91b('0x65'),JSON[_0xa91b('0x1e')](_0x59ee48));});};exports[_0xa91b('0x6c')]=function(_0x4e0d8e,_0x453b64,_0x2e0f2c,_0x204fa7,_0x2d5ed0,_0xed9692){var _0x1fdfbe,_0x1a1ca6,_0x2e8ec2,_0x1b3746;_0xed9692[_0xa91b('0x4c')]=intUtil[_0xa91b('0x4d')](_0xed9692[_0xa91b('0x4c')]);_0xed9692[_0xa91b('0x4e')]=intUtil[_0xa91b('0x4d')](_0xed9692['serverUrl']);def[_0xa91b('0x62')]=util[_0xa91b('0x20')]('%s/service/v4_1/rest.php',_0xed9692[_0xa91b('0x4c')]);if(_0x2d5ed0&&_0x2d5ed0['monitor_format']){logger[_0xa91b('0xa')]('['+_0x453b64[_0xa91b('0x6d')]['toUpperCase']()+']',_0xa91b('0x66'));_0x453b64[_0xa91b('0x51')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xed9692[_0xa91b('0x4e')],_0x453b64[_0xa91b('0x53')],md5(_0x453b64[_0xa91b('0x53')]));}else{_0x453b64[_0xa91b('0x51')]='';}return getConnection(_0xed9692)['then'](function(_0x5ad398){_0x1b3746=_0x5ad398;if(!_[_0xa91b('0x26')](_0x204fa7)){return getUser(_0xed9692,_0x204fa7['name'],_0x1b3746);}else{return getUser(_0xed9692,null,_0x1b3746);}})[_0xa91b('0x2b')](function(_0x2610f4){_0x1fdfbe=_0x2610f4;logger[_0xa91b('0xa')]('The\x20User\x20ID\x20is:',_0x1fdfbe['id']);return getEndUser(_0xed9692,_0x453b64[_0xa91b('0x55')],_0x453b64[_0xa91b('0x6e')],_0x1b3746);})['then'](function(_0x183a69){_0x1a1ca6=_0x183a69;logger[_0xa91b('0xa')](_0xa91b('0x56'),_0x1a1ca6['id']);return getTicket(_0xed9692,_0x1fdfbe,_0x1a1ca6,_0x2e0f2c,_0x453b64,_0x2e0f2c[_0xa91b('0x57')],_0x1b3746,_0xa91b('0x58'));})[_0xa91b('0x2b')](function(_0x37e564){_0x2e8ec2=_0x37e564;logger[_0xa91b('0xa')](_0xa91b('0x68'));logger[_0xa91b('0xa')](_0xa91b('0x69'),_0x2e8ec2['id']);return setRelationship(_0x1b3746,_0x1fdfbe,_0x2e8ec2,_0xa91b('0x59'));})[_0xa91b('0x2b')](function(){return setRelationship(_0x1b3746,_0x1a1ca6,_0x2e8ec2,_0xa91b('0x5a'));})['then'](function(){return getServerInfo(_0x1b3746);})['catch'](function(_0x5e8993){logger[_0xa91b('0x61')]('['+_0x453b64[_0xa91b('0x6d')][_0xa91b('0x6f')]()+']',JSON[_0xa91b('0x1e')](_0x5e8993));});}; \ 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 392b986..eb323d1 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 _0xae29=['Variable','toLowerCase','toString','keyValue','key','%s:\x20%s','keyContent','keyType','format','customVariable','join','stripTrailingSlash','slice','substring','isNil','test','lodash','util','getString','length','sortBy','string','push','content','variable','variableName','type','name'];(function(_0x132d9e,_0x1475d7){var _0x4337a4=function(_0x33cf87){while(--_0x33cf87){_0x132d9e['push'](_0x132d9e['shift']());}};_0x4337a4(++_0x1475d7);}(_0xae29,0xd4));var _0x9ae2=function(_0x5f46ee,_0x550dbb){_0x5f46ee=_0x5f46ee-0x0;var _0x5f3804=_0xae29[_0x5f46ee];return _0x5f3804;};'use strict';var _=require(_0x9ae2('0x0'));var util=require(_0x9ae2('0x1'));exports[_0x9ae2('0x2')]=function(_0x19a696,_0x5a827b,_0x2e363d){var _0x3073db=[];if(_0x19a696[_0x9ae2('0x3')]>0x0){var _0xdbff=_[_0x9ae2('0x4')](_0x19a696,['id']);for(var _0x24a05e=0x0;_0x24a05e<_0xdbff[_0x9ae2('0x3')];_0x24a05e++){var _0x43b228=_0xdbff[_0x24a05e];if(_0x43b228['type']===_0x9ae2('0x5')){_0x3073db[_0x9ae2('0x6')](_0x43b228[_0x9ae2('0x7')]);}else if(_0x43b228['type']===_0x9ae2('0x8')&&_0x43b228[_0x9ae2('0x9')]){_0x5a827b[_0x43b228[_0x9ae2('0x9')]]&&_0x3073db[_0x9ae2('0x6')](_0x5a827b[_0x43b228['variableName']]['toString']());}else if(_0x43b228[_0x9ae2('0xa')]==='customVariable'&&_0x43b228['Variable']&&_0x43b228['Variable'][_0x9ae2('0xb')]){_0x5a827b[_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')][_0x9ae2('0xd')]()]&&_0x3073db['push'](_0x5a827b[_0x43b228[_0x9ae2('0xc')]['name'][_0x9ae2('0xd')]()][_0x9ae2('0xe')]());}else if(_0x43b228[_0x9ae2('0xa')]===_0x9ae2('0xf')){if(_0x43b228['keyType']===_0x9ae2('0x5')&&_0x43b228[_0x9ae2('0x10')]){_0x3073db[_0x9ae2('0x6')](util['format'](_0x9ae2('0x11'),_0x43b228['key'],_0x43b228[_0x9ae2('0x12')]));}else if(_0x43b228[_0x9ae2('0x13')]===_0x9ae2('0x8')&&_0x43b228['variableName']&&_0x43b228[_0x9ae2('0x10')]){_0x5a827b[_0x43b228[_0x9ae2('0x9')]]&&_0x3073db[_0x9ae2('0x6')](util[_0x9ae2('0x14')]('%s:\x20%s',_0x43b228[_0x9ae2('0x10')],_0x5a827b[_0x43b228[_0x9ae2('0x9')]]));}else if(_0x43b228[_0x9ae2('0x13')]===_0x9ae2('0x15')&&_0x43b228['Variable']&&_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')]&&_0x43b228[_0x9ae2('0x10')]){_0x5a827b[_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')]['toLowerCase']()]&&_0x3073db['push'](util[_0x9ae2('0x14')](_0x9ae2('0x11'),_0x43b228[_0x9ae2('0x10')],_0x5a827b[_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')][_0x9ae2('0xd')]()]));}}}}return _0x3073db[_0x9ae2('0x16')](_0x2e363d);};exports[_0x9ae2('0x17')]=function(_0xdea9ee){var _0x5cf106=_0xdea9ee[_0x9ae2('0x18')](-0x1);if(_0x5cf106==='/'){_0xdea9ee=_0xdea9ee[_0x9ae2('0x19')](0x0,_0xdea9ee['lastIndexOf'](_0x5cf106));}return _0xdea9ee;};exports['validateEmail']=function(_0xc3b1c5){if(!_[_0x9ae2('0x1a')](_0xc3b1c5)&&_0xc3b1c5!==''){var _0x3eab08=/^(([^<>()\[\]\\.,;:\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 _0x3eab08[_0x9ae2('0x1b')](String(_0xc3b1c5)[_0x9ae2('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xd893=['content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','stripTrailingSlash','slice','lastIndexOf','lodash','util','length','sortBy','type','string','push'];(function(_0x2fa31c,_0x278530){var _0x1cff55=function(_0x470b7d){while(--_0x470b7d){_0x2fa31c['push'](_0x2fa31c['shift']());}};_0x1cff55(++_0x278530);}(_0xd893,0x169));var _0x3d89=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd893[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3d89('0x0'));var util=require(_0x3d89('0x1'));exports['getString']=function(_0x2df4f9,_0x21ba85,_0x244948){var _0x191e04=[];if(_0x2df4f9[_0x3d89('0x2')]>0x0){var _0x5919cc=_[_0x3d89('0x3')](_0x2df4f9,['id']);for(var _0x4a4215=0x0;_0x4a4215<_0x5919cc[_0x3d89('0x2')];_0x4a4215++){var _0x206e12=_0x5919cc[_0x4a4215];if(_0x206e12[_0x3d89('0x4')]===_0x3d89('0x5')){_0x191e04[_0x3d89('0x6')](_0x206e12[_0x3d89('0x7')]);}else if(_0x206e12[_0x3d89('0x4')]===_0x3d89('0x8')&&_0x206e12[_0x3d89('0x9')]){_0x21ba85[_0x206e12[_0x3d89('0x9')]]&&_0x191e04[_0x3d89('0x6')](_0x21ba85[_0x206e12[_0x3d89('0x9')]][_0x3d89('0xa')]());}else if(_0x206e12['type']===_0x3d89('0xb')&&_0x206e12['Variable']&&_0x206e12[_0x3d89('0xc')][_0x3d89('0xd')]){_0x21ba85[_0x206e12[_0x3d89('0xc')]['name'][_0x3d89('0xe')]()]&&_0x191e04[_0x3d89('0x6')](_0x21ba85[_0x206e12[_0x3d89('0xc')]['name']['toLowerCase']()][_0x3d89('0xa')]());}else if(_0x206e12[_0x3d89('0x4')]===_0x3d89('0xf')){if(_0x206e12[_0x3d89('0x10')]===_0x3d89('0x5')&&_0x206e12[_0x3d89('0x11')]){_0x191e04[_0x3d89('0x6')](util[_0x3d89('0x12')]('%s:\x20%s',_0x206e12[_0x3d89('0x11')],_0x206e12['keyContent']));}else if(_0x206e12[_0x3d89('0x10')]===_0x3d89('0x8')&&_0x206e12[_0x3d89('0x9')]&&_0x206e12[_0x3d89('0x11')]){_0x21ba85[_0x206e12[_0x3d89('0x9')]]&&_0x191e04[_0x3d89('0x6')](util[_0x3d89('0x12')]('%s:\x20%s',_0x206e12[_0x3d89('0x11')],_0x21ba85[_0x206e12['variableName']]));}else if(_0x206e12[_0x3d89('0x10')]===_0x3d89('0xb')&&_0x206e12[_0x3d89('0xc')]&&_0x206e12[_0x3d89('0xc')][_0x3d89('0xd')]&&_0x206e12[_0x3d89('0x11')]){_0x21ba85[_0x206e12[_0x3d89('0xc')][_0x3d89('0xd')]['toLowerCase']()]&&_0x191e04['push'](util[_0x3d89('0x12')](_0x3d89('0x13'),_0x206e12[_0x3d89('0x11')],_0x21ba85[_0x206e12['Variable'][_0x3d89('0xd')]['toLowerCase']()]));}}}}return _0x191e04['join'](_0x244948);};exports[_0x3d89('0x14')]=function(_0x403d04){var _0x4b5c2b=_0x403d04[_0x3d89('0x15')](-0x1);if(_0x4b5c2b==='/'){_0x403d04=_0x403d04['substring'](0x0,_0x403d04[_0x3d89('0x16')](_0x4b5c2b));}return _0x403d04;};exports['validateEmail']=function(_0x39884b){if(!_['isNil'](_0x39884b)&&_0x39884b!==''){var _0x8f14b1=/^(([^<>()\[\]\\.,;:\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 _0x8f14b1['test'](String(_0x39884b)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index ee4f11f..3f92720 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x50bb24,_0xf2d777){var _0x2c4a73=function(_0x20e069){while(--_0x20e069){_0x50bb24['push'](_0x50bb24['shift']());}};_0x2c4a73(++_0xf2d777);}(_0x34e8,0x12c));var _0x834e=function(_0x3f006a,_0x119be0){_0x3f006a=_0x3f006a-0x0;var _0x4fcc94=_0x34e8[_0x3f006a];return _0x4fcc94;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ 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 c93463d..db1684a 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 _0xe9bc=['The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Displaying\x20ticket\x20to\x20agent...','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','then','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','[HTTP]','stringify','defaults','includes','nameField','customField','content','toString','string','picklist','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','email'];(function(_0x2bb08c,_0x227735){var _0x208e44=function(_0x4dc3e9){while(--_0x4dc3e9){_0x2bb08c['push'](_0x2bb08c['shift']());}};_0x208e44(++_0x227735);}(_0xe9bc,0x169));var _0xce9b=function(_0x1057ca,_0x316455){_0x1057ca=_0x1057ca-0x0;var _0x279fdd=_0xe9bc[_0x1057ca];return _0x279fdd;};'use strict';var _=require(_0xce9b('0x0'));var rp=require(_0xce9b('0x1'));var md5=require(_0xce9b('0x2'));var util=require('util');var Redis=require(_0xce9b('0x3'));var intUtil=require(_0xce9b('0x4'));var config=require('../../../../config/environment');var logger=require(_0xce9b('0x5'))(_0xce9b('0x6'));config[_0xce9b('0x7')]=_['defaults'](config['redis'],{'host':_0xce9b('0x8'),'port':0x18eb});var io=require(_0xce9b('0x9'))(new Redis(config['redis']));function emit(_0x473b7e,_0x5e0de5,_0x5904a2){io['to'](_0x473b7e)[_0xce9b('0xa')](_0x5e0de5,_0x5904a2);}var headers={'Content-Type':_0xce9b('0xb'),'Accept':_0xce9b('0xb')};function getTicket(_0x105b36,_0x3d52ea,_0x473037,_0x24d9d4,_0x138390){logger[_0xce9b('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xce9b('0xd'),_0x105b36['remoteUri']),'method':_0xce9b('0xe'),'body':{'ticket':_[_0xce9b('0xf')]({'requester_id':_0x473037['id'],'submitter_id':_0x3d52ea?_0x3d52ea['id']:undefined,'assignee_id':_0x3d52ea?_0x3d52ea['id']:undefined,'tags':getTags(_0x24d9d4[_0xce9b('0x10')],_0xce9b('0x11')),'subject':intUtil[_0xce9b('0x12')](_0x24d9d4[_0xce9b('0x13')],_0x138390,'\x20'),'description':intUtil[_0xce9b('0x12')](_0x24d9d4[_0xce9b('0x14')],_0x138390,'\x0a'),'comment':{'public':![],'body':intUtil[_0xce9b('0x12')](_0x24d9d4['Descriptions'],_0x138390,'\x0a')}},getCustomFields(_0x24d9d4['Fields'],_0x138390))}})['then'](function(_0x4c2ef4){logger[_0xce9b('0xc')](_0xce9b('0x15'));return _0x4c2ef4[_0xce9b('0x16')];});}function getUser(_0x3e5fd7,_0x25d283){if(intUtil[_0xce9b('0x17')](_0x25d283)){logger['info'](_0xce9b('0x18'),_0x25d283);return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x1a'),_0x3e5fd7['remoteUri']),'qs':{'query':util[_0xce9b('0x19')](_0xce9b('0x1b'),_0x25d283)}})[_0xce9b('0x1c')](function(_0x260f3a){if(_0x260f3a['count']){logger[_0xce9b('0xc')](_0xce9b('0x1d'));return _[_0xce9b('0x1e')](_0x260f3a[_0xce9b('0x1f')],{'email':_0x25d283,'role':'agent'});}else{logger[_0xce9b('0xc')](_0xce9b('0x20'));return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x21'),_0x3e5fd7[_0xce9b('0x22')])})['then'](function(_0xee6ed3){logger[_0xce9b('0xc')](_0xce9b('0x23'));return _0xee6ed3[_0xce9b('0x24')];});}});}else{logger[_0xce9b('0xc')](_0xce9b('0x20'));return request({'uri':util[_0xce9b('0x19')]('%s/users/me.json',_0x3e5fd7[_0xce9b('0x22')])})['then'](function(_0x96b4d8){logger['info'](_0xce9b('0x23'));return _0x96b4d8[_0xce9b('0x24')];});}}function getEndUser(_0x1ca7e6,_0x46eb1f,_0x192f5a){logger[_0xce9b('0xc')]('Searching\x20enduser\x20with\x20phone',_0x192f5a);return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x1a'),_0x1ca7e6[_0xce9b('0x22')]),'qs':{'query':util['format'](_0xce9b('0x25'),_0x192f5a)}})['then'](function(_0x55a040){var _0x32daf2;if(_0x55a040[_0xce9b('0x1f')][_0xce9b('0x26')]){_0x55a040['results']=_[_0xce9b('0x27')](_0x55a040[_0xce9b('0x1f')],{'suspended':![],'role':'end-user'});if(_0x55a040[_0xce9b('0x1f')][_0xce9b('0x26')]){_0x32daf2=_[_0xce9b('0x28')](_0x55a040['results']);}}if(_0x32daf2){logger[_0xce9b('0xc')]('Enduser\x20found!');return _0x32daf2;}else{logger[_0xce9b('0xc')](_0xce9b('0x29'));return request({'uri':util[_0xce9b('0x19')]('%s/users.json',_0x1ca7e6['remoteUri']),'method':_0xce9b('0xe'),'body':{'user':{'role':_0xce9b('0x2a'),'name':util[_0xce9b('0x19')]('Caller\x20-\x20%s',_0x46eb1f||_0x192f5a),'phone':_0x192f5a}}})[_0xce9b('0x1c')](function(_0xfa00d3){logger[_0xce9b('0xc')](_0xce9b('0x2b'));return _0xfa00d3['user'];});}});}function getAuth(_0x18656f){var _0x522860;if(_0x18656f[_0xce9b('0x2c')]===_0xce9b('0x2d')){_0x522860=util[_0xce9b('0x19')](_0xce9b('0x2e'),_0x18656f[_0xce9b('0x2f')],_0x18656f['password']);}else if(_0x18656f['authType']===_0xce9b('0x30')){_0x522860=util['format'](_0xce9b('0x31'),_0x18656f[_0xce9b('0x2f')],_0x18656f['token']);}return util[_0xce9b('0x19')](_0xce9b('0x32'),new Buffer(_0x522860)['toString']('base64'));}function request(_0x770d1a){logger['debug'](_0xce9b('0x33'),JSON[_0xce9b('0x34')](_0x770d1a));return rp(_[_0xce9b('0x35')](_0x770d1a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x14683b,_0x4878a2){var _0x1738a8=[];if(_0x14683b&&_0x14683b[_0xce9b('0x26')]>0x0){_0x1738a8=_['map'](_0x14683b,_0x4878a2);}return _0x1738a8;}function getCustomFields(_0x528daf,_0x46d152){var _0x274f24=[];var _0x1b50d3={'custom_fields':[]};if(_0x528daf[_0xce9b('0x26')]>0x0){_['forEach'](_0x528daf,function(_0x48eeed){if(_[_0xce9b('0x36')](['string','picklist'],_0x48eeed['type'])&&_0x48eeed[_0xce9b('0x37')]&&!_0x48eeed[_0xce9b('0x38')]){_0x1b50d3[_0x48eeed['nameField']['toLowerCase']()]=_0x48eeed[_0xce9b('0x39')][_0xce9b('0x3a')]();}else if(_[_0xce9b('0x36')]([_0xce9b('0x3b'),_0xce9b('0x3c')],_0x48eeed[_0xce9b('0x3d')])&&_0x48eeed[_0xce9b('0x3e')]&&_0x48eeed[_0xce9b('0x38')]){_0x1b50d3[_0xce9b('0x3f')][_0xce9b('0x40')]({'id':_0x48eeed[_0xce9b('0x3e')],'value':_0x48eeed['content'][_0xce9b('0x3a')]()});}else if(_0x48eeed[_0xce9b('0x3d')]===_0xce9b('0x41')&&_0x48eeed[_0xce9b('0x42')]&&_0x48eeed[_0xce9b('0x3e')]&&_0x48eeed[_0xce9b('0x38')]){_0x46d152[_0x48eeed['variableName']]&&_0x1b50d3[_0xce9b('0x3f')][_0xce9b('0x40')]({'id':_0x48eeed[_0xce9b('0x3e')],'value':_0x46d152[_0x48eeed['variableName']][_0xce9b('0x3a')]()});}else if(_0x48eeed[_0xce9b('0x3d')]===_0xce9b('0x43')&&_0x48eeed['Variable']&&_0x48eeed[_0xce9b('0x44')][_0xce9b('0x11')]&&_0x48eeed[_0xce9b('0x3e')]&&_0x48eeed['customField']){_0x46d152[_0x48eeed[_0xce9b('0x44')][_0xce9b('0x11')][_0xce9b('0x45')]()]&&_0x1b50d3['custom_fields'][_0xce9b('0x40')]({'id':_0x48eeed[_0xce9b('0x3e')],'value':_0x46d152[_0x48eeed[_0xce9b('0x44')][_0xce9b('0x11')][_0xce9b('0x45')]()]['toString']()});}});}return _0x1b50d3;}exports[_0xce9b('0x46')]=function(_0x3d4576,_0x2e29ba,_0x3a82e5,_0xcd77f4,_0x2fa873,_0x2e307c){var _0x59ebe3,_0x283692;_0x2e307c[_0xce9b('0x22')]=intUtil['stripTrailingSlash'](_0x2e307c[_0xce9b('0x22')]);_0x2e307c[_0xce9b('0x47')]=intUtil[_0xce9b('0x48')](_0x2e307c['serverUrl']);if(_0x2fa873&&_0x2fa873[_0xce9b('0x49')]){logger[_0xce9b('0xc')](_0xce9b('0x4a'),_0xce9b('0x4b'));_0x2e29ba['recordingURL']=util[_0xce9b('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e307c[_0xce9b('0x47')],_0x2e29ba[_0xce9b('0x4c')],md5(_0x2e29ba[_0xce9b('0x4c')]));}else{_0x2e29ba['recordingURL']='';}headers[_0xce9b('0x4d')]=getAuth(_0x2e307c);return getUser(_0x2e307c,_0xcd77f4[_0xce9b('0x4e')])['then'](function(_0xb1b4d8){_0x59ebe3=_0xb1b4d8;logger[_0xce9b('0xc')](_0xce9b('0x4f'),_0x59ebe3['id']);return getEndUser(_0x2e307c,_0x2e29ba[_0xce9b('0x50')],_0x2e29ba[_0xce9b('0x51')]);})[_0xce9b('0x1c')](function(_0x2fad47){_0x283692=_0x2fad47;logger[_0xce9b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x283692['id']);return getTicket(_0x2e307c,_0x59ebe3,_0x283692,_0x3a82e5,_0x2e29ba);})['then'](function(_0x388930){if(_0x388930){logger[_0xce9b('0xc')](_0xce9b('0x52'),_0x388930['id']);switch(_0x2e307c[_0xce9b('0x3d')]){case _0xce9b('0x53'):logger['info'](_0xce9b('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x54'),_0x2e307c[_0xce9b('0x22')],_0x59ebe3['id'],_0x388930['id']),'method':_0xce9b('0xe')});case _0xce9b('0x55'):logger['info']('[QUEUE]',_0xce9b('0x56'));emit(util['format'](_0xce9b('0x57'),_0xcd77f4['name']),_0xce9b('0x58'),{'uri':util[_0xce9b('0x19')](_0xce9b('0x59'),_0x2e307c[_0xce9b('0x22')]['replace'](_0xce9b('0x5a'),''),_0x388930['id'])});break;default:logger[_0xce9b('0x5b')](_0xce9b('0x4a'),_0xce9b('0x5c'));}}})[_0xce9b('0x5d')](function(_0x5dfc11){logger[_0xce9b('0x5b')](_0xce9b('0x5e'),util['inspect'](_0x5dfc11,{'showHidden':!![],'depth':null}));});};exports[_0xce9b('0x5f')]=function(_0x2368d9,_0x5bb9f8,_0x551e3d,_0xa75e8,_0x286255,_0x226a89,_0x3c2057){var _0x1e0314,_0x41d7ff;_0x226a89[_0xce9b('0x22')]=intUtil[_0xce9b('0x48')](_0x226a89[_0xce9b('0x22')]);_0x226a89['serverUrl']=intUtil[_0xce9b('0x48')](_0x226a89['serverUrl']);if(_0x3c2057&&_0x3c2057[_0xce9b('0x60')]&&_0x3c2057[_0xce9b('0x60')]!==_0xce9b('0x61')){logger[_0xce9b('0xc')](_0xce9b('0x62'),_0xce9b('0x4b'));_0x5bb9f8[_0xce9b('0x63')]=util['format'](_0xce9b('0x64'),_0x226a89[_0xce9b('0x47')],_0x5bb9f8[_0xce9b('0x4c')],md5(_0x5bb9f8['uniqueid']));}headers[_0xce9b('0x4d')]=getAuth(_0x226a89);return getUser(_0x226a89,_0xa75e8[_0xce9b('0x4e')])[_0xce9b('0x1c')](function(_0x370e28){_0x1e0314=_0x370e28;logger['info'](_0xce9b('0x4f'),_0x1e0314['id']);return getEndUser(_0x226a89,_0x5bb9f8[_0xce9b('0x65')],_0x5bb9f8['destcalleridnum']);})['then'](function(_0x51fb7a){_0x41d7ff=_0x51fb7a;logger[_0xce9b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x41d7ff['id']);return getTicket(_0x226a89,_0x1e0314,_0x41d7ff,_0x551e3d,_0x5bb9f8);})[_0xce9b('0x1c')](function(_0x2bcd70){if(_0x2bcd70){logger['info'](_0xce9b('0x52'),_0x2bcd70['id']);switch(_0x226a89[_0xce9b('0x3d')]){case'integrationTab':logger[_0xce9b('0xc')](_0xce9b('0x62'),_0xce9b('0x66'));return request({'uri':util[_0xce9b('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x226a89['remoteUri'],_0x1e0314['id'],_0x2bcd70['id']),'method':_0xce9b('0xe')});case _0xce9b('0x55'):logger[_0xce9b('0xc')](_0xce9b('0x62'),_0xce9b('0x56'));emit(util[_0xce9b('0x19')](_0xce9b('0x57'),_0xa75e8['name']),_0xce9b('0x58'),{'uri':util['format'](_0xce9b('0x59'),_0x226a89[_0xce9b('0x22')][_0xce9b('0x67')]('/api/v2',''),_0x2bcd70['id'])});break;default:logger[_0xce9b('0x5b')](_0xce9b('0x62'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xce9b('0x5d')](function(_0x2ad7f8){logger['error'](_0xce9b('0x68'),util[_0xce9b('0x69')](_0x2ad7f8,{'showHidden':!![],'depth':null}));});};exports[_0xce9b('0x6a')]=function(_0x5e6a68,_0x2636d2,_0x264593,_0x61141e,_0x1bc343,_0x4dc945){var _0x3a5681,_0x27a70b;_0x4dc945['remoteUri']=intUtil['stripTrailingSlash'](_0x4dc945['remoteUri']);_0x4dc945[_0xce9b('0x47')]=intUtil[_0xce9b('0x48')](_0x4dc945[_0xce9b('0x47')]);if(_0x1bc343&&_0x1bc343[_0xce9b('0x49')]){logger[_0xce9b('0xc')]('['+_0x2636d2[_0xce9b('0x6b')]['toUpperCase']()+']',_0xce9b('0x4b'));_0x2636d2[_0xce9b('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4dc945[_0xce9b('0x47')],_0x2636d2[_0xce9b('0x4c')],md5(_0x2636d2[_0xce9b('0x4c')]));}else{_0x2636d2[_0xce9b('0x63')]='';}headers['Authorization']=getAuth(_0x4dc945);return getUser(_0x4dc945)[_0xce9b('0x1c')](function(_0x4a7d7f){_0x3a5681=_0x4a7d7f;logger[_0xce9b('0xc')](_0xce9b('0x4f'),_0x3a5681['id']);return getEndUser(_0x4dc945,_0x2636d2[_0xce9b('0x50')],_0x2636d2['calleridnum']);})[_0xce9b('0x1c')](function(_0x5d02b7){_0x27a70b=_0x5d02b7;logger[_0xce9b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x27a70b['id']);return getTicket(_0x4dc945,_0x3a5681,_0x27a70b,_0x264593,_0x2636d2);})['then'](function(_0xcbd75c){if(_0xcbd75c){logger['info'](_0xce9b('0x52'),_0xcbd75c['id']);}})[_0xce9b('0x5d')](function(_0x26a3e3){logger['error']('['+_0x2636d2[_0xce9b('0x6b')][_0xce9b('0x6c')]()+']'+_0xce9b('0x6d'),util[_0xce9b('0x69')](_0x26a3e3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xeb8a=['base64','debug','[HTTP]','defaults','GET','forEach','includes','string','type','toLowerCase','toString','picklist','customField','custom_fields','push','idField','content','variable','variableName','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','stripTrailingSlash','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','application/json','info','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','format','%s/search.json','type:user\x20role:agent\x20email:%s','then','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s'];(function(_0x34a36c,_0x4e9234){var _0x17ecee=function(_0x113f34){while(--_0x113f34){_0x34a36c['push'](_0x34a36c['shift']());}};_0x17ecee(++_0x4e9234);}(_0xeb8a,0x116));var _0xaeb8=function(_0x5e295d,_0x215392){_0x5e295d=_0x5e295d-0x0;var _0x3af5ce=_0xeb8a[_0x5e295d];return _0x3af5ce;};'use strict';var _=require('lodash');var rp=require(_0xaeb8('0x0'));var md5=require('md5');var util=require(_0xaeb8('0x1'));var Redis=require(_0xaeb8('0x2'));var intUtil=require(_0xaeb8('0x3'));var config=require('../../../../config/environment');var logger=require(_0xaeb8('0x4'))(_0xaeb8('0x5'));config[_0xaeb8('0x6')]=_['defaults'](config[_0xaeb8('0x6')],{'host':_0xaeb8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaeb8('0x6')]));function emit(_0x375e63,_0x1e950c,_0x315899){io['to'](_0x375e63)['emit'](_0x1e950c,_0x315899);}var headers={'Content-Type':_0xaeb8('0x8'),'Accept':_0xaeb8('0x8')};function getTicket(_0x57271b,_0x110aaf,_0x1c0bcf,_0x218833,_0x131e68){logger[_0xaeb8('0x9')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xaeb8('0xa'),_0x57271b[_0xaeb8('0xb')]),'method':'POST','body':{'ticket':_[_0xaeb8('0xc')]({'requester_id':_0x1c0bcf['id'],'submitter_id':_0x110aaf?_0x110aaf['id']:undefined,'assignee_id':_0x110aaf?_0x110aaf['id']:undefined,'tags':getTags(_0x218833[_0xaeb8('0xd')],_0xaeb8('0xe')),'subject':intUtil[_0xaeb8('0xf')](_0x218833[_0xaeb8('0x10')],_0x131e68,'\x20'),'description':intUtil['getString'](_0x218833[_0xaeb8('0x11')],_0x131e68,'\x0a'),'comment':{'public':![],'body':intUtil[_0xaeb8('0xf')](_0x218833['Descriptions'],_0x131e68,'\x0a')}},getCustomFields(_0x218833[_0xaeb8('0x12')],_0x131e68))}})['then'](function(_0x484233){logger['info'](_0xaeb8('0x13'));return _0x484233[_0xaeb8('0x14')];});}function getUser(_0x119085,_0x1e2f98){if(intUtil[_0xaeb8('0x15')](_0x1e2f98)){logger[_0xaeb8('0x9')]('Getting\x20agent\x20with\x20email',_0x1e2f98);return request({'uri':util[_0xaeb8('0x16')](_0xaeb8('0x17'),_0x119085[_0xaeb8('0xb')]),'qs':{'query':util[_0xaeb8('0x16')](_0xaeb8('0x18'),_0x1e2f98)}})[_0xaeb8('0x19')](function(_0x308251){if(_0x308251['count']){logger['info'](_0xaeb8('0x1a'));return _[_0xaeb8('0x1b')](_0x308251[_0xaeb8('0x1c')],{'email':_0x1e2f98,'role':'agent'});}else{logger[_0xaeb8('0x9')](_0xaeb8('0x1d'));return request({'uri':util[_0xaeb8('0x16')]('%s/users/me.json',_0x119085['remoteUri'])})['then'](function(_0x38e49e){logger[_0xaeb8('0x9')](_0xaeb8('0x1e'));return _0x38e49e[_0xaeb8('0x1f')];});}});}else{logger[_0xaeb8('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xaeb8('0x16')](_0xaeb8('0x20'),_0x119085[_0xaeb8('0xb')])})[_0xaeb8('0x19')](function(_0x29d442){logger[_0xaeb8('0x9')]('Admin\x20account\x20selected.');return _0x29d442['user'];});}}function getEndUser(_0x4d17ea,_0x5359d1,_0x5b3a40){logger['info'](_0xaeb8('0x21'),_0x5b3a40);return request({'uri':util['format'](_0xaeb8('0x17'),_0x4d17ea[_0xaeb8('0xb')]),'qs':{'query':util[_0xaeb8('0x16')]('type:user\x20role:end-user\x20phone:%s',_0x5b3a40)}})[_0xaeb8('0x19')](function(_0x466f95){var _0x207d36;if(_0x466f95['results'][_0xaeb8('0x22')]){_0x466f95[_0xaeb8('0x1c')]=_[_0xaeb8('0x23')](_0x466f95[_0xaeb8('0x1c')],{'suspended':![],'role':'end-user'});if(_0x466f95[_0xaeb8('0x1c')][_0xaeb8('0x22')]){_0x207d36=_[_0xaeb8('0x24')](_0x466f95[_0xaeb8('0x1c')]);}}if(_0x207d36){logger['info']('Enduser\x20found!');return _0x207d36;}else{logger['info'](_0xaeb8('0x25'));return request({'uri':util[_0xaeb8('0x16')](_0xaeb8('0x26'),_0x4d17ea[_0xaeb8('0xb')]),'method':_0xaeb8('0x27'),'body':{'user':{'role':_0xaeb8('0x28'),'name':util[_0xaeb8('0x16')](_0xaeb8('0x29'),_0x5359d1||_0x5b3a40),'phone':_0x5b3a40}}})[_0xaeb8('0x19')](function(_0x12b27e){logger[_0xaeb8('0x9')](_0xaeb8('0x2a'));return _0x12b27e['user'];});}});}function getAuth(_0x5f19ba){var _0x367036;if(_0x5f19ba[_0xaeb8('0x2b')]===_0xaeb8('0x2c')){_0x367036=util[_0xaeb8('0x16')](_0xaeb8('0x2d'),_0x5f19ba['username'],_0x5f19ba[_0xaeb8('0x2c')]);}else if(_0x5f19ba[_0xaeb8('0x2b')]===_0xaeb8('0x2e')){_0x367036=util[_0xaeb8('0x16')](_0xaeb8('0x2f'),_0x5f19ba['username'],_0x5f19ba[_0xaeb8('0x2e')]);}return util[_0xaeb8('0x16')](_0xaeb8('0x30'),new Buffer(_0x367036)['toString'](_0xaeb8('0x31')));}function request(_0x2bdb1a){logger[_0xaeb8('0x32')](_0xaeb8('0x33'),JSON['stringify'](_0x2bdb1a));return rp(_[_0xaeb8('0x34')](_0x2bdb1a,{'method':_0xaeb8('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x560015,_0x57f2a0){var _0x5220d4=[];if(_0x560015&&_0x560015['length']>0x0){_0x5220d4=_['map'](_0x560015,_0x57f2a0);}return _0x5220d4;}function getCustomFields(_0x4fbd26,_0x55a320){var _0x414a5c=[];var _0x1a62b5={'custom_fields':[]};if(_0x4fbd26[_0xaeb8('0x22')]>0x0){_[_0xaeb8('0x36')](_0x4fbd26,function(_0x440c35){if(_[_0xaeb8('0x37')]([_0xaeb8('0x38'),'picklist'],_0x440c35[_0xaeb8('0x39')])&&_0x440c35['nameField']&&!_0x440c35['customField']){_0x1a62b5[_0x440c35['nameField'][_0xaeb8('0x3a')]()]=_0x440c35['content'][_0xaeb8('0x3b')]();}else if(_[_0xaeb8('0x37')]([_0xaeb8('0x38'),_0xaeb8('0x3c')],_0x440c35[_0xaeb8('0x39')])&&_0x440c35['idField']&&_0x440c35[_0xaeb8('0x3d')]){_0x1a62b5[_0xaeb8('0x3e')][_0xaeb8('0x3f')]({'id':_0x440c35[_0xaeb8('0x40')],'value':_0x440c35[_0xaeb8('0x41')][_0xaeb8('0x3b')]()});}else if(_0x440c35[_0xaeb8('0x39')]===_0xaeb8('0x42')&&_0x440c35['variableName']&&_0x440c35[_0xaeb8('0x40')]&&_0x440c35[_0xaeb8('0x3d')]){_0x55a320[_0x440c35[_0xaeb8('0x43')]]&&_0x1a62b5[_0xaeb8('0x3e')][_0xaeb8('0x3f')]({'id':_0x440c35[_0xaeb8('0x40')],'value':_0x55a320[_0x440c35['variableName']][_0xaeb8('0x3b')]()});}else if(_0x440c35[_0xaeb8('0x39')]===_0xaeb8('0x44')&&_0x440c35[_0xaeb8('0x45')]&&_0x440c35['Variable'][_0xaeb8('0xe')]&&_0x440c35[_0xaeb8('0x40')]&&_0x440c35[_0xaeb8('0x3d')]){_0x55a320[_0x440c35[_0xaeb8('0x45')][_0xaeb8('0xe')][_0xaeb8('0x3a')]()]&&_0x1a62b5['custom_fields'][_0xaeb8('0x3f')]({'id':_0x440c35['idField'],'value':_0x55a320[_0x440c35[_0xaeb8('0x45')]['name'][_0xaeb8('0x3a')]()]['toString']()});}});}return _0x1a62b5;}exports[_0xaeb8('0x46')]=function(_0x3ccaa4,_0x57f96a,_0x4e68d7,_0x383ad3,_0x744084,_0x9dfbd3){var _0x3150c8,_0x10bb2d;_0x9dfbd3[_0xaeb8('0xb')]=intUtil['stripTrailingSlash'](_0x9dfbd3[_0xaeb8('0xb')]);_0x9dfbd3[_0xaeb8('0x47')]=intUtil['stripTrailingSlash'](_0x9dfbd3[_0xaeb8('0x47')]);if(_0x744084&&_0x744084[_0xaeb8('0x48')]){logger['info'](_0xaeb8('0x49'),_0xaeb8('0x4a'));_0x57f96a['recordingURL']=util[_0xaeb8('0x16')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9dfbd3[_0xaeb8('0x47')],_0x57f96a['uniqueid'],md5(_0x57f96a[_0xaeb8('0x4b')]));}else{_0x57f96a[_0xaeb8('0x4c')]='';}headers['Authorization']=getAuth(_0x9dfbd3);return getUser(_0x9dfbd3,_0x383ad3['email'])['then'](function(_0x433737){_0x3150c8=_0x433737;logger[_0xaeb8('0x9')](_0xaeb8('0x4d'),_0x3150c8['id']);return getEndUser(_0x9dfbd3,_0x57f96a[_0xaeb8('0x4e')],_0x57f96a[_0xaeb8('0x4f')]);})[_0xaeb8('0x19')](function(_0x742b01){_0x10bb2d=_0x742b01;logger['info']('The\x20Enduser\x20ID\x20is:',_0x10bb2d['id']);return getTicket(_0x9dfbd3,_0x3150c8,_0x10bb2d,_0x4e68d7,_0x57f96a);})['then'](function(_0x11b644){if(_0x11b644){logger[_0xaeb8('0x9')]('The\x20Ticket\x20ID\x20is:',_0x11b644['id']);switch(_0x9dfbd3[_0xaeb8('0x39')]){case _0xaeb8('0x50'):logger[_0xaeb8('0x9')](_0xaeb8('0x49'),_0xaeb8('0x51'));return request({'uri':util[_0xaeb8('0x16')](_0xaeb8('0x52'),_0x9dfbd3[_0xaeb8('0xb')],_0x3150c8['id'],_0x11b644['id']),'method':_0xaeb8('0x27')});case _0xaeb8('0x53'):logger[_0xaeb8('0x9')]('[QUEUE]',_0xaeb8('0x54'));emit(util['format'](_0xaeb8('0x55'),_0x383ad3['name']),_0xaeb8('0x56'),{'uri':util[_0xaeb8('0x16')]('%s/agent/tickets/%s',_0x9dfbd3[_0xaeb8('0xb')][_0xaeb8('0x57')](_0xaeb8('0x58'),''),_0x11b644['id'])});break;default:logger[_0xaeb8('0x59')]('[QUEUE]',_0xaeb8('0x5a'));}}})[_0xaeb8('0x5b')](function(_0x59c913){logger[_0xaeb8('0x59')](_0xaeb8('0x5c'),util[_0xaeb8('0x5d')](_0x59c913,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x20e1a5,_0x14358b,_0x4e61f0,_0x115151,_0x4ab3c9,_0x484654,_0x336f1c){var _0x129d62,_0x284bf7;_0x484654[_0xaeb8('0xb')]=intUtil[_0xaeb8('0x5e')](_0x484654[_0xaeb8('0xb')]);_0x484654[_0xaeb8('0x47')]=intUtil['stripTrailingSlash'](_0x484654['serverUrl']);if(_0x336f1c&&_0x336f1c[_0xaeb8('0x5f')]&&_0x336f1c['recordingFormat']!=='none'){logger[_0xaeb8('0x9')](_0xaeb8('0x60'),_0xaeb8('0x4a'));_0x14358b[_0xaeb8('0x4c')]=util[_0xaeb8('0x16')](_0xaeb8('0x61'),_0x484654[_0xaeb8('0x47')],_0x14358b[_0xaeb8('0x4b')],md5(_0x14358b[_0xaeb8('0x4b')]));}headers[_0xaeb8('0x62')]=getAuth(_0x484654);return getUser(_0x484654,_0x115151[_0xaeb8('0x63')])['then'](function(_0x28cb1d){_0x129d62=_0x28cb1d;logger['info'](_0xaeb8('0x4d'),_0x129d62['id']);return getEndUser(_0x484654,_0x14358b[_0xaeb8('0x64')],_0x14358b[_0xaeb8('0x65')]);})['then'](function(_0x297216){_0x284bf7=_0x297216;logger[_0xaeb8('0x9')](_0xaeb8('0x66'),_0x284bf7['id']);return getTicket(_0x484654,_0x129d62,_0x284bf7,_0x4e61f0,_0x14358b);})['then'](function(_0x424da7){if(_0x424da7){logger['info'](_0xaeb8('0x67'),_0x424da7['id']);switch(_0x484654[_0xaeb8('0x39')]){case _0xaeb8('0x50'):logger['info'](_0xaeb8('0x60'),_0xaeb8('0x51'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x484654[_0xaeb8('0xb')],_0x129d62['id'],_0x424da7['id']),'method':'POST'});case _0xaeb8('0x53'):logger[_0xaeb8('0x9')]('[OUTBOUND]',_0xaeb8('0x54'));emit(util['format'](_0xaeb8('0x55'),_0x115151[_0xaeb8('0xe')]),_0xaeb8('0x56'),{'uri':util[_0xaeb8('0x16')]('%s/agent/tickets/%s',_0x484654[_0xaeb8('0xb')]['replace'](_0xaeb8('0x58'),''),_0x424da7['id'])});break;default:logger['error'](_0xaeb8('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xaeb8('0x5b')](function(_0x27fe39){logger['error'](_0xaeb8('0x68'),util[_0xaeb8('0x5d')](_0x27fe39,{'showHidden':!![],'depth':null}));});};exports[_0xaeb8('0x69')]=function(_0x511ed9,_0x593070,_0x2f8ffc,_0x5422eb,_0x5bd3fc,_0x4c0118){var _0x4e1d05,_0x164761;_0x4c0118[_0xaeb8('0xb')]=intUtil[_0xaeb8('0x5e')](_0x4c0118[_0xaeb8('0xb')]);_0x4c0118[_0xaeb8('0x47')]=intUtil['stripTrailingSlash'](_0x4c0118[_0xaeb8('0x47')]);if(_0x5bd3fc&&_0x5bd3fc[_0xaeb8('0x48')]){logger[_0xaeb8('0x9')]('['+_0x593070['lastevent'][_0xaeb8('0x6a')]()+']',_0xaeb8('0x4a'));_0x593070[_0xaeb8('0x4c')]=util[_0xaeb8('0x16')](_0xaeb8('0x61'),_0x4c0118[_0xaeb8('0x47')],_0x593070[_0xaeb8('0x4b')],md5(_0x593070[_0xaeb8('0x4b')]));}else{_0x593070[_0xaeb8('0x4c')]='';}headers[_0xaeb8('0x62')]=getAuth(_0x4c0118);return getUser(_0x4c0118)[_0xaeb8('0x19')](function(_0x3ae6ad){_0x4e1d05=_0x3ae6ad;logger['info'](_0xaeb8('0x4d'),_0x4e1d05['id']);return getEndUser(_0x4c0118,_0x593070[_0xaeb8('0x4e')],_0x593070[_0xaeb8('0x4f')]);})[_0xaeb8('0x19')](function(_0x6f2162){_0x164761=_0x6f2162;logger['info'](_0xaeb8('0x66'),_0x164761['id']);return getTicket(_0x4c0118,_0x4e1d05,_0x164761,_0x2f8ffc,_0x593070);})['then'](function(_0x5b39a0){if(_0x5b39a0){logger[_0xaeb8('0x9')](_0xaeb8('0x67'),_0x5b39a0['id']);}})[_0xaeb8('0x5b')](function(_0x53242a){logger[_0xaeb8('0x59')]('['+_0x593070[_0xaeb8('0x6b')][_0xaeb8('0x6a')]()+']'+_0xaeb8('0x6c'),util['inspect'](_0x53242a,{'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 fcc9a23..7c69373 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 _0x8e2b=['Failing\x20creating\x20the\x20access_token','stack','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','POST','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','data','details','enduserType','Error:\x20','catch','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','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','starttime','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','code','SUCCESS','Call\x20created!','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','toUpperCase','lodash','request-promise','util','./util','moment','ioredis','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','variable','variableName','toString','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','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','error'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x8e2b,0x19a));var _0xb8e2=function(_0x2976de,_0x4c546d){_0x2976de=_0x2976de-0x0;var _0xecbf51=_0x8e2b[_0x2976de];return _0xecbf51;};'use strict';var _=require(_0xb8e2('0x0'));var rp=require(_0xb8e2('0x1'));var md5=require('md5');var util=require(_0xb8e2('0x2'));var intUtil=require(_0xb8e2('0x3'));var moment=require(_0xb8e2('0x4'));var Redis=require(_0xb8e2('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zoho');config[_0xb8e2('0x6')]=_['defaults'](config[_0xb8e2('0x6')],{'host':_0xb8e2('0x7'),'port':0x18eb});var io=require(_0xb8e2('0x8'))(new Redis(config[_0xb8e2('0x6')]));function emit(_0x4d059b,_0x314d51,_0x485ac5){io['to'](_0x4d059b)[_0xb8e2('0x9')](_0x314d51,_0x485ac5);}function request(_0x2f3ca0){logger[_0xb8e2('0xa')](_0xb8e2('0xb'),JSON[_0xb8e2('0xc')](_0x2f3ca0));return rp(_0x2f3ca0);}function getCustomFields(_0x360093,_0x48913e){var _0x37ccbc={};if(_0x360093['length']>0x0){_[_0xb8e2('0xd')](_0x360093,function(_0x43b3d8){if(_[_0xb8e2('0xe')]([_0xb8e2('0xf'),_0xb8e2('0x10')],_0x43b3d8[_0xb8e2('0x11')])&&_0x43b3d8[_0xb8e2('0x12')]){_0x37ccbc[_0x43b3d8[_0xb8e2('0x12')]]=_0x43b3d8['content']['toString']();}else if(_0x43b3d8[_0xb8e2('0x11')]===_0xb8e2('0x13')&&_0x43b3d8['variableName']&&_0x43b3d8[_0xb8e2('0x12')]&&_0x48913e[_0x43b3d8[_0xb8e2('0x14')]]){_0x37ccbc[_0x43b3d8[_0xb8e2('0x12')]]=_0x48913e[_0x43b3d8[_0xb8e2('0x14')]][_0xb8e2('0x15')]();}else if(_0x43b3d8[_0xb8e2('0x11')]===_0xb8e2('0x16')&&_0x43b3d8[_0xb8e2('0x17')]&&_0x43b3d8[_0xb8e2('0x17')][_0xb8e2('0x18')]&&_0x43b3d8[_0xb8e2('0x12')]&&_0x48913e[_0x43b3d8['Variable'][_0xb8e2('0x18')][_0xb8e2('0x19')]()]){_0x37ccbc[_0x43b3d8['idField']]=_0x48913e[_0x43b3d8[_0xb8e2('0x17')][_0xb8e2('0x18')][_0xb8e2('0x19')]()][_0xb8e2('0x15')]();}});}return _0x37ccbc;}function getName(_0x5e0973){if(_0x5e0973[_0xb8e2('0x1a')]('\x20')>0x0){var _0x39d18d=_0x5e0973[_0xb8e2('0x1b')](/ (.+)/);if(_0x39d18d[0x1]){return _0x39d18d;}}return[_0x5e0973,_0x5e0973];}var accountsTokens={};function getAccessToken(_0x3927af){return new Promise(function(_0x5d066a,_0x4c5bad){if(!_[_0xb8e2('0x1c')](accountsTokens[_0x3927af['id']])&&!_[_0xb8e2('0x1c')](accountsTokens[_0x3927af['id']][_0xb8e2('0x1d')])){if(moment()[_0xb8e2('0x1e')](accountsTokens[_0x3927af['id']][_0xb8e2('0x1f')])){_0x5d066a(accountsTokens[_0x3927af['id']][_0xb8e2('0x1d')]);}}var _0x555ffd;switch(_0x3927af[_0xb8e2('0x20')]){case'US':_0x555ffd='https://accounts.zoho.com';break;case'AU':_0x555ffd=_0xb8e2('0x21');break;case'EU':_0x555ffd=_0xb8e2('0x22');break;case'IN':_0x555ffd=_0xb8e2('0x23');break;case'CN':_0x555ffd='https://accounts.zoho.com.cn';break;default:_0x555ffd=_0xb8e2('0x22');break;}var _0x453405={'method':'POST','uri':_0x555ffd+_0xb8e2('0x24'),'qs':{'refresh_token':_0x3927af['refreshToken'],'client_id':_0x3927af[_0xb8e2('0x25')],'client_secret':_0x3927af[_0xb8e2('0x26')],'grant_type':_0xb8e2('0x27')},'json':!![]};return rp(_0x453405)[_0xb8e2('0x28')](function(_0x55d6ce){accountsTokens[_0x3927af['id']]={'access_token':_0x55d6ce[_0xb8e2('0x1d')],'expires_in':moment()['add'](_0x55d6ce[_0xb8e2('0x1f')],_0xb8e2('0x29'))};_0x5d066a(_0x55d6ce[_0xb8e2('0x1d')]);})['catch'](function(_0x524100){logger[_0xb8e2('0x2a')](_0xb8e2('0x2b'),_0x524100[_0xb8e2('0x2c')]);_0x4c5bad(_0x524100);});});}function getUser(_0x52955a,_0x1c5137,_0x487f5d,_0x30758a){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0xb8e2('0x2d')]('https://www.zohoapis.%s/crm/v2/users',_0x1c5137),'qs':{'type':_0xb8e2('0x2e')},'headers':{'Authorization':_0xb8e2('0x2f')+_0x52955a},'json':!![]})['then'](function(_0x9e9556){if(_0x9e9556[_0xb8e2('0x30')]){var _0x1d20d7=-0x1;if(_['isArrayLikeObject'](_0x9e9556[_0xb8e2('0x30')])){if(!_['isNil'](_0x30758a)){_0x1d20d7=_[_0xb8e2('0x31')](_0x9e9556['users'],function(_0x4fa6ac){return _0x4fa6ac[_0xb8e2('0x32')]===_0x30758a;});}if(_0x1d20d7>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xb8e2('0x33')](_0xb8e2('0x34'));_0x1d20d7=_[_0xb8e2('0x31')](_0x9e9556[_0xb8e2('0x30')],function(_0x23086f){return _0x23086f['profile']['name']===_0xb8e2('0x35');});}return _0x9e9556['users'][_0x1d20d7];}else{if(_0x9e9556[_0xb8e2('0x36')][_0xb8e2('0x37')]['name']==='Administrator'){logger[_0xb8e2('0x33')](_0xb8e2('0x34'));user=_0x9e9556['user'];return user;}else{logger[_0xb8e2('0x2a')](_0xb8e2('0x38'),JSON[_0xb8e2('0xc')](_0x9e9556));throw new Error(_0xb8e2('0x39')+JSON['stringify'](_0x9e9556));}}}else{logger[_0xb8e2('0x2a')](_0xb8e2('0x38'),JSON['stringify'](_0x9e9556));throw new Error(_0xb8e2('0x39')+JSON[_0xb8e2('0xc')](_0x9e9556));}})['catch'](function(_0x2a5903){console['error'](_0x2a5903);});}function getZohoUser(_0x44be19,_0x4749c0){return new BPromise(function(_0x12ef23,_0x554164){request(_0x44be19)['then'](function(_0x4888fc){var _0xe3172e=null;if(_0x4888fc){_0xe3172e=_0x4888fc['data'][0x0];_0xe3172e['enduserType']=_0x4749c0;}_0x12ef23(_0xe3172e);})['catch'](function(_0x591548){_0x554164(_0x591548);});});}function createEndUser(_0x30a0f9,_0x5f34f0,_0x19e114,_0x12bbd3,_0x17b393,_0x178969){var _0x19e114=getName(_0x19e114);return request({'method':_0xb8e2('0x3a'),'uri':_0xb8e2('0x3b')+_0x5f34f0+'/crm/v2/'+_[_0xb8e2('0x3c')](_0x178969[_0xb8e2('0x3d')])+'s','body':{'data':[{'Last_Name':_0x19e114[0x1],'First_Name':_0x19e114[0x0],'Phone':_0x12bbd3,'Owner':{'name':!_[_0xb8e2('0x1c')](_0x17b393[_0xb8e2('0x3e')][_0xb8e2('0x18')])?_0x17b393[_0xb8e2('0x3e')][_0xb8e2('0x18')]:!_[_0xb8e2('0x1c')](_0x17b393[_0xb8e2('0x3f')])?_0x17b393[_0xb8e2('0x3f')]+'\x20'+_0x17b393[_0xb8e2('0x40')]:_0x17b393['last_name'],'id':_0x17b393['id']}}]},'headers':{'Authorization':_0xb8e2('0x2f')+_0x30a0f9},'json':!![]})[_0xb8e2('0x28')](function(_0x1cb3b5){if(_0x1cb3b5&&_0x1cb3b5[_0xb8e2('0x41')][0x0]['code']==='SUCCESS'){var _0x142190=_0x1cb3b5[_0xb8e2('0x41')][0x0][_0xb8e2('0x42')];_0x142190[_0xb8e2('0x43')]=_[_0xb8e2('0x3c')](_0x178969[_0xb8e2('0x3d')])+'s';return _0x142190;}logger[_0xb8e2('0x2a')]('The\x20failing\x20result\x20is',JSON[_0xb8e2('0xc')](data));throw new Error(_0xb8e2('0x44')+JSON[_0xb8e2('0xc')](data));})[_0xb8e2('0x45')](function(_0x1781d3){console['log'](_0xb8e2('0x46'),_0x1781d3);});}function getEndUser(_0xf95bc3,_0x233f4f,_0x1b65f6,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0){var _0x5bd127={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xf95bc3},'json':!![]};switch(_0x16d6a0[_0xb8e2('0x47')]){case _0xb8e2('0x48'):_0x5bd127[_0xb8e2('0x49')]=_0xb8e2('0x3b')+_0x233f4f+_0xb8e2('0x4a')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4b'))[_0xb8e2('0x28')](function(_0x125878){if(_0x125878)return _0x125878;_0x5bd127[_0xb8e2('0x49')]='https://www.zohoapis.'+_0x233f4f+_0xb8e2('0x4c')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4d'))[_0xb8e2('0x28')](function(_0x50c68c){if(_0x50c68c)return _0x50c68c;if(_0x16d6a0[_0xb8e2('0x3d')]!=_0xb8e2('0x4e')){return createEndUser(_0xf95bc3,_0x233f4f,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0);}else{return{};}});});break;case _0xb8e2('0x4f'):_0x5bd127['uri']=_0xb8e2('0x3b')+_0x233f4f+_0xb8e2('0x4a')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4b'))[_0xb8e2('0x28')](function(_0x4465b9){if(_0x4465b9)return _0x4465b9;if(_0x16d6a0['moduleCreate']!=_0xb8e2('0x4e')){return createEndUser(_0xf95bc3,_0x233f4f,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0);}else{return{};}});break;case _0xb8e2('0x50'):_0x5bd127['uri']=_0xb8e2('0x3b')+_0x233f4f+_0xb8e2('0x4c')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4d'))[_0xb8e2('0x28')](function(_0x4b1a62){if(_0x4b1a62)return _0x4b1a62;if(_0x16d6a0[_0xb8e2('0x3d')]!=_0xb8e2('0x4e')){return createEndUser(_0xf95bc3,_0x233f4f,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0);}else{return{};}});break;}}function getCall(_0x17fb73,_0x1aa8af,_0x215ff3,_0x512b85,_0x3bbda4,_0x4f538a,_0x1a958e,_0x4b4cdb){logger[_0xb8e2('0x33')](_0xb8e2('0x51'));var _0x50de9a={};_0x50de9a[_0xb8e2('0x52')]={'name':!_[_0xb8e2('0x1c')](_0x512b85[_0xb8e2('0x3e')][_0xb8e2('0x18')])&&!_['isNil'](_0x512b85['profile'][_0xb8e2('0x18')])&&_0x512b85[_0xb8e2('0x37')][_0xb8e2('0x18')]===_0xb8e2('0x53')?_0x512b85[_0xb8e2('0x3e')]['name']:!_['isNil'](_0x512b85['first_name'])?_0x512b85['first_name']+'\x20'+_0x512b85[_0xb8e2('0x40')]:_0x512b85[_0xb8e2('0x40')],'id':_0x512b85['id']};_0x50de9a[_0xb8e2('0x54')]=intUtil[_0xb8e2('0x55')](_0x4f538a['Subjects'],_0x1a958e,'\x20');_0x50de9a['Description']=intUtil[_0xb8e2('0x55')](_0x4f538a[_0xb8e2('0x56')],_0x1a958e,'\x0a');if(_0x3bbda4[_0xb8e2('0x43')]===_0xb8e2('0x4b')){_0x50de9a[_0xb8e2('0x57')]={'name':!_['isNil'](_0x3bbda4[_0xb8e2('0x58')])?_0x3bbda4[_0xb8e2('0x58')]:!_[_0xb8e2('0x1c')](_0x3bbda4[_0xb8e2('0x59')])?_0x3bbda4[_0xb8e2('0x59')]+'\x20'+_0x3bbda4[_0xb8e2('0x5a')]:_0x3bbda4[_0xb8e2('0x5a')],'id':_0x3bbda4['id']};}if(_0x3bbda4['enduserType']===_0xb8e2('0x4d')){_0x50de9a['What_Id']={'name':!_[_0xb8e2('0x1c')](_0x3bbda4[_0xb8e2('0x58')])?_0x3bbda4[_0xb8e2('0x58')]:!_[_0xb8e2('0x1c')](_0x3bbda4[_0xb8e2('0x59')])?_0x3bbda4[_0xb8e2('0x59')]+'\x20'+_0x3bbda4[_0xb8e2('0x5a')]:_0x3bbda4[_0xb8e2('0x5a')],'id':_0x3bbda4['id']};_0x50de9a[_0xb8e2('0x5b')]=_[_0xb8e2('0x3c')](_0x3bbda4[_0xb8e2('0x43')]);}if(_0x1a958e[_0xb8e2('0x5c')]){_0x50de9a[_0xb8e2('0x5d')]=moment[_0xb8e2('0x5e')](parseInt(_0x1a958e[_0xb8e2('0x5c')])*0x3e8)[_0xb8e2('0x2d')](_0xb8e2('0x5f'));}else if(_0x1a958e[_0xb8e2('0x60')]&&_0x1a958e[_0xb8e2('0x61')]){_0x50de9a[_0xb8e2('0x5d')]=moment[_0xb8e2('0x5e')](moment(_0x1a958e['endtime'],_0xb8e2('0x62'))[_0xb8e2('0x63')](moment(_0x1a958e[_0xb8e2('0x64')],'YYYY-MM-DDTHH:mm:ss')))[_0xb8e2('0x2d')](_0xb8e2('0x5f'));}switch(_0x1a958e[_0xb8e2('0x65')]){case _0xb8e2('0x66'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x68');break;case'complete':case _0xb8e2('0x69'):_0x50de9a['Call_Result']=_0xb8e2('0x6a');break;case _0xb8e2('0x6b'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x6c');break;case _0xb8e2('0x6d'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x6e');break;case _0xb8e2('0x6f'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x70');default:}_0x50de9a[_0xb8e2('0x71')]=(_0x4b4cdb===_0xb8e2('0x72')?moment(_0x1a958e['starttime'])['format'](_0xb8e2('0x62')):moment(_0x1a958e[_0xb8e2('0x73')])[_0xb8e2('0x2d')](_0xb8e2('0x62')))||moment()[_0xb8e2('0x2d')](_0xb8e2('0x62'));_0x50de9a['Call_Type']=_0x4b4cdb||_0xb8e2('0x74');_0x50de9a=_[_0xb8e2('0x75')](_0x50de9a,getCustomFields(_0x4f538a['Fields'],_0x1a958e));return request({'method':'POST','uri':_0xb8e2('0x3b')+_0x1aa8af+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x17fb73},'body':{'data':[_0x50de9a]},'json':!![]})[_0xb8e2('0x28')](function(_0x4b3df8){if(_0x4b3df8&&_0x4b3df8['data'][0x0][_0xb8e2('0x76')]===_0xb8e2('0x77')){logger[_0xb8e2('0x33')](_0xb8e2('0x78'));return{'id':_0x4b3df8[_0xb8e2('0x41')][0x0][_0xb8e2('0x42')]['id']};}})[_0xb8e2('0x45')](function(_0x398769){logger[_0xb8e2('0x33')]('err',_0x398769[_0xb8e2('0x2c')]);console[_0xb8e2('0x79')](_0xb8e2('0x7a'),_0x398769);});}exports[_0xb8e2('0x7b')]=function(_0x169400,_0x29ae6a,_0x3a58dd,_0x112fab,_0x1478e8,_0x2f8f6b){var _0x286c8c,_0x1782a6,_0x27b8b3;_0x2f8f6b[_0xb8e2('0x7c')]=intUtil[_0xb8e2('0x7d')](_0x2f8f6b[_0xb8e2('0x7c')]);_0x2f8f6b[_0xb8e2('0x7e')]=intUtil[_0xb8e2('0x7d')](_0x2f8f6b[_0xb8e2('0x7e')]);if(_0x1478e8&&_0x1478e8[_0xb8e2('0x7f')]){logger[_0xb8e2('0x33')](_0xb8e2('0x80'),_0xb8e2('0x81'));_0x29ae6a[_0xb8e2('0x82')]=_0x2f8f6b[_0xb8e2('0x7e')]+_0xb8e2('0x83')+_0x29ae6a[_0xb8e2('0x84')]+_0xb8e2('0x85')+md5(_0x29ae6a[_0xb8e2('0x84')]);}else{_0x29ae6a[_0xb8e2('0x82')]='';}var _0x169b1e=_0x2f8f6b[_0xb8e2('0x7c')]===_0xb8e2('0x86')?'eu':_0xb8e2('0x87');return getAccessToken(_0x2f8f6b)[_0xb8e2('0x28')](function(_0x4236c1){_0x27b8b3=_0x4236c1;return getUser(_0x27b8b3,_0x169b1e,_0x2f8f6b,_0x112fab[_0xb8e2('0x32')]);})['then'](function(_0x3a7b26){_0x286c8c=_0x3a7b26;logger[_0xb8e2('0x33')](_0xb8e2('0x88'),_0x286c8c['id']);return getEndUser(_0x27b8b3,_0x169b1e,_0x2f8f6b,_0x29ae6a[_0xb8e2('0x89')],_0x29ae6a[_0xb8e2('0x8a')],_0x286c8c,_0x3a58dd);})['then'](function(_0x44b885){_0x1782a6=_0x44b885;return getCall(_0x27b8b3,_0x169b1e,_0x2f8f6b,_0x286c8c,_0x1782a6,_0x3a58dd,_0x29ae6a,_0xb8e2('0x74'));})[_0xb8e2('0x28')](function(_0x161a2c){if(_0x161a2c){logger['info']('The\x20Call\x20ID\x20is:',_0x161a2c['id']);logger[_0xb8e2('0x33')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb8e2('0x2d')](_0xb8e2('0x8b'),_0x112fab[_0xb8e2('0x18')]),_0xb8e2('0x8c'),{'uri':_0xb8e2('0x8d')+_0x2f8f6b[_0xb8e2('0x7c')]+_0xb8e2('0x8e')+_0x161a2c['id']});}})[_0xb8e2('0x45')](function(_0x5452d2){logger['error'](_0xb8e2('0x80'),JSON[_0xb8e2('0xc')](_0x5452d2));});};exports[_0xb8e2('0x72')]=function(_0x43fa53,_0x43e788,_0xd93d27,_0x127ce4,_0x35e1c9,_0x27c324,_0x555b20){var _0x1cb2e4,_0x1bbaa8,_0x178118;_0x27c324[_0xb8e2('0x7c')]=intUtil[_0xb8e2('0x7d')](_0x27c324[_0xb8e2('0x7c')]);_0x27c324[_0xb8e2('0x7e')]=intUtil[_0xb8e2('0x7d')](_0x27c324['serverUrl']);if(_0x555b20&&_0x555b20[_0xb8e2('0x8f')]&&_0x555b20[_0xb8e2('0x8f')]!==_0xb8e2('0x90')){logger[_0xb8e2('0x33')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x43e788[_0xb8e2('0x82')]=_0x27c324[_0xb8e2('0x7e')]+_0xb8e2('0x83')+_0x43e788['uniqueid']+_0xb8e2('0x85')+md5(_0x43e788['uniqueid']);}var _0xdb3f7c=_0x27c324[_0xb8e2('0x7c')]===_0xb8e2('0x86')?'eu':_0xb8e2('0x87');return getAccessToken(_0x27c324)[_0xb8e2('0x28')](function(_0x548537){_0x178118=_0x548537;return getUser(_0x178118,_0xdb3f7c,_0x27c324,_0x127ce4['email']);})['then'](function(_0x4cb5d1){_0x1cb2e4=_0x4cb5d1;logger[_0xb8e2('0x33')]('The\x20User\x20ID\x20is:',_0x1cb2e4['id']);return getEndUser(_0x178118,_0xdb3f7c,_0x27c324,_0x43e788[_0xb8e2('0x91')],_0x43e788[_0xb8e2('0x92')],_0x1cb2e4,_0xd93d27);})['then'](function(_0x43f445){_0x1bbaa8=_0x43f445;return getCall(_0x178118,_0xdb3f7c,_0x27c324,_0x1cb2e4,_0x1bbaa8,_0xd93d27,_0x43e788,_0xb8e2('0x93'));})['then'](function(_0x42d377){if(_0x42d377){logger[_0xb8e2('0x33')](_0xb8e2('0x94'),_0x42d377['id']);logger[_0xb8e2('0x33')](_0xb8e2('0x95'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb8e2('0x8b'),_0x127ce4[_0xb8e2('0x18')]),_0xb8e2('0x8c'),{'uri':_0xb8e2('0x8d')+_0x27c324[_0xb8e2('0x7c')]+_0xb8e2('0x8e')+_0x42d377['id']});}})[_0xb8e2('0x45')](function(_0x3b5b5d){logger[_0xb8e2('0x2a')]('[OUTBOUND]',JSON[_0xb8e2('0xc')](_0x3b5b5d));});};exports['unmanaged']=function(_0x1ee263,_0x386ec9,_0x14fbd3,_0x2d4539,_0x58e1d0,_0x4afad8){var _0xf63960,_0x5ca64f,_0x37bf27;_0x4afad8[_0xb8e2('0x7c')]=intUtil[_0xb8e2('0x7d')](_0x4afad8[_0xb8e2('0x7c')]);_0x4afad8[_0xb8e2('0x7e')]=intUtil['stripTrailingSlash'](_0x4afad8[_0xb8e2('0x7e')]);if(_0x58e1d0&&_0x58e1d0[_0xb8e2('0x7f')]){logger[_0xb8e2('0x33')]('['+_0x386ec9[_0xb8e2('0x65')][_0xb8e2('0x96')]()+']',_0xb8e2('0x81'));_0x386ec9[_0xb8e2('0x82')]=_0x4afad8[_0xb8e2('0x7e')]+_0xb8e2('0x83')+_0x386ec9['uniqueid']+_0xb8e2('0x85')+md5(_0x386ec9[_0xb8e2('0x84')]);}else{_0x386ec9['recordingURL']='';}var _0x19dbe=_0x4afad8['host']==='zoho.eu'?'eu':_0xb8e2('0x87');return getAccessToken(_0x4afad8)[_0xb8e2('0x28')](function(_0x1a6720){_0x37bf27=_0x1a6720;return getUser(_0x37bf27,_0x19dbe,_0x4afad8);})[_0xb8e2('0x28')](function(_0x5c3341){_0xf63960=_0x5c3341;logger[_0xb8e2('0x33')](_0xb8e2('0x88'),_0xf63960['id']);return getEndUser(_0x37bf27,_0x19dbe,_0x4afad8,_0x386ec9['calleridname'],_0x386ec9[_0xb8e2('0x8a')],_0xf63960,_0x14fbd3);})[_0xb8e2('0x28')](function(_0x4b5ece){_0x5ca64f=_0x4b5ece;return getCall(_0x37bf27,_0x19dbe,_0x4afad8,_0xf63960,_0x5ca64f,_0x14fbd3,_0x386ec9,_0xb8e2('0x74'));})[_0xb8e2('0x28')](function(_0x31438d){if(_0x31438d){logger[_0xb8e2('0x33')]('The\x20Call\x20ID\x20is:',_0x31438d['id']);}})[_0xb8e2('0x45')](function(_0x4e3857){logger['error']('['+_0x386ec9[_0xb8e2('0x65')][_0xb8e2('0x96')]()+']',JSON['stringify'](_0x4e3857));});}; \ No newline at end of file +var _0x252f=['Call_Duration','answertime','endtime','utc','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Call_Start_Time','outbound','YYYY-MM-DDTHH:mm:ss','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','stack','err','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','none','/api/voice/recordings/','zoho.eu','Outbound','[OUTBOUND]','user:%s','trigger:browser:url','unmanaged','toUpperCase','calleridnum','lodash','request-promise','./util','moment','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','length','forEach','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','info','profile','user','Administrator','Using\x20the\x20admin\x20account!','error','stringify','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','Subjects','Description','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime'];(function(_0x30cc22,_0x53653f){var _0x5abebf=function(_0x53b2c2){while(--_0x53b2c2){_0x30cc22['push'](_0x30cc22['shift']());}};_0x5abebf(++_0x53653f);}(_0x252f,0xd0));var _0xf252=function(_0x26f081,_0x4277f3){_0x26f081=_0x26f081-0x0;var _0x4bf032=_0x252f[_0x26f081];return _0x4bf032;};'use strict';var _=require(_0xf252('0x0'));var rp=require(_0xf252('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0xf252('0x2'));var moment=require(_0xf252('0x3'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xf252('0x4'));var logger=require(_0xf252('0x5'))(_0xf252('0x6'));config[_0xf252('0x7')]=_[_0xf252('0x8')](config['redis'],{'host':_0xf252('0x9'),'port':0x18eb});var io=require(_0xf252('0xa'))(new Redis(config[_0xf252('0x7')]));function emit(_0xc8ae97,_0x25e8af,_0x4e95aa){io['to'](_0xc8ae97)[_0xf252('0xb')](_0x25e8af,_0x4e95aa);}function request(_0x352951){logger['debug'](_0xf252('0xc'),JSON['stringify'](_0x352951));return rp(_0x352951);}function getCustomFields(_0x3bd392,_0x5aa122){var _0x4b624f={};if(_0x3bd392[_0xf252('0xd')]>0x0){_[_0xf252('0xe')](_0x3bd392,function(_0x51fa4){if(_['includes']([_0xf252('0xf'),_0xf252('0x10')],_0x51fa4[_0xf252('0x11')])&&_0x51fa4[_0xf252('0x12')]){_0x4b624f[_0x51fa4[_0xf252('0x12')]]=_0x51fa4[_0xf252('0x13')]['toString']();}else if(_0x51fa4[_0xf252('0x11')]===_0xf252('0x14')&&_0x51fa4[_0xf252('0x15')]&&_0x51fa4['idField']&&_0x5aa122[_0x51fa4[_0xf252('0x15')]]){_0x4b624f[_0x51fa4[_0xf252('0x12')]]=_0x5aa122[_0x51fa4[_0xf252('0x15')]][_0xf252('0x16')]();}else if(_0x51fa4['type']===_0xf252('0x17')&&_0x51fa4['Variable']&&_0x51fa4[_0xf252('0x18')][_0xf252('0x19')]&&_0x51fa4[_0xf252('0x12')]&&_0x5aa122[_0x51fa4['Variable']['name'][_0xf252('0x1a')]()]){_0x4b624f[_0x51fa4[_0xf252('0x12')]]=_0x5aa122[_0x51fa4[_0xf252('0x18')]['name'][_0xf252('0x1a')]()]['toString']();}});}return _0x4b624f;}function getName(_0x5acc79){if(_0x5acc79[_0xf252('0x1b')]('\x20')>0x0){var _0x273673=_0x5acc79[_0xf252('0x1c')](/ (.+)/);if(_0x273673[0x1]){return _0x273673;}}return[_0x5acc79,_0x5acc79];}var accountsTokens={};function getAccessToken(_0x2ab64c){return new Promise(function(_0x4c86fb,_0x8b9d7e){if(!_[_0xf252('0x1d')](accountsTokens[_0x2ab64c['id']])&&!_[_0xf252('0x1d')](accountsTokens[_0x2ab64c['id']][_0xf252('0x1e')])){if(moment()['isBefore'](accountsTokens[_0x2ab64c['id']]['expires_in'])){_0x4c86fb(accountsTokens[_0x2ab64c['id']][_0xf252('0x1e')]);}}var _0x453220;switch(_0x2ab64c[_0xf252('0x1f')]){case'US':_0x453220='https://accounts.zoho.com';break;case'AU':_0x453220=_0xf252('0x20');break;case'EU':_0x453220=_0xf252('0x21');break;case'IN':_0x453220=_0xf252('0x22');break;case'CN':_0x453220='https://accounts.zoho.com.cn';break;default:_0x453220=_0xf252('0x21');break;}var _0x7848e8={'method':_0xf252('0x23'),'uri':_0x453220+_0xf252('0x24'),'qs':{'refresh_token':_0x2ab64c[_0xf252('0x25')],'client_id':_0x2ab64c[_0xf252('0x26')],'client_secret':_0x2ab64c['clientSecret'],'grant_type':_0xf252('0x27')},'json':!![]};return rp(_0x7848e8)[_0xf252('0x28')](function(_0x2c6073){accountsTokens[_0x2ab64c['id']]={'access_token':_0x2c6073[_0xf252('0x1e')],'expires_in':moment()[_0xf252('0x29')](_0x2c6073[_0xf252('0x2a')],_0xf252('0x2b'))};_0x4c86fb(_0x2c6073[_0xf252('0x1e')]);})[_0xf252('0x2c')](function(_0x404eb0){logger['error'](_0xf252('0x2d'),_0x404eb0['stack']);_0x8b9d7e(_0x404eb0);});});}function getUser(_0x534c98,_0x418fc5,_0x311f51,_0x58617f){logger['info']('Search\x20user');return request({'method':_0xf252('0x2e'),'uri':util[_0xf252('0x2f')](_0xf252('0x30'),_0x418fc5),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xf252('0x31')+_0x534c98},'json':!![]})['then'](function(_0x35ef76){if(_0x35ef76['users']){var _0x2e2114=-0x1;if(_[_0xf252('0x32')](_0x35ef76[_0xf252('0x33')])){if(!_[_0xf252('0x1d')](_0x58617f)){_0x2e2114=_[_0xf252('0x34')](_0x35ef76[_0xf252('0x33')],function(_0x3ada46){return _0x3ada46[_0xf252('0x35')]===_0x58617f;});}if(_0x2e2114>=0x0){logger[_0xf252('0x36')]('Agent\x20found!');}else{logger[_0xf252('0x36')]('Using\x20the\x20admin\x20account!');_0x2e2114=_['findIndex'](_0x35ef76[_0xf252('0x33')],function(_0x471018){return _0x471018[_0xf252('0x37')][_0xf252('0x19')]==='Administrator';});}return _0x35ef76['users'][_0x2e2114];}else{if(_0x35ef76[_0xf252('0x38')][_0xf252('0x37')][_0xf252('0x19')]===_0xf252('0x39')){logger[_0xf252('0x36')](_0xf252('0x3a'));user=_0x35ef76['user'];return user;}else{logger[_0xf252('0x3b')]('The\x20failing\x20result\x20is',JSON[_0xf252('0x3c')](_0x35ef76));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xf252('0x3c')](_0x35ef76));}}}else{logger[_0xf252('0x3b')](_0xf252('0x3d'),JSON[_0xf252('0x3c')](_0x35ef76));throw new Error(_0xf252('0x3e')+JSON['stringify'](_0x35ef76));}})[_0xf252('0x2c')](function(_0x103f90){console[_0xf252('0x3b')](_0x103f90);});}function getZohoUser(_0xa24058,_0x1070ce){return new BPromise(function(_0xa361c3,_0x396ca1){request(_0xa24058)[_0xf252('0x28')](function(_0x53d405){var _0x285ad7=null;if(_0x53d405){_0x285ad7=_0x53d405['data'][0x0];_0x285ad7[_0xf252('0x3f')]=_0x1070ce;}_0xa361c3(_0x285ad7);})[_0xf252('0x2c')](function(_0x262d1a){_0x396ca1(_0x262d1a);});});}function createEndUser(_0x3e46fe,_0xa199aa,_0x2d6325,_0x1256ff,_0x5b9bdd,_0x452256){var _0x2d6325=getName(_0x2d6325);return request({'method':_0xf252('0x23'),'uri':'https://www.zohoapis.'+_0xa199aa+_0xf252('0x40')+_[_0xf252('0x41')](_0x452256[_0xf252('0x42')])+'s','body':{'data':[{'Last_Name':_0x2d6325[0x1],'First_Name':_0x2d6325[0x0],'Phone':_0x1256ff,'Owner':{'name':!_['isNil'](_0x5b9bdd[_0xf252('0x43')][_0xf252('0x19')])?_0x5b9bdd['role']['name']:!_['isNil'](_0x5b9bdd[_0xf252('0x44')])?_0x5b9bdd[_0xf252('0x44')]+'\x20'+_0x5b9bdd[_0xf252('0x45')]:_0x5b9bdd['last_name'],'id':_0x5b9bdd['id']}}]},'headers':{'Authorization':_0xf252('0x31')+_0x3e46fe},'json':!![]})['then'](function(_0x2c19dc){if(_0x2c19dc&&_0x2c19dc[_0xf252('0x46')][0x0][_0xf252('0x47')]===_0xf252('0x48')){var _0x302a20=_0x2c19dc[_0xf252('0x46')][0x0][_0xf252('0x49')];_0x302a20[_0xf252('0x3f')]=_[_0xf252('0x41')](_0x452256[_0xf252('0x42')])+'s';return _0x302a20;}logger[_0xf252('0x3b')](_0xf252('0x3d'),JSON[_0xf252('0x3c')](data));throw new Error(_0xf252('0x4a')+JSON[_0xf252('0x3c')](data));})[_0xf252('0x2c')](function(_0x550180){console[_0xf252('0x4b')](_0xf252('0x4c'),_0x550180);});}function getEndUser(_0x41cc49,_0x59f8f8,_0x29b907,_0x427c17,_0x2983a3,_0x5d5233,_0x4eb107){var _0x291c95={'method':_0xf252('0x2e'),'uri':'','headers':{'Authorization':_0xf252('0x31')+_0x41cc49},'json':!![]};switch(_0x4eb107[_0xf252('0x4d')]){case _0xf252('0x4e'):_0x291c95[_0xf252('0x4f')]=_0xf252('0x50')+_0x59f8f8+_0xf252('0x51')+_0x2983a3+'))';return getZohoUser(_0x291c95,_0xf252('0x52'))['then'](function(_0x498089){if(_0x498089)return _0x498089;_0x291c95['uri']=_0xf252('0x50')+_0x59f8f8+_0xf252('0x53')+_0x2983a3+'))';return getZohoUser(_0x291c95,'Leads')[_0xf252('0x28')](function(_0x48d8b2){if(_0x48d8b2)return _0x48d8b2;if(_0x4eb107[_0xf252('0x42')]!=_0xf252('0x54')){return createEndUser(_0x41cc49,_0x59f8f8,_0x427c17,_0x2983a3,_0x5d5233,_0x4eb107);}else{return{};}});});break;case'contact':_0x291c95['uri']='https://www.zohoapis.'+_0x59f8f8+_0xf252('0x51')+_0x2983a3+'))';return getZohoUser(_0x291c95,_0xf252('0x52'))[_0xf252('0x28')](function(_0x516ef2){if(_0x516ef2)return _0x516ef2;if(_0x4eb107[_0xf252('0x42')]!=_0xf252('0x54')){return createEndUser(_0x41cc49,_0x59f8f8,_0x427c17,_0x2983a3,_0x5d5233,_0x4eb107);}else{return{};}});break;case _0xf252('0x55'):_0x291c95['uri']=_0xf252('0x50')+_0x59f8f8+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2983a3+'))';return getZohoUser(_0x291c95,_0xf252('0x56'))[_0xf252('0x28')](function(_0x669cc6){if(_0x669cc6)return _0x669cc6;if(_0x4eb107[_0xf252('0x42')]!='nothing'){return createEndUser(_0x41cc49,_0x59f8f8,_0x427c17,_0x2983a3,_0x5d5233,_0x4eb107);}else{return{};}});break;}}function getCall(_0x580d14,_0x20350b,_0x2e4f1,_0x53cc93,_0x52be84,_0x222a5a,_0xc1d9c7,_0xa4c618){logger[_0xf252('0x36')](_0xf252('0x57'));var _0x31d1d8={};_0x31d1d8['Owner']={'name':!_[_0xf252('0x1d')](_0x53cc93[_0xf252('0x43')][_0xf252('0x19')])&&!_['isNil'](_0x53cc93['profile']['name'])&&_0x53cc93['profile'][_0xf252('0x19')]==='administrator'?_0x53cc93['role'][_0xf252('0x19')]:!_[_0xf252('0x1d')](_0x53cc93[_0xf252('0x44')])?_0x53cc93[_0xf252('0x44')]+'\x20'+_0x53cc93[_0xf252('0x45')]:_0x53cc93['last_name'],'id':_0x53cc93['id']};_0x31d1d8['Subject']=intUtil['getString'](_0x222a5a[_0xf252('0x58')],_0xc1d9c7,'\x20');_0x31d1d8[_0xf252('0x59')]=intUtil[_0xf252('0x5a')](_0x222a5a['Descriptions'],_0xc1d9c7,'\x0a');if(_0x52be84[_0xf252('0x3f')]===_0xf252('0x52')){_0x31d1d8[_0xf252('0x5b')]={'name':!_[_0xf252('0x1d')](_0x52be84['Full_Name'])?_0x52be84[_0xf252('0x5c')]:!_['isNil'](_0x52be84[_0xf252('0x5d')])?_0x52be84[_0xf252('0x5d')]+'\x20'+_0x52be84[_0xf252('0x5e')]:_0x52be84['Last_Name'],'id':_0x52be84['id']};}if(_0x52be84[_0xf252('0x3f')]===_0xf252('0x56')){_0x31d1d8[_0xf252('0x5f')]={'name':!_[_0xf252('0x1d')](_0x52be84[_0xf252('0x5c')])?_0x52be84['Full_Name']:!_['isNil'](_0x52be84['First_Name'])?_0x52be84[_0xf252('0x5d')]+'\x20'+_0x52be84['Last_Name']:_0x52be84[_0xf252('0x5e')],'id':_0x52be84['id']};_0x31d1d8[_0xf252('0x60')]=_[_0xf252('0x41')](_0x52be84['enduserType']);}if(_0xc1d9c7[_0xf252('0x61')]){_0x31d1d8[_0xf252('0x62')]=moment['utc'](parseInt(_0xc1d9c7[_0xf252('0x61')])*0x3e8)['format']('mm:ss');}else if(_0xc1d9c7[_0xf252('0x63')]&&_0xc1d9c7[_0xf252('0x64')]){_0x31d1d8[_0xf252('0x62')]=moment[_0xf252('0x65')](moment(_0xc1d9c7[_0xf252('0x64')],'YYYY-MM-DDTHH:mm:ss')[_0xf252('0x66')](moment(_0xc1d9c7[_0xf252('0x67')],'YYYY-MM-DDTHH:mm:ss')))['format']('mm:ss');}switch(_0xc1d9c7[_0xf252('0x68')]){case _0xf252('0x69'):_0x31d1d8[_0xf252('0x6a')]=_0xf252('0x6b');break;case _0xf252('0x6c'):case _0xf252('0x6d'):_0x31d1d8[_0xf252('0x6a')]=_0xf252('0x6e');break;case _0xf252('0x6f'):_0x31d1d8[_0xf252('0x6a')]=_0xf252('0x70');break;case'abandoned':_0x31d1d8[_0xf252('0x6a')]=_0xf252('0x71');break;case _0xf252('0x72'):_0x31d1d8[_0xf252('0x6a')]='Timeout';default:}_0x31d1d8[_0xf252('0x73')]=(_0xa4c618===_0xf252('0x74')?moment(_0xc1d9c7[_0xf252('0x67')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0xc1d9c7['agentcalledAt'])[_0xf252('0x2f')](_0xf252('0x75')))||moment()[_0xf252('0x2f')](_0xf252('0x75'));_0x31d1d8[_0xf252('0x76')]=_0xa4c618||_0xf252('0x77');_0x31d1d8=_[_0xf252('0x78')](_0x31d1d8,getCustomFields(_0x222a5a[_0xf252('0x79')],_0xc1d9c7));return request({'method':_0xf252('0x23'),'uri':'https://www.zohoapis.'+_0x20350b+_0xf252('0x7a'),'headers':{'Authorization':_0xf252('0x31')+_0x580d14},'body':{'data':[_0x31d1d8]},'json':!![]})['then'](function(_0x24a691){if(_0x24a691&&_0x24a691['data'][0x0][_0xf252('0x47')]==='SUCCESS'){logger['info'](_0xf252('0x7b'));return{'id':_0x24a691[_0xf252('0x46')][0x0][_0xf252('0x49')]['id']};}})['catch'](function(_0x275b24){logger[_0xf252('0x36')]('err',_0x275b24[_0xf252('0x7c')]);console[_0xf252('0x4b')](_0xf252('0x7d'),_0x275b24);});}exports['queue']=function(_0x4b53a7,_0x151d63,_0x5eaee2,_0x5a8b3c,_0x342742,_0x58a093){var _0x23cfcc,_0x4181e8,_0x4b2b44;_0x58a093[_0xf252('0x7e')]=intUtil['stripTrailingSlash'](_0x58a093[_0xf252('0x7e')]);_0x58a093[_0xf252('0x7f')]=intUtil[_0xf252('0x80')](_0x58a093[_0xf252('0x7f')]);if(_0x342742&&_0x342742[_0xf252('0x81')]){logger[_0xf252('0x36')]('[QUEUE]',_0xf252('0x82'));_0x151d63[_0xf252('0x83')]=_0x58a093[_0xf252('0x7f')]+'/api/voice/recordings/'+_0x151d63[_0xf252('0x84')]+_0xf252('0x85')+md5(_0x151d63[_0xf252('0x84')]);}else{_0x151d63[_0xf252('0x83')]='';}var _0x554773=_0x58a093[_0xf252('0x7e')]==='zoho.eu'?'eu':_0xf252('0x86');return getAccessToken(_0x58a093)['then'](function(_0x4337b3){_0x4b2b44=_0x4337b3;return getUser(_0x4b2b44,_0x554773,_0x58a093,_0x5a8b3c['email']);})[_0xf252('0x28')](function(_0x5e60cb){_0x23cfcc=_0x5e60cb;logger[_0xf252('0x36')](_0xf252('0x87'),_0x23cfcc['id']);return getEndUser(_0x4b2b44,_0x554773,_0x58a093,_0x151d63[_0xf252('0x88')],_0x151d63['calleridnum'],_0x23cfcc,_0x5eaee2);})[_0xf252('0x28')](function(_0x44b68b){_0x4181e8=_0x44b68b;return getCall(_0x4b2b44,_0x554773,_0x58a093,_0x23cfcc,_0x4181e8,_0x5eaee2,_0x151d63,'Inbound');})[_0xf252('0x28')](function(_0x2641a6){if(_0x2641a6){logger[_0xf252('0x36')](_0xf252('0x89'),_0x2641a6['id']);logger[_0xf252('0x36')]('[QUEUE]',_0xf252('0x8a'));emit(util[_0xf252('0x2f')]('user:%s',_0x5a8b3c[_0xf252('0x19')]),'trigger:browser:url',{'uri':_0xf252('0x8b')+_0x58a093[_0xf252('0x7e')]+_0xf252('0x8c')+_0x2641a6['id']});}})[_0xf252('0x2c')](function(_0x3983d4){logger[_0xf252('0x3b')](_0xf252('0x8d'),JSON[_0xf252('0x3c')](_0x3983d4));});};exports[_0xf252('0x74')]=function(_0xabbed0,_0x30c754,_0x4a243e,_0x1c1f2d,_0x56f3e9,_0x40ecf4,_0x3d7a22){var _0x427a13,_0x4b4cb3,_0x2d328d;_0x40ecf4[_0xf252('0x7e')]=intUtil[_0xf252('0x80')](_0x40ecf4[_0xf252('0x7e')]);_0x40ecf4[_0xf252('0x7f')]=intUtil[_0xf252('0x80')](_0x40ecf4[_0xf252('0x7f')]);if(_0x3d7a22&&_0x3d7a22[_0xf252('0x8e')]&&_0x3d7a22[_0xf252('0x8e')]!==_0xf252('0x8f')){logger[_0xf252('0x36')]('[OUTBOUND]',_0xf252('0x82'));_0x30c754[_0xf252('0x83')]=_0x40ecf4[_0xf252('0x7f')]+_0xf252('0x90')+_0x30c754['uniqueid']+_0xf252('0x85')+md5(_0x30c754[_0xf252('0x84')]);}var _0x3d3e41=_0x40ecf4['host']===_0xf252('0x91')?'eu':_0xf252('0x86');return getAccessToken(_0x40ecf4)[_0xf252('0x28')](function(_0x3aecee){_0x2d328d=_0x3aecee;return getUser(_0x2d328d,_0x3d3e41,_0x40ecf4,_0x1c1f2d[_0xf252('0x35')]);})[_0xf252('0x28')](function(_0x2978b3){_0x427a13=_0x2978b3;logger[_0xf252('0x36')](_0xf252('0x87'),_0x427a13['id']);return getEndUser(_0x2d328d,_0x3d3e41,_0x40ecf4,_0x30c754['destcalleridname'],_0x30c754['destcalleridnum'],_0x427a13,_0x4a243e);})[_0xf252('0x28')](function(_0x43ae42){_0x4b4cb3=_0x43ae42;return getCall(_0x2d328d,_0x3d3e41,_0x40ecf4,_0x427a13,_0x4b4cb3,_0x4a243e,_0x30c754,_0xf252('0x92'));})[_0xf252('0x28')](function(_0x5aeb13){if(_0x5aeb13){logger[_0xf252('0x36')](_0xf252('0x89'),_0x5aeb13['id']);logger['info'](_0xf252('0x93'),_0xf252('0x8a'));emit(util[_0xf252('0x2f')](_0xf252('0x94'),_0x1c1f2d[_0xf252('0x19')]),_0xf252('0x95'),{'uri':_0xf252('0x8b')+_0x40ecf4[_0xf252('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5aeb13['id']});}})['catch'](function(_0x1b0616){logger[_0xf252('0x3b')](_0xf252('0x93'),JSON[_0xf252('0x3c')](_0x1b0616));});};exports[_0xf252('0x96')]=function(_0x2f0d6d,_0x376455,_0xd35006,_0x3c63ee,_0x357acf,_0xd5b38c){var _0x2a9fc0,_0x125534,_0x5cf72e;_0xd5b38c[_0xf252('0x7e')]=intUtil[_0xf252('0x80')](_0xd5b38c[_0xf252('0x7e')]);_0xd5b38c[_0xf252('0x7f')]=intUtil[_0xf252('0x80')](_0xd5b38c[_0xf252('0x7f')]);if(_0x357acf&&_0x357acf[_0xf252('0x81')]){logger[_0xf252('0x36')]('['+_0x376455[_0xf252('0x68')][_0xf252('0x97')]()+']',_0xf252('0x82'));_0x376455['recordingURL']=_0xd5b38c[_0xf252('0x7f')]+_0xf252('0x90')+_0x376455[_0xf252('0x84')]+_0xf252('0x85')+md5(_0x376455[_0xf252('0x84')]);}else{_0x376455[_0xf252('0x83')]='';}var _0x46e074=_0xd5b38c[_0xf252('0x7e')]===_0xf252('0x91')?'eu':_0xf252('0x86');return getAccessToken(_0xd5b38c)['then'](function(_0x174120){_0x5cf72e=_0x174120;return getUser(_0x5cf72e,_0x46e074,_0xd5b38c);})['then'](function(_0x1e204e){_0x2a9fc0=_0x1e204e;logger[_0xf252('0x36')](_0xf252('0x87'),_0x2a9fc0['id']);return getEndUser(_0x5cf72e,_0x46e074,_0xd5b38c,_0x376455[_0xf252('0x88')],_0x376455[_0xf252('0x98')],_0x2a9fc0,_0xd35006);})['then'](function(_0xb404f5){_0x125534=_0xb404f5;return getCall(_0x5cf72e,_0x46e074,_0xd5b38c,_0x2a9fc0,_0x125534,_0xd35006,_0x376455,_0xf252('0x77'));})['then'](function(_0xbfd16a){if(_0xbfd16a){logger['info']('The\x20Call\x20ID\x20is:',_0xbfd16a['id']);}})[_0xf252('0x2c')](function(_0x4bf71d){logger['error']('['+_0x376455[_0xf252('0x68')][_0xf252('0x97')]()+']',JSON[_0xf252('0x3c')](_0x4bf71d));});}; \ 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 4482bae..2248392 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 _0x489c=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','exec','data2','render','data3','error'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0x489c,0x12d));var _0xc489=function(_0x2bf2f7,_0x3797ff){_0x2bf2f7=_0x2bf2f7-0x0;var _0x7c9d1c=_0x489c[_0x2bf2f7];return _0x7c9d1c;};'use strict';var util=require(_0xc489('0x0'));var sh=require(_0xc489('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0xc489('0x2')]=function(_0x29f11a,_0x4cba9c){var _0x33bca5=_0x29f11a[_0xc489('0x3')]?_0x29f11a[_0xc489('0x3')]:'Script';var _0x54bb52=_0x29f11a['data3']?Mustache[_0xc489('0x4')](_0x29f11a[_0xc489('0x5')],_0x4cba9c):_0x4cba9c;sh[_0xc489('0x2')](_0x54bb52,function(_0x109e21,_0x2036b6,_0xefe519){if(_0x109e21!==0x0){logger[_0xc489('0x6')](util['format'](_0xc489('0x7'),_0x33bca5,_0x54bb52,_0x109e21,_0xefe519));}else{logger[_0xc489('0x8')](util[_0xc489('0x9')](_0xc489('0xa'),_0x33bca5,_0x54bb52,_0x2036b6));}});}; \ No newline at end of file +var _0x401a=['shelljs','mustache','../../../../config/logger','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0x401a,0x103));var _0xa401=function(_0x170b19,_0x4913cb){_0x170b19=_0x170b19-0x0;var _0x2eb48d=_0x401a[_0x170b19];return _0x2eb48d;};'use strict';var util=require(_0xa401('0x0'));var sh=require(_0xa401('0x1'));var Mustache=require(_0xa401('0x2'));var logger=require(_0xa401('0x3'))('trigger');exports['exec']=function(_0x5f4a50,_0x5f139c){var _0x23ebeb=_0x5f4a50['data2']?_0x5f4a50['data2']:'Script';var _0x1a3d49=_0x5f4a50[_0xa401('0x4')]?Mustache['render'](_0x5f4a50[_0xa401('0x4')],_0x5f139c):_0x5f139c;sh[_0xa401('0x5')](_0x1a3d49,function(_0x2a235c,_0x5e9a55,_0x1b288c){if(_0x2a235c!==0x0){logger[_0xa401('0x6')](util[_0xa401('0x7')](_0xa401('0x8'),_0x23ebeb,_0x1a3d49,_0x2a235c,_0x1b288c));}else{logger[_0xa401('0x9')](util[_0xa401('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x23ebeb,_0x1a3d49,_0x5e9a55));}});}; \ 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 0fd04af..94c0ade 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 _0x1166=['name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','number','data5','headers','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','stringify','isNil','format','data2','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x3abdb3,_0x11f72c){var _0x736bfe=function(_0xe3652c){while(--_0xe3652c){_0x3abdb3['push'](_0x3abdb3['shift']());}};_0x736bfe(++_0x11f72c);}(_0x1166,0x86));var _0x6116=function(_0x41049b,_0x15ffb7){_0x41049b=_0x41049b-0x0;var _0x4055a5=_0x1166[_0x41049b];return _0x4055a5;};'use strict';var rp=require(_0x6116('0x0'));var util=require('util');var _=require(_0x6116('0x1'));var Mustache=require(_0x6116('0x2'));var logger=require(_0x6116('0x3'))(_0x6116('0x4'));exports[_0x6116('0x5')]=function(_0x56e5bd,_0x16b908){var _0x16a440,_0x45a181;var _0x3bd2bb={'method':_0x56e5bd[_0x6116('0x6')][_0x6116('0x7')](),'uri':Mustache['render'](_0x56e5bd['data2'],_0x16b908),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x56e5bd['data5'])===_0x6116('0x8')&&parseInt(_0x56e5bd[_0x6116('0x9')])>=0x1&&parseInt(_0x56e5bd[_0x6116('0x9')])<=0xa?parseInt(_0x56e5bd['data5'])*0x3e8:0x5*0x3e8};try{_0x3bd2bb[_0x6116('0xa')]=_0x56e5bd[_0x6116('0xb')]?JSON[_0x6116('0xc')](Mustache['render'](_0x56e5bd[_0x6116('0xb')],_0x16b908)):{};}catch(_0x3746f1){logger[_0x6116('0xd')](_0x3746f1[_0x6116('0xe')]);}switch(_0x56e5bd[_0x6116('0x6')][_0x6116('0x7')]()){case _0x6116('0xf'):case _0x6116('0x10'):_0x16a440=null;_0x3bd2bb['qs']=_0x16b908;break;case _0x6116('0x11'):case _0x6116('0x12'):if(_0x56e5bd[_0x6116('0x13')]){try{_0x16a440=JSON[_0x6116('0xc')](Mustache[_0x6116('0x14')](_0x56e5bd[_0x6116('0x13')],_0x16b908));_0x3bd2bb[_0x6116('0x15')]=_0x16a440;}catch(_0x5b70ec){logger[_0x6116('0xd')](_0x5b70ec[_0x6116('0xe')]);logger[_0x6116('0xd')](_0x6116('0x16'));}}else{_0x16a440=_0x16b908;_0x3bd2bb[_0x6116('0x15')]=_0x16a440;}break;}logger[_0x6116('0x17')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x56e5bd[_0x6116('0x6')],_0x56e5bd['data2'],JSON[_0x6116('0x18')](_0x3bd2bb)));rp(_0x3bd2bb)['then'](function(_0x12198c){_0x16a440=!_[_0x6116('0x19')](_0x16a440)?',\x20request\x20body:\x20'+_0x16a440:'';_0x45a181=typeof _0x12198c[_0x6116('0x15')]==='object'?JSON[_0x6116('0x18')](_0x12198c['body']):_0x12198c[_0x6116('0x15')];logger[_0x6116('0x17')](util[_0x6116('0x1a')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x56e5bd['data1'],_0x56e5bd[_0x6116('0x1b')],_0x12198c[_0x6116('0x1c')],_0x45a181));})[_0x6116('0x1d')](function(_0x36f840){logger[_0x6116('0xd')](util[_0x6116('0x1a')](_0x6116('0x1e'),_0x56e5bd[_0x6116('0x6')],_0x56e5bd[_0x6116('0x1b')],_0x36f840[_0x6116('0x1c')],_0x36f840[_0x6116('0x1f')],_0x36f840[_0x6116('0x20')]));});}; \ No newline at end of file +var _0x078b=['parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','mustache','trigger','exec','data1','toUpperCase','render','data2','number','data5','data6','error','GET','PUT','data7'];(function(_0x52f09d,_0x3304bf){var _0x53425a=function(_0x2772c7){while(--_0x2772c7){_0x52f09d['push'](_0x52f09d['shift']());}};_0x53425a(++_0x3304bf);}(_0x078b,0x70));var _0xb078=function(_0x3e2154,_0x53b213){_0x3e2154=_0x3e2154-0x0;var _0x39434d=_0x078b[_0x3e2154];return _0x39434d;};'use strict';var rp=require(_0xb078('0x0'));var util=require(_0xb078('0x1'));var _=require('lodash');var Mustache=require(_0xb078('0x2'));var logger=require('../../../../config/logger')(_0xb078('0x3'));exports[_0xb078('0x4')]=function(_0x2042f9,_0x260a6a){var _0x1fbd2d,_0x18cd68;var _0x43e767={'method':_0x2042f9[_0xb078('0x5')][_0xb078('0x6')](),'uri':Mustache[_0xb078('0x7')](_0x2042f9[_0xb078('0x8')],_0x260a6a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2042f9['data5'])===_0xb078('0x9')&&parseInt(_0x2042f9[_0xb078('0xa')])>=0x1&&parseInt(_0x2042f9[_0xb078('0xa')])<=0xa?parseInt(_0x2042f9[_0xb078('0xa')])*0x3e8:0x5*0x3e8};try{_0x43e767['headers']=_0x2042f9[_0xb078('0xb')]?JSON['parse'](Mustache['render'](_0x2042f9[_0xb078('0xb')],_0x260a6a)):{};}catch(_0x51d2e6){logger[_0xb078('0xc')](_0x51d2e6['stack']);}switch(_0x2042f9[_0xb078('0x5')][_0xb078('0x6')]()){case _0xb078('0xd'):case'DELETE':_0x1fbd2d=null;_0x43e767['qs']=_0x260a6a;break;case'POST':case _0xb078('0xe'):if(_0x2042f9[_0xb078('0xf')]){try{_0x1fbd2d=JSON[_0xb078('0x10')](Mustache[_0xb078('0x7')](_0x2042f9[_0xb078('0xf')],_0x260a6a));_0x43e767[_0xb078('0x11')]=_0x1fbd2d;}catch(_0x43860a){logger['error'](_0x43860a[_0xb078('0x12')]);logger['error'](_0xb078('0x13'));}}else{_0x1fbd2d=_0x260a6a;_0x43e767['body']=_0x1fbd2d;}break;}logger[_0xb078('0x14')](util['format'](_0xb078('0x15'),_0x2042f9[_0xb078('0x5')],_0x2042f9['data2'],JSON[_0xb078('0x16')](_0x43e767)));rp(_0x43e767)[_0xb078('0x17')](function(_0x1bab18){_0x1fbd2d=!_['isNil'](_0x1fbd2d)?_0xb078('0x18')+_0x1fbd2d:'';_0x18cd68=typeof _0x1bab18[_0xb078('0x11')]===_0xb078('0x19')?JSON[_0xb078('0x16')](_0x1bab18[_0xb078('0x11')]):_0x1bab18[_0xb078('0x11')];logger['info'](util[_0xb078('0x1a')](_0xb078('0x1b'),_0x2042f9[_0xb078('0x5')],_0x2042f9['data2'],_0x1bab18[_0xb078('0x1c')],_0x18cd68));})[_0xb078('0x1d')](function(_0x3a1745){logger[_0xb078('0xc')](util[_0xb078('0x1a')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2042f9[_0xb078('0x5')],_0x2042f9[_0xb078('0x8')],_0x3a1745[_0xb078('0x1c')],_0x3a1745[_0xb078('0x1e')],_0x3a1745[_0xb078('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 07dca76..e95e1d4 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 _0x94bd=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message','result','catch'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x94bd,0x10f));var _0xd94b=function(_0x2eacef,_0x34a7d2){_0x2eacef=_0x2eacef-0x0;var _0x376017=_0x94bd[_0x2eacef];return _0x376017;};'use strict';var jayson=require(_0xd94b('0x0'));var BPromise=require(_0xd94b('0x1'));var logger=require(_0xd94b('0x2'))(_0xd94b('0x3'));var client=jayson[_0xd94b('0x4')][_0xd94b('0x5')]({'port':0x2329});client[_0xd94b('0x6')]=function(_0x400462,_0x34e626){return new BPromise(function(_0x14a395,_0x1f886f){return client['request'](_0x400462,_0x34e626)[_0xd94b('0x7')](function(_0x2f1440){logger[_0xd94b('0x8')](_0xd94b('0x9'),_0xd94b('0x3'),_0x400462,_0x34e626,_0x2f1440);if(_0x2f1440[_0xd94b('0xa')]){logger[_0xd94b('0xa')]('rpc',_0xd94b('0x3'),_0x400462,_0x2f1440[_0xd94b('0xa')][_0xd94b('0xb')],_0x34e626);return _0x1f886f(_0x2f1440[_0xd94b('0xa')][_0xd94b('0xb')]);}else{return _0x14a395(_0x2f1440[_0xd94b('0xc')]);}})[_0xd94b('0xd')](function(_0x1643a3){logger['error'](_0xd94b('0x9'),_0xd94b('0x3'),_0x400462,_0x1643a3,_0x34e626);return _0x1f886f(_0x1643a3);});});};module[_0xd94b('0xe')]=client; \ No newline at end of file +var _0x9062=['../../config/logger','routing','client','http','Request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x8fed03,_0x2fb0c1){var _0x141fd6=function(_0x3e8503){while(--_0x3e8503){_0x8fed03['push'](_0x8fed03['shift']());}};_0x141fd6(++_0x2fb0c1);}(_0x9062,0x166));var _0x2906=function(_0x480603,_0xa406ed){_0x480603=_0x480603-0x0;var _0x41974b=_0x9062[_0x480603];return _0x41974b;};'use strict';var jayson=require(_0x2906('0x0'));var BPromise=require(_0x2906('0x1'));var logger=require(_0x2906('0x2'))(_0x2906('0x3'));var client=jayson[_0x2906('0x4')][_0x2906('0x5')]({'port':0x2329});client[_0x2906('0x6')]=function(_0x54a6a9,_0x64ef09){return new BPromise(function(_0x44569d,_0x65013d){return client['request'](_0x54a6a9,_0x64ef09)[_0x2906('0x7')](function(_0xb776cc){logger[_0x2906('0x8')](_0x2906('0x9'),_0x2906('0x3'),_0x54a6a9,_0x64ef09,_0xb776cc);if(_0xb776cc[_0x2906('0xa')]){logger[_0x2906('0xa')](_0x2906('0x9'),_0x2906('0x3'),_0x54a6a9,_0xb776cc[_0x2906('0xa')][_0x2906('0xb')],_0x64ef09);return _0x65013d(_0xb776cc[_0x2906('0xa')]['message']);}else{return _0x44569d(_0xb776cc[_0x2906('0xc')]);}})[_0x2906('0xd')](function(_0x240bc7){logger['error'](_0x2906('0x9'),'routing',_0x54a6a9,_0x240bc7,_0x64ef09);return _0x65013d(_0x240bc7);});});};module[_0x2906('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 9a336f7..4a34154 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 _0xa0df=['listen','getSettings','loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','mailAccounts'];(function(_0x38b60f,_0x1f4bac){var _0x1f164c=function(_0x7baade){while(--_0x7baade){_0x38b60f['push'](_0x38b60f['shift']());}};_0x1f164c(++_0x1f4bac);}(_0xa0df,0x11d));var _0xfa0d=function(_0x3e0c86,_0x1b7b6d){_0x3e0c86=_0x3e0c86-0x0;var _0x4a61b3=_0xa0df[_0x3e0c86];return _0x4a61b3;};'use strict';var BPromise=require(_0xfa0d('0x0'));var server=require(_0xfa0d('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xfa0d('0x2'));var mailAccount=require(_0xfa0d('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xfa0d('0x4')]()[_0xfa0d('0x5')](mailAccount[_0xfa0d('0x6')]())[_0xfa0d('0x5')](realtime[_0xfa0d('0x7')]())[_0xfa0d('0x5')](function(){email['refresh'](realtime[_0xfa0d('0x8')]);return realtime;});}function main(){return server[_0xfa0d('0x9')](realtime,email)['then'](function(){return initRealtime();})[_0xfa0d('0x5')](function(){return setting[_0xfa0d('0xa')]();})[_0xfa0d('0x5')](function(_0x571820){return setInterval(initRealtime,_0x571820[_0xfa0d('0xb')]*0x3e8);})[_0xfa0d('0xc')](function(_0x547bce){console[_0xfa0d('0xd')](_0x547bce);});}main(); \ No newline at end of file +var _0x2f30=['resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','log','bluebird','./server','./realtime','./lib/email'];(function(_0x48c99b,_0x4c75a1){var _0x21a2f6=function(_0x4906a0){while(--_0x4906a0){_0x48c99b['push'](_0x48c99b['shift']());}};_0x21a2f6(++_0x4c75a1);}(_0x2f30,0xe6));var _0x02f3=function(_0x38384f,_0x55c78b){_0x38384f=_0x38384f-0x0;var _0x264f1b=_0x2f30[_0x38384f];return _0x264f1b;};'use strict';var BPromise=require(_0x02f3('0x0'));var server=require(_0x02f3('0x1'));var Realtime=require(_0x02f3('0x2'));var EmailChannel=require(_0x02f3('0x3'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x02f3('0x4')]()[_0x02f3('0x5')](mailAccount[_0x02f3('0x6')]())[_0x02f3('0x5')](realtime[_0x02f3('0x7')]())[_0x02f3('0x5')](function(){email['refresh'](realtime[_0x02f3('0x8')]);return realtime;});}function main(){return server[_0x02f3('0x9')](realtime,email)[_0x02f3('0x5')](function(){return initRealtime();})[_0x02f3('0x5')](function(){return setting[_0x02f3('0xa')]();})[_0x02f3('0x5')](function(_0x59841b){return setInterval(initRealtime,_0x59841b[_0x02f3('0xb')]*0x3e8);})['catch'](function(_0x605415){console[_0x02f3('0xc')](_0x605415);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 2ac25d5..8757757 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 _0x6caa=['send','Smtp','verified','catch','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','smtp','prototype','emit','mailAccounts','key','active','Imap','messageStatus','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','handleImapBox','bind','handleImapEmail','handleImapEnd','error','isNil','status','disabled','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail'];(function(_0x371c79,_0x41bdf2){var _0x54fe8e=function(_0x19c501){while(--_0x19c501){_0x371c79['push'](_0x371c79['shift']());}};_0x54fe8e(++_0x41bdf2);}(_0x6caa,0x19c));var _0xa6ca=function(_0x2ff114,_0x4ff268){_0x2ff114=_0x2ff114-0x0;var _0x2fad22=_0x6caa[_0x2ff114];return _0x2fad22;};'use strict';var _=require('lodash');var moment=require(_0xa6ca('0x0'));var BPromise=require(_0xa6ca('0x1'));var md5=require(_0xa6ca('0x2'));var Redis=require(_0xa6ca('0x3'));var config=require(_0xa6ca('0x4'));var logger=require(_0xa6ca('0x5'))(_0xa6ca('0x6'));config[_0xa6ca('0x7')]=_[_0xa6ca('0x8')](config[_0xa6ca('0x7')],{'host':_0xa6ca('0x9'),'port':0x18eb});var io=require(_0xa6ca('0xa'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xa6ca('0xb'));var md5Accounts={};function EmailChannel(_0x1e5d05){logger[_0xa6ca('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x1e5d05['mailAccounts'];this['imapAccounts']={};this[_0xa6ca('0xd')]=new EmailSmtp();}EmailChannel[_0xa6ca('0xe')][_0xa6ca('0xf')]=function(_0x72cf9f){var _0xee552f=this[_0xa6ca('0x10')][_0x72cf9f];var _0x3e6604={'id':_0xee552f['id'],'name':_0xee552f['name'],'key':_0xee552f[_0xa6ca('0x11')],'active':_0xee552f[_0xa6ca('0x12')],'Imap':{'status':_0xee552f[_0xa6ca('0x13')]['status'],'messageStatus':_0xee552f[_0xa6ca('0x13')][_0xa6ca('0x14')],'total':_0xee552f[_0xa6ca('0x13')]['total']}};if(_['isNil'](md5Accounts[_0x72cf9f])){md5Accounts[_0x72cf9f]={};}var _0x54a572=md5(JSON[_0xa6ca('0x15')](_0x3e6604));if(md5Accounts[_0x72cf9f]['md5']!==_0x54a572){md5Accounts[_0x72cf9f][_0xa6ca('0x2')]=_0x54a572;io['emit'](_0xa6ca('0x16'),_0x3e6604);}};EmailChannel[_0xa6ca('0xe')][_0xa6ca('0x17')]=function(_0x52af97){for(var _0x426f96 in _0x52af97){if(_0x52af97[_0xa6ca('0x18')](_0x426f96)){if(_0x52af97[_0x426f96][_0xa6ca('0x13')]&&_0x52af97[_0x426f96][_0xa6ca('0x12')]){var _0x1558a6=_0x52af97[_0x426f96][_0xa6ca('0x13')];if(!this[_0xa6ca('0x19')][_0xa6ca('0x18')](_0x1558a6['id'])){this[_0xa6ca('0x19')][_0x1558a6['id']]=new EmailImap(_0x1558a6,_0x52af97[_0x426f96][_0xa6ca('0x6')]);this[_0xa6ca('0x19')][_0x1558a6['id']]['on']('box',this[_0xa6ca('0x1a')][_0xa6ca('0x1b')](this,_0x426f96));this[_0xa6ca('0x19')][_0x1558a6['id']]['on']('email',this[_0xa6ca('0x1c')][_0xa6ca('0x1b')](this,_0x426f96));this[_0xa6ca('0x19')][_0x1558a6['id']]['on']('end',this[_0xa6ca('0x1d')]['bind'](this,_0x426f96));this[_0xa6ca('0x19')][_0x1558a6['id']]['on'](_0xa6ca('0x1e'),this['handleImapError'][_0xa6ca('0x1b')](this,_0x426f96));}}else{if(_[_0xa6ca('0x1f')](this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')])){this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')]={};}this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')][_0xa6ca('0x20')]=_0xa6ca('0x21');this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')]['messageStatus']='';this['emit'](_0x426f96);}}}};EmailChannel['prototype'][_0xa6ca('0x1a')]=function(_0x50c0a3,_0x5932af){if(this['mailAccounts'][_0x50c0a3]){this[_0xa6ca('0x10')][_0x50c0a3]['Imap']['status']=_0xa6ca('0x22');this[_0xa6ca('0x10')][_0x50c0a3][_0xa6ca('0x13')][_0xa6ca('0x14')]=_0x5932af['name'];if(_0x5932af['messages']){this['mailAccounts'][_0x50c0a3][_0xa6ca('0x13')]['total']=_0x5932af[_0xa6ca('0x23')][_0xa6ca('0x24')];}return this[_0xa6ca('0xf')](_0x50c0a3);}};EmailChannel[_0xa6ca('0xe')][_0xa6ca('0x1c')]=function(_0x3e16ef,_0x5eb196){logger['info'](_0xa6ca('0x25'),_0x5eb196[_0xa6ca('0x26')],_0x5eb196[_0xa6ca('0x27')],_0x5eb196[_0xa6ca('0x28')],_0x3e16ef);if(this[_0xa6ca('0x10')][_0x3e16ef]){return mailAccount['notify'](_0x3e16ef,_0x5eb196)[_0xa6ca('0x29')](function(_0x5d5493){if(_0x5d5493){logger[_0xa6ca('0xc')](_0xa6ca('0x2a'));}})['catch'](function(_0x2c8957){logger[_0xa6ca('0x1e')](_0xa6ca('0x2b'),JSON[_0xa6ca('0x15')](_0x2c8957));});}};EmailChannel['prototype'][_0xa6ca('0x1d')]=function(_0x307b9f){if(this['mailAccounts'][_0x307b9f]&&this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')]){if(this[_0xa6ca('0x19')][this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')]['id']]){delete this[_0xa6ca('0x19')][this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')]['id']];}this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')][_0xa6ca('0x2c')]=moment();this[_0xa6ca('0xf')](_0x307b9f);}};EmailChannel['prototype'][_0xa6ca('0x2d')]=function(_0x3271e5,_0x3ebf5c){if(this[_0xa6ca('0x10')][_0x3271e5]){this['mailAccounts'][_0x3271e5][_0xa6ca('0x13')][_0xa6ca('0x20')]=_0xa6ca('0x1e');this[_0xa6ca('0x10')][_0x3271e5][_0xa6ca('0x13')]['messageStatus']=_0x3ebf5c;return this['emit'](_0x3271e5);}};EmailChannel[_0xa6ca('0xe')][_0xa6ca('0x2e')]=function(_0x56a293,_0x373247){return this[_0xa6ca('0xd')][_0xa6ca('0x2f')](_0x56a293,_0x373247);};EmailChannel['prototype']['verifySmtp']=function(_0x459046){var _0x223aef=this;if(this['mailAccounts'][_0x459046['id']]){if(_['isNil'](this['mailAccounts'][_0x459046['id']][_0xa6ca('0x30')])){this['mailAccounts'][_0x459046['id']]['Smtp']={};}this[_0xa6ca('0x10')][_0x459046['id']][_0xa6ca('0x30')][_0xa6ca('0x2c')]=moment();return new BPromise(function(_0x9215ea,_0x525271){return _0x223aef[_0xa6ca('0xd')]['verify'](_0x459046)['then'](function(_0x14013d){_0x223aef['mailAccounts'][_0x459046['id']]['Smtp']['status']=_0xa6ca('0x31');_0x223aef[_0xa6ca('0x10')][_0x459046['id']][_0xa6ca('0x30')]['messageStatus']='';_0x223aef[_0xa6ca('0xf')](_0x459046['id']);_0x9215ea(_0x14013d);})[_0xa6ca('0x32')](function(_0x4b00d3){_0x223aef[_0xa6ca('0x10')][_0x459046['id']][_0xa6ca('0x30')][_0xa6ca('0x20')]='error';_0x223aef[_0xa6ca('0x10')][_0x459046['id']]['Smtp'][_0xa6ca('0x14')]=_0x4b00d3;_0x223aef[_0xa6ca('0xf')](_0x459046['id']);_0x525271(_0x4b00d3);});});}return this[_0xa6ca('0xd')]['verify'](_0x459046);};module['exports']=EmailChannel; \ No newline at end of file +var _0xda40=['New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','ioredis','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','active','Imap','messageStatus','total','isNil','stringify','md5','mailAccount:update','email','handleImapBox','bind','handleImapEmail','end','error','handleImapError','status','disabled','messages','emit','info'];(function(_0x4393d8,_0x149b3b){var _0x675d22=function(_0x2f937f){while(--_0x2f937f){_0x4393d8['push'](_0x4393d8['shift']());}};_0x675d22(++_0x149b3b);}(_0xda40,0xe5));var _0x0da4=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0xda40[_0x2f6233];return _0x1c9c36;};'use strict';var _=require(_0x0da4('0x0'));var moment=require(_0x0da4('0x1'));var BPromise=require(_0x0da4('0x2'));var md5=require('md5');var Redis=require(_0x0da4('0x3'));var config=require('../../../config/environment');var logger=require(_0x0da4('0x4'))('email');config[_0x0da4('0x5')]=_[_0x0da4('0x6')](config[_0x0da4('0x5')],{'host':_0x0da4('0x7'),'port':0x18eb});var io=require(_0x0da4('0x8'))(new Redis(config[_0x0da4('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x0da4('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x26b18a){logger['info'](_0x0da4('0xa'));this['mailAccounts']=_0x26b18a[_0x0da4('0xb')];this[_0x0da4('0xc')]={};this[_0x0da4('0xd')]=new EmailSmtp();}EmailChannel[_0x0da4('0xe')]['emit']=function(_0x5edf73){var _0x74421e=this[_0x0da4('0xb')][_0x5edf73];var _0x289fc7={'id':_0x74421e['id'],'name':_0x74421e[_0x0da4('0xf')],'key':_0x74421e['key'],'active':_0x74421e[_0x0da4('0x10')],'Imap':{'status':_0x74421e[_0x0da4('0x11')]['status'],'messageStatus':_0x74421e[_0x0da4('0x11')][_0x0da4('0x12')],'total':_0x74421e[_0x0da4('0x11')][_0x0da4('0x13')]}};if(_[_0x0da4('0x14')](md5Accounts[_0x5edf73])){md5Accounts[_0x5edf73]={};}var _0x3795f6=md5(JSON[_0x0da4('0x15')](_0x289fc7));if(md5Accounts[_0x5edf73][_0x0da4('0x16')]!==_0x3795f6){md5Accounts[_0x5edf73]['md5']=_0x3795f6;io['emit'](_0x0da4('0x17'),_0x289fc7);}};EmailChannel[_0x0da4('0xe')]['refresh']=function(_0x48277f){for(var _0xd7a6cd in _0x48277f){if(_0x48277f['hasOwnProperty'](_0xd7a6cd)){if(_0x48277f[_0xd7a6cd]['Imap']&&_0x48277f[_0xd7a6cd]['active']){var _0xa1cef8=_0x48277f[_0xd7a6cd][_0x0da4('0x11')];if(!this[_0x0da4('0xc')]['hasOwnProperty'](_0xa1cef8['id'])){this[_0x0da4('0xc')][_0xa1cef8['id']]=new EmailImap(_0xa1cef8,_0x48277f[_0xd7a6cd][_0x0da4('0x18')]);this[_0x0da4('0xc')][_0xa1cef8['id']]['on']('box',this[_0x0da4('0x19')][_0x0da4('0x1a')](this,_0xd7a6cd));this['imapAccounts'][_0xa1cef8['id']]['on'](_0x0da4('0x18'),this[_0x0da4('0x1b')][_0x0da4('0x1a')](this,_0xd7a6cd));this[_0x0da4('0xc')][_0xa1cef8['id']]['on'](_0x0da4('0x1c'),this['handleImapEnd']['bind'](this,_0xd7a6cd));this[_0x0da4('0xc')][_0xa1cef8['id']]['on'](_0x0da4('0x1d'),this[_0x0da4('0x1e')][_0x0da4('0x1a')](this,_0xd7a6cd));}}else{if(_[_0x0da4('0x14')](this['mailAccounts'][_0xd7a6cd][_0x0da4('0x11')])){this[_0x0da4('0xb')][_0xd7a6cd][_0x0da4('0x11')]={};}this['mailAccounts'][_0xd7a6cd]['Imap'][_0x0da4('0x1f')]=_0x0da4('0x20');this[_0x0da4('0xb')][_0xd7a6cd]['Imap']['messageStatus']='';this['emit'](_0xd7a6cd);}}}};EmailChannel[_0x0da4('0xe')]['handleImapBox']=function(_0x24322e,_0x3f0ce0){if(this[_0x0da4('0xb')][_0x24322e]){this[_0x0da4('0xb')][_0x24322e][_0x0da4('0x11')]['status']='connected';this[_0x0da4('0xb')][_0x24322e][_0x0da4('0x11')][_0x0da4('0x12')]=_0x3f0ce0[_0x0da4('0xf')];if(_0x3f0ce0[_0x0da4('0x21')]){this[_0x0da4('0xb')][_0x24322e][_0x0da4('0x11')][_0x0da4('0x13')]=_0x3f0ce0[_0x0da4('0x21')][_0x0da4('0x13')];}return this[_0x0da4('0x22')](_0x24322e);}};EmailChannel[_0x0da4('0xe')][_0x0da4('0x1b')]=function(_0x1f9004,_0x399ba2){logger[_0x0da4('0x23')](_0x0da4('0x24'),_0x399ba2['firstName'],_0x399ba2[_0x0da4('0x25')],_0x399ba2[_0x0da4('0x26')],_0x1f9004);if(this[_0x0da4('0xb')][_0x1f9004]){return mailAccount[_0x0da4('0x27')](_0x1f9004,_0x399ba2)[_0x0da4('0x28')](function(_0x3d0f3d){if(_0x3d0f3d){logger['info'](_0x0da4('0x29'));}})[_0x0da4('0x2a')](function(_0x566193){logger[_0x0da4('0x1d')](_0x0da4('0x2b'),JSON[_0x0da4('0x15')](_0x566193));});}};EmailChannel[_0x0da4('0xe')][_0x0da4('0x2c')]=function(_0xbb90ae){if(this[_0x0da4('0xb')][_0xbb90ae]&&this[_0x0da4('0xb')][_0xbb90ae][_0x0da4('0x11')]){if(this[_0x0da4('0xc')][this[_0x0da4('0xb')][_0xbb90ae][_0x0da4('0x11')]['id']]){delete this[_0x0da4('0xc')][this[_0x0da4('0xb')][_0xbb90ae]['Imap']['id']];}this[_0x0da4('0xb')][_0xbb90ae][_0x0da4('0x11')][_0x0da4('0x2d')]=moment();this[_0x0da4('0x22')](_0xbb90ae);}};EmailChannel[_0x0da4('0xe')][_0x0da4('0x1e')]=function(_0xd9b79a,_0x3620d8){if(this[_0x0da4('0xb')][_0xd9b79a]){this[_0x0da4('0xb')][_0xd9b79a][_0x0da4('0x11')]['status']='error';this['mailAccounts'][_0xd9b79a][_0x0da4('0x11')][_0x0da4('0x12')]=_0x3620d8;return this[_0x0da4('0x22')](_0xd9b79a);}};EmailChannel[_0x0da4('0xe')][_0x0da4('0x2e')]=function(_0x262023,_0x111914){return this[_0x0da4('0xd')][_0x0da4('0x2f')](_0x262023,_0x111914);};EmailChannel['prototype'][_0x0da4('0x30')]=function(_0x5661b5){var _0x5b0f3e=this;if(this[_0x0da4('0xb')][_0x5661b5['id']]){if(_['isNil'](this[_0x0da4('0xb')][_0x5661b5['id']]['Smtp'])){this[_0x0da4('0xb')][_0x5661b5['id']]['Smtp']={};}this[_0x0da4('0xb')][_0x5661b5['id']][_0x0da4('0x31')][_0x0da4('0x2d')]=moment();return new BPromise(function(_0x36a99c,_0x3068f4){return _0x5b0f3e[_0x0da4('0xd')][_0x0da4('0x32')](_0x5661b5)['then'](function(_0x4d267e){_0x5b0f3e[_0x0da4('0xb')][_0x5661b5['id']][_0x0da4('0x31')]['status']=_0x0da4('0x33');_0x5b0f3e[_0x0da4('0xb')][_0x5661b5['id']]['Smtp']['messageStatus']='';_0x5b0f3e[_0x0da4('0x22')](_0x5661b5['id']);_0x36a99c(_0x4d267e);})[_0x0da4('0x2a')](function(_0x277084){_0x5b0f3e[_0x0da4('0xb')][_0x5661b5['id']]['Smtp']['status']=_0x0da4('0x1d');_0x5b0f3e[_0x0da4('0xb')][_0x5661b5['id']]['Smtp'][_0x0da4('0x12')]=_0x277084;_0x5b0f3e[_0x0da4('0x22')](_0x5661b5['id']);_0x3068f4(_0x277084);});});}return this[_0x0da4('0xd')][_0x0da4('0x32')](_0x5661b5);};module[_0x0da4('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 64623cc..99aeea2 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 _0x4c4e=['getHost','anonymous@xcally.com','prototype','handleOpenBox','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','handleFetchError','handleFetchEnd','error','closeBox','handleCloseBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','exports','path','imap','lodash','randomstring','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls'];(function(_0x3df822,_0x299495){var _0x4e457d=function(_0x68a45f){while(--_0x68a45f){_0x3df822['push'](_0x3df822['shift']());}};_0x4e457d(++_0x299495);}(_0x4c4e,0x152));var _0xe4c4=function(_0x49e77f,_0x52024a){_0x49e77f=_0x49e77f-0x0;var _0x22b693=_0x4c4e[_0x49e77f];return _0x22b693;};'use strict';var fs=require('fs');var path=require(_0xe4c4('0x0'));var util=require('util');var Imap=require(_0xe4c4('0x1'));var _=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var simpleParser=require('mailparser')[_0xe4c4('0x4')];var Iconv=require(_0xe4c4('0x5'))[_0xe4c4('0x6')];var EventEmitter=require('events')[_0xe4c4('0x7')];var utils=require('./utils');var logger=require(_0xe4c4('0x8'))(_0xe4c4('0x9'));function EmailImap(_0x262b64,_0xad105){this[_0xe4c4('0xa')]=_0xe4c4('0xb');this[_0xe4c4('0xc')]=this[_0xe4c4('0xd')](_0x262b64,_0xad105);this['imap']=new Imap(this['account']);this[_0xe4c4('0x1')][_0xe4c4('0xe')](_0xe4c4('0xf'),this[_0xe4c4('0x10')][_0xe4c4('0x11')](this));this[_0xe4c4('0x1')]['once'](_0xe4c4('0x12'),this[_0xe4c4('0x13')][_0xe4c4('0x11')](this));this[_0xe4c4('0x1')]['on']('error',this[_0xe4c4('0x14')][_0xe4c4('0x11')](this));this['imap'][_0xe4c4('0x15')]();}util[_0xe4c4('0x16')](EmailImap,EventEmitter);EmailImap['prototype'][_0xe4c4('0xd')]=function(_0x29766a,_0x5e263c){var _0x307aa8={'connTimeout':_0x29766a[_0xe4c4('0x17')]?_0x29766a[_0xe4c4('0x17')]*0x3e8:0x2710,'authTimeout':_0x29766a[_0xe4c4('0x18')]?_0x29766a[_0xe4c4('0x18')]*0x3e8:0x1388};if(_[_0xe4c4('0x19')](_0x29766a[_0xe4c4('0x1a')])){if(_0x29766a[_0xe4c4('0x1b')]){_0x307aa8[_0xe4c4('0x1c')]=_0x29766a[_0xe4c4('0x1c')];_0x307aa8[_0xe4c4('0x1d')]=_0x29766a[_0xe4c4('0x1d')];}_0x307aa8[_0xe4c4('0x1e')]=_0x29766a[_0xe4c4('0x1e')];_0x307aa8[_0xe4c4('0x1f')]=_0x29766a['port']||0x3e1;if(_0x29766a[_0xe4c4('0x20')]){_0x307aa8[_0xe4c4('0x20')]=!![];}else{_0x307aa8[_0xe4c4('0x20')]=![];_0x307aa8[_0xe4c4('0x21')]='required';}}else{_0x307aa8[_0xe4c4('0x1c')]=_0x29766a[_0xe4c4('0x1c')];_0x307aa8[_0xe4c4('0x1d')]=_0x29766a[_0xe4c4('0x1d')];_0x307aa8[_0xe4c4('0x1e')]=utils[_0xe4c4('0x22')](_0x29766a[_0xe4c4('0x1a')]);_0x307aa8[_0xe4c4('0x1f')]=0x3e1;_0x307aa8[_0xe4c4('0x20')]=!![];}_0x307aa8[_0xe4c4('0x9')]=_0x5e263c||_0x29766a[_0xe4c4('0x1c')]||_0xe4c4('0x23');return _0x307aa8;};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x10')]=function(){this[_0xe4c4('0x1')]['openBox'](this['mailbox'],![],this[_0xe4c4('0x25')]['bind'](this));};EmailImap[_0xe4c4('0x24')]['handleOpenBox']=function(_0x3adfcb,_0x5efc4c){if(_0x3adfcb){this[_0xe4c4('0x14')](_0x3adfcb,!![]);}else{this['emit'](_0xe4c4('0x26'),_0x5efc4c);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x5d66ab){if(_0x5d66ab){this[_0xe4c4('0x14')](_0x5d66ab,!![]);}else{this['imap']['end']();}};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x27')]=function(){this['imap']['search']([_0xe4c4('0x28')],this[_0xe4c4('0x29')]['bind'](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x29')]=function(_0x3f60fc,_0x48060e){if(_0x3f60fc){this['handleError'](_0x3f60fc,!![]);}else{if(_0x48060e[_0xe4c4('0x2a')]){try{var _0x2c5652=this[_0xe4c4('0x1')][_0xe4c4('0x2b')](_0x48060e,{'bodies':'','markSeen':!![]});_0x2c5652['on']('message',this['handleFetchMessage'][_0xe4c4('0x11')](this));_0x2c5652[_0xe4c4('0xe')]('error',this[_0xe4c4('0x2c')][_0xe4c4('0x11')](this));_0x2c5652[_0xe4c4('0xe')]('end',this[_0xe4c4('0x2d')]['bind'](this));}catch(_0x45fc76){logger[_0xe4c4('0x2e')](_0x45fc76);}}else{this[_0xe4c4('0x1')][_0xe4c4('0x2f')](!![],this[_0xe4c4('0x30')][_0xe4c4('0x11')](this));}}};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x31')]=function(_0x2213c9,_0x18b2a8){_0x2213c9['on'](_0xe4c4('0x32'),this[_0xe4c4('0x33')]['bind'](this));_0x2213c9[_0xe4c4('0xe')](_0xe4c4('0x34'),this[_0xe4c4('0x35')]['bind'](this));_0x2213c9[_0xe4c4('0xe')](_0xe4c4('0x12'),this[_0xe4c4('0x36')]['bind'](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x33')]=function(_0x4a3644,_0x1de955){simpleParser(_0x4a3644,{'Iconv':Iconv},this[_0xe4c4('0x37')][_0xe4c4('0x11')](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x35')]=function(_0x3d5ecb){};EmailImap[_0xe4c4('0x24')]['handleMessageEnd']=function(){};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x37')]=function(_0x1156d0,_0x3c16a5){if(_0x1156d0){logger['error'](_0x1156d0);}else{var _0x2362d6=this;utils[_0xe4c4('0x38')](this['account'],_0x3c16a5,function(_0xa5534c){_0x2362d6[_0xe4c4('0x39')]('email',_0xa5534c);});}};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x2d')]=function(){this[_0xe4c4('0x1')][_0xe4c4('0x2f')](!![],this[_0xe4c4('0x30')][_0xe4c4('0x11')](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x2c')]=function(_0x1e457c){this[_0xe4c4('0x14')](_0x1e457c);this[_0xe4c4('0x1')][_0xe4c4('0x2f')](!![],this['handleCloseBox'][_0xe4c4('0x11')](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x13')]=function(){this[_0xe4c4('0x39')](_0xe4c4('0x12'));};EmailImap[_0xe4c4('0x24')]['handleError']=function(_0x312a49,_0x526bef){logger[_0xe4c4('0x2e')](_0xe4c4('0x14'),this[_0xe4c4('0xc')][_0xe4c4('0x9')],JSON[_0xe4c4('0x3a')](_0x312a49));var _0x566eb7='';if(_0x312a49){if(_0x312a49['textCode']){_0x566eb7=_0x312a49[_0xe4c4('0x3b')];}else{for(var _0x41bd7a in _0x312a49){if(_0x312a49[_0xe4c4('0x3c')](_0x41bd7a)){_0x566eb7+=_['upperFirst'](_0x41bd7a)+':\x20'+_0x312a49[_0x41bd7a]+'\x0a';}}}}if(_0x526bef){this[_0xe4c4('0x1')][_0xe4c4('0x12')]();}else{this[_0xe4c4('0x39')](_0xe4c4('0x2e'),_0x566eb7);this['emit'](_0xe4c4('0x12'));}};module[_0xe4c4('0x3d')]=EmailImap; \ No newline at end of file +var _0x34e8=['getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','exports','path','util','imap','lodash','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','account'];(function(_0x258e85,_0x4b77e5){var _0x5dc74a=function(_0x213ede){while(--_0x213ede){_0x258e85['push'](_0x258e85['shift']());}};_0x5dc74a(++_0x4b77e5);}(_0x34e8,0x12c));var _0x834e=function(_0x1eb7ee,_0x541eeb){_0x1eb7ee=_0x1eb7ee-0x0;var _0x18ef70=_0x34e8[_0x1eb7ee];return _0x18ef70;};'use strict';var fs=require('fs');var path=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var Imap=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));var rs=require('randomstring');var simpleParser=require(_0x834e('0x4'))[_0x834e('0x5')];var Iconv=require(_0x834e('0x6'))[_0x834e('0x7')];var EventEmitter=require(_0x834e('0x8'))[_0x834e('0x9')];var utils=require(_0x834e('0xa'));var logger=require('../../../config/logger')(_0x834e('0xb'));function EmailImap(_0x52056d,_0x3e16d2){this[_0x834e('0xc')]=_0x834e('0xd');this[_0x834e('0xe')]=this[_0x834e('0xf')](_0x52056d,_0x3e16d2);this[_0x834e('0x2')]=new Imap(this[_0x834e('0xe')]);this[_0x834e('0x2')][_0x834e('0x10')](_0x834e('0x11'),this[_0x834e('0x12')][_0x834e('0x13')](this));this[_0x834e('0x2')][_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x15')][_0x834e('0x13')](this));this['imap']['on'](_0x834e('0x16'),this[_0x834e('0x17')]['bind'](this));this[_0x834e('0x2')][_0x834e('0x18')]();}util[_0x834e('0x19')](EmailImap,EventEmitter);EmailImap[_0x834e('0x1a')]['getAccount']=function(_0x43156c,_0x302cbd){var _0x57274a={'connTimeout':_0x43156c[_0x834e('0x1b')]?_0x43156c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x43156c[_0x834e('0x1c')]?_0x43156c[_0x834e('0x1c')]*0x3e8:0x1388};if(_['isNil'](_0x43156c[_0x834e('0x1d')])){if(_0x43156c[_0x834e('0x1e')]){_0x57274a[_0x834e('0x1f')]=_0x43156c['user'];_0x57274a[_0x834e('0x20')]=_0x43156c[_0x834e('0x20')];}_0x57274a[_0x834e('0x21')]=_0x43156c[_0x834e('0x21')];_0x57274a[_0x834e('0x22')]=_0x43156c[_0x834e('0x22')]||0x3e1;if(_0x43156c[_0x834e('0x23')]){_0x57274a['tls']=!![];}else{_0x57274a[_0x834e('0x23')]=![];_0x57274a[_0x834e('0x24')]=_0x834e('0x25');}}else{_0x57274a[_0x834e('0x1f')]=_0x43156c['user'];_0x57274a[_0x834e('0x20')]=_0x43156c[_0x834e('0x20')];_0x57274a['host']=utils[_0x834e('0x26')](_0x43156c[_0x834e('0x1d')]);_0x57274a[_0x834e('0x22')]=0x3e1;_0x57274a['tls']=!![];}_0x57274a['email']=_0x302cbd||_0x43156c[_0x834e('0x1f')]||_0x834e('0x27');return _0x57274a;};EmailImap['prototype'][_0x834e('0x12')]=function(){this[_0x834e('0x2')]['openBox'](this[_0x834e('0xc')],![],this[_0x834e('0x28')][_0x834e('0x13')](this));};EmailImap['prototype'][_0x834e('0x28')]=function(_0x3e310f,_0x5e1cc5){if(_0x3e310f){this['handleError'](_0x3e310f,!![]);}else{this[_0x834e('0x29')]('box',_0x5e1cc5);this[_0x834e('0x2a')]();}};EmailImap[_0x834e('0x1a')][_0x834e('0x2b')]=function(_0x2cc2eb){if(_0x2cc2eb){this[_0x834e('0x17')](_0x2cc2eb,!![]);}else{this[_0x834e('0x2')]['end']();}};EmailImap['prototype']['readUnseen']=function(){this['imap'][_0x834e('0x2c')]([_0x834e('0x2d')],this[_0x834e('0x2e')]['bind'](this));};EmailImap[_0x834e('0x1a')][_0x834e('0x2e')]=function(_0x1f3671,_0x1e026a){if(_0x1f3671){this[_0x834e('0x17')](_0x1f3671,!![]);}else{if(_0x1e026a[_0x834e('0x2f')]){try{var _0x3d149d=this[_0x834e('0x2')][_0x834e('0x30')](_0x1e026a,{'bodies':'','markSeen':!![]});_0x3d149d['on']('message',this[_0x834e('0x31')]['bind'](this));_0x3d149d[_0x834e('0x10')](_0x834e('0x16'),this[_0x834e('0x32')][_0x834e('0x13')](this));_0x3d149d[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x33')][_0x834e('0x13')](this));}catch(_0x358c31){logger[_0x834e('0x16')](_0x358c31);}}else{this['imap'][_0x834e('0x34')](!![],this[_0x834e('0x2b')][_0x834e('0x13')](this));}}};EmailImap[_0x834e('0x1a')]['handleFetchMessage']=function(_0x3f88ad,_0x379d60){_0x3f88ad['on']('body',this['handleMessageBody']['bind'](this));_0x3f88ad[_0x834e('0x10')](_0x834e('0x35'),this[_0x834e('0x36')][_0x834e('0x13')](this));_0x3f88ad[_0x834e('0x10')](_0x834e('0x14'),this['handleMessageEnd'][_0x834e('0x13')](this));};EmailImap['prototype'][_0x834e('0x37')]=function(_0x6a3ac,_0x47abed){simpleParser(_0x6a3ac,{'Iconv':Iconv},this[_0x834e('0x38')][_0x834e('0x13')](this));};EmailImap['prototype']['handleMessageAttributes']=function(_0x388711){};EmailImap[_0x834e('0x1a')][_0x834e('0x39')]=function(){};EmailImap[_0x834e('0x1a')][_0x834e('0x38')]=function(_0x4ca43c,_0x1c5ed6){if(_0x4ca43c){logger['error'](_0x4ca43c);}else{var _0x50c243=this;utils[_0x834e('0x3a')](this['account'],_0x1c5ed6,function(_0x2e5239){_0x50c243[_0x834e('0x29')](_0x834e('0xb'),_0x2e5239);});}};EmailImap[_0x834e('0x1a')][_0x834e('0x33')]=function(){this['imap'][_0x834e('0x34')](!![],this[_0x834e('0x2b')][_0x834e('0x13')](this));};EmailImap['prototype'][_0x834e('0x32')]=function(_0x16ac45){this['handleError'](_0x16ac45);this[_0x834e('0x2')]['closeBox'](!![],this[_0x834e('0x2b')][_0x834e('0x13')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x834e('0x29')](_0x834e('0x14'));};EmailImap[_0x834e('0x1a')][_0x834e('0x17')]=function(_0x8ad264,_0x23feea){logger[_0x834e('0x16')]('handleError',this[_0x834e('0xe')]['email'],JSON[_0x834e('0x3b')](_0x8ad264));var _0x540685='';if(_0x8ad264){if(_0x8ad264[_0x834e('0x3c')]){_0x540685=_0x8ad264['textCode'];}else{for(var _0x361f60 in _0x8ad264){if(_0x8ad264[_0x834e('0x3d')](_0x361f60)){_0x540685+=_['upperFirst'](_0x361f60)+':\x20'+_0x8ad264[_0x361f60]+'\x0a';}}}}if(_0x23feea){this[_0x834e('0x2')][_0x834e('0x14')]();}else{this[_0x834e('0x29')](_0x834e('0x16'),_0x540685);this[_0x834e('0x29')](_0x834e('0x14'));}};module[_0x834e('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6ef831c..fc4bbe6 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 _0x94a0=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x553837,_0x161714){var _0x124212=function(_0x41bfde){while(--_0x41bfde){_0x553837['push'](_0x553837['shift']());}};_0x124212(++_0x161714);}(_0x94a0,0x85));var _0x094a=function(_0x1ae06f,_0x5b7a6c){_0x1ae06f=_0x1ae06f-0x0;var _0x429688=_0x94a0[_0x1ae06f];return _0x429688;};'use strict';var nodemailer=require(_0x094a('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x094a('0x1'));function EmailSmtp(){}EmailSmtp[_0x094a('0x2')]['send']=function(_0x52a7d8,_0x486484){return new BPromise(function(_0x5c631d,_0x13bfae){var _0x478435=nodemailer[_0x094a('0x3')](_0x52a7d8);_0x478435[_0x094a('0x4')](_0x094a('0x5'),inlineBase64());_0x478435[_0x094a('0x6')](_0x486484,function(_0x1a9464,_0x1a4a4b){if(_0x1a9464){_0x13bfae(_0x1a9464[_0x094a('0x7')]());}else{_0x5c631d(_0x1a4a4b);}});});};EmailSmtp['prototype'][_0x094a('0x8')]=function(_0xab6411){return new BPromise(function(_0x56c9f5,_0x5300eb){var _0x4db481=nodemailer['createTransport'](_0xab6411);_0x4db481['verify'](function(_0x419f51,_0x31efc7){if(_0x419f51){_0x5300eb(_0x419f51['toString']());}else{if(_0x31efc7){_0x56c9f5(_0x31efc7);}else{_0x5300eb(_0x094a('0x9'));}}});});};module[_0x094a('0xa')]=EmailSmtp; \ No newline at end of file +var _0xb3b7=['use','compile','sendMail','toString','prototype','verify','createTransport','Not\x20verifired','bluebird','nodemailer-plugin-inline-base64'];(function(_0x4671e6,_0x5f01e6){var _0x15cb56=function(_0x473e1b){while(--_0x473e1b){_0x4671e6['push'](_0x4671e6['shift']());}};_0x15cb56(++_0x5f01e6);}(_0xb3b7,0x6c));var _0x7b3b=function(_0x48b355,_0x507070){_0x48b355=_0x48b355-0x0;var _0x5811b9=_0xb3b7[_0x48b355];return _0x5811b9;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x7b3b('0x0'));var inlineBase64=require(_0x7b3b('0x1'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x459f29,_0x1d7a23){return new BPromise(function(_0x2f6a9b,_0x1926a0){var _0x46bc3c=nodemailer['createTransport'](_0x459f29);_0x46bc3c[_0x7b3b('0x2')](_0x7b3b('0x3'),inlineBase64());_0x46bc3c[_0x7b3b('0x4')](_0x1d7a23,function(_0x2b35dc,_0x3f5568){if(_0x2b35dc){_0x1926a0(_0x2b35dc[_0x7b3b('0x5')]());}else{_0x2f6a9b(_0x3f5568);}});});};EmailSmtp[_0x7b3b('0x6')][_0x7b3b('0x7')]=function(_0x40e886){return new BPromise(function(_0x11e21a,_0x31d474){var _0x3e077f=nodemailer[_0x7b3b('0x8')](_0x40e886);_0x3e077f['verify'](function(_0x482c72,_0xc89e70){if(_0x482c72){_0x31d474(_0x482c72[_0x7b3b('0x5')]());}else{if(_0xc89e70){_0x11e21a(_0xc89e70);}else{_0x31d474(_0x7b3b('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 30adc6c..9f06e25 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 _0x896e=['split','slice','join','name','length','pop','isEmpty','html','test','replace','includes','push','filename','_SRC','_IMG','\x20[Attachment:\x20','body','textAsHtml','message','originTo','originCc','bcc','attachments','attach','type','attachment-','%s-%s','root','server/files/attachments/','writeFileSync','contentType','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value'];(function(_0x25d542,_0x462ad9){var _0x377a7e=function(_0x5bd8ee){while(--_0x5bd8ee){_0x25d542['push'](_0x25d542['shift']());}};_0x377a7e(++_0x462ad9);}(_0x896e,0x1e9));var _0xe896=function(_0x551888,_0x258872){_0x551888=_0x551888-0x0;var _0x253d4f=_0x896e[_0x551888];return _0x253d4f;};'use strict';var _=require(_0xe896('0x0'));var moment=require(_0xe896('0x1'));var random=require(_0xe896('0x2'));var fs=require('fs');var path=require(_0xe896('0x3'));var util=require(_0xe896('0x4'));var tnef=require(_0xe896('0x5'));var logger=require(_0xe896('0x6'))(_0xe896('0x7'));var config=require(_0xe896('0x8'));function getAddress(_0x2d3521){var _0x244f68=_[_0xe896('0x9')](_0x2d3521['value']);return _0x244f68&&_0x244f68[_0xe896('0xa')]?_0x244f68[_0xe896('0xa')]:_0xe896('0xb')+random[_0xe896('0xc')](0x6)+_0xe896('0xd');}function getFirstName(_0x5a1909){var _0x274062=_[_0xe896('0x9')](_0x5a1909[_0xe896('0xe')]);if(_0x274062&&_0x274062['name']){var _0x305616=_0x274062['name'][_0xe896('0xf')](/\s+/);return _0x305616['length']?_0x305616[_0xe896('0x10')](0x0,-0x1)[_0xe896('0x11')]('\x20'):_0x274062[_0xe896('0x12')];}return'Anonymous';}function getLastName(_0x3c531e){var _0x4452cd=_[_0xe896('0x9')](_0x3c531e['value']);if(_0x4452cd&&_0x4452cd[_0xe896('0x12')]){var _0x2f1c3e=_0x4452cd[_0xe896('0x12')]['split'](/\s+/);return _0x2f1c3e[_0xe896('0x13')]>0x1?_0x2f1c3e[_0xe896('0x14')]():'';}return'';}function getMails(_0x1e7ef8,_0x564758){var _0x5a7957='';for(var _0x446ce2=0x0;_0x446ce2<_0x564758[_0xe896('0xe')]['length'];_0x446ce2+=0x1){if(_0x564758['value'][_0x446ce2][_0xe896('0xa')]!==_0x1e7ef8){if(!_[_0xe896('0x15')](_0x5a7957)){_0x5a7957+=',';}_0x5a7957+=_0x564758['value'][_0x446ce2][_0xe896('0x12')]||_0x564758['value'][_0x446ce2][_0xe896('0xa')]||'';_0x5a7957+='\x20<';_0x5a7957+=_0x564758[_0xe896('0xe')][_0x446ce2][_0xe896('0xa')]?_0x564758['value'][_0x446ce2][_0xe896('0xa')]:_0xe896('0xb')+random[_0xe896('0xc')](0x6)+_0xe896('0xd');_0x5a7957+='>';}}return _0x5a7957;}function parseEmail(_0x2693d6,_0x3ac8b8,_0x388c2e){if(_0x3ac8b8[_0xe896('0x16')]){var _0x49547b=/)<[^<]*)*<\/script>/gi;while(_0x49547b[_0xe896('0x17')](_0x3ac8b8['html'])){_0x3ac8b8['html']=_0x3ac8b8[_0xe896('0x16')][_0xe896('0x18')](_0x49547b,'');}if(_0x3ac8b8[_0xe896('0x16')][_0xe896('0x19')]('{_0x468479[_0xe896('0x1a')](_0x45dd49[_0xe896('0x1b')]);});var _0x2e2c10=/]+>/g;var _0x20e295=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x4d9f03=_0x3ac8b8[_0xe896('0x16')]['replace'](_0x20e295,_0xe896('0x1c'));var _0x163a75=_0x4d9f03[_0xe896('0x18')](_0x2e2c10,'_IMG');for(let _0x26635e=0x0;_0x26635e<_0x468479[_0xe896('0x13')];_0x26635e++){var _0x2bc11d=_0x163a75[_0xe896('0x18')](_0xe896('0x1d'),_0xe896('0x1e')+_0x468479[_0x26635e]+'\x20]');_0x163a75=_0x2bc11d;}_0x3ac8b8[_0xe896('0x16')]=_0x163a75;}_0x388c2e[_0xe896('0x1f')]=_0x3ac8b8[_0xe896('0x16')];}else{_0x388c2e[_0xe896('0x1f')]=_0x3ac8b8[_0xe896('0x20')];}if(_0x388c2e['body']){_0x388c2e['body']=_0x388c2e['body']['replace'](/Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','@xcally.com','head','name','split','slice','join','Anonymous','pop','isEmpty','generate','test','html','includes','\x20[Attachment:\x20','body','0x1?_0x11c730[_0x6791('0x11')]():'';}return'';}function getMails(_0x5122f9,_0x2a9151){var _0x4c32a1='';for(var _0x3be9f0=0x0;_0x3be9f0<_0x2a9151[_0x6791('0x7')]['length'];_0x3be9f0+=0x1){if(_0x2a9151[_0x6791('0x7')][_0x3be9f0]['address']!==_0x5122f9){if(!_[_0x6791('0x12')](_0x4c32a1)){_0x4c32a1+=',';}_0x4c32a1+=_0x2a9151[_0x6791('0x7')][_0x3be9f0]['name']||_0x2a9151[_0x6791('0x7')][_0x3be9f0][_0x6791('0x8')]||'';_0x4c32a1+='\x20<';_0x4c32a1+=_0x2a9151['value'][_0x3be9f0][_0x6791('0x8')]?_0x2a9151['value'][_0x3be9f0][_0x6791('0x8')]:_0x6791('0x9')+random[_0x6791('0x13')](0x6)+_0x6791('0xa');_0x4c32a1+='>';}}return _0x4c32a1;}function parseEmail(_0x25adbc,_0x2bc0ab,_0x2ba11a){if(_0x2bc0ab['html']){var _0x4a2922=/)<[^<]*)*<\/script>/gi;while(_0x4a2922[_0x6791('0x14')](_0x2bc0ab['html'])){_0x2bc0ab[_0x6791('0x15')]=_0x2bc0ab[_0x6791('0x15')]['replace'](_0x4a2922,'');}if(_0x2bc0ab[_0x6791('0x15')][_0x6791('0x16')](_0x6791('0x17'))){var _0x12d83b=[];_0x2bc0ab['attachments'][_0x6791('0x18')](_0x1b516d=>{_0x12d83b['push'](_0x1b516d['filename']);});var _0x4b23bc=/]+>/g;var _0x372dae=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x502043=_0x2bc0ab[_0x6791('0x15')]['replace'](_0x372dae,'_SRC');var _0x496273=_0x502043[_0x6791('0x19')](_0x4b23bc,_0x6791('0x1a'));for(let _0xd49b84=0x0;_0xd49b84<_0x12d83b['length'];_0xd49b84++){var _0x3def2e=_0x496273[_0x6791('0x19')]('_IMG',_0x6791('0x1b')+_0x12d83b[_0xd49b84]+'\x20]');_0x496273=_0x3def2e;}_0x2bc0ab[_0x6791('0x15')]=_0x496273;}_0x2ba11a['body']=_0x2bc0ab['html'];}else{_0x2ba11a[_0x6791('0x1c')]=_0x2bc0ab['textAsHtml'];}if(_0x2ba11a[_0x6791('0x1c')]){_0x2ba11a[_0x6791('0x1c')]=_0x2ba11a['body'][_0x6791('0x19')](/0x0){if(this[_0x3363ad+_0xe348('0x25')]>0x0&&this[_0x3363ad+_0xe348('0x24')]>=this[_0x3363ad+_0xe348('0x25')]){return _0xe348('0x26');}else{return'working';}}else{return _0xe348('0x27');}};Agent[_0xe348('0x28')][_0xe348('0x22')]=function(){var _0x196b3c=['mail','chat',_0xe348('0x29'),_0xe348('0x2a'),_0xe348('0x2b'),_0xe348('0x2c')];for(var _0x53bdb1=0x0;_0x53bdb1<_0x196b3c[_0xe348('0x2d')];_0x53bdb1+=0x1){var _0x31045e=this[_0xe348('0x23')](_0x196b3c[_0x53bdb1]);if(this[_0x196b3c[_0x53bdb1]+_0xe348('0x2e')]!==_0x31045e){this[_0x196b3c[_0x53bdb1]+_0xe348('0x2f')]=_[_0xe348('0x30')](moment()[_0xe348('0x31')]('x'));}this[_0x196b3c[_0x53bdb1]+_0xe348('0x2e')]=_0x31045e;}var _0x3f17c7={'id':this['id'],'name':this[_0xe348('0x5')],'online':this['online'],'voicePause':this[_0xe348('0x7')],'chatPause':this[_0xe348('0x8')],'mailPause':this[_0xe348('0x9')],'smsPause':this[_0xe348('0xb')],'faxPause':this[_0xe348('0xa')],'openchannelPause':this[_0xe348('0xc')],'chatStatus':this[_0xe348('0x32')],'chatStatusTime':this[_0xe348('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xe348('0x10')],'mailStatus':this[_0xe348('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xe348('0x33')],'faxStatus':this[_0xe348('0x14')],'faxStatusTime':this[_0xe348('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xe348('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xe348('0x19')],'smsCapacity':this[_0xe348('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xe348('0x1b')],'whatsappStatusTime':this[_0xe348('0x34')],'whatsappCapacity':this[_0xe348('0x1c')],'whatsappCurrentCapacity':this[_0xe348('0x35')],'openchannelStatus':this[_0xe348('0x1d')],'openchannelStatusTime':this[_0xe348('0x36')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xe348('0x37')],'busy':this[_0xe348('0x1f')],'busyQueue':this[_0xe348('0x20')]};var _0x20bc96=md5(JSON[_0xe348('0x38')](_0x3f17c7));if(this[_0xe348('0x21')]!==_0x20bc96){this[_0xe348('0x21')]=_0x20bc96;io[_0xe348('0x39')]('user:save',_0x3f17c7);}};module[_0xe348('0x3a')]=Agent; \ No newline at end of file +var _0x4d9b=['whatsappStatus','emit','user:save','exports','ioredis','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','sms','whatsapp','Status','StatusTime','toNumber','format','chatStatus','chatCurrentCapacity','mailStatusTime','faxStatusTime'];(function(_0x19aa32,_0x33381b){var _0x104dd6=function(_0xd172cd){while(--_0xd172cd){_0x19aa32['push'](_0x19aa32['shift']());}};_0x104dd6(++_0x33381b);}(_0x4d9b,0x15a));var _0xb4d9=function(_0x55193b,_0x204da0){_0x55193b=_0x55193b-0x0;var _0x295171=_0x4d9b[_0x55193b];return _0x295171;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require(_0xb4d9('0x0'));var config=require('../../../config/environment');config[_0xb4d9('0x1')]=_['defaults'](config['redis'],{'host':_0xb4d9('0x2'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb4d9('0x1')]));function Agent(_0x313088){this['id']=_0x313088['id']||0x0;this['name']=_0x313088[_0xb4d9('0x3')]||'';this[_0xb4d9('0x4')]=_0x313088[_0xb4d9('0x4')]||!![];this[_0xb4d9('0x5')]=_0x313088['voicePause']||![];this[_0xb4d9('0x6')]=_0x313088[_0xb4d9('0x6')]||![];this[_0xb4d9('0x7')]=_0x313088[_0xb4d9('0x7')]||![];this[_0xb4d9('0x8')]=_0x313088[_0xb4d9('0x8')]||![];this[_0xb4d9('0x9')]=_0x313088[_0xb4d9('0x9')]||![];this[_0xb4d9('0xa')]=_0x313088[_0xb4d9('0xa')]||![];this['chatStatus']=_0xb4d9('0xb');this[_0xb4d9('0xc')]=0x0;this['chatCapacity']=_0x313088[_0xb4d9('0xd')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xb4d9('0xe')]=_0xb4d9('0xb');this['mailStatusTime']=0x0;this[_0xb4d9('0xf')]=_0x313088[_0xb4d9('0xf')]||0x0;this[_0xb4d9('0x10')]=0x0;this['faxStatus']=_0xb4d9('0xb');this['faxStatusTime']=0x0;this['faxCapacity']=_0x313088[_0xb4d9('0x11')]||0x0;this[_0xb4d9('0x12')]=0x0;this[_0xb4d9('0x13')]='unknown';this[_0xb4d9('0x14')]=0x0;this[_0xb4d9('0x15')]=_0x313088[_0xb4d9('0x15')]||0x0;this[_0xb4d9('0x16')]=0x0;this['whatsappStatus']=_0xb4d9('0xb');this['whatsappStatusTime']=0x0;this[_0xb4d9('0x17')]=_0x313088[_0xb4d9('0x17')]||0x0;this[_0xb4d9('0x18')]=0x0;this[_0xb4d9('0x19')]='unknown';this[_0xb4d9('0x1a')]=0x0;this[_0xb4d9('0x1b')]=_0x313088[_0xb4d9('0x1b')]||0x0;this[_0xb4d9('0x1c')]=0x0;this[_0xb4d9('0x1d')]=![];this[_0xb4d9('0x1e')]=undefined;this[_0xb4d9('0x1f')]='';this[_0xb4d9('0x20')]();}Agent[_0xb4d9('0x21')][_0xb4d9('0x22')]=function(_0x477342){if(this[_0x477342+_0xb4d9('0x23')]>0x0){if(this[_0x477342+'Capacity']>0x0&&this[_0x477342+_0xb4d9('0x23')]>=this[_0x477342+_0xb4d9('0x24')]){return _0xb4d9('0x25');}else{return _0xb4d9('0x26');}}else{return _0xb4d9('0x27');}};Agent[_0xb4d9('0x21')][_0xb4d9('0x20')]=function(){var _0x40c9ca=[_0xb4d9('0x28'),_0xb4d9('0x29'),_0xb4d9('0x2a'),'fax',_0xb4d9('0x2b'),_0xb4d9('0x2c')];for(var _0x57a6ad=0x0;_0x57a6ad<_0x40c9ca['length'];_0x57a6ad+=0x1){var _0x4f4216=this['getChannelStatus'](_0x40c9ca[_0x57a6ad]);if(this[_0x40c9ca[_0x57a6ad]+_0xb4d9('0x2d')]!==_0x4f4216){this[_0x40c9ca[_0x57a6ad]+_0xb4d9('0x2e')]=_[_0xb4d9('0x2f')](moment()[_0xb4d9('0x30')]('x'));}this[_0x40c9ca[_0x57a6ad]+'Status']=_0x4f4216;}var _0x9137a8={'id':this['id'],'name':this['name'],'online':this[_0xb4d9('0x4')],'voicePause':this['voicePause'],'chatPause':this[_0xb4d9('0x6')],'mailPause':this['mailPause'],'smsPause':this[_0xb4d9('0x9')],'faxPause':this[_0xb4d9('0x8')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xb4d9('0x31')],'chatStatusTime':this[_0xb4d9('0xc')],'chatCapacity':this[_0xb4d9('0xd')],'chatCurrentCapacity':this[_0xb4d9('0x32')],'mailStatus':this[_0xb4d9('0xe')],'mailStatusTime':this[_0xb4d9('0x33')],'mailCapacity':this[_0xb4d9('0xf')],'mailCurrentCapacity':this[_0xb4d9('0x10')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xb4d9('0x34')],'faxCapacity':this[_0xb4d9('0x11')],'faxCurrentCapacity':this[_0xb4d9('0x12')],'smsStatus':this[_0xb4d9('0x13')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xb4d9('0x15')],'smsCurrentCapacity':this[_0xb4d9('0x16')],'whatsappStatus':this[_0xb4d9('0x35')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xb4d9('0x17')],'whatsappCurrentCapacity':this[_0xb4d9('0x18')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xb4d9('0x1a')],'openchannelCapacity':this[_0xb4d9('0x1b')],'openchannelCurrentCapacity':this[_0xb4d9('0x1c')],'busy':this['busy'],'busyQueue':this[_0xb4d9('0x1e')]};var _0x4bba54=md5(JSON['stringify'](_0x9137a8));if(this[_0xb4d9('0x1f')]!==_0x4bba54){this['md5']=_0x4bba54;io[_0xb4d9('0x36')](_0xb4d9('0x37'),_0x9137a8);}};module[_0xb4d9('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e3b14c5..2df2977 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 _0x5302=['lodash','md5','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','length','online','loggedIn','chatPause','paused','available','stringify','format','chat:queue:%s'];(function(_0x45cd48,_0x5821bd){var _0x5aae54=function(_0x437067){while(--_0x437067){_0x45cd48['push'](_0x45cd48['shift']());}};_0x5aae54(++_0x5821bd);}(_0x5302,0xe1));var _0x2530=function(_0x1e5a0c,_0x3a16fc){_0x1e5a0c=_0x1e5a0c-0x0;var _0x5cc15b=_0x5302[_0x1e5a0c];return _0x5cc15b;};'use strict';var _=require(_0x2530('0x0'));var md5=require(_0x2530('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x2530('0x2')](config[_0x2530('0x3')],{'host':_0x2530('0x4'),'port':0x18eb});var io=require(_0x2530('0x5'))(new Redis(config[_0x2530('0x3')]));function ChatQueue(_0x295d2a){this['id']=_0x295d2a['id']||0x0;this[_0x2530('0x6')]=_0x295d2a[_0x2530('0x6')]||'';this['timeout']=_0x295d2a[_0x2530('0x7')]||0xa;this[_0x2530('0x8')]=_0x295d2a['strategy']||_0x2530('0x9');this['Agents']=_0x295d2a[_0x2530('0xa')];this[_0x2530('0xb')]={};this[_0x2530('0xc')]=0x0;this[_0x2530('0x1')]='';this[_0x2530('0xd')]();this['updateRealtime']();}ChatQueue[_0x2530('0xe')][_0x2530('0xd')]=function(){var _0x3d423d=this[_0x2530('0xb')]['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x2530('0xb')][_0x2530('0xf')]=_0x3d423d;};ChatQueue[_0x2530('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x423dc1=0x0;_0x423dc1=0x0?this[_0x2530('0x15')]:0x0;var _0x4d17e5={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2530('0x12')],'name':this[_0x2530('0x6')],'paused':this[_0x2530('0x14')],'waiting':this[_0x2530('0xc')]};var _0xa2d0dd=md5(JSON[_0x2530('0x16')](_0x4d17e5));if(this[_0x2530('0x1')]!==_0xa2d0dd){this[_0x2530('0x1')]=_0xa2d0dd;io['to'](util[_0x2530('0x17')](_0x2530('0x18'),_0x4d17e5[_0x2530('0x6')]))['emit']('chat_queue:save',_0x4d17e5);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x82de=['emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','chatPause','available','stringify','format'];(function(_0x342195,_0x52b268){var _0x35d14e=function(_0x3f416f){while(--_0x3f416f){_0x342195['push'](_0x342195['shift']());}};_0x35d14e(++_0x52b268);}(_0x82de,0x1e3));var _0xe82d=function(_0x507a18,_0x1323ee){_0x507a18=_0x507a18-0x0;var _0x1e9de4=_0x82de[_0x507a18];return _0x1e9de4;};'use strict';var _=require(_0xe82d('0x0'));var md5=require(_0xe82d('0x1'));var util=require(_0xe82d('0x2'));var Redis=require(_0xe82d('0x3'));var config=require(_0xe82d('0x4'));config[_0xe82d('0x5')]=_[_0xe82d('0x6')](config[_0xe82d('0x5')],{'host':_0xe82d('0x7'),'port':0x18eb});var io=require(_0xe82d('0x8'))(new Redis(config[_0xe82d('0x5')]));function ChatQueue(_0x58c8a2){this['id']=_0x58c8a2['id']||0x0;this[_0xe82d('0x9')]=_0x58c8a2['name']||'';this[_0xe82d('0xa')]=_0x58c8a2[_0xe82d('0xa')]||0xa;this[_0xe82d('0xb')]=_0x58c8a2[_0xe82d('0xb')]||_0xe82d('0xc');this[_0xe82d('0xd')]=_0x58c8a2[_0xe82d('0xd')];this[_0xe82d('0xe')]={};this['waiting']=0x0;this[_0xe82d('0x1')]='';this[_0xe82d('0xf')]();this[_0xe82d('0x10')]();}ChatQueue[_0xe82d('0x11')]['updateRouting']=function(){var _0x54ba22=this[_0xe82d('0xe')]['_rr'];this['mapAgentsId']=_['map'](this[_0xe82d('0xd')],'id');this[_0xe82d('0xe')][_0xe82d('0x12')]=_0x54ba22;};ChatQueue[_0xe82d('0x11')][_0xe82d('0x10')]=function(){this[_0xe82d('0x13')]=0x0;this[_0xe82d('0x14')]=0x0;for(var _0x12522b=0x0;_0x12522b=0x0?this['available']:0x0;var _0x22b0f0={'id':this['id'],'available':this[_0xe82d('0x18')],'loggedIn':this[_0xe82d('0x13')],'name':this['name'],'paused':this[_0xe82d('0x14')],'waiting':this['waiting']};var _0x2e38bc=md5(JSON[_0xe82d('0x19')](_0x22b0f0));if(this[_0xe82d('0x1')]!==_0x2e38bc){this['md5']=_0x2e38bc;io['to'](util[_0xe82d('0x1a')]('chat:queue:%s',_0x22b0f0['name']))[_0xe82d('0x1b')](_0xe82d('0x1c'),_0x22b0f0);}};module[_0xe82d('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 436b03a..c2f6567 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 _0x7282=['available','stringify','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','Agents','online','loggedIn'];(function(_0x452630,_0x1c0fc4){var _0x31ebec=function(_0x18cb48){while(--_0x18cb48){_0x452630['push'](_0x452630['shift']());}};_0x31ebec(++_0x1c0fc4);}(_0x7282,0x19a));var _0x2728=function(_0x3db2e8,_0x49c09b){_0x3db2e8=_0x3db2e8-0x0;var _0xf05958=_0x7282[_0x3db2e8];return _0xf05958;};'use strict';var _=require(_0x2728('0x0'));var md5=require(_0x2728('0x1'));var util=require(_0x2728('0x2'));var Redis=require(_0x2728('0x3'));var config=require(_0x2728('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x2728('0x5'),'port':0x18eb});var io=require(_0x2728('0x6'))(new Redis(config['redis']));function FaxQueue(_0x4e9219){this['id']=_0x4e9219['id']||0x0;this[_0x2728('0x7')]=_0x4e9219[_0x2728('0x7')]||'';this[_0x2728('0x8')]=_0x4e9219[_0x2728('0x8')]||0xa;this[_0x2728('0x9')]=_0x4e9219[_0x2728('0x9')]||_0x2728('0xa');this['Agents']=_0x4e9219['Agents'];this[_0x2728('0xb')]={};this[_0x2728('0xc')]=0x0;this[_0x2728('0x1')]='';this['updateRouting']();this[_0x2728('0xd')]();}FaxQueue[_0x2728('0xe')][_0x2728('0xf')]=function(){var _0x15e9de=this[_0x2728('0xb')][_0x2728('0x10')];this[_0x2728('0xb')]=_[_0x2728('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x2728('0x10')]=_0x15e9de;};FaxQueue[_0x2728('0xe')][_0x2728('0xd')]=function(){this['loggedIn']=0x0;this[_0x2728('0x12')]=0x0;for(var _0x1b9826=0x0;_0x1b9826=0x0?this['available']:0x0;var _0x2adfc1={'id':this['id'],'available':this[_0x2728('0x16')],'loggedIn':this[_0x2728('0x15')],'name':this[_0x2728('0x7')],'paused':this[_0x2728('0x12')],'waiting':this['waiting']};var _0x2909ec=md5(JSON[_0x2728('0x17')](_0x2adfc1));if(this['md5']!==_0x2909ec){this[_0x2728('0x1')]=_0x2909ec;io['to'](util['format']('fax:queue:%s',_0x2adfc1[_0x2728('0x7')]))[_0x2728('0x18')](_0x2728('0x19'),_0x2adfc1);}};module[_0x2728('0x1a')]=FaxQueue; \ No newline at end of file +var _0x601e=['stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','faxPause','available','waiting'];(function(_0x499ca5,_0x4986cf){var _0x7bfd9c=function(_0x36fe88){while(--_0x36fe88){_0x499ca5['push'](_0x499ca5['shift']());}};_0x7bfd9c(++_0x4986cf);}(_0x601e,0x17a));var _0xe601=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0x601e[_0x581960];return _0x4ee892;};'use strict';var _=require(_0xe601('0x0'));var md5=require(_0xe601('0x1'));var util=require(_0xe601('0x2'));var Redis=require(_0xe601('0x3'));var config=require('../../../config/environment');config[_0xe601('0x4')]=_[_0xe601('0x5')](config[_0xe601('0x4')],{'host':_0xe601('0x6'),'port':0x18eb});var io=require(_0xe601('0x7'))(new Redis(config[_0xe601('0x4')]));function FaxQueue(_0x1bf4b9){this['id']=_0x1bf4b9['id']||0x0;this[_0xe601('0x8')]=_0x1bf4b9[_0xe601('0x8')]||'';this[_0xe601('0x9')]=_0x1bf4b9['timeout']||0xa;this[_0xe601('0xa')]=_0x1bf4b9['strategy']||_0xe601('0xb');this[_0xe601('0xc')]=_0x1bf4b9['Agents'];this[_0xe601('0xd')]={};this['waiting']=0x0;this[_0xe601('0x1')]='';this[_0xe601('0xe')]();this[_0xe601('0xf')]();}FaxQueue[_0xe601('0x10')][_0xe601('0xe')]=function(){var _0x6d6114=this[_0xe601('0xd')][_0xe601('0x11')];this[_0xe601('0xd')]=_['map'](this[_0xe601('0xc')],'id');this[_0xe601('0xd')][_0xe601('0x11')]=_0x6d6114;};FaxQueue['prototype'][_0xe601('0xf')]=function(){this[_0xe601('0x12')]=0x0;this[_0xe601('0x13')]=0x0;for(var _0x281744=0x0;_0x281744=0x0?this['available']:0x0;var _0x1a0adf={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe601('0x12')],'name':this['name'],'paused':this[_0xe601('0x13')],'waiting':this[_0xe601('0x18')]};var _0x298441=md5(JSON[_0xe601('0x19')](_0x1a0adf));if(this['md5']!==_0x298441){this['md5']=_0x298441;io['to'](util[_0xe601('0x1a')](_0xe601('0x1b'),_0x1a0adf[_0xe601('0x8')]))[_0xe601('0x1c')](_0xe601('0x1d'),_0x1a0adf);}};module[_0xe601('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 9389f1a..36a6e68 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 _0xd342=['name'];(function(_0x5b2568,_0x186e15){var _0xa533a9=function(_0x432814){while(--_0x432814){_0x5b2568['push'](_0x5b2568['shift']());}};_0xa533a9(++_0x186e15);}(_0xd342,0x1a3));var _0x2d34=function(_0x476efe,_0xf0f9dc){_0x476efe=_0x476efe-0x0;var _0x23c193=_0xd342[_0x476efe];return _0x23c193;};'use strict';function Interval(_0x3fc37b){this['id']=_0x3fc37b['id']||0x0;this[_0x2d34('0x0')]=_0x3fc37b[_0x2d34('0x0')]||'';this['Intervals']=_0x3fc37b['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0x00eb=['Intervals','name'];(function(_0x4bd130,_0xea2b4){var _0x39d72a=function(_0x2fe72e){while(--_0x2fe72e){_0x4bd130['push'](_0x4bd130['shift']());}};_0x39d72a(++_0xea2b4);}(_0x00eb,0x105));var _0xb00e=function(_0x53eda1,_0x306c45){_0x53eda1=_0x53eda1-0x0;var _0x92a58b=_0x00eb[_0x53eda1];return _0x92a58b;};'use strict';function Interval(_0x2ecfbb){this['id']=_0x2ecfbb['id']||0x0;this[_0xb00e('0x0')]=_0x2ecfbb[_0xb00e('0x0')]||'';this[_0xb00e('0x1')]=_0x2ecfbb[_0xb00e('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 adfc13e..c8c52ef 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 _0x8853=['timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','name'];(function(_0x58c47c,_0x3485e2){var _0x1182d8=function(_0x22a03c){while(--_0x22a03c){_0x58c47c['push'](_0x58c47c['shift']());}};_0x1182d8(++_0x3485e2);}(_0x8853,0x1cd));var _0x3885=function(_0x14691c,_0xe1c878){_0x14691c=_0x14691c-0x0;var _0xbec98=_0x8853[_0x14691c];return _0xbec98;};'use strict';var _=require('lodash');var md5=require(_0x3885('0x0'));var util=require(_0x3885('0x1'));var Redis=require(_0x3885('0x2'));var config=require('../../../config/environment');config[_0x3885('0x3')]=_['defaults'](config[_0x3885('0x3')],{'host':_0x3885('0x4'),'port':0x18eb});var io=require(_0x3885('0x5'))(new Redis(config['redis']));function MailQueue(_0x24473e){this['id']=_0x24473e['id']||0x0;this['name']=_0x24473e[_0x3885('0x6')]||'';this[_0x3885('0x7')]=_0x24473e[_0x3885('0x7')]||0xa;this[_0x3885('0x8')]=_0x24473e[_0x3885('0x8')]||_0x3885('0x9');this['Agents']=_0x24473e[_0x3885('0xa')];this['mapAgentsId']={};this[_0x3885('0xb')]=0x0;this[_0x3885('0x0')]='';this['updateRouting']();this[_0x3885('0xc')]();}MailQueue[_0x3885('0xd')]['updateRouting']=function(){var _0x29f8f6=this[_0x3885('0xe')]['_rr'];this['mapAgentsId']=_[_0x3885('0xf')](this[_0x3885('0xa')],'id');this[_0x3885('0xe')][_0x3885('0x10')]=_0x29f8f6;};MailQueue[_0x3885('0xd')]['updateRealtime']=function(){this[_0x3885('0x11')]=0x0;this[_0x3885('0x12')]=0x0;for(var _0x4d945e=0x0;_0x4d945e=0x0?this[_0x3885('0x13')]:0x0;var _0xcb84bf={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x3885('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0xd14f55=md5(JSON[_0x3885('0x14')](_0xcb84bf));if(this['md5']!==_0xd14f55){this[_0x3885('0x0')]=_0xd14f55;io['to'](util[_0x3885('0x15')](_0x3885('0x16'),_0xcb84bf[_0x3885('0x6')]))[_0x3885('0x17')](_0x3885('0x18'),_0xcb84bf);}};module[_0x3885('0x19')]=MailQueue; \ No newline at end of file +var _0x966f=['updateRouting','prototype','_rr','loggedIn','paused','online','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x227675,_0x181c49){var _0x2690cc=function(_0x1d37ed){while(--_0x1d37ed){_0x227675['push'](_0x227675['shift']());}};_0x2690cc(++_0x181c49);}(_0x966f,0x99));var _0xf966=function(_0x303a00,_0x456e3e){_0x303a00=_0x303a00-0x0;var _0x29fb5c=_0x966f[_0x303a00];return _0x29fb5c;};'use strict';var _=require(_0xf966('0x0'));var md5=require(_0xf966('0x1'));var util=require('util');var Redis=require(_0xf966('0x2'));var config=require(_0xf966('0x3'));config[_0xf966('0x4')]=_[_0xf966('0x5')](config[_0xf966('0x4')],{'host':_0xf966('0x6'),'port':0x18eb});var io=require(_0xf966('0x7'))(new Redis(config[_0xf966('0x4')]));function MailQueue(_0x456228){this['id']=_0x456228['id']||0x0;this[_0xf966('0x8')]=_0x456228[_0xf966('0x8')]||'';this[_0xf966('0x9')]=_0x456228['timeout']||0xa;this[_0xf966('0xa')]=_0x456228[_0xf966('0xa')]||_0xf966('0xb');this[_0xf966('0xc')]=_0x456228['Agents'];this[_0xf966('0xd')]={};this[_0xf966('0xe')]=0x0;this[_0xf966('0x1')]='';this[_0xf966('0xf')]();this['updateRealtime']();}MailQueue[_0xf966('0x10')][_0xf966('0xf')]=function(){var _0xc7878a=this[_0xf966('0xd')][_0xf966('0x11')];this[_0xf966('0xd')]=_['map'](this[_0xf966('0xc')],'id');this[_0xf966('0xd')][_0xf966('0x11')]=_0xc7878a;};MailQueue['prototype']['updateRealtime']=function(){this[_0xf966('0x12')]=0x0;this[_0xf966('0x13')]=0x0;for(var _0x3d32ed=0x0;_0x3d32ed=0x0?this[_0xf966('0x16')]:0x0;var _0x47c6ce={'id':this['id'],'available':this[_0xf966('0x16')],'loggedIn':this[_0xf966('0x12')],'name':this[_0xf966('0x8')],'paused':this[_0xf966('0x13')],'waiting':this[_0xf966('0xe')]};var _0x4893df=md5(JSON['stringify'](_0x47c6ce));if(this[_0xf966('0x1')]!==_0x4893df){this['md5']=_0x4893df;io['to'](util[_0xf966('0x17')](_0xf966('0x18'),_0x47c6ce[_0xf966('0x8')]))[_0xf966('0x19')](_0xf966('0x1a'),_0x47c6ce);}};module[_0xf966('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b403004..2657341 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(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e9231,_0x2563fe){_0x1e9231=_0x1e9231-0x0;var _0x2f4b96=_0x2ef3[_0x1e9231];return _0x2f4b96;};'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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x1261,0x144));var _0x1126=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x1261[_0x21b762];return _0x2ea6d4;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c16b548..04bb072 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 _0xa631=['sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','available','name','stringify','format'];(function(_0x32f8ed,_0x4d3a84){var _0x16a050=function(_0x317461){while(--_0x317461){_0x32f8ed['push'](_0x32f8ed['shift']());}};_0x16a050(++_0x4d3a84);}(_0xa631,0xe4));var _0x1a63=function(_0x488226,_0x55c790){_0x488226=_0x488226-0x0;var _0x1f9928=_0xa631[_0x488226];return _0x1f9928;};'use strict';var _=require('lodash');var md5=require(_0x1a63('0x0'));var util=require(_0x1a63('0x1'));var Redis=require(_0x1a63('0x2'));var config=require('../../../config/environment');config[_0x1a63('0x3')]=_['defaults'](config['redis'],{'host':_0x1a63('0x4'),'port':0x18eb});var io=require(_0x1a63('0x5'))(new Redis(config[_0x1a63('0x3')]));function SmsQueue(_0x4eed61){this['id']=_0x4eed61['id']||0x0;this['name']=_0x4eed61['name']||'';this['timeout']=_0x4eed61[_0x1a63('0x6')]||0xa;this[_0x1a63('0x7')]=_0x4eed61[_0x1a63('0x7')]||'beepall';this['Agents']=_0x4eed61[_0x1a63('0x8')];this[_0x1a63('0x9')]={};this[_0x1a63('0xa')]=0x0;this[_0x1a63('0x0')]='';this[_0x1a63('0xb')]();this['updateRealtime']();}SmsQueue[_0x1a63('0xc')][_0x1a63('0xb')]=function(){var _0x1899b9=this[_0x1a63('0x9')]['_rr'];this[_0x1a63('0x9')]=_[_0x1a63('0xd')](this[_0x1a63('0x8')],'id');this['mapAgentsId'][_0x1a63('0xe')]=_0x1899b9;};SmsQueue['prototype'][_0x1a63('0xf')]=function(){this[_0x1a63('0x10')]=0x0;this[_0x1a63('0x11')]=0x0;for(var _0x5301b6=0x0;_0x5301b6=0x0?this[_0x1a63('0x14')]:0x0;var _0x24996e={'id':this['id'],'available':this[_0x1a63('0x14')],'loggedIn':this[_0x1a63('0x10')],'name':this[_0x1a63('0x15')],'paused':this[_0x1a63('0x11')],'waiting':this['waiting']};var _0x34ad77=md5(JSON[_0x1a63('0x16')](_0x24996e));if(this['md5']!==_0x34ad77){this[_0x1a63('0x0')]=_0x34ad77;io['to'](util[_0x1a63('0x17')](_0x1a63('0x18'),_0x24996e[_0x1a63('0x15')]))[_0x1a63('0x19')](_0x1a63('0x1a'),_0x24996e);}};module[_0x1a63('0x1b')]=SmsQueue; \ No newline at end of file +var _0xd52d=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','sms:queue:%s','sms_queue:save','md5','util','../../../config/environment','redis'];(function(_0x2e5286,_0x377bff){var _0x552484=function(_0x1c8ee1){while(--_0x1c8ee1){_0x2e5286['push'](_0x2e5286['shift']());}};_0x552484(++_0x377bff);}(_0xd52d,0x1c7));var _0xdd52=function(_0x3cfcc8,_0x32015f){_0x3cfcc8=_0x3cfcc8-0x0;var _0x3d1d8c=_0xd52d[_0x3cfcc8];return _0x3d1d8c;};'use strict';var _=require('lodash');var md5=require(_0xdd52('0x0'));var util=require(_0xdd52('0x1'));var Redis=require('ioredis');var config=require(_0xdd52('0x2'));config['redis']=_['defaults'](config[_0xdd52('0x3')],{'host':_0xdd52('0x4'),'port':0x18eb});var io=require(_0xdd52('0x5'))(new Redis(config[_0xdd52('0x3')]));function SmsQueue(_0x3b9337){this['id']=_0x3b9337['id']||0x0;this[_0xdd52('0x6')]=_0x3b9337[_0xdd52('0x6')]||'';this[_0xdd52('0x7')]=_0x3b9337['timeout']||0xa;this[_0xdd52('0x8')]=_0x3b9337[_0xdd52('0x8')]||_0xdd52('0x9');this[_0xdd52('0xa')]=_0x3b9337[_0xdd52('0xa')];this[_0xdd52('0xb')]={};this[_0xdd52('0xc')]=0x0;this[_0xdd52('0x0')]='';this[_0xdd52('0xd')]();this[_0xdd52('0xe')]();}SmsQueue[_0xdd52('0xf')][_0xdd52('0xd')]=function(){var _0x1cfc7f=this['mapAgentsId'][_0xdd52('0x10')];this[_0xdd52('0xb')]=_[_0xdd52('0x11')](this[_0xdd52('0xa')],'id');this[_0xdd52('0xb')][_0xdd52('0x10')]=_0x1cfc7f;};SmsQueue['prototype'][_0xdd52('0xe')]=function(){this[_0xdd52('0x12')]=0x0;this[_0xdd52('0x13')]=0x0;for(var _0x55b823=0x0;_0x55b823=0x0?this[_0xdd52('0x17')]:0x0;var _0x45062e={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdd52('0x12')],'name':this[_0xdd52('0x6')],'paused':this[_0xdd52('0x13')],'waiting':this[_0xdd52('0xc')]};var _0x5de47a=md5(JSON[_0xdd52('0x18')](_0x45062e));if(this['md5']!==_0x5de47a){this[_0xdd52('0x0')]=_0x5de47a;io['to'](util['format'](_0xdd52('0x19'),_0x45062e[_0xdd52('0x6')]))['emit'](_0xdd52('0x1a'),_0x45062e);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 27ff828..304018e 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 _0x5729=['paused','length','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn'];(function(_0x3ed6a6,_0x4d80c8){var _0x34501b=function(_0x4cf5c3){while(--_0x4cf5c3){_0x3ed6a6['push'](_0x3ed6a6['shift']());}};_0x34501b(++_0x4d80c8);}(_0x5729,0xbe));var _0x9572=function(_0xccd9b7,_0x2ea6bd){_0xccd9b7=_0xccd9b7-0x0;var _0x26301d=_0x5729[_0xccd9b7];return _0x26301d;};'use strict';var _=require(_0x9572('0x0'));var md5=require(_0x9572('0x1'));var util=require(_0x9572('0x2'));var Redis=require('ioredis');var config=require(_0x9572('0x3'));config[_0x9572('0x4')]=_[_0x9572('0x5')](config[_0x9572('0x4')],{'host':_0x9572('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9572('0x4')]));function WhatsappQueue(_0x1eb541){this['id']=_0x1eb541['id']||0x0;this['name']=_0x1eb541[_0x9572('0x7')]||'';this[_0x9572('0x8')]=_0x1eb541[_0x9572('0x8')]||0xa;this['strategy']=_0x1eb541[_0x9572('0x9')]||'beepall';this[_0x9572('0xa')]=_0x1eb541[_0x9572('0xa')];this[_0x9572('0xb')]={};this[_0x9572('0xc')]=0x0;this[_0x9572('0x1')]='';this[_0x9572('0xd')]();this[_0x9572('0xe')]();}WhatsappQueue['prototype'][_0x9572('0xd')]=function(){var _0x5da9fb=this[_0x9572('0xb')][_0x9572('0xf')];this['mapAgentsId']=_[_0x9572('0x10')](this[_0x9572('0xa')],'id');this[_0x9572('0xb')][_0x9572('0xf')]=_0x5da9fb;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x9572('0x11')]=0x0;this[_0x9572('0x12')]=0x0;for(var _0x194884=0x0;_0x194884=0x0?this[_0x9572('0x14')]:0x0;var _0x3e5cf6={'id':this['id'],'available':this[_0x9572('0x14')],'loggedIn':this[_0x9572('0x11')],'name':this[_0x9572('0x7')],'paused':this['paused'],'waiting':this[_0x9572('0xc')]};var _0x3b41e9=md5(JSON[_0x9572('0x15')](_0x3e5cf6));if(this['md5']!==_0x3b41e9){this[_0x9572('0x1')]=_0x3b41e9;io['to'](util[_0x9572('0x16')]('whatsapp:queue:%s',_0x3e5cf6['name']))[_0x9572('0x17')](_0x9572('0x18'),_0x3e5cf6);}};module[_0x9572('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x9e06=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','paused','length','online','loggedIn','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x2c61f8,_0xb8a4dd){var _0x4badd1=function(_0x548e80){while(--_0x548e80){_0x2c61f8['push'](_0x2c61f8['shift']());}};_0x4badd1(++_0xb8a4dd);}(_0x9e06,0xf9));var _0x69e0=function(_0xb45e44,_0x46e658){_0xb45e44=_0xb45e44-0x0;var _0xd19290=_0x9e06[_0xb45e44];return _0xd19290;};'use strict';var _=require(_0x69e0('0x0'));var md5=require('md5');var util=require(_0x69e0('0x1'));var Redis=require(_0x69e0('0x2'));var config=require(_0x69e0('0x3'));config[_0x69e0('0x4')]=_[_0x69e0('0x5')](config['redis'],{'host':_0x69e0('0x6'),'port':0x18eb});var io=require(_0x69e0('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x323fc9){this['id']=_0x323fc9['id']||0x0;this[_0x69e0('0x8')]=_0x323fc9[_0x69e0('0x8')]||'';this['timeout']=_0x323fc9[_0x69e0('0x9')]||0xa;this[_0x69e0('0xa')]=_0x323fc9['strategy']||_0x69e0('0xb');this[_0x69e0('0xc')]=_0x323fc9['Agents'];this[_0x69e0('0xd')]={};this[_0x69e0('0xe')]=0x0;this[_0x69e0('0xf')]='';this[_0x69e0('0x10')]();this[_0x69e0('0x11')]();}WhatsappQueue['prototype'][_0x69e0('0x10')]=function(){var _0x75ff35=this[_0x69e0('0xd')][_0x69e0('0x12')];this[_0x69e0('0xd')]=_['map'](this[_0x69e0('0xc')],'id');this[_0x69e0('0xd')]['_rr']=_0x75ff35;};WhatsappQueue['prototype'][_0x69e0('0x11')]=function(){this['loggedIn']=0x0;this[_0x69e0('0x13')]=0x0;for(var _0x37f349=0x0;_0x37f349=0x0?this['available']:0x0;var _0x237d27={'id':this['id'],'available':this['available'],'loggedIn':this[_0x69e0('0x16')],'name':this[_0x69e0('0x8')],'paused':this[_0x69e0('0x13')],'waiting':this[_0x69e0('0xe')]};var _0x13bfdb=md5(JSON[_0x69e0('0x19')](_0x237d27));if(this['md5']!==_0x13bfdb){this[_0x69e0('0xf')]=_0x13bfdb;io['to'](util['format'](_0x69e0('0x1a'),_0x237d27[_0x69e0('0x8')]))[_0x69e0('0x1b')](_0x69e0('0x1c'),_0x237d27);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index c31e66c..7e7349e 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(_0x394266,_0x2e46ae){var _0x553071=function(_0x48676c){while(--_0x48676c){_0x394266['push'](_0x394266['shift']());}};_0x553071(++_0x2e46ae);}(_0xb10b,0x12a));var _0xbb10=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xb10b[_0x547456];return _0xc1fd7b;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index f7b2b2f..3bd1786 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 _0x7878=['../client','update','updateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x49baaf,_0x4ff783){var _0x9c0dfc=function(_0x5eeffb){while(--_0x5eeffb){_0x49baaf['push'](_0x49baaf['shift']());}};_0x9c0dfc(++_0x4ff783);}(_0x7878,0x96));var _0x8787=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7878[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8787('0x0'));exports[_0x8787('0x1')]=function(_0xddb915,_0x3421bc){return client['Request']('UpdateChatInteraction',{'body':_0x3421bc,'options':{'where':{'id':_0xddb915}},'log':_0x8787('0x2')});};exports['addTags']=function(_0x1c3e44,_0x419a1e){return client[_0x8787('0x3')](_0x8787('0x4'),{'body':_0x419a1e,'options':{'where':{'id':_0x1c3e44}},'log':_0x8787('0x5')});}; \ No newline at end of file +var _0x1601=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x1601,0x122));var _0x1160=function(_0x31637d,_0x5116df){_0x31637d=_0x31637d-0x0;var _0x265eda=_0x1601[_0x31637d];return _0x265eda;};'use strict';var client=require('../client');exports['update']=function(_0x52ead8,_0x41e709){return client['Request'](_0x1160('0x0'),{'body':_0x41e709,'options':{'where':{'id':_0x52ead8}},'log':_0x1160('0x1')});};exports[_0x1160('0x2')]=function(_0x327289,_0x2a24d9){return client['Request'](_0x1160('0x3'),{'body':_0x2a24d9,'options':{'where':{'id':_0x327289}},'log':_0x1160('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c44060b..86d56b6 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 _0x3570=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0xb1e29c,_0x580161){var _0x1491f0=function(_0x3075f9){while(--_0x3075f9){_0xb1e29c['push'](_0xb1e29c['shift']());}};_0x1491f0(++_0x580161);}(_0x3570,0xa8));var _0x0357=function(_0x5c9a2f,_0x83c464){_0x5c9a2f=_0x5c9a2f-0x0;var _0x4a21fa=_0x3570[_0x5c9a2f];return _0x4a21fa;};'use strict';var client=require(_0x0357('0x0'));exports[_0x0357('0x1')]=function(_0x3ef8da){return client[_0x0357('0x2')](_0x0357('0x3'),{'body':_0x3ef8da,'log':_0x0357('0x4')});}; \ No newline at end of file +var _0x4eec=['../client','create','Request','CreateChatMessage'];(function(_0x20a65c,_0xe559d5){var _0xc46bfc=function(_0x1bed28){while(--_0x1bed28){_0x20a65c['push'](_0x20a65c['shift']());}};_0xc46bfc(++_0xe559d5);}(_0x4eec,0xd4));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc4ee('0x0'));exports[_0xc4ee('0x1')]=function(_0x5964c8){return client[_0xc4ee('0x2')](_0xc4ee('0x3'),{'body':_0x5964c8,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0ffa9c3..2194a08 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 _0x9ca0=['name','timeout','User','Agents','online','../client','getChatQueues','Request'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9ca0,0x65));var _0x09ca=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x9ca0[_0x278e3c];return _0x3e2d9b;};'use strict';var client=require(_0x09ca('0x0'));exports[_0x09ca('0x1')]=function(){return function(){return client[_0x09ca('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x09ca('0x3'),_0x09ca('0x4'),'strategy'],'include':[{'model':_0x09ca('0x5'),'as':_0x09ca('0x6'),'attributes':['id','name',_0x09ca('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xc6ab=['GetChatQueue','name','User','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc6ab,0x96));var _0xbc6a=function(_0x426c67,_0x7454c9){_0x426c67=_0x426c67-0x0;var _0x4fb642=_0xc6ab[_0x426c67];return _0x4fb642;};'use strict';var client=require(_0xbc6a('0x0'));exports[_0xbc6a('0x1')]=function(){return function(){return client[_0xbc6a('0x2')](_0xbc6a('0x3'),{'options':{'raw':![],'attributes':['id',_0xbc6a('0x4'),'timeout','strategy'],'include':[{'model':_0xbc6a('0x5'),'as':_0xbc6a('0x6'),'attributes':['id',_0xbc6a('0x4'),_0xbc6a('0x7'),_0xbc6a('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 27cf2d1..9036058 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 _0x826a=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x396d92,_0x2c581d){var _0x1e9cd4=function(_0x52e672){while(--_0x52e672){_0x396d92['push'](_0x396d92['shift']());}};_0x1e9cd4(++_0x2c581d);}(_0x826a,0x1aa));var _0xa826=function(_0x403d12,_0x4fbf84){_0x403d12=_0x403d12-0x0;var _0x43508a=_0x826a[_0x403d12];return _0x43508a;};'use strict';var client=require('../client');exports[_0xa826('0x0')]=function(_0x5bb1d7){return client[_0xa826('0x1')]('CreateChatQueueReport',{'body':_0x5bb1d7,'log':_0xa826('0x2')});};exports[_0xa826('0x3')]=function(_0x2212a4,_0x34e1ad){return client['Request'](_0xa826('0x4'),{'body':_0x34e1ad,'options':{'where':{'uniqueid':_0x2212a4},'order':[['id',_0xa826('0x5')]],'limit':0x1},'log':_0xa826('0x4')});}; \ No newline at end of file +var _0x6c63=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x253b57,_0x5ee196){var _0x291f2f=function(_0x490c60){while(--_0x490c60){_0x253b57['push'](_0x253b57['shift']());}};_0x291f2f(++_0x5ee196);}(_0x6c63,0x1ee));var _0x36c6=function(_0x108c04,_0x29fc63){_0x108c04=_0x108c04-0x0;var _0x3ffb8a=_0x6c63[_0x108c04];return _0x3ffb8a;};'use strict';var client=require(_0x36c6('0x0'));exports[_0x36c6('0x1')]=function(_0x2fcaae){return client[_0x36c6('0x2')](_0x36c6('0x3'),{'body':_0x2fcaae,'log':_0x36c6('0x3')});};exports['update']=function(_0x136502,_0x2a605b){return client[_0x36c6('0x2')](_0x36c6('0x4'),{'body':_0x2a605b,'options':{'where':{'uniqueid':_0x136502},'order':[['id',_0x36c6('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 47f7b7f..f056c2c 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x44f9ae,_0x27f80a){var _0x7fcd7=function(_0x41cfe6){while(--_0x41cfe6){_0x44f9ae['push'](_0x44f9ae['shift']());}};_0x7fcd7(++_0x27f80a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x7a54,0x106));var _0x47a5=function(_0x14940f,_0x3da9a9){_0x14940f=_0x14940f-0x0;var _0x49f954=_0x7a54[_0x14940f];return _0x49f954;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 68401e8..e9e1eda 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 _0x45e9=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x4ef77b,_0x6a3df){var _0x58d1a6=function(_0x3b7e29){while(--_0x3b7e29){_0x4ef77b['push'](_0x4ef77b['shift']());}};_0x58d1a6(++_0x6a3df);}(_0x45e9,0xaf));var _0x945e=function(_0x52ce83,_0x5a9a84){_0x52ce83=_0x52ce83-0x0;var _0x2d752a=_0x45e9[_0x52ce83];return _0x2d752a;};'use strict';var client=require(_0x945e('0x0'));exports[_0x945e('0x1')]=function(_0xa4d6a9){return client[_0x945e('0x2')](_0x945e('0x3'),{'body':_0xa4d6a9,'log':_0x945e('0x4')});}; \ No newline at end of file +var _0x0ce4=['Request','createFaxMessage','../client','create'];(function(_0x14cebc,_0x199f13){var _0x3d9539=function(_0x570ebd){while(--_0x570ebd){_0x14cebc['push'](_0x14cebc['shift']());}};_0x3d9539(++_0x199f13);}(_0x0ce4,0x11e));var _0x40ce=function(_0x1aedef,_0x30c67c){_0x1aedef=_0x1aedef-0x0;var _0x4941b2=_0x0ce4[_0x1aedef];return _0x4941b2;};'use strict';var client=require(_0x40ce('0x0'));exports[_0x40ce('0x1')]=function(_0x156f97){return client[_0x40ce('0x2')]('CreateFaxMessage',{'body':_0x156f97,'log':_0x40ce('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 30c766f..4e1a917 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 _0x8f5f=['faxPause','../client','getFaxQueues','GetFaxQueue','name','strategy','User','Agents','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f5f,0x14e));var _0xf8f5=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x8f5f[_0x4067ac];return _0x53d74d;};'use strict';var client=require(_0xf8f5('0x0'));exports[_0xf8f5('0x1')]=function(){return function(){return client['Request'](_0xf8f5('0x2'),{'options':{'raw':![],'attributes':['id',_0xf8f5('0x3'),'timeout',_0xf8f5('0x4')],'include':[{'model':_0xf8f5('0x5'),'as':_0xf8f5('0x6'),'attributes':['id','name',_0xf8f5('0x7'),_0xf8f5('0x8')]}]},'log':_0xf8f5('0x1')});};}; \ No newline at end of file +var _0x471d=['GetFaxQueue','name','timeout','strategy','online','faxPause','../client','getFaxQueues','Request'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x471d,0xde));var _0xd471=function(_0x1913a1,_0x2586f0){_0x1913a1=_0x1913a1-0x0;var _0xe97436=_0x471d[_0x1913a1];return _0xe97436;};'use strict';var client=require(_0xd471('0x0'));exports[_0xd471('0x1')]=function(){return function(){return client[_0xd471('0x2')](_0xd471('0x3'),{'options':{'raw':![],'attributes':['id',_0xd471('0x4'),_0xd471('0x5'),_0xd471('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0xd471('0x7'),_0xd471('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 31c4023..c8f90ea 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=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x4f2b7b,_0x85198){var _0x4db151=function(_0x1634c3){while(--_0x1634c3){_0x4f2b7b['push'](_0x4f2b7b['shift']());}};_0x4db151(++_0x85198);}(_0xce1b,0x6b));var _0xbce1=function(_0x4512fa,_0x4d6b86){_0x4512fa=_0x4512fa-0x0;var _0x537546=_0xce1b[_0x4512fa];return _0x537546;};'use strict';var client=require(_0xbce1('0x0'));exports[_0xbce1('0x1')]=function(_0x41cac5){return client[_0xbce1('0x2')]('CreateFaxQueueReport',{'body':_0x41cac5,'log':_0xbce1('0x3')});};exports[_0xbce1('0x4')]=function(_0x321525,_0x17541a){return client[_0xbce1('0x2')](_0xbce1('0x5'),{'body':_0x17541a,'options':{'where':{'uniqueid':_0x321525},'order':[['id','DESC']],'limit':0x1},'log':_0xbce1('0x5')});}; \ No newline at end of file +var _0xbe0d=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','Request'];(function(_0x210d46,_0x445967){var _0x5ee242=function(_0x1463d4){while(--_0x1463d4){_0x210d46['push'](_0x210d46['shift']());}};_0x5ee242(++_0x445967);}(_0xbe0d,0x88));var _0xdbe0=function(_0x304f80,_0x2f7b5b){_0x304f80=_0x304f80-0x0;var _0x4c0f2d=_0xbe0d[_0x304f80];return _0x4c0f2d;};'use strict';var client=require(_0xdbe0('0x0'));exports['create']=function(_0x24b32b){return client[_0xdbe0('0x1')](_0xdbe0('0x2'),{'body':_0x24b32b,'log':_0xdbe0('0x2')});};exports[_0xdbe0('0x3')]=function(_0x2091e6,_0x36d4cc){return client[_0xdbe0('0x1')](_0xdbe0('0x4'),{'body':_0x36d4cc,'options':{'where':{'uniqueid':_0x2091e6},'order':[['id',_0xdbe0('0x5')]],'limit':0x1},'log':_0xdbe0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index eb488bf..a281271 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 _0x8e16=['Intervals','interval','../client','Request','GetInterval','name'];(function(_0x3495e7,_0x2f6a1f){var _0x5cbb6f=function(_0x247f30){while(--_0x247f30){_0x3495e7['push'](_0x3495e7['shift']());}};_0x5cbb6f(++_0x2f6a1f);}(_0x8e16,0x13a));var _0x68e1=function(_0xddb604,_0x3cd27f){_0xddb604=_0xddb604-0x0;var _0x177a5f=_0x8e16[_0xddb604];return _0x177a5f;};'use strict';var client=require(_0x68e1('0x0'));exports['getIntervals']=function(){return function(){return client[_0x68e1('0x1')](_0x68e1('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x68e1('0x3')],'include':[{'model':'Interval','as':_0x68e1('0x4'),'attributes':['id','name',_0x68e1('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x4e53=['interval','getIntervals','../client','Request','name','Intervals'];(function(_0x2039ca,_0x228e70){var _0x37795e=function(_0x5e1066){while(--_0x5e1066){_0x2039ca['push'](_0x2039ca['shift']());}};_0x37795e(++_0x228e70);}(_0x4e53,0x18e));var _0x34e5=function(_0x23648b,_0x51a25f){_0x23648b=_0x23648b-0x0;var _0x2b5a63=_0x4e53[_0x23648b];return _0x2b5a63;};'use strict';var client=require(_0x34e5('0x0'));exports['getIntervals']=function(){return function(){return client[_0x34e5('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x34e5('0x2')],'include':[{'model':'Interval','as':_0x34e5('0x3'),'attributes':['id',_0x34e5('0x2'),_0x34e5('0x4')]}]},'log':_0x34e5('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 7e41038..e68cb40 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 _0x896e=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x896e,0x1e9));var _0xe896=function(_0x2aab36,_0x4c49dc){_0x2aab36=_0x2aab36-0x0;var _0x4bfb20=_0x896e[_0x2aab36];return _0x4bfb20;};'use strict';var client=require(_0xe896('0x0'));exports[_0xe896('0x1')]=function(_0x3feebe,_0x229b59){return client[_0xe896('0x2')](_0xe896('0x3'),{'body':_0x229b59,'options':{'where':{'id':_0x3feebe}},'log':_0xe896('0x4')});};exports[_0xe896('0x5')]=function(_0x3f85e5,_0x2d3521){return client[_0xe896('0x2')](_0xe896('0x6'),{'body':_0x2d3521,'options':{'where':{'id':_0x3f85e5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7096=['AddTagsToMailInteraction','addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x569f5f,_0x1c6c5c){var _0x3e8e2e=function(_0x46344f){while(--_0x46344f){_0x569f5f['push'](_0x569f5f['shift']());}};_0x3e8e2e(++_0x1c6c5c);}(_0x7096,0x10c));var _0x6709=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7096[_0x47b58b];return _0x46bebe;};'use strict';var client=require('../client');exports[_0x6709('0x0')]=function(_0x5035b7,_0x253760){return client['Request'](_0x6709('0x1'),{'body':_0x253760,'options':{'where':{'id':_0x5035b7}},'log':_0x6709('0x2')});};exports[_0x6709('0x3')]=function(_0xccdcb5,_0x3cd087){return client[_0x6709('0x4')](_0x6709('0x5'),{'body':_0x3cd087,'options':{'where':{'id':_0xccdcb5}},'log':_0x6709('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a4ed9fc..54abe13 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 _0x9cb0=['createMailMessage','create','Request','CreateMailMessage'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9cb0,0xe1));var _0x09cb=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x9cb0[_0x39cf70];return _0x580424;};'use strict';var client=require('../client');exports[_0x09cb('0x0')]=function(_0x3c77ae){return client[_0x09cb('0x1')](_0x09cb('0x2'),{'body':_0x3c77ae,'log':_0x09cb('0x3')});}; \ No newline at end of file +var _0x0686=['createMailMessage','Request','CreateMailMessage'];(function(_0x15f02f,_0x99a1c8){var _0x4b4a7c=function(_0x6422f2){while(--_0x6422f2){_0x15f02f['push'](_0x15f02f['shift']());}};_0x4b4a7c(++_0x99a1c8);}(_0x0686,0x9d));var _0x6068=function(_0x218b3d,_0x364338){_0x218b3d=_0x218b3d-0x0;var _0x35eaa1=_0x0686[_0x218b3d];return _0x35eaa1;};'use strict';var client=require('../client');exports['create']=function(_0x5c65b5){return client[_0x6068('0x0')](_0x6068('0x1'),{'body':_0x5c65b5,'log':_0x6068('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 4855d1d..0ab3296 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 _0x4039=['getMailQueues','Request','GetMailQueue','timeout','strategy','Agents','name','online','../client'];(function(_0x1465a5,_0x43c4ac){var _0x4b6bbc=function(_0x5e2076){while(--_0x5e2076){_0x1465a5['push'](_0x1465a5['shift']());}};_0x4b6bbc(++_0x43c4ac);}(_0x4039,0x143));var _0x9403=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x4039[_0xc67528];return _0x38e26d;};'use strict';var client=require(_0x9403('0x0'));exports[_0x9403('0x1')]=function(){return function(){return client[_0x9403('0x2')](_0x9403('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9403('0x4'),_0x9403('0x5')],'include':[{'model':'User','as':_0x9403('0x6'),'attributes':['id',_0x9403('0x7'),_0x9403('0x8'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xd6e5=['timeout','User','online','../client','Request'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xd6e5,0x184));var _0x5d6e=function(_0x230271,_0x179ef0){_0x230271=_0x230271-0x0;var _0x30414e=_0xd6e5[_0x230271];return _0x30414e;};'use strict';var client=require(_0x5d6e('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x5d6e('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x5d6e('0x2'),'strategy'],'include':[{'model':_0x5d6e('0x3'),'as':'Agents','attributes':['id','name',_0x5d6e('0x4'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 3a60770..ae7fc17 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 _0x8018=['CreateMailQueueReport','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x8018,0xa5));var _0x8801=function(_0x26e826,_0x4e4958){_0x26e826=_0x26e826-0x0;var _0x94901a=_0x8018[_0x26e826];return _0x94901a;};'use strict';var client=require(_0x8801('0x0'));exports[_0x8801('0x1')]=function(_0x548edf){return client[_0x8801('0x2')]('CreateMailQueueReport',{'body':_0x548edf,'log':_0x8801('0x3')});};exports['update']=function(_0x5d9e1c,_0x40607a){return client[_0x8801('0x2')]('UpdateMailQueueReport',{'body':_0x40607a,'options':{'where':{'uniqueid':_0x5d9e1c},'order':[['id',_0x8801('0x4')]],'limit':0x1},'log':_0x8801('0x5')});}; \ No newline at end of file +var _0x40cb=['DESC','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x40cb,0x15a));var _0xb40c=function(_0x2f6b14,_0x58519b){_0x2f6b14=_0x2f6b14-0x0;var _0x3a4019=_0x40cb[_0x2f6b14];return _0x3a4019;};'use strict';var client=require('../client');exports[_0xb40c('0x0')]=function(_0x5850ff){return client[_0xb40c('0x1')](_0xb40c('0x2'),{'body':_0x5850ff,'log':_0xb40c('0x2')});};exports['update']=function(_0x26d5d1,_0x194da9){return client['Request'](_0xb40c('0x3'),{'body':_0x194da9,'options':{'where':{'uniqueid':_0x26d5d1},'order':[['id',_0xb40c('0x4')]],'limit':0x1},'log':_0xb40c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 3e2c7ee..fb9714c 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 _0xdd98=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd98,0x1e0));var _0x8dd9=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0xdd98[_0x10e983];return _0x324138;};'use strict';var client=require('../client');exports['update']=function(_0xb47c6,_0x1bcbc2){return client[_0x8dd9('0x0')](_0x8dd9('0x1'),{'body':_0x1bcbc2,'options':{'where':{'id':_0xb47c6}},'log':_0x8dd9('0x2')});};exports[_0x8dd9('0x3')]=function(_0x4b657e,_0xa3ed71){return client[_0x8dd9('0x0')](_0x8dd9('0x4'),{'body':_0xa3ed71,'options':{'where':{'id':_0x4b657e}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xe1f2=['addTags','AddTagsToOpenchannelInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0xa32485,_0x2dedb7){var _0x121093=function(_0x352d1e){while(--_0x352d1e){_0xa32485['push'](_0xa32485['shift']());}};_0x121093(++_0x2dedb7);}(_0xe1f2,0x79));var _0x2e1f=function(_0x2093f0,_0x1f903c){_0x2093f0=_0x2093f0-0x0;var _0x37829f=_0xe1f2[_0x2093f0];return _0x37829f;};'use strict';var client=require(_0x2e1f('0x0'));exports[_0x2e1f('0x1')]=function(_0x58b4e1,_0x3beb82){return client[_0x2e1f('0x2')](_0x2e1f('0x3'),{'body':_0x3beb82,'options':{'where':{'id':_0x58b4e1}},'log':_0x2e1f('0x4')});};exports[_0x2e1f('0x5')]=function(_0x30f42c,_0x115f8b){return client['Request'](_0x2e1f('0x6'),{'body':_0x115f8b,'options':{'where':{'id':_0x30f42c}},'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 80d2301..7638765 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 _0x021a=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0xc5d9de,_0x151b03){var _0x49b41d=function(_0x41a80c){while(--_0x41a80c){_0xc5d9de['push'](_0xc5d9de['shift']());}};_0x49b41d(++_0x151b03);}(_0x021a,0x130));var _0xa021=function(_0x3a62d3,_0x4fd275){_0x3a62d3=_0x3a62d3-0x0;var _0x138eae=_0x021a[_0x3a62d3];return _0x138eae;};'use strict';var client=require(_0xa021('0x0'));exports[_0xa021('0x1')]=function(_0x8778d1){return client[_0xa021('0x2')](_0xa021('0x3'),{'body':_0x8778d1,'log':_0xa021('0x4')});}; \ No newline at end of file +var _0x1106=['CreateOpenchannelMessage','createOpenchannelMessage','create','Request'];(function(_0x33f127,_0x2abaf5){var _0x5b3ac6=function(_0x5a4091){while(--_0x5a4091){_0x33f127['push'](_0x33f127['shift']());}};_0x5b3ac6(++_0x2abaf5);}(_0x1106,0x132));var _0x6110=function(_0x390c0a,_0x10c79d){_0x390c0a=_0x390c0a-0x0;var _0xf7642=_0x1106[_0x390c0a];return _0xf7642;};'use strict';var client=require('../client');exports[_0x6110('0x0')]=function(_0x4f5804){return client[_0x6110('0x1')](_0x6110('0x2'),{'body':_0x4f5804,'log':_0x6110('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index e53c79f..6586c2c 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 _0xce03=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x65a6b6,_0x4f724e){var _0x4060bd=function(_0x38201f){while(--_0x38201f){_0x65a6b6['push'](_0x65a6b6['shift']());}};_0x4060bd(++_0x4f724e);}(_0xce03,0x114));var _0x3ce0=function(_0x3c3749,_0x1726fb){_0x3c3749=_0x3c3749-0x0;var _0x575f7e=_0xce03[_0x3c3749];return _0x575f7e;};'use strict';var client=require(_0x3ce0('0x0'));exports[_0x3ce0('0x1')]=function(){return function(){return client[_0x3ce0('0x2')](_0x3ce0('0x3'),{'options':{'raw':![],'attributes':['id',_0x3ce0('0x4'),_0x3ce0('0x5'),_0x3ce0('0x6')],'include':[{'model':_0x3ce0('0x7'),'as':_0x3ce0('0x8'),'attributes':['id',_0x3ce0('0x4'),_0x3ce0('0x9'),_0x3ce0('0xa')]}]},'log':_0x3ce0('0x1')});};}; \ No newline at end of file +var _0x8ccd=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','online'];(function(_0x3811d1,_0x1d2759){var _0x24b3af=function(_0x4fe1c1){while(--_0x4fe1c1){_0x3811d1['push'](_0x3811d1['shift']());}};_0x24b3af(++_0x1d2759);}(_0x8ccd,0x118));var _0xd8cc=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x8ccd[_0x1cb18a];return _0x22442e;};'use strict';var client=require('../client');exports[_0xd8cc('0x0')]=function(){return function(){return client[_0xd8cc('0x1')](_0xd8cc('0x2'),{'options':{'raw':![],'attributes':['id',_0xd8cc('0x3'),_0xd8cc('0x4'),_0xd8cc('0x5')],'include':[{'model':_0xd8cc('0x6'),'as':'Agents','attributes':['id',_0xd8cc('0x3'),_0xd8cc('0x7'),'openchannelPause']}]},'log':_0xd8cc('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 8c43cef..c78db34 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 _0xaf1b=['UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport','DESC'];(function(_0x300a7b,_0xe163ac){var _0x260455=function(_0x6fcf65){while(--_0x6fcf65){_0x300a7b['push'](_0x300a7b['shift']());}};_0x260455(++_0xe163ac);}(_0xaf1b,0x182));var _0xbaf1=function(_0x5e5bf8,_0x5844ba){_0x5e5bf8=_0x5e5bf8-0x0;var _0x3f5e3d=_0xaf1b[_0x5e5bf8];return _0x3f5e3d;};'use strict';var client=require(_0xbaf1('0x0'));exports['create']=function(_0x282c70){return client[_0xbaf1('0x1')](_0xbaf1('0x2'),{'body':_0x282c70,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x4be8ed,_0xf8c4d8){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0xf8c4d8,'options':{'where':{'uniqueid':_0x4be8ed},'order':[['id',_0xbaf1('0x3')]],'limit':0x1},'log':_0xbaf1('0x4')});}; \ No newline at end of file +var _0x64bb=['UpdateOpenchannelQueueReport','DESC','create','CreateOpenchannelQueueReport','update','Request'];(function(_0x657ac9,_0x3f655b){var _0x158ad6=function(_0xf32002){while(--_0xf32002){_0x657ac9['push'](_0x657ac9['shift']());}};_0x158ad6(++_0x3f655b);}(_0x64bb,0x68));var _0xb64b=function(_0xed80a8,_0x53a464){_0xed80a8=_0xed80a8-0x0;var _0x8f7f7d=_0x64bb[_0xed80a8];return _0x8f7f7d;};'use strict';var client=require('../client');exports[_0xb64b('0x0')]=function(_0x36c539){return client['Request'](_0xb64b('0x1'),{'body':_0x36c539,'log':_0xb64b('0x1')});};exports[_0xb64b('0x2')]=function(_0x54eb9b,_0x2bad12){return client[_0xb64b('0x3')](_0xb64b('0x4'),{'body':_0x2bad12,'options':{'where':{'uniqueid':_0x54eb9b},'order':[['id',_0xb64b('0x5')]],'limit':0x1},'log':_0xb64b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 09896ec..4a098d2 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 _0xec39=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x5d201e,_0x216b92){var _0x33ec76=function(_0x12a86c){while(--_0x12a86c){_0x5d201e['push'](_0x5d201e['shift']());}};_0x33ec76(++_0x216b92);}(_0xec39,0x19f));var _0x9ec3=function(_0x23b8dc,_0x1b7b9d){_0x23b8dc=_0x23b8dc-0x0;var _0xe76082=_0xec39[_0x23b8dc];return _0xe76082;};'use strict';var client=require(_0x9ec3('0x0'));exports[_0x9ec3('0x1')]=function(_0xc365e8,_0x3ea667){return client[_0x9ec3('0x2')](_0x9ec3('0x3'),{'body':_0x3ea667,'options':{'where':{'id':_0xc365e8}},'log':_0x9ec3('0x4')});};exports['addTags']=function(_0x1f43fb,_0x1c944d){return client[_0x9ec3('0x2')]('AddTagsToSmsInteraction',{'body':_0x1c944d,'options':{'where':{'id':_0x1f43fb}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x943c=['update','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x592cc3,_0x54e4ed){var _0xd6e229=function(_0x1c5531){while(--_0x1c5531){_0x592cc3['push'](_0x592cc3['shift']());}};_0xd6e229(++_0x54e4ed);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc943('0x0'));exports[_0xc943('0x1')]=function(_0x3ab205,_0x714ac3){return client['Request']('UpdateSmsInteraction',{'body':_0x714ac3,'options':{'where':{'id':_0x3ab205}},'log':_0xc943('0x2')});};exports[_0xc943('0x3')]=function(_0xa24827,_0x5b7d1d){return client[_0xc943('0x4')](_0xc943('0x5'),{'body':_0x5b7d1d,'options':{'where':{'id':_0xa24827}},'log':_0xc943('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 774bd04..33d60ce 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 _0x7bf8=['CreateSmsMessage','createSmsMessage','Request'];(function(_0x6f5598,_0xabeb74){var _0x1e1325=function(_0x1da246){while(--_0x1da246){_0x6f5598['push'](_0x6f5598['shift']());}};_0x1e1325(++_0xabeb74);}(_0x7bf8,0x11c));var _0x87bf=function(_0x2e5671,_0x24a3e5){_0x2e5671=_0x2e5671-0x0;var _0x3348b7=_0x7bf8[_0x2e5671];return _0x3348b7;};'use strict';var client=require('../client');exports['create']=function(_0x1cfaab){return client[_0x87bf('0x0')](_0x87bf('0x1'),{'body':_0x1cfaab,'log':_0x87bf('0x2')});}; \ No newline at end of file +var _0xd97f=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x14508e,_0x218b70){var _0x347bf7=function(_0x5723ef){while(--_0x5723ef){_0x14508e['push'](_0x14508e['shift']());}};_0x347bf7(++_0x218b70);}(_0xd97f,0x199));var _0xfd97=function(_0x504f4a,_0x19928c){_0x504f4a=_0x504f4a-0x0;var _0x4258e8=_0xd97f[_0x504f4a];return _0x4258e8;};'use strict';var client=require(_0xfd97('0x0'));exports[_0xfd97('0x1')]=function(_0x5b8158){return client[_0xfd97('0x2')](_0xfd97('0x3'),{'body':_0x5b8158,'log':_0xfd97('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d810fd6..1a76f80 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x30d4c8,_0x5143bb){var _0x42063d=function(_0x5afc7c){while(--_0x5afc7c){_0x30d4c8['push'](_0x30d4c8['shift']());}};_0x42063d(++_0x5143bb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x426076,_0xfdf5d2){var _0x1e9565=function(_0x38832a){while(--_0x38832a){_0x426076['push'](_0x426076['shift']());}};_0x1e9565(++_0xfdf5d2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 5a5babd..9bd9565 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x527d5d,_0x11704d){var _0x46dd84=function(_0x5790f4){while(--_0x5790f4){_0x527d5d['push'](_0x527d5d['shift']());}};_0x46dd84(++_0x11704d);}(_0x34e8,0x12c));var _0x834e=function(_0x28863b,_0x458dce){_0x28863b=_0x28863b-0x0;var _0x46507b=_0x34e8[_0x28863b];return _0x46507b;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x4e07cf,_0x99ec35){var _0x3027d0=function(_0x8bc1f9){while(--_0x8bc1f9){_0x4e07cf['push'](_0x4e07cf['shift']());}};_0x3027d0(++_0x99ec35);}(_0x34e8,0x12c));var _0x834e=function(_0x537962,_0x1e832a){_0x537962=_0x537962-0x0;var _0x24f6ec=_0x34e8[_0x537962];return _0x24f6ec;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 47c57b3..530c32c 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(_0x13179f,_0xfdfa7e){var _0x2533a2=function(_0x465fdb){while(--_0x465fdb){_0x13179f['push'](_0x13179f['shift']());}};_0x2533a2(++_0xfdfa7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x932cce,_0x505c8f){var _0x5f496f=function(_0x474fda){while(--_0x474fda){_0x932cce['push'](_0x932cce['shift']());}};_0x5f496f(++_0x505c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 1bfa399..35a4b48 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 _0x4d68=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x4d68,0x1c3));var _0x84d6=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x4d68[_0x55c1f0];return _0x1530fa;};'use strict';var client=require(_0x84d6('0x0'));exports[_0x84d6('0x1')]=function(_0x2e2636,_0xc5c972){return client[_0x84d6('0x2')](_0x84d6('0x3'),{'body':_0xc5c972,'options':{'where':{'id':_0x2e2636}},'log':'updateWhatsappInteraction'});};exports[_0x84d6('0x4')]=function(_0x5ee114,_0x3a2f0b){return client['Request'](_0x84d6('0x5'),{'body':_0x3a2f0b,'options':{'where':{'id':_0x5ee114}},'log':_0x84d6('0x6')});}; \ No newline at end of file +var _0x36c3=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x329232,_0x5752b2){var _0x36c515=function(_0x3c474e){while(--_0x3c474e){_0x329232['push'](_0x329232['shift']());}};_0x36c515(++_0x5752b2);}(_0x36c3,0x1a6));var _0x336c=function(_0x21f27d,_0x2305ba){_0x21f27d=_0x21f27d-0x0;var _0x504a7b=_0x36c3[_0x21f27d];return _0x504a7b;};'use strict';var client=require(_0x336c('0x0'));exports[_0x336c('0x1')]=function(_0x4c7eb5,_0xa96e0b){return client[_0x336c('0x2')](_0x336c('0x3'),{'body':_0xa96e0b,'options':{'where':{'id':_0x4c7eb5}},'log':_0x336c('0x4')});};exports[_0x336c('0x5')]=function(_0x2b1194,_0x39ed12){return client['Request'](_0x336c('0x6'),{'body':_0x39ed12,'options':{'where':{'id':_0x2b1194}},'log':_0x336c('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index a3ee5e2..26ec082 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 _0x9843=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x40b1de,_0x4d385f){var _0x2198bf=function(_0x3481ea){while(--_0x3481ea){_0x40b1de['push'](_0x40b1de['shift']());}};_0x2198bf(++_0x4d385f);}(_0x9843,0x160));var _0x3984=function(_0x4fa665,_0x1ae12a){_0x4fa665=_0x4fa665-0x0;var _0x62ccff=_0x9843[_0x4fa665];return _0x62ccff;};'use strict';var client=require(_0x3984('0x0'));exports[_0x3984('0x1')]=function(_0xa3b0db){return client[_0x3984('0x2')](_0x3984('0x3'),{'body':_0xa3b0db,'log':_0x3984('0x4')});}; \ No newline at end of file +var _0x7229=['../client','create','Request'];(function(_0x2a98c9,_0xe52f36){var _0x4c57b2=function(_0x55dc4b){while(--_0x55dc4b){_0x2a98c9['push'](_0x2a98c9['shift']());}};_0x4c57b2(++_0xe52f36);}(_0x7229,0x129));var _0x9722=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7229[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0x9722('0x0'));exports[_0x9722('0x1')]=function(_0x4a5330){return client[_0x9722('0x2')]('CreateWhatsappMessage',{'body':_0x4a5330,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b07015d..590698e 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 _0x0883=['name','timeout','strategy','User','Agents','whatsappPause','getWhatsappQueues','GetWhatsappQueue'];(function(_0x5cd054,_0x2d3b5d){var _0x5a9331=function(_0x2b2a0b){while(--_0x2b2a0b){_0x5cd054['push'](_0x5cd054['shift']());}};_0x5a9331(++_0x2d3b5d);}(_0x0883,0x17e));var _0x3088=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x0883[_0x1573ea];return _0x51c0e2;};'use strict';var client=require('../client');exports[_0x3088('0x0')]=function(){return function(){return client['Request'](_0x3088('0x1'),{'options':{'raw':![],'attributes':['id',_0x3088('0x2'),_0x3088('0x3'),_0x3088('0x4')],'include':[{'model':_0x3088('0x5'),'as':_0x3088('0x6'),'attributes':['id',_0x3088('0x2'),'online',_0x3088('0x7')]}]},'log':_0x3088('0x0')});};}; \ No newline at end of file +var _0x8a47=['name','timeout','strategy','User','Agents','online','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x1b873e,_0x5e977b){var _0x55f303=function(_0x273afd){while(--_0x273afd){_0x1b873e['push'](_0x1b873e['shift']());}};_0x55f303(++_0x5e977b);}(_0x8a47,0x84));var _0x78a4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8a47[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x78a4('0x0'));exports[_0x78a4('0x1')]=function(){return function(){return client['Request'](_0x78a4('0x2'),{'options':{'raw':![],'attributes':['id',_0x78a4('0x3'),_0x78a4('0x4'),_0x78a4('0x5')],'include':[{'model':_0x78a4('0x6'),'as':_0x78a4('0x7'),'attributes':['id','name',_0x78a4('0x8'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 88065db..233b240 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 _0x5342=['DESC','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x295cc9,_0x56f389){var _0x2a1858=function(_0x5816eb){while(--_0x5816eb){_0x295cc9['push'](_0x295cc9['shift']());}};_0x2a1858(++_0x56f389);}(_0x5342,0xaf));var _0x2534=function(_0xd04611,_0x6f7365){_0xd04611=_0xd04611-0x0;var _0x72e2db=_0x5342[_0xd04611];return _0x72e2db;};'use strict';var client=require('../client');exports[_0x2534('0x0')]=function(_0x556c22){return client[_0x2534('0x1')](_0x2534('0x2'),{'body':_0x556c22,'log':'CreateWhatsappQueueReport'});};exports[_0x2534('0x3')]=function(_0x4a4052,_0x4e11e7){return client[_0x2534('0x1')](_0x2534('0x4'),{'body':_0x4e11e7,'options':{'where':{'uniqueid':_0x4a4052},'order':[['id',_0x2534('0x5')]],'limit':0x1},'log':_0x2534('0x4')});}; \ No newline at end of file +var _0xd74d=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xd74d,0xa5));var _0xdd74=function(_0x2163ee,_0x2ba563){_0x2163ee=_0x2163ee-0x0;var _0x10ca0b=_0xd74d[_0x2163ee];return _0x10ca0b;};'use strict';var client=require(_0xdd74('0x0'));exports[_0xdd74('0x1')]=function(_0x11a41b){return client[_0xdd74('0x2')](_0xdd74('0x3'),{'body':_0x11a41b,'log':_0xdd74('0x3')});};exports['update']=function(_0x464250,_0x3a7b93){return client[_0xdd74('0x2')](_0xdd74('0x4'),{'body':_0x3a7b93,'options':{'where':{'uniqueid':_0x464250},'order':[['id',_0xdd74('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 091fe16..8bf5a04 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 _0x7b3a=['info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','join','stop','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number'];(function(_0x3f84aa,_0x14c188){var _0x411c06=function(_0x558f2f){while(--_0x558f2f){_0x3f84aa['push'](_0x3f84aa['shift']());}};_0x411c06(++_0x14c188);}(_0x7b3a,0xaa));var _0xa7b3=function(_0x326c94,_0x3b4ad){_0x326c94=_0x326c94-0x0;var _0x480d71=_0x7b3a[_0x326c94];return _0x480d71;};'use strict';var schema=require(_0xa7b3('0x0'));var _=require('lodash');var util=require(_0xa7b3('0x1'));var seqqueue=require(_0xa7b3('0x2'));var logger=require(_0xa7b3('0x3'))(_0xa7b3('0x4'));var strategy=require(_0xa7b3('0x5'));var queue=schema({'name':{'type':_0xa7b3('0x6'),'required':!![],'message':_0xa7b3('0x7')},'timeout':{'type':_0xa7b3('0x8'),'message':_0xa7b3('0x9')}});function writeLog(_0x326b33,_0x453953,_0x411723){return logger[_0xa7b3('0xa')](util[_0xa7b3('0xb')](_0xa7b3('0xc'),_0x326b33,_0x453953['name'],_0x411723));}function handleFindAgent(_0x3eff28){return function(_0x52deea){return _0x52deea[_0xa7b3('0xd')][_0xa7b3('0xe')]()===_0x3eff28[_0xa7b3('0xe')]();};}exports[_0xa7b3('0xf')]=function(_0x1e1237,_0x19714b,_0x3d0d09,_0x3d10a9){return function(_0x4f69c2){try{var _0x36b8a6={'name':_0x19714b[0x0],'timeout':_0x19714b[0x1]};var _0x364436=queue[_0xa7b3('0x0')](_0x36b8a6,{'typecast':!![]});if(_0x364436[_0xa7b3('0x10')]){logger[_0xa7b3('0x11')]('[%s][AGENT]\x20%s',_0x1e1237,_[_0xa7b3('0x12')](_0x364436,'message')[_0xa7b3('0x13')](',\x20'));_0x4f69c2[_0xa7b3('0x14')]();}else{var _0x4ffb46=_['find'](_0x3d0d09['agents'],handleFindAgent(_0x36b8a6['name']));if(_0x4ffb46){var _0x32d353=(_0x36b8a6[_0xa7b3('0x15')]||0xa)*0x3e8;var _0x351fa6,_0x27f63d;var _0x155529=seqqueue[_0xa7b3('0x16')](_0x32d353);_0x155529['id']=_0x1e1237;_0x155529[_0xa7b3('0x17')]=_0x32d353;_0x155529[_0xa7b3('0x18')]=_0x3d10a9['channel'];writeLog(_0x1e1237,_0x4ffb46,util[_0xa7b3('0xb')]('START:%s',_0x32d353));_0x3d0d09[_0xa7b3('0x19')][_0x1e1237]['on'](_0xa7b3('0x1a'),function(){logger['info'](_0xa7b3('0x1b'),_0x1e1237);clearTimeout(_0x27f63d);_0x27f63d=undefined;_0x155529['close']();if(_0x3d0d09['rules'][_0x1e1237]){delete _0x3d0d09[_0xa7b3('0x19')][_0x1e1237];}_0x4f69c2[_0xa7b3('0x14')]();});_0x3d0d09[_0xa7b3('0x19')][_0x1e1237]['on'](_0xa7b3('0x1c'),function(){if(_0x3d0d09['rules'][_0x1e1237]){delete _0x3d0d09['rules'][_0x1e1237];}});_0x27f63d=setTimeout(function(){logger['info'](_0xa7b3('0x1d'),_0x1e1237);clearTimeout(_0x27f63d);_0x155529['close']();_0x4f69c2[_0xa7b3('0x1e')]();},_0x32d353);strategy[_0xa7b3('0x1f')](_0x155529,_0x4ffb46,_0x3d0d09,_0x3d10a9);}else{logger[_0xa7b3('0x11')](_0xa7b3('0x20'),_0x1e1237,_0x36b8a6['name']);_0x4f69c2[_0xa7b3('0x14')]();}}}catch(_0x2f3b35){console[_0xa7b3('0x21')](_0x2f3b35);logger['error'](_0xa7b3('0x22'),_0x1e1237,_0x2f3b35[_0xa7b3('0x23')]);_0x4f69c2[_0xa7b3('0x14')]();}};}; \ No newline at end of file +var _0x7789=['rules','end','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','channel'];(function(_0x9a2d83,_0x41def8){var _0x5837a1=function(_0x48183c){while(--_0x48183c){_0x9a2d83['push'](_0x9a2d83['shift']());}};_0x5837a1(++_0x41def8);}(_0x7789,0x100));var _0x9778=function(_0x383075,_0x3e254a){_0x383075=_0x383075-0x0;var _0x4a24d9=_0x7789[_0x383075];return _0x4a24d9;};'use strict';var schema=require(_0x9778('0x0'));var _=require(_0x9778('0x1'));var util=require(_0x9778('0x2'));var seqqueue=require(_0x9778('0x3'));var logger=require(_0x9778('0x4'))(_0x9778('0x5'));var strategy=require(_0x9778('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x9778('0x7')},'timeout':{'type':'number','message':_0x9778('0x8')}});function writeLog(_0x5b3a1a,_0x2b50fe,_0x39768f){return logger[_0x9778('0x9')](util[_0x9778('0xa')](_0x9778('0xb'),_0x5b3a1a,_0x2b50fe[_0x9778('0xc')],_0x39768f));}function handleFindAgent(_0x260d0e){return function(_0x30abcf){return _0x30abcf['name'][_0x9778('0xd')]()===_0x260d0e['toLowerCase']();};}exports[_0x9778('0xe')]=function(_0x5bab89,_0x5e8e32,_0x2feb21,_0x1be1b4){return function(_0x5caea0){try{var _0x1dc4e1={'name':_0x5e8e32[0x0],'timeout':_0x5e8e32[0x1]};var _0x5cee2b=queue[_0x9778('0x0')](_0x1dc4e1,{'typecast':!![]});if(_0x5cee2b['length']){logger['error'](_0x9778('0xf'),_0x5bab89,_[_0x9778('0x10')](_0x5cee2b,_0x9778('0x11'))[_0x9778('0x12')](',\x20'));_0x5caea0[_0x9778('0x13')]();}else{var _0x56c6ce=_[_0x9778('0x14')](_0x2feb21[_0x9778('0x15')],handleFindAgent(_0x1dc4e1[_0x9778('0xc')]));if(_0x56c6ce){var _0x467512=(_0x1dc4e1['timeout']||0xa)*0x3e8;var _0x55952f,_0x3747b8;var _0x274a95=seqqueue['createQueue'](_0x467512);_0x274a95['id']=_0x5bab89;_0x274a95['atimeout']=_0x467512;_0x274a95[_0x9778('0x16')]=_0x1be1b4['channel'];writeLog(_0x5bab89,_0x56c6ce,util[_0x9778('0xa')]('START:%s',_0x467512));_0x2feb21[_0x9778('0x17')][_0x5bab89]['on'](_0x9778('0x18'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5bab89);clearTimeout(_0x3747b8);_0x3747b8=undefined;_0x274a95[_0x9778('0x19')]();if(_0x2feb21[_0x9778('0x17')][_0x5bab89]){delete _0x2feb21[_0x9778('0x17')][_0x5bab89];}_0x5caea0[_0x9778('0x13')]();});_0x2feb21[_0x9778('0x17')][_0x5bab89]['on']('complete',function(){if(_0x2feb21[_0x9778('0x17')][_0x5bab89]){delete _0x2feb21[_0x9778('0x17')][_0x5bab89];}});_0x3747b8=setTimeout(function(){logger[_0x9778('0x9')](_0x9778('0x1a'),_0x5bab89);clearTimeout(_0x3747b8);_0x274a95[_0x9778('0x19')]();_0x5caea0[_0x9778('0x1b')]();},_0x467512);strategy[_0x9778('0x1c')](_0x274a95,_0x56c6ce,_0x2feb21,_0x1be1b4);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5bab89,_0x1dc4e1[_0x9778('0xc')]);_0x5caea0['stop']();}}}catch(_0x28c5ae){console[_0x9778('0x1d')](_0x28c5ae);logger['error'](_0x9778('0x1e'),_0x5bab89,_0x28c5ae['stack']);_0x5caea0[_0x9778('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index b800fa6..fe12aae 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 _0x1eb0=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','postText','error','amazonlex','providerName','providerResponse','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','body','getMustacheRender','Message','then','info'];(function(_0x5cf793,_0xb09bc1){var _0x4e5066=function(_0x384ac7){while(--_0x384ac7){_0x5cf793['push'](_0x5cf793['shift']());}};_0x4e5066(++_0xb09bc1);}(_0x1eb0,0x1c7));var _0x01eb=function(_0x4c0926,_0x178dc2){_0x4c0926=_0x4c0926-0x0;var _0x5b76f5=_0x1eb0[_0x4c0926];return _0x5b76f5;};'use strict';var _=require(_0x01eb('0x0'));var moment=require(_0x01eb('0x1'));var AWS=require(_0x01eb('0x2'));var utils=require(_0x01eb('0x3'));var logger=require(_0x01eb('0x4'))('routing');var rpc={'chatMessage':require(_0x01eb('0x5')),'openchannelMessage':require(_0x01eb('0x6')),'mailMessage':require(_0x01eb('0x7')),'smsMessage':require(_0x01eb('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x01eb('0x9'))};exports[_0x01eb('0xa')]=function(_0x29e1ba,_0x520354){return function(_0x12386a){try{if(!_[_0x01eb('0xb')](this['interaction'][_0x01eb('0xc')])){logger['info'](_0x01eb('0xd'),_0x29e1ba,_0x01eb('0xe'));return _0x12386a[_0x01eb('0xf')]();}var _0x2f4647={'ContactId':this[_0x01eb('0x10')]['id'],'sentAt':moment()[_0x01eb('0x11')](_0x01eb('0x12')),'direction':'out'};if(this[_0x01eb('0x13')]===_0x01eb('0x14')||this['channel']===_0x01eb('0x15')){_0x2f4647['phone']=this[_0x01eb('0x16')][_0x01eb('0x17')];}var _0x2f3e15=this[_0x01eb('0x13')];if(_0x2f3e15===_0x01eb('0x18')){_0x2f4647[_0x01eb('0x19')]=this[_0x01eb('0x1a')]['id'];}else{_0x2f4647[_[_0x01eb('0x1b')](_0x2f3e15)+_0x01eb('0x1c')]=this[_0x01eb('0x1a')]['id'];}_0x2f4647[_[_0x01eb('0x1b')](_0x2f3e15)+'InteractionId']=this[_0x01eb('0x16')]['id'];if(this[_0x01eb('0x16')][_0x01eb('0x1d')]){var _0x116b61=_0x520354[0x4];if(!_['isEmpty'](_0x116b61)){_0x2f4647[_0x01eb('0x1e')]=utils[_0x01eb('0x1f')](_0x116b61,this);return rpc[_0x2f3e15+_0x01eb('0x20')]['create'](_0x2f4647)[_0x01eb('0x21')](function(_0x11ce1b){logger[_0x01eb('0x22')]('[%s][AMAZONLEX]\x20%s',_0x29e1ba,_0x2f4647['body']);})['catch'](function(_0x1e89dd){logger['error'](_0x01eb('0xd'),_0x29e1ba,JSON[_0x01eb('0x23')](_0x1e89dd));})[_0x01eb('0x24')](function(){logger[_0x01eb('0x22')](_0x01eb('0x25'),_0x29e1ba);_0x12386a[_0x01eb('0x26')]();});}else{logger[_0x01eb('0x22')](_0x01eb('0x27'),_0x29e1ba);_0x12386a[_0x01eb('0x26')]();}}else{var _0x538596=this;var _0x58b778=new AWS[(_0x01eb('0x28'))]({'accessKeyId':_0x520354[0x0],'secretAccessKey':_0x520354[0x1],'region':_0x520354[0x2]});var _0x5dbfcf={'botAlias':'$LATEST','botName':_0x520354[0x3],'inputText':this[_0x01eb('0x29')][_0x01eb('0x1e')],'userId':this[_0x01eb('0x13')]+':'+this['interaction']['id']['toString']()};_0x58b778[_0x01eb('0x2a')](_0x5dbfcf,function(_0x3bc096,_0x4b7711){if(_0x3bc096){logger[_0x01eb('0x2b')](_0x01eb('0xd'),_0x29e1ba,_0x3bc096[_0x01eb('0x29')]);_0x12386a[_0x01eb('0xf')]();}else if(_0x4b7711&&_0x4b7711[_0x01eb('0x29')]){_0x538596[_0x01eb('0x1e')][_0x01eb('0x2c')]=_0x4b7711;_0x2f4647[_0x01eb('0x1e')]=_0x4b7711[_0x01eb('0x29')];_0x2f4647[_0x01eb('0x2d')]=_0x01eb('0x2c');_0x2f4647[_0x01eb('0x2e')]=JSON['stringify'](_0x4b7711);return rpc[_0x2f3e15+_0x01eb('0x20')]['create'](_0x2f4647)[_0x01eb('0x21')](function(_0x486178){logger[_0x01eb('0x22')](_0x01eb('0xd'),_0x29e1ba,_0x2f4647['body']);if(_0x4b7711['dialogState']==_0x01eb('0x2f')){_0x12386a['next']();}else{_0x12386a['stop']();}})[_0x01eb('0x30')](function(_0x150d7e){logger['error']('[%s][AMAZONLEX]\x20%s',_0x29e1ba,JSON[_0x01eb('0x23')](_0x150d7e));_0x12386a[_0x01eb('0xf')]();});}else{_0x12386a[_0x01eb('0xf')]();}});}}catch(_0x19a6ef){logger[_0x01eb('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x29e1ba,JSON['stringify'](_0x19a6ef));_0x12386a[_0x01eb('0x26')]();}};}; \ No newline at end of file +var _0x4b3d=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone'];(function(_0x17fb0d,_0x13ac73){var _0x283dcc=function(_0xca4851){while(--_0xca4851){_0x17fb0d['push'](_0x17fb0d['shift']());}};_0x283dcc(++_0x13ac73);}(_0x4b3d,0xe2));var _0xd4b3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4b3d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xd4b3('0x0'));var moment=require(_0xd4b3('0x1'));var AWS=require(_0xd4b3('0x2'));var utils=require(_0xd4b3('0x3'));var logger=require(_0xd4b3('0x4'))(_0xd4b3('0x5'));var rpc={'chatMessage':require(_0xd4b3('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd4b3('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd4b3('0x8')),'whatsappMessage':require(_0xd4b3('0x9'))};exports[_0xd4b3('0xa')]=function(_0x1d3e2d,_0x457333){return function(_0x34d205){try{if(!_['isNil'](this[_0xd4b3('0xb')][_0xd4b3('0xc')])){logger[_0xd4b3('0xd')](_0xd4b3('0xe'),_0x1d3e2d,_0xd4b3('0xf'));return _0x34d205[_0xd4b3('0x10')]();}var _0x4f8634={'ContactId':this[_0xd4b3('0x11')]['id'],'sentAt':moment()[_0xd4b3('0x12')](_0xd4b3('0x13')),'direction':'out'};if(this[_0xd4b3('0x14')]===_0xd4b3('0x15')||this[_0xd4b3('0x14')]===_0xd4b3('0x16')){_0x4f8634[_0xd4b3('0x17')]=this[_0xd4b3('0xb')][_0xd4b3('0x17')];}var _0x3bc72a=this['channel'];if(_0x3bc72a==='chat'){_0x4f8634[_0xd4b3('0x18')]=this[_0xd4b3('0x19')]['id'];}else{_0x4f8634[_[_0xd4b3('0x1a')](_0x3bc72a)+_0xd4b3('0x1b')]=this[_0xd4b3('0x19')]['id'];}_0x4f8634[_[_0xd4b3('0x1a')](_0x3bc72a)+_0xd4b3('0x1c')]=this[_0xd4b3('0xb')]['id'];if(this[_0xd4b3('0xb')][_0xd4b3('0x1d')]){var _0x3be0ef=_0x457333[0x4];if(!_['isEmpty'](_0x3be0ef)){_0x4f8634[_0xd4b3('0x1e')]=utils[_0xd4b3('0x1f')](_0x3be0ef,this);return rpc[_0x3bc72a+_0xd4b3('0x20')][_0xd4b3('0x21')](_0x4f8634)['then'](function(_0x40329e){logger[_0xd4b3('0xd')]('[%s][AMAZONLEX]\x20%s',_0x1d3e2d,_0x4f8634[_0xd4b3('0x1e')]);})[_0xd4b3('0x22')](function(_0x2e2eba){logger[_0xd4b3('0x23')]('[%s][AMAZONLEX]\x20%s',_0x1d3e2d,JSON[_0xd4b3('0x24')](_0x2e2eba));})['finally'](function(){logger[_0xd4b3('0xd')](_0xd4b3('0x25'),_0x1d3e2d);_0x34d205[_0xd4b3('0x26')]();});}else{logger['info'](_0xd4b3('0x27'),_0x1d3e2d);_0x34d205[_0xd4b3('0x26')]();}}else{var _0xb7ce66=this;var _0x54a54e=new AWS['LexRuntime']({'accessKeyId':_0x457333[0x0],'secretAccessKey':_0x457333[0x1],'region':_0x457333[0x2]});var _0x24e5ff={'botAlias':_0xd4b3('0x28'),'botName':_0x457333[0x3],'inputText':this[_0xd4b3('0x29')]['body'],'userId':this[_0xd4b3('0x14')]+':'+this['interaction']['id'][_0xd4b3('0x2a')]()};_0x54a54e[_0xd4b3('0x2b')](_0x24e5ff,function(_0x1cafa7,_0x2820fb){if(_0x1cafa7){logger[_0xd4b3('0x23')]('[%s][AMAZONLEX]\x20%s',_0x1d3e2d,_0x1cafa7[_0xd4b3('0x29')]);_0x34d205[_0xd4b3('0x10')]();}else if(_0x2820fb&&_0x2820fb[_0xd4b3('0x29')]){_0xb7ce66[_0xd4b3('0x1e')][_0xd4b3('0x2c')]=_0x2820fb;_0x4f8634[_0xd4b3('0x1e')]=_0x2820fb[_0xd4b3('0x29')];_0x4f8634[_0xd4b3('0x2d')]='amazonlex';_0x4f8634[_0xd4b3('0x2e')]=JSON[_0xd4b3('0x24')](_0x2820fb);return rpc[_0x3bc72a+_0xd4b3('0x20')]['create'](_0x4f8634)[_0xd4b3('0x2f')](function(_0x35d9df){logger[_0xd4b3('0xd')](_0xd4b3('0xe'),_0x1d3e2d,_0x4f8634['body']);if(_0x2820fb[_0xd4b3('0x30')]==_0xd4b3('0x31')){_0x34d205[_0xd4b3('0x10')]();}else{_0x34d205[_0xd4b3('0x26')]();}})[_0xd4b3('0x22')](function(_0x4081d5){logger[_0xd4b3('0x23')](_0xd4b3('0xe'),_0x1d3e2d,JSON[_0xd4b3('0x24')](_0x4081d5));_0x34d205[_0xd4b3('0x10')]();});}else{_0x34d205['next']();}});}}catch(_0xf09d98){logger[_0xd4b3('0x23')](_0xd4b3('0xe'),_0x1d3e2d,JSON[_0xd4b3('0x24')](_0xf09d98));_0x34d205[_0xd4b3('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index b6ff93e..432ca46 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 _0xa0c0=['format','out','channel','body','getMustacheRender','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','AccountId','upperFirst','InteractionId','Message','mail','service','Smtp','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','','','headers','auto_reply','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','[%s][AUTOREPLY]\x20%s','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','update','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','interaction','created','info','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent'];(function(_0x3aa87f,_0x244c7d){var _0x45bfe8=function(_0x1388c0){while(--_0x1388c0){_0x3aa87f['push'](_0x3aa87f['shift']());}};_0x45bfe8(++_0x244c7d);}(_0xa0c0,0x1ef));var _0x0a0c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa0c0[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var moment=require(_0x0a0c('0x0'));var utils=require(_0x0a0c('0x1'));var logger=require(_0x0a0c('0x2'))(_0x0a0c('0x3'));var rpc={'chatMessage':require(_0x0a0c('0x4')),'openchannelMessage':require(_0x0a0c('0x5')),'mailMessage':require(_0x0a0c('0x6')),'smsMessage':require(_0x0a0c('0x7')),'faxMessage':require(_0x0a0c('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x0a0c('0x9')),'openchannelInteraction':require(_0x0a0c('0xa')),'mailInteraction':require(_0x0a0c('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x0a0c('0xc')),'whatsappInteraction':require(_0x0a0c('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x0a0c('0xe')]=function(_0x343c5b,_0x4f94a1){return function(_0x33306c){try{if(_0x4f94a1[0x0]==='1'&&(_['isNil'](this[_0x0a0c('0xf')][_0x0a0c('0x10')])||!this['interaction'][_0x0a0c('0x10')])){logger[_0x0a0c('0x11')]('[%s][AUTOREPLY]\x20%s',_0x343c5b,_0x0a0c('0x12'));return _0x33306c[_0x0a0c('0x13')]();}if(_0x4f94a1[0x0]==='2'&&this[_0x0a0c('0xf')][_0x0a0c('0x14')]){logger[_0x0a0c('0x11')](_0x0a0c('0x15'),_0x343c5b,_0x0a0c('0x16'));return _0x33306c['next']();}var _0x2476b8=this['channel'];var _0x38fec9={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0a0c('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0a0c('0x18')};if(this[_0x0a0c('0x19')]==='mail'){_0x38fec9[_0x0a0c('0x1a')]=utils[_0x0a0c('0x1b')](_0x4f94a1[0x2],this);}else{_0x38fec9['body']=utils[_0x0a0c('0x1b')](_0x4f94a1[0x1],this);}if(this[_0x0a0c('0x1c')]){_0x38fec9['to']=this[_0x0a0c('0x1c')]['from']||'';if(this[_0x0a0c('0x19')]==='mail'&&_0x4f94a1[0x1]==='1'){_0x38fec9['cc']=this[_0x0a0c('0x1c')]['cc']||'';}_0x38fec9['from']=this[_0x0a0c('0x1c')]['to']||'';_0x38fec9[_0x0a0c('0x1d')]=this[_0x0a0c('0x1c')]['phone']||'';_0x38fec9[_0x0a0c('0x1e')]=!![];if(this[_0x0a0c('0x1c')][_0x0a0c('0x1f')]){_0x38fec9['subject']='';_0x38fec9[_0x0a0c('0x1f')]+=_[_0x0a0c('0x20')](this[_0x0a0c('0x1c')]['subject'],_0x0a0c('0x21'))?'':_0x0a0c('0x22');_0x38fec9['subject']+=this['message'][_0x0a0c('0x1f')];}}if(this[_0x0a0c('0x19')]===_0x0a0c('0x23')){_0x38fec9['ChatWebsiteId']=this[_0x0a0c('0x24')]['id'];}else{_0x38fec9[_['upperFirst'](this['channel'])+_0x0a0c('0x25')]=this['account']['id'];}_0x38fec9[_[_0x0a0c('0x26')](this[_0x0a0c('0x19')])+_0x0a0c('0x27')]=this[_0x0a0c('0xf')]['id'];var _0x5bd99e=this[_0x0a0c('0xf')];if(rpc[this[_0x0a0c('0x19')]+_0x0a0c('0x28')]){if(this[_0x0a0c('0x19')]===_0x0a0c('0x29')){var _0x4410e2={'tls':{'rejectUnauthorized':![]}};if(this[_0x0a0c('0x24')]['Smtp'][_0x0a0c('0x2a')]){_0x4410e2['service']=this['account'][_0x0a0c('0x2b')][_0x0a0c('0x2a')];}else{_0x4410e2[_0x0a0c('0x2c')]=this[_0x0a0c('0x24')][_0x0a0c('0x2b')][_0x0a0c('0x2c')];_0x4410e2[_0x0a0c('0x2d')]=this[_0x0a0c('0x24')]['Smtp']['port'];_0x4410e2['secure']=this['account'][_0x0a0c('0x2b')][_0x0a0c('0x2e')];}if(this[_0x0a0c('0x24')][_0x0a0c('0x2b')][_0x0a0c('0x2f')]){_0x4410e2[_0x0a0c('0x30')]={'user':this['account']['Smtp'][_0x0a0c('0x31')],'pass':this[_0x0a0c('0x24')][_0x0a0c('0x2b')][_0x0a0c('0x32')]};}_0x38fec9[_0x0a0c('0x33')]=this[_0x0a0c('0x1c')][_0x0a0c('0x34')];_0x38fec9[_0x0a0c('0x35')]=_0x0a0c('0x36')+_['replace'](_0x38fec9['body'],_0x0a0c('0x37'),_0x0a0c('0x38'))+_0x0a0c('0x39');_0x38fec9[_0x0a0c('0x3a')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0x0a0c('0x3b')};return mailRpc['sendMailMessage'](_0x4410e2,_0x38fec9)['then'](function(_0x156076){logger[_0x0a0c('0x11')](_0x0a0c('0x3c'),_0x343c5b);_0x38fec9['messageId']=_0x156076[_0x0a0c('0x1c')][_0x0a0c('0x34')];return rpc[_0x2476b8+_0x0a0c('0x28')][_0x0a0c('0x3d')](_0x38fec9);})[_0x0a0c('0x3e')](function(_0x27b240){logger[_0x0a0c('0x11')](_0x0a0c('0x3f'),_0x343c5b,JSON['stringify'](_0x27b240));})[_0x0a0c('0x40')](function(_0x22b605){logger[_0x0a0c('0x41')](_0x0a0c('0x42'),_0x343c5b,JSON[_0x0a0c('0x43')](_0x22b605));})[_0x0a0c('0x44')](function(){Promise[_0x0a0c('0x45')]()[_0x0a0c('0x3e')](function(){if(_0x4f94a1[0x0]!=='2'||_0x5bd99e[_0x0a0c('0x14')])return;return rpc[_0x2476b8+'Interaction'][_0x0a0c('0x46')](_0x5bd99e['id'],{'autoreplyExecuted':!![]})[_0x0a0c('0x3e')](function(_0x408999){logger[_0x0a0c('0x11')](_0x0a0c('0x15'),_0x343c5b,JSON['stringify'](_0x408999));})[_0x0a0c('0x40')](function(_0x33a714){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x343c5b,JSON['stringify'](_0x33a714));});})['then'](function(){_0x33306c[_0x0a0c('0x13')]();});});}else{return rpc[this[_0x0a0c('0x19')]+_0x0a0c('0x28')][_0x0a0c('0x3d')](_0x38fec9)[_0x0a0c('0x3e')](function(_0xa2891f){logger[_0x0a0c('0x11')]('[%s][AUTOREPLY]\x20%s',_0x343c5b,_0x38fec9[_0x0a0c('0x1a')]);})[_0x0a0c('0x40')](function(_0x2d69da){logger[_0x0a0c('0x41')](_0x0a0c('0x3f'),_0x343c5b,JSON[_0x0a0c('0x43')](_0x2d69da));})[_0x0a0c('0x44')](function(){Promise['resolve']()[_0x0a0c('0x3e')](function(){if(_0x4f94a1[0x0]!=='2'||_0x5bd99e[_0x0a0c('0x14')])return;return rpc[_0x2476b8+_0x0a0c('0x47')][_0x0a0c('0x46')](_0x5bd99e['id'],{'autoreplyExecuted':!![]})[_0x0a0c('0x3e')](function(_0x3e4c08){logger[_0x0a0c('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x343c5b,JSON[_0x0a0c('0x43')](_0x3e4c08));})[_0x0a0c('0x40')](function(_0x2b71eb){logger['error'](_0x0a0c('0x48'),_0x343c5b,JSON['stringify'](_0x2b71eb));});})[_0x0a0c('0x3e')](function(){_0x33306c['next']();});});}}}catch(_0x2ab11c){logger['error'](_0x0a0c('0x3f'),_0x343c5b,JSON[_0x0a0c('0x43')](_0x2ab11c));_0x33306c[_0x0a0c('0x49')]();}};}; \ No newline at end of file +var _0x87c0=['../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','created','info','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','body','getMustacheRender','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','interaction','Smtp','service','port','secure','authentication','auth','user','pass','messageId','html','','replace','','headers','auto-replied','auto_reply','then','Message','[%s][AUTOREPLY]\x20%s','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','./utils','../../../../config/logger'];(function(_0xd1cf76,_0x1e667d){var _0x580cbf=function(_0x51dc24){while(--_0x51dc24){_0xd1cf76['push'](_0xd1cf76['shift']());}};_0x580cbf(++_0x1e667d);}(_0x87c0,0x152));var _0x087c=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x87c0[_0x2b91c5];return _0xbd5531;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x087c('0x0'));var logger=require(_0x087c('0x1'))('routing');var rpc={'chatMessage':require(_0x087c('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x087c('0x3')),'smsMessage':require(_0x087c('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x087c('0x5')),'chatInteraction':require(_0x087c('0x6')),'openchannelInteraction':require(_0x087c('0x7')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x087c('0x8')),'whatsappInteraction':require(_0x087c('0x9'))};var mailRpc=require('../../mailRpc');exports[_0x087c('0xa')]=function(_0x8c2c7d,_0x491690){return function(_0x2f55b5){try{if(_0x491690[0x0]==='1'&&(_['isNil'](this['interaction'][_0x087c('0xb')])||!this['interaction'][_0x087c('0xb')])){logger[_0x087c('0xc')]('[%s][AUTOREPLY]\x20%s',_0x8c2c7d,_0x087c('0xd'));return _0x2f55b5[_0x087c('0xe')]();}if(_0x491690[0x0]==='2'&&this['interaction'][_0x087c('0xf')]){logger[_0x087c('0xc')](_0x087c('0x10'),_0x8c2c7d,'One\x20Time\x20already\x20sent');return _0x2f55b5[_0x087c('0xe')]();}var _0xa639ed=this[_0x087c('0x11')];var _0x1b8162={'ContactId':this[_0x087c('0x12')]['id'],'sentAt':moment()[_0x087c('0x13')](_0x087c('0x14')),'direction':_0x087c('0x15')};if(this[_0x087c('0x11')]===_0x087c('0x16')){_0x1b8162[_0x087c('0x17')]=utils[_0x087c('0x18')](_0x491690[0x2],this);}else{_0x1b8162[_0x087c('0x17')]=utils['getMustacheRender'](_0x491690[0x1],this);}if(this[_0x087c('0x19')]){_0x1b8162['to']=this['message']['from']||'';if(this[_0x087c('0x11')]===_0x087c('0x16')&&_0x491690[0x1]==='1'){_0x1b8162['cc']=this[_0x087c('0x19')]['cc']||'';}_0x1b8162['from']=this[_0x087c('0x19')]['to']||'';_0x1b8162['phone']=this[_0x087c('0x19')][_0x087c('0x1a')]||'';_0x1b8162[_0x087c('0x1b')]=!![];if(this['message'][_0x087c('0x1c')]){_0x1b8162[_0x087c('0x1c')]='';_0x1b8162[_0x087c('0x1c')]+=_[_0x087c('0x1d')](this[_0x087c('0x19')][_0x087c('0x1c')],_0x087c('0x1e'))?'':_0x087c('0x1f');_0x1b8162[_0x087c('0x1c')]+=this[_0x087c('0x19')]['subject'];}}if(this[_0x087c('0x11')]===_0x087c('0x20')){_0x1b8162['ChatWebsiteId']=this[_0x087c('0x21')]['id'];}else{_0x1b8162[_['upperFirst'](this[_0x087c('0x11')])+'AccountId']=this[_0x087c('0x21')]['id'];}_0x1b8162[_[_0x087c('0x22')](this[_0x087c('0x11')])+'InteractionId']=this[_0x087c('0x23')]['id'];var _0x379bf6=this[_0x087c('0x23')];if(rpc[this[_0x087c('0x11')]+'Message']){if(this[_0x087c('0x11')]===_0x087c('0x16')){var _0x1f3d0c={'tls':{'rejectUnauthorized':![]}};if(this[_0x087c('0x21')][_0x087c('0x24')][_0x087c('0x25')]){_0x1f3d0c[_0x087c('0x25')]=this[_0x087c('0x21')][_0x087c('0x24')][_0x087c('0x25')];}else{_0x1f3d0c['host']=this['account'][_0x087c('0x24')]['host'];_0x1f3d0c['port']=this[_0x087c('0x21')][_0x087c('0x24')][_0x087c('0x26')];_0x1f3d0c[_0x087c('0x27')]=this[_0x087c('0x21')][_0x087c('0x24')][_0x087c('0x27')];}if(this[_0x087c('0x21')][_0x087c('0x24')][_0x087c('0x28')]){_0x1f3d0c[_0x087c('0x29')]={'user':this['account'][_0x087c('0x24')][_0x087c('0x2a')],'pass':this[_0x087c('0x21')][_0x087c('0x24')][_0x087c('0x2b')]};}_0x1b8162['inReplyTo']=this[_0x087c('0x19')][_0x087c('0x2c')];_0x1b8162[_0x087c('0x2d')]=_0x087c('0x2e')+_[_0x087c('0x2f')](_0x1b8162[_0x087c('0x17')],_0x087c('0x30'),_0x087c('0x31'))+_0x087c('0x32');_0x1b8162[_0x087c('0x33')]={'Auto-Submitted':_0x087c('0x34'),'X-Auto-Response-Suppress':'All','Precedence':_0x087c('0x35')};return mailRpc['sendMailMessage'](_0x1f3d0c,_0x1b8162)[_0x087c('0x36')](function(_0x2fc898){logger[_0x087c('0xc')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x8c2c7d);_0x1b8162[_0x087c('0x2c')]=_0x2fc898[_0x087c('0x19')][_0x087c('0x2c')];return rpc[_0xa639ed+_0x087c('0x37')]['create'](_0x1b8162);})[_0x087c('0x36')](function(_0x35386a){logger[_0x087c('0xc')](_0x087c('0x38'),_0x8c2c7d,JSON[_0x087c('0x39')](_0x35386a));})[_0x087c('0x3a')](function(_0x3452d6){logger[_0x087c('0x3b')](_0x087c('0x3c'),_0x8c2c7d,JSON['stringify'](_0x3452d6));})[_0x087c('0x3d')](function(){Promise[_0x087c('0x3e')]()[_0x087c('0x36')](function(){if(_0x491690[0x0]!=='2'||_0x379bf6['autoreplyExecuted'])return;return rpc[_0xa639ed+_0x087c('0x3f')][_0x087c('0x40')](_0x379bf6['id'],{'autoreplyExecuted':!![]})[_0x087c('0x36')](function(_0x57eca0){logger['info'](_0x087c('0x10'),_0x8c2c7d,JSON['stringify'](_0x57eca0));})[_0x087c('0x3a')](function(_0x3f8892){logger[_0x087c('0x3b')](_0x087c('0x41'),_0x8c2c7d,JSON[_0x087c('0x39')](_0x3f8892));});})[_0x087c('0x36')](function(){_0x2f55b5[_0x087c('0xe')]();});});}else{return rpc[this[_0x087c('0x11')]+_0x087c('0x37')][_0x087c('0x42')](_0x1b8162)[_0x087c('0x36')](function(_0x2a1d3b){logger[_0x087c('0xc')](_0x087c('0x38'),_0x8c2c7d,_0x1b8162['body']);})['catch'](function(_0x43a581){logger[_0x087c('0x3b')](_0x087c('0x38'),_0x8c2c7d,JSON[_0x087c('0x39')](_0x43a581));})['finally'](function(){Promise[_0x087c('0x3e')]()[_0x087c('0x36')](function(){if(_0x491690[0x0]!=='2'||_0x379bf6[_0x087c('0xf')])return;return rpc[_0xa639ed+_0x087c('0x3f')][_0x087c('0x40')](_0x379bf6['id'],{'autoreplyExecuted':!![]})[_0x087c('0x36')](function(_0x4a30f6){logger[_0x087c('0xc')](_0x087c('0x10'),_0x8c2c7d,JSON[_0x087c('0x39')](_0x4a30f6));})['catch'](function(_0x3d1254){logger[_0x087c('0x3b')](_0x087c('0x41'),_0x8c2c7d,JSON[_0x087c('0x39')](_0x3d1254));});})[_0x087c('0x36')](function(){_0x2f55b5['next']();});});}}}catch(_0x368cf5){logger[_0x087c('0x3b')](_0x087c('0x38'),_0x8c2c7d,JSON['stringify'](_0x368cf5));_0x2f55b5[_0x087c('0x43')]();}};}; \ 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 89954f1..99a3179 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 _0xdc0d=['../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info','format','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger'];(function(_0x4a8bfd,_0x2849a8){var _0x562bd9=function(_0x1c21c5){while(--_0x1c21c5){_0x4a8bfd['push'](_0x4a8bfd['shift']());}};_0x562bd9(++_0x2849a8);}(_0xdc0d,0x1e1));var _0xddc0=function(_0x250b9e,_0x26614d){_0x250b9e=_0x250b9e-0x0;var _0x36c5a3=_0xdc0d[_0x250b9e];return _0x36c5a3;};'use strict';var moment=require(_0xddc0('0x0'));var logger=require(_0xddc0('0x1'))('routing');var rpc={'chatInteraction':require(_0xddc0('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xddc0('0x3')),'mailInteraction':require(_0xddc0('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xddc0('0x5'))};exports['consequence']=function(_0x1a18a9,_0xed599,_0x520391,_0x1cd157){return function(_0x12d358){try{logger[_0xddc0('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x1a18a9,_0xed599[0x0]);var _0x5e6899={'closed':0x1,'closedAt':moment()[_0xddc0('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xddc0('0x8'),'disposition':_0xed599[0x0]};if(rpc[_0x1cd157[_0xddc0('0x9')]+'Interaction']){rpc[_0x1cd157[_0xddc0('0x9')]+_0xddc0('0xa')][_0xddc0('0xb')](_0x1cd157[_0xddc0('0xc')]['id'],_0x5e6899)[_0xddc0('0xd')](function(_0x16c054){logger[_0xddc0('0x6')](_0xddc0('0xe'),_0x1a18a9,_0x1cd157[_0xddc0('0xc')]['id']);})[_0xddc0('0xf')](function(_0x4155d8){logger[_0xddc0('0x10')](_0xddc0('0x11'),_0x1a18a9,JSON['stringify'](_0x4155d8));})[_0xddc0('0x12')](function(){_0x12d358[_0xddc0('0x13')]();});}}catch(_0x123020){logger[_0xddc0('0x10')](_0xddc0('0x11'),_0x1a18a9,JSON[_0xddc0('0x14')](_0x123020));_0x12d358[_0xddc0('0x13')]();}};}; \ No newline at end of file +var _0x5d4d=['Interaction','interaction','then','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel'];(function(_0x3c50e9,_0x7c6eae){var _0x3aaf46=function(_0x534f5c){while(--_0x534f5c){_0x3c50e9['push'](_0x3c50e9['shift']());}};_0x3aaf46(++_0x7c6eae);}(_0x5d4d,0x99));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xd5d4('0x0'));var logger=require(_0xd5d4('0x1'))(_0xd5d4('0x2'));var rpc={'chatInteraction':require(_0xd5d4('0x3')),'openchannelInteraction':require(_0xd5d4('0x4')),'smsInteraction':require(_0xd5d4('0x5')),'mailInteraction':require(_0xd5d4('0x6')),'faxInteraction':require(_0xd5d4('0x7')),'whatsappInteraction':require(_0xd5d4('0x8'))};exports[_0xd5d4('0x9')]=function(_0x3619e4,_0x15b7db,_0x193c96,_0x1ab142){return function(_0x1b9f3c){try{logger[_0xd5d4('0xa')](_0xd5d4('0xb'),_0x3619e4,_0x15b7db[0x0]);var _0xe58cb4={'closed':0x1,'closedAt':moment()[_0xd5d4('0xc')](_0xd5d4('0xd')),'closeReason':'system','disposition':_0x15b7db[0x0]};if(rpc[_0x1ab142[_0xd5d4('0xe')]+_0xd5d4('0xf')]){rpc[_0x1ab142['channel']+_0xd5d4('0xf')]['update'](_0x1ab142[_0xd5d4('0x10')]['id'],_0xe58cb4)[_0xd5d4('0x11')](function(_0x5dcec1){logger[_0xd5d4('0xa')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x3619e4,_0x1ab142[_0xd5d4('0x10')]['id']);})[_0xd5d4('0x12')](function(_0x83c0ab){logger['error'](_0xd5d4('0x13'),_0x3619e4,JSON[_0xd5d4('0x14')](_0x83c0ab));})[_0xd5d4('0x15')](function(){_0x1b9f3c[_0xd5d4('0x16')]();});}}catch(_0x36be37){logger[_0xd5d4('0x17')](_0xd5d4('0x13'),_0x3619e4,JSON[_0xd5d4('0x14')](_0x36be37));_0x1b9f3c[_0xd5d4('0x16')]();}};}; \ 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 1320b14..3024fd3 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 _0x2aa3=['created','isEmpty','body','getMustacheRender','then','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','Message','create','endConversation','next','lodash','moment','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId'];(function(_0x4f2894,_0xea7920){var _0x18f54f=function(_0x4970e8){while(--_0x4970e8){_0x4f2894['push'](_0x4f2894['shift']());}};_0x18f54f(++_0xea7920);}(_0x2aa3,0x83));var _0x32aa=function(_0x461f55,_0x23a3f8){_0x461f55=_0x461f55-0x0;var _0x2bd9fa=_0x2aa3[_0x461f55];return _0x2bd9fa;};'use strict';var _=require(_0x32aa('0x0'));var moment=require(_0x32aa('0x1'));var apiai=require(_0x32aa('0x2'));var md5=require(_0x32aa('0x3'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x32aa('0x4'));var rpc={'chatMessage':require(_0x32aa('0x5')),'openchannelMessage':require(_0x32aa('0x6')),'mailMessage':require(_0x32aa('0x7')),'smsMessage':require(_0x32aa('0x8')),'faxMessage':require(_0x32aa('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x32aa('0xa')]=function(_0x112396,_0x3ee18a){return function(_0x20efbe){try{if(!_[_0x32aa('0xb')](this[_0x32aa('0xc')][_0x32aa('0xd')])){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x32aa('0xf'));return _0x20efbe['next']();}var _0x3d61ee={'ContactId':this[_0x32aa('0x10')]['id'],'sentAt':moment()[_0x32aa('0x11')](_0x32aa('0x12')),'direction':'out'};if(this[_0x32aa('0x13')]===_0x32aa('0x14')||this[_0x32aa('0x13')]==='whatsapp'){_0x3d61ee[_0x32aa('0x15')]=this[_0x32aa('0xc')][_0x32aa('0x15')];}var _0x22c07a=this[_0x32aa('0x13')];if(_0x22c07a===_0x32aa('0x16')){_0x3d61ee[_0x32aa('0x17')]=this[_0x32aa('0x18')]['id'];}else{_0x3d61ee[_['upperFirst'](_0x22c07a)+_0x32aa('0x19')]=this[_0x32aa('0x18')]['id'];}_0x3d61ee[_[_0x32aa('0x1a')](_0x22c07a)+_0x32aa('0x1b')]=this[_0x32aa('0xc')]['id'];if(this['interaction'][_0x32aa('0x1c')]){var _0x251fa4=_0x3ee18a[0x2];if(!_[_0x32aa('0x1d')](_0x251fa4)){_0x3d61ee[_0x32aa('0x1e')]=utils[_0x32aa('0x1f')](_0x251fa4,this);return rpc[_0x22c07a+'Message']['create'](_0x3d61ee)[_0x32aa('0x20')](function(_0x34dcaf){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x3d61ee['body']);})[_0x32aa('0x21')](function(_0x148255){logger[_0x32aa('0x22')](_0x32aa('0x23'),_0x112396,JSON[_0x32aa('0x24')](_0x148255));})[_0x32aa('0x25')](function(){logger['info'](_0x32aa('0x26'),_0x112396);_0x20efbe[_0x32aa('0x27')]();});}else{logger[_0x32aa('0xe')](_0x32aa('0x28'),_0x112396);_0x20efbe[_0x32aa('0x27')]();}}else{var _0x90d165=this;var _0x1ce405=apiai(_0x3ee18a[0x0],{'language':_0x3ee18a[0x1]||'en'});return _0x1ce405[_0x32aa('0x29')](this[_0x32aa('0x2a')]['body'],{'sessionId':md5(this[_0x32aa('0xc')]['id'])})['then'](function(_0x6766da){_0x90d165[_0x32aa('0x1e')]['dialogflow']=_0x6766da;_0x3d61ee['body']=_0x6766da[_0x32aa('0x2b')][_0x32aa('0x2c')][_0x32aa('0x2d')];_0x3d61ee[_0x32aa('0x2e')]=_0x32aa('0x2f');_0x3d61ee[_0x32aa('0x30')]=JSON[_0x32aa('0x24')](_0x6766da);return rpc[_0x22c07a+_0x32aa('0x31')][_0x32aa('0x32')](_0x3d61ee)['then'](function(_0x128774){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x3d61ee[_0x32aa('0x1e')]);if(_0x6766da['result']['metadata'][_0x32aa('0x33')]){_0x20efbe[_0x32aa('0x34')]();}else{_0x20efbe[_0x32aa('0x27')]();}})[_0x32aa('0x21')](function(_0x5903b8){logger[_0x32aa('0x22')](_0x32aa('0x23'),_0x112396,JSON[_0x32aa('0x24')](_0x5903b8));_0x20efbe[_0x32aa('0x34')]();});})[_0x32aa('0x21')](function(_0x44887c){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x44887c[_0x32aa('0x2a')]);_0x20efbe[_0x32aa('0x34')]();});}}catch(_0x136893){logger[_0x32aa('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x112396,JSON['stringify'](_0x136893));_0x20efbe[_0x32aa('0x27')]();}};}; \ No newline at end of file +var _0xc7a3=['../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','next','format','out','sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment','providerName','providerResponse','metadata','endConversation','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage'];(function(_0x459ded,_0x12684f){var _0x5f1777=function(_0x4b2b38){while(--_0x4b2b38){_0x459ded['push'](_0x459ded['shift']());}};_0x5f1777(++_0x12684f);}(_0xc7a3,0xbd));var _0x3c7a=function(_0xbb899e,_0x4d4552){_0xbb899e=_0xbb899e-0x0;var _0x34275a=_0xc7a3[_0xbb899e];return _0x34275a;};'use strict';var _=require('lodash');var moment=require(_0x3c7a('0x0'));var apiai=require(_0x3c7a('0x1'));var md5=require(_0x3c7a('0x2'));var utils=require(_0x3c7a('0x3'));var logger=require(_0x3c7a('0x4'))(_0x3c7a('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3c7a('0x6')),'mailMessage':require(_0x3c7a('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3c7a('0x8')),'whatsappMessage':require(_0x3c7a('0x9'))};exports[_0x3c7a('0xa')]=function(_0x48e820,_0x115c8a){return function(_0x4f0608){try{if(!_[_0x3c7a('0xb')](this['interaction'][_0x3c7a('0xc')])){logger[_0x3c7a('0xd')](_0x3c7a('0xe'),_0x48e820,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4f0608[_0x3c7a('0xf')]();}var _0x314593={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3c7a('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3c7a('0x11')};if(this['channel']===_0x3c7a('0x12')||this[_0x3c7a('0x13')]===_0x3c7a('0x14')){_0x314593[_0x3c7a('0x15')]=this[_0x3c7a('0x16')]['phone'];}var _0x321e1b=this[_0x3c7a('0x13')];if(_0x321e1b===_0x3c7a('0x17')){_0x314593[_0x3c7a('0x18')]=this[_0x3c7a('0x19')]['id'];}else{_0x314593[_['upperFirst'](_0x321e1b)+_0x3c7a('0x1a')]=this[_0x3c7a('0x19')]['id'];}_0x314593[_['upperFirst'](_0x321e1b)+'InteractionId']=this[_0x3c7a('0x16')]['id'];if(this[_0x3c7a('0x16')][_0x3c7a('0x1b')]){var _0x4d7a8c=_0x115c8a[0x2];if(!_[_0x3c7a('0x1c')](_0x4d7a8c)){_0x314593['body']=utils[_0x3c7a('0x1d')](_0x4d7a8c,this);return rpc[_0x321e1b+_0x3c7a('0x1e')][_0x3c7a('0x1f')](_0x314593)[_0x3c7a('0x20')](function(_0x3cb5bf){logger[_0x3c7a('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x48e820,_0x314593[_0x3c7a('0x21')]);})[_0x3c7a('0x22')](function(_0x3f0024){logger[_0x3c7a('0x23')](_0x3c7a('0xe'),_0x48e820,JSON[_0x3c7a('0x24')](_0x3f0024));})[_0x3c7a('0x25')](function(){logger[_0x3c7a('0xd')](_0x3c7a('0x26'),_0x48e820);_0x4f0608['stop']();});}else{logger[_0x3c7a('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x48e820);_0x4f0608[_0x3c7a('0x27')]();}}else{var _0x557518=this;var _0x40d24e=apiai(_0x115c8a[0x0],{'language':_0x115c8a[0x1]||'en'});return _0x40d24e[_0x3c7a('0x28')](this[_0x3c7a('0x29')][_0x3c7a('0x21')],{'sessionId':md5(this[_0x3c7a('0x16')]['id'])})[_0x3c7a('0x20')](function(_0x8251d4){_0x557518[_0x3c7a('0x21')][_0x3c7a('0x2a')]=_0x8251d4;_0x314593[_0x3c7a('0x21')]=_0x8251d4[_0x3c7a('0x2b')][_0x3c7a('0x2c')]['speech'];_0x314593[_0x3c7a('0x2d')]=_0x3c7a('0x2a');_0x314593[_0x3c7a('0x2e')]=JSON[_0x3c7a('0x24')](_0x8251d4);return rpc[_0x321e1b+_0x3c7a('0x1e')][_0x3c7a('0x1f')](_0x314593)[_0x3c7a('0x20')](function(_0x8f084b){logger['info'](_0x3c7a('0xe'),_0x48e820,_0x314593[_0x3c7a('0x21')]);if(_0x8251d4[_0x3c7a('0x2b')][_0x3c7a('0x2f')][_0x3c7a('0x30')]){_0x4f0608[_0x3c7a('0xf')]();}else{_0x4f0608[_0x3c7a('0x27')]();}})[_0x3c7a('0x22')](function(_0x508d2e){logger[_0x3c7a('0x23')](_0x3c7a('0xe'),_0x48e820,JSON[_0x3c7a('0x24')](_0x508d2e));_0x4f0608[_0x3c7a('0xf')]();});})[_0x3c7a('0x22')](function(_0x2e7c6d){logger[_0x3c7a('0x23')](_0x3c7a('0xe'),_0x48e820,_0x2e7c6d[_0x3c7a('0x29')]);_0x4f0608[_0x3c7a('0xf')]();});}}catch(_0x34331a){logger[_0x3c7a('0x23')](_0x3c7a('0xe'),_0x48e820,JSON['stringify'](_0x34331a));_0x4f0608['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 634e026..6dd369e 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 _0x53a2=['../../rpc/smsMessage','body','Message','create','catch','error','[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','then','info','stringify','finally','stop','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','dialogflow','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x489070,_0x276d54){var _0x388c8f=function(_0x46fe5c){while(--_0x46fe5c){_0x489070['push'](_0x489070['shift']());}};_0x388c8f(++_0x276d54);}(_0x53a2,0x1a7));var _0x253a=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x53a2[_0x4d07cc];return _0x42de3b;};'use strict';var _=require('lodash');var dialogflow=require(_0x253a('0x0'));var md5=require(_0x253a('0x1'));var moment=require('moment');var Promise=require(_0x253a('0x2'));var logger=require(_0x253a('0x3'))(_0x253a('0x4'));var utils=require(_0x253a('0x5'));var rpc={'chatMessage':require(_0x253a('0x6')),'openchannelMessage':require(_0x253a('0x7')),'mailMessage':require(_0x253a('0x8')),'smsMessage':require(_0x253a('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x694f76,_0x42a9f6,_0x23cd36,_0x4f5fc0){return new Promise(function(_0x4a9991,_0x8ca664){var _0x49cfad=_['clone'](_0x23cd36);_0x49cfad[_0x253a('0xa')]=_0x4f5fc0;return rpc[_0x42a9f6+_0x253a('0xb')][_0x253a('0xc')](_0x49cfad)['then'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x694f76,_0x49cfad[_0x253a('0xa')]);_0x4a9991();})[_0x253a('0xd')](function(_0x2f67da){logger[_0x253a('0xe')](_0x253a('0xf'),_0x694f76,JSON['stringify'](_0x2f67da));_0x8ca664(_0x2f67da);});});}exports[_0x253a('0x10')]=function(_0x44043f,_0x21bac5){return function(_0x492e43){try{if(!_[_0x253a('0x11')](this[_0x253a('0x12')][_0x253a('0x13')])){logger['info'](_0x253a('0xf'),_0x44043f,_0x253a('0x14'));return _0x492e43[_0x253a('0x15')]();}var _0x5f30c1={'ContactId':this[_0x253a('0x16')]['id'],'sentAt':moment()[_0x253a('0x17')](_0x253a('0x18')),'direction':_0x253a('0x19')};if(this[_0x253a('0x1a')]===_0x253a('0x1b')||this[_0x253a('0x1a')]===_0x253a('0x1c')){_0x5f30c1[_0x253a('0x1d')]=this[_0x253a('0x12')]['phone'];}var _0x2e9995=this[_0x253a('0x1a')];if(_0x2e9995===_0x253a('0x1e')){_0x5f30c1[_0x253a('0x1f')]=this[_0x253a('0x20')]['id'];}else{_0x5f30c1[_['upperFirst'](_0x2e9995)+'AccountId']=this[_0x253a('0x20')]['id'];}_0x5f30c1[_[_0x253a('0x21')](_0x2e9995)+_0x253a('0x22')]=this[_0x253a('0x12')]['id'];if(this[_0x253a('0x12')][_0x253a('0x23')]){var _0x4c4729=_0x21bac5[0x4];if(!_[_0x253a('0x24')](_0x4c4729)){_0x5f30c1['body']=utils[_0x253a('0x25')](_0x4c4729,this);return rpc[_0x2e9995+'Message'][_0x253a('0xc')](_0x5f30c1)[_0x253a('0x26')](function(_0x5bc011){logger[_0x253a('0x27')](_0x253a('0xf'),_0x44043f,_0x5f30c1[_0x253a('0xa')]);})[_0x253a('0xd')](function(_0x2a74f4){logger[_0x253a('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x44043f,JSON[_0x253a('0x28')](_0x2a74f4));})[_0x253a('0x29')](function(){logger[_0x253a('0x27')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x44043f);_0x492e43[_0x253a('0x2a')]();});}else{logger[_0x253a('0x27')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x44043f);_0x492e43[_0x253a('0x2a')]();}}else{var _0x2fb6bb=this;var _0x119e72=_0x21bac5[0x2]['replace'](/\\n/g,'\x0a');var _0x46a9e2={'credentials':{'private_key':_0x119e72,'client_email':_0x21bac5[0x1]}};var _0x344e78=new dialogflow[(_0x253a('0x2b'))](_0x46a9e2);var _0x52d3cf=_0x344e78[_0x253a('0x2c')](_0x21bac5[0x0],md5(_0x2fb6bb['interaction']['id']));var _0x573730={'session':_0x52d3cf,'queryInput':{'text':{'text':_0x2fb6bb[_0x253a('0x2d')][_0x253a('0xa')],'languageCode':_0x21bac5[0x3]||'en'}}};return _0x344e78[_0x253a('0x2e')](_0x573730)[_0x253a('0x26')](function(_0x1d146d){if(_0x1d146d&&_0x1d146d['length']){_0x2fb6bb[_0x253a('0xa')][_0x253a('0x2f')]=_0x1d146d;var _0x400de8=_0x1d146d[0x0];var _0x4a9284=_0x400de8[_0x253a('0x30')]['diagnosticInfo']&&_0x400de8[_0x253a('0x30')][_0x253a('0x31')][_0x253a('0x32')]?_0x400de8[_0x253a('0x30')][_0x253a('0x31')][_0x253a('0x32')][_0x253a('0x33')][_0x253a('0x34')]:![];_0x2fb6bb['body']['DIALOGFLOWV2_ACTION']=_0x400de8['queryResult'][_0x253a('0x35')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x36')]=_0x400de8[_0x253a('0x30')][_0x253a('0x37')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x38')]=_0x400de8['queryResult'][_0x253a('0x31')]&&_0x400de8[_0x253a('0x30')]['diagnosticInfo'][_0x253a('0x32')]?_0x400de8[_0x253a('0x30')]['diagnosticInfo']['fields'][_0x253a('0x33')][_0x253a('0x34')]:![];_0x2fb6bb['body']['DIALOGFLOWV2_INTENTNAME']=_0x400de8[_0x253a('0x30')]['intent'][_0x253a('0x39')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x3a')]=_0x400de8[_0x253a('0x30')][_0x253a('0x3b')][_0x253a('0x3c')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x3d')]=_0x400de8[_0x253a('0x30')][_0x253a('0x3b')]['isFallback'];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x3e')]=_0x400de8[_0x253a('0x30')][_0x253a('0x3f')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x40')]=_0x400de8[_0x253a('0x30')][_0x253a('0x41')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x42')]=_0x400de8[_0x253a('0x30')][_0x253a('0x43')];_0x5f30c1[_0x253a('0x44')]=_0x253a('0x2f');_0x5f30c1[_0x253a('0x45')]=JSON[_0x253a('0x28')](_0x1d146d);var _0x2dc11a=[];for(var _0x52d95f=0x0;_0x52d95f<_0x1d146d[_0x253a('0x46')];_0x52d95f++){var _0x4cf422=_0x1d146d[_0x52d95f];if(_0x4cf422&&_0x4cf422[_0x253a('0x30')]&&_0x4cf422[_0x253a('0x30')][_0x253a('0x47')]){_0x2dc11a['push'](createMessage(_0x44043f,_0x2e9995,_0x5f30c1,_0x4cf422['queryResult']['fulfillmentText']));}}return Promise['all'](_0x2dc11a)[_0x253a('0x26')](function(){if(_0x4a9284){_0x492e43['next']();}else{_0x492e43[_0x253a('0x2a')]();}})[_0x253a('0xd')](function(_0x3c978b){logger[_0x253a('0xe')](_0x253a('0xf'),_0x44043f,JSON[_0x253a('0x28')](_0x3c978b));_0x492e43[_0x253a('0x15')]();});}})[_0x253a('0xd')](function(_0x1bcc6b){logger[_0x253a('0xe')](_0x253a('0xf'),_0x44043f,_0x1bcc6b[_0x253a('0x2d')]);_0x492e43[_0x253a('0x15')]();});}}catch(_0xd8d092){logger[_0x253a('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x44043f,JSON['stringify'](_0xd8d092));_0x492e43[_0x253a('0x2a')]();}};}; \ No newline at end of file +var _0x1093=['DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','push','all','next','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','body','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty','getMustacheRender','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','intent','name'];(function(_0x5774d1,_0x54e802){var _0x49fa0c=function(_0x5b3c2f){while(--_0x5b3c2f){_0x5774d1['push'](_0x5774d1['shift']());}};_0x49fa0c(++_0x54e802);}(_0x1093,0x1c8));var _0x3109=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x1093[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x3109('0x0'));var dialogflow=require(_0x3109('0x1'));var md5=require(_0x3109('0x2'));var moment=require(_0x3109('0x3'));var Promise=require(_0x3109('0x4'));var logger=require(_0x3109('0x5'))('routing');var utils=require(_0x3109('0x6'));var rpc={'chatMessage':require(_0x3109('0x7')),'openchannelMessage':require(_0x3109('0x8')),'mailMessage':require(_0x3109('0x9')),'smsMessage':require(_0x3109('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x3109('0xb'))};function createMessage(_0x8b1e13,_0x2f7e68,_0x48a6f9,_0x3a1543){return new Promise(function(_0x2fdb78,_0x4e22be){var _0x38e1d7=_[_0x3109('0xc')](_0x48a6f9);_0x38e1d7['body']=_0x3a1543;return rpc[_0x2f7e68+_0x3109('0xd')][_0x3109('0xe')](_0x38e1d7)[_0x3109('0xf')](function(){logger[_0x3109('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x8b1e13,_0x38e1d7[_0x3109('0x11')]);_0x2fdb78();})[_0x3109('0x12')](function(_0x35e069){logger['error'](_0x3109('0x13'),_0x8b1e13,JSON[_0x3109('0x14')](_0x35e069));_0x4e22be(_0x35e069);});});}exports[_0x3109('0x15')]=function(_0x419041,_0x3a7bde){return function(_0x5e6cc7){try{if(!_[_0x3109('0x16')](this[_0x3109('0x17')][_0x3109('0x18')])){logger['info'](_0x3109('0x13'),_0x419041,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5e6cc7['next']();}var _0x3780de={'ContactId':this[_0x3109('0x19')]['id'],'sentAt':moment()[_0x3109('0x1a')](_0x3109('0x1b')),'direction':_0x3109('0x1c')};if(this[_0x3109('0x1d')]===_0x3109('0x1e')||this['channel']==='whatsapp'){_0x3780de['phone']=this[_0x3109('0x17')][_0x3109('0x1f')];}var _0x52f04d=this[_0x3109('0x1d')];if(_0x52f04d===_0x3109('0x20')){_0x3780de[_0x3109('0x21')]=this[_0x3109('0x22')]['id'];}else{_0x3780de[_['upperFirst'](_0x52f04d)+_0x3109('0x23')]=this['account']['id'];}_0x3780de[_[_0x3109('0x24')](_0x52f04d)+'InteractionId']=this[_0x3109('0x17')]['id'];if(this[_0x3109('0x17')][_0x3109('0x25')]){var _0x1cb126=_0x3a7bde[0x4];if(!_[_0x3109('0x26')](_0x1cb126)){_0x3780de[_0x3109('0x11')]=utils[_0x3109('0x27')](_0x1cb126,this);return rpc[_0x52f04d+'Message']['create'](_0x3780de)[_0x3109('0xf')](function(_0x498990){logger[_0x3109('0x10')](_0x3109('0x13'),_0x419041,_0x3780de['body']);})[_0x3109('0x12')](function(_0x3ba4cc){logger[_0x3109('0x28')](_0x3109('0x13'),_0x419041,JSON[_0x3109('0x14')](_0x3ba4cc));})[_0x3109('0x29')](function(){logger['info'](_0x3109('0x2a'),_0x419041);_0x5e6cc7[_0x3109('0x2b')]();});}else{logger[_0x3109('0x10')](_0x3109('0x2c'),_0x419041);_0x5e6cc7[_0x3109('0x2b')]();}}else{var _0x39e887=this;var _0x307c38=_0x3a7bde[0x2]['replace'](/\\n/g,'\x0a');var _0x7f40e4={'credentials':{'private_key':_0x307c38,'client_email':_0x3a7bde[0x1]}};var _0x448f50=new dialogflow[(_0x3109('0x2d'))](_0x7f40e4);var _0x3f0a5e=_0x448f50[_0x3109('0x2e')](_0x3a7bde[0x0],md5(_0x39e887[_0x3109('0x17')]['id']));var _0x4c1361={'session':_0x3f0a5e,'queryInput':{'text':{'text':_0x39e887[_0x3109('0x2f')][_0x3109('0x11')],'languageCode':_0x3a7bde[0x3]||'en'}}};return _0x448f50[_0x3109('0x30')](_0x4c1361)[_0x3109('0xf')](function(_0x25552b){if(_0x25552b&&_0x25552b[_0x3109('0x31')]){_0x39e887[_0x3109('0x11')][_0x3109('0x32')]=_0x25552b;var _0x447ea1=_0x25552b[0x0];var _0x5db496=_0x447ea1[_0x3109('0x33')][_0x3109('0x34')]&&_0x447ea1[_0x3109('0x33')]['diagnosticInfo'][_0x3109('0x35')]?_0x447ea1[_0x3109('0x33')][_0x3109('0x34')][_0x3109('0x35')]['end_conversation'][_0x3109('0x36')]:![];_0x39e887[_0x3109('0x11')]['DIALOGFLOWV2_ACTION']=_0x447ea1[_0x3109('0x33')][_0x3109('0x37')];_0x39e887[_0x3109('0x11')][_0x3109('0x38')]=_0x447ea1[_0x3109('0x33')][_0x3109('0x39')];_0x39e887['body'][_0x3109('0x3a')]=_0x447ea1[_0x3109('0x33')][_0x3109('0x34')]&&_0x447ea1[_0x3109('0x33')]['diagnosticInfo']['fields']?_0x447ea1[_0x3109('0x33')][_0x3109('0x34')][_0x3109('0x35')][_0x3109('0x3b')][_0x3109('0x36')]:![];_0x39e887[_0x3109('0x11')]['DIALOGFLOWV2_INTENTNAME']=_0x447ea1[_0x3109('0x33')][_0x3109('0x3c')][_0x3109('0x3d')];_0x39e887[_0x3109('0x11')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x447ea1[_0x3109('0x33')][_0x3109('0x3c')]['displayName'];_0x39e887[_0x3109('0x11')][_0x3109('0x3e')]=_0x447ea1[_0x3109('0x33')][_0x3109('0x3c')][_0x3109('0x3f')];_0x39e887[_0x3109('0x11')][_0x3109('0x40')]=_0x447ea1[_0x3109('0x33')][_0x3109('0x41')];_0x39e887[_0x3109('0x11')][_0x3109('0x42')]=_0x447ea1[_0x3109('0x33')][_0x3109('0x43')];_0x39e887[_0x3109('0x11')][_0x3109('0x44')]=_0x447ea1[_0x3109('0x33')]['intentDetectionConfidence'];_0x3780de[_0x3109('0x45')]='dialogflowV2';_0x3780de[_0x3109('0x46')]=JSON[_0x3109('0x14')](_0x25552b);var _0x71168c=[];for(var _0x3bd866=0x0;_0x3bd866<_0x25552b[_0x3109('0x31')];_0x3bd866++){var _0x490ce9=_0x25552b[_0x3bd866];if(_0x490ce9&&_0x490ce9[_0x3109('0x33')]&&_0x490ce9[_0x3109('0x33')]['fulfillmentText']){_0x71168c[_0x3109('0x47')](createMessage(_0x419041,_0x52f04d,_0x3780de,_0x490ce9[_0x3109('0x33')]['fulfillmentText']));}}return Promise[_0x3109('0x48')](_0x71168c)[_0x3109('0xf')](function(){if(_0x5db496){_0x5e6cc7[_0x3109('0x49')]();}else{_0x5e6cc7[_0x3109('0x2b')]();}})[_0x3109('0x12')](function(_0x33cfe8){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x419041,JSON['stringify'](_0x33cfe8));_0x5e6cc7[_0x3109('0x49')]();});}})['catch'](function(_0x5c1f1d){logger[_0x3109('0x28')]('[%s][DIALOGFLOWV2]\x20%s',_0x419041,_0x5c1f1d[_0x3109('0x2f')]);_0x5e6cc7[_0x3109('0x49')]();});}}catch(_0x26f4f5){logger[_0x3109('0x28')]('[%s][DIALOGFLOWV2]\x20%s',_0x419041,JSON['stringify'](_0x26f4f5));_0x5e6cc7['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 25943e9..9d160e1 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 _0x9313=['[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','replace','length','error'];(function(_0x4ed080,_0x54974a){var _0x21d57f=function(_0x36aa7c){while(--_0x36aa7c){_0x4ed080['push'](_0x4ed080['shift']());}};_0x21d57f(++_0x54974a);}(_0x9313,0x143));var _0x3931=function(_0x98fb40,_0x37f8d0){_0x98fb40=_0x98fb40-0x0;var _0x15b43a=_0x9313[_0x98fb40];return _0x15b43a;};'use strict';var schema=require(_0x3931('0x0'));var _=require(_0x3931('0x1'));var htmlToText=require(_0x3931('0x2'));var utils=require(_0x3931('0x3'));var logger=require(_0x3931('0x4'))(_0x3931('0x5'));var gotoif=schema({'condition':{'type':_0x3931('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3931('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0x3931('0x8')}});exports[_0x3931('0x9')]=function(_0x460021,_0x5b92d9){return function(_0x4dfd92){try{var _0x2d27f5={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x5b92d9[0x0],this),{'wordwrap':![]})[_0x3931('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5b92d9[0x1],'priorityFalse':_0x5b92d9[0x2]};var _0xc8a8a3=gotoif['validate'](_0x2d27f5,{'typecast':!![]});if(_0xc8a8a3[_0x3931('0xb')]){logger[_0x3931('0xc')](_0x3931('0xd'),_0x460021,_[_0x3931('0xe')](_0xc8a8a3,_0x3931('0xf'))[_0x3931('0x10')](',\x20'));_0x4dfd92[_0x3931('0x11')]();}else{try{var _0x18fc22=eval('('+_0x2d27f5[_0x3931('0x12')]+')');var _0x2e504d=_0x18fc22?_0x2d27f5['priorityTrue']:_0x2d27f5[_0x3931('0x13')];logger[_0x3931('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x460021,_0x2d27f5[_0x3931('0x12')],_0x18fc22,_0x2e504d||'next');if(_0x2e504d){var _0x34c72b=_[_0x3931('0x15')](_0x4dfd92[_0x3931('0x16')](),{'p':_0x2e504d});if(_0x34c72b>=0x0){logger[_0x3931('0x14')](_0x3931('0x17'),_0x460021,_0x2e504d||_0x3931('0x18'),_0x34c72b);_0x4dfd92['next'](_0x34c72b);}else{logger['info'](_0x3931('0x19'),_0x460021,_0x2e504d||'next');_0x4dfd92[_0x3931('0x11')]();}}else{_0x4dfd92[_0x3931('0x18')]();}}catch(_0x56094f){logger[_0x3931('0xc')](_0x3931('0x1a'),_0x460021,_0x56094f[_0x3931('0xf')]);_0x4dfd92[_0x3931('0x11')]();}}}catch(_0x52a161){logger[_0x3931('0xc')]('[%s][GOTOIF]\x20%s',_0x460021,JSON[_0x3931('0x1b')](_0x52a161));_0x4dfd92['stop']();}};}; \ No newline at end of file +var _0x7377=['stop','priorityTrue','priorityFalse','info','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','message','stringify','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','fromString','replace','validate','error','[%s][GOTOIF]\x20%s','map','join'];(function(_0x33bebb,_0x1da2cc){var _0x2a5a9e=function(_0x6d098c){while(--_0x6d098c){_0x33bebb['push'](_0x33bebb['shift']());}};_0x2a5a9e(++_0x1da2cc);}(_0x7377,0xa1));var _0x7737=function(_0x5139d8,_0x37cf5c){_0x5139d8=_0x5139d8-0x0;var _0x42df7e=_0x7377[_0x5139d8];return _0x42df7e;};'use strict';var schema=require('validate');var _=require(_0x7737('0x0'));var htmlToText=require('html-to-text');var utils=require(_0x7737('0x1'));var logger=require(_0x7737('0x2'))('routing');var gotoif=schema({'condition':{'type':_0x7737('0x3'),'required':!![],'message':_0x7737('0x4')},'priorityTrue':{'type':_0x7737('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x7737('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x7737('0x6')]=function(_0x4cdf24,_0x78f340){return function(_0x4d40a4){try{var _0x14642b={'condition':htmlToText[_0x7737('0x7')](utils['getMustacheRender'](_0x78f340[0x0],this),{'wordwrap':![]})[_0x7737('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x78f340[0x1],'priorityFalse':_0x78f340[0x2]};var _0x325c24=gotoif[_0x7737('0x9')](_0x14642b,{'typecast':!![]});if(_0x325c24['length']){logger[_0x7737('0xa')](_0x7737('0xb'),_0x4cdf24,_[_0x7737('0xc')](_0x325c24,'message')[_0x7737('0xd')](',\x20'));_0x4d40a4[_0x7737('0xe')]();}else{try{var _0x1e5f8f=eval('('+_0x14642b['condition']+')');var _0x26a04e=_0x1e5f8f?_0x14642b[_0x7737('0xf')]:_0x14642b[_0x7737('0x10')];logger[_0x7737('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4cdf24,_0x14642b[_0x7737('0x12')],_0x1e5f8f,_0x26a04e||_0x7737('0x13'));if(_0x26a04e){var _0x8244c0=_[_0x7737('0x14')](_0x4d40a4['rules'](),{'p':_0x26a04e});if(_0x8244c0>=0x0){logger['info'](_0x7737('0x15'),_0x4cdf24,_0x26a04e||_0x7737('0x13'),_0x8244c0);_0x4d40a4[_0x7737('0x13')](_0x8244c0);}else{logger['info'](_0x7737('0x16'),_0x4cdf24,_0x26a04e||_0x7737('0x13'));_0x4d40a4[_0x7737('0xe')]();}}else{_0x4d40a4[_0x7737('0x13')]();}}catch(_0x3cca23){logger[_0x7737('0xa')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4cdf24,_0x3cca23[_0x7737('0x17')]);_0x4d40a4[_0x7737('0xe')]();}}}catch(_0x1bb8be){logger[_0x7737('0xa')]('[%s][GOTOIF]\x20%s',_0x4cdf24,JSON[_0x7737('0x18')](_0x1bb8be));_0x4d40a4[_0x7737('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index d61f344..084fa4b 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 _0x4856=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','error','[%s][GOTOP]\x20%s','message'];(function(_0x2ec0ea,_0x27ebc8){var _0x27f94e=function(_0x15db14){while(--_0x15db14){_0x2ec0ea['push'](_0x2ec0ea['shift']());}};_0x27f94e(++_0x27ebc8);}(_0x4856,0x1a2));var _0x6485=function(_0x2ed502,_0x3b7fab){_0x2ed502=_0x2ed502-0x0;var _0x191886=_0x4856[_0x2ed502];return _0x191886;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x6485('0x0'))(_0x6485('0x1'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x6485('0x2')}});exports['consequence']=function(_0x43af18,_0x36ac0e){return function(_0x1d7570){try{var _0x1737d9={'priority':_0x36ac0e[0x0]};var _0x21c8f4=gotop[_0x6485('0x3')](_0x1737d9,{'typecast':!![]});if(_0x21c8f4['length']){logger[_0x6485('0x4')](_0x6485('0x5'),_0x43af18,_['map'](_0x21c8f4,_0x6485('0x6'))['join'](',\x20'));_0x1d7570[_0x6485('0x7')]();}else{logger[_0x6485('0x8')](_0x6485('0x9'),_0x43af18,_0x1737d9[_0x6485('0xa')]);if(_0x1737d9['priority']){var _0x2c3271=_[_0x6485('0xb')](_0x1d7570[_0x6485('0xc')](),{'p':_0x1737d9[_0x6485('0xa')]});if(_0x2c3271>=0x0){logger['info'](_0x6485('0xd'),_0x43af18,_0x1737d9[_0x6485('0xa')]||_0x6485('0xe'),_0x2c3271);_0x1d7570[_0x6485('0xe')](_0x2c3271);}else{logger[_0x6485('0x8')](_0x6485('0xf'),_0x43af18,_0x1737d9['priority']||'next');_0x1d7570['stop']();}}else{_0x1d7570[_0x6485('0xe')]();}}}catch(_0x15686b){logger[_0x6485('0x4')]('[%s][GOTOP]\x20%s',_0x43af18,JSON[_0x6485('0x10')](_0x15686b));_0x1d7570['stop']();}};}; \ No newline at end of file +var _0xf595=['error','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x366ff4,_0x33441f){var _0x5bf432=function(_0x454f62){while(--_0x454f62){_0x366ff4['push'](_0x366ff4['shift']());}};_0x5bf432(++_0x33441f);}(_0xf595,0x6a));var _0x5f59=function(_0x22b588,_0x262a48){_0x22b588=_0x22b588-0x0;var _0x20a551=_0xf595[_0x22b588];return _0x20a551;};'use strict';var schema=require(_0x5f59('0x0'));var _=require(_0x5f59('0x1'));var logger=require(_0x5f59('0x2'))(_0x5f59('0x3'));var gotop=schema({'priority':{'type':_0x5f59('0x4'),'required':!![],'message':_0x5f59('0x5')}});exports['consequence']=function(_0x3ee181,_0x1665ac){return function(_0x266268){try{var _0x4b1969={'priority':_0x1665ac[0x0]};var _0x3948f7=gotop[_0x5f59('0x0')](_0x4b1969,{'typecast':!![]});if(_0x3948f7[_0x5f59('0x6')]){logger['error'](_0x5f59('0x7'),_0x3ee181,_[_0x5f59('0x8')](_0x3948f7,_0x5f59('0x9'))[_0x5f59('0xa')](',\x20'));_0x266268[_0x5f59('0xb')]();}else{logger[_0x5f59('0xc')](_0x5f59('0xd'),_0x3ee181,_0x4b1969[_0x5f59('0xe')]);if(_0x4b1969['priority']){var _0x47a119=_[_0x5f59('0xf')](_0x266268[_0x5f59('0x10')](),{'p':_0x4b1969[_0x5f59('0xe')]});if(_0x47a119>=0x0){logger[_0x5f59('0xc')](_0x5f59('0x11'),_0x3ee181,_0x4b1969[_0x5f59('0xe')]||_0x5f59('0x12'),_0x47a119);_0x266268[_0x5f59('0x12')](_0x47a119);}else{logger[_0x5f59('0xc')](_0x5f59('0x13'),_0x3ee181,_0x4b1969['priority']||_0x5f59('0x12'));_0x266268[_0x5f59('0xb')]();}}else{_0x266268['next']();}}}catch(_0x3d0f5f){logger[_0x5f59('0x14')]('[%s][GOTOP]\x20%s',_0x3ee181,JSON['stringify'](_0x3d0f5f));_0x266268['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index b1259c9..9516b7e 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 _0x3abf=['account','upperFirst','AccountId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat'];(function(_0x4e75c5,_0x5eeb93){var _0x872171=function(_0x137973){while(--_0x137973){_0x4e75c5['push'](_0x4e75c5['shift']());}};_0x872171(++_0x5eeb93);}(_0x3abf,0x16c));var _0xf3ab=function(_0xe121a8,_0x4b015a){_0xe121a8=_0xe121a8-0x0;var _0x45aa58=_0x3abf[_0xe121a8];return _0x45aa58;};'use strict';var _=require(_0xf3ab('0x0'));var utils=require(_0xf3ab('0x1'));var logger=require(_0xf3ab('0x2'))(_0xf3ab('0x3'));var rpc={'chatMessage':require(_0xf3ab('0x4')),'openchannelMessage':require(_0xf3ab('0x5')),'mailMessage':require(_0xf3ab('0x6')),'smsMessage':require(_0xf3ab('0x7')),'faxMessage':require(_0xf3ab('0x8')),'whatsappMessage':require(_0xf3ab('0x9'))};exports[_0xf3ab('0xa')]=function(_0x16f687,_0x87f297){return function(_0x25088c){try{var _0x261a28={'body':utils['getMustacheRender'](_0x87f297[0x0],this),'ContactId':this[_0xf3ab('0xb')]['id']};if(this[_0xf3ab('0xc')]===_0xf3ab('0xd')){_0x261a28['ChatWebsiteId']=this[_0xf3ab('0xe')]['id'];}else{_0x261a28[_[_0xf3ab('0xf')](this[_0xf3ab('0xc')])+_0xf3ab('0x10')]=this[_0xf3ab('0xe')]['id'];}_0x261a28[_[_0xf3ab('0xf')](this[_0xf3ab('0xc')])+'InteractionId']=this[_0xf3ab('0x11')]['id'];if(rpc[this['channel']+_0xf3ab('0x12')]){return rpc[this[_0xf3ab('0xc')]+'Message'][_0xf3ab('0x13')](_0x261a28)[_0xf3ab('0x14')](function(_0x223c47){logger[_0xf3ab('0x15')](_0xf3ab('0x16'),_0x16f687,_0x261a28['body']);_0x25088c[_0xf3ab('0x17')]();})['catch'](function(_0x2d28d5){logger[_0xf3ab('0x18')]('[%s][MESSAGE]\x20%s',_0x16f687,JSON['stringify'](_0x2d28d5));_0x25088c[_0xf3ab('0x19')]();});}}catch(_0x3ecf23){logger[_0xf3ab('0x18')](_0xf3ab('0x16'),_0x16f687,JSON[_0xf3ab('0x1a')](_0x3ecf23));_0x25088c['stop']();}};}; \ No newline at end of file +var _0xd3cc=['create','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0xd3cc,0xd4));var _0xcd3c=function(_0x1b9547,_0x4be6f3){_0x1b9547=_0x1b9547-0x0;var _0xb180b3=_0xd3cc[_0x1b9547];return _0xb180b3;};'use strict';var _=require(_0xcd3c('0x0'));var utils=require(_0xcd3c('0x1'));var logger=require(_0xcd3c('0x2'))(_0xcd3c('0x3'));var rpc={'chatMessage':require(_0xcd3c('0x4')),'openchannelMessage':require(_0xcd3c('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xcd3c('0x6')),'faxMessage':require(_0xcd3c('0x7')),'whatsappMessage':require(_0xcd3c('0x8'))};exports[_0xcd3c('0x9')]=function(_0x280bc9,_0x408b19){return function(_0x4dc71c){try{var _0x92f491={'body':utils['getMustacheRender'](_0x408b19[0x0],this),'ContactId':this[_0xcd3c('0xa')]['id']};if(this[_0xcd3c('0xb')]===_0xcd3c('0xc')){_0x92f491[_0xcd3c('0xd')]=this[_0xcd3c('0xe')]['id'];}else{_0x92f491[_[_0xcd3c('0xf')](this[_0xcd3c('0xb')])+_0xcd3c('0x10')]=this['account']['id'];}_0x92f491[_[_0xcd3c('0xf')](this[_0xcd3c('0xb')])+_0xcd3c('0x11')]=this[_0xcd3c('0x12')]['id'];if(rpc[this['channel']+_0xcd3c('0x13')]){return rpc[this[_0xcd3c('0xb')]+'Message'][_0xcd3c('0x14')](_0x92f491)['then'](function(_0x448ebb){logger[_0xcd3c('0x15')](_0xcd3c('0x16'),_0x280bc9,_0x92f491[_0xcd3c('0x17')]);_0x4dc71c[_0xcd3c('0x18')]();})[_0xcd3c('0x19')](function(_0x1c7af5){logger['error'](_0xcd3c('0x16'),_0x280bc9,JSON[_0xcd3c('0x1a')](_0x1c7af5));_0x4dc71c[_0xcd3c('0x1b')]();});}}catch(_0x4e74d3){logger[_0xcd3c('0x1c')](_0xcd3c('0x16'),_0x280bc9,JSON[_0xcd3c('0x1a')](_0x4e74d3));_0x4dc71c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 64f8f52..9dd3dd9 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 _0x737d=['next','error','stop','../../../../config/logger','routing','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x1e4624,_0x58e8d6){var _0x372983=function(_0x1aa5c0){while(--_0x1aa5c0){_0x1e4624['push'](_0x1e4624['shift']());}};_0x372983(++_0x58e8d6);}(_0x737d,0xea));var _0xd737=function(_0x2b03cd,_0x12cb04){_0x2b03cd=_0x2b03cd-0x0;var _0x3d3a8e=_0x737d[_0x2b03cd];return _0x3d3a8e;};'use strict';var utils=require('./utils');var logger=require(_0xd737('0x0'))(_0xd737('0x1'));exports['consequence']=function(_0x346c18,_0x1556b0){return function(_0x531c95){try{logger['info'](_0xd737('0x2'),_0x346c18,utils[_0xd737('0x3')](_0x1556b0[0x0],this));_0x531c95[_0xd737('0x4')]();}catch(_0x201e9b){logger[_0xd737('0x5')](_0xd737('0x2'),_0x346c18,JSON['stringify'](_0x201e9b));_0x531c95[_0xd737('0x6')]();}};}; \ No newline at end of file +var _0xf84c=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stop','./utils','../../../../config/logger','routing'];(function(_0x59de33,_0x230865){var _0x3ddfa6=function(_0x1a94c2){while(--_0x1a94c2){_0x59de33['push'](_0x59de33['shift']());}};_0x3ddfa6(++_0x230865);}(_0xf84c,0x14a));var _0xcf84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf84c[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xcf84('0x0'));var logger=require(_0xcf84('0x1'))(_0xcf84('0x2'));exports[_0xcf84('0x3')]=function(_0x5116ef,_0x1579e5){return function(_0x554098){try{logger[_0xcf84('0x4')](_0xcf84('0x5'),_0x5116ef,utils[_0xcf84('0x6')](_0x1579e5[0x0],this));_0x554098['next']();}catch(_0x2f88ee){logger[_0xcf84('0x7')]('[%s][NOOP]\x20%s',_0x5116ef,JSON['stringify'](_0x2f88ee));_0x554098[_0xcf84('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index d7c5edd..a175477 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 _0xecac=['waiting','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','update','update\x20queue\x20report'];(function(_0x3a7a77,_0x51995e){var _0x569e5a=function(_0x426305){while(--_0x426305){_0x3a7a77['push'](_0x3a7a77['shift']());}};_0x569e5a(++_0x51995e);}(_0xecac,0x100));var _0xceca=function(_0x5f92a5,_0x35a37e){_0x5f92a5=_0x5f92a5-0x0;var _0x3bdc69=_0xecac[_0x5f92a5];return _0x3bdc69;};'use strict';var schema=require(_0xceca('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0xceca('0x1'));var Redis=require(_0xceca('0x2'));var config=require('../../../../config/environment');var logger=require(_0xceca('0x3'))(_0xceca('0x4'));var strategy=require(_0xceca('0x5'));config['redis']=_['defaults'](config[_0xceca('0x6')],{'host':_0xceca('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xceca('0x8'),_0xceca('0x9'),_0xceca('0xa'),_0xceca('0xb'),_0xceca('0xc')];function emit(_0x5b4c73,_0x1ea536,_0x2bf5ea){io['to'](_0x5b4c73)[_0xceca('0xd')](_0x1ea536,_0x2bf5ea);}function emitChannelQueueInteraction(_0x1429fd,_0x5b5132,_0x6edf03,_0x5b6247,_0xbc5085,_0x4bf0e7,_0x452a7c,_0x5b5513){var _0x2ec4e4=_[_0xceca('0xe')](_0x6edf03);_0x2ec4e4[_0xceca('0x8')]=_0x5b5513;_0x2ec4e4[_0xceca('0xa')]=_0x5b5132;_0x2ec4e4['account']=_0x5b6247;_0x2ec4e4['id']=_0xbc5085;if(_0x4bf0e7){_0x452a7c[util[_0xceca('0xf')]('%sQueuesWaitingInteractions',_0x1429fd)][_0xbc5085]=_['pick'](_0x2ec4e4,attributes);}else{delete _0x452a7c[util[_0xceca('0xf')](_0xceca('0x10'),_0x1429fd)][_0xbc5085];}emit(util['format'](_0xceca('0x11'),_0x1429fd,_0x5b5132),util['format'](_0xceca('0x12'),_0x1429fd,_0x4bf0e7?_0xceca('0x13'):'remove'),_[_0xceca('0x14')](_0x2ec4e4,attributes));}var rpc={'openchannelQueueReport':require(_0xceca('0x15')),'mailQueueReport':require(_0xceca('0x16')),'chatQueueReport':require(_0xceca('0x17')),'smsQueueReport':require(_0xceca('0x18')),'faxQueueReport':require(_0xceca('0x19')),'whatsappQueueReport':require(_0xceca('0x1a'))};var queue=schema({'name':{'type':_0xceca('0x1b'),'required':!![],'message':_0xceca('0x1c')},'timeout':{'type':_0xceca('0x1d'),'message':_0xceca('0x1e')}});function startRouting(_0x41e1b1,_0x41aa4e,_0x4c6cf7,_0x25d010){if(_0x41e1b1&&_0x41aa4e&&_0x4c6cf7){_0x41aa4e['waiting']+=0x1;var _0x3a5e2e={'uniqueid':_0x41e1b1,'from':_0x4c6cf7['body']?_0x4c6cf7[_0xceca('0x1f')][_0xceca('0xb')]:'','joinAt':moment()[_0xceca('0xf')](_0xceca('0x20')),'ContactId':_0x4c6cf7['contact']?_0x4c6cf7[_0xceca('0x21')]['id']:null,'ListId':_0x4c6cf7['list']?_0x4c6cf7[_0xceca('0x22')]['id']:null};_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7['channel'])+'QueueId']=_0x41aa4e['id']||null;_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7[_0xceca('0x24')])+'InteractionId']=_0x4c6cf7[_0xceca('0x25')]?_0x4c6cf7[_0xceca('0x25')]['id']:null;_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7[_0xceca('0x24')])+_0xceca('0x26')]=_0x4c6cf7[_0xceca('0x27')]?_0x4c6cf7['message']['id']:null;_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7[_0xceca('0x24')])+(_0x4c6cf7['channel']!=='chat'?_0xceca('0x28'):_0xceca('0x29'))]=_0x4c6cf7[_0xceca('0x9')]?_0x4c6cf7[_0xceca('0x9')]['id']:null;logger[_0xceca('0x2a')](util[_0xceca('0xf')](_0xceca('0x2b'),_0x41e1b1,_0x41aa4e[_0xceca('0x2c')]));emitChannelQueueInteraction(_0x4c6cf7[_0xceca('0x24')],_0x41aa4e[_0xceca('0x2c')],_0x3a5e2e,_0x4c6cf7[_0xceca('0x9')][_0xceca('0x2c')],_0x4c6cf7[_0xceca('0x27')]['id'],!![],_0x25d010,_0x41aa4e['id']);if(rpc[_0x4c6cf7['channel']+_0xceca('0x2d')]){return rpc[_0x4c6cf7[_0xceca('0x24')]+_0xceca('0x2d')][_0xceca('0x2e')](_0x3a5e2e)[_0xceca('0x2f')](function(_0x14e094){logger[_0xceca('0x30')](_0xceca('0x31'));});}}}function stopRouting(_0x3b6b26,_0x3879de,_0x4c53ed,_0x5e0a2b){if(_0x3b6b26&&_0x3879de){_0x3879de['waiting']-=0x1;var _0x218a42={'leaveAt':moment()[_0xceca('0xf')](_0xceca('0x20')),'acceptAt':moment()[_0xceca('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0xceca('0x2a')](util[_0xceca('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x3b6b26,_0x3879de['name']));emitChannelQueueInteraction(_0x4c53ed['channel'],_0x3879de[_0xceca('0x2c')],_0x4c53ed[_0xceca('0x1f')],_0x4c53ed[_0xceca('0x9')][_0xceca('0x2c')],_0x4c53ed[_0xceca('0x27')]['id'],![],_0x5e0a2b,_0x3879de['id']);if(rpc[_0x4c53ed['channel']+'QueueReport']){return rpc[_0x4c53ed[_0xceca('0x24')]+_0xceca('0x2d')][_0xceca('0x32')](_0x3b6b26,_0x218a42)[_0xceca('0x2f')](function(_0x359683){logger[_0xceca('0x30')](_0xceca('0x33'));});}}}function endRouting(_0x4baad3,_0x291b16,_0x2956db,_0x355772){if(_0x4baad3&&_0x291b16){_0x291b16[_0xceca('0x34')]-=0x1;var _0x200a98={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xceca('0xf')](_0xceca('0x20')),'reason':'timeout'};logger[_0xceca('0x2a')](util[_0xceca('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x4baad3,_0x291b16[_0xceca('0x2c')]));emitChannelQueueInteraction(_0x2956db[_0xceca('0x24')],_0x291b16[_0xceca('0x2c')],_0x2956db['body'],_0x2956db[_0xceca('0x9')][_0xceca('0x2c')],_0x2956db[_0xceca('0x27')]['id'],![],_0x355772);if(rpc[_0x2956db['channel']+_0xceca('0x2d')]){return rpc[_0x2956db[_0xceca('0x24')]+'QueueReport']['update'](_0x4baad3,_0x200a98)[_0xceca('0x2f')](function(_0x53ba10){logger[_0xceca('0x30')](_0xceca('0x33'));});}}}function handleFindQueue(_0x42ba89){return function(_0x3e709e){return _0x3e709e[_0xceca('0x2c')][_0xceca('0x35')]()===_0x42ba89[_0xceca('0x35')]();};}exports[_0xceca('0x36')]=function(_0x1785d2,_0x47c65b,_0x987391,_0x205adf){return function(_0x1100b6){try{var _0x42ab3d={'name':_0x47c65b[0x0],'timeout':_0x47c65b[0x1]};var _0x25e37d=queue[_0xceca('0x0')](_0x42ab3d,{'typecast':!![]});if(_0x25e37d[_0xceca('0x37')]){logger[_0xceca('0x30')](_0xceca('0x38'),_0x1785d2,_[_0xceca('0x39')](_0x25e37d,'message')[_0xceca('0x3a')](',\x20'));_0x1100b6[_0xceca('0x3b')]();}else{var _0x59f78f=_[_0xceca('0x3c')](_0x987391[_0x205adf[_0xceca('0x24')]+_0xceca('0x3d')],handleFindQueue(_0x42ab3d['name']));if(_0x59f78f){startRouting(_0x1785d2,_0x59f78f,_0x205adf,_0x987391);var _0x38adc4=(_0x59f78f[_0xceca('0x3e')]||0xa)*0x3e8;var _0x5d348e=(_0x42ab3d[_0xceca('0x3e')]||0x14)*0x3e8;var _0x18410f,_0x34546d;if(_0x38adc4>_0x5d348e){_0x5d348e=_0x38adc4;}var _0x13dc25=seqqueue['createQueue'](_0x38adc4);_0x13dc25['id']=_0x1785d2;_0x13dc25[_0xceca('0x3f')]=_0x38adc4;_0x13dc25[_0xceca('0x40')]=_0x5d348e;_0x13dc25['channel']=_0x205adf[_0xceca('0x24')];_0x987391[_0xceca('0x41')][_0x1785d2]['on'](_0xceca('0x42'),function(){logger[_0xceca('0x2a')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1785d2);stopRouting(_0x1785d2,_0x59f78f,_0x205adf,_0x987391);clearTimeout(_0x18410f);_0x18410f=undefined;_0x13dc25[_0xceca('0x43')](!![]);if(_0x987391[_0xceca('0x41')][_0x1785d2]){delete _0x987391[_0xceca('0x41')][_0x1785d2];}_0x1100b6[_0xceca('0x3b')]();});_0x987391[_0xceca('0x41')][_0x1785d2]['on'](_0xceca('0x44'),function(){if(_0x987391[_0xceca('0x41')][_0x1785d2]){delete _0x987391[_0xceca('0x41')][_0x1785d2];}});_0x18410f=setTimeout(function(){logger['info'](_0xceca('0x45'),_0x1785d2);endRouting(_0x1785d2,_0x59f78f,_0x205adf,_0x987391);clearTimeout(_0x18410f);_0x13dc25[_0xceca('0x43')](!![]);_0x1100b6[_0xceca('0x46')]();},_0x5d348e);switch(_0x59f78f[_0xceca('0x47')]){case _0xceca('0x48'):strategy[_0xceca('0x48')](_0x13dc25,_0x59f78f,_0x987391,_0x205adf);break;default:strategy[_0xceca('0x49')](_0x13dc25,_0x59f78f,_0x987391,_0x205adf);}}else{logger[_0xceca('0x30')](_0xceca('0x4a'),_0x1785d2,_0x42ab3d[_0xceca('0x2c')]);_0x1100b6[_0xceca('0x3b')]();}}}catch(_0x4cba4e){console[_0xceca('0x4b')](_0x4cba4e);logger[_0xceca('0x30')](_0xceca('0x38'),_0x1785d2,_0x4cba4e[_0xceca('0x4c')]);_0x1100b6['stop']();}};}; \ No newline at end of file +var _0x76e9=['validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','clone','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack'];(function(_0x54d051,_0x312e3f){var _0x1cb039=function(_0x2683dc){while(--_0x2683dc){_0x54d051['push'](_0x54d051['shift']());}};_0x1cb039(++_0x312e3f);}(_0x76e9,0x140));var _0x976e=function(_0x3c257f,_0x2cfaea){_0x3c257f=_0x3c257f-0x0;var _0x3861af=_0x76e9[_0x3c257f];return _0x3861af;};'use strict';var schema=require(_0x976e('0x0'));var _=require(_0x976e('0x1'));var util=require(_0x976e('0x2'));var seqqueue=require(_0x976e('0x3'));var moment=require('moment');var Redis=require(_0x976e('0x4'));var config=require(_0x976e('0x5'));var logger=require(_0x976e('0x6'))(_0x976e('0x7'));var strategy=require(_0x976e('0x8'));config['redis']=_[_0x976e('0x9')](config[_0x976e('0xa')],{'host':_0x976e('0xb'),'port':0x18eb});var io=require(_0x976e('0xc'))(new Redis(config[_0x976e('0xa')]));var attributes=['id',_0x976e('0xd'),_0x976e('0xe'),_0x976e('0xf'),_0x976e('0x10'),'joinAt'];function emit(_0x403794,_0x335fa8,_0x428b6e){io['to'](_0x403794)['emit'](_0x335fa8,_0x428b6e);}function emitChannelQueueInteraction(_0x4c40f5,_0x3758e1,_0x455903,_0x30921b,_0x4e22ec,_0x3b94cf,_0x56242f,_0x3b74fb){var _0x2c34c8=_[_0x976e('0x11')](_0x455903);_0x2c34c8[_0x976e('0xd')]=_0x3b74fb;_0x2c34c8[_0x976e('0xf')]=_0x3758e1;_0x2c34c8[_0x976e('0xe')]=_0x30921b;_0x2c34c8['id']=_0x4e22ec;if(_0x3b94cf){_0x56242f[util[_0x976e('0x12')](_0x976e('0x13'),_0x4c40f5)][_0x4e22ec]=_['pick'](_0x2c34c8,attributes);}else{delete _0x56242f[util['format'](_0x976e('0x13'),_0x4c40f5)][_0x4e22ec];}emit(util['format']('%s:queue:%s',_0x4c40f5,_0x3758e1),util[_0x976e('0x12')](_0x976e('0x14'),_0x4c40f5,_0x3b94cf?_0x976e('0x15'):_0x976e('0x16')),_[_0x976e('0x17')](_0x2c34c8,attributes));}var rpc={'openchannelQueueReport':require(_0x976e('0x18')),'mailQueueReport':require(_0x976e('0x19')),'chatQueueReport':require(_0x976e('0x1a')),'smsQueueReport':require(_0x976e('0x1b')),'faxQueueReport':require(_0x976e('0x1c')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x976e('0x1d'),'required':!![],'message':_0x976e('0x1e')},'timeout':{'type':_0x976e('0x1f'),'message':_0x976e('0x20')}});function startRouting(_0x7922c9,_0x3aa09e,_0x53bda6,_0x44207c){if(_0x7922c9&&_0x3aa09e&&_0x53bda6){_0x3aa09e[_0x976e('0x21')]+=0x1;var _0x426741={'uniqueid':_0x7922c9,'from':_0x53bda6[_0x976e('0x22')]?_0x53bda6['body'][_0x976e('0x10')]:'','joinAt':moment()[_0x976e('0x12')](_0x976e('0x23')),'ContactId':_0x53bda6[_0x976e('0x24')]?_0x53bda6['contact']['id']:null,'ListId':_0x53bda6['list']?_0x53bda6[_0x976e('0x25')]['id']:null};_0x426741[_[_0x976e('0x26')](_0x53bda6['channel'])+_0x976e('0x27')]=_0x3aa09e['id']||null;_0x426741[_[_0x976e('0x26')](_0x53bda6[_0x976e('0x28')])+_0x976e('0x29')]=_0x53bda6[_0x976e('0x2a')]?_0x53bda6['interaction']['id']:null;_0x426741[_[_0x976e('0x26')](_0x53bda6[_0x976e('0x28')])+_0x976e('0x2b')]=_0x53bda6[_0x976e('0x2c')]?_0x53bda6[_0x976e('0x2c')]['id']:null;_0x426741[_[_0x976e('0x26')](_0x53bda6[_0x976e('0x28')])+(_0x53bda6[_0x976e('0x28')]!=='chat'?'AccountId':_0x976e('0x2d'))]=_0x53bda6[_0x976e('0xe')]?_0x53bda6[_0x976e('0xe')]['id']:null;logger[_0x976e('0x2e')](util['format'](_0x976e('0x2f'),_0x7922c9,_0x3aa09e['name']));emitChannelQueueInteraction(_0x53bda6[_0x976e('0x28')],_0x3aa09e[_0x976e('0x30')],_0x426741,_0x53bda6[_0x976e('0xe')][_0x976e('0x30')],_0x53bda6[_0x976e('0x2c')]['id'],!![],_0x44207c,_0x3aa09e['id']);if(rpc[_0x53bda6[_0x976e('0x28')]+_0x976e('0x31')]){return rpc[_0x53bda6[_0x976e('0x28')]+'QueueReport'][_0x976e('0x32')](_0x426741)[_0x976e('0x33')](function(_0x2da9f3){logger[_0x976e('0x34')](_0x976e('0x35'));});}}}function stopRouting(_0x3037e6,_0x19f277,_0x1ee830,_0x57c3a7){if(_0x3037e6&&_0x19f277){_0x19f277[_0x976e('0x21')]-=0x1;var _0x5d5cee={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x976e('0x12')](_0x976e('0x23')),'reason':_0x976e('0x36')};logger['info'](util[_0x976e('0x12')](_0x976e('0x37'),_0x3037e6,_0x19f277[_0x976e('0x30')]));emitChannelQueueInteraction(_0x1ee830[_0x976e('0x28')],_0x19f277[_0x976e('0x30')],_0x1ee830[_0x976e('0x22')],_0x1ee830[_0x976e('0xe')]['name'],_0x1ee830['message']['id'],![],_0x57c3a7,_0x19f277['id']);if(rpc[_0x1ee830[_0x976e('0x28')]+_0x976e('0x31')]){return rpc[_0x1ee830['channel']+_0x976e('0x31')][_0x976e('0x38')](_0x3037e6,_0x5d5cee)[_0x976e('0x33')](function(_0x3431c5){logger[_0x976e('0x34')](_0x976e('0x39'));});}}}function endRouting(_0x30e0a7,_0x41ecbc,_0x110660,_0x10e28e){if(_0x30e0a7&&_0x41ecbc){_0x41ecbc[_0x976e('0x21')]-=0x1;var _0x1e4cf1={'leaveAt':moment()[_0x976e('0x12')](_0x976e('0x23')),'exitAt':moment()[_0x976e('0x12')](_0x976e('0x23')),'reason':'timeout'};logger[_0x976e('0x2e')](util[_0x976e('0x12')](_0x976e('0x3a'),_0x30e0a7,_0x41ecbc[_0x976e('0x30')]));emitChannelQueueInteraction(_0x110660[_0x976e('0x28')],_0x41ecbc[_0x976e('0x30')],_0x110660[_0x976e('0x22')],_0x110660[_0x976e('0xe')]['name'],_0x110660[_0x976e('0x2c')]['id'],![],_0x10e28e);if(rpc[_0x110660[_0x976e('0x28')]+_0x976e('0x31')]){return rpc[_0x110660[_0x976e('0x28')]+'QueueReport'][_0x976e('0x38')](_0x30e0a7,_0x1e4cf1)[_0x976e('0x33')](function(_0x5416ab){logger[_0x976e('0x34')](_0x976e('0x39'));});}}}function handleFindQueue(_0xbdd8b){return function(_0x5de894){return _0x5de894[_0x976e('0x30')][_0x976e('0x3b')]()===_0xbdd8b[_0x976e('0x3b')]();};}exports['consequence']=function(_0x5d7f4e,_0x32c96d,_0x4f8350,_0x1ebdda){return function(_0x1ce395){try{var _0x3fd71c={'name':_0x32c96d[0x0],'timeout':_0x32c96d[0x1]};var _0x1bb005=queue[_0x976e('0x0')](_0x3fd71c,{'typecast':!![]});if(_0x1bb005['length']){logger[_0x976e('0x34')](_0x976e('0x3c'),_0x5d7f4e,_[_0x976e('0x3d')](_0x1bb005,_0x976e('0x2c'))[_0x976e('0x3e')](',\x20'));_0x1ce395[_0x976e('0x3f')]();}else{var _0x589f56=_['find'](_0x4f8350[_0x1ebdda[_0x976e('0x28')]+'Queues'],handleFindQueue(_0x3fd71c['name']));if(_0x589f56){startRouting(_0x5d7f4e,_0x589f56,_0x1ebdda,_0x4f8350);var _0x389fcf=(_0x589f56[_0x976e('0x40')]||0xa)*0x3e8;var _0x2dc86d=(_0x3fd71c[_0x976e('0x40')]||0x14)*0x3e8;var _0x2c1d97,_0x77217f;if(_0x389fcf>_0x2dc86d){_0x2dc86d=_0x389fcf;}var _0x24d91e=seqqueue[_0x976e('0x41')](_0x389fcf);_0x24d91e['id']=_0x5d7f4e;_0x24d91e[_0x976e('0x42')]=_0x389fcf;_0x24d91e[_0x976e('0x43')]=_0x2dc86d;_0x24d91e['channel']=_0x1ebdda[_0x976e('0x28')];_0x4f8350[_0x976e('0x44')][_0x5d7f4e]['on'](_0x976e('0x45'),function(){logger[_0x976e('0x2e')](_0x976e('0x46'),_0x5d7f4e);stopRouting(_0x5d7f4e,_0x589f56,_0x1ebdda,_0x4f8350);clearTimeout(_0x2c1d97);_0x2c1d97=undefined;_0x24d91e[_0x976e('0x47')](!![]);if(_0x4f8350[_0x976e('0x44')][_0x5d7f4e]){delete _0x4f8350[_0x976e('0x44')][_0x5d7f4e];}_0x1ce395['stop']();});_0x4f8350[_0x976e('0x44')][_0x5d7f4e]['on']('complete',function(){if(_0x4f8350[_0x976e('0x44')][_0x5d7f4e]){delete _0x4f8350[_0x976e('0x44')][_0x5d7f4e];}});_0x2c1d97=setTimeout(function(){logger[_0x976e('0x2e')](_0x976e('0x48'),_0x5d7f4e);endRouting(_0x5d7f4e,_0x589f56,_0x1ebdda,_0x4f8350);clearTimeout(_0x2c1d97);_0x24d91e[_0x976e('0x47')](!![]);_0x1ce395[_0x976e('0x49')]();},_0x2dc86d);switch(_0x589f56[_0x976e('0x4a')]){case _0x976e('0x4b'):strategy[_0x976e('0x4b')](_0x24d91e,_0x589f56,_0x4f8350,_0x1ebdda);break;default:strategy[_0x976e('0x4c')](_0x24d91e,_0x589f56,_0x4f8350,_0x1ebdda);}}else{logger[_0x976e('0x34')](_0x976e('0x4d'),_0x5d7f4e,_0x3fd71c['name']);_0x1ce395[_0x976e('0x3f')]();}}}catch(_0x511e1c){console[_0x976e('0x4e')](_0x511e1c);logger['error'](_0x976e('0x3c'),_0x5d7f4e,_0x511e1c[_0x976e('0x4f')]);_0x1ce395[_0x976e('0x3f')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index f78e048..1d5fecc 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 _0x166d=['prototype','info','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained'];(function(_0x3cb1c2,_0x9f9605){var _0x4da983=function(_0x4958f6){while(--_0x4958f6){_0x3cb1c2['push'](_0x3cb1c2['shift']());}};_0x4da983(++_0x9f9605);}(_0x166d,0x148));var _0xd166=function(_0x595986,_0x2754f1){_0x595986=_0x595986-0x0;var _0x19925c=_0x166d[_0x595986];return _0x19925c;};'use strict';var _=require('lodash');var uuid=require(_0xd166('0x0'));var util=require(_0xd166('0x1'));var logger=require(_0xd166('0x2'))(_0xd166('0x3'));var Agent=function(_0x399a1c,_0x29ed1f,_0x557c3b,_0x27f6ef){this[_0xd166('0x4')]=uuid['v4']();this[_0xd166('0x5')]=_0x399a1c;this['agent']=_0x29ed1f;this[_0xd166('0x6')]=_0x557c3b;this[_0xd166('0x3')]=_0x27f6ef;this['squeue'][_0xd166('0x7')](this[_0xd166('0x8')][_0xd166('0x9')](this),this[_0xd166('0xa')][_0xd166('0x9')](this));this[_0xd166('0x5')]['on'](_0xd166('0xb'),this[_0xd166('0xa')]['bind'](this));this['squeue']['on'](_0xd166('0xc'),this['handleDrained'][_0xd166('0x9')](this));};Agent[_0xd166('0xd')][_0xd166('0x7')]=function(){this['squeue']['push'](this[_0xd166('0x8')][_0xd166('0x9')](this),this[_0xd166('0xa')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0xd166('0xa')](!![]);};Agent[_0xd166('0xd')][_0xd166('0x8')]=function(_0x110652){logger[_0xd166('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xd166('0x5')]['id'],this[_0xd166('0xf')]['id']);if(_[_0xd166('0x10')](this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']])){logger['info'](_0xd166('0x12'),this[_0xd166('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xd166('0x7')]['bind'](this),0x3e8);}else{if(this[_0xd166('0x3')][_0xd166('0x13')]||util[_0xd166('0x14')](this['squeue']['id'],this[_0xd166('0x6')]['agents'][this[_0xd166('0xf')]['id']],this[_0xd166('0x5')][_0xd166('0x15')],![])){this[_0xd166('0x6')][_0xd166('0x11')][this['agent']['id']][_0xd166('0x16')]=!![];this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']]['busyQueue']=undefined;util[_0xd166('0x17')](this[_0xd166('0x4')],this[_0xd166('0x5')]['id'],this[_0xd166('0x6')]['agents'][this[_0xd166('0xf')]['id']],null,this[_0xd166('0x3')]);util[_0xd166('0x18')](this['squeue']['id'],this[_0xd166('0x6')][_0xd166('0x11')][this['agent']['id']],_0xd166('0x19')+(this['routing'][_0xd166('0x13')]?_0xd166('0x1a'):''));}else{logger[_0xd166('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0xd166('0xf')]['id']);setTimeout(this[_0xd166('0x7')][_0xd166('0x9')](this),0x3e8);}}};Agent[_0xd166('0xd')]['handleTimeout']=function(_0x2001c2){if(_[_0xd166('0x10')](this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']])){return logger[_0xd166('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd166('0x5')]['id'],this[_0xd166('0xf')]['id']);}else{logger[_0xd166('0xe')](_0xd166('0x1b'),this[_0xd166('0x5')]['id'],this[_0xd166('0xf')]['id']);util[_0xd166('0x1c')](this['notificationId'],this[_0xd166('0x5')]['id'],this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']],null,this[_0xd166('0x3')]);this[_0xd166('0x6')][_0xd166('0x11')][this['agent']['id']][_0xd166('0x16')]=![];this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']][_0xd166('0x1d')]=undefined;util[_0xd166('0x18')](this[_0xd166('0x5')]['id'],this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']],_0x2001c2?_0xd166('0x1e'):'TIMEOUT');}if(!_0x2001c2){setTimeout(this['push'][_0xd166('0x9')](this),0x3e8);}};function agent(_0x56db14,_0x2d6a4e,_0xde6200,_0x1de7d6){return new Agent(_0x56db14,_0x2d6a4e,_0xde6200,_0x1de7d6);}module['exports']=agent; \ No newline at end of file +var _0x6a13=['agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x29e07b,_0x453788){var _0x268686=function(_0x2581c8){while(--_0x2581c8){_0x29e07b['push'](_0x29e07b['shift']());}};_0x268686(++_0x453788);}(_0x6a13,0xe1));var _0x36a1=function(_0x29be0b,_0x2fdc2f){_0x29be0b=_0x29be0b-0x0;var _0x529e6b=_0x6a13[_0x29be0b];return _0x529e6b;};'use strict';var _=require('lodash');var uuid=require(_0x36a1('0x0'));var util=require(_0x36a1('0x1'));var logger=require(_0x36a1('0x2'))(_0x36a1('0x3'));var Agent=function(_0x4805f9,_0x91b7f9,_0x47aef1,_0xbdbdf9){this[_0x36a1('0x4')]=uuid['v4']();this[_0x36a1('0x5')]=_0x4805f9;this[_0x36a1('0x6')]=_0x91b7f9;this[_0x36a1('0x7')]=_0x47aef1;this['routing']=_0xbdbdf9;this[_0x36a1('0x5')][_0x36a1('0x8')](this[_0x36a1('0x9')][_0x36a1('0xa')](this),this[_0x36a1('0xb')][_0x36a1('0xa')](this));this[_0x36a1('0x5')]['on'](_0x36a1('0xc'),this[_0x36a1('0xb')][_0x36a1('0xa')](this));this[_0x36a1('0x5')]['on'](_0x36a1('0xd'),this[_0x36a1('0xe')][_0x36a1('0xa')](this));};Agent[_0x36a1('0xf')][_0x36a1('0x8')]=function(){this[_0x36a1('0x5')][_0x36a1('0x8')](this[_0x36a1('0x9')][_0x36a1('0xa')](this),this[_0x36a1('0xb')]['bind'](this));};Agent[_0x36a1('0xf')][_0x36a1('0xe')]=function(){this[_0x36a1('0xb')](!![]);};Agent[_0x36a1('0xf')]['handleRun']=function(_0x1992a3){logger['info'](_0x36a1('0x10'),this[_0x36a1('0x5')]['id'],this[_0x36a1('0x6')]['id']);if(_[_0x36a1('0x11')](this[_0x36a1('0x7')][_0x36a1('0x12')][this[_0x36a1('0x6')]['id']])){logger[_0x36a1('0x13')](_0x36a1('0x14'),this['squeue']['id'],this[_0x36a1('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x36a1('0x3')][_0x36a1('0x15')]||util[_0x36a1('0x16')](this[_0x36a1('0x5')]['id'],this[_0x36a1('0x7')][_0x36a1('0x12')][this[_0x36a1('0x6')]['id']],this[_0x36a1('0x5')]['channel'],![])){this[_0x36a1('0x7')]['agents'][this['agent']['id']][_0x36a1('0x17')]=!![];this[_0x36a1('0x7')][_0x36a1('0x12')][this[_0x36a1('0x6')]['id']][_0x36a1('0x18')]=undefined;util[_0x36a1('0x19')](this[_0x36a1('0x4')],this[_0x36a1('0x5')]['id'],this['realtime'][_0x36a1('0x12')][this[_0x36a1('0x6')]['id']],null,this[_0x36a1('0x3')]);util['writeLog'](this[_0x36a1('0x5')]['id'],this['realtime'][_0x36a1('0x12')][this['agent']['id']],'RINGING'+(this[_0x36a1('0x3')][_0x36a1('0x15')]?_0x36a1('0x1a'):''));}else{logger[_0x36a1('0x13')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x36a1('0x5')]['id'],this[_0x36a1('0x6')]['id']);setTimeout(this[_0x36a1('0x8')][_0x36a1('0xa')](this),0x3e8);}}};Agent[_0x36a1('0xf')][_0x36a1('0xb')]=function(_0x2625a4){if(_[_0x36a1('0x11')](this[_0x36a1('0x7')]['agents'][this[_0x36a1('0x6')]['id']])){return logger[_0x36a1('0x13')](_0x36a1('0x14'),this[_0x36a1('0x5')]['id'],this[_0x36a1('0x6')]['id']);}else{logger['info'](_0x36a1('0x1b'),this['squeue']['id'],this[_0x36a1('0x6')]['id']);util[_0x36a1('0x1c')](this[_0x36a1('0x4')],this[_0x36a1('0x5')]['id'],this[_0x36a1('0x7')]['agents'][this[_0x36a1('0x6')]['id']],null,this['routing']);this[_0x36a1('0x7')][_0x36a1('0x12')][this[_0x36a1('0x6')]['id']]['busy']=![];this['realtime'][_0x36a1('0x12')][this[_0x36a1('0x6')]['id']][_0x36a1('0x18')]=undefined;util[_0x36a1('0x1d')](this[_0x36a1('0x5')]['id'],this[_0x36a1('0x7')]['agents'][this[_0x36a1('0x6')]['id']],_0x2625a4?_0x36a1('0x1e'):_0x36a1('0x1f'));}if(!_0x2625a4){setTimeout(this[_0x36a1('0x8')]['bind'](this),0x3e8);}};function agent(_0x709195,_0x57c84e,_0x29d9e2,_0x3a2ec4){return new Agent(_0x709195,_0x57c84e,_0x29d9e2,_0x3a2ec4);}module[_0x36a1('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 de5bc26..e45587e 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 _0x77f7=['handleRun','bind','handleTimeout','drained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','name','showNotification','notificationId','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','queue','realtime','squeue','push'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x77f7,0xbd));var _0x777f=function(_0x49149e,_0x5d9fec){_0x49149e=_0x49149e-0x0;var _0x18c58f=_0x77f7[_0x49149e];return _0x18c58f;};'use strict';var _=require(_0x777f('0x0'));var uuid=require(_0x777f('0x1'));var util=require(_0x777f('0x2'));var logger=require(_0x777f('0x3'))(_0x777f('0x4'));var Beepall=function(_0xcd0b99,_0x1f15bf,_0xe31aeb,_0x1f783b){this['notificationId']=uuid['v4']();this['squeue']=_0xcd0b99;this[_0x777f('0x5')]=_0x1f15bf;this[_0x777f('0x6')]=_0xe31aeb;this[_0x777f('0x4')]=_0x1f783b;this[_0x777f('0x7')][_0x777f('0x8')](this[_0x777f('0x9')][_0x777f('0xa')](this),this[_0x777f('0xb')][_0x777f('0xa')](this));this[_0x777f('0x7')]['on']('timeout',this[_0x777f('0xb')]['bind'](this));this[_0x777f('0x7')]['on'](_0x777f('0xc'),this['handleDrained'][_0x777f('0xa')](this));};Beepall[_0x777f('0xd')][_0x777f('0x8')]=function(){this['squeue'][_0x777f('0x8')](this[_0x777f('0x9')][_0x777f('0xa')](this),this[_0x777f('0xb')][_0x777f('0xa')](this));};Beepall[_0x777f('0xd')]['handleDrained']=function(_0x33c907){this[_0x777f('0xb')](!![]);};Beepall['prototype'][_0x777f('0x9')]=function(_0x187bcb){var _0x198805=!![];if(!_[_0x777f('0xe')](this[_0x777f('0x5')])&&!_[_0x777f('0xe')](this[_0x777f('0x5')]['Agents'])&&this[_0x777f('0x5')][_0x777f('0xf')][_0x777f('0x10')]>0x0){for(var _0x1ef1c5=0x0,_0x361759;_0x1ef1c50x0){for(var _0x4e7781=0x0,_0x57a68a;_0x4e77810x0&&_0x31555d[_0x2a22e3+_0x47b8('0x28')]>=_0x31555d[_0x2a22e3+'Capacity']){writeLog(_0x54f6bc,_0x31555d,_0x2a22e3[_0x47b8('0x29')]()+_0x47b8('0x2a'));return![];}}return!![];};exports['showNotification']=function(_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0){return sendNotification(!![],_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0);};exports[_0x47b8('0x2b')]=function(_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d){return sendNotification(![],_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x71ab=['[%s][QUEUE]\x20%s','message','user:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','util','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','name','user:save','account','notificationSound','notificationShake','queue','body','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error'];(function(_0x4cdee9,_0x5c3cc1){var _0x4f7c88=function(_0x5434f0){while(--_0x5434f0){_0x4cdee9['push'](_0x4cdee9['shift']());}};_0x4f7c88(++_0x5c3cc1);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var utils=require('../utils');var Mustache=require(_0xb71a('0x1'));var Redis=require('ioredis');var config=require(_0xb71a('0x2'));var logger=require(_0xb71a('0x3'))(_0xb71a('0x4'));config[_0xb71a('0x5')]=_[_0xb71a('0x6')](config[_0xb71a('0x5')],{'host':_0xb71a('0x7'),'port':0x18eb});var io=require(_0xb71a('0x8'))(new Redis(config[_0xb71a('0x5')]));function emit(_0x35a84e,_0x4358ce,_0x2a4c86){io['to'](_0x35a84e)[_0xb71a('0x9')](_0x4358ce,_0x2a4c86);}function sendNotification(_0x471ab6,_0x18c7a6,_0xbfef18,_0x378c96,_0x2e8883,_0x517eed){io['to'](util[_0xb71a('0xa')]('user:%s',_0x378c96[_0xb71a('0xb')]))[_0xb71a('0x9')](_0xb71a('0xc'),_0x378c96);var _0x591311=_0x517eed||{};var _0x3909b4=_0xbfef18['split']('.');var _0x2a2d75={'uniqueid':_0x18c7a6,'channel':_0x3909b4[0x0],'id':_0x3909b4[0x1],'title':_0x3909b4[0x0]+'\x20interaction','interactionId':_0x3909b4[0x2],'queue':_0x2e8883?_0x2e8883['name']:null,'sound':_0x591311[_0xb71a('0xd')][_0xb71a('0xe')],'shake':_0x591311[_0xb71a('0xd')][_0xb71a('0xf')]};try{if(!_0x591311['body']){_0x591311['body']={};}if(_0x2e8883){_0x591311['body'][_0xb71a('0x10')]=_0x2e8883;}else if(_0x591311[_0xb71a('0x11')][_0xb71a('0x10')]){delete _0x591311[_0xb71a('0x11')][_0xb71a('0x10')];}_0x2a2d75[_0xb71a('0x12')]=utils[_0xb71a('0x13')](_0x591311[_0xb71a('0xd')][_0xb71a('0x14')],_0x591311);}catch(_0x5588cf){_0x2a2d75[_0xb71a('0x12')]=_0xb71a('0x15');logger[_0xb71a('0x16')](util[_0xb71a('0xa')](_0xb71a('0x17'),_0x18c7a6,_0x5588cf[_0xb71a('0x18')]));}io['to'](util[_0xb71a('0xa')](_0xb71a('0x19'),_0x378c96[_0xb71a('0xb')]))[_0xb71a('0x9')](util[_0xb71a('0xa')]('notification:%s',_0x471ab6?'save':_0xb71a('0x1a')),_0x2a2d75);}function writeLog(_0x578fe4,_0x4a4f4e,_0x4d8871){return logger[_0xb71a('0x1b')](util['format'](_0xb71a('0x1c'),_0x578fe4,_0x4a4f4e[_0xb71a('0xb')],_0x4d8871));}exports[_0xb71a('0x1d')]=function(_0x18fa8d,_0x38a728,_0x14b2a1,_0x2f4fac){if(_0x38a728[_0xb71a('0x1e')]){writeLog(_0x18fa8d,_0x38a728,'BUSY');return![];}if(!_0x38a728[_0xb71a('0x1f')]){writeLog(_0x18fa8d,_0x38a728,_0xb71a('0x20'));return![];}if(_0x38a728[_0x14b2a1+_0xb71a('0x21')]){writeLog(_0x18fa8d,_0x38a728,_0xb71a('0x22'));return![];}if(_0x2f4fac&&_0x38a728[_0xb71a('0x23')](_0x14b2a1+_0xb71a('0x24'))&&_0x38a728[_0xb71a('0x23')](_0x14b2a1+_0xb71a('0x25'))){if(_0x38a728[_0x14b2a1+_0xb71a('0x24')]>0x0&&_0x38a728[_0x14b2a1+_0xb71a('0x25')]>=_0x38a728[_0x14b2a1+_0xb71a('0x24')]){writeLog(_0x18fa8d,_0x38a728,_0x14b2a1[_0xb71a('0x26')]()+_0xb71a('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x2e8ea6,_0x39d874,_0x1689ce,_0x358954,_0x2fbd73){return sendNotification(!![],_0x2e8ea6,_0x39d874,_0x1689ce,_0x358954,_0x2fbd73);};exports[_0xb71a('0x28')]=function(_0x44826e,_0x25364c,_0x42c086,_0x421fcf,_0xcb40fc){return sendNotification(![],_0x44826e,_0x25364c,_0x42c086,_0x421fcf,_0xcb40fc);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index a72c447..b206664 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 _0xe3cb=['./utils','../../../../config/logger','routing','string','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','next','isObject','stringify','validate','shelljs','lodash'];(function(_0x366c24,_0x717d6c){var _0x1d32c1=function(_0x2c04fa){while(--_0x2c04fa){_0x366c24['push'](_0x366c24['shift']());}};_0x1d32c1(++_0x717d6c);}(_0xe3cb,0xd5));var _0xbe3c=function(_0x4e54db,_0x1ca2f8){_0x4e54db=_0x4e54db-0x0;var _0x80db36=_0xe3cb[_0x4e54db];return _0x80db36;};'use strict';var schema=require(_0xbe3c('0x0'));var sh=require(_0xbe3c('0x1'));var _=require(_0xbe3c('0x2'));var utils=require(_0xbe3c('0x3'));var logger=require(_0xbe3c('0x4'))(_0xbe3c('0x5'));var system=schema({'command':{'type':_0xbe3c('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x56262d,_0x2eddf6){return function(_0x4413c9){try{var _0x1ee23e={'command':_0x2eddf6[0x0]};var _0x9ffc9b=system['validate'](_0x1ee23e,{'typecast':!![]});if(_0x9ffc9b[_0xbe3c('0x7')]){logger[_0xbe3c('0x8')](_0xbe3c('0x9'),_0x56262d,_[_0xbe3c('0xa')](_0x9ffc9b,_0xbe3c('0xb'))[_0xbe3c('0xc')](',\x20'));logger[_0xbe3c('0xd')](_0xbe3c('0xe'),_0x56262d);_0x4413c9['next']();}else{var _0x16bab0=this;var _0x45a039=utils['getMustacheRender'](_0x2eddf6[0x0],this);logger[_0xbe3c('0xd')](_0xbe3c('0xf'),_0x56262d,_0x45a039);sh['exec'](_[_0xbe3c('0x10')](_0x45a039),function(_0x22a413,_0x439efc){logger[_0xbe3c('0xd')](_0xbe3c('0x11'),_0x56262d,_0x22a413);if(_0x22a413==0x0){var _0x532c24=_0x439efc[_0xbe3c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xbe3c('0x13')](_0x2eddf6[0x1])||_['isEmpty'](_0x2eddf6[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x56262d);_0x16bab0[_0xbe3c('0x14')][_0x2eddf6[0x1]]=_0x532c24;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x56262d,_0x2eddf6[0x1],_0x532c24);_0x16bab0[_0xbe3c('0x14')][_0x2eddf6[0x1]]=_0x532c24;}}_0x4413c9[_0xbe3c('0x15')]();});}}catch(_0x3ced77){logger[_0xbe3c('0x8')](_0xbe3c('0x9'),_0x56262d,_[_0xbe3c('0x16')](_0x3ced77)?JSON[_0xbe3c('0x17')](_0x3ced77):_0x3ced77);logger[_0xbe3c('0xd')](_0xbe3c('0xe'),_0x56262d);_0x4413c9[_0xbe3c('0x15')]();}};}; \ No newline at end of file +var _0x5a08=['length','error','[%s][SYSTEM]\x20%s','message','join','info','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','./utils','../../../../config/logger','string','consequence','validate'];(function(_0x2b937f,_0xeb0eae){var _0x45cc89=function(_0x5c6741){while(--_0x5c6741){_0x2b937f['push'](_0x2b937f['shift']());}};_0x45cc89(++_0xeb0eae);}(_0x5a08,0xc1));var _0x85a0=function(_0x314e1a,_0x99db6f){_0x314e1a=_0x314e1a-0x0;var _0x31c164=_0x5a08[_0x314e1a];return _0x31c164;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0x85a0('0x0'));var logger=require(_0x85a0('0x1'))('routing');var system=schema({'command':{'type':_0x85a0('0x2'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x85a0('0x3')]=function(_0x1b9ba8,_0x2c68eb){return function(_0xb222c0){try{var _0x2b1223={'command':_0x2c68eb[0x0]};var _0x541ec2=system[_0x85a0('0x4')](_0x2b1223,{'typecast':!![]});if(_0x541ec2[_0x85a0('0x5')]){logger[_0x85a0('0x6')](_0x85a0('0x7'),_0x1b9ba8,_['map'](_0x541ec2,_0x85a0('0x8'))[_0x85a0('0x9')](',\x20'));logger[_0x85a0('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1b9ba8);_0xb222c0[_0x85a0('0xb')]();}else{var _0x539c75=this;var _0x4bd320=utils[_0x85a0('0xc')](_0x2c68eb[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x1b9ba8,_0x4bd320);sh[_0x85a0('0xd')](_[_0x85a0('0xe')](_0x4bd320),function(_0x2852fa,_0x802968){logger[_0x85a0('0xa')](_0x85a0('0xf'),_0x1b9ba8,_0x2852fa);if(_0x2852fa==0x0){var _0xacd40b=_0x802968[_0x85a0('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x85a0('0x11')](_0x2c68eb[0x1])||_[_0x85a0('0x12')](_0x2c68eb[0x1])){logger[_0x85a0('0xa')](_0x85a0('0x13'),_0x1b9ba8);_0x539c75[_0x85a0('0x14')][_0x2c68eb[0x1]]=_0xacd40b;}else{logger[_0x85a0('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x1b9ba8,_0x2c68eb[0x1],_0xacd40b);_0x539c75[_0x85a0('0x14')][_0x2c68eb[0x1]]=_0xacd40b;}}_0xb222c0[_0x85a0('0xb')]();});}}catch(_0x54571f){logger['error'](_0x85a0('0x7'),_0x1b9ba8,_[_0x85a0('0x15')](_0x54571f)?JSON['stringify'](_0x54571f):_0x54571f);logger[_0x85a0('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x1b9ba8);_0xb222c0['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 6b08d81..1595fd2 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 _0xd76b=['../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x386600,_0x18dd88){var _0x537eed=function(_0x5688fd){while(--_0x5688fd){_0x386600['push'](_0x386600['shift']());}};_0x537eed(++_0x18dd88);}(_0xd76b,0xa4));var _0xbd76=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xd76b[_0x565c49];return _0x20ca34;};'use strict';var schema=require(_0xbd76('0x0'));var _=require(_0xbd76('0x1'));var rpc={'chatInteraction':require(_0xbd76('0x2')),'openchannelInteraction':require(_0xbd76('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xbd76('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xbd76('0x5'))};var logger=require(_0xbd76('0x6'))(_0xbd76('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xbd76('0x8')}});exports[_0xbd76('0x9')]=function(_0x214188,_0x1060e6,_0x507709,_0x5ba419){return function(_0x313ba4){try{var _0x380999={'tag':_0x1060e6[0x0]};var _0x4d7d41=tag[_0xbd76('0x0')](_0x380999,{'typecast':!![]});if(_0x4d7d41[_0xbd76('0xa')]){logger[_0xbd76('0xb')](_0xbd76('0xc'),_0x214188,_['map'](_0x4d7d41,'message')['join'](',\x20'));logger[_0xbd76('0xd')](_0xbd76('0xe'),_0x214188);_0x313ba4[_0xbd76('0xf')]();}else{var _0x6965b5={'ids':[_0x1060e6[0x0]]};if(rpc[_0x5ba419[_0xbd76('0x10')]+_0xbd76('0x11')]){rpc[_0x5ba419['channel']+_0xbd76('0x11')][_0xbd76('0x12')](_0x5ba419[_0xbd76('0x13')]['id'],_0x6965b5)[_0xbd76('0x14')](function(_0x926b17){logger[_0xbd76('0xd')](_0xbd76('0x15'),_0x214188,_0x1060e6[0x1],_0x5ba419[_0xbd76('0x10')],_0x5ba419['interaction']['id']);})['catch'](function(_0x5a2967){logger[_0xbd76('0xb')]('[%s][TAG]\x20%s',_0x214188,JSON[_0xbd76('0x16')](_0x5a2967));logger[_0xbd76('0xd')](_0xbd76('0xe'),_0x214188);})[_0xbd76('0x17')](function(){_0x313ba4[_0xbd76('0xf')]();});}}}catch(_0x2eeef9){logger[_0xbd76('0xb')](_0xbd76('0xc'),_0x214188,_['isObject'](_0x2eeef9)?JSON['stringify'](_0x2eeef9):_0x2eeef9);logger[_0xbd76('0xd')](_0xbd76('0xe'),_0x214188);_0x313ba4['next']();}};}; \ No newline at end of file +var _0x36d6=['then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','[%s][TAG]\x20%s','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','interaction'];(function(_0xcf3333,_0x3181e7){var _0x2d7bc9=function(_0x5d12be){while(--_0x5d12be){_0xcf3333['push'](_0xcf3333['shift']());}};_0x2d7bc9(++_0x3181e7);}(_0x36d6,0xc3));var _0x636d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36d6[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x636d('0x0'));var _=require(_0x636d('0x1'));var rpc={'chatInteraction':require(_0x636d('0x2')),'openchannelInteraction':require(_0x636d('0x3')),'smsInteraction':require(_0x636d('0x4')),'mailInteraction':require(_0x636d('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x636d('0x6'))};var logger=require(_0x636d('0x7'))(_0x636d('0x8'));var tag=schema({'tag':{'type':_0x636d('0x9'),'required':!![],'message':_0x636d('0xa')}});exports[_0x636d('0xb')]=function(_0x1fa82b,_0x5dcded,_0x1b717f,_0xb6df2d){return function(_0x379866){try{var _0x58f2ac={'tag':_0x5dcded[0x0]};var _0x44eb68=tag['validate'](_0x58f2ac,{'typecast':!![]});if(_0x44eb68[_0x636d('0xc')]){logger[_0x636d('0xd')]('[%s][TAG]\x20%s',_0x1fa82b,_[_0x636d('0xe')](_0x44eb68,_0x636d('0xf'))['join'](',\x20'));logger[_0x636d('0x10')](_0x636d('0x11'),_0x1fa82b);_0x379866[_0x636d('0x12')]();}else{var _0x38beb2={'ids':[_0x5dcded[0x0]]};if(rpc[_0xb6df2d['channel']+_0x636d('0x13')]){rpc[_0xb6df2d['channel']+_0x636d('0x13')]['addTags'](_0xb6df2d[_0x636d('0x14')]['id'],_0x38beb2)[_0x636d('0x15')](function(_0x83d779){logger['info'](_0x636d('0x16'),_0x1fa82b,_0x5dcded[0x1],_0xb6df2d['channel'],_0xb6df2d[_0x636d('0x14')]['id']);})['catch'](function(_0x180021){logger[_0x636d('0xd')](_0x636d('0x17'),_0x1fa82b,JSON['stringify'](_0x180021));logger[_0x636d('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1fa82b);})[_0x636d('0x18')](function(){_0x379866[_0x636d('0x12')]();});}}}catch(_0x5c2c9f){logger[_0x636d('0xd')](_0x636d('0x17'),_0x1fa82b,_[_0x636d('0x19')](_0x5c2c9f)?JSON[_0x636d('0x1a')](_0x5c2c9f):_0x5c2c9f);logger[_0x636d('0x10')](_0x636d('0x11'),_0x1fa82b);_0x379866[_0x636d('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 4561566..44bfc16 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(_0x32af8e,_0x44b7ce){var _0x48bb84=function(_0x4af7b9){while(--_0x4af7b9){_0x32af8e['push'](_0x32af8e['shift']());}};_0x48bb84(++_0x44b7ce);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0xc777d0,_0x4359fb){var _0x25f5bc=function(_0x598503){while(--_0x598503){_0xc777d0['push'](_0xc777d0['shift']());}};_0x25f5bc(++_0x4359fb);}(_0xe706,0xa3));var _0x6e70=function(_0x3357b8,_0xeb406){_0x3357b8=_0x3357b8-0x0;var _0x50737a=_0xe706[_0x3357b8];return _0x50737a;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 728f284..a32e78c 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 _0x4b55=['available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','message','tag','TagId','./interval','condition','intervals','./applications/','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues'];(function(_0x393f59,_0x27faa4){var _0x55eca2=function(_0x261e69){while(--_0x261e69){_0x393f59['push'](_0x393f59['shift']());}};_0x55eca2(++_0x27faa4);}(_0x4b55,0xcc));var _0x54b5=function(_0x1d344b,_0x3a2a0a){_0x1d344b=_0x1d344b-0x0;var _0x4f3b20=_0x4b55[_0x1d344b];return _0x4f3b20;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x54b5('0x0'));var fs=require('fs');var jayson=require(_0x54b5('0x1'));var BPromise=require(_0x54b5('0x2'));var uuid=require(_0x54b5('0x3'));var config=require(_0x54b5('0x4'));var logger=require(_0x54b5('0x5'))(_0x54b5('0x6'));var rpc={'openchannelQueueReport':require(_0x54b5('0x7')),'mailQueueReport':require(_0x54b5('0x8')),'chatQueueReport':require(_0x54b5('0x9')),'smsQueueReport':require(_0x54b5('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x54b5('0xb'))};var RuleEngine=require(_0x54b5('0xc'));function getId(_0x492cd2,_0x1b2491,_0x127e59){return util[_0x54b5('0xd')](_0x54b5('0xe'),_0x492cd2,_0x1b2491||0x0,_0x127e59||0x0);}function getIntervals(_0x2ea9ee,_0x46bbd3){var _0x354294=[];if(!_[_0x54b5('0xf')](_0x46bbd3[_0x54b5('0x10')])&&!_[_0x54b5('0xf')](_0x2ea9ee[_0x46bbd3[_0x54b5('0x10')]])&&!_[_0x54b5('0xf')](_0x2ea9ee[_0x46bbd3[_0x54b5('0x10')]][_0x54b5('0x11')])){_0x354294=_[_0x54b5('0x12')](_0x2ea9ee[_0x46bbd3[_0x54b5('0x10')]][_0x54b5('0x11')],_0x54b5('0x13'));}else if(!_[_0x54b5('0xf')](_0x46bbd3[_0x54b5('0x13')])){_0x354294=[_0x46bbd3[_0x54b5('0x13')]];}return _0x354294;}exports[_0x54b5('0x14')]=function(_0x2880a5){_0x2880a5[_0x54b5('0x15')]={};return new BPromise(function(_0x561d14,_0x194815){var _0x523f92={'Start':function(_0x594727){var _0x10fa4c=this;return new Promise(function(_0x3549b0,_0x134afa){if(_0x594727){try{var _0x283691=[];var _0x22ca81=getId(_0x594727[_0x54b5('0x16')],_0x594727['message']?_0x594727['message']['id']:0x0,_0x594727[_0x54b5('0x17')]?_0x594727['interaction']['id']:0x0);if(_0x594727[_0x54b5('0x18')]&&_['isArray'](_0x594727[_0x54b5('0x18')])&&_0x594727[_0x54b5('0x18')][_0x54b5('0x19')]){for(var _0xc2a709=0x0;_0xc2a709<_0x594727[_0x54b5('0x18')][_0x54b5('0x19')];_0xc2a709+=0x1){var _0xf9bebc=_0x594727[_0x54b5('0x18')][_0xc2a709];if(fs[_0x54b5('0x1a')](path[_0x54b5('0x1b')](__dirname,_0x54b5('0x18'),_0xf9bebc[_0x54b5('0x1c')]+_0x54b5('0x1d')))){var _0x44af4c=[];switch(_0xf9bebc[_0x54b5('0x1c')][_0x54b5('0x1e')]()){case _0x54b5('0x1f'):var _0x591fb9=_0xf9bebc[_0x54b5('0x20')][_0x54b5('0x21')](',');if(_0x594727['channel']===_0x54b5('0x22')){_0x44af4c[_0x54b5('0x23')](_0x591fb9[0x0]);_0x44af4c[_0x54b5('0x23')](_0x591fb9[0x1]);_0x44af4c['push'](_0x591fb9[_0x54b5('0x24')](0x2,_0x591fb9['length'])['join'](','));}else{_0x44af4c['push'](_0x591fb9[0x0]);_0x44af4c[_0x54b5('0x23')](_0x591fb9['slice'](0x1,_0x591fb9[_0x54b5('0x19')])['join'](','));}break;case'dialogflow':var _0xcea20c=_0xf9bebc[_0x54b5('0x20')][_0x54b5('0x21')](',');_0x44af4c[_0x54b5('0x23')](_0xcea20c[0x0]);_0x44af4c[_0x54b5('0x23')](_0xcea20c[0x1]);_0x44af4c[_0x54b5('0x23')](_0xcea20c['slice'](0x2,_0xcea20c[_0x54b5('0x19')])['join'](','));break;case _0x54b5('0x25'):var _0x217bb3=_0xf9bebc[_0x54b5('0x20')]['split'](',');_0x44af4c[_0x54b5('0x23')](_0x217bb3[0x0]);_0x44af4c['push'](_0x217bb3[0x1]);_0x44af4c['push'](_0x217bb3[0x2]);_0x44af4c[_0x54b5('0x23')](_0x217bb3[0x3]);_0x44af4c['push'](_0x217bb3[_0x54b5('0x24')](0x4,_0x217bb3[_0x54b5('0x19')])[_0x54b5('0x1b')](','));break;case _0x54b5('0x26'):var _0x1a50e9=_0xf9bebc[_0x54b5('0x20')]['split'](',');_0x44af4c['push'](_0x1a50e9[0x0]);_0x44af4c['push'](_0x1a50e9[0x1]);_0x44af4c[_0x54b5('0x23')](_0x1a50e9[0x2]);_0x44af4c[_0x54b5('0x23')](_0x1a50e9[0x3]);_0x44af4c[_0x54b5('0x23')](_0x1a50e9[_0x54b5('0x24')](0x4,_0x1a50e9[_0x54b5('0x19')])['join'](','));break;case _0x54b5('0x27'):_0x44af4c[_0x54b5('0x23')](_0xf9bebc[_0x54b5('0x20')]);break;case _0x54b5('0x28'):_0x44af4c['push'](_0xf9bebc[_0x54b5('0x29')]);_0x44af4c[_0x54b5('0x23')](_0xf9bebc[_0x54b5('0x20')]);break;default:_0x44af4c=_[_0x54b5('0xf')](_0xf9bebc[_0x54b5('0x20')])?[]:_0xf9bebc[_0x54b5('0x20')][_0x54b5('0x21')](',');}var _0x32bfcf={'id':util[_0x54b5('0xd')]('%s:%s:%s',_0x22ca81,_0xf9bebc['id'],_0xf9bebc['app']),'condition':require(_0x54b5('0x2a'))[_0x54b5('0x2b')](_0x22ca81,getIntervals(_0x2880a5[_0x54b5('0x2c')],_0xf9bebc),_0x2880a5),'consequence':require(_0x54b5('0x2d')+_0xf9bebc[_0x54b5('0x1c')])['consequence'](_0x22ca81,_0x44af4c,_0x2880a5,_0x594727),'p':_0xf9bebc['priority']||0x0};logger[_0x54b5('0x2e')](_0x54b5('0x2f'),_0x32bfcf['id'],_0x54b5('0x30'),getIntervals(_0x2880a5[_0x54b5('0x2c')],_0xf9bebc)[_0x54b5('0x1b')](_0x54b5('0x31')));_0x283691[_0x54b5('0x23')](_0x32bfcf);}else{logger[_0x54b5('0x32')](_0x54b5('0x33'),path[_0x54b5('0x1b')](__dirname,_0x54b5('0x18'),_0xf9bebc[_0x54b5('0x1c')]+_0x54b5('0x1d')));}}_0x2880a5[_0x54b5('0x15')][_0x22ca81]=new RuleEngine(_0x283691);_0x2880a5[_0x54b5('0x15')][_0x22ca81][_0x54b5('0x34')](_0x594727,function(_0x404168){logger['info'](_0x54b5('0x35'),JSON[_0x54b5('0x36')](_0x404168['matchPath']));if(_0x2880a5[_0x54b5('0x15')][_0x22ca81]){_0x2880a5['rules'][_0x22ca81][_0x54b5('0x37')](_0x54b5('0x38'));}});return _0x3549b0({'code':0xc8,'message':_0x594727});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x3549b0({'code':0xc8,'message':_0x594727});}}catch(_0x455ed6){logger['error'](_0x455ed6[_0x54b5('0x39')]);return _0x134afa(_0x10fa4c['error'](0x1f4,_0x455ed6));}}return _0x134afa(_0x54b5('0x3a'));});},'AcceptMessage':function(_0x3585f6){var _0x4fb2d5=this;return new Promise(function(_0x3f48dd,_0x54e297){if(_0x3585f6['agent']&&_0x3585f6[_0x54b5('0x3b')]['id']){if(_0x2880a5['agents'][_0x3585f6[_0x54b5('0x3b')]['id']]){_0x2880a5[_0x54b5('0x3c')][_0x3585f6[_0x54b5('0x3b')]['id']][_0x54b5('0x3d')]=![];_0x2880a5[_0x54b5('0x3c')][_0x3585f6[_0x54b5('0x3b')]['id']][_0x54b5('0x3e')]=undefined;}}if(_0x3585f6[_0x54b5('0x27')]&&_0x3585f6[_0x54b5('0x27')]['id']){try{var _0x4fc366=getId(_0x3585f6[_0x54b5('0x16')],_0x3585f6[_0x54b5('0x27')]?_0x3585f6[_0x54b5('0x27')]['id']:0x0,_0x3585f6['interaction']?_0x3585f6[_0x54b5('0x17')]['id']:0x0);if(_0x2880a5[_0x54b5('0x15')][_0x4fc366]){_0x2880a5[_0x54b5('0x15')][_0x4fc366][_0x54b5('0x37')](_0x54b5('0x3f'));if(rpc[_0x3585f6[_0x54b5('0x16')]+_0x54b5('0x40')]){rpc[_0x3585f6[_0x54b5('0x16')]+'QueueReport'][_0x54b5('0x41')](_0x4fc366,{'UserId':_0x3585f6[_0x54b5('0x27')][_0x54b5('0x42')]})['catch'](function(_0xab568c){logger[_0x54b5('0x32')](_0x54b5('0x43'));});}}return _0x3f48dd({'code':0xc8,'message':_0x3585f6});}catch(_0x58e6a1){logger['error'](_0x58e6a1[_0x54b5('0x39')]);return _0x54e297(_0x4fb2d5[_0x54b5('0x32')](0x1f4,_0x58e6a1));}}logger[_0x54b5('0x32')](_0x54b5('0x44'));return _0x54e297(_0x4fb2d5[_0x54b5('0x32')](0x1f4,_0x54b5('0x44')));});},'RejectMessage':function(_0x57a81f){var _0x3d3450=this;return new Promise(function(_0x1fe0a1,_0xbe5611){if(_0x57a81f[_0x54b5('0x3b')]&&_0x57a81f[_0x54b5('0x3b')]['id']){try{if(_0x2880a5['agents'][_0x57a81f[_0x54b5('0x3b')]['id']]){_0x2880a5['agents'][_0x57a81f['agent']['id']][_0x54b5('0x3d')]=![];_0x2880a5['agents'][_0x57a81f['agent']['id']][_0x54b5('0x3e')]=undefined;}return _0x1fe0a1({'code':0xc8,'message':_0x57a81f});}catch(_0x121d2d){logger[_0x54b5('0x32')](_0x121d2d[_0x54b5('0x39')]);return _0xbe5611(_0x3d3450[_0x54b5('0x32')](0x1f4,_0x121d2d));}}logger[_0x54b5('0x32')](_0x54b5('0x44'));return _0xbe5611(_0x3d3450[_0x54b5('0x32')](0x1f4,_0x54b5('0x44')));});},'AbandonInteraction':function(_0x5b84c5){var _0x2b13d1=this;return new Promise(function(_0x4d3284,_0x12b2d7){if(_0x5b84c5['channel']&&_0x5b84c5[_0x54b5('0x17')]&&_0x5b84c5[_0x54b5('0x17')]['id']){try{var _0x59fa3b=getId(_0x5b84c5['channel'],_0x5b84c5['message']?_0x5b84c5[_0x54b5('0x27')]['id']:0x0,_0x5b84c5['interaction']?_0x5b84c5[_0x54b5('0x17')]['id']:0x0);if(_0x2880a5[_0x54b5('0x15')][_0x59fa3b]){_0x2880a5[_0x54b5('0x15')][_0x59fa3b][_0x54b5('0x37')](_0x54b5('0x3f'));}return _0x4d3284({'code':0xc8,'message':_0x5b84c5});}catch(_0x5a4eb3){logger['error'](_0x5a4eb3['stack']);return _0x12b2d7(_0x2b13d1[_0x54b5('0x32')](0x1f4,_0x5a4eb3));}}logger[_0x54b5('0x32')](_0x54b5('0x44'));return _0x12b2d7(_0x2b13d1[_0x54b5('0x32')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5f79cf){var _0x1592d6=this;return new Promise(function(_0x52f145,_0x41ddaf){if(_0x2880a5[_0x54b5('0x3c')][_0x54b5('0x45')](_0x5f79cf['id'])){for(var _0x2aeb84 in _0x5f79cf[_0x54b5('0x46')]){if(_0x5f79cf[_0x54b5('0x46')]['hasOwnProperty'](_0x2aeb84)){if(_0x2880a5[_0x54b5('0x3c')][_0x5f79cf['id']]['hasOwnProperty'](_0x2aeb84+_0x54b5('0x47'))){_0x2880a5[_0x54b5('0x3c')][_0x5f79cf['id']][_0x2aeb84+_0x54b5('0x47')]=parseInt(_0x5f79cf['capacity'][_0x2aeb84],0xa);}}}_0x2880a5[_0x54b5('0x3c')][_0x5f79cf['id']][_0x54b5('0x48')]();return _0x52f145({'code':0xc8,'message':_0x2880a5['agents'][_0x5f79cf['id']]});}else{return _0x41ddaf(_0x1592d6[_0x54b5('0x32')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2b7162){return new Promise(function(_0x4cb39a,_0x3502f7){var _0x23f593=_[_0x54b5('0x49')](_0x2880a5['agents']);_0x4cb39a({'count':_0x23f593[_0x54b5('0x19')],'rows':_0x23f593});});},'ChatQueues':function(_0x12c53e){return new Promise(function(_0x11fc9e,_0x12e7fa){var _0x24b559=[];for(var _0x25252c in _0x2880a5[_0x54b5('0x4a')]){if(_0x2880a5['chatQueues'][_0x54b5('0x45')](_0x25252c)){var _0x2f69d1=_0x2880a5['chatQueues'][_0x25252c];var _0x30a1c3={'id':_0x2f69d1['id'],'available':_0x2f69d1[_0x54b5('0x4b')],'loggedIn':_0x2f69d1[_0x54b5('0x4c')],'name':_0x2f69d1[_0x54b5('0x4d')],'paused':_0x2f69d1['paused'],'waiting':_0x2f69d1[_0x54b5('0x4e')]};_0x24b559['push'](_0x30a1c3);}}_0x11fc9e({'count':_0x24b559[_0x54b5('0x19')],'rows':_0x24b559});});},'MailQueues':function(_0x57807d){return new Promise(function(_0x250ff0,_0x5bd949){var _0x4d57b9=[];for(var _0xe4342b in _0x2880a5[_0x54b5('0x4f')]){if(_0x2880a5[_0x54b5('0x4f')][_0x54b5('0x45')](_0xe4342b)){var _0x28c290=_0x2880a5[_0x54b5('0x4f')][_0xe4342b];var _0x3c4cb3={'id':_0x28c290['id'],'available':_0x28c290['available'],'loggedIn':_0x28c290[_0x54b5('0x4c')],'name':_0x28c290[_0x54b5('0x4d')],'paused':_0x28c290[_0x54b5('0x50')],'waiting':_0x28c290[_0x54b5('0x4e')]};_0x4d57b9[_0x54b5('0x23')](_0x3c4cb3);}}_0x250ff0({'count':_0x4d57b9['length'],'rows':_0x4d57b9});});},'OpenchannelQueues':function(_0x4bca0e){return new Promise(function(_0xfdb87a,_0x47ab6a){var _0x37644c=[];for(var _0x4ea91e in _0x2880a5[_0x54b5('0x51')]){if(_0x2880a5[_0x54b5('0x51')][_0x54b5('0x45')](_0x4ea91e)){var _0x505fb8=_0x2880a5['openchannelQueues'][_0x4ea91e];var _0x5e4992={'id':_0x505fb8['id'],'available':_0x505fb8[_0x54b5('0x4b')],'loggedIn':_0x505fb8['loggedIn'],'name':_0x505fb8['name'],'paused':_0x505fb8[_0x54b5('0x50')],'waiting':_0x505fb8[_0x54b5('0x4e')]};_0x37644c['push'](_0x5e4992);}}_0xfdb87a({'count':_0x37644c[_0x54b5('0x19')],'rows':_0x37644c});});},'SmsQueues':function(_0x17bdd3){return new Promise(function(_0x5ea088,_0x201677){var _0x24166e=[];for(var _0x47932f in _0x2880a5[_0x54b5('0x52')]){if(_0x2880a5['smsQueues']['hasOwnProperty'](_0x47932f)){var _0x41a184=_0x2880a5[_0x54b5('0x52')][_0x47932f];var _0x5bfcdf={'id':_0x41a184['id'],'available':_0x41a184['available'],'loggedIn':_0x41a184[_0x54b5('0x4c')],'name':_0x41a184['name'],'paused':_0x41a184[_0x54b5('0x50')],'waiting':_0x41a184[_0x54b5('0x4e')]};_0x24166e['push'](_0x5bfcdf);}}_0x5ea088({'count':_0x24166e[_0x54b5('0x19')],'rows':_0x24166e});});},'FaxQueues':function(_0x2487b6){return new Promise(function(_0x4299ad,_0x5ed1ff){var _0x1d4be8=[];for(var _0x1209e5 in _0x2880a5[_0x54b5('0x53')]){if(_0x2880a5[_0x54b5('0x53')]['hasOwnProperty'](_0x1209e5)){var _0x4f373b=_0x2880a5[_0x54b5('0x53')][_0x1209e5];var _0x5e79a2={'id':_0x4f373b['id'],'available':_0x4f373b['available'],'loggedIn':_0x4f373b[_0x54b5('0x4c')],'name':_0x4f373b[_0x54b5('0x4d')],'paused':_0x4f373b[_0x54b5('0x50')],'waiting':_0x4f373b['waiting']};_0x1d4be8['push'](_0x5e79a2);}}_0x4299ad({'count':_0x1d4be8[_0x54b5('0x19')],'rows':_0x1d4be8});});},'WhatsappQueues':function(_0x555db4){return new Promise(function(_0x580bb6,_0x7a8606){var _0x5c4041=[];for(var _0x25830b in _0x2880a5['whatsappQueues']){if(_0x2880a5[_0x54b5('0x54')][_0x54b5('0x45')](_0x25830b)){var _0x1eb589=_0x2880a5[_0x54b5('0x54')][_0x25830b];var _0x1eba7b={'id':_0x1eb589['id'],'available':_0x1eb589[_0x54b5('0x4b')],'loggedIn':_0x1eb589[_0x54b5('0x4c')],'name':_0x1eb589[_0x54b5('0x4d')],'paused':_0x1eb589[_0x54b5('0x50')],'waiting':_0x1eb589['waiting']};_0x5c4041[_0x54b5('0x23')](_0x1eba7b);}}_0x580bb6({'count':_0x5c4041['length'],'rows':_0x5c4041});});},'ChatQueuesWaitingInteractions':function(_0x1d4a1f){return new Promise(function(_0x5a9d7b,_0x7daa76){var _0x1703e6=_[_0x54b5('0x49')](_0x2880a5['chatQueuesWaitingInteractions']);_0x5a9d7b({'count':_0x1703e6[_0x54b5('0x19')],'rows':_0x1703e6});});},'MailQueuesWaitingInteractions':function(_0x297234){return new Promise(function(_0x3c940c,_0x254ff4){var _0x1b52c9=_[_0x54b5('0x49')](_0x2880a5[_0x54b5('0x55')]);_0x3c940c({'count':_0x1b52c9[_0x54b5('0x19')],'rows':_0x1b52c9});});},'OpenchannelQueuesWaitingInteractions':function(_0x4c87eb){return new Promise(function(_0x2f8bd9,_0x560842){var _0x2350a4=_['values'](_0x2880a5[_0x54b5('0x56')]);_0x2f8bd9({'count':_0x2350a4[_0x54b5('0x19')],'rows':_0x2350a4});});},'SmsQueuesWaitingInteractions':function(_0x27c4c4){return new Promise(function(_0x45502b,_0x4020f7){var _0x19a40b=_['values'](_0x2880a5[_0x54b5('0x57')]);_0x45502b({'count':_0x19a40b[_0x54b5('0x19')],'rows':_0x19a40b});});},'FaxQueuesWaitingInteractions':function(_0x3b1c59){return new Promise(function(_0x423eb5,_0x334213){var _0x55e195=_[_0x54b5('0x49')](_0x2880a5['faxQueuesWaitingInteractions']);_0x423eb5({'count':_0x55e195[_0x54b5('0x19')],'rows':_0x55e195});});},'WhatsappQueuesWaitingInteractions':function(_0x3c9ada){return new Promise(function(_0x10d625,_0x38ca8a){var _0x5c4c4d=_[_0x54b5('0x49')](_0x2880a5[_0x54b5('0x58')]);_0x10d625({'count':_0x5c4c4d[_0x54b5('0x19')],'rows':_0x5c4c4d});});}};var _0x51019c=jayson[_0x54b5('0x59')](_0x523f92)[_0x54b5('0x5a')]();_0x51019c['on'](_0x54b5('0x32'),function(_0x59ac7a){logger[_0x54b5('0x32')](JSON[_0x54b5('0x36')](_0x59ac7a));return _0x194815(_0x59ac7a);});_0x51019c['listen'](0x232c,'127.0.0.1',function(){console[_0x54b5('0x5b')](_0x54b5('0x5c'),0x232c);return _0x561d14('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x4727=['end','QueueReport','update','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','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/logger','routing','../rpc/openchannelQueueReport','../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','interaction','isArray','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','split','mail','slice','push','appdata','dialogflowv2','amazonlex','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue'];(function(_0x67c5cb,_0x3f9d95){var _0x488e97=function(_0x471bd4){while(--_0x471bd4){_0x67c5cb['push'](_0x67c5cb['shift']());}};_0x488e97(++_0x3f9d95);}(_0x4727,0x83));var _0x7472=function(_0x1c6db4,_0x56b151){_0x1c6db4=_0x1c6db4-0x0;var _0x544b1a=_0x4727[_0x1c6db4];return _0x544b1a;};'use strict';var _=require(_0x7472('0x0'));var util=require(_0x7472('0x1'));var path=require(_0x7472('0x2'));var fs=require('fs');var jayson=require(_0x7472('0x3'));var BPromise=require(_0x7472('0x4'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0x7472('0x5'))(_0x7472('0x6'));var rpc={'openchannelQueueReport':require(_0x7472('0x7')),'mailQueueReport':require(_0x7472('0x8')),'chatQueueReport':require(_0x7472('0x9')),'smsQueueReport':require(_0x7472('0xa')),'faxQueueReport':require(_0x7472('0xb')),'whatsappQueueReport':require(_0x7472('0xc'))};var RuleEngine=require(_0x7472('0xd'));function getId(_0x970251,_0x412895,_0x46d3a9){return util[_0x7472('0xe')](_0x7472('0xf'),_0x970251,_0x412895||0x0,_0x46d3a9||0x0);}function getIntervals(_0x5d8132,_0x48902f){var _0x521a39=[];if(!_[_0x7472('0x10')](_0x48902f['IntervalId'])&&!_[_0x7472('0x10')](_0x5d8132[_0x48902f[_0x7472('0x11')]])&&!_['isNil'](_0x5d8132[_0x48902f[_0x7472('0x11')]][_0x7472('0x12')])){_0x521a39=_[_0x7472('0x13')](_0x5d8132[_0x48902f[_0x7472('0x11')]]['Intervals'],_0x7472('0x14'));}else if(!_[_0x7472('0x10')](_0x48902f['interval'])){_0x521a39=[_0x48902f['interval']];}return _0x521a39;}exports[_0x7472('0x15')]=function(_0x4a267b){_0x4a267b[_0x7472('0x16')]={};return new BPromise(function(_0x56826d,_0x4cb432){var _0x123819={'Start':function(_0xb2030a){var _0x34143f=this;return new Promise(function(_0x33e76d,_0x2bd2bc){if(_0xb2030a){try{var _0x2c49bd=[];var _0x36e794=getId(_0xb2030a[_0x7472('0x17')],_0xb2030a[_0x7472('0x18')]?_0xb2030a[_0x7472('0x18')]['id']:0x0,_0xb2030a[_0x7472('0x19')]?_0xb2030a['interaction']['id']:0x0);if(_0xb2030a['applications']&&_[_0x7472('0x1a')](_0xb2030a['applications'])&&_0xb2030a[_0x7472('0x1b')][_0x7472('0x1c')]){for(var _0x2e65cc=0x0;_0x2e65cc<_0xb2030a[_0x7472('0x1b')][_0x7472('0x1c')];_0x2e65cc+=0x1){var _0x45e228=_0xb2030a['applications'][_0x2e65cc];if(fs[_0x7472('0x1d')](path[_0x7472('0x1e')](__dirname,_0x7472('0x1b'),_0x45e228[_0x7472('0x1f')]+_0x7472('0x20')))){var _0x5070c9=[];switch(_0x45e228['app'][_0x7472('0x21')]()){case _0x7472('0x22'):var _0x5663eb=_0x45e228['appdata'][_0x7472('0x23')](',');if(_0xb2030a[_0x7472('0x17')]===_0x7472('0x24')){_0x5070c9['push'](_0x5663eb[0x0]);_0x5070c9['push'](_0x5663eb[0x1]);_0x5070c9['push'](_0x5663eb[_0x7472('0x25')](0x2,_0x5663eb[_0x7472('0x1c')])[_0x7472('0x1e')](','));}else{_0x5070c9[_0x7472('0x26')](_0x5663eb[0x0]);_0x5070c9[_0x7472('0x26')](_0x5663eb[_0x7472('0x25')](0x1,_0x5663eb['length'])['join'](','));}break;case'dialogflow':var _0x415d3f=_0x45e228[_0x7472('0x27')][_0x7472('0x23')](',');_0x5070c9[_0x7472('0x26')](_0x415d3f[0x0]);_0x5070c9[_0x7472('0x26')](_0x415d3f[0x1]);_0x5070c9['push'](_0x415d3f[_0x7472('0x25')](0x2,_0x415d3f[_0x7472('0x1c')])[_0x7472('0x1e')](','));break;case _0x7472('0x28'):var _0x244974=_0x45e228[_0x7472('0x27')][_0x7472('0x23')](',');_0x5070c9[_0x7472('0x26')](_0x244974[0x0]);_0x5070c9[_0x7472('0x26')](_0x244974[0x1]);_0x5070c9['push'](_0x244974[0x2]);_0x5070c9[_0x7472('0x26')](_0x244974[0x3]);_0x5070c9[_0x7472('0x26')](_0x244974[_0x7472('0x25')](0x4,_0x244974[_0x7472('0x1c')])[_0x7472('0x1e')](','));break;case _0x7472('0x29'):var _0x12c4aa=_0x45e228['appdata']['split'](',');_0x5070c9[_0x7472('0x26')](_0x12c4aa[0x0]);_0x5070c9['push'](_0x12c4aa[0x1]);_0x5070c9[_0x7472('0x26')](_0x12c4aa[0x2]);_0x5070c9[_0x7472('0x26')](_0x12c4aa[0x3]);_0x5070c9[_0x7472('0x26')](_0x12c4aa[_0x7472('0x25')](0x4,_0x12c4aa[_0x7472('0x1c')])[_0x7472('0x1e')](','));break;case _0x7472('0x18'):_0x5070c9[_0x7472('0x26')](_0x45e228[_0x7472('0x27')]);break;case'tag':_0x5070c9[_0x7472('0x26')](_0x45e228['TagId']);_0x5070c9[_0x7472('0x26')](_0x45e228['appdata']);break;default:_0x5070c9=_[_0x7472('0x10')](_0x45e228['appdata'])?[]:_0x45e228[_0x7472('0x27')][_0x7472('0x23')](',');}var _0x1b25a2={'id':util[_0x7472('0xe')](_0x7472('0x2a'),_0x36e794,_0x45e228['id'],_0x45e228[_0x7472('0x1f')]),'condition':require(_0x7472('0x2b'))[_0x7472('0x2c')](_0x36e794,getIntervals(_0x4a267b[_0x7472('0x2d')],_0x45e228),_0x4a267b),'consequence':require(_0x7472('0x2e')+_0x45e228['app'])[_0x7472('0x2f')](_0x36e794,_0x5070c9,_0x4a267b,_0xb2030a),'p':_0x45e228[_0x7472('0x30')]||0x0};logger[_0x7472('0x31')](_0x7472('0x32'),_0x1b25a2['id'],_0x7472('0x33'),getIntervals(_0x4a267b[_0x7472('0x2d')],_0x45e228)[_0x7472('0x1e')](_0x7472('0x34')));_0x2c49bd[_0x7472('0x26')](_0x1b25a2);}else{logger[_0x7472('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x7472('0x1e')](__dirname,_0x7472('0x1b'),_0x45e228[_0x7472('0x1f')]+_0x7472('0x20')));}}_0x4a267b[_0x7472('0x16')][_0x36e794]=new RuleEngine(_0x2c49bd);_0x4a267b[_0x7472('0x16')][_0x36e794][_0x7472('0x36')](_0xb2030a,function(_0x42c445){logger[_0x7472('0x31')](_0x7472('0x37'),JSON['stringify'](_0x42c445['matchPath']));if(_0x4a267b[_0x7472('0x16')][_0x36e794]){_0x4a267b[_0x7472('0x16')][_0x36e794][_0x7472('0x38')](_0x7472('0x39'));}});return _0x33e76d({'code':0xc8,'message':_0xb2030a});}else{logger[_0x7472('0x31')](_0x7472('0x3a'));return _0x33e76d({'code':0xc8,'message':_0xb2030a});}}catch(_0x2d3f4a){logger[_0x7472('0x35')](_0x2d3f4a[_0x7472('0x3b')]);return _0x2bd2bc(_0x34143f[_0x7472('0x35')](0x1f4,_0x2d3f4a));}}return _0x2bd2bc(_0x7472('0x3c'));});},'AcceptMessage':function(_0x593523){var _0x173ec5=this;return new Promise(function(_0x161b6e,_0x5f0c5b){if(_0x593523['agent']&&_0x593523[_0x7472('0x3d')]['id']){if(_0x4a267b[_0x7472('0x3e')][_0x593523[_0x7472('0x3d')]['id']]){_0x4a267b['agents'][_0x593523[_0x7472('0x3d')]['id']][_0x7472('0x3f')]=![];_0x4a267b[_0x7472('0x3e')][_0x593523[_0x7472('0x3d')]['id']][_0x7472('0x40')]=undefined;}}if(_0x593523[_0x7472('0x18')]&&_0x593523[_0x7472('0x18')]['id']){try{var _0x1a6d50=getId(_0x593523[_0x7472('0x17')],_0x593523[_0x7472('0x18')]?_0x593523['message']['id']:0x0,_0x593523[_0x7472('0x19')]?_0x593523[_0x7472('0x19')]['id']:0x0);if(_0x4a267b[_0x7472('0x16')][_0x1a6d50]){_0x4a267b['rules'][_0x1a6d50][_0x7472('0x38')](_0x7472('0x41'));if(rpc[_0x593523['channel']+_0x7472('0x42')]){rpc[_0x593523['channel']+_0x7472('0x42')][_0x7472('0x43')](_0x1a6d50,{'UserId':_0x593523['message']['UserId']})[_0x7472('0x44')](function(_0x1eb28c){logger[_0x7472('0x35')]('error\x20update\x20queue\x20report');});}}return _0x161b6e({'code':0xc8,'message':_0x593523});}catch(_0x364e81){logger['error'](_0x364e81[_0x7472('0x3b')]);return _0x5f0c5b(_0x173ec5[_0x7472('0x35')](0x1f4,_0x364e81));}}logger['error'](_0x7472('0x45'));return _0x5f0c5b(_0x173ec5[_0x7472('0x35')](0x1f4,_0x7472('0x45')));});},'RejectMessage':function(_0x502ca5){var _0x18a950=this;return new Promise(function(_0x3bb2b3,_0x265d94){if(_0x502ca5[_0x7472('0x3d')]&&_0x502ca5['agent']['id']){try{if(_0x4a267b[_0x7472('0x3e')][_0x502ca5[_0x7472('0x3d')]['id']]){_0x4a267b[_0x7472('0x3e')][_0x502ca5['agent']['id']][_0x7472('0x3f')]=![];_0x4a267b['agents'][_0x502ca5[_0x7472('0x3d')]['id']][_0x7472('0x40')]=undefined;}return _0x3bb2b3({'code':0xc8,'message':_0x502ca5});}catch(_0x3ff505){logger['error'](_0x3ff505[_0x7472('0x3b')]);return _0x265d94(_0x18a950[_0x7472('0x35')](0x1f4,_0x3ff505));}}logger[_0x7472('0x35')](_0x7472('0x45'));return _0x265d94(_0x18a950[_0x7472('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x3de235){var _0x3e244d=this;return new Promise(function(_0x59f0be,_0x1f8820){if(_0x3de235[_0x7472('0x17')]&&_0x3de235[_0x7472('0x19')]&&_0x3de235[_0x7472('0x19')]['id']){try{var _0x391cc5=getId(_0x3de235[_0x7472('0x17')],_0x3de235[_0x7472('0x18')]?_0x3de235[_0x7472('0x18')]['id']:0x0,_0x3de235[_0x7472('0x19')]?_0x3de235[_0x7472('0x19')]['id']:0x0);if(_0x4a267b[_0x7472('0x16')][_0x391cc5]){_0x4a267b[_0x7472('0x16')][_0x391cc5]['emit'](_0x7472('0x41'));}return _0x59f0be({'code':0xc8,'message':_0x3de235});}catch(_0x52377b){logger['error'](_0x52377b['stack']);return _0x1f8820(_0x3e244d[_0x7472('0x35')](0x1f4,_0x52377b));}}logger[_0x7472('0x35')](_0x7472('0x45'));return _0x1f8820(_0x3e244d['error'](0x1f4,_0x7472('0x45')));});},'AgentCapacity':function(_0x45d628){var _0x2582e0=this;return new Promise(function(_0x188a2c,_0x76f337){if(_0x4a267b[_0x7472('0x3e')][_0x7472('0x46')](_0x45d628['id'])){for(var _0x23247d in _0x45d628[_0x7472('0x47')]){if(_0x45d628[_0x7472('0x47')][_0x7472('0x46')](_0x23247d)){if(_0x4a267b['agents'][_0x45d628['id']][_0x7472('0x46')](_0x23247d+_0x7472('0x48'))){_0x4a267b['agents'][_0x45d628['id']][_0x23247d+_0x7472('0x48')]=parseInt(_0x45d628[_0x7472('0x47')][_0x23247d],0xa);}}}_0x4a267b['agents'][_0x45d628['id']][_0x7472('0x49')]();return _0x188a2c({'code':0xc8,'message':_0x4a267b[_0x7472('0x3e')][_0x45d628['id']]});}else{return _0x76f337(_0x2582e0[_0x7472('0x35')](0x1f4,_0x7472('0x4a')));}});},'Agents':function(_0x1c16c1){return new Promise(function(_0xce068a,_0x251533){var _0x42caa4=_[_0x7472('0x4b')](_0x4a267b[_0x7472('0x3e')]);_0xce068a({'count':_0x42caa4[_0x7472('0x1c')],'rows':_0x42caa4});});},'ChatQueues':function(_0x5301d8){return new Promise(function(_0x4c1986,_0x5e8c37){var _0x1ed7dc=[];for(var _0x11e734 in _0x4a267b[_0x7472('0x4c')]){if(_0x4a267b['chatQueues'][_0x7472('0x46')](_0x11e734)){var _0x55f075=_0x4a267b[_0x7472('0x4c')][_0x11e734];var _0x1795f9={'id':_0x55f075['id'],'available':_0x55f075[_0x7472('0x4d')],'loggedIn':_0x55f075[_0x7472('0x4e')],'name':_0x55f075[_0x7472('0x4f')],'paused':_0x55f075[_0x7472('0x50')],'waiting':_0x55f075[_0x7472('0x51')]};_0x1ed7dc[_0x7472('0x26')](_0x1795f9);}}_0x4c1986({'count':_0x1ed7dc[_0x7472('0x1c')],'rows':_0x1ed7dc});});},'MailQueues':function(_0xdfe812){return new Promise(function(_0x50c29b,_0x31ef39){var _0x2304f8=[];for(var _0x56f8bf in _0x4a267b['mailQueues']){if(_0x4a267b[_0x7472('0x52')][_0x7472('0x46')](_0x56f8bf)){var _0x2a9280=_0x4a267b[_0x7472('0x52')][_0x56f8bf];var _0x198196={'id':_0x2a9280['id'],'available':_0x2a9280['available'],'loggedIn':_0x2a9280[_0x7472('0x4e')],'name':_0x2a9280[_0x7472('0x4f')],'paused':_0x2a9280[_0x7472('0x50')],'waiting':_0x2a9280[_0x7472('0x51')]};_0x2304f8[_0x7472('0x26')](_0x198196);}}_0x50c29b({'count':_0x2304f8['length'],'rows':_0x2304f8});});},'OpenchannelQueues':function(_0x320a57){return new Promise(function(_0x20e1a8,_0x1542d3){var _0x2f7c6d=[];for(var _0x18b521 in _0x4a267b['openchannelQueues']){if(_0x4a267b[_0x7472('0x53')]['hasOwnProperty'](_0x18b521)){var _0x28274c=_0x4a267b[_0x7472('0x53')][_0x18b521];var _0xa82dbc={'id':_0x28274c['id'],'available':_0x28274c[_0x7472('0x4d')],'loggedIn':_0x28274c['loggedIn'],'name':_0x28274c[_0x7472('0x4f')],'paused':_0x28274c[_0x7472('0x50')],'waiting':_0x28274c[_0x7472('0x51')]};_0x2f7c6d[_0x7472('0x26')](_0xa82dbc);}}_0x20e1a8({'count':_0x2f7c6d['length'],'rows':_0x2f7c6d});});},'SmsQueues':function(_0x54ec43){return new Promise(function(_0x5e9214,_0x3d9351){var _0x5cca6e=[];for(var _0x52abe5 in _0x4a267b['smsQueues']){if(_0x4a267b[_0x7472('0x54')]['hasOwnProperty'](_0x52abe5)){var _0x500438=_0x4a267b[_0x7472('0x54')][_0x52abe5];var _0x570178={'id':_0x500438['id'],'available':_0x500438['available'],'loggedIn':_0x500438['loggedIn'],'name':_0x500438[_0x7472('0x4f')],'paused':_0x500438['paused'],'waiting':_0x500438[_0x7472('0x51')]};_0x5cca6e[_0x7472('0x26')](_0x570178);}}_0x5e9214({'count':_0x5cca6e[_0x7472('0x1c')],'rows':_0x5cca6e});});},'FaxQueues':function(_0x386a15){return new Promise(function(_0x5cdeeb,_0x116a65){var _0x1eb56=[];for(var _0x7b35a6 in _0x4a267b['faxQueues']){if(_0x4a267b['faxQueues'][_0x7472('0x46')](_0x7b35a6)){var _0x43ddc9=_0x4a267b[_0x7472('0x55')][_0x7b35a6];var _0x470c1b={'id':_0x43ddc9['id'],'available':_0x43ddc9[_0x7472('0x4d')],'loggedIn':_0x43ddc9[_0x7472('0x4e')],'name':_0x43ddc9[_0x7472('0x4f')],'paused':_0x43ddc9['paused'],'waiting':_0x43ddc9[_0x7472('0x51')]};_0x1eb56[_0x7472('0x26')](_0x470c1b);}}_0x5cdeeb({'count':_0x1eb56['length'],'rows':_0x1eb56});});},'WhatsappQueues':function(_0x406eba){return new Promise(function(_0x3262a6,_0x550fb4){var _0x285617=[];for(var _0x507889 in _0x4a267b[_0x7472('0x56')]){if(_0x4a267b[_0x7472('0x56')][_0x7472('0x46')](_0x507889)){var _0x1f32bd=_0x4a267b['whatsappQueues'][_0x507889];var _0x2744eb={'id':_0x1f32bd['id'],'available':_0x1f32bd[_0x7472('0x4d')],'loggedIn':_0x1f32bd[_0x7472('0x4e')],'name':_0x1f32bd[_0x7472('0x4f')],'paused':_0x1f32bd['paused'],'waiting':_0x1f32bd[_0x7472('0x51')]};_0x285617[_0x7472('0x26')](_0x2744eb);}}_0x3262a6({'count':_0x285617[_0x7472('0x1c')],'rows':_0x285617});});},'ChatQueuesWaitingInteractions':function(_0x7b6427){return new Promise(function(_0x446e2b,_0x1a6110){var _0x48e56a=_['values'](_0x4a267b[_0x7472('0x57')]);_0x446e2b({'count':_0x48e56a[_0x7472('0x1c')],'rows':_0x48e56a});});},'MailQueuesWaitingInteractions':function(_0xb6004f){return new Promise(function(_0x260abc,_0x1cd233){var _0x265971=_[_0x7472('0x4b')](_0x4a267b[_0x7472('0x58')]);_0x260abc({'count':_0x265971['length'],'rows':_0x265971});});},'OpenchannelQueuesWaitingInteractions':function(_0x42bfde){return new Promise(function(_0x51392e,_0x5d3953){var _0x1ff21f=_[_0x7472('0x4b')](_0x4a267b[_0x7472('0x59')]);_0x51392e({'count':_0x1ff21f['length'],'rows':_0x1ff21f});});},'SmsQueuesWaitingInteractions':function(_0x116736){return new Promise(function(_0x4f2f8d,_0x5dbdd2){var _0x1eb799=_[_0x7472('0x4b')](_0x4a267b[_0x7472('0x5a')]);_0x4f2f8d({'count':_0x1eb799[_0x7472('0x1c')],'rows':_0x1eb799});});},'FaxQueuesWaitingInteractions':function(_0xe72634){return new Promise(function(_0x2db8f3,_0x45b927){var _0x2ed52b=_['values'](_0x4a267b['faxQueuesWaitingInteractions']);_0x2db8f3({'count':_0x2ed52b[_0x7472('0x1c')],'rows':_0x2ed52b});});},'WhatsappQueuesWaitingInteractions':function(_0x11f3a1){return new Promise(function(_0x57fba6,_0xb18608){var _0x134bf3=_[_0x7472('0x4b')](_0x4a267b[_0x7472('0x5b')]);_0x57fba6({'count':_0x134bf3[_0x7472('0x1c')],'rows':_0x134bf3});});}};var _0x1d6409=jayson[_0x7472('0x5c')](_0x123819)['http']();_0x1d6409['on'](_0x7472('0x35'),function(_0x2064e0){logger[_0x7472('0x35')](JSON[_0x7472('0x5d')](_0x2064e0));return _0x4cb432(_0x2064e0);});_0x1d6409[_0x7472('0x15')](0x232c,_0x7472('0x5e'),function(){console[_0x7472('0x5f')](_0x7472('0x60'),0x232c);return _0x56826d(_0x7472('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c140c2b..5115508 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 _0x8036=['log','stack','util','jayson/promise','lodash','client','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when'];(function(_0x36b771,_0x57e8d0){var _0x58dc31=function(_0xf1467e){while(--_0xf1467e){_0x36b771['push'](_0x36b771['shift']());}};_0x58dc31(++_0x57e8d0);}(_0x8036,0x89));var _0x6803=function(_0x4a34a9,_0xe439ad){_0x4a34a9=_0x4a34a9-0x0;var _0x50b73f=_0x8036[_0x4a34a9];return _0x50b73f;};'use strict';var util=require(_0x6803('0x0'));var BPromise=require('bluebird');var jayson=require(_0x6803('0x1'));var _=require(_0x6803('0x2'));var logger=require('../../../config/logger')('routing');var client=jayson[_0x6803('0x3')]['http']({'port':0x232a});function request(_0x40fc2b,_0x2c1b21){return new BPromise(function(_0x42ec48,_0x3f4776){return client['request'](_0x40fc2b,_0x2c1b21)['then'](function(_0x1ff1e1){if(_0x1ff1e1[_0x6803('0x4')]){return _0x3f4776(_0x1ff1e1[_0x6803('0x4')][_0x6803('0x5')]);}else{return _0x42ec48(_0x1ff1e1[_0x6803('0x6')]);}})[_0x6803('0x7')](function(_0x5c0e59){return _0x3f4776(_0x5c0e59);});});}exports[_0x6803('0x8')]=function(_0x2307e4,_0x5449f8,_0x272196){return function(_0x3d976e){if(_0x272196[_0x6803('0x9')]&&!_0x272196[_0x6803('0x9')][_0x2307e4]){logger[_0x6803('0xa')](_0x6803('0xb'),_0x2307e4);return _0x3d976e[_0x6803('0xc')]();}var _0x155466=[];for(var _0x1bcc08=0x0;_0x1bcc08<_0x5449f8['length'];_0x1bcc08+=0x1){_0x155466[_0x6803('0xd')](request(_0x6803('0xe'),{'command':util['format'](_0x6803('0xf'),_0x5449f8[_0x1bcc08])})[_0x6803('0x10')](function(_0x2eb025){return _0x2eb025&&_0x2eb025['message']&&_0x2eb025[_0x6803('0x5')][_0x6803('0x11')](_0x6803('0x12'))>=0x0?!![]:![];})[_0x6803('0x7')](function(_0x231159){logger[_0x6803('0x4')](_0x6803('0x13'),_0x2307e4,_0x5449f8[_0x1bcc08]);}));}BPromise[_0x6803('0x14')](_0x155466)[_0x6803('0x10')](function(_0x2080bd){var _0x475ab2=_[_0x6803('0x15')](_0x2080bd);logger[_0x6803('0xa')]('[%s][INTERVAL]\x20%s\x20%s',_0x2307e4,_0x5449f8[_0x6803('0x16')](_0x6803('0x17')),_0x475ab2);_0x3d976e[_0x6803('0x18')](_0x475ab2);})['catch'](function(_0x3e01cb){console[_0x6803('0x19')](_0x3e01cb);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x2307e4,_0x5449f8[_0x6803('0x16')](_0x6803('0x17')),_0x3e01cb[_0x6803('0x1a')]);_0x3d976e[_0x6803('0xc')]();});};}; \ No newline at end of file +var _0xbd42=['\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','bluebird','jayson/promise','lodash','routing','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','all','some','join'];(function(_0x1192c5,_0x399de4){var _0x1632dc=function(_0x46b814){while(--_0x46b814){_0x1192c5['push'](_0x1192c5['shift']());}};_0x1632dc(++_0x399de4);}(_0xbd42,0xd7));var _0x2bd4=function(_0x2a6c0d,_0x596838){_0x2a6c0d=_0x2a6c0d-0x0;var _0x4c9f43=_0xbd42[_0x2a6c0d];return _0x4c9f43;};'use strict';var util=require('util');var BPromise=require(_0x2bd4('0x0'));var jayson=require(_0x2bd4('0x1'));var _=require(_0x2bd4('0x2'));var logger=require('../../../config/logger')(_0x2bd4('0x3'));var client=jayson['client'][_0x2bd4('0x4')]({'port':0x232a});function request(_0x12c5d4,_0x91718){return new BPromise(function(_0x197895,_0x37d7f9){return client[_0x2bd4('0x5')](_0x12c5d4,_0x91718)[_0x2bd4('0x6')](function(_0x466446){if(_0x466446['error']){return _0x37d7f9(_0x466446[_0x2bd4('0x7')][_0x2bd4('0x8')]);}else{return _0x197895(_0x466446['result']);}})[_0x2bd4('0x9')](function(_0x325f05){return _0x37d7f9(_0x325f05);});});}exports[_0x2bd4('0xa')]=function(_0x2ec761,_0x4f2469,_0x1db19f){return function(_0x84fca6){if(_0x1db19f[_0x2bd4('0xb')]&&!_0x1db19f[_0x2bd4('0xb')][_0x2ec761]){logger[_0x2bd4('0xc')](_0x2bd4('0xd'),_0x2ec761);return _0x84fca6[_0x2bd4('0xe')]();}var _0x1f294d=[];for(var _0x1ea78c=0x0;_0x1ea78c<_0x4f2469[_0x2bd4('0xf')];_0x1ea78c+=0x1){_0x1f294d[_0x2bd4('0x10')](request(_0x2bd4('0x11'),{'command':util[_0x2bd4('0x12')](_0x2bd4('0x13'),_0x4f2469[_0x1ea78c])})[_0x2bd4('0x6')](function(_0x4ff1c5){return _0x4ff1c5&&_0x4ff1c5[_0x2bd4('0x8')]&&_0x4ff1c5['message'][_0x2bd4('0x14')](_0x2bd4('0x15'))>=0x0?!![]:![];})['catch'](function(_0x14d366){logger['error']('[%s][INTERVAL]\x20%s',_0x2ec761,_0x4f2469[_0x1ea78c]);}));}BPromise[_0x2bd4('0x16')](_0x1f294d)[_0x2bd4('0x6')](function(_0xb5053e){var _0x5cc51c=_[_0x2bd4('0x17')](_0xb5053e);logger[_0x2bd4('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x2ec761,_0x4f2469[_0x2bd4('0x18')](_0x2bd4('0x19')),_0x5cc51c);_0x84fca6[_0x2bd4('0x1a')](_0x5cc51c);})[_0x2bd4('0x9')](function(_0x508705){console[_0x2bd4('0x1b')](_0x508705);logger[_0x2bd4('0x7')](_0x2bd4('0x1c'),_0x2ec761,_0x4f2469[_0x2bd4('0x18')](_0x2bd4('0x19')),_0x508705[_0x2bd4('0x1d')]);_0x84fca6[_0x2bd4('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7d2446d..0ea5daa 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 _0x593e=['answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','agentconnectAt','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','acw','acwtime','agentacw','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','talktime','[%s][agents][agentconnect]','connect','answered_elsewhere'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x593e,0xcb));var _0xe593=function(_0x568365,_0x58699e){_0x568365=_0x568365-0x0;var _0x442a0d=_0x593e[_0x568365];return _0x442a0d;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var utils=require(_0xe593('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x28f28c,_0x43dabb){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x5'),_0x28f28c['uniqueid'],_0x28f28c[_0xe593('0x6')],_0x28f28c[_0xe593('0x7')],_0x28f28c[_0xe593('0x8')],_0x28f28c[_0xe593('0x9')],_0x28f28c[_0xe593('0xa')],_0x28f28c[_0xe593('0xb')],_0x28f28c[_0xe593('0xc')]));if(_0x28f28c[_0xe593('0x7')]){utils[_0xe593('0xd')](_0x28f28c[_0xe593('0x7')])['then'](function(_0x38c470){if(_0x38c470){_0x28f28c[_0xe593('0xe')]=_0x38c470[_0xe593('0xe')];_0x28f28c['agentacw']=_0x28f28c['agentcomplete']?_0x38c470[_0xe593('0xf')]:![];_0x28f28c[_0xe593('0x10')]=_0x28f28c[_0xe593('0x11')]?_0x38c470['acwTimeout']:0x0;}utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);});}else{utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);}if(_0x43dabb){delete transfers[_0x28f28c[_0xe593('0x14')]];}else{delete agents[_0x28f28c[_0xe593('0x15')]];}}exports[_0xe593('0x16')]=function(_0xa4d5e9){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcalled]',_0xa4d5e9[_0xe593('0x14')]),_0xa4d5e9);agents[_0xa4d5e9[_0xe593('0x15')]]=_0xa4d5e9;agents[_0xa4d5e9['destuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();agents[_0xa4d5e9['destuniqueid']][_0xe593('0xc')]=_0xe593('0x1a');agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0xb')]=null;agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x1b')]=null;utils['info'](util[_0xe593('0x4')](_0xe593('0x1c'),_0xa4d5e9['uniqueid'],agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x8')],_0xa4d5e9['destuniqueid']));}catch(_0x1c94aa){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x1e'),_0xa4d5e9[_0xe593('0x14')]),_0x1c94aa);}};exports[_0xe593('0x1f')]=function(_0x3d2a51){try{if(!_['isNil'](agents[_0x3d2a51['destuniqueid']])){utils[_0xe593('0x17')](util['format']('[%s][agents][agentringnoanswer]',_0x3d2a51[_0xe593('0x14')]),_0x3d2a51);utils[_0xe593('0x3')](util['format'](_0xe593('0x20'),_0x3d2a51['uniqueid'],agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x8')],_0x3d2a51[_0xe593('0x15')]));agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x1f')]=!![];agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x21')]=utils[_0xe593('0x19')]();agents[_0x3d2a51['destuniqueid']][_0xe593('0xc')]=_0xe593('0x22');agents[_0x3d2a51['destuniqueid']]['reason']=_0xe593('0x22');agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x23')]=_0x3d2a51[_0xe593('0x24')]?parseInt(_0x3d2a51[_0xe593('0x24')])/0x3e8:0x0;agents[_0x3d2a51[_0xe593('0x15')]]['talktime']=0x0;unanswered[_0xe593('0x25')](_0x3d2a51['destuniqueid']);}}catch(_0x1dacf6){utils[_0xe593('0x1d')](util['format'](_0xe593('0x26'),_0x3d2a51['uniqueid']),_0x1dacf6);}};exports[_0xe593('0x27')]=function(_0x1c147b){try{_[_0xe593('0x28')](agents,function(_0x501e54,_0x1ae8d9){if(_0x501e54[_0xe593('0x14')]==_0x1c147b[_0xe593('0x14')]&&!_[_0xe593('0x29')](unanswered,_0x501e54[_0xe593('0x15')])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x1c147b);utils[_0xe593('0x3')](util['format'](_0xe593('0x2a'),_0x1c147b['uniqueid'],_0x501e54[_0xe593('0x8')],_0x501e54[_0xe593('0x15')]));_0x501e54[_0xe593('0x1f')]=!![];_0x501e54[_0xe593('0x21')]=utils[_0xe593('0x19')]();_0x501e54[_0xe593('0xc')]=_0xe593('0x2b');_0x501e54[_0xe593('0x2c')]=_0xe593('0x2b');_0x501e54[_0xe593('0x23')]=_0x1c147b['holdtime'];_0x501e54[_0xe593('0x2d')]=0x0;writeDB(_0x501e54);}});}catch(_0x2c0a30){utils[_0xe593('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x2c0a30);}};exports['agentconnect']=function(_0x232bf1){try{if(agents[_0x232bf1[_0xe593('0x15')]]){utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x232bf1);utils[_0xe593('0x3')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x232bf1[_0xe593('0x14')],agents[_0x232bf1['destuniqueid']][_0xe593('0x8')],_0x232bf1['destuniqueid']));agents[_0x232bf1[_0xe593('0x15')]]['agentconnectAt']=utils['now']();agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xb')]=_0x232bf1[_0xe593('0xb')];agents[_0x232bf1['destuniqueid']]['connectedlinename']=_0x232bf1['connectedlinename'];agents[_0x232bf1[_0xe593('0x15')]]['holdtime']=_0x232bf1[_0xe593('0x24')];agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x2f');_['forIn'](agents,function(_0x196325,_0x53ed3c){if(_0x196325[_0xe593('0x15')]!=_0x232bf1['destuniqueid']&&_0x196325['uniqueid']==_0x232bf1['uniqueid']){_0x196325[_0xe593('0x2d')]=0x0;_0x196325['holdtime']=_0x232bf1[_0xe593('0x24')];_0x196325[_0xe593('0x1f')]=!![];_0x196325[_0xe593('0x21')]=utils['now']();_0x196325[_0xe593('0xc')]=_0xe593('0x30');_0x196325[_0xe593('0x2c')]=_0xe593('0x30');_0x196325[_0xe593('0x31')]=_0x232bf1[_0xe593('0x15')];_0x196325[_0xe593('0x32')]=_0x232bf1[_0xe593('0x8')];writeDB(_0x196325);}});}}catch(_0x4b36e1){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x4b36e1);}};exports[_0xe593('0x33')]=function(_0x4d3018){try{if(!_['isNil'](agents[_0x4d3018[_0xe593('0x15')]])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x4d3018);utils[_0xe593('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4d3018[_0xe593('0x14')],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x8')],_0x4d3018['destuniqueid']));agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x33')]=!![];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x34')]=utils['now']();agents[_0x4d3018['destuniqueid']]['talktime']=utils['diffTime'](agents[_0x4d3018[_0xe593('0x15')]]['agentcompleteAt'],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x35')]);agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x2c')]=_0x4d3018[_0xe593('0x2c')];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x36');writeDB(agents[_0x4d3018['destuniqueid']]);}}catch(_0x3dbb46){utils[_0xe593('0x1d')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x3dbb46);}};exports['blindtransfer']=function(_0x39ec9e){try{if(!_[_0xe593('0x37')](agents[_0x39ec9e[_0xe593('0x38')]])){utils['debug'](util['format'](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x39ec9e);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x39ec9e['uniqueid'],agents[_0x39ec9e['transfereruniqueid']][_0xe593('0x8')],agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')]));agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3a')]=!![];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3b')]=_0xe593('0x3c');agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3d')]=_0x39ec9e[_0xe593('0x3e')];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3f')]=agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')];}}catch(_0x46544d){utils['error'](util[_0xe593('0x4')](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x46544d);}};exports[_0xe593('0x40')]=function(_0x1204d8){try{utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x1204d8);if(_0x1204d8[_0xe593('0x42')]==_0x1204d8[_0xe593('0x43')]){if(!_[_0xe593('0x37')](agents[_0x1204d8[_0xe593('0x44')]])){utils[_0xe593('0x3')](util[_0xe593('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x8')]));agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3a')]=!![];agents[_0x1204d8['secondtransfereruniqueid']]['transfertype']=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x46')];agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x42')];}if(_0x1204d8['transfereeuniqueid']&&agents[_0x1204d8['transfereeuniqueid']]){agents[_0x1204d8[_0xe593('0x47')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8['transfereeuniqueid']]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x47')]]);transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0xa')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x4a')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x4a')];transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x23')]=0x0;transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x48')]=0x2;}}else if(_0x1204d8[_0xe593('0x44')]==_0x1204d8[_0xe593('0x4b')]){if(!_[_0xe593('0x37')](agents[_0x1204d8['origtransfereruniqueid']])){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x4c'),_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x42')]]['membername']));agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3a')]=!![];agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3b')]=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x4d')];agents[_0x1204d8['origtransfereruniqueid']][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x44')];}if(_0x1204d8[_0xe593('0x4e')]&&agents[_0x1204d8[_0xe593('0x4e')]]){agents[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8[_0xe593('0x4e')]]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x4e')]]);transfers[_0x1204d8[_0xe593('0x4e')]]['calleridnum']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x4e')]]['calleridname']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x4a')];transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x23')]=0x0;transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x2;}}}catch(_0x3486b3){utils['error'](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x3486b3);}};exports['hangup']=function(_0x43dcb0){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][hangup]',_0x43dcb0[_0xe593('0x14')]),_0x43dcb0);if(agents[_0x43dcb0[_0xe593('0x14')]]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]===_0xe593('0x22')){if(_0x43dcb0['cause']==='21'){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=_0xe593('0x4f');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x4f');}utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')],agents[_0x43dcb0['uniqueid']][_0xe593('0xc')]));writeDB(agents[_0x43dcb0[_0xe593('0x14')]]);var _0x9427d6=unanswered[_0xe593('0x51')](_0x43dcb0[_0xe593('0x14')]);if(_0x9427d6>-0x1){unanswered[_0xe593('0x52')](_0x9427d6,0x1);}}if(transfers[_0x43dcb0[_0xe593('0x14')]]){transfers[_0x43dcb0[_0xe593('0x14')]]['agentcomplete']=!![];transfers[_0x43dcb0['uniqueid']]['agentcompleteAt']=utils[_0xe593('0x19')]();transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2d')]=utils['diffTime'](transfers[_0x43dcb0['uniqueid']][_0xe593('0x34')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x35')]);transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]='agent';transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x8')],transfers[_0x43dcb0[_0xe593('0x14')]]['reason'],transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(transfers[_0x43dcb0[_0xe593('0x14')]],!![]);}if(agents[_0x43dcb0['uniqueid']]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x33')]=!![];agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x34')]=utils['now']();agents[_0x43dcb0['uniqueid']][_0xe593('0x2d')]=utils['diffTime'](agents[_0x43dcb0['uniqueid']]['agentcompleteAt'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]);agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=agents[_0x43dcb0[_0xe593('0x14')]]['transfer']?'transfer':_0xe593('0x53');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils['info'](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0['uniqueid']][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]]['reason'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(agents[_0x43dcb0['uniqueid']]);}}catch(_0x5bb9e2){utils['error'](util['format']('[%s][agents][hangup]',_0x43dcb0['uniqueid']),_0x5bb9e2);}}; \ No newline at end of file +var _0x6f7a=['indexOf','splice','agent','complete','diffTime','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','called','connectedlinename','error','agentringnoanswer','agentringnoanswerAt','reason','timeout','holdtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','agentcomplete','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1650d9,_0xded441){_0x1650d9=_0x1650d9-0x0;var _0x423ca1=_0x6f7a[_0x1650d9];return _0x423ca1;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var utils=require(_0xa6f7('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x982062,_0x4dd99d){utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')](_0xa6f7('0x5'),_0x982062[_0xa6f7('0x6')],_0x982062[_0xa6f7('0x7')],_0x982062[_0xa6f7('0x8')],_0x982062[_0xa6f7('0x9')],_0x982062[_0xa6f7('0xa')],_0x982062[_0xa6f7('0xb')],_0x982062[_0xa6f7('0xc')],_0x982062[_0xa6f7('0xd')]));if(_0x982062['queue']){utils['getVoiceQueueByName'](_0x982062[_0xa6f7('0x8')])[_0xa6f7('0xe')](function(_0x397020){if(_0x397020){_0x982062[_0xa6f7('0xf')]=_0x397020[_0xa6f7('0xf')];_0x982062['agentacw']=_0x982062['agentcomplete']?_0x397020[_0xa6f7('0x10')]:![];_0x982062[_0xa6f7('0x11')]=_0x982062['agentacw']?_0x397020[_0xa6f7('0x12')]:0x0;}utils['request'](_0xa6f7('0x13'),_0x982062);});}else{utils[_0xa6f7('0x14')](_0xa6f7('0x13'),_0x982062);}if(_0x4dd99d){delete transfers[_0x982062[_0xa6f7('0x6')]];}else{delete agents[_0x982062['destuniqueid']];}}exports[_0xa6f7('0x15')]=function(_0x532352){try{utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')](_0xa6f7('0x17'),_0x532352['uniqueid']),_0x532352);agents[_0x532352[_0xa6f7('0x18')]]=_0x532352;agents[_0x532352['destuniqueid']][_0xa6f7('0x19')]=utils['now']();agents[_0x532352[_0xa6f7('0x18')]][_0xa6f7('0xd')]=_0xa6f7('0x1a');agents[_0x532352['destuniqueid']][_0xa6f7('0xc')]=null;agents[_0x532352[_0xa6f7('0x18')]][_0xa6f7('0x1b')]=null;utils[_0xa6f7('0x3')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x532352[_0xa6f7('0x6')],agents[_0x532352['destuniqueid']][_0xa6f7('0x9')],_0x532352[_0xa6f7('0x18')]));}catch(_0x5d16d0){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x17'),_0x532352[_0xa6f7('0x6')]),_0x5d16d0);}};exports[_0xa6f7('0x1d')]=function(_0x1aa8dc){try{if(!_['isNil'](agents[_0x1aa8dc[_0xa6f7('0x18')]])){utils[_0xa6f7('0x16')](util['format']('[%s][agents][agentringnoanswer]',_0x1aa8dc['uniqueid']),_0x1aa8dc);utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x1aa8dc['uniqueid'],agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0x9')],_0x1aa8dc[_0xa6f7('0x18')]));agents[_0x1aa8dc[_0xa6f7('0x18')]]['agentringnoanswer']=!![];agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0x1e')]=utils['now']();agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0xd')]='timeout';agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x1f')]=_0xa6f7('0x20');agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x21')]=_0x1aa8dc['ringtime']?parseInt(_0x1aa8dc['ringtime'])/0x3e8:0x0;agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x22')]=0x0;unanswered['push'](_0x1aa8dc[_0xa6f7('0x18')]);}}catch(_0x27babb){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x23'),_0x1aa8dc[_0xa6f7('0x6')]),_0x27babb);}};exports[_0xa6f7('0x24')]=function(_0x54f72c){try{_[_0xa6f7('0x25')](agents,function(_0x3dee2e,_0x40b0f8){if(_0x3dee2e[_0xa6f7('0x6')]==_0x54f72c['uniqueid']&&!_[_0xa6f7('0x26')](unanswered,_0x3dee2e[_0xa6f7('0x18')])){utils['debug'](util[_0xa6f7('0x4')](_0xa6f7('0x27'),_0x54f72c['uniqueid']),_0x54f72c);utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x28'),_0x54f72c[_0xa6f7('0x6')],_0x3dee2e[_0xa6f7('0x9')],_0x3dee2e[_0xa6f7('0x18')]));_0x3dee2e['agentringnoanswer']=!![];_0x3dee2e['agentringnoanswerAt']=utils[_0xa6f7('0x29')]();_0x3dee2e['lastevent']=_0xa6f7('0x2a');_0x3dee2e[_0xa6f7('0x1f')]=_0xa6f7('0x2a');_0x3dee2e[_0xa6f7('0x21')]=_0x54f72c[_0xa6f7('0x21')];_0x3dee2e[_0xa6f7('0x22')]=0x0;writeDB(_0x3dee2e);}});}catch(_0x4d2d38){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x27'),_0x54f72c['uniqueid']),_0x4d2d38);}};exports[_0xa6f7('0x2b')]=function(_0x5ab03d){try{if(agents[_0x5ab03d[_0xa6f7('0x18')]]){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][agentconnect]',_0x5ab03d[_0xa6f7('0x6')]),_0x5ab03d);utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')](_0xa6f7('0x2c'),_0x5ab03d[_0xa6f7('0x6')],agents[_0x5ab03d[_0xa6f7('0x18')]]['membername'],_0x5ab03d[_0xa6f7('0x18')]));agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0x2d')]=utils[_0xa6f7('0x29')]();agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0xc')]=_0x5ab03d[_0xa6f7('0xc')];agents[_0x5ab03d[_0xa6f7('0x18')]]['connectedlinename']=_0x5ab03d[_0xa6f7('0x1b')];agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0x21')]=_0x5ab03d['ringtime'];agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0xd')]='connect';_[_0xa6f7('0x25')](agents,function(_0x13c7c4,_0x3ecb88){if(_0x13c7c4[_0xa6f7('0x18')]!=_0x5ab03d[_0xa6f7('0x18')]&&_0x13c7c4['uniqueid']==_0x5ab03d[_0xa6f7('0x6')]){_0x13c7c4[_0xa6f7('0x22')]=0x0;_0x13c7c4[_0xa6f7('0x21')]=_0x5ab03d[_0xa6f7('0x2e')];_0x13c7c4[_0xa6f7('0x1d')]=!![];_0x13c7c4[_0xa6f7('0x1e')]=utils[_0xa6f7('0x29')]();_0x13c7c4[_0xa6f7('0xd')]='answered_elsewhere';_0x13c7c4['reason']=_0xa6f7('0x2f');_0x13c7c4[_0xa6f7('0x30')]=_0x5ab03d[_0xa6f7('0x18')];_0x13c7c4[_0xa6f7('0x31')]=_0x5ab03d[_0xa6f7('0x9')];writeDB(_0x13c7c4);}});}}catch(_0x387714){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x32'),_0x5ab03d[_0xa6f7('0x6')]),_0x387714);}};exports['agentcomplete']=function(_0x41917c){try{if(!_[_0xa6f7('0x33')](agents[_0x41917c['destuniqueid']])){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')](_0xa6f7('0x34'),_0x41917c[_0xa6f7('0x6')]),_0x41917c);utils['info'](util[_0xa6f7('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x41917c['uniqueid'],agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x9')],_0x41917c[_0xa6f7('0x18')]));agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x35')]=!![];agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x36')]=utils['now']();agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x22')]=utils['diffTime'](agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x36')],agents[_0x41917c[_0xa6f7('0x18')]]['agentconnectAt']);agents[_0x41917c[_0xa6f7('0x18')]]['reason']=_0x41917c[_0xa6f7('0x1f')];agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0xd')]='complete';writeDB(agents[_0x41917c['destuniqueid']]);}}catch(_0x2b06b5){utils['error'](util[_0xa6f7('0x4')]('[%s][agents][agentcomplete]',_0x41917c['uniqueid']),_0x2b06b5);}};exports[_0xa6f7('0x37')]=function(_0x2e3a04){try{if(!_[_0xa6f7('0x33')](agents[_0x2e3a04[_0xa6f7('0x38')]])){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][blindtransfer]',_0x2e3a04[_0xa6f7('0x6')]),_0x2e3a04);utils[_0xa6f7('0x3')](util['format'](_0xa6f7('0x39'),_0x2e3a04['uniqueid'],agents[_0x2e3a04[_0xa6f7('0x38')]]['membername'],agents[_0x2e3a04['transfereruniqueid']][_0xa6f7('0x6')]));agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3a')]=!![];agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3b')]='blind';agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3c')]=_0x2e3a04['extension'];agents[_0x2e3a04[_0xa6f7('0x38')]]['transferuniqueid']=agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x6')];}}catch(_0x134dd7){utils['error'](util[_0xa6f7('0x4')]('[%s][agents][blindtransfer]',_0x2e3a04[_0xa6f7('0x6')]),_0x134dd7);}};exports[_0xa6f7('0x3d')]=function(_0x236372){try{utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][attendedtransfer]',_0x236372['origtransfereruniqueid']),_0x236372);if(_0x236372[_0xa6f7('0x3e')]==_0x236372[_0xa6f7('0x3f')]){if(!_[_0xa6f7('0x33')](agents[_0x236372[_0xa6f7('0x40')]])){utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x41'),_0x236372[_0xa6f7('0x3e')],agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x9')]));agents[_0x236372[_0xa6f7('0x40')]]['transfer']=!![];agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x3b')]=_0xa6f7('0x42');agents[_0x236372['secondtransfereruniqueid']][_0xa6f7('0x3c')]=_0x236372[_0xa6f7('0x43')];agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x44')]=_0x236372['origtransfereruniqueid'];}if(_0x236372['transfereeuniqueid']&&agents[_0x236372[_0xa6f7('0x45')]]){agents[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x46')]=0x1;transfers[_0x236372[_0xa6f7('0x45')]]=_[_0xa6f7('0x47')](agents[_0x236372[_0xa6f7('0x45')]]);transfers[_0x236372[_0xa6f7('0x45')]]['calleridnum']=agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0xb')];transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x48')]=agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x48')];transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x19')]=utils[_0xa6f7('0x29')]();transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x2d')]=utils['now']();transfers[_0x236372[_0xa6f7('0x45')]]['holdtime']=0x0;transfers[_0x236372[_0xa6f7('0x45')]]['agententerreason']=0x2;}}else if(_0x236372[_0xa6f7('0x40')]==_0x236372[_0xa6f7('0x49')]){if(!_['isNil'](agents[_0x236372[_0xa6f7('0x3e')]])){utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x236372[_0xa6f7('0x3e')],agents[_0x236372['origtransfereruniqueid']][_0xa6f7('0x9')]));agents[_0x236372[_0xa6f7('0x3e')]]['transfer']=!![];agents[_0x236372[_0xa6f7('0x3e')]]['transfertype']=_0xa6f7('0x42');agents[_0x236372['origtransfereruniqueid']][_0xa6f7('0x3c')]=_0x236372[_0xa6f7('0x4a')];agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0x44')]=_0x236372[_0xa6f7('0x40')];}if(_0x236372[_0xa6f7('0x4b')]&&agents[_0x236372[_0xa6f7('0x4b')]]){agents[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x46')]=0x1;transfers[_0x236372[_0xa6f7('0x4b')]]=_[_0xa6f7('0x47')](agents[_0x236372[_0xa6f7('0x4b')]]);transfers[_0x236372['transfertargetuniqueid']][_0xa6f7('0xb')]=agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0xb')];transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x48')]=agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0x48')];transfers[_0x236372[_0xa6f7('0x4b')]]['agentcalledAt']=utils[_0xa6f7('0x29')]();transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x2d')]=utils['now']();transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x21')]=0x0;transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x46')]=0x2;}}}catch(_0x1a1055){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x4c'),_0x236372['origtransfereruniqueid']),_0x1a1055);}};exports['hangup']=function(_0x265194){try{utils[_0xa6f7('0x16')](util['format'](_0xa6f7('0x4d'),_0x265194[_0xa6f7('0x6')]),_0x265194);if(agents[_0x265194[_0xa6f7('0x6')]]&&agents[_0x265194['uniqueid']][_0xa6f7('0x1f')]==='timeout'){if(_0x265194['cause']==='21'){agents[_0x265194['uniqueid']]['reason']='rejected';agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]=_0xa6f7('0x4e');}utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x4f'),_0x265194[_0xa6f7('0x6')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]));writeDB(agents[_0x265194[_0xa6f7('0x6')]]);var _0x55ad6b=unanswered[_0xa6f7('0x50')](_0x265194[_0xa6f7('0x6')]);if(_0x55ad6b>-0x1){unanswered[_0xa6f7('0x51')](_0x55ad6b,0x1);}}if(transfers[_0x265194[_0xa6f7('0x6')]]){transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x35')]=!![];transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x36')]=utils[_0xa6f7('0x29')]();transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x22')]=utils['diffTime'](transfers[_0x265194['uniqueid']][_0xa6f7('0x36')],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]);transfers[_0x265194['uniqueid']][_0xa6f7('0x1f')]=_0xa6f7('0x52');transfers[_0x265194['uniqueid']][_0xa6f7('0xd')]=_0xa6f7('0x53');utils['info'](util['format'](_0xa6f7('0x4f'),_0x265194['uniqueid'],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],transfers[_0x265194['uniqueid']]['reason'],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]));writeDB(transfers[_0x265194[_0xa6f7('0x6')]],!![]);}if(agents[_0x265194['uniqueid']]&&agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]){agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x35')]=!![];agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x36')]=utils[_0xa6f7('0x29')]();agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x22')]=utils[_0xa6f7('0x54')](agents[_0x265194[_0xa6f7('0x6')]]['agentcompleteAt'],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]);agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')]=agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x3a')]?'transfer':_0xa6f7('0x52');agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]=_0xa6f7('0x53');utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x265194['uniqueid'],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')],agents[_0x265194[_0xa6f7('0x6')]]['lastevent']));writeDB(agents[_0x265194[_0xa6f7('0x6')]]);}}catch(_0x4c7383){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')]('[%s][agents][hangup]',_0x265194['uniqueid']),_0x4c7383);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index d053c1a..4f2f61b 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 _0x21b1=['lastIndexOf','includes','noop','gotoif','toLowerCase','lastapplication','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','channel','membername','calleridnum','lastevent','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','isNil','systemanswertime','channelstate','transfer','answertime','toNumber','ANSWERED','[%s][calls][newstate]','hangup','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set'];(function(_0x1b16e7,_0x3a270f){var _0x15338c=function(_0x398840){while(--_0x398840){_0x1b16e7['push'](_0x1b16e7['shift']());}};_0x15338c(++_0x3a270f);}(_0x21b1,0xdc));var _0x121b=function(_0x5de00b,_0x15885c){_0x5de00b=_0x5de00b-0x0;var _0x3f9d96=_0x21b1[_0x5de00b];return _0x3f9d96;};'use strict';var _=require('lodash');var util=require(_0x121b('0x0'));var utils=require(_0x121b('0x1'));var transfers=require(_0x121b('0x2'));var dispositions=[_0x121b('0x3'),_0x121b('0x4'),_0x121b('0x4'),'NO\x20ANSWER','NO\x20ANSWER',_0x121b('0x3'),'ANSWERED',_0x121b('0x5'),'FAILED','FAILED',_0x121b('0x4')];var channels={};function writeDB(_0x23edfc){var _0x22120b;if(transfers[_0x121b('0x6')][_0x23edfc[_0x121b('0x7')]]){_0x22120b=_0x23edfc['uniqueid'];_0x23edfc[_0x121b('0x7')]=transfers[_0x121b('0x6')][_0x23edfc['uniqueid']][_0x121b('0x8')];}utils[_0x121b('0x9')](util[_0x121b('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x23edfc['uniqueid'],_0x23edfc[_0x121b('0xb')],_0x23edfc['queue'],_0x23edfc[_0x121b('0xc')],_0x23edfc['interface'],_0x23edfc[_0x121b('0xd')],_0x23edfc['connectedlinenum'],_0x23edfc[_0x121b('0xe')]));if(_0x23edfc[_0x121b('0xf')]){utils['getUserByInternal'](_0x23edfc[_0x121b('0xf')])[_0x121b('0x10')](function(_0x557d48){if(_0x557d48){_0x23edfc['UserId']=_0x557d48['id'];}utils[_0x121b('0x11')](_0x121b('0x12'),_0x23edfc);});}else{utils['request']('CreateVoiceCallReport',_0x23edfc);}if(channels[_0x23edfc[_0x121b('0x7')]]){delete channels[_0x23edfc[_0x121b('0x7')]];}else if(_0x22120b&&channels[_0x22120b]){delete transfers['blinds'][_0x22120b];delete channels[_0x22120b];}}exports[_0x121b('0x13')]=function(_0x437553){try{utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x15'),_0x437553[_0x121b('0x7')]),_0x437553);if(_0x437553[_0x121b('0x7')]==_0x437553[_0x121b('0x16')]&&_0x437553['channel']!=_0x121b('0x17')){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x18'),_0x437553['uniqueid'],_0x437553[_0x121b('0x19')],_0x437553[_0x121b('0x1a')]));channels[_0x437553[_0x121b('0x7')]]={'uniqueid':_0x437553[_0x121b('0x7')],'accountcode':_0x437553[_0x121b('0xf')],'source':_0x437553[_0x121b('0xd')],'destination':_0x437553[_0x121b('0x1a')],'destinationcontext':_0x437553[_0x121b('0x19')],'channel':_0x437553[_0x121b('0xb')],'starttime':utils[_0x121b('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x121b('0x3'),'amaflags':_0x121b('0x1c')};}}catch(_0x453dce){utils[_0x121b('0x1d')](util[_0x121b('0xa')](_0x121b('0x15'),_0x437553[_0x121b('0x7')]),_0x453dce);}};exports[_0x121b('0x1e')]=function(_0x41d72e){try{utils['debug'](util['format']('[%s][calls][newstate]',_0x41d72e[_0x121b('0x7')]),_0x41d72e);if(!_['isNil'](channels[_0x41d72e[_0x121b('0x7')]])&&_0x41d72e['channelstate']==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x41d72e['uniqueid'],_0x41d72e['context'],_0x41d72e[_0x121b('0xb')]));if(_[_0x121b('0x1f')](channels[_0x41d72e['uniqueid']]['systemanswertime'])){channels[_0x41d72e[_0x121b('0x7')]][_0x121b('0x20')]=utils[_0x121b('0x1b')]();}}else if(!_[_0x121b('0x1f')](channels[_0x41d72e['linkedid']])&&_0x41d72e[_0x121b('0x21')]==0x6&&_0x41d72e[_0x121b('0x19')]!=_0x121b('0x22')){utils['info'](util[_0x121b('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x41d72e['uniqueid'],_0x41d72e[_0x121b('0x16')],_0x41d72e[_0x121b('0x19')],_0x41d72e[_0x121b('0xb')]));channels[_0x41d72e[_0x121b('0x16')]][_0x121b('0xf')]=_0x41d72e[_0x121b('0xf')];channels[_0x41d72e[_0x121b('0x16')]]['destinationchannel']=_0x41d72e[_0x121b('0xb')];if(_['isNil'](channels[_0x41d72e['linkedid']][_0x121b('0x23')])){channels[_0x41d72e['linkedid']][_0x121b('0x23')]=utils[_0x121b('0x1b')]();}channels[_0x41d72e['linkedid']]['disposition']=dispositions[_[_0x121b('0x24')](_0x41d72e[_0x121b('0x21')])]||_0x121b('0x25');}}catch(_0x46049d){utils['error'](util['format'](_0x121b('0x26'),_0x41d72e[_0x121b('0x7')]),_0x46049d);}};exports[_0x121b('0x27')]=function(_0x3b09cb){try{if(!_[_0x121b('0x1f')](channels[_0x3b09cb[_0x121b('0x7')]])){utils[_0x121b('0x14')](util[_0x121b('0xa')]('[%s][calls][hangup]',_0x3b09cb[_0x121b('0x7')]),_0x3b09cb);if(_[_0x121b('0x1f')](channels[_0x3b09cb['uniqueid']][_0x121b('0x28')])){channels[_0x3b09cb['uniqueid']][_0x121b('0x28')]=_0x3b09cb[_0x121b('0x29')]+'\x20<'+_0x3b09cb['calleridnum']+'>';}utils['info'](util[_0x121b('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x3b09cb[_0x121b('0x7')],channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x28')],_0x3b09cb[_0x121b('0x2a')]));channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2b')]=utils['now']();channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2c')]=utils[_0x121b('0x2d')](channels[_0x3b09cb['uniqueid']][_0x121b('0x2b')],channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2e')]);channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2f')]=channels[_0x3b09cb[_0x121b('0x7')]]['answertime']?utils[_0x121b('0x2d')](channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2b')],channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x23')]):0x0;writeDB(channels[_0x3b09cb[_0x121b('0x7')]]);}}catch(_0x1c5cdb){utils['error'](util[_0x121b('0xa')](_0x121b('0x30'),_0x3b09cb[_0x121b('0x7')]),_0x1c5cdb);}};exports[_0x121b('0x31')]=function(_0x43279e){try{if(!_[_0x121b('0x1f')](channels[_0x43279e['localtwolinkedid']])){utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x32'),_0x43279e[_0x121b('0x33')]),_0x43279e);if(channels[_0x43279e[_0x121b('0x34')]]['channel']==_0x43279e['transfereechannel']){utils['info'](util[_0x121b('0xa')](_0x121b('0x35'),_0x43279e['origtransfereruniqueid'],_0x43279e['localtwolinkedid'],_0x43279e['secondtransfererchannel']));channels[_0x43279e[_0x121b('0x34')]][_0x121b('0x36')]=_0x43279e[_0x121b('0x37')];channels[_0x43279e[_0x121b('0x34')]]['userfield']=_0x121b('0x38');}else if(channels[_0x43279e['localtwolinkedid']][_0x121b('0xb')]=_0x43279e[_0x121b('0x39')]){utils['info'](util['format'](_0x121b('0x35'),_0x43279e[_0x121b('0x33')],_0x43279e[_0x121b('0x34')],_0x43279e['origtransfererchannel']));channels[_0x43279e['localtwolinkedid']][_0x121b('0x36')]=_0x43279e[_0x121b('0x3a')];channels[_0x43279e['localtwolinkedid']][_0x121b('0x3b')]='_attended';}}}catch(_0x3bd3a1){utils[_0x121b('0x1d')](util[_0x121b('0xa')](_0x121b('0x32'),_0x43279e[_0x121b('0x33')]),_0x3bd3a1);}};exports[_0x121b('0x3c')]=function(_0x1ec3e4){try{if(!_['isNil'](channels[_0x1ec3e4[_0x121b('0x7')]])){utils['debug'](util['format'](_0x121b('0x3d'),_0x1ec3e4[_0x121b('0x7')]),_0x1ec3e4);channels[_0x1ec3e4['uniqueid']][_0x121b('0x3e')]=utils['now']();utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x3f'),_0x1ec3e4[_0x121b('0x7')],channels[_0x1ec3e4[_0x121b('0x7')]][_0x121b('0x3e')]));}}catch(_0x5c4552){utils['error'](util[_0x121b('0xa')](_0x121b('0x3d'),_0x1ec3e4['uniqueid']),_0x5c4552);}};exports[_0x121b('0x40')]=function(_0x61689){try{if(!_['isNil'](channels[_0x61689['uniqueid']])){utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x41'),_0x61689[_0x121b('0x7')]),_0x61689);if(!_[_0x121b('0x1f')](channels[_0x61689[_0x121b('0x7')]]['musiconholdstartAt'])){channels[_0x61689[_0x121b('0x7')]][_0x121b('0x42')]+=utils[_0x121b('0x2d')](utils[_0x121b('0x1b')](),channels[_0x61689[_0x121b('0x7')]][_0x121b('0x3e')]);utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x43'),_0x61689['uniqueid'],channels[_0x61689[_0x121b('0x7')]][_0x121b('0x42')]));delete channels[_0x61689['uniqueid']]['musiconholdstartAt'];}}}catch(_0x5104e0){utils[_0x121b('0x1d')](util[_0x121b('0xa')](_0x121b('0x41'),_0x61689[_0x121b('0x7')]),_0x5104e0);}};exports[_0x121b('0x44')]=function(_0x5b0d4f){try{if(!_[_0x121b('0x1f')](channels[_0x5b0d4f[_0x121b('0x7')]])){utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x45'),_0x5b0d4f[_0x121b('0x7')]),_0x5b0d4f);if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x47')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x48'),_0x5b0d4f[_0x121b('0x7')],_0x5b0d4f['value']));channels[_0x5b0d4f['uniqueid']][_0x121b('0x49')]=_0x5b0d4f[_0x121b('0x4a')];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4b')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x4c'),_0x5b0d4f['uniqueid'],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]]['destination']=_0x5b0d4f[_0x121b('0x4a')];channels[_0x5b0d4f['uniqueid']][_0x121b('0x28')]='\x22'+_0x5b0d4f['value']+_0x121b('0x4d')+_0x5b0d4f[_0x121b('0x4a')]+'>';}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4e')])||!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4f')])){utils[_0x121b('0x9')](util['format'](_0x121b('0x50'),_0x5b0d4f[_0x121b('0x7')],!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4e')])?_0x121b('0x4e'):'xmd-callerid',_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x28')]=_0x5b0d4f[_0x121b('0x4a')];}if(!_['isNil'](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x51')])||!_[_0x121b('0x1f')](_0x5b0d4f['variable'][_0x121b('0x52')])){utils[_0x121b('0x9')](util[_0x121b('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5b0d4f[_0x121b('0x7')],!_[_0x121b('0x1f')](_0x5b0d4f['variable'][_0x121b('0x51')])?_0x121b('0x51'):'xmcs-queue',_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]]['lastapplication']=_0x121b('0x53');channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x54')]=_0x5b0d4f[_0x121b('0x4a')];channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x55')]=!![];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x56')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x57'),_0x5b0d4f[_0x121b('0x7')],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]]['ContactId']=_0x5b0d4f['value'];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x58')])){utils['info'](util[_0x121b('0xa')](_0x121b('0x59'),_0x5b0d4f['uniqueid'],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x5a')]=_0x5b0d4f[_0x121b('0x4a')];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x5b')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x5c'),_0x5b0d4f['uniqueid'],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x5d')]=_0x5b0d4f['value'];}if(!_[_0x121b('0x1f')](_0x5b0d4f['variable']['sipcallid'])){utils[_0x121b('0x9')](util[_0x121b('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5b0d4f[_0x121b('0x7')],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x5e')]=_0x5b0d4f[_0x121b('0x4a')];}}}catch(_0x71cc0e){utils['error'](util['format'](_0x121b('0x45'),_0x5b0d4f['uniqueid']),_0x71cc0e);}};exports[_0x121b('0x5f')]=function(_0x37f874){try{if(!_[_0x121b('0x1f')](channels[_0x37f874[_0x121b('0x7')]])){utils['debug'](util['format'](_0x121b('0x60'),_0x37f874[_0x121b('0x7')]),_0x37f874);utils[_0x121b('0x9')](util['format'](_0x121b('0x61'),_0x37f874[_0x121b('0x7')],_0x37f874[_0x121b('0x62')],_0x37f874[_0x121b('0x63')]));if(_0x37f874[_0x121b('0x62')]['toLowerCase']()==_0x121b('0x64')&&_['startsWith'](_0x37f874[_0x121b('0x63')]['toLowerCase'](),'cdr')){var _0xce62fc=_0x37f874['appdata']['split']('=');var _0x322b4e=_0xce62fc[0x0]['substring'](_0xce62fc[0x0]['lastIndexOf']('(')+0x1,_0xce62fc[0x0][_0x121b('0x65')](')'));var _0x19b278=_0xce62fc[0x1];channels[_0x37f874[_0x121b('0x7')]][_0x322b4e]=_0x19b278;}if(!_[_0x121b('0x66')]([_0x121b('0x27'),_0x121b('0x67'),'execif','set',_0x121b('0x68')],_0x37f874[_0x121b('0x62')][_0x121b('0x69')]())){channels[_0x37f874[_0x121b('0x7')]][_0x121b('0x6a')]=_0x37f874[_0x121b('0x62')];channels[_0x37f874['uniqueid']][_0x121b('0x54')]=_0x37f874[_0x121b('0x63')];}}}catch(_0x889776){utils['error'](util[_0x121b('0xa')](_0x121b('0x60'),_0x37f874['uniqueid']),_0x889776);}}; \ No newline at end of file +var _0xb040=['[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','application','startsWith','appdata','toLowerCase','cdr','substring','lastIndexOf','includes','execif','gotoif','lastapplication','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','toNumber','error','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','source','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid'];(function(_0x2be858,_0x3e8d9c){var _0x2cba37=function(_0x14a50e){while(--_0x14a50e){_0x2be858['push'](_0x2be858['shift']());}};_0x2cba37(++_0x3e8d9c);}(_0xb040,0x78));var _0x0b04=function(_0x3c9eca,_0x29e83e){_0x3c9eca=_0x3c9eca-0x0;var _0x2ef9bc=_0xb040[_0x3c9eca];return _0x2ef9bc;};'use strict';var _=require(_0x0b04('0x0'));var util=require(_0x0b04('0x1'));var utils=require('./utils');var transfers=require(_0x0b04('0x2'));var dispositions=[_0x0b04('0x3'),_0x0b04('0x4'),_0x0b04('0x4'),'NO\x20ANSWER',_0x0b04('0x3'),'NO\x20ANSWER',_0x0b04('0x5'),'BUSY',_0x0b04('0x4'),_0x0b04('0x4'),_0x0b04('0x4')];var channels={};function writeDB(_0x4639e8){var _0x5896b6;if(transfers[_0x0b04('0x6')][_0x4639e8[_0x0b04('0x7')]]){_0x5896b6=_0x4639e8[_0x0b04('0x7')];_0x4639e8[_0x0b04('0x7')]=transfers['blinds'][_0x4639e8[_0x0b04('0x7')]]['transfereeuniqueid'];}utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0xa'),_0x4639e8[_0x0b04('0x7')],_0x4639e8['channel'],_0x4639e8[_0x0b04('0xb')],_0x4639e8[_0x0b04('0xc')],_0x4639e8[_0x0b04('0xd')],_0x4639e8[_0x0b04('0xe')],_0x4639e8[_0x0b04('0xf')],_0x4639e8[_0x0b04('0x10')]));if(_0x4639e8['accountcode']){utils[_0x0b04('0x11')](_0x4639e8[_0x0b04('0x12')])[_0x0b04('0x13')](function(_0x2fb562){if(_0x2fb562){_0x4639e8[_0x0b04('0x14')]=_0x2fb562['id'];}utils[_0x0b04('0x15')](_0x0b04('0x16'),_0x4639e8);});}else{utils[_0x0b04('0x15')](_0x0b04('0x16'),_0x4639e8);}if(channels[_0x4639e8[_0x0b04('0x7')]]){delete channels[_0x4639e8['uniqueid']];}else if(_0x5896b6&&channels[_0x5896b6]){delete transfers['blinds'][_0x5896b6];delete channels[_0x5896b6];}}exports[_0x0b04('0x17')]=function(_0x3dd486){try{utils['debug'](util['format'](_0x0b04('0x18'),_0x3dd486[_0x0b04('0x7')]),_0x3dd486);if(_0x3dd486[_0x0b04('0x7')]==_0x3dd486['linkedid']&&_0x3dd486[_0x0b04('0x19')]!=_0x0b04('0x1a')){utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0x1b'),_0x3dd486['uniqueid'],_0x3dd486[_0x0b04('0x1c')],_0x3dd486[_0x0b04('0x1d')]));channels[_0x3dd486[_0x0b04('0x7')]]={'uniqueid':_0x3dd486[_0x0b04('0x7')],'accountcode':_0x3dd486['accountcode'],'source':_0x3dd486[_0x0b04('0xe')],'destination':_0x3dd486['exten'],'destinationcontext':_0x3dd486[_0x0b04('0x1c')],'channel':_0x3dd486['channel'],'starttime':utils[_0x0b04('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x0b04('0x3'),'amaflags':_0x0b04('0x1f')};}}catch(_0x2c5589){utils['error'](util[_0x0b04('0x9')]('[%s][calls][newchannel]',_0x3dd486[_0x0b04('0x7')]),_0x2c5589);}};exports[_0x0b04('0x20')]=function(_0x41a2bf){try{utils[_0x0b04('0x21')](util[_0x0b04('0x9')]('[%s][calls][newstate]',_0x41a2bf[_0x0b04('0x7')]),_0x41a2bf);if(!_[_0x0b04('0x22')](channels[_0x41a2bf[_0x0b04('0x7')]])&&_0x41a2bf[_0x0b04('0x23')]==0x6){utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0x24'),_0x41a2bf[_0x0b04('0x7')],_0x41a2bf['context'],_0x41a2bf[_0x0b04('0x19')]));if(_[_0x0b04('0x22')](channels[_0x41a2bf[_0x0b04('0x7')]][_0x0b04('0x25')])){channels[_0x41a2bf['uniqueid']]['systemanswertime']=utils[_0x0b04('0x1e')]();}}else if(!_[_0x0b04('0x22')](channels[_0x41a2bf['linkedid']])&&_0x41a2bf['channelstate']==0x6&&_0x41a2bf[_0x0b04('0x1c')]!='transfer'){utils['info'](util[_0x0b04('0x9')](_0x0b04('0x26'),_0x41a2bf[_0x0b04('0x7')],_0x41a2bf[_0x0b04('0x27')],_0x41a2bf['context'],_0x41a2bf[_0x0b04('0x19')]));channels[_0x41a2bf[_0x0b04('0x27')]][_0x0b04('0x12')]=_0x41a2bf[_0x0b04('0x12')];channels[_0x41a2bf[_0x0b04('0x27')]][_0x0b04('0x28')]=_0x41a2bf[_0x0b04('0x19')];if(_['isNil'](channels[_0x41a2bf['linkedid']][_0x0b04('0x29')])){channels[_0x41a2bf[_0x0b04('0x27')]][_0x0b04('0x29')]=utils[_0x0b04('0x1e')]();}channels[_0x41a2bf[_0x0b04('0x27')]]['disposition']=dispositions[_[_0x0b04('0x2a')](_0x41a2bf[_0x0b04('0x23')])]||_0x0b04('0x5');}}catch(_0x5ad5c5){utils[_0x0b04('0x2b')](util[_0x0b04('0x9')](_0x0b04('0x2c'),_0x41a2bf[_0x0b04('0x7')]),_0x5ad5c5);}};exports[_0x0b04('0x2d')]=function(_0x1b2ebf){try{if(!_['isNil'](channels[_0x1b2ebf[_0x0b04('0x7')]])){utils[_0x0b04('0x21')](util['format']('[%s][calls][hangup]',_0x1b2ebf[_0x0b04('0x7')]),_0x1b2ebf);if(_[_0x0b04('0x22')](channels[_0x1b2ebf[_0x0b04('0x7')]][_0x0b04('0x2e')])){channels[_0x1b2ebf[_0x0b04('0x7')]]['callerid']=_0x1b2ebf[_0x0b04('0x2f')]+'\x20<'+_0x1b2ebf['calleridnum']+'>';}utils['info'](util[_0x0b04('0x9')](_0x0b04('0x30'),_0x1b2ebf[_0x0b04('0x7')],channels[_0x1b2ebf['uniqueid']][_0x0b04('0x2e')],_0x1b2ebf[_0x0b04('0x31')]));channels[_0x1b2ebf['uniqueid']][_0x0b04('0x32')]=utils[_0x0b04('0x1e')]();channels[_0x1b2ebf['uniqueid']][_0x0b04('0x33')]=utils[_0x0b04('0x34')](channels[_0x1b2ebf[_0x0b04('0x7')]][_0x0b04('0x32')],channels[_0x1b2ebf['uniqueid']]['starttime']);channels[_0x1b2ebf[_0x0b04('0x7')]][_0x0b04('0x35')]=channels[_0x1b2ebf[_0x0b04('0x7')]]['answertime']?utils[_0x0b04('0x34')](channels[_0x1b2ebf[_0x0b04('0x7')]]['endtime'],channels[_0x1b2ebf[_0x0b04('0x7')]][_0x0b04('0x29')]):0x0;writeDB(channels[_0x1b2ebf[_0x0b04('0x7')]]);}}catch(_0x478d68){utils[_0x0b04('0x2b')](util[_0x0b04('0x9')]('[%s][calls][hangup]',_0x1b2ebf[_0x0b04('0x7')]),_0x478d68);}};exports[_0x0b04('0x36')]=function(_0x3db00f){try{if(!_['isNil'](channels[_0x3db00f[_0x0b04('0x37')]])){utils[_0x0b04('0x21')](util[_0x0b04('0x9')](_0x0b04('0x38'),_0x3db00f['origtransfereruniqueid']),_0x3db00f);if(channels[_0x3db00f[_0x0b04('0x37')]][_0x0b04('0x19')]==_0x3db00f['transfereechannel']){utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0x39'),_0x3db00f[_0x0b04('0x3a')],_0x3db00f[_0x0b04('0x37')],_0x3db00f[_0x0b04('0x3b')]));channels[_0x3db00f[_0x0b04('0x37')]]['destinationchannel']=_0x3db00f['secondtransfererchannel'];channels[_0x3db00f[_0x0b04('0x37')]][_0x0b04('0x3c')]=_0x0b04('0x3d');}else if(channels[_0x3db00f[_0x0b04('0x37')]][_0x0b04('0x19')]=_0x3db00f[_0x0b04('0x3e')]){utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0x39'),_0x3db00f['origtransfereruniqueid'],_0x3db00f[_0x0b04('0x37')],_0x3db00f[_0x0b04('0x3f')]));channels[_0x3db00f[_0x0b04('0x37')]]['destinationchannel']=_0x3db00f[_0x0b04('0x3f')];channels[_0x3db00f[_0x0b04('0x37')]]['userfield']=_0x0b04('0x3d');}}}catch(_0x491706){utils['error'](util[_0x0b04('0x9')](_0x0b04('0x38'),_0x3db00f[_0x0b04('0x3a')]),_0x491706);}};exports['musiconholdstart']=function(_0x1fb149){try{if(!_[_0x0b04('0x22')](channels[_0x1fb149[_0x0b04('0x7')]])){utils[_0x0b04('0x21')](util[_0x0b04('0x9')](_0x0b04('0x40'),_0x1fb149[_0x0b04('0x7')]),_0x1fb149);channels[_0x1fb149[_0x0b04('0x7')]][_0x0b04('0x41')]=utils[_0x0b04('0x1e')]();utils['info'](util[_0x0b04('0x9')](_0x0b04('0x42'),_0x1fb149[_0x0b04('0x7')],channels[_0x1fb149[_0x0b04('0x7')]][_0x0b04('0x41')]));}}catch(_0x355587){utils[_0x0b04('0x2b')](util[_0x0b04('0x9')]('[%s][calls][musiconholdstart]',_0x1fb149[_0x0b04('0x7')]),_0x355587);}};exports[_0x0b04('0x43')]=function(_0x3d82e6){try{if(!_['isNil'](channels[_0x3d82e6[_0x0b04('0x7')]])){utils[_0x0b04('0x21')](util[_0x0b04('0x9')](_0x0b04('0x44'),_0x3d82e6[_0x0b04('0x7')]),_0x3d82e6);if(!_[_0x0b04('0x22')](channels[_0x3d82e6[_0x0b04('0x7')]][_0x0b04('0x41')])){channels[_0x3d82e6[_0x0b04('0x7')]][_0x0b04('0x45')]+=utils[_0x0b04('0x34')](utils[_0x0b04('0x1e')](),channels[_0x3d82e6['uniqueid']][_0x0b04('0x41')]);utils['info'](util[_0x0b04('0x9')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x3d82e6['uniqueid'],channels[_0x3d82e6[_0x0b04('0x7')]][_0x0b04('0x45')]));delete channels[_0x3d82e6[_0x0b04('0x7')]][_0x0b04('0x41')];}}}catch(_0x419825){utils[_0x0b04('0x2b')](util[_0x0b04('0x9')](_0x0b04('0x44'),_0x3d82e6['uniqueid']),_0x419825);}};exports[_0x0b04('0x46')]=function(_0x224daa){try{if(!_[_0x0b04('0x22')](channels[_0x224daa[_0x0b04('0x7')]])){utils[_0x0b04('0x21')](util[_0x0b04('0x9')](_0x0b04('0x47'),_0x224daa[_0x0b04('0x7')]),_0x224daa);if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')][_0x0b04('0x49')])){utils['info'](util[_0x0b04('0x9')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x224daa[_0x0b04('0x7')],_0x224daa['value']));channels[_0x224daa[_0x0b04('0x7')]][_0x0b04('0x4a')]=_0x224daa[_0x0b04('0x4b')];}if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')]['xmd-phone'])){utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0x4c'),_0x224daa['uniqueid'],_0x224daa['value']));channels[_0x224daa[_0x0b04('0x7')]][_0x0b04('0x4d')]=_0x224daa['value'];channels[_0x224daa['uniqueid']][_0x0b04('0x2e')]='\x22'+_0x224daa[_0x0b04('0x4b')]+'\x22\x20<'+_0x224daa['value']+'>';}if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')][_0x0b04('0x4e')])||!_[_0x0b04('0x22')](_0x224daa['variable'][_0x0b04('0x4f')])){utils[_0x0b04('0x8')](util[_0x0b04('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x224daa[_0x0b04('0x7')],!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')][_0x0b04('0x4e')])?'xmd-callerid-preview':'xmd-callerid',_0x224daa['value']));channels[_0x224daa['uniqueid']][_0x0b04('0x2e')]=_0x224daa[_0x0b04('0x4b')];}if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')][_0x0b04('0x50')])||!_['isNil'](_0x224daa[_0x0b04('0x48')][_0x0b04('0x51')])){utils[_0x0b04('0x8')](util['format'](_0x0b04('0x52'),_0x224daa[_0x0b04('0x7')],!_[_0x0b04('0x22')](_0x224daa['variable'][_0x0b04('0x50')])?_0x0b04('0x50'):_0x0b04('0x51'),_0x224daa[_0x0b04('0x4b')]));channels[_0x224daa[_0x0b04('0x7')]]['lastapplication']=_0x0b04('0x53');channels[_0x224daa[_0x0b04('0x7')]][_0x0b04('0x54')]=_0x224daa[_0x0b04('0x4b')];channels[_0x224daa[_0x0b04('0x7')]][_0x0b04('0xb')]=!![];}if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')][_0x0b04('0x55')])){utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0x56'),_0x224daa[_0x0b04('0x7')],_0x224daa[_0x0b04('0x4b')]));channels[_0x224daa[_0x0b04('0x7')]][_0x0b04('0x57')]=_0x224daa['value'];}if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')][_0x0b04('0x58')])){utils[_0x0b04('0x8')](util[_0x0b04('0x9')](_0x0b04('0x59'),_0x224daa['uniqueid'],_0x224daa['value']));channels[_0x224daa[_0x0b04('0x7')]][_0x0b04('0x5a')]=_0x224daa[_0x0b04('0x4b')];}if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')][_0x0b04('0x5b')])){utils['info'](util[_0x0b04('0x9')](_0x0b04('0x5c'),_0x224daa[_0x0b04('0x7')],_0x224daa[_0x0b04('0x4b')]));channels[_0x224daa['uniqueid']]['routeid']=_0x224daa[_0x0b04('0x4b')];}if(!_[_0x0b04('0x22')](_0x224daa[_0x0b04('0x48')]['sipcallid'])){utils[_0x0b04('0x8')](util[_0x0b04('0x9')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x224daa[_0x0b04('0x7')],_0x224daa[_0x0b04('0x4b')]));channels[_0x224daa[_0x0b04('0x7')]][_0x0b04('0x5d')]=_0x224daa[_0x0b04('0x4b')];}}}catch(_0x542d7f){utils[_0x0b04('0x2b')](util[_0x0b04('0x9')](_0x0b04('0x47'),_0x224daa['uniqueid']),_0x542d7f);}};exports[_0x0b04('0x5e')]=function(_0xe47b3b){try{if(!_['isNil'](channels[_0xe47b3b[_0x0b04('0x7')]])){utils[_0x0b04('0x21')](util['format']('[%s][calls][newexten]',_0xe47b3b[_0x0b04('0x7')]),_0xe47b3b);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0xe47b3b['uniqueid'],_0xe47b3b[_0x0b04('0x5f')],_0xe47b3b['appdata']));if(_0xe47b3b[_0x0b04('0x5f')]['toLowerCase']()=='set'&&_[_0x0b04('0x60')](_0xe47b3b[_0x0b04('0x61')][_0x0b04('0x62')](),_0x0b04('0x63'))){var _0x2eb99f=_0xe47b3b[_0x0b04('0x61')]['split']('=');var _0x3f902a=_0x2eb99f[0x0][_0x0b04('0x64')](_0x2eb99f[0x0][_0x0b04('0x65')]('(')+0x1,_0x2eb99f[0x0][_0x0b04('0x65')](')'));var _0x4f8f5c=_0x2eb99f[0x1];channels[_0xe47b3b[_0x0b04('0x7')]][_0x3f902a]=_0x4f8f5c;}if(!_[_0x0b04('0x66')](['hangup','noop',_0x0b04('0x67'),'set',_0x0b04('0x68')],_0xe47b3b['application']['toLowerCase']())){channels[_0xe47b3b[_0x0b04('0x7')]][_0x0b04('0x69')]=_0xe47b3b[_0x0b04('0x5f')];channels[_0xe47b3b[_0x0b04('0x7')]][_0x0b04('0x54')]=_0xe47b3b[_0x0b04('0x61')];}}}catch(_0x278a7b){utils['error'](util[_0x0b04('0x9')]('[%s][calls][newexten]',_0xe47b3b[_0x0b04('0x7')]),_0x278a7b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 790229c..2836c5a 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 _0xa566=['connect','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','close','[core]\x20close','./utils'];(function(_0x1df07e,_0x475218){var _0x4b860e=function(_0x367657){while(--_0x367657){_0x1df07e['push'](_0x1df07e['shift']());}};_0x4b860e(++_0x475218);}(_0xa566,0x1c1));var _0x6a56=function(_0x8d4195,_0x609026){_0x8d4195=_0x8d4195-0x0;var _0x16cedb=_0xa566[_0x8d4195];return _0x16cedb;};'use strict';var utils=require(_0x6a56('0x0'));exports[_0x6a56('0x1')]=function(){utils[_0x6a56('0x2')]('[core]\x20connected');};exports[_0x6a56('0x3')]=function(){utils[_0x6a56('0x2')](_0x6a56('0x4'));};exports[_0x6a56('0x5')]=function(){utils['info'](_0x6a56('0x6'));};exports['error']=function(_0x4dc546){utils['error']('[core]\x20error',_0x4dc546);};exports[_0x6a56('0x7')]=function(){utils['info'](_0x6a56('0x8'));};exports['managerevent']=function(_0x33240c){}; \ No newline at end of file +var _0x24b4=['close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','error','[core]\x20error'];(function(_0x1a3f0a,_0xd164c2){var _0x13b0d4=function(_0x23927f){while(--_0x23927f){_0x1a3f0a['push'](_0x1a3f0a['shift']());}};_0x13b0d4(++_0xd164c2);}(_0x24b4,0x139));var _0x424b=function(_0x4a4034,_0x5665a7){_0x4a4034=_0x4a4034-0x0;var _0x2750e7=_0x24b4[_0x4a4034];return _0x2750e7;};'use strict';var utils=require(_0x424b('0x0'));exports[_0x424b('0x1')]=function(){utils[_0x424b('0x2')](_0x424b('0x3'));};exports['shutdown']=function(){utils[_0x424b('0x2')](_0x424b('0x4'));};exports['fullybooted']=function(){utils[_0x424b('0x2')]('[core]\x20fullybooted');};exports[_0x424b('0x5')]=function(_0x670a6f){utils[_0x424b('0x5')](_0x424b('0x6'),_0x670a6f);};exports[_0x424b('0x7')]=function(){utils[_0x424b('0x2')](_0x424b('0x8'));};exports[_0x424b('0x9')]=function(_0x185861){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 5296477..999d768 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 _0x953f=['value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','error','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x1911ac,_0x1ae4c1){var _0x4cba25=function(_0x43b349){while(--_0x43b349){_0x1911ac['push'](_0x1911ac['shift']());}};_0x4cba25(++_0x1ae4c1);}(_0x953f,0xea));var _0xf953=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x953f[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xf953('0x0'));var util=require(_0xf953('0x1'));var utils=require(_0xf953('0x2'));var dials={};function writeDB(_0x5d7db6){utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x5'),_0x5d7db6['uniqueid'],_0x5d7db6[_0xf953('0x6')],_0x5d7db6[_0xf953('0x7')],_0x5d7db6[_0xf953('0x8')],_0x5d7db6[_0xf953('0x9')],_0x5d7db6[_0xf953('0xa')]));utils['request'](_0xf953('0xb'),_0x5d7db6);delete dials[_0x5d7db6[_0xf953('0xc')]];}exports[_0xf953('0xd')]=function(_0x4347ea){try{utils[_0xf953('0xe')](util['format'](_0xf953('0xf'),_0x4347ea[_0xf953('0xc')]),_0x4347ea);utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x10'),_0x4347ea[_0xf953('0xc')],_0x4347ea[_0xf953('0x11')],_0x4347ea[_0xf953('0x12')]));if(_0x4347ea[_0xf953('0x11')][_0xf953('0x13')]()=='set'&&_[_0xf953('0x14')](_0x4347ea[_0xf953('0x12')][_0xf953('0x13')](),'cdr(routeid)')){var _0x5a5850=_0x4347ea[_0xf953('0x12')][_0xf953('0x15')]('=');dials[_0x4347ea[_0xf953('0xc')]]={'routeId':_0x5a5850[0x1]};}}catch(_0x5dfe45){utils['error'](util['format']('[%s][dials][newexten]',_0x4347ea[_0xf953('0xc')]),_0x5dfe45);}};exports['varset']=function(_0x110f9a){try{utils['debug'](util[_0xf953('0x4')](_0xf953('0x16'),_0x110f9a[_0xf953('0xc')]),_0x110f9a);if(!_[_0xf953('0x17')](_0x110f9a['variable'][_0xf953('0x18')])){utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x19'),_0x110f9a['uniqueid'],_0x110f9a['value']));dials[_0x110f9a['uniqueid']]={'routeId':_0x110f9a[_0xf953('0x1a')]};}}catch(_0x5d8e99){utils['error'](util[_0xf953('0x4')]('[%s][dials][varset]',_0x110f9a[_0xf953('0xc')]),_0x5d8e99);}};exports[_0xf953('0x1b')]=function(_0x617070){try{if(!_[_0xf953('0x17')](dials[_0x617070[_0xf953('0xc')]])){utils[_0xf953('0xe')](util['format'](_0xf953('0x1c'),_0x617070[_0xf953('0xc')]),_0x617070);dials[_0x617070[_0xf953('0xc')]]=_[_0xf953('0x1d')](dials[_0x617070[_0xf953('0xc')]],_0x617070);dials[_0x617070[_0xf953('0xc')]][_0xf953('0x1e')]=utils[_0xf953('0x1f')]();dials[_0x617070[_0xf953('0xc')]][_0xf953('0x20')]='called';utils[_0xf953('0x3')](util[_0xf953('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x617070['uniqueid'],dials[_0x617070[_0xf953('0xc')]][_0xf953('0x1e')]));}}catch(_0x4c32fd){utils['error'](util[_0xf953('0x4')](_0xf953('0x1c'),_0x617070[_0xf953('0xc')]),_0x4c32fd);}};exports[_0xf953('0x21')]=function(_0x15be6c){try{if(!_[_0xf953('0x17')](dials[_0x15be6c['uniqueid']])){utils[_0xf953('0xe')](util[_0xf953('0x4')](_0xf953('0x22'),_0x15be6c[_0xf953('0xc')]),_0x15be6c);dials[_0x15be6c[_0xf953('0xc')]][_0xf953('0xa')]=_0x15be6c[_0xf953('0xa')];if(_0x15be6c[_0xf953('0xa')]==_0xf953('0x23')){dials[_0x15be6c[_0xf953('0xc')]]=_[_0xf953('0x1d')](dials[_0x15be6c[_0xf953('0xc')]],_0x15be6c);dials[_0x15be6c[_0xf953('0xc')]][_0xf953('0x24')]=utils[_0xf953('0x1f')]();dials[_0x15be6c[_0xf953('0xc')]]['lastevent']=_0xf953('0x25');utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x26'),_0x15be6c[_0xf953('0xc')],_0x15be6c['dialstatus'],dials[_0x15be6c['uniqueid']][_0xf953('0x24')]));}else{utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x27'),_0x15be6c[_0xf953('0xc')],_0x15be6c[_0xf953('0xa')]));}}}catch(_0x16622d){utils[_0xf953('0x28')](util[_0xf953('0x4')]('[%s][dials][dialend]',_0x15be6c['uniqueid']),_0x16622d);}};exports[_0xf953('0x29')]=function(_0x567a1e){try{if(!_[_0xf953('0x17')](dials[_0x567a1e[_0xf953('0xc')]])){utils[_0xf953('0xe')](util[_0xf953('0x4')](_0xf953('0x2a'),_0x567a1e[_0xf953('0xc')]),_0x567a1e);utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x2b'),_0x567a1e[_0xf953('0xc')],_0x567a1e['calleridnum'],_0x567a1e[_0xf953('0x2c')],_0x567a1e[_0xf953('0x2d')]));dials[_0x567a1e[_0xf953('0xc')]]=_[_0xf953('0x1d')](dials[_0x567a1e[_0xf953('0xc')]],{'endtime':utils['now'](),'lastevent':_0xf953('0x2e')});dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x2f')]=utils[_0xf953('0x30')](dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x31')],dials[_0x567a1e[_0xf953('0xc')]]['starttime']);dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x32')]=utils['diffTime'](dials[_0x567a1e['uniqueid']]['answertime']||dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x31')],dials[_0x567a1e[_0xf953('0xc')]]['starttime']);dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x33')]=dials[_0x567a1e['uniqueid']][_0xf953('0x24')]?utils[_0xf953('0x30')](dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x31')],dials[_0x567a1e['uniqueid']]['answertime']):0x0;writeDB(dials[_0x567a1e['uniqueid']]);}}catch(_0x59f440){utils[_0xf953('0x28')](util[_0xf953('0x4')](_0xf953('0x2a'),_0x567a1e[_0xf953('0xc')]),_0x59f440);}}; \ No newline at end of file +var _0x9307=['dialbegin','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','debug','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s','isNil','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','startsWith','toLowerCase','cdr(routeid)','error','varset','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]'];(function(_0x5014ef,_0xe97fc1){var _0x1b8cdb=function(_0x372c8e){while(--_0x372c8e){_0x5014ef['push'](_0x5014ef['shift']());}};_0x1b8cdb(++_0xe97fc1);}(_0x9307,0x1ee));var _0x7930=function(_0x35b77a,_0x16900b){_0x35b77a=_0x35b77a-0x0;var _0x22195d=_0x9307[_0x35b77a];return _0x22195d;};'use strict';var _=require(_0x7930('0x0'));var util=require(_0x7930('0x1'));var utils=require(_0x7930('0x2'));var dials={};function writeDB(_0x29b8d5){utils[_0x7930('0x3')](util['format'](_0x7930('0x4'),_0x29b8d5[_0x7930('0x5')],_0x29b8d5['channel'],_0x29b8d5[_0x7930('0x6')],_0x29b8d5[_0x7930('0x7')],_0x29b8d5[_0x7930('0x8')],_0x29b8d5[_0x7930('0x9')]));utils[_0x7930('0xa')](_0x7930('0xb'),_0x29b8d5);delete dials[_0x29b8d5['uniqueid']];}exports[_0x7930('0xc')]=function(_0x1c840a){try{utils['debug'](util[_0x7930('0xd')](_0x7930('0xe'),_0x1c840a['uniqueid']),_0x1c840a);utils['info'](util[_0x7930('0xd')](_0x7930('0xf'),_0x1c840a[_0x7930('0x5')],_0x1c840a['application'],_0x1c840a[_0x7930('0x10')]));if(_0x1c840a['application']['toLowerCase']()=='set'&&_[_0x7930('0x11')](_0x1c840a['appdata'][_0x7930('0x12')](),_0x7930('0x13'))){var _0x22e347=_0x1c840a[_0x7930('0x10')]['split']('=');dials[_0x1c840a[_0x7930('0x5')]]={'routeId':_0x22e347[0x1]};}}catch(_0x3a8181){utils[_0x7930('0x14')](util['format']('[%s][dials][newexten]',_0x1c840a[_0x7930('0x5')]),_0x3a8181);}};exports[_0x7930('0x15')]=function(_0xf61137){try{utils['debug'](util[_0x7930('0xd')]('[%s][dials][varset]',_0xf61137['uniqueid']),_0xf61137);if(!_['isNil'](_0xf61137[_0x7930('0x16')]['outboundrouteid'])){utils[_0x7930('0x3')](util[_0x7930('0xd')](_0x7930('0x17'),_0xf61137[_0x7930('0x5')],_0xf61137['value']));dials[_0xf61137[_0x7930('0x5')]]={'routeId':_0xf61137[_0x7930('0x18')]};}}catch(_0x4fbc1f){utils[_0x7930('0x14')](util[_0x7930('0xd')](_0x7930('0x19'),_0xf61137[_0x7930('0x5')]),_0x4fbc1f);}};exports[_0x7930('0x1a')]=function(_0xf14da2){try{if(!_['isNil'](dials[_0xf14da2[_0x7930('0x5')]])){utils['debug'](util[_0x7930('0xd')]('[%s][dials][dialbegin]',_0xf14da2['uniqueid']),_0xf14da2);dials[_0xf14da2['uniqueid']]=_[_0x7930('0x1b')](dials[_0xf14da2[_0x7930('0x5')]],_0xf14da2);dials[_0xf14da2[_0x7930('0x5')]][_0x7930('0x1c')]=utils[_0x7930('0x1d')]();dials[_0xf14da2['uniqueid']]['lastevent']=_0x7930('0x1e');utils[_0x7930('0x3')](util[_0x7930('0xd')](_0x7930('0x1f'),_0xf14da2[_0x7930('0x5')],dials[_0xf14da2[_0x7930('0x5')]][_0x7930('0x1c')]));}}catch(_0x2c3dcf){utils[_0x7930('0x14')](util[_0x7930('0xd')](_0x7930('0x20'),_0xf14da2['uniqueid']),_0x2c3dcf);}};exports[_0x7930('0x21')]=function(_0x59c91d){try{if(!_['isNil'](dials[_0x59c91d[_0x7930('0x5')]])){utils[_0x7930('0x22')](util[_0x7930('0xd')](_0x7930('0x23'),_0x59c91d[_0x7930('0x5')]),_0x59c91d);dials[_0x59c91d[_0x7930('0x5')]][_0x7930('0x9')]=_0x59c91d[_0x7930('0x9')];if(_0x59c91d[_0x7930('0x9')]==_0x7930('0x24')){dials[_0x59c91d[_0x7930('0x5')]]=_[_0x7930('0x1b')](dials[_0x59c91d[_0x7930('0x5')]],_0x59c91d);dials[_0x59c91d[_0x7930('0x5')]][_0x7930('0x25')]=utils[_0x7930('0x1d')]();dials[_0x59c91d[_0x7930('0x5')]][_0x7930('0x26')]=_0x7930('0x27');utils[_0x7930('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x59c91d[_0x7930('0x5')],_0x59c91d[_0x7930('0x9')],dials[_0x59c91d[_0x7930('0x5')]]['answertime']));}else{utils[_0x7930('0x3')](util['format'](_0x7930('0x28'),_0x59c91d[_0x7930('0x5')],_0x59c91d[_0x7930('0x9')]));}}}catch(_0x1aeba5){utils[_0x7930('0x14')](util[_0x7930('0xd')](_0x7930('0x23'),_0x59c91d['uniqueid']),_0x1aeba5);}};exports['hangup']=function(_0x2e691f){try{if(!_[_0x7930('0x29')](dials[_0x2e691f[_0x7930('0x5')]])){utils[_0x7930('0x22')](util[_0x7930('0xd')](_0x7930('0x2a'),_0x2e691f[_0x7930('0x5')]),_0x2e691f);utils['info'](util[_0x7930('0xd')](_0x7930('0x2b'),_0x2e691f[_0x7930('0x5')],_0x2e691f[_0x7930('0x7')],_0x2e691f[_0x7930('0x2c')],_0x2e691f[_0x7930('0x2d')]));dials[_0x2e691f[_0x7930('0x5')]]=_['assign'](dials[_0x2e691f[_0x7930('0x5')]],{'endtime':utils[_0x7930('0x1d')](),'lastevent':_0x7930('0x2e')});dials[_0x2e691f[_0x7930('0x5')]][_0x7930('0x2f')]=utils[_0x7930('0x30')](dials[_0x2e691f[_0x7930('0x5')]][_0x7930('0x31')],dials[_0x2e691f[_0x7930('0x5')]][_0x7930('0x1c')]);dials[_0x2e691f[_0x7930('0x5')]][_0x7930('0x32')]=utils[_0x7930('0x30')](dials[_0x2e691f['uniqueid']]['answertime']||dials[_0x2e691f['uniqueid']][_0x7930('0x31')],dials[_0x2e691f[_0x7930('0x5')]][_0x7930('0x1c')]);dials[_0x2e691f['uniqueid']][_0x7930('0x33')]=dials[_0x2e691f[_0x7930('0x5')]][_0x7930('0x25')]?utils['diffTime'](dials[_0x2e691f['uniqueid']][_0x7930('0x31')],dials[_0x2e691f[_0x7930('0x5')]][_0x7930('0x25')]):0x0;writeDB(dials[_0x2e691f[_0x7930('0x5')]]);}}catch(_0x182ee6){utils[_0x7930('0x14')](util[_0x7930('0xd')](_0x7930('0x2a'),_0x2e691f[_0x7930('0x5')]),_0x182ee6);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b04c57d..44d8c69 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 _0x26a2=['./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','util','asterisk','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x11df8c,_0x4eb038){var _0x4d16b1=function(_0x11e663){while(--_0x11e663){_0x11df8c['push'](_0x11df8c['shift']());}};_0x4d16b1(++_0x4eb038);}(_0x26a2,0x1ae));var _0x226a=function(_0xf1d4e0,_0x53f8da){_0xf1d4e0=_0xf1d4e0-0x0;var _0x669a1b=_0x26a2[_0xf1d4e0];return _0x669a1b;};var AsteriskManager=require(_0x226a('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x226a('0x1'));var ami=new AsteriskManager(config[_0x226a('0x2')]['port'],config[_0x226a('0x2')]['ip'],config[_0x226a('0x2')]['username'],config[_0x226a('0x2')]['password'],!![]);ami['keepConnected']();if(config[_0x226a('0x3')]&&config[_0x226a('0x3')][_0x226a('0x4')]){utils[_0x226a('0x5')](_0x226a('0x6'));}else{var agents=require(_0x226a('0x7'));var calls=require('./calls.controller');var queues=require(_0x226a('0x8'));var recordings=require(_0x226a('0x9'));var members=require(_0x226a('0xa'));var dials=require('./dials.controller');var transfers=require(_0x226a('0xb'));var core=require(_0x226a('0xc'));ami['on'](_0x226a('0xd'),core[_0x226a('0xd')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0x226a('0xe'),core['fullybooted']);ami['on'](_0x226a('0xf'),core['error']);ami['on'](_0x226a('0x10'),core[_0x226a('0x10')]);ami['on'](_0x226a('0x11'),core[_0x226a('0x11')]);ami['on'](_0x226a('0x12'),function(_0x206916){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x14'),_0x206916[_0x226a('0x15')]),_0x206916);members['devicestatechange'](_0x206916);}catch(_0x1022f1){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x14'),_0x206916[_0x226a('0x15')]),_0x1022f1);}});ami['on'](_0x226a('0x16'),function(_0x5a144c){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x18'),_0x5a144c[_0x226a('0x19')]),_0x5a144c);agents[_0x226a('0x16')](_0x5a144c);}catch(_0x258a0f){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x18'),_0x5a144c[_0x226a('0x19')]),_0x258a0f);}});ami['on'](_0x226a('0x1a'),function(_0x8619c){try{utils['debug'](util[_0x226a('0x13')]('[%s][index][agentringnoanswer]',_0x8619c[_0x226a('0x19')]),_0x8619c);agents[_0x226a('0x1a')](_0x8619c);}catch(_0x1fd243){utils[_0x226a('0xf')](util['format'](_0x226a('0x1b'),_0x8619c[_0x226a('0x19')]),_0x1fd243);}});ami['on']('agentconnect',function(_0x49724f){try{utils['debug'](util['format'](_0x226a('0x1c'),_0x49724f[_0x226a('0x19')]),_0x49724f);agents[_0x226a('0x1d')](_0x49724f);queues[_0x226a('0x1d')](_0x49724f);}catch(_0xbc921b){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x1c'),_0x49724f[_0x226a('0x19')]),_0xbc921b);}});ami['on']('agentcomplete',function(_0x59466f){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x1e'),_0x59466f[_0x226a('0x19')]),_0x59466f);agents[_0x226a('0x1f')](_0x59466f);queues['agentcomplete'](_0x59466f);members[_0x226a('0x1f')](_0x59466f);}catch(_0x1b4d04){utils['error'](util[_0x226a('0x13')](_0x226a('0x1e'),_0x59466f['uniqueid']),_0x1b4d04);}});ami['on'](_0x226a('0x20'),function(_0x26173a){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x21'),_0x26173a['uniqueid']),_0x26173a);agents[_0x226a('0x20')](_0x26173a);queues[_0x226a('0x20')](_0x26173a);}catch(_0x1fed2c){utils[_0x226a('0xf')](util[_0x226a('0x13')]('[%s][index][queuecallerabandon]',_0x26173a[_0x226a('0x19')]),_0x1fed2c);}});ami['on'](_0x226a('0x22'),function(_0x43f584){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x23'),_0x43f584[_0x226a('0x19')]),_0x43f584);queues[_0x226a('0x22')](_0x43f584);recordings['queuecallerjoin'](_0x43f584);}catch(_0x271ddf){utils[_0x226a('0xf')](util['format']('[%s][index][queuecallerjoin]',_0x43f584[_0x226a('0x19')]),_0x271ddf);}});ami['on']('queuecallerleave',function(_0x480081){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x24'),_0x480081[_0x226a('0x19')]),_0x480081);queues['queuecallerleave'](_0x480081);}catch(_0x21a9d2){utils[_0x226a('0xf')](util[_0x226a('0x13')]('[%s][index][queuecallerleave]',_0x480081[_0x226a('0x19')]),_0x21a9d2);}});ami['on'](_0x226a('0x25'),function(_0x1e768d){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x26'),_0x1e768d['uniqueid']),_0x1e768d);queues[_0x226a('0x25')](_0x1e768d);calls[_0x226a('0x25')](_0x1e768d);}catch(_0x3892d2){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x26'),_0x1e768d[_0x226a('0x19')]),_0x3892d2);}});ami['on'](_0x226a('0x27'),function(_0x104c2c){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x28'),_0x104c2c[_0x226a('0x19')]),_0x104c2c);queues[_0x226a('0x27')](_0x104c2c);calls['musiconholdstop'](_0x104c2c);}catch(_0x13ffde){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x28'),_0x104c2c[_0x226a('0x19')]),_0x13ffde);}});ami['on'](_0x226a('0x29'),function(_0x1e32eb){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x2a'),_0x1e32eb[_0x226a('0x19')]),_0x1e32eb);calls['newstate'](_0x1e32eb);recordings['newstate'](_0x1e32eb);}catch(_0x1dc065){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x2a'),_0x1e32eb[_0x226a('0x19')]),_0x1dc065);}});ami['on']('hangup',function(_0x494d9c){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x2b'),_0x494d9c[_0x226a('0x19')]),_0x494d9c);calls['hangup'](_0x494d9c);recordings[_0x226a('0x2c')](_0x494d9c);dials[_0x226a('0x2c')](_0x494d9c);agents[_0x226a('0x2c')](_0x494d9c);queues['hangup'](_0x494d9c);}catch(_0x41eeed){utils[_0x226a('0xf')](util['format'](_0x226a('0x2b'),_0x494d9c[_0x226a('0x19')]),_0x41eeed);}});ami['on'](_0x226a('0x2d'),function(_0x206f4f){try{utils[_0x226a('0x17')](util['format']('[%s][index][cdr]',_0x206f4f[_0x226a('0x19')]),_0x206f4f);members[_0x226a('0x2d')](_0x206f4f);}catch(_0x233f28){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x2e'),_0x206f4f[_0x226a('0x19')]),_0x233f28);}});ami['on'](_0x226a('0x2f'),function(_0x5cb192){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x30'),_0x5cb192[_0x226a('0x19')]),_0x5cb192);queues[_0x226a('0x2f')](_0x5cb192);agents[_0x226a('0x2f')](_0x5cb192);transfers[_0x226a('0x2f')](_0x5cb192);}catch(_0x24badb){utils['error'](util[_0x226a('0x13')](_0x226a('0x30'),_0x5cb192[_0x226a('0x19')]),_0x24badb);}});ami['on'](_0x226a('0x31'),function(_0x58fb7e){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x32'),_0x58fb7e[_0x226a('0x33')]),_0x58fb7e);queues[_0x226a('0x31')](_0x58fb7e);transfers['attendedtransfer'](_0x58fb7e);agents['attendedtransfer'](_0x58fb7e);calls[_0x226a('0x31')](_0x58fb7e);}catch(_0x20b86b){utils[_0x226a('0xf')](util['format'](_0x226a('0x32'),_0x58fb7e[_0x226a('0x33')]),_0x20b86b);}});ami['on'](_0x226a('0x34'),function(_0x4f028c){try{utils['debug'](util['format'](_0x226a('0x35'),_0x4f028c[_0x226a('0x19')]),_0x4f028c);queues['varset'](_0x4f028c);recordings[_0x226a('0x34')](_0x4f028c);calls[_0x226a('0x34')](_0x4f028c);dials[_0x226a('0x34')](_0x4f028c);}catch(_0x5ca4b2){utils[_0x226a('0xf')](util['format'](_0x226a('0x35'),_0x4f028c[_0x226a('0x19')]),_0x5ca4b2);}});ami['on']('newexten',function(_0x422ed3){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x36'),_0x422ed3[_0x226a('0x19')]),_0x422ed3);calls[_0x226a('0x37')](_0x422ed3);recordings[_0x226a('0x37')](_0x422ed3);dials[_0x226a('0x37')](_0x422ed3);}catch(_0x5a60c3){utils[_0x226a('0xf')](util['format']('[%s][index][newexten]',_0x422ed3[_0x226a('0x19')]),_0x5a60c3);}});ami['on'](_0x226a('0x38'),function(_0x14253c){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x39'),_0x14253c['uniqueid']),_0x14253c);calls['newchannel'](_0x14253c);recordings[_0x226a('0x38')](_0x14253c);}catch(_0x545ccc){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x39'),_0x14253c[_0x226a('0x19')]),_0x545ccc);}});ami['on'](_0x226a('0x3a'),function(_0x4fa196){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x3b'),_0x4fa196['uniqueid']),_0x4fa196);dials['dialbegin'](_0x4fa196);}catch(_0xa30746){utils[_0x226a('0xf')](util['format'](_0x226a('0x3c'),_0x4fa196['uniqueid']),_0xa30746);}});ami['on'](_0x226a('0x3d'),function(_0x2d803c){try{utils['debug'](util['format']('[%s][index][dialend]',_0x2d803c[_0x226a('0x19')]),_0x2d803c);dials[_0x226a('0x3d')](_0x2d803c);}catch(_0x32dbed){utils[_0x226a('0xf')](util['format'](_0x226a('0x3e'),_0x2d803c[_0x226a('0x19')]),_0x32dbed);}});} \ No newline at end of file +var _0x7423=['./agents.controller','./calls.controller','./queues.controller','./members.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','info'];(function(_0x5f3846,_0x260822){var _0x13247a=function(_0x2d2854){while(--_0x2d2854){_0x5f3846['push'](_0x5f3846['shift']());}};_0x13247a(++_0x260822);}(_0x7423,0x169));var _0x3742=function(_0x34662f,_0x582126){_0x34662f=_0x34662f-0x0;var _0x502c88=_0x7423[_0x34662f];return _0x502c88;};var AsteriskManager=require('asterisk-manager');var config=require(_0x3742('0x0'));var utils=require(_0x3742('0x1'));var util=require(_0x3742('0x2'));var ami=new AsteriskManager(config[_0x3742('0x3')][_0x3742('0x4')],config['asterisk']['ip'],config[_0x3742('0x3')][_0x3742('0x5')],config[_0x3742('0x3')][_0x3742('0x6')],!![]);ami[_0x3742('0x7')]();if(config[_0x3742('0x8')]&&config[_0x3742('0x8')][_0x3742('0x9')]){utils[_0x3742('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0x3742('0xb'));var calls=require(_0x3742('0xc'));var queues=require(_0x3742('0xd'));var recordings=require('./recordings.controller');var members=require(_0x3742('0xe'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0x3742('0xf'));ami['on']('connect',core['connect']);ami['on']('shutdown',core[_0x3742('0x10')]);ami['on'](_0x3742('0x11'),core[_0x3742('0x11')]);ami['on'](_0x3742('0x12'),core[_0x3742('0x12')]);ami['on'](_0x3742('0x13'),core[_0x3742('0x13')]);ami['on'](_0x3742('0x14'),core['managerevent']);ami['on'](_0x3742('0x15'),function(_0x363fe7){try{utils['debug'](util[_0x3742('0x16')](_0x3742('0x17'),_0x363fe7['device']),_0x363fe7);members[_0x3742('0x15')](_0x363fe7);}catch(_0x348d5e){utils[_0x3742('0x12')](util[_0x3742('0x16')]('[%s][index][devicestatechange]',_0x363fe7[_0x3742('0x18')]),_0x348d5e);}});ami['on'](_0x3742('0x19'),function(_0x5dad75){try{utils[_0x3742('0x1a')](util['format'](_0x3742('0x1b'),_0x5dad75['uniqueid']),_0x5dad75);agents[_0x3742('0x19')](_0x5dad75);}catch(_0x5abede){utils['error'](util[_0x3742('0x16')](_0x3742('0x1b'),_0x5dad75[_0x3742('0x1c')]),_0x5abede);}});ami['on'](_0x3742('0x1d'),function(_0x347525){try{utils[_0x3742('0x1a')](util['format']('[%s][index][agentringnoanswer]',_0x347525['uniqueid']),_0x347525);agents[_0x3742('0x1d')](_0x347525);}catch(_0xf83d20){utils[_0x3742('0x12')](util[_0x3742('0x16')]('[%s][index][agentringnoanswer]',_0x347525[_0x3742('0x1c')]),_0xf83d20);}});ami['on']('agentconnect',function(_0xadeab6){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x1e'),_0xadeab6['uniqueid']),_0xadeab6);agents['agentconnect'](_0xadeab6);queues[_0x3742('0x1f')](_0xadeab6);}catch(_0x4d71aa){utils[_0x3742('0x12')](util[_0x3742('0x16')](_0x3742('0x1e'),_0xadeab6[_0x3742('0x1c')]),_0x4d71aa);}});ami['on'](_0x3742('0x20'),function(_0x52d755){try{utils[_0x3742('0x1a')](util['format']('[%s][index][agentcomplete]',_0x52d755[_0x3742('0x1c')]),_0x52d755);agents[_0x3742('0x20')](_0x52d755);queues['agentcomplete'](_0x52d755);members['agentcomplete'](_0x52d755);}catch(_0x524877){utils[_0x3742('0x12')](util[_0x3742('0x16')](_0x3742('0x21'),_0x52d755[_0x3742('0x1c')]),_0x524877);}});ami['on']('queuecallerabandon',function(_0x1e4ed9){try{utils['debug'](util[_0x3742('0x16')]('[%s][index][queuecallerabandon]',_0x1e4ed9[_0x3742('0x1c')]),_0x1e4ed9);agents[_0x3742('0x22')](_0x1e4ed9);queues[_0x3742('0x22')](_0x1e4ed9);}catch(_0x5af3be){utils[_0x3742('0x12')](util[_0x3742('0x16')]('[%s][index][queuecallerabandon]',_0x1e4ed9[_0x3742('0x1c')]),_0x5af3be);}});ami['on'](_0x3742('0x23'),function(_0x27b134){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x24'),_0x27b134[_0x3742('0x1c')]),_0x27b134);queues[_0x3742('0x23')](_0x27b134);recordings[_0x3742('0x23')](_0x27b134);}catch(_0xa70f64){utils['error'](util[_0x3742('0x16')]('[%s][index][queuecallerjoin]',_0x27b134[_0x3742('0x1c')]),_0xa70f64);}});ami['on']('queuecallerleave',function(_0x3c30c6){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x25'),_0x3c30c6[_0x3742('0x1c')]),_0x3c30c6);queues['queuecallerleave'](_0x3c30c6);}catch(_0x10ef0c){utils[_0x3742('0x12')](util['format'](_0x3742('0x25'),_0x3c30c6['uniqueid']),_0x10ef0c);}});ami['on'](_0x3742('0x26'),function(_0x54a170){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x27'),_0x54a170[_0x3742('0x1c')]),_0x54a170);queues[_0x3742('0x26')](_0x54a170);calls['musiconholdstart'](_0x54a170);}catch(_0x53944e){utils['error'](util[_0x3742('0x16')](_0x3742('0x27'),_0x54a170['uniqueid']),_0x53944e);}});ami['on']('musiconholdstop',function(_0x59278f){try{utils['debug'](util['format'](_0x3742('0x28'),_0x59278f['uniqueid']),_0x59278f);queues['musiconholdstop'](_0x59278f);calls['musiconholdstop'](_0x59278f);}catch(_0x2fe260){utils['error'](util[_0x3742('0x16')]('[%s][index][musiconholdstop]',_0x59278f[_0x3742('0x1c')]),_0x2fe260);}});ami['on']('newstate',function(_0x172f2f){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x29'),_0x172f2f[_0x3742('0x1c')]),_0x172f2f);calls[_0x3742('0x2a')](_0x172f2f);recordings[_0x3742('0x2a')](_0x172f2f);}catch(_0x27fd44){utils['error'](util[_0x3742('0x16')]('[%s][index][newstate]',_0x172f2f[_0x3742('0x1c')]),_0x27fd44);}});ami['on'](_0x3742('0x2b'),function(_0x2643f0){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x2c'),_0x2643f0['uniqueid']),_0x2643f0);calls[_0x3742('0x2b')](_0x2643f0);recordings[_0x3742('0x2b')](_0x2643f0);dials[_0x3742('0x2b')](_0x2643f0);agents[_0x3742('0x2b')](_0x2643f0);queues[_0x3742('0x2b')](_0x2643f0);}catch(_0x5357ab){utils[_0x3742('0x12')](util[_0x3742('0x16')](_0x3742('0x2c'),_0x2643f0[_0x3742('0x1c')]),_0x5357ab);}});ami['on'](_0x3742('0x2d'),function(_0x30e6cd){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x2e'),_0x30e6cd[_0x3742('0x1c')]),_0x30e6cd);members[_0x3742('0x2d')](_0x30e6cd);}catch(_0x2e6b91){utils[_0x3742('0x12')](util[_0x3742('0x16')](_0x3742('0x2e'),_0x30e6cd[_0x3742('0x1c')]),_0x2e6b91);}});ami['on'](_0x3742('0x2f'),function(_0x232a03){try{utils['debug'](util[_0x3742('0x16')]('[%s][index][blindtransfer]',_0x232a03['uniqueid']),_0x232a03);queues[_0x3742('0x2f')](_0x232a03);agents[_0x3742('0x2f')](_0x232a03);transfers[_0x3742('0x2f')](_0x232a03);}catch(_0x73dce3){utils['error'](util[_0x3742('0x16')]('[%s][index][blindtransfer]',_0x232a03['uniqueid']),_0x73dce3);}});ami['on']('attendedtransfer',function(_0x2c192c){try{utils[_0x3742('0x1a')](util[_0x3742('0x16')](_0x3742('0x30'),_0x2c192c[_0x3742('0x31')]),_0x2c192c);queues['attendedtransfer'](_0x2c192c);transfers[_0x3742('0x32')](_0x2c192c);agents[_0x3742('0x32')](_0x2c192c);calls[_0x3742('0x32')](_0x2c192c);}catch(_0x33322c){utils[_0x3742('0x12')](util['format'](_0x3742('0x30'),_0x2c192c[_0x3742('0x31')]),_0x33322c);}});ami['on'](_0x3742('0x33'),function(_0x159f1a){try{utils['debug'](util[_0x3742('0x16')](_0x3742('0x34'),_0x159f1a[_0x3742('0x1c')]),_0x159f1a);queues['varset'](_0x159f1a);recordings[_0x3742('0x33')](_0x159f1a);calls['varset'](_0x159f1a);dials[_0x3742('0x33')](_0x159f1a);}catch(_0x48817d){utils[_0x3742('0x12')](util[_0x3742('0x16')]('[%s][index][varset]',_0x159f1a[_0x3742('0x1c')]),_0x48817d);}});ami['on']('newexten',function(_0x356e2f){try{utils['debug'](util['format']('[%s][index][newexten]',_0x356e2f[_0x3742('0x1c')]),_0x356e2f);calls[_0x3742('0x35')](_0x356e2f);recordings['newexten'](_0x356e2f);dials[_0x3742('0x35')](_0x356e2f);}catch(_0x744745){utils[_0x3742('0x12')](util[_0x3742('0x16')](_0x3742('0x36'),_0x356e2f[_0x3742('0x1c')]),_0x744745);}});ami['on'](_0x3742('0x37'),function(_0x5b4dde){try{utils['debug'](util['format'](_0x3742('0x38'),_0x5b4dde[_0x3742('0x1c')]),_0x5b4dde);calls[_0x3742('0x37')](_0x5b4dde);recordings['newchannel'](_0x5b4dde);}catch(_0xdc02a9){utils[_0x3742('0x12')](util[_0x3742('0x16')](_0x3742('0x38'),_0x5b4dde[_0x3742('0x1c')]),_0xdc02a9);}});ami['on'](_0x3742('0x39'),function(_0x2125d2){try{utils[_0x3742('0x1a')](util['format'](_0x3742('0x3a'),_0x2125d2[_0x3742('0x1c')]),_0x2125d2);dials[_0x3742('0x39')](_0x2125d2);}catch(_0x234dd4){utils[_0x3742('0x12')](util[_0x3742('0x16')](_0x3742('0x3b'),_0x2125d2[_0x3742('0x1c')]),_0x234dd4);}});ami['on'](_0x3742('0x3c'),function(_0x361c44){try{utils['debug'](util['format']('[%s][index][dialend]',_0x361c44[_0x3742('0x1c')]),_0x361c44);dials[_0x3742('0x3c')](_0x361c44);}catch(_0x450a30){utils[_0x3742('0x12')](util['format'](_0x3742('0x3d'),_0x361c44[_0x3742('0x1c')]),_0x450a30);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4ab4248..f7f2bbe 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 _0x3fec=['device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data3','lodash','Local/_attended@transfer','Queue:','info','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','format','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xc3fe('0x1'),_0xc3fe('0x2')];function writeDB(_0x5adb4c){utils[_0xc3fe('0x3')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5adb4c[_0xc3fe('0x4')],_0x5adb4c['interface'],_0x5adb4c[_0xc3fe('0x5')],_0x5adb4c[_0xc3fe('0x6')],_0x5adb4c[_0xc3fe('0x7')],_0x5adb4c[_0xc3fe('0x8')]));if(_0x5adb4c[_0xc3fe('0x9')]){utils[_0xc3fe('0xa')](_0x5adb4c[_0xc3fe('0x9')])[_0xc3fe('0xb')](function(_0x25b1eb){if(_0x25b1eb){_0x5adb4c[_0xc3fe('0x7')]=_0x25b1eb[_0xc3fe('0xc')];_0x5adb4c[_0xc3fe('0xd')]=_0x25b1eb[_0xc3fe('0xd')];utils[_0xc3fe('0xe')](_0xc3fe('0xf'),_0x5adb4c);}else{utils[_0xc3fe('0x10')](_0x5adb4c['interface'][_0xc3fe('0x11')]('/')[0x1])[_0xc3fe('0xb')](function(_0x4ff4c2){if(_0x4ff4c2){_0x5adb4c[_0xc3fe('0x7')]=_0x4ff4c2[_0xc3fe('0xc')];_0x5adb4c[_0xc3fe('0xd')]=_0x4ff4c2[_0xc3fe('0xd')];utils[_0xc3fe('0xe')](_0xc3fe('0xf'),_0x5adb4c);}});}})[_0xc3fe('0x12')](function(_0x7d5e67){utils[_0xc3fe('0x13')](util[_0xc3fe('0x14')]('[%s][members][writeDB]',_0x5adb4c[_0xc3fe('0x4')]),_0x7d5e67);});}delete members[_0x5adb4c['interface']];}function startsWith(_0x10091c,_0x18e5ed){return _[_0xc3fe('0x15')](_0x10091c,function(_0x25ce78){return _[_0xc3fe('0x16')](_0x18e5ed,_0x25ce78);});}exports[_0xc3fe('0x17')]=function(_0x1e291f){try{utils[_0xc3fe('0x18')](util[_0xc3fe('0x14')](_0xc3fe('0x19'),members[_0x1e291f[_0xc3fe('0x1a')]]?members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x4')]:_0x1e291f[_0xc3fe('0x1a')]),_0x1e291f);utils[_0xc3fe('0x3')](util['format'](_0xc3fe('0x1b'),members[_0x1e291f[_0xc3fe('0x1a')]]?members[_0x1e291f[_0xc3fe('0x1a')]]['uniqueid']:_0x1e291f[_0xc3fe('0x1a')],_0x1e291f[_0xc3fe('0x1c')],_0x1e291f['device']));switch(_0x1e291f['state']){case _0xc3fe('0x1d'):case _0xc3fe('0x1e'):if(!startsWith(exclude,_0x1e291f[_0xc3fe('0x1a')])){members[_0x1e291f['device']]={'channel':_0xc3fe('0x1f'),'interface':_0x1e291f[_0xc3fe('0x1a')],'type':_0xc3fe('0x20'),'enterAt':utils[_0xc3fe('0x21')](),'role':_0xc3fe('0x22')};}break;case _0xc3fe('0x23'):if(!_[_0xc3fe('0x24')](members[_0x1e291f[_0xc3fe('0x1a')]])){members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x25')]=utils[_0xc3fe('0x21')]();members[_0x1e291f[_0xc3fe('0x1a')]]['duration']=utils[_0xc3fe('0x26')](members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x25')],members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x27')]);if(members[_0x1e291f['device']][_0xc3fe('0x4')]){writeDB(members[_0x1e291f[_0xc3fe('0x1a')]]);}}break;default:break;}}catch(_0x2bfaa0){utils[_0xc3fe('0x13')](util[_0xc3fe('0x14')](_0xc3fe('0x19'),members[_0x1e291f[_0xc3fe('0x1a')]]?members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x4')]:_0x1e291f[_0xc3fe('0x1a')]),_0x2bfaa0);}};exports[_0xc3fe('0x28')]=function(_0x17fe31){try{if(!_[_0xc3fe('0x24')](members[_0x17fe31[_0xc3fe('0x9')]])){utils[_0xc3fe('0x18')](util[_0xc3fe('0x14')](_0xc3fe('0x29'),_0x17fe31[_0xc3fe('0x4')]),_0x17fe31);utils['info'](util[_0xc3fe('0x14')](_0xc3fe('0x2a'),_0x17fe31[_0xc3fe('0x4')],_0x17fe31[_0xc3fe('0x9')],_0x17fe31[_0xc3fe('0x2b')]));members[_0x17fe31[_0xc3fe('0x9')]]=_[_0xc3fe('0x2c')](members[_0x17fe31[_0xc3fe('0x9')]],{'data4':_0x17fe31[_0xc3fe('0x2b')],'uniqueid':_0x17fe31[_0xc3fe('0x4')]});}}catch(_0x7b42b9){utils['error'](util['format']('[%s][members][agentcomplete]',_0x17fe31[_0xc3fe('0x4')]),_0x7b42b9);}};exports[_0xc3fe('0x2d')]=function(_0x56ad4f){try{utils[_0xc3fe('0x18')](util[_0xc3fe('0x14')]('[%s][members][cdr]',_0x56ad4f['uniqueid']),_0x56ad4f);if(_0x56ad4f[_0xc3fe('0x5')]){var _0x237680=_0x56ad4f[_0xc3fe('0x5')][_0xc3fe('0x11')]('-')[0x0];if(!_['isNil'](members[_0x237680])){members[_0x237680]=_['assign'](members[_0x237680],{'data1':members[_0x237680][_0xc3fe('0x2e')]||_0x56ad4f[_0xc3fe('0x8')],'data2':members[_0x237680][_0xc3fe('0x6')]||_0x56ad4f[_0xc3fe('0x2f')],'data3':members[_0x237680]['data3']||_0x56ad4f[_0xc3fe('0x30')],'uniqueid':members[_0x237680]['uniqueid']||_0x56ad4f[_0xc3fe('0x4')]});utils['info'](util[_0xc3fe('0x14')](_0xc3fe('0x31'),_0x56ad4f['uniqueid'],members[_0x237680][_0xc3fe('0x2e')],members[_0x237680][_0xc3fe('0x6')],members[_0x237680]['data3']));if(members[_0x237680][_0xc3fe('0x25')]){writeDB(members[_0x237680]);}}}if(_0x56ad4f['destinationchannel']){var _0x217f17=_0x56ad4f[_0xc3fe('0x32')][_0xc3fe('0x11')]('-')[0x0];if(!_[_0xc3fe('0x24')](members[_0x217f17])){members[_0x217f17]=_[_0xc3fe('0x2c')](members[_0x217f17],{'data1':members[_0x217f17]['data1']||_0x56ad4f[_0xc3fe('0x8')],'data2':members[_0x217f17][_0xc3fe('0x6')]||_0x56ad4f[_0xc3fe('0x2f')],'data3':members[_0x217f17][_0xc3fe('0x33')]||_0x56ad4f[_0xc3fe('0x30')],'uniqueid':members[_0x217f17][_0xc3fe('0x4')]||_0x56ad4f[_0xc3fe('0x4')]});utils['info'](util[_0xc3fe('0x14')](_0xc3fe('0x31'),_0x56ad4f[_0xc3fe('0x4')],members[_0x217f17][_0xc3fe('0x2e')],members[_0x217f17][_0xc3fe('0x6')],members[_0x217f17][_0xc3fe('0x33')]));if(members[_0x217f17][_0xc3fe('0x25')]){writeDB(members[_0x217f17]);}}}}catch(_0x5d4bfc){utils['error'](util[_0xc3fe('0x14')]('[%s][members][cdr]',_0x56ad4f['uniqueid']),_0x5d4bfc);}}; \ No newline at end of file +var _0x8ba1=['catch','error','format','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','split','data1','source','data3','destinationchannel','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName'];(function(_0xc93c01,_0x5ba6b6){var _0x11539b=function(_0x4e2a86){while(--_0x4e2a86){_0xc93c01['push'](_0xc93c01['shift']());}};_0x11539b(++_0x5ba6b6);}(_0x8ba1,0x19e));var _0x18ba=function(_0x4eeaba,_0xb83db4){_0x4eeaba=_0x4eeaba-0x0;var _0xe1d92d=_0x8ba1[_0x4eeaba];return _0xe1d92d;};'use strict';var _=require('lodash');var util=require(_0x18ba('0x0'));var utils=require(_0x18ba('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x18ba('0x2')];function writeDB(_0xc21bd4){utils[_0x18ba('0x3')](util['format'](_0x18ba('0x4'),_0xc21bd4[_0x18ba('0x5')],_0xc21bd4['interface'],_0xc21bd4[_0x18ba('0x6')],_0xc21bd4[_0x18ba('0x7')],_0xc21bd4[_0x18ba('0x8')],_0xc21bd4[_0x18ba('0x9')]));if(_0xc21bd4[_0x18ba('0xa')]){utils[_0x18ba('0xb')](_0xc21bd4[_0x18ba('0xa')])[_0x18ba('0xc')](function(_0x4ec5ad){if(_0x4ec5ad){_0xc21bd4[_0x18ba('0x8')]=_0x4ec5ad[_0x18ba('0xd')];_0xc21bd4[_0x18ba('0xe')]=_0x4ec5ad[_0x18ba('0xe')];utils[_0x18ba('0xf')](_0x18ba('0x10'),_0xc21bd4);}else{utils[_0x18ba('0x11')](_0xc21bd4[_0x18ba('0xa')]['split']('/')[0x1])[_0x18ba('0xc')](function(_0x5b90d8){if(_0x5b90d8){_0xc21bd4['membername']=_0x5b90d8[_0x18ba('0xd')];_0xc21bd4[_0x18ba('0xe')]=_0x5b90d8[_0x18ba('0xe')];utils[_0x18ba('0xf')]('CreateMemberReport',_0xc21bd4);}});}})[_0x18ba('0x12')](function(_0x416379){utils[_0x18ba('0x13')](util[_0x18ba('0x14')](_0x18ba('0x15'),_0xc21bd4[_0x18ba('0x5')]),_0x416379);});}delete members[_0xc21bd4[_0x18ba('0xa')]];}function startsWith(_0x17b3e5,_0x184b3e){return _[_0x18ba('0x16')](_0x17b3e5,function(_0x8fbc0f){return _[_0x18ba('0x17')](_0x184b3e,_0x8fbc0f);});}exports['devicestatechange']=function(_0x531cb7){try{utils[_0x18ba('0x18')](util['format'](_0x18ba('0x19'),members[_0x531cb7[_0x18ba('0x1a')]]?members[_0x531cb7[_0x18ba('0x1a')]][_0x18ba('0x5')]:_0x531cb7['device']),_0x531cb7);utils['info'](util[_0x18ba('0x14')](_0x18ba('0x1b'),members[_0x531cb7['device']]?members[_0x531cb7['device']][_0x18ba('0x5')]:_0x531cb7['device'],_0x531cb7[_0x18ba('0x1c')],_0x531cb7[_0x18ba('0x1a')]));switch(_0x531cb7[_0x18ba('0x1c')]){case _0x18ba('0x1d'):case _0x18ba('0x1e'):if(!startsWith(exclude,_0x531cb7['device'])){members[_0x531cb7[_0x18ba('0x1a')]]={'channel':_0x18ba('0x1f'),'interface':_0x531cb7[_0x18ba('0x1a')],'type':_0x18ba('0x20'),'enterAt':utils[_0x18ba('0x21')](),'role':_0x18ba('0x22')};}break;case _0x18ba('0x23'):if(!_[_0x18ba('0x24')](members[_0x531cb7[_0x18ba('0x1a')]])){members[_0x531cb7[_0x18ba('0x1a')]][_0x18ba('0x25')]=utils[_0x18ba('0x21')]();members[_0x531cb7[_0x18ba('0x1a')]][_0x18ba('0x26')]=utils[_0x18ba('0x27')](members[_0x531cb7[_0x18ba('0x1a')]][_0x18ba('0x25')],members[_0x531cb7[_0x18ba('0x1a')]][_0x18ba('0x28')]);if(members[_0x531cb7[_0x18ba('0x1a')]][_0x18ba('0x5')]){writeDB(members[_0x531cb7[_0x18ba('0x1a')]]);}}break;default:break;}}catch(_0x8fdcc4){utils[_0x18ba('0x13')](util[_0x18ba('0x14')](_0x18ba('0x19'),members[_0x531cb7[_0x18ba('0x1a')]]?members[_0x531cb7[_0x18ba('0x1a')]][_0x18ba('0x5')]:_0x531cb7['device']),_0x8fdcc4);}};exports[_0x18ba('0x29')]=function(_0x194ce3){try{if(!_['isNil'](members[_0x194ce3[_0x18ba('0xa')]])){utils[_0x18ba('0x18')](util['format'](_0x18ba('0x2a'),_0x194ce3[_0x18ba('0x5')]),_0x194ce3);utils['info'](util[_0x18ba('0x14')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x194ce3[_0x18ba('0x5')],_0x194ce3[_0x18ba('0xa')],_0x194ce3[_0x18ba('0x2b')]));members[_0x194ce3[_0x18ba('0xa')]]=_[_0x18ba('0x2c')](members[_0x194ce3[_0x18ba('0xa')]],{'data4':_0x194ce3['queue'],'uniqueid':_0x194ce3[_0x18ba('0x5')]});}}catch(_0x45a109){utils[_0x18ba('0x13')](util['format'](_0x18ba('0x2a'),_0x194ce3['uniqueid']),_0x45a109);}};exports[_0x18ba('0x2d')]=function(_0x5ebc6b){try{utils[_0x18ba('0x18')](util[_0x18ba('0x14')](_0x18ba('0x2e'),_0x5ebc6b[_0x18ba('0x5')]),_0x5ebc6b);if(_0x5ebc6b[_0x18ba('0x6')]){var _0x443675=_0x5ebc6b['channel'][_0x18ba('0x2f')]('-')[0x0];if(!_[_0x18ba('0x24')](members[_0x443675])){members[_0x443675]=_['assign'](members[_0x443675],{'data1':members[_0x443675][_0x18ba('0x30')]||_0x5ebc6b[_0x18ba('0x9')],'data2':members[_0x443675][_0x18ba('0x7')]||_0x5ebc6b[_0x18ba('0x31')],'data3':members[_0x443675][_0x18ba('0x32')]||_0x5ebc6b['destination'],'uniqueid':members[_0x443675][_0x18ba('0x5')]||_0x5ebc6b[_0x18ba('0x5')]});utils[_0x18ba('0x3')](util[_0x18ba('0x14')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5ebc6b[_0x18ba('0x5')],members[_0x443675][_0x18ba('0x30')],members[_0x443675][_0x18ba('0x7')],members[_0x443675][_0x18ba('0x32')]));if(members[_0x443675][_0x18ba('0x25')]){writeDB(members[_0x443675]);}}}if(_0x5ebc6b[_0x18ba('0x33')]){var _0x241501=_0x5ebc6b[_0x18ba('0x33')][_0x18ba('0x2f')]('-')[0x0];if(!_[_0x18ba('0x24')](members[_0x241501])){members[_0x241501]=_[_0x18ba('0x2c')](members[_0x241501],{'data1':members[_0x241501][_0x18ba('0x30')]||_0x5ebc6b['type'],'data2':members[_0x241501][_0x18ba('0x7')]||_0x5ebc6b[_0x18ba('0x31')],'data3':members[_0x241501]['data3']||_0x5ebc6b[_0x18ba('0x34')],'uniqueid':members[_0x241501][_0x18ba('0x5')]||_0x5ebc6b[_0x18ba('0x5')]});utils['info'](util[_0x18ba('0x14')](_0x18ba('0x35'),_0x5ebc6b[_0x18ba('0x5')],members[_0x241501][_0x18ba('0x30')],members[_0x241501][_0x18ba('0x7')],members[_0x241501][_0x18ba('0x32')]));if(members[_0x241501][_0x18ba('0x25')]){writeDB(members[_0x241501]);}}}}catch(_0x4ec1d3){utils[_0x18ba('0x13')](util[_0x18ba('0x14')](_0x18ba('0x2e'),_0x5ebc6b[_0x18ba('0x5')]),_0x4ec1d3);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e9cddac..cc877d2 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 _0xc764=['queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','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]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum','accountcode','then','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','uniqueid','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','debug','[%s][queues][hangup]'];(function(_0xbcea1,_0x469f9f){var _0x17fb47=function(_0x48f5e7){while(--_0x48f5e7){_0xbcea1['push'](_0xbcea1['shift']());}};_0x17fb47(++_0x469f9f);}(_0xc764,0x11a));var _0x4c76=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0xc764[_0x3caeb5];return _0x5eca7e;};'use strict';var _=require(_0x4c76('0x0'));var util=require(_0x4c76('0x1'));var utils=require(_0x4c76('0x2'));var queues={};function writeDB(_0x3a2341){utils['info'](util[_0x4c76('0x3')](_0x4c76('0x4'),_0x3a2341['uniqueid'],_0x3a2341[_0x4c76('0x5')],_0x3a2341[_0x4c76('0x6')],_0x3a2341['lastAssignedTo'],_0x3a2341[_0x4c76('0x7')],_0x3a2341[_0x4c76('0x8')],_0x3a2341['queuecallerexitreason']));if(_0x3a2341[_0x4c76('0x6')]){utils['getVoiceQueueByName'](_0x3a2341[_0x4c76('0x6')])[_0x4c76('0x9')](function(_0x501d28){if(_0x501d28){_0x3a2341['type']=_0x501d28[_0x4c76('0xa')];}utils['request']('CreateVoiceQueueReport',_0x3a2341);});}else{utils['request'](_0x4c76('0xb'),_0x3a2341);}if(_0x3a2341[_0x4c76('0xc')]){delete queues[_0x3a2341[_0x4c76('0xc')]];}else{delete queues[_0x3a2341['uniqueid']];}}exports[_0x4c76('0xd')]=function(_0x1f2a2e){try{utils['debug'](util[_0x4c76('0x3')](_0x4c76('0xe'),_0x1f2a2e[_0x4c76('0xf')]),_0x1f2a2e);utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x11'),_0x1f2a2e['uniqueid'],_0x1f2a2e[_0x4c76('0x6')],_0x1f2a2e[_0x4c76('0x12')]));queues[_0x1f2a2e[_0x4c76('0xf')]]=_['assign'](_0x1f2a2e,{'originalposition':_0x1f2a2e[_0x4c76('0x12')],'queuecallerjoinAt':utils[_0x4c76('0x13')](),'mohtime':0x0});}catch(_0x300fb4){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0xe'),_0x1f2a2e[_0x4c76('0xf')]),_0x300fb4);}};exports[_0x4c76('0x15')]=function(_0x466aa7){try{if(!_['isNil'](queues[_0x466aa7[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util['format'](_0x4c76('0x17'),_0x466aa7[_0x4c76('0xf')]),_0x466aa7);if(queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x18')]){if(!queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x19')]&&!queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1a')]){queues[_0x466aa7['uniqueid']][_0x4c76('0x1b')]=!![];queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1c')]=utils['now']();queues[_0x466aa7['uniqueid']][_0x4c76('0x1d')]='COMPLETEDBYAGENT';}utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x1e'),_0x466aa7['uniqueid'],queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1f')],queues[_0x466aa7['uniqueid']][_0x4c76('0x1d')]));writeDB(queues[_0x466aa7[_0x4c76('0xf')]]);}else if(queues[_0x466aa7[_0x4c76('0xf')]]['transfereduniqueid']){utils[_0x4c76('0x10')](util[_0x4c76('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x466aa7[_0x4c76('0xf')],queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1f')],queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0xc')]));queues[queues[_0x466aa7[_0x4c76('0xf')]]['transfereduniqueid']]=queues[_0x466aa7[_0x4c76('0xf')]];queues[queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0xc')]][_0x4c76('0x20')]=0x2;delete queues[_0x466aa7['uniqueid']];}}}catch(_0x21ac38){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x17'),_0x466aa7['uniqueid']),_0x21ac38);}};exports[_0x4c76('0x21')]=function(_0x33d5a9){try{utils['debug'](util[_0x4c76('0x3')](_0x4c76('0x22'),_0x33d5a9[_0x4c76('0xf')]),_0x33d5a9);if(!_[_0x4c76('0x23')](_0x33d5a9[_0x4c76('0x24')]['queuestatus'])&&_0x33d5a9[_0x4c76('0x25')][_0x4c76('0x26')]()!==_0x4c76('0x27')){if(!_[_0x4c76('0x23')](queues[_0x33d5a9[_0x4c76('0xf')]])){queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x28')]=null;queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1a')]=!![];queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x29')]=utils[_0x4c76('0x13')]();queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1d')]=_0x33d5a9[_0x4c76('0x25')][_0x4c76('0x26')]();utils[_0x4c76('0x10')](util[_0x4c76('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x33d5a9['uniqueid'],queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x33d5a9['value'],queues[_0x33d5a9[_0x4c76('0xf')]]['queuecallerexitreason']));writeDB(queues[_0x33d5a9['uniqueid']]);}}else if(!_[_0x4c76('0x23')](_0x33d5a9['variable'][_0x4c76('0x2a')])){if(!_['isNil'](queues[_0x33d5a9['uniqueid']])&&!queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x19')]){queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x33d5a9[_0x4c76('0xf')]]['queuecallerabandonAt']=null;queues[_0x33d5a9[_0x4c76('0xf')]]['queuecallerexit']=!![];queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x29')]=utils['now']();queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1d')]=_0x4c76('0x2b');utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x2c'),_0x33d5a9['uniqueid'],queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x33d5a9[_0x4c76('0x25')],queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1d')]));}}}catch(_0x1d9470){utils['error'](util[_0x4c76('0x3')]('[%s][queues][varset]',_0x33d5a9['uniqueid']),_0x1d9470);}};exports['queuecallerabandon']=function(_0x4e8ded){try{if(!_[_0x4c76('0x23')](queues[_0x4e8ded[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util[_0x4c76('0x3')](_0x4c76('0x2d'),_0x4e8ded[_0x4c76('0xf')]),_0x4e8ded);queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1a')]=![];queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x29')]=null;queues[_0x4e8ded[_0x4c76('0xf')]]['queuecallerabandon']=!![];queues[_0x4e8ded['uniqueid']][_0x4c76('0x28')]=utils[_0x4c76('0x13')]();queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1d')]=_0x4c76('0x2e');utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x2f'),_0x4e8ded['uniqueid'],queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1f')],queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1d')]));}}catch(_0x29caa0){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x2d'),_0x4e8ded['uniqueid']),_0x29caa0);}};exports[_0x4c76('0x30')]=function(_0x1da478){try{if(!_[_0x4c76('0x23')](queues[_0x1da478[_0x4c76('0xf')]])){utils['debug'](util[_0x4c76('0x3')]('[%s][queues][queuecallerleave]',_0x1da478['uniqueid']),_0x1da478);utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x31'),_0x1da478[_0x4c76('0xf')],queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x1da478['connectedlinenum'],_0x1da478['connectedlinename']));queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x30')]=!![];queues[_0x1da478['uniqueid']]['queuecallerleaveAt']=utils[_0x4c76('0x13')]();queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x32')]=utils[_0x4c76('0x33')](queues[_0x1da478[_0x4c76('0xf')]]['queuecallerleaveAt'],queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x34')]);queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x12')]=_0x1da478[_0x4c76('0x12')];queues[_0x1da478['uniqueid']][_0x4c76('0x35')]=_0x1da478[_0x4c76('0x35')];queues[_0x1da478['uniqueid']][_0x4c76('0x36')]=_0x1da478[_0x4c76('0x36')];queues[_0x1da478['uniqueid']][_0x4c76('0x37')]=_0x1da478[_0x4c76('0x37')];}}catch(_0x24f5d8){utils['error'](util[_0x4c76('0x3')]('[%s][queues][queuecallerleave]',_0x1da478[_0x4c76('0xf')]),_0x24f5d8);}};exports[_0x4c76('0x38')]=function(_0x258bbc){try{if(!_[_0x4c76('0x23')](queues[_0x258bbc[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util[_0x4c76('0x3')]('[%s][queues][agentconnect]',_0x258bbc[_0x4c76('0xf')]),_0x258bbc);utils[_0x4c76('0x10')](util['format'](_0x4c76('0x39'),_0x258bbc[_0x4c76('0xf')],queues[_0x258bbc[_0x4c76('0xf')]]['name'],_0x258bbc[_0x4c76('0x3a')],_0x258bbc[_0x4c76('0x3b')]));queues[_0x258bbc[_0x4c76('0xf')]]['queuecallerabandon']=![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x28')]=null;queues[_0x258bbc[_0x4c76('0xf')]]['queuecallerexit']=![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x1d')]=null;queues[_0x258bbc[_0x4c76('0xf')]]['queuecallerexitAt']=null;queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x3c')]=!![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x8')]=_0x258bbc[_0x4c76('0x3b')];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x3d')]=_0x258bbc['membername'];}}catch(_0x1daf0d){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x3e'),_0x258bbc[_0x4c76('0xf')]),_0x1daf0d);}};exports[_0x4c76('0x3f')]=function(_0x1dcf1f){try{if(!_[_0x4c76('0x23')](queues[_0x1dcf1f[_0x4c76('0xf')]])){if(queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x18')]){utils[_0x4c76('0x16')](util[_0x4c76('0x3')](_0x4c76('0x40'),_0x1dcf1f['uniqueid']),_0x1dcf1f);queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x1dcf1f[_0x4c76('0xf')]]['queuecallerabandon']=![];queues[_0x1dcf1f[_0x4c76('0xf')]]['queuecallerabandonAt']=null;queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1a')]=![];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x29')]=null;queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x3c')]=!![];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x3d')]=_0x1dcf1f[_0x4c76('0x3a')];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1b')]=!![];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1c')]=utils[_0x4c76('0x13')]();if(_0x1dcf1f['reason']==_0x4c76('0x41')){if(!queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x41')]){queues[_0x1dcf1f['uniqueid']][_0x4c76('0x1d')]=_0x4c76('0x42');}}else{queues[_0x1dcf1f['uniqueid']]['queuecallerexitreason']=_0x4c76('0x43')+_0x1dcf1f['reason']['toUpperCase']();}utils[_0x4c76('0x10')](util['format'](_0x4c76('0x44'),_0x1dcf1f[_0x4c76('0xf')],queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x1dcf1f['membername'],queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1d')]));writeDB(queues[_0x1dcf1f[_0x4c76('0xf')]]);}}}catch(_0x4929ab){utils['error'](util[_0x4c76('0x3')](_0x4c76('0x40'),_0x1dcf1f[_0x4c76('0xf')]),_0x4929ab);}};exports['blindtransfer']=function(_0x5974b1){try{if(!_['isNil'](queues[_0x5974b1[_0x4c76('0x45')]])){utils['debug'](util[_0x4c76('0x3')]('[%s][queues][blindtransfer]',_0x5974b1['uniqueid']),_0x5974b1);queues[_0x5974b1['transfereeuniqueid']][_0x4c76('0x41')]=!![];queues[_0x5974b1[_0x4c76('0x45')]][_0x4c76('0x46')]=_0x4c76('0x47');queues[_0x5974b1['transfereeuniqueid']][_0x4c76('0x48')]=_0x5974b1['extension'];queues[_0x5974b1[_0x4c76('0x45')]][_0x4c76('0x49')]=_0x5974b1[_0x4c76('0x45')];queues[_0x5974b1[_0x4c76('0x45')]]['queuecallerexitreason']=_0x4c76('0x4a');utils['info'](util[_0x4c76('0x3')](_0x4c76('0x4b'),_0x5974b1[_0x4c76('0xf')],queues[_0x5974b1['transfereeuniqueid']][_0x4c76('0x1f')],_0x5974b1[_0x4c76('0x45')],_0x5974b1[_0x4c76('0x4c')]));}}catch(_0x1b202e){utils['error'](util[_0x4c76('0x3')](_0x4c76('0x4d'),_0x5974b1[_0x4c76('0xf')]),_0x1b202e);}};exports[_0x4c76('0x4e')]=function(_0x15fad7){try{utils['debug'](util[_0x4c76('0x3')](_0x4c76('0x4f'),_0x15fad7[_0x4c76('0x50')]),_0x15fad7);if(_0x15fad7['origtransfereruniqueid']==_0x15fad7[_0x4c76('0x51')]){if(!_[_0x4c76('0x23')](queues[_0x15fad7['secondtransfererlinkedid']])){utils[_0x4c76('0x10')](util[_0x4c76('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0x1f')],_0x15fad7['origtransfererexten']));queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0x41')]=!![];queues[_0x15fad7['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x15fad7['secondtransfererlinkedid']][_0x4c76('0x48')]=_0x15fad7[_0x4c76('0x53')];queues[_0x15fad7['secondtransfererlinkedid']][_0x4c76('0x49')]=_0x15fad7['origtransfereruniqueid'];queues[_0x15fad7[_0x4c76('0x52')]]['queuecallerexitreason']=_0x4c76('0x54');}if(!_['isNil'](queues[_0x15fad7[_0x4c76('0x51')]])){if(_0x15fad7['transfereelinkedid']&&queues[_0x15fad7[_0x4c76('0x55')]]){queues[_0x15fad7[_0x4c76('0x55')]]['queuecallerenterreason']=0x1;queues[_0x15fad7[_0x4c76('0x45')]]=_[_0x4c76('0x56')](queues[_0x15fad7[_0x4c76('0x55')]]);queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0xc')]=_0x15fad7[_0x4c76('0x57')];queues[_0x15fad7[_0x4c76('0x45')]]['queuecallerenterreason']=0x2;queues[_0x15fad7['transfereeuniqueid']][_0x4c76('0x7')]=queues[_0x15fad7[_0x4c76('0x52')]]['calleridnum'];queues[_0x15fad7[_0x4c76('0x45')]]['calleridname']=queues[_0x15fad7[_0x4c76('0x52')]]['calleridname'];queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0x34')]=utils[_0x4c76('0x13')]();queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0x18')]=utils['now']();queues[_0x15fad7['transfereeuniqueid']][_0x4c76('0x32')]=0x0;queues[_0x15fad7['transfereeuniqueid']][_0x4c76('0x58')]=0x0;utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x59'),_0x15fad7['origtransfereruniqueid'],queues[_0x15fad7['transfereeuniqueid']]['name'],queues[_0x15fad7[_0x4c76('0x45')]]['calleridnum'],queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0x5a')]));}else{utils['info'](util[_0x4c76('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x51')]]['name'],_0x15fad7[_0x4c76('0x52')]));queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0xc')]=_0x15fad7[_0x4c76('0x52')];}}}else if(_0x15fad7['secondtransfereruniqueid']==_0x15fad7[_0x4c76('0x52')]){if(!_[_0x4c76('0x23')](queues[_0x15fad7[_0x4c76('0x51')]])){utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x5b'),_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x51')]]['name'],_0x15fad7[_0x4c76('0x5c')],_0x15fad7[_0x4c76('0x5d')]));queues[_0x15fad7['origtransfererlinkedid']][_0x4c76('0x41')]=!![];queues[_0x15fad7[_0x4c76('0x51')]]['transfertype']='ATTENDED';queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x48')]=_0x15fad7[_0x4c76('0x5d')];queues[_0x15fad7[_0x4c76('0x51')]]['transferuniqueid']=_0x15fad7['secondtransfereruniqueid'];queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x1d')]='ATTENDEDTRANSFER';}if(!_[_0x4c76('0x23')](queues[_0x15fad7[_0x4c76('0x52')]])){if(_0x15fad7[_0x4c76('0x5e')]&&queues[_0x15fad7[_0x4c76('0x5e')]]){queues[_0x15fad7[_0x4c76('0x5e')]][_0x4c76('0x20')]=0x1;queues[_0x15fad7['transfertargetuniqueid']]=_[_0x4c76('0x56')](queues[_0x15fad7[_0x4c76('0x5e')]]);queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0xc')]=_0x15fad7['transfertargetuniqueid'];queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x20')]=0x2;queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x7')]=queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x7')];queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x5a')]=queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x5a')];queues[_0x15fad7['transfertargetuniqueid']][_0x4c76('0x34')]=utils['now']();queues[_0x15fad7[_0x4c76('0x57')]]['queuecallerleaveAt']=utils[_0x4c76('0x13')]();queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x32')]=0x0;queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x58')]=0x0;utils[_0x4c76('0x10')](util['format'](_0x4c76('0x5f'),_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x1f')],queues[_0x15fad7[_0x4c76('0x57')]]['transfereduniqueid'],queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x7')],queues[_0x15fad7['transfertargetuniqueid']][_0x4c76('0x5a')]));}else{utils['info'](util[_0x4c76('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x15fad7['origtransfereruniqueid'],queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0x1f')],_0x15fad7[_0x4c76('0x51')]));queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0xc')]=_0x15fad7[_0x4c76('0x51')];}}}}catch(_0x3230e2){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x4f'),_0x15fad7[_0x4c76('0x50')]),_0x3230e2);}};exports[_0x4c76('0x60')]=function(_0x44008e){try{if(!_[_0x4c76('0x23')](queues[_0x44008e[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util['format'](_0x4c76('0x61'),_0x44008e['uniqueid']),_0x44008e);queues[_0x44008e[_0x4c76('0xf')]][_0x4c76('0x62')]=utils[_0x4c76('0x13')]();utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x63'),_0x44008e['uniqueid'],queues[_0x44008e[_0x4c76('0xf')]]['name'],queues[_0x44008e[_0x4c76('0xf')]][_0x4c76('0x62')]));}}catch(_0x5e087b){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x61'),_0x44008e['uniqueid']),_0x5e087b);}};exports['musiconholdstop']=function(_0x253e61){try{if(!_[_0x4c76('0x23')](queues[_0x253e61[_0x4c76('0xf')]])){if(!_['isNil'](queues[_0x253e61['uniqueid']][_0x4c76('0x62')])){utils[_0x4c76('0x16')](util['format'](_0x4c76('0x64'),_0x253e61[_0x4c76('0xf')]),_0x253e61);queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x58')]+=utils[_0x4c76('0x33')](utils['now'](),queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x62')]);utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x65'),_0x253e61['uniqueid'],queues[_0x253e61[_0x4c76('0xf')]]['name'],queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x58')]));delete queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x62')];}}}catch(_0x48c96f){utils['error'](util[_0x4c76('0x3')](_0x4c76('0x64'),_0x253e61[_0x4c76('0xf')]),_0x48c96f);}}; \ No newline at end of file +var _0x7191=['CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','assigned','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transferexten','extension','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','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request'];(function(_0xf2e064,_0x54e169){var _0x5003b1=function(_0x2db677){while(--_0x2db677){_0xf2e064['push'](_0xf2e064['shift']());}};_0x5003b1(++_0x54e169);}(_0x7191,0x136));var _0x1719=function(_0x2f5638,_0x3f4643){_0x2f5638=_0x2f5638-0x0;var _0x35507f=_0x7191[_0x2f5638];return _0x35507f;};'use strict';var _=require(_0x1719('0x0'));var util=require(_0x1719('0x1'));var utils=require(_0x1719('0x2'));var queues={};function writeDB(_0x28320b){utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x5'),_0x28320b[_0x1719('0x6')],_0x28320b[_0x1719('0x7')],_0x28320b['queue'],_0x28320b[_0x1719('0x8')],_0x28320b[_0x1719('0x9')],_0x28320b[_0x1719('0xa')],_0x28320b[_0x1719('0xb')]));if(_0x28320b[_0x1719('0xc')]){utils[_0x1719('0xd')](_0x28320b['queue'])[_0x1719('0xe')](function(_0x545bb1){if(_0x545bb1){_0x28320b[_0x1719('0xf')]=_0x545bb1[_0x1719('0xf')];}utils[_0x1719('0x10')](_0x1719('0x11'),_0x28320b);});}else{utils['request']('CreateVoiceQueueReport',_0x28320b);}if(_0x28320b[_0x1719('0x12')]){delete queues[_0x28320b[_0x1719('0x12')]];}else{delete queues[_0x28320b['uniqueid']];}}exports[_0x1719('0x13')]=function(_0x1c28f7){try{utils[_0x1719('0x14')](util['format']('[%s][queues][queuecallerjoin]',_0x1c28f7['uniqueid']),_0x1c28f7);utils[_0x1719('0x3')](util[_0x1719('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x1c28f7['uniqueid'],_0x1c28f7[_0x1719('0xc')],_0x1c28f7[_0x1719('0x15')]));queues[_0x1c28f7[_0x1719('0x6')]]=_[_0x1719('0x16')](_0x1c28f7,{'originalposition':_0x1c28f7['position'],'queuecallerjoinAt':utils[_0x1719('0x17')](),'mohtime':0x0});}catch(_0x386e65){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x19'),_0x1c28f7['uniqueid']),_0x386e65);}};exports[_0x1719('0x1a')]=function(_0xd90fef){try{if(!_['isNil'](queues[_0xd90fef[_0x1719('0x6')]])){utils[_0x1719('0x14')](util[_0x1719('0x4')](_0x1719('0x1b'),_0xd90fef[_0x1719('0x6')]),_0xd90fef);if(queues[_0xd90fef['uniqueid']][_0x1719('0x1c')]){if(!queues[_0xd90fef[_0x1719('0x6')]][_0x1719('0x1d')]&&!queues[_0xd90fef[_0x1719('0x6')]][_0x1719('0x1e')]){queues[_0xd90fef[_0x1719('0x6')]]['queuecallercomplete']=!![];queues[_0xd90fef['uniqueid']]['queuecallercompleteAt']=utils[_0x1719('0x17')]();queues[_0xd90fef['uniqueid']][_0x1719('0xb')]=_0x1719('0x1f');}utils['info'](util[_0x1719('0x4')](_0x1719('0x20'),_0xd90fef[_0x1719('0x6')],queues[_0xd90fef[_0x1719('0x6')]][_0x1719('0x21')],queues[_0xd90fef[_0x1719('0x6')]][_0x1719('0xb')]));writeDB(queues[_0xd90fef['uniqueid']]);}else if(queues[_0xd90fef[_0x1719('0x6')]][_0x1719('0x12')]){utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x22'),_0xd90fef[_0x1719('0x6')],queues[_0xd90fef[_0x1719('0x6')]][_0x1719('0x21')],queues[_0xd90fef['uniqueid']][_0x1719('0x12')]));queues[queues[_0xd90fef[_0x1719('0x6')]][_0x1719('0x12')]]=queues[_0xd90fef[_0x1719('0x6')]];queues[queues[_0xd90fef[_0x1719('0x6')]]['transfereduniqueid']][_0x1719('0x23')]=0x2;delete queues[_0xd90fef[_0x1719('0x6')]];}}}catch(_0x2adfdb){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x1b'),_0xd90fef[_0x1719('0x6')]),_0x2adfdb);}};exports[_0x1719('0x24')]=function(_0x44e585){try{utils['debug'](util[_0x1719('0x4')](_0x1719('0x25'),_0x44e585[_0x1719('0x6')]),_0x44e585);if(!_[_0x1719('0x26')](_0x44e585[_0x1719('0x27')][_0x1719('0x28')])&&_0x44e585[_0x1719('0x29')][_0x1719('0x2a')]()!==_0x1719('0x2b')){if(!_[_0x1719('0x26')](queues[_0x44e585[_0x1719('0x6')]])){queues[_0x44e585[_0x1719('0x6')]][_0x1719('0x1d')]=![];queues[_0x44e585['uniqueid']]['queuecallerabandonAt']=null;queues[_0x44e585[_0x1719('0x6')]][_0x1719('0x1e')]=!![];queues[_0x44e585[_0x1719('0x6')]]['queuecallerexitAt']=utils[_0x1719('0x17')]();queues[_0x44e585[_0x1719('0x6')]][_0x1719('0xb')]=_0x44e585[_0x1719('0x29')][_0x1719('0x2a')]();utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x2c'),_0x44e585['uniqueid'],queues[_0x44e585[_0x1719('0x6')]]['name'],_0x44e585[_0x1719('0x29')],queues[_0x44e585[_0x1719('0x6')]][_0x1719('0xb')]));writeDB(queues[_0x44e585[_0x1719('0x6')]]);}}else if(!_[_0x1719('0x26')](_0x44e585[_0x1719('0x27')]['queueposition'])){if(!_[_0x1719('0x26')](queues[_0x44e585[_0x1719('0x6')]])&&!queues[_0x44e585['uniqueid']][_0x1719('0x1d')]){queues[_0x44e585[_0x1719('0x6')]]['queuecallerabandon']=![];queues[_0x44e585['uniqueid']][_0x1719('0x2d')]=null;queues[_0x44e585[_0x1719('0x6')]][_0x1719('0x1e')]=!![];queues[_0x44e585[_0x1719('0x6')]][_0x1719('0x2e')]=utils[_0x1719('0x17')]();queues[_0x44e585[_0x1719('0x6')]]['queuecallerexitreason']=_0x1719('0x2f');utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x30'),_0x44e585[_0x1719('0x6')],queues[_0x44e585['uniqueid']][_0x1719('0x21')],_0x44e585[_0x1719('0x29')],queues[_0x44e585['uniqueid']]['queuecallerexitreason']));}}}catch(_0x4baf1c){utils['error'](util['format'](_0x1719('0x25'),_0x44e585[_0x1719('0x6')]),_0x4baf1c);}};exports[_0x1719('0x1d')]=function(_0x3cb93c){try{if(!_[_0x1719('0x26')](queues[_0x3cb93c[_0x1719('0x6')]])){utils[_0x1719('0x14')](util['format'](_0x1719('0x31'),_0x3cb93c[_0x1719('0x6')]),_0x3cb93c);queues[_0x3cb93c[_0x1719('0x6')]][_0x1719('0x1e')]=![];queues[_0x3cb93c['uniqueid']][_0x1719('0x2e')]=null;queues[_0x3cb93c[_0x1719('0x6')]][_0x1719('0x1d')]=!![];queues[_0x3cb93c[_0x1719('0x6')]][_0x1719('0x2d')]=utils[_0x1719('0x17')]();queues[_0x3cb93c['uniqueid']][_0x1719('0xb')]=_0x1719('0x32');utils[_0x1719('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3cb93c[_0x1719('0x6')],queues[_0x3cb93c['uniqueid']][_0x1719('0x21')],queues[_0x3cb93c[_0x1719('0x6')]][_0x1719('0xb')]));}}catch(_0x45d1cf){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x31'),_0x3cb93c[_0x1719('0x6')]),_0x45d1cf);}};exports[_0x1719('0x33')]=function(_0x3befb3){try{if(!_['isNil'](queues[_0x3befb3[_0x1719('0x6')]])){utils[_0x1719('0x14')](util[_0x1719('0x4')](_0x1719('0x34'),_0x3befb3[_0x1719('0x6')]),_0x3befb3);utils[_0x1719('0x3')](util['format'](_0x1719('0x35'),_0x3befb3[_0x1719('0x6')],queues[_0x3befb3['uniqueid']]['name'],_0x3befb3[_0x1719('0x36')],_0x3befb3['connectedlinename']));queues[_0x3befb3[_0x1719('0x6')]][_0x1719('0x33')]=!![];queues[_0x3befb3[_0x1719('0x6')]][_0x1719('0x1c')]=utils[_0x1719('0x17')]();queues[_0x3befb3[_0x1719('0x6')]][_0x1719('0x37')]=utils[_0x1719('0x38')](queues[_0x3befb3[_0x1719('0x6')]]['queuecallerleaveAt'],queues[_0x3befb3[_0x1719('0x6')]][_0x1719('0x39')]);queues[_0x3befb3[_0x1719('0x6')]]['position']=_0x3befb3[_0x1719('0x15')];queues[_0x3befb3[_0x1719('0x6')]][_0x1719('0x3a')]=_0x3befb3[_0x1719('0x3a')];queues[_0x3befb3[_0x1719('0x6')]][_0x1719('0x36')]=_0x3befb3['connectedlinenum'];queues[_0x3befb3[_0x1719('0x6')]][_0x1719('0x3b')]=_0x3befb3['connectedlinename'];}}catch(_0x551082){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x34'),_0x3befb3[_0x1719('0x6')]),_0x551082);}};exports[_0x1719('0x3c')]=function(_0x278d0a){try{if(!_[_0x1719('0x26')](queues[_0x278d0a[_0x1719('0x6')]])){utils['debug'](util[_0x1719('0x4')](_0x1719('0x3d'),_0x278d0a[_0x1719('0x6')]),_0x278d0a);utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x3e'),_0x278d0a[_0x1719('0x6')],queues[_0x278d0a['uniqueid']]['name'],_0x278d0a[_0x1719('0x3f')],_0x278d0a[_0x1719('0x40')]));queues[_0x278d0a[_0x1719('0x6')]][_0x1719('0x1d')]=![];queues[_0x278d0a['uniqueid']]['queuecallerabandon']=![];queues[_0x278d0a['uniqueid']][_0x1719('0x2d')]=null;queues[_0x278d0a[_0x1719('0x6')]][_0x1719('0x1e')]=![];queues[_0x278d0a['uniqueid']]['queuecallerexitreason']=null;queues[_0x278d0a[_0x1719('0x6')]][_0x1719('0x2e')]=null;queues[_0x278d0a[_0x1719('0x6')]]['assigned']=!![];queues[_0x278d0a[_0x1719('0x6')]]['accountcode']=_0x278d0a[_0x1719('0x40')];queues[_0x278d0a['uniqueid']][_0x1719('0x8')]=_0x278d0a[_0x1719('0x3f')];}}catch(_0x48f4f0){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x3d'),_0x278d0a[_0x1719('0x6')]),_0x48f4f0);}};exports[_0x1719('0x41')]=function(_0x3c9654){try{if(!_[_0x1719('0x26')](queues[_0x3c9654[_0x1719('0x6')]])){if(queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x1c')]){utils[_0x1719('0x14')](util[_0x1719('0x4')]('[%s][queues][agentcomplete]',_0x3c9654['uniqueid']),_0x3c9654);queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x1d')]=![];queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x1d')]=![];queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x2d')]=null;queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x1e')]=![];queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x2e')]=null;queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x42')]=!![];queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x8')]=_0x3c9654[_0x1719('0x3f')];queues[_0x3c9654['uniqueid']][_0x1719('0x43')]=!![];queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x44')]=utils['now']();if(_0x3c9654[_0x1719('0x45')]==_0x1719('0x46')){if(!queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x46')]){queues[_0x3c9654['uniqueid']][_0x1719('0xb')]=_0x1719('0x47');}}else{queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0xb')]=_0x1719('0x48')+_0x3c9654[_0x1719('0x45')]['toUpperCase']();}utils[_0x1719('0x3')](util['format'](_0x1719('0x49'),_0x3c9654['uniqueid'],queues[_0x3c9654[_0x1719('0x6')]][_0x1719('0x21')],_0x3c9654[_0x1719('0x3f')],queues[_0x3c9654[_0x1719('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x3c9654[_0x1719('0x6')]]);}}}catch(_0x59314d){utils['error'](util[_0x1719('0x4')](_0x1719('0x4a'),_0x3c9654[_0x1719('0x6')]),_0x59314d);}};exports[_0x1719('0x4b')]=function(_0x20a698){try{if(!_[_0x1719('0x26')](queues[_0x20a698[_0x1719('0x4c')]])){utils[_0x1719('0x14')](util[_0x1719('0x4')](_0x1719('0x4d'),_0x20a698[_0x1719('0x6')]),_0x20a698);queues[_0x20a698[_0x1719('0x4c')]][_0x1719('0x46')]=!![];queues[_0x20a698[_0x1719('0x4c')]]['transfertype']='BLIND';queues[_0x20a698[_0x1719('0x4c')]][_0x1719('0x4e')]=_0x20a698[_0x1719('0x4f')];queues[_0x20a698[_0x1719('0x4c')]]['transferuniqueid']=_0x20a698[_0x1719('0x4c')];queues[_0x20a698[_0x1719('0x4c')]][_0x1719('0xb')]=_0x1719('0x50');utils[_0x1719('0x3')](util['format'](_0x1719('0x51'),_0x20a698[_0x1719('0x6')],queues[_0x20a698['transfereeuniqueid']][_0x1719('0x21')],_0x20a698[_0x1719('0x4c')],_0x20a698[_0x1719('0x4f')]));}}catch(_0x19c8a8){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x4d'),_0x20a698[_0x1719('0x6')]),_0x19c8a8);}};exports[_0x1719('0x52')]=function(_0x20e54f){try{utils['debug'](util[_0x1719('0x4')](_0x1719('0x53'),_0x20e54f[_0x1719('0x54')]),_0x20e54f);if(_0x20e54f[_0x1719('0x54')]==_0x20e54f[_0x1719('0x55')]){if(!_[_0x1719('0x26')](queues[_0x20e54f['secondtransfererlinkedid']])){utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x56'),_0x20e54f[_0x1719('0x54')],queues[_0x20e54f['secondtransfererlinkedid']][_0x1719('0x21')],_0x20e54f['origtransfererexten']));queues[_0x20e54f[_0x1719('0x57')]]['transfer']=!![];queues[_0x20e54f[_0x1719('0x57')]][_0x1719('0x58')]=_0x1719('0x59');queues[_0x20e54f['secondtransfererlinkedid']][_0x1719('0x4e')]=_0x20e54f['origtransfererexten'];queues[_0x20e54f[_0x1719('0x57')]]['transferuniqueid']=_0x20e54f['origtransfereruniqueid'];queues[_0x20e54f[_0x1719('0x57')]]['queuecallerexitreason']=_0x1719('0x5a');}if(!_[_0x1719('0x26')](queues[_0x20e54f[_0x1719('0x55')]])){if(_0x20e54f[_0x1719('0x5b')]&&queues[_0x20e54f[_0x1719('0x5b')]]){queues[_0x20e54f[_0x1719('0x5b')]][_0x1719('0x23')]=0x1;queues[_0x20e54f[_0x1719('0x4c')]]=_[_0x1719('0x5c')](queues[_0x20e54f['transfereelinkedid']]);queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x12')]=_0x20e54f[_0x1719('0x5d')];queues[_0x20e54f['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x20e54f[_0x1719('0x4c')]]['calleridnum']=queues[_0x20e54f[_0x1719('0x57')]][_0x1719('0x9')];queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x5e')]=queues[_0x20e54f[_0x1719('0x57')]][_0x1719('0x5e')];queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x39')]=utils[_0x1719('0x17')]();queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x1c')]=utils[_0x1719('0x17')]();queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x37')]=0x0;queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x5f')]=0x0;utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x60'),_0x20e54f[_0x1719('0x54')],queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x21')],queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x9')],queues[_0x20e54f[_0x1719('0x4c')]][_0x1719('0x5e')]));}else{utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x61'),_0x20e54f['origtransfereruniqueid'],queues[_0x20e54f['origtransfererlinkedid']][_0x1719('0x21')],_0x20e54f[_0x1719('0x57')]));queues[_0x20e54f[_0x1719('0x55')]][_0x1719('0x12')]=_0x20e54f[_0x1719('0x57')];}}}else if(_0x20e54f[_0x1719('0x62')]==_0x20e54f[_0x1719('0x57')]){if(!_[_0x1719('0x26')](queues[_0x20e54f[_0x1719('0x55')]])){utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x63'),_0x20e54f[_0x1719('0x54')],queues[_0x20e54f['origtransfererlinkedid']][_0x1719('0x21')],_0x20e54f[_0x1719('0x62')],_0x20e54f[_0x1719('0x64')]));queues[_0x20e54f[_0x1719('0x55')]][_0x1719('0x46')]=!![];queues[_0x20e54f[_0x1719('0x55')]][_0x1719('0x58')]=_0x1719('0x59');queues[_0x20e54f[_0x1719('0x55')]]['transferexten']=_0x20e54f[_0x1719('0x64')];queues[_0x20e54f['origtransfererlinkedid']]['transferuniqueid']=_0x20e54f['secondtransfereruniqueid'];queues[_0x20e54f['origtransfererlinkedid']]['queuecallerexitreason']=_0x1719('0x5a');}if(!_[_0x1719('0x26')](queues[_0x20e54f[_0x1719('0x57')]])){if(_0x20e54f[_0x1719('0x65')]&&queues[_0x20e54f['transfertargetlinkedid']]){queues[_0x20e54f[_0x1719('0x65')]][_0x1719('0x23')]=0x1;queues[_0x20e54f['transfertargetuniqueid']]=_[_0x1719('0x5c')](queues[_0x20e54f['transfertargetlinkedid']]);queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x12')]=_0x20e54f['transfertargetuniqueid'];queues[_0x20e54f[_0x1719('0x5d')]]['queuecallerenterreason']=0x2;queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x9')]=queues[_0x20e54f[_0x1719('0x55')]][_0x1719('0x9')];queues[_0x20e54f['transfertargetuniqueid']][_0x1719('0x5e')]=queues[_0x20e54f['origtransfererlinkedid']]['calleridname'];queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x39')]=utils[_0x1719('0x17')]();queues[_0x20e54f['transfertargetuniqueid']][_0x1719('0x1c')]=utils['now']();queues[_0x20e54f[_0x1719('0x5d')]]['holdtime']=0x0;queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x5f')]=0x0;utils[_0x1719('0x3')](util[_0x1719('0x4')](_0x1719('0x66'),_0x20e54f[_0x1719('0x54')],queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x21')],queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x12')],queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x9')],queues[_0x20e54f[_0x1719('0x5d')]][_0x1719('0x5e')]));}else{utils[_0x1719('0x3')](util['format'](_0x1719('0x61'),_0x20e54f[_0x1719('0x54')],queues[_0x20e54f['secondtransfererlinkedid']][_0x1719('0x21')],_0x20e54f[_0x1719('0x55')]));queues[_0x20e54f['secondtransfererlinkedid']][_0x1719('0x12')]=_0x20e54f[_0x1719('0x55')];}}}}catch(_0x473e4a){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x53'),_0x20e54f['origtransfereruniqueid']),_0x473e4a);}};exports[_0x1719('0x67')]=function(_0x1c5e93){try{if(!_[_0x1719('0x26')](queues[_0x1c5e93[_0x1719('0x6')]])){utils[_0x1719('0x14')](util[_0x1719('0x4')](_0x1719('0x68'),_0x1c5e93['uniqueid']),_0x1c5e93);queues[_0x1c5e93[_0x1719('0x6')]]['musiconholdstartAt']=utils[_0x1719('0x17')]();utils['info'](util[_0x1719('0x4')](_0x1719('0x69'),_0x1c5e93[_0x1719('0x6')],queues[_0x1c5e93[_0x1719('0x6')]][_0x1719('0x21')],queues[_0x1c5e93[_0x1719('0x6')]][_0x1719('0x6a')]));}}catch(_0x197215){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x68'),_0x1c5e93[_0x1719('0x6')]),_0x197215);}};exports['musiconholdstop']=function(_0x2cb686){try{if(!_[_0x1719('0x26')](queues[_0x2cb686[_0x1719('0x6')]])){if(!_[_0x1719('0x26')](queues[_0x2cb686[_0x1719('0x6')]][_0x1719('0x6a')])){utils[_0x1719('0x14')](util[_0x1719('0x4')](_0x1719('0x6b'),_0x2cb686['uniqueid']),_0x2cb686);queues[_0x2cb686['uniqueid']][_0x1719('0x5f')]+=utils[_0x1719('0x38')](utils[_0x1719('0x17')](),queues[_0x2cb686[_0x1719('0x6')]][_0x1719('0x6a')]);utils['info'](util['format'](_0x1719('0x6c'),_0x2cb686[_0x1719('0x6')],queues[_0x2cb686[_0x1719('0x6')]]['name'],queues[_0x2cb686[_0x1719('0x6')]][_0x1719('0x5f')]));delete queues[_0x2cb686[_0x1719('0x6')]][_0x1719('0x6a')];}}}catch(_0xaf22a3){utils[_0x1719('0x18')](util[_0x1719('0x4')](_0x1719('0x6b'),_0x2cb686['uniqueid']),_0xaf22a3);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 7205d82..09d76e1 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 _0x4a43=['monitors','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','util','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','debug','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find'];(function(_0x492c8f,_0x3c657a){var _0x47dabf=function(_0x52a6b9){while(--_0x52a6b9){_0x492c8f['push'](_0x492c8f['shift']());}};_0x47dabf(++_0x3c657a);}(_0x4a43,0x11e));var _0x34a4=function(_0x472ae8,_0x2a0fc7){_0x472ae8=_0x472ae8-0x0;var _0x48240f=_0x4a43[_0x472ae8];return _0x48240f;};'use strict';var _=require('lodash');var util=require(_0x34a4('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x45f7f4){utils['info'](util[_0x34a4('0x1')](_0x34a4('0x2'),_0x45f7f4[_0x34a4('0x3')]));if(_0x45f7f4['accountcode']){utils[_0x34a4('0x4')](_0x45f7f4[_0x34a4('0x5')])[_0x34a4('0x6')](function(_0x195fbb){if(_0x195fbb){_0x45f7f4[_0x34a4('0x7')]=_0x195fbb[_0x34a4('0x8')];_0x45f7f4[_0x34a4('0x9')]=_0x195fbb['id'];}utils[_0x34a4('0xa')](_0x34a4('0xb'),_0x45f7f4);});}else{utils[_0x34a4('0xa')]('CreateVoiceRecording',_0x45f7f4);}}exports[_0x34a4('0xc')]=function(_0x58cb84){try{utils['debug'](util[_0x34a4('0x1')](_0x34a4('0xd'),_0x58cb84['uniqueid']),_0x58cb84);if(_0x58cb84[_0x34a4('0x3')]==_0x58cb84[_0x34a4('0xe')]){utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x10'),_0x58cb84[_0x34a4('0x3')],_0x58cb84[_0x34a4('0x11')],_0x58cb84[_0x34a4('0x12')]));recordings[_0x58cb84[_0x34a4('0x3')]]={'uniqueid':_0x58cb84[_0x34a4('0x3')],'accountcode':_0x58cb84[_0x34a4('0x5')],'exten':_0x58cb84[_0x34a4('0x12')],'context':_0x58cb84['context'],'channel':_0x58cb84[_0x34a4('0x13')],'monitors':[]};}}catch(_0x1d136a){utils[_0x34a4('0x14')](util['format'](_0x34a4('0xd'),_0x58cb84['uniqueid']),_0x1d136a);}};exports[_0x34a4('0x15')]=function(_0x2bf4af){try{utils['debug'](util['format'](_0x34a4('0x16'),_0x2bf4af[_0x34a4('0x3')]),_0x2bf4af);if(!_['isNil'](recordings[_0x2bf4af[_0x34a4('0x3')]])&&_0x2bf4af['channelstate']==0x6){utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x17'),_0x2bf4af[_0x34a4('0x3')],_0x2bf4af[_0x34a4('0x11')],_0x2bf4af['channel']));}else if(!_[_0x34a4('0x18')](recordings[_0x2bf4af['linkedid']])&&_0x2bf4af[_0x34a4('0x19')]==0x6&&_0x2bf4af[_0x34a4('0x11')]!=_0x34a4('0x1a')){utils['info'](util[_0x34a4('0x1')](_0x34a4('0x1b'),_0x2bf4af['uniqueid'],_0x2bf4af[_0x34a4('0xe')],_0x2bf4af['context'],_0x2bf4af[_0x34a4('0x13')]));recordings[_0x2bf4af[_0x34a4('0xe')]]['accountcode']=_0x2bf4af[_0x34a4('0x5')];}}catch(_0x27b5dc){utils[_0x34a4('0x14')](util[_0x34a4('0x1')](_0x34a4('0x16'),_0x2bf4af[_0x34a4('0x3')]),_0x27b5dc);}};exports[_0x34a4('0x1c')]=function(_0x947182){try{if(!_[_0x34a4('0x18')](_0x947182[_0x34a4('0x1d')])&&!_[_0x34a4('0x18')](_0x947182[_0x34a4('0x1d')][_0x34a4('0x1e')])){utils[_0x34a4('0x1f')](util['format']('[%s][recordings][varset]',_0x947182[_0x34a4('0x3')]),_0x947182);utils['info'](util['format'](_0x34a4('0x20'),_0x947182['uniqueid'],_0x947182[_0x34a4('0x1d')],_0x947182[_0x34a4('0x21')]));if(_[_0x34a4('0x22')](_0x947182['value'],_0x34a4('0x23'))){_0x947182[_0x34a4('0x21')]=_0x947182[_0x34a4('0x21')][_0x34a4('0x24')](_0x34a4('0x23'),_0x34a4('0x25'));}if(recordings[_0x947182[_0x34a4('0xe')]]){var _0x7444fe=_[_0x34a4('0x26')](recordings[_0x947182[_0x34a4('0xe')]][_0x34a4('0x27')],{'value':_0x947182[_0x34a4('0x21')]});if(_[_0x34a4('0x18')](_0x7444fe)){recordings[_0x947182[_0x34a4('0xe')]][_0x34a4('0x27')]['push']({'value':_0x947182[_0x34a4('0x21')]});}}}}catch(_0x186858){utils[_0x34a4('0x14')](util['format'](_0x34a4('0x28'),_0x947182['uniqueid']),_0x186858);}};exports[_0x34a4('0x29')]=function(_0x2dc1bc){try{if(!_['isNil'](recordings[_0x2dc1bc[_0x34a4('0x3')]])){utils[_0x34a4('0x1f')](util[_0x34a4('0x1')]('[%s][recordings][hangup]',_0x2dc1bc[_0x34a4('0x3')]),_0x2dc1bc);utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x2a'),_0x2dc1bc['uniqueid'],_0x2dc1bc[_0x34a4('0x2b')],_0x2dc1bc[_0x34a4('0x2c')],_0x2dc1bc[_0x34a4('0x2d')]));recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2b')]=_0x2dc1bc[_0x34a4('0x2b')];recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2c')]=_0x2dc1bc[_0x34a4('0x2c')];recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2e')]=_0x2dc1bc[_0x34a4('0x2e')];recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2f')]=_0x2dc1bc[_0x34a4('0x2f')];if(recordings[_0x2dc1bc[_0x34a4('0x3')]]['type']==_0x34a4('0x30')&&recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x5')]){recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2e')]=recordings[_0x2dc1bc['uniqueid']]['accountcode'];recordings[_0x2dc1bc['uniqueid']][_0x34a4('0x2f')]='';}recordings[_0x2dc1bc[_0x34a4('0x3')]]['monitors'][_0x34a4('0x31')](function(_0x27741a){var _0x3f0c64=_[_0x34a4('0x32')](recordings[_0x2dc1bc[_0x34a4('0x3')]]);_0x3f0c64[_0x34a4('0x21')]=_0x27741a[_0x34a4('0x21')];writeDB(_0x3f0c64);});delete recordings[_0x2dc1bc[_0x34a4('0x3')]];}}catch(_0x5912d7){utils['error'](util['format'](_0x34a4('0x33'),_0x2dc1bc[_0x34a4('0x3')]),_0x5912d7);}};exports[_0x34a4('0x34')]=function(_0x3caa3a){try{if(!_[_0x34a4('0x18')](recordings[_0x3caa3a[_0x34a4('0x3')]])){utils['debug'](util[_0x34a4('0x1')](_0x34a4('0x35'),_0x3caa3a[_0x34a4('0x3')]),_0x3caa3a);utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x36'),_0x3caa3a[_0x34a4('0x3')],_0x3caa3a[_0x34a4('0x37')],_0x3caa3a[_0x34a4('0x38')]));if(_0x3caa3a[_0x34a4('0x37')]['toLowerCase']()=='set'&&_[_0x34a4('0x39')](_0x3caa3a[_0x34a4('0x38')][_0x34a4('0x3a')](),_0x34a4('0x3b'))){var _0x24c544=_0x3caa3a[_0x34a4('0x38')]['split']('=');var _0x2b1679=_0x24c544[0x0][_0x34a4('0x3c')](_0x24c544[0x0]['lastIndexOf']('(')+0x1,_0x24c544[0x0][_0x34a4('0x3d')](')'));var _0x2e14f0=_0x24c544[0x1];recordings[_0x3caa3a[_0x34a4('0x3')]][_0x2b1679]=_0x2e14f0;}}}catch(_0x3d70eb){utils[_0x34a4('0x14')](util[_0x34a4('0x1')]('[%s][recordings][newexten]',_0x3caa3a[_0x34a4('0x3')]),_0x3d70eb);}};exports[_0x34a4('0x3e')]=function(_0x5a16ba){try{if(!_[_0x34a4('0x18')](recordings[_0x5a16ba[_0x34a4('0x3')]])){utils[_0x34a4('0x1f')](util[_0x34a4('0x1')](_0x34a4('0x3f'),_0x5a16ba[_0x34a4('0x3')]),_0x5a16ba);utils['info'](util[_0x34a4('0x1')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x5a16ba[_0x34a4('0x3')],_0x5a16ba[_0x34a4('0x40')]));recordings[_0x5a16ba[_0x34a4('0x3')]][_0x34a4('0x40')]=_0x5a16ba[_0x34a4('0x40')];}}catch(_0x291f5c){utils[_0x34a4('0x14')](util[_0x34a4('0x1')](_0x34a4('0x3f'),_0x5a16ba[_0x34a4('0x3')]),_0x291f5c);}}; \ No newline at end of file +var _0xd7ec=['hangup','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','newexten','[%s][recordings][newexten]','application','toLowerCase','set','startsWith','cdr','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','request','CreateVoiceRecording','newchannel','debug','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0xd7ec,0x134));var _0xcd7e=function(_0x590963,_0x32a707){_0x590963=_0x590963-0x0;var _0x53a209=_0xd7ec[_0x590963];return _0x53a209;};'use strict';var _=require(_0xcd7e('0x0'));var util=require(_0xcd7e('0x1'));var utils=require(_0xcd7e('0x2'));var recordings={};function writeDB(_0x269301){utils[_0xcd7e('0x3')](util[_0xcd7e('0x4')](_0xcd7e('0x5'),_0x269301['uniqueid']));if(_0x269301[_0xcd7e('0x6')]){utils[_0xcd7e('0x7')](_0x269301[_0xcd7e('0x6')])[_0xcd7e('0x8')](function(_0x373bf0){if(_0x373bf0){_0x269301[_0xcd7e('0x9')]=_0x373bf0['name'];_0x269301['UserId']=_0x373bf0['id'];}utils[_0xcd7e('0xa')]('CreateVoiceRecording',_0x269301);});}else{utils[_0xcd7e('0xa')](_0xcd7e('0xb'),_0x269301);}}exports[_0xcd7e('0xc')]=function(_0x15f6c){try{utils[_0xcd7e('0xd')](util[_0xcd7e('0x4')]('[%s][recordings][newchannel]',_0x15f6c[_0xcd7e('0xe')]),_0x15f6c);if(_0x15f6c[_0xcd7e('0xe')]==_0x15f6c['linkedid']){utils[_0xcd7e('0x3')](util[_0xcd7e('0x4')](_0xcd7e('0xf'),_0x15f6c[_0xcd7e('0xe')],_0x15f6c[_0xcd7e('0x10')],_0x15f6c[_0xcd7e('0x11')]));recordings[_0x15f6c['uniqueid']]={'uniqueid':_0x15f6c[_0xcd7e('0xe')],'accountcode':_0x15f6c[_0xcd7e('0x6')],'exten':_0x15f6c[_0xcd7e('0x11')],'context':_0x15f6c['context'],'channel':_0x15f6c[_0xcd7e('0x12')],'monitors':[]};}}catch(_0x4cfd38){utils[_0xcd7e('0x13')](util[_0xcd7e('0x4')](_0xcd7e('0x14'),_0x15f6c[_0xcd7e('0xe')]),_0x4cfd38);}};exports[_0xcd7e('0x15')]=function(_0x4ed983){try{utils[_0xcd7e('0xd')](util[_0xcd7e('0x4')](_0xcd7e('0x16'),_0x4ed983[_0xcd7e('0xe')]),_0x4ed983);if(!_[_0xcd7e('0x17')](recordings[_0x4ed983['uniqueid']])&&_0x4ed983[_0xcd7e('0x18')]==0x6){utils[_0xcd7e('0x3')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4ed983[_0xcd7e('0xe')],_0x4ed983[_0xcd7e('0x10')],_0x4ed983[_0xcd7e('0x12')]));}else if(!_[_0xcd7e('0x17')](recordings[_0x4ed983['linkedid']])&&_0x4ed983['channelstate']==0x6&&_0x4ed983['context']!='transfer'){utils[_0xcd7e('0x3')](util[_0xcd7e('0x4')](_0xcd7e('0x19'),_0x4ed983[_0xcd7e('0xe')],_0x4ed983[_0xcd7e('0x1a')],_0x4ed983[_0xcd7e('0x10')],_0x4ed983[_0xcd7e('0x12')]));recordings[_0x4ed983[_0xcd7e('0x1a')]][_0xcd7e('0x6')]=_0x4ed983[_0xcd7e('0x6')];}}catch(_0x370101){utils[_0xcd7e('0x13')](util[_0xcd7e('0x4')](_0xcd7e('0x16'),_0x4ed983[_0xcd7e('0xe')]),_0x370101);}};exports[_0xcd7e('0x1b')]=function(_0x30c1a3){try{if(!_[_0xcd7e('0x17')](_0x30c1a3[_0xcd7e('0x1c')])&&!_['isNil'](_0x30c1a3[_0xcd7e('0x1c')][_0xcd7e('0x1d')])){utils[_0xcd7e('0xd')](util['format'](_0xcd7e('0x1e'),_0x30c1a3[_0xcd7e('0xe')]),_0x30c1a3);utils['info'](util[_0xcd7e('0x4')](_0xcd7e('0x1f'),_0x30c1a3[_0xcd7e('0xe')],_0x30c1a3[_0xcd7e('0x1c')],_0x30c1a3[_0xcd7e('0x20')]));if(_[_0xcd7e('0x21')](_0x30c1a3[_0xcd7e('0x20')],_0xcd7e('0x22'))){_0x30c1a3[_0xcd7e('0x20')]=_0x30c1a3[_0xcd7e('0x20')][_0xcd7e('0x23')]('.wav49',_0xcd7e('0x24'));}if(recordings[_0x30c1a3['linkedid']]){var _0x47cd7d=_[_0xcd7e('0x25')](recordings[_0x30c1a3['linkedid']][_0xcd7e('0x26')],{'value':_0x30c1a3[_0xcd7e('0x20')]});if(_[_0xcd7e('0x17')](_0x47cd7d)){recordings[_0x30c1a3['linkedid']][_0xcd7e('0x26')][_0xcd7e('0x27')]({'value':_0x30c1a3[_0xcd7e('0x20')]});}}}}catch(_0x222d65){utils[_0xcd7e('0x13')](util[_0xcd7e('0x4')](_0xcd7e('0x1e'),_0x30c1a3[_0xcd7e('0xe')]),_0x222d65);}};exports[_0xcd7e('0x28')]=function(_0x53a361){try{if(!_['isNil'](recordings[_0x53a361['uniqueid']])){utils[_0xcd7e('0xd')](util[_0xcd7e('0x4')]('[%s][recordings][hangup]',_0x53a361[_0xcd7e('0xe')]),_0x53a361);utils[_0xcd7e('0x3')](util[_0xcd7e('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x53a361[_0xcd7e('0xe')],_0x53a361[_0xcd7e('0x29')],_0x53a361[_0xcd7e('0x2a')],_0x53a361[_0xcd7e('0x2b')]));recordings[_0x53a361[_0xcd7e('0xe')]]['calleridnum']=_0x53a361['calleridnum'];recordings[_0x53a361[_0xcd7e('0xe')]][_0xcd7e('0x2a')]=_0x53a361['calleridname'];recordings[_0x53a361['uniqueid']]['connectedlinenum']=_0x53a361[_0xcd7e('0x2c')];recordings[_0x53a361[_0xcd7e('0xe')]][_0xcd7e('0x2d')]=_0x53a361[_0xcd7e('0x2d')];if(recordings[_0x53a361['uniqueid']][_0xcd7e('0x2e')]=='outbound'&&recordings[_0x53a361[_0xcd7e('0xe')]]['accountcode']){recordings[_0x53a361[_0xcd7e('0xe')]][_0xcd7e('0x2c')]=recordings[_0x53a361[_0xcd7e('0xe')]][_0xcd7e('0x6')];recordings[_0x53a361[_0xcd7e('0xe')]][_0xcd7e('0x2d')]='';}recordings[_0x53a361['uniqueid']][_0xcd7e('0x26')]['forEach'](function(_0x4d30f5){var _0x29b095=_[_0xcd7e('0x2f')](recordings[_0x53a361['uniqueid']]);_0x29b095[_0xcd7e('0x20')]=_0x4d30f5[_0xcd7e('0x20')];writeDB(_0x29b095);});delete recordings[_0x53a361['uniqueid']];}}catch(_0x2e8f06){utils[_0xcd7e('0x13')](util[_0xcd7e('0x4')]('[%s][recordings][hangup]',_0x53a361[_0xcd7e('0xe')]),_0x2e8f06);}};exports[_0xcd7e('0x30')]=function(_0x23342f){try{if(!_[_0xcd7e('0x17')](recordings[_0x23342f[_0xcd7e('0xe')]])){utils[_0xcd7e('0xd')](util['format'](_0xcd7e('0x31'),_0x23342f[_0xcd7e('0xe')]),_0x23342f);utils[_0xcd7e('0x3')](util[_0xcd7e('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x23342f[_0xcd7e('0xe')],_0x23342f[_0xcd7e('0x32')],_0x23342f['appdata']));if(_0x23342f['application'][_0xcd7e('0x33')]()==_0xcd7e('0x34')&&_[_0xcd7e('0x35')](_0x23342f['appdata'][_0xcd7e('0x33')](),_0xcd7e('0x36'))){var _0x34775b=_0x23342f['appdata']['split']('=');var _0x57b62e=_0x34775b[0x0]['substring'](_0x34775b[0x0][_0xcd7e('0x37')]('(')+0x1,_0x34775b[0x0][_0xcd7e('0x37')](')'));var _0x4c7cb2=_0x34775b[0x1];recordings[_0x23342f[_0xcd7e('0xe')]][_0x57b62e]=_0x4c7cb2;}}}catch(_0x3e674a){utils[_0xcd7e('0x13')](util[_0xcd7e('0x4')](_0xcd7e('0x31'),_0x23342f[_0xcd7e('0xe')]),_0x3e674a);}};exports['queuecallerjoin']=function(_0x34a5b1){try{if(!_[_0xcd7e('0x17')](recordings[_0x34a5b1[_0xcd7e('0xe')]])){utils['debug'](util['format'](_0xcd7e('0x38'),_0x34a5b1[_0xcd7e('0xe')]),_0x34a5b1);utils[_0xcd7e('0x3')](util[_0xcd7e('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x34a5b1['uniqueid'],_0x34a5b1['queue']));recordings[_0x34a5b1[_0xcd7e('0xe')]]['queue']=_0x34a5b1[_0xcd7e('0x39')];}}catch(_0x2da872){utils[_0xcd7e('0x13')](util[_0xcd7e('0x4')](_0xcd7e('0x38'),_0x34a5b1[_0xcd7e('0xe')]),_0x2da872);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index d53bdb4..363d0ca 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 _0x8bc1=['attended','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten'];(function(_0x5342f2,_0x5df717){var _0xa1f29c=function(_0x18b4e6){while(--_0x18b4e6){_0x5342f2['push'](_0x5342f2['shift']());}};_0xa1f29c(++_0x5df717);}(_0x8bc1,0x11a));var _0x18bc=function(_0x364103,_0x1afd7a){_0x364103=_0x364103-0x0;var _0x3017b3=_0x8bc1[_0x364103];return _0x3017b3;};'use strict';var _=require(_0x18bc('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x5c8a0a){utils[_0x18bc('0x1')](util[_0x18bc('0x2')](_0x18bc('0x3'),_0x5c8a0a[_0x18bc('0x4')]==='attended'?_0x5c8a0a[_0x18bc('0x5')]:_0x5c8a0a[_0x18bc('0x6')],_0x5c8a0a[_0x18bc('0x4')]));utils[_0x18bc('0x7')](_0x18bc('0x8'),_0x5c8a0a);}exports[_0x18bc('0x9')]={};exports[_0x18bc('0xa')]=function(_0x2132ce){try{utils[_0x18bc('0xb')](util['format'](_0x18bc('0xc'),_0x2132ce['uniqueid']),_0x2132ce);utils['info'](util[_0x18bc('0x2')](_0x18bc('0xd'),_0x2132ce[_0x18bc('0x6')],_0x2132ce[_0x18bc('0xe')],_0x2132ce[_0x18bc('0xf')],_0x2132ce['transfereecalleridnum'],_0x2132ce[_0x18bc('0x10')]));_0x2132ce[_0x18bc('0x4')]=_0x18bc('0x11');exports[_0x18bc('0x9')][_0x2132ce['transfereruniqueid']]=_0x2132ce;writeDB(_0x2132ce);}catch(_0x69c71f){utils[_0x18bc('0x12')](util[_0x18bc('0x2')](_0x18bc('0xc'),_0x2132ce[_0x18bc('0x6')]),_0x69c71f);}};exports['attendedtransfer']=function(_0x98892){try{utils['debug'](util['format'](_0x18bc('0x13'),_0x98892[_0x18bc('0x5')]),_0x98892);utils[_0x18bc('0x1')](util[_0x18bc('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x98892[_0x18bc('0x5')],_0x98892['origtransferercalleridnum'],_0x98892[_0x18bc('0x14')],_0x98892[_0x18bc('0x15')],_0x98892[_0x18bc('0x16')]));_0x98892=_[_0x18bc('0x17')](_0x98892,{'transfererchannel':_0x98892['origtransfererchannel'],'transferercalleridnum':_0x98892[_0x18bc('0x18')],'transferercalleridname':_0x98892[_0x18bc('0x14')],'transfererconnectedlinenum':_0x98892[_0x18bc('0x19')],'transfererconnectedlinename':_0x98892['secondtransfererconnectedlinename'],'transfereraccountcode':_0x98892['origtransfereraccountcode'],'transferercontext':_0x98892[_0x18bc('0x1a')],'transfererexten':_0x98892['secondtransfererexten'],'transfererlinkedid':_0x98892[_0x18bc('0x1b')],'context':_0x98892[_0x18bc('0x1c')],'extension':_0x98892[_0x18bc('0x1d')],'type':_0x18bc('0x1e')});if(_['isNil'](_0x98892[_0x18bc('0x1f')])){_0x98892=_['assign'](_0x98892,{'transfereechannel':_0x98892[_0x18bc('0x20')],'transfereecalleridnum':_0x98892[_0x18bc('0x15')],'transfereecalleridname':_0x98892['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x98892[_0x18bc('0x21')],'transfereeconnectedlinename':_0x98892[_0x18bc('0x22')],'transfereeaccountcode':_0x98892[_0x18bc('0x23')],'transfereecontext':_0x98892[_0x18bc('0x24')],'transfereeexten':_0x98892[_0x18bc('0x25')],'transfereelinkedid':_0x98892[_0x18bc('0x26')]});}writeDB(_0x98892);}catch(_0x6b06b4){utils[_0x18bc('0x12')](util[_0x18bc('0x2')](_0x18bc('0x13'),_0x98892['origtransfereruniqueid']),_0x6b06b4);}}; \ No newline at end of file +var _0x7a89=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x1ebc6c,_0x58a00b){var _0x3a826d=function(_0x27d7eb){while(--_0x27d7eb){_0x1ebc6c['push'](_0x1ebc6c['shift']());}};_0x3a826d(++_0x58a00b);}(_0x7a89,0x16b));var _0x97a8=function(_0x4bdda0,_0x2dd23d){_0x4bdda0=_0x4bdda0-0x0;var _0x2d3f4e=_0x7a89[_0x4bdda0];return _0x2d3f4e;};'use strict';var _=require(_0x97a8('0x0'));var util=require(_0x97a8('0x1'));var utils=require(_0x97a8('0x2'));function writeDB(_0x36794a){utils[_0x97a8('0x3')](util[_0x97a8('0x4')](_0x97a8('0x5'),_0x36794a[_0x97a8('0x6')]==='attended'?_0x36794a[_0x97a8('0x7')]:_0x36794a[_0x97a8('0x8')],_0x36794a['type']));utils['request'](_0x97a8('0x9'),_0x36794a);}exports[_0x97a8('0xa')]={};exports[_0x97a8('0xb')]=function(_0x374cb9){try{utils[_0x97a8('0xc')](util['format']('[%s][transfers][blindtransfer]',_0x374cb9[_0x97a8('0x8')]),_0x374cb9);utils[_0x97a8('0x3')](util[_0x97a8('0x4')](_0x97a8('0xd'),_0x374cb9[_0x97a8('0x8')],_0x374cb9[_0x97a8('0xe')],_0x374cb9['transferercalleridname'],_0x374cb9[_0x97a8('0xf')],_0x374cb9[_0x97a8('0x10')]));_0x374cb9[_0x97a8('0x6')]=_0x97a8('0x11');exports[_0x97a8('0xa')][_0x374cb9[_0x97a8('0x12')]]=_0x374cb9;writeDB(_0x374cb9);}catch(_0x5ee3a2){utils[_0x97a8('0x13')](util[_0x97a8('0x4')](_0x97a8('0x14'),_0x374cb9[_0x97a8('0x8')]),_0x5ee3a2);}};exports[_0x97a8('0x15')]=function(_0x7871d4){try{utils['debug'](util[_0x97a8('0x4')](_0x97a8('0x16'),_0x7871d4[_0x97a8('0x7')]),_0x7871d4);utils['info'](util[_0x97a8('0x4')](_0x97a8('0x17'),_0x7871d4[_0x97a8('0x7')],_0x7871d4[_0x97a8('0x18')],_0x7871d4['origtransferercalleridname'],_0x7871d4[_0x97a8('0x19')],_0x7871d4['transfertargetcalleridname']));_0x7871d4=_['assign'](_0x7871d4,{'transfererchannel':_0x7871d4[_0x97a8('0x1a')],'transferercalleridnum':_0x7871d4[_0x97a8('0x18')],'transferercalleridname':_0x7871d4[_0x97a8('0x1b')],'transfererconnectedlinenum':_0x7871d4[_0x97a8('0x1c')],'transfererconnectedlinename':_0x7871d4[_0x97a8('0x1d')],'transfereraccountcode':_0x7871d4[_0x97a8('0x1e')],'transferercontext':_0x7871d4[_0x97a8('0x1f')],'transfererexten':_0x7871d4[_0x97a8('0x20')],'transfererlinkedid':_0x7871d4[_0x97a8('0x21')],'context':_0x7871d4['origtransferercontext'],'extension':_0x7871d4[_0x97a8('0x22')],'type':'attended'});if(_['isNil'](_0x7871d4[_0x97a8('0x23')])){_0x7871d4=_[_0x97a8('0x24')](_0x7871d4,{'transfereechannel':_0x7871d4[_0x97a8('0x25')],'transfereecalleridnum':_0x7871d4['transfertargetcalleridnum'],'transfereecalleridname':_0x7871d4[_0x97a8('0x26')],'transfereeconnectedlinenum':_0x7871d4[_0x97a8('0x27')],'transfereeconnectedlinename':_0x7871d4[_0x97a8('0x28')],'transfereeaccountcode':_0x7871d4[_0x97a8('0x29')],'transfereecontext':_0x7871d4[_0x97a8('0x2a')],'transfereeexten':_0x7871d4[_0x97a8('0x2b')],'transfereelinkedid':_0x7871d4[_0x97a8('0x2c')]});}writeDB(_0x7871d4);}catch(_0x30e04c){utils['error'](util[_0x97a8('0x4')](_0x97a8('0x16'),_0x7871d4[_0x97a8('0x7')]),_0x30e04c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index e168355..4f779c5 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 _0xbc6b=['sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','length','add','YYYY-MM-DD\x20HH:mm:ss','subtract','format','diffTime'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xbc6b,0x14b));var _0xbbc6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbc6b[_0x126558];return _0x1f6d14;};'use strict';var BPromise=require(_0xbbc6('0x0'));var jayson=require(_0xbbc6('0x1'));var moment=require(_0xbbc6('0x2'));var util=require('util');var client=jayson[_0xbbc6('0x3')][_0xbbc6('0x4')]({'port':0x2329});var logger=require(_0xbbc6('0x5'))(_0xbbc6('0x6'));exports['info']=function(_0x2815c4,_0x3c385a){logger[_0xbbc6('0x7')](_0x2815c4,_0x3c385a?util[_0xbbc6('0x8')](_0x3c385a,{'showHidden':![],'depth':null}):'');};exports[_0xbbc6('0x9')]=function(_0x5bf6ef,_0x5b915c){logger[_0xbbc6('0x9')](_0x5bf6ef,_0x5b915c?util[_0xbbc6('0x8')](_0x5b915c,{'showHidden':![],'depth':null}):'');};exports[_0xbbc6('0xa')]=function(_0x295ce0,_0x2de381){logger['error'](_0x295ce0,_0x2de381?util['inspect'](_0x2de381,{'showHidden':![],'depth':null}):'');};exports[_0xbbc6('0xb')]=function(_0x287f19,_0x42704e){return client['request'](_0x287f19,{'body':_0x42704e})[_0xbbc6('0xc')](function(_0x2cde3e){logger[_0xbbc6('0x9')](_0xbbc6('0xd'),_0x287f19,_0x2cde3e?util[_0xbbc6('0x8')](_0x2cde3e,{'showHidden':![],'depth':null}):'');})[_0xbbc6('0xe')](function(_0x33435b){logger[_0xbbc6('0xa')](_0xbbc6('0xd'),_0x287f19,_0x33435b?util[_0xbbc6('0x8')](_0x33435b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2c90e8){return client[_0xbbc6('0xb')](_0xbbc6('0xf'),{'options':{'raw':!![],'attributes':['id',_0xbbc6('0x10'),_0xbbc6('0x11'),_0xbbc6('0x12')],'where':_0x2c90e8,'limit':0x1}})[_0xbbc6('0xc')](function(_0x4be420){logger[_0xbbc6('0x9')](_0xbbc6('0x13'),JSON['stringify'](_0x2c90e8),_0x4be420?util[_0xbbc6('0x8')](_0x4be420,{'showHidden':![],'depth':null}):'');return _0x4be420[_0xbbc6('0x14')]['length']?_0x4be420[_0xbbc6('0x14')][0x0]:null;});}exports['getUserByInternal']=function(_0xd1f3ff){return new BPromise(function(_0x3c5c65,_0x27e668){if(_0xd1f3ff){return getUser({'internal':_0xd1f3ff})[_0xbbc6('0xc')](function(_0x4c311d){logger[_0xbbc6('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xd1f3ff,_0x4c311d?'found':_0xbbc6('0x15'));return _0x3c5c65(_0x4c311d);})[_0xbbc6('0xe')](function(_0x2abf23){logger['error']('[utils][getUserByInternal]',_0x2abf23?util[_0xbbc6('0x8')](_0x2abf23,{'showHidden':![],'depth':null}):'');return _0x3c5c65(null);});}return _0x3c5c65(null);});};exports[_0xbbc6('0x16')]=function(_0x4d0d12){return new BPromise(function(_0x5835a0,_0x235e64){if(_0x4d0d12){return getUser({'interface':_0x4d0d12})[_0xbbc6('0xc')](function(_0x587be5){logger[_0xbbc6('0x7')](_0xbbc6('0x17'),_0x4d0d12,_0x587be5?_0xbbc6('0x18'):_0xbbc6('0x15'));return _0x5835a0(_0x587be5);})['catch'](function(_0x246f95){logger['error'](_0xbbc6('0x19'),_0x246f95?util[_0xbbc6('0x8')](_0x246f95,{'showHidden':![],'depth':null}):'');return _0x5835a0(null);});}return _0x5835a0(null);});};exports['getUserByName']=function(_0x224009){return new BPromise(function(_0x570159,_0x2664f8){if(_0x224009){return getUser({'name':_0x224009})[_0xbbc6('0xc')](function(_0x231900){logger[_0xbbc6('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x224009,_0x231900?_0xbbc6('0x18'):'notfound');return _0x570159(_0x231900);})[_0xbbc6('0xe')](function(_0x8c33ab){logger[_0xbbc6('0xa')]('[utils][getUserByName]',_0x8c33ab?util[_0xbbc6('0x8')](_0x8c33ab,{'showHidden':![],'depth':null}):'');return _0x570159(null);});}return _0x570159(null);});};exports[_0xbbc6('0x1a')]=function(_0x3ac34d){return new BPromise(function(_0x343f92,_0x14d7d5){if(_0x3ac34d){return client[_0xbbc6('0xb')](_0xbbc6('0x1b'),{'options':{'raw':!![],'attributes':['id','name',_0xbbc6('0x1c'),_0xbbc6('0x1d'),_0xbbc6('0x1e')],'where':{'name':_0x3ac34d},'limit':0x1}})[_0xbbc6('0xc')](function(_0x5cae47){logger['debug'](_0xbbc6('0x1f'),_0x3ac34d,_0x5cae47?util[_0xbbc6('0x8')](_0x5cae47,{'showHidden':![],'depth':null}):'');logger[_0xbbc6('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x3ac34d,_0x5cae47?'found':_0xbbc6('0x15'));return _0x343f92(_0x5cae47[_0xbbc6('0x14')][_0xbbc6('0x20')]?_0x5cae47[_0xbbc6('0x14')][0x0]:null);})[_0xbbc6('0xe')](function(_0x24d2c1){logger[_0xbbc6('0xa')]('[utils][getVoiceQueueByName]',_0x24d2c1?util[_0xbbc6('0x8')](_0x24d2c1,{'showHidden':![],'depth':null}):'');return _0x343f92(null);});}return _0x343f92(null);});};exports['addTime']=function(_0x3530e7,_0x525ef0){return moment(_0x3530e7)[_0xbbc6('0x21')](_0x525ef0,'seconds')['format'](_0xbbc6('0x22'));};exports['subtractTime']=function(_0x8acff5,_0x57f888){return moment(_0x8acff5)[_0xbbc6('0x23')](_0x57f888,'seconds')[_0xbbc6('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xbbc6('0x25')]=function(_0x4a0b76,_0x57c89c){return moment(_0x4a0b76)['diff'](moment(_0x57c89c),'seconds');};exports[_0xbbc6('0x26')]=function(_0xb21bc9,_0x1bb104){return parseInt(_0xb21bc9,0xa)+parseInt(_0x1bb104,0xa);};exports['now']=function(){return moment()[_0xbbc6('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x3e43f9,_0x46ac49){if(_0x46ac49){return moment(_0x3e43f9)[_0xbbc6('0x27')](_0x46ac49);}return!![];};exports[_0xbbc6('0x28')]=function(_0x1a71ff,_0xf9fb74){if(_0xf9fb74){return moment(_0x1a71ff)[_0xbbc6('0x28')](_0xf9fb74);}else if(_0x1a71ff){return!![];}return![];}; \ No newline at end of file +var _0x2cf4=['diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','client','../../config/logger','xdr','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','request','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x2cf4,0xea));var _0x42cf=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x2cf4[_0x2212d1];return _0x15eec5;};'use strict';var BPromise=require(_0x42cf('0x0'));var jayson=require(_0x42cf('0x1'));var moment=require('moment');var util=require('util');var client=jayson[_0x42cf('0x2')]['http']({'port':0x2329});var logger=require(_0x42cf('0x3'))(_0x42cf('0x4'));exports[_0x42cf('0x5')]=function(_0x31bf16,_0x2f9e43){logger['info'](_0x31bf16,_0x2f9e43?util[_0x42cf('0x6')](_0x2f9e43,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4881db,_0x1c2c6a){logger[_0x42cf('0x7')](_0x4881db,_0x1c2c6a?util[_0x42cf('0x6')](_0x1c2c6a,{'showHidden':![],'depth':null}):'');};exports[_0x42cf('0x8')]=function(_0x37ea8c,_0x1df050){logger[_0x42cf('0x8')](_0x37ea8c,_0x1df050?util['inspect'](_0x1df050,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4102e0,_0x28c848){return client['request'](_0x4102e0,{'body':_0x28c848})[_0x42cf('0x9')](function(_0x4a6413){logger[_0x42cf('0x7')](_0x42cf('0xa'),_0x4102e0,_0x4a6413?util[_0x42cf('0x6')](_0x4a6413,{'showHidden':![],'depth':null}):'');})[_0x42cf('0xb')](function(_0x4d5ceb){logger[_0x42cf('0x8')]('[utils][request]\x20name:%s',_0x4102e0,_0x4d5ceb?util['inspect'](_0x4d5ceb,{'showHidden':![],'depth':null}):'');});};function getUser(_0x533944){return client[_0x42cf('0xc')](_0x42cf('0xd'),{'options':{'raw':!![],'attributes':['id',_0x42cf('0xe'),_0x42cf('0xf'),_0x42cf('0x10')],'where':_0x533944,'limit':0x1}})[_0x42cf('0x9')](function(_0x5587e2){logger[_0x42cf('0x7')](_0x42cf('0x11'),JSON[_0x42cf('0x12')](_0x533944),_0x5587e2?util['inspect'](_0x5587e2,{'showHidden':![],'depth':null}):'');return _0x5587e2[_0x42cf('0x13')][_0x42cf('0x14')]?_0x5587e2[_0x42cf('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x1e455d){return new BPromise(function(_0x3179e7,_0x2e197b){if(_0x1e455d){return getUser({'internal':_0x1e455d})[_0x42cf('0x9')](function(_0x14085b){logger[_0x42cf('0x5')](_0x42cf('0x15'),_0x1e455d,_0x14085b?_0x42cf('0x16'):_0x42cf('0x17'));return _0x3179e7(_0x14085b);})[_0x42cf('0xb')](function(_0x341166){logger[_0x42cf('0x8')]('[utils][getUserByInternal]',_0x341166?util[_0x42cf('0x6')](_0x341166,{'showHidden':![],'depth':null}):'');return _0x3179e7(null);});}return _0x3179e7(null);});};exports[_0x42cf('0x18')]=function(_0x1d835e){return new BPromise(function(_0x5e222a,_0x364735){if(_0x1d835e){return getUser({'interface':_0x1d835e})[_0x42cf('0x9')](function(_0xd1408c){logger[_0x42cf('0x5')](_0x42cf('0x19'),_0x1d835e,_0xd1408c?_0x42cf('0x16'):_0x42cf('0x17'));return _0x5e222a(_0xd1408c);})[_0x42cf('0xb')](function(_0x21d765){logger[_0x42cf('0x8')](_0x42cf('0x1a'),_0x21d765?util[_0x42cf('0x6')](_0x21d765,{'showHidden':![],'depth':null}):'');return _0x5e222a(null);});}return _0x5e222a(null);});};exports[_0x42cf('0x1b')]=function(_0x171b00){return new BPromise(function(_0x3c9626,_0x560d40){if(_0x171b00){return getUser({'name':_0x171b00})[_0x42cf('0x9')](function(_0x2b2524){logger[_0x42cf('0x5')](_0x42cf('0x1c'),_0x171b00,_0x2b2524?_0x42cf('0x16'):'notfound');return _0x3c9626(_0x2b2524);})['catch'](function(_0x4c5392){logger[_0x42cf('0x8')](_0x42cf('0x1d'),_0x4c5392?util[_0x42cf('0x6')](_0x4c5392,{'showHidden':![],'depth':null}):'');return _0x3c9626(null);});}return _0x3c9626(null);});};exports[_0x42cf('0x1e')]=function(_0x22f9bc){return new BPromise(function(_0x2d2c31,_0x36c95d){if(_0x22f9bc){return client['request'](_0x42cf('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x42cf('0xf'),_0x42cf('0x20'),_0x42cf('0x21'),'acwTimeout'],'where':{'name':_0x22f9bc},'limit':0x1}})[_0x42cf('0x9')](function(_0x461e84){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x22f9bc,_0x461e84?util[_0x42cf('0x6')](_0x461e84,{'showHidden':![],'depth':null}):'');logger[_0x42cf('0x5')](_0x42cf('0x22'),_0x22f9bc,_0x461e84?_0x42cf('0x16'):_0x42cf('0x17'));return _0x2d2c31(_0x461e84[_0x42cf('0x13')][_0x42cf('0x14')]?_0x461e84[_0x42cf('0x13')][0x0]:null);})[_0x42cf('0xb')](function(_0x3c3521){logger[_0x42cf('0x8')](_0x42cf('0x23'),_0x3c3521?util[_0x42cf('0x6')](_0x3c3521,{'showHidden':![],'depth':null}):'');return _0x2d2c31(null);});}return _0x2d2c31(null);});};exports[_0x42cf('0x24')]=function(_0x4b7f67,_0x2c5dc0){return moment(_0x4b7f67)['add'](_0x2c5dc0,_0x42cf('0x25'))[_0x42cf('0x26')](_0x42cf('0x27'));};exports[_0x42cf('0x28')]=function(_0x2d8dee,_0x4447a1){return moment(_0x2d8dee)['subtract'](_0x4447a1,_0x42cf('0x25'))[_0x42cf('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x42cf('0x29')]=function(_0x3182ff,_0x28e1be){return moment(_0x3182ff)[_0x42cf('0x2a')](moment(_0x28e1be),_0x42cf('0x25'));};exports[_0x42cf('0x2b')]=function(_0x31a692,_0xeb1046){return parseInt(_0x31a692,0xa)+parseInt(_0xeb1046,0xa);};exports['now']=function(){return moment()[_0x42cf('0x26')](_0x42cf('0x27'));};exports[_0x42cf('0x2c')]=function(_0x3cdc94,_0x5496a3){if(_0x5496a3){return moment(_0x3cdc94)[_0x42cf('0x2c')](_0x5496a3);}return!![];};exports[_0x42cf('0x2d')]=function(_0x5e62da,_0x70f2af){if(_0x70f2af){return moment(_0x5e62da)[_0x42cf('0x2d')](_0x70f2af);}else if(_0x5e62da){return!![];}return![];}; \ No newline at end of file